@delmaredigital/payload-puck 0.2.0 → 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 +349 -1370
  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 -216
  67. package/dist/components/index.d.ts.map +1 -0
  68. package/dist/components/index.js +15 -9262
  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 -9462
  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 -2119
  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 -4625
  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 -7704
  377. package/dist/fields/index.js.map +1 -0
  378. package/dist/fields/richtext-output.css +219 -0
  379. package/dist/{shared-X9UpCJKW.d.mts → fields/shared.d.ts} +111 -132
  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 -2253
  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 +51 -74
  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 -219
  525. package/dist/components/index.mjs +0 -9216
  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 -9445
  529. package/dist/config/index.d.mts +0 -68
  530. package/dist/config/index.mjs +0 -2099
  531. package/dist/editor/index.d.mts +0 -784
  532. package/dist/editor/index.mjs +0 -4592
  533. package/dist/fields/index.d.mts +0 -600
  534. package/dist/fields/index.mjs +0 -7588
  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 -2231
  544. package/dist/shared-X9UpCJKW.d.ts +0 -548
  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
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/render/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAG7C,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAA;AAGzD,2EAA2E;AAC3E,iEAAiE"}
@@ -0,0 +1,59 @@
1
+ /**
2
+ * Theme Context
3
+ *
4
+ * React context for distributing theme configuration to Puck components.
5
+ * The useTheme() hook returns defaults when no provider is present,
6
+ * ensuring backwards compatibility.
7
+ */
8
+ import { type ReactNode } from 'react';
9
+ import type { ThemeConfig, ResolvedTheme } from './types';
10
+ export interface ThemeProviderProps {
11
+ children: ReactNode;
12
+ /** Theme configuration to apply */
13
+ theme?: ThemeConfig;
14
+ }
15
+ /**
16
+ * Provides theme configuration to descendant Puck components
17
+ *
18
+ * @example
19
+ * ```tsx
20
+ * <ThemeProvider theme={{
21
+ * buttonVariants: {
22
+ * default: { classes: 'bg-primary text-white hover:bg-primary/90' }
23
+ * }
24
+ * }}>
25
+ * <PageRenderer data={data} />
26
+ * </ThemeProvider>
27
+ * ```
28
+ */
29
+ export declare function ThemeProvider({ children, theme }: ThemeProviderProps): import("react/jsx-runtime").JSX.Element;
30
+ /**
31
+ * Hook to access the current theme
32
+ *
33
+ * Returns DEFAULT_THEME if no ThemeProvider is present,
34
+ * ensuring components work standalone for backwards compatibility.
35
+ *
36
+ * @example
37
+ * ```tsx
38
+ * function MyComponent() {
39
+ * const theme = useTheme()
40
+ * const buttonClasses = getVariantClasses(theme.buttonVariants, 'primary')
41
+ * return <button className={buttonClasses}>Click me</button>
42
+ * }
43
+ * ```
44
+ */
45
+ export declare function useTheme(): ResolvedTheme;
46
+ /**
47
+ * Gets the default theme for server components
48
+ *
49
+ * Use this when you need theme values in a server component
50
+ * where hooks cannot be used.
51
+ */
52
+ export declare function getDefaultTheme(): ResolvedTheme;
53
+ /**
54
+ * Hook to check if a ThemeProvider is present
55
+ *
56
+ * Useful for conditional logic based on whether theming is configured.
57
+ */
58
+ export declare function useHasThemeProvider(): boolean;
59
+ //# sourceMappingURL=context.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/theme/context.tsx"],"names":[],"mappings":"AAEA;;;;;;GAMG;AAEH,OAAO,EAAsC,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;AAC1E,OAAO,KAAK,EAAE,WAAW,EAAqB,aAAa,EAAE,MAAM,SAAS,CAAA;AAM5E,MAAM,WAAW,kBAAkB;IACjC,QAAQ,EAAE,SAAS,CAAA;IACnB,mCAAmC;IACnC,KAAK,CAAC,EAAE,WAAW,CAAA;CACpB;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,aAAa,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE,kBAAkB,2CAWpE;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,QAAQ,IAAI,aAAa,CAIxC;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,IAAI,aAAa,CAE/C;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,IAAI,OAAO,CAG7C"}
@@ -0,0 +1,73 @@
1
+ 'use client';
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ /**
4
+ * Theme Context
5
+ *
6
+ * React context for distributing theme configuration to Puck components.
7
+ * The useTheme() hook returns defaults when no provider is present,
8
+ * ensuring backwards compatibility.
9
+ */
10
+ import { createContext, useContext, useMemo } from 'react';
11
+ import { DEFAULT_THEME } from './defaults';
12
+ import { resolveTheme } from './utils';
13
+ const ThemeContext = createContext(null);
14
+ /**
15
+ * Provides theme configuration to descendant Puck components
16
+ *
17
+ * @example
18
+ * ```tsx
19
+ * <ThemeProvider theme={{
20
+ * buttonVariants: {
21
+ * default: { classes: 'bg-primary text-white hover:bg-primary/90' }
22
+ * }
23
+ * }}>
24
+ * <PageRenderer data={data} />
25
+ * </ThemeProvider>
26
+ * ```
27
+ */
28
+ export function ThemeProvider({ children, theme }) {
29
+ const resolvedTheme = useMemo(() => resolveTheme(theme), [theme]);
30
+ const value = useMemo(() => ({
31
+ theme: resolvedTheme,
32
+ }), [resolvedTheme]);
33
+ return _jsx(ThemeContext.Provider, { value: value, children: children });
34
+ }
35
+ /**
36
+ * Hook to access the current theme
37
+ *
38
+ * Returns DEFAULT_THEME if no ThemeProvider is present,
39
+ * ensuring components work standalone for backwards compatibility.
40
+ *
41
+ * @example
42
+ * ```tsx
43
+ * function MyComponent() {
44
+ * const theme = useTheme()
45
+ * const buttonClasses = getVariantClasses(theme.buttonVariants, 'primary')
46
+ * return <button className={buttonClasses}>Click me</button>
47
+ * }
48
+ * ```
49
+ */
50
+ export function useTheme() {
51
+ const context = useContext(ThemeContext);
52
+ // Return defaults if no provider - ensures backwards compatibility
53
+ return context?.theme ?? DEFAULT_THEME;
54
+ }
55
+ /**
56
+ * Gets the default theme for server components
57
+ *
58
+ * Use this when you need theme values in a server component
59
+ * where hooks cannot be used.
60
+ */
61
+ export function getDefaultTheme() {
62
+ return DEFAULT_THEME;
63
+ }
64
+ /**
65
+ * Hook to check if a ThemeProvider is present
66
+ *
67
+ * Useful for conditional logic based on whether theming is configured.
68
+ */
69
+ export function useHasThemeProvider() {
70
+ const context = useContext(ThemeContext);
71
+ return context !== null;
72
+ }
73
+ //# sourceMappingURL=context.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context.js","sourceRoot":"","sources":["../../src/theme/context.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ;;;;;;GAMG;AAEH,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,OAAO,EAAkB,MAAM,OAAO,CAAA;AAE1E,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AAC1C,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAEtC,MAAM,YAAY,GAAG,aAAa,CAA2B,IAAI,CAAC,CAAA;AAQlE;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,aAAa,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAsB;IACnE,MAAM,aAAa,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC,YAAY,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAA;IAEjE,MAAM,KAAK,GAAG,OAAO,CACnB,GAAG,EAAE,CAAC,CAAC;QACL,KAAK,EAAE,aAAa;KACrB,CAAC,EACF,CAAC,aAAa,CAAC,CAChB,CAAA;IAED,OAAO,KAAC,YAAY,CAAC,QAAQ,IAAC,KAAK,EAAE,KAAK,YAAG,QAAQ,GAAyB,CAAA;AAChF,CAAC;AAED;;;;;;;;;;;;;;GAcG;AACH,MAAM,UAAU,QAAQ;IACtB,MAAM,OAAO,GAAG,UAAU,CAAC,YAAY,CAAC,CAAA;IACxC,mEAAmE;IACnE,OAAO,OAAO,EAAE,KAAK,IAAI,aAAa,CAAA;AACxC,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,eAAe;IAC7B,OAAO,aAAa,CAAA;AACtB,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,mBAAmB;IACjC,MAAM,OAAO,GAAG,UAAU,CAAC,YAAY,CAAC,CAAA;IACxC,OAAO,OAAO,KAAK,IAAI,CAAA;AACzB,CAAC"}
@@ -0,0 +1,39 @@
1
+ /**
2
+ * Default Theme Values
3
+ *
4
+ * These defaults ensure backwards compatibility - components render
5
+ * identically to before theming was introduced when no theme is provided.
6
+ */
7
+ import type { ButtonVariantStyles, BackgroundStyles, ColorPreset, ResolvedTheme } from './types';
8
+ /**
9
+ * Default button variant styles
10
+ * Uses semantic Tailwind classes that map to CSS variables (--primary, --secondary, etc.)
11
+ * This allows consuming apps to customize colors via their theme CSS variables.
12
+ */
13
+ export declare const DEFAULT_BUTTON_VARIANTS: ButtonVariantStyles;
14
+ /**
15
+ * Default CTA button variant styles
16
+ * Uses semantic Tailwind classes that map to CSS variables.
17
+ */
18
+ export declare const DEFAULT_CTA_BUTTON_VARIANTS: ButtonVariantStyles;
19
+ /**
20
+ * Default CTA background styles
21
+ * Uses semantic Tailwind classes that map to CSS variables.
22
+ */
23
+ export declare const DEFAULT_CTA_BACKGROUND_STYLES: BackgroundStyles;
24
+ /**
25
+ * Default color picker presets
26
+ * Matches DEFAULT_PRESETS from ColorPickerField.tsx
27
+ */
28
+ export declare const DEFAULT_COLOR_PRESETS: ColorPreset[];
29
+ /**
30
+ * Default focus ring color class
31
+ * Uses semantic ring color from CSS variables
32
+ */
33
+ export declare const DEFAULT_FOCUS_RING = "focus:ring-ring";
34
+ /**
35
+ * Complete default theme
36
+ * Used when no ThemeProvider is present or no theme config is provided
37
+ */
38
+ export declare const DEFAULT_THEME: ResolvedTheme;
39
+ //# sourceMappingURL=defaults.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"defaults.d.ts","sourceRoot":"","sources":["../../src/theme/defaults.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EACV,mBAAmB,EACnB,gBAAgB,EAChB,WAAW,EACX,aAAa,EACd,MAAM,SAAS,CAAA;AAEhB;;;;GAIG;AACH,eAAO,MAAM,uBAAuB,EAAE,mBAOrC,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,2BAA2B,EAAE,mBAMzC,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,6BAA6B,EAAE,gBAI3C,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,qBAAqB,EAAE,WAAW,EAW9C,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,kBAAkB,oBAAoB,CAAA;AAEnD;;;GAGG;AACH,eAAO,MAAM,aAAa,EAAE,aAM3B,CAAA"}
@@ -0,0 +1,72 @@
1
+ /**
2
+ * Default Theme Values
3
+ *
4
+ * These defaults ensure backwards compatibility - components render
5
+ * identically to before theming was introduced when no theme is provided.
6
+ */
7
+ /**
8
+ * Default button variant styles
9
+ * Uses semantic Tailwind classes that map to CSS variables (--primary, --secondary, etc.)
10
+ * This allows consuming apps to customize colors via their theme CSS variables.
11
+ */
12
+ export const DEFAULT_BUTTON_VARIANTS = {
13
+ default: { classes: 'bg-primary text-primary-foreground hover:bg-primary/90' },
14
+ secondary: { classes: 'bg-secondary text-secondary-foreground hover:bg-secondary/80' },
15
+ outline: { classes: 'border border-input bg-background hover:bg-accent hover:text-accent-foreground' },
16
+ ghost: { classes: 'bg-transparent hover:bg-accent hover:text-accent-foreground' },
17
+ destructive: { classes: 'bg-destructive text-destructive-foreground hover:bg-destructive/90' },
18
+ link: { classes: 'text-primary underline-offset-4 hover:underline bg-transparent' },
19
+ };
20
+ /**
21
+ * Default CTA button variant styles
22
+ * Uses semantic Tailwind classes that map to CSS variables.
23
+ */
24
+ export const DEFAULT_CTA_BUTTON_VARIANTS = {
25
+ primary: { classes: 'bg-primary text-primary-foreground hover:bg-primary/90' },
26
+ secondary: { classes: 'bg-secondary text-secondary-foreground hover:bg-secondary/80' },
27
+ outline: { classes: 'border border-input bg-background hover:bg-accent hover:text-accent-foreground' },
28
+ ghost: { classes: 'bg-transparent hover:bg-accent hover:text-accent-foreground' },
29
+ link: { classes: 'text-primary underline-offset-4 hover:underline bg-transparent' },
30
+ };
31
+ /**
32
+ * Default CTA background styles
33
+ * Uses semantic Tailwind classes that map to CSS variables.
34
+ */
35
+ export const DEFAULT_CTA_BACKGROUND_STYLES = {
36
+ default: 'bg-muted',
37
+ dark: 'bg-foreground text-background',
38
+ light: 'bg-background',
39
+ };
40
+ /**
41
+ * Default color picker presets
42
+ * Matches DEFAULT_PRESETS from ColorPickerField.tsx
43
+ */
44
+ export const DEFAULT_COLOR_PRESETS = [
45
+ { hex: '#ffffff', label: 'White' },
46
+ { hex: '#f9fafb', label: 'Gray 50' },
47
+ { hex: '#f3f4f6', label: 'Gray 100' },
48
+ { hex: '#1f2937', label: 'Gray 800' },
49
+ { hex: '#111827', label: 'Gray 900' },
50
+ { hex: '#000000', label: 'Black' },
51
+ { hex: '#3b82f6', label: 'Blue' },
52
+ { hex: '#10b981', label: 'Green' },
53
+ { hex: '#f59e0b', label: 'Amber' },
54
+ { hex: '#ef4444', label: 'Red' },
55
+ ];
56
+ /**
57
+ * Default focus ring color class
58
+ * Uses semantic ring color from CSS variables
59
+ */
60
+ export const DEFAULT_FOCUS_RING = 'focus:ring-ring';
61
+ /**
62
+ * Complete default theme
63
+ * Used when no ThemeProvider is present or no theme config is provided
64
+ */
65
+ export const DEFAULT_THEME = {
66
+ buttonVariants: DEFAULT_BUTTON_VARIANTS,
67
+ ctaButtonVariants: DEFAULT_CTA_BUTTON_VARIANTS,
68
+ ctaBackgroundStyles: DEFAULT_CTA_BACKGROUND_STYLES,
69
+ colorPresets: DEFAULT_COLOR_PRESETS,
70
+ focusRingColor: DEFAULT_FOCUS_RING,
71
+ };
72
+ //# sourceMappingURL=defaults.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"defaults.js","sourceRoot":"","sources":["../../src/theme/defaults.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AASH;;;;GAIG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAwB;IAC1D,OAAO,EAAE,EAAE,OAAO,EAAE,wDAAwD,EAAE;IAC9E,SAAS,EAAE,EAAE,OAAO,EAAE,8DAA8D,EAAE;IACtF,OAAO,EAAE,EAAE,OAAO,EAAE,gFAAgF,EAAE;IACtG,KAAK,EAAE,EAAE,OAAO,EAAE,6DAA6D,EAAE;IACjF,WAAW,EAAE,EAAE,OAAO,EAAE,oEAAoE,EAAE;IAC9F,IAAI,EAAE,EAAE,OAAO,EAAE,gEAAgE,EAAE;CACpF,CAAA;AAED;;;GAGG;AACH,MAAM,CAAC,MAAM,2BAA2B,GAAwB;IAC9D,OAAO,EAAE,EAAE,OAAO,EAAE,wDAAwD,EAAE;IAC9E,SAAS,EAAE,EAAE,OAAO,EAAE,8DAA8D,EAAE;IACtF,OAAO,EAAE,EAAE,OAAO,EAAE,gFAAgF,EAAE;IACtG,KAAK,EAAE,EAAE,OAAO,EAAE,6DAA6D,EAAE;IACjF,IAAI,EAAE,EAAE,OAAO,EAAE,gEAAgE,EAAE;CACpF,CAAA;AAED;;;GAGG;AACH,MAAM,CAAC,MAAM,6BAA6B,GAAqB;IAC7D,OAAO,EAAE,UAAU;IACnB,IAAI,EAAE,+BAA+B;IACrC,KAAK,EAAE,eAAe;CACvB,CAAA;AAED;;;GAGG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAkB;IAClD,EAAE,GAAG,EAAE,SAAS,EAAE,KAAK,EAAE,OAAO,EAAE;IAClC,EAAE,GAAG,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,EAAE;IACpC,EAAE,GAAG,EAAE,SAAS,EAAE,KAAK,EAAE,UAAU,EAAE;IACrC,EAAE,GAAG,EAAE,SAAS,EAAE,KAAK,EAAE,UAAU,EAAE;IACrC,EAAE,GAAG,EAAE,SAAS,EAAE,KAAK,EAAE,UAAU,EAAE;IACrC,EAAE,GAAG,EAAE,SAAS,EAAE,KAAK,EAAE,OAAO,EAAE;IAClC,EAAE,GAAG,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE;IACjC,EAAE,GAAG,EAAE,SAAS,EAAE,KAAK,EAAE,OAAO,EAAE;IAClC,EAAE,GAAG,EAAE,SAAS,EAAE,KAAK,EAAE,OAAO,EAAE;IAClC,EAAE,GAAG,EAAE,SAAS,EAAE,KAAK,EAAE,KAAK,EAAE;CACjC,CAAA;AAED;;;GAGG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,iBAAiB,CAAA;AAEnD;;;GAGG;AACH,MAAM,CAAC,MAAM,aAAa,GAAkB;IAC1C,cAAc,EAAE,uBAAuB;IACvC,iBAAiB,EAAE,2BAA2B;IAC9C,mBAAmB,EAAE,6BAA6B;IAClD,YAAY,EAAE,qBAAqB;IACnC,cAAc,EAAE,kBAAkB;CACnC,CAAA"}
@@ -0,0 +1,30 @@
1
+ /**
2
+ * Example Theme Configuration
3
+ *
4
+ * Copy this file to your project and customize it to match your design system.
5
+ *
6
+ * Usage:
7
+ * 1. Copy this file to your project (e.g., src/lib/puck-theme.ts)
8
+ * 2. Customize the values to match your CSS variables/design tokens
9
+ * 3. Import and pass to PageRenderer or PuckEditor:
10
+ *
11
+ * ```tsx
12
+ * import { puckTheme } from '@/lib/puck-theme'
13
+ *
14
+ * <PageRenderer data={data} config={config} theme={puckTheme} />
15
+ * ```
16
+ */
17
+ import type { ThemeConfig } from './types';
18
+ /**
19
+ * Example theme using shadcn/ui CSS variables
20
+ *
21
+ * This example assumes you have CSS variables like:
22
+ * --primary, --primary-foreground
23
+ * --secondary, --secondary-foreground
24
+ * --accent, --accent-foreground
25
+ * --muted, --muted-foreground
26
+ * --destructive, --destructive-foreground
27
+ * --ring (for focus rings)
28
+ */
29
+ export declare const exampleTheme: ThemeConfig;
30
+ //# sourceMappingURL=example.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"example.d.ts","sourceRoot":"","sources":["../../src/theme/example.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAE1C;;;;;;;;;;GAUG;AACH,eAAO,MAAM,YAAY,EAAE,WAiE1B,CAAA"}
@@ -0,0 +1,89 @@
1
+ /**
2
+ * Example Theme Configuration
3
+ *
4
+ * Copy this file to your project and customize it to match your design system.
5
+ *
6
+ * Usage:
7
+ * 1. Copy this file to your project (e.g., src/lib/puck-theme.ts)
8
+ * 2. Customize the values to match your CSS variables/design tokens
9
+ * 3. Import and pass to PageRenderer or PuckEditor:
10
+ *
11
+ * ```tsx
12
+ * import { puckTheme } from '@/lib/puck-theme'
13
+ *
14
+ * <PageRenderer data={data} config={config} theme={puckTheme} />
15
+ * ```
16
+ */
17
+ /**
18
+ * Example theme using shadcn/ui CSS variables
19
+ *
20
+ * This example assumes you have CSS variables like:
21
+ * --primary, --primary-foreground
22
+ * --secondary, --secondary-foreground
23
+ * --accent, --accent-foreground
24
+ * --muted, --muted-foreground
25
+ * --destructive, --destructive-foreground
26
+ * --ring (for focus rings)
27
+ */
28
+ export const exampleTheme = {
29
+ // Button component variants
30
+ buttonVariants: {
31
+ default: {
32
+ classes: 'bg-primary text-primary-foreground hover:bg-primary/90',
33
+ },
34
+ secondary: {
35
+ classes: 'bg-secondary text-secondary-foreground hover:bg-secondary/80',
36
+ },
37
+ outline: {
38
+ classes: 'border border-input bg-background hover:bg-accent hover:text-accent-foreground',
39
+ },
40
+ ghost: {
41
+ classes: 'hover:bg-accent hover:text-accent-foreground',
42
+ },
43
+ destructive: {
44
+ classes: 'bg-destructive text-destructive-foreground hover:bg-destructive/90',
45
+ },
46
+ link: {
47
+ classes: 'text-primary underline-offset-4 hover:underline',
48
+ },
49
+ },
50
+ // CTA button variants
51
+ ctaButtonVariants: {
52
+ primary: {
53
+ classes: 'bg-primary text-primary-foreground hover:bg-primary/90',
54
+ },
55
+ secondary: {
56
+ classes: 'bg-secondary text-secondary-foreground hover:bg-secondary/80',
57
+ },
58
+ outline: {
59
+ classes: 'border border-input bg-background hover:bg-accent hover:text-accent-foreground',
60
+ },
61
+ },
62
+ // CTA background styles
63
+ ctaBackgroundStyles: {
64
+ default: 'bg-muted',
65
+ dark: 'bg-primary text-primary-foreground',
66
+ light: 'bg-background',
67
+ },
68
+ // Focus ring class
69
+ focusRingColor: 'focus:ring-ring',
70
+ // Color picker presets - customize with your brand colors
71
+ colorPresets: [
72
+ { hex: '#ffffff', label: 'White' },
73
+ { hex: '#f8fafc', label: 'Slate 50' },
74
+ { hex: '#f1f5f9', label: 'Slate 100' },
75
+ { hex: '#e2e8f0', label: 'Slate 200' },
76
+ { hex: '#64748b', label: 'Slate 500' },
77
+ { hex: '#334155', label: 'Slate 700' },
78
+ { hex: '#1e293b', label: 'Slate 800' },
79
+ { hex: '#0f172a', label: 'Slate 900' },
80
+ { hex: '#000000', label: 'Black' },
81
+ { hex: '#3b82f6', label: 'Blue' },
82
+ { hex: '#10b981', label: 'Green' },
83
+ { hex: '#f59e0b', label: 'Amber' },
84
+ { hex: '#ef4444', label: 'Red' },
85
+ ],
86
+ // Set to true to add your presets to defaults instead of replacing
87
+ extendColorPresets: false,
88
+ };
89
+ //# sourceMappingURL=example.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"example.js","sourceRoot":"","sources":["../../src/theme/example.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAIH;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,YAAY,GAAgB;IACvC,4BAA4B;IAC5B,cAAc,EAAE;QACd,OAAO,EAAE;YACP,OAAO,EAAE,wDAAwD;SAClE;QACD,SAAS,EAAE;YACT,OAAO,EAAE,8DAA8D;SACxE;QACD,OAAO,EAAE;YACP,OAAO,EAAE,gFAAgF;SAC1F;QACD,KAAK,EAAE;YACL,OAAO,EAAE,8CAA8C;SACxD;QACD,WAAW,EAAE;YACX,OAAO,EAAE,oEAAoE;SAC9E;QACD,IAAI,EAAE;YACJ,OAAO,EAAE,iDAAiD;SAC3D;KACF;IAED,sBAAsB;IACtB,iBAAiB,EAAE;QACjB,OAAO,EAAE;YACP,OAAO,EAAE,wDAAwD;SAClE;QACD,SAAS,EAAE;YACT,OAAO,EAAE,8DAA8D;SACxE;QACD,OAAO,EAAE;YACP,OAAO,EAAE,gFAAgF;SAC1F;KACF;IAED,wBAAwB;IACxB,mBAAmB,EAAE;QACnB,OAAO,EAAE,UAAU;QACnB,IAAI,EAAE,oCAAoC;QAC1C,KAAK,EAAE,eAAe;KACvB;IAED,mBAAmB;IACnB,cAAc,EAAE,iBAAiB;IAEjC,0DAA0D;IAC1D,YAAY,EAAE;QACZ,EAAE,GAAG,EAAE,SAAS,EAAE,KAAK,EAAE,OAAO,EAAE;QAClC,EAAE,GAAG,EAAE,SAAS,EAAE,KAAK,EAAE,UAAU,EAAE;QACrC,EAAE,GAAG,EAAE,SAAS,EAAE,KAAK,EAAE,WAAW,EAAE;QACtC,EAAE,GAAG,EAAE,SAAS,EAAE,KAAK,EAAE,WAAW,EAAE;QACtC,EAAE,GAAG,EAAE,SAAS,EAAE,KAAK,EAAE,WAAW,EAAE;QACtC,EAAE,GAAG,EAAE,SAAS,EAAE,KAAK,EAAE,WAAW,EAAE;QACtC,EAAE,GAAG,EAAE,SAAS,EAAE,KAAK,EAAE,WAAW,EAAE;QACtC,EAAE,GAAG,EAAE,SAAS,EAAE,KAAK,EAAE,WAAW,EAAE;QACtC,EAAE,GAAG,EAAE,SAAS,EAAE,KAAK,EAAE,OAAO,EAAE;QAClC,EAAE,GAAG,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE;QACjC,EAAE,GAAG,EAAE,SAAS,EAAE,KAAK,EAAE,OAAO,EAAE;QAClC,EAAE,GAAG,EAAE,SAAS,EAAE,KAAK,EAAE,OAAO,EAAE;QAClC,EAAE,GAAG,EAAE,SAAS,EAAE,KAAK,EAAE,KAAK,EAAE;KACjC;IAED,mEAAmE;IACnE,kBAAkB,EAAE,KAAK;CAC1B,CAAA"}
@@ -1,155 +1,32 @@
1
- import { T as ThemeConfig, R as ResolvedTheme, B as ButtonVariantStyles, a as BackgroundStyles, C as ColorPreset } from '../types-_6MvjyKv.js';
2
- export { b as ButtonVariantConfig, c as ThemeContextValue } from '../types-_6MvjyKv.js';
3
- import * as react_jsx_runtime from 'react/jsx-runtime';
4
- import { ReactNode } from 'react';
5
-
6
- interface ThemeProviderProps {
7
- children: ReactNode;
8
- /** Theme configuration to apply */
9
- theme?: ThemeConfig;
10
- }
11
1
  /**
12
- * Provides theme configuration to descendant Puck components
2
+ * Theme Module
3
+ *
4
+ * Provides dynamic theming capabilities for payload-puck components.
13
5
  *
14
6
  * @example
15
7
  * ```tsx
8
+ * import { ThemeProvider, useTheme, getVariantClasses } from '@delmaredigital/payload-puck/theme'
9
+ *
10
+ * // In your app
16
11
  * <ThemeProvider theme={{
17
12
  * buttonVariants: {
18
- * default: { classes: 'bg-primary text-white hover:bg-primary/90' }
13
+ * default: { classes: 'bg-primary text-primary-foreground' }
19
14
  * }
20
15
  * }}>
21
16
  * <PageRenderer data={data} />
22
17
  * </ThemeProvider>
23
- * ```
24
- */
25
- declare function ThemeProvider({ children, theme }: ThemeProviderProps): react_jsx_runtime.JSX.Element;
26
- /**
27
- * Hook to access the current theme
28
- *
29
- * Returns DEFAULT_THEME if no ThemeProvider is present,
30
- * ensuring components work standalone for backwards compatibility.
31
18
  *
32
- * @example
33
- * ```tsx
34
- * function MyComponent() {
19
+ * // In a component
20
+ * function CustomButton({ variant }) {
35
21
  * const theme = useTheme()
36
- * const buttonClasses = getVariantClasses(theme.buttonVariants, 'primary')
37
- * return <button className={buttonClasses}>Click me</button>
22
+ * const classes = getVariantClasses(theme.buttonVariants, variant)
23
+ * return <button className={classes}>...</button>
38
24
  * }
39
25
  * ```
40
26
  */
