@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.
Files changed (95) hide show
  1. package/dist/components/email/EmailButton/EmailButton.editor.d.ts +3 -0
  2. package/dist/components/email/EmailButton/EmailButton.editor.js +81 -0
  3. package/dist/components/email/EmailButton/EmailButton.server.d.ts +3 -0
  4. package/dist/components/email/EmailButton/EmailButton.server.js +69 -0
  5. package/dist/components/email/EmailButton/EmailButton.types.d.ts +11 -0
  6. package/dist/components/email/EmailButton/EmailButton.types.js +1 -0
  7. package/dist/components/email/EmailColumns/EmailColumns.editor.d.ts +2 -0
  8. package/dist/components/email/EmailColumns/EmailColumns.editor.js +45 -0
  9. package/dist/components/email/EmailColumns/EmailColumns.server.d.ts +2 -0
  10. package/dist/components/email/EmailColumns/EmailColumns.server.js +58 -0
  11. package/dist/components/email/EmailColumns/EmailColumns.types.d.ts +8 -0
  12. package/dist/components/email/EmailColumns/EmailColumns.types.js +1 -0
  13. package/dist/components/email/EmailDivider/EmailDivider.editor.d.ts +3 -0
  14. package/dist/components/email/EmailDivider/EmailDivider.editor.js +38 -0
  15. package/dist/components/email/EmailDivider/EmailDivider.server.d.ts +3 -0
  16. package/dist/components/email/EmailDivider/EmailDivider.server.js +38 -0
  17. package/dist/components/email/EmailDivider/EmailDivider.types.d.ts +6 -0
  18. package/dist/components/email/EmailDivider/EmailDivider.types.js +1 -0
  19. package/dist/components/email/EmailFooter/EmailFooter.editor.d.ts +3 -0
  20. package/dist/components/email/EmailFooter/EmailFooter.editor.js +22 -0
  21. package/dist/components/email/EmailFooter/EmailFooter.server.d.ts +3 -0
  22. package/dist/components/email/EmailFooter/EmailFooter.server.js +59 -0
  23. package/dist/components/email/EmailFooter/EmailFooter.types.d.ts +6 -0
  24. package/dist/components/email/EmailFooter/EmailFooter.types.js +1 -0
  25. package/dist/components/email/EmailHeader/EmailHeader.editor.d.ts +3 -0
  26. package/dist/components/email/EmailHeader/EmailHeader.editor.js +28 -0
  27. package/dist/components/email/EmailHeader/EmailHeader.server.d.ts +3 -0
  28. package/dist/components/email/EmailHeader/EmailHeader.server.js +60 -0
  29. package/dist/components/email/EmailHeader/EmailHeader.types.d.ts +8 -0
  30. package/dist/components/email/EmailHeader/EmailHeader.types.js +1 -0
  31. package/dist/components/email/EmailHeading/EmailHeading.editor.d.ts +3 -0
  32. package/dist/components/email/EmailHeading/EmailHeading.editor.js +50 -0
  33. package/dist/components/email/EmailHeading/EmailHeading.server.d.ts +3 -0
  34. package/dist/components/email/EmailHeading/EmailHeading.server.js +35 -0
  35. package/dist/components/email/EmailHeading/EmailHeading.types.d.ts +7 -0
  36. package/dist/components/email/EmailHeading/EmailHeading.types.js +1 -0
  37. package/dist/components/email/EmailImage/EmailImage.editor.d.ts +3 -0
  38. package/dist/components/email/EmailImage/EmailImage.editor.js +46 -0
  39. package/dist/components/email/EmailImage/EmailImage.server.d.ts +3 -0
  40. package/dist/components/email/EmailImage/EmailImage.server.js +81 -0
  41. package/dist/components/email/EmailImage/EmailImage.types.d.ts +9 -0
  42. package/dist/components/email/EmailImage/EmailImage.types.js +1 -0
  43. package/dist/components/email/EmailSection/EmailSection.editor.d.ts +2 -0
  44. package/dist/components/email/EmailSection/EmailSection.editor.js +21 -0
  45. package/dist/components/email/EmailSection/EmailSection.server.d.ts +2 -0
  46. package/dist/components/email/EmailSection/EmailSection.server.js +49 -0
  47. package/dist/components/email/EmailSection/EmailSection.types.d.ts +7 -0
  48. package/dist/components/email/EmailSection/EmailSection.types.js +1 -0
  49. package/dist/components/email/EmailSocial/EmailSocial.editor.d.ts +3 -0
  50. package/dist/components/email/EmailSocial/EmailSocial.editor.js +70 -0
  51. package/dist/components/email/EmailSocial/EmailSocial.server.d.ts +3 -0
  52. package/dist/components/email/EmailSocial/EmailSocial.server.js +89 -0
  53. package/dist/components/email/EmailSocial/EmailSocial.types.d.ts +10 -0
  54. package/dist/components/email/EmailSocial/EmailSocial.types.js +1 -0
  55. package/dist/components/email/EmailSpacer/EmailSpacer.editor.d.ts +3 -0
  56. package/dist/components/email/EmailSpacer/EmailSpacer.editor.js +12 -0
  57. package/dist/components/email/EmailSpacer/EmailSpacer.server.d.ts +3 -0
  58. package/dist/components/email/EmailSpacer/EmailSpacer.server.js +25 -0
  59. package/dist/components/email/EmailSpacer/EmailSpacer.types.d.ts +3 -0
  60. package/dist/components/email/EmailSpacer/EmailSpacer.types.js +1 -0
  61. package/dist/components/email/EmailText/EmailText.editor.d.ts +3 -0
  62. package/dist/components/email/EmailText/EmailText.editor.js +102 -0
  63. package/dist/components/email/EmailText/EmailText.server.d.ts +3 -0
  64. package/dist/components/email/EmailText/EmailText.server.js +35 -0
  65. package/dist/components/email/EmailText/EmailText.types.d.ts +8 -0
  66. package/dist/components/email/EmailText/EmailText.types.js +1 -0
  67. package/dist/components/email/EmailWrapper/EmailWrapper.editor.d.ts +2 -0
  68. package/dist/components/email/EmailWrapper/EmailWrapper.editor.js +21 -0
  69. package/dist/components/email/EmailWrapper/EmailWrapper.server.d.ts +2 -0
  70. package/dist/components/email/EmailWrapper/EmailWrapper.server.js +61 -0
  71. package/dist/components/email/EmailWrapper/EmailWrapper.types.d.ts +7 -0
  72. package/dist/components/email/EmailWrapper/EmailWrapper.types.js +1 -0
  73. package/dist/components/email/exports.d.ts +49 -0
  74. package/dist/components/email/exports.js +50 -0
  75. package/dist/components/email/utils.d.ts +74 -0
  76. package/dist/components/email/utils.js +137 -0
  77. package/dist/config/config.email.d.ts +71 -0
  78. package/dist/config/config.email.editor.d.ts +82 -0
  79. package/dist/config/config.email.editor.js +112 -0
  80. package/dist/config/config.email.js +101 -0
  81. package/dist/email/EmailRenderer.d.ts +16 -0
  82. package/dist/email/EmailRenderer.js +20 -0
  83. package/dist/email/email-document.d.ts +29 -0
  84. package/dist/email/email-document.js +67 -0
  85. package/dist/email/index.d.ts +23 -0
  86. package/dist/email/index.js +22 -0
  87. package/dist/email/renderToEmailHtml.d.ts +23 -0
  88. package/dist/email/renderToEmailHtml.js +43 -0
  89. package/dist/fields/index.d.ts +1 -0
  90. package/dist/fields/index.js +1 -0
  91. package/dist/fields/shared.d.ts +16 -0
  92. package/dist/fields/shared.js +59 -0
  93. package/dist/version.d.ts +1 -1
  94. package/dist/version.js +1 -1
  95. 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,3 @@
