@templatical/editor 0.8.4 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{AiChatSidebar-CnRXeK77.js → AiChatSidebar-BUKj9n02.js} +5 -5
- package/dist/{AiFeatureMenu-BYDDrpj6.js → AiFeatureMenu-Co14YVJt.js} +3 -3
- package/dist/{BlockIssueBadge-DM-vXeD6.js → BlockIssueBadge-DThKKeub.js} +2 -2
- package/dist/{CloudEditor-B9a_K6Cm.js → CloudEditor-CAtw_sFC.js} +218 -217
- package/dist/{CollaboratorBar-HN4whzM-.js → CollaboratorBar-Bc6q0gB9.js} +2 -2
- package/dist/{CommentsSidebar-_llWQ4VT.js → CommentsSidebar-DiH4R4F0.js} +3 -3
- package/dist/{CountdownBlock-I99sC0C5.js → CountdownBlock-BTPefclD.js} +2 -2
- package/dist/{CountdownToolbar-BUhOUiQ9.js → CountdownToolbar-Dvr2icg-.js} +2 -2
- package/dist/{DesignReferenceSidebar-0GwjUn2V.js → DesignReferenceSidebar-BP32MgpS.js} +3 -3
- package/dist/{IssuesPanel-4MKZe8yP.js → IssuesPanel-B1LT91IX.js} +2 -2
- package/dist/{ModuleBrowserModal-DPZBsvqk.js → ModuleBrowserModal-CWegFoOA.js} +77 -85
- package/dist/{ModulePreviewCanvas-CK4j11-e.js → ModulePreviewCanvas-D9WUSSRT.js} +2 -2
- package/dist/{NumberWithSuffix-CxMFy_j3.js → NumberWithSuffix-CxUBW_V2.js} +2 -2
- package/dist/{ParagraphEditor-DBus_iHH.js → ParagraphEditor-DrAz2yot.js} +126 -126
- package/dist/{RichTextEditorContent-B_KCY6T1.js → RichTextEditorContent-gR169m1-.js} +4 -4
- package/dist/{SaveModuleDialog-DORRSbBo.js → SaveModuleDialog-DWidA0c9.js} +6 -6
- package/dist/{SnapshotHistory-DTMVEk03.js → SnapshotHistory-CIo2Jaw-.js} +4 -4
- package/dist/{TemplateScoringPanel-BIwEwFxD.js → TemplateScoringPanel-seBvvn8O.js} +2 -2
- package/dist/{TestEmailModal-DJmYp0Qi.js → TestEmailModal-BuCuWp3N.js} +3 -3
- package/dist/{TitleEditor-70d9AF1V.js → TitleEditor-BmW0uMl7.js} +67 -67
- package/dist/{TplModal-BEfwlvPC.js → TplModal-YFpBaiLj.js} +4 -4
- package/dist/{blockTypeIcons-2DRoPa3K.js → blockTypeIcons-DCkHXPhx.js} +19 -11
- package/dist/bundle-stats.json +8 -8
- package/dist/cdn/chunks/{AiFeatureMenu-CcuKnisc.js → AiFeatureMenu-Dayzk2H7.js} +2 -2
- package/dist/cdn/chunks/{AiFeatureMenu-CcuKnisc.js.map → AiFeatureMenu-Dayzk2H7.js.map} +1 -1
- package/dist/cdn/chunks/{BlockIssueBadge-Sr3is7Wr.js → BlockIssueBadge-D_US2wqo.js} +4 -4
- package/dist/cdn/chunks/{BlockIssueBadge-Sr3is7Wr.js.map → BlockIssueBadge-D_US2wqo.js.map} +1 -1
- package/dist/cdn/chunks/{CloudEditor-Bi10d2Gq.js → CloudEditor-CyJItWsK.js} +186 -185
- package/dist/cdn/chunks/{CloudEditor-Bi10d2Gq.js.map → CloudEditor-CyJItWsK.js.map} +1 -1
- package/dist/cdn/chunks/{CollaboratorBar-C0zeecvl.js → CollaboratorBar-C4CFs5EJ.js} +3 -3
- package/dist/cdn/chunks/{CollaboratorBar-C0zeecvl.js.map → CollaboratorBar-C4CFs5EJ.js.map} +1 -1
- package/dist/cdn/chunks/{CountdownBlock-CpSUUDDs.js → CountdownBlock-D6lCXhZA.js} +2 -2
- package/dist/cdn/chunks/{CountdownBlock-CpSUUDDs.js.map → CountdownBlock-D6lCXhZA.js.map} +1 -1
- package/dist/cdn/chunks/{CountdownToolbar-BBzdR-00.js → CountdownToolbar-BsGUxoRv.js} +3 -3
- package/dist/cdn/chunks/{CountdownToolbar-BBzdR-00.js.map → CountdownToolbar-BsGUxoRv.js.map} +1 -1
- package/dist/cdn/chunks/{IssuesPanel-Bthq6qoZ.js → IssuesPanel-DeHTmRDz.js} +5 -5
- package/dist/cdn/chunks/{IssuesPanel-Bthq6qoZ.js.map → IssuesPanel-DeHTmRDz.js.map} +1 -1
- package/dist/cdn/chunks/{ModuleBrowserModal-CFMd6M7E.js → ModuleBrowserModal-Cgjz4xAz.js} +8 -8
- package/dist/cdn/chunks/ModuleBrowserModal-Cgjz4xAz.js.map +1 -0
- package/dist/cdn/chunks/{ModulePreviewCanvas-BkcPcF5C.js → ModulePreviewCanvas-CeS9PsAA.js} +2 -2
- package/dist/cdn/chunks/{ModulePreviewCanvas-BkcPcF5C.js.map → ModulePreviewCanvas-CeS9PsAA.js.map} +1 -1
- package/dist/cdn/chunks/{NumberWithSuffix-C2hH_ZIK.js → NumberWithSuffix-Bp-idLCc.js} +2 -2
- package/dist/cdn/chunks/{NumberWithSuffix-C2hH_ZIK.js.map → NumberWithSuffix-Bp-idLCc.js.map} +1 -1
- package/dist/cdn/chunks/{ParagraphEditor-BIWXLPfu.js → ParagraphEditor-fM9aFu8T.js} +116 -116
- package/dist/cdn/chunks/ParagraphEditor-fM9aFu8T.js.map +1 -0
- package/dist/cdn/chunks/{RichTextEditorContent-DU0gc4bi.js → RichTextEditorContent-DwNPE5H5.js} +4 -4
- package/dist/cdn/chunks/{RichTextEditorContent-DU0gc4bi.js.map → RichTextEditorContent-DwNPE5H5.js.map} +1 -1
- package/dist/cdn/chunks/{SaveModuleDialog-DR9EZlWe.js → SaveModuleDialog-BrtDXzIz.js} +4 -4
- package/dist/cdn/chunks/SaveModuleDialog-BrtDXzIz.js.map +1 -0
- package/dist/cdn/chunks/TitleEditor-D0rSnye0.js +175 -0
- package/dist/cdn/chunks/TitleEditor-D0rSnye0.js.map +1 -0
- package/dist/cdn/chunks/{blockTypeIcons-eVGGIdne.js → blockTypeIcons-YOEe5mDE.js} +3 -3
- package/dist/cdn/chunks/{blockTypeIcons-eVGGIdne.js.map → blockTypeIcons-YOEe5mDE.js.map} +1 -1
- package/dist/{de-ED7c5RpG.js → cdn/chunks/de-CATfXDKV.js} +14 -1
- package/dist/cdn/chunks/{de-ED7c5RpG.js.map → de-CATfXDKV.js.map} +1 -1
- package/dist/cdn/chunks/{en-ivilDUn0.js → en-CwCAgYL5.js} +13 -2
- package/dist/cdn/chunks/{en-ivilDUn0.js.map → en-CwCAgYL5.js.map} +1 -1
- package/dist/cdn/chunks/{extensions-CvCoOuWB.js → extensions-GYsbQFPr.js} +26 -23
- package/dist/cdn/chunks/extensions-GYsbQFPr.js.map +1 -0
- package/dist/cdn/chunks/{features-CUYy5kZQ.js → features-D-2kVhHY.js} +1264 -1188
- package/dist/cdn/chunks/features-D-2kVhHY.js.map +1 -0
- package/dist/cdn/chunks/{icons-C4zY5-I3.js → icons-fZoyKV_s.js} +2 -2
- package/dist/cdn/chunks/{icons-C4zY5-I3.js.map → icons-fZoyKV_s.js.map} +1 -1
- package/dist/cdn/chunks/{media-library-BNt3msId.js → media-library-CO2WOETY.js} +240 -240
- package/dist/cdn/chunks/{media-library-BNt3msId.js.map → media-library-CO2WOETY.js.map} +1 -1
- package/dist/{pt-BR-B5tm2iBl.js → cdn/chunks/pt-BR-D3Mg7AKe.js} +14 -1
- package/dist/cdn/chunks/{pt-BR-B5tm2iBl.js.map → pt-BR-D3Mg7AKe.js.map} +1 -1
- package/dist/cdn/chunks/{quality-BTPRPGB-.js → quality-BxPiS-wv.js} +603 -577
- package/dist/cdn/chunks/{quality-BTPRPGB-.js.map → quality-BxPiS-wv.js.map} +1 -1
- package/dist/cdn/chunks/{renderer-IOmuuZjJ.js → renderer-7z2t_bYQ.js} +142 -108
- package/dist/cdn/chunks/{renderer-IOmuuZjJ.js.map → renderer-7z2t_bYQ.js.map} +1 -1
- package/dist/cdn/chunks/{src-Dp0ZFQ4-.js → src-ftxPuuQh.js} +4 -4
- package/dist/cdn/chunks/{src-Dp0ZFQ4-.js.map → src-ftxPuuQh.js.map} +1 -1
- package/dist/cdn/chunks/{styles-DtgjgsBH.js → styles-o0HIrw9F.js} +877 -622
- package/dist/cdn/chunks/styles-o0HIrw9F.js.map +1 -0
- 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.css +1 -1
- package/dist/cdn/editor.js +102 -101
- package/dist/cdn/editor.js.map +1 -1
- package/dist/{cloud-Dz8Ay2FM.js → cloud-VxYMtfXC.js} +1 -1
- package/dist/{cdn/chunks/de-ED7c5RpG.js → de-CATfXDKV.js} +12 -3
- 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-HO0vjY5Z.js → dist-CNLAS2v2.js} +130 -124
- 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/{en-ivilDUn0.js → en-CwCAgYL5.js} +12 -1
- package/dist/{extensions-BmGiz8Oo.js → extensions-Mj2-D8uK.js} +32 -29
- package/dist/{keys-B8K7Z7Ef.js → keys-BiQlvx51.js} +3 -3
- package/dist/{cdn/chunks/pt-BR-B5tm2iBl.js → pt-BR-D3Mg7AKe.js} +12 -3
- package/dist/style.css +1 -1
- package/dist/{styles-DFeOGKa_.js → styles-CJtcKmsx.js} +857 -601
- package/dist/templatical-editor.js +104 -103
- package/dist/{useCloudI18n-DFzVgYhJ.js → useCloudI18n-DKWJg6rJ.js} +1 -1
- package/dist/{useEditorCore-BXz-UXPd.js → useEditorCore-CEkf_VWX.js} +663 -633
- package/dist/{useI18n-CBbStVlD.js → useI18n-Besvmtxy.js} +1 -1
- package/dist/useMergeTag-WNzaCpXR.js +44 -0
- package/dist/{usePopoverRoot-62PlZQQ3.js → usePopoverRoot-CKt956u-.js} +1 -1
- package/package.json +21 -21
- package/dist/cdn/chunks/ModuleBrowserModal-CFMd6M7E.js.map +0 -1
- package/dist/cdn/chunks/ParagraphEditor-BIWXLPfu.js.map +0 -1
- package/dist/cdn/chunks/SaveModuleDialog-DR9EZlWe.js.map +0 -1
- package/dist/cdn/chunks/TitleEditor-DZcx2N4R.js +0 -175
- package/dist/cdn/chunks/TitleEditor-DZcx2N4R.js.map +0 -1
- package/dist/cdn/chunks/extensions-CvCoOuWB.js.map +0 -1
- package/dist/cdn/chunks/features-CUYy5kZQ.js.map +0 -1
- package/dist/cdn/chunks/styles-DtgjgsBH.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
- package/dist/useMergeTag-CS2bmWA0.js +0 -34
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { n as e } from "./rolldown-runtime-Dqa2HsxW.js";
|
|
2
|
-
import { An as t,
|
|
2
|
+
import { An as t, Dn as n, En as r, Fn as i, In as a, Ln as o, Mn as s, Nn as c, On as l, Pn as u, Rn as d, Tn as f, jn as p, kn as m } from "./features-D-2kVhHY.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
|
+
version: "0.9.0",
|
|
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 === "" ? "" : ee(e, (e) => w(e, "data-merge-tag") ?? w(e, "data-logic-merge-tag"));
|
|
94
|
+
}
|
|
95
|
+
function ee(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 w(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 T(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 E(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 D(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 O(e) {
|
|
148
|
+
let t = k(e);
|
|
115
149
|
return t === "" ? "" : ` css-class="${t}"`;
|
|
116
150
|
}
|
|
117
|
-
function
|
|
151
|
+
function k(e) {
|
|
118
152
|
let t = e.visibility;
|
|
119
153
|
if (!t) return "";
|
|
120
154
|
let n = [];
|
|
@@ -122,39 +156,39 @@ function O(e) {
|
|
|
122
156
|
}
|
|
123
157
|
//#endregion
|
|
124
158
|
//#region ../renderer/src/renderers/title.ts
|
|
125
|
-
function
|
|
126
|
-
if (
|
|
127
|
-
let n =
|
|
159
|
+
function te(e, t) {
|
|
160
|
+
if (D(e)) return "";
|
|
161
|
+
let n = T(e.styles.padding), r = E(e.styles.backgroundColor, "container"), i = ne(C(e.content)), a = d[e.level] ?? d[2], o = x(e.color), s = e.textAlign, c = re(e.fontFamily, t), l = O(e), u = `h${d[e.level] ? e.level : 2}`;
|
|
128
162
|
return `<mj-text
|
|
129
163
|
font-size="${a}px"
|
|
130
|
-
color="${
|
|
131
|
-
align="${
|
|
164
|
+
color="${o}"
|
|
165
|
+
align="${s}"
|
|
132
166
|
line-height="1.3"
|
|
133
|
-
padding="${n}"${r}${
|
|
134
|
-
><${
|
|
167
|
+
padding="${n}"${r}${c}${l}
|
|
168
|
+
><${u} style="margin:0;font-size:inherit;color:inherit;line-height:inherit">${i}</${u}></mj-text>`;
|
|
135
169
|
}
|
|
136
|
-
function
|
|
170
|
+
function ne(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 re(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 A(e, t) {
|
|
180
|
+
if (D(e) || e.content.replace(/<\/?p\b[^<>]*>/gi, "").trim() === "") return "";
|
|
181
|
+
let n = T(e.styles.padding), r = E(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}${O(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 (D(e) || e.src === "") return "";
|
|
191
|
+
let n = T(e.styles.padding), r = E(e.styles.backgroundColor, "container"), i = e.width === "full" ? t.containerWidth + "px" : e.width + "px", a = O(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 (D(e)) return "";
|
|
206
|
+
let n = T(e.styles.padding), r = E(e.styles.backgroundColor, "container"), i = T(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)}${O(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 (D(e)) return "";
|
|
224
|
+
let n = T(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}${O(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 D(e) ? "" : `<mj-spacer height="${e.height}px" padding="0"${e.styles.backgroundColor ? ` container-background-color="${x(e.styles.backgroundColor)}"` : ""}${O(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 (D(e) || !t.allowHtmlBlocks) return "";
|
|
208
242
|
let n = e.content;
|
|
209
|
-
return n === "" ? "" : `<mj-text${
|
|
243
|
+
return n === "" ? "" : `<mj-text${O(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 (D(e)) return "";
|
|
217
251
|
let n = e.icons;
|
|
218
252
|
if (n.length === 0) return "";
|
|
219
|
-
let r =
|
|
253
|
+
let r = T(e.styles.padding), i = e.styles.backgroundColor ? ` container-background-color="${x(e.styles.backgroundColor)}"` : "", a = O(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 (D(e) || e.items.length === 0) return "";
|
|
297
|
+
let n = T(e.styles.padding), r = E(e.styles.backgroundColor, "container"), i = O(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 (D(e) || e.rows.length === 0) return "";
|
|
322
|
+
let n = T(e.styles.padding), r = E(e.styles.backgroundColor, "container"), i = O(e), a = ie(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 ie(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 K(e, t) {
|
|
356
|
+
if (D(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 = O(e);
|
|
360
|
+
return `<mj-text${E(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,25 +391,25 @@ function q(e, t) {
|
|
|
357
391
|
}
|
|
358
392
|
//#endregion
|
|
359
393
|
//#region ../renderer/src/renderers/section.ts
|
|
360
|
-
function
|
|
361
|
-
if (
|
|
362
|
-
let
|
|
394
|
+
function Y(e, t, n) {
|
|
395
|
+
if (D(e)) return "";
|
|
396
|
+
let r = e.columns, i = q(r), a = J(r, t.containerWidth), o = T(e.styles.padding), c = E(e.styles.backgroundColor, "native"), l = O(e), u = e.children, d = [];
|
|
363
397
|
for (let e = 0; e < u.length; e++) {
|
|
364
|
-
let
|
|
365
|
-
d.push(`<mj-column width="${
|
|
398
|
+
let r = u[e], o = i[e] ?? "100%", c = Math.floor(a[e] ?? t.containerWidth), l = ae(r, t.allowHtmlBlocks).filter((e) => !s(e)), f = t.withContainerWidth(c), p = l.map((e) => n(e, f)).filter((e) => e !== "").join("\n");
|
|
399
|
+
d.push(`<mj-column width="${o}">
|
|
366
400
|
${p === "" ? "<mj-text> </mj-text>" : p}
|
|
367
401
|
</mj-column>`);
|
|
368
402
|
}
|
|
369
|
-
return `<mj-section${c} padding="${
|
|
403
|
+
return `<mj-section${c} padding="${o}"${l}>
|
|
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 (D(e)) return "";
|
|
424
|
+
let n = oe(e.url, e.thumbnailUrl);
|
|
391
425
|
if (!n) return "";
|
|
392
|
-
let r =
|
|
426
|
+
let r = T(e.styles.padding), i = E(e.styles.backgroundColor, "container"), a = e.width === "full" ? t.containerWidth + "px" : e.width + "px", o = O(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
|
|
440
|
+
function X(e, d) {
|
|
441
|
+
return s(e) ? Y(e, d, X) : a(e) ? te(e, d) : p(e) ? A(e, d) : m(e) ? j(e, d) : f(e) ? M(e, d) : n(e) ? P(e, d) : u(e) ? F(e, d) : l(e) ? I(e, d) : c(e) ? L(e, d) : t(e) ? R(e, d) : i(e) ? H(e, d) : o(e) ? se(e, d) : r(e) ? K(e, d) : "";
|
|
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: () => O,
|
|
452
|
+
getCssClasses: () => k,
|
|
453
|
+
getWidthPercentages: () => q,
|
|
454
|
+
getWidthPixels: () => J,
|
|
455
|
+
isHiddenOnAll: () => D,
|
|
456
|
+
renderBlock: () => X,
|
|
457
|
+
renderToMjml: () => Z,
|
|
458
|
+
toPaddingString: () => T
|
|
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
|
|
489
|
+
function le(e, t) {
|
|
490
|
+
return s(e) ? Q(e, X(e, t)) : Q(e, ue(X(e, t)));
|
|
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 = [];
|
|
@@ -492,16 +526,16 @@ async function pe(e, t) {
|
|
|
492
526
|
for (let e = 0; e < r.length; e++) n.set(r[e].id, i[e]);
|
|
493
527
|
return n;
|
|
494
528
|
}
|
|
495
|
-
function $(e,
|
|
496
|
-
for (let
|
|
497
|
-
if (
|
|
498
|
-
|
|
529
|
+
function $(e, t) {
|
|
530
|
+
for (let n of e) {
|
|
531
|
+
if (r(n)) {
|
|
532
|
+
t.push(n);
|
|
499
533
|
continue;
|
|
500
534
|
}
|
|
501
|
-
if (
|
|
535
|
+
if (s(n)) for (let e of n.children) $(e, t);
|
|
502
536
|
}
|
|
503
537
|
}
|
|
504
538
|
//#endregion
|
|
505
|
-
export {
|
|
539
|
+
export { ce as t };
|
|
506
540
|
|
|
507
|
-
//# sourceMappingURL=renderer-
|
|
541
|
+
//# sourceMappingURL=renderer-7z2t_bYQ.js.map
|