@pie-element/ebsr 11.0.0 → 12.0.1-esmbeta.1
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/CHANGELOG.md +22 -0
- package/configure/CHANGELOG.md +8 -0
- package/configure/node_modules/@pie-element/multiple-choice/CHANGELOG.json +1972 -0
- package/configure/node_modules/@pie-element/multiple-choice/CHANGELOG.md +4186 -0
- package/configure/node_modules/@pie-element/multiple-choice/LICENSE.md +5 -0
- package/configure/node_modules/@pie-element/multiple-choice/PRINT.md +35 -0
- package/configure/node_modules/@pie-element/multiple-choice/README.md +56 -0
- package/configure/node_modules/@pie-element/multiple-choice/choice.png +0 -0
- package/configure/node_modules/@pie-element/multiple-choice/configure/CHANGELOG.json +1387 -0
- package/configure/node_modules/@pie-element/multiple-choice/configure/CHANGELOG.md +3332 -0
- package/configure/node_modules/@pie-element/multiple-choice/configure/lib/defaults.js +202 -0
- package/configure/node_modules/@pie-element/multiple-choice/configure/lib/defaults.js.map +1 -0
- package/configure/node_modules/@pie-element/multiple-choice/configure/lib/index.js +248 -0
- package/configure/node_modules/@pie-element/multiple-choice/configure/lib/index.js.map +1 -0
- package/configure/node_modules/@pie-element/multiple-choice/configure/lib/main.js +597 -0
- package/configure/node_modules/@pie-element/multiple-choice/configure/lib/main.js.map +1 -0
- package/configure/node_modules/@pie-element/multiple-choice/configure/lib/utils.js +18 -0
- package/configure/node_modules/@pie-element/multiple-choice/configure/lib/utils.js.map +1 -0
- package/configure/node_modules/@pie-element/multiple-choice/configure/package.json +20 -0
- package/configure/node_modules/@pie-element/multiple-choice/controller/CHANGELOG.json +527 -0
- package/configure/node_modules/@pie-element/multiple-choice/controller/CHANGELOG.md +2297 -0
- package/configure/node_modules/@pie-element/multiple-choice/controller/lib/defaults.js +34 -0
- package/configure/node_modules/@pie-element/multiple-choice/controller/lib/defaults.js.map +1 -0
- package/configure/node_modules/@pie-element/multiple-choice/controller/lib/index.js +346 -0
- package/configure/node_modules/@pie-element/multiple-choice/controller/lib/index.js.map +1 -0
- package/configure/node_modules/@pie-element/multiple-choice/controller/lib/utils.js +28 -0
- package/configure/node_modules/@pie-element/multiple-choice/controller/lib/utils.js.map +1 -0
- package/configure/node_modules/@pie-element/multiple-choice/controller/package.json +15 -0
- package/configure/node_modules/@pie-element/multiple-choice/docs/config-schema.json +2993 -0
- package/configure/node_modules/@pie-element/multiple-choice/docs/config-schema.json.md +2217 -0
- package/configure/node_modules/@pie-element/multiple-choice/docs/demo/config.js +8 -0
- package/configure/node_modules/@pie-element/multiple-choice/docs/demo/generate.js +61 -0
- package/configure/node_modules/@pie-element/multiple-choice/docs/demo/index.html +1 -0
- package/configure/node_modules/@pie-element/multiple-choice/docs/demo/session.js +7 -0
- package/configure/node_modules/@pie-element/multiple-choice/docs/pie-schema.json +1332 -0
- package/configure/node_modules/@pie-element/multiple-choice/docs/pie-schema.json.md +1015 -0
- package/configure/node_modules/@pie-element/multiple-choice/esm/configure.css +847 -0
- package/configure/node_modules/@pie-element/multiple-choice/esm/configure.js +1218 -0
- package/configure/node_modules/@pie-element/multiple-choice/esm/configure.js.map +1 -0
- package/configure/node_modules/@pie-element/multiple-choice/esm/controller.css +847 -0
- package/configure/node_modules/@pie-element/multiple-choice/esm/controller.js +324 -0
- package/configure/node_modules/@pie-element/multiple-choice/esm/controller.js.map +1 -0
- package/configure/node_modules/@pie-element/multiple-choice/esm/element.css +847 -0
- package/configure/node_modules/@pie-element/multiple-choice/esm/element.js +3287 -0
- package/configure/node_modules/@pie-element/multiple-choice/esm/element.js.map +1 -0
- package/configure/node_modules/@pie-element/multiple-choice/esm/print.css +847 -0
- package/configure/node_modules/@pie-element/multiple-choice/esm/print.js +3017 -0
- package/configure/node_modules/@pie-element/multiple-choice/esm/print.js.map +1 -0
- package/configure/node_modules/@pie-element/multiple-choice/lib/choice-input.js +427 -0
- package/configure/node_modules/@pie-element/multiple-choice/lib/choice-input.js.map +1 -0
- package/configure/node_modules/@pie-element/multiple-choice/lib/choice.js +252 -0
- package/configure/node_modules/@pie-element/multiple-choice/lib/choice.js.map +1 -0
- package/configure/node_modules/@pie-element/multiple-choice/lib/feedback-tick.js +174 -0
- package/configure/node_modules/@pie-element/multiple-choice/lib/feedback-tick.js.map +1 -0
- package/configure/node_modules/@pie-element/multiple-choice/lib/index.js +388 -0
- package/configure/node_modules/@pie-element/multiple-choice/lib/index.js.map +1 -0
- package/configure/node_modules/@pie-element/multiple-choice/lib/main.js +108 -0
- package/configure/node_modules/@pie-element/multiple-choice/lib/main.js.map +1 -0
- package/configure/node_modules/@pie-element/multiple-choice/lib/multiple-choice.js +469 -0
- package/configure/node_modules/@pie-element/multiple-choice/lib/multiple-choice.js.map +1 -0
- package/configure/node_modules/@pie-element/multiple-choice/lib/print.js +129 -0
- package/configure/node_modules/@pie-element/multiple-choice/lib/print.js.map +1 -0
- package/configure/node_modules/@pie-element/multiple-choice/lib/session-updater.js +48 -0
- package/configure/node_modules/@pie-element/multiple-choice/lib/session-updater.js.map +1 -0
- package/configure/node_modules/@pie-element/multiple-choice/module/configure.js +1 -0
- package/configure/node_modules/@pie-element/multiple-choice/module/controller.js +3472 -0
- package/configure/node_modules/@pie-element/multiple-choice/module/demo.js +86 -0
- package/configure/node_modules/@pie-element/multiple-choice/module/element.js +1 -0
- package/configure/node_modules/@pie-element/multiple-choice/module/index.html +21 -0
- package/configure/node_modules/@pie-element/multiple-choice/module/index.js +2 -0
- package/configure/node_modules/@pie-element/multiple-choice/module/manifest.json +10 -0
- package/configure/node_modules/@pie-element/multiple-choice/module/print-demo.js +124 -0
- package/configure/node_modules/@pie-element/multiple-choice/module/print.html +18 -0
- package/configure/node_modules/@pie-element/multiple-choice/module/print.js +1 -0
- package/configure/node_modules/@pie-element/multiple-choice/package.json +53 -0
- package/configure/node_modules/@pie-lib/correct-answer-toggle/CHANGELOG.json +1 -0
- package/configure/node_modules/@pie-lib/correct-answer-toggle/CHANGELOG.md +898 -0
- package/configure/node_modules/@pie-lib/correct-answer-toggle/NEXT.CHANGELOG.json +1 -0
- package/configure/node_modules/@pie-lib/correct-answer-toggle/esm/index.js +262 -0
- package/configure/node_modules/@pie-lib/correct-answer-toggle/esm/index.js.map +1 -0
- package/configure/node_modules/@pie-lib/correct-answer-toggle/lib/expander.js +88 -0
- package/configure/node_modules/@pie-lib/correct-answer-toggle/lib/expander.js.map +1 -0
- package/configure/node_modules/@pie-lib/correct-answer-toggle/lib/index.js +181 -0
- package/configure/node_modules/@pie-lib/correct-answer-toggle/lib/index.js.map +1 -0
- package/configure/node_modules/@pie-lib/correct-answer-toggle/lib/styles.js +66 -0
- package/configure/node_modules/@pie-lib/correct-answer-toggle/lib/styles.js.map +1 -0
- package/configure/node_modules/@pie-lib/correct-answer-toggle/package.json +44 -0
- package/configure/node_modules/@pie-lib/correct-answer-toggle/src/__tests__/index.test.jsx +99 -0
- package/configure/node_modules/@pie-lib/correct-answer-toggle/src/expander.jsx +61 -0
- package/configure/node_modules/@pie-lib/correct-answer-toggle/src/index.jsx +98 -0
- package/configure/node_modules/@pie-lib/correct-answer-toggle/src/styles.js +61 -0
- package/configure/node_modules/@pie-lib/icons/CHANGELOG.json +1 -0
- package/configure/node_modules/@pie-lib/icons/CHANGELOG.md +539 -0
- package/configure/node_modules/@pie-lib/icons/NEXT.CHANGELOG.json +1 -0
- package/configure/node_modules/@pie-lib/icons/esm/index.js +1153 -0
- package/configure/node_modules/@pie-lib/icons/esm/index.js.map +1 -0
- package/configure/node_modules/@pie-lib/icons/lib/correct-icon.js +89 -0
- package/configure/node_modules/@pie-lib/icons/lib/correct-icon.js.map +1 -0
- package/configure/node_modules/@pie-lib/icons/lib/correct-response-icon.js +153 -0
- package/configure/node_modules/@pie-lib/icons/lib/correct-response-icon.js.map +1 -0
- package/configure/node_modules/@pie-lib/icons/lib/icon-base.js +206 -0
- package/configure/node_modules/@pie-lib/icons/lib/icon-base.js.map +1 -0
- package/configure/node_modules/@pie-lib/icons/lib/icon-root.js +130 -0
- package/configure/node_modules/@pie-lib/icons/lib/icon-root.js.map +1 -0
- package/configure/node_modules/@pie-lib/icons/lib/incorrect-icon.js +92 -0
- package/configure/node_modules/@pie-lib/icons/lib/incorrect-icon.js.map +1 -0
- package/configure/node_modules/@pie-lib/icons/lib/index.js +72 -0
- package/configure/node_modules/@pie-lib/icons/lib/index.js.map +1 -0
- package/configure/node_modules/@pie-lib/icons/lib/instructions-icon.js +229 -0
- package/configure/node_modules/@pie-lib/icons/lib/instructions-icon.js.map +1 -0
- package/configure/node_modules/@pie-lib/icons/lib/learn-more-icon.js +145 -0
- package/configure/node_modules/@pie-lib/icons/lib/learn-more-icon.js.map +1 -0
- package/configure/node_modules/@pie-lib/icons/lib/nothing-submitted-icon.js +183 -0
- package/configure/node_modules/@pie-lib/icons/lib/nothing-submitted-icon.js.map +1 -0
- package/configure/node_modules/@pie-lib/icons/lib/partially-correct-icon.js +82 -0
- package/configure/node_modules/@pie-lib/icons/lib/partially-correct-icon.js.map +1 -0
- package/configure/node_modules/@pie-lib/icons/lib/show-rationale-icon.js +206 -0
- package/configure/node_modules/@pie-lib/icons/lib/show-rationale-icon.js.map +1 -0
- package/configure/node_modules/@pie-lib/icons/lib/sized.js +41 -0
- package/configure/node_modules/@pie-lib/icons/lib/sized.js.map +1 -0
- package/configure/node_modules/@pie-lib/icons/package.json +35 -0
- package/configure/node_modules/@pie-lib/icons/src/__tests__/index.test.js +3 -0
- package/configure/node_modules/@pie-lib/icons/src/correct-icon.jsx +64 -0
- package/configure/node_modules/@pie-lib/icons/src/correct-response-icon.jsx +121 -0
- package/configure/node_modules/@pie-lib/icons/src/icon-base.jsx +158 -0
- package/configure/node_modules/@pie-lib/icons/src/icon-root.jsx +76 -0
- package/configure/node_modules/@pie-lib/icons/src/incorrect-icon.jsx +61 -0
- package/configure/node_modules/@pie-lib/icons/src/index.js +19 -0
- package/configure/node_modules/@pie-lib/icons/src/instructions-icon.jsx +189 -0
- package/configure/node_modules/@pie-lib/icons/src/learn-more-icon.jsx +107 -0
- package/configure/node_modules/@pie-lib/icons/src/nothing-submitted-icon.jsx +130 -0
- package/configure/node_modules/@pie-lib/icons/src/partially-correct-icon.jsx +49 -0
- package/configure/node_modules/@pie-lib/icons/src/show-rationale-icon.jsx +152 -0
- package/configure/node_modules/@pie-lib/icons/src/sized.jsx +25 -0
- package/configure/node_modules/@pie-lib/math-rendering/CHANGELOG.json +1 -0
- package/configure/node_modules/@pie-lib/math-rendering/CHANGELOG.md +775 -0
- package/configure/node_modules/@pie-lib/math-rendering/NEXT.CHANGELOG.json +1 -0
- package/configure/node_modules/@pie-lib/math-rendering/esm/index.js +690 -0
- package/configure/node_modules/@pie-lib/math-rendering/esm/index.js.map +1 -0
- package/configure/node_modules/@pie-lib/math-rendering/lib/index.js +38 -0
- package/configure/node_modules/@pie-lib/math-rendering/lib/index.js.map +1 -0
- package/configure/node_modules/@pie-lib/math-rendering/lib/mml-to-latex.js +15 -0
- package/configure/node_modules/@pie-lib/math-rendering/lib/mml-to-latex.js.map +1 -0
- package/configure/node_modules/@pie-lib/math-rendering/lib/mstack/chtml.js +296 -0
- package/configure/node_modules/@pie-lib/math-rendering/lib/mstack/chtml.js.map +1 -0
- package/configure/node_modules/@pie-lib/math-rendering/lib/mstack/index.js +23 -0
- package/configure/node_modules/@pie-lib/math-rendering/lib/mstack/index.js.map +1 -0
- package/configure/node_modules/@pie-lib/math-rendering/lib/mstack/mml.js +109 -0
- package/configure/node_modules/@pie-lib/math-rendering/lib/mstack/mml.js.map +1 -0
- package/configure/node_modules/@pie-lib/math-rendering/lib/normalization.js +95 -0
- package/configure/node_modules/@pie-lib/math-rendering/lib/normalization.js.map +1 -0
- package/configure/node_modules/@pie-lib/math-rendering/lib/render-math.js +438 -0
- package/configure/node_modules/@pie-lib/math-rendering/lib/render-math.js.map +1 -0
- package/configure/node_modules/@pie-lib/math-rendering/package.json +28 -0
- package/configure/node_modules/@pie-lib/math-rendering/src/__tests__/mml-to-latex.test.js +14 -0
- package/configure/node_modules/@pie-lib/math-rendering/src/__tests__/normalization.test.js +50 -0
- package/configure/node_modules/@pie-lib/math-rendering/src/__tests__/render-math.test.js +155 -0
- package/configure/node_modules/@pie-lib/math-rendering/src/index.js +5 -0
- package/configure/node_modules/@pie-lib/math-rendering/src/mml-to-latex.js +2 -0
- package/configure/node_modules/@pie-lib/math-rendering/src/mstack/__tests__/__snapshots__/chtml.test.js.snap +9 -0
- package/configure/node_modules/@pie-lib/math-rendering/src/mstack/__tests__/chtml.test.js +104 -0
- package/configure/node_modules/@pie-lib/math-rendering/src/mstack/chtml.js +220 -0
- package/configure/node_modules/@pie-lib/math-rendering/src/mstack/index.js +13 -0
- package/configure/node_modules/@pie-lib/math-rendering/src/mstack/mml.js +24 -0
- package/configure/node_modules/@pie-lib/math-rendering/src/normalization.js +69 -0
- package/configure/node_modules/@pie-lib/math-rendering/src/render-math.js +387 -0
- package/configure/node_modules/@pie-lib/render-ui/CHANGELOG.json +1 -0
- package/configure/node_modules/@pie-lib/render-ui/CHANGELOG.md +1026 -0
- package/configure/node_modules/@pie-lib/render-ui/NEXT.CHANGELOG.json +1 -0
- package/configure/node_modules/@pie-lib/render-ui/esm/index.js +1616 -0
- package/configure/node_modules/@pie-lib/render-ui/esm/index.js.map +1 -0
- package/configure/node_modules/@pie-lib/render-ui/lib/append-css-rules.js +88 -0
- package/configure/node_modules/@pie-lib/render-ui/lib/append-css-rules.js.map +1 -0
- package/configure/node_modules/@pie-lib/render-ui/lib/assets/enableAudioAutoplayImage.js +9 -0
- package/configure/node_modules/@pie-lib/render-ui/lib/assets/enableAudioAutoplayImage.js.map +1 -0
- package/configure/node_modules/@pie-lib/render-ui/lib/collapsible/index.js +135 -0
- package/configure/node_modules/@pie-lib/render-ui/lib/collapsible/index.js.map +1 -0
- package/configure/node_modules/@pie-lib/render-ui/lib/color.js +344 -0
- package/configure/node_modules/@pie-lib/render-ui/lib/color.js.map +1 -0
- package/configure/node_modules/@pie-lib/render-ui/lib/feedback.js +150 -0
- package/configure/node_modules/@pie-lib/render-ui/lib/feedback.js.map +1 -0
- package/configure/node_modules/@pie-lib/render-ui/lib/has-media.js +27 -0
- package/configure/node_modules/@pie-lib/render-ui/lib/has-media.js.map +1 -0
- package/configure/node_modules/@pie-lib/render-ui/lib/has-text.js +28 -0
- package/configure/node_modules/@pie-lib/render-ui/lib/has-text.js.map +1 -0
- package/configure/node_modules/@pie-lib/render-ui/lib/html-and-math.js +74 -0
- package/configure/node_modules/@pie-lib/render-ui/lib/html-and-math.js.map +1 -0
- package/configure/node_modules/@pie-lib/render-ui/lib/index.js +136 -0
- package/configure/node_modules/@pie-lib/render-ui/lib/index.js.map +1 -0
- package/configure/node_modules/@pie-lib/render-ui/lib/input-container.js +60 -0
- package/configure/node_modules/@pie-lib/render-ui/lib/input-container.js.map +1 -0
- package/configure/node_modules/@pie-lib/render-ui/lib/preview-layout.js +145 -0
- package/configure/node_modules/@pie-lib/render-ui/lib/preview-layout.js.map +1 -0
- package/configure/node_modules/@pie-lib/render-ui/lib/preview-prompt.js +321 -0
- package/configure/node_modules/@pie-lib/render-ui/lib/preview-prompt.js.map +1 -0
- package/configure/node_modules/@pie-lib/render-ui/lib/purpose.js +28 -0
- package/configure/node_modules/@pie-lib/render-ui/lib/purpose.js.map +1 -0
- package/configure/node_modules/@pie-lib/render-ui/lib/readable.js +28 -0
- package/configure/node_modules/@pie-lib/render-ui/lib/readable.js.map +1 -0
- package/configure/node_modules/@pie-lib/render-ui/lib/response-indicators.js +151 -0
- package/configure/node_modules/@pie-lib/render-ui/lib/response-indicators.js.map +1 -0
- package/configure/node_modules/@pie-lib/render-ui/lib/ui-layout.js +122 -0
- package/configure/node_modules/@pie-lib/render-ui/lib/ui-layout.js.map +1 -0
- package/configure/node_modules/@pie-lib/render-ui/lib/withUndoReset.js +181 -0
- package/configure/node_modules/@pie-lib/render-ui/lib/withUndoReset.js.map +1 -0
- package/configure/node_modules/@pie-lib/render-ui/package.json +40 -0
- package/configure/node_modules/@pie-lib/render-ui/src/__tests__/__snapshots__/html-and-math.test.js.snap +11 -0
- package/configure/node_modules/@pie-lib/render-ui/src/__tests__/__snapshots__/preview-prompt.test.jsx.snap +37 -0
- package/configure/node_modules/@pie-lib/render-ui/src/__tests__/__snapshots__/purpose.test.jsx.snap +42 -0
- package/configure/node_modules/@pie-lib/render-ui/src/__tests__/__snapshots__/readable.test.jsx.snap +64 -0
- package/configure/node_modules/@pie-lib/render-ui/src/__tests__/__snapshots__/response-indicators.test.jsx.snap +27 -0
- package/configure/node_modules/@pie-lib/render-ui/src/__tests__/color.test.js +12 -0
- package/configure/node_modules/@pie-lib/render-ui/src/__tests__/has-media.test.js +20 -0
- package/configure/node_modules/@pie-lib/render-ui/src/__tests__/has-text.test.js +21 -0
- package/configure/node_modules/@pie-lib/render-ui/src/__tests__/html-and-math.test.js +24 -0
- package/configure/node_modules/@pie-lib/render-ui/src/__tests__/preview-prompt.test.jsx +56 -0
- package/configure/node_modules/@pie-lib/render-ui/src/__tests__/purpose.test.jsx +47 -0
- package/configure/node_modules/@pie-lib/render-ui/src/__tests__/readable.test.jsx +64 -0
- package/configure/node_modules/@pie-lib/render-ui/src/__tests__/response-indicators.test.jsx +16 -0
- package/configure/node_modules/@pie-lib/render-ui/src/__tests__/ui-layout.test.jsx +34 -0
- package/configure/node_modules/@pie-lib/render-ui/src/__tests__/withUndoReset.test.jsx +254 -0
- package/configure/node_modules/@pie-lib/render-ui/src/append-css-rules.js +51 -0
- package/configure/node_modules/@pie-lib/render-ui/src/assets/enableAudioAutoplayImage.js +1 -0
- package/configure/node_modules/@pie-lib/render-ui/src/collapsible/__tests__/__snapshots__/index.test.jsx.snap +18 -0
- package/configure/node_modules/@pie-lib/render-ui/src/collapsible/__tests__/index.test.jsx +13 -0
- package/configure/node_modules/@pie-lib/render-ui/src/collapsible/index.jsx +64 -0
- package/configure/node_modules/@pie-lib/render-ui/src/color.js +121 -0
- package/configure/node_modules/@pie-lib/render-ui/src/feedback.jsx +99 -0
- package/configure/node_modules/@pie-lib/render-ui/src/has-media.js +16 -0
- package/configure/node_modules/@pie-lib/render-ui/src/has-text.js +18 -0
- package/configure/node_modules/@pie-lib/render-ui/src/html-and-math.js +21 -0
- package/configure/node_modules/@pie-lib/render-ui/src/index.js +35 -0
- package/configure/node_modules/@pie-lib/render-ui/src/input-container.jsx +41 -0
- package/configure/node_modules/@pie-lib/render-ui/src/preview-layout.jsx +95 -0
- package/configure/node_modules/@pie-lib/render-ui/src/preview-prompt.jsx +254 -0
- package/configure/node_modules/@pie-lib/render-ui/src/purpose.jsx +17 -0
- package/configure/node_modules/@pie-lib/render-ui/src/readable.jsx +19 -0
- package/configure/node_modules/@pie-lib/render-ui/src/response-indicators.jsx +89 -0
- package/configure/node_modules/@pie-lib/render-ui/src/ui-layout.jsx +66 -0
- package/configure/node_modules/@pie-lib/render-ui/src/withUndoReset.jsx +116 -0
- package/configure/node_modules/@pie-lib/test-utils/CHANGELOG.json +1 -0
- package/configure/node_modules/@pie-lib/test-utils/CHANGELOG.md +410 -0
- package/configure/node_modules/@pie-lib/test-utils/NEXT.CHANGELOG.json +1 -0
- package/configure/node_modules/@pie-lib/test-utils/esm/index.js +39 -0
- package/configure/node_modules/@pie-lib/test-utils/esm/index.js.map +1 -0
- package/configure/node_modules/@pie-lib/test-utils/lib/index.js +40 -0
- package/configure/node_modules/@pie-lib/test-utils/lib/index.js.map +1 -0
- package/configure/node_modules/@pie-lib/test-utils/package.json +25 -0
- package/configure/node_modules/@pie-lib/test-utils/src/__tests__/index.test.js +45 -0
- package/configure/node_modules/@pie-lib/test-utils/src/index.js +18 -0
- package/configure/node_modules/@pie-lib/translator/CHANGELOG.json +1 -0
- package/configure/node_modules/@pie-lib/translator/CHANGELOG.md +282 -0
- package/configure/node_modules/@pie-lib/translator/NEXT.CHANGELOG.json +1 -0
- package/configure/node_modules/@pie-lib/translator/esm/index.js +257 -0
- package/configure/node_modules/@pie-lib/translator/esm/index.js.map +1 -0
- package/configure/node_modules/@pie-lib/translator/lib/en.js +102 -0
- package/configure/node_modules/@pie-lib/translator/lib/en.js.map +1 -0
- package/configure/node_modules/@pie-lib/translator/lib/es.js +102 -0
- package/configure/node_modules/@pie-lib/translator/lib/es.js.map +1 -0
- package/configure/node_modules/@pie-lib/translator/lib/index.js +69 -0
- package/configure/node_modules/@pie-lib/translator/lib/index.js.map +1 -0
- package/configure/node_modules/@pie-lib/translator/package.json +25 -0
- package/configure/node_modules/@pie-lib/translator/src/en.js +99 -0
- package/configure/node_modules/@pie-lib/translator/src/es.js +99 -0
- package/configure/node_modules/@pie-lib/translator/src/index.js +43 -0
- package/configure/package.json +3 -3
- package/controller/CHANGELOG.md +8 -0
- package/controller/package.json +3 -3
- package/esm/configure.js +40550 -0
- package/esm/configure.js.map +1 -0
- package/esm/controller.js +3358 -0
- package/esm/controller.js.map +1 -0
- package/esm/element.js +2203 -0
- package/esm/element.js.map +1 -0
- package/esm/package.json +4 -0
- package/esm/print.js +4090 -0
- package/esm/print.js.map +1 -0
- package/module/controller.js +4973 -2252
- package/module/element.js +1 -1
- package/module/index.html +1 -1
- package/module/manifest.json +1 -1
- package/module/print.html +1 -1
- package/module/print.js +1 -1
- package/package.json +24 -6
|
@@ -0,0 +1,387 @@
|
|
|
1
|
+
import { mathjax } from 'mathjax-full/js/mathjax';
|
|
2
|
+
import { MathJax as globalMathjax } from 'mathjax-full/js/components/global';
|
|
3
|
+
import { AssistiveMmlHandler } from 'mathjax-full/js/a11y/assistive-mml';
|
|
4
|
+
import { EnrichHandler } from 'mathjax-full/js/a11y/semantic-enrich';
|
|
5
|
+
import { MenuHandler } from 'mathjax-full/js/ui/menu/MenuHandler';
|
|
6
|
+
import { FindMathML } from 'mathjax-full/js/input/mathml/FindMathML';
|
|
7
|
+
import { MathML } from 'mathjax-full/js/input/mathml';
|
|
8
|
+
import { TeX } from 'mathjax-full/js/input/tex';
|
|
9
|
+
|
|
10
|
+
import { CHTML } from 'mathjax-full/js/output/chtml';
|
|
11
|
+
import { RegisterHTMLHandler } from 'mathjax-full/js/handlers/html';
|
|
12
|
+
import { browserAdaptor } from 'mathjax-full/js/adaptors/browserAdaptor';
|
|
13
|
+
import { AllPackages } from 'mathjax-full/js/input/tex/AllPackages';
|
|
14
|
+
import { engineReady } from 'speech-rule-engine/js/common/system';
|
|
15
|
+
|
|
16
|
+
if (typeof window !== 'undefined') {
|
|
17
|
+
RegisterHTMLHandler(browserAdaptor());
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
let sreReady = false;
|
|
21
|
+
|
|
22
|
+
engineReady().then(() => {
|
|
23
|
+
sreReady = true;
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
// import pkg from '../../package.json';
|
|
27
|
+
import { mmlNodes, chtmlNodes } from './mstack';
|
|
28
|
+
import debug from 'debug';
|
|
29
|
+
import { wrapMath, unWrapMath } from './normalization';
|
|
30
|
+
import { MmlFactory } from 'mathjax-full/js/core/MmlTree/MmlFactory';
|
|
31
|
+
import { SerializedMmlVisitor } from 'mathjax-full/js/core/MmlTree/SerializedMmlVisitor';
|
|
32
|
+
import { CHTMLWrapperFactory } from 'mathjax-full/js/output/chtml/WrapperFactory';
|
|
33
|
+
import { CHTMLmspace } from 'mathjax-full/js/output/chtml/Wrappers/mspace';
|
|
34
|
+
import { HTMLDomStrings } from 'mathjax-full/js/handlers/html/HTMLDomStrings';
|
|
35
|
+
|
|
36
|
+
const visitor = new SerializedMmlVisitor();
|
|
37
|
+
const toMMl = (node) => visitor.visitTree(node);
|
|
38
|
+
|
|
39
|
+
const log = debug('pie-lib:math-rendering');
|
|
40
|
+
|
|
41
|
+
const NEWLINE_BLOCK_REGEX = /\\embed\{newLine\}\[\]/g;
|
|
42
|
+
const NEWLINE_LATEX = '\\newline ';
|
|
43
|
+
|
|
44
|
+
const getGlobal = () => {
|
|
45
|
+
// TODO does it make sense to use version?
|
|
46
|
+
// const key = `${pkg.name}@${pkg.version.split('.')[0]}`;
|
|
47
|
+
// It looks like Ed made this change when he switched from mathjax3 to mathjax-full
|
|
48
|
+
// I think it was supposed to make sure version 1 (using mathjax3) is not used
|
|
49
|
+
// in combination with version 2 (using mathjax-full)
|
|
50
|
+
|
|
51
|
+
// TODO higher level wrappers use this instance of math-rendering, and if 2 different instances are used, math rendering is not working
|
|
52
|
+
// so I will hardcode this for now until a better solution is found
|
|
53
|
+
const key = '@pie-lib/math-rendering@2';
|
|
54
|
+
|
|
55
|
+
if (typeof window !== 'undefined') {
|
|
56
|
+
if (!window[key]) {
|
|
57
|
+
window[key] = {};
|
|
58
|
+
}
|
|
59
|
+
return window[key];
|
|
60
|
+
} else {
|
|
61
|
+
return {};
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
/** Add temporary support for a global singleDollar override
|
|
66
|
+
* <code>
|
|
67
|
+
* // This will enable single dollar rendering
|
|
68
|
+
* window.pie = window.pie || {};
|
|
69
|
+
* window.pie.mathRendering = {useSingleDollar: true };
|
|
70
|
+
* </code>
|
|
71
|
+
*/
|
|
72
|
+
const defaultOpts = () => getGlobal().opts || {};
|
|
73
|
+
|
|
74
|
+
export const fixMathElement = (element) => {
|
|
75
|
+
if (element.dataset.mathHandled) {
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
let property = 'innerText';
|
|
80
|
+
|
|
81
|
+
if (element.textContent) {
|
|
82
|
+
property = 'textContent';
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
if (element[property]) {
|
|
86
|
+
element[property] = wrapMath(unWrapMath(element[property]).unwrapped);
|
|
87
|
+
// because mathquill doesn't understand line breaks, sometimes we end up with custom elements on prompts/rationale/etc.
|
|
88
|
+
// we need to replace the custom embedded elements with valid latex that Mathjax can understand
|
|
89
|
+
element[property] = element[property].replace(NEWLINE_BLOCK_REGEX, NEWLINE_LATEX);
|
|
90
|
+
element.dataset.mathHandled = true;
|
|
91
|
+
}
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
export const fixMathElements = (el = document) => {
|
|
95
|
+
const mathElements = el.querySelectorAll('[data-latex]');
|
|
96
|
+
|
|
97
|
+
mathElements.forEach((item) => fixMathElement(item));
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
const adjustMathMLStyle = (el = document) => {
|
|
101
|
+
const nodes = el.querySelectorAll('math');
|
|
102
|
+
nodes.forEach((node) => node.setAttribute('displaystyle', 'true'));
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
class myFindMathML extends FindMathML {
|
|
106
|
+
processMath(set) {
|
|
107
|
+
const adaptor = this.adaptor;
|
|
108
|
+
for (const mml of Array.from(set)) {
|
|
109
|
+
if (adaptor.kind(adaptor.parent(mml)) === 'mjx-assistive-mml') {
|
|
110
|
+
set.delete(mml);
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
return super.processMath(set);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
const createMathMLInstance = (opts, docProvided = document) => {
|
|
118
|
+
opts = opts || defaultOpts();
|
|
119
|
+
|
|
120
|
+
if (opts.useSingleDollar) {
|
|
121
|
+
// eslint-disable-next-line
|
|
122
|
+
console.warn('[math-rendering] using $ is not advisable, please use $$..$$ or \\(...\\)');
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
const packages = AllPackages.filter((name) => name !== 'bussproofs'); // Bussproofs needs an output jax
|
|
126
|
+
|
|
127
|
+
// The autoload extension predefines all the macros from the extensions that haven't been loaded already
|
|
128
|
+
// so that they automatically load the needed extension when they are first used
|
|
129
|
+
packages.push('autoload');
|
|
130
|
+
|
|
131
|
+
const macros = {
|
|
132
|
+
parallelogram: '\\lower.2em{\\Huge\\unicode{x25B1}}',
|
|
133
|
+
overarc: '\\overparen',
|
|
134
|
+
napprox: '\\not\\approx',
|
|
135
|
+
longdiv: '\\enclose{longdiv}',
|
|
136
|
+
};
|
|
137
|
+
|
|
138
|
+
const texConfig = opts.useSingleDollar
|
|
139
|
+
? {
|
|
140
|
+
packages,
|
|
141
|
+
macros,
|
|
142
|
+
inlineMath: [
|
|
143
|
+
['$', '$'],
|
|
144
|
+
['\\(', '\\)'],
|
|
145
|
+
],
|
|
146
|
+
processEscapes: true,
|
|
147
|
+
}
|
|
148
|
+
: {
|
|
149
|
+
packages,
|
|
150
|
+
macros,
|
|
151
|
+
};
|
|
152
|
+
|
|
153
|
+
const mmlConfig = {
|
|
154
|
+
parseError: function(node) {
|
|
155
|
+
// function to process parsing errors
|
|
156
|
+
// eslint-disable-next-line no-console
|
|
157
|
+
console.log('error:', node);
|
|
158
|
+
this.error(this.adaptor.textContent(node).replace(/\n.*/g, ''));
|
|
159
|
+
},
|
|
160
|
+
FindMathML: new myFindMathML(),
|
|
161
|
+
};
|
|
162
|
+
|
|
163
|
+
let cachedMathjax;
|
|
164
|
+
|
|
165
|
+
if (globalMathjax && globalMathjax.version !== mathjax.version) {
|
|
166
|
+
// handling other MathJax version on the page
|
|
167
|
+
// replacing it temporarily with the version we have
|
|
168
|
+
window.MathJax._ = window.MathJax._ || {};
|
|
169
|
+
window.MathJax.config = window.MathJax.config || {};
|
|
170
|
+
cachedMathjax = window.MathJax;
|
|
171
|
+
Object.assign(globalMathjax, mathjax);
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
const fontURL = `https://unpkg.com/mathjax-full@${mathjax.version}/ts/output/chtml/fonts/tex-woff-v2`;
|
|
175
|
+
const htmlConfig = {
|
|
176
|
+
fontURL,
|
|
177
|
+
|
|
178
|
+
wrapperFactory: new CHTMLWrapperFactory({
|
|
179
|
+
...CHTMLWrapperFactory.defaultNodes,
|
|
180
|
+
...chtmlNodes,
|
|
181
|
+
}),
|
|
182
|
+
};
|
|
183
|
+
|
|
184
|
+
const mml = new MathML(mmlConfig);
|
|
185
|
+
|
|
186
|
+
const customMmlFactory = new MmlFactory({
|
|
187
|
+
...MmlFactory.defaultNodes,
|
|
188
|
+
...mmlNodes,
|
|
189
|
+
});
|
|
190
|
+
const classFactory = EnrichHandler(
|
|
191
|
+
MenuHandler(AssistiveMmlHandler(mathjax.handlers.handlesDocument(docProvided))),
|
|
192
|
+
mml,
|
|
193
|
+
);
|
|
194
|
+
|
|
195
|
+
const html = classFactory.create(docProvided, {
|
|
196
|
+
compileError: (mj, math, err) => {
|
|
197
|
+
// eslint-disable-next-line no-console
|
|
198
|
+
console.log('bad math?:', math);
|
|
199
|
+
// eslint-disable-next-line no-console
|
|
200
|
+
console.error(err);
|
|
201
|
+
},
|
|
202
|
+
typesetError: function(doc, math, err) {
|
|
203
|
+
// eslint-disable-next-line no-console
|
|
204
|
+
console.log('typeset error');
|
|
205
|
+
// eslint-disable-next-line no-console
|
|
206
|
+
console.error(err);
|
|
207
|
+
doc.typesetError(math, err);
|
|
208
|
+
},
|
|
209
|
+
|
|
210
|
+
sre: {
|
|
211
|
+
speech: 'deep',
|
|
212
|
+
},
|
|
213
|
+
enrichSpeech: 'deep',
|
|
214
|
+
|
|
215
|
+
InputJax: [new TeX(texConfig), mml],
|
|
216
|
+
OutputJax: new CHTML(htmlConfig),
|
|
217
|
+
DomStrings: new HTMLDomStrings({
|
|
218
|
+
skipHtmlTags: [
|
|
219
|
+
'script',
|
|
220
|
+
'noscript',
|
|
221
|
+
'style',
|
|
222
|
+
'textarea',
|
|
223
|
+
'pre',
|
|
224
|
+
'code',
|
|
225
|
+
'annotation',
|
|
226
|
+
'annotation-xml',
|
|
227
|
+
'mjx-assistive-mml',
|
|
228
|
+
'mjx-container',
|
|
229
|
+
],
|
|
230
|
+
}),
|
|
231
|
+
});
|
|
232
|
+
|
|
233
|
+
// Note: we must set this *after* mathjax.document (no idea why)
|
|
234
|
+
mml.setMmlFactory(customMmlFactory);
|
|
235
|
+
|
|
236
|
+
if (cachedMathjax) {
|
|
237
|
+
// if we have a cached version, we replace it here
|
|
238
|
+
window.MathJax = cachedMathjax;
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
return html;
|
|
242
|
+
};
|
|
243
|
+
|
|
244
|
+
let enrichSpeechInitialized = false;
|
|
245
|
+
|
|
246
|
+
const bootstrap = (opts) => {
|
|
247
|
+
if (typeof window === 'undefined') {
|
|
248
|
+
return { Typeset: () => ({}) };
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
const html = createMathMLInstance(opts);
|
|
252
|
+
|
|
253
|
+
return {
|
|
254
|
+
version: mathjax.version,
|
|
255
|
+
html: html,
|
|
256
|
+
Typeset: function(...elements) {
|
|
257
|
+
const attemptRender = (temporary = false) => {
|
|
258
|
+
let updatedDocument = this.html.findMath(elements.length ? { elements } : {}).compile();
|
|
259
|
+
|
|
260
|
+
if (!temporary && sreReady) {
|
|
261
|
+
updatedDocument = updatedDocument.enrich();
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
updatedDocument = updatedDocument
|
|
265
|
+
.getMetrics()
|
|
266
|
+
.typeset()
|
|
267
|
+
.assistiveMml()
|
|
268
|
+
.attachSpeech()
|
|
269
|
+
.addMenu()
|
|
270
|
+
.updateDocument();
|
|
271
|
+
|
|
272
|
+
if (!enrichSpeechInitialized && typeof updatedDocument.math.list?.next?.data === 'object') {
|
|
273
|
+
enrichSpeechInitialized = true;
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
try {
|
|
277
|
+
const list = updatedDocument.math.list;
|
|
278
|
+
|
|
279
|
+
if (list) {
|
|
280
|
+
for (let item = list.next; typeof item.data !== 'symbol'; item = item.next) {
|
|
281
|
+
const mathMl = toMMl(item.data.root);
|
|
282
|
+
const parsedMathMl = mathMl.replaceAll('\n', '');
|
|
283
|
+
|
|
284
|
+
item.data.typesetRoot.setAttribute('data-mathml', parsedMathMl);
|
|
285
|
+
item.data.typesetRoot.setAttribute('tabindex', '-1');
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
} catch (e) {
|
|
289
|
+
// eslint-disable-next-line no-console
|
|
290
|
+
console.error(e.toString());
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
updatedDocument.clear();
|
|
294
|
+
};
|
|
295
|
+
|
|
296
|
+
if (!enrichSpeechInitialized) {
|
|
297
|
+
attemptRender(true);
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
mathjax.handleRetriesFor(() => {
|
|
301
|
+
attemptRender();
|
|
302
|
+
});
|
|
303
|
+
},
|
|
304
|
+
};
|
|
305
|
+
};
|
|
306
|
+
|
|
307
|
+
const renderMath = (el, renderOpts) => {
|
|
308
|
+
if (
|
|
309
|
+
window &&
|
|
310
|
+
window.MathJax &&
|
|
311
|
+
window.MathJax.customKey &&
|
|
312
|
+
window.MathJax.customKey == '@pie-lib/math-rendering-accessible@1'
|
|
313
|
+
) {
|
|
314
|
+
return;
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
const isString = typeof el === 'string';
|
|
318
|
+
let executeOn = document.body;
|
|
319
|
+
|
|
320
|
+
if (isString) {
|
|
321
|
+
const div = document.createElement('div');
|
|
322
|
+
|
|
323
|
+
div.innerHTML = el;
|
|
324
|
+
executeOn = div;
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
fixMathElements(executeOn);
|
|
328
|
+
adjustMathMLStyle(executeOn);
|
|
329
|
+
|
|
330
|
+
if (isString) {
|
|
331
|
+
const html = createMathMLInstance(undefined, executeOn);
|
|
332
|
+
|
|
333
|
+
const updatedDocument = html
|
|
334
|
+
.findMath()
|
|
335
|
+
.compile()
|
|
336
|
+
.getMetrics()
|
|
337
|
+
.typeset()
|
|
338
|
+
.updateDocument();
|
|
339
|
+
|
|
340
|
+
const list = updatedDocument.math.list;
|
|
341
|
+
const item = list.next;
|
|
342
|
+
|
|
343
|
+
if (!item) {
|
|
344
|
+
return '';
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
const mathMl = toMMl(item.data.root);
|
|
348
|
+
const parsedMathMl = mathMl.replaceAll('\n', '');
|
|
349
|
+
|
|
350
|
+
return parsedMathMl;
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
if (!getGlobal().instance) {
|
|
354
|
+
getGlobal().instance = bootstrap(renderOpts);
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
if (!el) {
|
|
358
|
+
log('el is undefined');
|
|
359
|
+
return;
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
if (el instanceof Element && getGlobal().instance?.Typeset) {
|
|
363
|
+
getGlobal().instance.Typeset(el);
|
|
364
|
+
} else if (el.length && getGlobal().instance?.Typeset) {
|
|
365
|
+
const arr = Array.from(el);
|
|
366
|
+
getGlobal().instance.Typeset(...arr);
|
|
367
|
+
}
|
|
368
|
+
};
|
|
369
|
+
|
|
370
|
+
/**
|
|
371
|
+
* This style is added to overried default styling of mjx-mspace Mathjax tag
|
|
372
|
+
* In mathjax src code \newline latex gets parsed to <mjx-mspace></mjx-mspace>,
|
|
373
|
+
* but has the default style
|
|
374
|
+
* 'mjx-mspace': {
|
|
375
|
+
"display": 'in-line',
|
|
376
|
+
"text-align": 'left'
|
|
377
|
+
} which prevents it from showing as a newline value
|
|
378
|
+
*/
|
|
379
|
+
CHTMLmspace.styles = {
|
|
380
|
+
'mjx-mspace': {
|
|
381
|
+
display: 'block',
|
|
382
|
+
'text-align': 'center',
|
|
383
|
+
height: '5px',
|
|
384
|
+
},
|
|
385
|
+
};
|
|
386
|
+
|
|
387
|
+
export default renderMath;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
[]
|