@makeswift/runtime 0.8.9 → 0.8.11

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 (519) hide show
  1. package/dist/Box.cjs.js +6 -6
  2. package/dist/Box.es.js +6 -6
  3. package/dist/Button.cjs.js +5 -6
  4. package/dist/Button.cjs.js.map +1 -1
  5. package/dist/Button.es.js +5 -6
  6. package/dist/Button.es.js.map +1 -1
  7. package/dist/Carousel.cjs.js +7 -8
  8. package/dist/Carousel.cjs.js.map +1 -1
  9. package/dist/Carousel.es.js +7 -8
  10. package/dist/Carousel.es.js.map +1 -1
  11. package/dist/Countdown.cjs.js +5 -6
  12. package/dist/Countdown.cjs.js.map +1 -1
  13. package/dist/Countdown.es.js +5 -6
  14. package/dist/Countdown.es.js.map +1 -1
  15. package/dist/Divider.cjs.js +5 -6
  16. package/dist/Divider.cjs.js.map +1 -1
  17. package/dist/Divider.es.js +5 -6
  18. package/dist/Divider.es.js.map +1 -1
  19. package/dist/Embed.cjs.js +7 -7
  20. package/dist/Embed.cjs.js.map +1 -1
  21. package/dist/Embed.es.js +7 -7
  22. package/dist/Form.cjs.js +5 -6
  23. package/dist/Form.cjs.js.map +1 -1
  24. package/dist/Form.es.js +6 -7
  25. package/dist/Form.es.js.map +1 -1
  26. package/dist/Image.cjs.js +4 -5
  27. package/dist/Image.cjs.js.map +1 -1
  28. package/dist/Image.es.js +5 -6
  29. package/dist/Image.es.js.map +1 -1
  30. package/dist/LiveProvider.cjs.js +8 -9
  31. package/dist/LiveProvider.cjs.js.map +1 -1
  32. package/dist/LiveProvider.es.js +8 -9
  33. package/dist/LiveProvider.es.js.map +1 -1
  34. package/dist/Navigation.cjs.js +7 -7
  35. package/dist/Navigation.cjs.js.map +1 -1
  36. package/dist/Navigation.es.js +7 -7
  37. package/dist/PreviewProvider.cjs.js +34 -35
  38. package/dist/PreviewProvider.cjs.js.map +1 -1
  39. package/dist/PreviewProvider.es.js +6 -7
  40. package/dist/PreviewProvider.es.js.map +1 -1
  41. package/dist/ReadOnlyText.cjs.js +72 -66
  42. package/dist/ReadOnlyText.cjs.js.map +1 -1
  43. package/dist/ReadOnlyText.es.js +18 -12
  44. package/dist/ReadOnlyText.es.js.map +1 -1
  45. package/dist/ReadOnlyTextV2.cjs.js +362 -0
  46. package/dist/ReadOnlyTextV2.cjs.js.map +1 -0
  47. package/dist/ReadOnlyTextV2.es.js +358 -0
  48. package/dist/ReadOnlyTextV2.es.js.map +1 -0
  49. package/dist/Root.cjs.js +6 -6
  50. package/dist/Root.es.js +6 -6
  51. package/dist/SocialLinks.cjs.js +5 -6
  52. package/dist/SocialLinks.cjs.js.map +1 -1
  53. package/dist/SocialLinks.es.js +5 -6
  54. package/dist/SocialLinks.es.js.map +1 -1
  55. package/dist/Text.cjs.js +6 -7
  56. package/dist/Text.cjs.js.map +1 -1
  57. package/dist/Text.es.js +7 -8
  58. package/dist/Text.es.js.map +1 -1
  59. package/dist/Video.cjs.js +5 -6
  60. package/dist/Video.cjs.js.map +1 -1
  61. package/dist/Video.es.js +5 -6
  62. package/dist/Video.es.js.map +1 -1
  63. package/dist/actions.cjs.js.map +1 -1
  64. package/dist/actions.es.js.map +1 -1
  65. package/dist/builder.cjs.js +6 -2
  66. package/dist/builder.cjs.js.map +1 -1
  67. package/dist/builder.es.js +6 -2
  68. package/dist/builder.es.js.map +1 -1
  69. package/dist/components.cjs.js +9 -9
  70. package/dist/components.es.js +9 -9
  71. package/dist/constants.cjs.js +0 -408
  72. package/dist/constants.cjs.js.map +1 -1
  73. package/dist/constants.es.js +1 -372
  74. package/dist/constants.es.js.map +1 -1
  75. package/dist/control-serialization.cjs.js +82 -41
  76. package/dist/control-serialization.cjs.js.map +1 -1
  77. package/dist/control-serialization.es.js +42 -1
  78. package/dist/control-serialization.es.js.map +1 -1
  79. package/dist/controls.cjs.js +58 -53
  80. package/dist/controls.cjs.js.map +1 -1
  81. package/dist/controls.es.js +8 -3
  82. package/dist/controls.es.js.map +1 -1
  83. package/dist/index.cjs.js +315 -394
  84. package/dist/index.cjs.js.map +1 -1
  85. package/dist/index.cjs10.js +371 -0
  86. package/dist/index.cjs10.js.map +1 -0
  87. package/dist/index.cjs2.js +11 -10
  88. package/dist/index.cjs2.js.map +1 -1
  89. package/dist/index.cjs5.js +108 -98
  90. package/dist/index.cjs5.js.map +1 -1
  91. package/dist/index.cjs6.js +41 -42
  92. package/dist/index.cjs6.js.map +1 -1
  93. package/dist/index.cjs7.js +65 -362
  94. package/dist/index.cjs7.js.map +1 -1
  95. package/dist/index.cjs8.js +43 -0
  96. package/dist/index.cjs8.js.map +1 -0
  97. package/dist/index.cjs9.js +257 -0
  98. package/dist/index.cjs9.js.map +1 -0
  99. package/dist/index.es.js +77 -158
  100. package/dist/index.es.js.map +1 -1
  101. package/dist/index.es10.js +364 -0
  102. package/dist/index.es10.js.map +1 -0
  103. package/dist/index.es2.js +5 -4
  104. package/dist/index.es2.js.map +1 -1
  105. package/dist/index.es3.js +1 -1
  106. package/dist/index.es5.js +72 -63
  107. package/dist/index.es5.js.map +1 -1
  108. package/dist/index.es6.js +36 -40
  109. package/dist/index.es6.js.map +1 -1
  110. package/dist/index.es7.js +66 -358
  111. package/dist/index.es7.js.map +1 -1
  112. package/dist/index.es8.js +40 -0
  113. package/dist/index.es8.js.map +1 -0
  114. package/dist/index.es9.js +250 -0
  115. package/dist/index.es9.js.map +1 -0
  116. package/dist/leaf.cjs.js +4 -4
  117. package/dist/leaf.cjs.js.map +1 -1
  118. package/dist/leaf.es.js +2 -2
  119. package/dist/leaf.es.js.map +1 -1
  120. package/dist/main.cjs.js +4 -4
  121. package/dist/main.es.js +4 -4
  122. package/dist/next.cjs.js +5 -6
  123. package/dist/next.cjs.js.map +1 -1
  124. package/dist/next.es.js +6 -7
  125. package/dist/next.es.js.map +1 -1
  126. package/dist/prop-controllers.cjs.js +10 -7
  127. package/dist/prop-controllers.cjs.js.map +1 -1
  128. package/dist/prop-controllers.es.js +6 -3
  129. package/dist/prop-controllers.es.js.map +1 -1
  130. package/dist/{descriptors.cjs.js → react-page.cjs.js} +865 -93
  131. package/dist/react-page.cjs.js.map +1 -0
  132. package/dist/{descriptors.es.js → react-page.es.js} +811 -92
  133. package/dist/react-page.es.js.map +1 -0
  134. package/dist/react.cjs.js +5 -6
  135. package/dist/react.cjs.js.map +1 -1
  136. package/dist/react.es.js +5 -6
  137. package/dist/react.es.js.map +1 -1
  138. package/dist/select.cjs.js +8 -0
  139. package/dist/select.cjs.js.map +1 -0
  140. package/dist/select.es.js +6 -0
  141. package/dist/select.es.js.map +1 -0
  142. package/dist/slate.cjs.js +19 -6
  143. package/dist/slate.cjs.js.map +1 -1
  144. package/dist/slate.es.js +9 -4
  145. package/dist/slate.es.js.map +1 -1
  146. package/dist/state/breakpoints.cjs.js.map +1 -1
  147. package/dist/state/breakpoints.es.js.map +1 -1
  148. package/dist/text-input.cjs.js +0 -6
  149. package/dist/text-input.cjs.js.map +1 -1
  150. package/dist/text-input.es.js +1 -5
  151. package/dist/text-input.es.js.map +1 -1
  152. package/dist/types/src/api/graphql/generated/types.d.ts +36 -36
  153. package/dist/types/src/api/graphql/generated/types.d.ts.map +1 -1
  154. package/dist/types/src/api/graphql/types.d.ts +2 -2
  155. package/dist/types/src/api/graphql/types.d.ts.map +1 -1
  156. package/dist/types/src/api/react.d.ts +3 -3
  157. package/dist/types/src/api/react.d.ts.map +1 -1
  158. package/dist/types/src/builder/serialization/control-serialization.d.ts +66 -66
  159. package/dist/types/src/builder/serialization/control-serialization.d.ts.map +1 -1
  160. package/dist/types/src/builder/serialization/controls/rich-text-v2.d.ts +5 -0
  161. package/dist/types/src/builder/serialization/controls/rich-text-v2.d.ts.map +1 -0
  162. package/dist/types/src/builder/serialization/controls/types.d.ts +3 -3
  163. package/dist/types/src/builder/serialization/controls/types.d.ts.map +1 -1
  164. package/dist/types/src/builder/serialization/function-serialization.d.ts +4 -4
  165. package/dist/types/src/builder/serialization/function-serialization.d.ts.map +1 -1
  166. package/dist/types/src/components/builtin/Box/animations.d.ts +1 -1
  167. package/dist/types/src/components/builtin/Box/animations.d.ts.map +1 -1
  168. package/dist/types/src/components/builtin/Box/components/Placeholder/index.d.ts +1 -1
  169. package/dist/types/src/components/builtin/Box/components/Placeholder/index.d.ts.map +1 -1
  170. package/dist/types/src/components/builtin/Box/constants.d.ts +1 -1
  171. package/dist/types/src/components/builtin/Box/constants.d.ts.map +1 -1
  172. package/dist/types/src/components/builtin/Button/Button.d.ts +3 -3
  173. package/dist/types/src/components/builtin/Button/Button.d.ts.map +1 -1
  174. package/dist/types/src/components/builtin/Button/contants.d.ts +1 -1
  175. package/dist/types/src/components/builtin/Button/contants.d.ts.map +1 -1
  176. package/dist/types/src/components/builtin/Carousel/Carousel.d.ts +1 -1
  177. package/dist/types/src/components/builtin/Carousel/Carousel.d.ts.map +1 -1
  178. package/dist/types/src/components/builtin/Countdown/Countdown.d.ts +1 -1
  179. package/dist/types/src/components/builtin/Countdown/Countdown.d.ts.map +1 -1
  180. package/dist/types/src/components/builtin/Divider/Divider.d.ts +2 -2
  181. package/dist/types/src/components/builtin/Divider/Divider.d.ts.map +1 -1
  182. package/dist/types/src/components/builtin/Embed/Embed.d.ts +1 -1
  183. package/dist/types/src/components/builtin/Embed/Embed.d.ts.map +1 -1
  184. package/dist/types/src/components/builtin/Form/Form.d.ts +2 -2
  185. package/dist/types/src/components/builtin/Form/Form.d.ts.map +1 -1
  186. package/dist/types/src/components/builtin/Form/components/Field/components/Checkbox/index.d.ts +2 -2
  187. package/dist/types/src/components/builtin/Form/components/Field/components/Checkbox/index.d.ts.map +1 -1
  188. package/dist/types/src/components/builtin/Form/components/Field/components/CheckboxTableField/index.d.ts +1 -1
  189. package/dist/types/src/components/builtin/Form/components/Field/components/CheckboxTableField/index.d.ts.map +1 -1
  190. package/dist/types/src/components/builtin/Form/components/Field/components/EmailTableField/index.d.ts +1 -1
  191. package/dist/types/src/components/builtin/Form/components/Field/components/EmailTableField/index.d.ts.map +1 -1
  192. package/dist/types/src/components/builtin/Form/components/Field/components/Input/index.d.ts +1 -1
  193. package/dist/types/src/components/builtin/Form/components/Field/components/Input/index.d.ts.map +1 -1
  194. package/dist/types/src/components/builtin/Form/components/Field/components/Label/index.d.ts +2 -2
  195. package/dist/types/src/components/builtin/Form/components/Field/components/Label/index.d.ts.map +1 -1
  196. package/dist/types/src/components/builtin/Form/components/Field/components/LongTextTableField/index.d.ts +1 -1
  197. package/dist/types/src/components/builtin/Form/components/Field/components/LongTextTableField/index.d.ts.map +1 -1
  198. package/dist/types/src/components/builtin/Form/components/Field/components/MultipleSelectTableField/index.d.ts +1 -1
  199. package/dist/types/src/components/builtin/Form/components/Field/components/MultipleSelectTableField/index.d.ts.map +1 -1
  200. package/dist/types/src/components/builtin/Form/components/Field/components/NumberTableField/index.d.ts +1 -1
  201. package/dist/types/src/components/builtin/Form/components/Field/components/NumberTableField/index.d.ts.map +1 -1
  202. package/dist/types/src/components/builtin/Form/components/Field/components/PhoneNumberTableField/index.d.ts +1 -1
  203. package/dist/types/src/components/builtin/Form/components/Field/components/PhoneNumberTableField/index.d.ts.map +1 -1
  204. package/dist/types/src/components/builtin/Form/components/Field/components/RadioButton/index.d.ts +1 -1
  205. package/dist/types/src/components/builtin/Form/components/Field/components/RadioButton/index.d.ts.map +1 -1
  206. package/dist/types/src/components/builtin/Form/components/Field/components/SingleLineTextTableField/index.d.ts +1 -1
  207. package/dist/types/src/components/builtin/Form/components/Field/components/SingleLineTextTableField/index.d.ts.map +1 -1
  208. package/dist/types/src/components/builtin/Form/components/Field/components/SingleSelectTableField/components/TableColumnRadioButtonGroup/index.d.ts +1 -1
  209. package/dist/types/src/components/builtin/Form/components/Field/components/SingleSelectTableField/components/TableColumnRadioButtonGroup/index.d.ts.map +1 -1
  210. package/dist/types/src/components/builtin/Form/components/Field/components/SingleSelectTableField/components/TableColumnSingleSelect/index.d.ts +1 -1
  211. package/dist/types/src/components/builtin/Form/components/Field/components/SingleSelectTableField/components/TableColumnSingleSelect/index.d.ts.map +1 -1
  212. package/dist/types/src/components/builtin/Form/components/Field/components/SingleSelectTableField/index.d.ts +1 -1
  213. package/dist/types/src/components/builtin/Form/components/Field/components/SingleSelectTableField/index.d.ts.map +1 -1
  214. package/dist/types/src/components/builtin/Form/components/Field/components/TextArea/index.d.ts +1 -1
  215. package/dist/types/src/components/builtin/Form/components/Field/components/TextArea/index.d.ts.map +1 -1
  216. package/dist/types/src/components/builtin/Form/components/Field/components/URLTableField/index.d.ts +1 -1
  217. package/dist/types/src/components/builtin/Form/components/Field/components/URLTableField/index.d.ts.map +1 -1
  218. package/dist/types/src/components/builtin/Form/components/Field/index.d.ts +2 -2
  219. package/dist/types/src/components/builtin/Form/components/Field/index.d.ts.map +1 -1
  220. package/dist/types/src/components/builtin/Form/components/Placeholder/index.d.ts +1 -1
  221. package/dist/types/src/components/builtin/Form/components/Placeholder/index.d.ts.map +1 -1
  222. package/dist/types/src/components/builtin/Form/context/FormContext.d.ts +5 -5
  223. package/dist/types/src/components/builtin/Form/context/FormContext.d.ts.map +1 -1
  224. package/dist/types/src/components/builtin/Form/types.d.ts +13 -13
  225. package/dist/types/src/components/builtin/Form/types.d.ts.map +1 -1
  226. package/dist/types/src/components/builtin/Image/Image.d.ts +1 -1
  227. package/dist/types/src/components/builtin/Image/Image.d.ts.map +1 -1
  228. package/dist/types/src/components/builtin/Navigation/Navigation.d.ts +1 -1
  229. package/dist/types/src/components/builtin/Navigation/Navigation.d.ts.map +1 -1
  230. package/dist/types/src/components/builtin/Navigation/components/DropDownButton/index.d.ts +3 -3
  231. package/dist/types/src/components/builtin/Navigation/components/DropDownButton/index.d.ts.map +1 -1
  232. package/dist/types/src/components/builtin/Navigation/components/LinksPlaceholder/index.d.ts +1 -1
  233. package/dist/types/src/components/builtin/Navigation/components/LinksPlaceholder/index.d.ts.map +1 -1
  234. package/dist/types/src/components/builtin/Navigation/components/MobileMenu/components/MobileDropDownButton/index.d.ts +3 -3
  235. package/dist/types/src/components/builtin/Navigation/components/MobileMenu/components/MobileDropDownButton/index.d.ts.map +1 -1
  236. package/dist/types/src/components/builtin/Navigation/components/MobileMenu/index.d.ts +1 -1
  237. package/dist/types/src/components/builtin/Navigation/components/MobileMenu/index.d.ts.map +1 -1
  238. package/dist/types/src/components/builtin/Root/Root.d.ts +1 -1
  239. package/dist/types/src/components/builtin/Root/Root.d.ts.map +1 -1
  240. package/dist/types/src/components/builtin/SocialLinks/SocialLinks.d.ts +1 -1
  241. package/dist/types/src/components/builtin/SocialLinks/SocialLinks.d.ts.map +1 -1
  242. package/dist/types/src/components/builtin/SocialLinks/components/SocialLinksPlaceholder/index.d.ts +1 -1
  243. package/dist/types/src/components/builtin/SocialLinks/components/SocialLinksPlaceholder/index.d.ts.map +1 -1
  244. package/dist/types/src/components/builtin/Text/EditableText/editable-text.d.ts +1 -1
  245. package/dist/types/src/components/builtin/Text/EditableText/editable-text.d.ts.map +1 -1
  246. package/dist/types/src/components/builtin/Text/ReadOnlyText.d.ts +4 -3
  247. package/dist/types/src/components/builtin/Text/ReadOnlyText.d.ts.map +1 -1
  248. package/dist/types/src/components/builtin/Text/Text.d.ts +1 -1
  249. package/dist/types/src/components/builtin/Text/Text.d.ts.map +1 -1
  250. package/dist/types/src/components/builtin/Text/components/Element/block.d.ts +2 -2
  251. package/dist/types/src/components/builtin/Text/components/Element/block.d.ts.map +1 -1
  252. package/dist/types/src/components/builtin/Text/components/Element/inline.d.ts +1 -1
  253. package/dist/types/src/components/builtin/Text/components/Element/inline.d.ts.map +1 -1
  254. package/dist/types/src/components/builtin/Text/components/Leaf/leaf.d.ts +5 -5
  255. package/dist/types/src/components/builtin/Text/components/Leaf/leaf.d.ts.map +1 -1
  256. package/dist/types/src/components/builtin/Video/Video.d.ts +1 -1
  257. package/dist/types/src/components/builtin/Video/Video.d.ts.map +1 -1
  258. package/dist/types/src/components/hooks/useBackgrounds.d.ts +8 -8
  259. package/dist/types/src/components/hooks/useBackgrounds.d.ts.map +1 -1
  260. package/dist/types/src/components/hooks/useBorder.d.ts +3 -3
  261. package/dist/types/src/components/hooks/useBorder.d.ts.map +1 -1
  262. package/dist/types/src/components/hooks/useBoxShadow.d.ts +3 -3
  263. package/dist/types/src/components/hooks/useBoxShadow.d.ts.map +1 -1
  264. package/dist/types/src/components/page/BodySnippet.d.ts +1 -1
  265. package/dist/types/src/components/page/BodySnippet.d.ts.map +1 -1
  266. package/dist/types/src/components/page/Page.d.ts +1 -1
  267. package/dist/types/src/components/page/Page.d.ts.map +1 -1
  268. package/dist/types/src/components/shared/BackgroundsContainer/components/BackgroundVideo/index.d.ts +1 -1
  269. package/dist/types/src/components/shared/BackgroundsContainer/components/BackgroundVideo/index.d.ts.map +1 -1
  270. package/dist/types/src/components/shared/BackgroundsContainer/components/Backgrounds/index.d.ts +1 -1
  271. package/dist/types/src/components/shared/BackgroundsContainer/components/Backgrounds/index.d.ts.map +1 -1
  272. package/dist/types/src/components/shared/BackgroundsContainer/components/Parallax/index.d.ts +1 -1
  273. package/dist/types/src/components/shared/BackgroundsContainer/components/Parallax/index.d.ts.map +1 -1
  274. package/dist/types/src/components/shared/BackgroundsContainer/index.d.ts +1 -1
  275. package/dist/types/src/components/shared/BackgroundsContainer/index.d.ts.map +1 -1
  276. package/dist/types/src/components/shared/FallbackComponent/FallbackComponent.d.ts +1 -1
  277. package/dist/types/src/components/shared/FallbackComponent/FallbackComponent.d.ts.map +1 -1
  278. package/dist/types/src/components/shared/GutterContainer/index.d.ts +2 -2
  279. package/dist/types/src/components/shared/GutterContainer/index.d.ts.map +1 -1
  280. package/dist/types/src/components/shared/Link/index.d.ts +1 -1
  281. package/dist/types/src/components/shared/Link/index.d.ts.map +1 -1
  282. package/dist/types/src/components/shared/grid-item.d.ts +2 -2
  283. package/dist/types/src/components/shared/grid-item.d.ts.map +1 -1
  284. package/dist/types/src/components/utils/drop-first.d.ts +1 -1
  285. package/dist/types/src/components/utils/drop-first.d.ts.map +1 -1
  286. package/dist/types/src/components/utils/types.d.ts +2 -2
  287. package/dist/types/src/components/utils/types.d.ts.map +1 -1
  288. package/dist/types/src/controls/checkbox.d.ts +3 -3
  289. package/dist/types/src/controls/checkbox.d.ts.map +1 -1
  290. package/dist/types/src/controls/color.d.ts +3 -3
  291. package/dist/types/src/controls/color.d.ts.map +1 -1
  292. package/dist/types/src/controls/combobox.d.ts +5 -5
  293. package/dist/types/src/controls/combobox.d.ts.map +1 -1
  294. package/dist/types/src/controls/control.d.ts +6 -4
  295. package/dist/types/src/controls/control.d.ts.map +1 -1
  296. package/dist/types/src/controls/image.d.ts +4 -4
  297. package/dist/types/src/controls/image.d.ts.map +1 -1
  298. package/dist/types/src/controls/link.d.ts +8 -8
  299. package/dist/types/src/controls/link.d.ts.map +1 -1
  300. package/dist/types/src/controls/list.d.ts +8 -7
  301. package/dist/types/src/controls/list.d.ts.map +1 -1
  302. package/dist/types/src/controls/number.d.ts +3 -3
  303. package/dist/types/src/controls/number.d.ts.map +1 -1
  304. package/dist/types/src/controls/rich-text/dto-types.d.ts +4 -4
  305. package/dist/types/src/controls/rich-text/dto-types.d.ts.map +1 -1
  306. package/dist/types/src/controls/rich-text/index.d.ts +0 -1
  307. package/dist/types/src/controls/rich-text/index.d.ts.map +1 -1
  308. package/dist/types/src/controls/rich-text/rich-text.d.ts +12 -12
  309. package/dist/types/src/controls/rich-text/rich-text.d.ts.map +1 -1
  310. package/dist/types/src/controls/rich-text/translation.d.ts +1 -1
  311. package/dist/types/src/controls/rich-text/translation.d.ts.map +1 -1
  312. package/dist/types/src/controls/rich-text-v2/rich-text-v2.d.ts +55 -13
  313. package/dist/types/src/controls/rich-text-v2/rich-text-v2.d.ts.map +1 -1
  314. package/dist/types/src/controls/select.d.ts +5 -5
  315. package/dist/types/src/controls/select.d.ts.map +1 -1
  316. package/dist/types/src/controls/shape.d.ts +7 -6
  317. package/dist/types/src/controls/shape.d.ts.map +1 -1
  318. package/dist/types/src/controls/slot.d.ts +18 -9
  319. package/dist/types/src/controls/slot.d.ts.map +1 -1
  320. package/dist/types/src/controls/style.d.ts +20 -19
  321. package/dist/types/src/controls/style.d.ts.map +1 -1
  322. package/dist/types/src/controls/text-area.d.ts +3 -3
  323. package/dist/types/src/controls/text-area.d.ts.map +1 -1
  324. package/dist/types/src/controls/text-input.d.ts +3 -3
  325. package/dist/types/src/controls/text-input.d.ts.map +1 -1
  326. package/dist/types/src/controls/types.d.ts +5 -5
  327. package/dist/types/src/controls/types.d.ts.map +1 -1
  328. package/dist/types/src/css/border-radius.d.ts +2 -2
  329. package/dist/types/src/css/border-radius.d.ts.map +1 -1
  330. package/dist/types/src/css/border.d.ts +2 -2
  331. package/dist/types/src/css/border.d.ts.map +1 -1
  332. package/dist/types/src/css/length-percentage.d.ts +2 -2
  333. package/dist/types/src/css/length-percentage.d.ts.map +1 -1
  334. package/dist/types/src/css/length.d.ts +1 -1
  335. package/dist/types/src/css/length.d.ts.map +1 -1
  336. package/dist/types/src/css/margin.d.ts +2 -2
  337. package/dist/types/src/css/margin.d.ts.map +1 -1
  338. package/dist/types/src/css/padding.d.ts +2 -2
  339. package/dist/types/src/css/padding.d.ts.map +1 -1
  340. package/dist/types/src/next/api-handler/handlers/element-tree.d.ts +3 -3
  341. package/dist/types/src/next/api-handler/handlers/element-tree.d.ts.map +1 -1
  342. package/dist/types/src/next/api-handler/handlers/fonts.d.ts +5 -5
  343. package/dist/types/src/next/api-handler/handlers/fonts.d.ts.map +1 -1
  344. package/dist/types/src/next/api-handler/handlers/manifest.d.ts +3 -3
  345. package/dist/types/src/next/api-handler/handlers/manifest.d.ts.map +1 -1
  346. package/dist/types/src/next/api-handler/handlers/proxy-preview-mode.d.ts +2 -2
  347. package/dist/types/src/next/api-handler/handlers/proxy-preview-mode.d.ts.map +1 -1
  348. package/dist/types/src/next/api-handler/handlers/revalidate.d.ts +3 -3
  349. package/dist/types/src/next/api-handler/handlers/revalidate.d.ts.map +1 -1
  350. package/dist/types/src/next/api-handler/index.d.ts +3 -3
  351. package/dist/types/src/next/api-handler/index.d.ts.map +1 -1
  352. package/dist/types/src/next/client.d.ts +8 -8
  353. package/dist/types/src/next/client.d.ts.map +1 -1
  354. package/dist/types/src/next/dynamic.d.ts +4 -4
  355. package/dist/types/src/next/dynamic.d.ts.map +1 -1
  356. package/dist/types/src/next/index.d.ts +2 -2
  357. package/dist/types/src/next/index.d.ts.map +1 -1
  358. package/dist/types/src/next/preview-mode.d.ts +2 -2
  359. package/dist/types/src/next/preview-mode.d.ts.map +1 -1
  360. package/dist/types/src/prop-controllers/base.d.ts +7 -0
  361. package/dist/types/src/prop-controllers/base.d.ts.map +1 -0
  362. package/dist/types/src/prop-controllers/descriptors.d.ts +179 -179
  363. package/dist/types/src/prop-controllers/descriptors.d.ts.map +1 -1
  364. package/dist/types/src/prop-controllers/instances.d.ts +18 -22
  365. package/dist/types/src/prop-controllers/instances.d.ts.map +1 -1
  366. package/dist/types/src/runtimes/react/components/LiveProvider.d.ts +1 -1
  367. package/dist/types/src/runtimes/react/components/LiveProvider.d.ts.map +1 -1
  368. package/dist/types/src/runtimes/react/components/PreviewProvider.d.ts +1 -1
  369. package/dist/types/src/runtimes/react/components/PreviewProvider.d.ts.map +1 -1
  370. package/dist/types/src/runtimes/react/components/render-hook.d.ts +1 -1
  371. package/dist/types/src/runtimes/react/components/render-hook.d.ts.map +1 -1
  372. package/dist/types/src/runtimes/react/controls/checkbox.d.ts +1 -1
  373. package/dist/types/src/runtimes/react/controls/checkbox.d.ts.map +1 -1
  374. package/dist/types/src/runtimes/react/controls/color.d.ts +1 -1
  375. package/dist/types/src/runtimes/react/controls/color.d.ts.map +1 -1
  376. package/dist/types/src/runtimes/react/controls/combobox.d.ts +1 -1
  377. package/dist/types/src/runtimes/react/controls/combobox.d.ts.map +1 -1
  378. package/dist/types/src/runtimes/react/controls/control.d.ts +2 -2
  379. package/dist/types/src/runtimes/react/controls/control.d.ts.map +1 -1
  380. package/dist/types/src/runtimes/react/controls/image.d.ts +3 -3
  381. package/dist/types/src/runtimes/react/controls/image.d.ts.map +1 -1
  382. package/dist/types/src/runtimes/react/controls/link.d.ts +2 -2
  383. package/dist/types/src/runtimes/react/controls/link.d.ts.map +1 -1
  384. package/dist/types/src/runtimes/react/controls/list.d.ts +3 -3
  385. package/dist/types/src/runtimes/react/controls/list.d.ts.map +1 -1
  386. package/dist/types/src/runtimes/react/controls/number.d.ts +1 -1
  387. package/dist/types/src/runtimes/react/controls/number.d.ts.map +1 -1
  388. package/dist/types/src/runtimes/react/controls/rich-text-v2/EditableTextV2/editable-text-v2.d.ts +13 -0
  389. package/dist/types/src/runtimes/react/controls/rich-text-v2/EditableTextV2/editable-text-v2.d.ts.map +1 -0
  390. package/dist/types/src/runtimes/react/controls/rich-text-v2/EditableTextV2/index.d.ts +4 -0
  391. package/dist/types/src/runtimes/react/controls/rich-text-v2/EditableTextV2/index.d.ts.map +1 -0
  392. package/dist/types/src/runtimes/react/controls/rich-text-v2/EditableTextV2/useSyncDOMSelection.d.ts +9 -0
  393. package/dist/types/src/runtimes/react/controls/rich-text-v2/EditableTextV2/useSyncDOMSelection.d.ts.map +1 -0
  394. package/dist/types/src/runtimes/react/controls/rich-text-v2/ReadOnlyTextV2.d.ts +24 -0
  395. package/dist/types/src/runtimes/react/controls/rich-text-v2/ReadOnlyTextV2.d.ts.map +1 -0
  396. package/dist/types/src/runtimes/react/controls/rich-text-v2/index.d.ts +2 -0
  397. package/dist/types/src/runtimes/react/controls/rich-text-v2/index.d.ts.map +1 -0
  398. package/dist/types/src/runtimes/react/controls/rich-text-v2/rich-text-v2.d.ts +8 -0
  399. package/dist/types/src/runtimes/react/controls/rich-text-v2/rich-text-v2.d.ts.map +1 -0
  400. package/dist/types/src/runtimes/react/controls/rich-text.d.ts +2 -2
  401. package/dist/types/src/runtimes/react/controls/rich-text.d.ts.map +1 -1
  402. package/dist/types/src/runtimes/react/controls/select.d.ts +1 -1
  403. package/dist/types/src/runtimes/react/controls/select.d.ts.map +1 -1
  404. package/dist/types/src/runtimes/react/controls/shape.d.ts +2 -2
  405. package/dist/types/src/runtimes/react/controls/shape.d.ts.map +1 -1
  406. package/dist/types/src/runtimes/react/controls/slot.d.ts +4 -4
  407. package/dist/types/src/runtimes/react/controls/slot.d.ts.map +1 -1
  408. package/dist/types/src/runtimes/react/controls/style.d.ts +1 -1
  409. package/dist/types/src/runtimes/react/controls/style.d.ts.map +1 -1
  410. package/dist/types/src/runtimes/react/controls/text-area.d.ts +1 -1
  411. package/dist/types/src/runtimes/react/controls/text-area.d.ts.map +1 -1
  412. package/dist/types/src/runtimes/react/controls/text-input.d.ts +1 -1
  413. package/dist/types/src/runtimes/react/controls/text-input.d.ts.map +1 -1
  414. package/dist/types/src/runtimes/react/controls.d.ts +8 -8
  415. package/dist/types/src/runtimes/react/controls.d.ts.map +1 -1
  416. package/dist/types/src/runtimes/react/element-imperative-handle.d.ts +1 -1
  417. package/dist/types/src/runtimes/react/element-imperative-handle.d.ts.map +1 -1
  418. package/dist/types/src/runtimes/react/find-dom-node.d.ts +1 -1
  419. package/dist/types/src/runtimes/react/find-dom-node.d.ts.map +1 -1
  420. package/dist/types/src/runtimes/react/index.d.ts +7 -7
  421. package/dist/types/src/runtimes/react/index.d.ts.map +1 -1
  422. package/dist/types/src/slate/BlockPlugin/index.d.ts +33 -2
  423. package/dist/types/src/slate/BlockPlugin/index.d.ts.map +1 -1
  424. package/dist/types/src/slate/BlockPlugin/setBlockKeyForDevice.d.ts +1 -1
  425. package/dist/types/src/slate/BlockPlugin/setBlockKeyForDevice.d.ts.map +1 -1
  426. package/dist/types/src/slate/BlockPlugin/types.d.ts +3 -3
  427. package/dist/types/src/slate/BlockPlugin/types.d.ts.map +1 -1
  428. package/dist/types/src/slate/BlockPlugin/unwrapInline.d.ts +1 -1
  429. package/dist/types/src/slate/BlockPlugin/unwrapInline.d.ts.map +1 -1
  430. package/dist/types/src/slate/BlockPlugin/wrapInline.d.ts +1 -1
  431. package/dist/types/src/slate/BlockPlugin/wrapInline.d.ts.map +1 -1
  432. package/dist/types/src/slate/BuilderPlugin/index.d.ts +7 -0
  433. package/dist/types/src/slate/BuilderPlugin/index.d.ts.map +1 -0
  434. package/dist/types/src/slate/InlineModePlugin/index.d.ts +9 -0
  435. package/dist/types/src/slate/InlineModePlugin/index.d.ts.map +1 -0
  436. package/dist/types/src/slate/ListPlugin/index.d.ts +2 -2
  437. package/dist/types/src/slate/ListPlugin/index.d.ts.map +1 -1
  438. package/dist/types/src/slate/ListPlugin/toggleList.d.ts +2 -2
  439. package/dist/types/src/slate/ListPlugin/toggleList.d.ts.map +1 -1
  440. package/dist/types/src/slate/ListPlugin/unwrapList.d.ts +1 -1
  441. package/dist/types/src/slate/ListPlugin/unwrapList.d.ts.map +1 -1
  442. package/dist/types/src/slate/ListPlugin/wrapList.d.ts +2 -2
  443. package/dist/types/src/slate/ListPlugin/wrapList.d.ts.map +1 -1
  444. package/dist/types/src/slate/TypographyPlugin/clearActiveTypographyStyle.d.ts +1 -1
  445. package/dist/types/src/slate/TypographyPlugin/clearActiveTypographyStyle.d.ts.map +1 -1
  446. package/dist/types/src/slate/TypographyPlugin/clearDeviceActiveTypography.d.ts +1 -1
  447. package/dist/types/src/slate/TypographyPlugin/clearDeviceActiveTypography.d.ts.map +1 -1
  448. package/dist/types/src/slate/TypographyPlugin/detachActiveTypography.d.ts +2 -2
  449. package/dist/types/src/slate/TypographyPlugin/detachActiveTypography.d.ts.map +1 -1
  450. package/dist/types/src/slate/TypographyPlugin/index.d.ts +2 -2
  451. package/dist/types/src/slate/TypographyPlugin/index.d.ts.map +1 -1
  452. package/dist/types/src/slate/TypographyPlugin/setActiveTypographyId.d.ts +1 -1
  453. package/dist/types/src/slate/TypographyPlugin/setActiveTypographyId.d.ts.map +1 -1
  454. package/dist/types/src/slate/TypographyPlugin/setActiveTypographyStyle.d.ts +1 -1
  455. package/dist/types/src/slate/TypographyPlugin/setActiveTypographyStyle.d.ts.map +1 -1
  456. package/dist/types/src/slate/index.d.ts +3 -0
  457. package/dist/types/src/slate/index.d.ts.map +1 -1
  458. package/dist/types/src/slate/selectors.d.ts +1 -1
  459. package/dist/types/src/slate/selectors.d.ts.map +1 -1
  460. package/dist/types/src/{controls/rich-text → slate}/types.d.ts +56 -46
  461. package/dist/types/src/slate/types.d.ts.map +1 -0
  462. package/dist/types/src/slate/utils/editor.d.ts +1 -1
  463. package/dist/types/src/slate/utils/editor.d.ts.map +1 -1
  464. package/dist/types/src/slate/utils/element.d.ts +1 -1
  465. package/dist/types/src/slate/utils/element.d.ts.map +1 -1
  466. package/dist/types/src/state/actions.d.ts +43 -42
  467. package/dist/types/src/state/actions.d.ts.map +1 -1
  468. package/dist/types/src/state/makeswift-api-client.d.ts +5 -5
  469. package/dist/types/src/state/makeswift-api-client.d.ts.map +1 -1
  470. package/dist/types/src/state/modules/api-resources.d.ts +2 -2
  471. package/dist/types/src/state/modules/api-resources.d.ts.map +1 -1
  472. package/dist/types/src/state/modules/box-models.d.ts +2 -2
  473. package/dist/types/src/state/modules/box-models.d.ts.map +1 -1
  474. package/dist/types/src/state/modules/breakpoints.d.ts +9 -9
  475. package/dist/types/src/state/modules/breakpoints.d.ts.map +1 -1
  476. package/dist/types/src/state/modules/builder-edit-mode.d.ts +2 -2
  477. package/dist/types/src/state/modules/builder-edit-mode.d.ts.map +1 -1
  478. package/dist/types/src/state/modules/components-meta.d.ts +3 -3
  479. package/dist/types/src/state/modules/components-meta.d.ts.map +1 -1
  480. package/dist/types/src/state/modules/element-imperative-handles.d.ts +1 -1
  481. package/dist/types/src/state/modules/element-imperative-handles.d.ts.map +1 -1
  482. package/dist/types/src/state/modules/is-in-builder.d.ts +1 -1
  483. package/dist/types/src/state/modules/is-in-builder.d.ts.map +1 -1
  484. package/dist/types/src/state/modules/is-preview.d.ts +1 -1
  485. package/dist/types/src/state/modules/is-preview.d.ts.map +1 -1
  486. package/dist/types/src/state/modules/pointer.d.ts +2 -2
  487. package/dist/types/src/state/modules/pointer.d.ts.map +1 -1
  488. package/dist/types/src/state/modules/prop-controller-handles.d.ts +3 -2
  489. package/dist/types/src/state/modules/prop-controller-handles.d.ts.map +1 -1
  490. package/dist/types/src/state/modules/prop-controllers.d.ts +1 -1
  491. package/dist/types/src/state/modules/prop-controllers.d.ts.map +1 -1
  492. package/dist/types/src/state/modules/react-components.d.ts +2 -2
  493. package/dist/types/src/state/modules/react-components.d.ts.map +1 -1
  494. package/dist/types/src/state/modules/read-only-documents.d.ts +7 -7
  495. package/dist/types/src/state/modules/read-only-documents.d.ts.map +1 -1
  496. package/dist/types/src/state/modules/read-write-documents.d.ts +1 -1
  497. package/dist/types/src/state/modules/read-write-documents.d.ts.map +1 -1
  498. package/dist/types/src/state/react-builder-preview.d.ts +5 -6
  499. package/dist/types/src/state/react-builder-preview.d.ts.map +1 -1
  500. package/dist/types/src/state/react-page.d.ts +11 -7
  501. package/dist/types/src/state/react-page.d.ts.map +1 -1
  502. package/dist/types/src/state/react-page.test.d.ts +3 -0
  503. package/dist/types/src/state/react-page.test.d.ts.map +1 -0
  504. package/dist/types/src/utils/isErrorWithMessage.d.ts +1 -1
  505. package/dist/types/src/utils/isErrorWithMessage.d.ts.map +1 -1
  506. package/dist/useIsomorphicLayoutEffect.cjs.js +6 -0
  507. package/dist/useIsomorphicLayoutEffect.cjs.js.map +1 -0
  508. package/dist/useIsomorphicLayoutEffect.es.js +5 -0
  509. package/dist/useIsomorphicLayoutEffect.es.js.map +1 -0
  510. package/package.json +4 -3
  511. package/dist/descriptors.cjs.js.map +0 -1
  512. package/dist/descriptors.es.js.map +0 -1
  513. package/dist/introspection.cjs.js +0 -331
  514. package/dist/introspection.cjs.js.map +0 -1
  515. package/dist/introspection.es.js +0 -317
  516. package/dist/introspection.es.js.map +0 -1
  517. package/dist/types/src/controls/rich-text/types.d.ts.map +0 -1
  518. package/dist/types/src/runtimes/react/controls/rich-text-v2.d.ts +0 -15
  519. package/dist/types/src/runtimes/react/controls/rich-text-v2.d.ts.map +0 -1
