@react-email/editor 0.0.0-experimental.45 → 0.0.0-experimental.47
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{event-bus-BFzKTuhV.mjs → columns-DC8gJU2D.mjs} +5 -88
- package/dist/columns-DC8gJU2D.mjs.map +1 -0
- package/dist/{event-bus-D-uahiao.cjs → columns-DFnIRlLe.cjs} +6 -107
- package/dist/core/index.cjs +5 -6
- package/dist/core/index.d.cts +2 -2
- package/dist/core/index.d.mts +2 -3
- package/dist/core/index.mjs +3 -3
- package/dist/core-BxIUuTKo.mjs +156 -0
- package/dist/core-BxIUuTKo.mjs.map +1 -0
- package/dist/core-i3eza_VQ.cjs +173 -0
- package/dist/event-bus-BxVEXi1L.mjs +88 -0
- package/dist/event-bus-BxVEXi1L.mjs.map +1 -0
- package/dist/event-bus-GmFPYJu2.cjs +105 -0
- package/dist/{extension-B_ImOuII.mjs → extension-79zQ_3No.mjs} +11 -10
- package/dist/{extension-B_ImOuII.mjs.map → extension-79zQ_3No.mjs.map} +1 -1
- package/dist/{extension-DHsEsAaO.cjs → extension-ATLgVzTR.cjs} +12 -11
- package/dist/extensions/index.cjs +10 -10
- package/dist/extensions/index.d.cts +1 -1
- package/dist/extensions/index.d.mts +1 -2
- package/dist/extensions/index.d.mts.map +1 -1
- package/dist/extensions/index.mjs +3 -3
- package/dist/{extensions-BT49qi4I.mjs → extensions-CGtkbFUL.mjs} +13 -352
- package/dist/extensions-CGtkbFUL.mjs.map +1 -0
- package/dist/{extensions-5sSJryUX.cjs → extensions-DE0L4Pim.cjs} +79 -455
- package/dist/global-content-CaNsyaPw.mjs +78 -0
- package/dist/global-content-CaNsyaPw.mjs.map +1 -0
- package/dist/global-content-Dcc6RTLp.cjs +89 -0
- package/dist/{index-BL2rehV8.d.mts → index-BMsf5s28.d.mts} +3 -34
- package/dist/index-BMsf5s28.d.mts.map +1 -0
- package/dist/{index-DJgMqa5C.d.cts → index-DNriNUPU.d.cts} +3 -34
- package/dist/index-DNriNUPU.d.cts.map +1 -0
- package/dist/index.cjs +140 -11
- package/dist/index.d.cts +9 -1
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +9 -1
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +136 -7
- package/dist/index.mjs.map +1 -1
- package/dist/plugins/index.cjs +1 -1
- package/dist/plugins/index.d.cts +1 -1
- package/dist/plugins/index.d.mts +1 -1
- package/dist/plugins/index.mjs +1 -1
- package/dist/{root-CJuwiIRn.mjs → root-DCHEkXs2.mjs} +272 -224
- package/dist/root-DCHEkXs2.mjs.map +1 -0
- package/dist/{root-CEAehvsX.cjs → root-DLdCJfdP.cjs} +288 -234
- package/dist/{set-text-alignment-GMXOPMlJ.mjs → set-text-alignment-BDkB4Vfh.mjs} +1 -1
- package/dist/{set-text-alignment-GMXOPMlJ.mjs.map → set-text-alignment-BDkB4Vfh.mjs.map} +1 -1
- package/dist/{global-content-D3TNgSN6.cjs → styles-CYEzPPfZ.cjs} +0 -88
- package/dist/{global-content-6jVh6L0b.mjs → styles-DZ9S92ix.mjs} +2 -78
- package/dist/styles-DZ9S92ix.mjs.map +1 -0
- package/dist/{types-BNEbRz-a.d.cts → types-B-hiUAR9.d.cts} +1 -1
- package/dist/{types-BNEbRz-a.d.cts.map → types-B-hiUAR9.d.cts.map} +1 -1
- package/dist/{types-C8k-blF7.d.mts → types-J7sLqbPy.d.mts} +1 -1
- package/dist/{types-C8k-blF7.d.mts.map → types-J7sLqbPy.d.mts.map} +1 -1
- package/dist/ui/index.cjs +20 -69
- package/dist/ui/index.d.cts +112 -143
- package/dist/ui/index.d.cts.map +1 -1
- package/dist/ui/index.d.mts +111 -142
- package/dist/ui/index.d.mts.map +1 -1
- package/dist/ui/index.mjs +5 -53
- package/dist/ui/index.mjs.map +1 -1
- package/dist/utils/index.cjs +1 -1
- package/dist/utils/index.mjs +1 -1
- package/package.json +1 -1
- package/readme.md +1 -1
- package/dist/create-paste-handler-B8BtjBk3.d.cts +0 -14
- package/dist/create-paste-handler-B8BtjBk3.d.cts.map +0 -1
- package/dist/create-paste-handler-DsJYKisA.d.mts +0 -14
- package/dist/create-paste-handler-DsJYKisA.d.mts.map +0 -1
- package/dist/event-bus-BFzKTuhV.mjs.map +0 -1
- package/dist/extensions-BT49qi4I.mjs.map +0 -1
- package/dist/global-content-6jVh6L0b.mjs.map +0 -1
- package/dist/index-BL2rehV8.d.mts.map +0 -1
- package/dist/index-DJgMqa5C.d.cts.map +0 -1
- package/dist/root-CJuwiIRn.mjs.map +0 -1
- /package/dist/{set-text-alignment-aNb7Ml9N.cjs → set-text-alignment-BlyZq1GA.cjs} +0 -0
|
@@ -1,306 +1,56 @@
|
|
|
1
|
-
const
|
|
2
|
-
const
|
|
1
|
+
const require_columns = require('./columns-DFnIRlLe.cjs');
|
|
2
|
+
const require_styles = require('./styles-CYEzPPfZ.cjs');
|
|
3
|
+
const require_core = require('./core-i3eza_VQ.cjs');
|
|
4
|
+
const require_event_bus = require('./event-bus-GmFPYJu2.cjs');
|
|
5
|
+
const require_global_content = require('./global-content-Dcc6RTLp.cjs');
|
|
3
6
|
let _tiptap_react = require("@tiptap/react");
|
|
4
|
-
let react = require("react");
|
|
5
|
-
react = require_event_bus.__toESM(react);
|
|
6
|
-
let _tiptap_html = require("@tiptap/html");
|
|
7
7
|
let _react_email_components = require("@react-email/components");
|
|
8
|
-
_react_email_components =
|
|
8
|
+
_react_email_components = require_columns.__toESM(_react_email_components);
|
|
9
9
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
10
10
|
let _tiptap_core = require("@tiptap/core");
|
|
11
11
|
let _tiptap_extensions = require("@tiptap/extensions");
|
|
12
12
|
let _tiptap_starter_kit = require("@tiptap/starter-kit");
|
|
13
|
-
_tiptap_starter_kit =
|
|
13
|
+
_tiptap_starter_kit = require_columns.__toESM(_tiptap_starter_kit);
|
|
14
14
|
let _tiptap_extension_blockquote = require("@tiptap/extension-blockquote");
|
|
15
|
-
_tiptap_extension_blockquote =
|
|
15
|
+
_tiptap_extension_blockquote = require_columns.__toESM(_tiptap_extension_blockquote);
|
|
16
16
|
let _tiptap_extension_bold = require("@tiptap/extension-bold");
|
|
17
|
-
_tiptap_extension_bold =
|
|
17
|
+
_tiptap_extension_bold = require_columns.__toESM(_tiptap_extension_bold);
|
|
18
18
|
let _tiptap_extension_bullet_list = require("@tiptap/extension-bullet-list");
|
|
19
|
-
_tiptap_extension_bullet_list =
|
|
19
|
+
_tiptap_extension_bullet_list = require_columns.__toESM(_tiptap_extension_bullet_list);
|
|
20
20
|
let _tiptap_extension_code = require("@tiptap/extension-code");
|
|
21
|
-
_tiptap_extension_code =
|
|
21
|
+
_tiptap_extension_code = require_columns.__toESM(_tiptap_extension_code);
|
|
22
22
|
let _tiptap_extension_code_block = require("@tiptap/extension-code-block");
|
|
23
|
-
_tiptap_extension_code_block =
|
|
23
|
+
_tiptap_extension_code_block = require_columns.__toESM(_tiptap_extension_code_block);
|
|
24
24
|
let _tiptap_pm_state = require("@tiptap/pm/state");
|
|
25
25
|
let _tiptap_pm_view = require("@tiptap/pm/view");
|
|
26
26
|
let hast_util_from_html = require("hast-util-from-html");
|
|
27
27
|
let prismjs = require("prismjs");
|
|
28
|
-
prismjs =
|
|
28
|
+
prismjs = require_columns.__toESM(prismjs);
|
|
29
29
|
let _tiptap_extension_horizontal_rule = require("@tiptap/extension-horizontal-rule");
|
|
30
|
-
_tiptap_extension_horizontal_rule =
|
|
30
|
+
_tiptap_extension_horizontal_rule = require_columns.__toESM(_tiptap_extension_horizontal_rule);
|
|
31
31
|
let _tiptap_extension_hard_break = require("@tiptap/extension-hard-break");
|
|
32
|
-
_tiptap_extension_hard_break =
|
|
32
|
+
_tiptap_extension_hard_break = require_columns.__toESM(_tiptap_extension_hard_break);
|
|
33
33
|
let _tiptap_extension_heading = require("@tiptap/extension-heading");
|
|
34
34
|
let _tiptap_extension_italic = require("@tiptap/extension-italic");
|
|
35
|
-
_tiptap_extension_italic =
|
|
35
|
+
_tiptap_extension_italic = require_columns.__toESM(_tiptap_extension_italic);
|
|
36
36
|
let _tiptap_extension_link = require("@tiptap/extension-link");
|
|
37
|
-
_tiptap_extension_link =
|
|
37
|
+
_tiptap_extension_link = require_columns.__toESM(_tiptap_extension_link);
|
|
38
38
|
let _tiptap_extension_list_item = require("@tiptap/extension-list-item");
|
|
39
|
-
_tiptap_extension_list_item =
|
|
39
|
+
_tiptap_extension_list_item = require_columns.__toESM(_tiptap_extension_list_item);
|
|
40
40
|
let _tiptap_extension_ordered_list = require("@tiptap/extension-ordered-list");
|
|
41
|
-
_tiptap_extension_ordered_list =
|
|
41
|
+
_tiptap_extension_ordered_list = require_columns.__toESM(_tiptap_extension_ordered_list);
|
|
42
42
|
let _tiptap_extension_paragraph = require("@tiptap/extension-paragraph");
|
|
43
|
-
_tiptap_extension_paragraph =
|
|
43
|
+
_tiptap_extension_paragraph = require_columns.__toESM(_tiptap_extension_paragraph);
|
|
44
44
|
let _tiptap_extension_placeholder = require("@tiptap/extension-placeholder");
|
|
45
|
-
_tiptap_extension_placeholder =
|
|
45
|
+
_tiptap_extension_placeholder = require_columns.__toESM(_tiptap_extension_placeholder);
|
|
46
46
|
let _tiptap_extension_strike = require("@tiptap/extension-strike");
|
|
47
|
-
_tiptap_extension_strike =
|
|
47
|
+
_tiptap_extension_strike = require_columns.__toESM(_tiptap_extension_strike);
|
|
48
48
|
let _tiptap_extension_superscript = require("@tiptap/extension-superscript");
|
|
49
|
-
_tiptap_extension_superscript =
|
|
49
|
+
_tiptap_extension_superscript = require_columns.__toESM(_tiptap_extension_superscript);
|
|
50
50
|
let _tiptap_extension_text = require("@tiptap/extension-text");
|
|
51
51
|
let _tiptap_extension_underline = require("@tiptap/extension-underline");
|
|
52
|
-
_tiptap_extension_underline =
|
|
52
|
+
_tiptap_extension_underline = require_columns.__toESM(_tiptap_extension_underline);
|
|
53
53
|
|
|
54
|
-
//#region src/core/create-drop-handler.ts
|
|
55
|
-
function createDropHandler({ onPaste, onUploadImage }) {
|
|
56
|
-
return (view, event, _slice, moved) => {
|
|
57
|
-
if (!moved && event.dataTransfer && event.dataTransfer.files && event.dataTransfer.files[0]) {
|
|
58
|
-
event.preventDefault();
|
|
59
|
-
const file = event.dataTransfer.files[0];
|
|
60
|
-
if (onPaste?.(file, view)) return true;
|
|
61
|
-
if (file.type.includes("image/") && onUploadImage) {
|
|
62
|
-
onUploadImage(file, view, (view.posAtCoords({
|
|
63
|
-
left: event.clientX,
|
|
64
|
-
top: event.clientY
|
|
65
|
-
})?.pos || 0) - 1);
|
|
66
|
-
return true;
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
return false;
|
|
70
|
-
};
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
//#endregion
|
|
74
|
-
//#region src/utils/paste-sanitizer.ts
|
|
75
|
-
/**
|
|
76
|
-
* Sanitizes pasted HTML.
|
|
77
|
-
* - From editor (has node-* classes): pass through as-is
|
|
78
|
-
* - From external: strip all styles/classes, keep only semantic HTML
|
|
79
|
-
*/
|
|
80
|
-
/**
|
|
81
|
-
* Detects content from the Resend editor by checking for node-* class names.
|
|
82
|
-
*/
|
|
83
|
-
const EDITOR_CLASS_PATTERN = /class="[^"]*node-/;
|
|
84
|
-
/**
|
|
85
|
-
* Attributes to preserve on specific elements for EXTERNAL content.
|
|
86
|
-
* Only functional attributes - NO style or class.
|
|
87
|
-
*/
|
|
88
|
-
const PRESERVED_ATTRIBUTES = {
|
|
89
|
-
a: [
|
|
90
|
-
"href",
|
|
91
|
-
"target",
|
|
92
|
-
"rel"
|
|
93
|
-
],
|
|
94
|
-
img: [
|
|
95
|
-
"src",
|
|
96
|
-
"alt",
|
|
97
|
-
"width",
|
|
98
|
-
"height"
|
|
99
|
-
],
|
|
100
|
-
td: ["colspan", "rowspan"],
|
|
101
|
-
th: [
|
|
102
|
-
"colspan",
|
|
103
|
-
"rowspan",
|
|
104
|
-
"scope"
|
|
105
|
-
],
|
|
106
|
-
table: [
|
|
107
|
-
"border",
|
|
108
|
-
"cellpadding",
|
|
109
|
-
"cellspacing"
|
|
110
|
-
],
|
|
111
|
-
"*": ["id"]
|
|
112
|
-
};
|
|
113
|
-
function isFromEditor(html) {
|
|
114
|
-
return EDITOR_CLASS_PATTERN.test(html);
|
|
115
|
-
}
|
|
116
|
-
function sanitizePastedHtml(html) {
|
|
117
|
-
if (isFromEditor(html)) return html;
|
|
118
|
-
const doc = new DOMParser().parseFromString(html, "text/html");
|
|
119
|
-
sanitizeNode(doc.body);
|
|
120
|
-
return doc.body.innerHTML;
|
|
121
|
-
}
|
|
122
|
-
function sanitizeNode(node) {
|
|
123
|
-
if (node.nodeType === Node.ELEMENT_NODE) sanitizeElement(node);
|
|
124
|
-
for (const child of Array.from(node.childNodes)) sanitizeNode(child);
|
|
125
|
-
}
|
|
126
|
-
function sanitizeElement(el) {
|
|
127
|
-
const allowedForTag = PRESERVED_ATTRIBUTES[el.tagName.toLowerCase()] || [];
|
|
128
|
-
const allowedGlobal = PRESERVED_ATTRIBUTES["*"] || [];
|
|
129
|
-
const allowed = new Set([...allowedForTag, ...allowedGlobal]);
|
|
130
|
-
const attributesToRemove = [];
|
|
131
|
-
for (const attr of Array.from(el.attributes)) {
|
|
132
|
-
if (attr.name.startsWith("data-")) {
|
|
133
|
-
attributesToRemove.push(attr.name);
|
|
134
|
-
continue;
|
|
135
|
-
}
|
|
136
|
-
if (!allowed.has(attr.name)) attributesToRemove.push(attr.name);
|
|
137
|
-
}
|
|
138
|
-
for (const attr of attributesToRemove) el.removeAttribute(attr);
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
//#endregion
|
|
142
|
-
//#region src/core/create-paste-handler.ts
|
|
143
|
-
function createPasteHandler({ onPaste, onUploadImage, extensions }) {
|
|
144
|
-
return (view, event, slice) => {
|
|
145
|
-
const text = event.clipboardData?.getData("text/plain");
|
|
146
|
-
if (text && onPaste?.(text, view)) {
|
|
147
|
-
event.preventDefault();
|
|
148
|
-
return true;
|
|
149
|
-
}
|
|
150
|
-
if (event.clipboardData?.files?.[0]) {
|
|
151
|
-
const file = event.clipboardData.files[0];
|
|
152
|
-
if (onPaste?.(file, view)) {
|
|
153
|
-
event.preventDefault();
|
|
154
|
-
return true;
|
|
155
|
-
}
|
|
156
|
-
if (file.type.includes("image/") && onUploadImage) {
|
|
157
|
-
const pos = view.state.selection.from;
|
|
158
|
-
onUploadImage(file, view, pos);
|
|
159
|
-
return true;
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
/**
|
|
163
|
-
* If the coming content has a single child, we can assume
|
|
164
|
-
* it's a plain text and doesn't need to be parsed and
|
|
165
|
-
* be introduced in a new line
|
|
166
|
-
*/
|
|
167
|
-
if (slice.content.childCount === 1) return false;
|
|
168
|
-
if (event.clipboardData?.getData?.("text/html")) {
|
|
169
|
-
event.preventDefault();
|
|
170
|
-
const jsonContent = (0, _tiptap_html.generateJSON)(sanitizePastedHtml(event.clipboardData.getData("text/html")), extensions);
|
|
171
|
-
const node = view.state.schema.nodeFromJSON(jsonContent);
|
|
172
|
-
const transaction = view.state.tr.replaceSelectionWith(node, false);
|
|
173
|
-
view.dispatch(transaction);
|
|
174
|
-
return true;
|
|
175
|
-
}
|
|
176
|
-
return false;
|
|
177
|
-
};
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
//#endregion
|
|
181
|
-
//#region src/core/serializer/default-base-template.tsx
|
|
182
|
-
function DefaultBaseTemplate({ children, previewText }) {
|
|
183
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_react_email_components.Html, { children: [
|
|
184
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_react_email_components.Head, { children: [
|
|
185
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("meta", {
|
|
186
|
-
content: "width=device-width",
|
|
187
|
-
name: "viewport"
|
|
188
|
-
}),
|
|
189
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("meta", {
|
|
190
|
-
content: "IE=edge",
|
|
191
|
-
httpEquiv: "X-UA-Compatible"
|
|
192
|
-
}),
|
|
193
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("meta", { name: "x-apple-disable-message-reformatting" }),
|
|
194
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("meta", {
|
|
195
|
-
content: "telephone=no,address=no,email=no,date=no,url=no",
|
|
196
|
-
name: "format-detection"
|
|
197
|
-
})
|
|
198
|
-
] }),
|
|
199
|
-
previewText && previewText !== "" && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_react_email_components.Preview, { children: previewText }),
|
|
200
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_react_email_components.Body, { children })
|
|
201
|
-
] });
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
//#endregion
|
|
205
|
-
//#region src/core/serializer/email-mark.ts
|
|
206
|
-
var EmailMark = class EmailMark extends _tiptap_core.Mark {
|
|
207
|
-
constructor(config) {
|
|
208
|
-
super(config);
|
|
209
|
-
}
|
|
210
|
-
/**
|
|
211
|
-
* Create a new Mark instance
|
|
212
|
-
* @param config - Mark configuration object or a function that returns a configuration object
|
|
213
|
-
*/
|
|
214
|
-
static create(config) {
|
|
215
|
-
return new EmailMark(typeof config === "function" ? config() : config);
|
|
216
|
-
}
|
|
217
|
-
static from(mark, renderToReactEmail) {
|
|
218
|
-
const customMark = EmailMark.create({});
|
|
219
|
-
Object.assign(customMark, { ...mark });
|
|
220
|
-
customMark.config = {
|
|
221
|
-
...mark.config,
|
|
222
|
-
renderToReactEmail
|
|
223
|
-
};
|
|
224
|
-
return customMark;
|
|
225
|
-
}
|
|
226
|
-
configure(options) {
|
|
227
|
-
return super.configure(options);
|
|
228
|
-
}
|
|
229
|
-
extend(extendedConfig) {
|
|
230
|
-
const resolvedConfig = typeof extendedConfig === "function" ? extendedConfig() : extendedConfig;
|
|
231
|
-
return super.extend(resolvedConfig);
|
|
232
|
-
}
|
|
233
|
-
};
|
|
234
|
-
|
|
235
|
-
//#endregion
|
|
236
|
-
//#region src/core/serializer/compose-react-email.tsx
|
|
237
|
-
const NODES_WITH_INCREMENTED_CHILD_DEPTH = new Set(["bulletList", "orderedList"]);
|
|
238
|
-
function getMarkRank(schema, markName) {
|
|
239
|
-
return schema.marks[markName]?.rank ?? Number.MAX_SAFE_INTEGER;
|
|
240
|
-
}
|
|
241
|
-
/** Sort marks by schema rank (Tiptap extension priority → ProseMirror order). */
|
|
242
|
-
function sortMarksBySchema(marks, schema) {
|
|
243
|
-
return [...marks].sort((a, b) => getMarkRank(schema, b.type) - getMarkRank(schema, a.type));
|
|
244
|
-
}
|
|
245
|
-
const composeReactEmail = async ({ editor, preview }) => {
|
|
246
|
-
const data = editor.getJSON();
|
|
247
|
-
const extensions = editor.extensionManager.extensions;
|
|
248
|
-
const serializerPlugin = extensions.map((ext) => ext.options?.serializerPlugin).filter((p) => Boolean(p)).at(-1);
|
|
249
|
-
const typeToExtensionMap = Object.fromEntries(extensions.map((extension) => [extension.name, extension]));
|
|
250
|
-
function parseContent(content, depth = 0) {
|
|
251
|
-
if (!content) return;
|
|
252
|
-
return content.map((node, index) => {
|
|
253
|
-
const style = serializerPlugin?.getNodeStyles(node, depth, editor) ?? {};
|
|
254
|
-
const inlineStyles = require_global_content.inlineCssToJs(node.attrs?.style);
|
|
255
|
-
if (!node.type) return null;
|
|
256
|
-
const emailNode = typeToExtensionMap[node.type];
|
|
257
|
-
if (!emailNode || !(emailNode instanceof require_event_bus.EmailNode)) return null;
|
|
258
|
-
const NodeComponent = emailNode.config.renderToReactEmail;
|
|
259
|
-
const childDepth = NODES_WITH_INCREMENTED_CHILD_DEPTH.has(node.type) ? depth + 1 : depth;
|
|
260
|
-
let renderedNode = node.text ? node.text : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(NodeComponent, {
|
|
261
|
-
node: node.type === "table" && inlineStyles.width && !node.attrs?.width ? {
|
|
262
|
-
...node,
|
|
263
|
-
attrs: {
|
|
264
|
-
...node.attrs,
|
|
265
|
-
width: inlineStyles.width
|
|
266
|
-
}
|
|
267
|
-
} : node,
|
|
268
|
-
style,
|
|
269
|
-
extension: emailNode,
|
|
270
|
-
children: parseContent(node.content, childDepth)
|
|
271
|
-
}, index);
|
|
272
|
-
if (node.marks) for (const mark of sortMarksBySchema(node.marks, editor.schema)) {
|
|
273
|
-
const emailMark = typeToExtensionMap[mark.type];
|
|
274
|
-
if (emailMark instanceof EmailMark) {
|
|
275
|
-
const MarkComponent = emailMark.config.renderToReactEmail;
|
|
276
|
-
renderedNode = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(MarkComponent, {
|
|
277
|
-
mark,
|
|
278
|
-
node,
|
|
279
|
-
style: serializerPlugin?.getNodeStyles({
|
|
280
|
-
type: mark.type,
|
|
281
|
-
attrs: mark.attrs ?? {}
|
|
282
|
-
}, depth, editor) ?? {},
|
|
283
|
-
extension: emailMark,
|
|
284
|
-
children: renderedNode
|
|
285
|
-
});
|
|
286
|
-
}
|
|
287
|
-
}
|
|
288
|
-
return renderedNode;
|
|
289
|
-
});
|
|
290
|
-
}
|
|
291
|
-
const unformattedHtml = await (0, _react_email_components.render)(/* @__PURE__ */ (0, react_jsx_runtime.jsx)(serializerPlugin?.BaseTemplate ?? DefaultBaseTemplate, {
|
|
292
|
-
previewText: preview,
|
|
293
|
-
editor,
|
|
294
|
-
children: parseContent(data.content)
|
|
295
|
-
}));
|
|
296
|
-
const [prettyHtml, text] = await Promise.all([(0, _react_email_components.pretty)(unformattedHtml), (0, _react_email_components.toPlainText)(unformattedHtml)]);
|
|
297
|
-
return {
|
|
298
|
-
html: prettyHtml,
|
|
299
|
-
text
|
|
300
|
-
};
|
|
301
|
-
};
|
|
302
|
-
|
|
303
|
-
//#endregion
|
|
304
54
|
//#region src/extensions/alignment-attribute.tsx
|
|
305
55
|
const AlignmentAttribute = _tiptap_core.Extension.create({
|
|
306
56
|
name: "alignmentAttribute",
|
|
@@ -372,7 +122,7 @@ const Blockquote = require_event_bus.EmailNode.from(_tiptap_extension_blockquote
|
|
|
372
122
|
className: node.attrs?.class || void 0,
|
|
373
123
|
style: {
|
|
374
124
|
...style,
|
|
375
|
-
...
|
|
125
|
+
...require_styles.inlineCssToJs(node.attrs?.style),
|
|
376
126
|
...getTextAlignment(node.attrs?.align || node.attrs?.alignment)
|
|
377
127
|
},
|
|
378
128
|
children
|
|
@@ -387,7 +137,7 @@ const Body = require_event_bus.EmailNode.create({
|
|
|
387
137
|
defining: true,
|
|
388
138
|
isolating: true,
|
|
389
139
|
addAttributes() {
|
|
390
|
-
return { ...
|
|
140
|
+
return { ...require_columns.createStandardAttributes([...require_columns.COMMON_HTML_ATTRIBUTES, ...require_columns.LAYOUT_ATTRIBUTES]) };
|
|
391
141
|
},
|
|
392
142
|
parseHTML() {
|
|
393
143
|
return [{
|
|
@@ -411,7 +161,7 @@ const Body = require_event_bus.EmailNode.create({
|
|
|
411
161
|
];
|
|
412
162
|
},
|
|
413
163
|
renderToReactEmail({ children, node, style }) {
|
|
414
|
-
const inlineStyles =
|
|
164
|
+
const inlineStyles = require_styles.inlineCssToJs(node.attrs?.style);
|
|
415
165
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
416
166
|
className: node.attrs?.class || void 0,
|
|
417
167
|
style: {
|
|
@@ -438,7 +188,7 @@ const BoldWithoutFontWeightInference = _tiptap_extension_bold.default.extend({ p
|
|
|
438
188
|
}
|
|
439
189
|
];
|
|
440
190
|
} });
|
|
441
|
-
const Bold = EmailMark.from(BoldWithoutFontWeightInference, ({ children, style }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("strong", {
|
|
191
|
+
const Bold = require_core.EmailMark.from(BoldWithoutFontWeightInference, ({ children, style }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("strong", {
|
|
442
192
|
style,
|
|
443
193
|
children
|
|
444
194
|
}));
|
|
@@ -449,7 +199,7 @@ const BulletList = require_event_bus.EmailNode.from(_tiptap_extension_bullet_lis
|
|
|
449
199
|
className: node.attrs?.class || void 0,
|
|
450
200
|
style: {
|
|
451
201
|
...style,
|
|
452
|
-
...
|
|
202
|
+
...require_styles.inlineCssToJs(node.attrs?.style)
|
|
453
203
|
},
|
|
454
204
|
children
|
|
455
205
|
}));
|
|
@@ -517,7 +267,7 @@ const Button = require_event_bus.EmailNode.create({
|
|
|
517
267
|
};
|
|
518
268
|
},
|
|
519
269
|
renderToReactEmail({ children, node, style }) {
|
|
520
|
-
const inlineStyles =
|
|
270
|
+
const inlineStyles = require_styles.inlineCssToJs(node.attrs?.style);
|
|
521
271
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_react_email_components.Row, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_react_email_components.Column, {
|
|
522
272
|
align: node.attrs?.align || node.attrs?.alignment,
|
|
523
273
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_react_email_components.Button, {
|
|
@@ -577,10 +327,10 @@ const ClassAttribute = _tiptap_core.Extension.create({
|
|
|
577
327
|
|
|
578
328
|
//#endregion
|
|
579
329
|
//#region src/extensions/code.tsx
|
|
580
|
-
const Code = EmailMark.from(_tiptap_extension_code.default, ({ children, node, style }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("code", {
|
|
330
|
+
const Code = require_core.EmailMark.from(_tiptap_extension_code.default, ({ children, node, style }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("code", {
|
|
581
331
|
style: {
|
|
582
332
|
...style,
|
|
583
|
-
...
|
|
333
|
+
...require_styles.inlineCssToJs(node.attrs?.style)
|
|
584
334
|
},
|
|
585
335
|
children
|
|
586
336
|
}));
|
|
@@ -622,7 +372,7 @@ function getDecorations({ doc, name, defaultLanguage, defaultTheme, loadingLangu
|
|
|
622
372
|
loadingLanguages.delete(language);
|
|
623
373
|
});
|
|
624
374
|
}
|
|
625
|
-
if (!
|
|
375
|
+
if (!require_columns.hasPrismThemeLoaded(theme)) require_columns.loadPrismTheme(theme);
|
|
626
376
|
html = prismjs.default.highlight(block.node.textContent, prismjs.default.languages[language], language);
|
|
627
377
|
} catch {
|
|
628
378
|
html = prismjs.default.highlight(block.node.textContent, prismjs.default.languages.javascript, "js");
|
|
@@ -690,7 +440,7 @@ function PrismPlugin({ name, defaultLanguage, defaultTheme }) {
|
|
|
690
440
|
} },
|
|
691
441
|
destroy() {
|
|
692
442
|
pluginView = null;
|
|
693
|
-
|
|
443
|
+
require_columns.removePrismTheme();
|
|
694
444
|
}
|
|
695
445
|
});
|
|
696
446
|
return prismjsPlugin;
|
|
@@ -885,7 +635,7 @@ const Container = require_event_bus.EmailNode.create({
|
|
|
885
635
|
})];
|
|
886
636
|
},
|
|
887
637
|
renderToReactEmail({ children, node, style }) {
|
|
888
|
-
const inlineStyles =
|
|
638
|
+
const inlineStyles = require_styles.inlineCssToJs(node.attrs?.style);
|
|
889
639
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_react_email_components.Container, {
|
|
890
640
|
className: node.attrs?.class || void 0,
|
|
891
641
|
align: style.align || "center",
|
|
@@ -930,10 +680,10 @@ const Div = require_event_bus.EmailNode.create({
|
|
|
930
680
|
];
|
|
931
681
|
},
|
|
932
682
|
addAttributes() {
|
|
933
|
-
return { ...
|
|
683
|
+
return { ...require_columns.createStandardAttributes([...require_columns.COMMON_HTML_ATTRIBUTES, ...require_columns.LAYOUT_ATTRIBUTES]) };
|
|
934
684
|
},
|
|
935
685
|
renderToReactEmail({ children, node, style }) {
|
|
936
|
-
const inlineStyles =
|
|
686
|
+
const inlineStyles = require_styles.inlineCssToJs(node.attrs?.style);
|
|
937
687
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
938
688
|
className: node.attrs?.class || void 0,
|
|
939
689
|
style: {
|
|
@@ -945,96 +695,6 @@ const Div = require_event_bus.EmailNode.create({
|
|
|
945
695
|
}
|
|
946
696
|
});
|
|
947
697
|
|
|
948
|
-
//#endregion
|
|
949
|
-
//#region src/core/is-document-visually-empty.ts
|
|
950
|
-
function isDocumentVisuallyEmpty(doc) {
|
|
951
|
-
let nonGlobalNodeCount = 0;
|
|
952
|
-
let firstNonGlobalNode = null;
|
|
953
|
-
for (let index = 0; index < doc.childCount; index += 1) {
|
|
954
|
-
const node = doc.child(index);
|
|
955
|
-
if (node.type.name === "globalContent") continue;
|
|
956
|
-
nonGlobalNodeCount += 1;
|
|
957
|
-
if (firstNonGlobalNode === null) firstNonGlobalNode = node;
|
|
958
|
-
}
|
|
959
|
-
if (nonGlobalNodeCount === 0) return true;
|
|
960
|
-
if (nonGlobalNodeCount !== 1) return false;
|
|
961
|
-
if (firstNonGlobalNode.type.name === "container") return hasOnlyEmptyParagraph(firstNonGlobalNode);
|
|
962
|
-
return isEmptyParagraph(firstNonGlobalNode);
|
|
963
|
-
}
|
|
964
|
-
function hasOnlyEmptyParagraph(node) {
|
|
965
|
-
if (node.childCount === 0) return true;
|
|
966
|
-
if (node.childCount !== 1) return false;
|
|
967
|
-
return isEmptyParagraph(node.child(0));
|
|
968
|
-
}
|
|
969
|
-
function isEmptyParagraph(node) {
|
|
970
|
-
return node.type.name === "paragraph" && node.content.size === 0;
|
|
971
|
-
}
|
|
972
|
-
|
|
973
|
-
//#endregion
|
|
974
|
-
//#region src/core/use-editor.ts
|
|
975
|
-
function useEditor({ content, extensions = [], onUpdate, onPaste, onUploadImage, onReady, editable = true, ...rest }) {
|
|
976
|
-
const [contentError, setContentError] = react.useState(null);
|
|
977
|
-
const isCollaborative = hasCollaborationExtension(extensions);
|
|
978
|
-
const effectiveExtensions = react.useMemo(() => [
|
|
979
|
-
StarterKit.configure({ UndoRedo: false }),
|
|
980
|
-
...isCollaborative ? [] : [_tiptap_extensions.UndoRedo],
|
|
981
|
-
...extensions
|
|
982
|
-
], [extensions, isCollaborative]);
|
|
983
|
-
const editor = (0, _tiptap_react.useEditor)({
|
|
984
|
-
content: isCollaborative ? void 0 : content,
|
|
985
|
-
extensions: effectiveExtensions,
|
|
986
|
-
editable,
|
|
987
|
-
immediatelyRender: false,
|
|
988
|
-
enableContentCheck: true,
|
|
989
|
-
onContentError({ editor: editor$1, error, disableCollaboration }) {
|
|
990
|
-
disableCollaboration();
|
|
991
|
-
setContentError(error);
|
|
992
|
-
console.error(error);
|
|
993
|
-
editor$1.setEditable(false);
|
|
994
|
-
},
|
|
995
|
-
onCreate({ editor: editor$1 }) {
|
|
996
|
-
onReady?.(editor$1);
|
|
997
|
-
},
|
|
998
|
-
onUpdate({ editor: editor$1, transaction }) {
|
|
999
|
-
onUpdate?.(editor$1, transaction);
|
|
1000
|
-
},
|
|
1001
|
-
editorProps: {
|
|
1002
|
-
handleDOMEvents: { click: (view, event) => {
|
|
1003
|
-
if (!view.editable) {
|
|
1004
|
-
if (event.target.closest("a")) {
|
|
1005
|
-
event.preventDefault();
|
|
1006
|
-
return true;
|
|
1007
|
-
}
|
|
1008
|
-
}
|
|
1009
|
-
return false;
|
|
1010
|
-
} },
|
|
1011
|
-
handlePaste: createPasteHandler({
|
|
1012
|
-
onPaste,
|
|
1013
|
-
onUploadImage,
|
|
1014
|
-
extensions: effectiveExtensions
|
|
1015
|
-
}),
|
|
1016
|
-
handleDrop: createDropHandler({
|
|
1017
|
-
onPaste,
|
|
1018
|
-
onUploadImage
|
|
1019
|
-
})
|
|
1020
|
-
},
|
|
1021
|
-
...rest
|
|
1022
|
-
});
|
|
1023
|
-
return {
|
|
1024
|
-
editor,
|
|
1025
|
-
isEditorEmpty: (0, _tiptap_react.useEditorState)({
|
|
1026
|
-
editor,
|
|
1027
|
-
selector: (context) => {
|
|
1028
|
-
if (!context.editor) return true;
|
|
1029
|
-
return isDocumentVisuallyEmpty(context.editor.state.doc);
|
|
1030
|
-
}
|
|
1031
|
-
}) ?? true,
|
|
1032
|
-
extensions: effectiveExtensions,
|
|
1033
|
-
contentError,
|
|
1034
|
-
isCollaborative
|
|
1035
|
-
};
|
|
1036
|
-
}
|
|
1037
|
-
|
|
1038
698
|
//#endregion
|
|
1039
699
|
//#region src/extensions/divider.tsx
|
|
1040
700
|
const Divider = require_event_bus.EmailNode.from(_tiptap_extension_horizontal_rule.default.extend({
|
|
@@ -1060,7 +720,7 @@ const Divider = require_event_bus.EmailNode.from(_tiptap_extension_horizontal_ru
|
|
|
1060
720
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_tiptap_react.NodeViewWrapper, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_react_email_components.Hr, {
|
|
1061
721
|
...rest,
|
|
1062
722
|
className: "node-hr",
|
|
1063
|
-
style:
|
|
723
|
+
style: require_styles.inlineCssToJs(node.attrs.style)
|
|
1064
724
|
}) });
|
|
1065
725
|
});
|
|
1066
726
|
}
|
|
@@ -1069,7 +729,7 @@ const Divider = require_event_bus.EmailNode.from(_tiptap_extension_horizontal_ru
|
|
|
1069
729
|
className: node.attrs?.class || void 0,
|
|
1070
730
|
style: {
|
|
1071
731
|
...style,
|
|
1072
|
-
...
|
|
732
|
+
...require_styles.inlineCssToJs(node.attrs?.style)
|
|
1073
733
|
}
|
|
1074
734
|
});
|
|
1075
735
|
});
|
|
@@ -1087,7 +747,7 @@ const Heading = require_event_bus.EmailNode.from(_tiptap_extension_heading.Headi
|
|
|
1087
747
|
const attrs = {
|
|
1088
748
|
...rest,
|
|
1089
749
|
className: `node-h${level} ${className}`,
|
|
1090
|
-
style:
|
|
750
|
+
style: require_styles.inlineCssToJs(node.attrs.style)
|
|
1091
751
|
};
|
|
1092
752
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_tiptap_react.NodeViewWrapper, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_react_email_components.Heading, {
|
|
1093
753
|
as: `h${level}`,
|
|
@@ -1101,7 +761,7 @@ const Heading = require_event_bus.EmailNode.from(_tiptap_extension_heading.Headi
|
|
|
1101
761
|
className: node.attrs?.class || void 0,
|
|
1102
762
|
style: {
|
|
1103
763
|
...style,
|
|
1104
|
-
...
|
|
764
|
+
...require_styles.inlineCssToJs(node.attrs?.style),
|
|
1105
765
|
...getTextAlignment(node.attrs?.align ?? node.attrs?.alignment)
|
|
1106
766
|
},
|
|
1107
767
|
children
|
|
@@ -1110,14 +770,14 @@ const Heading = require_event_bus.EmailNode.from(_tiptap_extension_heading.Headi
|
|
|
1110
770
|
|
|
1111
771
|
//#endregion
|
|
1112
772
|
//#region src/extensions/italic.tsx
|
|
1113
|
-
const Italic = EmailMark.from(_tiptap_extension_italic.default, ({ children, style }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("em", {
|
|
773
|
+
const Italic = require_core.EmailMark.from(_tiptap_extension_italic.default, ({ children, style }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("em", {
|
|
1114
774
|
style,
|
|
1115
775
|
children
|
|
1116
776
|
}));
|
|
1117
777
|
|
|
1118
778
|
//#endregion
|
|
1119
779
|
//#region src/extensions/preserved-style.tsx
|
|
1120
|
-
const PreservedStyle = EmailMark.create({
|
|
780
|
+
const PreservedStyle = require_core.EmailMark.create({
|
|
1121
781
|
name: "preservedStyle",
|
|
1122
782
|
addAttributes() {
|
|
1123
783
|
return { style: {
|
|
@@ -1149,7 +809,7 @@ const PreservedStyle = EmailMark.create({
|
|
|
1149
809
|
},
|
|
1150
810
|
renderToReactEmail({ children, mark }) {
|
|
1151
811
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
1152
|
-
style: mark.attrs?.style ?
|
|
812
|
+
style: mark.attrs?.style ? require_styles.inlineCssToJs(mark.attrs.style) : void 0,
|
|
1153
813
|
children
|
|
1154
814
|
});
|
|
1155
815
|
}
|
|
@@ -1197,8 +857,8 @@ function processStylesForUnlink(styleString) {
|
|
|
1197
857
|
|
|
1198
858
|
//#endregion
|
|
1199
859
|
//#region src/extensions/link.tsx
|
|
1200
|
-
const Link = EmailMark.from(_tiptap_extension_link.default, ({ children, mark, style }) => {
|
|
1201
|
-
const linkMarkStyle = mark.attrs?.style ?
|
|
860
|
+
const Link = require_core.EmailMark.from(_tiptap_extension_link.default, ({ children, mark, style }) => {
|
|
861
|
+
const linkMarkStyle = mark.attrs?.style ? require_styles.inlineCssToJs(mark.attrs.style) : {};
|
|
1202
862
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_react_email_components.Link, {
|
|
1203
863
|
href: mark.attrs?.href ?? void 0,
|
|
1204
864
|
rel: mark.attrs?.rel ?? void 0,
|
|
@@ -1275,7 +935,7 @@ const ListItem = require_event_bus.EmailNode.from(_tiptap_extension_list_item.de
|
|
|
1275
935
|
className: node.attrs?.class || void 0,
|
|
1276
936
|
style: {
|
|
1277
937
|
...style,
|
|
1278
|
-
...
|
|
938
|
+
...require_styles.inlineCssToJs(node.attrs?.style),
|
|
1279
939
|
...getTextAlignment(node.attrs?.align || node.attrs?.alignment)
|
|
1280
940
|
},
|
|
1281
941
|
children
|
|
@@ -1363,7 +1023,7 @@ const OrderedList = require_event_bus.EmailNode.from(_tiptap_extension_ordered_l
|
|
|
1363
1023
|
start: node.attrs?.start,
|
|
1364
1024
|
style: {
|
|
1365
1025
|
...style,
|
|
1366
|
-
...
|
|
1026
|
+
...require_styles.inlineCssToJs(node.attrs?.style)
|
|
1367
1027
|
},
|
|
1368
1028
|
children
|
|
1369
1029
|
}));
|
|
@@ -1376,7 +1036,7 @@ const Paragraph = require_event_bus.EmailNode.from(_tiptap_extension_paragraph.d
|
|
|
1376
1036
|
className: node.attrs?.class || void 0,
|
|
1377
1037
|
style: {
|
|
1378
1038
|
...style,
|
|
1379
|
-
...
|
|
1039
|
+
...require_styles.inlineCssToJs(node.attrs?.style),
|
|
1380
1040
|
...getTextAlignment(node.attrs?.align || node.attrs?.alignment)
|
|
1381
1041
|
},
|
|
1382
1042
|
children: isEmpty ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("br", {}) : children
|
|
@@ -1510,7 +1170,7 @@ const Section$1 = require_event_bus.EmailNode.create({
|
|
|
1510
1170
|
} };
|
|
1511
1171
|
},
|
|
1512
1172
|
renderToReactEmail({ children, node, style }) {
|
|
1513
|
-
const inlineStyles =
|
|
1173
|
+
const inlineStyles = require_styles.inlineCssToJs(node.attrs?.style);
|
|
1514
1174
|
const textAlign = node.attrs?.align || node.attrs?.alignment;
|
|
1515
1175
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_react_email_components.Section, {
|
|
1516
1176
|
className: node.attrs?.class || void 0,
|
|
@@ -1527,7 +1187,7 @@ const Section$1 = require_event_bus.EmailNode.create({
|
|
|
1527
1187
|
|
|
1528
1188
|
//#endregion
|
|
1529
1189
|
//#region src/extensions/strike.tsx
|
|
1530
|
-
const Strike = EmailMark.from(_tiptap_extension_strike.default, ({ children, style }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("s", {
|
|
1190
|
+
const Strike = require_core.EmailMark.from(_tiptap_extension_strike.default, ({ children, style }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("s", {
|
|
1531
1191
|
style,
|
|
1532
1192
|
children
|
|
1533
1193
|
}));
|
|
@@ -1599,7 +1259,7 @@ const SupBase = _tiptap_extension_superscript.default.extend({
|
|
|
1599
1259
|
};
|
|
1600
1260
|
}
|
|
1601
1261
|
});
|
|
1602
|
-
const Sup = EmailMark.from(SupBase, ({ children, style }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("sup", {
|
|
1262
|
+
const Sup = require_core.EmailMark.from(SupBase, ({ children, style }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("sup", {
|
|
1603
1263
|
style,
|
|
1604
1264
|
children
|
|
1605
1265
|
}));
|
|
@@ -1613,10 +1273,10 @@ const Table = require_event_bus.EmailNode.create({
|
|
|
1613
1273
|
isolating: true,
|
|
1614
1274
|
tableRole: "table",
|
|
1615
1275
|
addAttributes() {
|
|
1616
|
-
return { ...
|
|
1617
|
-
...
|
|
1618
|
-
...
|
|
1619
|
-
...
|
|
1276
|
+
return { ...require_columns.createStandardAttributes([
|
|
1277
|
+
...require_columns.TABLE_ATTRIBUTES,
|
|
1278
|
+
...require_columns.LAYOUT_ATTRIBUTES,
|
|
1279
|
+
...require_columns.COMMON_HTML_ATTRIBUTES
|
|
1620
1280
|
]) };
|
|
1621
1281
|
},
|
|
1622
1282
|
parseHTML() {
|
|
@@ -1645,7 +1305,7 @@ const Table = require_event_bus.EmailNode.create({
|
|
|
1645
1305
|
];
|
|
1646
1306
|
},
|
|
1647
1307
|
renderToReactEmail({ children, node, style }) {
|
|
1648
|
-
const inlineStyles =
|
|
1308
|
+
const inlineStyles = require_styles.inlineCssToJs(node.attrs?.style);
|
|
1649
1309
|
const alignment = node.attrs?.align || node.attrs?.alignment;
|
|
1650
1310
|
const width = node.attrs?.width;
|
|
1651
1311
|
const centeringStyles = alignment === "center" ? {
|
|
@@ -1655,7 +1315,7 @@ const Table = require_event_bus.EmailNode.create({
|
|
|
1655
1315
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_react_email_components.Section, {
|
|
1656
1316
|
className: node.attrs?.class || void 0,
|
|
1657
1317
|
align: alignment,
|
|
1658
|
-
style:
|
|
1318
|
+
style: require_styles.resolveConflictingStyles(style, {
|
|
1659
1319
|
...inlineStyles,
|
|
1660
1320
|
...centeringStyles
|
|
1661
1321
|
}),
|
|
@@ -1669,10 +1329,10 @@ const TableRow = require_event_bus.EmailNode.create({
|
|
|
1669
1329
|
group: "tableRow",
|
|
1670
1330
|
content: "(tableCell | tableHeader)+",
|
|
1671
1331
|
addAttributes() {
|
|
1672
|
-
return { ...
|
|
1673
|
-
...
|
|
1674
|
-
...
|
|
1675
|
-
...
|
|
1332
|
+
return { ...require_columns.createStandardAttributes([
|
|
1333
|
+
...require_columns.TABLE_CELL_ATTRIBUTES,
|
|
1334
|
+
...require_columns.LAYOUT_ATTRIBUTES,
|
|
1335
|
+
...require_columns.COMMON_HTML_ATTRIBUTES
|
|
1676
1336
|
]) };
|
|
1677
1337
|
},
|
|
1678
1338
|
parseHTML() {
|
|
@@ -1697,7 +1357,7 @@ const TableRow = require_event_bus.EmailNode.create({
|
|
|
1697
1357
|
];
|
|
1698
1358
|
},
|
|
1699
1359
|
renderToReactEmail({ children, node, style }) {
|
|
1700
|
-
const inlineStyles =
|
|
1360
|
+
const inlineStyles = require_styles.inlineCssToJs(node.attrs?.style);
|
|
1701
1361
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("tr", {
|
|
1702
1362
|
className: node.attrs?.class || void 0,
|
|
1703
1363
|
style: {
|
|
@@ -1714,10 +1374,10 @@ const TableCell = require_event_bus.EmailNode.create({
|
|
|
1714
1374
|
content: "block+",
|
|
1715
1375
|
isolating: true,
|
|
1716
1376
|
addAttributes() {
|
|
1717
|
-
return { ...
|
|
1718
|
-
...
|
|
1719
|
-
...
|
|
1720
|
-
...
|
|
1377
|
+
return { ...require_columns.createStandardAttributes([
|
|
1378
|
+
...require_columns.TABLE_CELL_ATTRIBUTES,
|
|
1379
|
+
...require_columns.LAYOUT_ATTRIBUTES,
|
|
1380
|
+
...require_columns.COMMON_HTML_ATTRIBUTES
|
|
1721
1381
|
]) };
|
|
1722
1382
|
},
|
|
1723
1383
|
parseHTML() {
|
|
@@ -1742,7 +1402,7 @@ const TableCell = require_event_bus.EmailNode.create({
|
|
|
1742
1402
|
];
|
|
1743
1403
|
},
|
|
1744
1404
|
renderToReactEmail({ children, node, style }) {
|
|
1745
|
-
const inlineStyles =
|
|
1405
|
+
const inlineStyles = require_styles.inlineCssToJs(node.attrs?.style);
|
|
1746
1406
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_react_email_components.Column, {
|
|
1747
1407
|
className: node.attrs?.class || void 0,
|
|
1748
1408
|
align: node.attrs?.align || node.attrs?.alignment,
|
|
@@ -1760,11 +1420,11 @@ const TableHeader = _tiptap_core.Node.create({
|
|
|
1760
1420
|
content: "block+",
|
|
1761
1421
|
isolating: true,
|
|
1762
1422
|
addAttributes() {
|
|
1763
|
-
return { ...
|
|
1764
|
-
...
|
|
1765
|
-
...
|
|
1766
|
-
...
|
|
1767
|
-
...
|
|
1423
|
+
return { ...require_columns.createStandardAttributes([
|
|
1424
|
+
...require_columns.TABLE_HEADER_ATTRIBUTES,
|
|
1425
|
+
...require_columns.TABLE_CELL_ATTRIBUTES,
|
|
1426
|
+
...require_columns.LAYOUT_ATTRIBUTES,
|
|
1427
|
+
...require_columns.COMMON_HTML_ATTRIBUTES
|
|
1768
1428
|
]) };
|
|
1769
1429
|
},
|
|
1770
1430
|
parseHTML() {
|
|
@@ -1870,14 +1530,14 @@ const TrailingNode = _tiptap_core.Extension.create({
|
|
|
1870
1530
|
|
|
1871
1531
|
//#endregion
|
|
1872
1532
|
//#region src/extensions/underline.tsx
|
|
1873
|
-
const Underline = EmailMark.from(_tiptap_extension_underline.default, ({ children, style }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("u", {
|
|
1533
|
+
const Underline = require_core.EmailMark.from(_tiptap_extension_underline.default, ({ children, style }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("u", {
|
|
1874
1534
|
style,
|
|
1875
1535
|
children
|
|
1876
1536
|
}));
|
|
1877
1537
|
|
|
1878
1538
|
//#endregion
|
|
1879
1539
|
//#region src/extensions/uppercase.tsx
|
|
1880
|
-
const Uppercase = EmailMark.create({
|
|
1540
|
+
const Uppercase = require_core.EmailMark.create({
|
|
1881
1541
|
name: "uppercase",
|
|
1882
1542
|
addOptions() {
|
|
1883
1543
|
return { HTMLAttributes: {} };
|
|
@@ -1927,11 +1587,11 @@ const Uppercase = EmailMark.create({
|
|
|
1927
1587
|
const starterKitExtensions = {
|
|
1928
1588
|
CodeBlockPrism,
|
|
1929
1589
|
Code,
|
|
1930
|
-
TwoColumns:
|
|
1931
|
-
ThreeColumns:
|
|
1932
|
-
FourColumns:
|
|
1590
|
+
TwoColumns: require_columns.TwoColumns,
|
|
1591
|
+
ThreeColumns: require_columns.ThreeColumns,
|
|
1592
|
+
FourColumns: require_columns.FourColumns,
|
|
1933
1593
|
Container,
|
|
1934
|
-
ColumnsColumn:
|
|
1594
|
+
ColumnsColumn: require_columns.ColumnsColumn,
|
|
1935
1595
|
Paragraph,
|
|
1936
1596
|
BulletList,
|
|
1937
1597
|
OrderedList,
|
|
@@ -2207,12 +1867,6 @@ Object.defineProperty(exports, 'Divider', {
|
|
|
2207
1867
|
return Divider;
|
|
2208
1868
|
}
|
|
2209
1869
|
});
|
|
2210
|
-
Object.defineProperty(exports, 'EmailMark', {
|
|
2211
|
-
enumerable: true,
|
|
2212
|
-
get: function () {
|
|
2213
|
-
return EmailMark;
|
|
2214
|
-
}
|
|
2215
|
-
});
|
|
2216
1870
|
Object.defineProperty(exports, 'HardBreak', {
|
|
2217
1871
|
enumerable: true,
|
|
2218
1872
|
get: function () {
|
|
@@ -2357,30 +2011,6 @@ Object.defineProperty(exports, 'Uppercase', {
|
|
|
2357
2011
|
return Uppercase;
|
|
2358
2012
|
}
|
|
2359
2013
|
});
|
|
2360
|
-
Object.defineProperty(exports, 'composeReactEmail', {
|
|
2361
|
-
enumerable: true,
|
|
2362
|
-
get: function () {
|
|
2363
|
-
return composeReactEmail;
|
|
2364
|
-
}
|
|
2365
|
-
});
|
|
2366
|
-
Object.defineProperty(exports, 'createDropHandler', {
|
|
2367
|
-
enumerable: true,
|
|
2368
|
-
get: function () {
|
|
2369
|
-
return createDropHandler;
|
|
2370
|
-
}
|
|
2371
|
-
});
|
|
2372
|
-
Object.defineProperty(exports, 'createPasteHandler', {
|
|
2373
|
-
enumerable: true,
|
|
2374
|
-
get: function () {
|
|
2375
|
-
return createPasteHandler;
|
|
2376
|
-
}
|
|
2377
|
-
});
|
|
2378
|
-
Object.defineProperty(exports, 'isDocumentVisuallyEmpty', {
|
|
2379
|
-
enumerable: true,
|
|
2380
|
-
get: function () {
|
|
2381
|
-
return isDocumentVisuallyEmpty;
|
|
2382
|
-
}
|
|
2383
|
-
});
|
|
2384
2014
|
Object.defineProperty(exports, 'processStylesForUnlink', {
|
|
2385
2015
|
enumerable: true,
|
|
2386
2016
|
get: function () {
|
|
@@ -2392,10 +2022,4 @@ Object.defineProperty(exports, 'skipTrailingNodeMeta', {
|
|
|
2392
2022
|
get: function () {
|
|
2393
2023
|
return skipTrailingNodeMeta;
|
|
2394
2024
|
}
|
|
2395
|
-
});
|
|
2396
|
-
Object.defineProperty(exports, 'useEditor', {
|
|
2397
|
-
enumerable: true,
|
|
2398
|
-
get: function () {
|
|
2399
|
-
return useEditor;
|
|
2400
|
-
}
|
|
2401
2025
|
});
|