@pie-element/ebsr 6.6.3-next.1097 → 6.6.3-next.1137

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 (239) hide show
  1. package/configure/node_modules/@pie-lib/config-ui/CHANGELOG.json +1677 -0
  2. package/configure/node_modules/@pie-lib/config-ui/CHANGELOG.md +1743 -0
  3. package/configure/node_modules/@pie-lib/config-ui/LICENSE.md +5 -0
  4. package/configure/node_modules/@pie-lib/config-ui/README.md +12 -0
  5. package/configure/node_modules/@pie-lib/config-ui/lib/alert-dialog.js +44 -0
  6. package/configure/node_modules/@pie-lib/config-ui/lib/alert-dialog.js.map +1 -0
  7. package/configure/node_modules/@pie-lib/config-ui/lib/checkbox.js +86 -0
  8. package/configure/node_modules/@pie-lib/config-ui/lib/checkbox.js.map +1 -0
  9. package/configure/node_modules/@pie-lib/config-ui/lib/choice-configuration/feedback-menu.js +164 -0
  10. package/configure/node_modules/@pie-lib/config-ui/lib/choice-configuration/feedback-menu.js.map +1 -0
  11. package/configure/node_modules/@pie-lib/config-ui/lib/choice-configuration/index.js +398 -0
  12. package/configure/node_modules/@pie-lib/config-ui/lib/choice-configuration/index.js.map +1 -0
  13. package/configure/node_modules/@pie-lib/config-ui/lib/choice-utils.js +54 -0
  14. package/configure/node_modules/@pie-lib/config-ui/lib/choice-utils.js.map +1 -0
  15. package/configure/node_modules/@pie-lib/config-ui/lib/feedback-config/feedback-selector.js +185 -0
  16. package/configure/node_modules/@pie-lib/config-ui/lib/feedback-config/feedback-selector.js.map +1 -0
  17. package/configure/node_modules/@pie-lib/config-ui/lib/feedback-config/group.js +75 -0
  18. package/configure/node_modules/@pie-lib/config-ui/lib/feedback-config/group.js.map +1 -0
  19. package/configure/node_modules/@pie-lib/config-ui/lib/feedback-config/index.js +178 -0
  20. package/configure/node_modules/@pie-lib/config-ui/lib/feedback-config/index.js.map +1 -0
  21. package/configure/node_modules/@pie-lib/config-ui/lib/form-section.js +46 -0
  22. package/configure/node_modules/@pie-lib/config-ui/lib/form-section.js.map +1 -0
  23. package/configure/node_modules/@pie-lib/config-ui/lib/help.js +145 -0
  24. package/configure/node_modules/@pie-lib/config-ui/lib/help.js.map +1 -0
  25. package/configure/node_modules/@pie-lib/config-ui/lib/index.js +216 -0
  26. package/configure/node_modules/@pie-lib/config-ui/lib/index.js.map +1 -0
  27. package/configure/node_modules/@pie-lib/config-ui/lib/input.js +139 -0
  28. package/configure/node_modules/@pie-lib/config-ui/lib/input.js.map +1 -0
  29. package/configure/node_modules/@pie-lib/config-ui/lib/inputs.js +131 -0
  30. package/configure/node_modules/@pie-lib/config-ui/lib/inputs.js.map +1 -0
  31. package/configure/node_modules/@pie-lib/config-ui/lib/langs.js +179 -0
  32. package/configure/node_modules/@pie-lib/config-ui/lib/langs.js.map +1 -0
  33. package/configure/node_modules/@pie-lib/config-ui/lib/layout/config-layout.js +101 -0
  34. package/configure/node_modules/@pie-lib/config-ui/lib/layout/config-layout.js.map +1 -0
  35. package/configure/node_modules/@pie-lib/config-ui/lib/layout/index.js +24 -0
  36. package/configure/node_modules/@pie-lib/config-ui/lib/layout/index.js.map +1 -0
  37. package/configure/node_modules/@pie-lib/config-ui/lib/layout/layout-contents.js +105 -0
  38. package/configure/node_modules/@pie-lib/config-ui/lib/layout/layout-contents.js.map +1 -0
  39. package/configure/node_modules/@pie-lib/config-ui/lib/layout/settings-box.js +87 -0
  40. package/configure/node_modules/@pie-lib/config-ui/lib/layout/settings-box.js.map +1 -0
  41. package/configure/node_modules/@pie-lib/config-ui/lib/mui-box/index.js +79 -0
  42. package/configure/node_modules/@pie-lib/config-ui/lib/mui-box/index.js.map +1 -0
  43. package/configure/node_modules/@pie-lib/config-ui/lib/number-text-field-custom.js +364 -0
  44. package/configure/node_modules/@pie-lib/config-ui/lib/number-text-field-custom.js.map +1 -0
  45. package/configure/node_modules/@pie-lib/config-ui/lib/number-text-field.js +265 -0
  46. package/configure/node_modules/@pie-lib/config-ui/lib/number-text-field.js.map +1 -0
  47. package/configure/node_modules/@pie-lib/config-ui/lib/radio-with-label.js +41 -0
  48. package/configure/node_modules/@pie-lib/config-ui/lib/radio-with-label.js.map +1 -0
  49. package/configure/node_modules/@pie-lib/config-ui/lib/settings/display-size.js +77 -0
  50. package/configure/node_modules/@pie-lib/config-ui/lib/settings/display-size.js.map +1 -0
  51. package/configure/node_modules/@pie-lib/config-ui/lib/settings/index.js +130 -0
  52. package/configure/node_modules/@pie-lib/config-ui/lib/settings/index.js.map +1 -0
  53. package/configure/node_modules/@pie-lib/config-ui/lib/settings/panel.js +412 -0
  54. package/configure/node_modules/@pie-lib/config-ui/lib/settings/panel.js.map +1 -0
  55. package/configure/node_modules/@pie-lib/config-ui/lib/settings/settings-radio-label.js +43 -0
  56. package/configure/node_modules/@pie-lib/config-ui/lib/settings/settings-radio-label.js.map +1 -0
  57. package/configure/node_modules/@pie-lib/config-ui/lib/settings/toggle.js +56 -0
  58. package/configure/node_modules/@pie-lib/config-ui/lib/settings/toggle.js.map +1 -0
  59. package/configure/node_modules/@pie-lib/config-ui/lib/tabs/index.js +106 -0
  60. package/configure/node_modules/@pie-lib/config-ui/lib/tabs/index.js.map +1 -0
  61. package/configure/node_modules/@pie-lib/config-ui/lib/tags-input/index.js +198 -0
  62. package/configure/node_modules/@pie-lib/config-ui/lib/tags-input/index.js.map +1 -0
  63. package/configure/node_modules/@pie-lib/config-ui/lib/two-choice.js +180 -0
  64. package/configure/node_modules/@pie-lib/config-ui/lib/two-choice.js.map +1 -0
  65. package/configure/node_modules/@pie-lib/config-ui/lib/with-stateful-model.js +84 -0
  66. package/configure/node_modules/@pie-lib/config-ui/lib/with-stateful-model.js.map +1 -0
  67. package/configure/node_modules/@pie-lib/config-ui/package.json +30 -0
  68. package/configure/node_modules/@pie-lib/config-ui/src/alert-dialog.jsx +43 -0
  69. package/configure/node_modules/@pie-lib/config-ui/src/checkbox.jsx +63 -0
  70. package/configure/node_modules/@pie-lib/config-ui/src/choice-configuration/feedback-menu.jsx +103 -0
  71. package/configure/node_modules/@pie-lib/config-ui/src/choice-configuration/index.jsx +319 -0
  72. package/configure/node_modules/@pie-lib/config-ui/src/choice-utils.js +30 -0
  73. package/configure/node_modules/@pie-lib/config-ui/src/feedback-config/feedback-selector.jsx +116 -0
  74. package/configure/node_modules/@pie-lib/config-ui/src/feedback-config/group.jsx +54 -0
  75. package/configure/node_modules/@pie-lib/config-ui/src/feedback-config/index.jsx +98 -0
  76. package/configure/node_modules/@pie-lib/config-ui/src/form-section.jsx +23 -0
  77. package/configure/node_modules/@pie-lib/config-ui/src/help.jsx +88 -0
  78. package/configure/node_modules/@pie-lib/config-ui/src/index.js +58 -0
  79. package/configure/node_modules/@pie-lib/config-ui/src/input.jsx +72 -0
  80. package/configure/node_modules/@pie-lib/config-ui/src/inputs.jsx +96 -0
  81. package/configure/node_modules/@pie-lib/config-ui/src/langs.jsx +122 -0
  82. package/configure/node_modules/@pie-lib/config-ui/src/layout/config-layout.jsx +64 -0
  83. package/configure/node_modules/@pie-lib/config-ui/src/layout/index.js +4 -0
  84. package/configure/node_modules/@pie-lib/config-ui/src/layout/layout-contents.jsx +60 -0
  85. package/configure/node_modules/@pie-lib/config-ui/src/layout/settings-box.jsx +31 -0
  86. package/configure/node_modules/@pie-lib/config-ui/src/mui-box/index.jsx +64 -0
  87. package/configure/node_modules/@pie-lib/config-ui/src/number-text-field-custom.jsx +276 -0
  88. package/configure/node_modules/@pie-lib/config-ui/src/number-text-field.jsx +196 -0
  89. package/configure/node_modules/@pie-lib/config-ui/src/radio-with-label.jsx +18 -0
  90. package/configure/node_modules/@pie-lib/config-ui/src/settings/display-size.jsx +52 -0
  91. package/configure/node_modules/@pie-lib/config-ui/src/settings/index.js +75 -0
  92. package/configure/node_modules/@pie-lib/config-ui/src/settings/panel.jsx +297 -0
  93. package/configure/node_modules/@pie-lib/config-ui/src/settings/settings-radio-label.jsx +20 -0
  94. package/configure/node_modules/@pie-lib/config-ui/src/settings/toggle.jsx +31 -0
  95. package/configure/node_modules/@pie-lib/config-ui/src/tabs/index.jsx +51 -0
  96. package/configure/node_modules/@pie-lib/config-ui/src/tags-input/index.jsx +121 -0
  97. package/configure/node_modules/@pie-lib/config-ui/src/two-choice.jsx +94 -0
  98. package/configure/node_modules/@pie-lib/config-ui/src/with-stateful-model.jsx +36 -0
  99. package/configure/node_modules/@pie-lib/editable-html/CHANGELOG.json +3327 -0
  100. package/configure/node_modules/@pie-lib/editable-html/CHANGELOG.md +1759 -0
  101. package/configure/node_modules/@pie-lib/editable-html/LICENSE.md +5 -0
  102. package/configure/node_modules/@pie-lib/editable-html/README.md +45 -0
  103. package/configure/node_modules/@pie-lib/editable-html/deploy.sh +16 -0
  104. package/configure/node_modules/@pie-lib/editable-html/lib/editor.js +893 -0
  105. package/configure/node_modules/@pie-lib/editable-html/lib/editor.js.map +1 -0
  106. package/configure/node_modules/@pie-lib/editable-html/lib/index.js +226 -0
  107. package/configure/node_modules/@pie-lib/editable-html/lib/index.js.map +1 -0
  108. package/configure/node_modules/@pie-lib/editable-html/lib/parse-html.js +16 -0
  109. package/configure/node_modules/@pie-lib/editable-html/lib/parse-html.js.map +1 -0
  110. package/configure/node_modules/@pie-lib/editable-html/lib/plugins/characters/custom-popover.js +70 -0
  111. package/configure/node_modules/@pie-lib/editable-html/lib/plugins/characters/custom-popover.js.map +1 -0
  112. package/configure/node_modules/@pie-lib/editable-html/lib/plugins/characters/index.js +266 -0
  113. package/configure/node_modules/@pie-lib/editable-html/lib/plugins/characters/index.js.map +1 -0
  114. package/configure/node_modules/@pie-lib/editable-html/lib/plugins/characters/utils.js +382 -0
  115. package/configure/node_modules/@pie-lib/editable-html/lib/plugins/characters/utils.js.map +1 -0
  116. package/configure/node_modules/@pie-lib/editable-html/lib/plugins/image/alt-dialog.js +119 -0
  117. package/configure/node_modules/@pie-lib/editable-html/lib/plugins/image/alt-dialog.js.map +1 -0
  118. package/configure/node_modules/@pie-lib/editable-html/lib/plugins/image/component.js +424 -0
  119. package/configure/node_modules/@pie-lib/editable-html/lib/plugins/image/component.js.map +1 -0
  120. package/configure/node_modules/@pie-lib/editable-html/lib/plugins/image/image-toolbar.js +175 -0
  121. package/configure/node_modules/@pie-lib/editable-html/lib/plugins/image/image-toolbar.js.map +1 -0
  122. package/configure/node_modules/@pie-lib/editable-html/lib/plugins/image/index.js +261 -0
  123. package/configure/node_modules/@pie-lib/editable-html/lib/plugins/image/index.js.map +1 -0
  124. package/configure/node_modules/@pie-lib/editable-html/lib/plugins/image/insert-image-handler.js +135 -0
  125. package/configure/node_modules/@pie-lib/editable-html/lib/plugins/image/insert-image-handler.js.map +1 -0
  126. package/configure/node_modules/@pie-lib/editable-html/lib/plugins/index.js +141 -0
  127. package/configure/node_modules/@pie-lib/editable-html/lib/plugins/index.js.map +1 -0
  128. package/configure/node_modules/@pie-lib/editable-html/lib/plugins/list/index.js +204 -0
  129. package/configure/node_modules/@pie-lib/editable-html/lib/plugins/list/index.js.map +1 -0
  130. package/configure/node_modules/@pie-lib/editable-html/lib/plugins/math/index.js +347 -0
  131. package/configure/node_modules/@pie-lib/editable-html/lib/plugins/math/index.js.map +1 -0
  132. package/configure/node_modules/@pie-lib/editable-html/lib/plugins/media/index.js +339 -0
  133. package/configure/node_modules/@pie-lib/editable-html/lib/plugins/media/index.js.map +1 -0
  134. package/configure/node_modules/@pie-lib/editable-html/lib/plugins/media/media-dialog.js +434 -0
  135. package/configure/node_modules/@pie-lib/editable-html/lib/plugins/media/media-dialog.js.map +1 -0
  136. package/configure/node_modules/@pie-lib/editable-html/lib/plugins/media/media-toolbar.js +99 -0
  137. package/configure/node_modules/@pie-lib/editable-html/lib/plugins/media/media-toolbar.js.map +1 -0
  138. package/configure/node_modules/@pie-lib/editable-html/lib/plugins/media/media-wrapper.js +93 -0
  139. package/configure/node_modules/@pie-lib/editable-html/lib/plugins/media/media-wrapper.js.map +1 -0
  140. package/configure/node_modules/@pie-lib/editable-html/lib/plugins/respArea/drag-in-the-blank/choice.js +251 -0
  141. package/configure/node_modules/@pie-lib/editable-html/lib/plugins/respArea/drag-in-the-blank/choice.js.map +1 -0
  142. package/configure/node_modules/@pie-lib/editable-html/lib/plugins/respArea/drag-in-the-blank/index.js +97 -0
  143. package/configure/node_modules/@pie-lib/editable-html/lib/plugins/respArea/drag-in-the-blank/index.js.map +1 -0
  144. package/configure/node_modules/@pie-lib/editable-html/lib/plugins/respArea/explicit-constructed-response/index.js +54 -0
  145. package/configure/node_modules/@pie-lib/editable-html/lib/plugins/respArea/explicit-constructed-response/index.js.map +1 -0
  146. package/configure/node_modules/@pie-lib/editable-html/lib/plugins/respArea/icons/index.js +93 -0
  147. package/configure/node_modules/@pie-lib/editable-html/lib/plugins/respArea/icons/index.js.map +1 -0
  148. package/configure/node_modules/@pie-lib/editable-html/lib/plugins/respArea/index.js +293 -0
  149. package/configure/node_modules/@pie-lib/editable-html/lib/plugins/respArea/index.js.map +1 -0
  150. package/configure/node_modules/@pie-lib/editable-html/lib/plugins/respArea/inline-dropdown/index.js +70 -0
  151. package/configure/node_modules/@pie-lib/editable-html/lib/plugins/respArea/inline-dropdown/index.js.map +1 -0
  152. package/configure/node_modules/@pie-lib/editable-html/lib/plugins/respArea/utils.js +110 -0
  153. package/configure/node_modules/@pie-lib/editable-html/lib/plugins/respArea/utils.js.map +1 -0
  154. package/configure/node_modules/@pie-lib/editable-html/lib/plugins/table/icons/index.js +69 -0
  155. package/configure/node_modules/@pie-lib/editable-html/lib/plugins/table/icons/index.js.map +1 -0
  156. package/configure/node_modules/@pie-lib/editable-html/lib/plugins/table/index.js +499 -0
  157. package/configure/node_modules/@pie-lib/editable-html/lib/plugins/table/index.js.map +1 -0
  158. package/configure/node_modules/@pie-lib/editable-html/lib/plugins/table/table-toolbar.js +158 -0
  159. package/configure/node_modules/@pie-lib/editable-html/lib/plugins/table/table-toolbar.js.map +1 -0
  160. package/configure/node_modules/@pie-lib/editable-html/lib/plugins/toolbar/default-toolbar.js +132 -0
  161. package/configure/node_modules/@pie-lib/editable-html/lib/plugins/toolbar/default-toolbar.js.map +1 -0
  162. package/configure/node_modules/@pie-lib/editable-html/lib/plugins/toolbar/done-button.js +50 -0
  163. package/configure/node_modules/@pie-lib/editable-html/lib/plugins/toolbar/done-button.js.map +1 -0
  164. package/configure/node_modules/@pie-lib/editable-html/lib/plugins/toolbar/editor-and-toolbar.js +263 -0
  165. package/configure/node_modules/@pie-lib/editable-html/lib/plugins/toolbar/editor-and-toolbar.js.map +1 -0
  166. package/configure/node_modules/@pie-lib/editable-html/lib/plugins/toolbar/index.js +32 -0
  167. package/configure/node_modules/@pie-lib/editable-html/lib/plugins/toolbar/index.js.map +1 -0
  168. package/configure/node_modules/@pie-lib/editable-html/lib/plugins/toolbar/toolbar-buttons.js +161 -0
  169. package/configure/node_modules/@pie-lib/editable-html/lib/plugins/toolbar/toolbar-buttons.js.map +1 -0
  170. package/configure/node_modules/@pie-lib/editable-html/lib/plugins/toolbar/toolbar.js +346 -0
  171. package/configure/node_modules/@pie-lib/editable-html/lib/plugins/toolbar/toolbar.js.map +1 -0
  172. package/configure/node_modules/@pie-lib/editable-html/lib/plugins/utils.js +62 -0
  173. package/configure/node_modules/@pie-lib/editable-html/lib/plugins/utils.js.map +1 -0
  174. package/configure/node_modules/@pie-lib/editable-html/lib/serialization.js +428 -0
  175. package/configure/node_modules/@pie-lib/editable-html/lib/serialization.js.map +1 -0
  176. package/configure/node_modules/@pie-lib/editable-html/lib/theme.js +9 -0
  177. package/configure/node_modules/@pie-lib/editable-html/lib/theme.js.map +1 -0
  178. package/configure/node_modules/@pie-lib/editable-html/package.json +52 -0
  179. package/configure/node_modules/@pie-lib/editable-html/playground/image/data.js +59 -0
  180. package/configure/node_modules/@pie-lib/editable-html/playground/image/index.html +24 -0
  181. package/configure/node_modules/@pie-lib/editable-html/playground/image/index.jsx +83 -0
  182. package/configure/node_modules/@pie-lib/editable-html/playground/index.html +27 -0
  183. package/configure/node_modules/@pie-lib/editable-html/playground/mathquill/index.html +25 -0
  184. package/configure/node_modules/@pie-lib/editable-html/playground/mathquill/index.jsx +151 -0
  185. package/configure/node_modules/@pie-lib/editable-html/playground/package.json +15 -0
  186. package/configure/node_modules/@pie-lib/editable-html/playground/prod-test/index.html +26 -0
  187. package/configure/node_modules/@pie-lib/editable-html/playground/prod-test/index.jsx +30 -0
  188. package/configure/node_modules/@pie-lib/editable-html/playground/schema-override/data.js +29 -0
  189. package/configure/node_modules/@pie-lib/editable-html/playground/schema-override/image-plugin.jsx +40 -0
  190. package/configure/node_modules/@pie-lib/editable-html/playground/schema-override/index.html +23 -0
  191. package/configure/node_modules/@pie-lib/editable-html/playground/schema-override/index.jsx +96 -0
  192. package/configure/node_modules/@pie-lib/editable-html/playground/serialization/data.js +29 -0
  193. package/configure/node_modules/@pie-lib/editable-html/playground/serialization/image-plugin.jsx +40 -0
  194. package/configure/node_modules/@pie-lib/editable-html/playground/serialization/index.html +24 -0
  195. package/configure/node_modules/@pie-lib/editable-html/playground/serialization/index.jsx +12 -0
  196. package/configure/node_modules/@pie-lib/editable-html/playground/static.json +3 -0
  197. package/configure/node_modules/@pie-lib/editable-html/playground/table-examples.html +67 -0
  198. package/configure/node_modules/@pie-lib/editable-html/playground/webpack.config.js +42 -0
  199. package/configure/node_modules/@pie-lib/editable-html/src/editor.jsx +749 -0
  200. package/configure/node_modules/@pie-lib/editable-html/src/index.jsx +145 -0
  201. package/configure/node_modules/@pie-lib/editable-html/src/parse-html.js +8 -0
  202. package/configure/node_modules/@pie-lib/editable-html/src/plugins/README.md +27 -0
  203. package/configure/node_modules/@pie-lib/editable-html/src/plugins/characters/custom-popover.js +45 -0
  204. package/configure/node_modules/@pie-lib/editable-html/src/plugins/characters/index.jsx +244 -0
  205. package/configure/node_modules/@pie-lib/editable-html/src/plugins/characters/utils.js +448 -0
  206. package/configure/node_modules/@pie-lib/editable-html/src/plugins/image/alt-dialog.jsx +69 -0
  207. package/configure/node_modules/@pie-lib/editable-html/src/plugins/image/component.jsx +349 -0
  208. package/configure/node_modules/@pie-lib/editable-html/src/plugins/image/image-toolbar.jsx +108 -0
  209. package/configure/node_modules/@pie-lib/editable-html/src/plugins/image/index.jsx +218 -0
  210. package/configure/node_modules/@pie-lib/editable-html/src/plugins/image/insert-image-handler.js +93 -0
  211. package/configure/node_modules/@pie-lib/editable-html/src/plugins/index.jsx +115 -0
  212. package/configure/node_modules/@pie-lib/editable-html/src/plugins/list/index.jsx +175 -0
  213. package/configure/node_modules/@pie-lib/editable-html/src/plugins/math/index.jsx +283 -0
  214. package/configure/node_modules/@pie-lib/editable-html/src/plugins/media/index.jsx +284 -0
  215. package/configure/node_modules/@pie-lib/editable-html/src/plugins/media/media-dialog.js +372 -0
  216. package/configure/node_modules/@pie-lib/editable-html/src/plugins/media/media-toolbar.jsx +53 -0
  217. package/configure/node_modules/@pie-lib/editable-html/src/plugins/media/media-wrapper.jsx +43 -0
  218. package/configure/node_modules/@pie-lib/editable-html/src/plugins/respArea/drag-in-the-blank/choice.jsx +187 -0
  219. package/configure/node_modules/@pie-lib/editable-html/src/plugins/respArea/drag-in-the-blank/index.jsx +78 -0
  220. package/configure/node_modules/@pie-lib/editable-html/src/plugins/respArea/explicit-constructed-response/index.jsx +45 -0
  221. package/configure/node_modules/@pie-lib/editable-html/src/plugins/respArea/icons/index.jsx +68 -0
  222. package/configure/node_modules/@pie-lib/editable-html/src/plugins/respArea/index.jsx +263 -0
  223. package/configure/node_modules/@pie-lib/editable-html/src/plugins/respArea/inline-dropdown/index.jsx +63 -0
  224. package/configure/node_modules/@pie-lib/editable-html/src/plugins/respArea/utils.jsx +77 -0
  225. package/configure/node_modules/@pie-lib/editable-html/src/plugins/table/icons/index.jsx +59 -0
  226. package/configure/node_modules/@pie-lib/editable-html/src/plugins/table/index.jsx +439 -0
  227. package/configure/node_modules/@pie-lib/editable-html/src/plugins/table/table-toolbar.jsx +104 -0
  228. package/configure/node_modules/@pie-lib/editable-html/src/plugins/toolbar/default-toolbar.jsx +111 -0
  229. package/configure/node_modules/@pie-lib/editable-html/src/plugins/toolbar/done-button.jsx +36 -0
  230. package/configure/node_modules/@pie-lib/editable-html/src/plugins/toolbar/editor-and-toolbar.jsx +225 -0
  231. package/configure/node_modules/@pie-lib/editable-html/src/plugins/toolbar/index.jsx +21 -0
  232. package/configure/node_modules/@pie-lib/editable-html/src/plugins/toolbar/toolbar-buttons.jsx +97 -0
  233. package/configure/node_modules/@pie-lib/editable-html/src/plugins/toolbar/toolbar.jsx +323 -0
  234. package/configure/node_modules/@pie-lib/editable-html/src/plugins/utils.js +32 -0
  235. package/configure/node_modules/@pie-lib/editable-html/src/serialization.jsx +385 -0
  236. package/configure/node_modules/@pie-lib/editable-html/src/theme.js +1 -0
  237. package/configure/node_modules/@pie-lib/editable-html/static.json +1 -0
  238. package/configure/package.json +1 -1
  239. package/package.json +3 -3
