@delmaredigital/payload-puck 0.1.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 (128) hide show
  1. package/LICENSE +73 -0
  2. package/README.md +1580 -0
  3. package/dist/AccordionClient.d.mts +24 -0
  4. package/dist/AccordionClient.d.ts +24 -0
  5. package/dist/AccordionClient.js +786 -0
  6. package/dist/AccordionClient.js.map +1 -0
  7. package/dist/AccordionClient.mjs +784 -0
  8. package/dist/AccordionClient.mjs.map +1 -0
  9. package/dist/AnimatedWrapper.d.mts +30 -0
  10. package/dist/AnimatedWrapper.d.ts +30 -0
  11. package/dist/AnimatedWrapper.js +379 -0
  12. package/dist/AnimatedWrapper.js.map +1 -0
  13. package/dist/AnimatedWrapper.mjs +377 -0
  14. package/dist/AnimatedWrapper.mjs.map +1 -0
  15. package/dist/admin/client.d.mts +108 -0
  16. package/dist/admin/client.d.ts +108 -0
  17. package/dist/admin/client.js +177 -0
  18. package/dist/admin/client.js.map +1 -0
  19. package/dist/admin/client.mjs +173 -0
  20. package/dist/admin/client.mjs.map +1 -0
  21. package/dist/admin/index.d.mts +157 -0
  22. package/dist/admin/index.d.ts +157 -0
  23. package/dist/admin/index.js +31 -0
  24. package/dist/admin/index.js.map +1 -0
  25. package/dist/admin/index.mjs +29 -0
  26. package/dist/admin/index.mjs.map +1 -0
  27. package/dist/api/index.d.mts +460 -0
  28. package/dist/api/index.d.ts +460 -0
  29. package/dist/api/index.js +588 -0
  30. package/dist/api/index.js.map +1 -0
  31. package/dist/api/index.mjs +578 -0
  32. package/dist/api/index.mjs.map +1 -0
  33. package/dist/components/index.css +339 -0
  34. package/dist/components/index.css.map +1 -0
  35. package/dist/components/index.d.mts +222 -0
  36. package/dist/components/index.d.ts +222 -0
  37. package/dist/components/index.js +9177 -0
  38. package/dist/components/index.js.map +1 -0
  39. package/dist/components/index.mjs +9130 -0
  40. package/dist/components/index.mjs.map +1 -0
  41. package/dist/config/config.editor.css +339 -0
  42. package/dist/config/config.editor.css.map +1 -0
  43. package/dist/config/config.editor.d.mts +153 -0
  44. package/dist/config/config.editor.d.ts +153 -0
  45. package/dist/config/config.editor.js +9400 -0
  46. package/dist/config/config.editor.js.map +1 -0
  47. package/dist/config/config.editor.mjs +9368 -0
  48. package/dist/config/config.editor.mjs.map +1 -0
  49. package/dist/config/index.d.mts +68 -0
  50. package/dist/config/index.d.ts +68 -0
  51. package/dist/config/index.js +2017 -0
  52. package/dist/config/index.js.map +1 -0
  53. package/dist/config/index.mjs +1991 -0
  54. package/dist/config/index.mjs.map +1 -0
  55. package/dist/editor/index.d.mts +784 -0
  56. package/dist/editor/index.d.ts +784 -0
  57. package/dist/editor/index.js +4517 -0
  58. package/dist/editor/index.js.map +1 -0
  59. package/dist/editor/index.mjs +4483 -0
  60. package/dist/editor/index.mjs.map +1 -0
  61. package/dist/fields/index.css +339 -0
  62. package/dist/fields/index.css.map +1 -0
  63. package/dist/fields/index.d.mts +600 -0
  64. package/dist/fields/index.d.ts +600 -0
  65. package/dist/fields/index.js +7739 -0
  66. package/dist/fields/index.js.map +1 -0
  67. package/dist/fields/index.mjs +7590 -0
  68. package/dist/fields/index.mjs.map +1 -0
  69. package/dist/index-CQu6SzDg.d.mts +327 -0
  70. package/dist/index-CoUQnyC3.d.ts +327 -0
  71. package/dist/index.d.mts +6 -0
  72. package/dist/index.d.ts +6 -0
  73. package/dist/index.js +569 -0
  74. package/dist/index.js.map +1 -0
  75. package/dist/index.mjs +555 -0
  76. package/dist/index.mjs.map +1 -0
  77. package/dist/layouts/index.d.mts +96 -0
  78. package/dist/layouts/index.d.ts +96 -0
  79. package/dist/layouts/index.js +394 -0
  80. package/dist/layouts/index.js.map +1 -0
  81. package/dist/layouts/index.mjs +378 -0
  82. package/dist/layouts/index.mjs.map +1 -0
  83. package/dist/plugin/index.d.mts +289 -0
  84. package/dist/plugin/index.d.ts +289 -0
  85. package/dist/plugin/index.js +569 -0
  86. package/dist/plugin/index.js.map +1 -0
  87. package/dist/plugin/index.mjs +555 -0
  88. package/dist/plugin/index.mjs.map +1 -0
  89. package/dist/render/index.d.mts +109 -0
  90. package/dist/render/index.d.ts +109 -0
  91. package/dist/render/index.js +2146 -0
  92. package/dist/render/index.js.map +1 -0
  93. package/dist/render/index.mjs +2123 -0
  94. package/dist/render/index.mjs.map +1 -0
  95. package/dist/shared-DMAF1AcH.d.mts +545 -0
  96. package/dist/shared-DMAF1AcH.d.ts +545 -0
  97. package/dist/theme/index.d.mts +155 -0
  98. package/dist/theme/index.d.ts +155 -0
  99. package/dist/theme/index.js +201 -0
  100. package/dist/theme/index.js.map +1 -0
  101. package/dist/theme/index.mjs +186 -0
  102. package/dist/theme/index.mjs.map +1 -0
  103. package/dist/types-D7D3rZ1J.d.mts +116 -0
  104. package/dist/types-D7D3rZ1J.d.ts +116 -0
  105. package/dist/types-_6MvjyKv.d.mts +104 -0
  106. package/dist/types-_6MvjyKv.d.ts +104 -0
  107. package/dist/utils/index.d.mts +267 -0
  108. package/dist/utils/index.d.ts +267 -0
  109. package/dist/utils/index.js +426 -0
  110. package/dist/utils/index.js.map +1 -0
  111. package/dist/utils/index.mjs +412 -0
  112. package/dist/utils/index.mjs.map +1 -0
  113. package/dist/utils-DaRs9t0J.d.mts +85 -0
  114. package/dist/utils-gAvt0Vhw.d.ts +85 -0
  115. package/examples/README.md +240 -0
  116. package/examples/api/puck/pages/[id]/route.ts +64 -0
  117. package/examples/api/puck/pages/[id]/versions/route.ts +47 -0
  118. package/examples/api/puck/pages/route.ts +45 -0
  119. package/examples/app/(frontend)/page.tsx +94 -0
  120. package/examples/app/[...slug]/page.tsx +101 -0
  121. package/examples/app/pages/[id]/edit/page.tsx +148 -0
  122. package/examples/components/CustomBanner.tsx +368 -0
  123. package/examples/config/custom-config.ts +223 -0
  124. package/examples/config/payload.config.example.ts +64 -0
  125. package/examples/lib/puck-layouts.ts +258 -0
  126. package/examples/lib/puck-theme.ts +94 -0
  127. package/examples/styles/puck-theme.css +171 -0
  128. package/package.json +157 -0
