@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
package/dist/Box.cjs.js CHANGED
@@ -43,7 +43,7 @@ require("use-sync-external-store/shim/with-selector");
43
43
  require("next/dynamic");
44
44
  require("./actions.cjs.js");
45
45
  require("zod");
46
- require("./typography.cjs.js");
46
+ require("./text-input.cjs.js");
47
47
  require("./combobox.cjs.js");
48
48
  require("slate");
49
49
  require("use-sync-external-store/shim");
package/dist/Box.es.js CHANGED
@@ -41,7 +41,7 @@ import "use-sync-external-store/shim/with-selector";
41
41
  import "next/dynamic";
42
42
  import "./actions.es.js";
43
43
  import "zod";
44
- import "./typography.es.js";
44
+ import "./text-input.es.js";
45
45
  import "./combobox.es.js";
46
46
  import "slate";
47
47
  import "use-sync-external-store/shim";
@@ -42,7 +42,7 @@ require("use-sync-external-store/shim/with-selector");
42
42
  require("next/dynamic");
43
43
  require("./actions.cjs.js");
44
44
  require("zod");
45
- require("./typography.cjs.js");
45
+ require("./text-input.cjs.js");
46
46
  require("./combobox.cjs.js");
47
47
  require("slate");
48
48
  require("use-sync-external-store/shim");
package/dist/Button.es.js CHANGED
@@ -40,7 +40,7 @@ import "use-sync-external-store/shim/with-selector";
40
40
  import "next/dynamic";
41
41
  import "./actions.es.js";
42
42
  import "zod";
43
- import "./typography.es.js";
43
+ import "./text-input.es.js";
44
44
  import "./combobox.es.js";
45
45
  import "slate";
46
46
  import "use-sync-external-store/shim";
@@ -47,7 +47,7 @@ var state_breakpoints = require("./state/breakpoints.cjs.js");
47
47
  var jsxRuntime = require("react/jsx-runtime");
48
48
  require("use-sync-external-store/shim/with-selector");
49
49
  require("next/dynamic");
50
- require("./typography.cjs.js");
50
+ require("./text-input.cjs.js");
51
51
  require("./combobox.cjs.js");
52
52
  require("redux");
53
53
  require("redux-thunk");
@@ -45,7 +45,7 @@ import { getBaseBreakpoint } from "./state/breakpoints.es.js";
45
45
  import { jsxs, jsx } from "react/jsx-runtime";
46
46
  import "use-sync-external-store/shim/with-selector";
47
47
  import "next/dynamic";
48
- import "./typography.es.js";
48
+ import "./text-input.es.js";
49
49
  import "./combobox.es.js";
50
50
  import "redux";
51
51
  import "redux-thunk";
@@ -46,7 +46,7 @@ require("@emotion/utils");
46
46
  require("slate");
47
47
  require("use-sync-external-store/shim/with-selector");
48
48
  require("next/dynamic");
49
- require("./typography.cjs.js");
49
+ require("./text-input.cjs.js");
50
50
  require("./combobox.cjs.js");
51
51
  require("use-sync-external-store/shim");
52
52
  require("./types.cjs.js");
@@ -44,7 +44,7 @@ import "@emotion/utils";
44
44
  import "slate";
45
45
  import "use-sync-external-store/shim/with-selector";
46
46
  import "next/dynamic";
47
- import "./typography.es.js";
47
+ import "./text-input.es.js";
48
48
  import "./combobox.es.js";
49
49
  import "use-sync-external-store/shim";
50
50
  import "./types.es.js";
@@ -9,7 +9,7 @@ require("use-sync-external-store/shim/with-selector");
9
9
  require("next/dynamic");
10
10
  require("./actions.cjs.js");
11
11
  require("zod");
12
- require("./typography.cjs.js");
12
+ require("./text-input.cjs.js");
13
13
  require("./combobox.cjs.js");
14
14
  require("slate");
15
15
  require("use-sync-external-store/shim");
@@ -7,7 +7,7 @@ import "use-sync-external-store/shim/with-selector";
7
7
  import "next/dynamic";
8
8
  import "./actions.es.js";
9
9
  import "zod";
10
- import "./typography.es.js";
10
+ import "./text-input.es.js";
11
11
  import "./combobox.es.js";
12
12
  import "slate";
13
13
  import "use-sync-external-store/shim";
package/dist/Form.cjs.js CHANGED
@@ -51,7 +51,7 @@ require("@emotion/utils");
51
51
  require("slate");
52
52
  require("use-sync-external-store/shim/with-selector");
53
53
  require("next/dynamic");
54
- require("./typography.cjs.js");
54
+ require("./text-input.cjs.js");
55
55
  require("./combobox.cjs.js");
56
56
  require("use-sync-external-store/shim");
57
57
  require("./types.cjs.js");
package/dist/Form.es.js CHANGED
@@ -50,7 +50,7 @@ import "@emotion/utils";
50
50
  import "slate";
51
51
  import "use-sync-external-store/shim/with-selector";
52
52
  import "next/dynamic";
53
- import "./typography.es.js";
53
+ import "./text-input.es.js";
54
54
  import "./combobox.es.js";
55
55
  import "use-sync-external-store/shim";
56
56
  import "./types.es.js";
package/dist/Image.cjs.js CHANGED
@@ -21,7 +21,7 @@ require("@emotion/utils");
21
21
  require("slate");
22
22
  require("use-sync-external-store/shim/with-selector");
23
23
  require("next/dynamic");
24
- require("./typography.cjs.js");
24
+ require("./text-input.cjs.js");
25
25
  require("./combobox.cjs.js");
26
26
  require("use-sync-external-store/shim");
27
27
  require("./types.cjs.js");
package/dist/Image.es.js CHANGED
@@ -19,7 +19,7 @@ import "@emotion/utils";
19
19
  import "slate";
20
20
  import "use-sync-external-store/shim/with-selector";
21
21
  import "next/dynamic";
22
- import "./typography.es.js";
22
+ import "./text-input.es.js";
23
23
  import "./combobox.es.js";
