@doenet/doenetml-iframe 0.7.24-dev.485 → 0.7.24-dev.486

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/README.md CHANGED
@@ -289,6 +289,9 @@ again (parked when off-screen and over budget).
289
289
  Notes:
290
290
 
291
291
  - Eviction is least-recently-visible first.
292
+ - A boot slot is released when the viewer's document initializes *or* when
293
+ its core cannot be started at all, so a failed activity does not hold a
294
+ slot until the wrapper's 90 s boot watchdog expires.
292
295
  - While parked, a viewer emits no reports (its state was flushed at park
293
296
  time). A host `SPLICE.flushState` broadcast is answered by the wrapper on
294
297
  the parked viewer's behalf, so pre-navigation flush round-trips don't
package/index.js CHANGED
@@ -29673,10 +29673,16 @@ function createBootScript(boundConsts, compiledEntryPoint) {
29673
29673
  ${compiledEntryPoint}
29674
29674
  <\/script>`;
29675
29675
  }
29676
+ const BOOT_CONCLUDING_CALLBACKS = [
29677
+ "initializedCallback",
29678
+ "coreStartFailedCallback"
29679
+ ];
29676
29680
  function createHtmlForDoenetViewer(id2, doenetML, doenetViewerProps, standaloneUrl, cssUrl, useSharedCoreWorker = false, windowed = false) {
29677
29681
  const doenetViewerPropsSpecified = Object.keys(doenetViewerProps);
29678
- if (!doenetViewerPropsSpecified.includes("initializedCallback")) {
29679
- doenetViewerPropsSpecified.push("initializedCallback");
29682
+ for (const key of BOOT_CONCLUDING_CALLBACKS) {
29683
+ if (!doenetViewerPropsSpecified.includes(key)) {
29684
+ doenetViewerPropsSpecified.push(key);
29685
+ }
29680
29686
  }
29681
29687
  return `
29682
29688
  <html style="overflow:hidden">
@@ -68524,7 +68530,7 @@ function ExternalVirtualKeyboard({
68524
68530
  }
68525
68531
  );
68526
68532
  }
68527
- const version = "0.7.24-dev.485";
68533
+ const version = "0.7.24-dev.486";
68528
68534
  const latestDoenetmlVersion = version;
68529
68535
  function subscribeToPinnedTheme() {
68530
68536
  return () => {
@@ -68596,25 +68602,35 @@ function DoenetViewer({
68596
68602
  clearBootWatchdog();
68597
68603
  releaseBootSlot(id2);
68598
68604
  }
68599
- const composedInitializedCallbackRef = React__default.useRef(null);
68600
- if (composedInitializedCallbackRef.current === null) {
68601
- composedInitializedCallbackRef.current = (arg) => {
68602
- relinquishBootSlot();
68603
- doenetViewerPropsRef.current.initializedCallback?.(arg);
68604
- };
68605
+ const composedBootCallbacksRef = React__default.useRef(null);
68606
+ if (composedBootCallbacksRef.current === null) {
68607
+ const composed = /* @__PURE__ */ Object.create(null);
68608
+ for (const key of BOOT_CONCLUDING_CALLBACKS) {
68609
+ composed[key] = (arg) => {
68610
+ relinquishBootSlot();
68611
+ doenetViewerPropsRef.current[key]?.(arg);
68612
+ };
68613
+ }
68614
+ composedBootCallbacksRef.current = composed;
68605
68615
  }
68606
68616
  function functionPropToProxy(key, prop) {
68607
- if (windowed && key === "initializedCallback") {
68608
- return composedInitializedCallbackRef.current;
68617
+ const composed = composedBootCallbacksRef.current[key];
68618
+ if (windowed && composed) {
68619
+ return composed;
68609
68620
  }
68610
68621
  return prop;
68611
68622
  }
68612
- function appendComposedInitializedCallback(proxiedFunctions, hostFunctions) {
68613
- if (windowed && !("initializedCallback" in hostFunctions)) {
68614
- proxiedFunctions.push("initializedCallback");
68615
- proxiedFunctions.push(
68616
- proxy(composedInitializedCallbackRef.current)
68617
- );
68623
+ function appendComposedBootCallbacks(proxiedFunctions, hostFunctions) {
68624
+ if (!windowed) {
68625
+ return;
68626
+ }
68627
+ for (const key of BOOT_CONCLUDING_CALLBACKS) {
68628
+ if (!(key in hostFunctions)) {
68629
+ proxiedFunctions.push(key);
68630
+ proxiedFunctions.push(
68631
+ proxy(composedBootCallbacksRef.current[key])
68632
+ );
68633
+ }
68618
68634
  }
68619
68635
  }
68620
68636
  const [height, setHeight] = React__default.useState("500px");
@@ -68826,7 +68842,7 @@ function DoenetViewer({
68826
68842
  );
68827
68843
  }
68828
68844
  }
68829
- appendComposedInitializedCallback(
68845
+ appendComposedBootCallbacks(
68830
68846
  proxiedFunctions,
68831
68847
  registeredFunctions
68832
68848
  );
@@ -68906,7 +68922,7 @@ function DoenetViewer({
68906
68922
  proxiedFunctions.push(key);
68907
68923
  proxiedFunctions.push(proxy(functionPropToProxy(key, val)));
68908
68924
  }
68909
- appendComposedInitializedCallback(proxiedFunctions, current);
68925
+ appendComposedBootCallbacks(proxiedFunctions, current);
68910
68926
  const action = (remote) => {
68911
68927
  remote.updateViewerFunctionProps(...proxiedFunctions).catch(
68912
68928
  logComlinkError(