@maildeno/editor 0.4.6 → 0.4.7
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/CHANGELOG.md +42 -0
- package/dist/DatePicker-DIaGGAVI.js +5347 -0
- package/dist/DatePicker-DmMga5gQ.js +5347 -0
- package/dist/Dialog-GTfGtduh.js +6294 -0
- package/dist/HealthIndicator--ScSxVRA.js +1216 -0
- package/dist/HealthIndicator-BraAh2Aj.js +1217 -0
- package/dist/Icon-BYmOM482.js +2537 -0
- package/dist/Icon-c2SPT3-6.js +2577 -0
- package/dist/PreviewCanvas-C1-rP9-B.js +533 -0
- package/dist/PreviewCanvas-Nro7tNCn.js +533 -0
- package/dist/RichTextEditor-CrYhiAOo.js +12217 -0
- package/dist/RichTextEditor-D7Itx0fL.js +12218 -0
- package/dist/RowPreviewChildren-B66HbFdX.js +4 -0
- package/dist/RowPreviewChildren-DvrE9HTT.js +4 -0
- package/dist/RowPreviewLegacyComponent-3QuwvWmT.js +402 -0
- package/dist/RowPreviewLegacyComponent-CPqaWwsE.js +402 -0
- package/dist/RowPreviewRow-B91YPfoz.js +80 -0
- package/dist/RowPreviewRow-MaA-9ApX.js +80 -0
- package/dist/SavedRowsPanel-CF-7R3q_.js +492 -0
- package/dist/SavedRowsPanel-TLOEvs3Z.js +491 -0
- package/dist/_plugin-vue_export-helper-Dj7HTbfw.js +8 -0
- package/dist/babel-DV7WPQI0.js +10043 -0
- package/dist/components/features/emailBuilder/EmailEditor.vue.d.ts +3 -3
- package/dist/composables/emailBuilder/transform/pipeline/optimize.d.ts +4 -4
- package/dist/editor.css +2 -1
- package/dist/element-CeRQDEn3.js +21396 -0
- package/dist/element.js +2 -2
- package/dist/estree-DY9POgc0.js +8195 -0
- package/dist/html-wb0gSX1o.js +7273 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +14886 -14
- package/dist/init.js +83 -94
- package/dist/mergeTagDefinitions-Cler19nv.js +27 -0
- package/dist/standalone-DHvJ30Td.js +3554 -0
- package/dist/useEmailBuilder-CjJoxzTi.js +4893 -0
- package/dist/useEmailBuilder-gOc8otd8.js +4893 -0
- package/dist/useToast-DeNMwkP3.js +194 -0
- package/dist/vue.runtime.esm-bundler-D2AjRP90.js +6117 -0
- package/package.json +3 -1
- package/dist/DatePicker-6dMK-shv.js +0 -5639
- package/dist/DatePicker-CEm1DPgG.js +0 -5640
- package/dist/HealthIndicator-Ch5Ck0BL.js +0 -1954
- package/dist/HealthIndicator-Dr5vMr1T.js +0 -1953
- package/dist/PreviewCanvas-CG52GC5m.js +0 -667
- package/dist/PreviewCanvas-CjOrVIGt.js +0 -668
- package/dist/RichTextEditor-DaaHuVox.js +0 -13487
- package/dist/RichTextEditor-DoWpYF0R.js +0 -13432
- package/dist/RowPreviewChildren-DQoyExvw.js +0 -4
- package/dist/RowPreviewChildren-yl3aB7hb.js +0 -4
- package/dist/RowPreviewLegacyComponent-CHxbwy9l.js +0 -454
- package/dist/RowPreviewLegacyComponent-Dv7OCys4.js +0 -454
- package/dist/RowPreviewRow-Bizr4PTf.js +0 -86
- package/dist/RowPreviewRow-CLhz0YQ5.js +0 -86
- package/dist/SavedRowsPanel-C0DkAzHi.js +0 -611
- package/dist/SavedRowsPanel-Cp3gADrK.js +0 -610
- package/dist/babel-Bmz1GpKj.js +0 -7218
- package/dist/element-CRfWpZos.js +0 -40842
- package/dist/estree-C5xyFN_T.js +0 -4831
- package/dist/html-Dc_r73Xn.js +0 -3062
- package/dist/index-BlYp4vAp.js +0 -34092
- package/dist/standalone-Yv8gSIWN.js +0 -2336
package/dist/init.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import { O as o, at as c, i as u, st as g } from "./vue.runtime.esm-bundler-D2AjRP90.js";
|
|
2
|
+
import { G as f, a as w, i as H, n as v, r as S } from "./element-CeRQDEn3.js";
|
|
3
|
+
import { E as b, T as A, U as C, c as J, l as M, m as I, p as R, w as j } from "./useEmailBuilder-gOc8otd8.js";
|
|
4
|
+
var m = !1;
|
|
5
|
+
function h() {
|
|
6
|
+
if (!(m || typeof document > "u")) {
|
|
7
|
+
m = !0;
|
|
7
8
|
for (const e of f()) {
|
|
8
9
|
if (!e) continue;
|
|
9
10
|
const l = document.createElement("style");
|
|
@@ -11,40 +12,35 @@ function p() {
|
|
|
11
12
|
}
|
|
12
13
|
}
|
|
13
14
|
}
|
|
14
|
-
function
|
|
15
|
-
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
setProp: (t, s) => {
|
|
31
|
-
a[t] = s;
|
|
15
|
+
function E(e, l) {
|
|
16
|
+
h();
|
|
17
|
+
const t = c({ ...l }), i = /* @__PURE__ */ new Set(), a = g(null), r = document.createElement("div");
|
|
18
|
+
r.style.height = "100%", e.appendChild(r);
|
|
19
|
+
const n = u({ setup() {
|
|
20
|
+
return () => o(S, {
|
|
21
|
+
...t,
|
|
22
|
+
ref: a,
|
|
23
|
+
onSave: (s) => i.forEach((d) => d(s))
|
|
24
|
+
});
|
|
25
|
+
} });
|
|
26
|
+
return n.mount(r), {
|
|
27
|
+
element: r,
|
|
28
|
+
exposed: () => a.value ?? null,
|
|
29
|
+
setProp: (s, d) => {
|
|
30
|
+
t[s] = d;
|
|
32
31
|
},
|
|
33
|
-
addSaveHandler: (
|
|
34
|
-
removeSaveHandler: (
|
|
32
|
+
addSaveHandler: (s) => i.add(s),
|
|
33
|
+
removeSaveHandler: (s) => i.delete(s),
|
|
35
34
|
destroy: () => {
|
|
36
|
-
|
|
35
|
+
n.unmount(), r.remove();
|
|
37
36
|
}
|
|
38
37
|
};
|
|
39
38
|
}
|
|
40
|
-
async function
|
|
39
|
+
async function N(e) {
|
|
41
40
|
const l = typeof e.container == "string" ? document.querySelector(e.container) : e.container;
|
|
42
|
-
if (!l)
|
|
43
|
-
throw new Error(
|
|
44
|
-
`[maildeno-editor] init() couldn't find a container${typeof e.container == "string" ? ` matching "${e.container}"` : ""}.`
|
|
45
|
-
);
|
|
41
|
+
if (!l) throw new Error(`[maildeno-editor] init() couldn't find a container${typeof e.container == "string" ? ` matching "${e.container}"` : ""}.`);
|
|
46
42
|
if (e.shadowDom === !1) {
|
|
47
|
-
const
|
|
43
|
+
const a = E(l, {
|
|
48
44
|
templateId: e.templateId,
|
|
49
45
|
storageAdapter: e.storageAdapter,
|
|
50
46
|
theme: e.theme,
|
|
@@ -55,94 +51,87 @@ async function H(e) {
|
|
|
55
51
|
saveHandler: e.onSave,
|
|
56
52
|
assistant: e.assistant
|
|
57
53
|
});
|
|
58
|
-
await new Promise((
|
|
59
|
-
const r = (
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
return typeof o == "function" ? o(...s) : null;
|
|
54
|
+
await new Promise((n) => setTimeout(n, 0));
|
|
55
|
+
const r = (n, ...s) => {
|
|
56
|
+
const d = a.exposed()?.[n];
|
|
57
|
+
return typeof d == "function" ? d(...s) : null;
|
|
63
58
|
};
|
|
64
59
|
return {
|
|
65
|
-
element:
|
|
66
|
-
on: (
|
|
67
|
-
off: (
|
|
68
|
-
setTheme: (
|
|
69
|
-
getHtml: (
|
|
70
|
-
getMjml: (
|
|
71
|
-
getReactEmail: (
|
|
60
|
+
element: a.element,
|
|
61
|
+
on: (n, s) => a.addSaveHandler(s),
|
|
62
|
+
off: (n, s) => a.removeSaveHandler(s),
|
|
63
|
+
setTheme: (n) => a.setProp("theme", n),
|
|
64
|
+
getHtml: (n = "prune") => r("getHtml", n),
|
|
65
|
+
getMjml: (n = "prune") => r("getMjml", n),
|
|
66
|
+
getReactEmail: (n = "prune") => r("getReactEmail", n),
|
|
72
67
|
getJson: () => r("getJson"),
|
|
73
|
-
setJson: (
|
|
74
|
-
r("setJson",
|
|
68
|
+
setJson: (n, s) => {
|
|
69
|
+
r("setJson", n, s);
|
|
75
70
|
},
|
|
76
71
|
getSelection: () => r("getSelection"),
|
|
77
|
-
setSelection: (
|
|
78
|
-
|
|
79
|
-
// always call the result — a host storing it and invoking it during
|
|
80
|
-
// teardown shouldn't have to null-check a cleanup function.
|
|
81
|
-
onChange: (t) => r("onChange", t) ?? (() => {
|
|
72
|
+
setSelection: (n) => r("setSelection", n) ?? !1,
|
|
73
|
+
onChange: (n) => r("onChange", n) ?? (() => {
|
|
82
74
|
}),
|
|
83
|
-
destroy: () =>
|
|
75
|
+
destroy: () => a.destroy()
|
|
84
76
|
};
|
|
85
77
|
}
|
|
86
|
-
|
|
87
|
-
const
|
|
88
|
-
e.templateId !== void 0 && (
|
|
78
|
+
v();
|
|
79
|
+
const t = document.createElement("maildeno-editor");
|
|
80
|
+
e.templateId !== void 0 && (t.templateId = e.templateId), e.storageAdapter && (t.storageAdapter = e.storageAdapter), e.theme && (t.theme = e.theme), e.capabilities && (t.capabilities = e.capabilities), e.onSendTestEmail && (t.onSendTestEmail = e.onSendTestEmail), e.brandName !== void 0 && (t.brandName = e.brandName), e.versions !== void 0 && (t.versions = e.versions), e.assistant && (t.assistant = e.assistant), e.onSave && (t.saveHandler = e.onSave), l.appendChild(t), await new Promise((a) => setTimeout(a, 0));
|
|
89
81
|
const i = /* @__PURE__ */ new WeakMap();
|
|
90
82
|
return {
|
|
91
|
-
element:
|
|
92
|
-
on(
|
|
93
|
-
const
|
|
94
|
-
|
|
95
|
-
));
|
|
96
|
-
i.set(r, t), a.addEventListener(n, t);
|
|
83
|
+
element: t,
|
|
84
|
+
on(a, r) {
|
|
85
|
+
const n = ((s) => r(Array.isArray(s.detail) ? s.detail[0] : s.detail));
|
|
86
|
+
i.set(r, n), t.addEventListener(a, n);
|
|
97
87
|
},
|
|
98
|
-
off(
|
|
99
|
-
const
|
|
100
|
-
|
|
88
|
+
off(a, r) {
|
|
89
|
+
const n = i.get(r);
|
|
90
|
+
n && (t.removeEventListener(a, n), i.delete(r));
|
|
101
91
|
},
|
|
102
|
-
setTheme(
|
|
103
|
-
|
|
92
|
+
setTheme(a) {
|
|
93
|
+
t.theme = a;
|
|
104
94
|
},
|
|
105
|
-
getHtml(
|
|
106
|
-
return
|
|
95
|
+
getHtml(a = "prune") {
|
|
96
|
+
return t.getHtml ? t.getHtml(a) : null;
|
|
107
97
|
},
|
|
108
|
-
getMjml(
|
|
109
|
-
return
|
|
98
|
+
getMjml(a = "prune") {
|
|
99
|
+
return t.getMjml ? t.getMjml(a) : null;
|
|
110
100
|
},
|
|
111
|
-
getReactEmail(
|
|
112
|
-
return
|
|
101
|
+
getReactEmail(a = "prune") {
|
|
102
|
+
return t.getReactEmail ? t.getReactEmail(a) : null;
|
|
113
103
|
},
|
|
114
104
|
getJson() {
|
|
115
|
-
return
|
|
105
|
+
return t.getJson ? t.getJson() : null;
|
|
116
106
|
},
|
|
117
|
-
setJson(
|
|
118
|
-
|
|
119
|
-
(t = a.setJson) == null || t.call(a, n, r);
|
|
107
|
+
setJson(a, r) {
|
|
108
|
+
t.setJson?.(a, r);
|
|
120
109
|
},
|
|
121
110
|
getSelection() {
|
|
122
|
-
return
|
|
111
|
+
return t.getSelection ? t.getSelection() : null;
|
|
123
112
|
},
|
|
124
|
-
setSelection(
|
|
125
|
-
return
|
|
113
|
+
setSelection(a) {
|
|
114
|
+
return t.setSelection ? t.setSelection(a) : !1;
|
|
126
115
|
},
|
|
127
|
-
onChange(
|
|
128
|
-
return
|
|
116
|
+
onChange(a) {
|
|
117
|
+
return t.onChange ? t.onChange(a) : () => {
|
|
129
118
|
};
|
|
130
119
|
},
|
|
131
120
|
destroy() {
|
|
132
|
-
|
|
121
|
+
t.remove();
|
|
133
122
|
}
|
|
134
123
|
};
|
|
135
124
|
}
|
|
136
125
|
export {
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
126
|
+
C as createLocalStorageAdapter,
|
|
127
|
+
j as getAllBlocks,
|
|
128
|
+
A as getBlock,
|
|
129
|
+
J as getRegisteredCustomESPs,
|
|
130
|
+
R as getRegisteredMergeTagIds,
|
|
131
|
+
N as init,
|
|
132
|
+
H as palette,
|
|
133
|
+
b as registerBlock,
|
|
134
|
+
M as registerESPSyntax,
|
|
135
|
+
I as registerMergeTags,
|
|
136
|
+
w as setEditorTheme
|
|
148
137
|
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
var r = /\{\{\s*(?:'([^']*)'|"([^"]*)"|(\w+))(?:\s*\|\s*(?:'([^']*)'|"([^"]*)"|([^'"\}\s][^'"\}]*?)))?\s*\}\}/g, c = (e) => ({
|
|
2
|
+
name: (e[1] ?? e[2] ?? e[3] ?? "").trim(),
|
|
3
|
+
fallback: (e[4] ?? e[5] ?? e[6] ?? "").trim()
|
|
4
|
+
}), o = (e) => {
|
|
5
|
+
const a = /* @__PURE__ */ new Set();
|
|
6
|
+
r.lastIndex = 0;
|
|
7
|
+
let t;
|
|
8
|
+
for (; (t = r.exec(e)) !== null; ) a.add(c(t).name);
|
|
9
|
+
return [...a];
|
|
10
|
+
}, d = (e) => {
|
|
11
|
+
const a = /* @__PURE__ */ new Map();
|
|
12
|
+
r.lastIndex = 0;
|
|
13
|
+
let t;
|
|
14
|
+
for (; (t = r.exec(e)) !== null; ) {
|
|
15
|
+
const { name: n, fallback: s } = c(t);
|
|
16
|
+
a.has(n) || a.set(n, s);
|
|
17
|
+
}
|
|
18
|
+
return a;
|
|
19
|
+
}, v = (e, a, t) => !t || !e ? e ?? "" : (r.lastIndex = 0, e.replace(r, (n, ...s) => {
|
|
20
|
+
const i = [n, ...s], { name: u, fallback: f } = c(i), l = a[u];
|
|
21
|
+
return l !== void 0 && l !== "" ? l : f || `{{ ${u} }}`;
|
|
22
|
+
}));
|
|
23
|
+
export {
|
|
24
|
+
d as n,
|
|
25
|
+
v as r,
|
|
26
|
+
o as t
|
|
27
|
+
};
|