@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
|
@@ -1,610 +0,0 @@
|
|
|
1
|
-
import { n as Z, o as i, q as c, F as I, t as H, u as q, v as M, w as j, x as se, y as J, z as ce, A as P, B as Q, C as X, D as ge, E as xe, G as he, H as be, I as we, J as ye, K as ke, L as $e, M as ne, N as o, O as ae, P as L, Q as Y, T as Ce, R as G, S as _e, U as le, V as Se, W as Re, a as k, X as de, Y as Pe, Z as Ie, $ as Te, a0 as De } from "./element-CRfWpZos.js";
|
|
2
|
-
const Fe = {
|
|
3
|
-
key: 1,
|
|
4
|
-
style: { height: "4px", width: "100%" }
|
|
5
|
-
}, Me = /* @__PURE__ */ Z({
|
|
6
|
-
__name: "RowPreviewChildren",
|
|
7
|
-
props: {
|
|
8
|
-
children: {},
|
|
9
|
-
scale: {},
|
|
10
|
-
depth: {}
|
|
11
|
-
},
|
|
12
|
-
setup(h) {
|
|
13
|
-
const $ = se(() => import("./RowPreviewRow-Bizr4PTf.js")), _ = se(
|
|
14
|
-
() => import("./RowPreviewLegacyComponent-CHxbwy9l.js")
|
|
15
|
-
);
|
|
16
|
-
function b(u) {
|
|
17
|
-
var C, T;
|
|
18
|
-
const p = u == null ? void 0 : u.backgroundGradient;
|
|
19
|
-
if ((p == null ? void 0 : p.useGradient) === !0 && Array.isArray((C = p == null ? void 0 : p.gradient) == null ? void 0 : C.colors) && p.gradient.colors.length >= 2) {
|
|
20
|
-
const { type: z, direction: t, colors: a } = p.gradient, l = a.map((n) => `${n.color} ${n.position}%`).join(", ");
|
|
21
|
-
return z === "radial" ? `radial-gradient(circle at center, ${l})` : `linear-gradient(${t}, ${l})`;
|
|
22
|
-
}
|
|
23
|
-
return (u == null ? void 0 : u.backgroundColor) ?? ((T = u == null ? void 0 : u.props) == null ? void 0 : T.backgroundColor) ?? "transparent";
|
|
24
|
-
}
|
|
25
|
-
function v(u) {
|
|
26
|
-
var p;
|
|
27
|
-
return u.height ?? ((p = u.props) == null ? void 0 : p.height) ?? 8;
|
|
28
|
-
}
|
|
29
|
-
return (u, p) => (i(!0), c(I, null, H(h.children, (m, C) => (i(), c(I, {
|
|
30
|
-
key: m.id
|
|
31
|
-
}, [
|
|
32
|
-
(h.depth ?? 0) < 5 ? (i(), c(I, { key: 0 }, [
|
|
33
|
-
m.type === "row" ? (i(), q(M($), {
|
|
34
|
-
key: 0,
|
|
35
|
-
row: m,
|
|
36
|
-
scale: h.scale,
|
|
37
|
-
depth: (h.depth ?? 0) + 1
|
|
38
|
-
}, null, 8, ["row", "scale", "depth"])) : m.type === "row-spacer" ? (i(), c("div", {
|
|
39
|
-
key: 1,
|
|
40
|
-
style: j({
|
|
41
|
-
width: "100%",
|
|
42
|
-
height: v(m) + "px",
|
|
43
|
-
background: b(m),
|
|
44
|
-
flexShrink: "0"
|
|
45
|
-
})
|
|
46
|
-
}, null, 4)) : m.type === "component" ? (i(), q(M(_), {
|
|
47
|
-
key: 2,
|
|
48
|
-
comp: { ...m, type: m.componentType ?? m.type },
|
|
49
|
-
scale: h.scale
|
|
50
|
-
}, null, 8, ["comp", "scale"])) : (i(), q(M(_), {
|
|
51
|
-
key: 3,
|
|
52
|
-
comp: m,
|
|
53
|
-
scale: h.scale
|
|
54
|
-
}, null, 8, ["comp", "scale"]))
|
|
55
|
-
], 64)) : (i(), c("div", Fe))
|
|
56
|
-
], 64))), 128));
|
|
57
|
-
}
|
|
58
|
-
}), je = {
|
|
59
|
-
key: 0,
|
|
60
|
-
class: "w-full border border-dashed border-(--md-border) rounded",
|
|
61
|
-
style: { "min-height": "10px" }
|
|
62
|
-
}, ze = /* @__PURE__ */ Z({
|
|
63
|
-
__name: "RowPreview",
|
|
64
|
-
props: {
|
|
65
|
-
row: {},
|
|
66
|
-
scale: {}
|
|
67
|
-
},
|
|
68
|
-
setup(h) {
|
|
69
|
-
const $ = h, { WEB_SAFE_FONTS: _, FONTS_WITH_ITALICS: b, DEFAULT_WEIGHTS: v } = ge(), u = (t) => {
|
|
70
|
-
var n;
|
|
71
|
-
const a = t == null ? void 0 : t.backgroundGradient;
|
|
72
|
-
if ((a == null ? void 0 : a.useGradient) === !0 && Array.isArray((n = a == null ? void 0 : a.gradient) == null ? void 0 : n.colors) && a.gradient.colors.length >= 2) {
|
|
73
|
-
const { type: f, direction: g, colors: y } = a.gradient, w = y.map((x) => `${x.color} ${x.position}%`).join(", ");
|
|
74
|
-
return f === "radial" ? `radial-gradient(circle at center, ${w})` : `linear-gradient(${g}, ${w})`;
|
|
75
|
-
}
|
|
76
|
-
return (t == null ? void 0 : t.backgroundColor) || "transparent";
|
|
77
|
-
}, p = (t) => {
|
|
78
|
-
if (b.has(t)) {
|
|
79
|
-
const a = v.map((n) => `0,${n}`), l = v.map((n) => `1,${n}`);
|
|
80
|
-
return `ital,wght@${[...a, ...l].join(";")}`;
|
|
81
|
-
}
|
|
82
|
-
return `wght@${v.join(";")}`;
|
|
83
|
-
}, m = (t) => {
|
|
84
|
-
if (!t || typeof document > "u" || _.has(t)) return;
|
|
85
|
-
const l = `https://fonts.googleapis.com/css2?family=${t.trim().replace(/\s+/g, "+")}:${p(t)}&display=swap`;
|
|
86
|
-
if (!document.querySelector(`link[href="${l}"]`)) {
|
|
87
|
-
const n = document.createElement("link");
|
|
88
|
-
n.rel = "stylesheet", n.href = l, document.head.appendChild(n);
|
|
89
|
-
}
|
|
90
|
-
}, C = () => {
|
|
91
|
-
function t(a) {
|
|
92
|
-
for (const l of a)
|
|
93
|
-
if (l.type === "row")
|
|
94
|
-
for (const n of l.columns ?? [])
|
|
95
|
-
t(n.children ?? n.components ?? []);
|
|
96
|
-
else {
|
|
97
|
-
const n = l.props;
|
|
98
|
-
if (!(n != null && n.fontFamily)) continue;
|
|
99
|
-
const f = l.componentType ?? l.type;
|
|
100
|
-
["heading", "paragraph", "list", "menu", "button", "anchor"].includes(
|
|
101
|
-
f
|
|
102
|
-
) && m(n.fontFamily);
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
for (const a of $.row.columns ?? [])
|
|
106
|
-
t(a.children ?? a.components ?? []);
|
|
107
|
-
};
|
|
108
|
-
J(
|
|
109
|
-
() => $.row,
|
|
110
|
-
() => C(),
|
|
111
|
-
{ deep: !0, immediate: !0 }
|
|
112
|
-
), ce(() => C());
|
|
113
|
-
const T = P(() => {
|
|
114
|
-
var l, n, f, g, y, w, x, S;
|
|
115
|
-
const t = $.row, a = {
|
|
116
|
-
display: "flex",
|
|
117
|
-
flexDirection: "row",
|
|
118
|
-
background: u(t),
|
|
119
|
-
padding: `${((l = t.padding) == null ? void 0 : l.top) ?? 0}px ${((n = t.padding) == null ? void 0 : n.right) ?? 0}px ${((f = t.padding) == null ? void 0 : f.bottom) ?? 0}px ${((g = t.padding) == null ? void 0 : g.left) ?? 0}px`,
|
|
120
|
-
alignItems: "stretch",
|
|
121
|
-
border: `${((y = t.border) == null ? void 0 : y.width) ?? 0}px ${((w = t.border) == null ? void 0 : w.style) ?? "solid"} ${((x = t.border) == null ? void 0 : x.color) ?? "transparent"}`,
|
|
122
|
-
borderRadius: `${((S = t.border) == null ? void 0 : S.radius) ?? 0}px`,
|
|
123
|
-
gap: `${t.gap ?? 0}px`
|
|
124
|
-
};
|
|
125
|
-
return t.backgroundImage && (a.backgroundImage = `url(${t.backgroundImage})`, a.backgroundSize = t.backgroundSize || "cover", a.backgroundPosition = t.backgroundPosition || "center center"), a;
|
|
126
|
-
});
|
|
127
|
-
function z(t, a) {
|
|
128
|
-
var S, D, O, N, B, A, E, V, R;
|
|
129
|
-
const l = {
|
|
130
|
-
top: "flex-start",
|
|
131
|
-
middle: "center",
|
|
132
|
-
bottom: "flex-end"
|
|
133
|
-
}, n = t.width ?? 100, f = ((S = a == null ? void 0 : a.columns) == null ? void 0 : S.length) || 1, g = (a == null ? void 0 : a.gap) ?? 0, y = f > 1 ? g * (f - 1) / f : 0, w = y > 0 ? `calc(${n}% - ${y}px)` : `${n}%`, x = {
|
|
134
|
-
flex: `0 0 ${w}`,
|
|
135
|
-
width: w,
|
|
136
|
-
maxWidth: w,
|
|
137
|
-
boxSizing: "border-box",
|
|
138
|
-
background: u(t),
|
|
139
|
-
padding: `${((D = t.padding) == null ? void 0 : D.top) ?? 10}px ${((O = t.padding) == null ? void 0 : O.right) ?? 10}px ${((N = t.padding) == null ? void 0 : N.bottom) ?? 10}px ${((B = t.padding) == null ? void 0 : B.left) ?? 10}px`,
|
|
140
|
-
border: `${((A = t.border) == null ? void 0 : A.width) ?? 0}px ${((E = t.border) == null ? void 0 : E.style) ?? "solid"} ${((V = t.border) == null ? void 0 : V.color) ?? "transparent"}`,
|
|
141
|
-
borderRadius: `${((R = t.border) == null ? void 0 : R.radius) ?? 0}px`,
|
|
142
|
-
overflow: "hidden",
|
|
143
|
-
minWidth: "0",
|
|
144
|
-
display: "flex",
|
|
145
|
-
flexDirection: "column",
|
|
146
|
-
justifyContent: l[t.verticalAlign] || "flex-start"
|
|
147
|
-
};
|
|
148
|
-
return t.backgroundImage && (x.backgroundImage = `url(${t.backgroundImage})`, x.backgroundSize = t.backgroundSize || "cover", x.backgroundPosition = t.backgroundPosition || "center center", x.minHeight = "14px"), x;
|
|
149
|
-
}
|
|
150
|
-
return (t, a) => (i(), c("div", {
|
|
151
|
-
style: j(T.value),
|
|
152
|
-
class: "flex w-full pointer-events-none select-none"
|
|
153
|
-
}, [
|
|
154
|
-
(i(!0), c(I, null, H(h.row.columns, (l) => (i(), c("div", {
|
|
155
|
-
key: l.id,
|
|
156
|
-
style: j(z(l, h.row)),
|
|
157
|
-
class: "overflow-hidden shrink-0"
|
|
158
|
-
}, [
|
|
159
|
-
Q(Me, {
|
|
160
|
-
children: l.children ?? l.components ?? [],
|
|
161
|
-
scale: h.scale,
|
|
162
|
-
depth: 0
|
|
163
|
-
}, null, 8, ["children", "scale"]),
|
|
164
|
-
(l.children ?? l.components ?? []).length === 0 ? (i(), c("div", je)) : X("", !0)
|
|
165
|
-
], 4))), 128))
|
|
166
|
-
], 4));
|
|
167
|
-
}
|
|
168
|
-
}), Be = {
|
|
169
|
-
key: 0,
|
|
170
|
-
class: "w-65 sticky top-16 h-[calc(100vh-5.25rem)] z-80"
|
|
171
|
-
}, Ae = { class: "bg-(--md-surface) flex flex-col h-full border-r border-(--md-border)/80" }, Ee = { class: "flex items-center justify-between px-3.5 py-3 shrink-0" }, Le = { class: "relative group/close" }, Ge = { class: "px-3.5 pb-2 shrink-0" }, He = {
|
|
172
|
-
key: 0,
|
|
173
|
-
class: "flex items-center gap-1"
|
|
174
|
-
}, Oe = ["aria-pressed", "onClick"], Ne = {
|
|
175
|
-
key: 1,
|
|
176
|
-
class: "text-[11px] font-medium text-(--md-text-subtle)"
|
|
177
|
-
}, Ve = { class: "flex-1 min-h-0 overflow-y-auto" }, We = {
|
|
178
|
-
key: 0,
|
|
179
|
-
class: "p-2 flex flex-col gap-2"
|
|
180
|
-
}, Ue = {
|
|
181
|
-
key: 1,
|
|
182
|
-
class: "flex flex-col items-center gap-3 px-5 py-12 text-center"
|
|
183
|
-
}, Ke = {
|
|
184
|
-
key: 2,
|
|
185
|
-
class: "p-2 flex flex-col gap-1.5"
|
|
186
|
-
}, qe = ["onClick", "onDragstart"], Ye = ["onDblclick"], Je = ["onBlur", "onKeyup"], Qe = { class: "text-[10px] text-(--md-text-subtle) shrink-0 tabular-nums" }, Xe = {
|
|
187
|
-
key: 2,
|
|
188
|
-
class: "relative group/del"
|
|
189
|
-
}, Ze = ["onClick"], et = {
|
|
190
|
-
key: 1,
|
|
191
|
-
class: "flex items-center gap-1.5 px-2 py-1.5"
|
|
192
|
-
}, tt = { class: "flex-1 text-[11px] font-medium text-(--md-text-muted) truncate" }, ot = { class: "text-[10px] text-(--md-text-subtle) shrink-0 tabular-nums" }, rt = 600, ie = 25, st = /* @__PURE__ */ Z({
|
|
193
|
-
__name: "SavedRowsPanel",
|
|
194
|
-
setup(h) {
|
|
195
|
-
const { isOpen: $, close: _ } = xe(), b = he(), v = be(), u = Ie(), p = Te(), m = we(), { rows: C, saveToHistoryImmediate: T } = ye(), { startLayoutDrag: z, endLayoutDrag: t } = ke(), a = {
|
|
196
|
-
rows: v.systemRows,
|
|
197
|
-
isFetching: v.isFetching,
|
|
198
|
-
ensureFetched: () => v.fetchRows(),
|
|
199
|
-
rename: () => {
|
|
200
|
-
throw new Error("Shared rows are read-only");
|
|
201
|
-
},
|
|
202
|
-
remove: () => {
|
|
203
|
-
throw new Error("Shared rows are read-only");
|
|
204
|
-
},
|
|
205
|
-
cloneForCanvas: (r) => v.cloneRowForCanvas(r)
|
|
206
|
-
}, l = {
|
|
207
|
-
rows: b.productRows,
|
|
208
|
-
isFetching: b.isFetching,
|
|
209
|
-
// Idempotent — guarded internally by `hasFetched` (DB) or `hasHydrated`
|
|
210
|
-
// (localStorage). Safe to call every time the user activates the tab.
|
|
211
|
-
ensureFetched: () => b.fetchRows(),
|
|
212
|
-
rename: (r, e) => b.renameProductRow(r, e),
|
|
213
|
-
remove: (r) => b.deleteProductRow(r),
|
|
214
|
-
cloneForCanvas: (r) => b.cloneRowForCanvas(r)
|
|
215
|
-
}, n = k("user"), f = P(
|
|
216
|
-
() => v.isSupported.value && v.systemRows.value.length > 0
|
|
217
|
-
);
|
|
218
|
-
J(f, (r) => {
|
|
219
|
-
!r && n.value === "system" && (n.value = "user");
|
|
220
|
-
});
|
|
221
|
-
const g = P(
|
|
222
|
-
() => n.value === "system" && f.value ? a : l
|
|
223
|
-
), y = P(() => n.value === "system"), w = P(
|
|
224
|
-
() => !y.value && m.value.rename !== !1
|
|
225
|
-
), x = P(
|
|
226
|
-
() => !y.value && m.value.delete !== !1
|
|
227
|
-
);
|
|
228
|
-
J(
|
|
229
|
-
$,
|
|
230
|
-
async (r) => {
|
|
231
|
-
r && await Promise.all([b.fetchRows(), v.fetchRows()]);
|
|
232
|
-
},
|
|
233
|
-
{ immediate: !0 }
|
|
234
|
-
);
|
|
235
|
-
const S = P(() => g.value.rows.value), D = k(null);
|
|
236
|
-
function O(r, e) {
|
|
237
|
-
D.value = e, z(r, { type: "product-row", entryId: e });
|
|
238
|
-
}
|
|
239
|
-
function N() {
|
|
240
|
-
D.value = null, t();
|
|
241
|
-
}
|
|
242
|
-
const B = k({}), A = k({});
|
|
243
|
-
function E(r) {
|
|
244
|
-
const e = B.value[r];
|
|
245
|
-
return e && e > 0 ? e / rt : 0;
|
|
246
|
-
}
|
|
247
|
-
function V(r) {
|
|
248
|
-
const e = A.value[r];
|
|
249
|
-
return e ? Math.max(
|
|
250
|
-
ie,
|
|
251
|
-
Math.round(e * E(r))
|
|
252
|
-
) : ie;
|
|
253
|
-
}
|
|
254
|
-
const R = k(null), W = k(null);
|
|
255
|
-
function ue(r, e) {
|
|
256
|
-
!r || !R.value || (r.dataset.entryId = e, R.value.observe(r));
|
|
257
|
-
}
|
|
258
|
-
function pe(r, e) {
|
|
259
|
-
!r || !W.value || (r.dataset.entryId = e, W.value.observe(r));
|
|
260
|
-
}
|
|
261
|
-
ce(() => {
|
|
262
|
-
R.value = new ResizeObserver((r) => {
|
|
263
|
-
for (const e of r) {
|
|
264
|
-
const s = e.target.dataset.entryId;
|
|
265
|
-
if (s) {
|
|
266
|
-
const d = e.contentRect.width;
|
|
267
|
-
d > 0 && (B.value[s] = d);
|
|
268
|
-
}
|
|
269
|
-
}
|
|
270
|
-
}), W.value = new ResizeObserver((r) => {
|
|
271
|
-
var e, s;
|
|
272
|
-
for (const d of r) {
|
|
273
|
-
const oe = d.target.dataset.entryId;
|
|
274
|
-
if (oe) {
|
|
275
|
-
const re = ((s = (e = d.borderBoxSize) == null ? void 0 : e[0]) == null ? void 0 : s.blockSize) ?? d.contentRect.height;
|
|
276
|
-
re > 0 && (A.value[oe] = re);
|
|
277
|
-
}
|
|
278
|
-
}
|
|
279
|
-
});
|
|
280
|
-
}), $e(() => {
|
|
281
|
-
var r, e;
|
|
282
|
-
(r = R.value) == null || r.disconnect(), (e = W.value) == null || e.disconnect();
|
|
283
|
-
});
|
|
284
|
-
function me(r) {
|
|
285
|
-
if (F.value === r) return;
|
|
286
|
-
const e = g.value.cloneForCanvas(r);
|
|
287
|
-
e && (C.value.push(e), T("add-product-row"));
|
|
288
|
-
}
|
|
289
|
-
function fe(r) {
|
|
290
|
-
u.require({
|
|
291
|
-
message: "Remove this product row from the library?",
|
|
292
|
-
header: "Clear product",
|
|
293
|
-
acceptLabel: "Yes",
|
|
294
|
-
rejectLabel: "Cancel",
|
|
295
|
-
acceptClass: "!bg-[var(--md-danger)] !hover:opacity-90 !border-[var(--md-danger)] !px-6 !py-2",
|
|
296
|
-
rejectClass: "!bg-[var(--md-border)] !hover:bg-[var(--md-border-strong)] !text-[var(--md-text)] !border-[var(--md-border)] !px-6 !py-2",
|
|
297
|
-
// Previously `accept: () => current.value.remove(entryId)` — the returned
|
|
298
|
-
// promise went nowhere, so a rejecting adapter produced an unhandled
|
|
299
|
-
// rejection and a dialog that closed as if the delete had worked. The row
|
|
300
|
-
// stays in the list on failure, which is correct: useProductRows only
|
|
301
|
-
// filters it out once the adapter resolves.
|
|
302
|
-
accept: async () => {
|
|
303
|
-
try {
|
|
304
|
-
await g.value.remove(r);
|
|
305
|
-
} catch (e) {
|
|
306
|
-
console.error("[maildeno-editor] failed to delete saved row:", e), de(e) || p.add({
|
|
307
|
-
severity: "error",
|
|
308
|
-
summary: "Delete failed",
|
|
309
|
-
detail: "That row couldn't be removed.",
|
|
310
|
-
life: 4e3
|
|
311
|
-
});
|
|
312
|
-
}
|
|
313
|
-
},
|
|
314
|
-
reject: () => {
|
|
315
|
-
}
|
|
316
|
-
});
|
|
317
|
-
}
|
|
318
|
-
const F = k(null), U = k(""), K = k(null);
|
|
319
|
-
function ve(r) {
|
|
320
|
-
F.value = r.id, U.value = r.name, Pe(() => {
|
|
321
|
-
const e = Array.isArray(K.value) ? K.value[0] : K.value;
|
|
322
|
-
e == null || e.focus();
|
|
323
|
-
});
|
|
324
|
-
}
|
|
325
|
-
async function ee(r) {
|
|
326
|
-
const e = "Saved";
|
|
327
|
-
if (F.value === r) {
|
|
328
|
-
const s = U.value.trim().toLowerCase().replace(/\s+/g, "_").replace(/[^a-z0-9_]/g, "");
|
|
329
|
-
try {
|
|
330
|
-
const d = await g.value.rename(r, s);
|
|
331
|
-
F.value = null, p.add({
|
|
332
|
-
severity: d ? "success" : "error",
|
|
333
|
-
summary: d ? "Rename successful" : "Save failed",
|
|
334
|
-
detail: d ? e : "Please try again",
|
|
335
|
-
life: 3e3
|
|
336
|
-
});
|
|
337
|
-
} catch (d) {
|
|
338
|
-
console.error("[maildeno-editor] failed to rename saved row:", d), de(d) || p.add({
|
|
339
|
-
severity: "error",
|
|
340
|
-
summary: "Rename failed",
|
|
341
|
-
detail: "Please try again",
|
|
342
|
-
life: 4e3
|
|
343
|
-
});
|
|
344
|
-
}
|
|
345
|
-
}
|
|
346
|
-
}
|
|
347
|
-
function te(r) {
|
|
348
|
-
return new Date(r).toLocaleDateString(void 0, {
|
|
349
|
-
month: "short",
|
|
350
|
-
day: "numeric"
|
|
351
|
-
});
|
|
352
|
-
}
|
|
353
|
-
return (r, e) => (i(), q(Re, { name: "panel-slide" }, {
|
|
354
|
-
default: ne(() => [
|
|
355
|
-
M($) ? (i(), c("div", Be, [
|
|
356
|
-
o("div", Ae, [
|
|
357
|
-
o("div", Ee, [
|
|
358
|
-
e[8] || (e[8] = o("div", { class: "flex items-center gap-2" }, [
|
|
359
|
-
o("svg", {
|
|
360
|
-
class: "w-3.5 h-3.5 text-(--md-text-subtle)",
|
|
361
|
-
viewBox: "0 0 24 24",
|
|
362
|
-
fill: "none",
|
|
363
|
-
stroke: "currentColor",
|
|
364
|
-
"stroke-width": "2",
|
|
365
|
-
"stroke-linecap": "round",
|
|
366
|
-
"stroke-linejoin": "round"
|
|
367
|
-
}, [
|
|
368
|
-
o("path", { d: "m19 21-7-4-7 4V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v16z" })
|
|
369
|
-
]),
|
|
370
|
-
o("span", { class: "text-[11px] font-semibold text-(--md-text-subtle) uppercase tracking-[.08em]" }, " Saved Rows ")
|
|
371
|
-
], -1)),
|
|
372
|
-
o("div", Le, [
|
|
373
|
-
o("button", {
|
|
374
|
-
onClick: e[0] || (e[0] = //@ts-ignore
|
|
375
|
-
(...s) => M(_) && M(_)(...s)),
|
|
376
|
-
class: "w-6 h-6 flex items-center justify-center rounded-md text-(--md-text-subtle) hover:text-(--md-text-muted) hover:bg-(--md-surface-muted) transition-colors focus:outline-none"
|
|
377
|
-
}, [...e[6] || (e[6] = [
|
|
378
|
-
o("svg", {
|
|
379
|
-
class: "w-3.5 h-3.5",
|
|
380
|
-
viewBox: "0 0 24 24",
|
|
381
|
-
fill: "none",
|
|
382
|
-
stroke: "currentColor",
|
|
383
|
-
"stroke-width": "2",
|
|
384
|
-
"stroke-linecap": "round",
|
|
385
|
-
"stroke-linejoin": "round"
|
|
386
|
-
}, [
|
|
387
|
-
o("path", { d: "M18 6 6 18M6 6l12 12" })
|
|
388
|
-
], -1)
|
|
389
|
-
])]),
|
|
390
|
-
e[7] || (e[7] = o("div", { class: "pointer-events-none absolute right-0 top-full mt-1.5 px-2 py-1 bg-(--md-tooltip-bg) text-(--md-tooltip-text) text-[10px] font-medium rounded-md whitespace-nowrap opacity-0 group-hover/close:opacity-100 -translate-y-0.5 group-hover/close:translate-y-0 transition-all duration-150 z-50 after:content-[''] after:absolute after:bottom-full after:right-2 after:border-4 after:border-transparent after:border-b-(--md-tooltip-bg)" }, " Close panel ", -1))
|
|
391
|
-
])
|
|
392
|
-
]),
|
|
393
|
-
o("div", Ge, [
|
|
394
|
-
f.value ? (i(), c("div", He, [
|
|
395
|
-
(i(), c(I, null, H(["user", "system"], (s) => o("button", {
|
|
396
|
-
key: s,
|
|
397
|
-
type: "button",
|
|
398
|
-
class: ae([
|
|
399
|
-
"px-2 py-1 rounded-md text-[11px] font-medium transition-colors",
|
|
400
|
-
n.value === s ? "bg-(--md-accent-bg) text-(--md-accent-text)" : "text-(--md-text-subtle) hover:text-(--md-text-muted) hover:bg-(--md-surface-muted)"
|
|
401
|
-
]),
|
|
402
|
-
"aria-pressed": n.value === s,
|
|
403
|
-
onClick: (d) => n.value = s
|
|
404
|
-
}, L(s === "user" ? "My Rows" : "Shared"), 11, Oe)), 64))
|
|
405
|
-
])) : (i(), c("span", Ne, "My Rows"))
|
|
406
|
-
]),
|
|
407
|
-
o("div", Ve, [
|
|
408
|
-
g.value.isFetching.value ? (i(), c("div", We, [
|
|
409
|
-
(i(), c(I, null, H(3, (s) => o("div", {
|
|
410
|
-
key: s,
|
|
411
|
-
class: "rounded-lg border border-(--md-border) overflow-hidden"
|
|
412
|
-
}, [
|
|
413
|
-
o("div", {
|
|
414
|
-
class: "bg-(--md-surface-muted) animate-pulse",
|
|
415
|
-
style: j({ height: 80 + s * 20 + "px" })
|
|
416
|
-
}, null, 4),
|
|
417
|
-
e[9] || (e[9] = o("div", { class: "flex items-center gap-2 px-2.5 py-2" }, [
|
|
418
|
-
o("div", { class: "h-2 flex-1 rounded-full bg-(--md-surface-muted) animate-pulse" }),
|
|
419
|
-
o("div", { class: "h-2 w-7 rounded-full bg-(--md-surface-muted) animate-pulse" })
|
|
420
|
-
], -1))
|
|
421
|
-
])), 64))
|
|
422
|
-
])) : g.value.rows.value.length === 0 ? (i(), c("div", Ue, [...e[10] || (e[10] = [
|
|
423
|
-
o("div", { class: "w-10 h-10 rounded-xl bg-(--md-surface-hover) border border-(--md-border)/80 flex items-center justify-center" }, [
|
|
424
|
-
o("svg", {
|
|
425
|
-
class: "w-5 h-5 text-(--md-text-subtle)",
|
|
426
|
-
viewBox: "0 0 24 24",
|
|
427
|
-
fill: "none",
|
|
428
|
-
stroke: "currentColor",
|
|
429
|
-
"stroke-width": "1.5",
|
|
430
|
-
"stroke-linecap": "round",
|
|
431
|
-
"stroke-linejoin": "round"
|
|
432
|
-
}, [
|
|
433
|
-
o("path", { d: "m19 21-7-4-7 4V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v16z" })
|
|
434
|
-
])
|
|
435
|
-
], -1),
|
|
436
|
-
o("div", { class: "space-y-1" }, [
|
|
437
|
-
o("p", { class: "text-xs font-medium text-(--md-text-subtle)" }, " No saved rows yet "),
|
|
438
|
-
o("p", { class: "text-[11px] text-(--md-text-subtle) leading-relaxed" }, [
|
|
439
|
-
Y(" Select a row on the canvas,"),
|
|
440
|
-
o("br"),
|
|
441
|
-
Y("then click "),
|
|
442
|
-
o("span", { class: "text-(--md-row-selection-fg) font-medium" }, "Save"),
|
|
443
|
-
Y(" in the toolbar. ")
|
|
444
|
-
])
|
|
445
|
-
], -1)
|
|
446
|
-
])])) : (i(), c("div", Ke, [
|
|
447
|
-
Q(Ce, { name: "row-list" }, {
|
|
448
|
-
default: ne(() => [
|
|
449
|
-
(i(!0), c(I, null, H(S.value, (s) => (i(), c("div", {
|
|
450
|
-
key: s.id,
|
|
451
|
-
draggable: "true",
|
|
452
|
-
class: ae(["group relative rounded-lg border bg-(--md-surface) overflow-hidden transition-all duration-150 select-none cursor-grab active:cursor-grabbing", [
|
|
453
|
-
D.value === s.id ? "ring-2 ring-(--md-row-selection) ring-offset-1 opacity-60 border-(--md-row-selection)" : "border-(--md-border)/80 hover:border-(--md-border-strong) hover:shadow-[0_2px_8px_rgba(0,0,0,0.07)]"
|
|
454
|
-
]]),
|
|
455
|
-
onClick: (d) => me(s.id),
|
|
456
|
-
onDragstart: (d) => O(d, s.id),
|
|
457
|
-
onDragend: N
|
|
458
|
-
}, [
|
|
459
|
-
o("div", {
|
|
460
|
-
ref_for: !0,
|
|
461
|
-
ref: (d) => ue(d, s.id),
|
|
462
|
-
class: "relative overflow-hidden border-b border-(--md-border)",
|
|
463
|
-
style: j({
|
|
464
|
-
height: V(s.id) + "px",
|
|
465
|
-
backgroundColor: s.row.backgroundColor || "#f9fafb"
|
|
466
|
-
})
|
|
467
|
-
}, [
|
|
468
|
-
o("div", {
|
|
469
|
-
ref_for: !0,
|
|
470
|
-
ref: (d) => pe(d, s.id),
|
|
471
|
-
class: "absolute top-0 left-0 pointer-events-none",
|
|
472
|
-
style: j({
|
|
473
|
-
width: "600px",
|
|
474
|
-
transformOrigin: "top left",
|
|
475
|
-
transform: `scale(${E(s.id)})`
|
|
476
|
-
})
|
|
477
|
-
}, [
|
|
478
|
-
Q(ze, {
|
|
479
|
-
row: s.row
|
|
480
|
-
}, null, 8, ["row"])
|
|
481
|
-
], 4),
|
|
482
|
-
e[11] || (e[11] = o("div", { class: "absolute inset-0 bg-(--md-text)/0 group-hover:bg-(--md-text)/[0.03] transition-colors duration-150 flex items-center justify-center" }, [
|
|
483
|
-
o("div", { class: "opacity-0 group-hover:opacity-100 transition-opacity duration-150 flex items-center gap-1.5 bg-(--md-surface)/90 backdrop-blur-sm border border-(--md-border) rounded-full px-2.5 py-1 shadow-sm" }, [
|
|
484
|
-
o("svg", {
|
|
485
|
-
class: "w-3 h-3 text-(--md-text-subtle)",
|
|
486
|
-
viewBox: "0 0 24 24",
|
|
487
|
-
fill: "none",
|
|
488
|
-
stroke: "currentColor",
|
|
489
|
-
"stroke-width": "2",
|
|
490
|
-
"stroke-linecap": "round",
|
|
491
|
-
"stroke-linejoin": "round"
|
|
492
|
-
}, [
|
|
493
|
-
o("path", { d: "M12 5v14M5 12l7-7 7 7" })
|
|
494
|
-
]),
|
|
495
|
-
o("span", { class: "text-[10px] font-medium text-(--md-text-muted)" }, "Click to insert")
|
|
496
|
-
])
|
|
497
|
-
], -1))
|
|
498
|
-
], 4),
|
|
499
|
-
w.value ? (i(), c("div", {
|
|
500
|
-
key: 0,
|
|
501
|
-
onClick: e[5] || (e[5] = G(() => {
|
|
502
|
-
}, ["stop"])),
|
|
503
|
-
class: "flex items-center gap-1.5 px-2 py-1.5"
|
|
504
|
-
}, [
|
|
505
|
-
e[14] || (e[14] = o("div", { class: "shrink-0 text-(--md-text-subtle) group-hover:text-(--md-text-muted) transition-colors cursor-grab active:cursor-grabbing" }, [
|
|
506
|
-
o("svg", {
|
|
507
|
-
class: "w-3 h-3",
|
|
508
|
-
viewBox: "0 0 16 16",
|
|
509
|
-
fill: "currentColor"
|
|
510
|
-
}, [
|
|
511
|
-
o("circle", {
|
|
512
|
-
cx: "5",
|
|
513
|
-
cy: "4",
|
|
514
|
-
r: "1.2"
|
|
515
|
-
}),
|
|
516
|
-
o("circle", {
|
|
517
|
-
cx: "11",
|
|
518
|
-
cy: "4",
|
|
519
|
-
r: "1.2"
|
|
520
|
-
}),
|
|
521
|
-
o("circle", {
|
|
522
|
-
cx: "5",
|
|
523
|
-
cy: "8",
|
|
524
|
-
r: "1.2"
|
|
525
|
-
}),
|
|
526
|
-
o("circle", {
|
|
527
|
-
cx: "11",
|
|
528
|
-
cy: "8",
|
|
529
|
-
r: "1.2"
|
|
530
|
-
}),
|
|
531
|
-
o("circle", {
|
|
532
|
-
cx: "5",
|
|
533
|
-
cy: "12",
|
|
534
|
-
r: "1.2"
|
|
535
|
-
}),
|
|
536
|
-
o("circle", {
|
|
537
|
-
cx: "11",
|
|
538
|
-
cy: "12",
|
|
539
|
-
r: "1.2"
|
|
540
|
-
})
|
|
541
|
-
])
|
|
542
|
-
], -1)),
|
|
543
|
-
F.value !== s.id ? (i(), c("span", {
|
|
544
|
-
key: 0,
|
|
545
|
-
onDblclick: G((d) => ve(s), ["stop"]),
|
|
546
|
-
onClick: e[1] || (e[1] = G(() => {
|
|
547
|
-
}, ["stop"])),
|
|
548
|
-
class: "flex-1 text-[11px] font-medium text-(--md-text-muted) truncate cursor-text"
|
|
549
|
-
}, L(s.name), 41, Ye)) : _e((i(), c("input", {
|
|
550
|
-
key: 1,
|
|
551
|
-
"onUpdate:modelValue": e[2] || (e[2] = (d) => U.value = d),
|
|
552
|
-
onBlur: (d) => ee(s.id),
|
|
553
|
-
onKeyup: [
|
|
554
|
-
le((d) => ee(s.id), ["enter"]),
|
|
555
|
-
e[3] || (e[3] = le((d) => F.value = null, ["escape"]))
|
|
556
|
-
],
|
|
557
|
-
onClick: e[4] || (e[4] = G(() => {
|
|
558
|
-
}, ["stop"])),
|
|
559
|
-
class: "flex-1 text-[11px] text-(--md-text) border border-(--md-row-selection) bg-(--md-row-selection-bg)/40 rounded-md px-1.5 py-0.5 focus:outline-none focus:border-(--md-row-selection)",
|
|
560
|
-
ref_for: !0,
|
|
561
|
-
ref_key: "renameInputRef",
|
|
562
|
-
ref: K
|
|
563
|
-
}, null, 40, Je)), [
|
|
564
|
-
[Se, U.value]
|
|
565
|
-
]),
|
|
566
|
-
o("span", Qe, L(te(s.createdAt)), 1),
|
|
567
|
-
x.value ? (i(), c("div", Xe, [
|
|
568
|
-
o("button", {
|
|
569
|
-
onClick: G((d) => fe(s.id), ["stop"]),
|
|
570
|
-
class: "hidden group-hover:flex items-center justify-center w-5 h-5 shrink-0 rounded-md text-(--md-text-subtle) hover:text-(--md-danger) hover:bg-(--md-danger-bg) transition-colors focus:outline-none"
|
|
571
|
-
}, [...e[12] || (e[12] = [
|
|
572
|
-
o("svg", {
|
|
573
|
-
class: "w-3 h-3",
|
|
574
|
-
viewBox: "0 0 24 24",
|
|
575
|
-
fill: "none",
|
|
576
|
-
stroke: "currentColor",
|
|
577
|
-
"stroke-width": "1.75",
|
|
578
|
-
"stroke-linecap": "round",
|
|
579
|
-
"stroke-linejoin": "round"
|
|
580
|
-
}, [
|
|
581
|
-
o("path", { d: "M3 6h18M8 6V4h8v2M19 6l-1 14a2 2 0 0 1-2 2H8a2 2 0 0 1-2-2L5 6" }),
|
|
582
|
-
o("path", { d: "M10 11v6M14 11v6" })
|
|
583
|
-
], -1)
|
|
584
|
-
])], 8, Ze),
|
|
585
|
-
e[13] || (e[13] = o("div", { class: "pointer-events-none absolute bottom-full right-0 mb-1.5 px-2 py-1 bg-(--md-tooltip-bg) text-(--md-tooltip-text) text-[10px] font-medium rounded-md whitespace-nowrap opacity-0 group-hover/del:opacity-100 translate-y-0.5 group-hover/del:translate-y-0 transition-all duration-150 z-50 after:content-[''] after:absolute after:top-full after:right-2 after:border-4 after:border-transparent after:border-t-(--md-tooltip-bg)" }, " Remove ", -1))
|
|
586
|
-
])) : X("", !0)
|
|
587
|
-
])) : (i(), c("div", et, [
|
|
588
|
-
o("span", tt, L(s.name), 1),
|
|
589
|
-
o("span", ot, L(te(s.createdAt)), 1)
|
|
590
|
-
]))
|
|
591
|
-
], 42, qe))), 128))
|
|
592
|
-
]),
|
|
593
|
-
_: 1
|
|
594
|
-
})
|
|
595
|
-
]))
|
|
596
|
-
])
|
|
597
|
-
])
|
|
598
|
-
])) : X("", !0)
|
|
599
|
-
]),
|
|
600
|
-
_: 1
|
|
601
|
-
}));
|
|
602
|
-
}
|
|
603
|
-
}), nt = /* @__PURE__ */ De(st, [["__scopeId", "data-v-ef885a8c"]]), lt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
604
|
-
__proto__: null,
|
|
605
|
-
default: nt
|
|
606
|
-
}, Symbol.toStringTag, { value: "Module" }));
|
|
607
|
-
export {
|
|
608
|
-
lt as S,
|
|
609
|
-
Me as _
|
|
610
|
-
};
|