@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.
Files changed (442) hide show
  1. package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/CHANGELOG.json +1677 -0
  2. package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/CHANGELOG.md +1695 -0
  3. package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/LICENSE.md +5 -0
  4. package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/README.md +12 -0
  5. package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/lib/alert-dialog.js +44 -0
  6. package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/lib/alert-dialog.js.map +1 -0
  7. package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/lib/checkbox.js +86 -0
  8. package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/lib/checkbox.js.map +1 -0
  9. package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/lib/choice-configuration/feedback-menu.js +164 -0
  10. package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/lib/choice-configuration/feedback-menu.js.map +1 -0
  11. package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/lib/choice-configuration/index.js +398 -0
  12. package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/lib/choice-configuration/index.js.map +1 -0
  13. package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/lib/choice-utils.js +54 -0
  14. package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/lib/choice-utils.js.map +1 -0
  15. package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/lib/feedback-config/feedback-selector.js +185 -0
  16. package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/lib/feedback-config/feedback-selector.js.map +1 -0
  17. package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/lib/feedback-config/group.js +75 -0
  18. package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/lib/feedback-config/group.js.map +1 -0
  19. package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/lib/feedback-config/index.js +178 -0
  20. package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/lib/feedback-config/index.js.map +1 -0
  21. package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/lib/form-section.js +46 -0
  22. package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/lib/form-section.js.map +1 -0
  23. package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/lib/help.js +145 -0
  24. package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/lib/help.js.map +1 -0
  25. package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/lib/index.js +216 -0
  26. package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/lib/index.js.map +1 -0
  27. package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/lib/input.js +139 -0
  28. package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/lib/input.js.map +1 -0
  29. package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/lib/inputs.js +131 -0
  30. package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/lib/inputs.js.map +1 -0
  31. package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/lib/langs.js +179 -0
  32. package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/lib/langs.js.map +1 -0
  33. package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/lib/layout/config-layout.js +101 -0
  34. package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/lib/layout/config-layout.js.map +1 -0
  35. package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/lib/layout/index.js +24 -0
  36. package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/lib/layout/index.js.map +1 -0
  37. package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/lib/layout/layout-contents.js +105 -0
  38. package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/lib/layout/layout-contents.js.map +1 -0
  39. package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/lib/layout/settings-box.js +87 -0
  40. package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/lib/layout/settings-box.js.map +1 -0
  41. package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/lib/mui-box/index.js +79 -0
  42. package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/lib/mui-box/index.js.map +1 -0
  43. package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/lib/number-text-field-custom.js +364 -0
  44. package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/lib/number-text-field-custom.js.map +1 -0
  45. package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/lib/number-text-field.js +265 -0
  46. package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/lib/number-text-field.js.map +1 -0
  47. package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/lib/radio-with-label.js +41 -0
  48. package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/lib/radio-with-label.js.map +1 -0
  49. package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/lib/settings/display-size.js +77 -0
  50. package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/lib/settings/display-size.js.map +1 -0
  51. package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/lib/settings/index.js +130 -0
  52. package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/lib/settings/index.js.map +1 -0
  53. package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/lib/settings/panel.js +412 -0
  54. package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/lib/settings/panel.js.map +1 -0
  55. package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/lib/settings/settings-radio-label.js +43 -0
  56. package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/lib/settings/settings-radio-label.js.map +1 -0
  57. package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/lib/settings/toggle.js +56 -0
  58. package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/lib/settings/toggle.js.map +1 -0
  59. package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/lib/tabs/index.js +106 -0
  60. package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/lib/tabs/index.js.map +1 -0
  61. package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/lib/tags-input/index.js +198 -0
  62. package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/lib/tags-input/index.js.map +1 -0
  63. package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/lib/two-choice.js +180 -0
  64. package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/lib/two-choice.js.map +1 -0
  65. package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/lib/with-stateful-model.js +84 -0
  66. package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/lib/with-stateful-model.js.map +1 -0
  67. package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/package.json +30 -0
  68. package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/src/alert-dialog.jsx +43 -0
  69. package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/src/checkbox.jsx +63 -0
  70. package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/src/choice-configuration/feedback-menu.jsx +103 -0
  71. package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/src/choice-configuration/index.jsx +319 -0
  72. package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/src/choice-utils.js +30 -0
  73. package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/src/feedback-config/feedback-selector.jsx +116 -0
  74. package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/src/feedback-config/group.jsx +54 -0
  75. package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/src/feedback-config/index.jsx +98 -0
  76. package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/src/form-section.jsx +23 -0
  77. package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/src/help.jsx +88 -0
  78. package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/src/index.js +58 -0
  79. package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/src/input.jsx +72 -0
  80. package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/src/inputs.jsx +96 -0
  81. package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/src/langs.jsx +122 -0
  82. package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/src/layout/config-layout.jsx +64 -0
  83. package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/src/layout/index.js +4 -0
  84. package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/src/layout/layout-contents.jsx +60 -0
  85. package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/src/layout/settings-box.jsx +31 -0
  86. package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/src/mui-box/index.jsx +64 -0
  87. package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/src/number-text-field-custom.jsx +276 -0
  88. package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/src/number-text-field.jsx +196 -0
  89. package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/src/radio-with-label.jsx +18 -0
  90. package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/src/settings/display-size.jsx +52 -0
  91. package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/src/settings/index.js +75 -0
  92. package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/src/settings/panel.jsx +297 -0
  93. package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/src/settings/settings-radio-label.jsx +20 -0
  94. package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/src/settings/toggle.jsx +31 -0
  95. package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/src/tabs/index.jsx +51 -0
  96. package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/src/tags-input/index.jsx +121 -0
  97. package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/src/two-choice.jsx +94 -0
  98. package/configure/node_modules/@pie-element/multiple-choice/node_modules/@pie-lib/config-ui/src/with-stateful-model.jsx +36 -0
  99. package/configure/node_modules/@pie-lib/correct-answer-toggle/CHANGELOG.json +547 -0
  100. package/configure/node_modules/@pie-lib/correct-answer-toggle/CHANGELOG.md +524 -0
  101. package/configure/node_modules/@pie-lib/correct-answer-toggle/LICENSE.md +5 -0
  102. package/configure/node_modules/@pie-lib/correct-answer-toggle/README.md +64 -0
  103. package/configure/node_modules/@pie-lib/correct-answer-toggle/lib/expander.js +86 -0
  104. package/configure/node_modules/@pie-lib/correct-answer-toggle/lib/expander.js.map +1 -0
  105. package/configure/node_modules/@pie-lib/correct-answer-toggle/lib/index.js +155 -0
  106. package/configure/node_modules/@pie-lib/correct-answer-toggle/lib/index.js.map +1 -0
  107. package/configure/node_modules/@pie-lib/correct-answer-toggle/lib/styles.js +65 -0
  108. package/configure/node_modules/@pie-lib/correct-answer-toggle/lib/styles.js.map +1 -0
  109. package/configure/node_modules/@pie-lib/correct-answer-toggle/package.json +36 -0
  110. package/configure/node_modules/@pie-lib/correct-answer-toggle/preview.png +0 -0
  111. package/configure/node_modules/@pie-lib/correct-answer-toggle/src/expander.jsx +65 -0
  112. package/configure/node_modules/@pie-lib/correct-answer-toggle/src/index.jsx +75 -0
  113. package/configure/node_modules/@pie-lib/correct-answer-toggle/src/styles.js +60 -0
  114. package/configure/node_modules/@pie-lib/editable-html/CHANGELOG.json +3327 -0
  115. package/configure/node_modules/@pie-lib/editable-html/CHANGELOG.md +1676 -0
  116. package/configure/node_modules/@pie-lib/editable-html/LICENSE.md +5 -0
  117. package/configure/node_modules/@pie-lib/editable-html/README.md +45 -0
  118. package/configure/node_modules/@pie-lib/editable-html/deploy.sh +16 -0
  119. package/configure/node_modules/@pie-lib/editable-html/lib/editor.js +837 -0
  120. package/configure/node_modules/@pie-lib/editable-html/lib/editor.js.map +1 -0
  121. package/configure/node_modules/@pie-lib/editable-html/lib/index.js +224 -0
  122. package/configure/node_modules/@pie-lib/editable-html/lib/index.js.map +1 -0
  123. package/configure/node_modules/@pie-lib/editable-html/lib/parse-html.js +16 -0
  124. package/configure/node_modules/@pie-lib/editable-html/lib/parse-html.js.map +1 -0
  125. package/configure/node_modules/@pie-lib/editable-html/lib/plugins/characters/custom-popover.js +70 -0
  126. package/configure/node_modules/@pie-lib/editable-html/lib/plugins/characters/custom-popover.js.map +1 -0
  127. package/configure/node_modules/@pie-lib/editable-html/lib/plugins/characters/index.js +261 -0
  128. package/configure/node_modules/@pie-lib/editable-html/lib/plugins/characters/index.js.map +1 -0
  129. package/configure/node_modules/@pie-lib/editable-html/lib/plugins/characters/utils.js +362 -0
  130. package/configure/node_modules/@pie-lib/editable-html/lib/plugins/characters/utils.js.map +1 -0
  131. package/configure/node_modules/@pie-lib/editable-html/lib/plugins/image/component.js +393 -0
  132. package/configure/node_modules/@pie-lib/editable-html/lib/plugins/image/component.js.map +1 -0
  133. package/configure/node_modules/@pie-lib/editable-html/lib/plugins/image/image-toolbar.js +78 -0
  134. package/configure/node_modules/@pie-lib/editable-html/lib/plugins/image/image-toolbar.js.map +1 -0
  135. package/configure/node_modules/@pie-lib/editable-html/lib/plugins/image/index.js +221 -0
  136. package/configure/node_modules/@pie-lib/editable-html/lib/plugins/image/index.js.map +1 -0
  137. package/configure/node_modules/@pie-lib/editable-html/lib/plugins/image/insert-image-handler.js +135 -0
  138. package/configure/node_modules/@pie-lib/editable-html/lib/plugins/image/insert-image-handler.js.map +1 -0
  139. package/configure/node_modules/@pie-lib/editable-html/lib/plugins/index.js +141 -0
  140. package/configure/node_modules/@pie-lib/editable-html/lib/plugins/index.js.map +1 -0
  141. package/configure/node_modules/@pie-lib/editable-html/lib/plugins/list/index.js +204 -0
  142. package/configure/node_modules/@pie-lib/editable-html/lib/plugins/list/index.js.map +1 -0
  143. package/configure/node_modules/@pie-lib/editable-html/lib/plugins/math/index.js +347 -0
  144. package/configure/node_modules/@pie-lib/editable-html/lib/plugins/math/index.js.map +1 -0
  145. package/configure/node_modules/@pie-lib/editable-html/lib/plugins/media/index.js +339 -0
  146. package/configure/node_modules/@pie-lib/editable-html/lib/plugins/media/index.js.map +1 -0
  147. package/configure/node_modules/@pie-lib/editable-html/lib/plugins/media/media-dialog.js +434 -0
  148. package/configure/node_modules/@pie-lib/editable-html/lib/plugins/media/media-dialog.js.map +1 -0
  149. package/configure/node_modules/@pie-lib/editable-html/lib/plugins/media/media-toolbar.js +99 -0
  150. package/configure/node_modules/@pie-lib/editable-html/lib/plugins/media/media-toolbar.js.map +1 -0
  151. package/configure/node_modules/@pie-lib/editable-html/lib/plugins/media/media-wrapper.js +93 -0
  152. package/configure/node_modules/@pie-lib/editable-html/lib/plugins/media/media-wrapper.js.map +1 -0
  153. package/configure/node_modules/@pie-lib/editable-html/lib/plugins/respArea/drag-in-the-blank/choice.js +251 -0
  154. package/configure/node_modules/@pie-lib/editable-html/lib/plugins/respArea/drag-in-the-blank/choice.js.map +1 -0
  155. package/configure/node_modules/@pie-lib/editable-html/lib/plugins/respArea/drag-in-the-blank/index.js +97 -0
  156. package/configure/node_modules/@pie-lib/editable-html/lib/plugins/respArea/drag-in-the-blank/index.js.map +1 -0
  157. package/configure/node_modules/@pie-lib/editable-html/lib/plugins/respArea/explicit-constructed-response/index.js +54 -0
  158. package/configure/node_modules/@pie-lib/editable-html/lib/plugins/respArea/explicit-constructed-response/index.js.map +1 -0
  159. package/configure/node_modules/@pie-lib/editable-html/lib/plugins/respArea/icons/index.js +93 -0
  160. package/configure/node_modules/@pie-lib/editable-html/lib/plugins/respArea/icons/index.js.map +1 -0
  161. package/configure/node_modules/@pie-lib/editable-html/lib/plugins/respArea/index.js +288 -0
  162. package/configure/node_modules/@pie-lib/editable-html/lib/plugins/respArea/index.js.map +1 -0
  163. package/configure/node_modules/@pie-lib/editable-html/lib/plugins/respArea/inline-dropdown/index.js +70 -0
  164. package/configure/node_modules/@pie-lib/editable-html/lib/plugins/respArea/inline-dropdown/index.js.map +1 -0
  165. package/configure/node_modules/@pie-lib/editable-html/lib/plugins/respArea/utils.js +110 -0
  166. package/configure/node_modules/@pie-lib/editable-html/lib/plugins/respArea/utils.js.map +1 -0
  167. package/configure/node_modules/@pie-lib/editable-html/lib/plugins/table/icons/index.js +69 -0
  168. package/configure/node_modules/@pie-lib/editable-html/lib/plugins/table/icons/index.js.map +1 -0
  169. package/configure/node_modules/@pie-lib/editable-html/lib/plugins/table/index.js +497 -0
  170. package/configure/node_modules/@pie-lib/editable-html/lib/plugins/table/index.js.map +1 -0
  171. package/configure/node_modules/@pie-lib/editable-html/lib/plugins/table/table-toolbar.js +158 -0
  172. package/configure/node_modules/@pie-lib/editable-html/lib/plugins/table/table-toolbar.js.map +1 -0
  173. package/configure/node_modules/@pie-lib/editable-html/lib/plugins/toolbar/default-toolbar.js +132 -0
  174. package/configure/node_modules/@pie-lib/editable-html/lib/plugins/toolbar/default-toolbar.js.map +1 -0
  175. package/configure/node_modules/@pie-lib/editable-html/lib/plugins/toolbar/done-button.js +50 -0
  176. package/configure/node_modules/@pie-lib/editable-html/lib/plugins/toolbar/done-button.js.map +1 -0
  177. package/configure/node_modules/@pie-lib/editable-html/lib/plugins/toolbar/editor-and-toolbar.js +263 -0
  178. package/configure/node_modules/@pie-lib/editable-html/lib/plugins/toolbar/editor-and-toolbar.js.map +1 -0
  179. package/configure/node_modules/@pie-lib/editable-html/lib/plugins/toolbar/index.js +32 -0
  180. package/configure/node_modules/@pie-lib/editable-html/lib/plugins/toolbar/index.js.map +1 -0
  181. package/configure/node_modules/@pie-lib/editable-html/lib/plugins/toolbar/toolbar-buttons.js +161 -0
  182. package/configure/node_modules/@pie-lib/editable-html/lib/plugins/toolbar/toolbar-buttons.js.map +1 -0
  183. package/configure/node_modules/@pie-lib/editable-html/lib/plugins/toolbar/toolbar.js +346 -0
  184. package/configure/node_modules/@pie-lib/editable-html/lib/plugins/toolbar/toolbar.js.map +1 -0
  185. package/configure/node_modules/@pie-lib/editable-html/lib/plugins/utils.js +62 -0
  186. package/configure/node_modules/@pie-lib/editable-html/lib/plugins/utils.js.map +1 -0
  187. package/configure/node_modules/@pie-lib/editable-html/lib/serialization.js +428 -0
  188. package/configure/node_modules/@pie-lib/editable-html/lib/serialization.js.map +1 -0
  189. package/configure/node_modules/@pie-lib/editable-html/lib/theme.js +9 -0
  190. package/configure/node_modules/@pie-lib/editable-html/lib/theme.js.map +1 -0
  191. package/configure/node_modules/@pie-lib/editable-html/package.json +51 -0
  192. package/configure/node_modules/@pie-lib/editable-html/playground/image/data.js +59 -0
  193. package/configure/node_modules/@pie-lib/editable-html/playground/image/index.html +24 -0
  194. package/configure/node_modules/@pie-lib/editable-html/playground/image/index.jsx +83 -0
  195. package/configure/node_modules/@pie-lib/editable-html/playground/index.html +27 -0
  196. package/configure/node_modules/@pie-lib/editable-html/playground/mathquill/index.html +25 -0
  197. package/configure/node_modules/@pie-lib/editable-html/playground/mathquill/index.jsx +151 -0
  198. package/configure/node_modules/@pie-lib/editable-html/playground/package.json +15 -0
  199. package/configure/node_modules/@pie-lib/editable-html/playground/prod-test/index.html +26 -0
  200. package/configure/node_modules/@pie-lib/editable-html/playground/prod-test/index.jsx +30 -0
  201. package/configure/node_modules/@pie-lib/editable-html/playground/schema-override/data.js +29 -0
  202. package/configure/node_modules/@pie-lib/editable-html/playground/schema-override/image-plugin.jsx +40 -0
  203. package/configure/node_modules/@pie-lib/editable-html/playground/schema-override/index.html +23 -0
  204. package/configure/node_modules/@pie-lib/editable-html/playground/schema-override/index.jsx +96 -0
  205. package/configure/node_modules/@pie-lib/editable-html/playground/serialization/data.js +29 -0
  206. package/configure/node_modules/@pie-lib/editable-html/playground/serialization/image-plugin.jsx +40 -0
  207. package/configure/node_modules/@pie-lib/editable-html/playground/serialization/index.html +24 -0
  208. package/configure/node_modules/@pie-lib/editable-html/playground/serialization/index.jsx +12 -0
  209. package/configure/node_modules/@pie-lib/editable-html/playground/static.json +3 -0
  210. package/configure/node_modules/@pie-lib/editable-html/playground/table-examples.html +67 -0
  211. package/configure/node_modules/@pie-lib/editable-html/playground/webpack.config.js +42 -0
  212. package/configure/node_modules/@pie-lib/editable-html/src/editor.jsx +724 -0
  213. package/configure/node_modules/@pie-lib/editable-html/src/index.jsx +145 -0
  214. package/configure/node_modules/@pie-lib/editable-html/src/parse-html.js +8 -0
  215. package/configure/node_modules/@pie-lib/editable-html/src/plugins/README.md +27 -0
  216. package/configure/node_modules/@pie-lib/editable-html/src/plugins/characters/custom-popover.js +45 -0
  217. package/configure/node_modules/@pie-lib/editable-html/src/plugins/characters/index.jsx +237 -0
  218. package/configure/node_modules/@pie-lib/editable-html/src/plugins/characters/utils.js +444 -0
  219. package/configure/node_modules/@pie-lib/editable-html/src/plugins/image/component.jsx +318 -0
  220. package/configure/node_modules/@pie-lib/editable-html/src/plugins/image/image-toolbar.jsx +32 -0
  221. package/configure/node_modules/@pie-lib/editable-html/src/plugins/image/index.jsx +182 -0
  222. package/configure/node_modules/@pie-lib/editable-html/src/plugins/image/insert-image-handler.js +93 -0
  223. package/configure/node_modules/@pie-lib/editable-html/src/plugins/index.jsx +115 -0
  224. package/configure/node_modules/@pie-lib/editable-html/src/plugins/list/index.jsx +175 -0
  225. package/configure/node_modules/@pie-lib/editable-html/src/plugins/math/index.jsx +283 -0
  226. package/configure/node_modules/@pie-lib/editable-html/src/plugins/media/index.jsx +284 -0
  227. package/configure/node_modules/@pie-lib/editable-html/src/plugins/media/media-dialog.js +372 -0
  228. package/configure/node_modules/@pie-lib/editable-html/src/plugins/media/media-toolbar.jsx +53 -0
  229. package/configure/node_modules/@pie-lib/editable-html/src/plugins/media/media-wrapper.jsx +43 -0
  230. package/configure/node_modules/@pie-lib/editable-html/src/plugins/respArea/drag-in-the-blank/choice.jsx +187 -0
  231. package/configure/node_modules/@pie-lib/editable-html/src/plugins/respArea/drag-in-the-blank/index.jsx +78 -0
  232. package/configure/node_modules/@pie-lib/editable-html/src/plugins/respArea/explicit-constructed-response/index.jsx +45 -0
  233. package/configure/node_modules/@pie-lib/editable-html/src/plugins/respArea/icons/index.jsx +68 -0
  234. package/configure/node_modules/@pie-lib/editable-html/src/plugins/respArea/index.jsx +259 -0
  235. package/configure/node_modules/@pie-lib/editable-html/src/plugins/respArea/inline-dropdown/index.jsx +63 -0
  236. package/configure/node_modules/@pie-lib/editable-html/src/plugins/respArea/utils.jsx +77 -0
  237. package/configure/node_modules/@pie-lib/editable-html/src/plugins/table/icons/index.jsx +59 -0
  238. package/configure/node_modules/@pie-lib/editable-html/src/plugins/table/index.jsx +437 -0
  239. package/configure/node_modules/@pie-lib/editable-html/src/plugins/table/table-toolbar.jsx +104 -0
  240. package/configure/node_modules/@pie-lib/editable-html/src/plugins/toolbar/default-toolbar.jsx +111 -0
  241. package/configure/node_modules/@pie-lib/editable-html/src/plugins/toolbar/done-button.jsx +36 -0
  242. package/configure/node_modules/@pie-lib/editable-html/src/plugins/toolbar/editor-and-toolbar.jsx +225 -0
  243. package/configure/node_modules/@pie-lib/editable-html/src/plugins/toolbar/index.jsx +21 -0
  244. package/configure/node_modules/@pie-lib/editable-html/src/plugins/toolbar/toolbar-buttons.jsx +97 -0
  245. package/configure/node_modules/@pie-lib/editable-html/src/plugins/toolbar/toolbar.jsx +323 -0
  246. package/configure/node_modules/@pie-lib/editable-html/src/plugins/utils.js +32 -0
  247. package/configure/node_modules/@pie-lib/editable-html/src/serialization.jsx +385 -0
  248. package/configure/node_modules/@pie-lib/editable-html/src/theme.js +1 -0
  249. package/configure/node_modules/@pie-lib/editable-html/static.json +1 -0
  250. package/configure/node_modules/@pie-lib/math-input/CHANGELOG.json +1547 -0
  251. package/configure/node_modules/@pie-lib/math-input/CHANGELOG.md +765 -0
  252. package/configure/node_modules/@pie-lib/math-input/LICENSE.md +5 -0
  253. package/configure/node_modules/@pie-lib/math-input/README.md +27 -0
  254. package/configure/node_modules/@pie-lib/math-input/lib/horizontal-keypad.js +129 -0
  255. package/configure/node_modules/@pie-lib/math-input/lib/horizontal-keypad.js.map +1 -0
  256. package/configure/node_modules/@pie-lib/math-input/lib/index.js +80 -0
  257. package/configure/node_modules/@pie-lib/math-input/lib/index.js.map +1 -0
  258. package/configure/node_modules/@pie-lib/math-input/lib/keypad/index.js +440 -0
  259. package/configure/node_modules/@pie-lib/math-input/lib/keypad/index.js.map +1 -0
  260. package/configure/node_modules/@pie-lib/math-input/lib/keypad/keys-layout.js +34 -0
  261. package/configure/node_modules/@pie-lib/math-input/lib/keypad/keys-layout.js.map +1 -0
  262. package/configure/node_modules/@pie-lib/math-input/lib/keys/basic-operators.js +41 -0
  263. package/configure/node_modules/@pie-lib/math-input/lib/keys/basic-operators.js.map +1 -0
  264. package/configure/node_modules/@pie-lib/math-input/lib/keys/chars.js +17 -0
  265. package/configure/node_modules/@pie-lib/math-input/lib/keys/chars.js.map +1 -0
  266. package/configure/node_modules/@pie-lib/math-input/lib/keys/comparison.js +46 -0
  267. package/configure/node_modules/@pie-lib/math-input/lib/keys/comparison.js.map +1 -0
  268. package/configure/node_modules/@pie-lib/math-input/lib/keys/constants.js +43 -0
  269. package/configure/node_modules/@pie-lib/math-input/lib/keys/constants.js.map +1 -0
  270. package/configure/node_modules/@pie-lib/math-input/lib/keys/digits.js +53 -0
  271. package/configure/node_modules/@pie-lib/math-input/lib/keys/digits.js.map +1 -0
  272. package/configure/node_modules/@pie-lib/math-input/lib/keys/edit.js +16 -0
  273. package/configure/node_modules/@pie-lib/math-input/lib/keys/edit.js.map +1 -0
  274. package/configure/node_modules/@pie-lib/math-input/lib/keys/exponent.js +35 -0
  275. package/configure/node_modules/@pie-lib/math-input/lib/keys/exponent.js.map +1 -0
  276. package/configure/node_modules/@pie-lib/math-input/lib/keys/fractions.js +31 -0
  277. package/configure/node_modules/@pie-lib/math-input/lib/keys/fractions.js.map +1 -0
  278. package/configure/node_modules/@pie-lib/math-input/lib/keys/geometry.js +165 -0
  279. package/configure/node_modules/@pie-lib/math-input/lib/keys/geometry.js.map +1 -0
  280. package/configure/node_modules/@pie-lib/math-input/lib/keys/grades.js +295 -0
  281. package/configure/node_modules/@pie-lib/math-input/lib/keys/grades.js.map +1 -0
  282. package/configure/node_modules/@pie-lib/math-input/lib/keys/index.js +54 -0
  283. package/configure/node_modules/@pie-lib/math-input/lib/keys/index.js.map +1 -0
  284. package/configure/node_modules/@pie-lib/math-input/lib/keys/log.js +32 -0
  285. package/configure/node_modules/@pie-lib/math-input/lib/keys/log.js.map +1 -0
  286. package/configure/node_modules/@pie-lib/math-input/lib/keys/logic.js +23 -0
  287. package/configure/node_modules/@pie-lib/math-input/lib/keys/logic.js.map +1 -0
  288. package/configure/node_modules/@pie-lib/math-input/lib/keys/matrices.js +23 -0
  289. package/configure/node_modules/@pie-lib/math-input/lib/keys/matrices.js.map +1 -0
  290. package/configure/node_modules/@pie-lib/math-input/lib/keys/misc.js +69 -0
  291. package/configure/node_modules/@pie-lib/math-input/lib/keys/misc.js.map +1 -0
  292. package/configure/node_modules/@pie-lib/math-input/lib/keys/navigation.js +23 -0
  293. package/configure/node_modules/@pie-lib/math-input/lib/keys/navigation.js.map +1 -0
  294. package/configure/node_modules/@pie-lib/math-input/lib/keys/operators.js +17 -0
  295. package/configure/node_modules/@pie-lib/math-input/lib/keys/operators.js.map +1 -0
  296. package/configure/node_modules/@pie-lib/math-input/lib/keys/statistics.js +45 -0
  297. package/configure/node_modules/@pie-lib/math-input/lib/keys/statistics.js.map +1 -0
  298. package/configure/node_modules/@pie-lib/math-input/lib/keys/sub-sup.js +23 -0
  299. package/configure/node_modules/@pie-lib/math-input/lib/keys/sub-sup.js.map +1 -0
  300. package/configure/node_modules/@pie-lib/math-input/lib/keys/trigonometry.js +53 -0
  301. package/configure/node_modules/@pie-lib/math-input/lib/keys/trigonometry.js.map +1 -0
  302. package/configure/node_modules/@pie-lib/math-input/lib/keys/utils.js +130 -0
  303. package/configure/node_modules/@pie-lib/math-input/lib/keys/utils.js.map +1 -0
  304. package/configure/node_modules/@pie-lib/math-input/lib/keys/vars.js +29 -0
  305. package/configure/node_modules/@pie-lib/math-input/lib/keys/vars.js.map +1 -0
  306. package/configure/node_modules/@pie-lib/math-input/lib/math-input.js +206 -0
  307. package/configure/node_modules/@pie-lib/math-input/lib/math-input.js.map +1 -0
  308. package/configure/node_modules/@pie-lib/math-input/lib/mq/custom-elements.js +23 -0
  309. package/configure/node_modules/@pie-lib/math-input/lib/mq/custom-elements.js.map +1 -0
  310. package/configure/node_modules/@pie-lib/math-input/lib/mq/index.js +24 -0
  311. package/configure/node_modules/@pie-lib/math-input/lib/mq/index.js.map +1 -0
  312. package/configure/node_modules/@pie-lib/math-input/lib/mq/input.js +257 -0
  313. package/configure/node_modules/@pie-lib/math-input/lib/mq/input.js.map +1 -0
  314. package/configure/node_modules/@pie-lib/math-input/lib/mq/static.js +224 -0
  315. package/configure/node_modules/@pie-lib/math-input/lib/mq/static.js.map +1 -0
  316. package/configure/node_modules/@pie-lib/math-input/package.json +26 -0
  317. package/configure/node_modules/@pie-lib/math-input/src/horizontal-keypad.jsx +56 -0
  318. package/configure/node_modules/@pie-lib/math-input/src/index.jsx +27 -0
  319. package/configure/node_modules/@pie-lib/math-input/src/keypad/index.jsx +367 -0
  320. package/configure/node_modules/@pie-lib/math-input/src/keypad/keys-layout.js +17 -0
  321. package/configure/node_modules/@pie-lib/math-input/src/keys/basic-operators.js +32 -0
  322. package/configure/node_modules/@pie-lib/math-input/src/keys/chars.js +5 -0
  323. package/configure/node_modules/@pie-lib/math-input/src/keys/comparison.js +27 -0
  324. package/configure/node_modules/@pie-lib/math-input/src/keys/constants.js +35 -0
  325. package/configure/node_modules/@pie-lib/math-input/src/keys/digits.js +40 -0
  326. package/configure/node_modules/@pie-lib/math-input/src/keys/edit.js +3 -0
  327. package/configure/node_modules/@pie-lib/math-input/src/keys/exponent.js +27 -0
  328. package/configure/node_modules/@pie-lib/math-input/src/keys/fractions.js +23 -0
  329. package/configure/node_modules/@pie-lib/math-input/src/keys/geometry.js +140 -0
  330. package/configure/node_modules/@pie-lib/math-input/src/keys/grades.js +379 -0
  331. package/configure/node_modules/@pie-lib/math-input/src/keys/index.js +21 -0
  332. package/configure/node_modules/@pie-lib/math-input/src/keys/log.js +22 -0
  333. package/configure/node_modules/@pie-lib/math-input/src/keys/logic.js +15 -0
  334. package/configure/node_modules/@pie-lib/math-input/src/keys/matrices.js +15 -0
  335. package/configure/node_modules/@pie-lib/math-input/src/keys/misc.js +60 -0
  336. package/configure/node_modules/@pie-lib/math-input/src/keys/navigation.js +8 -0
  337. package/configure/node_modules/@pie-lib/math-input/src/keys/operators.js +9 -0
  338. package/configure/node_modules/@pie-lib/math-input/src/keys/statistics.js +36 -0
  339. package/configure/node_modules/@pie-lib/math-input/src/keys/sub-sup.js +15 -0
  340. package/configure/node_modules/@pie-lib/math-input/src/keys/trigonometry.js +15 -0
  341. package/configure/node_modules/@pie-lib/math-input/src/keys/utils.js +71 -0
  342. package/configure/node_modules/@pie-lib/math-input/src/keys/vars.js +19 -0
  343. package/configure/node_modules/@pie-lib/math-input/src/math-input.jsx +128 -0
  344. package/configure/node_modules/@pie-lib/math-input/src/mq/custom-elements.js +11 -0
  345. package/configure/node_modules/@pie-lib/math-input/src/mq/index.js +4 -0
  346. package/configure/node_modules/@pie-lib/math-input/src/mq/input.jsx +163 -0
  347. package/configure/node_modules/@pie-lib/math-input/src/mq/static.jsx +145 -0
  348. package/configure/node_modules/@pie-lib/math-rendering/CHANGELOG.json +672 -0
  349. package/configure/node_modules/@pie-lib/math-rendering/CHANGELOG.md +457 -0
  350. package/configure/node_modules/@pie-lib/math-rendering/LICENSE.md +5 -0
  351. package/configure/node_modules/@pie-lib/math-rendering/lib/index.js +30 -0
  352. package/configure/node_modules/@pie-lib/math-rendering/lib/index.js.map +1 -0
  353. package/configure/node_modules/@pie-lib/math-rendering/lib/mstack/chtml.js +316 -0
  354. package/configure/node_modules/@pie-lib/math-rendering/lib/mstack/chtml.js.map +1 -0
  355. package/configure/node_modules/@pie-lib/math-rendering/lib/mstack/index.js +23 -0
  356. package/configure/node_modules/@pie-lib/math-rendering/lib/mstack/index.js.map +1 -0
  357. package/configure/node_modules/@pie-lib/math-rendering/lib/mstack/mml.js +123 -0
  358. package/configure/node_modules/@pie-lib/math-rendering/lib/mstack/mml.js.map +1 -0
  359. package/configure/node_modules/@pie-lib/math-rendering/lib/normalization.js +103 -0
  360. package/configure/node_modules/@pie-lib/math-rendering/lib/normalization.js.map +1 -0
  361. package/configure/node_modules/@pie-lib/math-rendering/lib/render-math.js +281 -0
  362. package/configure/node_modules/@pie-lib/math-rendering/lib/render-math.js.map +1 -0
  363. package/configure/node_modules/@pie-lib/math-rendering/package.json +19 -0
  364. package/configure/node_modules/@pie-lib/math-rendering/playground/demo.html +872 -0
  365. package/configure/node_modules/@pie-lib/math-rendering/playground/demo.js +108 -0
  366. package/configure/node_modules/@pie-lib/math-rendering/playground/main.html +156 -0
  367. package/configure/node_modules/@pie-lib/math-rendering/playground/main.js +16 -0
  368. package/configure/node_modules/@pie-lib/math-rendering/playground/webpack.config.js +29 -0
  369. package/configure/node_modules/@pie-lib/math-rendering/src/index.js +4 -0
  370. package/configure/node_modules/@pie-lib/math-rendering/src/mstack/chtml.js +215 -0
  371. package/configure/node_modules/@pie-lib/math-rendering/src/mstack/index.js +13 -0
  372. package/configure/node_modules/@pie-lib/math-rendering/src/mstack/mml.js +24 -0
  373. package/configure/node_modules/@pie-lib/math-rendering/src/normalization.js +69 -0
  374. package/configure/node_modules/@pie-lib/math-rendering/src/render-math.js +235 -0
  375. package/configure/node_modules/@pie-lib/math-toolbar/CHANGELOG.json +862 -0
  376. package/configure/node_modules/@pie-lib/math-toolbar/CHANGELOG.md +639 -0
  377. package/configure/node_modules/@pie-lib/math-toolbar/LICENSE.md +5 -0
  378. package/configure/node_modules/@pie-lib/math-toolbar/lib/done-button.js +53 -0
  379. package/configure/node_modules/@pie-lib/math-toolbar/lib/done-button.js.map +1 -0
  380. package/configure/node_modules/@pie-lib/math-toolbar/lib/editor-and-pad.js +483 -0
  381. package/configure/node_modules/@pie-lib/math-toolbar/lib/editor-and-pad.js.map +1 -0
  382. package/configure/node_modules/@pie-lib/math-toolbar/lib/index.js +280 -0
  383. package/configure/node_modules/@pie-lib/math-toolbar/lib/index.js.map +1 -0
  384. package/configure/node_modules/@pie-lib/math-toolbar/lib/math-preview.js +173 -0
  385. package/configure/node_modules/@pie-lib/math-toolbar/lib/math-preview.js.map +1 -0
  386. package/configure/node_modules/@pie-lib/math-toolbar/package.json +37 -0
  387. package/configure/node_modules/@pie-lib/math-toolbar/src/done-button.jsx +39 -0
  388. package/configure/node_modules/@pie-lib/math-toolbar/src/editor-and-pad.jsx +388 -0
  389. package/configure/node_modules/@pie-lib/math-toolbar/src/index.jsx +202 -0
  390. package/configure/node_modules/@pie-lib/math-toolbar/src/math-preview.jsx +107 -0
  391. package/configure/node_modules/@pie-lib/render-ui/CHANGELOG.json +937 -0
  392. package/configure/node_modules/@pie-lib/render-ui/CHANGELOG.md +626 -0
  393. package/configure/node_modules/@pie-lib/render-ui/LICENSE.md +5 -0
  394. package/configure/node_modules/@pie-lib/render-ui/README.md +33 -0
  395. package/configure/node_modules/@pie-lib/render-ui/lib/collapsible/index.js +146 -0
  396. package/configure/node_modules/@pie-lib/render-ui/lib/collapsible/index.js.map +1 -0
  397. package/configure/node_modules/@pie-lib/render-ui/lib/color.js +134 -0
  398. package/configure/node_modules/@pie-lib/render-ui/lib/color.js.map +1 -0
  399. package/configure/node_modules/@pie-lib/render-ui/lib/feedback.js +160 -0
  400. package/configure/node_modules/@pie-lib/render-ui/lib/feedback.js.map +1 -0
  401. package/configure/node_modules/@pie-lib/render-ui/lib/has-text.js +24 -0
  402. package/configure/node_modules/@pie-lib/render-ui/lib/has-text.js.map +1 -0
  403. package/configure/node_modules/@pie-lib/render-ui/lib/html-and-math.js +102 -0
  404. package/configure/node_modules/@pie-lib/render-ui/lib/html-and-math.js.map +1 -0
  405. package/configure/node_modules/@pie-lib/render-ui/lib/index.js +104 -0
  406. package/configure/node_modules/@pie-lib/render-ui/lib/index.js.map +1 -0
  407. package/configure/node_modules/@pie-lib/render-ui/lib/input-container.js +60 -0
  408. package/configure/node_modules/@pie-lib/render-ui/lib/input-container.js.map +1 -0
  409. package/configure/node_modules/@pie-lib/render-ui/lib/preview-layout.js +133 -0
  410. package/configure/node_modules/@pie-lib/render-ui/lib/preview-layout.js.map +1 -0
  411. package/configure/node_modules/@pie-lib/render-ui/lib/preview-prompt.js +162 -0
  412. package/configure/node_modules/@pie-lib/render-ui/lib/preview-prompt.js.map +1 -0
  413. package/configure/node_modules/@pie-lib/render-ui/lib/purpose.js +28 -0
  414. package/configure/node_modules/@pie-lib/render-ui/lib/purpose.js.map +1 -0
  415. package/configure/node_modules/@pie-lib/render-ui/lib/readable.js +28 -0
  416. package/configure/node_modules/@pie-lib/render-ui/lib/readable.js.map +1 -0
  417. package/configure/node_modules/@pie-lib/render-ui/lib/response-indicators.js +160 -0
  418. package/configure/node_modules/@pie-lib/render-ui/lib/response-indicators.js.map +1 -0
  419. package/configure/node_modules/@pie-lib/render-ui/lib/withUndoReset.js +206 -0
  420. package/configure/node_modules/@pie-lib/render-ui/lib/withUndoReset.js.map +1 -0
  421. package/configure/node_modules/@pie-lib/render-ui/package.json +30 -0
  422. package/configure/node_modules/@pie-lib/render-ui/src/collapsible/index.jsx +68 -0
  423. package/configure/node_modules/@pie-lib/render-ui/src/color.js +48 -0
  424. package/configure/node_modules/@pie-lib/render-ui/src/feedback.jsx +100 -0
  425. package/configure/node_modules/@pie-lib/render-ui/src/has-text.js +14 -0
  426. package/configure/node_modules/@pie-lib/render-ui/src/html-and-math.js +40 -0
  427. package/configure/node_modules/@pie-lib/render-ui/src/index.js +27 -0
  428. package/configure/node_modules/@pie-lib/render-ui/src/input-container.jsx +41 -0
  429. package/configure/node_modules/@pie-lib/render-ui/src/preview-layout.jsx +77 -0
  430. package/configure/node_modules/@pie-lib/render-ui/src/preview-prompt.jsx +90 -0
  431. package/configure/node_modules/@pie-lib/render-ui/src/purpose.jsx +19 -0
  432. package/configure/node_modules/@pie-lib/render-ui/src/readable.jsx +19 -0
  433. package/configure/node_modules/@pie-lib/render-ui/src/response-indicators.jsx +89 -0
  434. package/configure/node_modules/@pie-lib/render-ui/src/withUndoReset.jsx +118 -0
  435. package/configure/package.json +1 -1
  436. package/lib/index.js +2 -2
  437. package/lib/index.js.map +1 -1
  438. package/lib/print.js +2 -2
  439. package/lib/print.js.map +1 -1
  440. package/package.json +2 -2
  441. package/src/index.js +2 -2
  442. package/src/print.js +2 -2