24
24
  import "use-sync-external-store/shim";
25
25
  import "./types.es.js";
@@ -8,7 +8,7 @@ require("use-sync-external-store/shim/with-selector");
8
8
  require("next/dynamic");
9
9
  require("./actions.cjs.js");
10
10
  require("zod");
11
- require("./typography.cjs.js");
11
+ require("./text-input.cjs.js");
12
12
  require("./combobox.cjs.js");
13
13
  require("slate");
14
14
  require("use-sync-external-store/shim");
@@ -1,12 +1,12 @@
1
1
  import { useMemo } from "react";
2
- import { a as ReactRuntime, N as StoreContext, O as MakeswiftProvider } from "./index.es.js";
3
- import { am as configureStore } from "./react-page.es.js";
2
+ import { a as ReactRuntime, O as StoreContext, Q as MakeswiftProvider } from "./index.es.js";
3
+ import { an as configureStore } from "./react-page.es.js";
4
4
  import { jsx } from "react/jsx-runtime";
5
5
  import "use-sync-external-store/shim/with-selector";
6
6
  import "next/dynamic";
7
7
  import "./actions.es.js";
8
8
  import "zod";
9
- import "./typography.es.js";
9
+ import "./text-input.es.js";
10
10
  import "./combobox.es.js";
11
11
  import "slate";
12
12
  import "use-sync-external-store/shim";
@@ -58,7 +58,7 @@ require("@emotion/serialize");
58
58
  require("@emotion/utils");
59
59
  require("use-sync-external-store/shim/with-selector");
60
60
  require("next/dynamic");
61
- require("./typography.cjs.js");
61
+ require("./text-input.cjs.js");
62
62
  require("./combobox.cjs.js");
63
63
  require("./types.cjs.js");
64
64
  require("./box-models.cjs.js");
@@ -57,7 +57,7 @@ import "@emotion/serialize";
57
57
  import "@emotion/utils";
58
58
  import "use-sync-external-store/shim/with-selector";
59
59
  import "next/dynamic";
60
- import "./typography.es.js";
60
+ import "./text-input.es.js";
61
61
  import "./combobox.es.js";
62
62
  import "./types.es.js";
63
63
  import "./box-models.es.js";
@@ -33,7 +33,7 @@ var controlSerialization = require("./control-serialization.cjs.js");
33
33
  var jsxRuntime = require("react/jsx-runtime");
34
34
  require("use-sync-external-store/shim/with-selector");
35
35
  require("next/dynamic");
36
- require("./typography.cjs.js");
36
+ require("./text-input.cjs.js");
37
37
  require("./combobox.cjs.js");
38
38
  require("slate");
39
39
  require("use-sync-external-store/shim");
