@doenet/doenetml-iframe 0.7.0-beta11 → 0.7.0-beta12
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/index.js +4 -4
- package/index.js.map +1 -1
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -23709,7 +23709,7 @@ function requireCssesc() {
|
|
|
23709
23709
|
return cssesc_1;
|
|
23710
23710
|
}
|
|
23711
23711
|
requireCssesc();
|
|
23712
|
-
const viewerIframeJsSource = '(function() {\n "use strict";\n document.addEventListener("DOMContentLoaded", async () => {\n let pause100 = function() {\n return new Promise((resolve, _reject) => {\n setTimeout(resolve, 100);\n });\n };\n for (let i = 0; i < 10; i++) {\n if (typeof window.renderDoenetViewerToContainer === "function") {\n break;\n }\n await pause100();\n }\n if (typeof window.renderDoenetViewerToContainer !== "function") {\n return messageParentFromViewer({\n error: "Invalid DoenetML version or DoenetML package not found"\n });\n }\n });\n ComlinkViewer.expose(\n { renderViewerWithFunctionProps },\n ComlinkViewer.windowEndpoint(globalThis.parent)\n );\n function renderViewerWithFunctionProps(...args) {\n const augmentedDoenetViewerProps = { ...doenetViewerProps };\n augmentedDoenetViewerProps.externalVirtualKeyboardProvided = true;\n for (const propName of doenetViewerPropsSpecified) {\n if (!(propName in doenetViewerProps)) {\n const idx = args.indexOf(propName);\n if (idx !== -1) {\n augmentedDoenetViewerProps[propName] = args[idx + 1];\n }\n }\n }\n if (!doenetViewerPropsSpecified.includes("requestScrollTo")) {\n augmentedDoenetViewerProps.requestScrollTo = (offset) => {\n messageParentFromViewer({ type: "scrollTo", offset });\n };\n }\n window.renderDoenetViewerToContainer(\n document.getElementById("root"),\n void 0,\n augmentedDoenetViewerProps\n );\n }\n messageParentFromViewer({ iframeReady: true });\n
|
|
23712
|
+
const viewerIframeJsSource = '(function() {\n "use strict";\n document.addEventListener("DOMContentLoaded", async () => {\n let pause100 = function() {\n return new Promise((resolve, _reject) => {\n setTimeout(resolve, 100);\n });\n };\n for (let i = 0; i < 10; i++) {\n if (typeof window.renderDoenetViewerToContainer === "function") {\n break;\n }\n await pause100();\n }\n if (typeof window.renderDoenetViewerToContainer !== "function") {\n return messageParentFromViewer({\n error: "Invalid DoenetML version or DoenetML package not found"\n });\n }\n });\n ComlinkViewer.expose(\n { renderViewerWithFunctionProps },\n ComlinkViewer.windowEndpoint(globalThis.parent)\n );\n function renderViewerWithFunctionProps(...args) {\n const augmentedDoenetViewerProps = { ...doenetViewerProps };\n augmentedDoenetViewerProps.externalVirtualKeyboardProvided = true;\n for (const propName of doenetViewerPropsSpecified) {\n if (!(propName in doenetViewerProps)) {\n const idx = args.indexOf(propName);\n if (idx !== -1) {\n augmentedDoenetViewerProps[propName] = args[idx + 1];\n }\n }\n }\n if (!doenetViewerPropsSpecified.includes("requestScrollTo")) {\n augmentedDoenetViewerProps.requestScrollTo = (offset) => {\n messageParentFromViewer({ type: "scrollTo", offset });\n };\n }\n window.renderDoenetViewerToContainer(\n document.getElementById("root"),\n void 0,\n augmentedDoenetViewerProps\n );\n }\n messageParentFromViewer({ iframeReady: true });\n function messageParentFromViewer(data) {\n window.parent.postMessage(\n {\n origin: viewerId,\n data\n },\n window.parent.origin\n );\n }\n})();\n';
|
|
23713
23713
|
const editorIframeJsSource = '(function() {\n "use strict";\n document.addEventListener("DOMContentLoaded", async () => {\n let pause100 = function() {\n return new Promise((resolve, _reject) => {\n setTimeout(resolve, 100);\n });\n };\n for (let i = 0; i < 10; i++) {\n if (typeof window.renderDoenetViewerToContainer === "function") {\n break;\n }\n await pause100();\n }\n if (typeof window.renderDoenetEditorToContainer !== "function") {\n return messageParentFromEditor({\n error: "Invalid DoenetML version or DoenetML package not found"\n });\n }\n });\n ComlinkEditor.expose(\n { renderEditorWithFunctionProps },\n ComlinkEditor.windowEndpoint(globalThis.parent)\n );\n function renderEditorWithFunctionProps(...args) {\n const augmentedDoenetEditorProps = { ...doenetEditorProps };\n augmentedDoenetEditorProps.externalVirtualKeyboardProvided = true;\n for (const propName of doenetEditorPropsSpecified) {\n if (!(propName in doenetEditorProps)) {\n const idx = args.indexOf(propName);\n if (idx !== -1) {\n augmentedDoenetEditorProps[propName] = args[idx + 1];\n }\n }\n }\n window.renderDoenetEditorToContainer(\n document.getElementById("root"),\n void 0,\n augmentedDoenetEditorProps\n );\n }\n messageParentFromEditor({ iframeReady: true });\n function messageParentFromEditor(data) {\n window.parent.postMessage(\n {\n origin: editorId,\n data\n },\n window.parent.origin\n );\n }\n})();\n';
|
|
23714
23714
|
function createHtmlForDoenetViewer(id2, doenetML, doenetViewerProps, standaloneUrl, cssUrl) {
|
|
23715
23715
|
const doenetViewerPropsSpecified = Object.keys(doenetViewerProps);
|
|
@@ -23730,7 +23730,7 @@ function createHtmlForDoenetViewer(id2, doenetML, doenetViewerProps, standaloneU
|
|
|
23730
23730
|
// It assumes that viewerId, doenetViewerProps, doenetViewerPropsSpecified, and ComlinkViewer are defined in the global scope.
|
|
23731
23731
|
${viewerIframeJsSource}
|
|
23732
23732
|
<\/script>
|
|
23733
|
-
<div id="root">
|
|
23733
|
+
<div id="root" data-doenet-message-parent="true">
|
|
23734
23734
|
<script type="text/doenetml">${doenetML}<\/script>
|
|
23735
23735
|
</div>
|
|
23736
23736
|
</body>
|
|
@@ -23757,7 +23757,7 @@ function createHtmlForDoenetEditor(id2, doenetML, width, doenetEditorProps, stan
|
|
|
23757
23757
|
// It assumes that editorId, doenetEditorProps, doenetEditorPropsSpecified, and ComlinkEditor are defined in the global scope.
|
|
23758
23758
|
${editorIframeJsSource}
|
|
23759
23759
|
<\/script>
|
|
23760
|
-
<div id="root">
|
|
23760
|
+
<div id="root" data-doenet-message-parent="true">
|
|
23761
23761
|
<script type="text/doenetml">${doenetML}<\/script>
|
|
23762
23762
|
</div>
|
|
23763
23763
|
</body>
|
|
@@ -46764,7 +46764,7 @@ function ExternalVirtualKeyboard() {
|
|
|
46764
46764
|
}
|
|
46765
46765
|
);
|
|
46766
46766
|
}
|
|
46767
|
-
const version = "0.7.0-
|
|
46767
|
+
const version = "0.7.0-beta12";
|
|
46768
46768
|
const latestDoenetmlVersion = version;
|
|
46769
46769
|
function DoenetViewer({
|
|
46770
46770
|
doenetML,
|