@templatical/editor 0.8.4 → 0.8.5
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/{AiChatSidebar-CnRXeK77.js → AiChatSidebar-uhkhnXQd.js} +1 -1
- package/dist/{AiFeatureMenu-BYDDrpj6.js → AiFeatureMenu-DXNKvXP5.js} +1 -1
- package/dist/{CloudEditor-B9a_K6Cm.js → CloudEditor-BSkPQjwo.js} +6 -6
- package/dist/{CollaboratorBar-HN4whzM-.js → CollaboratorBar-CP76Sh6c.js} +1 -1
- package/dist/{DesignReferenceSidebar-0GwjUn2V.js → DesignReferenceSidebar-CfJqJ7l6.js} +1 -1
- package/dist/{ModuleBrowserModal-DPZBsvqk.js → ModuleBrowserModal-BFQTm6uY.js} +4 -4
- package/dist/{ModulePreviewCanvas-CK4j11-e.js → ModulePreviewCanvas-DeqMpo73.js} +1 -1
- package/dist/{ParagraphEditor-DBus_iHH.js → ParagraphEditor-DqomSbW3.js} +13 -13
- package/dist/{SaveModuleDialog-DORRSbBo.js → SaveModuleDialog-DKcpPeWd.js} +2 -2
- package/dist/{SnapshotHistory-DTMVEk03.js → SnapshotHistory-Z9RQj53S.js} +1 -1
- package/dist/{TestEmailModal-DJmYp0Qi.js → TestEmailModal-C8DhylO1.js} +2 -2
- package/dist/{TitleEditor-70d9AF1V.js → TitleEditor-CgLrn6R3.js} +5 -5
- package/dist/{TplModal-BEfwlvPC.js → TplModal-CbwRwmR3.js} +1 -1
- package/dist/{blockTypeIcons-2DRoPa3K.js → blockTypeIcons-CccKujXP.js} +1 -1
- package/dist/bundle-stats.json +6 -6
- package/dist/cdn/chunks/{AiFeatureMenu-CcuKnisc.js → AiFeatureMenu-ChNv7XXj.js} +2 -2
- package/dist/cdn/chunks/{AiFeatureMenu-CcuKnisc.js.map → AiFeatureMenu-ChNv7XXj.js.map} +1 -1
- package/dist/cdn/chunks/{BlockIssueBadge-Sr3is7Wr.js → BlockIssueBadge-BovmWgok.js} +2 -2
- package/dist/cdn/chunks/{BlockIssueBadge-Sr3is7Wr.js.map → BlockIssueBadge-BovmWgok.js.map} +1 -1
- package/dist/cdn/chunks/{CloudEditor-Bi10d2Gq.js → CloudEditor-CHF_P5OL.js} +7 -7
- package/dist/cdn/chunks/{CloudEditor-Bi10d2Gq.js.map → CloudEditor-CHF_P5OL.js.map} +1 -1
- package/dist/cdn/chunks/{CollaboratorBar-C0zeecvl.js → CollaboratorBar-Bjr5YSh0.js} +3 -3
- package/dist/cdn/chunks/{CollaboratorBar-C0zeecvl.js.map → CollaboratorBar-Bjr5YSh0.js.map} +1 -1
- package/dist/cdn/chunks/{CountdownBlock-CpSUUDDs.js → CountdownBlock-KyzvhjMF.js} +2 -2
- package/dist/cdn/chunks/{CountdownBlock-CpSUUDDs.js.map → CountdownBlock-KyzvhjMF.js.map} +1 -1
- package/dist/cdn/chunks/{CountdownToolbar-BBzdR-00.js → CountdownToolbar-bJtMHGYz.js} +3 -3
- package/dist/cdn/chunks/{CountdownToolbar-BBzdR-00.js.map → CountdownToolbar-bJtMHGYz.js.map} +1 -1
- package/dist/cdn/chunks/{IssuesPanel-Bthq6qoZ.js → IssuesPanel-DFSYTQXy.js} +3 -3
- package/dist/cdn/chunks/{IssuesPanel-Bthq6qoZ.js.map → IssuesPanel-DFSYTQXy.js.map} +1 -1
- package/dist/cdn/chunks/{ModuleBrowserModal-CFMd6M7E.js → ModuleBrowserModal-DS0BGRhZ.js} +5 -5
- package/dist/cdn/chunks/{ModuleBrowserModal-CFMd6M7E.js.map → ModuleBrowserModal-DS0BGRhZ.js.map} +1 -1
- package/dist/cdn/chunks/{ModulePreviewCanvas-BkcPcF5C.js → ModulePreviewCanvas-Dwn2cA5a.js} +2 -2
- package/dist/cdn/chunks/{ModulePreviewCanvas-BkcPcF5C.js.map → ModulePreviewCanvas-Dwn2cA5a.js.map} +1 -1
- package/dist/cdn/chunks/{NumberWithSuffix-C2hH_ZIK.js → NumberWithSuffix-BNBeHv0P.js} +2 -2
- package/dist/cdn/chunks/{NumberWithSuffix-C2hH_ZIK.js.map → NumberWithSuffix-BNBeHv0P.js.map} +1 -1
- package/dist/cdn/chunks/{ParagraphEditor-BIWXLPfu.js → ParagraphEditor-C4TrTIOm.js} +16 -16
- package/dist/cdn/chunks/{ParagraphEditor-BIWXLPfu.js.map → ParagraphEditor-C4TrTIOm.js.map} +1 -1
- package/dist/cdn/chunks/{RichTextEditorContent-DU0gc4bi.js → RichTextEditorContent-HNFFL4aK.js} +2 -2
- package/dist/cdn/chunks/{RichTextEditorContent-DU0gc4bi.js.map → RichTextEditorContent-HNFFL4aK.js.map} +1 -1
- package/dist/cdn/chunks/{SaveModuleDialog-DR9EZlWe.js → SaveModuleDialog-CbHqqeID.js} +2 -2
- package/dist/cdn/chunks/{SaveModuleDialog-DR9EZlWe.js.map → SaveModuleDialog-CbHqqeID.js.map} +1 -1
- package/dist/cdn/chunks/{TitleEditor-DZcx2N4R.js → TitleEditor-gr-eBUq_.js} +8 -8
- package/dist/cdn/chunks/{TitleEditor-DZcx2N4R.js.map → TitleEditor-gr-eBUq_.js.map} +1 -1
- package/dist/cdn/chunks/{blockTypeIcons-eVGGIdne.js → blockTypeIcons-BUlgu9JL.js} +3 -3
- package/dist/cdn/chunks/{blockTypeIcons-eVGGIdne.js.map → blockTypeIcons-BUlgu9JL.js.map} +1 -1
- package/dist/cdn/chunks/{extensions-CvCoOuWB.js → extensions-DK_lVs7A.js} +3 -3
- package/dist/cdn/chunks/{extensions-CvCoOuWB.js.map → extensions-DK_lVs7A.js.map} +1 -1
- package/dist/cdn/chunks/{features-CUYy5kZQ.js → features-LiilsBqW.js} +806 -773
- package/dist/cdn/chunks/features-LiilsBqW.js.map +1 -0
- package/dist/cdn/chunks/{icons-C4zY5-I3.js → icons-Bn2SIR30.js} +2 -2
- package/dist/cdn/chunks/{icons-C4zY5-I3.js.map → icons-Bn2SIR30.js.map} +1 -1
- package/dist/cdn/chunks/{media-library-BNt3msId.js → media-library-Bb2PavAd.js} +3 -3
- package/dist/cdn/chunks/{media-library-BNt3msId.js.map → media-library-Bb2PavAd.js.map} +1 -1
- package/dist/cdn/chunks/{quality-BTPRPGB-.js → quality-Bpj6kNxR.js} +180 -154
- package/dist/cdn/chunks/{quality-BTPRPGB-.js.map → quality-Bpj6kNxR.js.map} +1 -1
- package/dist/cdn/chunks/{renderer-IOmuuZjJ.js → renderer-CYYyu-Di.js} +130 -96
- package/dist/cdn/chunks/{renderer-IOmuuZjJ.js.map → renderer-CYYyu-Di.js.map} +1 -1
- package/dist/cdn/chunks/{src-Dp0ZFQ4-.js → src-CQjZnxvw.js} +4 -4
- package/dist/cdn/chunks/{src-Dp0ZFQ4-.js.map → src-CQjZnxvw.js.map} +1 -1
- package/dist/cdn/chunks/{styles-DtgjgsBH.js → styles-5g8XOS68.js} +8 -8
- package/dist/cdn/chunks/{styles-DtgjgsBH.js.map → styles-5g8XOS68.js.map} +1 -1
- package/dist/cdn/chunks/{tiptap-BErAJEvo.js → tiptap-BBbH3IT9.js} +849 -725
- package/dist/cdn/chunks/tiptap-BBbH3IT9.js.map +1 -0
- package/dist/cdn/editor.js +5 -5
- package/dist/{cloud-Dz8Ay2FM.js → cloud-VxYMtfXC.js} +1 -1
- package/dist/{dist-BygsE-n3.js → dist-BDgf2G-V.js} +453 -314
- package/dist/{dist-BtDBsF3N.js → dist-BxP6TB0l.js} +2 -2
- package/dist/{dist-DWhP3Dp2.js → dist-BzuC8o3y.js} +1209 -1217
- package/dist/{dist-v-O2Subd.js → dist-C0jo8wtG.js} +2 -2
- package/dist/{dist-BTgujVMy.js → dist-C8wMh_gi.js} +2 -2
- package/dist/{dist-Cipw2HFH.js → dist-CIV3Brg-.js} +37 -4
- package/dist/{dist-BS5Oi67L.js → dist-CUpJmrjt.js} +2 -2
- package/dist/dist-D5lmdi1F.js +5 -0
- package/dist/{dist-T-ORzNfM.js → dist-D8C6jIXM.js} +168 -175
- package/dist/dist-DILjuzSv.js +5 -0
- package/dist/{dist-CDtcJMB2.js → dist-DXaxGLsw.js} +33 -33
- package/dist/{dist-DnGTaPRX.js → dist-DYO-w_Jf.js} +2 -2
- package/dist/{dist-CDZCyoRy.js → dist-UK-lbEBc.js} +2 -2
- package/dist/{extensions-BmGiz8Oo.js → extensions-DeNHyWwh.js} +27 -27
- package/dist/{styles-DFeOGKa_.js → styles-Bgqv7rLA.js} +4 -4
- package/dist/templatical-editor.js +3 -3
- package/dist/{useEditorCore-BXz-UXPd.js → useEditorCore-CaOVDL_m.js} +4 -4
- package/dist/{useMergeTag-CS2bmWA0.js → useMergeTag-RWsgUcSh.js} +1 -1
- package/package.json +21 -21
- package/dist/cdn/chunks/features-CUYy5kZQ.js.map +0 -1
- package/dist/cdn/chunks/tiptap-BErAJEvo.js.map +0 -1
- package/dist/dist-BySzGkeC.js +0 -5
- package/dist/dist-D7JUZ2Kd.js +0 -5
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { n as e } from "./rolldown-runtime-Dqa2HsxW.js";
|
|
2
|
-
import { An as t, Cn as n, Dn as r, En as i, Fn as a, In as o, Mn as s, Nn as c, On as l, Pn as u, Tn as d, jn as f, kn as p, wn as m } from "./features-
|
|
2
|
+
import { An as t, Cn as n, Dn as r, En as i, Fn as a, In as o, Mn as s, Nn as c, On as l, Pn as u, Tn as d, jn as f, kn as p, wn as m } from "./features-LiilsBqW.js";
|
|
3
3
|
//#endregion
|
|
4
4
|
//#region ../renderer/src/render-context.ts
|
|
5
5
|
var h = `https://unpkg.com/@templatical/renderer@${{
|
|
6
6
|
name: "@templatical/renderer",
|
|
7
7
|
description: "Render Templatical email templates to MJML",
|
|
8
|
-
version: "0.8.
|
|
8
|
+
version: "0.8.5",
|
|
9
9
|
bugs: "https://github.com/templatical/sdk/issues",
|
|
10
10
|
dependencies: { "@templatical/types": "workspace:*" },
|
|
11
11
|
devDependencies: {
|
|
@@ -90,31 +90,65 @@ function S(e) {
|
|
|
90
90
|
return e === "" ? "" : x(e).replace(/[;{}\r\n]/g, "");
|
|
91
91
|
}
|
|
92
92
|
function C(e) {
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
93
|
+
return e === "" ? "" : w(e, (e) => T(e, "data-merge-tag") ?? T(e, "data-logic-merge-tag"));
|
|
94
|
+
}
|
|
95
|
+
function w(e, t) {
|
|
96
|
+
let n = "", r = 0;
|
|
97
|
+
for (; r < e.length;) {
|
|
98
|
+
let i = e.indexOf("<span", r);
|
|
99
|
+
if (i === -1) {
|
|
100
|
+
n += e.substring(r);
|
|
101
|
+
break;
|
|
102
|
+
}
|
|
103
|
+
let a = e[i + 5];
|
|
104
|
+
if (a !== ">" && a !== " " && a !== " " && a !== "\n" && a !== "\r" && a !== "/") {
|
|
105
|
+
n += e.substring(r, i + 5), r = i + 5;
|
|
106
|
+
continue;
|
|
107
|
+
}
|
|
108
|
+
let o = e.indexOf(">", i + 5);
|
|
109
|
+
if (o === -1) {
|
|
110
|
+
n += e.substring(r);
|
|
111
|
+
break;
|
|
112
|
+
}
|
|
113
|
+
let s = e.indexOf("</span>", o + 1);
|
|
114
|
+
if (s === -1) {
|
|
115
|
+
n += e.substring(r);
|
|
116
|
+
break;
|
|
117
|
+
}
|
|
118
|
+
let c = t(e.substring(i + 5, o));
|
|
119
|
+
if (c === null) {
|
|
120
|
+
n += e.substring(r, i + 5), r = i + 5;
|
|
121
|
+
continue;
|
|
122
|
+
}
|
|
123
|
+
n += e.substring(r, i), n += c, r = s + 7;
|
|
124
|
+
}
|
|
125
|
+
return n;
|
|
126
|
+
}
|
|
127
|
+
function T(e, t) {
|
|
128
|
+
let n = RegExp(`(?:^|\\s)${t}="([^"<>]*)"`).exec(e);
|
|
129
|
+
return n ? n[1] : null;
|
|
96
130
|
}
|
|
97
131
|
//#endregion
|
|
98
132
|
//#region ../renderer/src/padding.ts
|
|
99
|
-
function
|
|
133
|
+
function E(e) {
|
|
100
134
|
return `${e.top}px ${e.right}px ${e.bottom}px ${e.left}px`;
|
|
101
135
|
}
|
|
102
136
|
//#endregion
|
|
103
137
|
//#region ../renderer/src/utils.ts
|
|
104
|
-
function
|
|
138
|
+
function D(e, t) {
|
|
105
139
|
return e ? ` ${t === "native" ? "background-color" : "container-background-color"}="${e}"` : "";
|
|
106
140
|
}
|
|
107
141
|
//#endregion
|
|
108
142
|
//#region ../renderer/src/visibility.ts
|
|
109
|
-
function
|
|
143
|
+
function O(e) {
|
|
110
144
|
let t = e.visibility;
|
|
111
145
|
return t ? !t.desktop && !t.tablet && !t.mobile : !1;
|
|
112
146
|
}
|
|
113
|
-
function
|
|
114
|
-
let t =
|
|
147
|
+
function k(e) {
|
|
148
|
+
let t = A(e);
|
|
115
149
|
return t === "" ? "" : ` css-class="${t}"`;
|
|
116
150
|
}
|
|
117
|
-
function
|
|
151
|
+
function A(e) {
|
|
118
152
|
let t = e.visibility;
|
|
119
153
|
if (!t) return "";
|
|
120
154
|
let n = [];
|
|
@@ -123,8 +157,8 @@ function O(e) {
|
|
|
123
157
|
//#endregion
|
|
124
158
|
//#region ../renderer/src/renderers/title.ts
|
|
125
159
|
function ee(e, t) {
|
|
126
|
-
if (
|
|
127
|
-
let n =
|
|
160
|
+
if (O(e)) return "";
|
|
161
|
+
let n = E(e.styles.padding), r = D(e.styles.backgroundColor, "container"), i = te(C(e.content)), a = o[e.level] ?? o[2], s = x(e.color), c = e.textAlign, l = ne(e.fontFamily, t), u = k(e), d = `h${o[e.level] ? e.level : 2}`;
|
|
128
162
|
return `<mj-text
|
|
129
163
|
font-size="${a}px"
|
|
130
164
|
color="${s}"
|
|
@@ -133,28 +167,28 @@ function ee(e, t) {
|
|
|
133
167
|
padding="${n}"${r}${l}${u}
|
|
134
168
|
><${d} style="margin:0;font-size:inherit;color:inherit;line-height:inherit">${i}</${d}></mj-text>`;
|
|
135
169
|
}
|
|
136
|
-
function
|
|
170
|
+
function te(e) {
|
|
137
171
|
let t = e.match(/^\s*<p\b[^>]*>([\s\S]*)<\/p>\s*$/);
|
|
138
172
|
return !t || /<\/p>\s*<p\b/i.test(t[1]) ? e : t[1];
|
|
139
173
|
}
|
|
140
|
-
function
|
|
174
|
+
function ne(e, t) {
|
|
141
175
|
return e ? ` font-family="${t.resolveFontFamily(e)}"` : "";
|
|
142
176
|
}
|
|
143
177
|
//#endregion
|
|
144
178
|
//#region ../renderer/src/renderers/paragraph.ts
|
|
145
|
-
function
|
|
146
|
-
if (
|
|
147
|
-
let n =
|
|
179
|
+
function re(e, t) {
|
|
180
|
+
if (O(e) || e.content.replace(/<\/?p\b[^<>]*>/gi, "").trim() === "") return "";
|
|
181
|
+
let n = E(e.styles.padding), r = D(e.styles.backgroundColor, "container"), i = C(e.content);
|
|
148
182
|
return `<mj-text
|
|
149
183
|
line-height="1.5"
|
|
150
|
-
padding="${n}"${r}${
|
|
184
|
+
padding="${n}"${r}${k(e)}
|
|
151
185
|
>${i}</mj-text>`;
|
|
152
186
|
}
|
|
153
187
|
//#endregion
|
|
154
188
|
//#region ../renderer/src/renderers/image.ts
|
|
155
|
-
function
|
|
156
|
-
if (
|
|
157
|
-
let n =
|
|
189
|
+
function j(e, t) {
|
|
190
|
+
if (O(e) || e.src === "") return "";
|
|
191
|
+
let n = E(e.styles.padding), r = D(e.styles.backgroundColor, "container"), i = e.width === "full" ? t.containerWidth + "px" : e.width + "px", a = k(e), o = "";
|
|
158
192
|
e.linkUrl && (o = ` href="${x(e.linkUrl)}"`, e.linkOpenInNewTab && (o += " target=\"_blank\" rel=\"noopener\""));
|
|
159
193
|
let s = x(e.src), c = e.decorative === !0;
|
|
160
194
|
return `<mj-image
|
|
@@ -167,9 +201,9 @@ function re(e, t) {
|
|
|
167
201
|
}
|
|
168
202
|
//#endregion
|
|
169
203
|
//#region ../renderer/src/renderers/button.ts
|
|
170
|
-
function
|
|
171
|
-
if (
|
|
172
|
-
let n =
|
|
204
|
+
function M(e, t) {
|
|
205
|
+
if (O(e)) return "";
|
|
206
|
+
let n = E(e.styles.padding), r = D(e.styles.backgroundColor, "container"), i = E(e.buttonPadding), a = e.url === "" ? "" : x(e.url), o = a === "" ? "" : ` href="${a}"`, s = x(e.backgroundColor), c = x(e.textColor), l = e.fontSize, u = e.borderRadius, d = b(e.text);
|
|
173
207
|
return `<mj-button${o}${e.openInNewTab ? " target=\"_blank\" rel=\"noopener\"" : ""}
|
|
174
208
|
background-color="${s}"
|
|
175
209
|
color="${c}"
|
|
@@ -177,46 +211,46 @@ function A(e, t) {
|
|
|
177
211
|
font-weight="bold"
|
|
178
212
|
border-radius="${u}px"
|
|
179
213
|
inner-padding="${i}"
|
|
180
|
-
padding="${n}"${r}${
|
|
214
|
+
padding="${n}"${r}${N(e.fontFamily, t)}${k(e)}
|
|
181
215
|
>${d}</mj-button>`;
|
|
182
216
|
}
|
|
183
|
-
function
|
|
217
|
+
function N(e, t) {
|
|
184
218
|
return e ? ` font-family="${t.resolveFontFamily(e)}"` : "";
|
|
185
219
|
}
|
|
186
220
|
//#endregion
|
|
187
221
|
//#region ../renderer/src/renderers/divider.ts
|
|
188
|
-
function
|
|
189
|
-
if (
|
|
190
|
-
let n =
|
|
222
|
+
function P(e, t) {
|
|
223
|
+
if (O(e)) return "";
|
|
224
|
+
let n = E(e.styles.padding), r = e.styles.backgroundColor ? ` container-background-color="${x(e.styles.backgroundColor)}"` : "", i = e.width === "full" ? "100%" : e.width + "px";
|
|
191
225
|
return `<mj-divider
|
|
192
226
|
border-width="${e.thickness}px"
|
|
193
227
|
border-style="${e.lineStyle}"
|
|
194
228
|
border-color="${x(e.color)}"
|
|
195
229
|
width="${i}"
|
|
196
|
-
padding="${n}"${r}${
|
|
230
|
+
padding="${n}"${r}${k(e)}
|
|
197
231
|
/>`;
|
|
198
232
|
}
|
|
199
233
|
//#endregion
|
|
200
234
|
//#region ../renderer/src/renderers/spacer.ts
|
|
201
|
-
function
|
|
202
|
-
return
|
|
235
|
+
function F(e, t) {
|
|
236
|
+
return O(e) ? "" : `<mj-spacer height="${e.height}px" padding="0"${e.styles.backgroundColor ? ` container-background-color="${x(e.styles.backgroundColor)}"` : ""}${k(e)} />`;
|
|
203
237
|
}
|
|
204
238
|
//#endregion
|
|
205
239
|
//#region ../renderer/src/renderers/html.ts
|
|
206
|
-
function
|
|
207
|
-
if (
|
|
240
|
+
function I(e, t) {
|
|
241
|
+
if (O(e) || !t.allowHtmlBlocks) return "";
|
|
208
242
|
let n = e.content;
|
|
209
|
-
return n === "" ? "" : `<mj-text${
|
|
243
|
+
return n === "" ? "" : `<mj-text${k(e)}>
|
|
210
244
|
${n}
|
|
211
245
|
</mj-text>`;
|
|
212
246
|
}
|
|
213
247
|
//#endregion
|
|
214
248
|
//#region ../renderer/src/renderers/social.ts
|
|
215
|
-
function
|
|
216
|
-
if (
|
|
249
|
+
function L(e, t) {
|
|
250
|
+
if (O(e)) return "";
|
|
217
251
|
let n = e.icons;
|
|
218
252
|
if (n.length === 0) return "";
|
|
219
|
-
let r =
|
|
253
|
+
let r = E(e.styles.padding), i = e.styles.backgroundColor ? ` container-background-color="${x(e.styles.backgroundColor)}"` : "", a = k(e), o = e.align, s = e.iconSize, c = e.iconStyle, l = e.spacing, u;
|
|
220
254
|
switch (s) {
|
|
221
255
|
case "small":
|
|
222
256
|
u = 24;
|
|
@@ -258,78 +292,78 @@ ${n.map((e, n) => {
|
|
|
258
292
|
}
|
|
259
293
|
//#endregion
|
|
260
294
|
//#region ../renderer/src/renderers/menu.ts
|
|
261
|
-
function
|
|
262
|
-
if (
|
|
263
|
-
let n =
|
|
295
|
+
function R(e, t) {
|
|
296
|
+
if (O(e) || e.items.length === 0) return "";
|
|
297
|
+
let n = E(e.styles.padding), r = D(e.styles.backgroundColor, "container"), i = k(e), a = V(e.fontFamily, t), o = e.textAlign;
|
|
264
298
|
return `<mj-text
|
|
265
299
|
font-size="${e.fontSize}px"
|
|
266
300
|
color="${x(e.color)}"
|
|
267
301
|
align="${o}"
|
|
268
302
|
line-height="1.5"
|
|
269
303
|
padding="${n}"${r}${a}${i}
|
|
270
|
-
>${
|
|
304
|
+
>${z(e)}</mj-text>`;
|
|
271
305
|
}
|
|
272
|
-
function
|
|
306
|
+
function z(e) {
|
|
273
307
|
let t = e.items, n = b(e.separator), r = S(e.separatorColor), i = e.spacing, a = e.linkColor ?? e.color, o = [], s = t.length;
|
|
274
|
-
for (let e = 0; e < s; e++) o.push(
|
|
308
|
+
for (let e = 0; e < s; e++) o.push(B(t[e], a)), e < s - 1 && o.push(`<span style="color: ${r}; padding: 0 ${i}px;">${n}</span>`);
|
|
275
309
|
return o.join("");
|
|
276
310
|
}
|
|
277
|
-
function
|
|
311
|
+
function B(e, t) {
|
|
278
312
|
let n = b(e.text), r = x(e.url), i = S(e.color ?? t), a = e.openInNewTab ? " target=\"_blank\" rel=\"noopener\"" : "", o = [`color: ${i}`, "text-decoration: none"];
|
|
279
313
|
return e.bold && o.push("font-weight: bold"), e.underline && o.push("text-decoration: underline"), `<a href="${r}" style="${o.join("; ")}"${a}>${n}</a>`;
|
|
280
314
|
}
|
|
281
|
-
function
|
|
315
|
+
function V(e, t) {
|
|
282
316
|
return e ? ` font-family="${t.resolveFontFamily(e)}"` : "";
|
|
283
317
|
}
|
|
284
318
|
//#endregion
|
|
285
319
|
//#region ../renderer/src/renderers/table.ts
|
|
286
|
-
function
|
|
287
|
-
if (
|
|
288
|
-
let n =
|
|
320
|
+
function H(e, t) {
|
|
321
|
+
if (O(e) || e.rows.length === 0) return "";
|
|
322
|
+
let n = E(e.styles.padding), r = D(e.styles.backgroundColor, "container"), i = k(e), a = K(e.fontFamily, t);
|
|
289
323
|
return `<mj-text
|
|
290
324
|
font-size="${e.fontSize}px"
|
|
291
325
|
color="${x(e.color)}"
|
|
292
326
|
align="${e.textAlign}"
|
|
293
327
|
line-height="1.5"
|
|
294
328
|
padding="${n}"${r}${a}${i}
|
|
295
|
-
>${
|
|
329
|
+
>${U(e)}</mj-text>`;
|
|
296
330
|
}
|
|
297
|
-
function
|
|
331
|
+
function U(e) {
|
|
298
332
|
let t = S(e.borderColor), n = e.borderWidth, r = "";
|
|
299
333
|
for (let i = 0; i < e.rows.length; i++) {
|
|
300
334
|
let a = e.rows[i];
|
|
301
|
-
r +=
|
|
335
|
+
r += W(a, e, e.hasHeaderRow && i === 0, t, n);
|
|
302
336
|
}
|
|
303
337
|
return `<table style="width: 100%; border-collapse: collapse;">${r}</table>`;
|
|
304
338
|
}
|
|
305
|
-
function
|
|
339
|
+
function W(e, t, n, r, i) {
|
|
306
340
|
let a = "";
|
|
307
|
-
for (let o of e.cells) a +=
|
|
341
|
+
for (let o of e.cells) a += G(o, t, n, r, i);
|
|
308
342
|
return `<tr>${a}</tr>`;
|
|
309
343
|
}
|
|
310
|
-
function
|
|
344
|
+
function G(e, t, n, r, i) {
|
|
311
345
|
let a = t.cellPadding, o = [`border: ${i}px solid ${r}`, `padding: ${a}px`];
|
|
312
346
|
n && (o.push("font-weight: bold"), t.headerBackgroundColor && o.push(`background-color: ${S(t.headerBackgroundColor)}`));
|
|
313
347
|
let s = o.join("; "), c = C(e.content), l = n ? "th" : "td";
|
|
314
348
|
return `<${l} style="${s}">${c}</${l}>`;
|
|
315
349
|
}
|
|
316
|
-
function
|
|
350
|
+
function K(e, t) {
|
|
317
351
|
return e ? ` font-family="${t.resolveFontFamily(e)}"` : "";
|
|
318
352
|
}
|
|
319
353
|
//#endregion
|
|
320
354
|
//#region ../renderer/src/renderers/custom.ts
|
|
321
|
-
function
|
|
322
|
-
if (
|
|
355
|
+
function ie(e, t) {
|
|
356
|
+
if (O(e)) return "";
|
|
323
357
|
let n = t.customBlockHtml.get(e.id) ?? e.renderedHtml;
|
|
324
358
|
if (!n || n === "") return "";
|
|
325
|
-
let r =
|
|
326
|
-
return `<mj-text${
|
|
359
|
+
let r = k(e);
|
|
360
|
+
return `<mj-text${D(e.styles?.backgroundColor, "container")}${r}>
|
|
327
361
|
${n}
|
|
328
362
|
</mj-text>`;
|
|
329
363
|
}
|
|
330
364
|
//#endregion
|
|
331
365
|
//#region ../renderer/src/columns.ts
|
|
332
|
-
function
|
|
366
|
+
function q(e) {
|
|
333
367
|
switch (e) {
|
|
334
368
|
case "2": return ["50%", "50%"];
|
|
335
369
|
case "3": return [
|
|
@@ -342,7 +376,7 @@ function K(e) {
|
|
|
342
376
|
default: return ["100%"];
|
|
343
377
|
}
|
|
344
378
|
}
|
|
345
|
-
function
|
|
379
|
+
function J(e, t) {
|
|
346
380
|
switch (e) {
|
|
347
381
|
case "2": return [t * .5, t * .5];
|
|
348
382
|
case "3": return [
|
|
@@ -357,11 +391,11 @@ function q(e, t) {
|
|
|
357
391
|
}
|
|
358
392
|
//#endregion
|
|
359
393
|
//#region ../renderer/src/renderers/section.ts
|
|
360
|
-
function
|
|
361
|
-
if (
|
|
362
|
-
let i = e.columns, a =
|
|
394
|
+
function Y(e, n, r) {
|
|
395
|
+
if (O(e)) return "";
|
|
396
|
+
let i = e.columns, a = q(i), o = J(i, n.containerWidth), s = E(e.styles.padding), c = D(e.styles.backgroundColor, "native"), l = k(e), u = e.children, d = [];
|
|
363
397
|
for (let e = 0; e < u.length; e++) {
|
|
364
|
-
let i = u[e], s = a[e] ?? "100%", c = Math.floor(o[e] ?? n.containerWidth), l =
|
|
398
|
+
let i = u[e], s = a[e] ?? "100%", c = Math.floor(o[e] ?? n.containerWidth), l = ae(i, n.allowHtmlBlocks).filter((e) => !t(e)), f = n.withContainerWidth(c), p = l.map((e) => r(e, f)).filter((e) => e !== "").join("\n");
|
|
365
399
|
d.push(`<mj-column width="${s}">
|
|
366
400
|
${p === "" ? "<mj-text> </mj-text>" : p}
|
|
367
401
|
</mj-column>`);
|
|
@@ -370,12 +404,12 @@ ${p === "" ? "<mj-text> </mj-text>" : p}
|
|
|
370
404
|
${d.join("\n")}
|
|
371
405
|
</mj-section>`;
|
|
372
406
|
}
|
|
373
|
-
function
|
|
407
|
+
function ae(e, t) {
|
|
374
408
|
return t ? e : e.filter((e) => e.type !== "html");
|
|
375
409
|
}
|
|
376
410
|
//#endregion
|
|
377
411
|
//#region ../renderer/src/renderers/video.ts
|
|
378
|
-
function
|
|
412
|
+
function oe(e, t) {
|
|
379
413
|
if (t) return t;
|
|
380
414
|
if (!e) return null;
|
|
381
415
|
for (let t of [/(?:youtube\.com\/watch\?v=|youtu\.be\/|youtube\.com\/embed\/)([a-zA-Z0-9_-]{11})/, /youtube\.com\/shorts\/([a-zA-Z0-9_-]{11})/]) {
|
|
@@ -385,11 +419,11 @@ function X(e, t) {
|
|
|
385
419
|
let n = e.match(/vimeo\.com\/(?:video\/)?(\d+)/);
|
|
386
420
|
return n ? `https://vumbnail.com/${n[1]}.jpg` : null;
|
|
387
421
|
}
|
|
388
|
-
function
|
|
389
|
-
if (
|
|
390
|
-
let n =
|
|
422
|
+
function se(e, t) {
|
|
423
|
+
if (O(e)) return "";
|
|
424
|
+
let n = oe(e.url, e.thumbnailUrl);
|
|
391
425
|
if (!n) return "";
|
|
392
|
-
let r =
|
|
426
|
+
let r = E(e.styles.padding), i = D(e.styles.backgroundColor, "container"), a = e.width === "full" ? t.containerWidth + "px" : e.width + "px", o = k(e);
|
|
393
427
|
return `<mj-image
|
|
394
428
|
src="${x(n)}"
|
|
395
429
|
alt="${x(e.alt)}"
|
|
@@ -403,28 +437,28 @@ function ie(e, t) {
|
|
|
403
437
|
}
|
|
404
438
|
//#endregion
|
|
405
439
|
//#region ../renderer/src/renderers/index.ts
|
|
406
|
-
function
|
|
407
|
-
return t(e) ?
|
|
440
|
+
function X(e, o) {
|
|
441
|
+
return t(e) ? Y(e, o, X) : u(e) ? ee(e, o) : p(e) ? re(e, o) : r(e) ? j(e, o) : n(e) ? M(e, o) : d(e) ? P(e, o) : s(e) ? F(e, o) : i(e) ? I(e, o) : f(e) ? L(e, o) : l(e) ? R(e, o) : c(e) ? H(e, o) : a(e) ? se(e, o) : m(e) ? ie(e, o) : "";
|
|
408
442
|
}
|
|
409
443
|
//#endregion
|
|
410
444
|
//#region ../renderer/src/index.ts
|
|
411
|
-
var
|
|
445
|
+
var ce = /* @__PURE__ */ e({
|
|
412
446
|
DEFAULT_SOCIAL_ICONS_BASE_URL: () => h,
|
|
413
447
|
RenderContext: () => _,
|
|
414
448
|
convertMergeTagsToValues: () => C,
|
|
415
449
|
escapeAttr: () => x,
|
|
416
450
|
escapeHtml: () => b,
|
|
417
|
-
getCssClassAttr: () =>
|
|
418
|
-
getCssClasses: () =>
|
|
419
|
-
getWidthPercentages: () =>
|
|
420
|
-
getWidthPixels: () =>
|
|
421
|
-
isHiddenOnAll: () =>
|
|
422
|
-
renderBlock: () =>
|
|
423
|
-
renderToMjml: () =>
|
|
424
|
-
toPaddingString: () =>
|
|
451
|
+
getCssClassAttr: () => k,
|
|
452
|
+
getCssClasses: () => A,
|
|
453
|
+
getWidthPercentages: () => q,
|
|
454
|
+
getWidthPixels: () => J,
|
|
455
|
+
isHiddenOnAll: () => O,
|
|
456
|
+
renderBlock: () => X,
|
|
457
|
+
renderToMjml: () => Z,
|
|
458
|
+
toPaddingString: () => E
|
|
425
459
|
});
|
|
426
|
-
async function
|
|
427
|
-
let n = t?.customFonts ?? [], r = t?.defaultFallbackFont ?? "Arial, sans-serif", i = t?.allowHtmlBlocks ?? !0, a =
|
|
460
|
+
async function Z(e, t) {
|
|
461
|
+
let n = t?.customFonts ?? [], r = t?.defaultFallbackFont ?? "Arial, sans-serif", i = t?.allowHtmlBlocks ?? !0, a = de(t?.socialIconsBaseUrl ?? h), o = await he(e, t?.renderCustomBlock), s = new _(e.settings.width, n, r, i, o, a), c = me(e.blocks, i), l = s.resolveFontFamily(e.settings.fontFamily), u = e.settings.backgroundColor, d = c.map((e) => le(e, s)).filter((e) => e !== "").join("\n"), f = pe(n), p = fe(e.settings.preheaderText);
|
|
428
462
|
return `<mjml lang="${x(e.settings.locale)}">
|
|
429
463
|
<mj-head>${p}
|
|
430
464
|
<mj-attributes>
|
|
@@ -452,8 +486,8 @@ ${d}
|
|
|
452
486
|
</mj-body>
|
|
453
487
|
</mjml>`;
|
|
454
488
|
}
|
|
455
|
-
function
|
|
456
|
-
return t(e) ? Q(e,
|
|
489
|
+
function le(e, n) {
|
|
490
|
+
return t(e) ? Q(e, X(e, n)) : Q(e, ue(X(e, n)));
|
|
457
491
|
}
|
|
458
492
|
function Q(e, t) {
|
|
459
493
|
if (t === "") return "";
|
|
@@ -462,28 +496,28 @@ function Q(e, t) {
|
|
|
462
496
|
` + t + `
|
|
463
497
|
<mj-raw>${n.after}</mj-raw>` : t;
|
|
464
498
|
}
|
|
465
|
-
function
|
|
499
|
+
function ue(e) {
|
|
466
500
|
return e === "" ? "" : `<mj-section>
|
|
467
501
|
<mj-column>
|
|
468
502
|
${e}
|
|
469
503
|
</mj-column>
|
|
470
504
|
</mj-section>`;
|
|
471
505
|
}
|
|
472
|
-
function
|
|
506
|
+
function de(e) {
|
|
473
507
|
return e.endsWith("/") ? e.slice(0, -1) : e;
|
|
474
508
|
}
|
|
475
|
-
function
|
|
509
|
+
function fe(e) {
|
|
476
510
|
if (!e) return "";
|
|
477
511
|
let t = e.trim();
|
|
478
512
|
return t === "" ? "" : `\n <mj-preview>${b(t)}</mj-preview>`;
|
|
479
513
|
}
|
|
480
|
-
function
|
|
514
|
+
function pe(e) {
|
|
481
515
|
return e.length === 0 ? "" : e.map((e) => `\n <mj-font name="${x(e.name)}" href="${x(e.url)}" />`).join("");
|
|
482
516
|
}
|
|
483
|
-
function
|
|
517
|
+
function me(e, t) {
|
|
484
518
|
return t ? e : e.filter((e) => e.type !== "html");
|
|
485
519
|
}
|
|
486
|
-
async function
|
|
520
|
+
async function he(e, t) {
|
|
487
521
|
let n = /* @__PURE__ */ new Map();
|
|
488
522
|
if (!t) return n;
|
|
489
523
|
let r = [];
|
|
@@ -502,6 +536,6 @@ function $(e, n) {
|
|
|
502
536
|
}
|
|
503
537
|
}
|
|
504
538
|
//#endregion
|
|
505
|
-
export {
|
|
539
|
+
export { ce as t };
|
|
506
540
|
|
|
507
|
-
//# sourceMappingURL=renderer-
|
|
541
|
+
//# sourceMappingURL=renderer-CYYyu-Di.js.map
|