@@ -0,0 +1,222 @@
1
+ import { ComponentConfig } from '@measured/puck';
2
+ import { R as ResponsiveValue, D as DimensionsValue, P as PaddingValue, V as VisibilityValue } from '../shared-DMAF1AcH.mjs';
3
+ export { AnimatedWrapper, AnimatedWrapperProps } from '../AnimatedWrapper.mjs';
4
+ import 'react/jsx-runtime';
5
+ import 'react';
6
+
7
+ /**
8
+ * Container Component - Puck Configuration
9
+ *
10
+ * Content wrapper with max-width and background options.
11
+ * Uses Puck's slot system for nesting other components.
12
+ * Uses Tailwind classes for layout, inline styles for dynamic user values.
13
+ *
14
+ * Supports both preset options and advanced custom styling:
15
+ * - Outer (Section): background, customPadding, border (applies to full-width wrapper)
16
+ * - Inner (Content): innerBackground, innerPadding, innerBorder (applies to max-width container)
17
+ *
18
+ * Responsive Controls:
19
+ * - dimensions: Different max-width at different breakpoints
20
+ * - customPadding: Different outer padding at different breakpoints
21
+ * - innerPadding: Different inner padding at different breakpoints
22
+ * - margin: Different margins at different breakpoints
23
+ * - visibility: Show/hide at different breakpoints
24
+ */
25
+
26
+ declare const ContainerConfig: ComponentConfig;
27
+
28
+ /**
29
+ * Flex Component - Puck Configuration
30
+ *
31
+ * Flexbox layout following official Puck demo patterns.
32
+ * Uses Tailwind classes for layout, inline styles for dynamic user values.
33
+ *
34
+ * Supports both preset options and advanced custom styling:
35
+ * - Background: unified BackgroundField (solid, gradient, or image)
36
+ * - Advanced: customPadding, customWidth, border
37
+ *
38
+ * Responsive Controls:
39
+ * - dimensions: Different dimensions at different breakpoints
40
+ * - customPadding: Different padding at different breakpoints
41
+ * - margin: Different margins at different breakpoints
42
+ * - visibility: Show/hide at different breakpoints
43
+ */
44
+
45
+ declare const FlexConfig: ComponentConfig;
46
+
47
+ /**
48
+ * Grid Component - Puck Configuration
49
+ *
50
+ * CSS Grid layout following official Puck demo patterns.
51
+ * Responsive: stacks on mobile (flex column), grid on desktop (md+).
52
+ * Uses Tailwind classes for layout, inline styles for dynamic user values.
53
+ *
54
+ * Supports both preset options and advanced custom styling:
55
+ * - Background: unified BackgroundField (solid, gradient, or image)
56
+ * - Advanced: customPadding, customWidth, border
57
+ *
58
+ * Responsive Controls:
59
+ * - gap: Different gap at different breakpoints
60
+ * - visibility: Show/hide at different breakpoints
61
+ */
62
+
63
+ declare const GridConfig: ComponentConfig;
64
+
65
+ /**
66
+ * Section Component - Puck Configuration
67
+ *
68
+ * Full-width section with background options and content slot.
69
+ * Used as a top-level page section wrapper.
70
+ * Uses Tailwind classes for layout, inline styles for dynamic user values.
71
+ *
72
+ * Supports both preset options and advanced custom styling:
73
+ * - Background: unified BackgroundField (solid, gradient, or image)
74
+ * - Advanced: customPadding, customWidth, border
75
+ *
76
+ * Responsive Controls:
77
+ * - dimensions: Different dimensions at different breakpoints
78
+ * - customPadding: Different padding at different breakpoints
79
+ * - margin: Different margins at different breakpoints
80
+ * - visibility: Show/hide at different breakpoints
81
+ */
82
+
83
+ declare const SectionConfig: ComponentConfig;
84
+
85
+ /**
86
+ * Spacer Component - Puck Configuration
87
+ *
88
+ * Simple spacing component for adding vertical or horizontal space.
89
+ * Uses Tailwind classes for layout and sizing from predefined options.
90
+ *
91
+ * Responsive Controls:
92
+ * - visibility: Show/hide at different breakpoints
93
+ */
94
+
95
+ declare const SpacerConfig: ComponentConfig;
96
+
97
+ /**
98
+ * Template Component - Puck Configuration
99
+ *
100
+ * A reusable template container that allows saving and loading
101
+ * pre-configured component arrangements from the Payload CMS.
102
+ *
103
+ * Use this component to:
104
+ * - Create reusable page sections
105
+ * - Save common component patterns as templates
106
+ * - Quickly load pre-built layouts
107
+ *
108
+ * Responsive Controls:
109
+ * - dimensions: Different dimensions at different breakpoints
110
+ * - customPadding: Different padding at different breakpoints
111
+ * - margin: Different margins at different breakpoints
112
+ * - visibility: Show/hide at different breakpoints
113
+ */
114
+
115
+ interface TemplateProps {
116
+ /** Slot for nested components */
117
+ content: unknown;
118
+ /** ID of the currently loaded template (or null if none) */
119
+ templateId: string | null;
120
+ /** Responsive dimensions */
121
+ dimensions: ResponsiveValue<DimensionsValue> | DimensionsValue | null;
122
+ /** Responsive padding */
123
+ customPadding: ResponsiveValue<PaddingValue> | PaddingValue | null;
124
+ /** Responsive margin */
125
+ margin: ResponsiveValue<PaddingValue> | PaddingValue | null;
126
+ /** Responsive visibility */
127
+ visibility: VisibilityValue | null;
128
+ }
129
+ declare const TemplateConfig: ComponentConfig;
130
+
131
+ /**
132
+ * Template Component - Server-safe Configuration
133
+ *
134
+ * A reusable template container for rendering nested components.
135
+ * This server-safe version excludes the TemplateField (which requires client-side APIs).
136
+ *
137
+ * For the full editor experience with template loading, use Template.tsx
138
+ *
139
+ * Responsive Controls:
140
+ * - dimensions: Different dimensions at different breakpoints
141
+ * - customPadding: Different padding at different breakpoints
142
+ * - margin: Different margins at different breakpoints
143
+ * - visibility: Show/hide at different breakpoints
144
+ */
145
+
146
+ declare const TemplateServerConfig: ComponentConfig;
147
+
148
+ /**
149
+ * Heading Component - Puck Configuration
150
+ *
151
+ * H1-H6 headings with customizable styling.
152
+ * Supports custom margin for spacing control.
153
+ */
154
+
155
+ declare const HeadingConfig: ComponentConfig;
156
+
157
+ /**
158
+ * Text Component - Puck Configuration
159
+ *
160
+ * Simple paragraph text with customizable styling.
161
+ */
162
+
163
+ declare const TextConfig: ComponentConfig;
164
+
165
+ /**
166
+ * RichText Component - Puck Server Configuration
167
+ *
168
+ * Server-safe config for rendering. Uses a simple textarea for the field.
169
+ * The editor config (RichText.editor.tsx) uses Tiptap for the visual editor.
170
+ */
171
+
172
+ declare const RichTextConfig: ComponentConfig;
173
+
174
+ declare const RichTextEditorConfig: ComponentConfig;
175
+
176
+ /**
177
+ * Image Component - Puck Configuration
178
+ *
179
+ * Standalone image block with optional link wrapper.
180
+ * Server-safe version using standard HTML img element.
181
+ *
182
+ * Responsive Controls:
183
+ * - visibility: Show/hide at different breakpoints
184
+ */
185
+
186
+ declare const ImageConfig: ComponentConfig;
187
+
188
+ /**
189
+ * Button Component - Puck Configuration
190
+ *
191
+ * CTA button with customizable styling and link support.
192
+ */
193
+
194
+ declare const ButtonConfig: ComponentConfig;
195
+
196
+ /**
197
+ * Card Component - Puck Configuration
198
+ *
199
+ * Content card with image, heading, and text.
200
+ */
201
+
202
+ declare const CardConfig: ComponentConfig;
203
+
204
+ /**
205
+ * Divider Component - Puck Configuration
206
+ *
207
+ * Horizontal line separator with customizable style.
208
+ */
209
+
210
+ declare const DividerConfig: ComponentConfig;
211
+
212
+ /**
213
+ * Accordion Component - Puck Configuration
214
+ *
215
+ * Expandable sections with collapsible content.
216
+ * Uses plain HTML/CSS for the accordion behavior.
217
+ * Supports custom margin for spacing control.
218
+ */
219
+
220
+ declare const AccordionConfig: ComponentConfig;
221
+
222
+ export { AccordionConfig, ButtonConfig, CardConfig, ContainerConfig, DividerConfig, FlexConfig, GridConfig, HeadingConfig, ImageConfig, RichTextConfig, RichTextEditorConfig, SectionConfig, SpacerConfig, TemplateConfig, type TemplateProps, TemplateServerConfig, TextConfig };
@@ -0,0 +1,222 @@
1
+ import { ComponentConfig } from '@measured/puck';
2
+ import { R as ResponsiveValue, D as DimensionsValue, P as PaddingValue, V as VisibilityValue } from '../shared-DMAF1AcH.js';
3
+ export { AnimatedWrapper, AnimatedWrapperProps } from '../AnimatedWrapper.js';
4
+ import 'react/jsx-runtime';
5
+ import 'react';
6
+
7
+ /**
8
+ * Container Component - Puck Configuration
9
+ *
10
+ * Content wrapper with max-width and background options.
11
+ * Uses Puck's slot system for nesting other components.
12
+ * Uses Tailwind classes for layout, inline styles for dynamic user values.
13
+ *
14
+ * Supports both preset options and advanced custom styling:
15
+ * - Outer (Section): background, customPadding, border (applies to full-width wrapper)
16
+ * - Inner (Content): innerBackground, innerPadding, innerBorder (applies to max-width container)
17
+ *
18
+ * Responsive Controls:
19
+ * - dimensions: Different max-width at different breakpoints
20
+ * - customPadding: Different outer padding at different breakpoints
21
+ * - innerPadding: Different inner padding at different breakpoints
22
+ * - margin: Different margins at different breakpoints
23
+ * - visibility: Show/hide at different breakpoints
24
+ */
25
+
26
+ declare const ContainerConfig: ComponentConfig;
27
+
28
+ /**
29
+ * Flex Component - Puck Configuration
30
+ *
31
+ * Flexbox layout following official Puck demo patterns.
32
+ * Uses Tailwind classes for layout, inline styles for dynamic user values.
33
+ *
34
+ * Supports both preset options and advanced custom styling:
35
+ * - Background: unified BackgroundField (solid, gradient, or image)
36
+ * - Advanced: customPadding, customWidth, border
37
+ *
38
+ * Responsive Controls:
39
+ * - dimensions: Different dimensions at different breakpoints
40
+ * - customPadding: Different padding at different breakpoints
41
+ * - margin: Different margins at different breakpoints
42
+ * - visibility: Show/hide at different breakpoints
43
+ */
44
+
45
+ declare const FlexConfig: ComponentConfig;
46
+
47
+ /**
48
+ * Grid Component - Puck Configuration
49
+ *
50
+ * CSS Grid layout following official Puck demo patterns.
51
+ * Responsive: stacks on mobile (flex column), grid on desktop (md+).
52
+ * Uses Tailwind classes for layout, inline styles for dynamic user values.
53
+ *
54
+ * Supports both preset options and advanced custom styling:
55
+ * - Background: unified BackgroundField (solid, gradient, or image)
56
+ * - Advanced: customPadding, customWidth, border
57
+ *
58
+ * Responsive Controls:
59
+ * - gap: Different gap at different breakpoints
60
+ * - visibility: Show/hide at different breakpoints
61
+ */
62
+
63
+ declare const GridConfig: ComponentConfig;
64
+
65
+ /**
66
+ * Section Component - Puck Configuration
67
+ *
68
+ * Full-width section with background options and content slot.
69
+ * Used as a top-level page section wrapper.
70
+ * Uses Tailwind classes for layout, inline styles for dynamic user values.
71
+ *
72
+ * Supports both preset options and advanced custom styling:
73
+ * - Background: unified BackgroundField (solid, gradient, or image)
74
+ * - Advanced: customPadding, customWidth, border
75
+ *
76
+ * Responsive Controls:
77
+ * - dimensions: Different dimensions at different breakpoints
78
+ * - customPadding: Different padding at different breakpoints
79
+ * - margin: Different margins at different breakpoints
80
+ * - visibility: Show/hide at different breakpoints
81
+ */
82
+
83
+ declare const SectionConfig: ComponentConfig;
84
+
85
+ /**
86
+ * Spacer Component - Puck Configuration
87
+ *
88
+ * Simple spacing component for adding vertical or horizontal space.
89
+ * Uses Tailwind classes for layout and sizing from predefined options.
90
+ *
91
+ * Responsive Controls:
92
+ * - visibility: Show/hide at different breakpoints
93
+ */
94
+
95
+ declare const SpacerConfig: ComponentConfig;
96
+
97
+ /**
98
+ * Template Component - Puck Configuration
99
+ *
100
+ * A reusable template container that allows saving and loading
101
+ * pre-configured component arrangements from the Payload CMS.
102
+ *
103
+ * Use this component to:
104
+ * - Create reusable page sections
105
+ * - Save common component patterns as templates
106
+ * - Quickly load pre-built layouts
107
+ *
108
+ * Responsive Controls:
109
+ * - dimensions: Different dimensions at different breakpoints
110
+ * - customPadding: Different padding at different breakpoints
111
+ * - margin: Different margins at different breakpoints
112
+ * - visibility: Show/hide at different breakpoints
113
+ */
114
+
115
+ interface TemplateProps {
116
+ /** Slot for nested components */
117
+ content: unknown;
118
+ /** ID of the currently loaded template (or null if none) */
119
+ templateId: string | null;
120
+ /** Responsive dimensions */
121
+ dimensions: ResponsiveValue<DimensionsValue> | DimensionsValue | null;
122
+ /** Responsive padding */
123
+ customPadding: ResponsiveValue<PaddingValue> | PaddingValue | null;
124
+ /** Responsive margin */
125
+ margin: ResponsiveValue<PaddingValue> | PaddingValue | null;
126
+ /** Responsive visibility */
127
+ visibility: VisibilityValue | null;
128
+ }
129
+ declare const TemplateConfig: ComponentConfig;
130
+
131
+ /**
132
+ * Template Component - Server-safe Configuration
133
+ *
134
+ * A reusable template container for rendering nested components.
135
+ * This server-safe version excludes the TemplateField (which requires client-side APIs).
136
+ *
137
+ * For the full editor experience with template loading, use Template.tsx
138
+ *
139
+ * Responsive Controls:
140
+ * - dimensions: Different dimensions at different breakpoints
141
+ * - customPadding: Different padding at different breakpoints
142
+ * - margin: Different margins at different breakpoints
143
+ * - visibility: Show/hide at different breakpoints
144
+ */
145
+
146
+ declare const TemplateServerConfig: ComponentConfig;
147
+
148
+ /**
149
+ * Heading Component - Puck Configuration
150
+ *
151
+ * H1-H6 headings with customizable styling.
152
+ * Supports custom margin for spacing control.
153
+ */
154
+
155
+ declare const HeadingConfig: ComponentConfig;
156
+
157
+ /**
158
+ * Text Component - Puck Configuration
159
+ *
160
+ * Simple paragraph text with customizable styling.
161
+ */
162
+
163
+ declare const TextConfig: ComponentConfig;
164
+
165
+ /**
166
+ * RichText Component - Puck Server Configuration
167
+ *
168
+ * Server-safe config for rendering. Uses a simple textarea for the field.
169
+ * The editor config (RichText.editor.tsx) uses Tiptap for the visual editor.
170
+ */
171
+
172
+ declare const RichTextConfig: ComponentConfig;
173
+
174
+ declare const RichTextEditorConfig: ComponentConfig;
175
+
176
+ /**
177
+ * Image Component - Puck Configuration
178
+ *
179
+ * Standalone image block with optional link wrapper.
180
+ * Server-safe version using standard HTML img element.
181
+ *
182
+ * Responsive Controls:
183
+ * - visibility: Show/hide at different breakpoints
184
+ */
185
+
186
+ declare const ImageConfig: ComponentConfig;
187
+
188
+ /**
189
+ * Button Component - Puck Configuration
190
+ *
191
+ * CTA button with customizable styling and link support.
192
+ */
193
+
194
+ declare const ButtonConfig: ComponentConfig;
195
+
196
+ /**
197
+ * Card Component - Puck Configuration
198
+ *
199
+ * Content card with image, heading, and text.
200
+ */
201
+
202
+ declare const CardConfig: ComponentConfig;
203
+
204
+ /**
205
+ * Divider Component - Puck Configuration
206
+ *
207
+ * Horizontal line separator with customizable style.
208
+ */
209
+
210
+ declare const DividerConfig: ComponentConfig;
211
+
212
+ /**
213
+ * Accordion Component - Puck Configuration
214
+ *
215
+ * Expandable sections with collapsible content.
216
+ * Uses plain HTML/CSS for the accordion behavior.
217
+ * Supports custom margin for spacing control.
218
+ */
219
+
220
+ declare const AccordionConfig: ComponentConfig;
221
+
222
+ export { AccordionConfig, ButtonConfig, CardConfig, ContainerConfig, DividerConfig, FlexConfig, GridConfig, HeadingConfig, ImageConfig, RichTextConfig, RichTextEditorConfig, SectionConfig, SpacerConfig, TemplateConfig, type TemplateProps, TemplateServerConfig, TextConfig };