@templatical/media-library 0.43.1 → 0.43.2
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/dist/{MediaEditModal-g37o1fP4.js → MediaEditModal-CO_AVnsB.js} +140 -100
- package/dist/{cdn/chunks/ca-B1Ig3u8O.js → ca-DyHL0z4N.js} +6 -4
- package/dist/cdn/chunks/{MediaEditModal-984aDCxg.js → MediaEditModal-BNZEUoer.js} +317 -277
- package/dist/cdn/chunks/MediaEditModal-BNZEUoer.js.map +1 -0
- package/dist/{ca-B1Ig3u8O.js → cdn/chunks/ca-DyHL0z4N.js} +8 -2
- package/dist/cdn/chunks/ca-DyHL0z4N.js.map +1 -0
- package/dist/cdn/chunks/{de-BNbyJubD.js → de-Dcy8LcNQ.js} +7 -3
- package/dist/cdn/chunks/de-Dcy8LcNQ.js.map +1 -0
- package/dist/{en-CQxhpwqd.js → cdn/chunks/en-w2ihxIL6.js} +8 -2
- package/dist/cdn/chunks/en-w2ihxIL6.js.map +1 -0
- package/dist/cdn/chunks/{es-B2EH-TdJ.js → es-B43D0gmB.js} +7 -3
- package/dist/cdn/chunks/es-B43D0gmB.js.map +1 -0
- package/dist/cdn/chunks/{fr-9SWy_n9K.js → fr-DsxaRm09.js} +7 -3
- package/dist/cdn/chunks/fr-DsxaRm09.js.map +1 -0
- package/dist/cdn/chunks/{icons-4_7522gN.js → icons-BiNngs3F.js} +6 -6
- package/dist/cdn/chunks/{icons-4_7522gN.js.map → icons-BiNngs3F.js.map} +1 -1
- package/dist/{ja-CJeeGmVQ.js → cdn/chunks/ja-DDI6z0aO.js} +8 -2
- package/dist/cdn/chunks/ja-DDI6z0aO.js.map +1 -0
- package/dist/{nl-DJasgSvI.js → cdn/chunks/nl-CHa6u0cR.js} +8 -2
- package/dist/cdn/chunks/nl-CHa6u0cR.js.map +1 -0
- package/dist/cdn/chunks/{pt-BR-BtCfbqSj.js → pt-BR-CZmeAVC3.js} +7 -3
- package/dist/cdn/chunks/pt-BR-CZmeAVC3.js.map +1 -0
- package/dist/cdn/chunks/{useFocusTrap-5U5Mu8Hj.js → useFocusTrap-DlOYUC75.js} +14 -13
- package/dist/cdn/chunks/useFocusTrap-DlOYUC75.js.map +1 -0
- package/dist/cdn/media-library.css +1 -1
- package/dist/cdn/media-library.js +488 -449
- package/dist/cdn/media-library.js.map +1 -1
- package/dist/{de-BNbyJubD.js → de-Dcy8LcNQ.js} +6 -2
- package/dist/{cdn/chunks/en-CQxhpwqd.js → en-w2ihxIL6.js} +6 -4
- package/dist/{es-B2EH-TdJ.js → es-B43D0gmB.js} +6 -2
- package/dist/{fr-9SWy_n9K.js → fr-DsxaRm09.js} +6 -2
- package/dist/index.d.ts +8 -2
- package/dist/{cdn/chunks/ja-CJeeGmVQ.js → ja-DDI6z0aO.js} +6 -4
- package/dist/{cdn/chunks/nl-DJasgSvI.js → nl-CHa6u0cR.js} +6 -4
- package/dist/{pt-BR-BtCfbqSj.js → pt-BR-CZmeAVC3.js} +6 -2
- package/dist/templatical-media-library.css +1 -1
- package/dist/templatical-media-library.js +426 -387
- package/dist/{useFocusTrap-6eIRXtCA.js → useFocusTrap-CIacOa9R.js} +12 -11
- package/package.json +3 -3
- package/dist/cdn/chunks/MediaEditModal-984aDCxg.js.map +0 -1
- package/dist/cdn/chunks/ca-B1Ig3u8O.js.map +0 -1
- package/dist/cdn/chunks/de-BNbyJubD.js.map +0 -1
- package/dist/cdn/chunks/en-CQxhpwqd.js.map +0 -1
- package/dist/cdn/chunks/es-B2EH-TdJ.js.map +0 -1
- package/dist/cdn/chunks/fr-9SWy_n9K.js.map +0 -1
- package/dist/cdn/chunks/ja-CJeeGmVQ.js.map +0 -1
- package/dist/cdn/chunks/nl-DJasgSvI.js.map +0 -1
- package/dist/cdn/chunks/pt-BR-BtCfbqSj.js.map +0 -1
- package/dist/cdn/chunks/useFocusTrap-5U5Mu8Hj.js.map +0 -1
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { A as e, B as t, C as n, D as r, E as i, F as a, H as o, J as s, K as c, L as l, M as u, N as d, O as f, P as p, R as m, T as h, U as g, W as _, X as v, Z as y, _ as b, a as x, b as S, c as C, ct as w, d as T, dt as E, f as D, g as O, h as k, i as A, j, k as M, l as N, lt as P, m as F, n as I, nt as L, o as R, ot as
|
|
2
|
-
import { a as
|
|
1
|
+
import { A as e, B as t, C as n, D as r, E as i, F as a, H as o, J as s, K as c, L as l, M as u, N as d, O as f, P as p, R as m, T as h, U as g, W as _, X as v, Z as y, _ as b, a as x, b as S, c as C, ct as w, d as T, dt as E, f as D, g as O, h as k, i as A, j, k as M, l as N, lt as P, m as F, n as I, nt as L, o as R, ot as ee, p as te, r as ne, s as z, st as re, t as ie, u as B, ut as V, v as H, w as U, x as W, y as G } from "./chunks/icons-BiNngs3F.js";
|
|
2
|
+
import { a as ae, c as oe, d as se, f as K, h as q, i as ce, l as J, m as Y, n as le, o as X, p as ue, r as de, s as fe, t as pe, u as Z } from "./chunks/useFocusTrap-DlOYUC75.js";
|
|
3
3
|
//#region src/components/media/MediaBreadcrumb.vue?vue&type=script&setup=true&lang.ts
|
|
4
|
-
var
|
|
4
|
+
var me = {
|
|
5
5
|
key: 0,
|
|
6
6
|
class: "tpl:flex tpl:items-center tpl:gap-1 tpl:text-xs",
|
|
7
7
|
style: { color: "var(--tpl-text-muted)" }
|
|
8
|
-
},
|
|
8
|
+
}, he = ["onClick"], ge = {
|
|
9
9
|
key: 1,
|
|
10
10
|
style: { color: "var(--tpl-text)" }
|
|
11
|
-
},
|
|
11
|
+
}, _e = /* @__PURE__ */ a({
|
|
12
12
|
__name: "MediaBreadcrumb",
|
|
13
13
|
props: {
|
|
14
14
|
folders: {},
|
|
@@ -16,7 +16,7 @@ var pe = {
|
|
|
16
16
|
},
|
|
17
17
|
emits: ["navigate"],
|
|
18
18
|
setup(t, { emit: n }) {
|
|
19
|
-
let i = t, a = n, { t: s } =
|
|
19
|
+
let i = t, a = n, { t: s } = Z(), c = r(() => {
|
|
20
20
|
if (!i.currentFolderId) return [];
|
|
21
21
|
let e = [];
|
|
22
22
|
return l(i.folders, i.currentFolderId, e), e;
|
|
@@ -28,7 +28,7 @@ var pe = {
|
|
|
28
28
|
}
|
|
29
29
|
return !1;
|
|
30
30
|
}
|
|
31
|
-
return (t, n) => c.value.length > 0 ? (o(), j("div",
|
|
31
|
+
return (t, n) => c.value.length > 0 ? (o(), j("div", me, [f("button", {
|
|
32
32
|
class: "tpl:transition-colors tpl:duration-150 tpl:hover:underline",
|
|
33
33
|
style: { color: "var(--tpl-primary)" },
|
|
34
34
|
onClick: n[0] ||= (e) => a("navigate", null)
|
|
@@ -40,15 +40,15 @@ var pe = {
|
|
|
40
40
|
class: "tpl:transition-colors tpl:duration-150 tpl:hover:underline",
|
|
41
41
|
style: { color: "var(--tpl-primary)" },
|
|
42
42
|
onClick: (t) => a("navigate", e.id)
|
|
43
|
-
}, E(e.name), 9,
|
|
43
|
+
}, E(e.name), 9, he)) : (o(), j("span", ge, E(e.name), 1))], 64))), 128))])) : e("", !0);
|
|
44
44
|
}
|
|
45
|
-
}),
|
|
45
|
+
}), ve = ["aria-expanded", "aria-label"], ye = {
|
|
46
46
|
key: 1,
|
|
47
47
|
class: "tpl:size-4 tpl:shrink-0"
|
|
48
|
-
},
|
|
48
|
+
}, be = {
|
|
49
49
|
key: 0,
|
|
50
50
|
class: "tpl:truncate"
|
|
51
|
-
},
|
|
51
|
+
}, xe = ["onKeydown"], Se = ["title", "aria-label"], Ce = ["title", "aria-label"], we = ["title", "aria-label"], Te = { key: 0 }, Ee = ["placeholder", "onKeydown"], De = /* @__PURE__ */ a({
|
|
52
52
|
__name: "MediaFolderTreeNode",
|
|
53
53
|
props: {
|
|
54
54
|
folder: {},
|
|
@@ -65,7 +65,7 @@ var pe = {
|
|
|
65
65
|
"deleteFolder"
|
|
66
66
|
],
|
|
67
67
|
setup(t, { emit: i }) {
|
|
68
|
-
let a = t, s = i, { t: l } =
|
|
68
|
+
let a = t, s = i, { t: l } = Z(), u = L(!1), p = L(!1), m = L(""), g = L(!1), v = L(""), x = L(!1), S = r(() => a.folder.children.length > 0), T = r(() => a.depth < 4), D = r(() => a.currentFolderId === a.folder.id), O = r(() => a.currentFolderId ? A(a.folder.children, a.currentFolderId) : !1), k = r(() => u.value || O.value);
|
|
69
69
|
function A(e, t) {
|
|
70
70
|
for (let n of e) if (n.id === t || A(n.children, t)) return !0;
|
|
71
71
|
return !1;
|
|
@@ -80,26 +80,26 @@ var pe = {
|
|
|
80
80
|
let e = m.value.trim();
|
|
81
81
|
e && e !== a.folder.name && s("renameFolder", a.folder.id, e), p.value = !1, m.value = "";
|
|
82
82
|
}
|
|
83
|
-
function
|
|
83
|
+
function ee() {
|
|
84
84
|
p.value = !1, m.value = "";
|
|
85
85
|
}
|
|
86
|
-
function
|
|
86
|
+
function te() {
|
|
87
87
|
g.value = !0, v.value = "", u.value = !0;
|
|
88
88
|
}
|
|
89
|
-
function
|
|
89
|
+
function re() {
|
|
90
90
|
v.value.trim() && s("createFolder", v.value.trim(), a.folder.id), g.value = !1, v.value = "";
|
|
91
91
|
}
|
|
92
|
-
function
|
|
92
|
+
function ie() {
|
|
93
93
|
g.value = !1, v.value = "";
|
|
94
94
|
}
|
|
95
|
-
function
|
|
95
|
+
function B() {
|
|
96
96
|
if (x.value) {
|
|
97
97
|
s("deleteFolder", a.folder.id), x.value = !1;
|
|
98
98
|
return;
|
|
99
99
|
}
|
|
100
100
|
x.value = !0;
|
|
101
101
|
}
|
|
102
|
-
function
|
|
102
|
+
function H(e) {
|
|
103
103
|
let t = e.relatedTarget;
|
|
104
104
|
t && e.currentTarget.contains(t) || (x.value = !1);
|
|
105
105
|
}
|
|
@@ -107,12 +107,12 @@ var pe = {
|
|
|
107
107
|
let a = c("MediaFolderTreeNode", !0);
|
|
108
108
|
return o(), j("div", null, [f("div", {
|
|
109
109
|
class: "tpl:group tpl:flex tpl:w-full tpl:items-center tpl:gap-1 tpl:py-1.5 tpl:pr-2 tpl:text-left tpl:text-xs tpl:transition-all tpl:duration-150",
|
|
110
|
-
style:
|
|
110
|
+
style: V({
|
|
111
111
|
paddingLeft: `${t.depth * 16 + 8}px`,
|
|
112
112
|
backgroundColor: D.value ? "var(--tpl-bg-active)" : "transparent",
|
|
113
113
|
color: D.value ? "var(--tpl-primary)" : "var(--tpl-text)"
|
|
114
114
|
}),
|
|
115
|
-
onFocusout:
|
|
115
|
+
onFocusout: H
|
|
116
116
|
}, [
|
|
117
117
|
S.value || g.value ? (o(), j("button", {
|
|
118
118
|
key: 0,
|
|
@@ -120,12 +120,12 @@ var pe = {
|
|
|
120
120
|
class: "tpl:flex tpl:size-4 tpl:shrink-0 tpl:items-center tpl:justify-center tpl:rounded tpl:transition-colors",
|
|
121
121
|
"aria-expanded": k.value,
|
|
122
122
|
"aria-label": k.value ? w(l).mediaLibrary.collapseFolder : w(l).mediaLibrary.expandFolder,
|
|
123
|
-
onClick:
|
|
123
|
+
onClick: U(N, ["stop"])
|
|
124
124
|
}, [d(w(b), {
|
|
125
125
|
class: P(["tpl:transition-transform tpl:duration-150", { "tpl:rotate-90": k.value }]),
|
|
126
126
|
size: 10,
|
|
127
127
|
"stroke-width": 2
|
|
128
|
-
}, null, 8, ["class"])], 8,
|
|
128
|
+
}, null, 8, ["class"])], 8, ve)) : (o(), j("span", ye)),
|
|
129
129
|
f("button", {
|
|
130
130
|
type: "button",
|
|
131
131
|
class: "tpl:flex tpl:min-w-0 tpl:flex-1 tpl:items-center tpl:gap-1.5",
|
|
@@ -134,7 +134,7 @@ var pe = {
|
|
|
134
134
|
class: "tpl:shrink-0",
|
|
135
135
|
size: 14,
|
|
136
136
|
"stroke-width": 1.5
|
|
137
|
-
}), p.value ? e("", !0) : (o(), j("span",
|
|
137
|
+
}), p.value ? e("", !0) : (o(), j("span", be, E(t.folder.name), 1))]),
|
|
138
138
|
p.value ? y((o(), j("input", {
|
|
139
139
|
key: 2,
|
|
140
140
|
"onUpdate:modelValue": i[1] ||= (e) => m.value = e,
|
|
@@ -146,10 +146,10 @@ var pe = {
|
|
|
146
146
|
color: "var(--tpl-text)"
|
|
147
147
|
},
|
|
148
148
|
autofocus: "",
|
|
149
|
-
onKeydown: [n(R, ["enter"]), n(
|
|
149
|
+
onKeydown: [n(R, ["enter"]), n(U(ee, ["stop"]), ["escape"])],
|
|
150
150
|
onBlur: R,
|
|
151
|
-
onClick: i[2] ||=
|
|
152
|
-
}, null, 40,
|
|
151
|
+
onClick: i[2] ||= U(() => {}, ["stop"])
|
|
152
|
+
}, null, 40, xe)), [[W, m.value]]) : e("", !0),
|
|
153
153
|
p.value ? e("", !0) : (o(), j("span", {
|
|
154
154
|
key: 3,
|
|
155
155
|
class: P(["tpl:flex tpl:shrink-0 tpl:items-center tpl:gap-0.5 tpl:transition-opacity", D.value || x.value ? "tpl:opacity-100" : "tpl:opacity-0 tpl:group-hover:opacity-100 tpl:group-focus-within:opacity-100"])
|
|
@@ -160,22 +160,22 @@ var pe = {
|
|
|
160
160
|
class: "tpl:flex tpl:size-6 tpl:items-center tpl:justify-center tpl:rounded tpl:transition-colors",
|
|
161
161
|
title: w(l).mediaLibrary.addSubfolder,
|
|
162
162
|
"aria-label": w(l).mediaLibrary.addSubfolder,
|
|
163
|
-
onClick:
|
|
164
|
-
}, [d(w(
|
|
163
|
+
onClick: U(te, ["stop"])
|
|
164
|
+
}, [d(w(z), {
|
|
165
165
|
size: 12,
|
|
166
166
|
"stroke-width": 2
|
|
167
|
-
})], 8,
|
|
167
|
+
})], 8, Se)) : e("", !0),
|
|
168
168
|
t.canRenameFolder ? (o(), j("button", {
|
|
169
169
|
key: 1,
|
|
170
170
|
type: "button",
|
|
171
171
|
class: "tpl:flex tpl:size-6 tpl:items-center tpl:justify-center tpl:rounded tpl:transition-colors",
|
|
172
172
|
title: w(l).mediaLibrary.renameFolder,
|
|
173
173
|
"aria-label": w(l).mediaLibrary.renameFolder,
|
|
174
|
-
onClick:
|
|
174
|
+
onClick: U(I, ["stop"])
|
|
175
175
|
}, [d(w(C), {
|
|
176
176
|
size: 12,
|
|
177
177
|
"stroke-width": 2
|
|
178
|
-
})], 8,
|
|
178
|
+
})], 8, Ce)) : e("", !0),
|
|
179
179
|
t.canDeleteFolder ? (o(), j("button", {
|
|
180
180
|
key: 2,
|
|
181
181
|
type: "button",
|
|
@@ -183,14 +183,14 @@ var pe = {
|
|
|
183
183
|
class: "tpl:flex tpl:size-6 tpl:items-center tpl:justify-center tpl:rounded tpl:transition-colors",
|
|
184
184
|
title: x.value ? w(l).mediaLibrary.deleteFolderConfirm : w(l).mediaLibrary.deleteFolder,
|
|
185
185
|
"aria-label": x.value ? w(l).mediaLibrary.deleteFolderConfirm : w(l).mediaLibrary.deleteFolder,
|
|
186
|
-
onClick:
|
|
187
|
-
}, [d(w(
|
|
186
|
+
onClick: U(B, ["stop"])
|
|
187
|
+
}, [d(w(ne), {
|
|
188
188
|
size: 12,
|
|
189
189
|
"stroke-width": 2,
|
|
190
190
|
style: { color: "var(--tpl-danger)" }
|
|
191
|
-
})], 8,
|
|
191
|
+
})], 8, we)) : e("", !0)
|
|
192
192
|
], 2))
|
|
193
|
-
], 36), k.value ? (o(), j("div",
|
|
193
|
+
], 36), k.value ? (o(), j("div", Te, [(o(!0), j(h, null, _(t.folder.children, (e) => (o(), M(a, {
|
|
194
194
|
key: e.id,
|
|
195
195
|
folder: e,
|
|
196
196
|
"current-folder-id": t.currentFolderId,
|
|
@@ -211,7 +211,7 @@ var pe = {
|
|
|
211
211
|
"can-delete-folder"
|
|
212
212
|
]))), 128)), g.value ? (o(), j("div", {
|
|
213
213
|
key: 0,
|
|
214
|
-
style:
|
|
214
|
+
style: V({ paddingLeft: `${(t.depth + 1) * 16 + 8}px` }),
|
|
215
215
|
class: "tpl:py-1.5 tpl:pr-2"
|
|
216
216
|
}, [y(f("input", {
|
|
217
217
|
"onUpdate:modelValue": i[7] ||= (e) => v.value = e,
|
|
@@ -224,18 +224,18 @@ var pe = {
|
|
|
224
224
|
},
|
|
225
225
|
placeholder: w(l).mediaLibrary.subfolderName,
|
|
226
226
|
autofocus: "",
|
|
227
|
-
onKeydown: [n(
|
|
228
|
-
onBlur:
|
|
229
|
-
}, null, 40,
|
|
227
|
+
onKeydown: [n(re, ["enter"]), n(U(ie, ["stop"]), ["escape"])],
|
|
228
|
+
onBlur: re
|
|
229
|
+
}, null, 40, Ee), [[W, v.value]])], 4)) : e("", !0)])) : e("", !0)]);
|
|
230
230
|
};
|
|
231
231
|
}
|
|
232
|
-
}),
|
|
232
|
+
}), Oe = {
|
|
233
233
|
"data-testid": "media-folder-tree",
|
|
234
234
|
class: "tpl:flex tpl:h-full tpl:flex-col tpl:overflow-y-auto"
|
|
235
|
-
},
|
|
235
|
+
}, ke = {
|
|
236
236
|
key: 0,
|
|
237
237
|
class: "tpl:px-3 tpl:py-2"
|
|
238
|
-
},
|
|
238
|
+
}, Ae = ["placeholder", "onKeydown"], je = /* @__PURE__ */ a({
|
|
239
239
|
__name: "MediaFolderTree",
|
|
240
240
|
props: {
|
|
241
241
|
folders: {},
|
|
@@ -254,7 +254,7 @@ var pe = {
|
|
|
254
254
|
"showFrequentlyUsed"
|
|
255
255
|
],
|
|
256
256
|
setup(t, { emit: r }) {
|
|
257
|
-
let i = r, { t: a } =
|
|
257
|
+
let i = r, { t: a } = Z(), s = L(!1), c = L("");
|
|
258
258
|
function l() {
|
|
259
259
|
s.value = !0, c.value = "";
|
|
260
260
|
}
|
|
@@ -264,10 +264,10 @@ var pe = {
|
|
|
264
264
|
function m() {
|
|
265
265
|
s.value = !1, c.value = "";
|
|
266
266
|
}
|
|
267
|
-
return (r, g) => (o(), j("div",
|
|
267
|
+
return (r, g) => (o(), j("div", Oe, [
|
|
268
268
|
f("button", {
|
|
269
269
|
class: "tpl:flex tpl:w-full tpl:items-center tpl:gap-2 tpl:px-3 tpl:py-2 tpl:text-left tpl:text-xs tpl:font-medium tpl:transition-all tpl:duration-150",
|
|
270
|
-
style:
|
|
270
|
+
style: V({
|
|
271
271
|
backgroundColor: t.viewMode === "files" && t.currentFolderId === null ? "var(--tpl-bg-active)" : "transparent",
|
|
272
272
|
color: t.viewMode === "files" && t.currentFolderId === null ? "var(--tpl-primary)" : "var(--tpl-text)"
|
|
273
273
|
}),
|
|
@@ -276,7 +276,7 @@ var pe = {
|
|
|
276
276
|
size: 14,
|
|
277
277
|
"stroke-width": 1.5
|
|
278
278
|
}), u(" " + E(w(a).mediaLibrary.allFiles), 1)], 4),
|
|
279
|
-
(o(!0), j(h, null, _(t.folders, (e) => (o(), M(
|
|
279
|
+
(o(!0), j(h, null, _(t.folders, (e) => (o(), M(De, {
|
|
280
280
|
key: e.id,
|
|
281
281
|
folder: e,
|
|
282
282
|
"current-folder-id": t.currentFolderId,
|
|
@@ -295,7 +295,7 @@ var pe = {
|
|
|
295
295
|
"can-rename-folder",
|
|
296
296
|
"can-delete-folder"
|
|
297
297
|
]))), 128)),
|
|
298
|
-
s.value ? (o(), j("div",
|
|
298
|
+
s.value ? (o(), j("div", ke, [y(f("input", {
|
|
299
299
|
"onUpdate:modelValue": g[5] ||= (e) => c.value = e,
|
|
300
300
|
type: "text",
|
|
301
301
|
class: "tpl:w-full tpl:rounded tpl:border tpl:px-2 tpl:py-1 tpl:text-xs tpl:outline-none",
|
|
@@ -306,15 +306,15 @@ var pe = {
|
|
|
306
306
|
},
|
|
307
307
|
placeholder: w(a).mediaLibrary.folderName,
|
|
308
308
|
autofocus: "",
|
|
309
|
-
onKeydown: [n(p, ["enter"]), n(
|
|
309
|
+
onKeydown: [n(p, ["enter"]), n(U(m, ["stop"]), ["escape"])],
|
|
310
310
|
onBlur: p
|
|
311
|
-
}, null, 40,
|
|
311
|
+
}, null, 40, Ae), [[W, c.value]])])) : e("", !0),
|
|
312
312
|
!s.value && t.canCreateFolder ? (o(), j("button", {
|
|
313
313
|
key: 1,
|
|
314
314
|
class: "tpl:flex tpl:w-full tpl:items-center tpl:gap-2 tpl:px-3 tpl:py-2 tpl:text-left tpl:text-xs tpl:transition-all tpl:duration-150",
|
|
315
315
|
style: { color: "var(--tpl-text-muted)" },
|
|
316
316
|
onClick: l
|
|
317
|
-
}, [d(w(
|
|
317
|
+
}, [d(w(z), {
|
|
318
318
|
size: 14,
|
|
319
319
|
"stroke-width": 1.5
|
|
320
320
|
}), u(" " + E(w(a).mediaLibrary.newFolder), 1)])) : e("", !0),
|
|
@@ -323,7 +323,7 @@ var pe = {
|
|
|
323
323
|
key: 2,
|
|
324
324
|
"data-testid": "media-frequently-used",
|
|
325
325
|
class: "tpl:flex tpl:w-full tpl:items-center tpl:gap-2 tpl:border-t tpl:px-3 tpl:py-2 tpl:text-left tpl:text-xs tpl:font-medium tpl:transition-all tpl:duration-150",
|
|
326
|
-
style:
|
|
326
|
+
style: V({
|
|
327
327
|
borderColor: "var(--tpl-border)",
|
|
328
328
|
backgroundColor: t.viewMode === "frequently-used" ? "var(--tpl-bg-active)" : "transparent",
|
|
329
329
|
color: t.viewMode === "frequently-used" ? "var(--tpl-primary)" : "var(--tpl-text)"
|
|
@@ -335,7 +335,7 @@ var pe = {
|
|
|
335
335
|
}), u(" " + E(w(a).mediaLibrary.frequentlyUsed), 1)], 4)) : e("", !0)
|
|
336
336
|
]));
|
|
337
337
|
}
|
|
338
|
-
}),
|
|
338
|
+
}), Me = /* @__PURE__ */ a({
|
|
339
339
|
__name: "MediaFileIcon",
|
|
340
340
|
props: { mimeType: {} },
|
|
341
341
|
setup(e) {
|
|
@@ -438,7 +438,7 @@ var pe = {
|
|
|
438
438
|
}, a = r(() => n[t.mimeType] ?? i);
|
|
439
439
|
return (e, t) => (o(), j("div", {
|
|
440
440
|
class: "tpl:flex tpl:aspect-square tpl:flex-col tpl:items-center tpl:justify-center tpl:gap-2",
|
|
441
|
-
style:
|
|
441
|
+
style: V({ backgroundColor: a.value.bgColor })
|
|
442
442
|
}, [a.value.icon === "document" ? (o(), j("svg", {
|
|
443
443
|
key: 0,
|
|
444
444
|
width: "60",
|
|
@@ -447,7 +447,7 @@ var pe = {
|
|
|
447
447
|
fill: "none",
|
|
448
448
|
stroke: "currentColor",
|
|
449
449
|
"stroke-width": "1.5",
|
|
450
|
-
style:
|
|
450
|
+
style: V({ color: a.value.color })
|
|
451
451
|
}, [...t[0] ||= [
|
|
452
452
|
f("path", { d: "M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z" }, null, -1),
|
|
453
453
|
f("polyline", { points: "14 2 14 8 20 8" }, null, -1),
|
|
@@ -471,7 +471,7 @@ var pe = {
|
|
|
471
471
|
fill: "none",
|
|
472
472
|
stroke: "currentColor",
|
|
473
473
|
"stroke-width": "1.5",
|
|
474
|
-
style:
|
|
474
|
+
style: V({ color: a.value.color })
|
|
475
475
|
}, [...t[1] ||= [f("rect", {
|
|
476
476
|
x: "2",
|
|
477
477
|
y: "4",
|
|
@@ -490,7 +490,7 @@ var pe = {
|
|
|
490
490
|
fill: "none",
|
|
491
491
|
stroke: "currentColor",
|
|
492
492
|
"stroke-width": "1.5",
|
|
493
|
-
style:
|
|
493
|
+
style: V({ color: a.value.color })
|
|
494
494
|
}, [...t[2] ||= [
|
|
495
495
|
f("path", { d: "M9 18V5l12-2v13" }, null, -1),
|
|
496
496
|
f("circle", {
|
|
@@ -505,13 +505,13 @@ var pe = {
|
|
|
505
505
|
}, null, -1)
|
|
506
506
|
]], 4)), f("span", {
|
|
507
507
|
class: "tpl:text-xs tpl:font-bold tpl:tracking-wider",
|
|
508
|
-
style:
|
|
508
|
+
style: V({ color: a.value.color })
|
|
509
509
|
}, E(a.value.label), 5)], 4));
|
|
510
510
|
}
|
|
511
511
|
});
|
|
512
512
|
//#endregion
|
|
513
513
|
//#region src/utils/formatAbsoluteDate.ts
|
|
514
|
-
function
|
|
514
|
+
function Ne(e, t, n) {
|
|
515
515
|
let r = new Date(e);
|
|
516
516
|
if (Number.isNaN(r.getTime())) return "";
|
|
517
517
|
let i = t?.trim().replace(/_/g, "-") || void 0;
|
|
@@ -522,35 +522,48 @@ function Me(e, t, n) {
|
|
|
522
522
|
}
|
|
523
523
|
}
|
|
524
524
|
//#endregion
|
|
525
|
+
//#region src/utils/formatFileSize.ts
|
|
526
|
+
var Pe = [
|
|
527
|
+
"B",
|
|
528
|
+
"KB",
|
|
529
|
+
"MB",
|
|
530
|
+
"GB"
|
|
531
|
+
];
|
|
532
|
+
function Q(e) {
|
|
533
|
+
let t = e, n = 0;
|
|
534
|
+
for (; t >= 1024 && n < Pe.length - 1;) t /= 1024, n += 1;
|
|
535
|
+
return `${Math.round(t * 10) / 10} ${Pe[n]}`;
|
|
536
|
+
}
|
|
537
|
+
//#endregion
|
|
525
538
|
//#region src/components/media/MediaGrid.vue?vue&type=script&setup=true&lang.ts
|
|
526
|
-
var
|
|
539
|
+
var Fe = { class: "tpl:p-4" }, Ie = ["aria-label"], Le = {
|
|
527
540
|
key: 1,
|
|
528
541
|
class: "tpl:flex tpl:flex-col tpl:items-center tpl:justify-center tpl:py-16"
|
|
529
|
-
},
|
|
542
|
+
}, Re = {
|
|
530
543
|
class: "tpl:text-xs",
|
|
531
544
|
style: { color: "var(--tpl-text-muted)" }
|
|
532
|
-
},
|
|
545
|
+
}, ze = ["aria-label"], Be = [
|
|
533
546
|
"data-media-id",
|
|
534
547
|
"aria-selected",
|
|
535
548
|
"aria-label",
|
|
536
549
|
"onClick",
|
|
537
550
|
"onDblclick",
|
|
538
551
|
"onKeydown"
|
|
539
|
-
],
|
|
552
|
+
], Ve = { class: "tpl:aspect-square" }, He = ["src", "alt"], Ue = { class: "tpl:px-2 tpl:py-1.5" }, We = {
|
|
540
553
|
class: "tpl:truncate tpl:text-[10px] tpl:font-medium",
|
|
541
554
|
style: { color: "var(--tpl-text)" }
|
|
542
|
-
},
|
|
555
|
+
}, Ge = {
|
|
543
556
|
class: "tpl:flex tpl:justify-between tpl:text-[10px]",
|
|
544
557
|
style: { color: "var(--tpl-text-muted)" }
|
|
545
|
-
},
|
|
558
|
+
}, Ke = { key: 0 }, qe = { key: 1 }, Je = [
|
|
546
559
|
"title",
|
|
547
560
|
"aria-label",
|
|
548
561
|
"onClick"
|
|
549
|
-
],
|
|
562
|
+
], Ye = [
|
|
550
563
|
"title",
|
|
551
564
|
"aria-label",
|
|
552
565
|
"onClick"
|
|
553
|
-
],
|
|
566
|
+
], Xe = {
|
|
554
567
|
key: 0,
|
|
555
568
|
"aria-hidden": "true",
|
|
556
569
|
class: "tpl:absolute tpl:top-1.5 tpl:right-1.5 tpl:flex tpl:size-5 tpl:items-center tpl:justify-center tpl:rounded-full",
|
|
@@ -558,34 +571,34 @@ var Ne = { class: "tpl:p-4" }, Pe = ["aria-label"], Fe = {
|
|
|
558
571
|
"background-color": "var(--tpl-primary)",
|
|
559
572
|
color: "var(--tpl-on-primary)"
|
|
560
573
|
}
|
|
561
|
-
},
|
|
574
|
+
}, Ze = ["aria-label"], Qe = [
|
|
562
575
|
"data-media-id",
|
|
563
576
|
"aria-selected",
|
|
564
577
|
"aria-label",
|
|
565
578
|
"onClick",
|
|
566
579
|
"onDblclick",
|
|
567
580
|
"onKeydown"
|
|
568
|
-
],
|
|
581
|
+
], $e = {
|
|
569
582
|
class: "tpl:size-10 tpl:shrink-0 tpl:overflow-hidden tpl:rounded",
|
|
570
583
|
style: { "background-color": "var(--tpl-bg-hover)" }
|
|
571
|
-
},
|
|
584
|
+
}, et = ["src", "alt"], tt = {
|
|
572
585
|
key: 1,
|
|
573
586
|
class: "tpl-list-icon tpl:size-full"
|
|
574
|
-
},
|
|
587
|
+
}, nt = { class: "tpl:min-w-0 tpl:flex-1" }, rt = {
|
|
575
588
|
class: "tpl:truncate tpl:text-xs tpl:font-medium",
|
|
576
589
|
style: { color: "var(--tpl-text)" }
|
|
577
|
-
},
|
|
590
|
+
}, it = {
|
|
578
591
|
class: "tpl:text-[10px]",
|
|
579
592
|
style: { color: "var(--tpl-text-muted)" }
|
|
580
|
-
},
|
|
593
|
+
}, at = [
|
|
581
594
|
"title",
|
|
582
595
|
"aria-label",
|
|
583
596
|
"onClick"
|
|
584
|
-
],
|
|
597
|
+
], ot = [
|
|
585
598
|
"title",
|
|
586
599
|
"aria-label",
|
|
587
600
|
"onClick"
|
|
588
|
-
],
|
|
601
|
+
], st = {
|
|
589
602
|
key: 0,
|
|
590
603
|
"aria-hidden": "true",
|
|
591
604
|
class: "tpl:flex tpl:size-5 tpl:shrink-0 tpl:items-center tpl:justify-center tpl:rounded-full",
|
|
@@ -593,10 +606,10 @@ var Ne = { class: "tpl:p-4" }, Pe = ["aria-label"], Fe = {
|
|
|
593
606
|
"background-color": "var(--tpl-primary)",
|
|
594
607
|
color: "var(--tpl-on-primary)"
|
|
595
608
|
}
|
|
596
|
-
},
|
|
609
|
+
}, ct = {
|
|
597
610
|
key: 4,
|
|
598
611
|
class: "tpl:flex tpl:justify-center tpl:py-4"
|
|
599
|
-
},
|
|
612
|
+
}, lt = /*#__PURE__*/ le(/* @__PURE__ */ a({
|
|
600
613
|
__name: "MediaGrid",
|
|
601
614
|
props: {
|
|
602
615
|
items: {},
|
|
@@ -618,7 +631,7 @@ var Ne = { class: "tpl:p-4" }, Pe = ["aria-label"], Fe = {
|
|
|
618
631
|
"confirm"
|
|
619
632
|
],
|
|
620
633
|
setup(t, { emit: n }) {
|
|
621
|
-
let r = t, i = n, { isAcceptedMimeType: a, isImageMimeType: s } =
|
|
634
|
+
let r = t, i = n, { isAcceptedMimeType: a, isImageMimeType: s } = J();
|
|
622
635
|
function c(e) {
|
|
623
636
|
return e.mimeType ?? "";
|
|
624
637
|
}
|
|
@@ -653,21 +666,18 @@ var Ne = { class: "tpl:p-4" }, Pe = ["aria-label"], Fe = {
|
|
|
653
666
|
function T(e) {
|
|
654
667
|
return S(e) ? "tpl:opacity-100" : "tpl:opacity-0 tpl:group-hover:opacity-100 tpl:group-focus-within:opacity-100";
|
|
655
668
|
}
|
|
656
|
-
let { t: D } =
|
|
657
|
-
|
|
669
|
+
let { t: D } = Z(), O = m(Y, null), A = L(null);
|
|
670
|
+
fe(A, ([{ isIntersecting: e }]) => {
|
|
658
671
|
e && r.hasMore && !r.isLoading && i("loadMore");
|
|
659
672
|
}, { threshold: .1 });
|
|
660
673
|
function N(e) {
|
|
661
|
-
return
|
|
662
|
-
}
|
|
663
|
-
function F(e) {
|
|
664
|
-
return Me(e, O?.value, {
|
|
674
|
+
return Ne(e, O?.value, {
|
|
665
675
|
year: "numeric",
|
|
666
676
|
month: "short",
|
|
667
677
|
day: "numeric"
|
|
668
678
|
});
|
|
669
679
|
}
|
|
670
|
-
return (n, r) => (o(), j("div",
|
|
680
|
+
return (n, r) => (o(), j("div", Fe, [
|
|
671
681
|
t.isLoading && t.items.length === 0 ? (o(), j("div", {
|
|
672
682
|
key: 0,
|
|
673
683
|
role: "status",
|
|
@@ -679,12 +689,12 @@ var Ne = { class: "tpl:p-4" }, Pe = ["aria-label"], Fe = {
|
|
|
679
689
|
class: P(["tpl-pulse tpl:rounded-lg", t.layout === "list" ? "tpl:h-12" : "tpl:aspect-square"]),
|
|
680
690
|
style: { "background-color": "var(--tpl-bg-hover)" },
|
|
681
691
|
"aria-hidden": "true"
|
|
682
|
-
}, null, 2)), 64))], 10,
|
|
692
|
+
}, null, 2)), 64))], 10, Ie)) : t.items.length === 0 ? (o(), j("div", Le, [d(w(k), {
|
|
683
693
|
class: "tpl:mb-3",
|
|
684
694
|
size: 40,
|
|
685
695
|
"stroke-width": 1,
|
|
686
696
|
style: { color: "var(--tpl-text-dim)" }
|
|
687
|
-
}), f("p",
|
|
697
|
+
}), f("p", Re, E(t.searchQuery ? w(D).mediaLibrary.noSearchResults : w(D).mediaLibrary.noFiles), 1)])) : t.layout === "list" ? (o(), j("div", {
|
|
688
698
|
key: 3,
|
|
689
699
|
role: "listbox",
|
|
690
700
|
"aria-label": w(D).mediaLibrary.filesListAriaLabel,
|
|
@@ -699,21 +709,21 @@ var Ne = { class: "tpl:p-4" }, Pe = ["aria-label"], Fe = {
|
|
|
699
709
|
"data-media-id": t.id,
|
|
700
710
|
"aria-selected": S(t),
|
|
701
711
|
"aria-label": t.filename || t.url,
|
|
702
|
-
style:
|
|
712
|
+
style: V({ backgroundColor: S(t) ? "var(--tpl-bg-hover)" : "transparent" }),
|
|
703
713
|
onClick: (e) => y(t, e),
|
|
704
714
|
onDblclick: (e) => b(t),
|
|
705
715
|
onKeydown: (e) => x(t, e)
|
|
706
716
|
}, [
|
|
707
|
-
f("div",
|
|
717
|
+
f("div", $e, [w(s)(c(t)) ? (o(), j("img", {
|
|
708
718
|
key: 0,
|
|
709
719
|
src: l(t),
|
|
710
720
|
alt: t.filename || t.url,
|
|
711
721
|
class: "tpl:size-full tpl:object-cover",
|
|
712
722
|
loading: "lazy"
|
|
713
|
-
}, null, 8,
|
|
714
|
-
f("div",
|
|
715
|
-
t.size == null ? e("", !0) : (o(), j(h, { key: 0 }, [u(E(
|
|
716
|
-
t.createdAt ? (o(), j(h, { key: 1 }, [t.size == null ? e("", !0) : (o(), j(h, { key: 0 }, [u(" · ")], 64)), u(" " + E(
|
|
723
|
+
}, null, 8, et)) : (o(), j("div", tt, [d(Me, { "mime-type": c(t) }, null, 8, ["mime-type"])]))]),
|
|
724
|
+
f("div", nt, [f("p", rt, E(t.filename || t.url), 1), f("p", it, [
|
|
725
|
+
t.size == null ? e("", !0) : (o(), j(h, { key: 0 }, [u(E(w(Q)(t.size)), 1)], 64)),
|
|
726
|
+
t.createdAt ? (o(), j(h, { key: 1 }, [t.size == null ? e("", !0) : (o(), j(h, { key: 0 }, [u(" · ")], 64)), u(" " + E(N(t.createdAt)), 1)], 64)) : e("", !0),
|
|
717
727
|
w(s)(c(t)) && t.width && t.height ? (o(), j(h, { key: 2 }, [u(" · " + E(t.width) + "×" + E(t.height), 1)], 64)) : e("", !0)
|
|
718
728
|
])]),
|
|
719
729
|
f("div", { class: P(["tpl:flex tpl:gap-1 tpl:transition-opacity tpl:duration-150", T(t)]) }, [g(t) ? (o(), j("button", {
|
|
@@ -724,11 +734,11 @@ var Ne = { class: "tpl:p-4" }, Pe = ["aria-label"], Fe = {
|
|
|
724
734
|
style: { color: "var(--tpl-text-muted)" },
|
|
725
735
|
title: w(D).mediaLibrary.editFile,
|
|
726
736
|
"aria-label": w(D).mediaLibrary.editFile,
|
|
727
|
-
onClick:
|
|
737
|
+
onClick: U((e) => i("edit", t), ["stop"])
|
|
728
738
|
}, [d(w(C), {
|
|
729
739
|
size: 12,
|
|
730
740
|
"stroke-width": 2
|
|
731
|
-
})], 8,
|
|
741
|
+
})], 8, at)) : e("", !0), v(t) ? (o(), j("button", {
|
|
732
742
|
key: 1,
|
|
733
743
|
type: "button",
|
|
734
744
|
"data-testid": "media-replace",
|
|
@@ -736,16 +746,16 @@ var Ne = { class: "tpl:p-4" }, Pe = ["aria-label"], Fe = {
|
|
|
736
746
|
style: { color: "var(--tpl-text-muted)" },
|
|
737
747
|
title: w(D).mediaLibrary.replaceFile,
|
|
738
748
|
"aria-label": w(D).mediaLibrary.replaceFile,
|
|
739
|
-
onClick:
|
|
749
|
+
onClick: U((e) => i("replace", t), ["stop"])
|
|
740
750
|
}, [d(w(R), {
|
|
741
751
|
size: 12,
|
|
742
752
|
"stroke-width": 2
|
|
743
|
-
})], 8,
|
|
744
|
-
S(t) ? (o(), j("div",
|
|
753
|
+
})], 8, ot)) : e("", !0)], 2),
|
|
754
|
+
S(t) ? (o(), j("div", st, [d(w(H), {
|
|
745
755
|
size: 12,
|
|
746
756
|
"stroke-width": 3
|
|
747
757
|
})])) : e("", !0)
|
|
748
|
-
], 46,
|
|
758
|
+
], 46, Qe))), 128))], 8, Ze)) : (o(), j("div", {
|
|
749
759
|
key: 2,
|
|
750
760
|
role: "listbox",
|
|
751
761
|
"aria-label": w(D).mediaLibrary.filesListAriaLabel,
|
|
@@ -764,7 +774,7 @@ var Ne = { class: "tpl:p-4" }, Pe = ["aria-label"], Fe = {
|
|
|
764
774
|
"data-media-id": t.id,
|
|
765
775
|
"aria-selected": S(t),
|
|
766
776
|
"aria-label": t.filename || t.url,
|
|
767
|
-
style:
|
|
777
|
+
style: V({
|
|
768
778
|
borderColor: S(t) ? "var(--tpl-primary)" : "transparent",
|
|
769
779
|
backgroundColor: !p(t) && !S(t) ? "var(--tpl-bg)" : "var(--tpl-bg-hover)"
|
|
770
780
|
}),
|
|
@@ -772,17 +782,17 @@ var Ne = { class: "tpl:p-4" }, Pe = ["aria-label"], Fe = {
|
|
|
772
782
|
onDblclick: (e) => b(t),
|
|
773
783
|
onKeydown: (e) => x(t, e)
|
|
774
784
|
}, [
|
|
775
|
-
f("div",
|
|
785
|
+
f("div", Ve, [w(s)(c(t)) ? (o(), j("img", {
|
|
776
786
|
key: 0,
|
|
777
787
|
src: l(t),
|
|
778
788
|
alt: t.filename || t.url,
|
|
779
789
|
class: "tpl:size-full tpl:object-cover",
|
|
780
790
|
loading: "lazy"
|
|
781
|
-
}, null, 8,
|
|
791
|
+
}, null, 8, He)) : (o(), M(Me, {
|
|
782
792
|
key: 1,
|
|
783
793
|
"mime-type": c(t)
|
|
784
794
|
}, null, 8, ["mime-type"]))]),
|
|
785
|
-
f("div",
|
|
795
|
+
f("div", Ue, [f("p", We, E(t.filename || t.url), 1), f("p", Ge, [t.size == null ? e("", !0) : (o(), j("span", Ke, E(w(Q)(t.size)), 1)), w(s)(c(t)) && t.width && t.height ? (o(), j("span", qe, E(t.width) + "×" + E(t.height), 1)) : e("", !0)])]),
|
|
786
796
|
f("div", { class: P(["tpl:absolute tpl:top-1.5 tpl:left-1.5 tpl:flex tpl:gap-1 tpl:transition-opacity tpl:duration-150", T(t)]) }, [g(t) ? (o(), j("button", {
|
|
787
797
|
key: 0,
|
|
788
798
|
type: "button",
|
|
@@ -794,11 +804,11 @@ var Ne = { class: "tpl:p-4" }, Pe = ["aria-label"], Fe = {
|
|
|
794
804
|
},
|
|
795
805
|
title: w(D).mediaLibrary.editFile,
|
|
796
806
|
"aria-label": w(D).mediaLibrary.editFile,
|
|
797
|
-
onClick:
|
|
807
|
+
onClick: U((e) => i("edit", t), ["stop"])
|
|
798
808
|
}, [d(w(C), {
|
|
799
809
|
size: 11,
|
|
800
810
|
"stroke-width": 2
|
|
801
|
-
})], 8,
|
|
811
|
+
})], 8, Je)) : e("", !0), v(t) ? (o(), j("button", {
|
|
802
812
|
key: 1,
|
|
803
813
|
type: "button",
|
|
804
814
|
"data-testid": "media-replace",
|
|
@@ -809,22 +819,22 @@ var Ne = { class: "tpl:p-4" }, Pe = ["aria-label"], Fe = {
|
|
|
809
819
|
},
|
|
810
820
|
title: w(D).mediaLibrary.replaceFile,
|
|
811
821
|
"aria-label": w(D).mediaLibrary.replaceFile,
|
|
812
|
-
onClick:
|
|
822
|
+
onClick: U((e) => i("replace", t), ["stop"])
|
|
813
823
|
}, [d(w(R), {
|
|
814
824
|
size: 11,
|
|
815
825
|
"stroke-width": 2
|
|
816
|
-
})], 8,
|
|
817
|
-
S(t) ? (o(), j("div",
|
|
826
|
+
})], 8, Ye)) : e("", !0)], 2),
|
|
827
|
+
S(t) ? (o(), j("div", Xe, [d(w(H), {
|
|
818
828
|
size: 12,
|
|
819
829
|
"stroke-width": 3
|
|
820
830
|
})])) : e("", !0)
|
|
821
|
-
], 46,
|
|
831
|
+
], 46, Be))), 128))], 8, ze)),
|
|
822
832
|
f("div", {
|
|
823
833
|
ref_key: "sentinelRef",
|
|
824
834
|
ref: A,
|
|
825
835
|
class: "tpl:h-4"
|
|
826
836
|
}, null, 512),
|
|
827
|
-
t.isLoading && t.items.length > 0 ? (o(), j("div",
|
|
837
|
+
t.isLoading && t.items.length > 0 ? (o(), j("div", ct, [d(w(B), {
|
|
828
838
|
class: "tpl-spinner",
|
|
829
839
|
size: 20,
|
|
830
840
|
"stroke-width": 2,
|
|
@@ -832,26 +842,26 @@ var Ne = { class: "tpl:p-4" }, Pe = ["aria-label"], Fe = {
|
|
|
832
842
|
})])) : e("", !0)
|
|
833
843
|
]));
|
|
834
844
|
}
|
|
835
|
-
}), [["__scopeId", "data-v-
|
|
845
|
+
}), [["__scopeId", "data-v-375932e6"]]), ut = ["data-tpl-theme"], dt = {
|
|
836
846
|
id: "tpl-media-import-title",
|
|
837
847
|
class: "tpl:mb-4 tpl:text-sm tpl:font-semibold",
|
|
838
848
|
style: { color: "var(--tpl-text)" }
|
|
839
|
-
},
|
|
849
|
+
}, ft = { class: "tpl:mb-3" }, pt = [
|
|
840
850
|
"aria-label",
|
|
841
851
|
"aria-invalid",
|
|
842
852
|
"aria-describedby",
|
|
843
853
|
"placeholder",
|
|
844
854
|
"disabled"
|
|
845
|
-
],
|
|
855
|
+
], mt = {
|
|
846
856
|
key: 0,
|
|
847
857
|
id: "tpl-media-import-error",
|
|
848
858
|
role: "alert",
|
|
849
859
|
class: "tpl:mb-3 tpl:text-xs",
|
|
850
860
|
style: { color: "var(--tpl-danger)" }
|
|
851
|
-
},
|
|
861
|
+
}, ht = { class: "tpl:flex tpl:justify-end tpl:gap-2" }, gt = ["disabled"], _t = ["disabled"], vt = {
|
|
852
862
|
key: 0,
|
|
853
863
|
class: "tpl:flex tpl:items-center tpl:gap-1.5"
|
|
854
|
-
},
|
|
864
|
+
}, yt = { key: 1 }, bt = /* @__PURE__ */ a({
|
|
855
865
|
__name: "MediaImportUrlModal",
|
|
856
866
|
props: {
|
|
857
867
|
visible: { type: Boolean },
|
|
@@ -860,7 +870,7 @@ var Ne = { class: "tpl:p-4" }, Pe = ["aria-label"], Fe = {
|
|
|
860
870
|
},
|
|
861
871
|
emits: ["import", "close"],
|
|
862
872
|
setup(t, { emit: n }) {
|
|
863
|
-
let a = t, c = n, { t: l } =
|
|
873
|
+
let a = t, c = n, { t: l } = Z(), p = m(q, null), h = m(K, L(null)), g = L("");
|
|
864
874
|
s(() => a.visible, (e) => {
|
|
865
875
|
e && (g.value = "");
|
|
866
876
|
});
|
|
@@ -872,11 +882,11 @@ var Ne = { class: "tpl:p-4" }, Pe = ["aria-label"], Fe = {
|
|
|
872
882
|
a.isImporting || c("close");
|
|
873
883
|
}
|
|
874
884
|
let x = L(null), S = r(() => a.visible);
|
|
875
|
-
|
|
885
|
+
pe(x, S);
|
|
876
886
|
function C(e) {
|
|
877
887
|
e.stopPropagation(), e.key === "Enter" && (e.preventDefault(), _()), e.key === "Escape" && b();
|
|
878
888
|
}
|
|
879
|
-
return (n, r) => (o(), M(i, { to: w(h) || "body" }, [d(
|
|
889
|
+
return (n, r) => (o(), M(i, { to: w(h) || "body" }, [d(G, {
|
|
880
890
|
"enter-active-class": "tpl:transition tpl:ease-out tpl:duration-150",
|
|
881
891
|
"enter-from-class": "tpl:opacity-0",
|
|
882
892
|
"enter-to-class": "tpl:opacity-100",
|
|
@@ -889,7 +899,7 @@ var Ne = { class: "tpl:p-4" }, Pe = ["aria-label"], Fe = {
|
|
|
889
899
|
"data-tpl-theme": w(p),
|
|
890
900
|
class: P([w(h) ? void 0 : "tpl", "tpl:fixed tpl:inset-0 tpl:z-10 tpl:flex tpl:items-center tpl:justify-center tpl:p-4"]),
|
|
891
901
|
style: { "background-color": "var(--tpl-overlay)" },
|
|
892
|
-
onClick:
|
|
902
|
+
onClick: U(b, ["self"]),
|
|
893
903
|
onKeydown: C
|
|
894
904
|
}, [f("div", {
|
|
895
905
|
ref_key: "dialogRef",
|
|
@@ -900,8 +910,8 @@ var Ne = { class: "tpl:p-4" }, Pe = ["aria-label"], Fe = {
|
|
|
900
910
|
class: "tpl:max-h-[90%] tpl:w-full tpl:max-w-sm tpl:overflow-y-auto tpl:rounded-lg tpl:p-5 tpl:shadow-xl",
|
|
901
911
|
style: { "background-color": "var(--tpl-bg-elevated)" }
|
|
902
912
|
}, [
|
|
903
|
-
f("h3",
|
|
904
|
-
f("div",
|
|
913
|
+
f("h3", dt, E(w(l).mediaLibrary.importFromUrl), 1),
|
|
914
|
+
f("div", ft, [y(f("input", {
|
|
905
915
|
"onUpdate:modelValue": r[0] ||= (e) => g.value = e,
|
|
906
916
|
type: "url",
|
|
907
917
|
"aria-label": w(l).mediaLibrary.importFromUrl,
|
|
@@ -916,9 +926,9 @@ var Ne = { class: "tpl:p-4" }, Pe = ["aria-label"], Fe = {
|
|
|
916
926
|
placeholder: w(l).mediaLibrary.importUrlPlaceholder,
|
|
917
927
|
disabled: t.isImporting,
|
|
918
928
|
autofocus: ""
|
|
919
|
-
}, null, 8,
|
|
920
|
-
t.error ? (o(), j("p",
|
|
921
|
-
f("div",
|
|
929
|
+
}, null, 8, pt), [[W, g.value]])]),
|
|
930
|
+
t.error ? (o(), j("p", mt, E(t.error), 1)) : e("", !0),
|
|
931
|
+
f("div", ht, [f("button", {
|
|
922
932
|
class: P(["tpl:cursor-pointer tpl:rounded-md tpl:border tpl:px-3 tpl:py-1.5 tpl:text-xs tpl:font-medium tpl:transition-all tpl:duration-150", { "tpl:cursor-not-allowed tpl:opacity-50": t.isImporting }]),
|
|
923
933
|
style: {
|
|
924
934
|
"border-color": "var(--tpl-border)",
|
|
@@ -927,7 +937,7 @@ var Ne = { class: "tpl:p-4" }, Pe = ["aria-label"], Fe = {
|
|
|
927
937
|
},
|
|
928
938
|
disabled: t.isImporting,
|
|
929
939
|
onClick: b
|
|
930
|
-
}, E(w(l).mediaLibrary.cancel), 11,
|
|
940
|
+
}, E(w(l).mediaLibrary.cancel), 11, gt), f("button", {
|
|
931
941
|
class: "tpl:cursor-pointer tpl:rounded-md tpl:px-3 tpl:py-1.5 tpl:text-xs tpl:font-medium tpl:transition-all tpl:duration-150 tpl:hover:bg-[var(--tpl-primary-hover)] tpl:disabled:cursor-not-allowed tpl:disabled:opacity-50",
|
|
932
942
|
style: {
|
|
933
943
|
"background-color": "var(--tpl-primary)",
|
|
@@ -935,20 +945,20 @@ var Ne = { class: "tpl:p-4" }, Pe = ["aria-label"], Fe = {
|
|
|
935
945
|
},
|
|
936
946
|
disabled: !g.value.trim() || t.isImporting,
|
|
937
947
|
onClick: _
|
|
938
|
-
}, [t.isImporting ? (o(), j("span",
|
|
948
|
+
}, [t.isImporting ? (o(), j("span", vt, [d(w(B), {
|
|
939
949
|
class: "tpl:animate-spin",
|
|
940
950
|
size: 12,
|
|
941
951
|
"stroke-width": 2
|
|
942
|
-
}), u(" " + E(w(l).mediaLibrary.importing), 1)])) : (o(), j("span",
|
|
943
|
-
], 512)], 42,
|
|
952
|
+
}), u(" " + E(w(l).mediaLibrary.importing), 1)])) : (o(), j("span", yt, E(w(l).mediaLibrary.import), 1))], 8, _t)])
|
|
953
|
+
], 512)], 42, ut)) : e("", !0)]),
|
|
944
954
|
_: 1
|
|
945
955
|
})], 8, ["to"]));
|
|
946
956
|
}
|
|
947
|
-
}),
|
|
957
|
+
}), xt = { class: "tpl:max-h-56 tpl:overflow-y-auto tpl:py-1" }, St = ["disabled", "onClick"], Ct = { class: "tpl:truncate" }, wt = {
|
|
948
958
|
key: 0,
|
|
949
959
|
class: "tpl:shrink-0",
|
|
950
960
|
style: { color: "var(--tpl-text-dim)" }
|
|
951
|
-
},
|
|
961
|
+
}, Tt = /* @__PURE__ */ a({
|
|
952
962
|
__name: "MediaMovePicker",
|
|
953
963
|
props: {
|
|
954
964
|
folders: {},
|
|
@@ -956,7 +966,7 @@ var Ne = { class: "tpl:p-4" }, Pe = ["aria-label"], Fe = {
|
|
|
956
966
|
},
|
|
957
967
|
emits: ["select", "close"],
|
|
958
968
|
setup(t, { emit: n }) {
|
|
959
|
-
let r = n, { t: i } =
|
|
969
|
+
let r = n, { t: i } = Z(), a = L(null);
|
|
960
970
|
function s(e, t = 0) {
|
|
961
971
|
let n = [];
|
|
962
972
|
for (let r of e) n.push({
|
|
@@ -966,7 +976,7 @@ var Ne = { class: "tpl:p-4" }, Pe = ["aria-label"], Fe = {
|
|
|
966
976
|
}), r.children.length && n.push(...s(r.children, t + 1));
|
|
967
977
|
return n;
|
|
968
978
|
}
|
|
969
|
-
return
|
|
979
|
+
return de(a, () => {
|
|
970
980
|
r("close");
|
|
971
981
|
}), (n, c) => (o(), j("div", {
|
|
972
982
|
ref_key: "pickerRef",
|
|
@@ -977,7 +987,7 @@ var Ne = { class: "tpl:p-4" }, Pe = ["aria-label"], Fe = {
|
|
|
977
987
|
"border-color": "var(--tpl-border)",
|
|
978
988
|
"background-color": "var(--tpl-bg-elevated)"
|
|
979
989
|
}
|
|
980
|
-
}, [f("div",
|
|
990
|
+
}, [f("div", xt, [t.currentFolderId === null ? e("", !0) : (o(), j("button", {
|
|
981
991
|
key: 0,
|
|
982
992
|
class: "tpl:flex tpl:w-full tpl:items-center tpl:gap-1.5 tpl:px-3 tpl:py-1.5 tpl:text-left tpl:text-xs tpl:transition-colors tpl:duration-100",
|
|
983
993
|
style: { color: "var(--tpl-text)" },
|
|
@@ -989,7 +999,7 @@ var Ne = { class: "tpl:p-4" }, Pe = ["aria-label"], Fe = {
|
|
|
989
999
|
}), u(" " + E(w(i).mediaLibrary.moveToRoot), 1)])), (o(!0), j(h, null, _(s(t.folders), (n) => (o(), j("button", {
|
|
990
1000
|
key: n.id,
|
|
991
1001
|
class: "tpl:flex tpl:w-full tpl:items-center tpl:gap-1.5 tpl:py-1.5 tpl:pr-3 tpl:text-left tpl:text-xs tpl:transition-colors tpl:duration-100",
|
|
992
|
-
style:
|
|
1002
|
+
style: V({
|
|
993
1003
|
paddingLeft: `${n.depth * 16 + 12}px`,
|
|
994
1004
|
color: n.id === t.currentFolderId ? "var(--tpl-text-dim)" : "var(--tpl-text)",
|
|
995
1005
|
opacity: n.id === t.currentFolderId ? .5 : 1
|
|
@@ -1002,28 +1012,28 @@ var Ne = { class: "tpl:p-4" }, Pe = ["aria-label"], Fe = {
|
|
|
1002
1012
|
size: 14,
|
|
1003
1013
|
"stroke-width": 1.5
|
|
1004
1014
|
}),
|
|
1005
|
-
f("span",
|
|
1006
|
-
n.id === t.currentFolderId ? (o(), j("span",
|
|
1007
|
-
], 12,
|
|
1015
|
+
f("span", Ct, E(n.name), 1),
|
|
1016
|
+
n.id === t.currentFolderId ? (o(), j("span", wt, E(w(i).mediaLibrary.currentFolder), 1)) : e("", !0)
|
|
1017
|
+
], 12, St))), 128))])], 512));
|
|
1008
1018
|
}
|
|
1009
|
-
}),
|
|
1019
|
+
}), Et = { class: "tpl:flex tpl:items-center tpl:gap-3" }, Dt = ["src", "alt"], Ot = {
|
|
1010
1020
|
key: 1,
|
|
1011
1021
|
class: "tpl:flex tpl:size-10 tpl:shrink-0 tpl:items-center tpl:justify-center tpl:overflow-hidden tpl:rounded",
|
|
1012
1022
|
style: { border: "1px solid var(--tpl-border)" }
|
|
1013
|
-
},
|
|
1023
|
+
}, kt = { class: "tpl:min-w-0 tpl:flex-1" }, At = {
|
|
1014
1024
|
class: "tpl:truncate tpl:text-xs tpl:font-medium",
|
|
1015
1025
|
style: { color: "var(--tpl-text)" }
|
|
1016
|
-
},
|
|
1026
|
+
}, jt = {
|
|
1017
1027
|
class: "tpl:mt-0.5 tpl:text-[10px]",
|
|
1018
1028
|
style: { color: "var(--tpl-text-muted)" }
|
|
1019
|
-
},
|
|
1029
|
+
}, Mt = /*#__PURE__*/ le(/* @__PURE__ */ a({
|
|
1020
1030
|
__name: "MediaPreviewPanel",
|
|
1021
1031
|
props: {
|
|
1022
1032
|
item: {},
|
|
1023
1033
|
folders: {}
|
|
1024
1034
|
},
|
|
1025
1035
|
setup(t) {
|
|
1026
|
-
let n = t, i = m(
|
|
1036
|
+
let n = t, i = m(Y, null), { isImageMimeType: a } = J();
|
|
1027
1037
|
function s(e, t, n = []) {
|
|
1028
1038
|
for (let r of e) {
|
|
1029
1039
|
let e = [...n, r.name];
|
|
@@ -1041,30 +1051,27 @@ var Ne = { class: "tpl:p-4" }, Pe = ["aria-label"], Fe = {
|
|
|
1041
1051
|
return e ? e.join("/") : null;
|
|
1042
1052
|
}), l = r(() => n.item.mimeType ?? ""), p = r(() => a(l.value));
|
|
1043
1053
|
function g(e) {
|
|
1044
|
-
return
|
|
1045
|
-
}
|
|
1046
|
-
function _(e) {
|
|
1047
|
-
return Me(e, i?.value, {
|
|
1054
|
+
return Ne(e, i?.value, {
|
|
1048
1055
|
year: "numeric",
|
|
1049
1056
|
month: "short",
|
|
1050
1057
|
day: "numeric"
|
|
1051
1058
|
});
|
|
1052
1059
|
}
|
|
1053
|
-
let
|
|
1054
|
-
return (n, r) => (o(), j("div",
|
|
1060
|
+
let _ = r(() => n.item.filename || n.item.url);
|
|
1061
|
+
return (n, r) => (o(), j("div", Et, [p.value ? (o(), j("img", {
|
|
1055
1062
|
key: 0,
|
|
1056
1063
|
src: t.item.url,
|
|
1057
|
-
alt: t.item.alt ||
|
|
1064
|
+
alt: t.item.alt || _.value,
|
|
1058
1065
|
class: "tpl:size-10 tpl:shrink-0 tpl:rounded tpl:object-cover",
|
|
1059
1066
|
style: { border: "1px solid var(--tpl-border)" }
|
|
1060
|
-
}, null, 8,
|
|
1067
|
+
}, null, 8, Dt)) : (o(), j("div", Ot, [d(Me, {
|
|
1061
1068
|
"mime-type": l.value,
|
|
1062
1069
|
class: "tpl-preview-icon"
|
|
1063
|
-
}, null, 8, ["mime-type"])])), f("div",
|
|
1064
|
-
f("p",
|
|
1065
|
-
f("p",
|
|
1066
|
-
t.item.size == null ? e("", !0) : (o(), j(h, { key: 0 }, [u(E(
|
|
1067
|
-
t.item.createdAt ? (o(), j(h, { key: 1 }, [t.item.size == null ? e("", !0) : (o(), j(h, { key: 0 }, [u(" · ")], 64)), u(" " + E(
|
|
1070
|
+
}, null, 8, ["mime-type"])])), f("div", kt, [
|
|
1071
|
+
f("p", At, E(_.value), 1),
|
|
1072
|
+
f("p", jt, [
|
|
1073
|
+
t.item.size == null ? e("", !0) : (o(), j(h, { key: 0 }, [u(E(w(Q)(t.item.size)), 1)], 64)),
|
|
1074
|
+
t.item.createdAt ? (o(), j(h, { key: 1 }, [t.item.size == null ? e("", !0) : (o(), j(h, { key: 0 }, [u(" · ")], 64)), u(" " + E(g(t.item.createdAt)), 1)], 64)) : e("", !0),
|
|
1068
1075
|
p.value && t.item.width && t.item.height ? (o(), j(h, { key: 2 }, [u(" · " + E(t.item.width) + "×" + E(t.item.height) + "px ", 1)], 64)) : e("", !0),
|
|
1069
1076
|
c.value ? (o(), j(h, { key: 3 }, [
|
|
1070
1077
|
r[0] ||= u(" · ", -1),
|
|
@@ -1083,37 +1090,37 @@ var Ne = { class: "tpl:p-4" }, Pe = ["aria-label"], Fe = {
|
|
|
1083
1090
|
}, E(t.item.alt || "\xA0"), 3)) : e("", !0)
|
|
1084
1091
|
])]));
|
|
1085
1092
|
}
|
|
1086
|
-
}), [["__scopeId", "data-v-
|
|
1093
|
+
}), [["__scopeId", "data-v-9ebc1a04"]]), Nt = ["data-tpl-theme"], Pt = {
|
|
1087
1094
|
id: "tpl-media-replace-title",
|
|
1088
1095
|
class: "tpl:mb-2 tpl:text-sm tpl:font-semibold",
|
|
1089
1096
|
style: { color: "var(--tpl-text)" }
|
|
1090
|
-
},
|
|
1097
|
+
}, Ft = {
|
|
1091
1098
|
class: "tpl:mb-2 tpl:text-xs",
|
|
1092
1099
|
style: { color: "var(--tpl-text-muted)" }
|
|
1093
|
-
},
|
|
1100
|
+
}, It = {
|
|
1094
1101
|
key: 0,
|
|
1095
1102
|
class: "tpl:mb-3 tpl:text-xs",
|
|
1096
1103
|
style: { color: "var(--tpl-text-muted)" }
|
|
1097
|
-
},
|
|
1104
|
+
}, Lt = {
|
|
1098
1105
|
class: "tpl:mb-3 tpl:rounded tpl:border tpl:p-2",
|
|
1099
1106
|
style: { "border-color": "var(--tpl-border)" }
|
|
1100
|
-
},
|
|
1107
|
+
}, Rt = {
|
|
1101
1108
|
class: "tpl:truncate tpl:text-xs tpl:font-medium",
|
|
1102
1109
|
style: { color: "var(--tpl-text)" }
|
|
1103
|
-
},
|
|
1110
|
+
}, zt = { class: "tpl:mb-4" }, Bt = {
|
|
1104
1111
|
class: "tpl:mb-1 tpl:block tpl:text-xs tpl:font-medium",
|
|
1105
1112
|
style: { color: "var(--tpl-text-muted)" }
|
|
1106
|
-
},
|
|
1113
|
+
}, Vt = [
|
|
1107
1114
|
"accept",
|
|
1108
1115
|
"aria-invalid",
|
|
1109
1116
|
"aria-describedby"
|
|
1110
|
-
],
|
|
1117
|
+
], Ht = {
|
|
1111
1118
|
key: 1,
|
|
1112
1119
|
id: "tpl-media-replace-error",
|
|
1113
1120
|
role: "alert",
|
|
1114
1121
|
class: "tpl:mb-3 tpl:text-xs",
|
|
1115
1122
|
style: { color: "var(--tpl-danger)" }
|
|
1116
|
-
},
|
|
1123
|
+
}, Ut = { class: "tpl:flex tpl:justify-end tpl:gap-2" }, Wt = ["disabled"], Gt = ["disabled"], Kt = /* @__PURE__ */ a({
|
|
1117
1124
|
__name: "MediaReplaceModal",
|
|
1118
1125
|
props: {
|
|
1119
1126
|
visible: { type: Boolean },
|
|
@@ -1124,7 +1131,7 @@ var Ne = { class: "tpl:p-4" }, Pe = ["aria-label"], Fe = {
|
|
|
1124
1131
|
},
|
|
1125
1132
|
emits: ["replace", "close"],
|
|
1126
1133
|
setup(t, { emit: n }) {
|
|
1127
|
-
let a = t, c = n, { t: l } =
|
|
1134
|
+
let a = t, c = n, { t: l } = Z(), u = m(q, null), p = m(K, L(null)), h = L(null), g = L(null), _ = r(() => {
|
|
1128
1135
|
if (!a.item) return "";
|
|
1129
1136
|
let e = (a.item.filename ?? "").split(".");
|
|
1130
1137
|
return e.length > 1 ? e[e.length - 1].toLowerCase() : "";
|
|
@@ -1140,11 +1147,11 @@ var Ne = { class: "tpl:p-4" }, Pe = ["aria-label"], Fe = {
|
|
|
1140
1147
|
g.value && c("replace", g.value);
|
|
1141
1148
|
}
|
|
1142
1149
|
let C = L(null), T = r(() => a.visible && a.item !== null);
|
|
1143
|
-
|
|
1150
|
+
pe(C, T);
|
|
1144
1151
|
function D(e) {
|
|
1145
1152
|
e.stopPropagation(), e.key === "Escape" && c("close");
|
|
1146
1153
|
}
|
|
1147
|
-
return (n, r) => (o(), M(i, { to: w(p) || "body" }, [d(
|
|
1154
|
+
return (n, r) => (o(), M(i, { to: w(p) || "body" }, [d(G, {
|
|
1148
1155
|
"enter-active-class": "tpl:transition tpl:ease-out tpl:duration-150",
|
|
1149
1156
|
"enter-from-class": "tpl:opacity-0",
|
|
1150
1157
|
"enter-to-class": "tpl:opacity-100",
|
|
@@ -1157,7 +1164,7 @@ var Ne = { class: "tpl:p-4" }, Pe = ["aria-label"], Fe = {
|
|
|
1157
1164
|
"data-tpl-theme": w(u),
|
|
1158
1165
|
class: P([w(p) ? void 0 : "tpl", "tpl:fixed tpl:inset-0 tpl:z-10 tpl:flex tpl:items-center tpl:justify-center tpl:p-4"]),
|
|
1159
1166
|
style: { "background-color": "var(--tpl-overlay)" },
|
|
1160
|
-
onClick: r[1] ||=
|
|
1167
|
+
onClick: r[1] ||= U((e) => c("close"), ["self"]),
|
|
1161
1168
|
onKeydown: D
|
|
1162
1169
|
}, [f("div", {
|
|
1163
1170
|
ref_key: "dialogRef",
|
|
@@ -1168,11 +1175,11 @@ var Ne = { class: "tpl:p-4" }, Pe = ["aria-label"], Fe = {
|
|
|
1168
1175
|
class: "tpl:max-h-[90%] tpl:w-full tpl:max-w-sm tpl:overflow-y-auto tpl:rounded-lg tpl:p-5 tpl:shadow-xl",
|
|
1169
1176
|
style: { "background-color": "var(--tpl-bg-elevated)" }
|
|
1170
1177
|
}, [
|
|
1171
|
-
f("h3",
|
|
1172
|
-
f("p",
|
|
1173
|
-
b.value ? (o(), j("p",
|
|
1174
|
-
f("div",
|
|
1175
|
-
f("div",
|
|
1178
|
+
f("h3", Pt, E(w(l).mediaLibrary.replaceWarningTitle), 1),
|
|
1179
|
+
f("p", Ft, E(w(l).mediaLibrary.replaceWarningMessage.replace("{extension}", `.${_.value}`)), 1),
|
|
1180
|
+
b.value ? (o(), j("p", It, E(w(l).mediaLibrary.replaceWarningUsageNote.replace("{count}", t.usageInfo.templateCount.toString())), 1)) : e("", !0),
|
|
1181
|
+
f("div", Lt, [f("p", Rt, E(t.item.filename), 1)]),
|
|
1182
|
+
f("div", zt, [f("label", Bt, E(w(l).mediaLibrary.replaceSelectFile), 1), f("input", {
|
|
1176
1183
|
ref_key: "fileInputRef",
|
|
1177
1184
|
ref: h,
|
|
1178
1185
|
type: "file",
|
|
@@ -1186,9 +1193,9 @@ var Ne = { class: "tpl:p-4" }, Pe = ["aria-label"], Fe = {
|
|
|
1186
1193
|
color: "var(--tpl-text)"
|
|
1187
1194
|
},
|
|
1188
1195
|
onChange: x
|
|
1189
|
-
}, null, 40,
|
|
1190
|
-
t.error ? (o(), j("p",
|
|
1191
|
-
f("div",
|
|
1196
|
+
}, null, 40, Vt)]),
|
|
1197
|
+
t.error ? (o(), j("p", Ht, E(t.error), 1)) : e("", !0),
|
|
1198
|
+
f("div", Ut, [f("button", {
|
|
1192
1199
|
class: "tpl:cursor-pointer tpl:rounded-md tpl:border tpl:px-3 tpl:py-1.5 tpl:text-xs tpl:font-medium tpl:transition-all tpl:duration-150",
|
|
1193
1200
|
style: {
|
|
1194
1201
|
"border-color": "var(--tpl-border)",
|
|
@@ -1197,7 +1204,7 @@ var Ne = { class: "tpl:p-4" }, Pe = ["aria-label"], Fe = {
|
|
|
1197
1204
|
},
|
|
1198
1205
|
disabled: t.isReplacing,
|
|
1199
1206
|
onClick: r[0] ||= (e) => c("close")
|
|
1200
|
-
}, E(w(l).mediaLibrary.cancel), 9,
|
|
1207
|
+
}, E(w(l).mediaLibrary.cancel), 9, Wt), f("button", {
|
|
1201
1208
|
class: "tpl:cursor-pointer tpl:rounded-md tpl:px-3 tpl:py-1.5 tpl:text-xs tpl:font-medium tpl:transition-all tpl:duration-150 tpl:hover:bg-[var(--tpl-primary-hover)] tpl:disabled:cursor-not-allowed tpl:disabled:opacity-50",
|
|
1202
1209
|
style: {
|
|
1203
1210
|
"background-color": "var(--tpl-primary)",
|
|
@@ -1205,91 +1212,128 @@ var Ne = { class: "tpl:p-4" }, Pe = ["aria-label"], Fe = {
|
|
|
1205
1212
|
},
|
|
1206
1213
|
disabled: !g.value || t.isReplacing,
|
|
1207
1214
|
onClick: S
|
|
1208
|
-
}, E(t.isReplacing ? w(l).mediaLibrary.replacing : w(l).mediaLibrary.replace), 9,
|
|
1209
|
-
], 512)], 42,
|
|
1215
|
+
}, E(t.isReplacing ? w(l).mediaLibrary.replacing : w(l).mediaLibrary.replace), 9, Gt)])
|
|
1216
|
+
], 512)], 42, Nt)) : e("", !0)]),
|
|
1210
1217
|
_: 1
|
|
1211
1218
|
})], 8, ["to"]));
|
|
1212
1219
|
}
|
|
1213
|
-
})
|
|
1220
|
+
});
|
|
1221
|
+
//#endregion
|
|
1222
|
+
//#region src/utils/formatList.ts
|
|
1223
|
+
function qt(e, t) {
|
|
1224
|
+
let n = {
|
|
1225
|
+
style: "narrow",
|
|
1226
|
+
type: "conjunction"
|
|
1227
|
+
};
|
|
1228
|
+
try {
|
|
1229
|
+
return new Intl.ListFormat(t, n).format(e);
|
|
1230
|
+
} catch (t) {
|
|
1231
|
+
if (!(t instanceof RangeError)) throw t;
|
|
1232
|
+
return new Intl.ListFormat(void 0, n).format(e);
|
|
1233
|
+
}
|
|
1234
|
+
}
|
|
1235
|
+
//#endregion
|
|
1236
|
+
//#region src/components/media/MediaUploadZone.vue?vue&type=script&setup=true&lang.ts
|
|
1237
|
+
var Jt = [
|
|
1238
|
+
"aria-label",
|
|
1239
|
+
"aria-describedby",
|
|
1240
|
+
"aria-busy"
|
|
1241
|
+
], Yt = {
|
|
1214
1242
|
key: 0,
|
|
1215
1243
|
class: "tpl:flex tpl:items-center tpl:gap-2"
|
|
1216
|
-
},
|
|
1244
|
+
}, Xt = {
|
|
1217
1245
|
class: "tpl:text-xs",
|
|
1218
1246
|
style: { color: "var(--tpl-text-muted)" }
|
|
1219
|
-
},
|
|
1247
|
+
}, Zt = {
|
|
1220
1248
|
class: "tpl:text-xs",
|
|
1221
1249
|
style: { color: "var(--tpl-text-muted)" }
|
|
1222
|
-
},
|
|
1250
|
+
}, Qt = {
|
|
1251
|
+
id: "tpl-media-upload-hint",
|
|
1252
|
+
"data-testid": "media-upload-hint",
|
|
1223
1253
|
class: "tpl:mt-1 tpl:text-[10px]",
|
|
1224
1254
|
style: { color: "var(--tpl-text-dim)" }
|
|
1225
|
-
},
|
|
1255
|
+
}, $t = {
|
|
1256
|
+
key: 0,
|
|
1257
|
+
"data-testid": "media-upload-rejected",
|
|
1258
|
+
role: "alert",
|
|
1259
|
+
class: "tpl:mt-1.5 tpl:text-xs tpl:break-words",
|
|
1260
|
+
style: { color: "var(--tpl-danger)" }
|
|
1261
|
+
}, en = /* @__PURE__ */ a({
|
|
1226
1262
|
__name: "MediaUploadZone",
|
|
1227
1263
|
props: {
|
|
1228
1264
|
isUploading: { type: Boolean },
|
|
1229
1265
|
uploadProgress: {}
|
|
1230
1266
|
},
|
|
1231
1267
|
emits: ["upload"],
|
|
1232
|
-
setup(
|
|
1233
|
-
let
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
}
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1268
|
+
setup(t, { emit: n }) {
|
|
1269
|
+
let i = n, { t: a, format: s } = Z(), c = m(Y, null), { allAcceptedInputString: l, restrictsMimeTypes: u, availableCategories: p, maxFileSize: g, isAcceptedFile: _ } = J(), v = {
|
|
1270
|
+
images: "filterImages",
|
|
1271
|
+
documents: "filterDocuments",
|
|
1272
|
+
videos: "filterVideos",
|
|
1273
|
+
audio: "filterAudio"
|
|
1274
|
+
}, y = r(() => {
|
|
1275
|
+
let e = a.mediaLibrary, t = u.value ? qt(p.value.map((t) => e[v[t]]), c?.value) : a.mediaLibrary.acceptedAnyType;
|
|
1276
|
+
return Number.isFinite(g.value) ? s(a.mediaLibrary.acceptedFormatsMaxSize, {
|
|
1277
|
+
formats: t,
|
|
1278
|
+
size: Q(g.value)
|
|
1279
|
+
}) : t;
|
|
1280
|
+
}), b = L([]), x = L();
|
|
1281
|
+
function S(e) {
|
|
1282
|
+
let t = [], n = [];
|
|
1283
|
+
for (let r of Array.from(e)) _(r) ? t.push(r) : n.push(r.name);
|
|
1284
|
+
b.value = n, t.length && i("upload", t);
|
|
1285
|
+
}
|
|
1286
|
+
let { isOverDropZone: C } = ae(x, { onDrop: (e) => {
|
|
1287
|
+
e?.length && S(e);
|
|
1288
|
+
} }), { open: T, onChange: D } = X({
|
|
1289
|
+
accept: l.value,
|
|
1247
1290
|
multiple: !0
|
|
1248
1291
|
});
|
|
1249
|
-
return
|
|
1250
|
-
e?.length &&
|
|
1251
|
-
}), (
|
|
1292
|
+
return D((e) => {
|
|
1293
|
+
e?.length && S(e);
|
|
1294
|
+
}), (n, r) => (o(), j(h, null, [f("button", {
|
|
1252
1295
|
ref_key: "dropZoneRef",
|
|
1253
|
-
ref:
|
|
1296
|
+
ref: x,
|
|
1254
1297
|
type: "button",
|
|
1255
1298
|
"data-testid": "media-upload-zone",
|
|
1256
|
-
class: P(["tpl-upload-zone tpl:flex tpl:w-full tpl:cursor-pointer tpl:flex-col tpl:items-center tpl:justify-center tpl:rounded-lg tpl:border-2 tpl:border-dashed tpl:p-5 tpl:text-center tpl:transition-all tpl:duration-150", w(
|
|
1257
|
-
"aria-label": w(
|
|
1258
|
-
"aria-
|
|
1299
|
+
class: P(["tpl-upload-zone tpl:flex tpl:w-full tpl:cursor-pointer tpl:flex-col tpl:items-center tpl:justify-center tpl:rounded-lg tpl:border-2 tpl:border-dashed tpl:p-5 tpl:text-center tpl:transition-all tpl:duration-150", w(C) ? "tpl-upload-zone-active" : ""]),
|
|
1300
|
+
"aria-label": w(a).mediaLibrary.dropOrClick,
|
|
1301
|
+
"aria-describedby": t.isUploading ? void 0 : "tpl-media-upload-hint",
|
|
1302
|
+
"aria-busy": t.isUploading,
|
|
1259
1303
|
style: {
|
|
1260
1304
|
"border-color": "var(--tpl-border-light)",
|
|
1261
1305
|
"background-color": "var(--tpl-bg)"
|
|
1262
1306
|
},
|
|
1263
|
-
onClick:
|
|
1264
|
-
}, [
|
|
1307
|
+
onClick: r[0] ||= (e) => w(T)()
|
|
1308
|
+
}, [t.isUploading ? (o(), j("div", Yt, [d(w(B), {
|
|
1265
1309
|
class: "tpl-spinner",
|
|
1266
1310
|
size: 20,
|
|
1267
1311
|
"stroke-width": 2,
|
|
1268
1312
|
style: { color: "var(--tpl-primary)" }
|
|
1269
|
-
}), f("span",
|
|
1270
|
-
current:
|
|
1271
|
-
total:
|
|
1272
|
-
}) : w(
|
|
1313
|
+
}), f("span", Xt, E(t.uploadProgress && t.uploadProgress.total > 1 ? w(s)(w(a).mediaLibrary.uploadingProgress, {
|
|
1314
|
+
current: t.uploadProgress.current,
|
|
1315
|
+
total: t.uploadProgress.total
|
|
1316
|
+
}) : w(a).mediaLibrary.uploading), 1)])) : (o(), j(h, { key: 1 }, [
|
|
1273
1317
|
d(w(I), {
|
|
1274
1318
|
class: "tpl:mb-2",
|
|
1275
1319
|
size: 24,
|
|
1276
1320
|
"stroke-width": 1.5,
|
|
1277
1321
|
style: { color: "var(--tpl-text-dim)" }
|
|
1278
1322
|
}),
|
|
1279
|
-
f("p",
|
|
1280
|
-
f("p",
|
|
1281
|
-
], 64))], 10,
|
|
1323
|
+
f("p", Zt, E(w(a).mediaLibrary.dropOrClick), 1),
|
|
1324
|
+
f("p", Qt, E(y.value), 1)
|
|
1325
|
+
], 64))], 10, Jt), b.value.length ? (o(), j("p", $t, E(w(s)(w(a).mediaLibrary.uploadRejected, { files: b.value.join(", ") })), 1)) : e("", !0)], 64));
|
|
1282
1326
|
}
|
|
1283
|
-
}),
|
|
1327
|
+
}), tn = ["aria-label"], nn = [
|
|
1284
1328
|
"width",
|
|
1285
1329
|
"height",
|
|
1286
1330
|
"viewBox"
|
|
1287
|
-
],
|
|
1331
|
+
], rn = [
|
|
1288
1332
|
"cx",
|
|
1289
1333
|
"cy",
|
|
1290
1334
|
"r",
|
|
1291
1335
|
"stroke-width"
|
|
1292
|
-
],
|
|
1336
|
+
], an = [
|
|
1293
1337
|
"cx",
|
|
1294
1338
|
"cy",
|
|
1295
1339
|
"r",
|
|
@@ -1297,14 +1341,14 @@ var Ne = { class: "tpl:p-4" }, Pe = ["aria-label"], Fe = {
|
|
|
1297
1341
|
"stroke",
|
|
1298
1342
|
"stroke-dasharray",
|
|
1299
1343
|
"stroke-dashoffset"
|
|
1300
|
-
],
|
|
1344
|
+
], on = {
|
|
1301
1345
|
key: 0,
|
|
1302
1346
|
class: "tpl:absolute tpl:top-full tpl:left-1/2 tpl:z-50 tpl:mt-2 tpl:-translate-x-1/2 tpl:rounded-md tpl:px-2.5 tpl:py-1.5 tpl:text-xs tpl:whitespace-nowrap tpl:shadow-lg",
|
|
1303
1347
|
style: {
|
|
1304
1348
|
"background-color": "var(--tpl-text)",
|
|
1305
1349
|
color: "var(--tpl-bg-elevated)"
|
|
1306
1350
|
}
|
|
1307
|
-
},
|
|
1351
|
+
}, sn = /* @__PURE__ */ a({
|
|
1308
1352
|
__name: "StorageProgressRing",
|
|
1309
1353
|
props: {
|
|
1310
1354
|
usedBytes: {},
|
|
@@ -1312,27 +1356,16 @@ var Ne = { class: "tpl:p-4" }, Pe = ["aria-label"], Fe = {
|
|
|
1312
1356
|
size: {}
|
|
1313
1357
|
},
|
|
1314
1358
|
setup(t) {
|
|
1315
|
-
let n = t, { t: i, format: a } =
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
"B",
|
|
1320
|
-
"KB",
|
|
1321
|
-
"MB",
|
|
1322
|
-
"GB"
|
|
1323
|
-
], r = Math.floor(Math.log(e) / Math.log(t));
|
|
1324
|
-
return `${(e / t ** r).toFixed(+(r >= 2))} ${n[r]}`;
|
|
1325
|
-
}
|
|
1326
|
-
let b = r(() => y(n.usedBytes)), x = r(() => y(n.limitBytes)), S = r(() => Math.max(0, n.limitBytes - n.usedBytes)), C = r(() => y(S.value)), w = r(() => a(i.mediaLibrary.storageTooltip, {
|
|
1327
|
-
used: b.value,
|
|
1328
|
-
total: x.value,
|
|
1329
|
-
remaining: C.value
|
|
1359
|
+
let n = t, { t: i, format: a } = Z(), s = L(!1), c = r(() => n.size ?? 24), l = r(() => Math.max(2, c.value / 8)), p = r(() => (c.value - l.value) / 2), m = r(() => 2 * Math.PI * p.value), h = r(() => n.limitBytes <= 0 ? 0 : Math.min(100, n.usedBytes / n.limitBytes * 100)), g = r(() => m.value - h.value / 100 * m.value), _ = r(() => h.value >= 95 ? "var(--tpl-danger)" : h.value >= 75 ? "var(--tpl-warning)" : "var(--tpl-primary)"), y = r(() => Q(n.usedBytes)), b = r(() => Q(n.limitBytes)), x = r(() => Math.max(0, n.limitBytes - n.usedBytes)), S = r(() => Q(x.value)), C = r(() => a(i.mediaLibrary.storageTooltip, {
|
|
1360
|
+
used: y.value,
|
|
1361
|
+
total: b.value,
|
|
1362
|
+
remaining: S.value
|
|
1330
1363
|
}));
|
|
1331
1364
|
return (t, n) => (o(), j("div", {
|
|
1332
1365
|
"data-testid": "media-storage-ring",
|
|
1333
1366
|
class: "tpl:relative tpl:inline-flex tpl:cursor-help tpl:items-center tpl:justify-center",
|
|
1334
1367
|
tabindex: "0",
|
|
1335
|
-
"aria-label":
|
|
1368
|
+
"aria-label": C.value,
|
|
1336
1369
|
onMouseenter: n[0] ||= (e) => s.value = !0,
|
|
1337
1370
|
onMouseleave: n[1] ||= (e) => s.value = !1,
|
|
1338
1371
|
onFocus: n[2] ||= (e) => s.value = !0,
|
|
@@ -1349,7 +1382,7 @@ var Ne = { class: "tpl:p-4" }, Pe = ["aria-label"], Fe = {
|
|
|
1349
1382
|
fill: "none",
|
|
1350
1383
|
"stroke-width": l.value,
|
|
1351
1384
|
style: { stroke: "var(--tpl-border)" }
|
|
1352
|
-
}, null, 8,
|
|
1385
|
+
}, null, 8, rn), f("circle", {
|
|
1353
1386
|
cx: c.value / 2,
|
|
1354
1387
|
cy: c.value / 2,
|
|
1355
1388
|
r: p.value,
|
|
@@ -1360,7 +1393,7 @@ var Ne = { class: "tpl:p-4" }, Pe = ["aria-label"], Fe = {
|
|
|
1360
1393
|
"stroke-dasharray": m.value,
|
|
1361
1394
|
"stroke-dashoffset": g.value,
|
|
1362
1395
|
class: "tpl:transition-all tpl:duration-300 tpl:ease-out"
|
|
1363
|
-
}, null, 8,
|
|
1396
|
+
}, null, 8, an)], 8, nn)), d(G, {
|
|
1364
1397
|
"enter-active-class": "tpl:transition tpl:ease-out tpl:duration-150",
|
|
1365
1398
|
"enter-from-class": "tpl:opacity-0 tpl:translate-y-1",
|
|
1366
1399
|
"enter-to-class": "tpl:opacity-100 tpl:translate-y-0",
|
|
@@ -1368,17 +1401,17 @@ var Ne = { class: "tpl:p-4" }, Pe = ["aria-label"], Fe = {
|
|
|
1368
1401
|
"leave-from-class": "tpl:opacity-100 tpl:translate-y-0",
|
|
1369
1402
|
"leave-to-class": "tpl:opacity-0 tpl:translate-y-1"
|
|
1370
1403
|
}, {
|
|
1371
|
-
default: v(() => [s.value ? (o(), j("div",
|
|
1404
|
+
default: v(() => [s.value ? (o(), j("div", on, [u(E(C.value) + " ", 1), n[4] ||= f("div", {
|
|
1372
1405
|
class: "tpl:absolute tpl:-top-1 tpl:left-1/2 tpl:size-2 tpl:-translate-x-1/2 tpl:rotate-45",
|
|
1373
1406
|
style: { "background-color": "var(--tpl-text)" }
|
|
1374
1407
|
}, null, -1)])) : e("", !0)]),
|
|
1375
1408
|
_: 1
|
|
1376
|
-
})], 40,
|
|
1409
|
+
})], 40, tn));
|
|
1377
1410
|
}
|
|
1378
1411
|
});
|
|
1379
1412
|
//#endregion
|
|
1380
1413
|
//#region src/utils/treeFolders.ts
|
|
1381
|
-
function
|
|
1414
|
+
function cn(e) {
|
|
1382
1415
|
let t = /* @__PURE__ */ new Map();
|
|
1383
1416
|
for (let n of e) t.set(n.id, {
|
|
1384
1417
|
...n,
|
|
@@ -1393,12 +1426,12 @@ function rn(e) {
|
|
|
1393
1426
|
}
|
|
1394
1427
|
//#endregion
|
|
1395
1428
|
//#region src/composables/useMediaLibraryUI.ts
|
|
1396
|
-
function
|
|
1429
|
+
function ln(e) {
|
|
1397
1430
|
let { library: t, translations: n } = e;
|
|
1398
1431
|
function i() {
|
|
1399
1432
|
return "value" in n && typeof n.value == "object" ? n.value : n;
|
|
1400
1433
|
}
|
|
1401
|
-
let a = L("grid"), o = L(!1), c = L(""), l = L(null), u = L(!1), d = L(!1), f = r(() => t.previewItem.value?.url ?? null), p = r(() => t.frequentlyUsedItems.value.length > 0), m = r(() => t.viewMode.value === "frequently-used" ? t.frequentlyUsedItems.value : t.items.value), h = r(() => Object.values(t.deleteUsageInfo.value).some((e) => e.templateCount > 0)), g = r(() =>
|
|
1434
|
+
let a = L("grid"), o = L(!1), c = L(""), l = L(null), u = L(!1), d = L(!1), f = r(() => t.previewItem.value?.url ?? null), p = r(() => t.frequentlyUsedItems.value.length > 0), m = r(() => t.viewMode.value === "frequently-used" ? t.frequentlyUsedItems.value : t.items.value), h = r(() => Object.values(t.deleteUsageInfo.value).some((e) => e.templateCount > 0)), g = r(() => cn(t.folders.value)), _ = {
|
|
1402
1435
|
images: () => i().mediaLibrary.filterImages,
|
|
1403
1436
|
documents: () => i().mediaLibrary.filterDocuments,
|
|
1404
1437
|
videos: () => i().mediaLibrary.filterVideos,
|
|
@@ -1410,13 +1443,13 @@ function an(e) {
|
|
|
1410
1443
|
s(o, (e) => {
|
|
1411
1444
|
e && t.loadFolders();
|
|
1412
1445
|
});
|
|
1413
|
-
let y =
|
|
1446
|
+
let y = oe((e) => {
|
|
1414
1447
|
t.search(e);
|
|
1415
1448
|
}, 300);
|
|
1416
1449
|
function b(e) {
|
|
1417
1450
|
c.value = e, y(e);
|
|
1418
1451
|
}
|
|
1419
|
-
let { copy: x, copied: S } =
|
|
1452
|
+
let { copy: x, copied: S } = ce({
|
|
1420
1453
|
copiedDuring: 2e3,
|
|
1421
1454
|
legacy: !0
|
|
1422
1455
|
});
|
|
@@ -1439,7 +1472,7 @@ function an(e) {
|
|
|
1439
1472
|
l.value = e;
|
|
1440
1473
|
}
|
|
1441
1474
|
async function k(e, n, r, i) {
|
|
1442
|
-
i && await t.replaceMediaDirectly(e, i.file)
|
|
1475
|
+
return i && !await t.replaceMediaDirectly(e, i.file) ? "failed" : await t.updateFile(e, n, r) ? (l.value = null, "saved") : i ? "replaced" : "failed";
|
|
1443
1476
|
}
|
|
1444
1477
|
async function A(e) {
|
|
1445
1478
|
await t.importFromUrl(e) && (u.value = !1);
|
|
@@ -1492,7 +1525,7 @@ function an(e) {
|
|
|
1492
1525
|
}
|
|
1493
1526
|
//#endregion
|
|
1494
1527
|
//#region src/composable.ts
|
|
1495
|
-
function
|
|
1528
|
+
function un(e) {
|
|
1496
1529
|
let { provider: t } = e, n = L([]), r = L([]), i = L(null), a = L("files"), o = L(""), s = L(null), c = L("newest"), l = L(!1), u = L(!1), d = L(!1), f = L(null), p = L(null), m = L(/* @__PURE__ */ new Set()), h = L(null), g = L([]), _ = L({}), v = L(!1), y = L([]), b = L(!1), x = L(null), S = L(!1), C = L(null), w = L(!1), T = L(null), E = L(null), D = L(null), O = 0;
|
|
1497
1530
|
function k(t) {
|
|
1498
1531
|
try {
|
|
@@ -1505,7 +1538,7 @@ function on(e) {
|
|
|
1505
1538
|
return t.folders === !1 ? null : t.folders;
|
|
1506
1539
|
}
|
|
1507
1540
|
function j() {
|
|
1508
|
-
return
|
|
1541
|
+
return re(e.templateId);
|
|
1509
1542
|
}
|
|
1510
1543
|
function M(e) {
|
|
1511
1544
|
let t = {};
|
|
@@ -1553,13 +1586,13 @@ function on(e) {
|
|
|
1553
1586
|
async function R(e) {
|
|
1554
1587
|
c.value = e, await N();
|
|
1555
1588
|
}
|
|
1556
|
-
async function
|
|
1589
|
+
async function ee(e) {
|
|
1557
1590
|
a.value = "files", i.value = e, o.value = "", m.value = /* @__PURE__ */ new Set(), h.value = null, await N();
|
|
1558
1591
|
}
|
|
1559
|
-
async function
|
|
1560
|
-
a.value = "frequently-used", i.value = null, o.value = "", m.value = /* @__PURE__ */ new Set(), h.value = null, await
|
|
1592
|
+
async function te() {
|
|
1593
|
+
a.value = "frequently-used", i.value = null, o.value = "", m.value = /* @__PURE__ */ new Set(), h.value = null, await W();
|
|
1561
1594
|
}
|
|
1562
|
-
async function
|
|
1595
|
+
async function ne(r) {
|
|
1563
1596
|
let { create: a } = t;
|
|
1564
1597
|
if (typeof a != "function") return null;
|
|
1565
1598
|
u.value = !0;
|
|
@@ -1576,7 +1609,7 @@ function on(e) {
|
|
|
1576
1609
|
u.value = !1;
|
|
1577
1610
|
}
|
|
1578
1611
|
}
|
|
1579
|
-
async function
|
|
1612
|
+
async function z(r) {
|
|
1580
1613
|
let { create: a } = t;
|
|
1581
1614
|
if (typeof a == "function") {
|
|
1582
1615
|
u.value = !0, p.value = {
|
|
@@ -1605,7 +1638,7 @@ function on(e) {
|
|
|
1605
1638
|
}
|
|
1606
1639
|
}
|
|
1607
1640
|
}
|
|
1608
|
-
async function
|
|
1641
|
+
async function ie(t) {
|
|
1609
1642
|
if (m.value.size === 0) return;
|
|
1610
1643
|
let { move: r } = A() ?? { move: !1 };
|
|
1611
1644
|
if (typeof r == "function") try {
|
|
@@ -1619,39 +1652,40 @@ function on(e) {
|
|
|
1619
1652
|
e.onError?.(t);
|
|
1620
1653
|
}
|
|
1621
1654
|
}
|
|
1622
|
-
async function
|
|
1655
|
+
async function B(r, i, a) {
|
|
1623
1656
|
let { update: o } = t;
|
|
1624
|
-
if (typeof o
|
|
1657
|
+
if (typeof o != "function") return !1;
|
|
1658
|
+
try {
|
|
1625
1659
|
let e = { filename: i };
|
|
1626
1660
|
a !== void 0 && (e.alt = a);
|
|
1627
1661
|
let s = await o(r, e);
|
|
1628
|
-
n.value = n.value.map((e) => e.id === r ? s : e), h.value?.id === r && (h.value = s), k(() => t.onUpdated?.(s));
|
|
1662
|
+
return n.value = n.value.map((e) => e.id === r ? s : e), h.value?.id === r && (h.value = s), k(() => t.onUpdated?.(s)), !0;
|
|
1629
1663
|
} catch (t) {
|
|
1630
|
-
e.onError?.(t);
|
|
1664
|
+
return e.onError?.(t), !1;
|
|
1631
1665
|
}
|
|
1632
1666
|
}
|
|
1633
|
-
function
|
|
1667
|
+
function V(e) {
|
|
1634
1668
|
let t = /* @__PURE__ */ new Map();
|
|
1635
1669
|
for (let r of n.value) e.includes(r.id) && t.set(r.id, r);
|
|
1636
1670
|
for (let n of g.value) e.includes(n.id) && !t.has(n.id) && t.set(n.id, n);
|
|
1637
1671
|
return [...t.values()];
|
|
1638
1672
|
}
|
|
1639
|
-
function
|
|
1673
|
+
function H(e) {
|
|
1640
1674
|
n.value = n.value.filter((t) => !e.includes(t.id)), g.value = g.value.filter((t) => !e.includes(t.id)), m.value = /* @__PURE__ */ new Set(), h.value = null;
|
|
1641
1675
|
}
|
|
1642
|
-
async function
|
|
1676
|
+
async function U() {
|
|
1643
1677
|
if (m.value.size === 0) return;
|
|
1644
1678
|
let { delete: n } = t;
|
|
1645
1679
|
if (typeof n != "function") return;
|
|
1646
|
-
let r = [...m.value], i =
|
|
1680
|
+
let r = [...m.value], i = V(r);
|
|
1647
1681
|
try {
|
|
1648
|
-
await n(r),
|
|
1682
|
+
await n(r), H(r);
|
|
1649
1683
|
for (let e of i) k(() => t.onDeleted?.(e));
|
|
1650
1684
|
} catch (t) {
|
|
1651
1685
|
e.onError?.(t);
|
|
1652
1686
|
}
|
|
1653
1687
|
}
|
|
1654
|
-
async function
|
|
1688
|
+
async function W() {
|
|
1655
1689
|
let { frequentlyUsed: n } = t;
|
|
1656
1690
|
if (typeof n == "function") try {
|
|
1657
1691
|
g.value = await n();
|
|
@@ -1659,7 +1693,7 @@ function on(e) {
|
|
|
1659
1693
|
e.onError?.(t);
|
|
1660
1694
|
}
|
|
1661
1695
|
}
|
|
1662
|
-
async function
|
|
1696
|
+
async function G() {
|
|
1663
1697
|
if (m.value.size === 0) return !1;
|
|
1664
1698
|
y.value = [...m.value];
|
|
1665
1699
|
let { checkUsage: n } = t;
|
|
@@ -1673,21 +1707,21 @@ function on(e) {
|
|
|
1673
1707
|
return e.onError?.(t), !1;
|
|
1674
1708
|
}
|
|
1675
1709
|
}
|
|
1676
|
-
async function
|
|
1710
|
+
async function ae() {
|
|
1677
1711
|
let { delete: n } = t;
|
|
1678
1712
|
if (typeof n != "function" || (v.value = !1, y.value.length === 0)) return;
|
|
1679
|
-
let r = y.value, i =
|
|
1713
|
+
let r = y.value, i = V(r);
|
|
1680
1714
|
try {
|
|
1681
|
-
await n(r),
|
|
1715
|
+
await n(r), H(r), y.value = [], _.value = {};
|
|
1682
1716
|
for (let e of i) k(() => t.onDeleted?.(e));
|
|
1683
1717
|
} catch (t) {
|
|
1684
1718
|
e.onError?.(t);
|
|
1685
1719
|
}
|
|
1686
1720
|
}
|
|
1687
|
-
function
|
|
1721
|
+
function oe() {
|
|
1688
1722
|
v.value = !1, y.value = [], _.value = {};
|
|
1689
1723
|
}
|
|
1690
|
-
async function
|
|
1724
|
+
async function se(r) {
|
|
1691
1725
|
let a = t.importFromUrl;
|
|
1692
1726
|
if (typeof a != "function") return null;
|
|
1693
1727
|
b.value = !0, x.value = null;
|
|
@@ -1700,17 +1734,17 @@ function on(e) {
|
|
|
1700
1734
|
b.value = !1;
|
|
1701
1735
|
}
|
|
1702
1736
|
}
|
|
1703
|
-
function
|
|
1737
|
+
function K(e) {
|
|
1704
1738
|
let t = new Set(m.value);
|
|
1705
1739
|
t.has(e) ? t.delete(e) : t.add(e), m.value = t;
|
|
1706
1740
|
}
|
|
1707
|
-
function
|
|
1741
|
+
function q() {
|
|
1708
1742
|
m.value = /* @__PURE__ */ new Set(), h.value = null;
|
|
1709
1743
|
}
|
|
1710
|
-
function
|
|
1744
|
+
function ce(e) {
|
|
1711
1745
|
h.value = e, m.value = /* @__PURE__ */ new Set([e.id]);
|
|
1712
1746
|
}
|
|
1713
|
-
async function
|
|
1747
|
+
async function J() {
|
|
1714
1748
|
let { storage: n } = t;
|
|
1715
1749
|
if (typeof n != "function") {
|
|
1716
1750
|
D.value = null;
|
|
@@ -1722,7 +1756,7 @@ function on(e) {
|
|
|
1722
1756
|
e.onError?.(t);
|
|
1723
1757
|
}
|
|
1724
1758
|
}
|
|
1725
|
-
async function
|
|
1759
|
+
async function Y() {
|
|
1726
1760
|
let t = A();
|
|
1727
1761
|
if (t) try {
|
|
1728
1762
|
r.value = await t.list();
|
|
@@ -1730,40 +1764,40 @@ function on(e) {
|
|
|
1730
1764
|
e.onError?.(t);
|
|
1731
1765
|
}
|
|
1732
1766
|
}
|
|
1733
|
-
async function
|
|
1767
|
+
async function le(t, n) {
|
|
1734
1768
|
let { create: r } = A() ?? { create: !1 };
|
|
1735
1769
|
if (typeof r != "function") return null;
|
|
1736
1770
|
try {
|
|
1737
1771
|
let e = { name: t };
|
|
1738
1772
|
n !== void 0 && (e.parentId = n);
|
|
1739
1773
|
let i = await r(e);
|
|
1740
|
-
return await
|
|
1774
|
+
return await Y(), i;
|
|
1741
1775
|
} catch (t) {
|
|
1742
1776
|
return e.onError?.(t), null;
|
|
1743
1777
|
}
|
|
1744
1778
|
}
|
|
1745
|
-
function
|
|
1779
|
+
function X(e, t) {
|
|
1746
1780
|
for (let n of e) if (n.id === t) return n;
|
|
1747
1781
|
return null;
|
|
1748
1782
|
}
|
|
1749
|
-
async function
|
|
1783
|
+
async function ue(t, n) {
|
|
1750
1784
|
let { update: r } = A() ?? { update: !1 };
|
|
1751
1785
|
if (typeof r == "function") try {
|
|
1752
|
-
await r(t, { name: n }), await
|
|
1786
|
+
await r(t, { name: n }), await Y();
|
|
1753
1787
|
} catch (t) {
|
|
1754
1788
|
e.onError?.(t);
|
|
1755
1789
|
}
|
|
1756
1790
|
}
|
|
1757
|
-
async function
|
|
1791
|
+
async function de(t) {
|
|
1758
1792
|
let { delete: n } = A() ?? { delete: !1 };
|
|
1759
1793
|
if (typeof n == "function") try {
|
|
1760
|
-
let e =
|
|
1761
|
-
await n(t), i.value === t && (i.value = e), await
|
|
1794
|
+
let e = X(r.value, t)?.parentId ?? null;
|
|
1795
|
+
await n(t), i.value === t && (i.value = e), await Y(), await N();
|
|
1762
1796
|
} catch (t) {
|
|
1763
1797
|
e.onError?.(t);
|
|
1764
1798
|
}
|
|
1765
1799
|
}
|
|
1766
|
-
async function
|
|
1800
|
+
async function fe(n) {
|
|
1767
1801
|
T.value = n, C.value = null;
|
|
1768
1802
|
let { checkUsage: r } = t;
|
|
1769
1803
|
if (typeof r != "function") {
|
|
@@ -1777,31 +1811,31 @@ function on(e) {
|
|
|
1777
1811
|
e.onError?.(t);
|
|
1778
1812
|
}
|
|
1779
1813
|
}
|
|
1780
|
-
function
|
|
1814
|
+
function pe() {
|
|
1781
1815
|
w.value = !1, T.value = null, E.value = null, C.value = null;
|
|
1782
1816
|
}
|
|
1783
|
-
function
|
|
1817
|
+
function Z(e) {
|
|
1784
1818
|
n.value = n.value.map((t) => t.id === e.id ? e : t), g.value = g.value.map((t) => t.id === e.id ? e : t), h.value?.id === e.id && (h.value = e), k(() => t.onUpdated?.(e));
|
|
1785
1819
|
}
|
|
1786
|
-
async function
|
|
1820
|
+
async function me(n) {
|
|
1787
1821
|
let { replace: r } = t;
|
|
1788
1822
|
if (typeof r != "function" || !T.value) return null;
|
|
1789
1823
|
S.value = !0, C.value = null;
|
|
1790
1824
|
try {
|
|
1791
1825
|
let e = await r(T.value.id, n);
|
|
1792
|
-
return
|
|
1826
|
+
return Z(e), w.value = !1, T.value = null, E.value = null, e;
|
|
1793
1827
|
} catch (t) {
|
|
1794
1828
|
return C.value = t instanceof Error ? t.message : "Replace failed", e.onError?.(t), null;
|
|
1795
1829
|
} finally {
|
|
1796
1830
|
S.value = !1;
|
|
1797
1831
|
}
|
|
1798
1832
|
}
|
|
1799
|
-
async function
|
|
1833
|
+
async function he(n, r) {
|
|
1800
1834
|
let { replace: i } = t;
|
|
1801
1835
|
if (typeof i != "function") return null;
|
|
1802
1836
|
try {
|
|
1803
1837
|
let e = await i(n, r);
|
|
1804
|
-
return
|
|
1838
|
+
return Z(e), e;
|
|
1805
1839
|
} catch (t) {
|
|
1806
1840
|
return e.onError?.(t), null;
|
|
1807
1841
|
}
|
|
@@ -1828,119 +1862,119 @@ function on(e) {
|
|
|
1828
1862
|
search: F,
|
|
1829
1863
|
filterByCategory: I,
|
|
1830
1864
|
sortBy: R,
|
|
1831
|
-
navigateToFolder:
|
|
1832
|
-
showFrequentlyUsed:
|
|
1833
|
-
uploadFile:
|
|
1834
|
-
uploadFiles:
|
|
1835
|
-
moveSelected:
|
|
1836
|
-
updateFile:
|
|
1837
|
-
deleteSelected:
|
|
1865
|
+
navigateToFolder: ee,
|
|
1866
|
+
showFrequentlyUsed: te,
|
|
1867
|
+
uploadFile: ne,
|
|
1868
|
+
uploadFiles: z,
|
|
1869
|
+
moveSelected: ie,
|
|
1870
|
+
updateFile: B,
|
|
1871
|
+
deleteSelected: U,
|
|
1838
1872
|
isImportingFromUrl: b,
|
|
1839
1873
|
importFromUrlError: x,
|
|
1840
|
-
importFromUrl:
|
|
1841
|
-
toggleSelection:
|
|
1842
|
-
clearSelection:
|
|
1843
|
-
selectItem:
|
|
1844
|
-
loadFolders:
|
|
1845
|
-
createFolder:
|
|
1846
|
-
renameFolder:
|
|
1847
|
-
deleteFolder:
|
|
1848
|
-
findFolderInTree:
|
|
1849
|
-
loadFrequentlyUsed:
|
|
1850
|
-
checkUsageBeforeDelete:
|
|
1851
|
-
confirmDelete:
|
|
1852
|
-
cancelDelete:
|
|
1874
|
+
importFromUrl: se,
|
|
1875
|
+
toggleSelection: K,
|
|
1876
|
+
clearSelection: q,
|
|
1877
|
+
selectItem: ce,
|
|
1878
|
+
loadFolders: Y,
|
|
1879
|
+
createFolder: le,
|
|
1880
|
+
renameFolder: ue,
|
|
1881
|
+
deleteFolder: de,
|
|
1882
|
+
findFolderInTree: X,
|
|
1883
|
+
loadFrequentlyUsed: W,
|
|
1884
|
+
checkUsageBeforeDelete: G,
|
|
1885
|
+
confirmDelete: ae,
|
|
1886
|
+
cancelDelete: oe,
|
|
1853
1887
|
isReplacing: S,
|
|
1854
1888
|
replaceError: C,
|
|
1855
1889
|
showReplaceWarning: w,
|
|
1856
1890
|
pendingReplaceItem: T,
|
|
1857
1891
|
replaceUsageInfo: E,
|
|
1858
|
-
checkUsageBeforeReplace:
|
|
1859
|
-
cancelReplace:
|
|
1860
|
-
replaceFile:
|
|
1861
|
-
replaceMediaDirectly:
|
|
1892
|
+
checkUsageBeforeReplace: fe,
|
|
1893
|
+
cancelReplace: pe,
|
|
1894
|
+
replaceFile: me,
|
|
1895
|
+
replaceMediaDirectly: he,
|
|
1862
1896
|
storageInfo: D,
|
|
1863
|
-
loadStorage:
|
|
1897
|
+
loadStorage: J
|
|
1864
1898
|
};
|
|
1865
1899
|
}
|
|
1866
1900
|
//#endregion
|
|
1867
1901
|
//#region src/components/MediaLibraryChrome.vue?vue&type=script&setup=true&lang.ts
|
|
1868
|
-
var
|
|
1902
|
+
var dn = { class: "tpl:relative tpl:flex tpl:min-h-0 tpl:flex-1 tpl:flex-col tpl:overflow-hidden" }, fn = {
|
|
1869
1903
|
class: "tpl:flex tpl:shrink-0 tpl:items-center tpl:justify-between tpl:border-b tpl:px-5 tpl:py-3.5",
|
|
1870
1904
|
style: { "border-color": "var(--tpl-border)" }
|
|
1871
|
-
},
|
|
1905
|
+
}, pn = {
|
|
1872
1906
|
id: "tpl-media-library-title",
|
|
1873
1907
|
class: "tpl:text-sm tpl:font-semibold",
|
|
1874
1908
|
style: { color: "var(--tpl-text)" }
|
|
1875
|
-
},
|
|
1909
|
+
}, mn = { class: "tpl:flex tpl:items-center tpl:gap-3" }, hn = { class: "tpl:relative" }, gn = [
|
|
1876
1910
|
"value",
|
|
1877
1911
|
"disabled",
|
|
1878
1912
|
"aria-label",
|
|
1879
1913
|
"placeholder"
|
|
1880
|
-
],
|
|
1914
|
+
], _n = ["aria-label"], vn = { class: "tpl:flex tpl:min-h-0 tpl:flex-1 tpl:overflow-hidden" }, yn = {
|
|
1881
1915
|
key: 0,
|
|
1882
1916
|
class: "tpl:flex tpl:w-48 tpl:shrink-0 tpl:flex-col tpl:border-r",
|
|
1883
1917
|
style: {
|
|
1884
1918
|
"border-color": "var(--tpl-border)",
|
|
1885
1919
|
"background-color": "var(--tpl-bg)"
|
|
1886
1920
|
}
|
|
1887
|
-
},
|
|
1921
|
+
}, bn = { class: "tpl:flex tpl:min-w-0 tpl:flex-1 tpl:flex-col" }, xn = {
|
|
1888
1922
|
class: "tpl:flex tpl:shrink-0 tpl:items-center tpl:justify-between tpl:border-b tpl:px-4 tpl:py-2.5",
|
|
1889
1923
|
style: { "border-color": "var(--tpl-border)" }
|
|
1890
|
-
},
|
|
1924
|
+
}, Sn = { class: "tpl:flex tpl:items-center tpl:gap-2" }, Cn = [
|
|
1891
1925
|
"title",
|
|
1892
1926
|
"aria-label",
|
|
1893
1927
|
"aria-pressed"
|
|
1894
|
-
],
|
|
1928
|
+
], wn = {
|
|
1895
1929
|
key: 1,
|
|
1896
1930
|
class: "tpl:text-xs tpl:font-medium",
|
|
1897
1931
|
style: { color: "var(--tpl-text)" }
|
|
1898
|
-
},
|
|
1932
|
+
}, Tn = {
|
|
1899
1933
|
class: "tpl:flex tpl:rounded-md tpl:p-0.5",
|
|
1900
1934
|
style: {
|
|
1901
1935
|
border: "1px solid var(--tpl-border)",
|
|
1902
1936
|
"background-color": "var(--tpl-bg)"
|
|
1903
1937
|
}
|
|
1904
|
-
},
|
|
1938
|
+
}, En = [
|
|
1905
1939
|
"title",
|
|
1906
1940
|
"aria-label",
|
|
1907
1941
|
"aria-pressed"
|
|
1908
|
-
],
|
|
1942
|
+
], Dn = [
|
|
1909
1943
|
"title",
|
|
1910
1944
|
"aria-label",
|
|
1911
1945
|
"aria-pressed"
|
|
1912
|
-
],
|
|
1946
|
+
], On = { class: "tpl:flex tpl:items-center tpl:gap-2" }, kn = ["aria-label", "value"], An = { value: "" }, jn = ["value"], Mn = { class: "tpl:min-h-0 tpl:flex-1 tpl:overflow-y-auto" }, Nn = {
|
|
1913
1947
|
key: 0,
|
|
1914
1948
|
class: "tpl:px-4 tpl:pt-3"
|
|
1915
|
-
},
|
|
1949
|
+
}, Pn = {
|
|
1916
1950
|
class: "tpl-scale-in tpl:mx-4 tpl:w-full tpl:max-w-sm tpl:rounded-[var(--tpl-radius-lg)] tpl:p-5",
|
|
1917
1951
|
style: {
|
|
1918
1952
|
"background-color": "var(--tpl-bg-elevated)",
|
|
1919
1953
|
"box-shadow": "var(--tpl-shadow-xl)"
|
|
1920
1954
|
}
|
|
1921
|
-
},
|
|
1955
|
+
}, Fn = {
|
|
1922
1956
|
id: "tpl-media-delete-title",
|
|
1923
1957
|
class: "tpl:mb-2 tpl:text-sm tpl:font-semibold",
|
|
1924
1958
|
style: { color: "var(--tpl-text)" }
|
|
1925
|
-
},
|
|
1959
|
+
}, In = {
|
|
1926
1960
|
key: 0,
|
|
1927
1961
|
"data-testid": "media-delete-usage",
|
|
1928
1962
|
class: "tpl:mb-4 tpl:text-xs",
|
|
1929
1963
|
style: { color: "var(--tpl-text-muted)" }
|
|
1930
|
-
},
|
|
1964
|
+
}, Ln = {
|
|
1931
1965
|
key: 1,
|
|
1932
1966
|
class: "tpl:mb-4 tpl:max-h-32 tpl:overflow-y-auto tpl:rounded tpl:border tpl:p-2",
|
|
1933
1967
|
style: { "border-color": "var(--tpl-border)" }
|
|
1934
|
-
},
|
|
1968
|
+
}, Rn = { class: "tpl:font-medium" }, zn = { style: { color: "var(--tpl-text-muted)" } }, Bn = { class: "tpl:flex tpl:justify-end tpl:gap-2" }, Vn = {
|
|
1935
1969
|
class: "tpl:flex tpl:shrink-0 tpl:items-center tpl:justify-between tpl:border-t tpl:px-5 tpl:py-3",
|
|
1936
1970
|
style: { "border-color": "var(--tpl-border)" }
|
|
1937
|
-
},
|
|
1971
|
+
}, Hn = { class: "tpl:flex tpl:min-w-0 tpl:flex-1 tpl:items-center tpl:gap-3" }, Un = { class: "tpl:flex tpl:items-center tpl:gap-5" }, Wn = {
|
|
1938
1972
|
key: 0,
|
|
1939
1973
|
class: "tpl:flex tpl:items-center tpl:gap-2"
|
|
1940
|
-
},
|
|
1974
|
+
}, Gn = {
|
|
1941
1975
|
key: 1,
|
|
1942
1976
|
class: "tpl:relative"
|
|
1943
|
-
},
|
|
1977
|
+
}, Kn = { class: "tpl:flex tpl:items-center tpl:gap-2" }, qn = ["data-testid", "disabled"], Jn = /* @__PURE__ */ a({
|
|
1944
1978
|
__name: "MediaLibraryChrome",
|
|
1945
1979
|
props: {
|
|
1946
1980
|
provider: {},
|
|
@@ -1958,7 +1992,7 @@ var sn = { class: "tpl:relative tpl:flex tpl:min-h-0 tpl:flex-1 tpl:flex-col tpl
|
|
|
1958
1992
|
"ready"
|
|
1959
1993
|
],
|
|
1960
1994
|
setup(n, { expose: i, emit: a }) {
|
|
1961
|
-
let c = n, l = a, m = p(() => import("./chunks/MediaEditModal-
|
|
1995
|
+
let c = n, l = a, m = p(() => import("./chunks/MediaEditModal-BNZEUoer.js")), y = r(() => c.translations), b = r(() => c.confirmTestId ?? "media-confirm"), S = {
|
|
1962
1996
|
get maxFileSize() {
|
|
1963
1997
|
return c.provider.maxFileSize;
|
|
1964
1998
|
},
|
|
@@ -1969,45 +2003,45 @@ var sn = { class: "tpl:relative tpl:flex tpl:min-h-0 tpl:flex-1 tpl:flex-col tpl
|
|
|
1969
2003
|
return c.accept;
|
|
1970
2004
|
}
|
|
1971
2005
|
};
|
|
1972
|
-
g(
|
|
1973
|
-
let { isAcceptedMimeType: C, availableCategories: k } =
|
|
2006
|
+
g(se, S);
|
|
2007
|
+
let { isAcceptedMimeType: C, availableCategories: k } = J(S), A = un({
|
|
1974
2008
|
provider: c.provider,
|
|
1975
2009
|
templateId: () => c.templateId,
|
|
1976
2010
|
onError: (e) => c.onError?.(e)
|
|
1977
|
-
}), F =
|
|
2011
|
+
}), F = ln({
|
|
1978
2012
|
library: A,
|
|
1979
2013
|
translations: y
|
|
1980
|
-
}), I = r(() => typeof c.provider.create == "function"), L = r(() => c.provider.folders !== !1), R = r(() => typeof c.provider.importFromUrl == "function"),
|
|
2014
|
+
}), I = r(() => typeof c.provider.create == "function"), L = r(() => c.provider.folders !== !1), R = r(() => typeof c.provider.importFromUrl == "function"), ee = r(() => typeof c.provider.delete == "function"), ne = r(() => typeof c.provider.update == "function"), z = r(() => typeof c.provider.replace == "function"), re = r(() => typeof c.provider.frequentlyUsed == "function"), B = r(() => {
|
|
1981
2015
|
let e = c.provider.folders;
|
|
1982
2016
|
return e !== !1 && typeof e.move == "function";
|
|
1983
|
-
}),
|
|
2017
|
+
}), W = r(() => {
|
|
1984
2018
|
let e = c.provider.folders;
|
|
1985
2019
|
return e !== !1 && typeof e.create == "function";
|
|
1986
|
-
}),
|
|
2020
|
+
}), ae = r(() => {
|
|
1987
2021
|
let e = c.provider.folders;
|
|
1988
2022
|
return e !== !1 && typeof e.update == "function";
|
|
1989
|
-
}),
|
|
2023
|
+
}), oe = r(() => {
|
|
1990
2024
|
let e = c.provider.folders;
|
|
1991
2025
|
return e !== !1 && typeof e.delete == "function";
|
|
1992
|
-
}),
|
|
2026
|
+
}), K = r(() => A.isLoading.value && F.displayItems.value.length === 0), q = r(() => {
|
|
1993
2027
|
let e = A.previewItem.value;
|
|
1994
2028
|
return e ? !c.accept?.length || C(e.mimeType ?? "", c.accept) : !1;
|
|
1995
|
-
}),
|
|
1996
|
-
if (!
|
|
2029
|
+
}), ce = r(() => {
|
|
2030
|
+
if (!ee.value) return 0;
|
|
1997
2031
|
let e = 0;
|
|
1998
2032
|
for (let t of A.selectedItems.value) F.displayItems.value.find((e) => e.id === t)?.canDelete !== !1 && (e += 1);
|
|
1999
2033
|
return e;
|
|
2000
|
-
}),
|
|
2001
|
-
function
|
|
2002
|
-
return
|
|
2034
|
+
}), Y = r(() => F.showImportUrlModal.value || F.editingItem.value !== null || A.showReplaceWarning.value);
|
|
2035
|
+
function le() {
|
|
2036
|
+
return Y.value ? !0 : F.showMovePicker.value ? (F.showMovePicker.value = !1, !0) : A.showDeleteWarning.value ? (A.cancelDelete(), !0) : !1;
|
|
2003
2037
|
}
|
|
2004
|
-
function
|
|
2005
|
-
|
|
2038
|
+
function X() {
|
|
2039
|
+
q.value && A.previewItem.value && l("confirm", A.previewItem.value);
|
|
2006
2040
|
}
|
|
2007
|
-
function
|
|
2041
|
+
function ue(e) {
|
|
2008
2042
|
A.filterByCategory(e.target.value || null);
|
|
2009
2043
|
}
|
|
2010
|
-
async function
|
|
2044
|
+
async function de() {
|
|
2011
2045
|
let e = /* @__PURE__ */ new Set();
|
|
2012
2046
|
for (let t of A.selectedItems.value) F.displayItems.value.find((e) => e.id === t)?.canDelete !== !1 && e.add(t);
|
|
2013
2047
|
A.selectedItems.value = e, await F.handleDeleteClick();
|
|
@@ -2017,22 +2051,22 @@ var sn = { class: "tpl:relative tpl:flex tpl:min-h-0 tpl:flex-1 tpl:flex-col tpl
|
|
|
2017
2051
|
}, { immediate: !0 }), A.loadItems(), A.loadFrequentlyUsed(), A.loadStorage(), l("ready"), t(() => {
|
|
2018
2052
|
F.resetUI();
|
|
2019
2053
|
}), i({
|
|
2020
|
-
nestedDialogOpen:
|
|
2021
|
-
handleEscape:
|
|
2054
|
+
nestedDialogOpen: Y,
|
|
2055
|
+
handleEscape: le,
|
|
2022
2056
|
library: A,
|
|
2023
2057
|
ui: F
|
|
2024
|
-
}), (t, r) => (o(), j("div",
|
|
2025
|
-
f("div",
|
|
2026
|
-
w(A).storageInfo.value ? (o(), M(
|
|
2058
|
+
}), (t, r) => (o(), j("div", dn, [
|
|
2059
|
+
f("div", fn, [f("h2", pn, E(y.value.mediaLibrary.title), 1), f("div", mn, [
|
|
2060
|
+
w(A).storageInfo.value ? (o(), M(sn, {
|
|
2027
2061
|
key: 0,
|
|
2028
2062
|
"used-bytes": w(A).storageInfo.value.usedBytes,
|
|
2029
2063
|
"limit-bytes": w(A).storageInfo.value.limitBytes,
|
|
2030
2064
|
size: 22
|
|
2031
2065
|
}, null, 8, ["used-bytes", "limit-bytes"])) : e("", !0),
|
|
2032
|
-
f("div",
|
|
2066
|
+
f("div", hn, [f("input", {
|
|
2033
2067
|
value: w(F).searchInput.value,
|
|
2034
2068
|
type: "search",
|
|
2035
|
-
disabled:
|
|
2069
|
+
disabled: K.value,
|
|
2036
2070
|
"aria-label": y.value.mediaLibrary.searchAriaLabel,
|
|
2037
2071
|
class: "tpl:w-52 tpl:rounded-md tpl:border tpl:py-1.5 tpl:pr-3 tpl:pl-8 tpl:text-xs tpl:shadow-xs tpl:transition-all tpl:duration-150 tpl:outline-none tpl:focus:shadow-[var(--tpl-ring)] tpl:disabled:cursor-not-allowed tpl:disabled:opacity-50",
|
|
2038
2072
|
style: {
|
|
@@ -2042,7 +2076,7 @@ var sn = { class: "tpl:relative tpl:flex tpl:min-h-0 tpl:flex-1 tpl:flex-col tpl
|
|
|
2042
2076
|
},
|
|
2043
2077
|
placeholder: y.value.mediaLibrary.searchPlaceholder,
|
|
2044
2078
|
onInput: r[0] ||= (e) => w(F).handleSearchInput(e.target.value)
|
|
2045
|
-
}, null, 40,
|
|
2079
|
+
}, null, 40, gn), d(w(x), {
|
|
2046
2080
|
class: "tpl:absolute tpl:top-1/2 tpl:left-2.5 tpl:-translate-y-1/2",
|
|
2047
2081
|
size: 13,
|
|
2048
2082
|
"stroke-width": 2,
|
|
@@ -2055,12 +2089,12 @@ var sn = { class: "tpl:relative tpl:flex tpl:min-h-0 tpl:flex-1 tpl:flex-col tpl
|
|
|
2055
2089
|
class: "tpl:flex tpl:size-7 tpl:items-center tpl:justify-center tpl:rounded-md tpl:transition-all tpl:duration-150",
|
|
2056
2090
|
style: { color: "var(--tpl-text-muted)" },
|
|
2057
2091
|
onClick: r[1] ||= (e) => l("close")
|
|
2058
|
-
}, [d(w(
|
|
2092
|
+
}, [d(w(ie), {
|
|
2059
2093
|
size: 18,
|
|
2060
2094
|
"stroke-width": 2
|
|
2061
|
-
})], 8,
|
|
2095
|
+
})], 8, _n)) : e("", !0)
|
|
2062
2096
|
])]),
|
|
2063
|
-
f("div",
|
|
2097
|
+
f("div", vn, [d(G, {
|
|
2064
2098
|
"enter-active-class": "tpl:transition-all tpl:duration-200 tpl:ease-out",
|
|
2065
2099
|
"enter-from-class": "tpl:-ml-48 tpl:opacity-0",
|
|
2066
2100
|
"enter-to-class": "tpl:ml-0 tpl:opacity-100",
|
|
@@ -2068,14 +2102,14 @@ var sn = { class: "tpl:relative tpl:flex tpl:min-h-0 tpl:flex-1 tpl:flex-col tpl
|
|
|
2068
2102
|
"leave-from-class": "tpl:ml-0 tpl:opacity-100",
|
|
2069
2103
|
"leave-to-class": "tpl:-ml-48 tpl:opacity-0"
|
|
2070
2104
|
}, {
|
|
2071
|
-
default: v(() => [L.value && w(F).showSidebar.value ? (o(), j("div",
|
|
2105
|
+
default: v(() => [L.value && w(F).showSidebar.value ? (o(), j("div", yn, [d(je, {
|
|
2072
2106
|
folders: w(F).folderTree.value,
|
|
2073
2107
|
"current-folder-id": w(A).currentFolderId.value,
|
|
2074
2108
|
"view-mode": w(A).viewMode.value,
|
|
2075
|
-
"has-frequently-used":
|
|
2076
|
-
"can-create-folder":
|
|
2077
|
-
"can-rename-folder":
|
|
2078
|
-
"can-delete-folder":
|
|
2109
|
+
"has-frequently-used": re.value && w(F).hasFrequentlyUsed.value,
|
|
2110
|
+
"can-create-folder": W.value,
|
|
2111
|
+
"can-rename-folder": ae.value,
|
|
2112
|
+
"can-delete-folder": oe.value,
|
|
2079
2113
|
onNavigate: w(A).navigateToFolder,
|
|
2080
2114
|
onCreateFolder: w(F).handleCreateFolder,
|
|
2081
2115
|
onRenameFolder: w(F).handleRenameFolder,
|
|
@@ -2096,13 +2130,13 @@ var sn = { class: "tpl:relative tpl:flex tpl:min-h-0 tpl:flex-1 tpl:flex-col tpl
|
|
|
2096
2130
|
"onShowFrequentlyUsed"
|
|
2097
2131
|
])])) : e("", !0)]),
|
|
2098
2132
|
_: 1
|
|
2099
|
-
}), f("div",
|
|
2133
|
+
}), f("div", bn, [f("div", xn, [f("div", Sn, [
|
|
2100
2134
|
L.value ? (o(), j("button", {
|
|
2101
2135
|
key: 0,
|
|
2102
2136
|
type: "button",
|
|
2103
2137
|
"data-testid": "media-folder-toggle",
|
|
2104
2138
|
class: "tpl:flex tpl:size-7 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded-md tpl:transition-all tpl:duration-150",
|
|
2105
|
-
style:
|
|
2139
|
+
style: V({
|
|
2106
2140
|
color: w(F).showSidebar.value ? "var(--tpl-primary)" : "var(--tpl-text-muted)",
|
|
2107
2141
|
backgroundColor: w(F).showSidebar.value ? "var(--tpl-bg)" : "transparent",
|
|
2108
2142
|
border: w(F).showSidebar.value ? "1px solid var(--tpl-border)" : "1px solid transparent"
|
|
@@ -2114,8 +2148,8 @@ var sn = { class: "tpl:relative tpl:flex tpl:min-h-0 tpl:flex-1 tpl:flex-col tpl
|
|
|
2114
2148
|
}, [d(w(N), {
|
|
2115
2149
|
size: 16,
|
|
2116
2150
|
"stroke-width": 2
|
|
2117
|
-
})], 12,
|
|
2118
|
-
w(A).viewMode.value === "frequently-used" ? (o(), j("span",
|
|
2151
|
+
})], 12, Cn)) : e("", !0),
|
|
2152
|
+
w(A).viewMode.value === "frequently-used" ? (o(), j("span", wn, E(y.value.mediaLibrary.frequentlyUsed), 1)) : (o(), M(_e, {
|
|
2119
2153
|
key: 2,
|
|
2120
2154
|
folders: w(F).folderTree.value,
|
|
2121
2155
|
"current-folder-id": w(A).currentFolderId.value,
|
|
@@ -2125,10 +2159,10 @@ var sn = { class: "tpl:relative tpl:flex tpl:min-h-0 tpl:flex-1 tpl:flex-col tpl
|
|
|
2125
2159
|
"current-folder-id",
|
|
2126
2160
|
"onNavigate"
|
|
2127
2161
|
])),
|
|
2128
|
-
f("div",
|
|
2162
|
+
f("div", Tn, [f("button", {
|
|
2129
2163
|
type: "button",
|
|
2130
2164
|
class: "tpl:flex tpl:size-6 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded tpl:transition-all tpl:duration-150",
|
|
2131
|
-
style:
|
|
2165
|
+
style: V({
|
|
2132
2166
|
color: w(F).layoutMode.value === "grid" ? "var(--tpl-primary)" : "var(--tpl-text-muted)",
|
|
2133
2167
|
backgroundColor: w(F).layoutMode.value === "grid" ? "var(--tpl-bg-elevated)" : "transparent"
|
|
2134
2168
|
}),
|
|
@@ -2136,13 +2170,13 @@ var sn = { class: "tpl:relative tpl:flex tpl:min-h-0 tpl:flex-1 tpl:flex-col tpl
|
|
|
2136
2170
|
"aria-label": y.value.mediaLibrary.viewGrid,
|
|
2137
2171
|
"aria-pressed": w(F).layoutMode.value === "grid",
|
|
2138
2172
|
onClick: r[3] ||= (e) => w(F).layoutMode.value = "grid"
|
|
2139
|
-
}, [d(w(
|
|
2173
|
+
}, [d(w(te), {
|
|
2140
2174
|
size: 14,
|
|
2141
2175
|
"stroke-width": 2
|
|
2142
|
-
})], 12,
|
|
2176
|
+
})], 12, En), f("button", {
|
|
2143
2177
|
type: "button",
|
|
2144
2178
|
class: "tpl:flex tpl:size-6 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded tpl:transition-all tpl:duration-150",
|
|
2145
|
-
style:
|
|
2179
|
+
style: V({
|
|
2146
2180
|
color: w(F).layoutMode.value === "list" ? "var(--tpl-primary)" : "var(--tpl-text-muted)",
|
|
2147
2181
|
backgroundColor: w(F).layoutMode.value === "list" ? "var(--tpl-bg-elevated)" : "transparent"
|
|
2148
2182
|
}),
|
|
@@ -2153,8 +2187,8 @@ var sn = { class: "tpl:relative tpl:flex tpl:min-h-0 tpl:flex-1 tpl:flex-col tpl
|
|
|
2153
2187
|
}, [d(w(T), {
|
|
2154
2188
|
size: 14,
|
|
2155
2189
|
"stroke-width": 2
|
|
2156
|
-
})], 12,
|
|
2157
|
-
]), f("div",
|
|
2190
|
+
})], 12, Dn)])
|
|
2191
|
+
]), f("div", On, [w(k).length > 1 ? (o(), j("select", {
|
|
2158
2192
|
key: 0,
|
|
2159
2193
|
"aria-label": y.value.mediaLibrary.filterAriaLabel,
|
|
2160
2194
|
class: "tpl:rounded-md tpl:border tpl:py-1.5 tpl:pr-7 tpl:pl-2.5 tpl:text-xs tpl:transition-all tpl:duration-150 tpl:outline-none",
|
|
@@ -2164,11 +2198,11 @@ var sn = { class: "tpl:relative tpl:flex tpl:min-h-0 tpl:flex-1 tpl:flex-col tpl
|
|
|
2164
2198
|
color: "var(--tpl-text)"
|
|
2165
2199
|
},
|
|
2166
2200
|
value: w(A).categoryFilter.value ?? "",
|
|
2167
|
-
onChange:
|
|
2168
|
-
}, [f("option",
|
|
2201
|
+
onChange: ue
|
|
2202
|
+
}, [f("option", An, E(y.value.mediaLibrary.filterAll), 1), (o(!0), j(h, null, _(w(k), (e) => (o(), j("option", {
|
|
2169
2203
|
key: e,
|
|
2170
2204
|
value: e
|
|
2171
|
-
}, E(w(F).getCategoryLabel(e)), 9,
|
|
2205
|
+
}, E(w(F).getCategoryLabel(e)), 9, jn))), 128))], 40, kn)) : e("", !0)])]), f("div", Mn, [w(A).viewMode.value === "files" && (I.value || R.value) ? (o(), j("div", Nn, [I.value ? (o(), M(en, {
|
|
2172
2206
|
key: 0,
|
|
2173
2207
|
"is-uploading": w(A).isUploading.value,
|
|
2174
2208
|
"upload-progress": w(A).uploadProgress.value,
|
|
@@ -2190,7 +2224,7 @@ var sn = { class: "tpl:relative tpl:flex tpl:min-h-0 tpl:flex-1 tpl:flex-col tpl
|
|
|
2190
2224
|
}, [d(w(D), {
|
|
2191
2225
|
size: 14,
|
|
2192
2226
|
"stroke-width": 2
|
|
2193
|
-
}), u(" " + E(y.value.mediaLibrary.importFromUrl), 1)])) : e("", !0)])) : e("", !0), d(
|
|
2227
|
+
}), u(" " + E(y.value.mediaLibrary.importFromUrl), 1)])) : e("", !0)])) : e("", !0), d(lt, {
|
|
2194
2228
|
items: w(F).displayItems.value,
|
|
2195
2229
|
"selected-ids": w(A).selectedItems.value,
|
|
2196
2230
|
"is-loading": w(A).isLoading.value,
|
|
@@ -2198,14 +2232,14 @@ var sn = { class: "tpl:relative tpl:flex tpl:min-h-0 tpl:flex-1 tpl:flex-col tpl
|
|
|
2198
2232
|
accept: n.accept,
|
|
2199
2233
|
layout: w(F).layoutMode.value,
|
|
2200
2234
|
"search-query": w(A).searchQuery.value,
|
|
2201
|
-
"can-update":
|
|
2202
|
-
"can-replace":
|
|
2235
|
+
"can-update": ne.value,
|
|
2236
|
+
"can-replace": z.value,
|
|
2203
2237
|
onSelect: w(F).handleSelect,
|
|
2204
2238
|
onToggle: w(A).toggleSelection,
|
|
2205
2239
|
onLoadMore: w(A).loadMore,
|
|
2206
2240
|
onEdit: w(F).handleEditItem,
|
|
2207
2241
|
onReplace: w(F).handleReplaceItem,
|
|
2208
|
-
onConfirm:
|
|
2242
|
+
onConfirm: X
|
|
2209
2243
|
}, null, 8, [
|
|
2210
2244
|
"items",
|
|
2211
2245
|
"selected-ids",
|
|
@@ -2222,7 +2256,7 @@ var sn = { class: "tpl:relative tpl:flex tpl:min-h-0 tpl:flex-1 tpl:flex-col tpl
|
|
|
2222
2256
|
"onEdit",
|
|
2223
2257
|
"onReplace"
|
|
2224
2258
|
])])])]),
|
|
2225
|
-
d(
|
|
2259
|
+
d(bt, {
|
|
2226
2260
|
visible: w(F).showImportUrlModal.value,
|
|
2227
2261
|
"is-importing": w(A).isImportingFromUrl.value,
|
|
2228
2262
|
error: w(A).importFromUrlError.value,
|
|
@@ -2238,10 +2272,15 @@ var sn = { class: "tpl:relative tpl:flex tpl:min-h-0 tpl:flex-1 tpl:flex-col tpl
|
|
|
2238
2272
|
key: 0,
|
|
2239
2273
|
visible: !0,
|
|
2240
2274
|
item: w(F).editingItem.value,
|
|
2241
|
-
|
|
2275
|
+
save: w(F).handleEditSave,
|
|
2276
|
+
"can-crop": z.value && w(F).editingItem.value.canUpdate !== !1,
|
|
2242
2277
|
onClose: r[7] ||= (e) => w(F).editingItem.value = null
|
|
2243
|
-
}, null, 8, [
|
|
2244
|
-
|
|
2278
|
+
}, null, 8, [
|
|
2279
|
+
"item",
|
|
2280
|
+
"save",
|
|
2281
|
+
"can-crop"
|
|
2282
|
+
])) : e("", !0),
|
|
2283
|
+
d(Kt, {
|
|
2245
2284
|
visible: w(A).showReplaceWarning.value,
|
|
2246
2285
|
item: w(A).pendingReplaceItem.value,
|
|
2247
2286
|
"usage-info": w(A).replaceUsageInfo.value,
|
|
@@ -2258,7 +2297,7 @@ var sn = { class: "tpl:relative tpl:flex tpl:min-h-0 tpl:flex-1 tpl:flex-col tpl
|
|
|
2258
2297
|
"onReplace",
|
|
2259
2298
|
"onClose"
|
|
2260
2299
|
]),
|
|
2261
|
-
d(
|
|
2300
|
+
d(G, {
|
|
2262
2301
|
"enter-active-class": "tpl:transition tpl:ease-out tpl:duration-150",
|
|
2263
2302
|
"enter-from-class": "tpl:opacity-0",
|
|
2264
2303
|
"enter-to-class": "tpl:opacity-100",
|
|
@@ -2277,20 +2316,20 @@ var sn = { class: "tpl:relative tpl:flex tpl:min-h-0 tpl:flex-1 tpl:flex-col tpl
|
|
|
2277
2316
|
"backdrop-filter": "blur(8px)",
|
|
2278
2317
|
"-webkit-backdrop-filter": "blur(8px)"
|
|
2279
2318
|
},
|
|
2280
|
-
onClick: r[10] ||=
|
|
2281
|
-
}, [f("div",
|
|
2282
|
-
f("h3",
|
|
2319
|
+
onClick: r[10] ||= U((...e) => w(A).cancelDelete && w(A).cancelDelete(...e), ["self"])
|
|
2320
|
+
}, [f("div", Pn, [
|
|
2321
|
+
f("h3", Fn, E(y.value.mediaLibrary.deleteWarningTitle), 1),
|
|
2283
2322
|
f("p", {
|
|
2284
2323
|
class: P(["tpl:text-xs", w(F).hasUsedFiles.value ? "tpl:mb-2" : "tpl:mb-4"]),
|
|
2285
2324
|
style: { color: "var(--tpl-text-muted)" }
|
|
2286
2325
|
}, E(y.value.mediaLibrary.deleteWarningMessage), 3),
|
|
2287
|
-
w(F).hasUsedFiles.value ? (o(), j("p",
|
|
2288
|
-
w(F).hasUsedFiles.value ? (o(), j("div",
|
|
2326
|
+
w(F).hasUsedFiles.value ? (o(), j("p", In, E(y.value.mediaLibrary.deleteWarningUsageNote), 1)) : e("", !0),
|
|
2327
|
+
w(F).hasUsedFiles.value ? (o(), j("div", Ln, [(o(!0), j(h, null, _(w(A).deleteUsageInfo.value, (t, n) => (o(), j("div", {
|
|
2289
2328
|
key: n,
|
|
2290
2329
|
class: "tpl:text-xs",
|
|
2291
2330
|
style: { color: "var(--tpl-text)" }
|
|
2292
|
-
}, [t.templateCount > 0 ? (o(), j(h, { key: 0 }, [f("span",
|
|
2293
|
-
f("div",
|
|
2331
|
+
}, [t.templateCount > 0 ? (o(), j(h, { key: 0 }, [f("span", Rn, E(w(F).displayItems.value.find((e) => e.id === n)?.filename || n), 1), f("span", zn, " - " + E(y.value.mediaLibrary.usedInTemplates.replace("{count}", t.templateCount.toString())), 1)], 64)) : e("", !0)]))), 128))])) : e("", !0),
|
|
2332
|
+
f("div", Bn, [f("button", {
|
|
2294
2333
|
class: "tpl:cursor-pointer tpl:rounded-md tpl:border tpl:px-3 tpl:py-1.5 tpl:text-xs tpl:font-medium tpl:transition-all tpl:duration-150",
|
|
2295
2334
|
style: {
|
|
2296
2335
|
"border-color": "var(--tpl-border)",
|
|
@@ -2310,20 +2349,20 @@ var sn = { class: "tpl:relative tpl:flex tpl:min-h-0 tpl:flex-1 tpl:flex-col tpl
|
|
|
2310
2349
|
])])) : e("", !0)]),
|
|
2311
2350
|
_: 1
|
|
2312
2351
|
}),
|
|
2313
|
-
f("div",
|
|
2352
|
+
f("div", Vn, [f("div", Hn, [w(A).previewItem.value ? (o(), M(Mt, {
|
|
2314
2353
|
key: 0,
|
|
2315
2354
|
item: w(A).previewItem.value,
|
|
2316
2355
|
folders: w(F).folderTree.value
|
|
2317
|
-
}, null, 8, ["item", "folders"])) : e("", !0)]), f("div",
|
|
2356
|
+
}, null, 8, ["item", "folders"])) : e("", !0)]), f("div", Un, [w(A).selectedItems.value.size > 0 ? (o(), j("div", Wn, [w(A).previewItem.value ? (o(), j("button", {
|
|
2318
2357
|
key: 0,
|
|
2319
2358
|
class: "tpl:flex tpl:cursor-pointer tpl:items-center tpl:gap-1 tpl:rounded-md tpl:border tpl:px-3 tpl:py-1.5 tpl:text-xs tpl:font-medium tpl:transition-all tpl:duration-150",
|
|
2320
|
-
style:
|
|
2359
|
+
style: V({
|
|
2321
2360
|
borderColor: w(F).copied.value ? "var(--tpl-success)" : "var(--tpl-border)",
|
|
2322
2361
|
color: w(F).copied.value ? "var(--tpl-success)" : "var(--tpl-text)",
|
|
2323
2362
|
backgroundColor: "var(--tpl-bg)"
|
|
2324
2363
|
}),
|
|
2325
2364
|
onClick: r[11] ||= (e) => w(F).copy(w(F).selectedUrl.value)
|
|
2326
|
-
}, [w(F).copied.value ? (o(), M(w(
|
|
2365
|
+
}, [w(F).copied.value ? (o(), M(w(H), {
|
|
2327
2366
|
key: 1,
|
|
2328
2367
|
size: 12,
|
|
2329
2368
|
"stroke-width": 2
|
|
@@ -2331,7 +2370,7 @@ var sn = { class: "tpl:relative tpl:flex tpl:min-h-0 tpl:flex-1 tpl:flex-col tpl
|
|
|
2331
2370
|
key: 0,
|
|
2332
2371
|
size: 12,
|
|
2333
2372
|
"stroke-width": 2
|
|
2334
|
-
})), u(" " + E(w(F).copied.value ? y.value.mediaLibrary.copied : y.value.mediaLibrary.copyUrl), 1)], 4)) : e("", !0),
|
|
2373
|
+
})), u(" " + E(w(F).copied.value ? y.value.mediaLibrary.copied : y.value.mediaLibrary.copyUrl), 1)], 4)) : e("", !0), B.value ? (o(), j("div", Gn, [f("button", {
|
|
2335
2374
|
class: "tpl:cursor-pointer tpl:rounded-md tpl:border tpl:px-3 tpl:py-1.5 tpl:text-xs tpl:font-medium tpl:transition-all tpl:duration-150",
|
|
2336
2375
|
style: {
|
|
2337
2376
|
"border-color": "var(--tpl-border)",
|
|
@@ -2339,7 +2378,7 @@ var sn = { class: "tpl:relative tpl:flex tpl:min-h-0 tpl:flex-1 tpl:flex-col tpl
|
|
|
2339
2378
|
"background-color": "var(--tpl-bg)"
|
|
2340
2379
|
},
|
|
2341
2380
|
onClick: r[12] ||= (e) => w(F).showMovePicker.value = !w(F).showMovePicker.value
|
|
2342
|
-
}, E(y.value.mediaLibrary.moveSelected), 1), w(F).showMovePicker.value ? (o(), M(
|
|
2381
|
+
}, E(y.value.mediaLibrary.moveSelected), 1), w(F).showMovePicker.value ? (o(), M(Tt, {
|
|
2343
2382
|
key: 0,
|
|
2344
2383
|
folders: w(F).folderTree.value,
|
|
2345
2384
|
"current-folder-id": w(A).currentFolderId.value,
|
|
@@ -2349,7 +2388,7 @@ var sn = { class: "tpl:relative tpl:flex tpl:min-h-0 tpl:flex-1 tpl:flex-col tpl
|
|
|
2349
2388
|
"folders",
|
|
2350
2389
|
"current-folder-id",
|
|
2351
2390
|
"onSelect"
|
|
2352
|
-
])) : e("", !0)])) : e("", !0)])) : e("", !0), f("div",
|
|
2391
|
+
])) : e("", !0)])) : e("", !0)])) : e("", !0), f("div", Kn, [ce.value > 0 ? (o(), j("button", {
|
|
2353
2392
|
key: 0,
|
|
2354
2393
|
"data-testid": "media-delete",
|
|
2355
2394
|
class: "tpl:cursor-pointer tpl:rounded-md tpl:border tpl:px-3 tpl:py-1.5 tpl:text-xs tpl:font-medium tpl:transition-all tpl:duration-150",
|
|
@@ -2358,7 +2397,7 @@ var sn = { class: "tpl:relative tpl:flex tpl:min-h-0 tpl:flex-1 tpl:flex-col tpl
|
|
|
2358
2397
|
color: "var(--tpl-danger)",
|
|
2359
2398
|
"background-color": "var(--tpl-bg)"
|
|
2360
2399
|
},
|
|
2361
|
-
onClick:
|
|
2400
|
+
onClick: de
|
|
2362
2401
|
}, E(y.value.mediaLibrary.deleteSelected), 1)) : e("", !0), n.showConfirm ? (o(), j("button", {
|
|
2363
2402
|
key: 1,
|
|
2364
2403
|
"data-testid": b.value,
|
|
@@ -2367,12 +2406,12 @@ var sn = { class: "tpl:relative tpl:flex tpl:min-h-0 tpl:flex-1 tpl:flex-col tpl
|
|
|
2367
2406
|
"background-color": "var(--tpl-primary)",
|
|
2368
2407
|
color: "var(--tpl-on-primary)"
|
|
2369
2408
|
},
|
|
2370
|
-
disabled: !
|
|
2371
|
-
onClick:
|
|
2372
|
-
}, E(n.accept?.length ? y.value.mediaLibrary.selectImage : y.value.mediaLibrary.selectFile), 9,
|
|
2409
|
+
disabled: !q.value,
|
|
2410
|
+
onClick: X
|
|
2411
|
+
}, E(n.accept?.length ? y.value.mediaLibrary.selectImage : y.value.mediaLibrary.selectFile), 9, qn)) : e("", !0)])])])
|
|
2373
2412
|
]));
|
|
2374
2413
|
}
|
|
2375
|
-
}),
|
|
2414
|
+
}), Yn = /* @__PURE__ */ a({
|
|
2376
2415
|
__name: "MediaLibrary",
|
|
2377
2416
|
props: {
|
|
2378
2417
|
provider: {},
|
|
@@ -2384,9 +2423,9 @@ var sn = { class: "tpl:relative tpl:flex tpl:min-h-0 tpl:flex-1 tpl:flex-col tpl
|
|
|
2384
2423
|
emits: ["ready"],
|
|
2385
2424
|
setup(e, { emit: t }) {
|
|
2386
2425
|
let n = e, i = t, a = r(() => n.translations);
|
|
2387
|
-
g(
|
|
2426
|
+
g(ue, L(n.translations)), g(Y, ee(() => n.locale));
|
|
2388
2427
|
let s = L(null);
|
|
2389
|
-
g(
|
|
2428
|
+
g(K, s);
|
|
2390
2429
|
function c(e) {
|
|
2391
2430
|
n.onSelect?.(e);
|
|
2392
2431
|
}
|
|
@@ -2400,7 +2439,7 @@ var sn = { class: "tpl:relative tpl:flex tpl:min-h-0 tpl:flex-1 tpl:flex-col tpl
|
|
|
2400
2439
|
"background-color": "var(--tpl-bg-elevated)",
|
|
2401
2440
|
border: "1px solid var(--tpl-border)"
|
|
2402
2441
|
}
|
|
2403
|
-
}, [d(
|
|
2442
|
+
}, [d(Jn, {
|
|
2404
2443
|
provider: e.provider,
|
|
2405
2444
|
accept: e.accept,
|
|
2406
2445
|
translations: a.value,
|
|
@@ -2415,60 +2454,60 @@ var sn = { class: "tpl:relative tpl:flex tpl:min-h-0 tpl:flex-1 tpl:flex-col tpl
|
|
|
2415
2454
|
"show-confirm"
|
|
2416
2455
|
])], 512));
|
|
2417
2456
|
}
|
|
2418
|
-
}),
|
|
2419
|
-
"./locales/ca.ts": () => import("./chunks/ca-
|
|
2420
|
-
"./locales/de.ts": () => import("./chunks/de-
|
|
2421
|
-
"./locales/en.ts": () => import("./chunks/en-
|
|
2422
|
-
"./locales/es.ts": () => import("./chunks/es-
|
|
2423
|
-
"./locales/fr.ts": () => import("./chunks/fr-
|
|
2424
|
-
"./locales/ja.ts": () => import("./chunks/ja-
|
|
2425
|
-
"./locales/nl.ts": () => import("./chunks/nl-
|
|
2426
|
-
"./locales/pt-BR.ts": () => import("./chunks/pt-BR-
|
|
2457
|
+
}), Xn = /* #__PURE__ */ Object.assign({
|
|
2458
|
+
"./locales/ca.ts": () => import("./chunks/ca-DyHL0z4N.js"),
|
|
2459
|
+
"./locales/de.ts": () => import("./chunks/de-Dcy8LcNQ.js"),
|
|
2460
|
+
"./locales/en.ts": () => import("./chunks/en-w2ihxIL6.js").then((e) => e.n),
|
|
2461
|
+
"./locales/es.ts": () => import("./chunks/es-B43D0gmB.js"),
|
|
2462
|
+
"./locales/fr.ts": () => import("./chunks/fr-DsxaRm09.js"),
|
|
2463
|
+
"./locales/ja.ts": () => import("./chunks/ja-DDI6z0aO.js"),
|
|
2464
|
+
"./locales/nl.ts": () => import("./chunks/nl-CHa6u0cR.js"),
|
|
2465
|
+
"./locales/pt-BR.ts": () => import("./chunks/pt-BR-CZmeAVC3.js")
|
|
2427
2466
|
});
|
|
2428
|
-
function
|
|
2467
|
+
function Zn(e) {
|
|
2429
2468
|
return Object.keys(e).map((e) => e.match(/\/([^/]+)\.ts$/)?.[1]).filter((e) => !!e);
|
|
2430
2469
|
}
|
|
2431
|
-
var
|
|
2432
|
-
function
|
|
2470
|
+
var Qn = Zn(Xn);
|
|
2471
|
+
function $n(e) {
|
|
2433
2472
|
return e.trim().replace(/_/g, "-").toLowerCase();
|
|
2434
2473
|
}
|
|
2435
|
-
function
|
|
2436
|
-
let t =
|
|
2437
|
-
return
|
|
2474
|
+
function er(e) {
|
|
2475
|
+
let t = $n(e);
|
|
2476
|
+
return Qn.find((e) => $n(e) === t);
|
|
2438
2477
|
}
|
|
2439
|
-
function
|
|
2440
|
-
return
|
|
2478
|
+
function tr(e) {
|
|
2479
|
+
return $n(e).split("-")[0];
|
|
2441
2480
|
}
|
|
2442
|
-
function
|
|
2443
|
-
return
|
|
2481
|
+
function nr(e) {
|
|
2482
|
+
return er(e) ?? er(tr(e)) ?? "en";
|
|
2444
2483
|
}
|
|
2445
|
-
async function
|
|
2446
|
-
let t =
|
|
2484
|
+
async function rr(e) {
|
|
2485
|
+
let t = Xn[`./locales/${nr(e)}.ts`];
|
|
2447
2486
|
return (await t()).default;
|
|
2448
2487
|
}
|
|
2449
2488
|
//#endregion
|
|
2450
2489
|
//#region src/standalone/visual.ts
|
|
2451
|
-
var $ = null,
|
|
2452
|
-
async function
|
|
2490
|
+
var $ = null, ir = L(null);
|
|
2491
|
+
async function ar(e) {
|
|
2453
2492
|
let t = typeof e.container == "string" ? document.querySelector(e.container) : e.container;
|
|
2454
2493
|
if (!t) throw Error(`Container element not found: ${e.container}`);
|
|
2455
|
-
let n = await
|
|
2456
|
-
return
|
|
2494
|
+
let n = await rr(e.locale ?? "en");
|
|
2495
|
+
return sr(t, e.theme), $ && or(), new Promise((r, i) => {
|
|
2457
2496
|
try {
|
|
2458
2497
|
$ = S({ setup() {
|
|
2459
2498
|
let i = () => {
|
|
2460
2499
|
r({
|
|
2461
|
-
setTheme: (e) =>
|
|
2462
|
-
unmount:
|
|
2500
|
+
setTheme: (e) => sr(t, e),
|
|
2501
|
+
unmount: or
|
|
2463
2502
|
});
|
|
2464
2503
|
};
|
|
2465
|
-
return () => l(
|
|
2504
|
+
return () => l(Yn, {
|
|
2466
2505
|
provider: e.provider,
|
|
2467
2506
|
translations: n,
|
|
2468
2507
|
onSelect: e.onSelect,
|
|
2469
2508
|
accept: e.accept,
|
|
2470
2509
|
locale: e.locale,
|
|
2471
|
-
ref:
|
|
2510
|
+
ref: ir,
|
|
2472
2511
|
onReady: i
|
|
2473
2512
|
});
|
|
2474
2513
|
} }), $.mount(t);
|
|
@@ -2477,18 +2516,18 @@ async function tr(e) {
|
|
|
2477
2516
|
}
|
|
2478
2517
|
});
|
|
2479
2518
|
}
|
|
2480
|
-
function
|
|
2481
|
-
$ && ($.unmount(), $ = null,
|
|
2519
|
+
function or() {
|
|
2520
|
+
$ && ($.unmount(), $ = null, ir.value = null);
|
|
2482
2521
|
}
|
|
2483
|
-
function
|
|
2522
|
+
function sr(e, t) {
|
|
2484
2523
|
t && (t.primaryColor && e.style.setProperty("--tpl-user-primary", t.primaryColor), t.borderRadius !== void 0 && (e.style.setProperty("--tpl-user-radius", `${t.borderRadius}px`), e.style.setProperty("--tpl-user-radius-sm", `${Math.max(0, t.borderRadius - 3)}px`), e.style.setProperty("--tpl-user-radius-lg", `${t.borderRadius + 4}px`)));
|
|
2485
2524
|
}
|
|
2486
|
-
var
|
|
2487
|
-
init:
|
|
2488
|
-
unmount:
|
|
2525
|
+
var cr = {
|
|
2526
|
+
init: ar,
|
|
2527
|
+
unmount: or
|
|
2489
2528
|
};
|
|
2490
|
-
typeof window < "u" && (window.TemplaticalMedia =
|
|
2529
|
+
typeof window < "u" && (window.TemplaticalMedia = cr);
|
|
2491
2530
|
//#endregion
|
|
2492
|
-
export {
|
|
2531
|
+
export { cr as default, ar as init, or as unmount };
|
|
2493
2532
|
|
|
2494
2533
|
//# sourceMappingURL=media-library.js.map
|