1
+ import type { ComponentConfig } from '@puckeditor/core';
2
+ import type { EmailHeadingProps } from './EmailHeading.types.js';
3
+ export declare const EmailHeadingConfig: ComponentConfig<EmailHeadingProps>;
@@ -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,7 @@
1
+ import type { ColorValue } from '../../../fields/shared.js';
2
+ export interface EmailHeadingProps {
3
+ text: string;
4
+ level: 1 | 2 | 3;
5
+ color: ColorValue | null;
6
+ alignment: 'left' | 'center' | 'right';
7
+ }
@@ -0,0 +1,3 @@
1
+ import type { ComponentConfig } from '@puckeditor/core';
2
+ import type { EmailImageProps } from './EmailImage.types.js';
3
+ export declare const EmailImageEditorConfig: ComponentConfig<EmailImageProps>;
@@ -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,3 @@
1
+ import type { ComponentConfig } from '@puckeditor/core';
2
+ import type { EmailImageProps } from './EmailImage.types.js';
3
+ export declare const EmailImageConfig: ComponentConfig<EmailImageProps>;
@@ -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,9 @@
1
+ import type { MediaReference } from '../../../fields/MediaField.js';
2
+ export interface EmailImageProps {
3
+ image: MediaReference | null;
4
+ alt: string;
5
+ width: number;
6
+ height: number | null;
7
+ alignment: 'left' | 'center' | 'right';
8
+ link: string;
9
+ }
@@ -0,0 +1 @@
1
+ export { };
@@ -0,0 +1,2 @@
1
+ import type { ComponentConfig } from '@puckeditor/core';
2
+ export declare const EmailSectionEditorConfig: ComponentConfig;
@@ -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,2 @@
1
+ import type { ComponentConfig } from '@puckeditor/core';
2
+ export declare const EmailSectionConfig: ComponentConfig;
@@ -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,7 @@
1
+ import type { ColorValue, PaddingValue } from '../../../fields/shared.js';
2
+ export interface EmailSectionProps {
3
+ content: unknown;
4
+ backgroundColor: ColorValue | null;
5
+ padding: PaddingValue | null;
6
+ maxWidth: number;
7
+ }
@@ -0,0 +1,3 @@
1
+ import type { ComponentConfig } from '@puckeditor/core';
2
+ import type { EmailSocialProps } from './EmailSocial.types.js';
3
+ export declare const EmailSocialEditorConfig: ComponentConfig<EmailSocialProps>;
@@ -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,3 @@
1
+ import type { ComponentConfig } from '@puckeditor/core';
2
+ import type { EmailSocialProps } from './EmailSocial.types.js';
3
+ export declare const EmailSocialConfig: ComponentConfig<EmailSocialProps>;
@@ -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,3 @@
1
+ import type { ComponentConfig } from '@puckeditor/core';
2
+ import type { EmailSpacerProps } from './EmailSpacer.types.js';
3
+ export declare const EmailSpacerEditorConfig: ComponentConfig<EmailSpacerProps>;
@@ -0,0 +1,12 @@
1
+ import { EmailSpacerConfig } from './EmailSpacer.server.js';
2
+ export const EmailSpacerEditorConfig = {
3
+ ...EmailSpacerConfig,
4
+ fields: {
5
+ height: {
6
+ type: 'number',
7
+ label: 'Height (px)',
8
+ min: 1,
9
+ max: 200
10
+ }
11
+ }
12
+ };
@@ -0,0 +1,3 @@
1
+ import type { ComponentConfig } from '@puckeditor/core';
2
+ import type { EmailSpacerProps } from './EmailSpacer.types.js';
3
+ export declare const EmailSpacerConfig: ComponentConfig<EmailSpacerProps>;
@@ -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,3 @@
1
+ export interface EmailSpacerProps {
2
+ height: number;
3
+ }
@@ -0,0 +1,3 @@
1
+ import type { ComponentConfig } from '@puckeditor/core';
2
+ import type { EmailTextProps } from './EmailText.types.js';
3
+ export declare const EmailTextEditorConfig: ComponentConfig<EmailTextProps>;