@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.
Files changed (61) hide show
  1. package/CHANGELOG.md +42 -0
  2. package/dist/DatePicker-DIaGGAVI.js +5347 -0
  3. package/dist/DatePicker-DmMga5gQ.js +5347 -0
  4. package/dist/Dialog-GTfGtduh.js +6294 -0
  5. package/dist/HealthIndicator--ScSxVRA.js +1216 -0
  6. package/dist/HealthIndicator-BraAh2Aj.js +1217 -0
  7. package/dist/Icon-BYmOM482.js +2537 -0
  8. package/dist/Icon-c2SPT3-6.js +2577 -0
  9. package/dist/PreviewCanvas-C1-rP9-B.js +533 -0
  10. package/dist/PreviewCanvas-Nro7tNCn.js +533 -0
  11. package/dist/RichTextEditor-CrYhiAOo.js +12217 -0
  12. package/dist/RichTextEditor-D7Itx0fL.js +12218 -0
  13. package/dist/RowPreviewChildren-B66HbFdX.js +4 -0
  14. package/dist/RowPreviewChildren-DvrE9HTT.js +4 -0
  15. package/dist/RowPreviewLegacyComponent-3QuwvWmT.js +402 -0
  16. package/dist/RowPreviewLegacyComponent-CPqaWwsE.js +402 -0
  17. package/dist/RowPreviewRow-B91YPfoz.js +80 -0
  18. package/dist/RowPreviewRow-MaA-9ApX.js +80 -0
  19. package/dist/SavedRowsPanel-CF-7R3q_.js +492 -0
  20. package/dist/SavedRowsPanel-TLOEvs3Z.js +491 -0
  21. package/dist/_plugin-vue_export-helper-Dj7HTbfw.js +8 -0
  22. package/dist/babel-DV7WPQI0.js +10043 -0
  23. package/dist/components/features/emailBuilder/EmailEditor.vue.d.ts +3 -3
  24. package/dist/composables/emailBuilder/transform/pipeline/optimize.d.ts +4 -4
  25. package/dist/editor.css +2 -1
  26. package/dist/element-CeRQDEn3.js +21396 -0
  27. package/dist/element.js +2 -2
  28. package/dist/estree-DY9POgc0.js +8195 -0
  29. package/dist/html-wb0gSX1o.js +7273 -0
  30. package/dist/index.d.ts +3 -0
  31. package/dist/index.js +14886 -14
  32. package/dist/init.js +83 -94
  33. package/dist/mergeTagDefinitions-Cler19nv.js +27 -0
  34. package/dist/standalone-DHvJ30Td.js +3554 -0
  35. package/dist/useEmailBuilder-CjJoxzTi.js +4893 -0
  36. package/dist/useEmailBuilder-gOc8otd8.js +4893 -0
  37. package/dist/useToast-DeNMwkP3.js +194 -0
  38. package/dist/vue.runtime.esm-bundler-D2AjRP90.js +6117 -0
  39. package/package.json +3 -1
  40. package/dist/DatePicker-6dMK-shv.js +0 -5639
  41. package/dist/DatePicker-CEm1DPgG.js +0 -5640
  42. package/dist/HealthIndicator-Ch5Ck0BL.js +0 -1954
  43. package/dist/HealthIndicator-Dr5vMr1T.js +0 -1953
  44. package/dist/PreviewCanvas-CG52GC5m.js +0 -667
  45. package/dist/PreviewCanvas-CjOrVIGt.js +0 -668
  46. package/dist/RichTextEditor-DaaHuVox.js +0 -13487
  47. package/dist/RichTextEditor-DoWpYF0R.js +0 -13432
  48. package/dist/RowPreviewChildren-DQoyExvw.js +0 -4
  49. package/dist/RowPreviewChildren-yl3aB7hb.js +0 -4
  50. package/dist/RowPreviewLegacyComponent-CHxbwy9l.js +0 -454
  51. package/dist/RowPreviewLegacyComponent-Dv7OCys4.js +0 -454
  52. package/dist/RowPreviewRow-Bizr4PTf.js +0 -86
  53. package/dist/RowPreviewRow-CLhz0YQ5.js +0 -86
  54. package/dist/SavedRowsPanel-C0DkAzHi.js +0 -611
  55. package/dist/SavedRowsPanel-Cp3gADrK.js +0 -610
  56. package/dist/babel-Bmz1GpKj.js +0 -7218
  57. package/dist/element-CRfWpZos.js +0 -40842
  58. package/dist/estree-C5xyFN_T.js +0 -4831
  59. package/dist/html-Dc_r73Xn.js +0 -3062
  60. package/dist/index-BlYp4vAp.js +0 -34092
  61. package/dist/standalone-Yv8gSIWN.js +0 -2336
