From e6e256f9be1823e021984f708fa70a552ffc5c52 Mon Sep 17 00:00:00 2001 From: Duane Nykamp Date: Tue, 15 Aug 2023 16:23:46 -0500 Subject: [PATCH] Refactor copies and composites (#2316) * working toward phasing out copy - macros and copies behave the same way - combine plain macro and plain copy attributes into implicit prop attribute - if no prop, name applies to replacement (no assignNames) - if prop, still applies to copy, use assignNames for pieces * the ability to copy componentIndex from non-standard composites * updateValue, animateFromSequence handle target subnames and subnames component index * Actions always await performUpdate and similar * render composite replacements with commas * assignNames, componentIndex skip only blank children * correctly copy with no-link copies of a prop * aslist attribute for additional composites --- .../singlepageActivities.cy.js | 6 +- .../answerValidation/errorinnumbers.cy.js | 54 +- .../answerValidation/pointlocation.cy.js | 284 +- .../answerValidation/symbolicequality.cy.js | 32 +- .../answerValidation/videoProgress.cy.js | 4 +- .../e2e/DoenetML/assignNames/basiccopy.cy.js | 2749 ++-- .../DoenetML/assignNames/collections.cy.js | 370 +- .../e2e/DoenetML/assignNames/selects.cy.js | 2 +- .../e2e/DoenetML/assignNames/sequences.cy.js | 252 +- .../DoenetML/baseComponent/doenetMLtext.cy.js | 12 +- cypress/e2e/DoenetML/chemistry/atom.cy.js | 36 +- .../dynamicalsystem/cobwebpolyline.cy.js | 10 +- .../dynamicalsystem/equilibriumcurve.cy.js | 18 +- .../dynamicalsystem/equilibriumline.cy.js | 18 +- .../dynamicalsystem/equilibriumpoint.cy.js | 18 +- .../DoenetML/dynamicalsystem/odesystem.cy.js | 50 +- .../DoenetML/errorsAndWarnings/errors.cy.js | 134 +- .../DoenetML/graphing/graphreferences.cy.js | 34 +- .../DoenetML/graphing/graphreferences2.cy.js | 120 +- cypress/e2e/DoenetML/tagSpecific/angle.cy.js | 150 +- .../tagSpecific/animatefromsequence.cy.js | 28 +- cypress/e2e/DoenetML/tagSpecific/answer.cy.js | 811 +- .../DoenetML/tagSpecific/bestfitline.cy.js | 18 +- .../e2e/DoenetML/tagSpecific/boolean.cy.js | 18 +- .../DoenetML/tagSpecific/booleaninput.cy.js | 24 +- .../DoenetML/tagSpecific/booleanlist.cy.js | 18 +- .../tagSpecific/booleanoperators.cy.js | 78 +- .../e2e/DoenetML/tagSpecific/callaction.cy.js | 18 +- .../DoenetML/tagSpecific/choiceinput.cy.js | 82 +- cypress/e2e/DoenetML/tagSpecific/circle.cy.js | 451 +- .../e2e/DoenetML/tagSpecific/codeeditor.cy.js | 32 +- .../e2e/DoenetML/tagSpecific/collect.cy.js | 332 +- .../DoenetML/tagSpecific/componentsize.cy.js | 34 +- .../tagSpecific/conditionalcontent.cy.js | 2281 +-- cypress/e2e/DoenetML/tagSpecific/copy.cy.js | 11628 ++++++++++------ cypress/e2e/DoenetML/tagSpecific/copy2.cy.js | 1867 ++- .../DoenetML/tagSpecific/curve.bezier.cy.js | 384 +- cypress/e2e/DoenetML/tagSpecific/curve.cy.js | 50 +- .../DoenetML/tagSpecific/curve.function.cy.js | 12 +- .../tagSpecific/curve.parametrized.cy.js | 24 +- .../e2e/DoenetML/tagSpecific/document.cy.js | 8 +- .../e2e/DoenetML/tagSpecific/endpoint.cy.js | 6 +- .../e2e/DoenetML/tagSpecific/evaluate.cy.js | 182 +- .../e2e/DoenetML/tagSpecific/extract.cy.js | 28 +- .../e2e/DoenetML/tagSpecific/feedback.cy.js | 60 +- .../e2e/DoenetML/tagSpecific/function.cy.js | 570 +- .../tagSpecific/functioniterates.cy.js | 32 +- .../tagSpecific/functionoperators.cy.js | 160 +- cypress/e2e/DoenetML/tagSpecific/graph.cy.js | 156 +- cypress/e2e/DoenetML/tagSpecific/group.cy.js | 110 +- .../e2e/DoenetML/tagSpecific/integer.cy.js | 54 +- .../DoenetML/tagSpecific/intersection.cy.js | 88 +- cypress/e2e/DoenetML/tagSpecific/legend.cy.js | 4 +- cypress/e2e/DoenetML/tagSpecific/line.cy.js | 634 +- .../DoenetML/tagSpecific/linesegment.cy.js | 224 +- cypress/e2e/DoenetML/tagSpecific/lorem.cy.js | 2 +- cypress/e2e/DoenetML/tagSpecific/map.cy.js | 2342 +++- .../DoenetML/tagSpecific/matchespattern.cy.js | 12 +- cypress/e2e/DoenetML/tagSpecific/math.cy.js | 785 +- .../DoenetML/tagSpecific/mathdisplay.cy.js | 14 +- .../e2e/DoenetML/tagSpecific/mathinput.cy.js | 80 +- .../DoenetML/tagSpecific/mathinputgraph.cy.js | 8 +- .../e2e/DoenetML/tagSpecific/mathlist.cy.js | 94 +- .../DoenetML/tagSpecific/mathoperators.cy.js | 1574 +-- cypress/e2e/DoenetML/tagSpecific/matrix.cy.js | 20 +- .../DoenetML/tagSpecific/matrixinput.cy.js | 78 +- cypress/e2e/DoenetML/tagSpecific/module.cy.js | 130 +- cypress/e2e/DoenetML/tagSpecific/number.cy.js | 228 +- .../e2e/DoenetML/tagSpecific/numberlist.cy.js | 81 +- .../e2e/DoenetML/tagSpecific/paginator.cy.js | 48 +- .../e2e/DoenetML/tagSpecific/parabola.cy.js | 6406 +++------ .../DoenetML/tagSpecific/periodicset.cy.js | 377 +- .../e2e/DoenetML/tagSpecific/pluralize.cy.js | 2 +- cypress/e2e/DoenetML/tagSpecific/point.cy.js | 495 +- cypress/e2e/DoenetML/tagSpecific/point2.cy.js | 368 +- .../e2e/DoenetML/tagSpecific/polygon.cy.js | 122 +- .../e2e/DoenetML/tagSpecific/polyline.cy.js | 116 +- .../e2e/DoenetML/tagSpecific/problem.cy.js | 60 +- cypress/e2e/DoenetML/tagSpecific/ray.cy.js | 260 +- .../e2e/DoenetML/tagSpecific/rectangle.cy.js | 40 +- cypress/e2e/DoenetML/tagSpecific/ref.cy.js | 23 +- .../tagSpecific/sampleprimenumbers.cy.js | 819 +- .../tagSpecific/samplerandomnumbers.cy.js | 1961 +-- .../e2e/DoenetML/tagSpecific/sectioning.cy.js | 96 +- cypress/e2e/DoenetML/tagSpecific/select.cy.js | 1619 +-- .../tagSpecific/selectfromsequence.cy.js | 711 +- .../tagSpecific/selectprimenumbers.cy.js | 648 +- .../tagSpecific/selectrandomnumbers.cy.js | 678 +- .../e2e/DoenetML/tagSpecific/sequence.cy.js | 172 +- .../e2e/DoenetML/tagSpecific/shuffle.cy.js | 111 + .../e2e/DoenetML/tagSpecific/sidebyside.cy.js | 362 +- cypress/e2e/DoenetML/tagSpecific/slider.cy.js | 2 +- .../DoenetML/tagSpecific/solveequations.cy.js | 12 +- cypress/e2e/DoenetML/tagSpecific/sort.cy.js | 76 + .../DoenetML/tagSpecific/spreadsheet.cy.js | 68 +- .../DoenetML/tagSpecific/subsetofreals.cy.js | 12 +- .../e2e/DoenetML/tagSpecific/substitute.cy.js | 2 +- cypress/e2e/DoenetML/tagSpecific/text.cy.js | 6 +- .../e2e/DoenetML/tagSpecific/textinput.cy.js | 36 +- .../e2e/DoenetML/tagSpecific/textlist.cy.js | 22 +- .../e2e/DoenetML/tagSpecific/triangle.cy.js | 52 +- .../DoenetML/tagSpecific/updatevalue.cy.js | 18 +- cypress/e2e/DoenetML/tagSpecific/vector.cy.js | 908 +- cypress/e2e/DoenetML/tagSpecific/video.cy.js | 12 +- cypress/e2e/DoenetML/tagSpecific/when.cy.js | 6 +- .../variants/specifysinglevariant.cy.js | 70 +- cypress/e2e/Events/videoEvents.cy.js | 4 +- src/Core/Core.js | 463 +- src/Core/CoreWorker.js | 3 + src/Core/Dependencies.js | 132 +- src/Core/components/Angle.js | 2 + src/Core/components/Answer.js | 3 +- src/Core/components/AsList.js | 13 +- src/Core/components/Award.js | 3 +- src/Core/components/Boolean.js | 4 +- src/Core/components/BooleanInput.js | 3 +- src/Core/components/Caption.js | 12 +- src/Core/components/Cell.js | 12 +- src/Core/components/Choice.js | 14 +- src/Core/components/ChoiceInput.js | 3 +- src/Core/components/CodeEditor.js | 3 +- src/Core/components/Collect.js | 17 +- src/Core/components/Copy.js | 581 +- src/Core/components/Evaluate.js | 4 +- src/Core/components/Extract.js | 10 +- src/Core/components/Footnote.js | 12 +- src/Core/components/Group.js | 14 +- src/Core/components/Intersection.js | 10 +- src/Core/components/Label.js | 43 +- src/Core/components/Line.js | 1 + src/Core/components/Map.js | 62 +- src/Core/components/Math.js | 447 +- src/Core/components/MathInput.js | 3 +- src/Core/components/MatrixInput.js | 6 +- src/Core/components/Number.js | 4 +- src/Core/components/P.js | 12 +- src/Core/components/Point.js | 2 + src/Core/components/SamplePrimeNumbers.js | 6 + src/Core/components/SampleRandomNumbers.js | 10 +- src/Core/components/Select.js | 6 + src/Core/components/SelectFromSequence.js | 2 - src/Core/components/SelectPrimeNumbers.js | 6 + src/Core/components/SelectRandomNumbers.js | 2 - src/Core/components/Sequence.js | 11 +- src/Core/components/Shuffle.js | 83 +- src/Core/components/Slider.js | 3 +- src/Core/components/Sort.js | 81 +- src/Core/components/SubsetOfRealsInput.js | 3 +- src/Core/components/Text.js | 16 +- src/Core/components/TextInput.js | 3 +- src/Core/components/Vector.js | 2 + src/Core/components/abstract/BaseComponent.js | 13 +- .../abstract/InlineRenderInlineChildren.js | 12 +- .../components/abstract/MathBaseOperator.js | 10 +- src/Core/components/abstract/TextOrInline.js | 11 +- .../components/chemistry/OrbitalDiagram.js | 4 +- .../chemistry/OrbitalDiagramInput.js | 3 +- src/Core/utils/copy.js | 18 +- src/Core/utils/serializedStateProcessing.js | 757 +- src/Core/utils/text.js | 141 +- ...yuqj3f7axlpgcy3aqy4dfjqsn7ypbsgeyma.doenet | 55 - ...siravqyy7xnpynyskilyg2etb3hva7oe74.doenet} | 2 +- ...w4cs5gfspz5audke3rxrbg6mi3yv5lvgnia.doenet | 5 - ...gtao35dupv6so547rw32y5hnb4dn2gt4um.doenet} | 2 +- ...urh5lidhmtxmdlxcv7xtewp5mkqq32envae.doenet | 5 + ...2vfze2h6u6ybi3yx4snhn7asbidbbit6wqa.doenet | 3 + ...3qfgarfexcasf6txflg5huseru2qdpylaou.doenet | 59 + ...ymgfbl2r237iaxssvskpj7qd6owyszfamam.doenet | 3 - ...2i2iu2743vvzrvttjy55vcmvunka7nu3ope.doenet | 4 + ...3zlnnpm4vdgmtse7jx74zfvaee2ogfxnyqy.doenet | 55 + ...2vljtt4d36zqn5pjxxy77qwfz2frejwnzhm.doenet | 35 + ...fl4xpfagv5crdzg4jfaosowpoxssludkghm.doenet | 35 - ...fdt6tbc6o462wj7gtxkzrqsk3kzhdaqzabi.doenet | 4 - src/Viewer/renderers/alert.jsx | 10 + src/Viewer/renderers/blockQuote.jsx | 10 + src/Viewer/renderers/c.jsx | 10 + src/Viewer/renderers/cell.jsx | 10 + src/Viewer/renderers/containerBlock.jsx | 10 + src/Viewer/renderers/containerInline.jsx | 10 + src/Viewer/renderers/contentBrowser.jsx | 10 + src/Viewer/renderers/contentPicker.jsx | 10 + src/Viewer/renderers/em.jsx | 10 + src/Viewer/renderers/feedback.jsx | 10 + src/Viewer/renderers/footnote.jsx | 2 +- src/Viewer/renderers/hint.jsx | 13 + src/Viewer/renderers/list.jsx | 10 + src/Viewer/renderers/p.jsx | 10 + src/Viewer/renderers/pre.jsx | 10 + src/Viewer/renderers/q.jsx | 10 + src/Viewer/renderers/section.jsx | 11 + src/Viewer/renderers/solution.jsx | 10 + src/Viewer/renderers/sq.jsx | 10 + src/Viewer/renderers/utils/composites.jsx | 208 + 193 files changed, 26161 insertions(+), 24708 deletions(-) delete mode 100644 src/Media/bafkreia6ggqxrjyelafunquyuqj3f7axlpgcy3aqy4dfjqsn7ypbsgeyma.doenet rename src/Media/{bafkreievuawsojoy4kzz7sbjvc2sxreqw6bzg3gow2jwor23aknjsmihcy.doenet => bafkreiatr7qxnkb5lnjd7bccsiravqyy7xnpynyskilyg2etb3hva7oe74.doenet} (92%) delete mode 100644 src/Media/bafkreibw2hnx6fjk56ofulow4cs5gfspz5audke3rxrbg6mi3yv5lvgnia.doenet rename src/Media/{bafkreictwhjxdmqxxvpfoqybgdfp75tcvwda56kewdxhjhe2ixcia5bqu4.doenet => bafkreic2ntu5jyvhrm5wnfxngtao35dupv6so547rw32y5hnb4dn2gt4um.doenet} (88%) create mode 100644 src/Media/bafkreic2z7kam3hnfbbpscwurh5lidhmtxmdlxcv7xtewp5mkqq32envae.doenet create mode 100644 src/Media/bafkreiccroxlq6rumheoxcs2vfze2h6u6ybi3yx4snhn7asbidbbit6wqa.doenet create mode 100644 src/Media/bafkreickzviscuc3v3bodp73qfgarfexcasf6txflg5huseru2qdpylaou.doenet delete mode 100644 src/Media/bafkreid3zm7azt6xdt7vdepymgfbl2r237iaxssvskpj7qd6owyszfamam.doenet create mode 100644 src/Media/bafkreid5s6fwzzfaax7pr3d2i2iu2743vvzrvttjy55vcmvunka7nu3ope.doenet create mode 100644 src/Media/bafkreidpoi2m2sr52dm7hca3zlnnpm4vdgmtse7jx74zfvaee2ogfxnyqy.doenet create mode 100644 src/Media/bafkreiewcn63sugv6o6ernb2vljtt4d36zqn5pjxxy77qwfz2frejwnzhm.doenet delete mode 100644 src/Media/bafkreih2fyavknvf6vog7ksfl4xpfagv5crdzg4jfaosowpoxssludkghm.doenet delete mode 100644 src/Media/bafkreih7bmpf7mbimgeoxgffdt6tbc6o462wj7gtxkzrqsk3kzhdaqzabi.doenet create mode 100644 src/Viewer/renderers/utils/composites.jsx diff --git a/cypress/e2e/AssignedActivity/singlepageActivities.cy.js b/cypress/e2e/AssignedActivity/singlepageActivities.cy.js index efd9446aa5..12fdbb3687 100644 --- a/cypress/e2e/AssignedActivity/singlepageActivities.cy.js +++ b/cypress/e2e/AssignedActivity/singlepageActivities.cy.js @@ -1630,9 +1630,9 @@ describe("Single page activity tests", function () { const doenetML = ` A video