41
- declare function useTheme(): ResolvedTheme;
42
- /**
43
- * Gets the default theme for server components
44
- *
45
- * Use this when you need theme values in a server component
46
- * where hooks cannot be used.
47
- */
48
- declare function getDefaultTheme(): ResolvedTheme;
49
- /**
50
- * Hook to check if a ThemeProvider is present
51
- *
52
- * Useful for conditional logic based on whether theming is configured.
53
- */
54
- declare function useHasThemeProvider(): boolean;
55
-
56
- /**
57
- * Default Theme Values
58
- *
59
- * These defaults ensure backwards compatibility - components render
60
- * identically to before theming was introduced when no theme is provided.
61
- */
62
-
63
- /**
64
- * Default button variant styles
65
- * Uses semantic Tailwind classes that map to CSS variables (--primary, --secondary, etc.)
66
- * This allows consuming apps to customize colors via their theme CSS variables.
67
- */
68
- declare const DEFAULT_BUTTON_VARIANTS: ButtonVariantStyles;
69
- /**
70
- * Default CTA button variant styles
71
- * Uses semantic Tailwind classes that map to CSS variables.
72
- */
73
- declare const DEFAULT_CTA_BUTTON_VARIANTS: ButtonVariantStyles;
74
- /**
75
- * Default CTA background styles
76
- * Uses semantic Tailwind classes that map to CSS variables.
77
- */
78
- declare const DEFAULT_CTA_BACKGROUND_STYLES: BackgroundStyles;
79
- /**
80
- * Default color picker presets
81
- * Matches DEFAULT_PRESETS from ColorPickerField.tsx
82
- */
83
- declare const DEFAULT_COLOR_PRESETS: ColorPreset[];
84
- /**
85
- * Default focus ring color class
86
- * Uses semantic ring color from CSS variables
87
- */
88
- declare const DEFAULT_FOCUS_RING = "focus:ring-ring";
89
- /**
90
- * Complete default theme
91
- * Used when no ThemeProvider is present or no theme config is provided
92
- */
93
- declare const DEFAULT_THEME: ResolvedTheme;
94
-
95
- /**
96
- * Theme Resolution Utilities
97
- *
98
- * Functions for merging user-provided theme config with defaults
99
- * and safely accessing theme values.
100
- */
101
-
102
- /**
103
- * Merges user-provided theme config with defaults to create a fully resolved theme
104
- */
105
- declare function resolveTheme(config?: ThemeConfig): ResolvedTheme;
106
- /**
107
- * Safely gets variant classes from a variant styles object
108
- *
109
- * @param variants - The button variant styles object
110
- * @param variant - The variant key to look up
111
- * @param fallback - Fallback variant key if the requested variant doesn't exist
112
- * @returns The CSS classes string for the variant
113
- */
114
- declare function getVariantClasses(variants: ButtonVariantStyles, variant: string, fallback?: string): string;
115
- /**
116
- * Safely gets background style classes
117
- *
118
- * @param styles - The background styles object
119
- * @param style - The style key to look up
120
- * @param fallback - Fallback style key if the requested style doesn't exist
121
- * @returns The CSS classes string for the background
122
- */
123
- declare function getBackgroundClasses(styles: BackgroundStyles, style: string, fallback?: string): string;
124
-
125
- /**
126
- * Example Theme Configuration
127
- *
128
- * Copy this file to your project and customize it to match your design system.
129
- *
130
- * Usage:
131
- * 1. Copy this file to your project (e.g., src/lib/puck-theme.ts)
132
- * 2. Customize the values to match your CSS variables/design tokens
133
- * 3. Import and pass to PageRenderer or PuckEditor:
134
- *
135
- * ```tsx
136
- * import { puckTheme } from '@/lib/puck-theme'
137
- *
138
- * <PageRenderer data={data} config={config} theme={puckTheme} />
139
- * ```
140
- */
141
-
142
- /**
143
- * Example theme using shadcn/ui CSS variables
144
- *
145
- * This example assumes you have CSS variables like:
146
- * --primary, --primary-foreground
147
- * --secondary, --secondary-foreground
148
- * --accent, --accent-foreground
149
- * --muted, --muted-foreground
150
- * --destructive, --destructive-foreground
151
- * --ring (for focus rings)
152
- */
153
- declare const exampleTheme: ThemeConfig;
154
-
155
- export { BackgroundStyles, ButtonVariantStyles, ColorPreset, DEFAULT_BUTTON_VARIANTS, DEFAULT_COLOR_PRESETS, DEFAULT_CTA_BACKGROUND_STYLES, DEFAULT_CTA_BUTTON_VARIANTS, DEFAULT_FOCUS_RING, DEFAULT_THEME, ResolvedTheme, ThemeConfig, ThemeProvider, type ThemeProviderProps, exampleTheme, getBackgroundClasses, getDefaultTheme, getVariantClasses, resolveTheme, useHasThemeProvider, useTheme };
27
+ export type { ButtonVariantConfig, ButtonVariantStyles, ColorPreset, BackgroundStyles, ThemeConfig, ResolvedTheme, ThemeContextValue, } from './types';
28
+ export { ThemeProvider, useTheme, getDefaultTheme, useHasThemeProvider, type ThemeProviderProps, } from './context';
29
+ export { DEFAULT_BUTTON_VARIANTS, DEFAULT_CTA_BUTTON_VARIANTS, DEFAULT_CTA_BACKGROUND_STYLES, DEFAULT_COLOR_PRESETS, DEFAULT_FOCUS_RING, DEFAULT_THEME, } from './defaults';
30
+ export { resolveTheme, getVariantClasses, getBackgroundClasses } from './utils';
31
+ export { exampleTheme } from './example';
32
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/theme/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAGH,YAAY,EACV,mBAAmB,EACnB,mBAAmB,EACnB,WAAW,EACX,gBAAgB,EAChB,WAAW,EACX,aAAa,EACb,iBAAiB,GAClB,MAAM,SAAS,CAAA;AAGhB,OAAO,EACL,aAAa,EACb,QAAQ,EACR,eAAe,EACf,mBAAmB,EACnB,KAAK,kBAAkB,GACxB,MAAM,WAAW,CAAA;AAGlB,OAAO,EACL,uBAAuB,EACvB,2BAA2B,EAC3B,6BAA6B,EAC7B,qBAAqB,EACrB,kBAAkB,EAClB,aAAa,GACd,MAAM,YAAY,CAAA;AAGnB,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAA;AAG/E,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA"}