@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,749 @@
1
+ import { Editor as SlateEditor, findNode, getEventRange, getEventTransfer } from 'slate-react';
2
+ import SlateTypes from 'slate-prop-types';
3
+
4
+ import isEqual from 'lodash/isEqual';
5
+ import * as serialization from './serialization';
6
+ import PropTypes from 'prop-types';
7
+ import React from 'react';
8
+ import { Value, Block, Inline } from 'slate';
9
+ import { buildPlugins, ALL_PLUGINS, DEFAULT_PLUGINS } from './plugins';
10
+ import debug from 'debug';
11
+ import { withStyles } from '@material-ui/core/styles';
12
+ import classNames from 'classnames';
13
+ import { color } from '@pie-lib/render-ui';
14
+ import Plain from 'slate-plain-serializer';
15
+
16
+ import { getBase64 } from './serialization';
17
+
18
+ export { ALL_PLUGINS, DEFAULT_PLUGINS, serialization };
19
+
20
+ const log = debug('editable-html:editor');
21
+
22
+ const defaultToolbarOpts = {
23
+ position: 'bottom',
24
+ alignment: 'left',
25
+ alwaysVisible: false,
26
+ showDone: true,
27
+ doneOn: 'blur'
28
+ };
29
+
30
+ const defaultResponseAreaProps = {
31
+ options: {},
32
+ respAreaToolbar: () => {},
33
+ onHandleAreaChange: () => {}
34
+ };
35
+
36
+ const defaultLanguageCharactersProps = [];
37
+
38
+ const createToolbarOpts = toolbarOpts => {
39
+ return {
40
+ ...defaultToolbarOpts,
41
+ ...toolbarOpts
42
+ };
43
+ };
44
+
45
+ export class Editor extends React.Component {
46
+ static propTypes = {
47
+ autoFocus: PropTypes.bool,
48
+ editorRef: PropTypes.func.isRequired,
49
+ onRef: PropTypes.func.isRequired,
50
+ onChange: PropTypes.func.isRequired,
51
+ onFocus: PropTypes.func,
52
+ onBlur: PropTypes.func,
53
+ onKeyDown: PropTypes.func,
54
+ focus: PropTypes.func.isRequired,
55
+ value: SlateTypes.value.isRequired,
56
+ imageSupport: PropTypes.object,
57
+ charactersLimit: PropTypes.number,
58
+ width: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
59
+ height: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
60
+ minHeight: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
61
+ maxHeight: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
62
+ classes: PropTypes.object.isRequired,
63
+ highlightShape: PropTypes.bool,
64
+ disabled: PropTypes.bool,
65
+ spellCheck: PropTypes.bool,
66
+ nonEmpty: PropTypes.bool,
67
+ disableUnderline: PropTypes.bool,
68
+ autoWidthToolbar: PropTypes.bool,
69
+ pluginProps: PropTypes.any,
70
+ placeholder: PropTypes.string,
71
+ responseAreaProps: PropTypes.shape({
72
+ type: PropTypes.oneOf([
73
+ 'explicit-constructed-response',
74
+ 'inline-dropdown',
75
+ 'drag-in-the-blank'
76
+ ]),
77
+ options: PropTypes.object,
78
+ respAreaToolbar: PropTypes.func,
79
+ onHandleAreaChange: PropTypes.func
80
+ }),
81
+ languageCharactersProps: PropTypes.arrayOf(
82
+ PropTypes.shape({
83
+ language: PropTypes.string,
84
+ characterIcon: PropTypes.string,
85
+ characters: PropTypes.arrayOf(PropTypes.arrayOf(PropTypes.string))
86
+ })
87
+ ),
88
+ toolbarOpts: PropTypes.shape({
89
+ position: PropTypes.oneOf(['bottom', 'top']),
90
+ alignment: PropTypes.oneOf(['left', 'right']),
91
+ alwaysVisible: PropTypes.bool,
92
+ showDone: PropTypes.bool,
93
+ doneOn: PropTypes.string
94
+ }),
95
+ activePlugins: PropTypes.arrayOf(values => {
96
+ const allValid = values.every(v => ALL_PLUGINS.includes(v));
97
+
98
+ return (
99
+ !allValid &&
100
+ new Error(`Invalid values: ${values}, values must be one of [${ALL_PLUGINS.join(',')}]`)
101
+ );
102
+ }),
103
+ className: PropTypes.string,
104
+ maxImageWidth: PropTypes.number,
105
+ maxImageHeight: PropTypes.number
106
+ };
107
+
108
+ static defaultProps = {
109
+ disableUnderline: true,
110
+ onFocus: () => {},
111
+ onBlur: () => {},
112
+ onKeyDown: () => {},
113
+ toolbarOpts: defaultToolbarOpts,
114
+ responseAreaProps: defaultResponseAreaProps,
115
+ languageCharactersProps: defaultLanguageCharactersProps
116
+ };
117
+
118
+ constructor(props) {
119
+ super(props);
120
+ this.state = {
121
+ value: props.value,
122
+ toolbarOpts: createToolbarOpts(props.toolbarOpts)
123
+ };
124
+
125
+ this.onResize = () => {
126
+ props.onChange(this.state.value, true);
127
+ };
128
+
129
+ this.handlePlugins(this.props);
130
+ }
131
+
132
+ handlePlugins = props => {
133
+ const normalizedResponseAreaProps = {
134
+ ...defaultResponseAreaProps,
135
+ ...props.responseAreaProps
136
+ };
137
+
138
+ this.plugins = buildPlugins(props.activePlugins, {
139
+ math: {
140
+ onClick: this.onMathClick,
141
+ onFocus: this.onPluginFocus,
142
+ onBlur: this.onPluginBlur
143
+ },
144
+ image: {
145
+ onDelete:
146
+ props.imageSupport &&
147
+ props.imageSupport.delete &&
148
+ ((src, done) => {
149
+ props.imageSupport.delete(src, e => {
150
+ done(e, this.state.value);
151
+ });
152
+ }),
153
+ insertImageRequested:
154
+ props.imageSupport &&
155
+ (getHandler => {
156
+ /**
157
+ * The handler is the object through which the outer context
158
+ * communicates file upload events like: fileChosen, cancel, progress
159
+ */
160
+ const handler = getHandler(() => this.state.value);
161
+ props.imageSupport.add(handler);
162
+ }),
163
+ onFocus: this.onPluginFocus,
164
+ onBlur: this.onPluginBlur,
165
+ maxImageWidth: this.props.maxImageWidth,
166
+ maxImageHeight: this.props.maxImageHeight
167
+ },
168
+ toolbar: {
169
+ /**
170
+ * To minimize converting html -> state -> html
171
+ * We only emit markup once 'done' is clicked.
172
+ */
173
+ disableUnderline: props.disableUnderline,
174
+ autoWidth: props.autoWidthToolbar,
175
+ onDone: () => {
176
+ const { nonEmpty } = props;
177
+
178
+ log('[onDone]');
179
+ this.setState({ toolbarInFocus: false, focusedNode: null });
180
+ this.editor.blur();
181
+
182
+ if (nonEmpty && this.state.value.startText?.text?.length === 0) {
183
+ this.resetValue(true).then(() => {
184
+ this.onEditingDone();
185
+ });
186
+ } else {
187
+ this.onEditingDone();
188
+ }
189
+ }
190
+ },
191
+ table: {
192
+ onFocus: () => {
193
+ log('[table:onFocus]...');
194
+ this.onPluginFocus();
195
+ },
196
+ onBlur: () => {
197
+ log('[table:onBlur]...');
198
+ this.onPluginBlur();
199
+ }
200
+ },
201
+ responseArea: {
202
+ type: normalizedResponseAreaProps.type,
203
+ options: normalizedResponseAreaProps.options,
204
+ maxResponseAreas: normalizedResponseAreaProps.maxResponseAreas,
205
+ respAreaToolbar: normalizedResponseAreaProps.respAreaToolbar,
206
+ onHandleAreaChange: normalizedResponseAreaProps.onHandleAreaChange,
207
+ error: normalizedResponseAreaProps.error,
208
+ onFocus: () => {
209
+ log('[table:onFocus]...');
210
+ this.onPluginFocus();
211
+ },
212
+ onBlur: () => {
213
+ log('[table:onBlur]...');
214
+ this.onPluginBlur();
215
+ }
216
+ },
217
+ languageCharacters: props.languageCharactersProps,
218
+ media: {
219
+ focus: this.focus,
220
+ createChange: () => this.state.value.change(),
221
+ onChange: this.onChange
222
+ }
223
+ });
224
+ };
225
+
226
+ componentDidMount() {
227
+ // onRef is needed to get the ref of the component because we export it using withStyles
228
+ this.props.onRef(this);
229
+
230
+ window.addEventListener('resize', this.onResize);
231
+
232
+ if (this.editor && this.props.autoFocus) {
233
+ Promise.resolve().then(() => {
234
+ if (this.editor) {
235
+ const editorDOM = document.querySelector(
236
+ `[data-key="${this.editor.value.document.key}"]`
237
+ );
238
+
239
+ this.editor.focus();
240
+
241
+ if (editorDOM) {
242
+ editorDOM.focus();
243
+ }
244
+ }
245
+ });
246
+ }
247
+ }
248
+
249
+ componentWillReceiveProps(nextProps) {
250
+ const { toolbarOpts } = this.state;
251
+ const newToolbarOpts = createToolbarOpts(nextProps.toolbarOpts);
252
+
253
+ if (!isEqual(newToolbarOpts, toolbarOpts)) {
254
+ this.setState({
255
+ toolbarOpts: newToolbarOpts
256
+ });
257
+ }
258
+
259
+ if (!isEqual(nextProps.languageCharactersProps, this.props.languageCharactersProps)) {
260
+ this.handlePlugins(nextProps);
261
+ }
262
+ }
263
+
264
+ componentDidUpdate() {
265
+ // The cursor is on a zero width element and when that is placed near void elements, it is not visible
266
+ // so we increase the width to at least 2px in order for the user to see it
267
+ const zeroWidthEls = document.querySelectorAll('[data-slate-zero-width="z"]');
268
+
269
+ Array.from(zeroWidthEls).forEach(el => {
270
+ el.style.minWidth = '2px';
271
+ el.style.display = 'inline-block';
272
+ });
273
+ }
274
+
275
+ onPluginBlur = e => {
276
+ log('[onPluginBlur]', e && e.relatedTarget);
277
+ const target = e && e.relatedTarget;
278
+
279
+ const node = target ? findNode(target, this.state.value) : null;
280
+ log('[onPluginBlur] node: ', node);
281
+ this.setState({ focusedNode: node }, () => {
282
+ this.resetValue();
283
+ });
284
+ };
285
+
286
+ onPluginFocus = e => {
287
+ log('[onPluginFocus]', e && e.target);
288
+ const target = e && e.target;
289
+ if (target) {
290
+ const node = findNode(target, this.state.value);
291
+ log('[onPluginFocus] node: ', node);
292
+
293
+ const stashedValue = this.state.stashedValue || this.state.value;
294
+ this.setState({ focusedNode: node, stashedValue });
295
+ } else {
296
+ this.setState({ focusedNode: null });
297
+ }
298
+ this.stashValue();
299
+ };
300
+
301
+ onMathClick = node => {
302
+ this.editor.change(c => c.collapseToStartOf(node));
303
+ this.setState({ selectedNode: node });
304
+ };
305
+
306
+ onEditingDone = () => {
307
+ log('[onEditingDone]');
308
+ this.setState({ stashedValue: null, focusedNode: null });
309
+ log('[onEditingDone] value: ', this.state.value);
310
+ this.props.onChange(this.state.value, true);
311
+ };
312
+
313
+ /**
314
+ * Remove onResize event listener
315
+ */
316
+ componentWillUnmount() {
317
+ window.removeEventListener('resize', this.onResize);
318
+ }
319
+
320
+ // Allowing time for onChange to take effect if it is called
321
+ handleBlur = resolve => {
322
+ const { nonEmpty } = this.props;
323
+ const {
324
+ toolbarOpts: { doneOn }
325
+ } = this.state;
326
+
327
+ this.setState({ toolbarInFocus: false, focusedNode: null });
328
+
329
+ if (this.editor) {
330
+ this.editor.blur();
331
+ }
332
+
333
+ if (doneOn === 'blur') {
334
+ if (nonEmpty && this.state.value.startText?.text?.length === 0) {
335
+ this.resetValue(true).then(() => {
336
+ this.onEditingDone();
337
+ resolve();
338
+ });
339
+ } else {
340
+ this.onEditingDone();
341
+ resolve();
342
+ }
343
+ }
344
+ };
345
+
346
+ onBlur = event => {
347
+ log('[onBlur]');
348
+ const target = event.relatedTarget;
349
+
350
+ const node = target ? findNode(target, this.state.value) : null;
351
+
352
+ log('[onBlur] node: ', node);
353
+
354
+ return new Promise(resolve => {
355
+ this.setState({ focusedNode: !node ? null : node }, this.handleBlur.bind(this, resolve));
356
+ this.props.onBlur(event);
357
+ });
358
+ };
359
+
360
+ handleDomBlur = e => {
361
+ const editorDOM = document.querySelector(`[data-key="${this.state.value.document.key}"]`);
362
+
363
+ setTimeout(() => {
364
+ if (!this.wrapperRef) {
365
+ return;
366
+ }
367
+
368
+ const editorElement =
369
+ !editorDOM || document.activeElement.closest(`[class*="${editorDOM.className}"]`);
370
+ const toolbarElement =
371
+ !this.toolbarRef ||
372
+ document.activeElement.closest(`[class*="${this.toolbarRef.className}"]`);
373
+ const isInCurrentComponent =
374
+ this.wrapperRef.contains(editorElement) || this.wrapperRef.contains(toolbarElement);
375
+
376
+ if (!isInCurrentComponent) {
377
+ editorDOM.removeEventListener('blur', this.handleDomBlur);
378
+ this.onBlur(e);
379
+ }
380
+ }, 50);
381
+ };
382
+
383
+ /*
384
+ * Needs to be wrapped otherwise it causes issues because of race conditions
385
+ * Known issue for slatejs. See: https://github.com/ianstormtaylor/slate/issues/2097
386
+ * Using timeout I wasn't able to test this
387
+ *
388
+ * Note: The use of promises has been causing issues with MathQuill
389
+ * */
390
+ onFocus = () =>
391
+ new Promise(resolve => {
392
+ const editorDOM = document.querySelector(`[data-key="${this.state.value.document.key}"]`);
393
+
394
+ log('[onFocus]', document.activeElement);
395
+
396
+ /**
397
+ * This is a temporary hack - @see changeData below for some more information.
398
+ */
399
+ if (this.__TEMPORARY_CHANGE_DATA) {
400
+ const { key, data } = this.__TEMPORARY_CHANGE_DATA;
401
+ const domEl = document.querySelector(`[data-key="${key}"]`);
402
+
403
+ if (domEl) {
404
+ let change = this.state.value.change().setNodeByKey(key, { data });
405
+
406
+ this.setState({ value: change.value }, () => {
407
+ this.__TEMPORARY_CHANGE_DATA = null;
408
+ });
409
+ }
410
+ }
411
+
412
+ /**
413
+ * This is needed just in case the browser decides to make the editor
414
+ * lose focus without triggering the onBlur event (can happen in a few cases).
415
+ * This will also trigger onBlur if the user clicks outside of the page when the editor
416
+ * is focused.
417
+ */
418
+ if (editorDOM === document.activeElement) {
419
+ editorDOM.removeEventListener('blur', this.handleDomBlur);
420
+ editorDOM.addEventListener('blur', this.handleDomBlur);
421
+ }
422
+
423
+ this.stashValue();
424
+ this.props.onFocus();
425
+
426
+ resolve();
427
+ });
428
+
429
+ stashValue = () => {
430
+ log('[stashValue]');
431
+ if (!this.state.stashedValue) {
432
+ this.setState({ stashedValue: this.state.value });
433
+ }
434
+ };
435
+
436
+ /**
437
+ * Reset the value if the user didn't click done.
438
+ */
439
+ resetValue = force => {
440
+ const { value, focusedNode } = this.state;
441
+
442
+ const stopReset = this.plugins.reduce((s, p) => {
443
+ return s || (p.stopReset && p.stopReset(this.state.value));
444
+ }, false);
445
+
446
+ log('[resetValue]', value.isFocused, focusedNode, 'stopReset: ', stopReset);
447
+ if ((this.state.stashedValue && !value.isFocused && !focusedNode && !stopReset) || force) {
448
+ log('[resetValue] resetting...');
449
+ log('stashed', this.state.stashedValue.document.toObject());
450
+ log('current', this.state.value.document.toObject());
451
+
452
+ const newValue = Value.fromJSON(this.state.stashedValue.toJSON());
453
+
454
+ log('newValue: ', newValue.document);
455
+ return new Promise(resolve => {
456
+ setTimeout(() => {
457
+ this.setState({ value: newValue, stashedValue: null }, () => {
458
+ log('value now: ', this.state.value.document.toJSON());
459
+ resolve();
460
+ });
461
+ }, 50);
462
+ });
463
+ } else {
464
+ return Promise.resolve({});
465
+ }
466
+ };
467
+
468
+ onChange = (change, done) => {
469
+ log('[onChange]');
470
+
471
+ const { value } = change;
472
+ const { charactersLimit } = this.props;
473
+
474
+ if (
475
+ value &&
476
+ value.document &&
477
+ value.document.text &&
478
+ value.document.text.length > charactersLimit
479
+ ) {
480
+ return;
481
+ }
482
+
483
+ this.setState({ value }, () => {
484
+ log('[onChange], call done()');
485
+
486
+ if (done) {
487
+ done();
488
+ }
489
+ });
490
+ };
491
+
492
+ UNSAFE_componentWillReceiveProps(props) {
493
+ if (!props.value.document.equals(this.props.value.document)) {
494
+ this.setState({
495
+ focus: false,
496
+ value: props.value
497
+ });
498
+ }
499
+ }
500
+
501
+ valueToSize = v => {
502
+ if (!v) {
503
+ return;
504
+ }
505
+
506
+ if (typeof v === 'string') {
507
+ if (v.endsWith('%')) {
508
+ return undefined;
509
+ } else if (v.endsWith('px') || v.endsWith('vh') || v.endsWith('vw')) {
510
+ return v;
511
+ } else {
512
+ const value = parseInt(v, 10);
513
+ return isNaN(value) ? value : `${value}px`;
514
+ }
515
+ }
516
+ if (typeof v === 'number') {
517
+ return `${v}px`;
518
+ }
519
+
520
+ return;
521
+ };
522
+
523
+ buildSizeStyle() {
524
+ const { width, minHeight, height, maxHeight } = this.props;
525
+
526
+ return {
527
+ width: this.valueToSize(width),
528
+ height: this.valueToSize(height),
529
+ minHeight: this.valueToSize(minHeight),
530
+ maxHeight: this.valueToSize(maxHeight)
531
+ };
532
+ }
533
+
534
+ validateNode = node => {
535
+ if (node.object !== 'block') return;
536
+
537
+ const last = node.nodes.last();
538
+ if (!last) return;
539
+
540
+ if (last.type !== 'image') return;
541
+
542
+ log('[validateNode] last is image..');
543
+
544
+ const parent = last.getParent(last.key);
545
+ const p = Block.getParent(last.key);
546
+ log('[validateNode] parent:', parent, p);
547
+
548
+ return undefined;
549
+ };
550
+
551
+ changeData = (key, data) => {
552
+ log('[changeData]. .. ', key, data);
553
+
554
+ /**
555
+ * HACK ALERT: We should be calling setState here and storing the change data:
556
+ *
557
+ * <code>this.setState({changeData: { key, data}})</code>
558
+ * However this is causing issues with the Mathquill instance. The 'input' event stops firing on the element and no
559
+ * more changes get through. The issues seem to be related to the promises in onBlur/onFocus. But removing these
560
+ * brings it's own problems. A major clean up is planned for this component so I've decided to temporarily settle
561
+ * on this hack rather than spend more time on this.
562
+ */
563
+
564
+ // Uncomment this line to see the bug described above.
565
+ // this.setState({changeData: {key, data}})
566
+
567
+ this.__TEMPORARY_CHANGE_DATA = { key, data };
568
+ };
569
+
570
+ focus = (pos, node) => {
571
+ const position = pos || 'end';
572
+
573
+ this.props.focus(position, node);
574
+ };
575
+
576
+ onDropPaste = async (event, change, dropContext) => {
577
+ const editor = change.editor;
578
+ const transfer = getEventTransfer(event);
579
+ const file = transfer.files && transfer.files[0];
580
+
581
+ const type = transfer.type;
582
+ const fragment = transfer.fragment;
583
+ const text = transfer.text;
584
+
585
+ if (
586
+ file &&
587
+ (file.type === 'image/jpeg' || file.type === 'image/jpg' || file.type === 'image/png')
588
+ ) {
589
+ if (!this.props.imageSupport) {
590
+ return;
591
+ }
592
+ try {
593
+ log('[onDropPaste]');
594
+ const src = await getBase64(file);
595
+ const inline = Inline.create({
596
+ type: 'image',
597
+ isVoid: true,
598
+ data: {
599
+ loading: false,
600
+ src
601
+ }
602
+ });
603
+
604
+ if (dropContext) {
605
+ this.focus();
606
+ } else {
607
+ const range = getEventRange(event, editor);
608
+ if (range) {
609
+ change.select(range);
610
+ }
611
+ }
612
+
613
+ const ch = change.insertInline(inline);
614
+ this.onChange(ch);
615
+ } catch (err) {
616
+ log('[onDropPaste] error: ', err);
617
+ }
618
+ } else if (type === 'fragment') {
619
+ change.insertFragment(fragment);
620
+ } else if (type === 'text' || type === 'html') {
621
+ if (!text) {
622
+ return;
623
+ }
624
+ const {
625
+ value: { document, selection, startBlock }
626
+ } = change;
627
+
628
+ if (startBlock.isVoid) {
629
+ return;
630
+ }
631
+
632
+ const defaultBlock = startBlock;
633
+ const defaultMarks = document.getInsertMarksAtRange(selection);
634
+ const frag = Plain.deserialize(text, {
635
+ defaultBlock,
636
+ defaultMarks
637
+ }).document;
638
+ change.insertFragment(frag);
639
+ }
640
+ };
641
+
642
+ render() {
643
+ const {
644
+ disabled,
645
+ spellCheck,
646
+ highlightShape,
647
+ classes,
648
+ className,
649
+ placeholder,
650
+ pluginProps,
651
+ onKeyDown
652
+ } = this.props;
653
+
654
+ const { value, focusedNode, toolbarOpts } = this.state;
655
+
656
+ log('[render] value: ', value);
657
+ const sizeStyle = this.buildSizeStyle();
658
+ const names = classNames(
659
+ {
660
+ [classes.withBg]: highlightShape,
661
+ [classes.toolbarOnTop]: toolbarOpts.alwaysVisible && toolbarOpts.position === 'top'
662
+ },
663
+ className
664
+ );
665
+
666
+ return (
667
+ <div
668
+ ref={ref => (this.wrapperRef = ref)}
669
+ style={{ width: sizeStyle.width }}
670
+ className={names}
671
+ >
672
+ <SlateEditor
673
+ plugins={this.plugins}
674
+ innerRef={r => {
675
+ if (r) {
676
+ this.slateEditor = r;
677
+ }
678
+ }}
679
+ ref={r => (this.editor = r && this.props.editorRef(r))}
680
+ toolbarRef={r => {
681
+ if (r) {
682
+ this.toolbarRef = r;
683
+ }
684
+ }}
685
+ value={value}
686
+ focus={this.focus}
687
+ onKeyDown={onKeyDown}
688
+ onChange={this.onChange}
689
+ onBlur={this.onBlur}
690
+ onDrop={(event, editor) => this.onDropPaste(event, editor, true)}
691
+ onPaste={(event, editor) => this.onDropPaste(event, editor)}
692
+ onFocus={this.onFocus}
693
+ onEditingDone={this.onEditingDone}
694
+ focusedNode={focusedNode}
695
+ normalize={this.normalize}
696
+ readOnly={disabled}
697
+ spellCheck={spellCheck}
698
+ className={classes.slateEditor}
699
+ style={{
700
+ minHeight: sizeStyle.minHeight,
701
+ height: sizeStyle.height,
702
+ maxHeight: sizeStyle.maxHeight
703
+ }}
704
+ pluginProps={pluginProps}
705
+ toolbarOpts={toolbarOpts}
706
+ placeholder={placeholder}
707
+ onDataChange={this.changeData}
708
+ />
709
+ </div>
710
+ );
711
+ }
712
+ }
713
+
714
+ // TODO color - hardcoded gray background and keypad colors will need to change too
715
+ const styles = {
716
+ withBg: {
717
+ backgroundColor: 'rgba(0,0,0,0.06)'
718
+ },
719
+ slateEditor: {
720
+ fontFamily: 'Roboto, sans-serif',
721
+
722
+ '& table': {
723
+ tableLayout: 'fixed',
724
+ width: '100%',
725
+ borderCollapse: 'collapse',
726
+ color: color.text(),
727
+ backgroundColor: color.background()
728
+ },
729
+ '& table:not([border="1"]) tr': {
730
+ borderTop: '1px solid #dfe2e5'
731
+ // TODO perhaps secondary color for background, for now disable
732
+ // '&:nth-child(2n)': {
733
+ // backgroundColor: '#f6f8fa'
734
+ // }
735
+ },
736
+ '& td, th': {
737
+ padding: '.6em 1em',
738
+ textAlign: 'center'
739
+ },
740
+ '& table:not([border="1"]) td, th': {
741
+ border: '1px solid #dfe2e5'
742
+ }
743
+ },
744
+ toolbarOnTop: {
745
+ marginTop: '45px'
746
+ }
747
+ };
748
+
749
+ export default withStyles(styles)(Editor);