@makeswift/runtime 0.0.0-1faafb3 → 0.0.0-20221019211549

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 (619) hide show
  1. package/api.js +1 -0
  2. package/box-model.js +1 -0
  3. package/builder.js +1 -0
  4. package/components.js +1 -0
  5. package/controls.js +1 -0
  6. package/dist/Box.cjs.js +507 -0
  7. package/dist/Box.cjs.js.map +1 -0
  8. package/dist/Box.es.js +501 -0
  9. package/dist/Box.es.js.map +1 -0
  10. package/dist/Button.cjs.js +315 -0
  11. package/dist/Button.cjs.js.map +1 -0
  12. package/dist/Button.es.js +308 -0
  13. package/dist/Button.es.js.map +1 -0
  14. package/dist/Carousel.cjs.js +493 -0
  15. package/dist/Carousel.cjs.js.map +1 -0
  16. package/dist/Carousel.es.js +487 -0
  17. package/dist/Carousel.es.js.map +1 -0
  18. package/dist/Countdown.cjs.js +347 -0
  19. package/dist/Countdown.cjs.js.map +1 -0
  20. package/dist/Countdown.es.js +341 -0
  21. package/dist/Countdown.es.js.map +1 -0
  22. package/dist/Divider.cjs.js +122 -0
  23. package/dist/Divider.cjs.js.map +1 -0
  24. package/dist/Divider.es.js +116 -0
  25. package/dist/Divider.es.js.map +1 -0
  26. package/dist/Embed.cjs.js +136 -0
  27. package/dist/Embed.cjs.js.map +1 -0
  28. package/dist/Embed.es.js +130 -0
  29. package/dist/Embed.es.js.map +1 -0
  30. package/dist/Form.cjs.js +1731 -0
  31. package/dist/Form.cjs.js.map +1 -0
  32. package/dist/Form.es.js +1704 -0
  33. package/dist/Form.es.js.map +1 -0
  34. package/dist/Image.cjs2.js +155 -0
  35. package/dist/Image.cjs2.js.map +1 -0
  36. package/dist/Image.es2.js +148 -0
  37. package/dist/Image.es2.js.map +1 -0
  38. package/dist/Navigation.cjs.js +742 -0
  39. package/dist/Navigation.cjs.js.map +1 -0
  40. package/dist/Navigation.es.js +716 -0
  41. package/dist/Navigation.es.js.map +1 -0
  42. package/dist/Root.cjs.js +149 -0
  43. package/dist/Root.cjs.js.map +1 -0
  44. package/dist/Root.es.js +143 -0
  45. package/dist/Root.es.js.map +1 -0
  46. package/dist/SocialLinks.cjs.js +906 -0
  47. package/dist/SocialLinks.cjs.js.map +1 -0
  48. package/dist/SocialLinks.es.js +880 -0
  49. package/dist/SocialLinks.es.js.map +1 -0
  50. package/dist/Text.cjs.js +482 -0
  51. package/dist/Text.cjs.js.map +1 -0
  52. package/dist/Text.es.js +474 -0
  53. package/dist/Text.es.js.map +1 -0
  54. package/dist/Video.cjs.js +128 -0
  55. package/dist/Video.cjs.js.map +1 -0
  56. package/dist/Video.es.js +121 -0
  57. package/dist/Video.es.js.map +1 -0
  58. package/dist/actions.cjs.js +140 -17
  59. package/dist/actions.cjs.js.map +1 -1
  60. package/dist/actions.es.js +122 -16
  61. package/dist/actions.es.js.map +1 -1
  62. package/dist/api.cjs.js +6 -0
  63. package/dist/api.cjs.js.map +1 -0
  64. package/dist/api.es.js +3 -0
  65. package/dist/api.es.js.map +1 -0
  66. package/dist/box-model.cjs.js +2 -2
  67. package/dist/box-model.es.js +1 -0
  68. package/dist/box-model.es.js.map +1 -1
  69. package/dist/box-models.cjs.js +28 -156
  70. package/dist/box-models.cjs.js.map +1 -1
  71. package/dist/box-models.es.js +31 -159
  72. package/dist/box-models.es.js.map +1 -1
  73. package/dist/builder.cjs.js +13 -0
  74. package/dist/builder.cjs.js.map +1 -0
  75. package/dist/builder.es.js +4 -0
  76. package/dist/builder.es.js.map +1 -0
  77. package/dist/color.cjs.js +8 -0
  78. package/dist/color.cjs.js.map +1 -0
  79. package/dist/color.es.js +6 -0
  80. package/dist/color.es.js.map +1 -0
  81. package/dist/components.cjs.js +107 -6901
  82. package/dist/components.cjs.js.map +1 -1
  83. package/dist/components.es.js +66 -6866
  84. package/dist/components.es.js.map +1 -1
  85. package/dist/constants.cjs.js +15 -0
  86. package/dist/constants.cjs.js.map +1 -0
  87. package/dist/constants.es.js +14 -0
  88. package/dist/constants.es.js.map +1 -0
  89. package/dist/control-serialization.cjs.js +485 -0
  90. package/dist/control-serialization.cjs.js.map +1 -0
  91. package/dist/control-serialization.es.js +478 -0
  92. package/dist/control-serialization.es.js.map +1 -0
  93. package/dist/controls.cjs.js +38 -0
  94. package/dist/controls.cjs.js.map +1 -0
  95. package/dist/controls.es.js +6 -0
  96. package/dist/controls.es.js.map +1 -0
  97. package/dist/cssMediaRules.cjs.js +210 -0
  98. package/dist/cssMediaRules.cjs.js.map +1 -0
  99. package/dist/cssMediaRules.es.js +201 -0
  100. package/dist/cssMediaRules.es.js.map +1 -0
  101. package/dist/graphql.cjs.js +365 -0
  102. package/dist/graphql.cjs.js.map +1 -0
  103. package/dist/graphql.es.js +356 -0
  104. package/dist/graphql.es.js.map +1 -0
  105. package/dist/image.cjs.js +282 -0
  106. package/dist/image.cjs.js.map +1 -0
  107. package/dist/image.es.js +240 -0
  108. package/dist/image.es.js.map +1 -0
  109. package/dist/index.cjs.js +3211 -0
  110. package/dist/index.cjs.js.map +1 -0
  111. package/dist/index.cjs2.js +522 -0
  112. package/dist/index.cjs2.js.map +1 -0
  113. package/dist/index.cjs3.js +146 -0
  114. package/dist/index.cjs3.js.map +1 -0
  115. package/dist/index.cjs4.js +18 -0
  116. package/dist/index.cjs4.js.map +1 -0
  117. package/dist/index.es.js +3104 -0
  118. package/dist/index.es.js.map +1 -0
  119. package/dist/index.es2.js +514 -0
  120. package/dist/index.es2.js.map +1 -0
  121. package/dist/index.es3.js +140 -0
  122. package/dist/index.es3.js.map +1 -0
  123. package/dist/index.es4.js +13 -0
  124. package/dist/index.es4.js.map +1 -0
  125. package/dist/main.cjs.js +16 -2
  126. package/dist/main.cjs.js.map +1 -1
  127. package/dist/main.es.js +7 -1
  128. package/dist/main.es.js.map +1 -1
  129. package/dist/next.cjs.js +432 -0
  130. package/dist/next.cjs.js.map +1 -0
  131. package/dist/next.es.js +416 -0
  132. package/dist/next.es.js.map +1 -0
  133. package/dist/placeholders.cjs.js +13 -0
  134. package/dist/placeholders.cjs.js.map +1 -0
  135. package/dist/placeholders.es.js +12 -0
  136. package/dist/placeholders.es.js.map +1 -0
  137. package/dist/prop-controllers.cjs.js +6 -175
  138. package/dist/prop-controllers.cjs.js.map +1 -1
  139. package/dist/prop-controllers.es.js +2 -173
  140. package/dist/prop-controllers.es.js.map +1 -1
  141. package/dist/react-builder-preview.cjs.js +257 -4138
  142. package/dist/react-builder-preview.cjs.js.map +1 -1
  143. package/dist/react-builder-preview.es.js +249 -4134
  144. package/dist/react-builder-preview.es.js.map +1 -1
  145. package/dist/react-page.cjs.js +602 -0
  146. package/dist/react-page.cjs.js.map +1 -0
  147. package/dist/react-page.es.js +566 -0
  148. package/dist/react-page.es.js.map +1 -0
  149. package/dist/react.cjs.js +41 -7
  150. package/dist/react.cjs.js.map +1 -1
  151. package/dist/react.es.js +33 -1
  152. package/dist/react.es.js.map +1 -1
  153. package/dist/shape.cjs.js +20 -0
  154. package/dist/shape.cjs.js.map +1 -0
  155. package/dist/shape.es.js +14 -0
  156. package/dist/shape.es.js.map +1 -0
  157. package/dist/slot.cjs.js +130 -0
  158. package/dist/slot.cjs.js.map +1 -0
  159. package/dist/slot.es.js +123 -0
  160. package/dist/slot.es.js.map +1 -0
  161. package/dist/text-input.cjs.js +38 -0
  162. package/dist/text-input.cjs.js.map +1 -0
  163. package/dist/text-input.es.js +26 -0
  164. package/dist/text-input.es.js.map +1 -0
  165. package/dist/types/src/api/constants.d.ts +4 -0
  166. package/dist/types/src/api/constants.d.ts.map +1 -0
  167. package/dist/types/src/api/generated/graphql.d.ts +175 -0
  168. package/dist/types/src/api/generated/graphql.d.ts.map +1 -0
  169. package/dist/types/src/api/index.d.ts +3 -0
  170. package/dist/types/src/api/index.d.ts.map +1 -0
  171. package/dist/types/src/api/introspection.d.ts +10 -0
  172. package/dist/types/src/api/introspection.d.ts.map +1 -0
  173. package/dist/types/src/api/react.d.ts +27 -0
  174. package/dist/types/src/api/react.d.ts.map +1 -0
  175. package/dist/types/src/api/types.d.ts +4 -0
  176. package/dist/types/src/api/types.d.ts.map +1 -0
  177. package/dist/types/src/box-model.d.ts +3 -0
  178. package/dist/types/src/box-model.d.ts.map +1 -0
  179. package/dist/types/src/builder/index.d.ts +2 -0
  180. package/dist/types/src/builder/index.d.ts.map +1 -0
  181. package/dist/types/src/builder/serialization/control-serialization.d.ts +301 -0
  182. package/dist/types/src/builder/serialization/control-serialization.d.ts.map +1 -0
  183. package/dist/types/src/builder/serialization/controls/combobox.d.ts +5 -0
  184. package/dist/types/src/builder/serialization/controls/combobox.d.ts.map +1 -0
  185. package/dist/types/src/builder/serialization/controls/list.d.ts +5 -0
  186. package/dist/types/src/builder/serialization/controls/list.d.ts.map +1 -0
  187. package/dist/types/src/builder/serialization/controls/shape.d.ts +5 -0
  188. package/dist/types/src/builder/serialization/controls/shape.d.ts.map +1 -0
  189. package/dist/types/src/builder/serialization/controls/types.d.ts +10 -0
  190. package/dist/types/src/builder/serialization/controls/types.d.ts.map +1 -0
  191. package/dist/types/src/builder/serialization/function-serialization.d.ts +12 -0
  192. package/dist/types/src/builder/serialization/function-serialization.d.ts.map +1 -0
  193. package/dist/types/src/builder/serialization/index.d.ts +4 -0
  194. package/dist/types/src/builder/serialization/index.d.ts.map +1 -0
  195. package/dist/types/{components → src/components/builtin}/Box/Box.d.ts +8 -5
  196. package/dist/types/src/components/builtin/Box/Box.d.ts.map +1 -0
  197. package/dist/types/{components → src/components/builtin}/Box/animations.d.ts +3 -10
  198. package/dist/types/src/components/builtin/Box/animations.d.ts.map +1 -0
  199. package/dist/types/{components → src/components/builtin}/Box/components/Placeholder/index.d.ts +0 -0
  200. package/dist/types/src/components/builtin/Box/components/Placeholder/index.d.ts.map +1 -0
  201. package/dist/types/src/components/builtin/Box/constants.d.ts +9 -0
  202. package/dist/types/src/components/builtin/Box/constants.d.ts.map +1 -0
  203. package/dist/types/{components → src/components/builtin}/Box/index.d.ts +1 -1
  204. package/dist/types/src/components/builtin/Box/index.d.ts.map +1 -0
  205. package/dist/types/src/components/builtin/Box/register.d.ts +3 -0
  206. package/dist/types/src/components/builtin/Box/register.d.ts.map +1 -0
  207. package/dist/types/src/components/builtin/Button/Button.d.ts +117 -0
  208. package/dist/types/src/components/builtin/Button/Button.d.ts.map +1 -0
  209. package/dist/types/src/components/builtin/Button/contants.d.ts +2 -0
  210. package/dist/types/src/components/builtin/Button/contants.d.ts.map +1 -0
  211. package/dist/types/src/components/builtin/Button/index.d.ts +2 -0
  212. package/dist/types/src/components/builtin/Button/index.d.ts.map +1 -0
  213. package/dist/types/src/components/builtin/Button/register.d.ts +3 -0
  214. package/dist/types/src/components/builtin/Button/register.d.ts.map +1 -0
  215. package/dist/types/src/components/builtin/Carousel/Carousel.d.ts +26 -0
  216. package/dist/types/src/components/builtin/Carousel/Carousel.d.ts.map +1 -0
  217. package/dist/types/src/components/builtin/Carousel/index.d.ts +2 -0
  218. package/dist/types/src/components/builtin/Carousel/index.d.ts.map +1 -0
  219. package/dist/types/src/components/builtin/Carousel/register.d.ts +3 -0
  220. package/dist/types/src/components/builtin/Carousel/register.d.ts.map +1 -0
  221. package/dist/types/src/components/builtin/Countdown/Countdown.d.ts +25 -0
  222. package/dist/types/src/components/builtin/Countdown/Countdown.d.ts.map +1 -0
  223. package/dist/types/src/components/builtin/Countdown/index.d.ts +2 -0
  224. package/dist/types/src/components/builtin/Countdown/index.d.ts.map +1 -0
  225. package/dist/types/src/components/builtin/Countdown/register.d.ts +3 -0
  226. package/dist/types/src/components/builtin/Countdown/register.d.ts.map +1 -0
  227. package/dist/types/src/components/builtin/Divider/Divider.d.ts +15 -0
  228. package/dist/types/src/components/builtin/Divider/Divider.d.ts.map +1 -0
  229. package/dist/types/src/components/builtin/Divider/index.d.ts +2 -0
  230. package/dist/types/src/components/builtin/Divider/index.d.ts.map +1 -0
  231. package/dist/types/src/components/builtin/Divider/register.d.ts +3 -0
  232. package/dist/types/src/components/builtin/Divider/register.d.ts.map +1 -0
  233. package/dist/types/src/components/builtin/Embed/Embed.d.ts +11 -0
  234. package/dist/types/src/components/builtin/Embed/Embed.d.ts.map +1 -0
  235. package/dist/types/src/components/builtin/Embed/index.d.ts +2 -0
  236. package/dist/types/src/components/builtin/Embed/index.d.ts.map +1 -0
  237. package/dist/types/src/components/builtin/Embed/register.d.ts +3 -0
  238. package/dist/types/src/components/builtin/Embed/register.d.ts.map +1 -0
  239. package/dist/types/src/components/builtin/Form/Form.d.ts +33 -0
  240. package/dist/types/src/components/builtin/Form/Form.d.ts.map +1 -0
  241. package/dist/types/src/components/builtin/Form/components/Field/components/Checkbox/index.d.ts +15 -0
  242. package/dist/types/src/components/builtin/Form/components/Field/components/Checkbox/index.d.ts.map +1 -0
  243. package/dist/types/src/components/builtin/Form/components/Field/components/CheckboxTableField/index.d.ts +15 -0
  244. package/dist/types/src/components/builtin/Form/components/Field/components/CheckboxTableField/index.d.ts.map +1 -0
  245. package/dist/types/src/components/builtin/Form/components/Field/components/EmailTableField/index.d.ts +11 -0
  246. package/dist/types/src/components/builtin/Form/components/Field/components/EmailTableField/index.d.ts.map +1 -0
  247. package/dist/types/src/components/builtin/Form/components/Field/components/Input/index.d.ts +14 -0
  248. package/dist/types/src/components/builtin/Form/components/Field/components/Input/index.d.ts.map +1 -0
  249. package/dist/types/src/components/builtin/Form/components/Field/components/Label/index.d.ts +16 -0
  250. package/dist/types/src/components/builtin/Form/components/Field/components/Label/index.d.ts.map +1 -0
  251. package/dist/types/src/components/builtin/Form/components/Field/components/LongTextTableField/index.d.ts +10 -0
  252. package/dist/types/src/components/builtin/Form/components/Field/components/LongTextTableField/index.d.ts.map +1 -0
  253. package/dist/types/src/components/builtin/Form/components/Field/components/MultipleSelectTableField/index.d.ts +23 -0
  254. package/dist/types/src/components/builtin/Form/components/Field/components/MultipleSelectTableField/index.d.ts.map +1 -0
  255. package/dist/types/src/components/builtin/Form/components/Field/components/NumberTableField/index.d.ts +11 -0
  256. package/dist/types/src/components/builtin/Form/components/Field/components/NumberTableField/index.d.ts.map +1 -0
  257. package/dist/types/src/components/builtin/Form/components/Field/components/PhoneNumberTableField/index.d.ts +11 -0
  258. package/dist/types/src/components/builtin/Form/components/Field/components/PhoneNumberTableField/index.d.ts.map +1 -0
  259. package/dist/types/src/components/builtin/Form/components/Field/components/PlaceholderTableField/index.d.ts +3 -0
  260. package/dist/types/src/components/builtin/Form/components/Field/components/PlaceholderTableField/index.d.ts.map +1 -0
  261. package/dist/types/src/components/builtin/Form/components/Field/components/RadioButton/index.d.ts +17 -0
  262. package/dist/types/src/components/builtin/Form/components/Field/components/RadioButton/index.d.ts.map +1 -0
  263. package/dist/types/src/components/builtin/Form/components/Field/components/SingleLineTextTableField/index.d.ts +11 -0
  264. package/dist/types/src/components/builtin/Form/components/Field/components/SingleLineTextTableField/index.d.ts.map +1 -0
  265. package/dist/types/src/components/builtin/Form/components/Field/components/SingleSelectTableField/components/TableColumnRadioButtonGroup/index.d.ts +23 -0
  266. package/dist/types/src/components/builtin/Form/components/Field/components/SingleSelectTableField/components/TableColumnRadioButtonGroup/index.d.ts.map +1 -0
  267. package/dist/types/src/components/builtin/Form/components/Field/components/SingleSelectTableField/components/TableColumnSingleSelect/index.d.ts +19 -0
  268. package/dist/types/src/components/builtin/Form/components/Field/components/SingleSelectTableField/components/TableColumnSingleSelect/index.d.ts.map +1 -0
  269. package/dist/types/src/components/builtin/Form/components/Field/components/SingleSelectTableField/index.d.ts +24 -0
  270. package/dist/types/src/components/builtin/Form/components/Field/components/SingleSelectTableField/index.d.ts.map +1 -0
  271. package/dist/types/src/components/builtin/Form/components/Field/components/TextArea/index.d.ts +13 -0
  272. package/dist/types/src/components/builtin/Form/components/Field/components/TextArea/index.d.ts.map +1 -0
  273. package/dist/types/src/components/builtin/Form/components/Field/components/URLTableField/index.d.ts +11 -0
  274. package/dist/types/src/components/builtin/Form/components/Field/components/URLTableField/index.d.ts.map +1 -0
  275. package/dist/types/src/components/builtin/Form/components/Field/index.d.ts +19 -0
  276. package/dist/types/src/components/builtin/Form/components/Field/index.d.ts.map +1 -0
  277. package/dist/types/src/components/builtin/Form/components/Field/services/cssField.d.ts +11 -0
  278. package/dist/types/src/components/builtin/Form/components/Field/services/cssField.d.ts.map +1 -0
  279. package/dist/types/src/components/builtin/Form/components/Placeholder/index.d.ts +10 -0
  280. package/dist/types/src/components/builtin/Form/components/Placeholder/index.d.ts.map +1 -0
  281. package/dist/types/src/components/builtin/Form/components/Spinner/index.d.ts +3 -0
  282. package/dist/types/src/components/builtin/Form/components/Spinner/index.d.ts.map +1 -0
  283. package/dist/types/src/components/builtin/Form/context/FormContext.d.ts +39 -0
  284. package/dist/types/src/components/builtin/Form/context/FormContext.d.ts.map +1 -0
  285. package/dist/types/src/components/builtin/Form/index.d.ts +2 -0
  286. package/dist/types/src/components/builtin/Form/index.d.ts.map +1 -0
  287. package/dist/types/src/components/builtin/Form/register.d.ts +3 -0
  288. package/dist/types/src/components/builtin/Form/register.d.ts.map +1 -0
  289. package/dist/types/src/components/builtin/Form/types.d.ts +62 -0
  290. package/dist/types/src/components/builtin/Form/types.d.ts.map +1 -0
  291. package/dist/types/src/components/builtin/Image/Image.d.ts +26 -0
  292. package/dist/types/src/components/builtin/Image/Image.d.ts.map +1 -0
  293. package/dist/types/src/components/builtin/Image/index.d.ts +2 -0
  294. package/dist/types/src/components/builtin/Image/index.d.ts.map +1 -0
  295. package/dist/types/src/components/builtin/Image/register.d.ts +3 -0
  296. package/dist/types/src/components/builtin/Image/register.d.ts.map +1 -0
  297. package/dist/types/src/components/builtin/Navigation/Navigation.d.ts +24 -0
  298. package/dist/types/src/components/builtin/Navigation/Navigation.d.ts.map +1 -0
  299. package/dist/types/src/components/builtin/Navigation/components/DropDownButton/index.d.ts +100 -0
  300. package/dist/types/src/components/builtin/Navigation/components/DropDownButton/index.d.ts.map +1 -0
  301. package/dist/types/src/components/builtin/Navigation/components/LinksPlaceholder/index.d.ts +8 -0
  302. package/dist/types/src/components/builtin/Navigation/components/LinksPlaceholder/index.d.ts.map +1 -0
  303. package/dist/types/src/components/builtin/Navigation/components/MobileMenu/components/MobileDropDownButton/index.d.ts +101 -0
  304. package/dist/types/src/components/builtin/Navigation/components/MobileMenu/components/MobileDropDownButton/index.d.ts.map +1 -0
  305. package/dist/types/src/components/builtin/Navigation/components/MobileMenu/index.d.ts +14 -0
  306. package/dist/types/src/components/builtin/Navigation/components/MobileMenu/index.d.ts.map +1 -0
  307. package/dist/types/src/components/builtin/Navigation/index.d.ts +2 -0
  308. package/dist/types/src/components/builtin/Navigation/index.d.ts.map +1 -0
  309. package/dist/types/src/components/builtin/Navigation/register.d.ts +3 -0
  310. package/dist/types/src/components/builtin/Navigation/register.d.ts.map +1 -0
  311. package/dist/types/src/components/builtin/Root/Root.d.ts +12 -0
  312. package/dist/types/src/components/builtin/Root/Root.d.ts.map +1 -0
  313. package/dist/types/{components → src/components/builtin}/Root/components/Placeholder/index.d.ts +0 -0
  314. package/dist/types/src/components/builtin/Root/components/Placeholder/index.d.ts.map +1 -0
  315. package/dist/types/{components → src/components/builtin}/Root/index.d.ts +0 -0
  316. package/dist/types/src/components/builtin/Root/index.d.ts.map +1 -0
  317. package/dist/types/src/components/builtin/Root/register.d.ts +3 -0
  318. package/dist/types/src/components/builtin/Root/register.d.ts.map +1 -0
  319. package/dist/types/src/components/builtin/SocialLinks/SocialLinks.d.ts +19 -0
  320. package/dist/types/src/components/builtin/SocialLinks/SocialLinks.d.ts.map +1 -0
  321. package/dist/types/src/components/builtin/SocialLinks/components/SocialLinksPlaceholder/index.d.ts +8 -0
  322. package/dist/types/src/components/builtin/SocialLinks/components/SocialLinksPlaceholder/index.d.ts.map +1 -0
  323. package/dist/types/src/components/builtin/SocialLinks/index.d.ts +2 -0
  324. package/dist/types/src/components/builtin/SocialLinks/index.d.ts.map +1 -0
  325. package/dist/types/src/components/builtin/SocialLinks/options.d.ts +118 -0
  326. package/dist/types/src/components/builtin/SocialLinks/options.d.ts.map +1 -0
  327. package/dist/types/src/components/builtin/SocialLinks/register.d.ts +3 -0
  328. package/dist/types/src/components/builtin/SocialLinks/register.d.ts.map +1 -0
  329. package/dist/types/src/components/builtin/Text/Text.d.ts +16 -0
  330. package/dist/types/src/components/builtin/Text/Text.d.ts.map +1 -0
  331. package/dist/types/src/components/builtin/Text/components/RichTextEditor/components/Block/index.d.ts +13 -0
  332. package/dist/types/src/components/builtin/Text/components/RichTextEditor/components/Block/index.d.ts.map +1 -0
  333. package/dist/types/src/components/builtin/Text/components/RichTextEditor/components/Mark/hooks/useTypographyMark.d.ts +25 -0
  334. package/dist/types/src/components/builtin/Text/components/RichTextEditor/components/Mark/hooks/useTypographyMark.d.ts.map +1 -0
  335. package/dist/types/src/components/builtin/Text/components/RichTextEditor/components/Mark/index.d.ts +13 -0
  336. package/dist/types/src/components/builtin/Text/components/RichTextEditor/components/Mark/index.d.ts.map +1 -0
  337. package/dist/types/src/components/builtin/Text/components/RichTextEditor/index.d.ts +5 -0
  338. package/dist/types/src/components/builtin/Text/components/RichTextEditor/index.d.ts.map +1 -0
  339. package/dist/types/src/components/builtin/Text/components/RichTextEditor/plugins/DeviceOverridesBlocks.d.ts +3 -0
  340. package/dist/types/src/components/builtin/Text/components/RichTextEditor/plugins/DeviceOverridesBlocks.d.ts.map +1 -0
  341. package/dist/types/src/components/builtin/Text/components/RichTextEditor/plugins/DeviceOverridesMarks.d.ts +3 -0
  342. package/dist/types/src/components/builtin/Text/components/RichTextEditor/plugins/DeviceOverridesMarks.d.ts.map +1 -0
  343. package/dist/types/src/components/builtin/Text/components/RichTextEditor/plugins/Inlines.d.ts +3 -0
  344. package/dist/types/src/components/builtin/Text/components/RichTextEditor/plugins/Inlines.d.ts.map +1 -0
  345. package/dist/types/src/components/builtin/Text/components/RichTextEditor/plugins/Link.d.ts +3 -0
  346. package/dist/types/src/components/builtin/Text/components/RichTextEditor/plugins/Link.d.ts.map +1 -0
  347. package/dist/types/src/components/builtin/Text/index.d.ts +2 -0
  348. package/dist/types/src/components/builtin/Text/index.d.ts.map +1 -0
  349. package/dist/types/src/components/builtin/Text/register.d.ts +3 -0
  350. package/dist/types/src/components/builtin/Text/register.d.ts.map +1 -0
  351. package/dist/types/src/components/builtin/Video/Video.d.ts +12 -0
  352. package/dist/types/src/components/builtin/Video/Video.d.ts.map +1 -0
  353. package/dist/types/src/components/builtin/Video/index.d.ts +2 -0
  354. package/dist/types/src/components/builtin/Video/index.d.ts.map +1 -0
  355. package/dist/types/src/components/builtin/Video/register.d.ts +3 -0
  356. package/dist/types/src/components/builtin/Video/register.d.ts.map +1 -0
  357. package/dist/types/src/components/builtin/constants.d.ts +20 -0
  358. package/dist/types/src/components/builtin/constants.d.ts.map +1 -0
  359. package/dist/types/src/components/builtin/index.d.ts +16 -0
  360. package/dist/types/src/components/builtin/index.d.ts.map +1 -0
  361. package/dist/types/src/components/builtin/register.d.ts +3 -0
  362. package/dist/types/src/components/builtin/register.d.ts.map +1 -0
  363. package/dist/types/src/components/hooks/index.d.ts +8 -0
  364. package/dist/types/src/components/hooks/index.d.ts.map +1 -0
  365. package/dist/types/src/components/hooks/useBackgrounds.d.ts +59 -0
  366. package/dist/types/src/components/hooks/useBackgrounds.d.ts.map +1 -0
  367. package/dist/types/src/components/hooks/useBorder.d.ts +19 -0
  368. package/dist/types/src/components/hooks/useBorder.d.ts.map +1 -0
  369. package/dist/types/src/components/hooks/useBoxShadow.d.ts +19 -0
  370. package/dist/types/src/components/hooks/useBoxShadow.d.ts.map +1 -0
  371. package/dist/types/src/components/hooks/useFile.d.ts +13 -0
  372. package/dist/types/src/components/hooks/useFile.d.ts.map +1 -0
  373. package/dist/types/src/components/hooks/useIsomorphicLayoutEffect.d.ts +3 -0
  374. package/dist/types/src/components/hooks/useIsomorphicLayoutEffect.d.ts.map +1 -0
  375. package/dist/types/{components → src/components}/hooks/useMediaQuery.d.ts +0 -0
  376. package/dist/types/src/components/hooks/useMediaQuery.d.ts.map +1 -0
  377. package/dist/types/src/components/hooks/usePage.d.ts +7 -0
  378. package/dist/types/src/components/hooks/usePage.d.ts.map +1 -0
  379. package/dist/types/src/components/hooks/useResponsiveColor.d.ts +7 -0
  380. package/dist/types/src/components/hooks/useResponsiveColor.d.ts.map +1 -0
  381. package/dist/types/src/components/hooks/useTableFormFieldRefs.d.ts +8 -0
  382. package/dist/types/src/components/hooks/useTableFormFieldRefs.d.ts.map +1 -0
  383. package/dist/types/src/components/hooks/useTypography.d.ts +24 -0
  384. package/dist/types/src/components/hooks/useTypography.d.ts.map +1 -0
  385. package/dist/types/src/components/index.d.ts +5 -0
  386. package/dist/types/src/components/index.d.ts.map +1 -0
  387. package/dist/types/src/components/page/BodySnippet.d.ts +7 -0
  388. package/dist/types/src/components/page/BodySnippet.d.ts.map +1 -0
  389. package/dist/types/src/components/page/Page.d.ts +28 -0
  390. package/dist/types/src/components/page/Page.d.ts.map +1 -0
  391. package/dist/types/src/components/page/index.d.ts +2 -0
  392. package/dist/types/src/components/page/index.d.ts.map +1 -0
  393. package/dist/types/src/components/shared/BackgroundsContainer/components/BackgroundVideo/index.d.ts +11 -0
  394. package/dist/types/src/components/shared/BackgroundsContainer/components/BackgroundVideo/index.d.ts.map +1 -0
  395. package/dist/types/src/components/shared/BackgroundsContainer/components/Backgrounds/index.d.ts +8 -0
  396. package/dist/types/src/components/shared/BackgroundsContainer/components/Backgrounds/index.d.ts.map +1 -0
  397. package/dist/types/src/components/shared/BackgroundsContainer/components/Parallax/index.d.ts +11 -0
  398. package/dist/types/src/components/shared/BackgroundsContainer/components/Parallax/index.d.ts.map +1 -0
  399. package/dist/types/src/components/shared/BackgroundsContainer/index.d.ts +11 -0
  400. package/dist/types/src/components/shared/BackgroundsContainer/index.d.ts.map +1 -0
  401. package/dist/types/src/components/shared/FallbackComponent/FallbackComponent.d.ts +7 -0
  402. package/dist/types/src/components/shared/FallbackComponent/FallbackComponent.d.ts.map +1 -0
  403. package/dist/types/src/components/shared/FallbackComponent/index.d.ts +2 -0
  404. package/dist/types/src/components/shared/FallbackComponent/index.d.ts.map +1 -0
  405. package/dist/types/src/components/shared/GutterContainer/index.d.ts +8 -0
  406. package/dist/types/src/components/shared/GutterContainer/index.d.ts.map +1 -0
  407. package/dist/types/src/components/shared/Link/index.d.ts +9 -0
  408. package/dist/types/src/components/shared/Link/index.d.ts.map +1 -0
  409. package/dist/types/src/components/utils/colorToString.d.ts +3 -0
  410. package/dist/types/src/components/utils/colorToString.d.ts.map +1 -0
  411. package/dist/types/{components → src/components}/utils/columns.d.ts +0 -0
  412. package/dist/types/src/components/utils/columns.d.ts.map +1 -0
  413. package/dist/types/{components → src/components}/utils/cssMediaRules.d.ts +23 -1
  414. package/dist/types/src/components/utils/cssMediaRules.d.ts.map +1 -0
  415. package/dist/types/{components → src/components}/utils/devices.d.ts +1 -0
  416. package/dist/types/src/components/utils/devices.d.ts.map +1 -0
  417. package/dist/types/src/components/utils/isNonNullable.d.ts +2 -0
  418. package/dist/types/src/components/utils/isNonNullable.d.ts.map +1 -0
  419. package/dist/types/src/components/utils/placeholders.d.ts +17 -0
  420. package/dist/types/src/components/utils/placeholders.d.ts.map +1 -0
  421. package/dist/types/src/components/utils/queries.d.ts +10 -0
  422. package/dist/types/src/components/utils/queries.d.ts.map +1 -0
  423. package/dist/types/src/components/utils/responsive-style.d.ts +9 -0
  424. package/dist/types/src/components/utils/responsive-style.d.ts.map +1 -0
  425. package/dist/types/src/components/utils/types.d.ts +10 -0
  426. package/dist/types/src/components/utils/types.d.ts.map +1 -0
  427. package/dist/types/src/controls/checkbox.d.ts +13 -0
  428. package/dist/types/src/controls/checkbox.d.ts.map +1 -0
  429. package/dist/types/src/controls/color.d.ts +16 -0
  430. package/dist/types/src/controls/color.d.ts.map +1 -0
  431. package/dist/types/src/controls/combobox.d.ts +22 -0
  432. package/dist/types/src/controls/combobox.d.ts.map +1 -0
  433. package/dist/types/src/controls/control.d.ts +14 -0
  434. package/dist/types/src/controls/control.d.ts.map +1 -0
  435. package/dist/types/src/controls/image.d.ts +24 -0
  436. package/dist/types/src/controls/image.d.ts.map +1 -0
  437. package/dist/types/src/controls/index.d.ts +15 -0
  438. package/dist/types/src/controls/index.d.ts.map +1 -0
  439. package/dist/types/src/controls/link.d.ts +50 -0
  440. package/dist/types/src/controls/link.d.ts.map +1 -0
  441. package/dist/types/src/controls/list.d.ts +26 -0
  442. package/dist/types/src/controls/list.d.ts.map +1 -0
  443. package/dist/types/src/controls/number.d.ts +18 -0
  444. package/dist/types/src/controls/number.d.ts.map +1 -0
  445. package/dist/types/src/controls/select.d.ts +22 -0
  446. package/dist/types/src/controls/select.d.ts.map +1 -0
  447. package/dist/types/src/controls/shape.d.ts +15 -0
  448. package/dist/types/src/controls/shape.d.ts.map +1 -0
  449. package/dist/types/src/controls/slot.d.ts +42 -0
  450. package/dist/types/src/controls/slot.d.ts.map +1 -0
  451. package/dist/types/src/controls/style.d.ts +206 -0
  452. package/dist/types/src/controls/style.d.ts.map +1 -0
  453. package/dist/types/src/controls/text-area.d.ts +14 -0
  454. package/dist/types/src/controls/text-area.d.ts.map +1 -0
  455. package/dist/types/src/controls/text-input.d.ts +13 -0
  456. package/dist/types/src/controls/text-input.d.ts.map +1 -0
  457. package/dist/types/src/controls/types.d.ts +14 -0
  458. package/dist/types/src/controls/types.d.ts.map +1 -0
  459. package/dist/types/{index.d.ts → src/index.d.ts} +3 -1
  460. package/dist/types/src/index.d.ts.map +1 -0
  461. package/dist/types/src/next/api-handler.d.ts +31 -0
  462. package/dist/types/src/next/api-handler.d.ts.map +1 -0
  463. package/dist/types/src/next/client.d.ts +68 -0
  464. package/dist/types/src/next/client.d.ts.map +1 -0
  465. package/dist/types/src/next/document.d.ts +7 -0
  466. package/dist/types/src/next/document.d.ts.map +1 -0
  467. package/dist/types/src/next/dynamic.d.ts +13 -0
  468. package/dist/types/src/next/dynamic.d.ts.map +1 -0
  469. package/dist/types/src/next/index.d.ts +24 -0
  470. package/dist/types/src/next/index.d.ts.map +1 -0
  471. package/dist/types/src/next/preview-mode.d.ts +11 -0
  472. package/dist/types/src/next/preview-mode.d.ts.map +1 -0
  473. package/dist/types/{prop-controllers → src/prop-controllers}/descriptors.d.ts +132 -45
  474. package/dist/types/src/prop-controllers/descriptors.d.ts.map +1 -0
  475. package/dist/types/src/prop-controllers/index.d.ts +5 -0
  476. package/dist/types/src/prop-controllers/index.d.ts.map +1 -0
  477. package/dist/types/src/prop-controllers/instances.d.ts +102 -0
  478. package/dist/types/src/prop-controllers/instances.d.ts.map +1 -0
  479. package/dist/types/src/prop-controllers/introspection.d.ts +10 -0
  480. package/dist/types/src/prop-controllers/introspection.d.ts.map +1 -0
  481. package/dist/types/src/react.d.ts +4 -0
  482. package/dist/types/src/react.d.ts.map +1 -0
  483. package/dist/types/src/runtimes/react/components/index.d.ts +2 -0
  484. package/dist/types/src/runtimes/react/components/index.d.ts.map +1 -0
  485. package/dist/types/src/runtimes/react/components/render-hook.d.ts +14 -0
  486. package/dist/types/src/runtimes/react/components/render-hook.d.ts.map +1 -0
  487. package/dist/types/src/runtimes/react/controls/checkbox.d.ts +4 -0
  488. package/dist/types/src/runtimes/react/controls/checkbox.d.ts.map +1 -0
  489. package/dist/types/src/runtimes/react/controls/color.d.ts +4 -0
  490. package/dist/types/src/runtimes/react/controls/color.d.ts.map +1 -0
  491. package/dist/types/src/runtimes/react/controls/combobox.d.ts +4 -0
  492. package/dist/types/src/runtimes/react/controls/combobox.d.ts.map +1 -0
  493. package/dist/types/src/runtimes/react/controls/control.d.ts +22 -0
  494. package/dist/types/src/runtimes/react/controls/control.d.ts.map +1 -0
  495. package/dist/types/src/runtimes/react/controls/image.d.ts +13 -0
  496. package/dist/types/src/runtimes/react/controls/image.d.ts.map +1 -0
  497. package/dist/types/src/runtimes/react/controls/link.d.ts +11 -0
  498. package/dist/types/src/runtimes/react/controls/link.d.ts.map +1 -0
  499. package/dist/types/src/runtimes/react/controls/list.d.ts +13 -0
  500. package/dist/types/src/runtimes/react/controls/list.d.ts.map +1 -0
  501. package/dist/types/src/runtimes/react/controls/number.d.ts +4 -0
  502. package/dist/types/src/runtimes/react/controls/number.d.ts.map +1 -0
  503. package/dist/types/src/runtimes/react/controls/select.d.ts +4 -0
  504. package/dist/types/src/runtimes/react/controls/select.d.ts.map +1 -0
  505. package/dist/types/src/runtimes/react/controls/shape.d.ts +14 -0
  506. package/dist/types/src/runtimes/react/controls/shape.d.ts.map +1 -0
  507. package/dist/types/src/runtimes/react/controls/slot.d.ts +30 -0
  508. package/dist/types/src/runtimes/react/controls/slot.d.ts.map +1 -0
  509. package/dist/types/src/runtimes/react/controls/style.d.ts +4 -0
  510. package/dist/types/src/runtimes/react/controls/style.d.ts.map +1 -0
  511. package/dist/types/src/runtimes/react/controls/text-area.d.ts +4 -0
  512. package/dist/types/src/runtimes/react/controls/text-area.d.ts.map +1 -0
  513. package/dist/types/src/runtimes/react/controls/text-input.d.ts +4 -0
  514. package/dist/types/src/runtimes/react/controls/text-input.d.ts.map +1 -0
  515. package/dist/types/src/runtimes/react/controls.d.ts +13 -0
  516. package/dist/types/src/runtimes/react/controls.d.ts.map +1 -0
  517. package/dist/types/src/runtimes/react/find-dom-node.d.ts +7 -0
  518. package/dist/types/src/runtimes/react/find-dom-node.d.ts.map +1 -0
  519. package/dist/types/src/runtimes/react/index.d.ts +48 -0
  520. package/dist/types/src/runtimes/react/index.d.ts.map +1 -0
  521. package/dist/types/src/runtimes/react/use-style.d.ts +3 -0
  522. package/dist/types/src/runtimes/react/use-style.d.ts.map +1 -0
  523. package/dist/types/src/state/actions.d.ts +291 -0
  524. package/dist/types/src/state/actions.d.ts.map +1 -0
  525. package/dist/types/{state → src/state}/modules/box-models.d.ts +5 -5
  526. package/dist/types/src/state/modules/box-models.d.ts.map +1 -0
  527. package/dist/types/{state → src/state}/modules/components-meta.d.ts +0 -0
  528. package/dist/types/src/state/modules/components-meta.d.ts.map +1 -0
  529. package/dist/types/src/state/modules/is-in-builder.d.ts +6 -0
  530. package/dist/types/src/state/modules/is-in-builder.d.ts.map +1 -0
  531. package/dist/types/src/state/modules/prop-controller-handles.d.ts +17 -0
  532. package/dist/types/src/state/modules/prop-controller-handles.d.ts.map +1 -0
  533. package/dist/types/{state → src/state}/modules/prop-controllers.d.ts +1 -0
  534. package/dist/types/src/state/modules/prop-controllers.d.ts.map +1 -0
  535. package/dist/types/{state → src/state}/modules/react-components.d.ts +4 -2
  536. package/dist/types/src/state/modules/react-components.d.ts.map +1 -0
  537. package/dist/types/{state → src/state}/modules/read-only-documents.d.ts +8 -4
  538. package/dist/types/src/state/modules/read-only-documents.d.ts.map +1 -0
  539. package/dist/types/{state → src/state}/modules/read-write-documents.d.ts +1 -1
  540. package/dist/types/src/state/modules/read-write-documents.d.ts.map +1 -0
  541. package/dist/types/{state → src/state}/react-builder-preview.d.ts +16 -11
  542. package/dist/types/src/state/react-builder-preview.d.ts.map +1 -0
  543. package/dist/types/src/state/react-page.d.ts +38 -0
  544. package/dist/types/src/state/react-page.d.ts.map +1 -0
  545. package/dist/types/src/utils/clamp.d.ts +3 -0
  546. package/dist/types/src/utils/clamp.d.ts.map +1 -0
  547. package/dist/types/src/utils/coalesce.d.ts +3 -0
  548. package/dist/types/src/utils/coalesce.d.ts.map +1 -0
  549. package/dist/types/src/utils/constants.d.ts +6 -0
  550. package/dist/types/src/utils/constants.d.ts.map +1 -0
  551. package/dist/types/{utils → src/utils}/deepEqual.d.ts +0 -0
  552. package/dist/types/src/utils/deepEqual.d.ts.map +1 -0
  553. package/dist/types/src/utils/intersection.d.ts +4 -0
  554. package/dist/types/src/utils/intersection.d.ts.map +1 -0
  555. package/dist/types/{utils → src/utils}/is.d.ts +0 -0
  556. package/dist/types/src/utils/is.d.ts.map +1 -0
  557. package/dist/types/src/utils/keys.d.ts +5 -0
  558. package/dist/types/src/utils/keys.d.ts.map +1 -0
  559. package/dist/types/{utils → src/utils}/shallowEqual.d.ts +0 -0
  560. package/dist/types/src/utils/shallowEqual.d.ts.map +1 -0
  561. package/dist/types/src/utils/shallowMerge.d.ts +2 -0
  562. package/dist/types/src/utils/shallowMerge.d.ts.map +1 -0
  563. package/dist/useBoxShadow.cjs.js +78 -0
  564. package/dist/useBoxShadow.cjs.js.map +1 -0
  565. package/dist/useBoxShadow.es.js +77 -0
  566. package/dist/useBoxShadow.es.js.map +1 -0
  567. package/dist/useMediaQuery.cjs.js +26 -0
  568. package/dist/useMediaQuery.cjs.js.map +1 -0
  569. package/dist/useMediaQuery.es.js +25 -0
  570. package/dist/useMediaQuery.es.js.map +1 -0
  571. package/next/plugin.js +1 -0
  572. package/next.js +1 -0
  573. package/package.json +105 -24
  574. package/prop-controllers.js +1 -0
  575. package/react.js +1 -0
  576. package/dist/react.cjs2.js +0 -835
  577. package/dist/react.cjs2.js.map +0 -1
  578. package/dist/react.es2.js +0 -810
  579. package/dist/react.es2.js.map +0 -1
  580. package/dist/types/box-model.d.ts +0 -3
  581. package/dist/types/box-model.d.ts.map +0 -1
  582. package/dist/types/components/Box/Box.d.ts.map +0 -1
  583. package/dist/types/components/Box/animations.d.ts.map +0 -1
  584. package/dist/types/components/Box/components/Placeholder/index.d.ts.map +0 -1
  585. package/dist/types/components/Box/index.d.ts.map +0 -1
  586. package/dist/types/components/Root/Root.d.ts +0 -11
  587. package/dist/types/components/Root/Root.d.ts.map +0 -1
  588. package/dist/types/components/Root/components/Placeholder/index.d.ts.map +0 -1
  589. package/dist/types/components/Root/index.d.ts.map +0 -1
  590. package/dist/types/components/hooks/index.d.ts +0 -2
  591. package/dist/types/components/hooks/index.d.ts.map +0 -1
  592. package/dist/types/components/hooks/useMediaQuery.d.ts.map +0 -1
  593. package/dist/types/components/index.d.ts +0 -4
  594. package/dist/types/components/index.d.ts.map +0 -1
  595. package/dist/types/components/utils/columns.d.ts.map +0 -1
  596. package/dist/types/components/utils/cssMediaRules.d.ts.map +0 -1
  597. package/dist/types/components/utils/devices.d.ts.map +0 -1
  598. package/dist/types/index.d.ts.map +0 -1
  599. package/dist/types/prop-controllers/descriptors.d.ts.map +0 -1
  600. package/dist/types/prop-controllers/index.d.ts +0 -3
  601. package/dist/types/prop-controllers/index.d.ts.map +0 -1
  602. package/dist/types/react.d.ts +0 -4
  603. package/dist/types/react.d.ts.map +0 -1
  604. package/dist/types/runtimes/react.d.ts +0 -28
  605. package/dist/types/runtimes/react.d.ts.map +0 -1
  606. package/dist/types/state/actions.d.ts +0 -124
  607. package/dist/types/state/actions.d.ts.map +0 -1
  608. package/dist/types/state/modules/box-models.d.ts.map +0 -1
  609. package/dist/types/state/modules/components-meta.d.ts.map +0 -1
  610. package/dist/types/state/modules/prop-controllers.d.ts.map +0 -1
  611. package/dist/types/state/modules/react-components.d.ts.map +0 -1
  612. package/dist/types/state/modules/read-only-documents.d.ts.map +0 -1
  613. package/dist/types/state/modules/read-write-documents.d.ts.map +0 -1
  614. package/dist/types/state/react-builder-preview.d.ts.map +0 -1
  615. package/dist/types/state/react-page.d.ts +0 -28
  616. package/dist/types/state/react-page.d.ts.map +0 -1
  617. package/dist/types/utils/deepEqual.d.ts.map +0 -1
  618. package/dist/types/utils/is.d.ts.map +0 -1
  619. package/dist/types/utils/shallowEqual.d.ts.map +0 -1
