@templatical/editor 0.9.1 → 0.10.1
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-BUKj9n02.js → AiChatSidebar-Dz5bH1z3.js} +13 -13
- package/dist/{AiFeatureMenu-Co14YVJt.js → AiFeatureMenu-D2Xn0jFx.js} +7 -7
- package/dist/{BlockIssueBadge-DThKKeub.js → BlockIssueBadge-CnqD1cGo.js} +5 -5
- package/dist/{CloudEditor-DHB1FoQD.js → CloudEditor-BizZwsfD.js} +237 -233
- package/dist/{CollaboratorBar-Bc6q0gB9.js → CollaboratorBar-Bn2JDu6l.js} +4 -4
- package/dist/{CommentsSidebar-DiH4R4F0.js → CommentsSidebar-BAG6rdVC.js} +12 -12
- package/dist/{CountdownBlock-BTPefclD.js → CountdownBlock-B_Hr9Bm9.js} +3 -3
- package/dist/{CountdownToolbar-Dvr2icg-.js → CountdownToolbar-DaqDLKLk.js} +3 -3
- package/dist/{DesignReferenceSidebar-BP32MgpS.js → DesignReferenceSidebar-I9LWjvrj.js} +9 -9
- package/dist/{IssuesPanel-B1LT91IX.js → IssuesPanel-B32Ifp4x.js} +8 -8
- package/dist/{LoadingTrack-xCOLUR3o.js → LoadingTrack-UTqOUN4O.js} +1 -1
- package/dist/{ModuleBrowserModal-CWegFoOA.js → ModuleBrowserModal-DodRped1.js} +10 -10
- package/dist/{ModulePreviewCanvas-D9WUSSRT.js → ModulePreviewCanvas-DhcnddJF.js} +3 -3
- package/dist/{NumberWithSuffix-CxUBW_V2.js → NumberWithSuffix-DB7GyyCI.js} +3 -3
- package/dist/{ParagraphEditor-DrAz2yot.js → ParagraphEditor-pJA9BHAL.js} +26 -26
- package/dist/{RichTextEditorContent-gR169m1-.js → RichTextEditorContent-dTGSUff_.js} +6 -6
- package/dist/{SaveModuleDialog-DWidA0c9.js → SaveModuleDialog-D634e99d.js} +7 -7
- package/dist/{SnapshotHistory-CIo2Jaw-.js → SnapshotHistory-m_nGAHlb.js} +9 -9
- package/dist/{TemplateScoringPanel-seBvvn8O.js → TemplateScoringPanel-BOQh9neV.js} +14 -14
- package/dist/{TestEmailModal-BuCuWp3N.js → TestEmailModal-DOcwoKkc.js} +5 -5
- package/dist/{TitleEditor-BmW0uMl7.js → TitleEditor-t6JMWamY.js} +12 -12
- package/dist/{TplModal-YFpBaiLj.js → TplModal-BAtbfDB0.js} +4 -4
- package/dist/{blockTypeIcons-DCkHXPhx.js → blockTypeIcons-C4lXx3Au.js} +2 -2
- package/dist/bundle-stats.json +6 -6
- package/dist/cdn/chunks/{AiFeatureMenu-Dayzk2H7.js → AiFeatureMenu-BeOyHAoZ.js} +3 -3
- package/dist/cdn/chunks/{AiFeatureMenu-Dayzk2H7.js.map → AiFeatureMenu-BeOyHAoZ.js.map} +1 -1
- package/dist/cdn/chunks/{BlockIssueBadge-D_US2wqo.js → BlockIssueBadge-C6YilQdl.js} +5 -5
- package/dist/cdn/chunks/{BlockIssueBadge-D_US2wqo.js.map → BlockIssueBadge-C6YilQdl.js.map} +1 -1
- package/dist/cdn/chunks/{CloudEditor-CrZk-OwQ.js → CloudEditor-DEA37rdW.js} +178 -174
- package/dist/cdn/chunks/CloudEditor-DEA37rdW.js.map +1 -0
- package/dist/cdn/chunks/{CollaboratorBar-C4CFs5EJ.js → CollaboratorBar-CKW7jOW4.js} +4 -4
- package/dist/cdn/chunks/{CollaboratorBar-C4CFs5EJ.js.map → CollaboratorBar-CKW7jOW4.js.map} +1 -1
- package/dist/cdn/chunks/{CountdownBlock-D6lCXhZA.js → CountdownBlock-DU9ga9Ki.js} +3 -3
- package/dist/cdn/chunks/{CountdownBlock-D6lCXhZA.js.map → CountdownBlock-DU9ga9Ki.js.map} +1 -1
- package/dist/cdn/chunks/{CountdownToolbar-BsGUxoRv.js → CountdownToolbar-BHWsxth7.js} +4 -4
- package/dist/cdn/chunks/{CountdownToolbar-BsGUxoRv.js.map → CountdownToolbar-BHWsxth7.js.map} +1 -1
- package/dist/cdn/chunks/{IssuesPanel-DeHTmRDz.js → IssuesPanel-BkYhij39.js} +9 -9
- package/dist/cdn/chunks/{IssuesPanel-DeHTmRDz.js.map → IssuesPanel-BkYhij39.js.map} +1 -1
- package/dist/cdn/chunks/{ModuleBrowserModal-Cgjz4xAz.js → ModuleBrowserModal-D51w942J.js} +9 -9
- package/dist/cdn/chunks/{ModuleBrowserModal-Cgjz4xAz.js.map → ModuleBrowserModal-D51w942J.js.map} +1 -1
- package/dist/cdn/chunks/{ModulePreviewCanvas-CeS9PsAA.js → ModulePreviewCanvas-BqTqcKHS.js} +3 -3
- package/dist/cdn/chunks/{ModulePreviewCanvas-CeS9PsAA.js.map → ModulePreviewCanvas-BqTqcKHS.js.map} +1 -1
- package/dist/cdn/chunks/{NumberWithSuffix-Bp-idLCc.js → NumberWithSuffix-DuUcF2zG.js} +3 -3
- package/dist/cdn/chunks/{NumberWithSuffix-Bp-idLCc.js.map → NumberWithSuffix-DuUcF2zG.js.map} +1 -1
- package/dist/cdn/chunks/{ParagraphEditor-fM9aFu8T.js → ParagraphEditor-Bqjn3ZNm.js} +45 -45
- package/dist/cdn/chunks/{ParagraphEditor-fM9aFu8T.js.map → ParagraphEditor-Bqjn3ZNm.js.map} +1 -1
- package/dist/cdn/chunks/{RichTextEditorContent-DwNPE5H5.js → RichTextEditorContent-mIkkb5EK.js} +4 -4
- package/dist/cdn/chunks/{RichTextEditorContent-DwNPE5H5.js.map → RichTextEditorContent-mIkkb5EK.js.map} +1 -1
- package/dist/cdn/chunks/{SaveModuleDialog-BrtDXzIz.js → SaveModuleDialog-Felfmkcj.js} +5 -5
- package/dist/cdn/chunks/{SaveModuleDialog-BrtDXzIz.js.map → SaveModuleDialog-Felfmkcj.js.map} +1 -1
- package/dist/cdn/chunks/{TitleEditor-D0rSnye0.js → TitleEditor-Dcldr8D6.js} +12 -12
- package/dist/cdn/chunks/{TitleEditor-D0rSnye0.js.map → TitleEditor-Dcldr8D6.js.map} +1 -1
- package/dist/cdn/chunks/blockTypeIcons-D05Wqf5u.js +22 -0
- package/dist/cdn/chunks/{blockTypeIcons-YOEe5mDE.js.map → blockTypeIcons-D05Wqf5u.js.map} +1 -1
- package/dist/{de-CATfXDKV.js → cdn/chunks/de-DIAGP7yH.js} +2 -6
- package/dist/cdn/chunks/de-DIAGP7yH.js.map +1 -0
- package/dist/cdn/chunks/{draggable-BwWMFq33.js → draggable-J_1CPXYc.js} +1254 -1253
- package/dist/cdn/chunks/draggable-J_1CPXYc.js.map +1 -0
- package/dist/{en-CwCAgYL5.js → cdn/chunks/en-nqIW8Q9W.js} +2 -6
- package/dist/cdn/chunks/en-nqIW8Q9W.js.map +1 -0
- package/dist/cdn/chunks/{extensions-GYsbQFPr.js → extensions-CNmpC18A.js} +127 -124
- package/dist/cdn/chunks/{extensions-GYsbQFPr.js.map → extensions-CNmpC18A.js.map} +1 -1
- package/dist/cdn/chunks/{features-D-2kVhHY.js → features-_ar9QbVv.js} +1006 -979
- package/dist/cdn/chunks/features-_ar9QbVv.js.map +1 -0
- package/dist/cdn/chunks/{icons-fZoyKV_s.js → icons-CnwCLJX-.js} +19 -33
- package/dist/cdn/chunks/icons-CnwCLJX-.js.map +1 -0
- package/dist/cdn/chunks/{media-library-CO2WOETY.js → media-library-9jyt7Bf9.js} +83 -79
- package/dist/cdn/chunks/media-library-9jyt7Bf9.js.map +1 -0
- package/dist/{pt-BR-D3Mg7AKe.js → cdn/chunks/pt-BR-DCNnLLx9.js} +2 -6
- package/dist/cdn/chunks/pt-BR-DCNnLLx9.js.map +1 -0
- package/dist/cdn/chunks/{quality-BxPiS-wv.js → quality-CO9mj_RH.js} +494 -484
- package/dist/cdn/chunks/quality-CO9mj_RH.js.map +1 -0
- package/dist/cdn/chunks/{renderer-CfHPFI5v.js → renderer-m6XTCWCL.js} +135 -117
- package/dist/cdn/chunks/renderer-m6XTCWCL.js.map +1 -0
- package/dist/cdn/chunks/{src-ftxPuuQh.js → src-DfMSYqvE.js} +9 -9
- package/dist/cdn/chunks/{src-ftxPuuQh.js.map → src-DfMSYqvE.js.map} +1 -1
- package/dist/cdn/chunks/{styles-CVUvPdKD.js → styles-1uFWdD5T.js} +1045 -1074
- package/dist/cdn/chunks/styles-1uFWdD5T.js.map +1 -0
- package/dist/cdn/chunks/{tiptap-BBbH3IT9.js → tiptap-CJbIm_hE.js} +5 -5
- package/dist/cdn/chunks/{tiptap-BBbH3IT9.js.map → tiptap-CJbIm_hE.js.map} +1 -1
- package/dist/cdn/editor.css +1 -1
- package/dist/cdn/editor.js +109 -100
- package/dist/cdn/editor.js.map +1 -1
- package/dist/{check-ChQyfxJ3.js → check-Bs6_uQpm.js} +1 -1
- package/dist/{chevron-down-DJjo0jSV.js → chevron-down-so1rnGwF.js} +1 -1
- package/dist/{circle-alert-CPH6l3Lc.js → circle-alert-CrKv0AuW.js} +1 -1
- package/dist/{clock-DHl_BIkU.js → clock-Cpx6GYpa.js} +1 -1
- package/dist/{cloud-VxYMtfXC.js → cloud-bHhCNRZa.js} +80 -74
- package/dist/{createLucideIcon-XgXOJ05E.js → createLucideIcon-DFBxEm5K.js} +3 -3
- package/dist/{cdn/chunks/de-CATfXDKV.js → de-DIAGP7yH.js} +0 -8
- package/dist/{dist-C0jo8wtG.js → dist-0RguD1vS.js} +1 -1
- package/dist/{dist-CNLAS2v2.js → dist-2-A7SaKm.js} +3 -3
- package/dist/{dist-UK-lbEBc.js → dist-74n2Mqc6.js} +1 -1
- package/dist/{dist-BzuC8o3y.js → dist-B3CcePtK.js} +3 -3
- package/dist/{dist-D8C6jIXM.js → dist-BejBMbBX.js} +3 -3
- package/dist/{dist-CIV3Brg-.js → dist-BufRk8ZY.js} +4 -6
- package/dist/{dist-DILjuzSv.js → dist-Bvje_Tqb.js} +1 -1
- package/dist/{dist-BDgf2G-V.js → dist-BxHa6kIT.js} +3 -3
- package/dist/{dist-CUpJmrjt.js → dist-CIK3BYgh.js} +1 -1
- package/dist/{dist-C8wMh_gi.js → dist-CMkZaqX1.js} +1 -1
- package/dist/{dist-BxP6TB0l.js → dist-CoaWXQ7N.js} +1 -1
- package/dist/{dist-D5lmdi1F.js → dist-D1YvgM6p.js} +1 -1
- package/dist/{dist-DYO-w_Jf.js → dist-DJ5YJLXn.js} +1 -1
- package/dist/{dist-DXaxGLsw.js → dist-DwEpKyry.js} +1 -1
- package/dist/{cdn/chunks/en-CwCAgYL5.js → en-nqIW8Q9W.js} +0 -8
- package/dist/{extensions-Mj2-D8uK.js → extensions-C810eSzv.js} +107 -104
- package/dist/{image-up-CPBCOMit.js → image-up-kMLE5GsI.js} +1 -1
- package/dist/index.d.ts +8 -0
- package/dist/{info-DIY9mguM.js → info-xqRxLfNz.js} +1 -1
- package/dist/keys-BoYBr3PU.js +10 -0
- package/dist/{list-checks-CSCyu3fH.js → list-checks-C81htkBJ.js} +1 -1
- package/dist/{loader-circle-Rz_4vJLH.js → loader-circle-C6cZPIum.js} +1 -1
- package/dist/{message-circle-D-umK_MU.js → message-circle-dqOBRe07.js} +1 -1
- package/dist/{cdn/chunks/pt-BR-D3Mg7AKe.js → pt-BR-DCNnLLx9.js} +0 -8
- package/dist/{refresh-cw-CvWF4jfR.js → refresh-cw-DCjNd6o0.js} +1 -1
- package/dist/{scan-line-wanvAFDr.js → scan-line-DXz0nZVJ.js} +1 -1
- package/dist/{send-BhbhbIFT.js → send-C4uH_WaI.js} +1 -1
- package/dist/{shield-check-CXPPMWth.js → shield-check-B3U68ssA.js} +1 -1
- package/dist/{sparkles-CrUN0KWY.js → sparkles-CsDweGUy.js} +1 -1
- package/dist/style.css +1 -1
- package/dist/{styles-CxwIlb7Y.js → styles-CBlNpqL9.js} +1031 -1074
- package/dist/templatical-editor.js +116 -107
- package/dist/{text-align-end-Bkq8oBrD.js → text-align-start-BkKQePFp.js} +11 -11
- package/dist/{trash-2-BpY5BCLT.js → trash-2-BIOkaEz1.js} +1 -1
- package/dist/{triangle-alert-MwJBKR2e.js → triangle-alert-Bbgu6uUG.js} +1 -1
- package/dist/{useAliveFlag-BLyG8L4d.js → useAliveFlag-Bc99FWyR.js} +1 -1
- package/dist/{useCloudI18n-DKWJg6rJ.js → useCloudI18n-DiwsLi6z.js} +2 -2
- package/dist/{useEditorCore-CEkf_VWX.js → useEditorCore-7c1QpPlw.js} +717 -694
- package/dist/{useI18n-Besvmtxy.js → useI18n-DskZMfRJ.js} +2 -2
- package/dist/{useMergeTag-WNzaCpXR.js → useMergeTag-Co4xYwG6.js} +4 -4
- package/dist/usePopoverRoot-DYH_gX8o.js +8 -0
- package/dist/{vue.runtime.esm-bundler-BDSGA5hA.js → vue.runtime.esm-bundler-D0Hg03Ub.js} +1289 -1288
- package/dist/{x-rcnxRG8Y.js → x-DWU6NCuE.js} +1 -1
- package/package.json +10 -10
- package/dist/cdn/chunks/CloudEditor-CrZk-OwQ.js.map +0 -1
- package/dist/cdn/chunks/blockTypeIcons-YOEe5mDE.js +0 -22
- package/dist/cdn/chunks/de-CATfXDKV.js.map +0 -1
- package/dist/cdn/chunks/draggable-BwWMFq33.js.map +0 -1
- package/dist/cdn/chunks/en-CwCAgYL5.js.map +0 -1
- package/dist/cdn/chunks/features-D-2kVhHY.js.map +0 -1
- package/dist/cdn/chunks/icons-fZoyKV_s.js.map +0 -1
- package/dist/cdn/chunks/media-library-CO2WOETY.js.map +0 -1
- package/dist/cdn/chunks/pt-BR-D3Mg7AKe.js.map +0 -1
- package/dist/cdn/chunks/quality-BxPiS-wv.js.map +0 -1
- package/dist/cdn/chunks/renderer-CfHPFI5v.js.map +0 -1
- package/dist/cdn/chunks/styles-CVUvPdKD.js.map +0 -1
- package/dist/keys-BiQlvx51.js +0 -10
- package/dist/usePopoverRoot-CKt956u-.js +0 -8
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
import { n as e } from "./rolldown-runtime-Dqa2HsxW.js";
|
|
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,
|
|
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, jn as f, kn as p, zn as m } from "./features-_ar9QbVv.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.10.1",
|
|
9
9
|
bugs: "https://github.com/templatical/sdk/issues",
|
|
10
10
|
dependencies: { "@templatical/types": "workspace:*" },
|
|
11
11
|
devDependencies: {
|
|
12
12
|
"@resvg/resvg-js": "^2.6.2",
|
|
13
|
-
mjml: "^5.
|
|
14
|
-
tsup: "^8.5.1",
|
|
13
|
+
mjml: "^5.3.0",
|
|
15
14
|
typescript: "^6.0.3",
|
|
16
15
|
vitest: "^4.1.7"
|
|
17
16
|
},
|
|
@@ -38,7 +37,7 @@ var h = `https://unpkg.com/@templatical/renderer@${{
|
|
|
38
37
|
directory: "packages/renderer"
|
|
39
38
|
},
|
|
40
39
|
scripts: {
|
|
41
|
-
build: "
|
|
40
|
+
build: "tsdown && node scripts/rasterize-social.mjs",
|
|
42
41
|
test: "vitest run --config vitest.config.ts",
|
|
43
42
|
typecheck: "tsc --noEmit"
|
|
44
43
|
},
|
|
@@ -90,9 +89,9 @@ function S(e) {
|
|
|
90
89
|
return e === "" ? "" : x(e).replace(/[;{}\r\n]/g, "");
|
|
91
90
|
}
|
|
92
91
|
function C(e) {
|
|
93
|
-
return e === "" ? "" :
|
|
92
|
+
return e === "" ? "" : w(e, (e) => T(e, "data-merge-tag") ?? T(e, "data-logic-merge-tag"));
|
|
94
93
|
}
|
|
95
|
-
function
|
|
94
|
+
function w(e, t) {
|
|
96
95
|
let n = "", r = 0;
|
|
97
96
|
for (; r < e.length;) {
|
|
98
97
|
let i = e.indexOf("<span", r);
|
|
@@ -124,41 +123,41 @@ function ee(e, t) {
|
|
|
124
123
|
}
|
|
125
124
|
return n;
|
|
126
125
|
}
|
|
127
|
-
function
|
|
126
|
+
function T(e, t) {
|
|
128
127
|
let n = RegExp(`(?:^|\\s)${t}="([^"<>]*)"`).exec(e);
|
|
129
128
|
return n ? n[1] : null;
|
|
130
129
|
}
|
|
131
130
|
//#endregion
|
|
132
131
|
//#region ../renderer/src/padding.ts
|
|
133
|
-
function
|
|
132
|
+
function E(e) {
|
|
134
133
|
return `${e.top}px ${e.right}px ${e.bottom}px ${e.left}px`;
|
|
135
134
|
}
|
|
136
135
|
//#endregion
|
|
137
136
|
//#region ../renderer/src/utils.ts
|
|
138
|
-
function
|
|
137
|
+
function D(e, t) {
|
|
139
138
|
return e ? ` ${t === "native" ? "background-color" : "container-background-color"}="${e}"` : "";
|
|
140
139
|
}
|
|
141
140
|
//#endregion
|
|
142
141
|
//#region ../renderer/src/visibility.ts
|
|
143
|
-
function
|
|
142
|
+
function O(e) {
|
|
144
143
|
let t = e.visibility;
|
|
145
|
-
return t ? !t.desktop && !t.
|
|
144
|
+
return t ? !t.desktop && !t.mobile : !1;
|
|
146
145
|
}
|
|
147
|
-
function
|
|
148
|
-
let t =
|
|
146
|
+
function k(e) {
|
|
147
|
+
let t = A(e);
|
|
149
148
|
return t === "" ? "" : ` css-class="${t}"`;
|
|
150
149
|
}
|
|
151
|
-
function
|
|
150
|
+
function A(e) {
|
|
152
151
|
let t = e.visibility;
|
|
153
152
|
if (!t) return "";
|
|
154
153
|
let n = [];
|
|
155
|
-
return t.desktop || n.push("tpl-hide-desktop"), t.
|
|
154
|
+
return t.desktop || n.push("tpl-hide-desktop"), t.mobile || n.push("tpl-hide-mobile"), n.join(" ");
|
|
156
155
|
}
|
|
157
156
|
//#endregion
|
|
158
157
|
//#region ../renderer/src/renderers/title.ts
|
|
159
|
-
function
|
|
160
|
-
if (
|
|
161
|
-
let n =
|
|
158
|
+
function j(e, t) {
|
|
159
|
+
if (O(e)) return "";
|
|
160
|
+
let n = E(e.styles.padding), r = D(e.styles.backgroundColor, "container"), i = ee(C(e.content)), a = m[e.level] ?? m[2], o = x(e.color), s = e.textAlign, c = te(e.fontFamily, t), l = k(e), u = `h${m[e.level] ? e.level : 2}`;
|
|
162
161
|
return `<mj-text
|
|
163
162
|
font-size="${a}px"
|
|
164
163
|
color="${o}"
|
|
@@ -167,28 +166,28 @@ function te(e, t) {
|
|
|
167
166
|
padding="${n}"${r}${c}${l}
|
|
168
167
|
><${u} style="margin:0;font-size:inherit;color:inherit;line-height:inherit">${i}</${u}></mj-text>`;
|
|
169
168
|
}
|
|
170
|
-
function
|
|
169
|
+
function ee(e) {
|
|
171
170
|
let t = e.match(/^\s*<p\b[^>]*>([\s\S]*)<\/p>\s*$/);
|
|
172
171
|
return !t || /<\/p>\s*<p\b/i.test(t[1]) ? e : t[1];
|
|
173
172
|
}
|
|
174
|
-
function
|
|
173
|
+
function te(e, t) {
|
|
175
174
|
return e ? ` font-family="${t.resolveFontFamily(e)}"` : "";
|
|
176
175
|
}
|
|
177
176
|
//#endregion
|
|
178
177
|
//#region ../renderer/src/renderers/paragraph.ts
|
|
179
|
-
function
|
|
180
|
-
if (
|
|
181
|
-
let n =
|
|
178
|
+
function ne(e, t) {
|
|
179
|
+
if (O(e) || e.content.replace(/<\/?p\b[^<>]*>/gi, "").trim() === "") return "";
|
|
180
|
+
let n = E(e.styles.padding), r = D(e.styles.backgroundColor, "container"), i = C(e.content);
|
|
182
181
|
return `<mj-text
|
|
183
182
|
line-height="1.5"
|
|
184
|
-
padding="${n}"${r}${
|
|
183
|
+
padding="${n}"${r}${k(e)}
|
|
185
184
|
>${i}</mj-text>`;
|
|
186
185
|
}
|
|
187
186
|
//#endregion
|
|
188
187
|
//#region ../renderer/src/renderers/image.ts
|
|
189
|
-
function
|
|
190
|
-
if (
|
|
191
|
-
let n =
|
|
188
|
+
function M(e, t) {
|
|
189
|
+
if (O(e) || e.src === "") return "";
|
|
190
|
+
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 = "";
|
|
192
191
|
e.linkUrl && (o = ` href="${x(e.linkUrl)}"`, e.linkOpenInNewTab && (o += " target=\"_blank\" rel=\"noopener\""));
|
|
193
192
|
let s = x(e.src), c = e.decorative === !0;
|
|
194
193
|
return `<mj-image
|
|
@@ -201,9 +200,9 @@ function j(e, t) {
|
|
|
201
200
|
}
|
|
202
201
|
//#endregion
|
|
203
202
|
//#region ../renderer/src/renderers/button.ts
|
|
204
|
-
function
|
|
205
|
-
if (
|
|
206
|
-
let n =
|
|
203
|
+
function N(e, t) {
|
|
204
|
+
if (O(e)) return "";
|
|
205
|
+
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);
|
|
207
206
|
return `<mj-button${o}${e.openInNewTab ? " target=\"_blank\" rel=\"noopener\"" : ""}
|
|
208
207
|
background-color="${s}"
|
|
209
208
|
color="${c}"
|
|
@@ -211,46 +210,48 @@ function M(e, t) {
|
|
|
211
210
|
font-weight="bold"
|
|
212
211
|
border-radius="${u}px"
|
|
213
212
|
inner-padding="${i}"
|
|
214
|
-
padding="${n}"${r}${
|
|
213
|
+
padding="${n}"${r}${P(e.fontFamily, t)}${k(e)}
|
|
215
214
|
>${d}</mj-button>`;
|
|
216
215
|
}
|
|
217
|
-
function
|
|
216
|
+
function P(e, t) {
|
|
218
217
|
return e ? ` font-family="${t.resolveFontFamily(e)}"` : "";
|
|
219
218
|
}
|
|
220
219
|
//#endregion
|
|
221
220
|
//#region ../renderer/src/renderers/divider.ts
|
|
222
|
-
function
|
|
223
|
-
if (
|
|
224
|
-
let n =
|
|
221
|
+
function F(e, t) {
|
|
222
|
+
if (O(e)) return "";
|
|
223
|
+
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";
|
|
225
224
|
return `<mj-divider
|
|
226
225
|
border-width="${e.thickness}px"
|
|
227
226
|
border-style="${e.lineStyle}"
|
|
228
227
|
border-color="${x(e.color)}"
|
|
229
228
|
width="${i}"
|
|
230
|
-
padding="${n}"${r}${
|
|
229
|
+
padding="${n}"${r}${k(e)}
|
|
231
230
|
/>`;
|
|
232
231
|
}
|
|
233
232
|
//#endregion
|
|
234
233
|
//#region ../renderer/src/renderers/spacer.ts
|
|
235
|
-
function
|
|
236
|
-
return
|
|
234
|
+
function I(e, t) {
|
|
235
|
+
return O(e) ? "" : `<mj-spacer height="${e.height}px" padding="0"${e.styles.backgroundColor ? ` container-background-color="${x(e.styles.backgroundColor)}"` : ""}${k(e)} />`;
|
|
237
236
|
}
|
|
238
237
|
//#endregion
|
|
239
238
|
//#region ../renderer/src/renderers/html.ts
|
|
240
|
-
function
|
|
241
|
-
if (
|
|
239
|
+
function L(e, t) {
|
|
240
|
+
if (O(e) || !t.allowHtmlBlocks) return "";
|
|
242
241
|
let n = e.content;
|
|
243
|
-
|
|
242
|
+
if (n === "") return "";
|
|
243
|
+
let r = k(e);
|
|
244
|
+
return `<mj-text padding="${E(e.styles.padding)}"${D(e.styles.backgroundColor, "container")}${r}>
|
|
244
245
|
${n}
|
|
245
246
|
</mj-text>`;
|
|
246
247
|
}
|
|
247
248
|
//#endregion
|
|
248
249
|
//#region ../renderer/src/renderers/social.ts
|
|
249
|
-
function
|
|
250
|
-
if (
|
|
250
|
+
function R(e, t) {
|
|
251
|
+
if (O(e)) return "";
|
|
251
252
|
let n = e.icons;
|
|
252
253
|
if (n.length === 0) return "";
|
|
253
|
-
let r =
|
|
254
|
+
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;
|
|
254
255
|
switch (s) {
|
|
255
256
|
case "small":
|
|
256
257
|
u = 24;
|
|
@@ -292,78 +293,78 @@ ${n.map((e, n) => {
|
|
|
292
293
|
}
|
|
293
294
|
//#endregion
|
|
294
295
|
//#region ../renderer/src/renderers/menu.ts
|
|
295
|
-
function
|
|
296
|
-
if (
|
|
297
|
-
let n =
|
|
296
|
+
function z(e, t) {
|
|
297
|
+
if (O(e) || e.items.length === 0) return "";
|
|
298
|
+
let n = E(e.styles.padding), r = D(e.styles.backgroundColor, "container"), i = k(e), a = H(e.fontFamily, t), o = e.textAlign;
|
|
298
299
|
return `<mj-text
|
|
299
300
|
font-size="${e.fontSize}px"
|
|
300
301
|
color="${x(e.color)}"
|
|
301
302
|
align="${o}"
|
|
302
303
|
line-height="1.5"
|
|
303
304
|
padding="${n}"${r}${a}${i}
|
|
304
|
-
>${
|
|
305
|
+
>${B(e)}</mj-text>`;
|
|
305
306
|
}
|
|
306
|
-
function
|
|
307
|
+
function B(e) {
|
|
307
308
|
let t = e.items, n = b(e.separator), r = S(e.separatorColor), i = e.spacing, a = e.linkColor ?? e.color, o = [], s = t.length;
|
|
308
|
-
for (let e = 0; e < s; e++) o.push(
|
|
309
|
+
for (let e = 0; e < s; e++) o.push(V(t[e], a)), e < s - 1 && o.push(`<span style="color: ${r}; padding: 0 ${i}px;">${n}</span>`);
|
|
309
310
|
return o.join("");
|
|
310
311
|
}
|
|
311
|
-
function
|
|
312
|
+
function V(e, t) {
|
|
312
313
|
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"];
|
|
313
314
|
return e.bold && o.push("font-weight: bold"), e.underline && o.push("text-decoration: underline"), `<a href="${r}" style="${o.join("; ")}"${a}>${n}</a>`;
|
|
314
315
|
}
|
|
315
|
-
function
|
|
316
|
+
function H(e, t) {
|
|
316
317
|
return e ? ` font-family="${t.resolveFontFamily(e)}"` : "";
|
|
317
318
|
}
|
|
318
319
|
//#endregion
|
|
319
320
|
//#region ../renderer/src/renderers/table.ts
|
|
320
|
-
function
|
|
321
|
-
if (
|
|
322
|
-
let n =
|
|
321
|
+
function U(e, t) {
|
|
322
|
+
if (O(e) || e.rows.length === 0) return "";
|
|
323
|
+
let n = E(e.styles.padding), r = D(e.styles.backgroundColor, "container"), i = k(e), a = q(e.fontFamily, t);
|
|
323
324
|
return `<mj-text
|
|
324
325
|
font-size="${e.fontSize}px"
|
|
325
326
|
color="${x(e.color)}"
|
|
326
327
|
align="${e.textAlign}"
|
|
327
328
|
line-height="1.5"
|
|
328
329
|
padding="${n}"${r}${a}${i}
|
|
329
|
-
>${
|
|
330
|
+
>${W(e)}</mj-text>`;
|
|
330
331
|
}
|
|
331
|
-
function
|
|
332
|
+
function W(e) {
|
|
332
333
|
let t = S(e.borderColor), n = e.borderWidth, r = "";
|
|
333
334
|
for (let i = 0; i < e.rows.length; i++) {
|
|
334
335
|
let a = e.rows[i];
|
|
335
|
-
r +=
|
|
336
|
+
r += G(a, e, e.hasHeaderRow && i === 0, t, n);
|
|
336
337
|
}
|
|
337
338
|
return `<table style="width: 100%; border-collapse: collapse;">${r}</table>`;
|
|
338
339
|
}
|
|
339
|
-
function
|
|
340
|
+
function G(e, t, n, r, i) {
|
|
340
341
|
let a = "";
|
|
341
|
-
for (let o of e.cells) a +=
|
|
342
|
+
for (let o of e.cells) a += K(o, t, n, r, i);
|
|
342
343
|
return `<tr>${a}</tr>`;
|
|
343
344
|
}
|
|
344
|
-
function
|
|
345
|
+
function K(e, t, n, r, i) {
|
|
345
346
|
let a = t.cellPadding, o = [`border: ${i}px solid ${r}`, `padding: ${a}px`];
|
|
346
347
|
n && (o.push("font-weight: bold"), t.headerBackgroundColor && o.push(`background-color: ${S(t.headerBackgroundColor)}`));
|
|
347
348
|
let s = o.join("; "), c = C(e.content), l = n ? "th" : "td";
|
|
348
349
|
return `<${l} style="${s}">${c}</${l}>`;
|
|
349
350
|
}
|
|
350
|
-
function
|
|
351
|
+
function q(e, t) {
|
|
351
352
|
return e ? ` font-family="${t.resolveFontFamily(e)}"` : "";
|
|
352
353
|
}
|
|
353
354
|
//#endregion
|
|
354
355
|
//#region ../renderer/src/renderers/custom.ts
|
|
355
|
-
function
|
|
356
|
-
if (
|
|
356
|
+
function re(e, t) {
|
|
357
|
+
if (O(e)) return "";
|
|
357
358
|
let n = t.customBlockHtml.get(e.id) ?? e.renderedHtml;
|
|
358
359
|
if (!n || n === "") return "";
|
|
359
|
-
let r =
|
|
360
|
-
return `<mj-text${E(e.styles
|
|
360
|
+
let r = k(e);
|
|
361
|
+
return `<mj-text padding="${E(e.styles.padding)}"${D(e.styles.backgroundColor, "container")}${r}>
|
|
361
362
|
${n}
|
|
362
363
|
</mj-text>`;
|
|
363
364
|
}
|
|
364
365
|
//#endregion
|
|
365
366
|
//#region ../renderer/src/columns.ts
|
|
366
|
-
function
|
|
367
|
+
function J(e) {
|
|
367
368
|
switch (e) {
|
|
368
369
|
case "2": return ["50%", "50%"];
|
|
369
370
|
case "3": return [
|
|
@@ -376,7 +377,7 @@ function q(e) {
|
|
|
376
377
|
default: return ["100%"];
|
|
377
378
|
}
|
|
378
379
|
}
|
|
379
|
-
function
|
|
380
|
+
function Y(e, t) {
|
|
380
381
|
switch (e) {
|
|
381
382
|
case "2": return [t * .5, t * .5];
|
|
382
383
|
case "3": return [
|
|
@@ -390,17 +391,26 @@ function J(e, t) {
|
|
|
390
391
|
}
|
|
391
392
|
}
|
|
392
393
|
//#endregion
|
|
394
|
+
//#region ../renderer/src/display-condition.ts
|
|
395
|
+
function X(e, t) {
|
|
396
|
+
if (t === "") return "";
|
|
397
|
+
let n = e.displayCondition;
|
|
398
|
+
return n ? `<mj-raw>${n.before}</mj-raw>
|
|
399
|
+
` + t + `
|
|
400
|
+
<mj-raw>${n.after}</mj-raw>` : t;
|
|
401
|
+
}
|
|
402
|
+
//#endregion
|
|
393
403
|
//#region ../renderer/src/renderers/section.ts
|
|
394
|
-
function
|
|
395
|
-
if (
|
|
396
|
-
let r = e.columns, i =
|
|
404
|
+
function ie(e, t, n) {
|
|
405
|
+
if (O(e)) return "";
|
|
406
|
+
let r = e.columns, i = J(r), a = Y(r, t.containerWidth), o = E(e.styles.padding), s = D(e.styles.backgroundColor, "native"), l = k(e), u = e.children, d = [];
|
|
397
407
|
for (let e = 0; e < u.length; e++) {
|
|
398
|
-
let r = u[e], o = i[e] ?? "100%",
|
|
408
|
+
let r = u[e], o = i[e] ?? "100%", s = Math.floor(a[e] ?? t.containerWidth), l = ae(r, t.allowHtmlBlocks).filter((e) => !c(e)), f = t.withContainerWidth(s), p = l.map((e) => X(e, n(e, f))).filter((e) => e !== "").join("\n");
|
|
399
409
|
d.push(`<mj-column width="${o}">
|
|
400
410
|
${p === "" ? "<mj-text> </mj-text>" : p}
|
|
401
411
|
</mj-column>`);
|
|
402
412
|
}
|
|
403
|
-
return `<mj-section${
|
|
413
|
+
return `<mj-section${s} padding="${o}"${l}>
|
|
404
414
|
${d.join("\n")}
|
|
405
415
|
</mj-section>`;
|
|
406
416
|
}
|
|
@@ -420,10 +430,10 @@ function oe(e, t) {
|
|
|
420
430
|
return n ? `https://vumbnail.com/${n[1]}.jpg` : null;
|
|
421
431
|
}
|
|
422
432
|
function se(e, t) {
|
|
423
|
-
if (
|
|
433
|
+
if (O(e)) return "";
|
|
424
434
|
let n = oe(e.url, e.thumbnailUrl);
|
|
425
435
|
if (!n) return "";
|
|
426
|
-
let r =
|
|
436
|
+
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);
|
|
427
437
|
return `<mj-image
|
|
428
438
|
src="${x(n)}"
|
|
429
439
|
alt="${x(e.alt)}"
|
|
@@ -437,8 +447,8 @@ function se(e, t) {
|
|
|
437
447
|
}
|
|
438
448
|
//#endregion
|
|
439
449
|
//#region ../renderer/src/renderers/index.ts
|
|
440
|
-
function
|
|
441
|
-
return
|
|
450
|
+
function Z(e, m) {
|
|
451
|
+
return c(e) ? ie(e, m, Z) : o(e) ? j(e, m) : s(e) ? ne(e, m) : t(e) ? M(e, m) : r(e) ? N(e, m) : l(e) ? F(e, m) : i(e) ? I(e, m) : p(e) ? L(e, m) : u(e) ? R(e, m) : f(e) ? z(e, m) : a(e) ? U(e, m) : d(e) ? se(e, m) : n(e) ? re(e, m) : "";
|
|
442
452
|
}
|
|
443
453
|
//#endregion
|
|
444
454
|
//#region ../renderer/src/index.ts
|
|
@@ -448,73 +458,63 @@ var ce = /* @__PURE__ */ e({
|
|
|
448
458
|
convertMergeTagsToValues: () => C,
|
|
449
459
|
escapeAttr: () => x,
|
|
450
460
|
escapeHtml: () => b,
|
|
451
|
-
getCssClassAttr: () =>
|
|
452
|
-
getCssClasses: () =>
|
|
453
|
-
getWidthPercentages: () =>
|
|
454
|
-
getWidthPixels: () =>
|
|
455
|
-
isHiddenOnAll: () =>
|
|
456
|
-
renderBlock: () =>
|
|
457
|
-
renderToMjml: () =>
|
|
458
|
-
toPaddingString: () =>
|
|
461
|
+
getCssClassAttr: () => k,
|
|
462
|
+
getCssClasses: () => A,
|
|
463
|
+
getWidthPercentages: () => J,
|
|
464
|
+
getWidthPixels: () => Y,
|
|
465
|
+
isHiddenOnAll: () => O,
|
|
466
|
+
renderBlock: () => Z,
|
|
467
|
+
renderToMjml: () => le,
|
|
468
|
+
toPaddingString: () => E
|
|
459
469
|
});
|
|
460
|
-
async function
|
|
461
|
-
let n = t?.customFonts ?? [], r = t?.defaultFallbackFont ?? "Arial, sans-serif", i = t?.allowHtmlBlocks ?? !0, a =
|
|
470
|
+
async function le(e, t) {
|
|
471
|
+
let n = t?.customFonts ?? [], r = t?.defaultFallbackFont ?? "Arial, sans-serif", i = t?.allowHtmlBlocks ?? !0, a = fe(t?.socialIconsBaseUrl ?? h), o = await he(e, t?.renderCustomBlock), s = ge(e, t?.getCustomBlockStylesheet), c = new _(e.settings.width, n, r, i, o, a), l = Q(e.blocks, i), u = c.resolveFontFamily(e.settings.fontFamily), d = e.settings.backgroundColor, f = l.map((e) => ue(e, c)).filter((e) => e !== "").join("\n"), p = me(n), m = pe(e.settings.preheaderText);
|
|
462
472
|
return `<mjml lang="${x(e.settings.locale)}">
|
|
463
|
-
<mj-head>${
|
|
473
|
+
<mj-head>${m}
|
|
464
474
|
<mj-attributes>
|
|
465
|
-
<mj-all font-family="${
|
|
475
|
+
<mj-all font-family="${u}" />
|
|
466
476
|
<mj-text font-size="14px" />
|
|
467
477
|
<mj-section padding="0" />
|
|
468
478
|
<mj-column padding="0" />
|
|
469
479
|
<mj-image fluid-on-mobile="true" />
|
|
470
|
-
</mj-attributes>${
|
|
480
|
+
</mj-attributes>${p}
|
|
471
481
|
<mj-style>
|
|
472
482
|
a { color: inherit; text-decoration: none; }
|
|
473
483
|
@media only screen and (max-width: 480px) {
|
|
474
484
|
.tpl-hide-mobile { display: none !important; mso-hide: all !important; }
|
|
475
485
|
}
|
|
476
|
-
@media only screen and (min-width: 481px)
|
|
477
|
-
.tpl-hide-tablet { display: none !important; mso-hide: all !important; }
|
|
478
|
-
}
|
|
479
|
-
@media only screen and (min-width: 769px) {
|
|
486
|
+
@media only screen and (min-width: 481px) {
|
|
480
487
|
.tpl-hide-desktop { display: none !important; mso-hide: all !important; }
|
|
481
488
|
}
|
|
482
|
-
</mj-style
|
|
489
|
+
</mj-style>${_e(s)}
|
|
483
490
|
</mj-head>
|
|
484
|
-
<mj-body width="${
|
|
485
|
-
${
|
|
491
|
+
<mj-body width="${c.containerWidth}px" background-color="${d}">
|
|
492
|
+
${f}
|
|
486
493
|
</mj-body>
|
|
487
494
|
</mjml>`;
|
|
488
495
|
}
|
|
489
|
-
function
|
|
490
|
-
return
|
|
496
|
+
function ue(e, t) {
|
|
497
|
+
return c(e) ? X(e, Z(e, t)) : X(e, de(Z(e, t)));
|
|
491
498
|
}
|
|
492
|
-
function
|
|
493
|
-
if (t === "") return "";
|
|
494
|
-
let n = e.displayCondition;
|
|
495
|
-
return n ? `<mj-raw>${n.before}</mj-raw>
|
|
496
|
-
` + t + `
|
|
497
|
-
<mj-raw>${n.after}</mj-raw>` : t;
|
|
498
|
-
}
|
|
499
|
-
function ue(e) {
|
|
499
|
+
function de(e) {
|
|
500
500
|
return e === "" ? "" : `<mj-section>
|
|
501
501
|
<mj-column>
|
|
502
502
|
${e}
|
|
503
503
|
</mj-column>
|
|
504
504
|
</mj-section>`;
|
|
505
505
|
}
|
|
506
|
-
function
|
|
506
|
+
function fe(e) {
|
|
507
507
|
return e.endsWith("/") ? e.slice(0, -1) : e;
|
|
508
508
|
}
|
|
509
|
-
function
|
|
509
|
+
function pe(e) {
|
|
510
510
|
if (!e) return "";
|
|
511
511
|
let t = e.trim();
|
|
512
512
|
return t === "" ? "" : `\n <mj-preview>${b(t)}</mj-preview>`;
|
|
513
513
|
}
|
|
514
|
-
function
|
|
514
|
+
function me(e) {
|
|
515
515
|
return e.length === 0 ? "" : e.map((e) => `\n <mj-font name="${x(e.name)}" href="${x(e.url)}" />`).join("");
|
|
516
516
|
}
|
|
517
|
-
function
|
|
517
|
+
function Q(e, t) {
|
|
518
518
|
return t ? e : e.filter((e) => e.type !== "html");
|
|
519
519
|
}
|
|
520
520
|
async function he(e, t) {
|
|
@@ -527,15 +527,33 @@ async function he(e, t) {
|
|
|
527
527
|
return n;
|
|
528
528
|
}
|
|
529
529
|
function $(e, t) {
|
|
530
|
-
for (let
|
|
531
|
-
if (r
|
|
532
|
-
t.push(
|
|
530
|
+
for (let r of e) {
|
|
531
|
+
if (n(r)) {
|
|
532
|
+
t.push(r);
|
|
533
533
|
continue;
|
|
534
534
|
}
|
|
535
|
-
if (
|
|
535
|
+
if (c(r)) for (let e of r.children) $(e, t);
|
|
536
536
|
}
|
|
537
537
|
}
|
|
538
|
+
function ge(e, t) {
|
|
539
|
+
if (!t) return [];
|
|
540
|
+
let n = [];
|
|
541
|
+
if ($(e.blocks, n), n.length === 0) return [];
|
|
542
|
+
let r = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new Set(), a = [];
|
|
543
|
+
for (let e of n) {
|
|
544
|
+
if (r.has(e.customType)) continue;
|
|
545
|
+
r.add(e.customType);
|
|
546
|
+
let n = t(e.customType);
|
|
547
|
+
if (!n) continue;
|
|
548
|
+
let o = n.trim();
|
|
549
|
+
o === "" || i.has(o) || (i.add(o), a.push(o));
|
|
550
|
+
}
|
|
551
|
+
return a;
|
|
552
|
+
}
|
|
553
|
+
function _e(e) {
|
|
554
|
+
return e.length === 0 ? "" : e.map((e) => `\n <mj-style>\n${e}\n </mj-style>`).join("");
|
|
555
|
+
}
|
|
538
556
|
//#endregion
|
|
539
557
|
export { ce as t };
|
|
540
558
|
|
|
541
|
-
//# sourceMappingURL=renderer-
|
|
559
|
+
//# sourceMappingURL=renderer-m6XTCWCL.js.map
|