@makeswift/runtime 0.8.10 → 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (552) hide show
  1. package/dist/Box.cjs.js +6 -4
  2. package/dist/Box.cjs.js.map +1 -1
  3. package/dist/Box.es.js +6 -4
  4. package/dist/Box.es.js.map +1 -1
  5. package/dist/Button.cjs.js +6 -4
  6. package/dist/Button.cjs.js.map +1 -1
  7. package/dist/Button.es.js +6 -4
  8. package/dist/Button.es.js.map +1 -1
  9. package/dist/Carousel.cjs.js +9 -7
  10. package/dist/Carousel.cjs.js.map +1 -1
  11. package/dist/Carousel.es.js +9 -7
  12. package/dist/Carousel.es.js.map +1 -1
  13. package/dist/Countdown.cjs.js +6 -4
  14. package/dist/Countdown.cjs.js.map +1 -1
  15. package/dist/Countdown.es.js +6 -4
  16. package/dist/Countdown.es.js.map +1 -1
  17. package/dist/Divider.cjs.js +6 -4
  18. package/dist/Divider.cjs.js.map +1 -1
  19. package/dist/Divider.es.js +6 -4
  20. package/dist/Divider.es.js.map +1 -1
  21. package/dist/Embed.cjs.js +6 -4
  22. package/dist/Embed.cjs.js.map +1 -1
  23. package/dist/Embed.es.js +6 -4
  24. package/dist/Embed.es.js.map +1 -1
  25. package/dist/Form.cjs.js +6 -4
  26. package/dist/Form.cjs.js.map +1 -1
  27. package/dist/Form.es.js +6 -4
  28. package/dist/Form.es.js.map +1 -1
  29. package/dist/Image.cjs.js +6 -4
  30. package/dist/Image.cjs.js.map +1 -1
  31. package/dist/Image.es.js +6 -4
  32. package/dist/Image.es.js.map +1 -1
  33. package/dist/LiveProvider.cjs.js +8 -6
  34. package/dist/LiveProvider.cjs.js.map +1 -1
  35. package/dist/LiveProvider.es.js +7 -5
  36. package/dist/LiveProvider.es.js.map +1 -1
  37. package/dist/Navigation.cjs.js +6 -4
  38. package/dist/Navigation.cjs.js.map +1 -1
  39. package/dist/Navigation.es.js +6 -4
  40. package/dist/Navigation.es.js.map +1 -1
  41. package/dist/PreviewProvider.cjs.js +51 -34
  42. package/dist/PreviewProvider.cjs.js.map +1 -1
  43. package/dist/PreviewProvider.es.js +23 -6
  44. package/dist/PreviewProvider.es.js.map +1 -1
  45. package/dist/ReadOnlyText.cjs.js +72 -67
  46. package/dist/ReadOnlyText.cjs.js.map +1 -1
  47. package/dist/ReadOnlyText.es.js +18 -13
  48. package/dist/ReadOnlyText.es.js.map +1 -1
  49. package/dist/ReadOnlyTextV2.cjs.js +136 -91
  50. package/dist/ReadOnlyTextV2.cjs.js.map +1 -1
  51. package/dist/ReadOnlyTextV2.es.js +82 -37
  52. package/dist/ReadOnlyTextV2.es.js.map +1 -1
  53. package/dist/Root.cjs.js +6 -4
  54. package/dist/Root.cjs.js.map +1 -1
  55. package/dist/Root.es.js +6 -4
  56. package/dist/Root.es.js.map +1 -1
  57. package/dist/SocialLinks.cjs.js +6 -4
  58. package/dist/SocialLinks.cjs.js.map +1 -1
  59. package/dist/SocialLinks.es.js +6 -4
  60. package/dist/SocialLinks.es.js.map +1 -1
  61. package/dist/Text.cjs.js +7 -5
  62. package/dist/Text.cjs.js.map +1 -1
  63. package/dist/Text.es.js +7 -5
  64. package/dist/Text.es.js.map +1 -1
  65. package/dist/Video.cjs.js +6 -4
  66. package/dist/Video.cjs.js.map +1 -1
  67. package/dist/Video.es.js +6 -4
  68. package/dist/Video.es.js.map +1 -1
  69. package/dist/actions.cjs.js +16 -1
  70. package/dist/actions.cjs.js.map +1 -1
  71. package/dist/actions.es.js +14 -2
  72. package/dist/actions.es.js.map +1 -1
  73. package/dist/builder.cjs.js +7 -2
  74. package/dist/builder.cjs.js.map +1 -1
  75. package/dist/builder.es.js +7 -2
  76. package/dist/builder.es.js.map +1 -1
  77. package/dist/components.cjs.js +8 -6
  78. package/dist/components.cjs.js.map +1 -1
  79. package/dist/components.es.js +8 -6
  80. package/dist/components.es.js.map +1 -1
  81. package/dist/constants.cjs.js +0 -408
  82. package/dist/constants.cjs.js.map +1 -1
  83. package/dist/constants.es.js +1 -372
  84. package/dist/constants.es.js.map +1 -1
  85. package/dist/control-serialization.cjs.js +84 -41
  86. package/dist/control-serialization.cjs.js.map +1 -1
  87. package/dist/control-serialization.es.js +44 -1
  88. package/dist/control-serialization.es.js.map +1 -1
  89. package/dist/controls.cjs.js +58 -50
  90. package/dist/controls.cjs.js.map +1 -1
  91. package/dist/controls.es.js +8 -3
  92. package/dist/controls.es.js.map +1 -1
  93. package/dist/index.cjs.js +534 -495
  94. package/dist/index.cjs.js.map +1 -1
  95. package/dist/index.cjs10.js +372 -0
  96. package/dist/index.cjs10.js.map +1 -0
  97. package/dist/index.cjs2.js +10 -8
  98. package/dist/index.cjs2.js.map +1 -1
  99. package/dist/index.cjs5.js +2 -480
  100. package/dist/index.cjs5.js.map +1 -1
  101. package/dist/index.cjs6.js +6 -7
  102. package/dist/index.cjs6.js.map +1 -1
  103. package/dist/index.cjs7.js +17 -39
  104. package/dist/index.cjs7.js.map +1 -1
  105. package/dist/index.cjs8.js +14 -180
  106. package/dist/index.cjs8.js.map +1 -1
  107. package/dist/index.cjs9.js +191 -265
  108. package/dist/index.cjs9.js.map +1 -1
  109. package/dist/index.es.js +299 -260
  110. package/dist/index.es.js.map +1 -1
  111. package/dist/index.es10.js +365 -0
  112. package/dist/index.es10.js.map +1 -0
  113. package/dist/index.es2.js +5 -3
  114. package/dist/index.es2.js.map +1 -1
  115. package/dist/index.es5.js +3 -471
  116. package/dist/index.es5.js.map +1 -1
  117. package/dist/index.es6.js +4 -5
  118. package/dist/index.es6.js.map +1 -1
  119. package/dist/index.es7.js +17 -37
  120. package/dist/index.es7.js.map +1 -1
  121. package/dist/index.es8.js +13 -175
  122. package/dist/index.es8.js.map +1 -1
  123. package/dist/index.es9.js +188 -262
  124. package/dist/index.es9.js.map +1 -1
  125. package/dist/leaf.cjs.js +4 -4
  126. package/dist/leaf.cjs.js.map +1 -1
  127. package/dist/leaf.es.js +1 -1
  128. package/dist/leaf.es.js.map +1 -1
  129. package/dist/main.cjs.js +8 -4
  130. package/dist/main.cjs.js.map +1 -1
  131. package/dist/main.es.js +6 -5
  132. package/dist/main.es.js.map +1 -1
  133. package/dist/next.cjs.js +6 -4
  134. package/dist/next.cjs.js.map +1 -1
  135. package/dist/next.es.js +6 -4
  136. package/dist/next.es.js.map +1 -1
  137. package/dist/prop-controllers.cjs.js +11 -7
  138. package/dist/prop-controllers.cjs.js.map +1 -1
  139. package/dist/prop-controllers.es.js +7 -3
  140. package/dist/prop-controllers.es.js.map +1 -1
  141. package/dist/{descriptors.cjs.js → react-page.cjs.js} +1559 -102
  142. package/dist/react-page.cjs.js.map +1 -0
  143. package/dist/{descriptors.es.js → react-page.es.js} +1469 -80
  144. package/dist/react-page.es.js.map +1 -0
  145. package/dist/react.cjs.js +6 -4
  146. package/dist/react.cjs.js.map +1 -1
  147. package/dist/react.es.js +6 -4
  148. package/dist/react.es.js.map +1 -1
  149. package/dist/slate.cjs.js +17 -11
  150. package/dist/slate.cjs.js.map +1 -1
  151. package/dist/slate.es.js +7 -5
  152. package/dist/slate.es.js.map +1 -1
  153. package/dist/state/breakpoints.cjs.js.map +1 -1
  154. package/dist/state/breakpoints.es.js.map +1 -1
  155. package/dist/text-input.cjs.js +0 -6
  156. package/dist/text-input.cjs.js.map +1 -1
  157. package/dist/text-input.es.js +1 -5
  158. package/dist/text-input.es.js.map +1 -1
  159. package/dist/types/src/api/graphql/documents/queries.d.ts.map +1 -1
  160. package/dist/types/src/api/graphql/generated/types.d.ts +36 -44
  161. package/dist/types/src/api/graphql/generated/types.d.ts.map +1 -1
  162. package/dist/types/src/api/graphql/types.d.ts +2 -2
  163. package/dist/types/src/api/graphql/types.d.ts.map +1 -1
  164. package/dist/types/src/api/react.d.ts +3 -3
  165. package/dist/types/src/api/react.d.ts.map +1 -1
  166. package/dist/types/src/builder/serialization/control-serialization.d.ts +66 -66
  167. package/dist/types/src/builder/serialization/control-serialization.d.ts.map +1 -1
  168. package/dist/types/src/builder/serialization/controls/rich-text-v2.d.ts +5 -0
  169. package/dist/types/src/builder/serialization/controls/rich-text-v2.d.ts.map +1 -0
  170. package/dist/types/src/builder/serialization/controls/types.d.ts +3 -3
  171. package/dist/types/src/builder/serialization/controls/types.d.ts.map +1 -1
  172. package/dist/types/src/builder/serialization/function-serialization.d.ts +4 -4
  173. package/dist/types/src/builder/serialization/function-serialization.d.ts.map +1 -1
  174. package/dist/types/src/components/builtin/Box/animations.d.ts +1 -1
  175. package/dist/types/src/components/builtin/Box/animations.d.ts.map +1 -1
  176. package/dist/types/src/components/builtin/Box/components/Placeholder/index.d.ts +1 -1
  177. package/dist/types/src/components/builtin/Box/components/Placeholder/index.d.ts.map +1 -1
  178. package/dist/types/src/components/builtin/Box/constants.d.ts +1 -1
  179. package/dist/types/src/components/builtin/Box/constants.d.ts.map +1 -1
  180. package/dist/types/src/components/builtin/Button/Button.d.ts +3 -3
  181. package/dist/types/src/components/builtin/Button/Button.d.ts.map +1 -1
  182. package/dist/types/src/components/builtin/Button/contants.d.ts +1 -1
  183. package/dist/types/src/components/builtin/Button/contants.d.ts.map +1 -1
  184. package/dist/types/src/components/builtin/Carousel/Carousel.d.ts +1 -1
  185. package/dist/types/src/components/builtin/Carousel/Carousel.d.ts.map +1 -1
  186. package/dist/types/src/components/builtin/Carousel/register.d.ts.map +1 -1
  187. package/dist/types/src/components/builtin/Countdown/Countdown.d.ts +1 -1
  188. package/dist/types/src/components/builtin/Countdown/Countdown.d.ts.map +1 -1
  189. package/dist/types/src/components/builtin/Countdown/register.d.ts.map +1 -1
  190. package/dist/types/src/components/builtin/Divider/Divider.d.ts +2 -2
  191. package/dist/types/src/components/builtin/Divider/Divider.d.ts.map +1 -1
  192. package/dist/types/src/components/builtin/Divider/register.d.ts.map +1 -1
  193. package/dist/types/src/components/builtin/Embed/Embed.d.ts +1 -1
  194. package/dist/types/src/components/builtin/Embed/Embed.d.ts.map +1 -1
  195. package/dist/types/src/components/builtin/Embed/register.d.ts.map +1 -1
  196. package/dist/types/src/components/builtin/Form/Form.d.ts +2 -2
  197. package/dist/types/src/components/builtin/Form/Form.d.ts.map +1 -1
  198. package/dist/types/src/components/builtin/Form/components/Field/components/Checkbox/index.d.ts +2 -2
  199. package/dist/types/src/components/builtin/Form/components/Field/components/Checkbox/index.d.ts.map +1 -1
  200. package/dist/types/src/components/builtin/Form/components/Field/components/CheckboxTableField/index.d.ts +1 -1
  201. package/dist/types/src/components/builtin/Form/components/Field/components/CheckboxTableField/index.d.ts.map +1 -1
  202. package/dist/types/src/components/builtin/Form/components/Field/components/EmailTableField/index.d.ts +1 -1
  203. package/dist/types/src/components/builtin/Form/components/Field/components/EmailTableField/index.d.ts.map +1 -1
  204. package/dist/types/src/components/builtin/Form/components/Field/components/Input/index.d.ts +1 -1
  205. package/dist/types/src/components/builtin/Form/components/Field/components/Input/index.d.ts.map +1 -1
  206. package/dist/types/src/components/builtin/Form/components/Field/components/Label/index.d.ts +2 -2
  207. package/dist/types/src/components/builtin/Form/components/Field/components/Label/index.d.ts.map +1 -1
  208. package/dist/types/src/components/builtin/Form/components/Field/components/LongTextTableField/index.d.ts +1 -1
  209. package/dist/types/src/components/builtin/Form/components/Field/components/LongTextTableField/index.d.ts.map +1 -1
  210. package/dist/types/src/components/builtin/Form/components/Field/components/MultipleSelectTableField/index.d.ts +1 -1
  211. package/dist/types/src/components/builtin/Form/components/Field/components/MultipleSelectTableField/index.d.ts.map +1 -1
  212. package/dist/types/src/components/builtin/Form/components/Field/components/NumberTableField/index.d.ts +1 -1
  213. package/dist/types/src/components/builtin/Form/components/Field/components/NumberTableField/index.d.ts.map +1 -1
  214. package/dist/types/src/components/builtin/Form/components/Field/components/PhoneNumberTableField/index.d.ts +1 -1
  215. package/dist/types/src/components/builtin/Form/components/Field/components/PhoneNumberTableField/index.d.ts.map +1 -1
  216. package/dist/types/src/components/builtin/Form/components/Field/components/RadioButton/index.d.ts +1 -1
  217. package/dist/types/src/components/builtin/Form/components/Field/components/RadioButton/index.d.ts.map +1 -1
  218. package/dist/types/src/components/builtin/Form/components/Field/components/SingleLineTextTableField/index.d.ts +1 -1
  219. package/dist/types/src/components/builtin/Form/components/Field/components/SingleLineTextTableField/index.d.ts.map +1 -1
  220. package/dist/types/src/components/builtin/Form/components/Field/components/SingleSelectTableField/components/TableColumnRadioButtonGroup/index.d.ts +1 -1
  221. package/dist/types/src/components/builtin/Form/components/Field/components/SingleSelectTableField/components/TableColumnRadioButtonGroup/index.d.ts.map +1 -1
  222. package/dist/types/src/components/builtin/Form/components/Field/components/SingleSelectTableField/components/TableColumnSingleSelect/index.d.ts +1 -1
  223. package/dist/types/src/components/builtin/Form/components/Field/components/SingleSelectTableField/components/TableColumnSingleSelect/index.d.ts.map +1 -1
  224. package/dist/types/src/components/builtin/Form/components/Field/components/SingleSelectTableField/index.d.ts +1 -1
  225. package/dist/types/src/components/builtin/Form/components/Field/components/SingleSelectTableField/index.d.ts.map +1 -1
  226. package/dist/types/src/components/builtin/Form/components/Field/components/TextArea/index.d.ts +1 -1
  227. package/dist/types/src/components/builtin/Form/components/Field/components/TextArea/index.d.ts.map +1 -1
  228. package/dist/types/src/components/builtin/Form/components/Field/components/URLTableField/index.d.ts +1 -1
  229. package/dist/types/src/components/builtin/Form/components/Field/components/URLTableField/index.d.ts.map +1 -1
  230. package/dist/types/src/components/builtin/Form/components/Field/index.d.ts +2 -2
  231. package/dist/types/src/components/builtin/Form/components/Field/index.d.ts.map +1 -1
  232. package/dist/types/src/components/builtin/Form/components/Placeholder/index.d.ts +1 -1
  233. package/dist/types/src/components/builtin/Form/components/Placeholder/index.d.ts.map +1 -1
  234. package/dist/types/src/components/builtin/Form/context/FormContext.d.ts +5 -5
  235. package/dist/types/src/components/builtin/Form/context/FormContext.d.ts.map +1 -1
  236. package/dist/types/src/components/builtin/Form/register.d.ts.map +1 -1
  237. package/dist/types/src/components/builtin/Form/types.d.ts +13 -13
  238. package/dist/types/src/components/builtin/Form/types.d.ts.map +1 -1
  239. package/dist/types/src/components/builtin/Image/Image.d.ts +1 -1
  240. package/dist/types/src/components/builtin/Image/Image.d.ts.map +1 -1
  241. package/dist/types/src/components/builtin/Navigation/Navigation.d.ts +1 -1
  242. package/dist/types/src/components/builtin/Navigation/Navigation.d.ts.map +1 -1
  243. package/dist/types/src/components/builtin/Navigation/components/DropDownButton/index.d.ts +3 -3
  244. package/dist/types/src/components/builtin/Navigation/components/DropDownButton/index.d.ts.map +1 -1
  245. package/dist/types/src/components/builtin/Navigation/components/LinksPlaceholder/index.d.ts +1 -1
  246. package/dist/types/src/components/builtin/Navigation/components/LinksPlaceholder/index.d.ts.map +1 -1
  247. package/dist/types/src/components/builtin/Navigation/components/MobileMenu/components/MobileDropDownButton/index.d.ts +3 -3
  248. package/dist/types/src/components/builtin/Navigation/components/MobileMenu/components/MobileDropDownButton/index.d.ts.map +1 -1
  249. package/dist/types/src/components/builtin/Navigation/components/MobileMenu/index.d.ts +1 -1
  250. package/dist/types/src/components/builtin/Navigation/components/MobileMenu/index.d.ts.map +1 -1
  251. package/dist/types/src/components/builtin/Navigation/register.d.ts.map +1 -1
  252. package/dist/types/src/components/builtin/Root/Root.d.ts +1 -1
  253. package/dist/types/src/components/builtin/Root/Root.d.ts.map +1 -1
  254. package/dist/types/src/components/builtin/SocialLinks/SocialLinks.d.ts +1 -1
  255. package/dist/types/src/components/builtin/SocialLinks/SocialLinks.d.ts.map +1 -1
  256. package/dist/types/src/components/builtin/SocialLinks/components/SocialLinksPlaceholder/index.d.ts +1 -1
  257. package/dist/types/src/components/builtin/SocialLinks/components/SocialLinksPlaceholder/index.d.ts.map +1 -1
  258. package/dist/types/src/components/builtin/SocialLinks/register.d.ts.map +1 -1
  259. package/dist/types/src/components/builtin/Text/EditableText/editable-text.d.ts +1 -1
  260. package/dist/types/src/components/builtin/Text/EditableText/editable-text.d.ts.map +1 -1
  261. package/dist/types/src/components/builtin/Text/ReadOnlyText.d.ts +3 -3
  262. package/dist/types/src/components/builtin/Text/ReadOnlyText.d.ts.map +1 -1
  263. package/dist/types/src/components/builtin/Text/Text.d.ts +1 -1
  264. package/dist/types/src/components/builtin/Text/Text.d.ts.map +1 -1
  265. package/dist/types/src/components/builtin/Text/components/Element/block.d.ts +2 -2
  266. package/dist/types/src/components/builtin/Text/components/Element/block.d.ts.map +1 -1
  267. package/dist/types/src/components/builtin/Text/components/Element/inline.d.ts +1 -1
  268. package/dist/types/src/components/builtin/Text/components/Element/inline.d.ts.map +1 -1
  269. package/dist/types/src/components/builtin/Text/components/Leaf/leaf.d.ts +5 -5
  270. package/dist/types/src/components/builtin/Text/components/Leaf/leaf.d.ts.map +1 -1
  271. package/dist/types/src/components/builtin/Video/Video.d.ts +1 -1
  272. package/dist/types/src/components/builtin/Video/Video.d.ts.map +1 -1
  273. package/dist/types/src/components/builtin/Video/register.d.ts.map +1 -1
  274. package/dist/types/src/components/hooks/useBackgrounds.d.ts +8 -8
  275. package/dist/types/src/components/hooks/useBackgrounds.d.ts.map +1 -1
  276. package/dist/types/src/components/hooks/useBorder.d.ts +3 -3
  277. package/dist/types/src/components/hooks/useBorder.d.ts.map +1 -1
  278. package/dist/types/src/components/hooks/useBoxShadow.d.ts +3 -3
  279. package/dist/types/src/components/hooks/useBoxShadow.d.ts.map +1 -1
  280. package/dist/types/src/components/page/BodySnippet.d.ts +1 -1
  281. package/dist/types/src/components/page/BodySnippet.d.ts.map +1 -1
  282. package/dist/types/src/components/page/Page.d.ts +1 -1
  283. package/dist/types/src/components/page/Page.d.ts.map +1 -1
  284. package/dist/types/src/components/shared/BackgroundsContainer/components/BackgroundVideo/index.d.ts +1 -1
  285. package/dist/types/src/components/shared/BackgroundsContainer/components/BackgroundVideo/index.d.ts.map +1 -1
  286. package/dist/types/src/components/shared/BackgroundsContainer/components/Backgrounds/index.d.ts +1 -1
  287. package/dist/types/src/components/shared/BackgroundsContainer/components/Backgrounds/index.d.ts.map +1 -1
  288. package/dist/types/src/components/shared/BackgroundsContainer/components/Parallax/index.d.ts +1 -1
  289. package/dist/types/src/components/shared/BackgroundsContainer/components/Parallax/index.d.ts.map +1 -1
  290. package/dist/types/src/components/shared/BackgroundsContainer/index.d.ts +1 -1
  291. package/dist/types/src/components/shared/BackgroundsContainer/index.d.ts.map +1 -1
  292. package/dist/types/src/components/shared/FallbackComponent/FallbackComponent.d.ts +1 -1
  293. package/dist/types/src/components/shared/FallbackComponent/FallbackComponent.d.ts.map +1 -1
  294. package/dist/types/src/components/shared/GutterContainer/index.d.ts +2 -2
  295. package/dist/types/src/components/shared/GutterContainer/index.d.ts.map +1 -1
  296. package/dist/types/src/components/shared/Link/index.d.ts +1 -1
  297. package/dist/types/src/components/shared/Link/index.d.ts.map +1 -1
  298. package/dist/types/src/components/shared/grid-item.d.ts +2 -2
  299. package/dist/types/src/components/shared/grid-item.d.ts.map +1 -1
  300. package/dist/types/src/components/utils/drop-first.d.ts +1 -1
  301. package/dist/types/src/components/utils/drop-first.d.ts.map +1 -1
  302. package/dist/types/src/components/utils/types.d.ts +2 -2
  303. package/dist/types/src/components/utils/types.d.ts.map +1 -1
  304. package/dist/types/src/controls/checkbox.d.ts +3 -3
  305. package/dist/types/src/controls/checkbox.d.ts.map +1 -1
  306. package/dist/types/src/controls/color.d.ts +3 -3
  307. package/dist/types/src/controls/color.d.ts.map +1 -1
  308. package/dist/types/src/controls/combobox.d.ts +5 -5
  309. package/dist/types/src/controls/combobox.d.ts.map +1 -1
  310. package/dist/types/src/controls/control.d.ts +6 -4
  311. package/dist/types/src/controls/control.d.ts.map +1 -1
  312. package/dist/types/src/controls/image.d.ts +4 -4
  313. package/dist/types/src/controls/image.d.ts.map +1 -1
  314. package/dist/types/src/controls/link.d.ts +8 -8
  315. package/dist/types/src/controls/link.d.ts.map +1 -1
  316. package/dist/types/src/controls/list.d.ts +6 -6
  317. package/dist/types/src/controls/list.d.ts.map +1 -1
  318. package/dist/types/src/controls/number.d.ts +3 -3
  319. package/dist/types/src/controls/number.d.ts.map +1 -1
  320. package/dist/types/src/controls/rich-text/dto-types.d.ts +4 -4
  321. package/dist/types/src/controls/rich-text/dto-types.d.ts.map +1 -1
  322. package/dist/types/src/controls/rich-text/rich-text.d.ts +11 -11
  323. package/dist/types/src/controls/rich-text/rich-text.d.ts.map +1 -1
  324. package/dist/types/src/controls/rich-text/translation.d.ts +1 -1
  325. package/dist/types/src/controls/rich-text/translation.d.ts.map +1 -1
  326. package/dist/types/src/controls/rich-text-v2/rich-text-v2.d.ts +39 -18
  327. package/dist/types/src/controls/rich-text-v2/rich-text-v2.d.ts.map +1 -1
  328. package/dist/types/src/controls/select.d.ts +5 -5
  329. package/dist/types/src/controls/select.d.ts.map +1 -1
  330. package/dist/types/src/controls/shape.d.ts +5 -5
  331. package/dist/types/src/controls/shape.d.ts.map +1 -1
  332. package/dist/types/src/controls/slot.d.ts +17 -8
  333. package/dist/types/src/controls/slot.d.ts.map +1 -1
  334. package/dist/types/src/controls/style.d.ts +18 -18
  335. package/dist/types/src/controls/style.d.ts.map +1 -1
  336. package/dist/types/src/controls/text-area.d.ts +3 -3
  337. package/dist/types/src/controls/text-area.d.ts.map +1 -1
  338. package/dist/types/src/controls/text-input.d.ts +3 -3
  339. package/dist/types/src/controls/text-input.d.ts.map +1 -1
  340. package/dist/types/src/controls/types.d.ts +5 -5
  341. package/dist/types/src/controls/types.d.ts.map +1 -1
  342. package/dist/types/src/css/border-radius.d.ts +2 -2
  343. package/dist/types/src/css/border-radius.d.ts.map +1 -1
  344. package/dist/types/src/css/border.d.ts +2 -2
  345. package/dist/types/src/css/border.d.ts.map +1 -1
  346. package/dist/types/src/css/length-percentage.d.ts +2 -2
  347. package/dist/types/src/css/length-percentage.d.ts.map +1 -1
  348. package/dist/types/src/css/length.d.ts +1 -1
  349. package/dist/types/src/css/length.d.ts.map +1 -1
  350. package/dist/types/src/css/margin.d.ts +2 -2
  351. package/dist/types/src/css/margin.d.ts.map +1 -1
  352. package/dist/types/src/css/padding.d.ts +2 -2
  353. package/dist/types/src/css/padding.d.ts.map +1 -1
  354. package/dist/types/src/index.d.ts +2 -1
  355. package/dist/types/src/index.d.ts.map +1 -1
  356. package/dist/types/src/next/api-handler/handlers/element-tree.d.ts +3 -3
  357. package/dist/types/src/next/api-handler/handlers/element-tree.d.ts.map +1 -1
  358. package/dist/types/src/next/api-handler/handlers/fonts.d.ts +5 -5
  359. package/dist/types/src/next/api-handler/handlers/fonts.d.ts.map +1 -1
  360. package/dist/types/src/next/api-handler/handlers/manifest.d.ts +6 -4
  361. package/dist/types/src/next/api-handler/handlers/manifest.d.ts.map +1 -1
  362. package/dist/types/src/next/api-handler/handlers/proxy-preview-mode.d.ts +2 -2
  363. package/dist/types/src/next/api-handler/handlers/proxy-preview-mode.d.ts.map +1 -1
  364. package/dist/types/src/next/api-handler/handlers/revalidate.d.ts +3 -3
  365. package/dist/types/src/next/api-handler/handlers/revalidate.d.ts.map +1 -1
  366. package/dist/types/src/next/api-handler/index.d.ts +5 -4
  367. package/dist/types/src/next/api-handler/index.d.ts.map +1 -1
  368. package/dist/types/src/next/client.d.ts +15 -15
  369. package/dist/types/src/next/client.d.ts.map +1 -1
  370. package/dist/types/src/next/dynamic.d.ts +4 -4
  371. package/dist/types/src/next/dynamic.d.ts.map +1 -1
  372. package/dist/types/src/next/index.d.ts +10 -7
  373. package/dist/types/src/next/index.d.ts.map +1 -1
  374. package/dist/types/src/next/preview-mode.d.ts +18 -4
  375. package/dist/types/src/next/preview-mode.d.ts.map +1 -1
  376. package/dist/types/src/prop-controllers/descriptors.d.ts +179 -179
  377. package/dist/types/src/prop-controllers/descriptors.d.ts.map +1 -1
  378. package/dist/types/src/prop-controllers/instances.d.ts +17 -17
  379. package/dist/types/src/prop-controllers/instances.d.ts.map +1 -1
  380. package/dist/types/src/runtimes/react/components/LiveProvider.d.ts +1 -1
  381. package/dist/types/src/runtimes/react/components/LiveProvider.d.ts.map +1 -1
  382. package/dist/types/src/runtimes/react/components/PreviewProvider.d.ts +1 -1
  383. package/dist/types/src/runtimes/react/components/PreviewProvider.d.ts.map +1 -1
  384. package/dist/types/src/runtimes/react/components/render-hook.d.ts +1 -1
  385. package/dist/types/src/runtimes/react/components/render-hook.d.ts.map +1 -1
  386. package/dist/types/src/runtimes/react/controls/checkbox.d.ts +1 -1
  387. package/dist/types/src/runtimes/react/controls/checkbox.d.ts.map +1 -1
  388. package/dist/types/src/runtimes/react/controls/color.d.ts +1 -1
  389. package/dist/types/src/runtimes/react/controls/color.d.ts.map +1 -1
  390. package/dist/types/src/runtimes/react/controls/combobox.d.ts +1 -1
  391. package/dist/types/src/runtimes/react/controls/combobox.d.ts.map +1 -1
  392. package/dist/types/src/runtimes/react/controls/control.d.ts +2 -2
  393. package/dist/types/src/runtimes/react/controls/control.d.ts.map +1 -1
  394. package/dist/types/src/runtimes/react/controls/image.d.ts +3 -3
  395. package/dist/types/src/runtimes/react/controls/image.d.ts.map +1 -1
  396. package/dist/types/src/runtimes/react/controls/link.d.ts +2 -2
  397. package/dist/types/src/runtimes/react/controls/link.d.ts.map +1 -1
  398. package/dist/types/src/runtimes/react/controls/list.d.ts +3 -3
  399. package/dist/types/src/runtimes/react/controls/list.d.ts.map +1 -1
  400. package/dist/types/src/runtimes/react/controls/number.d.ts +1 -1
  401. package/dist/types/src/runtimes/react/controls/number.d.ts.map +1 -1
  402. package/dist/types/src/runtimes/react/controls/rich-text-v2/EditableTextV2/editable-text-v2.d.ts +3 -3
  403. package/dist/types/src/runtimes/react/controls/rich-text-v2/EditableTextV2/editable-text-v2.d.ts.map +1 -1
  404. package/dist/types/src/runtimes/react/controls/rich-text-v2/ReadOnlyTextV2.d.ts +7 -4
  405. package/dist/types/src/runtimes/react/controls/rich-text-v2/ReadOnlyTextV2.d.ts.map +1 -1
  406. package/dist/types/src/runtimes/react/controls/rich-text-v2/rich-text-v2.d.ts +2 -2
  407. package/dist/types/src/runtimes/react/controls/rich-text-v2/rich-text-v2.d.ts.map +1 -1
  408. package/dist/types/src/runtimes/react/controls/rich-text.d.ts +2 -2
  409. package/dist/types/src/runtimes/react/controls/rich-text.d.ts.map +1 -1
  410. package/dist/types/src/runtimes/react/controls/select.d.ts +1 -1
  411. package/dist/types/src/runtimes/react/controls/select.d.ts.map +1 -1
  412. package/dist/types/src/runtimes/react/controls/shape.d.ts +2 -2
  413. package/dist/types/src/runtimes/react/controls/shape.d.ts.map +1 -1
  414. package/dist/types/src/runtimes/react/controls/slot.d.ts +4 -4
  415. package/dist/types/src/runtimes/react/controls/slot.d.ts.map +1 -1
  416. package/dist/types/src/runtimes/react/controls/style.d.ts +1 -1
  417. package/dist/types/src/runtimes/react/controls/style.d.ts.map +1 -1
  418. package/dist/types/src/runtimes/react/controls/text-area.d.ts +1 -1
  419. package/dist/types/src/runtimes/react/controls/text-area.d.ts.map +1 -1
  420. package/dist/types/src/runtimes/react/controls/text-input.d.ts +1 -1
  421. package/dist/types/src/runtimes/react/controls/text-input.d.ts.map +1 -1
  422. package/dist/types/src/runtimes/react/controls.d.ts +8 -8
  423. package/dist/types/src/runtimes/react/controls.d.ts.map +1 -1
  424. package/dist/types/src/runtimes/react/element-imperative-handle.d.ts +1 -1
  425. package/dist/types/src/runtimes/react/element-imperative-handle.d.ts.map +1 -1
  426. package/dist/types/src/runtimes/react/find-dom-node.d.ts +1 -1
  427. package/dist/types/src/runtimes/react/find-dom-node.d.ts.map +1 -1
  428. package/dist/types/src/runtimes/react/index.d.ts +10 -8
  429. package/dist/types/src/runtimes/react/index.d.ts.map +1 -1
  430. package/dist/types/src/slate/BlockPlugin/constants.d.ts.map +1 -0
  431. package/dist/types/src/slate/BlockPlugin/dedent.d.ts.map +1 -0
  432. package/dist/types/src/slate/BlockPlugin/indent.d.ts.map +1 -0
  433. package/dist/types/src/slate/BlockPlugin/index.d.ts +56 -2
  434. package/dist/types/src/slate/BlockPlugin/index.d.ts.map +1 -1
  435. package/dist/types/src/slate/BlockPlugin/setBlockKeyForDevice.d.ts +1 -1
  436. package/dist/types/src/slate/BlockPlugin/setBlockKeyForDevice.d.ts.map +1 -1
  437. package/dist/types/src/slate/{ListPlugin → BlockPlugin}/toggleList.d.ts +2 -2
  438. package/dist/types/src/slate/BlockPlugin/toggleList.d.ts.map +1 -0
  439. package/dist/types/src/slate/BlockPlugin/types.d.ts +3 -3
  440. package/dist/types/src/slate/BlockPlugin/types.d.ts.map +1 -1
  441. package/dist/types/src/slate/BlockPlugin/unwrapInline.d.ts +1 -1
  442. package/dist/types/src/slate/BlockPlugin/unwrapInline.d.ts.map +1 -1
  443. package/dist/types/src/slate/{ListPlugin → BlockPlugin}/unwrapList.d.ts +1 -1
  444. package/dist/types/src/slate/BlockPlugin/unwrapList.d.ts.map +1 -0
  445. package/dist/types/src/slate/BlockPlugin/utils/filterForSubtreeRoots.d.ts.map +1 -0
  446. package/dist/types/src/slate/BlockPlugin/utils/getSelectedListItems.d.ts.map +1 -0
  447. package/dist/types/src/slate/BlockPlugin/utils/location.d.ts.map +1 -0
  448. package/dist/types/src/slate/BlockPlugin/wrapInline.d.ts +1 -1
  449. package/dist/types/src/slate/BlockPlugin/wrapInline.d.ts.map +1 -1
  450. package/dist/types/src/slate/{ListPlugin → BlockPlugin}/wrapList.d.ts +2 -2
  451. package/dist/types/src/slate/BlockPlugin/wrapList.d.ts.map +1 -0
  452. package/dist/types/src/slate/BuilderPlugin/index.d.ts +1 -1
  453. package/dist/types/src/slate/BuilderPlugin/index.d.ts.map +1 -1
  454. package/dist/types/src/slate/InlineModePlugin/index.d.ts +6 -2
  455. package/dist/types/src/slate/InlineModePlugin/index.d.ts.map +1 -1
  456. package/dist/types/src/slate/TypographyPlugin/clearActiveTypographyStyle.d.ts +1 -1
  457. package/dist/types/src/slate/TypographyPlugin/clearActiveTypographyStyle.d.ts.map +1 -1
  458. package/dist/types/src/slate/TypographyPlugin/clearDeviceActiveTypography.d.ts +1 -1
  459. package/dist/types/src/slate/TypographyPlugin/clearDeviceActiveTypography.d.ts.map +1 -1
  460. package/dist/types/src/slate/TypographyPlugin/detachActiveTypography.d.ts +2 -2
  461. package/dist/types/src/slate/TypographyPlugin/detachActiveTypography.d.ts.map +1 -1
  462. package/dist/types/src/slate/TypographyPlugin/index.d.ts +2 -2
  463. package/dist/types/src/slate/TypographyPlugin/index.d.ts.map +1 -1
  464. package/dist/types/src/slate/TypographyPlugin/setActiveTypographyId.d.ts +1 -1
  465. package/dist/types/src/slate/TypographyPlugin/setActiveTypographyId.d.ts.map +1 -1
  466. package/dist/types/src/slate/TypographyPlugin/setActiveTypographyStyle.d.ts +1 -1
  467. package/dist/types/src/slate/TypographyPlugin/setActiveTypographyStyle.d.ts.map +1 -1
  468. package/dist/types/src/slate/index.d.ts +1 -1
  469. package/dist/types/src/slate/index.d.ts.map +1 -1
  470. package/dist/types/src/slate/selectors.d.ts +1 -1
  471. package/dist/types/src/slate/selectors.d.ts.map +1 -1
  472. package/dist/types/{types/slate.d.ts → src/slate/types.d.ts} +42 -35
  473. package/dist/types/src/slate/types.d.ts.map +1 -0
  474. package/dist/types/src/slate/utils/editor.d.ts +1 -1
  475. package/dist/types/src/slate/utils/editor.d.ts.map +1 -1
  476. package/dist/types/src/slate/utils/element.d.ts +1 -2
  477. package/dist/types/src/slate/utils/element.d.ts.map +1 -1
  478. package/dist/types/src/state/actions.d.ts +66 -41
  479. package/dist/types/src/state/actions.d.ts.map +1 -1
  480. package/dist/types/src/state/makeswift-api-client.d.ts +5 -5
  481. package/dist/types/src/state/makeswift-api-client.d.ts.map +1 -1
  482. package/dist/types/src/state/modules/api-resources.d.ts +2 -2
  483. package/dist/types/src/state/modules/api-resources.d.ts.map +1 -1
  484. package/dist/types/src/state/modules/box-models.d.ts +2 -2
  485. package/dist/types/src/state/modules/box-models.d.ts.map +1 -1
  486. package/dist/types/src/state/modules/breakpoints.d.ts +9 -9
  487. package/dist/types/src/state/modules/breakpoints.d.ts.map +1 -1
  488. package/dist/types/src/state/modules/builder-edit-mode.d.ts +2 -2
  489. package/dist/types/src/state/modules/builder-edit-mode.d.ts.map +1 -1
  490. package/dist/types/src/state/modules/components-meta.d.ts +27 -3
  491. package/dist/types/src/state/modules/components-meta.d.ts.map +1 -1
  492. package/dist/types/src/state/modules/element-imperative-handles.d.ts +1 -1
  493. package/dist/types/src/state/modules/element-imperative-handles.d.ts.map +1 -1
  494. package/dist/types/src/state/modules/is-in-builder.d.ts +1 -1
  495. package/dist/types/src/state/modules/is-in-builder.d.ts.map +1 -1
  496. package/dist/types/src/state/modules/is-preview.d.ts +1 -1
  497. package/dist/types/src/state/modules/is-preview.d.ts.map +1 -1
  498. package/dist/types/src/state/modules/locales.d.ts +16 -0
  499. package/dist/types/src/state/modules/locales.d.ts.map +1 -0
  500. package/dist/types/src/state/modules/pointer.d.ts +2 -2
  501. package/dist/types/src/state/modules/pointer.d.ts.map +1 -1
  502. package/dist/types/src/state/modules/prop-controller-handles.d.ts +1 -1
  503. package/dist/types/src/state/modules/prop-controller-handles.d.ts.map +1 -1
  504. package/dist/types/src/state/modules/prop-controllers.d.ts +1 -1
  505. package/dist/types/src/state/modules/prop-controllers.d.ts.map +1 -1
  506. package/dist/types/src/state/modules/react-components.d.ts +2 -2
  507. package/dist/types/src/state/modules/react-components.d.ts.map +1 -1
  508. package/dist/types/src/state/modules/read-only-documents.d.ts +7 -7
  509. package/dist/types/src/state/modules/read-only-documents.d.ts.map +1 -1
  510. package/dist/types/src/state/modules/read-write-documents.d.ts +1 -1
  511. package/dist/types/src/state/modules/read-write-documents.d.ts.map +1 -1
  512. package/dist/types/src/state/react-builder-preview.d.ts +7 -6
  513. package/dist/types/src/state/react-builder-preview.d.ts.map +1 -1
  514. package/dist/types/src/state/react-page.d.ts +15 -7
  515. package/dist/types/src/state/react-page.d.ts.map +1 -1
  516. package/dist/types/src/state/react-page.test.d.ts +3 -0
  517. package/dist/types/src/state/react-page.test.d.ts.map +1 -0
  518. package/dist/types/src/utils/isErrorWithMessage.d.ts +1 -1
  519. package/dist/types/src/utils/isErrorWithMessage.d.ts.map +1 -1
  520. package/package.json +8 -4
  521. package/dist/descriptors.cjs.js.map +0 -1
  522. package/dist/descriptors.es.js.map +0 -1
  523. package/dist/element.cjs.js +0 -55
  524. package/dist/element.cjs.js.map +0 -1
  525. package/dist/element.es.js +0 -54
  526. package/dist/element.es.js.map +0 -1
  527. package/dist/introspection.cjs.js +0 -329
  528. package/dist/introspection.cjs.js.map +0 -1
  529. package/dist/introspection.es.js +0 -315
  530. package/dist/introspection.es.js.map +0 -1
  531. package/dist/slate.cjs2.js +0 -46
  532. package/dist/slate.cjs2.js.map +0 -1
  533. package/dist/slate.es2.js +0 -44
  534. package/dist/slate.es2.js.map +0 -1
  535. package/dist/types/src/slate/ListPlugin/constants.d.ts.map +0 -1
  536. package/dist/types/src/slate/ListPlugin/dedent.d.ts.map +0 -1
  537. package/dist/types/src/slate/ListPlugin/indent.d.ts.map +0 -1
  538. package/dist/types/src/slate/ListPlugin/index.d.ts +0 -17
  539. package/dist/types/src/slate/ListPlugin/index.d.ts.map +0 -1
  540. package/dist/types/src/slate/ListPlugin/toggleList.d.ts.map +0 -1
  541. package/dist/types/src/slate/ListPlugin/unwrapList.d.ts.map +0 -1
  542. package/dist/types/src/slate/ListPlugin/utils/filterForSubtreeRoots.d.ts.map +0 -1
  543. package/dist/types/src/slate/ListPlugin/utils/getSelectedListItems.d.ts.map +0 -1
  544. package/dist/types/src/slate/ListPlugin/utils/location.d.ts.map +0 -1
  545. package/dist/types/src/slate/ListPlugin/wrapList.d.ts.map +0 -1
  546. package/dist/types/types/slate.d.ts.map +0 -1
  547. /package/dist/types/src/slate/{ListPlugin → BlockPlugin}/constants.d.ts +0 -0
  548. /package/dist/types/src/slate/{ListPlugin → BlockPlugin}/dedent.d.ts +0 -0
  549. /package/dist/types/src/slate/{ListPlugin → BlockPlugin}/indent.d.ts +0 -0
  550. /package/dist/types/src/slate/{ListPlugin → BlockPlugin}/utils/filterForSubtreeRoots.d.ts +0 -0
  551. /package/dist/types/src/slate/{ListPlugin → BlockPlugin}/utils/getSelectedListItems.d.ts +0 -0
  552. /package/dist/types/src/slate/{ListPlugin → BlockPlugin}/utils/location.d.ts +0 -0
