@doenet/doenetml 0.7.21-dev.361 → 0.7.21-dev.362
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-BzVcEOrl.js → AnswerResponseButton-FrNXi7jz.js} +8 -10
- package/{Description-CeDL7FZY.js → Description-D4h1QV0r.js} +20 -3
- package/{GraphFrame-8IPcvXqk.js → GraphFrame-7muJHYBu.js} +2 -2
- package/{JSXGraphRenderer-Be41lgIz.js → JSXGraphRenderer-DH6ZzfYT.js} +1 -1
- package/{NonInlineMediaWrapper-Tf8Bgp1V.js → NonInlineMediaWrapper-CqBvf7rz.js} +1 -1
- package/Viewer/DocViewer.d.ts.map +1 -1
- package/Viewer/coreWorkerBoot.d.ts.map +1 -1
- package/Viewer/renderers/_error.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/feedback.d.ts.map +1 -1
- package/Viewer/renderers/footnote.d.ts.map +1 -1
- package/Viewer/renderers/fractionInput.d.ts.map +1 -1
- package/Viewer/renderers/hint.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/orbitalDiagramInput.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/slider.d.ts.map +1 -1
- package/Viewer/renderers/solution.d.ts.map +1 -1
- package/Viewer/renderers/subsetOfRealsInput.d.ts.map +1 -1
- package/Viewer/renderers/summaryStatistics.d.ts.map +1 -1
- package/Viewer/renderers/textInput.d.ts.map +1 -1
- package/Viewer/renderers/utils/AnswerResponseButton.d.ts.map +1 -1
- package/Viewer/renderers/utils/Description.d.ts.map +1 -1
- package/Viewer/renderers/utils/checkWork.d.ts +5 -1
- package/Viewer/renderers/utils/checkWork.d.ts.map +1 -1
- package/Viewer/renderers/utils/disclosure.d.ts +16 -0
- package/Viewer/renderers/utils/disclosure.d.ts.map +1 -0
- package/Viewer/renderers/utils/validationState.d.ts +3 -1
- package/Viewer/renderers/utils/validationState.d.ts.map +1 -1
- package/Viewer/renderersLoadComponent.d.ts.map +1 -1
- package/{_error-DhRiszio.js → _error-BdTgXDgj.js} +4 -3
- package/{alert-CExDcbrh.js → alert-Bp9rBO1c.js} +3 -3
- package/{angle-FCTtCuvN.js → angle-xoJC6SFX.js} +6 -6
- package/{answer-BLusvBSG.js → answer-_Zvxo4jA.js} +8 -6
- package/{asList-Dv__hv6D.js → asList-DZD-Xdrj.js} +2 -2
- package/{blockQuote-B6Wtw4HN.js → blockQuote-CUi9cydG.js} +3 -3
- package/{boolean-IP59-Zjp.js → boolean-CX7vVQJz.js} +2 -2
- package/{booleanInput-BCNoC_vo.js → booleanInput-CceFBEy2.js} +9 -7
- package/{br-BqejfFtq.js → br-C_fdDVKv.js} +2 -2
- package/{button-DzYMy3G6.js → button-DBxivYmV.js} +4 -4
- package/{c-wV9nNSPC.js → c-Dr5FHPut.js} +3 -3
- package/{cell-Cfv7v4mc.js → cell-hqwqMA4A.js} +3 -3
- package/{choiceInput-BjbqDU9d.js → choiceInput-7JZaBHNZ.js} +10 -7
- package/{circle-CQ5lWEtc.js → circle-BqfCWmj2.js} +6 -6
- package/{cobwebPolyline-CAStHK_5.js → cobwebPolyline-JFOTL1HK.js} +4 -4
- package/{codeEditor-C2tiWOSh.js → codeEditor-oSH9duvd.js} +2 -2
- package/{composites-BVLPwfSW.js → composites-DbpoF3XJ.js} +1 -1
- package/{containerBlock-CLEUmhMM.js → containerBlock-BwJnX0UE.js} +7 -5
- package/{containerInline-kv3umsgq.js → containerInline-DSHf9h9o.js} +7 -5
- package/{curve-gdmcSsYU.js → curve-BH7j7hXT.js} +4 -4
- package/disclosure-axyZa36E.js +6 -0
- package/{doenetml-BXSsTmMg.js → doenetml-CCMBYR_b.js} +1712 -227
- package/doenetml-external-worker.js +2 -2
- package/doenetml-inline-worker.js +2 -2
- package/doenetml.d.ts.map +1 -1
- package/{ellipsis-D4fj-dH6.js → ellipsis-CQ4585lT.js} +2 -2
- package/{em-BLDmBPbZ.js → em-CYcBkUiA.js} +3 -3
- package/{embed-DFjdhAuI.js → embed-Be0he9Uz.js} +2 -2
- package/{feedback-BDSuY82b.js → feedback-ByTDuaNm.js} +7 -5
- package/{figure-DCQvyct_.js → figure-Dl_yKz7e.js} +3 -3
- package/{fillPatterns-DePmEjFP.js → fillPatterns-B-Wb7Rdw.js} +1 -1
- package/{footnote-EqPCQBWN.js → footnote-BpmhdxIC.js} +6 -8
- package/{fractionInput-CLSJPyA_.js → fractionInput-CCMZLzep.js} +10 -7
- package/{graph-C6hIOAwD.js → graph-CJRztDFF.js} +6 -6
- package/{hint-5LodBIQj.js → hint-39ljV3xf.js} +9 -9
- package/{hr-C9sb2QsS.js → hr-ACnfIwXC.js} +2 -2
- package/{image-CVqPuME4.js → image-DvAqXhei.js} +7 -7
- package/{index-yIMJFPe2.js → index-CMIXIik7.js} +1 -1
- package/{index.es-DnBW6AYz.js → index.es-p77isnix.js} +1 -1
- package/index.js +1 -1
- package/{label-BH-b9r-w.js → label-C63Ww5PO.js} +6 -6
- package/{labelWithLatex-DpzLXHtw.js → labelWithLatex-ClPeO6KG.js} +1 -1
- package/{legend-Dmq310xU.js → legend-BIyyKsy5.js} +4 -4
- package/{line-BerJZTGH.js → line-nzRw-2iw.js} +6 -6
- package/{lineFamilyDragHandlers-YfhC_Q94.js → lineFamilyDragHandlers-LT5y2nwm.js} +1 -1
- package/{lineSegment-BUtYPLbh.js → lineSegment-DEV7vXZ3.js} +5 -5
- package/{list-Ye_2Ltwm.js → list-0vosUKx2.js} +7 -5
- package/{lq-BiqdUNus.js → lq-C6SI-4Ja.js} +2 -2
- package/{lsq-DiKKUzSa.js → lsq-77sCkOO8.js} +2 -2
- package/{markupRenderer-Cb5alIAV.js → markupRenderer-BkS3m7gW.js} +1 -1
- package/{math-CIdkbUN1.js → math-dC5Avala.js} +6 -6
- package/{mathInput-BzRlJdzU.js → mathInput-Be03NUZy.js} +25 -13
- package/{matrixInput-DDs7lvBh.js → matrixInput-BZHnwuib.js} +23 -9
- package/{mdash-6RQrvN6B.js → mdash-D-AfwjXw.js} +2 -2
- package/{nbsp-Bv8MOxpQ.js → nbsp-D2K2UhZb.js} +2 -2
- package/{ndash-9o2u4hWP.js → ndash-DadHhIWX.js} +2 -2
- package/{number-CkoP-Awu.js → number-dzVGZ9ov.js} +6 -6
- package/{orbitalDiagram-B0YGzU6e.js → orbitalDiagram-Dxcuy3dt.js} +2 -2
- package/{orbitalDiagramInput-CMOVOQd6.js → orbitalDiagramInput-CI-jzpnD.js} +25 -10
- package/{p-Ds5IiZOP.js → p-pEbvJ23K.js} +7 -5
- package/package.json +1 -1
- package/{paginatorControls-2F08srE_.js → paginatorControls-DGwC24KV.js} +2 -2
- package/{pegboard-CJ7R1ORC.js → pegboard-DThvj_AK.js} +4 -4
- package/{point-DWqkuQLD.js → point-DRIItKT6.js} +6 -6
- package/{polygon-DVaeOcPw.js → polygon-CyiUEjCg.js} +6 -6
- package/{polyline-DQvHh8rj.js → polyline-Boz-zlQv.js} +5 -5
- package/{pre-C_MW5Olo.js → pre-Bjvq5iJ4.js} +3 -3
- package/{prefigure-Ci1f1zUh.js → prefigure-BPQPwHBD.js} +1 -1
- package/{pretzel-DVucy8kL.js → pretzel-CfNL3RKC.js} +10 -7
- package/{q-CNXXCBSX.js → q-DJbSp6bj.js} +3 -3
- package/{ray-DJJXgWjR.js → ray-BfGfX6gD.js} +5 -5
- package/{ref-Cd36RrOw.js → ref-B-M85Wgb.js} +2 -2
- package/{regionBetweenCurveXAxis-C4leqEex.js → regionBetweenCurveXAxis-CGlQKapF.js} +5 -5
- package/{regionBetweenCurves-BMps4Bio.js → regionBetweenCurves-DV7ARKKw.js} +5 -5
- package/{row-CbA-d6r0.js → row-DBEHryOQ.js} +2 -2
- package/{rq-DOr-Phc5.js → rq-DSkqTb4D.js} +2 -2
- package/{rsq-DIEK5RYn.js → rsq-CmYO91JS.js} +2 -2
- package/{section-DxVcSpPO.js → section-P6nedLi8.js} +26 -22
- package/{sha256-J35x7uWS-BC2XE0XO.js → sha256-J35x7uWS-BtnkRJk3.js} +1 -1
- package/{sideBySide-Dax2p65a.js → sideBySide-B__iobBS.js} +2 -2
- package/{slider-WcUbkagC.js → slider-Cj1kf_PL.js} +6 -5
- package/{solution-pYYqr4mI.js → solution-CugnzBD0.js} +10 -10
- package/{spreadsheet-BrvEPVkR.js → spreadsheet-BDQTKOo4.js} +2 -2
- package/{sq-CsVdwQ0w.js → sq-DRRKkcQ2.js} +3 -3
- package/style.css +7 -0
- package/{subsetOfRealsInput-C7LSCImc.js → subsetOfRealsInput-runRYoEh.js} +34 -6
- package/{summaryStatistics-Dx4n5bYn.js → summaryStatistics-CpAo0yUx.js} +11 -6
- package/{table-BCG2EBik.js → table-DFoJXU6W.js} +2 -2
- package/{tabular-DEiey_kF.js → tabular-CHSfbyFz.js} +2 -2
- package/{tag-CfZ-K_y5.js → tag-CgmbdQFT.js} +2 -2
- package/{text-C6U0VcDc.js → text-Cp6jnCrT.js} +6 -6
- package/{textInput-CaAFDfjE.js → textInput-Dqw-NXoY.js} +12 -9
- package/{tooltip-provider-kvNemycF.js → tooltip-provider-BTQ5leCb.js} +1 -1
- package/{useAnchoredGraphDragHandler-BUbd_SAk.js → useAnchoredGraphDragHandler-CoDUH2rg.js} +1 -1
- package/useDoenetRenderer-DAqF5zFD.js +114 -0
- package/{useSubmitActionWithDelay-BysJ9T7y.js → useSubmitActionWithDelay-DBHyoI8R.js} +52 -24
- package/utils/i18n.d.ts +46 -0
- package/utils/i18n.d.ts.map +1 -0
- package/validationState-DI_lxk1a.js +21 -0
- package/{vector-eEvp4DAc.js → vector-Dnoio46i.js} +6 -6
- package/{video-B7wOIA1h.js → video-DQw2pxWK.js} +4 -4
- package/useDoenetRenderer-BAq1ktng.js +0 -114
- package/validationState-CVwSJZpB.js +0 -13
package/utils/i18n.d.ts
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { Translator } from '../../packages/i18n/dist';
|
|
3
|
+
/**
|
|
4
|
+
* Build the chrome translator for a resolved UI locale.
|
|
5
|
+
*
|
|
6
|
+
* @param uiLocale The chrome's language, already through `resolveUiLocale`.
|
|
7
|
+
* @param localeResources Host-supplied catalogs as locale → FTL source.
|
|
8
|
+
*/
|
|
9
|
+
export declare function useChromeTranslator(uiLocale: string, localeResources?: Record<string, string> | null): Translator;
|
|
10
|
+
/**
|
|
11
|
+
* Build the chrome translator a host's props alone imply.
|
|
12
|
+
*
|
|
13
|
+
* For chrome that sits *outside* the document — the virtual keyboard, the
|
|
14
|
+
* variant selector — where there is no authored `<document lang>` to consult:
|
|
15
|
+
* hence the `undefined` authored language. Inside the document, `DocViewer`
|
|
16
|
+
* resolves the same pair of rules again against the language it parsed out of
|
|
17
|
+
* the source, and mounts a nested provider with the result.
|
|
18
|
+
*
|
|
19
|
+
* @param uiLocale The `uiLocale` prop, if the host set one.
|
|
20
|
+
* @param documentLocale The `documentLocale` prop, if the host set one.
|
|
21
|
+
* @param localeResources Host-supplied catalogs as locale → FTL source.
|
|
22
|
+
*/
|
|
23
|
+
export declare function useHostChromeTranslator(uiLocale: string | null | undefined, documentLocale: string | null | undefined, localeResources?: Record<string, string> | null): Translator;
|
|
24
|
+
/**
|
|
25
|
+
* Publish a translator to every `useT()` below it.
|
|
26
|
+
*
|
|
27
|
+
* Mounted twice per viewer, on purpose: `doenetml.tsx` mounts one from the
|
|
28
|
+
* props alone, covering chrome outside the document, and `DocViewer` nests a
|
|
29
|
+
* second inside it, because only there is an authored `<document lang>` known.
|
|
30
|
+
* The inner one wins for renderers, which is the right split — the keyboard is
|
|
31
|
+
* host chrome, the renderers are inside the document.
|
|
32
|
+
*/
|
|
33
|
+
export declare function I18nProvider({ translate, children, }: {
|
|
34
|
+
translate: Translator;
|
|
35
|
+
children: React.ReactNode;
|
|
36
|
+
}): React.JSX.Element;
|
|
37
|
+
/**
|
|
38
|
+
* The chrome translator in effect.
|
|
39
|
+
*
|
|
40
|
+
* Call it with a string-literal key and an English fallback:
|
|
41
|
+
* `t("answer-correct", undefined, "Correct")`. Both parts are load-bearing —
|
|
42
|
+
* `lint:i18n` matches exactly that shape to check the key exists, and the
|
|
43
|
+
* fallback is what renders if a catalog is somehow missing it.
|
|
44
|
+
*/
|
|
45
|
+
export declare function useT(): Translator;
|
|
46
|
+
//# sourceMappingURL=i18n.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"i18n.d.ts","sourceRoot":"","sources":["../../src/utils/i18n.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA6C,MAAM,OAAO,CAAC;AAClE,OAAO,EAMH,KAAK,UAAU,EAClB,MAAM,cAAc,CAAC;AAYtB;;;;;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;;;;;;;;;;;;GAYG;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,UAAU,CAQZ;AAED;;;;;;;;GAQG;AACH,wBAAgB,YAAY,CAAC,EACzB,SAAS,EACT,QAAQ,GACX,EAAE;IACC,SAAS,EAAE,UAAU,CAAC;IACtB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC7B,qBAMA;AAED;;;;;;;GAOG;AACH,wBAAgB,IAAI,IAAI,UAAU,CAEjC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
function addValidationStateToShortDescription(validationState, shortDescription, t) {
|
|
2
|
+
let suffix = null;
|
|
3
|
+
if (validationState === "correct") {
|
|
4
|
+
suffix = t("validation-correct", void 0, "(Correct)");
|
|
5
|
+
} else if (validationState === "incorrect") {
|
|
6
|
+
suffix = t("validation-incorrect", void 0, "(Incorrect)");
|
|
7
|
+
} else if (validationState === "partialcorrect") {
|
|
8
|
+
suffix = t(
|
|
9
|
+
"validation-partially-correct",
|
|
10
|
+
void 0,
|
|
11
|
+
"(Partially correct)"
|
|
12
|
+
);
|
|
13
|
+
}
|
|
14
|
+
if (suffix === null) {
|
|
15
|
+
return shortDescription;
|
|
16
|
+
}
|
|
17
|
+
return (shortDescription ? shortDescription + " " : "") + suffix;
|
|
18
|
+
}
|
|
19
|
+
export {
|
|
20
|
+
addValidationStateToShortDescription as a
|
|
21
|
+
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { o as DocContext, n as jsxRuntimeExports, t as textRendererStyle, p as DynamicMath } from "./doenetml-
|
|
1
|
+
import { o as DocContext, n as jsxRuntimeExports, t as textRendererStyle, p as DynamicMath } from "./doenetml-CCMBYR_b.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-DH6ZzfYT.js";
|
|
4
|
+
import { u as useDoenetRenderer } from "./useDoenetRenderer-DAqF5zFD.js";
|
|
5
|
+
import { BoardContext, VERTEX_LAYER_OFFSET, LINE_LAYER_OFFSET } from "./graph-CJRztDFF.js";
|
|
6
|
+
import { u as useSourceNavigation, a as attachLineFamilyDragHandlers } from "./lineFamilyDragHandlers-LT5y2nwm.js";
|
|
7
|
+
import { ChoiceInputInlineContext } from "./choiceInput-7JZaBHNZ.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 { q as useRecordVisibilityChanges, n as jsxRuntimeExports } from "./doenetml-CCMBYR_b.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-DAqF5zFD.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-D4h1QV0r.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-CqBvf7rz.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 { y as useAppSelector, z as mainSlice, A as renderersLoadComponent, _ as __variableDynamicImportRuntimeHelper } from "./doenetml-BXSsTmMg.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-8IPcvXqk.js"), "./renderers/JSXGraphRenderer.tsx": () => import("./JSXGraphRenderer-Be41lgIz.js").then((n) => n.m), "./renderers/_error.tsx": () => import("./_error-DhRiszio.js"), "./renderers/alert.tsx": () => import("./alert-CExDcbrh.js"), "./renderers/angle.tsx": () => import("./angle-FCTtCuvN.js"), "./renderers/answer.tsx": () => import("./answer-BLusvBSG.js"), "./renderers/asList.tsx": () => import("./asList-Dv__hv6D.js"), "./renderers/blockQuote.tsx": () => import("./blockQuote-B6Wtw4HN.js"), "./renderers/boolean.tsx": () => import("./boolean-IP59-Zjp.js"), "./renderers/booleanInput.tsx": () => import("./booleanInput-BCNoC_vo.js"), "./renderers/br.tsx": () => import("./br-BqejfFtq.js"), "./renderers/button.tsx": () => import("./button-DzYMy3G6.js"), "./renderers/c.tsx": () => import("./c-wV9nNSPC.js"), "./renderers/cell.tsx": () => import("./cell-Cfv7v4mc.js"), "./renderers/choiceInput.tsx": () => import("./choiceInput-BjbqDU9d.js"), "./renderers/circle.tsx": () => import("./circle-CQ5lWEtc.js"), "./renderers/cobwebPolyline.tsx": () => import("./cobwebPolyline-CAStHK_5.js"), "./renderers/codeEditor.tsx": () => import("./codeEditor-C2tiWOSh.js"), "./renderers/containerBlock.tsx": () => import("./containerBlock-CLEUmhMM.js"), "./renderers/containerInline.tsx": () => import("./containerInline-kv3umsgq.js"), "./renderers/curve.tsx": () => import("./curve-gdmcSsYU.js"), "./renderers/ellipsis.tsx": () => import("./ellipsis-D4fj-dH6.js"), "./renderers/em.tsx": () => import("./em-BLDmBPbZ.js"), "./renderers/embed.tsx": () => import("./embed-DFjdhAuI.js"), "./renderers/feedback.tsx": () => import("./feedback-BDSuY82b.js"), "./renderers/figure.tsx": () => import("./figure-DCQvyct_.js"), "./renderers/footnote.tsx": () => import("./footnote-EqPCQBWN.js"), "./renderers/fractionInput.tsx": () => import("./fractionInput-CLSJPyA_.js"), "./renderers/graph.tsx": () => import("./graph-C6hIOAwD.js"), "./renderers/hint.tsx": () => import("./hint-5LodBIQj.js"), "./renderers/hr.tsx": () => import("./hr-C9sb2QsS.js"), "./renderers/image.tsx": () => import("./image-CVqPuME4.js"), "./renderers/label.tsx": () => import("./label-BH-b9r-w.js"), "./renderers/legend.tsx": () => import("./legend-Dmq310xU.js"), "./renderers/line.tsx": () => import("./line-BerJZTGH.js"), "./renderers/lineSegment.tsx": () => import("./lineSegment-BUtYPLbh.js"), "./renderers/list.tsx": () => import("./list-Ye_2Ltwm.js"), "./renderers/lq.tsx": () => import("./lq-BiqdUNus.js"), "./renderers/lsq.tsx": () => import("./lsq-DiKKUzSa.js"), "./renderers/math.tsx": () => import("./math-CIdkbUN1.js"), "./renderers/mathInput.tsx": () => import("./mathInput-BzRlJdzU.js"), "./renderers/matrixInput.tsx": () => import("./matrixInput-DDs7lvBh.js"), "./renderers/mdash.tsx": () => import("./mdash-6RQrvN6B.js"), "./renderers/nbsp.tsx": () => import("./nbsp-Bv8MOxpQ.js"), "./renderers/ndash.tsx": () => import("./ndash-9o2u4hWP.js"), "./renderers/number.tsx": () => import("./number-CkoP-Awu.js"), "./renderers/orbitalDiagram.tsx": () => import("./orbitalDiagram-B0YGzU6e.js"), "./renderers/orbitalDiagramInput.tsx": () => import("./orbitalDiagramInput-CMOVOQd6.js"), "./renderers/p.tsx": () => import("./p-Ds5IiZOP.js"), "./renderers/paginatorControls.tsx": () => import("./paginatorControls-2F08srE_.js"), "./renderers/pegboard.tsx": () => import("./pegboard-CJ7R1ORC.js"), "./renderers/point.tsx": () => import("./point-DWqkuQLD.js"), "./renderers/polygon.tsx": () => import("./polygon-DVaeOcPw.js"), "./renderers/polyline.tsx": () => import("./polyline-DQvHh8rj.js"), "./renderers/pre.tsx": () => import("./pre-C_MW5Olo.js"), "./renderers/prefigure.tsx": () => import("./prefigure-Ci1f1zUh.js"), "./renderers/pretzel.tsx": () => import("./pretzel-DVucy8kL.js"), "./renderers/q.tsx": () => import("./q-CNXXCBSX.js"), "./renderers/ray.tsx": () => import("./ray-DJJXgWjR.js"), "./renderers/ref.tsx": () => import("./ref-Cd36RrOw.js"), "./renderers/regionBetweenCurveXAxis.tsx": () => import("./regionBetweenCurveXAxis-C4leqEex.js"), "./renderers/regionBetweenCurves.tsx": () => import("./regionBetweenCurves-BMps4Bio.js"), "./renderers/row.tsx": () => import("./row-CbA-d6r0.js"), "./renderers/rq.tsx": () => import("./rq-DOr-Phc5.js"), "./renderers/rsq.tsx": () => import("./rsq-DIEK5RYn.js"), "./renderers/section.tsx": () => import("./section-DxVcSpPO.js"), "./renderers/sideBySide.tsx": () => import("./sideBySide-Dax2p65a.js"), "./renderers/slider.tsx": () => import("./slider-WcUbkagC.js"), "./renderers/solution.tsx": () => import("./solution-pYYqr4mI.js"), "./renderers/spreadsheet.tsx": () => import("./spreadsheet-BrvEPVkR.js"), "./renderers/sq.tsx": () => import("./sq-CsVdwQ0w.js"), "./renderers/subsetOfRealsInput.tsx": () => import("./subsetOfRealsInput-C7LSCImc.js"), "./renderers/summaryStatistics.tsx": () => import("./summaryStatistics-Dx4n5bYn.js"), "./renderers/table.tsx": () => import("./table-BCG2EBik.js"), "./renderers/tabular.tsx": () => import("./tabular-DEiey_kF.js"), "./renderers/tag.tsx": () => import("./tag-CfZ-K_y5.js"), "./renderers/text.tsx": () => import("./text-C6U0VcDc.js"), "./renderers/textInput.tsx": () => import("./textInput-CaAFDfjE.js"), "./renderers/vector.tsx": () => import("./vector-eEvp4DAc.js"), "./renderers/video.tsx": () => import("./video-B7wOIA1h.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
|
-
};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
function addValidationStateToShortDescription(validationState, shortDescription) {
|
|
2
|
-
if (validationState === "correct") {
|
|
3
|
-
shortDescription = (shortDescription ? shortDescription + " " : "") + "(Correct)";
|
|
4
|
-
} else if (validationState === "incorrect") {
|
|
5
|
-
shortDescription = (shortDescription ? shortDescription + " " : "") + "(Incorrect)";
|
|
6
|
-
} else if (validationState === "partialcorrect") {
|
|
7
|
-
shortDescription = (shortDescription ? shortDescription + " " : "") + "(Partially correct)";
|
|
8
|
-
}
|
|
9
|
-
return shortDescription;
|
|
10
|
-
}
|
|
11
|
-
export {
|
|
12
|
-
addValidationStateToShortDescription as a
|
|
13
|
-
};
|