@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.
Files changed (25) hide show
  1. package/README.md +1 -0
  2. package/dist/{HealthIndicator-4Iw6N-g_.js → HealthIndicator-BLID6Ty0.js} +2 -2
  3. package/dist/{HealthIndicator-ZohgzF2_.js → HealthIndicator-DfzqzPNw.js} +1 -1
  4. package/dist/{PreviewCanvas-QN4C68KA.js → PreviewCanvas-D3SpILsV.js} +3 -3
  5. package/dist/{PreviewCanvas-DzpLghCo.js → PreviewCanvas-PtW1UL1J.js} +3 -3
  6. package/dist/{RichTextEditor-CmM4XRFC.js → RichTextEditor-D6DQqbJg.js} +2 -2
  7. package/dist/{RichTextEditor-Cz1-_ZtA.js → RichTextEditor-DDEfKPZm.js} +3 -3
  8. package/dist/RowPreviewChildren-BGnilx-K.js +4 -0
  9. package/dist/RowPreviewChildren-CalQWx1C.js +4 -0
  10. package/dist/{RowPreviewRow-DPaSbxmB.js → RowPreviewRow-C2XAe5Xs.js} +1 -1
  11. package/dist/{RowPreviewRow-Dx4ExtSN.js → RowPreviewRow-DG4AdMrv.js} +1 -1
  12. package/dist/{SavedRowsPanel-DqSHB6Jk.js → SavedRowsPanel-2JBfYdxN.js} +37 -37
  13. package/dist/{SavedRowsPanel-DyXjSOEt.js → SavedRowsPanel-B6_VHQZm.js} +33 -33
  14. package/dist/components/features/emailBuilder/EmailEditor.vue.d.ts +1 -0
  15. package/dist/{element-B3gq8Xvd.js → element-DQw3HLit.js} +4689 -4649
  16. package/dist/element.js +1 -1
  17. package/dist/index.js +4213 -4173
  18. package/dist/init.d.ts +2 -0
  19. package/dist/init.js +31 -25
  20. package/dist/{useEmailBuilder-BR4wfai1.js → useEmailBuilder-2yCUzRx2.js} +470 -460
  21. package/dist/{useEmailBuilder-B19p-2yp.js → useEmailBuilder-D3uV7dwL.js} +833 -823
  22. package/dist/{useToast-DD11IxqP.js → useToast-D1GgDMqQ.js} +7 -7
  23. package/package.json +1 -1
  24. package/dist/RowPreviewChildren-BYaMZID3.js +0 -4
  25. package/dist/RowPreviewChildren-_A9gPQCs.js +0 -4
