@delmaredigital/payload-puck 0.6.16 → 0.6.18
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/dist/components/email/EmailButton/EmailButton.editor.d.ts +3 -0
- package/dist/components/email/EmailButton/EmailButton.editor.js +81 -0
- package/dist/components/email/EmailButton/EmailButton.server.d.ts +3 -0
- package/dist/components/email/EmailButton/EmailButton.server.js +69 -0
- package/dist/components/email/EmailButton/EmailButton.types.d.ts +11 -0
- package/dist/components/email/EmailButton/EmailButton.types.js +1 -0
- package/dist/components/email/EmailColumns/EmailColumns.editor.d.ts +2 -0
- package/dist/components/email/EmailColumns/EmailColumns.editor.js +45 -0
- package/dist/components/email/EmailColumns/EmailColumns.server.d.ts +2 -0
- package/dist/components/email/EmailColumns/EmailColumns.server.js +58 -0
- package/dist/components/email/EmailColumns/EmailColumns.types.d.ts +8 -0
- package/dist/components/email/EmailColumns/EmailColumns.types.js +1 -0
- package/dist/components/email/EmailDivider/EmailDivider.editor.d.ts +3 -0
- package/dist/components/email/EmailDivider/EmailDivider.editor.js +38 -0
- package/dist/components/email/EmailDivider/EmailDivider.server.d.ts +3 -0
- package/dist/components/email/EmailDivider/EmailDivider.server.js +38 -0
- package/dist/components/email/EmailDivider/EmailDivider.types.d.ts +6 -0
- package/dist/components/email/EmailDivider/EmailDivider.types.js +1 -0
- package/dist/components/email/EmailFooter/EmailFooter.editor.d.ts +3 -0
- package/dist/components/email/EmailFooter/EmailFooter.editor.js +22 -0
- package/dist/components/email/EmailFooter/EmailFooter.server.d.ts +3 -0
- package/dist/components/email/EmailFooter/EmailFooter.server.js +59 -0
- package/dist/components/email/EmailFooter/EmailFooter.types.d.ts +6 -0
- package/dist/components/email/EmailFooter/EmailFooter.types.js +1 -0
- package/dist/components/email/EmailHeader/EmailHeader.editor.d.ts +3 -0
- package/dist/components/email/EmailHeader/EmailHeader.editor.js +28 -0
- package/dist/components/email/EmailHeader/EmailHeader.server.d.ts +3 -0
- package/dist/components/email/EmailHeader/EmailHeader.server.js +60 -0
- package/dist/components/email/EmailHeader/EmailHeader.types.d.ts +8 -0
- package/dist/components/email/EmailHeader/EmailHeader.types.js +1 -0
- package/dist/components/email/EmailHeading/EmailHeading.editor.d.ts +3 -0
- package/dist/components/email/EmailHeading/EmailHeading.editor.js +50 -0
- package/dist/components/email/EmailHeading/EmailHeading.server.d.ts +3 -0
- package/dist/components/email/EmailHeading/EmailHeading.server.js +35 -0
- package/dist/components/email/EmailHeading/EmailHeading.types.d.ts +7 -0
- package/dist/components/email/EmailHeading/EmailHeading.types.js +1 -0
- package/dist/components/email/EmailImage/EmailImage.editor.d.ts +3 -0
- package/dist/components/email/EmailImage/EmailImage.editor.js +46 -0
- package/dist/components/email/EmailImage/EmailImage.server.d.ts +3 -0
- package/dist/components/email/EmailImage/EmailImage.server.js +81 -0
- package/dist/components/email/EmailImage/EmailImage.types.d.ts +9 -0
- package/dist/components/email/EmailImage/EmailImage.types.js +1 -0
- package/dist/components/email/EmailSection/EmailSection.editor.d.ts +2 -0
- package/dist/components/email/EmailSection/EmailSection.editor.js +21 -0
- package/dist/components/email/EmailSection/EmailSection.server.d.ts +2 -0
- package/dist/components/email/EmailSection/EmailSection.server.js +49 -0
- package/dist/components/email/EmailSection/EmailSection.types.d.ts +7 -0
- package/dist/components/email/EmailSection/EmailSection.types.js +1 -0
- package/dist/components/email/EmailSocial/EmailSocial.editor.d.ts +3 -0
- package/dist/components/email/EmailSocial/EmailSocial.editor.js +70 -0
- package/dist/components/email/EmailSocial/EmailSocial.server.d.ts +3 -0
- package/dist/components/email/EmailSocial/EmailSocial.server.js +89 -0
- package/dist/components/email/EmailSocial/EmailSocial.types.d.ts +10 -0
- package/dist/components/email/EmailSocial/EmailSocial.types.js +1 -0
- package/dist/components/email/EmailSpacer/EmailSpacer.editor.d.ts +3 -0
- package/dist/components/email/EmailSpacer/EmailSpacer.editor.js +12 -0
- package/dist/components/email/EmailSpacer/EmailSpacer.server.d.ts +3 -0
- package/dist/components/email/EmailSpacer/EmailSpacer.server.js +25 -0
- package/dist/components/email/EmailSpacer/EmailSpacer.types.d.ts +3 -0
- package/dist/components/email/EmailSpacer/EmailSpacer.types.js +1 -0
- package/dist/components/email/EmailText/EmailText.editor.d.ts +3 -0
- package/dist/components/email/EmailText/EmailText.editor.js +102 -0
- package/dist/components/email/EmailText/EmailText.server.d.ts +3 -0
- package/dist/components/email/EmailText/EmailText.server.js +35 -0
- package/dist/components/email/EmailText/EmailText.types.d.ts +8 -0
- package/dist/components/email/EmailText/EmailText.types.js +1 -0
- package/dist/components/email/EmailWrapper/EmailWrapper.editor.d.ts +2 -0
- package/dist/components/email/EmailWrapper/EmailWrapper.editor.js +21 -0
- package/dist/components/email/EmailWrapper/EmailWrapper.server.d.ts +2 -0
- package/dist/components/email/EmailWrapper/EmailWrapper.server.js +61 -0
- package/dist/components/email/EmailWrapper/EmailWrapper.types.d.ts +7 -0
- package/dist/components/email/EmailWrapper/EmailWrapper.types.js +1 -0
- package/dist/components/email/exports.d.ts +49 -0
- package/dist/components/email/exports.js +50 -0
- package/dist/components/email/utils.d.ts +74 -0
- package/dist/components/email/utils.js +137 -0
- package/dist/config/config.email.d.ts +71 -0
- package/dist/config/config.email.editor.d.ts +82 -0
- package/dist/config/config.email.editor.js +112 -0
- package/dist/config/config.email.js +101 -0
- package/dist/email/EmailRenderer.d.ts +16 -0
- package/dist/email/EmailRenderer.js +20 -0
- package/dist/email/email-document.d.ts +29 -0
- package/dist/email/email-document.js +67 -0
- package/dist/email/index.d.ts +23 -0
- package/dist/email/index.js +22 -0
- package/dist/email/renderToEmailHtml.d.ts +23 -0
- package/dist/email/renderToEmailHtml.js +43 -0
- package/dist/fields/index.d.ts +1 -0
- package/dist/fields/index.js +1 -0
- package/dist/fields/shared.d.ts +16 -0
- package/dist/fields/shared.js +59 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +29 -17
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { EmailHeadingConfig } from './EmailHeading.server.js';
|
|
2
|
+
import { createColorPickerField } from '../../../fields/ColorPickerField.js';
|
|
3
|
+
export const EmailHeadingEditorConfig = {
|
|
4
|
+
...EmailHeadingConfig,
|
|
5
|
+
fields: {
|
|
6
|
+
text: {
|
|
7
|
+
type: 'text',
|
|
8
|
+
label: 'Text'
|
|
9
|
+
},
|
|
10
|
+
level: {
|
|
11
|
+
type: 'radio',
|
|
12
|
+
label: 'Level',
|
|
13
|
+
options: [
|
|
14
|
+
{
|
|
15
|
+
label: 'H1',
|
|
16
|
+
value: 1
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
label: 'H2',
|
|
20
|
+
value: 2
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
label: 'H3',
|
|
24
|
+
value: 3
|
|
25
|
+
}
|
|
26
|
+
]
|
|
27
|
+
},
|
|
28
|
+
color: createColorPickerField({
|
|
29
|
+
label: 'Color'
|
|
30
|
+
}),
|
|
31
|
+
alignment: {
|
|
32
|
+
type: 'radio',
|
|
33
|
+
label: 'Alignment',
|
|
34
|
+
options: [
|
|
35
|
+
{
|
|
36
|
+
label: 'Left',
|
|
37
|
+
value: 'left'
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
label: 'Center',
|
|
41
|
+
value: 'center'
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
label: 'Right',
|
|
45
|
+
value: 'right'
|
|
46
|
+
}
|
|
47
|
+
]
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { colorValueToEmailCSS } from '../../../fields/shared.js';
|
|
3
|
+
const HEADING_SIZES = {
|
|
4
|
+
1: '32px',
|
|
5
|
+
2: '24px',
|
|
6
|
+
3: '20px'
|
|
7
|
+
};
|
|
8
|
+
const defaultProps = {
|
|
9
|
+
text: 'Heading',
|
|
10
|
+
level: 1,
|
|
11
|
+
color: {
|
|
12
|
+
hex: '#333333'
|
|
13
|
+
},
|
|
14
|
+
alignment: 'left'
|
|
15
|
+
};
|
|
16
|
+
export const EmailHeadingConfig = {
|
|
17
|
+
label: 'Heading',
|
|
18
|
+
defaultProps,
|
|
19
|
+
render: ({ text, level, color, alignment })=>{
|
|
20
|
+
const textColor = colorValueToEmailCSS(color) ?? '#333333';
|
|
21
|
+
const fontSize = HEADING_SIZES[level] ?? '24px';
|
|
22
|
+
return /*#__PURE__*/ _jsx("p", {
|
|
23
|
+
style: {
|
|
24
|
+
margin: '0 0 16px 0',
|
|
25
|
+
padding: 0,
|
|
26
|
+
fontSize,
|
|
27
|
+
fontWeight: 'bold',
|
|
28
|
+
color: textColor,
|
|
29
|
+
textAlign: alignment,
|
|
30
|
+
lineHeight: '1.2'
|
|
31
|
+
},
|
|
32
|
+
children: text
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { EmailImageConfig } from './EmailImage.server.js';
|
|
2
|
+
import { createMediaField } from '../../../fields/MediaField.js';
|
|
3
|
+
export const EmailImageEditorConfig = {
|
|
4
|
+
...EmailImageConfig,
|
|
5
|
+
fields: {
|
|
6
|
+
image: createMediaField({
|
|
7
|
+
label: 'Image'
|
|
8
|
+
}),
|
|
9
|
+
alt: {
|
|
10
|
+
type: 'text',
|
|
11
|
+
label: 'Alt Text'
|
|
12
|
+
},
|
|
13
|
+
width: {
|
|
14
|
+
type: 'number',
|
|
15
|
+
label: 'Width (px)',
|
|
16
|
+
min: 50,
|
|
17
|
+
max: 900
|
|
18
|
+
},
|
|
19
|
+
height: {
|
|
20
|
+
type: 'number',
|
|
21
|
+
label: 'Height (px, optional)'
|
|
22
|
+
},
|
|
23
|
+
alignment: {
|
|
24
|
+
type: 'radio',
|
|
25
|
+
label: 'Alignment',
|
|
26
|
+
options: [
|
|
27
|
+
{
|
|
28
|
+
label: 'Left',
|
|
29
|
+
value: 'left'
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
label: 'Center',
|
|
33
|
+
value: 'center'
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
label: 'Right',
|
|
37
|
+
value: 'right'
|
|
38
|
+
}
|
|
39
|
+
]
|
|
40
|
+
},
|
|
41
|
+
link: {
|
|
42
|
+
type: 'text',
|
|
43
|
+
label: 'Link URL'
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
};
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { TABLE_ATTRS } from '../utils.js';
|
|
3
|
+
const defaultProps = {
|
|
4
|
+
image: null,
|
|
5
|
+
alt: '',
|
|
6
|
+
width: 600,
|
|
7
|
+
height: null,
|
|
8
|
+
alignment: 'center',
|
|
9
|
+
link: ''
|
|
10
|
+
};
|
|
11
|
+
export const EmailImageConfig = {
|
|
12
|
+
label: 'Image',
|
|
13
|
+
defaultProps,
|
|
14
|
+
render: ({ image, alt, width, height, alignment, link })=>{
|
|
15
|
+
if (!image?.url) {
|
|
16
|
+
return /*#__PURE__*/ _jsx("table", {
|
|
17
|
+
...TABLE_ATTRS,
|
|
18
|
+
style: {
|
|
19
|
+
width: '100%',
|
|
20
|
+
borderCollapse: 'collapse'
|
|
21
|
+
},
|
|
22
|
+
children: /*#__PURE__*/ _jsx("tbody", {
|
|
23
|
+
children: /*#__PURE__*/ _jsx("tr", {
|
|
24
|
+
children: /*#__PURE__*/ _jsx("td", {
|
|
25
|
+
align: alignment,
|
|
26
|
+
style: {
|
|
27
|
+
padding: '20px',
|
|
28
|
+
textAlign: alignment,
|
|
29
|
+
color: '#999999',
|
|
30
|
+
fontSize: '14px'
|
|
31
|
+
},
|
|
32
|
+
children: "No image selected"
|
|
33
|
+
})
|
|
34
|
+
})
|
|
35
|
+
})
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
const imgElement = /*#__PURE__*/ _jsx("img", {
|
|
39
|
+
src: image.url,
|
|
40
|
+
alt: alt || image.alt || '',
|
|
41
|
+
width: width,
|
|
42
|
+
height: height ?? undefined,
|
|
43
|
+
style: {
|
|
44
|
+
display: 'block',
|
|
45
|
+
width: `${width}px`,
|
|
46
|
+
maxWidth: '100%',
|
|
47
|
+
height: height ? `${height}px` : 'auto',
|
|
48
|
+
border: 0,
|
|
49
|
+
outline: 'none',
|
|
50
|
+
textDecoration: 'none'
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
const content = link ? /*#__PURE__*/ _jsx("a", {
|
|
54
|
+
href: link,
|
|
55
|
+
target: "_blank",
|
|
56
|
+
rel: "noopener noreferrer",
|
|
57
|
+
style: {
|
|
58
|
+
display: 'block'
|
|
59
|
+
},
|
|
60
|
+
children: imgElement
|
|
61
|
+
}) : imgElement;
|
|
62
|
+
return /*#__PURE__*/ _jsx("table", {
|
|
63
|
+
...TABLE_ATTRS,
|
|
64
|
+
style: {
|
|
65
|
+
width: '100%',
|
|
66
|
+
borderCollapse: 'collapse'
|
|
67
|
+
},
|
|
68
|
+
children: /*#__PURE__*/ _jsx("tbody", {
|
|
69
|
+
children: /*#__PURE__*/ _jsx("tr", {
|
|
70
|
+
children: /*#__PURE__*/ _jsx("td", {
|
|
71
|
+
align: alignment,
|
|
72
|
+
style: {
|
|
73
|
+
textAlign: alignment
|
|
74
|
+
},
|
|
75
|
+
children: content
|
|
76
|
+
})
|
|
77
|
+
})
|
|
78
|
+
})
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { EmailSectionConfig } from './EmailSection.server.js';
|
|
2
|
+
import { createColorPickerField } from '../../../fields/ColorPickerField.js';
|
|
3
|
+
import { createPaddingField } from '../../../fields/PaddingField.js';
|
|
4
|
+
export const EmailSectionEditorConfig = {
|
|
5
|
+
...EmailSectionConfig,
|
|
6
|
+
fields: {
|
|
7
|
+
...EmailSectionConfig.fields,
|
|
8
|
+
backgroundColor: createColorPickerField({
|
|
9
|
+
label: 'Background Color'
|
|
10
|
+
}),
|
|
11
|
+
padding: createPaddingField({
|
|
12
|
+
label: 'Padding'
|
|
13
|
+
}),
|
|
14
|
+
maxWidth: {
|
|
15
|
+
type: 'number',
|
|
16
|
+
label: 'Max Width (px)',
|
|
17
|
+
min: 200,
|
|
18
|
+
max: 900
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { TABLE_ATTRS, centeredTableStyle } from '../utils.js';
|
|
3
|
+
import { colorValueToEmailCSS, paddingValueToEmailCSS } from '../../../fields/shared.js';
|
|
4
|
+
const defaultProps = {
|
|
5
|
+
content: [],
|
|
6
|
+
backgroundColor: null,
|
|
7
|
+
padding: {
|
|
8
|
+
top: 20,
|
|
9
|
+
right: 20,
|
|
10
|
+
bottom: 20,
|
|
11
|
+
left: 20,
|
|
12
|
+
unit: 'px',
|
|
13
|
+
linked: true
|
|
14
|
+
},
|
|
15
|
+
maxWidth: 600
|
|
16
|
+
};
|
|
17
|
+
export const EmailSectionConfig = {
|
|
18
|
+
label: 'Section',
|
|
19
|
+
fields: {
|
|
20
|
+
content: {
|
|
21
|
+
type: 'slot'
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
defaultProps,
|
|
25
|
+
render: ({ content: Content, backgroundColor, padding, maxWidth })=>{
|
|
26
|
+
const bgColor = colorValueToEmailCSS(backgroundColor);
|
|
27
|
+
const paddingCSS = paddingValueToEmailCSS(padding);
|
|
28
|
+
const ContentSlot = Content;
|
|
29
|
+
return /*#__PURE__*/ _jsx("table", {
|
|
30
|
+
...TABLE_ATTRS,
|
|
31
|
+
style: centeredTableStyle(maxWidth),
|
|
32
|
+
children: /*#__PURE__*/ _jsx("tbody", {
|
|
33
|
+
children: /*#__PURE__*/ _jsx("tr", {
|
|
34
|
+
children: /*#__PURE__*/ _jsx("td", {
|
|
35
|
+
style: {
|
|
36
|
+
...bgColor ? {
|
|
37
|
+
backgroundColor: bgColor
|
|
38
|
+
} : {},
|
|
39
|
+
...paddingCSS ? {
|
|
40
|
+
padding: paddingCSS
|
|
41
|
+
} : {}
|
|
42
|
+
},
|
|
43
|
+
children: /*#__PURE__*/ _jsx(ContentSlot, {})
|
|
44
|
+
})
|
|
45
|
+
})
|
|
46
|
+
})
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { EmailSocialConfig } from './EmailSocial.server.js';
|
|
2
|
+
export const EmailSocialEditorConfig = {
|
|
3
|
+
...EmailSocialConfig,
|
|
4
|
+
fields: {
|
|
5
|
+
links: {
|
|
6
|
+
type: 'array',
|
|
7
|
+
label: 'Social Links',
|
|
8
|
+
arrayFields: {
|
|
9
|
+
platform: {
|
|
10
|
+
type: 'select',
|
|
11
|
+
label: 'Platform',
|
|
12
|
+
options: [
|
|
13
|
+
{
|
|
14
|
+
label: 'Facebook',
|
|
15
|
+
value: 'facebook'
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
label: 'X (Twitter)',
|
|
19
|
+
value: 'x'
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
label: 'Instagram',
|
|
23
|
+
value: 'instagram'
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
label: 'LinkedIn',
|
|
27
|
+
value: 'linkedin'
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
label: 'YouTube',
|
|
31
|
+
value: 'youtube'
|
|
32
|
+
}
|
|
33
|
+
]
|
|
34
|
+
},
|
|
35
|
+
url: {
|
|
36
|
+
type: 'text',
|
|
37
|
+
label: 'URL'
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
defaultItemProps: {
|
|
41
|
+
platform: 'facebook',
|
|
42
|
+
url: '#'
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
iconSize: {
|
|
46
|
+
type: 'number',
|
|
47
|
+
label: 'Icon Size (px)',
|
|
48
|
+
min: 20,
|
|
49
|
+
max: 64
|
|
50
|
+
},
|
|
51
|
+
alignment: {
|
|
52
|
+
type: 'radio',
|
|
53
|
+
label: 'Alignment',
|
|
54
|
+
options: [
|
|
55
|
+
{
|
|
56
|
+
label: 'Left',
|
|
57
|
+
value: 'left'
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
label: 'Center',
|
|
61
|
+
value: 'center'
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
label: 'Right',
|
|
65
|
+
value: 'right'
|
|
66
|
+
}
|
|
67
|
+
]
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
};
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { TABLE_ATTRS } from '../utils.js';
|
|
3
|
+
const PLATFORM_LABELS = {
|
|
4
|
+
facebook: 'Facebook',
|
|
5
|
+
x: 'X',
|
|
6
|
+
instagram: 'Instagram',
|
|
7
|
+
linkedin: 'LinkedIn',
|
|
8
|
+
youtube: 'YouTube'
|
|
9
|
+
};
|
|
10
|
+
const defaultProps = {
|
|
11
|
+
links: [
|
|
12
|
+
{
|
|
13
|
+
platform: 'facebook',
|
|
14
|
+
url: '#'
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
platform: 'x',
|
|
18
|
+
url: '#'
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
platform: 'instagram',
|
|
22
|
+
url: '#'
|
|
23
|
+
}
|
|
24
|
+
],
|
|
25
|
+
iconSize: 32,
|
|
26
|
+
alignment: 'center'
|
|
27
|
+
};
|
|
28
|
+
export const EmailSocialConfig = {
|
|
29
|
+
label: 'Social Links',
|
|
30
|
+
defaultProps,
|
|
31
|
+
render: ({ links, iconSize, alignment })=>{
|
|
32
|
+
if (!links?.length) {
|
|
33
|
+
return /*#__PURE__*/ _jsx("table", {
|
|
34
|
+
...TABLE_ATTRS,
|
|
35
|
+
style: {
|
|
36
|
+
width: '100%',
|
|
37
|
+
borderCollapse: 'collapse'
|
|
38
|
+
},
|
|
39
|
+
children: /*#__PURE__*/ _jsx("tbody", {
|
|
40
|
+
children: /*#__PURE__*/ _jsx("tr", {
|
|
41
|
+
children: /*#__PURE__*/ _jsx("td", {
|
|
42
|
+
style: {
|
|
43
|
+
padding: '10px 0'
|
|
44
|
+
}
|
|
45
|
+
})
|
|
46
|
+
})
|
|
47
|
+
})
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
return /*#__PURE__*/ _jsx("table", {
|
|
51
|
+
...TABLE_ATTRS,
|
|
52
|
+
style: {
|
|
53
|
+
width: '100%',
|
|
54
|
+
borderCollapse: 'collapse'
|
|
55
|
+
},
|
|
56
|
+
children: /*#__PURE__*/ _jsx("tbody", {
|
|
57
|
+
children: /*#__PURE__*/ _jsx("tr", {
|
|
58
|
+
children: /*#__PURE__*/ _jsx("td", {
|
|
59
|
+
align: alignment,
|
|
60
|
+
style: {
|
|
61
|
+
padding: '10px 0',
|
|
62
|
+
textAlign: alignment
|
|
63
|
+
},
|
|
64
|
+
children: links.map((link, i)=>/*#__PURE__*/ _jsx("a", {
|
|
65
|
+
href: link.url,
|
|
66
|
+
target: "_blank",
|
|
67
|
+
rel: "noopener noreferrer",
|
|
68
|
+
style: {
|
|
69
|
+
display: 'inline-block',
|
|
70
|
+
width: `${iconSize}px`,
|
|
71
|
+
height: `${iconSize}px`,
|
|
72
|
+
lineHeight: `${iconSize}px`,
|
|
73
|
+
textAlign: 'center',
|
|
74
|
+
backgroundColor: '#cccccc',
|
|
75
|
+
color: '#ffffff',
|
|
76
|
+
borderRadius: '50%',
|
|
77
|
+
textDecoration: 'none',
|
|
78
|
+
fontSize: '12px',
|
|
79
|
+
fontWeight: 'bold',
|
|
80
|
+
margin: '0 4px'
|
|
81
|
+
},
|
|
82
|
+
children: PLATFORM_LABELS[link.platform]?.charAt(0) ?? '?'
|
|
83
|
+
}, i))
|
|
84
|
+
})
|
|
85
|
+
})
|
|
86
|
+
})
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export type SocialPlatform = 'facebook' | 'x' | 'instagram' | 'linkedin' | 'youtube';
|
|
2
|
+
export interface SocialLink {
|
|
3
|
+
platform: SocialPlatform;
|
|
4
|
+
url: string;
|
|
5
|
+
}
|
|
6
|
+
export interface EmailSocialProps {
|
|
7
|
+
links: SocialLink[];
|
|
8
|
+
iconSize: number;
|
|
9
|
+
alignment: 'left' | 'center' | 'right';
|
|
10
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { TABLE_ATTRS, FULL_WIDTH_TABLE_STYLE } from '../utils.js';
|
|
3
|
+
const defaultProps = {
|
|
4
|
+
height: 24
|
|
5
|
+
};
|
|
6
|
+
export const EmailSpacerConfig = {
|
|
7
|
+
label: 'Spacer',
|
|
8
|
+
defaultProps,
|
|
9
|
+
render: ({ height })=>/*#__PURE__*/ _jsx("table", {
|
|
10
|
+
...TABLE_ATTRS,
|
|
11
|
+
style: FULL_WIDTH_TABLE_STYLE,
|
|
12
|
+
children: /*#__PURE__*/ _jsx("tbody", {
|
|
13
|
+
children: /*#__PURE__*/ _jsx("tr", {
|
|
14
|
+
children: /*#__PURE__*/ _jsx("td", {
|
|
15
|
+
style: {
|
|
16
|
+
height: `${height}px`,
|
|
17
|
+
fontSize: '1px',
|
|
18
|
+
lineHeight: `${height}px`
|
|
19
|
+
},
|
|
20
|
+
children: " "
|
|
21
|
+
})
|
|
22
|
+
})
|
|
23
|
+
})
|
|
24
|
+
})
|
|
25
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|