@doenet/doenetml 0.7.24-dev.495 → 0.7.24-dev.496
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-Dh3-9gZO.js → AnswerResponseButton-BrrWb-sk.js} +2 -2
- package/{Description-C784Vv21.js → Description-BZ8oeOL9.js} +1 -1
- package/{DynamicMath-D1wKrLlg.js → DynamicMath-DNJy5-OC.js} +1 -1
- package/{EditorViewer-CgeqFSvi.js → EditorViewer-BtN3PY5x.js} +7 -7
- package/{GraphFrame-zEBOQLV2.js → GraphFrame-l_fXN6oJ.js} +2 -2
- package/{JSXGraphRenderer-CyYe0d3K.js → JSXGraphRenderer-xuqNYEMe.js} +1 -1
- package/{NonInlineMediaWrapper-C6IeqhUk.js → NonInlineMediaWrapper-CcmkTJmz.js} +1 -1
- package/Viewer/DocViewer.d.ts.map +1 -1
- package/Viewer/coreWorkerBoot.d.ts +9 -1
- package/Viewer/coreWorkerBoot.d.ts.map +1 -1
- package/{_error-hqesHzVC.js → _error-6wEbVswo.js} +2 -2
- package/{alert-axYiV_tJ.js → alert-DGIdSxd5.js} +3 -3
- package/{angle-BKq_hmKc.js → angle-B_yqY4eA.js} +7 -7
- package/{answer-BMMoGAJn.js → answer-CsP3EPMl.js} +6 -6
- package/{asList-CC2BVoI_.js → asList-DCXp-O5w.js} +2 -2
- package/{blockQuote-kj3Ck-pZ.js → blockQuote-BdOxQAZX.js} +3 -3
- package/{boolean-BuBdYx-N.js → boolean-w9_LHFn2.js} +2 -2
- package/{booleanInput-BcvmUpXs.js → booleanInput-WvLRmRvQ.js} +7 -7
- package/{br-BRIBO7bD.js → br-BkZHYEyb.js} +2 -2
- package/{button-CMX4IneM.js → button-eO4GcDK0.js} +5 -5
- package/{c-sY8VwhFg.js → c-BQKhLZrA.js} +3 -3
- package/{cell-L0R7RpcY.js → cell-C0WBTaNk.js} +3 -3
- package/{choiceInput-BrWYbJql.js → choiceInput-BhxWosVq.js} +4 -4
- package/{circle-C7ZgorN7.js → circle-CpKUhiP5.js} +6 -6
- package/{cobwebPolyline-DH3cUzkl.js → cobwebPolyline-_r-rG3Nw.js} +4 -4
- package/{codeEditor-D12aWsev.js → codeEditor-CszCj14f.js} +2 -2
- package/{composites-B9f9SwvS.js → composites-Bbo8IP1W.js} +1 -1
- package/{containerBlock-Cc3gEQrI.js → containerBlock-Dyrio5Dv.js} +4 -4
- package/{containerInline-CPpPik-D.js → containerInline--3XrSLzN.js} +4 -4
- package/{curve-C4GzvlkI.js → curve-kTH7dlHM.js} +4 -4
- package/{doenetml-BuSy6I1w.js → doenetml-CJXENjwD.js} +53 -17
- package/doenetml-external-worker.js +2 -2
- package/doenetml-inline-worker.js +3 -3
- package/doenetml-worker/index.esm.js +1 -1
- package/doenetml-worker/index.js +1 -1
- package/{ellipsis-DnFVuA9d.js → ellipsis-D80KnK2G.js} +2 -2
- package/{em-DdD05o3x.js → em-TShdxpOF.js} +3 -3
- package/{embed-B62WIgaH.js → embed-C-EstgJD.js} +2 -2
- package/{feedback-BcxDOMuZ.js → feedback-Cxw3lzpg.js} +4 -4
- package/{figure-CcLohmH5.js → figure--Rh8P7Sz.js} +3 -3
- package/{fillPatterns-CIOIFbrm.js → fillPatterns-B_8jtfYS.js} +1 -1
- package/{footnote-CPEytkdo.js → footnote-DptVzLcw.js} +3 -3
- package/{fractionInput-CiL7mOX5.js → fractionInput-DuK4ef-d.js} +4 -4
- package/{graph-9LOjGTCa.js → graph-CJH3fb_9.js} +6 -6
- package/{hint-C41Ch5XB.js → hint-B4OYwoCZ.js} +4 -4
- package/{hovercard-store-uHO3b4aw.js → hovercard-store-Cor2JG-E.js} +1 -1
- package/{hr-C84KrkaF.js → hr-DxyxAfyw.js} +2 -2
- package/{image-DsR4O6yd.js → image-CRE46C0H.js} +7 -7
- package/{index-CoqrVLpI.js → index-CBRP4-wN.js} +1 -1
- package/{index-B7k3y3yv.js → index-DsDLFuEL.js} +1 -1
- package/{index.es-DGwBETra.js → index.es-DEOewEZn.js} +1 -1
- package/index.js +1 -1
- package/{label-CodBWl3q.js → label-CIpj5Y63.js} +7 -7
- package/{labelWithLatex-Dz50ruqm.js → labelWithLatex-BicLyl1D.js} +2 -2
- package/{legend-D5qk1cn9.js → legend-B6iNoOk3.js} +4 -4
- package/{line-LKhHK3ao.js → line-uTSnEqNp.js} +7 -7
- package/{lineFamilyDragHandlers-B-CET7lf.js → lineFamilyDragHandlers-Df7osYz-.js} +1 -1
- package/{lineSegment-CMe7p4B8.js → lineSegment-Dfyje5QM.js} +5 -5
- package/{list-aDqq9E8_.js → list-D9pGeii4.js} +4 -4
- package/{lq-sk_kpM4g.js → lq-CZICWXNg.js} +2 -2
- package/{lsq-udYhMiy-.js → lsq-C5DeGe8L.js} +2 -2
- package/{markupRenderer-BGYjAPmU.js → markupRenderer-DiDBWayp.js} +1 -1
- package/{math-D5bR8goy.js → math--Up--LZT.js} +7 -7
- package/{mathInput-CqA8QGlC.js → mathInput-DiCsw8Xy.js} +7 -7
- package/{matrixInput-DZ5rWbAH.js → matrixInput-DeDRhwTH.js} +5 -5
- package/{mdash-ByqoX5jk.js → mdash-YpMtTzYb.js} +2 -2
- package/{nbsp-DJyyMGnV.js → nbsp-CzouLmyA.js} +2 -2
- package/{ndash-Cm01kWl7.js → ndash-CesSHMoZ.js} +2 -2
- package/{number-C22PBQNy.js → number-Dsi8t-oT.js} +7 -7
- package/{orbitalDiagram-CTmuEgi-.js → orbitalDiagram-DqW8lDXG.js} +2 -2
- package/{orbitalDiagramInput-ByYETH5z.js → orbitalDiagramInput-Ujhexiv5.js} +3 -3
- package/{p-TtFLz_x5.js → p-JkDCJkLt.js} +4 -4
- package/package.json +1 -1
- package/{paginatorControls-D0_5xOvO.js → paginatorControls-zeS4MeYM.js} +3 -3
- package/{pegboard-pPTxf8sE.js → pegboard-DzlzO4lr.js} +4 -4
- package/{point-D4b8U4lC.js → point-BnRGGL5k.js} +7 -7
- package/{polygon-iydeAeAK.js → polygon-BeS39j3N.js} +6 -6
- package/{polyline-D1Wqv7hE.js → polyline-DjMK8sjj.js} +5 -5
- package/{pre-CQ9y4D0C.js → pre-B9SF1WXw.js} +3 -3
- package/{prefigure-CJkNxksY.js → prefigure-CgQvLn5h.js} +1 -1
- package/{pretzel-CPkDoQpu.js → pretzel-DBniVxdm.js} +4 -4
- package/{q-CZXq0YKe.js → q-CLzPbBkU.js} +3 -3
- package/{ray-BXcVKK2Z.js → ray-Bg6L_yXO.js} +5 -5
- package/{ref-DU5u7LFH.js → ref-CCJXcMPu.js} +2 -2
- package/{regionBetweenCurveXAxis-D8UXPU8g.js → regionBetweenCurveXAxis-CS_AlIVf.js} +5 -5
- package/{regionBetweenCurves-DvRmJcwN.js → regionBetweenCurves-DNvowvoK.js} +5 -5
- package/{row-DvC8EdBh.js → row-Dle_oVKb.js} +2 -2
- package/{rq-JzDMJ0ZL.js → rq-CI5DfsFj.js} +2 -2
- package/{rsq-GgFYOjN0.js → rsq-BB9E3_NA.js} +2 -2
- package/{section-BrgbvDNu.js → section-p0dG4GrG.js} +5 -5
- package/{sha256-DT5xJ2Hv-zsQ-uelX.js → sha256-DT5xJ2Hv-nRhEg6Iu.js} +1 -1
- package/{sideBySide-DE2uxJzi.js → sideBySide-C0hv1H5l.js} +2 -2
- package/{slider-CkjyPDPg.js → slider-CvaKYTQl.js} +4 -4
- package/{slopeField-DzoDI_VI.js → slopeField-C7IAnOmN.js} +2 -2
- package/{solution-D61ajFGy.js → solution-WX05uux-.js} +4 -4
- package/{spreadsheet-DG_DFrQv.js → spreadsheet-YJjdy9w5.js} +2 -2
- package/{sq-Crt8B5Q9.js → sq-ChyPDsQB.js} +3 -3
- package/{subsetOfRealsInput-Cpy9vBVy.js → subsetOfRealsInput-BwDeYfV-.js} +3 -3
- package/{summaryStatistics-DW_aR-Nj.js → summaryStatistics-Dnv8WfMs.js} +2 -2
- package/{table-CbJlvUVx.js → table-DgDuWmAc.js} +2 -2
- package/{tabular-CrEPPxUm.js → tabular-DCqCE_YP.js} +2 -2
- package/{tag-sTOkSoGF.js → tag-Cz5m3LXR.js} +2 -2
- package/{text-BOFBX0YD.js → text-BpAMUhHw.js} +6 -6
- package/{textInput-TRboDv3U.js → textInput-DUcTr-gU.js} +6 -6
- package/{tooltip-provider-MdvzPbk6.js → tooltip-provider-C2iQu8q1.js} +2 -2
- package/{useAnchoredGraphDragHandler-CyQBCDpJ.js → useAnchoredGraphDragHandler-guvyhnhU.js} +1 -1
- package/useDoenetRenderer-BAtxQcWU.js +114 -0
- package/{useFieldCurve-DJVrRZ6y.js → useFieldCurve-DTQt88CG.js} +2 -2
- package/{useSubmitActionWithDelay-Bz9sbOOj.js → useSubmitActionWithDelay-DfA50-Kj.js} +2 -2
- package/utils/handshakeCensus.d.ts +52 -10
- package/utils/handshakeCensus.d.ts.map +1 -1
- package/{vector-QaINZf3K.js → vector-BWEByhmm.js} +7 -7
- package/{vectorField-PPj_aZIR.js → vectorField-De1Z4iOl.js} +2 -2
- package/{video-CYCSnFH1.js → video-BQM_T1_i.js} +4 -4
- package/useDoenetRenderer-BqmSXVL0.js +0 -114
|
@@ -24,6 +24,39 @@
|
|
|
24
24
|
* Everything here is best-effort. A census that cannot be joined or queried
|
|
25
25
|
* reads as "no visible contention", which is the behavior that predates it.
|
|
26
26
|
*/
|
|
27
|
+
/**
|
|
28
|
+
* Lock name held — in `shared` mode, so every holder is granted at once — for
|
|
29
|
+
* the duration of a core handshake.
|
|
30
|
+
*
|
|
31
|
+
* Exported so tests can drive the census the way other realms do: seats taken
|
|
32
|
+
* through the lock manager directly are visible to a query but leave this
|
|
33
|
+
* realm's cached count untouched, which is the state a first boot is really
|
|
34
|
+
* in (#1718).
|
|
35
|
+
*/
|
|
36
|
+
export declare const HANDSHAKE_CENSUS_LOCK = "doenet-handshake-census";
|
|
37
|
+
/**
|
|
38
|
+
* A realm's place in the census, for as long as it holds the handle.
|
|
39
|
+
*/
|
|
40
|
+
export type HandshakeCensusSeat = {
|
|
41
|
+
/** Leave the census. */
|
|
42
|
+
release: () => void;
|
|
43
|
+
/**
|
|
44
|
+
* How many handshakes were in flight — this one included — when the seat
|
|
45
|
+
* was granted, or the neutral 1 wherever the census could not be joined
|
|
46
|
+
* or queried.
|
|
47
|
+
*
|
|
48
|
+
* Counted from inside the grant, which is what makes it usable on a first
|
|
49
|
+
* boot: `concurrentHandshakesSnapshot` answers with the reading before
|
|
50
|
+
* the caller's own refresh, and a realm's first handshake has no reading
|
|
51
|
+
* before it (#1718).
|
|
52
|
+
*
|
|
53
|
+
* A promise, because the count is deliberately NOT what the seat waits
|
|
54
|
+
* for: the handle resolves the moment the lock is granted, and the figure
|
|
55
|
+
* follows a query later. A caller that has already started its handshake
|
|
56
|
+
* consumes it where it lands.
|
|
57
|
+
*/
|
|
58
|
+
count: Promise<number>;
|
|
59
|
+
};
|
|
27
60
|
/**
|
|
28
61
|
* How many logical cores the browser admits to, or 0 where the hint is
|
|
29
62
|
* unavailable (no `navigator`, or a browser that withholds it). Callers decide
|
|
@@ -43,12 +76,15 @@ export declare function reportedCores(): number;
|
|
|
43
76
|
* handshake concludes; if they do not, the browser still drops it when the
|
|
44
77
|
* realm goes away, so a crashed realm cannot inflate the count forever.
|
|
45
78
|
*
|
|
79
|
+
* The handle carries the count the seat was granted against — see
|
|
80
|
+
* `HandshakeCensusSeat.count` for why a first handshake has nowhere else to
|
|
81
|
+
* get one (#1718). It is a promise, so taking a seat still resolves as soon as
|
|
82
|
+
* the lock is granted.
|
|
83
|
+
*
|
|
46
84
|
* Resolves to a no-op handle wherever Web Locks are unavailable — the count
|
|
47
85
|
* then reads as "no visible contention", which is the pre-#1711 behavior.
|
|
48
86
|
*/
|
|
49
|
-
export declare function joinHandshakeCensus(): Promise<
|
|
50
|
-
release: () => void;
|
|
51
|
-
}>;
|
|
87
|
+
export declare function joinHandshakeCensus(): Promise<HandshakeCensusSeat>;
|
|
52
88
|
/**
|
|
53
89
|
* How many core handshakes are in flight across every same-origin realm the
|
|
54
90
|
* browser is running (see the origin-scope note in `webLocks`), including this
|
|
@@ -72,6 +108,11 @@ export declare function countConcurrentHandshakes(): Promise<number>;
|
|
|
72
108
|
* at all — a `DocViewer/i18n` CI failure bisected to exactly that change. A
|
|
73
109
|
* count one boot out of date is a perfectly good input to a timeout; a boot
|
|
74
110
|
* that races itself is not.
|
|
111
|
+
*
|
|
112
|
+
* What a cache costs is a first reading, since a realm's first handshake has
|
|
113
|
+
* no refresh before it. `HandshakeCensusSeat.count` is where that one reading
|
|
114
|
+
* comes from instead (#1718), and it stays off the boot path the same way:
|
|
115
|
+
* arriving mid-handshake, it widens a budget in flight rather than gating one.
|
|
75
116
|
*/
|
|
76
117
|
export declare function concurrentHandshakesSnapshot(): number;
|
|
77
118
|
/**
|
|
@@ -81,13 +122,14 @@ export declare function concurrentHandshakesSnapshot(): number;
|
|
|
81
122
|
*
|
|
82
123
|
* Because the update lands a turn or more later, the reading a caller gets
|
|
83
124
|
* from `concurrentHandshakesSnapshot` is always the one *before* its own
|
|
84
|
-
* refresh. A boot refreshes once per handshake attempt, and
|
|
85
|
-
*
|
|
86
|
-
* the previous attempt's refresh and a first attempt reads the
|
|
87
|
-
* the last attempt
|
|
88
|
-
* another tab's realm drains invisibly (its releases refresh
|
|
89
|
-
* not this one), so the first attempt after one can still read
|
|
90
|
-
* attempt's own refresh corrects the reading for every attempt
|
|
125
|
+
* refresh. A boot refreshes once per handshake attempt, and a census seat
|
|
126
|
+
* refreshes both as it is taken and as it drops — so each attempt's read is
|
|
127
|
+
* answered by the previous attempt's refresh, and a first attempt reads the
|
|
128
|
+
* count as of the last attempt, or the last seat taken or dropped, in this
|
|
129
|
+
* realm. A wave in another tab's realm drains invisibly (its releases refresh
|
|
130
|
+
* its own cache, not this one), so the first attempt after one can still read
|
|
131
|
+
* high; the attempt's own refresh corrects the reading for every attempt
|
|
132
|
+
* after it.
|
|
91
133
|
*/
|
|
92
134
|
export declare function refreshHandshakeCensusCount(): void;
|
|
93
135
|
//# sourceMappingURL=handshakeCensus.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handshakeCensus.d.ts","sourceRoot":"","sources":["../../src/utils/handshakeCensus.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;
|
|
1
|
+
{"version":3,"file":"handshakeCensus.d.ts","sourceRoot":"","sources":["../../src/utils/handshakeCensus.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAIH;;;;;;;;GAQG;AACH,eAAO,MAAM,qBAAqB,4BAA4B,CAAC;AAS/D;;GAEG;AACH,MAAM,MAAM,mBAAmB,GAAG;IAC9B,wBAAwB;IACxB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB;;;;;;;;;;;;;;OAcG;IACH,KAAK,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;CAC1B,CAAC;AAYF;;;;;;;;GAQG;AACH,wBAAgB,aAAa,IAAI,MAAM,CAWtC;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,mBAAmB,IAAI,OAAO,CAAC,mBAAmB,CAAC,CAsGlE;AAED;;;;;;;;GAQG;AACH,wBAAsB,yBAAyB,IAAI,OAAO,CAAC,MAAM,CAAC,CAcjE;AAQD;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,4BAA4B,IAAI,MAAM,CAErD;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,2BAA2B,IAAI,IAAI,CAUlD"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { A as DocContext, q as jsxRuntimeExports, B as textRendererStyle } from "./doenetml-
|
|
1
|
+
import { A as DocContext, q as jsxRuntimeExports, B as textRendererStyle } from "./doenetml-CJXENjwD.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 { D as DynamicMath } from "./DynamicMath-
|
|
7
|
-
import { u as useSourceNavigation, a as attachLineFamilyDragHandlers } from "./lineFamilyDragHandlers-
|
|
8
|
-
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-xuqNYEMe.js";
|
|
4
|
+
import { u as useDoenetRenderer } from "./useDoenetRenderer-BAtxQcWU.js";
|
|
5
|
+
import { BoardContext, VERTEX_LAYER_OFFSET, LINE_LAYER_OFFSET } from "./graph-CJH3fb_9.js";
|
|
6
|
+
import { D as DynamicMath } from "./DynamicMath-DNJy5-OC.js";
|
|
7
|
+
import { u as useSourceNavigation, a as attachLineFamilyDragHandlers } from "./lineFamilyDragHandlers-Df7osYz-.js";
|
|
8
|
+
import { ChoiceInputInlineContext } from "./choiceInput-BhxWosVq.js";
|
|
9
9
|
import { a as buildLineLikeAttributes, c as buildDragHandleAttributes } from "./buildGraphicalAttributes-0RNcbd2S.js";
|
|
10
10
|
import { u as usePointerDragState, a as useBoardPointerTracking } from "./useBoardPointerTracking-DV6a8Wvg.js";
|
|
11
11
|
import { p as pointerEventToUserCoords } from "./dragThreshold-DuSSFrIU.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React__default from "react";
|
|
2
|
-
import { u as useDoenetRenderer } from "./useDoenetRenderer-
|
|
3
|
-
import { u as useFieldFunction, a as useFieldCurve, c as buildVectorFieldData } from "./useFieldCurve-
|
|
2
|
+
import { u as useDoenetRenderer } from "./useDoenetRenderer-BAtxQcWU.js";
|
|
3
|
+
import { u as useFieldFunction, a as useFieldCurve, c as buildVectorFieldData } from "./useFieldCurve-DTQt88CG.js";
|
|
4
4
|
const vectorField = React__default.memo(function VectorField(props) {
|
|
5
5
|
let { SVs } = useDoenetRenderer(props);
|
|
6
6
|
VectorField.ignoreActionsWithoutCore = () => true;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { G as useRecordVisibilityChanges, q as jsxRuntimeExports } from "./doenetml-
|
|
1
|
+
import { G as useRecordVisibilityChanges, q as jsxRuntimeExports } from "./doenetml-CJXENjwD.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-BAtxQcWU.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-BZ8oeOL9.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-CcmkTJmz.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 { x as useAppSelector, y as mainSlice, z as renderersLoadComponent, _ as __variableDynamicImportRuntimeHelper } from "./doenetml-BuSy6I1w.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-zEBOQLV2.js"), "./renderers/JSXGraphRenderer.tsx": () => import("./JSXGraphRenderer-CyYe0d3K.js").then((n) => n.m), "./renderers/_error.tsx": () => import("./_error-hqesHzVC.js"), "./renderers/alert.tsx": () => import("./alert-axYiV_tJ.js"), "./renderers/angle.tsx": () => import("./angle-BKq_hmKc.js"), "./renderers/answer.tsx": () => import("./answer-BMMoGAJn.js"), "./renderers/asList.tsx": () => import("./asList-CC2BVoI_.js"), "./renderers/blockQuote.tsx": () => import("./blockQuote-kj3Ck-pZ.js"), "./renderers/boolean.tsx": () => import("./boolean-BuBdYx-N.js"), "./renderers/booleanInput.tsx": () => import("./booleanInput-BcvmUpXs.js"), "./renderers/br.tsx": () => import("./br-BRIBO7bD.js"), "./renderers/button.tsx": () => import("./button-CMX4IneM.js"), "./renderers/c.tsx": () => import("./c-sY8VwhFg.js"), "./renderers/cell.tsx": () => import("./cell-L0R7RpcY.js"), "./renderers/choiceInput.tsx": () => import("./choiceInput-BrWYbJql.js"), "./renderers/circle.tsx": () => import("./circle-C7ZgorN7.js"), "./renderers/cobwebPolyline.tsx": () => import("./cobwebPolyline-DH3cUzkl.js"), "./renderers/codeEditor.tsx": () => import("./codeEditor-D12aWsev.js"), "./renderers/containerBlock.tsx": () => import("./containerBlock-Cc3gEQrI.js"), "./renderers/containerInline.tsx": () => import("./containerInline-CPpPik-D.js"), "./renderers/curve.tsx": () => import("./curve-C4GzvlkI.js"), "./renderers/ellipsis.tsx": () => import("./ellipsis-DnFVuA9d.js"), "./renderers/em.tsx": () => import("./em-DdD05o3x.js"), "./renderers/embed.tsx": () => import("./embed-B62WIgaH.js"), "./renderers/feedback.tsx": () => import("./feedback-BcxDOMuZ.js"), "./renderers/figure.tsx": () => import("./figure-CcLohmH5.js"), "./renderers/footnote.tsx": () => import("./footnote-CPEytkdo.js"), "./renderers/fractionInput.tsx": () => import("./fractionInput-CiL7mOX5.js"), "./renderers/graph.tsx": () => import("./graph-9LOjGTCa.js"), "./renderers/hint.tsx": () => import("./hint-C41Ch5XB.js"), "./renderers/hr.tsx": () => import("./hr-C84KrkaF.js"), "./renderers/image.tsx": () => import("./image-DsR4O6yd.js"), "./renderers/label.tsx": () => import("./label-CodBWl3q.js"), "./renderers/legend.tsx": () => import("./legend-D5qk1cn9.js"), "./renderers/line.tsx": () => import("./line-LKhHK3ao.js"), "./renderers/lineSegment.tsx": () => import("./lineSegment-CMe7p4B8.js"), "./renderers/list.tsx": () => import("./list-aDqq9E8_.js"), "./renderers/lq.tsx": () => import("./lq-sk_kpM4g.js"), "./renderers/lsq.tsx": () => import("./lsq-udYhMiy-.js"), "./renderers/math.tsx": () => import("./math-D5bR8goy.js"), "./renderers/mathInput.tsx": () => import("./mathInput-CqA8QGlC.js"), "./renderers/matrixInput.tsx": () => import("./matrixInput-DZ5rWbAH.js"), "./renderers/mdash.tsx": () => import("./mdash-ByqoX5jk.js"), "./renderers/nbsp.tsx": () => import("./nbsp-DJyyMGnV.js"), "./renderers/ndash.tsx": () => import("./ndash-Cm01kWl7.js"), "./renderers/number.tsx": () => import("./number-C22PBQNy.js"), "./renderers/orbitalDiagram.tsx": () => import("./orbitalDiagram-CTmuEgi-.js"), "./renderers/orbitalDiagramInput.tsx": () => import("./orbitalDiagramInput-ByYETH5z.js"), "./renderers/p.tsx": () => import("./p-TtFLz_x5.js"), "./renderers/paginatorControls.tsx": () => import("./paginatorControls-D0_5xOvO.js"), "./renderers/pegboard.tsx": () => import("./pegboard-pPTxf8sE.js"), "./renderers/point.tsx": () => import("./point-D4b8U4lC.js"), "./renderers/polygon.tsx": () => import("./polygon-iydeAeAK.js"), "./renderers/polyline.tsx": () => import("./polyline-D1Wqv7hE.js"), "./renderers/pre.tsx": () => import("./pre-CQ9y4D0C.js"), "./renderers/prefigure.tsx": () => import("./prefigure-CJkNxksY.js"), "./renderers/pretzel.tsx": () => import("./pretzel-CPkDoQpu.js"), "./renderers/q.tsx": () => import("./q-CZXq0YKe.js"), "./renderers/ray.tsx": () => import("./ray-BXcVKK2Z.js"), "./renderers/ref.tsx": () => import("./ref-DU5u7LFH.js"), "./renderers/regionBetweenCurveXAxis.tsx": () => import("./regionBetweenCurveXAxis-D8UXPU8g.js"), "./renderers/regionBetweenCurves.tsx": () => import("./regionBetweenCurves-DvRmJcwN.js"), "./renderers/row.tsx": () => import("./row-DvC8EdBh.js"), "./renderers/rq.tsx": () => import("./rq-JzDMJ0ZL.js"), "./renderers/rsq.tsx": () => import("./rsq-GgFYOjN0.js"), "./renderers/section.tsx": () => import("./section-BrgbvDNu.js"), "./renderers/sideBySide.tsx": () => import("./sideBySide-DE2uxJzi.js"), "./renderers/slider.tsx": () => import("./slider-CkjyPDPg.js"), "./renderers/slopeField.tsx": () => import("./slopeField-DzoDI_VI.js"), "./renderers/solution.tsx": () => import("./solution-D61ajFGy.js"), "./renderers/spreadsheet.tsx": () => import("./spreadsheet-DG_DFrQv.js"), "./renderers/sq.tsx": () => import("./sq-Crt8B5Q9.js"), "./renderers/subsetOfRealsInput.tsx": () => import("./subsetOfRealsInput-Cpy9vBVy.js"), "./renderers/summaryStatistics.tsx": () => import("./summaryStatistics-DW_aR-Nj.js"), "./renderers/table.tsx": () => import("./table-CbJlvUVx.js"), "./renderers/tabular.tsx": () => import("./tabular-CrEPPxUm.js"), "./renderers/tag.tsx": () => import("./tag-sTOkSoGF.js"), "./renderers/text.tsx": () => import("./text-BOFBX0YD.js"), "./renderers/textInput.tsx": () => import("./textInput-TRboDv3U.js"), "./renderers/vector.tsx": () => import("./vector-QaINZf3K.js"), "./renderers/vectorField.tsx": () => import("./vectorField-PPj_aZIR.js"), "./renderers/video.tsx": () => import("./video-CYCSnFH1.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
|
-
};
|