@blocknote/xl-email-exporter 0.47.2 → 0.48.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.
|
@@ -1,723 +1,479 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { render as
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
/* @__PURE__ */ n(
|
|
317
|
-
w,
|
|
318
|
-
{
|
|
319
|
-
url: e.props.url,
|
|
320
|
-
name: e.props.name,
|
|
321
|
-
defaultText: "Open file",
|
|
322
|
-
icon: t
|
|
323
|
-
}
|
|
324
|
-
),
|
|
325
|
-
/* @__PURE__ */ n(
|
|
326
|
-
x,
|
|
327
|
-
{
|
|
328
|
-
caption: e.props.caption,
|
|
329
|
-
width: l,
|
|
330
|
-
textStyles: r
|
|
331
|
-
}
|
|
332
|
-
)
|
|
333
|
-
] });
|
|
334
|
-
},
|
|
335
|
-
image: (e) => /* @__PURE__ */ n(
|
|
336
|
-
E,
|
|
337
|
-
{
|
|
338
|
-
src: e.props.url,
|
|
339
|
-
width: e.props.previewWidth,
|
|
340
|
-
alt: e.props.caption
|
|
341
|
-
}
|
|
342
|
-
),
|
|
343
|
-
table: (e, t) => {
|
|
344
|
-
const l = e.content;
|
|
345
|
-
if (!l || typeof l != "object" || !Array.isArray(l.rows))
|
|
346
|
-
return /* @__PURE__ */ n(f, { ...r.tableError, children: "Table data not available" });
|
|
347
|
-
const i = l.headerRows ?? 0, o = l.headerCols ?? 0;
|
|
348
|
-
return /* @__PURE__ */ n(
|
|
349
|
-
"table",
|
|
350
|
-
{
|
|
351
|
-
style: {
|
|
352
|
-
borderCollapse: "collapse",
|
|
353
|
-
width: "100%",
|
|
354
|
-
margin: "16px 0",
|
|
355
|
-
border: "1px solid #ddd",
|
|
356
|
-
borderRadius: 4,
|
|
357
|
-
overflow: "hidden"
|
|
358
|
-
},
|
|
359
|
-
border: 0,
|
|
360
|
-
cellPadding: 0,
|
|
361
|
-
cellSpacing: 0,
|
|
362
|
-
children: /* @__PURE__ */ n("tbody", { children: l.rows.map((a, s) => /* @__PURE__ */ n("tr", { children: a.cells.map((u, c) => {
|
|
363
|
-
var v;
|
|
364
|
-
const d = T(u), p = s < i, b = c < o, C = p || b;
|
|
365
|
-
return /* @__PURE__ */ n(
|
|
366
|
-
C ? "th" : "td",
|
|
367
|
-
{
|
|
368
|
-
style: {
|
|
369
|
-
border: "1px solid #ddd",
|
|
370
|
-
padding: "8px 12px",
|
|
371
|
-
background: d.props.backgroundColor !== "default" ? t.options.colors[d.props.backgroundColor].background : "inherit",
|
|
372
|
-
fontWeight: C ? "bold" : void 0,
|
|
373
|
-
textAlign: d.props.textAlignment || "left",
|
|
374
|
-
color: d.props.textColor !== "default" ? t.options.colors[d.props.textColor].text : "inherit",
|
|
375
|
-
...m.tableCell.style,
|
|
376
|
-
...(v = r.tableCell) == null ? void 0 : v.style
|
|
377
|
-
},
|
|
378
|
-
...(d.props.colspan || 1) > 1 && {
|
|
379
|
-
colSpan: d.props.colspan || 1
|
|
380
|
-
},
|
|
381
|
-
...(d.props.rowspan || 1) > 1 && {
|
|
382
|
-
rowSpan: d.props.rowspan || 1
|
|
383
|
-
},
|
|
384
|
-
children: t.transformInlineContent(d.content)
|
|
385
|
-
},
|
|
386
|
-
"row_" + s + "_col_" + c
|
|
387
|
-
);
|
|
388
|
-
}) }, "row-" + s)) })
|
|
389
|
-
}
|
|
390
|
-
);
|
|
391
|
-
},
|
|
392
|
-
quote: (e, t) => {
|
|
393
|
-
var l;
|
|
394
|
-
return /* @__PURE__ */ n(
|
|
395
|
-
f,
|
|
396
|
-
{
|
|
397
|
-
...r.quote,
|
|
398
|
-
style: {
|
|
399
|
-
borderLeft: "2px solid #bdbdbd",
|
|
400
|
-
padding: "0px 12px",
|
|
401
|
-
fontStyle: "italic",
|
|
402
|
-
color: t.options.colors.gray.text,
|
|
403
|
-
display: "block",
|
|
404
|
-
...m.quote.style,
|
|
405
|
-
...(l = r.quote) == null ? void 0 : l.style
|
|
406
|
-
},
|
|
407
|
-
children: t.transformInlineContent(e.content)
|
|
408
|
-
}
|
|
409
|
-
);
|
|
410
|
-
},
|
|
411
|
-
pageBreak: () => /* @__PURE__ */ n(
|
|
412
|
-
"hr",
|
|
413
|
-
{
|
|
414
|
-
style: {
|
|
415
|
-
border: "none",
|
|
416
|
-
borderTop: "2px dashed #ccc",
|
|
417
|
-
margin: "24px 0"
|
|
418
|
-
}
|
|
419
|
-
}
|
|
420
|
-
),
|
|
421
|
-
divider: () => /* @__PURE__ */ n(
|
|
422
|
-
"hr",
|
|
423
|
-
{
|
|
424
|
-
style: {
|
|
425
|
-
border: "none",
|
|
426
|
-
borderTop: "1px solid #ccc",
|
|
427
|
-
margin: "11.5px 0"
|
|
428
|
-
}
|
|
429
|
-
}
|
|
430
|
-
)
|
|
431
|
-
}), P = k();
|
|
432
|
-
function w({
|
|
433
|
-
url: r,
|
|
434
|
-
name: e,
|
|
435
|
-
defaultText: t,
|
|
436
|
-
icon: l
|
|
437
|
-
}) {
|
|
438
|
-
return /* @__PURE__ */ h(
|
|
439
|
-
I,
|
|
440
|
-
{
|
|
441
|
-
href: r,
|
|
442
|
-
style: {
|
|
443
|
-
textDecoration: "none",
|
|
444
|
-
color: "#333",
|
|
445
|
-
display: "inline-flex",
|
|
446
|
-
alignItems: "center",
|
|
447
|
-
gap: 8,
|
|
448
|
-
fontSize: 16
|
|
449
|
-
},
|
|
450
|
-
children: [
|
|
451
|
-
l,
|
|
452
|
-
/* @__PURE__ */ n("span", { style: { verticalAlign: "middle" }, children: e || t })
|
|
453
|
-
]
|
|
454
|
-
}
|
|
455
|
-
);
|
|
1
|
+
import { COLORS_DEFAULT as e, Exporter as t, mapTableCell as n } from "@blocknote/core";
|
|
2
|
+
import { Body as r, CodeBlock as i, Head as a, Heading as o, Html as s, Img as c, Link as l, Preview as u, Section as d, Tailwind as f, Text as p, dracula as m } from "@react-email/components";
|
|
3
|
+
import { jsx as h, jsxs as g } from "react/jsx-runtime";
|
|
4
|
+
import { render as _ } from "@react-email/render";
|
|
5
|
+
import v from "react";
|
|
6
|
+
//#region src/react-email/defaultSchema/blocks.tsx
|
|
7
|
+
var y = {
|
|
8
|
+
fontSize: 16,
|
|
9
|
+
lineHeight: 1.5,
|
|
10
|
+
margin: 3,
|
|
11
|
+
minHeight: 24
|
|
12
|
+
}, b = {
|
|
13
|
+
paragraph: { style: y },
|
|
14
|
+
bulletListItem: { style: y },
|
|
15
|
+
toggleListItem: { style: y },
|
|
16
|
+
numberedListItem: { style: y },
|
|
17
|
+
checkListItem: { style: y },
|
|
18
|
+
quote: { style: y },
|
|
19
|
+
tableError: { style: y },
|
|
20
|
+
tableCell: { style: y },
|
|
21
|
+
caption: { style: y },
|
|
22
|
+
heading1: { style: {
|
|
23
|
+
fontSize: 48,
|
|
24
|
+
margin: 3
|
|
25
|
+
} },
|
|
26
|
+
heading2: { style: {
|
|
27
|
+
fontSize: 36,
|
|
28
|
+
margin: 3
|
|
29
|
+
} },
|
|
30
|
+
heading3: { style: {
|
|
31
|
+
fontSize: 24,
|
|
32
|
+
margin: 3
|
|
33
|
+
} },
|
|
34
|
+
heading4: { style: {
|
|
35
|
+
fontSize: 20,
|
|
36
|
+
margin: 3
|
|
37
|
+
} },
|
|
38
|
+
heading5: { style: {
|
|
39
|
+
fontSize: 18,
|
|
40
|
+
margin: 3
|
|
41
|
+
} },
|
|
42
|
+
heading6: { style: {
|
|
43
|
+
fontSize: 16,
|
|
44
|
+
margin: 3
|
|
45
|
+
} },
|
|
46
|
+
codeBlock: { style: y }
|
|
47
|
+
}, x = (e = b) => ({
|
|
48
|
+
paragraph: (t, n) => /* @__PURE__ */ h(p, {
|
|
49
|
+
...e.paragraph,
|
|
50
|
+
style: {
|
|
51
|
+
...b.paragraph.style,
|
|
52
|
+
...e.paragraph?.style
|
|
53
|
+
},
|
|
54
|
+
children: n.transformInlineContent(t.content)
|
|
55
|
+
}),
|
|
56
|
+
bulletListItem: (t, n) => /* @__PURE__ */ h(p, {
|
|
57
|
+
...e.bulletListItem,
|
|
58
|
+
style: {
|
|
59
|
+
...b.bulletListItem.style,
|
|
60
|
+
...e.bulletListItem?.style
|
|
61
|
+
},
|
|
62
|
+
children: n.transformInlineContent(t.content)
|
|
63
|
+
}),
|
|
64
|
+
toggleListItem: (t, n) => /* @__PURE__ */ h(p, {
|
|
65
|
+
...e.toggleListItem,
|
|
66
|
+
style: {
|
|
67
|
+
...b.toggleListItem.style,
|
|
68
|
+
...e.toggleListItem?.style
|
|
69
|
+
},
|
|
70
|
+
children: n.transformInlineContent(t.content)
|
|
71
|
+
}),
|
|
72
|
+
numberedListItem: (t, n, r) => /* @__PURE__ */ h(p, {
|
|
73
|
+
...e.numberedListItem,
|
|
74
|
+
style: {
|
|
75
|
+
...b.numberedListItem.style,
|
|
76
|
+
...e.numberedListItem?.style
|
|
77
|
+
},
|
|
78
|
+
children: n.transformInlineContent(t.content)
|
|
79
|
+
}),
|
|
80
|
+
checkListItem: (t, n) => {
|
|
81
|
+
let r = t.props?.checked ? /* @__PURE__ */ g("svg", {
|
|
82
|
+
width: "18",
|
|
83
|
+
height: "18",
|
|
84
|
+
viewBox: "0 0 18 18",
|
|
85
|
+
style: {
|
|
86
|
+
display: "inline",
|
|
87
|
+
verticalAlign: "middle",
|
|
88
|
+
marginRight: 8
|
|
89
|
+
},
|
|
90
|
+
children: [/* @__PURE__ */ h("rect", {
|
|
91
|
+
x: "2",
|
|
92
|
+
y: "2",
|
|
93
|
+
width: "14",
|
|
94
|
+
height: "14",
|
|
95
|
+
rx: "3",
|
|
96
|
+
fill: "#4F8A10",
|
|
97
|
+
stroke: "#4F8A10",
|
|
98
|
+
strokeWidth: "2"
|
|
99
|
+
}), /* @__PURE__ */ h("polyline", {
|
|
100
|
+
points: "5,10 8,13 13,6",
|
|
101
|
+
fill: "none",
|
|
102
|
+
stroke: "#fff",
|
|
103
|
+
strokeWidth: "2"
|
|
104
|
+
})]
|
|
105
|
+
}) : /* @__PURE__ */ h("svg", {
|
|
106
|
+
width: "18",
|
|
107
|
+
height: "18",
|
|
108
|
+
viewBox: "0 0 18 18",
|
|
109
|
+
style: {
|
|
110
|
+
display: "inline",
|
|
111
|
+
verticalAlign: "middle",
|
|
112
|
+
marginRight: 8
|
|
113
|
+
},
|
|
114
|
+
children: /* @__PURE__ */ h("rect", {
|
|
115
|
+
x: "2",
|
|
116
|
+
y: "2",
|
|
117
|
+
width: "14",
|
|
118
|
+
height: "14",
|
|
119
|
+
rx: "3",
|
|
120
|
+
fill: "#fff",
|
|
121
|
+
stroke: "#888",
|
|
122
|
+
strokeWidth: "2"
|
|
123
|
+
})
|
|
124
|
+
});
|
|
125
|
+
return /* @__PURE__ */ g(p, {
|
|
126
|
+
...e.checkListItem,
|
|
127
|
+
style: {
|
|
128
|
+
...b.checkListItem.style,
|
|
129
|
+
...e.checkListItem?.style
|
|
130
|
+
},
|
|
131
|
+
children: [r, /* @__PURE__ */ h("span", { children: n.transformInlineContent(t.content) })]
|
|
132
|
+
});
|
|
133
|
+
},
|
|
134
|
+
heading: (t, n) => /* @__PURE__ */ h(o, {
|
|
135
|
+
as: `h${t.props.level}`,
|
|
136
|
+
...e[`heading${t.props.level}`],
|
|
137
|
+
style: {
|
|
138
|
+
...b[`heading${t.props.level}`].style,
|
|
139
|
+
...e[`heading${t.props.level}`]?.style
|
|
140
|
+
},
|
|
141
|
+
children: n.transformInlineContent(t.content)
|
|
142
|
+
}),
|
|
143
|
+
codeBlock: (t) => /* @__PURE__ */ h(i, {
|
|
144
|
+
code: t.content[0]?.text || "",
|
|
145
|
+
fontFamily: "'CommitMono', monospace",
|
|
146
|
+
language: t.props.language,
|
|
147
|
+
theme: m,
|
|
148
|
+
...e.codeBlock,
|
|
149
|
+
style: {
|
|
150
|
+
...b.codeBlock.style,
|
|
151
|
+
...e.codeBlock?.style
|
|
152
|
+
}
|
|
153
|
+
}),
|
|
154
|
+
audio: (t) => {
|
|
155
|
+
let n = /* @__PURE__ */ h("svg", {
|
|
156
|
+
height: "18",
|
|
157
|
+
width: "18",
|
|
158
|
+
viewBox: "0 0 24 24",
|
|
159
|
+
fill: "#4F8A10",
|
|
160
|
+
style: {
|
|
161
|
+
display: "inline",
|
|
162
|
+
verticalAlign: "middle"
|
|
163
|
+
},
|
|
164
|
+
children: /* @__PURE__ */ h("path", { d: "M2 16.0001H5.88889L11.1834 20.3319C11.2727 20.405 11.3846 20.4449 11.5 20.4449C11.7761 20.4449 12 20.2211 12 19.9449V4.05519C12 3.93977 11.9601 3.8279 11.887 3.73857C11.7121 3.52485 11.3971 3.49335 11.1834 3.66821L5.88889 8.00007H2C1.44772 8.00007 1 8.44778 1 9.00007V15.0001C1 15.5524 1.44772 16.0001 2 16.0001ZM23 12C23 15.292 21.5539 18.2463 19.2622 20.2622L17.8445 18.8444C19.7758 17.1937 21 14.7398 21 12C21 9.26016 19.7758 6.80629 17.8445 5.15557L19.2622 3.73779C21.5539 5.75368 23 8.70795 23 12ZM18 12C18 10.0883 17.106 8.38548 15.7133 7.28673L14.2842 8.71584C15.3213 9.43855 16 10.64 16 12C16 13.36 15.3213 14.5614 14.2842 15.2841L15.7133 16.7132C17.106 15.6145 18 13.9116 18 12Z" })
|
|
165
|
+
}), r = "previewWidth" in t.props ? t.props.previewWidth : void 0;
|
|
166
|
+
return /* @__PURE__ */ g("div", {
|
|
167
|
+
style: { margin: "8px 0" },
|
|
168
|
+
children: [/* @__PURE__ */ h(C, {
|
|
169
|
+
url: t.props.url,
|
|
170
|
+
name: t.props.name,
|
|
171
|
+
defaultText: "Open audio file",
|
|
172
|
+
icon: n
|
|
173
|
+
}), /* @__PURE__ */ h(w, {
|
|
174
|
+
caption: t.props.caption,
|
|
175
|
+
width: r,
|
|
176
|
+
textStyles: e
|
|
177
|
+
})]
|
|
178
|
+
});
|
|
179
|
+
},
|
|
180
|
+
video: (t) => {
|
|
181
|
+
let n = /* @__PURE__ */ h("svg", {
|
|
182
|
+
height: "18",
|
|
183
|
+
width: "18",
|
|
184
|
+
viewBox: "0 0 24 24",
|
|
185
|
+
fill: "#1976D2",
|
|
186
|
+
style: {
|
|
187
|
+
display: "inline",
|
|
188
|
+
verticalAlign: "middle"
|
|
189
|
+
},
|
|
190
|
+
children: /* @__PURE__ */ h("path", { d: "M2 3.9934C2 3.44476 2.45531 3 2.9918 3H21.0082C21.556 3 22 3.44495 22 3.9934V20.0066C22 20.5552 21.5447 21 21.0082 21H2.9918C2.44405 21 2 20.5551 2 20.0066V3.9934ZM8 5V19H16V5H8ZM4 5V7H6V5H4ZM18 5V7H20V5H18ZM4 9V11H6V9H4ZM18 9V11H20V9H18ZM4 13V15H6V13H4ZM18 13V15H20V13H18ZM4 17V19H6V17H4ZM18 17V19H20V17H18Z" })
|
|
191
|
+
}), r = "previewWidth" in t.props ? t.props.previewWidth : void 0;
|
|
192
|
+
return /* @__PURE__ */ g("div", {
|
|
193
|
+
style: { margin: "8px 0" },
|
|
194
|
+
children: [/* @__PURE__ */ h(C, {
|
|
195
|
+
url: t.props.url,
|
|
196
|
+
name: t.props.name,
|
|
197
|
+
defaultText: "Open video file",
|
|
198
|
+
icon: n
|
|
199
|
+
}), /* @__PURE__ */ h(w, {
|
|
200
|
+
caption: t.props.caption,
|
|
201
|
+
width: r,
|
|
202
|
+
textStyles: e
|
|
203
|
+
})]
|
|
204
|
+
});
|
|
205
|
+
},
|
|
206
|
+
file: (t) => {
|
|
207
|
+
let n = /* @__PURE__ */ h("svg", {
|
|
208
|
+
height: "18",
|
|
209
|
+
width: "18",
|
|
210
|
+
viewBox: "0 0 24 24",
|
|
211
|
+
fill: "#888",
|
|
212
|
+
style: {
|
|
213
|
+
display: "inline",
|
|
214
|
+
verticalAlign: "middle"
|
|
215
|
+
},
|
|
216
|
+
children: /* @__PURE__ */ h("path", { d: "M3 8L9.00319 2H19.9978C20.5513 2 21 2.45531 21 2.9918V21.0082C21 21.556 20.5551 22 20.0066 22H3.9934C3.44476 22 3 21.5501 3 20.9932V8ZM10 4V9H5V20H19V4H10Z" })
|
|
217
|
+
}), r = "previewWidth" in t.props ? t.props.previewWidth : void 0;
|
|
218
|
+
return /* @__PURE__ */ g("div", {
|
|
219
|
+
style: { margin: "8px 0" },
|
|
220
|
+
children: [/* @__PURE__ */ h(C, {
|
|
221
|
+
url: t.props.url,
|
|
222
|
+
name: t.props.name,
|
|
223
|
+
defaultText: "Open file",
|
|
224
|
+
icon: n
|
|
225
|
+
}), /* @__PURE__ */ h(w, {
|
|
226
|
+
caption: t.props.caption,
|
|
227
|
+
width: r,
|
|
228
|
+
textStyles: e
|
|
229
|
+
})]
|
|
230
|
+
});
|
|
231
|
+
},
|
|
232
|
+
image: (e) => /* @__PURE__ */ h(c, {
|
|
233
|
+
src: e.props.url,
|
|
234
|
+
width: e.props.previewWidth,
|
|
235
|
+
alt: e.props.caption
|
|
236
|
+
}),
|
|
237
|
+
table: (t, r) => {
|
|
238
|
+
let i = t.content;
|
|
239
|
+
if (!i || typeof i != "object" || !Array.isArray(i.rows)) return /* @__PURE__ */ h(p, {
|
|
240
|
+
...e.tableError,
|
|
241
|
+
children: "Table data not available"
|
|
242
|
+
});
|
|
243
|
+
let a = i.headerRows ?? 0, o = i.headerCols ?? 0;
|
|
244
|
+
return /* @__PURE__ */ h("table", {
|
|
245
|
+
style: {
|
|
246
|
+
borderCollapse: "collapse",
|
|
247
|
+
width: "100%",
|
|
248
|
+
margin: "16px 0",
|
|
249
|
+
border: "1px solid #ddd",
|
|
250
|
+
borderRadius: 4,
|
|
251
|
+
overflow: "hidden"
|
|
252
|
+
},
|
|
253
|
+
border: 0,
|
|
254
|
+
cellPadding: 0,
|
|
255
|
+
cellSpacing: 0,
|
|
256
|
+
children: /* @__PURE__ */ h("tbody", { children: i.rows.map((t, i) => /* @__PURE__ */ h("tr", { children: t.cells.map((t, s) => {
|
|
257
|
+
let c = n(t), l = i < a || s < o;
|
|
258
|
+
return /* @__PURE__ */ h(l ? "th" : "td", {
|
|
259
|
+
style: {
|
|
260
|
+
border: "1px solid #ddd",
|
|
261
|
+
padding: "8px 12px",
|
|
262
|
+
background: c.props.backgroundColor === "default" ? "inherit" : r.options.colors[c.props.backgroundColor].background,
|
|
263
|
+
fontWeight: l ? "bold" : void 0,
|
|
264
|
+
textAlign: c.props.textAlignment || "left",
|
|
265
|
+
color: c.props.textColor === "default" ? "inherit" : r.options.colors[c.props.textColor].text,
|
|
266
|
+
...b.tableCell.style,
|
|
267
|
+
...e.tableCell?.style
|
|
268
|
+
},
|
|
269
|
+
...(c.props.colspan || 1) > 1 && { colSpan: c.props.colspan || 1 },
|
|
270
|
+
...(c.props.rowspan || 1) > 1 && { rowSpan: c.props.rowspan || 1 },
|
|
271
|
+
children: r.transformInlineContent(c.content)
|
|
272
|
+
}, "row_" + i + "_col_" + s);
|
|
273
|
+
}) }, "row-" + i)) })
|
|
274
|
+
});
|
|
275
|
+
},
|
|
276
|
+
quote: (t, n) => /* @__PURE__ */ h(p, {
|
|
277
|
+
...e.quote,
|
|
278
|
+
style: {
|
|
279
|
+
borderLeft: "2px solid #bdbdbd",
|
|
280
|
+
padding: "0px 12px",
|
|
281
|
+
fontStyle: "italic",
|
|
282
|
+
color: n.options.colors.gray.text,
|
|
283
|
+
display: "block",
|
|
284
|
+
...b.quote.style,
|
|
285
|
+
...e.quote?.style
|
|
286
|
+
},
|
|
287
|
+
children: n.transformInlineContent(t.content)
|
|
288
|
+
}),
|
|
289
|
+
pageBreak: () => /* @__PURE__ */ h("hr", { style: {
|
|
290
|
+
border: "none",
|
|
291
|
+
borderTop: "2px dashed #ccc",
|
|
292
|
+
margin: "24px 0"
|
|
293
|
+
} }),
|
|
294
|
+
divider: () => /* @__PURE__ */ h("hr", { style: {
|
|
295
|
+
border: "none",
|
|
296
|
+
borderTop: "1px solid #ccc",
|
|
297
|
+
margin: "11.5px 0"
|
|
298
|
+
} })
|
|
299
|
+
}), S = x();
|
|
300
|
+
function C({ url: e, name: t, defaultText: n, icon: r }) {
|
|
301
|
+
return /* @__PURE__ */ g(l, {
|
|
302
|
+
href: e,
|
|
303
|
+
style: {
|
|
304
|
+
textDecoration: "none",
|
|
305
|
+
color: "#333",
|
|
306
|
+
display: "inline-flex",
|
|
307
|
+
alignItems: "center",
|
|
308
|
+
gap: 8,
|
|
309
|
+
fontSize: 16
|
|
310
|
+
},
|
|
311
|
+
children: [r, /* @__PURE__ */ h("span", {
|
|
312
|
+
style: { verticalAlign: "middle" },
|
|
313
|
+
children: t || n
|
|
314
|
+
})]
|
|
315
|
+
});
|
|
456
316
|
}
|
|
457
|
-
function
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
color: "#888",
|
|
471
|
-
margin: "4px 0 0 0",
|
|
472
|
-
...m.caption.style,
|
|
473
|
-
...(l = t.caption) == null ? void 0 : l.style
|
|
474
|
-
},
|
|
475
|
-
children: r
|
|
476
|
-
}
|
|
477
|
-
) : null;
|
|
317
|
+
function w({ caption: e, width: t, textStyles: n }) {
|
|
318
|
+
return e ? /* @__PURE__ */ h(p, {
|
|
319
|
+
...n.caption,
|
|
320
|
+
style: {
|
|
321
|
+
width: t,
|
|
322
|
+
fontSize: 13,
|
|
323
|
+
color: "#888",
|
|
324
|
+
margin: "4px 0 0 0",
|
|
325
|
+
...b.caption.style,
|
|
326
|
+
...n.caption?.style
|
|
327
|
+
},
|
|
328
|
+
children: e
|
|
329
|
+
}) : null;
|
|
478
330
|
}
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
},
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
}),
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
}
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
});
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
/* @__PURE__ */ n(
|
|
624
|
-
"ol",
|
|
625
|
-
{
|
|
626
|
-
className: "mb-2 list-decimal pl-6",
|
|
627
|
-
start: 1,
|
|
628
|
-
children: u
|
|
629
|
-
},
|
|
630
|
-
l + "-ol-nested-" + o
|
|
631
|
-
)
|
|
632
|
-
), o = c;
|
|
633
|
-
} else {
|
|
634
|
-
const s = await this.transformBlocks([a], t);
|
|
635
|
-
i.push(
|
|
636
|
-
/* @__PURE__ */ n(W, { style: { marginLeft: "24px" }, children: s }, a.id)
|
|
637
|
-
), o++;
|
|
638
|
-
}
|
|
639
|
-
}
|
|
640
|
-
return i;
|
|
641
|
-
}
|
|
642
|
-
async transformBlocks(e, t = 0) {
|
|
643
|
-
const l = [];
|
|
644
|
-
let i = 0;
|
|
645
|
-
for (; i < e.length; ) {
|
|
646
|
-
const o = e[i];
|
|
647
|
-
if (o.type === "bulletListItem" || o.type === "numberedListItem" || o.type === "toggleListItem") {
|
|
648
|
-
const { element: c, nextIndex: d } = await this.renderGroupedListBlocks(
|
|
649
|
-
e,
|
|
650
|
-
i,
|
|
651
|
-
t
|
|
652
|
-
);
|
|
653
|
-
l.push(c), i = d;
|
|
654
|
-
continue;
|
|
655
|
-
}
|
|
656
|
-
const a = await this.transformBlocks(o.children, t + 1), s = await this.mapBlock(o, t, 0), u = this.blocknoteDefaultPropsToReactEmailStyle(o.props);
|
|
657
|
-
l.push(
|
|
658
|
-
/* @__PURE__ */ h(L.Fragment, { children: [
|
|
659
|
-
Object.entries(u).length > 0 ? /* @__PURE__ */ n("div", { style: u, children: s }) : s,
|
|
660
|
-
a.length > 0 && /* @__PURE__ */ n("div", { style: { marginLeft: "24px" }, children: a })
|
|
661
|
-
] }, o.id)
|
|
662
|
-
), i++;
|
|
663
|
-
}
|
|
664
|
-
return l;
|
|
665
|
-
}
|
|
666
|
-
async toReactEmailDocument(e, t) {
|
|
667
|
-
const l = await this.transformBlocks(e), i = (t == null ? void 0 : t.container) || (({ children: s }) => /* @__PURE__ */ n(L.Fragment, { children: s })), o = !globalThis.ReadableByteStreamController;
|
|
668
|
-
o && (globalThis.ReadableByteStreamController = (await import("web-streams-polyfill")).default.ReadableByteStreamController);
|
|
669
|
-
const a = await N(
|
|
670
|
-
/* @__PURE__ */ h(Z, { children: [
|
|
671
|
-
/* @__PURE__ */ n(z, { children: t == null ? void 0 : t.head }),
|
|
672
|
-
/* @__PURE__ */ h(
|
|
673
|
-
O,
|
|
674
|
-
{
|
|
675
|
-
style: (t == null ? void 0 : t.bodyStyles) ?? {
|
|
676
|
-
fontFamily: "'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif",
|
|
677
|
-
fontSize: "16px",
|
|
678
|
-
lineHeight: "1.5",
|
|
679
|
-
color: "#333"
|
|
680
|
-
},
|
|
681
|
-
children: [
|
|
682
|
-
(t == null ? void 0 : t.preview) && /* @__PURE__ */ n(j, { children: t.preview }),
|
|
683
|
-
/* @__PURE__ */ n(_, { children: /* @__PURE__ */ h(i, { children: [
|
|
684
|
-
t == null ? void 0 : t.header,
|
|
685
|
-
l,
|
|
686
|
-
t == null ? void 0 : t.footer
|
|
687
|
-
] }) })
|
|
688
|
-
]
|
|
689
|
-
}
|
|
690
|
-
)
|
|
691
|
-
] })
|
|
692
|
-
);
|
|
693
|
-
return o && delete globalThis.ReadableByteStreamController, a;
|
|
694
|
-
}
|
|
695
|
-
blocknoteDefaultPropsToReactEmailStyle(e) {
|
|
696
|
-
var l, i;
|
|
697
|
-
const t = {
|
|
698
|
-
textAlign: e.textAlignment === "left" ? void 0 : e.textAlignment,
|
|
699
|
-
backgroundColor: e.backgroundColor === "default" || !e.backgroundColor || (l = this.options.colors[e.backgroundColor]) == null ? void 0 : l.background,
|
|
700
|
-
color: e.textColor === "default" || !e.textColor || (i = this.options.colors[e.textColor]) == null ? void 0 : i.text,
|
|
701
|
-
alignItems: e.textAlignment === "right" ? "flex-end" : e.textAlignment === "center" ? "center" : void 0
|
|
702
|
-
};
|
|
703
|
-
return Object.fromEntries(
|
|
704
|
-
Object.entries(t).filter(([o, a]) => a !== void 0)
|
|
705
|
-
);
|
|
706
|
-
}
|
|
707
|
-
}
|
|
708
|
-
export {
|
|
709
|
-
te as ReactEmailExporter,
|
|
710
|
-
k as createReactEmailBlockMappingForDefaultSchema,
|
|
711
|
-
S as createReactEmailInlineContentMappingForDefaultSchema,
|
|
712
|
-
B as createReactEmailStyleMappingForDefaultSchema,
|
|
713
|
-
G as defaultReactEmailDefaultSchemaStyles,
|
|
714
|
-
H as defaultReactEmailLinkStyles,
|
|
715
|
-
M as defaultReactEmailStyleTransformStyles,
|
|
716
|
-
m as defaultReactEmailTextStyles,
|
|
717
|
-
P as reactEmailBlockMappingForDefaultSchema,
|
|
718
|
-
Y as reactEmailDefaultSchemaMappings,
|
|
719
|
-
ee as reactEmailDefaultSchemaMappingsWithStyles,
|
|
720
|
-
q as reactEmailInlineContentMappingForDefaultSchema,
|
|
721
|
-
$ as reactEmailStyleMappingForDefaultSchema
|
|
331
|
+
//#endregion
|
|
332
|
+
//#region src/react-email/defaultSchema/inlinecontent.tsx
|
|
333
|
+
var T = { link: {} }, E = (e = T) => ({
|
|
334
|
+
link: (t, n) => /* @__PURE__ */ h(l, {
|
|
335
|
+
href: t.href,
|
|
336
|
+
...e.link,
|
|
337
|
+
children: [...t.content.map((e) => n.transformStyledText(e))]
|
|
338
|
+
}),
|
|
339
|
+
text: (e, t) => t.transformStyledText(e)
|
|
340
|
+
}), D = E(), O = {}, k = (e = O) => ({
|
|
341
|
+
bold: (e) => e ? { fontWeight: "bold" } : {},
|
|
342
|
+
italic: (e) => e ? { fontStyle: "italic" } : {},
|
|
343
|
+
underline: (e) => e ? { textDecoration: "underline" } : {},
|
|
344
|
+
strike: (e) => e ? { textDecoration: "line-through" } : {},
|
|
345
|
+
backgroundColor: (e, t) => e ? { backgroundColor: t.options.colors[e].background } : {},
|
|
346
|
+
textColor: (e, t) => e ? { color: t.options.colors[e].text } : {},
|
|
347
|
+
code: (e) => e ? { fontFamily: "GeistMono" } : {}
|
|
348
|
+
}), A = k(), j = {
|
|
349
|
+
textStyles: b,
|
|
350
|
+
linkStyles: T,
|
|
351
|
+
styleTransformStyles: O
|
|
352
|
+
}, M = {
|
|
353
|
+
blockMapping: S,
|
|
354
|
+
inlineContentMapping: D,
|
|
355
|
+
styleMapping: A
|
|
356
|
+
}, N = (e = j) => ({
|
|
357
|
+
blockMapping: x(e.textStyles),
|
|
358
|
+
inlineContentMapping: E(e.linkStyles),
|
|
359
|
+
styleMapping: k(e.styleTransformStyles)
|
|
360
|
+
}), P = class extends t {
|
|
361
|
+
constructor(t, n, r) {
|
|
362
|
+
let i = {
|
|
363
|
+
colors: e,
|
|
364
|
+
...r
|
|
365
|
+
};
|
|
366
|
+
super(t, n, i), this.schema = t;
|
|
367
|
+
}
|
|
368
|
+
transformStyledText(e) {
|
|
369
|
+
let t = this.mapStyles(e.styles);
|
|
370
|
+
return /* @__PURE__ */ h("span", {
|
|
371
|
+
style: Object.assign({}, ...t),
|
|
372
|
+
dangerouslySetInnerHTML: { __html: e.text.replace(/\n/g, "<br />") }
|
|
373
|
+
});
|
|
374
|
+
}
|
|
375
|
+
async renderGroupedListBlocks(e, t, n) {
|
|
376
|
+
let r = e[t].type, i = [], a = t;
|
|
377
|
+
for (let t = 1; a < e.length && e[a].type === r; a++, t++) {
|
|
378
|
+
let r = e[a], o = await this.mapBlock(r, n, t), s = [];
|
|
379
|
+
r.children && r.children.length > 0 && (s = await this.renderNestedLists(r.children, n + 1, r.id)), i.push(/* @__PURE__ */ g("li", { children: [o, s.length > 0 && s] }, r.id));
|
|
380
|
+
}
|
|
381
|
+
let o;
|
|
382
|
+
return o = r === "bulletListItem" || r === "toggleListItem" ? /* @__PURE__ */ h("ul", {
|
|
383
|
+
className: "mb-2 list-disc pl-6",
|
|
384
|
+
children: i
|
|
385
|
+
}, e[t].id + "-ul") : /* @__PURE__ */ h("ol", {
|
|
386
|
+
className: "mb-2 list-decimal pl-6",
|
|
387
|
+
start: 1,
|
|
388
|
+
children: i
|
|
389
|
+
}, e[t].id + "-ol"), {
|
|
390
|
+
element: o,
|
|
391
|
+
nextIndex: a
|
|
392
|
+
};
|
|
393
|
+
}
|
|
394
|
+
async renderNestedLists(e, t, n) {
|
|
395
|
+
let r = [], i = 0;
|
|
396
|
+
for (; i < e.length;) {
|
|
397
|
+
let a = e[i];
|
|
398
|
+
if (a.type === "bulletListItem" || a.type === "numberedListItem") {
|
|
399
|
+
let o = a.type, s = [], c = i;
|
|
400
|
+
for (let n = 1; c < e.length && e[c].type === o; c++, n++) {
|
|
401
|
+
let r = e[c], i = await this.mapBlock(r, t, n), a = this.blocknoteDefaultPropsToReactEmailStyle(r.props), o = [];
|
|
402
|
+
r.children && r.children.length > 0 && (o = r.children[0] && (r.children[0].type === "bulletListItem" || r.children[0].type === "numberedListItem") ? await this.renderNestedLists(r.children, t + 1, r.id) : await this.transformBlocks(r.children, t + 1)), s.push(/* @__PURE__ */ g("li", {
|
|
403
|
+
style: a,
|
|
404
|
+
children: [i, o.length > 0 && /* @__PURE__ */ h("div", {
|
|
405
|
+
style: { marginTop: "8px" },
|
|
406
|
+
children: o
|
|
407
|
+
})]
|
|
408
|
+
}, r.id));
|
|
409
|
+
}
|
|
410
|
+
o === "bulletListItem" ? r.push(/* @__PURE__ */ h("ul", {
|
|
411
|
+
className: "mb-2 list-disc pl-6",
|
|
412
|
+
children: s
|
|
413
|
+
}, n + "-ul-nested-" + i)) : r.push(/* @__PURE__ */ h("ol", {
|
|
414
|
+
className: "mb-2 list-decimal pl-6",
|
|
415
|
+
start: 1,
|
|
416
|
+
children: s
|
|
417
|
+
}, n + "-ol-nested-" + i)), i = c;
|
|
418
|
+
} else {
|
|
419
|
+
let e = await this.transformBlocks([a], t);
|
|
420
|
+
r.push(/* @__PURE__ */ h(d, {
|
|
421
|
+
style: { marginLeft: "24px" },
|
|
422
|
+
children: e
|
|
423
|
+
}, a.id)), i++;
|
|
424
|
+
}
|
|
425
|
+
}
|
|
426
|
+
return r;
|
|
427
|
+
}
|
|
428
|
+
async transformBlocks(e, t = 0) {
|
|
429
|
+
let n = [], r = 0;
|
|
430
|
+
for (; r < e.length;) {
|
|
431
|
+
let i = e[r];
|
|
432
|
+
if (i.type === "bulletListItem" || i.type === "numberedListItem" || i.type === "toggleListItem") {
|
|
433
|
+
let { element: i, nextIndex: a } = await this.renderGroupedListBlocks(e, r, t);
|
|
434
|
+
n.push(i), r = a;
|
|
435
|
+
continue;
|
|
436
|
+
}
|
|
437
|
+
let a = await this.transformBlocks(i.children, t + 1), o = await this.mapBlock(i, t, 0), s = this.blocknoteDefaultPropsToReactEmailStyle(i.props);
|
|
438
|
+
n.push(/* @__PURE__ */ g(v.Fragment, { children: [Object.entries(s).length > 0 ? /* @__PURE__ */ h("div", {
|
|
439
|
+
style: s,
|
|
440
|
+
children: o
|
|
441
|
+
}) : o, a.length > 0 && /* @__PURE__ */ h("div", {
|
|
442
|
+
style: { marginLeft: "24px" },
|
|
443
|
+
children: a
|
|
444
|
+
})] }, i.id)), r++;
|
|
445
|
+
}
|
|
446
|
+
return n;
|
|
447
|
+
}
|
|
448
|
+
async toReactEmailDocument(e, t) {
|
|
449
|
+
let n = await this.transformBlocks(e), i = t?.container || (({ children: e }) => /* @__PURE__ */ h(v.Fragment, { children: e })), o = !globalThis.ReadableByteStreamController;
|
|
450
|
+
o && (globalThis.ReadableByteStreamController = (await import("web-streams-polyfill")).default.ReadableByteStreamController);
|
|
451
|
+
let c = await _(/* @__PURE__ */ g(s, { children: [/* @__PURE__ */ h(a, { children: t?.head }), /* @__PURE__ */ g(r, {
|
|
452
|
+
style: t?.bodyStyles ?? {
|
|
453
|
+
fontFamily: "'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif",
|
|
454
|
+
fontSize: "16px",
|
|
455
|
+
lineHeight: "1.5",
|
|
456
|
+
color: "#333"
|
|
457
|
+
},
|
|
458
|
+
children: [t?.preview && /* @__PURE__ */ h(u, { children: t.preview }), /* @__PURE__ */ h(f, { children: /* @__PURE__ */ g(i, { children: [
|
|
459
|
+
t?.header,
|
|
460
|
+
n,
|
|
461
|
+
t?.footer
|
|
462
|
+
] }) })]
|
|
463
|
+
})] }));
|
|
464
|
+
return o && delete globalThis.ReadableByteStreamController, c;
|
|
465
|
+
}
|
|
466
|
+
blocknoteDefaultPropsToReactEmailStyle(e) {
|
|
467
|
+
let t = {
|
|
468
|
+
textAlign: e.textAlignment === "left" ? void 0 : e.textAlignment,
|
|
469
|
+
backgroundColor: e.backgroundColor === "default" || !e.backgroundColor ? void 0 : this.options.colors[e.backgroundColor]?.background,
|
|
470
|
+
color: e.textColor === "default" || !e.textColor ? void 0 : this.options.colors[e.textColor]?.text,
|
|
471
|
+
alignItems: e.textAlignment === "right" ? "flex-end" : e.textAlignment === "center" ? "center" : void 0
|
|
472
|
+
};
|
|
473
|
+
return Object.fromEntries(Object.entries(t).filter(([e, t]) => t !== void 0));
|
|
474
|
+
}
|
|
722
475
|
};
|
|
723
|
-
//#
|
|
476
|
+
//#endregion
|
|
477
|
+
export { P as ReactEmailExporter, x as createReactEmailBlockMappingForDefaultSchema, E as createReactEmailInlineContentMappingForDefaultSchema, k as createReactEmailStyleMappingForDefaultSchema, j as defaultReactEmailDefaultSchemaStyles, T as defaultReactEmailLinkStyles, O as defaultReactEmailStyleTransformStyles, b as defaultReactEmailTextStyles, S as reactEmailBlockMappingForDefaultSchema, M as reactEmailDefaultSchemaMappings, N as reactEmailDefaultSchemaMappingsWithStyles, D as reactEmailInlineContentMappingForDefaultSchema, A as reactEmailStyleMappingForDefaultSchema };
|
|
478
|
+
|
|
479
|
+
//# sourceMappingURL=blocknote-xl-email-exporter.js.map
|