@makeswift/runtime 0.9.12 → 0.10.1

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 (244) 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 +10 -6
  42. package/dist/PreviewProvider.cjs.js.map +1 -1
  43. package/dist/PreviewProvider.es.js +9 -5
  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/actions.cjs.js +2 -2
  70. package/dist/actions.cjs.js.map +1 -1
  71. package/dist/actions.es.js +2 -2
  72. package/dist/actions.es.js.map +1 -1
  73. package/dist/builder.cjs.js +2 -0
  74. package/dist/builder.cjs.js.map +1 -1
  75. package/dist/builder.es.js +2 -0
  76. package/dist/builder.es.js.map +1 -1
  77. package/dist/components.cjs.js +3 -2
  78. package/dist/components.cjs.js.map +1 -1
  79. package/dist/components.es.js +3 -2
  80. package/dist/components.es.js.map +1 -1
  81. package/dist/control-serialization.es.js +1 -1
  82. package/dist/controls.cjs.js +8 -8
  83. package/dist/controls.es.js +4 -2
  84. package/dist/controls.es.js.map +1 -1
  85. package/dist/index.cjs.js +280 -216
  86. package/dist/index.cjs.js.map +1 -1
  87. package/dist/index.cjs3.js +21 -107
  88. package/dist/index.cjs3.js.map +1 -1
  89. package/dist/index.cjs4.js +16 -57
  90. package/dist/index.cjs4.js.map +1 -1
  91. package/dist/index.cjs5.js +53 -242
  92. package/dist/index.cjs5.js.map +1 -1
  93. package/dist/index.cjs6.js +0 -41
  94. package/dist/index.cjs6.js.map +1 -1
  95. package/dist/index.cjs7.js +376 -14
  96. package/dist/index.cjs7.js.map +1 -1
  97. package/dist/index.cjs8.js +275 -11
  98. package/dist/index.cjs8.js.map +1 -1
  99. package/dist/index.es.js +274 -209
  100. package/dist/index.es.js.map +1 -1
  101. package/dist/index.es2.js +2 -2
  102. package/dist/index.es3.js +22 -103
  103. package/dist/index.es3.js.map +1 -1
  104. package/dist/index.es4.js +16 -57
  105. package/dist/index.es4.js.map +1 -1
  106. package/dist/index.es5.js +53 -240
  107. package/dist/index.es5.js.map +1 -1
  108. package/dist/index.es6.js +1 -36
  109. package/dist/index.es6.js.map +1 -1
  110. package/dist/index.es7.js +372 -16
  111. package/dist/index.es7.js.map +1 -1
  112. package/dist/index.es8.js +270 -10
  113. package/dist/index.es8.js.map +1 -1
  114. package/dist/main.cjs.js +2 -0
  115. package/dist/main.cjs.js.map +1 -1
  116. package/dist/main.es.js +2 -0
  117. package/dist/main.es.js.map +1 -1
  118. package/dist/next.cjs.js +3 -0
  119. package/dist/next.cjs.js.map +1 -1
  120. package/dist/next.es.js +4 -1
  121. package/dist/next.es.js.map +1 -1
  122. package/dist/prop-controllers.cjs.js +2 -0
  123. package/dist/prop-controllers.cjs.js.map +1 -1
  124. package/dist/prop-controllers.es.js +2 -0
  125. package/dist/prop-controllers.es.js.map +1 -1
  126. package/dist/react-page.cjs.js +1450 -65
  127. package/dist/react-page.cjs.js.map +1 -1
  128. package/dist/react-page.es.js +1427 -66
  129. package/dist/react-page.es.js.map +1 -1
  130. package/dist/react.cjs.js +3 -0
  131. package/dist/react.cjs.js.map +1 -1
  132. package/dist/react.es.js +3 -0
  133. package/dist/react.es.js.map +1 -1
  134. package/dist/slate.cjs.js +33 -391
  135. package/dist/slate.cjs.js.map +1 -1
  136. package/dist/slate.es.js +15 -376
  137. package/dist/slate.es.js.map +1 -1
  138. package/dist/text-input.cjs.js +0 -22
  139. package/dist/text-input.cjs.js.map +1 -1
  140. package/dist/text-input.es.js +1 -18
  141. package/dist/text-input.es.js.map +1 -1
  142. package/dist/types/src/components/builtin/Text/Text.d.ts +3 -4
  143. package/dist/types/src/components/builtin/Text/Text.d.ts.map +1 -1
  144. package/dist/types/src/components/builtin/Text/register.d.ts.map +1 -1
  145. package/dist/types/src/controls/rich-text/fixtures/v2-data-types.d.ts.map +1 -1
  146. package/dist/types/src/controls/rich-text/rich-text.d.ts +0 -1
  147. package/dist/types/src/controls/rich-text/rich-text.d.ts.map +1 -1
  148. package/dist/types/src/controls/rich-text/translation.d.ts.map +1 -1
  149. package/dist/types/src/controls/rich-text-v2/plugin.d.ts +29 -0
  150. package/dist/types/src/controls/rich-text-v2/plugin.d.ts.map +1 -0
  151. package/dist/types/src/controls/rich-text-v2/rich-text-v2.d.ts +17 -31
  152. package/dist/types/src/controls/rich-text-v2/rich-text-v2.d.ts.map +1 -1
  153. package/dist/types/src/next/api-handler/index.d.ts.map +1 -1
  154. package/dist/types/src/next/client.d.ts.map +1 -1
  155. package/dist/types/src/next/index.d.ts.map +1 -1
  156. package/dist/types/src/prop-controllers/descriptors.d.ts +1 -1
  157. package/dist/types/src/prop-controllers/descriptors.d.ts.map +1 -1
  158. package/dist/types/src/prop-controllers/introspection.d.ts.map +1 -1
  159. package/dist/types/src/runtimes/react/controls/control.d.ts +1 -1
  160. package/dist/types/src/runtimes/react/controls/control.d.ts.map +1 -1
  161. package/dist/types/src/{components/builtin/Text → runtimes/react/controls/rich-text}/EditableText/editable-text.d.ts +4 -3
  162. package/dist/types/src/runtimes/react/controls/rich-text/EditableText/editable-text.d.ts.map +1 -0
  163. package/dist/types/src/runtimes/react/controls/rich-text/EditableText/index.d.ts.map +1 -0
  164. package/dist/types/src/runtimes/react/controls/rich-text/EditableText/useSyncDOMSelection.d.ts.map +1 -0
  165. package/dist/types/src/{components/builtin/Text → runtimes/react/controls/rich-text}/EditableText/useSyncWithBuilder.d.ts +1 -1
  166. package/dist/types/src/runtimes/react/controls/rich-text/EditableText/useSyncWithBuilder.d.ts.map +1 -0
  167. package/dist/types/src/{components/builtin/Text → runtimes/react/controls/rich-text}/ReadOnlyText.d.ts +2 -2
  168. package/dist/types/src/runtimes/react/controls/rich-text/ReadOnlyText.d.ts.map +1 -0
  169. package/dist/types/src/{components/builtin/Text → runtimes/react/controls/rich-text}/components/Element/block.d.ts +1 -1
  170. package/dist/types/src/runtimes/react/controls/rich-text/components/Element/block.d.ts.map +1 -0
  171. package/dist/types/src/runtimes/react/controls/rich-text/components/Element/element.d.ts.map +1 -0
  172. package/dist/types/src/runtimes/react/controls/rich-text/components/Element/index.d.ts.map +1 -0
  173. package/dist/types/src/{components/builtin/Text → runtimes/react/controls/rich-text}/components/Element/inline.d.ts +1 -1
  174. package/dist/types/src/runtimes/react/controls/rich-text/components/Element/inline.d.ts.map +1 -0
  175. package/dist/types/src/runtimes/react/controls/rich-text/components/Leaf/index.d.ts.map +1 -0
  176. package/dist/types/src/runtimes/react/controls/rich-text/components/Leaf/leaf.d.ts.map +1 -0
  177. package/dist/types/src/runtimes/react/controls/rich-text/components/index.d.ts.map +1 -0
  178. package/dist/types/src/runtimes/react/controls/rich-text/index.d.ts +2 -0
  179. package/dist/types/src/runtimes/react/controls/rich-text/index.d.ts.map +1 -0
  180. package/dist/types/src/runtimes/react/controls/{rich-text.d.ts → rich-text/rich-text.d.ts} +1 -1
  181. package/dist/types/src/runtimes/react/controls/rich-text/rich-text.d.ts.map +1 -0
  182. package/dist/types/src/runtimes/react/controls/rich-text-v2/EditableTextV2/editable-text-v2.d.ts.map +1 -1
  183. package/dist/types/src/runtimes/react/controls/rich-text-v2/EditableTextV2/render-element.d.ts +2 -1
  184. package/dist/types/src/runtimes/react/controls/rich-text-v2/EditableTextV2/render-element.d.ts.map +1 -1
  185. package/dist/types/src/runtimes/react/controls/rich-text-v2/EditableTextV2/render-leaf.d.ts +2 -1
  186. package/dist/types/src/runtimes/react/controls/rich-text-v2/EditableTextV2/render-leaf.d.ts.map +1 -1
  187. package/dist/types/src/runtimes/react/controls/rich-text-v2/EditableTextV2/useRemoteChanges.d.ts.map +1 -1
  188. package/dist/types/src/runtimes/react/controls/rich-text-v2/ReadOnlyTextV2.d.ts +2 -1
  189. package/dist/types/src/runtimes/react/controls/rich-text-v2/ReadOnlyTextV2.d.ts.map +1 -1
  190. package/dist/types/src/slate/BlockPlugin/index.d.ts +3 -3
  191. package/dist/types/src/slate/BlockPlugin/index.d.ts.map +1 -1
  192. package/dist/types/src/slate/InlineModePlugin/index.d.ts +6 -4
  193. package/dist/types/src/slate/InlineModePlugin/index.d.ts.map +1 -1
  194. package/dist/types/src/slate/InlinePlugin/index.d.ts +3 -3
  195. package/dist/types/src/slate/InlinePlugin/index.d.ts.map +1 -1
  196. package/dist/types/src/slate/InlinePlugin/types.d.ts +1 -1
  197. package/dist/types/src/slate/InlinePlugin/types.d.ts.map +1 -1
  198. package/dist/types/src/slate/LinkPlugin/index.d.ts +3 -3
  199. package/dist/types/src/slate/LinkPlugin/index.d.ts.map +1 -1
  200. package/dist/types/src/slate/LinkPlugin/linkPluginWithoutRenderElement.d.ts +16 -0
  201. package/dist/types/src/slate/LinkPlugin/linkPluginWithoutRenderElement.d.ts.map +1 -0
  202. package/dist/types/src/slate/TextAlignPlugin/index.d.ts +3 -3
  203. package/dist/types/src/slate/TypographyPlugin/index.d.ts +3 -3
  204. package/dist/types/src/slate/TypographyPlugin/index.d.ts.map +1 -1
  205. package/dist/types/src/slate/types.d.ts +1 -10
  206. package/dist/types/src/slate/types.d.ts.map +1 -1
  207. package/dist/types/src/slate/utils/element.d.ts.map +1 -1
  208. package/dist/types/src/state/actions.d.ts +2 -1
  209. package/dist/types/src/state/actions.d.ts.map +1 -1
  210. package/dist/types/src/state/modules/locales.d.ts.map +1 -1
  211. package/dist/types/src/state/react-builder-preview.d.ts.map +1 -1
  212. package/package.json +1 -1
  213. package/dist/index.cjs10.js +0 -390
  214. package/dist/index.cjs10.js.map +0 -1
  215. package/dist/index.cjs9.js +0 -295
  216. package/dist/index.cjs9.js.map +0 -1
  217. package/dist/index.es10.js +0 -383
  218. package/dist/index.es10.js.map +0 -1
  219. package/dist/index.es9.js +0 -288
  220. package/dist/index.es9.js.map +0 -1
  221. package/dist/types/src/components/builtin/Text/EditableText/editable-text.d.ts.map +0 -1
  222. package/dist/types/src/components/builtin/Text/EditableText/index.d.ts.map +0 -1
  223. package/dist/types/src/components/builtin/Text/EditableText/useSyncDOMSelection.d.ts.map +0 -1
  224. package/dist/types/src/components/builtin/Text/EditableText/useSyncWithBuilder.d.ts.map +0 -1
  225. package/dist/types/src/components/builtin/Text/ReadOnlyText.d.ts.map +0 -1
  226. package/dist/types/src/components/builtin/Text/components/Element/block.d.ts.map +0 -1
  227. package/dist/types/src/components/builtin/Text/components/Element/element.d.ts.map +0 -1
  228. package/dist/types/src/components/builtin/Text/components/Element/index.d.ts.map +0 -1
  229. package/dist/types/src/components/builtin/Text/components/Element/inline.d.ts.map +0 -1
  230. package/dist/types/src/components/builtin/Text/components/Leaf/index.d.ts.map +0 -1
  231. package/dist/types/src/components/builtin/Text/components/Leaf/leaf.d.ts.map +0 -1
  232. package/dist/types/src/components/builtin/Text/components/index.d.ts.map +0 -1
  233. package/dist/types/src/runtimes/react/controls/rich-text.d.ts.map +0 -1
  234. package/dist/types.cjs2.js +0 -765
  235. package/dist/types.cjs2.js.map +0 -1
  236. package/dist/types.es2.js +0 -748
  237. package/dist/types.es2.js.map +0 -1
  238. /package/dist/types/src/{components/builtin/Text → runtimes/react/controls/rich-text}/EditableText/index.d.ts +0 -0
  239. /package/dist/types/src/{components/builtin/Text → runtimes/react/controls/rich-text}/EditableText/useSyncDOMSelection.d.ts +0 -0
  240. /package/dist/types/src/{components/builtin/Text → runtimes/react/controls/rich-text}/components/Element/element.d.ts +0 -0
  241. /package/dist/types/src/{components/builtin/Text → runtimes/react/controls/rich-text}/components/Element/index.d.ts +0 -0
  242. /package/dist/types/src/{components/builtin/Text → runtimes/react/controls/rich-text}/components/Leaf/index.d.ts +0 -0
  243. /package/dist/types/src/{components/builtin/Text → runtimes/react/controls/rich-text}/components/Leaf/leaf.d.ts +0 -0
  244. /package/dist/types/src/{components/builtin/Text → runtimes/react/controls/rich-text}/components/index.d.ts +0 -0