@@ -19,12 +19,12 @@ var __spreadValues = (a, b) => {
19
19
  var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
20
  const import_meta = {};
21
21
  import { useMemo, useEffect } from "react";
22
- import { L as deepEqual, M as ElementImperativeHandle, a as ReactRuntime, N as StoreContext, O as MakeswiftProvider } from "./index.es.js";
22
+ import { M as deepEqual, N as ElementImperativeHandle, a as ReactRuntime, O as StoreContext, Q as MakeswiftProvider } from "./index.es.js";
23
23
  import { createStore, applyMiddleware, combineReducers } from "redux";
24
24
  import thunk from "redux-thunk";
25
25
  import Router from "next/router";
26
26
  import { removeIn, setIn } from "immutable";
27
- import { bk as getInitialState$3, bl as reducer$4, bm as getDocument$1, c as createDocument, bn as getComponentsMeta$1, bo as getComponentPropControllerDescriptors$1, ao as getBreakpoints, bp as getLocales, bq as getDefaultLocale, av as getBuilderEditMode, br as BuilderEditMode, bs as getDocumentKeysSortedByDepth, bt as getPropController, bu as getPropControllersHandle, bv as getElement, bw as getElementPropControllerDescriptors, bx as createPropController, b as isElementReference, a1 as isPropControllersHandle, by as reducer$5, bz as reducer$7, bA as reducer$8, bB as reducer$9, bC as reducer$a, bD as reducer$b, bE as reducer$c, bF as reducer$e, bG as getInitialState$4 } from "./react-page.es.js";
27
+ import { bw as getInitialState$3, bx as reducer$4, by as getDocument$1, c as createDocument, bz as getComponentsMeta$1, bA as getComponentPropControllerDescriptors$1, ap as getBreakpoints, bB as getLocales, bC as getDefaultLocale, aw as getBuilderEditMode, bD as BuilderEditMode, bE as getDocumentKeysSortedByDepth, bF as getPropController, bG as getPropControllersHandle, bH as getElement, bI as getElementPropControllerDescriptors, bJ as createPropController, b as isElementReference, a0 as isPropControllersHandle, bK as reducer$5, bL as reducer$7, bM as reducer$8, bN as reducer$9, bO as reducer$a, bP as reducer$b, bQ as reducer$c, bR as reducer$e, bS as getInitialState$4 } from "./react-page.es.js";
28
28
  import { A as ActionTypes, w as unregisterMeasurable, x as registerMeasurable, y as registerBuilderComponent, j as setBreakpoints, l as setLocales, z as setDefaultLocale, k as setLocale, B as changePathnameStart, C as changePathnameComplete, D as changeElementBoxModels, E as changeDocumentElementSize, F as handleWheel, G as handlePointerMove, H as elementFromPointChange, I as setIsInBuilder, J as unregisterBuilderComponent, K as unregisterPropControllers, L as registerPropControllers, M as registerPropControllersHandle, r as registerDocument, N as registerComponentHandle, O as messageBuilderPropController, P as registerDocumentEffect } from "./actions.es.js";
29
29
  import { i as isMeasurable, a as getMeasurables$1, b as getBoxModels$1, m as measure, d as getBoxModel$1, r as reducer$6 } from "./box-models.es.js";
30
30
  import { reducer as reducer$d } from "./state/breakpoints.es.js";
@@ -32,7 +32,7 @@ import { a as serializeControls } from "./control-serialization.es.js";
32
32
  import { jsx } from "react/jsx-runtime";
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 "slate";
38
38
  import "use-sync-external-store/shim";
@@ -12,6 +12,7 @@ require("./types.cjs2.js");
12
12
  require("is-hotkey");
13
13
  require("slate-react");
14
14
  var jsxRuntime = require("react/jsx-runtime");
15
+ require("uuid");
15
16
  require("redux");
16
17
  require("redux-thunk");
17
18
  require("@emotion/serialize");
@@ -20,7 +21,7 @@ require("scroll-into-view-if-needed");
20
21
  require("next/link");
21
22
  require("use-sync-external-store/shim/with-selector");
22
23
  require("next/dynamic");
23
- require("./typography.cjs.js");
24
+ require("./text-input.cjs.js");
24
25
  require("./combobox.cjs.js");
25
26
  require("use-sync-external-store/shim");
26
27
  require("./types.cjs.js");
@@ -39,7 +40,6 @@ require("cookie");
39
40
  require("http-proxy");
40
41
  require("set-cookie-parser");
41
42
  require("./constants.cjs.js");
42
- require("uuid");
43
43
  require("corporate-ipsum");
44
44
  const ReadOnlyText = React.forwardRef(function ReadOnlyText2({
45
45
  id,
@@ -141,6 +141,7 @@ function BlockElement({
141
141
  descendants: descendant.children
142
142
  })
143
143
  });
144
+ case reactPage.BlockType.Default:
144
145
  case reactPage.BlockType.Paragraph:
145
146
  return /* @__PURE__ */ jsxRuntime.jsx("p", {
146
147
  className: css.cx(...blockStyles),
@@ -261,9 +262,13 @@ function Descendants({
261
262
  case reactPage.BlockType.Heading1:
262
263
  case reactPage.BlockType.Heading2:
263
264
  case reactPage.BlockType.Heading3:
265
+ case reactPage.BlockType.Heading4:
266
+ case reactPage.BlockType.Heading5:
267
+ case reactPage.BlockType.Heading6:
264
268
  case reactPage.BlockType.BlockQuote:
265
- case reactPage.BlockType.Text:
266
269
  case reactPage.BlockType.Paragraph:
270
+ case reactPage.BlockType.Default:
271
+ case reactPage.BlockType.Text:
267
272
  case reactPage.BlockType.OrderedList:
268
273
  case reactPage.BlockType.UnorderedList:
269
274
  case reactPage.BlockType.ListItem:
@@ -284,8 +289,13 @@ function isBlock(descendant) {
284
289
  case reactPage.BlockType.Heading1:
285
290
  case reactPage.BlockType.Heading2:
286
291
  case reactPage.BlockType.Heading3:
292
+ case reactPage.BlockType.Heading4:
293
+ case reactPage.BlockType.Heading5:
294
+ case reactPage.BlockType.Heading6:
287
295
  case reactPage.BlockType.BlockQuote:
288
296
  case reactPage.BlockType.Paragraph:
297
+ case reactPage.BlockType.Default:
298
+ case reactPage.BlockType.Text:
289
299
  case reactPage.BlockType.OrderedList:
290
300
  case reactPage.BlockType.UnorderedList:
291
301
  case reactPage.BlockType.ListItem:
@@ -309,8 +319,13 @@ function getTextByDescendant(descendant) {
309
319
  case reactPage.BlockType.Heading1:
310
320
  case reactPage.BlockType.Heading2:
311
321
  case reactPage.BlockType.Heading3:
322
+ case reactPage.BlockType.Heading4:
323
+ case reactPage.BlockType.Heading5:
324
+ case reactPage.BlockType.Heading6:
312
325
  case reactPage.BlockType.BlockQuote:
313
326
  case reactPage.BlockType.Paragraph:
327
+ case reactPage.BlockType.Default:
328
+ case reactPage.BlockType.Text:
314
329
  case reactPage.BlockType.OrderedList:
315
330
  case reactPage.BlockType.UnorderedList:
316
331
  case reactPage.BlockType.ListItem:
@@ -1 +1 @@
1
- {"version":3,"file":"ReadOnlyText.cjs.js","sources":["../src/components/builtin/Text/ReadOnlyText.tsx"],"sourcesContent":["import { cx } from '@emotion/css'\nimport { ForwardedRef, forwardRef } from 'react'\nimport { Descendant, Text } from 'slate'\n\nimport type { ElementIDValue, RichTextValue } from '../../../prop-controllers/descriptors'\nimport { useStyle } from '../../../runtimes/react/use-style'\nimport { Link } from '../../shared/Link'\nimport { useResponsiveStyle } from '../../utils/responsive-style'\nimport { Inline, InlineType, Block, BlockType } from '../../../slate'\nimport { richTextDTOtoDAO } from '../../../controls'\nimport useEnhancedTypography, {\n useTypographyClassName,\n} from '../../../runtimes/react/controls/typography'\n\ntype Props = {\n id?: ElementIDValue\n text?: RichTextValue\n width?: string\n margin?: string\n}\n\nconst ReadOnlyText = forwardRef(function ReadOnlyText(\n { id, text, width, margin }: Props,\n ref: ForwardedRef<HTMLDivElement>,\n) {\n const descendants = text == null ? [] : richTextDTOtoDAO(text)\n const descendantsAsString = getText(descendants)\n\n return (\n <div ref={ref} id={id} className={cx(width, margin)}>\n {descendantsAsString === '' ? <Placeholder /> : <Descendants descendants={descendants} />}\n </div>\n )\n})\n\nexport default ReadOnlyText\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}\n\nfunction InlineElement({ descendant }: 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} />\n </code>\n )\n\n case InlineType.SuperScript:\n return (\n <sup>\n <Descendants descendants={descendant.children} />\n </sup>\n )\n\n case InlineType.SubScript:\n return (\n <sub>\n <Descendants descendants={descendant.children} />\n </sub>\n )\n\n case InlineType.Link:\n return (\n <Link className={linkClassName} link={descendant.link ?? undefined}>\n <Descendants descendants={descendant.children} />\n </Link>\n )\n }\n}\n\nexport interface BlockProps {\n descendant: Block\n}\n\nexport function BlockElement({ descendant }: 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 switch (descendant.type) {\n case BlockType.Text:\n return (\n <span className={cx(...blockStyles)}>\n <Descendants descendants={descendant.children} />\n </span>\n )\n case BlockType.Paragraph:\n return (\n <p className={cx(...blockStyles)}>\n <Descendants descendants={descendant.children} />\n </p>\n )\n case BlockType.Heading1:\n return (\n <h1 className={cx(...blockStyles)}>\n <Descendants descendants={descendant.children} />\n </h1>\n )\n case BlockType.Heading2:\n return (\n <h2 className={cx(...blockStyles)}>\n <Descendants descendants={descendant.children} />\n </h2>\n )\n case BlockType.Heading3:\n return (\n <h3 className={cx(...blockStyles)}>\n <Descendants descendants={descendant.children} />\n </h3>\n )\n case BlockType.Heading4:\n return (\n <h4 className={cx(...blockStyles)}>\n <Descendants descendants={descendant.children} />\n </h4>\n )\n case BlockType.Heading5:\n return (\n <h5 className={cx(...blockStyles)}>\n <Descendants descendants={descendant.children} />\n </h5>\n )\n case BlockType.Heading6:\n return (\n <h6 className={cx(...blockStyles)}>\n <Descendants descendants={descendant.children} />\n </h6>\n )\n case BlockType.BlockQuote:\n return (\n <blockquote className={cx(...blockStyles, quoteStyle)}>\n <Descendants descendants={descendant.children} />\n </blockquote>\n )\n case BlockType.OrderedList:\n return (\n <ol className={cx(...blockStyles)} style={{ listStylePosition: 'inside' }}>\n <Descendants descendants={descendant.children} />\n </ol>\n )\n case BlockType.UnorderedList:\n return (\n <ul className={cx(...blockStyles)} style={{ listStylePosition: 'inside' }}>\n <Descendants descendants={descendant.children} />\n </ul>\n )\n case BlockType.ListItem:\n return (\n <li className={cx(...blockStyles)}>\n <Descendants descendants={descendant.children} />\n </li>\n )\n case BlockType.ListItemChild:\n return (\n <span className={cx(...blockStyles)}>\n <Descendants descendants={descendant.children} />\n </span>\n )\n default:\n return null\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 }: { descendants: Descendant[] }) {\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} />\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} />\n default:\n return null\n }\n })}\n </>\n )\n}\n\nfunction isBlock(descendant: Descendant): descendant is Block {\n if ('text' in 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 return true\n\n default:\n return false\n }\n}\n\nfunction getTextByDescendant(descendant: Descendant): string {\n if ('text' in 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":["ReadOnlyText","forwardRef","id","text","width","margin","ref","descendants","richTextDTOtoDAO","descendantsAsString","getText","cx","_jsx","useStyle","display","maxWidth","whiteSpace","opacity","verticalAlign","descendant","enhancedTypography","useEnhancedTypography","typography","typographyClassName","useTypographyClassName","linkClassName","textDecoration","type","InlineType","Code","children","SuperScript","SubScript","Link","link","undefined","blockStyles","useResponsiveStyle","textAlign","quoteStyle","padding","fontSize","fontWeight","borderLeft","BlockType","Text","Paragraph","Heading1","Heading2","Heading3","Heading4","Heading5","Heading6","BlockQuote","OrderedList","listStylePosition","UnorderedList","ListItem","ListItemChild","node","_Fragment","map","index","isText","getTextByDescendant","join","every","isBlock"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqBMA,MAAAA,eAAeC,MAAAA,WAAW,uBAC9B;AAAA,EAAEC;AAAAA,EAAIC;AAAAA,EAAMC;AAAAA,EAAOC;AAAAA,GACnBC,KACA;AACMC,QAAAA,cAAcJ,QAAQ,OAAO,CAAA,IAAKK,UAAAA,iBAAiBL,IAAD;AAClDM,Q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AAI1C,CAAc6C,gBAAAA,oBAAoB7C,WAAD,CAAzD,EAAuE8C,KAAK,EAA5E,MAAA9C,YAAmF;AAAA,SACvFyB,UAAAA,UAAUG;AAAAA,SACVH,UAAAA,UAAUI;AAAAA,SACVJ,UAAAA,UAAUK;AAAAA,SACVL,UAAAA,UAAUS;AAAAA,SACVT,UAAAA,UAAUE;AAAAA,SACVF,UAAAA,UAAUU;AAAAA,SACVV,UAAAA,UAAUY;AAAAA,SACVZ,UAAAA,UAAUa;AAAAA,SACVb,UAAUc,UAAAA;AAEXvC,aAAAA,iBAAWW,SACR+B,IAAI1C,CAAc6C,gBAAAA,oBAAoB7C,WAAD,CADxC,EAEG8C,KAAK9C,WAAWW,SAASoC,MAAMC,OAA1B,IAAqC,OAAO,EAFpD,MAAAhD,YAE2D;AAAA;AAGtD,aAAA;AAAA;AAEZ;AAED,iBAAiBA,YAAkC;AAC1CA,SAAAA,WAAW0C,IAAIG,mBAAf,EAAoCC,KAAK,IAAzC;AACR;;;;"}
1
+ {"version":3,"file":"ReadOnlyText.cjs.js","sources":["../src/components/builtin/Text/ReadOnlyText.tsx"],"sourcesContent":["import { cx } from '@emotion/css'\nimport { ForwardedRef, forwardRef } from 'react'\nimport { Descendant, Text } from 'slate'\n\nimport type { ElementIDValue, RichTextValue } from '../../../prop-controllers/descriptors'\nimport { useStyle } from '../../../runtimes/react/use-style'\nimport { Link } from '../../shared/Link'\nimport { useResponsiveStyle } from '../../utils/responsive-style'\nimport { Inline, InlineType, Block, BlockType } from '../../../slate'\nimport { richTextDTOtoDAO } from '../../../controls'\nimport useEnhancedTypography, {\n useTypographyClassName,\n} from '../../../runtimes/react/controls/typography'\n\ntype Props = {\n id?: ElementIDValue\n text?: RichTextValue\n width?: string\n margin?: string\n}\n\nconst ReadOnlyText = forwardRef(function ReadOnlyText(\n { id, text, width, margin }: Props,\n ref: ForwardedRef<HTMLDivElement>,\n) {\n const descendants = text == null ? [] : richTextDTOtoDAO(text)\n const descendantsAsString = getText(descendants)\n\n return (\n <div ref={ref} id={id} className={cx(width, margin)}>\n {descendantsAsString === '' ? <Placeholder /> : <Descendants descendants={descendants} />}\n </div>\n )\n})\n\nexport default ReadOnlyText\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}\n\nfunction InlineElement({ descendant }: 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} />\n </code>\n )\n\n case InlineType.SuperScript:\n return (\n <sup>\n <Descendants descendants={descendant.children} />\n </sup>\n )\n\n case InlineType.SubScript:\n return (\n <sub>\n <Descendants descendants={descendant.children} />\n </sub>\n )\n\n case InlineType.Link:\n return (\n <Link className={linkClassName} link={descendant.link ?? undefined}>\n <Descendants descendants={descendant.children} />\n </Link>\n )\n }\n}\n\nexport interface BlockProps {\n descendant: Block\n}\n\nexport function BlockElement({ descendant }: 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 switch (descendant.type) {\n case BlockType.Text:\n return (\n <span className={cx(...blockStyles)}>\n <Descendants descendants={descendant.children} />\n </span>\n )\n case BlockType.Default:\n case BlockType.Paragraph:\n return (\n <p className={cx(...blockStyles)}>\n <Descendants descendants={descendant.children} />\n </p>\n )\n case BlockType.Heading1:\n return (\n <h1 className={cx(...blockStyles)}>\n <Descendants descendants={descendant.children} />\n </h1>\n )\n case BlockType.Heading2:\n return (\n <h2 className={cx(...blockStyles)}>\n <Descendants descendants={descendant.children} />\n </h2>\n )\n case BlockType.Heading3:\n return (\n <h3 className={cx(...blockStyles)}>\n <Descendants descendants={descendant.children} />\n </h3>\n )\n case BlockType.Heading4:\n return (\n <h4 className={cx(...blockStyles)}>\n <Descendants descendants={descendant.children} />\n </h4>\n )\n case BlockType.Heading5:\n return (\n <h5 className={cx(...blockStyles)}>\n <Descendants descendants={descendant.children} />\n </h5>\n )\n case BlockType.Heading6:\n return (\n <h6 className={cx(...blockStyles)}>\n <Descendants descendants={descendant.children} />\n </h6>\n )\n case BlockType.BlockQuote:\n return (\n <blockquote className={cx(...blockStyles, quoteStyle)}>\n <Descendants descendants={descendant.children} />\n </blockquote>\n )\n case BlockType.OrderedList:\n return (\n <ol className={cx(...blockStyles)} style={{ listStylePosition: 'inside' }}>\n <Descendants descendants={descendant.children} />\n </ol>\n )\n case BlockType.UnorderedList:\n return (\n <ul className={cx(...blockStyles)} style={{ listStylePosition: 'inside' }}>\n <Descendants descendants={descendant.children} />\n </ul>\n )\n case BlockType.ListItem:\n return (\n <li className={cx(...blockStyles)}>\n <Descendants descendants={descendant.children} />\n </li>\n )\n case BlockType.ListItemChild:\n return (\n <span className={cx(...blockStyles)}>\n <Descendants descendants={descendant.children} />\n </span>\n )\n default:\n return null\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 }: { descendants: Descendant[] }) {\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} />\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 <BlockElement key={index} descendant={descendant} />\n default:\n return null\n }\n })}\n </>\n )\n}\n\nfunction isBlock(descendant: Descendant): descendant is Block {\n if ('text' in 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 ('text' in 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":["ReadOnlyText","forwardRef","id","text","width","margin","ref","descendants","richTextDTOtoDAO","descendantsAsString","getText","cx","_jsx","useStyle","display","maxWidth","whiteSpace","opacity","verticalAlign","descendant","enhancedTypography","useEnhancedTypography","typography","typographyClassName","useTypographyClassName","linkClassName","textDecoration","type","InlineType","Code","children","SuperScript","SubScript","Link","link","undefined","blockStyles","useResponsiveStyle","textAlign","quoteStyle","padding","fontSize","fontWeight","borderLeft","BlockType","Text","Default","Paragraph","Heading1","Heading2","Heading3","Heading4","Heading5","Heading6","BlockQuote","OrderedList","listStylePosition","UnorderedList","ListItem","ListItemChild","node","_Fragment","map","index","isText","getTextByDescendant","join","every","isBlock"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqBMA,MAAAA,eAAeC,MAAAA,WAAW,uBAC9B;AAAA,EAAEC;AAAAA,EAAIC;AAAAA,EAAMC;AAAAA,EAAOC;AAAAA,GACnBC,KACA;AACMC,QAAAA,cAAcJ,QAAQ,OAAO,CAAA,IAAKK,UAAAA,iBAAiBL,IAAD;AAClDM,QAAAA,sBAAsBC,QAAQH,WAAD;AAGjC,wCAAA,OAAA;AAAA,IAAK;AAAA,IAAU;AAAA,IAAQ,WAAWI,IAAAA,GAAGP,OAAOC,MAAR;AAAA,IACjCI,UAAAA,wBAAwB,KAAKG,2BAAA,IAAC,aAAD,EAAA,IAAkBA,2BAAA,IAAC,aAAD;AAAA,MAAa;AAAA,IAAA,CAAb;AAAA,EAAA,CAFpD;AAKD,CAZ8B;AAgB/B,qBAAqB;AAAA,EAAET,OAAO;AAAA,GAA2C;AAErE,wCAAA,QAAA;AAAA,IACE,WAAWU,UAAAA,SAAS;AAAA,MAClBC,SAAS;AAAA,MACTV,OAAO;AAAA,MACPW,UAAU;AAAA,MACVC,YAAY;AAAA,MACZC,SAAS;AAAA,MACTC,eAAe;AAAA,IAAA,CANE;AAAA,IASlBf,UAAAA;AAAAA,EAAAA,CAXL;AA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,UAAAA,UAAUU;AAAAA,SACVV,UAAAA,UAAUG;AAAAA,SACVH,UAAAA,UAAUE;AAAAA,SACVF,UAAAA,UAAUC;AAAAA,SACVD,UAAAA,UAAUW;AAAAA,SACVX,UAAAA,UAAUa;AAAAA,SACVb,UAAAA,UAAUc;AAAAA,SACVd,UAAUe,UAAAA;AAEXxC,aAAAA,iBAAWW,SACRgC,IAAI3C,CAAc8C,gBAAAA,oBAAoB9C,WAAD,CADxC,EAEG+C,KAAK/C,WAAWW,SAASqC,MAAMC,OAA1B,IAAqC,OAAO,EAFpD,MAAAjD,YAE2D;AAAA;AAGtD,aAAA;AAAA;AAEZ;AAED,iBAAiBA,YAAkC;AAC1CA,SAAAA,WAAW2C,IAAIG,mBAAf,EAAoCC,KAAK,IAAzC;AACR;;;;"}
@@ -1,8 +1,8 @@
1
1
  import { cx } from "@emotion/css";
2
2
  import { forwardRef } from "react";
3
- import { b6 as richTextDTOtoDAO, U as useStyle, bi as BlockType, bg as InlineType } from "./react-page.es.js";
3
+ import { bf as richTextDTOtoDAO, U as useStyle, bu as BlockType, bs as InlineType } from "./react-page.es.js";
4
4
  import { L as Link } from "./index.es3.js";
5
- import { V as useEnhancedTypography, W as useTypographyClassName, n as useResponsiveStyle } from "./index.es.js";
5
+ import { W as useEnhancedTypography, X as useTypographyClassName, n as useResponsiveStyle } from "./index.es.js";
6
6
  import "slate";
7
7
  import "./state/breakpoints.es.js";
8
8
  import "./actions.es.js";
@@ -10,6 +10,7 @@ import "./types.es2.js";
10
10
  import "is-hotkey";
11
11
  import "slate-react";
12
12
  import { jsx, Fragment } from "react/jsx-runtime";
13
+ import "uuid";
13
14
  import "redux";
14
15
  import "redux-thunk";
15
16
  import "@emotion/serialize";
@@ -18,7 +19,7 @@ import "scroll-into-view-if-needed";
18
19
  import "next/link";
19
20
  import "use-sync-external-store/shim/with-selector";
20
21
  import "next/dynamic";
21
- import "./typography.es.js";
22
+ import "./text-input.es.js";
22
23
  import "./combobox.es.js";
23
24
  import "use-sync-external-store/shim";
24
25
  import "./types.es.js";
@@ -37,7 +38,6 @@ import "cookie";
37
38
  import "http-proxy";
38
39
  import "set-cookie-parser";
39
40
  import "./constants.es.js";
40
- import "uuid";
41
41
  import "corporate-ipsum";
42
42
  const ReadOnlyText = forwardRef(function ReadOnlyText2({
43
43
  id,
@@ -139,6 +139,7 @@ function BlockElement({
139
139
  descendants: descendant.children
140
140
  })
141
141
  });
142
+ case BlockType.Default:
142
143
  case BlockType.Paragraph:
143
144
  return /* @__PURE__ */ jsx("p", {
144
145
  className: cx(...blockStyles),
@@ -259,9 +260,13 @@ function Descendants({
259
260
  case BlockType.Heading1:
260
261
  case BlockType.Heading2:
261
262
  case BlockType.Heading3:
263
+ case BlockType.Heading4:
264
+ case BlockType.Heading5:
265
+ case BlockType.Heading6:
262
266
  case BlockType.BlockQuote:
263
- case BlockType.Text:
264
267
  case BlockType.Paragraph:
268
+ case BlockType.Default:
269
+ case BlockType.Text:
265
270
  case BlockType.OrderedList:
266
271
  case BlockType.UnorderedList:
267
272
  case BlockType.ListItem:
@@ -282,8 +287,13 @@ function isBlock(descendant) {
282
287
  case BlockType.Heading1:
283
288
  case BlockType.Heading2:
284
289
  case BlockType.Heading3:
290
+ case BlockType.Heading4:
291
+ case BlockType.Heading5:
292
+ case BlockType.Heading6:
285
293
  case BlockType.BlockQuote:
286
294
  case BlockType.Paragraph:
295
+ case BlockType.Default:
296
+ case BlockType.Text:
287
297
  case BlockType.OrderedList:
288
298
  case BlockType.UnorderedList:
289
299
  case BlockType.ListItem:
@@ -307,8 +317,13 @@ function getTextByDescendant(descendant) {
307
317
  case BlockType.Heading1:
308
318
  case BlockType.Heading2:
309
319
  case BlockType.Heading3:
320
+ case BlockType.Heading4:
321
+ case BlockType.Heading5:
322
+ case BlockType.Heading6:
310
323
  case BlockType.BlockQuote:
311
324
  case BlockType.Paragraph:
325
+ case BlockType.Default:
326
+ case BlockType.Text:
312
327
  case BlockType.OrderedList:
313
328
  case BlockType.UnorderedList:
314
329
  case BlockType.ListItem:
@@ -1 +1 @@
1
- {"version":3,"file":"ReadOnlyText.es.js","sources":["../src/components/builtin/Text/ReadOnlyText.tsx"],"sourcesContent":["import { cx } from '@emotion/css'\nimport { ForwardedRef, forwardRef } from 'react'\nimport { Descendant, Text } from 'slate'\n\nimport type { ElementIDValue, RichTextValue } from '../../../prop-controllers/descriptors'\nimport { useStyle } from '../../../runtimes/react/use-style'\nimport { Link } from '../../shared/Link'\nimport { useResponsiveStyle } from '../../utils/responsive-style'\nimport { Inline, InlineType, Block, BlockType } from '../../../slate'\nimport { richTextDTOtoDAO } from '../../../controls'\nimport useEnhancedTypography, {\n useTypographyClassName,\n} from '../../../runtimes/react/controls/typography'\n\ntype Props = {\n id?: ElementIDValue\n text?: RichTextValue\n width?: string\n margin?: string\n}\n\nconst ReadOnlyText = forwardRef(function ReadOnlyText(\n { id, text, width, margin }: Props,\n ref: ForwardedRef<HTMLDivElement>,\n) {\n const descendants = text == null ? [] : richTextDTOtoDAO(text)\n const descendantsAsString = getText(descendants)\n\n return (\n <div ref={ref} id={id} className={cx(width, margin)}>\n {descendantsAsString === '' ? <Placeholder /> : <Descendants descendants={descendants} />}\n </div>\n )\n})\n\nexport default ReadOnlyText\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}\n\nfunction InlineElement({ descendant }: 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} />\n </code>\n )\n\n case InlineType.SuperScript:\n return (\n <sup>\n <Descendants descendants={descendant.children} />\n </sup>\n )\n\n case InlineType.SubScript:\n return (\n <sub>\n <Descendants descendants={descendant.children} />\n </sub>\n )\n\n case InlineType.Link:\n return (\n <Link className={linkClassName} link={descendant.link ?? undefined}>\n <Descendants descendants={descendant.children} />\n </Link>\n )\n }\n}\n\nexport interface BlockProps {\n descendant: Block\n}\n\nexport function BlockElement({ descendant }: 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 switch (descendant.type) {\n case BlockType.Text:\n return (\n <span className={cx(...blockStyles)}>\n <Descendants descendants={descendant.children} />\n </span>\n )\n case BlockType.Paragraph:\n return (\n <p className={cx(...blockStyles)}>\n <Descendants descendants={descendant.children} />\n </p>\n )\n case BlockType.Heading1:\n return (\n <h1 className={cx(...blockStyles)}>\n <Descendants descendants={descendant.children} />\n </h1>\n )\n case BlockType.Heading2:\n return (\n <h2 className={cx(...blockStyles)}>\n <Descendants descendants={descendant.children} />\n </h2>\n )\n case BlockType.Heading3:\n return (\n <h3 className={cx(...blockStyles)}>\n <Descendants descendants={descendant.children} />\n </h3>\n )\n case BlockType.Heading4:\n return (\n <h4 className={cx(...blockStyles)}>\n <Descendants descendants={descendant.children} />\n </h4>\n )\n case BlockType.Heading5:\n return (\n <h5 className={cx(...blockStyles)}>\n <Descendants descendants={descendant.children} />\n </h5>\n )\n case BlockType.Heading6:\n return (\n <h6 className={cx(...blockStyles)}>\n <Descendants descendants={descendant.children} />\n </h6>\n )\n case BlockType.BlockQuote:\n return (\n <blockquote className={cx(...blockStyles, quoteStyle)}>\n <Descendants descendants={descendant.children} />\n </blockquote>\n )\n case BlockType.OrderedList:\n return (\n <ol className={cx(...blockStyles)} style={{ listStylePosition: 'inside' }}>\n <Descendants descendants={descendant.children} />\n </ol>\n )\n case BlockType.UnorderedList:\n return (\n <ul className={cx(...blockStyles)} style={{ listStylePosition: 'inside' }}>\n <Descendants descendants={descendant.children} />\n </ul>\n )\n case BlockType.ListItem:\n return (\n <li className={cx(...blockStyles)}>\n <Descendants descendants={descendant.children} />\n </li>\n )\n case BlockType.ListItemChild:\n return (\n <span className={cx(...blockStyles)}>\n <Descendants descendants={descendant.children} />\n </span>\n )\n default:\n return null\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 }: { descendants: Descendant[] }) {\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} />\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} />\n default:\n return null\n }\n })}\n </>\n )\n}\n\nfunction isBlock(descendant: Descendant): descendant is Block {\n if ('text' in 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 return true\n\n default:\n return false\n }\n}\n\nfunction getTextByDescendant(descendant: Descendant): string {\n if ('text' in 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":["ReadOnlyText","forwardRef","id","text","width","margin","ref","descendants","richTextDTOtoDAO","descendantsAsString","getText","cx","_jsx","useStyle","display","maxWidth","whiteSpace","opacity","verticalAlign","descendant","enhancedTypography","useEnhancedTypography","typography","typographyClassName","useTypographyClassName","linkClassName","textDecoration","type","InlineType","Code","children","SuperScript","SubScript","Link","link","undefined","blockStyles","useResponsiveStyle","textAlign","quoteStyle","padding","fontSize","fontWeight","borderLeft","BlockType","Text","Paragraph","Heading1","Heading2","Heading3","Heading4","Heading5","Heading6","BlockQuote","OrderedList","listStylePosition","UnorderedList","ListItem","ListItemChild","node","_Fragment","map","index","isText","getTextByDescendant","join","every","isBlock"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqBMA,MAAAA,eAAeC,WAAW,uBAC9B;AAAA,EAAEC;AAAAA,EAAIC;AAAAA,EAAMC;AAAAA,EAAOC;AAAAA,GACnBC,KACA;AACMC,QAAAA,cAAcJ,QAAQ,OAAO,CAAA,IAAKK,iBAAiBL,IAAD;AAClDM,QAAAA,sBAAsBC,QAAQH,WAAD;AAGjC,6BAAA,OAAA;AAAA,IAAK;AAAA,IAAU;AAAA,IAAQ,WAAWI,GAAGP,OAAOC,MAAR;AAAA,IACjCI,UAAAA,wBAA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sourcesContent":["import { cx } from '@emotion/css'\nimport { ForwardedRef, forwardRef } from 'react'\nimport { Descendant, Text } from 'slate'\n\nimport type { ElementIDValue, RichTextValue } from '../../../prop-controllers/descriptors'\nimport { useStyle } from '../../../runtimes/react/use-style'\nimport { Link } from '../../shared/Link'\nimport { useResponsiveStyle } from '../../utils/responsive-style'\nimport { Inline, InlineType, Block, BlockType } from '../../../slate'\nimport { richTextDTOtoDAO } from '../../../controls'\nimport useEnhancedTypography, {\n useTypographyClassName,\n} from '../../../runtimes/react/controls/typography'\n\ntype Props = {\n id?: ElementIDValue\n text?: RichTextValue\n width?: string\n margin?: string\n}\n\nconst ReadOnlyText = forwardRef(function ReadOnlyText(\n { id, text, width, margin }: Props,\n ref: ForwardedRef<HTMLDivElement>,\n) {\n const descendants = text == null ? [] : richTextDTOtoDAO(text)\n const descendantsAsString = getText(descendants)\n\n return (\n <div ref={ref} id={id} className={cx(width, margin)}>\n {descendantsAsString === '' ? <Placeholder /> : <Descendants descendants={descendants} />}\n </div>\n )\n})\n\nexport default ReadOnlyText\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}\n\nfunction InlineElement({ descendant }: 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} />\n </code>\n )\n\n case InlineType.SuperScript:\n return (\n <sup>\n <Descendants descendants={descendant.children} />\n </sup>\n )\n\n case InlineType.SubScript:\n return (\n <sub>\n <Descendants descendants={descendant.children} />\n </sub>\n )\n\n case InlineType.Link:\n return (\n <Link className={linkClassName} link={descendant.link ?? undefined}>\n <Descendants descendants={descendant.children} />\n </Link>\n )\n }\n}\n\nexport interface BlockProps {\n descendant: Block\n}\n\nexport function BlockElement({ descendant }: 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 switch (descendant.type) {\n case BlockType.Text:\n return (\n <span className={cx(...blockStyles)}>\n <Descendants descendants={descendant.children} />\n </span>\n )\n case BlockType.Default:\n case BlockType.Paragraph:\n return (\n <p className={cx(...blockStyles)}>\n <Descendants descendants={descendant.children} />\n </p>\n )\n case BlockType.Heading1:\n return (\n <h1 className={cx(...blockStyles)}>\n <Descendants descendants={descendant.children} />\n </h1>\n )\n case BlockType.Heading2:\n return (\n <h2 className={cx(...blockStyles)}>\n <Descendants descendants={descendant.children} />\n </h2>\n )\n case BlockType.Heading3:\n return (\n <h3 className={cx(...blockStyles)}>\n <Descendants descendants={descendant.children} />\n </h3>\n )\n case BlockType.Heading4:\n return (\n <h4 className={cx(...blockStyles)}>\n <Descendants descendants={descendant.children} />\n </h4>\n )\n case BlockType.Heading5:\n return (\n <h5 className={cx(...blockStyles)}>\n <Descendants descendants={descendant.children} />\n </h5>\n )\n case BlockType.Heading6:\n return (\n <h6 className={cx(...blockStyles)}>\n <Descendants descendants={descendant.children} />\n </h6>\n )\n case BlockType.BlockQuote:\n return (\n <blockquote className={cx(...blockStyles, quoteStyle)}>\n <Descendants descendants={descendant.children} />\n </blockquote>\n )\n case BlockType.OrderedList:\n return (\n <ol className={cx(...blockStyles)} style={{ listStylePosition: 'inside' }}>\n <Descendants descendants={descendant.children} />\n </ol>\n )\n case BlockType.UnorderedList:\n return (\n <ul className={cx(...blockStyles)} style={{ listStylePosition: 'inside' }}>\n <Descendants descendants={descendant.children} />\n </ul>\n )\n case BlockType.ListItem:\n return (\n <li className={cx(...blockStyles)}>\n <Descendants descendants={descendant.children} />\n </li>\n )\n case BlockType.ListItemChild:\n return (\n <span className={cx(...blockStyles)}>\n <Descendants descendants={descendant.children} />\n </span>\n )\n default:\n return null\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 }: { descendants: Descendant[] }) {\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} />\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 <BlockElement key={index} descendant={descendant} />\n default:\n return null\n }\n })}\n </>\n )\n}\n\nfunction isBlock(descendant: Descendant): descendant is Block {\n if ('text' in 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 ('text' in 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":["ReadOnlyText","forwardRef","id","text","width","margin","ref","descendants","richTextDTOtoDAO","descendantsAsString","getText","cx","_jsx","useStyle","display","maxWidth","whiteSpace","opacity","verticalAlign","descendant","enhancedTypography","useEnhancedTypography","typography","typographyClassName","useTypographyClassName","linkClassName","textDecoration","type","InlineType","Code","children","SuperScript","SubScript","Link","link","undefined","blockStyles","useResponsiveStyle","textAlign","quoteStyle","padding","fontSize","fontWeight","borderLeft","BlockType","Text","Default","Paragraph","Heading1","Heading2","Heading3","Heading4","Heading5","Heading6","BlockQuote","OrderedList","listStylePosition","UnorderedList","ListItem","ListItemChild","node","_Fragment","map","index","isText","getTextByDescendant","join","every","isBlock"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqBMA,MAAAA,eAAeC,WAAW,uBAC9B;AAAA,EAAEC;AAAAA,EAAIC;AAAAA,EAAMC;AAAAA,EAAOC;AAAAA,GACnBC,KACA;AACMC,QAAAA,cAAcJ,QAAQ,OAAO,CAAA,IAAKK,iBAAiBL,IAAD;AAClDM,QAAAA,sBAAsBC,QAAQH,WAA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