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