@@ -22,17 +22,230 @@ var __publicField = (obj, key, value) => {
22
22
  return value;
23
23
  };
24
24
  const import_meta = {};
25
+ import { combineReducers, createStore, applyMiddleware } from "redux";
26
+ import thunk from "redux-thunk";
25
27
  import { A as ActionTypes } from "./actions.es.js";
26
- import { B as BlockType, I as InlineType } from "./slate.es2.js";
28
+ import { findBreakpointOverride, reducer as reducer$a, getInitialState as getInitialState$9 } from "./state/breakpoints.es.js";
29
+ import { Element, Range, Editor, Text, Path, Transforms, Node, Point } from "slate";
30
+ import isHotkey from "is-hotkey";
31
+ import "slate-react";
32
+ const ComponentIcon = {
33
+ Billing: "billing",
34
+ Bolt: "bolt",
35
+ Button: "button",
36
+ Carousel: "carousel",
37
+ Chats: "chats",
38
+ Code: "code",
39
+ Countdown: "countdown",
40
+ Cube: "cube",
41
+ Database: "database",
42
+ Divider: "divider",
43
+ Form: "form",
44
+ Gallery: "gallery",
45
+ Help: "help",
46
+ Image: "image",
47
+ Layout: "layout",
48
+ Lock: "lock",
49
+ Navigation: "navigation",
50
+ SocialLinks: "social-links",
51
+ Star: "star",
52
+ Text: "text",
53
+ Users: "users",
54
+ Video: "video"
55
+ };
56
+ function getInitialState$8({
57
+ componentsMeta = /* @__PURE__ */ new Map()
58
+ } = {}) {
59
+ return componentsMeta;
60
+ }
61
+ function getComponentsMeta(state) {
62
+ return state;
63
+ }
64
+ function reducer$9(state = getInitialState$8(), action) {
65
+ switch (action.type) {
66
+ case ActionTypes.REGISTER_COMPONENT:
67
+ return new Map(state).set(action.payload.type, action.payload.meta);
68
+ case ActionTypes.UNREGISTER_COMPONENT: {
69
+ const nextState = new Map(state);
70
+ const deleted = nextState.delete(action.payload.type);
71
+ return deleted ? nextState : state;
72
+ }
73
+ default:
74
+ return state;
75
+ }
76
+ }
77
+ function isElementReference(element) {
78
+ return !("props" in element);
79
+ }
80
+ function createDocumentReference(key) {
81
+ return { key };
82
+ }
83
+ function createDocument(key, rootElement) {
84
+ return { key, rootElement };
85
+ }
86
+ function getInitialState$7({
87
+ rootElements = /* @__PURE__ */ new Map()
88
+ } = {}) {
89
+ const initialState = /* @__PURE__ */ new Map();
90
+ rootElements.forEach((rootElement, documentKey) => {
91
+ initialState.set(documentKey, createDocument(documentKey, rootElement));
92
+ });
93
+ return initialState;
94
+ }
95
+ function getDocuments(state) {
96
+ return state;
97
+ }
98
+ function getDocument$1(state, documentKey) {
99
+ var _a;
100
+ return (_a = getDocuments(state).get(documentKey)) != null ? _a : null;
101
+ }
102
+ function reducer$8(state = getInitialState$7(), action) {
103
+ switch (action.type) {
104
+ case ActionTypes.REGISTER_DOCUMENT:
105
+ return new Map(state).set(action.payload.documentKey, action.payload.document);
106
+ case ActionTypes.UNREGISTER_DOCUMENT: {
107
+ const nextState = new Map(state);
108
+ const deleted = nextState.delete(action.payload.documentKey);
109
+ return deleted ? nextState : state;
110
+ }
111
+ default:
112
+ return state;
113
+ }
114
+ }
115
+ function getInitialState$6({
116
+ reactComponents = /* @__PURE__ */ new Map()
117
+ } = {}) {
118
+ return reactComponents;
119
+ }
120
+ function getReactComponents(state) {
121
+ return state;
122
+ }
123
+ function getReactComponent$1(state, type) {
124
+ var _a;
125
+ return (_a = getReactComponents(state).get(type)) != null ? _a : null;
126
+ }
127
+ function reducer$7(state = getInitialState$6(), action) {
128
+ switch (action.type) {
129
+ case ActionTypes.REGISTER_REACT_COMPONENT:
130
+ return new Map(state).set(action.payload.type, action.payload.component);
131
+ case ActionTypes.UNREGISTER_REACT_COMPONENT: {
132
+ const nextState = new Map(state);
133
+ const deleted = nextState.delete(action.payload.type);
134
+ return deleted ? nextState : state;
135
+ }
136
+ default:
137
+ return state;
138
+ }
139
+ }
140
+ function getInitialState$5({
141
+ propControllerDescriptors = /* @__PURE__ */ new Map()
142
+ } = {}) {
143
+ return propControllerDescriptors;
144
+ }
145
+ function getPropControllerDescriptors$1(state) {
146
+ return state;
147
+ }
148
+ function getComponentPropControllerDescriptors$1(state, componentType) {
149
+ var _a;
150
+ return (_a = getPropControllerDescriptors$1(state).get(componentType)) != null ? _a : null;
151
+ }
152
+ function reducer$6(state = getInitialState$5(), action) {
153
+ switch (action.type) {
154
+ case ActionTypes.REGISTER_COMPONENT:
155
+ return new Map(state).set(action.payload.type, action.payload.propControllerDescriptors);
156
+ case ActionTypes.UNREGISTER_COMPONENT: {
157
+ const nextState = new Map(state);
158
+ const deleted = nextState.delete(action.payload.type);
159
+ return deleted ? nextState : state;
160
+ }
161
+ default:
162
+ return state;
163
+ }
164
+ }
165
+ function isPropControllersHandle(value) {
166
+ if (typeof value === "object" && value !== null && "setPropControllers" in value && typeof value.setPropControllers === "function") {
167
+ return true;
168
+ }
169
+ return false;
170
+ }
171
+ function getInitialState$4() {
172
+ return { handles: /* @__PURE__ */ new Map(), instances: /* @__PURE__ */ new Map() };
173
+ }
174
+ function getPropControllersHandle(state, documentKey, elementKey) {
175
+ var _a, _b;
176
+ return (_b = (_a = state.handles.get(documentKey)) == null ? void 0 : _a.get(elementKey)) != null ? _b : null;
177
+ }
178
+ function getPropControllers$1(state, documentKey, elementKey) {
179
+ var _a, _b;
180
+ return (_b = (_a = state.instances.get(documentKey)) == null ? void 0 : _a.get(elementKey)) != null ? _b : null;
181
+ }
182
+ function getPropController(state, documentKey, elementKey, propName) {
183
+ var _a, _b;
184
+ return (_b = (_a = getPropControllers$1(state, documentKey, elementKey)) == null ? void 0 : _a[propName]) != null ? _b : null;
185
+ }
186
+ function reducer$5(state = getInitialState$4(), action) {
187
+ var _a, _b, _c, _d;
188
+ switch (action.type) {
189
+ case ActionTypes.REGISTER_PROP_CONTROLLERS_HANDLE: {
190
+ const { documentKey, elementKey, handle } = action.payload;
191
+ return __spreadProps(__spreadValues({}, state), {
192
+ handles: new Map(state.handles).set(documentKey, new Map((_a = state.handles.get(documentKey)) != null ? _a : []).set(elementKey, handle))
193
+ });
194
+ }
195
+ case ActionTypes.UNREGISTER_PROP_CONTROLLERS_HANDLE: {
196
+ const { documentKey, elementKey } = action.payload;
197
+ const nextHandles = new Map((_b = state.handles.get(documentKey)) != null ? _b : []);
198
+ const deleted = nextHandles.delete(elementKey);
199
+ return deleted ? __spreadProps(__spreadValues({}, state), { handles: new Map(state.handles).set(documentKey, nextHandles) }) : state;
200
+ }
201
+ case ActionTypes.REGISTER_PROP_CONTROLLERS: {
202
+ const { documentKey, elementKey, propControllers } = action.payload;
203
+ return __spreadProps(__spreadValues({}, state), {
204
+ instances: new Map(state.instances).set(documentKey, new Map((_c = state.instances.get(documentKey)) != null ? _c : []).set(elementKey, propControllers))
205
+ });
206
+ }
207
+ case ActionTypes.UNREGISTER_PROP_CONTROLLERS: {
208
+ const { documentKey, elementKey } = action.payload;
209
+ const nextInstances = new Map((_d = state.instances.get(documentKey)) != null ? _d : []);
210
+ const deleted = nextInstances.delete(elementKey);
211
+ return deleted ? __spreadProps(__spreadValues({}, state), { instances: new Map(state.instances).set(documentKey, nextInstances) }) : state;
212
+ }
213
+ default:
214
+ return state;
215
+ }
216
+ }
217
+ function getInitialState$3() {
218
+ return false;
219
+ }
220
+ function reducer$4(state = getInitialState$3(), action) {
221
+ switch (action.type) {
222
+ case ActionTypes.SET_IS_IN_BUILDER:
223
+ return action.payload;
224
+ default:
225
+ return state;
226
+ }
227
+ }
228
+ function getInitialState$2(isPreview = false) {
229
+ return isPreview;
230
+ }
231
+ function getIsPreview$1(state) {
232
+ return state;
233
+ }
234
+ function reducer$3(state = getInitialState$2(), action) {
235
+ switch (action.type) {
236
+ default:
237
+ return state;
238
+ }
239
+ }
27
240
  const BuilderEditMode = {
28
241
  BUILD: "build",
29
242
  CONTENT: "content",
30
243
  INTERACT: "interact"
31
244
  };
