@makeswift/runtime 0.9.12 → 0.10.0

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 (235) hide show
  1. package/dist/Box.cjs.js +3 -0
  2. package/dist/Box.cjs.js.map +1 -1
  3. package/dist/Box.es.js +4 -1
  4. package/dist/Box.es.js.map +1 -1
  5. package/dist/Button.cjs.js +3 -2
  6. package/dist/Button.cjs.js.map +1 -1
  7. package/dist/Button.es.js +4 -3
  8. package/dist/Button.es.js.map +1 -1
  9. package/dist/Carousel.cjs.js +3 -2
  10. package/dist/Carousel.cjs.js.map +1 -1
  11. package/dist/Carousel.es.js +4 -3
  12. package/dist/Carousel.es.js.map +1 -1
  13. package/dist/Countdown.cjs.js +3 -0
  14. package/dist/Countdown.cjs.js.map +1 -1
  15. package/dist/Countdown.es.js +4 -1
  16. package/dist/Countdown.es.js.map +1 -1
  17. package/dist/Divider.cjs.js +3 -0
  18. package/dist/Divider.cjs.js.map +1 -1
  19. package/dist/Divider.es.js +4 -1
  20. package/dist/Divider.es.js.map +1 -1
  21. package/dist/Embed.cjs.js +1 -0
  22. package/dist/Embed.cjs.js.map +1 -1
  23. package/dist/Embed.es.js +2 -1
  24. package/dist/Embed.es.js.map +1 -1
  25. package/dist/Form.cjs.js +13 -12
  26. package/dist/Form.cjs.js.map +1 -1
  27. package/dist/Form.es.js +5 -4
  28. package/dist/Form.es.js.map +1 -1
  29. package/dist/Image.cjs.js +11 -10
  30. package/dist/Image.cjs.js.map +1 -1
  31. package/dist/Image.es.js +11 -10
  32. package/dist/Image.es.js.map +1 -1
  33. package/dist/LiveProvider.cjs.js +3 -0
  34. package/dist/LiveProvider.cjs.js.map +1 -1
  35. package/dist/LiveProvider.es.js +5 -2
  36. package/dist/LiveProvider.es.js.map +1 -1
  37. package/dist/Navigation.cjs.js +11 -10
  38. package/dist/Navigation.cjs.js.map +1 -1
  39. package/dist/Navigation.es.js +11 -10
  40. package/dist/Navigation.es.js.map +1 -1
  41. package/dist/PreviewProvider.cjs.js +6 -3
  42. package/dist/PreviewProvider.cjs.js.map +1 -1
  43. package/dist/PreviewProvider.es.js +5 -2
  44. package/dist/PreviewProvider.es.js.map +1 -1
  45. package/dist/ReadOnlyText.cjs.js +19 -26
  46. package/dist/ReadOnlyText.cjs.js.map +1 -1
  47. package/dist/ReadOnlyText.es.js +15 -22
  48. package/dist/ReadOnlyText.es.js.map +1 -1
  49. package/dist/ReadOnlyTextV2.cjs.js +29 -26
  50. package/dist/ReadOnlyTextV2.cjs.js.map +1 -1
  51. package/dist/ReadOnlyTextV2.es.js +28 -25
  52. package/dist/ReadOnlyTextV2.es.js.map +1 -1
  53. package/dist/Root.cjs.js +3 -0
  54. package/dist/Root.cjs.js.map +1 -1
  55. package/dist/Root.es.js +4 -1
  56. package/dist/Root.es.js.map +1 -1
  57. package/dist/SocialLinks.cjs.js +6 -5
  58. package/dist/SocialLinks.cjs.js.map +1 -1
  59. package/dist/SocialLinks.es.js +7 -6
  60. package/dist/SocialLinks.es.js.map +1 -1
  61. package/dist/Text.cjs.js +12 -71
  62. package/dist/Text.cjs.js.map +1 -1
  63. package/dist/Text.es.js +13 -64
  64. package/dist/Text.es.js.map +1 -1
  65. package/dist/Video.cjs.js +1 -0
  66. package/dist/Video.cjs.js.map +1 -1
  67. package/dist/Video.es.js +2 -1
  68. package/dist/Video.es.js.map +1 -1
  69. package/dist/builder.cjs.js +2 -0
  70. package/dist/builder.cjs.js.map +1 -1
  71. package/dist/builder.es.js +2 -0
  72. package/dist/builder.es.js.map +1 -1
  73. package/dist/components.cjs.js +3 -2
  74. package/dist/components.cjs.js.map +1 -1
  75. package/dist/components.es.js +3 -2
  76. package/dist/components.es.js.map +1 -1
  77. package/dist/control-serialization.es.js +1 -1
  78. package/dist/controls.cjs.js +8 -8
  79. package/dist/controls.es.js +4 -2
  80. package/dist/controls.es.js.map +1 -1
  81. package/dist/index.cjs.js +276 -213
  82. package/dist/index.cjs.js.map +1 -1
  83. package/dist/index.cjs3.js +21 -107
  84. package/dist/index.cjs3.js.map +1 -1
  85. package/dist/index.cjs4.js +16 -57
  86. package/dist/index.cjs4.js.map +1 -1
  87. package/dist/index.cjs5.js +53 -242
  88. package/dist/index.cjs5.js.map +1 -1
  89. package/dist/index.cjs6.js +0 -41
  90. package/dist/index.cjs6.js.map +1 -1
  91. package/dist/index.cjs7.js +376 -14
  92. package/dist/index.cjs7.js.map +1 -1
  93. package/dist/index.cjs8.js +275 -11
  94. package/dist/index.cjs8.js.map +1 -1
  95. package/dist/index.es.js +270 -206
  96. package/dist/index.es.js.map +1 -1
  97. package/dist/index.es2.js +2 -2
  98. package/dist/index.es3.js +22 -103
  99. package/dist/index.es3.js.map +1 -1
  100. package/dist/index.es4.js +16 -57
  101. package/dist/index.es4.js.map +1 -1
  102. package/dist/index.es5.js +53 -240
  103. package/dist/index.es5.js.map +1 -1
  104. package/dist/index.es6.js +1 -36
  105. package/dist/index.es6.js.map +1 -1
  106. package/dist/index.es7.js +372 -16
  107. package/dist/index.es7.js.map +1 -1
  108. package/dist/index.es8.js +270 -10
  109. package/dist/index.es8.js.map +1 -1
  110. package/dist/main.cjs.js +2 -0
  111. package/dist/main.cjs.js.map +1 -1
  112. package/dist/main.es.js +2 -0
  113. package/dist/main.es.js.map +1 -1
  114. package/dist/next.cjs.js +3 -0
  115. package/dist/next.cjs.js.map +1 -1
  116. package/dist/next.es.js +4 -1
  117. package/dist/next.es.js.map +1 -1
  118. package/dist/prop-controllers.cjs.js +2 -0
  119. package/dist/prop-controllers.cjs.js.map +1 -1
  120. package/dist/prop-controllers.es.js +2 -0
  121. package/dist/prop-controllers.es.js.map +1 -1
  122. package/dist/react-page.cjs.js +1450 -65
  123. package/dist/react-page.cjs.js.map +1 -1
  124. package/dist/react-page.es.js +1427 -66
  125. package/dist/react-page.es.js.map +1 -1
  126. package/dist/react.cjs.js +3 -0
  127. package/dist/react.cjs.js.map +1 -1
  128. package/dist/react.es.js +3 -0
  129. package/dist/react.es.js.map +1 -1
  130. package/dist/slate.cjs.js +33 -391
  131. package/dist/slate.cjs.js.map +1 -1
  132. package/dist/slate.es.js +15 -376
  133. package/dist/slate.es.js.map +1 -1
  134. package/dist/text-input.cjs.js +0 -22
  135. package/dist/text-input.cjs.js.map +1 -1
  136. package/dist/text-input.es.js +1 -18
  137. package/dist/text-input.es.js.map +1 -1
  138. package/dist/types/src/components/builtin/Text/Text.d.ts +3 -4
  139. package/dist/types/src/components/builtin/Text/Text.d.ts.map +1 -1
  140. package/dist/types/src/components/builtin/Text/register.d.ts.map +1 -1
  141. package/dist/types/src/controls/rich-text/fixtures/v2-data-types.d.ts.map +1 -1
  142. package/dist/types/src/controls/rich-text/rich-text.d.ts +0 -1
  143. package/dist/types/src/controls/rich-text/rich-text.d.ts.map +1 -1
  144. package/dist/types/src/controls/rich-text/translation.d.ts.map +1 -1
  145. package/dist/types/src/controls/rich-text-v2/plugin.d.ts +29 -0
  146. package/dist/types/src/controls/rich-text-v2/plugin.d.ts.map +1 -0
  147. package/dist/types/src/controls/rich-text-v2/rich-text-v2.d.ts +17 -31
  148. package/dist/types/src/controls/rich-text-v2/rich-text-v2.d.ts.map +1 -1
  149. package/dist/types/src/next/client.d.ts.map +1 -1
  150. package/dist/types/src/prop-controllers/descriptors.d.ts +1 -1
  151. package/dist/types/src/prop-controllers/descriptors.d.ts.map +1 -1
  152. package/dist/types/src/prop-controllers/introspection.d.ts.map +1 -1
  153. package/dist/types/src/runtimes/react/controls/control.d.ts +1 -1
  154. package/dist/types/src/runtimes/react/controls/control.d.ts.map +1 -1
  155. package/dist/types/src/{components/builtin/Text → runtimes/react/controls/rich-text}/EditableText/editable-text.d.ts +4 -3
  156. package/dist/types/src/runtimes/react/controls/rich-text/EditableText/editable-text.d.ts.map +1 -0
  157. package/dist/types/src/runtimes/react/controls/rich-text/EditableText/index.d.ts.map +1 -0
  158. package/dist/types/src/runtimes/react/controls/rich-text/EditableText/useSyncDOMSelection.d.ts.map +1 -0
  159. package/dist/types/src/{components/builtin/Text → runtimes/react/controls/rich-text}/EditableText/useSyncWithBuilder.d.ts +1 -1
  160. package/dist/types/src/runtimes/react/controls/rich-text/EditableText/useSyncWithBuilder.d.ts.map +1 -0
  161. package/dist/types/src/{components/builtin/Text → runtimes/react/controls/rich-text}/ReadOnlyText.d.ts +2 -2
  162. package/dist/types/src/runtimes/react/controls/rich-text/ReadOnlyText.d.ts.map +1 -0
  163. package/dist/types/src/{components/builtin/Text → runtimes/react/controls/rich-text}/components/Element/block.d.ts +1 -1
  164. package/dist/types/src/runtimes/react/controls/rich-text/components/Element/block.d.ts.map +1 -0
  165. package/dist/types/src/runtimes/react/controls/rich-text/components/Element/element.d.ts.map +1 -0
  166. package/dist/types/src/runtimes/react/controls/rich-text/components/Element/index.d.ts.map +1 -0
  167. package/dist/types/src/{components/builtin/Text → runtimes/react/controls/rich-text}/components/Element/inline.d.ts +1 -1
  168. package/dist/types/src/runtimes/react/controls/rich-text/components/Element/inline.d.ts.map +1 -0
  169. package/dist/types/src/runtimes/react/controls/rich-text/components/Leaf/index.d.ts.map +1 -0
  170. package/dist/types/src/runtimes/react/controls/rich-text/components/Leaf/leaf.d.ts.map +1 -0
  171. package/dist/types/src/runtimes/react/controls/rich-text/components/index.d.ts.map +1 -0
  172. package/dist/types/src/runtimes/react/controls/rich-text/index.d.ts +2 -0
  173. package/dist/types/src/runtimes/react/controls/rich-text/index.d.ts.map +1 -0
  174. package/dist/types/src/runtimes/react/controls/{rich-text.d.ts → rich-text/rich-text.d.ts} +1 -1
  175. package/dist/types/src/runtimes/react/controls/rich-text/rich-text.d.ts.map +1 -0
  176. package/dist/types/src/runtimes/react/controls/rich-text-v2/EditableTextV2/editable-text-v2.d.ts.map +1 -1
  177. package/dist/types/src/runtimes/react/controls/rich-text-v2/EditableTextV2/render-element.d.ts +2 -1
  178. package/dist/types/src/runtimes/react/controls/rich-text-v2/EditableTextV2/render-element.d.ts.map +1 -1
  179. package/dist/types/src/runtimes/react/controls/rich-text-v2/EditableTextV2/render-leaf.d.ts +2 -1
  180. package/dist/types/src/runtimes/react/controls/rich-text-v2/EditableTextV2/render-leaf.d.ts.map +1 -1
  181. package/dist/types/src/runtimes/react/controls/rich-text-v2/EditableTextV2/useRemoteChanges.d.ts.map +1 -1
  182. package/dist/types/src/runtimes/react/controls/rich-text-v2/ReadOnlyTextV2.d.ts +2 -1
  183. package/dist/types/src/runtimes/react/controls/rich-text-v2/ReadOnlyTextV2.d.ts.map +1 -1
  184. package/dist/types/src/slate/BlockPlugin/index.d.ts +3 -3
  185. package/dist/types/src/slate/BlockPlugin/index.d.ts.map +1 -1
  186. package/dist/types/src/slate/InlineModePlugin/index.d.ts +6 -4
  187. package/dist/types/src/slate/InlineModePlugin/index.d.ts.map +1 -1
  188. package/dist/types/src/slate/InlinePlugin/index.d.ts +3 -3
  189. package/dist/types/src/slate/InlinePlugin/index.d.ts.map +1 -1
  190. package/dist/types/src/slate/InlinePlugin/types.d.ts +1 -1
  191. package/dist/types/src/slate/InlinePlugin/types.d.ts.map +1 -1
  192. package/dist/types/src/slate/LinkPlugin/index.d.ts +3 -3
  193. package/dist/types/src/slate/LinkPlugin/index.d.ts.map +1 -1
  194. package/dist/types/src/slate/LinkPlugin/linkPluginWithoutRenderElement.d.ts +16 -0
  195. package/dist/types/src/slate/LinkPlugin/linkPluginWithoutRenderElement.d.ts.map +1 -0
  196. package/dist/types/src/slate/TextAlignPlugin/index.d.ts +3 -3
  197. package/dist/types/src/slate/TypographyPlugin/index.d.ts +3 -3
  198. package/dist/types/src/slate/TypographyPlugin/index.d.ts.map +1 -1
  199. package/dist/types/src/slate/types.d.ts +1 -10
  200. package/dist/types/src/slate/types.d.ts.map +1 -1
  201. package/dist/types/src/slate/utils/element.d.ts.map +1 -1
  202. package/dist/types/src/state/modules/locales.d.ts.map +1 -1
  203. package/package.json +1 -1
  204. package/dist/index.cjs10.js +0 -390
  205. package/dist/index.cjs10.js.map +0 -1
  206. package/dist/index.cjs9.js +0 -295
  207. package/dist/index.cjs9.js.map +0 -1
  208. package/dist/index.es10.js +0 -383
  209. package/dist/index.es10.js.map +0 -1
  210. package/dist/index.es9.js +0 -288
  211. package/dist/index.es9.js.map +0 -1
  212. package/dist/types/src/components/builtin/Text/EditableText/editable-text.d.ts.map +0 -1
  213. package/dist/types/src/components/builtin/Text/EditableText/index.d.ts.map +0 -1
  214. package/dist/types/src/components/builtin/Text/EditableText/useSyncDOMSelection.d.ts.map +0 -1
  215. package/dist/types/src/components/builtin/Text/EditableText/useSyncWithBuilder.d.ts.map +0 -1
  216. package/dist/types/src/components/builtin/Text/ReadOnlyText.d.ts.map +0 -1
  217. package/dist/types/src/components/builtin/Text/components/Element/block.d.ts.map +0 -1
  218. package/dist/types/src/components/builtin/Text/components/Element/element.d.ts.map +0 -1
  219. package/dist/types/src/components/builtin/Text/components/Element/index.d.ts.map +0 -1
  220. package/dist/types/src/components/builtin/Text/components/Element/inline.d.ts.map +0 -1
  221. package/dist/types/src/components/builtin/Text/components/Leaf/index.d.ts.map +0 -1
  222. package/dist/types/src/components/builtin/Text/components/Leaf/leaf.d.ts.map +0 -1
  223. package/dist/types/src/components/builtin/Text/components/index.d.ts.map +0 -1
  224. package/dist/types/src/runtimes/react/controls/rich-text.d.ts.map +0 -1
  225. package/dist/types.cjs2.js +0 -765
  226. package/dist/types.cjs2.js.map +0 -1
  227. package/dist/types.es2.js +0 -748
  228. package/dist/types.es2.js.map +0 -1
  229. /package/dist/types/src/{components/builtin/Text → runtimes/react/controls/rich-text}/EditableText/index.d.ts +0 -0
  230. /package/dist/types/src/{components/builtin/Text → runtimes/react/controls/rich-text}/EditableText/useSyncDOMSelection.d.ts +0 -0
  231. /package/dist/types/src/{components/builtin/Text → runtimes/react/controls/rich-text}/components/Element/element.d.ts +0 -0
  232. /package/dist/types/src/{components/builtin/Text → runtimes/react/controls/rich-text}/components/Element/index.d.ts +0 -0
  233. /package/dist/types/src/{components/builtin/Text → runtimes/react/controls/rich-text}/components/Leaf/index.d.ts +0 -0
  234. /package/dist/types/src/{components/builtin/Text → runtimes/react/controls/rich-text}/components/Leaf/leaf.d.ts +0 -0
  235. /package/dist/types/src/{components/builtin/Text → runtimes/react/controls/rich-text}/components/index.d.ts +0 -0
