blocks-dusted 0.1.1 → 0.1.3

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 (56) hide show
  1. package/README.md +967 -3
  2. package/package.json +2 -2
  3. package/src/commands/add.js +143 -45
  4. package/src/commands/list.js +2 -2
  5. package/src/installers/checkRequirements.js +1 -0
  6. package/src/installers/copyTemplateFiles.js +23 -2
  7. package/src/installers/patchPayloadConfigCollections.js +92 -0
  8. package/src/installers/writeInstalledBlockReadme.js +17 -4
  9. package/src/registry/listTemplates.js +16 -7
  10. package/src/registry/loadTemplateManifest.js +20 -11
  11. package/src/registry/validateTemplateManifest.js +6 -5
  12. package/src/utils/paths.js +7 -0
  13. package/templates/blocks/DD-BookCall/Component.tsx +535 -573
  14. package/templates/blocks/DD-CardTemplate01/Component.tsx +45 -49
  15. package/templates/blocks/DD-Carousel-A/Component.tsx +249 -266
  16. package/templates/blocks/DD-Carousel-B/Component.tsx +403 -432
  17. package/templates/blocks/DD-ComparisonTable/Component.tsx +256 -272
  18. package/templates/blocks/DD-Contact/Component.tsx +434 -439
  19. package/templates/blocks/DD-Contact/config.ts +8 -3
  20. package/templates/blocks/DD-FeatCat/Component.tsx +302 -361
  21. package/templates/blocks/DD-FeatCat/config.ts +201 -204
  22. package/templates/blocks/DD-FeatStrip/Component.tsx +171 -201
  23. package/templates/blocks/DD-Hero/Component.tsx +297 -317
  24. package/templates/blocks/DD-HorizontalScroll/Component.tsx +244 -303
  25. package/templates/blocks/DD-MasonaryMedia/Component.tsx +202 -228
  26. package/templates/blocks/DD-MasonaryMedia/config.ts +13 -14
  27. package/templates/blocks/DD-Pricing/Component.tsx +372 -380
  28. package/templates/blocks/DD-Process/Component.tsx +149 -155
  29. package/templates/blocks/DD-Section/Component.tsx +266 -327
  30. package/templates/blocks/DD-Services/Component.tsx +176 -188
  31. package/templates/blocks/DD-ShowcaseGrid/Component.tsx +307 -317
  32. package/templates/blocks/DD-Slider-A/Component.tsx +237 -252
  33. package/templates/blocks/DD-StackCards/Component.tsx +137 -160
  34. package/templates/blocks/DD-Team/Component.tsx +247 -265
  35. package/templates/blocks/DD-TechStack/Component.tsx +57 -72
  36. package/templates/blocks/DD-Testimonials/Component.tsx +147 -147
  37. package/templates/blocks/DD-Testimonials/config.ts +66 -66
  38. package/templates/blocks/DD-Work/Component.tsx +315 -328
  39. package/templates/blocks/DD-Work-B/Component.tsx +294 -320
  40. package/templates/collections/Testimonials/README.md +11 -0
  41. package/templates/collections/Testimonials/Testimonials.ts +161 -0
  42. package/templates/collections/Testimonials/manifest.json +55 -0
  43. package/templates/components/HeaderDD02/MobileBottomNav/index.tsx +545 -0
  44. package/templates/components/HeaderDD02/README.md +45 -0
  45. package/templates/components/HeaderDD02/RowLabel.tsx +33 -0
  46. package/templates/components/HeaderDD02/config.ts +302 -0
  47. package/templates/components/HeaderDD02/index.tsx +517 -0
  48. package/templates/components/HeaderDD02/manifest.json +123 -0
  49. package/templates/components/RichText/README.md +13 -0
  50. package/templates/components/RichText/converter/componentConverter/blocks.tsx +43 -0
  51. package/templates/components/RichText/converter/componentConverter/types.ts +11 -0
  52. package/templates/components/RichText/converter/index.tsx +18 -0
  53. package/templates/components/RichText/converter/internalLinks.tsx +45 -0
  54. package/templates/components/RichText/converter/textConverter.tsx +27 -0
  55. package/templates/components/RichText/index.tsx +35 -0
  56. package/templates/components/RichText/manifest.json +80 -0
