@react-email/editor 0.0.0-canary.49

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.
Files changed (80) hide show
  1. package/dist/columns-D1gzbJr5.cjs +404 -0
  2. package/dist/columns-TFI4L-IC.mjs +277 -0
  3. package/dist/columns-TFI4L-IC.mjs.map +1 -0
  4. package/dist/core/index.cjs +9 -0
  5. package/dist/core/index.d.cts +2 -0
  6. package/dist/core/index.d.mts +2 -0
  7. package/dist/core/index.mjs +4 -0
  8. package/dist/core-Dp3tVCOZ.mjs +156 -0
  9. package/dist/core-Dp3tVCOZ.mjs.map +1 -0
  10. package/dist/core-NV1Aun-R.cjs +173 -0
  11. package/dist/event-bus-BxVEXi1L.mjs +88 -0
  12. package/dist/event-bus-BxVEXi1L.mjs.map +1 -0
  13. package/dist/event-bus-WI0H5tIM.cjs +105 -0
  14. package/dist/extension-CfIsm0_p.cjs +1504 -0
  15. package/dist/extension-n2yYIR7e.mjs +1403 -0
  16. package/dist/extension-n2yYIR7e.mjs.map +1 -0
  17. package/dist/extensions/index.cjs +51 -0
  18. package/dist/extensions/index.d.cts +401 -0
  19. package/dist/extensions/index.d.cts.map +1 -0
  20. package/dist/extensions/index.d.mts +401 -0
  21. package/dist/extensions/index.d.mts.map +1 -0
  22. package/dist/extensions/index.mjs +5 -0
  23. package/dist/extensions-BsDsFFkk.mjs +1785 -0
  24. package/dist/extensions-BsDsFFkk.mjs.map +1 -0
  25. package/dist/extensions-D9BbHnEV.cjs +2029 -0
  26. package/dist/global-content-CaNsyaPw.mjs +78 -0
  27. package/dist/global-content-CaNsyaPw.mjs.map +1 -0
  28. package/dist/global-content-CxV8qpMp.cjs +89 -0
  29. package/dist/index-BMsf5s28.d.mts +194 -0
  30. package/dist/index-BMsf5s28.d.mts.map +1 -0
  31. package/dist/index-DNriNUPU.d.cts +194 -0
  32. package/dist/index-DNriNUPU.d.cts.map +1 -0
  33. package/dist/index.cjs +199 -0
  34. package/dist/index.css +1171 -0
  35. package/dist/index.css.map +1 -0
  36. package/dist/index.d.cts +43 -0
  37. package/dist/index.d.cts.map +1 -0
  38. package/dist/index.d.mts +43 -0
  39. package/dist/index.d.mts.map +1 -0
  40. package/dist/index.mjs +199 -0
  41. package/dist/index.mjs.map +1 -0
  42. package/dist/plugins/index.cjs +19 -0
  43. package/dist/plugins/index.d.cts +73 -0
  44. package/dist/plugins/index.d.cts.map +1 -0
  45. package/dist/plugins/index.d.mts +73 -0
  46. package/dist/plugins/index.d.mts.map +1 -0
  47. package/dist/plugins/index.mjs +3 -0
  48. package/dist/root-BWiLr5WO.mjs +2363 -0
  49. package/dist/root-BWiLr5WO.mjs.map +1 -0
  50. package/dist/root-Bm_YBU0n.cjs +2873 -0
  51. package/dist/set-text-alignment-BDkB4Vfh.mjs +19 -0
  52. package/dist/set-text-alignment-BDkB4Vfh.mjs.map +1 -0
  53. package/dist/set-text-alignment-BlyZq1GA.cjs +24 -0
  54. package/dist/styles-BBXVfEv-.mjs +223 -0
  55. package/dist/styles-BBXVfEv-.mjs.map +1 -0
  56. package/dist/styles-D5jB7Yx-.cjs +252 -0
  57. package/dist/types-B-hiUAR9.d.cts +47 -0
  58. package/dist/types-B-hiUAR9.d.cts.map +1 -0
  59. package/dist/types-J7sLqbPy.d.mts +47 -0
  60. package/dist/types-J7sLqbPy.d.mts.map +1 -0
  61. package/dist/ui/bubble-menu/bubble-menu.css +285 -0
  62. package/dist/ui/index.cjs +3052 -0
  63. package/dist/ui/index.d.cts +1220 -0
  64. package/dist/ui/index.d.cts.map +1 -0
  65. package/dist/ui/index.d.mts +1220 -0
  66. package/dist/ui/index.d.mts.map +1 -0
  67. package/dist/ui/index.mjs +2942 -0
  68. package/dist/ui/index.mjs.map +1 -0
  69. package/dist/ui/inspector/inspector.css +338 -0
  70. package/dist/ui/slash-command/slash-command.css +44 -0
  71. package/dist/ui/themes/default.css +1169 -0
  72. package/dist/utils/index.cjs +3 -0
  73. package/dist/utils/index.d.cts +7 -0
  74. package/dist/utils/index.d.cts.map +1 -0
  75. package/dist/utils/index.d.mts +7 -0
  76. package/dist/utils/index.d.mts.map +1 -0
  77. package/dist/utils/index.mjs +3 -0
  78. package/license.md +7 -0
  79. package/package.json +159 -0
  80. package/readme.md +69 -0
