@blocknote/xl-email-exporter 0.32.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.
@@ -0,0 +1,1097 @@
1
+ import U from "react";
2
+ import { mapTableCell as vr, Exporter as mr, COLORS_DEFAULT as gr } from "@blocknote/core";
3
+ import { Text as k, Img as yr, CodeBlock as xr, dracula as br, Heading as Cr, Link as Pe, Section as Se, Html as Er, Head as jr, Body as Rr, Preview as wr, Tailwind as _r, Container as Tr } from "@react-email/components";
4
+ import { render as Sr } from "@react-email/render";
5
+ var te = { exports: {} }, H = {};
6
+ /**
7
+ * @license React
8
+ * react-jsx-runtime.production.min.js
9
+ *
10
+ * Copyright (c) Facebook, Inc. and its affiliates.
11
+ *
12
+ * This source code is licensed under the MIT license found in the
13
+ * LICENSE file in the root directory of this source tree.
14
+ */
15
+ var Oe;
16
+ function Or() {
17
+ if (Oe) return H;
18
+ Oe = 1;
19
+ var t = U, n = Symbol.for("react.element"), o = Symbol.for("react.fragment"), d = Object.prototype.hasOwnProperty, g = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, p = { key: !0, ref: !0, __self: !0, __source: !0 };
20
+ function y(C, h, u) {
21
+ var x, v = {}, _ = null, S = null;
22
+ u !== void 0 && (_ = "" + u), h.key !== void 0 && (_ = "" + h.key), h.ref !== void 0 && (S = h.ref);
23
+ for (x in h) d.call(h, x) && !p.hasOwnProperty(x) && (v[x] = h[x]);
24
+ if (C && C.defaultProps) for (x in h = C.defaultProps, h) v[x] === void 0 && (v[x] = h[x]);
25
+ return { $$typeof: n, type: C, key: _, ref: S, props: v, _owner: g.current };
26
+ }
27
+ return H.Fragment = o, H.jsx = y, H.jsxs = y, H;
28
+ }
29
+ var W = {};
30
+ /**
31
+ * @license React
32
+ * react-jsx-runtime.development.js
33
+ *
34
+ * Copyright (c) Facebook, Inc. and its affiliates.
35
+ *
36
+ * This source code is licensed under the MIT license found in the
37
+ * LICENSE file in the root directory of this source tree.
38
+ */
39
+ var ke;
40
+ function kr() {
41
+ return ke || (ke = 1, process.env.NODE_ENV !== "production" && function() {
42
+ var t = U, n = Symbol.for("react.element"), o = Symbol.for("react.portal"), d = Symbol.for("react.fragment"), g = Symbol.for("react.strict_mode"), p = Symbol.for("react.profiler"), y = Symbol.for("react.provider"), C = Symbol.for("react.context"), h = Symbol.for("react.forward_ref"), u = Symbol.for("react.suspense"), x = Symbol.for("react.suspense_list"), v = Symbol.for("react.memo"), _ = Symbol.for("react.lazy"), S = Symbol.for("react.offscreen"), P = Symbol.iterator, Ae = "@@iterator";
43
+ function Ie(e) {
44
+ if (e === null || typeof e != "object")
45
+ return null;
46
+ var r = P && e[P] || e[Ae];
47
+ return typeof r == "function" ? r : null;
48
+ }
49
+ var D = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
50
+ function j(e) {
51
+ {
52
+ for (var r = arguments.length, i = new Array(r > 1 ? r - 1 : 0), l = 1; l < r; l++)
53
+ i[l - 1] = arguments[l];
54
+ De("error", e, i);
55
+ }
56
+ }
57
+ function De(e, r, i) {
58
+ {
59
+ var l = D.ReactDebugCurrentFrame, f = l.getStackAddendum();
60
+ f !== "" && (r += "%s", i = i.concat([f]));
61
+ var m = i.map(function(c) {
62
+ return String(c);
63
+ });
64
+ m.unshift("Warning: " + r), Function.prototype.apply.call(console[e], console, m);
65
+ }
66
+ }
67
+ var Fe = !1, Le = !1, Ve = !1, Me = !1, He = !1, ne;
68
+ ne = Symbol.for("react.module.reference");
69
+ function We(e) {
70
+ return !!(typeof e == "string" || typeof e == "function" || e === d || e === p || He || e === g || e === u || e === x || Me || e === S || Fe || Le || Ve || typeof e == "object" && e !== null && (e.$$typeof === _ || e.$$typeof === v || e.$$typeof === y || e.$$typeof === C || e.$$typeof === h || // This needs to include all possible module reference object
71
+ // types supported by any Flight configuration anywhere since
72
+ // we don't know which Flight build this will end up being used
73
+ // with.
74
+ e.$$typeof === ne || e.getModuleId !== void 0));
75
+ }
76
+ function Be(e, r, i) {
77
+ var l = e.displayName;
78
+ if (l)
79
+ return l;
80
+ var f = r.displayName || r.name || "";
81
+ return f !== "" ? i + "(" + f + ")" : i;
82
+ }
83
+ function ie(e) {
84
+ return e.displayName || "Context";
85
+ }
86
+ function O(e) {
87
+ if (e == null)
88
+ return null;
89
+ if (typeof e.tag == "number" && j("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
90
+ return e.displayName || e.name || null;
91
+ if (typeof e == "string")
92
+ return e;
93
+ switch (e) {
94
+ case d:
95
+ return "Fragment";
96
+ case o:
97
+ return "Portal";
98
+ case p:
99
+ return "Profiler";
100
+ case g:
101
+ return "StrictMode";
102
+ case u:
103
+ return "Suspense";
104
+ case x:
105
+ return "SuspenseList";
106
+ }
107
+ if (typeof e == "object")
108
+ switch (e.$$typeof) {
109
+ case C:
110
+ var r = e;
111
+ return ie(r) + ".Consumer";
112
+ case y:
113
+ var i = e;
114
+ return ie(i._context) + ".Provider";
115
+ case h:
116
+ return Be(e, e.render, "ForwardRef");
117
+ case v:
118
+ var l = e.displayName || null;
119
+ return l !== null ? l : O(e.type) || "Memo";
120
+ case _: {
121
+ var f = e, m = f._payload, c = f._init;
122
+ try {
123
+ return O(c(m));
124
+ } catch {
125
+ return null;
126
+ }
127
+ }
128
+ }
129
+ return null;
130
+ }
131
+ var A = Object.assign, V = 0, ae, oe, le, se, ce, ue, fe;
132
+ function de() {
133
+ }
134
+ de.__reactDisabledLog = !0;
135
+ function $e() {
136
+ {
137
+ if (V === 0) {
138
+ ae = console.log, oe = console.info, le = console.warn, se = console.error, ce = console.group, ue = console.groupCollapsed, fe = console.groupEnd;
139
+ var e = {
140
+ configurable: !0,
141
+ enumerable: !0,
142
+ value: de,
143
+ writable: !0
144
+ };
145
+ Object.defineProperties(console, {
146
+ info: e,
147
+ log: e,
148
+ warn: e,
149
+ error: e,
150
+ group: e,
151
+ groupCollapsed: e,
152
+ groupEnd: e
153
+ });
154
+ }
155
+ V++;
156
+ }
157
+ }
158
+ function Ye() {
159
+ {
160
+ if (V--, V === 0) {
161
+ var e = {
162
+ configurable: !0,
163
+ enumerable: !0,
164
+ writable: !0
165
+ };
166
+ Object.defineProperties(console, {
167
+ log: A({}, e, {
168
+ value: ae
169
+ }),
170
+ info: A({}, e, {
171
+ value: oe
172
+ }),
173
+ warn: A({}, e, {
174
+ value: le
175
+ }),
176
+ error: A({}, e, {
177
+ value: se
178
+ }),
179
+ group: A({}, e, {
180
+ value: ce
181
+ }),
182
+ groupCollapsed: A({}, e, {
183
+ value: ue
184
+ }),
185
+ groupEnd: A({}, e, {
186
+ value: fe
187
+ })
188
+ });
189
+ }
190
+ V < 0 && j("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
191
+ }
192
+ }
193
+ var Z = D.ReactCurrentDispatcher, q;
194
+ function B(e, r, i) {
195
+ {
196
+ if (q === void 0)
197
+ try {
198
+ throw Error();
199
+ } catch (f) {
200
+ var l = f.stack.trim().match(/\n( *(at )?)/);
201
+ q = l && l[1] || "";
202
+ }
203
+ return `
204
+ ` + q + e;
205
+ }
206
+ }
207
+ var z = !1, $;
208
+ {
209
+ var Ne = typeof WeakMap == "function" ? WeakMap : Map;
210
+ $ = new Ne();
211
+ }
212
+ function pe(e, r) {
213
+ if (!e || z)
214
+ return "";
215
+ {
216
+ var i = $.get(e);
217
+ if (i !== void 0)
218
+ return i;
219
+ }
220
+ var l;
221
+ z = !0;
222
+ var f = Error.prepareStackTrace;
223
+ Error.prepareStackTrace = void 0;
224
+ var m;
225
+ m = Z.current, Z.current = null, $e();
226
+ try {
227
+ if (r) {
228
+ var c = function() {
229
+ throw Error();
230
+ };
231
+ if (Object.defineProperty(c.prototype, "props", {
232
+ set: function() {
233
+ throw Error();
234
+ }
235
+ }), typeof Reflect == "object" && Reflect.construct) {
236
+ try {
237
+ Reflect.construct(c, []);
238
+ } catch (w) {
239
+ l = w;
240
+ }
241
+ Reflect.construct(e, [], c);
242
+ } else {
243
+ try {
244
+ c.call();
245
+ } catch (w) {
246
+ l = w;
247
+ }
248
+ e.call(c.prototype);
249
+ }
250
+ } else {
251
+ try {
252
+ throw Error();
253
+ } catch (w) {
254
+ l = w;
255
+ }
256
+ e();
257
+ }
258
+ } catch (w) {
259
+ if (w && l && typeof w.stack == "string") {
260
+ for (var s = w.stack.split(`
261
+ `), R = l.stack.split(`
262
+ `), b = s.length - 1, E = R.length - 1; b >= 1 && E >= 0 && s[b] !== R[E]; )
263
+ E--;
264
+ for (; b >= 1 && E >= 0; b--, E--)
265
+ if (s[b] !== R[E]) {
266
+ if (b !== 1 || E !== 1)
267
+ do
268
+ if (b--, E--, E < 0 || s[b] !== R[E]) {
269
+ var T = `
270
+ ` + s[b].replace(" at new ", " at ");
271
+ return e.displayName && T.includes("<anonymous>") && (T = T.replace("<anonymous>", e.displayName)), typeof e == "function" && $.set(e, T), T;
272
+ }
273
+ while (b >= 1 && E >= 0);
274
+ break;
275
+ }
276
+ }
277
+ } finally {
278
+ z = !1, Z.current = m, Ye(), Error.prepareStackTrace = f;
279
+ }
280
+ var L = e ? e.displayName || e.name : "", I = L ? B(L) : "";
281
+ return typeof e == "function" && $.set(e, I), I;
282
+ }
283
+ function Ue(e, r, i) {
284
+ return pe(e, !1);
285
+ }
286
+ function Ze(e) {
287
+ var r = e.prototype;
288
+ return !!(r && r.isReactComponent);
289
+ }
290
+ function Y(e, r, i) {
291
+ if (e == null)
292
+ return "";
293
+ if (typeof e == "function")
294
+ return pe(e, Ze(e));
295
+ if (typeof e == "string")
296
+ return B(e);
297
+ switch (e) {
298
+ case u:
299
+ return B("Suspense");
300
+ case x:
301
+ return B("SuspenseList");
302
+ }
303
+ if (typeof e == "object")
304
+ switch (e.$$typeof) {
305
+ case h:
306
+ return Ue(e.render);
307
+ case v:
308
+ return Y(e.type, r, i);
309
+ case _: {
310
+ var l = e, f = l._payload, m = l._init;
311
+ try {
312
+ return Y(m(f), r, i);
313
+ } catch {
314
+ }
315
+ }
316
+ }
317
+ return "";
318
+ }
319
+ var M = Object.prototype.hasOwnProperty, he = {}, ve = D.ReactDebugCurrentFrame;
320
+ function N(e) {
321
+ if (e) {
322
+ var r = e._owner, i = Y(e.type, e._source, r ? r.type : null);
323
+ ve.setExtraStackFrame(i);
324
+ } else
325
+ ve.setExtraStackFrame(null);
326
+ }
327
+ function qe(e, r, i, l, f) {
328
+ {
329
+ var m = Function.call.bind(M);
330
+ for (var c in e)
331
+ if (m(e, c)) {
332
+ var s = void 0;
333
+ try {
334
+ if (typeof e[c] != "function") {
335
+ var R = Error((l || "React class") + ": " + i + " type `" + c + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[c] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
336
+ throw R.name = "Invariant Violation", R;
337
+ }
338
+ s = e[c](r, c, l, i, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
339
+ } catch (b) {
340
+ s = b;
341
+ }
342
+ s && !(s instanceof Error) && (N(f), j("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", l || "React class", i, c, typeof s), N(null)), s instanceof Error && !(s.message in he) && (he[s.message] = !0, N(f), j("Failed %s type: %s", i, s.message), N(null));
343
+ }
344
+ }
345
+ }
346
+ var ze = Array.isArray;
347
+ function J(e) {
348
+ return ze(e);
349
+ }
350
+ function Je(e) {
351
+ {
352
+ var r = typeof Symbol == "function" && Symbol.toStringTag, i = r && e[Symbol.toStringTag] || e.constructor.name || "Object";
353
+ return i;
354
+ }
355
+ }
356
+ function Ge(e) {
357
+ try {
358
+ return me(e), !1;
359
+ } catch {
360
+ return !0;
361
+ }
362
+ }
363
+ function me(e) {
364
+ return "" + e;
365
+ }
366
+ function ge(e) {
367
+ if (Ge(e))
368
+ return j("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Je(e)), me(e);
369
+ }
370
+ var ye = D.ReactCurrentOwner, Ke = {
371
+ key: !0,
372
+ ref: !0,
373
+ __self: !0,
374
+ __source: !0
375
+ }, xe, be;
376
+ function Xe(e) {
377
+ if (M.call(e, "ref")) {
378
+ var r = Object.getOwnPropertyDescriptor(e, "ref").get;
379
+ if (r && r.isReactWarning)
380
+ return !1;
381
+ }
382
+ return e.ref !== void 0;
383
+ }
384
+ function Qe(e) {
385
+ if (M.call(e, "key")) {
386
+ var r = Object.getOwnPropertyDescriptor(e, "key").get;
387
+ if (r && r.isReactWarning)
388
+ return !1;
389
+ }
390
+ return e.key !== void 0;
391
+ }
392
+ function er(e, r) {
393
+ typeof e.ref == "string" && ye.current;
394
+ }
395
+ function rr(e, r) {
396
+ {
397
+ var i = function() {
398
+ xe || (xe = !0, j("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", r));
399
+ };
400
+ i.isReactWarning = !0, Object.defineProperty(e, "key", {
401
+ get: i,
402
+ configurable: !0
403
+ });
404
+ }
405
+ }
406
+ function tr(e, r) {
407
+ {
408
+ var i = function() {
409
+ be || (be = !0, j("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", r));
410
+ };
411
+ i.isReactWarning = !0, Object.defineProperty(e, "ref", {
412
+ get: i,
413
+ configurable: !0
414
+ });
415
+ }
416
+ }
417
+ var nr = function(e, r, i, l, f, m, c) {
418
+ var s = {
419
+ // This tag allows us to uniquely identify this as a React Element
420
+ $$typeof: n,
421
+ // Built-in properties that belong on the element
422
+ type: e,
423
+ key: r,
424
+ ref: i,
425
+ props: c,
426
+ // Record the component responsible for creating this element.
427
+ _owner: m
428
+ };
429
+ return s._store = {}, Object.defineProperty(s._store, "validated", {
430
+ configurable: !1,
431
+ enumerable: !1,
432
+ writable: !0,
433
+ value: !1
434
+ }), Object.defineProperty(s, "_self", {
435
+ configurable: !1,
436
+ enumerable: !1,
437
+ writable: !1,
438
+ value: l
439
+ }), Object.defineProperty(s, "_source", {
440
+ configurable: !1,
441
+ enumerable: !1,
442
+ writable: !1,
443
+ value: f
444
+ }), Object.freeze && (Object.freeze(s.props), Object.freeze(s)), s;
445
+ };
446
+ function ir(e, r, i, l, f) {
447
+ {
448
+ var m, c = {}, s = null, R = null;
449
+ i !== void 0 && (ge(i), s = "" + i), Qe(r) && (ge(r.key), s = "" + r.key), Xe(r) && (R = r.ref, er(r, f));
450
+ for (m in r)
451
+ M.call(r, m) && !Ke.hasOwnProperty(m) && (c[m] = r[m]);
452
+ if (e && e.defaultProps) {
453
+ var b = e.defaultProps;
454
+ for (m in b)
455
+ c[m] === void 0 && (c[m] = b[m]);
456
+ }
457
+ if (s || R) {
458
+ var E = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
459
+ s && rr(c, E), R && tr(c, E);
460
+ }
461
+ return nr(e, s, R, f, l, ye.current, c);
462
+ }
463
+ }
464
+ var G = D.ReactCurrentOwner, Ce = D.ReactDebugCurrentFrame;
465
+ function F(e) {
466
+ if (e) {
467
+ var r = e._owner, i = Y(e.type, e._source, r ? r.type : null);
468
+ Ce.setExtraStackFrame(i);
469
+ } else
470
+ Ce.setExtraStackFrame(null);
471
+ }
472
+ var K;
473
+ K = !1;
474
+ function X(e) {
475
+ return typeof e == "object" && e !== null && e.$$typeof === n;
476
+ }
477
+ function Ee() {
478
+ {
479
+ if (G.current) {
480
+ var e = O(G.current.type);
481
+ if (e)
482
+ return `
483
+
484
+ Check the render method of \`` + e + "`.";
485
+ }
486
+ return "";
487
+ }
488
+ }
489
+ function ar(e) {
490
+ return "";
491
+ }
492
+ var je = {};
493
+ function or(e) {
494
+ {
495
+ var r = Ee();
496
+ if (!r) {
497
+ var i = typeof e == "string" ? e : e.displayName || e.name;
498
+ i && (r = `
499
+
500
+ Check the top-level render call using <` + i + ">.");
501
+ }
502
+ return r;
503
+ }
504
+ }
505
+ function Re(e, r) {
506
+ {
507
+ if (!e._store || e._store.validated || e.key != null)
508
+ return;
509
+ e._store.validated = !0;
510
+ var i = or(r);
511
+ if (je[i])
512
+ return;
513
+ je[i] = !0;
514
+ var l = "";
515
+ e && e._owner && e._owner !== G.current && (l = " It was passed a child from " + O(e._owner.type) + "."), F(e), j('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', i, l), F(null);
516
+ }
517
+ }
518
+ function we(e, r) {
519
+ {
520
+ if (typeof e != "object")
521
+ return;
522
+ if (J(e))
523
+ for (var i = 0; i < e.length; i++) {
524
+ var l = e[i];
525
+ X(l) && Re(l, r);
526
+ }
527
+ else if (X(e))
528
+ e._store && (e._store.validated = !0);
529
+ else if (e) {
530
+ var f = Ie(e);
531
+ if (typeof f == "function" && f !== e.entries)
532
+ for (var m = f.call(e), c; !(c = m.next()).done; )
533
+ X(c.value) && Re(c.value, r);
534
+ }
535
+ }
536
+ }
537
+ function lr(e) {
538
+ {
539
+ var r = e.type;
540
+ if (r == null || typeof r == "string")
541
+ return;
542
+ var i;
543
+ if (typeof r == "function")
544
+ i = r.propTypes;
545
+ else if (typeof r == "object" && (r.$$typeof === h || // Note: Memo only checks outer props here.
546
+ // Inner props are checked in the reconciler.
547
+ r.$$typeof === v))
548
+ i = r.propTypes;
549
+ else
550
+ return;
551
+ if (i) {
552
+ var l = O(r);
553
+ qe(i, e.props, "prop", l, e);
554
+ } else if (r.PropTypes !== void 0 && !K) {
555
+ K = !0;
556
+ var f = O(r);
557
+ j("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", f || "Unknown");
558
+ }
559
+ typeof r.getDefaultProps == "function" && !r.getDefaultProps.isReactClassApproved && j("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
560
+ }
561
+ }
562
+ function sr(e) {
563
+ {
564
+ for (var r = Object.keys(e.props), i = 0; i < r.length; i++) {
565
+ var l = r[i];
566
+ if (l !== "children" && l !== "key") {
567
+ F(e), j("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", l), F(null);
568
+ break;
569
+ }
570
+ }
571
+ e.ref !== null && (F(e), j("Invalid attribute `ref` supplied to `React.Fragment`."), F(null));
572
+ }
573
+ }
574
+ var _e = {};
575
+ function Te(e, r, i, l, f, m) {
576
+ {
577
+ var c = We(e);
578
+ if (!c) {
579
+ var s = "";
580
+ (e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (s += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
581
+ var R = ar();
582
+ R ? s += R : s += Ee();
583
+ var b;
584
+ e === null ? b = "null" : J(e) ? b = "array" : e !== void 0 && e.$$typeof === n ? (b = "<" + (O(e.type) || "Unknown") + " />", s = " Did you accidentally export a JSX literal instead of a component?") : b = typeof e, j("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", b, s);
585
+ }
586
+ var E = ir(e, r, i, f, m);
587
+ if (E == null)
588
+ return E;
589
+ if (c) {
590
+ var T = r.children;
591
+ if (T !== void 0)
592
+ if (l)
593
+ if (J(T)) {
594
+ for (var L = 0; L < T.length; L++)
595
+ we(T[L], e);
596
+ Object.freeze && Object.freeze(T);
597
+ } else
598
+ j("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
599
+ else
600
+ we(T, e);
601
+ }
602
+ if (M.call(r, "key")) {
603
+ var I = O(e), w = Object.keys(r).filter(function(hr) {
604
+ return hr !== "key";
605
+ }), Q = w.length > 0 ? "{key: someKey, " + w.join(": ..., ") + ": ...}" : "{key: someKey}";
606
+ if (!_e[I + Q]) {
607
+ var pr = w.length > 0 ? "{" + w.join(": ..., ") + ": ...}" : "{}";
608
+ j(`A props object containing a "key" prop is being spread into JSX:
609
+ let props = %s;
610
+ <%s {...props} />
611
+ React keys must be passed directly to JSX without using spread:
612
+ let props = %s;
613
+ <%s key={someKey} {...props} />`, Q, I, pr, I), _e[I + Q] = !0;
614
+ }
615
+ }
616
+ return e === d ? sr(E) : lr(E), E;
617
+ }
618
+ }
619
+ function cr(e, r, i) {
620
+ return Te(e, r, i, !0);
621
+ }
622
+ function ur(e, r, i) {
623
+ return Te(e, r, i, !1);
624
+ }
625
+ var fr = ur, dr = cr;
626
+ W.Fragment = d, W.jsx = fr, W.jsxs = dr;
627
+ }()), W;
628
+ }
629
+ process.env.NODE_ENV === "production" ? te.exports = Or() : te.exports = kr();
630
+ var a = te.exports;
631
+ const Pr = {
632
+ paragraph: (t, n) => /* @__PURE__ */ a.jsx(k, { children: n.transformInlineContent(t.content) }),
633
+ bulletListItem: (t, n) => /* @__PURE__ */ a.jsx(k, { children: n.transformInlineContent(t.content) }),
634
+ toggleListItem: (t, n) => /* @__PURE__ */ a.jsx(k, { children: n.transformInlineContent(t.content) }),
635
+ numberedListItem: (t, n, o) => /* @__PURE__ */ a.jsx(k, { children: n.transformInlineContent(t.content) }),
636
+ checkListItem: (t, n) => {
637
+ var g;
638
+ const d = ((g = t.props) == null ? void 0 : g.checked) ? /* @__PURE__ */ a.jsxs(
639
+ "svg",
640
+ {
641
+ width: "18",
642
+ height: "18",
643
+ viewBox: "0 0 18 18",
644
+ style: { display: "inline", verticalAlign: "middle", marginRight: 8 },
645
+ children: [
646
+ /* @__PURE__ */ a.jsx(
647
+ "rect",
648
+ {
649
+ x: "2",
650
+ y: "2",
651
+ width: "14",
652
+ height: "14",
653
+ rx: "3",
654
+ fill: "#4F8A10",
655
+ stroke: "#4F8A10",
656
+ strokeWidth: "2"
657
+ }
658
+ ),
659
+ /* @__PURE__ */ a.jsx(
660
+ "polyline",
661
+ {
662
+ points: "5,10 8,13 13,6",
663
+ fill: "none",
664
+ stroke: "#fff",
665
+ strokeWidth: "2"
666
+ }
667
+ )
668
+ ]
669
+ }
670
+ ) : /* @__PURE__ */ a.jsx(
671
+ "svg",
672
+ {
673
+ width: "18",
674
+ height: "18",
675
+ viewBox: "0 0 18 18",
676
+ style: { display: "inline", verticalAlign: "middle", marginRight: 8 },
677
+ children: /* @__PURE__ */ a.jsx(
678
+ "rect",
679
+ {
680
+ x: "2",
681
+ y: "2",
682
+ width: "14",
683
+ height: "14",
684
+ rx: "3",
685
+ fill: "#fff",
686
+ stroke: "#888",
687
+ strokeWidth: "2"
688
+ }
689
+ )
690
+ }
691
+ );
692
+ return /* @__PURE__ */ a.jsxs(k, { children: [
693
+ d,
694
+ /* @__PURE__ */ a.jsx("span", { children: n.transformInlineContent(t.content) })
695
+ ] });
696
+ },
697
+ heading: (t, n) => /* @__PURE__ */ a.jsx(Cr, { as: `h${t.props.level}`, children: n.transformInlineContent(t.content) }),
698
+ codeBlock: (t) => {
699
+ var o;
700
+ const n = ((o = t.content[0]) == null ? void 0 : o.text) || "";
701
+ return /* @__PURE__ */ a.jsx(
702
+ xr,
703
+ {
704
+ code: n,
705
+ fontFamily: "'CommitMono', monospace",
706
+ language: t.props.language,
707
+ theme: br
708
+ }
709
+ );
710
+ },
711
+ audio: (t) => {
712
+ const n = /* @__PURE__ */ a.jsx(
713
+ "svg",
714
+ {
715
+ height: "18",
716
+ width: "18",
717
+ viewBox: "0 0 24 24",
718
+ fill: "#4F8A10",
719
+ style: { display: "inline", verticalAlign: "middle" },
720
+ children: /* @__PURE__ */ a.jsx("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" })
721
+ }
722
+ ), o = "previewWidth" in t.props ? t.props.previewWidth : void 0;
723
+ return /* @__PURE__ */ a.jsxs("div", { style: { margin: "8px 0" }, children: [
724
+ /* @__PURE__ */ a.jsx(
725
+ ee,
726
+ {
727
+ url: t.props.url,
728
+ name: t.props.name,
729
+ defaultText: "Open audio file",
730
+ icon: n
731
+ }
732
+ ),
733
+ /* @__PURE__ */ a.jsx(re, { caption: t.props.caption, width: o })
734
+ ] });
735
+ },
736
+ video: (t) => {
737
+ const n = /* @__PURE__ */ a.jsx(
738
+ "svg",
739
+ {
740
+ height: "18",
741
+ width: "18",
742
+ viewBox: "0 0 24 24",
743
+ fill: "#1976D2",
744
+ style: { display: "inline", verticalAlign: "middle" },
745
+ children: /* @__PURE__ */ a.jsx("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" })
746
+ }
747
+ ), o = "previewWidth" in t.props ? t.props.previewWidth : void 0;
748
+ return /* @__PURE__ */ a.jsxs("div", { style: { margin: "8px 0" }, children: [
749
+ /* @__PURE__ */ a.jsx(
750
+ ee,
751
+ {
752
+ url: t.props.url,
753
+ name: t.props.name,
754
+ defaultText: "Open video file",
755
+ icon: n
756
+ }
757
+ ),
758
+ /* @__PURE__ */ a.jsx(re, { caption: t.props.caption, width: o })
759
+ ] });
760
+ },
761
+ file: (t) => {
762
+ const n = /* @__PURE__ */ a.jsx(
763
+ "svg",
764
+ {
765
+ height: "18",
766
+ width: "18",
767
+ viewBox: "0 0 24 24",
768
+ fill: "#888",
769
+ style: { display: "inline", verticalAlign: "middle" },
770
+ children: /* @__PURE__ */ a.jsx("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" })
771
+ }
772
+ ), o = "previewWidth" in t.props ? t.props.previewWidth : void 0;
773
+ return /* @__PURE__ */ a.jsxs("div", { style: { margin: "8px 0" }, children: [
774
+ /* @__PURE__ */ a.jsx(
775
+ ee,
776
+ {
777
+ url: t.props.url,
778
+ name: t.props.name,
779
+ defaultText: "Open file",
780
+ icon: n
781
+ }
782
+ ),
783
+ /* @__PURE__ */ a.jsx(re, { caption: t.props.caption, width: o })
784
+ ] });
785
+ },
786
+ image: (t) => /* @__PURE__ */ a.jsx(
787
+ yr,
788
+ {
789
+ src: t.props.url,
790
+ width: t.props.previewWidth,
791
+ alt: t.props.caption
792
+ }
793
+ ),
794
+ table: (t, n) => {
795
+ const o = t.content;
796
+ if (!o || typeof o != "object" || !Array.isArray(o.rows))
797
+ return /* @__PURE__ */ a.jsx(k, { children: "Table data not available" });
798
+ const d = o.headerRows ?? 0, g = o.headerCols ?? 0;
799
+ return /* @__PURE__ */ a.jsx(
800
+ "table",
801
+ {
802
+ style: {
803
+ borderCollapse: "collapse",
804
+ width: "100%",
805
+ margin: "16px 0",
806
+ border: "1px solid #ddd",
807
+ borderRadius: 4,
808
+ overflow: "hidden"
809
+ },
810
+ border: 0,
811
+ cellPadding: 0,
812
+ cellSpacing: 0,
813
+ children: /* @__PURE__ */ a.jsx("tbody", { children: o.rows.map((p, y) => /* @__PURE__ */ a.jsx("tr", { children: p.cells.map((C, h) => {
814
+ const u = vr(C), x = y < d, v = h < g, _ = x || v, S = _ ? "th" : "td";
815
+ return /* @__PURE__ */ a.jsx(
816
+ S,
817
+ {
818
+ style: {
819
+ border: "1px solid #ddd",
820
+ padding: "8px 12px",
821
+ background: _ ? "#f5f5f5" : u.props.backgroundColor !== "default" ? u.props.backgroundColor : "#fff",
822
+ fontWeight: _ ? "bold" : "normal",
823
+ textAlign: u.props.textAlignment || "left",
824
+ color: u.props.textColor !== "default" ? u.props.textColor : "inherit"
825
+ },
826
+ ...(u.props.colspan || 1) > 1 && {
827
+ colSpan: u.props.colspan || 1
828
+ },
829
+ ...(u.props.rowspan || 1) > 1 && {
830
+ rowSpan: u.props.rowspan || 1
831
+ },
832
+ children: n.transformInlineContent(u.content)
833
+ },
834
+ "row_" + y + "_col_" + h
835
+ );
836
+ }) }, "row-" + y)) })
837
+ }
838
+ );
839
+ },
840
+ quote: (t, n) => /* @__PURE__ */ a.jsx(
841
+ k,
842
+ {
843
+ style: {
844
+ borderLeft: "4px solid #bdbdbd",
845
+ background: "#f9f9f9",
846
+ padding: "12px 16px",
847
+ margin: "16px 0",
848
+ fontStyle: "italic",
849
+ color: "#555",
850
+ display: "block"
851
+ },
852
+ children: n.transformInlineContent(t.content)
853
+ }
854
+ ),
855
+ pageBreak: () => /* @__PURE__ */ a.jsx(
856
+ "hr",
857
+ {
858
+ style: {
859
+ border: "none",
860
+ borderTop: "2px dashed #ccc",
861
+ margin: "24px 0"
862
+ }
863
+ }
864
+ )
865
+ };
866
+ function ee({
867
+ url: t,
868
+ name: n,
869
+ defaultText: o,
870
+ icon: d
871
+ }) {
872
+ return /* @__PURE__ */ a.jsxs(
873
+ Pe,
874
+ {
875
+ href: t,
876
+ style: {
877
+ textDecoration: "none",
878
+ color: "#333",
879
+ display: "inline-flex",
880
+ alignItems: "center",
881
+ gap: 8,
882
+ fontSize: 16
883
+ },
884
+ children: [
885
+ d,
886
+ /* @__PURE__ */ a.jsx("span", { style: { verticalAlign: "middle" }, children: n || o })
887
+ ]
888
+ }
889
+ );
890
+ }
891
+ function re({ caption: t, width: n }) {
892
+ return t ? /* @__PURE__ */ a.jsx(k, { style: { width: n, fontSize: 13, color: "#888", margin: "4px 0 0 0" }, children: t }) : null;
893
+ }
894
+ const Ar = {
895
+ link: (t, n) => /* @__PURE__ */ a.jsxs(Pe, { href: t.href, children: [
896
+ ...t.content.map((o) => n.transformStyledText(o))
897
+ ] }),
898
+ text: (t, n) => n.transformStyledText(t)
899
+ }, Ir = {
900
+ bold: (t) => t ? {
901
+ fontWeight: "bold"
902
+ } : {},
903
+ italic: (t) => t ? {
904
+ fontStyle: "italic"
905
+ } : {},
906
+ underline: (t) => t ? {
907
+ textDecoration: "underline"
908
+ // TODO: could conflict with strike
909
+ } : {},
910
+ strike: (t) => t ? {
911
+ textDecoration: "line-through"
912
+ } : {},
913
+ backgroundColor: (t) => ({
914
+ backgroundColor: t
915
+ }),
916
+ textColor: (t) => t ? {
917
+ color: t
918
+ } : {},
919
+ code: (t) => t ? {
920
+ fontFamily: "Courier"
921
+ } : {}
922
+ }, Mr = {
923
+ blockMapping: Pr,
924
+ inlineContentMapping: Ar,
925
+ styleMapping: Ir
926
+ };
927
+ class Hr extends mr {
928
+ constructor(n, o, d) {
929
+ const p = {
930
+ ...{
931
+ colors: gr
932
+ },
933
+ ...d
934
+ };
935
+ super(n, o, p), this.schema = n;
936
+ }
937
+ transformStyledText(n) {
938
+ const o = this.mapStyles(n.styles), d = Object.assign({}, ...o);
939
+ return /* @__PURE__ */ a.jsx("span", { style: d, children: n.text });
940
+ }
941
+ async renderGroupedListBlocks(n, o, d) {
942
+ const g = n[o].type, p = [];
943
+ let y = o;
944
+ for (let h = 1; y < n.length && n[y].type === g; y++, h++) {
945
+ const u = n[y], x = await this.mapBlock(
946
+ u,
947
+ d,
948
+ h
949
+ );
950
+ let v = [];
951
+ u.children && u.children.length > 0 && (v = await this.renderNestedLists(
952
+ u.children,
953
+ d + 1,
954
+ u.id
955
+ )), p.push(
956
+ /* @__PURE__ */ a.jsxs(U.Fragment, { children: [
957
+ x,
958
+ v.length > 0 && v
959
+ ] }, u.id)
960
+ );
961
+ }
962
+ let C;
963
+ return g === "bulletListItem" || g === "toggleListItem" ? C = /* @__PURE__ */ a.jsx("ul", { className: "mb-2 list-disc pl-6", children: p }, n[o].id + "-ul") : C = /* @__PURE__ */ a.jsx(
964
+ "ol",
965
+ {
966
+ className: "mb-2 list-decimal pl-6",
967
+ start: 1,
968
+ children: p
969
+ },
970
+ n[o].id + "-ol"
971
+ ), { element: C, nextIndex: y };
972
+ }
973
+ async renderNestedLists(n, o, d) {
974
+ const g = [];
975
+ let p = 0;
976
+ for (; p < n.length; ) {
977
+ const y = n[p];
978
+ if (y.type === "bulletListItem" || y.type === "numberedListItem") {
979
+ const C = y.type, h = [];
980
+ let u = p;
981
+ for (let x = 1; u < n.length && n[u].type === C; u++, x++) {
982
+ const v = n[u], _ = await this.mapBlock(
983
+ v,
984
+ o,
985
+ x
986
+ ), S = this.blocknoteDefaultPropsToReactEmailStyle(
987
+ v.props
988
+ );
989
+ let P = [];
990
+ v.children && v.children.length > 0 && (v.children[0] && (v.children[0].type === "bulletListItem" || v.children[0].type === "numberedListItem") ? P = await this.renderNestedLists(
991
+ v.children,
992
+ o + 1,
993
+ v.id
994
+ ) : P = await this.transformBlocks(
995
+ v.children,
996
+ o + 1
997
+ )), h.push(
998
+ /* @__PURE__ */ a.jsxs("li", { style: S, children: [
999
+ _,
1000
+ P.length > 0 && /* @__PURE__ */ a.jsx("div", { style: { marginTop: "8px" }, children: P })
1001
+ ] }, v.id)
1002
+ );
1003
+ }
1004
+ C === "bulletListItem" ? g.push(
1005
+ /* @__PURE__ */ a.jsx(
1006
+ "ul",
1007
+ {
1008
+ className: "mb-2 list-disc pl-6",
1009
+ children: h
1010
+ },
1011
+ d + "-ul-nested-" + p
1012
+ )
1013
+ ) : g.push(
1014
+ /* @__PURE__ */ a.jsx(
1015
+ "ol",
1016
+ {
1017
+ className: "mb-2 list-decimal pl-6",
1018
+ start: 1,
1019
+ children: h
1020
+ },
1021
+ d + "-ol-nested-" + p
1022
+ )
1023
+ ), p = u;
1024
+ } else {
1025
+ const C = await this.transformBlocks([y], o);
1026
+ g.push(
1027
+ /* @__PURE__ */ a.jsx(Se, { style: { marginLeft: "24px" }, children: C }, y.id)
1028
+ ), p++;
1029
+ }
1030
+ }
1031
+ return g;
1032
+ }
1033
+ async transformBlocks(n, o = 0) {
1034
+ const d = [];
1035
+ let g = 0;
1036
+ for (; g < n.length; ) {
1037
+ const p = n[g];
1038
+ if (p.type === "bulletListItem" || p.type === "numberedListItem") {
1039
+ const { element: u, nextIndex: x } = await this.renderGroupedListBlocks(
1040
+ n,
1041
+ g,
1042
+ o
1043
+ );
1044
+ d.push(u), g = x;
1045
+ continue;
1046
+ }
1047
+ const y = await this.transformBlocks(p.children, o + 1), C = await this.mapBlock(p, o, 0), h = this.blocknoteDefaultPropsToReactEmailStyle(p.props);
1048
+ d.push(
1049
+ /* @__PURE__ */ a.jsxs(U.Fragment, { children: [
1050
+ /* @__PURE__ */ a.jsx(Se, { style: h, children: C }),
1051
+ y.length > 0 && /* @__PURE__ */ a.jsx("div", { style: { marginLeft: "24px" }, children: y })
1052
+ ] }, p.id)
1053
+ ), g++;
1054
+ }
1055
+ return d;
1056
+ }
1057
+ async toReactEmailDocument(n, o) {
1058
+ const d = await this.transformBlocks(n);
1059
+ return Sr(
1060
+ /* @__PURE__ */ a.jsxs(Er, { children: [
1061
+ /* @__PURE__ */ a.jsx(jr, { children: o == null ? void 0 : o.head }),
1062
+ /* @__PURE__ */ a.jsxs(
1063
+ Rr,
1064
+ {
1065
+ style: {
1066
+ fontFamily: "'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif",
1067
+ fontSize: "16px",
1068
+ lineHeight: "1.5",
1069
+ color: "#333"
1070
+ },
1071
+ children: [
1072
+ (o == null ? void 0 : o.preview) && /* @__PURE__ */ a.jsx(wr, { children: o.preview }),
1073
+ /* @__PURE__ */ a.jsx(_r, { children: /* @__PURE__ */ a.jsxs(Tr, { children: [
1074
+ o == null ? void 0 : o.header,
1075
+ d,
1076
+ o == null ? void 0 : o.footer
1077
+ ] }) })
1078
+ ]
1079
+ }
1080
+ )
1081
+ ] })
1082
+ );
1083
+ }
1084
+ blocknoteDefaultPropsToReactEmailStyle(n) {
1085
+ return {
1086
+ textAlign: n.textAlignment,
1087
+ backgroundColor: n.backgroundColor === "default" || !n.backgroundColor ? void 0 : this.options.colors[n.backgroundColor].background,
1088
+ color: n.textColor === "default" || !n.textColor ? void 0 : this.options.colors[n.textColor].text,
1089
+ alignItems: n.textAlignment === "right" ? "flex-end" : n.textAlignment === "center" ? "center" : void 0
1090
+ };
1091
+ }
1092
+ }
1093
+ export {
1094
+ Hr as ReactEmailExporter,
1095
+ Mr as reactEmailDefaultSchemaMappings
1096
+ };
1097
+ //# sourceMappingURL=blocknote-xl-email-exporter.js.map