@@ -0,0 +1,302 @@
1
+ import type { Field } from 'payload'
2
+
3
+ import { BlocksFeature, HeadingFeature } from '@payloadcms/richtext-lexical'
4
+
5
+ import { defaultLexical } from '@/fields/defaultLexical'
6
+ import { link } from '@/fields/link'
7
+ import { iconPicker } from '@/fields/lucide-icon-picker/field'
8
+
9
+ const headerRichTextEditor = defaultLexical({
10
+ features: [
11
+ HeadingFeature({
12
+ enabledHeadingSizes: ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'],
13
+ }),
14
+ BlocksFeature({
15
+ blocks: [],
16
+ }),
17
+ ],
18
+ })
19
+
20
+ export const HeaderDD02: Field[] = [
21
+ {
22
+ admin: {
23
+ initCollapsed: true,
24
+ className: 'custom-css-class',
25
+ position: 'sidebar',
26
+ },
27
+ type: 'collapsible',
28
+ label: 'Scroll Behavior',
29
+ fields: [
30
+ {
31
+ name: 'enableHideOnScroll',
32
+ type: 'checkbox',
33
+ defaultValue: true,
34
+ admin: {
35
+ description:
36
+ 'Enable hiding the header when scrolling down and showing it when scrolling up',
37
+ },
38
+ },
39
+ {
40
+ type: 'row',
41
+ fields: [
42
+ {
43
+ name: 'scrollThreshold',
44
+ type: 'number',
45
+ defaultValue: 100,
46
+ admin: {
47
+ width: '50%',
48
+ description: 'Scroll distance in pixels before the header hides when scrolling down',
49
+ condition: (_, siblingData) => Boolean(siblingData?.enableHideOnScroll),
50
+ },
51
+ },
52
+ {
53
+ name: 'animationDuration',
54
+ type: 'number',
55
+ defaultValue: 0.3,
56
+ admin: {
57
+ width: '50%',
58
+ description: 'Duration of the hide/show animation in seconds',
59
+ condition: (_, siblingData) => Boolean(siblingData?.enableHideOnScroll),
60
+ },
61
+ },
62
+ ],
63
+ },
64
+ ],
65
+ },
66
+ {
67
+ admin: {
68
+ initCollapsed: true,
69
+ className: 'custom-css-class',
70
+ position: 'sidebar',
71
+ },
72
+ type: 'collapsible',
73
+ label: 'Mobile Navigation',
74
+ fields: [
75
+ {
76
+ name: 'mobileNavVariant',
77
+ type: 'select',
78
+ defaultValue: 'standard',
79
+ options: [
80
+ { label: 'Standard', value: 'standard' },
81
+ { label: 'Header03 Style', value: 'header03' },
82
+ ],
83
+ admin: {
84
+ hidden: false,
85
+ description: 'Select the mobile navigation style',
86
+ },
87
+ },
88
+ {
89
+ name: 'mobileNavHeader03',
90
+ type: 'ui',
91
+ admin: {
92
+ position: 'main',
93
+ components: {
94
+ Field: '@/components/Admin/ui/componentInfo.tsx#MobileNavHeader03',
95
+ },
96
+ },
97
+ },
98
+ {
99
+ name: 'showMobileLabels',
100
+ type: 'checkbox',
101
+ defaultValue: true,
102
+ admin: {
103
+ description: 'Show labels under icons in the mobile bottom navigation bar',
104
+ },
105
+ },
106
+ ],
107
+ },
108
+ {
109
+ name: 'navItems',
110
+ type: 'array',
111
+ fields: [
112
+ {
113
+ name: 'type',
114
+ type: 'select',
115
+ options: [
116
+ { label: 'Simple Link', value: 'link' },
117
+ { label: 'Dropdown with RichText + Links', value: 'dropdown-richtext' },
118
+ { label: 'Dropdown - Single Column with Description', value: 'dropdown-single-desc' },
119
+ { label: 'Dropdown - Single Column no Description', value: 'dropdown-single' },
120
+ { label: 'Dropdown - Single Column with Icons', value: 'dropdown-icons' },
121
+ ],
122
+ defaultValue: 'link',
123
+ },
124
+ link({
125
+ appearances: false,
126
+ overrides: {
127
+ admin: {
128
+ condition: (_, siblingData) => siblingData?.type === 'link',
129
+ },
130
+ },
131
+ }),
132
+ {
133
+ name: 'showLabel',
134
+ label: 'Show label',
135
+ type: 'checkbox',
136
+ defaultValue: true,
137
+ admin: {
138
+ description: 'Toggle the label text for this nav item (useful for icon-only links).',
139
+ condition: (_, siblingData) => siblingData?.type === 'link',
140
+ },
141
+ },
142
+ {
143
+ name: 'label',
144
+ type: 'text',
145
+ required: true,
146
+ admin: {
147
+ description: 'Dropdown trigger label',
148
+ condition: (_, siblingData) => siblingData?.type !== 'link',
149
+ },
150
+ },
151
+ iconPicker({
152
+ name: 'triggerIcon',
153
+ description: 'Optional icon for dropdown trigger',
154
+ required: false,
155
+ overrides: (field) => ({
156
+ ...field,
157
+ admin: {
158
+ ...field.admin,
159
+ condition: (_, siblingData) => siblingData?.type !== 'link',
160
+ },
161
+ }),
162
+ }),
163
+ {
164
+ name: 'triggerIconPosition',
165
+ type: 'select',
166
+ defaultValue: 'before',
167
+ options: [
168
+ { label: 'Before', value: 'before' },
169
+ { label: 'After', value: 'after' },
170
+ ],
171
+ admin: {
172
+ description: 'Icon position for dropdown trigger',
173
+ condition: (_, siblingData) => siblingData?.type !== 'link',
174
+ },
175
+ },
176
+ {
177
+ name: 'richTextContent',
178
+ type: 'richText',
179
+ admin: {
180
+ description: 'Rich text content for the featured column',
181
+ condition: (_, siblingData) => siblingData?.type === 'dropdown-richtext',
182
+ },
183
+ editor: headerRichTextEditor,
184
+ },
185
+ {
186
+ name: 'v1_children',
187
+ label: 'Menu Items on Column 2',
188
+ type: 'array',
189
+ admin: {
190
+ description: 'Add dropdown menu items for RichText variant',
191
+ initCollapsed: true,
192
+ components: {
193
+ RowLabel: '/Header/RowLabel.tsx#RowLabel',
194
+ },
195
+ condition: (_, siblingData) => siblingData?.type === 'dropdown-richtext',
196
+ },
197
+ fields: [
198
+ link({ appearances: false }),
199
+ {
200
+ name: 'description',
201
+ label: 'Description',
202
+ type: 'text',
203
+ admin: {
204
+ description: 'Short description for menu items',
205
+ },
206
+ },
207
+ ],
208
+ },
209
+ {
210
+ name: 'v4_children',
211
+ label: 'Menu Items with Description',
212
+ type: 'array',
213
+ admin: {
214
+ description: 'Add dropdown menu items for single column with description',
215
+ initCollapsed: true,
216
+ components: {
217
+ RowLabel: '/Header/RowLabel.tsx#RowLabel',
218
+ },
219
+ condition: (_, siblingData) => siblingData?.type === 'dropdown-single-desc',
220
+ },
221
+ fields: [
222
+ link({ appearances: false }),
223
+ {
224
+ name: 'description',
225
+ label: 'Description',
226
+ type: 'text',
227
+ admin: {
228
+ description: 'Short description for menu items',
229
+ },
230
+ },
231
+ ],
232
+ },
233
+ {
234
+ name: 'v5_children',
235
+ label: 'Menu Items no Description',
236
+ type: 'array',
237
+ admin: {
238
+ description: 'Add dropdown menu items for single column without description',
239
+ initCollapsed: true,
240
+ components: {
241
+ RowLabel: '/Header/RowLabel.tsx#RowLabel',
242
+ },
243
+ condition: (_, siblingData) => siblingData?.type === 'dropdown-single',
244
+ },
245
+ fields: [link({ appearances: false })],
246
+ },
247
+ {
248
+ name: 'v6_children',
249
+ label: 'Menu Items with Icons',
250
+ type: 'array',
251
+ admin: {
252
+ description: 'Add dropdown menu items with icons',
253
+ initCollapsed: true,
254
+ components: {
255
+ RowLabel: '/Header/RowLabel.tsx#RowLabel',
256
+ },
257
+ condition: (_, siblingData) => siblingData?.type === 'dropdown-icons',
258
+ },
259
+ fields: [
260
+ link({
261
+ appearances: false,
262
+ overrides: {
263
+ admin: {
264
+ description: 'Link with icon support (icon field included in link)',
265
+ },
266
+ },
267
+ }),
268
+ ],
269
+ },
270
+ ],
271
+ admin: {
272
+ initCollapsed: true,
273
+ components: {
274
+ RowLabel: '/Header/RowLabel.tsx#RowLabel',
275
+ },
276
+ description:
277
+ 'Add navigation items here. Each can be a simple link or different types of dropdown menus.',
278
+ },
279
+ maxRows: 8,
280
+ },
281
+ {
282
+ name: 'showFloatingContent',
283
+ label: 'Show Floating Content',
284
+ type: 'checkbox',
285
+ defaultValue: false,
286
+ admin: {
287
+ condition: (_, siblingData) => siblingData?.mobileNavVariant === 'header03',
288
+ description: 'Toggle to show/hide the floating content panel',
289
+ },
290
+ },
291
+ {
292
+ name: 'floatingContent',
293
+ label: 'Floating Content (Above Drawer)',
294
+ type: 'richText',
295
+ admin: {
296
+ condition: (_, siblingData) =>
297
+ siblingData?.mobileNavVariant === 'header03' && siblingData?.showFloatingContent === true,
298
+ description: 'Content that appears in the floating panel above the drawer',
299
+ },
300
+ editor: headerRichTextEditor,
301
+ },
302
+ ]