package/dist/index.es6.js CHANGED
@@ -1,39 +1,4 @@
1
- import { Path, Transforms } from "slate";
2
- import isHotkey from "is-hotkey";
3
- import { bu as BlockType, bj as createRichTextV2Plugin } from "./react-page.es.js";
4
- import { E as ElementUtils } from "./types.es2.js";
5
1
  import { v4 } from "uuid";
6
- const BLOCK_ONE_PATH = [0];
7
- const BLOCK_TWO_PATH = [1];
8
- function withInlineMode(editor) {
9
- const { normalizeNode } = editor;
10
- editor.normalizeNode = (entry) => {
11
- const [normalizationNode, normalizationPath] = entry;
12
- if (Path.equals(BLOCK_TWO_PATH, normalizationPath)) {
13
- Transforms.mergeNodes(editor, { at: BLOCK_TWO_PATH });
14
- return;
15
- }
16
- if (Path.isAncestor(BLOCK_ONE_PATH, normalizationPath) && ElementUtils.isBlock(normalizationNode)) {
17
- Transforms.unwrapNodes(editor, {
18
- at: normalizationPath
19
- });
20
- return;
21
- }
22
- if (Path.equals(BLOCK_ONE_PATH, normalizationPath)) {
23
- Transforms.setNodes(editor, { type: BlockType.Text }, { at: normalizationPath });
24
- return;
25
- }
26
- normalizeNode(entry);
27
- };
28
- return editor;
29
- }
30
- const InlineModePlugin = createRichTextV2Plugin({
31
- onKeyDown: (e) => {
32
- if (isHotkey("enter", e))
33
- e.preventDefault();
34
- },
35
- withPlugin: withInlineMode
36
- });
37
2
  function withLocalChanges(editor) {
38
3
  editor.localChanges = /* @__PURE__ */ new Map();
39
4
  editor.recentLocalChanges = [];
@@ -52,5 +17,5 @@ function withLocalChanges(editor) {
52
17
  };
53
18
  return editor;
54
19
  }
