@blocknote/xl-email-exporter 0.44.1 → 0.45.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/blocknote-xl-email-exporter.js +138 -136
- package/dist/blocknote-xl-email-exporter.js.map +1 -1
- package/dist/blocknote-xl-email-exporter.umd.cjs +1 -1
- package/dist/blocknote-xl-email-exporter.umd.cjs.map +1 -1
- package/dist/webpack-stats.json +1 -1
- package/package.json +4 -3
- package/src/react-email/reactEmailExporter.tsx +13 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { mapTableCell as V, Exporter as
|
|
1
|
+
import { jsx as n, jsxs as h } from "react/jsx-runtime";
|
|
2
|
+
import { mapTableCell as V, Exporter as R, COLORS_DEFAULT as E } from "@blocknote/core";
|
|
3
3
|
import { Text as f, Img as A, CodeBlock as D, dracula as F, Heading as W, Link as k, Section as v, Html as Z, Head as z, Body as N, Preview as _, Tailwind as O } from "@react-email/components";
|
|
4
|
-
import { render as
|
|
4
|
+
import { render as P } from "@react-email/render";
|
|
5
5
|
import I from "react";
|
|
6
6
|
const g = {
|
|
7
7
|
fontSize: 16,
|
|
@@ -75,58 +75,58 @@ const g = {
|
|
|
75
75
|
codeBlock: {
|
|
76
76
|
style: g
|
|
77
77
|
}
|
|
78
|
-
}, H = (
|
|
78
|
+
}, H = (r = m) => ({
|
|
79
79
|
paragraph: (e, t) => {
|
|
80
|
-
var
|
|
81
|
-
return /* @__PURE__ */
|
|
80
|
+
var l;
|
|
81
|
+
return /* @__PURE__ */ n(
|
|
82
82
|
f,
|
|
83
83
|
{
|
|
84
|
-
...
|
|
84
|
+
...r.paragraph,
|
|
85
85
|
style: {
|
|
86
86
|
...m.paragraph.style,
|
|
87
|
-
...(
|
|
87
|
+
...(l = r.paragraph) == null ? void 0 : l.style
|
|
88
88
|
},
|
|
89
89
|
children: t.transformInlineContent(e.content)
|
|
90
90
|
}
|
|
91
91
|
);
|
|
92
92
|
},
|
|
93
93
|
bulletListItem: (e, t) => {
|
|
94
|
-
var
|
|
95
|
-
return /* @__PURE__ */
|
|
94
|
+
var l;
|
|
95
|
+
return /* @__PURE__ */ n(
|
|
96
96
|
f,
|
|
97
97
|
{
|
|
98
|
-
...
|
|
98
|
+
...r.bulletListItem,
|
|
99
99
|
style: {
|
|
100
100
|
...m.bulletListItem.style,
|
|
101
|
-
...(
|
|
101
|
+
...(l = r.bulletListItem) == null ? void 0 : l.style
|
|
102
102
|
},
|
|
103
103
|
children: t.transformInlineContent(e.content)
|
|
104
104
|
}
|
|
105
105
|
);
|
|
106
106
|
},
|
|
107
107
|
toggleListItem: (e, t) => {
|
|
108
|
-
var
|
|
109
|
-
return /* @__PURE__ */
|
|
108
|
+
var l;
|
|
109
|
+
return /* @__PURE__ */ n(
|
|
110
110
|
f,
|
|
111
111
|
{
|
|
112
|
-
...
|
|
112
|
+
...r.toggleListItem,
|
|
113
113
|
style: {
|
|
114
114
|
...m.toggleListItem.style,
|
|
115
|
-
...(
|
|
115
|
+
...(l = r.toggleListItem) == null ? void 0 : l.style
|
|
116
116
|
},
|
|
117
117
|
children: t.transformInlineContent(e.content)
|
|
118
118
|
}
|
|
119
119
|
);
|
|
120
120
|
},
|
|
121
|
-
numberedListItem: (e, t,
|
|
121
|
+
numberedListItem: (e, t, l) => {
|
|
122
122
|
var o;
|
|
123
|
-
return /* @__PURE__ */
|
|
123
|
+
return /* @__PURE__ */ n(
|
|
124
124
|
f,
|
|
125
125
|
{
|
|
126
|
-
...
|
|
126
|
+
...r.numberedListItem,
|
|
127
127
|
style: {
|
|
128
128
|
...m.numberedListItem.style,
|
|
129
|
-
...(o =
|
|
129
|
+
...(o = r.numberedListItem) == null ? void 0 : o.style
|
|
130
130
|
},
|
|
131
131
|
children: t.transformInlineContent(e.content)
|
|
132
132
|
}
|
|
@@ -142,7 +142,7 @@ const g = {
|
|
|
142
142
|
viewBox: "0 0 18 18",
|
|
143
143
|
style: { display: "inline", verticalAlign: "middle", marginRight: 8 },
|
|
144
144
|
children: [
|
|
145
|
-
/* @__PURE__ */
|
|
145
|
+
/* @__PURE__ */ n(
|
|
146
146
|
"rect",
|
|
147
147
|
{
|
|
148
148
|
x: "2",
|
|
@@ -155,7 +155,7 @@ const g = {
|
|
|
155
155
|
strokeWidth: "2"
|
|
156
156
|
}
|
|
157
157
|
),
|
|
158
|
-
/* @__PURE__ */
|
|
158
|
+
/* @__PURE__ */ n(
|
|
159
159
|
"polyline",
|
|
160
160
|
{
|
|
161
161
|
points: "5,10 8,13 13,6",
|
|
@@ -166,14 +166,14 @@ const g = {
|
|
|
166
166
|
)
|
|
167
167
|
]
|
|
168
168
|
}
|
|
169
|
-
) : /* @__PURE__ */
|
|
169
|
+
) : /* @__PURE__ */ n(
|
|
170
170
|
"svg",
|
|
171
171
|
{
|
|
172
172
|
width: "18",
|
|
173
173
|
height: "18",
|
|
174
174
|
viewBox: "0 0 18 18",
|
|
175
175
|
style: { display: "inline", verticalAlign: "middle", marginRight: 8 },
|
|
176
|
-
children: /* @__PURE__ */
|
|
176
|
+
children: /* @__PURE__ */ n(
|
|
177
177
|
"rect",
|
|
178
178
|
{
|
|
179
179
|
x: "2",
|
|
@@ -191,53 +191,53 @@ const g = {
|
|
|
191
191
|
return /* @__PURE__ */ h(
|
|
192
192
|
f,
|
|
193
193
|
{
|
|
194
|
-
...
|
|
194
|
+
...r.checkListItem,
|
|
195
195
|
style: {
|
|
196
196
|
...m.checkListItem.style,
|
|
197
|
-
...(a =
|
|
197
|
+
...(a = r.checkListItem) == null ? void 0 : a.style
|
|
198
198
|
},
|
|
199
199
|
children: [
|
|
200
200
|
o,
|
|
201
|
-
/* @__PURE__ */
|
|
201
|
+
/* @__PURE__ */ n("span", { children: t.transformInlineContent(e.content) })
|
|
202
202
|
]
|
|
203
203
|
}
|
|
204
204
|
);
|
|
205
205
|
},
|
|
206
206
|
heading: (e, t) => {
|
|
207
|
-
var
|
|
208
|
-
return /* @__PURE__ */
|
|
207
|
+
var l;
|
|
208
|
+
return /* @__PURE__ */ n(
|
|
209
209
|
W,
|
|
210
210
|
{
|
|
211
211
|
as: `h${e.props.level}`,
|
|
212
|
-
...
|
|
212
|
+
...r[`heading${e.props.level}`],
|
|
213
213
|
style: {
|
|
214
214
|
...m[`heading${e.props.level}`].style,
|
|
215
|
-
...(
|
|
215
|
+
...(l = r[`heading${e.props.level}`]) == null ? void 0 : l.style
|
|
216
216
|
},
|
|
217
217
|
children: t.transformInlineContent(e.content)
|
|
218
218
|
}
|
|
219
219
|
);
|
|
220
220
|
},
|
|
221
221
|
codeBlock: (e) => {
|
|
222
|
-
var
|
|
223
|
-
const t = ((
|
|
224
|
-
return /* @__PURE__ */
|
|
222
|
+
var l, o;
|
|
223
|
+
const t = ((l = e.content[0]) == null ? void 0 : l.text) || "";
|
|
224
|
+
return /* @__PURE__ */ n(
|
|
225
225
|
D,
|
|
226
226
|
{
|
|
227
227
|
code: t,
|
|
228
228
|
fontFamily: "'CommitMono', monospace",
|
|
229
229
|
language: e.props.language,
|
|
230
230
|
theme: F,
|
|
231
|
-
...
|
|
231
|
+
...r.codeBlock,
|
|
232
232
|
style: {
|
|
233
233
|
...m.codeBlock.style,
|
|
234
|
-
...(o =
|
|
234
|
+
...(o = r.codeBlock) == null ? void 0 : o.style
|
|
235
235
|
}
|
|
236
236
|
}
|
|
237
237
|
);
|
|
238
238
|
},
|
|
239
239
|
audio: (e) => {
|
|
240
|
-
const t = /* @__PURE__ */
|
|
240
|
+
const t = /* @__PURE__ */ n(
|
|
241
241
|
"svg",
|
|
242
242
|
{
|
|
243
243
|
height: "18",
|
|
@@ -245,12 +245,12 @@ const g = {
|
|
|
245
245
|
viewBox: "0 0 24 24",
|
|
246
246
|
fill: "#4F8A10",
|
|
247
247
|
style: { display: "inline", verticalAlign: "middle" },
|
|
248
|
-
children: /* @__PURE__ */
|
|
248
|
+
children: /* @__PURE__ */ n("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" })
|
|
249
249
|
}
|
|
250
|
-
),
|
|
250
|
+
), l = "previewWidth" in e.props ? e.props.previewWidth : void 0;
|
|
251
251
|
return /* @__PURE__ */ h("div", { style: { margin: "8px 0" }, children: [
|
|
252
|
-
/* @__PURE__ */
|
|
253
|
-
|
|
252
|
+
/* @__PURE__ */ n(
|
|
253
|
+
w,
|
|
254
254
|
{
|
|
255
255
|
url: e.props.url,
|
|
256
256
|
name: e.props.name,
|
|
@@ -258,18 +258,18 @@ const g = {
|
|
|
258
258
|
icon: t
|
|
259
259
|
}
|
|
260
260
|
),
|
|
261
|
-
/* @__PURE__ */
|
|
262
|
-
|
|
261
|
+
/* @__PURE__ */ n(
|
|
262
|
+
x,
|
|
263
263
|
{
|
|
264
264
|
caption: e.props.caption,
|
|
265
|
-
width:
|
|
266
|
-
textStyles:
|
|
265
|
+
width: l,
|
|
266
|
+
textStyles: r
|
|
267
267
|
}
|
|
268
268
|
)
|
|
269
269
|
] });
|
|
270
270
|
},
|
|
271
271
|
video: (e) => {
|
|
272
|
-
const t = /* @__PURE__ */
|
|
272
|
+
const t = /* @__PURE__ */ n(
|
|
273
273
|
"svg",
|
|
274
274
|
{
|
|
275
275
|
height: "18",
|
|
@@ -277,12 +277,12 @@ const g = {
|
|
|
277
277
|
viewBox: "0 0 24 24",
|
|
278
278
|
fill: "#1976D2",
|
|
279
279
|
style: { display: "inline", verticalAlign: "middle" },
|
|
280
|
-
children: /* @__PURE__ */
|
|
280
|
+
children: /* @__PURE__ */ n("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" })
|
|
281
281
|
}
|
|
282
|
-
),
|
|
282
|
+
), l = "previewWidth" in e.props ? e.props.previewWidth : void 0;
|
|
283
283
|
return /* @__PURE__ */ h("div", { style: { margin: "8px 0" }, children: [
|
|
284
|
-
/* @__PURE__ */
|
|
285
|
-
|
|
284
|
+
/* @__PURE__ */ n(
|
|
285
|
+
w,
|
|
286
286
|
{
|
|
287
287
|
url: e.props.url,
|
|
288
288
|
name: e.props.name,
|
|
@@ -290,18 +290,18 @@ const g = {
|
|
|
290
290
|
icon: t
|
|
291
291
|
}
|
|
292
292
|
),
|
|
293
|
-
/* @__PURE__ */
|
|
294
|
-
|
|
293
|
+
/* @__PURE__ */ n(
|
|
294
|
+
x,
|
|
295
295
|
{
|
|
296
296
|
caption: e.props.caption,
|
|
297
|
-
width:
|
|
298
|
-
textStyles:
|
|
297
|
+
width: l,
|
|
298
|
+
textStyles: r
|
|
299
299
|
}
|
|
300
300
|
)
|
|
301
301
|
] });
|
|
302
302
|
},
|
|
303
303
|
file: (e) => {
|
|
304
|
-
const t = /* @__PURE__ */
|
|
304
|
+
const t = /* @__PURE__ */ n(
|
|
305
305
|
"svg",
|
|
306
306
|
{
|
|
307
307
|
height: "18",
|
|
@@ -309,12 +309,12 @@ const g = {
|
|
|
309
309
|
viewBox: "0 0 24 24",
|
|
310
310
|
fill: "#888",
|
|
311
311
|
style: { display: "inline", verticalAlign: "middle" },
|
|
312
|
-
children: /* @__PURE__ */
|
|
312
|
+
children: /* @__PURE__ */ n("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" })
|
|
313
313
|
}
|
|
314
|
-
),
|
|
314
|
+
), l = "previewWidth" in e.props ? e.props.previewWidth : void 0;
|
|
315
315
|
return /* @__PURE__ */ h("div", { style: { margin: "8px 0" }, children: [
|
|
316
|
-
/* @__PURE__ */
|
|
317
|
-
|
|
316
|
+
/* @__PURE__ */ n(
|
|
317
|
+
w,
|
|
318
318
|
{
|
|
319
319
|
url: e.props.url,
|
|
320
320
|
name: e.props.name,
|
|
@@ -322,17 +322,17 @@ const g = {
|
|
|
322
322
|
icon: t
|
|
323
323
|
}
|
|
324
324
|
),
|
|
325
|
-
/* @__PURE__ */
|
|
326
|
-
|
|
325
|
+
/* @__PURE__ */ n(
|
|
326
|
+
x,
|
|
327
327
|
{
|
|
328
328
|
caption: e.props.caption,
|
|
329
|
-
width:
|
|
330
|
-
textStyles:
|
|
329
|
+
width: l,
|
|
330
|
+
textStyles: r
|
|
331
331
|
}
|
|
332
332
|
)
|
|
333
333
|
] });
|
|
334
334
|
},
|
|
335
|
-
image: (e) => /* @__PURE__ */
|
|
335
|
+
image: (e) => /* @__PURE__ */ n(
|
|
336
336
|
A,
|
|
337
337
|
{
|
|
338
338
|
src: e.props.url,
|
|
@@ -341,11 +341,11 @@ const g = {
|
|
|
341
341
|
}
|
|
342
342
|
),
|
|
343
343
|
table: (e, t) => {
|
|
344
|
-
const
|
|
345
|
-
if (!
|
|
346
|
-
return /* @__PURE__ */
|
|
347
|
-
const o =
|
|
348
|
-
return /* @__PURE__ */
|
|
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 o = l.headerRows ?? 0, i = l.headerCols ?? 0;
|
|
348
|
+
return /* @__PURE__ */ n(
|
|
349
349
|
"table",
|
|
350
350
|
{
|
|
351
351
|
style: {
|
|
@@ -359,10 +359,10 @@ const g = {
|
|
|
359
359
|
border: 0,
|
|
360
360
|
cellPadding: 0,
|
|
361
361
|
cellSpacing: 0,
|
|
362
|
-
children: /* @__PURE__ */
|
|
362
|
+
children: /* @__PURE__ */ n("tbody", { children: l.rows.map((a, p) => /* @__PURE__ */ n("tr", { children: a.cells.map((u, s) => {
|
|
363
363
|
var L;
|
|
364
|
-
const c = V(u), d = p < o,
|
|
365
|
-
return /* @__PURE__ */
|
|
364
|
+
const c = V(u), d = p < o, b = s < i, C = d || b;
|
|
365
|
+
return /* @__PURE__ */ n(
|
|
366
366
|
C ? "th" : "td",
|
|
367
367
|
{
|
|
368
368
|
style: {
|
|
@@ -373,7 +373,7 @@ const g = {
|
|
|
373
373
|
textAlign: c.props.textAlignment || "left",
|
|
374
374
|
color: c.props.textColor !== "default" ? t.options.colors[c.props.textColor].text : "inherit",
|
|
375
375
|
...m.tableCell.style,
|
|
376
|
-
...(L =
|
|
376
|
+
...(L = r.tableCell) == null ? void 0 : L.style
|
|
377
377
|
},
|
|
378
378
|
...(c.props.colspan || 1) > 1 && {
|
|
379
379
|
colSpan: c.props.colspan || 1
|
|
@@ -390,11 +390,11 @@ const g = {
|
|
|
390
390
|
);
|
|
391
391
|
},
|
|
392
392
|
quote: (e, t) => {
|
|
393
|
-
var
|
|
394
|
-
return /* @__PURE__ */
|
|
393
|
+
var l;
|
|
394
|
+
return /* @__PURE__ */ n(
|
|
395
395
|
f,
|
|
396
396
|
{
|
|
397
|
-
...
|
|
397
|
+
...r.quote,
|
|
398
398
|
style: {
|
|
399
399
|
borderLeft: "2px solid #bdbdbd",
|
|
400
400
|
padding: "0px 12px",
|
|
@@ -402,13 +402,13 @@ const g = {
|
|
|
402
402
|
color: t.options.colors.gray.text,
|
|
403
403
|
display: "block",
|
|
404
404
|
...m.quote.style,
|
|
405
|
-
...(
|
|
405
|
+
...(l = r.quote) == null ? void 0 : l.style
|
|
406
406
|
},
|
|
407
407
|
children: t.transformInlineContent(e.content)
|
|
408
408
|
}
|
|
409
409
|
);
|
|
410
410
|
},
|
|
411
|
-
pageBreak: () => /* @__PURE__ */
|
|
411
|
+
pageBreak: () => /* @__PURE__ */ n(
|
|
412
412
|
"hr",
|
|
413
413
|
{
|
|
414
414
|
style: {
|
|
@@ -418,7 +418,7 @@ const g = {
|
|
|
418
418
|
}
|
|
419
419
|
}
|
|
420
420
|
),
|
|
421
|
-
divider: () => /* @__PURE__ */
|
|
421
|
+
divider: () => /* @__PURE__ */ n(
|
|
422
422
|
"hr",
|
|
423
423
|
{
|
|
424
424
|
style: {
|
|
@@ -428,17 +428,17 @@ const g = {
|
|
|
428
428
|
}
|
|
429
429
|
}
|
|
430
430
|
)
|
|
431
|
-
}),
|
|
432
|
-
function
|
|
433
|
-
url:
|
|
431
|
+
}), j = H();
|
|
432
|
+
function w({
|
|
433
|
+
url: r,
|
|
434
434
|
name: e,
|
|
435
435
|
defaultText: t,
|
|
436
|
-
icon:
|
|
436
|
+
icon: l
|
|
437
437
|
}) {
|
|
438
438
|
return /* @__PURE__ */ h(
|
|
439
439
|
k,
|
|
440
440
|
{
|
|
441
|
-
href:
|
|
441
|
+
href: r,
|
|
442
442
|
style: {
|
|
443
443
|
textDecoration: "none",
|
|
444
444
|
color: "#333",
|
|
@@ -448,19 +448,19 @@ function x({
|
|
|
448
448
|
fontSize: 16
|
|
449
449
|
},
|
|
450
450
|
children: [
|
|
451
|
-
|
|
452
|
-
/* @__PURE__ */
|
|
451
|
+
l,
|
|
452
|
+
/* @__PURE__ */ n("span", { style: { verticalAlign: "middle" }, children: e || t })
|
|
453
453
|
]
|
|
454
454
|
}
|
|
455
455
|
);
|
|
456
456
|
}
|
|
457
|
-
function
|
|
458
|
-
caption:
|
|
457
|
+
function x({
|
|
458
|
+
caption: r,
|
|
459
459
|
width: e,
|
|
460
460
|
textStyles: t
|
|
461
461
|
}) {
|
|
462
|
-
var
|
|
463
|
-
return
|
|
462
|
+
var l;
|
|
463
|
+
return r ? /* @__PURE__ */ n(
|
|
464
464
|
f,
|
|
465
465
|
{
|
|
466
466
|
...t.caption,
|
|
@@ -470,20 +470,20 @@ function b({
|
|
|
470
470
|
color: "#888",
|
|
471
471
|
margin: "4px 0 0 0",
|
|
472
472
|
...m.caption.style,
|
|
473
|
-
...(
|
|
473
|
+
...(l = t.caption) == null ? void 0 : l.style
|
|
474
474
|
},
|
|
475
|
-
children:
|
|
475
|
+
children: r
|
|
476
476
|
}
|
|
477
477
|
) : null;
|
|
478
478
|
}
|
|
479
479
|
const S = {
|
|
480
480
|
link: {}
|
|
481
|
-
}, M = (
|
|
482
|
-
link: (e, t) => /* @__PURE__ */ h(k, { href: e.href, ...
|
|
483
|
-
...e.content.map((
|
|
481
|
+
}, M = (r = S) => ({
|
|
482
|
+
link: (e, t) => /* @__PURE__ */ h(k, { href: e.href, ...r.link, children: [
|
|
483
|
+
...e.content.map((l) => t.transformStyledText(l))
|
|
484
484
|
] }),
|
|
485
485
|
text: (e, t) => t.transformStyledText(e)
|
|
486
|
-
}), q = M(), B = {}, T = (
|
|
486
|
+
}), q = M(), B = {}, T = (r = B) => ({
|
|
487
487
|
bold: (e) => e ? {
|
|
488
488
|
fontWeight: "bold"
|
|
489
489
|
} : {},
|
|
@@ -511,55 +511,55 @@ const S = {
|
|
|
511
511
|
linkStyles: S,
|
|
512
512
|
styleTransformStyles: B
|
|
513
513
|
}, Y = {
|
|
514
|
-
blockMapping:
|
|
514
|
+
blockMapping: j,
|
|
515
515
|
inlineContentMapping: q,
|
|
516
516
|
styleMapping: $
|
|
517
|
-
}, ee = (
|
|
517
|
+
}, ee = (r = G) => ({
|
|
518
518
|
blockMapping: H(
|
|
519
|
-
|
|
519
|
+
r.textStyles
|
|
520
520
|
),
|
|
521
521
|
inlineContentMapping: M(
|
|
522
|
-
|
|
522
|
+
r.linkStyles
|
|
523
523
|
),
|
|
524
524
|
styleMapping: T(
|
|
525
|
-
|
|
525
|
+
r.styleTransformStyles
|
|
526
526
|
)
|
|
527
527
|
});
|
|
528
|
-
class te extends
|
|
529
|
-
constructor(e, t,
|
|
528
|
+
class te extends R {
|
|
529
|
+
constructor(e, t, l) {
|
|
530
530
|
const i = {
|
|
531
531
|
...{
|
|
532
|
-
colors:
|
|
532
|
+
colors: E
|
|
533
533
|
},
|
|
534
|
-
...
|
|
534
|
+
...l
|
|
535
535
|
};
|
|
536
536
|
super(e, t, i), this.schema = e;
|
|
537
537
|
}
|
|
538
538
|
transformStyledText(e) {
|
|
539
|
-
const t = this.mapStyles(e.styles),
|
|
540
|
-
return /* @__PURE__ */
|
|
539
|
+
const t = this.mapStyles(e.styles), l = Object.assign({}, ...t);
|
|
540
|
+
return /* @__PURE__ */ n(
|
|
541
541
|
"span",
|
|
542
542
|
{
|
|
543
|
-
style:
|
|
543
|
+
style: l,
|
|
544
544
|
dangerouslySetInnerHTML: {
|
|
545
545
|
__html: e.text.replace(/\n/g, "<br />")
|
|
546
546
|
}
|
|
547
547
|
}
|
|
548
548
|
);
|
|
549
549
|
}
|
|
550
|
-
async renderGroupedListBlocks(e, t,
|
|
550
|
+
async renderGroupedListBlocks(e, t, l) {
|
|
551
551
|
const o = e[t].type, i = [];
|
|
552
552
|
let a = t;
|
|
553
553
|
for (let u = 1; a < e.length && e[a].type === o; a++, u++) {
|
|
554
554
|
const s = e[a], c = await this.mapBlock(
|
|
555
555
|
s,
|
|
556
|
-
|
|
556
|
+
l,
|
|
557
557
|
u
|
|
558
558
|
);
|
|
559
559
|
let d = [];
|
|
560
560
|
s.children && s.children.length > 0 && (d = await this.renderNestedLists(
|
|
561
561
|
s.children,
|
|
562
|
-
|
|
562
|
+
l + 1,
|
|
563
563
|
s.id
|
|
564
564
|
)), i.push(
|
|
565
565
|
/* @__PURE__ */ h("li", { children: [
|
|
@@ -569,7 +569,7 @@ class te extends E {
|
|
|
569
569
|
);
|
|
570
570
|
}
|
|
571
571
|
let p;
|
|
572
|
-
return o === "bulletListItem" || o === "toggleListItem" ? p = /* @__PURE__ */
|
|
572
|
+
return o === "bulletListItem" || o === "toggleListItem" ? p = /* @__PURE__ */ n("ul", { className: "mb-2 list-disc pl-6", children: i }, e[t].id + "-ul") : p = /* @__PURE__ */ n(
|
|
573
573
|
"ol",
|
|
574
574
|
{
|
|
575
575
|
className: "mb-2 list-decimal pl-6",
|
|
@@ -579,7 +579,7 @@ class te extends E {
|
|
|
579
579
|
e[t].id + "-ol"
|
|
580
580
|
), { element: p, nextIndex: a };
|
|
581
581
|
}
|
|
582
|
-
async renderNestedLists(e, t,
|
|
582
|
+
async renderNestedLists(e, t, l) {
|
|
583
583
|
const o = [];
|
|
584
584
|
let i = 0;
|
|
585
585
|
for (; i < e.length; ) {
|
|
@@ -588,7 +588,7 @@ class te extends E {
|
|
|
588
588
|
const p = a.type, u = [];
|
|
589
589
|
let s = i;
|
|
590
590
|
for (let c = 1; s < e.length && e[s].type === p; s++, c++) {
|
|
591
|
-
const d = e[s],
|
|
591
|
+
const d = e[s], b = await this.mapBlock(
|
|
592
592
|
d,
|
|
593
593
|
t,
|
|
594
594
|
c
|
|
@@ -605,42 +605,42 @@ class te extends E {
|
|
|
605
605
|
t + 1
|
|
606
606
|
)), u.push(
|
|
607
607
|
/* @__PURE__ */ h("li", { style: C, children: [
|
|
608
|
-
|
|
609
|
-
y.length > 0 && /* @__PURE__ */
|
|
608
|
+
b,
|
|
609
|
+
y.length > 0 && /* @__PURE__ */ n("div", { style: { marginTop: "8px" }, children: y })
|
|
610
610
|
] }, d.id)
|
|
611
611
|
);
|
|
612
612
|
}
|
|
613
613
|
p === "bulletListItem" ? o.push(
|
|
614
|
-
/* @__PURE__ */
|
|
614
|
+
/* @__PURE__ */ n(
|
|
615
615
|
"ul",
|
|
616
616
|
{
|
|
617
617
|
className: "mb-2 list-disc pl-6",
|
|
618
618
|
children: u
|
|
619
619
|
},
|
|
620
|
-
|
|
620
|
+
l + "-ul-nested-" + i
|
|
621
621
|
)
|
|
622
622
|
) : o.push(
|
|
623
|
-
/* @__PURE__ */
|
|
623
|
+
/* @__PURE__ */ n(
|
|
624
624
|
"ol",
|
|
625
625
|
{
|
|
626
626
|
className: "mb-2 list-decimal pl-6",
|
|
627
627
|
start: 1,
|
|
628
628
|
children: u
|
|
629
629
|
},
|
|
630
|
-
|
|
630
|
+
l + "-ol-nested-" + i
|
|
631
631
|
)
|
|
632
632
|
), i = s;
|
|
633
633
|
} else {
|
|
634
634
|
const p = await this.transformBlocks([a], t);
|
|
635
635
|
o.push(
|
|
636
|
-
/* @__PURE__ */
|
|
636
|
+
/* @__PURE__ */ n(v, { style: { marginLeft: "24px" }, children: p }, a.id)
|
|
637
637
|
), i++;
|
|
638
638
|
}
|
|
639
639
|
}
|
|
640
640
|
return o;
|
|
641
641
|
}
|
|
642
642
|
async transformBlocks(e, t = 0) {
|
|
643
|
-
const
|
|
643
|
+
const l = [];
|
|
644
644
|
let o = 0;
|
|
645
645
|
for (; o < e.length; ) {
|
|
646
646
|
const i = e[o];
|
|
@@ -650,24 +650,25 @@ class te extends E {
|
|
|
650
650
|
o,
|
|
651
651
|
t
|
|
652
652
|
);
|
|
653
|
-
|
|
653
|
+
l.push(s), o = c;
|
|
654
654
|
continue;
|
|
655
655
|
}
|
|
656
656
|
const a = await this.transformBlocks(i.children, t + 1), p = await this.mapBlock(i, t, 0), u = this.blocknoteDefaultPropsToReactEmailStyle(i.props);
|
|
657
|
-
|
|
657
|
+
l.push(
|
|
658
658
|
/* @__PURE__ */ h(I.Fragment, { children: [
|
|
659
|
-
/* @__PURE__ */
|
|
660
|
-
a.length > 0 && /* @__PURE__ */
|
|
659
|
+
/* @__PURE__ */ n(v, { style: u, children: p }),
|
|
660
|
+
a.length > 0 && /* @__PURE__ */ n("div", { style: { marginLeft: "24px" }, children: a })
|
|
661
661
|
] }, i.id)
|
|
662
662
|
), o++;
|
|
663
663
|
}
|
|
664
|
-
return
|
|
664
|
+
return l;
|
|
665
665
|
}
|
|
666
666
|
async toReactEmailDocument(e, t) {
|
|
667
|
-
const
|
|
668
|
-
|
|
667
|
+
const l = await this.transformBlocks(e), o = (t == null ? void 0 : t.container) || (({ children: p }) => /* @__PURE__ */ n(I.Fragment, { children: p })), i = !globalThis.ReadableByteStreamController;
|
|
668
|
+
i && (globalThis.ReadableByteStreamController = (await import("web-streams-polyfill")).default.ReadableByteStreamController);
|
|
669
|
+
const a = await P(
|
|
669
670
|
/* @__PURE__ */ h(Z, { children: [
|
|
670
|
-
/* @__PURE__ */
|
|
671
|
+
/* @__PURE__ */ n(z, { children: t == null ? void 0 : t.head }),
|
|
671
672
|
/* @__PURE__ */ h(
|
|
672
673
|
N,
|
|
673
674
|
{
|
|
@@ -678,10 +679,10 @@ class te extends E {
|
|
|
678
679
|
color: "#333"
|
|
679
680
|
},
|
|
680
681
|
children: [
|
|
681
|
-
(t == null ? void 0 : t.preview) && /* @__PURE__ */
|
|
682
|
-
/* @__PURE__ */
|
|
682
|
+
(t == null ? void 0 : t.preview) && /* @__PURE__ */ n(_, { children: t.preview }),
|
|
683
|
+
/* @__PURE__ */ n(O, { children: /* @__PURE__ */ h(o, { children: [
|
|
683
684
|
t == null ? void 0 : t.header,
|
|
684
|
-
|
|
685
|
+
l,
|
|
685
686
|
t == null ? void 0 : t.footer
|
|
686
687
|
] }) })
|
|
687
688
|
]
|
|
@@ -689,13 +690,14 @@ class te extends E {
|
|
|
689
690
|
)
|
|
690
691
|
] })
|
|
691
692
|
);
|
|
693
|
+
return i && delete globalThis.ReadableByteStreamController, a;
|
|
692
694
|
}
|
|
693
695
|
blocknoteDefaultPropsToReactEmailStyle(e) {
|
|
694
|
-
var t,
|
|
696
|
+
var t, l;
|
|
695
697
|
return {
|
|
696
698
|
textAlign: e.textAlignment,
|
|
697
699
|
backgroundColor: e.backgroundColor === "default" || !e.backgroundColor || (t = this.options.colors[e.backgroundColor]) == null ? void 0 : t.background,
|
|
698
|
-
color: e.textColor === "default" || !e.textColor || (
|
|
700
|
+
color: e.textColor === "default" || !e.textColor || (l = this.options.colors[e.textColor]) == null ? void 0 : l.text,
|
|
699
701
|
alignItems: e.textAlignment === "right" ? "flex-end" : e.textAlignment === "center" ? "center" : void 0
|
|
700
702
|
};
|
|
701
703
|
}
|
|
@@ -709,7 +711,7 @@ export {
|
|
|
709
711
|
S as defaultReactEmailLinkStyles,
|
|
710
712
|
B as defaultReactEmailStyleTransformStyles,
|
|
711
713
|
m as defaultReactEmailTextStyles,
|
|
712
|
-
|
|
714
|
+
j as reactEmailBlockMappingForDefaultSchema,
|
|
713
715
|
Y as reactEmailDefaultSchemaMappings,
|
|
714
716
|
ee as reactEmailDefaultSchemaMappingsWithStyles,
|
|
715
717
|
q as reactEmailInlineContentMappingForDefaultSchema,
|