@maildeno/editor 0.4.4 → 0.4.5
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 +23 -0
- package/dist/RowPreviewLegacyComponent-3QuwvWmT.js +402 -0
- package/dist/RowPreviewLegacyComponent-DVxrCJ14.js +402 -0
- package/dist/RowPreviewRow-0pEQLmS4.js +80 -0
- package/dist/RowPreviewRow-Eum1wh1W.js +80 -0
- package/dist/babel-DV7WPQI0.js +10043 -0
- package/dist/editor.css +2 -1
- package/dist/element-Dq6bmt2l.js +48454 -0
- package/dist/element.js +2 -2
- package/dist/estree-DY9POgc0.js +8195 -0
- package/dist/html-wb0gSX1o.js +7273 -0
- package/dist/index.js +48471 -14
- package/dist/init.js +82 -94
- package/dist/standalone-DHvJ30Td.js +3554 -0
- package/dist/vue.runtime.esm-bundler-CsdyQceJ.js +6118 -0
- package/package.json +6 -8
- package/dist/RowPreviewChildren-C_6CFAct.js +0 -4
- package/dist/RowPreviewChildren-y7meU9Pj.js +0 -4
- package/dist/RowPreviewLegacyComponent-B1rwsYW_.js +0 -454
- package/dist/RowPreviewLegacyComponent-Dv7OCys4.js +0 -454
- package/dist/RowPreviewRow-BjO2HdFR.js +0 -86
- package/dist/RowPreviewRow-D8yJ4LSs.js +0 -86
- package/dist/babel-Bmz1GpKj.js +0 -7218
- package/dist/element-DyFj9kgl.js +0 -62972
- package/dist/estree-C5xyFN_T.js +0 -4831
- package/dist/html-Dc_r73Xn.js +0 -3062
- package/dist/index-Cud9IN-O.js +0 -56306
- package/dist/standalone-Yv8gSIWN.js +0 -2336
package/dist/init.js
CHANGED
|
@@ -1,50 +1,45 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
function
|
|
5
|
-
if (!(
|
|
6
|
-
|
|
7
|
-
for (const e of
|
|
1
|
+
import { O as o, at as c, i as u, st as g } from "./vue.runtime.esm-bundler-CsdyQceJ.js";
|
|
2
|
+
import { a as H, c as b, d as w, f as T, h as A, i as C, l as J, m as M, n as f, p as I, r as v, s as S, u as R } from "./element-Dq6bmt2l.js";
|
|
3
|
+
var m = !1;
|
|
4
|
+
function h() {
|
|
5
|
+
if (!(m || typeof document > "u")) {
|
|
6
|
+
m = !0;
|
|
7
|
+
for (const e of S()) {
|
|
8
8
|
if (!e) continue;
|
|
9
9
|
const l = document.createElement("style");
|
|
10
10
|
l.setAttribute("data-maildeno-light-dom", ""), l.textContent = e, document.head.appendChild(l);
|
|
11
11
|
}
|
|
12
12
|
}
|
|
13
13
|
}
|
|
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;
|
|
14
|
+
function E(e, l) {
|
|
15
|
+
h();
|
|
16
|
+
const t = c({ ...l }), i = /* @__PURE__ */ new Set(), a = g(null), r = document.createElement("div");
|
|
17
|
+
r.style.height = "100%", e.appendChild(r);
|
|
18
|
+
const n = u({ setup() {
|
|
19
|
+
return () => o(v, {
|
|
20
|
+
...t,
|
|
21
|
+
ref: a,
|
|
22
|
+
onSave: (s) => i.forEach((d) => d(s))
|
|
23
|
+
});
|
|
24
|
+
} });
|
|
25
|
+
return n.mount(r), {
|
|
26
|
+
element: r,
|
|
27
|
+
exposed: () => a.value ?? null,
|
|
28
|
+
setProp: (s, d) => {
|
|
29
|
+
t[s] = d;
|
|
32
30
|
},
|
|
33
|
-
addSaveHandler: (
|
|
34
|
-
removeSaveHandler: (
|
|
31
|
+
addSaveHandler: (s) => i.add(s),
|
|
32
|
+
removeSaveHandler: (s) => i.delete(s),
|
|
35
33
|
destroy: () => {
|
|
36
|
-
|
|
34
|
+
n.unmount(), r.remove();
|
|
37
35
|
}
|
|
38
36
|
};
|
|
39
37
|
}
|
|
40
|
-
async function
|
|
38
|
+
async function j(e) {
|
|
41
39
|
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
|
-
);
|
|
40
|
+
if (!l) throw new Error(`[maildeno-editor] init() couldn't find a container${typeof e.container == "string" ? ` matching "${e.container}"` : ""}.`);
|
|
46
41
|
if (e.shadowDom === !1) {
|
|
47
|
-
const
|
|
42
|
+
const a = E(l, {
|
|
48
43
|
templateId: e.templateId,
|
|
49
44
|
storageAdapter: e.storageAdapter,
|
|
50
45
|
theme: e.theme,
|
|
@@ -55,94 +50,87 @@ async function H(e) {
|
|
|
55
50
|
saveHandler: e.onSave,
|
|
56
51
|
assistant: e.assistant
|
|
57
52
|
});
|
|
58
|
-
await new Promise((
|
|
59
|
-
const r = (
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
return typeof o == "function" ? o(...s) : null;
|
|
53
|
+
await new Promise((n) => setTimeout(n, 0));
|
|
54
|
+
const r = (n, ...s) => {
|
|
55
|
+
const d = a.exposed()?.[n];
|
|
56
|
+
return typeof d == "function" ? d(...s) : null;
|
|
63
57
|
};
|
|
64
58
|
return {
|
|
65
|
-
element:
|
|
66
|
-
on: (
|
|
67
|
-
off: (
|
|
68
|
-
setTheme: (
|
|
69
|
-
getHtml: (
|
|
70
|
-
getMjml: (
|
|
71
|
-
getReactEmail: (
|
|
59
|
+
element: a.element,
|
|
60
|
+
on: (n, s) => a.addSaveHandler(s),
|
|
61
|
+
off: (n, s) => a.removeSaveHandler(s),
|
|
62
|
+
setTheme: (n) => a.setProp("theme", n),
|
|
63
|
+
getHtml: (n = "prune") => r("getHtml", n),
|
|
64
|
+
getMjml: (n = "prune") => r("getMjml", n),
|
|
65
|
+
getReactEmail: (n = "prune") => r("getReactEmail", n),
|
|
72
66
|
getJson: () => r("getJson"),
|
|
73
|
-
setJson: (
|
|
74
|
-
r("setJson",
|
|
67
|
+
setJson: (n, s) => {
|
|
68
|
+
r("setJson", n, s);
|
|
75
69
|
},
|
|
76
70
|
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) ?? (() => {
|
|
71
|
+
setSelection: (n) => r("setSelection", n) ?? !1,
|
|
72
|
+
onChange: (n) => r("onChange", n) ?? (() => {
|
|
82
73
|
}),
|
|
83
|
-
destroy: () =>
|
|
74
|
+
destroy: () => a.destroy()
|
|
84
75
|
};
|
|
85
76
|
}
|
|
86
|
-
|
|
87
|
-
const
|
|
88
|
-
e.templateId !== void 0 && (
|
|
77
|
+
f();
|
|
78
|
+
const t = document.createElement("maildeno-editor");
|
|
79
|
+
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
80
|
const i = /* @__PURE__ */ new WeakMap();
|
|
90
81
|
return {
|
|
91
|
-
element:
|
|
92
|
-
on(
|
|
93
|
-
const
|
|
94
|
-
|
|
95
|
-
));
|
|
96
|
-
i.set(r, t), a.addEventListener(n, t);
|
|
82
|
+
element: t,
|
|
83
|
+
on(a, r) {
|
|
84
|
+
const n = ((s) => r(Array.isArray(s.detail) ? s.detail[0] : s.detail));
|
|
85
|
+
i.set(r, n), t.addEventListener(a, n);
|
|
97
86
|
},
|
|
98
|
-
off(
|
|
99
|
-
const
|
|
100
|
-
|
|
87
|
+
off(a, r) {
|
|
88
|
+
const n = i.get(r);
|
|
89
|
+
n && (t.removeEventListener(a, n), i.delete(r));
|
|
101
90
|
},
|
|
102
|
-
setTheme(
|
|
103
|
-
|
|
91
|
+
setTheme(a) {
|
|
92
|
+
t.theme = a;
|
|
104
93
|
},
|
|
105
|
-
getHtml(
|
|
106
|
-
return
|
|
94
|
+
getHtml(a = "prune") {
|
|
95
|
+
return t.getHtml ? t.getHtml(a) : null;
|
|
107
96
|
},
|
|
108
|
-
getMjml(
|
|
109
|
-
return
|
|
97
|
+
getMjml(a = "prune") {
|
|
98
|
+
return t.getMjml ? t.getMjml(a) : null;
|
|
110
99
|
},
|
|
111
|
-
getReactEmail(
|
|
112
|
-
return
|
|
100
|
+
getReactEmail(a = "prune") {
|
|
101
|
+
return t.getReactEmail ? t.getReactEmail(a) : null;
|
|
113
102
|
},
|
|
114
103
|
getJson() {
|
|
115
|
-
return
|
|
104
|
+
return t.getJson ? t.getJson() : null;
|
|
116
105
|
},
|
|
117
|
-
setJson(
|
|
118
|
-
|
|
119
|
-
(t = a.setJson) == null || t.call(a, n, r);
|
|
106
|
+
setJson(a, r) {
|
|
107
|
+
t.setJson?.(a, r);
|
|
120
108
|
},
|
|
121
109
|
getSelection() {
|
|
122
|
-
return
|
|
110
|
+
return t.getSelection ? t.getSelection() : null;
|
|
123
111
|
},
|
|
124
|
-
setSelection(
|
|
125
|
-
return
|
|
112
|
+
setSelection(a) {
|
|
113
|
+
return t.setSelection ? t.setSelection(a) : !1;
|
|
126
114
|
},
|
|
127
|
-
onChange(
|
|
128
|
-
return
|
|
115
|
+
onChange(a) {
|
|
116
|
+
return t.onChange ? t.onChange(a) : () => {
|
|
129
117
|
};
|
|
130
118
|
},
|
|
131
119
|
destroy() {
|
|
132
|
-
|
|
120
|
+
t.remove();
|
|
133
121
|
}
|
|
134
122
|
};
|
|
135
123
|
}
|
|
136
124
|
export {
|
|
137
125
|
A as createLocalStorageAdapter,
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
126
|
+
T as getAllBlocks,
|
|
127
|
+
I as getBlock,
|
|
128
|
+
b as getRegisteredCustomESPs,
|
|
129
|
+
R as getRegisteredMergeTagIds,
|
|
130
|
+
j as init,
|
|
131
|
+
C as palette,
|
|
132
|
+
M as registerBlock,
|
|
133
|
+
J as registerESPSyntax,
|
|
134
|
+
w as registerMergeTags,
|
|
135
|
+
H as setEditorTheme
|
|
148
136
|
};
|