better-react-email-editor 0.1.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/LICENSE +21 -0
- package/README.md +381 -0
- package/dist/index.cjs +2 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.js +4190 -0
- package/dist/index.js.map +1 -0
- package/dist/styles.css +1634 -0
- package/dist/types/components/BetterEmailEditor.d.ts +34 -0
- package/dist/types/components/BlockProperties.d.ts +7 -0
- package/dist/types/components/BlocksTab.d.ts +13 -0
- package/dist/types/components/BodyTab.d.ts +9 -0
- package/dist/types/components/Canvas.d.ts +15 -0
- package/dist/types/components/CanvasOverlay.d.ts +10 -0
- package/dist/types/components/ContentPanel.d.ts +19 -0
- package/dist/types/components/ContentTab.d.ts +17 -0
- package/dist/types/components/LayersPanel.d.ts +9 -0
- package/dist/types/components/PreviewDialog.d.ts +15 -0
- package/dist/types/components/PropertiesPanel.d.ts +12 -0
- package/dist/types/components/Sidebar.d.ts +14 -0
- package/dist/types/components/TextProperties.d.ts +7 -0
- package/dist/types/components/TopBar.d.ts +37 -0
- package/dist/types/components/fields.d.ts +103 -0
- package/dist/types/components/icons.d.ts +21 -0
- package/dist/types/components/inspectors/ButtonInspector.d.ts +2 -0
- package/dist/types/components/inspectors/ColumnsInspector.d.ts +3 -0
- package/dist/types/components/inspectors/DefaultInspector.d.ts +3 -0
- package/dist/types/components/inspectors/HeadingInspector.d.ts +2 -0
- package/dist/types/components/inspectors/ImageInspector.d.ts +2 -0
- package/dist/types/components/inspectors/SimpleInspectors.d.ts +6 -0
- package/dist/types/components/inspectors/SocialLinksInspector.d.ts +2 -0
- package/dist/types/components/inspectors/groups.d.ts +22 -0
- package/dist/types/components/useDraggableBlock.d.ts +17 -0
- package/dist/types/context.d.ts +115 -0
- package/dist/types/core/content.d.ts +28 -0
- package/dist/types/core/cx.d.ts +8 -0
- package/dist/types/core/dnd.d.ts +73 -0
- package/dist/types/core/layers.d.ts +27 -0
- package/dist/types/core/paste-handler.d.ts +9 -0
- package/dist/types/core/paste.d.ts +22 -0
- package/dist/types/core/stores.d.ts +19 -0
- package/dist/types/core/style-utils.d.ts +3 -0
- package/dist/types/i18n/en.d.ts +247 -0
- package/dist/types/i18n/fr.d.ts +3 -0
- package/dist/types/i18n/index.d.ts +509 -0
- package/dist/types/index.d.ts +37 -0
- package/dist/types/nodes/custom-nodes.d.ts +19 -0
- package/dist/types/registry/default-nodes.d.ts +7 -0
- package/dist/types/registry/default-palette.d.ts +7 -0
- package/dist/types/registry/default-templates.d.ts +10 -0
- package/dist/types/registry/types.d.ts +56 -0
- package/package.json +89 -0
|
@@ -0,0 +1,509 @@
|
|
|
1
|
+
import { en, type Messages } from './en';
|
|
2
|
+
import { fr } from './fr';
|
|
3
|
+
export { en, fr, type Messages };
|
|
4
|
+
/** Built-in locales. Pass your own `messages` to support any other language. */
|
|
5
|
+
export declare const locales: {
|
|
6
|
+
readonly en: {
|
|
7
|
+
topBar: {
|
|
8
|
+
layers: string;
|
|
9
|
+
toggleLayers: string;
|
|
10
|
+
undo: string;
|
|
11
|
+
redo: string;
|
|
12
|
+
canvasWidth: string;
|
|
13
|
+
desktop: string;
|
|
14
|
+
mobile: string;
|
|
15
|
+
template: string;
|
|
16
|
+
confirmTemplate: string;
|
|
17
|
+
import: string;
|
|
18
|
+
exportJson: string;
|
|
19
|
+
preview: string;
|
|
20
|
+
exportHtml: string;
|
|
21
|
+
invalidFile: (message: string) => string;
|
|
22
|
+
};
|
|
23
|
+
preview: {
|
|
24
|
+
dialogLabel: string;
|
|
25
|
+
desktop: string;
|
|
26
|
+
mobile: string;
|
|
27
|
+
html: string;
|
|
28
|
+
text: string;
|
|
29
|
+
copy: string;
|
|
30
|
+
copied: string;
|
|
31
|
+
download: string;
|
|
32
|
+
close: string;
|
|
33
|
+
rendering: string;
|
|
34
|
+
renderError: (message: string) => string;
|
|
35
|
+
iframeTitle: string;
|
|
36
|
+
};
|
|
37
|
+
sidebar: {
|
|
38
|
+
label: string;
|
|
39
|
+
tabContent: string;
|
|
40
|
+
tabBlocks: string;
|
|
41
|
+
tabBody: string;
|
|
42
|
+
layoutTitle: string;
|
|
43
|
+
contentTitle: string;
|
|
44
|
+
dragHint: string;
|
|
45
|
+
tileTitle: (label: string) => string;
|
|
46
|
+
propertiesEyebrow: string;
|
|
47
|
+
closeProperties: string;
|
|
48
|
+
breadcrumb: string;
|
|
49
|
+
selectedText: string;
|
|
50
|
+
};
|
|
51
|
+
body: {
|
|
52
|
+
general: string;
|
|
53
|
+
previewText: string;
|
|
54
|
+
previewTextPlaceholder: string;
|
|
55
|
+
background: string;
|
|
56
|
+
backgroundColor: string;
|
|
57
|
+
outerPadding: string;
|
|
58
|
+
content: string;
|
|
59
|
+
width: string;
|
|
60
|
+
contentColor: string;
|
|
61
|
+
innerPadding: string;
|
|
62
|
+
radius: string;
|
|
63
|
+
defaultStyles: string;
|
|
64
|
+
text: string;
|
|
65
|
+
headings: string;
|
|
66
|
+
links: string;
|
|
67
|
+
buttonBackground: string;
|
|
68
|
+
buttonText: string;
|
|
69
|
+
};
|
|
70
|
+
inspector: {
|
|
71
|
+
typography: string;
|
|
72
|
+
color: string;
|
|
73
|
+
size: string;
|
|
74
|
+
weight: string;
|
|
75
|
+
weightLight: string;
|
|
76
|
+
weightNormal: string;
|
|
77
|
+
weightSemibold: string;
|
|
78
|
+
weightBold: string;
|
|
79
|
+
weightExtrabold: string;
|
|
80
|
+
lineHeight: string;
|
|
81
|
+
alignment: string;
|
|
82
|
+
spacing: string;
|
|
83
|
+
padding: string;
|
|
84
|
+
box: string;
|
|
85
|
+
backgroundColor: string;
|
|
86
|
+
radius: string;
|
|
87
|
+
border: string;
|
|
88
|
+
borderColor: string;
|
|
89
|
+
image: string;
|
|
90
|
+
uploadImage: string;
|
|
91
|
+
imageUrl: string;
|
|
92
|
+
altText: string;
|
|
93
|
+
altPlaceholder: string;
|
|
94
|
+
layout: string;
|
|
95
|
+
autoWidth: string;
|
|
96
|
+
width: string;
|
|
97
|
+
action: string;
|
|
98
|
+
clickLink: string;
|
|
99
|
+
linkUrl: string;
|
|
100
|
+
button: string;
|
|
101
|
+
textColor: string;
|
|
102
|
+
textSize: string;
|
|
103
|
+
buttonPadding: string;
|
|
104
|
+
networks: string;
|
|
105
|
+
removeNetwork: string;
|
|
106
|
+
addNetwork: string;
|
|
107
|
+
appearance: string;
|
|
108
|
+
iconSize: string;
|
|
109
|
+
gap: string;
|
|
110
|
+
columns: string;
|
|
111
|
+
distribution: string;
|
|
112
|
+
equal: string;
|
|
113
|
+
columnGap: string;
|
|
114
|
+
columnsHint: string;
|
|
115
|
+
spacer: string;
|
|
116
|
+
height: string;
|
|
117
|
+
htmlCode: string;
|
|
118
|
+
htmlHint: string;
|
|
119
|
+
line: string;
|
|
120
|
+
thickness: string;
|
|
121
|
+
lineStyle: string;
|
|
122
|
+
heading: string;
|
|
123
|
+
level: string;
|
|
124
|
+
formatting: string;
|
|
125
|
+
bold: string;
|
|
126
|
+
italic: string;
|
|
127
|
+
underline: string;
|
|
128
|
+
strike: string;
|
|
129
|
+
link: string;
|
|
130
|
+
url: string;
|
|
131
|
+
linkColor: string;
|
|
132
|
+
};
|
|
133
|
+
fields: {
|
|
134
|
+
colorDefault: string;
|
|
135
|
+
chooseColor: (value: string) => string;
|
|
136
|
+
hexCode: string;
|
|
137
|
+
eyedropper: string;
|
|
138
|
+
documentColors: string;
|
|
139
|
+
palette: string;
|
|
140
|
+
resetColor: string;
|
|
141
|
+
alignLeft: string;
|
|
142
|
+
alignCenter: string;
|
|
143
|
+
alignRight: string;
|
|
144
|
+
top: string;
|
|
145
|
+
right: string;
|
|
146
|
+
bottom: string;
|
|
147
|
+
left: string;
|
|
148
|
+
moreOptions: string;
|
|
149
|
+
auto: string;
|
|
150
|
+
};
|
|
151
|
+
layers: {
|
|
152
|
+
title: string;
|
|
153
|
+
expandAll: string;
|
|
154
|
+
collapseAll: string;
|
|
155
|
+
close: string;
|
|
156
|
+
tree: string;
|
|
157
|
+
emptyEmail: string;
|
|
158
|
+
emptyZone: string;
|
|
159
|
+
column: (index: number) => string;
|
|
160
|
+
fixedHint: string;
|
|
161
|
+
itemHint: string;
|
|
162
|
+
expand: string;
|
|
163
|
+
collapse: string;
|
|
164
|
+
uploadedImage: string;
|
|
165
|
+
empty: string;
|
|
166
|
+
};
|
|
167
|
+
canvas: {
|
|
168
|
+
dropHere: string;
|
|
169
|
+
dropLabel: (label: string) => string;
|
|
170
|
+
emptyZone: string;
|
|
171
|
+
move: string;
|
|
172
|
+
moveLabel: (label: string) => string;
|
|
173
|
+
selectParent: (label: string) => string;
|
|
174
|
+
duplicate: string;
|
|
175
|
+
delete: string;
|
|
176
|
+
};
|
|
177
|
+
placeholder: {
|
|
178
|
+
heading: string;
|
|
179
|
+
paragraph: string;
|
|
180
|
+
};
|
|
181
|
+
nodes: Record<string, string>;
|
|
182
|
+
palette: {
|
|
183
|
+
oneColumn: string;
|
|
184
|
+
twoColumns: string;
|
|
185
|
+
threeColumns: string;
|
|
186
|
+
fourColumns: string;
|
|
187
|
+
heading: string;
|
|
188
|
+
text: string;
|
|
189
|
+
button: string;
|
|
190
|
+
image: string;
|
|
191
|
+
divider: string;
|
|
192
|
+
spacer: string;
|
|
193
|
+
social: string;
|
|
194
|
+
menu: string;
|
|
195
|
+
list: string;
|
|
196
|
+
quote: string;
|
|
197
|
+
html: string;
|
|
198
|
+
card: string;
|
|
199
|
+
};
|
|
200
|
+
templates: {
|
|
201
|
+
header: string;
|
|
202
|
+
headerDescription: string;
|
|
203
|
+
hero: string;
|
|
204
|
+
heroDescription: string;
|
|
205
|
+
products: string;
|
|
206
|
+
productsDescription: string;
|
|
207
|
+
features: string;
|
|
208
|
+
featuresDescription: string;
|
|
209
|
+
testimonial: string;
|
|
210
|
+
testimonialDescription: string;
|
|
211
|
+
footer: string;
|
|
212
|
+
footerDescription: string;
|
|
213
|
+
};
|
|
214
|
+
content: {
|
|
215
|
+
heading: string;
|
|
216
|
+
text: string;
|
|
217
|
+
button: string;
|
|
218
|
+
image: string;
|
|
219
|
+
menuHome: string;
|
|
220
|
+
menuShop: string;
|
|
221
|
+
menuBlog: string;
|
|
222
|
+
menuContact: string;
|
|
223
|
+
listItems: string[];
|
|
224
|
+
quote: string;
|
|
225
|
+
html: string;
|
|
226
|
+
cardTitle: string;
|
|
227
|
+
cardText: string;
|
|
228
|
+
logo: string;
|
|
229
|
+
heroTitle: string;
|
|
230
|
+
heroText: string;
|
|
231
|
+
heroButton: string;
|
|
232
|
+
productA: string;
|
|
233
|
+
productB: string;
|
|
234
|
+
productText: string;
|
|
235
|
+
productButton: string;
|
|
236
|
+
features: string[];
|
|
237
|
+
featureText: string;
|
|
238
|
+
testimonialQuote: string;
|
|
239
|
+
testimonialAuthor: string;
|
|
240
|
+
footerAddress: string;
|
|
241
|
+
unsubscribe: string;
|
|
242
|
+
starterTitle: string;
|
|
243
|
+
};
|
|
244
|
+
slashCommands: Record<string, {
|
|
245
|
+
title: string;
|
|
246
|
+
description: string;
|
|
247
|
+
}>;
|
|
248
|
+
};
|
|
249
|
+
readonly fr: {
|
|
250
|
+
topBar: {
|
|
251
|
+
layers: string;
|
|
252
|
+
toggleLayers: string;
|
|
253
|
+
undo: string;
|
|
254
|
+
redo: string;
|
|
255
|
+
canvasWidth: string;
|
|
256
|
+
desktop: string;
|
|
257
|
+
mobile: string;
|
|
258
|
+
template: string;
|
|
259
|
+
confirmTemplate: string;
|
|
260
|
+
import: string;
|
|
261
|
+
exportJson: string;
|
|
262
|
+
preview: string;
|
|
263
|
+
exportHtml: string;
|
|
264
|
+
invalidFile: (message: string) => string;
|
|
265
|
+
};
|
|
266
|
+
preview: {
|
|
267
|
+
dialogLabel: string;
|
|
268
|
+
desktop: string;
|
|
269
|
+
mobile: string;
|
|
270
|
+
html: string;
|
|
271
|
+
text: string;
|
|
272
|
+
copy: string;
|
|
273
|
+
copied: string;
|
|
274
|
+
download: string;
|
|
275
|
+
close: string;
|
|
276
|
+
rendering: string;
|
|
277
|
+
renderError: (message: string) => string;
|
|
278
|
+
iframeTitle: string;
|
|
279
|
+
};
|
|
280
|
+
sidebar: {
|
|
281
|
+
label: string;
|
|
282
|
+
tabContent: string;
|
|
283
|
+
tabBlocks: string;
|
|
284
|
+
tabBody: string;
|
|
285
|
+
layoutTitle: string;
|
|
286
|
+
contentTitle: string;
|
|
287
|
+
dragHint: string;
|
|
288
|
+
tileTitle: (label: string) => string;
|
|
289
|
+
propertiesEyebrow: string;
|
|
290
|
+
closeProperties: string;
|
|
291
|
+
breadcrumb: string;
|
|
292
|
+
selectedText: string;
|
|
293
|
+
};
|
|
294
|
+
body: {
|
|
295
|
+
general: string;
|
|
296
|
+
previewText: string;
|
|
297
|
+
previewTextPlaceholder: string;
|
|
298
|
+
background: string;
|
|
299
|
+
backgroundColor: string;
|
|
300
|
+
outerPadding: string;
|
|
301
|
+
content: string;
|
|
302
|
+
width: string;
|
|
303
|
+
contentColor: string;
|
|
304
|
+
innerPadding: string;
|
|
305
|
+
radius: string;
|
|
306
|
+
defaultStyles: string;
|
|
307
|
+
text: string;
|
|
308
|
+
headings: string;
|
|
309
|
+
links: string;
|
|
310
|
+
buttonBackground: string;
|
|
311
|
+
buttonText: string;
|
|
312
|
+
};
|
|
313
|
+
inspector: {
|
|
314
|
+
typography: string;
|
|
315
|
+
color: string;
|
|
316
|
+
size: string;
|
|
317
|
+
weight: string;
|
|
318
|
+
weightLight: string;
|
|
319
|
+
weightNormal: string;
|
|
320
|
+
weightSemibold: string;
|
|
321
|
+
weightBold: string;
|
|
322
|
+
weightExtrabold: string;
|
|
323
|
+
lineHeight: string;
|
|
324
|
+
alignment: string;
|
|
325
|
+
spacing: string;
|
|
326
|
+
padding: string;
|
|
327
|
+
box: string;
|
|
328
|
+
backgroundColor: string;
|
|
329
|
+
radius: string;
|
|
330
|
+
border: string;
|
|
331
|
+
borderColor: string;
|
|
332
|
+
image: string;
|
|
333
|
+
uploadImage: string;
|
|
334
|
+
imageUrl: string;
|
|
335
|
+
altText: string;
|
|
336
|
+
altPlaceholder: string;
|
|
337
|
+
layout: string;
|
|
338
|
+
autoWidth: string;
|
|
339
|
+
width: string;
|
|
340
|
+
action: string;
|
|
341
|
+
clickLink: string;
|
|
342
|
+
linkUrl: string;
|
|
343
|
+
button: string;
|
|
344
|
+
textColor: string;
|
|
345
|
+
textSize: string;
|
|
346
|
+
buttonPadding: string;
|
|
347
|
+
networks: string;
|
|
348
|
+
removeNetwork: string;
|
|
349
|
+
addNetwork: string;
|
|
350
|
+
appearance: string;
|
|
351
|
+
iconSize: string;
|
|
352
|
+
gap: string;
|
|
353
|
+
columns: string;
|
|
354
|
+
distribution: string;
|
|
355
|
+
equal: string;
|
|
356
|
+
columnGap: string;
|
|
357
|
+
columnsHint: string;
|
|
358
|
+
spacer: string;
|
|
359
|
+
height: string;
|
|
360
|
+
htmlCode: string;
|
|
361
|
+
htmlHint: string;
|
|
362
|
+
line: string;
|
|
363
|
+
thickness: string;
|
|
364
|
+
lineStyle: string;
|
|
365
|
+
heading: string;
|
|
366
|
+
level: string;
|
|
367
|
+
formatting: string;
|
|
368
|
+
bold: string;
|
|
369
|
+
italic: string;
|
|
370
|
+
underline: string;
|
|
371
|
+
strike: string;
|
|
372
|
+
link: string;
|
|
373
|
+
url: string;
|
|
374
|
+
linkColor: string;
|
|
375
|
+
};
|
|
376
|
+
fields: {
|
|
377
|
+
colorDefault: string;
|
|
378
|
+
chooseColor: (value: string) => string;
|
|
379
|
+
hexCode: string;
|
|
380
|
+
eyedropper: string;
|
|
381
|
+
documentColors: string;
|
|
382
|
+
palette: string;
|
|
383
|
+
resetColor: string;
|
|
384
|
+
alignLeft: string;
|
|
385
|
+
alignCenter: string;
|
|
386
|
+
alignRight: string;
|
|
387
|
+
top: string;
|
|
388
|
+
right: string;
|
|
389
|
+
bottom: string;
|
|
390
|
+
left: string;
|
|
391
|
+
moreOptions: string;
|
|
392
|
+
auto: string;
|
|
393
|
+
};
|
|
394
|
+
layers: {
|
|
395
|
+
title: string;
|
|
396
|
+
expandAll: string;
|
|
397
|
+
collapseAll: string;
|
|
398
|
+
close: string;
|
|
399
|
+
tree: string;
|
|
400
|
+
emptyEmail: string;
|
|
401
|
+
emptyZone: string;
|
|
402
|
+
column: (index: number) => string;
|
|
403
|
+
fixedHint: string;
|
|
404
|
+
itemHint: string;
|
|
405
|
+
expand: string;
|
|
406
|
+
collapse: string;
|
|
407
|
+
uploadedImage: string;
|
|
408
|
+
empty: string;
|
|
409
|
+
};
|
|
410
|
+
canvas: {
|
|
411
|
+
dropHere: string;
|
|
412
|
+
dropLabel: (label: string) => string;
|
|
413
|
+
emptyZone: string;
|
|
414
|
+
move: string;
|
|
415
|
+
moveLabel: (label: string) => string;
|
|
416
|
+
selectParent: (label: string) => string;
|
|
417
|
+
duplicate: string;
|
|
418
|
+
delete: string;
|
|
419
|
+
};
|
|
420
|
+
placeholder: {
|
|
421
|
+
heading: string;
|
|
422
|
+
paragraph: string;
|
|
423
|
+
};
|
|
424
|
+
nodes: Record<string, string>;
|
|
425
|
+
palette: {
|
|
426
|
+
oneColumn: string;
|
|
427
|
+
twoColumns: string;
|
|
428
|
+
threeColumns: string;
|
|
429
|
+
fourColumns: string;
|
|
430
|
+
heading: string;
|
|
431
|
+
text: string;
|
|
432
|
+
button: string;
|
|
433
|
+
image: string;
|
|
434
|
+
divider: string;
|
|
435
|
+
spacer: string;
|
|
436
|
+
social: string;
|
|
437
|
+
menu: string;
|
|
438
|
+
list: string;
|
|
439
|
+
quote: string;
|
|
440
|
+
html: string;
|
|
441
|
+
card: string;
|
|
442
|
+
};
|
|
443
|
+
templates: {
|
|
444
|
+
header: string;
|
|
445
|
+
headerDescription: string;
|
|
446
|
+
hero: string;
|
|
447
|
+
heroDescription: string;
|
|
448
|
+
products: string;
|
|
449
|
+
productsDescription: string;
|
|
450
|
+
features: string;
|
|
451
|
+
featuresDescription: string;
|
|
452
|
+
testimonial: string;
|
|
453
|
+
testimonialDescription: string;
|
|
454
|
+
footer: string;
|
|
455
|
+
footerDescription: string;
|
|
456
|
+
};
|
|
457
|
+
content: {
|
|
458
|
+
heading: string;
|
|
459
|
+
text: string;
|
|
460
|
+
button: string;
|
|
461
|
+
image: string;
|
|
462
|
+
menuHome: string;
|
|
463
|
+
menuShop: string;
|
|
464
|
+
menuBlog: string;
|
|
465
|
+
menuContact: string;
|
|
466
|
+
listItems: string[];
|
|
467
|
+
quote: string;
|
|
468
|
+
html: string;
|
|
469
|
+
cardTitle: string;
|
|
470
|
+
cardText: string;
|
|
471
|
+
logo: string;
|
|
472
|
+
heroTitle: string;
|
|
473
|
+
heroText: string;
|
|
474
|
+
heroButton: string;
|
|
475
|
+
productA: string;
|
|
476
|
+
productB: string;
|
|
477
|
+
productText: string;
|
|
478
|
+
productButton: string;
|
|
479
|
+
features: string[];
|
|
480
|
+
featureText: string;
|
|
481
|
+
testimonialQuote: string;
|
|
482
|
+
testimonialAuthor: string;
|
|
483
|
+
footerAddress: string;
|
|
484
|
+
unsubscribe: string;
|
|
485
|
+
starterTitle: string;
|
|
486
|
+
};
|
|
487
|
+
slashCommands: Record<string, {
|
|
488
|
+
title: string;
|
|
489
|
+
description: string;
|
|
490
|
+
}>;
|
|
491
|
+
};
|
|
492
|
+
};
|
|
493
|
+
export type BuiltInLocale = keyof typeof locales;
|
|
494
|
+
export interface I18n {
|
|
495
|
+
locale: string;
|
|
496
|
+
t: Messages;
|
|
497
|
+
}
|
|
498
|
+
/**
|
|
499
|
+
* A user-facing string: plain text, or a function of the current locale.
|
|
500
|
+
* Lets custom palette items and templates follow the editor's language.
|
|
501
|
+
*/
|
|
502
|
+
export type Label = string | ((i18n: I18n) => string);
|
|
503
|
+
export declare function resolveLabel(label: Label, i18n: I18n): string;
|
|
504
|
+
type DeepPartial<T> = {
|
|
505
|
+
[K in keyof T]?: T[K] extends (...args: never[]) => unknown ? T[K] : T[K] extends readonly unknown[] ? T[K] : T[K] extends object ? DeepPartial<T[K]> : T[K];
|
|
506
|
+
};
|
|
507
|
+
export type PartialMessages = DeepPartial<Messages>;
|
|
508
|
+
/** Built-in locale (falls back to English) with optional overrides on top. */
|
|
509
|
+
export declare function resolveMessages(locale: string, overrides?: PartialMessages): Messages;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
export { BetterEmailEditor, type BetterEmailEditorProps, type BetterEmailEditorComponents } from './components/BetterEmailEditor';
|
|
2
|
+
export { EditorRoot, useEmailEditor, useOptionalEmailEditor, useI18n, useMessages, defaultTheme, readFileAsDataUrl, type EditorRootProps, type EmailEditorHandle, type EmailEditorContextValue, type EmailValue, type EmailSettings, type EmailExport, type Device, } from './context';
|
|
3
|
+
export { Canvas, type CanvasProps } from './components/Canvas';
|
|
4
|
+
export { CanvasOverlay } from './components/CanvasOverlay';
|
|
5
|
+
export { TopBar, LayersToggle, UndoRedo, DeviceToggle, TemplateButton, ImportButton, ExportJsonButton, PreviewButton, ExportHtmlButton, type TopBarProps, type PreviewButtonProps, } from './components/TopBar';
|
|
6
|
+
export { LayersPanel, type LayersPanelProps } from './components/LayersPanel';
|
|
7
|
+
export { Sidebar, type SidebarProps } from './components/Sidebar';
|
|
8
|
+
export { ContentPanel, type ContentPanelProps, type ContentPanelTab } from './components/ContentPanel';
|
|
9
|
+
export { ContentTab, PaletteTile, type ContentTabProps, type PaletteTileProps } from './components/ContentTab';
|
|
10
|
+
export { BlocksTab, TemplateCard, type BlocksTabProps, type TemplateCardProps } from './components/BlocksTab';
|
|
11
|
+
export { BodyTab, type BodyTabProps, type DocumentContext } from './components/BodyTab';
|
|
12
|
+
export { PropertiesPanel, useDeselect, type PropertiesPanelProps } from './components/PropertiesPanel';
|
|
13
|
+
export { BlockProperties, type BlockPropertiesProps } from './components/BlockProperties';
|
|
14
|
+
export { TextProperties, type TextPropertiesProps } from './components/TextProperties';
|
|
15
|
+
export { PreviewDialog, download, type PreviewDialogProps, type PreviewView } from './components/PreviewDialog';
|
|
16
|
+
export { useDraggableBlock } from './components/useDraggableBlock';
|
|
17
|
+
export { DefaultInspector } from './components/inspectors/DefaultInspector';
|
|
18
|
+
export { HeadingInspector } from './components/inspectors/HeadingInspector';
|
|
19
|
+
export { ImageInspector } from './components/inspectors/ImageInspector';
|
|
20
|
+
export { ButtonInspector } from './components/inspectors/ButtonInspector';
|
|
21
|
+
export { SocialLinksInspector } from './components/inspectors/SocialLinksInspector';
|
|
22
|
+
export { ColumnsInspector } from './components/inspectors/ColumnsInspector';
|
|
23
|
+
export { SpacerInspector, HtmlInspector, DividerInspector, ContainerInspector } from './components/inspectors/SimpleInspectors';
|
|
24
|
+
export { TypographyGroup, SpacingGroup, BoxGroup, css, type TypographyGroupProps, type SpacingGroupProps, type BoxGroupProps, } from './components/inspectors/groups';
|
|
25
|
+
export { Group, Field, TextInput, TextArea, NumberInput, RangeInput, ColorInput, Select, Segmented, AlignInput, PaddingInput, toHex, DEFAULT_SWATCHES, type GroupProps, type FieldProps, type TextInputProps, type TextAreaProps, type NumberInputProps, type RangeInputProps, type ColorInputProps, type SelectProps, type SegmentedProps, type AlignInputProps, type PaddingInputProps, type Side, } from './components/fields';
|
|
26
|
+
export * as icons from './components/icons';
|
|
27
|
+
export { defaultNodes, textPreview, truncate } from './registry/default-nodes';
|
|
28
|
+
export { defaultPalette, defaultPaletteGroups, menuParagraph } from './registry/default-palette';
|
|
29
|
+
export { defaultTemplates, createStarterDocument, TemplateThumbnail } from './registry/default-templates';
|
|
30
|
+
export type { NodeDefinition, PaletteItem, PaletteGroup, TemplateItem, InspectorProps, IconComponent } from './registry/types';
|
|
31
|
+
export { Spacer, SocialLinks, HtmlBlock, SOCIAL_NETWORKS, iconUrl, type SocialLink } from './nodes/custom-nodes';
|
|
32
|
+
export { en, fr, locales, resolveMessages, resolveLabel, type Messages, type PartialMessages, type I18n, type Label, type BuiltInLocale } from './i18n';
|
|
33
|
+
export * as content from './core/content';
|
|
34
|
+
export { BLOCK_CONTAINERS, COLUMN_PARENTS, appendBlocks, applyDrop, findDropTarget, selectedUnit, selectUnit, duplicateUnit, deleteUnit, parentUnit, unitAt, type BlockUnit, type DragPayload, type DropTarget, } from './core/dnd';
|
|
35
|
+
export { EmailButton } from './core/paste';
|
|
36
|
+
export { inlineStyleToObject } from './core/style-utils';
|
|
37
|
+
export { cx, type StyleProps } from './core/cx';
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { EmailNode } from '@react-email/editor/core';
|
|
2
|
+
export declare const Spacer: EmailNode<Record<string, never>, Record<string, never>>;
|
|
3
|
+
export interface SocialLink {
|
|
4
|
+
network: string;
|
|
5
|
+
url: string;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Icons come from the Simple Icons CDN. For maximum client support (Gmail
|
|
9
|
+
* does not render SVG) host PNG versions and swap `iconUrl`.
|
|
10
|
+
*/
|
|
11
|
+
export declare const SOCIAL_NETWORKS: Record<string, {
|
|
12
|
+
label: string;
|
|
13
|
+
slug: string;
|
|
14
|
+
color: string;
|
|
15
|
+
}>;
|
|
16
|
+
export declare function iconUrl(network: string): string;
|
|
17
|
+
export declare const SocialLinks: EmailNode<Record<string, never>, Record<string, never>>;
|
|
18
|
+
export declare const HtmlBlock: EmailNode<Record<string, never>, Record<string, never>>;
|
|
19
|
+
export declare const customNodes: EmailNode<Record<string, never>, Record<string, never>>[];
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { Node as PMNode } from '@tiptap/pm/model';
|
|
2
|
+
import type { I18n } from '../i18n';
|
|
3
|
+
import type { NodeDefinition } from './types';
|
|
4
|
+
export declare function truncate(text: string, max?: number): string;
|
|
5
|
+
/** Text content, or "empty". The default preview of text-like nodes. */
|
|
6
|
+
export declare const textPreview: (node: PMNode, { t }: I18n) => string;
|
|
7
|
+
export declare const defaultNodes: NodeDefinition[];
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { JSONContent } from '@tiptap/core';
|
|
2
|
+
import type { I18n } from '../i18n';
|
|
3
|
+
import type { PaletteGroup, PaletteItem } from './types';
|
|
4
|
+
/** A text menu (Home · Shop · Blog · Contact), shared by the palette and the header template. */
|
|
5
|
+
export declare const menuParagraph: ({ t }: I18n, alignment?: string) => JSONContent;
|
|
6
|
+
export declare const defaultPaletteGroups: PaletteGroup[];
|
|
7
|
+
export declare const defaultPalette: PaletteItem[];
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { JSONContent } from '@tiptap/core';
|
|
2
|
+
import type { I18n } from '../i18n';
|
|
3
|
+
import type { TemplateItem } from './types';
|
|
4
|
+
/** Abstract wireframe used as the card preview of the built-in templates. */
|
|
5
|
+
export declare function TemplateThumbnail({ variant }: {
|
|
6
|
+
variant: string;
|
|
7
|
+
}): import("react").JSX.Element;
|
|
8
|
+
export declare const defaultTemplates: TemplateItem[];
|
|
9
|
+
/** The demo email: header, hero, products and footer. */
|
|
10
|
+
export declare function createStarterDocument(i18n: I18n): JSONContent;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import type { AnyExtension, JSONContent } from '@tiptap/core';
|
|
2
|
+
import type { Node as PMNode } from '@tiptap/pm/model';
|
|
3
|
+
import type { InspectorNodeContext } from '@react-email/editor/ui';
|
|
4
|
+
import type { ComponentType, ReactNode } from 'react';
|
|
5
|
+
import type { StyleProps } from '../core/cx';
|
|
6
|
+
import type { I18n, Label } from '../i18n';
|
|
7
|
+
export type IconComponent = ComponentType<{
|
|
8
|
+
size?: number;
|
|
9
|
+
}>;
|
|
10
|
+
/** Props given to a block's properties panel. */
|
|
11
|
+
export interface InspectorProps extends StyleProps {
|
|
12
|
+
/** The package's inspector context: getStyle / setStyle / getAttr / setAttr… */
|
|
13
|
+
ctx: InspectorNodeContext;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Describes one node type (block) of the email: how it is named, shown in
|
|
17
|
+
* the layers panel and edited in the properties panel. Custom nodes also
|
|
18
|
+
* bring their Tiptap extension.
|
|
19
|
+
*/
|
|
20
|
+
export interface NodeDefinition {
|
|
21
|
+
/** ProseMirror node type name, e.g. "image" or "spacer". */
|
|
22
|
+
type: string;
|
|
23
|
+
/** Display name. Defaults to `messages.nodes[type]`, then to `type`. */
|
|
24
|
+
label?: Label;
|
|
25
|
+
/** Icon in the layers panel. */
|
|
26
|
+
icon?: IconComponent;
|
|
27
|
+
/** Properties panel shown when the block is selected. Defaults to `DefaultInspector`. */
|
|
28
|
+
inspector?: ComponentType<InspectorProps>;
|
|
29
|
+
/** Short content hint shown next to the label in the layers panel. */
|
|
30
|
+
preview?: (node: PMNode, i18n: I18n) => string;
|
|
31
|
+
/** Tiptap extensions the node needs (custom nodes created with `EmailNode.create`). */
|
|
32
|
+
extensions?: AnyExtension[];
|
|
33
|
+
}
|
|
34
|
+
/** A draggable tile of the "Content" tab. */
|
|
35
|
+
export interface PaletteItem {
|
|
36
|
+
id: string;
|
|
37
|
+
/** Group id: "layout" and "content" are built in, any other id creates a new group. */
|
|
38
|
+
group: string;
|
|
39
|
+
label: Label;
|
|
40
|
+
icon: ReactNode;
|
|
41
|
+
/** Blocks inserted on drop or click. Called on every insertion. */
|
|
42
|
+
content: (i18n: I18n) => JSONContent[];
|
|
43
|
+
}
|
|
44
|
+
export interface PaletteGroup {
|
|
45
|
+
id: string;
|
|
46
|
+
title: Label;
|
|
47
|
+
}
|
|
48
|
+
/** A prebuilt row of the "Blocks" tab. */
|
|
49
|
+
export interface TemplateItem {
|
|
50
|
+
id: string;
|
|
51
|
+
label: Label;
|
|
52
|
+
description?: Label;
|
|
53
|
+
/** Small preview drawn in the card. */
|
|
54
|
+
thumbnail?: ReactNode;
|
|
55
|
+
content: (i18n: I18n) => JSONContent[];
|
|
56
|
+
}
|