@makeswift/runtime 0.9.10 → 0.9.12

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 (209) hide show
  1. package/dist/Box.cjs.js +1 -1
  2. package/dist/Box.es.js +1 -1
  3. package/dist/Button.cjs.js +1 -1
  4. package/dist/Button.es.js +1 -1
  5. package/dist/Carousel.cjs.js +1 -1
  6. package/dist/Carousel.es.js +1 -1
  7. package/dist/Countdown.cjs.js +1 -1
  8. package/dist/Countdown.es.js +1 -1
  9. package/dist/Divider.cjs.js +1 -1
  10. package/dist/Divider.es.js +1 -1
  11. package/dist/Form.cjs.js +1 -1
  12. package/dist/Form.es.js +1 -1
  13. package/dist/Image.cjs.js +1 -1
  14. package/dist/Image.es.js +1 -1
  15. package/dist/LiveProvider.cjs.js +1 -1
  16. package/dist/LiveProvider.es.js +3 -3
  17. package/dist/Navigation.cjs.js +1 -1
  18. package/dist/Navigation.es.js +1 -1
  19. package/dist/PreviewProvider.cjs.js +1 -1
  20. package/dist/PreviewProvider.es.js +3 -3
  21. package/dist/ReadOnlyText.cjs.js +18 -3
  22. package/dist/ReadOnlyText.cjs.js.map +1 -1
  23. package/dist/ReadOnlyText.es.js +20 -5
  24. package/dist/ReadOnlyText.es.js.map +1 -1
  25. package/dist/ReadOnlyTextV2.cjs.js +116 -240
  26. package/dist/ReadOnlyTextV2.cjs.js.map +1 -1
  27. package/dist/ReadOnlyTextV2.es.js +115 -238
  28. package/dist/ReadOnlyTextV2.es.js.map +1 -1
  29. package/dist/Root.cjs.js +1 -1
  30. package/dist/Root.es.js +1 -1
  31. package/dist/SocialLinks.cjs.js +1 -1
  32. package/dist/SocialLinks.es.js +1 -1
  33. package/dist/Text.cjs.js +1 -1
  34. package/dist/Text.es.js +1 -1
  35. package/dist/components.cjs.js +1 -1
  36. package/dist/components.es.js +1 -1
  37. package/dist/control-serialization.es.js +1 -1
  38. package/dist/controls.cjs.js +28 -18
  39. package/dist/controls.cjs.js.map +1 -1
  40. package/dist/controls.es.js +2 -2
  41. package/dist/index.cjs.js +47 -42
  42. package/dist/index.cjs.js.map +1 -1
  43. package/dist/index.cjs10.js +2 -2
  44. package/dist/index.cjs2.js +3 -3
  45. package/dist/index.cjs2.js.map +1 -1
  46. package/dist/index.cjs5.js +5 -6
  47. package/dist/index.cjs5.js.map +1 -1
  48. package/dist/index.cjs6.js +20 -0
  49. package/dist/index.cjs6.js.map +1 -1
  50. package/dist/index.cjs8.js +1 -1
  51. package/dist/index.cjs9.js +27 -31
  52. package/dist/index.cjs9.js.map +1 -1
  53. package/dist/index.es.js +22 -18
  54. package/dist/index.es.js.map +1 -1
  55. package/dist/index.es10.js +4 -4
  56. package/dist/index.es2.js +2 -2
  57. package/dist/index.es3.js +1 -1
  58. package/dist/index.es5.js +1 -2
  59. package/dist/index.es5.js.map +1 -1
  60. package/dist/index.es6.js +21 -2
  61. package/dist/index.es6.js.map +1 -1
  62. package/dist/index.es8.js +1 -1
  63. package/dist/index.es9.js +31 -35
  64. package/dist/index.es9.js.map +1 -1
  65. package/dist/next.cjs.js +1 -1
  66. package/dist/next.es.js +2 -2
  67. package/dist/react-page.cjs.js +310 -147
  68. package/dist/react-page.cjs.js.map +1 -1
  69. package/dist/react-page.es.js +297 -146
  70. package/dist/react-page.es.js.map +1 -1
  71. package/dist/react.cjs.js +1 -1
  72. package/dist/react.es.js +1 -1
  73. package/dist/slate.cjs.js +40 -27
  74. package/dist/slate.cjs.js.map +1 -1
  75. package/dist/slate.es.js +49 -37
  76. package/dist/slate.es.js.map +1 -1
  77. package/dist/{typography.cjs.js → text-input.cjs.js} +1 -9
  78. package/dist/text-input.cjs.js.map +1 -0
  79. package/dist/{typography.es.js → text-input.es.js} +2 -8
  80. package/dist/text-input.es.js.map +1 -0
  81. package/dist/types/src/api/react.d.ts +1 -1
  82. package/dist/types/src/api/react.d.ts.map +1 -1
  83. package/dist/types/src/components/builtin/Button/Button.d.ts +3 -39
  84. package/dist/types/src/components/builtin/Button/Button.d.ts.map +1 -1
  85. package/dist/types/src/components/builtin/Form/components/Field/components/Checkbox/index.d.ts +2 -2
  86. package/dist/types/src/components/builtin/Form/components/Field/components/Input/index.d.ts +1 -1
  87. package/dist/types/src/components/builtin/Form/components/Field/components/PlaceholderTableField/index.d.ts +0 -1
  88. package/dist/types/src/components/builtin/Form/components/Field/components/PlaceholderTableField/index.d.ts.map +1 -1
  89. package/dist/types/src/components/builtin/Form/components/Field/components/RadioButton/index.d.ts +2 -2
  90. package/dist/types/src/components/builtin/Form/components/Field/components/TextArea/index.d.ts +1 -1
  91. package/dist/types/src/components/builtin/Form/components/Field/index.d.ts +0 -1
  92. package/dist/types/src/components/builtin/Form/components/Field/index.d.ts.map +1 -1
  93. package/dist/types/src/components/builtin/Form/components/Spinner/index.d.ts +0 -1
  94. package/dist/types/src/components/builtin/Form/components/Spinner/index.d.ts.map +1 -1
  95. package/dist/types/src/components/builtin/Navigation/components/DropDownButton/index.d.ts +1 -1
  96. package/dist/types/src/components/builtin/Navigation/components/DropDownButton/index.d.ts.map +1 -1
  97. package/dist/types/src/components/builtin/Navigation/components/LinksPlaceholder/index.d.ts +0 -1
  98. package/dist/types/src/components/builtin/Navigation/components/LinksPlaceholder/index.d.ts.map +1 -1
  99. package/dist/types/src/components/builtin/Navigation/components/MobileMenu/components/MobileDropDownButton/index.d.ts +1 -1
  100. package/dist/types/src/components/builtin/Navigation/components/MobileMenu/components/MobileDropDownButton/index.d.ts.map +1 -1
  101. package/dist/types/src/components/builtin/Navigation/components/MobileMenu/index.d.ts +0 -1
  102. package/dist/types/src/components/builtin/Navigation/components/MobileMenu/index.d.ts.map +1 -1
  103. package/dist/types/src/components/builtin/SocialLinks/components/SocialLinksPlaceholder/index.d.ts +0 -1
  104. package/dist/types/src/components/builtin/SocialLinks/components/SocialLinksPlaceholder/index.d.ts.map +1 -1
  105. package/dist/types/src/components/builtin/SocialLinks/options.d.ts +23 -24
  106. package/dist/types/src/components/builtin/SocialLinks/options.d.ts.map +1 -1
  107. package/dist/types/src/components/builtin/Text/ReadOnlyText.d.ts +2 -2
  108. package/dist/types/src/components/builtin/Text/ReadOnlyText.d.ts.map +1 -1
  109. package/dist/types/src/components/builtin/Text/components/Element/block.d.ts +1 -2
  110. package/dist/types/src/components/builtin/Text/components/Element/block.d.ts.map +1 -1
  111. package/dist/types/src/components/builtin/Text/components/Element/element.d.ts +1 -2
  112. package/dist/types/src/components/builtin/Text/components/Element/element.d.ts.map +1 -1
  113. package/dist/types/src/components/builtin/Text/components/Element/inline.d.ts +1 -2
  114. package/dist/types/src/components/builtin/Text/components/Element/inline.d.ts.map +1 -1
  115. package/dist/types/src/components/builtin/Text/components/Leaf/leaf.d.ts +1 -2
  116. package/dist/types/src/components/builtin/Text/components/Leaf/leaf.d.ts.map +1 -1
  117. package/dist/types/src/components/page/Page.d.ts +0 -1
  118. package/dist/types/src/components/page/Page.d.ts.map +1 -1
  119. package/dist/types/src/components/shared/BackgroundsContainer/components/BackgroundVideo/index.d.ts +0 -1
  120. package/dist/types/src/components/shared/BackgroundsContainer/components/BackgroundVideo/index.d.ts.map +1 -1
  121. package/dist/types/src/components/shared/BackgroundsContainer/components/Backgrounds/index.d.ts +0 -1
  122. package/dist/types/src/components/shared/BackgroundsContainer/components/Backgrounds/index.d.ts.map +1 -1
  123. package/dist/types/src/components/shared/BackgroundsContainer/index.d.ts +1 -1
  124. package/dist/types/src/components/shared/GutterContainer/index.d.ts +1 -1
  125. package/dist/types/src/components/shared/GutterContainer/index.d.ts.map +1 -1
  126. package/dist/types/src/components/shared/Link/index.d.ts +1 -1
  127. package/dist/types/src/components/shared/Link/index.d.ts.map +1 -1
  128. package/dist/types/src/components/shared/grid-item.d.ts +1 -1
  129. package/dist/types/src/components/shared/grid-item.d.ts.map +1 -1
  130. package/dist/types/src/controls/list.d.ts +5 -2
  131. package/dist/types/src/controls/list.d.ts.map +1 -1
  132. package/dist/types/src/controls/rich-text/introspection.d.ts +5 -0
  133. package/dist/types/src/controls/rich-text/introspection.d.ts.map +1 -0
  134. package/dist/types/src/controls/rich-text/introspection.test.d.ts +2 -0
  135. package/dist/types/src/controls/rich-text/introspection.test.d.ts.map +1 -0
  136. package/dist/types/src/controls/rich-text-v2/introspection.d.ts +5 -0
  137. package/dist/types/src/controls/rich-text-v2/introspection.d.ts.map +1 -0
  138. package/dist/types/src/controls/rich-text-v2/introspection.test.d.ts +2 -0
  139. package/dist/types/src/controls/rich-text-v2/introspection.test.d.ts.map +1 -0
  140. package/dist/types/src/controls/rich-text-v2/rich-text-v2.d.ts +15 -3
  141. package/dist/types/src/controls/rich-text-v2/rich-text-v2.d.ts.map +1 -1
  142. package/dist/types/src/controls/rich-text-v2/translation.d.ts +1 -1
  143. package/dist/types/src/controls/rich-text-v2/translation.d.ts.map +1 -1
  144. package/dist/types/src/controls/shape.d.ts +5 -2
  145. package/dist/types/src/controls/shape.d.ts.map +1 -1
  146. package/dist/types/src/controls/typography.d.ts +2 -0
  147. package/dist/types/src/controls/typography.d.ts.map +1 -1
  148. package/dist/types/src/next/client.d.ts.map +1 -1
  149. package/dist/types/src/next/document.d.ts +1 -2
  150. package/dist/types/src/next/document.d.ts.map +1 -1
  151. package/dist/types/src/next/index.d.ts +1 -1
  152. package/dist/types/src/next/index.d.ts.map +1 -1
  153. package/dist/types/src/next/preview-mode.d.ts +1 -2
  154. package/dist/types/src/next/preview-mode.d.ts.map +1 -1
  155. package/dist/types/src/prop-controllers/descriptors.d.ts +10 -0
  156. package/dist/types/src/prop-controllers/descriptors.d.ts.map +1 -1
  157. package/dist/types/src/prop-controllers/introspection.d.ts +0 -2
  158. package/dist/types/src/prop-controllers/introspection.d.ts.map +1 -1
  159. package/dist/types/src/runtimes/react/components/render-hook.d.ts +0 -1
  160. package/dist/types/src/runtimes/react/components/render-hook.d.ts.map +1 -1
  161. package/dist/types/src/runtimes/react/controls/control.d.ts +0 -1
  162. package/dist/types/src/runtimes/react/controls/control.d.ts.map +1 -1
  163. package/dist/types/src/runtimes/react/controls/list.d.ts +0 -1
  164. package/dist/types/src/runtimes/react/controls/list.d.ts.map +1 -1
  165. package/dist/types/src/runtimes/react/controls/rich-text-v2/EditableTextV2/editable-text-v2.d.ts +1 -1
  166. package/dist/types/src/runtimes/react/controls/rich-text-v2/EditableTextV2/editable-text-v2.d.ts.map +1 -1
  167. package/dist/types/src/runtimes/react/controls/rich-text-v2/EditableTextV2/render-element.d.ts +1 -2
  168. package/dist/types/src/runtimes/react/controls/rich-text-v2/EditableTextV2/render-element.d.ts.map +1 -1
  169. package/dist/types/src/runtimes/react/controls/rich-text-v2/EditableTextV2/render-leaf.d.ts +1 -2
  170. package/dist/types/src/runtimes/react/controls/rich-text-v2/EditableTextV2/render-leaf.d.ts.map +1 -1
  171. package/dist/types/src/runtimes/react/controls/rich-text-v2/EditableTextV2/useRemoteChanges.d.ts +4 -0
  172. package/dist/types/src/runtimes/react/controls/rich-text-v2/EditableTextV2/useRemoteChanges.d.ts.map +1 -0
  173. package/dist/types/src/runtimes/react/controls/rich-text-v2/ReadOnlyTextV2.d.ts +7 -16
  174. package/dist/types/src/runtimes/react/controls/rich-text-v2/ReadOnlyTextV2.d.ts.map +1 -1
  175. package/dist/types/src/runtimes/react/controls/rich-text-v2/rich-text-v2.d.ts +1 -1
  176. package/dist/types/src/runtimes/react/controls/rich-text-v2/rich-text-v2.d.ts.map +1 -1
  177. package/dist/types/src/runtimes/react/controls/rich-text.d.ts +1 -1
  178. package/dist/types/src/runtimes/react/controls/rich-text.d.ts.map +1 -1
  179. package/dist/types/src/runtimes/react/controls/shape.d.ts +0 -1
  180. package/dist/types/src/runtimes/react/controls/shape.d.ts.map +1 -1
  181. package/dist/types/src/runtimes/react/controls/slot.d.ts +2 -2
  182. package/dist/types/src/runtimes/react/controls/slot.d.ts.map +1 -1
  183. package/dist/types/src/runtimes/react/controls/style-v2.d.ts +0 -1
  184. package/dist/types/src/runtimes/react/controls/style-v2.d.ts.map +1 -1
  185. package/dist/types/src/runtimes/react/controls.d.ts +0 -1
  186. package/dist/types/src/runtimes/react/controls.d.ts.map +1 -1
  187. package/dist/types/src/runtimes/react/find-dom-node.d.ts.map +1 -1
  188. package/dist/types/src/runtimes/react/index.d.ts +1 -1
  189. package/dist/types/src/runtimes/react/index.d.ts.map +1 -1
  190. package/dist/types/src/slate/LinkPlugin/index.d.ts.map +1 -1
  191. package/dist/types/src/slate/LocalChangesPlugin/index.d.ts +16 -0
  192. package/dist/types/src/slate/LocalChangesPlugin/index.d.ts.map +1 -0
  193. package/dist/types/src/slate/TextAlignPlugin/index.d.ts +3 -3
  194. package/dist/types/src/slate/TextAlignPlugin/index.d.ts.map +1 -1
  195. package/dist/types/src/slate/index.d.ts +1 -0
  196. package/dist/types/src/slate/index.d.ts.map +1 -1
  197. package/dist/types/src/slate/types.d.ts +2 -2
  198. package/dist/types/src/slate/types.d.ts.map +1 -1
  199. package/dist/types/src/slate/utils/responsive.d.ts +1 -1
  200. package/dist/types/src/slate/utils/responsive.d.ts.map +1 -1
  201. package/dist/types/src/state/modules/react-components.d.ts +2 -2
  202. package/dist/types/src/state/modules/react-components.d.ts.map +1 -1
  203. package/dist/types.cjs2.js +67 -48
  204. package/dist/types.cjs2.js.map +1 -1
  205. package/dist/types.es2.js +64 -45
  206. package/dist/types.es2.js.map +1 -1
  207. package/package.json +4 -5
  208. package/dist/typography.cjs.js.map +0 -1
  209. package/dist/typography.es.js.map +0 -1