@@ -0,0 +1,3211 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __defProps = Object.defineProperties;
4
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
5
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
8
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
9
+ var __spreadValues = (a, b) => {
10
+ for (var prop in b || (b = {}))
11
+ if (__hasOwnProp.call(b, prop))
12
+ __defNormalProp(a, prop, b[prop]);
13
+ if (__getOwnPropSymbols)
14
+ for (var prop of __getOwnPropSymbols(b)) {
15
+ if (__propIsEnum.call(b, prop))
16
+ __defNormalProp(a, prop, b[prop]);
17
+ }
18
+ return a;
19
+ };
20
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
21
+ var __restKey = (key) => typeof key === "symbol" ? key : key + "";
22
+ var __objRest = (source, exclude) => {
23
+ var target = {};
24
+ for (var prop in source)
25
+ if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
26
+ target[prop] = source[prop];
27
+ if (source != null && __getOwnPropSymbols)
28
+ for (var prop of __getOwnPropSymbols(source)) {
29
+ if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
30
+ target[prop] = source[prop];
31
+ }
32
+ return target;
33
+ };
34
+ var __publicField = (obj, key, value) => {
35
+ __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
36
+ return value;
37
+ };
38
+ var _e;
39
+ var React = require("react");
40
+ var withSelector = require("use-sync-external-store/shim/with-selector");
41
+ var reactPage = require("./react-page.cjs.js");
42
+ var actions = require("./actions.cjs.js");
43
+ var dynamic = require("next/dynamic");
44
+ var client = require("@apollo/client");
45
+ var batchHttp = require("@apollo/client/link/batch-http");
46
+ var slate = require("slate");
47
+ var graphql = require("./graphql.cjs.js");
48
+ var image = require("./image.cjs.js");
49
+ var shape = require("./shape.cjs.js");
50
+ var jsxRuntime = require("react/jsx-runtime");
51
+ var styled = require("styled-components");
52
+ var textInput = require("./text-input.cjs.js");
53
+ var color = require("./color.cjs.js");
54
+ var slot = require("./slot.cjs.js");
55
+ var css = require("@emotion/css");
56
+ var ColorHelper = require("color");
57
+ var scrollIntoView = require("scroll-into-view-if-needed");
58
+ var boxModels = require("./box-models.cjs.js");
59
+ var reactDom = require("react-dom");
60
+ var parse = require("html-react-parser");
61
+ var Head = require("next/head");
62
+ require("@emotion/server/create-instance");
63
+ require("next/document");
64
+ require("cookie");
65
+ require("cors");
66
+ require("http-proxy");
67
+ require("set-cookie-parser");
68
+ var uuid = require("uuid/v4");
69
+ var ipsum = require("corporate-ipsum");
70
+ function _interopDefaultLegacy(e) {
71
+ return e && typeof e === "object" && "default" in e ? e : { "default": e };
72
+ }
73
+ function _interopNamespace(e) {
74
+ if (e && e.__esModule)
75
+ return e;
76
+ var n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
77
+ if (e) {
78
+ Object.keys(e).forEach(function(k) {
79
+ if (k !== "default") {
80
+ var d = Object.getOwnPropertyDescriptor(e, k);
81
+ Object.defineProperty(n, k, d.get ? d : {
82
+ enumerable: true,
83
+ get: function() {
84
+ return e[k];
85
+ }
86
+ });
87
+ }
88
+ });
89
+ }
90
+ n["default"] = e;
91
+ return Object.freeze(n);
92
+ }
93
+ var React__namespace = /* @__PURE__ */ _interopNamespace(React);
94
+ var dynamic__default = /* @__PURE__ */ _interopDefaultLegacy(dynamic);
95
+ var styled__default = /* @__PURE__ */ _interopDefaultLegacy(styled);
96
+ var ColorHelper__default = /* @__PURE__ */ _interopDefaultLegacy(ColorHelper);
97
+ var scrollIntoView__default = /* @__PURE__ */ _interopDefaultLegacy(scrollIntoView);
98
+ var parse__default = /* @__PURE__ */ _interopDefaultLegacy(parse);
99
+ var Head__default = /* @__PURE__ */ _interopDefaultLegacy(Head);
100
+ var uuid__default = /* @__PURE__ */ _interopDefaultLegacy(uuid);
101
+ var ipsum__default = /* @__PURE__ */ _interopDefaultLegacy(ipsum);
102
+ const SCRIPT_TAG = "script";
103
+ function BodySnippet({
104
+ code,
105
+ cleanup
106
+ }) {
107
+ React.useEffect(() => {
108
+ const container = document.createElement("div");
109
+ container.innerHTML = code;
110
+ const walker = document.createTreeWalker(container, NodeFilter.SHOW_ELEMENT);
111
+ const scripts = [];
112
+ while (walker.nextNode()) {
113
+ if (walker.currentNode instanceof HTMLScriptElement)
114
+ scripts.push(walker.currentNode);
115
+ }
116
+ scripts.forEach((inlineScript) => {
117
+ var _a;
118
+ const executableScript = document.createElement(SCRIPT_TAG);
119
+ executableScript.textContent = inlineScript.textContent;
120
+ Array.from(inlineScript.attributes).forEach(({
121
+ name,
122
+ value
123
+ }) => {
124
+ executableScript.setAttribute(name, value);
125
+ });
126
+ (_a = inlineScript.parentNode) == null ? void 0 : _a.replaceChild(executableScript, inlineScript);
127
+ });
128
+ const nodes = Array.from(container.childNodes);
129
+ document.body.append(...nodes);
130
+ return () => {
131
+ nodes.forEach((node) => {
132
+ var _a;
133
+ (_a = node.parentNode) == null ? void 0 : _a.removeChild(node);
134
+ });
135
+ if (cleanup == null)
136
+ return;
137
+ const cleanUp = new Function(cleanup);
138
+ try {
139
+ cleanUp();
140
+ } catch {
141
+ }
142
+ };
143
+ }, [code, cleanup]);
144
+ return null;
145
+ }
146
+ const SWATCHES_BY_ID = client.gql`
147
+ query SwatchesById($ids: [ID!]!) {
148
+ swatches(ids: $ids) {
149
+ id
150
+ hue
151
+ saturation
152
+ lightness
153
+ }
154
+ }
155
+ `;
156
+ const FILE_BY_ID = client.gql`
157
+ query FileById($id: ID!) {
158
+ file(id: $id) {
159
+ id
160
+ name
161
+ publicUrl
162
+ extension
163
+ dimensions {
164
+ width
165
+ height
166
+ }
167
+ }
168
+ }
169
+ `;
170
+ const FILES_BY_ID = client.gql`
171
+ query FilesById($ids: [ID!]!) {
172
+ files(ids: $ids) {
173
+ id
174
+ name
175
+ publicUrl
176
+ extension
177
+ dimensions {
178
+ width
179
+ height
180
+ }
181
+ }
182
+ }
183
+ `;
184
+ const PAGE_PATHNAMES_BY_ID = client.gql`
185
+ query PagePathnamesById($ids: [ID!]!) {
186
+ pagePathnamesById(ids: $ids) {
187
+ id
188
+ pathname
189
+ }
190
+ }
191
+ `;
192
+ const TYPOGRAPHY_FRAGMENT = client.gql`
193
+ fragment Typography on Typography {
194
+ id
195
+ name
196
+ style {
197
+ deviceId
198
+ value {
199
+ fontFamily
200
+ fontSize {
201
+ value
202
+ unit
203
+ }
204
+ color {
205
+ swatchId
206
+ alpha
207
+ }
208
+ lineHeight
209
+ letterSpacing
210
+ fontWeight
211
+ textAlign
212
+ uppercase
213
+ underline
214
+ strikethrough
215
+ italic
216
+ }
217
+ }
218
+ }
219
+ `;
220
+ const TYPOGRAPHIES_BY_ID = client.gql`
221
+ query TypographiesById($ids: [ID!]!) {
222
+ typographies(ids: $ids) {
223
+ ...Typography
224
+ }
225
+ }
226
+
227
+ ${TYPOGRAPHY_FRAGMENT}
228
+ `;
229
+ const TABLE_BY_ID = client.gql`
230
+ query TableById($id: ID!) {
231
+ table(id: $id) {
232
+ id
233
+ name
234
+ columns {
235
+ id
236
+ name
237
+ ... on MultipleSelectTableColumn {
238
+ options {
239
+ id
240
+ name
241
+ }
242
+ }
243
+ ... on SingleSelectTableColumn {
244
+ options {
245
+ id
246
+ name
247
+ }
248
+ }
249
+ }
250
+ }
251
+ }
252
+ `;
253
+ const ELEMENT_REFERENCE_GLOBAL_ELEMENT = client.gql`
254
+ query ElementReferenceGlobalElement($id: ID!) {
255
+ globalElement(id: $id) {
256
+ id
257
+ data
258
+ }
259
+ }
260
+ `;
261
+ const INTROSPECTION_QUERY = client.gql`
262
+ query Introspection(
263
+ $swatchIds: [ID!]!
264
+ $fileIds: [ID!]!
265
+ $pageIds: [ID!]!
266
+ $typographyIds: [ID!]!
267
+ $tableIds: [ID!]!
268
+ ) {
269
+ swatches(ids: $swatchIds) {
270
+ id
271
+ hue
272
+ saturation
273
+ lightness
274
+ }
275
+
276
+ files(ids: $fileIds) {
277
+ id
278
+ name
279
+ publicUrl
280
+ extension
281
+ dimensions {
282
+ width
283
+ height
284
+ }
285
+ }
286
+
287
+ pagePathnamesById(ids: $pageIds) {
288
+ id
289
+ pathname
290
+ }
291
+
292
+ typographies(ids: $typographyIds) {
293
+ ...Typography
294
+ }
295
+
296
+ tables(ids: $tableIds) {
297
+ id
298
+ name
299
+ columns {
300
+ id
301
+ name
302
+ ... on MultipleSelectTableColumn {
303
+ options {
304
+ id
305
+ name
306
+ }
307
+ }
308
+ ... on SingleSelectTableColumn {
309
+ options {
310
+ id
311
+ name
312
+ }
313
+ }
314
+ }
315
+ }
316
+ }
317
+
318
+ ${TYPOGRAPHY_FRAGMENT}
319
+ `;
320
+ async function introspect(element, client2, store) {
321
+ var _a, _b, _c;
322
+ const descriptors = reactPage.getPropControllerDescriptors(store.getState());
323
+ const swatchIds = /* @__PURE__ */ new Set();
324
+ const fileIds = /* @__PURE__ */ new Set();
325
+ const typographyIds = /* @__PURE__ */ new Set();
326
+ const tableIds = /* @__PURE__ */ new Set();
327
+ const pageIds = /* @__PURE__ */ new Set();
328
+ const remaining = [element];
329
+ let current;
330
+ while (current = remaining.pop()) {
331
+ let getResourcesFromElementDescriptors = function(elementDescriptors2, props) {
332
+ Object.entries(elementDescriptors2).forEach(([propName, descriptor]) => {
333
+ reactPage.getElementSwatchIds(descriptor, props[propName]).forEach((swatchId) => {
334
+ swatchIds.add(swatchId);
335
+ });
336
+ reactPage.getFileIds(descriptor, props[propName]).forEach((fileId) => fileIds.add(fileId));
337
+ reactPage.getTypographyIds(descriptor, props[propName]).forEach((typographyId) => typographyIds.add(typographyId));
338
+ reactPage.getTableIds(descriptor, props[propName]).forEach((tableId) => tableIds.add(tableId));
339
+ reactPage.getPageIds(descriptor, props[propName]).forEach((pageId) => pageIds.add(pageId));
340
+ reactPage.getElementChildren(descriptor, props[propName]).forEach((child) => remaining.push(child));
341
+ if (descriptor.type === shape.ShapeControlType) {
342
+ const prop = props[propName];
343
+ if (prop == null)
344
+ return;
345
+ getResourcesFromElementDescriptors(descriptor.config.type, prop);
346
+ }
347
+ if (descriptor.type === shape.ListControlType) {
348
+ const prop = props[propName];
349
+ if (prop == null)
350
+ return;
351
+ prop.forEach((item) => {
352
+ getResourcesFromElementDescriptors({ propName: descriptor.config.type }, { propName: item.value });
353
+ });
354
+ }
355
+ if (descriptor.type === image.Types.Shape) {
356
+ const prop = props[propName];
357
+ if (prop == null)
358
+ return;
359
+ getResourcesFromElementDescriptors(descriptor.options.type, prop);
360
+ }
361
+ if (descriptor.type === image.Types.List) {
362
+ const prop = props[propName];
363
+ if (prop == null)
364
+ return;
365
+ prop.forEach((item) => {
366
+ getResourcesFromElementDescriptors({ propName: descriptor.options.type }, { propName: item.value });
367
+ });
368
+ }
369
+ });
370
+ };
371
+ let element2;
372
+ if (reactPage.isElementReference(current)) {
373
+ const query = await client2.query({
374
+ query: ELEMENT_REFERENCE_GLOBAL_ELEMENT,
375
+ variables: { id: current.value }
376
+ });
377
+ const elementData = (_b = (_a = query.data) == null ? void 0 : _a.globalElement) == null ? void 0 : _b.data;
378
+ if (elementData == null)
379
+ continue;
380
+ element2 = elementData;
381
+ } else {
382
+ element2 = current;
383
+ }
384
+ const elementDescriptors = descriptors.get(element2.type);
385
+ if (elementDescriptors == null)
386
+ continue;
387
+ getResourcesFromElementDescriptors(elementDescriptors, element2.props);
388
+ }
389
+ const typographiesResult = await client2.query({
390
+ query: TYPOGRAPHIES_BY_ID,
391
+ variables: { ids: [...typographyIds] }
392
+ });
393
+ (_c = typographiesResult == null ? void 0 : typographiesResult.data) == null ? void 0 : _c.typographies.forEach((typography) => {
394
+ typography == null ? void 0 : typography.style.forEach((style) => {
395
+ var _a2;
396
+ const swatchId = (_a2 = style.value.color) == null ? void 0 : _a2.swatchId;
397
+ if (swatchId != null)
398
+ swatchIds.add(swatchId);
399
+ });
400
+ });
401
+ return {
402
+ swatchIds: [...swatchIds],
403
+ fileIds: [...fileIds],
404
+ typographyIds: [...typographyIds],
405
+ tableIds: [...tableIds],
406
+ pageIds: [...pageIds]
407
+ };
408
+ }
409
+ const typePolicies = {
410
+ Query: {
411
+ fields: {
412
+ swatches(existingData, {
413
+ args,
414
+ toReference
415
+ }) {
416
+ return existingData != null ? existingData : args == null ? void 0 : args.ids.map((id) => toReference({
417
+ __typename: "Swatch",
418
+ id
419
+ }, true));
420
+ },
421
+ file(existingData, {
422
+ args,
423
+ toReference
424
+ }) {
425
+ return existingData != null ? existingData : toReference({
426
+ __typename: "File",
427
+ id: args == null ? void 0 : args.id
428
+ }, true);
429
+ },
430
+ files(existingData, {
431
+ args,
432
+ toReference
433
+ }) {
434
+ return existingData != null ? existingData : args == null ? void 0 : args.ids.map((id) => toReference({
435
+ __typename: "File",
436
+ id
437
+ }, true));
438
+ },
439
+ typographies(existingData, {
440
+ args,
441
+ toReference
442
+ }) {
443
+ return existingData != null ? existingData : args == null ? void 0 : args.ids.map((id) => toReference({
444
+ __typename: "Typography",
445
+ id
446
+ }, true));
447
+ },
448
+ pagePathnamesById(existingData, {
449
+ args,
450
+ toReference
451
+ }) {
452
+ return existingData != null ? existingData : args == null ? void 0 : args.ids.map((id) => toReference({
453
+ __typename: "PagePathnameSlice",
454
+ id
455
+ }, true));
456
+ },
457
+ globalElement(existingData, {
458
+ args,
459
+ toReference
460
+ }) {
461
+ return existingData != null ? existingData : toReference({
462
+ __typename: "GlobalElement",
463
+ id: args == null ? void 0 : args.id
464
+ }, true);
465
+ },
466
+ table(existingData, {
467
+ args,
468
+ toReference
469
+ }) {
470
+ return existingData != null ? existingData : toReference({
471
+ __typename: "Table",
472
+ id: args == null ? void 0 : args.id
473
+ }, true);
474
+ },
475
+ page(existingData, {
476
+ args,
477
+ toReference
478
+ }) {
479
+ return existingData != null ? existingData : toReference({
480
+ __typename: "Page",
481
+ id: args == null ? void 0 : args.id
482
+ }, true);
483
+ },
484
+ site(existingData, {
485
+ args,
486
+ toReference
487
+ }) {
488
+ return existingData != null ? existingData : toReference({
489
+ __typename: "Site",
490
+ id: args == null ? void 0 : args.id
491
+ }, true);
492
+ }
493
+ }
494
+ }
495
+ };
496
+ function createApolloClient({
497
+ uri,
498
+ cacheData
499
+ }) {
500
+ const cache = new client.InMemoryCache({
501
+ typePolicies
502
+ });
503
+ if (cacheData)
504
+ cache.restore(cacheData);
505
+ return new client.ApolloClient({
506
+ link: new batchHttp.BatchHttpLink({
507
+ uri,
508
+ batchMax: 100
509
+ }),
510
+ cache
511
+ });
512
+ }
513
+ class MakeswiftClient {
514
+ constructor({
515
+ uri,
516
+ cacheData
517
+ }) {
518
+ __publicField(this, "apolloClient");
519
+ this.apolloClient = createApolloClient({
520
+ uri,
521
+ cacheData
522
+ });
523
+ }
524
+ async prefetch(element) {
525
+ const introspectionData = await introspect(element, this.apolloClient, storeContextDefaultValue);
526
+ const res = await this.apolloClient.query({
527
+ query: INTROSPECTION_QUERY,
528
+ variables: introspectionData
529
+ });
530
+ res.data.pagePathnamesById.forEach((pagePathnameSlice) => {
531
+ if (pagePathnameSlice == null)
532
+ return;
533
+ const id = Buffer.from(`Page:${pagePathnameSlice.id}`).toString("base64");
534
+ this.apolloClient.cache.writeFragment({
535
+ fragment: graphql.PagePathnameSliceFragmentDoc,
536
+ data: __spreadProps(__spreadValues({}, pagePathnameSlice), {
537
+ id
538
+ })
539
+ });
540
+ });
541
+ slate.KeyUtils.resetGenerator();
542
+ return this.apolloClient.cache.extract();
543
+ }
544
+ updateCacheData(cacheData) {
545
+ this.apolloClient.cache.restore(cacheData);
546
+ }
547
+ }
548
+ const Context$2 = React.createContext(void 0);
549
+ function useQuery(query, options) {
550
+ const client$1 = React.useContext(Context$2);
551
+ return client.useQuery(query, __spreadValues({
552
+ client: client$1 == null ? void 0 : client$1.apolloClient
553
+ }, options));
554
+ }
555
+ function useMutation(mutation, options) {
556
+ const client$1 = React.useContext(Context$2);
557
+ return client.useMutation(mutation, __spreadValues({
558
+ client: client$1 == null ? void 0 : client$1.apolloClient
559
+ }, options));
560
+ }
561
+ function MakeswiftProvider({
562
+ client: client2,
563
+ children
564
+ }) {
565
+ return /* @__PURE__ */ jsxRuntime.jsx(Context$2.Provider, {
566
+ value: client2,
567
+ children
568
+ });
569
+ }
570
+ function is(x, y) {
571
+ if (x === y)
572
+ return x !== 0 || y !== 0 || 1 / x === 1 / y;
573
+ return x !== x && y !== y;
574
+ }
575
+ const { hasOwnProperty: hasOwnProperty$1 } = Object.prototype;
576
+ const shallowEqual = (a, b) => {
577
+ if (is(a, b))
578
+ return true;
579
+ if (typeof a !== "object" || a === null || typeof b !== "object" || b === null)
580
+ return false;
581
+ const keysA = Object.keys(a);
582
+ const keysB = Object.keys(b);
583
+ if (keysA.length !== keysB.length)
584
+ return false;
585
+ for (let i = 0; i < keysA.length; i += 1) {
586
+ if (!hasOwnProperty$1.call(b, keysA[i]) || !is(a[keysA[i]], b[keysA[i]]))
587
+ return false;
588
+ }
589
+ return true;
590
+ };
591
+ const { hasOwnProperty } = Object.prototype;
592
+ const deepEqual = (a, b) => {
593
+ if (shallowEqual(a, b))
594
+ return true;
595
+ if (typeof a !== "object" || a === null || typeof b !== "object" || b === null)
596
+ return false;
597
+ const keysA = Object.keys(a);
598
+ const keysB = Object.keys(b);
599
+ if (keysA.length !== keysB.length)
600
+ return false;
601
+ for (let i = 0; i < keysA.length; i += 1) {
602
+ if (!hasOwnProperty.call(b, keysA[i]) || !deepEqual(a[keysA[i]], b[keysA[i]]))
603
+ return false;
604
+ }
605
+ return true;
606
+ };
607
+ const SnippetLocation = {
608
+ Body: "BODY",
609
+ Head: "HEAD"
610
+ };
611
+ const defaultFavicon = {
612
+ mimetype: "image/png",
613
+ publicUrl: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACIAAAAiCAYAAAA6RwvCAAAACXBIWXMAABcRAAAXEQHKJvM/AAABjElEQVRYhc2XzU3EMBCFB8TddAAXn6EE6GCpgNABZ1/IXnymBOgAOmA7YM8+ABVsXEHQQFaKQryeN3Yk3ilKJtEnv/nLUd/3pFG0riGi88yrnQn+UfJ5FUi0riWiB2H4nQn+KRd0DFP8agXEfkqCYJBoHdtxIQxfm+DfFgEhoith3NYE30o/qgGR2BJB+xY7kdYEL8oNFUi0jiFMJuxVWrJqEMFxsyUNCsE6AeNztvBp7aJ143vXksoRnwhYtmNdSoIQa6RlO9YXEWW7KgoCleOgxgTf1QZBT+RZ2lXFING6UxCCq+ceeUE8fYdknY599v9sJvzGBP+yCEgC7GPmETc0OJ+0awAlkhe2pAbIXAeFZ8xe2g2Nk3c3ub0xwWt6zY9qbmiqGVMbZK21ZC/YmhlbeBMTzZNDQqcvDb1kM1x32iqZSt1HaqukfKvq34BAOTLsrH+ETNmUkKHHA+428RgeclPVWozeSyAI2EdWB34jtqXNTAySOY3i/KgFIlqOa4GkFmBegorzg4joG07he/M7zl6jAAAAAElFTkSuQmCC"
614
+ };
615
+ const VALID_TAG_REGEX = /^[a-zA-Z][a-zA-Z:_.\-\d]*$/;
616
+ const VALID_HEAD_ELEMENT_TYPES = ["title", "base", "link", "style", "meta", "script", "noscript", "template"];
617
+ function snippetToElement(snippet) {
618
+ return React.Children.map(parse__default["default"](snippet.code), (element) => {
619
+ if (typeof element === "string")
620
+ return element;
621
+ if (!VALID_TAG_REGEX.test(element.type))
622
+ return null;
623
+ const key = element.key ? `${snippet.id}:${element.key}` : snippet.id;
624
+ return React.createElement(element.type, __spreadProps(__spreadValues({}, element.props), {
625
+ key
626
+ }));
627
+ });
628
+ }
629
+ const filterUsedSnippetProperties = ({
630
+ code,
631
+ builderEnabled,
632
+ liveEnabled,
633
+ location,
634
+ cleanup
635
+ }) => ({
636
+ code,
637
+ builderEnabled,
638
+ liveEnabled,
639
+ location,
640
+ cleanup
641
+ });
642
+ const PAGE_SNIPPETS_QUERY = client.gql`
643
+ query PageById($id: ID!) {
644
+ page(id: $id) {
645
+ __typename
646
+ id
647
+ snippets {
648
+ __typename
649
+ id
650
+ name
651
+ code
652
+ cleanup
653
+ location
654
+ shouldAddToNewPages
655
+ liveEnabled
656
+ builderEnabled
657
+ }
658
+ }
659
+ }
660
+ `;
661
+ const SITE_FONTS_QUERY = client.gql`
662
+ query SiteById($id: ID!) {
663
+ site(id: $id) {
664
+ id
665
+ googleFonts {
666
+ edges {
667
+ activeVariants {
668
+ specifier
669
+ }
670
+ node {
671
+ family
672
+ variants {
673
+ specifier
674
+ }
675
+ }
676
+ }
677
+ }
678
+ }
679
+ }
680
+ `;
681
+ function Page({
682
+ document: page
683
+ }) {
684
+ var _a;
685
+ const isInBuilder = useIsInBuilder();
686
+ const [snippets, setSnippets] = React.useState(page.snippets);
687
+ useQuery(PAGE_SNIPPETS_QUERY, {
688
+ variables: {
689
+ id: page.id
690
+ },
691
+ skip: isInBuilder === false,
692
+ fetchPolicy: "cache-only",
693
+ onCompleted(data) {
694
+ if (data == null)
695
+ return;
696
+ const oldSnippets = snippets.map(filterUsedSnippetProperties);
697
+ const newSnippets = data.page.snippets.map(filterUsedSnippetProperties);
698
+ if (deepEqual(newSnippets, oldSnippets))
699
+ return;
700
+ setSnippets(data.page.snippets);
701
+ }
702
+ });
703
+ const {
704
+ data: siteData
705
+ } = useQuery(SITE_FONTS_QUERY, {
706
+ variables: {
707
+ id: page.site.id
708
+ },
709
+ skip: isInBuilder === false,
710
+ fetchPolicy: "cache-only"
711
+ });
712
+ const favicon = (_a = page.meta.favicon) != null ? _a : defaultFavicon;
713
+ const {
714
+ title,
715
+ description,
716
+ keywords,
717
+ socialImage
718
+ } = page.meta;
719
+ const {
720
+ canonicalUrl,
721
+ isIndexingBlocked
722
+ } = page.seo;
723
+ const fontFamilyParamValue = React.useMemo(() => {
724
+ if ((siteData == null ? void 0 : siteData.site) == null) {
725
+ return page.fonts.map(({
726
+ family,
727
+ variants
728
+ }) => {
729
+ return `${family.replace(/ /g, "+")}:${variants.join()}`;
730
+ }).join("|");
731
+ }
732
+ return siteData.site.googleFonts.edges.filter((edge) => edge != null).map(({
733
+ activeVariants,
734
+ node: {
735
+ family,
736
+ variants
737
+ }
738
+ }) => {
739
+ const activeVariantSpecifiers = variants.filter((variant) => activeVariants.some((activeVariant) => activeVariant.specifier === variant.specifier)).map((variant) => variant.specifier).join();
740
+ return `${family.replace(/ /g, "+")}:${activeVariantSpecifiers}`;
741
+ }).join("|");
742
+ }, [siteData, page]);
743
+ const filteredSnippets = React.useMemo(() => snippets.filter((snippet) => isInBuilder ? snippet.builderEnabled : snippet.liveEnabled), [snippets, isInBuilder]);
744
+ const headSnippets = React.useMemo(() => filteredSnippets.filter((snippet) => snippet.location === SnippetLocation.Head), [filteredSnippets]);
745
+ const previousHeadSnippets = React.useRef(null);
746
+ React.useEffect(() => {
747
+ var _a2;
748
+ const headSnippetsToCleanUp = ((_a2 = previousHeadSnippets.current) != null ? _a2 : []).filter((previousSnippet) => previousSnippet.cleanup != null).filter((previousSnippet) => !headSnippets.some((snippet) => previousSnippet.id === snippet.id));
749
+ headSnippetsToCleanUp.forEach((snippetToCleanUp) => {
750
+ if (snippetToCleanUp.cleanup == null)
751
+ return;
752
+ const cleanUp = new Function(snippetToCleanUp.cleanup);
753
+ try {
754
+ cleanUp();
755
+ } catch {
756
+ }
757
+ });
758
+ previousHeadSnippets.current = headSnippets;
759
+ }, [headSnippets]);
760
+ return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, {
761
+ children: [/* @__PURE__ */ jsxRuntime.jsxs(Head__default["default"], {
762
+ children: [/* @__PURE__ */ jsxRuntime.jsx("style", {
763
+ children: `
764
+ html {
765
+ font-family: sans-serif;
766
+ }
767
+ div#__next {
768
+ overflow: hidden;
769
+ }
770
+ `
771
+ }), /* @__PURE__ */ jsxRuntime.jsx("link", {
772
+ rel: "icon",
773
+ type: favicon.mimetype,
774
+ href: favicon.publicUrl
775
+ }), canonicalUrl && /* @__PURE__ */ jsxRuntime.jsx("link", {
776
+ rel: "canonical",
777
+ href: canonicalUrl
778
+ }), isIndexingBlocked && /* @__PURE__ */ jsxRuntime.jsx("meta", {
779
+ name: "robots",
780
+ content: "noindex"
781
+ }), title && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, {
782
+ children: [/* @__PURE__ */ jsxRuntime.jsx("title", {
783
+ children: title
784
+ }), /* @__PURE__ */ jsxRuntime.jsx("meta", {
785
+ property: "og:title",
786
+ content: title
787
+ }), /* @__PURE__ */ jsxRuntime.jsx("meta", {
788
+ name: "twitter:title",
789
+ content: title
790
+ }), /* @__PURE__ */ jsxRuntime.jsx("meta", {
791
+ itemProp: "name",
792
+ content: title
793
+ })]
794
+ }), description && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, {
795
+ children: [/* @__PURE__ */ jsxRuntime.jsx("meta", {
796
+ name: "description",
797
+ content: description
798
+ }), /* @__PURE__ */ jsxRuntime.jsx("meta", {
799
+ property: "og:description",
800
+ content: description
801
+ }), /* @__PURE__ */ jsxRuntime.jsx("meta", {
802
+ name: "twitter:description",
803
+ content: description
804
+ }), /* @__PURE__ */ jsxRuntime.jsx("meta", {
805
+ itemProp: "description",
806
+ content: description
807
+ })]
808
+ }), keywords && /* @__PURE__ */ jsxRuntime.jsx("meta", {
809
+ name: "keywords",
810
+ content: keywords
811
+ }), socialImage && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, {
812
+ children: [/* @__PURE__ */ jsxRuntime.jsx("meta", {
813
+ property: "og:image",
814
+ content: socialImage.publicUrl
815
+ }), /* @__PURE__ */ jsxRuntime.jsx("meta", {
816
+ property: "og:image:type",
817
+ content: socialImage.mimetype
818
+ }), /* @__PURE__ */ jsxRuntime.jsx("meta", {
819
+ name: "twitter:image",
820
+ content: socialImage.publicUrl
821
+ }), /* @__PURE__ */ jsxRuntime.jsx("meta", {
822
+ name: "twitter:card",
823
+ content: "summary_large_image"
824
+ }), /* @__PURE__ */ jsxRuntime.jsx("meta", {
825
+ itemProp: "image",
826
+ content: socialImage.publicUrl
827
+ })]
828
+ }), fontFamilyParamValue !== "" && /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, {
829
+ children: /* @__PURE__ */ jsxRuntime.jsx("link", {
830
+ rel: "stylesheet",
831
+ href: `https://fonts.googleapis.com/css?family=${fontFamilyParamValue}&display=swap`
832
+ })
833
+ }), headSnippets.map(snippetToElement).map((children) => React.Children.map(children, (child) => {
834
+ if (typeof child === "string")
835
+ return child;
836
+ if (VALID_HEAD_ELEMENT_TYPES.includes(child.type))
837
+ return child;
838
+ return null;
839
+ }))]
840
+ }), /* @__PURE__ */ jsxRuntime.jsx(DocumentReference, {
841
+ documentReference: reactPage.createDocumentReference(page.id)
842
+ }), filteredSnippets.filter((snippet) => snippet.location === SnippetLocation.Body).map((snippet) => /* @__PURE__ */ jsxRuntime.jsx(BodySnippet, {
843
+ code: snippet.code,
844
+ cleanup: snippet.cleanup
845
+ }, snippet.id))]
846
+ });
847
+ }
848
+ const FORWARDED_NEXT_DYNAMIC_REF_KEY = "__forwarded_next_dynamic_ref__";
849
+ function saveForwardedRef(props, ref) {
850
+ return __spreadProps(__spreadValues({}, props), {
851
+ [FORWARDED_NEXT_DYNAMIC_REF_KEY]: ref
852
+ });
853
+ }
854
+ function loadForwardedRef(_a) {
855
+ var _b = _a, {
856
+ [FORWARDED_NEXT_DYNAMIC_REF_KEY]: ref
857
+ } = _b, props = __objRest(_b, [
858
+ __restKey(FORWARDED_NEXT_DYNAMIC_REF_KEY)
859
+ ]);
860
+ return __spreadProps(__spreadValues({}, props), {
861
+ ref
862
+ });
863
+ }
864
+ function resolve(obj) {
865
+ return obj && obj.__esModule ? obj.default : obj;
866
+ }
867
+ function forwardNextDynamicRef(nextDynamicThunk) {
868
+ const Dynamic = nextDynamicThunk((loaderComponent) => loaderComponent.then((moduleOrComponent) => ({
869
+ __esModule: true,
870
+ default: (props) => React.createElement(resolve(moduleOrComponent), loadForwardedRef(props))
871
+ })));
872
+ return React.forwardRef((props, ref) => /* @__PURE__ */ jsxRuntime.jsx(Dynamic, __spreadValues({}, saveForwardedRef(props, ref))));
873
+ }
874
+ const keys = (o) => Object.keys(o);
875
+ const coalesce = (...args) => {
876
+ let i;
877
+ for (i = 0; i < args.length - 1; i += 1) {
878
+ if (args[i] != null)
879
+ return args[i];
880
+ }
881
+ return args[i];
882
+ };
883
+ function shallowMerge(a, b) {
884
+ const bKeys = keys(b);
885
+ const merged = __spreadValues({}, a);
886
+ bKeys.forEach((key) => {
887
+ merged[key] = coalesce(merged[key], b[key]);
888
+ });
889
+ return merged;
890
+ }
891
+ const DEVICES = [
892
+ { id: "desktop", minWidth: 769 },
893
+ { id: "tablet", minWidth: 576, maxWidth: 768 },
894
+ { id: "mobile", maxWidth: 575 }
895
+ ];
896
+ const getDevice = (deviceId) => {
897
+ const device = DEVICES.find(({ id }) => id === deviceId);
898
+ if (device == null)
899
+ throw new Error(`Unrecognized device ID: "${deviceId}".`);
900
+ return device;
901
+ };
902
+ function defaultStrategy(value, fallbacks) {
903
+ return value || fallbacks[0];
904
+ }
905
+ function shallowMergeFallbacks(value, fallbacks) {
906
+ return [value, ...fallbacks].filter((override) => Boolean(override)).reduce((a, b) => ({
907
+ deviceId: a.deviceId || b.deviceId,
908
+ value: shallowMerge(a.value, b.value)
909
+ }));
910
+ }
911
+ function findDeviceOverride(values = [], deviceId, strategy = defaultStrategy) {
912
+ const value = values.find(({ deviceId: d }) => d === deviceId);
913
+ const fallbacks = DEVICES.slice(0, DEVICES.findIndex((d) => d.id === deviceId) + 1).reverse().map((d) => values.find((v) => v.deviceId === d.id)).filter((override) => Boolean(override));
914
+ return value != null || fallbacks.length > 0 ? strategy(value, fallbacks) : void 0;
915
+ }
916
+ function join(responsiveValues, joinFn, strategy) {
917
+ return DEVICES.map(({ id }) => id).map((deviceId) => {
918
+ const value = joinFn(responsiveValues.map((responsiveValue) => {
919
+ const deviceValue = responsiveValue && findDeviceOverride(responsiveValue, deviceId, strategy);
920
+ return deviceValue == null ? void 0 : deviceValue.value;
921
+ }));
922
+ if (value == null)
923
+ return null;
924
+ return { deviceId, value };
925
+ }).filter((override) => Boolean(override));
926
+ }
927
+ const getDeviceMediaQuery = (device) => {
928
+ const parts = ["@media only screen"];
929
+ if (device.minWidth != null) {
930
+ parts.push(`(min-width: ${device.minWidth}px)`);
931
+ }
932
+ if (device.maxWidth != null) {
933
+ parts.push(`(max-width: ${device.maxWidth}px)`);
934
+ }
935
+ return parts.join(" and ");
936
+ };
937
+ const MakeswiftComponentType = {
938
+ Box: "./components/Box/index.js",
939
+ Button: "./components/Button/index.js",
940
+ Carousel: "./components/Carousel/index.js",
941
+ Countdown: "./components/Countdown/index.js",
942
+ Divider: "./components/Divider/index.js",
943
+ Embed: "./components/Embed/index.js",
944
+ Form: "./components/Form/index.js",
945
+ Image: "./components/Image/index.js",
946
+ Navigation: "./components/Navigation/index.js",
947
+ Root: "./components/Root/index.js",
948
+ SocialLinks: "./components/SocialLinks/index.js",
949
+ Text: "./components/Text/index.js",
950
+ Video: "./components/Video/index.js"
951
+ };
952
+ const DEFAULT_BOX_ANIMATE_TYPE = "none";
953
+ const DEFAULT_BOX_ANIMATE_DELAY = 0;
954
+ const DEFAULT_BOX_ANIMATE_DURATION = 0.75;
955
+ const DEFAULT_ITEM_ANIMATE_TYPE = "none";
956
+ const DEFAULT_ITEM_ANIMATE_DELAY = 0;
957
+ const DEFAULT_ITEM_ANIMATE_DURATION = 0.75;
958
+ const DEFAULT_ITEM_STAGGER_DURATION = 0;
959
+ function registerComponent$c(runtime) {
960
+ function isHiddenBasedOnAnimationType(props, deviceId, property) {
961
+ var _a, _b;
962
+ const animateIn = props[property];
963
+ return ((_b = (_a = findDeviceOverride(animateIn, deviceId)) == null ? void 0 : _a.value) != null ? _b : "none") === "none";
964
+ }
965
+ const isHiddenBasedOnBoxAnimation = (props, deviceId) => isHiddenBasedOnAnimationType(props, deviceId, "boxAnimateType");
966
+ const isHiddenBasedOnItemAnimation = (props, deviceId) => isHiddenBasedOnAnimationType(props, deviceId, "itemAnimateType");
967
+ return runtime.registerComponent(forwardNextDynamicRef((patch) => dynamic__default["default"](() => patch(Promise.resolve().then(function() {
968
+ return require("./Box.cjs.js");
969
+ })))), {
970
+ type: MakeswiftComponentType.Box,
971
+ label: "Box",
972
+ props: {
973
+ id: image.ElementID(),
974
+ backgrounds: image.Backgrounds(),
975
+ width: image.Width(),
976
+ height: image.ResponsiveIconRadioGroup({
977
+ label: "Height",
978
+ options: [
979
+ { value: "auto", label: "Auto", icon: "HeightAuto16" },
980
+ { value: "stretch", label: "Stretch", icon: "HeightMatch16" }
981
+ ],
982
+ defaultValue: "auto"
983
+ }),
984
+ verticalAlign: image.ResponsiveIconRadioGroup({
985
+ label: "Align items",
986
+ options: [
987
+ { value: "flex-start", label: "Top", icon: "VerticalAlignStart16" },
988
+ { value: "center", label: "Middle", icon: "VerticalAlignMiddle16" },
989
+ { value: "flex-end", label: "Bottom", icon: "VerticalAlignEnd16" },
990
+ {
991
+ value: "space-between",
992
+ label: "Space between",
993
+ icon: "VerticalAlignSpaceBetween16"
994
+ }
995
+ ],
996
+ defaultValue: "flex-start"
997
+ }),
998
+ margin: image.Margin(),
999
+ padding: image.Padding({
1000
+ preset: [
1001
+ {
1002
+ deviceId: "desktop",
1003
+ value: {
1004
+ paddingTop: { value: 10, unit: "px" },
1005
+ paddingRight: { value: 10, unit: "px" },
1006
+ paddingBottom: { value: 10, unit: "px" },
1007
+ paddingLeft: { value: 10, unit: "px" }
1008
+ }
1009
+ }
1010
+ ]
1011
+ }),
1012
+ border: image.Border(),
1013
+ borderRadius: image.BorderRadius(),
1014
+ boxShadow: image.Shadows(),
1015
+ rowGap: image.GapY((props) => ({
1016
+ hidden: props.children == null
1017
+ })),
1018
+ columnGap: image.GapX((props) => ({
1019
+ hidden: props.children == null
1020
+ })),
1021
+ boxAnimateType: image.ResponsiveSelect({
1022
+ label: "Animate box in",
1023
+ labelOrientation: "vertical",
1024
+ options: [
1025
+ { value: "none", label: "None" },
1026
+ { value: "fadeIn", label: "Fade in" },
1027
+ { value: "fadeRight", label: "Fade right" },
1028
+ { value: "fadeDown", label: "Fade down" },
1029
+ { value: "fadeLeft", label: "Fade left" },
1030
+ { value: "fadeUp", label: "Fade up" },
1031
+ { value: "blurIn", label: "Blur in" },
1032
+ { value: "scaleUp", label: "Scale up" },
1033
+ { value: "scaleDown", label: "Scale down" }
1034
+ ],
1035
+ defaultValue: "none"
1036
+ }),
1037
+ boxAnimateDuration: image.ResponsiveNumber((props, device) => ({
1038
+ label: "Box duration",
1039
+ defaultValue: DEFAULT_BOX_ANIMATE_DURATION,
1040
+ min: 0.1,
1041
+ step: 0.05,
1042
+ suffix: "s",
1043
+ hidden: isHiddenBasedOnBoxAnimation(props, device)
1044
+ })),
1045
+ boxAnimateDelay: image.ResponsiveNumber((props, device) => ({
1046
+ label: "Box delay",
1047
+ defaultValue: DEFAULT_BOX_ANIMATE_DELAY,
1048
+ min: 0,
1049
+ step: 0.05,
1050
+ suffix: "s",
1051
+ hidden: isHiddenBasedOnBoxAnimation(props, device)
1052
+ })),
1053
+ itemAnimateType: image.ResponsiveSelect({
1054
+ label: "Animate items in",
1055
+ labelOrientation: "vertical",
1056
+ options: [
1057
+ { value: "none", label: "None" },
1058
+ { value: "fadeIn", label: "Fade in" },
1059
+ { value: "fadeRight", label: "Fade right" },
1060
+ { value: "fadeDown", label: "Fade down" },
1061
+ { value: "fadeLeft", label: "Fade left" },
1062
+ { value: "fadeUp", label: "Fade up" },
1063
+ { value: "blurIn", label: "Blur in" },
1064
+ { value: "scaleUp", label: "Scale up" },
1065
+ { value: "scaleDown", label: "Scale down" }
1066
+ ],
1067
+ defaultValue: "none"
1068
+ }),
1069
+ itemAnimateDuration: image.ResponsiveNumber((props, device) => ({
1070
+ label: "Items duration",
1071
+ defaultValue: DEFAULT_BOX_ANIMATE_DURATION,
1072
+ min: 0.1,
1073
+ step: 0.05,
1074
+ suffix: "s",
1075
+ hidden: isHiddenBasedOnItemAnimation(props, device)
1076
+ })),
1077
+ itemAnimateDelay: image.ResponsiveNumber((props, device) => ({
1078
+ label: "Items delay",
1079
+ defaultValue: DEFAULT_ITEM_ANIMATE_DELAY,
1080
+ min: 0,
1081
+ step: 0.05,
1082
+ suffix: "s",
1083
+ hidden: isHiddenBasedOnItemAnimation(props, device)
1084
+ })),
1085
+ itemStaggerDuration: image.ResponsiveNumber((props, device) => ({
1086
+ label: "Stagger",
1087
+ min: 0,
1088
+ step: 0.05,
1089
+ suffix: "s",
1090
+ defaultValue: DEFAULT_ITEM_STAGGER_DURATION,
1091
+ hidden: isHiddenBasedOnItemAnimation(props, device)
1092
+ })),
1093
+ hidePlaceholder: image.Checkbox((props) => ({
1094
+ label: "Hide placeholder",
1095
+ hidden: props.children != null
1096
+ })),
1097
+ children: image.Grid()
1098
+ }
1099
+ });
1100
+ }
1101
+ function registerComponent$b(runtime) {
1102
+ return runtime.registerComponent(forwardNextDynamicRef((patch) => dynamic__default["default"](() => patch(Promise.resolve().then(function() {
1103
+ return require("./Button.cjs.js");
1104
+ })))), {
1105
+ type: MakeswiftComponentType.Button,
1106
+ label: "Button",
1107
+ props: {
1108
+ id: image.ElementID(),
1109
+ children: image.TextInput({ placeholder: "Button text" }),
1110
+ link: image.Link({
1111
+ defaultValue: {
1112
+ type: "OPEN_PAGE",
1113
+ payload: {
1114
+ pageId: null,
1115
+ openInNewTab: false
1116
+ }
1117
+ }
1118
+ }),
1119
+ variant: image.ResponsiveSelect({
1120
+ label: "Style",
1121
+ labelOrientation: "horizontal",
1122
+ options: [
1123
+ { value: "flat", label: "Flat" },
1124
+ { value: "outline", label: "Outline" },
1125
+ { value: "shadow", label: "Floating" },
1126
+ { value: "clear", label: "Clear" },
1127
+ { value: "blocky", label: "Blocky" },
1128
+ { value: "bubbly", label: "Bubbly" },
1129
+ { value: "skewed", label: "Skewed" }
1130
+ ],
1131
+ defaultValue: "flat"
1132
+ }),
1133
+ shape: image.ResponsiveIconRadioGroup({
1134
+ label: "Shape",
1135
+ options: [
1136
+ { label: "Pill", value: "pill", icon: "ButtonPill16" },
1137
+ { label: "Rounded", value: "rounded", icon: "ButtonRounded16" },
1138
+ { label: "Square", value: "square", icon: "ButtonSquare16" }
1139
+ ],
1140
+ defaultValue: "rounded"
1141
+ }),
1142
+ size: image.ResponsiveIconRadioGroup({
1143
+ label: "Size",
1144
+ options: [
1145
+ { label: "Small", value: "small", icon: "SizeSmall16" },
1146
+ { label: "Medium", value: "medium", icon: "SizeMedium16" },
1147
+ { label: "Large", value: "large", icon: "SizeLarge16" }
1148
+ ],
1149
+ defaultValue: "medium"
1150
+ }),
1151
+ color: image.ResponsiveColor((props, device) => {
1152
+ var _a;
1153
+ const variant = props.variant;
1154
+ const hidden = ((_a = findDeviceOverride(variant, device)) == null ? void 0 : _a.value) === "clear";
1155
+ return { placeholder: "black", hidden };
1156
+ }),
1157
+ textColor: image.ResponsiveColor({
1158
+ label: "Text color",
1159
+ placeholder: "white"
1160
+ }),
1161
+ textStyle: image.TextStyle(),
1162
+ width: image.Width(),
1163
+ margin: image.Margin()
1164
+ }
1165
+ });
1166
+ }
1167
+ function registerComponent$a(runtime) {
1168
+ return runtime.registerComponent(forwardNextDynamicRef((patch) => dynamic__default["default"](() => patch(Promise.resolve().then(function() {
1169
+ return require("./Carousel.cjs.js");
1170
+ })))), {
1171
+ type: MakeswiftComponentType.Carousel,
1172
+ label: "Carousel",
1173
+ icon: "Carousel40",
1174
+ props: {
1175
+ id: image.ElementID(),
1176
+ images: image.Images({
1177
+ preset: [
1178
+ { key: uuid__default["default"](), props: {} },
1179
+ { key: uuid__default["default"](), props: {} },
1180
+ { key: uuid__default["default"](), props: {} }
1181
+ ]
1182
+ }),
1183
+ width: image.Width({ defaultValue: { value: 400, unit: "px" } }),
1184
+ margin: image.Margin(),
1185
+ pageSize: image.ResponsiveNumber((props) => {
1186
+ var _a;
1187
+ const images = props.images;
1188
+ const imagesLength = (_a = images == null ? void 0 : images.length) != null ? _a : 0;
1189
+ return {
1190
+ label: "Images shown",
1191
+ defaultValue: 1,
1192
+ min: 1,
1193
+ max: imagesLength,
1194
+ step: 1
1195
+ };
1196
+ }),
1197
+ step: image.ResponsiveNumber((props, device) => {
1198
+ var _a, _b;
1199
+ const pageSize = props.pageSize;
1200
+ const pageSizeValue = (_b = (_a = findDeviceOverride(pageSize, device)) == null ? void 0 : _a.value) != null ? _b : 1;
1201
+ return {
1202
+ label: "Step",
1203
+ defaultValue: 1,
1204
+ min: 1,
1205
+ max: pageSizeValue,
1206
+ step: 1
1207
+ };
1208
+ }),
1209
+ slideAlignment: image.ResponsiveIconRadioGroup({
1210
+ label: "Alignment",
1211
+ options: [
1212
+ { label: "Top", value: "flex-start", icon: "VerticalAlignStart16" },
1213
+ { label: "Middle", value: "center", icon: "VerticalAlignMiddle16" },
1214
+ { label: "Bottom", value: "flex-end", icon: "VerticalAlignEnd16" }
1215
+ ],
1216
+ defaultValue: "center"
1217
+ }),
1218
+ gap: image.GapX({
1219
+ label: "Gap",
1220
+ step: 5,
1221
+ defaultValue: { value: 0, unit: "px" }
1222
+ }),
1223
+ autoplay: image.Checkbox({ label: "Autoplay" }),
1224
+ delay: image.Number((props) => ({
1225
+ label: "Delay",
1226
+ preset: 5,
1227
+ min: 1,
1228
+ step: 0.1,
1229
+ suffix: "seconds",
1230
+ hidden: !props.autoplay
1231
+ })),
1232
+ showArrows: image.Checkbox({ preset: true, label: "Show arrows" }),
1233
+ arrowPosition: image.ResponsiveIconRadioGroup((props) => ({
1234
+ label: "Arrow position",
1235
+ options: [
1236
+ { label: "Inside", value: "inside", icon: "ArrowInside16" },
1237
+ { label: "Center", value: "center", icon: "ArrowCenter16" },
1238
+ { label: "Outside", value: "outside", icon: "ArrowOutside16" }
1239
+ ],
1240
+ defaultValue: "inside",
1241
+ hidden: props.showArrows === false
1242
+ })),
1243
+ arrowColor: image.ResponsiveColor((props) => ({
1244
+ label: "Arrow color",
1245
+ placeholder: "black",
1246
+ hidden: props.showArrows === false
1247
+ })),
1248
+ arrowBackground: image.ResponsiveColor((props) => ({
1249
+ label: "Arrow background",
1250
+ placeholder: "white",
1251
+ hidden: props.showArrows === false
1252
+ })),
1253
+ showDots: image.Checkbox({ preset: true, label: "Show dots" }),
1254
+ dotColor: image.ResponsiveColor((props) => ({
1255
+ label: "Dot color",
1256
+ placeholder: "black",
1257
+ hidden: props.showDots === false
1258
+ })),
1259
+ slideBorder: image.Border(),
1260
+ slideBorderRadius: image.BorderRadius()
1261
+ }
1262
+ });
1263
+ }
1264
+ function registerComponent$9(runtime) {
1265
+ return runtime.registerComponent(forwardNextDynamicRef((patch) => dynamic__default["default"](() => patch(Promise.resolve().then(function() {
1266
+ return require("./Countdown.cjs.js");
1267
+ })))), {
1268
+ type: MakeswiftComponentType.Countdown,
1269
+ label: "Countdown",
1270
+ icon: "Countdown40",
1271
+ props: {
1272
+ id: image.ElementID(),
1273
+ date: image.Date(() => ({
1274
+ preset: new Date(Date.now() + 1e3 * 60 * 60 * 24 * 2).toISOString()
1275
+ })),
1276
+ variant: image.ResponsiveIconRadioGroup({
1277
+ label: "Style",
1278
+ options: [
1279
+ { label: "Filled", value: "filled", icon: "CountdownSolid16" },
1280
+ {
1281
+ label: "Filled split",
1282
+ value: "filled-split",
1283
+ icon: "CountdownSolidSplit16"
1284
+ },
1285
+ { label: "Outline", value: "outline", icon: "CountdownOutline16" },
1286
+ {
1287
+ label: "Outline split",
1288
+ value: "outline-split",
1289
+ icon: "CountdownOutlineSplit16"
1290
+ },
1291
+ { label: "Clear", value: "clear", icon: "CountdownNaked16" }
1292
+ ],
1293
+ defaultValue: "filled"
1294
+ }),
1295
+ shape: image.ResponsiveIconRadioGroup({
1296
+ label: "Shape",
1297
+ options: [
1298
+ { label: "Pill", value: "pill", icon: "ButtonPill16" },
1299
+ { label: "Rounded", value: "rounded", icon: "ButtonRounded16" },
1300
+ { label: "Square", value: "square", icon: "ButtonSquare16" }
1301
+ ],
1302
+ defaultValue: "rounded"
1303
+ }),
1304
+ size: image.ResponsiveIconRadioGroup({
1305
+ label: "Size",
1306
+ options: [
1307
+ { label: "Small", value: "small", icon: "SizeSmall16" },
1308
+ { label: "Medium", value: "medium", icon: "SizeMedium16" },
1309
+ { label: "Large", value: "large", icon: "SizeLarge16" }
1310
+ ],
1311
+ defaultValue: "medium"
1312
+ }),
1313
+ gap: image.GapX({
1314
+ preset: [{ deviceId: "desktop", value: { value: 10, unit: "px" } }],
1315
+ label: "Gap",
1316
+ step: 1,
1317
+ min: 0,
1318
+ max: 100,
1319
+ defaultValue: { value: 0, unit: "px" }
1320
+ }),
1321
+ numberFont: image.Font({ label: "Number font" }),
1322
+ numberColor: image.ResponsiveColor({
1323
+ label: "Number color",
1324
+ placeholder: "white"
1325
+ }),
1326
+ blockColor: image.ResponsiveColor({
1327
+ label: "Block color",
1328
+ placeholder: "black"
1329
+ }),
1330
+ labelFont: image.Font({ label: "Label font" }),
1331
+ labelColor: image.ResponsiveColor({
1332
+ label: "Label color",
1333
+ placeholder: "black"
1334
+ }),
1335
+ width: image.Width({ defaultValue: { value: 560, unit: "px" } }),
1336
+ margin: image.Margin(),
1337
+ daysLabel: image.TextInput({ label: "Days label", placeholder: "Days" }),
1338
+ hoursLabel: image.TextInput({ label: "Hours label", placeholder: "Hours" }),
1339
+ minutesLabel: image.TextInput({
1340
+ label: "Minutes label",
1341
+ placeholder: "Minutes"
1342
+ }),
1343
+ secondsLabel: image.TextInput({
1344
+ label: "Seconds label",
1345
+ placeholder: "Seconds"
1346
+ })
1347
+ }
1348
+ });
1349
+ }
1350
+ function registerComponent$8(runtime) {
1351
+ return runtime.registerComponent(forwardNextDynamicRef((patch) => dynamic__default["default"](() => patch(Promise.resolve().then(function() {
1352
+ return require("./Divider.cjs.js");
1353
+ })))), {
1354
+ type: MakeswiftComponentType.Divider,
1355
+ label: "Divider",
1356
+ icon: "Divider40",
1357
+ props: {
1358
+ id: image.ElementID(),
1359
+ variant: image.ResponsiveSelect({
1360
+ label: "Style",
1361
+ labelOrientation: "horizontal",
1362
+ options: [
1363
+ { value: "solid", label: "Solid" },
1364
+ { value: "dashed", label: "Dashed" },
1365
+ { value: "dotted", label: "Dotted" },
1366
+ { value: "blended", label: "Blended" }
1367
+ ],
1368
+ defaultValue: "solid"
1369
+ }),
1370
+ thickness: image.ResponsiveLength({
1371
+ label: "Height",
1372
+ defaultValue: { value: 1, unit: "px" },
1373
+ options: [{ value: "px", label: "Pixels", icon: "Px16" }]
1374
+ }),
1375
+ color: image.ResponsiveColor({ placeholder: "black" }),
1376
+ width: image.Width({ defaultValue: { value: 100, unit: "%" } }),
1377
+ margin: image.Margin()
1378
+ }
1379
+ });
1380
+ }
1381
+ function registerComponent$7(runtime) {
1382
+ return runtime.registerComponent(forwardNextDynamicRef((patch) => dynamic__default["default"](() => patch(Promise.resolve().then(function() {
1383
+ return require("./Embed.cjs.js");
1384
+ })))), {
1385
+ type: MakeswiftComponentType.Embed,
1386
+ label: "Embed",
1387
+ icon: "Code40",
1388
+ props: {
1389
+ id: image.ElementID(),
1390
+ html: image.TextArea({ label: "Code", rows: 20 }),
1391
+ width: image.Width({}),
1392
+ margin: image.Margin()
1393
+ }
1394
+ });
1395
+ }
1396
+ const Alignments = {
1397
+ LEFT: "left",
1398
+ CENTER: "center",
1399
+ RIGHT: "right"
1400
+ };
1401
+ const Shapes = Object.freeze({
1402
+ SQUARE: "square",
1403
+ ROUNDED: "rounded",
1404
+ PILL: "pill"
1405
+ });
1406
+ const Sizes = Object.freeze({
1407
+ SMALL: "small",
1408
+ MEDIUM: "medium",
1409
+ LARGE: "large"
1410
+ });
1411
+ const Contrasts = Object.freeze({
1412
+ LIGHT: "light",
1413
+ DARK: "dark"
1414
+ });
1415
+ const Context$1 = React.createContext({});
1416
+ function useFormContext() {
1417
+ return React.useContext(Context$1);
1418
+ }
1419
+ const { Provider } = Context$1;
1420
+ function registerComponent$6(runtime) {
1421
+ return runtime.registerComponent(forwardNextDynamicRef((patch) => dynamic__default["default"](() => patch(Promise.resolve().then(function() {
1422
+ return require("./Form.cjs.js");
1423
+ })))), {
1424
+ type: MakeswiftComponentType.Form,
1425
+ label: "Form",
1426
+ icon: "Form40",
1427
+ props: {
1428
+ id: image.ElementID(),
1429
+ tableId: image.Table(),
1430
+ fields: image.TableFormFields(),
1431
+ submitLink: image.Link((props) => ({
1432
+ label: "Redirect to",
1433
+ options: [
1434
+ { value: "OPEN_PAGE", label: "Open page" },
1435
+ { value: "OPEN_URL", label: "Open URL" }
1436
+ ],
1437
+ hidden: props.tableId == null
1438
+ })),
1439
+ gap: image.GapY((props) => ({
1440
+ preset: [{ deviceId: "desktop", value: { value: 10, unit: "px" } }],
1441
+ label: "Gap",
1442
+ defaultValue: { value: 0, unit: "px" },
1443
+ hidden: props.tableId == null
1444
+ })),
1445
+ shape: image.ResponsiveIconRadioGroup((props) => ({
1446
+ label: "Shape",
1447
+ options: [
1448
+ { label: "Pill", value: Shapes.PILL, icon: "ButtonPill16" },
1449
+ { label: "Rounded", value: Shapes.ROUNDED, icon: "ButtonRounded16" },
1450
+ { label: "Square", value: Shapes.SQUARE, icon: "ButtonSquare16" }
1451
+ ],
1452
+ defaultValue: Shapes.ROUNDED,
1453
+ hidden: props.tableId == null
1454
+ })),
1455
+ size: image.ResponsiveIconRadioGroup((props) => ({
1456
+ label: "Size",
1457
+ options: [
1458
+ { label: "Small", value: Sizes.SMALL, icon: "SizeSmall16" },
1459
+ { label: "Medium", value: Sizes.MEDIUM, icon: "SizeMedium16" },
1460
+ { label: "Large", value: Sizes.LARGE, icon: "SizeLarge16" }
1461
+ ],
1462
+ defaultValue: Sizes.MEDIUM,
1463
+ hidden: (props == null ? void 0 : props.tableId) == null
1464
+ })),
1465
+ contrast: image.ResponsiveIconRadioGroup((props) => ({
1466
+ label: "Color",
1467
+ options: [
1468
+ { label: "Light mode", value: Contrasts.LIGHT, icon: "Sun16" },
1469
+ { label: "Dark mode", value: Contrasts.DARK, icon: "Moon16" }
1470
+ ],
1471
+ defaultValue: Contrasts.LIGHT,
1472
+ hidden: props.tableId == null
1473
+ })),
1474
+ labelTextStyle: image.TextStyle({ label: "Label text style" }),
1475
+ labelTextColor: image.ResponsiveColor((props, device) => {
1476
+ const hidden = props.tableId == null;
1477
+ const responsiveContrast = props.contrast;
1478
+ const contrast = findDeviceOverride(responsiveContrast, device);
1479
+ return {
1480
+ hidden,
1481
+ label: "Label text color",
1482
+ placeholder: (contrast == null ? void 0 : contrast.value) === Contrasts.DARK ? "rgba(255,255,255,0.95)" : "rgba(0,0,0,0.8)"
1483
+ };
1484
+ }),
1485
+ submitTextStyle: image.TextStyle({ label: "Button text style" }),
1486
+ brandColor: image.ResponsiveColor((props) => ({
1487
+ label: "Button color",
1488
+ placeholder: "black",
1489
+ hidden: props.tableId == null
1490
+ })),
1491
+ submitTextColor: image.ResponsiveColor((props) => ({
1492
+ label: "Button text color",
1493
+ placeholder: "white",
1494
+ hidden: props.tableId == null
1495
+ })),
1496
+ submitLabel: image.TextInput((props) => ({
1497
+ label: "Button label",
1498
+ placeholder: "Submit",
1499
+ hidden: props.tableId == null
1500
+ })),
1501
+ submitVariant: image.ResponsiveSelect((props) => ({
1502
+ label: "Button style",
1503
+ options: [
1504
+ { value: "flat", label: "Flat" },
1505
+ { value: "outline", label: "Outline" },
1506
+ { value: "shadow", label: "Floating" },
1507
+ { value: "clear", label: "Clear" },
1508
+ { value: "blocky", label: "Blocky" },
1509
+ { value: "bubbly", label: "Bubbly" },
1510
+ { value: "skewed", label: "Skewed" }
1511
+ ],
1512
+ defaultValue: "flat",
1513
+ hidden: props.tableId == null
1514
+ })),
1515
+ submitWidth: image.ResponsiveLength((props) => ({
1516
+ label: "Button width",
1517
+ hidden: props.tableId == null
1518
+ })),
1519
+ submitAlignment: image.ResponsiveIconRadioGroup((props) => ({
1520
+ label: "Button alignment",
1521
+ options: [
1522
+ { label: "Left", value: Alignments.LEFT, icon: "AlignLeft16" },
1523
+ { label: "Center", value: Alignments.CENTER, icon: "AlignCenter16" },
1524
+ { label: "Right", value: Alignments.RIGHT, icon: "AlignRight16" }
1525
+ ],
1526
+ defaultValue: Alignments.CENTER,
1527
+ hidden: props.tableId == null
1528
+ })),
1529
+ width: image.Width({
1530
+ preset: [{ deviceId: "desktop", value: { value: 550, unit: "px" } }],
1531
+ defaultValue: { value: 100, unit: "%" }
1532
+ }),
1533
+ margin: image.Margin()
1534
+ }
1535
+ });
1536
+ }
1537
+ function registerComponent$5(runtime) {
1538
+ return runtime.registerComponent(forwardNextDynamicRef((patch) => dynamic__default["default"](() => patch(Promise.resolve().then(function() {
1539
+ return require("./Image.cjs2.js");
1540
+ })))), {
1541
+ type: MakeswiftComponentType.Image,
1542
+ label: "Image",
1543
+ props: {
1544
+ id: image.ElementID(),
1545
+ file: image.Image(),
1546
+ altText: image.TextInput({ label: "Alt text" }),
1547
+ link: image.Link({ label: "On click" }),
1548
+ width: image.Width(),
1549
+ margin: image.Margin(),
1550
+ padding: image.Padding(),
1551
+ border: image.Border(),
1552
+ borderRadius: image.BorderRadius(),
1553
+ boxShadow: image.Shadows(),
1554
+ opacity: image.ResponsiveOpacity()
1555
+ }
1556
+ });
1557
+ }
1558
+ function registerComponent$4(runtime) {
1559
+ return runtime.registerComponent(forwardNextDynamicRef((patch) => dynamic__default["default"](() => patch(Promise.resolve().then(function() {
1560
+ return require("./Navigation.cjs.js");
1561
+ })))), {
1562
+ type: MakeswiftComponentType.Navigation,
1563
+ label: "Navigation",
1564
+ icon: "Navigation40",
1565
+ props: {
1566
+ id: image.ElementID(),
1567
+ links: image.NavigationLinks(),
1568
+ linkTextStyle: image.TextStyle((props) => {
1569
+ const links = props.links;
1570
+ return {
1571
+ label: "Link text style",
1572
+ hidden: links == null || links.length === 0
1573
+ };
1574
+ }),
1575
+ showLogo: image.Checkbox({ preset: true, label: "Show logo" }),
1576
+ logoFile: image.Image((props) => ({
1577
+ label: "Logo",
1578
+ hidden: props.showLogo === false
1579
+ })),
1580
+ logoWidth: image.ResponsiveLength((props) => ({
1581
+ preset: [{ deviceId: "desktop", value: { value: 100, unit: "px" } }],
1582
+ label: "Logo width",
1583
+ min: 0,
1584
+ max: 1e3,
1585
+ options: [{ value: "px", label: "Pixels", icon: "Px16" }],
1586
+ hidden: props.showLogo === false
1587
+ })),
1588
+ logoAltText: image.TextInput((props) => ({
1589
+ label: "Logo alt text",
1590
+ hidden: props.showLogo === false
1591
+ })),
1592
+ logoLink: image.Link((props) => ({
1593
+ label: "Logo on click",
1594
+ hidden: props.showLogo === false
1595
+ })),
1596
+ alignment: image.ResponsiveIconRadioGroup({
1597
+ label: "Alignment",
1598
+ options: [
1599
+ { label: "Left", value: "flex-start", icon: "AlignLeft16" },
1600
+ { label: "Center", value: "center", icon: "AlignCenter16" },
1601
+ { label: "End", value: "flex-end", icon: "AlignRight16" }
1602
+ ],
1603
+ defaultValue: "flex-end"
1604
+ }),
1605
+ gutter: image.GapX({
1606
+ preset: [{ deviceId: "desktop", value: { value: 10, unit: "px" } }],
1607
+ label: "Link gap",
1608
+ min: 0,
1609
+ max: 100,
1610
+ step: 1,
1611
+ defaultValue: { value: 0, unit: "px" }
1612
+ }),
1613
+ mobileMenuAnimation: image.ResponsiveSelect({
1614
+ label: "Mobile menu",
1615
+ options: [
1616
+ { value: "coverRight", label: "Cover from right" },
1617
+ { value: "coverLeft", label: "Cover from left" }
1618
+ ]
1619
+ }),
1620
+ mobileMenuOpenIconColor: image.ResponsiveColor((props, device) => {
1621
+ const mobileMenuAnimation = props.mobileMenuAnimation;
1622
+ const hidden = !findDeviceOverride(mobileMenuAnimation, device);
1623
+ return {
1624
+ label: "Open icon color",
1625
+ placeholder: "rgba(161, 168, 194, 0.5)",
1626
+ hidden
1627
+ };
1628
+ }),
1629
+ mobileMenuCloseIconColor: image.ResponsiveColor((props, device) => {
1630
+ const mobileMenuAnimation = props.mobileMenuAnimation;
1631
+ const hidden = !findDeviceOverride(mobileMenuAnimation, device);
1632
+ return {
1633
+ label: "Close icon color",
1634
+ placeholder: "rgba(161, 168, 194, 0.5)",
1635
+ hidden
1636
+ };
1637
+ }),
1638
+ mobileMenuBackgroundColor: image.ResponsiveColor((props, device) => {
1639
+ const mobileMenuAnimation = props.mobileMenuAnimation;
1640
+ const hidden = !findDeviceOverride(mobileMenuAnimation, device);
1641
+ return {
1642
+ label: "Menu BG color",
1643
+ placeholder: "black",
1644
+ hidden
1645
+ };
1646
+ }),
1647
+ width: image.Width({ defaultValue: { value: 100, unit: "%" } }),
1648
+ margin: image.Margin()
1649
+ }
1650
+ });
1651
+ }
1652
+ function registerComponent$3(runtime) {
1653
+ return runtime.registerComponent(forwardNextDynamicRef((patch) => dynamic__default["default"](() => patch(Promise.resolve().then(function() {
1654
+ return require("./Root.cjs.js");
1655
+ })))), {
1656
+ type: MakeswiftComponentType.Root,
1657
+ label: "Page",
1658
+ hidden: true,
1659
+ props: {
1660
+ children: image.Grid(),
1661
+ backgrounds: image.Backgrounds(),
1662
+ rowGap: image.GapY(),
1663
+ columnGap: image.GapX()
1664
+ }
1665
+ });
1666
+ }
1667
+ function registerComponent$2(runtime) {
1668
+ return runtime.registerComponent(forwardNextDynamicRef((patch) => dynamic__default["default"](() => patch(Promise.resolve().then(function() {
1669
+ return require("./SocialLinks.cjs.js");
1670
+ })))), {
1671
+ type: MakeswiftComponentType.SocialLinks,
1672
+ label: "Social Links",
1673
+ icon: "SocialLinks40",
1674
+ props: {
1675
+ id: image.ElementID(),
1676
+ links: image.SocialLinks({
1677
+ preset: {
1678
+ links: [
1679
+ {
1680
+ id: "facebook",
1681
+ payload: { type: "facebook", url: "https://www.facebook.com" }
1682
+ },
1683
+ {
1684
+ id: "instagram",
1685
+ payload: { type: "instagram", url: "https://www.instagram.com" }
1686
+ },
1687
+ {
1688
+ id: "twitter",
1689
+ payload: { type: "twitter", url: "https://www.twitter.com" }
1690
+ }
1691
+ ],
1692
+ openInNewTab: false
1693
+ }
1694
+ }),
1695
+ shape: image.ResponsiveIconRadioGroup((props) => {
1696
+ const links = props.links;
1697
+ return {
1698
+ label: "Shape",
1699
+ options: [
1700
+ { label: "Naked", value: "naked", icon: "Star16" },
1701
+ { label: "Circle", value: "circle", icon: "StarCircle16" },
1702
+ { label: "Rounded", value: "rounded", icon: "StarRoundedSquare16" },
1703
+ { label: "Square", value: "square", icon: "StarSquare16" }
1704
+ ],
1705
+ defaultValue: "naked",
1706
+ hidden: links == null || links.links.length === 0
1707
+ };
1708
+ }),
1709
+ size: image.ResponsiveIconRadioGroup((props) => {
1710
+ const links = props.links;
1711
+ return {
1712
+ label: "Size",
1713
+ options: [
1714
+ { label: "Small", value: "small", icon: "SizeSmall16" },
1715
+ { label: "Medium", value: "medium", icon: "SizeMedium16" },
1716
+ { label: "Large", value: "large", icon: "SizeLarge16" }
1717
+ ],
1718
+ defaultValue: "medium",
1719
+ hidden: links == null || links.links.length === 0
1720
+ };
1721
+ }),
1722
+ hoverStyle: image.ResponsiveSelect((props) => {
1723
+ const links = props.links;
1724
+ const hidden = links == null || links.links.length === 0;
1725
+ return {
1726
+ label: "On hover",
1727
+ options: [
1728
+ { value: "none", label: "None" },
1729
+ { value: "grow", label: "Grow" },
1730
+ { value: "shrink", label: "Shrink" },
1731
+ { value: "fade", label: "Fade" }
1732
+ ],
1733
+ defaultValue: "none",
1734
+ labelOrientation: "horizontal",
1735
+ hidden
1736
+ };
1737
+ }),
1738
+ fill: image.ResponsiveColor((props) => {
1739
+ const links = props.links;
1740
+ const hidden = links == null || links.links.length === 0;
1741
+ return {
1742
+ label: "Icon color",
1743
+ hidden
1744
+ };
1745
+ }),
1746
+ backgroundColor: image.ResponsiveColor((props) => {
1747
+ const links = props.links;
1748
+ const hidden = links == null || links.links.length === 0;
1749
+ return {
1750
+ label: "Shape color",
1751
+ hidden
1752
+ };
1753
+ }),
1754
+ alignment: image.ResponsiveIconRadioGroup({
1755
+ label: "Alignment",
1756
+ options: [
1757
+ { label: "flex-start", value: "flex-start", icon: "AlignLeft16" },
1758
+ { label: "center", value: "center", icon: "AlignCenter16" },
1759
+ { label: "flex-end", value: "flex-end", icon: "AlignRight16" }
1760
+ ],
1761
+ defaultValue: "center"
1762
+ }),
1763
+ gutter: image.GapX({
1764
+ preset: [{ deviceId: "desktop", value: { value: 10, unit: "px" } }],
1765
+ label: "Link gap",
1766
+ min: 0,
1767
+ max: 100,
1768
+ step: 1,
1769
+ defaultValue: { value: 0, unit: "px" }
1770
+ }),
1771
+ width: image.Width({ defaultValue: { value: 100, unit: "%" } }),
1772
+ margin: image.Margin({
1773
+ preset: [
1774
+ {
1775
+ deviceId: "desktop",
1776
+ value: {
1777
+ marginTop: { value: 10, unit: "px" },
1778
+ marginRight: "auto",
1779
+ marginBottom: { value: 10, unit: "px" },
1780
+ marginLeft: "auto"
1781
+ }
1782
+ }
1783
+ ]
1784
+ })
1785
+ }
1786
+ });
1787
+ }
1788
+ function registerComponent$1(runtime) {
1789
+ return runtime.registerComponent(forwardNextDynamicRef((patch) => dynamic__default["default"](() => patch(Promise.resolve().then(function() {
1790
+ return require("./Text.cjs.js");
1791
+ })))), {
1792
+ type: MakeswiftComponentType.Text,
1793
+ label: "Text",
1794
+ props: {
1795
+ id: image.ElementID(),
1796
+ text: image.RichText(() => ({
1797
+ preset: {
1798
+ document: {
1799
+ nodes: [
1800
+ {
1801
+ object: "block",
1802
+ type: "paragraph",
1803
+ nodes: [
1804
+ {
1805
+ object: "text",
1806
+ text: ipsum__default["default"](3),
1807
+ marks: [
1808
+ {
1809
+ object: "mark",
1810
+ type: "typography",
1811
+ data: {
1812
+ value: {
1813
+ id: null,
1814
+ style: [
1815
+ {
1816
+ deviceId: "mobile",
1817
+ value: { fontSize: { value: 16, unit: "px" } }
1818
+ },
1819
+ {
1820
+ deviceId: "desktop",
1821
+ value: {
1822
+ fontWeight: 400,
1823
+ fontSize: { value: 18, unit: "px" },
1824
+ lineHeight: 1.5
1825
+ }
1826
+ }
1827
+ ]
1828
+ }
1829
+ }
1830
+ }
1831
+ ]
1832
+ }
1833
+ ]
1834
+ }
1835
+ ]
1836
+ }
1837
+ }
1838
+ })),
1839
+ width: image.Width({
1840
+ preset: [{ deviceId: "desktop", value: { value: 700, unit: "px" } }],
1841
+ defaultValue: { value: 100, unit: "%" }
1842
+ }),
1843
+ margin: image.Margin({
1844
+ preset: [
1845
+ {
1846
+ deviceId: "desktop",
1847
+ value: {
1848
+ marginTop: null,
1849
+ marginRight: "auto",
1850
+ marginBottom: { value: 20, unit: "px" },
1851
+ marginLeft: "auto"
1852
+ }
1853
+ }
1854
+ ]
1855
+ })
1856
+ }
1857
+ });
1858
+ }
1859
+ function registerComponent(runtime) {
1860
+ return runtime.registerComponent(forwardNextDynamicRef((patch) => dynamic__default["default"](() => patch(Promise.resolve().then(function() {
1861
+ return require("./Video.cjs.js");
1862
+ })))), {
1863
+ type: MakeswiftComponentType.Video,
1864
+ label: "Video",
1865
+ icon: "Video40",
1866
+ props: {
1867
+ id: image.ElementID(),
1868
+ video: image.Video({ preset: { controls: true } }),
1869
+ width: image.Width({ defaultValue: { value: 560, unit: "px" } }),
1870
+ margin: image.Margin(),
1871
+ borderRadius: image.BorderRadius()
1872
+ }
1873
+ });
1874
+ }
1875
+ function registerBuiltinComponents(runtime) {
1876
+ const unregisterBoxComponent = registerComponent$c(runtime);
1877
+ const unregisterButtonComponent = registerComponent$b(runtime);
1878
+ const unregisterCarouselComponent = registerComponent$a(runtime);
1879
+ const unregisterCountdownComponent = registerComponent$9(runtime);
1880
+ const unregisterDividerComponent = registerComponent$8(runtime);
1881
+ const unregisterEmbedComponent = registerComponent$7(runtime);
1882
+ const unregisterFormComponent = registerComponent$6(runtime);
1883
+ const unregisterImageComponent = registerComponent$5(runtime);
1884
+ const unregisterNavigationComponent = registerComponent$4(runtime);
1885
+ const unregisterRootComponent = registerComponent$3(runtime);
1886
+ const unregisterSocialLinksComponent = registerComponent$2(runtime);
1887
+ const unregisterTextComponent = registerComponent$1(runtime);
1888
+ const unregisterVideoComponent = registerComponent(runtime);
1889
+ return () => {
1890
+ unregisterBoxComponent();
1891
+ unregisterButtonComponent();
1892
+ unregisterCarouselComponent();
1893
+ unregisterCountdownComponent();
1894
+ unregisterDividerComponent();
1895
+ unregisterEmbedComponent();
1896
+ unregisterFormComponent();
1897
+ unregisterImageComponent();
1898
+ unregisterNavigationComponent();
1899
+ unregisterRootComponent();
1900
+ unregisterSocialLinksComponent();
1901
+ unregisterTextComponent();
1902
+ unregisterTextComponent();
1903
+ unregisterVideoComponent();
1904
+ };
1905
+ }
1906
+ var _path;
1907
+ function _extends() {
1908
+ _extends = Object.assign || function(target) {
1909
+ for (var i = 1; i < arguments.length; i++) {
1910
+ var source = arguments[i];
1911
+ for (var key in source) {
1912
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
1913
+ target[key] = source[key];
1914
+ }
1915
+ }
1916
+ }
1917
+ return target;
1918
+ };
1919
+ return _extends.apply(this, arguments);
1920
+ }
1921
+ var SvgWarning20 = function SvgWarning202(props) {
1922
+ return /* @__PURE__ */ React__namespace.createElement("svg", _extends({
1923
+ width: 20,
1924
+ height: 20,
1925
+ viewBox: "0 0 20 20",
1926
+ xmlns: "http://www.w3.org/2000/svg"
1927
+ }, props), _path || (_path = /* @__PURE__ */ React__namespace.createElement("path", {
1928
+ fillRule: "evenodd",
1929
+ clipRule: "evenodd",
1930
+ d: "M2.89864 18H17.1014C18.4183 18 19.2633 16.6003 18.65 15.4349L11.5486 1.94236C10.8925 0.69577 9.10749 0.695766 8.45139 1.94236L1.35003 15.4349C0.736692 16.6003 1.58174 18 2.89864 18ZM9 6C9 5.44772 9.44771 5 10 5C10.5523 5 11 5.44772 11 6V11C11 11.5523 10.5523 12 10 12C9.44771 12 9 11.5523 9 11V6ZM11.25 14.75C11.25 15.4404 10.6904 16 10 16C9.30964 16 8.75 15.4404 8.75 14.75C8.75 14.0596 9.30964 13.5 10 13.5C10.6904 13.5 11.25 14.0596 11.25 14.75Z"
1931
+ })));
1932
+ };
1933
+ const ErrorDiv = styled__default["default"]("div")`
1934
+ width: 100%;
1935
+ height: 54px;
1936
+ background-color: #fcedf2;
1937
+ border-radius: 6px;
1938
+ padding: 16px;
1939
+ display: flex;
1940
+ align-items: center;
1941
+ gap: 8px;
1942
+ color: #c73e6d;
1943
+ fill: currentColor;
1944
+ font-family: Heebo, sans-serif;
1945
+ font-size: 16px;
1946
+ `;
1947
+ const FallbackComponent = React.forwardRef(function FallbackComponent2({
1948
+ text
1949
+ }, ref) {
1950
+ return /* @__PURE__ */ jsxRuntime.jsxs(ErrorDiv, {
1951
+ ref,
1952
+ children: [/* @__PURE__ */ jsxRuntime.jsx(SvgWarning20, {}), /* @__PURE__ */ jsxRuntime.jsx("span", {
1953
+ children: text
1954
+ })]
1955
+ });
1956
+ });
1957
+ function isNonNullable(value) {
1958
+ return value != null;
1959
+ }
1960
+ function mapSideColor(swatches, _c) {
1961
+ var _d = _c, { color: color2 } = _d, restOfSide = __objRest(_d, ["color"]);
1962
+ return __spreadProps(__spreadValues({}, restOfSide), {
1963
+ color: color2 && {
1964
+ alpha: color2.alpha,
1965
+ swatch: swatches.find((s) => s && s.id === color2.swatchId)
1966
+ }
1967
+ });
1968
+ }
1969
+ function useBorder(value) {
1970
+ const swatchIds = value == null ? [] : [
1971
+ ...Array.from(new Set(value.map(({ value: { borderTop, borderLeft, borderBottom, borderRight } }) => [
1972
+ borderTop && borderTop.color && borderTop.color.swatchId,
1973
+ borderBottom && borderBottom.color && borderBottom.color.swatchId,
1974
+ borderLeft && borderLeft.color && borderLeft.color.swatchId,
1975
+ borderRight && borderRight.color && borderRight.color.swatchId
1976
+ ]).reduce((a, b) => a.concat(b)).filter(isNonNullable)))
1977
+ ];
1978
+ const skip = value == null || swatchIds.length === 0;
1979
+ const { error, data = {} } = useQuery(SWATCHES_BY_ID, { skip, variables: { ids: swatchIds } });
1980
+ if (value == null || error != null)
1981
+ return null;
1982
+ const { swatches = [] } = data;
1983
+ return value.map((_a) => {
1984
+ var _b = _a, { value: { borderTop, borderBottom, borderLeft, borderRight } } = _b, rest = __objRest(_b, ["value"]);
1985
+ return __spreadProps(__spreadValues({}, rest), {
1986
+ value: {
1987
+ borderTop: borderTop && mapSideColor(swatches, borderTop),
1988
+ borderBottom: borderBottom && mapSideColor(swatches, borderBottom),
1989
+ borderLeft: borderLeft && mapSideColor(swatches, borderLeft),
1990
+ borderRight: borderRight && mapSideColor(swatches, borderRight)
1991
+ }
1992
+ });
1993
+ });
1994
+ }
1995
+ function useResponsiveColor(color2) {
1996
+ const swatchIds = color2 == null ? [] : [...Array.from(new Set(color2.map(({ value: v }) => v && v.swatchId).filter(isNonNullable)))];
1997
+ const skip = swatchIds.length === 0;
1998
+ const { error, data = {} } = useQuery(SWATCHES_BY_ID, { skip, variables: { ids: swatchIds } });
1999
+ if (color2 == null || error != null)
2000
+ return null;
2001
+ const { swatches = [] } = data;
2002
+ return color2.map((_a) => {
2003
+ var _b = _a, { value: v } = _b, rest = __objRest(_b, ["value"]);
2004
+ const { swatchId, alpha } = v;
2005
+ const swatch = swatches.find((s) => s && s.id === swatchId);
2006
+ return swatch == null ? null : __spreadProps(__spreadValues({}, rest), { value: { swatch, alpha } });
2007
+ }).filter(isNonNullable);
2008
+ }
2009
+ function useFile(fileId) {
2010
+ const { error, data = {} } = useQuery(FILE_BY_ID, {
2011
+ skip: fileId == null,
2012
+ variables: { id: fileId }
2013
+ });
2014
+ if (fileId == null || error != null)
2015
+ return null;
2016
+ return data.file;
2017
+ }
2018
+ const isSSR = typeof window === "undefined" || /ServerSideRendering/.test(window.navigator && window.navigator.userAgent);
2019
+ const useIsomorphicLayoutEffect = isSSR ? React.useEffect : React.useLayoutEffect;
2020
+ function usePage(pageId) {
2021
+ const { error, data = {} } = useQuery(PAGE_PATHNAMES_BY_ID, {
2022
+ skip: pageId == null,
2023
+ variables: { ids: [pageId] }
2024
+ });
2025
+ if (pageId == null || error != null)
2026
+ return null;
2027
+ const { pagePathnamesById: [page] = [] } = data;
2028
+ return page;
2029
+ }
2030
+ function responsiveStyle(responsiveValues, join$1, strategy) {
2031
+ return join(responsiveValues, join$1, strategy).reduce((acc, { deviceId, value }) => {
2032
+ const device = getDevice(deviceId);
2033
+ const mediaQuery = getDeviceMediaQuery(device);
2034
+ return __spreadProps(__spreadValues({}, acc), {
2035
+ [mediaQuery]: __spreadValues(__spreadValues({}, acc[mediaQuery]), value)
2036
+ });
2037
+ }, {});
2038
+ }
2039
+ function responsiveWidth(widthData, defaultValue = "100%") {
2040
+ return __spreadValues({
2041
+ maxWidth: "100%"
2042
+ }, responsiveStyle([widthData], ([width = defaultValue]) => ({
2043
+ width: typeof width === "object" ? `${width.value}${width.unit}` : width
2044
+ })));
2045
+ }
2046
+ function colorToString(color2) {
2047
+ return color2 && color2.swatch ? `hsla(${color2.swatch.hue},${color2.swatch.saturation}%,${color2.swatch.lightness}%,${color2.alpha})` : "";
2048
+ }
2049
+ function murmur2(str) {
2050
+ var h = 0;
2051
+ var k, i = 0, len = str.length;
2052
+ for (; len >= 4; ++i, len -= 4) {
2053
+ k = str.charCodeAt(i) & 255 | (str.charCodeAt(++i) & 255) << 8 | (str.charCodeAt(++i) & 255) << 16 | (str.charCodeAt(++i) & 255) << 24;
2054
+ k = (k & 65535) * 1540483477 + ((k >>> 16) * 59797 << 16);
2055
+ k ^= k >>> 24;
2056
+ h = (k & 65535) * 1540483477 + ((k >>> 16) * 59797 << 16) ^ (h & 65535) * 1540483477 + ((h >>> 16) * 59797 << 16);
2057
+ }
2058
+ switch (len) {
2059
+ case 3:
2060
+ h ^= (str.charCodeAt(i + 2) & 255) << 16;
2061
+ case 2:
2062
+ h ^= (str.charCodeAt(i + 1) & 255) << 8;
2063
+ case 1:
2064
+ h ^= str.charCodeAt(i) & 255;
2065
+ h = (h & 65535) * 1540483477 + ((h >>> 16) * 59797 << 16);
2066
+ }
2067
+ h ^= h >>> 13;
2068
+ h = (h & 65535) * 1540483477 + ((h >>> 16) * 59797 << 16);
2069
+ return ((h ^ h >>> 15) >>> 0).toString(36);
2070
+ }
2071
+ var unitlessKeys = {
2072
+ animationIterationCount: 1,
2073
+ borderImageOutset: 1,
2074
+ borderImageSlice: 1,
2075
+ borderImageWidth: 1,
2076
+ boxFlex: 1,
2077
+ boxFlexGroup: 1,
2078
+ boxOrdinalGroup: 1,
2079
+ columnCount: 1,
2080
+ columns: 1,
2081
+ flex: 1,
2082
+ flexGrow: 1,
2083
+ flexPositive: 1,
2084
+ flexShrink: 1,
2085
+ flexNegative: 1,
2086
+ flexOrder: 1,
2087
+ gridRow: 1,
2088
+ gridRowEnd: 1,
2089
+ gridRowSpan: 1,
2090
+ gridRowStart: 1,
2091
+ gridColumn: 1,
2092
+ gridColumnEnd: 1,
2093
+ gridColumnSpan: 1,
2094
+ gridColumnStart: 1,
2095
+ msGridRow: 1,
2096
+ msGridRowSpan: 1,
2097
+ msGridColumn: 1,
2098
+ msGridColumnSpan: 1,
2099
+ fontWeight: 1,
2100
+ lineHeight: 1,
2101
+ opacity: 1,
2102
+ order: 1,
2103
+ orphans: 1,
2104
+ tabSize: 1,
2105
+ widows: 1,
2106
+ zIndex: 1,
2107
+ zoom: 1,
2108
+ WebkitLineClamp: 1,
2109
+ fillOpacity: 1,
2110
+ floodOpacity: 1,
2111
+ stopOpacity: 1,
2112
+ strokeDasharray: 1,
2113
+ strokeDashoffset: 1,
2114
+ strokeMiterlimit: 1,
2115
+ strokeOpacity: 1,
2116
+ strokeWidth: 1
2117
+ };
2118
+ function memoize(fn) {
2119
+ var cache = /* @__PURE__ */ Object.create(null);
2120
+ return function(arg) {
2121
+ if (cache[arg] === void 0)
2122
+ cache[arg] = fn(arg);
2123
+ return cache[arg];
2124
+ };
2125
+ }
2126
+ var hyphenateRegex = /[A-Z]|^ms/g;
2127
+ var animationRegex = /_EMO_([^_]+?)_([^]*?)_EMO_/g;
2128
+ var isCustomProperty = function isCustomProperty2(property) {
2129
+ return property.charCodeAt(1) === 45;
2130
+ };
2131
+ var isProcessableValue = function isProcessableValue2(value) {
2132
+ return value != null && typeof value !== "boolean";
2133
+ };
2134
+ var processStyleName = /* @__PURE__ */ memoize(function(styleName) {
2135
+ return isCustomProperty(styleName) ? styleName : styleName.replace(hyphenateRegex, "-$&").toLowerCase();
2136
+ });
2137
+ var processStyleValue = function processStyleValue2(key, value) {
2138
+ switch (key) {
2139
+ case "animation":
2140
+ case "animationName": {
2141
+ if (typeof value === "string") {
2142
+ return value.replace(animationRegex, function(match, p1, p2) {
2143
+ cursor = {
2144
+ name: p1,
2145
+ styles: p2,
2146
+ next: cursor
2147
+ };
2148
+ return p1;
2149
+ });
2150
+ }
2151
+ }
2152
+ }
2153
+ if (unitlessKeys[key] !== 1 && !isCustomProperty(key) && typeof value === "number" && value !== 0) {
2154
+ return value + "px";
2155
+ }
2156
+ return value;
2157
+ };
2158
+ function handleInterpolation(mergedProps, registered, interpolation) {
2159
+ if (interpolation == null) {
2160
+ return "";
2161
+ }
2162
+ if (interpolation.__emotion_styles !== void 0) {
2163
+ return interpolation;
2164
+ }
2165
+ switch (typeof interpolation) {
2166
+ case "boolean": {
2167
+ return "";
2168
+ }
2169
+ case "object": {
2170
+ if (interpolation.anim === 1) {
2171
+ cursor = {
2172
+ name: interpolation.name,
2173
+ styles: interpolation.styles,
2174
+ next: cursor
2175
+ };
2176
+ return interpolation.name;
2177
+ }
2178
+ if (interpolation.styles !== void 0) {
2179
+ var next = interpolation.next;
2180
+ if (next !== void 0) {
2181
+ while (next !== void 0) {
2182
+ cursor = {
2183
+ name: next.name,
2184
+ styles: next.styles,
2185
+ next: cursor
2186
+ };
2187
+ next = next.next;
2188
+ }
2189
+ }
2190
+ var styles = interpolation.styles + ";";
2191
+ return styles;
2192
+ }
2193
+ return createStringFromObject(mergedProps, registered, interpolation);
2194
+ }
2195
+ case "function": {
2196
+ if (mergedProps !== void 0) {
2197
+ var previousCursor = cursor;
2198
+ var result = interpolation(mergedProps);
2199
+ cursor = previousCursor;
2200
+ return handleInterpolation(mergedProps, registered, result);
2201
+ }
2202
+ break;
2203
+ }
2204
+ }
2205
+ if (registered == null) {
2206
+ return interpolation;
2207
+ }
2208
+ var cached = registered[interpolation];
2209
+ return cached !== void 0 ? cached : interpolation;
2210
+ }
2211
+ function createStringFromObject(mergedProps, registered, obj) {
2212
+ var string = "";
2213
+ if (Array.isArray(obj)) {
2214
+ for (var i = 0; i < obj.length; i++) {
2215
+ string += handleInterpolation(mergedProps, registered, obj[i]) + ";";
2216
+ }
2217
+ } else {
2218
+ for (var _key in obj) {
2219
+ var value = obj[_key];
2220
+ if (typeof value !== "object") {
2221
+ if (registered != null && registered[value] !== void 0) {
2222
+ string += _key + "{" + registered[value] + "}";
2223
+ } else if (isProcessableValue(value)) {
2224
+ string += processStyleName(_key) + ":" + processStyleValue(_key, value) + ";";
2225
+ }
2226
+ } else {
2227
+ if (_key === "NO_COMPONENT_SELECTOR" && false) {
2228
+ throw new Error("Component selectors can only be used in conjunction with @emotion/babel-plugin.");
2229
+ }
2230
+ if (Array.isArray(value) && typeof value[0] === "string" && (registered == null || registered[value[0]] === void 0)) {
2231
+ for (var _i = 0; _i < value.length; _i++) {
2232
+ if (isProcessableValue(value[_i])) {
2233
+ string += processStyleName(_key) + ":" + processStyleValue(_key, value[_i]) + ";";
2234
+ }
2235
+ }
2236
+ } else {
2237
+ var interpolated = handleInterpolation(mergedProps, registered, value);
2238
+ switch (_key) {
2239
+ case "animation":
2240
+ case "animationName": {
2241
+ string += processStyleName(_key) + ":" + interpolated + ";";
2242
+ break;
2243
+ }
2244
+ default: {
2245
+ string += _key + "{" + interpolated + "}";
2246
+ }
2247
+ }
2248
+ }
2249
+ }
2250
+ }
2251
+ }
2252
+ return string;
2253
+ }
2254
+ var labelPattern = /label:\s*([^\s;\n{]+)\s*(;|$)/g;
2255
+ var cursor;
2256
+ var serializeStyles = function serializeStyles2(args, registered, mergedProps) {
2257
+ if (args.length === 1 && typeof args[0] === "object" && args[0] !== null && args[0].styles !== void 0) {
2258
+ return args[0];
2259
+ }
2260
+ var stringMode = true;
2261
+ var styles = "";
2262
+ cursor = void 0;
2263
+ var strings = args[0];
2264
+ if (strings == null || strings.raw === void 0) {
2265
+ stringMode = false;
2266
+ styles += handleInterpolation(mergedProps, registered, strings);
2267
+ } else {
2268
+ styles += strings[0];
2269
+ }
2270
+ for (var i = 1; i < args.length; i++) {
2271
+ styles += handleInterpolation(mergedProps, registered, args[i]);
2272
+ if (stringMode) {
2273
+ styles += strings[i];
2274
+ }
2275
+ }
2276
+ labelPattern.lastIndex = 0;
2277
+ var identifierName = "";
2278
+ var match;
2279
+ while ((match = labelPattern.exec(styles)) !== null) {
2280
+ identifierName += "-" + match[1];
2281
+ }
2282
+ var name = murmur2(styles) + identifierName;
2283
+ return {
2284
+ name,
2285
+ styles,
2286
+ next: cursor
2287
+ };
2288
+ };
2289
+ var isBrowser = true;
2290
+ var registerStyles = function registerStyles2(cache, serialized, isStringTag) {
2291
+ var className = cache.key + "-" + serialized.name;
2292
+ if ((isStringTag === false || isBrowser === false) && cache.registered[className] === void 0) {
2293
+ cache.registered[className] = serialized.styles;
2294
+ }
2295
+ };
2296
+ var insertStyles = function insertStyles2(cache, serialized, isStringTag) {
2297
+ registerStyles(cache, serialized, isStringTag);
2298
+ var className = cache.key + "-" + serialized.name;
2299
+ if (cache.inserted[serialized.name] === void 0) {
2300
+ var current = serialized;
2301
+ do {
2302
+ cache.insert(serialized === current ? "." + className : "", current, cache.sheet, true);
2303
+ current = current.next;
2304
+ } while (current !== void 0);
2305
+ }
2306
+ };
2307
+ const isServer = typeof window === "undefined";
2308
+ const useInsertionEffectSpecifier = "useInsertionEffect";
2309
+ const useInsertionEffect = (_e = React__namespace[useInsertionEffectSpecifier]) != null ? _e : React__namespace.useLayoutEffect;
2310
+ function useStyle(style) {
2311
+ const serialized = serializeStyles([style], css.cache.registered);
2312
+ registerStyles(css.cache, serialized, false);
2313
+ useInsertionEffect(() => {
2314
+ insertStyles(css.cache, serialized, false);
2315
+ });
2316
+ if (isServer)
2317
+ insertStyles(css.cache, serialized, false);
2318
+ return `${css.cache.key}-${serialized.name}`;
2319
+ }
2320
+ function useStyleControlCssObject(style, controlDefinition) {
2321
+ const { properties } = controlDefinition.config;
2322
+ return __spreadValues(__spreadValues({}, properties.includes(image.StyleControlProperty.Width) && {
2323
+ maxWidth: "100%"
2324
+ }), responsiveStyle([
2325
+ style == null ? void 0 : style.width,
2326
+ style == null ? void 0 : style.margin,
2327
+ style == null ? void 0 : style.padding,
2328
+ useBorder(style == null ? void 0 : style.border),
2329
+ style == null ? void 0 : style.borderRadius,
2330
+ style == null ? void 0 : style.textStyle
2331
+ ], ([width, margin, padding, border, borderRadius, textStyle]) => {
2332
+ var _a, _b, _c, _d, _e2, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s;
2333
+ return __spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues({}, properties.includes(image.StyleControlProperty.Width) && {
2334
+ width: (_a = widthToString(width)) != null ? _a : "100%"
2335
+ }), properties.includes(image.StyleControlProperty.Margin) && {
2336
+ marginTop: (_b = marginToString(margin == null ? void 0 : margin.marginTop)) != null ? _b : 0,
2337
+ marginRight: (_c = marginToString(margin == null ? void 0 : margin.marginRight)) != null ? _c : "auto",
2338
+ marginBottom: (_d = marginToString(margin == null ? void 0 : margin.marginBottom)) != null ? _d : 0,
2339
+ marginLeft: (_e2 = marginToString(margin == null ? void 0 : margin.marginLeft)) != null ? _e2 : "auto"
2340
+ }), properties.includes(image.StyleControlProperty.Padding) && {
2341
+ paddingTop: (_f = paddingToString(padding == null ? void 0 : padding.paddingTop)) != null ? _f : 0,
2342
+ paddingRight: (_g = paddingToString(padding == null ? void 0 : padding.paddingRight)) != null ? _g : 0,
2343
+ paddingBottom: (_h = paddingToString(padding == null ? void 0 : padding.paddingBottom)) != null ? _h : 0,
2344
+ paddingLeft: (_i = paddingToString(padding == null ? void 0 : padding.paddingLeft)) != null ? _i : 0
2345
+ }), properties.includes(image.StyleControlProperty.Border) && {
2346
+ borderTop: (_j = borderSideToString(border == null ? void 0 : border.borderTop)) != null ? _j : "0 solid black",
2347
+ borderRight: (_k = borderSideToString(border == null ? void 0 : border.borderRight)) != null ? _k : "0 solid black",
2348
+ borderBottom: (_l = borderSideToString(border == null ? void 0 : border.borderBottom)) != null ? _l : "0 solid black",
2349
+ borderLeft: (_m = borderSideToString(border == null ? void 0 : border.borderLeft)) != null ? _m : "0 solid black"
2350
+ }), properties.includes(image.StyleControlProperty.BorderRadius) && {
2351
+ borderTopLeftRadius: (_n = borderRadiusToString(borderRadius == null ? void 0 : borderRadius.borderTopLeftRadius)) != null ? _n : 0,
2352
+ borderTopRightRadius: (_o = borderRadiusToString(borderRadius == null ? void 0 : borderRadius.borderTopRightRadius)) != null ? _o : 0,
2353
+ borderBottomRightRadius: (_p = borderRadiusToString(borderRadius == null ? void 0 : borderRadius.borderBottomRightRadius)) != null ? _p : 0,
2354
+ borderBottomLeftRadius: (_q = borderRadiusToString(borderRadius == null ? void 0 : borderRadius.borderBottomLeftRadius)) != null ? _q : 0
2355
+ }), properties.includes(image.StyleControlProperty.TextStyle) && __spreadProps(__spreadValues(__spreadValues(__spreadValues(__spreadValues({}, (textStyle == null ? void 0 : textStyle.fontFamily) && { fontFamily: textStyle.fontFamily }), (textStyle == null ? void 0 : textStyle.letterSpacing) && { letterSpacing: textStyle.letterSpacing }), (textStyle == null ? void 0 : textStyle.fontSize) && { fontSize: fontSizeToString(textStyle.fontSize) }), (textStyle == null ? void 0 : textStyle.fontWeight) && { fontWeight: textStyle.fontWeight }), {
2356
+ textTransform: (_r = textStyle == null ? void 0 : textStyle.textTransform) != null ? _r : [],
2357
+ fontStyle: (_s = textStyle == null ? void 0 : textStyle.fontStyle) != null ? _s : []
2358
+ }));
2359
+ }));
2360
+ function widthToString(widthProperty) {
2361
+ if (widthProperty == null)
2362
+ return null;
2363
+ return `${widthProperty.value}${widthProperty.unit}`;
2364
+ }
2365
+ function marginToString(marginProperty) {
2366
+ if (marginProperty == null)
2367
+ return null;
2368
+ if (marginProperty === "auto")
2369
+ return marginProperty;
2370
+ return `${marginProperty.value}${marginProperty.unit}`;
2371
+ }
2372
+ function paddingToString(paddingProperty) {
2373
+ if (paddingProperty == null)
2374
+ return null;
2375
+ return `${paddingProperty.value}${paddingProperty.unit}`;
2376
+ }
2377
+ function borderSideToString(borderSide) {
2378
+ if (borderSide == null)
2379
+ return null;
2380
+ const { width, color: color2, style: style2 } = borderSide;
2381
+ return `${width != null ? width : 0}px ${style2} ${color2 != null ? colorToString(color2) : "black"}`;
2382
+ }
2383
+ function borderRadiusToString(borderRadius) {
2384
+ if (borderRadius == null)
2385
+ return null;
2386
+ return `${borderRadius.value}${borderRadius.unit}`;
2387
+ }
2388
+ function fontSizeToString(fontSize) {
2389
+ return `${fontSize.value}${fontSize.unit}`;
2390
+ }
2391
+ }
2392
+ function useFormattedStyle(styleControlData, controlDefinition) {
2393
+ const style = useStyleControlCssObject(styleControlData, controlDefinition);
2394
+ return useStyle(style);
2395
+ }
2396
+ function RenderHook({
2397
+ hook: useHook,
2398
+ parameters,
2399
+ children
2400
+ }) {
2401
+ return children(useHook(...parameters));
2402
+ }
2403
+ function useCheckboxControlValue(data, definition) {
2404
+ return data != null ? data : definition.config.defaultValue;
2405
+ }
2406
+ function useColorValue(data, definition) {
2407
+ var _a, _b;
2408
+ const result = useQuery(SWATCHES_BY_ID, {
2409
+ variables: { ids: [data == null ? void 0 : data.swatchId] },
2410
+ skip: (data == null ? void 0 : data.swatchId) == null
2411
+ });
2412
+ if (data === void 0) {
2413
+ const { defaultValue } = definition.config;
2414
+ if (defaultValue === void 0)
2415
+ return void 0;
2416
+ let defaultColor;
2417
+ try {
2418
+ defaultColor = ColorHelper__default["default"](definition.config.defaultValue);
2419
+ } catch {
2420
+ defaultColor = ColorHelper__default["default"]();
2421
+ }
2422
+ return defaultColor.rgb().string();
2423
+ }
2424
+ const [swatch] = (_b = (_a = result.data) == null ? void 0 : _a.swatches) != null ? _b : [null];
2425
+ return ColorHelper__default["default"]({ h: swatch == null ? void 0 : swatch.hue, s: swatch == null ? void 0 : swatch.saturation, l: swatch == null ? void 0 : swatch.lightness }).alpha(data.alpha).rgb().string();
2426
+ }
2427
+ function useComboboxControlValue(data) {
2428
+ return data == null ? void 0 : data.value;
2429
+ }
2430
+ function useImageControlValue(data, definition) {
2431
+ var _a;
2432
+ const format = (_a = definition.config.format) != null ? _a : image.ImageControlValueFormat.URL;
2433
+ const file = useFile(data);
2434
+ if (format === image.ImageControlValueFormat.URL) {
2435
+ return file == null ? void 0 : file.publicUrl;
2436
+ }
2437
+ if (file == null || file.dimensions == null)
2438
+ return void 0;
2439
+ return {
2440
+ url: file.publicUrl,
2441
+ dimensions: { width: file.dimensions.width, height: file.dimensions.height }
2442
+ };
2443
+ }
2444
+ function useLinkControlValue(link, _definition) {
2445
+ var _a;
2446
+ const page = usePage(link && link.type === "OPEN_PAGE" ? link.payload.pageId : null);
2447
+ const elementKey = (link == null ? void 0 : link.type) === "SCROLL_TO_ELEMENT" ? (_a = link.payload.elementIdConfig) == null ? void 0 : _a.elementKey : null;
2448
+ const elementId = useElementId(elementKey);
2449
+ let href = "#";
2450
+ let target;
2451
+ let block;
2452
+ if (link) {
2453
+ switch (link.type) {
2454
+ case "OPEN_PAGE": {
2455
+ if (page)
2456
+ href = `/${page.pathname}`;
2457
+ target = link.payload.openInNewTab ? "_blank" : "_self";
2458
+ break;
2459
+ }
2460
+ case "OPEN_URL": {
2461
+ href = link.payload.url;
2462
+ target = link.payload.openInNewTab ? "_blank" : "_self";
2463
+ break;
2464
+ }
2465
+ case "SEND_EMAIL": {
2466
+ const { to, subject = "", body = "" } = link.payload;
2467
+ if (to != null)
2468
+ href = `mailto:${to}?subject=${subject}&body=${body}`;
2469
+ break;
2470
+ }
2471
+ case "CALL_PHONE": {
2472
+ href = `tel:${link.payload.phoneNumber}`;
2473
+ break;
2474
+ }
2475
+ case "SCROLL_TO_ELEMENT": {
2476
+ href = `#${elementId != null ? elementId : ""}`;
2477
+ block = link.payload.block;
2478
+ break;
2479
+ }
2480
+ default:
2481
+ throw new RangeError(`Invalid link type "${link.type}."`);
2482
+ }
2483
+ }
2484
+ const handleClick = React.useCallback((event) => {
2485
+ if (event.defaultPrevented)
2486
+ return;
2487
+ if (link && link.type === "SCROLL_TO_ELEMENT") {
2488
+ let hash;
2489
+ try {
2490
+ hash = new URL(`http://www.example.com/${href}`).hash;
2491
+ } catch (error) {
2492
+ console.error(`Link received invalid href: ${href}`, error);
2493
+ }
2494
+ if (href != null && href === hash) {
2495
+ event.preventDefault();
2496
+ const view = event.view;
2497
+ scrollIntoView__default["default"](view.document.querySelector(hash), {
2498
+ behavior: "smooth",
2499
+ block
2500
+ });
2501
+ if (view.location.hash !== hash)
2502
+ view.history.pushState({}, "", hash);
2503
+ }
2504
+ }
2505
+ }, [link, href, block]);
2506
+ const res = React.useMemo(() => ({ href, target, onClick: handleClick }), [href, target, handleClick]);
2507
+ return res;
2508
+ }
2509
+ function ListControlValue({
2510
+ definition,
2511
+ data,
2512
+ children
2513
+ }) {
2514
+ return (data != null ? data : []).reduce((renderFn, item) => (listControlValue) => /* @__PURE__ */ jsxRuntime.jsx(ControlValue, {
2515
+ definition: definition.config.type,
2516
+ data: item.value,
2517
+ children: (value) => renderFn([value, ...listControlValue])
2518
+ }), children)([]);
2519
+ }
2520
+ function useNumber(numberControlData, controlDefinition) {
2521
+ return numberControlData != null ? numberControlData : controlDefinition.config.defaultValue;
2522
+ }
2523
+ function useSelectControlValue(data, definition) {
2524
+ return data != null ? data : definition == null ? void 0 : definition.config.defaultValue;
2525
+ }
2526
+ function ShapeControlValue({
2527
+ definition,
2528
+ data,
2529
+ children
2530
+ }) {
2531
+ return Object.entries(definition.config.type).reduceRight((renderFn, [key, controlDefinition]) => (shapeControlValue) => /* @__PURE__ */ jsxRuntime.jsx(ControlValue, {
2532
+ definition: controlDefinition,
2533
+ data: data == null ? void 0 : data[key],
2534
+ children: (value) => renderFn(__spreadProps(__spreadValues({}, shapeControlValue), {
2535
+ [key]: value
2536
+ }))
2537
+ }), children)({});
2538
+ }
2539
+ function useTextAreaValue(data, definition) {
2540
+ return data != null ? data : definition.config.defaultValue;
2541
+ }
2542
+ function useTextInputValue(data, definition) {
2543
+ return data != null ? data : definition.config.defaultValue;
2544
+ }
2545
+ function ControlValue({
2546
+ data,
2547
+ definition,
2548
+ children
2549
+ }) {
2550
+ switch (definition.type) {
2551
+ case textInput.CheckboxControlType:
2552
+ return /* @__PURE__ */ jsxRuntime.jsx(RenderHook, {
2553
+ hook: useCheckboxControlValue,
2554
+ parameters: [data, definition],
2555
+ children: (value) => children(value)
2556
+ }, definition.type);
2557
+ case textInput.NumberControlType:
2558
+ return /* @__PURE__ */ jsxRuntime.jsx(RenderHook, {
2559
+ hook: useNumber,
2560
+ parameters: [data, definition],
2561
+ children: (value) => children(value)
2562
+ }, definition.type);
2563
+ case textInput.TextInputControlType:
2564
+ return /* @__PURE__ */ jsxRuntime.jsx(RenderHook, {
2565
+ hook: useTextInputValue,
2566
+ parameters: [data, definition],
2567
+ children: (value) => children(value)
2568
+ }, definition.type);
2569
+ case textInput.TextAreaControlType:
2570
+ return /* @__PURE__ */ jsxRuntime.jsx(RenderHook, {
2571
+ hook: useTextAreaValue,
2572
+ parameters: [data, definition],
2573
+ children: (value) => children(value)
2574
+ }, definition.type);
2575
+ case textInput.SelectControlType:
2576
+ return /* @__PURE__ */ jsxRuntime.jsx(RenderHook, {
2577
+ hook: useSelectControlValue,
2578
+ parameters: [data, definition],
2579
+ children: (value) => children(value)
2580
+ }, definition.type);
2581
+ case color.ColorControlType:
2582
+ return /* @__PURE__ */ jsxRuntime.jsx(RenderHook, {
2583
+ hook: useColorValue,
2584
+ parameters: [data, definition],
2585
+ children: (value) => children(value)
2586
+ }, definition.type);
2587
+ case image.ImageControlType:
2588
+ return /* @__PURE__ */ jsxRuntime.jsx(RenderHook, {
2589
+ hook: useImageControlValue,
2590
+ parameters: [data, definition],
2591
+ children: (value) => children(value)
2592
+ }, definition.type);
2593
+ case textInput.LinkControlType:
2594
+ return /* @__PURE__ */ jsxRuntime.jsx(RenderHook, {
2595
+ hook: useLinkControlValue,
2596
+ parameters: [data, definition],
2597
+ children: (value) => children(value)
2598
+ }, definition.type);
2599
+ case shape.ComboboxControlType:
2600
+ return /* @__PURE__ */ jsxRuntime.jsx(RenderHook, {
2601
+ hook: useComboboxControlValue,
2602
+ parameters: [data],
2603
+ children: (value) => children(value)
2604
+ }, definition.type);
2605
+ case shape.ShapeControlType:
2606
+ return /* @__PURE__ */ jsxRuntime.jsx(ShapeControlValue, {
2607
+ definition,
2608
+ data,
2609
+ children: (value) => children(value)
2610
+ });
2611
+ case shape.ListControlType:
2612
+ return /* @__PURE__ */ jsxRuntime.jsx(ListControlValue, {
2613
+ definition,
2614
+ data,
2615
+ children: (value) => children(value)
2616
+ });
2617
+ default:
2618
+ return children(data);
2619
+ }
2620
+ }
2621
+ const getIndexes = (spans, index) => {
2622
+ const flattened = spans.reduce((a, s) => a.concat(s), []);
2623
+ if (index < 0 || index > flattened.length)
2624
+ throw new RangeError();
2625
+ let remainder = index;
2626
+ let rowIndex = 0;
2627
+ while (rowIndex < spans.length - 1 && remainder >= spans[rowIndex].length) {
2628
+ remainder -= spans[rowIndex].length;
2629
+ rowIndex += 1;
2630
+ }
2631
+ return [rowIndex, remainder];
2632
+ };
2633
+ function useSlot(data, control) {
2634
+ if (data == null || data.elements.length === 0) {
2635
+ return /* @__PURE__ */ jsxRuntime.jsx(Slot.Placeholder, {
2636
+ control
2637
+ });
2638
+ }
2639
+ return /* @__PURE__ */ jsxRuntime.jsx(Slot, {
2640
+ control,
2641
+ children: data.elements.map((element, i) => /* @__PURE__ */ jsxRuntime.jsx(Slot.Item, {
2642
+ control,
2643
+ grid: data.columns,
2644
+ index: i,
2645
+ children: /* @__PURE__ */ jsxRuntime.jsx(Element, {
2646
+ element
2647
+ })
2648
+ }, element.key))
2649
+ });
2650
+ }
2651
+ function Slot(_f) {
2652
+ var _g = _f, {
2653
+ as,
2654
+ control,
2655
+ children,
2656
+ className
2657
+ } = _g, restOfProps = __objRest(_g, [
2658
+ "as",
2659
+ "control",
2660
+ "children",
2661
+ "className"
2662
+ ]);
2663
+ const As = as != null ? as : "div";
2664
+ const [element, setElement] = React.useState(null);
2665
+ const baseClassName = useStyle({
2666
+ display: "flex",
2667
+ flexWrap: "wrap",
2668
+ width: "100%"
2669
+ });
2670
+ React.useEffect(() => {
2671
+ if (element == null || control == null)
2672
+ return;
2673
+ return pollBoxModel({
2674
+ element,
2675
+ onBoxModelChange: (boxModel) => control.changeContainerBoxModel(boxModel)
2676
+ });
2677
+ }, [element, control]);
2678
+ return /* @__PURE__ */ jsxRuntime.jsx(As, __spreadProps(__spreadValues({}, restOfProps), {
2679
+ ref: setElement,
2680
+ className: css.cx(baseClassName, className),
2681
+ children
2682
+ }));
2683
+ }
2684
+ Slot.Placeholder = SlotPlaceholder;
2685
+ Slot.Item = SlotItem;
2686
+ function SlotItem(_h) {
2687
+ var _i = _h, {
2688
+ as,
2689
+ control,
2690
+ grid,
2691
+ index,
2692
+ children,
2693
+ className
2694
+ } = _i, restOfProps = __objRest(_i, [
2695
+ "as",
2696
+ "control",
2697
+ "grid",
2698
+ "index",
2699
+ "children",
2700
+ "className"
2701
+ ]);
2702
+ const As = as != null ? as : "div";
2703
+ const [element, setElement] = React.useState(null);
2704
+ const baseClassName = useStyle(__spreadValues({
2705
+ display: "flex"
2706
+ }, responsiveStyle([grid], ([{
2707
+ count = 12,
2708
+ spans = [[12]]
2709
+ } = {}]) => {
2710
+ const [rowIndex, columnIndex] = getIndexes(spans, index);
2711
+ const span = spans[rowIndex][columnIndex];
2712
+ const flexBasis = `calc(100% * ${(span / count).toFixed(5)})`;
2713
+ return span === 0 ? {
2714
+ display: "none"
2715
+ } : {
2716
+ flexBasis,
2717
+ minWidth: flexBasis
2718
+ };
2719
+ })));
2720
+ React.useEffect(() => {
2721
+ if (element == null || control == null)
2722
+ return;
2723
+ return pollBoxModel({
2724
+ element,
2725
+ onBoxModelChange: (boxModel) => control.changeItemBoxModel(index, boxModel)
2726
+ });
2727
+ }, [element, control, index]);
2728
+ return /* @__PURE__ */ jsxRuntime.jsx(As, __spreadProps(__spreadValues({}, restOfProps), {
2729
+ ref: setElement,
2730
+ className: css.cx(baseClassName, className),
2731
+ children
2732
+ }));
2733
+ }
2734
+ function SlotPlaceholder({
2735
+ control
2736
+ }) {
2737
+ const [element, setElement] = React.useState(null);
2738
+ React.useEffect(() => {
2739
+ if (element == null || control == null)
2740
+ return;
2741
+ return pollBoxModel({
2742
+ element,
2743
+ onBoxModelChange: (boxModel) => control.changeContainerBoxModel(boxModel)
2744
+ });
2745
+ }, [element, control]);
2746
+ return /* @__PURE__ */ jsxRuntime.jsx("div", {
2747
+ ref: setElement,
2748
+ className: useStyle({
2749
+ width: "100%",
2750
+ background: "rgba(161, 168, 194, 0.18)",
2751
+ height: "80px"
2752
+ }),
2753
+ children: /* @__PURE__ */ jsxRuntime.jsx("svg", {
2754
+ xmlns: "http://www.w3.org/2000/svg",
2755
+ width: "100%",
2756
+ height: "100%",
2757
+ className: useStyle({
2758
+ overflow: "visible",
2759
+ padding: 8
2760
+ }),
2761
+ children: /* @__PURE__ */ jsxRuntime.jsx("rect", {
2762
+ x: 0,
2763
+ y: 0,
2764
+ width: "100%",
2765
+ height: "100%",
2766
+ strokeWidth: 2,
2767
+ strokeDasharray: "4 2",
2768
+ fill: "none",
2769
+ stroke: "rgba(161, 168, 194, 0.40)",
2770
+ rx: "4",
2771
+ ry: "4"
2772
+ })
2773
+ })
2774
+ });
2775
+ }
2776
+ function pollBoxModel({
2777
+ element,
2778
+ onBoxModelChange
2779
+ }) {
2780
+ let currentBoxModel = null;
2781
+ const handleAnimationFrameRequest = () => {
2782
+ const measuredBoxModel = boxModels.getBox(element);
2783
+ if (!deepEqual(currentBoxModel, measuredBoxModel)) {
2784
+ currentBoxModel = measuredBoxModel;
2785
+ onBoxModelChange(currentBoxModel);
2786
+ }
2787
+ animationFrameHandle = requestAnimationFrame(handleAnimationFrameRequest);
2788
+ };
2789
+ let animationFrameHandle = requestAnimationFrame(handleAnimationFrameRequest);
2790
+ return () => {
2791
+ cancelAnimationFrame(animationFrameHandle);
2792
+ };
2793
+ }
2794
+ function useDeviceMode() {
2795
+ return "desktop";
2796
+ }
2797
+ function useWidth(value, descriptor, props) {
2798
+ const deviceMode = useDeviceMode();
2799
+ const options = React.useMemo(() => typeof descriptor.options === "function" ? descriptor.options(props, deviceMode) : descriptor.options, [props, deviceMode]);
2800
+ return React.useMemo(() => options.format === image.WidthControlValueFormats.ClassName ? css.css(responsiveWidth(value, options.defaultValue)) : value, [value, options.defaultValue, options.format]);
2801
+ }
2802
+ function PropsValue({
2803
+ element,
2804
+ children
2805
+ }) {
2806
+ var _a;
2807
+ const store = useStore();
2808
+ const propControllerDescriptorsRef = React.useRef((_a = reactPage.getComponentPropControllerDescriptors(store.getState(), element.type)) != null ? _a : {});
2809
+ const props = element.props;
2810
+ const documentKey = useDocumentKey();
2811
+ const propControllers = useSelector((state) => {
2812
+ if (documentKey == null)
2813
+ return null;
2814
+ return reactPage.getPropControllers(state, documentKey, element.key);
2815
+ });
2816
+ return Object.entries(propControllerDescriptorsRef.current).reduceRight((renderFn, [propName, descriptor]) => (propsValue) => {
2817
+ var _a2;
2818
+ switch (descriptor.type) {
2819
+ case textInput.CheckboxControlType:
2820
+ case textInput.NumberControlType:
2821
+ case textInput.TextInputControlType:
2822
+ case textInput.TextAreaControlType:
2823
+ case textInput.SelectControlType:
2824
+ case color.ColorControlType:
2825
+ case image.ImageControlType:
2826
+ case shape.ComboboxControlType:
2827
+ case shape.ShapeControlType:
2828
+ case shape.ListControlType:
2829
+ case textInput.LinkControlType:
2830
+ return /* @__PURE__ */ jsxRuntime.jsx(ControlValue, {
2831
+ definition: descriptor,
2832
+ data: props[propName],
2833
+ children: (value) => renderFn(__spreadProps(__spreadValues({}, propsValue), {
2834
+ [propName]: value
2835
+ }))
2836
+ });
2837
+ case image.StyleControlType:
2838
+ return /* @__PURE__ */ jsxRuntime.jsx(RenderHook, {
2839
+ hook: useFormattedStyle,
2840
+ parameters: [props[propName], descriptor],
2841
+ children: (value) => renderFn(__spreadProps(__spreadValues({}, propsValue), {
2842
+ [propName]: value
2843
+ }))
2844
+ }, descriptor.type);
2845
+ case slot.SlotControlType: {
2846
+ const control = (_a2 = propControllers == null ? void 0 : propControllers[propName]) != null ? _a2 : null;
2847
+ return /* @__PURE__ */ jsxRuntime.jsx(RenderHook, {
2848
+ hook: useSlot,
2849
+ parameters: [props[propName], control],
2850
+ children: (value) => renderFn(__spreadProps(__spreadValues({}, propsValue), {
2851
+ [propName]: value
2852
+ }))
2853
+ }, descriptor.type);
2854
+ }
2855
+ case image.Types.Width:
2856
+ return /* @__PURE__ */ jsxRuntime.jsx(RenderHook, {
2857
+ hook: useWidth,
2858
+ parameters: [props[propName], descriptor, props],
2859
+ children: (value) => renderFn(__spreadProps(__spreadValues({}, propsValue), {
2860
+ [propName]: value
2861
+ }))
2862
+ }, descriptor.type);
2863
+ case image.Types.ResponsiveColor:
2864
+ return /* @__PURE__ */ jsxRuntime.jsx(RenderHook, {
2865
+ hook: useResponsiveColor,
2866
+ parameters: [props[propName]],
2867
+ children: (value) => renderFn(__spreadProps(__spreadValues({}, propsValue), {
2868
+ [propName]: value
2869
+ }))
2870
+ }, descriptor.type);
2871
+ default:
2872
+ return renderFn(__spreadProps(__spreadValues({}, propsValue), {
2873
+ [propName]: props[propName]
2874
+ }));
2875
+ }
2876
+ }, children)({});
2877
+ }
2878
+ function suppressWarningAndFindDomNode(instance) {
2879
+ const error = console.error;
2880
+ console.error = (...args) => {
2881
+ if (typeof args[0] === "string" && args[0].includes("%s is deprecated in StrictMode."))
2882
+ return;
2883
+ return error.apply(console, args);
2884
+ };
2885
+ const foundDomNode = reactDom.findDOMNode(instance);
2886
+ console.error = error;
2887
+ return foundDomNode;
2888
+ }
2889
+ class FindDomNodeClassComponent extends React.Component {
2890
+ componentDidMount() {
2891
+ this.setInnerRef(suppressWarningAndFindDomNode(this));
2892
+ }
2893
+ componentDidUpdate() {
2894
+ this.setInnerRef(suppressWarningAndFindDomNode(this));
2895
+ }
2896
+ setInnerRef(current) {
2897
+ const {
2898
+ innerRef
2899
+ } = this.props;
2900
+ if (innerRef == null)
2901
+ return;
2902
+ if (typeof innerRef === "function")
2903
+ innerRef(current);
2904
+ else
2905
+ innerRef.current = current;
2906
+ }
2907
+ render() {
2908
+ return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, {
2909
+ children: this.props.children
2910
+ });
2911
+ }
2912
+ }
2913
+ const FindDomNode = React.forwardRef(function FindDomNode2(props, ref) {
2914
+ return /* @__PURE__ */ jsxRuntime.jsx(FindDomNodeClassComponent, __spreadProps(__spreadValues({}, props), {
2915
+ innerRef: ref
2916
+ }));
2917
+ });
2918
+ const storeContextDefaultValue = reactPage.configureStore();
2919
+ function createReactRuntime(store) {
2920
+ return {
2921
+ registerComponent(component, {
2922
+ type,
2923
+ label,
2924
+ icon = "Cube40",
2925
+ hidden = false,
2926
+ props
2927
+ }) {
2928
+ const unregisterComponent = store.dispatch(actions.registerComponentEffect(type, {
2929
+ label,
2930
+ icon,
2931
+ hidden
2932
+ }, props != null ? props : {}));
2933
+ const unregisterReactComponent = store.dispatch(actions.registerReactComponentEffect(type, component));
2934
+ return () => {
2935
+ unregisterComponent();
2936
+ unregisterReactComponent();
2937
+ };
2938
+ }
2939
+ };
2940
+ }
2941
+ const ReactRuntime = createReactRuntime(storeContextDefaultValue);
2942
+ registerBuiltinComponents(ReactRuntime);
2943
+ const Context = React.createContext(storeContextDefaultValue);
2944
+ function RuntimeProvider({
2945
+ client: client2,
2946
+ children,
2947
+ rootElements
2948
+ }) {
2949
+ const [store, setStore] = React.useState(() => {
2950
+ const store2 = reactPage.configureStore({
2951
+ preloadedState: storeContextDefaultValue.getState(),
2952
+ rootElements
2953
+ });
2954
+ return store2;
2955
+ });
2956
+ React.useEffect(() => {
2957
+ var _a;
2958
+ const unregisterDocuments = Array.from((_a = rootElements == null ? void 0 : rootElements.entries()) != null ? _a : []).map(([documentKey, rootElement]) => store.dispatch(actions.registerDocumentEffect(reactPage.createDocument(documentKey, rootElement))));
2959
+ return () => {
2960
+ unregisterDocuments.forEach((unregisterDocument) => {
2961
+ unregisterDocument();
2962
+ });
2963
+ };
2964
+ }, [store, rootElements]);
2965
+ React.useEffect(() => {
2966
+ const isInBuilder = window.parent !== window;
2967
+ if (isInBuilder)
2968
+ setReactBuilderPreviewStore();
2969
+ async function setReactBuilderPreviewStore() {
2970
+ const ReactBuilderPreview = await Promise.resolve().then(function() {
2971
+ return require("./react-builder-preview.cjs.js");
2972
+ });
2973
+ setStore((store2) => ReactBuilderPreview.configureStore({
2974
+ preloadedState: store2.getState(),
2975
+ client: client2.apolloClient
2976
+ }));
2977
+ }
2978
+ }, [client2]);
2979
+ return /* @__PURE__ */ jsxRuntime.jsx(Context.Provider, {
2980
+ value: store,
2981
+ children: /* @__PURE__ */ jsxRuntime.jsx(MakeswiftProvider, {
2982
+ client: client2,
2983
+ children
2984
+ })
2985
+ });
2986
+ }
2987
+ const PageContext = React.createContext(null);
2988
+ function usePageIdOrNull() {
2989
+ return React.useContext(PageContext);
2990
+ }
2991
+ function usePageId() {
2992
+ const pageIdOrNull = usePageIdOrNull();
2993
+ if (pageIdOrNull == null)
2994
+ throw new Error("`usePageId` must be used with `<PageProvider>`");
2995
+ return pageIdOrNull;
2996
+ }
2997
+ function PageProvider({
2998
+ id,
2999
+ children
3000
+ }) {
3001
+ return /* @__PURE__ */ jsxRuntime.jsx(PageContext.Provider, {
3002
+ value: id,
3003
+ children
3004
+ });
3005
+ }
3006
+ const DocumentContext = React.createContext(null);
3007
+ function useDocumentKey() {
3008
+ return React.useContext(DocumentContext);
3009
+ }
3010
+ function useStore() {
3011
+ return React.useContext(Context);
3012
+ }
3013
+ function useSelector(selector) {
3014
+ const store = useStore();
3015
+ return withSelector.useSyncExternalStoreWithSelector(store.subscribe, store.getState, store.getState, selector);
3016
+ }
3017
+ function useComponent(type) {
3018
+ return useSelector((state) => reactPage.getReactComponent(state, type));
3019
+ }
3020
+ function useElementId(elementKey) {
3021
+ const documentKey = useDocumentKey();
3022
+ return useSelector((state) => documentKey == null || elementKey == null ? null : reactPage.getElementId(state, documentKey, elementKey));
3023
+ }
3024
+ function useDocument(documentKey) {
3025
+ return useSelector((state) => reactPage.getDocument(state, documentKey));
3026
+ }
3027
+ function useIsInBuilder() {
3028
+ return useSelector((state) => reactPage.getIsInBuilder(state));
3029
+ }
3030
+ function useDispatch() {
3031
+ const store = React.useContext(Context);
3032
+ return store.dispatch;
3033
+ }
3034
+ const originalError = console.error;
3035
+ let patched = false;
3036
+ function suppressRefWarning(ownerName) {
3037
+ if (patched === false) {
3038
+ console.error = (...args) => {
3039
+ if (typeof args[0] === "string" && args[0].includes("Function components cannot be given refs.") && args[0].includes(`Check the render method of \`${ownerName}\`.`)) {
3040
+ return;
3041
+ }
3042
+ return originalError(...args);
3043
+ };
3044
+ patched = true;
3045
+ }
3046
+ }
3047
+ const ElementData = React.memo(React.forwardRef(function ElementData2({
3048
+ elementData
3049
+ }, ref) {
3050
+ const Component = useComponent(elementData.type);
3051
+ const [handle, setHandle] = React.useState(null);
3052
+ const [foundDomNode, setFoundDomNode] = React.useState(null);
3053
+ React.useImperativeHandle(ref, () => handle != null ? handle : foundDomNode, [handle, foundDomNode]);
3054
+ suppressRefWarning(`\`ForwardRef(${ElementData2.name})\``);
3055
+ if (Component == null) {
3056
+ return /* @__PURE__ */ jsxRuntime.jsx(FallbackComponent, {
3057
+ ref: setHandle,
3058
+ text: "Component not found"
3059
+ });
3060
+ }
3061
+ return /* @__PURE__ */ jsxRuntime.jsx(FindDomNode, {
3062
+ ref: setFoundDomNode,
3063
+ children: /* @__PURE__ */ jsxRuntime.jsx(PropsValue, {
3064
+ element: elementData,
3065
+ children: (props) => /* @__PURE__ */ React.createElement(Component, __spreadProps(__spreadValues({}, props), {
3066
+ key: elementData.key,
3067
+ ref: setHandle
3068
+ }))
3069
+ })
3070
+ });
3071
+ }));
3072
+ const DisableRegisterElement = React.createContext(false);
3073
+ const ElementReference = React.memo(React.forwardRef(function ElementReference2({
3074
+ elementReference
3075
+ }, ref) {
3076
+ var _a;
3077
+ const {
3078
+ error,
3079
+ data
3080
+ } = useQuery(ELEMENT_REFERENCE_GLOBAL_ELEMENT, {
3081
+ variables: {
3082
+ id: elementReference.value
3083
+ }
3084
+ });
3085
+ const globalElementData = (_a = data == null ? void 0 : data.globalElement) == null ? void 0 : _a.data;
3086
+ const elementReferenceDocument = useDocument(elementReference.key);
3087
+ if (error != null) {
3088
+ return /* @__PURE__ */ jsxRuntime.jsx(FallbackComponent, {
3089
+ ref,
3090
+ text: "Something went wrong!"
3091
+ });
3092
+ }
3093
+ if (globalElementData == null) {
3094
+ return /* @__PURE__ */ jsxRuntime.jsx(FallbackComponent, {
3095
+ ref,
3096
+ text: "This global component doesn't exist"
3097
+ });
3098
+ }
3099
+ return elementReferenceDocument != null ? /* @__PURE__ */ jsxRuntime.jsx(Document, {
3100
+ document: elementReferenceDocument,
3101
+ ref
3102
+ }) : /* @__PURE__ */ jsxRuntime.jsx(DisableRegisterElement.Provider, {
3103
+ value: true,
3104
+ children: /* @__PURE__ */ jsxRuntime.jsx(ElementData, {
3105
+ elementData: globalElementData,
3106
+ ref
3107
+ })
3108
+ });
3109
+ }));
3110
+ const Element = React.memo(React.forwardRef(function Element2({
3111
+ element
3112
+ }, ref) {
3113
+ const elementKey = element.key;
3114
+ const dispatch = useDispatch();
3115
+ const documentKey = useDocumentKey();
3116
+ const [handle, setHandle] = React.useState(null);
3117
+ const isRegisterElementDisabled = React.useContext(DisableRegisterElement);
3118
+ React.useImperativeHandle(ref, () => handle, [handle]);
3119
+ React.useEffect(() => {
3120
+ if (documentKey == null || isRegisterElementDisabled)
3121
+ return;
3122
+ return dispatch(actions.registerComponentHandleEffect(documentKey, elementKey, handle));
3123
+ }, [dispatch, documentKey, elementKey, handle, isRegisterElementDisabled]);
3124
+ React.useEffect(() => {
3125
+ if (documentKey == null || isRegisterElementDisabled)
3126
+ return;
3127
+ return dispatch(actions.mountComponentEffect(documentKey, elementKey));
3128
+ }, [dispatch, documentKey, elementKey, isRegisterElementDisabled]);
3129
+ return reactPage.isElementReference(element) ? /* @__PURE__ */ jsxRuntime.jsx(ElementReference, {
3130
+ ref: setHandle,
3131
+ elementReference: element
3132
+ }, elementKey) : /* @__PURE__ */ jsxRuntime.jsx(ElementData, {
3133
+ ref: setHandle,
3134
+ elementData: element
3135
+ }, elementKey);
3136
+ }));
3137
+ const Document = React.memo(React.forwardRef(function Document2({
3138
+ document: document2
3139
+ }, ref) {
3140
+ return /* @__PURE__ */ jsxRuntime.jsx(DocumentContext.Provider, {
3141
+ value: document2.key,
3142
+ children: /* @__PURE__ */ jsxRuntime.jsx(Element, {
3143
+ ref,
3144
+ element: document2.rootElement
3145
+ })
3146
+ });
3147
+ }));
3148
+ const DocumentReference = React.memo(React.forwardRef(function DocumentReference2({
3149
+ documentReference
3150
+ }, ref) {
3151
+ const document2 = useDocument(documentReference.key);
3152
+ if (document2 == null) {
3153
+ return /* @__PURE__ */ jsxRuntime.jsx(FallbackComponent, {
3154
+ ref,
3155
+ text: "Document not found"
3156
+ });
3157
+ }
3158
+ return /* @__PURE__ */ jsxRuntime.jsx(Document, {
3159
+ ref,
3160
+ document: document2
3161
+ });
3162
+ }));
3163
+ exports.Alignments = Alignments;
3164
+ exports.Contrasts = Contrasts;
3165
+ exports.DEFAULT_BOX_ANIMATE_DELAY = DEFAULT_BOX_ANIMATE_DELAY;
3166
+ exports.DEFAULT_BOX_ANIMATE_DURATION = DEFAULT_BOX_ANIMATE_DURATION;
3167
+ exports.DEFAULT_BOX_ANIMATE_TYPE = DEFAULT_BOX_ANIMATE_TYPE;
3168
+ exports.DEFAULT_ITEM_ANIMATE_DELAY = DEFAULT_ITEM_ANIMATE_DELAY;
3169
+ exports.DEFAULT_ITEM_ANIMATE_DURATION = DEFAULT_ITEM_ANIMATE_DURATION;
3170
+ exports.DEFAULT_ITEM_ANIMATE_TYPE = DEFAULT_ITEM_ANIMATE_TYPE;
3171
+ exports.DEFAULT_ITEM_STAGGER_DURATION = DEFAULT_ITEM_STAGGER_DURATION;
3172
+ exports.DEVICES = DEVICES;
3173
+ exports.DocumentReference = DocumentReference;
3174
+ exports.Element = Element;
3175
+ exports.FILES_BY_ID = FILES_BY_ID;
3176
+ exports.MakeswiftClient = MakeswiftClient;
3177
+ exports.MakeswiftComponentType = MakeswiftComponentType;
3178
+ exports.PAGE_SNIPPETS_QUERY = PAGE_SNIPPETS_QUERY;
3179
+ exports.Page = Page;
3180
+ exports.PageProvider = PageProvider;
3181
+ exports.Provider = Provider;
3182
+ exports.ReactRuntime = ReactRuntime;
3183
+ exports.RuntimeProvider = RuntimeProvider;
3184
+ exports.SITE_FONTS_QUERY = SITE_FONTS_QUERY;
3185
+ exports.SWATCHES_BY_ID = SWATCHES_BY_ID;
3186
+ exports.Shapes = Shapes;
3187
+ exports.Sizes = Sizes;
3188
+ exports.TABLE_BY_ID = TABLE_BY_ID;
3189
+ exports.TYPOGRAPHIES_BY_ID = TYPOGRAPHIES_BY_ID;
3190
+ exports.colorToString = colorToString;
3191
+ exports.deepEqual = deepEqual;
3192
+ exports.findDeviceOverride = findDeviceOverride;
3193
+ exports.forwardNextDynamicRef = forwardNextDynamicRef;
3194
+ exports.getDevice = getDevice;
3195
+ exports.getDeviceMediaQuery = getDeviceMediaQuery;
3196
+ exports.getIndexes = getIndexes;
3197
+ exports.isNonNullable = isNonNullable;
3198
+ exports.join = join;
3199
+ exports.shallowMergeFallbacks = shallowMergeFallbacks;
3200
+ exports.useBorder = useBorder;
3201
+ exports.useElementId = useElementId;
3202
+ exports.useFile = useFile;
3203
+ exports.useFormContext = useFormContext;
3204
+ exports.useIsInBuilder = useIsInBuilder;
3205
+ exports.useIsomorphicLayoutEffect = useIsomorphicLayoutEffect;
3206
+ exports.useMutation = useMutation;
3207
+ exports.usePage = usePage;
3208
+ exports.usePageId = usePageId;
3209
+ exports.useQuery = useQuery;
3210
+ exports.useResponsiveColor = useResponsiveColor;
3211
+ //# sourceMappingURL=index.cjs.js.map