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