@delmaredigital/payload-puck 0.1.3 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (565) hide show
  1. package/README.md +293 -1237
  2. package/dist/admin/EditWithPuckButton.d.ts +74 -0
  3. package/dist/admin/EditWithPuckButton.d.ts.map +1 -0
  4. package/dist/admin/EditWithPuckButton.js +114 -0
  5. package/dist/admin/EditWithPuckButton.js.map +1 -0
  6. package/dist/admin/EditWithPuckCell.d.ts +43 -0
  7. package/dist/admin/EditWithPuckCell.d.ts.map +1 -0
  8. package/dist/admin/EditWithPuckCell.js +66 -0
  9. package/dist/admin/EditWithPuckCell.js.map +1 -0
  10. package/dist/admin/PuckEditorView.d.ts +85 -0
  11. package/dist/admin/PuckEditorView.d.ts.map +1 -0
  12. package/dist/admin/PuckEditorView.js +135 -0
  13. package/dist/admin/PuckEditorView.js.map +1 -0
  14. package/dist/admin/client.d.ts +8 -104
  15. package/dist/admin/client.d.ts.map +1 -0
  16. package/dist/admin/client.js +14 -176
  17. package/dist/admin/client.js.map +1 -0
  18. package/dist/admin/generateAdminComponents.d.ts +51 -0
  19. package/dist/admin/generateAdminComponents.d.ts.map +1 -0
  20. package/dist/admin/generateAdminComponents.js +42 -0
  21. package/dist/admin/generateAdminComponents.js.map +1 -0
  22. package/dist/admin/index.d.ts +14 -150
  23. package/dist/admin/index.d.ts.map +1 -0
  24. package/dist/admin/index.js +17 -30
  25. package/dist/admin/index.js.map +1 -0
  26. package/dist/api/createPuckApiRoutes.d.ts +31 -0
  27. package/dist/api/createPuckApiRoutes.d.ts.map +1 -0
  28. package/dist/api/createPuckApiRoutes.js +193 -0
  29. package/dist/api/createPuckApiRoutes.js.map +1 -0
  30. package/dist/api/createPuckApiRoutesVersions.d.ts +28 -0
  31. package/dist/api/createPuckApiRoutesVersions.d.ts.map +1 -0
  32. package/dist/api/createPuckApiRoutesVersions.js +144 -0
  33. package/dist/api/createPuckApiRoutesVersions.js.map +1 -0
  34. package/dist/api/createPuckApiRoutesWithId.d.ts +34 -0
  35. package/dist/api/createPuckApiRoutesWithId.d.ts.map +1 -0
  36. package/dist/api/createPuckApiRoutesWithId.js +251 -0
  37. package/dist/api/createPuckApiRoutesWithId.js.map +1 -0
  38. package/dist/api/index.d.ts +11 -431
  39. package/dist/api/index.d.ts.map +1 -0
  40. package/dist/api/index.js +40 -587
  41. package/dist/api/index.js.map +1 -0
  42. package/dist/api/types.d.ts +302 -0
  43. package/dist/api/types.d.ts.map +1 -0
  44. package/dist/api/types.js +2 -0
  45. package/dist/api/types.js.map +1 -0
  46. package/dist/api/utils/mapRootProps.d.ts +76 -0
  47. package/dist/api/utils/mapRootProps.d.ts.map +1 -0
  48. package/dist/api/utils/mapRootProps.js +169 -0
  49. package/dist/api/utils/mapRootProps.js.map +1 -0
  50. package/dist/collections/Templates.d.ts +9 -0
  51. package/dist/collections/Templates.d.ts.map +1 -0
  52. package/dist/collections/Templates.js +62 -0
  53. package/dist/collections/Templates.js.map +1 -0
  54. package/dist/components/AccordionClient.d.ts +20 -0
  55. package/dist/components/AccordionClient.d.ts.map +1 -0
  56. package/dist/components/AccordionClient.js +67 -0
  57. package/dist/components/AccordionClient.js.map +1 -0
  58. package/dist/components/AnimatedWrapper.d.ts +33 -0
  59. package/dist/components/AnimatedWrapper.d.ts.map +1 -0
  60. package/dist/components/AnimatedWrapper.js +61 -0
  61. package/dist/components/AnimatedWrapper.js.map +1 -0
  62. package/dist/components/exports.d.ts +54 -0
  63. package/dist/components/exports.d.ts.map +1 -0
  64. package/dist/components/exports.js +71 -0
  65. package/dist/components/exports.js.map +1 -0
  66. package/dist/components/index.d.ts +8 -219
  67. package/dist/components/index.d.ts.map +1 -0
  68. package/dist/components/index.js +15 -9155
  69. package/dist/components/index.js.map +1 -0
  70. package/dist/components/interactive/Accordion.d.ts +28 -0
  71. package/dist/components/interactive/Accordion.d.ts.map +1 -0
  72. package/dist/components/interactive/Accordion.js +159 -0
  73. package/dist/components/interactive/Accordion.js.map +1 -0
  74. package/dist/components/interactive/Accordion.server.d.ts +29 -0
  75. package/dist/components/interactive/Accordion.server.d.ts.map +1 -0
  76. package/dist/components/interactive/Accordion.server.js +30 -0
  77. package/dist/components/interactive/Accordion.server.js.map +1 -0
  78. package/dist/components/interactive/Button.d.ts +26 -0
  79. package/dist/components/interactive/Button.d.ts.map +1 -0
  80. package/dist/components/interactive/Button.js +133 -0
  81. package/dist/components/interactive/Button.js.map +1 -0
  82. package/dist/components/interactive/Button.server.d.ts +28 -0
  83. package/dist/components/interactive/Button.server.d.ts.map +1 -0
  84. package/dist/components/interactive/Button.server.js +96 -0
  85. package/dist/components/interactive/Button.server.js.map +1 -0
  86. package/dist/components/interactive/Card.d.ts +27 -0
  87. package/dist/components/interactive/Card.d.ts.map +1 -0
  88. package/dist/components/interactive/Card.js +128 -0
  89. package/dist/components/interactive/Card.js.map +1 -0
  90. package/dist/components/interactive/Card.server.d.ts +29 -0
  91. package/dist/components/interactive/Card.server.d.ts.map +1 -0
  92. package/dist/components/interactive/Card.server.js +77 -0
  93. package/dist/components/interactive/Card.server.js.map +1 -0
  94. package/dist/components/interactive/Divider.d.ts +18 -0
  95. package/dist/components/interactive/Divider.d.ts.map +1 -0
  96. package/dist/components/interactive/Divider.js +68 -0
  97. package/dist/components/interactive/Divider.js.map +1 -0
  98. package/dist/components/interactive/Divider.server.d.ts +20 -0
  99. package/dist/components/interactive/Divider.server.d.ts.map +1 -0
  100. package/dist/components/interactive/Divider.server.js +50 -0
  101. package/dist/components/interactive/Divider.server.js.map +1 -0
  102. package/dist/components/interactive/index.d.ts +10 -0
  103. package/dist/components/interactive/index.d.ts.map +1 -0
  104. package/dist/components/interactive/index.js +10 -0
  105. package/dist/components/interactive/index.js.map +1 -0
  106. package/dist/components/layout/Container.d.ts +29 -0
  107. package/dist/components/layout/Container.d.ts.map +1 -0
  108. package/dist/components/layout/Container.js +166 -0
  109. package/dist/components/layout/Container.js.map +1 -0
  110. package/dist/components/layout/Container.server.d.ts +32 -0
  111. package/dist/components/layout/Container.server.d.ts.map +1 -0
  112. package/dist/components/layout/Container.server.js +105 -0
  113. package/dist/components/layout/Container.server.js.map +1 -0
  114. package/dist/components/layout/Flex.d.ts +36 -0
  115. package/dist/components/layout/Flex.d.ts.map +1 -0
  116. package/dist/components/layout/Flex.js +183 -0
  117. package/dist/components/layout/Flex.js.map +1 -0
  118. package/dist/components/layout/Flex.server.d.ts +36 -0
  119. package/dist/components/layout/Flex.server.d.ts.map +1 -0
  120. package/dist/components/layout/Flex.server.js +97 -0
  121. package/dist/components/layout/Flex.server.js.map +1 -0
  122. package/dist/components/layout/Grid.d.ts +31 -0
  123. package/dist/components/layout/Grid.d.ts.map +1 -0
  124. package/dist/components/layout/Grid.js +164 -0
  125. package/dist/components/layout/Grid.js.map +1 -0
  126. package/dist/components/layout/Grid.server.d.ts +32 -0
  127. package/dist/components/layout/Grid.server.d.ts.map +1 -0
  128. package/dist/components/layout/Grid.server.js +92 -0
  129. package/dist/components/layout/Grid.server.js.map +1 -0
  130. package/dist/components/layout/Section.d.ts +35 -0
  131. package/dist/components/layout/Section.d.ts.map +1 -0
  132. package/dist/components/layout/Section.js +212 -0
  133. package/dist/components/layout/Section.js.map +1 -0
  134. package/dist/components/layout/Section.server.d.ts +35 -0
  135. package/dist/components/layout/Section.server.d.ts.map +1 -0
  136. package/dist/components/layout/Section.server.js +144 -0
  137. package/dist/components/layout/Section.server.js.map +1 -0
  138. package/dist/components/layout/Spacer.d.ts +18 -0
  139. package/dist/components/layout/Spacer.d.ts.map +1 -0
  140. package/dist/components/layout/Spacer.js +99 -0
  141. package/dist/components/layout/Spacer.js.map +1 -0
  142. package/dist/components/layout/Spacer.server.d.ts +21 -0
  143. package/dist/components/layout/Spacer.server.d.ts.map +1 -0
  144. package/dist/components/layout/Spacer.server.js +61 -0
  145. package/dist/components/layout/Spacer.server.js.map +1 -0
  146. package/dist/components/layout/Template.d.ts +35 -0
  147. package/dist/components/layout/Template.d.ts.map +1 -0
  148. package/dist/components/layout/Template.js +124 -0
  149. package/dist/components/layout/Template.js.map +1 -0
  150. package/dist/components/layout/Template.server.d.ts +32 -0
  151. package/dist/components/layout/Template.server.d.ts.map +1 -0
  152. package/dist/components/layout/Template.server.js +75 -0
  153. package/dist/components/layout/Template.server.js.map +1 -0
  154. package/dist/components/layout/index.d.ts +14 -0
  155. package/dist/components/layout/index.d.ts.map +1 -0
  156. package/dist/components/layout/index.js +13 -0
  157. package/dist/components/layout/index.js.map +1 -0
  158. package/dist/components/media/Image.d.ts +30 -0
  159. package/dist/components/media/Image.d.ts.map +1 -0
  160. package/dist/components/media/Image.js +123 -0
  161. package/dist/components/media/Image.js.map +1 -0
  162. package/dist/components/media/Image.server.d.ts +28 -0
  163. package/dist/components/media/Image.server.d.ts.map +1 -0
  164. package/dist/components/media/Image.server.js +76 -0
  165. package/dist/components/media/Image.server.js.map +1 -0
  166. package/dist/components/media/index.d.ts +7 -0
  167. package/dist/components/media/index.d.ts.map +1 -0
  168. package/dist/components/media/index.js +7 -0
  169. package/dist/components/media/index.js.map +1 -0
  170. package/dist/components/typography/Heading.d.ts +21 -0
  171. package/dist/components/typography/Heading.d.ts.map +1 -0
  172. package/dist/components/typography/Heading.js +71 -0
  173. package/dist/components/typography/Heading.js.map +1 -0
  174. package/dist/components/typography/Heading.server.d.ts +21 -0
  175. package/dist/components/typography/Heading.server.d.ts.map +1 -0
  176. package/dist/components/typography/Heading.server.js +49 -0
  177. package/dist/components/typography/Heading.server.js.map +1 -0
  178. package/dist/components/typography/RichText.d.ts +20 -0
  179. package/dist/components/typography/RichText.d.ts.map +1 -0
  180. package/dist/components/typography/RichText.editor.d.ts +11 -0
  181. package/dist/components/typography/RichText.editor.d.ts.map +1 -0
  182. package/dist/components/typography/RichText.editor.js +67 -0
  183. package/dist/components/typography/RichText.editor.js.map +1 -0
  184. package/dist/components/typography/RichText.js +73 -0
  185. package/dist/components/typography/RichText.js.map +1 -0
  186. package/dist/components/typography/RichText.server.d.ts +22 -0
  187. package/dist/components/typography/RichText.server.d.ts.map +1 -0
  188. package/dist/components/typography/RichText.server.js +52 -0
  189. package/dist/components/typography/RichText.server.js.map +1 -0
  190. package/dist/components/typography/Text.d.ts +20 -0
  191. package/dist/components/typography/Text.d.ts.map +1 -0
  192. package/dist/components/typography/Text.js +61 -0
  193. package/dist/components/typography/Text.js.map +1 -0
  194. package/dist/components/typography/Text.server.d.ts +21 -0
  195. package/dist/components/typography/Text.server.d.ts.map +1 -0
  196. package/dist/components/typography/Text.server.js +39 -0
  197. package/dist/components/typography/Text.server.js.map +1 -0
  198. package/dist/components/typography/index.d.ts +10 -0
  199. package/dist/components/typography/index.d.ts.map +1 -0
  200. package/dist/components/typography/index.js +10 -0
  201. package/dist/components/typography/index.js.map +1 -0
  202. package/dist/config/config.editor.d.ts +15 -56
  203. package/dist/config/config.editor.d.ts.map +1 -0
  204. package/dist/config/config.editor.js +125 -9364
  205. package/dist/config/config.editor.js.map +1 -0
  206. package/dist/config/index.d.ts +7 -33
  207. package/dist/config/index.d.ts.map +1 -0
  208. package/dist/config/index.js +110 -2028
  209. package/dist/config/index.js.map +1 -0
  210. package/dist/config/merge.d.ts +23 -0
  211. package/dist/config/merge.d.ts.map +1 -0
  212. package/dist/config/merge.js +80 -0
  213. package/dist/config/merge.js.map +1 -0
  214. package/dist/config/presets.d.ts +342 -0
  215. package/dist/config/presets.d.ts.map +1 -0
  216. package/dist/config/presets.js +247 -0
  217. package/dist/config/presets.js.map +1 -0
  218. package/dist/editor/PuckEditor.client.d.ts +131 -0
  219. package/dist/editor/PuckEditor.client.d.ts.map +1 -0
  220. package/dist/editor/PuckEditor.client.js +42 -0
  221. package/dist/editor/PuckEditor.client.js.map +1 -0
  222. package/dist/editor/PuckEditorCore.client.d.ts +141 -0
  223. package/dist/editor/PuckEditorCore.client.d.ts.map +1 -0
  224. package/dist/editor/PuckEditorCore.client.js +306 -0
  225. package/dist/editor/PuckEditorCore.client.js.map +1 -0
  226. package/dist/editor/components/HeaderActions.d.ts +109 -0
  227. package/dist/editor/components/HeaderActions.d.ts.map +1 -0
  228. package/dist/editor/components/HeaderActions.js +254 -0
  229. package/dist/editor/components/HeaderActions.js.map +1 -0
  230. package/dist/editor/components/IframeWrapper.d.ts +77 -0
  231. package/dist/editor/components/IframeWrapper.d.ts.map +1 -0
  232. package/dist/editor/components/IframeWrapper.js +257 -0
  233. package/dist/editor/components/IframeWrapper.js.map +1 -0
  234. package/dist/editor/components/LoadingState.d.ts +14 -0
  235. package/dist/editor/components/LoadingState.d.ts.map +1 -0
  236. package/dist/editor/components/LoadingState.js +12 -0
  237. package/dist/editor/components/LoadingState.js.map +1 -0
  238. package/dist/editor/components/PreviewModal.d.ts +54 -0
  239. package/dist/editor/components/PreviewModal.d.ts.map +1 -0
  240. package/dist/editor/components/PreviewModal.js +298 -0
  241. package/dist/editor/components/PreviewModal.js.map +1 -0
  242. package/dist/editor/components/VersionHistory.d.ts +44 -0
  243. package/dist/editor/components/VersionHistory.d.ts.map +1 -0
  244. package/dist/editor/components/VersionHistory.js +308 -0
  245. package/dist/editor/components/VersionHistory.js.map +1 -0
  246. package/dist/editor/hooks/useUnsavedChanges.d.ts +27 -0
  247. package/dist/editor/hooks/useUnsavedChanges.d.ts.map +1 -0
  248. package/dist/editor/hooks/useUnsavedChanges.js +55 -0
  249. package/dist/editor/hooks/useUnsavedChanges.js.map +1 -0
  250. package/dist/editor/index.d.ts +16 -756
  251. package/dist/editor/index.d.ts.map +1 -0
  252. package/dist/editor/index.js +49 -4533
  253. package/dist/editor/index.js.map +1 -0
  254. package/dist/editor/plugins/index.d.ts +12 -0
  255. package/dist/editor/plugins/index.d.ts.map +1 -0
  256. package/dist/editor/plugins/index.js +12 -0
  257. package/dist/editor/plugins/index.js.map +1 -0
  258. package/dist/endpoints/index.d.ts +46 -0
  259. package/dist/endpoints/index.d.ts.map +1 -0
  260. package/dist/endpoints/index.js +204 -0
  261. package/dist/endpoints/index.js.map +1 -0
  262. package/dist/exports/client.d.ts +19 -0
  263. package/dist/exports/client.d.ts.map +1 -0
  264. package/dist/exports/client.js +21 -0
  265. package/dist/exports/client.js.map +1 -0
  266. package/dist/exports/rsc.d.ts +19 -0
  267. package/dist/exports/rsc.d.ts.map +1 -0
  268. package/dist/exports/rsc.js +19 -0
  269. package/dist/exports/rsc.js.map +1 -0
  270. package/dist/fields/AlignmentField.d.ts +36 -0
  271. package/dist/fields/AlignmentField.d.ts.map +1 -0
  272. package/dist/fields/AlignmentField.js +120 -0
  273. package/dist/fields/AlignmentField.js.map +1 -0
  274. package/dist/fields/AnimationField.d.ts +44 -0
  275. package/dist/fields/AnimationField.d.ts.map +1 -0
  276. package/dist/fields/AnimationField.js +329 -0
  277. package/dist/fields/AnimationField.js.map +1 -0
  278. package/dist/fields/BackgroundField.d.ts +40 -0
  279. package/dist/fields/BackgroundField.d.ts.map +1 -0
  280. package/dist/fields/BackgroundField.js +413 -0
  281. package/dist/fields/BackgroundField.js.map +1 -0
  282. package/dist/fields/BorderField.d.ts +29 -0
  283. package/dist/fields/BorderField.d.ts.map +1 -0
  284. package/dist/fields/BorderField.js +264 -0
  285. package/dist/fields/BorderField.js.map +1 -0
  286. package/dist/fields/ColorPickerField.d.ts +43 -0
  287. package/dist/fields/ColorPickerField.d.ts.map +1 -0
  288. package/dist/fields/ColorPickerField.js +285 -0
  289. package/dist/fields/ColorPickerField.js.map +1 -0
  290. package/dist/fields/DimensionsField.d.ts +43 -0
  291. package/dist/fields/DimensionsField.d.ts.map +1 -0
  292. package/dist/fields/DimensionsField.js +532 -0
  293. package/dist/fields/DimensionsField.js.map +1 -0
  294. package/dist/fields/FlexAlignmentField.d.ts +61 -0
  295. package/dist/fields/FlexAlignmentField.d.ts.map +1 -0
  296. package/dist/fields/FlexAlignmentField.js +166 -0
  297. package/dist/fields/FlexAlignmentField.js.map +1 -0
  298. package/dist/fields/FolderPickerField.d.ts +17 -0
  299. package/dist/fields/FolderPickerField.d.ts.map +1 -0
  300. package/dist/fields/FolderPickerField.js +282 -0
  301. package/dist/fields/FolderPickerField.js.map +1 -0
  302. package/dist/fields/GradientEditor.d.ts +22 -0
  303. package/dist/fields/GradientEditor.d.ts.map +1 -0
  304. package/dist/fields/GradientEditor.js +322 -0
  305. package/dist/fields/GradientEditor.js.map +1 -0
  306. package/dist/fields/LockedField.d.ts +67 -0
  307. package/dist/fields/LockedField.d.ts.map +1 -0
  308. package/dist/fields/LockedField.js +170 -0
  309. package/dist/fields/LockedField.js.map +1 -0
  310. package/dist/fields/MarginField.d.ts +31 -0
  311. package/dist/fields/MarginField.d.ts.map +1 -0
  312. package/dist/fields/MarginField.js +233 -0
  313. package/dist/fields/MarginField.js.map +1 -0
  314. package/dist/fields/MediaField.d.ts +33 -0
  315. package/dist/fields/MediaField.d.ts.map +1 -0
  316. package/dist/fields/MediaField.js +677 -0
  317. package/dist/fields/MediaField.js.map +1 -0
  318. package/dist/fields/PaddingField.d.ts +29 -0
  319. package/dist/fields/PaddingField.d.ts.map +1 -0
  320. package/dist/fields/PaddingField.js +232 -0
  321. package/dist/fields/PaddingField.js.map +1 -0
  322. package/dist/fields/PageSegmentField.d.ts +17 -0
  323. package/dist/fields/PageSegmentField.d.ts.map +1 -0
  324. package/dist/fields/PageSegmentField.js +92 -0
  325. package/dist/fields/PageSegmentField.js.map +1 -0
  326. package/dist/fields/ResetField.d.ts +27 -0
  327. package/dist/fields/ResetField.d.ts.map +1 -0
  328. package/dist/fields/ResetField.js +122 -0
  329. package/dist/fields/ResetField.js.map +1 -0
  330. package/dist/fields/ResponsiveField.d.ts +38 -0
  331. package/dist/fields/ResponsiveField.d.ts.map +1 -0
  332. package/dist/fields/ResponsiveField.js +275 -0
  333. package/dist/fields/ResponsiveField.js.map +1 -0
  334. package/dist/fields/ResponsiveVisibilityField.d.ts +34 -0
  335. package/dist/fields/ResponsiveVisibilityField.d.ts.map +1 -0
  336. package/dist/fields/ResponsiveVisibilityField.js +145 -0
  337. package/dist/fields/ResponsiveVisibilityField.js.map +1 -0
  338. package/dist/fields/SizeField.d.ts +54 -0
  339. package/dist/fields/SizeField.d.ts.map +1 -0
  340. package/dist/fields/SizeField.js +255 -0
  341. package/dist/fields/SizeField.js.map +1 -0
  342. package/dist/fields/SlugPreviewField.d.ts +16 -0
  343. package/dist/fields/SlugPreviewField.d.ts.map +1 -0
  344. package/dist/fields/SlugPreviewField.js +49 -0
  345. package/dist/fields/SlugPreviewField.js.map +1 -0
  346. package/dist/fields/TemplateField.d.ts +31 -0
  347. package/dist/fields/TemplateField.d.ts.map +1 -0
  348. package/dist/fields/TemplateField.js +428 -0
  349. package/dist/fields/TemplateField.js.map +1 -0
  350. package/dist/fields/TiptapField.d.ts +40 -0
  351. package/dist/fields/TiptapField.d.ts.map +1 -0
  352. package/dist/fields/TiptapField.js +857 -0
  353. package/dist/fields/TiptapField.js.map +1 -0
  354. package/dist/fields/TiptapModal.d.ts +10 -0
  355. package/dist/fields/TiptapModal.d.ts.map +1 -0
  356. package/dist/fields/TiptapModal.js +114 -0
  357. package/dist/fields/TiptapModal.js.map +1 -0
  358. package/dist/fields/TiptapModalField.d.ts +23 -0
  359. package/dist/fields/TiptapModalField.d.ts.map +1 -0
  360. package/dist/fields/TiptapModalField.js +55 -0
  361. package/dist/fields/TiptapModalField.js.map +1 -0
  362. package/dist/fields/TransformField.d.ts +31 -0
  363. package/dist/fields/TransformField.d.ts.map +1 -0
  364. package/dist/fields/TransformField.js +384 -0
  365. package/dist/fields/TransformField.js.map +1 -0
  366. package/dist/fields/VerticalAlignmentField.d.ts +35 -0
  367. package/dist/fields/VerticalAlignmentField.d.ts.map +1 -0
  368. package/dist/fields/VerticalAlignmentField.js +120 -0
  369. package/dist/fields/VerticalAlignmentField.js.map +1 -0
  370. package/dist/fields/WidthField.d.ts +28 -0
  371. package/dist/fields/WidthField.d.ts.map +1 -0
  372. package/dist/fields/WidthField.js +339 -0
  373. package/dist/fields/WidthField.js.map +1 -0
  374. package/dist/fields/index.d.ts +44 -559
  375. package/dist/fields/index.d.ts.map +1 -0
  376. package/dist/fields/index.js +91 -7685
  377. package/dist/fields/index.js.map +1 -0
  378. package/dist/fields/richtext-output.css +219 -0
  379. package/dist/{shared-DeNKN95N.d.mts → fields/shared.d.ts} +114 -133
  380. package/dist/fields/shared.d.ts.map +1 -0
  381. package/dist/fields/shared.js +1542 -0
  382. package/dist/fields/shared.js.map +1 -0
  383. package/dist/fields/{index.css → tiptap-styles.css} +75 -166
  384. package/dist/hooks/index.d.ts +8 -0
  385. package/dist/hooks/index.d.ts.map +1 -0
  386. package/dist/hooks/index.js +8 -0
  387. package/dist/hooks/index.js.map +1 -0
  388. package/dist/hooks/useResponsiveStyles.d.ts +51 -0
  389. package/dist/hooks/useResponsiveStyles.d.ts.map +1 -0
  390. package/dist/hooks/useResponsiveStyles.js +149 -0
  391. package/dist/hooks/useResponsiveStyles.js.map +1 -0
  392. package/dist/hooks/useScrollAnimation.d.ts +56 -0
  393. package/dist/hooks/useScrollAnimation.d.ts.map +1 -0
  394. package/dist/hooks/useScrollAnimation.js +116 -0
  395. package/dist/hooks/useScrollAnimation.js.map +1 -0
  396. package/dist/index.d.ts +66 -6
  397. package/dist/index.d.ts.map +1 -0
  398. package/dist/index.js +67 -568
  399. package/dist/index.js.map +1 -0
  400. package/dist/layouts/LayoutWrapper.d.ts +33 -0
  401. package/dist/layouts/LayoutWrapper.d.ts.map +1 -0
  402. package/dist/layouts/LayoutWrapper.js +112 -0
  403. package/dist/layouts/LayoutWrapper.js.map +1 -0
  404. package/dist/layouts/defaults.d.ts +40 -0
  405. package/dist/layouts/defaults.d.ts.map +1 -0
  406. package/dist/layouts/defaults.js +106 -0
  407. package/dist/layouts/defaults.js.map +1 -0
  408. package/dist/layouts/index.d.ts +27 -94
  409. package/dist/layouts/index.d.ts.map +1 -0
  410. package/dist/layouts/index.js +30 -393
  411. package/dist/layouts/index.js.map +1 -0
  412. package/dist/{types-D7D3rZ1J.d.ts → layouts/types.d.ts} +8 -11
  413. package/dist/layouts/types.d.ts.map +1 -0
  414. package/dist/layouts/types.js +7 -0
  415. package/dist/layouts/types.js.map +1 -0
  416. package/dist/layouts/utils.d.ts +42 -0
  417. package/dist/layouts/utils.d.ts.map +1 -0
  418. package/dist/layouts/utils.js +83 -0
  419. package/dist/layouts/utils.js.map +1 -0
  420. package/dist/plugin/collections/Pages.d.ts +8 -0
  421. package/dist/plugin/collections/Pages.d.ts.map +1 -0
  422. package/dist/plugin/collections/Pages.js +117 -0
  423. package/dist/plugin/collections/Pages.js.map +1 -0
  424. package/dist/plugin/fields/index.d.ts +153 -0
  425. package/dist/plugin/fields/index.d.ts.map +1 -0
  426. package/dist/plugin/fields/index.js +364 -0
  427. package/dist/plugin/fields/index.js.map +1 -0
  428. package/dist/plugin/fields/types.d.ts +108 -0
  429. package/dist/plugin/fields/types.d.ts.map +1 -0
  430. package/dist/plugin/fields/types.js +7 -0
  431. package/dist/plugin/fields/types.js.map +1 -0
  432. package/dist/plugin/index.d.ts +13 -255
  433. package/dist/plugin/index.d.ts.map +1 -0
  434. package/dist/plugin/index.js +276 -553
  435. package/dist/plugin/index.js.map +1 -0
  436. package/dist/render/HybridPageRenderer.d.ts +85 -0
  437. package/dist/render/HybridPageRenderer.d.ts.map +1 -0
  438. package/dist/render/HybridPageRenderer.js +29 -0
  439. package/dist/render/HybridPageRenderer.js.map +1 -0
  440. package/dist/render/PageRenderer.d.ts +51 -0
  441. package/dist/render/PageRenderer.d.ts.map +1 -0
  442. package/dist/render/PageRenderer.js +61 -0
  443. package/dist/render/PageRenderer.js.map +1 -0
  444. package/dist/render/PuckEditor.client.d.ts +66 -0
  445. package/dist/render/PuckEditor.client.d.ts.map +1 -0
  446. package/dist/render/PuckEditor.client.js +66 -0
  447. package/dist/render/PuckEditor.client.js.map +1 -0
  448. package/dist/render/index.d.ts +8 -106
  449. package/dist/render/index.d.ts.map +1 -0
  450. package/dist/render/index.js +10 -2162
  451. package/dist/render/index.js.map +1 -0
  452. package/dist/theme/context.d.ts +59 -0
  453. package/dist/theme/context.d.ts.map +1 -0
  454. package/dist/theme/context.js +73 -0
  455. package/dist/theme/context.js.map +1 -0
  456. package/dist/theme/defaults.d.ts +39 -0
  457. package/dist/theme/defaults.d.ts.map +1 -0
  458. package/dist/theme/defaults.js +72 -0
  459. package/dist/theme/defaults.js.map +1 -0
  460. package/dist/theme/example.d.ts +30 -0
  461. package/dist/theme/example.d.ts.map +1 -0
  462. package/dist/theme/example.js +89 -0
  463. package/dist/theme/example.js.map +1 -0
  464. package/dist/theme/index.d.ts +17 -140
  465. package/dist/theme/index.d.ts.map +1 -0
  466. package/dist/theme/index.js +34 -200
  467. package/dist/theme/index.js.map +1 -0
  468. package/dist/{types-_6MvjyKv.d.ts → theme/types.d.ts} +8 -9
  469. package/dist/theme/types.d.ts.map +1 -0
  470. package/dist/theme/types.js +9 -0
  471. package/dist/theme/types.js.map +1 -0
  472. package/dist/theme/utils.d.ts +30 -0
  473. package/dist/theme/utils.d.ts.map +1 -0
  474. package/dist/theme/utils.js +84 -0
  475. package/dist/theme/utils.js.map +1 -0
  476. package/dist/{index-CQu6SzDg.d.mts → types/index.d.ts} +120 -115
  477. package/dist/types/index.d.ts.map +1 -0
  478. package/dist/types/index.js +2 -0
  479. package/dist/types/index.js.map +1 -0
  480. package/dist/utils/index.d.ts +23 -257
  481. package/dist/utils/index.d.ts.map +1 -0
  482. package/dist/utils/index.js +56 -425
  483. package/dist/utils/index.js.map +1 -0
  484. package/dist/utils/{index.d.mts → migration.d.ts} +16 -112
  485. package/dist/utils/migration.d.ts.map +1 -0
  486. package/dist/utils/migration.js +309 -0
  487. package/dist/utils/migration.js.map +1 -0
  488. package/dist/utils/validation.d.ts +89 -0
  489. package/dist/utils/validation.d.ts.map +1 -0
  490. package/dist/utils/validation.js +247 -0
  491. package/dist/utils/validation.js.map +1 -0
  492. package/dist/views/PuckConfigContext.d.ts +71 -0
  493. package/dist/views/PuckConfigContext.d.ts.map +1 -0
  494. package/dist/views/PuckConfigContext.js +45 -0
  495. package/dist/views/PuckConfigContext.js.map +1 -0
  496. package/dist/views/PuckEditorClient.d.ts +73 -0
  497. package/dist/views/PuckEditorClient.d.ts.map +1 -0
  498. package/dist/views/PuckEditorClient.js +130 -0
  499. package/dist/views/PuckEditorClient.js.map +1 -0
  500. package/dist/views/PuckEditorView.d.ts +19 -0
  501. package/dist/views/PuckEditorView.d.ts.map +1 -0
  502. package/dist/views/PuckEditorView.js +106 -0
  503. package/dist/views/PuckEditorView.js.map +1 -0
  504. package/dist/views/index.d.ts +10 -0
  505. package/dist/views/index.d.ts.map +1 -0
  506. package/dist/views/index.js +10 -0
  507. package/dist/views/index.js.map +1 -0
  508. package/package.json +50 -72
  509. package/dist/AccordionClient.d.mts +0 -24
  510. package/dist/AccordionClient.d.ts +0 -24
  511. package/dist/AccordionClient.js +0 -786
  512. package/dist/AccordionClient.mjs +0 -784
  513. package/dist/AnimatedWrapper.d.mts +0 -30
  514. package/dist/AnimatedWrapper.d.ts +0 -30
  515. package/dist/AnimatedWrapper.js +0 -379
  516. package/dist/AnimatedWrapper.mjs +0 -377
  517. package/dist/admin/client.d.mts +0 -108
  518. package/dist/admin/client.mjs +0 -173
  519. package/dist/admin/index.d.mts +0 -157
  520. package/dist/admin/index.mjs +0 -29
  521. package/dist/api/index.d.mts +0 -460
  522. package/dist/api/index.mjs +0 -578
  523. package/dist/components/index.css +0 -339
  524. package/dist/components/index.d.mts +0 -222
  525. package/dist/components/index.mjs +0 -9109
  526. package/dist/config/config.editor.css +0 -339
  527. package/dist/config/config.editor.d.mts +0 -153
  528. package/dist/config/config.editor.mjs +0 -9347
  529. package/dist/config/index.d.mts +0 -68
  530. package/dist/config/index.mjs +0 -2008
  531. package/dist/editor/index.d.mts +0 -784
  532. package/dist/editor/index.mjs +0 -4500
  533. package/dist/fields/index.d.mts +0 -600
  534. package/dist/fields/index.mjs +0 -7569
  535. package/dist/index-CoUQnyC3.d.ts +0 -327
  536. package/dist/index.d.mts +0 -6
  537. package/dist/index.mjs +0 -555
  538. package/dist/layouts/index.d.mts +0 -96
  539. package/dist/layouts/index.mjs +0 -378
  540. package/dist/plugin/index.d.mts +0 -289
  541. package/dist/plugin/index.mjs +0 -555
  542. package/dist/render/index.d.mts +0 -109
  543. package/dist/render/index.mjs +0 -2140
  544. package/dist/shared-DeNKN95N.d.ts +0 -546
  545. package/dist/theme/index.d.mts +0 -155
  546. package/dist/theme/index.mjs +0 -186
  547. package/dist/types-D7D3rZ1J.d.mts +0 -116
  548. package/dist/types-_6MvjyKv.d.mts +0 -104
  549. package/dist/utils/index.mjs +0 -412
  550. package/dist/utils-DaRs9t0J.d.mts +0 -85
  551. package/dist/utils-gAvt0Vhw.d.ts +0 -85
  552. package/examples/README.md +0 -247
  553. package/examples/api/puck/pages/[id]/route.ts +0 -64
  554. package/examples/api/puck/pages/[id]/versions/route.ts +0 -47
  555. package/examples/api/puck/pages/route.ts +0 -45
  556. package/examples/app/(frontend)/page.tsx +0 -94
  557. package/examples/app/(manage)/layout.tsx +0 -31
  558. package/examples/app/[...slug]/page.tsx +0 -101
  559. package/examples/app/pages/[id]/edit/page.tsx +0 -148
  560. package/examples/components/CustomBanner.tsx +0 -368
  561. package/examples/config/custom-config.ts +0 -223
  562. package/examples/config/payload.config.example.ts +0 -64
  563. package/examples/lib/puck-layouts.ts +0 -258
  564. package/examples/lib/puck-theme.ts +0 -94
  565. package/examples/styles/puck-theme.css +0 -171
