@templatical/types 0.9.1 → 0.10.1
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/index.d.ts +568 -533
- package/dist/index.js +449 -579
- package/dist/index.js.map +1 -1
- package/package.json +3 -4
package/dist/index.d.ts
CHANGED
|
@@ -1,197 +1,191 @@
|
|
|
1
|
+
//#region src/blocks.d.ts
|
|
1
2
|
interface SpacingValue {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
}
|
|
7
|
-
interface ResponsiveStyles {
|
|
8
|
-
tablet?: Partial<BlockStyles>;
|
|
9
|
-
mobile?: Partial<BlockStyles>;
|
|
3
|
+
top: number;
|
|
4
|
+
right: number;
|
|
5
|
+
bottom: number;
|
|
6
|
+
left: number;
|
|
10
7
|
}
|
|
11
8
|
interface BlockStyles {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
backgroundColor?: string;
|
|
15
|
-
responsive?: ResponsiveStyles;
|
|
9
|
+
padding: SpacingValue;
|
|
10
|
+
backgroundColor?: string;
|
|
16
11
|
}
|
|
17
12
|
interface BlockVisibility {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
mobile: boolean;
|
|
13
|
+
desktop: boolean;
|
|
14
|
+
mobile: boolean;
|
|
21
15
|
}
|
|
22
16
|
interface BaseBlock {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
};
|
|
17
|
+
id: string;
|
|
18
|
+
type: string;
|
|
19
|
+
styles: BlockStyles;
|
|
20
|
+
visibility?: BlockVisibility;
|
|
21
|
+
displayCondition?: {
|
|
22
|
+
label: string;
|
|
23
|
+
before: string;
|
|
24
|
+
after: string;
|
|
25
|
+
group?: string;
|
|
26
|
+
description?: string;
|
|
27
|
+
};
|
|
35
28
|
}
|
|
36
29
|
type ColumnLayout = "1" | "2" | "3" | "2-1" | "1-2";
|
|
37
30
|
interface SectionBlock extends BaseBlock {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
31
|
+
type: "section";
|
|
32
|
+
columns: ColumnLayout;
|
|
33
|
+
children: Block[][];
|
|
41
34
|
}
|
|
42
35
|
type HeadingLevel = 1 | 2 | 3 | 4;
|
|
43
36
|
declare const HEADING_LEVEL_FONT_SIZE: Record<HeadingLevel, number>;
|
|
44
37
|
interface TitleBlock extends BaseBlock {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
38
|
+
type: "title";
|
|
39
|
+
content: string;
|
|
40
|
+
level: HeadingLevel;
|
|
41
|
+
color: string;
|
|
42
|
+
textAlign: "left" | "center" | "right";
|
|
43
|
+
fontFamily?: string;
|
|
51
44
|
}
|
|
52
45
|
interface ParagraphBlock extends BaseBlock {
|
|
53
|
-
|
|
54
|
-
|
|
46
|
+
type: "paragraph";
|
|
47
|
+
content: string;
|
|
55
48
|
}
|
|
56
49
|
interface ImageBlock extends BaseBlock {
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
50
|
+
type: "image";
|
|
51
|
+
src: string;
|
|
52
|
+
alt: string;
|
|
53
|
+
width: number | "full";
|
|
54
|
+
align: "left" | "center" | "right";
|
|
55
|
+
linkUrl?: string;
|
|
56
|
+
linkOpenInNewTab?: boolean;
|
|
57
|
+
placeholderUrl?: string;
|
|
58
|
+
decorative?: boolean;
|
|
66
59
|
}
|
|
67
60
|
interface ButtonBlock extends BaseBlock {
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
61
|
+
type: "button";
|
|
62
|
+
text: string;
|
|
63
|
+
url: string;
|
|
64
|
+
openInNewTab?: boolean;
|
|
65
|
+
backgroundColor: string;
|
|
66
|
+
textColor: string;
|
|
67
|
+
borderRadius: number;
|
|
68
|
+
fontSize: number;
|
|
69
|
+
buttonPadding: SpacingValue;
|
|
70
|
+
fontFamily?: string;
|
|
78
71
|
}
|
|
79
72
|
interface DividerBlock extends BaseBlock {
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
73
|
+
type: "divider";
|
|
74
|
+
lineStyle: "solid" | "dashed" | "dotted";
|
|
75
|
+
color: string;
|
|
76
|
+
thickness: number;
|
|
77
|
+
width: number | "full";
|
|
85
78
|
}
|
|
86
79
|
interface VideoBlock extends BaseBlock {
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
80
|
+
type: "video";
|
|
81
|
+
url: string;
|
|
82
|
+
openInNewTab?: boolean;
|
|
83
|
+
thumbnailUrl: string;
|
|
84
|
+
alt: string;
|
|
85
|
+
width: number | "full";
|
|
86
|
+
align: "left" | "center" | "right";
|
|
87
|
+
placeholderUrl?: string;
|
|
95
88
|
}
|
|
96
89
|
type SocialPlatform = "facebook" | "twitter" | "instagram" | "linkedin" | "youtube" | "tiktok" | "pinterest" | "email" | "whatsapp" | "telegram" | "discord" | "snapchat" | "reddit" | "github" | "dribbble" | "behance";
|
|
97
90
|
type SocialIconStyle = "solid" | "outlined" | "rounded" | "square" | "circle";
|
|
98
91
|
type SocialIconSize = "small" | "medium" | "large";
|
|
99
92
|
interface SocialIcon {
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
93
|
+
id: string;
|
|
94
|
+
platform: SocialPlatform;
|
|
95
|
+
url: string;
|
|
103
96
|
}
|
|
104
97
|
interface SocialIconsBlock extends BaseBlock {
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
98
|
+
type: "social";
|
|
99
|
+
icons: SocialIcon[];
|
|
100
|
+
iconStyle: SocialIconStyle;
|
|
101
|
+
iconSize: SocialIconSize;
|
|
102
|
+
spacing: number;
|
|
103
|
+
align: "left" | "center" | "right";
|
|
111
104
|
}
|
|
112
105
|
interface SpacerBlock extends BaseBlock {
|
|
113
|
-
|
|
114
|
-
|
|
106
|
+
type: "spacer";
|
|
107
|
+
height: number;
|
|
115
108
|
}
|
|
116
109
|
interface HtmlBlock extends BaseBlock {
|
|
117
|
-
|
|
118
|
-
|
|
110
|
+
type: "html";
|
|
111
|
+
content: string;
|
|
119
112
|
}
|
|
120
113
|
interface MenuItemData {
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
114
|
+
id: string;
|
|
115
|
+
text: string;
|
|
116
|
+
url: string;
|
|
117
|
+
openInNewTab: boolean;
|
|
118
|
+
bold: boolean;
|
|
119
|
+
underline: boolean;
|
|
120
|
+
color?: string;
|
|
128
121
|
}
|
|
129
122
|
interface MenuBlock extends BaseBlock {
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
123
|
+
type: "menu";
|
|
124
|
+
items: MenuItemData[];
|
|
125
|
+
fontSize: number;
|
|
126
|
+
fontFamily?: string;
|
|
127
|
+
color: string;
|
|
128
|
+
linkColor?: string;
|
|
129
|
+
textAlign: "left" | "center" | "right";
|
|
130
|
+
separator: string;
|
|
131
|
+
separatorColor: string;
|
|
132
|
+
spacing: number;
|
|
140
133
|
}
|
|
141
134
|
interface TableCellData {
|
|
142
|
-
|
|
143
|
-
|
|
135
|
+
id: string;
|
|
136
|
+
content: string;
|
|
144
137
|
}
|
|
145
138
|
interface TableRowData {
|
|
146
|
-
|
|
147
|
-
|
|
139
|
+
id: string;
|
|
140
|
+
cells: TableCellData[];
|
|
148
141
|
}
|
|
149
142
|
interface TableBlock extends BaseBlock {
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
143
|
+
type: "table";
|
|
144
|
+
rows: TableRowData[];
|
|
145
|
+
hasHeaderRow: boolean;
|
|
146
|
+
headerBackgroundColor?: string;
|
|
147
|
+
borderColor: string;
|
|
148
|
+
borderWidth: number;
|
|
149
|
+
cellPadding: number;
|
|
150
|
+
fontSize: number;
|
|
151
|
+
fontFamily?: string;
|
|
152
|
+
color: string;
|
|
153
|
+
textAlign: "left" | "center" | "right";
|
|
161
154
|
}
|
|
162
155
|
interface CountdownBlock extends BaseBlock {
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
156
|
+
type: "countdown";
|
|
157
|
+
targetDate: string;
|
|
158
|
+
timezone: string;
|
|
159
|
+
showDays: boolean;
|
|
160
|
+
showHours: boolean;
|
|
161
|
+
showMinutes: boolean;
|
|
162
|
+
showSeconds: boolean;
|
|
163
|
+
separator: ":" | "-" | " ";
|
|
164
|
+
digitFontSize: number;
|
|
165
|
+
digitColor: string;
|
|
166
|
+
labelColor: string;
|
|
167
|
+
labelFontSize: number;
|
|
168
|
+
backgroundColor: string;
|
|
169
|
+
fontFamily?: string;
|
|
170
|
+
labelDays: string;
|
|
171
|
+
labelHours: string;
|
|
172
|
+
labelMinutes: string;
|
|
173
|
+
labelSeconds: string;
|
|
174
|
+
expiredMessage: string;
|
|
175
|
+
expiredImageUrl: string;
|
|
176
|
+
hideOnExpiry: boolean;
|
|
184
177
|
}
|
|
185
178
|
interface CustomBlock extends BaseBlock {
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
179
|
+
type: "custom";
|
|
180
|
+
customType: string;
|
|
181
|
+
fieldValues: Record<string, unknown>;
|
|
182
|
+
renderedHtml?: string;
|
|
183
|
+
dataSourceFetched?: boolean;
|
|
191
184
|
}
|
|
192
185
|
type Block = SectionBlock | TitleBlock | ParagraphBlock | ImageBlock | ButtonBlock | DividerBlock | VideoBlock | SocialIconsBlock | SpacerBlock | HtmlBlock | MenuBlock | TableBlock | CountdownBlock | CustomBlock;
|
|
193
186
|
type BlockType = Block["type"];
|
|
194
|
-
|
|
187
|
+
//#endregion
|
|
188
|
+
//#region src/guards.d.ts
|
|
195
189
|
declare function isSection(block: Block): block is SectionBlock;
|
|
196
190
|
declare function isTitle(block: Block): block is TitleBlock;
|
|
197
191
|
declare function isParagraph(block: Block): block is ParagraphBlock;
|
|
@@ -206,22 +200,23 @@ declare function isMenu(block: Block): block is MenuBlock;
|
|
|
206
200
|
declare function isTable(block: Block): block is TableBlock;
|
|
207
201
|
declare function isCountdown(block: Block): block is CountdownBlock;
|
|
208
202
|
declare function isCustomBlock(block: Block): block is CustomBlock;
|
|
209
|
-
|
|
203
|
+
//#endregion
|
|
204
|
+
//#region src/defaults.d.ts
|
|
210
205
|
type BlockDefaultsFor<T> = Partial<Omit<T, "id" | "type">>;
|
|
211
206
|
interface BlockDefaults {
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
207
|
+
title?: BlockDefaultsFor<TitleBlock>;
|
|
208
|
+
paragraph?: BlockDefaultsFor<ParagraphBlock>;
|
|
209
|
+
image?: BlockDefaultsFor<ImageBlock>;
|
|
210
|
+
button?: BlockDefaultsFor<ButtonBlock>;
|
|
211
|
+
divider?: BlockDefaultsFor<DividerBlock>;
|
|
212
|
+
section?: BlockDefaultsFor<SectionBlock>;
|
|
213
|
+
video?: BlockDefaultsFor<VideoBlock>;
|
|
214
|
+
social?: BlockDefaultsFor<SocialIconsBlock>;
|
|
215
|
+
spacer?: BlockDefaultsFor<SpacerBlock>;
|
|
216
|
+
html?: BlockDefaultsFor<HtmlBlock>;
|
|
217
|
+
menu?: BlockDefaultsFor<MenuBlock>;
|
|
218
|
+
table?: BlockDefaultsFor<TableBlock>;
|
|
219
|
+
countdown?: BlockDefaultsFor<CountdownBlock>;
|
|
225
220
|
}
|
|
226
221
|
type TemplateDefaults = Partial<TemplateSettings>;
|
|
227
222
|
declare const TITLE_BLOCK_DEFAULTS: BlockDefaultsFor<TitleBlock>;
|
|
@@ -240,95 +235,129 @@ declare const COUNTDOWN_BLOCK_DEFAULTS: BlockDefaultsFor<CountdownBlock>;
|
|
|
240
235
|
declare const DEFAULT_BLOCK_DEFAULTS: Required<BlockDefaults>;
|
|
241
236
|
declare const DEFAULT_TEMPLATE_DEFAULTS: TemplateDefaults;
|
|
242
237
|
declare function deepMergeDefaults<T extends object>(base: T, overrides: Partial<T>): T;
|
|
243
|
-
|
|
238
|
+
//#endregion
|
|
239
|
+
//#region src/template.d.ts
|
|
244
240
|
interface TemplateSettings {
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
241
|
+
width: number;
|
|
242
|
+
backgroundColor: string;
|
|
243
|
+
fontFamily: string;
|
|
244
|
+
preheaderText?: string;
|
|
245
|
+
/**
|
|
246
|
+
* BCP-47 language code for the rendered email's `<html lang>`. Drives
|
|
247
|
+
* screen-reader pronunciation. Default `'en'` via `DEFAULT_TEMPLATE_DEFAULTS`.
|
|
248
|
+
*/
|
|
249
|
+
locale: string;
|
|
254
250
|
}
|
|
255
251
|
interface TemplateContent {
|
|
256
|
-
|
|
257
|
-
|
|
252
|
+
blocks: Block[];
|
|
253
|
+
settings: TemplateSettings;
|
|
258
254
|
}
|
|
259
255
|
declare function createDefaultTemplateContent(defaultFontFamily?: string, templateDefaults?: TemplateDefaults): TemplateContent;
|
|
260
|
-
|
|
261
|
-
|
|
256
|
+
//#endregion
|
|
257
|
+
//#region src/custom-blocks.d.ts
|
|
262
258
|
type CustomBlockFieldType = "text" | "textarea" | "image" | "color" | "number" | "select" | "boolean" | "repeatable";
|
|
263
259
|
interface CustomBlockFieldBase {
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
260
|
+
key: string;
|
|
261
|
+
label: string;
|
|
262
|
+
required?: boolean;
|
|
263
|
+
placeholder?: string;
|
|
264
|
+
readOnly?: boolean;
|
|
269
265
|
}
|
|
270
266
|
interface CustomBlockTextField extends CustomBlockFieldBase {
|
|
271
|
-
|
|
272
|
-
|
|
267
|
+
type: "text";
|
|
268
|
+
default?: string;
|
|
273
269
|
}
|
|
274
270
|
interface CustomBlockTextareaField extends CustomBlockFieldBase {
|
|
275
|
-
|
|
276
|
-
|
|
271
|
+
type: "textarea";
|
|
272
|
+
default?: string;
|
|
277
273
|
}
|
|
278
274
|
interface CustomBlockImageField extends CustomBlockFieldBase {
|
|
279
|
-
|
|
280
|
-
|
|
275
|
+
type: "image";
|
|
276
|
+
default?: string;
|
|
281
277
|
}
|
|
282
278
|
interface CustomBlockColorField extends CustomBlockFieldBase {
|
|
283
|
-
|
|
284
|
-
|
|
279
|
+
type: "color";
|
|
280
|
+
default?: string;
|
|
285
281
|
}
|
|
286
282
|
interface CustomBlockNumberField extends CustomBlockFieldBase {
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
283
|
+
type: "number";
|
|
284
|
+
default?: number;
|
|
285
|
+
min?: number;
|
|
286
|
+
max?: number;
|
|
287
|
+
step?: number;
|
|
292
288
|
}
|
|
293
289
|
interface SelectOption {
|
|
294
|
-
|
|
295
|
-
|
|
290
|
+
label: string;
|
|
291
|
+
value: string;
|
|
296
292
|
}
|
|
297
293
|
interface CustomBlockSelectField extends CustomBlockFieldBase {
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
294
|
+
type: "select";
|
|
295
|
+
options: SelectOption[];
|
|
296
|
+
default?: string;
|
|
301
297
|
}
|
|
302
298
|
interface CustomBlockBooleanField extends CustomBlockFieldBase {
|
|
303
|
-
|
|
304
|
-
|
|
299
|
+
type: "boolean";
|
|
300
|
+
default?: boolean;
|
|
305
301
|
}
|
|
306
302
|
interface CustomBlockRepeatableField extends CustomBlockFieldBase {
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
303
|
+
type: "repeatable";
|
|
304
|
+
fields: Exclude<CustomBlockField, CustomBlockRepeatableField>[];
|
|
305
|
+
default?: Record<string, unknown>[];
|
|
306
|
+
minItems?: number;
|
|
307
|
+
maxItems?: number;
|
|
312
308
|
}
|
|
313
309
|
type CustomBlockField = CustomBlockTextField | CustomBlockTextareaField | CustomBlockImageField | CustomBlockColorField | CustomBlockNumberField | CustomBlockSelectField | CustomBlockBooleanField | CustomBlockRepeatableField;
|
|
314
310
|
interface CustomBlockDefinition {
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
311
|
+
type: string;
|
|
312
|
+
name: string;
|
|
313
|
+
icon?: string;
|
|
314
|
+
description?: string;
|
|
315
|
+
fields: CustomBlockField[];
|
|
316
|
+
template: string;
|
|
317
|
+
dataSource?: DataSourceConfig;
|
|
318
|
+
/**
|
|
319
|
+
* Default block styles applied when a new instance of this custom block is
|
|
320
|
+
* created. Deep-merged over the built-in defaults — only specify the fields
|
|
321
|
+
* you want to override. Controls both the editor canvas wrapper and the
|
|
322
|
+
* rendered MJML/email output.
|
|
323
|
+
*
|
|
324
|
+
* @example
|
|
325
|
+
* defaultStyles: {
|
|
326
|
+
* padding: { top: 0, right: 0, bottom: 0, left: 0 },
|
|
327
|
+
* }
|
|
328
|
+
*/
|
|
329
|
+
defaultStyles?: Partial<BlockStyles>;
|
|
330
|
+
/**
|
|
331
|
+
* Optional CSS rules attached to this custom block definition. Emitted once
|
|
332
|
+
* (deduped across instances) into `<mj-head><mj-style>…</mj-style></mj-head>`
|
|
333
|
+
* in the rendered MJML, and adopted into the editor canvas (shadow root or
|
|
334
|
+
* light-DOM mount) so authored responsive/hover/font behavior previews
|
|
335
|
+
* inside the editor.
|
|
336
|
+
*
|
|
337
|
+
* Use this for media queries, hover states, or any CSS that should apply
|
|
338
|
+
* once per definition rather than per block instance. Class names are not
|
|
339
|
+
* scoped by the SDK — namespace them yourself (e.g. `.tplc-<type>-<el>`) to
|
|
340
|
+
* avoid collisions with other definitions or built-in editor styles.
|
|
341
|
+
*
|
|
342
|
+
* @example
|
|
343
|
+
* stylesheet: `
|
|
344
|
+
* @media (max-width: 480px) {
|
|
345
|
+
* .tplc-image-text-cell { display: block !important; width: 100% !important; }
|
|
346
|
+
* }
|
|
347
|
+
* `
|
|
348
|
+
*/
|
|
349
|
+
stylesheet?: string;
|
|
322
350
|
}
|
|
323
351
|
interface DataSourceFetchContext {
|
|
324
|
-
|
|
325
|
-
|
|
352
|
+
fieldValues: Record<string, unknown>;
|
|
353
|
+
blockId: string;
|
|
326
354
|
}
|
|
327
355
|
interface DataSourceConfig {
|
|
328
|
-
|
|
329
|
-
|
|
356
|
+
label: string;
|
|
357
|
+
onFetch: (context: DataSourceFetchContext) => Promise<Record<string, unknown> | null>;
|
|
330
358
|
}
|
|
331
|
-
|
|
359
|
+
//#endregion
|
|
360
|
+
//#region src/factory.d.ts
|
|
332
361
|
declare function generateId(): string;
|
|
333
362
|
declare function createTitleBlock(partial?: Partial<TitleBlock>): TitleBlock;
|
|
334
363
|
declare function createParagraphBlock(partial?: Partial<ParagraphBlock>): ParagraphBlock;
|
|
@@ -346,114 +375,117 @@ declare function createCountdownBlock(partial?: Partial<CountdownBlock>): Countd
|
|
|
346
375
|
declare function createCustomBlock(definition: CustomBlockDefinition): CustomBlock;
|
|
347
376
|
declare function createBlock(type: BlockType, blockDefaults?: BlockDefaults): Block;
|
|
348
377
|
declare function cloneBlock(block: Block): Block;
|
|
349
|
-
|
|
378
|
+
//#endregion
|
|
379
|
+
//#region src/events.d.ts
|
|
350
380
|
declare class EventEmitter<TEvents extends Record<string, unknown> = Record<string, unknown>> {
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
}
|
|
358
|
-
|
|
359
|
-
|
|
381
|
+
private handlers;
|
|
382
|
+
on<K extends keyof TEvents>(event: K, handler: (data: TEvents[K]) => void): () => void;
|
|
383
|
+
off<K extends keyof TEvents>(event: K, handler: (data: TEvents[K]) => void): void;
|
|
384
|
+
emit<K extends keyof TEvents>(event: K, data: TEvents[K]): void;
|
|
385
|
+
removeAllListeners(event?: keyof TEvents): void;
|
|
386
|
+
listenerCount(event: keyof TEvents): number;
|
|
387
|
+
}
|
|
388
|
+
//#endregion
|
|
389
|
+
//#region src/config.d.ts
|
|
390
|
+
type ViewportSize = "desktop" | "mobile";
|
|
360
391
|
type UiTheme = "light" | "dark" | "auto";
|
|
361
392
|
interface CustomFont {
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
393
|
+
name: string;
|
|
394
|
+
url: string;
|
|
395
|
+
fallback?: string;
|
|
365
396
|
}
|
|
366
397
|
interface FontsConfig {
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
398
|
+
defaultFallback?: string;
|
|
399
|
+
defaultFont?: string;
|
|
400
|
+
customFonts?: CustomFont[];
|
|
370
401
|
}
|
|
371
402
|
interface ExportResult {
|
|
372
|
-
|
|
373
|
-
|
|
403
|
+
html: string;
|
|
404
|
+
mjml: string;
|
|
374
405
|
}
|
|
375
406
|
interface MergeTag {
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
407
|
+
label: string;
|
|
408
|
+
value: string;
|
|
409
|
+
/**
|
|
410
|
+
* Optional grouping label used by the built-in merge tag picker to
|
|
411
|
+
* section the list. When no tag in the configured array carries
|
|
412
|
+
* `group`, the picker renders a plain flat list with no headers.
|
|
413
|
+
* Ignored by the renderer and by typing-autocomplete.
|
|
414
|
+
*/
|
|
415
|
+
group?: string;
|
|
416
|
+
/**
|
|
417
|
+
* Optional helper text shown beneath the tag in the built-in merge
|
|
418
|
+
* tag picker. Not rendered anywhere else (toolbar, autocomplete,
|
|
419
|
+
* MJML output) and not stored on the inserted document node.
|
|
420
|
+
*/
|
|
421
|
+
description?: string;
|
|
391
422
|
}
|
|
392
423
|
interface MediaResult {
|
|
393
|
-
|
|
394
|
-
|
|
424
|
+
url: string;
|
|
425
|
+
alt?: string;
|
|
395
426
|
}
|
|
396
427
|
interface MergeTagsConfig {
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
428
|
+
syntax?: SyntaxPresetName | SyntaxPreset;
|
|
429
|
+
tags?: MergeTag[];
|
|
430
|
+
onRequest?: () => Promise<MergeTag | null>;
|
|
431
|
+
/**
|
|
432
|
+
* Enables typing-based autocomplete in rich text fields. When the user
|
|
433
|
+
* types the syntax opener (e.g. `{{`), a popup lists matching `tags`.
|
|
434
|
+
*
|
|
435
|
+
* Defaults to `true`. Effective only when `tags` is non-empty AND
|
|
436
|
+
* `syntax` matches a built-in preset (custom regex syntaxes cannot be
|
|
437
|
+
* mapped to a trigger string and silently disable autocomplete).
|
|
438
|
+
*/
|
|
439
|
+
autocomplete?: boolean;
|
|
409
440
|
}
|
|
410
441
|
interface DisplayCondition {
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
442
|
+
label: string;
|
|
443
|
+
before: string;
|
|
444
|
+
after: string;
|
|
445
|
+
group?: string;
|
|
446
|
+
description?: string;
|
|
416
447
|
}
|
|
417
448
|
interface DisplayConditionsConfig {
|
|
418
|
-
|
|
419
|
-
|
|
449
|
+
conditions: DisplayCondition[];
|
|
450
|
+
allowCustom?: boolean;
|
|
420
451
|
}
|
|
421
452
|
interface ThemeOverrides {
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
453
|
+
bg?: string;
|
|
454
|
+
bgElevated?: string;
|
|
455
|
+
bgHover?: string;
|
|
456
|
+
bgActive?: string;
|
|
457
|
+
border?: string;
|
|
458
|
+
borderLight?: string;
|
|
459
|
+
text?: string;
|
|
460
|
+
textMuted?: string;
|
|
461
|
+
textDim?: string;
|
|
462
|
+
primary?: string;
|
|
463
|
+
primaryHover?: string;
|
|
464
|
+
primaryLight?: string;
|
|
465
|
+
secondary?: string;
|
|
466
|
+
secondaryHover?: string;
|
|
467
|
+
secondaryLight?: string;
|
|
468
|
+
success?: string;
|
|
469
|
+
successLight?: string;
|
|
470
|
+
warning?: string;
|
|
471
|
+
warningLight?: string;
|
|
472
|
+
danger?: string;
|
|
473
|
+
dangerLight?: string;
|
|
474
|
+
canvasBg?: string;
|
|
475
|
+
dark?: Omit<ThemeOverrides, "dark">;
|
|
445
476
|
}
|
|
446
477
|
declare class SdkError extends Error {
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
}
|
|
453
|
-
|
|
478
|
+
readonly statusCode?: number | undefined;
|
|
479
|
+
constructor(message: string, statusCode?: number | undefined);
|
|
480
|
+
get isNotFound(): boolean;
|
|
481
|
+
get isUnauthorized(): boolean;
|
|
482
|
+
get isServerError(): boolean;
|
|
483
|
+
}
|
|
484
|
+
//#endregion
|
|
485
|
+
//#region src/merge-tags.d.ts
|
|
454
486
|
interface SyntaxPreset {
|
|
455
|
-
|
|
456
|
-
|
|
487
|
+
value: RegExp;
|
|
488
|
+
logic: RegExp;
|
|
457
489
|
}
|
|
458
490
|
type SyntaxPresetName = "liquid" | "handlebars" | "mailchimp" | "ampscript";
|
|
459
491
|
declare const SYNTAX_PRESETS: Record<SyntaxPresetName, SyntaxPreset>;
|
|
@@ -472,331 +504,334 @@ declare function restoreMergeTagMarkup(html: string, mergeTags: MergeTag[], synt
|
|
|
472
504
|
declare function isLogicMergeTagValue(value: string, syntax: SyntaxPreset): boolean;
|
|
473
505
|
declare function getLogicMergeTagKeyword(value: string, syntax: SyntaxPreset): string;
|
|
474
506
|
declare function resolveHtmlLogicMergeTagLabels(html: string, syntax: SyntaxPreset): string;
|
|
475
|
-
|
|
507
|
+
//#endregion
|
|
508
|
+
//#region ../media-library/src/types.d.ts
|
|
476
509
|
type MediaCategory = "images" | "documents" | "videos" | "audio";
|
|
477
510
|
interface MediaItem {
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
511
|
+
id: string;
|
|
512
|
+
filename: string;
|
|
513
|
+
mime_type: string;
|
|
514
|
+
size: number;
|
|
515
|
+
url: string;
|
|
516
|
+
small_url: string | null;
|
|
517
|
+
medium_url: string | null;
|
|
518
|
+
large_url: string | null;
|
|
519
|
+
folder_id: string | null;
|
|
520
|
+
conversions_generated: boolean;
|
|
521
|
+
width: number | null;
|
|
522
|
+
height: number | null;
|
|
523
|
+
alt_text: string;
|
|
524
|
+
created_at: string;
|
|
525
|
+
updated_at: string;
|
|
493
526
|
}
|
|
494
527
|
interface MediaRequestContext {
|
|
495
|
-
|
|
528
|
+
accept?: MediaCategory[];
|
|
496
529
|
}
|
|
497
530
|
interface StorageInfo {
|
|
498
|
-
|
|
499
|
-
|
|
531
|
+
used_bytes: number;
|
|
532
|
+
limit_bytes: number;
|
|
500
533
|
}
|
|
501
534
|
interface MediaCategoryData {
|
|
502
|
-
|
|
503
|
-
|
|
535
|
+
mime_types: string[];
|
|
536
|
+
extensions: string[];
|
|
504
537
|
}
|
|
505
538
|
interface MediaConfig {
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
539
|
+
use_media_library: boolean;
|
|
540
|
+
categories: Record<string, MediaCategoryData>;
|
|
541
|
+
max_file_size: number;
|
|
509
542
|
}
|
|
510
|
-
|
|
543
|
+
//#endregion
|
|
544
|
+
//#region src/cloud.d.ts
|
|
511
545
|
interface Template {
|
|
512
|
-
|
|
513
|
-
|
|
546
|
+
id: string;
|
|
547
|
+
content: TemplateContent;
|
|
514
548
|
}
|
|
515
549
|
interface TemplateSnapshot {
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
550
|
+
id: string;
|
|
551
|
+
template_id: string;
|
|
552
|
+
content: TemplateContent;
|
|
553
|
+
is_autosave: boolean;
|
|
554
|
+
created_at: string;
|
|
521
555
|
}
|
|
522
556
|
interface Comment {
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
557
|
+
id: string;
|
|
558
|
+
template_id: string;
|
|
559
|
+
block_id: string | null;
|
|
560
|
+
parent_id: string | null;
|
|
561
|
+
body: string;
|
|
562
|
+
author_identifier: string;
|
|
563
|
+
author_name: string;
|
|
564
|
+
resolved_at: string | null;
|
|
565
|
+
resolved_by_identifier: string | null;
|
|
566
|
+
resolved_by_name: string | null;
|
|
567
|
+
created_at: string;
|
|
568
|
+
updated_at: string;
|
|
569
|
+
replies: Comment[];
|
|
536
570
|
}
|
|
537
571
|
type CommentThread = Comment;
|
|
538
572
|
type CommentEventType = "created" | "updated" | "deleted" | "resolved" | "unresolved";
|
|
539
573
|
interface CommentEvent {
|
|
540
|
-
|
|
541
|
-
|
|
574
|
+
type: CommentEventType;
|
|
575
|
+
comment: Comment;
|
|
542
576
|
}
|
|
543
577
|
interface SavedModule {
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
578
|
+
id: string;
|
|
579
|
+
name: string;
|
|
580
|
+
content: Block[];
|
|
581
|
+
created_at: string;
|
|
582
|
+
updated_at: string;
|
|
549
583
|
}
|
|
550
584
|
type FindingSeverity = "high" | "medium" | "low";
|
|
551
585
|
type ScoringCategory = "spam" | "readability" | "accessibility" | "bestPractices";
|
|
552
586
|
interface ScoringFinding {
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
587
|
+
id: string;
|
|
588
|
+
severity: FindingSeverity;
|
|
589
|
+
message: string;
|
|
590
|
+
blockId: string | null;
|
|
591
|
+
category: ScoringCategory;
|
|
592
|
+
suggestion: string;
|
|
559
593
|
}
|
|
560
594
|
interface CategoryScore {
|
|
561
|
-
|
|
562
|
-
|
|
595
|
+
score: number;
|
|
596
|
+
findings: ScoringFinding[];
|
|
563
597
|
}
|
|
564
598
|
interface ScoringResult {
|
|
565
|
-
|
|
566
|
-
|
|
599
|
+
score: number;
|
|
600
|
+
categories: Record<ScoringCategory, CategoryScore>;
|
|
567
601
|
}
|
|
568
602
|
interface HealthCheckResult {
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
603
|
+
api: {
|
|
604
|
+
ok: boolean;
|
|
605
|
+
latency: number;
|
|
606
|
+
};
|
|
607
|
+
websocket: {
|
|
608
|
+
ok: boolean;
|
|
609
|
+
error?: string;
|
|
610
|
+
};
|
|
611
|
+
auth: {
|
|
612
|
+
ok: boolean;
|
|
613
|
+
error?: string;
|
|
614
|
+
};
|
|
615
|
+
overall: boolean;
|
|
582
616
|
}
|
|
583
617
|
interface TokenData {
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
618
|
+
token: string;
|
|
619
|
+
expires_at: number;
|
|
620
|
+
project_id: string;
|
|
621
|
+
tenant: string;
|
|
622
|
+
test_email?: {
|
|
623
|
+
allowed_emails: string[];
|
|
624
|
+
signature: string;
|
|
625
|
+
};
|
|
626
|
+
user?: {
|
|
627
|
+
id: string;
|
|
628
|
+
name: string;
|
|
629
|
+
signature: string;
|
|
630
|
+
};
|
|
597
631
|
}
|
|
598
632
|
interface AuthRequestOptions {
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
633
|
+
method?: "GET" | "POST";
|
|
634
|
+
headers?: Record<string, string>;
|
|
635
|
+
body?: Record<string, unknown>;
|
|
636
|
+
credentials?: RequestCredentials;
|
|
603
637
|
}
|
|
604
638
|
interface AuthConfig {
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
639
|
+
url: string;
|
|
640
|
+
baseUrl?: string;
|
|
641
|
+
requestOptions?: AuthRequestOptions;
|
|
642
|
+
onError?: (error: Error) => void;
|
|
609
643
|
}
|
|
610
644
|
interface TestEmailConfig {
|
|
611
|
-
|
|
612
|
-
|
|
645
|
+
allowedEmails: string[];
|
|
646
|
+
signature: string;
|
|
613
647
|
}
|
|
614
648
|
interface UserConfig {
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
649
|
+
id: string;
|
|
650
|
+
name: string;
|
|
651
|
+
signature: string;
|
|
618
652
|
}
|
|
619
653
|
interface DirectAuthConfig {
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
654
|
+
mode: "direct";
|
|
655
|
+
clientId: string;
|
|
656
|
+
clientSecret: string;
|
|
657
|
+
tenant: string;
|
|
658
|
+
baseUrl?: string;
|
|
625
659
|
}
|
|
626
660
|
interface ProxyAuthConfig {
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
661
|
+
mode: "proxy";
|
|
662
|
+
url: string;
|
|
663
|
+
baseUrl?: string;
|
|
664
|
+
requestOptions?: AuthRequestOptions;
|
|
631
665
|
}
|
|
632
666
|
type SdkAuthConfig = DirectAuthConfig | ProxyAuthConfig;
|
|
633
667
|
interface Collaborator {
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
668
|
+
id: string;
|
|
669
|
+
name: string;
|
|
670
|
+
color: string;
|
|
671
|
+
selectedBlockId: string | null;
|
|
638
672
|
}
|
|
639
673
|
type McpOperation = "add_block" | "update_block" | "delete_block" | "move_block" | "update_settings" | "set_content" | "update_block_style";
|
|
640
674
|
interface McpOperationPayload {
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
675
|
+
operation: McpOperation;
|
|
676
|
+
data: Record<string, unknown>;
|
|
677
|
+
timestamp: number;
|
|
644
678
|
}
|
|
645
679
|
interface SaveResult {
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
680
|
+
templateId: string;
|
|
681
|
+
html: string;
|
|
682
|
+
mjml: string;
|
|
683
|
+
content: TemplateContent;
|
|
650
684
|
}
|
|
651
685
|
interface AiConfig {
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
686
|
+
chat?: boolean;
|
|
687
|
+
scoring?: boolean;
|
|
688
|
+
designToTemplate?: boolean;
|
|
689
|
+
rewrite?: boolean;
|
|
656
690
|
}
|
|
657
691
|
interface McpConfig {
|
|
658
|
-
|
|
659
|
-
|
|
692
|
+
enabled: boolean;
|
|
693
|
+
onOperation?: (payload: McpOperationPayload) => void;
|
|
660
694
|
}
|
|
661
695
|
interface CollaborationConfig {
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
696
|
+
enabled: boolean;
|
|
697
|
+
onCollaboratorJoined?: (collaborator: Collaborator) => void;
|
|
698
|
+
onCollaboratorLeft?: (collaborator: Collaborator) => void;
|
|
699
|
+
onBlockLocked?: (event: {
|
|
700
|
+
blockId: string;
|
|
701
|
+
collaborator: Collaborator;
|
|
702
|
+
}) => void;
|
|
703
|
+
onBlockUnlocked?: (event: {
|
|
704
|
+
blockId: string;
|
|
705
|
+
collaborator: Collaborator;
|
|
706
|
+
}) => void;
|
|
673
707
|
}
|
|
674
708
|
interface WebSocketServerConfig {
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
709
|
+
host: string;
|
|
710
|
+
port: number;
|
|
711
|
+
app_key: string;
|
|
678
712
|
}
|
|
679
713
|
interface TemplaticalConfig {
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
714
|
+
container: string | HTMLElement;
|
|
715
|
+
auth: Omit<AuthConfig, "onError">;
|
|
716
|
+
baseUrl?: string;
|
|
717
|
+
theme?: ThemeOverrides;
|
|
718
|
+
locale?: string;
|
|
719
|
+
ai?: AiConfig | false;
|
|
720
|
+
onCreate?: (template: Template) => void;
|
|
721
|
+
onLoad?: (template: Template) => void;
|
|
722
|
+
onSave?: (result: SaveResult) => void;
|
|
723
|
+
onError?: (error: Error) => void;
|
|
724
|
+
onUnmount?: () => void;
|
|
725
|
+
mergeTags?: MergeTagsConfig;
|
|
726
|
+
onRequestMedia?: (context: MediaRequestContext) => Promise<MediaItem | null>;
|
|
727
|
+
displayConditions?: DisplayConditionsConfig;
|
|
728
|
+
fonts?: FontsConfig;
|
|
729
|
+
autoSave?: boolean;
|
|
730
|
+
autoSaveDebounce?: number;
|
|
731
|
+
onBeforeTestEmail?: (html: string) => string | Promise<string>;
|
|
732
|
+
customBlocks?: CustomBlockDefinition[];
|
|
733
|
+
commenting?: boolean;
|
|
734
|
+
onComment?: (event: CommentEvent) => void;
|
|
735
|
+
mcp?: McpConfig;
|
|
736
|
+
collaboration?: CollaborationConfig;
|
|
737
|
+
modules?: boolean;
|
|
704
738
|
}
|
|
705
739
|
interface TemplaticalInstance {
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
740
|
+
setTheme(theme: ThemeOverrides): void;
|
|
741
|
+
create(content?: TemplateContent): Promise<Template>;
|
|
742
|
+
load(templateId: string): Promise<Template>;
|
|
743
|
+
save(): Promise<SaveResult>;
|
|
744
|
+
unmount(): void;
|
|
711
745
|
}
|
|
712
746
|
interface EditorState {
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
747
|
+
template: Template | null;
|
|
748
|
+
content: TemplateContent;
|
|
749
|
+
selectedBlockId: string | null;
|
|
750
|
+
viewport: ViewportSize;
|
|
751
|
+
darkMode: boolean;
|
|
752
|
+
previewMode: boolean;
|
|
753
|
+
isDirty: boolean;
|
|
754
|
+
isSaving: boolean;
|
|
755
|
+
isLoading: boolean;
|
|
756
|
+
uiTheme: UiTheme;
|
|
723
757
|
}
|
|
724
758
|
interface ApiResponse<T> {
|
|
725
|
-
|
|
759
|
+
data: T;
|
|
726
760
|
}
|
|
727
761
|
interface ApiError {
|
|
728
|
-
|
|
729
|
-
|
|
762
|
+
message: string;
|
|
763
|
+
errors?: Record<string, string[]>;
|
|
730
764
|
}
|
|
731
765
|
interface PlanFeatures {
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
766
|
+
media_folders: boolean;
|
|
767
|
+
import_from_url: boolean;
|
|
768
|
+
auto_save: boolean;
|
|
769
|
+
custom_fonts: boolean;
|
|
770
|
+
theme_customization: boolean;
|
|
771
|
+
html_block: boolean;
|
|
772
|
+
export_mjml: boolean;
|
|
773
|
+
white_label: boolean;
|
|
774
|
+
test_email: boolean;
|
|
775
|
+
ai_generation: boolean;
|
|
776
|
+
custom_blocks: boolean;
|
|
777
|
+
commenting: boolean;
|
|
778
|
+
collaboration: boolean;
|
|
779
|
+
saved_modules: boolean;
|
|
780
|
+
headless_sdk: boolean;
|
|
781
|
+
pluggable_media: boolean;
|
|
748
782
|
}
|
|
749
783
|
interface PlanLimits {
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
784
|
+
max_file_size_mb: number;
|
|
785
|
+
max_templates: number | null;
|
|
786
|
+
media_categories: string[];
|
|
787
|
+
storage_limit_bytes: number;
|
|
754
788
|
}
|
|
755
789
|
interface PlanConfig {
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
790
|
+
features: PlanFeatures;
|
|
791
|
+
limits: PlanLimits;
|
|
792
|
+
template_count: number;
|
|
793
|
+
plan: string;
|
|
794
|
+
media: MediaConfig;
|
|
795
|
+
storage: StorageInfo;
|
|
796
|
+
websocket: WebSocketServerConfig;
|
|
797
|
+
accessibility?: {
|
|
798
|
+
blockOnError?: boolean;
|
|
799
|
+
};
|
|
766
800
|
}
|
|
767
801
|
interface AiChatMessage {
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
802
|
+
id: string;
|
|
803
|
+
role: "user" | "assistant";
|
|
804
|
+
content: string;
|
|
805
|
+
timestamp: number;
|
|
772
806
|
}
|
|
773
807
|
interface CreateCommentData {
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
808
|
+
body: string;
|
|
809
|
+
blockId?: string;
|
|
810
|
+
parentId?: string;
|
|
811
|
+
authorIdentifier: string;
|
|
812
|
+
authorName: string;
|
|
779
813
|
}
|
|
780
814
|
interface UpdateCommentData {
|
|
781
|
-
|
|
815
|
+
body: string;
|
|
782
816
|
}
|
|
783
817
|
interface AiGenerateOptions {
|
|
784
|
-
|
|
818
|
+
conversationId?: string;
|
|
785
819
|
}
|
|
786
820
|
interface AiStreamEvent {
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
821
|
+
type: "text" | "done" | "error";
|
|
822
|
+
text?: string;
|
|
823
|
+
content?: TemplateContent;
|
|
824
|
+
conversationId?: string;
|
|
825
|
+
error?: string;
|
|
792
826
|
}
|
|
793
827
|
interface RewriteData {
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
828
|
+
text: string;
|
|
829
|
+
instruction: string;
|
|
830
|
+
blockId: string;
|
|
797
831
|
}
|
|
798
832
|
interface AiScoreOptions {
|
|
799
|
-
|
|
833
|
+
fixFindingId?: string;
|
|
800
834
|
}
|
|
801
|
-
|
|
802
|
-
export { type AiChatMessage, type AiConfig, type AiGenerateOptions, type AiScoreOptions, type AiStreamEvent, type ApiError, type ApiResponse, type AuthConfig, type AuthRequestOptions, BUTTON_BLOCK_DEFAULTS, type BaseBlock, type Block, type BlockDefaults, type BlockStyles, type BlockType, type BlockVisibility, type ButtonBlock, COUNTDOWN_BLOCK_DEFAULTS, type CategoryScore, type CollaborationConfig, type Collaborator, type ColumnLayout, type Comment, type CommentEvent, type CommentEventType, type CommentThread, type CountdownBlock, type CreateCommentData, type CustomBlock, type CustomBlockBooleanField, type CustomBlockColorField, type CustomBlockDefinition, type CustomBlockField, type CustomBlockFieldBase, type CustomBlockFieldType, type CustomBlockImageField, type CustomBlockNumberField, type CustomBlockRepeatableField, type CustomBlockSelectField, type CustomBlockTextField, type CustomBlockTextareaField, type CustomFont, DEFAULT_BLOCK_DEFAULTS, DEFAULT_TEMPLATE_DEFAULTS, DIVIDER_BLOCK_DEFAULTS, type DataSourceConfig, type DataSourceFetchContext, type DirectAuthConfig, type DisplayCondition, type DisplayConditionsConfig, type DividerBlock, type EditorState, EventEmitter, type ExportResult, type FindingSeverity, type FontsConfig, HEADING_LEVEL_FONT_SIZE, HTML_BLOCK_DEFAULTS, type HeadingLevel, type HealthCheckResult, type HtmlBlock, IMAGE_BLOCK_DEFAULTS, type ImageBlock, MENU_BLOCK_DEFAULTS, type McpConfig, type McpOperation, type McpOperationPayload, type MediaResult, type MenuBlock, type MenuItemData, type MergeTag, type MergeTagsConfig, PARAGRAPH_BLOCK_DEFAULTS, type ParagraphBlock, type PlanConfig, type PlanFeatures, type PlanLimits, type ProxyAuthConfig, type
|
|
835
|
+
//#endregion
|
|
836
|
+
export { type AiChatMessage, type AiConfig, type AiGenerateOptions, type AiScoreOptions, type AiStreamEvent, type ApiError, type ApiResponse, type AuthConfig, type AuthRequestOptions, BUTTON_BLOCK_DEFAULTS, type BaseBlock, type Block, type BlockDefaults, type BlockStyles, type BlockType, type BlockVisibility, type ButtonBlock, COUNTDOWN_BLOCK_DEFAULTS, type CategoryScore, type CollaborationConfig, type Collaborator, type ColumnLayout, type Comment, type CommentEvent, type CommentEventType, type CommentThread, type CountdownBlock, type CreateCommentData, type CustomBlock, type CustomBlockBooleanField, type CustomBlockColorField, type CustomBlockDefinition, type CustomBlockField, type CustomBlockFieldBase, type CustomBlockFieldType, type CustomBlockImageField, type CustomBlockNumberField, type CustomBlockRepeatableField, type CustomBlockSelectField, type CustomBlockTextField, type CustomBlockTextareaField, type CustomFont, DEFAULT_BLOCK_DEFAULTS, DEFAULT_TEMPLATE_DEFAULTS, DIVIDER_BLOCK_DEFAULTS, type DataSourceConfig, type DataSourceFetchContext, type DirectAuthConfig, type DisplayCondition, type DisplayConditionsConfig, type DividerBlock, type EditorState, EventEmitter, type ExportResult, type FindingSeverity, type FontsConfig, HEADING_LEVEL_FONT_SIZE, HTML_BLOCK_DEFAULTS, type HeadingLevel, type HealthCheckResult, type HtmlBlock, IMAGE_BLOCK_DEFAULTS, type ImageBlock, MENU_BLOCK_DEFAULTS, type McpConfig, type McpOperation, type McpOperationPayload, type MediaResult, type MenuBlock, type MenuItemData, type MergeTag, type MergeTagsConfig, PARAGRAPH_BLOCK_DEFAULTS, type ParagraphBlock, type PlanConfig, type PlanFeatures, type PlanLimits, type ProxyAuthConfig, type RewriteData, SECTION_BLOCK_DEFAULTS, SOCIAL_ICONS_BLOCK_DEFAULTS, SPACER_BLOCK_DEFAULTS, SYNTAX_PRESETS, type SaveResult, type SavedModule, type ScoringCategory, type ScoringFinding, type ScoringResult, type SdkAuthConfig, SdkError, type SectionBlock, type SelectOption, type SocialIcon, type SocialIconSize, type SocialIconStyle, type SocialIconsBlock, type SocialPlatform, type SpacerBlock, type SpacingValue, type SyntaxPreset, type SyntaxPresetName, TABLE_BLOCK_DEFAULTS, TITLE_BLOCK_DEFAULTS, type TableBlock, type TableCellData, type TableRowData, type Template, type TemplateContent, type TemplateDefaults, type TemplateSettings, type TemplateSnapshot, type TemplaticalConfig, type TemplaticalInstance, type TestEmailConfig, type ThemeOverrides, type TitleBlock, type TokenData, type UiTheme, type UpdateCommentData, type UserConfig, VIDEO_BLOCK_DEFAULTS, type VideoBlock, type ViewportSize, type WebSocketServerConfig, cloneBlock, containsMergeTag, createBlock, createButtonBlock, createCountdownBlock, createCustomBlock, createDefaultTemplateContent, createDividerBlock, createHtmlBlock, createImageBlock, createMenuBlock, createParagraphBlock, createSectionBlock, createSocialIconsBlock, createSpacerBlock, createTableBlock, createTitleBlock, createVideoBlock, deepMergeDefaults, generateId, getLogicMergeTagKeyword, getMergeTagLabel, getSyntaxTriggerChar, isButton, isCountdown, isCustomBlock, isDivider, isHtml, isImage, isLogicMergeTagValue, isMenu, isMergeTagValue, isParagraph, isSection, isSocialIcons, isSpacer, isTable, isTitle, isVideo, resolveHtmlLogicMergeTagLabels, resolveHtmlMergeTagLabels, resolveSyntax, restoreMergeTagMarkup };
|
|
837
|
+
//# sourceMappingURL=index.d.ts.map
|