@templatical/media-library 0.43.0 → 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,9 +1,9 @@
|
|
|
1
|
-
import { a as e, c as t, i as n, l as r, n as i, o as a, r as o, s, t as c } from "./useFocusTrap-
|
|
1
|
+
import { a as e, c as t, i as n, l as r, n as i, o as a, r as o, s, t as c } from "./useFocusTrap-CIacOa9R.js";
|
|
2
2
|
import { Fragment as l, Teleport as u, Transition as d, computed as f, createApp as p, createBlock as m, createCommentVNode as h, createElementBlock as g, createElementVNode as _, createTextVNode as v, createVNode as y, defineAsyncComponent as b, defineComponent as x, h as S, inject as C, normalizeClass as w, normalizeStyle as T, onBeforeUnmount as E, openBlock as D, provide as O, ref as k, renderList as A, resolveComponent as j, toDisplayString as M, toRef as N, toValue as P, unref as F, vModelText as I, watch as L, withCtx as R, withDirectives as z, withKeys as B, withModifiers as V } from "vue";
|
|
3
|
-
import { Check as H, ChevronRight as
|
|
4
|
-
import { onClickOutside as
|
|
3
|
+
import { Check as H, ChevronRight as U, Copy as ee, File as W, Folder as G, Grid2x2 as te, Link as ne, List as re, LoaderCircle as K, PanelLeft as ie, Pencil as q, Plus as ae, RefreshCw as J, Search as oe, Star as se, Trash2 as Y, Upload as X, X as ce } from "@lucide/vue";
|
|
4
|
+
import { onClickOutside as Z, useClipboard as le, useDebounceFn as ue, useDropZone as de, useEventListener as fe, useFileDialog as pe, useIntersectionObserver as me } from "@vueuse/core";
|
|
5
5
|
//#region src/composable.ts
|
|
6
|
-
function
|
|
6
|
+
function he(e) {
|
|
7
7
|
let { provider: t } = e, n = k([]), r = k([]), i = k(null), a = k("files"), o = k(""), s = k(null), c = k("newest"), l = k(!1), u = k(!1), d = k(!1), f = k(null), p = k(null), m = k(/* @__PURE__ */ new Set()), h = k(null), g = k([]), _ = k({}), v = k(!1), y = k([]), b = k(!1), x = k(null), S = k(!1), C = k(null), w = k(!1), T = k(null), E = k(null), D = k(null), O = 0;
|
|
8
8
|
function A(t) {
|
|
9
9
|
try {
|
|
@@ -87,7 +87,7 @@ function me(e) {
|
|
|
87
87
|
u.value = !1;
|
|
88
88
|
}
|
|
89
89
|
}
|
|
90
|
-
async function
|
|
90
|
+
async function U(r) {
|
|
91
91
|
let { create: a } = t;
|
|
92
92
|
if (typeof a == "function") {
|
|
93
93
|
u.value = !0, p.value = {
|
|
@@ -116,7 +116,7 @@ function me(e) {
|
|
|
116
116
|
}
|
|
117
117
|
}
|
|
118
118
|
}
|
|
119
|
-
async function
|
|
119
|
+
async function ee(t) {
|
|
120
120
|
if (m.value.size === 0) return;
|
|
121
121
|
let { move: r } = j() ?? { move: !1 };
|
|
122
122
|
if (typeof r == "function") try {
|
|
@@ -130,33 +130,34 @@ function me(e) {
|
|
|
130
130
|
e.onError?.(t);
|
|
131
131
|
}
|
|
132
132
|
}
|
|
133
|
-
async function
|
|
133
|
+
async function W(r, i, a) {
|
|
134
134
|
let { update: o } = t;
|
|
135
|
-
if (typeof o
|
|
135
|
+
if (typeof o != "function") return !1;
|
|
136
|
+
try {
|
|
136
137
|
let e = { filename: i };
|
|
137
138
|
a !== void 0 && (e.alt = a);
|
|
138
139
|
let s = await o(r, e);
|
|
139
|
-
n.value = n.value.map((e) => e.id === r ? s : e), h.value?.id === r && (h.value = s), A(() => t.onUpdated?.(s));
|
|
140
|
+
return n.value = n.value.map((e) => e.id === r ? s : e), h.value?.id === r && (h.value = s), A(() => t.onUpdated?.(s)), !0;
|
|
140
141
|
} catch (t) {
|
|
141
|
-
e.onError?.(t);
|
|
142
|
+
return e.onError?.(t), !1;
|
|
142
143
|
}
|
|
143
144
|
}
|
|
144
|
-
function
|
|
145
|
+
function G(e) {
|
|
145
146
|
let t = /* @__PURE__ */ new Map();
|
|
146
147
|
for (let r of n.value) e.includes(r.id) && t.set(r.id, r);
|
|
147
148
|
for (let n of g.value) e.includes(n.id) && !t.has(n.id) && t.set(n.id, n);
|
|
148
149
|
return [...t.values()];
|
|
149
150
|
}
|
|
150
|
-
function
|
|
151
|
+
function te(e) {
|
|
151
152
|
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;
|
|
152
153
|
}
|
|
153
154
|
async function ne() {
|
|
154
155
|
if (m.value.size === 0) return;
|
|
155
156
|
let { delete: n } = t;
|
|
156
157
|
if (typeof n != "function") return;
|
|
157
|
-
let r = [...m.value], i =
|
|
158
|
+
let r = [...m.value], i = G(r);
|
|
158
159
|
try {
|
|
159
|
-
await n(r),
|
|
160
|
+
await n(r), te(r);
|
|
160
161
|
for (let e of i) A(() => t.onDeleted?.(e));
|
|
161
162
|
} catch (t) {
|
|
162
163
|
e.onError?.(t);
|
|
@@ -187,9 +188,9 @@ function me(e) {
|
|
|
187
188
|
async function ie() {
|
|
188
189
|
let { delete: n } = t;
|
|
189
190
|
if (typeof n != "function" || (v.value = !1, y.value.length === 0)) return;
|
|
190
|
-
let r = y.value, i =
|
|
191
|
+
let r = y.value, i = G(r);
|
|
191
192
|
try {
|
|
192
|
-
await n(r),
|
|
193
|
+
await n(r), te(r), y.value = [], _.value = {};
|
|
193
194
|
for (let e of i) A(() => t.onDeleted?.(e));
|
|
194
195
|
} catch (t) {
|
|
195
196
|
e.onError?.(t);
|
|
@@ -198,7 +199,7 @@ function me(e) {
|
|
|
198
199
|
function q() {
|
|
199
200
|
v.value = !1, y.value = [], _.value = {};
|
|
200
201
|
}
|
|
201
|
-
async function
|
|
202
|
+
async function ae(r) {
|
|
202
203
|
let a = t.importFromUrl;
|
|
203
204
|
if (typeof a != "function") return null;
|
|
204
205
|
b.value = !0, x.value = null;
|
|
@@ -211,17 +212,17 @@ function me(e) {
|
|
|
211
212
|
b.value = !1;
|
|
212
213
|
}
|
|
213
214
|
}
|
|
214
|
-
function
|
|
215
|
+
function J(e) {
|
|
215
216
|
let t = new Set(m.value);
|
|
216
217
|
t.has(e) ? t.delete(e) : t.add(e), m.value = t;
|
|
217
218
|
}
|
|
218
|
-
function
|
|
219
|
+
function oe() {
|
|
219
220
|
m.value = /* @__PURE__ */ new Set(), h.value = null;
|
|
220
221
|
}
|
|
221
|
-
function
|
|
222
|
+
function se(e) {
|
|
222
223
|
h.value = e, m.value = /* @__PURE__ */ new Set([e.id]);
|
|
223
224
|
}
|
|
224
|
-
async function
|
|
225
|
+
async function Y() {
|
|
225
226
|
let { storage: n } = t;
|
|
226
227
|
if (typeof n != "function") {
|
|
227
228
|
D.value = null;
|
|
@@ -233,7 +234,7 @@ function me(e) {
|
|
|
233
234
|
e.onError?.(t);
|
|
234
235
|
}
|
|
235
236
|
}
|
|
236
|
-
async function
|
|
237
|
+
async function X() {
|
|
237
238
|
let t = j();
|
|
238
239
|
if (t) try {
|
|
239
240
|
r.value = await t.list();
|
|
@@ -241,40 +242,40 @@ function me(e) {
|
|
|
241
242
|
e.onError?.(t);
|
|
242
243
|
}
|
|
243
244
|
}
|
|
244
|
-
async function
|
|
245
|
+
async function ce(t, n) {
|
|
245
246
|
let { create: r } = j() ?? { create: !1 };
|
|
246
247
|
if (typeof r != "function") return null;
|
|
247
248
|
try {
|
|
248
249
|
let e = { name: t };
|
|
249
250
|
n !== void 0 && (e.parentId = n);
|
|
250
251
|
let i = await r(e);
|
|
251
|
-
return await
|
|
252
|
+
return await X(), i;
|
|
252
253
|
} catch (t) {
|
|
253
254
|
return e.onError?.(t), null;
|
|
254
255
|
}
|
|
255
256
|
}
|
|
256
|
-
function
|
|
257
|
+
function Z(e, t) {
|
|
257
258
|
for (let n of e) if (n.id === t) return n;
|
|
258
259
|
return null;
|
|
259
260
|
}
|
|
260
|
-
async function
|
|
261
|
+
async function le(t, n) {
|
|
261
262
|
let { update: r } = j() ?? { update: !1 };
|
|
262
263
|
if (typeof r == "function") try {
|
|
263
|
-
await r(t, { name: n }), await
|
|
264
|
+
await r(t, { name: n }), await X();
|
|
264
265
|
} catch (t) {
|
|
265
266
|
e.onError?.(t);
|
|
266
267
|
}
|
|
267
268
|
}
|
|
268
|
-
async function
|
|
269
|
+
async function ue(t) {
|
|
269
270
|
let { delete: n } = j() ?? { delete: !1 };
|
|
270
271
|
if (typeof n == "function") try {
|
|
271
|
-
let e =
|
|
272
|
-
await n(t), i.value === t && (i.value = e), await
|
|
272
|
+
let e = Z(r.value, t)?.parentId ?? null;
|
|
273
|
+
await n(t), i.value === t && (i.value = e), await X(), await F();
|
|
273
274
|
} catch (t) {
|
|
274
275
|
e.onError?.(t);
|
|
275
276
|
}
|
|
276
277
|
}
|
|
277
|
-
async function
|
|
278
|
+
async function de(n) {
|
|
278
279
|
T.value = n, C.value = null;
|
|
279
280
|
let { checkUsage: r } = t;
|
|
280
281
|
if (typeof r != "function") {
|
|
@@ -288,31 +289,31 @@ function me(e) {
|
|
|
288
289
|
e.onError?.(t);
|
|
289
290
|
}
|
|
290
291
|
}
|
|
291
|
-
function
|
|
292
|
+
function fe() {
|
|
292
293
|
w.value = !1, T.value = null, E.value = null, C.value = null;
|
|
293
294
|
}
|
|
294
|
-
function
|
|
295
|
+
function pe(e) {
|
|
295
296
|
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), A(() => t.onUpdated?.(e));
|
|
296
297
|
}
|
|
297
|
-
async function
|
|
298
|
+
async function me(n) {
|
|
298
299
|
let { replace: r } = t;
|
|
299
300
|
if (typeof r != "function" || !T.value) return null;
|
|
300
301
|
S.value = !0, C.value = null;
|
|
301
302
|
try {
|
|
302
303
|
let e = await r(T.value.id, n);
|
|
303
|
-
return
|
|
304
|
+
return pe(e), w.value = !1, T.value = null, E.value = null, e;
|
|
304
305
|
} catch (t) {
|
|
305
306
|
return C.value = t instanceof Error ? t.message : "Replace failed", e.onError?.(t), null;
|
|
306
307
|
} finally {
|
|
307
308
|
S.value = !1;
|
|
308
309
|
}
|
|
309
310
|
}
|
|
310
|
-
async function
|
|
311
|
+
async function he(n, r) {
|
|
311
312
|
let { replace: i } = t;
|
|
312
313
|
if (typeof i != "function") return null;
|
|
313
314
|
try {
|
|
314
315
|
let e = await i(n, r);
|
|
315
|
-
return
|
|
316
|
+
return pe(e), e;
|
|
316
317
|
} catch (t) {
|
|
317
318
|
return e.onError?.(t), null;
|
|
318
319
|
}
|
|
@@ -342,21 +343,21 @@ function me(e) {
|
|
|
342
343
|
navigateToFolder: B,
|
|
343
344
|
showFrequentlyUsed: V,
|
|
344
345
|
uploadFile: H,
|
|
345
|
-
uploadFiles:
|
|
346
|
-
moveSelected:
|
|
347
|
-
updateFile:
|
|
346
|
+
uploadFiles: U,
|
|
347
|
+
moveSelected: ee,
|
|
348
|
+
updateFile: W,
|
|
348
349
|
deleteSelected: ne,
|
|
349
350
|
isImportingFromUrl: b,
|
|
350
351
|
importFromUrlError: x,
|
|
351
|
-
importFromUrl:
|
|
352
|
-
toggleSelection:
|
|
353
|
-
clearSelection:
|
|
354
|
-
selectItem:
|
|
355
|
-
loadFolders:
|
|
356
|
-
createFolder:
|
|
357
|
-
renameFolder:
|
|
358
|
-
deleteFolder:
|
|
359
|
-
findFolderInTree:
|
|
352
|
+
importFromUrl: ae,
|
|
353
|
+
toggleSelection: J,
|
|
354
|
+
clearSelection: oe,
|
|
355
|
+
selectItem: se,
|
|
356
|
+
loadFolders: X,
|
|
357
|
+
createFolder: ce,
|
|
358
|
+
renameFolder: le,
|
|
359
|
+
deleteFolder: ue,
|
|
360
|
+
findFolderInTree: Z,
|
|
360
361
|
loadFrequentlyUsed: re,
|
|
361
362
|
checkUsageBeforeDelete: K,
|
|
362
363
|
confirmDelete: ie,
|
|
@@ -366,24 +367,24 @@ function me(e) {
|
|
|
366
367
|
showReplaceWarning: w,
|
|
367
368
|
pendingReplaceItem: T,
|
|
368
369
|
replaceUsageInfo: E,
|
|
369
|
-
checkUsageBeforeReplace:
|
|
370
|
-
cancelReplace:
|
|
371
|
-
replaceFile:
|
|
372
|
-
replaceMediaDirectly:
|
|
370
|
+
checkUsageBeforeReplace: de,
|
|
371
|
+
cancelReplace: fe,
|
|
372
|
+
replaceFile: me,
|
|
373
|
+
replaceMediaDirectly: he,
|
|
373
374
|
storageInfo: D,
|
|
374
|
-
loadStorage:
|
|
375
|
+
loadStorage: Y
|
|
375
376
|
};
|
|
376
377
|
}
|
|
377
378
|
//#endregion
|
|
378
379
|
//#region src/components/media/MediaBreadcrumb.vue?vue&type=script&setup=true&lang.ts
|
|
379
|
-
var
|
|
380
|
+
var ge = {
|
|
380
381
|
key: 0,
|
|
381
382
|
class: "tpl:flex tpl:items-center tpl:gap-1 tpl:text-xs",
|
|
382
383
|
style: { color: "var(--tpl-text-muted)" }
|
|
383
|
-
},
|
|
384
|
+
}, _e = ["onClick"], ve = {
|
|
384
385
|
key: 1,
|
|
385
386
|
style: { color: "var(--tpl-text)" }
|
|
386
|
-
},
|
|
387
|
+
}, ye = /* @__PURE__ */ x({
|
|
387
388
|
__name: "MediaBreadcrumb",
|
|
388
389
|
props: {
|
|
389
390
|
folders: {},
|
|
@@ -403,11 +404,11 @@ var he = {
|
|
|
403
404
|
}
|
|
404
405
|
return !1;
|
|
405
406
|
}
|
|
406
|
-
return (e, t) => o.value.length > 0 ? (D(), g("div",
|
|
407
|
+
return (e, t) => o.value.length > 0 ? (D(), g("div", ge, [_("button", {
|
|
407
408
|
class: "tpl:transition-colors tpl:duration-150 tpl:hover:underline",
|
|
408
409
|
style: { color: "var(--tpl-primary)" },
|
|
409
410
|
onClick: t[0] ||= (e) => i("navigate", null)
|
|
410
|
-
}, M(F(a).mediaLibrary.allFiles), 1), (D(!0), g(l, null, A(o.value, (e, t) => (D(), g(l, { key: e.id }, [y(F(
|
|
411
|
+
}, M(F(a).mediaLibrary.allFiles), 1), (D(!0), g(l, null, A(o.value, (e, t) => (D(), g(l, { key: e.id }, [y(F(U), {
|
|
411
412
|
size: 12,
|
|
412
413
|
"stroke-width": 2
|
|
413
414
|
}), t < o.value.length - 1 ? (D(), g("button", {
|
|
@@ -415,15 +416,15 @@ var he = {
|
|
|
415
416
|
class: "tpl:transition-colors tpl:duration-150 tpl:hover:underline",
|
|
416
417
|
style: { color: "var(--tpl-primary)" },
|
|
417
418
|
onClick: (t) => i("navigate", e.id)
|
|
418
|
-
}, M(e.name), 9,
|
|
419
|
+
}, M(e.name), 9, _e)) : (D(), g("span", ve, M(e.name), 1))], 64))), 128))])) : h("", !0);
|
|
419
420
|
}
|
|
420
|
-
}),
|
|
421
|
+
}), be = ["aria-expanded", "aria-label"], xe = {
|
|
421
422
|
key: 1,
|
|
422
423
|
class: "tpl:size-4 tpl:shrink-0"
|
|
423
|
-
},
|
|
424
|
+
}, Se = {
|
|
424
425
|
key: 0,
|
|
425
426
|
class: "tpl:truncate"
|
|
426
|
-
},
|
|
427
|
+
}, Ce = ["onKeydown"], we = ["title", "aria-label"], Te = ["title", "aria-label"], Ee = ["title", "aria-label"], De = { key: 0 }, Oe = ["placeholder", "onKeydown"], ke = /* @__PURE__ */ x({
|
|
427
428
|
__name: "MediaFolderTreeNode",
|
|
428
429
|
props: {
|
|
429
430
|
folder: {},
|
|
@@ -464,17 +465,17 @@ var he = {
|
|
|
464
465
|
function H() {
|
|
465
466
|
d.value.trim() && i("createFolder", d.value.trim(), r.folder.id), u.value = !1, d.value = "";
|
|
466
467
|
}
|
|
467
|
-
function
|
|
468
|
+
function ee() {
|
|
468
469
|
u.value = !1, d.value = "";
|
|
469
470
|
}
|
|
470
|
-
function
|
|
471
|
+
function W() {
|
|
471
472
|
if (p.value) {
|
|
472
473
|
i("deleteFolder", r.folder.id), p.value = !1;
|
|
473
474
|
return;
|
|
474
475
|
}
|
|
475
476
|
p.value = !0;
|
|
476
477
|
}
|
|
477
|
-
function
|
|
478
|
+
function te(e) {
|
|
478
479
|
let t = e.relatedTarget;
|
|
479
480
|
t && e.currentTarget.contains(t) || (p.value = !1);
|
|
480
481
|
}
|
|
@@ -487,7 +488,7 @@ var he = {
|
|
|
487
488
|
backgroundColor: x.value ? "var(--tpl-bg-active)" : "transparent",
|
|
488
489
|
color: x.value ? "var(--tpl-primary)" : "var(--tpl-text)"
|
|
489
490
|
}),
|
|
490
|
-
onFocusout:
|
|
491
|
+
onFocusout: te
|
|
491
492
|
}, [
|
|
492
493
|
v.value || u.value ? (D(), g("button", {
|
|
493
494
|
key: 0,
|
|
@@ -496,20 +497,20 @@ var he = {
|
|
|
496
497
|
"aria-expanded": C.value,
|
|
497
498
|
"aria-label": C.value ? F(a).mediaLibrary.collapseFolder : F(a).mediaLibrary.expandFolder,
|
|
498
499
|
onClick: V(O, ["stop"])
|
|
499
|
-
}, [y(F(
|
|
500
|
+
}, [y(F(U), {
|
|
500
501
|
class: w(["tpl:transition-transform tpl:duration-150", { "tpl:rotate-90": C.value }]),
|
|
501
502
|
size: 10,
|
|
502
503
|
"stroke-width": 2
|
|
503
|
-
}, null, 8, ["class"])], 8,
|
|
504
|
+
}, null, 8, ["class"])], 8, be)) : (D(), g("span", xe)),
|
|
504
505
|
_("button", {
|
|
505
506
|
type: "button",
|
|
506
507
|
class: "tpl:flex tpl:min-w-0 tpl:flex-1 tpl:items-center tpl:gap-1.5",
|
|
507
508
|
onClick: n[0] ||= (t) => i("navigate", e.folder.id)
|
|
508
|
-
}, [y(F(
|
|
509
|
+
}, [y(F(G), {
|
|
509
510
|
class: "tpl:shrink-0",
|
|
510
511
|
size: 14,
|
|
511
512
|
"stroke-width": 1.5
|
|
512
|
-
}), s.value ? h("", !0) : (D(), g("span",
|
|
513
|
+
}), s.value ? h("", !0) : (D(), g("span", Se, M(e.folder.name), 1))]),
|
|
513
514
|
s.value ? z((D(), g("input", {
|
|
514
515
|
key: 2,
|
|
515
516
|
"onUpdate:modelValue": n[1] ||= (e) => c.value = e,
|
|
@@ -524,7 +525,7 @@ var he = {
|
|
|
524
525
|
onKeydown: [B(P, ["enter"]), B(V(L, ["stop"]), ["escape"])],
|
|
525
526
|
onBlur: P,
|
|
526
527
|
onClick: n[2] ||= V(() => {}, ["stop"])
|
|
527
|
-
}, null, 40,
|
|
528
|
+
}, null, 40, Ce)), [[I, c.value]]) : h("", !0),
|
|
528
529
|
s.value ? h("", !0) : (D(), g("span", {
|
|
529
530
|
key: 3,
|
|
530
531
|
class: w(["tpl:flex tpl:shrink-0 tpl:items-center tpl:gap-0.5 tpl:transition-opacity", x.value || p.value ? "tpl:opacity-100" : "tpl:opacity-0 tpl:group-hover:opacity-100 tpl:group-focus-within:opacity-100"])
|
|
@@ -536,10 +537,10 @@ var he = {
|
|
|
536
537
|
title: F(a).mediaLibrary.addSubfolder,
|
|
537
538
|
"aria-label": F(a).mediaLibrary.addSubfolder,
|
|
538
539
|
onClick: V(R, ["stop"])
|
|
539
|
-
}, [y(F(
|
|
540
|
+
}, [y(F(ae), {
|
|
540
541
|
size: 12,
|
|
541
542
|
"stroke-width": 2
|
|
542
|
-
})], 8,
|
|
543
|
+
})], 8, we)) : h("", !0),
|
|
543
544
|
e.canRenameFolder ? (D(), g("button", {
|
|
544
545
|
key: 1,
|
|
545
546
|
type: "button",
|
|
@@ -550,7 +551,7 @@ var he = {
|
|
|
550
551
|
}, [y(F(q), {
|
|
551
552
|
size: 12,
|
|
552
553
|
"stroke-width": 2
|
|
553
|
-
})], 8,
|
|
554
|
+
})], 8, Te)) : h("", !0),
|
|
554
555
|
e.canDeleteFolder ? (D(), g("button", {
|
|
555
556
|
key: 2,
|
|
556
557
|
type: "button",
|
|
@@ -558,14 +559,14 @@ var he = {
|
|
|
558
559
|
class: "tpl:flex tpl:size-6 tpl:items-center tpl:justify-center tpl:rounded tpl:transition-colors",
|
|
559
560
|
title: p.value ? F(a).mediaLibrary.deleteFolderConfirm : F(a).mediaLibrary.deleteFolder,
|
|
560
561
|
"aria-label": p.value ? F(a).mediaLibrary.deleteFolderConfirm : F(a).mediaLibrary.deleteFolder,
|
|
561
|
-
onClick: V(
|
|
562
|
-
}, [y(F(
|
|
562
|
+
onClick: V(W, ["stop"])
|
|
563
|
+
}, [y(F(Y), {
|
|
563
564
|
size: 12,
|
|
564
565
|
"stroke-width": 2,
|
|
565
566
|
style: { color: "var(--tpl-danger)" }
|
|
566
|
-
})], 8,
|
|
567
|
+
})], 8, Ee)) : h("", !0)
|
|
567
568
|
], 2))
|
|
568
|
-
], 36), C.value ? (D(), g("div",
|
|
569
|
+
], 36), C.value ? (D(), g("div", De, [(D(!0), g(l, null, A(e.folder.children, (t) => (D(), m(r, {
|
|
569
570
|
key: t.id,
|
|
570
571
|
folder: t,
|
|
571
572
|
"current-folder-id": e.currentFolderId,
|
|
@@ -599,18 +600,18 @@ var he = {
|
|
|
599
600
|
},
|
|
600
601
|
placeholder: F(a).mediaLibrary.subfolderName,
|
|
601
602
|
autofocus: "",
|
|
602
|
-
onKeydown: [B(H, ["enter"]), B(V(
|
|
603
|
+
onKeydown: [B(H, ["enter"]), B(V(ee, ["stop"]), ["escape"])],
|
|
603
604
|
onBlur: H
|
|
604
|
-
}, null, 40,
|
|
605
|
+
}, null, 40, Oe), [[I, d.value]])], 4)) : h("", !0)])) : h("", !0)]);
|
|
605
606
|
};
|
|
606
607
|
}
|
|
607
|
-
}),
|
|
608
|
+
}), Ae = {
|
|
608
609
|
"data-testid": "media-folder-tree",
|
|
609
610
|
class: "tpl:flex tpl:h-full tpl:flex-col tpl:overflow-y-auto"
|
|
610
|
-
},
|
|
611
|
+
}, je = {
|
|
611
612
|
key: 0,
|
|
612
613
|
class: "tpl:px-3 tpl:py-2"
|
|
613
|
-
},
|
|
614
|
+
}, Me = ["placeholder", "onKeydown"], Ne = /* @__PURE__ */ x({
|
|
614
615
|
__name: "MediaFolderTree",
|
|
615
616
|
props: {
|
|
616
617
|
folders: {},
|
|
@@ -639,7 +640,7 @@ var he = {
|
|
|
639
640
|
function u() {
|
|
640
641
|
a.value = !1, o.value = "";
|
|
641
642
|
}
|
|
642
|
-
return (t, n) => (D(), g("div",
|
|
643
|
+
return (t, n) => (D(), g("div", Ae, [
|
|
643
644
|
_("button", {
|
|
644
645
|
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",
|
|
645
646
|
style: T({
|
|
@@ -647,11 +648,11 @@ var he = {
|
|
|
647
648
|
color: e.viewMode === "files" && e.currentFolderId === null ? "var(--tpl-primary)" : "var(--tpl-text)"
|
|
648
649
|
}),
|
|
649
650
|
onClick: n[0] ||= (e) => r("navigate", null)
|
|
650
|
-
}, [y(F(
|
|
651
|
+
}, [y(F(W), {
|
|
651
652
|
size: 14,
|
|
652
653
|
"stroke-width": 1.5
|
|
653
654
|
}), v(" " + M(F(i).mediaLibrary.allFiles), 1)], 4),
|
|
654
|
-
(D(!0), g(l, null, A(e.folders, (t) => (D(), m(
|
|
655
|
+
(D(!0), g(l, null, A(e.folders, (t) => (D(), m(ke, {
|
|
655
656
|
key: t.id,
|
|
656
657
|
folder: t,
|
|
657
658
|
"current-folder-id": e.currentFolderId,
|
|
@@ -670,7 +671,7 @@ var he = {
|
|
|
670
671
|
"can-rename-folder",
|
|
671
672
|
"can-delete-folder"
|
|
672
673
|
]))), 128)),
|
|
673
|
-
a.value ? (D(), g("div",
|
|
674
|
+
a.value ? (D(), g("div", je, [z(_("input", {
|
|
674
675
|
"onUpdate:modelValue": n[5] ||= (e) => o.value = e,
|
|
675
676
|
type: "text",
|
|
676
677
|
class: "tpl:w-full tpl:rounded tpl:border tpl:px-2 tpl:py-1 tpl:text-xs tpl:outline-none",
|
|
@@ -683,13 +684,13 @@ var he = {
|
|
|
683
684
|
autofocus: "",
|
|
684
685
|
onKeydown: [B(c, ["enter"]), B(V(u, ["stop"]), ["escape"])],
|
|
685
686
|
onBlur: c
|
|
686
|
-
}, null, 40,
|
|
687
|
+
}, null, 40, Me), [[I, o.value]])])) : h("", !0),
|
|
687
688
|
!a.value && e.canCreateFolder ? (D(), g("button", {
|
|
688
689
|
key: 1,
|
|
689
690
|
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",
|
|
690
691
|
style: { color: "var(--tpl-text-muted)" },
|
|
691
692
|
onClick: s
|
|
692
|
-
}, [y(F(
|
|
693
|
+
}, [y(F(ae), {
|
|
693
694
|
size: 14,
|
|
694
695
|
"stroke-width": 1.5
|
|
695
696
|
}), v(" " + M(F(i).mediaLibrary.newFolder), 1)])) : h("", !0),
|
|
@@ -704,13 +705,13 @@ var he = {
|
|
|
704
705
|
color: e.viewMode === "frequently-used" ? "var(--tpl-primary)" : "var(--tpl-text)"
|
|
705
706
|
}),
|
|
706
707
|
onClick: n[6] ||= (e) => r("showFrequentlyUsed")
|
|
707
|
-
}, [y(F(
|
|
708
|
+
}, [y(F(se), {
|
|
708
709
|
size: 14,
|
|
709
710
|
"stroke-width": 1.5
|
|
710
711
|
}), v(" " + M(F(i).mediaLibrary.frequentlyUsed), 1)], 4)) : h("", !0)
|
|
711
712
|
]));
|
|
712
713
|
}
|
|
713
|
-
}),
|
|
714
|
+
}), Pe = /* @__PURE__ */ x({
|
|
714
715
|
__name: "MediaFileIcon",
|
|
715
716
|
props: { mimeType: {} },
|
|
716
717
|
setup(e) {
|
|
@@ -886,7 +887,7 @@ var he = {
|
|
|
886
887
|
});
|
|
887
888
|
//#endregion
|
|
888
889
|
//#region src/utils/formatAbsoluteDate.ts
|
|
889
|
-
function
|
|
890
|
+
function Fe(e, t, n) {
|
|
890
891
|
let r = new Date(e);
|
|
891
892
|
if (Number.isNaN(r.getTime())) return "";
|
|
892
893
|
let i = t?.trim().replace(/_/g, "-") || void 0;
|
|
@@ -897,35 +898,48 @@ function Pe(e, t, n) {
|
|
|
897
898
|
}
|
|
898
899
|
}
|
|
899
900
|
//#endregion
|
|
901
|
+
//#region src/utils/formatFileSize.ts
|
|
902
|
+
var Ie = [
|
|
903
|
+
"B",
|
|
904
|
+
"KB",
|
|
905
|
+
"MB",
|
|
906
|
+
"GB"
|
|
907
|
+
];
|
|
908
|
+
function Q(e) {
|
|
909
|
+
let t = e, n = 0;
|
|
910
|
+
for (; t >= 1024 && n < Ie.length - 1;) t /= 1024, n += 1;
|
|
911
|
+
return `${Math.round(t * 10) / 10} ${Ie[n]}`;
|
|
912
|
+
}
|
|
913
|
+
//#endregion
|
|
900
914
|
//#region src/components/media/MediaGrid.vue?vue&type=script&setup=true&lang.ts
|
|
901
|
-
var
|
|
915
|
+
var Le = { class: "tpl:p-4" }, Re = ["aria-label"], ze = {
|
|
902
916
|
key: 1,
|
|
903
917
|
class: "tpl:flex tpl:flex-col tpl:items-center tpl:justify-center tpl:py-16"
|
|
904
|
-
},
|
|
918
|
+
}, Be = {
|
|
905
919
|
class: "tpl:text-xs",
|
|
906
920
|
style: { color: "var(--tpl-text-muted)" }
|
|
907
|
-
},
|
|
921
|
+
}, Ve = ["aria-label"], He = [
|
|
908
922
|
"data-media-id",
|
|
909
923
|
"aria-selected",
|
|
910
924
|
"aria-label",
|
|
911
925
|
"onClick",
|
|
912
926
|
"onDblclick",
|
|
913
927
|
"onKeydown"
|
|
914
|
-
],
|
|
928
|
+
], Ue = { class: "tpl:aspect-square" }, We = ["src", "alt"], Ge = { class: "tpl:px-2 tpl:py-1.5" }, Ke = {
|
|
915
929
|
class: "tpl:truncate tpl:text-[10px] tpl:font-medium",
|
|
916
930
|
style: { color: "var(--tpl-text)" }
|
|
917
|
-
},
|
|
931
|
+
}, qe = {
|
|
918
932
|
class: "tpl:flex tpl:justify-between tpl:text-[10px]",
|
|
919
933
|
style: { color: "var(--tpl-text-muted)" }
|
|
920
|
-
},
|
|
934
|
+
}, Je = { key: 0 }, Ye = { key: 1 }, Xe = [
|
|
921
935
|
"title",
|
|
922
936
|
"aria-label",
|
|
923
937
|
"onClick"
|
|
924
|
-
],
|
|
938
|
+
], Ze = [
|
|
925
939
|
"title",
|
|
926
940
|
"aria-label",
|
|
927
941
|
"onClick"
|
|
928
|
-
],
|
|
942
|
+
], Qe = {
|
|
929
943
|
key: 0,
|
|
930
944
|
"aria-hidden": "true",
|
|
931
945
|
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",
|
|
@@ -933,34 +947,34 @@ var Fe = { class: "tpl:p-4" }, Ie = ["aria-label"], Le = {
|
|
|
933
947
|
"background-color": "var(--tpl-primary)",
|
|
934
948
|
color: "var(--tpl-on-primary)"
|
|
935
949
|
}
|
|
936
|
-
},
|
|
950
|
+
}, $e = ["aria-label"], et = [
|
|
937
951
|
"data-media-id",
|
|
938
952
|
"aria-selected",
|
|
939
953
|
"aria-label",
|
|
940
954
|
"onClick",
|
|
941
955
|
"onDblclick",
|
|
942
956
|
"onKeydown"
|
|
943
|
-
],
|
|
957
|
+
], tt = {
|
|
944
958
|
class: "tpl:size-10 tpl:shrink-0 tpl:overflow-hidden tpl:rounded",
|
|
945
959
|
style: { "background-color": "var(--tpl-bg-hover)" }
|
|
946
|
-
},
|
|
960
|
+
}, nt = ["src", "alt"], rt = {
|
|
947
961
|
key: 1,
|
|
948
962
|
class: "tpl-list-icon tpl:size-full"
|
|
949
|
-
},
|
|
963
|
+
}, it = { class: "tpl:min-w-0 tpl:flex-1" }, at = {
|
|
950
964
|
class: "tpl:truncate tpl:text-xs tpl:font-medium",
|
|
951
965
|
style: { color: "var(--tpl-text)" }
|
|
952
|
-
},
|
|
966
|
+
}, ot = {
|
|
953
967
|
class: "tpl:text-[10px]",
|
|
954
968
|
style: { color: "var(--tpl-text-muted)" }
|
|
955
|
-
},
|
|
969
|
+
}, st = [
|
|
956
970
|
"title",
|
|
957
971
|
"aria-label",
|
|
958
972
|
"onClick"
|
|
959
|
-
],
|
|
973
|
+
], ct = [
|
|
960
974
|
"title",
|
|
961
975
|
"aria-label",
|
|
962
976
|
"onClick"
|
|
963
|
-
],
|
|
977
|
+
], lt = {
|
|
964
978
|
key: 0,
|
|
965
979
|
"aria-hidden": "true",
|
|
966
980
|
class: "tpl:flex tpl:size-5 tpl:shrink-0 tpl:items-center tpl:justify-center tpl:rounded-full",
|
|
@@ -968,10 +982,10 @@ var Fe = { class: "tpl:p-4" }, Ie = ["aria-label"], Le = {
|
|
|
968
982
|
"background-color": "var(--tpl-primary)",
|
|
969
983
|
color: "var(--tpl-on-primary)"
|
|
970
984
|
}
|
|
971
|
-
},
|
|
985
|
+
}, ut = {
|
|
972
986
|
key: 4,
|
|
973
987
|
class: "tpl:flex tpl:justify-center tpl:py-4"
|
|
974
|
-
},
|
|
988
|
+
}, dt = /*#__PURE__*/ i(/* @__PURE__ */ x({
|
|
975
989
|
__name: "MediaGrid",
|
|
976
990
|
props: {
|
|
977
991
|
items: {},
|
|
@@ -1029,20 +1043,17 @@ var Fe = { class: "tpl:p-4" }, Ie = ["aria-label"], Le = {
|
|
|
1029
1043
|
return O(e) ? "tpl:opacity-100" : "tpl:opacity-0 tpl:group-hover:opacity-100 tpl:group-focus-within:opacity-100";
|
|
1030
1044
|
}
|
|
1031
1045
|
let { t: N } = n(), P = C(t, null), I = k(null);
|
|
1032
|
-
|
|
1046
|
+
me(I, ([{ isIntersecting: e }]) => {
|
|
1033
1047
|
e && i.hasMore && !i.isLoading && a("loadMore");
|
|
1034
1048
|
}, { threshold: .1 });
|
|
1035
1049
|
function L(e) {
|
|
1036
|
-
return
|
|
1037
|
-
}
|
|
1038
|
-
function R(e) {
|
|
1039
|
-
return Pe(e, P?.value, {
|
|
1050
|
+
return Fe(e, P?.value, {
|
|
1040
1051
|
year: "numeric",
|
|
1041
1052
|
month: "short",
|
|
1042
1053
|
day: "numeric"
|
|
1043
1054
|
});
|
|
1044
1055
|
}
|
|
1045
|
-
return (t, n) => (D(), g("div",
|
|
1056
|
+
return (t, n) => (D(), g("div", Le, [
|
|
1046
1057
|
e.isLoading && e.items.length === 0 ? (D(), g("div", {
|
|
1047
1058
|
key: 0,
|
|
1048
1059
|
role: "status",
|
|
@@ -1054,12 +1065,12 @@ var Fe = { class: "tpl:p-4" }, Ie = ["aria-label"], Le = {
|
|
|
1054
1065
|
class: w(["tpl-pulse tpl:rounded-lg", e.layout === "list" ? "tpl:h-12" : "tpl:aspect-square"]),
|
|
1055
1066
|
style: { "background-color": "var(--tpl-bg-hover)" },
|
|
1056
1067
|
"aria-hidden": "true"
|
|
1057
|
-
}, null, 2)), 64))], 10,
|
|
1068
|
+
}, null, 2)), 64))], 10, Re)) : e.items.length === 0 ? (D(), g("div", ze, [y(F(W), {
|
|
1058
1069
|
class: "tpl:mb-3",
|
|
1059
1070
|
size: 40,
|
|
1060
1071
|
"stroke-width": 1,
|
|
1061
1072
|
style: { color: "var(--tpl-text-dim)" }
|
|
1062
|
-
}), _("p",
|
|
1073
|
+
}), _("p", Be, M(e.searchQuery ? F(N).mediaLibrary.noSearchResults : F(N).mediaLibrary.noFiles), 1)])) : e.layout === "list" ? (D(), g("div", {
|
|
1063
1074
|
key: 3,
|
|
1064
1075
|
role: "listbox",
|
|
1065
1076
|
"aria-label": F(N).mediaLibrary.filesListAriaLabel,
|
|
@@ -1079,16 +1090,16 @@ var Fe = { class: "tpl:p-4" }, Ie = ["aria-label"], Le = {
|
|
|
1079
1090
|
onDblclick: (t) => S(e),
|
|
1080
1091
|
onKeydown: (t) => E(e, t)
|
|
1081
1092
|
}, [
|
|
1082
|
-
_("div",
|
|
1093
|
+
_("div", tt, [F(c)(u(e)) ? (D(), g("img", {
|
|
1083
1094
|
key: 0,
|
|
1084
1095
|
src: d(e),
|
|
1085
1096
|
alt: e.filename || e.url,
|
|
1086
1097
|
class: "tpl:size-full tpl:object-cover",
|
|
1087
1098
|
loading: "lazy"
|
|
1088
|
-
}, null, 8,
|
|
1089
|
-
_("div",
|
|
1090
|
-
e.size == null ? h("", !0) : (D(), g(l, { key: 0 }, [v(M(
|
|
1091
|
-
e.createdAt ? (D(), g(l, { key: 1 }, [e.size == null ? h("", !0) : (D(), g(l, { key: 0 }, [v(" · ")], 64)), v(" " + M(
|
|
1099
|
+
}, null, 8, nt)) : (D(), g("div", rt, [y(Pe, { "mime-type": u(e) }, null, 8, ["mime-type"])]))]),
|
|
1100
|
+
_("div", it, [_("p", at, M(e.filename || e.url), 1), _("p", ot, [
|
|
1101
|
+
e.size == null ? h("", !0) : (D(), g(l, { key: 0 }, [v(M(F(Q)(e.size)), 1)], 64)),
|
|
1102
|
+
e.createdAt ? (D(), g(l, { key: 1 }, [e.size == null ? h("", !0) : (D(), g(l, { key: 0 }, [v(" · ")], 64)), v(" " + M(L(e.createdAt)), 1)], 64)) : h("", !0),
|
|
1092
1103
|
F(c)(u(e)) && e.width && e.height ? (D(), g(l, { key: 2 }, [v(" · " + M(e.width) + "×" + M(e.height), 1)], 64)) : h("", !0)
|
|
1093
1104
|
])]),
|
|
1094
1105
|
_("div", { class: w(["tpl:flex tpl:gap-1 tpl:transition-opacity tpl:duration-150", j(e)]) }, [p(e) ? (D(), g("button", {
|
|
@@ -1103,7 +1114,7 @@ var Fe = { class: "tpl:p-4" }, Ie = ["aria-label"], Le = {
|
|
|
1103
1114
|
}, [y(F(q), {
|
|
1104
1115
|
size: 12,
|
|
1105
1116
|
"stroke-width": 2
|
|
1106
|
-
})], 8,
|
|
1117
|
+
})], 8, st)) : h("", !0), b(e) ? (D(), g("button", {
|
|
1107
1118
|
key: 1,
|
|
1108
1119
|
type: "button",
|
|
1109
1120
|
"data-testid": "media-replace",
|
|
@@ -1112,15 +1123,15 @@ var Fe = { class: "tpl:p-4" }, Ie = ["aria-label"], Le = {
|
|
|
1112
1123
|
title: F(N).mediaLibrary.replaceFile,
|
|
1113
1124
|
"aria-label": F(N).mediaLibrary.replaceFile,
|
|
1114
1125
|
onClick: V((t) => a("replace", e), ["stop"])
|
|
1115
|
-
}, [y(F(
|
|
1126
|
+
}, [y(F(J), {
|
|
1116
1127
|
size: 12,
|
|
1117
1128
|
"stroke-width": 2
|
|
1118
|
-
})], 8,
|
|
1119
|
-
O(e) ? (D(), g("div",
|
|
1129
|
+
})], 8, ct)) : h("", !0)], 2),
|
|
1130
|
+
O(e) ? (D(), g("div", lt, [y(F(H), {
|
|
1120
1131
|
size: 12,
|
|
1121
1132
|
"stroke-width": 3
|
|
1122
1133
|
})])) : h("", !0)
|
|
1123
|
-
], 46,
|
|
1134
|
+
], 46, et))), 128))], 8, $e)) : (D(), g("div", {
|
|
1124
1135
|
key: 2,
|
|
1125
1136
|
role: "listbox",
|
|
1126
1137
|
"aria-label": F(N).mediaLibrary.filesListAriaLabel,
|
|
@@ -1147,17 +1158,17 @@ var Fe = { class: "tpl:p-4" }, Ie = ["aria-label"], Le = {
|
|
|
1147
1158
|
onDblclick: (t) => S(e),
|
|
1148
1159
|
onKeydown: (t) => E(e, t)
|
|
1149
1160
|
}, [
|
|
1150
|
-
_("div",
|
|
1161
|
+
_("div", Ue, [F(c)(u(e)) ? (D(), g("img", {
|
|
1151
1162
|
key: 0,
|
|
1152
1163
|
src: d(e),
|
|
1153
1164
|
alt: e.filename || e.url,
|
|
1154
1165
|
class: "tpl:size-full tpl:object-cover",
|
|
1155
1166
|
loading: "lazy"
|
|
1156
|
-
}, null, 8,
|
|
1167
|
+
}, null, 8, We)) : (D(), m(Pe, {
|
|
1157
1168
|
key: 1,
|
|
1158
1169
|
"mime-type": u(e)
|
|
1159
1170
|
}, null, 8, ["mime-type"]))]),
|
|
1160
|
-
_("div",
|
|
1171
|
+
_("div", Ge, [_("p", Ke, M(e.filename || e.url), 1), _("p", qe, [e.size == null ? h("", !0) : (D(), g("span", Je, M(F(Q)(e.size)), 1)), F(c)(u(e)) && e.width && e.height ? (D(), g("span", Ye, M(e.width) + "×" + M(e.height), 1)) : h("", !0)])]),
|
|
1161
1172
|
_("div", { class: w(["tpl:absolute tpl:top-1.5 tpl:left-1.5 tpl:flex tpl:gap-1 tpl:transition-opacity tpl:duration-150", j(e)]) }, [p(e) ? (D(), g("button", {
|
|
1162
1173
|
key: 0,
|
|
1163
1174
|
type: "button",
|
|
@@ -1173,7 +1184,7 @@ var Fe = { class: "tpl:p-4" }, Ie = ["aria-label"], Le = {
|
|
|
1173
1184
|
}, [y(F(q), {
|
|
1174
1185
|
size: 11,
|
|
1175
1186
|
"stroke-width": 2
|
|
1176
|
-
})], 8,
|
|
1187
|
+
})], 8, Xe)) : h("", !0), b(e) ? (D(), g("button", {
|
|
1177
1188
|
key: 1,
|
|
1178
1189
|
type: "button",
|
|
1179
1190
|
"data-testid": "media-replace",
|
|
@@ -1185,21 +1196,21 @@ var Fe = { class: "tpl:p-4" }, Ie = ["aria-label"], Le = {
|
|
|
1185
1196
|
title: F(N).mediaLibrary.replaceFile,
|
|
1186
1197
|
"aria-label": F(N).mediaLibrary.replaceFile,
|
|
1187
1198
|
onClick: V((t) => a("replace", e), ["stop"])
|
|
1188
|
-
}, [y(F(
|
|
1199
|
+
}, [y(F(J), {
|
|
1189
1200
|
size: 11,
|
|
1190
1201
|
"stroke-width": 2
|
|
1191
|
-
})], 8,
|
|
1192
|
-
O(e) ? (D(), g("div",
|
|
1202
|
+
})], 8, Ze)) : h("", !0)], 2),
|
|
1203
|
+
O(e) ? (D(), g("div", Qe, [y(F(H), {
|
|
1193
1204
|
size: 12,
|
|
1194
1205
|
"stroke-width": 3
|
|
1195
1206
|
})])) : h("", !0)
|
|
1196
|
-
], 46,
|
|
1207
|
+
], 46, He))), 128))], 8, Ve)),
|
|
1197
1208
|
_("div", {
|
|
1198
1209
|
ref_key: "sentinelRef",
|
|
1199
1210
|
ref: I,
|
|
1200
1211
|
class: "tpl:h-4"
|
|
1201
1212
|
}, null, 512),
|
|
1202
|
-
e.isLoading && e.items.length > 0 ? (D(), g("div",
|
|
1213
|
+
e.isLoading && e.items.length > 0 ? (D(), g("div", ut, [y(F(K), {
|
|
1203
1214
|
class: "tpl-spinner",
|
|
1204
1215
|
size: 20,
|
|
1205
1216
|
"stroke-width": 2,
|
|
@@ -1207,26 +1218,26 @@ var Fe = { class: "tpl:p-4" }, Ie = ["aria-label"], Le = {
|
|
|
1207
1218
|
})])) : h("", !0)
|
|
1208
1219
|
]));
|
|
1209
1220
|
}
|
|
1210
|
-
}), [["__scopeId", "data-v-
|
|
1221
|
+
}), [["__scopeId", "data-v-375932e6"]]), ft = ["data-tpl-theme"], pt = {
|
|
1211
1222
|
id: "tpl-media-import-title",
|
|
1212
1223
|
class: "tpl:mb-4 tpl:text-sm tpl:font-semibold",
|
|
1213
1224
|
style: { color: "var(--tpl-text)" }
|
|
1214
|
-
},
|
|
1225
|
+
}, mt = { class: "tpl:mb-3" }, ht = [
|
|
1215
1226
|
"aria-label",
|
|
1216
1227
|
"aria-invalid",
|
|
1217
1228
|
"aria-describedby",
|
|
1218
1229
|
"placeholder",
|
|
1219
1230
|
"disabled"
|
|
1220
|
-
],
|
|
1231
|
+
], gt = {
|
|
1221
1232
|
key: 0,
|
|
1222
1233
|
id: "tpl-media-import-error",
|
|
1223
1234
|
role: "alert",
|
|
1224
1235
|
class: "tpl:mb-3 tpl:text-xs",
|
|
1225
1236
|
style: { color: "var(--tpl-danger)" }
|
|
1226
|
-
},
|
|
1237
|
+
}, _t = { class: "tpl:flex tpl:justify-end tpl:gap-2" }, vt = ["disabled"], yt = ["disabled"], bt = {
|
|
1227
1238
|
key: 0,
|
|
1228
1239
|
class: "tpl:flex tpl:items-center tpl:gap-1.5"
|
|
1229
|
-
},
|
|
1240
|
+
}, xt = { key: 1 }, St = /* @__PURE__ */ x({
|
|
1230
1241
|
__name: "MediaImportUrlModal",
|
|
1231
1242
|
props: {
|
|
1232
1243
|
visible: { type: Boolean },
|
|
@@ -1275,8 +1286,8 @@ var Fe = { class: "tpl:p-4" }, Ie = ["aria-label"], Le = {
|
|
|
1275
1286
|
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",
|
|
1276
1287
|
style: { "background-color": "var(--tpl-bg-elevated)" }
|
|
1277
1288
|
}, [
|
|
1278
|
-
_("h3",
|
|
1279
|
-
_("div",
|
|
1289
|
+
_("h3", pt, M(F(s).mediaLibrary.importFromUrl), 1),
|
|
1290
|
+
_("div", mt, [z(_("input", {
|
|
1280
1291
|
"onUpdate:modelValue": n[0] ||= (e) => b.value = e,
|
|
1281
1292
|
type: "url",
|
|
1282
1293
|
"aria-label": F(s).mediaLibrary.importFromUrl,
|
|
@@ -1291,9 +1302,9 @@ var Fe = { class: "tpl:p-4" }, Ie = ["aria-label"], Le = {
|
|
|
1291
1302
|
placeholder: F(s).mediaLibrary.importUrlPlaceholder,
|
|
1292
1303
|
disabled: e.isImporting,
|
|
1293
1304
|
autofocus: ""
|
|
1294
|
-
}, null, 8,
|
|
1295
|
-
e.error ? (D(), g("p",
|
|
1296
|
-
_("div",
|
|
1305
|
+
}, null, 8, ht), [[I, b.value]])]),
|
|
1306
|
+
e.error ? (D(), g("p", gt, M(e.error), 1)) : h("", !0),
|
|
1307
|
+
_("div", _t, [_("button", {
|
|
1297
1308
|
class: w(["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": e.isImporting }]),
|
|
1298
1309
|
style: {
|
|
1299
1310
|
"border-color": "var(--tpl-border)",
|
|
@@ -1302,7 +1313,7 @@ var Fe = { class: "tpl:p-4" }, Ie = ["aria-label"], Le = {
|
|
|
1302
1313
|
},
|
|
1303
1314
|
disabled: e.isImporting,
|
|
1304
1315
|
onClick: S
|
|
1305
|
-
}, M(F(s).mediaLibrary.cancel), 11,
|
|
1316
|
+
}, M(F(s).mediaLibrary.cancel), 11, vt), _("button", {
|
|
1306
1317
|
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",
|
|
1307
1318
|
style: {
|
|
1308
1319
|
"background-color": "var(--tpl-primary)",
|
|
@@ -1310,20 +1321,20 @@ var Fe = { class: "tpl:p-4" }, Ie = ["aria-label"], Le = {
|
|
|
1310
1321
|
},
|
|
1311
1322
|
disabled: !b.value.trim() || e.isImporting,
|
|
1312
1323
|
onClick: x
|
|
1313
|
-
}, [e.isImporting ? (D(), g("span",
|
|
1324
|
+
}, [e.isImporting ? (D(), g("span", bt, [y(F(K), {
|
|
1314
1325
|
class: "tpl:animate-spin",
|
|
1315
1326
|
size: 12,
|
|
1316
1327
|
"stroke-width": 2
|
|
1317
|
-
}), v(" " + M(F(s).mediaLibrary.importing), 1)])) : (D(), g("span",
|
|
1318
|
-
], 512)], 42,
|
|
1328
|
+
}), v(" " + M(F(s).mediaLibrary.importing), 1)])) : (D(), g("span", xt, M(F(s).mediaLibrary.import), 1))], 8, yt)])
|
|
1329
|
+
], 512)], 42, ft)) : h("", !0)]),
|
|
1319
1330
|
_: 1
|
|
1320
1331
|
})], 8, ["to"]));
|
|
1321
1332
|
}
|
|
1322
|
-
}),
|
|
1333
|
+
}), Ct = { class: "tpl:max-h-56 tpl:overflow-y-auto tpl:py-1" }, wt = ["disabled", "onClick"], Tt = { class: "tpl:truncate" }, Et = {
|
|
1323
1334
|
key: 0,
|
|
1324
1335
|
class: "tpl:shrink-0",
|
|
1325
1336
|
style: { color: "var(--tpl-text-dim)" }
|
|
1326
|
-
},
|
|
1337
|
+
}, Dt = /* @__PURE__ */ x({
|
|
1327
1338
|
__name: "MediaMovePicker",
|
|
1328
1339
|
props: {
|
|
1329
1340
|
folders: {},
|
|
@@ -1341,7 +1352,7 @@ var Fe = { class: "tpl:p-4" }, Ie = ["aria-label"], Le = {
|
|
|
1341
1352
|
}), r.children.length && n.push(...o(r.children, t + 1));
|
|
1342
1353
|
return n;
|
|
1343
1354
|
}
|
|
1344
|
-
return
|
|
1355
|
+
return Z(a, () => {
|
|
1345
1356
|
r("close");
|
|
1346
1357
|
}), (t, n) => (D(), g("div", {
|
|
1347
1358
|
ref_key: "pickerRef",
|
|
@@ -1352,12 +1363,12 @@ var Fe = { class: "tpl:p-4" }, Ie = ["aria-label"], Le = {
|
|
|
1352
1363
|
"border-color": "var(--tpl-border)",
|
|
1353
1364
|
"background-color": "var(--tpl-bg-elevated)"
|
|
1354
1365
|
}
|
|
1355
|
-
}, [_("div",
|
|
1366
|
+
}, [_("div", Ct, [e.currentFolderId === null ? h("", !0) : (D(), g("button", {
|
|
1356
1367
|
key: 0,
|
|
1357
1368
|
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",
|
|
1358
1369
|
style: { color: "var(--tpl-text)" },
|
|
1359
1370
|
onClick: n[0] ||= (e) => r("select", null)
|
|
1360
|
-
}, [y(F(
|
|
1371
|
+
}, [y(F(W), {
|
|
1361
1372
|
class: "tpl:shrink-0",
|
|
1362
1373
|
size: 14,
|
|
1363
1374
|
"stroke-width": 1.5
|
|
@@ -1372,26 +1383,26 @@ var Fe = { class: "tpl:p-4" }, Ie = ["aria-label"], Le = {
|
|
|
1372
1383
|
disabled: t.id === e.currentFolderId,
|
|
1373
1384
|
onClick: (e) => r("select", t.id)
|
|
1374
1385
|
}, [
|
|
1375
|
-
y(F(
|
|
1386
|
+
y(F(G), {
|
|
1376
1387
|
class: "tpl:shrink-0",
|
|
1377
1388
|
size: 14,
|
|
1378
1389
|
"stroke-width": 1.5
|
|
1379
1390
|
}),
|
|
1380
|
-
_("span",
|
|
1381
|
-
t.id === e.currentFolderId ? (D(), g("span",
|
|
1382
|
-
], 12,
|
|
1391
|
+
_("span", Tt, M(t.name), 1),
|
|
1392
|
+
t.id === e.currentFolderId ? (D(), g("span", Et, M(F(i).mediaLibrary.currentFolder), 1)) : h("", !0)
|
|
1393
|
+
], 12, wt))), 128))])], 512));
|
|
1383
1394
|
}
|
|
1384
|
-
}),
|
|
1395
|
+
}), Ot = { class: "tpl:flex tpl:items-center tpl:gap-3" }, kt = ["src", "alt"], At = {
|
|
1385
1396
|
key: 1,
|
|
1386
1397
|
class: "tpl:flex tpl:size-10 tpl:shrink-0 tpl:items-center tpl:justify-center tpl:overflow-hidden tpl:rounded",
|
|
1387
1398
|
style: { border: "1px solid var(--tpl-border)" }
|
|
1388
|
-
},
|
|
1399
|
+
}, jt = { class: "tpl:min-w-0 tpl:flex-1" }, Mt = {
|
|
1389
1400
|
class: "tpl:truncate tpl:text-xs tpl:font-medium",
|
|
1390
1401
|
style: { color: "var(--tpl-text)" }
|
|
1391
|
-
},
|
|
1402
|
+
}, Nt = {
|
|
1392
1403
|
class: "tpl:mt-0.5 tpl:text-[10px]",
|
|
1393
1404
|
style: { color: "var(--tpl-text-muted)" }
|
|
1394
|
-
},
|
|
1405
|
+
}, Pt = /*#__PURE__*/ i(/* @__PURE__ */ x({
|
|
1395
1406
|
__name: "MediaPreviewPanel",
|
|
1396
1407
|
props: {
|
|
1397
1408
|
item: {},
|
|
@@ -1416,34 +1427,31 @@ var Fe = { class: "tpl:p-4" }, Ie = ["aria-label"], Le = {
|
|
|
1416
1427
|
return e ? e.join("/") : null;
|
|
1417
1428
|
}), c = f(() => n.item.mimeType ?? ""), u = f(() => i(c.value));
|
|
1418
1429
|
function d(e) {
|
|
1419
|
-
return
|
|
1420
|
-
}
|
|
1421
|
-
function p(e) {
|
|
1422
|
-
return Pe(e, r?.value, {
|
|
1430
|
+
return Fe(e, r?.value, {
|
|
1423
1431
|
year: "numeric",
|
|
1424
1432
|
month: "short",
|
|
1425
1433
|
day: "numeric"
|
|
1426
1434
|
});
|
|
1427
1435
|
}
|
|
1428
|
-
let
|
|
1429
|
-
return (t, n) => (D(), g("div",
|
|
1436
|
+
let p = f(() => n.item.filename || n.item.url);
|
|
1437
|
+
return (t, n) => (D(), g("div", Ot, [u.value ? (D(), g("img", {
|
|
1430
1438
|
key: 0,
|
|
1431
1439
|
src: e.item.url,
|
|
1432
|
-
alt: e.item.alt ||
|
|
1440
|
+
alt: e.item.alt || p.value,
|
|
1433
1441
|
class: "tpl:size-10 tpl:shrink-0 tpl:rounded tpl:object-cover",
|
|
1434
1442
|
style: { border: "1px solid var(--tpl-border)" }
|
|
1435
|
-
}, null, 8,
|
|
1443
|
+
}, null, 8, kt)) : (D(), g("div", At, [y(Pe, {
|
|
1436
1444
|
"mime-type": c.value,
|
|
1437
1445
|
class: "tpl-preview-icon"
|
|
1438
|
-
}, null, 8, ["mime-type"])])), _("div",
|
|
1439
|
-
_("p",
|
|
1440
|
-
_("p",
|
|
1441
|
-
e.item.size == null ? h("", !0) : (D(), g(l, { key: 0 }, [v(M(
|
|
1442
|
-
e.item.createdAt ? (D(), g(l, { key: 1 }, [e.item.size == null ? h("", !0) : (D(), g(l, { key: 0 }, [v(" · ")], 64)), v(" " + M(
|
|
1446
|
+
}, null, 8, ["mime-type"])])), _("div", jt, [
|
|
1447
|
+
_("p", Mt, M(p.value), 1),
|
|
1448
|
+
_("p", Nt, [
|
|
1449
|
+
e.item.size == null ? h("", !0) : (D(), g(l, { key: 0 }, [v(M(F(Q)(e.item.size)), 1)], 64)),
|
|
1450
|
+
e.item.createdAt ? (D(), g(l, { key: 1 }, [e.item.size == null ? h("", !0) : (D(), g(l, { key: 0 }, [v(" · ")], 64)), v(" " + M(d(e.item.createdAt)), 1)], 64)) : h("", !0),
|
|
1443
1451
|
u.value && e.item.width && e.item.height ? (D(), g(l, { key: 2 }, [v(" · " + M(e.item.width) + "×" + M(e.item.height) + "px ", 1)], 64)) : h("", !0),
|
|
1444
1452
|
s.value ? (D(), g(l, { key: 3 }, [
|
|
1445
1453
|
n[0] ||= v(" · ", -1),
|
|
1446
|
-
y(F(
|
|
1454
|
+
y(F(G), {
|
|
1447
1455
|
class: "tpl:mb-px tpl:inline",
|
|
1448
1456
|
size: 9,
|
|
1449
1457
|
"stroke-width": 2
|
|
@@ -1458,37 +1466,37 @@ var Fe = { class: "tpl:p-4" }, Ie = ["aria-label"], Le = {
|
|
|
1458
1466
|
}, M(e.item.alt || "\xA0"), 3)) : h("", !0)
|
|
1459
1467
|
])]));
|
|
1460
1468
|
}
|
|
1461
|
-
}), [["__scopeId", "data-v-
|
|
1469
|
+
}), [["__scopeId", "data-v-9ebc1a04"]]), Ft = ["data-tpl-theme"], It = {
|
|
1462
1470
|
id: "tpl-media-replace-title",
|
|
1463
1471
|
class: "tpl:mb-2 tpl:text-sm tpl:font-semibold",
|
|
1464
1472
|
style: { color: "var(--tpl-text)" }
|
|
1465
|
-
},
|
|
1473
|
+
}, Lt = {
|
|
1466
1474
|
class: "tpl:mb-2 tpl:text-xs",
|
|
1467
1475
|
style: { color: "var(--tpl-text-muted)" }
|
|
1468
|
-
},
|
|
1476
|
+
}, Rt = {
|
|
1469
1477
|
key: 0,
|
|
1470
1478
|
class: "tpl:mb-3 tpl:text-xs",
|
|
1471
1479
|
style: { color: "var(--tpl-text-muted)" }
|
|
1472
|
-
},
|
|
1480
|
+
}, zt = {
|
|
1473
1481
|
class: "tpl:mb-3 tpl:rounded tpl:border tpl:p-2",
|
|
1474
1482
|
style: { "border-color": "var(--tpl-border)" }
|
|
1475
|
-
},
|
|
1483
|
+
}, Bt = {
|
|
1476
1484
|
class: "tpl:truncate tpl:text-xs tpl:font-medium",
|
|
1477
1485
|
style: { color: "var(--tpl-text)" }
|
|
1478
|
-
},
|
|
1486
|
+
}, Vt = { class: "tpl:mb-4" }, Ht = {
|
|
1479
1487
|
class: "tpl:mb-1 tpl:block tpl:text-xs tpl:font-medium",
|
|
1480
1488
|
style: { color: "var(--tpl-text-muted)" }
|
|
1481
|
-
},
|
|
1489
|
+
}, Ut = [
|
|
1482
1490
|
"accept",
|
|
1483
1491
|
"aria-invalid",
|
|
1484
1492
|
"aria-describedby"
|
|
1485
|
-
],
|
|
1493
|
+
], Wt = {
|
|
1486
1494
|
key: 1,
|
|
1487
1495
|
id: "tpl-media-replace-error",
|
|
1488
1496
|
role: "alert",
|
|
1489
1497
|
class: "tpl:mb-3 tpl:text-xs",
|
|
1490
1498
|
style: { color: "var(--tpl-danger)" }
|
|
1491
|
-
},
|
|
1499
|
+
}, Gt = { class: "tpl:flex tpl:justify-end tpl:gap-2" }, Kt = ["disabled"], qt = ["disabled"], Jt = /* @__PURE__ */ x({
|
|
1492
1500
|
__name: "MediaReplaceModal",
|
|
1493
1501
|
props: {
|
|
1494
1502
|
visible: { type: Boolean },
|
|
@@ -1543,11 +1551,11 @@ var Fe = { class: "tpl:p-4" }, Ie = ["aria-label"], Le = {
|
|
|
1543
1551
|
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",
|
|
1544
1552
|
style: { "background-color": "var(--tpl-bg-elevated)" }
|
|
1545
1553
|
}, [
|
|
1546
|
-
_("h3",
|
|
1547
|
-
_("p",
|
|
1548
|
-
T.value ? (D(), g("p",
|
|
1549
|
-
_("div",
|
|
1550
|
-
_("div",
|
|
1554
|
+
_("h3", It, M(F(s).mediaLibrary.replaceWarningTitle), 1),
|
|
1555
|
+
_("p", Lt, M(F(s).mediaLibrary.replaceWarningMessage.replace("{extension}", `.${x.value}`)), 1),
|
|
1556
|
+
T.value ? (D(), g("p", Rt, M(F(s).mediaLibrary.replaceWarningUsageNote.replace("{count}", e.usageInfo.templateCount.toString())), 1)) : h("", !0),
|
|
1557
|
+
_("div", zt, [_("p", Bt, M(e.item.filename), 1)]),
|
|
1558
|
+
_("div", Vt, [_("label", Ht, M(F(s).mediaLibrary.replaceSelectFile), 1), _("input", {
|
|
1551
1559
|
ref_key: "fileInputRef",
|
|
1552
1560
|
ref: v,
|
|
1553
1561
|
type: "file",
|
|
@@ -1561,9 +1569,9 @@ var Fe = { class: "tpl:p-4" }, Ie = ["aria-label"], Le = {
|
|
|
1561
1569
|
color: "var(--tpl-text)"
|
|
1562
1570
|
},
|
|
1563
1571
|
onChange: E
|
|
1564
|
-
}, null, 40,
|
|
1565
|
-
e.error ? (D(), g("p",
|
|
1566
|
-
_("div",
|
|
1572
|
+
}, null, 40, Ut)]),
|
|
1573
|
+
e.error ? (D(), g("p", Wt, M(e.error), 1)) : h("", !0),
|
|
1574
|
+
_("div", Gt, [_("button", {
|
|
1567
1575
|
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",
|
|
1568
1576
|
style: {
|
|
1569
1577
|
"border-color": "var(--tpl-border)",
|
|
@@ -1572,7 +1580,7 @@ var Fe = { class: "tpl:p-4" }, Ie = ["aria-label"], Le = {
|
|
|
1572
1580
|
},
|
|
1573
1581
|
disabled: e.isReplacing,
|
|
1574
1582
|
onClick: n[0] ||= (e) => o("close")
|
|
1575
|
-
}, M(F(s).mediaLibrary.cancel), 9,
|
|
1583
|
+
}, M(F(s).mediaLibrary.cancel), 9, Kt), _("button", {
|
|
1576
1584
|
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",
|
|
1577
1585
|
style: {
|
|
1578
1586
|
"background-color": "var(--tpl-primary)",
|
|
@@ -1580,91 +1588,128 @@ var Fe = { class: "tpl:p-4" }, Ie = ["aria-label"], Le = {
|
|
|
1580
1588
|
},
|
|
1581
1589
|
disabled: !b.value || e.isReplacing,
|
|
1582
1590
|
onClick: O
|
|
1583
|
-
}, M(e.isReplacing ? F(s).mediaLibrary.replacing : F(s).mediaLibrary.replace), 9,
|
|
1584
|
-
], 512)], 42,
|
|
1591
|
+
}, M(e.isReplacing ? F(s).mediaLibrary.replacing : F(s).mediaLibrary.replace), 9, qt)])
|
|
1592
|
+
], 512)], 42, Ft)) : h("", !0)]),
|
|
1585
1593
|
_: 1
|
|
1586
1594
|
})], 8, ["to"]));
|
|
1587
1595
|
}
|
|
1588
|
-
})
|
|
1596
|
+
});
|
|
1597
|
+
//#endregion
|
|
1598
|
+
//#region src/utils/formatList.ts
|
|
1599
|
+
function Yt(e, t) {
|
|
1600
|
+
let n = {
|
|
1601
|
+
style: "narrow",
|
|
1602
|
+
type: "conjunction"
|
|
1603
|
+
};
|
|
1604
|
+
try {
|
|
1605
|
+
return new Intl.ListFormat(t, n).format(e);
|
|
1606
|
+
} catch (t) {
|
|
1607
|
+
if (!(t instanceof RangeError)) throw t;
|
|
1608
|
+
return new Intl.ListFormat(void 0, n).format(e);
|
|
1609
|
+
}
|
|
1610
|
+
}
|
|
1611
|
+
//#endregion
|
|
1612
|
+
//#region src/components/media/MediaUploadZone.vue?vue&type=script&setup=true&lang.ts
|
|
1613
|
+
var Xt = [
|
|
1614
|
+
"aria-label",
|
|
1615
|
+
"aria-describedby",
|
|
1616
|
+
"aria-busy"
|
|
1617
|
+
], Zt = {
|
|
1589
1618
|
key: 0,
|
|
1590
1619
|
class: "tpl:flex tpl:items-center tpl:gap-2"
|
|
1591
|
-
},
|
|
1620
|
+
}, Qt = {
|
|
1592
1621
|
class: "tpl:text-xs",
|
|
1593
1622
|
style: { color: "var(--tpl-text-muted)" }
|
|
1594
|
-
},
|
|
1623
|
+
}, $t = {
|
|
1595
1624
|
class: "tpl:text-xs",
|
|
1596
1625
|
style: { color: "var(--tpl-text-muted)" }
|
|
1597
|
-
},
|
|
1626
|
+
}, en = {
|
|
1627
|
+
id: "tpl-media-upload-hint",
|
|
1628
|
+
"data-testid": "media-upload-hint",
|
|
1598
1629
|
class: "tpl:mt-1 tpl:text-[10px]",
|
|
1599
1630
|
style: { color: "var(--tpl-text-dim)" }
|
|
1600
|
-
},
|
|
1631
|
+
}, tn = {
|
|
1632
|
+
key: 0,
|
|
1633
|
+
"data-testid": "media-upload-rejected",
|
|
1634
|
+
role: "alert",
|
|
1635
|
+
class: "tpl:mt-1.5 tpl:text-xs tpl:break-words",
|
|
1636
|
+
style: { color: "var(--tpl-danger)" }
|
|
1637
|
+
}, nn = /* @__PURE__ */ x({
|
|
1601
1638
|
__name: "MediaUploadZone",
|
|
1602
1639
|
props: {
|
|
1603
1640
|
isUploading: { type: Boolean },
|
|
1604
1641
|
uploadProgress: {}
|
|
1605
1642
|
},
|
|
1606
1643
|
emits: ["upload"],
|
|
1607
|
-
setup(e, { emit:
|
|
1608
|
-
let
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
}
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1644
|
+
setup(e, { emit: r }) {
|
|
1645
|
+
let i = r, { t: a, format: s } = n(), c = C(t, null), { allAcceptedInputString: u, restrictsMimeTypes: d, availableCategories: p, maxFileSize: m, isAcceptedFile: v } = o(), b = {
|
|
1646
|
+
images: "filterImages",
|
|
1647
|
+
documents: "filterDocuments",
|
|
1648
|
+
videos: "filterVideos",
|
|
1649
|
+
audio: "filterAudio"
|
|
1650
|
+
}, x = f(() => {
|
|
1651
|
+
let e = a.mediaLibrary, t = d.value ? Yt(p.value.map((t) => e[b[t]]), c?.value) : a.mediaLibrary.acceptedAnyType;
|
|
1652
|
+
return Number.isFinite(m.value) ? s(a.mediaLibrary.acceptedFormatsMaxSize, {
|
|
1653
|
+
formats: t,
|
|
1654
|
+
size: Q(m.value)
|
|
1655
|
+
}) : t;
|
|
1656
|
+
}), S = k([]), T = k();
|
|
1657
|
+
function E(e) {
|
|
1658
|
+
let t = [], n = [];
|
|
1659
|
+
for (let r of Array.from(e)) v(r) ? t.push(r) : n.push(r.name);
|
|
1660
|
+
S.value = n, t.length && i("upload", t);
|
|
1661
|
+
}
|
|
1662
|
+
let { isOverDropZone: O } = de(T, { onDrop: (e) => {
|
|
1663
|
+
e?.length && E(e);
|
|
1664
|
+
} }), { open: A, onChange: j } = pe({
|
|
1665
|
+
accept: u.value,
|
|
1622
1666
|
multiple: !0
|
|
1623
1667
|
});
|
|
1624
|
-
return
|
|
1625
|
-
e?.length &&
|
|
1626
|
-
}), (t, n) => (D(), g("button", {
|
|
1668
|
+
return j((e) => {
|
|
1669
|
+
e?.length && E(e);
|
|
1670
|
+
}), (t, n) => (D(), g(l, null, [_("button", {
|
|
1627
1671
|
ref_key: "dropZoneRef",
|
|
1628
|
-
ref:
|
|
1672
|
+
ref: T,
|
|
1629
1673
|
type: "button",
|
|
1630
1674
|
"data-testid": "media-upload-zone",
|
|
1631
|
-
class: w(["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", F(
|
|
1632
|
-
"aria-label": F(
|
|
1675
|
+
class: w(["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", F(O) ? "tpl-upload-zone-active" : ""]),
|
|
1676
|
+
"aria-label": F(a).mediaLibrary.dropOrClick,
|
|
1677
|
+
"aria-describedby": e.isUploading ? void 0 : "tpl-media-upload-hint",
|
|
1633
1678
|
"aria-busy": e.isUploading,
|
|
1634
1679
|
style: {
|
|
1635
1680
|
"border-color": "var(--tpl-border-light)",
|
|
1636
1681
|
"background-color": "var(--tpl-bg)"
|
|
1637
1682
|
},
|
|
1638
|
-
onClick: n[0] ||= (e) => F(
|
|
1639
|
-
}, [e.isUploading ? (D(), g("div",
|
|
1683
|
+
onClick: n[0] ||= (e) => F(A)()
|
|
1684
|
+
}, [e.isUploading ? (D(), g("div", Zt, [y(F(K), {
|
|
1640
1685
|
class: "tpl-spinner",
|
|
1641
1686
|
size: 20,
|
|
1642
1687
|
"stroke-width": 2,
|
|
1643
1688
|
style: { color: "var(--tpl-primary)" }
|
|
1644
|
-
}), _("span",
|
|
1689
|
+
}), _("span", Qt, M(e.uploadProgress && e.uploadProgress.total > 1 ? F(s)(F(a).mediaLibrary.uploadingProgress, {
|
|
1645
1690
|
current: e.uploadProgress.current,
|
|
1646
1691
|
total: e.uploadProgress.total
|
|
1647
|
-
}) : F(
|
|
1648
|
-
y(F(
|
|
1692
|
+
}) : F(a).mediaLibrary.uploading), 1)])) : (D(), g(l, { key: 1 }, [
|
|
1693
|
+
y(F(X), {
|
|
1649
1694
|
class: "tpl:mb-2",
|
|
1650
1695
|
size: 24,
|
|
1651
1696
|
"stroke-width": 1.5,
|
|
1652
1697
|
style: { color: "var(--tpl-text-dim)" }
|
|
1653
1698
|
}),
|
|
1654
|
-
_("p",
|
|
1655
|
-
_("p",
|
|
1656
|
-
], 64))], 10,
|
|
1699
|
+
_("p", $t, M(F(a).mediaLibrary.dropOrClick), 1),
|
|
1700
|
+
_("p", en, M(x.value), 1)
|
|
1701
|
+
], 64))], 10, Xt), S.value.length ? (D(), g("p", tn, M(F(s)(F(a).mediaLibrary.uploadRejected, { files: S.value.join(", ") })), 1)) : h("", !0)], 64));
|
|
1657
1702
|
}
|
|
1658
|
-
}),
|
|
1703
|
+
}), rn = ["aria-label"], an = [
|
|
1659
1704
|
"width",
|
|
1660
1705
|
"height",
|
|
1661
1706
|
"viewBox"
|
|
1662
|
-
],
|
|
1707
|
+
], on = [
|
|
1663
1708
|
"cx",
|
|
1664
1709
|
"cy",
|
|
1665
1710
|
"r",
|
|
1666
1711
|
"stroke-width"
|
|
1667
|
-
],
|
|
1712
|
+
], sn = [
|
|
1668
1713
|
"cx",
|
|
1669
1714
|
"cy",
|
|
1670
1715
|
"r",
|
|
@@ -1672,14 +1717,14 @@ var Fe = { class: "tpl:p-4" }, Ie = ["aria-label"], Le = {
|
|
|
1672
1717
|
"stroke",
|
|
1673
1718
|
"stroke-dasharray",
|
|
1674
1719
|
"stroke-dashoffset"
|
|
1675
|
-
],
|
|
1720
|
+
], cn = {
|
|
1676
1721
|
key: 0,
|
|
1677
1722
|
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",
|
|
1678
1723
|
style: {
|
|
1679
1724
|
"background-color": "var(--tpl-text)",
|
|
1680
1725
|
color: "var(--tpl-bg-elevated)"
|
|
1681
1726
|
}
|
|
1682
|
-
},
|
|
1727
|
+
}, ln = /* @__PURE__ */ x({
|
|
1683
1728
|
__name: "StorageProgressRing",
|
|
1684
1729
|
props: {
|
|
1685
1730
|
usedBytes: {},
|
|
@@ -1687,27 +1732,16 @@ var Fe = { class: "tpl:p-4" }, Ie = ["aria-label"], Le = {
|
|
|
1687
1732
|
size: {}
|
|
1688
1733
|
},
|
|
1689
1734
|
setup(e) {
|
|
1690
|
-
let t = e, { t: r, format: i } = n(), a = k(!1), o = f(() => t.size ?? 24), s = f(() => Math.max(2, o.value / 8)), c = f(() => (o.value - s.value) / 2), l = f(() => 2 * Math.PI * c.value), u = f(() => t.limitBytes <= 0 ? 0 : Math.min(100, t.usedBytes / t.limitBytes * 100)), p = f(() => l.value - u.value / 100 * l.value), m = f(() => u.value >= 95 ? "var(--tpl-danger)" : u.value >= 75 ? "var(--tpl-warning)" : "var(--tpl-primary)")
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
"B",
|
|
1695
|
-
"KB",
|
|
1696
|
-
"MB",
|
|
1697
|
-
"GB"
|
|
1698
|
-
], r = Math.floor(Math.log(e) / Math.log(t)), i = e / t ** r, a = +(r >= 2);
|
|
1699
|
-
return `${i.toFixed(a)} ${n[r]}`;
|
|
1700
|
-
}
|
|
1701
|
-
let x = f(() => b(t.usedBytes)), S = f(() => b(t.limitBytes)), C = f(() => Math.max(0, t.limitBytes - t.usedBytes)), w = f(() => b(C.value)), T = f(() => i(r.mediaLibrary.storageTooltip, {
|
|
1702
|
-
used: x.value,
|
|
1703
|
-
total: S.value,
|
|
1704
|
-
remaining: w.value
|
|
1735
|
+
let t = e, { t: r, format: i } = n(), a = k(!1), o = f(() => t.size ?? 24), s = f(() => Math.max(2, o.value / 8)), c = f(() => (o.value - s.value) / 2), l = f(() => 2 * Math.PI * c.value), u = f(() => t.limitBytes <= 0 ? 0 : Math.min(100, t.usedBytes / t.limitBytes * 100)), p = f(() => l.value - u.value / 100 * l.value), m = f(() => u.value >= 95 ? "var(--tpl-danger)" : u.value >= 75 ? "var(--tpl-warning)" : "var(--tpl-primary)"), b = f(() => Q(t.usedBytes)), x = f(() => Q(t.limitBytes)), S = f(() => Math.max(0, t.limitBytes - t.usedBytes)), C = f(() => Q(S.value)), w = f(() => i(r.mediaLibrary.storageTooltip, {
|
|
1736
|
+
used: b.value,
|
|
1737
|
+
total: x.value,
|
|
1738
|
+
remaining: C.value
|
|
1705
1739
|
}));
|
|
1706
1740
|
return (e, t) => (D(), g("div", {
|
|
1707
1741
|
"data-testid": "media-storage-ring",
|
|
1708
1742
|
class: "tpl:relative tpl:inline-flex tpl:cursor-help tpl:items-center tpl:justify-center",
|
|
1709
1743
|
tabindex: "0",
|
|
1710
|
-
"aria-label":
|
|
1744
|
+
"aria-label": w.value,
|
|
1711
1745
|
onMouseenter: t[0] ||= (e) => a.value = !0,
|
|
1712
1746
|
onMouseleave: t[1] ||= (e) => a.value = !1,
|
|
1713
1747
|
onFocus: t[2] ||= (e) => a.value = !0,
|
|
@@ -1724,7 +1758,7 @@ var Fe = { class: "tpl:p-4" }, Ie = ["aria-label"], Le = {
|
|
|
1724
1758
|
fill: "none",
|
|
1725
1759
|
"stroke-width": s.value,
|
|
1726
1760
|
style: { stroke: "var(--tpl-border)" }
|
|
1727
|
-
}, null, 8,
|
|
1761
|
+
}, null, 8, on), _("circle", {
|
|
1728
1762
|
cx: o.value / 2,
|
|
1729
1763
|
cy: o.value / 2,
|
|
1730
1764
|
r: c.value,
|
|
@@ -1735,7 +1769,7 @@ var Fe = { class: "tpl:p-4" }, Ie = ["aria-label"], Le = {
|
|
|
1735
1769
|
"stroke-dasharray": l.value,
|
|
1736
1770
|
"stroke-dashoffset": p.value,
|
|
1737
1771
|
class: "tpl:transition-all tpl:duration-300 tpl:ease-out"
|
|
1738
|
-
}, null, 8,
|
|
1772
|
+
}, null, 8, sn)], 8, an)), y(d, {
|
|
1739
1773
|
"enter-active-class": "tpl:transition tpl:ease-out tpl:duration-150",
|
|
1740
1774
|
"enter-from-class": "tpl:opacity-0 tpl:translate-y-1",
|
|
1741
1775
|
"enter-to-class": "tpl:opacity-100 tpl:translate-y-0",
|
|
@@ -1743,17 +1777,17 @@ var Fe = { class: "tpl:p-4" }, Ie = ["aria-label"], Le = {
|
|
|
1743
1777
|
"leave-from-class": "tpl:opacity-100 tpl:translate-y-0",
|
|
1744
1778
|
"leave-to-class": "tpl:opacity-0 tpl:translate-y-1"
|
|
1745
1779
|
}, {
|
|
1746
|
-
default: R(() => [a.value ? (D(), g("div",
|
|
1780
|
+
default: R(() => [a.value ? (D(), g("div", cn, [v(M(w.value) + " ", 1), t[4] ||= _("div", {
|
|
1747
1781
|
class: "tpl:absolute tpl:-top-1 tpl:left-1/2 tpl:size-2 tpl:-translate-x-1/2 tpl:rotate-45",
|
|
1748
1782
|
style: { "background-color": "var(--tpl-text)" }
|
|
1749
1783
|
}, null, -1)])) : h("", !0)]),
|
|
1750
1784
|
_: 1
|
|
1751
|
-
})], 40,
|
|
1785
|
+
})], 40, rn));
|
|
1752
1786
|
}
|
|
1753
1787
|
});
|
|
1754
1788
|
//#endregion
|
|
1755
1789
|
//#region src/utils/treeFolders.ts
|
|
1756
|
-
function
|
|
1790
|
+
function un(e) {
|
|
1757
1791
|
let t = /* @__PURE__ */ new Map();
|
|
1758
1792
|
for (let n of e) t.set(n.id, {
|
|
1759
1793
|
...n,
|
|
@@ -1768,12 +1802,12 @@ function on(e) {
|
|
|
1768
1802
|
}
|
|
1769
1803
|
//#endregion
|
|
1770
1804
|
//#region src/composables/useMediaLibraryUI.ts
|
|
1771
|
-
function
|
|
1805
|
+
function dn(e) {
|
|
1772
1806
|
let { library: t, translations: n } = e;
|
|
1773
1807
|
function r() {
|
|
1774
1808
|
return "value" in n && typeof n.value == "object" ? n.value : n;
|
|
1775
1809
|
}
|
|
1776
|
-
let i = k("grid"), a = k(!1), o = k(""), s = k(null), c = k(!1), l = k(!1), u = f(() => t.previewItem.value?.url ?? null), d = f(() => t.frequentlyUsedItems.value.length > 0), p = f(() => t.viewMode.value === "frequently-used" ? t.frequentlyUsedItems.value : t.items.value), m = f(() => Object.values(t.deleteUsageInfo.value).some((e) => e.templateCount > 0)), h = f(() =>
|
|
1810
|
+
let i = k("grid"), a = k(!1), o = k(""), s = k(null), c = k(!1), l = k(!1), u = f(() => t.previewItem.value?.url ?? null), d = f(() => t.frequentlyUsedItems.value.length > 0), p = f(() => t.viewMode.value === "frequently-used" ? t.frequentlyUsedItems.value : t.items.value), m = f(() => Object.values(t.deleteUsageInfo.value).some((e) => e.templateCount > 0)), h = f(() => un(t.folders.value)), g = {
|
|
1777
1811
|
images: () => r().mediaLibrary.filterImages,
|
|
1778
1812
|
documents: () => r().mediaLibrary.filterDocuments,
|
|
1779
1813
|
videos: () => r().mediaLibrary.filterVideos,
|
|
@@ -1785,13 +1819,13 @@ function sn(e) {
|
|
|
1785
1819
|
L(a, (e) => {
|
|
1786
1820
|
e && t.loadFolders();
|
|
1787
1821
|
});
|
|
1788
|
-
let v =
|
|
1822
|
+
let v = ue((e) => {
|
|
1789
1823
|
t.search(e);
|
|
1790
1824
|
}, 300);
|
|
1791
1825
|
function y(e) {
|
|
1792
1826
|
o.value = e, v(e);
|
|
1793
1827
|
}
|
|
1794
|
-
let { copy: b, copied: x } =
|
|
1828
|
+
let { copy: b, copied: x } = le({
|
|
1795
1829
|
copiedDuring: 2e3,
|
|
1796
1830
|
legacy: !0
|
|
1797
1831
|
});
|
|
@@ -1814,7 +1848,7 @@ function sn(e) {
|
|
|
1814
1848
|
s.value = e;
|
|
1815
1849
|
}
|
|
1816
1850
|
async function O(e, n, r, i) {
|
|
1817
|
-
i && await t.replaceMediaDirectly(e, i.file)
|
|
1851
|
+
return i && !await t.replaceMediaDirectly(e, i.file) ? "failed" : await t.updateFile(e, n, r) ? (s.value = null, "saved") : i ? "replaced" : "failed";
|
|
1818
1852
|
}
|
|
1819
1853
|
async function A(e) {
|
|
1820
1854
|
await t.importFromUrl(e) && (c.value = !1);
|
|
@@ -1867,82 +1901,82 @@ function sn(e) {
|
|
|
1867
1901
|
}
|
|
1868
1902
|
//#endregion
|
|
1869
1903
|
//#region src/components/MediaLibraryChrome.vue?vue&type=script&setup=true&lang.ts
|
|
1870
|
-
var
|
|
1904
|
+
var fn = { class: "tpl:relative tpl:flex tpl:min-h-0 tpl:flex-1 tpl:flex-col tpl:overflow-hidden" }, pn = {
|
|
1871
1905
|
class: "tpl:flex tpl:shrink-0 tpl:items-center tpl:justify-between tpl:border-b tpl:px-5 tpl:py-3.5",
|
|
1872
1906
|
style: { "border-color": "var(--tpl-border)" }
|
|
1873
|
-
},
|
|
1907
|
+
}, mn = {
|
|
1874
1908
|
id: "tpl-media-library-title",
|
|
1875
1909
|
class: "tpl:text-sm tpl:font-semibold",
|
|
1876
1910
|
style: { color: "var(--tpl-text)" }
|
|
1877
|
-
},
|
|
1911
|
+
}, hn = { class: "tpl:flex tpl:items-center tpl:gap-3" }, gn = { class: "tpl:relative" }, _n = [
|
|
1878
1912
|
"value",
|
|
1879
1913
|
"disabled",
|
|
1880
1914
|
"aria-label",
|
|
1881
1915
|
"placeholder"
|
|
1882
|
-
],
|
|
1916
|
+
], vn = ["aria-label"], yn = { class: "tpl:flex tpl:min-h-0 tpl:flex-1 tpl:overflow-hidden" }, bn = {
|
|
1883
1917
|
key: 0,
|
|
1884
1918
|
class: "tpl:flex tpl:w-48 tpl:shrink-0 tpl:flex-col tpl:border-r",
|
|
1885
1919
|
style: {
|
|
1886
1920
|
"border-color": "var(--tpl-border)",
|
|
1887
1921
|
"background-color": "var(--tpl-bg)"
|
|
1888
1922
|
}
|
|
1889
|
-
},
|
|
1923
|
+
}, xn = { class: "tpl:flex tpl:min-w-0 tpl:flex-1 tpl:flex-col" }, Sn = {
|
|
1890
1924
|
class: "tpl:flex tpl:shrink-0 tpl:items-center tpl:justify-between tpl:border-b tpl:px-4 tpl:py-2.5",
|
|
1891
1925
|
style: { "border-color": "var(--tpl-border)" }
|
|
1892
|
-
},
|
|
1926
|
+
}, Cn = { class: "tpl:flex tpl:items-center tpl:gap-2" }, wn = [
|
|
1893
1927
|
"title",
|
|
1894
1928
|
"aria-label",
|
|
1895
1929
|
"aria-pressed"
|
|
1896
|
-
],
|
|
1930
|
+
], Tn = {
|
|
1897
1931
|
key: 1,
|
|
1898
1932
|
class: "tpl:text-xs tpl:font-medium",
|
|
1899
1933
|
style: { color: "var(--tpl-text)" }
|
|
1900
|
-
},
|
|
1934
|
+
}, En = {
|
|
1901
1935
|
class: "tpl:flex tpl:rounded-md tpl:p-0.5",
|
|
1902
1936
|
style: {
|
|
1903
1937
|
border: "1px solid var(--tpl-border)",
|
|
1904
1938
|
"background-color": "var(--tpl-bg)"
|
|
1905
1939
|
}
|
|
1906
|
-
},
|
|
1940
|
+
}, Dn = [
|
|
1907
1941
|
"title",
|
|
1908
1942
|
"aria-label",
|
|
1909
1943
|
"aria-pressed"
|
|
1910
|
-
],
|
|
1944
|
+
], On = [
|
|
1911
1945
|
"title",
|
|
1912
1946
|
"aria-label",
|
|
1913
1947
|
"aria-pressed"
|
|
1914
|
-
],
|
|
1948
|
+
], kn = { class: "tpl:flex tpl:items-center tpl:gap-2" }, An = ["aria-label", "value"], jn = { value: "" }, Mn = ["value"], Nn = { class: "tpl:min-h-0 tpl:flex-1 tpl:overflow-y-auto" }, Pn = {
|
|
1915
1949
|
key: 0,
|
|
1916
1950
|
class: "tpl:px-4 tpl:pt-3"
|
|
1917
|
-
},
|
|
1951
|
+
}, Fn = {
|
|
1918
1952
|
class: "tpl-scale-in tpl:mx-4 tpl:w-full tpl:max-w-sm tpl:rounded-[var(--tpl-radius-lg)] tpl:p-5",
|
|
1919
1953
|
style: {
|
|
1920
1954
|
"background-color": "var(--tpl-bg-elevated)",
|
|
1921
1955
|
"box-shadow": "var(--tpl-shadow-xl)"
|
|
1922
1956
|
}
|
|
1923
|
-
},
|
|
1957
|
+
}, In = {
|
|
1924
1958
|
id: "tpl-media-delete-title",
|
|
1925
1959
|
class: "tpl:mb-2 tpl:text-sm tpl:font-semibold",
|
|
1926
1960
|
style: { color: "var(--tpl-text)" }
|
|
1927
|
-
},
|
|
1961
|
+
}, Ln = {
|
|
1928
1962
|
key: 0,
|
|
1929
1963
|
"data-testid": "media-delete-usage",
|
|
1930
1964
|
class: "tpl:mb-4 tpl:text-xs",
|
|
1931
1965
|
style: { color: "var(--tpl-text-muted)" }
|
|
1932
|
-
},
|
|
1966
|
+
}, Rn = {
|
|
1933
1967
|
key: 1,
|
|
1934
1968
|
class: "tpl:mb-4 tpl:max-h-32 tpl:overflow-y-auto tpl:rounded tpl:border tpl:p-2",
|
|
1935
1969
|
style: { "border-color": "var(--tpl-border)" }
|
|
1936
|
-
},
|
|
1970
|
+
}, zn = { class: "tpl:font-medium" }, Bn = { style: { color: "var(--tpl-text-muted)" } }, Vn = { class: "tpl:flex tpl:justify-end tpl:gap-2" }, Hn = {
|
|
1937
1971
|
class: "tpl:flex tpl:shrink-0 tpl:items-center tpl:justify-between tpl:border-t tpl:px-5 tpl:py-3",
|
|
1938
1972
|
style: { "border-color": "var(--tpl-border)" }
|
|
1939
|
-
},
|
|
1973
|
+
}, Un = { class: "tpl:flex tpl:min-w-0 tpl:flex-1 tpl:items-center tpl:gap-3" }, Wn = { class: "tpl:flex tpl:items-center tpl:gap-5" }, Gn = {
|
|
1940
1974
|
key: 0,
|
|
1941
1975
|
class: "tpl:flex tpl:items-center tpl:gap-2"
|
|
1942
|
-
},
|
|
1976
|
+
}, Kn = {
|
|
1943
1977
|
key: 1,
|
|
1944
1978
|
class: "tpl:relative"
|
|
1945
|
-
},
|
|
1979
|
+
}, qn = { class: "tpl:flex tpl:items-center tpl:gap-2" }, Jn = ["data-testid", "disabled"], Yn = /* @__PURE__ */ x({
|
|
1946
1980
|
__name: "MediaLibraryChrome",
|
|
1947
1981
|
props: {
|
|
1948
1982
|
provider: {},
|
|
@@ -1960,7 +1994,7 @@ var cn = { class: "tpl:relative tpl:flex tpl:min-h-0 tpl:flex-1 tpl:flex-col tpl
|
|
|
1960
1994
|
"ready"
|
|
1961
1995
|
],
|
|
1962
1996
|
setup(t, { expose: n, emit: r }) {
|
|
1963
|
-
let i = t, a = r, s = b(() => import("./MediaEditModal-
|
|
1997
|
+
let i = t, a = r, s = b(() => import("./MediaEditModal-CO_AVnsB.js")), c = f(() => i.translations), u = f(() => i.confirmTestId ?? "media-confirm"), p = {
|
|
1964
1998
|
get maxFileSize() {
|
|
1965
1999
|
return i.provider.maxFileSize;
|
|
1966
2000
|
},
|
|
@@ -1972,17 +2006,17 @@ var cn = { class: "tpl:relative tpl:flex tpl:min-h-0 tpl:flex-1 tpl:flex-col tpl
|
|
|
1972
2006
|
}
|
|
1973
2007
|
};
|
|
1974
2008
|
O(e, p);
|
|
1975
|
-
let { isAcceptedMimeType: x, availableCategories: S } = o(p), C =
|
|
2009
|
+
let { isAcceptedMimeType: x, availableCategories: S } = o(p), C = he({
|
|
1976
2010
|
provider: i.provider,
|
|
1977
2011
|
templateId: () => i.templateId,
|
|
1978
2012
|
onError: (e) => i.onError?.(e)
|
|
1979
|
-
}), k =
|
|
2013
|
+
}), k = dn({
|
|
1980
2014
|
library: C,
|
|
1981
2015
|
translations: c
|
|
1982
|
-
}), j = f(() => typeof i.provider.create == "function"), N = f(() => i.provider.folders !== !1), P = f(() => typeof i.provider.importFromUrl == "function"), I = f(() => typeof i.provider.delete == "function"), z = f(() => typeof i.provider.update == "function"), B = f(() => typeof i.provider.replace == "function"),
|
|
2016
|
+
}), j = f(() => typeof i.provider.create == "function"), N = f(() => i.provider.folders !== !1), P = f(() => typeof i.provider.importFromUrl == "function"), I = f(() => typeof i.provider.delete == "function"), z = f(() => typeof i.provider.update == "function"), B = f(() => typeof i.provider.replace == "function"), U = f(() => typeof i.provider.frequentlyUsed == "function"), W = f(() => {
|
|
1983
2017
|
let e = i.provider.folders;
|
|
1984
2018
|
return e !== !1 && typeof e.move == "function";
|
|
1985
|
-
}),
|
|
2019
|
+
}), G = f(() => {
|
|
1986
2020
|
let e = i.provider.folders;
|
|
1987
2021
|
return e !== !1 && typeof e.create == "function";
|
|
1988
2022
|
}), K = f(() => {
|
|
@@ -1991,26 +2025,26 @@ var cn = { class: "tpl:relative tpl:flex tpl:min-h-0 tpl:flex-1 tpl:flex-col tpl
|
|
|
1991
2025
|
}), q = f(() => {
|
|
1992
2026
|
let e = i.provider.folders;
|
|
1993
2027
|
return e !== !1 && typeof e.delete == "function";
|
|
1994
|
-
}),
|
|
2028
|
+
}), ae = f(() => C.isLoading.value && k.displayItems.value.length === 0), J = f(() => {
|
|
1995
2029
|
let e = C.previewItem.value;
|
|
1996
2030
|
return e ? !i.accept?.length || x(e.mimeType ?? "", i.accept) : !1;
|
|
1997
|
-
}),
|
|
2031
|
+
}), se = f(() => {
|
|
1998
2032
|
if (!I.value) return 0;
|
|
1999
2033
|
let e = 0;
|
|
2000
2034
|
for (let t of C.selectedItems.value) k.displayItems.value.find((e) => e.id === t)?.canDelete !== !1 && (e += 1);
|
|
2001
2035
|
return e;
|
|
2002
|
-
}),
|
|
2003
|
-
function
|
|
2004
|
-
return
|
|
2036
|
+
}), Y = f(() => k.showImportUrlModal.value || k.editingItem.value !== null || C.showReplaceWarning.value);
|
|
2037
|
+
function X() {
|
|
2038
|
+
return Y.value ? !0 : k.showMovePicker.value ? (k.showMovePicker.value = !1, !0) : C.showDeleteWarning.value ? (C.cancelDelete(), !0) : !1;
|
|
2005
2039
|
}
|
|
2006
|
-
function
|
|
2007
|
-
|
|
2040
|
+
function Z() {
|
|
2041
|
+
J.value && C.previewItem.value && a("confirm", C.previewItem.value);
|
|
2008
2042
|
}
|
|
2009
|
-
function
|
|
2043
|
+
function le(e) {
|
|
2010
2044
|
let t = e.target.value;
|
|
2011
2045
|
C.filterByCategory(t || null);
|
|
2012
2046
|
}
|
|
2013
|
-
async function
|
|
2047
|
+
async function ue() {
|
|
2014
2048
|
let e = /* @__PURE__ */ new Set();
|
|
2015
2049
|
for (let t of C.selectedItems.value) k.displayItems.value.find((e) => e.id === t)?.canDelete !== !1 && e.add(t);
|
|
2016
2050
|
C.selectedItems.value = e, await k.handleDeleteClick();
|
|
@@ -2020,22 +2054,22 @@ var cn = { class: "tpl:relative tpl:flex tpl:min-h-0 tpl:flex-1 tpl:flex-col tpl
|
|
|
2020
2054
|
}, { immediate: !0 }), C.loadItems(), C.loadFrequentlyUsed(), C.loadStorage(), a("ready"), E(() => {
|
|
2021
2055
|
k.resetUI();
|
|
2022
2056
|
}), n({
|
|
2023
|
-
nestedDialogOpen:
|
|
2024
|
-
handleEscape:
|
|
2057
|
+
nestedDialogOpen: Y,
|
|
2058
|
+
handleEscape: X,
|
|
2025
2059
|
library: C,
|
|
2026
2060
|
ui: k
|
|
2027
|
-
}), (e, n) => (D(), g("div",
|
|
2028
|
-
_("div",
|
|
2029
|
-
F(C).storageInfo.value ? (D(), m(
|
|
2061
|
+
}), (e, n) => (D(), g("div", fn, [
|
|
2062
|
+
_("div", pn, [_("h2", mn, M(c.value.mediaLibrary.title), 1), _("div", hn, [
|
|
2063
|
+
F(C).storageInfo.value ? (D(), m(ln, {
|
|
2030
2064
|
key: 0,
|
|
2031
2065
|
"used-bytes": F(C).storageInfo.value.usedBytes,
|
|
2032
2066
|
"limit-bytes": F(C).storageInfo.value.limitBytes,
|
|
2033
2067
|
size: 22
|
|
2034
2068
|
}, null, 8, ["used-bytes", "limit-bytes"])) : h("", !0),
|
|
2035
|
-
_("div",
|
|
2069
|
+
_("div", gn, [_("input", {
|
|
2036
2070
|
value: F(k).searchInput.value,
|
|
2037
2071
|
type: "search",
|
|
2038
|
-
disabled:
|
|
2072
|
+
disabled: ae.value,
|
|
2039
2073
|
"aria-label": c.value.mediaLibrary.searchAriaLabel,
|
|
2040
2074
|
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",
|
|
2041
2075
|
style: {
|
|
@@ -2045,7 +2079,7 @@ var cn = { class: "tpl:relative tpl:flex tpl:min-h-0 tpl:flex-1 tpl:flex-col tpl
|
|
|
2045
2079
|
},
|
|
2046
2080
|
placeholder: c.value.mediaLibrary.searchPlaceholder,
|
|
2047
2081
|
onInput: n[0] ||= (e) => F(k).handleSearchInput(e.target.value)
|
|
2048
|
-
}, null, 40,
|
|
2082
|
+
}, null, 40, _n), y(F(oe), {
|
|
2049
2083
|
class: "tpl:absolute tpl:top-1/2 tpl:left-2.5 tpl:-translate-y-1/2",
|
|
2050
2084
|
size: 13,
|
|
2051
2085
|
"stroke-width": 2,
|
|
@@ -2058,12 +2092,12 @@ var cn = { class: "tpl:relative tpl:flex tpl:min-h-0 tpl:flex-1 tpl:flex-col tpl
|
|
|
2058
2092
|
class: "tpl:flex tpl:size-7 tpl:items-center tpl:justify-center tpl:rounded-md tpl:transition-all tpl:duration-150",
|
|
2059
2093
|
style: { color: "var(--tpl-text-muted)" },
|
|
2060
2094
|
onClick: n[1] ||= (e) => a("close")
|
|
2061
|
-
}, [y(F(
|
|
2095
|
+
}, [y(F(ce), {
|
|
2062
2096
|
size: 18,
|
|
2063
2097
|
"stroke-width": 2
|
|
2064
|
-
})], 8,
|
|
2098
|
+
})], 8, vn)) : h("", !0)
|
|
2065
2099
|
])]),
|
|
2066
|
-
_("div",
|
|
2100
|
+
_("div", yn, [y(d, {
|
|
2067
2101
|
"enter-active-class": "tpl:transition-all tpl:duration-200 tpl:ease-out",
|
|
2068
2102
|
"enter-from-class": "tpl:-ml-48 tpl:opacity-0",
|
|
2069
2103
|
"enter-to-class": "tpl:ml-0 tpl:opacity-100",
|
|
@@ -2071,12 +2105,12 @@ var cn = { class: "tpl:relative tpl:flex tpl:min-h-0 tpl:flex-1 tpl:flex-col tpl
|
|
|
2071
2105
|
"leave-from-class": "tpl:ml-0 tpl:opacity-100",
|
|
2072
2106
|
"leave-to-class": "tpl:-ml-48 tpl:opacity-0"
|
|
2073
2107
|
}, {
|
|
2074
|
-
default: R(() => [N.value && F(k).showSidebar.value ? (D(), g("div",
|
|
2108
|
+
default: R(() => [N.value && F(k).showSidebar.value ? (D(), g("div", bn, [y(Ne, {
|
|
2075
2109
|
folders: F(k).folderTree.value,
|
|
2076
2110
|
"current-folder-id": F(C).currentFolderId.value,
|
|
2077
2111
|
"view-mode": F(C).viewMode.value,
|
|
2078
|
-
"has-frequently-used":
|
|
2079
|
-
"can-create-folder":
|
|
2112
|
+
"has-frequently-used": U.value && F(k).hasFrequentlyUsed.value,
|
|
2113
|
+
"can-create-folder": G.value,
|
|
2080
2114
|
"can-rename-folder": K.value,
|
|
2081
2115
|
"can-delete-folder": q.value,
|
|
2082
2116
|
onNavigate: F(C).navigateToFolder,
|
|
@@ -2099,7 +2133,7 @@ var cn = { class: "tpl:relative tpl:flex tpl:min-h-0 tpl:flex-1 tpl:flex-col tpl
|
|
|
2099
2133
|
"onShowFrequentlyUsed"
|
|
2100
2134
|
])])) : h("", !0)]),
|
|
2101
2135
|
_: 1
|
|
2102
|
-
}), _("div",
|
|
2136
|
+
}), _("div", xn, [_("div", Sn, [_("div", Cn, [
|
|
2103
2137
|
N.value ? (D(), g("button", {
|
|
2104
2138
|
key: 0,
|
|
2105
2139
|
type: "button",
|
|
@@ -2117,8 +2151,8 @@ var cn = { class: "tpl:relative tpl:flex tpl:min-h-0 tpl:flex-1 tpl:flex-col tpl
|
|
|
2117
2151
|
}, [y(F(ie), {
|
|
2118
2152
|
size: 16,
|
|
2119
2153
|
"stroke-width": 2
|
|
2120
|
-
})], 12,
|
|
2121
|
-
F(C).viewMode.value === "frequently-used" ? (D(), g("span",
|
|
2154
|
+
})], 12, wn)) : h("", !0),
|
|
2155
|
+
F(C).viewMode.value === "frequently-used" ? (D(), g("span", Tn, M(c.value.mediaLibrary.frequentlyUsed), 1)) : (D(), m(ye, {
|
|
2122
2156
|
key: 2,
|
|
2123
2157
|
folders: F(k).folderTree.value,
|
|
2124
2158
|
"current-folder-id": F(C).currentFolderId.value,
|
|
@@ -2128,7 +2162,7 @@ var cn = { class: "tpl:relative tpl:flex tpl:min-h-0 tpl:flex-1 tpl:flex-col tpl
|
|
|
2128
2162
|
"current-folder-id",
|
|
2129
2163
|
"onNavigate"
|
|
2130
2164
|
])),
|
|
2131
|
-
_("div",
|
|
2165
|
+
_("div", En, [_("button", {
|
|
2132
2166
|
type: "button",
|
|
2133
2167
|
class: "tpl:flex tpl:size-6 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded tpl:transition-all tpl:duration-150",
|
|
2134
2168
|
style: T({
|
|
@@ -2139,10 +2173,10 @@ var cn = { class: "tpl:relative tpl:flex tpl:min-h-0 tpl:flex-1 tpl:flex-col tpl
|
|
|
2139
2173
|
"aria-label": c.value.mediaLibrary.viewGrid,
|
|
2140
2174
|
"aria-pressed": F(k).layoutMode.value === "grid",
|
|
2141
2175
|
onClick: n[3] ||= (e) => F(k).layoutMode.value = "grid"
|
|
2142
|
-
}, [y(F(
|
|
2176
|
+
}, [y(F(te), {
|
|
2143
2177
|
size: 14,
|
|
2144
2178
|
"stroke-width": 2
|
|
2145
|
-
})], 12,
|
|
2179
|
+
})], 12, Dn), _("button", {
|
|
2146
2180
|
type: "button",
|
|
2147
2181
|
class: "tpl:flex tpl:size-6 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded tpl:transition-all tpl:duration-150",
|
|
2148
2182
|
style: T({
|
|
@@ -2156,8 +2190,8 @@ var cn = { class: "tpl:relative tpl:flex tpl:min-h-0 tpl:flex-1 tpl:flex-col tpl
|
|
|
2156
2190
|
}, [y(F(re), {
|
|
2157
2191
|
size: 14,
|
|
2158
2192
|
"stroke-width": 2
|
|
2159
|
-
})], 12,
|
|
2160
|
-
]), _("div",
|
|
2193
|
+
})], 12, On)])
|
|
2194
|
+
]), _("div", kn, [F(S).length > 1 ? (D(), g("select", {
|
|
2161
2195
|
key: 0,
|
|
2162
2196
|
"aria-label": c.value.mediaLibrary.filterAriaLabel,
|
|
2163
2197
|
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",
|
|
@@ -2167,11 +2201,11 @@ var cn = { class: "tpl:relative tpl:flex tpl:min-h-0 tpl:flex-1 tpl:flex-col tpl
|
|
|
2167
2201
|
color: "var(--tpl-text)"
|
|
2168
2202
|
},
|
|
2169
2203
|
value: F(C).categoryFilter.value ?? "",
|
|
2170
|
-
onChange:
|
|
2171
|
-
}, [_("option",
|
|
2204
|
+
onChange: le
|
|
2205
|
+
}, [_("option", jn, M(c.value.mediaLibrary.filterAll), 1), (D(!0), g(l, null, A(F(S), (e) => (D(), g("option", {
|
|
2172
2206
|
key: e,
|
|
2173
2207
|
value: e
|
|
2174
|
-
}, M(F(k).getCategoryLabel(e)), 9,
|
|
2208
|
+
}, M(F(k).getCategoryLabel(e)), 9, Mn))), 128))], 40, An)) : h("", !0)])]), _("div", Nn, [F(C).viewMode.value === "files" && (j.value || P.value) ? (D(), g("div", Pn, [j.value ? (D(), m(nn, {
|
|
2175
2209
|
key: 0,
|
|
2176
2210
|
"is-uploading": F(C).isUploading.value,
|
|
2177
2211
|
"upload-progress": F(C).uploadProgress.value,
|
|
@@ -2193,7 +2227,7 @@ var cn = { class: "tpl:relative tpl:flex tpl:min-h-0 tpl:flex-1 tpl:flex-col tpl
|
|
|
2193
2227
|
}, [y(F(ne), {
|
|
2194
2228
|
size: 14,
|
|
2195
2229
|
"stroke-width": 2
|
|
2196
|
-
}), v(" " + M(c.value.mediaLibrary.importFromUrl), 1)])) : h("", !0)])) : h("", !0), y(
|
|
2230
|
+
}), v(" " + M(c.value.mediaLibrary.importFromUrl), 1)])) : h("", !0)])) : h("", !0), y(dt, {
|
|
2197
2231
|
items: F(k).displayItems.value,
|
|
2198
2232
|
"selected-ids": F(C).selectedItems.value,
|
|
2199
2233
|
"is-loading": F(C).isLoading.value,
|
|
@@ -2208,7 +2242,7 @@ var cn = { class: "tpl:relative tpl:flex tpl:min-h-0 tpl:flex-1 tpl:flex-col tpl
|
|
|
2208
2242
|
onLoadMore: F(C).loadMore,
|
|
2209
2243
|
onEdit: F(k).handleEditItem,
|
|
2210
2244
|
onReplace: F(k).handleReplaceItem,
|
|
2211
|
-
onConfirm:
|
|
2245
|
+
onConfirm: Z
|
|
2212
2246
|
}, null, 8, [
|
|
2213
2247
|
"items",
|
|
2214
2248
|
"selected-ids",
|
|
@@ -2225,7 +2259,7 @@ var cn = { class: "tpl:relative tpl:flex tpl:min-h-0 tpl:flex-1 tpl:flex-col tpl
|
|
|
2225
2259
|
"onEdit",
|
|
2226
2260
|
"onReplace"
|
|
2227
2261
|
])])])]),
|
|
2228
|
-
y(
|
|
2262
|
+
y(St, {
|
|
2229
2263
|
visible: F(k).showImportUrlModal.value,
|
|
2230
2264
|
"is-importing": F(C).isImportingFromUrl.value,
|
|
2231
2265
|
error: F(C).importFromUrlError.value,
|
|
@@ -2241,10 +2275,15 @@ var cn = { class: "tpl:relative tpl:flex tpl:min-h-0 tpl:flex-1 tpl:flex-col tpl
|
|
|
2241
2275
|
key: 0,
|
|
2242
2276
|
visible: !0,
|
|
2243
2277
|
item: F(k).editingItem.value,
|
|
2244
|
-
|
|
2278
|
+
save: F(k).handleEditSave,
|
|
2279
|
+
"can-crop": B.value && F(k).editingItem.value.canUpdate !== !1,
|
|
2245
2280
|
onClose: n[7] ||= (e) => F(k).editingItem.value = null
|
|
2246
|
-
}, null, 8, [
|
|
2247
|
-
|
|
2281
|
+
}, null, 8, [
|
|
2282
|
+
"item",
|
|
2283
|
+
"save",
|
|
2284
|
+
"can-crop"
|
|
2285
|
+
])) : h("", !0),
|
|
2286
|
+
y(Jt, {
|
|
2248
2287
|
visible: F(C).showReplaceWarning.value,
|
|
2249
2288
|
item: F(C).pendingReplaceItem.value,
|
|
2250
2289
|
"usage-info": F(C).replaceUsageInfo.value,
|
|
@@ -2281,19 +2320,19 @@ var cn = { class: "tpl:relative tpl:flex tpl:min-h-0 tpl:flex-1 tpl:flex-col tpl
|
|
|
2281
2320
|
"-webkit-backdrop-filter": "blur(8px)"
|
|
2282
2321
|
},
|
|
2283
2322
|
onClick: n[10] ||= V((...e) => F(C).cancelDelete && F(C).cancelDelete(...e), ["self"])
|
|
2284
|
-
}, [_("div",
|
|
2285
|
-
_("h3",
|
|
2323
|
+
}, [_("div", Fn, [
|
|
2324
|
+
_("h3", In, M(c.value.mediaLibrary.deleteWarningTitle), 1),
|
|
2286
2325
|
_("p", {
|
|
2287
2326
|
class: w(["tpl:text-xs", F(k).hasUsedFiles.value ? "tpl:mb-2" : "tpl:mb-4"]),
|
|
2288
2327
|
style: { color: "var(--tpl-text-muted)" }
|
|
2289
2328
|
}, M(c.value.mediaLibrary.deleteWarningMessage), 3),
|
|
2290
|
-
F(k).hasUsedFiles.value ? (D(), g("p",
|
|
2291
|
-
F(k).hasUsedFiles.value ? (D(), g("div",
|
|
2329
|
+
F(k).hasUsedFiles.value ? (D(), g("p", Ln, M(c.value.mediaLibrary.deleteWarningUsageNote), 1)) : h("", !0),
|
|
2330
|
+
F(k).hasUsedFiles.value ? (D(), g("div", Rn, [(D(!0), g(l, null, A(F(C).deleteUsageInfo.value, (e, t) => (D(), g("div", {
|
|
2292
2331
|
key: t,
|
|
2293
2332
|
class: "tpl:text-xs",
|
|
2294
2333
|
style: { color: "var(--tpl-text)" }
|
|
2295
|
-
}, [e.templateCount > 0 ? (D(), g(l, { key: 0 }, [_("span",
|
|
2296
|
-
_("div",
|
|
2334
|
+
}, [e.templateCount > 0 ? (D(), g(l, { key: 0 }, [_("span", zn, M(F(k).displayItems.value.find((e) => e.id === t)?.filename || t), 1), _("span", Bn, " - " + M(c.value.mediaLibrary.usedInTemplates.replace("{count}", e.templateCount.toString())), 1)], 64)) : h("", !0)]))), 128))])) : h("", !0),
|
|
2335
|
+
_("div", Vn, [_("button", {
|
|
2297
2336
|
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",
|
|
2298
2337
|
style: {
|
|
2299
2338
|
"border-color": "var(--tpl-border)",
|
|
@@ -2313,11 +2352,11 @@ var cn = { class: "tpl:relative tpl:flex tpl:min-h-0 tpl:flex-1 tpl:flex-col tpl
|
|
|
2313
2352
|
])])) : h("", !0)]),
|
|
2314
2353
|
_: 1
|
|
2315
2354
|
}),
|
|
2316
|
-
_("div",
|
|
2355
|
+
_("div", Hn, [_("div", Un, [F(C).previewItem.value ? (D(), m(Pt, {
|
|
2317
2356
|
key: 0,
|
|
2318
2357
|
item: F(C).previewItem.value,
|
|
2319
2358
|
folders: F(k).folderTree.value
|
|
2320
|
-
}, null, 8, ["item", "folders"])) : h("", !0)]), _("div",
|
|
2359
|
+
}, null, 8, ["item", "folders"])) : h("", !0)]), _("div", Wn, [F(C).selectedItems.value.size > 0 ? (D(), g("div", Gn, [F(C).previewItem.value ? (D(), g("button", {
|
|
2321
2360
|
key: 0,
|
|
2322
2361
|
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",
|
|
2323
2362
|
style: T({
|
|
@@ -2330,11 +2369,11 @@ var cn = { class: "tpl:relative tpl:flex tpl:min-h-0 tpl:flex-1 tpl:flex-col tpl
|
|
|
2330
2369
|
key: 1,
|
|
2331
2370
|
size: 12,
|
|
2332
2371
|
"stroke-width": 2
|
|
2333
|
-
})) : (D(), m(F(
|
|
2372
|
+
})) : (D(), m(F(ee), {
|
|
2334
2373
|
key: 0,
|
|
2335
2374
|
size: 12,
|
|
2336
2375
|
"stroke-width": 2
|
|
2337
|
-
})), v(" " + M(F(k).copied.value ? c.value.mediaLibrary.copied : c.value.mediaLibrary.copyUrl), 1)], 4)) : h("", !0),
|
|
2376
|
+
})), v(" " + M(F(k).copied.value ? c.value.mediaLibrary.copied : c.value.mediaLibrary.copyUrl), 1)], 4)) : h("", !0), W.value ? (D(), g("div", Kn, [_("button", {
|
|
2338
2377
|
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",
|
|
2339
2378
|
style: {
|
|
2340
2379
|
"border-color": "var(--tpl-border)",
|
|
@@ -2342,7 +2381,7 @@ var cn = { class: "tpl:relative tpl:flex tpl:min-h-0 tpl:flex-1 tpl:flex-col tpl
|
|
|
2342
2381
|
"background-color": "var(--tpl-bg)"
|
|
2343
2382
|
},
|
|
2344
2383
|
onClick: n[12] ||= (e) => F(k).showMovePicker.value = !F(k).showMovePicker.value
|
|
2345
|
-
}, M(c.value.mediaLibrary.moveSelected), 1), F(k).showMovePicker.value ? (D(), m(
|
|
2384
|
+
}, M(c.value.mediaLibrary.moveSelected), 1), F(k).showMovePicker.value ? (D(), m(Dt, {
|
|
2346
2385
|
key: 0,
|
|
2347
2386
|
folders: F(k).folderTree.value,
|
|
2348
2387
|
"current-folder-id": F(C).currentFolderId.value,
|
|
@@ -2352,7 +2391,7 @@ var cn = { class: "tpl:relative tpl:flex tpl:min-h-0 tpl:flex-1 tpl:flex-col tpl
|
|
|
2352
2391
|
"folders",
|
|
2353
2392
|
"current-folder-id",
|
|
2354
2393
|
"onSelect"
|
|
2355
|
-
])) : h("", !0)])) : h("", !0)])) : h("", !0), _("div",
|
|
2394
|
+
])) : h("", !0)])) : h("", !0)])) : h("", !0), _("div", qn, [se.value > 0 ? (D(), g("button", {
|
|
2356
2395
|
key: 0,
|
|
2357
2396
|
"data-testid": "media-delete",
|
|
2358
2397
|
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",
|
|
@@ -2361,7 +2400,7 @@ var cn = { class: "tpl:relative tpl:flex tpl:min-h-0 tpl:flex-1 tpl:flex-col tpl
|
|
|
2361
2400
|
color: "var(--tpl-danger)",
|
|
2362
2401
|
"background-color": "var(--tpl-bg)"
|
|
2363
2402
|
},
|
|
2364
|
-
onClick:
|
|
2403
|
+
onClick: ue
|
|
2365
2404
|
}, M(c.value.mediaLibrary.deleteSelected), 1)) : h("", !0), t.showConfirm ? (D(), g("button", {
|
|
2366
2405
|
key: 1,
|
|
2367
2406
|
"data-testid": u.value,
|
|
@@ -2370,45 +2409,45 @@ var cn = { class: "tpl:relative tpl:flex tpl:min-h-0 tpl:flex-1 tpl:flex-col tpl
|
|
|
2370
2409
|
"background-color": "var(--tpl-primary)",
|
|
2371
2410
|
color: "var(--tpl-on-primary)"
|
|
2372
2411
|
},
|
|
2373
|
-
disabled: !
|
|
2374
|
-
onClick:
|
|
2375
|
-
}, M(t.accept?.length ? c.value.mediaLibrary.selectImage : c.value.mediaLibrary.selectFile), 9,
|
|
2412
|
+
disabled: !J.value,
|
|
2413
|
+
onClick: Z
|
|
2414
|
+
}, M(t.accept?.length ? c.value.mediaLibrary.selectImage : c.value.mediaLibrary.selectFile), 9, Jn)) : h("", !0)])])])
|
|
2376
2415
|
]));
|
|
2377
2416
|
}
|
|
2378
|
-
}),
|
|
2379
|
-
"./locales/ca.ts": () => import("./ca-
|
|
2380
|
-
"./locales/de.ts": () => import("./de-
|
|
2381
|
-
"./locales/en.ts": () => import("./en-
|
|
2382
|
-
"./locales/es.ts": () => import("./es-
|
|
2383
|
-
"./locales/fr.ts": () => import("./fr-
|
|
2384
|
-
"./locales/ja.ts": () => import("./ja-
|
|
2385
|
-
"./locales/nl.ts": () => import("./nl-
|
|
2386
|
-
"./locales/pt-BR.ts": () => import("./pt-BR-
|
|
2417
|
+
}), Xn = /* #__PURE__ */ Object.assign({
|
|
2418
|
+
"./locales/ca.ts": () => import("./ca-DyHL0z4N.js"),
|
|
2419
|
+
"./locales/de.ts": () => import("./de-Dcy8LcNQ.js"),
|
|
2420
|
+
"./locales/en.ts": () => import("./en-w2ihxIL6.js").then((e) => e.n),
|
|
2421
|
+
"./locales/es.ts": () => import("./es-B43D0gmB.js"),
|
|
2422
|
+
"./locales/fr.ts": () => import("./fr-DsxaRm09.js"),
|
|
2423
|
+
"./locales/ja.ts": () => import("./ja-DDI6z0aO.js"),
|
|
2424
|
+
"./locales/nl.ts": () => import("./nl-CHa6u0cR.js"),
|
|
2425
|
+
"./locales/pt-BR.ts": () => import("./pt-BR-CZmeAVC3.js")
|
|
2387
2426
|
});
|
|
2388
|
-
function
|
|
2427
|
+
function Zn(e) {
|
|
2389
2428
|
return Object.keys(e).map((e) => e.match(/\/([^/]+)\.ts$/)?.[1]).filter((e) => !!e);
|
|
2390
2429
|
}
|
|
2391
|
-
var
|
|
2392
|
-
function
|
|
2430
|
+
var Qn = Zn(Xn);
|
|
2431
|
+
function $n(e) {
|
|
2393
2432
|
return e.trim().replace(/_/g, "-").toLowerCase();
|
|
2394
2433
|
}
|
|
2395
|
-
function
|
|
2396
|
-
let t =
|
|
2397
|
-
return
|
|
2434
|
+
function er(e) {
|
|
2435
|
+
let t = $n(e);
|
|
2436
|
+
return Qn.find((e) => $n(e) === t);
|
|
2398
2437
|
}
|
|
2399
|
-
function
|
|
2400
|
-
return
|
|
2438
|
+
function tr(e) {
|
|
2439
|
+
return $n(e).split("-")[0];
|
|
2401
2440
|
}
|
|
2402
|
-
function
|
|
2403
|
-
return
|
|
2441
|
+
function nr(e) {
|
|
2442
|
+
return er(e) ?? er(tr(e)) ?? "en";
|
|
2404
2443
|
}
|
|
2405
|
-
async function
|
|
2406
|
-
let t =
|
|
2444
|
+
async function rr(e) {
|
|
2445
|
+
let t = Xn[`./locales/${nr(e)}.ts`];
|
|
2407
2446
|
return (await t()).default;
|
|
2408
2447
|
}
|
|
2409
2448
|
//#endregion
|
|
2410
2449
|
//#region src/components/MediaLibraryModal.vue?vue&type=script&setup=true&lang.ts
|
|
2411
|
-
var
|
|
2450
|
+
var ir = ["data-tpl-theme"], ar = /* @__PURE__ */ x({
|
|
2412
2451
|
__name: "MediaLibraryModal",
|
|
2413
2452
|
props: {
|
|
2414
2453
|
visible: { type: Boolean },
|
|
@@ -2424,7 +2463,7 @@ var er = ["data-tpl-theme"], tr = /* @__PURE__ */ x({
|
|
|
2424
2463
|
setup(e, { emit: n }) {
|
|
2425
2464
|
let i = e, o = n, l = k(null);
|
|
2426
2465
|
L(() => i.locale, async (e) => {
|
|
2427
|
-
l.value = await
|
|
2466
|
+
l.value = await rr(e ?? "en");
|
|
2428
2467
|
}, { immediate: !0 }), O(s, l);
|
|
2429
2468
|
let p = f(() => i.uiTheme);
|
|
2430
2469
|
O(r, p);
|
|
@@ -2441,7 +2480,7 @@ var er = ["data-tpl-theme"], tr = /* @__PURE__ */ x({
|
|
|
2441
2480
|
o("close");
|
|
2442
2481
|
}
|
|
2443
2482
|
}
|
|
2444
|
-
|
|
2483
|
+
fe(document, "keydown", C);
|
|
2445
2484
|
function T(e) {
|
|
2446
2485
|
o("select", e), o("close");
|
|
2447
2486
|
}
|
|
@@ -2481,7 +2520,7 @@ var er = ["data-tpl-theme"], tr = /* @__PURE__ */ x({
|
|
|
2481
2520
|
border: "1px solid var(--tpl-border)",
|
|
2482
2521
|
"box-shadow": "var(--tpl-shadow-xl)"
|
|
2483
2522
|
}
|
|
2484
|
-
}, [y(
|
|
2523
|
+
}, [y(Yn, {
|
|
2485
2524
|
ref_key: "chromeRef",
|
|
2486
2525
|
ref: x,
|
|
2487
2526
|
provider: e.provider,
|
|
@@ -2500,14 +2539,14 @@ var er = ["data-tpl-theme"], tr = /* @__PURE__ */ x({
|
|
|
2500
2539
|
"template-id",
|
|
2501
2540
|
"on-error",
|
|
2502
2541
|
"translations"
|
|
2503
|
-
])], 512)], 10,
|
|
2542
|
+
])], 512)], 10, ir)) : h("", !0)]),
|
|
2504
2543
|
_: 1
|
|
2505
2544
|
})], 8, ["to"]));
|
|
2506
2545
|
}
|
|
2507
2546
|
});
|
|
2508
2547
|
//#endregion
|
|
2509
2548
|
//#region src/composables/useMediaPicker.ts
|
|
2510
|
-
function
|
|
2549
|
+
function or() {
|
|
2511
2550
|
let e = C("onRequestMedia"), t = k(!1), n = f(() => !!e);
|
|
2512
2551
|
async function r(n) {
|
|
2513
2552
|
if (!e) return null;
|
|
@@ -2526,7 +2565,7 @@ function nr() {
|
|
|
2526
2565
|
}
|
|
2527
2566
|
//#endregion
|
|
2528
2567
|
//#region src/standalone/MediaLibrary.vue
|
|
2529
|
-
var
|
|
2568
|
+
var sr = /* @__PURE__ */ x({
|
|
2530
2569
|
__name: "MediaLibrary",
|
|
2531
2570
|
props: {
|
|
2532
2571
|
provider: {},
|
|
@@ -2554,7 +2593,7 @@ var rr = /* @__PURE__ */ x({
|
|
|
2554
2593
|
"background-color": "var(--tpl-bg-elevated)",
|
|
2555
2594
|
border: "1px solid var(--tpl-border)"
|
|
2556
2595
|
}
|
|
2557
|
-
}, [y(
|
|
2596
|
+
}, [y(Yn, {
|
|
2558
2597
|
provider: e.provider,
|
|
2559
2598
|
accept: e.accept,
|
|
2560
2599
|
translations: o.value,
|
|
@@ -2569,27 +2608,27 @@ var rr = /* @__PURE__ */ x({
|
|
|
2569
2608
|
"show-confirm"
|
|
2570
2609
|
])], 512));
|
|
2571
2610
|
}
|
|
2572
|
-
}), $ = null,
|
|
2573
|
-
async function
|
|
2611
|
+
}), $ = null, cr = k(null);
|
|
2612
|
+
async function lr(e) {
|
|
2574
2613
|
let t = typeof e.container == "string" ? document.querySelector(e.container) : e.container;
|
|
2575
2614
|
if (!t) throw Error(`Container element not found: ${e.container}`);
|
|
2576
|
-
let n = await
|
|
2577
|
-
return
|
|
2615
|
+
let n = await rr(e.locale ?? "en");
|
|
2616
|
+
return dr(t, e.theme), $ && ur(), new Promise((r, i) => {
|
|
2578
2617
|
try {
|
|
2579
2618
|
$ = p({ setup() {
|
|
2580
2619
|
let i = () => {
|
|
2581
2620
|
r({
|
|
2582
|
-
setTheme: (e) =>
|
|
2583
|
-
unmount:
|
|
2621
|
+
setTheme: (e) => dr(t, e),
|
|
2622
|
+
unmount: ur
|
|
2584
2623
|
});
|
|
2585
2624
|
};
|
|
2586
|
-
return () => S(
|
|
2625
|
+
return () => S(sr, {
|
|
2587
2626
|
provider: e.provider,
|
|
2588
2627
|
translations: n,
|
|
2589
2628
|
onSelect: e.onSelect,
|
|
2590
2629
|
accept: e.accept,
|
|
2591
2630
|
locale: e.locale,
|
|
2592
|
-
ref:
|
|
2631
|
+
ref: cr,
|
|
2593
2632
|
onReady: i
|
|
2594
2633
|
});
|
|
2595
2634
|
} }), $.mount(t);
|
|
@@ -2598,15 +2637,15 @@ async function ar(e) {
|
|
|
2598
2637
|
}
|
|
2599
2638
|
});
|
|
2600
2639
|
}
|
|
2601
|
-
function
|
|
2602
|
-
$ && ($.unmount(), $ = null,
|
|
2640
|
+
function ur() {
|
|
2641
|
+
$ && ($.unmount(), $ = null, cr.value = null);
|
|
2603
2642
|
}
|
|
2604
|
-
function
|
|
2643
|
+
function dr(e, t) {
|
|
2605
2644
|
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`)));
|
|
2606
2645
|
}
|
|
2607
2646
|
typeof window < "u" && (window.TemplaticalMedia = {
|
|
2608
|
-
init:
|
|
2609
|
-
unmount:
|
|
2647
|
+
init: lr,
|
|
2648
|
+
unmount: ur
|
|
2610
2649
|
});
|
|
2611
2650
|
//#endregion
|
|
2612
|
-
export {
|
|
2651
|
+
export { ar as MediaLibraryModal, lr as init, ur as unmount, n as useI18n, o as useMediaCategories, he as useMediaLibrary, or as useMediaPicker };
|