blocks-dusted 0.1.11 → 0.1.12
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.
- package/package.json +5 -2
- package/src/cli.js +39 -3
- package/src/commands/shop.js +59 -0
- package/src/commands/warehouse.js +73 -0
- package/templates/blocks/DD-BookCall/Component.tsx +535 -534
- package/templates/blocks/DD-CardTemplate01/Component.tsx +140 -139
- package/templates/blocks/DD-Carousel-A/Component.tsx +1 -1
- package/templates/blocks/DD-Carousel-B/Component.tsx +1 -1
- package/templates/blocks/DD-Chip/Component.tsx +14 -14
- package/templates/blocks/DD-ComparisonTable/Component.tsx +1 -1
- package/templates/blocks/DD-Contact/Component.tsx +8 -7
- package/templates/blocks/DD-Counter/Component.tsx +10 -10
- package/templates/blocks/DD-FeatCat/Component.tsx +1 -1
- package/templates/blocks/DD-FeatStrip/Component.tsx +1 -1
- package/templates/blocks/DD-Hero/Component.tsx +297 -320
- package/templates/blocks/DD-HorizontalScroll/Component.tsx +936 -938
- package/templates/blocks/DD-IframeMedia/Component.tsx +14 -10
- package/templates/blocks/DD-MasonaryMedia/Component.tsx +8 -10
- package/templates/blocks/DD-Pricing/Component.tsx +369 -372
- package/templates/blocks/DD-Process/Component.tsx +147 -149
- package/templates/blocks/DD-Progress/Component.tsx +156 -141
- package/templates/blocks/DD-ProjSlider/config.ts +2 -2
- package/templates/blocks/DD-Section/Component.tsx +1 -1
- package/templates/blocks/DD-Services/Component.tsx +1 -1
- package/templates/blocks/DD-ShowcaseGrid/Component.tsx +13 -13
- package/templates/blocks/DD-Slider-A/Component.tsx +237 -237
- package/templates/blocks/DD-StackCards/Component.tsx +473 -473
- package/templates/blocks/DD-Team/Component.tsx +1 -1
- package/templates/blocks/DD-TechStack/Component.tsx +22 -28
- package/templates/blocks/DD-Testimonials/Component.tsx +35 -43
- package/templates/blocks/DD-TextMarq/Component.tsx +157 -157
- package/templates/blocks/DD-Thanks/Component.tsx +501 -500
- package/templates/blocks/DD-Work/Component.tsx +4 -4
- package/templates/blocks/DD-Work-B/Component.tsx +1 -1
- package/templates/blocks/DDHG-CTASection2/Component.tsx +6 -6
- package/templates/blocks/DDHG-HighlightArc/Component.tsx +243 -243
- package/templates/blocks/DDHG-LogoMarquee/Component.tsx +143 -93
- package/templates/blocks/DDHG-LogoMarquee/config.ts +154 -66
- package/templates/blocks/DDHG-NavCodeGrid/Component.tsx +227 -213
- package/templates/blocks/DDHG-ProcessSec/Component.tsx +38 -39
- package/templates/blocks/DDHG-ServiceDetails/Component.tsx +11 -11
- package/templates/blocks/DDHG-ServiceDetails/ServiceDetailCard.tsx +24 -28
- package/templates/blocks/DDHG-ServiceHero/Component.tsx +1 -1
- package/templates/blocks/DDHG-ServiceOverview/Component.tsx +23 -23
- package/templates/blocks/DDHG-StatsFAQ/Component.tsx +40 -40
- package/templates/blocks/DDHG-TeamCards/Component.tsx +169 -131
|
@@ -1,93 +1,143 @@
|
|
|
1
|
-
'use client'
|
|
2
|
-
|
|
3
|
-
import React, { useState } from 'react'
|
|
4
|
-
import { motion } from 'framer-motion'
|
|
5
|
-
import Image from 'next/image'
|
|
6
|
-
import { cn } from '@/utilities/ui'
|
|
7
|
-
// DDHG TODO: Re-enable after reviewing the project-specific separator/custom CSS bundle.
|
|
8
|
-
// import { Separator } from '@/components/ui/separator'
|
|
9
|
-
// import { extractCustomCSS } from '@/utilities/renderCustomCSS'
|
|
10
|
-
|
|
11
|
-
const placeholderBlur =
|
|
12
|
-
'data:image/svg+xml;base64,' +
|
|
13
|
-
btoa(
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
1
|
+
'use client'
|
|
2
|
+
|
|
3
|
+
import React, { useState } from 'react'
|
|
4
|
+
import { motion } from 'framer-motion'
|
|
5
|
+
import Image from 'next/image'
|
|
6
|
+
import { cn } from '@/utilities/ui'
|
|
7
|
+
// DDHG TODO: Re-enable after reviewing the project-specific separator/custom CSS bundle.
|
|
8
|
+
// import { Separator } from '@/components/ui/separator'
|
|
9
|
+
// import { extractCustomCSS } from '@/utilities/renderCustomCSS'
|
|
10
|
+
|
|
11
|
+
const placeholderBlur =
|
|
12
|
+
'data:image/svg+xml;base64,' +
|
|
13
|
+
btoa(
|
|
14
|
+
`<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg" style="opacity:0"><rect width="100%" height="100%" fill="transparent" /></svg>`,
|
|
15
|
+
)
|
|
16
|
+
|
|
17
|
+
type LogoItem = {
|
|
18
|
+
image?: { url?: string | null; alt?: string | null } | null
|
|
19
|
+
imageClass?: string | null
|
|
20
|
+
imageStyle?: React.CSSProperties
|
|
21
|
+
imageAltClass?: string | null
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export type DDHGLogoMarqueeProps = {
|
|
25
|
+
sectionId?: string | null
|
|
26
|
+
logos?: LogoItem[] | null
|
|
27
|
+
speed?: number | null
|
|
28
|
+
spacing?: number | null
|
|
29
|
+
priority?: boolean | null
|
|
30
|
+
showTopDivider?: boolean | null
|
|
31
|
+
showBottomDivider?: boolean | null
|
|
32
|
+
containerClass?: string | null
|
|
33
|
+
itemWidth?: number | null
|
|
34
|
+
enableCustomCSS?: boolean | null
|
|
35
|
+
customCSS?: Array<{ blockType?: string; css?: string }> | string | null
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
const LogoImage: React.FC<{
|
|
39
|
+
src: string
|
|
40
|
+
alt?: string | null
|
|
41
|
+
customClass?: string | null
|
|
42
|
+
imageStyle?: React.CSSProperties
|
|
43
|
+
priority?: boolean
|
|
44
|
+
}> = ({ src, alt, customClass, imageStyle, priority = false }) => {
|
|
45
|
+
const [imageError, setImageError] = useState(false)
|
|
46
|
+
const imageSrc = !src || imageError ? placeholderBlur : src
|
|
47
|
+
return (
|
|
48
|
+
<Image
|
|
49
|
+
src={imageSrc}
|
|
50
|
+
alt={alt || 'Logo'}
|
|
51
|
+
width={300}
|
|
52
|
+
height={300}
|
|
53
|
+
priority={priority}
|
|
54
|
+
className={customClass || ''}
|
|
55
|
+
style={{
|
|
56
|
+
objectFit: 'contain',
|
|
57
|
+
...(imageStyle && typeof imageStyle === 'object' ? imageStyle : {}),
|
|
58
|
+
}}
|
|
59
|
+
onError={() => setImageError(true)}
|
|
60
|
+
placeholder="blur"
|
|
61
|
+
blurDataURL={placeholderBlur}
|
|
62
|
+
/>
|
|
63
|
+
)
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export const DDHGLogoMarquee: React.FC<DDHGLogoMarqueeProps> = ({
|
|
67
|
+
sectionId,
|
|
68
|
+
logos,
|
|
69
|
+
speed = 10,
|
|
70
|
+
spacing = 32,
|
|
71
|
+
priority = false,
|
|
72
|
+
showTopDivider = false,
|
|
73
|
+
showBottomDivider = false,
|
|
74
|
+
containerClass = 'overflow-hidden py-8 bg-transparent',
|
|
75
|
+
enableCustomCSS = false,
|
|
76
|
+
customCSS,
|
|
77
|
+
itemWidth,
|
|
78
|
+
}) => {
|
|
79
|
+
const validLogos = Array.isArray(logos) ? logos : []
|
|
80
|
+
if (validLogos.length === 0) return null
|
|
81
|
+
const calculatedItemWidth = itemWidth || 100
|
|
82
|
+
const totalWidth = validLogos.length * (calculatedItemWidth + (spacing || 0))
|
|
83
|
+
|
|
84
|
+
// DDHG TODO: Re-enable with extractCustomCSS when that bundle is reviewed.
|
|
85
|
+
// const extractedCSS = enableCustomCSS && Array.isArray(customCSS)
|
|
86
|
+
// ? extractCustomCSS(customCSS)
|
|
87
|
+
// : typeof customCSS === 'string'
|
|
88
|
+
// ? customCSS
|
|
89
|
+
// : ''
|
|
90
|
+
const extractedCSS = ''
|
|
91
|
+
void enableCustomCSS
|
|
92
|
+
void customCSS
|
|
93
|
+
void showTopDivider
|
|
94
|
+
void showBottomDivider
|
|
95
|
+
|
|
96
|
+
const renderSet = (suffix = '') =>
|
|
97
|
+
validLogos.map((logo, index) => (
|
|
98
|
+
<div
|
|
99
|
+
key={`logo-${index}${suffix}`}
|
|
100
|
+
className="marque-image-container shrink-0 flex flex-col items-center justify-center"
|
|
101
|
+
style={{
|
|
102
|
+
marginRight: `${spacing || 0}px`,
|
|
103
|
+
...(itemWidth
|
|
104
|
+
? { width: `${calculatedItemWidth}px` }
|
|
105
|
+
: { minWidth: `${calculatedItemWidth}px` }),
|
|
106
|
+
}}
|
|
107
|
+
>
|
|
108
|
+
<LogoImage
|
|
109
|
+
src={logo.image?.url || placeholderBlur}
|
|
110
|
+
alt={logo.image?.alt}
|
|
111
|
+
customClass={logo.imageClass}
|
|
112
|
+
imageStyle={logo.imageStyle}
|
|
113
|
+
priority={Boolean(priority)}
|
|
114
|
+
/>
|
|
115
|
+
<p className={cn('text-base text-center', logo.imageAltClass)}>{logo.image?.alt || null}</p>
|
|
116
|
+
</div>
|
|
117
|
+
))
|
|
118
|
+
|
|
119
|
+
return (
|
|
120
|
+
<>
|
|
121
|
+
{/* DDHG TODO: Re-enable optional Separator rendering after bundle review. */}
|
|
122
|
+
{/* {showTopDivider && <Separator gradient={true} className="border-seperator" />} */}
|
|
123
|
+
<div
|
|
124
|
+
id={sectionId ?? undefined}
|
|
125
|
+
className="logo-marquee-block relative mx-auto max-w-screen overflow-x-clip bg-stone-300/20 dark:bg-stone-900/10 top-[20vh]"
|
|
126
|
+
>
|
|
127
|
+
{extractedCSS && <style dangerouslySetInnerHTML={{ __html: extractedCSS }} />}
|
|
128
|
+
<motion.div
|
|
129
|
+
className={`${containerClass} flex py-4`}
|
|
130
|
+
animate={{ x: [0, -totalWidth] }}
|
|
131
|
+
transition={{ repeat: Infinity, duration: speed || 10, ease: 'linear' }}
|
|
132
|
+
style={{ width: `${totalWidth * 2}px` }}
|
|
133
|
+
>
|
|
134
|
+
{renderSet()}
|
|
135
|
+
{renderSet('-duplicate')}
|
|
136
|
+
</motion.div>
|
|
137
|
+
</div>
|
|
138
|
+
{/* {showBottomDivider && <Separator gradient={true} className="border-seperator opacity-20" />} */}
|
|
139
|
+
</>
|
|
140
|
+
)
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
export default DDHGLogoMarquee
|
|
@@ -1,66 +1,154 @@
|
|
|
1
|
-
import type { Block } from 'payload'
|
|
2
|
-
// DDHG TODO: Re-enable with the project-specific CustomCssBlock bundle.
|
|
3
|
-
// import { CustomCSSBlock } from '@/blocks/CustomCssBlock/config'
|
|
4
|
-
|
|
5
|
-
export const DDHGLogoMarquee: Block = {
|
|
6
|
-
slug: 'DDHG-LogoMarquee',
|
|
7
|
-
interfaceName: 'DDHGLogoMarquee',
|
|
8
|
-
labels: { singular: 'Image Marquee', plural: 'Image Marquee' },
|
|
9
|
-
fields: [
|
|
10
|
-
{
|
|
11
|
-
|
|
12
|
-
type: '
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
1
|
+
import type { Block } from 'payload'
|
|
2
|
+
// DDHG TODO: Re-enable with the project-specific CustomCssBlock bundle.
|
|
3
|
+
// import { CustomCSSBlock } from '@/blocks/CustomCssBlock/config'
|
|
4
|
+
|
|
5
|
+
export const DDHGLogoMarquee: Block = {
|
|
6
|
+
slug: 'DDHG-LogoMarquee',
|
|
7
|
+
interfaceName: 'DDHGLogoMarquee',
|
|
8
|
+
labels: { singular: 'Image Marquee', plural: 'Image Marquee' },
|
|
9
|
+
fields: [
|
|
10
|
+
{
|
|
11
|
+
name: 'sectionId',
|
|
12
|
+
type: 'text',
|
|
13
|
+
label: 'Section ID',
|
|
14
|
+
required: false,
|
|
15
|
+
admin: { description: 'Optional anchor ID for linking and scroll targets.' },
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
type: 'collapsible',
|
|
19
|
+
label: 'Block Settings',
|
|
20
|
+
admin: { initCollapsed: true, className: 'custom-css-class' },
|
|
21
|
+
fields: [
|
|
22
|
+
{
|
|
23
|
+
type: 'collapsible',
|
|
24
|
+
label: 'Container Class',
|
|
25
|
+
admin: { initCollapsed: true, className: 'custom-css-class' },
|
|
26
|
+
fields: [
|
|
27
|
+
{
|
|
28
|
+
name: 'containerClass',
|
|
29
|
+
label: false,
|
|
30
|
+
type: 'text',
|
|
31
|
+
required: false,
|
|
32
|
+
admin: { description: 'Override the default container class.' },
|
|
33
|
+
},
|
|
34
|
+
],
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
type: 'collapsible',
|
|
38
|
+
label: 'Marquee Settings',
|
|
39
|
+
admin: { initCollapsed: true, className: 'custom-group-class' },
|
|
40
|
+
fields: [
|
|
41
|
+
{
|
|
42
|
+
type: 'row',
|
|
43
|
+
fields: [
|
|
44
|
+
{
|
|
45
|
+
name: 'speed',
|
|
46
|
+
type: 'number',
|
|
47
|
+
label: 'Scroll Speed (seconds)',
|
|
48
|
+
defaultValue: 10,
|
|
49
|
+
required: true,
|
|
50
|
+
admin: { width: '50%' },
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
name: 'spacing',
|
|
54
|
+
type: 'number',
|
|
55
|
+
label: 'Spacing between images (px)',
|
|
56
|
+
defaultValue: 32,
|
|
57
|
+
required: true,
|
|
58
|
+
admin: { width: '50%' },
|
|
59
|
+
},
|
|
60
|
+
],
|
|
61
|
+
},
|
|
62
|
+
],
|
|
63
|
+
},
|
|
64
|
+
{ name: 'priority', type: 'checkbox', label: 'High Priority Loading', defaultValue: false },
|
|
65
|
+
{
|
|
66
|
+
type: 'collapsible',
|
|
67
|
+
label: 'Dividers',
|
|
68
|
+
admin: { initCollapsed: true, className: 'custom-group-class' },
|
|
69
|
+
fields: [
|
|
70
|
+
{ name: 'showTopDivider', type: 'checkbox', label: 'Show Top Divider' },
|
|
71
|
+
{ name: 'showBottomDivider', type: 'checkbox', label: 'Show Bottom Divider' },
|
|
72
|
+
],
|
|
73
|
+
},
|
|
74
|
+
],
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
name: 'logoImages',
|
|
78
|
+
type: 'upload',
|
|
79
|
+
relationTo: 'media',
|
|
80
|
+
hasMany: true,
|
|
81
|
+
required: false,
|
|
82
|
+
filterOptions: { mimeType: { contains: 'image' } },
|
|
83
|
+
hooks: {
|
|
84
|
+
beforeChange: [
|
|
85
|
+
({ value, siblingData }) => {
|
|
86
|
+
if (!Array.isArray(value) || value.length === 0) return value
|
|
87
|
+
const existingLogos = Array.isArray((siblingData as any)?.logos)
|
|
88
|
+
? (siblingData as any).logos
|
|
89
|
+
: []
|
|
90
|
+
const normalizeImageId = (imageValue: unknown): number | string | undefined => {
|
|
91
|
+
if (typeof imageValue === 'number' || typeof imageValue === 'string')
|
|
92
|
+
return imageValue
|
|
93
|
+
if (imageValue && typeof imageValue === 'object' && 'id' in (imageValue as any)) {
|
|
94
|
+
const maybeId = (imageValue as any).id
|
|
95
|
+
if (typeof maybeId === 'number' || typeof maybeId === 'string') return maybeId
|
|
96
|
+
}
|
|
97
|
+
return undefined
|
|
98
|
+
}
|
|
99
|
+
const existingIds = new Set(
|
|
100
|
+
existingLogos
|
|
101
|
+
.map((row: any) => normalizeImageId(row?.image))
|
|
102
|
+
.filter((id: any) => id !== undefined),
|
|
103
|
+
)
|
|
104
|
+
const newRows = value
|
|
105
|
+
.map((id) => normalizeImageId(id))
|
|
106
|
+
.filter((id): id is number | string => id !== undefined)
|
|
107
|
+
.filter((id) => !existingIds.has(id))
|
|
108
|
+
.map((id) => ({ image: id, imageAltClass: 'hidden', imageClass: '' }))
|
|
109
|
+
;(siblingData as any).logos = [...existingLogos, ...newRows]
|
|
110
|
+
return []
|
|
111
|
+
},
|
|
112
|
+
],
|
|
113
|
+
},
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
name: 'logos',
|
|
117
|
+
type: 'array',
|
|
118
|
+
label: 'Images',
|
|
119
|
+
labels: { singular: 'Image', plural: 'Images' },
|
|
120
|
+
fields: [
|
|
121
|
+
{
|
|
122
|
+
name: 'image',
|
|
123
|
+
type: 'upload',
|
|
124
|
+
relationTo: 'media',
|
|
125
|
+
required: false,
|
|
126
|
+
filterOptions: { mimeType: { contains: 'image' } },
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
type: 'collapsible',
|
|
130
|
+
label: 'Alt Text Class',
|
|
131
|
+
admin: { initCollapsed: true, className: 'custom-css-class' },
|
|
132
|
+
fields: [
|
|
133
|
+
{
|
|
134
|
+
name: 'imageAltClass',
|
|
135
|
+
label: false,
|
|
136
|
+
type: 'text',
|
|
137
|
+
required: false,
|
|
138
|
+
defaultValue: 'hidden',
|
|
139
|
+
},
|
|
140
|
+
],
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
type: 'collapsible',
|
|
144
|
+
label: 'Image Class',
|
|
145
|
+
admin: { initCollapsed: true, className: 'custom-css-class' },
|
|
146
|
+
fields: [{ name: 'imageClass', label: false, type: 'text', required: false }],
|
|
147
|
+
},
|
|
148
|
+
],
|
|
149
|
+
},
|
|
150
|
+
// DDHG TODO: Re-enable custom CSS support after reviewing the CustomCssBlock bundle.
|
|
151
|
+
// { name: 'enableCustomCSS', type: 'checkbox', label: 'Inject Custom CSS', defaultValue: false },
|
|
152
|
+
// { name: 'customCSS', type: 'blocks', label: 'Custom CSS', blocks: [CustomCSSBlock], maxRows: 1, required: false, admin: { initCollapsed: true, className: 'for-devs-class custom-css-class', condition: (_, siblingData) => Boolean(siblingData.enableCustomCSS) } },
|
|
153
|
+
],
|
|
154
|
+
}
|