package/dist/init.d.ts CHANGED
@@ -127,6 +127,8 @@ export interface EditorHandle {
127
127
  * mechanism that applies it on initial mount. Calling this again after
128
128
  * mount is the actual "live" part, not just initial configuration. */
129
129
  setTheme(theme: ThemeOptions): void;
130
+ /** Updates the name used by the header, saves and exports. Empty clears it. */
131
+ setTemplateName(name: string): void;
130
132
  /** These four call EmailEditor.vue's defineExpose'd methods, which Vue's
131
133
  * own defineCustomElement implementation forwards directly onto the
132
134
  * custom element instance (confirmed: _instance.exposed is read and
package/dist/init.js CHANGED
@@ -1,10 +1,10 @@
1
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 H, i as b, n as v, r as S } from "./element-B3gq8Xvd.js";
3
- import { D as T, E as A, G as C, O as J, c as M, l as I, m as R, p as j } from "./useEmailBuilder-BR4wfai1.js";
4
- var m = !1;
5
- function h() {
6
- if (!(m || typeof document > "u")) {
7
- m = !0;
2
+ import { G as f, a as T, i as H, n as v, r as S } from "./element-DQw3HLit.js";
3
+ import { D as w, K as A, O as C, c as N, k as J, l as M, m as I, p as R } from "./useEmailBuilder-2yCUzRx2.js";
4
+ var d = !1;
5
+ function p() {
6
+ if (!(d || typeof document > "u")) {
7
+ d = !0;
8
8
  for (const e of f()) {
9
9
  if (!e) continue;
10
10
  const l = document.createElement("style");
@@ -12,22 +12,22 @@ function h() {
12
12
  }
13
13
  }
14
14
  }
15
- function E(e, l) {
16
- h();
15
+ function h(e, l) {
16
+ p();
17
17
  const t = c({ ...l }), i = /* @__PURE__ */ new Set(), a = g(null), r = document.createElement("div");
18
18
  r.style.height = "100%", e.appendChild(r);
19
19
  const n = u({ setup() {
20
20
  return () => o(S, {
21
21
  ...t,
22
22
  ref: a,
23
- onSave: (s) => i.forEach((d) => d(s))
23
+ onSave: (s) => i.forEach((m) => m(s))
24
24
  });
25
25
  } });
26
26
  return n.mount(r), {
27
27
  element: r,
28
28
  exposed: () => a.value ?? null,
29
- setProp: (s, d) => {
30
- t[s] = d;
29
+ setProp: (s, m) => {
30
+ t[s] = m;
31
31
  },
32
32
  addSaveHandler: (s) => i.add(s),
33
33
  removeSaveHandler: (s) => i.delete(s),
@@ -36,11 +36,11 @@ function E(e, l) {
36
36
  }
37
37
  };
38
38
  }
39
- async function N(e) {
39
+ async function j(e) {
40
40
  const l = typeof e.container == "string" ? document.querySelector(e.container) : e.container;
41
41
  if (!l) throw new Error(`[maildeno-editor] init() couldn't find a container${typeof e.container == "string" ? ` matching "${e.container}"` : ""}.`);
42
42
  if (e.shadowDom === !1) {
43
- const a = E(l, {
43
+ const a = h(l, {
44
44
  templateId: e.templateId,
45
45
  storageAdapter: e.storageAdapter,
46
46
  theme: e.theme,
@@ -53,14 +53,17 @@ async function N(e) {
53
53
  });
54
54
  await new Promise((n) => setTimeout(n, 0));
55
55
  const r = (n, ...s) => {
56
- const d = a.exposed()?.[n];
57
- return typeof d == "function" ? d(...s) : null;
56
+ const m = a.exposed()?.[n];
57
+ return typeof m == "function" ? m(...s) : null;
58
58
  };
59
59
  return {
60
60
  element: a.element,
61
61
  on: (n, s) => a.addSaveHandler(s),
62
62
  off: (n, s) => a.removeSaveHandler(s),
63
63
  setTheme: (n) => a.setProp("theme", n),
64
+ setTemplateName: (n) => {
65
+ r("setTemplateName", n);
66
+ },
64
67
  getHtml: (n = "prune") => r("getHtml", n),
65
68
  getMjml: (n = "prune") => r("getMjml", n),
66
69
  getReactEmail: (n = "prune") => r("getReactEmail", n),
@@ -92,6 +95,9 @@ async function N(e) {
92
95
  setTheme(a) {
93
96
  t.theme = a;
94
97
  },
98
+ setTemplateName(a) {
99
+ t.setTemplateName?.(a);
100
+ },
95
101
  getHtml(a = "prune") {
96
102
  return t.getHtml ? t.getHtml(a) : null;
97
103
  },
@@ -123,15 +129,15 @@ async function N(e) {
123
129
  };
124
130
  }
125
131
  export {
126
- C as createLocalStorageAdapter,
127
- A as getAllBlocks,
128
- T as getBlock,
129
- M as getRegisteredCustomESPs,
130
- j as getRegisteredMergeTagIds,
131
- N as init,
132
- b as palette,
132
+ A as createLocalStorageAdapter,
133
+ w as getAllBlocks,
134
+ C as getBlock,
135
+ N as getRegisteredCustomESPs,
136
+ R as getRegisteredMergeTagIds,
137
+ j as init,
138
+ H as palette,
133
139
  J as registerBlock,
134
- I as registerESPSyntax,
135
- R as registerMergeTags,
136
- H as setEditorTheme
140
+ M as registerESPSyntax,
141
+ I as registerMergeTags,
142
+ T as setEditorTheme
137
143
  };