@@ -1,31 +1,50 @@
1
- import { cx } from "@emotion/css";
1
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
2
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
3
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
4
+ var __objRest = (source, exclude) => {
5
+ var target = {};
6
+ for (var prop in source)
7
+ if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
8
+ target[prop] = source[prop];
9
+ if (source != null && __getOwnPropSymbols)
10
+ for (var prop of __getOwnPropSymbols(source)) {
11
+ if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
12
+ target[prop] = source[prop];
13
+ }
14
+ return target;
15
+ };
2
16
  import { forwardRef } from "react";
3
- import { V as useEnhancedTypography, W as useTypographyClassName, n as useResponsiveStyle } from "./index.es.js";
4
- import { b9 as RichTextV2Mode, U as useStyle, bi as BlockType, bg as InlineType } from "./react-page.es.js";
5
- import "./actions.es.js";
6
- import { L as Link } from "./index.es3.js";
17
+ import { U as useStyle, bu as BlockType, bs as InlineType } from "./react-page.es.js";
7
18
  import "slate";
8
19
  import "./state/breakpoints.es.js";
20
+ import "./actions.es.js";
9
21
  import "./types.es2.js";
10
22
  import "is-hotkey";
11
23
  import "slate-react";
12
24
  import { jsx, Fragment } from "react/jsx-runtime";