@@ -0,0 +1,204 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.serialization = exports["default"] = void 0;
9
+
10
+ var _react = _interopRequireDefault(require("react"));
11
+
12
+ var _slate = require("slate");
13
+
14
+ var _immutable = _interopRequireDefault(require("immutable"));
15
+
16
+ var _propTypes = _interopRequireDefault(require("prop-types"));
17
+
18
+ var _slateEditList = _interopRequireDefault(require("slate-edit-list"));
19
+
20
+ var _debug = _interopRequireDefault(require("debug"));
21
+
22
+ var log = (0, _debug["default"])('@pie-lib:editable-html:plugins:list');
23
+
24
+ var b = function b(type, next, childNodes) {
25
+ return {
26
+ object: 'block',
27
+ type: type,
28
+ nodes: next(childNodes)
29
+ };
30
+ };
31
+
32
+ var serialization = {
33
+ deserialize: function deserialize(el, next) {
34
+ var name = el.tagName.toLowerCase();
35
+
36
+ if (name === 'li') {
37
+ return b('list_item', next, el.childNodes);
38
+ }
39
+
40
+ if (name === 'ul') {
41
+ return b('ul_list', next, el.children.length ? Array.from(el.children) : el.childNodes);
42
+ }
43
+
44
+ if (name === 'ol') {
45
+ return b('ol_list', next, el.children.length ? Array.from(el.children) : el.childNodes);
46
+ }
47
+ },
48
+ serialize: function serialize(object, children) {
49
+ if (object.object !== 'block') return;
50
+
51
+ if (object.type === 'list_item') {
52
+ return /*#__PURE__*/_react["default"].createElement("li", null, children);
53
+ }
54
+
55
+ if (object.type === 'ul_list') {
56
+ return /*#__PURE__*/_react["default"].createElement("ul", null, children);
57
+ }
58
+
59
+ if (object.type === 'ol_list') {
60
+ return /*#__PURE__*/_react["default"].createElement("ol", null, children);
61
+ }
62
+ }
63
+ };
64
+ exports.serialization = serialization;
65
+
66
+ var createEditList = function createEditList() {
67
+ var core = (0, _slateEditList["default"])({
68
+ typeDefault: 'span'
69
+ }); // fix outdated schema
70
+
71
+ if (core.schema && core.schema.blocks) {
72
+ Object.keys(core.schema.blocks).forEach(function (key) {
73
+ var block = core.schema.blocks[key];
74
+
75
+ if (block.parent) {
76
+ return;
77
+ }
78
+
79
+ block.nodes[0] = {
80
+ type: block.nodes[0].types[0]
81
+ };
82
+ });
83
+ }
84
+ /**
85
+ * This override of the core.changes.wrapInList is needed because the version
86
+ * of immutable that we have does not support getting the element at a specific
87
+ * index with a square bracket (list[0]). We have to use the list.get function instead
88
+ */
89
+
90
+ /**
91
+ * Returns the highest list of blocks that cover the current selection
92
+ */
93
+
94
+
95
+ var getHighestSelectedBlocks = function getHighestSelectedBlocks(value) {
96
+ var range = value.selection;
97
+ var document = value.document;
98
+ var startBlock = document.getClosestBlock(range.startKey);
99
+ var endBlock = document.getClosestBlock(range.endKey);
100
+
101
+ if (startBlock === endBlock) {
102
+ return _immutable["default"].List([startBlock]);
103
+ }
104
+
105
+ var ancestor = document.getCommonAncestor(startBlock.key, endBlock.key);
106
+ var startPath = ancestor.getPath(startBlock.key);
107
+ var endPath = ancestor.getPath(endBlock.key);
108
+ return ancestor.nodes.slice(startPath.get(0), endPath.get(0) + 1);
109
+ };
110
+ /**
111
+ * Wrap the blocks in the current selection in a new list. Selected
112
+ * lists are merged together.
113
+ */
114
+
115
+
116
+ core.changes.wrapInList = function (change, type, data) {
117
+ var selectedBlocks = getHighestSelectedBlocks(change.value); // Wrap in container
118
+
119
+ change.wrapBlock({
120
+ type: type,
121
+ data: _slate.Data.create(data)
122
+ }, {
123
+ normalize: false
124
+ }); // Wrap in list items
125
+
126
+ selectedBlocks.forEach(function (node) {
127
+ if (core.utils.isList(node)) {
128
+ // Merge its items with the created list
129
+ node.nodes.forEach(function (_ref) {
130
+ var key = _ref.key;
131
+ return change.unwrapNodeByKey(key, {
132
+ normalize: false
133
+ });
134
+ });
135
+ } else if (node.type !== 'list_item') {
136
+ change.wrapBlockByKey(node.key, 'list_item', {
137
+ normalize: false
138
+ });
139
+ }
140
+ });
141
+ return change.normalize();
142
+ };
143
+
144
+ return core;
145
+ };
146
+
147
+ var _default = function _default(options) {
148
+ var type = options.type,
149
+ icon = options.icon;
150
+ var core = createEditList(); // eslint-disable-next-line react/display-name
151
+
152
+ core.renderNode = function (props) {
153
+ var node = props.node,
154
+ attributes = props.attributes,
155
+ children = props.children;
156
+
157
+ switch (node.type) {
158
+ case 'ul_list':
159
+ return /*#__PURE__*/_react["default"].createElement("ul", attributes, children);
160
+
161
+ case 'ol_list':
162
+ return /*#__PURE__*/_react["default"].createElement("ol", attributes, children);
163
+
164
+ case 'list_item':
165
+ return /*#__PURE__*/_react["default"].createElement("li", attributes, children);
166
+ }
167
+ };
168
+
169
+ core.toolbar = {
170
+ isMark: false,
171
+ type: type,
172
+ icon: icon,
173
+ isActive: function isActive(value, type) {
174
+ if (!core.utils.isSelectionInList(value)) {
175
+ return false;
176
+ }
177
+
178
+ var current = core.utils.getCurrentList(value);
179
+ return current ? current.type === type : false;
180
+ },
181
+ onClick: function onClick(value, onChange) {
182
+ log('[onClick]', value);
183
+ var inList = core.utils.isSelectionInList(value);
184
+
185
+ if (inList) {
186
+ var change = value.change().call(core.changes.unwrapList);
187
+ onChange(change);
188
+ } else {
189
+ var _change = value.change().call(core.changes.wrapInList, type);
190
+
191
+ onChange(_change);
192
+ }
193
+ }
194
+ };
195
+ core.renderNode.propTypes = {
196
+ node: _propTypes["default"].object,
197
+ attributes: _propTypes["default"].object,
198
+ children: _propTypes["default"].func
199
+ };
200
+ return core;
201
+ };
202
+
203
+ exports["default"] = _default;
204
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/plugins/list/index.jsx"],"names":["log","b","type","next","childNodes","object","nodes","serialization","deserialize","el","name","tagName","toLowerCase","children","length","Array","from","serialize","createEditList","core","typeDefault","schema","blocks","Object","keys","forEach","key","block","parent","types","getHighestSelectedBlocks","value","range","selection","document","startBlock","getClosestBlock","startKey","endBlock","endKey","Immutable","List","ancestor","getCommonAncestor","startPath","getPath","endPath","slice","get","changes","wrapInList","change","data","selectedBlocks","wrapBlock","Data","create","normalize","node","utils","isList","_ref","unwrapNodeByKey","wrapBlockByKey","options","icon","renderNode","props","attributes","toolbar","isMark","isActive","isSelectionInList","current","getCurrentList","onClick","onChange","inList","call","unwrapList","propTypes","PropTypes","func"],"mappings":";;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAEA,IAAMA,GAAG,GAAG,uBAAM,qCAAN,CAAZ;;AAEA,IAAMC,CAAC,GAAG,SAAJA,CAAI,CAACC,IAAD,EAAOC,IAAP,EAAaC,UAAb;AAAA,SAA6B;AACrCC,IAAAA,MAAM,EAAE,OAD6B;AAErCH,IAAAA,IAAI,EAAJA,IAFqC;AAGrCI,IAAAA,KAAK,EAAEH,IAAI,CAACC,UAAD;AAH0B,GAA7B;AAAA,CAAV;;AAMO,IAAMG,aAAa,GAAG;AAC3BC,EAAAA,WAD2B,uBACfC,EADe,EACXN,IADW,EACL;AACpB,QAAMO,IAAI,GAAGD,EAAE,CAACE,OAAH,CAAWC,WAAX,EAAb;;AAEA,QAAIF,IAAI,KAAK,IAAb,EAAmB;AACjB,aAAOT,CAAC,CAAC,WAAD,EAAcE,IAAd,EAAoBM,EAAE,CAACL,UAAvB,CAAR;AACD;;AAED,QAAIM,IAAI,KAAK,IAAb,EAAmB;AACjB,aAAOT,CAAC,CAAC,SAAD,EAAYE,IAAZ,EAAkBM,EAAE,CAACI,QAAH,CAAYC,MAAZ,GAAqBC,KAAK,CAACC,IAAN,CAAWP,EAAE,CAACI,QAAd,CAArB,GAA+CJ,EAAE,CAACL,UAApE,CAAR;AACD;;AAED,QAAIM,IAAI,KAAK,IAAb,EAAmB;AACjB,aAAOT,CAAC,CAAC,SAAD,EAAYE,IAAZ,EAAkBM,EAAE,CAACI,QAAH,CAAYC,MAAZ,GAAqBC,KAAK,CAACC,IAAN,CA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SAAhB,GAA4B;AAC1BtB,IAAAA,IAAI,EAAEuB,sBAAU5E,MADU;AAE1B+D,IAAAA,UAAU,EAAEa,sBAAU5E,MAFI;AAG1BQ,IAAAA,QAAQ,EAAEoE,sBAAUC;AAHM,GAA5B;AAMA,SAAO/D,IAAP;AACD,C","sourcesContent":["import React from 'react';\nimport { Data } from 'slate';\nimport Immutable from 'immutable';\nimport PropTypes from 'prop-types';\nimport EditList from 'slate-edit-list';\nimport debug from 'debug';\n\nconst log = debug('@pie-lib:editable-html:plugins:list');\n\nconst b = (type, next, childNodes) => ({\n object: 'block',\n type,\n nodes: next(childNodes)\n});\n\nexport const serialization = {\n deserialize(el, next) {\n const name = el.tagName.toLowerCase();\n\n if (name === 'li') {\n return b('list_item', next, el.childNodes);\n }\n\n if (name === 'ul') {\n return b('ul_list', next, el.children.length ? Array.from(el.children) : el.childNodes);\n }\n\n if (name === 'ol') {\n return b('ol_list', next, el.children.length ? Array.from(el.children) : el.childNodes);\n }\n },\n serialize(object, children) {\n if (object.object !== 'block') return;\n\n if (object.type === 'list_item') {\n return <li>{children}</li>;\n }\n\n if (object.type === 'ul_list') {\n return <ul>{children}</ul>;\n }\n\n if (object.type === 'ol_list') {\n return <ol>{children}</ol>;\n }\n }\n};\n\nconst createEditList = () => {\n const core = EditList({\n typeDefault: 'span'\n });\n\n // fix outdated schema\n if (core.schema && core.schema.blocks) {\n Object.keys(core.schema.blocks).forEach(key => {\n const block = core.schema.blocks[key];\n\n if (block.parent) {\n return;\n }\n\n block.nodes[0] = { type: block.nodes[0].types[0] };\n });\n }\n\n /**\n * This override of the core.changes.wrapInList is needed because the version\n * of immutable that we have does not support getting the element at a specific\n * index with a square bracket (list[0]). We have to use the list.get function instead\n */\n\n /**\n * Returns the highest list of blocks that cover the current selection\n */\n const getHighestSelectedBlocks = value => {\n const range = value.selection;\n const document = value.document;\n\n const startBlock = document.getClosestBlock(range.startKey);\n const endBlock = document.getClosestBlock(range.endKey);\n\n if (startBlock === endBlock) {\n return Immutable.List([startBlock]);\n }\n\n const ancestor = document.getCommonAncestor(startBlock.key, endBlock.key);\n const startPath = ancestor.getPath(startBlock.key);\n const endPath = ancestor.getPath(endBlock.key);\n\n return ancestor.nodes.slice(startPath.get(0), endPath.get(0) + 1);\n };\n\n /**\n * Wrap the blocks in the current selection in a new list. Selected\n * lists are merged together.\n */\n core.changes.wrapInList = function(change, type, data) {\n const selectedBlocks = getHighestSelectedBlocks(change.value);\n\n // Wrap in container\n change.wrapBlock({ type: type, data: Data.create(data) }, { normalize: false });\n\n // Wrap in list items\n selectedBlocks.forEach(function(node) {\n if (core.utils.isList(node)) {\n // Merge its items with the created list\n node.nodes.forEach(function(_ref) {\n const key = _ref.key;\n return change.unwrapNodeByKey(key, { normalize: false });\n });\n } else if (node.type !== 'list_item') {\n change.wrapBlockByKey(node.key, 'list_item', {\n normalize: false\n });\n }\n });\n\n return change.normalize();\n };\n\n return core;\n};\n\nexport default options => {\n const { type, icon } = options;\n\n const core = createEditList();\n\n // eslint-disable-next-line react/display-name\n core.renderNode = props => {\n const { node, attributes, children } = props;\n\n switch (node.type) {\n case 'ul_list':\n return <ul {...attributes}>{children}</ul>;\n case 'ol_list':\n return <ol {...attributes}>{children}</ol>;\n case 'list_item':\n return <li {...attributes}>{children}</li>;\n }\n };\n\n core.toolbar = {\n isMark: false,\n type,\n icon,\n isActive: (value, type) => {\n if (!core.utils.isSelectionInList(value)) {\n return false;\n }\n const current = core.utils.getCurrentList(value);\n return current ? current.type === type : false;\n },\n onClick: (value, onChange) => {\n log('[onClick]', value);\n const inList = core.utils.isSelectionInList(value);\n if (inList) {\n const change = value.change().call(core.changes.unwrapList);\n onChange(change);\n } else {\n const change = value.change().call(core.changes.wrapInList, type);\n onChange(change);\n }\n }\n };\n\n core.renderNode.propTypes = {\n node: PropTypes.object,\n attributes: PropTypes.object,\n children: PropTypes.func\n };\n\n return core;\n};\n"],"file":"index.js"}
@@ -0,0 +1,347 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.CustomToolbarComp = void 0;
9
+ exports["default"] = MathPlugin;
10
+ exports.serialization = exports.inlineMath = void 0;
11
+
12
+ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
13
+
14
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
15
+
16
+ var _Functions = _interopRequireDefault(require("@material-ui/icons/Functions"));
17
+
18
+ var _slate = require("slate");
19
+
20
+ var _mathToolbar = require("@pie-lib/math-toolbar");
21
+
22
+ var _mathRendering = require("@pie-lib/math-rendering");
23
+
24
+ var _react = _interopRequireDefault(require("react"));
25
+
26
+ var _debug = _interopRequireDefault(require("debug"));
27
+
28
+ var _slatePropTypes = _interopRequireDefault(require("slate-prop-types"));
29
+
30
+ var _propTypes = _interopRequireDefault(require("prop-types"));
31
+
32
+ var _serialization = require("../../serialization");
33
+
34
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
35
+
36
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
37
+
38
+ var log = (0, _debug["default"])('@pie-lib:editable-html:plugins:math');
39
+ var TEXT_NODE = 3;
40
+
41
+ function generateAdditionalKeys() {
42
+ var keyData = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
43
+ return keyData.map(function (key) {
44
+ return {
45
+ name: key,
46
+ latex: key,
47
+ write: key,
48
+ label: key
49
+ };
50
+ });
51
+ }
52
+
53
+ var CustomToolbarComp = /*#__PURE__*/_react["default"].memo(function (props) {
54
+ var node = props.node,
55
+ value = props.value,
56
+ onFocus = props.onFocus,
57
+ onBlur = props.onBlur,
58
+ onClick = props.onClick;
59
+
60
+ var _ref = props || {},
61
+ pluginProps = _ref.pluginProps;
62
+
63
+ var _ref2 = pluginProps || {},
64
+ math = _ref2.math;
65
+
66
+ var _ref3 = math || {},
67
+ keypadMode = _ref3.keypadMode,
68
+ customKeys = _ref3.customKeys,
69
+ _ref3$controlledKeypa = _ref3.controlledKeypadMode,
70
+ controlledKeypadMode = _ref3$controlledKeypa === void 0 ? true : _ref3$controlledKeypa;
71
+
72
+ var onDone = function onDone(latex) {
73
+ var update = _objectSpread(_objectSpread({}, node.data.toObject()), {}, {
74
+ latex: latex
75
+ });
76
+
77
+ var change = value.change().setNodeByKey(node.key, {
78
+ data: update
79
+ });
80
+ var nextText = value.document.getNextText(node.key);
81
+ change.moveFocusTo(nextText.key, 0).moveAnchorTo(nextText.key, 0);
82
+ props.onToolbarDone(change, false);
83
+ };
84
+
85
+ var onChange = function onChange(latex) {
86
+ var update = _objectSpread(_objectSpread({}, node.data.toObject()), {}, {
87
+ latex: latex
88
+ });
89
+
90
+ var change = value.change().setNodeByKey(node.key, {
91
+ data: update
92
+ });
93
+ log('call onToolbarChange:', change);
94
+ props.onDataChange(node.key, update);
95
+ };
96
+
97
+ var latex = node.data.get('latex');
98
+ return /*#__PURE__*/_react["default"].createElement(_mathToolbar.MathToolbar, {
99
+ autoFocus: true,
100
+ additionalKeys: generateAdditionalKeys(customKeys),
101
+ latex: latex,
102
+ onChange: onChange,
103
+ onDone: onDone,
104
+ onBlur: onBlur,
105
+ onFocus: onFocus,
106
+ onClick: onClick,
107
+ keypadMode: keypadMode,
108
+ controlledKeypadMode: controlledKeypadMode
109
+ });
110
+ }, function (prev, next) {
111
+ var node = prev.node,
112
+ _prev$pluginProps = prev.pluginProps;
113
+ _prev$pluginProps = _prev$pluginProps === void 0 ? {} : _prev$pluginProps;
114
+ var _prev$pluginProps$mat = _prev$pluginProps.math;
115
+ _prev$pluginProps$mat = _prev$pluginProps$mat === void 0 ? {} : _prev$pluginProps$mat;
116
+ var keypadMode = _prev$pluginProps$mat.keypadMode,
117
+ controlledKeypadMode = _prev$pluginProps$mat.controlledKeypadMode;
118
+ var nodeNext = next.node,
119
+ _next$pluginProps = next.pluginProps;
120
+ _next$pluginProps = _next$pluginProps === void 0 ? {} : _next$pluginProps;
121
+ var _next$pluginProps$mat = _next$pluginProps.math;
122
+ _next$pluginProps$mat = _next$pluginProps$mat === void 0 ? {} : _next$pluginProps$mat;
123
+ var keypadModeNext = _next$pluginProps$mat.keypadMode,
124
+ controlledKeypadModeNext = _next$pluginProps$mat.controlledKeypadMode;
125
+ var keypadModeChanged = keypadMode !== keypadModeNext;
126
+ var controlledKeypadModeChanged = controlledKeypadMode !== controlledKeypadModeNext;
127
+ var equal = node.equals(nodeNext);
128
+ return equal && !keypadModeChanged && !controlledKeypadModeChanged;
129
+ });
130
+
131
+ exports.CustomToolbarComp = CustomToolbarComp;
132
+ CustomToolbarComp.propTypes = {
133
+ node: _slatePropTypes["default"].node.isRequired,
134
+ value: _slatePropTypes["default"].value,
135
+ onToolbarDone: _propTypes["default"].func,
136
+ onDataChange: _propTypes["default"].func,
137
+ onFocus: _propTypes["default"].func,
138
+ onClick: _propTypes["default"].func,
139
+ onBlur: _propTypes["default"].func
140
+ };
141
+
142
+ function MathPlugin() {
143
+ return {
144
+ name: 'math',
145
+ toolbar: {
146
+ icon: /*#__PURE__*/_react["default"].createElement(_Functions["default"], null),
147
+ onClick: function onClick(value, onChange) {
148
+ log('[insertMath]');
149
+ var math = inlineMath();
150
+ var change = value.change().insertInline(math);
151
+ onChange(change);
152
+ },
153
+ supports: function supports(node) {
154
+ return node && node.object === 'inline' && node.type === 'math';
155
+ },
156
+
157
+ /**
158
+ * Return a react component function
159
+ * @param node {Slate.Node}
160
+ * @param value {Slate.Value}
161
+ * @param onDone {(change?: Slate.Change, finishEditing :boolea) => void} - a function to call once the toolbar
162
+ * has made any changes, call with the node.key and a data object.
163
+ */
164
+ CustomToolbarComp: CustomToolbarComp
165
+ },
166
+ schema: {
167
+ document: {
168
+ match: [{
169
+ type: 'math'
170
+ }]
171
+ }
172
+ },
173
+ pluginStyles: function pluginStyles(node, parentNode, p) {
174
+ if (p) {
175
+ return {
176
+ position: 'absolute',
177
+ top: 'initial'
178
+ };
179
+ }
180
+ },
181
+ renderNode: function renderNode(props) {
182
+ if (props.node.type === 'math') {
183
+ log('[renderNode]: data:', props.node.data);
184
+ return /*#__PURE__*/_react["default"].createElement(_mathToolbar.MathPreview, props);
185
+ }
186
+ /**
187
+ * Here for rendering mathml content
188
+ */
189
+
190
+
191
+ if (props.node.type === 'mathml') {
192
+ var html = props.node.data.get('html');
193
+ return /*#__PURE__*/_react["default"].createElement("span", (0, _extends2["default"])({}, props.attributes, {
194
+ dangerouslySetInnerHTML: {
195
+ __html: html
196
+ }
197
+ }));
198
+ }
199
+ }
200
+ };
201
+ }
202
+
203
+ MathPlugin.ROUND_BRACKETS = 'round_brackets';
204
+ MathPlugin.SQUARE_BRACKETS = 'square_brackets';
205
+ MathPlugin.DOLLAR = 'dollar';
206
+ MathPlugin.DOUBLE_DOLLAR = 'double_dollar';
207
+
208
+ var inlineMath = function inlineMath() {
209
+ return _slate.Inline.create({
210
+ object: 'inline',
211
+ type: 'math',
212
+ isVoid: true,
213
+ data: {
214
+ latex: ''
215
+ }
216
+ });
217
+ };
218
+
219
+ exports.inlineMath = inlineMath;
220
+
221
+ var htmlDecode = function htmlDecode(input) {
222
+ var doc = new DOMParser().parseFromString(input, 'text/html');
223
+ return doc.documentElement.textContent;
224
+ };
225
+
226
+ var getTagName = function getTagName(el) {
227
+ return (el && el.tagName || '').toLowerCase();
228
+ };
229
+ /**
230
+ * Makes sure that strings that contain stuff like:
231
+ * x<y are not transformed into x by the DOMParser because it thinks
232
+ * that <y is the start of a dom element tag
233
+ * @param input
234
+ * @returns {*}
235
+ */
236
+
237
+
238
+ var lessThanHandling = function lessThanHandling(input) {
239
+ var arrowSplit = input.split('<'); // if we don't have at least 2 characters there's no point in checking
240
+
241
+ if (input.length > 2) {
242
+ return arrowSplit.reduce(function (st, part) {
243
+ /*
244
+ We check if this element resulted is:
245
+ div - continuation of a beginning of a HTML element
246
+ /div - closing of a HTML tag
247
+ br/> - beginning and closing of a html TAG
248
+ */
249
+ if (part.match(/<[a-zA-Z/][\s\S]*>/ig)) {
250
+ return "".concat(st).concat(st ? '<' : '').concat(part);
251
+ }
252
+
253
+ return "".concat(st).concat(st ? '&lt;' : '').concat(part);
254
+ }, '');
255
+ }
256
+
257
+ return input;
258
+ };
259
+
260
+ var serialization = {
261
+ deserialize: function deserialize(el) {
262
+ var tagName = getTagName(el);
263
+ /**
264
+ * This is used for when there's a wrapper over the mathml element.
265
+ * Because of this slate rule: "Only allow block nodes or inline and text nodes in blocks."
266
+ * The element that contains only the mathml is removed (along with the math) because it has
267
+ * an inline child and the block is of type block
268
+ * This is for legacy content only since our math rendering is valid for the core slate rules
269
+ */
270
+
271
+ var hasMathChild = _serialization.BLOCK_TAGS[tagName] && el.childNodes.length === 1 && getTagName(el.firstChild) === 'math';
272
+ log('[deserialize] name: ', tagName);
273
+ /**
274
+ * This is here in order to be able to render mathml content
275
+ */
276
+
277
+ if (tagName === 'math' || el.dataset && el.dataset.type === 'mathml' || hasMathChild) {
278
+ var newHtml = hasMathChild ? el.innerHTML : el.outerHTML;
279
+ return {
280
+ object: 'inline',
281
+ isVoid: true,
282
+ type: 'mathml',
283
+ data: {
284
+ html: newHtml
285
+ }
286
+ };
287
+ }
288
+
289
+ if (el.nodeType === TEXT_NODE) {
290
+ return;
291
+ }
292
+
293
+ if (tagName !== 'span') {
294
+ return;
295
+ }
296
+
297
+ var hasLatex = el.hasAttribute('data-latex') || el.hasAttribute('latex');
298
+
299
+ if (hasLatex) {
300
+ var latex = htmlDecode(el.innerHTML);
301
+
302
+ var _unWrapMath = (0, _mathRendering.unWrapMath)(latex),
303
+ unwrapped = _unWrapMath.unwrapped,
304
+ wrapType = _unWrapMath.wrapType;
305
+
306
+ log('[deserialize]: noBrackets: ', unwrapped, wrapType);
307
+ return {
308
+ object: 'inline',
309
+ type: 'math',
310
+ isVoid: true,
311
+ nodes: [],
312
+ data: {
313
+ latex: unwrapped,
314
+ wrapper: wrapType
315
+ }
316
+ };
317
+ }
318
+ },
319
+ serialize: function serialize(object) {
320
+ if (object.type === 'math') {
321
+ var l = object.data.get('latex');
322
+ var wrapper = object.data.get('wrapper');
323
+ log('[serialize] latex: ', l);
324
+ var decoded = htmlDecode(lessThanHandling(l));
325
+ return /*#__PURE__*/_react["default"].createElement("span", {
326
+ "data-latex": "",
327
+ "data-raw": decoded
328
+ }, (0, _mathRendering.wrapMath)(decoded, wrapper));
329
+ }
330
+ /**
331
+ * Here for rendering mathml content
332
+ */
333
+
334
+
335
+ if (object.type === 'mathml') {
336
+ var html = object.data.get('html');
337
+ return /*#__PURE__*/_react["default"].createElement("span", {
338
+ "data-type": "mathml",
339
+ dangerouslySetInnerHTML: {
340
+ __html: html
341
+ }
342
+ });
343
+ }
344
+ }
345
+ };
346
+ exports.serialization = serialization;
347
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/plugins/math/index.jsx"],"names":["log","TEXT_NODE","generateAdditionalKeys","keyData","map","key","name","latex","write","label","CustomToolbarComp","React","memo","props","node","value","onFocus","onBlur","onClick","pluginProps","math","keypadMode","customKeys","controlledKeypadMode","onDone","update","data","toObject","change","setNodeByKey","nextText","document","getNextText","moveFocusTo","moveAnchorTo","onToolbarDone","onChange","onDataChange","get","prev","next","nodeNext","keypadModeNext","controlledKeypadModeNext","keypadModeChanged","controlledKeypadModeChanged","equal","equals","propTypes","SlatePropTypes","isRequired","PropTypes","func","MathPlugin","toolbar","icon","inlineMath","insertInline","supports","object","type","schema","match","pluginStyles","parentNode","p","position","top","renderNode","html","attributes","__html","ROUND_BRACKETS","SQUARE_BRACKETS","DOLLAR","DOUBLE_DOLLAR","Inline","create","isVoid","htmlDecode","input","doc","DOMParser","parseFromString","documentElement","textContent","getTagName","el","tagName","toLowerCase","lessThanHandling","arrowSplit","split","length","reduce","st","part","serialization","deserialize","hasMathChild","BLOCK_TAGS","childNodes","firstChild","dataset","newHtml","innerHTML","outerHTML","nodeType","hasLatex","hasAttribute","unwrapped","wrapType","nodes","wrapper","serialize","l","decoded"],"mappings":";;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAEA;;;;;;AACA,IAAMA,GAAG,GAAG,uBAAM,qCAAN,CAAZ;AAEA,IAAMC,SAAS,GAAG,CAAlB;;AAEA,SAASC,sBAAT,GAA8C;AAAA,MAAdC,OAAc,uEAAJ,EAAI;AAC5C,SAAOA,OAAO,CAACC,GAAR,CAAY,UAAAC,GAAG;AAAA,WAAK;AACzBC,MAAAA,IAAI,EAAED,GADmB;AAEzBE,MAAAA,KAAK,EAAEF,GAFkB;AAGzBG,MAAAA,KAAK,EAAEH,GAHkB;AAIzBI,MAAAA,KAAK,EAAEJ;AAJkB,KAAL;AAAA,GAAf,CAAP;AAMD;;AAEM,IAAMK,iBAAiB,gBAAGC,kBAAMC,IAAN,CAC/B,UAAAC,KAAK,EAAI;AACP,MAAQC,IAAR,GAAkDD,KAAlD,CAAQC,IAAR;AAAA,MAAcC,KAAd,GAAkDF,KAAlD,CAAcE,KAAd;AAAA,MAAqBC,OAArB,GAAkDH,KAAlD,CAAqBG,OAArB;AAAA,MAA8BC,MAA9B,GAAkDJ,KAAlD,CAA8BI,MAA9B;AAAA,MAAsCC,OAAtC,GAAkDL,KAAlD,CAAsCK,OAAtC;;AACA,aAAwBL,KAAK,IAAI,EAAjC;AAAA,MAAQM,WAA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AAK,EAAEuG,SADH;AAEJG,UAAAA,OAAO,EAAEF;AAFL;AALD,OAAP;AAUD;AACF,GAvD0B;AAwD3BG,EAAAA,SAxD2B,qBAwDjBvD,MAxDiB,EAwDT;AAChB,QAAIA,MAAM,CAACC,IAAP,KAAgB,MAApB,EAA4B;AAC1B,UAAMuD,CAAC,GAAGxD,MAAM,CAACjC,IAAP,CAAYY,GAAZ,CAAgB,OAAhB,CAAV;AACA,UAAM2E,OAAO,GAAGtD,MAAM,CAACjC,IAAP,CAAYY,GAAZ,CAAgB,SAAhB,CAAhB;AACAtC,MAAAA,GAAG,CAAC,qBAAD,EAAwBmH,CAAxB,CAAH;AACA,UAAMC,OAAO,GAAGrC,UAAU,CAACW,gBAAgB,CAACyB,CAAD,CAAjB,CAA1B;AACA,0BACE;AAAM,sBAAW,EAAjB;AAAoB,oBAAUC;AAA9B,SACG,6BAASA,OAAT,EAAkBH,OAAlB,CADH,CADF;AAKD;AAED;AACJ;AACA;;;AACI,QAAItD,MAAM,CAACC,IAAP,KAAgB,QAApB,EAA8B;AAC5B,UAAMS,IAAI,GAAGV,MAAM,CAACjC,IAAP,CAAYY,GAAZ,CAAgB,MAAhB,CAAb;AAEA,0BAAO;AAAM,qBAAU,QAAhB;AAAyB,QAAA,uBAAuB,EAAE;AAAEiC,UAAAA,MAAM,EAAEF;AAAV;AAAlD,QAAP;AACD;AACF;AA7E0B,CAAtB","sourcesContent":["import Functions from '@material-ui/icons/Functions';\nimport { Inline } from 'slate';\nimport { MathPreview, MathToolbar } from '@pie-lib/math-toolbar';\nimport { wrapMath, unWrapMath } from '@pie-lib/math-rendering';\nimport React from 'react';\nimport debug from 'debug';\nimport SlatePropTypes from 'slate-prop-types';\nimport PropTypes from 'prop-types';\n\nimport { BLOCK_TAGS } from '../../serialization';\nconst log = debug('@pie-lib:editable-html:plugins:math');\n\nconst TEXT_NODE = 3;\n\nfunction generateAdditionalKeys(keyData = []) {\n return keyData.map(key => ({\n name: key,\n latex: key,\n write: key,\n label: key\n }));\n}\n\nexport const CustomToolbarComp = React.memo(\n props => {\n const { node, value, onFocus, onBlur, onClick } = props;\n const { pluginProps } = props || {};\n const { math } = pluginProps || {};\n const { keypadMode, customKeys, controlledKeypadMode = true } = math || {};\n\n const onDone = latex => {\n const update = {\n ...node.data.toObject(),\n latex\n };\n const change = value.change().setNodeByKey(node.key, { data: update });\n\n const nextText = value.document.getNextText(node.key);\n\n change.moveFocusTo(nextText.key, 0).moveAnchorTo(nextText.key, 0);\n\n props.onToolbarDone(change, false);\n };\n\n const onChange = latex => {\n const update = {\n ...node.data.toObject(),\n latex\n };\n const change = value.change().setNodeByKey(node.key, { data: update });\n log('call onToolbarChange:', change);\n props.onDataChange(node.key, update);\n };\n\n const latex = node.data.get('latex');\n\n return (\n <MathToolbar\n autoFocus\n additionalKeys={generateAdditionalKeys(customKeys)}\n latex={latex}\n onChange={onChange}\n onDone={onDone}\n onBlur={onBlur}\n onFocus={onFocus}\n onClick={onClick}\n keypadMode={keypadMode}\n controlledKeypadMode={controlledKeypadMode}\n />\n );\n },\n (prev, next) => {\n const { node, pluginProps: { math: { keypadMode, controlledKeypadMode } = {} } = {} } = prev;\n const {\n node: nodeNext,\n pluginProps: {\n math: { keypadMode: keypadModeNext, controlledKeypadMode: controlledKeypadModeNext } = {}\n } = {}\n } = next;\n const keypadModeChanged = keypadMode !== keypadModeNext;\n const controlledKeypadModeChanged = controlledKeypadMode !== controlledKeypadModeNext;\n\n const equal = node.equals(nodeNext);\n return equal && !keypadModeChanged && !controlledKeypadModeChanged;\n }\n);\n\nCustomToolbarComp.propTypes = {\n node: SlatePropTypes.node.isRequired,\n value: SlatePropTypes.value,\n onToolbarDone: PropTypes.func,\n onDataChange: PropTypes.func,\n onFocus: PropTypes.func,\n onClick: PropTypes.func,\n onBlur: PropTypes.func\n};\n\nexport default function MathPlugin() {\n return {\n name: 'math',\n toolbar: {\n icon: <Functions />,\n onClick: (value, onChange) => {\n log('[insertMath]');\n const math = inlineMath();\n const change = value.change().insertInline(math);\n onChange(change);\n },\n supports: node => node && node.object === 'inline' && node.type === 'math',\n /**\n * Return a react component function\n * @param node {Slate.Node}\n * @param value {Slate.Value}\n * @param onDone {(change?: Slate.Change, finishEditing :boolea) => void} - a function to call once the toolbar\n * has made any changes, call with the node.key and a data object.\n */\n CustomToolbarComp\n },\n schema: {\n document: { match: [{ type: 'math' }] }\n },\n\n pluginStyles: (node, parentNode, p) => {\n if (p) {\n return {\n position: 'absolute',\n top: 'initial'\n };\n }\n },\n\n renderNode: props => {\n if (props.node.type === 'math') {\n log('[renderNode]: data:', props.node.data);\n return <MathPreview {...props} />;\n }\n\n /**\n * Here for rendering mathml content\n */\n if (props.node.type === 'mathml') {\n const html = props.node.data.get('html');\n\n return <span {...props.attributes} dangerouslySetInnerHTML={{ __html: html }} />;\n }\n }\n };\n}\n\nMathPlugin.ROUND_BRACKETS = 'round_brackets';\nMathPlugin.SQUARE_BRACKETS = 'square_brackets';\nMathPlugin.DOLLAR = 'dollar';\nMathPlugin.DOUBLE_DOLLAR = 'double_dollar';\n\nexport const inlineMath = () =>\n Inline.create({\n object: 'inline',\n type: 'math',\n isVoid: true,\n data: {\n latex: ''\n }\n });\n\nconst htmlDecode = input => {\n const doc = new DOMParser().parseFromString(input, 'text/html');\n\n return doc.documentElement.textContent;\n};\n\nconst getTagName = el => {\n return ((el && el.tagName) || '').toLowerCase();\n};\n\n/**\n * Makes sure that strings that contain stuff like:\n * x<y are not transformed into x by the DOMParser because it thinks\n * that <y is the start of a dom element tag\n * @param input\n * @returns {*}\n */\nconst lessThanHandling = input => {\n const arrowSplit = input.split('<');\n\n // if we don't have at least 2 characters there's no point in checking\n if (input.length > 2) {\n return arrowSplit.reduce((st, part) => {\n /*\n We check if this element resulted is:\n div - continuation of a beginning of a HTML element\n /div - closing of a HTML tag\n br/> - beginning and closing of a html TAG\n */\n if (part.match(/<[a-zA-Z/][\\s\\S]*>/ig)) {\n return `${st}${st ? '<' : ''}${part}`;\n }\n\n return `${st}${st ? '&lt;' : ''}${part}`;\n }, '');\n }\n\n return input;\n};\n\nexport const serialization = {\n deserialize(el) {\n const tagName = getTagName(el);\n /**\n * This is used for when there's a wrapper over the mathml element.\n * Because of this slate rule: \"Only allow block nodes or inline and text nodes in blocks.\"\n * The element that contains only the mathml is removed (along with the math) because it has\n * an inline child and the block is of type block\n * This is for legacy content only since our math rendering is valid for the core slate rules\n */\n const hasMathChild =\n BLOCK_TAGS[tagName] && el.childNodes.length === 1 && getTagName(el.firstChild) === 'math';\n log('[deserialize] name: ', tagName);\n\n /**\n * This is here in order to be able to render mathml content\n */\n if (tagName === 'math' || (el.dataset && el.dataset.type === 'mathml') || hasMathChild) {\n const newHtml = hasMathChild ? el.innerHTML : el.outerHTML;\n\n return {\n object: 'inline',\n isVoid: true,\n type: 'mathml',\n data: {\n html: newHtml\n }\n };\n }\n\n if (el.nodeType === TEXT_NODE) {\n return;\n }\n\n if (tagName !== 'span') {\n return;\n }\n\n const hasLatex = el.hasAttribute('data-latex') || el.hasAttribute('latex');\n\n if (hasLatex) {\n const latex = htmlDecode(el.innerHTML);\n const { unwrapped, wrapType } = unWrapMath(latex);\n log('[deserialize]: noBrackets: ', unwrapped, wrapType);\n return {\n object: 'inline',\n type: 'math',\n isVoid: true,\n nodes: [],\n data: {\n latex: unwrapped,\n wrapper: wrapType\n }\n };\n }\n },\n serialize(object) {\n if (object.type === 'math') {\n const l = object.data.get('latex');\n const wrapper = object.data.get('wrapper');\n log('[serialize] latex: ', l);\n const decoded = htmlDecode(lessThanHandling(l));\n return (\n <span data-latex=\"\" data-raw={decoded}>\n {wrapMath(decoded, wrapper)}\n </span>\n );\n }\n\n /**\n * Here for rendering mathml content\n */\n if (object.type === 'mathml') {\n const html = object.data.get('html');\n\n return <span data-type=\"mathml\" dangerouslySetInnerHTML={{ __html: html }} />;\n }\n }\n};\n"],"file":"index.js"}