55
- export { InlineModePlugin as I, withLocalChanges as a, withInlineMode as w };
20
+ export { withLocalChanges as w };
56
21
  //# sourceMappingURL=index.es6.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.es6.js","sources":["../src/slate/InlineModePlugin/index.ts","../src/slate/LocalChangesPlugin/index.tsx"],"sourcesContent":["import { Editor, Path, Transforms } from 'slate'\nimport { KeyboardEvent } from 'react'\nimport isHotkey from 'is-hotkey'\nimport { createRichTextV2Plugin } from '../../controls/rich-text-v2'\nimport { ElementUtils } from '../utils/element'\nimport { BlockType } from '../types'\n\nconst BLOCK_ONE_PATH = [0]\nconst BLOCK_TWO_PATH = [1]\n\nexport function withInlineMode(editor: Editor): Editor {\n const { normalizeNode } = editor\n editor.normalizeNode = entry => {\n const [normalizationNode, normalizationPath] = entry\n\n /**\n * Merge root nodes past the first one\n */\n if (Path.equals(BLOCK_TWO_PATH, normalizationPath)) {\n Transforms.mergeNodes(editor, { at: BLOCK_TWO_PATH })\n return\n }\n /**\n * Unwrap non text nodes of first root node\n */\n if (\n Path.isAncestor(BLOCK_ONE_PATH, normalizationPath) &&\n ElementUtils.isBlock(normalizationNode)\n ) {\n Transforms.unwrapNodes(editor, {\n at: normalizationPath,\n })\n return\n }\n /**\n * Update type of root nodes to be `text-block`\n */\n if (Path.equals(BLOCK_ONE_PATH, normalizationPath)) {\n Transforms.setNodes(editor, { type: BlockType.Text }, { at: normalizationPath })\n return\n }\n\n normalizeNode(entry)\n }\n\n return editor\n}\n\nexport const InlineModePlugin = createRichTextV2Plugin({\n onKeyDown: (e: KeyboardEvent) => {\n if (isHotkey('enter', e)) e.preventDefault()\n },\n withPlugin: withInlineMode,\n})\n","import { BaseEditor, Editor, Selection } from 'slate'\nimport { v4 as uuid } from 'uuid'\n\nexport type LocalChange = { selection: Selection; time: number }\n\nexport interface LocalChangesEditor extends BaseEditor {\n localChanges: Map<string, LocalChange>\n recentKeys: Map<string, number>\n recentLocalChanges: { time: number; key: string }[]\n currentKey: string\n}\n\nexport function withLocalChanges(editor: Editor): Editor {\n editor.localChanges = new Map<string, LocalChange>()\n editor.recentLocalChanges = []\n editor.currentKey = ''\n\n const _onChange = editor.onChange\n editor.onChange = options => {\n _onChange(options)\n if (editor == null || options?.operation == null) return\n\n const key = uuid()\n editor.localChanges.set(key, { selection: editor.selection, time: performance.now() })\n editor.currentKey = key\n }\n\n return editor\n}\n"],"names":["editor","localChanges","Map","recentLocalChanges","currentKey","_onChange","onChange","options","operation","key","uuid","set","selection","time","performance","now"],"mappings":";;;;;AAOA,MAAM,iBAAiB,CAAC,CAAC;AACzB,MAAM,iBAAiB,CAAC,CAAC;AAElB,wBAAwB,QAAwB;AACrD,QAAM,EAAE,kBAAkB;AAC1B,SAAO,gBAAgB,CAAS,UAAA;AACxB,UAAA,CAAC,mBAAmB,qBAAqB;AAK/C,QAAI,KAAK,OAAO,gBAAgB,iBAAiB,GAAG;AAClD,iBAAW,WAAW,QAAQ,EAAE,IAAI,eAAgB,CAAA;AACpD;AAAA,IACF;AAKE,QAAA,KAAK,WAAW,gBAAgB,iBAAiB,KACjD,aAAa,QAAQ,iBAAiB,GACtC;AACA,iBAAW,YAAY,QAAQ;AAAA,QAC7B,IAAI;AAAA,MAAA,CACL;AACD;AAAA,IACF;AAIA,QAAI,KAAK,OAAO,gBAAgB,iBAAiB,GAAG;AACvC,iBAAA,SAAS,QAAQ,EAAE,MAAM,UAAU,QAAQ,EAAE,IAAI,kBAAA,CAAmB;AAC/E;AAAA,IACF;AAEA,kBAAc,KAAK;AAAA,EAAA;AAGd,SAAA;AACT;AAEO,MAAM,mBAAmB,uBAAuB;AAAA,EACrD,WAAW,CAAC,MAAqB;AAC3B,QAAA,SAAS,SAAS,CAAC;AAAG,QAAE,eAAe;AAAA,EAC7C;AAAA,EACA,YAAY;AACd,CAAC;ACzCM,0BAA0BA,QAAwB;AAChDC,SAAAA,mCAAmBC;AAC1BF,SAAOG,qBAAqB;AAC5BH,SAAOI,aAAa;AAEpB,QAAMC,YAAYL,OAAOM;AACzBN,SAAOM,WAAWC,CAAW,YAAA;AAC3BF,cAAUE,OAAD;AACLP,QAAAA,UAAU,QAAQO,oCAASC,cAAa;AAAM;AAE5CC,UAAAA,MAAMC;AACLT,WAAAA,aAAaU,IAAIF,KAAK;AAAA,MAAEG,WAAWZ,OAAOY;AAAAA,MAAWC,MAAMC,YAAYC,IAAZ;AAAA,IAAA,CAAlE;AACAf,WAAOI,aAAaK;AAAAA,EAAAA;AAGfT,SAAAA;AACR;;"}