@@ -1,2140 +0,0 @@
1
- import { Render } from '@measured/puck';
2
- import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
3
- import { AnimatedWrapper } from '../AnimatedWrapper';
4
- import * as React from 'react';
5
- import { memo, useCallback, createElement } from 'react';
6
- import { X } from 'lucide-react';
7
- import { Slot } from '@radix-ui/react-slot';
8
- import { cva } from 'class-variance-authority';
9
- import { clsx } from 'clsx';
10
- import { twMerge } from 'tailwind-merge';
11
- import * as LabelPrimitive from '@radix-ui/react-label';
12
- import { AccordionClient } from '../AccordionClient';
13
-
14
- // src/render/PageRenderer.tsx
15
-
16
- // src/layouts/defaults.ts
17
- var defaultLayout = {
18
- value: "default",
19
- label: "Default",
20
- description: "Standard page layout with contained content width",
21
- classes: {
22
- wrapper: "",
23
- container: "mx-auto px-4 sm:px-6 lg:px-8",
24
- content: ""
25
- },
26
- maxWidth: "1200px",
27
- fullWidth: false
28
- };
29
- var landingLayout = {
30
- value: "landing",
31
- label: "Landing",
32
- description: "Full-width sections with no global container constraints",
33
- classes: {
34
- wrapper: "",
35
- container: "",
36
- content: ""
37
- },
38
- fullWidth: true
39
- };
40
- var fullWidthLayout = {
41
- value: "full-width",
42
- label: "Full Width",
43
- description: "Content spans the full viewport width",
44
- classes: {
45
- wrapper: "w-full",
46
- container: "w-full",
47
- content: ""
48
- },
49
- maxWidth: "100%",
50
- fullWidth: true
51
- };
52
- var DEFAULT_LAYOUTS = [
53
- defaultLayout,
54
- landingLayout,
55
- fullWidthLayout
56
- ];
57
-
58
- // src/layouts/utils.ts
59
- function getLayout(layouts, value, fallback = "default") {
60
- const layout = layouts.find((l) => l.value === value);
61
- if (layout) return layout;
62
- if (value !== fallback) {
63
- return layouts.find((l) => l.value === fallback);
64
- }
65
- return layouts[0];
66
- }
67
- function layoutsToOptions(layouts) {
68
- return layouts.map(({ value, label, description }) => ({
69
- value,
70
- label,
71
- description
72
- }));
73
- }
74
-
75
- // src/fields/shared.ts
76
- function cn(...classes) {
77
- return classes.filter(Boolean).join(" ");
78
- }
79
- function isLegacyWidthValue(value) {
80
- if (!value || typeof value !== "object") return false;
81
- const v = value;
82
- return typeof v.maxWidth === "number" && typeof v.unit === "string" && typeof v.mode === "string" && !("minWidth" in v) && !("minHeight" in v) && !("maxHeight" in v);
83
- }
84
- var alignmentMap = {
85
- left: "text-left",
86
- center: "text-center",
87
- right: "text-right"
88
- };
89
- var shadowMap = {
90
- none: "",
91
- sm: "shadow-sm",
92
- md: "shadow-md",
93
- lg: "shadow-lg",
94
- xl: "shadow-xl",
95
- "2xl": "shadow-2xl"
96
- };
97
- var headingLevelMap = {
98
- h1: "text-4xl md:text-5xl lg:text-6xl font-bold tracking-tight",
99
- h2: "text-3xl md:text-4xl font-bold tracking-tight",
100
- h3: "text-2xl md:text-3xl font-semibold",
101
- h4: "text-xl md:text-2xl font-semibold",
102
- h5: "text-lg md:text-xl font-medium",
103
- h6: "text-base md:text-lg font-medium"
104
- };
105
- var textSizeMap = {
106
- xs: "text-xs",
107
- sm: "text-sm",
108
- base: "text-base",
109
- lg: "text-lg",
110
- xl: "text-xl",
111
- "2xl": "text-2xl"
112
- };
113
- var aspectRatioMap = {
114
- auto: "",
115
- square: "aspect-square",
116
- video: "aspect-video",
117
- portrait: "aspect-[3/4]",
118
- landscape: "aspect-[4/3]",
119
- wide: "aspect-[21/9]"
120
- };
121
- var dividerStyleMap = {
122
- solid: "border-solid",
123
- dashed: "border-dashed",
124
- dotted: "border-dotted"
125
- };
126
- var justifyContentMap = {
127
- start: "justify-start",
128
- "flex-start": "justify-start",
129
- center: "justify-center",
130
- end: "justify-end",
131
- "flex-end": "justify-end",
132
- between: "justify-between",
133
- "space-between": "justify-between",
134
- around: "justify-around",
135
- "space-around": "justify-around",
136
- evenly: "justify-evenly",
137
- "space-evenly": "justify-evenly"
138
- };
139
- var alignItemsMap = {
140
- start: "items-start",
141
- "flex-start": "items-start",
142
- center: "items-center",
143
- end: "items-end",
144
- "flex-end": "items-end",
145
- stretch: "items-stretch",
146
- baseline: "items-baseline"
147
- };
148
- function hexToRgb(hex) {
149
- const clean = hex.replace(/^#/, "");
150
- if (clean.length !== 6) return null;
151
- const r = parseInt(clean.substring(0, 2), 16);
152
- const g = parseInt(clean.substring(2, 4), 16);
153
- const b = parseInt(clean.substring(4, 6), 16);
154
- if (isNaN(r) || isNaN(g) || isNaN(b)) return null;
155
- return { r, g, b };
156
- }
157
- function colorValueToCSS(color) {
158
- if (!color?.hex) return void 0;
159
- const rgb = hexToRgb(color.hex);
160
- if (!rgb) return color.hex;
161
- const opacity = (color.opacity ?? 100) / 100;
162
- if (opacity === 1) {
163
- return color.hex;
164
- }
165
- return `rgba(${rgb.r}, ${rgb.g}, ${rgb.b}, ${opacity})`;
166
- }
167
- function paddingValueToCSS(padding) {
168
- if (!padding) return void 0;
169
- const { top, right, bottom, left, unit } = padding;
170
- if (top === right && right === bottom && bottom === left) {
171
- return `${top}${unit}`;
172
- }
173
- if (top === bottom && left === right) {
174
- return `${top}${unit} ${right}${unit}`;
175
- }
176
- if (left === right) {
177
- return `${top}${unit} ${right}${unit} ${bottom}${unit}`;
178
- }
179
- return `${top}${unit} ${right}${unit} ${bottom}${unit} ${left}${unit}`;
180
- }
181
- function marginValueToCSS(margin) {
182
- if (!margin) return void 0;
183
- const { top, right, bottom, left, unit } = margin;
184
- if (top === right && right === bottom && bottom === left) {
185
- return `${top}${unit}`;
186
- }
187
- if (top === bottom && left === right) {
188
- return `${top}${unit} ${right}${unit}`;
189
- }
190
- if (left === right) {
191
- return `${top}${unit} ${right}${unit} ${bottom}${unit}`;
192
- }
193
- return `${top}${unit} ${right}${unit} ${bottom}${unit} ${left}${unit}`;
194
- }
195
- function borderValueToCSS(border) {
196
- if (!border || border.style === "none") return void 0;
197
- const color = colorValueToCSS(border.color) || "#000000";
198
- const style = {};
199
- if (border.sides.top) {
200
- style.borderTopWidth = `${border.width}px`;
201
- style.borderTopStyle = border.style;
202
- style.borderTopColor = color;
203
- }
204
- if (border.sides.right) {
205
- style.borderRightWidth = `${border.width}px`;
206
- style.borderRightStyle = border.style;
207
- style.borderRightColor = color;
208
- }
209
- if (border.sides.bottom) {
210
- style.borderBottomWidth = `${border.width}px`;
211
- style.borderBottomStyle = border.style;
212
- style.borderBottomColor = color;
213
- }
214
- if (border.sides.left) {
215
- style.borderLeftWidth = `${border.width}px`;
216
- style.borderLeftStyle = border.style;
217
- style.borderLeftColor = color;
218
- }
219
- if (border.radius > 0) {
220
- style.borderRadius = `${border.radius}px`;
221
- }
222
- return Object.keys(style).length > 0 ? style : void 0;
223
- }
224
- function widthValueToCSS(width) {
225
- if (!width) return void 0;
226
- const style = {};
227
- if (width.mode === "full") {
228
- style.width = "100%";
229
- style.maxWidth = "100%";
230
- } else {
231
- style.maxWidth = `${width.maxWidth}${width.unit}`;
232
- style.width = "100%";
233
- }
234
- switch (width.alignment) {
235
- case "left":
236
- style.marginLeft = "0";
237
- style.marginRight = "auto";
238
- break;
239
- case "center":
240
- style.marginLeft = "auto";
241
- style.marginRight = "auto";
242
- break;
243
- case "right":
244
- style.marginLeft = "auto";
245
- style.marginRight = "0";
246
- break;
247
- }
248
- return style;
249
- }
250
- function dimensionsValueToCSS(dimensions) {
251
- if (!dimensions) return void 0;
252
- if (isLegacyWidthValue(dimensions)) {
253
- return widthValueToCSS(dimensions);
254
- }
255
- const dim = dimensions;
256
- const style = {};
257
- if (dim.mode === "full") {
258
- style.width = "100%";
259
- style.maxWidth = "100%";
260
- } else {
261
- style.width = "100%";
262
- if (dim.maxWidth?.enabled !== false && dim.maxWidth?.value > 0) {
263
- style.maxWidth = `${dim.maxWidth.value}${dim.maxWidth.unit}`;
264
- }
265
- if (dim.minWidth?.enabled && dim.minWidth.value > 0) {
266
- style.minWidth = `${dim.minWidth.value}${dim.minWidth.unit}`;
267
- }
268
- }
269
- if (dim.minHeight?.enabled && dim.minHeight.value > 0) {
270
- style.minHeight = `${dim.minHeight.value}${dim.minHeight.unit}`;
271
- }
272
- if (dim.maxHeight?.enabled && dim.maxHeight.value > 0) {
273
- style.maxHeight = `${dim.maxHeight.value}${dim.maxHeight.unit}`;
274
- }
275
- switch (dim.alignment) {
276
- case "left":
277
- style.marginLeft = "0";
278
- style.marginRight = "auto";
279
- break;
280
- case "center":
281
- style.marginLeft = "auto";
282
- style.marginRight = "auto";
283
- break;
284
- case "right":
285
- style.marginLeft = "auto";
286
- style.marginRight = "0";
287
- break;
288
- }
289
- return style;
290
- }
291
- function gradientValueToCSS(gradient) {
292
- if (!gradient?.stops || gradient.stops.length === 0) {
293
- return "transparent";
294
- }
295
- const sortedStops = [...gradient.stops].sort((a, b) => a.position - b.position);
296
- const stopsCSS = sortedStops.map((stop) => {
297
- const color = colorValueToCSS(stop.color) || "transparent";
298
- return `${color} ${stop.position}%`;
299
- }).join(", ");
300
- if (gradient.type === "radial") {
301
- const shape = gradient.radialShape || "circle";
302
- const position = gradient.radialPosition || "center";
303
- return `radial-gradient(${shape} at ${position}, ${stopsCSS})`;
304
- }
305
- return `linear-gradient(${gradient.angle}deg, ${stopsCSS})`;
306
- }
307
- function positionToCSS(position) {
308
- const positionMap = {
309
- center: "center",
310
- top: "top",
311
- bottom: "bottom",
312
- left: "left",
313
- right: "right",
314
- "top-left": "top left",
315
- "top-right": "top right",
316
- "bottom-left": "bottom left",
317
- "bottom-right": "bottom right"
318
- };
319
- return position ? positionMap[position] || "center" : "center";
320
- }
321
- function maskDirectionToCSS(direction) {
322
- const directionMap = {
323
- "to-top": "to top",
324
- "to-bottom": "to bottom",
325
- "to-left": "to left",
326
- "to-right": "to right",
327
- "to-top-left": "to top left",
328
- "to-top-right": "to top right",
329
- "to-bottom-left": "to bottom left",
330
- "to-bottom-right": "to bottom right",
331
- "from-center": "radial"
332
- // Not used for linear, handled separately in maskToCSS
333
- };
334
- return directionMap[direction] || "to bottom";
335
- }
336
- function maskToCSS(mask) {
337
- const startAlpha = (mask.startOpacity ?? 100) / 100;
338
- const endAlpha = (mask.endOpacity ?? 0) / 100;
339
- if (mask.direction === "from-center") {
340
- return `radial-gradient(circle at center, rgba(0,0,0,${startAlpha}) ${mask.startPosition}%, rgba(0,0,0,${endAlpha}) ${mask.endPosition}%)`;
341
- }
342
- const direction = maskDirectionToCSS(mask.direction);
343
- return `linear-gradient(${direction}, rgba(0,0,0,${startAlpha}) ${mask.startPosition}%, rgba(0,0,0,${endAlpha}) ${mask.endPosition}%)`;
344
- }
345
- function backgroundValueToCSS(bg) {
346
- if (!bg || bg.type === "none") {
347
- return {};
348
- }
349
- const style = {};
350
- switch (bg.type) {
351
- case "solid":
352
- if (bg.solid?.hex) {
353
- style.backgroundColor = colorValueToCSS(bg.solid);
354
- }
355
- break;
356
- case "gradient":
357
- if (bg.gradient && bg.gradient.stops && bg.gradient.stops.length > 0) {
358
- style.background = gradientValueToCSS(bg.gradient);
359
- }
360
- break;
361
- case "image":
362
- if (bg.image?.media?.url) {
363
- const imageUrl = bg.image.media.url;
364
- const size = bg.image.size || "cover";
365
- const position = positionToCSS(bg.image.position);
366
- const repeat = bg.image.repeat || "no-repeat";
367
- const attachment = bg.image.attachment || "scroll";
368
- if (bg.overlay?.enabled) {
369
- const overlayCSS = bg.overlay.type === "solid" ? colorValueToCSS(bg.overlay.solid) : gradientValueToCSS(bg.overlay.gradient);
370
- if (bg.overlay.type === "solid" && overlayCSS) {
371
- style.backgroundImage = `linear-gradient(${overlayCSS}, ${overlayCSS}), url(${imageUrl})`;
372
- } else {
373
- style.backgroundImage = `${overlayCSS}, url(${imageUrl})`;
374
- }
375
- style.backgroundSize = `auto, ${size}`;
376
- style.backgroundPosition = `center, ${position}`;
377
- style.backgroundRepeat = `no-repeat, ${repeat}`;
378
- style.backgroundAttachment = `scroll, ${attachment}`;
379
- } else {
380
- style.backgroundImage = `url(${imageUrl})`;
381
- style.backgroundSize = size;
382
- style.backgroundPosition = position;
383
- style.backgroundRepeat = repeat;
384
- style.backgroundAttachment = attachment;
385
- }
386
- if (bg.image.mask?.enabled) {
387
- const maskCSS = maskToCSS(bg.image.mask);
388
- style.maskImage = maskCSS;
389
- style.WebkitMaskImage = maskCSS;
390
- }
391
- }
392
- break;
393
- }
394
- return style;
395
- }
396
- function transformOriginToCSS(origin) {
397
- const originMap = {
398
- center: "center",
399
- top: "top",
400
- bottom: "bottom",
401
- left: "left",
402
- right: "right",
403
- "top-left": "top left",
404
- "top-right": "top right",
405
- "bottom-left": "bottom left",
406
- "bottom-right": "bottom right"
407
- };
408
- return originMap[origin] || "center";
409
- }
410
- function transformValueToCSS(transform) {
411
- if (!transform) return void 0;
412
- const style = {};
413
- const transforms = [];
414
- if (transform.enable3D && transform.perspective) {
415
- style.perspective = `${transform.perspective}px`;
416
- }
417
- if (transform.translateX !== 0 || transform.translateY !== 0) {
418
- transforms.push(
419
- `translate(${transform.translateX}${transform.translateUnit}, ${transform.translateY}${transform.translateUnit})`
420
- );
421
- }
422
- if (transform.rotate !== 0) {
423
- transforms.push(`rotate(${transform.rotate}deg)`);
424
- }
425
- if (transform.enable3D) {
426
- if (transform.rotateX && transform.rotateX !== 0) {
427
- transforms.push(`rotateX(${transform.rotateX}deg)`);
428
- }
429
- if (transform.rotateY && transform.rotateY !== 0) {
430
- transforms.push(`rotateY(${transform.rotateY}deg)`);
431
- }
432
- }
433
- if (transform.scaleX !== 1 || transform.scaleY !== 1) {
434
- if (transform.scaleX === transform.scaleY) {
435
- transforms.push(`scale(${transform.scaleX})`);
436
- } else {
437
- transforms.push(`scale(${transform.scaleX}, ${transform.scaleY})`);
438
- }
439
- }
440
- if (transform.skewX !== 0 || transform.skewY !== 0) {
441
- if (transform.skewX !== 0 && transform.skewY !== 0) {
442
- transforms.push(`skew(${transform.skewX}deg, ${transform.skewY}deg)`);
443
- } else if (transform.skewX !== 0) {
444
- transforms.push(`skewX(${transform.skewX}deg)`);
445
- } else {
446
- transforms.push(`skewY(${transform.skewY}deg)`);
447
- }
448
- }
449
- if (transforms.length > 0) {
450
- style.transform = transforms.join(" ");
451
- }
452
- if (transform.origin !== "center") {
453
- style.transformOrigin = transformOriginToCSS(transform.origin);
454
- }
455
- if (transform.enable3D) {
456
- style.transformStyle = "preserve-3d";
457
- }
458
- return Object.keys(style).length > 0 ? style : void 0;
459
- }
460
- var BREAKPOINTS = [
461
- { key: "xs", label: "XS", minWidth: null },
462
- { key: "sm", label: "SM", minWidth: 640 },
463
- { key: "md", label: "MD", minWidth: 768 },
464
- { key: "lg", label: "LG", minWidth: 1024 },
465
- { key: "xl", label: "XL", minWidth: 1280 }
466
- ];
467
- function isResponsiveValue(value) {
468
- if (!value || typeof value !== "object") return false;
469
- return "xs" in value;
470
- }
471
- function camelToKebab(str) {
472
- return str.replace(/[A-Z]/g, (letter) => `-${letter.toLowerCase()}`);
473
- }
474
- function cssPropertiesToString(styles) {
475
- return Object.entries(styles).filter(([, value]) => value !== void 0 && value !== null && value !== "").map(([key, value]) => `${camelToKebab(key)}: ${value}`).join("; ");
476
- }
477
- function responsiveValueToCSS(value, converter, uniqueId) {
478
- if (value === null || value === void 0) {
479
- return { baseStyles: {}, mediaQueryCSS: "" };
480
- }
481
- if (!isResponsiveValue(value)) {
482
- const styles = converter(value);
483
- return {
484
- baseStyles: styles || {},
485
- mediaQueryCSS: ""
486
- };
487
- }
488
- const mediaQueries = [];
489
- let baseStyles = {};
490
- BREAKPOINTS.forEach((bp) => {
491
- const bpValue = value[bp.key];
492
- if (bpValue === void 0) return;
493
- const cssProps = converter(bpValue);
494
- if (!cssProps) return;
495
- if (bp.key === "xs") {
496
- baseStyles = cssProps;
497
- } else {
498
- const styleString = cssPropertiesToString(cssProps);
499
- if (styleString) {
500
- mediaQueries.push(
501
- `@media (min-width: ${bp.minWidth}px) { .${uniqueId} { ${styleString} } }`
502
- );
503
- }
504
- }
505
- });
506
- return { baseStyles, mediaQueryCSS: mediaQueries.join("\n") };
507
- }
508
- function visibilityValueToCSS(visibility, uniqueId) {
509
- if (!visibility) return "";
510
- const mediaQueries = [];
511
- const breakpointWidths = {
512
- xs: null,
513
- // 0px
514
- sm: 640,
515
- md: 768,
516
- lg: 1024,
517
- xl: 1280
518
- };
519
- const getNextBreakpointWidth = (bp) => {
520
- const order = ["xs", "sm", "md", "lg", "xl"];
521
- const index = order.indexOf(bp);
522
- if (index === -1 || index === order.length - 1) return null;
523
- return breakpointWidths[order[index + 1]];
524
- };
525
- if (visibility.xs === false) {
526
- const nextWidth = getNextBreakpointWidth("xs");
527
- if (nextWidth) {
528
- mediaQueries.push(`@media (max-width: ${nextWidth - 1}px) { .${uniqueId} { display: none; } }`);
529
- } else {
530
- mediaQueries.push(`.${uniqueId} { display: none; }`);
531
- }
532
- }
533
- BREAKPOINTS.slice(1).forEach((bp) => {
534
- if (visibility[bp.key] === false) {
535
- const minWidth = breakpointWidths[bp.key];
536
- const maxWidth = getNextBreakpointWidth(bp.key);
537
- if (minWidth && maxWidth) {
538
- mediaQueries.push(
539
- `@media (min-width: ${minWidth}px) and (max-width: ${maxWidth - 1}px) { .${uniqueId} { display: none; } }`
540
- );
541
- } else if (minWidth) {
542
- mediaQueries.push(
543
- `@media (min-width: ${minWidth}px) { .${uniqueId} { display: none; } }`
544
- );
545
- }
546
- }
547
- });
548
- return mediaQueries.join("\n");
549
- }
550
- var stickyFooterContainerStyle = {
551
- minHeight: "100vh",
552
- display: "flex",
553
- flexDirection: "column"
554
- };
555
- var stickyFooterMainStyle = {
556
- flex: 1
557
- };
558
- function LayoutWrapper({ children, layout, className, overrides }) {
559
- if (!layout) {
560
- if (overrides?.background) {
561
- const bgStyles = backgroundValueToCSS(overrides.background);
562
- return /* @__PURE__ */ jsx("div", { style: { minHeight: "100vh", ...bgStyles }, children });
563
- }
564
- return /* @__PURE__ */ jsx(Fragment, { children });
565
- }
566
- const Header = layout.header;
567
- const Footer = layout.footer;
568
- const shouldShowHeader = overrides?.showHeader === "hide" ? false : overrides?.showHeader === "show" ? true : !!Header;
569
- const shouldShowFooter = overrides?.showFooter === "hide" ? false : overrides?.showFooter === "show" ? true : !!Footer;
570
- const useStickyFooter = layout.stickyFooter !== false;
571
- const mainStyle = {
572
- ...layout.stickyHeaderHeight && shouldShowHeader ? { paddingTop: layout.stickyHeaderHeight } : {},
573
- ...useStickyFooter ? stickyFooterMainStyle : {}
574
- };
575
- const outerBackgroundStyles = overrides?.background ? backgroundValueToCSS(overrides.background) : {
576
- ...layout.styles?.wrapper?.background !== void 0 ? { background: layout.styles.wrapper.background } : {},
577
- ...layout.styles?.wrapper?.backgroundAttachment !== void 0 ? { backgroundAttachment: layout.styles.wrapper.backgroundAttachment } : {}
578
- };
579
- const effectiveMaxWidth = overrides?.maxWidth && overrides.maxWidth !== "default" ? overrides.maxWidth : layout.maxWidth;
580
- const wrapWithStickyFooter = (content) => {
581
- if (useStickyFooter) {
582
- return /* @__PURE__ */ jsx("div", { style: { ...stickyFooterContainerStyle, ...outerBackgroundStyles }, children: content });
583
- }
584
- const hasBackground = Object.keys(outerBackgroundStyles).length > 0;
585
- if (hasBackground) {
586
- return /* @__PURE__ */ jsx("div", { style: { minHeight: "100vh", ...outerBackgroundStyles }, children: content });
587
- }
588
- return /* @__PURE__ */ jsx(Fragment, { children: content });
589
- };
590
- if (layout.wrapper) {
591
- const CustomWrapper = layout.wrapper;
592
- return wrapWithStickyFooter(
593
- /* @__PURE__ */ jsxs(Fragment, { children: [
594
- shouldShowHeader && Header && /* @__PURE__ */ jsx(Header, {}),
595
- /* @__PURE__ */ jsx("main", { style: Object.keys(mainStyle).length > 0 ? mainStyle : void 0, children: /* @__PURE__ */ jsx(CustomWrapper, { children }) }),
596
- shouldShowFooter && Footer && /* @__PURE__ */ jsx(Footer, {})
597
- ] })
598
- );
599
- }
600
- const wrapperStyle = {
601
- ...layout.styles?.wrapper
602
- };
603
- const containerStyle = {
604
- ...effectiveMaxWidth && !layout.fullWidth ? { maxWidth: effectiveMaxWidth } : {},
605
- ...layout.styles?.container
606
- };
607
- const contentStyle = {
608
- ...layout.styles?.content
609
- };
610
- const dataAttrs = {
611
- "data-layout": layout.value,
612
- ...layout.dataAttributes
613
- };
614
- if (layout.fullWidth) {
615
- return wrapWithStickyFooter(
616
- /* @__PURE__ */ jsxs(Fragment, { children: [
617
- shouldShowHeader && Header && /* @__PURE__ */ jsx(Header, {}),
618
- /* @__PURE__ */ jsx(
619
- "main",
620
- {
621
- className: [layout.classes?.wrapper, className].filter(Boolean).join(" ") || void 0,
622
- style: {
623
- ...mainStyle,
624
- ...Object.keys(wrapperStyle).length > 0 ? wrapperStyle : {}
625
- },
626
- ...dataAttrs,
627
- children
628
- }
629
- ),
630
- shouldShowFooter && Footer && /* @__PURE__ */ jsx(Footer, {})
631
- ] })
632
- );
633
- }
634
- return wrapWithStickyFooter(
635
- /* @__PURE__ */ jsxs(Fragment, { children: [
636
- shouldShowHeader && Header && /* @__PURE__ */ jsx(Header, {}),
637
- /* @__PURE__ */ jsx(
638
- "main",
639
- {
640
- className: layout.classes?.wrapper || void 0,
641
- style: {
642
- ...mainStyle,
643
- ...Object.keys(wrapperStyle).length > 0 ? wrapperStyle : {}
644
- },
645
- ...dataAttrs,
646
- children: /* @__PURE__ */ jsx(
647
- "div",
648
- {
649
- className: [layout.classes?.container, className].filter(Boolean).join(" ") || void 0,
650
- style: Object.keys(containerStyle).length > 0 ? containerStyle : void 0,
651
- children: /* @__PURE__ */ jsx(
652
- "div",
653
- {
654
- className: layout.classes?.content || void 0,
655
- style: Object.keys(contentStyle).length > 0 ? contentStyle : void 0,
656
- children
657
- }
658
- )
659
- }
660
- )
661
- }
662
- ),
663
- shouldShowFooter && Footer && /* @__PURE__ */ jsx(Footer, {})
664
- ] })
665
- );
666
- }
667
- var idCounter = 0;
668
- function generateUniqueId() {
669
- return `c${(++idCounter).toString(36)}${Math.random().toString(36).slice(2, 6)}`;
670
- }
671
- var defaultProps = {
672
- content: [],
673
- background: null,
674
- customPadding: null,
675
- dimensions: null,
676
- border: null,
677
- margin: null,
678
- animation: null,
679
- innerBackground: null,
680
- innerPadding: null,
681
- innerBorder: null,
682
- visibility: null
683
- };
684
- var ContainerConfig = {
685
- label: "Container",
686
- fields: {
687
- content: { type: "slot" }
688
- },
689
- defaultProps,
690
- render: ({
691
- content: Content,
692
- background,
693
- customPadding,
694
- dimensions,
695
- border,
696
- margin,
697
- animation,
698
- innerBackground,
699
- innerPadding,
700
- innerBorder,
701
- visibility
702
- }) => {
703
- const uniqueId = generateUniqueId();
704
- const outerClass = `puck-container-outer-${uniqueId}`;
705
- const innerClass = `puck-container-inner-${uniqueId}`;
706
- const mediaQueries = [];
707
- const outerBackgroundStyles = backgroundValueToCSS(background);
708
- const outerStyles = {
709
- ...outerBackgroundStyles
710
- };
711
- const outerPaddingResult = responsiveValueToCSS(
712
- customPadding,
713
- (v) => ({ padding: paddingValueToCSS(v) }),
714
- outerClass
715
- );
716
- Object.assign(outerStyles, outerPaddingResult.baseStyles);
717
- if (outerPaddingResult.mediaQueryCSS) {
718
- mediaQueries.push(outerPaddingResult.mediaQueryCSS);
719
- }
720
- const outerBorderStyles = borderValueToCSS(border);
721
- if (outerBorderStyles) {
722
- Object.assign(outerStyles, outerBorderStyles);
723
- }
724
- const marginResult = responsiveValueToCSS(
725
- margin,
726
- (v) => ({ margin: marginValueToCSS(v) }),
727
- outerClass
728
- );
729
- Object.assign(outerStyles, marginResult.baseStyles);
730
- if (marginResult.mediaQueryCSS) {
731
- mediaQueries.push(marginResult.mediaQueryCSS);
732
- }
733
- const innerBackgroundStyles = backgroundValueToCSS(innerBackground);
734
- const innerStyles = {
735
- ...innerBackgroundStyles
736
- };
737
- const dimensionsResult = responsiveValueToCSS(
738
- dimensions,
739
- dimensionsValueToCSS,
740
- innerClass
741
- );
742
- Object.assign(innerStyles, dimensionsResult.baseStyles);
743
- if (dimensionsResult.mediaQueryCSS) {
744
- mediaQueries.push(dimensionsResult.mediaQueryCSS);
745
- }
746
- const innerPaddingResult = responsiveValueToCSS(
747
- innerPadding,
748
- (v) => ({ padding: paddingValueToCSS(v) }),
749
- innerClass
750
- );
751
- Object.assign(innerStyles, innerPaddingResult.baseStyles);
752
- if (innerPaddingResult.mediaQueryCSS) {
753
- mediaQueries.push(innerPaddingResult.mediaQueryCSS);
754
- }
755
- const innerBorderStyles = borderValueToCSS(innerBorder);
756
- if (innerBorderStyles) {
757
- Object.assign(innerStyles, innerBorderStyles);
758
- }
759
- const visibilityCSS = visibilityValueToCSS(visibility, outerClass);
760
- if (visibilityCSS) {
761
- mediaQueries.push(visibilityCSS);
762
- }
763
- const contentClasses = cn("px-4", innerClass);
764
- const hasInnerStyles = Object.keys(innerStyles).length > 0;
765
- const allMediaQueryCSS = mediaQueries.join("\n");
766
- const ContentSlot = Content;
767
- return /* @__PURE__ */ jsxs(AnimatedWrapper, { animation, children: [
768
- allMediaQueryCSS && /* @__PURE__ */ jsx("style", { children: allMediaQueryCSS }),
769
- /* @__PURE__ */ jsx("div", { className: outerClass, style: outerStyles, children: hasInnerStyles ? /* @__PURE__ */ jsx("div", { className: contentClasses, style: innerStyles, children: /* @__PURE__ */ jsx(ContentSlot, {}) }) : /* @__PURE__ */ jsx(ContentSlot, { className: contentClasses, style: innerStyles }) })
770
- ] });
771
- }
772
- };
773
- var idCounter2 = 0;
774
- function generateUniqueId2() {
775
- return `f${(++idCounter2).toString(36)}${Math.random().toString(36).slice(2, 6)}`;
776
- }
777
- var flexDirectionMap = {
778
- row: "flex-row",
779
- column: "flex-col",
780
- "row-reverse": "flex-row-reverse",
781
- "column-reverse": "flex-col-reverse"
782
- };
783
- var flexWrapMap = {
784
- wrap: "flex-wrap",
785
- nowrap: "flex-nowrap",
786
- "wrap-reverse": "flex-wrap-reverse"
787
- };
788
- var defaultProps2 = {
789
- content: [],
790
- direction: "row",
791
- justifyContent: null,
792
- alignItems: null,
793
- gap: 24,
794
- wrap: "wrap",
795
- background: null,
796
- customPadding: null,
797
- margin: null,
798
- dimensions: null,
799
- border: null,
800
- animation: null,
801
- visibility: null
802
- };
803
- var FlexConfig = {
804
- label: "Flex",
805
- fields: {
806
- content: { type: "slot" }
807
- },
808
- defaultProps: defaultProps2,
809
- render: ({
810
- content: Content,
811
- direction,
812
- justifyContent,
813
- alignItems,
814
- gap,
815
- wrap,
816
- background,
817
- customPadding,
818
- margin,
819
- dimensions,
820
- border,
821
- animation,
822
- visibility
823
- }) => {
824
- const uniqueId = generateUniqueId2();
825
- const wrapperClass = `puck-flex-${uniqueId}`;
826
- const contentClass = `puck-flex-content-${uniqueId}`;
827
- const mediaQueries = [];
828
- const backgroundStyles = backgroundValueToCSS(background);
829
- const wrapperStyles = {
830
- ...backgroundStyles
831
- };
832
- const paddingResult = responsiveValueToCSS(
833
- customPadding,
834
- (v) => ({ padding: paddingValueToCSS(v) }),
835
- wrapperClass
836
- );
837
- Object.assign(wrapperStyles, paddingResult.baseStyles);
838
- if (paddingResult.mediaQueryCSS) {
839
- mediaQueries.push(paddingResult.mediaQueryCSS);
840
- }
841
- const borderStyles = borderValueToCSS(border);
842
- if (borderStyles) {
843
- Object.assign(wrapperStyles, borderStyles);
844
- }
845
- const marginResult = responsiveValueToCSS(
846
- margin,
847
- (v) => ({ margin: marginValueToCSS(v) }),
848
- wrapperClass
849
- );
850
- Object.assign(wrapperStyles, marginResult.baseStyles);
851
- if (marginResult.mediaQueryCSS) {
852
- mediaQueries.push(marginResult.mediaQueryCSS);
853
- }
854
- const dimensionsResult = responsiveValueToCSS(
855
- dimensions,
856
- dimensionsValueToCSS,
857
- contentClass
858
- );
859
- const visibilityCSS = visibilityValueToCSS(visibility, wrapperClass);
860
- if (visibilityCSS) {
861
- mediaQueries.push(visibilityCSS);
862
- }
863
- const contentClasses = cn(
864
- "flex w-full min-h-[50px]",
865
- flexDirectionMap[direction],
866
- justifyContent && justifyContentMap[justifyContent],
867
- alignItems && alignItemsMap[alignItems],
868
- flexWrapMap[wrap],
869
- "[&>*]:min-w-0",
870
- contentClass
871
- );
872
- const contentStyles = {
873
- gap,
874
- ...dimensionsResult.baseStyles
875
- };
876
- if (dimensionsResult.mediaQueryCSS) {
877
- mediaQueries.push(dimensionsResult.mediaQueryCSS);
878
- }
879
- const allMediaQueryCSS = mediaQueries.join("\n");
880
- const ContentSlot = Content;
881
- return /* @__PURE__ */ jsxs(AnimatedWrapper, { animation, children: [
882
- allMediaQueryCSS && /* @__PURE__ */ jsx("style", { children: allMediaQueryCSS }),
883
- /* @__PURE__ */ jsx("div", { className: wrapperClass, style: wrapperStyles, children: /* @__PURE__ */ jsx(ContentSlot, { className: contentClasses, style: contentStyles }) })
884
- ] });
885
- }
886
- };
887
- var idCounter3 = 0;
888
- function generateUniqueId3() {
889
- return `g${(++idCounter3).toString(36)}${Math.random().toString(36).slice(2, 6)}`;
890
- }
891
- var defaultProps3 = {
892
- content: [],
893
- numColumns: 3,
894
- gap: 24,
895
- background: null,
896
- customPadding: null,
897
- dimensions: null,
898
- border: null,
899
- margin: null,
900
- animation: null,
901
- visibility: null
902
- };
903
- var GridConfig = {
904
- label: "Grid",
905
- fields: {
906
- content: { type: "slot" }
907
- },
908
- defaultProps: defaultProps3,
909
- render: ({
910
- content: Content,
911
- numColumns,
912
- gap,
913
- background,
914
- customPadding,
915
- dimensions,
916
- border,
917
- margin,
918
- animation,
919
- visibility
920
- }) => {
921
- const uniqueId = generateUniqueId3();
922
- const wrapperClass = `puck-grid-${uniqueId}`;
923
- const contentClass = `puck-grid-content-${uniqueId}`;
924
- const mediaQueries = [];
925
- const backgroundStyles = backgroundValueToCSS(background);
926
- const wrapperStyles = {
927
- ...backgroundStyles
928
- };
929
- const paddingResult = responsiveValueToCSS(
930
- customPadding,
931
- (v) => ({ padding: paddingValueToCSS(v) }),
932
- wrapperClass
933
- );
934
- Object.assign(wrapperStyles, paddingResult.baseStyles);
935
- if (paddingResult.mediaQueryCSS) {
936
- mediaQueries.push(paddingResult.mediaQueryCSS);
937
- }
938
- const borderStyles = borderValueToCSS(border);
939
- if (borderStyles) {
940
- Object.assign(wrapperStyles, borderStyles);
941
- }
942
- const marginResult = responsiveValueToCSS(
943
- margin,
944
- (v) => ({ margin: marginValueToCSS(v) }),
945
- wrapperClass
946
- );
947
- Object.assign(wrapperStyles, marginResult.baseStyles);
948
- if (marginResult.mediaQueryCSS) {
949
- mediaQueries.push(marginResult.mediaQueryCSS);
950
- }
951
- const dimensionsResult = responsiveValueToCSS(
952
- dimensions,
953
- dimensionsValueToCSS,
954
- contentClass
955
- );
956
- const visibilityCSS = visibilityValueToCSS(visibility, wrapperClass);
957
- if (visibilityCSS) {
958
- mediaQueries.push(visibilityCSS);
959
- }
960
- const contentClasses = cn(
961
- "flex flex-col w-full",
962
- "md:grid",
963
- contentClass
964
- );
965
- const contentStyles = {
966
- gap,
967
- ...dimensionsResult.baseStyles
968
- };
969
- if (dimensionsResult.mediaQueryCSS) {
970
- mediaQueries.push(dimensionsResult.mediaQueryCSS);
971
- }
972
- const gridStyles = {
973
- ...contentStyles,
974
- "--grid-cols": numColumns
975
- };
976
- const allMediaQueryCSS = mediaQueries.join("\n");
977
- const ContentSlot = Content;
978
- return /* @__PURE__ */ jsxs(AnimatedWrapper, { animation, children: [
979
- allMediaQueryCSS && /* @__PURE__ */ jsx("style", { children: allMediaQueryCSS }),
980
- /* @__PURE__ */ jsxs("div", { className: wrapperClass, style: wrapperStyles, children: [
981
- /* @__PURE__ */ jsx(ContentSlot, { className: contentClasses, style: gridStyles }),
982
- /* @__PURE__ */ jsx("style", { children: `
983
- @media (min-width: 768px) {
984
- .flex.md\\:grid {
985
- grid-template-columns: repeat(var(--grid-cols), 1fr);
986
- }
987
- }
988
- ` })
989
- ] })
990
- ] });
991
- }
992
- };
993
- var idCounter4 = 0;
994
- function generateUniqueId4() {
995
- return `s${(++idCounter4).toString(36)}${Math.random().toString(36).slice(2, 6)}`;
996
- }
997
- var defaultProps4 = {
998
- id: "",
999
- content: [],
1000
- background: null,
1001
- fullWidth: false,
1002
- customPadding: null,
1003
- dimensions: null,
1004
- border: null,
1005
- margin: null,
1006
- animation: null,
1007
- visibility: null
1008
- };
1009
- var SectionConfig = {
1010
- label: "Section",
1011
- fields: {
1012
- content: { type: "slot" }
1013
- },
1014
- defaultProps: defaultProps4,
1015
- render: ({
1016
- id,
1017
- content: Content,
1018
- background,
1019
- fullWidth,
1020
- customPadding,
1021
- dimensions,
1022
- border,
1023
- margin,
1024
- animation,
1025
- visibility
1026
- }) => {
1027
- const uniqueId = generateUniqueId4();
1028
- const sectionClass = `puck-section-${uniqueId}`;
1029
- const contentClass = `puck-section-content-${uniqueId}`;
1030
- const mediaQueries = [];
1031
- const backgroundStyles = backgroundValueToCSS(background);
1032
- const sectionStyles = {
1033
- ...backgroundStyles
1034
- };
1035
- const paddingResult = responsiveValueToCSS(
1036
- customPadding,
1037
- (v) => ({ padding: paddingValueToCSS(v) }),
1038
- sectionClass
1039
- );
1040
- Object.assign(sectionStyles, paddingResult.baseStyles);
1041
- if (paddingResult.mediaQueryCSS) {
1042
- mediaQueries.push(paddingResult.mediaQueryCSS);
1043
- }
1044
- const borderStyles = borderValueToCSS(border);
1045
- if (borderStyles) {
1046
- Object.assign(sectionStyles, borderStyles);
1047
- }
1048
- const marginResult = responsiveValueToCSS(
1049
- margin,
1050
- (v) => ({ margin: marginValueToCSS(v) }),
1051
- sectionClass
1052
- );
1053
- Object.assign(sectionStyles, marginResult.baseStyles);
1054
- if (marginResult.mediaQueryCSS) {
1055
- mediaQueries.push(marginResult.mediaQueryCSS);
1056
- }
1057
- const visibilityCSS = visibilityValueToCSS(visibility, sectionClass);
1058
- if (visibilityCSS) {
1059
- mediaQueries.push(visibilityCSS);
1060
- }
1061
- const sectionClasses = cn("relative w-full", sectionClass);
1062
- const dimensionsResult = responsiveValueToCSS(
1063
- dimensions,
1064
- dimensionsValueToCSS,
1065
- contentClass
1066
- );
1067
- if (dimensionsResult.mediaQueryCSS) {
1068
- mediaQueries.push(dimensionsResult.mediaQueryCSS);
1069
- }
1070
- const contentClasses = cn(
1071
- "relative z-10",
1072
- // Only apply preset content width if no dimensions set
1073
- !dimensions && !fullWidth && "max-w-[1200px] mx-auto px-4",
1074
- contentClass
1075
- );
1076
- const allMediaQueryCSS = mediaQueries.join("\n");
1077
- const ContentSlot = Content;
1078
- return /* @__PURE__ */ jsxs(AnimatedWrapper, { animation, children: [
1079
- allMediaQueryCSS && /* @__PURE__ */ jsx("style", { children: allMediaQueryCSS }),
1080
- /* @__PURE__ */ jsx(
1081
- "section",
1082
- {
1083
- id: id || void 0,
1084
- className: sectionClasses,
1085
- style: sectionStyles,
1086
- children: /* @__PURE__ */ jsx(ContentSlot, { className: contentClasses, style: dimensionsResult.baseStyles })
1087
- }
1088
- )
1089
- ] });
1090
- }
1091
- };
1092
- var idCounter5 = 0;
1093
- function generateUniqueId5() {
1094
- return `sp${(++idCounter5).toString(36)}${Math.random().toString(36).slice(2, 6)}`;
1095
- }
1096
- var heightMap = {
1097
- "8px": "h-2",
1098
- "16px": "h-4",
1099
- "24px": "h-6",
1100
- "32px": "h-8",
1101
- "48px": "h-12",
1102
- "64px": "h-16",
1103
- "80px": "h-20",
1104
- "96px": "h-24",
1105
- "128px": "h-32"
1106
- };
1107
- var widthMap = {
1108
- "8px": "w-2",
1109
- "16px": "w-4",
1110
- "24px": "w-6",
1111
- "32px": "w-8",
1112
- "48px": "w-12",
1113
- "64px": "w-16",
1114
- "80px": "w-20",
1115
- "96px": "w-24",
1116
- "128px": "w-32"
1117
- };
1118
- var defaultProps5 = {
1119
- size: "24px",
1120
- direction: "vertical",
1121
- visibility: null
1122
- };
1123
- var SpacerConfig = {
1124
- label: "Spacer",
1125
- defaultProps: defaultProps5,
1126
- render: ({ size, direction, visibility }) => {
1127
- const uniqueId = generateUniqueId5();
1128
- const wrapperClass = `puck-spacer-${uniqueId}`;
1129
- const visibilityCSS = visibilityValueToCSS(visibility, wrapperClass);
1130
- const getClasses = () => {
1131
- const heightClass = heightMap[size] || "h-6";
1132
- const widthClass = widthMap[size] || "w-6";
1133
- if (direction === "vertical") {
1134
- return `block ${heightClass} w-full`;
1135
- }
1136
- if (direction === "horizontal") {
1137
- return `inline-block ${widthClass} h-full`;
1138
- }
1139
- return `block ${heightClass} ${widthClass}`;
1140
- };
1141
- return /* @__PURE__ */ jsxs(Fragment, { children: [
1142
- visibilityCSS && /* @__PURE__ */ jsx("style", { children: visibilityCSS }),
1143
- /* @__PURE__ */ jsx("div", { className: cn(getClasses(), wrapperClass), "aria-hidden": "true" })
1144
- ] });
1145
- }
1146
- };
1147
- var idCounter6 = 0;
1148
- function generateUniqueId6() {
1149
- return `t${(++idCounter6).toString(36)}${Math.random().toString(36).slice(2, 6)}`;
1150
- }
1151
- var defaultProps6 = {
1152
- content: [],
1153
- templateId: null,
1154
- dimensions: null,
1155
- customPadding: null,
1156
- margin: null,
1157
- visibility: null
1158
- };
1159
- var TemplateServerConfig = {
1160
- label: "Template",
1161
- fields: {
1162
- // In server config, templateId is just for reference (no loading UI)
1163
- templateId: {
1164
- type: "text",
1165
- label: "Template ID"
1166
- },
1167
- content: {
1168
- type: "slot"
1169
- }
1170
- },
1171
- defaultProps: defaultProps6,
1172
- render: ({ content: Content, dimensions, customPadding, margin, visibility }) => {
1173
- const uniqueId = generateUniqueId6();
1174
- const wrapperClass = `puck-template-${uniqueId}`;
1175
- const contentClass = `puck-template-content-${uniqueId}`;
1176
- const mediaQueries = [];
1177
- const wrapperStyles = {};
1178
- const paddingResult = responsiveValueToCSS(
1179
- customPadding,
1180
- (v) => ({ padding: paddingValueToCSS(v) }),
1181
- wrapperClass
1182
- );
1183
- Object.assign(wrapperStyles, paddingResult.baseStyles);
1184
- if (paddingResult.mediaQueryCSS) {
1185
- mediaQueries.push(paddingResult.mediaQueryCSS);
1186
- }
1187
- const marginResult = responsiveValueToCSS(
1188
- margin,
1189
- (v) => ({ margin: marginValueToCSS(v) }),
1190
- wrapperClass
1191
- );
1192
- Object.assign(wrapperStyles, marginResult.baseStyles);
1193
- if (marginResult.mediaQueryCSS) {
1194
- mediaQueries.push(marginResult.mediaQueryCSS);
1195
- }
1196
- const visibilityCSS = visibilityValueToCSS(visibility, wrapperClass);
1197
- if (visibilityCSS) {
1198
- mediaQueries.push(visibilityCSS);
1199
- }
1200
- const dimensionsResult = responsiveValueToCSS(
1201
- dimensions,
1202
- dimensionsValueToCSS,
1203
- contentClass
1204
- );
1205
- if (dimensionsResult.mediaQueryCSS) {
1206
- mediaQueries.push(dimensionsResult.mediaQueryCSS);
1207
- }
1208
- const allMediaQueryCSS = mediaQueries.join("\n");
1209
- const ContentSlot = Content;
1210
- return /* @__PURE__ */ jsxs(Fragment, { children: [
1211
- allMediaQueryCSS && /* @__PURE__ */ jsx("style", { children: allMediaQueryCSS }),
1212
- /* @__PURE__ */ jsx(
1213
- "div",
1214
- {
1215
- className: cn("template-wrapper", wrapperClass),
1216
- style: Object.keys(wrapperStyles).length > 0 ? wrapperStyles : void 0,
1217
- children: /* @__PURE__ */ jsx(ContentSlot, { className: contentClass, style: dimensionsResult.baseStyles })
1218
- }
1219
- )
1220
- ] });
1221
- }
1222
- };
1223
- var defaultProps7 = {
1224
- text: "Heading Text",
1225
- level: "h2",
1226
- alignment: null,
1227
- textColor: null,
1228
- dimensions: null,
1229
- animation: null,
1230
- margin: null,
1231
- customPadding: null
1232
- };
1233
- var HeadingConfig = {
1234
- label: "Heading",
1235
- defaultProps: defaultProps7,
1236
- render: ({ text, level, alignment, textColor, dimensions, animation, margin, customPadding }) => {
1237
- const tag = level || "h2";
1238
- const alignmentValue = alignment ?? "left";
1239
- const classes = cn(
1240
- headingLevelMap[level] || headingLevelMap.h2,
1241
- alignmentMap[alignmentValue] || alignmentMap.left
1242
- );
1243
- const dimensionsStyles = dimensions ? dimensionsValueToCSS(dimensions) : void 0;
1244
- const style = {
1245
- ...dimensionsStyles
1246
- };
1247
- const marginCSS = marginValueToCSS(margin);
1248
- if (marginCSS) {
1249
- style.margin = marginCSS;
1250
- }
1251
- const paddingCSS = paddingValueToCSS(customPadding);
1252
- if (paddingCSS) {
1253
- style.padding = paddingCSS;
1254
- }
1255
- const colorCSS = colorValueToCSS(textColor);
1256
- if (colorCSS) {
1257
- style.color = colorCSS;
1258
- }
1259
- const headingElement = createElement(tag, { className: classes, style: Object.keys(style).length > 0 ? style : void 0 }, text);
1260
- return /* @__PURE__ */ jsx(AnimatedWrapper, { animation, children: headingElement });
1261
- }
1262
- };
1263
- var defaultProps8 = {
1264
- content: "Enter your text here...",
1265
- size: "base",
1266
- alignment: null,
1267
- textColor: null,
1268
- dimensions: null,
1269
- animation: null,
1270
- margin: null,
1271
- customPadding: null
1272
- };
1273
- var TextConfig = {
1274
- label: "Text",
1275
- defaultProps: defaultProps8,
1276
- render: ({ content, size, alignment, textColor, dimensions, animation, margin, customPadding }) => {
1277
- const dimensionsStyles = dimensions ? dimensionsValueToCSS(dimensions) : void 0;
1278
- const style = {
1279
- ...dimensionsStyles
1280
- };
1281
- const marginCSS = marginValueToCSS(margin);
1282
- if (marginCSS) {
1283
- style.margin = marginCSS;
1284
- }
1285
- const paddingCSS = paddingValueToCSS(customPadding);
1286
- if (paddingCSS) {
1287
- style.padding = paddingCSS;
1288
- }
1289
- const colorCSS = colorValueToCSS(textColor);
1290
- if (colorCSS) {
1291
- style.color = colorCSS;
1292
- }
1293
- const alignmentValue = alignment ?? "left";
1294
- return /* @__PURE__ */ jsx(AnimatedWrapper, { animation, children: /* @__PURE__ */ jsx(
1295
- "p",
1296
- {
1297
- className: cn(
1298
- textSizeMap[size] || textSizeMap.base,
1299
- alignmentMap[alignmentValue] || alignmentMap.left
1300
- ),
1301
- style: Object.keys(style).length > 0 ? style : void 0,
1302
- children: content
1303
- }
1304
- ) });
1305
- }
1306
- };
1307
- var defaultProps9 = {
1308
- content: "<p>Enter your content here...</p>",
1309
- alignment: null,
1310
- textColor: null,
1311
- dimensions: null,
1312
- animation: null,
1313
- margin: null,
1314
- customPadding: null
1315
- };
1316
- var RichTextConfig = {
1317
- label: "Rich Text",
1318
- defaultProps: defaultProps9,
1319
- render: ({ content, alignment, textColor, dimensions, animation, margin, customPadding }) => {
1320
- const dimensionsStyles = dimensions ? dimensionsValueToCSS(dimensions) : void 0;
1321
- const style = {
1322
- ...dimensionsStyles
1323
- };
1324
- const marginCSS = marginValueToCSS(margin);
1325
- if (marginCSS) {
1326
- style.margin = marginCSS;
1327
- }
1328
- const customPaddingCSS = paddingValueToCSS(customPadding);
1329
- if (customPaddingCSS) {
1330
- style.padding = customPaddingCSS;
1331
- }
1332
- const colorCSS = colorValueToCSS(textColor);
1333
- if (colorCSS) {
1334
- style.color = colorCSS;
1335
- }
1336
- const alignmentValue = alignment ?? "left";
1337
- const alignmentClass = alignmentMap[alignmentValue] || alignmentMap.left;
1338
- if (!content || content === "<p></p>") {
1339
- return /* @__PURE__ */ jsx(AnimatedWrapper, { animation, children: /* @__PURE__ */ jsx("section", { className: cn("relative overflow-hidden px-4", alignmentClass), style: Object.keys(style).length > 0 ? style : void 0, children: /* @__PURE__ */ jsx("div", { className: "prose dark:prose-invert", children: /* @__PURE__ */ jsx("p", { children: /* @__PURE__ */ jsx("em", { children: "No content available" }) }) }) }) });
1340
- }
1341
- return /* @__PURE__ */ jsx(AnimatedWrapper, { animation, children: /* @__PURE__ */ jsx("section", { className: cn("relative overflow-hidden px-4", alignmentClass), style: Object.keys(style).length > 0 ? style : void 0, children: /* @__PURE__ */ jsx(
1342
- "div",
1343
- {
1344
- className: "prose dark:prose-invert",
1345
- dangerouslySetInnerHTML: { __html: content }
1346
- }
1347
- ) }) });
1348
- }
1349
- };
1350
- var idCounter7 = 0;
1351
- function generateUniqueId7() {
1352
- return `i${(++idCounter7).toString(36)}${Math.random().toString(36).slice(2, 6)}`;
1353
- }
1354
- var defaultProps10 = {
1355
- image: null,
1356
- alt: "",
1357
- aspectRatio: "auto",
1358
- link: "",
1359
- openInNewTab: false,
1360
- margin: null,
1361
- border: null,
1362
- dimensions: null,
1363
- alignment: null,
1364
- transform: null,
1365
- animation: null,
1366
- customPadding: null,
1367
- visibility: null
1368
- };
1369
- var ImageConfig = {
1370
- label: "Image",
1371
- defaultProps: defaultProps10,
1372
- render: ({ image, alt, aspectRatio, link, openInNewTab, dimensions, alignment, margin, border, transform, animation, customPadding, visibility }) => {
1373
- const uniqueId = generateUniqueId7();
1374
- const wrapperClass = `puck-image-${uniqueId}`;
1375
- const visibilityCSS = visibilityValueToCSS(visibility, wrapperClass);
1376
- const dimensionsStyles = dimensionsValueToCSS(dimensions);
1377
- const style = {
1378
- ...dimensionsStyles
1379
- };
1380
- const marginCSS = marginValueToCSS(margin);
1381
- if (marginCSS) {
1382
- style.margin = marginCSS;
1383
- }
1384
- const paddingCSS = paddingValueToCSS(customPadding);
1385
- if (paddingCSS) {
1386
- style.padding = paddingCSS;
1387
- }
1388
- const borderStyles = borderValueToCSS(border);
1389
- if (borderStyles) {
1390
- Object.assign(style, borderStyles);
1391
- }
1392
- const transformStyles = transformValueToCSS(transform);
1393
- if (transformStyles) {
1394
- Object.assign(style, transformStyles);
1395
- }
1396
- const alignmentValue = alignment ?? "center";
1397
- const alignmentClasses = cn(
1398
- "flex",
1399
- alignmentValue === "left" && "justify-start",
1400
- alignmentValue === "center" && "justify-center",
1401
- alignmentValue === "right" && "justify-end"
1402
- );
1403
- if (!image?.url) {
1404
- return /* @__PURE__ */ jsxs(AnimatedWrapper, { animation, children: [
1405
- visibilityCSS && /* @__PURE__ */ jsx("style", { children: visibilityCSS }),
1406
- /* @__PURE__ */ jsx("div", { className: cn("py-4 px-4", wrapperClass), style: Object.keys(style).length > 0 ? style : void 0, children: /* @__PURE__ */ jsx("div", { className: alignmentClasses, children: /* @__PURE__ */ jsx(
1407
- "div",
1408
- {
1409
- className: cn(
1410
- "relative overflow-hidden rounded-lg w-full max-w-md bg-muted flex items-center justify-center min-h-[200px]",
1411
- aspectRatioMap[aspectRatio] || ""
1412
- ),
1413
- children: /* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: "No image selected" })
1414
- }
1415
- ) }) })
1416
- ] });
1417
- }
1418
- const imageElement = aspectRatio === "auto" ? /* @__PURE__ */ jsx("div", { className: "relative overflow-hidden rounded-lg w-full", children: /* @__PURE__ */ jsx(
1419
- "img",
1420
- {
1421
- src: image.url,
1422
- alt: alt || image.alt || "",
1423
- className: "w-full h-auto object-cover"
1424
- }
1425
- ) }) : /* @__PURE__ */ jsx("div", { className: cn("relative overflow-hidden rounded-lg w-full", aspectRatioMap[aspectRatio]), children: /* @__PURE__ */ jsx(
1426
- "img",
1427
- {
1428
- src: image.url,
1429
- alt: alt || image.alt || "",
1430
- className: "absolute inset-0 w-full h-full object-cover"
1431
- }
1432
- ) });
1433
- const content = link ? /* @__PURE__ */ jsx(
1434
- "a",
1435
- {
1436
- href: link,
1437
- target: openInNewTab ? "_blank" : void 0,
1438
- rel: openInNewTab ? "noopener noreferrer" : void 0,
1439
- className: "block transition-opacity hover:opacity-90",
1440
- children: imageElement
1441
- }
1442
- ) : imageElement;
1443
- return /* @__PURE__ */ jsxs(AnimatedWrapper, { animation, children: [
1444
- visibilityCSS && /* @__PURE__ */ jsx("style", { children: visibilityCSS }),
1445
- /* @__PURE__ */ jsx("div", { className: cn("py-4 px-4", wrapperClass), style: Object.keys(style).length > 0 ? style : void 0, children: /* @__PURE__ */ jsx("div", { className: alignmentClasses, children: content }) })
1446
- ] });
1447
- }
1448
- };
1449
- function cn2(...inputs) {
1450
- return twMerge(clsx(inputs));
1451
- }
1452
- var buttonVariants = cva(
1453
- "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
1454
- {
1455
- variants: {
1456
- variant: {
1457
- default: "bg-primary text-primary-foreground hover:bg-primary/90",
1458
- destructive: "bg-destructive text-destructive-foreground hover:bg-destructive/90",
1459
- outline: "border border-input bg-background hover:bg-accent hover:text-accent-foreground",
1460
- secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
1461
- ghost: "hover:bg-accent hover:text-accent-foreground",
1462
- link: "text-primary underline-offset-4 hover:underline"
1463
- },
1464
- size: {
1465
- default: "h-10 px-4 py-2",
1466
- sm: "h-8 px-3 text-xs",
1467
- lg: "h-11 px-8",
1468
- icon: "h-10 w-10 p-2",
1469
- "icon-sm": "h-8 w-8 p-1.5"
1470
- }
1471
- },
1472
- defaultVariants: {
1473
- variant: "default",
1474
- size: "default"
1475
- }
1476
- }
1477
- );
1478
- var Button = React.forwardRef(
1479
- ({ className, variant, size, asChild = false, ...props }, ref) => {
1480
- const Comp = asChild ? Slot : "button";
1481
- return /* @__PURE__ */ jsx(
1482
- Comp,
1483
- {
1484
- className: cn2(buttonVariants({ variant, size, className })),
1485
- ref,
1486
- ...props
1487
- }
1488
- );
1489
- }
1490
- );
1491
- Button.displayName = "Button";
1492
- var Input = React.forwardRef(
1493
- ({ className, type, ...props }, ref) => {
1494
- return /* @__PURE__ */ jsx(
1495
- "input",
1496
- {
1497
- type,
1498
- className: cn2(
1499
- "flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",
1500
- className
1501
- ),
1502
- ref,
1503
- ...props
1504
- }
1505
- );
1506
- }
1507
- );
1508
- Input.displayName = "Input";
1509
- var labelVariants = cva(
1510
- "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"
1511
- );
1512
- var Label = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
1513
- LabelPrimitive.Root,
1514
- {
1515
- ref,
1516
- className: cn2(labelVariants(), className),
1517
- ...props
1518
- }
1519
- ));
1520
- Label.displayName = LabelPrimitive.Root.displayName;
1521
- var DEFAULT_VALUE = {
1522
- mode: "default"
1523
- };
1524
- var CUSTOM_DEFAULTS = {
1525
- height: 40,
1526
- paddingX: 16,
1527
- paddingY: 8,
1528
- fontSize: 14,
1529
- unit: "px"
1530
- };
1531
- function SizeFieldInner({
1532
- value,
1533
- onChange,
1534
- label = "Size",
1535
- readOnly,
1536
- showHeight = true,
1537
- showFontSize = true
1538
- }) {
1539
- const currentValue = value || DEFAULT_VALUE;
1540
- const handleModeChange = useCallback((mode) => {
1541
- if (mode === "custom") {
1542
- onChange({
1543
- mode,
1544
- ...CUSTOM_DEFAULTS
1545
- });
1546
- } else {
1547
- onChange({ mode });
1548
- }
1549
- }, [onChange]);
1550
- const handleValueChange = useCallback((field, val) => {
1551
- onChange({
1552
- ...currentValue,
1553
- [field]: val
1554
- });
1555
- }, [currentValue, onChange]);
1556
- const handleUnitChange = useCallback((unit) => {
1557
- onChange({
1558
- ...currentValue,
1559
- unit
1560
- });
1561
- }, [currentValue, onChange]);
1562
- const handleClear = useCallback(() => {
1563
- onChange(null);
1564
- }, [onChange]);
1565
- const presets = [
1566
- { mode: "sm", label: "SM" },
1567
- { mode: "default", label: "Default" },
1568
- { mode: "lg", label: "LG" },
1569
- { mode: "custom", label: "Custom" }
1570
- ];
1571
- return /* @__PURE__ */ jsxs("div", { className: "puck-field space-y-3", children: [
1572
- /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
1573
- /* @__PURE__ */ jsx(Label, { className: "text-sm font-medium text-foreground", children: label }),
1574
- value && !readOnly && /* @__PURE__ */ jsx(
1575
- Button,
1576
- {
1577
- type: "button",
1578
- variant: "ghost",
1579
- size: "icon-sm",
1580
- onClick: handleClear,
1581
- className: "text-muted-foreground hover:text-destructive",
1582
- title: "Reset to default",
1583
- children: /* @__PURE__ */ jsx(X, { className: "h-4 w-4" })
1584
- }
1585
- )
1586
- ] }),
1587
- /* @__PURE__ */ jsx("div", { className: "flex flex-wrap gap-1", children: presets.map(({ mode, label: modeLabel }) => {
1588
- const isActive = currentValue.mode === mode;
1589
- return /* @__PURE__ */ jsx(
1590
- Button,
1591
- {
1592
- type: "button",
1593
- variant: isActive ? "default" : "secondary",
1594
- size: "sm",
1595
- onClick: () => handleModeChange(mode),
1596
- disabled: readOnly,
1597
- className: cn2(
1598
- "text-xs",
1599
- isActive && "bg-primary hover:bg-primary/90"
1600
- ),
1601
- children: modeLabel
1602
- },
1603
- mode
1604
- );
1605
- }) }),
1606
- currentValue.mode === "custom" && /* @__PURE__ */ jsxs("div", { className: "space-y-3 p-3 bg-muted/50 rounded-md", children: [
1607
- /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
1608
- /* @__PURE__ */ jsx(Label, { className: "text-[10px] uppercase tracking-wide text-muted-foreground flex-shrink-0", children: "Unit:" }),
1609
- /* @__PURE__ */ jsx("div", { className: "flex gap-1", children: ["px", "rem"].map((unit) => {
1610
- const isActive = (currentValue.unit || "px") === unit;
1611
- return /* @__PURE__ */ jsx(
1612
- Button,
1613
- {
1614
- type: "button",
1615
- variant: isActive ? "default" : "outline",
1616
- size: "sm",
1617
- onClick: () => handleUnitChange(unit),
1618
- disabled: readOnly,
1619
- className: cn2(
1620
- "text-xs font-mono h-7 px-2",
1621
- isActive && "bg-primary hover:bg-primary/90"
1622
- ),
1623
- children: unit
1624
- },
1625
- unit
1626
- );
1627
- }) })
1628
- ] }),
1629
- /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 gap-2", children: [
1630
- showHeight && /* @__PURE__ */ jsxs("div", { className: "space-y-1", children: [
1631
- /* @__PURE__ */ jsx(Label, { className: "text-[10px] uppercase tracking-wide text-muted-foreground", children: "Height" }),
1632
- /* @__PURE__ */ jsx(
1633
- Input,
1634
- {
1635
- type: "number",
1636
- min: 0,
1637
- value: currentValue.height ?? CUSTOM_DEFAULTS.height,
1638
- onChange: (e) => handleValueChange("height", parseInt(e.target.value, 10) || 0),
1639
- disabled: readOnly,
1640
- className: "h-8 text-sm font-mono"
1641
- }
1642
- )
1643
- ] }),
1644
- showFontSize && /* @__PURE__ */ jsxs("div", { className: "space-y-1", children: [
1645
- /* @__PURE__ */ jsx(Label, { className: "text-[10px] uppercase tracking-wide text-muted-foreground", children: "Font Size" }),
1646
- /* @__PURE__ */ jsx(
1647
- Input,
1648
- {
1649
- type: "number",
1650
- min: 0,
1651
- value: currentValue.fontSize ?? CUSTOM_DEFAULTS.fontSize,
1652
- onChange: (e) => handleValueChange("fontSize", parseInt(e.target.value, 10) || 0),
1653
- disabled: readOnly,
1654
- className: "h-8 text-sm font-mono"
1655
- }
1656
- )
1657
- ] }),
1658
- /* @__PURE__ */ jsxs("div", { className: "space-y-1", children: [
1659
- /* @__PURE__ */ jsx(Label, { className: "text-[10px] uppercase tracking-wide text-muted-foreground", children: "Padding X" }),
1660
- /* @__PURE__ */ jsx(
1661
- Input,
1662
- {
1663
- type: "number",
1664
- min: 0,
1665
- value: currentValue.paddingX ?? CUSTOM_DEFAULTS.paddingX,
1666
- onChange: (e) => handleValueChange("paddingX", parseInt(e.target.value, 10) || 0),
1667
- disabled: readOnly,
1668
- className: "h-8 text-sm font-mono"
1669
- }
1670
- )
1671
- ] }),
1672
- /* @__PURE__ */ jsxs("div", { className: "space-y-1", children: [
1673
- /* @__PURE__ */ jsx(Label, { className: "text-[10px] uppercase tracking-wide text-muted-foreground", children: "Padding Y" }),
1674
- /* @__PURE__ */ jsx(
1675
- Input,
1676
- {
1677
- type: "number",
1678
- min: 0,
1679
- value: currentValue.paddingY ?? CUSTOM_DEFAULTS.paddingY,
1680
- onChange: (e) => handleValueChange("paddingY", parseInt(e.target.value, 10) || 0),
1681
- disabled: readOnly,
1682
- className: "h-8 text-sm font-mono"
1683
- }
1684
- )
1685
- ] })
1686
- ] }),
1687
- /* @__PURE__ */ jsxs("div", { className: "text-xs text-muted-foreground font-mono pt-1 border-t border-border/50", children: [
1688
- showHeight && `h: ${currentValue.height ?? CUSTOM_DEFAULTS.height}${currentValue.unit || "px"}`,
1689
- showHeight && " | ",
1690
- `p: ${currentValue.paddingY ?? CUSTOM_DEFAULTS.paddingY}${currentValue.unit || "px"} ${currentValue.paddingX ?? CUSTOM_DEFAULTS.paddingX}${currentValue.unit || "px"}`,
1691
- showFontSize && ` | font: ${currentValue.fontSize ?? CUSTOM_DEFAULTS.fontSize}${currentValue.unit || "px"}`
1692
- ] })
1693
- ] })
1694
- ] });
1695
- }
1696
- memo(SizeFieldInner);
1697
- function sizeValueToCSS(size) {
1698
- if (!size || size.mode !== "custom") return void 0;
1699
- const unit = size.unit || "px";
1700
- const style = {};
1701
- if (size.height != null) {
1702
- style.height = `${size.height}${unit}`;
1703
- }
1704
- if (size.paddingX != null || size.paddingY != null) {
1705
- const py = size.paddingY ?? 0;
1706
- const px = size.paddingX ?? 0;
1707
- style.padding = `${py}${unit} ${px}${unit}`;
1708
- }
1709
- if (size.fontSize != null) {
1710
- style.fontSize = `${size.fontSize}${unit}`;
1711
- }
1712
- return Object.keys(style).length > 0 ? style : void 0;
1713
- }
1714
- function getSizeClasses(size, sizeMap) {
1715
- if (!size) return sizeMap.default || "";
1716
- if (size.mode === "custom") return "";
1717
- return sizeMap[size.mode] || sizeMap.default || "";
1718
- }
1719
-
1720
- // src/theme/defaults.ts
1721
- var DEFAULT_BUTTON_VARIANTS = {
1722
- default: { classes: "bg-primary text-primary-foreground hover:bg-primary/90" },
1723
- secondary: { classes: "bg-secondary text-secondary-foreground hover:bg-secondary/80" },
1724
- outline: { classes: "border border-input bg-background hover:bg-accent hover:text-accent-foreground" },
1725
- ghost: { classes: "bg-transparent hover:bg-accent hover:text-accent-foreground" },
1726
- destructive: { classes: "bg-destructive text-destructive-foreground hover:bg-destructive/90" },
1727
- link: { classes: "text-primary underline-offset-4 hover:underline bg-transparent" }
1728
- };
1729
- var DEFAULT_FOCUS_RING = "focus:ring-ring";
1730
-
1731
- // src/theme/utils.ts
1732
- function getVariantClasses(variants, variant, fallback = "default") {
1733
- const config = variants[variant];
1734
- if (config?.classes) {
1735
- return config.classes;
1736
- }
1737
- const fallbackConfig = variants[fallback];
1738
- return fallbackConfig?.classes ?? "";
1739
- }
1740
- var sizeStyles = {
1741
- sm: "h-8 px-3 text-sm",
1742
- default: "h-10 px-4",
1743
- lg: "h-12 px-8 text-lg"
1744
- };
1745
- var alignmentWrapperMap = {
1746
- left: "text-left",
1747
- center: "text-center",
1748
- right: "text-right"
1749
- };
1750
- var defaultProps11 = {
1751
- text: "Click Me",
1752
- link: "",
1753
- variant: "default",
1754
- size: null,
1755
- openInNewTab: "no",
1756
- margin: null,
1757
- customBackgroundColor: null,
1758
- customTextColor: null,
1759
- customBorder: null,
1760
- alignment: null,
1761
- transform: null,
1762
- animation: null,
1763
- customPadding: null
1764
- };
1765
- var ButtonConfig = {
1766
- label: "Button",
1767
- defaultProps: defaultProps11,
1768
- render: ({ text, link, variant, size, openInNewTab, alignment, margin, customBackgroundColor, customTextColor, customBorder, transform, animation, customPadding }) => {
1769
- const hasCustomBackground = customBackgroundColor?.hex;
1770
- const hasCustomTextColor = customTextColor?.hex;
1771
- const hasCustomPadding = customPadding;
1772
- const hasCustomSize = size?.mode === "custom";
1773
- const variantClasses = getVariantClasses(DEFAULT_BUTTON_VARIANTS, variant, "default");
1774
- const sizeClasses = getSizeClasses(size, sizeStyles);
1775
- const buttonClasses = cn(
1776
- "inline-flex items-center justify-center font-medium transition-colors",
1777
- `focus:outline-none focus:ring-2 focus:ring-offset-2 ${DEFAULT_FOCUS_RING}`,
1778
- "disabled:opacity-50 disabled:pointer-events-none",
1779
- // Only apply variant styles if no custom background/text color
1780
- !hasCustomBackground && !hasCustomTextColor && variantClasses,
1781
- // Only apply background portion of variant if no custom background
1782
- hasCustomBackground && !hasCustomTextColor && "hover:opacity-90",
1783
- // Only apply size classes if not using custom size or custom padding
1784
- !hasCustomPadding && !hasCustomSize && sizeClasses,
1785
- // Apply rounded-md unless custom border has radius
1786
- !customBorder?.radius && "rounded-md"
1787
- );
1788
- const buttonStyle = {};
1789
- if (hasCustomBackground) {
1790
- buttonStyle.backgroundColor = colorValueToCSS(customBackgroundColor);
1791
- }
1792
- if (hasCustomTextColor) {
1793
- buttonStyle.color = colorValueToCSS(customTextColor);
1794
- }
1795
- const borderStyles = borderValueToCSS(customBorder);
1796
- if (borderStyles) {
1797
- Object.assign(buttonStyle, borderStyles);
1798
- }
1799
- const customSizeStyles = sizeValueToCSS(size);
1800
- if (customSizeStyles) {
1801
- Object.assign(buttonStyle, customSizeStyles);
1802
- }
1803
- const paddingCSS = paddingValueToCSS(customPadding);
1804
- if (paddingCSS) {
1805
- buttonStyle.padding = paddingCSS;
1806
- }
1807
- const transformStyles = transformValueToCSS(transform);
1808
- if (transformStyles) {
1809
- Object.assign(buttonStyle, transformStyles);
1810
- }
1811
- const buttonElement = link ? /* @__PURE__ */ jsx(
1812
- "a",
1813
- {
1814
- href: link,
1815
- target: openInNewTab === "yes" ? "_blank" : void 0,
1816
- rel: openInNewTab === "yes" ? "noopener noreferrer" : void 0,
1817
- className: buttonClasses,
1818
- style: buttonStyle,
1819
- children: text
1820
- }
1821
- ) : /* @__PURE__ */ jsx("button", { type: "button", className: buttonClasses, style: buttonStyle, children: text });
1822
- const wrapperStyle = {};
1823
- const marginCSS = marginValueToCSS(margin);
1824
- if (marginCSS) {
1825
- wrapperStyle.margin = marginCSS;
1826
- }
1827
- const alignmentValue = alignment ?? "left";
1828
- return /* @__PURE__ */ jsx(
1829
- AnimatedWrapper,
1830
- {
1831
- animation,
1832
- className: alignmentWrapperMap[alignmentValue] || alignmentWrapperMap.left,
1833
- style: wrapperStyle,
1834
- children: buttonElement
1835
- }
1836
- );
1837
- }
1838
- };
1839
- var defaultProps12 = {
1840
- image: null,
1841
- heading: "Card Heading",
1842
- text: "Card description text goes here.",
1843
- link: "",
1844
- openInNewTab: false,
1845
- shadow: "md",
1846
- margin: null,
1847
- background: null,
1848
- border: null,
1849
- dimensions: null,
1850
- alignment: null,
1851
- transform: null,
1852
- animation: null,
1853
- customPadding: null
1854
- };
1855
- var CardConfig = {
1856
- label: "Card",
1857
- defaultProps: defaultProps12,
1858
- render: ({ image, heading, text, link, openInNewTab, shadow, background, dimensions, alignment, margin, border, transform, animation, customPadding }) => {
1859
- const hasBorderRadius = border?.radius && border.radius > 0;
1860
- const cardClasses = cn(
1861
- "overflow-hidden transition-all bg-card",
1862
- !hasBorderRadius && "rounded-lg",
1863
- shadowMap[shadow] || "",
1864
- link && "hover:shadow-lg cursor-pointer"
1865
- );
1866
- const wrapperStyle = {};
1867
- const marginCSS = marginValueToCSS(margin);
1868
- if (marginCSS) {
1869
- wrapperStyle.margin = marginCSS;
1870
- }
1871
- const dimensionsStyles = dimensionsValueToCSS(dimensions);
1872
- if (dimensionsStyles) {
1873
- Object.assign(wrapperStyle, dimensionsStyles);
1874
- }
1875
- const transformStyles = transformValueToCSS(transform);
1876
- if (transformStyles) {
1877
- Object.assign(wrapperStyle, transformStyles);
1878
- }
1879
- const alignmentValue = alignment ?? "left";
1880
- const alignmentClasses = cn(
1881
- "flex",
1882
- alignmentValue === "left" && "justify-start",
1883
- alignmentValue === "center" && "justify-center",
1884
- alignmentValue === "right" && "justify-end"
1885
- );
1886
- const backgroundStyles = backgroundValueToCSS(background);
1887
- const cardStyle = {
1888
- ...backgroundStyles
1889
- };
1890
- const borderStyles = borderValueToCSS(border);
1891
- if (borderStyles) {
1892
- Object.assign(cardStyle, borderStyles);
1893
- }
1894
- const paddingCSS = paddingValueToCSS(customPadding);
1895
- if (paddingCSS) {
1896
- cardStyle.padding = paddingCSS;
1897
- }
1898
- const cardContent = /* @__PURE__ */ jsxs("div", { className: cardClasses, style: cardStyle, children: [
1899
- image?.url ? /* @__PURE__ */ jsx("div", { className: "relative aspect-video w-full overflow-hidden", children: /* @__PURE__ */ jsx(
1900
- "img",
1901
- {
1902
- src: image.url,
1903
- alt: image.alt || heading || "",
1904
- className: "w-full h-full object-cover"
1905
- }
1906
- ) }) : /* @__PURE__ */ jsx("div", { className: "aspect-video w-full bg-muted flex items-center justify-center", children: /* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: "No image" }) }),
1907
- /* @__PURE__ */ jsxs("div", { className: "p-4", children: [
1908
- heading && /* @__PURE__ */ jsx("h3", { className: "text-lg font-semibold text-foreground mb-2", children: heading }),
1909
- text && /* @__PURE__ */ jsx("p", { className: "text-muted-foreground text-sm", children: text })
1910
- ] })
1911
- ] });
1912
- if (link) {
1913
- return /* @__PURE__ */ jsx(AnimatedWrapper, { animation, children: /* @__PURE__ */ jsx("div", { className: alignmentClasses, children: /* @__PURE__ */ jsx(
1914
- "a",
1915
- {
1916
- href: link,
1917
- target: openInNewTab ? "_blank" : void 0,
1918
- rel: openInNewTab ? "noopener noreferrer" : void 0,
1919
- className: "block",
1920
- style: wrapperStyle,
1921
- children: cardContent
1922
- }
1923
- ) }) });
1924
- }
1925
- return /* @__PURE__ */ jsx(AnimatedWrapper, { animation, children: /* @__PURE__ */ jsx("div", { className: alignmentClasses, children: /* @__PURE__ */ jsx("div", { style: wrapperStyle, children: cardContent }) }) });
1926
- }
1927
- };
1928
- var defaultProps13 = {
1929
- style: "solid",
1930
- color: null,
1931
- margin: null,
1932
- dimensions: null,
1933
- transform: null,
1934
- animation: null,
1935
- customPadding: null
1936
- };
1937
- var DividerConfig = {
1938
- label: "Divider",
1939
- defaultProps: defaultProps13,
1940
- render: ({ style, color, dimensions, margin, transform, animation, customPadding }) => {
1941
- const dimensionsStyles = dimensionsValueToCSS(dimensions);
1942
- const wrapperStyle = {
1943
- ...dimensionsStyles
1944
- };
1945
- const marginCSS = marginValueToCSS(margin);
1946
- if (marginCSS) {
1947
- wrapperStyle.margin = marginCSS;
1948
- }
1949
- const paddingCSS = paddingValueToCSS(customPadding);
1950
- if (paddingCSS) {
1951
- wrapperStyle.padding = paddingCSS;
1952
- }
1953
- const transformStyles = transformValueToCSS(transform);
1954
- if (transformStyles) {
1955
- Object.assign(wrapperStyle, transformStyles);
1956
- }
1957
- const customColor = colorValueToCSS(color);
1958
- const hrStyle = customColor ? { borderColor: customColor } : void 0;
1959
- return /* @__PURE__ */ jsx(AnimatedWrapper, { animation, children: /* @__PURE__ */ jsx("div", { className: "px-4", style: Object.keys(wrapperStyle).length > 0 ? wrapperStyle : void 0, children: /* @__PURE__ */ jsx(
1960
- "hr",
1961
- {
1962
- className: cn(
1963
- "border-t border-border",
1964
- dividerStyleMap[style] || dividerStyleMap.solid
1965
- ),
1966
- style: hrStyle
1967
- }
1968
- ) }) });
1969
- }
1970
- };
1971
- var defaultProps14 = {
1972
- items: [
1973
- {
1974
- title: "What is this?",
1975
- content: "This is an accordion component that can expand and collapse.",
1976
- defaultOpen: false
1977
- },
1978
- {
1979
- title: "How do I use it?",
1980
- content: "Click on each item to expand or collapse it.",
1981
- defaultOpen: false
1982
- }
1983
- ],
1984
- allowMultiple: false,
1985
- textColor: null,
1986
- margin: null,
1987
- background: null,
1988
- dimensions: null,
1989
- transform: null,
1990
- animation: null,
1991
- customPadding: null
1992
- };
1993
- var AccordionConfig = {
1994
- label: "Accordion",
1995
- defaultProps: defaultProps14,
1996
- render: (props) => /* @__PURE__ */ jsx(
1997
- AccordionClient,
1998
- {
1999
- items: props.items,
2000
- allowMultiple: props.allowMultiple,
2001
- textColor: props.textColor,
2002
- margin: props.margin,
2003
- background: props.background,
2004
- dimensions: props.dimensions,
2005
- transform: props.transform,
2006
- animation: props.animation,
2007
- customPadding: props.customPadding
2008
- }
2009
- )
2010
- };
2011
- function createConfig(layouts = DEFAULT_LAYOUTS) {
2012
- const layoutOptions = layoutsToOptions(layouts);
2013
- return {
2014
- root: {
2015
- fields: {
2016
- title: {
2017
- type: "text",
2018
- label: "Page Title"
2019
- },
2020
- pageLayout: {
2021
- type: "select",
2022
- label: "Page Layout",
2023
- options: layoutOptions.map(({ value, label }) => ({ value, label }))
2024
- }
2025
- },
2026
- defaultProps: {
2027
- title: "New Page",
2028
- pageLayout: "default"
2029
- },
2030
- render: ({ children }) => /* @__PURE__ */ jsx(Fragment, { children })
2031
- },
2032
- categories: {
2033
- layout: {
2034
- title: "Layout",
2035
- components: ["Container", "Flex", "Grid", "Section", "Spacer", "Template"],
2036
- defaultExpanded: true
2037
- },
2038
- typography: {
2039
- title: "Typography",
2040
- components: ["Heading", "Text", "RichText"]
2041
- },
2042
- media: {
2043
- title: "Media",
2044
- components: ["Image"]
2045
- },
2046
- interactive: {
2047
- title: "Interactive",
2048
- components: ["Button", "Card", "Divider", "Accordion"]
2049
- }
2050
- },
2051
- components: {
2052
- // Layout
2053
- Container: ContainerConfig,
2054
- Flex: FlexConfig,
2055
- Grid: GridConfig,
2056
- Section: SectionConfig,
2057
- Spacer: SpacerConfig,
2058
- Template: TemplateServerConfig,
2059
- // Typography
2060
- Heading: HeadingConfig,
2061
- Text: TextConfig,
2062
- RichText: RichTextConfig,
2063
- // Media
2064
- Image: ImageConfig,
2065
- // Interactive
2066
- Button: ButtonConfig,
2067
- Card: CardConfig,
2068
- Divider: DividerConfig,
2069
- Accordion: AccordionConfig
2070
- }
2071
- };
2072
- }
2073
- var baseConfig = createConfig(DEFAULT_LAYOUTS);
2074
- function PageRenderer({
2075
- data,
2076
- config = baseConfig,
2077
- wrapper: Wrapper,
2078
- className,
2079
- layouts = DEFAULT_LAYOUTS
2080
- }) {
2081
- if (!data || !data.content) {
2082
- return /* @__PURE__ */ jsx("div", { className, children: /* @__PURE__ */ jsx("p", { children: "No content available" }) });
2083
- }
2084
- const content = /* @__PURE__ */ jsx(Render, { config, data });
2085
- const rootProps = data.root?.props;
2086
- const overrides = {
2087
- showHeader: rootProps?.showHeader,
2088
- showFooter: rootProps?.showFooter,
2089
- background: rootProps?.pageBackground,
2090
- maxWidth: rootProps?.pageMaxWidth
2091
- };
2092
- let result = content;
2093
- if (Wrapper) {
2094
- result = /* @__PURE__ */ jsx(Wrapper, { children: result });
2095
- } else {
2096
- const pageLayout = rootProps?.pageLayout;
2097
- const layout = pageLayout ? getLayout(layouts, pageLayout) : void 0;
2098
- if (layout) {
2099
- result = /* @__PURE__ */ jsx(LayoutWrapper, { layout, className, overrides, children: result });
2100
- } else if (className || overrides.background) {
2101
- result = /* @__PURE__ */ jsx(LayoutWrapper, { className, overrides, children: result });
2102
- }
2103
- }
2104
- return result;
2105
- }
2106
- function HybridPageRenderer({
2107
- page,
2108
- legacyRenderer,
2109
- legacyBlocksField = "layout",
2110
- fallback = /* @__PURE__ */ jsx("div", { children: "No content available" }),
2111
- config,
2112
- layouts,
2113
- wrapper,
2114
- className
2115
- }) {
2116
- const puckData = page.puckData;
2117
- const hasPuckContent = puckData?.content && Array.isArray(puckData.content) && puckData.content.length > 0;
2118
- const legacyBlocks = page[legacyBlocksField];
2119
- const hasLegacyContent = Array.isArray(legacyBlocks) && legacyBlocks.length > 0;
2120
- if (page.editorVersion === "puck" && hasPuckContent) {
2121
- return /* @__PURE__ */ jsx(
2122
- PageRenderer,
2123
- {
2124
- data: puckData,
2125
- config,
2126
- layouts,
2127
- wrapper,
2128
- className
2129
- }
2130
- );
2131
- }
2132
- if (hasLegacyContent) {
2133
- return /* @__PURE__ */ jsx(Fragment, { children: legacyRenderer(legacyBlocks) });
2134
- }
2135
- return /* @__PURE__ */ jsx(Fragment, { children: fallback });
2136
- }
2137
-
2138
- export { HybridPageRenderer, PageRenderer };
2139
- //# sourceMappingURL=index.mjs.map
2140
- //# sourceMappingURL=index.mjs.map