@@ -1,32 +1,30 @@
1
1
  import { cx } from "@emotion/css";
2
2
  import { forwardRef } from "react";
3
- import { aw as richTextDTOtoDAO, Q as BlockType, aA as InlineType } from "./descriptors.es.js";
4
- import "slate";
5
- import "slate-react";
6
3
  import { n as useStyle, o as useResponsiveStyle } from "./index.es.js";
7
4
  import { L as Link } from "./index.es3.js";
5
+ import "slate";
6
+ import "is-hotkey";
7
+ import { aX as richTextDTOtoDAO, b4 as BlockType, b5 as InlineType } from "./react-page.es.js";
8
+ import "./state/breakpoints.es.js";
9
+ import "slate-react";
8
10
  import { jsx, Fragment } from "react/jsx-runtime";
9
11
  import { u as useEnhancedTypography, a as useTypographyClassName } from "./leaf.es.js";
10
- import "./actions.es.js";
11
12
  import "use-sync-external-store/shim/with-selector";
12
13
  import "next/dynamic";
13
- import "./constants.es.js";
14
- import "redux";
15
- import "redux-thunk";
16
- import "./state/breakpoints.es.js";
17
- import "./introspection.es.js";
14
+ import "./actions.es.js";
18
15
  import "@emotion/serialize";