32
- function getInitialState() {
245
+ function getInitialState$1() {
33
246
  return null;
34
247
  }
35
- function reducer(state = getInitialState(), action) {
248
+ function reducer$2(state = getInitialState$1(), action) {
36
249
  switch (action.type) {
37
250
  case ActionTypes.SET_BUILDER_EDIT_MODE:
38
251
  return action.payload.editMode;
@@ -40,6 +253,34 @@ function reducer(state = getInitialState(), action) {
40
253
  return state;
41
254
  }
42
255
  }
256
+ function getInitialState(initialState) {
257
+ var _a, _b, _c;
258
+ return {
259
+ locales: (_a = initialState == null ? void 0 : initialState.locales) != null ? _a : [],
260
+ locale: (_b = initialState == null ? void 0 : initialState.locale) != null ? _b : null,
261
+ defaultLocale: (_c = initialState == null ? void 0 : initialState.defaultLocale) != null ? _c : null
262
+ };
263
+ }
264
+ function reducer$1(state = getInitialState(), action) {
265
+ switch (action.type) {
266
+ case ActionTypes.SET_LOCALES: {
267
+ const locales = action.payload.locales;
268
+ return __spreadProps(__spreadValues({}, state), { locales });
269
+ }
270
+ case ActionTypes.SET_LOCALE: {
271
+ if (action.payload.locale === state.locale)
272
+ return state;
273
+ return __spreadProps(__spreadValues({}, state), { locale: action.payload.locale });
274
+ }
275
+ case ActionTypes.SET_DEFAULT_LOCALE: {
276
+ if (action.payload.defaultLocale === state.defaultLocale)
277
+ return state;
278
+ return __spreadProps(__spreadValues({}, state), { defaultLocale: action.payload.defaultLocale });
279
+ }
280
+ default:
281
+ return state;
282
+ }
283
+ }
43
284
  const ColorControlType = "makeswift::controls::color";
44
285
  function Color(config = {}) {
45
286
  return { type: ColorControlType, config };
@@ -315,11 +556,11 @@ class ListControl extends PropController {
315
556
  this.controls = /* @__PURE__ */ new Map();
316
557
  }
317
558
  }
318
- function copyListData(definition, value, context) {
559
+ function copyListData(definition2, value, context) {
319
560
  if (value == null)
320
561
  return value;
321
562
  return value && value.map((item) => __spreadProps(__spreadValues({}, item), {
322
- value: copy(definition.config.type, item.value, context)
563
+ value: copy(definition2.config.type, item.value, context)
323
564
  }));
324
565
  }
325
566
  const ShapeControlType = "makeswift::controls::shape";
@@ -365,11 +606,11 @@ class ShapeControl extends PropController {
365
606
  this.setControls();
366
607
  }
367
608
  }
368
- function copyShapeData(definition, value, context) {
609
+ function copyShapeData(definition2, value, context) {
369
610
  if (value == null)
370
611
  return value;
371
612
  const newValue = {};
372
- for (const [key, itemDefinition] of Object.entries(definition.config.type)) {
613
+ for (const [key, itemDefinition] of Object.entries(definition2.config.type)) {
373
614
  const prop = value[key];
374
615
  newValue[key] = copy(itemDefinition, prop, context);
375
616
  }
@@ -597,6 +838,22 @@ function copySlotData(value, context) {
597
838
  elements: value.elements.map((element) => context.copyElement(element))
598
839
  });
599
840
  }
841
+ function mergeSlotData(base = { columns: [], elements: [] }, override = { columns: [], elements: [] }, context) {
842
+ const mergedColumns = base.columns;
843
+ const mergedElements = base.elements.flatMap((baseElement) => {
844
+ const overrideElement = override.elements.find((e) => baseElement.type === e.type && baseElement.key === e.key);
845
+ if (overrideElement == null)
846
+ return [baseElement];
847
+ if (overrideElement.deleted)
848
+ return [];
849
+ if (isElementReference(overrideElement))
850
+ return [overrideElement];
851
+ if (isElementReference(baseElement))
852
+ return [baseElement];
853
+ return context.mergeElement(baseElement, overrideElement);
854
+ });
855
+ return { columns: mergedColumns, elements: mergedElements };
856
+ }
600
857
  function copy$e(value, context) {
601
858
  if (value == null)
602
859
  return value;
@@ -1349,8 +1606,8 @@ function copy$1(descriptor, value, context) {
1349
1606
  function copyElementReference(value, context) {
1350
1607
  return context.replacementContext.globalElementIds.get(value) || value;
1351
1608
  }
1352
- function copy(definition, value, context) {
1353
- switch (definition.type) {
1609
+ function copy(definition2, value, context) {
1610
+ switch (definition2.type) {
1354
1611
  case Types.Backgrounds:
1355
1612
  case Types.Grid:
1356
1613
  case Types.NavigationLinks:
@@ -1364,7 +1621,7 @@ function copy(definition, value, context) {
1364
1621
  case Types.Border:
1365
1622
  case Types.RichText:
1366
1623
  case Types.ElementID:
1367
- return copy$1(definition, value, context);
1624
+ return copy$1(definition2, value, context);
1368
1625
  case ColorControlType:
1369
1626
  return copyColorData(value, context);
1370
1627
  case ImageControlType:
@@ -1372,9 +1629,9 @@ function copy(definition, value, context) {
1372
1629
  case LinkControlType:
1373
1630
  return copyLinkData(value, context);
1374
1631
  case ShapeControlType:
1375
- return copyShapeData(definition, value, context);
1632
+ return copyShapeData(definition2, value, context);
1376
1633
  case ListControlType:
1377
- return copyListData(definition, value, context);
1634
+ return copyListData(definition2, value, context);
1378
1635
  case StyleControlType:
1379
1636
  return copyStyleData(value, context);
1380
1637
  case SlotControlType:
@@ -1383,6 +1640,18 @@ function copy(definition, value, context) {
1383
1640
  return value;
1384
1641
  }
1385
1642
  }
1643
+ function merge(definition2, a, b = a, context) {
1644
+ switch (definition2.type) {
1645
+ case SlotControlType:
1646
+ return mergeSlotData(a, b, context);
1647
+ default:
1648
+ return b;
1649
+ }
1650
+ }
1651
+ const SelectControlType = "makeswift::controls::select";
1652
+ function Select(config) {
1653
+ return { type: SelectControlType, config };
1654
+ }
1386
1655
  const ObjectType = {
1387
1656
  Value: "value",
1388
1657
  Text: "text",
@@ -1398,6 +1667,712 @@ const ObjectType = {
1398
1667
  Point: "point",
1399
1668
  Operation: "operation"
1400
1669
  };
1670
+ const RootBlockType = {
1671
+ Default: "default",
1672
+ Text: "text-block",
1673
+ Paragraph: "paragraph",
1674
+ Heading1: "heading-one",
1675
+ Heading2: "heading-two",
1676
+ Heading3: "heading-three",
1677
+ Heading4: "heading-four",
1678
+ Heading5: "heading-five",
1679
+ Heading6: "heading-six",
1680
+ BlockQuote: "blockquote",
1681
+ UnorderedList: "unordered-list",
1682
+ OrderedList: "ordered-list"
1683
+ };
1684
+ const BlockType = __spreadProps(__spreadValues({}, RootBlockType), {
1685
+ ListItem: "list-item",
1686
+ ListItemChild: "list-item-child"
1687
+ });
1688
+ const InlineType = {
1689
+ Code: "code",
1690
+ SuperScript: "superscript",
1691
+ SubScript: "subscript",
1692
+ Link: "link"
1693
+ };
1694
+ const BlockTextAlignment = {
1695
+ Left: "left",
1696
+ Center: "center",
1697
+ Right: "right",
1698
+ Justify: "justify"
1699
+ };
1700
+ const ElementUtils = {
1701
+ isRootBlock(node) {
1702
+ return Element.isElement(node) && (Element.isElementType(node, BlockType.Paragraph) || Element.isElementType(node, BlockType.Heading1) || Element.isElementType(node, BlockType.Heading2) || Element.isElementType(node, BlockType.Heading3) || Element.isElementType(node, BlockType.Heading3) || Element.isElementType(node, BlockType.Heading4) || Element.isElementType(node, BlockType.Heading5) || Element.isElementType(node, BlockType.Heading6) || Element.isElementType(node, BlockType.BlockQuote) || Element.isElementType(node, BlockType.UnorderedList) || Element.isElementType(node, BlockType.OrderedList) || Element.isElementType(node, BlockType.Text) || Element.isElementType(node, BlockType.Default));
1703
+ },
1704
+ isBlock(node) {
1705
+ return Element.isElement(node) && (this.isRootBlock(node) || Element.isElementType(node, BlockType.ListItem) || Element.isElementType(node, BlockType.ListItemChild));
1706
+ },
1707
+ isInline(node) {
1708
+ return Element.isElementType(node, InlineType.Code) || Element.isElementType(node, InlineType.Link) || Element.isElementType(node, InlineType.SubScript) || Element.isElementType(node, InlineType.SuperScript);
1709
+ },
1710
+ isConvertibleToListTextNode(node) {
1711
+ return !this.isList(node) && !this.isListItem(node) && !this.isListItemChild(node);
1712
+ },
1713
+ isList(node) {
1714
+ return Element.isElementType(node, BlockType.OrderedList) || Element.isElementType(node, BlockType.UnorderedList);
1715
+ },
1716
+ isListItem(node) {
1717
+ return Element.isElementType(node, BlockType.ListItem);
1718
+ },
1719
+ isListItemChild(node) {
1720
+ return Element.isElementType(node, BlockType.ListItemChild);
1721
+ },
1722
+ createText() {
1723
+ return { text: "" };
1724
+ },
1725
+ createParagraph() {
1726
+ return {
1727
+ children: [this.createText()],
1728
+ type: BlockType.Paragraph
1729
+ };
1730
+ },
1731
+ createList(type = BlockType.UnorderedList) {
1732
+ return { children: [this.createText()], type };
1733
+ },
1734
+ createListItem() {
1735
+ return {
1736
+ children: [this.createListItemChild()],
1737
+ type: BlockType.ListItem
1738
+ };
1739
+ },
1740
+ createListItemChild() {
1741
+ return {
1742
+ children: [this.createText()],
1743
+ type: BlockType.ListItemChild
1744
+ };
1745
+ }
1746
+ };
1747
+ function unhangRange(editor, range) {
1748
+ let [start, end] = Range.edges(range);
1749
+ if (start.offset !== 0 || end.offset !== 0 || Range.isCollapsed(range)) {
1750
+ return range;
1751
+ }
1752
+ const endBlock = Editor.above(editor, {
1753
+ at: end,
1754
+ match: (n) => Element.isElement(n) && Editor.isBlock(editor, n)
1755
+ });
1756
+ const blockPath = endBlock ? endBlock[1] : [];
1757
+ const first = Editor.start(editor, start);
1758
+ const before = { anchor: first, focus: end };
1759
+ let skip = true;
1760
+ for (const [node, path] of Editor.nodes(editor, {
1761
+ at: before,
1762
+ match: Text.isText,
1763
+ reverse: true
1764
+ })) {
1765
+ if (skip) {
1766
+ skip = false;
1767
+ continue;
1768
+ }
1769
+ if (node.text !== "" || Path.isBefore(path, blockPath)) {
1770
+ end = { path, offset: node.text.length };
1771
+ break;
1772
+ }
1773
+ }
1774
+ return { anchor: start, focus: end };
1775
+ }
1776
+ function getSelection(editor) {
1777
+ if (editor.selection)
1778
+ return unhangRange(editor, editor.selection);
1779
+ return {
1780
+ anchor: Editor.start(editor, []),
1781
+ focus: Editor.end(editor, [])
1782
+ };
1783
+ }
1784
+ function getBlocksInSelection(editor) {
1785
+ return Array.from(Editor.nodes(editor, {
1786
+ at: getSelection(editor),
1787
+ match: (node) => ElementUtils.isRootBlock(node)
1788
+ })).filter((entry) => ElementUtils.isRootBlock(entry[0]));
1789
+ }
1790
+ function getActiveBlockType(editor) {
1791
+ var _a;
1792
+ const rootBlocks = getBlocksInSelection(editor).map(([node]) => node.type);
1793
+ return rootBlocks.reduce((a, b) => a === b ? b : null, (_a = rootBlocks.at(0)) != null ? _a : null);
1794
+ }
1795
+ function setBlockKeyForDevice(editor, breakpoints, deviceId, key, value, options) {
1796
+ var _a, _b;
1797
+ const at = (_a = options == null ? void 0 : options.at) != null ? _a : editor.selection;
1798
+ if (!at)
1799
+ return;
1800
+ const rootElements = getBlocksInSelection(editor);
1801
+ for (const [node, path] of rootElements) {
1802
+ if (ElementUtils.isBlock(node)) {
1803
+ const deviceValues = (_b = node[key]) != null ? _b : [];
1804
+ const currentDeviceValue = findBreakpointOverride(breakpoints, deviceValues, deviceId, (v) => v);
1805
+ const nextDeviceValue = __spreadProps(__spreadValues({}, currentDeviceValue), {
1806
+ deviceId,
1807
+ value
1808
+ });
1809
+ Transforms.setNodes(editor, {
1810
+ [key]: [...deviceValues.filter((v) => v.deviceId !== deviceId), nextDeviceValue]
1811
+ }, { at: path });
1812
+ }
1813
+ }
1814
+ }
1815
+ function clearBlockKeyForDevice(editor, deviceId, key) {
1816
+ var _a;
1817
+ const rootElements = getBlocksInSelection(editor);
1818
+ for (const [node, path] of rootElements) {
1819
+ if (ElementUtils.isBlock(node)) {
1820
+ const deviceOverrides = (_a = node[key]) != null ? _a : [];
1821
+ Transforms.setNodes(editor, {
1822
+ [key]: deviceOverrides.filter((v) => v.deviceId !== deviceId)
1823
+ }, { at: path });
1824
+ }
1825
+ }
1826
+ }
1827
+ function wrapInline(editor, inline) {
1828
+ Transforms.wrapNodes(editor, inline, {
1829
+ at: getSelection(editor),
1830
+ split: true
1831
+ });
1832
+ }
1833
+ function unwrapInline(editor, type) {
1834
+ Transforms.unwrapNodes(editor, {
1835
+ match: (node) => ElementUtils.isInline(node) && node.type === type,
1836
+ at: getSelection(editor)
1837
+ });
1838
+ }
1839
+ const EditorUtils = {
1840
+ getFirstAncestorList(editor, path) {
1841
+ try {
1842
+ const parentList = Editor.above(editor, {
1843
+ at: path,
1844
+ match: (node) => ElementUtils.isList(node)
1845
+ });
1846
+ return parentList != null ? parentList : null;
1847
+ } catch (e) {
1848
+ return null;
1849
+ }
1850
+ },
1851
+ getFirstAncestorListItem(editor, path) {
1852
+ try {
1853
+ const parentListItem = Editor.above(editor, {
1854
+ at: path,
1855
+ match: (node) => ElementUtils.isListItem(node)
1856
+ });
1857
+ return parentListItem != null ? parentListItem : null;
1858
+ } catch (e) {
1859
+ return null;
1860
+ }
1861
+ }
1862
+ };
1863
+ const LIST_ITEM_CHILD_POSITION = 0;
1864
+ const LIST_ITEM_LIST_POSITION = 1;
1865
+ function filterForSubtreeRoots(entries) {
1866
+ return entries.filter(([, nodePath]) => !Path.ancestors(nodePath).some((ancestor) => {
1867
+ return entries.some(([, path]) => Path.equals(path, ancestor));
1868
+ }));
1869
+ }
1870
+ function unwrapPath(editor, listItemPath) {
1871
+ const parentList = EditorUtils.getFirstAncestorList(editor, listItemPath);
1872
+ const listItemContainingParentList = EditorUtils.getFirstAncestorListItem(editor, listItemPath);
1873
+ if (!parentList || listItemContainingParentList)
1874
+ return;
1875
+ Editor.withoutNormalizing(editor, () => {
1876
+ const listItemTextPath = [...listItemPath, LIST_ITEM_CHILD_POSITION];
1877
+ const listItemNestedListPath = [...listItemPath, LIST_ITEM_LIST_POSITION];
1878
+ if (Node.has(editor, listItemNestedListPath)) {
1879
+ Transforms.setNodes(editor, { type: parentList[0].type }, { at: listItemNestedListPath });
1880
+ Transforms.liftNodes(editor, { at: listItemNestedListPath });
1881
+ Transforms.liftNodes(editor, { at: Path.next(listItemPath) });
1882
+ }
1883
+ if (Node.has(editor, listItemTextPath)) {
1884
+ Transforms.setNodes(editor, { type: BlockType.Paragraph }, {
1885
+ at: listItemTextPath
1886
+ });
1887
+ Transforms.liftNodes(editor, { at: listItemTextPath });
1888
+ Transforms.liftNodes(editor, { at: listItemPath });
1889
+ }
1890
+ });
1891
+ }
1892
+ function unwrapList(editor, options) {
1893
+ var _a;
1894
+ const at = (_a = options == null ? void 0 : options.at) != null ? _a : editor.selection;
1895
+ if (!at)
1896
+ return;
1897
+ const listItems = Array.from(Editor.nodes(editor, {
1898
+ at,
1899
+ match: (node) => {
1900
+ return Element.isElement(node) && ElementUtils.isListItem(node);
1901
+ }
1902
+ }));
1903
+ const subRoots = filterForSubtreeRoots(listItems);
1904
+ const refs = subRoots.map(([_, path]) => Editor.pathRef(editor, path));
1905
+ refs.forEach((ref) => {
1906
+ if (ref.current) {
1907
+ unwrapPath(editor, ref.current);
1908
+ }
1909
+ ref.unref();
1910
+ });
1911
+ }
1912
+ function wrapList(editor, options = { type: BlockType.UnorderedList }) {
1913
+ var _a;
1914
+ const at = (_a = options.at) != null ? _a : editor.selection;
1915
+ if (!at)
1916
+ return;
1917
+ const nonListEntries = Array.from(Editor.nodes(editor, {
1918
+ at,
1919
+ match: (node) => {
1920
+ return Element.isElement(node) && ElementUtils.isConvertibleToListTextNode(node);
1921
+ }
1922
+ }));
1923
+ const refs = nonListEntries.map(([_, path]) => Editor.pathRef(editor, path));
1924
+ refs.forEach((ref) => {
1925
+ const path = ref.current;
1926
+ if (path) {
1927
+ Editor.withoutNormalizing(editor, () => {
1928
+ Transforms.setNodes(editor, { type: BlockType.ListItemChild }, {
1929
+ at: path
1930
+ });
1931
+ Transforms.wrapNodes(editor, ElementUtils.createListItem(), {
1932
+ match: (node) => ElementUtils.isListItemChild(node),
1933
+ at: path
1934
+ });
1935
+ Transforms.wrapNodes(editor, ElementUtils.createList(options.type), {
1936
+ at: path
1937
+ });
1938
+ });
1939
+ }
1940
+ ref.unref();
1941
+ });
1942
+ }
1943
+ const LocationUtils = {
1944
+ getStartPath(location) {
1945
+ if (Range.isRange(location))
1946
+ return Range.start(location).path;
1947
+ if (Point.isPoint(location))
1948
+ return location.path;
1949
+ return location;
1950
+ }
1951
+ };
1952
+ function getSelectedListItems(editor) {
1953
+ var _a, _b;
1954
+ if (!editor.selection)
1955
+ return [];
1956
+ const start = LocationUtils.getStartPath(editor.selection);
1957
+ const listItems = Editor.nodes(editor, {
1958
+ at: editor.selection,
1959
+ match: (node) => ElementUtils.isListItem(node)
1960
+ });
1961
+ const firstAncestorPath = (_b = (_a = EditorUtils.getFirstAncestorListItem(editor, start)) == null ? void 0 : _a[1]) != null ? _b : [];
1962
+ return Array.from(listItems).filter((node) => Path.isDescendant(start, node[1]) ? Path.equals(node[1], firstAncestorPath) : !Path.isAfter(start, node[1]));
1963
+ }
1964
+ function indentPath(editor, path) {
1965
+ const parent = Node.parent(editor, path);
1966
+ if (!path || !Path.hasPrevious(path) || !ElementUtils.isList(parent))
1967
+ return;
1968
+ const previosPath = Path.previous(path);
1969
+ const previousChildListPath = [...previosPath, LIST_ITEM_LIST_POSITION];
1970
+ const previousHasChildList = Node.has(editor, previousChildListPath);
1971
+ Editor.withoutNormalizing(editor, () => {
1972
+ if (!previousHasChildList) {
1973
+ Transforms.insertNodes(editor, ElementUtils.createList(parent.type), {
1974
+ at: previousChildListPath
1975
+ });
1976
+ }
1977
+ const previousChildList = Node.get(editor, previousChildListPath);
1978
+ if (ElementUtils.isList(previousChildList)) {
1979
+ const index = previousHasChildList ? previousChildList.children.length : 0;
1980
+ Transforms.moveNodes(editor, {
1981
+ at: path,
1982
+ to: [...previousChildListPath, index]
1983
+ });
1984
+ }
1985
+ });
1986
+ }
1987
+ function indent(editor) {
1988
+ if (!editor.selection)
1989
+ return;
1990
+ const listItems = getSelectedListItems(editor);
1991
+ const subRoots = filterForSubtreeRoots(listItems);
1992
+ const refs = subRoots.map(([_, path]) => Editor.pathRef(editor, path));
1993
+ refs.forEach((ref) => {
1994
+ if (ref.current) {
1995
+ indentPath(editor, ref.current);
1996
+ }
1997
+ ref.unref();
1998
+ });
1999
+ }
2000
+ function dedentPath(editor, listItemPath) {
2001
+ const parentList = EditorUtils.getFirstAncestorList(editor, listItemPath);
2002
+ const listItemContainingParentList = EditorUtils.getFirstAncestorListItem(editor, listItemPath);
2003
+ if (!parentList || !listItemContainingParentList)
2004
+ return;
2005
+ const [parentListNode, parentListPath] = parentList;
2006
+ const [_, listItemContainingParentListPath] = listItemContainingParentList;
2007
+ const listItemPosition = listItemPath[listItemPath.length - 1];
2008
+ const previousSiblings = parentListNode.children.slice(0, listItemPosition);
2009
+ const nextSiblings = parentListNode.children.slice(listItemPosition + 1);
2010
+ Editor.withoutNormalizing(editor, () => {
2011
+ nextSiblings.forEach(() => {
2012
+ const nextSiblingPath = [...parentListPath, listItemPosition + 1];
2013
+ indentPath(editor, nextSiblingPath);
2014
+ });
2015
+ Transforms.moveNodes(editor, {
2016
+ at: listItemPath,
2017
+ to: Path.next(listItemContainingParentListPath)
2018
+ });
2019
+ if (previousSiblings.length === 0) {
2020
+ Transforms.removeNodes(editor, { at: parentListPath });
2021
+ }
2022
+ });
2023
+ }
2024
+ function dedent(editor) {
2025
+ if (!editor.selection)
2026
+ return;
2027
+ const listItems = getSelectedListItems(editor);
2028
+ const subRoots = filterForSubtreeRoots(listItems);
2029
+ const refs = subRoots.map(([_, path]) => Editor.pathRef(editor, path));
2030
+ refs.forEach((ref) => {
2031
+ if (ref.current) {
2032
+ dedentPath(editor, ref.current);
2033
+ }
2034
+ ref.unref();
2035
+ });
2036
+ }
2037
+ function toggleList(editor, options = { type: BlockType.UnorderedList }) {
2038
+ var _a;
2039
+ const at = (_a = options.at) != null ? _a : editor.selection;
2040
+ if (at == null)
2041
+ return;
2042
+ const start = LocationUtils.getStartPath(at);
2043
+ const ancestorPath = Path.ancestors(start).at(1);
2044
+ if (!ancestorPath || !Node.has(editor, ancestorPath))
2045
+ return;
2046
+ const ancestor = Node.get(editor, ancestorPath);
2047
+ if (!ElementUtils.isList(ancestor)) {
2048
+ return wrapList(editor, { type: options.type, at });
2049
+ }
2050
+ if (ancestor.type === options.type) {
2051
+ unwrapList(editor, { at });
2052
+ } else {
2053
+ Transforms.setNodes(editor, { type: options.type }, { at: ancestorPath });
2054
+ }
2055
+ }
2056
+ const BlockActions = {
2057
+ setBlockKeyForDevice,
2058
+ clearBlockKeyForDevice,
2059
+ wrapInline,
2060
+ unwrapInline
2061
+ };
2062
+ const ListActions = {
2063
+ unwrapList,
2064
+ wrapList,
2065
+ indent,
2066
+ dedent,
2067
+ toggleList
2068
+ };
2069
+ function onKeyDown(e, editor) {
2070
+ if (!editor.selection || Array.from(Editor.nodes(editor, { match: (node) => ElementUtils.isListItem(node) })).length === 0)
2071
+ return;
2072
+ if (isHotkey("shift+tab", e)) {
2073
+ e.preventDefault();
2074
+ ListActions.dedent(editor);
2075
+ }
2076
+ if (isHotkey("tab", e)) {
2077
+ e.preventDefault();
2078
+ ListActions.indent(editor);
2079
+ }
2080
+ if (isHotkey("backspace", e)) {
2081
+ if (!editor.selection)
2082
+ return;
2083
+ if (Range.isExpanded(editor.selection))
2084
+ return;
2085
+ const listItem = EditorUtils.getFirstAncestorListItem(editor, editor.selection.anchor.path);
2086
+ if (editor.selection.anchor.offset === 0 && listItem) {
2087
+ e.preventDefault();
2088
+ const parentListItem = EditorUtils.getFirstAncestorListItem(editor, listItem[1]);
2089
+ const list = EditorUtils.getFirstAncestorList(editor, listItem[1]);
2090
+ if (parentListItem) {
2091
+ ListActions.dedent(editor);
2092
+ } else if (list) {
2093
+ ListActions.unwrapList(editor);
2094
+ }
2095
+ return;
2096
+ }
2097
+ }
2098
+ if (isHotkey("enter", e)) {
2099
+ e.preventDefault();
2100
+ if (!editor.selection)
2101
+ return;
2102
+ if (Range.isExpanded(editor.selection)) {
2103
+ Transforms.delete(editor);
2104
+ return;
2105
+ }
2106
+ const listItem = EditorUtils.getFirstAncestorListItem(editor, editor.selection.anchor.path);
2107
+ if (editor.selection.anchor.offset === 0 && listItem && Editor.string(editor, listItem[1]) === "") {
2108
+ const parentListItem = EditorUtils.getFirstAncestorListItem(editor, listItem[1]);
2109
+ if (parentListItem) {
2110
+ ListActions.dedent(editor);
2111
+ } else {
2112
+ ListActions.unwrapList(editor);
2113
+ }
2114
+ return;
2115
+ }
2116
+ Transforms.splitNodes(editor, {
2117
+ at: editor.selection,
2118
+ always: true,
2119
+ match: (node) => ElementUtils.isListItem(node)
2120
+ });
2121
+ }
2122
+ if (isHotkey("shift+enter", e)) {
2123
+ e.preventDefault();
2124
+ editor.insertText("\n");
2125
+ }
2126
+ }
2127
+ function withBlock(editor) {
2128
+ const { normalizeNode } = editor;
2129
+ editor.isInline = (entry) => {
2130
+ return ElementUtils.isInline(entry);
2131
+ };
2132
+ editor.normalizeNode = (entry) => {
2133
+ var _a;
2134
+ const [normalizationNode, normalizationPath] = entry;
2135
+ if (ElementUtils.isBlock(normalizationNode) && ((_a = normalizationNode == null ? void 0 : normalizationNode.textAlign) == null ? void 0 : _a.length) == 0) {
2136
+ Transforms.unsetNodes(editor, "textAlign", { at: normalizationPath });
2137
+ return;
2138
+ }
2139
+ if (ElementUtils.isListItem(normalizationNode)) {
2140
+ const pathToListItemText = [...normalizationPath, LIST_ITEM_CHILD_POSITION];
2141
+ if (Node.has(editor, pathToListItemText)) {
2142
+ const nodeInListItemTextPosition = Node.get(editor, pathToListItemText);
2143
+ if (ElementUtils.isRootBlock(nodeInListItemTextPosition)) {
2144
+ Transforms.setNodes(editor, { type: BlockType.ListItemChild }, {
2145
+ at: pathToListItemText
2146
+ });
2147
+ return;
2148
+ }
2149
+ } else {
2150
+ Transforms.insertNodes(editor, ElementUtils.createListItem(), {
2151
+ at: pathToListItemText
2152
+ });
2153
+ return;
2154
+ }
2155
+ }
2156
+ if (!Text.isText(normalizationNode)) {
2157
+ const mergeableChildren = Array.from(Node.children(editor, normalizationPath)).map((child, index, children) => {
2158
+ const potentialNodeToBeMerged = children.at(index + 1);
2159
+ if (!potentialNodeToBeMerged || !ElementUtils.isList(potentialNodeToBeMerged[0]) || !ElementUtils.isList(child[0]) || potentialNodeToBeMerged[0].type !== child[0].type) {
2160
+ return null;
2161
+ }
2162
+ return [
2163
+ Editor.pathRef(editor, child[1]),
2164
+ Editor.pathRef(editor, potentialNodeToBeMerged[1])
2165
+ ];
2166
+ }).filter((mergeableNodes) => Boolean(mergeableNodes));
2167
+ if (mergeableChildren.length !== 0) {
2168
+ mergeableChildren.reverse().forEach(([nodePathRef, nodeToBeMergedPathRef]) => {
2169
+ const nodePath = nodePathRef.current;
2170
+ const nodeToBeMergedPath = nodeToBeMergedPathRef.current;
2171
+ if (nodePath == null || nodeToBeMergedPath == null)
2172
+ return;
2173
+ const nodeChildren = Array.from(Node.children(editor, nodePath));
2174
+ const childrenToBeMerged = Array.from(Node.children(editor, nodeToBeMergedPath));
2175
+ Editor.withoutNormalizing(editor, () => {
2176
+ childrenToBeMerged.reverse().forEach(([_, childPath]) => {
2177
+ Transforms.moveNodes(editor, {
2178
+ at: childPath,
2179
+ to: [...nodePath, nodeChildren.length]
2180
+ });
2181
+ });
2182
+ Transforms.removeNodes(editor, { at: nodeToBeMergedPath });
2183
+ });
2184
+ nodePathRef.unref();
2185
+ nodeToBeMergedPathRef.unref();
2186
+ });
2187
+ return;
2188
+ }
2189
+ }
2190
+ normalizeNode(entry);
2191
+ };
2192
+ return editor;
2193
+ }
2194
+ const definition = Select({
2195
+ label: "Block",
2196
+ labelOrientation: "horizontal",
2197
+ options: [
2198
+ {
2199
+ value: BlockType.Paragraph,
2200
+ label: "Paragraph"
2201
+ },
2202
+ {
2203
+ value: BlockType.Heading1,
2204
+ label: "Heading 1"
2205
+ },
2206
+ {
2207
+ value: BlockType.Heading2,
2208
+ label: "Heading 2"
2209
+ },
2210
+ {
2211
+ value: BlockType.Heading3,
2212
+ label: "Heading 3"
2213
+ },
2214
+ {
2215
+ value: BlockType.Heading4,
2216
+ label: "Heading 4"
2217
+ },
2218
+ {
2219
+ value: BlockType.Heading5,
2220
+ label: "Heading 5"
2221
+ },
2222
+ {
2223
+ value: BlockType.Heading6,
2224
+ label: "Heading 6"
2225
+ },
2226
+ {
2227
+ value: BlockType.UnorderedList,
2228
+ label: "Bulleted list"
2229
+ },
2230
+ {
2231
+ value: BlockType.OrderedList,
2232
+ label: "Numbered list"
2233
+ },
2234
+ {
2235
+ value: BlockType.BlockQuote,
2236
+ label: "Quote"
2237
+ }
2238
+ ],
2239
+ defaultValue: BlockType.Paragraph
2240
+ });
2241
+ function BlockPlugin() {
2242
+ return createRichTextV2Plugin({
2243
+ withPlugin: withBlock,
2244
+ onKeyDown,
2245
+ control: {
2246
+ definition,
2247
+ onChange: (editor, value) => {
2248
+ const activeBlockType = getActiveBlockType(editor);
2249
+ if (value === BlockType.UnorderedList || value === BlockType.OrderedList) {
2250
+ ListActions.toggleList(editor, {
2251
+ type: value,
2252
+ at: getSelection(editor)
2253
+ });
2254
+ } else if (activeBlockType === value) {
2255
+ Transforms.setNodes(editor, {
2256
+ type: BlockType.Default
2257
+ }, { at: getSelection(editor) });
2258
+ } else {
2259
+ ListActions.unwrapList(editor, {
2260
+ at: getSelection(editor)
2261
+ });
2262
+ Transforms.setNodes(editor, {
2263
+ type: value != null ? value : BlockType.Default
2264
+ }, { at: getSelection(editor) });
2265
+ }
2266
+ },
2267
+ getValue: (editor) => {
2268
+ const activeBlock = getActiveBlockType(editor);
2269
+ if (activeBlock === RootBlockType.Text || activeBlock === RootBlockType.Default)
2270
+ return void 0;
2271
+ return activeBlock;
2272
+ }
2273
+ }
2274
+ });
2275
+ }
2276
+ const RichTextV2ControlType = "makeswift::controls::rich-text-v2";
2277
+ const RichTextV2Mode = {
2278
+ Inline: "makeswift::controls::rich-text-v2::mode::inline",
2279
+ Block: "makeswift::controls::rich-text-v2::mode::block"
2280
+ };
2281
+ function createRichTextV2Plugin({
2282
+ control,
2283
+ withPlugin,
2284
+ onKeyDown: onKeyDown2
2285
+ }) {
2286
+ return { control, withPlugin, onKeyDown: onKeyDown2 };
2287
+ }
2288
+ function unstable_RichTextV2(config = {}) {
2289
+ return { type: RichTextV2ControlType, config };
2290
+ }
2291
+ const RichTextV2ControlMessageType = {
2292
+ RESET_VALUE: "RESET_VALUE",
2293
+ FOCUS: "FOCUS",
2294
+ RUN_PLUGIN_CONTROL_ACTION: "RUN_PLUGIN_CONTROL_ACTION",
2295
+ SET_DEFAULT_VALUE: "SET_DEFAULT_VALUE",
2296
+ SET_PLUGIN_CONTROL_VALUE: "SET_PLUGIN_CONTROL_VALUE",
2297
+ ON_CHANGE: "ON_CHANGE",
2298
+ SELECT: "SELECT",
2299
+ SWITCH_TO_BUILD_MODE: "SWITCH_TO_BUILD_MODE",
2300
+ CHANGE_BOX_MODEL: "CHANGE_BOX_MODEL"
2301
+ };
2302
+ class RichTextV2Control extends PropController {
2303
+ constructor(send, descriptor) {
2304
+ super(send);
2305
+ __publicField(this, "editor", null);
2306
+ __publicField(this, "defaultValue", null);
2307
+ __publicField(this, "descriptor");
2308
+ __publicField(this, "recv", (message) => {
2309
+ var _a, _b, _c;
2310
+ if (!this.editor)
2311
+ return;
2312
+ switch (message.type) {
2313
+ case RichTextV2ControlMessageType.FOCUS: {
2314
+ this.editor.focusAndSelectAll();
2315
+ break;
2316
+ }
2317
+ case RichTextV2ControlMessageType.RESET_VALUE: {
2318
+ if (this.defaultValue) {
2319
+ this.editor.selection = null;
2320
+ this.editor.children = this.defaultValue;
2321
+ this.editor.onChange();
2322
+ }
2323
+ break;
2324
+ }
2325
+ case RichTextV2ControlMessageType.RUN_PLUGIN_CONTROL_ACTION: {
2326
+ (_c = (_b = (_a = this.descriptor.config.plugins) == null ? void 0 : _a.at(message.pluginIndex)) == null ? void 0 : _b.control) == null ? void 0 : _c.onChange(this.editor, message.value);
2327
+ break;
2328
+ }
2329
+ }
2330
+ });
2331
+ this.descriptor = descriptor;
2332
+ this.send = send;
2333
+ }
2334
+ setEditor(editor) {
2335
+ var _a, _b, _c;
2336
+ this.editor = editor;
2337
+ this.send({
2338
+ type: RichTextV2ControlMessageType.SET_PLUGIN_CONTROL_VALUE,
2339
+ value: (_c = (_b = (_a = this.descriptor.config) == null ? void 0 : _a.plugins) == null ? void 0 : _b.map((plugin) => {
2340
+ var _a2;
2341
+ return (_a2 = plugin == null ? void 0 : plugin.control) == null ? void 0 : _a2.getValue(editor);
2342
+ })) != null ? _c : []
2343
+ });
2344
+ }
2345
+ setDefaultValue(defaultValue) {
2346
+ this.defaultValue = defaultValue;
2347
+ this.send({ type: RichTextV2ControlMessageType.SET_DEFAULT_VALUE, value: defaultValue });
2348
+ }
2349
+ select() {
2350
+ this.send({ type: RichTextV2ControlMessageType.SELECT });
2351
+ }
2352
+ switchToBuildMode() {
2353
+ this.send({ type: RichTextV2ControlMessageType.SWITCH_TO_BUILD_MODE });
2354
+ }
2355
+ onChange(value) {
2356
+ var _a, _b, _c;
2357
+ const editor = this.editor;
2358
+ if (editor == null)
2359
+ return;
2360
+ this.send({
2361
+ type: RichTextV2ControlMessageType.ON_CHANGE,
2362
+ value
2363
+ });
2364
+ this.send({
2365
+ type: RichTextV2ControlMessageType.SET_PLUGIN_CONTROL_VALUE,
2366
+ value: (_c = (_b = (_a = this.descriptor.config) == null ? void 0 : _a.plugins) == null ? void 0 : _b.map((plugin) => {
2367
+ var _a2;
2368
+ return (_a2 = plugin == null ? void 0 : plugin.control) == null ? void 0 : _a2.getValue(editor);
2369
+ })) != null ? _c : []
2370
+ });
2371
+ }
2372
+ changeBoxModel(boxModel) {
2373
+ this.send({ type: RichTextV2ControlMessageType.CHANGE_BOX_MODEL, payload: { boxModel } });
2374
+ }
2375
+ }
1401
2376
  function isText(node) {
1402
2377
  if (typeof node === "object" && "text" in node)
1403
2378
  return true;
@@ -1660,72 +2635,6 @@ class RichTextControl extends PropController {
1660
2635
  this.send({ type: RichTextControlMessageType.CHANGE_BOX_MODEL, payload: { boxModel } });
1661
2636
  }
1662
2637
  }
1663
- const RichTextV2ControlType = "makeswift::controls::rich-text-v2";
1664
- const RichTextV2Mode = {
1665
- Inline: "makeswift::controls::rich-text-v2::mode::inline",
1666
- Block: "makeswift::controls::rich-text-v2::mode::block"
1667
- };
1668
- function unstable_RichTextV2(config = {}) {
1669
- return { type: RichTextV2ControlType, config };
1670
- }
1671
- const RichTextV2ControlMessageType = {
1672
- RESET_VALUE: "RESET_VALUE",
1673
- FOCUS: "FOCUS",
1674
- SET_DEFAULT_VALUE: "SET_DEFAULT_VALUE",
1675
- ON_CHANGE: "ON_CHANGE",
1676
- SELECT: "SELECT",
1677
- SWITCH_TO_BUILD_MODE: "SWITCH_TO_BUILD_MODE",
1678
- CHANGE_BOX_MODEL: "CHANGE_BOX_MODEL"
1679
- };
1680
- class RichTextV2Control extends PropController {
1681
- constructor(send, descriptor) {
1682
- super(send);
1683
- __publicField(this, "editor", null);
1684
- __publicField(this, "defaultValue", null);
1685
- __publicField(this, "descriptor");
1686
- __publicField(this, "recv", (message) => {
1687
- if (!this.editor)
1688
- return;
1689
- switch (message.type) {
1690
- case RichTextV2ControlMessageType.FOCUS: {
1691
- this.editor.focusAndSelectAll();
1692
- break;
1693
- }
1694
- case RichTextV2ControlMessageType.RESET_VALUE: {
1695
- if (this.defaultValue) {
1696
- this.editor.selection = null;
1697
- this.editor.children = this.defaultValue;
1698
- this.editor.onChange();
1699
- }
1700
- }
1701
- }
1702
- });
1703
- this.descriptor = descriptor;
1704
- this.send = send;
1705
- }
1706
- setEditor(editor) {
1707
- this.editor = editor;
1708
- }
1709
- setDefaultValue(defaultValue) {
1710
- this.defaultValue = defaultValue;
1711
- this.send({ type: RichTextV2ControlMessageType.SET_DEFAULT_VALUE, value: defaultValue });
1712
- }
1713
- select() {
1714
- this.send({ type: RichTextV2ControlMessageType.SELECT });
1715
- }
1716
- switchToBuildMode() {
1717
- this.send({ type: RichTextV2ControlMessageType.SWITCH_TO_BUILD_MODE });
1718
- }
1719
- onChange(value) {
1720
- this.send({
1721
- type: RichTextV2ControlMessageType.ON_CHANGE,
1722
- value
1723
- });
1724
- }
1725
- changeBoxModel(boxModel) {
1726
- this.send({ type: RichTextV2ControlMessageType.CHANGE_BOX_MODEL, payload: { boxModel } });
1727
- }
1728
- }
1729
2638
  const Types = {
1730
2639
  Backgrounds: "Backgrounds",
1731
2640
  Border: "Border",
@@ -1949,5 +2858,485 @@ var descriptors = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.definePro
1949
2858
  WidthPropControllerFormat,
1950
2859
  Width
1951
2860
  }, Symbol.toStringTag, { value: "Module" }));
1952
- export { BorderRadiusPropControllerFormat as $, NavigationLinks as A, Backgrounds as B, ColorControlType as C, Date as D, ElementID as E, Font as F, GapY as G, SocialLinks as H, ImageControlType as I, RichText as J, StyleControlProperty as K, ListControlType as L, Margin as M, Number as N, ImageControlValueFormat as O, Padding as P, StyleControlType as Q, RichTextPropControllerMessageType as R, ShapeControlType as S, Types as T, RichTextV2ControlType as U, Video as V, Width as W, RichTextControlType as X, LinkControlType as Y, BorderPropControllerFormat as Z, ShadowsPropControllerFormat as _, copy as a, MarginPropControllerFormat as a0, PaddingPropControllerFormat as a1, WidthPropControllerFormat as a2, Color as a3, copyColorData as a4, Image$1 as a5, copyImageData as a6, Link$1 as a7, copyLinkData as a8, List$1 as a9, RichTextV2Control as aA, BuilderEditMode as aB, createPropController as aC, ListControlMessageType as aa, ListControl as ab, copyListData as ac, Shape$1 as ad, ShapeControlMessageType as ae, ShapeControl as af, copyShapeData as ag, Slot as ah, SlotControlMessageType as ai, SlotControl as aj, copySlotData as ak, Style as al, StyleControlMessageType as am, StyleControl as an, copyStyleData as ao, ObjectType as ap, RichText$1 as aq, RichTextControlMessageType as ar, RichTextControl as as, richTextDTOtoSelection as at, richTextDTOtoDAO as au, toSelectionDTO as av, richTextDAOToDTO as aw, RichTextV2Mode as ax, unstable_RichTextV2 as ay, RichTextV2ControlMessageType as az, SlotControlType as b, copyElementReference as c, descriptors as d, TableFormFieldsMessageType as e, ResponsiveIconRadioGroup as f, Border as g, BorderRadius as h, Shadows as i, GapX as j, ResponsiveSelect as k, ResponsiveNumber as l, Checkbox as m, Grid as n, TextInput as o, Link as p, ResponsiveColor as q, reducer as r, TextStyle as s, Images as t, ResponsiveLength as u, TextArea as v, Table as w, TableFormFields as x, Image as y, ResponsiveOpacity as z };
1953
- //# sourceMappingURL=descriptors.es.js.map
2861
+ function isNonNullable(value) {
2862
+ return value != null;
2863
+ }
2864
+ function getElementChildren(descriptor, prop) {
2865
+ if (prop == null)
2866
+ return [];
2867
+ switch (descriptor.type) {
2868
+ case Types.Grid:
2869
+ return prop.elements;
2870
+ case SlotControlType:
2871
+ return prop.elements;
2872
+ case ListControlType:
2873
+ return prop.flatMap(({ value }) => getElementChildren(descriptor.config.type, value));
2874
+ case ShapeControlType: {
2875
+ const shapeControlData = prop;
2876
+ return Object.keys(shapeControlData).flatMap((key) => getElementChildren(descriptor.config.type[key], shapeControlData[key]));
2877
+ }
2878
+ default:
2879
+ return [];
2880
+ }
2881
+ }
2882
+ function getElementId$1(descriptor, prop) {
2883
+ if (prop == null)
2884
+ return null;
2885
+ switch (descriptor.type) {
2886
+ case Types.ElementID:
2887
+ return prop;
2888
+ default:
2889
+ return null;
2890
+ }
2891
+ }
2892
+ function getBackgroundsSwatchIds(value) {
2893
+ var _a;
2894
+ return (_a = value == null ? void 0 : value.flatMap((override) => override.value).flatMap((backgroundItem) => {
2895
+ var _a2;
2896
+ switch (backgroundItem.type) {
2897
+ case "color":
2898
+ return ((_a2 = backgroundItem.payload) == null ? void 0 : _a2.swatchId) == null ? [] : [backgroundItem.payload.swatchId];
2899
+ case "gradient":
2900
+ return backgroundItem.payload.stops.flatMap((stop) => stop.color == null ? [] : stop.color.swatchId);
2901
+ default:
2902
+ return [];
2903
+ }
2904
+ })) != null ? _a : [];
2905
+ }
2906
+ function getBorderSwatchIds(value) {
2907
+ var _a;
2908
+ return (_a = value == null ? void 0 : value.flatMap((override) => override.value).flatMap((borderValue) => {
2909
+ var _a2, _b, _c, _d, _e, _f, _g, _h;
2910
+ return [
2911
+ (_b = (_a2 = borderValue.borderTop) == null ? void 0 : _a2.color) == null ? void 0 : _b.swatchId,
2912
+ (_d = (_c = borderValue.borderRight) == null ? void 0 : _c.color) == null ? void 0 : _d.swatchId,
2913
+ (_f = (_e = borderValue.borderBottom) == null ? void 0 : _e.color) == null ? void 0 : _f.swatchId,
2914
+ (_h = (_g = borderValue.borderLeft) == null ? void 0 : _g.color) == null ? void 0 : _h.swatchId
2915
+ ].filter((swatchId) => swatchId != null);
2916
+ })) != null ? _a : [];
2917
+ }
2918
+ function getBoxShadowsSwatchIds(value) {
2919
+ var _a;
2920
+ return (_a = value == null ? void 0 : value.flatMap((override) => override.value).map((item) => {
2921
+ var _a2;
2922
+ return (_a2 = item.payload.color) == null ? void 0 : _a2.swatchId;
2923
+ }).filter((swatchId) => swatchId != null)) != null ? _a : [];
2924
+ }
2925
+ function getResponsiveColorSwatchIds(value) {
2926
+ var _a;
2927
+ return (_a = value == null ? void 0 : value.map((override) => override.value).map((color) => color.swatchId)) != null ? _a : [];
2928
+ }
2929
+ function getTypographyStyleSwatchIds(style) {
2930
+ var _a;
2931
+ return (_a = style == null ? void 0 : style.map((override) => override.value).flatMap((typographyStyle) => {
2932
+ var _a2;
2933
+ return (_a2 = typographyStyle.color) == null ? void 0 : _a2.swatchId;
2934
+ }).filter(isNonNullable)) != null ? _a : [];
2935
+ }
2936
+ function getElementSwatchIds(descriptor, prop) {
2937
+ var _a;
2938
+ if (prop == null)
2939
+ return [];
2940
+ switch (descriptor.type) {
2941
+ case Types.Backgrounds:
2942
+ return getBackgroundsSwatchIds(prop);
2943
+ case Types.Border:
2944
+ return getBorderSwatchIds(prop);
2945
+ case Types.NavigationLinks: {
2946
+ const value = prop;
2947
+ return (_a = value == null ? void 0 : value.flatMap((item) => {
2948
+ var _a2, _b, _c, _d;
2949
+ switch (item.type) {
2950
+ case "button":
2951
+ case "dropdown":
2952
+ return [
2953
+ ...(_b = (_a2 = item.payload.color) == null ? void 0 : _a2.map((override) => override.value).map((color) => color.swatchId)) != null ? _b : [],
2954
+ ...(_d = (_c = item.payload.textColor) == null ? void 0 : _c.map((override) => override.value).map((color) => color.swatchId)) != null ? _d : []
2955
+ ];
2956
+ }
2957
+ })) != null ? _a : [];
2958
+ }
2959
+ case Types.ResponsiveColor:
2960
+ return getResponsiveColorSwatchIds(prop);
2961
+ case Types.Shadows:
2962
+ return getBoxShadowsSwatchIds(prop);
2963
+ case Types.RichText: {
2964
+ let getNodeSwatchIds = function(node) {
2965
+ var _a2, _b, _c, _d;
2966
+ switch (node.object) {
2967
+ case "document":
2968
+ case "block":
2969
+ case "inline":
2970
+ return (_b = (_a2 = node.nodes) == null ? void 0 : _a2.flatMap(getNodeSwatchIds)) != null ? _b : [];
2971
+ case "text":
2972
+ return (_d = (_c = node.marks) == null ? void 0 : _c.flatMap(getMarkSwatchIds)) != null ? _d : [];
2973
+ default:
2974
+ return [];
2975
+ }
2976
+ }, getMarkSwatchIds = function(mark) {
2977
+ var _a2, _b;
2978
+ return getTypographyStyleSwatchIds((_b = (_a2 = mark.data) == null ? void 0 : _a2.value) == null ? void 0 : _b.style);
2979
+ };
2980
+ const value = prop;
2981
+ if (value == null || value.document == null)
2982
+ return [];
2983
+ return getNodeSwatchIds(value.document);
2984
+ }
2985
+ case ColorControlType: {
2986
+ const value = prop;
2987
+ return (value == null ? void 0 : value.swatchId) == null ? [] : [value.swatchId];
2988
+ }
2989
+ default:
2990
+ return [];
2991
+ }
2992
+ }
2993
+ function getBackgroundsFileIds(value) {
2994
+ var _a;
2995
+ return (_a = value == null ? void 0 : value.flatMap((override) => override.value).flatMap((backgroundItem) => {
2996
+ switch (backgroundItem.type) {
2997
+ case "image":
2998
+ return [backgroundItem.payload.imageId];
2999
+ default:
3000
+ return [];
3001
+ }
3002
+ })) != null ? _a : [];
3003
+ }
3004
+ function getFileIds(descriptor, prop) {
3005
+ var _a;
3006
+ if (prop == null)
3007
+ return [];
3008
+ switch (descriptor.type) {
3009
+ case Types.Backgrounds:
3010
+ return getBackgroundsFileIds(prop);
3011
+ case Types.Image: {
3012
+ const value = prop;
3013
+ return value == null ? [] : [value];
3014
+ }
3015
+ case Types.Images: {
3016
+ const value = prop;
3017
+ return (_a = value == null ? void 0 : value.flatMap((item) => item.props.file == null ? [] : [item.props.file])) != null ? _a : [];
3018
+ }
3019
+ case ImageControlType: {
3020
+ const value = prop;
3021
+ return value == null ? [] : [value];
3022
+ }
3023
+ default:
3024
+ return [];
3025
+ }
3026
+ }
3027
+ function getTypographyIds(descriptor, prop) {
3028
+ if (prop == null)
3029
+ return [];
3030
+ switch (descriptor.type) {
3031
+ case Types.RichText: {
3032
+ let getNodeTypographyIds = function(node) {
3033
+ var _a, _b, _c, _d;
3034
+ switch (node.object) {
3035
+ case "document":
3036
+ case "block":
3037
+ case "inline":
3038
+ return (_b = (_a = node.nodes) == null ? void 0 : _a.flatMap(getNodeTypographyIds)) != null ? _b : [];
3039
+ case "text":
3040
+ return (_d = (_c = node.marks) == null ? void 0 : _c.flatMap(getMarkTypographyIds)) != null ? _d : [];
3041
+ default:
3042
+ return [];
3043
+ }
3044
+ }, getMarkTypographyIds = function(mark) {
3045
+ var _a, _b;
3046
+ return [(_b = (_a = mark.data) == null ? void 0 : _a.value) == null ? void 0 : _b.id].filter((id) => id != null);
3047
+ };
3048
+ const value = prop;
3049
+ if (value == null || value.document == null)
3050
+ return [];
3051
+ return getNodeTypographyIds(value.document);
3052
+ }
3053
+ default:
3054
+ return [];
3055
+ }
3056
+ }
3057
+ function getTableIds(descriptor, prop) {
3058
+ if (prop == null)
3059
+ return [];
3060
+ switch (descriptor.type) {
3061
+ case Types.Table: {
3062
+ const value = prop;
3063
+ return value == null ? [] : [value];
3064
+ }
3065
+ default:
3066
+ return [];
3067
+ }
3068
+ }
3069
+ function getPageIds(descriptor, prop) {
3070
+ var _a;
3071
+ if (prop == null)
3072
+ return [];
3073
+ switch (descriptor.type) {
3074
+ case Types.Link: {
3075
+ const value = prop;
3076
+ if (value == null)
3077
+ return [];
3078
+ switch (value.type) {
3079
+ case "OPEN_PAGE":
3080
+ return value.payload.pageId == null ? [] : [value.payload.pageId];
3081
+ default:
3082
+ return [];
3083
+ }
3084
+ }
3085
+ case Types.NavigationLinks: {
3086
+ const value = prop;
3087
+ if (value == null)
3088
+ return [];
3089
+ return (_a = value == null ? void 0 : value.flatMap((item) => {
3090
+ var _a2, _b;
3091
+ switch (item.type) {
3092
+ case "button": {
3093
+ if (item.payload.link == null)
3094
+ return [];
3095
+ switch (item.payload.link.type) {
3096
+ case "OPEN_PAGE":
3097
+ return item.payload.link.payload.pageId == null ? [] : [item.payload.link.payload.pageId];
3098
+ default:
3099
+ return [];
3100
+ }
3101
+ }
3102
+ case "dropdown": {
3103
+ return (_b = (_a2 = item.payload.links) == null ? void 0 : _a2.flatMap((link) => {
3104
+ if (link.payload.link == null)
3105
+ return [];
3106
+ switch (link.payload.link.type) {
3107
+ case "OPEN_PAGE":
3108
+ return link.payload.link.payload.pageId == null ? [] : [link.payload.link.payload.pageId];
3109
+ default:
3110
+ return [];
3111
+ }
3112
+ })) != null ? _b : [];
3113
+ }
3114
+ }
3115
+ })) != null ? _a : [];
3116
+ }
3117
+ case Types.RichText: {
3118
+ let getNodePageIds = function(node) {
3119
+ var _a2, _b;
3120
+ switch (node.object) {
3121
+ case "document":
3122
+ case "block":
3123
+ return (_b = (_a2 = node.nodes) == null ? void 0 : _a2.flatMap(getNodePageIds)) != null ? _b : [];
3124
+ case "inline":
3125
+ return getInlinePageIds(node);
3126
+ default:
3127
+ return [];
3128
+ }
3129
+ }, getInlinePageIds = function(inline) {
3130
+ var _a2, _b, _c, _d;
3131
+ switch (inline.type) {
3132
+ case "link": {
3133
+ const nodePageIds = (_b = (_a2 = inline.nodes) == null ? void 0 : _a2.flatMap(getNodePageIds)) != null ? _b : [];
3134
+ const dataPageIds = inline.data ? getLinkDataPageIds(inline.data) : [];
3135
+ return [...nodePageIds, ...dataPageIds];
3136
+ }
3137
+ default:
3138
+ return (_d = (_c = inline.nodes) == null ? void 0 : _c.flatMap(getNodePageIds)) != null ? _d : [];
3139
+ }
3140
+ }, getLinkDataPageIds = function(link) {
3141
+ switch (link.type) {
3142
+ case "OPEN_PAGE":
3143
+ return link.payload.pageId == null ? [] : [link.payload.pageId];
3144
+ default:
3145
+ return [];
3146
+ }
3147
+ };
3148
+ const value = prop;
3149
+ if (value == null || value.document == null)
3150
+ return [];
3151
+ return getNodePageIds(value.document);
3152
+ }
3153
+ default:
3154
+ return [];
3155
+ }
3156
+ }
3157
+ var introspection = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3158
+ __proto__: null,
3159
+ getElementChildren,
3160
+ getElementId: getElementId$1,
3161
+ getBackgroundsSwatchIds,
3162
+ getBorderSwatchIds,
3163
+ getBoxShadowsSwatchIds,
3164
+ getResponsiveColorSwatchIds,
3165
+ getTypographyStyleSwatchIds,
3166
+ getElementSwatchIds,
3167
+ getBackgroundsFileIds,
3168
+ getFileIds,
3169
+ getTypographyIds,
3170
+ getTableIds,
3171
+ getPageIds
3172
+ }, Symbol.toStringTag, { value: "Module" }));
3173
+ const reducer = combineReducers({
3174
+ documents: reducer$8,
3175
+ reactComponents: reducer$7,
3176
+ componentsMeta: reducer$9,
3177
+ propControllers: reducer$6,
3178
+ propControllerHandles: reducer$5,
3179
+ isInBuilder: reducer$4,
3180
+ isPreview: reducer$3,
3181
+ builderEditMode: reducer$2,
3182
+ breakpoints: reducer$a,
3183
+ locales: reducer$1
3184
+ });
3185
+ function getDocumentsStateSlice(state) {
3186
+ return state.documents;
3187
+ }
3188
+ function getDocument(state, documentKey) {
3189
+ return getDocument$1(getDocumentsStateSlice(state), documentKey);
3190
+ }
3191
+ function getReactComponentsStateSlice(state) {
3192
+ return state.reactComponents;
3193
+ }
3194
+ function getReactComponent(state, type) {
3195
+ return getReactComponent$1(getReactComponentsStateSlice(state), type);
3196
+ }
3197
+ function getPropControllersStateSlice(state) {
3198
+ return state.propControllers;
3199
+ }
3200
+ function getPropControllerDescriptors(state) {
3201
+ return getPropControllerDescriptors$1(getPropControllersStateSlice(state));
3202
+ }
3203
+ function getComponentPropControllerDescriptors(state, componentType) {
3204
+ return getComponentPropControllerDescriptors$1(getPropControllersStateSlice(state), componentType);
3205
+ }
3206
+ function getPropControllerHandlesStateSlice(state) {
3207
+ return state.propControllerHandles;
3208
+ }
3209
+ function getPropControllers(state, documentKey, elementKey) {
3210
+ return getPropControllers$1(getPropControllerHandlesStateSlice(state), documentKey, elementKey);
3211
+ }
3212
+ function normalizeElement(element, descriptors2) {
3213
+ const elements = /* @__PURE__ */ new Map();
3214
+ const remaining = [element];
3215
+ let current;
3216
+ while (current = remaining.pop()) {
3217
+ elements.set(current.key, current);
3218
+ if (isElementReference(current))
3219
+ continue;
3220
+ const elementDescriptors = descriptors2.get(current.type);
3221
+ if (elementDescriptors == null)
3222
+ continue;
3223
+ const parent = current;
3224
+ const children = Object.entries(elementDescriptors).reduce((acc, [propName, descriptor]) => {
3225
+ return [...acc, ...getElementChildren(descriptor, parent.props[propName])];
3226
+ }, []);
3227
+ remaining.push(...children);
3228
+ }
3229
+ return elements;
3230
+ }
3231
+ function getDocumentElements(state, documentKey) {
3232
+ const document = getDocument(state, documentKey);
3233
+ const descriptors2 = getPropControllerDescriptors(state);
3234
+ if (document == null)
3235
+ return /* @__PURE__ */ new Map();
3236
+ return normalizeElement(document.rootElement, descriptors2);
3237
+ }
3238
+ function getDocumentKeysSortedByDepth(state) {
3239
+ const documents = getDocuments(getDocumentsStateSlice(state));
3240
+ const keys = Array.from(documents.keys());
3241
+ if (keys.length < 2)
3242
+ return keys;
3243
+ const elements = /* @__PURE__ */ new Map();
3244
+ keys.forEach((key) => {
3245
+ elements.set(key, getDocumentElements(state, key));
3246
+ });
3247
+ keys.sort((a, b) => {
3248
+ var _a;
3249
+ return ((_a = elements.get(a)) == null ? void 0 : _a.has(b)) ? -1 : 1;
3250
+ });
3251
+ return keys;
3252
+ }
3253
+ function getElement(state, documentKey, elementKey) {
3254
+ var _a;
3255
+ return (_a = getDocumentElements(state, documentKey).get(elementKey)) != null ? _a : null;
3256
+ }
3257
+ function getElementPropControllerDescriptors(state, documentKey, elementKey) {
3258
+ const element = getElement(state, documentKey, elementKey);
3259
+ if (element == null || isElementReference(element))
3260
+ return null;
3261
+ return getComponentPropControllerDescriptors(state, element.type);
3262
+ }
3263
+ function getElementId(state, documentKey, elementKey) {
3264
+ const element = getElement(state, documentKey, elementKey);
3265
+ if (element == null || isElementReference(element))
3266
+ return null;
3267
+ const descriptors2 = getComponentPropControllerDescriptors(state, element.type);
3268
+ if (descriptors2 == null)
3269
+ return null;
3270
+ const elementId = Object.entries(descriptors2).reduce((acc, [propName, descriptor]) => {
3271
+ if (acc != null)
3272
+ return acc;
3273
+ return getElementId$1(descriptor, element.props[propName]);
3274
+ }, null);
3275
+ return elementId;
3276
+ }
3277
+ function createReplacementContext(serializableReplacementContext) {
3278
+ const rc = {
3279
+ elementHtmlIds: new Set(serializableReplacementContext.elementHtmlIds),
3280
+ elementKeys: new Map(serializableReplacementContext.elementKeys && Object.entries(serializableReplacementContext.elementKeys)),
3281
+ swatchIds: new Map(serializableReplacementContext.swatchIds && Object.entries(serializableReplacementContext.swatchIds)),
3282
+ fileIds: new Map(serializableReplacementContext.fileIds && Object.entries(serializableReplacementContext.fileIds)),
3283
+ typographyIds: new Map(serializableReplacementContext.typographyIds && Object.entries(serializableReplacementContext.typographyIds)),
3284
+ tableIds: new Map(serializableReplacementContext.tableIds && Object.entries(serializableReplacementContext.tableIds)),
3285
+ tableColumnIds: new Map(serializableReplacementContext.tableColumnIds && Object.entries(serializableReplacementContext.tableColumnIds)),
3286
+ pageIds: new Map(serializableReplacementContext.pageIds && Object.entries(serializableReplacementContext.pageIds)),
3287
+ globalElementIds: new Map(serializableReplacementContext.globalElementIds && Object.entries(serializableReplacementContext.globalElementIds)),
3288
+ globalElementData: new Map(serializableReplacementContext.globalElementData && Object.entries(serializableReplacementContext.globalElementData))
3289
+ };
3290
+ return rc;
3291
+ }
3292
+ function copyElementTree(state, elementTree, replacementContext) {
3293
+ function copyElementTreeNode(state2, replacementContext2) {
3294
+ return function(node) {
3295
+ const context = {
3296
+ replacementContext: replacementContext2,
3297
+ copyElement: copyElementTreeNode(state2, replacementContext2)
3298
+ };
3299
+ if (isElementReference(node)) {
3300
+ return __spreadProps(__spreadValues({}, node), { value: copyElementReference(node.value, context) });
3301
+ }
3302
+ const descriptors2 = getComponentPropControllerDescriptors(state2, node.type);
3303
+ if (descriptors2 == null)
3304
+ return node;
3305
+ for (const [propKey, descriptor] of Object.entries(descriptors2)) {
3306
+ node.props[propKey] = copy(descriptor, node.props[propKey], context);
3307
+ }
3308
+ return node;
3309
+ };
3310
+ }
3311
+ const copy$12 = JSON.parse(JSON.stringify(elementTree));
3312
+ return copyElementTreeNode(state, createReplacementContext(replacementContext))(copy$12);
3313
+ }
3314
+ function getIsInBuilder(state) {
3315
+ return state.isInBuilder;
3316
+ }
3317
+ function getIsPreview(state) {
3318
+ return getIsPreview$1(state.isPreview);
3319
+ }
3320
+ function getBuilderEditMode(state) {
3321
+ return state.builderEditMode;
3322
+ }
3323
+ function getBreakpoints(state) {
3324
+ return state.breakpoints;
3325
+ }
3326
+ function getLocales(state) {
3327
+ return state.locales;
3328
+ }
3329
+ function configureStore({
3330
+ rootElements,
3331
+ preloadedState,
3332
+ breakpoints,
3333
+ locales
3334
+ } = {}) {
3335
+ return createStore(reducer, __spreadProps(__spreadValues({}, preloadedState), {
3336
+ documents: getInitialState$7({ rootElements }),
3337
+ breakpoints: getInitialState$9(breakpoints != null ? breakpoints : preloadedState == null ? void 0 : preloadedState.breakpoints),
3338
+ locales: getInitialState(locales != null ? locales : preloadedState == null ? void 0 : preloadedState.locales)
3339
+ }), applyMiddleware(thunk));
3340
+ }
3341
+ export { getBoxShadowsSwatchIds as $, ResponsiveLength as A, Backgrounds as B, ComponentIcon as C, Date as D, ElementID as E, Font as F, GapY as G, TextArea as H, Images as I, Table as J, TableFormFields as K, ListControlType as L, Margin as M, Number as N, Image as O, Padding as P, ResponsiveOpacity as Q, RichTextPropControllerMessageType as R, ShapeControlType as S, TableFormFieldsMessageType as T, NavigationLinks as U, SocialLinks as V, Width as W, RichText as X, Video as Y, getBorderSwatchIds as Z, isNonNullable as _, createDocumentReference as a, toSelectionDTO as a$, getResponsiveColorSwatchIds as a0, StyleControlProperty as a1, ImageControlValueFormat as a2, isPropControllersHandle as a3, StyleControlType as a4, RichTextV2ControlType as a5, RichTextControlType as a6, SlotControlType as a7, LinkControlType as a8, ImageControlType as a9, copyImageData as aA, Link$1 as aB, copyLinkData as aC, List$1 as aD, ListControlMessageType as aE, ListControl as aF, copyListData as aG, Select as aH, Shape$1 as aI, ShapeControlMessageType as aJ, ShapeControl as aK, copyShapeData as aL, Slot as aM, SlotControlMessageType as aN, SlotControl as aO, copySlotData as aP, mergeSlotData as aQ, Style as aR, StyleControlMessageType as aS, StyleControl as aT, copyStyleData as aU, ObjectType as aV, RichText$1 as aW, RichTextControlMessageType as aX, RichTextControl as aY, richTextDTOtoSelection as aZ, richTextDTOtoDAO as a_, ColorControlType as aa, SelectControlType as ab, getComponentPropControllerDescriptors as ac, getPropControllers as ad, BorderPropControllerFormat as ae, ShadowsPropControllerFormat as af, BorderRadiusPropControllerFormat as ag, MarginPropControllerFormat as ah, PaddingPropControllerFormat as ai, WidthPropControllerFormat as aj, configureStore as ak, copyElementTree as al, getBreakpoints as am, getDocument as an, getElementId as ao, getIsPreview as ap, getIsInBuilder as aq, getReactComponent as ar, getBuilderEditMode as as, getBackgroundsFileIds as at, getBackgroundsSwatchIds as au, Color as av, copyColorData as aw, copy as ax, merge as ay, Image$1 as az, isElementReference as b, richTextDAOToDTO as b0, RichTextV2Mode as b1, createRichTextV2Plugin as b2, unstable_RichTextV2 as b3, RichTextV2ControlMessageType as b4, RichTextV2Control as b5, BlockActions as b6, ListActions as b7, onKeyDown as b8, withBlock as b9, reducer$1 as bA, getInitialState$2 as bB, BlockPlugin as ba, RootBlockType as bb, BlockType as bc, InlineType as bd, BlockTextAlignment as be, ElementUtils as bf, getInitialState$7 as bg, reducer$8 as bh, getDocument$1 as bi, getComponentsMeta as bj, getComponentPropControllerDescriptors$1 as bk, getLocales as bl, BuilderEditMode as bm, getDocumentKeysSortedByDepth as bn, getPropController as bo, getPropControllersHandle as bp, getElement as bq, getElementPropControllerDescriptors as br, createPropController as bs, reducer$7 as bt, reducer$9 as bu, reducer$6 as bv, reducer$5 as bw, reducer$4 as bx, reducer$3 as by, reducer$2 as bz, createDocument as c, descriptors as d, getElementSwatchIds as e, getFileIds as f, getPropControllerDescriptors as g, getTypographyIds as h, introspection as i, getTableIds as j, getPageIds as k, getElementChildren as l, Types as m, ResponsiveIconRadioGroup as n, Border as o, BorderRadius as p, Shadows as q, GapX as r, ResponsiveSelect as s, ResponsiveNumber as t, Checkbox as u, Grid as v, TextInput as w, Link as x, ResponsiveColor as y, TextStyle as z };
3342
+ //# sourceMappingURL=react-page.es.js.map