@unlayer/types 1.386.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.
- package/dist/containers/body.d.ts +162 -0
- package/dist/containers/column.d.ts +85 -0
- package/dist/containers/content.d.ts +62 -0
- package/dist/containers/footer.d.ts +79 -0
- package/dist/containers/header.d.ts +79 -0
- package/dist/containers/index.d.ts +6 -0
- package/dist/containers/row.d.ts +100 -0
- package/dist/design.d.ts +102 -0
- package/dist/editor/audit.d.ts +31 -0
- package/dist/editor/config.d.ts +41 -0
- package/dist/editor/design.d.ts +16 -0
- package/dist/editor/display-conditions.d.ts +5 -0
- package/dist/editor/editor.d.ts +467 -0
- package/dist/editor/export.d.ts +104 -0
- package/dist/editor/features.d.ts +122 -0
- package/dist/editor/font.d.ts +24 -0
- package/dist/editor/index.d.ts +15 -0
- package/dist/editor/intl.d.ts +16 -0
- package/dist/editor/link-types.d.ts +72 -0
- package/dist/editor/merge-tags.d.ts +28 -0
- package/dist/editor/style-guide.d.ts +20 -0
- package/dist/editor/theme.d.ts +775 -0
- package/dist/editor/types.d.ts +23 -0
- package/dist/editor/utils.d.ts +88 -0
- package/dist/index.d.ts +3 -0
- package/dist/tools/button.d.ts +111 -0
- package/dist/tools/carousel.d.ts +52 -0
- package/dist/tools/divider.d.ts +54 -0
- package/dist/tools/form.d.ts +159 -0
- package/dist/tools/heading.d.ts +79 -0
- package/dist/tools/html.d.ts +48 -0
- package/dist/tools/image.d.ts +75 -0
- package/dist/tools/index.d.ts +17 -0
- package/dist/tools/menu.d.ts +91 -0
- package/dist/tools/page-break.d.ts +57 -0
- package/dist/tools/paragraph.d.ts +76 -0
- package/dist/tools/social.d.ts +58 -0
- package/dist/tools/table.d.ts +178 -0
- package/dist/tools/text.d.ts +76 -0
- package/dist/tools/timer.d.ts +87 -0
- package/dist/tools/video.d.ts +72 -0
- package/package.json +44 -0
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
// Auto-generated by build-values-types.js. Do not edit manually.
|
|
2
|
+
|
|
3
|
+
import type { DisplayMode, ExporterName } from '../editor/types';
|
|
4
|
+
|
|
5
|
+
type BodyValuesBase = {
|
|
6
|
+
_styleGuide: string;
|
|
7
|
+
contentWidth: number | `${number}px` | `${number}%` | "auto";
|
|
8
|
+
fontFamily: {
|
|
9
|
+
label: string;
|
|
10
|
+
value: string;
|
|
11
|
+
defaultFont?: boolean;
|
|
12
|
+
type?: string;
|
|
13
|
+
url?: string;
|
|
14
|
+
weights?: (number | {
|
|
15
|
+
value: number;
|
|
16
|
+
label?: string;
|
|
17
|
+
})[];
|
|
18
|
+
};
|
|
19
|
+
textColor: string;
|
|
20
|
+
language: any;
|
|
21
|
+
linkStyle: {
|
|
22
|
+
body?: boolean;
|
|
23
|
+
inherit?: boolean;
|
|
24
|
+
linkColor?: string;
|
|
25
|
+
linkHoverColor?: string;
|
|
26
|
+
linkUnderline?: boolean;
|
|
27
|
+
linkHoverUnderline?: boolean;
|
|
28
|
+
};
|
|
29
|
+
_meta: {
|
|
30
|
+
htmlID?: string;
|
|
31
|
+
htmlClassNames?: string;
|
|
32
|
+
labels?: string[];
|
|
33
|
+
description?: string;
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
type BodyValuesForEmail = BodyValuesBase & {
|
|
38
|
+
backgroundColor: string;
|
|
39
|
+
contentAlign: "left" | "center" | "right" | "justify";
|
|
40
|
+
fontWeight: number | {
|
|
41
|
+
value: number;
|
|
42
|
+
label?: string;
|
|
43
|
+
};
|
|
44
|
+
preheaderText: string | number;
|
|
45
|
+
accessibilityTitle: string | number;
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
type BodyValuesForWeb = BodyValuesBase & {
|
|
49
|
+
backgroundColor: string;
|
|
50
|
+
contentAlign: "left" | "center" | "right" | "justify";
|
|
51
|
+
fontWeight: number | {
|
|
52
|
+
value: number;
|
|
53
|
+
label?: string;
|
|
54
|
+
};
|
|
55
|
+
backgroundImage: {
|
|
56
|
+
[x: string]: unknown;
|
|
57
|
+
url: string;
|
|
58
|
+
width?: number;
|
|
59
|
+
height?: number;
|
|
60
|
+
fullWidth?: boolean;
|
|
61
|
+
size?: "custom" | "contain" | "cover";
|
|
62
|
+
customSize?: [string?, string?, ...unknown[]];
|
|
63
|
+
repeat?: "repeat" | "no-repeat" | "repeat-x" | "repeat-y";
|
|
64
|
+
position?: "custom" | "center" | "top-left" | "top-center" | "top-right" | "center-left" | "center-right" | "bottom-left" | "bottom-center" | "bottom-right";
|
|
65
|
+
customPosition?: [string?, string?, ...unknown[]];
|
|
66
|
+
};
|
|
67
|
+
accessibilityTitle: string | number;
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
type BodyValuesForPopup = BodyValuesBase & {
|
|
71
|
+
popupPosition: "custom" | "center" | "top-left" | "top-center" | "top-right" | "center-left" | "center-right" | "bottom-left" | "bottom-center" | "bottom-right";
|
|
72
|
+
popupDisplayDelay: number | `${number}px` | `${number}%` | "auto";
|
|
73
|
+
popupWidth: number | `${number}px` | `${number}%` | "auto";
|
|
74
|
+
popupHeight: number | `${number}px` | `${number}%` | "auto";
|
|
75
|
+
borderRadius: `${number}px` | `${number}px ${number}px` | `${number}px ${number}px ${number}px` | `${number}px ${number}px ${number}px ${number}px`;
|
|
76
|
+
contentAlign: "left" | "center" | "right";
|
|
77
|
+
contentVerticalAlign: "top" | "middle" | "bottom";
|
|
78
|
+
fontWeight: number | {
|
|
79
|
+
value: number;
|
|
80
|
+
label?: string;
|
|
81
|
+
};
|
|
82
|
+
popupBackgroundColor: string;
|
|
83
|
+
popupBackgroundImage: {
|
|
84
|
+
[x: string]: unknown;
|
|
85
|
+
url: string;
|
|
86
|
+
width?: number;
|
|
87
|
+
height?: number;
|
|
88
|
+
fullWidth?: boolean;
|
|
89
|
+
size?: "custom" | "contain" | "cover";
|
|
90
|
+
customSize?: [string?, string?, ...unknown[]];
|
|
91
|
+
repeat?: "repeat" | "no-repeat" | "repeat-x" | "repeat-y";
|
|
92
|
+
position?: "custom" | "center" | "top-left" | "top-center" | "top-right" | "center-left" | "center-right" | "bottom-left" | "bottom-center" | "bottom-right";
|
|
93
|
+
customPosition?: [string?, string?, ...unknown[]];
|
|
94
|
+
};
|
|
95
|
+
popupOverlay_backgroundColor: string;
|
|
96
|
+
popupCloseButton_position: "custom" | "center" | "top-left" | "top-center" | "top-right" | "center-left" | "center-right" | "bottom-left" | "bottom-center" | "bottom-right";
|
|
97
|
+
popupCloseButton_backgroundColor: string;
|
|
98
|
+
popupCloseButton_iconColor: string;
|
|
99
|
+
popupCloseButton_borderRadius: `${number}px` | `${number}px ${number}px` | `${number}px ${number}px ${number}px` | `${number}px ${number}px ${number}px ${number}px`;
|
|
100
|
+
popupCloseButton_margin: `${number}px` | `${number}px ${number}px` | `${number}px ${number}px ${number}px` | `${number}px ${number}px ${number}px ${number}px`;
|
|
101
|
+
popupCloseButton_action: {
|
|
102
|
+
name: string;
|
|
103
|
+
attrs?: {
|
|
104
|
+
[x: string]: unknown;
|
|
105
|
+
href?: string;
|
|
106
|
+
target?: string;
|
|
107
|
+
onClick?: unknown;
|
|
108
|
+
class?: string;
|
|
109
|
+
download?: boolean;
|
|
110
|
+
};
|
|
111
|
+
values?: Record<string, string | number | {
|
|
112
|
+
label?: string;
|
|
113
|
+
value?: string | number;
|
|
114
|
+
}[]>;
|
|
115
|
+
};
|
|
116
|
+
};
|
|
117
|
+
|
|
118
|
+
type BodyValuesForDocument = BodyValuesBase & {
|
|
119
|
+
backgroundColor: string;
|
|
120
|
+
contentAlign: "left" | "center" | "right" | "justify";
|
|
121
|
+
backgroundImage: {
|
|
122
|
+
[x: string]: unknown;
|
|
123
|
+
url: string;
|
|
124
|
+
width?: number;
|
|
125
|
+
height?: number;
|
|
126
|
+
fullWidth?: boolean;
|
|
127
|
+
size?: "custom" | "contain" | "cover";
|
|
128
|
+
customSize?: [string?, string?, ...unknown[]];
|
|
129
|
+
repeat?: "repeat" | "no-repeat" | "repeat-x" | "repeat-y";
|
|
130
|
+
position?: "custom" | "center" | "top-left" | "top-center" | "top-right" | "center-left" | "center-right" | "bottom-left" | "bottom-center" | "bottom-right";
|
|
131
|
+
customPosition?: [string?, string?, ...unknown[]];
|
|
132
|
+
};
|
|
133
|
+
};
|
|
134
|
+
|
|
135
|
+
export type BodyValues<
|
|
136
|
+
TDisplayMode extends DisplayMode | undefined = undefined,
|
|
137
|
+
> =
|
|
138
|
+
TDisplayMode extends undefined
|
|
139
|
+
? BodyValuesForEmail & BodyValuesForWeb & BodyValuesForPopup & BodyValuesForDocument
|
|
140
|
+
: TDisplayMode extends 'email'
|
|
141
|
+
? BodyValuesForEmail
|
|
142
|
+
: TDisplayMode extends 'web'
|
|
143
|
+
? BodyValuesForWeb
|
|
144
|
+
: TDisplayMode extends 'popup'
|
|
145
|
+
? BodyValuesForPopup
|
|
146
|
+
: TDisplayMode extends 'document'
|
|
147
|
+
? BodyValuesForDocument
|
|
148
|
+
: never;
|
|
149
|
+
|
|
150
|
+
import type { Variant } from '../editor/types';
|
|
151
|
+
|
|
152
|
+
type BodyExporter = (
|
|
153
|
+
innerHTML: string,
|
|
154
|
+
bodyValues: Record<string, any>, // @deprecated use last param instead
|
|
155
|
+
meta: {
|
|
156
|
+
bodyValues: BodyValues;
|
|
157
|
+
type: string;
|
|
158
|
+
variant: Variant;
|
|
159
|
+
},
|
|
160
|
+
) => string;
|
|
161
|
+
|
|
162
|
+
export type BodyExporters = Partial<Record<ExporterName, BodyExporter>>;
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
// Auto-generated by build-values-types.js. Do not edit manually.
|
|
2
|
+
|
|
3
|
+
import type { DisplayMode, ExporterName } from '../editor/types';
|
|
4
|
+
|
|
5
|
+
type ColumnValuesBase = {
|
|
6
|
+
border: {
|
|
7
|
+
borderBottomColor?: string;
|
|
8
|
+
borderBottomStyle?: string;
|
|
9
|
+
borderBottomWidth?: `${number}px`;
|
|
10
|
+
borderLeftColor?: string;
|
|
11
|
+
borderLeftStyle?: string;
|
|
12
|
+
borderLeftWidth?: `${number}px`;
|
|
13
|
+
borderRightColor?: string;
|
|
14
|
+
borderRightStyle?: string;
|
|
15
|
+
borderRightWidth?: `${number}px`;
|
|
16
|
+
borderTopColor?: string;
|
|
17
|
+
borderTopStyle?: string;
|
|
18
|
+
borderTopWidth?: `${number}px`;
|
|
19
|
+
};
|
|
20
|
+
backgroundColor: string;
|
|
21
|
+
padding: `${number}px` | `${number}px ${number}px` | `${number}px ${number}px ${number}px` | `${number}px ${number}px ${number}px ${number}px`;
|
|
22
|
+
_meta: {
|
|
23
|
+
htmlID?: string;
|
|
24
|
+
htmlClassNames?: string;
|
|
25
|
+
labels?: string[];
|
|
26
|
+
description?: string;
|
|
27
|
+
};
|
|
28
|
+
deletable: boolean;
|
|
29
|
+
locked: boolean;
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
type ColumnValuesForEmail = ColumnValuesBase;
|
|
33
|
+
|
|
34
|
+
type ColumnValuesForWeb = ColumnValuesBase & {
|
|
35
|
+
borderRadius: `${number}px` | `${number}px ${number}px` | `${number}px ${number}px ${number}px` | `${number}px ${number}px ${number}px ${number}px`;
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
type ColumnValuesForPopup = ColumnValuesBase & {
|
|
39
|
+
borderRadius: `${number}px` | `${number}px ${number}px` | `${number}px ${number}px ${number}px` | `${number}px ${number}px ${number}px ${number}px`;
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
type ColumnValuesForDocument = ColumnValuesBase & {
|
|
43
|
+
borderRadius: `${number}px` | `${number}px ${number}px` | `${number}px ${number}px ${number}px` | `${number}px ${number}px ${number}px ${number}px`;
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
export type ColumnValues<
|
|
47
|
+
TDisplayMode extends DisplayMode | undefined = undefined,
|
|
48
|
+
> =
|
|
49
|
+
TDisplayMode extends undefined
|
|
50
|
+
? ColumnValuesForEmail & ColumnValuesForWeb & ColumnValuesForPopup & ColumnValuesForDocument
|
|
51
|
+
: TDisplayMode extends 'email'
|
|
52
|
+
? ColumnValuesForEmail
|
|
53
|
+
: TDisplayMode extends 'web'
|
|
54
|
+
? ColumnValuesForWeb
|
|
55
|
+
: TDisplayMode extends 'popup'
|
|
56
|
+
? ColumnValuesForPopup
|
|
57
|
+
: TDisplayMode extends 'document'
|
|
58
|
+
? ColumnValuesForDocument
|
|
59
|
+
: never;
|
|
60
|
+
|
|
61
|
+
import type { BodyValues } from '../containers/body';
|
|
62
|
+
import type { RowValues } from '../containers/row';
|
|
63
|
+
import type { Variant } from '../editor/types';
|
|
64
|
+
|
|
65
|
+
type ColumnExporter = (
|
|
66
|
+
innerHTML: string,
|
|
67
|
+
columnValues: Record<string, any>, // @deprecated use last param instead
|
|
68
|
+
columnIndex: number, // @deprecated use last param instead
|
|
69
|
+
rowCells: number[], // @deprecated use last param instead
|
|
70
|
+
bodyValues: BodyValues, // @deprecated use last param instead
|
|
71
|
+
rowValues: RowValues, // @deprecated use last param instead
|
|
72
|
+
meta: {
|
|
73
|
+
columnIndex: number;
|
|
74
|
+
columnValues: ColumnValues;
|
|
75
|
+
rowIndex: number;
|
|
76
|
+
rowCells: number[];
|
|
77
|
+
rowValues: RowValues;
|
|
78
|
+
bodyValues: BodyValues;
|
|
79
|
+
|
|
80
|
+
variant: Variant;
|
|
81
|
+
language: string;
|
|
82
|
+
},
|
|
83
|
+
) => string;
|
|
84
|
+
|
|
85
|
+
export type ColumnExporters = Partial<Record<ExporterName, ColumnExporter>>;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
// Auto-generated by build-values-types.js. Do not edit manually.
|
|
2
|
+
|
|
3
|
+
import type { DisplayMode, ExporterName } from '../editor/types';
|
|
4
|
+
|
|
5
|
+
export type ContentValues<
|
|
6
|
+
TDisplayMode extends DisplayMode | undefined = undefined,
|
|
7
|
+
> = {
|
|
8
|
+
displayCondition: {
|
|
9
|
+
label: string;
|
|
10
|
+
description: string;
|
|
11
|
+
type: string;
|
|
12
|
+
before?: string;
|
|
13
|
+
after?: string;
|
|
14
|
+
};
|
|
15
|
+
_styleGuide: string;
|
|
16
|
+
anchor: string;
|
|
17
|
+
containerPadding: `${number}px` | `${number}px ${number}px` | `${number}px ${number}px ${number}px` | `${number}px ${number}px ${number}px ${number}px`;
|
|
18
|
+
_meta: {
|
|
19
|
+
htmlID?: string;
|
|
20
|
+
htmlClassNames?: string;
|
|
21
|
+
labels?: string[];
|
|
22
|
+
description?: string;
|
|
23
|
+
};
|
|
24
|
+
deletable: boolean;
|
|
25
|
+
locked: boolean;
|
|
26
|
+
selectable: boolean;
|
|
27
|
+
draggable: boolean;
|
|
28
|
+
duplicatable: boolean;
|
|
29
|
+
hideable: boolean;
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
import type { BodyValues } from '../containers/body';
|
|
33
|
+
import type { ColumnValues } from '../containers/column';
|
|
34
|
+
import type { RowValues } from '../containers/row';
|
|
35
|
+
import type { MergeTagsValues } from '../editor/merge-tags';
|
|
36
|
+
import type { Variant } from '../editor/types';
|
|
37
|
+
|
|
38
|
+
type ContentExporter = (
|
|
39
|
+
innerHTML: string,
|
|
40
|
+
contentValues: Record<string, any>, // @deprecated use last param instead
|
|
41
|
+
bodyValues: BodyValues, // @deprecated use last param instead
|
|
42
|
+
meta: {
|
|
43
|
+
index: number;
|
|
44
|
+
columnIndex: number;
|
|
45
|
+
columnValues: ColumnValues;
|
|
46
|
+
rowIndex: number;
|
|
47
|
+
rowCells: number[];
|
|
48
|
+
rowValues: RowValues;
|
|
49
|
+
bodyValues: BodyValues;
|
|
50
|
+
|
|
51
|
+
variant: Variant | undefined;
|
|
52
|
+
language: string | undefined;
|
|
53
|
+
embeddedValues: Record<string, unknown>;
|
|
54
|
+
mergeTagState: {
|
|
55
|
+
mergeTagGroup: string;
|
|
56
|
+
mergeTagRule: string;
|
|
57
|
+
mergeTags: MergeTagsValues;
|
|
58
|
+
};
|
|
59
|
+
},
|
|
60
|
+
) => string;
|
|
61
|
+
|
|
62
|
+
export type ContentExporters = Partial<Record<ExporterName, ContentExporter>>;
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
// Auto-generated by build-values-types.js. Do not edit manually.
|
|
2
|
+
|
|
3
|
+
import type { DisplayMode } from '../editor/types';
|
|
4
|
+
|
|
5
|
+
type FooterValuesBase = {
|
|
6
|
+
[x: string]: unknown;
|
|
7
|
+
sync: {
|
|
8
|
+
id: string;
|
|
9
|
+
dirty: boolean;
|
|
10
|
+
updatedAt?: string;
|
|
11
|
+
};
|
|
12
|
+
displayCondition: {
|
|
13
|
+
label: string;
|
|
14
|
+
description: string;
|
|
15
|
+
type: string;
|
|
16
|
+
before?: string;
|
|
17
|
+
after?: string;
|
|
18
|
+
};
|
|
19
|
+
columns: any;
|
|
20
|
+
_styleGuide: string;
|
|
21
|
+
anchor: string;
|
|
22
|
+
backgroundColor: string;
|
|
23
|
+
padding: `${number}px` | `${number}px ${number}px` | `${number}px ${number}px ${number}px` | `${number}px ${number}px ${number}px ${number}px`;
|
|
24
|
+
backgroundImage: {
|
|
25
|
+
[x: string]: unknown;
|
|
26
|
+
url: string;
|
|
27
|
+
width?: number;
|
|
28
|
+
height?: number;
|
|
29
|
+
fullWidth?: boolean;
|
|
30
|
+
size?: "custom" | "contain" | "cover";
|
|
31
|
+
customSize?: [string?, string?, ...unknown[]];
|
|
32
|
+
repeat?: "repeat" | "no-repeat" | "repeat-x" | "repeat-y";
|
|
33
|
+
position?: "custom" | "center" | "top-left" | "top-center" | "top-right" | "center-left" | "center-right" | "bottom-left" | "bottom-center" | "bottom-right";
|
|
34
|
+
customPosition?: [string?, string?, ...unknown[]];
|
|
35
|
+
};
|
|
36
|
+
columnsBackgroundColor: string;
|
|
37
|
+
noStackMobile: boolean;
|
|
38
|
+
_meta: {
|
|
39
|
+
htmlID?: string;
|
|
40
|
+
htmlClassNames?: string;
|
|
41
|
+
labels?: string[];
|
|
42
|
+
description?: string;
|
|
43
|
+
};
|
|
44
|
+
deletable: boolean;
|
|
45
|
+
locked: boolean;
|
|
46
|
+
selectable: boolean;
|
|
47
|
+
draggable: boolean;
|
|
48
|
+
duplicatable: boolean;
|
|
49
|
+
hideable: boolean;
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
type FooterValuesForEmail = FooterValuesBase;
|
|
53
|
+
|
|
54
|
+
type FooterValuesForWeb = FooterValuesBase & {
|
|
55
|
+
alignItems: "center" | "flex-start" | "flex-end";
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
type FooterValuesForPopup = FooterValuesBase & {
|
|
59
|
+
alignItems: "center" | "flex-start" | "flex-end";
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
type FooterValuesForDocument = FooterValuesBase & {
|
|
63
|
+
alignItems: "center" | "flex-start" | "flex-end";
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
export type FooterValues<
|
|
67
|
+
TDisplayMode extends DisplayMode | undefined = undefined,
|
|
68
|
+
> =
|
|
69
|
+
TDisplayMode extends undefined
|
|
70
|
+
? FooterValuesForEmail & FooterValuesForWeb & FooterValuesForPopup & FooterValuesForDocument
|
|
71
|
+
: TDisplayMode extends 'email'
|
|
72
|
+
? FooterValuesForEmail
|
|
73
|
+
: TDisplayMode extends 'web'
|
|
74
|
+
? FooterValuesForWeb
|
|
75
|
+
: TDisplayMode extends 'popup'
|
|
76
|
+
? FooterValuesForPopup
|
|
77
|
+
: TDisplayMode extends 'document'
|
|
78
|
+
? FooterValuesForDocument
|
|
79
|
+
: never;
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
// Auto-generated by build-values-types.js. Do not edit manually.
|
|
2
|
+
|
|
3
|
+
import type { DisplayMode } from '../editor/types';
|
|
4
|
+
|
|
5
|
+
type HeaderValuesBase = {
|
|
6
|
+
[x: string]: unknown;
|
|
7
|
+
sync: {
|
|
8
|
+
id: string;
|
|
9
|
+
dirty: boolean;
|
|
10
|
+
updatedAt?: string;
|
|
11
|
+
};
|
|
12
|
+
displayCondition: {
|
|
13
|
+
label: string;
|
|
14
|
+
description: string;
|
|
15
|
+
type: string;
|
|
16
|
+
before?: string;
|
|
17
|
+
after?: string;
|
|
18
|
+
};
|
|
19
|
+
columns: any;
|
|
20
|
+
_styleGuide: string;
|
|
21
|
+
anchor: string;
|
|
22
|
+
backgroundColor: string;
|
|
23
|
+
padding: `${number}px` | `${number}px ${number}px` | `${number}px ${number}px ${number}px` | `${number}px ${number}px ${number}px ${number}px`;
|
|
24
|
+
backgroundImage: {
|
|
25
|
+
[x: string]: unknown;
|
|
26
|
+
url: string;
|
|
27
|
+
width?: number;
|
|
28
|
+
height?: number;
|
|
29
|
+
fullWidth?: boolean;
|
|
30
|
+
size?: "custom" | "contain" | "cover";
|
|
31
|
+
customSize?: [string?, string?, ...unknown[]];
|
|
32
|
+
repeat?: "repeat" | "no-repeat" | "repeat-x" | "repeat-y";
|
|
33
|
+
position?: "custom" | "center" | "top-left" | "top-center" | "top-right" | "center-left" | "center-right" | "bottom-left" | "bottom-center" | "bottom-right";
|
|
34
|
+
customPosition?: [string?, string?, ...unknown[]];
|
|
35
|
+
};
|
|
36
|
+
columnsBackgroundColor: string;
|
|
37
|
+
noStackMobile: boolean;
|
|
38
|
+
_meta: {
|
|
39
|
+
htmlID?: string;
|
|
40
|
+
htmlClassNames?: string;
|
|
41
|
+
labels?: string[];
|
|
42
|
+
description?: string;
|
|
43
|
+
};
|
|
44
|
+
deletable: boolean;
|
|
45
|
+
locked: boolean;
|
|
46
|
+
selectable: boolean;
|
|
47
|
+
draggable: boolean;
|
|
48
|
+
duplicatable: boolean;
|
|
49
|
+
hideable: boolean;
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
type HeaderValuesForEmail = HeaderValuesBase;
|
|
53
|
+
|
|
54
|
+
type HeaderValuesForWeb = HeaderValuesBase & {
|
|
55
|
+
alignItems: "center" | "flex-start" | "flex-end";
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
type HeaderValuesForPopup = HeaderValuesBase & {
|
|
59
|
+
alignItems: "center" | "flex-start" | "flex-end";
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
type HeaderValuesForDocument = HeaderValuesBase & {
|
|
63
|
+
alignItems: "center" | "flex-start" | "flex-end";
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
export type HeaderValues<
|
|
67
|
+
TDisplayMode extends DisplayMode | undefined = undefined,
|
|
68
|
+
> =
|
|
69
|
+
TDisplayMode extends undefined
|
|
70
|
+
? HeaderValuesForEmail & HeaderValuesForWeb & HeaderValuesForPopup & HeaderValuesForDocument
|
|
71
|
+
: TDisplayMode extends 'email'
|
|
72
|
+
? HeaderValuesForEmail
|
|
73
|
+
: TDisplayMode extends 'web'
|
|
74
|
+
? HeaderValuesForWeb
|
|
75
|
+
: TDisplayMode extends 'popup'
|
|
76
|
+
? HeaderValuesForPopup
|
|
77
|
+
: TDisplayMode extends 'document'
|
|
78
|
+
? HeaderValuesForDocument
|
|
79
|
+
: never;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export type { BodyValues, BodyExporters } from './body';
|
|
2
|
+
export type { ColumnValues, ColumnExporters } from './column';
|
|
3
|
+
export type { ContentValues, ContentExporters } from './content';
|
|
4
|
+
export type { FooterValues } from './footer';
|
|
5
|
+
export type { HeaderValues } from './header';
|
|
6
|
+
export type { RowValues, RowExporters } from './row';
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
// Auto-generated by build-values-types.js. Do not edit manually.
|
|
2
|
+
|
|
3
|
+
import type { DisplayMode, ExporterName } from '../editor/types';
|
|
4
|
+
|
|
5
|
+
type RowValuesBase = {
|
|
6
|
+
[x: string]: unknown;
|
|
7
|
+
sync: {
|
|
8
|
+
id: string;
|
|
9
|
+
dirty: boolean;
|
|
10
|
+
updatedAt?: string;
|
|
11
|
+
};
|
|
12
|
+
displayCondition: {
|
|
13
|
+
label: string;
|
|
14
|
+
description: string;
|
|
15
|
+
type: string;
|
|
16
|
+
before?: string;
|
|
17
|
+
after?: string;
|
|
18
|
+
};
|
|
19
|
+
columns: any;
|
|
20
|
+
_styleGuide: string;
|
|
21
|
+
anchor: string;
|
|
22
|
+
backgroundColor: string;
|
|
23
|
+
padding: `${number}px` | `${number}px ${number}px` | `${number}px ${number}px ${number}px` | `${number}px ${number}px ${number}px ${number}px`;
|
|
24
|
+
backgroundImage: {
|
|
25
|
+
[x: string]: unknown;
|
|
26
|
+
url: string;
|
|
27
|
+
width?: number;
|
|
28
|
+
height?: number;
|
|
29
|
+
fullWidth?: boolean;
|
|
30
|
+
size?: "custom" | "contain" | "cover";
|
|
31
|
+
customSize?: [string?, string?, ...unknown[]];
|
|
32
|
+
repeat?: "repeat" | "no-repeat" | "repeat-x" | "repeat-y";
|
|
33
|
+
position?: "custom" | "center" | "top-left" | "top-center" | "top-right" | "center-left" | "center-right" | "bottom-left" | "bottom-center" | "bottom-right";
|
|
34
|
+
customPosition?: [string?, string?, ...unknown[]];
|
|
35
|
+
};
|
|
36
|
+
columnsBackgroundColor: string;
|
|
37
|
+
noStackMobile: boolean;
|
|
38
|
+
_meta: {
|
|
39
|
+
htmlID?: string;
|
|
40
|
+
htmlClassNames?: string;
|
|
41
|
+
labels?: string[];
|
|
42
|
+
description?: string;
|
|
43
|
+
};
|
|
44
|
+
deletable: boolean;
|
|
45
|
+
locked: boolean;
|
|
46
|
+
selectable: boolean;
|
|
47
|
+
draggable: boolean;
|
|
48
|
+
duplicatable: boolean;
|
|
49
|
+
hideable: boolean;
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
type RowValuesForEmail = RowValuesBase;
|
|
53
|
+
|
|
54
|
+
type RowValuesForWeb = RowValuesBase & {
|
|
55
|
+
alignItems: "center" | "flex-start" | "flex-end";
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
type RowValuesForPopup = RowValuesBase & {
|
|
59
|
+
alignItems: "center" | "flex-start" | "flex-end";
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
type RowValuesForDocument = RowValuesBase & {
|
|
63
|
+
alignItems: "center" | "flex-start" | "flex-end";
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
export type RowValues<
|
|
67
|
+
TDisplayMode extends DisplayMode | undefined = undefined,
|
|
68
|
+
> =
|
|
69
|
+
TDisplayMode extends undefined
|
|
70
|
+
? RowValuesForEmail & RowValuesForWeb & RowValuesForPopup & RowValuesForDocument
|
|
71
|
+
: TDisplayMode extends 'email'
|
|
72
|
+
? RowValuesForEmail
|
|
73
|
+
: TDisplayMode extends 'web'
|
|
74
|
+
? RowValuesForWeb
|
|
75
|
+
: TDisplayMode extends 'popup'
|
|
76
|
+
? RowValuesForPopup
|
|
77
|
+
: TDisplayMode extends 'document'
|
|
78
|
+
? RowValuesForDocument
|
|
79
|
+
: never;
|
|
80
|
+
|
|
81
|
+
import type { BodyValues } from '../containers/body';
|
|
82
|
+
import type { Collection, Variant } from '../editor/types';
|
|
83
|
+
|
|
84
|
+
type RowExporter = (
|
|
85
|
+
innerHTML: string,
|
|
86
|
+
rowValues: RowValues, // @deprecated use last param instead
|
|
87
|
+
bodyValues: BodyValues, // @deprecated use last param instead
|
|
88
|
+
meta: {
|
|
89
|
+
rowIndex: number;
|
|
90
|
+
rowCells: number[];
|
|
91
|
+
rowValues: RowValues;
|
|
92
|
+
bodyValues: BodyValues;
|
|
93
|
+
|
|
94
|
+
variant: Variant | undefined;
|
|
95
|
+
language: string | undefined;
|
|
96
|
+
collection: Collection;
|
|
97
|
+
},
|
|
98
|
+
) => string;
|
|
99
|
+
|
|
100
|
+
export type RowExporters = Partial<Record<ExporterName, RowExporter>>;
|
package/dist/design.d.ts
ADDED
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
// Auto-generated by build-values-types.js. Do not edit manually.
|
|
2
|
+
|
|
3
|
+
import type { BodyValues } from './containers/body';
|
|
4
|
+
import type { ColumnValues } from './containers/column';
|
|
5
|
+
import type { ContentValues } from './containers/content';
|
|
6
|
+
import type { RowValues } from './containers/row';
|
|
7
|
+
import type { ButtonValues } from './tools/button';
|
|
8
|
+
import type { CarouselValues } from './tools/carousel';
|
|
9
|
+
import type { DividerValues } from './tools/divider';
|
|
10
|
+
import type { FormValues } from './tools/form';
|
|
11
|
+
import type { HeadingValues } from './tools/heading';
|
|
12
|
+
import type { HtmlValues } from './tools/html';
|
|
13
|
+
import type { ImageValues } from './tools/image';
|
|
14
|
+
import type { MenuValues } from './tools/menu';
|
|
15
|
+
import type { PageBreakValues } from './tools/page-break';
|
|
16
|
+
import type { ParagraphValues } from './tools/paragraph';
|
|
17
|
+
import type { SocialValues } from './tools/social';
|
|
18
|
+
import type { TableValues } from './tools/table';
|
|
19
|
+
import type { TextValues } from './tools/text';
|
|
20
|
+
import type { TimerValues } from './tools/timer';
|
|
21
|
+
import type { VideoValues } from './tools/video';
|
|
22
|
+
|
|
23
|
+
interface ContentToolValuesMap<
|
|
24
|
+
TDisplayMode extends DisplayMode | undefined = undefined,
|
|
25
|
+
> {
|
|
26
|
+
button: ButtonValues<TDisplayMode>;
|
|
27
|
+
carousel: CarouselValues<TDisplayMode>;
|
|
28
|
+
divider: DividerValues<TDisplayMode>;
|
|
29
|
+
form: FormValues<TDisplayMode>;
|
|
30
|
+
heading: HeadingValues<TDisplayMode>;
|
|
31
|
+
html: HtmlValues<TDisplayMode>;
|
|
32
|
+
image: ImageValues<TDisplayMode>;
|
|
33
|
+
menu: MenuValues<TDisplayMode>;
|
|
34
|
+
page_break: PageBreakValues<TDisplayMode>;
|
|
35
|
+
paragraph: ParagraphValues<TDisplayMode>;
|
|
36
|
+
social: SocialValues<TDisplayMode>;
|
|
37
|
+
table: TableValues<TDisplayMode>;
|
|
38
|
+
text: TextValues<TDisplayMode>;
|
|
39
|
+
timer: TimerValues<TDisplayMode>;
|
|
40
|
+
video: VideoValues<TDisplayMode>;
|
|
41
|
+
}
|
|
42
|
+
import type { DisplayMode } from './editor/types';
|
|
43
|
+
|
|
44
|
+
export type { DisplayMode };
|
|
45
|
+
|
|
46
|
+
type DesignContentItemOf<
|
|
47
|
+
TType extends string,
|
|
48
|
+
TValues,
|
|
49
|
+
TDisplayMode extends DisplayMode | undefined = undefined,
|
|
50
|
+
> = {
|
|
51
|
+
id?: string;
|
|
52
|
+
type: TType;
|
|
53
|
+
values: TValues & ContentValues<TDisplayMode>;
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
export type DesignContentType = keyof ContentToolValuesMap | (string & {});
|
|
57
|
+
|
|
58
|
+
export type DesignContentItem<
|
|
59
|
+
TDisplayMode extends DisplayMode | undefined = undefined,
|
|
60
|
+
> = {
|
|
61
|
+
[K in keyof ContentToolValuesMap<TDisplayMode>]: DesignContentItemOf<
|
|
62
|
+
K,
|
|
63
|
+
ContentToolValuesMap<TDisplayMode>[K],
|
|
64
|
+
TDisplayMode
|
|
65
|
+
>;
|
|
66
|
+
}[keyof ContentToolValuesMap<TDisplayMode>];
|
|
67
|
+
|
|
68
|
+
export type DesignColumn<
|
|
69
|
+
TDisplayMode extends DisplayMode | undefined = undefined,
|
|
70
|
+
> = {
|
|
71
|
+
id?: string;
|
|
72
|
+
contents: DesignContentItem<TDisplayMode>[];
|
|
73
|
+
values: ColumnValues<TDisplayMode>;
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
export type DesignRow<
|
|
77
|
+
TDisplayMode extends DisplayMode | undefined = undefined,
|
|
78
|
+
> = {
|
|
79
|
+
id?: string;
|
|
80
|
+
cells: number[];
|
|
81
|
+
columns: DesignColumn<TDisplayMode>[];
|
|
82
|
+
values: RowValues<TDisplayMode>;
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
export type DesignBody<
|
|
86
|
+
TDisplayMode extends DisplayMode | undefined = undefined,
|
|
87
|
+
> = {
|
|
88
|
+
id?: string;
|
|
89
|
+
rows: DesignRow<TDisplayMode>[];
|
|
90
|
+
values: BodyValues<TDisplayMode>;
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
export type JSONTemplate<
|
|
94
|
+
TDisplayMode extends DisplayMode | undefined = undefined,
|
|
95
|
+
> = {
|
|
96
|
+
counters: Record<string, number>;
|
|
97
|
+
body: DesignBody<TDisplayMode> & {
|
|
98
|
+
headers?: DesignRow<TDisplayMode>[];
|
|
99
|
+
footers?: DesignRow<TDisplayMode>[];
|
|
100
|
+
};
|
|
101
|
+
schemaVersion?: number;
|
|
102
|
+
};
|