@boxcc/maildeno-editor 0.4.13 → 0.4.14
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/README.md +1 -0
- package/dist/{HealthIndicator-4Iw6N-g_.js → HealthIndicator-BLID6Ty0.js} +2 -2
- package/dist/{HealthIndicator-ZohgzF2_.js → HealthIndicator-DfzqzPNw.js} +1 -1
- package/dist/{PreviewCanvas-QN4C68KA.js → PreviewCanvas-D3SpILsV.js} +3 -3
- package/dist/{PreviewCanvas-DzpLghCo.js → PreviewCanvas-PtW1UL1J.js} +3 -3
- package/dist/{RichTextEditor-CmM4XRFC.js → RichTextEditor-D6DQqbJg.js} +2 -2
- package/dist/{RichTextEditor-Cz1-_ZtA.js → RichTextEditor-DDEfKPZm.js} +3 -3
- package/dist/RowPreviewChildren-BGnilx-K.js +4 -0
- package/dist/RowPreviewChildren-CalQWx1C.js +4 -0
- package/dist/{RowPreviewRow-DPaSbxmB.js → RowPreviewRow-C2XAe5Xs.js} +1 -1
- package/dist/{RowPreviewRow-Dx4ExtSN.js → RowPreviewRow-DG4AdMrv.js} +1 -1
- package/dist/{SavedRowsPanel-DqSHB6Jk.js → SavedRowsPanel-2JBfYdxN.js} +37 -37
- package/dist/{SavedRowsPanel-DyXjSOEt.js → SavedRowsPanel-B6_VHQZm.js} +33 -33
- package/dist/components/features/emailBuilder/EmailEditor.vue.d.ts +1 -0
- package/dist/{element-B3gq8Xvd.js → element-DQw3HLit.js} +4689 -4649
- package/dist/element.js +1 -1
- package/dist/index.js +4213 -4173
- package/dist/init.d.ts +2 -0
- package/dist/init.js +31 -25
- package/dist/{useEmailBuilder-BR4wfai1.js → useEmailBuilder-2yCUzRx2.js} +470 -460
- package/dist/{useEmailBuilder-B19p-2yp.js → useEmailBuilder-D3uV7dwL.js} +833 -823
- package/dist/{useToast-DD11IxqP.js → useToast-D1GgDMqQ.js} +7 -7
- package/package.json +1 -1
- package/dist/RowPreviewChildren-BYaMZID3.js +0 -4
- package/dist/RowPreviewChildren-_A9gPQCs.js +0 -4
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { F as dr, K as hn, M as ye, R as Ie, h as Ce, k as Oe, lt as pr, q as mr, st as
|
|
1
|
+
import { F as dr, K as hn, M as ye, R as Ie, h as Ce, k as Oe, lt as pr, q as mr, st as L } from "./vue.runtime.esm-bundler-D2AjRP90.js";
|
|
2
2
|
import { c as de, o as At, r as Y, s as ue, t as ee } from "./borderRadius-CkSa1lQ9.js";
|
|
3
|
-
var
|
|
3
|
+
var it = (e) => e.trim().toLowerCase().replace(/[^a-z0-9]+/g, "_").replace(/^_+|_+$/g, "") || "untitled_template";
|
|
4
4
|
function vn(e) {
|
|
5
5
|
if (!e || typeof e != "object") throw new Error("Unrecognized template file format");
|
|
6
6
|
if (e.template_id && e.template_name && e.canvas && e.rows && e.schema_version) {
|
|
@@ -14,7 +14,7 @@ function vn(e) {
|
|
|
14
14
|
if (e.meta && e.canvas && e.content?.rows) {
|
|
15
15
|
const t = e.meta.name || "Untitled Template";
|
|
16
16
|
return {
|
|
17
|
-
template_id:
|
|
17
|
+
template_id: it(t),
|
|
18
18
|
template_name: t,
|
|
19
19
|
canvas: e.canvas,
|
|
20
20
|
rows: e.content.rows,
|
|
@@ -22,7 +22,7 @@ function vn(e) {
|
|
|
22
22
|
};
|
|
23
23
|
}
|
|
24
24
|
if (e.canvas && e.content?.rows) return {
|
|
25
|
-
template_id:
|
|
25
|
+
template_id: it("Untitled Template"),
|
|
26
26
|
template_name: "Untitled Template",
|
|
27
27
|
canvas: e.canvas,
|
|
28
28
|
rows: e.content.rows,
|
|
@@ -31,7 +31,7 @@ function vn(e) {
|
|
|
31
31
|
if (!e.meta && e.canvasStyles && e.rows) {
|
|
32
32
|
const t = "Untitled Template";
|
|
33
33
|
return {
|
|
34
|
-
template_id:
|
|
34
|
+
template_id: it(t),
|
|
35
35
|
template_name: t,
|
|
36
36
|
canvas: e.canvasStyles,
|
|
37
37
|
rows: e.rows,
|
|
@@ -40,7 +40,7 @@ function vn(e) {
|
|
|
40
40
|
}
|
|
41
41
|
throw new Error("Unrecognized template file format");
|
|
42
42
|
}
|
|
43
|
-
var K = () => crypto.randomUUID().replace(/-/g, "").slice(0, 16), Se = "maildeno:product-rows",
|
|
43
|
+
var K = () => crypto.randomUUID().replace(/-/g, "").slice(0, 16), Se = "maildeno:product-rows", Pe = "maildeno:template:", kt = "maildeno:versions:", en = 20;
|
|
44
44
|
function bn(e) {
|
|
45
45
|
const t = JSON.parse(JSON.stringify(e));
|
|
46
46
|
return t.id = K(), t.type === "row" && Array.isArray(t.columns) && (t.columns = t.columns.map((r) => {
|
|
@@ -65,17 +65,17 @@ function De(e, t) {
|
|
|
65
65
|
}
|
|
66
66
|
function $n() {
|
|
67
67
|
async function e(s) {
|
|
68
|
-
return s ? fe(
|
|
68
|
+
return s ? fe(Pe + s) : null;
|
|
69
69
|
}
|
|
70
70
|
async function t(s, S) {
|
|
71
71
|
const C = S || K();
|
|
72
72
|
try {
|
|
73
|
-
const _ = fe(
|
|
73
|
+
const _ = fe(Pe + C);
|
|
74
74
|
_ && b(C, _);
|
|
75
75
|
} catch (_) {
|
|
76
76
|
console.warn("[maildeno-editor] couldn't record a template version:", _);
|
|
77
77
|
}
|
|
78
|
-
return De(
|
|
78
|
+
return De(Pe + C, {
|
|
79
79
|
...s,
|
|
80
80
|
updatedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
81
81
|
}), { templateId: C };
|
|
@@ -84,7 +84,7 @@ function $n() {
|
|
|
84
84
|
const s = [];
|
|
85
85
|
for (let S = 0; S < localStorage.length; S++) {
|
|
86
86
|
const C = localStorage.key(S);
|
|
87
|
-
if (!C?.startsWith(
|
|
87
|
+
if (!C?.startsWith(Pe)) continue;
|
|
88
88
|
const _ = fe(C);
|
|
89
89
|
s.push({
|
|
90
90
|
templateId: C.slice(18),
|
|
@@ -95,7 +95,7 @@ function $n() {
|
|
|
95
95
|
return s.sort((S, C) => (C.updatedAt ?? "").localeCompare(S.updatedAt ?? ""));
|
|
96
96
|
}
|
|
97
97
|
async function n(s) {
|
|
98
|
-
localStorage.removeItem(
|
|
98
|
+
localStorage.removeItem(Pe + s), localStorage.removeItem(kt + s);
|
|
99
99
|
}
|
|
100
100
|
function a(s) {
|
|
101
101
|
return fe(kt + s) ?? [];
|
|
@@ -112,7 +112,7 @@ function $n() {
|
|
|
112
112
|
async function c(s, S) {
|
|
113
113
|
i(s, a(s).filter((C) => C.versionId !== S));
|
|
114
114
|
}
|
|
115
|
-
async function
|
|
115
|
+
async function p(s) {
|
|
116
116
|
i(s, a(s).filter((S) => S.kept));
|
|
117
117
|
}
|
|
118
118
|
async function v(s, S, C) {
|
|
@@ -163,11 +163,11 @@ function $n() {
|
|
|
163
163
|
name: S.trim() || _.name
|
|
164
164
|
} : _));
|
|
165
165
|
}
|
|
166
|
-
function
|
|
166
|
+
function u(s) {
|
|
167
167
|
const S = (fe(Se) ?? []).find((C) => C.id === s);
|
|
168
168
|
return S ? bn(S.row) : null;
|
|
169
169
|
}
|
|
170
|
-
async function
|
|
170
|
+
async function d(s) {
|
|
171
171
|
return new Promise((S, C) => {
|
|
172
172
|
const _ = new FileReader();
|
|
173
173
|
_.onload = () => S(_.result), _.onerror = () => C(_.error), _.readAsDataURL(s);
|
|
@@ -181,15 +181,15 @@ function $n() {
|
|
|
181
181
|
listTemplateVersions: o,
|
|
182
182
|
getTemplateVersion: l,
|
|
183
183
|
deleteTemplateVersion: c,
|
|
184
|
-
deleteAllTemplateVersions:
|
|
184
|
+
deleteAllTemplateVersions: p,
|
|
185
185
|
setTemplateVersionKept: v,
|
|
186
186
|
listSavedRows: E,
|
|
187
187
|
listSystemSavedRows: w,
|
|
188
188
|
saveSavedRow: R,
|
|
189
189
|
deleteSavedRow: M,
|
|
190
190
|
renameSavedRow: O,
|
|
191
|
-
cloneSavedRowForCanvas:
|
|
192
|
-
uploadImage:
|
|
191
|
+
cloneSavedRowForCanvas: u,
|
|
192
|
+
uploadImage: d
|
|
193
193
|
};
|
|
194
194
|
}
|
|
195
195
|
var yn = /* @__PURE__ */ Symbol("maildeno-editor:storage-adapter");
|
|
@@ -204,14 +204,14 @@ var Sn = /* @__PURE__ */ Symbol("maildeno-editor:can-save");
|
|
|
204
204
|
function gr() {
|
|
205
205
|
return Oe(Sn, Ce(() => !0));
|
|
206
206
|
}
|
|
207
|
-
function
|
|
207
|
+
function Va(e) {
|
|
208
208
|
Ie(Sn, e);
|
|
209
209
|
}
|
|
210
210
|
var kn = /* @__PURE__ */ Symbol("maildeno-editor:has-template-library");
|
|
211
|
-
function
|
|
211
|
+
function Ka() {
|
|
212
212
|
return Oe(kn, !0);
|
|
213
213
|
}
|
|
214
|
-
function
|
|
214
|
+
function Ya(e) {
|
|
215
215
|
const t = fr(e);
|
|
216
216
|
return Ie(yn, t), Ie(kn, !e || typeof e.listTemplates == "function"), t;
|
|
217
217
|
}
|
|
@@ -219,23 +219,23 @@ var hr = () => {
|
|
|
219
219
|
const e = Oe(yn);
|
|
220
220
|
return e || (console.warn("[maildeno-editor] useStorageAdapter() couldn't find a provided adapter — falling back to the default localStorage adapter. If you passed a custom storageAdapter, it wasn't picked up; please report this."), $n());
|
|
221
221
|
}, wn = /* @__PURE__ */ Symbol("maildeno-editor:saved-row-capabilities");
|
|
222
|
-
function
|
|
222
|
+
function Xa(e) {
|
|
223
223
|
Ie(wn, e);
|
|
224
224
|
}
|
|
225
|
-
function
|
|
225
|
+
function Qa() {
|
|
226
226
|
return Oe(wn, Ce(() => ({})));
|
|
227
227
|
}
|
|
228
|
-
var dt = pr(null), Rt =
|
|
228
|
+
var dt = pr(null), Rt = L(!1);
|
|
229
229
|
function Ot() {
|
|
230
230
|
Rt.value = !1, setTimeout(() => {
|
|
231
231
|
Rt.value || (dt.value = null);
|
|
232
232
|
}, 200);
|
|
233
233
|
}
|
|
234
|
-
function
|
|
234
|
+
function Za() {
|
|
235
235
|
const e = dt.value;
|
|
236
236
|
Ot(), e?.accept?.();
|
|
237
237
|
}
|
|
238
|
-
function
|
|
238
|
+
function eo() {
|
|
239
239
|
const e = dt.value;
|
|
240
240
|
Ot(), e?.reject?.();
|
|
241
241
|
}
|
|
@@ -264,7 +264,7 @@ var _e = () => ({
|
|
|
264
264
|
}), $r = Object.freeze({
|
|
265
265
|
desktopHide: !1,
|
|
266
266
|
mobileHide: !1
|
|
267
|
-
}),
|
|
267
|
+
}), to = Object.freeze({
|
|
268
268
|
visibility: br,
|
|
269
269
|
...$r
|
|
270
270
|
}), wt = (e) => ({
|
|
@@ -281,7 +281,7 @@ var _e = () => ({
|
|
|
281
281
|
position: 100
|
|
282
282
|
}]
|
|
283
283
|
}
|
|
284
|
-
}),
|
|
284
|
+
}), Xe = () => ({
|
|
285
285
|
useGradient: !1,
|
|
286
286
|
solid: "transparent",
|
|
287
287
|
gradient: {
|
|
@@ -306,7 +306,7 @@ var _e = () => ({
|
|
|
306
306
|
fontStyle: "normal",
|
|
307
307
|
letterSpacing: 0,
|
|
308
308
|
backgroundColor: "transparent",
|
|
309
|
-
backgroundGradient:
|
|
309
|
+
backgroundGradient: Xe(),
|
|
310
310
|
margin: {
|
|
311
311
|
top: 0,
|
|
312
312
|
right: 0,
|
|
@@ -350,7 +350,7 @@ var _e = () => ({
|
|
|
350
350
|
fontFamily: "Arial",
|
|
351
351
|
letterSpacing: 0,
|
|
352
352
|
backgroundColor: "transparent",
|
|
353
|
-
backgroundGradient:
|
|
353
|
+
backgroundGradient: Xe(),
|
|
354
354
|
margin: {
|
|
355
355
|
top: 0,
|
|
356
356
|
right: 0,
|
|
@@ -465,7 +465,7 @@ var _e = () => ({
|
|
|
465
465
|
letterSpacing: 0,
|
|
466
466
|
color: "#111111",
|
|
467
467
|
backgroundColor: "transparent",
|
|
468
|
-
backgroundGradient:
|
|
468
|
+
backgroundGradient: Xe(),
|
|
469
469
|
margin: {
|
|
470
470
|
top: 0,
|
|
471
471
|
right: 0,
|
|
@@ -650,7 +650,7 @@ var _e = () => ({
|
|
|
650
650
|
textTransform: "none",
|
|
651
651
|
textDecoration: "none",
|
|
652
652
|
backgroundColor: "transparent",
|
|
653
|
-
backgroundGradient:
|
|
653
|
+
backgroundGradient: Xe(),
|
|
654
654
|
spacing: 16,
|
|
655
655
|
align: "center",
|
|
656
656
|
margin: {
|
|
@@ -730,7 +730,7 @@ var _e = () => ({
|
|
|
730
730
|
},
|
|
731
731
|
...ae()
|
|
732
732
|
}
|
|
733
|
-
} }),
|
|
733
|
+
} }), no = (e) => e.trim().toLowerCase().replace(/\s+/g, "_").replace(/[^a-z0-9_]/g, ""), ro = (e) => e.split("_").map((t) => t.charAt(0).toUpperCase() + t.slice(1)).join(" "), xn = () => `row_${K().slice(0, 4)}`, Fe = (e) => ({
|
|
734
734
|
useGradient: !1,
|
|
735
735
|
solid: e,
|
|
736
736
|
gradient: {
|
|
@@ -754,7 +754,7 @@ var _e = () => ({
|
|
|
754
754
|
};
|
|
755
755
|
return delete a.components, a;
|
|
756
756
|
})), t;
|
|
757
|
-
},
|
|
757
|
+
}, Qe = (e, t) => {
|
|
758
758
|
const r = zt(e);
|
|
759
759
|
if (r.type === "row-spacer") return r;
|
|
760
760
|
const n = e.name ?? xn(), a = new Set(t.map((l) => l.name));
|
|
@@ -807,12 +807,12 @@ var _e = () => ({
|
|
|
807
807
|
const r = t.children ?? t.components ?? [];
|
|
808
808
|
for (const n of r) ie(n);
|
|
809
809
|
}
|
|
810
|
-
},
|
|
810
|
+
}, st = (e) => {
|
|
811
811
|
if (e?.id && (re.delete(e.id), e.type === "row" && Array.isArray(e.columns)))
|
|
812
812
|
for (const t of e.columns) {
|
|
813
813
|
t?.id && re.delete(t.id);
|
|
814
814
|
const r = t.children ?? t.components ?? [];
|
|
815
|
-
for (const n of r)
|
|
815
|
+
for (const n of r) st(n);
|
|
816
816
|
}
|
|
817
817
|
}, Sr = (e, t, r, n, a = n) => {
|
|
818
818
|
re.size === 0 && Array.isArray(e.value) && e.value.length && tn(e.value);
|
|
@@ -962,7 +962,7 @@ var _e = () => ({
|
|
|
962
962
|
const m = e.value.findIndex((h) => h.id === g);
|
|
963
963
|
if (m !== -1) {
|
|
964
964
|
const [h] = e.value.splice(m, 1);
|
|
965
|
-
|
|
965
|
+
st(h), n("delete-row");
|
|
966
966
|
return;
|
|
967
967
|
}
|
|
968
968
|
for (const h of e.value)
|
|
@@ -971,11 +971,11 @@ var _e = () => ({
|
|
|
971
971
|
const y = he(x), $ = ve(y, g);
|
|
972
972
|
if ($) {
|
|
973
973
|
const [k] = $.parentChildren.splice($.index, 1);
|
|
974
|
-
|
|
974
|
+
st(k), n("delete-row");
|
|
975
975
|
return;
|
|
976
976
|
}
|
|
977
977
|
}
|
|
978
|
-
},
|
|
978
|
+
}, p = (g, m) => {
|
|
979
979
|
const h = e.value.findIndex((y) => y.id === g);
|
|
980
980
|
if (h !== -1) {
|
|
981
981
|
const y = m === "up" ? h - 1 : h + 1;
|
|
@@ -1060,7 +1060,7 @@ var _e = () => ({
|
|
|
1060
1060
|
}, w = (g) => {
|
|
1061
1061
|
const m = e.value.findIndex((h) => h.id === g);
|
|
1062
1062
|
if (m !== -1) {
|
|
1063
|
-
const h =
|
|
1063
|
+
const h = Qe(e.value[m], e.value);
|
|
1064
1064
|
e.value.splice(m + 1, 0, h);
|
|
1065
1065
|
const x = e.value[m + 1];
|
|
1066
1066
|
ie(x), n("duplicate-row");
|
|
@@ -1071,7 +1071,7 @@ var _e = () => ({
|
|
|
1071
1071
|
for (const x of h.columns) {
|
|
1072
1072
|
const y = he(x), $ = ve(y, g);
|
|
1073
1073
|
if ($) {
|
|
1074
|
-
const k =
|
|
1074
|
+
const k = Qe($.element, $.parentChildren);
|
|
1075
1075
|
$.parentChildren.splice($.index + 1, 0, k);
|
|
1076
1076
|
const A = $.parentChildren[$.index + 1];
|
|
1077
1077
|
ie(A), n("duplicate-row");
|
|
@@ -1081,7 +1081,7 @@ var _e = () => ({
|
|
|
1081
1081
|
}, R = (g) => {
|
|
1082
1082
|
const m = e.value.findIndex((h) => h.id === g);
|
|
1083
1083
|
if (m !== -1) {
|
|
1084
|
-
const h =
|
|
1084
|
+
const h = Qe(e.value[m], e.value);
|
|
1085
1085
|
e.value.splice(m + 1, 0, h);
|
|
1086
1086
|
const x = e.value[m + 1];
|
|
1087
1087
|
ie(x), n("duplicate-row-spacer");
|
|
@@ -1092,7 +1092,7 @@ var _e = () => ({
|
|
|
1092
1092
|
for (const x of h.columns) {
|
|
1093
1093
|
const y = he(x), $ = ve(y, g);
|
|
1094
1094
|
if ($) {
|
|
1095
|
-
const k =
|
|
1095
|
+
const k = Qe($.element, $.parentChildren);
|
|
1096
1096
|
$.parentChildren.splice($.index + 1, 0, k);
|
|
1097
1097
|
const A = $.parentChildren[$.index + 1];
|
|
1098
1098
|
ie(A), n("duplicate-row-spacer");
|
|
@@ -1127,18 +1127,18 @@ var _e = () => ({
|
|
|
1127
1127
|
A.splice(x, 0, k);
|
|
1128
1128
|
const f = A[x];
|
|
1129
1129
|
ie(f), t.value = f.id, n("add-component");
|
|
1130
|
-
},
|
|
1130
|
+
}, u = (g) => {
|
|
1131
1131
|
for (const m of e.value)
|
|
1132
1132
|
if (m.columns)
|
|
1133
1133
|
for (const h of m.columns) {
|
|
1134
1134
|
const x = he(h), y = ve(x, g);
|
|
1135
1135
|
if (y) {
|
|
1136
1136
|
const [$] = y.parentChildren.splice(y.index, 1);
|
|
1137
|
-
|
|
1137
|
+
st($), t.value === g && (t.value = null), n("delete-component");
|
|
1138
1138
|
return;
|
|
1139
1139
|
}
|
|
1140
1140
|
}
|
|
1141
|
-
},
|
|
1141
|
+
}, d = (g, m) => {
|
|
1142
1142
|
for (const h of e.value)
|
|
1143
1143
|
if (h.columns)
|
|
1144
1144
|
for (const x of h.columns) {
|
|
@@ -1188,7 +1188,7 @@ var _e = () => ({
|
|
|
1188
1188
|
addNestedRow: o,
|
|
1189
1189
|
findRow: l,
|
|
1190
1190
|
deleteRow: c,
|
|
1191
|
-
moveRow:
|
|
1191
|
+
moveRow: p,
|
|
1192
1192
|
moveNestedRow: v,
|
|
1193
1193
|
reorderRows: b,
|
|
1194
1194
|
addSpacer: E,
|
|
@@ -1196,8 +1196,8 @@ var _e = () => ({
|
|
|
1196
1196
|
duplicateRowSpacer: R,
|
|
1197
1197
|
addComponent: M,
|
|
1198
1198
|
addComponentAtIndex: O,
|
|
1199
|
-
deleteComponent:
|
|
1200
|
-
moveComponent:
|
|
1199
|
+
deleteComponent: u,
|
|
1200
|
+
moveComponent: d,
|
|
1201
1201
|
moveComponentBetweenColumns: s,
|
|
1202
1202
|
findComponent: S,
|
|
1203
1203
|
updateComponent: (g, m) => {
|
|
@@ -1221,7 +1221,7 @@ var _e = () => ({
|
|
|
1221
1221
|
rebuildIdRegistry: () => tn(e.value)
|
|
1222
1222
|
};
|
|
1223
1223
|
}, Z = null, kr = 600, xt = (e) => JSON.parse(JSON.stringify(e)), wr = () => {
|
|
1224
|
-
const t =
|
|
1224
|
+
const t = L([]), r = L(-1), n = L(0), a = Ce(() => r.value > 0), i = Ce(() => r.value < t.value.length - 1), o = Ce(() => `${r.value + 1} / ${t.value.length}`), l = (E, w = "change", R = !1) => {
|
|
1225
1225
|
const M = () => {
|
|
1226
1226
|
Z = null, r.value < t.value.length - 1 && (t.value = t.value.slice(0, r.value + 1)), t.value.push({
|
|
1227
1227
|
state: xt(E),
|
|
@@ -1230,7 +1230,7 @@ var _e = () => ({
|
|
|
1230
1230
|
}), r.value++, t.value.length > 100 && (t.value.shift(), r.value--), n.value++;
|
|
1231
1231
|
};
|
|
1232
1232
|
R ? (Z && (clearTimeout(Z), Z = null), M()) : (Z && clearTimeout(Z), Z = setTimeout(M, kr));
|
|
1233
|
-
}, c = () => a.value ? (Z && (clearTimeout(Z), Z = null), r.value--, n.value++, xt(t.value[r.value].state)) : null,
|
|
1233
|
+
}, c = () => a.value ? (Z && (clearTimeout(Z), Z = null), r.value--, n.value++, xt(t.value[r.value].state)) : null, p = () => i.value ? (Z && (clearTimeout(Z), Z = null), r.value++, n.value++, xt(t.value[r.value].state)) : null, v = () => {
|
|
1234
1234
|
t.value = [], r.value = -1, n.value++;
|
|
1235
1235
|
};
|
|
1236
1236
|
return {
|
|
@@ -1239,7 +1239,7 @@ var _e = () => ({
|
|
|
1239
1239
|
historyStatus: o,
|
|
1240
1240
|
saveState: l,
|
|
1241
1241
|
undo: c,
|
|
1242
|
-
redo:
|
|
1242
|
+
redo: p,
|
|
1243
1243
|
clearHistory: v,
|
|
1244
1244
|
initHistory: (E) => {
|
|
1245
1245
|
v(), l(E, "initial");
|
|
@@ -1253,7 +1253,7 @@ var _e = () => ({
|
|
|
1253
1253
|
rows: R.value,
|
|
1254
1254
|
canvasStyles: M.value
|
|
1255
1255
|
}),
|
|
1256
|
-
restoreState: (R, M, O,
|
|
1256
|
+
restoreState: (R, M, O, u, d, s) => {
|
|
1257
1257
|
if (!R) return;
|
|
1258
1258
|
M.value = R.rows, O.value = R.canvasStyles;
|
|
1259
1259
|
const S = /* @__PURE__ */ new Set(), C = (_) => {
|
|
@@ -1262,7 +1262,7 @@ var _e = () => ({
|
|
|
1262
1262
|
for (const m of g.columns)
|
|
1263
1263
|
m?.id && S.add(String(m.id)), C(m.children ?? m.components ?? []);
|
|
1264
1264
|
};
|
|
1265
|
-
if (C(R.rows),
|
|
1265
|
+
if (C(R.rows), u.value && !S.has(String(u.value)) && (u.value = null), d.value && !S.has(String(d.value)) && (d.value = null), s.value) {
|
|
1266
1266
|
const { rowId: _, columnId: g } = s.value;
|
|
1267
1267
|
(!S.has(String(_)) || !S.has(String(g))) && (s.value = null);
|
|
1268
1268
|
}
|
|
@@ -1286,7 +1286,7 @@ var _e = () => ({
|
|
|
1286
1286
|
},
|
|
1287
1287
|
version: l
|
|
1288
1288
|
};
|
|
1289
|
-
}, Cr = (e) => e == null,
|
|
1289
|
+
}, Cr = (e) => e == null, Lt = (e) => {
|
|
1290
1290
|
if (!e || typeof e != "object") return !0;
|
|
1291
1291
|
const t = e;
|
|
1292
1292
|
return Array.isArray(t.rules) && t.rules.length > 0 ? !1 : t.enabled === !1 && t.match === "all" && t.rules.length === 0;
|
|
@@ -1294,7 +1294,7 @@ var _e = () => ({
|
|
|
1294
1294
|
if (!e || typeof e != "object") return !0;
|
|
1295
1295
|
const t = e;
|
|
1296
1296
|
return !t.sides && t.width === 0 && t.style === "solid" && t.color === "#000000" && (t.radius === void 0 || t.radius === 0);
|
|
1297
|
-
},
|
|
1297
|
+
}, qe = (e) => !e || typeof e != "object" ? !0 : e.useGradient === !1, nn = (e) => e === !1, _r = (e) => {
|
|
1298
1298
|
if (!e || typeof e != "object") return !0;
|
|
1299
1299
|
const t = e;
|
|
1300
1300
|
return t.top === 0 && t.right === 0 && t.bottom === 0 && t.left === 0;
|
|
@@ -1310,7 +1310,7 @@ var _e = () => ({
|
|
|
1310
1310
|
}, Er = (e) => {
|
|
1311
1311
|
const t = {};
|
|
1312
1312
|
for (const [r, n] of Object.entries(e))
|
|
1313
|
-
Cr(n) || r === "backgroundGradient" &&
|
|
1313
|
+
Cr(n) || r === "backgroundGradient" && qe(n) || (t[r] = n);
|
|
1314
1314
|
return Object.keys(t).length > 0 ? t : void 0;
|
|
1315
1315
|
}, Mr = (e) => {
|
|
1316
1316
|
const t = { ...e.props };
|
|
@@ -1318,7 +1318,7 @@ var _e = () => ({
|
|
|
1318
1318
|
const r = Er(e.props.mobile);
|
|
1319
1319
|
r ? t.mobile = r : delete t.mobile;
|
|
1320
1320
|
}
|
|
1321
|
-
if (
|
|
1321
|
+
if (Lt(e.props.visibility) && delete t.visibility, nn(e.props.desktopHide) && delete t.desktopHide, nn(e.props.mobileHide) && delete t.mobileHide, _r(e.props.margin) && delete t.margin, pt(e.props.padding) && delete t.padding, qe(e.props.backgroundGradient) && delete t.backgroundGradient, Tr(e.props.letterSpacing) && delete t.letterSpacing, e.props.backgroundImage || (delete t.backgroundImage, delete t.backgroundSize, delete t.backgroundPosition, delete t.backgroundRepeat), "icon" in e.props && Ar(e.props.icon) && (delete t.icon, delete t.iconAlt, delete t.iconPosition, delete t.iconSize, delete t.iconGap), "platforms" in e.props) {
|
|
1322
1322
|
const r = Rr(e.props.platforms);
|
|
1323
1323
|
r === void 0 ? delete t.platforms : t.platforms = r;
|
|
1324
1324
|
}
|
|
@@ -1330,7 +1330,7 @@ var _e = () => ({
|
|
|
1330
1330
|
};
|
|
1331
1331
|
}, Ir = (e) => e.type === "component" ? Mr(e) : _n(e), Nr = (e) => {
|
|
1332
1332
|
const { id: t, width: r, children: n, components: a, ...i } = e, o = { ...i };
|
|
1333
|
-
Cn(e.border) && delete o.border,
|
|
1333
|
+
Cn(e.border) && delete o.border, qe(e.backgroundGradient) && delete o.backgroundGradient, pt(e.padding) && delete o.padding, e.backgroundImage || (delete o.backgroundImage, delete o.backgroundSize, delete o.backgroundPosition, delete o.backgroundRepeat);
|
|
1334
1334
|
const l = (n ?? a ?? []).map(Ir);
|
|
1335
1335
|
return {
|
|
1336
1336
|
id: t,
|
|
@@ -1340,7 +1340,7 @@ var _e = () => ({
|
|
|
1340
1340
|
};
|
|
1341
1341
|
}, Br = (e) => {
|
|
1342
1342
|
const { id: t, type: r, ...n } = e, a = { ...n };
|
|
1343
|
-
|
|
1343
|
+
Lt(e.visibility) && delete a.visibility, qe(e.backgroundGradient) && delete a.backgroundGradient;
|
|
1344
1344
|
const { height: i, ...o } = a;
|
|
1345
1345
|
return {
|
|
1346
1346
|
id: t,
|
|
@@ -1351,7 +1351,7 @@ var _e = () => ({
|
|
|
1351
1351
|
}, _n = (e) => {
|
|
1352
1352
|
if (e.type === "row-spacer") return Br(e);
|
|
1353
1353
|
const { id: t, type: r, name: n, columns: a, ...i } = e, o = { ...i };
|
|
1354
|
-
return
|
|
1354
|
+
return Lt(e.visibility) && delete o.visibility, Cn(e.border) && delete o.border, qe(e.backgroundGradient) && delete o.backgroundGradient, pt(e.padding) && delete o.padding, e.backgroundImage || (delete o.backgroundImage, delete o.backgroundSize, delete o.backgroundPosition, delete o.backgroundRepeat), e.minHeight === 0 && delete o.minHeight, {
|
|
1355
1355
|
id: t,
|
|
1356
1356
|
type: r,
|
|
1357
1357
|
...n !== void 0 && { name: n },
|
|
@@ -1450,7 +1450,7 @@ var _e = () => ({
|
|
|
1450
1450
|
radius: 0
|
|
1451
1451
|
},
|
|
1452
1452
|
verticalAlign: "top"
|
|
1453
|
-
},
|
|
1453
|
+
}, Lr = {
|
|
1454
1454
|
language: "en-US",
|
|
1455
1455
|
preheaderText: "View this email in your browser",
|
|
1456
1456
|
bodyBackgroundColor: "#f9fafb",
|
|
@@ -1467,8 +1467,8 @@ var _e = () => ({
|
|
|
1467
1467
|
left: 0
|
|
1468
1468
|
},
|
|
1469
1469
|
mobileBreakpoint: 600
|
|
1470
|
-
},
|
|
1471
|
-
const r =
|
|
1470
|
+
}, Pr = (e) => JSON.parse(JSON.stringify(e)), je = (e, t) => {
|
|
1471
|
+
const r = Pr(e);
|
|
1472
1472
|
for (const n of Object.keys(t)) {
|
|
1473
1473
|
const a = t[n], i = e[n];
|
|
1474
1474
|
a != null && (typeof a == "object" && !Array.isArray(a) && typeof i == "object" && i !== null && !Array.isArray(i) ? r[n] = je(i, a) : r[n] = a);
|
|
@@ -1502,9 +1502,9 @@ var _e = () => ({
|
|
|
1502
1502
|
}) : Rn(e);
|
|
1503
1503
|
}, Fr = (e) => {
|
|
1504
1504
|
const t = e.children ?? e.components ?? [], { components: r, children: n, ...a } = e, i = e.backgroundColor !== void 0 || e.backgroundGradient !== void 0 || e.backgroundImage !== void 0, { backgroundColor: o, backgroundGradient: l, ...c } = zr;
|
|
1505
|
-
let
|
|
1506
|
-
return i ? (
|
|
1507
|
-
...
|
|
1505
|
+
let p = je(c, a);
|
|
1506
|
+
return i ? (p.backgroundColor = e.backgroundColor, p.backgroundGradient = e.backgroundGradient) : (p.backgroundColor = o, p.backgroundGradient = l), e.backgroundImage || (p.backgroundImage = "", p.backgroundSize = "cover", p.backgroundPosition = "center center", p.backgroundRepeat = "no-repeat"), {
|
|
1507
|
+
...p,
|
|
1508
1508
|
children: t.map(Dr)
|
|
1509
1509
|
};
|
|
1510
1510
|
}, Hr = (e) => {
|
|
@@ -1516,7 +1516,7 @@ var _e = () => ({
|
|
|
1516
1516
|
let l = je(o, r);
|
|
1517
1517
|
return n ? (l.backgroundColor = e.backgroundColor, l.backgroundGradient = e.backgroundGradient) : (l.backgroundColor = a, l.backgroundGradient = i), e.backgroundImage || (l.backgroundImage = "", l.backgroundSize = "cover", l.backgroundPosition = "center center", l.backgroundRepeat = "no-repeat"), l.minHeight === void 0 && (l.minHeight = 0), Array.isArray(t) && (l.columns = t.map(Fr)), l;
|
|
1518
1518
|
}, ct = (e) => {
|
|
1519
|
-
const t = je(
|
|
1519
|
+
const t = je(Lr, e);
|
|
1520
1520
|
return e.bodyBackgroundImage || (t.bodyBackgroundImage = "", t.bodyBackgroundSize = "cover", t.bodyBackgroundPosition = "center center", t.bodyBackgroundRepeat = "no-repeat"), t;
|
|
1521
1521
|
}, ut = (e) => e.map(Rn), ge = "maildeno:autosave", Mt = "1.0", an = (e, t, r = null, n, a) => {
|
|
1522
1522
|
const i = Date.now();
|
|
@@ -1534,13 +1534,13 @@ var _e = () => ({
|
|
|
1534
1534
|
}
|
|
1535
1535
|
};
|
|
1536
1536
|
}, Ct = null, Ur = () => {
|
|
1537
|
-
const e =
|
|
1537
|
+
const e = L("idle"), t = L(null);
|
|
1538
1538
|
return {
|
|
1539
|
-
saveToLocal: (l, c,
|
|
1539
|
+
saveToLocal: (l, c, p = null, v, b) => {
|
|
1540
1540
|
e.value = "saving";
|
|
1541
1541
|
const E = () => {
|
|
1542
1542
|
try {
|
|
1543
|
-
const w = an(l, c,
|
|
1543
|
+
const w = an(l, c, p, v, b);
|
|
1544
1544
|
localStorage.setItem(ge, JSON.stringify(w)), t.value = /* @__PURE__ */ new Date(), Ct && clearTimeout(Ct), e.value = "saved", Ct = setTimeout(() => {
|
|
1545
1545
|
e.value = "idle";
|
|
1546
1546
|
}, 2500);
|
|
@@ -1552,9 +1552,9 @@ var _e = () => ({
|
|
|
1552
1552
|
};
|
|
1553
1553
|
typeof window < "u" && "requestIdleCallback" in window ? window.requestIdleCallback(E, { timeout: 2e3 }) : setTimeout(E, 0);
|
|
1554
1554
|
},
|
|
1555
|
-
flushSave: (l, c,
|
|
1555
|
+
flushSave: (l, c, p = null, v, b) => {
|
|
1556
1556
|
try {
|
|
1557
|
-
const E = an(l, c,
|
|
1557
|
+
const E = an(l, c, p, v, b);
|
|
1558
1558
|
localStorage.setItem(ge, JSON.stringify(E)), t.value = /* @__PURE__ */ new Date();
|
|
1559
1559
|
} catch {
|
|
1560
1560
|
}
|
|
@@ -1583,8 +1583,8 @@ var _e = () => ({
|
|
|
1583
1583
|
try {
|
|
1584
1584
|
const c = localStorage.getItem(ge);
|
|
1585
1585
|
if (!c) return !1;
|
|
1586
|
-
const
|
|
1587
|
-
return !(Date.now() >
|
|
1586
|
+
const p = JSON.parse(c);
|
|
1587
|
+
return !(Date.now() > p.expiresAt || l !== void 0 && p.templateId !== l);
|
|
1588
1588
|
} catch {
|
|
1589
1589
|
return !1;
|
|
1590
1590
|
}
|
|
@@ -1592,12 +1592,12 @@ var _e = () => ({
|
|
|
1592
1592
|
saveStatus: e,
|
|
1593
1593
|
lastSaved: t
|
|
1594
1594
|
};
|
|
1595
|
-
},
|
|
1595
|
+
}, Pt = (e) => !e || /\{\{.*?\}\}/.test(e) || /^(https?:\/\/|mailto:|tel:)/i.test(e) ? e : `https://${e}`, Dt = (e) => e == null ? "" : String(e).replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'"), Ft = (e) => e == null ? "" : String(e).replace(/&/g, "&").replace(/"/g, """).replace(/</g, "<").replace(/>/g, ">"), Jr = (e) => {
|
|
1596
1596
|
if (e == null) return "";
|
|
1597
1597
|
const t = String(e);
|
|
1598
1598
|
return t.indexOf(""") === -1 ? t : t.replace(/style="([^"]*)"/g, (r, n) => `style="${n.replace(/"/g, "'")}"`);
|
|
1599
1599
|
}, Ht = /* @__PURE__ */ new Map();
|
|
1600
|
-
function
|
|
1600
|
+
function ao(e, t) {
|
|
1601
1601
|
const r = typeof e == "string" ? t : e;
|
|
1602
1602
|
if (!r) {
|
|
1603
1603
|
console.error("[maildeno-editor] registerBlock was called without a definition.");
|
|
@@ -1616,7 +1616,7 @@ function ro(e, t) {
|
|
|
1616
1616
|
function Ut(e) {
|
|
1617
1617
|
return Ht.get(e);
|
|
1618
1618
|
}
|
|
1619
|
-
function
|
|
1619
|
+
function oo() {
|
|
1620
1620
|
return Ht;
|
|
1621
1621
|
}
|
|
1622
1622
|
var Gr = () => {
|
|
@@ -1625,8 +1625,8 @@ var Gr = () => {
|
|
|
1625
1625
|
const b = n && typeof n == "object" && n.solid ? n.solid : a;
|
|
1626
1626
|
return !b || b === "transparent" ? "" : `background-color:${b};`;
|
|
1627
1627
|
}
|
|
1628
|
-
const { type: i, direction: o, colors: l } = n.gradient, c = l.map((b) => `${b.color} ${b.position}%`).join(", "),
|
|
1629
|
-
return `${v && v !== "transparent" ? `background-color:${v};` : ""}background:${
|
|
1628
|
+
const { type: i, direction: o, colors: l } = n.gradient, c = l.map((b) => `${b.color} ${b.position}%`).join(", "), p = i === "radial" ? `radial-gradient(circle at center, ${c})` : `linear-gradient(${o}, ${c})`, v = n.solid || a || "";
|
|
1629
|
+
return `${v && v !== "transparent" ? `background-color:${v};` : ""}background:${p};`;
|
|
1630
1630
|
}, t = (n, a) => n?.useGradient === !0 && Array.isArray(n?.gradient?.colors) && n.gradient.colors.length >= 2 ? {
|
|
1631
1631
|
vmlOpen: `
|
|
1632
1632
|
<!--[if mso]>
|
|
@@ -1647,17 +1647,17 @@ var Gr = () => {
|
|
|
1647
1647
|
return { generateHTMLComponent: (n) => {
|
|
1648
1648
|
const a = n.componentType ?? n.type, { props: i } = n;
|
|
1649
1649
|
let o = "";
|
|
1650
|
-
const l = `eb-${n.id}`, c = i.margin ? `margin:${i.margin?.top ?? 0}px ${i.margin?.right ?? 0}px ${i.margin?.bottom ?? 0}px ${i.margin?.left ?? 0}px;` : "",
|
|
1650
|
+
const l = `eb-${n.id}`, c = i.margin ? `margin:${i.margin?.top ?? 0}px ${i.margin?.right ?? 0}px ${i.margin?.bottom ?? 0}px ${i.margin?.left ?? 0}px;` : "", p = i.padding ? `padding:${i.padding?.top ?? 0}px ${i.padding?.right ?? 0}px ${i.padding?.bottom ?? 0}px ${i.padding?.left ?? 0}px;` : "", v = (E, w, R) => {
|
|
1651
1651
|
const M = [R ? `${l}-${R}` : l];
|
|
1652
1652
|
return E && M.push("desktop-hide"), w && M.push("mobile-hide"), M.join(" ");
|
|
1653
1653
|
}, b = Ut(a);
|
|
1654
1654
|
return b ? b.renderEmail.html(i, {
|
|
1655
1655
|
uid: l,
|
|
1656
1656
|
marginStyle: c,
|
|
1657
|
-
paddingStyle:
|
|
1657
|
+
paddingStyle: p,
|
|
1658
1658
|
escapeHtml: Dt,
|
|
1659
1659
|
escapeAttr: Ft,
|
|
1660
|
-
safeUrl:
|
|
1660
|
+
safeUrl: Pt,
|
|
1661
1661
|
resolveBgCss: e,
|
|
1662
1662
|
resolveBgVml: t,
|
|
1663
1663
|
getResponsiveClasses: v,
|
|
@@ -1681,13 +1681,13 @@ var Gr = () => {
|
|
|
1681
1681
|
const v = r && typeof r == "object" && r.solid ? r.solid : n;
|
|
1682
1682
|
return !v || v === "transparent" ? "" : `background-color:${v};`;
|
|
1683
1683
|
}
|
|
1684
|
-
const { type: a, direction: i, colors: o } = r.gradient, l = o.map((v) => `${v.color} ${v.position}%`).join(", "), c = a === "radial" ? `radial-gradient(circle at center, ${l})` : `linear-gradient(${i}, ${l})`,
|
|
1685
|
-
return `${
|
|
1684
|
+
const { type: a, direction: i, colors: o } = r.gradient, l = o.map((v) => `${v.color} ${v.position}%`).join(", "), c = a === "radial" ? `radial-gradient(circle at center, ${l})` : `linear-gradient(${i}, ${l})`, p = r.solid || n || "";
|
|
1685
|
+
return `${p && p !== "transparent" ? `background-color:${p};` : ""}background:${c};`;
|
|
1686
1686
|
};
|
|
1687
1687
|
return { generateReactEmailComponent: (r) => {
|
|
1688
1688
|
const n = r.componentType ?? r.type, { props: a } = r;
|
|
1689
1689
|
let i = "";
|
|
1690
|
-
const o = `eb-${r.id}`, l = a.margin ? `margin:${a.margin?.top ?? 0}px ${a.margin?.right ?? 0}px ${a.margin?.bottom ?? 0}px ${a.margin?.left ?? 0}px;` : "", c = a.padding ? `padding:${a.padding?.top ?? 0}px ${a.padding?.right ?? 0}px ${a.padding?.bottom ?? 0}px ${a.padding?.left ?? 0}px;` : "",
|
|
1690
|
+
const o = `eb-${r.id}`, l = a.margin ? `margin:${a.margin?.top ?? 0}px ${a.margin?.right ?? 0}px ${a.margin?.bottom ?? 0}px ${a.margin?.left ?? 0}px;` : "", c = a.padding ? `padding:${a.padding?.top ?? 0}px ${a.padding?.right ?? 0}px ${a.padding?.bottom ?? 0}px ${a.padding?.left ?? 0}px;` : "", p = (E, w) => E?.useGradient === !0 && Array.isArray(E?.gradient?.colors) && E.gradient.colors.length >= 2 ? {
|
|
1691
1691
|
vmlOpen: "",
|
|
1692
1692
|
vmlClose: ""
|
|
1693
1693
|
} : {
|
|
@@ -1703,9 +1703,9 @@ var Gr = () => {
|
|
|
1703
1703
|
paddingStyle: c,
|
|
1704
1704
|
escapeHtml: Dt,
|
|
1705
1705
|
escapeAttr: Ft,
|
|
1706
|
-
safeUrl:
|
|
1706
|
+
safeUrl: Pt,
|
|
1707
1707
|
resolveBgCss: e,
|
|
1708
|
-
resolveBgVml:
|
|
1708
|
+
resolveBgVml: p,
|
|
1709
1709
|
getResponsiveClasses: v,
|
|
1710
1710
|
react: {
|
|
1711
1711
|
parseCssString: Xr,
|
|
@@ -1750,7 +1750,7 @@ var Nn = () => {
|
|
|
1750
1750
|
const R = o && typeof o == "object" && o.solid ? o.solid : l;
|
|
1751
1751
|
return !R || R === "transparent" ? "" : `background-color:${R};`;
|
|
1752
1752
|
}
|
|
1753
|
-
const { type: c, direction:
|
|
1753
|
+
const { type: c, direction: p, colors: v } = o.gradient, b = v.map((R) => `${R.color} ${R.position}%`).join(", "), E = c === "radial" ? `radial-gradient(circle at center, ${b})` : `linear-gradient(${p}, ${b})`, w = o.solid || l || "";
|
|
1754
1754
|
return `${w && w !== "transparent" ? `background-color:${w};` : ""}background:${E};`;
|
|
1755
1755
|
}, t = (o, l) => o?.useGradient === !0 && Array.isArray(o?.gradient?.colors) && o.gradient.colors.length >= 2 ? {
|
|
1756
1756
|
vmlOpen: `
|
|
@@ -1771,26 +1771,26 @@ var Nn = () => {
|
|
|
1771
1771
|
}, r = (o, l) => o && typeof o == "object" && o.solid && o.solid !== "transparent" ? o.solid : l && l !== "transparent" ? l : "", n = (o) => o ? `${o.top ?? 0}px ${o.right ?? 0}px ${o.bottom ?? 0}px ${o.left ?? 0}px` : "0px";
|
|
1772
1772
|
return {
|
|
1773
1773
|
generateMJMLComponent: (o) => {
|
|
1774
|
-
const l = o.componentType ?? o.type, { props: c } = o,
|
|
1775
|
-
const
|
|
1776
|
-
return R &&
|
|
1774
|
+
const l = o.componentType ?? o.type, { props: c } = o, p = `eb-${o.id}`, v = c.margin ? `margin:${c.margin?.top ?? 0}px ${c.margin?.right ?? 0}px ${c.margin?.bottom ?? 0}px ${c.margin?.left ?? 0}px;` : "", b = c.padding ? `padding:${c.padding?.top ?? 0}px ${c.padding?.right ?? 0}px ${c.padding?.bottom ?? 0}px ${c.padding?.left ?? 0}px;` : "", E = (R, M, O) => {
|
|
1775
|
+
const u = [O ? `${p}-${O}` : p];
|
|
1776
|
+
return R && u.push("desktop-hide"), M && u.push("mobile-hide"), u.join(" ");
|
|
1777
1777
|
}, w = Ut(l);
|
|
1778
1778
|
return w ? w.renderEmail.mjml(c, {
|
|
1779
|
-
uid:
|
|
1779
|
+
uid: p,
|
|
1780
1780
|
marginStyle: v,
|
|
1781
1781
|
paddingStyle: b,
|
|
1782
1782
|
escapeHtml: Dt,
|
|
1783
1783
|
escapeAttr: Ft,
|
|
1784
|
-
safeUrl:
|
|
1784
|
+
safeUrl: Pt,
|
|
1785
1785
|
resolveBgCss: e,
|
|
1786
1786
|
resolveBgVml: t,
|
|
1787
1787
|
getResponsiveClasses: E,
|
|
1788
1788
|
react: null
|
|
1789
1789
|
}) : "";
|
|
1790
1790
|
},
|
|
1791
|
-
assembleMJML: (o, l, c,
|
|
1792
|
-
const w =
|
|
1793
|
-
@import url('${
|
|
1791
|
+
assembleMJML: (o, l, c, p, v, b = 600, E = "") => {
|
|
1792
|
+
const w = p ? `<mj-style inline="false">
|
|
1793
|
+
@import url('${p}');
|
|
1794
1794
|
</mj-style>` : "", R = `<mj-style inline="false">
|
|
1795
1795
|
.desktop-hide { display: none !important; }
|
|
1796
1796
|
ul li:last-child, ol li:last-child { margin-bottom: 0 !important; }
|
|
@@ -1800,7 +1800,7 @@ ${E}
|
|
|
1800
1800
|
@media only screen and (max-width:${b}px) {
|
|
1801
1801
|
${v}
|
|
1802
1802
|
}
|
|
1803
|
-
</mj-style>` : "",
|
|
1803
|
+
</mj-style>` : "", u = c.bodyBackgroundColor || "#ffffff", d = c.bodyBackgroundImage ? [
|
|
1804
1804
|
`background-url="${c.bodyBackgroundImage}"`,
|
|
1805
1805
|
`background-size="${c.bodyBackgroundSize || "cover"}"`,
|
|
1806
1806
|
`background-position="${c.bodyBackgroundPosition || "center center"}"`,
|
|
@@ -1823,8 +1823,8 @@ ${v}
|
|
|
1823
1823
|
${M}
|
|
1824
1824
|
${O}
|
|
1825
1825
|
</mj-head>
|
|
1826
|
-
<mj-body background-color="${
|
|
1827
|
-
<mj-wrapper full-width="full-width" ${
|
|
1826
|
+
<mj-body background-color="${u}" width="${c.width ?? 600}px">
|
|
1827
|
+
<mj-wrapper full-width="full-width" ${d} padding="0">
|
|
1828
1828
|
<mj-section background-color="${s}" padding="${S}">
|
|
1829
1829
|
${l}
|
|
1830
1830
|
</mj-section>
|
|
@@ -1836,7 +1836,7 @@ ${l}
|
|
|
1836
1836
|
padAttr: n
|
|
1837
1837
|
};
|
|
1838
1838
|
}, Bn = /* @__PURE__ */ Symbol("maildeno-editor:info-dialog");
|
|
1839
|
-
function
|
|
1839
|
+
function io() {
|
|
1840
1840
|
const e = On();
|
|
1841
1841
|
return Ie(Bn, e), e;
|
|
1842
1842
|
}
|
|
@@ -1845,7 +1845,7 @@ var ea = () => {
|
|
|
1845
1845
|
return e || (console.warn("[maildeno-editor] useInfoDialog() couldn't find a provided instance — falling back to a standalone instance (open() won't visibly show anything)."), On());
|
|
1846
1846
|
};
|
|
1847
1847
|
function On() {
|
|
1848
|
-
const e =
|
|
1848
|
+
const e = L(!1), t = L("Info"), r = L("");
|
|
1849
1849
|
return {
|
|
1850
1850
|
visible: e,
|
|
1851
1851
|
header: t,
|
|
@@ -1855,16 +1855,16 @@ function On() {
|
|
|
1855
1855
|
}
|
|
1856
1856
|
};
|
|
1857
1857
|
}
|
|
1858
|
-
var
|
|
1858
|
+
var so = ["is_empty", "is_not_empty"], lo = ["in", "not_in"], co = [
|
|
1859
1859
|
">",
|
|
1860
1860
|
"<",
|
|
1861
1861
|
">=",
|
|
1862
1862
|
"<="
|
|
1863
|
-
],
|
|
1863
|
+
], uo = [
|
|
1864
1864
|
"date_before",
|
|
1865
1865
|
"date_after",
|
|
1866
1866
|
"date_on"
|
|
1867
|
-
],
|
|
1867
|
+
], po = [
|
|
1868
1868
|
{
|
|
1869
1869
|
label: "Equals ==",
|
|
1870
1870
|
value: "=="
|
|
@@ -1933,7 +1933,7 @@ var io = ["is_empty", "is_not_empty"], so = ["in", "not_in"], lo = [
|
|
|
1933
1933
|
label: "Is Not Empty",
|
|
1934
1934
|
value: "is_not_empty"
|
|
1935
1935
|
}
|
|
1936
|
-
], on = (e) => e.split(/[,\n;]+/).map((t) => t.trim()).filter(Boolean),
|
|
1936
|
+
], on = (e) => e.split(/[,\n;]+/).map((t) => t.trim()).filter(Boolean), Ze = (e, t) => [parseFloat(e ?? ""), parseFloat(t)], et = (e, t) => !isNaN(e) && !isNaN(t), Ee = (e) => {
|
|
1937
1937
|
if (!e?.trim()) return null;
|
|
1938
1938
|
const t = /^\d{4}-\d{2}-\d{2}$/.test(e.trim()) ? /* @__PURE__ */ new Date(`${e.trim()}T00:00:00Z`) : new Date(e.trim());
|
|
1939
1939
|
return isNaN(t.getTime()) ? null : new Date(Date.UTC(t.getUTCFullYear(), t.getUTCMonth(), t.getUTCDate()));
|
|
@@ -1957,20 +1957,20 @@ var io = ["is_empty", "is_not_empty"], so = ["in", "not_in"], lo = [
|
|
|
1957
1957
|
case "not_in":
|
|
1958
1958
|
return !on(a).includes(n);
|
|
1959
1959
|
case ">": {
|
|
1960
|
-
const [i, o] =
|
|
1961
|
-
return
|
|
1960
|
+
const [i, o] = Ze(r, e.value);
|
|
1961
|
+
return et(i, o) && i > o;
|
|
1962
1962
|
}
|
|
1963
1963
|
case "<": {
|
|
1964
|
-
const [i, o] =
|
|
1965
|
-
return
|
|
1964
|
+
const [i, o] = Ze(r, e.value);
|
|
1965
|
+
return et(i, o) && i < o;
|
|
1966
1966
|
}
|
|
1967
1967
|
case ">=": {
|
|
1968
|
-
const [i, o] =
|
|
1969
|
-
return
|
|
1968
|
+
const [i, o] = Ze(r, e.value);
|
|
1969
|
+
return et(i, o) && i >= o;
|
|
1970
1970
|
}
|
|
1971
1971
|
case "<=": {
|
|
1972
|
-
const [i, o] =
|
|
1973
|
-
return
|
|
1972
|
+
const [i, o] = Ze(r, e.value);
|
|
1973
|
+
return et(i, o) && i <= o;
|
|
1974
1974
|
}
|
|
1975
1975
|
case "date_before": {
|
|
1976
1976
|
const i = Ee(r), o = Ee(e.value);
|
|
@@ -2015,7 +2015,7 @@ var io = ["is_empty", "is_not_empty"], so = ["in", "not_in"], lo = [
|
|
|
2015
2015
|
a && a !== "transparent" && t.push(`background-color:${a}`), t.push(`background:${n}`);
|
|
2016
2016
|
} else e.backgroundColor && e.backgroundColor !== "transparent" && t.push(`background-color:${e.backgroundColor}`);
|
|
2017
2017
|
return e.backgroundImage && (t.push(`background-image:url('${e.backgroundImage}')`), t.push(`background-size:${e.backgroundSize}`), t.push(`background-position:${e.backgroundPosition}`), t.push(`background-repeat:${e.backgroundRepeat}`)), t;
|
|
2018
|
-
},
|
|
2018
|
+
}, tt = (e) => {
|
|
2019
2019
|
const t = {}, r = e.backgroundGradient;
|
|
2020
2020
|
if (r?.useGradient === !0 && Array.isArray(r?.gradient?.colors) && r.gradient.colors.length >= 2) {
|
|
2021
2021
|
const n = jn(r), a = r.solid || e.backgroundColor || "";
|
|
@@ -2036,7 +2036,7 @@ var io = ["is_empty", "is_not_empty"], so = ["in", "not_in"], lo = [
|
|
|
2036
2036
|
l.length > 0 && zn(l, t, r + 1);
|
|
2037
2037
|
}
|
|
2038
2038
|
}
|
|
2039
|
-
},
|
|
2039
|
+
}, Ln = (e) => {
|
|
2040
2040
|
const t = /* @__PURE__ */ new Set();
|
|
2041
2041
|
if (zn(e, t, 0), t.size === 0) return "";
|
|
2042
2042
|
const r = [...t].sort((n, a) => n - a);
|
|
@@ -2044,8 +2044,8 @@ var io = ["is_empty", "is_not_empty"], so = ["in", "not_in"], lo = [
|
|
|
2044
2044
|
`) + " { display:block !important; width:100% !important; }"}
|
|
2045
2045
|
${r.map((n) => `.mobile-stack.gap-${n} { height:${n}px !important; line-height:${n}px !important; }`).join(`
|
|
2046
2046
|
`)}`;
|
|
2047
|
-
},
|
|
2048
|
-
const e =
|
|
2047
|
+
}, nt = L(/* @__PURE__ */ new Set()), gt = () => {
|
|
2048
|
+
const e = L([
|
|
2049
2049
|
"Arial",
|
|
2050
2050
|
"Arial Black",
|
|
2051
2051
|
"Comic Sans MS",
|
|
@@ -2430,9 +2430,9 @@ ${r.map((n) => `.mobile-stack.gap-${n} { height:${n}px !important; line-height:$
|
|
|
2430
2430
|
}
|
|
2431
2431
|
return `wght@${n.join(";")}`;
|
|
2432
2432
|
}, l = (b) => {
|
|
2433
|
-
if (!b || a(b) ||
|
|
2433
|
+
if (!b || a(b) || nt.value.has(b)) return;
|
|
2434
2434
|
const E = document.createElement("link");
|
|
2435
|
-
E.rel = "stylesheet", E.href = `https://fonts.googleapis.com/css2?family=${i(b)}:${o(b)}&display=swap`, document.head.appendChild(E),
|
|
2435
|
+
E.rel = "stylesheet", E.href = `https://fonts.googleapis.com/css2?family=${i(b)}:${o(b)}&display=swap`, document.head.appendChild(E), nt.value.add(b);
|
|
2436
2436
|
}, c = (b) => {
|
|
2437
2437
|
const E = Array.from(new Set(b)).filter((w) => w && !a(w));
|
|
2438
2438
|
return E.length ? `https://fonts.googleapis.com/css2?${E.map((w) => `family=${i(w)}:${o(w)}`).join("&")}&display=swap` : "";
|
|
@@ -2445,13 +2445,13 @@ ${r.map((n) => `.mobile-stack.gap-${n} { height:${n}px !important; line-height:$
|
|
|
2445
2445
|
if (!b || b.length === 0) return;
|
|
2446
2446
|
const E = [], w = /* @__PURE__ */ new Set();
|
|
2447
2447
|
for (const O of b)
|
|
2448
|
-
O && (w.has(O) || (w.add(O), !a(O) && (
|
|
2448
|
+
O && (w.has(O) || (w.add(O), !a(O) && (nt.value.has(O) || E.push(O))));
|
|
2449
2449
|
if (E.length === 0) return;
|
|
2450
2450
|
const R = c(E);
|
|
2451
2451
|
if (!R) return;
|
|
2452
2452
|
const M = document.createElement("link");
|
|
2453
2453
|
M.rel = "stylesheet", M.href = R, M.dataset.canvasFonts = E.join(","), document.head.appendChild(M);
|
|
2454
|
-
for (const O of E)
|
|
2454
|
+
for (const O of E) nt.value.add(O);
|
|
2455
2455
|
},
|
|
2456
2456
|
preconnectGoogleFonts: () => {
|
|
2457
2457
|
if (typeof document > "u") return;
|
|
@@ -2469,127 +2469,136 @@ ${r.map((n) => `.mobile-stack.gap-${n} { height:${n}px !important; line-height:$
|
|
|
2469
2469
|
DEFAULT_WEIGHTS: n
|
|
2470
2470
|
};
|
|
2471
2471
|
};
|
|
2472
|
-
function
|
|
2472
|
+
function Je(e) {
|
|
2473
2473
|
if (typeof e != "string") return "auto";
|
|
2474
2474
|
const t = e.trim().toLowerCase();
|
|
2475
2475
|
return /^(?:auto|(?:\d+(?:\.\d+)?|\.\d+)(?:px|%))$/.test(t) ? t : "auto";
|
|
2476
2476
|
}
|
|
2477
2477
|
function na(e) {
|
|
2478
|
-
const t =
|
|
2478
|
+
const t = Je(e.width), r = Je(e.height);
|
|
2479
2479
|
return [
|
|
2480
2480
|
t,
|
|
2481
2481
|
r,
|
|
2482
2482
|
e.mobile?.width,
|
|
2483
2483
|
e.mobile?.height
|
|
2484
|
-
].some((n) =>
|
|
2484
|
+
].some((n) => Je(n) !== "auto") ? {
|
|
2485
2485
|
width: t,
|
|
2486
2486
|
height: r,
|
|
2487
2487
|
boxSizing: "border-box",
|
|
2488
2488
|
textAlign: "center"
|
|
2489
2489
|
} : {};
|
|
2490
2490
|
}
|
|
2491
|
+
function ra(e, t) {
|
|
2492
|
+
const r = t === "width" ? "100%" : "auto";
|
|
2493
|
+
if (typeof e != "string" && typeof e != "number") return r;
|
|
2494
|
+
let n = String(e).trim().toLowerCase();
|
|
2495
|
+
if (/^(?:\d+(?:\.\d+)?|\.\d+)$/.test(n) && (n += t === "width" ? "%" : "px"), t === "height" && n.endsWith("%")) return r;
|
|
2496
|
+
const a = Je(n);
|
|
2497
|
+
return a === "auto" && n !== "auto" ? r : a;
|
|
2498
|
+
}
|
|
2491
2499
|
var Jt = () => ({ emailMobileStyles: (t, r) => {
|
|
2492
2500
|
const n = t.componentType ?? t.type, a = t.props.mobileStack === !0, i = t.props.mobile;
|
|
2493
2501
|
if (!i && !(n === "menu" && a)) return "";
|
|
2494
|
-
const o = i ?? {}, l = [], c = [],
|
|
2495
|
-
|
|
2502
|
+
const o = i ?? {}, l = [], c = [], p = [], v = (/* @__PURE__ */ new Set(["button", "anchor"])).has(n), b = n === "button" && !!na(t.props).width, E = (/* @__PURE__ */ new Set(["menu", "socials"])).has(n), w = (u, d) => {
|
|
2503
|
+
d && u.push(d);
|
|
2496
2504
|
}, R = () => {
|
|
2497
|
-
const
|
|
2498
|
-
if (
|
|
2499
|
-
if (
|
|
2500
|
-
const { type: s, direction: S, colors: C } =
|
|
2505
|
+
const u = o.backgroundGradient;
|
|
2506
|
+
if (u != null) {
|
|
2507
|
+
if (u.useGradient === !0 && Array.isArray(u.gradient?.colors) && u.gradient.colors.length >= 2) {
|
|
2508
|
+
const { type: s, direction: S, colors: C } = u.gradient, _ = C.map((x) => `${x.color} ${x.position}%`).join(", "), g = s === "radial" ? `radial-gradient(circle at center, ${_})` : `linear-gradient(${S}, ${_})`, m = u.solid || o.backgroundColor || "", h = [];
|
|
2501
2509
|
return h.push(`background-color: ${m && m !== "transparent" ? m : "transparent"} !important`), h.push(`background: ${g} !important`), h;
|
|
2502
2510
|
}
|
|
2503
|
-
const
|
|
2504
|
-
return
|
|
2511
|
+
const d = u.solid ?? o.backgroundColor;
|
|
2512
|
+
return d != null ? ["background: none !important", `background-color: ${d} !important`] : [];
|
|
2505
2513
|
}
|
|
2506
2514
|
return o.backgroundColor != null ? ["background: none !important", `background-color: ${o.backgroundColor} !important`] : [];
|
|
2507
|
-
}, M = (
|
|
2508
|
-
w(
|
|
2515
|
+
}, M = (u) => {
|
|
2516
|
+
w(u, o.fontSize != null && `font-size: ${o.fontSize}px !important`), w(u, o.lineHeight != null && `line-height: ${o.lineHeight} !important`), w(u, o.letterSpacing != null && `letter-spacing: ${o.letterSpacing}px !important`), w(u, o.color != null && `color: ${o.color} !important`), w(u, o.fontWeight != null && `font-weight: ${o.fontWeight} !important`), w(u, o.fontFamily != null && `font-family: '${o.fontFamily}', Arial, sans-serif !important`), w(u, o.fontStyle != null && `font-style: ${o.fontStyle} !important`), w(u, o.textTransform != null && `text-transform: ${o.textTransform} !important`), w(u, o.textDecoration != null && `text-decoration: ${o.textDecoration} !important`), b || u.push(...R());
|
|
2509
2517
|
};
|
|
2510
2518
|
if (o.margin) {
|
|
2511
|
-
const
|
|
2512
|
-
l.push(`margin: ${
|
|
2519
|
+
const u = o.margin;
|
|
2520
|
+
l.push(`margin: ${u.top}px ${u.right}px ${u.bottom}px ${u.left}px !important`);
|
|
2513
2521
|
}
|
|
2514
2522
|
if (o.padding && !v && !E) {
|
|
2515
|
-
const
|
|
2516
|
-
l.push(`padding: ${
|
|
2523
|
+
const u = o.padding;
|
|
2524
|
+
l.push(`padding: ${u.top}px ${u.right}px ${u.bottom}px ${u.left}px !important`);
|
|
2517
2525
|
}
|
|
2518
2526
|
if (o.align != null && !E && l.push(`text-align: ${o.align} !important`), v) {
|
|
2519
2527
|
M(c);
|
|
2520
|
-
const
|
|
2528
|
+
const u = b ? R() : c;
|
|
2521
2529
|
if (o.padding) {
|
|
2522
|
-
const
|
|
2523
|
-
b ?
|
|
2530
|
+
const d = o.padding, s = `padding: ${d.top}px ${d.right}px ${d.bottom}px ${d.left}px !important`;
|
|
2531
|
+
b ? p.push(`.${r}-button-content { ${s} }`) : c.push(s);
|
|
2524
2532
|
}
|
|
2525
2533
|
if (o.border) {
|
|
2526
|
-
const
|
|
2527
|
-
|
|
2534
|
+
const d = o.border;
|
|
2535
|
+
u.push(ue(d, !0));
|
|
2528
2536
|
}
|
|
2529
|
-
if (o.borderRadius != null &&
|
|
2530
|
-
for (const s of ["width", "height"]) o[s] != null &&
|
|
2531
|
-
const
|
|
2532
|
-
w(
|
|
2537
|
+
if (o.borderRadius != null && u.push(`border-radius: ${Y(o.borderRadius)} !important`), n === "button") {
|
|
2538
|
+
for (const s of ["width", "height"]) o[s] != null && u.push(`${s}: ${Je(o[s])} !important`);
|
|
2539
|
+
const d = [];
|
|
2540
|
+
w(d, o.fontSize != null && `font-size: ${o.fontSize}px !important`), w(d, o.letterSpacing != null && `letter-spacing: ${o.letterSpacing}px !important`), w(d, o.color != null && `color: ${o.color} !important`), w(d, o.fontWeight != null && `font-weight: ${o.fontWeight} !important`), w(d, o.fontFamily != null && `font-family: '${o.fontFamily}', Arial, sans-serif !important`), w(d, o.fontStyle != null && `font-style: ${o.fontStyle} !important`), w(d, o.textTransform != null && `text-transform: ${o.textTransform} !important`), w(d, o.textDecoration != null && `text-decoration: ${o.textDecoration} !important`), d.length > 0 && p.push(`.${r}-text { ${d.join("; ")} }`);
|
|
2533
2541
|
}
|
|
2534
|
-
b &&
|
|
2535
|
-
} else if (n === "image")
|
|
2536
|
-
|
|
2537
|
-
|
|
2542
|
+
b && u.length > 0 && p.push(`.${r}-button-table { ${u.join("; ")} }`);
|
|
2543
|
+
} else if (n === "image") {
|
|
2544
|
+
for (const u of ["width", "height"]) o[u] != null && c.push(`${u}: ${ra(o[u], u)} !important`);
|
|
2545
|
+
w(c, o.borderRadius != null && `border-radius: ${Y(o.borderRadius)} !important`), w(c, o.border != null && ue(o.border, !0));
|
|
2546
|
+
} else if (n === "video")
|
|
2538
2547
|
w(c, o.width != null && `width: ${o.width}% !important`), w(c, o.height != null && `height: ${o.height} !important`), w(c, o.borderRadius != null && `border-radius: ${Y(o.borderRadius)} !important`), w(c, o.border != null && ue(o.border, !0));
|
|
2539
2548
|
else if (n === "divider") {
|
|
2540
|
-
const
|
|
2541
|
-
if (o.width != null &&
|
|
2549
|
+
const u = [], d = [];
|
|
2550
|
+
if (o.width != null && u.push(`width: ${o.width}% !important`), o.align != null) {
|
|
2542
2551
|
const s = o.align === "left" ? "0" : "auto", S = o.align === "right" ? "0" : "auto";
|
|
2543
|
-
|
|
2552
|
+
u.push(`margin-left: ${s} !important`), u.push(`margin-right: ${S} !important`);
|
|
2544
2553
|
}
|
|
2545
|
-
o.height != null && (
|
|
2554
|
+
o.height != null && (d.push(`height: ${o.height}px !important`), d.push(`line-height: ${o.height}px !important`)), d.push(...R()), u.length > 0 && p.push(`.${r}-divider-table { ${u.join("; ")} }`), d.length > 0 && p.push(`.${r}-divider-td { ${d.join("; ")} }`);
|
|
2546
2555
|
} else if (n === "spacer") {
|
|
2547
|
-
const
|
|
2548
|
-
o.height != null && (
|
|
2556
|
+
const u = [];
|
|
2557
|
+
o.height != null && (u.push(`height: ${o.height}px !important`), u.push(`line-height: ${o.height}px !important`)), u.push(...R()), u.length > 0 && p.push(`.${r}-spacer-td { ${u.join("; ")} }`);
|
|
2549
2558
|
} else if (n === "list")
|
|
2550
|
-
M(l), o.itemSpacing != null &&
|
|
2559
|
+
M(l), o.itemSpacing != null && p.push(`.${r} li { margin-bottom: ${o.itemSpacing}px !important; }`);
|
|
2551
2560
|
else if (n === "menu") {
|
|
2552
|
-
const
|
|
2553
|
-
if (
|
|
2561
|
+
const u = [];
|
|
2562
|
+
if (u.push(...R()), o.padding) {
|
|
2554
2563
|
const s = o.padding;
|
|
2555
|
-
|
|
2564
|
+
u.push(`padding: ${s.top}px ${s.right}px ${s.bottom}px ${s.left}px !important`);
|
|
2556
2565
|
}
|
|
2557
|
-
|
|
2558
|
-
const
|
|
2559
|
-
if (o.fontSize != null &&
|
|
2566
|
+
u.length > 0 && p.push(`.${r}-menu-td { ${u.join("; ")} }`), o.align != null && p.push(`.${r}-menu-td { text-align: ${o.align} !important; }`);
|
|
2567
|
+
const d = [];
|
|
2568
|
+
if (o.fontSize != null && d.push(`font-size: ${o.fontSize}px !important`), o.lineHeight != null && d.push(`line-height: ${o.lineHeight} !important`), o.letterSpacing != null && d.push(`letter-spacing: ${o.letterSpacing}px !important`), o.color != null && d.push(`color: ${o.color} !important`), o.fontWeight != null && d.push(`font-weight: ${o.fontWeight} !important`), o.fontFamily != null && d.push(`font-family: '${o.fontFamily}', Arial, sans-serif !important`), o.fontStyle != null && d.push(`font-style: ${o.fontStyle} !important`), o.textTransform != null && d.push(`text-transform: ${o.textTransform} !important`), o.textDecoration != null && d.push(`text-decoration: ${o.textDecoration} !important`), d.length > 0 && p.push(`.${r}-menu-td a { ${d.join("; ")} }`), a) {
|
|
2560
2569
|
const s = o.spacing ?? t.props.spacing ?? 0;
|
|
2561
|
-
|
|
2570
|
+
p.push(`.${r}-menu-item a { display: block !important; white-space: normal !important; margin-left: 0 !important; margin-right: 0 !important; margin-bottom: ${s}px !important; }`), p.push(`.${r}-menu-item:last-of-type a { margin-bottom: 0 !important; }`);
|
|
2562
2571
|
} else if (o.spacing != null) {
|
|
2563
2572
|
const s = Math.ceil(o.spacing / 2);
|
|
2564
|
-
|
|
2573
|
+
p.push(`.${r}-menu-item a { margin-left: ${s}px !important; margin-right: ${s}px !important; }`), p.push(`.${r}-menu-item:first-of-type a { margin-left: 0 !important; }`), p.push(`.${r}-menu-item:last-of-type a { margin-right: 0 !important; }`);
|
|
2565
2574
|
}
|
|
2566
2575
|
} else if (n === "socials") {
|
|
2567
|
-
const
|
|
2576
|
+
const u = [];
|
|
2568
2577
|
if (o.padding) {
|
|
2569
|
-
const
|
|
2570
|
-
|
|
2578
|
+
const d = o.padding;
|
|
2579
|
+
u.push(`padding: ${d.top}px ${d.right}px ${d.bottom}px ${d.left}px !important`);
|
|
2571
2580
|
}
|
|
2572
2581
|
if (o.align != null) {
|
|
2573
|
-
const
|
|
2574
|
-
|
|
2582
|
+
const d = o.align === "left" ? "0" : "auto", s = o.align === "right" ? "0" : "auto";
|
|
2583
|
+
p.push(`.${r}-socials-inner { display:inline-table !important; margin-left: ${d} !important; margin-right: ${s} !important; }`), u.push(`text-align: ${o.align} !important`);
|
|
2575
2584
|
}
|
|
2576
|
-
if (
|
|
2577
|
-
const
|
|
2578
|
-
|
|
2585
|
+
if (u.length > 0 && p.push(`.${r}-socials-td { ${u.join("; ")} }`), o.iconSize != null && p.push(`.${r}-socials-inner img { width: ${o.iconSize}px !important; height: ${o.iconSize}px !important; }`), o.spacing != null) {
|
|
2586
|
+
const d = Math.ceil(o.spacing / 2);
|
|
2587
|
+
p.push(`.${r}-socials-item a { margin-left: ${d}px !important; margin-right: ${d}px !important; }`), p.push(`.${r}-socials-item:first-of-type a { margin-left: 0 !important; }`), p.push(`.${r}-socials-item:last-of-type a { margin-right: 0 !important; }`);
|
|
2579
2588
|
}
|
|
2580
2589
|
} else M(l);
|
|
2581
2590
|
const O = [];
|
|
2582
2591
|
if (l.length > 0 && O.push(`.${r} { ${l.join("; ")} }`), c.length > 0) {
|
|
2583
|
-
const
|
|
2584
|
-
O.push(`${
|
|
2592
|
+
const u = v ? `.${r}-link` : n === "image" ? `.${r} img` : n === "video" ? `.${r} video` : `.${r}`;
|
|
2593
|
+
O.push(`${u} { ${c.join("; ")} }`);
|
|
2585
2594
|
}
|
|
2586
|
-
return O.push(...
|
|
2595
|
+
return O.push(...p), O.join(`
|
|
2587
2596
|
`);
|
|
2588
|
-
} }), ln = (e) => de(e) ? ue(e) : "",
|
|
2597
|
+
} }), ln = (e) => de(e) ? ue(e) : "", Pn = (e, t, r = [], n) => {
|
|
2589
2598
|
const a = `padding:${n?.top ?? 0}px ${n?.right ?? 0}px ${n?.bottom ?? 0}px ${n?.left ?? 0}px`, i = t && ee(t.radius ?? 0) && de(t), o = t && de(t) && !ee(t.radius ?? 0);
|
|
2590
2599
|
if (!i) {
|
|
2591
|
-
const
|
|
2592
|
-
return o &&
|
|
2600
|
+
const p = [a];
|
|
2601
|
+
return o && p.push(ln(t)), p.push("line-height:0"), p.push("font-size:0"), `<div style="${p.join(";")}">${e}</div>`;
|
|
2593
2602
|
}
|
|
2594
2603
|
const l = [
|
|
2595
2604
|
`border-radius:${Y(t.radius)}`,
|
|
@@ -2604,7 +2613,7 @@ var Jt = () => ({ emailMobileStyles: (t, r) => {
|
|
|
2604
2613
|
"font-size:0"
|
|
2605
2614
|
];
|
|
2606
2615
|
return `<div style="${l.join(";")}"><div style="${c.join(";")}">${e}</div></div>`;
|
|
2607
|
-
},
|
|
2616
|
+
}, aa = (e, t, r = {}, n, a = !0) => {
|
|
2608
2617
|
const i = `${n?.top ?? 0}px ${n?.right ?? 0}px ${n?.bottom ?? 0}px ${n?.left ?? 0}px`, o = t && ee(t.radius ?? 0) && de(t) && a, l = t && de(t) && !ee(t.radius ?? 0) && a;
|
|
2609
2618
|
if (!o) {
|
|
2610
2619
|
const v = {
|
|
@@ -2621,12 +2630,12 @@ var Jt = () => ({ emailMobileStyles: (t, r) => {
|
|
|
2621
2630
|
fontSize: "0"
|
|
2622
2631
|
};
|
|
2623
2632
|
de(t) && Object.assign(c, At(t));
|
|
2624
|
-
const
|
|
2633
|
+
const p = {
|
|
2625
2634
|
padding: i,
|
|
2626
2635
|
lineHeight: "0",
|
|
2627
2636
|
fontSize: "0"
|
|
2628
2637
|
};
|
|
2629
|
-
return `<div style={{ ${Object.entries(c).map(([v, b]) => `${v}:"${b}"`).join(", ")} }}><div style={{ ${Object.entries(
|
|
2638
|
+
return `<div style={{ ${Object.entries(c).map(([v, b]) => `${v}:"${b}"`).join(", ")} }}><div style={{ ${Object.entries(p).map(([v, b]) => `${v}:"${b}"`).join(", ")} }}>${e}</div></div>`;
|
|
2630
2639
|
}, _t = null, Tt = null;
|
|
2631
2640
|
function Dn() {
|
|
2632
2641
|
return _t ??= Promise.all([import("./standalone-DHvJ30Td.js"), import("./html-wb0gSX1o.js")]).then(([e, t]) => ({
|
|
@@ -2636,7 +2645,7 @@ function Dn() {
|
|
|
2636
2645
|
throw _t = null, e;
|
|
2637
2646
|
}), _t;
|
|
2638
2647
|
}
|
|
2639
|
-
function
|
|
2648
|
+
function oa() {
|
|
2640
2649
|
return Tt ??= Promise.all([
|
|
2641
2650
|
import("./standalone-DHvJ30Td.js"),
|
|
2642
2651
|
import("./babel-DV7WPQI0.js"),
|
|
@@ -2655,25 +2664,25 @@ async function Gt(e, t) {
|
|
|
2655
2664
|
return console.warn("[maildeno-editor] formatter unavailable; returning unformatted output", r), e;
|
|
2656
2665
|
}
|
|
2657
2666
|
}
|
|
2658
|
-
var
|
|
2667
|
+
var ia = async (e) => Gt(e, async () => {
|
|
2659
2668
|
const { prettier: t, plugins: r } = await Dn();
|
|
2660
2669
|
return t.format(e, {
|
|
2661
2670
|
parser: "html",
|
|
2662
2671
|
plugins: r
|
|
2663
2672
|
});
|
|
2664
|
-
}),
|
|
2665
|
-
const { prettier: t, plugins: r } = await
|
|
2673
|
+
}), sa = async (e) => Gt(e, async () => {
|
|
2674
|
+
const { prettier: t, plugins: r } = await oa();
|
|
2666
2675
|
return t.format(e, {
|
|
2667
2676
|
parser: "babel-ts",
|
|
2668
2677
|
plugins: r
|
|
2669
2678
|
});
|
|
2670
|
-
}),
|
|
2679
|
+
}), la = async (e) => Gt(e, async () => {
|
|
2671
2680
|
const { prettier: t, plugins: r } = await Dn();
|
|
2672
2681
|
return t.format(e, {
|
|
2673
2682
|
parser: "html",
|
|
2674
2683
|
plugins: r
|
|
2675
2684
|
});
|
|
2676
|
-
}), cn = (e) => e.trim().toLowerCase().replace(/\s+/g, "_"),
|
|
2685
|
+
}), cn = (e) => e.trim().toLowerCase().replace(/\s+/g, "_"), ca = (e) => {
|
|
2677
2686
|
const t = e.indexOf("|");
|
|
2678
2687
|
if (t === -1) return { key: cn(e) };
|
|
2679
2688
|
const r = e.slice(0, t), n = e.slice(t + 1).trim().replace(/^['"]|['"]$/g, "");
|
|
@@ -2682,19 +2691,19 @@ var oa = async (e) => Gt(e, async () => {
|
|
|
2682
2691
|
pipeDefault: n
|
|
2683
2692
|
};
|
|
2684
2693
|
}, un = (e, t, r) => !r || !e ? e : e.replace(/\{\{\s*([^}]+?)\s*\}\}/g, (n, a) => {
|
|
2685
|
-
const { key: i, pipeDefault: o } =
|
|
2694
|
+
const { key: i, pipeDefault: o } = ca(a);
|
|
2686
2695
|
return Object.prototype.hasOwnProperty.call(t, i) && t[i] !== "" ? t[i] : o !== void 0 ? o : n;
|
|
2687
2696
|
}), Fn = (e, t, r, n, a) => {
|
|
2688
2697
|
let i = un(e, t, r);
|
|
2689
2698
|
return i = un(i, n, a), i;
|
|
2690
2699
|
}, qt = /* @__PURE__ */ new Map();
|
|
2691
|
-
function
|
|
2700
|
+
function mo(e) {
|
|
2692
2701
|
for (const t of e) qt.set(t.key, t);
|
|
2693
2702
|
}
|
|
2694
|
-
function
|
|
2703
|
+
function ua() {
|
|
2695
2704
|
return [...qt.keys()];
|
|
2696
2705
|
}
|
|
2697
|
-
function
|
|
2706
|
+
function da(e, t) {
|
|
2698
2707
|
return qt.get(e)?.tokens?.[t];
|
|
2699
2708
|
}
|
|
2700
2709
|
var Wt = {
|
|
@@ -2812,7 +2821,7 @@ var Wt = {
|
|
|
2812
2821
|
hubspot: "{{ today }}",
|
|
2813
2822
|
sfmc: "%%=Format(Now(),'M/d/yyyy')=%%"
|
|
2814
2823
|
}
|
|
2815
|
-
},
|
|
2824
|
+
}, pa = (e, t, r) => {
|
|
2816
2825
|
const n = !!r?.trim(), a = r?.trim() ?? "";
|
|
2817
2826
|
switch (t) {
|
|
2818
2827
|
case "liquid":
|
|
@@ -2871,32 +2880,32 @@ var Wt = {
|
|
|
2871
2880
|
const i = n[t];
|
|
2872
2881
|
if (i) return r?.trim() ? dn(i, t, r) : i;
|
|
2873
2882
|
}
|
|
2874
|
-
const a =
|
|
2875
|
-
return a ? r?.trim() ? dn(a, t, r) : a :
|
|
2876
|
-
},
|
|
2883
|
+
const a = da(e, t);
|
|
2884
|
+
return a ? r?.trim() ? dn(a, t, r) : a : pa(e, t, r);
|
|
2885
|
+
}, ma = (e, t) => {
|
|
2877
2886
|
if (!e) return "";
|
|
2878
2887
|
let r = e.replace(/<span[^>]*\bdata-merge="([^"]+)"(?:[^>]*\bdata-merge-default="([^"]*)")?[^>]*>.*?<\/span>/gs, (n, a, i) => pn(a, t, i?.trim() || void 0));
|
|
2879
|
-
return r = r.replace(/\{\{\s*(?:'([^']*)'|"([^"]*)"|(\w+))(?:\s*\|\s*(?:'([^']*)'|"([^"]*)"|([^'"\}\s][^'"\}]*?)))?\s*\}\}/g, (n, a, i, o, l, c,
|
|
2880
|
-
const v = (a ?? i ?? o ?? "").trim(), b = (l ?? c ??
|
|
2888
|
+
return r = r.replace(/\{\{\s*(?:'([^']*)'|"([^"]*)"|(\w+))(?:\s*\|\s*(?:'([^']*)'|"([^"]*)"|([^'"\}\s][^'"\}]*?)))?\s*\}\}/g, (n, a, i, o, l, c, p) => {
|
|
2889
|
+
const v = (a ?? i ?? o ?? "").trim(), b = (l ?? c ?? p ?? "").trim();
|
|
2881
2890
|
return pn(v, t, b || void 0);
|
|
2882
2891
|
}), r;
|
|
2883
|
-
},
|
|
2892
|
+
}, fo = () => [...Object.keys(Wt), ...ua()], go = (e, t) => Wt[e]?.[t] ?? null, Ge = (e) => {
|
|
2884
2893
|
let t = (e ?? "").trim().replace(/[^A-Za-z0-9_$]+/g, "_");
|
|
2885
2894
|
return /^[0-9]/.test(t) && (t = `_${t}`), t || "_tag";
|
|
2886
2895
|
}, mn = (e, t) => {
|
|
2887
2896
|
const r = e.trim();
|
|
2888
2897
|
return r ? t?.trim() ? `{${r} ?? "${t.trim().replace(/"/g, '\\"')}"}` : `{${r}}` : "";
|
|
2889
|
-
},
|
|
2898
|
+
}, fa = (e) => {
|
|
2890
2899
|
if (!e) return "";
|
|
2891
2900
|
let t = e.replace(/<span[^>]*\bdata-merge="([^"]+)"(?:[^>]*\bdata-merge-default="([^"]*)")?[^>]*>.*?<\/span>/gs, (r, n, a) => mn(n, a?.trim() || void 0));
|
|
2892
2901
|
return t = t.replace(/\{\{\s*(?:'([^']*)'|"([^"]*)"|(\w+))(?:\s*\|\s*(?:'([^']*)'|"([^"]*)"|([^'"\}\s][^'"\}]*?)))?\s*\}\}/g, (r, n, a, i, o, l, c) => {
|
|
2893
|
-
const
|
|
2894
|
-
return mn(
|
|
2902
|
+
const p = (n ?? a ?? i ?? "").trim(), v = (o ?? l ?? c ?? "").trim();
|
|
2903
|
+
return mn(p, v || void 0);
|
|
2895
2904
|
}), t = t.replace(/(\b(?!style=)\w[\w-]*=)"([^"]*\{[^}]+\}[^"]*)"/g, (r, n, a) => {
|
|
2896
2905
|
const i = a.match(/^\{(\w+)\}$/);
|
|
2897
2906
|
return i ? `${n}{${i[1]}}` : `${n}{\`${a.replace(/\{(\w+)\}/g, "${$1}")}\`}`;
|
|
2898
2907
|
}), t;
|
|
2899
|
-
},
|
|
2908
|
+
}, ga = (e) => {
|
|
2900
2909
|
if (e.length === 0) return {
|
|
2901
2910
|
propsInterface: "",
|
|
2902
2911
|
propsDestructure: ""
|
|
@@ -2911,7 +2920,7 @@ ${r.map(([n]) => ` ${n}?: string;`).join(`
|
|
|
2911
2920
|
}`,
|
|
2912
2921
|
propsDestructure: `{ ${r.map(([n, a]) => a?.trim() ? `${n} = "${a.trim().replace(/"/g, '\\"')}"` : n).join(", ")} }: EmailProps`
|
|
2913
2922
|
};
|
|
2914
|
-
},
|
|
2923
|
+
}, ha = (e) => {
|
|
2915
2924
|
const t = /* @__PURE__ */ new Map();
|
|
2916
2925
|
for (const r of e.matchAll(/<span[^>]*\bdata-merge="([^"]+)"(?:[^>]*\bdata-merge-default="([^"]*)")?[^>]*>.*?<\/span>/gs)) {
|
|
2917
2926
|
const n = r[1].trim();
|
|
@@ -2925,11 +2934,11 @@ ${r.map(([n]) => ` ${n}?: string;`).join(`
|
|
|
2925
2934
|
tagId: r,
|
|
2926
2935
|
fallback: n
|
|
2927
2936
|
}));
|
|
2928
|
-
},
|
|
2937
|
+
}, va = (e) => {
|
|
2929
2938
|
const t = /* @__PURE__ */ new Set(), r = (a) => {
|
|
2930
2939
|
if (a?.enabled) {
|
|
2931
|
-
for (const i of a.rules ?? []) i.tag?.trim() && t.add(
|
|
2932
|
-
for (const i of a.groups ?? []) for (const o of i.rules ?? []) o.tag?.trim() && t.add(
|
|
2940
|
+
for (const i of a.rules ?? []) i.tag?.trim() && t.add(Ge(i.tag));
|
|
2941
|
+
for (const i of a.groups ?? []) for (const o of i.rules ?? []) o.tag?.trim() && t.add(Ge(o.tag));
|
|
2933
2942
|
}
|
|
2934
2943
|
}, n = (a) => {
|
|
2935
2944
|
for (const i of a) if (i.type === "row") {
|
|
@@ -2947,14 +2956,14 @@ ${r.map(([n]) => ` ${n}?: string;`).join(`
|
|
|
2947
2956
|
r(i.props?.visibility), n(i.children ?? i.components ?? []);
|
|
2948
2957
|
}
|
|
2949
2958
|
return [...t];
|
|
2950
|
-
},
|
|
2959
|
+
}, ba = (e) => e.length === 0 ? "" : ` // Visibility data — replace with real values from your data source
|
|
2951
2960
|
${e.map((t) => ` const ${t} = "";`).join(`
|
|
2952
2961
|
`)}`, Hn = (e, t, r, n, a = !1) => {
|
|
2953
2962
|
const i = n?.mergeTagActive || n?.linkTagActive;
|
|
2954
|
-
if (t === "wrap" || !i) return
|
|
2963
|
+
if (t === "wrap" || !i) return ma(e, r);
|
|
2955
2964
|
if (a) {
|
|
2956
|
-
const { mergeTagContext: o, mergeTagActive: l, linkTagContext: c, linkTagActive:
|
|
2957
|
-
return Fn(e, o ?? {}, l ?? !1, c ?? {},
|
|
2965
|
+
const { mergeTagContext: o, mergeTagActive: l, linkTagContext: c, linkTagActive: p } = n;
|
|
2966
|
+
return Fn(e, o ?? {}, l ?? !1, c ?? {}, p ?? !1);
|
|
2958
2967
|
}
|
|
2959
2968
|
return e;
|
|
2960
2969
|
}, Un = (e, t, r) => {
|
|
@@ -2962,28 +2971,28 @@ ${e.map((t) => ` const ${t} = "";`).join(`
|
|
|
2962
2971
|
const { mergeTagContext: n, mergeTagActive: a, linkTagContext: i, linkTagActive: o } = r;
|
|
2963
2972
|
return !a && !o ? e : Fn(e, n, a, i, o);
|
|
2964
2973
|
}, Vt = /* @__PURE__ */ new Map(), Jn = /* @__PURE__ */ new Map();
|
|
2965
|
-
function
|
|
2974
|
+
function ho(e, t, r) {
|
|
2966
2975
|
Vt.set(e, t), r && Jn.set(e, r);
|
|
2967
2976
|
}
|
|
2968
|
-
var
|
|
2977
|
+
var $a = {
|
|
2969
2978
|
label: "Custom",
|
|
2970
2979
|
group: "custom",
|
|
2971
2980
|
description: "Registered ESP syntax with no metadata override.",
|
|
2972
2981
|
supportsNesting: !0
|
|
2973
2982
|
};
|
|
2974
|
-
function
|
|
2975
|
-
return t[e] ?? Vt.get(e) ??
|
|
2983
|
+
function ya(e, t) {
|
|
2984
|
+
return t[e] ?? Vt.get(e) ?? $a;
|
|
2976
2985
|
}
|
|
2977
2986
|
function Gn(e) {
|
|
2978
2987
|
return Jn.get(e);
|
|
2979
2988
|
}
|
|
2980
|
-
function
|
|
2989
|
+
function vo() {
|
|
2981
2990
|
return [...Vt.entries()].map(([e, t]) => ({
|
|
2982
2991
|
id: e,
|
|
2983
2992
|
meta: t
|
|
2984
2993
|
}));
|
|
2985
2994
|
}
|
|
2986
|
-
var
|
|
2995
|
+
var Sa = {
|
|
2987
2996
|
handlebars: {
|
|
2988
2997
|
label: "Handlebars (Generic)",
|
|
2989
2998
|
group: "handlebars",
|
|
@@ -3079,7 +3088,7 @@ var ya = {
|
|
|
3079
3088
|
description: "Microsoft Office VML conditional comments for Outlook",
|
|
3080
3089
|
supportsNesting: !1
|
|
3081
3090
|
}
|
|
3082
|
-
},
|
|
3091
|
+
}, bo = [
|
|
3083
3092
|
{
|
|
3084
3093
|
syntax: "handlebars",
|
|
3085
3094
|
label: "Handlebars",
|
|
@@ -3290,8 +3299,8 @@ var ya = {
|
|
|
3290
3299
|
is_empty: "none",
|
|
3291
3300
|
date: "none"
|
|
3292
3301
|
}
|
|
3293
|
-
],
|
|
3294
|
-
const r =
|
|
3302
|
+
], ka = (e, t) => {
|
|
3303
|
+
const r = Ge(e);
|
|
3295
3304
|
switch (t) {
|
|
3296
3305
|
case "sfmc":
|
|
3297
3306
|
return `AttributeValue("${r}")`;
|
|
@@ -3303,7 +3312,7 @@ var ya = {
|
|
|
3303
3312
|
return r;
|
|
3304
3313
|
}
|
|
3305
3314
|
}, Te = (e, t) => {
|
|
3306
|
-
const { operator: r, value: n } = e, a =
|
|
3315
|
+
const { operator: r, value: n } = e, a = ka(e.tag, t);
|
|
3307
3316
|
switch (t) {
|
|
3308
3317
|
case "handlebars":
|
|
3309
3318
|
case "sendgrid":
|
|
@@ -3627,29 +3636,29 @@ var ya = {
|
|
|
3627
3636
|
default:
|
|
3628
3637
|
return "{{/if}}";
|
|
3629
3638
|
}
|
|
3630
|
-
}, Nt = (e) => `__esp_ts_${e.replace(/[^a-zA-Z0-9]/g, "_")}`, Bt = (e, t) => `__esp_cmp_${e.replace(/[^a-zA-Z0-9]/g, "_")}_${t.replace(/[^a-zA-Z0-9]/g, "_")}`,
|
|
3639
|
+
}, Nt = (e) => `__esp_ts_${e.replace(/[^a-zA-Z0-9]/g, "_")}`, Bt = (e, t) => `__esp_cmp_${e.replace(/[^a-zA-Z0-9]/g, "_")}_${t.replace(/[^a-zA-Z0-9]/g, "_")}`, wa = (e) => {
|
|
3631
3640
|
const t = /* @__PURE__ */ new Set(), r = [];
|
|
3632
3641
|
for (const n of e) {
|
|
3633
3642
|
const a = n.operator;
|
|
3634
3643
|
if (a !== "date_before" && a !== "date_after") continue;
|
|
3635
3644
|
const i = Nt(n.tag), o = Bt(n.tag, n.value);
|
|
3636
|
-
t.has(i) || (t.add(i), r.push(`{%- assign ${i} = ${
|
|
3645
|
+
t.has(i) || (t.add(i), r.push(`{%- assign ${i} = ${Ge(n.tag)} | date: '%s' -%}`)), t.has(o) || (t.add(o), r.push(`{%- assign ${o} = '${n.value}' | date: '%s' -%}`));
|
|
3637
3646
|
}
|
|
3638
3647
|
return r;
|
|
3639
|
-
},
|
|
3640
|
-
const r = (o, l) => o.length === 0 ? l : [...o].reverse().reduce((c,
|
|
3648
|
+
}, xa = (e) => e === "liquid" || e === "klaviyo" || e === "braze" || e === "hubspot", Ca = (e, t) => {
|
|
3649
|
+
const r = (o, l) => o.length === 0 ? l : [...o].reverse().reduce((c, p) => `*|IF:${p}|*
|
|
3641
3650
|
${c}
|
|
3642
3651
|
*|END:IF|*`, l), n = (o, l) => o.length === 0 ? l : o.map((c) => `*|IF:${c}|*
|
|
3643
3652
|
${l}
|
|
3644
3653
|
*|END:IF|*`).join(`
|
|
3645
3654
|
`), a = (o, l, c) => {
|
|
3646
|
-
const
|
|
3647
|
-
return
|
|
3655
|
+
const p = o.map((v) => Te(v, "mailchimp")).filter((v) => v !== null);
|
|
3656
|
+
return p.length === 0 ? null : l === "all" ? r(p, c) : n(p, c);
|
|
3648
3657
|
}, i = (t.rules ?? []).map((o) => Te(o, "mailchimp")).filter((o) => o !== null);
|
|
3649
3658
|
if (t.match === "all") {
|
|
3650
3659
|
let o = e;
|
|
3651
3660
|
for (const l of [...t.groups ?? []].reverse()) {
|
|
3652
|
-
const c = l.rules.map((
|
|
3661
|
+
const c = l.rules.map((p) => Te(p, "mailchimp")).filter((p) => p !== null);
|
|
3653
3662
|
c.length !== 0 && (o = l.match === "all" ? r(c, o) : n(c, o));
|
|
3654
3663
|
}
|
|
3655
3664
|
return i.length > 0 ? r(i, o) : o;
|
|
@@ -3661,10 +3670,10 @@ ${e}
|
|
|
3661
3670
|
`) : e;
|
|
3662
3671
|
}
|
|
3663
3672
|
}, Vn = (e, t) => {
|
|
3664
|
-
const r =
|
|
3673
|
+
const r = ya(t, Sa), n = (e.rules ?? []).map((o) => Te(o, t)).filter((o) => o !== null);
|
|
3665
3674
|
let a;
|
|
3666
3675
|
r.supportsNesting ? a = (e.groups ?? []).map((o) => {
|
|
3667
|
-
const l = o.rules.map((
|
|
3676
|
+
const l = o.rules.map((p) => Te(p, t)).filter((p) => p !== null);
|
|
3668
3677
|
if (l.length === 0) return null;
|
|
3669
3678
|
const c = fn(l, o.match, t);
|
|
3670
3679
|
return l.length > 1 ? `(${c})` : c;
|
|
@@ -3672,29 +3681,29 @@ ${e}
|
|
|
3672
3681
|
const i = [...n, ...a];
|
|
3673
3682
|
return i.length === 0 ? null : {
|
|
3674
3683
|
expression: fn(i, e.match, t),
|
|
3675
|
-
preludes:
|
|
3684
|
+
preludes: xa(t) ? wa([...e.rules ?? [], ...(e.groups ?? []).flatMap((o) => o.rules)]) : []
|
|
3676
3685
|
};
|
|
3677
3686
|
}, be = (e, t, r = "handlebars") => {
|
|
3678
3687
|
if (!t?.enabled) return e;
|
|
3679
3688
|
const n = (t.rules?.length ?? 0) > 0, a = (t.groups?.length ?? 0) > 0;
|
|
3680
3689
|
if (!n && !a) return e;
|
|
3681
|
-
if (r === "mailchimp") return
|
|
3690
|
+
if (r === "mailchimp") return Ca(e, t);
|
|
3682
3691
|
const i = Vn(t, r);
|
|
3683
3692
|
if (!i) return e;
|
|
3684
|
-
const { expression: o, preludes: l } = i, c = qn(o, r),
|
|
3693
|
+
const { expression: o, preludes: l } = i, c = qn(o, r), p = Wn(r);
|
|
3685
3694
|
return `${l.length > 0 ? `${l.join(`
|
|
3686
3695
|
`)}
|
|
3687
3696
|
` : ""}${c}
|
|
3688
3697
|
${e}
|
|
3689
|
-
${
|
|
3690
|
-
},
|
|
3698
|
+
${p}`;
|
|
3699
|
+
}, $o = (e, t = "handlebars") => {
|
|
3691
3700
|
if (!e?.enabled) return null;
|
|
3692
3701
|
const r = (e.rules?.length ?? 0) > 0, n = (e.groups?.length ?? 0) > 0;
|
|
3693
3702
|
if (!r && !n) return null;
|
|
3694
3703
|
if (t === "mailchimp") {
|
|
3695
|
-
const c = [...e.rules ?? [], ...(e.groups ?? []).flatMap((v) => v.rules)],
|
|
3696
|
-
return
|
|
3697
|
-
openTag: `*|IF:${
|
|
3704
|
+
const c = [...e.rules ?? [], ...(e.groups ?? []).flatMap((v) => v.rules)], p = c.map((v) => Te(v, "mailchimp")).find((v) => v !== null);
|
|
3705
|
+
return p ? {
|
|
3706
|
+
openTag: `*|IF:${p}|*${c.length > 1 && e.match === "all" ? " …nested…" : ""}`,
|
|
3698
3707
|
closeTag: "*|END:IF|*"
|
|
3699
3708
|
} : null;
|
|
3700
3709
|
}
|
|
@@ -3708,7 +3717,7 @@ ${d}`;
|
|
|
3708
3717
|
closeTag: Wn(t)
|
|
3709
3718
|
};
|
|
3710
3719
|
}, Kn = (e) => {
|
|
3711
|
-
const t =
|
|
3720
|
+
const t = Ge(e.tag), r = String(e.value ?? "");
|
|
3712
3721
|
switch (e.operator) {
|
|
3713
3722
|
case "==":
|
|
3714
3723
|
return `String(${t}).toLowerCase() === ${JSON.stringify(r.toLowerCase())}`;
|
|
@@ -3751,21 +3760,21 @@ ${d}`;
|
|
|
3751
3760
|
default:
|
|
3752
3761
|
return "true";
|
|
3753
3762
|
}
|
|
3754
|
-
},
|
|
3763
|
+
}, _a = (e) => {
|
|
3755
3764
|
if (!e.rules.length) return null;
|
|
3756
3765
|
const t = e.rules.map(Kn);
|
|
3757
3766
|
return t.length === 1 ? t[0] : `(${t.join(e.match === "any" ? " || " : " && ")})`;
|
|
3758
|
-
},
|
|
3759
|
-
const t = (e.rules ?? []).map(Kn), r = (e.groups ?? []).map(
|
|
3767
|
+
}, Ta = (e) => {
|
|
3768
|
+
const t = (e.rules ?? []).map(Kn), r = (e.groups ?? []).map(_a).filter((i) => i !== null), n = [...t, ...r];
|
|
3760
3769
|
if (n.length === 0) return null;
|
|
3761
3770
|
if (n.length === 1) return n[0];
|
|
3762
3771
|
const a = e.match === "any" ? " || " : " && ";
|
|
3763
3772
|
return `(${n.join(a)})`;
|
|
3764
|
-
},
|
|
3773
|
+
}, rt = (e, t) => {
|
|
3765
3774
|
if (!t?.enabled) return e;
|
|
3766
3775
|
const r = (t.rules?.length ?? 0) > 0, n = (t.groups?.length ?? 0) > 0;
|
|
3767
3776
|
if (!r && !n) return e;
|
|
3768
|
-
const a =
|
|
3777
|
+
const a = Ta(t);
|
|
3769
3778
|
return a ? `{${a} && (
|
|
3770
3779
|
${e.split(`
|
|
3771
3780
|
`).map((i) => ` ${i}`).join(`
|
|
@@ -3774,9 +3783,9 @@ ${e.split(`
|
|
|
3774
3783
|
}, Ae = ({ content: e, filename: t, mimeType: r }) => {
|
|
3775
3784
|
const n = new Blob([e], { type: r }), a = URL.createObjectURL(n), i = document.createElement("a");
|
|
3776
3785
|
i.href = a, i.download = t, i.click(), URL.revokeObjectURL(a);
|
|
3777
|
-
}, ht = (e) => e.toLowerCase().replace(/\s+/g, "-"), Ne = (e, t) => `${e}${t === "wrap" ? "-master" : "-snapshot"}`,
|
|
3786
|
+
}, ht = (e) => e.toLowerCase().replace(/\s+/g, "-"), Ne = (e, t) => `${e}${t === "wrap" ? "-master" : "-snapshot"}`, Aa = /(<style[\s>][\s\S]*?<\/style>|<script[\s>][\s\S]*?<\/script>|<!--[\s\S]*?-->)/gi;
|
|
3778
3787
|
function Yn(e) {
|
|
3779
|
-
const t = e.split(
|
|
3788
|
+
const t = e.split(Aa), r = [];
|
|
3780
3789
|
return t.forEach((n, a) => {
|
|
3781
3790
|
if (a % 2 === 1) {
|
|
3782
3791
|
let i = n.replace(/^[ \t]+|[ \t]+$/gm, "");
|
|
@@ -3788,13 +3797,13 @@ function Yn(e) {
|
|
|
3788
3797
|
}
|
|
3789
3798
|
}), r.join("");
|
|
3790
3799
|
}
|
|
3791
|
-
function Aa(e) {
|
|
3792
|
-
return e && Yn(e);
|
|
3793
|
-
}
|
|
3794
3800
|
function Ra(e) {
|
|
3795
3801
|
return e && Yn(e);
|
|
3796
3802
|
}
|
|
3797
3803
|
function Ea(e) {
|
|
3804
|
+
return e && Yn(e);
|
|
3805
|
+
}
|
|
3806
|
+
function Ma(e) {
|
|
3798
3807
|
if (!e) return e;
|
|
3799
3808
|
let t = e.replace(/^[ \t]+|[ \t]+$/gm, "");
|
|
3800
3809
|
return t = t.replace(/\n{3,}/g, `
|
|
@@ -3804,17 +3813,17 @@ function Ea(e) {
|
|
|
3804
3813
|
function Be(e, t) {
|
|
3805
3814
|
switch (e) {
|
|
3806
3815
|
case "html":
|
|
3807
|
-
return Aa(t);
|
|
3808
|
-
case "mjml":
|
|
3809
3816
|
return Ra(t);
|
|
3810
|
-
case "
|
|
3817
|
+
case "mjml":
|
|
3811
3818
|
return Ea(t);
|
|
3819
|
+
case "react-email":
|
|
3820
|
+
return Ma(t);
|
|
3812
3821
|
default:
|
|
3813
3822
|
return t;
|
|
3814
3823
|
}
|
|
3815
3824
|
}
|
|
3816
|
-
var Xn = "maildeno:export:minify", lt =
|
|
3817
|
-
function
|
|
3825
|
+
var Xn = "maildeno:export:minify", lt = L(Ia());
|
|
3826
|
+
function Ia() {
|
|
3818
3827
|
if (typeof window > "u") return !1;
|
|
3819
3828
|
try {
|
|
3820
3829
|
return localStorage.getItem(Xn) === "true";
|
|
@@ -3837,8 +3846,8 @@ function Kt() {
|
|
|
3837
3846
|
}
|
|
3838
3847
|
};
|
|
3839
3848
|
}
|
|
3840
|
-
var
|
|
3841
|
-
const { rows: t, canvasStyles: r, generators: n, espSyntax: a, visibilityContext: i, tagSubstitution: o, guardEmpty: l, collectFonts: c, collectMobileCSS:
|
|
3849
|
+
var Na = 5, Ba = (e) => {
|
|
3850
|
+
const { rows: t, canvasStyles: r, generators: n, espSyntax: a, visibilityContext: i, tagSubstitution: o, guardEmpty: l, collectFonts: c, collectMobileCSS: p, buildMobileStyleBlock: v } = e, { evaluateVisibility: b } = ft(), E = (s) => s.type === "component" ? s.props?.visibility : s.visibility, w = (s) => {
|
|
3842
3851
|
if (!s?.enabled) return !1;
|
|
3843
3852
|
const S = (s.rules?.length ?? 0) > 0, C = (s.groups?.length ?? 0) > 0;
|
|
3844
3853
|
return S || C;
|
|
@@ -3848,7 +3857,7 @@ var Ia = 5, Na = (e) => {
|
|
|
3848
3857
|
if (C === "prune" && !b(E(m), S)) continue;
|
|
3849
3858
|
const h = m.type;
|
|
3850
3859
|
if (h === "row") {
|
|
3851
|
-
if (_ >=
|
|
3860
|
+
if (_ >= Na) continue;
|
|
3852
3861
|
const $ = M(m, S, C, _ + 1);
|
|
3853
3862
|
$.trim() && (g += `<table width="100%" cellpadding="0" cellspacing="0" style="border-collapse:collapse;">${$}</table>`);
|
|
3854
3863
|
continue;
|
|
@@ -3869,7 +3878,7 @@ var Ia = 5, Na = (e) => {
|
|
|
3869
3878
|
if (s.type === "row-spacer") {
|
|
3870
3879
|
if (!s.height || s.height <= 0) return "";
|
|
3871
3880
|
const I = ce(s);
|
|
3872
|
-
let
|
|
3881
|
+
let P = `
|
|
3873
3882
|
<tr>
|
|
3874
3883
|
<td>
|
|
3875
3884
|
<div height="${s.height}" style="height:${s.height}px;line-height:${s.height}px;font-size:1px;mso-line-height-rule:exactly;${I.join(";")}">
|
|
@@ -3877,20 +3886,20 @@ var Ia = 5, Na = (e) => {
|
|
|
3877
3886
|
</td>
|
|
3878
3887
|
</tr>
|
|
3879
3888
|
`;
|
|
3880
|
-
return C === "wrap" && w(s.visibility) && (
|
|
3889
|
+
return C === "wrap" && w(s.visibility) && (P = be(P, s.visibility, a.value)), P;
|
|
3881
3890
|
}
|
|
3882
3891
|
const g = ce(s), m = r.value.mobileBreakpoint || 600, h = (s.gap || 0) / m * 100, x = 100 - h * (s.columns.length - 1), y = [];
|
|
3883
3892
|
let $ = 0;
|
|
3884
3893
|
s.columns.forEach((I) => {
|
|
3885
|
-
const
|
|
3886
|
-
y.push(
|
|
3894
|
+
const P = I.width / 100 * x;
|
|
3895
|
+
y.push(P), $ += P;
|
|
3887
3896
|
});
|
|
3888
3897
|
const k = x - $;
|
|
3889
3898
|
Math.abs(k) > 0.01 && y.length > 0 && (y[y.length - 1] += k);
|
|
3890
3899
|
let A = "";
|
|
3891
|
-
s.columns.forEach((I,
|
|
3900
|
+
s.columns.forEach((I, P) => {
|
|
3892
3901
|
if (C === "prune" && !b(I.props?.visibility, S)) return;
|
|
3893
|
-
const V = y[
|
|
3902
|
+
const V = y[P], q = s.mobileStack ? "mobile-stack" : "", W = ce(I), Q = [
|
|
3894
3903
|
`width:${V}%`,
|
|
3895
3904
|
`max-width:${V}%`,
|
|
3896
3905
|
`vertical-align:${I.verticalAlign ?? "middle"}`,
|
|
@@ -3907,7 +3916,7 @@ var Ia = 5, Na = (e) => {
|
|
|
3907
3916
|
<td valign="${I.verticalAlign ?? "middle"}"${q ? ` class="${q}"` : ""} style="${Q.join(";")}">
|
|
3908
3917
|
${pe}
|
|
3909
3918
|
</td>
|
|
3910
|
-
`,
|
|
3919
|
+
`, P < s.columns.length - 1 && s.gap && (A += `
|
|
3911
3920
|
<td
|
|
3912
3921
|
class="${q ? `gap-${s.gap} ${q}` : `gap-${s.gap}`}"
|
|
3913
3922
|
width="${h}%"
|
|
@@ -3927,7 +3936,7 @@ ${A}
|
|
|
3927
3936
|
z ? `border-radius:${Y(s.border.radius, 2)}` : "",
|
|
3928
3937
|
"overflow:hidden"
|
|
3929
3938
|
].filter(Boolean);
|
|
3930
|
-
let F =
|
|
3939
|
+
let F = Pn(B, s.border, [], s.padding);
|
|
3931
3940
|
return C === "wrap" && w(s.visibility) && (F = be(F, s.visibility, a.value)), (s.minHeight ?? 0) > 0 && N.push(`min-height:${s.minHeight}px`), `
|
|
3932
3941
|
<tr>
|
|
3933
3942
|
<td${N.length ? ` style="${N.join(";")}"` : ""}>
|
|
@@ -3936,7 +3945,7 @@ ${F}
|
|
|
3936
3945
|
</tr>
|
|
3937
3946
|
`;
|
|
3938
3947
|
}, O = (s, S) => {
|
|
3939
|
-
const { getGoogleFontImports: C } = gt(), { emailMobileStyles: _ } = Jt(), g = i?.value ?? {}, m = C([...c(s, g)]), h =
|
|
3948
|
+
const { getGoogleFontImports: C } = gt(), { emailMobileStyles: _ } = Jt(), g = i?.value ?? {}, m = C([...c(s, g)]), h = p(s, g, _), x = v(r.value.mobileBreakpoint, h), y = [
|
|
3940
3949
|
"margin:0",
|
|
3941
3950
|
"padding:0",
|
|
3942
3951
|
r.value.bodyBackgroundColor ? `background-color:${r.value.bodyBackgroundColor}` : "",
|
|
@@ -4014,7 +4023,7 @@ ${r.value.preheaderText} ͏ ‌ ͏ ‌ ͏ ‌
|
|
|
4014
4023
|
mimeType: "text/html"
|
|
4015
4024
|
});
|
|
4016
4025
|
else {
|
|
4017
|
-
const h = await
|
|
4026
|
+
const h = await ia(_);
|
|
4018
4027
|
Ae({
|
|
4019
4028
|
content: h,
|
|
4020
4029
|
filename: `${Ne(g, s)}.html`,
|
|
@@ -4028,19 +4037,19 @@ ${r.value.preheaderText} ͏ ‌ ͏ ‌ ͏ ‌
|
|
|
4028
4037
|
return Be("html", C);
|
|
4029
4038
|
}
|
|
4030
4039
|
};
|
|
4031
|
-
},
|
|
4032
|
-
const { rows: t, canvasStyles: r, generators: n, espSyntax: a, visibilityContext: i, tagSubstitution: o, guardEmpty: l, collectFonts: c, collectMobileCSS:
|
|
4033
|
-
if (!
|
|
4034
|
-
const s = (
|
|
4040
|
+
}, Oa = 5, ja = (e) => {
|
|
4041
|
+
const { rows: t, canvasStyles: r, generators: n, espSyntax: a, visibilityContext: i, tagSubstitution: o, guardEmpty: l, collectFonts: c, collectMobileCSS: p, buildMobileStyleBlock: v } = e, { evaluateVisibility: b } = ft(), E = (d) => {
|
|
4042
|
+
if (!d?.enabled) return !1;
|
|
4043
|
+
const s = (d.rules?.length ?? 0) > 0, S = (d.groups?.length ?? 0) > 0;
|
|
4035
4044
|
return s || S;
|
|
4036
|
-
}, w = (
|
|
4045
|
+
}, w = (d, s, S, C, _) => {
|
|
4037
4046
|
let g = "";
|
|
4038
|
-
for (const m of
|
|
4047
|
+
for (const m of d) {
|
|
4039
4048
|
const h = m.type === "component" ? m.props?.visibility : m.visibility;
|
|
4040
4049
|
if (S === "prune" && !b(h, s)) continue;
|
|
4041
4050
|
const x = m.type;
|
|
4042
4051
|
if (x === "row") {
|
|
4043
|
-
if (_ >=
|
|
4052
|
+
if (_ >= Oa) continue;
|
|
4044
4053
|
const $ = R(m, s, S, _ + 1);
|
|
4045
4054
|
$.trim() && (g += ` ${$.trim()}
|
|
4046
4055
|
`);
|
|
@@ -4048,41 +4057,41 @@ ${r.value.preheaderText} ͏ ‌ ͏ ‌ ͏ ‌
|
|
|
4048
4057
|
}
|
|
4049
4058
|
if (x === "row-spacer") {
|
|
4050
4059
|
if (!m.height || m.height <= 0) continue;
|
|
4051
|
-
const $ =
|
|
4060
|
+
const $ = tt(m), k = Object.keys($).length > 0 ? `, ${Object.entries($).map(([f, B]) => `${f}:"${B}"`).join(", ")}` : "";
|
|
4052
4061
|
let A = `<div style={{ display: "block", height: "${m.height}px", lineHeight: "${m.height}px", fontSize: "1px"${k} }}> </div>`;
|
|
4053
|
-
S === "wrap" && E(m.visibility) && (A =
|
|
4062
|
+
S === "wrap" && E(m.visibility) && (A = rt(A, m.visibility)), g += ` ${A}
|
|
4054
4063
|
`;
|
|
4055
4064
|
continue;
|
|
4056
4065
|
}
|
|
4057
4066
|
let y = Un(n.react(m), S, o?.value);
|
|
4058
|
-
S === "wrap" && E(m.props?.visibility) && (y =
|
|
4067
|
+
S === "wrap" && E(m.props?.visibility) && (y = rt(y, m.props.visibility)), g += ` ${y.trim()}
|
|
4059
4068
|
`;
|
|
4060
4069
|
}
|
|
4061
4070
|
return g;
|
|
4062
|
-
}, R = (
|
|
4063
|
-
if (S === "prune" && !b(
|
|
4064
|
-
if (
|
|
4065
|
-
if (!
|
|
4066
|
-
const I =
|
|
4071
|
+
}, R = (d, s, S, C = 0) => {
|
|
4072
|
+
if (S === "prune" && !b(d.visibility, s)) return "";
|
|
4073
|
+
if (d.type === "row-spacer") {
|
|
4074
|
+
if (!d.height || d.height <= 0) return "";
|
|
4075
|
+
const I = tt(d), P = Object.keys(I).length > 0 ? `, ${Object.entries(I).map(([q, W]) => `${q}:"${W}"`).join(", ")}` : "";
|
|
4067
4076
|
let V = `
|
|
4068
4077
|
{/* Row Spacer */}
|
|
4069
4078
|
<Section>
|
|
4070
|
-
<div style={{ display: "block", height: "${
|
|
4079
|
+
<div style={{ display: "block", height: "${d.height}px", lineHeight: "${d.height}px", fontSize: "1px"${P} }}> </div>
|
|
4071
4080
|
</Section>`;
|
|
4072
|
-
return S === "wrap" && E(
|
|
4081
|
+
return S === "wrap" && E(d.visibility) && (V = rt(V, d.visibility)), V;
|
|
4073
4082
|
}
|
|
4074
|
-
const _ = r.value.mobileBreakpoint || 600, g = (
|
|
4083
|
+
const _ = r.value.mobileBreakpoint || 600, g = (d.gap || 0) / _ * 100, m = 100 - g * (d.columns.length - 1), h = [];
|
|
4075
4084
|
let x = 0;
|
|
4076
|
-
|
|
4077
|
-
const
|
|
4078
|
-
h.push(
|
|
4085
|
+
d.columns.forEach((I) => {
|
|
4086
|
+
const P = I.width / 100 * m;
|
|
4087
|
+
h.push(P), x += P;
|
|
4079
4088
|
});
|
|
4080
4089
|
const y = m - x;
|
|
4081
4090
|
Math.abs(y) > 0.01 && h.length > 0 && (h[h.length - 1] += y);
|
|
4082
4091
|
let $ = "";
|
|
4083
|
-
|
|
4092
|
+
d.columns.forEach((I, P) => {
|
|
4084
4093
|
if (S === "prune" && !b(I.props?.visibility, s)) return;
|
|
4085
|
-
const V = h[
|
|
4094
|
+
const V = h[P], q = d.mobileStack ? "mobile-stack" : "", W = tt(I), Q = {
|
|
4086
4095
|
width: `${V}%`,
|
|
4087
4096
|
boxSizing: "border-box",
|
|
4088
4097
|
verticalAlign: I.verticalAlign ?? "middle",
|
|
@@ -4093,30 +4102,30 @@ ${r.value.preheaderText} ͏ ‌ ͏ ‌ ͏ ‌
|
|
|
4093
4102
|
fontSize: "0",
|
|
4094
4103
|
padding: `${I.padding?.top ?? 0}px ${I.padding?.right ?? 0}px ${I.padding?.bottom ?? 0}px ${I.padding?.left ?? 0}px`,
|
|
4095
4104
|
...W
|
|
4096
|
-
}, se = Object.entries(Q).map(([le, ze]) => `${le}:"${ze}"`).join(", "), pe = I.children ?? I.components ?? [], me = w(pe, s, S,
|
|
4105
|
+
}, se = Object.entries(Q).map(([le, ze]) => `${le}:"${ze}"`).join(", "), pe = I.children ?? I.components ?? [], me = w(pe, s, S, d, C);
|
|
4097
4106
|
$ += `<Column
|
|
4098
4107
|
className="${q}"
|
|
4099
4108
|
style={{ ${se} }}
|
|
4100
4109
|
>
|
|
4101
4110
|
${me}
|
|
4102
4111
|
</Column>
|
|
4103
|
-
`,
|
|
4104
|
-
className="${q ? `gap-${
|
|
4112
|
+
`, P < d.columns.length - 1 && d.gap && ($ += `<Column
|
|
4113
|
+
className="${q ? `gap-${d.gap} ${q}` : `gap-${d.gap}`}"
|
|
4105
4114
|
style={{ width:"${g}%", maxWidth:"${g}%", fontSize:"0", lineHeight:"0" }}
|
|
4106
4115
|
> </Column>
|
|
4107
4116
|
`);
|
|
4108
4117
|
});
|
|
4109
|
-
const k =
|
|
4118
|
+
const k = tt(d), A = ee(d.border?.radius ?? 0), f = {
|
|
4110
4119
|
...k,
|
|
4111
|
-
...A ? { borderRadius: Y(
|
|
4120
|
+
...A ? { borderRadius: Y(d.border.radius, 2) } : {},
|
|
4112
4121
|
overflow: "hidden"
|
|
4113
|
-
}, B = Object.entries(f).filter(([I,
|
|
4122
|
+
}, B = Object.entries(f).filter(([I, P]) => P !== void 0 && P !== "").map(([I, P]) => `${I}:"${P}"`).join(", "), z = B ? ` style={{ ${B} }}` : "", N = `<Row>${$}</Row>`;
|
|
4114
4123
|
let F = ` <Section${z}>
|
|
4115
|
-
${
|
|
4124
|
+
${aa(N, d.border, {}, d.padding, !0)}
|
|
4116
4125
|
</Section>`;
|
|
4117
|
-
return S === "wrap" && E(
|
|
4118
|
-
}, M = (
|
|
4119
|
-
const S = s || "Untitled Template", C = S.replace(/[^a-zA-Z0-9 ]/g, "").split(" ").map((N) => N.charAt(0).toUpperCase() + N.slice(1)).join(""), { getGoogleFontImports: _ } = gt(), { emailMobileStyles: g } = Jt(), m = i?.value ?? {}, h = c(
|
|
4126
|
+
return S === "wrap" && E(d.visibility) && (F = rt(F, d.visibility)), F;
|
|
4127
|
+
}, M = (d = "prune", s) => {
|
|
4128
|
+
const S = s || "Untitled Template", C = S.replace(/[^a-zA-Z0-9 ]/g, "").split(" ").map((N) => N.charAt(0).toUpperCase() + N.slice(1)).join(""), { getGoogleFontImports: _ } = gt(), { emailMobileStyles: g } = Jt(), m = i?.value ?? {}, h = c(d, m), x = _([...h]), y = p(d, m, g), $ = v(r.value.mobileBreakpoint, y), k = t.value.map((N) => R(N, m, d, 0)).filter(Boolean).join(`
|
|
4120
4129
|
`), A = x?.includes("fonts.googleapis.com"), f = x ? A ? ` {/* Google Fonts via <link> — all families in one request */}
|
|
4121
4130
|
<link href="${x}" rel="stylesheet" />` : [...h].map((N) => ` <Font
|
|
4122
4131
|
fontFamily="${mt(N)}"
|
|
@@ -4197,58 +4206,58 @@ ${k}
|
|
|
4197
4206
|
}
|
|
4198
4207
|
`;
|
|
4199
4208
|
const z = o?.value?.mergeTagActive || o?.value?.linkTagActive;
|
|
4200
|
-
if (
|
|
4201
|
-
const N =
|
|
4202
|
-
(
|
|
4203
|
-
|
|
4209
|
+
if (d === "wrap" || !z) {
|
|
4210
|
+
const N = ha(B), F = new Set(N.map((W) => W.tagId)), I = va(t.value).filter((W) => !F.has(W)), { propsInterface: P, propsDestructure: V } = ga(N), q = ba(I);
|
|
4211
|
+
(P || q) && (B = B.replace(/^(export default function (\w+))\(\)\s*\{/m, [
|
|
4212
|
+
P ? `${P}
|
|
4204
4213
|
|
|
4205
4214
|
` : "",
|
|
4206
4215
|
`$1(${V || ""}) {`,
|
|
4207
4216
|
q ? `
|
|
4208
4217
|
${q}
|
|
4209
4218
|
` : ""
|
|
4210
|
-
].join(""))), B =
|
|
4219
|
+
].join(""))), B = fa(B);
|
|
4211
4220
|
}
|
|
4212
4221
|
return B = En(B), B;
|
|
4213
4222
|
};
|
|
4214
4223
|
return {
|
|
4215
|
-
export: async (
|
|
4224
|
+
export: async (d = "prune", s) => {
|
|
4216
4225
|
if (!l("Export")) return;
|
|
4217
|
-
const S = s || "Untitled Template", C = M(
|
|
4226
|
+
const S = s || "Untitled Template", C = M(d, S), _ = ht(S), { minifyOutput: g } = Kt();
|
|
4218
4227
|
if (g.value) Ae({
|
|
4219
4228
|
content: Be("react-email", C),
|
|
4220
|
-
filename: `${Ne(_,
|
|
4229
|
+
filename: `${Ne(_, d)}.tsx`,
|
|
4221
4230
|
mimeType: "text/plain"
|
|
4222
4231
|
});
|
|
4223
4232
|
else {
|
|
4224
|
-
const m = await
|
|
4233
|
+
const m = await sa(C);
|
|
4225
4234
|
Ae({
|
|
4226
4235
|
content: m,
|
|
4227
|
-
filename: `${Ne(_,
|
|
4236
|
+
filename: `${Ne(_, d)}.tsx`,
|
|
4228
4237
|
mimeType: "text/plain"
|
|
4229
4238
|
});
|
|
4230
4239
|
}
|
|
4231
4240
|
},
|
|
4232
|
-
getReactEmail: (
|
|
4241
|
+
getReactEmail: (d = "prune", s) => {
|
|
4233
4242
|
if (!t.value || t.value.length === 0) return null;
|
|
4234
|
-
const S = M(
|
|
4243
|
+
const S = M(d, s || "Untitled Template");
|
|
4235
4244
|
return Be("react-email", S);
|
|
4236
4245
|
}
|
|
4237
4246
|
};
|
|
4238
|
-
},
|
|
4239
|
-
const { rows: t, canvasStyles: r, generators: n, espSyntax: a, visibilityContext: i, tagSubstitution: o, guardEmpty: l, collectFonts: c, collectMobileCSS:
|
|
4240
|
-
if (!
|
|
4241
|
-
const
|
|
4242
|
-
return
|
|
4243
|
-
}, E = (
|
|
4247
|
+
}, za = 5, La = (e) => {
|
|
4248
|
+
const { rows: t, canvasStyles: r, generators: n, espSyntax: a, visibilityContext: i, tagSubstitution: o, guardEmpty: l, collectFonts: c, collectMobileCSS: p } = e, { evaluateVisibility: v } = ft(), b = (u) => {
|
|
4249
|
+
if (!u?.enabled) return !1;
|
|
4250
|
+
const d = (u.rules?.length ?? 0) > 0, s = (u.groups?.length ?? 0) > 0;
|
|
4251
|
+
return d || s;
|
|
4252
|
+
}, E = (u, d, s, S) => {
|
|
4244
4253
|
let C = "";
|
|
4245
|
-
for (const _ of
|
|
4254
|
+
for (const _ of u) {
|
|
4246
4255
|
const g = _.type === "component" ? _.props?.visibility : _.visibility;
|
|
4247
|
-
if (s === "prune" && !v(g,
|
|
4256
|
+
if (s === "prune" && !v(g, d)) continue;
|
|
4248
4257
|
const m = _.type;
|
|
4249
4258
|
if (m === "row") {
|
|
4250
|
-
if (S >=
|
|
4251
|
-
const x = w(_,
|
|
4259
|
+
if (S >= za) continue;
|
|
4260
|
+
const x = w(_, d, s, S + 1);
|
|
4252
4261
|
if (x.trim()) {
|
|
4253
4262
|
let y = x;
|
|
4254
4263
|
s === "wrap" && b(_.visibility) && (y = be(y, _.visibility, a.value)), C += y;
|
|
@@ -4266,20 +4275,20 @@ ${q}
|
|
|
4266
4275
|
s === "wrap" && b(_.props?.visibility) && (h = be(h, _.props.visibility, a.value)), C += h;
|
|
4267
4276
|
}
|
|
4268
4277
|
return C;
|
|
4269
|
-
}, w = (
|
|
4270
|
-
if (!
|
|
4271
|
-
const C = ce(
|
|
4278
|
+
}, w = (u, d, s, S) => {
|
|
4279
|
+
if (!u.columns?.length) return "";
|
|
4280
|
+
const C = ce(u), _ = r.value.mobileBreakpoint || 600, g = u.gap || 0, m = g / _ * 100, h = 100 - m * (u.columns.length - 1), x = [];
|
|
4272
4281
|
let y = 0;
|
|
4273
|
-
|
|
4282
|
+
u.columns.forEach((N) => {
|
|
4274
4283
|
const F = N.width / 100 * h;
|
|
4275
4284
|
x.push(F), y += F;
|
|
4276
4285
|
});
|
|
4277
4286
|
const $ = h - y;
|
|
4278
4287
|
Math.abs($) > 0.01 && x.length > 0 && (x[x.length - 1] += $);
|
|
4279
4288
|
let k = "";
|
|
4280
|
-
|
|
4281
|
-
if (s === "prune" && !v(N.props?.visibility,
|
|
4282
|
-
const I = x[F],
|
|
4289
|
+
u.columns.forEach((N, F) => {
|
|
4290
|
+
if (s === "prune" && !v(N.props?.visibility, d)) return;
|
|
4291
|
+
const I = x[F], P = u.mobileStack ? "mobile-stack" : "", V = ce(N), q = [
|
|
4283
4292
|
`width:${I}%`,
|
|
4284
4293
|
"box-sizing:border-box",
|
|
4285
4294
|
`vertical-align:${N.verticalAlign ?? "middle"}`,
|
|
@@ -4287,25 +4296,25 @@ ${q}
|
|
|
4287
4296
|
`border-radius:${Y(N.border.radius)}`,
|
|
4288
4297
|
"overflow:hidden",
|
|
4289
4298
|
...V
|
|
4290
|
-
], W = N.children ?? N.components ?? [], Q = E(W,
|
|
4299
|
+
], W = N.children ?? N.components ?? [], Q = E(W, d, s, S), se = Pn(Q, N.border, [], N.padding), pe = P ? ` class="${P}"` : "";
|
|
4291
4300
|
if (k += `<td valign="${N.verticalAlign ?? "middle"}"${pe} style="${q.join(";")}">
|
|
4292
4301
|
${se}
|
|
4293
4302
|
</td>
|
|
4294
|
-
`, F <
|
|
4295
|
-
const me =
|
|
4303
|
+
`, F < u.columns.length - 1 && g > 0) {
|
|
4304
|
+
const me = P ? `gap-${g} ${P}` : `gap-${g}`;
|
|
4296
4305
|
k += `<td class="${me}" width="${m}%" style="width:${m}%;max-width:${m}%;font-size:0;line-height:0;padding:0;"> </td>
|
|
4297
4306
|
`;
|
|
4298
4307
|
}
|
|
4299
4308
|
});
|
|
4300
|
-
const A = de(
|
|
4309
|
+
const A = de(u.border) ? `${ue(u.border)};border-radius:${Y(u.border.radius)};overflow:hidden;` : `border-radius:${Y(u.border.radius)};overflow:hidden;`, f = u.padding ? `${u.padding.top ?? 0}px ${u.padding.right ?? 0}px ${u.padding.bottom ?? 0}px ${u.padding.left ?? 0}px` : "0px", B = C.length ? `${C.join(";")};` : "", z = u.columns.some((N) => ee(N.border?.radius ?? 0));
|
|
4301
4310
|
return `<div style="padding:${f};${A}${B}">
|
|
4302
|
-
<table width="100%" cellpadding="0" cellspacing="0" style="border-collapse:${(
|
|
4311
|
+
<table width="100%" cellpadding="0" cellspacing="0" style="border-collapse:${(u.gap ?? 0) > 0 || z ? "separate" : "collapse"};">
|
|
4303
4312
|
<tr>
|
|
4304
4313
|
${k}</tr>
|
|
4305
4314
|
</table>
|
|
4306
4315
|
</div>`;
|
|
4307
|
-
}, R = (
|
|
4308
|
-
const s =
|
|
4316
|
+
}, R = (u = "prune", d) => {
|
|
4317
|
+
const s = d || "Untitled Template", { getGoogleFontImports: S } = gt(), { emailMobileStyles: C } = Jt(), { assembleMJML: _ } = Nn(), g = i?.value ?? {}, m = S([...c(u, g)]), h = p(u, g, C), x = Ln(t.value), y = [
|
|
4309
4318
|
".email-container { max-width:100% !important; width:100% !important; }",
|
|
4310
4319
|
".desktop-hide { display:block !important; }",
|
|
4311
4320
|
".mobile-hide { display:none !important; }",
|
|
@@ -4320,7 +4329,7 @@ ${k}</tr>
|
|
|
4320
4329
|
].join(`
|
|
4321
4330
|
`) : y, k = [];
|
|
4322
4331
|
t.value.forEach((f) => {
|
|
4323
|
-
if (
|
|
4332
|
+
if (u === "prune" && !v(f.visibility, g)) return;
|
|
4324
4333
|
if (f.type === "row-spacer") {
|
|
4325
4334
|
if (!f.height || f.height <= 0) return;
|
|
4326
4335
|
const H = ce(f);
|
|
@@ -4333,16 +4342,16 @@ ${k}</tr>
|
|
|
4333
4342
|
</tr>
|
|
4334
4343
|
</table>
|
|
4335
4344
|
</mj-raw>`;
|
|
4336
|
-
|
|
4345
|
+
u === "wrap" && b(f.visibility) && (D = be(D, f.visibility, a.value)), k.push(D);
|
|
4337
4346
|
return;
|
|
4338
4347
|
}
|
|
4339
4348
|
const B = r.value.mobileBreakpoint || 600, z = f.gap || 0, N = z / B * 100, F = 100 - N * (f.columns.length - 1), I = [];
|
|
4340
|
-
let
|
|
4349
|
+
let P = 0;
|
|
4341
4350
|
f.columns.forEach((H) => {
|
|
4342
4351
|
const D = H.width / 100 * F;
|
|
4343
|
-
I.push(D),
|
|
4352
|
+
I.push(D), P += D;
|
|
4344
4353
|
});
|
|
4345
|
-
const V = F -
|
|
4354
|
+
const V = F - P;
|
|
4346
4355
|
Math.abs(V) > 0.01 && I.length > 0 && (I[I.length - 1] += V);
|
|
4347
4356
|
const q = ce(f), W = (() => {
|
|
4348
4357
|
const H = f.backgroundGradient;
|
|
@@ -4350,17 +4359,17 @@ ${k}</tr>
|
|
|
4350
4359
|
})(), Q = W && W !== "transparent" ? W : "", se = f.padding ? `${f.padding.top ?? 0}px ${f.padding.right ?? 0}px ${f.padding.bottom ?? 0}px ${f.padding.left ?? 0}px` : "0px", pe = ee(f.border?.radius ?? 0), me = de(f.border) && !ee(f.border?.radius ?? 0), le = [...q, "overflow:hidden"];
|
|
4351
4360
|
me && (le.push(ue(f.border)), le.push(`padding:${se}`)), pe && le.push(`border-radius:${Y(f.border.radius, 2)}`), (f.minHeight ?? 0) > 0 && le.push(`min-height:${f.minHeight}px`);
|
|
4352
4361
|
const ze = le.length ? ` style="${le.join(";")}"` : "";
|
|
4353
|
-
let
|
|
4354
|
-
de(f.border) && (
|
|
4355
|
-
const
|
|
4362
|
+
let Le = "";
|
|
4363
|
+
de(f.border) && (Le = `${ue(f.border)};`, ee(f.border?.radius ?? 0) && (Le += `border-radius:${Y(f.border.radius)};overflow:hidden;`));
|
|
4364
|
+
const We = [
|
|
4356
4365
|
`padding:${se}`,
|
|
4357
4366
|
"font-size:0",
|
|
4358
4367
|
"line-height:0",
|
|
4359
|
-
|
|
4368
|
+
Le
|
|
4360
4369
|
].filter(Boolean).join(";");
|
|
4361
4370
|
let U = "";
|
|
4362
4371
|
f.columns.forEach((H, D) => {
|
|
4363
|
-
if (
|
|
4372
|
+
if (u === "prune" && !v(H.props?.visibility, g)) return;
|
|
4364
4373
|
const te = I[D], Re = f.mobileStack ? "mobile-stack" : "", vt = ce(H), bt = [
|
|
4365
4374
|
`width:${te}%`,
|
|
4366
4375
|
"box-sizing:border-box",
|
|
@@ -4372,7 +4381,7 @@ ${k}</tr>
|
|
|
4372
4381
|
"line-height:0",
|
|
4373
4382
|
"font-size:0",
|
|
4374
4383
|
`padding:${H.padding?.top ?? 0}px ${H.padding?.right ?? 0}px ${H.padding?.bottom ?? 0}px ${H.padding?.left ?? 0}px`
|
|
4375
|
-
],
|
|
4384
|
+
], Ve = H.children ?? H.components ?? [], $t = E(Ve, g, u, 0), yt = Re ? ` class="${Re}"` : "";
|
|
4376
4385
|
if (U += `<td valign="${H.verticalAlign ?? "middle"}"${yt} style="${bt.join(";")}">
|
|
4377
4386
|
${$t}
|
|
4378
4387
|
</td>
|
|
@@ -4383,11 +4392,11 @@ ${$t}
|
|
|
4383
4392
|
}
|
|
4384
4393
|
});
|
|
4385
4394
|
const X = f.columns.some((H) => ee(H.border?.radius ?? 0));
|
|
4386
|
-
let ke = `<div style="${
|
|
4395
|
+
let ke = `<div style="${We}">${`<table width="100%" cellpadding="0" cellspacing="0" style="border-collapse:${(f.gap ?? 0) > 0 || X ? "separate" : "collapse"};">
|
|
4387
4396
|
<tr>
|
|
4388
4397
|
${U}</tr>
|
|
4389
4398
|
</table>`}</div>`;
|
|
4390
|
-
|
|
4399
|
+
u === "wrap" && b(f.visibility) && (ke = be(ke, f.visibility, a.value));
|
|
4391
4400
|
const $e = r.value.width ?? 600;
|
|
4392
4401
|
k.push(` <mj-raw>
|
|
4393
4402
|
<!--[if mso | IE]><table align="center" border="0" cellpadding="0" cellspacing="0" role="presentation" style="width:${$e}px;" width="${$e}"${Q ? ` bgcolor="${Q}"` : ""}><tr><td style="line-height:0px;font-size:0px;mso-line-height-rule:exactly;"><![endif]-->
|
|
@@ -4407,29 +4416,29 @@ ${U}</tr>
|
|
|
4407
4416
|
});
|
|
4408
4417
|
let A = _(s, k.join(`
|
|
4409
4418
|
`), r.value, m, $, r.value.mobileBreakpoint ?? 600, "");
|
|
4410
|
-
return A = Hn(A,
|
|
4419
|
+
return A = Hn(A, u, a.value, o?.value, !0), A;
|
|
4411
4420
|
};
|
|
4412
4421
|
return {
|
|
4413
|
-
export: async (
|
|
4422
|
+
export: async (u = "prune", d) => {
|
|
4414
4423
|
if (!l("Export")) return;
|
|
4415
|
-
const s =
|
|
4424
|
+
const s = d || "Untitled Template", S = R(u, s), C = ht(s), { minifyOutput: _ } = Kt();
|
|
4416
4425
|
if (_.value) Ae({
|
|
4417
4426
|
content: Be("mjml", S),
|
|
4418
|
-
filename: `${Ne(C,
|
|
4427
|
+
filename: `${Ne(C, u)}.mjml`,
|
|
4419
4428
|
mimeType: "text/plain"
|
|
4420
4429
|
});
|
|
4421
4430
|
else {
|
|
4422
|
-
const g = await
|
|
4431
|
+
const g = await la(S);
|
|
4423
4432
|
Ae({
|
|
4424
4433
|
content: g,
|
|
4425
|
-
filename: `${Ne(C,
|
|
4434
|
+
filename: `${Ne(C, u)}.mjml`,
|
|
4426
4435
|
mimeType: "text/plain"
|
|
4427
4436
|
});
|
|
4428
4437
|
}
|
|
4429
4438
|
},
|
|
4430
|
-
getMJML: (
|
|
4439
|
+
getMJML: (u = "prune", d) => {
|
|
4431
4440
|
if (!t.value || t.value.length === 0) return null;
|
|
4432
|
-
const s = R(
|
|
4441
|
+
const s = R(u, d || "Untitled Template");
|
|
4433
4442
|
return Be("mjml", s);
|
|
4434
4443
|
}
|
|
4435
4444
|
};
|
|
@@ -4437,7 +4446,7 @@ ${U}</tr>
|
|
|
4437
4446
|
const { rows: t, canvasStyles: r, saveToHistoryFn: n, guardEmpty: a } = e, i = e.notify ?? ((v, b = "Import failed") => console.error(`[maildeno-editor] ${b}: ${v}`)), o = (v) => {
|
|
4438
4447
|
const b = v || "Untitled Template";
|
|
4439
4448
|
return {
|
|
4440
|
-
template_id:
|
|
4449
|
+
template_id: it(b),
|
|
4441
4450
|
template_name: b,
|
|
4442
4451
|
canvas: Tn(JSON.parse(JSON.stringify(r.value))),
|
|
4443
4452
|
rows: An(JSON.parse(JSON.stringify(t.value))),
|
|
@@ -4467,10 +4476,10 @@ ${U}</tr>
|
|
|
4467
4476
|
},
|
|
4468
4477
|
getJSON: (v) => !t.value || t.value.length === 0 ? null : o(v)
|
|
4469
4478
|
};
|
|
4470
|
-
},
|
|
4479
|
+
}, Da = 5, gn = /font-family\s*:\s*([^;<]+)/gi, Fa = (e) => e.replace(/"/g, '"').replace(/'/g, "'").replace(/'/g, "'"), Ha = (e) => {
|
|
4471
4480
|
if (!e || typeof e != "string") return [];
|
|
4472
4481
|
if (e.indexOf("font-family") === -1) return [];
|
|
4473
|
-
const t =
|
|
4482
|
+
const t = Fa(e), r = [];
|
|
4474
4483
|
let n;
|
|
4475
4484
|
for (gn.lastIndex = 0; (n = gn.exec(t)) !== null; ) {
|
|
4476
4485
|
const a = n[1];
|
|
@@ -4478,10 +4487,10 @@ ${U}</tr>
|
|
|
4478
4487
|
let i = a;
|
|
4479
4488
|
const o = i.trimStart()[0];
|
|
4480
4489
|
if (o === '"' || o === "'") {
|
|
4481
|
-
const c = i.indexOf(o),
|
|
4482
|
-
if (
|
|
4483
|
-
const v = i.slice(
|
|
4484
|
-
i = v === -1 ? i : i.slice(0,
|
|
4490
|
+
const c = i.indexOf(o), p = i.indexOf(o, c + 1);
|
|
4491
|
+
if (p !== -1) {
|
|
4492
|
+
const v = i.slice(p + 1).search(/["<]/);
|
|
4493
|
+
i = v === -1 ? i : i.slice(0, p + 1 + v);
|
|
4485
4494
|
}
|
|
4486
4495
|
} else {
|
|
4487
4496
|
const c = i.search(/["<]/);
|
|
@@ -4491,35 +4500,35 @@ ${U}</tr>
|
|
|
4491
4500
|
l && r.push(l);
|
|
4492
4501
|
}
|
|
4493
4502
|
return r;
|
|
4494
|
-
},
|
|
4503
|
+
}, Ua = (e, t, r, n, a, i, o, l, c, p) => {
|
|
4495
4504
|
let v, b, E, w;
|
|
4496
4505
|
typeof r == "object" && !("value" in r) ? (v = r, b = n, E = a, w = i) : (v = {
|
|
4497
4506
|
html: r,
|
|
4498
4507
|
react: n,
|
|
4499
4508
|
mjml: a
|
|
4500
4509
|
}, b = i, E = o, w = l);
|
|
4501
|
-
const { evaluateVisibility: R } = ft(), { open: M } =
|
|
4502
|
-
if (!(B >=
|
|
4510
|
+
const { evaluateVisibility: R } = ft(), { open: M } = p ?? ea(), O = c ?? L({ syntax: "handlebars" }), u = ($, k, A, f, B = 0) => {
|
|
4511
|
+
if (!(B >= Da))
|
|
4503
4512
|
for (const z of $) {
|
|
4504
4513
|
const N = z.type;
|
|
4505
4514
|
if (N === "row") {
|
|
4506
4515
|
if (k === "prune" && !R(z.visibility, A)) continue;
|
|
4507
4516
|
for (const F of z.columns ?? []) {
|
|
4508
4517
|
const I = F.children ?? F.components ?? [];
|
|
4509
|
-
|
|
4518
|
+
u(I, k, A, f, B + 1);
|
|
4510
4519
|
}
|
|
4511
4520
|
continue;
|
|
4512
4521
|
}
|
|
4513
4522
|
N !== "row-spacer" && (k === "prune" && !R(z.props?.visibility, A) || f(z));
|
|
4514
4523
|
}
|
|
4515
|
-
},
|
|
4524
|
+
}, d = ($) => !e.value || e.value.length === 0 ? (M("Your template is empty. Please add at least one row before exporting.", $), !1) : !0, s = ($, k) => {
|
|
4516
4525
|
const A = /* @__PURE__ */ new Set();
|
|
4517
4526
|
return e.value.forEach((f) => {
|
|
4518
4527
|
$ === "prune" && !R(f.visibility, k) || f.columns && f.columns.forEach((B) => {
|
|
4519
4528
|
const z = B.children ?? B.components ?? [];
|
|
4520
|
-
|
|
4529
|
+
u(z, $, k, (N) => {
|
|
4521
4530
|
if (N.props?.fontFamily && A.add(N.props.fontFamily), N.props?.mobile?.fontFamily && A.add(N.props.mobile.fontFamily), typeof N.props?.content == "string") {
|
|
4522
|
-
const F =
|
|
4531
|
+
const F = Ha(N.props.content);
|
|
4523
4532
|
for (const I of F) A.add(I);
|
|
4524
4533
|
}
|
|
4525
4534
|
});
|
|
@@ -4530,14 +4539,14 @@ ${U}</tr>
|
|
|
4530
4539
|
return e.value.forEach((B) => {
|
|
4531
4540
|
$ === "prune" && !R(B.visibility, k) || B.columns && B.columns.forEach((z) => {
|
|
4532
4541
|
const N = z.children ?? z.components ?? [];
|
|
4533
|
-
|
|
4542
|
+
u(N, $, k, (F) => {
|
|
4534
4543
|
const I = A(F, `eb-${F.id}`);
|
|
4535
4544
|
I && f.push(I);
|
|
4536
4545
|
});
|
|
4537
4546
|
});
|
|
4538
4547
|
}), f;
|
|
4539
4548
|
}, C = ($, k) => {
|
|
4540
|
-
const A =
|
|
4549
|
+
const A = Ln(e.value), f = k.length > 0 ? `
|
|
4541
4550
|
|
|
4542
4551
|
/* Mobile property overrides */
|
|
4543
4552
|
${k.join(`
|
|
@@ -4566,15 +4575,15 @@ ${A}` : ""}${f}
|
|
|
4566
4575
|
espSyntax: _,
|
|
4567
4576
|
visibilityContext: E,
|
|
4568
4577
|
tagSubstitution: w,
|
|
4569
|
-
guardEmpty:
|
|
4578
|
+
guardEmpty: d,
|
|
4570
4579
|
collectFonts: s,
|
|
4571
4580
|
collectMobileCSS: S,
|
|
4572
4581
|
buildMobileStyleBlock: C
|
|
4573
|
-
}, m =
|
|
4582
|
+
}, m = Ba(g), h = ja(g), x = La(g), y = Pa({
|
|
4574
4583
|
rows: e,
|
|
4575
4584
|
canvasStyles: t,
|
|
4576
4585
|
saveToHistoryFn: b,
|
|
4577
|
-
guardEmpty:
|
|
4586
|
+
guardEmpty: d,
|
|
4578
4587
|
notify: ($, k) => M($, k ?? "Import failed")
|
|
4579
4588
|
});
|
|
4580
4589
|
return {
|
|
@@ -4589,7 +4598,7 @@ ${A}` : ""}${f}
|
|
|
4589
4598
|
importJSON: y.import,
|
|
4590
4599
|
espConfig: O
|
|
4591
4600
|
};
|
|
4592
|
-
},
|
|
4601
|
+
}, Ja = 3e3, Me = null, Ue, at, oe = -1, ot = () => ({
|
|
4593
4602
|
language: "en-US",
|
|
4594
4603
|
preheaderText: "View this email in your browser",
|
|
4595
4604
|
bodyBackgroundColor: "#f9fafb",
|
|
@@ -4607,39 +4616,39 @@ ${A}` : ""}${f}
|
|
|
4607
4616
|
},
|
|
4608
4617
|
mobileBreakpoint: 600
|
|
4609
4618
|
}), Qn = /* @__PURE__ */ Symbol("maildeno-editor:email-builder");
|
|
4610
|
-
function
|
|
4611
|
-
const r =
|
|
4619
|
+
function yo(e, t) {
|
|
4620
|
+
const r = Ga(e, t);
|
|
4612
4621
|
return Ie(Qn, r), r;
|
|
4613
4622
|
}
|
|
4614
|
-
var
|
|
4623
|
+
var So = () => {
|
|
4615
4624
|
const e = Oe(Qn);
|
|
4616
4625
|
if (!e) throw new Error("[maildeno-editor] useEmailBuilder() was called outside an EmailEditor instance. This composable only works inside the component tree under <EmailEditor>, which is where provideEmailBuilder() creates the shared instance.");
|
|
4617
4626
|
return e;
|
|
4618
4627
|
};
|
|
4619
|
-
function
|
|
4620
|
-
const r = e ?? hr(), n = vr(), a =
|
|
4621
|
-
|
|
4628
|
+
function Ga(e, t) {
|
|
4629
|
+
const r = e ?? hr(), n = vr(), a = L([]), i = L(null), o = L(ot()), l = L(null), c = L([]), p = L(null), v = L(null), b = L("properties"), E = L("desktop"), w = L(!1), R = L(!1), M = L(null), O = L("create"), u = L({}), d = L(null), s = (T, j, J = "") => {
|
|
4630
|
+
d.value = {
|
|
4622
4631
|
componentId: T,
|
|
4623
4632
|
tagName: j,
|
|
4624
4633
|
default: J
|
|
4625
4634
|
};
|
|
4626
|
-
}, S =
|
|
4635
|
+
}, S = L({}), C = L(!1), _ = L({}), g = L(!1), m = L(null), h = L(null), x = L(!1), y = L(!1), $ = L(null), k = L({ syntax: "handlebars" }), { defaultProps: A } = jt(), f = xr(), B = () => f.getCurrentState(a, o), z = (T) => f.restoreState(T, a, o, i, p, v), { generateHTMLComponent: N } = Gr(), { generateReactEmailComponent: F } = Yr(), { generateMJMLComponent: I } = Nn(), P = {
|
|
4627
4636
|
html: N,
|
|
4628
4637
|
react: F,
|
|
4629
4638
|
mjml: I
|
|
4630
|
-
}, { saveToLocal: V, flushSave: q, loadFromLocal: W, clearLocal: Q, hasDraft: se, saveStatus: pe, lastSaved: me } = Ur(), { syncFontsForTemplate: le } = gt(), ze = 5,
|
|
4639
|
+
}, { saveToLocal: V, flushSave: q, loadFromLocal: W, clearLocal: Q, hasDraft: se, saveStatus: pe, lastSaved: me } = Ur(), { syncFontsForTemplate: le } = gt(), ze = 5, Le = (T) => {
|
|
4631
4640
|
const j = /* @__PURE__ */ new Set(), J = (G, we) => {
|
|
4632
4641
|
if (!(we >= ze))
|
|
4633
|
-
for (const
|
|
4634
|
-
if (!
|
|
4635
|
-
const Qt =
|
|
4642
|
+
for (const Ke of G) {
|
|
4643
|
+
if (!Ke) continue;
|
|
4644
|
+
const Qt = Ke.type;
|
|
4636
4645
|
if (Qt === "row") {
|
|
4637
|
-
for (const Zt of
|
|
4646
|
+
for (const Zt of Ke.columns ?? []) J(Zt.children ?? Zt.components ?? [], we + 1);
|
|
4638
4647
|
continue;
|
|
4639
4648
|
}
|
|
4640
4649
|
if (Qt === "row-spacer") continue;
|
|
4641
|
-
const
|
|
4642
|
-
|
|
4650
|
+
const Ye = Ke.props;
|
|
4651
|
+
Ye?.fontFamily && j.add(Ye.fontFamily), Ye?.mobile?.fontFamily && j.add(Ye.mobile.fontFamily);
|
|
4643
4652
|
}
|
|
4644
4653
|
};
|
|
4645
4654
|
for (const G of T)
|
|
@@ -4650,20 +4659,20 @@ function Ja(e, t) {
|
|
|
4650
4659
|
{
|
|
4651
4660
|
let T = null;
|
|
4652
4661
|
mr(() => {
|
|
4653
|
-
const j =
|
|
4662
|
+
const j = Le(a.value);
|
|
4654
4663
|
T && clearTimeout(T), T = setTimeout(() => {
|
|
4655
4664
|
T = null, le(j);
|
|
4656
4665
|
}, 200);
|
|
4657
4666
|
});
|
|
4658
4667
|
}
|
|
4659
|
-
const
|
|
4668
|
+
const We = gr();
|
|
4660
4669
|
let U = null, X = !1;
|
|
4661
4670
|
const ke = () => {
|
|
4662
|
-
X ||
|
|
4671
|
+
X || We.value && (U && clearTimeout(U), U = setTimeout(() => {
|
|
4663
4672
|
U = null;
|
|
4664
4673
|
const T = f.version.value;
|
|
4665
|
-
T !== oe && (oe = T, Ue = l.value ?? void 0, V(a.value, o.value, Me, Ue,
|
|
4666
|
-
},
|
|
4674
|
+
T !== oe && (oe = T, Ue = l.value ?? void 0, V(a.value, o.value, Me, Ue, at));
|
|
4675
|
+
}, Ja));
|
|
4667
4676
|
};
|
|
4668
4677
|
function $e(T = "change", j = !1) {
|
|
4669
4678
|
f.saveToHistory(B, T, j), ke();
|
|
@@ -4671,18 +4680,18 @@ function Ja(e, t) {
|
|
|
4671
4680
|
function H(T) {
|
|
4672
4681
|
$e(T, !0);
|
|
4673
4682
|
}
|
|
4674
|
-
const D = Sr(a, i, A, H, $e), te = () => D.rebuildIdRegistry(), Re = (T) => D.addRow(T, !0), vt = () => D.addSpacer(!0), bt = (T, j) => D.reorderRows(T, j, !0),
|
|
4683
|
+
const D = Sr(a, i, A, H, $e), te = () => D.rebuildIdRegistry(), Re = (T) => D.addRow(T, !0), vt = () => D.addSpacer(!0), bt = (T, j) => D.reorderRows(T, j, !0), Ve = (T, j) => {
|
|
4675
4684
|
if (T?.id && (j.add(T.id), T.type === "row" && Array.isArray(T.columns)))
|
|
4676
4685
|
for (const J of T.columns) {
|
|
4677
4686
|
J?.id && j.add(J.id);
|
|
4678
4687
|
const G = J.children ?? J.components ?? [];
|
|
4679
|
-
for (const we of G)
|
|
4688
|
+
for (const we of G) Ve(we, j);
|
|
4680
4689
|
}
|
|
4681
4690
|
}, $t = (T) => {
|
|
4682
4691
|
const j = D.findRow(T);
|
|
4683
4692
|
if (j) {
|
|
4684
4693
|
const J = /* @__PURE__ */ new Set();
|
|
4685
|
-
|
|
4694
|
+
Ve(j, J), i.value && J.has(i.value) && (i.value = null), p.value && J.has(p.value) && (p.value = null), v.value && (J.has(v.value.rowId) || J.has(v.value.columnId)) && (v.value = null);
|
|
4686
4695
|
}
|
|
4687
4696
|
D.deleteRow(T);
|
|
4688
4697
|
}, yt = Ce(() => ({
|
|
@@ -4690,24 +4699,24 @@ function Ja(e, t) {
|
|
|
4690
4699
|
mergeTagActive: C.value,
|
|
4691
4700
|
linkTagContext: _.value,
|
|
4692
4701
|
linkTagActive: g.value
|
|
4693
|
-
})), ne =
|
|
4702
|
+
})), ne = Ua(a, o, P, $e, u, yt, void 0, void 0, k, t);
|
|
4694
4703
|
{
|
|
4695
4704
|
const T = () => {
|
|
4696
|
-
U && (clearTimeout(U), U = null, q(a.value, o.value, Me, Ue,
|
|
4705
|
+
U && (clearTimeout(U), U = null, q(a.value, o.value, Me, Ue, at), oe = f.version.value);
|
|
4697
4706
|
};
|
|
4698
4707
|
window.addEventListener("beforeunload", T), dr(() => {
|
|
4699
|
-
window.removeEventListener("beforeunload", T), U && (clearTimeout(U), U = null, q(a.value, o.value, Me, Ue,
|
|
4708
|
+
window.removeEventListener("beforeunload", T), U && (clearTimeout(U), U = null, q(a.value, o.value, Me, Ue, at), oe = f.version.value);
|
|
4700
4709
|
});
|
|
4701
4710
|
}
|
|
4702
4711
|
const Yt = () => {
|
|
4703
4712
|
if (a.value.length > 0)
|
|
4704
|
-
return w.value = !0, te(), i.value = null,
|
|
4713
|
+
return w.value = !0, te(), i.value = null, p.value = null, v.value = null, b.value = "properties", null;
|
|
4705
4714
|
const T = W();
|
|
4706
|
-
return !T || T.templateId !== null ? (w.value = !0, null) : (w.value = !1, X = !0, a.value = T.rows, o.value = T.canvas, i.value = null,
|
|
4715
|
+
return !T || T.templateId !== null ? (w.value = !0, null) : (w.value = !1, X = !0, a.value = T.rows, o.value = T.canvas, i.value = null, p.value = null, v.value = null, b.value = "properties", ye(() => {
|
|
4707
4716
|
X = !1, te(), f.initialize(B()), oe = f.version.value, w.value = !0;
|
|
4708
4717
|
}), me.value = new Date(T.updatedAt), T.name !== void 0 && (l.value = T.name), T.tags !== void 0 && (c.value = T.tags), T.updatedAt);
|
|
4709
4718
|
}, Zn = async (T) => {
|
|
4710
|
-
if (!
|
|
4719
|
+
if (!We.value) throw new Error("[maildeno-editor] this editor has no saveTemplate — nothing was saved");
|
|
4711
4720
|
const { templateId: j } = await r.saveTemplate(T, M.value ?? void 0);
|
|
4712
4721
|
M.value = j, O.value === "create" && (O.value = "edit");
|
|
4713
4722
|
const J = ne.getExportedJSON(T.name);
|
|
@@ -4721,33 +4730,33 @@ function Ja(e, t) {
|
|
|
4721
4730
|
tags: j.tags
|
|
4722
4731
|
}, T), M.value = T, O.value = "edit", !0) : !1;
|
|
4723
4732
|
}, tr = () => {
|
|
4724
|
-
w.value = !1, v.value = null,
|
|
4733
|
+
w.value = !1, v.value = null, p.value = null, b.value = "properties", U && (clearTimeout(U), U = null);
|
|
4725
4734
|
const T = W();
|
|
4726
4735
|
if (T && T.templateId === null) {
|
|
4727
4736
|
Yt();
|
|
4728
4737
|
return;
|
|
4729
4738
|
}
|
|
4730
|
-
T && T.templateId !== null && Q(), X = !0, a.value = [], i.value = null, o.value =
|
|
4739
|
+
T && T.templateId !== null && Q(), X = !0, a.value = [], i.value = null, o.value = ot(), Me = null, l.value = null, c.value = [], ye(() => {
|
|
4731
4740
|
X = !1, te(), f.initialize(B()), oe = f.version.value, w.value = !0;
|
|
4732
4741
|
});
|
|
4733
4742
|
}, nr = () => {
|
|
4734
|
-
w.value = !1, v.value = null,
|
|
4743
|
+
w.value = !1, v.value = null, p.value = null, b.value = "properties", U && (clearTimeout(U), U = null), Q(), X = !0, a.value = [], i.value = null, o.value = ot(), Me = null, M.value = null, O.value = "create", l.value = null, c.value = [], ye(() => {
|
|
4735
4744
|
X = !1, te(), f.initialize(B()), oe = f.version.value, w.value = !0;
|
|
4736
4745
|
});
|
|
4737
4746
|
}, Xt = (T, j, J) => {
|
|
4738
|
-
w.value = !1, Me = j, Ue = T.name,
|
|
4747
|
+
w.value = !1, Me = j, Ue = T.name, at = T.tags, l.value = T.name ?? null, c.value = T.tags ?? [], U && (clearTimeout(U), U = null);
|
|
4739
4748
|
const G = W();
|
|
4740
4749
|
if (G && G.templateId === j) {
|
|
4741
|
-
console.info(`[EmailBuilder] Restoring local draft for template ${j} (saved ${G.updatedAt}).`), G.name !== void 0 && (l.value = G.name), G.tags !== void 0 && (c.value = G.tags), X = !0, o.value = G.canvas, a.value = G.rows, i.value = null,
|
|
4750
|
+
console.info(`[EmailBuilder] Restoring local draft for template ${j} (saved ${G.updatedAt}).`), G.name !== void 0 && (l.value = G.name), G.tags !== void 0 && (c.value = G.tags), X = !0, o.value = G.canvas, a.value = G.rows, i.value = null, p.value = null, v.value = null, b.value = "properties", ye(() => {
|
|
4742
4751
|
X = !1, te(), f.initialize(B()), oe = f.version.value, w.value = !0, J?.();
|
|
4743
4752
|
}), me.value = new Date(G.updatedAt);
|
|
4744
4753
|
return;
|
|
4745
4754
|
}
|
|
4746
|
-
G && G.templateId !== j && (console.info(`[EmailBuilder] Clearing stale draft (belongs to ${G.templateId}, current is ${j}).`), Q()), X = !0, o.value = ct(JSON.parse(JSON.stringify(T.canvas))), a.value = ut(JSON.parse(JSON.stringify(T.content?.rows ?? []))), i.value = null,
|
|
4755
|
+
G && G.templateId !== j && (console.info(`[EmailBuilder] Clearing stale draft (belongs to ${G.templateId}, current is ${j}).`), Q()), X = !0, o.value = ct(JSON.parse(JSON.stringify(T.canvas))), a.value = ut(JSON.parse(JSON.stringify(T.content?.rows ?? []))), i.value = null, p.value = null, v.value = null, b.value = "properties", ye(() => {
|
|
4747
4756
|
X = !1, te(), f.initialize(B()), oe = f.version.value, w.value = !0, J?.();
|
|
4748
4757
|
});
|
|
4749
4758
|
}, St = (T, j = "restore-version") => {
|
|
4750
|
-
U && (clearTimeout(U), U = null), X = !0, o.value = ct(JSON.parse(JSON.stringify(T.canvas))), a.value = ut(JSON.parse(JSON.stringify(T.content?.rows ?? []))), i.value = null,
|
|
4759
|
+
U && (clearTimeout(U), U = null), X = !0, o.value = ct(JSON.parse(JSON.stringify(T.canvas))), a.value = ut(JSON.parse(JSON.stringify(T.content?.rows ?? []))), i.value = null, p.value = null, v.value = null, b.value = "properties", ye(() => {
|
|
4751
4760
|
X = !1, te(), H(j);
|
|
4752
4761
|
});
|
|
4753
4762
|
}, rr = () => {
|
|
@@ -4755,7 +4764,7 @@ function Ja(e, t) {
|
|
|
4755
4764
|
}, ar = () => {
|
|
4756
4765
|
f.redo(z) && (te(), ke());
|
|
4757
4766
|
}, or = () => {
|
|
4758
|
-
a.value = [], i.value = null,
|
|
4767
|
+
a.value = [], i.value = null, p.value = null, v.value = null, b.value = "properties", o.value = ot(), ye(() => {
|
|
4759
4768
|
te(), f.initialize(B()), oe = f.version.value;
|
|
4760
4769
|
});
|
|
4761
4770
|
}, ir = () => {
|
|
@@ -4799,10 +4808,10 @@ function Ja(e, t) {
|
|
|
4799
4808
|
previewMode: E,
|
|
4800
4809
|
sidebarTab: b,
|
|
4801
4810
|
selectedId: i,
|
|
4802
|
-
selectedRowId:
|
|
4811
|
+
selectedRowId: p,
|
|
4803
4812
|
selectedColumn: v,
|
|
4804
|
-
visibilityPreviewContext:
|
|
4805
|
-
mergeTagInsertQueue:
|
|
4813
|
+
visibilityPreviewContext: u,
|
|
4814
|
+
mergeTagInsertQueue: d,
|
|
4806
4815
|
triggerMergeTagInsert: s,
|
|
4807
4816
|
mergeTagPreviewContext: S,
|
|
4808
4817
|
mergeTagPreviewActive: C,
|
|
@@ -4875,50 +4884,51 @@ function Ja(e, t) {
|
|
|
4875
4884
|
};
|
|
4876
4885
|
}
|
|
4877
4886
|
export {
|
|
4878
|
-
|
|
4879
|
-
|
|
4880
|
-
|
|
4881
|
-
|
|
4882
|
-
|
|
4883
|
-
|
|
4884
|
-
|
|
4885
|
-
|
|
4886
|
-
|
|
4887
|
-
K,
|
|
4888
|
-
|
|
4889
|
-
|
|
4890
|
-
|
|
4891
|
-
|
|
4892
|
-
|
|
4893
|
-
|
|
4894
|
-
|
|
4895
|
-
|
|
4896
|
-
|
|
4897
|
-
|
|
4898
|
-
|
|
4899
|
-
|
|
4900
|
-
|
|
4887
|
+
Jr as A,
|
|
4888
|
+
Va as B,
|
|
4889
|
+
so as C,
|
|
4890
|
+
oo as D,
|
|
4891
|
+
ea as E,
|
|
4892
|
+
Za as F,
|
|
4893
|
+
hr as G,
|
|
4894
|
+
Ya as H,
|
|
4895
|
+
dt as I,
|
|
4896
|
+
$n as K,
|
|
4897
|
+
Rt as L,
|
|
4898
|
+
An as M,
|
|
4899
|
+
ro as N,
|
|
4900
|
+
Ut as O,
|
|
4901
|
+
no as P,
|
|
4902
|
+
eo as R,
|
|
4903
|
+
po as S,
|
|
4904
|
+
io as T,
|
|
4905
|
+
Ka as U,
|
|
4906
|
+
Xa as V,
|
|
4907
|
+
Qa as W,
|
|
4908
|
+
Je as _,
|
|
4909
|
+
bo as a,
|
|
4901
4910
|
lo as b,
|
|
4902
|
-
|
|
4903
|
-
|
|
4911
|
+
vo as c,
|
|
4912
|
+
go as d,
|
|
4904
4913
|
pn as f,
|
|
4905
|
-
|
|
4906
|
-
|
|
4907
|
-
|
|
4908
|
-
|
|
4909
|
-
|
|
4910
|
-
|
|
4911
|
-
|
|
4912
|
-
|
|
4913
|
-
|
|
4914
|
-
|
|
4914
|
+
na as g,
|
|
4915
|
+
ra as h,
|
|
4916
|
+
Sa as i,
|
|
4917
|
+
Tn as j,
|
|
4918
|
+
ao as k,
|
|
4919
|
+
ho as l,
|
|
4920
|
+
mo as m,
|
|
4921
|
+
So as n,
|
|
4922
|
+
$o as o,
|
|
4923
|
+
ua as p,
|
|
4924
|
+
K as q,
|
|
4915
4925
|
Kt as r,
|
|
4916
|
-
|
|
4917
|
-
|
|
4918
|
-
|
|
4919
|
-
|
|
4920
|
-
|
|
4921
|
-
|
|
4922
|
-
|
|
4923
|
-
|
|
4926
|
+
ya as s,
|
|
4927
|
+
yo as t,
|
|
4928
|
+
fo as u,
|
|
4929
|
+
gt as v,
|
|
4930
|
+
ft as w,
|
|
4931
|
+
co as x,
|
|
4932
|
+
uo as y,
|
|
4933
|
+
vr as z
|
|
4924
4934
|
};
|