@@ -0,0 +1,62 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.hasNode = exports.hasMark = exports.hasBlock = exports.findSingleNode = exports.findParentNode = void 0;
7
+
8
+ var findSingleNode = function findSingleNode(value) {
9
+ if (!value || !value.isCollapsed || !value.startKey) {
10
+ return;
11
+ }
12
+
13
+ var inline = value.document.getClosestInline(value.startKey);
14
+
15
+ if (inline) {
16
+ return inline;
17
+ }
18
+
19
+ var block = value.document.getClosestBlock(value.startKey);
20
+
21
+ if (block) {
22
+ return block;
23
+ }
24
+ };
25
+
26
+ exports.findSingleNode = findSingleNode;
27
+
28
+ var findParentNode = function findParentNode(value, node) {
29
+ if (!value || !node) {
30
+ return;
31
+ }
32
+
33
+ return value.document.getParent(node.key);
34
+ };
35
+
36
+ exports.findParentNode = findParentNode;
37
+
38
+ var hasMark = function hasMark(value, type) {
39
+ return value && value.marks.some(function (mark) {
40
+ return mark.type == type;
41
+ });
42
+ };
43
+
44
+ exports.hasMark = hasMark;
45
+
46
+ var hasBlock = function hasBlock(value, type) {
47
+ return value && value.blocks.some(function (node) {
48
+ return node.type == type;
49
+ });
50
+ };
51
+
52
+ exports.hasBlock = hasBlock;
53
+
54
+ var hasNode = function hasNode(_ref, type) {
55
+ var document = _ref.document;
56
+ return document && document.nodes.some(function (node) {
57
+ return node.type == type;
58
+ });
59
+ };
60
+
61
+ exports.hasNode = hasNode;
62
+ //# sourceMappingURL=utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/plugins/utils.js"],"names":["findSingleNode","value","isCollapsed","startKey","inline","document","getClosestInline","block","getClosestBlock","findParentNode","node","getParent","key","hasMark","type","marks","some","mark","hasBlock","blocks","hasNode","nodes"],"mappings":";;;;;;;AAAO,IAAMA,cAAc,GAAG,SAAjBA,cAAiB,CAAAC,KAAK,EAAI;AACrC,MAAI,CAACA,KAAD,IAAU,CAACA,KAAK,CAACC,WAAjB,IAAgC,CAACD,KAAK,CAACE,QAA3C,EAAqD;AACnD;AACD;;AAED,MAAMC,MAAM,GAAGH,KAAK,CAACI,QAAN,CAAeC,gBAAf,CAAgCL,KAAK,CAACE,QAAtC,CAAf;;AAEA,MAAIC,MAAJ,EAAY;AACV,WAAOA,MAAP;AACD;;AAED,MAAMG,KAAK,GAAGN,KAAK,CAACI,QAAN,CAAeG,eAAf,CAA+BP,KAAK,CAACE,QAArC,CAAd;;AAEA,MAAII,KAAJ,EAAW;AACT,WAAOA,KAAP;AACD;AACF,CAhBM;;;;AAkBA,IAAME,cAAc,GAAG,SAAjBA,cAAiB,CAACR,KAAD,EAAQS,IAAR,EAAiB;AAC7C,MAAI,CAACT,KAAD,IAAU,CAACS,IAAf,EAAqB;AACnB;AACD;;AAED,SAAOT,KAAK,CAACI,QAAN,CAAeM,SAAf,CAAyBD,IAAI,CAACE,GAA9B,CAAP;AACD,CANM;;;;AAQA,IAAMC,OAAO,GAAG,SAAVA,OAAU,CAACZ,KAAD,EAAQa,IAAR;AAAA,SAAiBb,KAAK,IAAIA,KAAK,CAACc,KAAN,CAAYC,IAAZ,CAAiB,UAAAC,IAAI;AAAA,WAAIA,IAAI,CAACH,IAAL,IAAaA,IAAjB;AAAA,GAArB,CAA1B;AAAA,CAAhB;;;;AAEA,IAAMI,QAAQ,GAAG,SAAXA,QAAW,CAACjB,KAAD,EAAQa,IAAR;AAAA,SAAiBb,KAAK,IAAIA,KAAK,CAACkB,MAAN,CAAaH,IAAb,CAAkB,UAAAN,IAAI;AAAA,WAAIA,IAAI,CAACI,IAAL,IAAaA,IAAjB;AAAA,GAAtB,CAA1B;AAAA,CAAjB;;;;AAEA,IAAMM,OAAO,GAAG,SAAVA,OAAU,OAAeN,IAAf;AAAA,MAAGT,QAAH,QAAGA,QAAH;AAAA,SACrBA,QAAQ,IAAIA,QAAQ,CAACgB,KAAT,CAAeL,IAAf,CAAoB,UAAAN,IAAI;AAAA,WAAIA,IAAI,CAACI,IAAL,IAAaA,IAAjB;AAAA,GAAxB,CADS;AAAA,CAAhB","sourcesContent":["export const findSingleNode = value => {\n if (!value || !value.isCollapsed || !value.startKey) {\n return;\n }\n\n const inline = value.document.getClosestInline(value.startKey);\n\n if (inline) {\n return inline;\n }\n\n const block = value.document.getClosestBlock(value.startKey);\n\n if (block) {\n return block;\n }\n};\n\nexport const findParentNode = (value, node) => {\n if (!value || !node) {\n return;\n }\n\n return value.document.getParent(node.key);\n};\n\nexport const hasMark = (value, type) => value && value.marks.some(mark => mark.type == type);\n\nexport const hasBlock = (value, type) => value && value.blocks.some(node => node.type == type);\n\nexport const hasNode = ({ document }, type) =>\n document && document.nodes.some(node => node.type == type);\n"],"file":"utils.js"}
@@ -0,0 +1,428 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.valueToHtml = exports.reactAttributes = exports.parseStyleString = exports.htmlToValue = exports.getBase64 = exports.TEXT_RULE = exports.BLOCK_TAGS = void 0;
9
+
10
+ var _slateHtmlSerializer = _interopRequireDefault(require("slate-html-serializer"));
11
+
12
+ var _react = _interopRequireDefault(require("react"));
13
+
14
+ var _debug = _interopRequireDefault(require("debug"));
15
+
16
+ var _toStyle = require("to-style");
17
+
18
+ var _image = require("./plugins/image");
19
+
20
+ var _math = require("./plugins/math");
21
+
22
+ var _media = require("./plugins/media");
23
+
24
+ var _list = require("./plugins/list");
25
+
26
+ var _table = require("./plugins/table");
27
+
28
+ var _respArea = require("./plugins/respArea");
29
+
30
+ var _slate = require("slate");
31
+
32
+ var log = (0, _debug["default"])('@pie-lib:editable-html:serialization');
33
+ /**
34
+ * Tags to blocks.
35
+ *
36
+ * @type {Object}
37
+ */
38
+
39
+ var BLOCK_TAGS = {
40
+ div: 'div',
41
+ span: 'span',
42
+ p: 'paragraph',
43
+ blockquote: 'quote',
44
+ pre: 'code',
45
+ h1: 'heading-one',
46
+ h2: 'heading-two',
47
+ h3: 'heading-three',
48
+ h4: 'heading-four',
49
+ h5: 'heading-five',
50
+ h6: 'heading-six'
51
+ };
52
+ /**
53
+ * Tags to marks.
54
+ *
55
+ * @type {Object}
56
+ */
57
+
58
+ exports.BLOCK_TAGS = BLOCK_TAGS;
59
+ var MARK_TAGS = {
60
+ b: 'bold',
61
+ em: 'italic',
62
+ u: 'underline',
63
+ s: 'strikethrough',
64
+ code: 'code',
65
+ strong: 'bold'
66
+ };
67
+
68
+ var parseStyleString = function parseStyleString(s) {
69
+ var regex = /([\w-]*)\s*:\s*([^;]*)/g;
70
+ var match;
71
+ var result = {};
72
+
73
+ while (match = regex.exec(s)) {
74
+ result[match[1]] = match[2].trim();
75
+ }
76
+
77
+ return result;
78
+ };
79
+
80
+ exports.parseStyleString = parseStyleString;
81
+
82
+ var getBase64 = function getBase64(file) {
83
+ return new Promise(function (resolve, reject) {
84
+ var reader = new FileReader();
85
+ reader.readAsDataURL(file);
86
+
87
+ reader.onload = function () {
88
+ return resolve(reader.result);
89
+ };
90
+
91
+ reader.onerror = function (error) {
92
+ return reject(error);
93
+ };
94
+ });
95
+ };
96
+
97
+ exports.getBase64 = getBase64;
98
+
99
+ var reactAttributes = function reactAttributes(o) {
100
+ return (0, _toStyle.object)(o, {
101
+ camelize: true,
102
+ addUnits: false
103
+ });
104
+ };
105
+
106
+ exports.reactAttributes = reactAttributes;
107
+
108
+ var attributesToMap = function attributesToMap(el) {
109
+ return function (acc, attribute) {
110
+ var value = el.getAttribute(attribute);
111
+
112
+ if (value) {
113
+ if (attribute === 'style') {
114
+ var styleString = el.getAttribute(attribute);
115
+ var reactStyleObject = reactAttributes(parseStyleString(styleString));
116
+ acc['style'] = reactStyleObject;
117
+ } else {
118
+ acc[attribute] = el.getAttribute(attribute);
119
+ }
120
+ }
121
+
122
+ return acc;
123
+ };
124
+ };
125
+
126
+ var attributes = ['border', 'cellpadding', 'cellspacing', 'class', 'style'];
127
+ /**
128
+ * Serializer rules.
129
+ *
130
+ * @type {Array}
131
+ */
132
+
133
+ var blocks = {
134
+ deserialize: function deserialize(el, next) {
135
+ log('[blocks:deserialize] block: ', el);
136
+ var block = BLOCK_TAGS[el.tagName.toLowerCase()];
137
+ if (!block) return;
138
+ log('[blocks:deserialize] block: ', block);
139
+
140
+ if (el.childNodes.length === 1) {
141
+ var cn = el.childNodes[0];
142
+
143
+ if (cn && cn.tagName && cn.tagName.toLowerCase() === block) {
144
+ log('[we have a child node of the same]...');
145
+ return;
146
+ }
147
+ }
148
+
149
+ return {
150
+ object: 'block',
151
+ type: block,
152
+
153
+ /**
154
+ * Here for rendering styles for all block elements
155
+ */
156
+ data: {
157
+ attributes: attributes.reduce(attributesToMap(el), {})
158
+ },
159
+ nodes: next(el.childNodes)
160
+ };
161
+ },
162
+ serialize: function serialize(object, children) {
163
+ if (object.object !== 'block') return;
164
+ var jsonData = object.data.toJSON();
165
+ log('[blocks:serialize] object: ', object, children);
166
+ var key;
167
+
168
+ for (key in BLOCK_TAGS) {
169
+ if (BLOCK_TAGS[key] === object.type) {
170
+ var Tag = key;
171
+ return /*#__PURE__*/_react["default"].createElement(Tag, jsonData.attributes, children);
172
+ }
173
+ }
174
+ }
175
+ };
176
+ var marks = {
177
+ deserialize: function deserialize(el, next) {
178
+ var mark = MARK_TAGS[el.tagName.toLowerCase()];
179
+ if (!mark) return;
180
+ log('[deserialize] mark: ', mark);
181
+ return {
182
+ object: 'mark',
183
+ type: mark,
184
+ nodes: next(el.childNodes)
185
+ };
186
+ },
187
+ serialize: function serialize(object, children) {
188
+ if (_slate.Mark.isMark(object)) {
189
+ for (var key in MARK_TAGS) {
190
+ if (MARK_TAGS[key] === object.type) {
191
+ var Tag = key;
192
+ return /*#__PURE__*/_react["default"].createElement(Tag, null, children);
193
+ }
194
+ }
195
+ }
196
+ }
197
+ };
198
+
199
+ var findPreviousText = function findPreviousText(el) {
200
+ if (el.nodeName === '#text') {
201
+ return el;
202
+ }
203
+
204
+ if (el.previousSibling) {
205
+ return findPreviousText(el.previousSibling);
206
+ }
207
+
208
+ return null;
209
+ };
210
+
211
+ var TEXT_RULE = {
212
+ deserialize: function deserialize(el) {
213
+ /**
214
+ * This needs to be called on the dom element in order to merge the adjacent text nodes together
215
+ * */
216
+ el.normalize();
217
+
218
+ if (el.tagName && el.tagName.toLowerCase() === 'br') {
219
+ return {
220
+ object: 'text',
221
+ leaves: [{
222
+ object: 'leaf',
223
+ text: '\n'
224
+ }]
225
+ };
226
+ }
227
+
228
+ if (el.nodeName === '#text') {
229
+ if (el.nodeValue && el.nodeValue.match(/<!--.*?-->/)) return;
230
+ log('[text:deserialize] return text object..');
231
+ return {
232
+ object: 'text',
233
+ leaves: [{
234
+ object: 'leaf',
235
+ text: el.nodeValue
236
+ }]
237
+ };
238
+ }
239
+ },
240
+ serialize: function serialize(obj, children) {
241
+ if (obj.object === 'string') {
242
+ return children.split('\n').reduce(function (array, text, i) {
243
+ if (i !== 0) array.push( /*#__PURE__*/_react["default"].createElement("br", null));
244
+ array.push(text);
245
+ return array;
246
+ }, []);
247
+ }
248
+ }
249
+ };
250
+ exports.TEXT_RULE = TEXT_RULE;
251
+ var RULES = [_list.serialization, _math.serialization, _media.serialization, _image.serialization, _table.serialization, _respArea.serialization, TEXT_RULE, blocks, marks];
252
+
253
+ function allWhitespace(node) {
254
+ // Use ECMA-262 Edition 3 String and RegExp features
255
+ return !/[^\t\n\r ]/.test(node.textContent);
256
+ }
257
+
258
+ function defaultParseHtml(html) {
259
+ if (typeof DOMParser === 'undefined') {
260
+ throw new Error('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.');
261
+ }
262
+
263
+ var parsed = new DOMParser().parseFromString(html, 'text/html');
264
+ var body = parsed.body;
265
+ var textNodes = document.createTreeWalker(body, NodeFilter.SHOW_TEXT, null, null);
266
+ var n = textNodes.nextNode();
267
+
268
+ while (n) {
269
+ if (allWhitespace(n) || n.nodeValue === "\u200B") {
270
+ n.parentNode.removeChild(n);
271
+ }
272
+
273
+ n = textNodes.nextNode();
274
+ }
275
+
276
+ return body;
277
+ }
278
+ /** If this lib is used on the server side, we need to bypass using the DOMParser - just put in a stub. */
279
+
280
+
281
+ var parseHtml = typeof window === 'undefined' ? function () {
282
+ return {
283
+ childNodes: []
284
+ };
285
+ } : defaultParseHtml;
286
+ var serializer = new _slateHtmlSerializer["default"]({
287
+ defaultBlock: 'div',
288
+ rules: RULES,
289
+ parseHtml: parseHtml
290
+ });
291
+
292
+ var _extends = Object.assign || function (target) {
293
+ for (var i = 1; i < arguments.length; i++) {
294
+ var source = arguments[i];
295
+
296
+ for (var key in source) {
297
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
298
+ target[key] = source[key];
299
+ }
300
+ }
301
+ }
302
+
303
+ return target;
304
+ };
305
+ /**
306
+ * This is needed in order to override the function that eventually leads
307
+ * to the max iteration of 12, which in most cases it's not enough. The newer versions
308
+ * have a different way to calculate this, but updating to a newer version of slate
309
+ * requires a lot of work fixing other issues. So we just increase the rules by 1000,
310
+ * which means a lot of iterations.
311
+ * Below is the code that calculates the max iterations.
312
+ * var max = schema.stack.plugins.length + schema.rules.length + 1;
313
+ */
314
+
315
+
316
+ serializer.deserialize = function deserialize(html) {
317
+ var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
318
+ var _options$toJSON = options.toJSON;
319
+ var toJSON = _options$toJSON === undefined ? false : _options$toJSON;
320
+ var defaultBlock = this.defaultBlock;
321
+ var parseHtml = this.parseHtml;
322
+ var fragment = parseHtml(html);
323
+ var children = Array.from(fragment.childNodes);
324
+ var nodes = this.deserializeElements(children); // COMPAT: ensure that all top-level inline nodes are wrapped into a block.
325
+
326
+ nodes = nodes.reduce(function (memo, node, i, original) {
327
+ if (node.object === 'block') {
328
+ memo.push(node);
329
+ return memo;
330
+ }
331
+
332
+ if (i > 0 && original[i - 1].object !== 'block') {
333
+ var _block = memo[memo.length - 1];
334
+
335
+ _block.nodes.push(node);
336
+
337
+ return memo;
338
+ }
339
+
340
+ var block = _extends({
341
+ object: 'block',
342
+ data: {},
343
+ isVoid: false
344
+ }, defaultBlock, {
345
+ nodes: [node]
346
+ });
347
+
348
+ memo.push(block);
349
+ return memo;
350
+ }, []);
351
+
352
+ if (nodes.length === 0) {
353
+ nodes = [_extends({
354
+ object: 'block',
355
+ data: {},
356
+ isVoid: false
357
+ }, defaultBlock, {
358
+ nodes: [{
359
+ object: 'text',
360
+ leaves: [{
361
+ object: 'leaf',
362
+ text: '',
363
+ marks: []
364
+ }]
365
+ }]
366
+ })];
367
+ }
368
+
369
+ var json = {
370
+ object: 'value',
371
+ document: {
372
+ object: 'document',
373
+ data: {},
374
+ nodes: nodes
375
+ },
376
+ schema: {
377
+ rules: []
378
+ }
379
+ };
380
+ var i;
381
+
382
+ for (i = 0; i < 3000; i++) {
383
+ json.schema.rules.push({
384
+ match: {
385
+ object: 'document'
386
+ },
387
+ nodes: [{
388
+ match: {
389
+ object: 'block'
390
+ }
391
+ }]
392
+ });
393
+ }
394
+
395
+ var ret = toJSON ? json : _slate.Value.fromJSON(json);
396
+
397
+ if (ret) {
398
+ return ret;
399
+ }
400
+
401
+ return null;
402
+ };
403
+
404
+ var htmlToValue = function htmlToValue(html) {
405
+ try {
406
+ return serializer.deserialize(html);
407
+ } catch (e) {
408
+ console.log("Couldn't parse html: ", e);
409
+ return {};
410
+ }
411
+ };
412
+
413
+ exports.htmlToValue = htmlToValue;
414
+
415
+ var valueToHtml = function valueToHtml(value) {
416
+ return serializer.serialize(value);
417
+ };
418
+ /**
419
+ *
420
+ * <div><div>a</div></div> -> <div>a</div>
421
+ *
422
+ * <div><div>a</div><div>b</div></div> -> <div>a</div><div>b</div>
423
+ * <div><div>a</div>4444<div>b</div></div> -> <div>a</div>4444<div>b</div>
424
+ */
425
+
426
+
427
+ exports.valueToHtml = valueToHtml;
428
+ //# sourceMappingURL=serialization.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/serialization.jsx"],"names":["log","BLOCK_TAGS","div","span","p","blockquote","pre","h1","h2","h3","h4","h5","h6","MARK_TAGS","b","em","u","s","code","strong","parseStyleString","regex","match","result","exec","trim","getBase64","file","Promise","resolve","reject","reader","FileReader","readAsDataURL","onload","onerror","error","reactAttributes","o","camelize","addUnits","attributesToMap","el","acc","attribute","value","getAttribute","styleString","reactStyleObject","attributes","blocks","deserialize","next","block","tagName","toLowerCase","childNodes","length","cn","object","type","data","reduce","nodes","serialize","children","jsonData","toJSON","key","Tag","marks","mark","Mark","isMark","findPreviousText","nodeName","previousSibling","TEXT_RULE","normalize","leaves","text","nodeValue","obj","split","array","i","push","RULES","listSerialization","mathSerialization","mediaSerialization","imgSerialization","tableSerialization","responseAreaSerialization","allWhitespace","node","test","textContent","defaultParseHtml","html","DOMParser","Error","parsed","parseFromString","body","textNodes","document","createTreeWalker","NodeFilter","SHOW_TEXT","n","nextNode","parentNode","removeChild","parseHtml","window","serializer","Html","defaultBlock","rules","_extends","Object","assign","target","arguments","source","prototype","hasOwnProperty","call","options","undefined","_options$toJSON","fragment","Array","from","deserializeElements","memo","original","_block","isVoid","json","schema","ret","Value","fromJSON","htmlToValue","e","console","valueToHtml"],"mappings":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,CAArC;AACA,WAAO,EAAP;AACD;AACF,CAPM;;;;AASA,IAAME,WAAW,GAAG,SAAdA,WAAc,CAAAvG,KAAK;AAAA,SAAIuE,UAAU,CAACpD,SAAX,CAAqBnB,KAArB,CAAJ;AAAA,CAAzB;AAEP;AACA;AACA;AACA;AACA;AACA;AACA","sourcesContent":["import Html from 'slate-html-serializer';\nimport React from 'react';\nimport debug from 'debug';\nimport { object as toStyleObject } from 'to-style';\n\nimport { serialization as imgSerialization } from './plugins/image';\nimport { serialization as mathSerialization } from './plugins/math';\nimport { serialization as mediaSerialization } from './plugins/media';\nimport { serialization as listSerialization } from './plugins/list';\nimport { serialization as tableSerialization } from './plugins/table';\nimport { serialization as responseAreaSerialization } from './plugins/respArea';\nimport { Mark, Value } from 'slate';\n\nconst log = debug('@pie-lib:editable-html:serialization');\n\n/**\n * Tags to blocks.\n *\n * @type {Object}\n */\n\nexport const BLOCK_TAGS = {\n div: 'div',\n span: 'span',\n p: 'paragraph',\n blockquote: 'quote',\n pre: 'code',\n h1: 'heading-one',\n h2: 'heading-two',\n h3: 'heading-three',\n h4: 'heading-four',\n h5: 'heading-five',\n h6: 'heading-six'\n};\n\n/**\n * Tags to marks.\n *\n * @type {Object}\n */\n\nconst MARK_TAGS = {\n b: 'bold',\n em: 'italic',\n u: 'underline',\n s: 'strikethrough',\n code: 'code',\n strong: 'bold'\n};\n\nexport const parseStyleString = s => {\n const regex = /([\\w-]*)\\s*:\\s*([^;]*)/g;\n let match;\n const result = {};\n while ((match = regex.exec(s))) {\n result[match[1]] = match[2].trim();\n }\n return result;\n};\n\nexport const getBase64 = file => {\n return new Promise((resolve, reject) => {\n const reader = new FileReader();\n reader.readAsDataURL(file);\n reader.onload = () => resolve(reader.result);\n reader.onerror = error => reject(error);\n });\n};\n\nexport const reactAttributes = o => toStyleObject(o, { camelize: true, addUnits: false });\n\nconst attributesToMap = el => (acc, attribute) => {\n const value = el.getAttribute(attribute);\n if (value) {\n if (attribute === 'style') {\n const styleString = el.getAttribute(attribute);\n const reactStyleObject = reactAttributes(parseStyleString(styleString));\n acc['style'] = reactStyleObject;\n } else {\n acc[attribute] = el.getAttribute(attribute);\n }\n }\n return acc;\n};\n\nconst attributes = ['border', 'cellpadding', 'cellspacing', 'class', 'style'];\n\n/**\n * Serializer rules.\n *\n * @type {Array}\n */\n\nconst blocks = {\n deserialize(el, next) {\n log('[blocks:deserialize] block: ', el);\n const block = BLOCK_TAGS[el.tagName.toLowerCase()];\n if (!block) return;\n log('[blocks:deserialize] block: ', block);\n\n if (el.childNodes.length === 1) {\n const cn = el.childNodes[0];\n if (cn && cn.tagName && cn.tagName.toLowerCase() === block) {\n log('[we have a child node of the same]...');\n return;\n }\n }\n\n return {\n object: 'block',\n type: block,\n /**\n * Here for rendering styles for all block elements\n */\n data: { attributes: attributes.reduce(attributesToMap(el), {}) },\n nodes: next(el.childNodes)\n };\n },\n serialize: (object, children) => {\n if (object.object !== 'block') return;\n\n const jsonData = object.data.toJSON();\n\n log('[blocks:serialize] object: ', object, children);\n let key;\n\n for (key in BLOCK_TAGS) {\n if (BLOCK_TAGS[key] === object.type) {\n const Tag = key;\n\n return <Tag {...jsonData.attributes}>{children}</Tag>;\n }\n }\n }\n};\n\nconst marks = {\n deserialize(el, next) {\n const mark = MARK_TAGS[el.tagName.toLowerCase()];\n if (!mark) return;\n log('[deserialize] mark: ', mark);\n return {\n object: 'mark',\n type: mark,\n nodes: next(el.childNodes)\n };\n },\n serialize(object, children) {\n if (Mark.isMark(object)) {\n for (var key in MARK_TAGS) {\n if (MARK_TAGS[key] === object.type) {\n const Tag = key;\n return <Tag>{children}</Tag>;\n }\n }\n }\n }\n};\n\nconst findPreviousText = el => {\n if (el.nodeName === '#text') {\n return el;\n }\n\n if (el.previousSibling) {\n return findPreviousText(el.previousSibling);\n }\n\n return null;\n};\n\nexport const TEXT_RULE = {\n deserialize(el) {\n /**\n * This needs to be called on the dom element in order to merge the adjacent text nodes together\n * */\n el.normalize();\n\n if (el.tagName && el.tagName.toLowerCase() === 'br') {\n return {\n object: 'text',\n leaves: [\n {\n object: 'leaf',\n text: '\\n'\n }\n ]\n };\n }\n\n if (el.nodeName === '#text') {\n if (el.nodeValue && el.nodeValue.match(/<!--.*?-->/)) return;\n\n log('[text:deserialize] return text object..');\n return {\n object: 'text',\n leaves: [\n {\n object: 'leaf',\n text: el.nodeValue\n }\n ]\n };\n }\n },\n\n serialize(obj, children) {\n if (obj.object === 'string') {\n return children.split('\\n').reduce((array, text, i) => {\n if (i !== 0) array.push(<br />);\n array.push(text);\n return array;\n }, []);\n }\n }\n};\n\nconst RULES = [\n listSerialization,\n mathSerialization,\n mediaSerialization,\n imgSerialization,\n tableSerialization,\n responseAreaSerialization,\n TEXT_RULE,\n blocks,\n marks\n];\n\nfunction allWhitespace(node) {\n // Use ECMA-262 Edition 3 String and RegExp features\n return !/[^\\t\\n\\r ]/.test(node.textContent);\n}\n\nfunction defaultParseHtml(html) {\n if (typeof DOMParser === 'undefined') {\n throw new Error(\n '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.'\n );\n }\n\n const parsed = new DOMParser().parseFromString(html, 'text/html');\n\n const { body } = parsed;\n var textNodes = document.createTreeWalker(body, NodeFilter.SHOW_TEXT, null, null);\n var n = textNodes.nextNode();\n\n while (n) {\n if (allWhitespace(n) || n.nodeValue === '\\u200B') {\n n.parentNode.removeChild(n);\n }\n n = textNodes.nextNode();\n }\n\n return body;\n}\n\n/** If this lib is used on the server side, we need to bypass using the DOMParser - just put in a stub. */\nconst parseHtml =\n typeof window === 'undefined'\n ? () => ({\n childNodes: []\n })\n : defaultParseHtml;\n\nconst serializer = new Html({\n defaultBlock: 'div',\n rules: RULES,\n parseHtml\n});\n\nconst _extends =\n Object.assign ||\n function(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n };\n\n/**\n * This is needed in order to override the function that eventually leads\n * to the max iteration of 12, which in most cases it's not enough. The newer versions\n * have a different way to calculate this, but updating to a newer version of slate\n * requires a lot of work fixing other issues. So we just increase the rules by 1000,\n * which means a lot of iterations.\n * Below is the code that calculates the max iterations.\n * var max = schema.stack.plugins.length + schema.rules.length + 1;\n */\nserializer.deserialize = function deserialize(html) {\n const options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n const _options$toJSON = options.toJSON;\n const toJSON = _options$toJSON === undefined ? false : _options$toJSON;\n const defaultBlock = this.defaultBlock;\n const parseHtml = this.parseHtml;\n\n const fragment = parseHtml(html);\n const children = Array.from(fragment.childNodes);\n let nodes = this.deserializeElements(children);\n\n // COMPAT: ensure that all top-level inline nodes are wrapped into a block.\n nodes = nodes.reduce(function(memo, node, i, original) {\n if (node.object === 'block') {\n memo.push(node);\n return memo;\n }\n\n if (i > 0 && original[i - 1].object !== 'block') {\n const _block = memo[memo.length - 1];\n\n _block.nodes.push(node);\n return memo;\n }\n\n const block = _extends({ object: 'block', data: {}, isVoid: false }, defaultBlock, {\n nodes: [node]\n });\n\n memo.push(block);\n return memo;\n }, []);\n\n if (nodes.length === 0) {\n nodes = [\n _extends({ object: 'block', data: {}, isVoid: false }, defaultBlock, {\n nodes: [{ object: 'text', leaves: [{ object: 'leaf', text: '', marks: [] }] }]\n })\n ];\n }\n\n const json = {\n object: 'value',\n document: {\n object: 'document',\n data: {},\n nodes: nodes\n },\n schema: {\n rules: []\n }\n };\n\n let i;\n\n for (i = 0; i < 3000; i++) {\n json.schema.rules.push({\n match: { object: 'document' },\n nodes: [{ match: { object: 'block' } }]\n });\n }\n\n const ret = toJSON ? json : Value.fromJSON(json);\n\n if (ret) {\n return ret;\n }\n\n return null;\n};\n\nexport const htmlToValue = html => {\n try {\n return serializer.deserialize(html);\n } catch (e) {\n console.log(\"Couldn't parse html: \", e);\n return {};\n }\n};\n\nexport const valueToHtml = value => serializer.serialize(value);\n\n/**\n *\n * <div><div>a</div></div> -> <div>a</div>\n *\n * <div><div>a</div><div>b</div></div> -> <div>a</div><div>b</div>\n * <div><div>a</div>4444<div>b</div></div> -> <div>a</div>4444<div>b</div>\n */\n"],"file":"serialization.js"}
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.primary = void 0;
7
+ var primary = '#304ffe';
8
+ exports.primary = primary;
9
+ //# sourceMappingURL=theme.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/theme.js"],"names":["primary"],"mappings":";;;;;;AAAO,IAAMA,OAAO,GAAG,SAAhB","sourcesContent":["export const primary = '#304ffe';\n"],"file":"theme.js"}
@@ -0,0 +1,52 @@
1
+ {
2
+ "name": "@pie-lib/editable-html",
3
+ "version": "9.0.5",
4
+ "description": "",
5
+ "license": "ISC",
6
+ "main": "lib/index.js",
7
+ "module": "src/index.jsx",
8
+ "author": "pie-framework developers",
9
+ "dependencies": {
10
+ "@material-ui/core": "^3.8.3",
11
+ "@material-ui/icons": "^3.0.2",
12
+ "@material-ui/styles": "^3.0.0-alpha.10",
13
+ "@pie-lib/drag": "^1.1.52",
14
+ "@pie-lib/math-rendering": "^2.4.5",
15
+ "@pie-lib/math-toolbar": "^1.10.3",
16
+ "@pie-lib/render-ui": "^4.13.1",
17
+ "change-case": "^3.0.2",
18
+ "classnames": "^2.2.6",
19
+ "debug": "^4.1.1",
20
+ "immutable": "^4.0.0-rc.12",
21
+ "keycode": "^2.2.0",
22
+ "lodash": "^4.17.11",
23
+ "prop-types": "^15.6.2",
24
+ "react-attr-converter": "^0.3.1",
25
+ "react-jss": "^8.6.1",
26
+ "react-portal": "^4.2.0",
27
+ "slate": "^0.36.2",
28
+ "slate-dev-environment": "^0.2.0",
29
+ "slate-edit-list": "^0.11.3",
30
+ "slate-edit-table": "^0.17.0",
31
+ "slate-html-serializer": "^0.6.12",
32
+ "slate-plain-serializer": "^0.5.26",
33
+ "slate-prop-types": "^0.4.38",
34
+ "slate-react": "^0.14.3",
35
+ "slate-schema-violations": "^0.1.39",
36
+ "slate-soft-break": "^0.8.1",
37
+ "to-style": "^1.3.3"
38
+ },
39
+ "devDependencies": {
40
+ "@pie-framework/mathquill": "^1.1.3",
41
+ "react": "^16.8.1",
42
+ "react-dom": "^16.9.0"
43
+ },
44
+ "peerDependencies": {
45
+ "react": "^16.8.1"
46
+ },
47
+ "publishConfig": {
48
+ "access": "public"
49
+ },
50
+ "gitHead": "45e12d524142a6576c9ebb9292de01a34e88fc03",
51
+ "scripts": {}
52
+ }
@@ -0,0 +1,59 @@
1
+ module.exports = {
2
+ document: {
3
+ nodes: [
4
+ {
5
+ object: 'block',
6
+ type: 'div',
7
+ nodes: [
8
+ {
9
+ object: 'block',
10
+ type: 'paragraph',
11
+ nodes: [
12
+ {
13
+ object: 'text',
14
+ leaves: [
15
+ {
16
+ text: 'foo'
17
+ }
18
+ ]
19
+ },
20
+
21
+ {
22
+ object: 'inline',
23
+ type: 'image',
24
+ isVoid: true,
25
+ data: {
26
+ src:
27
+ 'https://img.washingtonpost.com/wp-apps/imrs.php?src=https://img.washingtonpost.com/news/speaking-of-science/wp-content/uploads/sites/36/2015/10/as12-49-7278-1024x1024.jpg&w=1484'
28
+ }
29
+ },
30
+
31
+ {
32
+ object: 'text',
33
+ leaves: [
34
+ {
35
+ text: 'bar'
36
+ }
37
+ ]
38
+ }
39
+ ]
40
+ }
41
+ ]
42
+ },
43
+ {
44
+ object: 'block',
45
+ type: 'paragraph',
46
+ nodes: [
47
+ {
48
+ object: 'text',
49
+ leaves: [
50
+ {
51
+ text: 'text'
52
+ }
53
+ ]
54
+ }
55
+ ]
56
+ }
57
+ ]
58
+ }
59
+ };