19
16
  import "@emotion/utils";
20
17
  import "./text-input.es.js";
21
18
  import "./combobox.es.js";
19
+ import "./select.es.js";
22
20
  import "use-sync-external-store/shim";
21
+ import "redux";
22
+ import "redux-thunk";
23
23
  import "./types.es.js";
24
24
  import "./box-models.es.js";
25
25
  import "css-box-model";
26
26
  import "color";
27
27
  import "scroll-into-view-if-needed";
28
- import "is-hotkey";
29
- import "slate-history";
30
28
  import "react-dom";
31
29
  import "html-react-parser";
32
30
  import "next/head";
@@ -37,6 +35,7 @@ import "path-to-regexp";
37
35
  import "cookie";
38
36
  import "http-proxy";
39
37
  import "set-cookie-parser";
38
+ import "./constants.es.js";
40
39
  import "uuid";
41
40
  import "corporate-ipsum";
42
41
  import "next/link";
@@ -228,14 +227,21 @@ function BlockElement({
228
227
  descendants: descendant.children
229
228
  })
230
229
  });
230
+ default:
231
+ return null;
231
232
  }
232
233
  }
234
+ function isText(node) {
235
+ if (typeof node === "object" && "text" in node)
236
+ return true;
237
+ return false;
238
+ }
233
239
  function Descendants({
234
240
  descendants
235
241
  }) {
236
242
  return /* @__PURE__ */ jsx(Fragment, {
237
243
  children: descendants.map((descendant, index) => {
238
- if ("text" in descendant) {
244
+ if (isText(descendant)) {
239
245
  return /* @__PURE__ */ jsx(TextElement, {
240
246
  descendant
241
247
  }, index);
@@ -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 {\n Block,\n BlockType,\n Inline,\n InlineType,\n richTextDTOtoDAO,\n Text,\n Element,\n} from '../../../controls'\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 { useTypographyClassName } from './components'\nimport useEnhancedTypography from './components/Leaf/leaf'\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}>\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\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\n className={cx(\n ...blockStyles,\n 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 >\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 }\n}\n\nfunction Descendants({ descendants }: { descendants: (Element | Text)[] }) {\n return (\n <>\n {descendants.map((descendant, index) => {\n if ('text' in 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: Element | Text): 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\n/**\n * I am using `Element | Text` here to ensure that nothing from Slate\n * is imported so that the RichText maintains it's slim bundle size\n */\nfunction getTextByDescendant(descendant: Element | Text): 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: (Element | Text)[]): 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","blockStyles","useResponsiveStyle","textAlign","BlockType","Text","Paragraph","Heading1","Heading2","Heading3","Heading4","Heading5","Heading6","BlockQuote","padding","fontSize","fontWeight","borderLeft","OrderedList","listStylePosition","UnorderedList","ListItem","ListItemChild","_Fragment","map","index","getTextByDescendant","join","every","isBlock"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyBMA,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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AAmB,WAAA;AAEzBA,UAAAA,WAAWQ;AAAAA,SACZW,UAAUG;AAAAA,SACVH,UAAUI;AAAAA,SACVJ,UAAUK;AAAAA,SACVL,UAAUS;AAAAA,SACVT,UAAUE;AAAAA,SACVF,UAAUc;AAAAA,SACVd,UAAUgB;AAAAA,SACVhB,UAAUiB;AAAAA,SACVjB,UAAUkB;AACN,aAAA;AAAA;AAGA,aAAA;AAAA;AAEZ;AAMD,6BAA6BrC,YAAoC;;AAC3D,MAAA,UAAUA,YAAY;AACxB,WAAOA,iBAAWhB,SAAXgB,YAAmB;AAAA,EAC3B;AAEOA,UAAAA,WAAWQ;AAAAA,SACZC,WAAWK;AAAAA,SACXL,WAAWC;AAAAA,SACXD,WAAWI;AAAAA,SACXJ,WAAWG;AACPZ,aAAAA,iBAAWW,SAAS4B,IAAIvC,CAAcyC,gBAAAA,oBAAoBzC,WAAD,CAAzD,EAAuE0C,KAAK,EAA5E,MAAA1C,YAAmF;AAAA,SACvFmB,UAAUG;AAAAA,SACVH,UAAUI;AAAAA,SACVJ,UAAUK;AAAAA,SACVL,UAAUS;AAAAA,SACVT,UAAUE;AAAAA,SACVF,UAAUc;AAAAA,SACVd,UAAUgB;AAAAA,SACVhB,UAAUiB;AAAAA,SACVjB,UAAUkB;AAEXrC,aAAAA,iBAAWW,SACR4B,IAAIvC,CAAcyC,gBAAAA,oBAAoBzC,WAAD,CADxC,EAEG0C,KAAK1C,WAAWW,SAASgC,MAAMC,OAA1B,IAAqC,OAAO,EAFpD,MAAA5C,YAE2D;AAAA;AAGtD,aAAA;AAAA;AAEZ;AAED,iBAAiBA,YAAwC;AAChDA,SAAAA,WAAWuC,IAAIE,mBAAf,EAAoCC,KAAK,IAAzC;AACR;;"}
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 { useTypographyClassName } from './components'\nimport useEnhancedTypography from './components/Leaf/leaf'\nimport { Inline, InlineType, Block, BlockType } from '../../../slate'\nimport { richTextDTOtoDAO } from '../../../controls'\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}>\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\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\n className={cx(\n ...blockStyles,\n 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 >\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","blockStyles","useResponsiveStyle","textAlign","BlockType","Text","Paragraph","Heading1","Heading2","Heading3","Heading4","Heading5","Heading6","BlockQuote","padding","fontSize","fontWeight","borderLeft","OrderedList","listStylePosition","UnorderedList","ListItem","ListItemChild","node","_Fragment","map","index","isText","getTextByDescendant","join","every","isBlock"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoBMA,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,wBAAwB,KAAKG,oBAAC,aAAD,EAAA,IAAkBA,oBAAC,aAAD;AAAA,MAAa;AAAA,IAAA,CAAb;AAAA,EAAA,CAFpD;AAKD,CAZ8B;AAgB/B,qBAAqB;AAAA,EAAET,OAAO;AAAA,GAA2C;AAErE,6BAAA,QAAA;AAAA,IACE,WAAWU,SAAS;AAAA,MAClBC,SAAS;A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AAAA,SACVd,UAAUgB;AAAAA,SACVhB,UAAUiB;AAAAA,SACVjB,UAAUkB;AACN,aAAA;AAAA;AAGA,aAAA;AAAA;AAEZ;AAED,6BAA6BrC,YAAgC;;AACvD,MAAA,UAAUA,YAAY;AACxB,WAAOA,iBAAWhB,SAAXgB,YAAmB;AAAA,EAC3B;AAEOA,UAAAA,WAAWQ;AAAAA,SACZC,WAAWK;AAAAA,SACXL,WAAWC;AAAAA,SACXD,WAAWI;AAAAA,SACXJ,WAAWG;AACPZ,aAAAA,iBAAWW,SAAS6B,IAAIxC,CAAc2C,gBAAAA,oBAAoB3C,WAAD,CAAzD,EAAuE4C,KAAK,EAA5E,MAAA5C,YAAmF;AAAA,SACvFmB,UAAUG;AAAAA,SACVH,UAAUI;AAAAA,SACVJ,UAAUK;AAAAA,SACVL,UAAUS;AAAAA,SACVT,UAAUE;AAAAA,SACVF,UAAUc;AAAAA,SACVd,UAAUgB;AAAAA,SACVhB,UAAUiB;AAAAA,SACVjB,UAAUkB;AAEXrC,aAAAA,iBAAWW,SACR6B,IAAIxC,CAAc2C,gBAAAA,oBAAoB3C,WAAD,CADxC,EAEG4C,KAAK5C,WAAWW,SAASkC,MAAMC,OAA1B,IAAqC,OAAO,EAFpD,MAAA9C,YAE2D;AAAA;AAGtD,aAAA;AAAA;AAEZ;AAED,iBAAiBA,YAAkC;AAC1CA,SAAAA,WAAWwC,IAAIG,mBAAf,EAAoCC,KAAK,IAAzC;AACR;;"}
@@ -0,0 +1,362 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ var css = require("@emotion/css");
4
+ var React = require("react");
5
+ var next = require("./index.cjs.js");
6
+ require("slate");
7
+ require("is-hotkey");
8
+ var reactPage = require("./react-page.cjs.js");
9
+ require("./state/breakpoints.cjs.js");
10
+ require("slate-react");
11
+ var jsxRuntime = require("react/jsx-runtime");
12
+ var index = require("./index.cjs3.js");
13
+ var leaf = require("./leaf.cjs.js");
14
+ require("use-sync-external-store/shim/with-selector");
15
+ require("next/dynamic");
16
+ require("./actions.cjs.js");
17
+ require("@emotion/serialize");
18
+ require("@emotion/utils");
19
+ require("./text-input.cjs.js");
20
+ require("./combobox.cjs.js");
21
+ require("./select.cjs.js");
22
+ require("use-sync-external-store/shim");
23
+ require("redux");
24
+ require("redux-thunk");
25
+ require("./types.cjs.js");
26
+ require("./box-models.cjs.js");
27
+ require("css-box-model");
28
+ require("color");
29
+ require("scroll-into-view-if-needed");
30
+ require("react-dom");
31
+ require("html-react-parser");
32
+ require("next/head");
33
+ require("@emotion/server/create-instance");
34
+ require("next/document");
35
+ require("cors");
36
+ require("path-to-regexp");
37
+ require("cookie");
38
+ require("http-proxy");
39
+ require("set-cookie-parser");
40
+ require("./constants.cjs.js");
41
+ require("uuid");
42
+ require("corporate-ipsum");
43
+ require("next/link");
44
+ const ReadOnlyTextV2 = React.forwardRef(function ReadOnlyText({
45
+ text: descendants,
46
+ control
47
+ }, ref) {
48
+ var _a;
49
+ const descendantsAsString = getText(descendants);
50
+ const mode = (_a = control == null ? void 0 : control.descriptor.config.mode) != null ? _a : reactPage.RichTextV2Mode.Block;
51
+ return /* @__PURE__ */ jsxRuntime.jsx("div", {
52
+ ref,
53
+ children: descendantsAsString === "" ? /* @__PURE__ */ jsxRuntime.jsx(Placeholder, {}) : /* @__PURE__ */ jsxRuntime.jsx(Descendants, {
54
+ descendants,
55
+ mode
56
+ })
57
+ });
58
+ });
59
+ function Placeholder({
60
+ text = "Write some text..."
61
+ }) {
62
+ return /* @__PURE__ */ jsxRuntime.jsx("span", {
63
+ className: next.useStyle({
64
+ display: "inline-block",
65
+ width: 0,
66
+ maxWidth: "100%",
67
+ whiteSpace: "nowrap",
68
+ opacity: 0.333,
69
+ verticalAlign: "text-top"
70
+ }),
71
+ children: text
72
+ });
73
+ }
74
+ function TextElement({
75
+ descendant
76
+ }) {
77
+ const enhancedTypography = leaf.useEnhancedTypography(descendant.typography);
78
+ const typographyClassName = leaf.useTypographyClassName(enhancedTypography);
79
+ return /* @__PURE__ */ jsxRuntime.jsx("span", {
80
+ className: typographyClassName,
81
+ children: descendant.text === "" ? "\uFEFF" : descendant.text
82
+ });
83
+ }
84
+ function InlineElement({
85
+ descendant,
86
+ mode
87
+ }) {
88
+ const linkClassName = next.useStyle({
89
+ textDecoration: "none"
90
+ });
91
+ switch (descendant.type) {
92
+ case reactPage.InlineType.Code:
93
+ return /* @__PURE__ */ jsxRuntime.jsx("code", {
94
+ children: /* @__PURE__ */ jsxRuntime.jsx(Descendants, {
95
+ descendants: descendant.children,
96
+ mode
97
+ })
98
+ });
99
+ case reactPage.InlineType.SuperScript:
100
+ return /* @__PURE__ */ jsxRuntime.jsx("sup", {
101
+ children: /* @__PURE__ */ jsxRuntime.jsx(Descendants, {
102
+ descendants: descendant.children,
103
+ mode
104
+ })
105
+ });
106
+ case reactPage.InlineType.SubScript:
107
+ return /* @__PURE__ */ jsxRuntime.jsx("sub", {
108
+ children: /* @__PURE__ */ jsxRuntime.jsx(Descendants, {
109
+ descendants: descendant.children,
110
+ mode
111
+ })
112
+ });
113
+ case reactPage.InlineType.Link:
114
+ return /* @__PURE__ */ jsxRuntime.jsx(index.Link, {
115
+ className: linkClassName,
116
+ link: descendant.link,
117
+ children: /* @__PURE__ */ jsxRuntime.jsx(Descendants, {
118
+ descendants: descendant.children,
119
+ mode
120
+ })
121
+ });
122
+ }
123
+ }
124
+ function BlockElement({
125
+ descendant,
126
+ mode
127
+ }) {
128
+ const blockStyles = [next.useStyle({
129
+ margin: 0
130
+ }), next.useStyle(next.useResponsiveStyle([descendant.textAlign], ([textAlign = "left"]) => ({
131
+ textAlign
132
+ })))];
133
+ switch (descendant.type) {
134
+ case reactPage.BlockType.Text:
135
+ return /* @__PURE__ */ jsxRuntime.jsx("span", {
136
+ className: css.cx(...blockStyles),
137
+ children: /* @__PURE__ */ jsxRuntime.jsx(Descendants, {
138
+ descendants: descendant.children,
139
+ mode
140
+ })
141
+ });
142
+ case reactPage.BlockType.Paragraph:
143
+ return /* @__PURE__ */ jsxRuntime.jsx("p", {
144
+ className: css.cx(...blockStyles),
145
+ children: /* @__PURE__ */ jsxRuntime.jsx(Descendants, {
146
+ descendants: descendant.children,
147
+ mode
148
+ })
149
+ });
150
+ case reactPage.BlockType.Heading1:
151
+ return /* @__PURE__ */ jsxRuntime.jsx("h1", {
152
+ className: css.cx(...blockStyles),
153
+ children: /* @__PURE__ */ jsxRuntime.jsx(Descendants, {
154
+ descendants: descendant.children,
155
+ mode
156
+ })
157
+ });
158
+ case reactPage.BlockType.Heading2:
159
+ return /* @__PURE__ */ jsxRuntime.jsx("h2", {
160
+ className: css.cx(...blockStyles),
161
+ children: /* @__PURE__ */ jsxRuntime.jsx(Descendants, {
162
+ descendants: descendant.children,
163
+ mode
164
+ })
165
+ });
166
+ case reactPage.BlockType.Heading3:
167
+ return /* @__PURE__ */ jsxRuntime.jsx("h3", {
168
+ className: css.cx(...blockStyles),
169
+ children: /* @__PURE__ */ jsxRuntime.jsx(Descendants, {
170
+ descendants: descendant.children,
171
+ mode
172
+ })
173
+ });
174
+ case reactPage.BlockType.Heading4:
175
+ return /* @__PURE__ */ jsxRuntime.jsx("h4", {
176
+ className: css.cx(...blockStyles),
177
+ children: /* @__PURE__ */ jsxRuntime.jsx(Descendants, {
178
+ descendants: descendant.children,
179
+ mode
180
+ })
181
+ });
182
+ case reactPage.BlockType.Heading5:
183
+ return /* @__PURE__ */ jsxRuntime.jsx("h5", {
184
+ className: css.cx(...blockStyles),
185
+ children: /* @__PURE__ */ jsxRuntime.jsx(Descendants, {
186
+ descendants: descendant.children,
187
+ mode
188
+ })
189
+ });
190
+ case reactPage.BlockType.Heading6:
191
+ return /* @__PURE__ */ jsxRuntime.jsx("h6", {
192
+ className: css.cx(...blockStyles),
193
+ children: /* @__PURE__ */ jsxRuntime.jsx(Descendants, {
194
+ descendants: descendant.children,
195
+ mode
196
+ })
197
+ });
198
+ case reactPage.BlockType.BlockQuote:
199
+ return /* @__PURE__ */ jsxRuntime.jsx("blockquote", {
200
+ className: css.cx(...blockStyles, next.useStyle({
201
+ padding: "0.5em 10px",
202
+ fontSize: "1.25em",
203
+ fontWeight: "300",
204
+ borderLeft: "5px solid rgba(0, 0, 0, 0.1)"
205
+ })),
206
+ children: /* @__PURE__ */ jsxRuntime.jsx(Descendants, {
207
+ descendants: descendant.children,
208
+ mode
209
+ })
210
+ });
211
+ case reactPage.BlockType.OrderedList:
212
+ return /* @__PURE__ */ jsxRuntime.jsx("ol", {
213
+ className: css.cx(...blockStyles),
214
+ style: {
215
+ listStylePosition: "inside"
216
+ },
217
+ children: /* @__PURE__ */ jsxRuntime.jsx(Descendants, {
218
+ descendants: descendant.children,
219
+ mode
220
+ })
221
+ });
222
+ case reactPage.BlockType.UnorderedList:
223
+ return /* @__PURE__ */ jsxRuntime.jsx("ul", {
224
+ className: css.cx(...blockStyles),
225
+ style: {
226
+ listStylePosition: "inside"
227
+ },
228
+ children: /* @__PURE__ */ jsxRuntime.jsx(Descendants, {
229
+ descendants: descendant.children,
230
+ mode
231
+ })
232
+ });
233
+ case reactPage.BlockType.ListItem:
234
+ return /* @__PURE__ */ jsxRuntime.jsx("li", {
235
+ className: css.cx(...blockStyles),
236
+ children: /* @__PURE__ */ jsxRuntime.jsx(Descendants, {
237
+ descendants: descendant.children,
238
+ mode
239
+ })
240
+ });
241
+ case reactPage.BlockType.ListItemChild:
242
+ return /* @__PURE__ */ jsxRuntime.jsx("span", {
243
+ className: css.cx(...blockStyles),
244
+ children: /* @__PURE__ */ jsxRuntime.jsx(Descendants, {
245
+ descendants: descendant.children,
246
+ mode
247
+ })
248
+ });
249
+ default:
250
+ if (mode === reactPage.RichTextV2Mode.Inline)
251
+ return /* @__PURE__ */ jsxRuntime.jsx("span", {
252
+ className: css.cx(...blockStyles),
253
+ children: /* @__PURE__ */ jsxRuntime.jsx(Descendants, {
254
+ descendants: descendant.children,
255
+ mode
256
+ })
257
+ });
258
+ return /* @__PURE__ */ jsxRuntime.jsx("p", {
259
+ className: css.cx(...blockStyles),
260
+ children: /* @__PURE__ */ jsxRuntime.jsx(Descendants, {
261
+ descendants: descendant.children,
262
+ mode
263
+ })
264
+ });
265
+ }
266
+ }
267
+ function isText(node) {
268
+ if (typeof node === "object" && "text" in node)
269
+ return true;
270
+ return false;
271
+ }
272
+ function Descendants({
273
+ descendants,
274
+ mode
275
+ }) {
276
+ return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, {
277
+ children: descendants.map((descendant, index2) => {
278
+ if (isText(descendant)) {
279
+ return /* @__PURE__ */ jsxRuntime.jsx(TextElement, {
280
+ descendant
281
+ }, index2);
282
+ }
283
+ switch (descendant.type) {
284
+ case reactPage.InlineType.Link:
285
+ case reactPage.InlineType.Code:
286
+ case reactPage.InlineType.SubScript:
287
+ case reactPage.InlineType.SuperScript:
288
+ return /* @__PURE__ */ jsxRuntime.jsx(InlineElement, {
289
+ descendant,
290
+ mode
291
+ }, index2);
292
+ case reactPage.BlockType.Heading1:
293
+ case reactPage.BlockType.Heading2:
294
+ case reactPage.BlockType.Heading3:
295
+ case reactPage.BlockType.BlockQuote:
296
+ case reactPage.BlockType.Text:
297
+ case reactPage.BlockType.Paragraph:
298
+ case reactPage.BlockType.OrderedList:
299
+ case reactPage.BlockType.UnorderedList:
300
+ case reactPage.BlockType.ListItem:
301
+ case reactPage.BlockType.ListItemChild:
302
+ return /* @__PURE__ */ jsxRuntime.jsx(BlockElement, {
303
+ descendant,
304
+ mode
305
+ }, index2);
306
+ default:
307
+ return null;
308
+ }
309
+ })
310
+ });
311
+ }
312
+ function isBlock(descendant) {
313
+ if (isText(descendant))
314
+ return false;
315
+ switch (descendant.type) {
316
+ case reactPage.BlockType.Heading1:
317
+ case reactPage.BlockType.Heading2:
318
+ case reactPage.BlockType.Heading3:
319
+ case reactPage.BlockType.BlockQuote:
320
+ case reactPage.BlockType.Paragraph:
321
+ case reactPage.BlockType.OrderedList:
322
+ case reactPage.BlockType.UnorderedList:
323
+ case reactPage.BlockType.ListItem:
324
+ case reactPage.BlockType.ListItemChild:
325
+ case reactPage.BlockType.Text:
326
+ return true;
327
+ default:
328
+ return false;
329
+ }
330
+ }
331
+ function getTextByDescendant(descendant) {
332
+ var _a, _b, _c;
333
+ if (isText(descendant)) {
334
+ return (_a = descendant.text) != null ? _a : "";
335
+ }
336
+ switch (descendant.type) {
337
+ case reactPage.InlineType.Link:
338
+ case reactPage.InlineType.Code:
339
+ case reactPage.InlineType.SubScript:
340
+ case reactPage.InlineType.SuperScript:
341
+ return (_b = descendant.children.map((descendant2) => getTextByDescendant(descendant2)).join("")) != null ? _b : "";
342
+ case reactPage.BlockType.Heading1:
343
+ case reactPage.BlockType.Heading2:
344
+ case reactPage.BlockType.Heading3:
345
+ case reactPage.BlockType.BlockQuote:
346
+ case reactPage.BlockType.Paragraph:
347
+ case reactPage.BlockType.OrderedList:
348
+ case reactPage.BlockType.UnorderedList:
349
+ case reactPage.BlockType.ListItem:
350
+ case reactPage.BlockType.ListItemChild:
351
+ return (_c = descendant.children.map((descendant2) => getTextByDescendant(descendant2)).join(descendant.children.every(isBlock) ? "\n" : "")) != null ? _c : "";
352
+ default:
353
+ return "";
354
+ }
355
+ }
356
+ function getText(descendant) {
357
+ return descendant.map(getTextByDescendant).join("\n");
358
+ }
359
+ exports.BlockElement = BlockElement;
360
+ exports.TextElement = TextElement;
361
+ exports["default"] = ReadOnlyTextV2;
362
+ //# sourceMappingURL=ReadOnlyTextV2.cjs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ReadOnlyTextV2.cjs.js","sources":["../src/runtimes/react/controls/rich-text-v2/ReadOnlyTextV2.tsx"],"sourcesContent":["import { cx } from '@emotion/css'\nimport { ForwardedRef, forwardRef } from 'react'\nimport { useTypographyClassName } from '../../../../components/builtin/Text/components'\nimport useEnhancedTypography from '../../../../components/builtin/Text/components/Leaf/leaf'\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'\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}>\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\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\n className={cx(\n ...blockStyles,\n 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 >\n <Descendants descendants={descendant.children} mode={mode} />\n </blockquote>\n )\n case BlockType.OrderedList:\n return (\n <ol className={cx(...blockStyles)} style={{ listStylePosition: 'inside' }}>\n <Descendants descendants={descendant.children} mode={mode} />\n </ol>\n )\n case BlockType.UnorderedList:\n return (\n <ul className={cx(...blockStyles)} style={{ listStylePosition: 'inside' }}>\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","blockStyles","margin","useResponsiveStyle","textAlign","BlockType","Text","cx","Paragraph","Heading1","Heading2","Heading3","Heading4","Heading5","Heading6","BlockQuote","padding","fontSize","fontWeight","borderLeft","OrderedList","listStylePosition","UnorderedList","ListItem","ListItemChild","Inline","node","_Fragment","map","index","isText","getTextByDescendant","join","every","isBlock"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgBMA,MAAAA,iBAAiBC,MAAAA,WAAW,sBAChC;AAAA,EAAEC,MAAMC;AAAAA,EAAaC;AAAAA,GACrBC,KACA;;AACMC,QAAAA,sBAAsBC,QAAQJ,WAAD;AAEnC,QAAMK,OAAOJ,yCAASK,WAAWC,OAAOF,SAA3BJ,YAAmCO,UAAeC,eAAAA;AAG7D,wCAAA,OAAA;AAAA,IAAK;AAAA,IACFN,UAAAA,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