@doenet/doenetml-iframe 0.7.0-alpha23 → 0.7.0-alpha24
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.d.ts +3 -0
- package/index.js +7 -9
- package/index.js.map +1 -1
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ import { DoenetEditor as DoenetEditor_2 } from '@doenet/doenetml';
|
|
|
3
3
|
import { DoenetViewer as DoenetViewer_2 } from '@doenet/doenetml';
|
|
4
4
|
import { ErrorDescription } from '@doenet/utils';
|
|
5
5
|
import { mathjaxConfig } from '@doenet/utils';
|
|
6
|
+
import { parseAndCompile } from '@doenet/parser';
|
|
6
7
|
import { WarningDescription } from '@doenet/utils';
|
|
7
8
|
|
|
8
9
|
/**
|
|
@@ -93,6 +94,8 @@ export { ErrorDescription }
|
|
|
93
94
|
|
|
94
95
|
export { mathjaxConfig }
|
|
95
96
|
|
|
97
|
+
export { parseAndCompile }
|
|
98
|
+
|
|
96
99
|
export declare const version: string;
|
|
97
100
|
|
|
98
101
|
export { WarningDescription }
|
package/index.js
CHANGED
|
@@ -26878,7 +26878,7 @@ const mathjaxConfig = {
|
|
|
26878
26878
|
load: ["[tex]/noerrors"]
|
|
26879
26879
|
}
|
|
26880
26880
|
};
|
|
26881
|
-
const viewerIframeJsSource = '(function() {\n "use strict";\n document.addEventListener("DOMContentLoaded", () => {\n if (typeof window.renderDoenetViewerToContainer !== "function") {\n return messageParentFromViewer({\n error: "Invalid DoenetML version or DoenetML package not found"\n });\n }\n window.renderDoenetViewerToContainer(\n document.getElementById("root"),\n void 0,\n {\n ...doenetViewerProps,\n externalVirtualKeyboardProvided: true,\n // Callbacks have to be explicitly overridden here so that they\n // can message the parent React component (outside the iframe).\n updateCreditAchievedCallback: (args) => {\n messageParentFromViewer({\n callback: "updateCreditAchievedCallback",\n args\n });\n },\n
|
|
26881
|
+
const viewerIframeJsSource = '(function() {\n "use strict";\n document.addEventListener("DOMContentLoaded", () => {\n if (typeof window.renderDoenetViewerToContainer !== "function") {\n return messageParentFromViewer({\n error: "Invalid DoenetML version or DoenetML package not found"\n });\n }\n window.renderDoenetViewerToContainer(\n document.getElementById("root"),\n void 0,\n {\n ...doenetViewerProps,\n externalVirtualKeyboardProvided: true,\n // Callbacks have to be explicitly overridden here so that they\n // can message the parent React component (outside the iframe).\n updateCreditAchievedCallback: (args) => {\n messageParentFromViewer({\n callback: "updateCreditAchievedCallback",\n args\n });\n },\n setIsInErrorState: (args) => {\n messageParentFromViewer({\n callback: "setIsInErrorState",\n args\n });\n },\n generatedVariantCallback: (args) => {\n messageParentFromViewer({\n callback: "generatedVariantCallback",\n args\n });\n },\n setErrorsAndWarningsCallback: (args) => {\n messageParentFromViewer({\n callback: "setErrorsAndWarningsCallback",\n args\n });\n }\n }\n );\n });\n window.addEventListener("message", (e) => {\n if (e.data.subject.startsWith("SPLICE") && !e.data.subject.endsWith("response")) {\n window.parent.postMessage(e.data);\n }\n });\n function messageParentFromViewer(data) {\n window.parent.postMessage(\n {\n origin: viewerId,\n data\n },\n window.parent.origin\n );\n }\n})();\n';
|
|
26882
26882
|
const editorIframeJsSource = '(function() {\n "use strict";\n document.addEventListener("DOMContentLoaded", () => {\n if (typeof window.renderDoenetEditorToContainer !== "function") {\n return messageParentFromEditor({\n error: "Invalid DoenetML version or DoenetML package not found"\n });\n }\n window.renderDoenetEditorToContainer(\n document.getElementById("root"),\n void 0,\n {\n ...doenetEditorProps,\n externalVirtualKeyboardProvided: true,\n // Callbacks have to be explicitly overridden here so that they\n // can message the parent React component (outside the iframe).\n doenetmlChangeCallback: (args) => {\n messageParentFromEditor({\n callback: "doenetmlChangeCallback",\n args\n });\n },\n immediateDoenetmlChangeCallback: (args) => {\n messageParentFromEditor({\n callback: "immediateDoenetmlChangeCallback",\n args\n });\n }\n }\n );\n });\n function messageParentFromEditor(data) {\n window.parent.postMessage(\n {\n origin: editorId,\n data\n },\n window.parent.origin\n );\n }\n})();\n';
|
|
26883
26883
|
var __defProp$2 = Object.defineProperty;
|
|
26884
26884
|
var __defNormalProp$2 = (obj, key, value) => key in obj ? __defProp$2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
@@ -49561,7 +49561,7 @@ function ExternalVirtualKeyboard() {
|
|
|
49561
49561
|
}
|
|
49562
49562
|
);
|
|
49563
49563
|
}
|
|
49564
|
-
const version = "0.7.0-
|
|
49564
|
+
const version = "0.7.0-alpha24";
|
|
49565
49565
|
const latestDoenetmlVersion = version;
|
|
49566
49566
|
function DoenetViewer({
|
|
49567
49567
|
doenetML,
|
|
@@ -49600,7 +49600,7 @@ function DoenetViewer({
|
|
|
49600
49600
|
}
|
|
49601
49601
|
React__default__default.useEffect(() => {
|
|
49602
49602
|
const listener3 = (event) => {
|
|
49603
|
-
var _a, _b, _c, _d, _e2, _f, _g
|
|
49603
|
+
var _a, _b, _c, _d, _e2, _f, _g;
|
|
49604
49604
|
if (event.data.subject === "SPLICE.getState.response") {
|
|
49605
49605
|
(_b = (_a = ref.current) == null ? void 0 : _a.contentWindow) == null ? void 0 : _b.postMessage(event.data);
|
|
49606
49606
|
return;
|
|
@@ -49619,20 +49619,17 @@ function DoenetViewer({
|
|
|
49619
49619
|
data.args
|
|
49620
49620
|
);
|
|
49621
49621
|
}
|
|
49622
|
-
case "updateAttemptNumber": {
|
|
49623
|
-
return (_e2 = doenetViewerProps.updateAttemptNumber) == null ? void 0 : _e2.call(doenetViewerProps, data.args);
|
|
49624
|
-
}
|
|
49625
49622
|
case "setIsInErrorState": {
|
|
49626
|
-
return (
|
|
49623
|
+
return (_e2 = doenetViewerProps.setIsInErrorState) == null ? void 0 : _e2.call(doenetViewerProps, data.args);
|
|
49627
49624
|
}
|
|
49628
49625
|
case "generatedVariantCallback": {
|
|
49629
|
-
return (
|
|
49626
|
+
return (_f = doenetViewerProps.generatedVariantCallback) == null ? void 0 : _f.call(
|
|
49630
49627
|
doenetViewerProps,
|
|
49631
49628
|
data.args
|
|
49632
49629
|
);
|
|
49633
49630
|
}
|
|
49634
49631
|
case "setErrorsAndWarningsCallback": {
|
|
49635
|
-
return (
|
|
49632
|
+
return (_g = doenetViewerProps.setErrorsAndWarningsCallback) == null ? void 0 : _g.call(
|
|
49636
49633
|
doenetViewerProps,
|
|
49637
49634
|
data.args
|
|
49638
49635
|
);
|
|
@@ -49829,6 +49826,7 @@ export {
|
|
|
49829
49826
|
DoenetEditor,
|
|
49830
49827
|
DoenetViewer,
|
|
49831
49828
|
mathjaxConfig,
|
|
49829
|
+
parseAndCompile,
|
|
49832
49830
|
version
|
|
49833
49831
|
};
|
|
49834
49832
|
//# sourceMappingURL=index.js.map
|