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