@pie-element/ebsr 6.6.3-next.1075 → 6.6.3-next.1082
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/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/CHANGELOG.json +1677 -0
- package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/CHANGELOG.md +1695 -0
- package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/LICENSE.md +5 -0
- package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/README.md +12 -0
- package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/lib/alert-dialog.js +44 -0
- package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/lib/alert-dialog.js.map +1 -0
- package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/lib/checkbox.js +86 -0
- package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/lib/checkbox.js.map +1 -0
- package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/lib/choice-configuration/feedback-menu.js +164 -0
- package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/lib/choice-configuration/feedback-menu.js.map +1 -0
- package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/lib/choice-configuration/index.js +398 -0
- package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/lib/choice-configuration/index.js.map +1 -0
- package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/lib/choice-utils.js +54 -0
- package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/lib/choice-utils.js.map +1 -0
- package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/lib/feedback-config/feedback-selector.js +185 -0
- package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/lib/feedback-config/feedback-selector.js.map +1 -0
- package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/lib/feedback-config/group.js +75 -0
- package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/lib/feedback-config/group.js.map +1 -0
- package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/lib/feedback-config/index.js +178 -0
- package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/lib/feedback-config/index.js.map +1 -0
- package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/lib/form-section.js +46 -0
- package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/lib/form-section.js.map +1 -0
- package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/lib/help.js +145 -0
- package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/lib/help.js.map +1 -0
- package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/lib/index.js +216 -0
- package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/lib/index.js.map +1 -0
- package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/lib/input.js +139 -0
- package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/lib/input.js.map +1 -0
- package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/lib/inputs.js +131 -0
- package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/lib/inputs.js.map +1 -0
- package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/lib/langs.js +179 -0
- package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/lib/langs.js.map +1 -0
- package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/lib/layout/config-layout.js +101 -0
- package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/lib/layout/config-layout.js.map +1 -0
- package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/lib/layout/index.js +24 -0
- package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/lib/layout/index.js.map +1 -0
- package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/lib/layout/layout-contents.js +105 -0
- package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/lib/layout/layout-contents.js.map +1 -0
- package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/lib/layout/settings-box.js +87 -0
- package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/lib/layout/settings-box.js.map +1 -0
- package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/lib/mui-box/index.js +79 -0
- package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/lib/mui-box/index.js.map +1 -0
- package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/lib/number-text-field-custom.js +364 -0
- package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/lib/number-text-field-custom.js.map +1 -0
- package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/lib/number-text-field.js +265 -0
- package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/lib/number-text-field.js.map +1 -0
- package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/lib/radio-with-label.js +41 -0
- package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/lib/radio-with-label.js.map +1 -0
- package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/lib/settings/display-size.js +77 -0
- package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/lib/settings/display-size.js.map +1 -0
- package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/lib/settings/index.js +130 -0
- package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/lib/settings/index.js.map +1 -0
- package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/lib/settings/panel.js +412 -0
- package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/lib/settings/panel.js.map +1 -0
- package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/lib/settings/settings-radio-label.js +43 -0
- package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/lib/settings/settings-radio-label.js.map +1 -0
- package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/lib/settings/toggle.js +56 -0
- package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/lib/settings/toggle.js.map +1 -0
- package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/lib/tabs/index.js +106 -0
- package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/lib/tabs/index.js.map +1 -0
- package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/lib/tags-input/index.js +198 -0
- package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/lib/tags-input/index.js.map +1 -0
- package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/lib/two-choice.js +180 -0
- package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/lib/two-choice.js.map +1 -0
- package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/lib/with-stateful-model.js +84 -0
- package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/lib/with-stateful-model.js.map +1 -0
- package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/package.json +30 -0
- package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/src/alert-dialog.jsx +43 -0
- package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/src/checkbox.jsx +63 -0
- package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/src/choice-configuration/feedback-menu.jsx +103 -0
- package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/src/choice-configuration/index.jsx +319 -0
- package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/src/choice-utils.js +30 -0
- package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/src/feedback-config/feedback-selector.jsx +116 -0
- package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/src/feedback-config/group.jsx +54 -0
- package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/src/feedback-config/index.jsx +98 -0
- package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/src/form-section.jsx +23 -0
- package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/src/help.jsx +88 -0
- package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/src/index.js +58 -0
- package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/src/input.jsx +72 -0
- package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/src/inputs.jsx +96 -0
- package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/src/langs.jsx +122 -0
- package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/src/layout/config-layout.jsx +64 -0
- package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/src/layout/index.js +4 -0
- package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/src/layout/layout-contents.jsx +60 -0
- package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/src/layout/settings-box.jsx +31 -0
- package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/src/mui-box/index.jsx +64 -0
- package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/src/number-text-field-custom.jsx +276 -0
- package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/src/number-text-field.jsx +196 -0
- package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/src/radio-with-label.jsx +18 -0
- package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/src/settings/display-size.jsx +52 -0
- package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/src/settings/index.js +75 -0
- package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/src/settings/panel.jsx +297 -0
- package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/src/settings/settings-radio-label.jsx +20 -0
- package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/src/settings/toggle.jsx +31 -0
- package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/src/tabs/index.jsx +51 -0
- package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/src/tags-input/index.jsx +121 -0
- package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/src/two-choice.jsx +94 -0
- package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/src/with-stateful-model.jsx +36 -0
- package/configure/node_modules/@pie-lib/correct-answer-toggle/CHANGELOG.json +547 -0
- package/configure/node_modules/@pie-lib/correct-answer-toggle/CHANGELOG.md +524 -0
- package/configure/node_modules/@pie-lib/correct-answer-toggle/LICENSE.md +5 -0
- package/configure/node_modules/@pie-lib/correct-answer-toggle/README.md +64 -0
- package/configure/node_modules/@pie-lib/correct-answer-toggle/lib/expander.js +86 -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 +155 -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 +65 -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 +36 -0
- package/configure/node_modules/@pie-lib/correct-answer-toggle/preview.png +0 -0
- package/configure/node_modules/@pie-lib/correct-answer-toggle/src/expander.jsx +65 -0
- package/configure/node_modules/@pie-lib/correct-answer-toggle/src/index.jsx +75 -0
- package/configure/node_modules/@pie-lib/correct-answer-toggle/src/styles.js +60 -0
- package/configure/node_modules/@pie-lib/editable-html/CHANGELOG.json +3327 -0
- package/configure/node_modules/@pie-lib/editable-html/CHANGELOG.md +1676 -0
- package/configure/node_modules/@pie-lib/editable-html/LICENSE.md +5 -0
- package/configure/node_modules/@pie-lib/editable-html/README.md +45 -0
- package/configure/node_modules/@pie-lib/editable-html/deploy.sh +16 -0
- package/configure/node_modules/@pie-lib/editable-html/lib/editor.js +837 -0
- package/configure/node_modules/@pie-lib/editable-html/lib/editor.js.map +1 -0
- package/configure/node_modules/@pie-lib/editable-html/lib/index.js +224 -0
- package/configure/node_modules/@pie-lib/editable-html/lib/index.js.map +1 -0
- package/configure/node_modules/@pie-lib/editable-html/lib/parse-html.js +16 -0
- package/configure/node_modules/@pie-lib/editable-html/lib/parse-html.js.map +1 -0
- package/configure/node_modules/@pie-lib/editable-html/lib/plugins/characters/custom-popover.js +70 -0
- package/configure/node_modules/@pie-lib/editable-html/lib/plugins/characters/custom-popover.js.map +1 -0
- package/configure/node_modules/@pie-lib/editable-html/lib/plugins/characters/index.js +261 -0
- package/configure/node_modules/@pie-lib/editable-html/lib/plugins/characters/index.js.map +1 -0
- package/configure/node_modules/@pie-lib/editable-html/lib/plugins/characters/utils.js +362 -0
- package/configure/node_modules/@pie-lib/editable-html/lib/plugins/characters/utils.js.map +1 -0
- package/configure/node_modules/@pie-lib/editable-html/lib/plugins/image/component.js +393 -0
- package/configure/node_modules/@pie-lib/editable-html/lib/plugins/image/component.js.map +1 -0
- package/configure/node_modules/@pie-lib/editable-html/lib/plugins/image/image-toolbar.js +78 -0
- package/configure/node_modules/@pie-lib/editable-html/lib/plugins/image/image-toolbar.js.map +1 -0
- package/configure/node_modules/@pie-lib/editable-html/lib/plugins/image/index.js +221 -0
- package/configure/node_modules/@pie-lib/editable-html/lib/plugins/image/index.js.map +1 -0
- package/configure/node_modules/@pie-lib/editable-html/lib/plugins/image/insert-image-handler.js +135 -0
- package/configure/node_modules/@pie-lib/editable-html/lib/plugins/image/insert-image-handler.js.map +1 -0
- package/configure/node_modules/@pie-lib/editable-html/lib/plugins/index.js +141 -0
- package/configure/node_modules/@pie-lib/editable-html/lib/plugins/index.js.map +1 -0
- package/configure/node_modules/@pie-lib/editable-html/lib/plugins/list/index.js +204 -0
- package/configure/node_modules/@pie-lib/editable-html/lib/plugins/list/index.js.map +1 -0
- package/configure/node_modules/@pie-lib/editable-html/lib/plugins/math/index.js +347 -0
- package/configure/node_modules/@pie-lib/editable-html/lib/plugins/math/index.js.map +1 -0
- package/configure/node_modules/@pie-lib/editable-html/lib/plugins/media/index.js +339 -0
- package/configure/node_modules/@pie-lib/editable-html/lib/plugins/media/index.js.map +1 -0
- package/configure/node_modules/@pie-lib/editable-html/lib/plugins/media/media-dialog.js +434 -0
- package/configure/node_modules/@pie-lib/editable-html/lib/plugins/media/media-dialog.js.map +1 -0
- package/configure/node_modules/@pie-lib/editable-html/lib/plugins/media/media-toolbar.js +99 -0
- package/configure/node_modules/@pie-lib/editable-html/lib/plugins/media/media-toolbar.js.map +1 -0
- package/configure/node_modules/@pie-lib/editable-html/lib/plugins/media/media-wrapper.js +93 -0
- package/configure/node_modules/@pie-lib/editable-html/lib/plugins/media/media-wrapper.js.map +1 -0
- package/configure/node_modules/@pie-lib/editable-html/lib/plugins/respArea/drag-in-the-blank/choice.js +251 -0
- package/configure/node_modules/@pie-lib/editable-html/lib/plugins/respArea/drag-in-the-blank/choice.js.map +1 -0
- package/configure/node_modules/@pie-lib/editable-html/lib/plugins/respArea/drag-in-the-blank/index.js +97 -0
- package/configure/node_modules/@pie-lib/editable-html/lib/plugins/respArea/drag-in-the-blank/index.js.map +1 -0
- package/configure/node_modules/@pie-lib/editable-html/lib/plugins/respArea/explicit-constructed-response/index.js +54 -0
- package/configure/node_modules/@pie-lib/editable-html/lib/plugins/respArea/explicit-constructed-response/index.js.map +1 -0
- package/configure/node_modules/@pie-lib/editable-html/lib/plugins/respArea/icons/index.js +93 -0
- package/configure/node_modules/@pie-lib/editable-html/lib/plugins/respArea/icons/index.js.map +1 -0
- package/configure/node_modules/@pie-lib/editable-html/lib/plugins/respArea/index.js +288 -0
- package/configure/node_modules/@pie-lib/editable-html/lib/plugins/respArea/index.js.map +1 -0
- package/configure/node_modules/@pie-lib/editable-html/lib/plugins/respArea/inline-dropdown/index.js +70 -0
- package/configure/node_modules/@pie-lib/editable-html/lib/plugins/respArea/inline-dropdown/index.js.map +1 -0
- package/configure/node_modules/@pie-lib/editable-html/lib/plugins/respArea/utils.js +110 -0
- package/configure/node_modules/@pie-lib/editable-html/lib/plugins/respArea/utils.js.map +1 -0
- package/configure/node_modules/@pie-lib/editable-html/lib/plugins/table/icons/index.js +69 -0
- package/configure/node_modules/@pie-lib/editable-html/lib/plugins/table/icons/index.js.map +1 -0
- package/configure/node_modules/@pie-lib/editable-html/lib/plugins/table/index.js +497 -0
- package/configure/node_modules/@pie-lib/editable-html/lib/plugins/table/index.js.map +1 -0
- package/configure/node_modules/@pie-lib/editable-html/lib/plugins/table/table-toolbar.js +158 -0
- package/configure/node_modules/@pie-lib/editable-html/lib/plugins/table/table-toolbar.js.map +1 -0
- package/configure/node_modules/@pie-lib/editable-html/lib/plugins/toolbar/default-toolbar.js +132 -0
- package/configure/node_modules/@pie-lib/editable-html/lib/plugins/toolbar/default-toolbar.js.map +1 -0
- package/configure/node_modules/@pie-lib/editable-html/lib/plugins/toolbar/done-button.js +50 -0
- package/configure/node_modules/@pie-lib/editable-html/lib/plugins/toolbar/done-button.js.map +1 -0
- package/configure/node_modules/@pie-lib/editable-html/lib/plugins/toolbar/editor-and-toolbar.js +263 -0
- package/configure/node_modules/@pie-lib/editable-html/lib/plugins/toolbar/editor-and-toolbar.js.map +1 -0
- package/configure/node_modules/@pie-lib/editable-html/lib/plugins/toolbar/index.js +32 -0
- package/configure/node_modules/@pie-lib/editable-html/lib/plugins/toolbar/index.js.map +1 -0
- package/configure/node_modules/@pie-lib/editable-html/lib/plugins/toolbar/toolbar-buttons.js +161 -0
- package/configure/node_modules/@pie-lib/editable-html/lib/plugins/toolbar/toolbar-buttons.js.map +1 -0
- package/configure/node_modules/@pie-lib/editable-html/lib/plugins/toolbar/toolbar.js +346 -0
- package/configure/node_modules/@pie-lib/editable-html/lib/plugins/toolbar/toolbar.js.map +1 -0
- package/configure/node_modules/@pie-lib/editable-html/lib/plugins/utils.js +62 -0
- package/configure/node_modules/@pie-lib/editable-html/lib/plugins/utils.js.map +1 -0
- package/configure/node_modules/@pie-lib/editable-html/lib/serialization.js +428 -0
- package/configure/node_modules/@pie-lib/editable-html/lib/serialization.js.map +1 -0
- package/configure/node_modules/@pie-lib/editable-html/lib/theme.js +9 -0
- package/configure/node_modules/@pie-lib/editable-html/lib/theme.js.map +1 -0
- package/configure/node_modules/@pie-lib/editable-html/package.json +51 -0
- package/configure/node_modules/@pie-lib/editable-html/playground/image/data.js +59 -0
- package/configure/node_modules/@pie-lib/editable-html/playground/image/index.html +24 -0
- package/configure/node_modules/@pie-lib/editable-html/playground/image/index.jsx +83 -0
- package/configure/node_modules/@pie-lib/editable-html/playground/index.html +27 -0
- package/configure/node_modules/@pie-lib/editable-html/playground/mathquill/index.html +25 -0
- package/configure/node_modules/@pie-lib/editable-html/playground/mathquill/index.jsx +151 -0
- package/configure/node_modules/@pie-lib/editable-html/playground/package.json +15 -0
- package/configure/node_modules/@pie-lib/editable-html/playground/prod-test/index.html +26 -0
- package/configure/node_modules/@pie-lib/editable-html/playground/prod-test/index.jsx +30 -0
- package/configure/node_modules/@pie-lib/editable-html/playground/schema-override/data.js +29 -0
- package/configure/node_modules/@pie-lib/editable-html/playground/schema-override/image-plugin.jsx +40 -0
- package/configure/node_modules/@pie-lib/editable-html/playground/schema-override/index.html +23 -0
- package/configure/node_modules/@pie-lib/editable-html/playground/schema-override/index.jsx +96 -0
- package/configure/node_modules/@pie-lib/editable-html/playground/serialization/data.js +29 -0
- package/configure/node_modules/@pie-lib/editable-html/playground/serialization/image-plugin.jsx +40 -0
- package/configure/node_modules/@pie-lib/editable-html/playground/serialization/index.html +24 -0
- package/configure/node_modules/@pie-lib/editable-html/playground/serialization/index.jsx +12 -0
- package/configure/node_modules/@pie-lib/editable-html/playground/static.json +3 -0
- package/configure/node_modules/@pie-lib/editable-html/playground/table-examples.html +67 -0
- package/configure/node_modules/@pie-lib/editable-html/playground/webpack.config.js +42 -0
- package/configure/node_modules/@pie-lib/editable-html/src/editor.jsx +724 -0
- package/configure/node_modules/@pie-lib/editable-html/src/index.jsx +145 -0
- package/configure/node_modules/@pie-lib/editable-html/src/parse-html.js +8 -0
- package/configure/node_modules/@pie-lib/editable-html/src/plugins/README.md +27 -0
- package/configure/node_modules/@pie-lib/editable-html/src/plugins/characters/custom-popover.js +45 -0
- package/configure/node_modules/@pie-lib/editable-html/src/plugins/characters/index.jsx +237 -0
- package/configure/node_modules/@pie-lib/editable-html/src/plugins/characters/utils.js +444 -0
- package/configure/node_modules/@pie-lib/editable-html/src/plugins/image/component.jsx +318 -0
- package/configure/node_modules/@pie-lib/editable-html/src/plugins/image/image-toolbar.jsx +32 -0
- package/configure/node_modules/@pie-lib/editable-html/src/plugins/image/index.jsx +182 -0
- package/configure/node_modules/@pie-lib/editable-html/src/plugins/image/insert-image-handler.js +93 -0
- package/configure/node_modules/@pie-lib/editable-html/src/plugins/index.jsx +115 -0
- package/configure/node_modules/@pie-lib/editable-html/src/plugins/list/index.jsx +175 -0
- package/configure/node_modules/@pie-lib/editable-html/src/plugins/math/index.jsx +283 -0
- package/configure/node_modules/@pie-lib/editable-html/src/plugins/media/index.jsx +284 -0
- package/configure/node_modules/@pie-lib/editable-html/src/plugins/media/media-dialog.js +372 -0
- package/configure/node_modules/@pie-lib/editable-html/src/plugins/media/media-toolbar.jsx +53 -0
- package/configure/node_modules/@pie-lib/editable-html/src/plugins/media/media-wrapper.jsx +43 -0
- package/configure/node_modules/@pie-lib/editable-html/src/plugins/respArea/drag-in-the-blank/choice.jsx +187 -0
- package/configure/node_modules/@pie-lib/editable-html/src/plugins/respArea/drag-in-the-blank/index.jsx +78 -0
- package/configure/node_modules/@pie-lib/editable-html/src/plugins/respArea/explicit-constructed-response/index.jsx +45 -0
- package/configure/node_modules/@pie-lib/editable-html/src/plugins/respArea/icons/index.jsx +68 -0
- package/configure/node_modules/@pie-lib/editable-html/src/plugins/respArea/index.jsx +259 -0
- package/configure/node_modules/@pie-lib/editable-html/src/plugins/respArea/inline-dropdown/index.jsx +63 -0
- package/configure/node_modules/@pie-lib/editable-html/src/plugins/respArea/utils.jsx +77 -0
- package/configure/node_modules/@pie-lib/editable-html/src/plugins/table/icons/index.jsx +59 -0
- package/configure/node_modules/@pie-lib/editable-html/src/plugins/table/index.jsx +437 -0
- package/configure/node_modules/@pie-lib/editable-html/src/plugins/table/table-toolbar.jsx +104 -0
- package/configure/node_modules/@pie-lib/editable-html/src/plugins/toolbar/default-toolbar.jsx +111 -0
- package/configure/node_modules/@pie-lib/editable-html/src/plugins/toolbar/done-button.jsx +36 -0
- package/configure/node_modules/@pie-lib/editable-html/src/plugins/toolbar/editor-and-toolbar.jsx +225 -0
- package/configure/node_modules/@pie-lib/editable-html/src/plugins/toolbar/index.jsx +21 -0
- package/configure/node_modules/@pie-lib/editable-html/src/plugins/toolbar/toolbar-buttons.jsx +97 -0
- package/configure/node_modules/@pie-lib/editable-html/src/plugins/toolbar/toolbar.jsx +323 -0
- package/configure/node_modules/@pie-lib/editable-html/src/plugins/utils.js +32 -0
- package/configure/node_modules/@pie-lib/editable-html/src/serialization.jsx +385 -0
- package/configure/node_modules/@pie-lib/editable-html/src/theme.js +1 -0
- package/configure/node_modules/@pie-lib/editable-html/static.json +1 -0
- package/configure/node_modules/@pie-lib/math-input/CHANGELOG.json +1547 -0
- package/configure/node_modules/@pie-lib/math-input/CHANGELOG.md +765 -0
- package/configure/node_modules/@pie-lib/math-input/LICENSE.md +5 -0
- package/configure/node_modules/@pie-lib/math-input/README.md +27 -0
- package/configure/node_modules/@pie-lib/math-input/lib/horizontal-keypad.js +129 -0
- package/configure/node_modules/@pie-lib/math-input/lib/horizontal-keypad.js.map +1 -0
- package/configure/node_modules/@pie-lib/math-input/lib/index.js +80 -0
- package/configure/node_modules/@pie-lib/math-input/lib/index.js.map +1 -0
- package/configure/node_modules/@pie-lib/math-input/lib/keypad/index.js +440 -0
- package/configure/node_modules/@pie-lib/math-input/lib/keypad/index.js.map +1 -0
- package/configure/node_modules/@pie-lib/math-input/lib/keypad/keys-layout.js +34 -0
- package/configure/node_modules/@pie-lib/math-input/lib/keypad/keys-layout.js.map +1 -0
- package/configure/node_modules/@pie-lib/math-input/lib/keys/basic-operators.js +41 -0
- package/configure/node_modules/@pie-lib/math-input/lib/keys/basic-operators.js.map +1 -0
- package/configure/node_modules/@pie-lib/math-input/lib/keys/chars.js +17 -0
- package/configure/node_modules/@pie-lib/math-input/lib/keys/chars.js.map +1 -0
- package/configure/node_modules/@pie-lib/math-input/lib/keys/comparison.js +46 -0
- package/configure/node_modules/@pie-lib/math-input/lib/keys/comparison.js.map +1 -0
- package/configure/node_modules/@pie-lib/math-input/lib/keys/constants.js +43 -0
- package/configure/node_modules/@pie-lib/math-input/lib/keys/constants.js.map +1 -0
- package/configure/node_modules/@pie-lib/math-input/lib/keys/digits.js +53 -0
- package/configure/node_modules/@pie-lib/math-input/lib/keys/digits.js.map +1 -0
- package/configure/node_modules/@pie-lib/math-input/lib/keys/edit.js +16 -0
- package/configure/node_modules/@pie-lib/math-input/lib/keys/edit.js.map +1 -0
- package/configure/node_modules/@pie-lib/math-input/lib/keys/exponent.js +35 -0
- package/configure/node_modules/@pie-lib/math-input/lib/keys/exponent.js.map +1 -0
- package/configure/node_modules/@pie-lib/math-input/lib/keys/fractions.js +31 -0
- package/configure/node_modules/@pie-lib/math-input/lib/keys/fractions.js.map +1 -0
- package/configure/node_modules/@pie-lib/math-input/lib/keys/geometry.js +165 -0
- package/configure/node_modules/@pie-lib/math-input/lib/keys/geometry.js.map +1 -0
- package/configure/node_modules/@pie-lib/math-input/lib/keys/grades.js +295 -0
- package/configure/node_modules/@pie-lib/math-input/lib/keys/grades.js.map +1 -0
- package/configure/node_modules/@pie-lib/math-input/lib/keys/index.js +54 -0
- package/configure/node_modules/@pie-lib/math-input/lib/keys/index.js.map +1 -0
- package/configure/node_modules/@pie-lib/math-input/lib/keys/log.js +32 -0
- package/configure/node_modules/@pie-lib/math-input/lib/keys/log.js.map +1 -0
- package/configure/node_modules/@pie-lib/math-input/lib/keys/logic.js +23 -0
- package/configure/node_modules/@pie-lib/math-input/lib/keys/logic.js.map +1 -0
- package/configure/node_modules/@pie-lib/math-input/lib/keys/matrices.js +23 -0
- package/configure/node_modules/@pie-lib/math-input/lib/keys/matrices.js.map +1 -0
- package/configure/node_modules/@pie-lib/math-input/lib/keys/misc.js +69 -0
- package/configure/node_modules/@pie-lib/math-input/lib/keys/misc.js.map +1 -0
- package/configure/node_modules/@pie-lib/math-input/lib/keys/navigation.js +23 -0
- package/configure/node_modules/@pie-lib/math-input/lib/keys/navigation.js.map +1 -0
- package/configure/node_modules/@pie-lib/math-input/lib/keys/operators.js +17 -0
- package/configure/node_modules/@pie-lib/math-input/lib/keys/operators.js.map +1 -0
- package/configure/node_modules/@pie-lib/math-input/lib/keys/statistics.js +45 -0
- package/configure/node_modules/@pie-lib/math-input/lib/keys/statistics.js.map +1 -0
- package/configure/node_modules/@pie-lib/math-input/lib/keys/sub-sup.js +23 -0
- package/configure/node_modules/@pie-lib/math-input/lib/keys/sub-sup.js.map +1 -0
- package/configure/node_modules/@pie-lib/math-input/lib/keys/trigonometry.js +53 -0
- package/configure/node_modules/@pie-lib/math-input/lib/keys/trigonometry.js.map +1 -0
- package/configure/node_modules/@pie-lib/math-input/lib/keys/utils.js +130 -0
- package/configure/node_modules/@pie-lib/math-input/lib/keys/utils.js.map +1 -0
- package/configure/node_modules/@pie-lib/math-input/lib/keys/vars.js +29 -0
- package/configure/node_modules/@pie-lib/math-input/lib/keys/vars.js.map +1 -0
- package/configure/node_modules/@pie-lib/math-input/lib/math-input.js +206 -0
- package/configure/node_modules/@pie-lib/math-input/lib/math-input.js.map +1 -0
- package/configure/node_modules/@pie-lib/math-input/lib/mq/custom-elements.js +23 -0
- package/configure/node_modules/@pie-lib/math-input/lib/mq/custom-elements.js.map +1 -0
- package/configure/node_modules/@pie-lib/math-input/lib/mq/index.js +24 -0
- package/configure/node_modules/@pie-lib/math-input/lib/mq/index.js.map +1 -0
- package/configure/node_modules/@pie-lib/math-input/lib/mq/input.js +257 -0
- package/configure/node_modules/@pie-lib/math-input/lib/mq/input.js.map +1 -0
- package/configure/node_modules/@pie-lib/math-input/lib/mq/static.js +224 -0
- package/configure/node_modules/@pie-lib/math-input/lib/mq/static.js.map +1 -0
- package/configure/node_modules/@pie-lib/math-input/package.json +26 -0
- package/configure/node_modules/@pie-lib/math-input/src/horizontal-keypad.jsx +56 -0
- package/configure/node_modules/@pie-lib/math-input/src/index.jsx +27 -0
- package/configure/node_modules/@pie-lib/math-input/src/keypad/index.jsx +367 -0
- package/configure/node_modules/@pie-lib/math-input/src/keypad/keys-layout.js +17 -0
- package/configure/node_modules/@pie-lib/math-input/src/keys/basic-operators.js +32 -0
- package/configure/node_modules/@pie-lib/math-input/src/keys/chars.js +5 -0
- package/configure/node_modules/@pie-lib/math-input/src/keys/comparison.js +27 -0
- package/configure/node_modules/@pie-lib/math-input/src/keys/constants.js +35 -0
- package/configure/node_modules/@pie-lib/math-input/src/keys/digits.js +40 -0
- package/configure/node_modules/@pie-lib/math-input/src/keys/edit.js +3 -0
- package/configure/node_modules/@pie-lib/math-input/src/keys/exponent.js +27 -0
- package/configure/node_modules/@pie-lib/math-input/src/keys/fractions.js +23 -0
- package/configure/node_modules/@pie-lib/math-input/src/keys/geometry.js +140 -0
- package/configure/node_modules/@pie-lib/math-input/src/keys/grades.js +379 -0
- package/configure/node_modules/@pie-lib/math-input/src/keys/index.js +21 -0
- package/configure/node_modules/@pie-lib/math-input/src/keys/log.js +22 -0
- package/configure/node_modules/@pie-lib/math-input/src/keys/logic.js +15 -0
- package/configure/node_modules/@pie-lib/math-input/src/keys/matrices.js +15 -0
- package/configure/node_modules/@pie-lib/math-input/src/keys/misc.js +60 -0
- package/configure/node_modules/@pie-lib/math-input/src/keys/navigation.js +8 -0
- package/configure/node_modules/@pie-lib/math-input/src/keys/operators.js +9 -0
- package/configure/node_modules/@pie-lib/math-input/src/keys/statistics.js +36 -0
- package/configure/node_modules/@pie-lib/math-input/src/keys/sub-sup.js +15 -0
- package/configure/node_modules/@pie-lib/math-input/src/keys/trigonometry.js +15 -0
- package/configure/node_modules/@pie-lib/math-input/src/keys/utils.js +71 -0
- package/configure/node_modules/@pie-lib/math-input/src/keys/vars.js +19 -0
- package/configure/node_modules/@pie-lib/math-input/src/math-input.jsx +128 -0
- package/configure/node_modules/@pie-lib/math-input/src/mq/custom-elements.js +11 -0
- package/configure/node_modules/@pie-lib/math-input/src/mq/index.js +4 -0
- package/configure/node_modules/@pie-lib/math-input/src/mq/input.jsx +163 -0
- package/configure/node_modules/@pie-lib/math-input/src/mq/static.jsx +145 -0
- package/configure/node_modules/@pie-lib/math-rendering/CHANGELOG.json +672 -0
- package/configure/node_modules/@pie-lib/math-rendering/CHANGELOG.md +457 -0
- package/configure/node_modules/@pie-lib/math-rendering/LICENSE.md +5 -0
- package/configure/node_modules/@pie-lib/math-rendering/lib/index.js +30 -0
- package/configure/node_modules/@pie-lib/math-rendering/lib/index.js.map +1 -0
- package/configure/node_modules/@pie-lib/math-rendering/lib/mstack/chtml.js +316 -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 +123 -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 +103 -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 +281 -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 +19 -0
- package/configure/node_modules/@pie-lib/math-rendering/playground/demo.html +872 -0
- package/configure/node_modules/@pie-lib/math-rendering/playground/demo.js +108 -0
- package/configure/node_modules/@pie-lib/math-rendering/playground/main.html +156 -0
- package/configure/node_modules/@pie-lib/math-rendering/playground/main.js +16 -0
- package/configure/node_modules/@pie-lib/math-rendering/playground/webpack.config.js +29 -0
- package/configure/node_modules/@pie-lib/math-rendering/src/index.js +4 -0
- package/configure/node_modules/@pie-lib/math-rendering/src/mstack/chtml.js +215 -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 +235 -0
- package/configure/node_modules/@pie-lib/math-toolbar/CHANGELOG.json +862 -0
- package/configure/node_modules/@pie-lib/math-toolbar/CHANGELOG.md +639 -0
- package/configure/node_modules/@pie-lib/math-toolbar/LICENSE.md +5 -0
- package/configure/node_modules/@pie-lib/math-toolbar/lib/done-button.js +53 -0
- package/configure/node_modules/@pie-lib/math-toolbar/lib/done-button.js.map +1 -0
- package/configure/node_modules/@pie-lib/math-toolbar/lib/editor-and-pad.js +483 -0
- package/configure/node_modules/@pie-lib/math-toolbar/lib/editor-and-pad.js.map +1 -0
- package/configure/node_modules/@pie-lib/math-toolbar/lib/index.js +280 -0
- package/configure/node_modules/@pie-lib/math-toolbar/lib/index.js.map +1 -0
- package/configure/node_modules/@pie-lib/math-toolbar/lib/math-preview.js +173 -0
- package/configure/node_modules/@pie-lib/math-toolbar/lib/math-preview.js.map +1 -0
- package/configure/node_modules/@pie-lib/math-toolbar/package.json +37 -0
- package/configure/node_modules/@pie-lib/math-toolbar/src/done-button.jsx +39 -0
- package/configure/node_modules/@pie-lib/math-toolbar/src/editor-and-pad.jsx +388 -0
- package/configure/node_modules/@pie-lib/math-toolbar/src/index.jsx +202 -0
- package/configure/node_modules/@pie-lib/math-toolbar/src/math-preview.jsx +107 -0
- package/configure/node_modules/@pie-lib/render-ui/CHANGELOG.json +937 -0
- package/configure/node_modules/@pie-lib/render-ui/CHANGELOG.md +626 -0
- package/configure/node_modules/@pie-lib/render-ui/LICENSE.md +5 -0
- package/configure/node_modules/@pie-lib/render-ui/README.md +33 -0
- package/configure/node_modules/@pie-lib/render-ui/lib/collapsible/index.js +146 -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 +134 -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 +160 -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-text.js +24 -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 +102 -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 +104 -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 +133 -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 +162 -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 +160 -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/withUndoReset.js +206 -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 +30 -0
- package/configure/node_modules/@pie-lib/render-ui/src/collapsible/index.jsx +68 -0
- package/configure/node_modules/@pie-lib/render-ui/src/color.js +48 -0
- package/configure/node_modules/@pie-lib/render-ui/src/feedback.jsx +100 -0
- package/configure/node_modules/@pie-lib/render-ui/src/has-text.js +14 -0
- package/configure/node_modules/@pie-lib/render-ui/src/html-and-math.js +40 -0
- package/configure/node_modules/@pie-lib/render-ui/src/index.js +27 -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 +77 -0
- package/configure/node_modules/@pie-lib/render-ui/src/preview-prompt.jsx +90 -0
- package/configure/node_modules/@pie-lib/render-ui/src/purpose.jsx +19 -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/withUndoReset.jsx +118 -0
- package/configure/package.json +1 -1
- package/lib/index.js +2 -2
- package/lib/index.js.map +1 -1
- package/lib/print.js +2 -2
- package/lib/print.js.map +1 -1
- package/package.json +2 -2
- package/src/index.js +2 -2
- package/src/print.js +2 -2
|
@@ -0,0 +1,385 @@
|
|
|
1
|
+
import Html from 'slate-html-serializer';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import debug from 'debug';
|
|
4
|
+
import { object as toStyleObject } from 'to-style';
|
|
5
|
+
|
|
6
|
+
import { serialization as imgSerialization } from './plugins/image';
|
|
7
|
+
import { serialization as mathSerialization } from './plugins/math';
|
|
8
|
+
import { serialization as mediaSerialization } from './plugins/media';
|
|
9
|
+
import { serialization as listSerialization } from './plugins/list';
|
|
10
|
+
import { serialization as tableSerialization } from './plugins/table';
|
|
11
|
+
import { serialization as responseAreaSerialization } from './plugins/respArea';
|
|
12
|
+
import { Mark, Value } from 'slate';
|
|
13
|
+
|
|
14
|
+
const log = debug('@pie-lib:editable-html:serialization');
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Tags to blocks.
|
|
18
|
+
*
|
|
19
|
+
* @type {Object}
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
export const BLOCK_TAGS = {
|
|
23
|
+
div: 'div',
|
|
24
|
+
span: 'span',
|
|
25
|
+
p: 'paragraph',
|
|
26
|
+
blockquote: 'quote',
|
|
27
|
+
pre: 'code',
|
|
28
|
+
h1: 'heading-one',
|
|
29
|
+
h2: 'heading-two',
|
|
30
|
+
h3: 'heading-three',
|
|
31
|
+
h4: 'heading-four',
|
|
32
|
+
h5: 'heading-five',
|
|
33
|
+
h6: 'heading-six'
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Tags to marks.
|
|
38
|
+
*
|
|
39
|
+
* @type {Object}
|
|
40
|
+
*/
|
|
41
|
+
|
|
42
|
+
const MARK_TAGS = {
|
|
43
|
+
b: 'bold',
|
|
44
|
+
em: 'italic',
|
|
45
|
+
u: 'underline',
|
|
46
|
+
s: 'strikethrough',
|
|
47
|
+
code: 'code',
|
|
48
|
+
strong: 'bold'
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
export const parseStyleString = s => {
|
|
52
|
+
const regex = /([\w-]*)\s*:\s*([^;]*)/g;
|
|
53
|
+
let match;
|
|
54
|
+
const result = {};
|
|
55
|
+
while ((match = regex.exec(s))) {
|
|
56
|
+
result[match[1]] = match[2].trim();
|
|
57
|
+
}
|
|
58
|
+
return result;
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
export const getBase64 = file => {
|
|
62
|
+
return new Promise((resolve, reject) => {
|
|
63
|
+
const reader = new FileReader();
|
|
64
|
+
reader.readAsDataURL(file);
|
|
65
|
+
reader.onload = () => resolve(reader.result);
|
|
66
|
+
reader.onerror = error => reject(error);
|
|
67
|
+
});
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
export const reactAttributes = o => toStyleObject(o, { camelize: true, addUnits: false });
|
|
71
|
+
|
|
72
|
+
const attributesToMap = el => (acc, attribute) => {
|
|
73
|
+
const value = el.getAttribute(attribute);
|
|
74
|
+
if (value) {
|
|
75
|
+
if (attribute === 'style') {
|
|
76
|
+
const styleString = el.getAttribute(attribute);
|
|
77
|
+
const reactStyleObject = reactAttributes(parseStyleString(styleString));
|
|
78
|
+
acc['style'] = reactStyleObject;
|
|
79
|
+
} else {
|
|
80
|
+
acc[attribute] = el.getAttribute(attribute);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
return acc;
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
const attributes = ['border', 'cellpadding', 'cellspacing', 'class', 'style'];
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* Serializer rules.
|
|
90
|
+
*
|
|
91
|
+
* @type {Array}
|
|
92
|
+
*/
|
|
93
|
+
|
|
94
|
+
const blocks = {
|
|
95
|
+
deserialize(el, next) {
|
|
96
|
+
log('[blocks:deserialize] block: ', el);
|
|
97
|
+
const block = BLOCK_TAGS[el.tagName.toLowerCase()];
|
|
98
|
+
if (!block) return;
|
|
99
|
+
log('[blocks:deserialize] block: ', block);
|
|
100
|
+
|
|
101
|
+
if (el.childNodes.length === 1) {
|
|
102
|
+
const cn = el.childNodes[0];
|
|
103
|
+
if (cn && cn.tagName && cn.tagName.toLowerCase() === block) {
|
|
104
|
+
log('[we have a child node of the same]...');
|
|
105
|
+
return;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
return {
|
|
110
|
+
object: 'block',
|
|
111
|
+
type: block,
|
|
112
|
+
/**
|
|
113
|
+
* Here for rendering styles for all block elements
|
|
114
|
+
*/
|
|
115
|
+
data: { attributes: attributes.reduce(attributesToMap(el), {}) },
|
|
116
|
+
nodes: next(el.childNodes)
|
|
117
|
+
};
|
|
118
|
+
},
|
|
119
|
+
serialize: (object, children) => {
|
|
120
|
+
if (object.object !== 'block') return;
|
|
121
|
+
|
|
122
|
+
const jsonData = object.data.toJSON();
|
|
123
|
+
|
|
124
|
+
log('[blocks:serialize] object: ', object, children);
|
|
125
|
+
let key;
|
|
126
|
+
|
|
127
|
+
for (key in BLOCK_TAGS) {
|
|
128
|
+
if (BLOCK_TAGS[key] === object.type) {
|
|
129
|
+
const Tag = key;
|
|
130
|
+
|
|
131
|
+
return <Tag {...jsonData.attributes}>{children}</Tag>;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
};
|
|
136
|
+
|
|
137
|
+
const marks = {
|
|
138
|
+
deserialize(el, next) {
|
|
139
|
+
const mark = MARK_TAGS[el.tagName.toLowerCase()];
|
|
140
|
+
if (!mark) return;
|
|
141
|
+
log('[deserialize] mark: ', mark);
|
|
142
|
+
return {
|
|
143
|
+
object: 'mark',
|
|
144
|
+
type: mark,
|
|
145
|
+
nodes: next(el.childNodes)
|
|
146
|
+
};
|
|
147
|
+
},
|
|
148
|
+
serialize(object, children) {
|
|
149
|
+
if (Mark.isMark(object)) {
|
|
150
|
+
for (var key in MARK_TAGS) {
|
|
151
|
+
if (MARK_TAGS[key] === object.type) {
|
|
152
|
+
const Tag = key;
|
|
153
|
+
return <Tag>{children}</Tag>;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
};
|
|
159
|
+
|
|
160
|
+
const findPreviousText = el => {
|
|
161
|
+
if (el.nodeName === '#text') {
|
|
162
|
+
return el;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
if (el.previousSibling) {
|
|
166
|
+
return findPreviousText(el.previousSibling);
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
return null;
|
|
170
|
+
};
|
|
171
|
+
|
|
172
|
+
export const TEXT_RULE = {
|
|
173
|
+
deserialize(el) {
|
|
174
|
+
/**
|
|
175
|
+
* This needs to be called on the dom element in order to merge the adjacent text nodes together
|
|
176
|
+
* */
|
|
177
|
+
el.normalize();
|
|
178
|
+
|
|
179
|
+
if (el.tagName && el.tagName.toLowerCase() === 'br') {
|
|
180
|
+
return {
|
|
181
|
+
object: 'text',
|
|
182
|
+
leaves: [
|
|
183
|
+
{
|
|
184
|
+
object: 'leaf',
|
|
185
|
+
text: '\n'
|
|
186
|
+
}
|
|
187
|
+
]
|
|
188
|
+
};
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
if (el.nodeName === '#text') {
|
|
192
|
+
if (el.nodeValue && el.nodeValue.match(/<!--.*?-->/)) return;
|
|
193
|
+
|
|
194
|
+
log('[text:deserialize] return text object..');
|
|
195
|
+
return {
|
|
196
|
+
object: 'text',
|
|
197
|
+
leaves: [
|
|
198
|
+
{
|
|
199
|
+
object: 'leaf',
|
|
200
|
+
text: el.nodeValue
|
|
201
|
+
}
|
|
202
|
+
]
|
|
203
|
+
};
|
|
204
|
+
}
|
|
205
|
+
},
|
|
206
|
+
|
|
207
|
+
serialize(obj, children) {
|
|
208
|
+
if (obj.object === 'string') {
|
|
209
|
+
return children.split('\n').reduce((array, text, i) => {
|
|
210
|
+
if (i !== 0) array.push(<br />);
|
|
211
|
+
array.push(text);
|
|
212
|
+
return array;
|
|
213
|
+
}, []);
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
};
|
|
217
|
+
|
|
218
|
+
const RULES = [
|
|
219
|
+
listSerialization,
|
|
220
|
+
mathSerialization,
|
|
221
|
+
mediaSerialization,
|
|
222
|
+
imgSerialization,
|
|
223
|
+
tableSerialization,
|
|
224
|
+
responseAreaSerialization,
|
|
225
|
+
TEXT_RULE,
|
|
226
|
+
blocks,
|
|
227
|
+
marks
|
|
228
|
+
];
|
|
229
|
+
|
|
230
|
+
function allWhitespace(node) {
|
|
231
|
+
// Use ECMA-262 Edition 3 String and RegExp features
|
|
232
|
+
return !/[^\t\n\r ]/.test(node.textContent);
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
function defaultParseHtml(html) {
|
|
236
|
+
if (typeof DOMParser === 'undefined') {
|
|
237
|
+
throw new Error(
|
|
238
|
+
'The native `DOMParser` global which the `Html` serializer uses by default is not present in this environment. You must supply the `options.parseHtml` function instead.'
|
|
239
|
+
);
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
const parsed = new DOMParser().parseFromString(html, 'text/html');
|
|
243
|
+
|
|
244
|
+
const { body } = parsed;
|
|
245
|
+
var textNodes = document.createTreeWalker(body, NodeFilter.SHOW_TEXT, null, null);
|
|
246
|
+
var n = textNodes.nextNode();
|
|
247
|
+
|
|
248
|
+
while (n) {
|
|
249
|
+
if (allWhitespace(n) || n.nodeValue === '\u200B') {
|
|
250
|
+
n.parentNode.removeChild(n);
|
|
251
|
+
}
|
|
252
|
+
n = textNodes.nextNode();
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
return body;
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
/** If this lib is used on the server side, we need to bypass using the DOMParser - just put in a stub. */
|
|
259
|
+
const parseHtml =
|
|
260
|
+
typeof window === 'undefined'
|
|
261
|
+
? () => ({
|
|
262
|
+
childNodes: []
|
|
263
|
+
})
|
|
264
|
+
: defaultParseHtml;
|
|
265
|
+
|
|
266
|
+
const serializer = new Html({
|
|
267
|
+
defaultBlock: 'div',
|
|
268
|
+
rules: RULES,
|
|
269
|
+
parseHtml
|
|
270
|
+
});
|
|
271
|
+
|
|
272
|
+
const _extends =
|
|
273
|
+
Object.assign ||
|
|
274
|
+
function(target) {
|
|
275
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
276
|
+
var source = arguments[i];
|
|
277
|
+
|
|
278
|
+
for (var key in source) {
|
|
279
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
280
|
+
target[key] = source[key];
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
return target;
|
|
286
|
+
};
|
|
287
|
+
|
|
288
|
+
/**
|
|
289
|
+
* This is needed in order to override the function that eventually leads
|
|
290
|
+
* to the max iteration of 12, which in most cases it's not enough. The newer versions
|
|
291
|
+
* have a different way to calculate this, but updating to a newer version of slate
|
|
292
|
+
* requires a lot of work fixing other issues. So we just increase the rules by 1000,
|
|
293
|
+
* which means a lot of iterations.
|
|
294
|
+
* Below is the code that calculates the max iterations.
|
|
295
|
+
* var max = schema.stack.plugins.length + schema.rules.length + 1;
|
|
296
|
+
*/
|
|
297
|
+
serializer.deserialize = function deserialize(html) {
|
|
298
|
+
const options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
299
|
+
const _options$toJSON = options.toJSON;
|
|
300
|
+
const toJSON = _options$toJSON === undefined ? false : _options$toJSON;
|
|
301
|
+
const defaultBlock = this.defaultBlock;
|
|
302
|
+
const parseHtml = this.parseHtml;
|
|
303
|
+
|
|
304
|
+
const fragment = parseHtml(html);
|
|
305
|
+
const children = Array.from(fragment.childNodes);
|
|
306
|
+
let nodes = this.deserializeElements(children);
|
|
307
|
+
|
|
308
|
+
// COMPAT: ensure that all top-level inline nodes are wrapped into a block.
|
|
309
|
+
nodes = nodes.reduce(function(memo, node, i, original) {
|
|
310
|
+
if (node.object === 'block') {
|
|
311
|
+
memo.push(node);
|
|
312
|
+
return memo;
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
if (i > 0 && original[i - 1].object !== 'block') {
|
|
316
|
+
const _block = memo[memo.length - 1];
|
|
317
|
+
|
|
318
|
+
_block.nodes.push(node);
|
|
319
|
+
return memo;
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
const block = _extends({ object: 'block', data: {}, isVoid: false }, defaultBlock, {
|
|
323
|
+
nodes: [node]
|
|
324
|
+
});
|
|
325
|
+
|
|
326
|
+
memo.push(block);
|
|
327
|
+
return memo;
|
|
328
|
+
}, []);
|
|
329
|
+
|
|
330
|
+
if (nodes.length === 0) {
|
|
331
|
+
nodes = [
|
|
332
|
+
_extends({ object: 'block', data: {}, isVoid: false }, defaultBlock, {
|
|
333
|
+
nodes: [{ object: 'text', leaves: [{ object: 'leaf', text: '', marks: [] }] }]
|
|
334
|
+
})
|
|
335
|
+
];
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
const json = {
|
|
339
|
+
object: 'value',
|
|
340
|
+
document: {
|
|
341
|
+
object: 'document',
|
|
342
|
+
data: {},
|
|
343
|
+
nodes: nodes
|
|
344
|
+
},
|
|
345
|
+
schema: {
|
|
346
|
+
rules: []
|
|
347
|
+
}
|
|
348
|
+
};
|
|
349
|
+
|
|
350
|
+
let i;
|
|
351
|
+
|
|
352
|
+
for (i = 0; i < 3000; i++) {
|
|
353
|
+
json.schema.rules.push({
|
|
354
|
+
match: { object: 'document' },
|
|
355
|
+
nodes: [{ match: { object: 'block' } }]
|
|
356
|
+
});
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
const ret = toJSON ? json : Value.fromJSON(json);
|
|
360
|
+
|
|
361
|
+
if (ret) {
|
|
362
|
+
return ret;
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
return null;
|
|
366
|
+
};
|
|
367
|
+
|
|
368
|
+
export const htmlToValue = html => {
|
|
369
|
+
try {
|
|
370
|
+
return serializer.deserialize(html);
|
|
371
|
+
} catch (e) {
|
|
372
|
+
console.log("Couldn't parse html: ", e);
|
|
373
|
+
return {};
|
|
374
|
+
}
|
|
375
|
+
};
|
|
376
|
+
|
|
377
|
+
export const valueToHtml = value => serializer.serialize(value);
|
|
378
|
+
|
|
379
|
+
/**
|
|
380
|
+
*
|
|
381
|
+
* <div><div>a</div></div> -> <div>a</div>
|
|
382
|
+
*
|
|
383
|
+
* <div><div>a</div><div>b</div></div> -> <div>a</div><div>b</div>
|
|
384
|
+
* <div><div>a</div>4444<div>b</div></div> -> <div>a</div>4444<div>b</div>
|
|
385
|
+
*/
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const primary = '#304ffe';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|