@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,68 @@
1
+ import { Config } from '@measured/puck';
2
+ import { L as LayoutDefinition } from '../types-D7D3rZ1J.mjs';
3
+ export { D as DEFAULT_LAYOUTS, c as createLayout } from '../utils-DaRs9t0J.mjs';
4
+ import { b as MergeConfigOptions } from '../index-CQu6SzDg.mjs';
5
+ import 'react';
6
+ import 'payload';
7
+
8
+ /**
9
+ * Merges Puck configurations together
10
+ *
11
+ * @example
12
+ * ```typescript
13
+ * import { mergeConfigs, baseConfig } from '@delmaredigital/payload-puck/config'
14
+ *
15
+ * const customConfig = mergeConfigs({
16
+ * base: baseConfig,
17
+ * components: {
18
+ * CustomHero: myHeroConfig,
19
+ * },
20
+ * categories: {
21
+ * custom: { title: 'Custom', components: ['CustomHero'] },
22
+ * },
23
+ * exclude: ['CallToAction'], // Remove if not needed
24
+ * })
25
+ * ```
26
+ */
27
+ declare function mergeConfigs(options: MergeConfigOptions): Config;
28
+
29
+ /**
30
+ * Server-safe Puck configuration
31
+ *
32
+ * This config is safe for server-side rendering and should be used
33
+ * with the PageRenderer component.
34
+ */
35
+
36
+ /**
37
+ * Creates a Puck configuration with custom layouts
38
+ *
39
+ * @param layouts - Custom layout definitions
40
+ * @returns Puck configuration with the specified layouts
41
+ *
42
+ * @example
43
+ * ```tsx
44
+ * import { createConfig, DEFAULT_LAYOUTS, createLayout } from '@delmaredigital/payload-puck/config'
45
+ *
46
+ * const customConfig = createConfig([
47
+ * ...DEFAULT_LAYOUTS,
48
+ * createLayout({
49
+ * value: 'blog',
50
+ * label: 'Blog Post',
51
+ * maxWidth: '720px',
52
+ * }),
53
+ * ])
54
+ * ```
55
+ */
56
+ declare function createConfig(layouts?: LayoutDefinition[]): Config;
57
+ /**
58
+ * Base Puck configuration with server-safe component configs
59
+ *
60
+ * All components have server-safe versions (.server.tsx) that render
61
+ * without client-side interactivity. Use editorConfig from ./config.editor
62
+ * for the full interactive editor experience.
63
+ *
64
+ * For custom layouts, use createConfig() instead.
65
+ */
66
+ declare const baseConfig: Config;
67
+
68
+ export { LayoutDefinition, baseConfig, createConfig, mergeConfigs };
@@ -0,0 +1,68 @@
1
+ import { Config } from '@measured/puck';
2
+ import { L as LayoutDefinition } from '../types-D7D3rZ1J.js';
3
+ export { D as DEFAULT_LAYOUTS, c as createLayout } from '../utils-gAvt0Vhw.js';
4
+ import { b as MergeConfigOptions } from '../index-CoUQnyC3.js';
5
+ import 'react';
6
+ import 'payload';
7
+
8
+ /**
9
+ * Merges Puck configurations together
10
+ *
11
+ * @example
12
+ * ```typescript
13
+ * import { mergeConfigs, baseConfig } from '@delmaredigital/payload-puck/config'
14
+ *
15
+ * const customConfig = mergeConfigs({
16
+ * base: baseConfig,
17
+ * components: {
18
+ * CustomHero: myHeroConfig,
19
+ * },
20
+ * categories: {
21
+ * custom: { title: 'Custom', components: ['CustomHero'] },
22
+ * },
23
+ * exclude: ['CallToAction'], // Remove if not needed
24
+ * })
25
+ * ```
26
+ */
27
+ declare function mergeConfigs(options: MergeConfigOptions): Config;
28
+
29
+ /**
30
+ * Server-safe Puck configuration
31
+ *
32
+ * This config is safe for server-side rendering and should be used
33
+ * with the PageRenderer component.
34
+ */
35
+
36
+ /**
37
+ * Creates a Puck configuration with custom layouts
38
+ *
39
+ * @param layouts - Custom layout definitions
40
+ * @returns Puck configuration with the specified layouts
41
+ *
42
+ * @example
43
+ * ```tsx
44
+ * import { createConfig, DEFAULT_LAYOUTS, createLayout } from '@delmaredigital/payload-puck/config'
45
+ *
46
+ * const customConfig = createConfig([
47
+ * ...DEFAULT_LAYOUTS,
48
+ * createLayout({
49
+ * value: 'blog',
50
+ * label: 'Blog Post',
51
+ * maxWidth: '720px',
52
+ * }),
53
+ * ])
54
+ * ```
55
+ */
56
+ declare function createConfig(layouts?: LayoutDefinition[]): Config;
57
+ /**
58
+ * Base Puck configuration with server-safe component configs
59
+ *
60
+ * All components have server-safe versions (.server.tsx) that render
61
+ * without client-side interactivity. Use editorConfig from ./config.editor
62
+ * for the full interactive editor experience.
63
+ *
64
+ * For custom layouts, use createConfig() instead.
65
+ */
66
+ declare const baseConfig: Config;
67
+
68
+ export { LayoutDefinition, baseConfig, createConfig, mergeConfigs };