@doenet/doenetml 0.7.21-dev.341 → 0.7.21-dev.343
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/{AnswerResponseButton-F0c45e3m.js → AnswerResponseButton-CZabp-LL.js} +2 -2
- package/{Description-dGZQDql9.js → Description-CRODvMC1.js} +1 -1
- package/{GraphFrame-DB4wOrtP.js → GraphFrame-5R_Nnklj.js} +2 -2
- package/{JSXGraphRenderer-BZetOZGA.js → JSXGraphRenderer-BcR36ozd.js} +1 -1
- package/{NonInlineMediaWrapper-DUTDW2CP.js → NonInlineMediaWrapper-D4iFcIdJ.js} +1 -1
- package/{_error-BB55uuOi.js → _error-l3ASAd_O.js} +2 -2
- package/{alert-DEcY_Agt.js → alert-C31vQ1Zm.js} +3 -3
- package/{angle-CcBjLVkI.js → angle-D5tPYJGy.js} +6 -6
- package/{answer-Ca_lx4AY.js → answer-DUvHSopX.js} +5 -5
- package/{asList-ZYvKNdsO.js → asList-17wIQSts.js} +2 -2
- package/{blockQuote-BtV79V-k.js → blockQuote-H67CPvh4.js} +3 -3
- package/{boolean-COZ5WBFs.js → boolean-BrfbiVxM.js} +2 -2
- package/{booleanInput-Ct9jtzPR.js → booleanInput-1RzOSBmO.js} +6 -6
- package/{br-BO66uC6v.js → br-Y3u1HEpF.js} +2 -2
- package/{button-DyegLoHD.js → button-BuX0qERC.js} +4 -4
- package/{c-C5I-RerR.js → c-Y0FRTzwm.js} +3 -3
- package/{cell-BGgZ39yi.js → cell-DXzGgLZC.js} +3 -3
- package/{choiceInput-oluRcxaK.js → choiceInput-QYG5RDnq.js} +4 -4
- package/{circle-BApd25ki.js → circle-BcT8JW-2.js} +5 -5
- package/{cobwebPolyline-_86BoMha.js → cobwebPolyline-Bk86qCZN.js} +4 -4
- package/{codeEditor-BO8789mf.js → codeEditor-CSg_ERC_.js} +2 -2
- package/{composites-Bd-zZHjL.js → composites-CTAXsoVJ.js} +1 -1
- package/{containerBlock-Dd5OMt-V.js → containerBlock-BiLyDPdi.js} +4 -4
- package/{containerInline-84cJj5vI.js → containerInline-BHA-8I0O.js} +4 -4
- package/{curve-BP7e3bEq.js → curve-CY8QmohO.js} +4 -4
- package/{doenetml-DBnC263_.js → doenetml-drNYjJiF.js} +13 -5
- package/doenetml-external-worker.js +2 -2
- package/doenetml-inline-worker.js +2 -2
- package/{ellipsis-D0qYAm8_.js → ellipsis-DYESmUW7.js} +2 -2
- package/{em-DjyApTe-.js → em-kfmKy4PD.js} +3 -3
- package/{embed-BqSds-Pr.js → embed-D1ZSN3di.js} +2 -2
- package/{feedback-BML439vw.js → feedback-CLHphyee.js} +4 -4
- package/{figure-CwIS4Kan.js → figure-BrePmmQq.js} +3 -3
- package/{fillPatterns-CuPw-DhW.js → fillPatterns-CRaVTk2g.js} +1 -1
- package/{footnote-d7SB2zAy.js → footnote-3FW1HY9k.js} +3 -3
- package/{fractionInput-Dqs46B8U.js → fractionInput-BC8E81uj.js} +4 -4
- package/{graph-DqRzGSX5.js → graph-uNmxqd5I.js} +6 -6
- package/{hint-CWHr9UCA.js → hint-B_kdL21O.js} +4 -4
- package/{hr-CV-LeMBg.js → hr-DZafn4SW.js} +2 -2
- package/{image-C-XUGV50.js → image-BGchg3Hp.js} +7 -7
- package/{index-C-OAaLdY.js → index-CirIolbf.js} +1 -1
- package/{index.es-cV104-N8.js → index.es-CxbMbZHV.js} +1 -1
- package/index.js +1 -1
- package/{label-BacX6na0.js → label-BEZXfmM-.js} +6 -6
- package/{labelWithLatex-B0nhH8sA.js → labelWithLatex-tld42Q2B.js} +1 -1
- package/{legend-BnmPHzUw.js → legend-PTdKctOq.js} +4 -4
- package/{line-CbQgFuWz.js → line-CRs9Kffi.js} +5 -5
- package/{lineSegment-Zt1Z4R-H.js → lineSegment-CF6YCRAO.js} +4 -4
- package/{list-Pe1H3ZFe.js → list-mBXCMvMp.js} +4 -4
- package/{lq-NuRMVNJz.js → lq-DnFLilVI.js} +2 -2
- package/{lsq-BmgjWYUK.js → lsq-HTRPVsTA.js} +2 -2
- package/{markupRenderer-f0IiD5hf.js → markupRenderer-rPpSzHPv.js} +1 -1
- package/{math-DuYTIUw5.js → math-Diykw-Cl.js} +6 -6
- package/{mathInput-BrgDgAqA.js → mathInput-BlFoiDUY.js} +7 -7
- package/{matrixInput--qTCSGaH.js → matrixInput-CxIgxmNb.js} +4 -4
- package/{mdash-wsYNiWK9.js → mdash-CHe8idf5.js} +2 -2
- package/{nbsp-CzVTo9Ce.js → nbsp-DLhqASSt.js} +2 -2
- package/{ndash-C1y_rzYb.js → ndash-Bk0U8LUk.js} +2 -2
- package/{number-DWwdCaOT.js → number-B0eczUCk.js} +6 -6
- package/{orbitalDiagram-DhmN-dz1.js → orbitalDiagram-ncpQ3XeY.js} +2 -2
- package/{orbitalDiagramInput-B_4tj8Dh.js → orbitalDiagramInput-D6_ENlYY.js} +2 -2
- package/{p-DZpY4hQe.js → p-BWfkgup-.js} +4 -4
- package/package.json +1 -1
- package/{paginatorControls-kx6TQa6c.js → paginatorControls-BpypxFCi.js} +2 -2
- package/{pegboard-DE0h5eed.js → pegboard-CS7dNQQS.js} +4 -4
- package/{point-CQolRwd1.js → point-B_tHcxBn.js} +5 -5
- package/{polygon-BHb0mOpO.js → polygon-ChWHMbNG.js} +5 -5
- package/{polyline-Bpo25-Em.js → polyline-ByVT3k6z.js} +4 -4
- package/{pre-7XK6at3o.js → pre-BEzb0br9.js} +3 -3
- package/{prefigure-DPG0KLHL.js → prefigure-UIeHl-FK.js} +1 -1
- package/{pretzel-ROYqpQaR.js → pretzel-RAGpWNd8.js} +4 -4
- package/{q-5EoLrWmB.js → q-CWri8Bpx.js} +3 -3
- package/{ray-D0gcJau3.js → ray-Ca4Kymx-.js} +4 -4
- package/{ref-gJj92dTx.js → ref-Dq7yAQOX.js} +2 -2
- package/{regionBetweenCurveXAxis-UudrQaKF.js → regionBetweenCurveXAxis-B0BToHLL.js} +5 -5
- package/{regionBetweenCurves-OdcYtqXZ.js → regionBetweenCurves-BcClg3xK.js} +5 -5
- package/{row-CP3mSA8q.js → row-Cr2G9qWM.js} +2 -2
- package/{rq-JwJuQS_I.js → rq-Bzxr4ovA.js} +2 -2
- package/{rsq-BXu5vRD5.js → rsq-D9Kkw4CU.js} +2 -2
- package/{section-Cu5a8t0E.js → section-DWjZ3izY.js} +5 -5
- package/{sha256-C0vj3HDn-C63op1V-.js → sha256-C0vj3HDn-BxaiuOaa.js} +1 -1
- package/{sideBySide-x12GGDno.js → sideBySide-B3IH4vRy.js} +2 -2
- package/{slider-8voyawWp.js → slider-D24sz9P1.js} +3 -3
- package/{solution-BURGyiWv.js → solution-D26PvuZ-.js} +4 -4
- package/{spreadsheet-CJEuN3-a.js → spreadsheet-DNcPWkpY.js} +2 -2
- package/{sq-CqpQQ2An.js → sq-BZq6nmRm.js} +3 -3
- package/{subsetOfRealsInput-CkLAjpca.js → subsetOfRealsInput-DlrNfBY6.js} +2 -2
- package/{summaryStatistics-BLx2s1qP.js → summaryStatistics-BZWidOD_.js} +2 -2
- package/{table-fa-RT1ys.js → table-C-dMRPmP.js} +2 -2
- package/{tabular-C8YasAq1.js → tabular-whrBBrNK.js} +2 -2
- package/{tag-D04W6wnl.js → tag-B59gIOhu.js} +2 -2
- package/{text-BMGcwWq0.js → text-Be88xCNH.js} +6 -6
- package/{textInput-CxvDR7Z8.js → textInput-Cqrld3OV.js} +6 -6
- package/{tooltip-provider-CkDY2Sis.js → tooltip-provider-bTQrT7TJ.js} +1 -1
- package/{useAnchoredGraphDragHandler-B1bepAna.js → useAnchoredGraphDragHandler-BEy2dmsI.js} +1 -1
- package/useDoenetRenderer-CDZbHBy-.js +114 -0
- package/{useSubmitActionWithDelay-AldkXRbD.js → useSubmitActionWithDelay-K14395kS.js} +2 -2
- package/utils/visibility.d.ts +17 -1
- package/utils/visibility.d.ts.map +1 -1
- package/utils/visibility.test.d.ts +2 -0
- package/utils/visibility.test.d.ts.map +1 -0
- package/{vector-nSGMCL3-.js → vector-BOzufZlV.js} +5 -5
- package/{video-CNAY_Ue5.js → video-bqqPRRHP.js} +4 -4
- package/useDoenetRenderer-B4NpAX2T.js +0 -114
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
import { w as useAppSelector, x as mainSlice, y as renderersLoadComponent, _ as __variableDynamicImportRuntimeHelper } from "./doenetml-DBnC263_.js";
|
|
2
|
-
import React__default, { useState, useEffect } from "react";
|
|
3
|
-
function useDoenetRenderer(props, initializeChildrenOnConstruction = true) {
|
|
4
|
-
const actions = props.componentInstructions.actions;
|
|
5
|
-
const componentIdx = props.componentInstructions.componentIdx;
|
|
6
|
-
const effectiveIdx = props.componentInstructions.effectiveIdx;
|
|
7
|
-
const id = props.componentInstructions.id;
|
|
8
|
-
const rendererName = props.coreId + componentIdx;
|
|
9
|
-
const [renderersToLoad, setRenderersToLoad] = useState({});
|
|
10
|
-
const componentInfo = useAppSelector(
|
|
11
|
-
(state) => mainSlice.selectors.componentInfo(state)[rendererName]
|
|
12
|
-
);
|
|
13
|
-
const {
|
|
14
|
-
stateValues,
|
|
15
|
-
sourceOfUpdate = {},
|
|
16
|
-
ignoreUpdate,
|
|
17
|
-
childrenInstructions,
|
|
18
|
-
prefixForIds
|
|
19
|
-
} = componentInfo || {
|
|
20
|
-
stateValues: {},
|
|
21
|
-
sourceOfUpdate: {},
|
|
22
|
-
ignoreUpdate: false,
|
|
23
|
-
childrenInstructions: [],
|
|
24
|
-
prefixForIds: ""
|
|
25
|
-
};
|
|
26
|
-
let children = [];
|
|
27
|
-
const loadMoreRenderers = Object.keys(renderersToLoad).length === 0;
|
|
28
|
-
for (let childInstructions of childrenInstructions) {
|
|
29
|
-
let child = createChildFromInstructions(
|
|
30
|
-
childInstructions,
|
|
31
|
-
loadMoreRenderers
|
|
32
|
-
);
|
|
33
|
-
children.push(child);
|
|
34
|
-
}
|
|
35
|
-
useEffect(() => {
|
|
36
|
-
const entries = Object.entries(renderersToLoad);
|
|
37
|
-
if (entries.length > 0) {
|
|
38
|
-
const names = entries.map(([name]) => name);
|
|
39
|
-
const loaders = entries.map(([, loader]) => loader);
|
|
40
|
-
renderersLoadComponent(loaders, names).then(
|
|
41
|
-
({ rendererClasses: newRendererClasses }) => {
|
|
42
|
-
Object.assign(props.rendererClasses, newRendererClasses);
|
|
43
|
-
setRenderersToLoad({});
|
|
44
|
-
}
|
|
45
|
-
);
|
|
46
|
-
}
|
|
47
|
-
}, [renderersToLoad, props.rendererClasses]);
|
|
48
|
-
function createChildFromInstructions(childInstructions, loadMoreRenderers2) {
|
|
49
|
-
if (typeof childInstructions === "string" || childInstructions === null) {
|
|
50
|
-
return childInstructions;
|
|
51
|
-
}
|
|
52
|
-
let propsForChild = {
|
|
53
|
-
key: props.coreId + childInstructions.componentIdx,
|
|
54
|
-
componentInstructions: childInstructions,
|
|
55
|
-
rendererClasses: props.rendererClasses,
|
|
56
|
-
coreId: props.coreId,
|
|
57
|
-
docId: props.docId,
|
|
58
|
-
activityId: props.activityId,
|
|
59
|
-
callAction: props.callAction,
|
|
60
|
-
fetchExternalDoenetML: props.fetchExternalDoenetML,
|
|
61
|
-
requestScrollTo: props.requestScrollTo,
|
|
62
|
-
flags: props.flags
|
|
63
|
-
};
|
|
64
|
-
let rendererClass = props.rendererClasses[childInstructions.rendererType];
|
|
65
|
-
if (!rendererClass) {
|
|
66
|
-
if (loadMoreRenderers2) {
|
|
67
|
-
setRenderersToLoad((old) => {
|
|
68
|
-
let rendererLoaders = { ...old };
|
|
69
|
-
if (!(childInstructions.rendererType in rendererLoaders)) {
|
|
70
|
-
rendererLoaders[childInstructions.rendererType] = () => __variableDynamicImportRuntimeHelper(/* @__PURE__ */ Object.assign({ "./renderers/GraphFrame.tsx": () => import("./GraphFrame-DB4wOrtP.js"), "./renderers/JSXGraphRenderer.tsx": () => import("./JSXGraphRenderer-BZetOZGA.js").then((n) => n.m), "./renderers/_error.tsx": () => import("./_error-BB55uuOi.js"), "./renderers/alert.tsx": () => import("./alert-DEcY_Agt.js"), "./renderers/angle.tsx": () => import("./angle-CcBjLVkI.js"), "./renderers/answer.tsx": () => import("./answer-Ca_lx4AY.js"), "./renderers/asList.tsx": () => import("./asList-ZYvKNdsO.js"), "./renderers/blockQuote.tsx": () => import("./blockQuote-BtV79V-k.js"), "./renderers/boolean.tsx": () => import("./boolean-COZ5WBFs.js"), "./renderers/booleanInput.tsx": () => import("./booleanInput-Ct9jtzPR.js"), "./renderers/br.tsx": () => import("./br-BO66uC6v.js"), "./renderers/button.tsx": () => import("./button-DyegLoHD.js"), "./renderers/c.tsx": () => import("./c-C5I-RerR.js"), "./renderers/cell.tsx": () => import("./cell-BGgZ39yi.js"), "./renderers/choiceInput.tsx": () => import("./choiceInput-oluRcxaK.js"), "./renderers/circle.tsx": () => import("./circle-BApd25ki.js"), "./renderers/cobwebPolyline.tsx": () => import("./cobwebPolyline-_86BoMha.js"), "./renderers/codeEditor.tsx": () => import("./codeEditor-BO8789mf.js"), "./renderers/containerBlock.tsx": () => import("./containerBlock-Dd5OMt-V.js"), "./renderers/containerInline.tsx": () => import("./containerInline-84cJj5vI.js"), "./renderers/curve.tsx": () => import("./curve-BP7e3bEq.js"), "./renderers/ellipsis.tsx": () => import("./ellipsis-D0qYAm8_.js"), "./renderers/em.tsx": () => import("./em-DjyApTe-.js"), "./renderers/embed.tsx": () => import("./embed-BqSds-Pr.js"), "./renderers/feedback.tsx": () => import("./feedback-BML439vw.js"), "./renderers/figure.tsx": () => import("./figure-CwIS4Kan.js"), "./renderers/footnote.tsx": () => import("./footnote-d7SB2zAy.js"), "./renderers/fractionInput.tsx": () => import("./fractionInput-Dqs46B8U.js"), "./renderers/graph.tsx": () => import("./graph-DqRzGSX5.js"), "./renderers/hint.tsx": () => import("./hint-CWHr9UCA.js"), "./renderers/hr.tsx": () => import("./hr-CV-LeMBg.js"), "./renderers/image.tsx": () => import("./image-C-XUGV50.js"), "./renderers/label.tsx": () => import("./label-BacX6na0.js"), "./renderers/legend.tsx": () => import("./legend-BnmPHzUw.js"), "./renderers/line.tsx": () => import("./line-CbQgFuWz.js"), "./renderers/lineSegment.tsx": () => import("./lineSegment-Zt1Z4R-H.js"), "./renderers/list.tsx": () => import("./list-Pe1H3ZFe.js"), "./renderers/lq.tsx": () => import("./lq-NuRMVNJz.js"), "./renderers/lsq.tsx": () => import("./lsq-BmgjWYUK.js"), "./renderers/math.tsx": () => import("./math-DuYTIUw5.js"), "./renderers/mathInput.tsx": () => import("./mathInput-BrgDgAqA.js"), "./renderers/matrixInput.tsx": () => import("./matrixInput--qTCSGaH.js"), "./renderers/mdash.tsx": () => import("./mdash-wsYNiWK9.js"), "./renderers/nbsp.tsx": () => import("./nbsp-CzVTo9Ce.js"), "./renderers/ndash.tsx": () => import("./ndash-C1y_rzYb.js"), "./renderers/number.tsx": () => import("./number-DWwdCaOT.js"), "./renderers/orbitalDiagram.tsx": () => import("./orbitalDiagram-DhmN-dz1.js"), "./renderers/orbitalDiagramInput.tsx": () => import("./orbitalDiagramInput-B_4tj8Dh.js"), "./renderers/p.tsx": () => import("./p-DZpY4hQe.js"), "./renderers/paginatorControls.tsx": () => import("./paginatorControls-kx6TQa6c.js"), "./renderers/pegboard.tsx": () => import("./pegboard-DE0h5eed.js"), "./renderers/point.tsx": () => import("./point-CQolRwd1.js"), "./renderers/polygon.tsx": () => import("./polygon-BHb0mOpO.js"), "./renderers/polyline.tsx": () => import("./polyline-Bpo25-Em.js"), "./renderers/pre.tsx": () => import("./pre-7XK6at3o.js"), "./renderers/prefigure.tsx": () => import("./prefigure-DPG0KLHL.js"), "./renderers/pretzel.tsx": () => import("./pretzel-ROYqpQaR.js"), "./renderers/q.tsx": () => import("./q-5EoLrWmB.js"), "./renderers/ray.tsx": () => import("./ray-D0gcJau3.js"), "./renderers/ref.tsx": () => import("./ref-gJj92dTx.js"), "./renderers/regionBetweenCurveXAxis.tsx": () => import("./regionBetweenCurveXAxis-UudrQaKF.js"), "./renderers/regionBetweenCurves.tsx": () => import("./regionBetweenCurves-OdcYtqXZ.js"), "./renderers/row.tsx": () => import("./row-CP3mSA8q.js"), "./renderers/rq.tsx": () => import("./rq-JwJuQS_I.js"), "./renderers/rsq.tsx": () => import("./rsq-BXu5vRD5.js"), "./renderers/section.tsx": () => import("./section-Cu5a8t0E.js"), "./renderers/sideBySide.tsx": () => import("./sideBySide-x12GGDno.js"), "./renderers/slider.tsx": () => import("./slider-8voyawWp.js"), "./renderers/solution.tsx": () => import("./solution-BURGyiWv.js"), "./renderers/spreadsheet.tsx": () => import("./spreadsheet-CJEuN3-a.js"), "./renderers/sq.tsx": () => import("./sq-CqpQQ2An.js"), "./renderers/subsetOfRealsInput.tsx": () => import("./subsetOfRealsInput-CkLAjpca.js"), "./renderers/summaryStatistics.tsx": () => import("./summaryStatistics-BLx2s1qP.js"), "./renderers/table.tsx": () => import("./table-fa-RT1ys.js"), "./renderers/tabular.tsx": () => import("./tabular-C8YasAq1.js"), "./renderers/tag.tsx": () => import("./tag-D04W6wnl.js"), "./renderers/text.tsx": () => import("./text-BMGcwWq0.js"), "./renderers/textInput.tsx": () => import("./textInput-CxvDR7Z8.js"), "./renderers/vector.tsx": () => import("./vector-nSGMCL3-.js"), "./renderers/video.tsx": () => import("./video-CNAY_Ue5.js") }), `./renderers/${childInstructions.rendererType}.tsx`, 3);
|
|
71
|
-
}
|
|
72
|
-
return rendererLoaders;
|
|
73
|
-
});
|
|
74
|
-
}
|
|
75
|
-
return null;
|
|
76
|
-
}
|
|
77
|
-
let child = React__default.createElement(rendererClass, propsForChild);
|
|
78
|
-
return child;
|
|
79
|
-
}
|
|
80
|
-
let rendererType = props.componentInstructions.rendererType;
|
|
81
|
-
const callAction = (argObj) => {
|
|
82
|
-
if (!argObj.componentIdx) {
|
|
83
|
-
argObj = { ...argObj };
|
|
84
|
-
argObj.componentIdx = componentIdx;
|
|
85
|
-
}
|
|
86
|
-
if (!argObj.rendererType) {
|
|
87
|
-
argObj = { ...argObj };
|
|
88
|
-
argObj.rendererType = rendererType;
|
|
89
|
-
}
|
|
90
|
-
return props.callAction(argObj);
|
|
91
|
-
};
|
|
92
|
-
return {
|
|
93
|
-
componentIdx: effectiveIdx,
|
|
94
|
-
id: prefixForIds + id,
|
|
95
|
-
SVs: stateValues,
|
|
96
|
-
docId: props.docId,
|
|
97
|
-
activityId: props.activityId,
|
|
98
|
-
actions,
|
|
99
|
-
children,
|
|
100
|
-
sourceOfUpdate,
|
|
101
|
-
ignoreUpdate,
|
|
102
|
-
rendererName,
|
|
103
|
-
initializeChildren: () => {
|
|
104
|
-
},
|
|
105
|
-
callAction,
|
|
106
|
-
doenetViewerUrl: props.doenetViewerUrl,
|
|
107
|
-
fetchExternalDoenetML: props.fetchExternalDoenetML,
|
|
108
|
-
requestScrollTo: props.requestScrollTo,
|
|
109
|
-
flags: props.flags
|
|
110
|
-
};
|
|
111
|
-
}
|
|
112
|
-
export {
|
|
113
|
-
useDoenetRenderer as u
|
|
114
|
-
};
|