@@ -0,0 +1,194 @@
1
+ import { H as g } from "./useEmailBuilder-CjJoxzTi.js";
2
+ import { inject as w, provide as y, ref as u } from "vue";
3
+ var R = /* @__PURE__ */ Symbol("maildeno-editor:saved-rows-panel");
4
+ function j() {
5
+ const e = P();
6
+ return y(R, e), e;
7
+ }
8
+ var x = () => {
9
+ const e = w(R);
10
+ if (!e) throw new Error("[maildeno-editor] useSavedRowsPanel() was called outside an EmailEditor instance.");
11
+ return e;
12
+ };
13
+ function P() {
14
+ const e = u(!1), t = u("user");
15
+ function a(r) {
16
+ r && (t.value = r), e.value = !0;
17
+ }
18
+ function s() {
19
+ e.value = !1;
20
+ }
21
+ function o(r) {
22
+ if (r && e.value && t.value !== r) {
23
+ t.value = r;
24
+ return;
25
+ }
26
+ e.value = !e.value, e.value && r && (t.value = r);
27
+ }
28
+ function n(r) {
29
+ t.value = r;
30
+ }
31
+ return {
32
+ isOpen: e,
33
+ activeTab: t,
34
+ open: a,
35
+ close: s,
36
+ toggle: o,
37
+ setTab: n
38
+ };
39
+ }
40
+ var S = /* @__PURE__ */ Symbol("maildeno-editor:layout-drag");
41
+ function A() {
42
+ const e = E();
43
+ return y(S, e), e;
44
+ }
45
+ var K = () => {
46
+ const e = w(S);
47
+ if (!e) throw new Error("[maildeno-editor] useLayoutDrag() was called outside an EmailEditor instance.");
48
+ return e;
49
+ };
50
+ function E() {
51
+ const e = u(!1), t = u(null);
52
+ return {
53
+ isLayoutDragActive: e,
54
+ layoutDragPayload: t,
55
+ startLayoutDrag: (o, n) => {
56
+ e.value = !0, t.value = n, o.dataTransfer && (o.dataTransfer.effectAllowed = "copy", o.dataTransfer.setData("layoutDragType", n.type), (n.type === "row" || n.type === "nested-row") && o.dataTransfer.setData("layoutDragColumns", JSON.stringify(n.columns)), n.type === "product-row" && o.dataTransfer.setData("layoutDragEntryId", n.entryId), n.type === "nested-row" && (o.dataTransfer.setData("layoutDragTargetColumnId", n.targetColumnId), o.dataTransfer.setData("layoutDragTargetIndex", String(n.targetIndex))));
57
+ },
58
+ endLayoutDrag: () => {
59
+ e.value = !1, t.value = null;
60
+ }
61
+ };
62
+ }
63
+ function L(e) {
64
+ const t = e ?? g(), a = u([]), s = u(!1);
65
+ let o = !1;
66
+ async function n() {
67
+ if (!o) {
68
+ o = !0, s.value = !0;
69
+ try {
70
+ a.value = await t.listSavedRows();
71
+ } finally {
72
+ s.value = !1;
73
+ }
74
+ }
75
+ }
76
+ async function r(i, c) {
77
+ const l = await t.saveSavedRow(i, c);
78
+ return l && (a.value = [l, ...a.value]), l;
79
+ }
80
+ async function m(i) {
81
+ await t.deleteSavedRow(i), a.value = a.value.filter((c) => c.id !== i);
82
+ }
83
+ async function d(i, c) {
84
+ return await t.renameSavedRow(i, c), a.value = a.value.map((l) => l.id === i ? {
85
+ ...l,
86
+ name: c.trim() || l.name
87
+ } : l), a.value;
88
+ }
89
+ function T(i) {
90
+ return t.cloneSavedRowForCanvas(i);
91
+ }
92
+ return {
93
+ productRows: a,
94
+ isFetching: s,
95
+ fetchRows: n,
96
+ saveProductRow: r,
97
+ deleteProductRow: m,
98
+ renameProductRow: d,
99
+ cloneRowForCanvas: T
100
+ };
101
+ }
102
+ var p = /* @__PURE__ */ Symbol("maildeno-editor:product-rows");
103
+ function H(e) {
104
+ const t = L(e);
105
+ return y(p, t), t;
106
+ }
107
+ var O = () => {
108
+ const e = w(p);
109
+ if (!e) throw new Error("[maildeno-editor] useProductRows() was called outside an EmailEditor instance.");
110
+ return e;
111
+ };
112
+ function D(e) {
113
+ const t = e ?? g(), a = u([]), s = u(!1), o = u(typeof t.listSystemSavedRows == "function");
114
+ let n = !1;
115
+ async function r() {
116
+ if (!(n || !o.value)) {
117
+ n = !0, s.value = !0;
118
+ try {
119
+ a.value = await t.listSystemSavedRows();
120
+ } catch (d) {
121
+ console.warn("[maildeno-editor] couldn't load shared rows:", d), a.value = [];
122
+ } finally {
123
+ s.value = !1;
124
+ }
125
+ }
126
+ }
127
+ function m(d) {
128
+ return t.cloneSavedRowForCanvas(d);
129
+ }
130
+ return {
131
+ systemRows: a,
132
+ isFetching: s,
133
+ isSupported: o,
134
+ fetchRows: r,
135
+ cloneRowForCanvas: m
136
+ };
137
+ }
138
+ var h = /* @__PURE__ */ Symbol("maildeno-editor:system-rows");
139
+ function k(e) {
140
+ const t = D(e);
141
+ return y(h, t), t;
142
+ }
143
+ function J() {
144
+ const e = w(h, void 0);
145
+ return e || D();
146
+ }
147
+ function M(e) {
148
+ if (typeof e == "object" && e !== null) try {
149
+ return e.handled = !0, e;
150
+ } catch {
151
+ }
152
+ return Object.assign(new Error(String(e?.message ?? e)), {
153
+ handled: !0,
154
+ cause: e
155
+ });
156
+ }
157
+ function q(e) {
158
+ return typeof e == "object" && e !== null && e.handled === !0;
159
+ }
160
+ var f = u([]), I = 0, v = /* @__PURE__ */ new Map();
161
+ function F(e) {
162
+ f.value = f.value.filter((a) => a.id !== e);
163
+ const t = v.get(e);
164
+ t && (clearTimeout(t), v.delete(e));
165
+ }
166
+ function z() {
167
+ return {
168
+ add(e) {
169
+ const t = I++;
170
+ f.value = [...f.value, {
171
+ ...e,
172
+ id: t
173
+ }], v.set(t, setTimeout(() => F(t), e.life ?? 3e3));
174
+ },
175
+ removeAll() {
176
+ v.forEach((e) => clearTimeout(e)), v.clear(), f.value = [];
177
+ }
178
+ };
179
+ }
180
+ export {
181
+ M as a,
182
+ H as c,
183
+ K as d,
184
+ j as f,
185
+ q as i,
186
+ O as l,
187
+ f as n,
188
+ k as o,
189
+ x as p,
190
+ z as r,
191
+ J as s,
192
+ F as t,
193
+ A as u
194
+ };