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