@doenet/doenetml 0.7.21-dev.393 → 0.7.21-dev.394
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-DQwAdHX2.js → AnswerResponseButton-D8cecyxo.js} +2 -2
- package/{Description-kcKiIsUu.js → Description-CpqUPpwA.js} +1 -1
- package/{GraphFrame-LDqZHTPC.js → GraphFrame-DkJnCqmY.js} +2 -2
- package/{JSXGraphRenderer-DGH7P4zf.js → JSXGraphRenderer-CQ4UnDuA.js} +1 -1
- package/{NonInlineMediaWrapper-CyfGNcth.js → NonInlineMediaWrapper-BJJ7dSCJ.js} +1 -1
- package/Viewer/DocViewer.d.ts.map +1 -1
- package/Viewer/renderers/answer.d.ts.map +1 -1
- package/Viewer/renderers/booleanInput.d.ts.map +1 -1
- package/Viewer/renderers/choiceInput.d.ts.map +1 -1
- package/Viewer/renderers/containerBlock.d.ts.map +1 -1
- package/Viewer/renderers/containerInline.d.ts.map +1 -1
- package/Viewer/renderers/fractionInput.d.ts.map +1 -1
- package/Viewer/renderers/list.d.ts.map +1 -1
- package/Viewer/renderers/mathInput.d.ts.map +1 -1
- package/Viewer/renderers/matrixInput.d.ts.map +1 -1
- package/Viewer/renderers/p.d.ts.map +1 -1
- package/Viewer/renderers/pretzel.d.ts.map +1 -1
- package/Viewer/renderers/section.d.ts.map +1 -1
- package/Viewer/renderers/textInput.d.ts.map +1 -1
- package/Viewer/renderers/utils/checkWork.d.ts +9 -2
- package/Viewer/renderers/utils/checkWork.d.ts.map +1 -1
- package/Viewer/renderers/utils/validationState.d.ts +7 -1
- package/Viewer/renderers/utils/validationState.d.ts.map +1 -1
- package/{_error-BuKpjCb1.js → _error-B4Oho622.js} +2 -2
- package/{alert-Cv1_RLrQ.js → alert-BL0q2ccF.js} +3 -3
- package/{angle-DcdoJNiv.js → angle-B78qnore.js} +6 -6
- package/{answer-BKBbzk3a.js → answer-CRrKuv0J.js} +7 -7
- package/{asList-pqSyJPcN.js → asList-Byc66duD.js} +2 -2
- package/{blockQuote-0LLUyiD7.js → blockQuote-VtHvsxDh.js} +3 -3
- package/{boolean-BVYrZLUc.js → boolean-BzxaJixO.js} +2 -2
- package/{booleanInput-DROlOkmS.js → booleanInput-Dv5TU6If.js} +8 -8
- package/{br-MvAHmErh.js → br-CUb6oTi6.js} +2 -2
- package/{button-RrnmXhwT.js → button-C9Hxh-2e.js} +4 -4
- package/{c-CHLIJ9rr.js → c-ylFmrkJc.js} +3 -3
- package/{cell-DaIk_iBZ.js → cell-B_vT-N8p.js} +3 -3
- package/{choiceInput-DUmyLdvW.js → choiceInput-CJIUcxFH.js} +7 -7
- package/{circle-CWyavNC6.js → circle-6QF0Ni9Y.js} +6 -6
- package/{cobwebPolyline-OoivfaI4.js → cobwebPolyline-DIYZW5Sc.js} +4 -4
- package/{codeEditor-MFGmzXrn.js → codeEditor-yddXkzmF.js} +2 -2
- package/{composites-Ur8mMp9J.js → composites-D3aDmkmy.js} +1 -1
- package/{containerBlock-BdsmwwE0.js → containerBlock-CcyGSn-A.js} +6 -6
- package/{containerInline-D2wrqOOZ.js → containerInline-D43T-PUb.js} +6 -6
- package/{curve-OUEZJHzC.js → curve-ZuACj1i8.js} +4 -4
- package/{doenetml-pwYrzume.js → doenetml-M4DBortx.js} +78 -63
- package/doenetml-external-worker.js +2 -2
- package/doenetml-inline-worker.js +2 -2
- package/{ellipsis-BY1gjFaj.js → ellipsis-CikXCTS4.js} +2 -2
- package/{em-CIC2L8-X.js → em-Bznqd91f.js} +3 -3
- package/{embed-CR9CoYHt.js → embed-vLohMCBG.js} +2 -2
- package/{feedback-BxUH7q4C.js → feedback-DRu7VSKX.js} +4 -4
- package/{figure-B0EkOX2h.js → figure-Jtc-fKzc.js} +3 -3
- package/{fillPatterns-C8vdMra-.js → fillPatterns-Cx9SYc5t.js} +1 -1
- package/{footnote-DySi7tuS.js → footnote-BjHWBHoB.js} +3 -3
- package/{fractionInput-aidkKaUT.js → fractionInput-BbJoQVWi.js} +7 -7
- package/{graph-CpJquYXz.js → graph-CoAsQ_ck.js} +6 -6
- package/{hint-_ReoOUSN.js → hint-DW58dgtH.js} +4 -4
- package/{hr-B-YChV4e.js → hr-CXoyx0h4.js} +2 -2
- package/{image-GucHr3Fs.js → image-DA8Rlq6z.js} +7 -7
- package/{index-D_WGbXnQ.js → index-o-rmv2Q6.js} +1 -1
- package/{index.es-CYh-S9ku.js → index.es-D0L-dwBl.js} +1 -1
- package/index.js +1 -1
- package/{label-CgJfmzuE.js → label-BTrHrS2r.js} +6 -6
- package/{labelWithLatex-Dyh44zVC.js → labelWithLatex-D2_zUZ8t.js} +1 -1
- package/{legend-CB1XhEFU.js → legend-BPkT7kuB.js} +4 -4
- package/{line-Cso0t33P.js → line-Cegmf8m3.js} +6 -6
- package/{lineFamilyDragHandlers-D49hLbrj.js → lineFamilyDragHandlers-BdbaGIUE.js} +1 -1
- package/{lineSegment-B8O3N9Cu.js → lineSegment-CGCfT6Da.js} +5 -5
- package/{list-CZTnP_Ds.js → list-a67fT9yh.js} +6 -6
- package/{lq-DWeaQAwV.js → lq-6oZLm5K6.js} +2 -2
- package/{lsq-Il7EMuuO.js → lsq-D0YQbDIR.js} +2 -2
- package/{markupRenderer-C_yN5ah4.js → markupRenderer-CKCx6OJL.js} +1 -1
- package/{math-D7vT-BqW.js → math-C3t9SSI5.js} +6 -6
- package/{mathInput-CIJP6Soy.js → mathInput-CokLvyoG.js} +10 -10
- package/{matrixInput-DV1bXIG9.js → matrixInput-Cwo-V_Yk.js} +6 -5
- package/{mdash-DAOr4MG9.js → mdash-BDGj1dpJ.js} +2 -2
- package/{nbsp-CafnSEbd.js → nbsp-lE5WK9SF.js} +2 -2
- package/{ndash--E9FnFYk.js → ndash-DdoXaOfJ.js} +2 -2
- package/{number-usb1aLJ7.js → number-DtJ-CTaw.js} +6 -6
- package/{orbitalDiagram-D1oi-yDi.js → orbitalDiagram-DPLf42mz.js} +2 -2
- package/{orbitalDiagramInput-CTIhyhUz.js → orbitalDiagramInput-Dm2XgaLh.js} +2 -2
- package/{p-hln_7ooZ.js → p-BGiiZMSa.js} +6 -6
- package/package.json +1 -1
- package/{paginatorControls-0ymdghMm.js → paginatorControls-BUD-MI2d.js} +2 -2
- package/{pegboard-CKooxSGH.js → pegboard-CQI5zwd8.js} +4 -4
- package/{point-BSxJ2BnS.js → point-BxczWypz.js} +6 -6
- package/{polygon-CBNRp60z.js → polygon-DwRxpJ3-.js} +6 -6
- package/{polyline-GAh4H9p0.js → polyline-CqlaMAc9.js} +5 -5
- package/{pre-zDQgCXFe.js → pre-HrqEtqQJ.js} +3 -3
- package/{prefigure-G--3no_a.js → prefigure-DmFL_GTz.js} +1 -1
- package/{pretzel-OcJYDh1B.js → pretzel-S2OXRrpz.js} +6 -5
- package/{q-3Dia_368.js → q-2gFYzLe-.js} +3 -3
- package/{ray-07T3Uzf_.js → ray-Cm4aCzsB.js} +5 -5
- package/{ref-Ds74I8Cw.js → ref-gXA8ndaP.js} +2 -2
- package/{regionBetweenCurveXAxis-C4RFBXHq.js → regionBetweenCurveXAxis-CpsnQ4zy.js} +5 -5
- package/{regionBetweenCurves-I902DEC-.js → regionBetweenCurves-D8j17vWE.js} +5 -5
- package/{row-CwUonUzt.js → row-Doiu0TLJ.js} +2 -2
- package/{rq-DrSf5VSd.js → rq-1_gG74Jw.js} +2 -2
- package/{rsq-C5kUzS8d.js → rsq-5j-4hYKU.js} +2 -2
- package/{section-PMLPEMUv.js → section-D9ATngmG.js} +7 -6
- package/{sha256-AuWkkb03-BxQuqeyG.js → sha256-AuWkkb03-SPFNQ78W.js} +1 -1
- package/{sideBySide-D32_g8FK.js → sideBySide-amvyICUd.js} +2 -2
- package/{slider-BYhpoM2O.js → slider-DImp35oF.js} +3 -3
- package/{solution-CbXNhznJ.js → solution-DH8QweIs.js} +4 -4
- package/{spreadsheet-ozrM7-UB.js → spreadsheet-CpaizOgd.js} +2 -2
- package/{sq-CAKz9x_X.js → sq-D9SSTgIX.js} +3 -3
- package/{subsetOfRealsInput-C1qF4zde.js → subsetOfRealsInput-6nUGa76R.js} +2 -2
- package/{summaryStatistics-Blmw-X1a.js → summaryStatistics-DiWNUeD3.js} +2 -2
- package/{table-DmRTyhL0.js → table-C5W6jTEg.js} +2 -2
- package/{tabular-C6v4sxO_.js → tabular-CTNsSyqf.js} +2 -2
- package/{tag-BCmJ32cM.js → tag-Dwt_sh99.js} +2 -2
- package/{text-CeMtCdIU.js → text-CCC_HiXX.js} +6 -6
- package/{textInput-DQijaHeR.js → textInput-N47wvFgX.js} +9 -9
- package/{tooltip-provider-BxNX9ykJ.js → tooltip-provider-D4iBdY_5.js} +1 -1
- package/{useAnchoredGraphDragHandler-B5i789Rc.js → useAnchoredGraphDragHandler-DgiHGeuc.js} +1 -1
- package/useDoenetRenderer-xKXv4Q3h.js +114 -0
- package/{useSubmitActionWithDelay-YEoNlg6K.js → useSubmitActionWithDelay-CfntauU-.js} +2 -2
- package/utils/i18n.d.ts +58 -0
- package/utils/i18n.d.ts.map +1 -1
- package/{vector-BRN-3p5O.js → vector-CqDzM8VB.js} +6 -6
- package/{video--Z4kLzNs.js → video-Dqu_SN1a.js} +4 -4
- package/useDoenetRenderer-Crmjm0_-.js +0 -114
package/utils/i18n.d.ts
CHANGED
|
@@ -60,4 +60,62 @@ export declare function useT(): Translator;
|
|
|
60
60
|
* list arguments with `Intl.ListFormat`.
|
|
61
61
|
*/
|
|
62
62
|
export declare function useUiLocale(): string;
|
|
63
|
+
/**
|
|
64
|
+
* Publish the document-language translator to every {@link useContentT} below.
|
|
65
|
+
*
|
|
66
|
+
* Mounted by `DocViewer` beside {@link I18nProvider}, from the same
|
|
67
|
+
* `effectiveDocumentLocale` the core was handed — so a word this renders and a
|
|
68
|
+
* word the worker computed cannot disagree.
|
|
69
|
+
*
|
|
70
|
+
* Needs no `useMemo` where {@link I18nProvider} does: what it publishes is the
|
|
71
|
+
* translator itself, which `useChromeTranslator` already memoizes, rather than
|
|
72
|
+
* an object rebuilt on every render.
|
|
73
|
+
*/
|
|
74
|
+
export declare function ContentI18nProvider({ translate, children, }: {
|
|
75
|
+
translate: Translator;
|
|
76
|
+
children: React.ReactNode;
|
|
77
|
+
}): React.JSX.Element;
|
|
78
|
+
/**
|
|
79
|
+
* A translator bound to the document's language — usually *not* the one to
|
|
80
|
+
* reach for. Almost everything a renderer draws is chrome and belongs on
|
|
81
|
+
* {@link useT}; this is for a control the core already writes part of, where
|
|
82
|
+
* following the reader would put one widget in two languages.
|
|
83
|
+
*
|
|
84
|
+
* The check-work button is the case it exists for, and the reason is a chain
|
|
85
|
+
* of two links rather than taste. Its resting label is `submitLabel`, a
|
|
86
|
+
* *content* state variable: an author can write `submitLabel="Comprueba"`, and
|
|
87
|
+
* can interpolate `$ans.submitLabel` into their own prose — "Pulsa el botón
|
|
88
|
+
* $ans.submitLabel" — so its value cannot depend on who is reading, and the
|
|
89
|
+
* worker that computes it is never told `uiLocale`. Everything the button says
|
|
90
|
+
* afterwards ("Correct", "37% Credit", "no attempts remaining") therefore has
|
|
91
|
+
* to answer to the same tag, or the sentence pointing at the button stops
|
|
92
|
+
* naming what the button says.
|
|
93
|
+
*
|
|
94
|
+
* What answers to it is the whole control, not each string weighed alone. The
|
|
95
|
+
* button's visually hidden span carries `submitLabel` verbatim beside the
|
|
96
|
+
* status only a screen reader hears ("Checking answer"), so putting that
|
|
97
|
+
* announcement in the reader's language would leave one span bilingual; the
|
|
98
|
+
* `Max credit available: 80%; 1 attempt remaining` line renders as a single
|
|
99
|
+
* joined sentence immediately after the button and splits no better.
|
|
100
|
+
*
|
|
101
|
+
* This is deliberately *not* the rule for everything drawn inside the
|
|
102
|
+
* document. What a *neighbouring* element says is weighed on its own, and
|
|
103
|
+
* mostly comes out the other way: the in-document error box follows the reader
|
|
104
|
+
* (#1570), and so does the validation state appended to an input's accessible
|
|
105
|
+
* description, because both are addressed to whoever is looking at the screen
|
|
106
|
+
* and no authored prose ever refers to them. The test is whether the author's
|
|
107
|
+
* own document talks about the words — not where they appear.
|
|
108
|
+
*
|
|
109
|
+
* The catalogs are the same ones {@link useT} resolves against; only the
|
|
110
|
+
* negotiated locale differs. The keys stay in `chrome.ftl` because namespaces
|
|
111
|
+
* split by *load context*, and these are drawn on the main thread — moving
|
|
112
|
+
* them to `content` would ship them to the worker, which never draws them.
|
|
113
|
+
*
|
|
114
|
+
* Bind it as `tContent`, and reach its keys through a helper whose own
|
|
115
|
+
* parameter is named `t` (`createCheckWorkComponent`). `lint:i18n` only sees
|
|
116
|
+
* call sites through a translator named `t` or `translate`, so a key called
|
|
117
|
+
* straight off `tContent` would read as an orphan; the name also keeps `t`
|
|
118
|
+
* meaning the reader's translator in every renderer.
|
|
119
|
+
*/
|
|
120
|
+
export declare function useContentT(): Translator;
|
|
63
121
|
//# sourceMappingURL=i18n.d.ts.map
|
package/utils/i18n.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"i18n.d.ts","sourceRoot":"","sources":["../../src/utils/i18n.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA6C,MAAM,OAAO,CAAC;AAClE,OAAO,EAOH,KAAK,UAAU,EAClB,MAAM,cAAc,CAAC;AAoBtB;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAC/B,QAAQ,EAAE,MAAM,EAChB,eAAe,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI,GAChD,UAAU,CASZ;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,uBAAuB,CACnC,QAAQ,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EACnC,cAAc,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EACzC,eAAe,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI,GAChD;IAAE,SAAS,EAAE,UAAU,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAO3C;AAED;;;;;;;;GAQG;AACH,wBAAgB,YAAY,CAAC,EACzB,SAAS,EACT,MAAM,EACN,QAAQ,GACX,EAAE;IACC,SAAS,EAAE,UAAU,CAAC;IACtB,yDAAyD;IACzD,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC7B,qBAOA;AAED;;;;;;;GAOG;AACH,wBAAgB,IAAI,IAAI,UAAU,CAEjC;AAED;;;;;;GAMG;AACH,wBAAgB,WAAW,IAAI,MAAM,CAEpC"}
|
|
1
|
+
{"version":3,"file":"i18n.d.ts","sourceRoot":"","sources":["../../src/utils/i18n.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA6C,MAAM,OAAO,CAAC;AAClE,OAAO,EAOH,KAAK,UAAU,EAClB,MAAM,cAAc,CAAC;AAoBtB;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAC/B,QAAQ,EAAE,MAAM,EAChB,eAAe,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI,GAChD,UAAU,CASZ;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,uBAAuB,CACnC,QAAQ,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EACnC,cAAc,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EACzC,eAAe,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI,GAChD;IAAE,SAAS,EAAE,UAAU,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAO3C;AAED;;;;;;;;GAQG;AACH,wBAAgB,YAAY,CAAC,EACzB,SAAS,EACT,MAAM,EACN,QAAQ,GACX,EAAE;IACC,SAAS,EAAE,UAAU,CAAC;IACtB,yDAAyD;IACzD,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC7B,qBAOA;AAED;;;;;;;GAOG;AACH,wBAAgB,IAAI,IAAI,UAAU,CAEjC;AAED;;;;;;GAMG;AACH,wBAAgB,WAAW,IAAI,MAAM,CAEpC;AAUD;;;;;;;;;;GAUG;AACH,wBAAgB,mBAAmB,CAAC,EAChC,SAAS,EACT,QAAQ,GACX,EAAE;IACC,SAAS,EAAE,UAAU,CAAC;IACtB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC7B,qBAMA;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AACH,wBAAgB,WAAW,IAAI,UAAU,CAExC"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { q as DocContext, p as jsxRuntimeExports, t as textRendererStyle, v as DynamicMath } from "./doenetml-
|
|
1
|
+
import { q as DocContext, p as jsxRuntimeExports, t as textRendererStyle, v as DynamicMath } from "./doenetml-M4DBortx.js";
|
|
2
2
|
import React__default, { useContext, useRef } from "react";
|
|
3
|
-
import { j as jxg, s as syncLayer, g as syncVisPropValues, e as syncLineStrokeStyle, a as syncWithLabelToggle, f as syncLabelStrokeColor, b as syncLabelMaskCssStyle, i as applyLineFamilyLabelPlacement, k as buildLineFamilyLabelAttributes, d as attachLabelHoverHighlight, c as computeLabelMaskCssStyle, l as stabilizeInitialLineFamilyLabelPlacement, r as removeJXGEventHandlers } from "./JSXGraphRenderer-
|
|
4
|
-
import { u as useDoenetRenderer } from "./useDoenetRenderer-
|
|
5
|
-
import { BoardContext, VERTEX_LAYER_OFFSET, LINE_LAYER_OFFSET } from "./graph-
|
|
6
|
-
import { u as useSourceNavigation, a as attachLineFamilyDragHandlers } from "./lineFamilyDragHandlers-
|
|
7
|
-
import { ChoiceInputInlineContext } from "./choiceInput-
|
|
3
|
+
import { j as jxg, s as syncLayer, g as syncVisPropValues, e as syncLineStrokeStyle, a as syncWithLabelToggle, f as syncLabelStrokeColor, b as syncLabelMaskCssStyle, i as applyLineFamilyLabelPlacement, k as buildLineFamilyLabelAttributes, d as attachLabelHoverHighlight, c as computeLabelMaskCssStyle, l as stabilizeInitialLineFamilyLabelPlacement, r as removeJXGEventHandlers } from "./JSXGraphRenderer-CQ4UnDuA.js";
|
|
4
|
+
import { u as useDoenetRenderer } from "./useDoenetRenderer-xKXv4Q3h.js";
|
|
5
|
+
import { BoardContext, VERTEX_LAYER_OFFSET, LINE_LAYER_OFFSET } from "./graph-CoAsQ_ck.js";
|
|
6
|
+
import { u as useSourceNavigation, a as attachLineFamilyDragHandlers } from "./lineFamilyDragHandlers-BdbaGIUE.js";
|
|
7
|
+
import { ChoiceInputInlineContext } from "./choiceInput-CJIUcxFH.js";
|
|
8
8
|
import { a as buildLineLikeAttributes } from "./buildGraphicalAttributes-C7PtyKL7.js";
|
|
9
9
|
import { u as usePointerDragState, a as useBoardPointerTracking } from "./useBoardPointerTracking-DV6a8Wvg.js";
|
|
10
10
|
import { p as pointerEventToUserCoords } from "./dragThreshold-DuSSFrIU.js";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { x as useRecordVisibilityChanges, p as jsxRuntimeExports } from "./doenetml-M4DBortx.js";
|
|
2
2
|
import React__default, { useState, useEffect, useRef } from "react";
|
|
3
|
-
import { u as useDoenetRenderer } from "./useDoenetRenderer-
|
|
3
|
+
import { u as useDoenetRenderer } from "./useDoenetRenderer-xKXv4Q3h.js";
|
|
4
4
|
import { s as sizeToCSS } from "./css-BJLDLYRJ.js";
|
|
5
|
-
import { D as DescriptionPopover, a as DescriptionAsDetails } from "./Description-
|
|
5
|
+
import { D as DescriptionPopover, a as DescriptionAsDetails } from "./Description-CpqUPpwA.js";
|
|
6
6
|
import { g as getNonInlineMediaLayoutStyles } from "./nonInlineMediaLayout-CkXHaqzo.js";
|
|
7
|
-
import { N as NonInlineMediaWrapper } from "./NonInlineMediaWrapper-
|
|
7
|
+
import { N as NonInlineMediaWrapper } from "./NonInlineMediaWrapper-BJJ7dSCJ.js";
|
|
8
8
|
const YT_API_SRC = "https://www.youtube.com/iframe_api";
|
|
9
9
|
const listeners = /* @__PURE__ */ new Set();
|
|
10
10
|
let installed = false;
|
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
import { E as useAppSelector, F as mainSlice, G as renderersLoadComponent, _ as __variableDynamicImportRuntimeHelper } from "./doenetml-pwYrzume.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-LDqZHTPC.js"), "./renderers/JSXGraphRenderer.tsx": () => import("./JSXGraphRenderer-DGH7P4zf.js").then((n) => n.m), "./renderers/_error.tsx": () => import("./_error-BuKpjCb1.js"), "./renderers/alert.tsx": () => import("./alert-Cv1_RLrQ.js"), "./renderers/angle.tsx": () => import("./angle-DcdoJNiv.js"), "./renderers/answer.tsx": () => import("./answer-BKBbzk3a.js"), "./renderers/asList.tsx": () => import("./asList-pqSyJPcN.js"), "./renderers/blockQuote.tsx": () => import("./blockQuote-0LLUyiD7.js"), "./renderers/boolean.tsx": () => import("./boolean-BVYrZLUc.js"), "./renderers/booleanInput.tsx": () => import("./booleanInput-DROlOkmS.js"), "./renderers/br.tsx": () => import("./br-MvAHmErh.js"), "./renderers/button.tsx": () => import("./button-RrnmXhwT.js"), "./renderers/c.tsx": () => import("./c-CHLIJ9rr.js"), "./renderers/cell.tsx": () => import("./cell-DaIk_iBZ.js"), "./renderers/choiceInput.tsx": () => import("./choiceInput-DUmyLdvW.js"), "./renderers/circle.tsx": () => import("./circle-CWyavNC6.js"), "./renderers/cobwebPolyline.tsx": () => import("./cobwebPolyline-OoivfaI4.js"), "./renderers/codeEditor.tsx": () => import("./codeEditor-MFGmzXrn.js"), "./renderers/containerBlock.tsx": () => import("./containerBlock-BdsmwwE0.js"), "./renderers/containerInline.tsx": () => import("./containerInline-D2wrqOOZ.js"), "./renderers/curve.tsx": () => import("./curve-OUEZJHzC.js"), "./renderers/ellipsis.tsx": () => import("./ellipsis-BY1gjFaj.js"), "./renderers/em.tsx": () => import("./em-CIC2L8-X.js"), "./renderers/embed.tsx": () => import("./embed-CR9CoYHt.js"), "./renderers/feedback.tsx": () => import("./feedback-BxUH7q4C.js"), "./renderers/figure.tsx": () => import("./figure-B0EkOX2h.js"), "./renderers/footnote.tsx": () => import("./footnote-DySi7tuS.js"), "./renderers/fractionInput.tsx": () => import("./fractionInput-aidkKaUT.js"), "./renderers/graph.tsx": () => import("./graph-CpJquYXz.js"), "./renderers/hint.tsx": () => import("./hint-_ReoOUSN.js"), "./renderers/hr.tsx": () => import("./hr-B-YChV4e.js"), "./renderers/image.tsx": () => import("./image-GucHr3Fs.js"), "./renderers/label.tsx": () => import("./label-CgJfmzuE.js"), "./renderers/legend.tsx": () => import("./legend-CB1XhEFU.js"), "./renderers/line.tsx": () => import("./line-Cso0t33P.js"), "./renderers/lineSegment.tsx": () => import("./lineSegment-B8O3N9Cu.js"), "./renderers/list.tsx": () => import("./list-CZTnP_Ds.js"), "./renderers/lq.tsx": () => import("./lq-DWeaQAwV.js"), "./renderers/lsq.tsx": () => import("./lsq-Il7EMuuO.js"), "./renderers/math.tsx": () => import("./math-D7vT-BqW.js"), "./renderers/mathInput.tsx": () => import("./mathInput-CIJP6Soy.js"), "./renderers/matrixInput.tsx": () => import("./matrixInput-DV1bXIG9.js"), "./renderers/mdash.tsx": () => import("./mdash-DAOr4MG9.js"), "./renderers/nbsp.tsx": () => import("./nbsp-CafnSEbd.js"), "./renderers/ndash.tsx": () => import("./ndash--E9FnFYk.js"), "./renderers/number.tsx": () => import("./number-usb1aLJ7.js"), "./renderers/orbitalDiagram.tsx": () => import("./orbitalDiagram-D1oi-yDi.js"), "./renderers/orbitalDiagramInput.tsx": () => import("./orbitalDiagramInput-CTIhyhUz.js"), "./renderers/p.tsx": () => import("./p-hln_7ooZ.js"), "./renderers/paginatorControls.tsx": () => import("./paginatorControls-0ymdghMm.js"), "./renderers/pegboard.tsx": () => import("./pegboard-CKooxSGH.js"), "./renderers/point.tsx": () => import("./point-BSxJ2BnS.js"), "./renderers/polygon.tsx": () => import("./polygon-CBNRp60z.js"), "./renderers/polyline.tsx": () => import("./polyline-GAh4H9p0.js"), "./renderers/pre.tsx": () => import("./pre-zDQgCXFe.js"), "./renderers/prefigure.tsx": () => import("./prefigure-G--3no_a.js"), "./renderers/pretzel.tsx": () => import("./pretzel-OcJYDh1B.js"), "./renderers/q.tsx": () => import("./q-3Dia_368.js"), "./renderers/ray.tsx": () => import("./ray-07T3Uzf_.js"), "./renderers/ref.tsx": () => import("./ref-Ds74I8Cw.js"), "./renderers/regionBetweenCurveXAxis.tsx": () => import("./regionBetweenCurveXAxis-C4RFBXHq.js"), "./renderers/regionBetweenCurves.tsx": () => import("./regionBetweenCurves-I902DEC-.js"), "./renderers/row.tsx": () => import("./row-CwUonUzt.js"), "./renderers/rq.tsx": () => import("./rq-DrSf5VSd.js"), "./renderers/rsq.tsx": () => import("./rsq-C5kUzS8d.js"), "./renderers/section.tsx": () => import("./section-PMLPEMUv.js"), "./renderers/sideBySide.tsx": () => import("./sideBySide-D32_g8FK.js"), "./renderers/slider.tsx": () => import("./slider-BYhpoM2O.js"), "./renderers/solution.tsx": () => import("./solution-CbXNhznJ.js"), "./renderers/spreadsheet.tsx": () => import("./spreadsheet-ozrM7-UB.js"), "./renderers/sq.tsx": () => import("./sq-CAKz9x_X.js"), "./renderers/subsetOfRealsInput.tsx": () => import("./subsetOfRealsInput-C1qF4zde.js"), "./renderers/summaryStatistics.tsx": () => import("./summaryStatistics-Blmw-X1a.js"), "./renderers/table.tsx": () => import("./table-DmRTyhL0.js"), "./renderers/tabular.tsx": () => import("./tabular-C6v4sxO_.js"), "./renderers/tag.tsx": () => import("./tag-BCmJ32cM.js"), "./renderers/text.tsx": () => import("./text-CeMtCdIU.js"), "./renderers/textInput.tsx": () => import("./textInput-DQijaHeR.js"), "./renderers/vector.tsx": () => import("./vector-BRN-3p5O.js"), "./renderers/video.tsx": () => import("./video--Z4kLzNs.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
|
-
};
|