@templatical/editor 0.60.1 → 0.60.3
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/{AiRewriteMenu-BaeMlSEx.js → AiRewriteMenu-DOreXB10.js} +1 -1
- package/dist/{BlockPreviewCanvas-DWDfih6j.js → BlockPreviewCanvas-YaFum01Z.js} +3 -3
- package/dist/{CloudPanels-ClHDM3ge.js → CloudPanels-Bxv7vUYr.js} +1 -1
- package/dist/{CountdownToolbar-DYFSFwkD.js → CountdownToolbar-BQdhVNaK.js} +1 -1
- package/dist/{LanguageMenu-f7js1FF8.js → LanguageMenu-wS43Ck1x.js} +1 -1
- package/dist/{ParagraphEditor-ByzfpepN.js → ParagraphEditor-zMOqNnmx.js} +14 -14
- package/dist/{RestoreVersionDialog-Da5sTCFI.js → RestoreVersionDialog-DdPpilBS.js} +1 -1
- package/dist/{SaveBlockDialog-BM1Fki_2.js → SaveBlockDialog-CQzccFIM.js} +4 -4
- package/dist/{SavedBlocksBrowserModal-DHOTdJKB.js → SavedBlocksBrowserModal-8cZ9z-pL.js} +4 -4
- package/dist/{SavedBlocksPanels-BJ2OM0cG.js → SavedBlocksPanels-C9Oztudc.js} +1 -1
- package/dist/{SavedBlocksPickBar-C4Bv1K_9.js → SavedBlocksPickBar-udG0wuTf.js} +1 -1
- package/dist/{TestEmailModal-CMo0cJik.js → TestEmailModal-BP6954nj.js} +3 -3
- package/dist/{TestEmailPanel-B2OoOy9K.js → TestEmailPanel-5YlcWwPJ.js} +1 -1
- package/dist/{TitleEditor--gFbrR7V.js → TitleEditor-Cy-6WZuK.js} +5 -5
- package/dist/{Toolbar-UXT03-Dc.js → Toolbar-Br0W6NE0.js} +7 -3
- package/dist/{TplModal-DkoyIwy1.js → TplModal-DnytM7wO.js} +1 -1
- package/dist/{VersionHistoryPanels-TzzRlmqK.js → VersionHistoryPanels-DIqWP71K.js} +1 -1
- package/dist/{WrapperBlock-B4mdW2CP.js → WrapperBlock-DoNQX0Ml.js} +2 -2
- package/dist/{blockTypeIcons-MX-xQH_Z.js → blockTypeIcons-BePGuX0b.js} +1 -1
- package/dist/bundle-stats.json +6 -6
- package/dist/cdn/chunks/{AiRewriteMenu-C34wZVcW.js → AiRewriteMenu-BqwwNUzj.js} +2 -2
- package/dist/cdn/chunks/{AiRewriteMenu-C34wZVcW.js.map → AiRewriteMenu-BqwwNUzj.js.map} +1 -1
- package/dist/cdn/chunks/{BlockPreviewCanvas-CUOrwkWR.js → BlockPreviewCanvas-T13OIi1f.js} +4 -4
- package/dist/cdn/chunks/{BlockPreviewCanvas-CUOrwkWR.js.map → BlockPreviewCanvas-T13OIi1f.js.map} +1 -1
- package/dist/cdn/chunks/{CloudPanels-BAGDHObm.js → CloudPanels-DDNWZ7ET.js} +2 -2
- package/dist/cdn/chunks/{CloudPanels-BAGDHObm.js.map → CloudPanels-DDNWZ7ET.js.map} +1 -1
- package/dist/cdn/chunks/{CountdownToolbar-BBiK9EaU.js → CountdownToolbar-D16RWxkh.js} +2 -2
- package/dist/cdn/chunks/{CountdownToolbar-BBiK9EaU.js.map → CountdownToolbar-D16RWxkh.js.map} +1 -1
- package/dist/cdn/chunks/{LanguageMenu-BDldm-Hp.js → LanguageMenu-D71nO6LO.js} +2 -2
- package/dist/cdn/chunks/{LanguageMenu-BDldm-Hp.js.map → LanguageMenu-D71nO6LO.js.map} +1 -1
- package/dist/cdn/chunks/{ParagraphEditor-CPYQXRIc.js → ParagraphEditor-BClN3WxA.js} +15 -15
- package/dist/cdn/chunks/{ParagraphEditor-CPYQXRIc.js.map → ParagraphEditor-BClN3WxA.js.map} +1 -1
- package/dist/cdn/chunks/{RestoreVersionDialog-NjbHial9.js → RestoreVersionDialog-CVfKIT1K.js} +2 -2
- package/dist/cdn/chunks/{RestoreVersionDialog-NjbHial9.js.map → RestoreVersionDialog-CVfKIT1K.js.map} +1 -1
- package/dist/cdn/chunks/{SaveBlockDialog-BZqPkGrE.js → SaveBlockDialog-Cy6mI_xB.js} +5 -5
- package/dist/cdn/chunks/{SaveBlockDialog-BZqPkGrE.js.map → SaveBlockDialog-Cy6mI_xB.js.map} +1 -1
- package/dist/cdn/chunks/{SavedBlocksBrowserModal-CqfyRtlX.js → SavedBlocksBrowserModal-DW917QDB.js} +4 -4
- package/dist/cdn/chunks/{SavedBlocksBrowserModal-CqfyRtlX.js.map → SavedBlocksBrowserModal-DW917QDB.js.map} +1 -1
- package/dist/cdn/chunks/{SavedBlocksPanels-BILHEdkP.js → SavedBlocksPanels-Cyzerpxs.js} +2 -2
- package/dist/cdn/chunks/{SavedBlocksPanels-BILHEdkP.js.map → SavedBlocksPanels-Cyzerpxs.js.map} +1 -1
- package/dist/cdn/chunks/{SavedBlocksPickBar-C9NKqOEU.js → SavedBlocksPickBar-D6n86773.js} +2 -2
- package/dist/cdn/chunks/{SavedBlocksPickBar-C9NKqOEU.js.map → SavedBlocksPickBar-D6n86773.js.map} +1 -1
- package/dist/cdn/chunks/{TestEmailModal-CtfoV82K.js → TestEmailModal-V_UFUIaf.js} +4 -4
- package/dist/cdn/chunks/{TestEmailModal-CtfoV82K.js.map → TestEmailModal-V_UFUIaf.js.map} +1 -1
- package/dist/cdn/chunks/{TestEmailPanel-NK26SU2u.js → TestEmailPanel-CBfqsO2u.js} +2 -2
- package/dist/cdn/chunks/{TestEmailPanel-NK26SU2u.js.map → TestEmailPanel-CBfqsO2u.js.map} +1 -1
- package/dist/cdn/chunks/{TitleEditor-DXN_aOn0.js → TitleEditor-CimWOQVn.js} +6 -6
- package/dist/cdn/chunks/{TitleEditor-DXN_aOn0.js.map → TitleEditor-CimWOQVn.js.map} +1 -1
- package/dist/cdn/chunks/{Toolbar-HCxD4Ifc.js → Toolbar-czJfutfE.js} +7 -3
- package/dist/cdn/chunks/Toolbar-czJfutfE.js.map +1 -0
- package/dist/cdn/chunks/{TplModal-DzHoLmGo.js → TplModal-BtJJ5-En.js} +2 -2
- package/dist/cdn/chunks/{TplModal-DzHoLmGo.js.map → TplModal-BtJJ5-En.js.map} +1 -1
- package/dist/cdn/chunks/{VersionHistoryPanels-Du8sQry2.js → VersionHistoryPanels-BS0USHsp.js} +2 -2
- package/dist/cdn/chunks/{VersionHistoryPanels-Du8sQry2.js.map → VersionHistoryPanels-BS0USHsp.js.map} +1 -1
- package/dist/cdn/chunks/{WrapperBlock-DTayPD6Q.js → WrapperBlock-CSjYFYUT.js} +3 -3
- package/dist/cdn/chunks/{WrapperBlock-DTayPD6Q.js.map → WrapperBlock-CSjYFYUT.js.map} +1 -1
- package/dist/cdn/chunks/{composables-BJBr8B4t.js → composables-BHsV8gkq.js} +5 -4
- package/dist/cdn/chunks/composables-BHsV8gkq.js.map +1 -0
- package/dist/cdn/chunks/{extensions-BPZirXpF.js → extensions-BeGvJ6f0.js} +2 -2
- package/dist/cdn/chunks/{extensions-BPZirXpF.js.map → extensions-BeGvJ6f0.js.map} +1 -1
- package/dist/cdn/chunks/{socialIcons-WD1cjZDr.js → socialIcons-DMelHF3p.js} +29 -29
- package/dist/cdn/chunks/socialIcons-DMelHF3p.js.map +1 -0
- package/dist/cdn/chunks/{src-C9opbQj_.js → src-B32tyank.js} +100 -101
- package/dist/cdn/chunks/src-B32tyank.js.map +1 -0
- package/dist/cdn/chunks/{tiptap-D9amDW4u.js → tiptap-LIEsAVOF.js} +3047 -3044
- package/dist/cdn/chunks/tiptap-LIEsAVOF.js.map +1 -0
- package/dist/cdn/editor.js +10 -10
- package/dist/{composables-DjCuq6RV.js → composables-DG_CMpuY.js} +4 -3
- package/dist/{dist-fDsB6dCL.js → dist-BKFfCbrD.js} +1 -1
- package/dist/{dist-DG_AWt8v.js → dist-BMULQVZF.js} +1 -1
- package/dist/{dist-AyAOL8Bj.js → dist-BnPPgVlu.js} +1 -1
- package/dist/{dist-CBnAqr27.js → dist-Bsg1RBUb.js} +1 -1
- package/dist/{dist-C7YLw60i.js → dist-BvNveHdP.js} +1 -1
- package/dist/{dist-BNrGwgev.js → dist-CRcnmuxb.js} +1 -1
- package/dist/{dist-DYtuc3jc.js → dist-CiOtB5na.js} +1 -1
- package/dist/{dist-COvAA64n.js → dist-DCGVHlXC.js} +1 -1
- package/dist/{dist-BPVNNdTv.js → dist-DRbuXmjl.js} +1 -1
- package/dist/{dist-CuRjmtWu.js → dist-LrtNpIZD.js} +3 -3
- package/dist/{dist-DoWk1r7z.js → dist-xc8l1i2C.js} +1967 -1962
- package/dist/{dist-DkPTWQuO.js → dist-zAzcxDCA.js} +1 -1
- package/dist/{extensions-C7OLgMEj.js → extensions-Cao-H_tB.js} +2 -2
- package/dist/{socialIcons-CPBiLTjY.js → socialIcons-DXOO2y7u.js} +28 -28
- package/dist/templatical-editor.js +10 -10
- package/package.json +8 -8
- package/dist/cdn/chunks/Toolbar-HCxD4Ifc.js.map +0 -1
- package/dist/cdn/chunks/composables-BJBr8B4t.js.map +0 -1
- package/dist/cdn/chunks/socialIcons-WD1cjZDr.js.map +0 -1
- package/dist/cdn/chunks/src-C9opbQj_.js.map +0 -1
- package/dist/cdn/chunks/tiptap-D9amDW4u.js.map +0 -1
|
@@ -3,7 +3,7 @@ import { An as e, At as t, Ct as n, Dn as r, Dt as i, En as a, It as o, Jt as s,
|
|
|
3
3
|
var T = `https://cdn.jsdelivr.net/npm/@templatical/renderer@${{
|
|
4
4
|
name: "@templatical/renderer",
|
|
5
5
|
description: "Render Templatical email templates to MJML",
|
|
6
|
-
version: "0.60.
|
|
6
|
+
version: "0.60.3",
|
|
7
7
|
bugs: "https://github.com/templatical/sdk/issues",
|
|
8
8
|
dependencies: { "@templatical/types": "workspace:*" },
|
|
9
9
|
devDependencies: {
|
|
@@ -66,61 +66,60 @@ var T = `https://cdn.jsdelivr.net/npm/@templatical/renderer@${{
|
|
|
66
66
|
defaultFallback: this.defaultFallbackFont
|
|
67
67
|
});
|
|
68
68
|
}
|
|
69
|
-
},
|
|
69
|
+
}, _e = {
|
|
70
70
|
"&": "&",
|
|
71
71
|
"<": "<",
|
|
72
72
|
">": ">",
|
|
73
|
-
"\"": """
|
|
74
|
-
|
|
75
|
-
|
|
73
|
+
"\"": """
|
|
74
|
+
}, ve = /[&<>]/g;
|
|
75
|
+
function E(e) {
|
|
76
|
+
return e === "" ? "" : e.replace(ve, (e) => _e[e]);
|
|
77
|
+
}
|
|
78
|
+
var ye = /[&<>"]/g;
|
|
76
79
|
function D(e) {
|
|
77
|
-
return e === "" ? "" : e.replace(
|
|
80
|
+
return e === "" ? "" : e.replace(ye, (e) => _e[e]);
|
|
78
81
|
}
|
|
79
82
|
function O(e) {
|
|
80
|
-
return e === "" ? "" : e.replace(
|
|
83
|
+
return e === "" ? "" : D(e.replace(/[;{}\r\n]/g, ""));
|
|
81
84
|
}
|
|
82
85
|
function k(e) {
|
|
83
|
-
return
|
|
84
|
-
}
|
|
85
|
-
var ve = /[&<>"]/g;
|
|
86
|
-
function A(e) {
|
|
87
|
-
return e.replace(ve, (e) => E[e] ?? e);
|
|
86
|
+
return D(e);
|
|
88
87
|
}
|
|
89
88
|
// ../renderer/src/visibility.ts
|
|
90
|
-
function
|
|
89
|
+
function A(e) {
|
|
91
90
|
let t = e.visibility;
|
|
92
91
|
return t ? !t.desktop && !t.mobile : !1;
|
|
93
92
|
}
|
|
94
|
-
function
|
|
95
|
-
let n = [
|
|
96
|
-
return n === "" ? "" : ` css-class="${
|
|
93
|
+
function j(e, t = []) {
|
|
94
|
+
let n = [M(e), ...t].filter((e) => e !== "").join(" ");
|
|
95
|
+
return n === "" ? "" : ` css-class="${D(n)}"`;
|
|
97
96
|
}
|
|
98
|
-
function
|
|
97
|
+
function M(e) {
|
|
99
98
|
let t = e.visibility;
|
|
100
99
|
if (!t) return "";
|
|
101
100
|
let n = [];
|
|
102
101
|
return t.desktop || n.push("tpl-hide-desktop"), t.mobile || n.push("tpl-hide-mobile"), n.join(" ");
|
|
103
102
|
}
|
|
104
103
|
// ../renderer/src/unrenderable.ts
|
|
105
|
-
var
|
|
106
|
-
function
|
|
104
|
+
var N = "templatical:unrenderable-block";
|
|
105
|
+
function P(e) {
|
|
107
106
|
return e.replace(/[<>]/g, "").replace(/-{2,}/g, "-");
|
|
108
107
|
}
|
|
109
|
-
function
|
|
108
|
+
function F(e) {
|
|
110
109
|
return JSON.stringify(String(e)).slice(1, -1);
|
|
111
110
|
}
|
|
112
|
-
function
|
|
113
|
-
return console.warn(`[Templatical] No renderer for block type "${
|
|
111
|
+
function I(e) {
|
|
112
|
+
return console.warn(`[Templatical] No renderer for block type "${F(e.type)}" (id: ${F(e.id)}). A placeholder comment was emitted in its place. Pass a \`blockRenderers\` entry for this type to render it.`), `<mj-raw><!-- ${N} type="${P(e.type)}" id="${P(e.id)}" --></mj-raw>`;
|
|
114
113
|
}
|
|
115
114
|
// ../renderer/src/padding.ts
|
|
116
|
-
function
|
|
117
|
-
return
|
|
115
|
+
function L(e) {
|
|
116
|
+
return D(`${e.top}px ${e.right}px ${e.bottom}px ${e.left}px`);
|
|
118
117
|
}
|
|
119
118
|
// ../renderer/src/utils.ts
|
|
120
|
-
function
|
|
121
|
-
return e ? ` ${t === "native" ? "background-color" : "container-background-color"}="${
|
|
119
|
+
function R(e, t) {
|
|
120
|
+
return e ? ` ${t === "native" ? "background-color" : "container-background-color"}="${O(e)}"` : "";
|
|
122
121
|
}
|
|
123
|
-
function
|
|
122
|
+
function z(e) {
|
|
124
123
|
return typeof e != "number" || !Number.isFinite(e) || e <= 0 ? "" : ` height="${e}px"`;
|
|
125
124
|
}
|
|
126
125
|
function B(t, n) {
|
|
@@ -134,15 +133,15 @@ function V(e, t) {
|
|
|
134
133
|
return e.width === "full" || e.width >= n ? " fluid-on-mobile=\"true\"" : "";
|
|
135
134
|
}
|
|
136
135
|
function H(e) {
|
|
137
|
-
return Object.entries(re(e)).map(([e, t]) => ` ${e}="${
|
|
136
|
+
return Object.entries(re(e)).map(([e, t]) => ` ${e}="${O(t)}"`).join("");
|
|
138
137
|
}
|
|
139
138
|
function U(e) {
|
|
140
139
|
let t = u(e);
|
|
141
|
-
return t === null ? "" : ` border-radius="${
|
|
140
|
+
return t === null ? "" : ` border-radius="${O(t)}"`;
|
|
142
141
|
}
|
|
143
142
|
function be(e) {
|
|
144
143
|
let t = c(e);
|
|
145
|
-
return t === null ? "" : ` background-url="${
|
|
144
|
+
return t === null ? "" : ` background-url="${D(t.url)}" background-size="${O(t.size)}" background-position="${O(t.position)}" background-repeat="${O(t.repeat)}"`;
|
|
146
145
|
}
|
|
147
146
|
// ../renderer/src/rich-text.ts
|
|
148
147
|
var W = "tpl-rich-text";
|
|
@@ -231,8 +230,8 @@ function Oe(e) {
|
|
|
231
230
|
}
|
|
232
231
|
// ../renderer/src/renderers/title.ts
|
|
233
232
|
function ke(e, t) {
|
|
234
|
-
if (
|
|
235
|
-
let n =
|
|
233
|
+
if (A(e)) return "";
|
|
234
|
+
let n = L(e.styles.padding), r = R(e.styles.backgroundColor, "container"), i = Ae(Oe(b(w(e.content)))), o = a[e.level] ?? a[2], s = e.color ? `\n color="${D(e.color)}"` : "", c = D(e.textAlign), l = je(e.fontFamily, t), u = j(e, [W, G(K(void 0))]), d = `h${a[e.level] ? e.level : 2}`;
|
|
236
235
|
return `<mj-text
|
|
237
236
|
font-size="${o}px"${s}
|
|
238
237
|
align="${c}"
|
|
@@ -251,12 +250,12 @@ function Ae(e) {
|
|
|
251
250
|
return /<\/p>\s*<p\b/i.test(i) ? e : i;
|
|
252
251
|
}
|
|
253
252
|
function je(e, t) {
|
|
254
|
-
return e ? ` font-family="${
|
|
253
|
+
return e ? ` font-family="${k(t.resolveFontFamily(e))}"` : "";
|
|
255
254
|
}
|
|
256
255
|
// ../renderer/src/renderers/paragraph.ts
|
|
257
256
|
function Me(e, t) {
|
|
258
|
-
if (
|
|
259
|
-
let n =
|
|
257
|
+
if (A(e) || ce(e.content)) return "";
|
|
258
|
+
let n = L(e.styles.padding), r = R(e.styles.backgroundColor, "container"), i = Oe(b(w(e.content))), a = j(e, [W, G(K(e.paragraphSpacing))]);
|
|
260
259
|
return `<mj-text
|
|
261
260
|
line-height="1.5"${t.contentDirection === "rtl" ? "\n align=\"right\"" : ""}
|
|
262
261
|
padding="${n}"${r}${a}
|
|
@@ -264,27 +263,27 @@ function Me(e, t) {
|
|
|
264
263
|
}
|
|
265
264
|
// ../renderer/src/renderers/image.ts
|
|
266
265
|
function Ne(e, t) {
|
|
267
|
-
if (
|
|
268
|
-
let n =
|
|
269
|
-
e.linkUrl && (u = ` href="${
|
|
270
|
-
let d =
|
|
266
|
+
if (A(e) || e.src === "") return "";
|
|
267
|
+
let n = L(e.styles.padding), r = R(e.styles.backgroundColor, "container"), i = D(e.width === "full" ? t.containerWidth + "px" : e.width + "px"), a = z(e.height), o = V(e, t), s = j(e), c = U(e.borderRadius), l = H(e.border), u = "";
|
|
268
|
+
e.linkUrl && (u = ` href="${D(e.linkUrl)}"`, e.linkOpenInNewTab && (u += " target=\"_blank\" rel=\"noopener\""));
|
|
269
|
+
let d = D(e.src), f = e.decorative === !0;
|
|
271
270
|
return `<mj-image
|
|
272
271
|
src="${d}"
|
|
273
|
-
alt="${f ? "" :
|
|
272
|
+
alt="${f ? "" : D(e.alt)}"
|
|
274
273
|
width="${i}"${a}${o}
|
|
275
|
-
align="${
|
|
274
|
+
align="${D(e.align)}"
|
|
276
275
|
padding="${n}"${r}${l}${c}${u}${s}${f ? " role=\"presentation\"" : ""}
|
|
277
276
|
/>`;
|
|
278
277
|
}
|
|
279
278
|
// ../renderer/src/renderers/button.ts
|
|
280
279
|
var J = "tpl-button-full";
|
|
281
280
|
function Pe(e, t) {
|
|
282
|
-
if (
|
|
283
|
-
let n =
|
|
281
|
+
if (A(e)) return "";
|
|
282
|
+
let n = L(e.styles.padding), r = R(e.styles.backgroundColor, "container"), i = L(e.buttonPadding), a = e.url === "" ? "" : D(e.url), o = a === "" ? "" : ` href="${a}"`, s = Fe(e.backgroundColor), c = D(e.textColor), l = e.fontSize, u = Ie(e.fontWeight), d = D(Re(e.borderRadius)), f = E(e.text), p = e.openInNewTab ? " target=\"_blank\" rel=\"noopener\"" : "", h = Le(e.fontFamily, t), g = ze(e.width), _ = j(e, e.width === "full" || typeof e.width == "string" && pe(e.width) !== null ? [J] : []), v = H(e.border), y = D(e.align ?? "center");
|
|
284
283
|
return `<mj-button${o}${p}
|
|
285
284
|
background-color="${s}"
|
|
286
285
|
color="${c}"
|
|
287
|
-
font-size="${
|
|
286
|
+
font-size="${D(String(l))}px"
|
|
288
287
|
line-height="${m(ae(e) * 100)}%"
|
|
289
288
|
font-weight="${u}"
|
|
290
289
|
border-radius="${d}"${v}
|
|
@@ -294,45 +293,45 @@ function Pe(e, t) {
|
|
|
294
293
|
>${f}</mj-button>`;
|
|
295
294
|
}
|
|
296
295
|
function Fe(e) {
|
|
297
|
-
return e.trim() === "" ? "transparent" :
|
|
296
|
+
return e.trim() === "" ? "transparent" : D(e);
|
|
298
297
|
}
|
|
299
298
|
function Ie(e) {
|
|
300
299
|
return e === "regular" ? "400" : e === "medium" ? "500" : e === "bold" ? "700" : "bold";
|
|
301
300
|
}
|
|
302
301
|
function Le(e, t) {
|
|
303
|
-
return e ? ` font-family="${
|
|
302
|
+
return e ? ` font-family="${k(t.resolveFontFamily(e))}"` : "";
|
|
304
303
|
}
|
|
305
304
|
function Re(e) {
|
|
306
305
|
return typeof e == "number" ? `${e}px` : u(e) ?? "0px";
|
|
307
306
|
}
|
|
308
307
|
function ze(e) {
|
|
309
|
-
return e === void 0 ? "" : e === "full" || typeof e == "number" ? ` width="${
|
|
308
|
+
return e === void 0 ? "" : e === "full" || typeof e == "number" ? ` width="${D(e === "full" ? "100%" : `${e}px`)}"` : pe(e) === null ? "" : ` width="${D(e)}"`;
|
|
310
309
|
}
|
|
311
310
|
// ../renderer/src/renderers/divider.ts
|
|
312
311
|
function Be(e, t) {
|
|
313
|
-
if (
|
|
314
|
-
let n =
|
|
312
|
+
if (A(e)) return "";
|
|
313
|
+
let n = L(e.styles.padding), r = e.styles.backgroundColor ? ` container-background-color="${D(e.styles.backgroundColor)}"` : "", i = e.width === "full" ? "100%" : typeof e.width == "number" ? `${e.width}px` : e.width, a = e.thickness, o = D(e.lineStyle), s = D(e.color), c = j(e);
|
|
315
314
|
return `<mj-divider
|
|
316
|
-
border-width="${
|
|
315
|
+
border-width="${D(String(a))}px"
|
|
317
316
|
border-style="${o}"
|
|
318
317
|
border-color="${s}"
|
|
319
|
-
width="${
|
|
318
|
+
width="${D(i)}"
|
|
320
319
|
padding="${n}"${r}${c}
|
|
321
320
|
/>`;
|
|
322
321
|
}
|
|
323
322
|
// ../renderer/src/renderers/spacer.ts
|
|
324
323
|
function Ve(e, t) {
|
|
325
|
-
if (
|
|
326
|
-
let n = e.height, r = e.styles.backgroundColor ? ` container-background-color="${
|
|
327
|
-
return `<mj-spacer height="${
|
|
324
|
+
if (A(e)) return "";
|
|
325
|
+
let n = e.height, r = e.styles.backgroundColor ? ` container-background-color="${D(e.styles.backgroundColor)}"` : "", i = j(e);
|
|
326
|
+
return `<mj-spacer height="${D(String(n))}px" padding="0"${r}${i} />`;
|
|
328
327
|
}
|
|
329
328
|
// ../renderer/src/renderers/html.ts
|
|
330
329
|
function He(e, t) {
|
|
331
|
-
if (
|
|
330
|
+
if (A(e) || !t.allowHtmlBlocks) return "";
|
|
332
331
|
let n = e.content;
|
|
333
332
|
if (n === "") return "";
|
|
334
|
-
let r =
|
|
335
|
-
return `<mj-text padding="${
|
|
333
|
+
let r = j(e);
|
|
334
|
+
return `<mj-text padding="${L(e.styles.padding)}"${R(e.styles.backgroundColor, "container")}${r}>
|
|
336
335
|
${n}
|
|
337
336
|
</mj-text>`;
|
|
338
337
|
}
|
|
@@ -347,10 +346,10 @@ function Ge(e) {
|
|
|
347
346
|
return typeof t == "string" ? t : "";
|
|
348
347
|
}
|
|
349
348
|
function Ke(e, t) {
|
|
350
|
-
if (
|
|
349
|
+
if (A(e)) return "";
|
|
351
350
|
let n = e.icons.filter((e) => e.platform !== "custom" || We(e));
|
|
352
351
|
if (n.length === 0) return "";
|
|
353
|
-
let r =
|
|
352
|
+
let r = L(e.styles.padding), i = e.styles.backgroundColor ? ` container-background-color="${D(e.styles.backgroundColor)}"` : "", a = j(e), s = D(e.align), c = e.iconSize, l = e.iconStyle, u = D(o(l, e.iconTone)), d = e.spacing, f;
|
|
354
353
|
switch (c) {
|
|
355
354
|
case "small":
|
|
356
355
|
f = 24;
|
|
@@ -381,49 +380,49 @@ function Ke(e, t) {
|
|
|
381
380
|
padding="${r}"${i}${a}
|
|
382
381
|
>
|
|
383
382
|
${n.map((e, n) => {
|
|
384
|
-
let r =
|
|
385
|
-
if (e.platform === "custom") return `<mj-social-element src="${
|
|
386
|
-
let o =
|
|
383
|
+
let r = D(e.url), i = n === m - 1 ? 0 : d, a = `0 ${D(String(i))}px 0 0`;
|
|
384
|
+
if (e.platform === "custom") return `<mj-social-element src="${D(e.imageUrl)}" alt="${D(Ge(e))}" href="${r}" icon-size="${f}px" padding="${a}" border-radius="0" background-color="transparent" css-class="${Ue}"></mj-social-element>`;
|
|
385
|
+
let o = D(e.platform);
|
|
387
386
|
return `<mj-social-element src="${`${t.socialIconsBaseUrl}/${u}/${o}.png`}" href="${r}" icon-size="${f}px" padding="${a}" border-radius="${p}" background-color="transparent"></mj-social-element>`;
|
|
388
387
|
}).join("\n")}
|
|
389
388
|
</mj-social>`;
|
|
390
389
|
}
|
|
391
390
|
// ../renderer/src/renderers/menu.ts
|
|
392
391
|
function qe(e, t) {
|
|
393
|
-
if (
|
|
394
|
-
let n =
|
|
392
|
+
if (A(e) || e.items.length === 0) return "";
|
|
393
|
+
let n = L(e.styles.padding), r = R(e.styles.backgroundColor, "container"), i = j(e), a = Xe(e.fontFamily, t), o = D(e.textAlign), s = e.fontSize, c = e.color ? `\n color="${D(e.color)}"` : "", l = Je(e);
|
|
395
394
|
return `<mj-text
|
|
396
|
-
font-size="${
|
|
395
|
+
font-size="${D(String(s))}px"${c}
|
|
397
396
|
align="${o}"
|
|
398
397
|
line-height="1.5"
|
|
399
398
|
padding="${n}"${r}${a}${i}
|
|
400
399
|
>${l}</mj-text>`;
|
|
401
400
|
}
|
|
402
401
|
function Je(e) {
|
|
403
|
-
let t = e.items, n =
|
|
404
|
-
for (let e = 0; e < s; e++) o.push(Ye(t[e], a)), e < s - 1 && o.push(`<span style="color: ${r}; padding: 0 ${
|
|
402
|
+
let t = e.items, n = E(e.separator), r = O(e.separatorColor), i = e.spacing, a = e.linkColor ?? e.color, o = [], s = t.length;
|
|
403
|
+
for (let e = 0; e < s; e++) o.push(Ye(t[e], a)), e < s - 1 && o.push(`<span style="color: ${r}; padding: 0 ${O(String(i))}px;">${n}</span>`);
|
|
405
404
|
return o.join("");
|
|
406
405
|
}
|
|
407
406
|
function Ye(e, t) {
|
|
408
|
-
let n =
|
|
409
|
-
return i && o.unshift(`color: ${
|
|
407
|
+
let n = E(e.text), r = D(e.url), i = e.color ?? t, a = e.openInNewTab ? " target=\"_blank\" rel=\"noopener\"" : "", o = ["text-decoration: none"];
|
|
408
|
+
return i && o.unshift(`color: ${O(i)}`), e.bold && o.push("font-weight: bold"), e.underline && o.push("text-decoration: underline"), `<a href="${r}" style="${o.join("; ")}"${a}>${n}</a>`;
|
|
410
409
|
}
|
|
411
410
|
function Xe(e, t) {
|
|
412
|
-
return e ? ` font-family="${
|
|
411
|
+
return e ? ` font-family="${k(t.resolveFontFamily(e))}"` : "";
|
|
413
412
|
}
|
|
414
413
|
// ../renderer/src/renderers/table.ts
|
|
415
414
|
function Ze(e, t) {
|
|
416
|
-
if (
|
|
417
|
-
let n =
|
|
415
|
+
if (A(e) || e.rows.length === 0) return "";
|
|
416
|
+
let n = L(e.styles.padding), r = R(e.styles.backgroundColor, "container"), i = j(e), a = tt(e.fontFamily, t), o = e.fontSize, s = e.color ? `\n color="${D(e.color)}"` : "", c = D(e.textAlign), l = Qe(e);
|
|
418
417
|
return `<mj-text
|
|
419
|
-
font-size="${
|
|
418
|
+
font-size="${D(String(o))}px"${s}
|
|
420
419
|
align="${c}"
|
|
421
420
|
line-height="1.5"
|
|
422
421
|
padding="${n}"${r}${a}${i}
|
|
423
422
|
>${l}</mj-text>`;
|
|
424
423
|
}
|
|
425
424
|
function Qe(e) {
|
|
426
|
-
let t =
|
|
425
|
+
let t = O(e.borderColor), n = e.borderWidth, r = "";
|
|
427
426
|
for (let i = 0; i < e.rows.length; i++) {
|
|
428
427
|
let a = e.rows[i];
|
|
429
428
|
r += $e(a, e, e.hasHeaderRow && i === 0, t, n);
|
|
@@ -436,21 +435,21 @@ function $e(e, t, n, r, i) {
|
|
|
436
435
|
return `<tr>${a}</tr>`;
|
|
437
436
|
}
|
|
438
437
|
function et(e, t, n, r, i) {
|
|
439
|
-
let a = t.cellPadding, o = [`border: ${
|
|
440
|
-
n && (o.push("font-weight: bold"), t.headerBackgroundColor && o.push(`background-color: ${
|
|
441
|
-
let s = o.join("; "), c =
|
|
438
|
+
let a = t.cellPadding, o = [`border: ${O(String(i))}px solid ${r}`, `padding: ${O(String(a))}px`];
|
|
439
|
+
n && (o.push("font-weight: bold"), t.headerBackgroundColor && o.push(`background-color: ${O(t.headerBackgroundColor)}`));
|
|
440
|
+
let s = o.join("; "), c = E(w(e.content)), l = n ? "th" : "td";
|
|
442
441
|
return `<${l} style="${s}">${c}</${l}>`;
|
|
443
442
|
}
|
|
444
443
|
function tt(e, t) {
|
|
445
|
-
return e ? ` font-family="${
|
|
444
|
+
return e ? ` font-family="${k(t.resolveFontFamily(e))}"` : "";
|
|
446
445
|
}
|
|
447
446
|
// ../renderer/src/renderers/custom.ts
|
|
448
447
|
function nt(e, t) {
|
|
449
|
-
if (
|
|
448
|
+
if (A(e)) return "";
|
|
450
449
|
let n = t.customBlockHtml.get(e.id) ?? e.renderedHtml;
|
|
451
450
|
if (!n || n === "") return "";
|
|
452
|
-
let r =
|
|
453
|
-
return `<mj-text padding="${
|
|
451
|
+
let r = j(e);
|
|
452
|
+
return `<mj-text padding="${L(e.styles.padding)}"${R(e.styles.backgroundColor, "container")}${r}>
|
|
454
453
|
${n}
|
|
455
454
|
</mj-text>`;
|
|
456
455
|
}
|
|
@@ -493,10 +492,10 @@ function Y(e, t) {
|
|
|
493
492
|
}
|
|
494
493
|
// ../renderer/src/renderers/section.ts
|
|
495
494
|
function st(e, t, n) {
|
|
496
|
-
if (
|
|
495
|
+
if (A(e)) return "";
|
|
497
496
|
let r = _(e);
|
|
498
497
|
if (r?.applied) return ct(e, r, t, n);
|
|
499
|
-
let i = e.columns, a = v(e), o = a.map((e) => `${e}%`), c = e.columnWidths !== void 0 && s(e) === null ? a.map((e) => t.containerWidth * e / 100) : at(i, t.containerWidth), l = Math.floor(t.contentWidth) - B(e.styles.padding, e.border), u = o.map((e) => Math.floor(l * parseFloat(e) / 100)), d =
|
|
498
|
+
let i = e.columns, a = v(e), o = a.map((e) => `${e}%`), c = e.columnWidths !== void 0 && s(e) === null ? a.map((e) => t.containerWidth * e / 100) : at(i, t.containerWidth), l = Math.floor(t.contentWidth) - B(e.styles.padding, e.border), u = o.map((e) => Math.floor(l * parseFloat(e) / 100)), d = L(e.styles.padding), f = R(e.styles.backgroundColor, "native"), p = be(e.backgroundImage), m = j(e), h = U(e.borderRadius), y = H(e.border), b = t.contentDirection === "rtl" ? " direction=\"rtl\"" : "", x = e.children, S = [];
|
|
500
499
|
for (let e = 0; e < x.length; e++) {
|
|
501
500
|
let r = x[e], i = o[e] ?? "100%", a = Math.floor(c[e] ?? t.containerWidth), s = lt(r, t.allowHtmlBlocks).filter((e) => !g(e)), d = t.withContainerWidth(a, u[e] ?? l), f = s.map((e) => Y(e, n(e, d))).filter((e) => e !== "").join("\n");
|
|
502
501
|
S.push(`<mj-column width="${i}"${b}>
|
|
@@ -511,8 +510,8 @@ ${C}
|
|
|
511
510
|
</mj-section>`;
|
|
512
511
|
}
|
|
513
512
|
function ct(e, t, n, r) {
|
|
514
|
-
let i = Math.floor(n.contentWidth), a = ot(t, i, e.styles.padding), o =
|
|
515
|
-
return `<mj-hero mode="${a.mode}" height="${a.height}px" background-url="${
|
|
513
|
+
let i = Math.floor(n.contentWidth), a = ot(t, i, e.styles.padding), o = R(e.styles.backgroundColor, "native") || " background-color=\"transparent\"", s = L(e.styles.padding), c = U(e.borderRadius), l = j(e), u = n.withContainerWidth(i, i - B(e.styles.padding)), d = lt(e.children[0] ?? [], n.allowHtmlBlocks).filter((e) => !g(e)).map((e) => Y(e, r(e, u))).filter((e) => e !== "").join("\n");
|
|
514
|
+
return `<mj-hero mode="${a.mode}" height="${a.height}px" background-url="${D(t.image.url)}" background-width="${a.backgroundWidth}px" background-height="${a.backgroundHeight}px" background-position="${D(t.image.position)}"${o} padding="${s}" vertical-align="${D(t.verticalAlign)}"${c}${l}>
|
|
516
515
|
${d}
|
|
517
516
|
</mj-hero>`;
|
|
518
517
|
}
|
|
@@ -531,17 +530,17 @@ function ut(e, t) {
|
|
|
531
530
|
return n ? `https://vumbnail.com/${n[1]}.jpg` : null;
|
|
532
531
|
}
|
|
533
532
|
function dt(e, t) {
|
|
534
|
-
if (
|
|
533
|
+
if (A(e)) return "";
|
|
535
534
|
let n = ut(e.url, e.thumbnailUrl);
|
|
536
535
|
if (!n) return "";
|
|
537
|
-
let r =
|
|
536
|
+
let r = L(e.styles.padding), i = R(e.styles.backgroundColor, "container"), a = D(e.width === "full" ? t.containerWidth + "px" : e.width + "px"), o = z(e.height), s = V(e, t), c = j(e);
|
|
538
537
|
return `<mj-image
|
|
539
|
-
src="${
|
|
540
|
-
alt="${
|
|
538
|
+
src="${D(n)}"
|
|
539
|
+
alt="${D(e.alt)}"
|
|
541
540
|
width="${a}"${o}${s}
|
|
542
|
-
align="${
|
|
541
|
+
align="${D(e.align)}"
|
|
543
542
|
padding="${r}"
|
|
544
|
-
href="${
|
|
543
|
+
href="${D(e.url)}"
|
|
545
544
|
target="_blank"
|
|
546
545
|
rel="noopener"${i}${c}
|
|
547
546
|
/>`;
|
|
@@ -549,18 +548,18 @@ function dt(e, t) {
|
|
|
549
548
|
// ../renderer/src/renderers/index.ts
|
|
550
549
|
function X(e, r) {
|
|
551
550
|
let a = r.blockRenderers[e.type];
|
|
552
|
-
return a ? a(e, r) : g(e) ? st(e, r, X) : t(e) ? ke(e, r) : fe(e) ? Me(e, r) : h(e) ? Ne(e, r) : y(e) ? Pe(e, r) : x(e) ? Be(e, r) : p(e) ? Ve(e, r) : me(e) ? He(e, r) : i(e) ? Ke(e, r) : n(e) ? qe(e, r) : oe(e) ? Ze(e, r) : ie(e) ? dt(e, r) : he(e) ? nt(e, r) :
|
|
551
|
+
return a ? a(e, r) : g(e) ? st(e, r, X) : t(e) ? ke(e, r) : fe(e) ? Me(e, r) : h(e) ? Ne(e, r) : y(e) ? Pe(e, r) : x(e) ? Be(e, r) : p(e) ? Ve(e, r) : me(e) ? He(e, r) : i(e) ? Ke(e, r) : n(e) ? qe(e, r) : oe(e) ? Ze(e, r) : ie(e) ? dt(e, r) : he(e) ? nt(e, r) : A(e) ? "" : I(e);
|
|
553
552
|
}
|
|
554
553
|
// ../renderer/src/index.ts
|
|
555
554
|
var ft = `.${J} a { display: block !important; }`;
|
|
556
555
|
async function pt(e, t) {
|
|
557
556
|
if (t?.customBlocks !== void 0 && t.renderCustomBlock !== void 0) throw TypeError("[Templatical] customBlocks cannot be combined with renderCustomBlock");
|
|
558
557
|
if (t?.customBlocks !== void 0 && t.getCustomBlockStylesheet !== void 0) throw TypeError("[Templatical] customBlocks cannot be combined with getCustomBlockStylesheet");
|
|
559
|
-
let n = t?.locale ?? ne(e), r = ee(e, n), i = t?.layout ? le(ee(t.layout, n, { missing: "default" }), r) : (se(r), C(r), r), a = t?.customFonts ?? [], o = t?.defaultFallbackFont ?? "Arial, sans-serif", s = t?.allowHtmlBlocks ?? !0, c = _t(t?.socialIconsBaseUrl ?? T), l = t?.customBlocks === void 0 ? await bt(i, t?.renderCustomBlock) : await xt(i, t.customBlocks, t.liquidjs), u = St(i, t?.getCustomBlockStylesheet, t?.customBlocks === void 0 ? void 0 : new Map(t.customBlocks.map((e) => [e.type, e]))), d = S(i.settings), f = new ge(i.settings.width, a, o, s, l, c, t?.blockRenderers ?? {}, d), p = Q(i.blocks, s), m = f.resolveFontFamily(i.settings.fontFamily), h = /[<>]/.test(i.settings.backgroundColor) ? "transparent" : i.settings.backgroundColor, g = i.settings.textColor ? ` color="${
|
|
560
|
-
return `<mjml lang="${
|
|
558
|
+
let n = t?.locale ?? ne(e), r = ee(e, n), i = t?.layout ? le(ee(t.layout, n, { missing: "default" }), r) : (se(r), C(r), r), a = t?.customFonts ?? [], o = t?.defaultFallbackFont ?? "Arial, sans-serif", s = t?.allowHtmlBlocks ?? !0, c = _t(t?.socialIconsBaseUrl ?? T), l = t?.customBlocks === void 0 ? await bt(i, t?.renderCustomBlock) : await xt(i, t.customBlocks, t.liquidjs), u = St(i, t?.getCustomBlockStylesheet, t?.customBlocks === void 0 ? void 0 : new Map(t.customBlocks.map((e) => [e.type, e]))), d = S(i.settings), f = new ge(i.settings.width, a, o, s, l, c, t?.blockRenderers ?? {}, d), p = Q(i.blocks, s), m = f.resolveFontFamily(i.settings.fontFamily), h = /[<>]/.test(i.settings.backgroundColor) ? "transparent" : i.settings.backgroundColor, g = i.settings.textColor ? ` color="${D(i.settings.textColor)}"` : "", _ = i.settings.linkColor && !/['"]/.test(i.settings.linkColor) ? O(i.settings.linkColor) : "inherit", v = i.settings.linkUnderline ? "underline" : "none", y = p.map((e) => mt(e, f)).filter((e) => e !== "").join("\n"), b = yt(a), x = vt(i.settings.preheaderText);
|
|
559
|
+
return `<mjml lang="${D(i.settings.locale)}" dir="${D(d)}">
|
|
561
560
|
<mj-head>${x}
|
|
562
561
|
<mj-attributes>
|
|
563
|
-
<mj-all font-family="${
|
|
562
|
+
<mj-all font-family="${k(m)}" />
|
|
564
563
|
<mj-text font-size="14px"${g} />
|
|
565
564
|
<mj-section padding="0" />
|
|
566
565
|
<mj-column padding="0" />
|
|
@@ -579,7 +578,7 @@ async function pt(e, t) {
|
|
|
579
578
|
}
|
|
580
579
|
</mj-style>${Ct(u)}
|
|
581
580
|
</mj-head>
|
|
582
|
-
<mj-body width="${
|
|
581
|
+
<mj-body width="${D(String(f.containerWidth))}px" background-color="${O(h)}">
|
|
583
582
|
${y}
|
|
584
583
|
</mj-body>
|
|
585
584
|
</mjml>`;
|
|
@@ -605,7 +604,7 @@ function Z(e, t) {
|
|
|
605
604
|
return e.withContainerWidth(e.containerWidth, Math.floor(e.contentWidth) - B(t));
|
|
606
605
|
}
|
|
607
606
|
function ht(e, t, n) {
|
|
608
|
-
return `<mj-wrapper${
|
|
607
|
+
return `<mj-wrapper${R(t.backgroundColor, "native")}${be(t.backgroundImage)}${` padding="${t.padding ? L(t.padding) : "0"}"`}${t.fullWidth ? "" : U(t.borderRadius)}${t.fullWidth ? " full-width=\"full-width\"" : ""}${n === "rtl" ? " direction=\"rtl\"" : ""}>
|
|
609
608
|
${e}
|
|
610
609
|
</mj-wrapper>`;
|
|
611
610
|
}
|
|
@@ -624,10 +623,10 @@ function _t(e) {
|
|
|
624
623
|
function vt(e) {
|
|
625
624
|
if (!e) return "";
|
|
626
625
|
let t = e.trim();
|
|
627
|
-
return t === "" ? "" : `\n <mj-preview>${
|
|
626
|
+
return t === "" ? "" : `\n <mj-preview>${E(t)}</mj-preview>`;
|
|
628
627
|
}
|
|
629
628
|
function yt(e) {
|
|
630
|
-
return e.length === 0 ? "" : e.map((e) => `\n <mj-font name="${
|
|
629
|
+
return e.length === 0 ? "" : e.map((e) => `\n <mj-font name="${D(e.name)}" href="${D(e.url)}" />`).join("");
|
|
631
630
|
}
|
|
632
631
|
function Q(e, t) {
|
|
633
632
|
return t ? e : e.filter((e) => e.type !== "html");
|
|
@@ -679,6 +678,6 @@ function St(e, t, n) {
|
|
|
679
678
|
function Ct(e) {
|
|
680
679
|
return e.length === 0 ? "" : e.map((e) => `\n <mj-style>\n${e.replaceAll("<", "\\3c ")}\n </mj-style>`).join("");
|
|
681
680
|
}
|
|
682
|
-
export { J as BUTTON_FULL_WIDTH_CSS_CLASS, T as DEFAULT_SOCIAL_ICONS_BASE_URL, W as RICH_TEXT_CSS_CLASS, ge as RenderContext,
|
|
681
|
+
export { J as BUTTON_FULL_WIDTH_CSS_CLASS, T as DEFAULT_SOCIAL_ICONS_BASE_URL, W as RICH_TEXT_CSS_CLASS, ge as RenderContext, N as UNRENDERABLE_MARKER_PREFIX, w as convertMergeTagsToValues, D as escapeAttr, E as escapeHtml, V as fluidOnMobileAttr, j as getCssClassAttr, M as getCssClasses, it as getWidthPercentages, at as getWidthPixels, A as isHiddenOnAll, X as renderBlock, pt as renderToMjml, I as renderUnrenderableBlock, K as resolveParagraphGap, G as richTextGapClass, L as toPaddingString };
|
|
683
682
|
|
|
684
|
-
//# sourceMappingURL=src-
|
|
683
|
+
//# sourceMappingURL=src-B32tyank.js.map
|