@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
1
|
import { c as de, o as At, r as Y, s as ue, t as ee } from "./borderRadius-CkSa1lQ9.js";
|
|
2
|
-
import { computed as Ce, inject as Oe, nextTick as ye, onUnmounted as dr, provide as Ie, ref as
|
|
3
|
-
var
|
|
2
|
+
import { computed as Ce, inject as Oe, nextTick as ye, onUnmounted as dr, provide as Ie, ref as L, shallowRef as pr, watch as hn, watchEffect as mr } from "vue";
|
|
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,16 +40,16 @@ 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) => {
|
|
47
|
-
const n = r.children ?? r.components ?? [],
|
|
47
|
+
const n = r.children ?? r.components ?? [], o = {
|
|
48
48
|
...r,
|
|
49
49
|
id: K(),
|
|
50
50
|
children: n.map((i) => bn(i))
|
|
51
51
|
};
|
|
52
|
-
return delete
|
|
52
|
+
return delete o.components, o;
|
|
53
53
|
})), t;
|
|
54
54
|
}
|
|
55
55
|
function fe(e) {
|
|
@@ -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,34 +95,34 @@ 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
|
-
function
|
|
100
|
+
function o(s) {
|
|
101
101
|
return fe(kt + s) ?? [];
|
|
102
102
|
}
|
|
103
103
|
function i(s, S) {
|
|
104
104
|
De(kt + s, S);
|
|
105
105
|
}
|
|
106
|
-
async function
|
|
107
|
-
return
|
|
106
|
+
async function a(s) {
|
|
107
|
+
return o(s).map(({ snapshot: S, ...C }) => C);
|
|
108
108
|
}
|
|
109
109
|
async function l(s, S) {
|
|
110
|
-
return
|
|
110
|
+
return o(s).find((C) => C.versionId === S)?.snapshot ?? null;
|
|
111
111
|
}
|
|
112
112
|
async function c(s, S) {
|
|
113
|
-
i(s,
|
|
113
|
+
i(s, o(s).filter((C) => C.versionId !== S));
|
|
114
114
|
}
|
|
115
|
-
async function
|
|
116
|
-
i(s,
|
|
115
|
+
async function p(s) {
|
|
116
|
+
i(s, o(s).filter((S) => S.kept));
|
|
117
117
|
}
|
|
118
118
|
async function v(s, S, C) {
|
|
119
|
-
i(s,
|
|
119
|
+
i(s, o(s).map((_) => _.versionId === S ? {
|
|
120
120
|
..._,
|
|
121
121
|
kept: C
|
|
122
122
|
} : _));
|
|
123
123
|
}
|
|
124
124
|
function b(s, S) {
|
|
125
|
-
const C =
|
|
125
|
+
const C = o(s);
|
|
126
126
|
C.unshift({
|
|
127
127
|
versionId: K(),
|
|
128
128
|
createdAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
@@ -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);
|
|
@@ -178,18 +178,18 @@ function $n() {
|
|
|
178
178
|
saveTemplate: t,
|
|
179
179
|
listTemplates: r,
|
|
180
180
|
deleteTemplate: n,
|
|
181
|
-
listTemplateVersions:
|
|
181
|
+
listTemplateVersions: a,
|
|
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");
|
|
@@ -197,21 +197,21 @@ function fr(e) {
|
|
|
197
197
|
const t = $n();
|
|
198
198
|
if (!e) return t;
|
|
199
199
|
const r = { ...t };
|
|
200
|
-
for (const [n,
|
|
200
|
+
for (const [n, o] of Object.entries(e)) typeof o == "function" && (r[n] = o);
|
|
201
201
|
return r;
|
|
202
202
|
}
|
|
203
203
|
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 Ko(e) {
|
|
208
208
|
Ie(Sn, e);
|
|
209
209
|
}
|
|
210
210
|
var kn = /* @__PURE__ */ Symbol("maildeno-editor:has-template-library");
|
|
211
|
-
function
|
|
211
|
+
function Yo() {
|
|
212
212
|
return Oe(kn, !0);
|
|
213
213
|
}
|
|
214
|
-
function
|
|
214
|
+
function Xo(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 Qo(e) {
|
|
223
223
|
Ie(wn, e);
|
|
224
224
|
}
|
|
225
|
-
function
|
|
225
|
+
function Zo() {
|
|
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 ea() {
|
|
235
235
|
const e = dt.value;
|
|
236
236
|
Ot(), e?.accept?.();
|
|
237
237
|
}
|
|
238
|
-
function
|
|
238
|
+
function ta() {
|
|
239
239
|
const e = dt.value;
|
|
240
240
|
Ot(), e?.reject?.();
|
|
241
241
|
}
|
|
@@ -254,7 +254,7 @@ var _e = () => ({
|
|
|
254
254
|
}), Et = () => ({
|
|
255
255
|
desktopHide: !1,
|
|
256
256
|
mobileHide: !1
|
|
257
|
-
}),
|
|
257
|
+
}), oe = () => ({
|
|
258
258
|
visibility: _e(),
|
|
259
259
|
...Et()
|
|
260
260
|
}), br = Object.freeze({
|
|
@@ -264,7 +264,7 @@ var _e = () => ({
|
|
|
264
264
|
}), $r = Object.freeze({
|
|
265
265
|
desktopHide: !1,
|
|
266
266
|
mobileHide: !1
|
|
267
|
-
}),
|
|
267
|
+
}), na = 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,
|
|
@@ -338,7 +338,7 @@ var _e = () => ({
|
|
|
338
338
|
margin: null,
|
|
339
339
|
padding: null
|
|
340
340
|
},
|
|
341
|
-
...
|
|
341
|
+
...oe()
|
|
342
342
|
},
|
|
343
343
|
heading: {
|
|
344
344
|
content: "Heading Text",
|
|
@@ -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,
|
|
@@ -381,7 +381,7 @@ var _e = () => ({
|
|
|
381
381
|
margin: null,
|
|
382
382
|
padding: null
|
|
383
383
|
},
|
|
384
|
-
...
|
|
384
|
+
...oe()
|
|
385
385
|
},
|
|
386
386
|
image: {
|
|
387
387
|
src: "https://email-builder-nor-dev.s3.amazonaws.com/images/2026/08/20/5bffeaf2.jpeg",
|
|
@@ -418,7 +418,7 @@ var _e = () => ({
|
|
|
418
418
|
borderRadius: null,
|
|
419
419
|
border: null
|
|
420
420
|
},
|
|
421
|
-
...
|
|
421
|
+
...oe()
|
|
422
422
|
},
|
|
423
423
|
video: {
|
|
424
424
|
fallbackLink: "https://example.com",
|
|
@@ -455,7 +455,7 @@ var _e = () => ({
|
|
|
455
455
|
borderRadius: null,
|
|
456
456
|
border: null
|
|
457
457
|
},
|
|
458
|
-
...
|
|
458
|
+
...oe()
|
|
459
459
|
},
|
|
460
460
|
list: {
|
|
461
461
|
content: "<ul><li>List item 1</li><li>List item 2</li><li>List item 3</li></ul>",
|
|
@@ -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,
|
|
@@ -491,7 +491,7 @@ var _e = () => ({
|
|
|
491
491
|
padding: null,
|
|
492
492
|
itemSpacing: null
|
|
493
493
|
},
|
|
494
|
-
...
|
|
494
|
+
...oe()
|
|
495
495
|
},
|
|
496
496
|
button: {
|
|
497
497
|
text: "Click Me",
|
|
@@ -545,7 +545,7 @@ var _e = () => ({
|
|
|
545
545
|
border: null,
|
|
546
546
|
align: null
|
|
547
547
|
},
|
|
548
|
-
...
|
|
548
|
+
...oe()
|
|
549
549
|
},
|
|
550
550
|
anchor: {
|
|
551
551
|
text: "Click here",
|
|
@@ -580,7 +580,7 @@ var _e = () => ({
|
|
|
580
580
|
padding: null,
|
|
581
581
|
align: null
|
|
582
582
|
},
|
|
583
|
-
...
|
|
583
|
+
...oe()
|
|
584
584
|
},
|
|
585
585
|
divider: {
|
|
586
586
|
backgroundColor: "#cccccc",
|
|
@@ -609,7 +609,7 @@ var _e = () => ({
|
|
|
609
609
|
padding: null,
|
|
610
610
|
align: null
|
|
611
611
|
},
|
|
612
|
-
...
|
|
612
|
+
...oe()
|
|
613
613
|
},
|
|
614
614
|
spacer: {
|
|
615
615
|
height: 20,
|
|
@@ -620,7 +620,7 @@ var _e = () => ({
|
|
|
620
620
|
backgroundColor: null,
|
|
621
621
|
backgroundGradient: null
|
|
622
622
|
},
|
|
623
|
-
...
|
|
623
|
+
...oe()
|
|
624
624
|
},
|
|
625
625
|
menu: {
|
|
626
626
|
items: [
|
|
@@ -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: {
|
|
@@ -683,7 +683,7 @@ var _e = () => ({
|
|
|
683
683
|
margin: null,
|
|
684
684
|
padding: null
|
|
685
685
|
},
|
|
686
|
-
...
|
|
686
|
+
...oe()
|
|
687
687
|
},
|
|
688
688
|
socials: {
|
|
689
689
|
platforms: [
|
|
@@ -728,9 +728,9 @@ var _e = () => ({
|
|
|
728
728
|
margin: null,
|
|
729
729
|
padding: null
|
|
730
730
|
},
|
|
731
|
-
...
|
|
731
|
+
...oe()
|
|
732
732
|
}
|
|
733
|
-
} }),
|
|
733
|
+
} }), ra = (e) => e.trim().toLowerCase().replace(/\s+/g, "_").replace(/[^a-z0-9_]/g, ""), oa = (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: {
|
|
@@ -747,20 +747,20 @@ var _e = () => ({
|
|
|
747
747
|
}), he = (e) => e.children ?? e.components ?? [], He = (e) => (e.children || (e.children = e.components ?? []), e.children), zt = (e) => {
|
|
748
748
|
const t = JSON.parse(JSON.stringify(e));
|
|
749
749
|
return t.id = K(), t.type === "row" && Array.isArray(t.columns) && (t.columns = t.columns.map((r) => {
|
|
750
|
-
const n = r.children ?? r.components ?? [],
|
|
750
|
+
const n = r.children ?? r.components ?? [], o = {
|
|
751
751
|
...r,
|
|
752
752
|
id: K(),
|
|
753
753
|
children: n.map((i) => zt(i))
|
|
754
754
|
};
|
|
755
|
-
return delete
|
|
755
|
+
return delete o.components, o;
|
|
756
756
|
})), t;
|
|
757
|
-
},
|
|
757
|
+
}, Qe = (e, t) => {
|
|
758
758
|
const r = zt(e);
|
|
759
759
|
if (r.type === "row-spacer") return r;
|
|
760
|
-
const n = e.name ?? xn(),
|
|
761
|
-
let i = `${n}_copy`,
|
|
762
|
-
for (;
|
|
763
|
-
i = `${n}_copy_${
|
|
760
|
+
const n = e.name ?? xn(), o = new Set(t.map((l) => l.name));
|
|
761
|
+
let i = `${n}_copy`, a = 2;
|
|
762
|
+
for (; o.has(i); )
|
|
763
|
+
i = `${n}_copy_${a}`, a++;
|
|
764
764
|
return r.name = i, r;
|
|
765
765
|
}, yr = (e) => zt(e), ve = (e, t) => {
|
|
766
766
|
for (let r = 0; r < e.length; r++) {
|
|
@@ -770,8 +770,8 @@ var _e = () => ({
|
|
|
770
770
|
index: r,
|
|
771
771
|
element: n
|
|
772
772
|
};
|
|
773
|
-
if (n.type === "row") for (const
|
|
774
|
-
const i = ve(
|
|
773
|
+
if (n.type === "row") for (const o of n.columns ?? []) {
|
|
774
|
+
const i = ve(o.children ?? o.components ?? [], t);
|
|
775
775
|
if (i) return i;
|
|
776
776
|
}
|
|
777
777
|
}
|
|
@@ -780,12 +780,12 @@ var _e = () => ({
|
|
|
780
780
|
for (const r of e) {
|
|
781
781
|
if (r.id === t) return r;
|
|
782
782
|
if (r.type === "row" && r.columns) for (const n of r.columns) {
|
|
783
|
-
const
|
|
784
|
-
for (const i of
|
|
783
|
+
const o = he(n);
|
|
784
|
+
for (const i of o) {
|
|
785
785
|
if (i.id === t && i.type === "row") return i;
|
|
786
786
|
if (i.type === "row" && i.columns) {
|
|
787
|
-
const
|
|
788
|
-
if (
|
|
787
|
+
const a = xe([i], t);
|
|
788
|
+
if (a) return a;
|
|
789
789
|
}
|
|
790
790
|
}
|
|
791
791
|
}
|
|
@@ -796,8 +796,8 @@ var _e = () => ({
|
|
|
796
796
|
const t = (r) => {
|
|
797
797
|
for (const n of r)
|
|
798
798
|
if (n?.id && (re.set(n.id, n), n.type === "row" && Array.isArray(n.columns)))
|
|
799
|
-
for (const
|
|
800
|
-
|
|
799
|
+
for (const o of n.columns)
|
|
800
|
+
o?.id && re.set(o.id, o), t(o.children ?? o.components ?? []);
|
|
801
801
|
};
|
|
802
802
|
t(e);
|
|
803
803
|
}, ie = (e) => {
|
|
@@ -807,14 +807,14 @@ 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
|
-
}, Sr = (e, t, r, n,
|
|
817
|
+
}, Sr = (e, t, r, n, o = n) => {
|
|
818
818
|
re.size === 0 && Array.isArray(e.value) && e.value.length && tn(e.value);
|
|
819
819
|
const i = (g, m = !1) => {
|
|
820
820
|
let h;
|
|
@@ -882,7 +882,7 @@ var _e = () => ({
|
|
|
882
882
|
e.value.push(y);
|
|
883
883
|
const $ = e.value[e.value.length - 1];
|
|
884
884
|
ie($), m || n("add-row");
|
|
885
|
-
},
|
|
885
|
+
}, a = (g, m, h, x) => {
|
|
886
886
|
const y = xe(e.value, g);
|
|
887
887
|
if (!y?.columns) return;
|
|
888
888
|
const $ = y.columns.find((N) => N.id === m);
|
|
@@ -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) {
|
|
@@ -1185,10 +1185,10 @@ var _e = () => ({
|
|
|
1185
1185
|
};
|
|
1186
1186
|
return {
|
|
1187
1187
|
addRow: i,
|
|
1188
|
-
addNestedRow:
|
|
1188
|
+
addNestedRow: a,
|
|
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,13 +1196,13 @@ 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) => {
|
|
1204
1204
|
const h = S(g);
|
|
1205
|
-
h && (Object.assign(h.props, m),
|
|
1205
|
+
h && (Object.assign(h.props, m), o("update-component"));
|
|
1206
1206
|
},
|
|
1207
1207
|
duplicateComponent: (g) => {
|
|
1208
1208
|
for (const m of e.value)
|
|
@@ -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), o = Ce(() => r.value > 0), i = Ce(() => r.value < t.value.length - 1), a = 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,16 +1230,16 @@ 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 = () =>
|
|
1233
|
+
}, c = () => o.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 {
|
|
1237
|
-
canUndo:
|
|
1237
|
+
canUndo: o,
|
|
1238
1238
|
canRedo: i,
|
|
1239
|
-
historyStatus:
|
|
1239
|
+
historyStatus: a,
|
|
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");
|
|
@@ -1247,13 +1247,13 @@ var _e = () => ({
|
|
|
1247
1247
|
version: n
|
|
1248
1248
|
};
|
|
1249
1249
|
}, xr = () => {
|
|
1250
|
-
const { saveState: e, undo: t, redo: r, canUndo: n, canRedo:
|
|
1250
|
+
const { saveState: e, undo: t, redo: r, canUndo: n, canRedo: o, historyStatus: i, initHistory: a, version: l } = wr();
|
|
1251
1251
|
return {
|
|
1252
1252
|
getCurrentState: (R, M) => ({
|
|
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
|
}
|
|
@@ -1279,14 +1279,14 @@ var _e = () => ({
|
|
|
1279
1279
|
return M ? (R(M), M) : null;
|
|
1280
1280
|
},
|
|
1281
1281
|
canUndo: n,
|
|
1282
|
-
canRedo:
|
|
1282
|
+
canRedo: o,
|
|
1283
1283
|
historyStatus: i,
|
|
1284
1284
|
initialize: (R) => {
|
|
1285
|
-
|
|
1285
|
+
a(R);
|
|
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
|
}
|
|
@@ -1329,34 +1329,34 @@ var _e = () => ({
|
|
|
1329
1329
|
props: t
|
|
1330
1330
|
};
|
|
1331
1331
|
}, Ir = (e) => e.type === "component" ? Mr(e) : _n(e), Nr = (e) => {
|
|
1332
|
-
const { id: t, width: r, children: n, components:
|
|
1333
|
-
Cn(e.border) && delete
|
|
1334
|
-
const l = (n ??
|
|
1332
|
+
const { id: t, width: r, children: n, components: o, ...i } = e, a = { ...i };
|
|
1333
|
+
Cn(e.border) && delete a.border, qe(e.backgroundGradient) && delete a.backgroundGradient, pt(e.padding) && delete a.padding, e.backgroundImage || (delete a.backgroundImage, delete a.backgroundSize, delete a.backgroundPosition, delete a.backgroundRepeat);
|
|
1334
|
+
const l = (n ?? o ?? []).map(Ir);
|
|
1335
1335
|
return {
|
|
1336
1336
|
id: t,
|
|
1337
1337
|
width: r,
|
|
1338
|
-
...
|
|
1338
|
+
...a,
|
|
1339
1339
|
children: l
|
|
1340
1340
|
};
|
|
1341
1341
|
}, Br = (e) => {
|
|
1342
|
-
const { id: t, type: r, ...n } = e,
|
|
1343
|
-
|
|
1344
|
-
const { height: i, ...
|
|
1342
|
+
const { id: t, type: r, ...n } = e, o = { ...n };
|
|
1343
|
+
Lt(e.visibility) && delete o.visibility, qe(e.backgroundGradient) && delete o.backgroundGradient;
|
|
1344
|
+
const { height: i, ...a } = o;
|
|
1345
1345
|
return {
|
|
1346
1346
|
id: t,
|
|
1347
1347
|
type: r,
|
|
1348
1348
|
height: i,
|
|
1349
|
-
...
|
|
1349
|
+
...a
|
|
1350
1350
|
};
|
|
1351
1351
|
}, _n = (e) => {
|
|
1352
1352
|
if (e.type === "row-spacer") return Br(e);
|
|
1353
|
-
const { id: t, type: r, name: n, columns:
|
|
1354
|
-
return
|
|
1353
|
+
const { id: t, type: r, name: n, columns: o, ...i } = e, a = { ...i };
|
|
1354
|
+
return Lt(e.visibility) && delete a.visibility, Cn(e.border) && delete a.border, qe(e.backgroundGradient) && delete a.backgroundGradient, pt(e.padding) && delete a.padding, e.backgroundImage || (delete a.backgroundImage, delete a.backgroundSize, delete a.backgroundPosition, delete a.backgroundRepeat), e.minHeight === 0 && delete a.minHeight, {
|
|
1355
1355
|
id: t,
|
|
1356
1356
|
type: r,
|
|
1357
1357
|
...n !== void 0 && { name: n },
|
|
1358
|
-
...
|
|
1359
|
-
columns:
|
|
1358
|
+
...a,
|
|
1359
|
+
columns: o?.map(Nr)
|
|
1360
1360
|
};
|
|
1361
1361
|
}, Tn = (e) => {
|
|
1362
1362
|
const t = { ...e };
|
|
@@ -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,30 +1467,30 @@ 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
|
-
const
|
|
1474
|
-
|
|
1473
|
+
const o = t[n], i = e[n];
|
|
1474
|
+
o != null && (typeof o == "object" && !Array.isArray(o) && typeof i == "object" && i !== null && !Array.isArray(i) ? r[n] = je(i, o) : r[n] = o);
|
|
1475
1475
|
}
|
|
1476
1476
|
return r;
|
|
1477
1477
|
}, rn = (e) => {
|
|
1478
1478
|
const { defaultProps: t } = jt(), r = e.componentType ?? e.type, n = t[r];
|
|
1479
1479
|
if (!n)
|
|
1480
1480
|
return console.warn(`[Hydrator] Unknown component type "${r}" — skipping hydration.`), e;
|
|
1481
|
-
const
|
|
1482
|
-
if (n.mobile && typeof n.mobile == "object" && (
|
|
1481
|
+
const o = je(n, e.props);
|
|
1482
|
+
if (n.mobile && typeof n.mobile == "object" && (o.mobile = {
|
|
1483
1483
|
...n.mobile,
|
|
1484
|
-
...
|
|
1485
|
-
},
|
|
1486
|
-
const i =
|
|
1487
|
-
i && (
|
|
1484
|
+
...o.mobile ?? {}
|
|
1485
|
+
}, o.mobile && !o.mobile.backgroundGradient && (o.mobile.backgroundGradient = n.mobile.backgroundGradient)), o.visibility = o.visibility ?? _e(), o.desktopHide = o.desktopHide ?? Et().desktopHide, o.mobileHide = o.mobileHide ?? Et().mobileHide, o.margin === void 0 && n.margin && (o.margin = { ...n.margin }), o.padding === void 0 && n.padding && (o.padding = { ...n.padding }), o.letterSpacing === void 0 && n.letterSpacing !== void 0 && (o.letterSpacing = n.letterSpacing), o.backgroundGradient) {
|
|
1486
|
+
const i = o.backgroundColor;
|
|
1487
|
+
i && (o.backgroundGradient.solid = i);
|
|
1488
1488
|
}
|
|
1489
|
-
return !
|
|
1489
|
+
return !o.backgroundImage && n.backgroundImage !== void 0 && (o.backgroundImage = n.backgroundImage, o.backgroundSize = n.backgroundSize, o.backgroundPosition = n.backgroundPosition, o.backgroundRepeat = n.backgroundRepeat), "icon" in n && (o.icon = o.icon ?? n.icon, o.iconAlt = o.iconAlt ?? n.iconAlt ?? "", o.iconPosition = o.iconPosition ?? n.iconPosition ?? "before", o.iconSize = o.iconSize ?? n.iconSize ?? 20, o.iconGap = o.iconGap ?? n.iconGap ?? 8), {
|
|
1490
1490
|
...e,
|
|
1491
1491
|
type: "component",
|
|
1492
1492
|
componentType: r,
|
|
1493
|
-
props:
|
|
1493
|
+
props: o
|
|
1494
1494
|
};
|
|
1495
1495
|
}, Dr = (e) => {
|
|
1496
1496
|
if (e.type === "component") return rn(e);
|
|
@@ -1501,10 +1501,10 @@ var _e = () => ({
|
|
|
1501
1501
|
componentType: e.type
|
|
1502
1502
|
}) : Rn(e);
|
|
1503
1503
|
}, Fr = (e) => {
|
|
1504
|
-
const t = e.children ?? e.components ?? [], { components: r, children: n, ...
|
|
1505
|
-
let
|
|
1506
|
-
return i ? (
|
|
1507
|
-
...
|
|
1504
|
+
const t = e.children ?? e.components ?? [], { components: r, children: n, ...o } = e, i = e.backgroundColor !== void 0 || e.backgroundGradient !== void 0 || e.backgroundImage !== void 0, { backgroundColor: a, backgroundGradient: l, ...c } = zr;
|
|
1505
|
+
let p = je(c, o);
|
|
1506
|
+
return i ? (p.backgroundColor = e.backgroundColor, p.backgroundGradient = e.backgroundGradient) : (p.backgroundColor = a, 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) => {
|
|
@@ -1512,13 +1512,13 @@ var _e = () => ({
|
|
|
1512
1512
|
return t.backgroundColor === void 0 && (t.backgroundColor = "transparent"), t;
|
|
1513
1513
|
}, Rn = (e) => {
|
|
1514
1514
|
if (e.type === "row-spacer") return Hr(e);
|
|
1515
|
-
const { columns: t, ...r } = e, n = e.backgroundColor !== void 0 || e.backgroundGradient !== void 0 || e.backgroundImage !== void 0, { backgroundColor:
|
|
1516
|
-
let l = je(
|
|
1517
|
-
return n ? (l.backgroundColor = e.backgroundColor, l.backgroundGradient = e.backgroundGradient) : (l.backgroundColor =
|
|
1515
|
+
const { columns: t, ...r } = e, n = e.backgroundColor !== void 0 || e.backgroundGradient !== void 0 || e.backgroundImage !== void 0, { backgroundColor: o, backgroundGradient: i, ...a } = Or;
|
|
1516
|
+
let l = je(a, r);
|
|
1517
|
+
return n ? (l.backgroundColor = e.backgroundColor, l.backgroundGradient = e.backgroundGradient) : (l.backgroundColor = o, 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
|
-
}, ut = (e) => e.map(Rn), ge = "maildeno:autosave", Mt = "1.0",
|
|
1521
|
+
}, ut = (e) => e.map(Rn), ge = "maildeno:autosave", Mt = "1.0", on = (e, t, r = null, n, o) => {
|
|
1522
1522
|
const i = Date.now();
|
|
1523
1523
|
return {
|
|
1524
1524
|
schemaVersion: Mt,
|
|
@@ -1527,20 +1527,20 @@ var _e = () => ({
|
|
|
1527
1527
|
touchedAt: i,
|
|
1528
1528
|
updatedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
1529
1529
|
...n !== void 0 && { name: n },
|
|
1530
|
-
...
|
|
1530
|
+
...o !== void 0 && { tags: o },
|
|
1531
1531
|
content: {
|
|
1532
1532
|
rows: An(e),
|
|
1533
1533
|
canvas: Tn(t)
|
|
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 =
|
|
1543
|
+
const w = on(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 =
|
|
1557
|
+
const E = on(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 aa(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,23 +1616,23 @@ function ro(e, t) {
|
|
|
1616
1616
|
function Ut(e) {
|
|
1617
1617
|
return Ht.get(e);
|
|
1618
1618
|
}
|
|
1619
|
-
function
|
|
1619
|
+
function ia() {
|
|
1620
1620
|
return Ht;
|
|
1621
1621
|
}
|
|
1622
1622
|
var Gr = () => {
|
|
1623
|
-
const e = (n,
|
|
1623
|
+
const e = (n, o) => {
|
|
1624
1624
|
if (!(n?.useGradient === !0 && Array.isArray(n?.gradient?.colors) && n.gradient.colors.length >= 2)) {
|
|
1625
|
-
const b = n && typeof n == "object" && n.solid ? n.solid :
|
|
1625
|
+
const b = n && typeof n == "object" && n.solid ? n.solid : o;
|
|
1626
1626
|
return !b || b === "transparent" ? "" : `background-color:${b};`;
|
|
1627
1627
|
}
|
|
1628
|
-
const { type: i, direction:
|
|
1629
|
-
return `${v && v !== "transparent" ? `background-color:${v};` : ""}background:${
|
|
1630
|
-
}, t = (n,
|
|
1628
|
+
const { type: i, direction: a, colors: l } = n.gradient, c = l.map((b) => `${b.color} ${b.position}%`).join(", "), p = i === "radial" ? `radial-gradient(circle at center, ${c})` : `linear-gradient(${a}, ${c})`, v = n.solid || o || "";
|
|
1629
|
+
return `${v && v !== "transparent" ? `background-color:${v};` : ""}background:${p};`;
|
|
1630
|
+
}, t = (n, o) => n?.useGradient === !0 && Array.isArray(n?.gradient?.colors) && n.gradient.colors.length >= 2 ? {
|
|
1631
1631
|
vmlOpen: `
|
|
1632
1632
|
<!--[if mso]>
|
|
1633
1633
|
<v:rect xmlns:v="urn:schemas-microsoft-com:vml" fill="t" stroke="f"
|
|
1634
1634
|
style="mso-width-percent:1000;">
|
|
1635
|
-
<v:fill type="solid" color="${n.solid ||
|
|
1635
|
+
<v:fill type="solid" color="${n.solid || o || "#ffffff"}" />
|
|
1636
1636
|
<v:textbox style="mso-fit-shape-to-text:true;">
|
|
1637
1637
|
<![endif]-->`,
|
|
1638
1638
|
vmlClose: `
|
|
@@ -1645,33 +1645,33 @@ var Gr = () => {
|
|
|
1645
1645
|
vmlClose: ""
|
|
1646
1646
|
};
|
|
1647
1647
|
return { generateHTMLComponent: (n) => {
|
|
1648
|
-
const
|
|
1649
|
-
let
|
|
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;` : "",
|
|
1648
|
+
const o = n.componentType ?? n.type, { props: i } = n;
|
|
1649
|
+
let a = "";
|
|
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
|
-
}, b = Ut(
|
|
1653
|
+
}, b = Ut(o);
|
|
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,
|
|
1664
1664
|
react: null
|
|
1665
|
-
}) :
|
|
1665
|
+
}) : a;
|
|
1666
1666
|
} };
|
|
1667
1667
|
}, En = (e) => e.replace(/<br\s*\/?>/gi, "<br />"), mt = (e) => e.split(",").map((t) => t.trim().replace(/^'+|'+$/g, "").trim()).join(", "), Mn = (e) => e.replace(/font-family\s*:\s*([^;]+)/gi, (t, r) => `font-family:${mt(r)}`), qr = (e) => e.trim().replace(/-([a-z])/g, (t, r) => r.toUpperCase()), Wr = (e) => e.split(";").map((t) => t.trim()).filter(Boolean).map((t) => {
|
|
1668
1668
|
const r = t.indexOf(":");
|
|
1669
1669
|
if (r < 0) return null;
|
|
1670
|
-
const n = t.slice(0, r).trim(),
|
|
1670
|
+
const n = t.slice(0, r).trim(), o = t.slice(r + 1).trim(), i = n.toLowerCase() === "font-family" ? mt(o) : Mn(o);
|
|
1671
1671
|
return `${qr(n)}: "${i}"`;
|
|
1672
1672
|
}).filter((t) => t !== null).join(", "), Vr = (e) => e.replace(/\bcontenteditable\s*=\s*(["']?)([^"'\s>]+)\1/gi, (t, r, n) => {
|
|
1673
|
-
const
|
|
1674
|
-
return
|
|
1673
|
+
const o = n.toLowerCase();
|
|
1674
|
+
return o === "true" || o === "false" ? `contentEditable={${o}}` : `contentEditable="${n}"`;
|
|
1675
1675
|
}), Kr = (e) => {
|
|
1676
1676
|
let t = Jr(e);
|
|
1677
1677
|
return t = En(t), t = Vr(t), t = t.replace(/\bstyle="([^"]*)"/g, (r, n) => `style={{ ${Wr(n)} }}`), t;
|
|
@@ -1681,31 +1681,31 @@ 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:
|
|
1685
|
-
return `${
|
|
1684
|
+
const { type: o, direction: i, colors: a } = r.gradient, l = a.map((v) => `${v.color} ${v.position}%`).join(", "), c = o === "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
|
-
const n = r.componentType ?? r.type, { props:
|
|
1688
|
+
const n = r.componentType ?? r.type, { props: o } = r;
|
|
1689
1689
|
let i = "";
|
|
1690
|
-
const
|
|
1690
|
+
const a = `eb-${r.id}`, l = o.margin ? `margin:${o.margin?.top ?? 0}px ${o.margin?.right ?? 0}px ${o.margin?.bottom ?? 0}px ${o.margin?.left ?? 0}px;` : "", c = o.padding ? `padding:${o.padding?.top ?? 0}px ${o.padding?.right ?? 0}px ${o.padding?.bottom ?? 0}px ${o.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
|
} : {
|
|
1694
1694
|
vmlOpen: "",
|
|
1695
1695
|
vmlClose: ""
|
|
1696
1696
|
}, v = (E, w, R) => {
|
|
1697
|
-
const M = [R ? `${
|
|
1697
|
+
const M = [R ? `${a}-${R}` : a];
|
|
1698
1698
|
return E && M.push("desktop-hide"), w && M.push("mobile-hide"), M.join(" ");
|
|
1699
1699
|
}, b = Ut(n);
|
|
1700
|
-
return b ? b.renderEmail.reactEmail(
|
|
1701
|
-
uid:
|
|
1700
|
+
return b ? b.renderEmail.reactEmail(o, {
|
|
1701
|
+
uid: a,
|
|
1702
1702
|
marginStyle: l,
|
|
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,
|
|
@@ -1723,8 +1723,8 @@ function Xr(e) {
|
|
|
1723
1723
|
return e.split(";").map((r) => r.trim()).filter(Boolean).forEach((r) => {
|
|
1724
1724
|
const n = r.indexOf(":");
|
|
1725
1725
|
if (n < 0) return;
|
|
1726
|
-
const
|
|
1727
|
-
t[
|
|
1726
|
+
const o = r.slice(0, n).trim(), i = r.slice(n + 1).trim(), a = o.replace(/-([a-z])/g, (l, c) => c.toUpperCase());
|
|
1727
|
+
t[a] = Mn(i);
|
|
1728
1728
|
}), t;
|
|
1729
1729
|
}
|
|
1730
1730
|
function Qr(e, t) {
|
|
@@ -1734,9 +1734,9 @@ function Qr(e, t) {
|
|
|
1734
1734
|
function In(e) {
|
|
1735
1735
|
return Object.entries(e).filter(([, t]) => t != null && t !== "").map(([t, r]) => `${t}: "${r}"`).join(", ");
|
|
1736
1736
|
}
|
|
1737
|
-
function Zr(e, t, r, n,
|
|
1738
|
-
return `<${e}${
|
|
1739
|
-
as="${
|
|
1737
|
+
function Zr(e, t, r, n, o) {
|
|
1738
|
+
return `<${e}${o ? `
|
|
1739
|
+
as="${o}"` : ""}
|
|
1740
1740
|
className="${t}"
|
|
1741
1741
|
style={{ ${In(r)} }}
|
|
1742
1742
|
>
|
|
@@ -1745,19 +1745,19 @@ function Zr(e, t, r, n, a) {
|
|
|
1745
1745
|
`;
|
|
1746
1746
|
}
|
|
1747
1747
|
var Nn = () => {
|
|
1748
|
-
const e = (
|
|
1749
|
-
if (!(
|
|
1750
|
-
const R =
|
|
1748
|
+
const e = (a, l) => {
|
|
1749
|
+
if (!(a?.useGradient === !0 && Array.isArray(a?.gradient?.colors) && a.gradient.colors.length >= 2)) {
|
|
1750
|
+
const R = a && typeof a == "object" && a.solid ? a.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 } = a.gradient, b = v.map((R) => `${R.color} ${R.position}%`).join(", "), E = c === "radial" ? `radial-gradient(circle at center, ${b})` : `linear-gradient(${p}, ${b})`, w = a.solid || l || "";
|
|
1754
1754
|
return `${w && w !== "transparent" ? `background-color:${w};` : ""}background:${E};`;
|
|
1755
|
-
}, t = (
|
|
1755
|
+
}, t = (a, l) => a?.useGradient === !0 && Array.isArray(a?.gradient?.colors) && a.gradient.colors.length >= 2 ? {
|
|
1756
1756
|
vmlOpen: `
|
|
1757
1757
|
<!--[if mso]>
|
|
1758
1758
|
<v:rect xmlns:v="urn:schemas-microsoft-com:vml" fill="t" stroke="f"
|
|
1759
1759
|
style="mso-width-percent:1000;">
|
|
1760
|
-
<v:fill type="solid" color="${
|
|
1760
|
+
<v:fill type="solid" color="${a.solid || l || "#ffffff"}" />
|
|
1761
1761
|
<v:textbox style="mso-fit-shape-to-text:true;">
|
|
1762
1762
|
<![endif]-->`,
|
|
1763
1763
|
vmlClose: `
|
|
@@ -1768,29 +1768,29 @@ var Nn = () => {
|
|
|
1768
1768
|
} : {
|
|
1769
1769
|
vmlOpen: "",
|
|
1770
1770
|
vmlClose: ""
|
|
1771
|
-
}, r = (
|
|
1771
|
+
}, r = (a, l) => a && typeof a == "object" && a.solid && a.solid !== "transparent" ? a.solid : l && l !== "transparent" ? l : "", n = (a) => a ? `${a.top ?? 0}px ${a.right ?? 0}px ${a.bottom ?? 0}px ${a.left ?? 0}px` : "0px";
|
|
1772
1772
|
return {
|
|
1773
|
-
generateMJMLComponent: (
|
|
1774
|
-
const l =
|
|
1775
|
-
const
|
|
1776
|
-
return R &&
|
|
1773
|
+
generateMJMLComponent: (a) => {
|
|
1774
|
+
const l = a.componentType ?? a.type, { props: c } = a, p = `eb-${a.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: (
|
|
1792
|
-
const w =
|
|
1793
|
-
@import url('${
|
|
1791
|
+
assembleMJML: (a, 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"}"`,
|
|
@@ -1809,7 +1809,7 @@ ${v}
|
|
|
1809
1809
|
return `<mjml lang="${c.language}">
|
|
1810
1810
|
<mj-head>
|
|
1811
1811
|
${w}
|
|
1812
|
-
<mj-title>${
|
|
1812
|
+
<mj-title>${a}</mj-title>
|
|
1813
1813
|
<mj-preview>${c.preheaderText} ͏ ‌ ͏ ‌ ͏ ‌ ͏ ‌ ͏ ‌ ͏ ‌ ͏ ‌ </mj-preview>
|
|
1814
1814
|
<mj-attributes>
|
|
1815
1815
|
<mj-all font-family="Arial, sans-serif" />
|
|
@@ -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,35 +1836,35 @@ ${l}
|
|
|
1836
1836
|
padAttr: n
|
|
1837
1837
|
};
|
|
1838
1838
|
}, Bn = /* @__PURE__ */ Symbol("maildeno-editor:info-dialog");
|
|
1839
|
-
function
|
|
1839
|
+
function sa() {
|
|
1840
1840
|
const e = On();
|
|
1841
1841
|
return Ie(Bn, e), e;
|
|
1842
1842
|
}
|
|
1843
|
-
var
|
|
1843
|
+
var eo = () => {
|
|
1844
1844
|
const e = Oe(Bn);
|
|
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,
|
|
1852
1852
|
message: r,
|
|
1853
|
-
open: (
|
|
1854
|
-
r.value =
|
|
1853
|
+
open: (o, i = "Info") => {
|
|
1854
|
+
r.value = o, t.value = i, e.value = !0;
|
|
1855
1855
|
}
|
|
1856
1856
|
};
|
|
1857
1857
|
}
|
|
1858
|
-
var
|
|
1858
|
+
var la = ["is_empty", "is_not_empty"], ca = ["in", "not_in"], ua = [
|
|
1859
1859
|
">",
|
|
1860
1860
|
"<",
|
|
1861
1861
|
">=",
|
|
1862
1862
|
"<="
|
|
1863
|
-
],
|
|
1863
|
+
], da = [
|
|
1864
1864
|
"date_before",
|
|
1865
1865
|
"date_after",
|
|
1866
1866
|
"date_on"
|
|
1867
|
-
],
|
|
1867
|
+
], pa = [
|
|
1868
1868
|
{
|
|
1869
1869
|
label: "Equals ==",
|
|
1870
1870
|
value: "=="
|
|
@@ -1933,56 +1933,56 @@ 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
|
-
],
|
|
1936
|
+
], an = (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()));
|
|
1940
1940
|
}, It = (e, t) => {
|
|
1941
|
-
const r = t[e.tag.toLowerCase()], n = r?.toLowerCase() ?? "",
|
|
1941
|
+
const r = t[e.tag.toLowerCase()], n = r?.toLowerCase() ?? "", o = e.value.toLowerCase();
|
|
1942
1942
|
switch (e.operator) {
|
|
1943
1943
|
case "==":
|
|
1944
|
-
return n ===
|
|
1944
|
+
return n === o;
|
|
1945
1945
|
case "!=":
|
|
1946
|
-
return n !==
|
|
1946
|
+
return n !== o;
|
|
1947
1947
|
case "contains":
|
|
1948
|
-
return n.includes(
|
|
1948
|
+
return n.includes(o);
|
|
1949
1949
|
case "not_contains":
|
|
1950
|
-
return !n.includes(
|
|
1950
|
+
return !n.includes(o);
|
|
1951
1951
|
case "starts_with":
|
|
1952
|
-
return n.startsWith(
|
|
1952
|
+
return n.startsWith(o);
|
|
1953
1953
|
case "ends_with":
|
|
1954
|
-
return n.endsWith(
|
|
1954
|
+
return n.endsWith(o);
|
|
1955
1955
|
case "in":
|
|
1956
|
-
return
|
|
1956
|
+
return an(o).includes(n);
|
|
1957
1957
|
case "not_in":
|
|
1958
|
-
return !
|
|
1958
|
+
return !an(o).includes(n);
|
|
1959
1959
|
case ">": {
|
|
1960
|
-
const [i,
|
|
1961
|
-
return
|
|
1960
|
+
const [i, a] = Ze(r, e.value);
|
|
1961
|
+
return et(i, a) && i > a;
|
|
1962
1962
|
}
|
|
1963
1963
|
case "<": {
|
|
1964
|
-
const [i,
|
|
1965
|
-
return
|
|
1964
|
+
const [i, a] = Ze(r, e.value);
|
|
1965
|
+
return et(i, a) && i < a;
|
|
1966
1966
|
}
|
|
1967
1967
|
case ">=": {
|
|
1968
|
-
const [i,
|
|
1969
|
-
return
|
|
1968
|
+
const [i, a] = Ze(r, e.value);
|
|
1969
|
+
return et(i, a) && i >= a;
|
|
1970
1970
|
}
|
|
1971
1971
|
case "<=": {
|
|
1972
|
-
const [i,
|
|
1973
|
-
return
|
|
1972
|
+
const [i, a] = Ze(r, e.value);
|
|
1973
|
+
return et(i, a) && i <= a;
|
|
1974
1974
|
}
|
|
1975
1975
|
case "date_before": {
|
|
1976
|
-
const i = Ee(r),
|
|
1977
|
-
return i !== null &&
|
|
1976
|
+
const i = Ee(r), a = Ee(e.value);
|
|
1977
|
+
return i !== null && a !== null && i.getTime() < a.getTime();
|
|
1978
1978
|
}
|
|
1979
1979
|
case "date_after": {
|
|
1980
|
-
const i = Ee(r),
|
|
1981
|
-
return i !== null &&
|
|
1980
|
+
const i = Ee(r), a = Ee(e.value);
|
|
1981
|
+
return i !== null && a !== null && i.getTime() > a.getTime();
|
|
1982
1982
|
}
|
|
1983
1983
|
case "date_on": {
|
|
1984
|
-
const i = Ee(r),
|
|
1985
|
-
return i !== null &&
|
|
1984
|
+
const i = Ee(r), a = Ee(e.value);
|
|
1985
|
+
return i !== null && a !== null && i.getTime() === a.getTime();
|
|
1986
1986
|
}
|
|
1987
1987
|
case "is_empty":
|
|
1988
1988
|
return r === void 0 || r.trim() === "";
|
|
@@ -1998,54 +1998,54 @@ var io = ["is_empty", "is_not_empty"], so = ["in", "not_in"], lo = [
|
|
|
1998
1998
|
}, ft = () => ({
|
|
1999
1999
|
evaluateVisibility: (t, r) => {
|
|
2000
2000
|
if (!t?.enabled) return !0;
|
|
2001
|
-
const n = t.rules?.length > 0,
|
|
2002
|
-
if (!n && !
|
|
2003
|
-
const i = (t.rules ?? []).map((c) => It(c, r)),
|
|
2001
|
+
const n = t.rules?.length > 0, o = (t.groups?.length ?? 0) > 0;
|
|
2002
|
+
if (!n && !o) return !0;
|
|
2003
|
+
const i = (t.rules ?? []).map((c) => It(c, r)), a = (t.groups ?? []).map((c) => sn(c, r)), l = [...i, ...a];
|
|
2004
2004
|
return t.match === "any" ? l.some(Boolean) : l.every(Boolean);
|
|
2005
2005
|
},
|
|
2006
2006
|
evaluateRule: It,
|
|
2007
2007
|
evaluateGroup: sn
|
|
2008
2008
|
}), jn = (e) => {
|
|
2009
|
-
const { type: t, direction: r, colors: n } = e.gradient,
|
|
2010
|
-
return t === "radial" ? `radial-gradient(circle at center, ${
|
|
2009
|
+
const { type: t, direction: r, colors: n } = e.gradient, o = n.map((i) => `${i.color} ${i.position}%`).join(", ");
|
|
2010
|
+
return t === "radial" ? `radial-gradient(circle at center, ${o})` : `linear-gradient(${r}, ${o})`;
|
|
2011
2011
|
}, ce = (e) => {
|
|
2012
2012
|
const t = [], r = e.backgroundGradient;
|
|
2013
2013
|
if (r?.useGradient === !0 && Array.isArray(r?.gradient?.colors) && r.gradient.colors.length >= 2) {
|
|
2014
|
-
const n = jn(r),
|
|
2015
|
-
|
|
2014
|
+
const n = jn(r), o = r.solid || e.backgroundColor || "";
|
|
2015
|
+
o && o !== "transparent" && t.push(`background-color:${o}`), 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
|
-
const n = jn(r),
|
|
2022
|
-
|
|
2021
|
+
const n = jn(r), o = r.solid || e.backgroundColor || "";
|
|
2022
|
+
o && o !== "transparent" && (t.backgroundColor = o), t.background = n;
|
|
2023
2023
|
} else e.backgroundColor && e.backgroundColor !== "transparent" && (t.backgroundColor = e.backgroundColor);
|
|
2024
2024
|
return e.backgroundImage && (t.backgroundImage = `url(${e.backgroundImage})`, t.backgroundSize = e.backgroundSize, t.backgroundPosition = e.backgroundPosition, t.backgroundRepeat = e.backgroundRepeat), t;
|
|
2025
|
-
},
|
|
2026
|
-
if (!(r >=
|
|
2025
|
+
}, to = 5, zn = (e, t, r) => {
|
|
2026
|
+
if (!(r >= to) && Array.isArray(e))
|
|
2027
2027
|
for (const n of e) {
|
|
2028
2028
|
if (!n || n.type === "row-spacer") continue;
|
|
2029
2029
|
n.mobileStack && (n.gap ?? 0) > 0 && t.add(n.gap);
|
|
2030
|
-
const
|
|
2031
|
-
if (Array.isArray(
|
|
2032
|
-
for (const i of
|
|
2033
|
-
const
|
|
2034
|
-
if (!Array.isArray(
|
|
2035
|
-
const l =
|
|
2030
|
+
const o = n.columns;
|
|
2031
|
+
if (Array.isArray(o))
|
|
2032
|
+
for (const i of o) {
|
|
2033
|
+
const a = i?.children ?? i?.components;
|
|
2034
|
+
if (!Array.isArray(a) || a.length === 0) continue;
|
|
2035
|
+
const l = a.filter((c) => c?.type === "row");
|
|
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
|
-
const r = [...t].sort((n,
|
|
2042
|
+
const r = [...t].sort((n, o) => n - o);
|
|
2043
2043
|
return `${r.map((n) => `.mobile-stack.gap-${n}`).join(`,
|
|
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",
|
|
@@ -2423,19 +2423,19 @@ ${r.map((n) => `.mobile-stack.gap-${n} { height:${n}px !important; line-height:$
|
|
|
2423
2423
|
500,
|
|
2424
2424
|
600,
|
|
2425
2425
|
700
|
|
2426
|
-
],
|
|
2426
|
+
], o = (b) => t.has(b), i = (b) => b.trim().replace(/\s+/g, "+"), a = (b) => {
|
|
2427
2427
|
if (r.has(b)) {
|
|
2428
2428
|
const E = n.map((R) => `0,${R}`), w = n.map((R) => `1,${R}`);
|
|
2429
2429
|
return `ital,wght@${[...E, ...w].join(";")}`;
|
|
2430
2430
|
}
|
|
2431
2431
|
return `wght@${n.join(";")}`;
|
|
2432
2432
|
}, l = (b) => {
|
|
2433
|
-
if (!b ||
|
|
2433
|
+
if (!b || o(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)}:${
|
|
2435
|
+
E.rel = "stylesheet", E.href = `https://fonts.googleapis.com/css2?family=${i(b)}:${a(b)}&display=swap`, document.head.appendChild(E), nt.value.add(b);
|
|
2436
2436
|
}, c = (b) => {
|
|
2437
|
-
const E = Array.from(new Set(b)).filter((w) => w && !
|
|
2438
|
-
return E.length ? `https://fonts.googleapis.com/css2?${E.map((w) => `family=${i(w)}:${
|
|
2437
|
+
const E = Array.from(new Set(b)).filter((w) => w && !o(w));
|
|
2438
|
+
return E.length ? `https://fonts.googleapis.com/css2?${E.map((w) => `family=${i(w)}:${a(w)}`).join("&")}&display=swap` : "";
|
|
2439
2439
|
};
|
|
2440
2440
|
return {
|
|
2441
2441
|
googleFonts: e,
|
|
@@ -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), !
|
|
2448
|
+
O && (w.has(O) || (w.add(O), !o(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;
|
|
@@ -2463,133 +2463,142 @@ ${r.map((n) => `.mobile-stack.gap-${n} { height:${n}px !important; line-height:$
|
|
|
2463
2463
|
};
|
|
2464
2464
|
b("https://fonts.googleapis.com"), b("https://fonts.gstatic.com", !0);
|
|
2465
2465
|
},
|
|
2466
|
-
isWebSafeFont:
|
|
2466
|
+
isWebSafeFont: o,
|
|
2467
2467
|
WEB_SAFE_FONTS: t,
|
|
2468
2468
|
FONTS_WITH_ITALICS: r,
|
|
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
|
-
function
|
|
2478
|
-
const t =
|
|
2477
|
+
function no(e) {
|
|
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 ro(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 o = Je(n);
|
|
2497
|
+
return o === "auto" && n !== "auto" ? r : o;
|
|
2498
|
+
}
|
|
2491
2499
|
var Jt = () => ({ emailMobileStyles: (t, r) => {
|
|
2492
|
-
const n = t.componentType ?? t.type,
|
|
2493
|
-
if (!i && !(n === "menu" &&
|
|
2494
|
-
const
|
|
2495
|
-
|
|
2500
|
+
const n = t.componentType ?? t.type, o = t.props.mobileStack === !0, i = t.props.mobile;
|
|
2501
|
+
if (!i && !(n === "menu" && o)) return "";
|
|
2502
|
+
const a = i ?? {}, l = [], c = [], p = [], v = (/* @__PURE__ */ new Set(["button", "anchor"])).has(n), b = n === "button" && !!no(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 = a.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 || a.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 ?? a.backgroundColor;
|
|
2512
|
+
return d != null ? ["background: none !important", `background-color: ${d} !important`] : [];
|
|
2505
2513
|
}
|
|
2506
|
-
return
|
|
2507
|
-
}, M = (
|
|
2508
|
-
w(
|
|
2514
|
+
return a.backgroundColor != null ? ["background: none !important", `background-color: ${a.backgroundColor} !important`] : [];
|
|
2515
|
+
}, M = (u) => {
|
|
2516
|
+
w(u, a.fontSize != null && `font-size: ${a.fontSize}px !important`), w(u, a.lineHeight != null && `line-height: ${a.lineHeight} !important`), w(u, a.letterSpacing != null && `letter-spacing: ${a.letterSpacing}px !important`), w(u, a.color != null && `color: ${a.color} !important`), w(u, a.fontWeight != null && `font-weight: ${a.fontWeight} !important`), w(u, a.fontFamily != null && `font-family: '${a.fontFamily}', Arial, sans-serif !important`), w(u, a.fontStyle != null && `font-style: ${a.fontStyle} !important`), w(u, a.textTransform != null && `text-transform: ${a.textTransform} !important`), w(u, a.textDecoration != null && `text-decoration: ${a.textDecoration} !important`), b || u.push(...R());
|
|
2509
2517
|
};
|
|
2510
|
-
if (
|
|
2511
|
-
const
|
|
2512
|
-
l.push(`margin: ${
|
|
2518
|
+
if (a.margin) {
|
|
2519
|
+
const u = a.margin;
|
|
2520
|
+
l.push(`margin: ${u.top}px ${u.right}px ${u.bottom}px ${u.left}px !important`);
|
|
2513
2521
|
}
|
|
2514
|
-
if (
|
|
2515
|
-
const
|
|
2516
|
-
l.push(`padding: ${
|
|
2522
|
+
if (a.padding && !v && !E) {
|
|
2523
|
+
const u = a.padding;
|
|
2524
|
+
l.push(`padding: ${u.top}px ${u.right}px ${u.bottom}px ${u.left}px !important`);
|
|
2517
2525
|
}
|
|
2518
|
-
if (
|
|
2526
|
+
if (a.align != null && !E && l.push(`text-align: ${a.align} !important`), v) {
|
|
2519
2527
|
M(c);
|
|
2520
|
-
const
|
|
2521
|
-
if (
|
|
2522
|
-
const
|
|
2523
|
-
b ?
|
|
2528
|
+
const u = b ? R() : c;
|
|
2529
|
+
if (a.padding) {
|
|
2530
|
+
const d = a.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
|
-
if (
|
|
2526
|
-
const
|
|
2527
|
-
|
|
2533
|
+
if (a.border) {
|
|
2534
|
+
const d = a.border;
|
|
2535
|
+
u.push(ue(d, !0));
|
|
2528
2536
|
}
|
|
2529
|
-
if (
|
|
2530
|
-
for (const s of ["width", "height"])
|
|
2531
|
-
const
|
|
2532
|
-
w(
|
|
2537
|
+
if (a.borderRadius != null && u.push(`border-radius: ${Y(a.borderRadius)} !important`), n === "button") {
|
|
2538
|
+
for (const s of ["width", "height"]) a[s] != null && u.push(`${s}: ${Je(a[s])} !important`);
|
|
2539
|
+
const d = [];
|
|
2540
|
+
w(d, a.fontSize != null && `font-size: ${a.fontSize}px !important`), w(d, a.letterSpacing != null && `letter-spacing: ${a.letterSpacing}px !important`), w(d, a.color != null && `color: ${a.color} !important`), w(d, a.fontWeight != null && `font-weight: ${a.fontWeight} !important`), w(d, a.fontFamily != null && `font-family: '${a.fontFamily}', Arial, sans-serif !important`), w(d, a.fontStyle != null && `font-style: ${a.fontStyle} !important`), w(d, a.textTransform != null && `text-transform: ${a.textTransform} !important`), w(d, a.textDecoration != null && `text-decoration: ${a.textDecoration} !important`), d.length > 0 && p.push(`.${r}-text { ${d.join("; ")} }`);
|
|
2533
2541
|
}
|
|
2534
|
-
b &&
|
|
2535
|
-
} else if (n === "image")
|
|
2536
|
-
|
|
2537
|
-
|
|
2538
|
-
|
|
2542
|
+
b && u.length > 0 && p.push(`.${r}-button-table { ${u.join("; ")} }`);
|
|
2543
|
+
} else if (n === "image") {
|
|
2544
|
+
for (const u of ["width", "height"]) a[u] != null && c.push(`${u}: ${ro(a[u], u)} !important`);
|
|
2545
|
+
w(c, a.borderRadius != null && `border-radius: ${Y(a.borderRadius)} !important`), w(c, a.border != null && ue(a.border, !0));
|
|
2546
|
+
} else if (n === "video")
|
|
2547
|
+
w(c, a.width != null && `width: ${a.width}% !important`), w(c, a.height != null && `height: ${a.height} !important`), w(c, a.borderRadius != null && `border-radius: ${Y(a.borderRadius)} !important`), w(c, a.border != null && ue(a.border, !0));
|
|
2539
2548
|
else if (n === "divider") {
|
|
2540
|
-
const
|
|
2541
|
-
if (
|
|
2542
|
-
const s =
|
|
2543
|
-
|
|
2549
|
+
const u = [], d = [];
|
|
2550
|
+
if (a.width != null && u.push(`width: ${a.width}% !important`), a.align != null) {
|
|
2551
|
+
const s = a.align === "left" ? "0" : "auto", S = a.align === "right" ? "0" : "auto";
|
|
2552
|
+
u.push(`margin-left: ${s} !important`), u.push(`margin-right: ${S} !important`);
|
|
2544
2553
|
}
|
|
2545
|
-
|
|
2554
|
+
a.height != null && (d.push(`height: ${a.height}px !important`), d.push(`line-height: ${a.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
|
-
|
|
2556
|
+
const u = [];
|
|
2557
|
+
a.height != null && (u.push(`height: ${a.height}px !important`), u.push(`line-height: ${a.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),
|
|
2559
|
+
M(l), a.itemSpacing != null && p.push(`.${r} li { margin-bottom: ${a.itemSpacing}px !important; }`);
|
|
2551
2560
|
else if (n === "menu") {
|
|
2552
|
-
const p = [];
|
|
2553
|
-
if (p.push(...R()), o.padding) {
|
|
2554
|
-
const s = o.padding;
|
|
2555
|
-
p.push(`padding: ${s.top}px ${s.right}px ${s.bottom}px ${s.left}px !important`);
|
|
2556
|
-
}
|
|
2557
|
-
p.length > 0 && d.push(`.${r}-menu-td { ${p.join("; ")} }`), o.align != null && d.push(`.${r}-menu-td { text-align: ${o.align} !important; }`);
|
|
2558
2561
|
const u = [];
|
|
2559
|
-
if (
|
|
2560
|
-
const s =
|
|
2561
|
-
|
|
2562
|
-
}
|
|
2563
|
-
|
|
2564
|
-
|
|
2562
|
+
if (u.push(...R()), a.padding) {
|
|
2563
|
+
const s = a.padding;
|
|
2564
|
+
u.push(`padding: ${s.top}px ${s.right}px ${s.bottom}px ${s.left}px !important`);
|
|
2565
|
+
}
|
|
2566
|
+
u.length > 0 && p.push(`.${r}-menu-td { ${u.join("; ")} }`), a.align != null && p.push(`.${r}-menu-td { text-align: ${a.align} !important; }`);
|
|
2567
|
+
const d = [];
|
|
2568
|
+
if (a.fontSize != null && d.push(`font-size: ${a.fontSize}px !important`), a.lineHeight != null && d.push(`line-height: ${a.lineHeight} !important`), a.letterSpacing != null && d.push(`letter-spacing: ${a.letterSpacing}px !important`), a.color != null && d.push(`color: ${a.color} !important`), a.fontWeight != null && d.push(`font-weight: ${a.fontWeight} !important`), a.fontFamily != null && d.push(`font-family: '${a.fontFamily}', Arial, sans-serif !important`), a.fontStyle != null && d.push(`font-style: ${a.fontStyle} !important`), a.textTransform != null && d.push(`text-transform: ${a.textTransform} !important`), a.textDecoration != null && d.push(`text-decoration: ${a.textDecoration} !important`), d.length > 0 && p.push(`.${r}-menu-td a { ${d.join("; ")} }`), o) {
|
|
2569
|
+
const s = a.spacing ?? t.props.spacing ?? 0;
|
|
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; }`);
|
|
2571
|
+
} else if (a.spacing != null) {
|
|
2572
|
+
const s = Math.ceil(a.spacing / 2);
|
|
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
|
|
2568
|
-
if (
|
|
2569
|
-
const
|
|
2570
|
-
|
|
2576
|
+
const u = [];
|
|
2577
|
+
if (a.padding) {
|
|
2578
|
+
const d = a.padding;
|
|
2579
|
+
u.push(`padding: ${d.top}px ${d.right}px ${d.bottom}px ${d.left}px !important`);
|
|
2571
2580
|
}
|
|
2572
|
-
if (
|
|
2573
|
-
const
|
|
2574
|
-
|
|
2581
|
+
if (a.align != null) {
|
|
2582
|
+
const d = a.align === "left" ? "0" : "auto", s = a.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: ${a.align} !important`);
|
|
2575
2584
|
}
|
|
2576
|
-
if (
|
|
2577
|
-
const
|
|
2578
|
-
|
|
2585
|
+
if (u.length > 0 && p.push(`.${r}-socials-td { ${u.join("; ")} }`), a.iconSize != null && p.push(`.${r}-socials-inner img { width: ${a.iconSize}px !important; height: ${a.iconSize}px !important; }`), a.spacing != null) {
|
|
2586
|
+
const d = Math.ceil(a.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) : "",
|
|
2589
|
-
const
|
|
2597
|
+
} }), ln = (e) => de(e) ? ue(e) : "", Pn = (e, t, r = [], n) => {
|
|
2598
|
+
const o = `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), a = t && de(t) && !ee(t.radius ?? 0);
|
|
2590
2599
|
if (!i) {
|
|
2591
|
-
const
|
|
2592
|
-
return
|
|
2600
|
+
const p = [o];
|
|
2601
|
+
return a && 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)}`,
|
|
@@ -2599,14 +2608,14 @@ var Jt = () => ({ emailMobileStyles: (t, r) => {
|
|
|
2599
2608
|
];
|
|
2600
2609
|
de(t) && l.push(ln(t));
|
|
2601
2610
|
const c = [
|
|
2602
|
-
|
|
2611
|
+
o,
|
|
2603
2612
|
"line-height:0",
|
|
2604
2613
|
"font-size:0"
|
|
2605
2614
|
];
|
|
2606
2615
|
return `<div style="${l.join(";")}"><div style="${c.join(";")}">${e}</div></div>`;
|
|
2607
|
-
},
|
|
2608
|
-
const i = `${n?.top ?? 0}px ${n?.right ?? 0}px ${n?.bottom ?? 0}px ${n?.left ?? 0}px`,
|
|
2609
|
-
if (!
|
|
2616
|
+
}, oo = (e, t, r = {}, n, o = !0) => {
|
|
2617
|
+
const i = `${n?.top ?? 0}px ${n?.right ?? 0}px ${n?.bottom ?? 0}px ${n?.left ?? 0}px`, a = t && ee(t.radius ?? 0) && de(t) && o, l = t && de(t) && !ee(t.radius ?? 0) && o;
|
|
2618
|
+
if (!a) {
|
|
2610
2619
|
const v = {
|
|
2611
2620
|
padding: i,
|
|
2612
2621
|
lineHeight: "0",
|
|
@@ -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 ao() {
|
|
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 io = 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
|
+
}), so = async (e) => Gt(e, async () => {
|
|
2674
|
+
const { prettier: t, plugins: r } = await ao();
|
|
2666
2675
|
return t.format(e, {
|
|
2667
2676
|
parser: "babel-ts",
|
|
2668
2677
|
plugins: r
|
|
2669
2678
|
});
|
|
2670
|
-
}),
|
|
2679
|
+
}), lo = 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, "_"), co = (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, "");
|
|
@@ -2681,20 +2690,20 @@ var oa = async (e) => Gt(e, async () => {
|
|
|
2681
2690
|
key: cn(r),
|
|
2682
2691
|
pipeDefault: n
|
|
2683
2692
|
};
|
|
2684
|
-
}, un = (e, t, r) => !r || !e ? e : e.replace(/\{\{\s*([^}]+?)\s*\}\}/g, (n,
|
|
2685
|
-
const { key: i, pipeDefault:
|
|
2686
|
-
return Object.prototype.hasOwnProperty.call(t, i) && t[i] !== "" ? t[i] :
|
|
2687
|
-
}), Fn = (e, t, r, n,
|
|
2693
|
+
}, un = (e, t, r) => !r || !e ? e : e.replace(/\{\{\s*([^}]+?)\s*\}\}/g, (n, o) => {
|
|
2694
|
+
const { key: i, pipeDefault: a } = co(o);
|
|
2695
|
+
return Object.prototype.hasOwnProperty.call(t, i) && t[i] !== "" ? t[i] : a !== void 0 ? a : n;
|
|
2696
|
+
}), Fn = (e, t, r, n, o) => {
|
|
2688
2697
|
let i = un(e, t, r);
|
|
2689
|
-
return i = un(i, n,
|
|
2698
|
+
return i = un(i, n, o), i;
|
|
2690
2699
|
}, qt = /* @__PURE__ */ new Map();
|
|
2691
|
-
function
|
|
2700
|
+
function ma(e) {
|
|
2692
2701
|
for (const t of e) qt.set(t.key, t);
|
|
2693
2702
|
}
|
|
2694
|
-
function
|
|
2703
|
+
function uo() {
|
|
2695
2704
|
return [...qt.keys()];
|
|
2696
2705
|
}
|
|
2697
|
-
function
|
|
2706
|
+
function po(e, t) {
|
|
2698
2707
|
return qt.get(e)?.tokens?.[t];
|
|
2699
2708
|
}
|
|
2700
2709
|
var Wt = {
|
|
@@ -2812,28 +2821,28 @@ var Wt = {
|
|
|
2812
2821
|
hubspot: "{{ today }}",
|
|
2813
2822
|
sfmc: "%%=Format(Now(),'M/d/yyyy')=%%"
|
|
2814
2823
|
}
|
|
2815
|
-
},
|
|
2816
|
-
const n = !!r?.trim(),
|
|
2824
|
+
}, mo = (e, t, r) => {
|
|
2825
|
+
const n = !!r?.trim(), o = r?.trim() ?? "";
|
|
2817
2826
|
switch (t) {
|
|
2818
2827
|
case "liquid":
|
|
2819
2828
|
case "klaviyo":
|
|
2820
2829
|
case "hubspot":
|
|
2821
|
-
return n ? `{{ ${e} | default: '${
|
|
2830
|
+
return n ? `{{ ${e} | default: '${o}' }}` : `{{ ${e} }}`;
|
|
2822
2831
|
case "braze":
|
|
2823
|
-
return n ? `{{custom_attribute.${e} | default: '${
|
|
2832
|
+
return n ? `{{custom_attribute.${e} | default: '${o}'}}` : `{{custom_attribute.${e}}}`;
|
|
2824
2833
|
case "handlebars":
|
|
2825
2834
|
case "sendgrid":
|
|
2826
|
-
return n ? `{{ ${e} }}{{!-- default: ${
|
|
2835
|
+
return n ? `{{ ${e} }}{{!-- default: ${o} --}}` : `{{ ${e} }}`;
|
|
2827
2836
|
case "iterable":
|
|
2828
|
-
return n ? `{{${e}|default:${
|
|
2837
|
+
return n ? `{{${e}|default:${o}}}` : `{{${e}}}`;
|
|
2829
2838
|
case "mailchimp":
|
|
2830
|
-
return n ? `*|${e.toUpperCase()}:${
|
|
2839
|
+
return n ? `*|${e.toUpperCase()}:${o}|*` : `*|${e.toUpperCase()}|*`;
|
|
2831
2840
|
case "sfmc":
|
|
2832
|
-
return n ? `%%=IIF(Empty(@${e}),'${
|
|
2841
|
+
return n ? `%%=IIF(Empty(@${e}),'${o}',@${e})=%%` : `%%=v(@${e})=%%`;
|
|
2833
2842
|
case "activecampaign":
|
|
2834
2843
|
return `%${e.toUpperCase()}%`;
|
|
2835
2844
|
case "marketo":
|
|
2836
|
-
return n ? `{{lead.${e}:default ${
|
|
2845
|
+
return n ? `{{lead.${e}:default ${o}}}` : `{{lead.${e}}}`;
|
|
2837
2846
|
case "pardot":
|
|
2838
2847
|
return `%%${e}%%`;
|
|
2839
2848
|
case "campaign_monitor":
|
|
@@ -2871,119 +2880,119 @@ var Wt = {
|
|
|
2871
2880
|
const i = n[t];
|
|
2872
2881
|
if (i) return r?.trim() ? dn(i, t, r) : i;
|
|
2873
2882
|
}
|
|
2874
|
-
const
|
|
2875
|
-
return
|
|
2876
|
-
},
|
|
2883
|
+
const o = po(e, t);
|
|
2884
|
+
return o ? r?.trim() ? dn(o, t, r) : o : mo(e, t, r);
|
|
2885
|
+
}, fo = (e, t) => {
|
|
2877
2886
|
if (!e) return "";
|
|
2878
|
-
let r = e.replace(/<span[^>]*\bdata-merge="([^"]+)"(?:[^>]*\bdata-merge-default="([^"]*)")?[^>]*>.*?<\/span>/gs, (n,
|
|
2879
|
-
return r = r.replace(/\{\{\s*(?:'([^']*)'|"([^"]*)"|(\w+))(?:\s*\|\s*(?:'([^']*)'|"([^"]*)"|([^'"\}\s][^'"\}]*?)))?\s*\}\}/g, (n,
|
|
2880
|
-
const v = (
|
|
2887
|
+
let r = e.replace(/<span[^>]*\bdata-merge="([^"]+)"(?:[^>]*\bdata-merge-default="([^"]*)")?[^>]*>.*?<\/span>/gs, (n, o, i) => pn(o, t, i?.trim() || void 0));
|
|
2888
|
+
return r = r.replace(/\{\{\s*(?:'([^']*)'|"([^"]*)"|(\w+))(?:\s*\|\s*(?:'([^']*)'|"([^"]*)"|([^'"\}\s][^'"\}]*?)))?\s*\}\}/g, (n, o, i, a, l, c, p) => {
|
|
2889
|
+
const v = (o ?? i ?? a ?? "").trim(), b = (l ?? c ?? p ?? "").trim();
|
|
2881
2890
|
return pn(v, t, b || void 0);
|
|
2882
2891
|
}), r;
|
|
2883
|
-
},
|
|
2892
|
+
}, fa = () => [...Object.keys(Wt), ...uo()], ga = (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
|
+
}, go = (e) => {
|
|
2890
2899
|
if (!e) return "";
|
|
2891
|
-
let t = e.replace(/<span[^>]*\bdata-merge="([^"]+)"(?:[^>]*\bdata-merge-default="([^"]*)")?[^>]*>.*?<\/span>/gs, (r, n,
|
|
2892
|
-
return t = t.replace(/\{\{\s*(?:'([^']*)'|"([^"]*)"|(\w+))(?:\s*\|\s*(?:'([^']*)'|"([^"]*)"|([^'"\}\s][^'"\}]*?)))?\s*\}\}/g, (r, n,
|
|
2893
|
-
const
|
|
2894
|
-
return mn(
|
|
2895
|
-
}), t = t.replace(/(\b(?!style=)\w[\w-]*=)"([^"]*\{[^}]+\}[^"]*)"/g, (r, n,
|
|
2896
|
-
const i =
|
|
2897
|
-
return i ? `${n}{${i[1]}}` : `${n}{\`${
|
|
2900
|
+
let t = e.replace(/<span[^>]*\bdata-merge="([^"]+)"(?:[^>]*\bdata-merge-default="([^"]*)")?[^>]*>.*?<\/span>/gs, (r, n, o) => mn(n, o?.trim() || void 0));
|
|
2901
|
+
return t = t.replace(/\{\{\s*(?:'([^']*)'|"([^"]*)"|(\w+))(?:\s*\|\s*(?:'([^']*)'|"([^"]*)"|([^'"\}\s][^'"\}]*?)))?\s*\}\}/g, (r, n, o, i, a, l, c) => {
|
|
2902
|
+
const p = (n ?? o ?? i ?? "").trim(), v = (a ?? l ?? c ?? "").trim();
|
|
2903
|
+
return mn(p, v || void 0);
|
|
2904
|
+
}), t = t.replace(/(\b(?!style=)\w[\w-]*=)"([^"]*\{[^}]+\}[^"]*)"/g, (r, n, o) => {
|
|
2905
|
+
const i = o.match(/^\{(\w+)\}$/);
|
|
2906
|
+
return i ? `${n}{${i[1]}}` : `${n}{\`${o.replace(/\{(\w+)\}/g, "${$1}")}\`}`;
|
|
2898
2907
|
}), t;
|
|
2899
|
-
},
|
|
2908
|
+
}, ho = (e) => {
|
|
2900
2909
|
if (e.length === 0) return {
|
|
2901
2910
|
propsInterface: "",
|
|
2902
2911
|
propsDestructure: ""
|
|
2903
2912
|
};
|
|
2904
2913
|
const t = /* @__PURE__ */ new Map();
|
|
2905
|
-
for (const { tagId: n, fallback:
|
|
2914
|
+
for (const { tagId: n, fallback: o } of e) t.has(n) || t.set(n, o);
|
|
2906
2915
|
const r = [...t.entries()];
|
|
2907
2916
|
return {
|
|
2908
2917
|
propsInterface: `interface EmailProps {
|
|
2909
2918
|
${r.map(([n]) => ` ${n}?: string;`).join(`
|
|
2910
2919
|
`)}
|
|
2911
2920
|
}`,
|
|
2912
|
-
propsDestructure: `{ ${r.map(([n,
|
|
2921
|
+
propsDestructure: `{ ${r.map(([n, o]) => o?.trim() ? `${n} = "${o.trim().replace(/"/g, '\\"')}"` : n).join(", ")} }: EmailProps`
|
|
2913
2922
|
};
|
|
2914
|
-
},
|
|
2923
|
+
}, vo = (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();
|
|
2918
2927
|
n && !t.has(n) && t.set(n, r[2]?.trim() || void 0);
|
|
2919
2928
|
}
|
|
2920
2929
|
for (const r of e.matchAll(/\{\{\s*(?:'([^']*)'|"([^"]*)"|(\w+))(?:\s*\|\s*(?:'([^']*)'|"([^"]*)"|([^'"\}\s][^'"\}]*?)))?\s*\}\}/g)) {
|
|
2921
|
-
const n = (r[1] ?? r[2] ?? r[3] ?? "").trim(),
|
|
2922
|
-
n && !t.has(n) && t.set(n,
|
|
2930
|
+
const n = (r[1] ?? r[2] ?? r[3] ?? "").trim(), o = (r[4] ?? r[5] ?? r[6] ?? "").trim();
|
|
2931
|
+
n && !t.has(n) && t.set(n, o || void 0);
|
|
2923
2932
|
}
|
|
2924
2933
|
return [...t.entries()].map(([r, n]) => ({
|
|
2925
2934
|
tagId: r,
|
|
2926
2935
|
fallback: n
|
|
2927
2936
|
}));
|
|
2928
|
-
},
|
|
2929
|
-
const t = /* @__PURE__ */ new Set(), r = (
|
|
2930
|
-
if (
|
|
2931
|
-
for (const i of
|
|
2932
|
-
for (const i of
|
|
2937
|
+
}, bo = (e) => {
|
|
2938
|
+
const t = /* @__PURE__ */ new Set(), r = (o) => {
|
|
2939
|
+
if (o?.enabled) {
|
|
2940
|
+
for (const i of o.rules ?? []) i.tag?.trim() && t.add(Ge(i.tag));
|
|
2941
|
+
for (const i of o.groups ?? []) for (const a of i.rules ?? []) a.tag?.trim() && t.add(Ge(a.tag));
|
|
2933
2942
|
}
|
|
2934
|
-
}, n = (
|
|
2935
|
-
for (const i of
|
|
2943
|
+
}, n = (o) => {
|
|
2944
|
+
for (const i of o) if (i.type === "row") {
|
|
2936
2945
|
r(i.visibility);
|
|
2937
|
-
for (const
|
|
2938
|
-
r(
|
|
2939
|
-
const l =
|
|
2946
|
+
for (const a of i.columns ?? []) {
|
|
2947
|
+
r(a.props?.visibility);
|
|
2948
|
+
const l = a.children ?? a.components ?? [];
|
|
2940
2949
|
n(l);
|
|
2941
2950
|
}
|
|
2942
2951
|
} else i.type === "row-spacer" ? r(i.visibility) : r(i.props?.visibility);
|
|
2943
2952
|
};
|
|
2944
|
-
for (const
|
|
2945
|
-
r(
|
|
2946
|
-
for (const i of
|
|
2953
|
+
for (const o of e) {
|
|
2954
|
+
r(o.visibility);
|
|
2955
|
+
for (const i of o.columns ?? [])
|
|
2947
2956
|
r(i.props?.visibility), n(i.children ?? i.components ?? []);
|
|
2948
2957
|
}
|
|
2949
2958
|
return [...t];
|
|
2950
|
-
},
|
|
2959
|
+
}, $o = (e) => e.length === 0 ? "" : ` // Visibility data — replace with real values from your data source
|
|
2951
2960
|
${e.map((t) => ` const ${t} = "";`).join(`
|
|
2952
|
-
`)}`, Hn = (e, t, r, n,
|
|
2961
|
+
`)}`, Hn = (e, t, r, n, o = !1) => {
|
|
2953
2962
|
const i = n?.mergeTagActive || n?.linkTagActive;
|
|
2954
|
-
if (t === "wrap" || !i) return
|
|
2955
|
-
if (
|
|
2956
|
-
const { mergeTagContext:
|
|
2957
|
-
return Fn(e,
|
|
2963
|
+
if (t === "wrap" || !i) return fo(e, r);
|
|
2964
|
+
if (o) {
|
|
2965
|
+
const { mergeTagContext: a, mergeTagActive: l, linkTagContext: c, linkTagActive: p } = n;
|
|
2966
|
+
return Fn(e, a ?? {}, l ?? !1, c ?? {}, p ?? !1);
|
|
2958
2967
|
}
|
|
2959
2968
|
return e;
|
|
2960
2969
|
}, Un = (e, t, r) => {
|
|
2961
2970
|
if (t === "wrap" || !r) return e;
|
|
2962
|
-
const { mergeTagContext: n, mergeTagActive:
|
|
2963
|
-
return !
|
|
2971
|
+
const { mergeTagContext: n, mergeTagActive: o, linkTagContext: i, linkTagActive: a } = r;
|
|
2972
|
+
return !o && !a ? e : Fn(e, n, o, i, a);
|
|
2964
2973
|
}, Vt = /* @__PURE__ */ new Map(), Jn = /* @__PURE__ */ new Map();
|
|
2965
|
-
function
|
|
2974
|
+
function ha(e, t, r) {
|
|
2966
2975
|
Vt.set(e, t), r && Jn.set(e, r);
|
|
2967
2976
|
}
|
|
2968
|
-
var
|
|
2977
|
+
var yo = {
|
|
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 So(e, t) {
|
|
2984
|
+
return t[e] ?? Vt.get(e) ?? yo;
|
|
2976
2985
|
}
|
|
2977
2986
|
function Gn(e) {
|
|
2978
2987
|
return Jn.get(e);
|
|
2979
2988
|
}
|
|
2980
|
-
function
|
|
2989
|
+
function va() {
|
|
2981
2990
|
return [...Vt.entries()].map(([e, t]) => ({
|
|
2982
2991
|
id: e,
|
|
2983
2992
|
meta: t
|
|
2984
2993
|
}));
|
|
2985
2994
|
}
|
|
2986
|
-
var
|
|
2995
|
+
var ko = {
|
|
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
|
+
}, ba = [
|
|
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
|
+
], wo = (e, t) => {
|
|
3303
|
+
const r = Ge(e);
|
|
3295
3304
|
switch (t) {
|
|
3296
3305
|
case "sfmc":
|
|
3297
3306
|
return `AttributeValue("${r}")`;
|
|
@@ -3303,48 +3312,48 @@ var ya = {
|
|
|
3303
3312
|
return r;
|
|
3304
3313
|
}
|
|
3305
3314
|
}, Te = (e, t) => {
|
|
3306
|
-
const { operator: r, value: n } = e,
|
|
3315
|
+
const { operator: r, value: n } = e, o = wo(e.tag, t);
|
|
3307
3316
|
switch (t) {
|
|
3308
3317
|
case "handlebars":
|
|
3309
3318
|
case "sendgrid":
|
|
3310
3319
|
case "iterable":
|
|
3311
3320
|
switch (r) {
|
|
3312
3321
|
case "==":
|
|
3313
|
-
return `(eq ${
|
|
3322
|
+
return `(eq ${o} '${n}')`;
|
|
3314
3323
|
case "!=":
|
|
3315
|
-
return `(neq ${
|
|
3324
|
+
return `(neq ${o} '${n}')`;
|
|
3316
3325
|
case "contains":
|
|
3317
|
-
return `(contains ${
|
|
3326
|
+
return `(contains ${o} '${n}')`;
|
|
3318
3327
|
case "not_contains":
|
|
3319
|
-
return `(not (contains ${
|
|
3328
|
+
return `(not (contains ${o} '${n}'))`;
|
|
3320
3329
|
case "starts_with":
|
|
3321
|
-
return `(startsWith ${
|
|
3330
|
+
return `(startsWith ${o} '${n}')`;
|
|
3322
3331
|
case "ends_with":
|
|
3323
|
-
return `(endsWith ${
|
|
3332
|
+
return `(endsWith ${o} '${n}')`;
|
|
3324
3333
|
case "in":
|
|
3325
|
-
return `(in ${
|
|
3334
|
+
return `(in ${o} ${n.split(",").map((i) => `'${i.trim()}'`).join(" ")})`;
|
|
3326
3335
|
case "not_in":
|
|
3327
|
-
return `(not (in ${
|
|
3336
|
+
return `(not (in ${o} ${n.split(",").map((i) => `'${i.trim()}'`).join(" ")}))`;
|
|
3328
3337
|
case ">":
|
|
3329
|
-
return `(gt ${
|
|
3338
|
+
return `(gt ${o} ${n})`;
|
|
3330
3339
|
case "<":
|
|
3331
|
-
return `(lt ${
|
|
3340
|
+
return `(lt ${o} ${n})`;
|
|
3332
3341
|
case ">=":
|
|
3333
|
-
return `(gte ${
|
|
3342
|
+
return `(gte ${o} ${n})`;
|
|
3334
3343
|
case "<=":
|
|
3335
|
-
return `(lte ${
|
|
3344
|
+
return `(lte ${o} ${n})`;
|
|
3336
3345
|
case "is_empty":
|
|
3337
|
-
return `(isEmpty ${
|
|
3346
|
+
return `(isEmpty ${o})`;
|
|
3338
3347
|
case "is_not_empty":
|
|
3339
|
-
return `(not (isEmpty ${
|
|
3348
|
+
return `(not (isEmpty ${o}))`;
|
|
3340
3349
|
case "date_before":
|
|
3341
|
-
return `(dateBefore ${
|
|
3350
|
+
return `(dateBefore ${o} '${n}')`;
|
|
3342
3351
|
case "date_after":
|
|
3343
|
-
return `(dateAfter ${
|
|
3352
|
+
return `(dateAfter ${o} '${n}')`;
|
|
3344
3353
|
case "date_on":
|
|
3345
|
-
return `(dateOn ${
|
|
3354
|
+
return `(dateOn ${o} '${n}')`;
|
|
3346
3355
|
default:
|
|
3347
|
-
return `(eq ${
|
|
3356
|
+
return `(eq ${o} '${n}')`;
|
|
3348
3357
|
}
|
|
3349
3358
|
case "liquid":
|
|
3350
3359
|
case "klaviyo":
|
|
@@ -3352,197 +3361,197 @@ var ya = {
|
|
|
3352
3361
|
case "hubspot":
|
|
3353
3362
|
switch (r) {
|
|
3354
3363
|
case "==":
|
|
3355
|
-
return `${
|
|
3364
|
+
return `${o} == '${n}'`;
|
|
3356
3365
|
case "!=":
|
|
3357
|
-
return `${
|
|
3366
|
+
return `${o} != '${n}'`;
|
|
3358
3367
|
case "contains":
|
|
3359
|
-
return `${
|
|
3368
|
+
return `${o} contains '${n}'`;
|
|
3360
3369
|
case "not_contains":
|
|
3361
|
-
return `not (${
|
|
3370
|
+
return `not (${o} contains '${n}')`;
|
|
3362
3371
|
case "starts_with":
|
|
3363
3372
|
case "ends_with":
|
|
3364
3373
|
return null;
|
|
3365
3374
|
case "in":
|
|
3366
|
-
return n.split(",").map((i) => `${
|
|
3375
|
+
return n.split(",").map((i) => `${o} == '${i.trim()}'`).join(" or ");
|
|
3367
3376
|
case "not_in":
|
|
3368
|
-
return n.split(",").map((i) => `${
|
|
3377
|
+
return n.split(",").map((i) => `${o} != '${i.trim()}'`).join(" and ");
|
|
3369
3378
|
case ">":
|
|
3370
|
-
return `${
|
|
3379
|
+
return `${o} > ${n}`;
|
|
3371
3380
|
case "<":
|
|
3372
|
-
return `${
|
|
3381
|
+
return `${o} < ${n}`;
|
|
3373
3382
|
case ">=":
|
|
3374
|
-
return `${
|
|
3383
|
+
return `${o} >= ${n}`;
|
|
3375
3384
|
case "<=":
|
|
3376
|
-
return `${
|
|
3385
|
+
return `${o} <= ${n}`;
|
|
3377
3386
|
case "is_empty":
|
|
3378
|
-
return `${
|
|
3387
|
+
return `${o} == blank`;
|
|
3379
3388
|
case "is_not_empty":
|
|
3380
|
-
return `${
|
|
3389
|
+
return `${o} != blank`;
|
|
3381
3390
|
case "date_before":
|
|
3382
3391
|
return `${Nt(e.tag)} < ${Bt(e.tag, n)}`;
|
|
3383
3392
|
case "date_after":
|
|
3384
3393
|
return `${Nt(e.tag)} > ${Bt(e.tag, n)}`;
|
|
3385
3394
|
case "date_on":
|
|
3386
|
-
return `${
|
|
3395
|
+
return `${o} | date: '%F' == '${n}'`;
|
|
3387
3396
|
default:
|
|
3388
|
-
return `${
|
|
3397
|
+
return `${o} == '${n}'`;
|
|
3389
3398
|
}
|
|
3390
3399
|
case "mailchimp":
|
|
3391
3400
|
switch (r) {
|
|
3392
3401
|
case "==":
|
|
3393
|
-
return `${
|
|
3402
|
+
return `${o}='${n}'`;
|
|
3394
3403
|
case "!=":
|
|
3395
|
-
return `${
|
|
3404
|
+
return `${o}!='${n}'`;
|
|
3396
3405
|
case ">":
|
|
3397
3406
|
case "<":
|
|
3398
3407
|
case ">=":
|
|
3399
3408
|
case "<=": {
|
|
3400
3409
|
const i = Number(n);
|
|
3401
|
-
return Number.isNaN(i) ? `${
|
|
3410
|
+
return Number.isNaN(i) ? `${o}='${n}'` : `${o}${r}${i}`;
|
|
3402
3411
|
}
|
|
3403
3412
|
case "date_before":
|
|
3404
|
-
return `${
|
|
3413
|
+
return `${o}<'${n}'`;
|
|
3405
3414
|
case "date_after":
|
|
3406
|
-
return `${
|
|
3415
|
+
return `${o}>'${n}'`;
|
|
3407
3416
|
case "date_on":
|
|
3408
|
-
return `${
|
|
3417
|
+
return `${o}='${n}'`;
|
|
3409
3418
|
default:
|
|
3410
|
-
return `${
|
|
3419
|
+
return `${o}='${n}'`;
|
|
3411
3420
|
}
|
|
3412
3421
|
case "sfmc":
|
|
3413
3422
|
switch (r) {
|
|
3414
3423
|
case "==":
|
|
3415
|
-
return `${
|
|
3424
|
+
return `${o} == '${n}'`;
|
|
3416
3425
|
case "!=":
|
|
3417
|
-
return `${
|
|
3426
|
+
return `${o} != '${n}'`;
|
|
3418
3427
|
case "contains":
|
|
3419
|
-
return `Contains(${
|
|
3428
|
+
return `Contains(${o}, '${n}')`;
|
|
3420
3429
|
case "not_contains":
|
|
3421
|
-
return `Not Contains(${
|
|
3430
|
+
return `Not Contains(${o}, '${n}')`;
|
|
3422
3431
|
case "starts_with":
|
|
3423
|
-
return `IndexOf(${
|
|
3432
|
+
return `IndexOf(${o}, '${n}') == 1`;
|
|
3424
3433
|
case "ends_with":
|
|
3425
|
-
return `Substring(${
|
|
3434
|
+
return `Substring(${o}, Subtract(Length(${o}), Subtract(Length('${n}'), 1)), Length('${n}')) == '${n}'`;
|
|
3426
3435
|
case "in":
|
|
3427
|
-
return n.split(",").map((i) => `${
|
|
3436
|
+
return n.split(",").map((i) => `${o} == '${i.trim()}'`).join(" OR ");
|
|
3428
3437
|
case "not_in":
|
|
3429
|
-
return n.split(",").map((i) => `${
|
|
3438
|
+
return n.split(",").map((i) => `${o} != '${i.trim()}'`).join(" AND ");
|
|
3430
3439
|
case ">":
|
|
3431
|
-
return `${
|
|
3440
|
+
return `${o} > ${n}`;
|
|
3432
3441
|
case "<":
|
|
3433
|
-
return `${
|
|
3442
|
+
return `${o} < ${n}`;
|
|
3434
3443
|
case ">=":
|
|
3435
|
-
return `${
|
|
3444
|
+
return `${o} >= ${n}`;
|
|
3436
3445
|
case "<=":
|
|
3437
|
-
return `${
|
|
3446
|
+
return `${o} <= ${n}`;
|
|
3438
3447
|
case "is_empty":
|
|
3439
|
-
return `Empty(${
|
|
3448
|
+
return `Empty(${o})`;
|
|
3440
3449
|
case "is_not_empty":
|
|
3441
|
-
return `Not Empty(${
|
|
3450
|
+
return `Not Empty(${o})`;
|
|
3442
3451
|
case "date_before":
|
|
3443
|
-
return `DateDiff(DateParse(${
|
|
3452
|
+
return `DateDiff(DateParse(${o}), DateParse('${n}'), "D") < 0`;
|
|
3444
3453
|
case "date_after":
|
|
3445
|
-
return `DateDiff(DateParse(${
|
|
3454
|
+
return `DateDiff(DateParse(${o}), DateParse('${n}'), "D") > 0`;
|
|
3446
3455
|
case "date_on":
|
|
3447
|
-
return `DateDiff(DateParse(${
|
|
3456
|
+
return `DateDiff(DateParse(${o}), DateParse('${n}'), "D") == 0`;
|
|
3448
3457
|
default:
|
|
3449
|
-
return `${
|
|
3458
|
+
return `${o} == '${n}'`;
|
|
3450
3459
|
}
|
|
3451
3460
|
case "activecampaign":
|
|
3452
3461
|
switch (r) {
|
|
3453
3462
|
case "==":
|
|
3454
|
-
return `${
|
|
3463
|
+
return `${o} EQUALS ${n}`;
|
|
3455
3464
|
case "!=":
|
|
3456
|
-
return `${
|
|
3465
|
+
return `${o} NOT EQUALS ${n}`;
|
|
3457
3466
|
case "contains":
|
|
3458
|
-
return `${
|
|
3467
|
+
return `${o} CONTAINS ${n}`;
|
|
3459
3468
|
case "not_contains":
|
|
3460
|
-
return `${
|
|
3469
|
+
return `${o} NOT CONTAINS ${n}`;
|
|
3461
3470
|
case "starts_with":
|
|
3462
3471
|
case "ends_with":
|
|
3463
3472
|
return null;
|
|
3464
3473
|
case "in":
|
|
3465
|
-
return `${
|
|
3474
|
+
return `${o} IN ${n.split(",").map((i) => i.trim()).join(",")}`;
|
|
3466
3475
|
case "not_in":
|
|
3467
|
-
return `${
|
|
3476
|
+
return `${o} NOT IN ${n.split(",").map((i) => i.trim()).join(",")}`;
|
|
3468
3477
|
case ">":
|
|
3469
|
-
return `${
|
|
3478
|
+
return `${o} GREATER THAN ${n}`;
|
|
3470
3479
|
case "<":
|
|
3471
|
-
return `${
|
|
3480
|
+
return `${o} LESS THAN ${n}`;
|
|
3472
3481
|
case ">=":
|
|
3473
|
-
return `${
|
|
3482
|
+
return `${o} GREATER THAN OR EQUAL TO ${n}`;
|
|
3474
3483
|
case "<=":
|
|
3475
|
-
return `${
|
|
3484
|
+
return `${o} LESS THAN OR EQUAL TO ${n}`;
|
|
3476
3485
|
case "is_empty":
|
|
3477
|
-
return `${
|
|
3486
|
+
return `${o} IS EMPTY`;
|
|
3478
3487
|
case "is_not_empty":
|
|
3479
|
-
return `${
|
|
3488
|
+
return `${o} IS NOT EMPTY`;
|
|
3480
3489
|
case "date_before":
|
|
3481
|
-
return `${
|
|
3490
|
+
return `${o} LESS THAN ${n}`;
|
|
3482
3491
|
case "date_after":
|
|
3483
|
-
return `${
|
|
3492
|
+
return `${o} GREATER THAN ${n}`;
|
|
3484
3493
|
case "date_on":
|
|
3485
|
-
return `${
|
|
3494
|
+
return `${o} EQUALS ${n}`;
|
|
3486
3495
|
default:
|
|
3487
|
-
return `${
|
|
3496
|
+
return `${o} EQUALS ${n}`;
|
|
3488
3497
|
}
|
|
3489
3498
|
case "marketo":
|
|
3490
3499
|
switch (r) {
|
|
3491
3500
|
case "==":
|
|
3492
|
-
return `${
|
|
3501
|
+
return `${o} == '${n}'`;
|
|
3493
3502
|
case "!=":
|
|
3494
|
-
return `${
|
|
3503
|
+
return `${o} != '${n}'`;
|
|
3495
3504
|
case "contains":
|
|
3496
|
-
return `${
|
|
3505
|
+
return `${o} && ${o}.contains('${n}')`;
|
|
3497
3506
|
case "not_contains":
|
|
3498
|
-
return `!${
|
|
3507
|
+
return `!${o} || !${o}.contains('${n}')`;
|
|
3499
3508
|
case "starts_with":
|
|
3500
|
-
return `${
|
|
3509
|
+
return `${o}.startsWith('${n}')`;
|
|
3501
3510
|
case "ends_with":
|
|
3502
|
-
return `${
|
|
3511
|
+
return `${o}.endsWith('${n}')`;
|
|
3503
3512
|
case "in":
|
|
3504
|
-
return n.split(",").map((i) => `${
|
|
3513
|
+
return n.split(",").map((i) => `${o} == '${i.trim()}'`).join(" || ");
|
|
3505
3514
|
case "not_in":
|
|
3506
|
-
return n.split(",").map((i) => `${
|
|
3515
|
+
return n.split(",").map((i) => `${o} != '${i.trim()}'`).join(" && ");
|
|
3507
3516
|
case ">":
|
|
3508
|
-
return `${
|
|
3517
|
+
return `${o}.toInteger() > ${n}`;
|
|
3509
3518
|
case "<":
|
|
3510
|
-
return `${
|
|
3519
|
+
return `${o}.toInteger() < ${n}`;
|
|
3511
3520
|
case ">=":
|
|
3512
|
-
return `${
|
|
3521
|
+
return `${o}.toInteger() >= ${n}`;
|
|
3513
3522
|
case "<=":
|
|
3514
|
-
return `${
|
|
3523
|
+
return `${o}.toInteger() <= ${n}`;
|
|
3515
3524
|
case "is_empty":
|
|
3516
|
-
return `!${
|
|
3525
|
+
return `!${o} || ${o} == ''`;
|
|
3517
3526
|
case "is_not_empty":
|
|
3518
|
-
return `${
|
|
3527
|
+
return `${o} && ${o} != ''`;
|
|
3519
3528
|
case "date_before":
|
|
3520
|
-
return `$date.parse('yyyy-MM-dd', ${
|
|
3529
|
+
return `$date.parse('yyyy-MM-dd', ${o}).before($date.parse('yyyy-MM-dd', '${n}'))`;
|
|
3521
3530
|
case "date_after":
|
|
3522
|
-
return `$date.parse('yyyy-MM-dd', ${
|
|
3531
|
+
return `$date.parse('yyyy-MM-dd', ${o}).after($date.parse('yyyy-MM-dd', '${n}'))`;
|
|
3523
3532
|
case "date_on":
|
|
3524
|
-
return `$date.parse('yyyy-MM-dd', ${
|
|
3533
|
+
return `$date.parse('yyyy-MM-dd', ${o}).equals($date.parse('yyyy-MM-dd', '${n}'))`;
|
|
3525
3534
|
default:
|
|
3526
|
-
return `${
|
|
3535
|
+
return `${o} == '${n}'`;
|
|
3527
3536
|
}
|
|
3528
3537
|
case "campaign_monitor":
|
|
3529
3538
|
case "pardot":
|
|
3530
3539
|
switch (r) {
|
|
3531
3540
|
case "==":
|
|
3532
|
-
return `${
|
|
3541
|
+
return `${o}='${n}'`;
|
|
3533
3542
|
case "!=":
|
|
3534
|
-
return `${
|
|
3543
|
+
return `${o}!='${n}'`;
|
|
3535
3544
|
case "date_before":
|
|
3536
3545
|
case "date_after":
|
|
3537
3546
|
case "date_on":
|
|
3538
|
-
return `${
|
|
3547
|
+
return `${o}='${n}'`;
|
|
3539
3548
|
default:
|
|
3540
|
-
return `${
|
|
3549
|
+
return `${o}='${n}'`;
|
|
3541
3550
|
}
|
|
3542
3551
|
case "mso":
|
|
3543
3552
|
return "mso | IE";
|
|
3544
3553
|
default:
|
|
3545
|
-
return `${
|
|
3554
|
+
return `${o} == '${n}'`;
|
|
3546
3555
|
}
|
|
3547
3556
|
}, fn = (e, t, r) => {
|
|
3548
3557
|
if (e.length === 1) return e[0];
|
|
@@ -3627,88 +3636,88 @@ 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, "_")}`, xo = (e) => {
|
|
3631
3640
|
const t = /* @__PURE__ */ new Set(), r = [];
|
|
3632
3641
|
for (const n of e) {
|
|
3633
|
-
const
|
|
3634
|
-
if (
|
|
3635
|
-
const i = Nt(n.tag),
|
|
3636
|
-
t.has(i) || (t.add(i), r.push(`{%- assign ${i} = ${
|
|
3642
|
+
const o = n.operator;
|
|
3643
|
+
if (o !== "date_before" && o !== "date_after") continue;
|
|
3644
|
+
const i = Nt(n.tag), a = Bt(n.tag, n.value);
|
|
3645
|
+
t.has(i) || (t.add(i), r.push(`{%- assign ${i} = ${Ge(n.tag)} | date: '%s' -%}`)), t.has(a) || (t.add(a), r.push(`{%- assign ${a} = '${n.value}' | date: '%s' -%}`));
|
|
3637
3646
|
}
|
|
3638
3647
|
return r;
|
|
3639
|
-
},
|
|
3640
|
-
const r = (
|
|
3648
|
+
}, Co = (e) => e === "liquid" || e === "klaviyo" || e === "braze" || e === "hubspot", _o = (e, t) => {
|
|
3649
|
+
const r = (a, l) => a.length === 0 ? l : [...a].reverse().reduce((c, p) => `*|IF:${p}|*
|
|
3641
3650
|
${c}
|
|
3642
|
-
*|END:IF|*`, l), n = (
|
|
3651
|
+
*|END:IF|*`, l), n = (a, l) => a.length === 0 ? l : a.map((c) => `*|IF:${c}|*
|
|
3643
3652
|
${l}
|
|
3644
3653
|
*|END:IF|*`).join(`
|
|
3645
|
-
`),
|
|
3646
|
-
const
|
|
3647
|
-
return
|
|
3648
|
-
}, i = (t.rules ?? []).map((
|
|
3654
|
+
`), o = (a, l, c) => {
|
|
3655
|
+
const p = a.map((v) => Te(v, "mailchimp")).filter((v) => v !== null);
|
|
3656
|
+
return p.length === 0 ? null : l === "all" ? r(p, c) : n(p, c);
|
|
3657
|
+
}, i = (t.rules ?? []).map((a) => Te(a, "mailchimp")).filter((a) => a !== null);
|
|
3649
3658
|
if (t.match === "all") {
|
|
3650
|
-
let
|
|
3659
|
+
let a = e;
|
|
3651
3660
|
for (const l of [...t.groups ?? []].reverse()) {
|
|
3652
|
-
const c = l.rules.map((
|
|
3653
|
-
c.length !== 0 && (
|
|
3661
|
+
const c = l.rules.map((p) => Te(p, "mailchimp")).filter((p) => p !== null);
|
|
3662
|
+
c.length !== 0 && (a = l.match === "all" ? r(c, a) : n(c, a));
|
|
3654
3663
|
}
|
|
3655
|
-
return i.length > 0 ? r(i,
|
|
3664
|
+
return i.length > 0 ? r(i, a) : a;
|
|
3656
3665
|
} else {
|
|
3657
|
-
const
|
|
3666
|
+
const a = [...i.map((l) => `*|IF:${l}|*
|
|
3658
3667
|
${e}
|
|
3659
|
-
*|END:IF|*`), ...(t.groups ?? []).map((l) =>
|
|
3660
|
-
return
|
|
3668
|
+
*|END:IF|*`), ...(t.groups ?? []).map((l) => o(l.rules, l.match, e)).filter((l) => l !== null)];
|
|
3669
|
+
return a.length > 0 ? a.join(`
|
|
3661
3670
|
`) : e;
|
|
3662
3671
|
}
|
|
3663
3672
|
}, Vn = (e, t) => {
|
|
3664
|
-
const r =
|
|
3665
|
-
let
|
|
3666
|
-
r.supportsNesting ?
|
|
3667
|
-
const l =
|
|
3673
|
+
const r = So(t, ko), n = (e.rules ?? []).map((a) => Te(a, t)).filter((a) => a !== null);
|
|
3674
|
+
let o;
|
|
3675
|
+
r.supportsNesting ? o = (e.groups ?? []).map((a) => {
|
|
3676
|
+
const l = a.rules.map((p) => Te(p, t)).filter((p) => p !== null);
|
|
3668
3677
|
if (l.length === 0) return null;
|
|
3669
|
-
const c = fn(l,
|
|
3678
|
+
const c = fn(l, a.match, t);
|
|
3670
3679
|
return l.length > 1 ? `(${c})` : c;
|
|
3671
|
-
}).filter((
|
|
3672
|
-
const i = [...n, ...
|
|
3680
|
+
}).filter((a) => a !== null) : o = (e.groups ?? []).flatMap((a) => a.rules).map((a) => Te(a, t)).filter((a) => a !== null);
|
|
3681
|
+
const i = [...n, ...o];
|
|
3673
3682
|
return i.length === 0 ? null : {
|
|
3674
3683
|
expression: fn(i, e.match, t),
|
|
3675
|
-
preludes:
|
|
3684
|
+
preludes: Co(t) ? xo([...e.rules ?? [], ...(e.groups ?? []).flatMap((a) => a.rules)]) : []
|
|
3676
3685
|
};
|
|
3677
3686
|
}, be = (e, t, r = "handlebars") => {
|
|
3678
3687
|
if (!t?.enabled) return e;
|
|
3679
|
-
const n = (t.rules?.length ?? 0) > 0,
|
|
3680
|
-
if (!n && !
|
|
3681
|
-
if (r === "mailchimp") return
|
|
3688
|
+
const n = (t.rules?.length ?? 0) > 0, o = (t.groups?.length ?? 0) > 0;
|
|
3689
|
+
if (!n && !o) return e;
|
|
3690
|
+
if (r === "mailchimp") return _o(e, t);
|
|
3682
3691
|
const i = Vn(t, r);
|
|
3683
3692
|
if (!i) return e;
|
|
3684
|
-
const { expression:
|
|
3693
|
+
const { expression: a, preludes: l } = i, c = qn(a, 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
|
+
}, $a = (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
|
}
|
|
3701
|
-
const
|
|
3702
|
-
if (!
|
|
3703
|
-
const { expression: i, preludes:
|
|
3710
|
+
const o = Vn(e, t);
|
|
3711
|
+
if (!o) return null;
|
|
3712
|
+
const { expression: i, preludes: a } = o, l = qn(i, t);
|
|
3704
3713
|
return {
|
|
3705
|
-
openTag: `${
|
|
3714
|
+
openTag: `${a.length > 0 ? `${a.join(`
|
|
3706
3715
|
`)}
|
|
3707
3716
|
` : ""}${l}`,
|
|
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())}`;
|
|
@@ -3723,11 +3732,11 @@ ${d}`;
|
|
|
3723
3732
|
case "ends_with":
|
|
3724
3733
|
return `String(${t}).toLowerCase().endsWith(${JSON.stringify(r.toLowerCase())})`;
|
|
3725
3734
|
case "in": {
|
|
3726
|
-
const n = r.split(/[,\n;]+/).map((
|
|
3735
|
+
const n = r.split(/[,\n;]+/).map((o) => o.trim().toLowerCase()).filter(Boolean);
|
|
3727
3736
|
return `${JSON.stringify(n)}.includes(String(${t}).toLowerCase())`;
|
|
3728
3737
|
}
|
|
3729
3738
|
case "not_in": {
|
|
3730
|
-
const n = r.split(/[,\n;]+/).map((
|
|
3739
|
+
const n = r.split(/[,\n;]+/).map((o) => o.trim().toLowerCase()).filter(Boolean);
|
|
3731
3740
|
return `!${JSON.stringify(n)}.includes(String(${t}).toLowerCase())`;
|
|
3732
3741
|
}
|
|
3733
3742
|
case ">":
|
|
@@ -3751,34 +3760,34 @@ ${d}`;
|
|
|
3751
3760
|
default:
|
|
3752
3761
|
return "true";
|
|
3753
3762
|
}
|
|
3754
|
-
},
|
|
3763
|
+
}, To = (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
|
+
}, Ao = (e) => {
|
|
3768
|
+
const t = (e.rules ?? []).map(Kn), r = (e.groups ?? []).map(To).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
|
-
const
|
|
3763
|
-
return `(${n.join(
|
|
3764
|
-
},
|
|
3771
|
+
const o = e.match === "any" ? " || " : " && ";
|
|
3772
|
+
return `(${n.join(o)})`;
|
|
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
|
|
3769
|
-
return
|
|
3777
|
+
const o = Ao(t);
|
|
3778
|
+
return o ? `{${o} && (
|
|
3770
3779
|
${e.split(`
|
|
3771
3780
|
`).map((i) => ` ${i}`).join(`
|
|
3772
3781
|
`)}
|
|
3773
3782
|
)}` : e;
|
|
3774
3783
|
}, Ae = ({ content: e, filename: t, mimeType: r }) => {
|
|
3775
|
-
const n = new Blob([e], { type: r }),
|
|
3776
|
-
i.href =
|
|
3777
|
-
}, ht = (e) => e.toLowerCase().replace(/\s+/g, "-"), Ne = (e, t) => `${e}${t === "wrap" ? "-master" : "-snapshot"}`,
|
|
3784
|
+
const n = new Blob([e], { type: r }), o = URL.createObjectURL(n), i = document.createElement("a");
|
|
3785
|
+
i.href = o, i.download = t, i.click(), URL.revokeObjectURL(o);
|
|
3786
|
+
}, ht = (e) => e.toLowerCase().replace(/\s+/g, "-"), Ne = (e, t) => `${e}${t === "wrap" ? "-master" : "-snapshot"}`, Ro = /(<style[\s>][\s\S]*?<\/style>|<script[\s>][\s\S]*?<\/script>|<!--[\s\S]*?-->)/gi;
|
|
3778
3787
|
function Yn(e) {
|
|
3779
|
-
const t = e.split(
|
|
3780
|
-
return t.forEach((n,
|
|
3781
|
-
if (
|
|
3788
|
+
const t = e.split(Ro), r = [];
|
|
3789
|
+
return t.forEach((n, o) => {
|
|
3790
|
+
if (o % 2 === 1) {
|
|
3782
3791
|
let i = n.replace(/^[ \t]+|[ \t]+$/gm, "");
|
|
3783
3792
|
i = i.replace(/\n{2,}/g, `
|
|
3784
3793
|
`), r.push(i);
|
|
@@ -3788,13 +3797,13 @@ function Yn(e) {
|
|
|
3788
3797
|
}
|
|
3789
3798
|
}), r.join("");
|
|
3790
3799
|
}
|
|
3791
|
-
function
|
|
3800
|
+
function Eo(e) {
|
|
3792
3801
|
return e && Yn(e);
|
|
3793
3802
|
}
|
|
3794
|
-
function
|
|
3803
|
+
function Mo(e) {
|
|
3795
3804
|
return e && Yn(e);
|
|
3796
3805
|
}
|
|
3797
|
-
function
|
|
3806
|
+
function Io(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
|
|
3816
|
+
return Eo(t);
|
|
3808
3817
|
case "mjml":
|
|
3809
|
-
return
|
|
3818
|
+
return Mo(t);
|
|
3810
3819
|
case "react-email":
|
|
3811
|
-
return
|
|
3820
|
+
return Io(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(No());
|
|
3826
|
+
function No() {
|
|
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:
|
|
3849
|
+
var Bo = 5, Oo = (e) => {
|
|
3850
|
+
const { rows: t, canvasStyles: r, generators: n, espSyntax: o, visibilityContext: i, tagSubstitution: a, 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 (_ >= Bo) 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;
|
|
@@ -3857,19 +3866,19 @@ var Ia = 5, Na = (e) => {
|
|
|
3857
3866
|
if (!m.height || m.height <= 0) continue;
|
|
3858
3867
|
const $ = ce(m);
|
|
3859
3868
|
let k = `<div height="${m.height}" style="height:${m.height}px;line-height:${m.height}px;font-size:1px;mso-line-height-rule:exactly;${$.join(";")}"> </div>`;
|
|
3860
|
-
C === "wrap" && w(m.visibility) && (k = be(k, m.visibility,
|
|
3869
|
+
C === "wrap" && w(m.visibility) && (k = be(k, m.visibility, o.value)), g += k;
|
|
3861
3870
|
continue;
|
|
3862
3871
|
}
|
|
3863
|
-
let x = Un(n.html(m), C,
|
|
3872
|
+
let x = Un(n.html(m), C, a?.value);
|
|
3864
3873
|
const y = m.props?.visibility;
|
|
3865
|
-
C === "wrap" && w(y) && (x = be(x, y,
|
|
3874
|
+
C === "wrap" && w(y) && (x = be(x, y, o.value)), g += x;
|
|
3866
3875
|
}
|
|
3867
3876
|
return g;
|
|
3868
3877
|
}, M = (s, S, C, _ = 0) => {
|
|
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, o.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,8 +3936,8 @@ ${A}
|
|
|
3927
3936
|
z ? `border-radius:${Y(s.border.radius, 2)}` : "",
|
|
3928
3937
|
"overflow:hidden"
|
|
3929
3938
|
].filter(Boolean);
|
|
3930
|
-
let F =
|
|
3931
|
-
return C === "wrap" && w(s.visibility) && (F = be(F, s.visibility,
|
|
3939
|
+
let F = Pn(B, s.border, [], s.padding);
|
|
3940
|
+
return C === "wrap" && w(s.visibility) && (F = be(F, s.visibility, o.value)), (s.minHeight ?? 0) > 0 && N.push(`min-height:${s.minHeight}px`), `
|
|
3932
3941
|
<tr>
|
|
3933
3942
|
<td${N.length ? ` style="${N.join(";")}"` : ""}>
|
|
3934
3943
|
${F}
|
|
@@ -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}` : "",
|
|
@@ -4002,7 +4011,7 @@ ${r.value.preheaderText} ͏ ‌ ͏ ‌ ͏ ‌
|
|
|
4002
4011
|
</table>
|
|
4003
4012
|
</body>
|
|
4004
4013
|
</html>
|
|
4005
|
-
`, $ = Hn($, s,
|
|
4014
|
+
`, $ = Hn($, s, o.value, a?.value), $;
|
|
4006
4015
|
};
|
|
4007
4016
|
return {
|
|
4008
4017
|
export: async (s = "prune", S) => {
|
|
@@ -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 io(_);
|
|
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:
|
|
4033
|
-
if (!
|
|
4034
|
-
const s = (
|
|
4040
|
+
}, jo = 5, zo = (e) => {
|
|
4041
|
+
const { rows: t, canvasStyles: r, generators: n, espSyntax: o, visibilityContext: i, tagSubstitution: a, 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 (_ >= jo) 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
|
-
let y = Un(n.react(m), S,
|
|
4058
|
-
S === "wrap" && E(m.props?.visibility) && (y =
|
|
4066
|
+
let y = Un(n.react(m), S, a?.value);
|
|
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
|
+
${oo(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)}"
|
|
@@ -4196,62 +4205,62 @@ ${k}
|
|
|
4196
4205
|
);
|
|
4197
4206
|
}
|
|
4198
4207
|
`;
|
|
4199
|
-
const z =
|
|
4200
|
-
if (
|
|
4201
|
-
const N =
|
|
4202
|
-
(
|
|
4203
|
-
|
|
4208
|
+
const z = a?.value?.mergeTagActive || a?.value?.linkTagActive;
|
|
4209
|
+
if (d === "wrap" || !z) {
|
|
4210
|
+
const N = vo(B), F = new Set(N.map((W) => W.tagId)), I = bo(t.value).filter((W) => !F.has(W)), { propsInterface: P, propsDestructure: V } = ho(N), q = $o(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 = go(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 so(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:
|
|
4240
|
-
if (!
|
|
4241
|
-
const
|
|
4242
|
-
return
|
|
4243
|
-
}, E = (
|
|
4247
|
+
}, Lo = 5, Po = (e) => {
|
|
4248
|
+
const { rows: t, canvasStyles: r, generators: n, espSyntax: o, visibilityContext: i, tagSubstitution: a, 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 >= Lo) continue;
|
|
4260
|
+
const x = w(_, d, s, S + 1);
|
|
4252
4261
|
if (x.trim()) {
|
|
4253
4262
|
let y = x;
|
|
4254
|
-
s === "wrap" && b(_.visibility) && (y = be(y, _.visibility,
|
|
4263
|
+
s === "wrap" && b(_.visibility) && (y = be(y, _.visibility, o.value)), C += y;
|
|
4255
4264
|
}
|
|
4256
4265
|
continue;
|
|
4257
4266
|
}
|
|
@@ -4259,27 +4268,27 @@ ${q}
|
|
|
4259
4268
|
if (!_.height || _.height <= 0) continue;
|
|
4260
4269
|
const x = ce(_);
|
|
4261
4270
|
let y = `<div height="${_.height}" style="height:${_.height}px;line-height:${_.height}px;font-size:1px;mso-line-height-rule:exactly;${x.join(";")}"> </div>`;
|
|
4262
|
-
s === "wrap" && b(_.visibility) && (y = be(y, _.visibility,
|
|
4271
|
+
s === "wrap" && b(_.visibility) && (y = be(y, _.visibility, o.value)), C += y;
|
|
4263
4272
|
continue;
|
|
4264
4273
|
}
|
|
4265
4274
|
let h = `<div style="font-family:none;font-size:0;line-height:0;text-align:left;color:#000000;">${n.mjml(_).replace(/^<mj-text[^>]*>/i, "").replace(/<\/mj-text>\s*$/i, "")}</div>`;
|
|
4266
|
-
s === "wrap" && b(_.props?.visibility) && (h = be(h, _.props.visibility,
|
|
4275
|
+
s === "wrap" && b(_.props?.visibility) && (h = be(h, _.props.visibility, o.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, o.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, o.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,37 +4416,37 @@ ${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, o.value, a?.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 lo(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
|
};
|
|
4436
|
-
},
|
|
4437
|
-
const { rows: t, canvasStyles: r, saveToHistoryFn: n, guardEmpty:
|
|
4445
|
+
}, Do = (e) => {
|
|
4446
|
+
const { rows: t, canvasStyles: r, saveToHistoryFn: n, guardEmpty: o } = e, i = e.notify ?? ((v, b = "Import failed") => console.error(`[maildeno-editor] ${b}: ${v}`)), a = (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))),
|
|
@@ -4446,8 +4455,8 @@ ${U}</tr>
|
|
|
4446
4455
|
};
|
|
4447
4456
|
return {
|
|
4448
4457
|
export: (v) => {
|
|
4449
|
-
if (!
|
|
4450
|
-
const b =
|
|
4458
|
+
if (!o("Export")) return;
|
|
4459
|
+
const b = a(v);
|
|
4451
4460
|
Ae({
|
|
4452
4461
|
content: JSON.stringify(b, null, 2),
|
|
4453
4462
|
filename: `${ht(b.template_name)}.json`,
|
|
@@ -4465,23 +4474,23 @@ ${U}</tr>
|
|
|
4465
4474
|
}
|
|
4466
4475
|
}, E.readAsText(v);
|
|
4467
4476
|
},
|
|
4468
|
-
getJSON: (v) => !t.value || t.value.length === 0 ? null :
|
|
4477
|
+
getJSON: (v) => !t.value || t.value.length === 0 ? null : a(v)
|
|
4469
4478
|
};
|
|
4470
|
-
},
|
|
4479
|
+
}, Fo = 5, gn = /font-family\s*:\s*([^;<]+)/gi, Ho = (e) => e.replace(/"/g, '"').replace(/'/g, "'").replace(/'/g, "'"), Uo = (e) => {
|
|
4471
4480
|
if (!e || typeof e != "string") return [];
|
|
4472
4481
|
if (e.indexOf("font-family") === -1) return [];
|
|
4473
|
-
const t =
|
|
4482
|
+
const t = Ho(e), r = [];
|
|
4474
4483
|
let n;
|
|
4475
4484
|
for (gn.lastIndex = 0; (n = gn.exec(t)) !== null; ) {
|
|
4476
|
-
const
|
|
4477
|
-
if (!
|
|
4478
|
-
let i =
|
|
4479
|
-
const
|
|
4480
|
-
if (
|
|
4481
|
-
const c = i.indexOf(
|
|
4482
|
-
if (
|
|
4483
|
-
const v = i.slice(
|
|
4484
|
-
i = v === -1 ? i : i.slice(0,
|
|
4485
|
+
const o = n[1];
|
|
4486
|
+
if (!o) continue;
|
|
4487
|
+
let i = o;
|
|
4488
|
+
const a = i.trimStart()[0];
|
|
4489
|
+
if (a === '"' || a === "'") {
|
|
4490
|
+
const c = i.indexOf(a), p = i.indexOf(a, 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
|
+
}, Jo = (e, t, r, n, o, i, a, l, c, p) => {
|
|
4495
4504
|
let v, b, E, w;
|
|
4496
|
-
typeof r == "object" && !("value" in r) ? (v = r, b = n, E =
|
|
4505
|
+
typeof r == "object" && !("value" in r) ? (v = r, b = n, E = o, w = i) : (v = {
|
|
4497
4506
|
html: r,
|
|
4498
4507
|
react: n,
|
|
4499
|
-
mjml:
|
|
4500
|
-
}, b = i, E =
|
|
4501
|
-
const { evaluateVisibility: R } = ft(), { open: M } =
|
|
4502
|
-
if (!(B >=
|
|
4508
|
+
mjml: o
|
|
4509
|
+
}, b = i, E = a, w = l);
|
|
4510
|
+
const { evaluateVisibility: R } = ft(), { open: M } = p ?? eo(), O = c ?? L({ syntax: "handlebars" }), u = ($, k, A, f, B = 0) => {
|
|
4511
|
+
if (!(B >= Fo))
|
|
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 = Uo(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 = Oo(g), h = zo(g), x = Po(g), y = Do({
|
|
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
|
+
}, Go = 3e3, Me = null, Ue, ot, ae = -1, at = () => ({
|
|
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 ya(e, t) {
|
|
4620
|
+
const r = qo(e, t);
|
|
4612
4621
|
return Ie(Qn, r), r;
|
|
4613
4622
|
}
|
|
4614
|
-
var
|
|
4623
|
+
var Sa = () => {
|
|
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(),
|
|
4621
|
-
|
|
4628
|
+
function qo(e, t) {
|
|
4629
|
+
const r = e ?? hr(), n = vr(), o = L([]), i = L(null), a = L(at()), 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(o, a), z = (T) => f.restoreState(T, o, a, 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(o.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 !==
|
|
4666
|
-
},
|
|
4674
|
+
T !== ae && (ae = T, Ue = l.value ?? void 0, V(o.value, a.value, Me, Ue, ot));
|
|
4675
|
+
}, Go));
|
|
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(
|
|
4683
|
+
const D = Sr(o, 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 = Jo(o, a, P, $e, u, yt, void 0, void 0, k, t);
|
|
4694
4703
|
{
|
|
4695
4704
|
const T = () => {
|
|
4696
|
-
U && (clearTimeout(U), U = null, q(
|
|
4705
|
+
U && (clearTimeout(U), U = null, q(o.value, a.value, Me, Ue, ot), ae = f.version.value);
|
|
4697
4706
|
};
|
|
4698
4707
|
window.addEventListener("beforeunload", T), dr(() => {
|
|
4699
|
-
window.removeEventListener("beforeunload", T), U && (clearTimeout(U), U = null, q(
|
|
4708
|
+
window.removeEventListener("beforeunload", T), U && (clearTimeout(U), U = null, q(o.value, a.value, Me, Ue, ot), ae = f.version.value);
|
|
4700
4709
|
});
|
|
4701
4710
|
}
|
|
4702
4711
|
const Yt = () => {
|
|
4703
|
-
if (
|
|
4704
|
-
return w.value = !0, te(), i.value = null,
|
|
4712
|
+
if (o.value.length > 0)
|
|
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,
|
|
4707
|
-
X = !1, te(), f.initialize(B()),
|
|
4715
|
+
return !T || T.templateId !== null ? (w.value = !0, null) : (w.value = !1, X = !0, o.value = T.rows, a.value = T.canvas, i.value = null, p.value = null, v.value = null, b.value = "properties", ye(() => {
|
|
4716
|
+
X = !1, te(), f.initialize(B()), ae = 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,42 +4730,42 @@ 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,
|
|
4731
|
-
X = !1, te(), f.initialize(B()),
|
|
4739
|
+
T && T.templateId !== null && Q(), X = !0, o.value = [], i.value = null, a.value = at(), Me = null, l.value = null, c.value = [], ye(() => {
|
|
4740
|
+
X = !1, te(), f.initialize(B()), ae = f.version.value, w.value = !0;
|
|
4732
4741
|
});
|
|
4733
4742
|
}, nr = () => {
|
|
4734
|
-
w.value = !1, v.value = null,
|
|
4735
|
-
X = !1, te(), f.initialize(B()),
|
|
4743
|
+
w.value = !1, v.value = null, p.value = null, b.value = "properties", U && (clearTimeout(U), U = null), Q(), X = !0, o.value = [], i.value = null, a.value = at(), Me = null, M.value = null, O.value = "create", l.value = null, c.value = [], ye(() => {
|
|
4744
|
+
X = !1, te(), f.initialize(B()), ae = 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, ot = 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,
|
|
4742
|
-
X = !1, te(), f.initialize(B()),
|
|
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, a.value = G.canvas, o.value = G.rows, i.value = null, p.value = null, v.value = null, b.value = "properties", ye(() => {
|
|
4751
|
+
X = !1, te(), f.initialize(B()), ae = 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,
|
|
4747
|
-
X = !1, te(), f.initialize(B()),
|
|
4755
|
+
G && G.templateId !== j && (console.info(`[EmailBuilder] Clearing stale draft (belongs to ${G.templateId}, current is ${j}).`), Q()), X = !0, a.value = ct(JSON.parse(JSON.stringify(T.canvas))), o.value = ut(JSON.parse(JSON.stringify(T.content?.rows ?? []))), i.value = null, p.value = null, v.value = null, b.value = "properties", ye(() => {
|
|
4756
|
+
X = !1, te(), f.initialize(B()), ae = f.version.value, w.value = !0, J?.();
|
|
4748
4757
|
});
|
|
4749
4758
|
}, St = (T, j = "restore-version") => {
|
|
4750
|
-
U && (clearTimeout(U), U = null), X = !0,
|
|
4759
|
+
U && (clearTimeout(U), U = null), X = !0, a.value = ct(JSON.parse(JSON.stringify(T.canvas))), o.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 = () => {
|
|
4754
4763
|
f.undo(z) && (te(), ke());
|
|
4755
|
-
}, ar = () => {
|
|
4756
|
-
f.redo(z) && (te(), ke());
|
|
4757
4764
|
}, or = () => {
|
|
4758
|
-
|
|
4759
|
-
|
|
4765
|
+
f.redo(z) && (te(), ke());
|
|
4766
|
+
}, ar = () => {
|
|
4767
|
+
o.value = [], i.value = null, p.value = null, v.value = null, b.value = "properties", a.value = at(), ye(() => {
|
|
4768
|
+
te(), f.initialize(B()), ae = f.version.value;
|
|
4760
4769
|
});
|
|
4761
4770
|
}, ir = () => {
|
|
4762
4771
|
n.require({
|
|
@@ -4766,7 +4775,7 @@ function Ja(e, t) {
|
|
|
4766
4775
|
rejectLabel: "Cancel",
|
|
4767
4776
|
acceptClass: "!bg-red-600 !hover:bg-red-700 !border-red-600 !px-6 !py-2",
|
|
4768
4777
|
rejectClass: "!bg-gray-200 !hover:bg-gray-300 !text-gray-800 !border-gray-200 !px-6 !py-2",
|
|
4769
|
-
accept: () =>
|
|
4778
|
+
accept: () => ar(),
|
|
4770
4779
|
reject: () => {
|
|
4771
4780
|
}
|
|
4772
4781
|
});
|
|
@@ -4777,7 +4786,7 @@ function Ja(e, t) {
|
|
|
4777
4786
|
};
|
|
4778
4787
|
if (j.history === "reset") {
|
|
4779
4788
|
St(G, "set-json"), ye(() => {
|
|
4780
|
-
f.initialize(B()),
|
|
4789
|
+
f.initialize(B()), ae = f.version.value;
|
|
4781
4790
|
});
|
|
4782
4791
|
return;
|
|
4783
4792
|
}
|
|
@@ -4792,17 +4801,17 @@ function Ja(e, t) {
|
|
|
4792
4801
|
};
|
|
4793
4802
|
}, cr = (T) => T !== null && !D.findComponent(T) ? !1 : (i.value = T, !0), ur = (T) => hn(() => f.version.value, () => T());
|
|
4794
4803
|
return {
|
|
4795
|
-
rows:
|
|
4796
|
-
canvasStyles:
|
|
4804
|
+
rows: o,
|
|
4805
|
+
canvasStyles: a,
|
|
4797
4806
|
templateTags: c,
|
|
4798
4807
|
savedTemplateName: l,
|
|
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,
|
|
@@ -4848,7 +4857,7 @@ function Ja(e, t) {
|
|
|
4848
4857
|
importJSON: (T) => ne.importJSON(T, i),
|
|
4849
4858
|
clearTemplate: ir,
|
|
4850
4859
|
undo: rr,
|
|
4851
|
-
redo:
|
|
4860
|
+
redo: or,
|
|
4852
4861
|
canUndo: f.canUndo,
|
|
4853
4862
|
canRedo: f.canRedo,
|
|
4854
4863
|
historyStatus: f.historyStatus,
|
|
@@ -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
|
-
|
|
4901
|
-
|
|
4902
|
-
|
|
4903
|
-
|
|
4887
|
+
Jr as A,
|
|
4888
|
+
Ko as B,
|
|
4889
|
+
la as C,
|
|
4890
|
+
ia as D,
|
|
4891
|
+
eo as E,
|
|
4892
|
+
ea as F,
|
|
4893
|
+
hr as G,
|
|
4894
|
+
Xo as H,
|
|
4895
|
+
dt as I,
|
|
4896
|
+
$n as K,
|
|
4897
|
+
Rt as L,
|
|
4898
|
+
An as M,
|
|
4899
|
+
oa as N,
|
|
4900
|
+
Ut as O,
|
|
4901
|
+
ra as P,
|
|
4902
|
+
ta as R,
|
|
4903
|
+
pa as S,
|
|
4904
|
+
sa as T,
|
|
4905
|
+
Yo as U,
|
|
4906
|
+
Qo as V,
|
|
4907
|
+
Zo as W,
|
|
4908
|
+
Je as _,
|
|
4909
|
+
ba as a,
|
|
4910
|
+
ca as b,
|
|
4911
|
+
va as c,
|
|
4912
|
+
ga as d,
|
|
4904
4913
|
pn as f,
|
|
4905
|
-
|
|
4906
|
-
|
|
4907
|
-
|
|
4908
|
-
|
|
4909
|
-
|
|
4910
|
-
|
|
4911
|
-
|
|
4912
|
-
|
|
4913
|
-
|
|
4914
|
-
|
|
4914
|
+
no as g,
|
|
4915
|
+
ro as h,
|
|
4916
|
+
ko as i,
|
|
4917
|
+
Tn as j,
|
|
4918
|
+
aa as k,
|
|
4919
|
+
ha as l,
|
|
4920
|
+
ma as m,
|
|
4921
|
+
Sa as n,
|
|
4922
|
+
$a as o,
|
|
4923
|
+
uo as p,
|
|
4924
|
+
K as q,
|
|
4915
4925
|
Kt as r,
|
|
4916
|
-
|
|
4917
|
-
|
|
4918
|
-
|
|
4919
|
-
|
|
4920
|
-
|
|
4921
|
-
|
|
4922
|
-
|
|
4923
|
-
|
|
4926
|
+
So as s,
|
|
4927
|
+
ya as t,
|
|
4928
|
+
fa as u,
|
|
4929
|
+
gt as v,
|
|
4930
|
+
ft as w,
|
|
4931
|
+
ua as x,
|
|
4932
|
+
da as y,
|
|
4933
|
+
vr as z
|
|
4924
4934
|
};
|