@@ -0,0 +1,1785 @@
1
+ import { a as resolveConflictingStyles, r as inlineCssToJs } from "./styles-BBXVfEv-.mjs";
2
+ import { r as EmailMark } from "./core-Dp3tVCOZ.mjs";
3
+ import { r as EmailNode, t as editorEventBus } from "./event-bus-BxVEXi1L.mjs";
4
+ import { a as ThreeColumns, c as hasPrismThemeLoaded, d as COMMON_HTML_ATTRIBUTES, f as LAYOUT_ATTRIBUTES, g as createStandardAttributes, h as TABLE_HEADER_ATTRIBUTES, l as loadPrismTheme, m as TABLE_CELL_ATTRIBUTES, n as ColumnsColumn, o as TwoColumns, p as TABLE_ATTRIBUTES, r as FourColumns, u as removePrismTheme } from "./columns-TFI4L-IC.mjs";
5
+ import { t as GlobalContent } from "./global-content-CaNsyaPw.mjs";
6
+ import { NodeViewContent, NodeViewWrapper, ReactNodeViewRenderer } from "@tiptap/react";
7
+ import * as ReactEmailComponents from "react-email";
8
+ import { Button, CodeBlock, Column, Container, Heading, Hr, Link, Row, Section } from "react-email";
9
+ import { Fragment, jsx } from "react/jsx-runtime";
10
+ import { Extension, InputRule, Node, findChildren, mergeAttributes } from "@tiptap/core";
11
+ import { UndoRedo } from "@tiptap/extensions";
12
+ import TipTapStarterKit from "@tiptap/starter-kit";
13
+ import BlockquoteBase from "@tiptap/extension-blockquote";
14
+ import BoldBase from "@tiptap/extension-bold";
15
+ import BulletListBase from "@tiptap/extension-bullet-list";
16
+ import CodeBase from "@tiptap/extension-code";
17
+ import CodeBlock$1 from "@tiptap/extension-code-block";
18
+ import { Plugin, PluginKey, TextSelection } from "@tiptap/pm/state";
19
+ import { Decoration, DecorationSet } from "@tiptap/pm/view";
20
+ import { fromHtml } from "hast-util-from-html";
21
+ import Prism from "prismjs";
22
+ import HorizontalRule from "@tiptap/extension-horizontal-rule";
23
+ import HardBreakBase from "@tiptap/extension-hard-break";
24
+ import { Heading as Heading$1 } from "@tiptap/extension-heading";
25
+ import ItalicBase from "@tiptap/extension-italic";
26
+ import TiptapLink from "@tiptap/extension-link";
27
+ import ListItemBase from "@tiptap/extension-list-item";
28
+ import OrderedListBase from "@tiptap/extension-ordered-list";
29
+ import ParagraphBase from "@tiptap/extension-paragraph";
30
+ import TipTapPlaceholder from "@tiptap/extension-placeholder";
31
+ import StrikeBase from "@tiptap/extension-strike";
32
+ import SuperscriptBase from "@tiptap/extension-superscript";
33
+ import { Text } from "@tiptap/extension-text";
34
+ import UnderlineBase from "@tiptap/extension-underline";
35
+
36
+ //#region src/extensions/alignment-attribute.tsx
37
+ const AlignmentAttribute = Extension.create({
38
+ name: "alignmentAttribute",
39
+ addOptions() {
40
+ return {
41
+ types: [],
42
+ alignments: [
43
+ "left",
44
+ "center",
45
+ "right",
46
+ "justify"
47
+ ]
48
+ };
49
+ },
50
+ addGlobalAttributes() {
51
+ return [{
52
+ types: this.options.types,
53
+ attributes: { alignment: {
54
+ parseHTML: (element) => {
55
+ const explicitAlign = element.getAttribute("align") || element.getAttribute("alignment") || element.style.textAlign;
56
+ if (explicitAlign && this.options.alignments.includes(explicitAlign)) return explicitAlign;
57
+ return null;
58
+ },
59
+ renderHTML: (attributes) => {
60
+ if (attributes.alignment === "left") return {};
61
+ return { alignment: attributes.alignment };
62
+ }
63
+ } }
64
+ }];
65
+ },
66
+ addCommands() {
67
+ return { setAlignment: (alignment) => ({ commands }) => {
68
+ if (!this.options.alignments.includes(alignment)) return false;
69
+ return this.options.types.every((type) => commands.updateAttributes(type, { alignment }));
70
+ } };
71
+ },
72
+ addKeyboardShortcuts() {
73
+ return {
74
+ Enter: () => {
75
+ const { from } = this.editor.state.selection;
76
+ const currentAlignment = this.editor.state.doc.nodeAt(from)?.attrs?.alignment;
77
+ if (currentAlignment) requestAnimationFrame(() => {
78
+ this.editor.commands.setAlignment(currentAlignment);
79
+ });
80
+ return false;
81
+ },
82
+ "Mod-Shift-l": () => this.editor.commands.setAlignment("left"),
83
+ "Mod-Shift-e": () => this.editor.commands.setAlignment("center"),
84
+ "Mod-Shift-r": () => this.editor.commands.setAlignment("right"),
85
+ "Mod-Shift-j": () => this.editor.commands.setAlignment("justify")
86
+ };
87
+ }
88
+ });
89
+
90
+ //#endregion
91
+ //#region src/utils/get-text-alignment.ts
92
+ function getTextAlignment(alignment) {
93
+ switch (alignment) {
94
+ case "left": return { textAlign: "left" };
95
+ case "center": return { textAlign: "center" };
96
+ case "right": return { textAlign: "right" };
97
+ default: return {};
98
+ }
99
+ }
100
+
101
+ //#endregion
102
+ //#region src/extensions/blockquote.tsx
103
+ const Blockquote = EmailNode.from(BlockquoteBase, ({ children, node, style }) => /* @__PURE__ */ jsx("blockquote", {
104
+ className: node.attrs?.class || void 0,
105
+ style: {
106
+ ...style,
107
+ ...inlineCssToJs(node.attrs?.style),
108
+ ...getTextAlignment(node.attrs?.align || node.attrs?.alignment)
109
+ },
110
+ children
111
+ }));
112
+
113
+ //#endregion
114
+ //#region src/extensions/body.tsx
115
+ const Body$1 = EmailNode.create({
116
+ name: "body",
117
+ group: "block",
118
+ content: "block+",
119
+ defining: true,
120
+ isolating: true,
121
+ addAttributes() {
122
+ return { ...createStandardAttributes([...COMMON_HTML_ATTRIBUTES, ...LAYOUT_ATTRIBUTES]) };
123
+ },
124
+ parseHTML() {
125
+ return [{
126
+ tag: "body",
127
+ getAttrs: (node) => {
128
+ if (typeof node === "string") return false;
129
+ const element = node;
130
+ const attrs = {};
131
+ Array.from(element.attributes).forEach((attr) => {
132
+ attrs[attr.name] = attr.value;
133
+ });
134
+ return attrs;
135
+ }
136
+ }];
137
+ },
138
+ renderHTML({ HTMLAttributes }) {
139
+ return [
140
+ "div",
141
+ mergeAttributes(this.options.HTMLAttributes, HTMLAttributes),
142
+ 0
143
+ ];
144
+ },
145
+ renderToReactEmail({ children, node, style }) {
146
+ const inlineStyles = inlineCssToJs(node.attrs?.style);
147
+ return /* @__PURE__ */ jsx("div", {
148
+ className: node.attrs?.class || void 0,
149
+ style: {
150
+ ...style,
151
+ ...inlineStyles
152
+ },
153
+ children
154
+ });
155
+ }
156
+ });
157
+
158
+ //#endregion
159
+ //#region src/extensions/bold.tsx
160
+ const BoldWithoutFontWeightInference = BoldBase.extend({ parseHTML() {
161
+ return [
162
+ { tag: "strong" },
163
+ {
164
+ tag: "b",
165
+ getAttrs: (node) => node.style.fontWeight !== "normal" && null
166
+ },
167
+ {
168
+ style: "font-weight=400",
169
+ clearMark: (mark) => mark.type.name === this.name
170
+ }
171
+ ];
172
+ } });
173
+ const Bold = EmailMark.from(BoldWithoutFontWeightInference, ({ children, style }) => /* @__PURE__ */ jsx("strong", {
174
+ style,
175
+ children
176
+ }));
177
+
178
+ //#endregion
179
+ //#region src/extensions/bullet-list.tsx
180
+ const BulletList = EmailNode.from(BulletListBase, ({ children, node, style }) => /* @__PURE__ */ jsx("ul", {
181
+ className: node.attrs?.class || void 0,
182
+ style: {
183
+ ...style,
184
+ ...inlineCssToJs(node.attrs?.style)
185
+ },
186
+ children
187
+ }));
188
+
189
+ //#endregion
190
+ //#region src/extensions/button.tsx
191
+ const Button$1 = EmailNode.create({
192
+ name: "button",
193
+ group: "block",
194
+ content: "inline*",
195
+ defining: true,
196
+ draggable: true,
197
+ marks: "bold",
198
+ addAttributes() {
199
+ return {
200
+ class: { default: "button" },
201
+ href: { default: "#" },
202
+ alignment: { default: "left" }
203
+ };
204
+ },
205
+ parseHTML() {
206
+ return [{
207
+ tag: "a[data-id=\"react-email-button\"]",
208
+ getAttrs: (node) => {
209
+ if (typeof node === "string") return false;
210
+ const element = node;
211
+ const attrs = {};
212
+ Array.from(element.attributes).forEach((attr) => {
213
+ attrs[attr.name] = attr.value;
214
+ });
215
+ return {
216
+ ...attrs,
217
+ href: attrs["data-href"] ?? attrs.href
218
+ };
219
+ }
220
+ }];
221
+ },
222
+ renderHTML({ HTMLAttributes }) {
223
+ return [
224
+ "div",
225
+ mergeAttributes({ class: `align-${HTMLAttributes?.alignment}` }),
226
+ [
227
+ "a",
228
+ mergeAttributes({
229
+ class: `node-button ${HTMLAttributes?.class}`,
230
+ style: HTMLAttributes?.style,
231
+ "data-id": "react-email-button",
232
+ href: HTMLAttributes?.href,
233
+ "data-href": HTMLAttributes?.href
234
+ }),
235
+ 0
236
+ ]
237
+ ];
238
+ },
239
+ addCommands() {
240
+ return {
241
+ updateButton: (attributes) => ({ commands }) => {
242
+ return commands.updateAttributes("button", attributes);
243
+ },
244
+ setButton: () => ({ commands }) => {
245
+ return commands.insertContent({
246
+ type: "button",
247
+ content: [{
248
+ type: "text",
249
+ text: "Button"
250
+ }]
251
+ });
252
+ }
253
+ };
254
+ },
255
+ renderToReactEmail({ children, node, style }) {
256
+ const inlineStyles = inlineCssToJs(node.attrs?.style);
257
+ return /* @__PURE__ */ jsx(Row, { children: /* @__PURE__ */ jsx(Column, {
258
+ align: node.attrs?.align || node.attrs?.alignment,
259
+ children: /* @__PURE__ */ jsx(Button, {
260
+ className: node.attrs?.class || void 0,
261
+ href: node.attrs?.href,
262
+ style: {
263
+ ...style,
264
+ ...inlineStyles
265
+ },
266
+ children
267
+ })
268
+ }) });
269
+ }
270
+ });
271
+
272
+ //#endregion
273
+ //#region src/extensions/class-attribute.tsx
274
+ const ClassAttribute = Extension.create({
275
+ name: "classAttribute",
276
+ addOptions() {
277
+ return {
278
+ types: [],
279
+ class: []
280
+ };
281
+ },
282
+ addGlobalAttributes() {
283
+ return [{
284
+ types: this.options.types,
285
+ attributes: { class: {
286
+ default: "",
287
+ parseHTML: (element) => element.className || "",
288
+ renderHTML: (attributes) => {
289
+ return attributes.class ? { class: attributes.class } : {};
290
+ }
291
+ } }
292
+ }];
293
+ },
294
+ addCommands() {
295
+ return {
296
+ unsetClass: () => ({ commands }) => {
297
+ return this.options.types.every((type) => commands.resetAttributes(type, "class"));
298
+ },
299
+ setClass: (classList) => ({ commands }) => {
300
+ return this.options.types.every((type) => commands.updateAttributes(type, { class: classList }));
301
+ }
302
+ };
303
+ },
304
+ addKeyboardShortcuts() {
305
+ return { Enter: ({ editor }) => {
306
+ requestAnimationFrame(() => {
307
+ editor.commands.resetAttributes("paragraph", "class");
308
+ });
309
+ return false;
310
+ } };
311
+ }
312
+ });
313
+
314
+ //#endregion
315
+ //#region src/extensions/code.tsx
316
+ const Code = EmailMark.from(CodeBase, ({ children, node, style }) => /* @__PURE__ */ jsx("code", {
317
+ style: {
318
+ ...style,
319
+ ...inlineCssToJs(node.attrs?.style)
320
+ },
321
+ children
322
+ }));
323
+
324
+ //#endregion
325
+ //#region src/extensions/prism-plugin.ts
326
+ const PRISM_LANGUAGE_LOADED_META = "prismLanguageLoaded";
327
+ function parseNodes(nodes, className = []) {
328
+ return nodes.flatMap((node) => {
329
+ const classes = [...className, ...node.properties ? node.properties.className : []];
330
+ if (node.children) return parseNodes(node.children, classes);
331
+ return {
332
+ text: node.value ?? "",
333
+ classes
334
+ };
335
+ });
336
+ }
337
+ function getHighlightNodes(html) {
338
+ return fromHtml(html, { fragment: true }).children;
339
+ }
340
+ function registeredLang(aliasOrLanguage) {
341
+ const allSupportLang = Object.keys(Prism.languages).filter((id) => typeof Prism.languages[id] === "object");
342
+ return Boolean(allSupportLang.find((x) => x === aliasOrLanguage));
343
+ }
344
+ function getDecorations({ doc, name, defaultLanguage, defaultTheme, loadingLanguages, onLanguageLoaded }) {
345
+ const decorations = [];
346
+ findChildren(doc, (node) => node.type.name === name).forEach((block) => {
347
+ let from = block.pos + 1;
348
+ const language = block.node.attrs.language || defaultLanguage;
349
+ const theme = block.node.attrs.theme || defaultTheme;
350
+ let html = "";
351
+ try {
352
+ if (!registeredLang(language) && !loadingLanguages.has(language)) {
353
+ loadingLanguages.add(language);
354
+ import(`prismjs/components/prism-${language}`).then(() => {
355
+ loadingLanguages.delete(language);
356
+ onLanguageLoaded(language);
357
+ }).catch(() => {
358
+ loadingLanguages.delete(language);
359
+ });
360
+ }
361
+ if (!hasPrismThemeLoaded(theme)) loadPrismTheme(theme);
362
+ html = Prism.highlight(block.node.textContent, Prism.languages[language], language);
363
+ } catch {
364
+ html = Prism.highlight(block.node.textContent, Prism.languages.javascript, "js");
365
+ }
366
+ parseNodes(getHighlightNodes(html)).forEach((node) => {
367
+ const to = from + node.text.length;
368
+ if (node.classes.length) {
369
+ const decoration = Decoration.inline(from, to, { class: node.classes.join(" ") });
370
+ decorations.push(decoration);
371
+ }
372
+ from = to;
373
+ });
374
+ });
375
+ return DecorationSet.create(doc, decorations);
376
+ }
377
+ function PrismPlugin({ name, defaultLanguage, defaultTheme }) {
378
+ if (!defaultLanguage) throw Error("You must specify the defaultLanguage parameter");
379
+ const loadingLanguages = /* @__PURE__ */ new Set();
380
+ let pluginView = null;
381
+ const onLanguageLoaded = (language) => {
382
+ if (pluginView) pluginView.dispatch(pluginView.state.tr.setMeta(PRISM_LANGUAGE_LOADED_META, language));
383
+ };
384
+ const prismjsPlugin = new Plugin({
385
+ key: new PluginKey("prism"),
386
+ view(view) {
387
+ pluginView = view;
388
+ return { destroy() {
389
+ pluginView = null;
390
+ } };
391
+ },
392
+ state: {
393
+ init: (_, { doc }) => {
394
+ return getDecorations({
395
+ doc,
396
+ name,
397
+ defaultLanguage,
398
+ defaultTheme,
399
+ loadingLanguages,
400
+ onLanguageLoaded
401
+ });
402
+ },
403
+ apply: (transaction, decorationSet, oldState, newState) => {
404
+ const oldNodeName = oldState.selection.$head.parent.type.name;
405
+ const newNodeName = newState.selection.$head.parent.type.name;
406
+ const oldNodes = findChildren(oldState.doc, (node) => node.type.name === name);
407
+ const newNodes = findChildren(newState.doc, (node) => node.type.name === name);
408
+ if (transaction.getMeta(PRISM_LANGUAGE_LOADED_META) || transaction.docChanged && ([oldNodeName, newNodeName].includes(name) || newNodes.length !== oldNodes.length || transaction.steps.some((step) => {
409
+ const rangeStep = step;
410
+ return rangeStep.from !== void 0 && rangeStep.to !== void 0 && oldNodes.some((node) => {
411
+ return node.pos >= rangeStep.from && node.pos + node.node.nodeSize <= rangeStep.to;
412
+ });
413
+ }))) return getDecorations({
414
+ doc: transaction.doc,
415
+ name,
416
+ defaultLanguage,
417
+ defaultTheme,
418
+ loadingLanguages,
419
+ onLanguageLoaded
420
+ });
421
+ return decorationSet.map(transaction.mapping, transaction.doc);
422
+ }
423
+ },
424
+ props: { decorations(state) {
425
+ return prismjsPlugin.getState(state);
426
+ } },
427
+ destroy() {
428
+ pluginView = null;
429
+ removePrismTheme();
430
+ }
431
+ });
432
+ return prismjsPlugin;
433
+ }
434
+
435
+ //#endregion
436
+ //#region src/extensions/code-block.tsx
437
+ const CodeBlockPrism = EmailNode.from(CodeBlock$1.extend({
438
+ addOptions() {
439
+ return {
440
+ languageClassPrefix: "language-",
441
+ exitOnTripleEnter: false,
442
+ exitOnArrowDown: false,
443
+ enableTabIndentation: true,
444
+ tabSize: 2,
445
+ defaultLanguage: "javascript",
446
+ defaultTheme: "default",
447
+ HTMLAttributes: {}
448
+ };
449
+ },
450
+ addAttributes() {
451
+ return {
452
+ ...this.parent?.(),
453
+ language: {
454
+ default: this.options.defaultLanguage,
455
+ parseHTML: (element) => {
456
+ if (!element) return null;
457
+ const { languageClassPrefix } = this.options;
458
+ if (!languageClassPrefix) return null;
459
+ const language = [...element.firstElementChild?.classList || []].filter((className) => className.startsWith(languageClassPrefix || "")).map((className) => className.replace(languageClassPrefix, ""))[0];
460
+ if (!language) return null;
461
+ return language;
462
+ },
463
+ rendered: false
464
+ },
465
+ theme: {
466
+ default: this.options.defaultTheme,
467
+ rendered: false
468
+ }
469
+ };
470
+ },
471
+ renderHTML({ node, HTMLAttributes }) {
472
+ return [
473
+ "pre",
474
+ mergeAttributes(this.options.HTMLAttributes, HTMLAttributes, { class: node.attrs.language ? `${this.options.languageClassPrefix}${node.attrs.language}` : null }, { "data-theme": node.attrs.theme }),
475
+ [
476
+ "code",
477
+ { class: node.attrs.language ? `${this.options.languageClassPrefix}${node.attrs.language} node-codeTag` : "node-codeTag" },
478
+ 0
479
+ ]
480
+ ];
481
+ },
482
+ addKeyboardShortcuts() {
483
+ return {
484
+ ...this.parent?.(),
485
+ "Mod-a": ({ editor }) => {
486
+ const { state } = editor;
487
+ const { selection } = state;
488
+ const { $from } = selection;
489
+ for (let depth = $from.depth; depth >= 1; depth--) if ($from.node(depth).type.name === this.name) {
490
+ const blockStart = $from.start(depth);
491
+ const blockEnd = $from.end(depth);
492
+ if (selection.from === blockStart && selection.to === blockEnd) return false;
493
+ const tr = state.tr.setSelection(TextSelection.create(state.doc, blockStart, blockEnd));
494
+ editor.view.dispatch(tr);
495
+ return true;
496
+ }
497
+ return false;
498
+ }
499
+ };
500
+ },
501
+ addProseMirrorPlugins() {
502
+ return [...this.parent?.() || [], PrismPlugin({
503
+ name: this.name,
504
+ defaultLanguage: this.options.defaultLanguage,
505
+ defaultTheme: this.options.defaultTheme
506
+ })];
507
+ }
508
+ }), ({ node, style }) => {
509
+ const language = node.attrs?.language ? `${node.attrs.language}` : "javascript";
510
+ const userTheme = ReactEmailComponents[node.attrs?.theme];
511
+ const theme = userTheme ? {
512
+ ...userTheme,
513
+ base: {
514
+ ...userTheme.base,
515
+ borderRadius: "0.125rem",
516
+ padding: "0.75rem 1rem"
517
+ }
518
+ } : { base: {
519
+ color: "#1e293b",
520
+ background: "#f1f5f9",
521
+ lineHeight: "1.5",
522
+ fontFamily: "\"Fira Code\", \"Fira Mono\", Menlo, Consolas, \"DejaVu Sans Mono\", monospace",
523
+ padding: "0.75rem 1rem",
524
+ borderRadius: "0.125rem"
525
+ } };
526
+ return /* @__PURE__ */ jsx(CodeBlock, {
527
+ code: node.content?.[0]?.text ?? "",
528
+ language,
529
+ theme,
530
+ style: {
531
+ width: "auto",
532
+ ...style
533
+ }
534
+ });
535
+ });
536
+
537
+ //#endregion
538
+ //#region src/utils/is-collaboration.ts
539
+ const COLLABORATION_EXTENSION_NAMES = new Set(["liveblocksExtension", "collaboration"]);
540
+ function hasCollaborationExtension(exts) {
541
+ return exts.some((ext) => COLLABORATION_EXTENSION_NAMES.has(ext.name));
542
+ }
543
+
544
+ //#endregion
545
+ //#region src/extensions/container.tsx
546
+ function hasContainerNode(doc) {
547
+ let found = false;
548
+ doc.forEach((node) => {
549
+ if (node.type.name === "container") found = true;
550
+ });
551
+ return found;
552
+ }
553
+ function wrapInContainer(state) {
554
+ const { doc } = state;
555
+ const containerType = state.schema.nodes.container;
556
+ const contentNodes = [];
557
+ const globalContentNodes = [];
558
+ doc.forEach((node) => {
559
+ if (node.type.name === "globalContent") globalContentNodes.push(node);
560
+ else contentNodes.push(node);
561
+ });
562
+ const containerContent = contentNodes.length > 0 ? contentNodes : [state.schema.nodes.paragraph.create()];
563
+ const containerNode = containerType.create(null, containerContent);
564
+ const newDocContent = [...globalContentNodes, containerNode];
565
+ const tr = state.tr;
566
+ tr.replaceWith(0, doc.content.size, newDocContent);
567
+ tr.setMeta("addToHistory", false);
568
+ return tr;
569
+ }
570
+ const Container$1 = EmailNode.create({
571
+ name: "container",
572
+ group: "block",
573
+ content: "block+",
574
+ defining: true,
575
+ isolating: true,
576
+ selectable: false,
577
+ draggable: false,
578
+ addOptions() {
579
+ return { HTMLAttributes: {} };
580
+ },
581
+ parseHTML() {
582
+ return [{ tag: "div[data-type=\"container\"]" }, {
583
+ tag: "table[role=\"presentation\"]",
584
+ priority: 60,
585
+ getAttrs: (node) => {
586
+ if (typeof node === "string") return false;
587
+ const table = node;
588
+ if (!table.style.maxWidth) return false;
589
+ if (!table.querySelector(":scope > tbody > tr:only-child > td:only-child")) return false;
590
+ return null;
591
+ },
592
+ contentElement: (node) => node.querySelector(":scope > tbody > tr > td")
593
+ }];
594
+ },
595
+ renderHTML({ HTMLAttributes }) {
596
+ return [
597
+ "div",
598
+ mergeAttributes({
599
+ "data-type": "container",
600
+ class: "node-container"
601
+ }, this.options.HTMLAttributes, HTMLAttributes),
602
+ 0
603
+ ];
604
+ },
605
+ addProseMirrorPlugins() {
606
+ const isCollaborative = hasCollaborationExtension(this.editor.extensionManager.extensions);
607
+ return [new Plugin({
608
+ key: new PluginKey("containerEnforcer"),
609
+ view: isCollaborative ? void 0 : (editorView) => {
610
+ if (!hasContainerNode(editorView.state.doc)) {
611
+ const tr = wrapInContainer(editorView.state);
612
+ editorView.dispatch(tr);
613
+ }
614
+ return {};
615
+ },
616
+ appendTransaction(_transactions, oldState, newState) {
617
+ if (hasContainerNode(newState.doc)) return null;
618
+ if (newState.doc.eq(oldState.doc)) return null;
619
+ return wrapInContainer(newState);
620
+ }
621
+ })];
622
+ },
623
+ renderToReactEmail({ children, node, style }) {
624
+ const inlineStyles = inlineCssToJs(node.attrs?.style);
625
+ return /* @__PURE__ */ jsx(Container, {
626
+ className: node.attrs?.class || void 0,
627
+ align: style.align || "center",
628
+ style: {
629
+ ...style,
630
+ ...inlineStyles,
631
+ width: "100%",
632
+ maxWidth: style?.width ?? style?.maxWidth
633
+ },
634
+ children
635
+ });
636
+ }
637
+ });
638
+
639
+ //#endregion
640
+ //#region src/extensions/div.tsx
641
+ const Div = EmailNode.create({
642
+ name: "div",
643
+ group: "block",
644
+ content: "block+",
645
+ defining: true,
646
+ isolating: true,
647
+ parseHTML() {
648
+ return [{
649
+ tag: "div:not([data-type])",
650
+ getAttrs: (node) => {
651
+ if (typeof node === "string") return false;
652
+ const element = node;
653
+ const attrs = {};
654
+ Array.from(element.attributes).forEach((attr) => {
655
+ attrs[attr.name] = attr.value;
656
+ });
657
+ return attrs;
658
+ }
659
+ }];
660
+ },
661
+ renderHTML({ HTMLAttributes }) {
662
+ return [
663
+ "div",
664
+ mergeAttributes(this.options.HTMLAttributes, HTMLAttributes),
665
+ 0
666
+ ];
667
+ },
668
+ addAttributes() {
669
+ return { ...createStandardAttributes([...COMMON_HTML_ATTRIBUTES, ...LAYOUT_ATTRIBUTES]) };
670
+ },
671
+ renderToReactEmail({ children, node, style }) {
672
+ const inlineStyles = inlineCssToJs(node.attrs?.style);
673
+ return /* @__PURE__ */ jsx("div", {
674
+ className: node.attrs?.class || void 0,
675
+ style: {
676
+ ...style,
677
+ ...inlineStyles
678
+ },
679
+ children
680
+ });
681
+ }
682
+ });
683
+
684
+ //#endregion
685
+ //#region src/extensions/divider.tsx
686
+ const Divider = EmailNode.from(HorizontalRule.extend({
687
+ addAttributes() {
688
+ return { class: { default: "divider" } };
689
+ },
690
+ addInputRules() {
691
+ return [new InputRule({
692
+ find: /^(?:---|—-|___\s|\*\*\*\s)$/,
693
+ handler: ({ state, range }) => {
694
+ const attributes = {};
695
+ const { tr } = state;
696
+ const start = range.from;
697
+ const end = range.to;
698
+ tr.insert(start - 1, this.type.create(attributes)).delete(tr.mapping.map(start), tr.mapping.map(end));
699
+ }
700
+ })];
701
+ },
702
+ addNodeView() {
703
+ return ReactNodeViewRenderer((props) => {
704
+ const node = props.node;
705
+ const { class: className, ...rest } = node.attrs;
706
+ return /* @__PURE__ */ jsx(NodeViewWrapper, { children: /* @__PURE__ */ jsx(Hr, {
707
+ ...rest,
708
+ className: "node-hr",
709
+ style: inlineCssToJs(node.attrs.style)
710
+ }) });
711
+ });
712
+ }
713
+ }), ({ node, style }) => {
714
+ return /* @__PURE__ */ jsx(Hr, {
715
+ className: node.attrs?.class || void 0,
716
+ style: {
717
+ ...style,
718
+ ...inlineCssToJs(node.attrs?.style)
719
+ }
720
+ });
721
+ });
722
+
723
+ //#endregion
724
+ //#region src/extensions/hard-break.tsx
725
+ const HardBreak = EmailNode.from(HardBreakBase, () => /* @__PURE__ */ jsx("br", {}));
726
+
727
+ //#endregion
728
+ //#region src/extensions/heading.tsx
729
+ const Heading$2 = EmailNode.from(Heading$1.extend({ addNodeView() {
730
+ return ReactNodeViewRenderer(({ node }) => {
731
+ const level = node.attrs.level ?? 1;
732
+ const { class: className, ...rest } = node.attrs;
733
+ const attrs = {
734
+ ...rest,
735
+ className: `node-h${level} ${className}`,
736
+ style: inlineCssToJs(node.attrs.style)
737
+ };
738
+ return /* @__PURE__ */ jsx(NodeViewWrapper, { children: /* @__PURE__ */ jsx(Heading, {
739
+ as: `h${level}`,
740
+ ...attrs,
741
+ children: /* @__PURE__ */ jsx(NodeViewContent, {})
742
+ }) });
743
+ });
744
+ } }), ({ children, node, style }) => {
745
+ return /* @__PURE__ */ jsx(Heading, {
746
+ as: `h${node.attrs?.level ?? 1}`,
747
+ className: node.attrs?.class || void 0,
748
+ style: {
749
+ ...style,
750
+ ...inlineCssToJs(node.attrs?.style),
751
+ ...getTextAlignment(node.attrs?.align ?? node.attrs?.alignment)
752
+ },
753
+ children
754
+ });
755
+ });
756
+
757
+ //#endregion
758
+ //#region src/extensions/italic.tsx
759
+ const Italic = EmailMark.from(ItalicBase, ({ children, style }) => /* @__PURE__ */ jsx("em", {
760
+ style,
761
+ children
762
+ }));
763
+
764
+ //#endregion
765
+ //#region src/extensions/preserved-style.tsx
766
+ const PreservedStyle = EmailMark.create({
767
+ name: "preservedStyle",
768
+ addAttributes() {
769
+ return { style: {
770
+ default: null,
771
+ parseHTML: (element) => element.getAttribute("style"),
772
+ renderHTML: (attributes) => {
773
+ if (!attributes.style) return {};
774
+ return { style: attributes.style };
775
+ }
776
+ } };
777
+ },
778
+ parseHTML() {
779
+ return [{
780
+ tag: "span[style]",
781
+ getAttrs: (element) => {
782
+ if (typeof element === "string") return false;
783
+ const style = element.getAttribute("style");
784
+ if (style && hasPreservableStyles(style)) return { style };
785
+ return false;
786
+ }
787
+ }];
788
+ },
789
+ renderHTML({ HTMLAttributes }) {
790
+ return [
791
+ "span",
792
+ mergeAttributes(HTMLAttributes),
793
+ 0
794
+ ];
795
+ },
796
+ renderToReactEmail({ children, mark }) {
797
+ return /* @__PURE__ */ jsx("span", {
798
+ style: mark.attrs?.style ? inlineCssToJs(mark.attrs.style) : void 0,
799
+ children
800
+ });
801
+ }
802
+ });
803
+ const LINK_INDICATOR_STYLES = [
804
+ "color",
805
+ "text-decoration",
806
+ "text-decoration-line",
807
+ "text-decoration-color",
808
+ "text-decoration-style"
809
+ ];
810
+ function parseStyleString(styleString) {
811
+ const temp = document.createElement("div");
812
+ temp.style.cssText = styleString;
813
+ return temp.style;
814
+ }
815
+ function hasBackground(style) {
816
+ const bgColor = style.backgroundColor;
817
+ const bg = style.background;
818
+ if (bgColor && bgColor !== "transparent" && bgColor !== "rgba(0, 0, 0, 0)") return true;
819
+ if (bg && bg !== "transparent" && bg !== "none" && bg !== "rgba(0, 0, 0, 0)") return true;
820
+ return false;
821
+ }
822
+ function hasPreservableStyles(styleString) {
823
+ return processStylesForUnlink(styleString) !== null;
824
+ }
825
+ /**
826
+ * Processes styles when unlinking:
827
+ * - Has background (button-like): preserve all styles
828
+ * - No background: strip link-indicator styles (color, text-decoration), keep the rest
829
+ */
830
+ function processStylesForUnlink(styleString) {
831
+ if (!styleString) return null;
832
+ const style = parseStyleString(styleString);
833
+ if (hasBackground(style)) return styleString;
834
+ const filtered = [];
835
+ for (let i = 0; i < style.length; i++) {
836
+ const prop = style[i];
837
+ if (LINK_INDICATOR_STYLES.includes(prop)) continue;
838
+ const value = style.getPropertyValue(prop);
839
+ if (value) filtered.push(`${prop}: ${value}`);
840
+ }
841
+ return filtered.length > 0 ? filtered.join("; ") : null;
842
+ }
843
+
844
+ //#endregion
845
+ //#region src/extensions/link.tsx
846
+ const Link$1 = EmailMark.from(TiptapLink, ({ children, mark, style }) => {
847
+ const linkMarkStyle = mark.attrs?.style ? inlineCssToJs(mark.attrs.style) : {};
848
+ return /* @__PURE__ */ jsx(Link, {
849
+ href: mark.attrs?.href ?? void 0,
850
+ rel: mark.attrs?.rel ?? void 0,
851
+ style: {
852
+ ...style,
853
+ ...linkMarkStyle
854
+ },
855
+ target: mark.attrs?.target ?? void 0,
856
+ ...mark.attrs?.["ses:no-track"] ? { "ses:no-track": mark.attrs["ses:no-track"] } : {},
857
+ children
858
+ });
859
+ }).extend({
860
+ parseHTML() {
861
+ return [{
862
+ tag: "a[target]:not([data-id=\"react-email-button\"])",
863
+ getAttrs: (node) => {
864
+ if (typeof node === "string") return false;
865
+ const element = node;
866
+ const attrs = {};
867
+ Array.from(element.attributes).forEach((attr) => {
868
+ attrs[attr.name] = attr.value;
869
+ });
870
+ return attrs;
871
+ }
872
+ }, {
873
+ tag: "a[href]:not([data-id=\"react-email-button\"])",
874
+ getAttrs: (node) => {
875
+ if (typeof node === "string") return false;
876
+ const element = node;
877
+ const attrs = {};
878
+ Array.from(element.attributes).forEach((attr) => {
879
+ attrs[attr.name] = attr.value;
880
+ });
881
+ return attrs;
882
+ }
883
+ }];
884
+ },
885
+ addAttributes() {
886
+ return {
887
+ ...this.parent?.(),
888
+ "ses:no-track": {
889
+ default: null,
890
+ parseHTML: (element) => element.getAttribute("ses:no-track")
891
+ }
892
+ };
893
+ },
894
+ addCommands() {
895
+ return {
896
+ ...this.parent?.(),
897
+ unsetLink: () => ({ state, chain }) => {
898
+ const { from } = state.selection;
899
+ const linkStyle = state.doc.resolve(from).marks().find((m) => m.type.name === "link")?.attrs?.style ?? null;
900
+ const preservedStyle = processStylesForUnlink(linkStyle);
901
+ const shouldRemoveUnderline = preservedStyle !== linkStyle;
902
+ if (preservedStyle) {
903
+ const cmd = chain().extendMarkRange("link").unsetMark("link").setMark("preservedStyle", { style: preservedStyle });
904
+ return shouldRemoveUnderline ? cmd.unsetMark("underline").run() : cmd.run();
905
+ }
906
+ return chain().extendMarkRange("link").unsetMark("link").unsetMark("underline").run();
907
+ }
908
+ };
909
+ },
910
+ addKeyboardShortcuts() {
911
+ return { "Mod-k": () => {
912
+ editorEventBus.dispatch("bubble-menu:add-link", void 0);
913
+ return this.editor.chain().focus().toggleLink({ href: "" }).run();
914
+ } };
915
+ }
916
+ });
917
+
918
+ //#endregion
919
+ //#region src/extensions/list-item.tsx
920
+ const ListItem = EmailNode.from(ListItemBase, ({ children, node, style }) => /* @__PURE__ */ jsx("li", {
921
+ className: node.attrs?.class || void 0,
922
+ style: {
923
+ ...style,
924
+ ...inlineCssToJs(node.attrs?.style),
925
+ ...getTextAlignment(node.attrs?.align || node.attrs?.alignment)
926
+ },
927
+ children
928
+ }));
929
+
930
+ //#endregion
931
+ //#region src/extensions/max-nesting.ts
932
+ const MaxNesting = Extension.create({
933
+ name: "maxNesting",
934
+ addOptions() {
935
+ return {
936
+ maxDepth: 3,
937
+ nodeTypes: void 0
938
+ };
939
+ },
940
+ addProseMirrorPlugins() {
941
+ const { maxDepth, nodeTypes } = this.options;
942
+ if (typeof maxDepth !== "number" || maxDepth < 1) throw new Error("maxDepth must be a positive number");
943
+ return [new Plugin({
944
+ key: new PluginKey("maxNesting"),
945
+ appendTransaction(transactions, _oldState, newState) {
946
+ if (!transactions.some((tr$1) => tr$1.docChanged)) return null;
947
+ const rangesToLift = [];
948
+ newState.doc.descendants((node, pos) => {
949
+ let depth = 0;
950
+ let currentPos = pos;
951
+ let currentNode = node;
952
+ while (currentNode && depth <= maxDepth) {
953
+ if (!nodeTypes || nodeTypes.includes(currentNode.type.name)) depth++;
954
+ const $pos = newState.doc.resolve(currentPos);
955
+ if ($pos.depth === 0) break;
956
+ currentPos = $pos.before($pos.depth);
957
+ currentNode = newState.doc.nodeAt(currentPos);
958
+ }
959
+ if (depth > maxDepth) {
960
+ const $pos = newState.doc.resolve(pos);
961
+ if ($pos.depth > 0) {
962
+ const range = $pos.blockRange();
963
+ if (range && "canReplace" in newState.schema.nodes.doc && typeof newState.schema.nodes.doc.canReplace === "function" && newState.schema.nodes.doc.canReplace(range.start - 1, range.end + 1, newState.doc.slice(range.start, range.end).content)) rangesToLift.push({
964
+ range,
965
+ target: range.start - 1
966
+ });
967
+ }
968
+ }
969
+ });
970
+ if (rangesToLift.length === 0) return null;
971
+ const tr = newState.tr;
972
+ for (let i = rangesToLift.length - 1; i >= 0; i--) {
973
+ const { range, target } = rangesToLift[i];
974
+ tr.lift(range, target);
975
+ }
976
+ return tr;
977
+ },
978
+ filterTransaction(tr) {
979
+ if (!tr.docChanged) return true;
980
+ let wouldCreateDeepNesting = false;
981
+ const newDoc = tr.doc;
982
+ newDoc.descendants((node, pos) => {
983
+ if (wouldCreateDeepNesting) return false;
984
+ let depth = 0;
985
+ let currentPos = pos;
986
+ let currentNode = node;
987
+ while (currentNode && depth <= maxDepth) {
988
+ if (!nodeTypes || nodeTypes.includes(currentNode.type.name)) depth++;
989
+ const $pos = newDoc.resolve(currentPos);
990
+ if ($pos.depth === 0) break;
991
+ currentPos = $pos.before($pos.depth);
992
+ currentNode = newDoc.nodeAt(currentPos);
993
+ }
994
+ if (depth > maxDepth) {
995
+ wouldCreateDeepNesting = true;
996
+ return false;
997
+ }
998
+ });
999
+ return !wouldCreateDeepNesting;
1000
+ }
1001
+ })];
1002
+ }
1003
+ });
1004
+
1005
+ //#endregion
1006
+ //#region src/extensions/ordered-list.tsx
1007
+ const OrderedList = EmailNode.from(OrderedListBase, ({ children, node, style }) => /* @__PURE__ */ jsx("ol", {
1008
+ className: node.attrs?.class || void 0,
1009
+ start: node.attrs?.start,
1010
+ style: {
1011
+ ...style,
1012
+ ...inlineCssToJs(node.attrs?.style)
1013
+ },
1014
+ children
1015
+ }));
1016
+
1017
+ //#endregion
1018
+ //#region src/extensions/paragraph.tsx
1019
+ const Paragraph = EmailNode.from(ParagraphBase, ({ children, node, style }) => {
1020
+ const isEmpty = !node.content || node.content.length === 0;
1021
+ return /* @__PURE__ */ jsx("p", {
1022
+ className: node.attrs?.class || void 0,
1023
+ style: {
1024
+ ...style,
1025
+ ...inlineCssToJs(node.attrs?.style),
1026
+ ...getTextAlignment(node.attrs?.align || node.attrs?.alignment)
1027
+ },
1028
+ children: isEmpty ? /* @__PURE__ */ jsx("br", {}) : children
1029
+ });
1030
+ });
1031
+
1032
+ //#endregion
1033
+ //#region src/extensions/placeholder.ts
1034
+ const Placeholder = TipTapPlaceholder.configure({
1035
+ placeholder: ({ node }) => {
1036
+ if (node.type.name === "heading") return `Heading ${node.attrs.level}`;
1037
+ return "Press '/' for commands";
1038
+ },
1039
+ includeChildren: true
1040
+ });
1041
+
1042
+ //#endregion
1043
+ //#region src/extensions/preview-text.ts
1044
+ const PreviewText = Node.create({
1045
+ name: "previewText",
1046
+ group: "block",
1047
+ selectable: false,
1048
+ draggable: false,
1049
+ atom: true,
1050
+ addOptions() {
1051
+ return { HTMLAttributes: {} };
1052
+ },
1053
+ addStorage() {
1054
+ return { previewText: null };
1055
+ },
1056
+ renderHTML() {
1057
+ return ["div", { style: "display: none" }];
1058
+ },
1059
+ parseHTML() {
1060
+ return [{
1061
+ tag: "div[data-skip-in-text=\"true\"]",
1062
+ getAttrs: (node) => {
1063
+ if (typeof node === "string") return false;
1064
+ const element = node;
1065
+ let directText = "";
1066
+ for (const child of element.childNodes) if (child.nodeType === 3) directText += child.textContent || "";
1067
+ const cleanText = directText.trim();
1068
+ if (cleanText) this.storage.previewText = cleanText;
1069
+ return false;
1070
+ }
1071
+ }, {
1072
+ tag: "span.preheader",
1073
+ getAttrs: (node) => {
1074
+ if (typeof node === "string") return false;
1075
+ const preheaderText = node.textContent?.trim();
1076
+ if (preheaderText) this.storage.previewText = preheaderText;
1077
+ return false;
1078
+ }
1079
+ }];
1080
+ }
1081
+ });
1082
+
1083
+ //#endregion
1084
+ //#region src/extensions/section.tsx
1085
+ function isSectionEmpty(node) {
1086
+ return node.textContent === "" && node.content.size <= node.childCount * 2;
1087
+ }
1088
+ const Section$1 = EmailNode.create({
1089
+ name: "section",
1090
+ group: "block",
1091
+ content: "block+",
1092
+ isolating: true,
1093
+ defining: true,
1094
+ parseHTML() {
1095
+ return [{ tag: "section[data-type=\"section\"]" }];
1096
+ },
1097
+ renderHTML({ HTMLAttributes }) {
1098
+ return [
1099
+ "section",
1100
+ mergeAttributes({
1101
+ "data-type": "section",
1102
+ class: "node-section"
1103
+ }, HTMLAttributes),
1104
+ 0
1105
+ ];
1106
+ },
1107
+ addKeyboardShortcuts() {
1108
+ return { Backspace: ({ editor }) => {
1109
+ const { state } = editor;
1110
+ const { selection } = state;
1111
+ const { empty, $from } = selection;
1112
+ if (!empty) return false;
1113
+ for (let depth = $from.depth; depth >= 1; depth--) {
1114
+ if ($from.node(depth).type.name !== "section") continue;
1115
+ if ($from.parentOffset !== 0) return false;
1116
+ let atStart = true;
1117
+ for (let d = depth; d < $from.depth; d++) if ($from.index(d) !== 0) {
1118
+ atStart = false;
1119
+ break;
1120
+ }
1121
+ if (!atStart) return false;
1122
+ if (!isSectionEmpty($from.node(depth))) return false;
1123
+ const tr = state.tr;
1124
+ const from = $from.before(depth);
1125
+ const to = $from.after(depth);
1126
+ if ($from.node(depth - 1).childCount === 1) tr.replaceWith(from, to, state.schema.nodes.paragraph.create());
1127
+ else tr.delete(from, to);
1128
+ editor.view.dispatch(tr);
1129
+ return true;
1130
+ }
1131
+ for (let depth = $from.depth; depth >= 1; depth--) {
1132
+ if ($from.pos !== $from.start(depth)) break;
1133
+ const indexInParent = $from.index(depth - 1);
1134
+ if (indexInParent === 0) continue;
1135
+ const prevNode = $from.node(depth - 1).child(indexInParent - 1);
1136
+ if (prevNode.type.name === "section" && isSectionEmpty(prevNode)) {
1137
+ const deleteFrom = $from.before(depth) - prevNode.nodeSize;
1138
+ const deleteTo = $from.before(depth);
1139
+ editor.view.dispatch(state.tr.delete(deleteFrom, deleteTo));
1140
+ return true;
1141
+ }
1142
+ break;
1143
+ }
1144
+ return false;
1145
+ } };
1146
+ },
1147
+ addCommands() {
1148
+ return { insertSection: () => ({ commands }) => {
1149
+ return commands.insertContent({
1150
+ type: this.name,
1151
+ content: [{
1152
+ type: "paragraph",
1153
+ content: []
1154
+ }]
1155
+ });
1156
+ } };
1157
+ },
1158
+ renderToReactEmail({ children, node, style }) {
1159
+ const inlineStyles = inlineCssToJs(node.attrs?.style);
1160
+ const textAlign = node.attrs?.align || node.attrs?.alignment;
1161
+ return /* @__PURE__ */ jsx(Section, {
1162
+ className: node.attrs?.class || void 0,
1163
+ align: textAlign,
1164
+ style: {
1165
+ ...style,
1166
+ ...inlineStyles,
1167
+ ...getTextAlignment(textAlign)
1168
+ },
1169
+ children
1170
+ });
1171
+ }
1172
+ });
1173
+
1174
+ //#endregion
1175
+ //#region src/extensions/strike.tsx
1176
+ const Strike = EmailMark.from(StrikeBase, ({ children, style }) => /* @__PURE__ */ jsx("s", {
1177
+ style,
1178
+ children
1179
+ }));
1180
+
1181
+ //#endregion
1182
+ //#region src/extensions/style-attribute.tsx
1183
+ const StyleAttribute = Extension.create({
1184
+ name: "styleAttribute",
1185
+ priority: 101,
1186
+ addOptions() {
1187
+ return {
1188
+ types: [],
1189
+ style: []
1190
+ };
1191
+ },
1192
+ addGlobalAttributes() {
1193
+ return [{
1194
+ types: this.options.types,
1195
+ attributes: { style: {
1196
+ default: "",
1197
+ parseHTML: (element) => element.getAttribute("style") || "",
1198
+ renderHTML: (attributes) => {
1199
+ return { style: attributes.style ?? "" };
1200
+ }
1201
+ } }
1202
+ }];
1203
+ },
1204
+ addCommands() {
1205
+ return {
1206
+ unsetStyle: () => ({ commands }) => {
1207
+ return this.options.types.every((type) => commands.resetAttributes(type, "style"));
1208
+ },
1209
+ setStyle: (style) => ({ commands }) => {
1210
+ return this.options.types.every((type) => commands.updateAttributes(type, { style }));
1211
+ }
1212
+ };
1213
+ },
1214
+ addKeyboardShortcuts() {
1215
+ return { Enter: ({ editor }) => {
1216
+ const { state } = editor.view;
1217
+ const { selection } = state;
1218
+ const { $from } = selection;
1219
+ const textBefore = $from.nodeBefore?.text || "";
1220
+ if (textBefore.includes("{{") || textBefore.includes("{{{")) return false;
1221
+ requestAnimationFrame(() => {
1222
+ editor.commands.resetAttributes("paragraph", "style");
1223
+ });
1224
+ return false;
1225
+ } };
1226
+ }
1227
+ });
1228
+
1229
+ //#endregion
1230
+ //#region src/extensions/sup.tsx
1231
+ const SupBase = SuperscriptBase.extend({
1232
+ name: "sup",
1233
+ addCommands() {
1234
+ return {
1235
+ ...this.parent?.(),
1236
+ setSup: () => ({ commands }) => {
1237
+ return commands.setMark(this.name);
1238
+ },
1239
+ toggleSup: () => ({ commands }) => {
1240
+ return commands.toggleMark(this.name);
1241
+ },
1242
+ unsetSup: () => ({ commands }) => {
1243
+ return commands.unsetMark(this.name);
1244
+ }
1245
+ };
1246
+ }
1247
+ });
1248
+ const Sup = EmailMark.from(SupBase, ({ children, style }) => /* @__PURE__ */ jsx("sup", {
1249
+ style,
1250
+ children
1251
+ }));
1252
+
1253
+ //#endregion
1254
+ //#region src/extensions/table.tsx
1255
+ const Table = EmailNode.create({
1256
+ name: "table",
1257
+ group: "block",
1258
+ content: "tableRow+",
1259
+ isolating: true,
1260
+ tableRole: "table",
1261
+ addAttributes() {
1262
+ return { ...createStandardAttributes([
1263
+ ...TABLE_ATTRIBUTES,
1264
+ ...LAYOUT_ATTRIBUTES,
1265
+ ...COMMON_HTML_ATTRIBUTES
1266
+ ]) };
1267
+ },
1268
+ parseHTML() {
1269
+ return [{
1270
+ tag: "table",
1271
+ getAttrs: (node) => {
1272
+ if (typeof node === "string") return false;
1273
+ const element = node;
1274
+ const attrs = {};
1275
+ Array.from(element.attributes).forEach((attr) => {
1276
+ attrs[attr.name] = attr.value;
1277
+ });
1278
+ return attrs;
1279
+ }
1280
+ }];
1281
+ },
1282
+ renderHTML({ HTMLAttributes }) {
1283
+ return [
1284
+ "table",
1285
+ mergeAttributes(this.options.HTMLAttributes, HTMLAttributes),
1286
+ [
1287
+ "tbody",
1288
+ {},
1289
+ 0
1290
+ ]
1291
+ ];
1292
+ },
1293
+ renderToReactEmail({ children, node, style }) {
1294
+ const inlineStyles = inlineCssToJs(node.attrs?.style);
1295
+ const alignment = node.attrs?.align || node.attrs?.alignment;
1296
+ const width = node.attrs?.width;
1297
+ const centeringStyles = alignment === "center" ? {
1298
+ marginLeft: "auto",
1299
+ marginRight: "auto"
1300
+ } : {};
1301
+ return /* @__PURE__ */ jsx(Section, {
1302
+ className: node.attrs?.class || void 0,
1303
+ align: alignment,
1304
+ style: resolveConflictingStyles(style, {
1305
+ ...inlineStyles,
1306
+ ...centeringStyles
1307
+ }),
1308
+ ...width !== void 0 ? { width } : {},
1309
+ children
1310
+ });
1311
+ }
1312
+ });
1313
+ const TableRow = EmailNode.create({
1314
+ name: "tableRow",
1315
+ group: "tableRow",
1316
+ content: "(tableCell | tableHeader)+",
1317
+ addAttributes() {
1318
+ return { ...createStandardAttributes([
1319
+ ...TABLE_CELL_ATTRIBUTES,
1320
+ ...LAYOUT_ATTRIBUTES,
1321
+ ...COMMON_HTML_ATTRIBUTES
1322
+ ]) };
1323
+ },
1324
+ parseHTML() {
1325
+ return [{
1326
+ tag: "tr",
1327
+ getAttrs: (node) => {
1328
+ if (typeof node === "string") return false;
1329
+ const element = node;
1330
+ const attrs = {};
1331
+ Array.from(element.attributes).forEach((attr) => {
1332
+ attrs[attr.name] = attr.value;
1333
+ });
1334
+ return attrs;
1335
+ }
1336
+ }];
1337
+ },
1338
+ renderHTML({ HTMLAttributes }) {
1339
+ return [
1340
+ "tr",
1341
+ HTMLAttributes,
1342
+ 0
1343
+ ];
1344
+ },
1345
+ renderToReactEmail({ children, node, style }) {
1346
+ const inlineStyles = inlineCssToJs(node.attrs?.style);
1347
+ return /* @__PURE__ */ jsx("tr", {
1348
+ className: node.attrs?.class || void 0,
1349
+ style: {
1350
+ ...style,
1351
+ ...inlineStyles
1352
+ },
1353
+ children
1354
+ });
1355
+ }
1356
+ });
1357
+ const TableCell = EmailNode.create({
1358
+ name: "tableCell",
1359
+ group: "tableCell",
1360
+ content: "block+",
1361
+ isolating: true,
1362
+ addAttributes() {
1363
+ return { ...createStandardAttributes([
1364
+ ...TABLE_CELL_ATTRIBUTES,
1365
+ ...LAYOUT_ATTRIBUTES,
1366
+ ...COMMON_HTML_ATTRIBUTES
1367
+ ]) };
1368
+ },
1369
+ parseHTML() {
1370
+ return [{
1371
+ tag: "td",
1372
+ getAttrs: (node) => {
1373
+ if (typeof node === "string") return false;
1374
+ const element = node;
1375
+ const attrs = {};
1376
+ Array.from(element.attributes).forEach((attr) => {
1377
+ attrs[attr.name] = attr.value;
1378
+ });
1379
+ return attrs;
1380
+ }
1381
+ }];
1382
+ },
1383
+ renderHTML({ HTMLAttributes }) {
1384
+ return [
1385
+ "td",
1386
+ HTMLAttributes,
1387
+ 0
1388
+ ];
1389
+ },
1390
+ renderToReactEmail({ children, node, style }) {
1391
+ const inlineStyles = inlineCssToJs(node.attrs?.style);
1392
+ return /* @__PURE__ */ jsx(Column, {
1393
+ className: node.attrs?.class || void 0,
1394
+ align: node.attrs?.align || node.attrs?.alignment,
1395
+ style: {
1396
+ ...style,
1397
+ ...inlineStyles
1398
+ },
1399
+ children
1400
+ });
1401
+ }
1402
+ });
1403
+ const TableHeader = Node.create({
1404
+ name: "tableHeader",
1405
+ group: "tableCell",
1406
+ content: "block+",
1407
+ isolating: true,
1408
+ addAttributes() {
1409
+ return { ...createStandardAttributes([
1410
+ ...TABLE_HEADER_ATTRIBUTES,
1411
+ ...TABLE_CELL_ATTRIBUTES,
1412
+ ...LAYOUT_ATTRIBUTES,
1413
+ ...COMMON_HTML_ATTRIBUTES
1414
+ ]) };
1415
+ },
1416
+ parseHTML() {
1417
+ return [{
1418
+ tag: "th",
1419
+ getAttrs: (node) => {
1420
+ if (typeof node === "string") return false;
1421
+ const element = node;
1422
+ const attrs = {};
1423
+ Array.from(element.attributes).forEach((attr) => {
1424
+ attrs[attr.name] = attr.value;
1425
+ });
1426
+ return attrs;
1427
+ }
1428
+ }];
1429
+ },
1430
+ renderHTML({ HTMLAttributes }) {
1431
+ return [
1432
+ "th",
1433
+ HTMLAttributes,
1434
+ 0
1435
+ ];
1436
+ }
1437
+ });
1438
+
1439
+ //#endregion
1440
+ //#region src/extensions/text.tsx
1441
+ const Text$1 = EmailNode.from(Text, ({ children }) => {
1442
+ return /* @__PURE__ */ jsx(Fragment, { children });
1443
+ });
1444
+
1445
+ //#endregion
1446
+ //#region src/extensions/trailing-node.tsx
1447
+ const skipTrailingNodeMeta = "skipTrailingNode";
1448
+ function nodeEqualsType({ types, node }) {
1449
+ return node && Array.isArray(types) && types.includes(node.type) || node?.type === types;
1450
+ }
1451
+ /**
1452
+ * This extension allows you to add an extra node at the end of a node.
1453
+ *
1454
+ * Differently from TipTap's native one, it allows you to pick which node to append the trailing node to.
1455
+ * @see https://www.tiptap.dev/api/extensions/trailing-node
1456
+ *
1457
+ * We could contribute this to TipTap's core extensions and I think we should at some once we get some time.
1458
+ */
1459
+ const TrailingNode = Extension.create({
1460
+ name: "trailingNode",
1461
+ addOptions() {
1462
+ return {
1463
+ node: void 0,
1464
+ appendTo: "doc",
1465
+ notAfter: []
1466
+ };
1467
+ },
1468
+ addProseMirrorPlugins() {
1469
+ const plugin = new PluginKey(this.name);
1470
+ const defaultNode = this.options.node || this.editor.schema.topNodeType.contentMatch.defaultType?.name || "paragraph";
1471
+ const notAfter = Array.isArray(this.options.notAfter) ? this.options.notAfter : [this.options.notAfter].filter(Boolean);
1472
+ const disabledNodes = Object.entries(this.editor.schema.nodes).map(([, value]) => value).filter((node) => notAfter.concat(defaultNode).includes(node.name));
1473
+ const appendToType = this.editor.schema.nodes[this.options.appendTo || "doc"];
1474
+ const getInsertPositions = (doc) => {
1475
+ const positions = [];
1476
+ if (doc.type === appendToType) {
1477
+ if (!nodeEqualsType({
1478
+ node: doc.lastChild,
1479
+ types: disabledNodes
1480
+ })) positions.push(doc.content.size);
1481
+ }
1482
+ doc.descendants((node, pos) => {
1483
+ if (node.type !== appendToType) return;
1484
+ if (!nodeEqualsType({
1485
+ node: node.lastChild,
1486
+ types: disabledNodes
1487
+ })) positions.push(pos + node.nodeSize - 1);
1488
+ });
1489
+ return positions;
1490
+ };
1491
+ return [new Plugin({
1492
+ key: plugin,
1493
+ appendTransaction: (transactions, __, state) => {
1494
+ const { doc, tr, schema } = state;
1495
+ const shouldInsert = plugin.getState(state);
1496
+ const type = schema.nodes[defaultNode];
1497
+ if (transactions.some((transaction) => transaction.getMeta(skipTrailingNodeMeta))) return;
1498
+ if (!shouldInsert) return;
1499
+ const positions = getInsertPositions(doc);
1500
+ for (const pos of positions.sort((a, b) => b - a)) tr.insert(pos, type.create());
1501
+ return positions.length > 0 ? tr : void 0;
1502
+ },
1503
+ state: {
1504
+ init: (_, state) => {
1505
+ return getInsertPositions(state.doc).length > 0;
1506
+ },
1507
+ apply: (tr, value) => {
1508
+ if (!tr.docChanged) return value;
1509
+ if (tr.getMeta("__uniqueIDTransaction")) return value;
1510
+ return getInsertPositions(tr.doc).length > 0;
1511
+ }
1512
+ }
1513
+ })];
1514
+ }
1515
+ });
1516
+
1517
+ //#endregion
1518
+ //#region src/extensions/underline.tsx
1519
+ const Underline = EmailMark.from(UnderlineBase, ({ children, style }) => /* @__PURE__ */ jsx("u", {
1520
+ style,
1521
+ children
1522
+ }));
1523
+
1524
+ //#endregion
1525
+ //#region src/extensions/uppercase.tsx
1526
+ const Uppercase = EmailMark.create({
1527
+ name: "uppercase",
1528
+ addOptions() {
1529
+ return { HTMLAttributes: {} };
1530
+ },
1531
+ parseHTML() {
1532
+ return [{
1533
+ tag: "span",
1534
+ getAttrs: (node) => {
1535
+ if (node.style.textTransform === "uppercase") return {};
1536
+ return false;
1537
+ }
1538
+ }];
1539
+ },
1540
+ renderHTML({ HTMLAttributes }) {
1541
+ return [
1542
+ "span",
1543
+ mergeAttributes(this.options.HTMLAttributes, HTMLAttributes, { style: "text-transform: uppercase" }),
1544
+ 0
1545
+ ];
1546
+ },
1547
+ renderToReactEmail({ children, style }) {
1548
+ return /* @__PURE__ */ jsx("span", {
1549
+ style: {
1550
+ ...style,
1551
+ textTransform: "uppercase"
1552
+ },
1553
+ children
1554
+ });
1555
+ },
1556
+ addCommands() {
1557
+ return {
1558
+ setUppercase: () => ({ commands }) => {
1559
+ return commands.setMark(this.name);
1560
+ },
1561
+ toggleUppercase: () => ({ commands }) => {
1562
+ return commands.toggleMark(this.name);
1563
+ },
1564
+ unsetUppercase: () => ({ commands }) => {
1565
+ return commands.unsetMark(this.name);
1566
+ }
1567
+ };
1568
+ }
1569
+ });
1570
+
1571
+ //#endregion
1572
+ //#region src/extensions/index.ts
1573
+ const starterKitExtensions = {
1574
+ CodeBlockPrism,
1575
+ Code,
1576
+ TwoColumns,
1577
+ ThreeColumns,
1578
+ FourColumns,
1579
+ Container: Container$1,
1580
+ ColumnsColumn,
1581
+ Paragraph,
1582
+ BulletList,
1583
+ OrderedList,
1584
+ Blockquote,
1585
+ ListItem,
1586
+ HardBreak,
1587
+ Italic,
1588
+ Placeholder,
1589
+ PreviewText,
1590
+ TrailingNode,
1591
+ Bold,
1592
+ Strike,
1593
+ Heading: Heading$2,
1594
+ Divider,
1595
+ Link: Link$1,
1596
+ Sup,
1597
+ Underline,
1598
+ Uppercase,
1599
+ PreservedStyle,
1600
+ Table,
1601
+ TableRow,
1602
+ TableCell,
1603
+ TableHeader,
1604
+ Body: Body$1,
1605
+ Div,
1606
+ Button: Button$1,
1607
+ Section: Section$1,
1608
+ GlobalContent,
1609
+ Text: Text$1,
1610
+ AlignmentAttribute,
1611
+ StyleAttribute,
1612
+ ClassAttribute,
1613
+ MaxNesting,
1614
+ UndoRedo
1615
+ };
1616
+ const StarterKit = Extension.create({
1617
+ name: "reactEmailStarterKit",
1618
+ addOptions() {
1619
+ return {
1620
+ TiptapStarterKit: {},
1621
+ CodeBlockPrism: {
1622
+ defaultLanguage: "javascript",
1623
+ HTMLAttributes: { class: "prism node-codeBlock" }
1624
+ },
1625
+ TrailingNode: {
1626
+ node: "paragraph",
1627
+ appendTo: "container"
1628
+ },
1629
+ Code: { HTMLAttributes: {
1630
+ class: "node-inlineCode",
1631
+ spellcheck: "false"
1632
+ } },
1633
+ TwoColumns: {},
1634
+ ThreeColumns: {},
1635
+ FourColumns: {},
1636
+ ColumnsColumn: {},
1637
+ Paragraph: { HTMLAttributes: { class: "node-paragraph" } },
1638
+ BulletList: { HTMLAttributes: { class: "node-bulletList" } },
1639
+ OrderedList: { HTMLAttributes: { class: "node-orderedList" } },
1640
+ Blockquote: { HTMLAttributes: { class: "node-blockquote" } },
1641
+ ListItem: {},
1642
+ HardBreak: {},
1643
+ Italic: {},
1644
+ Placeholder: {},
1645
+ PreviewText: {},
1646
+ Bold: {},
1647
+ Strike: {},
1648
+ Heading: {},
1649
+ Divider: {},
1650
+ Link: {
1651
+ openOnClick: false,
1652
+ HTMLAttributes: { class: "node-link" }
1653
+ },
1654
+ Sup: {},
1655
+ Underline: {},
1656
+ Uppercase: {},
1657
+ PreservedStyle: {},
1658
+ Table: {},
1659
+ TableRow: {},
1660
+ TableCell: {},
1661
+ TableHeader: {},
1662
+ Body: {},
1663
+ Container: {},
1664
+ Div: {},
1665
+ Button: {},
1666
+ Section: {},
1667
+ GlobalContent: {},
1668
+ AlignmentAttribute: { types: [
1669
+ "heading",
1670
+ "paragraph",
1671
+ "image",
1672
+ "blockquote",
1673
+ "codeBlock",
1674
+ "bulletList",
1675
+ "orderedList",
1676
+ "listItem",
1677
+ "button",
1678
+ "youtube",
1679
+ "twitter",
1680
+ "table",
1681
+ "tableRow",
1682
+ "tableCell",
1683
+ "tableHeader",
1684
+ "columnsColumn"
1685
+ ] },
1686
+ StyleAttribute: { types: [
1687
+ "heading",
1688
+ "paragraph",
1689
+ "image",
1690
+ "blockquote",
1691
+ "codeBlock",
1692
+ "bulletList",
1693
+ "orderedList",
1694
+ "listItem",
1695
+ "button",
1696
+ "youtube",
1697
+ "twitter",
1698
+ "horizontalRule",
1699
+ "footer",
1700
+ "section",
1701
+ "div",
1702
+ "body",
1703
+ "table",
1704
+ "tableRow",
1705
+ "tableCell",
1706
+ "tableHeader",
1707
+ "columnsColumn",
1708
+ "link"
1709
+ ] },
1710
+ Text: {},
1711
+ ClassAttribute: { types: [
1712
+ "heading",
1713
+ "paragraph",
1714
+ "image",
1715
+ "blockquote",
1716
+ "bulletList",
1717
+ "orderedList",
1718
+ "listItem",
1719
+ "button",
1720
+ "youtube",
1721
+ "twitter",
1722
+ "horizontalRule",
1723
+ "footer",
1724
+ "section",
1725
+ "div",
1726
+ "body",
1727
+ "table",
1728
+ "tableRow",
1729
+ "tableCell",
1730
+ "tableHeader",
1731
+ "columnsColumn",
1732
+ "link"
1733
+ ] },
1734
+ MaxNesting: {
1735
+ maxDepth: 50,
1736
+ nodeTypes: [
1737
+ "section",
1738
+ "bulletList",
1739
+ "orderedList"
1740
+ ]
1741
+ },
1742
+ UndoRedo: {}
1743
+ };
1744
+ },
1745
+ addExtensions() {
1746
+ const extensions$1 = [];
1747
+ if (this.options.TiptapStarterKit !== false) extensions$1.push(TipTapStarterKit.configure({
1748
+ undoRedo: false,
1749
+ heading: false,
1750
+ link: false,
1751
+ underline: false,
1752
+ trailingNode: false,
1753
+ bold: false,
1754
+ italic: false,
1755
+ strike: false,
1756
+ code: false,
1757
+ paragraph: false,
1758
+ bulletList: false,
1759
+ orderedList: false,
1760
+ listItem: false,
1761
+ blockquote: false,
1762
+ hardBreak: false,
1763
+ gapcursor: false,
1764
+ codeBlock: false,
1765
+ text: false,
1766
+ horizontalRule: false,
1767
+ dropcursor: {
1768
+ color: "#61a8f8",
1769
+ class: "rounded-full animate-[fade-in_300ms_ease-in-out] !z-40",
1770
+ width: 4
1771
+ },
1772
+ ...this.options.TiptapStarterKit
1773
+ }));
1774
+ for (const [name, extension] of Object.entries(starterKitExtensions)) {
1775
+ const key = name;
1776
+ const extensionOptions = this.options[key];
1777
+ if (extensionOptions !== false) extensions$1.push(extension.configure(extensionOptions));
1778
+ }
1779
+ return extensions$1;
1780
+ }
1781
+ });
1782
+
1783
+ //#endregion
1784
+ export { CodeBlockPrism as A, processStylesForUnlink as C, Divider as D, HardBreak as E, Bold as F, Body$1 as I, Blockquote as L, ClassAttribute as M, Button$1 as N, Div as O, BulletList as P, AlignmentAttribute as R, PreservedStyle as S, Heading$2 as T, Paragraph as _, skipTrailingNodeMeta as a, ListItem as b, TableCell as c, Sup as d, StyleAttribute as f, Placeholder as g, PreviewText as h, TrailingNode as i, Code as j, Container$1 as k, TableHeader as l, Section$1 as m, Uppercase as n, Text$1 as o, Strike as p, Underline as r, Table as s, StarterKit as t, TableRow as u, OrderedList as v, Italic as w, Link$1 as x, MaxNesting as y };
1785
+ //# sourceMappingURL=extensions-BsDsFFkk.mjs.map