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