25
+ import "./index.es3.js";
26
+ import "@emotion/css";
27
+ import "uuid";
28
+ import { T as ControlValue } from "./index.es.js";
29
+ import "redux";
30
+ import "redux-thunk";
31
+ import "@emotion/serialize";
32
+ import "@emotion/utils";
33
+ import "zod";
34
+ import "./text-input.es.js";
35
+ import "scroll-into-view-if-needed";
36
+ import "next/link";
13
37
  import "use-sync-external-store/shim/with-selector";
14
38
  import "next/dynamic";
15
- import "./typography.es.js";
16
39
  import "./combobox.es.js";
17
40
  import "use-sync-external-store/shim";
18
- import "redux";
19
- import "redux-thunk";
20
41
  import "./types.es.js";
21
42
  import "./box-models.es.js";
22
43
  import "css-box-model";
23
44
  import "color";
24
- import "scroll-into-view-if-needed";
25
45
  import "react-dom";
26
46
  import "html-react-parser";
27
47
  import "next/head";
28
- import "zod";
29
48
  import "@emotion/server/create-instance";
30
49
  import "next/document";
31
50
  import "cors";
@@ -34,25 +53,20 @@ import "cookie";
34
53
  import "http-proxy";
35
54
  import "set-cookie-parser";
36
55
  import "./constants.es.js";
37
- import "uuid";
38
56
  import "corporate-ipsum";
39
- import "@emotion/serialize";
40
- import "@emotion/utils";
41
- import "next/link";
42
57
  const ReadOnlyTextV2 = forwardRef(function ReadOnlyText({
43
58
  text: {
44
59
  descendants
45
60
  },
46
- control
61
+ definition
47
62
  }, ref) {
48
63
  var _a;
49
64
  const descendantsAsString = getText(descendants);
50
- const mode = (_a = control == null ? void 0 : control.descriptor.config.mode) != null ? _a : RichTextV2Mode.Block;
51
65
  return /* @__PURE__ */ jsx("div", {
52
66
  ref,
53
67
  children: descendantsAsString === "" ? /* @__PURE__ */ jsx(Placeholder, {}) : /* @__PURE__ */ jsx(Descendants, {
54
- descendants,
55
- mode
68
+ plugins: (_a = definition == null ? void 0 : definition.config.plugins) != null ? _a : [],
69
+ descendants
56
70
  })
57
71
  });
58
72
  });
@@ -71,199 +85,74 @@ function Placeholder({
71
85
  children: text
72
86
  });
73
87
  }