@@ -1,390 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __defProps = Object.defineProperties;
4
- var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
5
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
8
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
9
- var __spreadValues = (a, b) => {
10
- for (var prop in b || (b = {}))
11
- if (__hasOwnProp.call(b, prop))
12
- __defNormalProp(a, prop, b[prop]);
13
- if (__getOwnPropSymbols)
14
- for (var prop of __getOwnPropSymbols(b)) {
15
- if (__propIsEnum.call(b, prop))
16
- __defNormalProp(a, prop, b[prop]);
17
- }
18
- return a;
19
- };
20
- var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
21
- var __objRest = (source, exclude) => {
22
- var target = {};
23
- for (var prop in source)
24
- if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
25
- target[prop] = source[prop];
26
- if (source != null && __getOwnPropSymbols)
27
- for (var prop of __getOwnPropSymbols(source)) {
28
- if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
29
- target[prop] = source[prop];
30
- }
31
- return target;
32
- };
33
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
34
- var React = require("react");
35
- var slate = require("slate");
36
- var slateReact = require("slate-react");
37
- var css = require("@emotion/css");
38
- var boxModels = require("./box-models.cjs.js");
39
- var reactPage = require("./react-page.cjs.js");
40
- var next = require("./index.cjs.js");
41
- var jsxRuntime = require("react/jsx-runtime");
42
- require("./state/breakpoints.cjs.js");
43
- require("./actions.cjs.js");
44
- var types = require("./types.cjs2.js");
45
- var isHotkey = require("is-hotkey");
46
- var index = require("./index.cjs3.js");
47
- require("uuid");
48
- var index$1 = require("./index.cjs5.js");
49
- var index$2 = require("./index.cjs7.js");
50
- var useIsomorphicLayoutEffect = require("./useIsomorphicLayoutEffect.cjs.js");
51
- require("css-box-model");
52
- require("redux");
53
- require("redux-thunk");
54
- require("@emotion/serialize");
55
- require("@emotion/utils");
56
- require("use-sync-external-store/shim/with-selector");
57
- require("next/dynamic");
58
- require("./text-input.cjs.js");
59
- require("./combobox.cjs.js");
60
- require("use-sync-external-store/shim");
61
- require("./types.cjs.js");
62
- require("color");
63
- require("scroll-into-view-if-needed");
64
- require("react-dom");
65
- require("html-react-parser");
66
- require("next/head");
67
- require("zod");
68
- require("@emotion/server/create-instance");
69
- require("next/document");
70
- require("cors");
71
- require("path-to-regexp");
72
- require("cookie");
73
- require("http-proxy");
74
- require("set-cookie-parser");
75
- require("./constants.cjs.js");
76
- require("corporate-ipsum");
77
- require("next/link");
78
- function _interopDefaultLegacy(e) {
79
- return e && typeof e === "object" && "default" in e ? e : { "default": e };
80
- }
81
- var isHotkey__default = /* @__PURE__ */ _interopDefaultLegacy(isHotkey);
82
- function Leaf(_a) {
83
- var _b = _a, {
84
- leaf
85
- } = _b, props = __objRest(_b, [
86
- "leaf"
87
- ]);
88
- const enhancedTypography = next.useEnhancedTypography(leaf.typography);
89
- const typographyClassName = next.useTypographyClassName(enhancedTypography);
90
- return /* @__PURE__ */ jsxRuntime.jsx("span", __spreadProps(__spreadValues({}, props.attributes), {
91
- className: typographyClassName,
92
- children: props.children
93
- }));
94
- }
95
- function BlockElement({
96
- element,
97
- attributes,
98
- children
99
- }) {
100
- const blockStyles = [reactPage.useStyle({
101
- margin: 0
102
- }), reactPage.useStyle(next.useResponsiveStyle([element.textAlign], ([textAlign = "left"]) => ({
103
- textAlign
104
- })))];
105
- const quoteStyles = reactPage.useStyle({
106
- padding: "0.5em 10px",
107
- fontSize: "1.25em",
108
- fontWeight: "300",
109
- borderLeft: "5px solid rgba(0, 0, 0, 0.1)"
110
- });
111
- switch (element.type) {
112
- case reactPage.BlockType.Text:
113
- return /* @__PURE__ */ jsxRuntime.jsx("span", __spreadProps(__spreadValues({}, attributes), {
114
- className: css.cx(...blockStyles),
115
- children
116
- }));
117
- case reactPage.BlockType.Default:
118
- case reactPage.BlockType.Paragraph:
119
- return /* @__PURE__ */ jsxRuntime.jsx("p", __spreadProps(__spreadValues({}, attributes), {
120
- className: css.cx(...blockStyles),
121
- children
122
- }));
123
- case reactPage.BlockType.Heading1:
124
- return /* @__PURE__ */ jsxRuntime.jsx("h1", __spreadProps(__spreadValues({}, attributes), {
125
- className: css.cx(...blockStyles),
126
- children
127
- }));
128
- case reactPage.BlockType.Heading2:
129
- return /* @__PURE__ */ jsxRuntime.jsx("h2", __spreadProps(__spreadValues({}, attributes), {
130
- className: css.cx(...blockStyles),
131
- children
132
- }));
133
- case reactPage.BlockType.Heading3:
134
- return /* @__PURE__ */ jsxRuntime.jsx("h3", __spreadProps(__spreadValues({}, attributes), {
135
- className: css.cx(...blockStyles),
136
- children
137
- }));
138
- case reactPage.BlockType.Heading4:
139
- return /* @__PURE__ */ jsxRuntime.jsx("h4", __spreadProps(__spreadValues({}, attributes), {
140
- className: css.cx(...blockStyles),
141
- children
142
- }));
143
- case reactPage.BlockType.Heading5:
144
- return /* @__PURE__ */ jsxRuntime.jsx("h5", __spreadProps(__spreadValues({}, attributes), {
145
- className: css.cx(...blockStyles),
146
- children
147
- }));
148
- case reactPage.BlockType.Heading6:
149
- return /* @__PURE__ */ jsxRuntime.jsx("h6", __spreadProps(__spreadValues({}, attributes), {
150
- className: css.cx(...blockStyles),
151
- children
152
- }));
153
- case reactPage.BlockType.BlockQuote:
154
- return /* @__PURE__ */ jsxRuntime.jsx("blockquote", __spreadProps(__spreadValues({}, attributes), {
155
- className: css.cx(...blockStyles, quoteStyles),
156
- children
157
- }));
158
- case reactPage.BlockType.OrderedList:
159
- return /* @__PURE__ */ jsxRuntime.jsx("ol", __spreadProps(__spreadValues({}, attributes), {
160
- className: css.cx(...blockStyles),
161
- style: {
162
- listStylePosition: "inside"
163
- },
164
- children
165
- }));
166
- case reactPage.BlockType.UnorderedList:
167
- return /* @__PURE__ */ jsxRuntime.jsx("ul", __spreadProps(__spreadValues({}, attributes), {
168
- className: css.cx(...blockStyles),
169
- style: {
170
- listStylePosition: "inside"
171
- },
172
- children
173
- }));
174
- case reactPage.BlockType.ListItem:
175
- return /* @__PURE__ */ jsxRuntime.jsx("li", __spreadProps(__spreadValues({}, attributes), {
176
- className: css.cx(...blockStyles),
177
- children
178
- }));
179
- case reactPage.BlockType.ListItemChild:
180
- return /* @__PURE__ */ jsxRuntime.jsx("span", __spreadProps(__spreadValues({}, attributes), {
181
- className: css.cx(...blockStyles),
182
- children
183
- }));
184
- }
185
- }
186
- function StyledLink(_c) {
187
- var _d = _c, {
188
- className
189
- } = _d, restOfProps = __objRest(_d, [
190
- "className"
191
- ]);
192
- return /* @__PURE__ */ jsxRuntime.jsx(index.Link, __spreadProps(__spreadValues({}, restOfProps), {
193
- className: css.cx(reactPage.useStyle({
194
- textDecoration: "none"
195
- }), className)
196
- }));
197
- }
198
- function InlineElement({
199
- element,
200
- attributes,
201
- children
202
- }) {
203
- var _a;
204
- switch (element.type) {
205
- case reactPage.InlineType.Code:
206
- return /* @__PURE__ */ jsxRuntime.jsx("code", __spreadProps(__spreadValues({}, attributes), {
207
- children
208
- }));
209
- case reactPage.InlineType.SuperScript:
210
- return /* @__PURE__ */ jsxRuntime.jsx("sup", __spreadProps(__spreadValues({}, attributes), {
211
- children
212
- }));
213
- case reactPage.InlineType.SubScript:
214
- return /* @__PURE__ */ jsxRuntime.jsx("sub", __spreadProps(__spreadValues({}, attributes), {
215
- children
216
- }));
217
- case reactPage.InlineType.Link:
218
- return /* @__PURE__ */ jsxRuntime.jsx(StyledLink, __spreadProps(__spreadValues({}, attributes), {
219
- link: (_a = element.link) != null ? _a : void 0,
220
- children
221
- }));
222
- }
223
- }
224
- function Element(_e) {
225
- var _f = _e, {
226
- element
227
- } = _f, props = __objRest(_f, [
228
- "element"
229
- ]);
230
- switch (element.type) {
231
- case reactPage.InlineType.Code:
232
- case reactPage.InlineType.SuperScript:
233
- case reactPage.InlineType.SubScript:
234
- case reactPage.InlineType.Link:
235
- return /* @__PURE__ */ jsxRuntime.jsx(InlineElement, __spreadValues({
236
- element
237
- }, props));
238
- case reactPage.BlockType.Text:
239
- case reactPage.BlockType.Default:
240
- case reactPage.BlockType.Paragraph:
241
- case reactPage.BlockType.Heading1:
242
- case reactPage.BlockType.Heading2:
243
- case reactPage.BlockType.Heading3:
244
- case reactPage.BlockType.Heading4:
245
- case reactPage.BlockType.Heading5:
246
- case reactPage.BlockType.Heading6:
247
- case reactPage.BlockType.BlockQuote:
248
- case reactPage.BlockType.OrderedList:
249
- case reactPage.BlockType.UnorderedList:
250
- case reactPage.BlockType.ListItem:
251
- case reactPage.BlockType.ListItemChild:
252
- return /* @__PURE__ */ jsxRuntime.jsx(BlockElement, __spreadValues({
253
- element
254
- }, props));
255
- default:
256
- return /* @__PURE__ */ jsxRuntime.jsx("span", __spreadProps(__spreadValues({}, props.attributes), {
257
- children: props.children
258
- }));
259
- }
260
- }
261
- const COMMIT_DEBOUNCE_DELAY = 500;
262
- function useSyncWithBuilder(editor, text) {
263
- const [shouldCommit, setShouldCommit] = React.useState(true);
264
- const isInBuilder = next.useIsInBuilder();
265
- React.useEffect(() => {
266
- if (shouldCommit && text && isInBuilder) {
267
- const nextValue = reactPage.richTextDTOtoDAO(text);
268
- const nextSelection = reactPage.richTextDTOtoSelection(text);
269
- if (!next.deepEqual(editor.children, nextValue) || !next.deepEqual(editor.selection, nextSelection)) {
270
- editor.children = nextValue;
271
- editor.selection = nextSelection;
272
- editor.onChange();
273
- }
274
- }
275
- }, [editor, shouldCommit, text]);
276
- React.useEffect(() => {
277
- if (shouldCommit)
278
- return;
279
- const timeoutId = window.setTimeout(() => {
280
- setShouldCommit(true);
281
- }, COMMIT_DEBOUNCE_DELAY);
282
- return () => {
283
- window.clearTimeout(timeoutId);
284
- };
285
- }, [shouldCommit]);
286
- return React.useCallback(() => setShouldCommit(false), []);
287
- }
288
- function useSyncDOMSelection(editor, isEnabled) {
289
- useIsomorphicLayoutEffect.useIsomorphicLayoutEffect(() => {
290
- if (!isEnabled || editor.selection == null || slateReact.ReactEditor.isFocused(editor))
291
- return;
292
- try {
293
- const root = slateReact.ReactEditor.findDocumentOrShadowRoot(editor);
294
- const domSelection = root.getSelection();
295
- const newDomRange = slateReact.ReactEditor.toDOMRange(editor, editor.selection);
296
- if (newDomRange) {
297
- if (slate.Range.isBackward(editor.selection)) {
298
- domSelection == null ? void 0 : domSelection.setBaseAndExtent(newDomRange.endContainer, newDomRange.endOffset, newDomRange.startContainer, newDomRange.startOffset);
299
- } else {
300
- domSelection == null ? void 0 : domSelection.setBaseAndExtent(newDomRange.startContainer, newDomRange.startOffset, newDomRange.endContainer, newDomRange.endOffset);
301
- }
302
- } else {
303
- domSelection == null ? void 0 : domSelection.removeAllRanges();
304
- }
305
- } catch (e) {
306
- console.error(e);
307
- }
308
- });
309
- }
310
- const defaultText = [{
311
- type: reactPage.BlockType.Paragraph,
312
- children: [{
313
- text: ""
314
- }]
315
- }];
316
- const EditableText = React.forwardRef(function EditableText2({
317
- id,
318
- text,
319
- width,
320
- margin
321
- }, ref) {
322
- const [editor] = React.useState(() => types.withBlock(index$1.withTypography(index$2.withBuilder(slateReact.withReact(slate.createEditor())))));
323
- const [isPreservingDOMSElection, setIsPreservingDOMSelection] = React.useState(false);
324
- useSyncDOMSelection(editor, isPreservingDOMSElection);
325
- const delaySync = useSyncWithBuilder(editor, text);
326
- const editMode = next.useBuilderEditMode();
327
- const [propControllers, setPropControllers] = React.useState(null);
328
- const controller = propControllers == null ? void 0 : propControllers.text;
329
- React.useEffect(() => {
330
- if (controller == null)
331
- return;
332
- const element = slateReact.ReactEditor.toDOMNode(editor, editor);
333
- return next.pollBoxModel({
334
- element,
335
- onBoxModelChange: (boxModel) => controller.changeBoxModel(boxModel)
336
- });
337
- }, [editor, controller]);
338
- React.useImperativeHandle(ref, () => ({
339
- getDomNode() {
340
- return slateReact.ReactEditor.toDOMNode(editor, editor);
341
- },
342
- getBoxModel() {
343
- return boxModels.getBox(slateReact.ReactEditor.toDOMNode(editor, editor));
344
- },
345
- setPropControllers
346
- }), [editor, setPropControllers]);
347
- const initialValue = React.useMemo(() => text ? reactPage.richTextDTOtoDAO(text) : defaultText, [text]);
348
- React.useEffect(() => {
349
- controller == null ? void 0 : controller.setSlateEditor(editor);
350
- }, [controller, editor]);
351
- const handleFocus = React.useCallback(() => {
352
- controller == null ? void 0 : controller.focus();
353
- setIsPreservingDOMSelection(true);
354
- }, [controller]);
355
- const handleKeyDown = React.useCallback((e) => {
356
- if (isHotkey__default["default"]("mod+shift+z", e))
357
- return controller == null ? void 0 : controller.redo();
358
- if (isHotkey__default["default"]("mod+z", e))
359
- return controller == null ? void 0 : controller.undo();
360
- if (isHotkey__default["default"]("escape")(e))
361
- return controller == null ? void 0 : controller.blur();
362
- types.onKeyDown(e, editor);
363
- }, [controller, editor]);
364
- const handleBlur = React.useCallback((e) => {
365
- if (e.relatedTarget == null)
366
- return;
367
- setIsPreservingDOMSelection(false);
368
- slateReact.ReactEditor.deselect(editor);
369
- }, []);
370
- return /* @__PURE__ */ jsxRuntime.jsx(slateReact.Slate, {
371
- editor,
372
- value: initialValue,
373
- onChange: delaySync,
374
- children: /* @__PURE__ */ jsxRuntime.jsx(slateReact.Editable, {
375
- id,
376
- renderLeaf: Leaf,
377
- renderElement: Element,
378
- onFocus: handleFocus,
379
- onKeyDown: handleKeyDown,
380
- onBlur: handleBlur,
381
- className: css.cx(width, margin),
382
- readOnly: editMode !== reactPage.BuilderEditMode.CONTENT,
383
- placeholder: "Write some text..."
384
- })
385
- });
386
- });
387
- var EditableText$1 = EditableText;
388
- exports.EditableText = EditableText;
389
- exports["default"] = EditableText$1;
390
- //# sourceMappingURL=index.cjs10.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.cjs10.js","sources":["../src/components/builtin/Text/components/Leaf/leaf.tsx","../src/components/builtin/Text/components/Element/block.tsx","../src/components/builtin/Text/components/Element/inline.tsx","../src/components/builtin/Text/components/Element/element.tsx","../src/components/builtin/Text/EditableText/useSyncWithBuilder.tsx","../src/components/builtin/Text/EditableText/useSyncDOMSelection.tsx","../src/components/builtin/Text/EditableText/editable-text.tsx"],"sourcesContent":["import { RenderLeafProps } from 'slate-react'\nimport useEnhancedTypography, {\n useTypographyClassName,\n} from '../../../../../runtimes/react/controls/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 { cx } from '@emotion/css'\nimport { RenderElementProps } from 'slate-react'\nimport { useStyle } from '../../../../../runtimes/react/use-style'\nimport { useResponsiveStyle } from '../../../../utils/responsive-style'\nimport { Block, BlockType } from '../../../../../slate'\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.Text:\n return (\n <span {...attributes} className={cx(...blockStyles)}>\n {children}\n </span>\n )\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 { useStyle } from '../../../../../runtimes/react/use-style'\nimport { Link } from '../../../../shared/Link'\nimport { Inline, InlineType } from '../../../../../slate'\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 { InlineType, BlockType } from '../../../../../slate'\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.Text:\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 { useState, useEffect, useCallback } from 'react'\nimport { Editor } from 'slate'\nimport { richTextDTOtoDAO, richTextDTOtoSelection } from '../../../../controls'\nimport { RichTextValue } from '../../../../prop-controllers'\nimport deepEqual from '../../../../utils/deepEqual'\nimport { useIsInBuilder } from '../../../../runtimes/react'\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 { ReactEditor } from 'slate-react'\nimport { useIsomorphicLayoutEffect } from '../../../hooks/useIsomorphicLayoutEffect'\nimport { Editor, Range as SlateRange } from 'slate'\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 {\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'\n\nimport { ElementIDValue, RichTextValue } from '../../../../prop-controllers/descriptors'\nimport { cx } from '@emotion/css'\nimport { DescriptorsPropControllers } from '../../../../prop-controllers/instances'\nimport { Descriptors } from '../../../../runtimes/react/controls/rich-text'\nimport { getBox } from '../../../../box-model'\nimport { PropControllersHandle } from '../../../../state/modules/prop-controller-handles'\nimport { richTextDTOtoDAO } from '../../../../controls'\nimport { Leaf } from '../components/Leaf'\nimport { Element } from '../components/Element'\nimport { useSyncWithBuilder } from './useSyncWithBuilder'\nimport isHotkey from 'is-hotkey'\nimport { useBuilderEditMode } from '../../../../runtimes/react'\nimport { BuilderEditMode } from '../../../../state/modules/builder-edit-mode'\nimport { onKeyDown, withBlock, withTypography, withBuilder } from '../../../../slate'\nimport { pollBoxModel } from '../../../../runtimes/react/poll-box-model'\nimport { useSyncDOMSelection } from './useSyncDOMSelection'\nimport { RichTextDAO, BlockType } from '../../../../slate'\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":["leaf","props","enhancedTypography","useEnhancedTypography","typography","typographyClassName","useTypographyClassName","attributes","children","element","blockStyles","useStyle","margin","useResponsiveStyle","textAlign","quoteStyles","padding","fontSize","fontWeight","borderLeft","type","BlockType","Text","cx","Default","Paragraph","Heading1","Heading2","Heading3","Heading4","Heading5","Heading6","BlockQuote","OrderedList","listStylePosition","UnorderedList","ListItem","ListItemChild","className","restOfProps","Link","textDecoration","InlineType","Code","SuperScript","SubScript","link","undefined","COMMIT_DEBOUNCE_DELAY","editor","text","shouldCommit","setShouldCommit","useState","isInBuilder","useIsInBuilder","useEffect","nextValue","richTextDTOtoDAO","nextSelection","richTextDTOtoSelection","deepEqual","selection","onChange","timeoutId","window","setTimeout","clearTimeout","useCallback","isEnabled","useIsomorphicLayoutEffect","ReactEditor","isFocused","root","findDocumentOrShadowRoot","domSelection","getSelection","newDomRange","toDOMRange","SlateRange","isBackward","setBaseAndExtent","endContainer","endOffset","startContainer","startOffset","removeAllRanges","e","console","error","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","Slate","Editable","Leaf","Element","BuilderEditMode","CONTENT"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKqB,cAAA,IAAqC;AAArC,eAAEA;AAAAA;AAAAA,MAAF,IAAWC,kBAAX,IAAWA;AAAAA,IAATD;AAAAA;AAEfE,QAAAA,qBAAqBC,KAAAA,sBAAsBH,KAAKI,UAAN;AAG1CC,QAAAA,sBAAsBC,4BAAuBJ,kBAAD;AAGhD,wCAAA,QAAA,iCAAUD,MAAMM,aAAhB;AAAA,IAA4B,WAAWF;AAAAA,IAAvC,UACGJ,MAAMO;AAAAA,EAAAA,EAFX;AAKD;ACP4B,sBAAA;AAAA,EAAEC;AAAAA,EAASF;AAAAA,EAAYC;AAAAA,GAAsC;AAClFE,QAAAA,cAAc,CAClBC,mBAAS;AAAA,IAAEC,QAAQ;AAAA,EAAA,CAAX,GACR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