1
+ {"version":3,"file":"index.es6.js","sources":["../src/slate/LocalChangesPlugin/index.tsx"],"sourcesContent":["import { BaseEditor, Editor, Selection } from 'slate'\nimport { v4 as uuid } from 'uuid'\n\nexport type LocalChange = { selection: Selection; time: number }\n\nexport interface LocalChangesEditor extends BaseEditor {\n localChanges: Map<string, LocalChange>\n recentKeys: Map<string, number>\n recentLocalChanges: { time: number; key: string }[]\n currentKey: string\n}\n\nexport function withLocalChanges(editor: Editor): Editor {\n editor.localChanges = new Map<string, LocalChange>()\n editor.recentLocalChanges = []\n editor.currentKey = ''\n\n const _onChange = editor.onChange\n editor.onChange = options => {\n _onChange(options)\n if (editor == null || options?.operation == null) return\n\n const key = uuid()\n editor.localChanges.set(key, { selection: editor.selection, time: performance.now() })\n editor.currentKey = key\n }\n\n return editor\n}\n"],"names":["editor","localChanges","Map","recentLocalChanges","currentKey","_onChange","onChange","options","operation","key","uuid","set","selection","time","performance","now"],"mappings":";AAYO,0BAA0BA,QAAwB;AAChDC,SAAAA,mCAAmBC;AAC1BF,SAAOG,qBAAqB;AAC5BH,SAAOI,aAAa;AAEpB,QAAMC,YAAYL,OAAOM;AACzBN,SAAOM,WAAWC,CAAW,YAAA;AAC3BF,cAAUE,OAAD;AACLP,QAAAA,UAAU,QAAQO,oCAASC,cAAa;AAAM;AAE5CC,UAAAA,MAAMC;AACLT,WAAAA,aAAaU,IAAIF,KAAK;AAAA,MAAEG,WAAWZ,OAAOY;AAAAA,MAAWC,MAAMC,YAAYC,IAAZ;AAAA,IAAA,CAAlE;AACAf,WAAOI,aAAaK;AAAAA,EAAAA;AAGfT,SAAAA;AACR;;"}
package/dist/index.es7.js CHANGED
@@ -1,18 +1,374 @@
1
- import { Transforms, Editor } from "slate";
2
- import { ReactEditor } from "slate-react";
3
- function withBuilder(editor) {
4
- editor.deselectAndBlur = function() {
5
- ReactEditor.deselect(editor);
6
- ReactEditor.blur(editor);
7
- };
8
- editor.focusAndSelectAll = function() {
9
- ReactEditor.focus(editor);
10
- Transforms.select(editor, {
11
- anchor: Editor.start(editor, []),
12
- focus: Editor.end(editor, [])
13
- });
14
- };
15
- return editor;
1
+ var __defProp = Object.defineProperty;
2
+ var __defProps = Object.defineProperties;
3
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
4
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
7
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8
+ var __spreadValues = (a, b) => {
9
+ for (var prop in b || (b = {}))
10
+ if (__hasOwnProp.call(b, prop))
11
+ __defNormalProp(a, prop, b[prop]);
12
+ if (__getOwnPropSymbols)
13
+ for (var prop of __getOwnPropSymbols(b)) {
14
+ if (__propIsEnum.call(b, prop))
15
+ __defNormalProp(a, prop, b[prop]);
16
+ }
17
+ return a;
18
+ };
19
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
+ var __objRest = (source, exclude) => {
21
+ var target = {};
22
+ for (var prop in source)
23
+ if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
24
+ target[prop] = source[prop];
25
+ if (source != null && __getOwnPropSymbols)
26
+ for (var prop of __getOwnPropSymbols(source)) {
27
+ if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
28
+ target[prop] = source[prop];
29
+ }
30
+ return target;
31
+ };
32
+ import { cx } from "@emotion/css";
33
+ import { getBox } from "css-box-model";
34
+ import isHotkey from "is-hotkey";
35
+ import { useCallback, useState, useEffect, forwardRef, useImperativeHandle, useMemo } from "react";
36
+ import { Range, createEditor } from "slate";
37
+ import { ReactEditor, withReact, Slate, Editable } from "slate-react";
38
+ import { n as useResponsiveStyle, L as Link, J as useEnhancedTypography, K as useTypographyClassName, u as useIsInBuilder, N as useBuilderEditMode, O as pollBoxModel } from "./index.es.js";
39
+ import { _ as useStyle, Y as BlockType, bM as InlineType, bn as richTextDTOtoDAO, bm as richTextDTOtoSelection, a as deepEqual, bF as withBlock, bA as withTypography, bE as onKeyDown, b_ as BuilderEditMode } from "./react-page.es.js";
40
+ import { jsx } from "react/jsx-runtime";
41
+ import { w as withBuilder } from "./index.es4.js";
42
+ import "./state/breakpoints.es.js";
43
+ import "uuid";
44
+ import "./actions.es.js";
45
+ import { u as useIsomorphicLayoutEffect } from "./useIsomorphicLayoutEffect.es.js";
46
+ import "use-sync-external-store/shim/with-selector";
47
+ import "next/dynamic";
48
+ import "./text-input.es.js";
49
+ import "./combobox.es.js";
50
+ import "use-sync-external-store/shim";
51
+ import "redux";
52
+ import "redux-thunk";
53
+ import "./types.es.js";
54
+ import "./box-models.es.js";
55
+ import "color";
56
+ import "scroll-into-view-if-needed";
57
+ import "react-dom";
58
+ import "html-react-parser";
59
+ import "next/head";
60
+ import "zod";
61
+ import "@emotion/server/create-instance";
62
+ import "next/document";
63
+ import "cors";
64
+ import "path-to-regexp";
65
+ import "cookie";
66
+ import "http-proxy";
67
+ import "set-cookie-parser";
68
+ import "./constants.es.js";
69
+ import "corporate-ipsum";
70
+ import "next/link";
71
+ import "@emotion/serialize";
72
+ import "@emotion/utils";
73
+ function BlockElement({
74
+ element,
75
+ attributes,
76
+ children
77
+ }) {
78
+ const blockStyles = [useStyle({
79
+ margin: 0
80
+ }), useStyle(useResponsiveStyle([element.textAlign], ([textAlign = "left"]) => ({
81
+ textAlign
82
+ })))];
83
+ const quoteStyles = useStyle({
84
+ padding: "0.5em 10px",
85
+ fontSize: "1.25em",
86
+ fontWeight: "300",
87
+ borderLeft: "5px solid rgba(0, 0, 0, 0.1)"
88
+ });
89
+ switch (element.type) {
90
+ case BlockType.Default:
91
+ case BlockType.Paragraph:
92
+ return /* @__PURE__ */ jsx("p", __spreadProps(__spreadValues({}, attributes), {
93
+ className: cx(...blockStyles),
94
+ children
95
+ }));
96
+ case BlockType.Heading1:
97
+ return /* @__PURE__ */ jsx("h1", __spreadProps(__spreadValues({}, attributes), {
98
+ className: cx(...blockStyles),
99
+ children
100
+ }));
101
+ case BlockType.Heading2:
102
+ return /* @__PURE__ */ jsx("h2", __spreadProps(__spreadValues({}, attributes), {
103
+ className: cx(...blockStyles),
104
+ children
105
+ }));
106
+ case BlockType.Heading3:
107
+ return /* @__PURE__ */ jsx("h3", __spreadProps(__spreadValues({}, attributes), {
108
+ className: cx(...blockStyles),
109
+ children
110
+ }));
111
+ case BlockType.Heading4:
112
+ return /* @__PURE__ */ jsx("h4", __spreadProps(__spreadValues({}, attributes), {
113
+ className: cx(...blockStyles),
114
+ children
115
+ }));
116
+ case BlockType.Heading5:
117
+ return /* @__PURE__ */ jsx("h5", __spreadProps(__spreadValues({}, attributes), {
118
+ className: cx(...blockStyles),
119
+ children
120
+ }));
121
+ case BlockType.Heading6:
122
+ return /* @__PURE__ */ jsx("h6", __spreadProps(__spreadValues({}, attributes), {
123
+ className: cx(...blockStyles),
124
+ children
125
+ }));
126
+ case BlockType.BlockQuote:
127
+ return /* @__PURE__ */ jsx("blockquote", __spreadProps(__spreadValues({}, attributes), {
128
+ className: cx(...blockStyles, quoteStyles),
129
+ children
130
+ }));
131
+ case BlockType.OrderedList:
132
+ return /* @__PURE__ */ jsx("ol", __spreadProps(__spreadValues({}, attributes), {
133
+ className: cx(...blockStyles),
134
+ style: {
135
+ listStylePosition: "inside"
136
+ },
137
+ children
138
+ }));
139
+ case BlockType.UnorderedList:
140
+ return /* @__PURE__ */ jsx("ul", __spreadProps(__spreadValues({}, attributes), {
141
+ className: cx(...blockStyles),
142
+ style: {
143
+ listStylePosition: "inside"
144
+ },
145
+ children
146
+ }));
147
+ case BlockType.ListItem:
148
+ return /* @__PURE__ */ jsx("li", __spreadProps(__spreadValues({}, attributes), {
149
+ className: cx(...blockStyles),
150
+ children
151
+ }));
152
+ case BlockType.ListItemChild:
153
+ return /* @__PURE__ */ jsx("span", __spreadProps(__spreadValues({}, attributes), {
154
+ className: cx(...blockStyles),
155
+ children
156
+ }));
157
+ }
158
+ }
159
+ function StyledLink(_a) {
160
+ var _b = _a, {
161
+ className
162
+ } = _b, restOfProps = __objRest(_b, [
163
+ "className"
164
+ ]);
165
+ return /* @__PURE__ */ jsx(Link, __spreadProps(__spreadValues({}, restOfProps), {
166
+ className: cx(useStyle({
167
+ textDecoration: "none"
168
+ }), className)
169
+ }));
170
+ }
171
+ function InlineElement({
172
+ element,
173
+ attributes,
174
+ children
175
+ }) {
176
+ var _a;
177
+ switch (element.type) {
178
+ case InlineType.Code:
179
+ return /* @__PURE__ */ jsx("code", __spreadProps(__spreadValues({}, attributes), {
180
+ children
181
+ }));
182
+ case InlineType.SuperScript:
183
+ return /* @__PURE__ */ jsx("sup", __spreadProps(__spreadValues({}, attributes), {
184
+ children
185
+ }));
186
+ case InlineType.SubScript:
187
+ return /* @__PURE__ */ jsx("sub", __spreadProps(__spreadValues({}, attributes), {
188
+ children
189
+ }));
190
+ case InlineType.Link:
191
+ return /* @__PURE__ */ jsx(StyledLink, __spreadProps(__spreadValues({}, attributes), {
192
+ link: (_a = element.link) != null ? _a : void 0,
193
+ children
194
+ }));
195
+ }
196
+ }
197
+ function Element(_c) {
198
+ var _d = _c, {
199
+ element
200
+ } = _d, props = __objRest(_d, [
201
+ "element"
202
+ ]);
203
+ switch (element.type) {
204
+ case InlineType.Code:
205
+ case InlineType.SuperScript:
206
+ case InlineType.SubScript:
207
+ case InlineType.Link:
208
+ return /* @__PURE__ */ jsx(InlineElement, __spreadValues({
209
+ element
210
+ }, props));
211
+ case BlockType.Default:
212
+ case BlockType.Paragraph:
213
+ case BlockType.Heading1:
214
+ case BlockType.Heading2:
215
+ case BlockType.Heading3:
216
+ case BlockType.Heading4:
217
+ case BlockType.Heading5:
218
+ case BlockType.Heading6:
219
+ case BlockType.BlockQuote:
220
+ case BlockType.OrderedList:
221
+ case BlockType.UnorderedList:
222
+ case BlockType.ListItem:
223
+ case BlockType.ListItemChild:
224
+ return /* @__PURE__ */ jsx(BlockElement, __spreadValues({
225
+ element
226
+ }, props));
227
+ default:
228
+ return /* @__PURE__ */ jsx("span", __spreadProps(__spreadValues({}, props.attributes), {
229
+ children: props.children
230
+ }));
231
+ }
16
232
  }
17
- export { withBuilder as w };
233
+ function Leaf(_e) {
234
+ var _f = _e, {
235
+ leaf
236
+ } = _f, props = __objRest(_f, [
237
+ "leaf"
238
+ ]);
239
+ const enhancedTypography = useEnhancedTypography(leaf.typography);
240
+ const typographyClassName = useTypographyClassName(enhancedTypography);
241
+ return /* @__PURE__ */ jsx("span", __spreadProps(__spreadValues({}, props.attributes), {
242
+ className: typographyClassName,
243
+ children: props.children
244
+ }));
245
+ }
246
+ function useSyncDOMSelection(editor, isEnabled) {
247
+ useIsomorphicLayoutEffect(() => {
248
+ if (!isEnabled || editor.selection == null || ReactEditor.isFocused(editor))
249
+ return;
250
+ try {
251
+ const root = ReactEditor.findDocumentOrShadowRoot(editor);
252
+ const domSelection = root.getSelection();
253
+ const newDomRange = ReactEditor.toDOMRange(editor, editor.selection);
254
+ if (newDomRange) {
255
+ if (Range.isBackward(editor.selection)) {
256
+ domSelection == null ? void 0 : domSelection.setBaseAndExtent(newDomRange.endContainer, newDomRange.endOffset, newDomRange.startContainer, newDomRange.startOffset);
257
+ } else {
258
+ domSelection == null ? void 0 : domSelection.setBaseAndExtent(newDomRange.startContainer, newDomRange.startOffset, newDomRange.endContainer, newDomRange.endOffset);
259
+ }
260
+ } else {
261
+ domSelection == null ? void 0 : domSelection.removeAllRanges();
262
+ }
263
+ } catch (e) {
264
+ console.error(e);
265
+ }
266
+ });
267
+ }
268
+ const COMMIT_DEBOUNCE_DELAY = 500;
269
+ function useSyncWithBuilder(editor, text) {
270
+ const [shouldCommit, setShouldCommit] = useState(true);
271
+ const isInBuilder = useIsInBuilder();
272
+ useEffect(() => {
273
+ if (shouldCommit && text && isInBuilder) {
274
+ const nextValue = richTextDTOtoDAO(text);
275
+ const nextSelection = richTextDTOtoSelection(text);
276
+ if (!deepEqual(editor.children, nextValue) || !deepEqual(editor.selection, nextSelection)) {
277
+ editor.children = nextValue;
278
+ editor.selection = nextSelection;
279
+ editor.onChange();
280
+ }
281
+ }
282
+ }, [editor, shouldCommit, text]);
283
+ useEffect(() => {
284
+ if (shouldCommit)
285
+ return;
286
+ const timeoutId = window.setTimeout(() => {
287
+ setShouldCommit(true);
288
+ }, COMMIT_DEBOUNCE_DELAY);
289
+ return () => {
290
+ window.clearTimeout(timeoutId);
291
+ };
292
+ }, [shouldCommit]);
293
+ return useCallback(() => setShouldCommit(false), []);
294
+ }
295
+ const defaultText = [{
296
+ type: BlockType.Paragraph,
297
+ children: [{
298
+ text: ""
299
+ }]
300
+ }];
301
+ const EditableText = forwardRef(function EditableText2({
302
+ id,
303
+ text,
304
+ width,
305
+ margin
306
+ }, ref) {
307
+ const [editor] = useState(() => withBlock(withTypography(withBuilder(withReact(createEditor())))));
308
+ const [isPreservingDOMSElection, setIsPreservingDOMSelection] = useState(false);
309
+ useSyncDOMSelection(editor, isPreservingDOMSElection);
310
+ const delaySync = useSyncWithBuilder(editor, text);
311
+ const editMode = useBuilderEditMode();
312
+ const [propControllers, setPropControllers] = useState(null);
313
+ const controller = propControllers == null ? void 0 : propControllers.text;
314
+ useEffect(() => {
315
+ if (controller == null)
316
+ return;
317
+ const element = ReactEditor.toDOMNode(editor, editor);
318
+ return pollBoxModel({
319
+ element,
320
+ onBoxModelChange: (boxModel) => controller.changeBoxModel(boxModel)
321
+ });
322
+ }, [editor, controller]);
323
+ useImperativeHandle(ref, () => ({
324
+ getDomNode() {
325
+ return ReactEditor.toDOMNode(editor, editor);
326
+ },
327
+ getBoxModel() {
328
+ return getBox(ReactEditor.toDOMNode(editor, editor));
329
+ },
330
+ setPropControllers
331
+ }), [editor, setPropControllers]);
332
+ const initialValue = useMemo(() => text ? richTextDTOtoDAO(text) : defaultText, [text]);
333
+ useEffect(() => {
334
+ controller == null ? void 0 : controller.setSlateEditor(editor);
335
+ }, [controller, editor]);
336
+ const handleFocus = useCallback(() => {
337
+ controller == null ? void 0 : controller.focus();
338
+ setIsPreservingDOMSelection(true);
339
+ }, [controller]);
340
+ const handleKeyDown = useCallback((e) => {
341
+ if (isHotkey("mod+shift+z", e))
342
+ return controller == null ? void 0 : controller.redo();
343
+ if (isHotkey("mod+z", e))
344
+ return controller == null ? void 0 : controller.undo();
345
+ if (isHotkey("escape")(e))
346
+ return controller == null ? void 0 : controller.blur();
347
+ onKeyDown(e, editor);
348
+ }, [controller, editor]);
349
+ const handleBlur = useCallback((e) => {
350
+ if (e.relatedTarget == null)
351
+ return;
352
+ setIsPreservingDOMSelection(false);
353
+ ReactEditor.deselect(editor);
354
+ }, []);
355
+ return /* @__PURE__ */ jsx(Slate, {
356
+ editor,
357
+ value: initialValue,
358
+ onChange: delaySync,
359
+ children: /* @__PURE__ */ jsx(Editable, {
360
+ id,
361
+ renderLeaf: Leaf,
362
+ renderElement: Element,
363
+ onFocus: handleFocus,
364
+ onKeyDown: handleKeyDown,
365
+ onBlur: handleBlur,
366
+ className: cx(width, margin),
367
+ readOnly: editMode !== BuilderEditMode.CONTENT,
368
+ placeholder: "Write some text..."
369
+ })
370
+ });
371
+ });
372
+ var EditableText$1 = EditableText;
373
+ export { EditableText, EditableText$1 as default };
18
374
  //# sourceMappingURL=index.es7.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.es7.js","sources":["../src/slate/BuilderPlugin/index.ts"],"sourcesContent":["import { BaseEditor, Editor, Transforms } from 'slate'\nimport { ReactEditor } from 'slate-react'\n\nexport interface BuilderEditor extends BaseEditor {\n focusAndSelectAll: () => void\n deselectAndBlur: () => void\n}\n\nexport function withBuilder(editor: Editor) {\n editor.deselectAndBlur = function () {\n ReactEditor.deselect(editor)\n ReactEditor.blur(editor)\n }\n\n editor.focusAndSelectAll = function () {\n ReactEditor.focus(editor)\n Transforms.select(editor, {\n anchor: Editor.start(editor, []),\n focus: Editor.end(editor, []),\n })\n }\n\n return editor\n}\n"],"names":[],"mappings":";;AAQO,qBAAqB,QAAgB;AAC1C,SAAO,kBAAkB,WAAY;AACnC,gBAAY,SAAS,MAAM;AAC3B,gBAAY,KAAK,MAAM;AAAA,EAAA;AAGzB,SAAO,oBAAoB,WAAY;AACrC,gBAAY,MAAM,MAAM;AACxB,eAAW,OAAO,QAAQ;AAAA,MACxB,QAAQ,OAAO,MAAM,QAAQ,CAAA,CAAE;AAAA,MAC/B,OAAO,OAAO,IAAI,QAAQ,CAAA,CAAE;AAAA,IAAA,CAC7B;AAAA,EAAA;AAGI,SAAA;AACT;;"}
1
+ {"version":3,"file":"index.es7.js","sources":["../src/runtimes/react/controls/rich-text/components/Element/block.tsx","../src/runtimes/react/controls/rich-text/components/Element/inline.tsx","../src/runtimes/react/controls/rich-text/components/Element/element.tsx","../src/runtimes/react/controls/rich-text/components/Leaf/leaf.tsx","../src/runtimes/react/controls/rich-text/EditableText/useSyncDOMSelection.tsx","../src/runtimes/react/controls/rich-text/EditableText/useSyncWithBuilder.tsx","../src/runtimes/react/controls/rich-text/EditableText/editable-text.tsx"],"sourcesContent":["import { cx } from '@emotion/css'\nimport { RenderElementProps } from 'slate-react'\nimport { useResponsiveStyle } from '../../../../../../components/utils/responsive-style'\nimport { Block, BlockType } from '../../../../../../slate'\nimport { useStyle } from '../../../../use-style'\n\nexport interface InlineRenderElementProps extends RenderElementProps {\n element: Block\n}\n\nexport function BlockElement({ element, attributes, children }: InlineRenderElementProps) {\n const blockStyles = [\n useStyle({ margin: 0 }),\n useStyle(useResponsiveStyle([element.textAlign], ([textAlign = 'left']) => ({ textAlign }))),\n ]\n\n const quoteStyles = useStyle({\n padding: '0.5em 10px',\n fontSize: '1.25em',\n fontWeight: '300',\n borderLeft: '5px solid rgba(0, 0, 0, 0.1)',\n })\n\n switch (element.type) {\n case BlockType.Default:\n case BlockType.Paragraph:\n return (\n <p {...attributes} className={cx(...blockStyles)}>\n {children}\n </p>\n )\n case BlockType.Heading1:\n return (\n <h1 {...attributes} className={cx(...blockStyles)}>\n {children}\n </h1>\n )\n case BlockType.Heading2:\n return (\n <h2 {...attributes} className={cx(...blockStyles)}>\n {children}\n </h2>\n )\n case BlockType.Heading3:\n return (\n <h3 {...attributes} className={cx(...blockStyles)}>\n {children}\n </h3>\n )\n case BlockType.Heading4:\n return (\n <h4 {...attributes} className={cx(...blockStyles)}>\n {children}\n </h4>\n )\n case BlockType.Heading5:\n return (\n <h5 {...attributes} className={cx(...blockStyles)}>\n {children}\n </h5>\n )\n case BlockType.Heading6:\n return (\n <h6 {...attributes} className={cx(...blockStyles)}>\n {children}\n </h6>\n )\n case BlockType.BlockQuote:\n return (\n <blockquote {...attributes} className={cx(...blockStyles, quoteStyles)}>\n {children}\n </blockquote>\n )\n case BlockType.OrderedList:\n return (\n <ol {...attributes} className={cx(...blockStyles)} style={{ listStylePosition: 'inside' }}>\n {children}\n </ol>\n )\n case BlockType.UnorderedList:\n return (\n <ul {...attributes} className={cx(...blockStyles)} style={{ listStylePosition: 'inside' }}>\n {children}\n </ul>\n )\n case BlockType.ListItem:\n return (\n <li {...attributes} className={cx(...blockStyles)}>\n {children}\n </li>\n )\n case BlockType.ListItemChild:\n return (\n <span {...attributes} className={cx(...blockStyles)}>\n {children}\n </span>\n )\n }\n}\n","import { cx } from '@emotion/css'\nimport { ComponentPropsWithoutRef } from 'react'\nimport { RenderElementProps } from 'slate-react'\nimport { Inline, InlineType } from '../../../../../../slate/types'\nimport { useStyle } from '../../../../use-style'\nimport { Link } from '../../../../../../components/shared/Link'\n\nfunction StyledLink({ className, ...restOfProps }: ComponentPropsWithoutRef<typeof Link>) {\n return <Link {...restOfProps} className={cx(useStyle({ textDecoration: 'none' }), className)} />\n}\n\nexport interface InlineRenderElementProps extends RenderElementProps {\n element: Inline\n}\n\nexport function InlineElement({ element, attributes, children }: InlineRenderElementProps) {\n switch (element.type) {\n case InlineType.Code:\n return <code {...attributes}>{children}</code>\n case InlineType.SuperScript:\n return <sup {...attributes}>{children}</sup>\n case InlineType.SubScript:\n return <sub {...attributes}>{children}</sub>\n case InlineType.Link:\n return (\n <StyledLink {...attributes} link={element.link ?? undefined}>\n {children}\n </StyledLink>\n )\n }\n}\n","import { RenderElementProps } from 'slate-react'\nimport { BlockElement } from './block'\nimport { InlineElement } from './inline'\nimport { BlockType, InlineType } from '../../../../../../slate/types'\n\nexport function Element({ element, ...props }: RenderElementProps) {\n switch (element.type) {\n case InlineType.Code:\n case InlineType.SuperScript:\n case InlineType.SubScript:\n case InlineType.Link:\n return <InlineElement element={element} {...props} />\n case BlockType.Default:\n case BlockType.Paragraph:\n case BlockType.Heading1:\n case BlockType.Heading2:\n case BlockType.Heading3:\n case BlockType.Heading4:\n case BlockType.Heading5:\n case BlockType.Heading6:\n case BlockType.BlockQuote:\n case BlockType.OrderedList:\n case BlockType.UnorderedList:\n case BlockType.ListItem:\n case BlockType.ListItemChild:\n return <BlockElement element={element} {...props} />\n default:\n return <span {...props.attributes}>{props.children}</span>\n }\n}\n","import { RenderLeafProps } from 'slate-react'\nimport useEnhancedTypography, { useTypographyClassName } from '../../../typography'\n\nexport function Leaf({ leaf, ...props }: RenderLeafProps) {\n // for each breakpoint fetch related resources and merge its value with its override\n const enhancedTypography = useEnhancedTypography(leaf.typography)\n\n // for each breakpoint shallow merge back up through the breakpoints and create a className\n const typographyClassName = useTypographyClassName(enhancedTypography)\n\n return (\n <span {...props.attributes} className={typographyClassName}>\n {props.children}\n </span>\n )\n}\n","import { ReactEditor } from 'slate-react'\nimport { Editor, Range as SlateRange } from 'slate'\nimport { useIsomorphicLayoutEffect } from '../../../../../components/hooks/useIsomorphicLayoutEffect'\n\n/**\n * Clicking outside of the host blurs our `<Editable />`.\n * `<Editable />` only updates the DOM's selection to match slate when it is focused.\n * In the case of a panel being clicked this hook updates the DOM selection to match slate.\n */\nexport function useSyncDOMSelection(editor: Editor, isEnabled: boolean) {\n useIsomorphicLayoutEffect(() => {\n if (!isEnabled || editor.selection == null || ReactEditor.isFocused(editor)) return\n try {\n const root = ReactEditor.findDocumentOrShadowRoot(editor) as Document\n const domSelection = root.getSelection()\n const newDomRange: Range | null = ReactEditor.toDOMRange(editor, editor.selection)\n\n if (newDomRange) {\n if (SlateRange.isBackward(editor.selection!)) {\n domSelection?.setBaseAndExtent(\n newDomRange.endContainer,\n newDomRange.endOffset,\n newDomRange.startContainer,\n newDomRange.startOffset,\n )\n } else {\n domSelection?.setBaseAndExtent(\n newDomRange.startContainer,\n newDomRange.startOffset,\n newDomRange.endContainer,\n newDomRange.endOffset,\n )\n }\n } else {\n domSelection?.removeAllRanges()\n }\n } catch (e) {\n console.error(e)\n }\n })\n}\n","import { useState, useEffect, useCallback } from 'react'\nimport { Editor } from 'slate'\nimport { useIsInBuilder } from '../../../../../react'\nimport { richTextDTOtoDAO, richTextDTOtoSelection } from '../../../../../controls'\nimport { RichTextValue } from '../../../../../prop-controllers'\nimport deepEqual from '../../../../../utils/deepEqual'\n\nconst COMMIT_DEBOUNCE_DELAY = 500\n\n/**\n * Compare new prop value with current editor and update editor\n * if the values are not equal.\n */\nexport function useSyncWithBuilder(editor: Editor, text?: RichTextValue) {\n const [shouldCommit, setShouldCommit] = useState(true)\n const isInBuilder = useIsInBuilder()\n\n useEffect(() => {\n if (shouldCommit && text && isInBuilder) {\n const nextValue = richTextDTOtoDAO(text)\n const nextSelection = richTextDTOtoSelection(text)\n if (!deepEqual(editor.children, nextValue) || !deepEqual(editor.selection, nextSelection)) {\n editor.children = nextValue\n editor.selection = nextSelection\n editor.onChange()\n }\n }\n }, [editor, shouldCommit, text])\n\n useEffect(() => {\n if (shouldCommit) return\n\n const timeoutId = window.setTimeout(() => {\n setShouldCommit(true)\n }, COMMIT_DEBOUNCE_DELAY)\n\n return () => {\n window.clearTimeout(timeoutId)\n }\n }, [shouldCommit])\n\n return useCallback(() => setShouldCommit(false), [])\n}\n","import { cx } from '@emotion/css'\nimport { getBox } from 'css-box-model'\nimport isHotkey from 'is-hotkey'\nimport {\n FocusEvent,\n forwardRef,\n KeyboardEvent,\n Ref,\n useCallback,\n useEffect,\n useImperativeHandle,\n useMemo,\n useState,\n} from 'react'\n\nimport { createEditor } from 'slate'\nimport { Slate, Editable, withReact, ReactEditor } from 'slate-react'\nimport { useBuilderEditMode } from '../../..'\nimport { richTextDTOtoDAO } from '../../../../../controls'\nimport { RichTextValue } from '../../../../../prop-controllers'\nimport { ElementIDValue } from '../../../../../prop-controllers/descriptors'\nimport { DescriptorsPropControllers } from '../../../../../prop-controllers/instances'\nimport {\n RichTextDAO,\n BlockType,\n withBlock,\n withTypography,\n withBuilder,\n onKeyDown,\n} from '../../../../../slate'\nimport { BuilderEditMode } from '../../../../../state/modules/builder-edit-mode'\nimport { PropControllersHandle } from '../../../../../state/modules/prop-controller-handles'\nimport { pollBoxModel } from '../../../poll-box-model'\nimport { Element, Leaf } from '../components'\nimport { Descriptors } from '../rich-text'\nimport { useSyncDOMSelection } from './useSyncDOMSelection'\nimport { useSyncWithBuilder } from './useSyncWithBuilder'\n\ntype Props = {\n id?: ElementIDValue\n text?: RichTextValue\n width?: string\n margin?: string\n}\n\nconst defaultText: RichTextDAO = [{ type: BlockType.Paragraph, children: [{ text: '' }] }]\n\nexport const EditableText = forwardRef(function EditableText(\n { id, text, width, margin }: Props,\n ref: Ref<PropControllersHandle<Descriptors>>,\n) {\n const [editor] = useState(() => withBlock(withTypography(withBuilder(withReact(createEditor())))))\n const [isPreservingDOMSElection, setIsPreservingDOMSelection] = useState(false)\n useSyncDOMSelection(editor, isPreservingDOMSElection)\n const delaySync = useSyncWithBuilder(editor, text)\n const editMode = useBuilderEditMode()\n\n const [propControllers, setPropControllers] =\n useState<DescriptorsPropControllers<Descriptors> | null>(null)\n const controller = propControllers?.text\n\n useEffect(() => {\n if (controller == null) return\n\n const element = ReactEditor.toDOMNode(editor, editor)\n\n return pollBoxModel({\n element,\n onBoxModelChange: boxModel => controller.changeBoxModel(boxModel),\n })\n }, [editor, controller])\n\n useImperativeHandle(\n ref,\n () => ({\n getDomNode() {\n return ReactEditor.toDOMNode(editor, editor)\n },\n getBoxModel() {\n return getBox(ReactEditor.toDOMNode(editor, editor))\n },\n setPropControllers,\n }),\n [editor, setPropControllers],\n )\n\n const initialValue = useMemo(() => (text ? richTextDTOtoDAO(text) : defaultText), [text])\n\n useEffect(() => {\n controller?.setSlateEditor(editor)\n }, [controller, editor])\n\n const handleFocus = useCallback(() => {\n controller?.focus()\n setIsPreservingDOMSelection(true)\n }, [controller])\n\n const handleKeyDown = useCallback(\n (e: KeyboardEvent) => {\n if (isHotkey('mod+shift+z', e)) return controller?.redo()\n if (isHotkey('mod+z', e)) return controller?.undo()\n if (isHotkey('escape')(e)) return controller?.blur()\n onKeyDown(e, editor)\n },\n [controller, editor],\n )\n\n const handleBlur = useCallback((e: FocusEvent) => {\n // When clicking outside of the iframe (`relatedTarget` is null) we want to preserve the DOM selection.\n if (e.relatedTarget == null) return\n // Otherwise we want to deselect on blur and stop preserving selection.\n setIsPreservingDOMSelection(false)\n ReactEditor.deselect(editor)\n }, [])\n\n return (\n <Slate editor={editor} value={initialValue} onChange={delaySync}>\n <Editable\n id={id}\n renderLeaf={Leaf}\n renderElement={Element}\n onFocus={handleFocus}\n onKeyDown={handleKeyDown}\n onBlur={handleBlur}\n className={cx(width, margin)}\n readOnly={editMode !== BuilderEditMode.CONTENT}\n placeholder=\"Write some text...\"\n />\n </Slate>\n )\n})\n\nexport default EditableText\n"],"names":["element","attributes","children","blockStyles","useStyle","margin","useResponsiveStyle","textAlign","quoteStyles","padding","fontSize","fontWeight","borderLeft","type","BlockType","Default","Paragraph","cx","Heading1","Heading2","Heading3","Heading4","Heading5","Heading6","BlockQuote","OrderedList","listStylePosition","UnorderedList","ListItem","ListItemChild","className","restOfProps","textDecoration","InlineType","Code","SuperScript","SubScript","Link","link","undefined","props","leaf","enhancedTypography","useEnhancedTypography","typography","typographyClassName","useTypographyClassName","editor","isEnabled","useIsomorphicLayoutEffect","selection","ReactEditor","isFocused","root","findDocumentOrShadowRoot","domSelection","getSelection","newDomRange","toDOMRange","SlateRange","isBackward","setBaseAndExtent","endContainer","endOffset","startContainer","startOffset","removeAllRanges","e","console","error","COMMIT_DEBOUNCE_DELAY","text","shouldCommit","setShouldCommit","useState","isInBuilder","useIsInBuilder","useEffect","nextValue","richTextDTOtoDAO","nextSelection","richTextDTOtoSelection","deepEqual","onChange","timeoutId","window","setTimeout","clearTimeout","useCallback","defaultText","EditableText","forwardRef","id","width","ref","withBlock","withTypography","withBuilder","withReact","createEditor","isPreservingDOMSElection","setIsPreservingDOMSelection","useSyncDOMSelection","delaySync","useSyncWithBuilder","editMode","useBuilderEditMode","propControllers","setPropControllers","controller","toDOMNode","pollBoxModel","onBoxModelChange","boxModel","changeBoxModel","useImperativeHandle","getDomNode","getBoxModel","getBox","initialValue","useMemo","setSlateEditor","handleFocus","focus","handleKeyDown","isHotkey","redo","undo","blur","onKeyDown","handleBlur","relatedTarget","deselect","Leaf","Element","BuilderEditMode","CONTENT"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAU6B,sBAAA;AAAA,EAAEA;AAAAA,EAASC;AAAAA,EAAYC;AAAAA,GAAsC;AAClFC,QAAAA,cAAc,CAClBC,SAAS;AAAA,IAAEC,QAAQ;AAAA,EAAA,CAAX,GACRD,SAASE,mBAAmB,CAACN,QAAQO,SAAT,GAAqB,CAAC,CAACA,YAAY,YAAa;AAAA,IAAEA;AAAAA,EAAAA,EAAnD,CAAnB,CAFU;AAKdC,QAAAA,cAAcJ,SAAS;AAAA,IAC3BK,SAAS;AAAA,IACTC,UAAU;AAAA,IACVC,YAAY;AAAA,IACZC,YAAY;AAAA,EA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