74
- function TextElement({
75
- descendant
76
- }) {
77
- const enhancedTypography = useEnhancedTypography(descendant.typography);
78
- const typographyClassName = useTypographyClassName(enhancedTypography);
79
- return /* @__PURE__ */ jsx("span", {
80
- className: typographyClassName,
81
- children: descendant.text === "" ? "\uFEFF" : descendant.text
88
+ function LeafComponent(_a) {
89
+ var _b = _a, {
90
+ plugins
91
+ } = _b, props = __objRest(_b, [
92
+ "plugins"
93
+ ]);
94
+ function initialRenderLeaf({
95
+ leaf
96
+ }) {
97
+ return /* @__PURE__ */ jsx("span", {
98
+ className: leaf.className,
99
+ children: leaf.text === "" ? "\uFEFF" : leaf.text
100
+ });
101
+ }
102
+ const renderLeaf = plugins.reduce((renderFn, plugin) => (props2) => {
103
+ const {
104
+ control,
105
+ renderLeaf: renderLeaf2
106
+ } = plugin;
107
+ if ((control == null ? void 0 : control.definition) == null || renderLeaf2 == null)
108
+ return renderFn(props2);
109
+ if (control.getLeafValue == null)
110
+ return renderLeaf2(renderFn, void 0)(props2);
111
+ return /* @__PURE__ */ jsx(ControlValue, {
112
+ definition: control.definition,
113
+ data: control.getLeafValue(props2.leaf),
114
+ children: (value) => renderLeaf2(renderFn, value)(props2)
115
+ });
116
+ }, initialRenderLeaf);
117
+ return renderLeaf({
118
+ attributes: {},
119
+ leaf: props.leaf,
120
+ children: null,
121
+ text: props.leaf
82
122
  });
83
123
  }
84
- function InlineElement({
85
- descendant,
86
- mode
87
- }) {
88
- var _a;
89
- const linkClassName = useStyle({
90
- textDecoration: "none"
91
- });
92
- switch (descendant.type) {
93
- case InlineType.Code:
94
- return /* @__PURE__ */ jsx("code", {
95
- children: /* @__PURE__ */ jsx(Descendants, {
96
- descendants: descendant.children,
97
- mode
98
- })
99
- });
100
- case InlineType.SuperScript:
101
- return /* @__PURE__ */ jsx("sup", {
102
- children: /* @__PURE__ */ jsx(Descendants, {
103
- descendants: descendant.children,
104
- mode
105
- })
106
- });
107
- case InlineType.SubScript:
108
- return /* @__PURE__ */ jsx("sub", {
109
- children: /* @__PURE__ */ jsx(Descendants, {
110
- descendants: descendant.children,
111
- mode
112
- })
113
- });
114
- case InlineType.Link:
115
- return /* @__PURE__ */ jsx(Link, {
116
- className: linkClassName,
117
- link: (_a = descendant.link) != null ? _a : void 0,
118
- children: /* @__PURE__ */ jsx(Descendants, {
119
- descendants: descendant.children,
120
- mode
121
- })
122
- });
124
+ function ElementComponent(_c) {
125
+ var _d = _c, {
126
+ plugins
127
+ } = _d, props = __objRest(_d, [
128
+ "plugins"
129
+ ]);
130
+ function initialRenderElement(props2) {
131
+ return /* @__PURE__ */ jsx(Descendants, {
132
+ descendants: props2.element.children,
133
+ plugins
134
+ });
123
135
  }
124
- }
125
- function BlockElement({
126
- descendant,
127
- mode
128
- }) {
129
- const blockStyles = [useStyle({
130
- margin: 0
131
- }), useStyle(useResponsiveStyle([descendant.textAlign], ([textAlign = "left"]) => ({
132
- textAlign
133
- })))];
134
- const quoteStyle = useStyle({
135
- padding: "0.5em 10px",
136
- fontSize: "1.25em",
137
- fontWeight: "300",
138
- borderLeft: "5px solid rgba(0, 0, 0, 0.1)"
136
+ const renderElement = plugins.reduce((renderFn, plugin) => (props2) => {
137
+ const {
138
+ control,
139
+ renderElement: renderElement2
140
+ } = plugin;
141
+ if ((control == null ? void 0 : control.definition) == null || renderElement2 == null)
142
+ return renderFn(props2);
143
+ if (control.getElementValue == null)
144
+ return renderElement2(renderFn, void 0)(props2);
145
+ return /* @__PURE__ */ jsx(ControlValue, {
146
+ definition: control.definition,
147
+ data: control.getElementValue(props2.element),
148
+ children: (value) => renderElement2(renderFn, value)(props2)
149
+ });
150
+ }, initialRenderElement);
151
+ return renderElement({
152
+ attributes: {},
153
+ children: null,
154
+ element: props.descendant
139
155
  });
140
- const listStyles = useStyle({
141
- listStylePosition: "inside",
142
- paddingInlineStart: "20px",
143
- listStyleType: "disc"
144
- });
145
- switch (descendant.type) {
146
- case BlockType.Text:
147
- return /* @__PURE__ */ jsx("span", {
148
- className: cx(...blockStyles),
149
- children: /* @__PURE__ */ jsx(Descendants, {
150
- descendants: descendant.children,
151
- mode
152
- })
153
- });
154
- case BlockType.Paragraph:
155
- return /* @__PURE__ */ jsx("p", {
156
- className: cx(...blockStyles),
157
- children: /* @__PURE__ */ jsx(Descendants, {
158
- descendants: descendant.children,
159
- mode
160
- })
161
- });
162
- case BlockType.Heading1:
163
- return /* @__PURE__ */ jsx("h1", {
164
- className: cx(...blockStyles),
165
- children: /* @__PURE__ */ jsx(Descendants, {
166
- descendants: descendant.children,
167
- mode
168
- })
169
- });
170
- case BlockType.Heading2:
171
- return /* @__PURE__ */ jsx("h2", {
172
- className: cx(...blockStyles),
173
- children: /* @__PURE__ */ jsx(Descendants, {
174
- descendants: descendant.children,
175
- mode
176
- })
177
- });
178
- case BlockType.Heading3:
179
- return /* @__PURE__ */ jsx("h3", {
180
- className: cx(...blockStyles),
181
- children: /* @__PURE__ */ jsx(Descendants, {
182
- descendants: descendant.children,
183
- mode
184
- })
185
- });
186
- case BlockType.Heading4:
187
- return /* @__PURE__ */ jsx("h4", {
188
- className: cx(...blockStyles),
189
- children: /* @__PURE__ */ jsx(Descendants, {
190
- descendants: descendant.children,
191
- mode
192
- })
193
- });
194
- case BlockType.Heading5:
195
- return /* @__PURE__ */ jsx("h5", {
196
- className: cx(...blockStyles),
197
- children: /* @__PURE__ */ jsx(Descendants, {
198
- descendants: descendant.children,
199
- mode
200
- })
201
- });
202
- case BlockType.Heading6:
203
- return /* @__PURE__ */ jsx("h6", {
204
- className: cx(...blockStyles),
205
- children: /* @__PURE__ */ jsx(Descendants, {
206
- descendants: descendant.children,
207
- mode
208
- })
209
- });
210
- case BlockType.BlockQuote:
211
- return /* @__PURE__ */ jsx("blockquote", {
212
- className: cx(...blockStyles, quoteStyle),
213
- children: /* @__PURE__ */ jsx(Descendants, {
214
- descendants: descendant.children,
215
- mode
216
- })
217
- });
218
- case BlockType.OrderedList:
219
- return /* @__PURE__ */ jsx("ol", {
220
- className: cx(...blockStyles, listStyles),
221
- children: /* @__PURE__ */ jsx(Descendants, {
222
- descendants: descendant.children,
223
- mode
224
- })
225
- });
226
- case BlockType.UnorderedList:
227
- return /* @__PURE__ */ jsx("ul", {
228
- className: cx(...blockStyles, listStyles),
229
- children: /* @__PURE__ */ jsx(Descendants, {
230
- descendants: descendant.children,
231
- mode
232
- })
233
- });
234
- case BlockType.ListItem:
235
- return /* @__PURE__ */ jsx("li", {
236
- className: cx(...blockStyles),
237
- children: /* @__PURE__ */ jsx(Descendants, {
238
- descendants: descendant.children,
239
- mode
240
- })
241
- });
242
- case BlockType.ListItemChild:
243
- return /* @__PURE__ */ jsx("span", {
244
- className: cx(...blockStyles),
245
- children: /* @__PURE__ */ jsx(Descendants, {
246
- descendants: descendant.children,
247
- mode
248
- })
249
- });
250
- default:
251
- if (mode === RichTextV2Mode.Inline)
252
- return /* @__PURE__ */ jsx("span", {
253
- className: cx(...blockStyles),
254
- children: /* @__PURE__ */ jsx(Descendants, {
255
- descendants: descendant.children,
256
- mode
257
- })
258
- });
259
- return /* @__PURE__ */ jsx("p", {
260
- className: cx(...blockStyles),
261
- children: /* @__PURE__ */ jsx(Descendants, {
262
- descendants: descendant.children,
263
- mode
264
- })
265
- });
266
- }
267
156
  }
268
157
  function isText(node) {
269
158
  if (typeof node === "object" && "text" in node)
@@ -272,41 +161,20 @@ function isText(node) {
272
161
  }
273
162
  function Descendants({
274
163
  descendants,
275
- mode
164
+ plugins
276
165
  }) {
277
166
  return /* @__PURE__ */ jsx(Fragment, {
278
167
  children: descendants.map((descendant, index) => {
279
168
  if (isText(descendant)) {
280
- return /* @__PURE__ */ jsx(TextElement, {
281
- descendant
169
+ return /* @__PURE__ */ jsx(LeafComponent, {
170
+ plugins,
171
+ leaf: descendant
282
172
  }, index);
283
173
  }
284
- switch (descendant.type) {
285
- case InlineType.Link:
286
- case InlineType.Code:
287
- case InlineType.SubScript:
288
- case InlineType.SuperScript:
289
- return /* @__PURE__ */ jsx(InlineElement, {
290
- descendant,
291
- mode
292
- }, index);
293
- case BlockType.Heading1:
294
- case BlockType.Heading2:
295
- case BlockType.Heading3:
296
- case BlockType.BlockQuote:
297
- case BlockType.Text:
298
- case BlockType.Paragraph:
299
- case BlockType.OrderedList:
300
- case BlockType.UnorderedList:
301
- case BlockType.ListItem:
302
- case BlockType.ListItemChild:
303
- return /* @__PURE__ */ jsx(BlockElement, {
304
- descendant,
305
- mode
306
- }, index);
307
- default:
308
- return null;
309
- }
174
+ return /* @__PURE__ */ jsx(ElementComponent, {
175
+ descendant,
176
+ plugins
177
+ }, index);
310
178
  })
311
179
  });
312
180
  }
@@ -317,13 +185,17 @@ function isBlock(descendant) {
317
185
  case BlockType.Heading1:
318
186
  case BlockType.Heading2:
319
187
  case BlockType.Heading3:
188
+ case BlockType.Heading4:
189
+ case BlockType.Heading5:
190
+ case BlockType.Heading6:
320
191
  case BlockType.BlockQuote:
321
192
  case BlockType.Paragraph:
193
+ case BlockType.Default:
194
+ case BlockType.Text:
322
195
  case BlockType.OrderedList:
323
196
  case BlockType.UnorderedList:
324
197
  case BlockType.ListItem:
325
198
  case BlockType.ListItemChild:
326
- case BlockType.Text:
327
199
  return true;
328
200
  default:
329
201
  return false;
@@ -343,8 +215,13 @@ function getTextByDescendant(descendant) {
343
215
  case BlockType.Heading1:
344
216
  case BlockType.Heading2:
345
217
  case BlockType.Heading3:
218
+ case BlockType.Heading4:
219
+ case BlockType.Heading5:
220
+ case BlockType.Heading6:
346
221
  case BlockType.BlockQuote:
347
222
  case BlockType.Paragraph:
223
+ case BlockType.Default:
224
+ case BlockType.Text:
348
225
  case BlockType.OrderedList:
349
226
  case BlockType.UnorderedList:
350
227
  case BlockType.ListItem:
@@ -357,5 +234,5 @@ function getTextByDescendant(descendant) {
357
234
  function getText(descendant) {
358
235
  return descendant.map(getTextByDescendant).join("\n");
359
236
  }
360
- export { BlockElement, TextElement, ReadOnlyTextV2 as default };
237
+ export { LeafComponent, ReadOnlyTextV2 as default };
361
238
  //# sourceMappingURL=ReadOnlyTextV2.es.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ReadOnlyTextV2.es.js","sources":["../src/runtimes/react/controls/rich-text-v2/ReadOnlyTextV2.tsx"],"sourcesContent":["import { cx } from '@emotion/css'\nimport { ForwardedRef, forwardRef } from 'react'\nimport { useResponsiveStyle } from '../../../../components/utils/responsive-style'\nimport { RichTextV2Control, RichTextV2ControlData, RichTextV2Mode } from '../../../../controls'\nimport { useStyle } from '../../use-style'\nimport { Descendant, Text } from 'slate'\nimport { Link } from '../../../../components/shared/Link'\nimport { Inline, InlineType, Block, BlockType } from '../../../../slate'\nimport useEnhancedTypography, { useTypographyClassName } from '../typography'\n\ntype Props = {\n text: RichTextV2ControlData\n control: RichTextV2Control | null\n}\n\nconst ReadOnlyTextV2 = forwardRef(function ReadOnlyText(\n { text: { descendants }, control }: Props,\n ref: ForwardedRef<HTMLDivElement>,\n) {\n const descendantsAsString = getText(descendants)\n\n const mode = control?.descriptor.config.mode ?? RichTextV2Mode.Block\n\n return (\n <div ref={ref}>\n {descendantsAsString === '' ? (\n <Placeholder />\n ) : (\n <Descendants descendants={descendants} mode={mode} />\n )}\n </div>\n )\n})\n\nexport default ReadOnlyTextV2\n\nfunction Placeholder({ text = 'Write some text...' }: { text?: string }) {\n return (\n <span\n className={useStyle({\n display: 'inline-block',\n width: 0,\n maxWidth: '100%',\n whiteSpace: 'nowrap',\n opacity: 0.333,\n verticalAlign: 'text-top',\n })}\n >\n {text}\n </span>\n )\n}\n\nexport interface TextProps {\n descendant: Text\n}\n\nexport function TextElement({ descendant }: TextProps) {\n const enhancedTypography = useEnhancedTypography(descendant.typography)\n const typographyClassName = useTypographyClassName(enhancedTypography)\n\n return (\n <span className={typographyClassName}>\n {descendant.text === '' ? '\\uFEFF' : descendant.text}\n </span>\n )\n}\n\nexport interface InlineProps {\n descendant: Inline\n mode: RichTextV2Mode\n}\n\nfunction InlineElement({ descendant, mode }: InlineProps) {\n const linkClassName = useStyle({ textDecoration: 'none' })\n\n switch (descendant.type) {\n case InlineType.Code:\n return (\n <code>\n <Descendants descendants={descendant.children} mode={mode} />\n </code>\n )\n\n case InlineType.SuperScript:\n return (\n <sup>\n <Descendants descendants={descendant.children} mode={mode} />\n </sup>\n )\n\n case InlineType.SubScript:\n return (\n <sub>\n <Descendants descendants={descendant.children} mode={mode} />\n </sub>\n )\n\n case InlineType.Link:\n return (\n <Link className={linkClassName} link={descendant.link ?? undefined}>\n <Descendants descendants={descendant.children} mode={mode} />\n </Link>\n )\n }\n}\n\nexport interface BlockProps {\n descendant: Block\n mode: RichTextV2Mode\n}\n\nexport function BlockElement({ descendant, mode }: BlockProps) {\n const blockStyles = [\n useStyle({ margin: 0 }),\n useStyle(useResponsiveStyle([descendant.textAlign], ([textAlign = 'left']) => ({ textAlign }))),\n ]\n const quoteStyle = 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 const listStyles = useStyle({\n listStylePosition: 'inside',\n paddingInlineStart: '20px',\n listStyleType: 'disc',\n })\n\n switch (descendant.type) {\n case BlockType.Text:\n return (\n <span className={cx(...blockStyles)}>\n <Descendants descendants={descendant.children} mode={mode} />\n </span>\n )\n case BlockType.Paragraph:\n return (\n <p className={cx(...blockStyles)}>\n <Descendants descendants={descendant.children} mode={mode} />\n </p>\n )\n case BlockType.Heading1:\n return (\n <h1 className={cx(...blockStyles)}>\n <Descendants descendants={descendant.children} mode={mode} />\n </h1>\n )\n case BlockType.Heading2:\n return (\n <h2 className={cx(...blockStyles)}>\n <Descendants descendants={descendant.children} mode={mode} />\n </h2>\n )\n case BlockType.Heading3:\n return (\n <h3 className={cx(...blockStyles)}>\n <Descendants descendants={descendant.children} mode={mode} />\n </h3>\n )\n case BlockType.Heading4:\n return (\n <h4 className={cx(...blockStyles)}>\n <Descendants descendants={descendant.children} mode={mode} />\n </h4>\n )\n case BlockType.Heading5:\n return (\n <h5 className={cx(...blockStyles)}>\n <Descendants descendants={descendant.children} mode={mode} />\n </h5>\n )\n case BlockType.Heading6:\n return (\n <h6 className={cx(...blockStyles)}>\n <Descendants descendants={descendant.children} mode={mode} />\n </h6>\n )\n case BlockType.BlockQuote:\n return (\n <blockquote className={cx(...blockStyles, quoteStyle)}>\n <Descendants descendants={descendant.children} mode={mode} />\n </blockquote>\n )\n case BlockType.OrderedList:\n return (\n <ol className={cx(...blockStyles, listStyles)}>\n <Descendants descendants={descendant.children} mode={mode} />\n </ol>\n )\n case BlockType.UnorderedList:\n return (\n <ul className={cx(...blockStyles, listStyles)}>\n <Descendants descendants={descendant.children} mode={mode} />\n </ul>\n )\n case BlockType.ListItem:\n return (\n <li className={cx(...blockStyles)}>\n <Descendants descendants={descendant.children} mode={mode} />\n </li>\n )\n case BlockType.ListItemChild:\n return (\n <span className={cx(...blockStyles)}>\n <Descendants descendants={descendant.children} mode={mode} />\n </span>\n )\n default:\n if (mode === RichTextV2Mode.Inline)\n return (\n <span className={cx(...blockStyles)}>\n <Descendants descendants={descendant.children} mode={mode} />\n </span>\n )\n return (\n <p className={cx(...blockStyles)}>\n <Descendants descendants={descendant.children} mode={mode} />\n </p>\n )\n }\n}\n\n// reimplemented from slate source for code splitting\nfunction isText(node: any): node is Text {\n if (typeof node === 'object' && 'text' in node) return true\n\n return false\n}\n\nfunction Descendants({ descendants, mode }: { descendants: Descendant[]; mode: RichTextV2Mode }) {\n return (\n <>\n {descendants.map((descendant, index) => {\n if (isText(descendant)) {\n return <TextElement key={index} descendant={descendant} />\n }\n\n switch (descendant.type) {\n case InlineType.Link:\n case InlineType.Code:\n case InlineType.SubScript:\n case InlineType.SuperScript:\n return <InlineElement key={index} descendant={descendant} mode={mode} />\n case BlockType.Heading1:\n case BlockType.Heading2:\n case BlockType.Heading3:\n case BlockType.BlockQuote:\n case BlockType.Text:\n case BlockType.Paragraph:\n case BlockType.OrderedList:\n case BlockType.UnorderedList:\n case BlockType.ListItem:\n case BlockType.ListItemChild:\n return <BlockElement key={index} descendant={descendant} mode={mode} />\n default:\n return null\n }\n })}\n </>\n )\n}\n\nfunction isBlock(descendant: Descendant): descendant is Block {\n if (isText(descendant)) return false\n\n switch (descendant.type) {\n case BlockType.Heading1:\n case BlockType.Heading2:\n case BlockType.Heading3:\n case BlockType.BlockQuote:\n case BlockType.Paragraph:\n case BlockType.OrderedList:\n case BlockType.UnorderedList:\n case BlockType.ListItem:\n case BlockType.ListItemChild:\n case BlockType.Text:\n return true\n\n default:\n return false\n }\n}\n\nfunction getTextByDescendant(descendant: Descendant): string {\n if (isText(descendant)) {\n return descendant.text ?? ''\n }\n\n switch (descendant.type) {\n case InlineType.Link:\n case InlineType.Code:\n case InlineType.SubScript:\n case InlineType.SuperScript:\n return descendant.children.map(descendant => getTextByDescendant(descendant)).join('') ?? ''\n case BlockType.Heading1:\n case BlockType.Heading2:\n case BlockType.Heading3:\n case BlockType.BlockQuote:\n case BlockType.Paragraph:\n case BlockType.OrderedList:\n case BlockType.UnorderedList:\n case BlockType.ListItem:\n case BlockType.ListItemChild:\n return (\n descendant.children\n .map(descendant => getTextByDescendant(descendant))\n .join(descendant.children.every(isBlock) ? '\\n' : '') ?? ''\n )\n default:\n return ''\n }\n}\n\nfunction getText(descendant: Descendant[]): string {\n return descendant.map(getTextByDescendant).join('\\n')\n}\n"],"names":["ReadOnlyTextV2","forwardRef","text","descendants","control","ref","descendantsAsString","getText","mode","descriptor","config","RichTextV2Mode","Block","_jsx","useStyle","display","width","maxWidth","whiteSpace","opacity","verticalAlign","descendant","enhancedTypography","useEnhancedTypography","typography","typographyClassName","useTypographyClassName","linkClassName","textDecoration","type","InlineType","Code","children","SuperScript","SubScript","Link","link","undefined","blockStyles","margin","useResponsiveStyle","textAlign","quoteStyle","padding","fontSize","fontWeight","borderLeft","listStyles","listStylePosition","paddingInlineStart","listStyleType","BlockType","Text","cx","Paragraph","Heading1","Heading2","Heading3","Heading4","Heading5","Heading6","BlockQuote","OrderedList","UnorderedList","ListItem","ListItemChild","Inline","node","_Fragment","map","index","isText","getTextByDescendant","join","every","isBlock"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAeMA,MAAAA,iBAAiBC,WAAW,sBAChC;AAAA,EAAEC,MAAM;AAAA,IAAEC;AAAAA;AAAAA,EAAeC;AAAAA,GACzBC,KACA;;AACMC,QAAAA,sBAAsBC,QAAQJ,WAAD;AAEnC,QAAMK,OAAOJ,yCAASK,WAAWC,OAAOF,SAA3BJ,YAAmCO,eAAeC;AAG7D,6BAAA,OAAA;AAAA,IAAK;AAAA,IACFN,UAAAA,wBAAwB,KACvBO,oBAAC,aAAD,EAAA,IAEAA,oBAAC,aAAD;AAAA,MAAa;AAAA,MAA0B;AAAA,IAAA,CAAvC;AAAA,EAAA,CALN;AASD,CAjBgC;AAqBjC,qBAAqB;AAAA,EAAEX,OAAO;AAAA,GAA2C;AAErE,6BAAA,QAAA;AAAA,IACE,WAAWY,SAAS;AAAA,MAClBC,SAAS;AAAA,MACTC,OAAO;AAAA,MACPC,UAAU;AAAA,MACVC,YAAY;AAAA,MACZC,SAAS;AAAA,MACTC,eAAe;AAAA,IAAA,CANE;AAAA,IASlBlB,UAAAA;AAAAA,EAAAA,CAXL;AAcD;AAM2B,qBAAA;AAAA,EAAEmB;AAAAA,GAAyB;AAC/CC,QAAAA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qC,OAAO,EAFpD,MAAAtD,YAE2D;AAAA;AAGtD,aAAA;AAAA;AAEZ;AAED,iBAAiBA,YAAkC;AAC1CA,SAAAA,WAAWgD,IAAIG,mBAAf,EAAoCC,KAAK,IAAzC;AACR;;"}
1
+ {"version":3,"file":"ReadOnlyTextV2.es.js","sources":["../src/runtimes/react/controls/rich-text-v2/ReadOnlyTextV2.tsx"],"sourcesContent":["import { ForwardedRef, forwardRef } from 'react'\nimport {\n RichTextV2ControlData,\n RichTextV2ControlDefinition,\n RichTextV2Plugin,\n} from '../../../../controls'\nimport { useStyle } from '../../use-style'\nimport { Descendant, Element, Text } from 'slate'\nimport { InlineType, Block, BlockType } from '../../../../slate'\nimport { ControlValue } from '../control'\nimport { RenderElementProps, RenderLeafProps } from 'slate-react'\n\ntype Props = {\n text: RichTextV2ControlData\n definition: RichTextV2ControlDefinition | null\n}\n\nconst ReadOnlyTextV2 = forwardRef(function ReadOnlyText(\n { text: { descendants }, definition }: Props,\n ref: ForwardedRef<HTMLDivElement>,\n) {\n const descendantsAsString = getText(descendants)\n\n return (\n <div ref={ref}>\n {descendantsAsString === '' ? (\n <Placeholder />\n ) : (\n <Descendants plugins={definition?.config.plugins ?? []} descendants={descendants} />\n )}\n </div>\n )\n})\n\nexport default ReadOnlyTextV2\n\nfunction Placeholder({ text = 'Write some text...' }: { text?: string }) {\n return (\n <span\n className={useStyle({\n display: 'inline-block',\n width: 0,\n maxWidth: '100%',\n whiteSpace: 'nowrap',\n opacity: 0.333,\n verticalAlign: 'text-top',\n })}\n >\n {text}\n </span>\n )\n}\n\ntype LeafProps = {\n leaf: Text\n plugins: RichTextV2Plugin[]\n}\n\nexport function LeafComponent({ plugins, ...props }: LeafProps) {\n function initialRenderLeaf({ leaf }: RenderLeafProps) {\n return <span className={leaf.className}>{leaf.text === '' ? '\\uFEFF' : leaf.text}</span>\n }\n\n const renderLeaf = plugins.reduce(\n (renderFn, plugin) => (props: RenderLeafProps) => {\n const { control, renderLeaf } = plugin\n\n if (control?.definition == null || renderLeaf == null) return renderFn(props)\n\n if (control.getLeafValue == null) return renderLeaf(renderFn, undefined)(props)\n\n return (\n <ControlValue definition={control.definition} data={control.getLeafValue(props.leaf)}>\n {value => renderLeaf(renderFn, value)(props)}\n </ControlValue>\n )\n },\n initialRenderLeaf,\n )\n\n return renderLeaf({ attributes: {} as any, leaf: props.leaf, children: null, text: props.leaf })\n}\n\ntype ElementProps = {\n descendant: Element\n plugins: RichTextV2Plugin[]\n}\n\nfunction ElementComponent({ plugins, ...props }: ElementProps) {\n function initialRenderElement(props: RenderElementProps) {\n return <Descendants descendants={props.element.children} plugins={plugins} />\n }\n\n const renderElement = plugins.reduce(\n (renderFn, plugin) => (props: RenderElementProps) => {\n const { control, renderElement } = plugin\n\n if (control?.definition == null || renderElement == null) return renderFn(props)\n\n if (control.getElementValue == null) return renderElement(renderFn, undefined)(props)\n\n return (\n <ControlValue definition={control.definition} data={control.getElementValue(props.element)}>\n {value => renderElement(renderFn, value)(props)}\n </ControlValue>\n )\n },\n initialRenderElement,\n )\n\n return renderElement({ attributes: {} as any, children: null, element: props.descendant })\n}\n\n// reimplemented from slate source for code splitting\nfunction isText(node: Descendant): node is Text {\n if (typeof node === 'object' && 'text' in node) return true\n\n return false\n}\n\nfunction Descendants({\n descendants,\n plugins,\n}: {\n plugins: RichTextV2Plugin[]\n descendants: Descendant[]\n}) {\n return (\n <>\n {descendants.map((descendant, index) => {\n if (isText(descendant)) {\n return <LeafComponent key={index} plugins={plugins} leaf={descendant} />\n }\n\n return <ElementComponent key={index} descendant={descendant} plugins={plugins} />\n })}\n </>\n )\n}\n\nfunction isBlock(descendant: Descendant): descendant is Block {\n if (isText(descendant)) return false\n\n switch (descendant.type) {\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.Paragraph:\n case BlockType.Default:\n case BlockType.Text:\n case BlockType.OrderedList:\n case BlockType.UnorderedList:\n case BlockType.ListItem:\n case BlockType.ListItemChild:\n return true\n\n default:\n return false\n }\n}\n\nfunction getTextByDescendant(descendant: Descendant): string {\n if (isText(descendant)) {\n return descendant.text ?? ''\n }\n\n switch (descendant.type) {\n case InlineType.Link:\n case InlineType.Code:\n case InlineType.SubScript:\n case InlineType.SuperScript:\n return descendant.children.map(descendant => getTextByDescendant(descendant)).join('') ?? ''\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.Paragraph:\n case BlockType.Default:\n case BlockType.Text:\n case BlockType.OrderedList:\n case BlockType.UnorderedList:\n case BlockType.ListItem:\n case BlockType.ListItemChild:\n return (\n descendant.children\n .map(descendant => getTextByDescendant(descendant))\n .join(descendant.children.every(isBlock) ? '\\n' : '') ?? ''\n )\n default:\n return ''\n }\n}\n\nfunction getText(descendant: Descendant[]): string {\n return descendant.map(getTextByDescendant).join('\\n')\n}\n"],"names":["ReadOnlyTextV2","forwardRef","text","descendants","definition","ref","descendantsAsString","getText","_jsx","config","plugins","useStyle","display","width","maxWidth","whiteSpace","opacity","verticalAlign","props","leaf","className","renderLeaf","reduce","renderFn","plugin","control","getLeafValue","undefined","value","initialRenderLeaf","attributes","children","element","renderElement","getElementValue","initialRenderElement","descendant","node","_Fragment","map","index","isText","type","BlockType","Heading1","Heading2","Heading3","Heading4","Heading5","Heading6","BlockQuote","Paragraph","Default","Text","OrderedList","UnorderedList","ListItem","ListItemChild","InlineType","Link","Code","SubScript","SuperScript","getTextByDescendant","join","every","isBlock"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiBMA,MAAAA,iBAAiBC,WAAW,sBAChC;AAAA,EAAEC,MAAM;AAAA,IAAEC;AAAAA;AAAAA,EAAeC;AAAAA,GACzBC,KACA;;AACMC,QAAAA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AAUW;AAAAA,SACVX,UAAUY;AAAAA,SACVZ,UAAUa;AAAAA,SACVb,UAAUc;AAEXrB,aAAAA,iBAAWL,SACRQ,IAAIH,CAAc2B,gBAAAA,oBAAoB3B,WAAD,CADxC,EAEG4B,KAAK5B,WAAWL,SAASkC,MAAMC,OAA1B,IAAqC,OAAO,EAFpD,MAAA9B,YAE2D;AAAA;AAGtD,aAAA;AAAA;AAEZ;AAED,iBAAiBA,YAAkC;AAC1CA,SAAAA,WAAWG,IAAIwB,mBAAf,EAAoCC,KAAK,IAAzC;AACR;;"}
package/dist/Root.cjs.js CHANGED
@@ -18,7 +18,7 @@ require("./state/breakpoints.cjs.js");
18
18
  require("slate");
19
19
  require("use-sync-external-store/shim/with-selector");
20
20
  require("next/dynamic");
21
- require("./typography.cjs.js");
21
+ require("./text-input.cjs.js");
22
22
  require("./combobox.cjs.js");
23
23
  require("use-sync-external-store/shim");
24
24
  require("./types.cjs.js");
package/dist/Root.es.js CHANGED
@@ -17,7 +17,7 @@ import "./state/breakpoints.es.js";
17
17
  import "slate";
18
18
  import "use-sync-external-store/shim/with-selector";
19
19
  import "next/dynamic";
20
- import "./typography.es.js";
20
+ import "./text-input.es.js";
21
21
  import "./combobox.es.js";
22
22
  import "use-sync-external-store/shim";
23
23
  import "./types.es.js";
@@ -44,7 +44,7 @@ require("use-sync-external-store/shim/with-selector");
44
44
  require("next/dynamic");
45
45
  require("./actions.cjs.js");
46
46
  require("zod");
47
- require("./typography.cjs.js");
47
+ require("./text-input.cjs.js");
48
48
  require("./combobox.cjs.js");
49
49
  require("slate");
50
50
  require("use-sync-external-store/shim");
@@ -43,7 +43,7 @@ import "use-sync-external-store/shim/with-selector";
43
43
  import "next/dynamic";
44
44
  import "./actions.es.js";
45
45
  import "zod";
46
- import "./typography.es.js";
46
+ import "./text-input.es.js";
47
47
  import "./combobox.es.js";
48
48
  import "slate";
49
49
  import "use-sync-external-store/shim";
package/dist/Text.cjs.js CHANGED
@@ -34,7 +34,7 @@ require("@emotion/css");
34
34
  require("@emotion/serialize");
35
35
  require("@emotion/utils");
36
36
  require("slate");
37
- require("./typography.cjs.js");
37
+ require("./text-input.cjs.js");
38
38
  require("./combobox.cjs.js");
39
39
  require("use-sync-external-store/shim");
40
40
  require("./types.cjs.js");
package/dist/Text.es.js CHANGED
@@ -32,7 +32,7 @@ import "@emotion/css";
32
32
  import "@emotion/serialize";
33
33
  import "@emotion/utils";
34
34
  import "slate";
35
- import "./typography.es.js";
35
+ import "./text-input.es.js";
36
36
  import "./combobox.es.js";
37
37
  import "use-sync-external-store/shim";
38
38
  import "./types.es.js";
@@ -34,7 +34,7 @@ require("./box-models.cjs.js");
34
34
  require("css-box-model");
35
35
  require("use-sync-external-store/shim/with-selector");
36
36
  require("next/dynamic");
37
- require("./typography.cjs.js");
37
+ require("./text-input.cjs.js");
38
38
  require("./combobox.cjs.js");
39
39
  require("use-sync-external-store/shim");
40
40
  require("./types.cjs.js");
@@ -32,7 +32,7 @@ import "./box-models.es.js";
32
32
  import "css-box-model";
33
33
  import "use-sync-external-store/shim/with-selector";
34
34
  import "next/dynamic";
35
- import "./typography.es.js";
35
+ import "./text-input.es.js";
36
36
  import "./combobox.es.js";
37
37
  import "use-sync-external-store/shim";
38
38
  import "./types.es.js";
@@ -31,7 +31,7 @@ var __objRest = (source, exclude) => {
31
31
  };
32
32
  const import_meta = {};
33
33
  import { C as ComboboxControlType } from "./combobox.es.js";
34
- import { a8 as ListControlType, a9 as ShapeControlType, a7 as StyleV2ControlType, a4 as RichTextV2ControlType, af as Types } from "./react-page.es.js";
34
+ import { a9 as ListControlType, aa as ShapeControlType, a8 as StyleV2ControlType, a5 as RichTextV2ControlType, ag as Types } from "./react-page.es.js";
35
35
  import "./actions.es.js";
36
36
  import "slate";
37
37
  function isSerializedFunction(value) {