@nice2dev/ui-tools 1.0.10
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/README.md +36 -0
- package/dist/access-control.d.ts +726 -0
- package/dist/access-control.d.ts.map +1 -0
- package/dist/accessibility-i18n.d.ts +1017 -0
- package/dist/accessibility-i18n.d.ts.map +1 -0
- package/dist/ai-assistant.d.ts +263 -0
- package/dist/ai-assistant.d.ts.map +1 -0
- package/dist/ai-playgrounds.d.ts +842 -0
- package/dist/ai-playgrounds.d.ts.map +1 -0
- package/dist/alerting-incidents.d.ts +558 -0
- package/dist/alerting-incidents.d.ts.map +1 -0
- package/dist/api-designer.d.ts +1568 -0
- package/dist/api-designer.d.ts.map +1 -0
- package/dist/api-testing.d.ts +1146 -0
- package/dist/api-testing.d.ts.map +1 -0
- package/dist/apm-profiling.d.ts +656 -0
- package/dist/apm-profiling.d.ts.map +1 -0
- package/dist/artifacts.d.ts +421 -0
- package/dist/artifacts.d.ts.map +1 -0
- package/dist/audit-compliance.d.ts +752 -0
- package/dist/audit-compliance.d.ts.map +1 -0
- package/dist/certificates.d.ts +256 -0
- package/dist/certificates.d.ts.map +1 -0
- package/dist/chart-builder.d.ts +1404 -0
- package/dist/chart-builder.d.ts.map +1 -0
- package/dist/cloud-instances.d.ts +169 -0
- package/dist/cloud-instances.d.ts.map +1 -0
- package/dist/config-management.d.ts +350 -0
- package/dist/config-management.d.ts.map +1 -0
- package/dist/containers.d.ts +256 -0
- package/dist/containers.d.ts.map +1 -0
- package/dist/dashboard-designer.d.ts +1238 -0
- package/dist/dashboard-designer.d.ts.map +1 -0
- package/dist/data-management.d.ts +496 -0
- package/dist/data-management.d.ts.map +1 -0
- package/dist/data-pipeline.d.ts +1105 -0
- package/dist/data-pipeline.d.ts.map +1 -0
- package/dist/data-warehouse.d.ts +1097 -0
- package/dist/data-warehouse.d.ts.map +1 -0
- package/dist/dataset-management.d.ts +782 -0
- package/dist/dataset-management.d.ts.map +1 -0
- package/dist/db-adapters.d.ts +704 -0
- package/dist/db-adapters.d.ts.map +1 -0
- package/dist/db-admin.d.ts +699 -0
- package/dist/db-admin.d.ts.map +1 -0
- package/dist/db-designer.d.ts +366 -0
- package/dist/db-designer.d.ts.map +1 -0
- package/dist/debugger.d.ts +356 -0
- package/dist/debugger.d.ts.map +1 -0
- package/dist/device-management.d.ts +871 -0
- package/dist/device-management.d.ts.map +1 -0
- package/dist/distributed-tracing.d.ts +427 -0
- package/dist/distributed-tracing.d.ts.map +1 -0
- package/dist/dns-management.d.ts +215 -0
- package/dist/dns-management.d.ts.map +1 -0
- package/dist/download-manager.d.ts +271 -0
- package/dist/download-manager.d.ts.map +1 -0
- package/dist/download-torrent.d.ts +1062 -0
- package/dist/download-torrent.d.ts.map +1 -0
- package/dist/edge-computing.d.ts +720 -0
- package/dist/edge-computing.d.ts.map +1 -0
- package/dist/education.d.ts +1135 -0
- package/dist/education.d.ts.map +1 -0
- package/dist/email-template.d.ts +1141 -0
- package/dist/email-template.d.ts.map +1 -0
- package/dist/erp-enterprise.d.ts +1270 -0
- package/dist/erp-enterprise.d.ts.map +1 -0
- package/dist/form-builder.d.ts +1117 -0
- package/dist/form-builder.d.ts.map +1 -0
- package/dist/game-engine-advanced.d.ts +1049 -0
- package/dist/game-engine-advanced.d.ts.map +1 -0
- package/dist/git.d.ts +415 -0
- package/dist/git.d.ts.map +1 -0
- package/dist/hardware-integration.d.ts +966 -0
- package/dist/hardware-integration.d.ts.map +1 -0
- package/dist/iac.d.ts +318 -0
- package/dist/iac.d.ts.map +1 -0
- package/dist/icon-tools.d.ts +1023 -0
- package/dist/icon-tools.d.ts.map +1 -0
- package/dist/ide.d.ts +322 -0
- package/dist/ide.d.ts.map +1 -0
- package/dist/index.cjs +2 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +176 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.mjs +1887 -0
- package/dist/index.mjs.map +1 -0
- package/dist/integration-platform.d.ts +857 -0
- package/dist/integration-platform.d.ts.map +1 -0
- package/dist/kubernetes.d.ts +278 -0
- package/dist/kubernetes.d.ts.map +1 -0
- package/dist/life-management.d.ts +1132 -0
- package/dist/life-management.d.ts.map +1 -0
- package/dist/log-management.d.ts +473 -0
- package/dist/log-management.d.ts.map +1 -0
- package/dist/mathematics.d.ts +870 -0
- package/dist/mathematics.d.ts.map +1 -0
- package/dist/message-queue.d.ts +1006 -0
- package/dist/message-queue.d.ts.map +1 -0
- package/dist/metrics-dashboard.d.ts +596 -0
- package/dist/metrics-dashboard.d.ts.map +1 -0
- package/dist/mobile-components.d.ts +766 -0
- package/dist/mobile-components.d.ts.map +1 -0
- package/dist/model-deployment.d.ts +787 -0
- package/dist/model-deployment.d.ts.map +1 -0
- package/dist/model-registry.d.ts +740 -0
- package/dist/model-registry.d.ts.map +1 -0
- package/dist/model-training.d.ts +706 -0
- package/dist/model-training.d.ts.map +1 -0
- package/dist/network-config.d.ts +334 -0
- package/dist/network-config.d.ts.map +1 -0
- package/dist/network-monitoring.d.ts +291 -0
- package/dist/network-monitoring.d.ts.map +1 -0
- package/dist/pdf-tools.d.ts +1003 -0
- package/dist/pdf-tools.d.ts.map +1 -0
- package/dist/pipelines.d.ts +250 -0
- package/dist/pipelines.d.ts.map +1 -0
- package/dist/remote-desktop.d.ts +207 -0
- package/dist/remote-desktop.d.ts.map +1 -0
- package/dist/report-designer.d.ts +1153 -0
- package/dist/report-designer.d.ts.map +1 -0
- package/dist/scada-industrial.d.ts +848 -0
- package/dist/scada-industrial.d.ts.map +1 -0
- package/dist/scientific-research.d.ts +1149 -0
- package/dist/scientific-research.d.ts.map +1 -0
- package/dist/secret-management.d.ts +617 -0
- package/dist/secret-management.d.ts.map +1 -0
- package/dist/security-scanning.d.ts +714 -0
- package/dist/security-scanning.d.ts.map +1 -0
- package/dist/self-service-analytics.d.ts +1208 -0
- package/dist/self-service-analytics.d.ts.map +1 -0
- package/dist/sensor-dashboard.d.ts +845 -0
- package/dist/sensor-dashboard.d.ts.map +1 -0
- package/dist/server-management.d.ts +331 -0
- package/dist/server-management.d.ts.map +1 -0
- package/dist/smart-home.d.ts +861 -0
- package/dist/smart-home.d.ts.map +1 -0
- package/dist/spreadsheet.d.ts +1043 -0
- package/dist/spreadsheet.d.ts.map +1 -0
- package/dist/sql-editor.d.ts +402 -0
- package/dist/sql-editor.d.ts.map +1 -0
- package/dist/terminal.d.ts +245 -0
- package/dist/terminal.d.ts.map +1 -0
- package/dist/testing-qa.d.ts +1013 -0
- package/dist/testing-qa.d.ts.map +1 -0
- package/dist/torrent-client.d.ts +298 -0
- package/dist/torrent-client.d.ts.map +1 -0
- package/dist/traceless.d.ts +759 -0
- package/dist/traceless.d.ts.map +1 -0
- package/dist/virtual-machines.d.ts +199 -0
- package/dist/virtual-machines.d.ts.map +1 -0
- package/dist/visual-scripting.d.ts +381 -0
- package/dist/visual-scripting.d.ts.map +1 -0
- package/dist/word-processor.d.ts +1124 -0
- package/dist/word-processor.d.ts.map +1 -0
- package/dist/workspace.d.ts +333 -0
- package/dist/workspace.d.ts.map +1 -0
- package/package.json +62 -0
|
@@ -0,0 +1,1141 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file email-template.ts
|
|
3
|
+
* @module @nice2dev/ui-tools
|
|
4
|
+
* @description PRO-14.6 — Email Template Editor
|
|
5
|
+
*
|
|
6
|
+
* Types for email template editor: MJML editor, drag-drop blocks, responsive preview,
|
|
7
|
+
* merge tags, template library, A/B variants, spam score, link tracking, accessibility.
|
|
8
|
+
*/
|
|
9
|
+
/** Email client */
|
|
10
|
+
export type EmailClient = 'gmail' | 'outlookcom' | 'outlook' | 'yahoo' | 'apple-mail' | 'thunderbird' | 'samsung' | 'aol' | 'protonmail' | 'zoho' | 'office365' | 'gmx';
|
|
11
|
+
/** Device preview */
|
|
12
|
+
export type DevicePreview = 'desktop' | 'tablet' | 'mobile';
|
|
13
|
+
/** Theme mode */
|
|
14
|
+
export type ThemeMode = 'light' | 'dark' | 'auto';
|
|
15
|
+
/** Email editor configuration */
|
|
16
|
+
export interface EmailEditorConfig {
|
|
17
|
+
/** Initial template */
|
|
18
|
+
template?: EmailTemplate;
|
|
19
|
+
/** Editor mode */
|
|
20
|
+
mode?: EmailEditorMode;
|
|
21
|
+
/** Theme */
|
|
22
|
+
theme?: EmailEditorTheme;
|
|
23
|
+
/** Locale */
|
|
24
|
+
locale?: string;
|
|
25
|
+
/** Enable MJML editing */
|
|
26
|
+
mjmlEditor?: boolean;
|
|
27
|
+
/** Enable HTML editing */
|
|
28
|
+
htmlEditor?: boolean;
|
|
29
|
+
/** Enable preview */
|
|
30
|
+
preview?: boolean;
|
|
31
|
+
/** Enable undo/redo */
|
|
32
|
+
undoRedo?: boolean;
|
|
33
|
+
/** Max undo steps */
|
|
34
|
+
maxUndoSteps?: number;
|
|
35
|
+
/** Enable collaboration */
|
|
36
|
+
collaboration?: boolean;
|
|
37
|
+
/** Enable comments */
|
|
38
|
+
comments?: boolean;
|
|
39
|
+
/** Enable version history */
|
|
40
|
+
versionHistory?: boolean;
|
|
41
|
+
/** Available blocks */
|
|
42
|
+
blocks?: EmailBlockDefinition[];
|
|
43
|
+
/** Custom blocks */
|
|
44
|
+
customBlocks?: CustomEmailBlock[];
|
|
45
|
+
/** Merge tags */
|
|
46
|
+
mergeTags?: MergeTagDefinition[];
|
|
47
|
+
/** Image upload handler */
|
|
48
|
+
imageUpload?: ImageUploadConfig;
|
|
49
|
+
/** Link validation */
|
|
50
|
+
linkValidation?: boolean;
|
|
51
|
+
/** Spam check */
|
|
52
|
+
spamCheck?: boolean;
|
|
53
|
+
/** Accessibility check */
|
|
54
|
+
accessibilityCheck?: boolean;
|
|
55
|
+
/** Toolbar configuration */
|
|
56
|
+
toolbar?: EmailToolbarConfig;
|
|
57
|
+
/** Sidebar configuration */
|
|
58
|
+
sidebar?: EmailSidebarConfig;
|
|
59
|
+
/** Brand assets */
|
|
60
|
+
brandAssets?: BrandAssets;
|
|
61
|
+
/** Template constraints */
|
|
62
|
+
constraints?: TemplateConstraints;
|
|
63
|
+
}
|
|
64
|
+
/** Editor mode */
|
|
65
|
+
export type EmailEditorMode = 'visual' | 'mjml' | 'html' | 'split';
|
|
66
|
+
/** Email editor theme */
|
|
67
|
+
export interface EmailEditorTheme {
|
|
68
|
+
name?: string;
|
|
69
|
+
primary?: string;
|
|
70
|
+
secondary?: string;
|
|
71
|
+
background?: string;
|
|
72
|
+
surface?: string;
|
|
73
|
+
text?: string;
|
|
74
|
+
border?: string;
|
|
75
|
+
canvas?: string;
|
|
76
|
+
selection?: string;
|
|
77
|
+
error?: string;
|
|
78
|
+
warning?: string;
|
|
79
|
+
success?: string;
|
|
80
|
+
}
|
|
81
|
+
/** Image upload configuration */
|
|
82
|
+
export interface ImageUploadConfig {
|
|
83
|
+
url?: string;
|
|
84
|
+
headers?: Record<string, string>;
|
|
85
|
+
maxSize?: number;
|
|
86
|
+
allowedTypes?: string[];
|
|
87
|
+
resize?: ImageResizeOptions;
|
|
88
|
+
cdnPrefix?: string;
|
|
89
|
+
}
|
|
90
|
+
/** Image resize options */
|
|
91
|
+
export interface ImageResizeOptions {
|
|
92
|
+
maxWidth?: number;
|
|
93
|
+
maxHeight?: number;
|
|
94
|
+
quality?: number;
|
|
95
|
+
format?: 'jpeg' | 'png' | 'webp';
|
|
96
|
+
}
|
|
97
|
+
/** Email toolbar configuration */
|
|
98
|
+
export interface EmailToolbarConfig {
|
|
99
|
+
visible?: boolean;
|
|
100
|
+
items?: EmailToolbarItem[];
|
|
101
|
+
customItems?: CustomToolbarItem[];
|
|
102
|
+
}
|
|
103
|
+
/** Toolbar item */
|
|
104
|
+
export type EmailToolbarItem = 'undo' | 'redo' | 'save' | 'preview' | 'previewDevice' | 'previewDarkMode' | 'sendTest' | 'export' | 'import' | 'spamCheck' | 'accessibilityCheck' | 'linkCheck' | 'viewMjml' | 'viewHtml' | 'fullscreen' | 'settings' | 'separator';
|
|
105
|
+
/** Custom toolbar item */
|
|
106
|
+
export interface CustomToolbarItem {
|
|
107
|
+
id: string;
|
|
108
|
+
label?: string;
|
|
109
|
+
icon?: string;
|
|
110
|
+
tooltip?: string;
|
|
111
|
+
handler: () => void;
|
|
112
|
+
disabled?: boolean;
|
|
113
|
+
position?: number;
|
|
114
|
+
}
|
|
115
|
+
/** Email sidebar configuration */
|
|
116
|
+
export interface EmailSidebarConfig {
|
|
117
|
+
visible?: boolean;
|
|
118
|
+
position?: 'left' | 'right';
|
|
119
|
+
width?: number;
|
|
120
|
+
tabs?: ('blocks' | 'properties' | 'style' | 'assets' | 'settings')[];
|
|
121
|
+
}
|
|
122
|
+
/** Brand assets */
|
|
123
|
+
export interface BrandAssets {
|
|
124
|
+
logos?: BrandAsset[];
|
|
125
|
+
colors?: BrandColor[];
|
|
126
|
+
fonts?: BrandFont[];
|
|
127
|
+
images?: BrandAsset[];
|
|
128
|
+
socialIcons?: SocialIcon[];
|
|
129
|
+
}
|
|
130
|
+
/** Brand asset */
|
|
131
|
+
export interface BrandAsset {
|
|
132
|
+
id: string;
|
|
133
|
+
name: string;
|
|
134
|
+
url: string;
|
|
135
|
+
width?: number;
|
|
136
|
+
height?: number;
|
|
137
|
+
category?: string;
|
|
138
|
+
}
|
|
139
|
+
/** Brand color */
|
|
140
|
+
export interface BrandColor {
|
|
141
|
+
id: string;
|
|
142
|
+
name: string;
|
|
143
|
+
value: string;
|
|
144
|
+
usage?: string;
|
|
145
|
+
}
|
|
146
|
+
/** Brand font */
|
|
147
|
+
export interface BrandFont {
|
|
148
|
+
id: string;
|
|
149
|
+
name: string;
|
|
150
|
+
family: string;
|
|
151
|
+
url?: string;
|
|
152
|
+
weights?: number[];
|
|
153
|
+
}
|
|
154
|
+
/** Social icon */
|
|
155
|
+
export interface SocialIcon {
|
|
156
|
+
platform: string;
|
|
157
|
+
url: string;
|
|
158
|
+
iconUrl?: string;
|
|
159
|
+
}
|
|
160
|
+
/** Template constraints */
|
|
161
|
+
export interface TemplateConstraints {
|
|
162
|
+
maxWidth?: number;
|
|
163
|
+
minWidth?: number;
|
|
164
|
+
maxBlocks?: number;
|
|
165
|
+
maxImages?: number;
|
|
166
|
+
maxFileSize?: number;
|
|
167
|
+
requiredFields?: string[];
|
|
168
|
+
lockedSections?: string[];
|
|
169
|
+
editableOnly?: string[];
|
|
170
|
+
}
|
|
171
|
+
/** Email template */
|
|
172
|
+
export interface EmailTemplate {
|
|
173
|
+
id: string;
|
|
174
|
+
name: string;
|
|
175
|
+
description?: string;
|
|
176
|
+
subject?: string;
|
|
177
|
+
preheader?: string;
|
|
178
|
+
body: EmailBody;
|
|
179
|
+
settings?: EmailSettings;
|
|
180
|
+
metadata?: EmailTemplateMetadata;
|
|
181
|
+
variants?: EmailVariant[];
|
|
182
|
+
version?: string;
|
|
183
|
+
mjml?: string;
|
|
184
|
+
html?: string;
|
|
185
|
+
}
|
|
186
|
+
/** Email body */
|
|
187
|
+
export interface EmailBody {
|
|
188
|
+
type: 'mj-body';
|
|
189
|
+
backgroundColor?: string;
|
|
190
|
+
width?: number;
|
|
191
|
+
sections: EmailSection[];
|
|
192
|
+
}
|
|
193
|
+
/** Email section */
|
|
194
|
+
export interface EmailSection {
|
|
195
|
+
id: string;
|
|
196
|
+
type: 'mj-section';
|
|
197
|
+
columns: EmailColumn[];
|
|
198
|
+
attributes?: SectionAttributes;
|
|
199
|
+
style?: SectionStyle;
|
|
200
|
+
conditions?: SectionCondition[];
|
|
201
|
+
locked?: boolean;
|
|
202
|
+
}
|
|
203
|
+
/** Section attributes */
|
|
204
|
+
export interface SectionAttributes {
|
|
205
|
+
fullWidth?: boolean;
|
|
206
|
+
backgroundColor?: string;
|
|
207
|
+
backgroundUrl?: string;
|
|
208
|
+
backgroundRepeat?: 'repeat' | 'repeat-x' | 'repeat-y' | 'no-repeat';
|
|
209
|
+
backgroundSize?: string;
|
|
210
|
+
backgroundPosition?: string;
|
|
211
|
+
borderRadius?: string;
|
|
212
|
+
border?: string;
|
|
213
|
+
padding?: string;
|
|
214
|
+
paddingTop?: string;
|
|
215
|
+
paddingRight?: string;
|
|
216
|
+
paddingBottom?: string;
|
|
217
|
+
paddingLeft?: string;
|
|
218
|
+
textAlign?: 'left' | 'center' | 'right';
|
|
219
|
+
direction?: 'ltr' | 'rtl';
|
|
220
|
+
}
|
|
221
|
+
/** Section style */
|
|
222
|
+
export interface SectionStyle {
|
|
223
|
+
backgroundColor?: string;
|
|
224
|
+
backgroundImage?: string;
|
|
225
|
+
borderTop?: string;
|
|
226
|
+
borderRight?: string;
|
|
227
|
+
borderBottom?: string;
|
|
228
|
+
borderLeft?: string;
|
|
229
|
+
borderRadius?: string;
|
|
230
|
+
boxShadow?: string;
|
|
231
|
+
}
|
|
232
|
+
/** Section condition */
|
|
233
|
+
export interface SectionCondition {
|
|
234
|
+
field: string;
|
|
235
|
+
operator: ConditionOperator;
|
|
236
|
+
value: unknown;
|
|
237
|
+
action: 'show' | 'hide';
|
|
238
|
+
}
|
|
239
|
+
/** Condition operator */
|
|
240
|
+
export type ConditionOperator = 'equals' | 'notEquals' | 'contains' | 'notContains' | 'isEmpty' | 'isNotEmpty' | 'greaterThan' | 'lessThan';
|
|
241
|
+
/** Email column */
|
|
242
|
+
export interface EmailColumn {
|
|
243
|
+
id: string;
|
|
244
|
+
type: 'mj-column';
|
|
245
|
+
blocks: EmailBlock[];
|
|
246
|
+
attributes?: ColumnAttributes;
|
|
247
|
+
style?: ColumnStyle;
|
|
248
|
+
}
|
|
249
|
+
/** Column attributes */
|
|
250
|
+
export interface ColumnAttributes {
|
|
251
|
+
width?: string;
|
|
252
|
+
backgroundColor?: string;
|
|
253
|
+
borderRadius?: string;
|
|
254
|
+
border?: string;
|
|
255
|
+
padding?: string;
|
|
256
|
+
paddingTop?: string;
|
|
257
|
+
paddingRight?: string;
|
|
258
|
+
paddingBottom?: string;
|
|
259
|
+
paddingLeft?: string;
|
|
260
|
+
verticalAlign?: 'top' | 'middle' | 'bottom';
|
|
261
|
+
}
|
|
262
|
+
/** Column style */
|
|
263
|
+
export interface ColumnStyle {
|
|
264
|
+
backgroundColor?: string;
|
|
265
|
+
borderTop?: string;
|
|
266
|
+
borderRight?: string;
|
|
267
|
+
borderBottom?: string;
|
|
268
|
+
borderLeft?: string;
|
|
269
|
+
borderRadius?: string;
|
|
270
|
+
}
|
|
271
|
+
/** Email settings */
|
|
272
|
+
export interface EmailSettings {
|
|
273
|
+
fonts?: EmailFont[];
|
|
274
|
+
headStyles?: string;
|
|
275
|
+
attributes?: EmailAttributes;
|
|
276
|
+
preview?: PreviewSettings;
|
|
277
|
+
}
|
|
278
|
+
/** Email font */
|
|
279
|
+
export interface EmailFont {
|
|
280
|
+
name: string;
|
|
281
|
+
href?: string;
|
|
282
|
+
}
|
|
283
|
+
/** Email attributes */
|
|
284
|
+
export interface EmailAttributes {
|
|
285
|
+
'mj-all'?: Record<string, string>;
|
|
286
|
+
'mj-text'?: Record<string, string>;
|
|
287
|
+
'mj-button'?: Record<string, string>;
|
|
288
|
+
'mj-section'?: Record<string, string>;
|
|
289
|
+
'mj-column'?: Record<string, string>;
|
|
290
|
+
[key: string]: Record<string, string> | undefined;
|
|
291
|
+
}
|
|
292
|
+
/** Preview settings */
|
|
293
|
+
export interface PreviewSettings {
|
|
294
|
+
devices?: DevicePreview[];
|
|
295
|
+
defaultDevice?: DevicePreview;
|
|
296
|
+
clients?: EmailClient[];
|
|
297
|
+
darkMode?: boolean;
|
|
298
|
+
}
|
|
299
|
+
/** Email template metadata */
|
|
300
|
+
export interface EmailTemplateMetadata {
|
|
301
|
+
created?: Date;
|
|
302
|
+
createdBy?: string;
|
|
303
|
+
modified?: Date;
|
|
304
|
+
modifiedBy?: string;
|
|
305
|
+
published?: boolean;
|
|
306
|
+
publishedDate?: Date;
|
|
307
|
+
status?: 'draft' | 'review' | 'approved' | 'published' | 'archived';
|
|
308
|
+
category?: string;
|
|
309
|
+
tags?: string[];
|
|
310
|
+
campaignId?: string;
|
|
311
|
+
listId?: string;
|
|
312
|
+
analytics?: TemplateAnalytics;
|
|
313
|
+
}
|
|
314
|
+
/** Template analytics */
|
|
315
|
+
export interface TemplateAnalytics {
|
|
316
|
+
sends?: number;
|
|
317
|
+
opens?: number;
|
|
318
|
+
clicks?: number;
|
|
319
|
+
openRate?: number;
|
|
320
|
+
clickRate?: number;
|
|
321
|
+
unsubscribes?: number;
|
|
322
|
+
bounces?: number;
|
|
323
|
+
complaints?: number;
|
|
324
|
+
}
|
|
325
|
+
/** Email block */
|
|
326
|
+
export type EmailBlock = TextBlock | ImageBlock | ButtonBlock | DividerBlock | SpacerBlock | SocialBlock | NavbarBlock | HeroBlock | ImageTextBlock | CarouselBlock | AccordionBlock | TableBlock | RawBlock | CustomBlock;
|
|
327
|
+
/** Block base */
|
|
328
|
+
export interface BlockBase {
|
|
329
|
+
id: string;
|
|
330
|
+
type: EmailBlockType;
|
|
331
|
+
locked?: boolean;
|
|
332
|
+
visible?: boolean;
|
|
333
|
+
conditions?: SectionCondition[];
|
|
334
|
+
}
|
|
335
|
+
/** Block type */
|
|
336
|
+
export type EmailBlockType = 'mj-text' | 'mj-image' | 'mj-button' | 'mj-divider' | 'mj-spacer' | 'mj-social' | 'mj-navbar' | 'mj-hero' | 'mj-image-text' | 'mj-carousel' | 'mj-accordion' | 'mj-table' | 'mj-raw' | 'custom';
|
|
337
|
+
/** Text block */
|
|
338
|
+
export interface TextBlock extends BlockBase {
|
|
339
|
+
type: 'mj-text';
|
|
340
|
+
content: string;
|
|
341
|
+
attributes?: TextBlockAttributes;
|
|
342
|
+
}
|
|
343
|
+
/** Text block attributes */
|
|
344
|
+
export interface TextBlockAttributes {
|
|
345
|
+
color?: string;
|
|
346
|
+
fontFamily?: string;
|
|
347
|
+
fontSize?: string;
|
|
348
|
+
fontStyle?: 'normal' | 'italic';
|
|
349
|
+
fontWeight?: string | number;
|
|
350
|
+
lineHeight?: string;
|
|
351
|
+
letterSpacing?: string;
|
|
352
|
+
textDecoration?: 'none' | 'underline' | 'overline' | 'line-through';
|
|
353
|
+
textTransform?: 'none' | 'capitalize' | 'uppercase' | 'lowercase';
|
|
354
|
+
align?: 'left' | 'center' | 'right' | 'justify';
|
|
355
|
+
padding?: string;
|
|
356
|
+
paddingTop?: string;
|
|
357
|
+
paddingRight?: string;
|
|
358
|
+
paddingBottom?: string;
|
|
359
|
+
paddingLeft?: string;
|
|
360
|
+
containerBackgroundColor?: string;
|
|
361
|
+
cssClass?: string;
|
|
362
|
+
}
|
|
363
|
+
/** Image block */
|
|
364
|
+
export interface ImageBlock extends BlockBase {
|
|
365
|
+
type: 'mj-image';
|
|
366
|
+
src: string;
|
|
367
|
+
attributes?: ImageBlockAttributes;
|
|
368
|
+
}
|
|
369
|
+
/** Image block attributes */
|
|
370
|
+
export interface ImageBlockAttributes {
|
|
371
|
+
alt?: string;
|
|
372
|
+
title?: string;
|
|
373
|
+
href?: string;
|
|
374
|
+
target?: '_blank' | '_self';
|
|
375
|
+
width?: string;
|
|
376
|
+
height?: string;
|
|
377
|
+
align?: 'left' | 'center' | 'right';
|
|
378
|
+
padding?: string;
|
|
379
|
+
paddingTop?: string;
|
|
380
|
+
paddingRight?: string;
|
|
381
|
+
paddingBottom?: string;
|
|
382
|
+
paddingLeft?: string;
|
|
383
|
+
border?: string;
|
|
384
|
+
borderRadius?: string;
|
|
385
|
+
containerBackgroundColor?: string;
|
|
386
|
+
fluidOnMobile?: boolean;
|
|
387
|
+
cssClass?: string;
|
|
388
|
+
}
|
|
389
|
+
/** Button block */
|
|
390
|
+
export interface ButtonBlock extends BlockBase {
|
|
391
|
+
type: 'mj-button';
|
|
392
|
+
content: string;
|
|
393
|
+
href: string;
|
|
394
|
+
attributes?: ButtonBlockAttributes;
|
|
395
|
+
}
|
|
396
|
+
/** Button block attributes */
|
|
397
|
+
export interface ButtonBlockAttributes {
|
|
398
|
+
backgroundColor?: string;
|
|
399
|
+
color?: string;
|
|
400
|
+
fontFamily?: string;
|
|
401
|
+
fontSize?: string;
|
|
402
|
+
fontStyle?: 'normal' | 'italic';
|
|
403
|
+
fontWeight?: string | number;
|
|
404
|
+
letterSpacing?: string;
|
|
405
|
+
textDecoration?: 'none' | 'underline';
|
|
406
|
+
textTransform?: 'none' | 'capitalize' | 'uppercase' | 'lowercase';
|
|
407
|
+
align?: 'left' | 'center' | 'right';
|
|
408
|
+
verticalAlign?: 'top' | 'middle' | 'bottom';
|
|
409
|
+
borderRadius?: string;
|
|
410
|
+
border?: string;
|
|
411
|
+
innerPadding?: string;
|
|
412
|
+
padding?: string;
|
|
413
|
+
paddingTop?: string;
|
|
414
|
+
paddingRight?: string;
|
|
415
|
+
paddingBottom?: string;
|
|
416
|
+
paddingLeft?: string;
|
|
417
|
+
width?: string;
|
|
418
|
+
height?: string;
|
|
419
|
+
target?: '_blank' | '_self';
|
|
420
|
+
rel?: string;
|
|
421
|
+
containerBackgroundColor?: string;
|
|
422
|
+
cssClass?: string;
|
|
423
|
+
}
|
|
424
|
+
/** Divider block */
|
|
425
|
+
export interface DividerBlock extends BlockBase {
|
|
426
|
+
type: 'mj-divider';
|
|
427
|
+
attributes?: DividerBlockAttributes;
|
|
428
|
+
}
|
|
429
|
+
/** Divider block attributes */
|
|
430
|
+
export interface DividerBlockAttributes {
|
|
431
|
+
borderColor?: string;
|
|
432
|
+
borderStyle?: 'solid' | 'dashed' | 'dotted' | 'double';
|
|
433
|
+
borderWidth?: string;
|
|
434
|
+
padding?: string;
|
|
435
|
+
paddingTop?: string;
|
|
436
|
+
paddingRight?: string;
|
|
437
|
+
paddingBottom?: string;
|
|
438
|
+
paddingLeft?: string;
|
|
439
|
+
width?: string;
|
|
440
|
+
align?: 'left' | 'center' | 'right';
|
|
441
|
+
containerBackgroundColor?: string;
|
|
442
|
+
cssClass?: string;
|
|
443
|
+
}
|
|
444
|
+
/** Spacer block */
|
|
445
|
+
export interface SpacerBlock extends BlockBase {
|
|
446
|
+
type: 'mj-spacer';
|
|
447
|
+
attributes?: SpacerBlockAttributes;
|
|
448
|
+
}
|
|
449
|
+
/** Spacer block attributes */
|
|
450
|
+
export interface SpacerBlockAttributes {
|
|
451
|
+
height?: string;
|
|
452
|
+
padding?: string;
|
|
453
|
+
paddingTop?: string;
|
|
454
|
+
paddingRight?: string;
|
|
455
|
+
paddingBottom?: string;
|
|
456
|
+
paddingLeft?: string;
|
|
457
|
+
containerBackgroundColor?: string;
|
|
458
|
+
cssClass?: string;
|
|
459
|
+
}
|
|
460
|
+
/** Social block */
|
|
461
|
+
export interface SocialBlock extends BlockBase {
|
|
462
|
+
type: 'mj-social';
|
|
463
|
+
elements: SocialElement[];
|
|
464
|
+
attributes?: SocialBlockAttributes;
|
|
465
|
+
}
|
|
466
|
+
/** Social element */
|
|
467
|
+
export interface SocialElement {
|
|
468
|
+
name: SocialPlatform;
|
|
469
|
+
href: string;
|
|
470
|
+
src?: string;
|
|
471
|
+
alt?: string;
|
|
472
|
+
title?: string;
|
|
473
|
+
backgroundColor?: string;
|
|
474
|
+
color?: string;
|
|
475
|
+
borderRadius?: string;
|
|
476
|
+
iconSize?: string;
|
|
477
|
+
iconHeight?: string;
|
|
478
|
+
iconPadding?: string;
|
|
479
|
+
textPadding?: string;
|
|
480
|
+
padding?: string;
|
|
481
|
+
}
|
|
482
|
+
/** Social platform */
|
|
483
|
+
export type SocialPlatform = 'facebook' | 'twitter' | 'x' | 'instagram' | 'linkedin' | 'pinterest' | 'youtube' | 'tiktok' | 'snapchat' | 'github' | 'dribbble' | 'behance' | 'medium' | 'web' | 'email' | 'phone' | 'whatsapp' | 'telegram' | 'discord' | 'slack' | 'custom';
|
|
484
|
+
/** Social block attributes */
|
|
485
|
+
export interface SocialBlockAttributes {
|
|
486
|
+
align?: 'left' | 'center' | 'right';
|
|
487
|
+
borderRadius?: string;
|
|
488
|
+
color?: string;
|
|
489
|
+
fontFamily?: string;
|
|
490
|
+
fontSize?: string;
|
|
491
|
+
fontStyle?: 'normal' | 'italic';
|
|
492
|
+
fontWeight?: string | number;
|
|
493
|
+
iconHeight?: string;
|
|
494
|
+
iconSize?: string;
|
|
495
|
+
innerPadding?: string;
|
|
496
|
+
lineHeight?: string;
|
|
497
|
+
mode?: 'horizontal' | 'vertical';
|
|
498
|
+
padding?: string;
|
|
499
|
+
paddingTop?: string;
|
|
500
|
+
paddingRight?: string;
|
|
501
|
+
paddingBottom?: string;
|
|
502
|
+
paddingLeft?: string;
|
|
503
|
+
textPadding?: string;
|
|
504
|
+
textDecoration?: 'none' | 'underline';
|
|
505
|
+
containerBackgroundColor?: string;
|
|
506
|
+
cssClass?: string;
|
|
507
|
+
}
|
|
508
|
+
/** Navbar block */
|
|
509
|
+
export interface NavbarBlock extends BlockBase {
|
|
510
|
+
type: 'mj-navbar';
|
|
511
|
+
links: NavbarLink[];
|
|
512
|
+
attributes?: NavbarBlockAttributes;
|
|
513
|
+
}
|
|
514
|
+
/** Navbar link */
|
|
515
|
+
export interface NavbarLink {
|
|
516
|
+
content: string;
|
|
517
|
+
href: string;
|
|
518
|
+
target?: '_blank' | '_self';
|
|
519
|
+
color?: string;
|
|
520
|
+
fontFamily?: string;
|
|
521
|
+
fontSize?: string;
|
|
522
|
+
fontStyle?: 'normal' | 'italic';
|
|
523
|
+
fontWeight?: string | number;
|
|
524
|
+
letterSpacing?: string;
|
|
525
|
+
lineHeight?: string;
|
|
526
|
+
padding?: string;
|
|
527
|
+
textDecoration?: 'none' | 'underline';
|
|
528
|
+
textTransform?: 'none' | 'capitalize' | 'uppercase' | 'lowercase';
|
|
529
|
+
}
|
|
530
|
+
/** Navbar block attributes */
|
|
531
|
+
export interface NavbarBlockAttributes {
|
|
532
|
+
align?: 'left' | 'center' | 'right';
|
|
533
|
+
baseUrl?: string;
|
|
534
|
+
hamburger?: 'hamburger';
|
|
535
|
+
icoAlign?: 'left' | 'center' | 'right';
|
|
536
|
+
icoClose?: string;
|
|
537
|
+
icoColor?: string;
|
|
538
|
+
icoFontFamily?: string;
|
|
539
|
+
icoFontSize?: string;
|
|
540
|
+
icoLineHeight?: string;
|
|
541
|
+
icoOpen?: string;
|
|
542
|
+
icoPadding?: string;
|
|
543
|
+
icoPaddingTop?: string;
|
|
544
|
+
icoPaddingRight?: string;
|
|
545
|
+
icoPaddingBottom?: string;
|
|
546
|
+
icoPaddingLeft?: string;
|
|
547
|
+
icoTextDecoration?: 'none' | 'underline';
|
|
548
|
+
icoTextTransform?: 'none' | 'capitalize' | 'uppercase' | 'lowercase';
|
|
549
|
+
padding?: string;
|
|
550
|
+
cssClass?: string;
|
|
551
|
+
}
|
|
552
|
+
/** Hero block */
|
|
553
|
+
export interface HeroBlock extends BlockBase {
|
|
554
|
+
type: 'mj-hero';
|
|
555
|
+
content: EmailBlock[];
|
|
556
|
+
attributes?: HeroBlockAttributes;
|
|
557
|
+
}
|
|
558
|
+
/** Hero block attributes */
|
|
559
|
+
export interface HeroBlockAttributes {
|
|
560
|
+
backgroundColor?: string;
|
|
561
|
+
backgroundHeight?: string;
|
|
562
|
+
backgroundPosition?: string;
|
|
563
|
+
backgroundUrl?: string;
|
|
564
|
+
backgroundWidth?: string;
|
|
565
|
+
height?: string;
|
|
566
|
+
mode?: 'fixed-height' | 'fluid-height';
|
|
567
|
+
padding?: string;
|
|
568
|
+
paddingTop?: string;
|
|
569
|
+
paddingRight?: string;
|
|
570
|
+
paddingBottom?: string;
|
|
571
|
+
paddingLeft?: string;
|
|
572
|
+
verticalAlign?: 'top' | 'middle' | 'bottom';
|
|
573
|
+
width?: string;
|
|
574
|
+
cssClass?: string;
|
|
575
|
+
}
|
|
576
|
+
/** Image text block */
|
|
577
|
+
export interface ImageTextBlock extends BlockBase {
|
|
578
|
+
type: 'mj-image-text';
|
|
579
|
+
image: ImageBlock;
|
|
580
|
+
text: TextBlock;
|
|
581
|
+
attributes?: ImageTextBlockAttributes;
|
|
582
|
+
}
|
|
583
|
+
/** Image text block attributes */
|
|
584
|
+
export interface ImageTextBlockAttributes {
|
|
585
|
+
imagePosition?: 'left' | 'right';
|
|
586
|
+
imageWidth?: string;
|
|
587
|
+
textWidth?: string;
|
|
588
|
+
reverseOnMobile?: boolean;
|
|
589
|
+
padding?: string;
|
|
590
|
+
containerBackgroundColor?: string;
|
|
591
|
+
}
|
|
592
|
+
/** Carousel block */
|
|
593
|
+
export interface CarouselBlock extends BlockBase {
|
|
594
|
+
type: 'mj-carousel';
|
|
595
|
+
images: CarouselImage[];
|
|
596
|
+
attributes?: CarouselBlockAttributes;
|
|
597
|
+
}
|
|
598
|
+
/** Carousel image */
|
|
599
|
+
export interface CarouselImage {
|
|
600
|
+
src: string;
|
|
601
|
+
alt?: string;
|
|
602
|
+
title?: string;
|
|
603
|
+
href?: string;
|
|
604
|
+
thumbnailSrc?: string;
|
|
605
|
+
rel?: string;
|
|
606
|
+
target?: '_blank' | '_self';
|
|
607
|
+
cssClass?: string;
|
|
608
|
+
}
|
|
609
|
+
/** Carousel block attributes */
|
|
610
|
+
export interface CarouselBlockAttributes {
|
|
611
|
+
align?: 'left' | 'center' | 'right';
|
|
612
|
+
backgroundColor?: string;
|
|
613
|
+
borderRadius?: string;
|
|
614
|
+
iconWidth?: string;
|
|
615
|
+
leftIcon?: string;
|
|
616
|
+
rightIcon?: string;
|
|
617
|
+
tbBorderRadius?: string;
|
|
618
|
+
tbHoverBorderColor?: string;
|
|
619
|
+
tbSelectedBorderColor?: string;
|
|
620
|
+
tbWidth?: string;
|
|
621
|
+
thumbnails?: 'visible' | 'hidden';
|
|
622
|
+
padding?: string;
|
|
623
|
+
cssClass?: string;
|
|
624
|
+
}
|
|
625
|
+
/** Accordion block */
|
|
626
|
+
export interface AccordionBlock extends BlockBase {
|
|
627
|
+
type: 'mj-accordion';
|
|
628
|
+
items: AccordionItem[];
|
|
629
|
+
attributes?: AccordionBlockAttributes;
|
|
630
|
+
}
|
|
631
|
+
/** Accordion item */
|
|
632
|
+
export interface AccordionItem {
|
|
633
|
+
title: AccordionTitle;
|
|
634
|
+
content: AccordionContent;
|
|
635
|
+
}
|
|
636
|
+
/** Accordion title */
|
|
637
|
+
export interface AccordionTitle {
|
|
638
|
+
content: string;
|
|
639
|
+
backgroundColor?: string;
|
|
640
|
+
color?: string;
|
|
641
|
+
fontFamily?: string;
|
|
642
|
+
fontSize?: string;
|
|
643
|
+
iconAlign?: 'left' | 'right';
|
|
644
|
+
iconHeight?: string;
|
|
645
|
+
iconPosition?: 'left' | 'right';
|
|
646
|
+
iconUnwrappedAlt?: string;
|
|
647
|
+
iconUnwrappedUrl?: string;
|
|
648
|
+
iconWidth?: string;
|
|
649
|
+
iconWrappedAlt?: string;
|
|
650
|
+
iconWrappedUrl?: string;
|
|
651
|
+
padding?: string;
|
|
652
|
+
}
|
|
653
|
+
/** Accordion content */
|
|
654
|
+
export interface AccordionContent {
|
|
655
|
+
content: string;
|
|
656
|
+
backgroundColor?: string;
|
|
657
|
+
color?: string;
|
|
658
|
+
fontFamily?: string;
|
|
659
|
+
fontSize?: string;
|
|
660
|
+
lineHeight?: string;
|
|
661
|
+
padding?: string;
|
|
662
|
+
}
|
|
663
|
+
/** Accordion block attributes */
|
|
664
|
+
export interface AccordionBlockAttributes {
|
|
665
|
+
border?: string;
|
|
666
|
+
fontFamily?: string;
|
|
667
|
+
iconAlign?: 'left' | 'right';
|
|
668
|
+
iconHeight?: string;
|
|
669
|
+
iconPosition?: 'left' | 'right';
|
|
670
|
+
iconUnwrappedAlt?: string;
|
|
671
|
+
iconUnwrappedUrl?: string;
|
|
672
|
+
iconWidth?: string;
|
|
673
|
+
iconWrappedAlt?: string;
|
|
674
|
+
iconWrappedUrl?: string;
|
|
675
|
+
padding?: string;
|
|
676
|
+
containerBackgroundColor?: string;
|
|
677
|
+
cssClass?: string;
|
|
678
|
+
}
|
|
679
|
+
/** Table block */
|
|
680
|
+
export interface TableBlock extends BlockBase {
|
|
681
|
+
type: 'mj-table';
|
|
682
|
+
content: string;
|
|
683
|
+
attributes?: TableBlockAttributes;
|
|
684
|
+
}
|
|
685
|
+
/** Table block attributes */
|
|
686
|
+
export interface TableBlockAttributes {
|
|
687
|
+
align?: 'left' | 'center' | 'right';
|
|
688
|
+
cellpadding?: string;
|
|
689
|
+
cellspacing?: string;
|
|
690
|
+
color?: string;
|
|
691
|
+
containerBackgroundColor?: string;
|
|
692
|
+
fontFamily?: string;
|
|
693
|
+
fontSize?: string;
|
|
694
|
+
fontStyle?: 'normal' | 'italic';
|
|
695
|
+
lineHeight?: string;
|
|
696
|
+
padding?: string;
|
|
697
|
+
paddingTop?: string;
|
|
698
|
+
paddingRight?: string;
|
|
699
|
+
paddingBottom?: string;
|
|
700
|
+
paddingLeft?: string;
|
|
701
|
+
tableLayout?: 'auto' | 'fixed';
|
|
702
|
+
width?: string;
|
|
703
|
+
cssClass?: string;
|
|
704
|
+
}
|
|
705
|
+
/** Raw block */
|
|
706
|
+
export interface RawBlock extends BlockBase {
|
|
707
|
+
type: 'mj-raw';
|
|
708
|
+
content: string;
|
|
709
|
+
}
|
|
710
|
+
/** Custom block */
|
|
711
|
+
export interface CustomBlock extends BlockBase {
|
|
712
|
+
type: 'custom';
|
|
713
|
+
customType: string;
|
|
714
|
+
content?: unknown;
|
|
715
|
+
attributes?: Record<string, unknown>;
|
|
716
|
+
}
|
|
717
|
+
/** Email block definition */
|
|
718
|
+
export interface EmailBlockDefinition {
|
|
719
|
+
type: EmailBlockType;
|
|
720
|
+
label: string;
|
|
721
|
+
icon?: string;
|
|
722
|
+
category?: string;
|
|
723
|
+
defaultAttributes?: Record<string, unknown>;
|
|
724
|
+
schema?: BlockSchema;
|
|
725
|
+
thumbnail?: string;
|
|
726
|
+
}
|
|
727
|
+
/** Block schema */
|
|
728
|
+
export interface BlockSchema {
|
|
729
|
+
properties: BlockProperty[];
|
|
730
|
+
groups?: BlockPropertyGroup[];
|
|
731
|
+
}
|
|
732
|
+
/** Block property */
|
|
733
|
+
export interface BlockProperty {
|
|
734
|
+
name: string;
|
|
735
|
+
label: string;
|
|
736
|
+
type: PropertyType;
|
|
737
|
+
defaultValue?: unknown;
|
|
738
|
+
options?: PropertyOption[];
|
|
739
|
+
min?: number;
|
|
740
|
+
max?: number;
|
|
741
|
+
unit?: string;
|
|
742
|
+
group?: string;
|
|
743
|
+
description?: string;
|
|
744
|
+
advanced?: boolean;
|
|
745
|
+
}
|
|
746
|
+
/** Property type */
|
|
747
|
+
export type PropertyType = 'text' | 'textarea' | 'richtext' | 'number' | 'select' | 'color' | 'image' | 'url' | 'align' | 'padding' | 'border' | 'font' | 'toggle' | 'slider' | 'code';
|
|
748
|
+
/** Property option */
|
|
749
|
+
export interface PropertyOption {
|
|
750
|
+
value: string | number;
|
|
751
|
+
label: string;
|
|
752
|
+
icon?: string;
|
|
753
|
+
}
|
|
754
|
+
/** Block property group */
|
|
755
|
+
export interface BlockPropertyGroup {
|
|
756
|
+
id: string;
|
|
757
|
+
label: string;
|
|
758
|
+
collapsed?: boolean;
|
|
759
|
+
}
|
|
760
|
+
/** Custom email block */
|
|
761
|
+
export interface CustomEmailBlock {
|
|
762
|
+
type: string;
|
|
763
|
+
label: string;
|
|
764
|
+
icon?: string;
|
|
765
|
+
category?: string;
|
|
766
|
+
schema?: BlockSchema;
|
|
767
|
+
mjml?: string;
|
|
768
|
+
html?: string;
|
|
769
|
+
render?: (block: CustomBlock, options: RenderOptions) => string;
|
|
770
|
+
}
|
|
771
|
+
/** Render options */
|
|
772
|
+
export interface RenderOptions {
|
|
773
|
+
preview?: boolean;
|
|
774
|
+
device?: DevicePreview;
|
|
775
|
+
darkMode?: boolean;
|
|
776
|
+
mergeTags?: Record<string, unknown>;
|
|
777
|
+
}
|
|
778
|
+
/** Merge tag definition */
|
|
779
|
+
export interface MergeTagDefinition {
|
|
780
|
+
tag: string;
|
|
781
|
+
label: string;
|
|
782
|
+
description?: string;
|
|
783
|
+
category?: string;
|
|
784
|
+
defaultValue?: string;
|
|
785
|
+
example?: string;
|
|
786
|
+
format?: MergeTagFormat;
|
|
787
|
+
source?: MergeTagSource;
|
|
788
|
+
}
|
|
789
|
+
/** Merge tag format */
|
|
790
|
+
export interface MergeTagFormat {
|
|
791
|
+
type: 'text' | 'date' | 'number' | 'currency' | 'url' | 'html';
|
|
792
|
+
pattern?: string;
|
|
793
|
+
fallback?: string;
|
|
794
|
+
escape?: boolean;
|
|
795
|
+
}
|
|
796
|
+
/** Merge tag source */
|
|
797
|
+
export interface MergeTagSource {
|
|
798
|
+
type: 'field' | 'api' | 'function';
|
|
799
|
+
field?: string;
|
|
800
|
+
endpoint?: string;
|
|
801
|
+
function?: (context: MergeTagContext) => string;
|
|
802
|
+
}
|
|
803
|
+
/** Merge tag context */
|
|
804
|
+
export interface MergeTagContext {
|
|
805
|
+
recipient?: Record<string, unknown>;
|
|
806
|
+
campaign?: Record<string, unknown>;
|
|
807
|
+
custom?: Record<string, unknown>;
|
|
808
|
+
}
|
|
809
|
+
/** Merge tag value */
|
|
810
|
+
export interface MergeTagValue {
|
|
811
|
+
tag: string;
|
|
812
|
+
value: unknown;
|
|
813
|
+
formatted?: string;
|
|
814
|
+
}
|
|
815
|
+
/** Email variant */
|
|
816
|
+
export interface EmailVariant {
|
|
817
|
+
id: string;
|
|
818
|
+
name: string;
|
|
819
|
+
description?: string;
|
|
820
|
+
body: EmailBody;
|
|
821
|
+
subject?: string;
|
|
822
|
+
preheader?: string;
|
|
823
|
+
weight?: number;
|
|
824
|
+
winner?: boolean;
|
|
825
|
+
statistics?: VariantStatistics;
|
|
826
|
+
}
|
|
827
|
+
/** Variant statistics */
|
|
828
|
+
export interface VariantStatistics {
|
|
829
|
+
sends: number;
|
|
830
|
+
opens: number;
|
|
831
|
+
clicks: number;
|
|
832
|
+
openRate: number;
|
|
833
|
+
clickRate: number;
|
|
834
|
+
conversions?: number;
|
|
835
|
+
conversionRate?: number;
|
|
836
|
+
confidence?: number;
|
|
837
|
+
}
|
|
838
|
+
/** A/B test configuration */
|
|
839
|
+
export interface ABTestConfig {
|
|
840
|
+
type: 'subject' | 'content' | 'both';
|
|
841
|
+
sampleSize: number;
|
|
842
|
+
winnerCriteria: WinnerCriteria;
|
|
843
|
+
testDuration?: number;
|
|
844
|
+
autoSelectWinner?: boolean;
|
|
845
|
+
minimumSampleSize?: number;
|
|
846
|
+
confidenceLevel?: number;
|
|
847
|
+
}
|
|
848
|
+
/** Winner criteria */
|
|
849
|
+
export type WinnerCriteria = 'openRate' | 'clickRate' | 'conversionRate' | 'revenue' | 'custom';
|
|
850
|
+
/** Spam check result */
|
|
851
|
+
export interface SpamCheckResult {
|
|
852
|
+
score: number;
|
|
853
|
+
maxScore: number;
|
|
854
|
+
passing: boolean;
|
|
855
|
+
checks: SpamCheck[];
|
|
856
|
+
recommendations?: string[];
|
|
857
|
+
}
|
|
858
|
+
/** Spam check */
|
|
859
|
+
export interface SpamCheck {
|
|
860
|
+
rule: string;
|
|
861
|
+
description: string;
|
|
862
|
+
score: number;
|
|
863
|
+
passed: boolean;
|
|
864
|
+
severity: 'low' | 'medium' | 'high' | 'critical';
|
|
865
|
+
category: SpamCheckCategory;
|
|
866
|
+
fix?: string;
|
|
867
|
+
}
|
|
868
|
+
/** Spam check category */
|
|
869
|
+
export type SpamCheckCategory = 'content' | 'links' | 'images' | 'html' | 'subject' | 'authentication' | 'blacklist' | 'reputation';
|
|
870
|
+
/** Accessibility check result */
|
|
871
|
+
export interface AccessibilityCheckResult {
|
|
872
|
+
score: number;
|
|
873
|
+
passing: boolean;
|
|
874
|
+
issues: AccessibilityIssue[];
|
|
875
|
+
warnings: AccessibilityWarning[];
|
|
876
|
+
recommendations?: string[];
|
|
877
|
+
}
|
|
878
|
+
/** Accessibility issue */
|
|
879
|
+
export interface AccessibilityIssue {
|
|
880
|
+
rule: string;
|
|
881
|
+
description: string;
|
|
882
|
+
severity: 'error' | 'warning' | 'info';
|
|
883
|
+
element?: string;
|
|
884
|
+
location?: string;
|
|
885
|
+
fix?: string;
|
|
886
|
+
wcag?: string;
|
|
887
|
+
}
|
|
888
|
+
/** Accessibility warning */
|
|
889
|
+
export interface AccessibilityWarning {
|
|
890
|
+
rule: string;
|
|
891
|
+
description: string;
|
|
892
|
+
element?: string;
|
|
893
|
+
recommendation?: string;
|
|
894
|
+
}
|
|
895
|
+
/** Link tracking configuration */
|
|
896
|
+
export interface LinkTrackingConfig {
|
|
897
|
+
enabled: boolean;
|
|
898
|
+
baseUrl?: string;
|
|
899
|
+
utmSource?: string;
|
|
900
|
+
utmMedium?: string;
|
|
901
|
+
utmCampaign?: string;
|
|
902
|
+
utmContent?: string;
|
|
903
|
+
utmTerm?: string;
|
|
904
|
+
customParameters?: Record<string, string>;
|
|
905
|
+
excludePatterns?: string[];
|
|
906
|
+
trackClicks?: boolean;
|
|
907
|
+
trackUnsubscribe?: boolean;
|
|
908
|
+
protocol?: 'http' | 'https';
|
|
909
|
+
}
|
|
910
|
+
/** Tracked link */
|
|
911
|
+
export interface TrackedLink {
|
|
912
|
+
id: string;
|
|
913
|
+
originalUrl: string;
|
|
914
|
+
trackedUrl: string;
|
|
915
|
+
label?: string;
|
|
916
|
+
category?: string;
|
|
917
|
+
clicks?: number;
|
|
918
|
+
uniqueClicks?: number;
|
|
919
|
+
}
|
|
920
|
+
/** Link validation result */
|
|
921
|
+
export interface LinkValidationResult {
|
|
922
|
+
url: string;
|
|
923
|
+
valid: boolean;
|
|
924
|
+
status?: number;
|
|
925
|
+
error?: string;
|
|
926
|
+
redirectUrl?: string;
|
|
927
|
+
responseTime?: number;
|
|
928
|
+
}
|
|
929
|
+
/** Email preview */
|
|
930
|
+
export interface EmailPreview {
|
|
931
|
+
device: DevicePreview;
|
|
932
|
+
client?: EmailClient;
|
|
933
|
+
darkMode?: boolean;
|
|
934
|
+
html: string;
|
|
935
|
+
subject?: string;
|
|
936
|
+
preheader?: string;
|
|
937
|
+
width?: number;
|
|
938
|
+
height?: number;
|
|
939
|
+
}
|
|
940
|
+
/** Client preview */
|
|
941
|
+
export interface ClientPreview {
|
|
942
|
+
client: EmailClient;
|
|
943
|
+
device: DevicePreview;
|
|
944
|
+
darkMode: boolean;
|
|
945
|
+
screenshot?: string;
|
|
946
|
+
issues?: ClientIssue[];
|
|
947
|
+
}
|
|
948
|
+
/** Client issue */
|
|
949
|
+
export interface ClientIssue {
|
|
950
|
+
severity: 'error' | 'warning' | 'info';
|
|
951
|
+
description: string;
|
|
952
|
+
element?: string;
|
|
953
|
+
workaround?: string;
|
|
954
|
+
}
|
|
955
|
+
/** Email export format */
|
|
956
|
+
export type EmailExportFormat = 'html' | 'mjml' | 'json' | 'zip' | 'pdf' | 'image';
|
|
957
|
+
/** Email export options */
|
|
958
|
+
export interface EmailExportOptions {
|
|
959
|
+
format: EmailExportFormat;
|
|
960
|
+
minify?: boolean;
|
|
961
|
+
inlineCss?: boolean;
|
|
962
|
+
embedImages?: boolean;
|
|
963
|
+
includeSourceMaps?: boolean;
|
|
964
|
+
includeAssets?: boolean;
|
|
965
|
+
applyMergeTags?: boolean;
|
|
966
|
+
mergeTags?: Record<string, unknown>;
|
|
967
|
+
}
|
|
968
|
+
/** Email export result */
|
|
969
|
+
export interface EmailExportResult {
|
|
970
|
+
format: EmailExportFormat;
|
|
971
|
+
data: string | ArrayBuffer;
|
|
972
|
+
filename?: string;
|
|
973
|
+
mimeType?: string;
|
|
974
|
+
size?: number;
|
|
975
|
+
assets?: ExportedAsset[];
|
|
976
|
+
}
|
|
977
|
+
/** Exported asset */
|
|
978
|
+
export interface ExportedAsset {
|
|
979
|
+
name: string;
|
|
980
|
+
path: string;
|
|
981
|
+
mimeType: string;
|
|
982
|
+
size: number;
|
|
983
|
+
data?: ArrayBuffer;
|
|
984
|
+
}
|
|
985
|
+
/** Email import options */
|
|
986
|
+
export interface EmailImportOptions {
|
|
987
|
+
format?: 'html' | 'mjml' | 'json' | 'zip';
|
|
988
|
+
preserveStyles?: boolean;
|
|
989
|
+
convertToBlocks?: boolean;
|
|
990
|
+
extractAssets?: boolean;
|
|
991
|
+
}
|
|
992
|
+
/** Email import result */
|
|
993
|
+
export interface EmailImportResult {
|
|
994
|
+
success: boolean;
|
|
995
|
+
template?: EmailTemplate;
|
|
996
|
+
warnings?: string[];
|
|
997
|
+
errors?: string[];
|
|
998
|
+
}
|
|
999
|
+
/** Template library item */
|
|
1000
|
+
export interface TemplateLibraryItem {
|
|
1001
|
+
id: string;
|
|
1002
|
+
name: string;
|
|
1003
|
+
description?: string;
|
|
1004
|
+
category?: string;
|
|
1005
|
+
tags?: string[];
|
|
1006
|
+
thumbnail?: string;
|
|
1007
|
+
preview?: string;
|
|
1008
|
+
author?: string;
|
|
1009
|
+
created?: Date;
|
|
1010
|
+
modified?: Date;
|
|
1011
|
+
downloads?: number;
|
|
1012
|
+
rating?: number;
|
|
1013
|
+
featured?: boolean;
|
|
1014
|
+
premium?: boolean;
|
|
1015
|
+
template: EmailTemplate;
|
|
1016
|
+
}
|
|
1017
|
+
/** Template category */
|
|
1018
|
+
export interface TemplateCategory {
|
|
1019
|
+
id: string;
|
|
1020
|
+
name: string;
|
|
1021
|
+
description?: string;
|
|
1022
|
+
icon?: string;
|
|
1023
|
+
count?: number;
|
|
1024
|
+
subcategories?: TemplateCategory[];
|
|
1025
|
+
}
|
|
1026
|
+
/** Template search options */
|
|
1027
|
+
export interface TemplateSearchOptions {
|
|
1028
|
+
query?: string;
|
|
1029
|
+
category?: string;
|
|
1030
|
+
tags?: string[];
|
|
1031
|
+
sortBy?: 'name' | 'created' | 'modified' | 'downloads' | 'rating';
|
|
1032
|
+
sortOrder?: 'asc' | 'desc';
|
|
1033
|
+
limit?: number;
|
|
1034
|
+
offset?: number;
|
|
1035
|
+
premium?: boolean;
|
|
1036
|
+
}
|
|
1037
|
+
/** Email collaboration session */
|
|
1038
|
+
export interface EmailCollaborationSession {
|
|
1039
|
+
id: string;
|
|
1040
|
+
templateId: string;
|
|
1041
|
+
users: CollaborationUser[];
|
|
1042
|
+
cursors: UserCursor[];
|
|
1043
|
+
selections: UserSelection[];
|
|
1044
|
+
version: number;
|
|
1045
|
+
lastModified: Date;
|
|
1046
|
+
}
|
|
1047
|
+
/** Collaboration user */
|
|
1048
|
+
export interface CollaborationUser {
|
|
1049
|
+
id: string;
|
|
1050
|
+
name: string;
|
|
1051
|
+
color: string;
|
|
1052
|
+
avatar?: string;
|
|
1053
|
+
online: boolean;
|
|
1054
|
+
lastActivity?: Date;
|
|
1055
|
+
}
|
|
1056
|
+
/** User cursor */
|
|
1057
|
+
export interface UserCursor {
|
|
1058
|
+
userId: string;
|
|
1059
|
+
blockId?: string;
|
|
1060
|
+
position?: number;
|
|
1061
|
+
timestamp: Date;
|
|
1062
|
+
}
|
|
1063
|
+
/** User selection */
|
|
1064
|
+
export interface UserSelection {
|
|
1065
|
+
userId: string;
|
|
1066
|
+
blockId: string;
|
|
1067
|
+
start?: number;
|
|
1068
|
+
end?: number;
|
|
1069
|
+
timestamp: Date;
|
|
1070
|
+
}
|
|
1071
|
+
/** Template version */
|
|
1072
|
+
export interface TemplateVersion {
|
|
1073
|
+
id: string;
|
|
1074
|
+
templateId: string;
|
|
1075
|
+
version: number;
|
|
1076
|
+
name?: string;
|
|
1077
|
+
description?: string;
|
|
1078
|
+
template: EmailTemplate;
|
|
1079
|
+
author?: string;
|
|
1080
|
+
created: Date;
|
|
1081
|
+
changes?: VersionChange[];
|
|
1082
|
+
tags?: string[];
|
|
1083
|
+
}
|
|
1084
|
+
/** Version change */
|
|
1085
|
+
export interface VersionChange {
|
|
1086
|
+
type: 'add' | 'remove' | 'modify';
|
|
1087
|
+
path: string;
|
|
1088
|
+
before?: unknown;
|
|
1089
|
+
after?: unknown;
|
|
1090
|
+
}
|
|
1091
|
+
/** Test email configuration */
|
|
1092
|
+
export interface TestEmailConfig {
|
|
1093
|
+
recipients: string[];
|
|
1094
|
+
subject?: string;
|
|
1095
|
+
preheader?: string;
|
|
1096
|
+
mergeTags?: Record<string, unknown>;
|
|
1097
|
+
fromName?: string;
|
|
1098
|
+
fromEmail?: string;
|
|
1099
|
+
replyTo?: string;
|
|
1100
|
+
trackOpens?: boolean;
|
|
1101
|
+
trackClicks?: boolean;
|
|
1102
|
+
}
|
|
1103
|
+
/** Test email result */
|
|
1104
|
+
export interface TestEmailResult {
|
|
1105
|
+
success: boolean;
|
|
1106
|
+
messageId?: string;
|
|
1107
|
+
recipients: TestEmailRecipient[];
|
|
1108
|
+
errors?: string[];
|
|
1109
|
+
}
|
|
1110
|
+
/** Test email recipient */
|
|
1111
|
+
export interface TestEmailRecipient {
|
|
1112
|
+
email: string;
|
|
1113
|
+
status: 'sent' | 'bounced' | 'failed';
|
|
1114
|
+
error?: string;
|
|
1115
|
+
}
|
|
1116
|
+
/** Dark mode settings */
|
|
1117
|
+
export interface DarkModeSettings {
|
|
1118
|
+
enabled: boolean;
|
|
1119
|
+
strategy: 'auto' | 'media-query' | 'class';
|
|
1120
|
+
overrides?: DarkModeOverride[];
|
|
1121
|
+
}
|
|
1122
|
+
/** Dark mode override */
|
|
1123
|
+
export interface DarkModeOverride {
|
|
1124
|
+
selector: string;
|
|
1125
|
+
property: string;
|
|
1126
|
+
lightValue: string;
|
|
1127
|
+
darkValue: string;
|
|
1128
|
+
}
|
|
1129
|
+
/** Dark mode preview */
|
|
1130
|
+
export interface DarkModePreview {
|
|
1131
|
+
lightHtml: string;
|
|
1132
|
+
darkHtml: string;
|
|
1133
|
+
issues?: DarkModeIssue[];
|
|
1134
|
+
}
|
|
1135
|
+
/** Dark mode issue */
|
|
1136
|
+
export interface DarkModeIssue {
|
|
1137
|
+
element: string;
|
|
1138
|
+
description: string;
|
|
1139
|
+
fix?: string;
|
|
1140
|
+
}
|
|
1141
|
+
//# sourceMappingURL=email-template.d.ts.map
|