@templatical/media-library 0.26.3 → 0.27.0
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/cdn/media-library.js +894 -888
- package/dist/cdn/media-library.js.map +1 -1
- package/dist/index.d.ts +18 -0
- package/dist/templatical-media-library.js +660 -667
- package/package.json +3 -3
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { API_ROUTES as e, ApiClient as t, buildUrl as n, createSdkAuthManager as r } from "@templatical/core/cloud";
|
|
2
2
|
import { Fragment as i, Teleport as a, Transition as o, computed as s, createApp as c, createBlock as l, createCommentVNode as u, createElementBlock as d, createElementVNode as f, createTextVNode as p, createVNode as m, defineComponent as h, h as g, inject as _, isRef as v, normalizeClass as y, normalizeStyle as b, onMounted as x, openBlock as S, provide as C, ref as w, renderList as T, resolveComponent as E, toDisplayString as D, toRef as O, unref as k, vModelText as A, watch as j, withCtx as M, withDirectives as N, withKeys as P, withModifiers as F } from "vue";
|
|
3
|
-
import { Check as I, ChevronRight as L, Copy as R, File as z, Folder as B, Grid2x2 as V, Link as H, List as U, LoaderCircle as W, PanelLeft as G, Pencil as K, Plus as q, RefreshCw as
|
|
4
|
-
import { Cropper as
|
|
5
|
-
import { onClickOutside as
|
|
3
|
+
import { Check as I, ChevronRight as L, Copy as R, File as z, Folder as B, Grid2x2 as V, Link as H, List as U, LoaderCircle as W, PanelLeft as G, Pencil as K, Plus as q, RefreshCw as ee, Search as J, Star as te, Trash2 as Y, Upload as ne, X as re } from "@lucide/vue";
|
|
4
|
+
import { Cropper as ie } from "vue-advanced-cropper";
|
|
5
|
+
import { onClickOutside as ae, useClipboard as oe, useDebounceFn as se, useDropZone as ce, useEventListener as le, useFileDialog as ue, useIntersectionObserver as de } from "@vueuse/core";
|
|
6
6
|
//#region src/api-client.ts
|
|
7
|
-
var
|
|
7
|
+
var fe = class {
|
|
8
8
|
authManager;
|
|
9
9
|
constructor(e) {
|
|
10
10
|
this.authManager = e;
|
|
@@ -161,9 +161,9 @@ var de = class {
|
|
|
161
161
|
};
|
|
162
162
|
//#endregion
|
|
163
163
|
//#region src/composable.ts
|
|
164
|
-
function
|
|
164
|
+
function pe(e) {
|
|
165
165
|
if (!e.projectId) throw Error("projectId is required for useMediaLibrary");
|
|
166
|
-
let t = new
|
|
166
|
+
let t = new fe(e.authManager), n = w([]), r = w([]), i = w(null), a = w("files"), o = w(""), s = w(null), c = w("newest"), l = w(!1), u = w(!1), d = w(!1), f = w(null), p = w(null), m = w(/* @__PURE__ */ new Set()), h = w(null), g = w([]), _ = w({}), v = w(!1), y = w([]), b = w(!1), x = w(null), S = w(!1), C = w(null), T = w(!1), E = w(null), D = w(null), O = 0;
|
|
167
167
|
async function k() {
|
|
168
168
|
let r = ++O;
|
|
169
169
|
l.value = !0;
|
|
@@ -326,50 +326,50 @@ function fe(e) {
|
|
|
326
326
|
function q() {
|
|
327
327
|
m.value = /* @__PURE__ */ new Set(), h.value = null;
|
|
328
328
|
}
|
|
329
|
-
function
|
|
329
|
+
function ee(e) {
|
|
330
330
|
h.value = e, m.value = /* @__PURE__ */ new Set([e.id]);
|
|
331
331
|
}
|
|
332
|
-
async function
|
|
332
|
+
async function J() {
|
|
333
333
|
try {
|
|
334
334
|
r.value = await t.getMediaFolders();
|
|
335
335
|
} catch (t) {
|
|
336
336
|
e.onError?.(t);
|
|
337
337
|
}
|
|
338
338
|
}
|
|
339
|
-
async function
|
|
339
|
+
async function te(n, r) {
|
|
340
340
|
try {
|
|
341
341
|
let e = await t.createMediaFolder(n, r);
|
|
342
|
-
return await
|
|
342
|
+
return await J(), e;
|
|
343
343
|
} catch (t) {
|
|
344
344
|
return e.onError?.(t), null;
|
|
345
345
|
}
|
|
346
346
|
}
|
|
347
|
-
function
|
|
347
|
+
function Y(e, t) {
|
|
348
348
|
for (let n of e) {
|
|
349
349
|
if (n.id === t) return n;
|
|
350
350
|
if (n.children) {
|
|
351
|
-
let e =
|
|
351
|
+
let e = Y(n.children, t);
|
|
352
352
|
if (e) return e;
|
|
353
353
|
}
|
|
354
354
|
}
|
|
355
355
|
return null;
|
|
356
356
|
}
|
|
357
|
-
async function
|
|
357
|
+
async function ne(n, r) {
|
|
358
358
|
try {
|
|
359
|
-
await t.renameMediaFolder(n, r), await
|
|
359
|
+
await t.renameMediaFolder(n, r), await J();
|
|
360
360
|
} catch (t) {
|
|
361
361
|
e.onError?.(t);
|
|
362
362
|
}
|
|
363
363
|
}
|
|
364
|
-
async function
|
|
364
|
+
async function re(n) {
|
|
365
365
|
try {
|
|
366
|
-
let e =
|
|
367
|
-
await t.deleteMediaFolder(n), i.value === n && (i.value = e), await
|
|
366
|
+
let e = Y(r.value, n)?.parent_id ?? null;
|
|
367
|
+
await t.deleteMediaFolder(n), i.value === n && (i.value = e), await J(), await k();
|
|
368
368
|
} catch (t) {
|
|
369
369
|
e.onError?.(t);
|
|
370
370
|
}
|
|
371
371
|
}
|
|
372
|
-
async function
|
|
372
|
+
async function ie(n) {
|
|
373
373
|
E.value = n, C.value = null;
|
|
374
374
|
try {
|
|
375
375
|
let e = await t.checkMediaUsage([n.id]);
|
|
@@ -378,10 +378,10 @@ function fe(e) {
|
|
|
378
378
|
e.onError?.(t);
|
|
379
379
|
}
|
|
380
380
|
}
|
|
381
|
-
function
|
|
381
|
+
function ae() {
|
|
382
382
|
T.value = !1, E.value = null, D.value = null, C.value = null;
|
|
383
383
|
}
|
|
384
|
-
async function
|
|
384
|
+
async function oe(r) {
|
|
385
385
|
if (!E.value) return null;
|
|
386
386
|
S.value = !0, C.value = null;
|
|
387
387
|
try {
|
|
@@ -393,7 +393,7 @@ function fe(e) {
|
|
|
393
393
|
S.value = !1;
|
|
394
394
|
}
|
|
395
395
|
}
|
|
396
|
-
async function
|
|
396
|
+
async function se(r, i) {
|
|
397
397
|
try {
|
|
398
398
|
let e = await t.replaceMedia(r, i);
|
|
399
399
|
return 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), e;
|
|
@@ -435,12 +435,12 @@ function fe(e) {
|
|
|
435
435
|
importFromUrl: G,
|
|
436
436
|
toggleSelection: K,
|
|
437
437
|
clearSelection: q,
|
|
438
|
-
selectItem:
|
|
439
|
-
loadFolders:
|
|
440
|
-
createFolder:
|
|
441
|
-
renameFolder:
|
|
442
|
-
deleteFolder:
|
|
443
|
-
findFolderInTree:
|
|
438
|
+
selectItem: ee,
|
|
439
|
+
loadFolders: J,
|
|
440
|
+
createFolder: te,
|
|
441
|
+
renameFolder: ne,
|
|
442
|
+
deleteFolder: re,
|
|
443
|
+
findFolderInTree: Y,
|
|
444
444
|
loadFrequentlyUsed: V,
|
|
445
445
|
checkUsageBeforeDelete: H,
|
|
446
446
|
confirmDelete: U,
|
|
@@ -450,15 +450,15 @@ function fe(e) {
|
|
|
450
450
|
showReplaceWarning: T,
|
|
451
451
|
pendingReplaceItem: E,
|
|
452
452
|
replaceUsageInfo: D,
|
|
453
|
-
checkUsageBeforeReplace:
|
|
454
|
-
cancelReplace:
|
|
455
|
-
replaceFile:
|
|
456
|
-
replaceMediaDirectly:
|
|
453
|
+
checkUsageBeforeReplace: ie,
|
|
454
|
+
cancelReplace: ae,
|
|
455
|
+
replaceFile: oe,
|
|
456
|
+
replaceMediaDirectly: se
|
|
457
457
|
};
|
|
458
458
|
}
|
|
459
459
|
//#endregion
|
|
460
460
|
//#region src/composables/useI18n.ts
|
|
461
|
-
function
|
|
461
|
+
function X(e) {
|
|
462
462
|
let t = e ?? _("translations"), n = v(t) ? t.value : t;
|
|
463
463
|
function r(e, t) {
|
|
464
464
|
return e.replace(/\{(\w+)\}/g, (e, n) => n in t ? String(t[n]) : `{${n}}`);
|
|
@@ -470,14 +470,14 @@ function Z(e) {
|
|
|
470
470
|
}
|
|
471
471
|
//#endregion
|
|
472
472
|
//#region src/components/media/MediaBreadcrumb.vue?vue&type=script&setup=true&lang.ts
|
|
473
|
-
var
|
|
473
|
+
var me = {
|
|
474
474
|
key: 0,
|
|
475
475
|
class: "tpl:flex tpl:items-center tpl:gap-1 tpl:text-xs",
|
|
476
476
|
style: { color: "var(--tpl-text-muted)" }
|
|
477
|
-
},
|
|
477
|
+
}, he = ["onClick"], ge = {
|
|
478
478
|
key: 1,
|
|
479
479
|
style: { color: "var(--tpl-text)" }
|
|
480
|
-
},
|
|
480
|
+
}, _e = /* @__PURE__ */ h({
|
|
481
481
|
__name: "MediaBreadcrumb",
|
|
482
482
|
props: {
|
|
483
483
|
folders: {},
|
|
@@ -485,7 +485,7 @@ var pe = {
|
|
|
485
485
|
},
|
|
486
486
|
emits: ["navigate"],
|
|
487
487
|
setup(e, { emit: t }) {
|
|
488
|
-
let n = e, r = t, { t: a } =
|
|
488
|
+
let n = e, r = t, { t: a } = X(), o = s(() => {
|
|
489
489
|
if (!n.currentFolderId) return [];
|
|
490
490
|
let e = [];
|
|
491
491
|
return c(n.folders, n.currentFolderId, e), e;
|
|
@@ -497,7 +497,7 @@ var pe = {
|
|
|
497
497
|
}
|
|
498
498
|
return !1;
|
|
499
499
|
}
|
|
500
|
-
return (e, t) => o.value.length > 0 ? (S(), d("div",
|
|
500
|
+
return (e, t) => o.value.length > 0 ? (S(), d("div", me, [f("button", {
|
|
501
501
|
class: "tpl:transition-colors tpl:duration-150 tpl:hover:underline",
|
|
502
502
|
style: { color: "var(--tpl-primary)" },
|
|
503
503
|
onClick: t[0] ||= (e) => r("navigate", null)
|
|
@@ -509,13 +509,15 @@ var pe = {
|
|
|
509
509
|
class: "tpl:transition-colors tpl:duration-150 tpl:hover:underline",
|
|
510
510
|
style: { color: "var(--tpl-primary)" },
|
|
511
511
|
onClick: (t) => r("navigate", e.id)
|
|
512
|
-
}, D(e.name), 9,
|
|
512
|
+
}, D(e.name), 9, he)) : (S(), d("span", ge, D(e.name), 1))], 64))), 128))])) : u("", !0);
|
|
513
513
|
}
|
|
514
|
-
});
|
|
514
|
+
}), ve = Symbol("templaticalMediaPlanConfig"), ye = Symbol("templaticalMediaPopoverTarget");
|
|
515
515
|
//#endregion
|
|
516
516
|
//#region src/composables/useMediaCategories.ts
|
|
517
|
-
function
|
|
518
|
-
let e = _(
|
|
517
|
+
function Z() {
|
|
518
|
+
let e = _(ve, null);
|
|
519
|
+
if (!e) throw Error("[Templatical] useMediaCategories() needs a plan config in scope. Render it under <MediaLibraryModal> (pass its `planConfig` prop) or provide PLAN_CONFIG_KEY yourself.");
|
|
520
|
+
let t = s(() => e.config.value?.media ?? null), n = s(() => t.value?.use_media_library ?? !0), r = s(() => t.value?.categories ?? null), i = s(() => r.value ? Object.values(r.value).flatMap((e) => e.mime_types) : []), a = s(() => i.value.join(",")), o = s(() => t.value?.max_file_size ?? 0);
|
|
519
521
|
function c(e, t) {
|
|
520
522
|
return r.value ? !t || t.length === 0 ? i.value.includes(e) : t.some((t) => r.value[t]?.mime_types.includes(e)) : !1;
|
|
521
523
|
}
|
|
@@ -540,14 +542,14 @@ function Q() {
|
|
|
540
542
|
}
|
|
541
543
|
//#endregion
|
|
542
544
|
//#region src/composables/useImageCrop.ts
|
|
543
|
-
var
|
|
545
|
+
var be = {
|
|
544
546
|
free: void 0,
|
|
545
547
|
square: 1,
|
|
546
548
|
landscape43: 4 / 3,
|
|
547
549
|
landscape169: 16 / 9,
|
|
548
550
|
original: void 0
|
|
549
551
|
};
|
|
550
|
-
function
|
|
552
|
+
function xe(e) {
|
|
551
553
|
return e === "image/png" || e === "image/gif" ? {
|
|
552
554
|
mimeType: "image/png",
|
|
553
555
|
quality: 1
|
|
@@ -559,7 +561,7 @@ function ve(e) {
|
|
|
559
561
|
quality: .92
|
|
560
562
|
};
|
|
561
563
|
}
|
|
562
|
-
function
|
|
564
|
+
function Se(e, t, n) {
|
|
563
565
|
let r = e.width, i = e.height;
|
|
564
566
|
if (!t && !n) return e;
|
|
565
567
|
let a = r, o = i;
|
|
@@ -573,7 +575,7 @@ function ye(e, t, n) {
|
|
|
573
575
|
let c = s.getContext("2d");
|
|
574
576
|
return c && (c.imageSmoothingEnabled = !0, c.imageSmoothingQuality = "high", c.drawImage(e, 0, 0, a, o)), s;
|
|
575
577
|
}
|
|
576
|
-
function
|
|
578
|
+
function Ce(e, t, n) {
|
|
577
579
|
return new Promise((r, i) => {
|
|
578
580
|
e.toBlob((e) => {
|
|
579
581
|
if (!e) {
|
|
@@ -585,7 +587,7 @@ function be(e, t, n) {
|
|
|
585
587
|
}, n.mimeType, n.quality);
|
|
586
588
|
});
|
|
587
589
|
}
|
|
588
|
-
function
|
|
590
|
+
function we(e, t, n, r) {
|
|
589
591
|
let i = e, a = t;
|
|
590
592
|
if (n && i > n) {
|
|
591
593
|
let e = n / i;
|
|
@@ -601,58 +603,58 @@ function xe(e, t, n, r) {
|
|
|
601
603
|
};
|
|
602
604
|
}
|
|
603
605
|
//#endregion
|
|
604
|
-
//#region src/
|
|
605
|
-
var
|
|
606
|
+
//#region src/components/media/MediaEditModal.vue?vue&type=script&setup=true&lang.ts
|
|
607
|
+
var Te = ["data-tpl-theme"], Ee = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, De = {
|
|
606
608
|
class: "tpl:text-sm tpl:font-semibold",
|
|
607
609
|
style: { color: "var(--tpl-text)" }
|
|
608
|
-
},
|
|
610
|
+
}, Oe = { class: "tpl:min-h-0 tpl:flex-1 tpl:overflow-y-auto tpl:px-5" }, ke = {
|
|
609
611
|
key: 0,
|
|
610
612
|
class: "tpl:mb-4"
|
|
611
|
-
},
|
|
613
|
+
}, Ae = {
|
|
612
614
|
class: "tpl:relative tpl:mb-3 tpl:overflow-hidden tpl:rounded-md tpl:border",
|
|
613
615
|
style: {
|
|
614
616
|
"border-color": "var(--tpl-border)",
|
|
615
617
|
height: "300px",
|
|
616
618
|
"background-color": "var(--tpl-bg)"
|
|
617
619
|
}
|
|
618
|
-
},
|
|
620
|
+
}, je = { class: "tpl:space-y-3" }, Me = {
|
|
619
621
|
class: "tpl:mb-1.5 tpl:block tpl:text-xs tpl:font-medium",
|
|
620
622
|
style: { color: "var(--tpl-text-muted)" }
|
|
621
|
-
},
|
|
623
|
+
}, Ne = { class: "tpl:flex tpl:flex-wrap tpl:gap-1.5" }, Pe = ["onClick"], Fe = { class: "tpl:flex tpl:gap-3" }, Ie = { class: "tpl:flex-1" }, Le = {
|
|
622
624
|
class: "tpl:mb-1 tpl:block tpl:text-xs tpl:font-medium",
|
|
623
625
|
style: { color: "var(--tpl-text-muted)" }
|
|
624
|
-
},
|
|
626
|
+
}, Re = {
|
|
625
627
|
class: "tpl:font-normal",
|
|
626
628
|
style: { color: "var(--tpl-text-dim)" }
|
|
627
|
-
},
|
|
629
|
+
}, ze = { class: "tpl:relative" }, Be = ["value", "placeholder"], Ve = {
|
|
628
630
|
class: "tpl:absolute tpl:top-1/2 tpl:right-2.5 tpl:-translate-y-1/2 tpl:text-xs",
|
|
629
631
|
style: { color: "var(--tpl-text-dim)" }
|
|
630
|
-
},
|
|
632
|
+
}, He = { class: "tpl:flex-1" }, Ue = {
|
|
631
633
|
class: "tpl:mb-1 tpl:block tpl:text-xs tpl:font-medium",
|
|
632
634
|
style: { color: "var(--tpl-text-muted)" }
|
|
633
|
-
},
|
|
635
|
+
}, We = {
|
|
634
636
|
class: "tpl:font-normal",
|
|
635
637
|
style: { color: "var(--tpl-text-dim)" }
|
|
636
|
-
},
|
|
638
|
+
}, Ge = { class: "tpl:relative" }, Ke = ["value", "placeholder"], qe = {
|
|
637
639
|
class: "tpl:absolute tpl:top-1/2 tpl:right-2.5 tpl:-translate-y-1/2 tpl:text-xs",
|
|
638
640
|
style: { color: "var(--tpl-text-dim)" }
|
|
639
|
-
},
|
|
641
|
+
}, Je = {
|
|
640
642
|
key: 0,
|
|
641
643
|
class: "tpl:flex tpl:items-center tpl:gap-1 tpl:text-xs",
|
|
642
644
|
style: { color: "var(--tpl-text-muted)" }
|
|
643
|
-
},
|
|
645
|
+
}, Ye = {
|
|
644
646
|
class: "tpl:font-medium",
|
|
645
647
|
style: { color: "var(--tpl-text)" }
|
|
646
|
-
},
|
|
648
|
+
}, Xe = { class: "tpl:mb-3" }, Ze = {
|
|
647
649
|
class: "tpl:mb-1 tpl:block tpl:text-xs tpl:font-medium",
|
|
648
650
|
style: { color: "var(--tpl-text-muted)" }
|
|
649
|
-
},
|
|
651
|
+
}, Qe = ["autofocus"], $e = {
|
|
650
652
|
key: 1,
|
|
651
653
|
class: "tpl:mb-4"
|
|
652
|
-
},
|
|
654
|
+
}, et = {
|
|
653
655
|
class: "tpl:mb-1 tpl:block tpl:text-xs tpl:font-medium",
|
|
654
656
|
style: { color: "var(--tpl-text-muted)" }
|
|
655
|
-
},
|
|
657
|
+
}, tt = ["placeholder"], nt = { class: "tpl:flex tpl:shrink-0 tpl:justify-end tpl:gap-2 tpl:p-5 tpl:pt-4" }, rt = ["disabled"], it = /*@__PURE__*/ h({
|
|
656
658
|
__name: "MediaEditModal",
|
|
657
659
|
props: {
|
|
658
660
|
visible: { type: Boolean },
|
|
@@ -660,33 +662,33 @@ var Se = Symbol("templaticalMediaPopoverTarget"), Ce = ["data-tpl-theme"], we =
|
|
|
660
662
|
},
|
|
661
663
|
emits: ["save", "close"],
|
|
662
664
|
setup(e, { emit: t }) {
|
|
663
|
-
let n = e, r = t, { t: c } =
|
|
665
|
+
let n = e, r = t, { t: c } = X(), h = _("tplUiTheme"), g = _(ye, w(null)), v = c.mediaLibrary, { isImageMimeType: x } = Z(), C = w(""), E = w(""), O = w(null), P = w("free"), I = w(void 0), L = w(void 0), R = w(""), z = w(""), B = w(void 0), V = w(null), H = w(!1), U = w(!1), W = w(!1), G = s(() => n.item ? [
|
|
664
666
|
"image/jpeg",
|
|
665
667
|
"image/png",
|
|
666
668
|
"image/webp",
|
|
667
669
|
"image/gif"
|
|
668
|
-
].includes(n.item.mime_type) : !1), K = s(() => P.value === "original" ? B.value :
|
|
670
|
+
].includes(n.item.mime_type) : !1), K = s(() => P.value === "original" ? B.value : be[P.value]), q = s(() => V.value ? we(V.value.width, V.value.height, I.value, L.value) : null);
|
|
669
671
|
j(() => n.visible, (e) => {
|
|
670
672
|
e && n.item && (C.value = n.item.filename, E.value = n.item.alt_text || "", P.value = "free", I.value = void 0, L.value = void 0, R.value = "", z.value = "", B.value = void 0, V.value = null, H.value = !1, W.value = !1, n.item.width && n.item.height && (B.value = n.item.width / n.item.height));
|
|
671
673
|
});
|
|
672
|
-
function
|
|
674
|
+
function ee(e) {
|
|
673
675
|
e.coordinates && (V.value = {
|
|
674
676
|
width: Math.round(e.coordinates.width),
|
|
675
677
|
height: Math.round(e.coordinates.height)
|
|
676
678
|
}, W.value = !0);
|
|
677
679
|
}
|
|
678
|
-
function
|
|
680
|
+
function J() {
|
|
679
681
|
H.value = !0, !B.value && n.item?.width && n.item?.height && (B.value = n.item.width / n.item.height);
|
|
680
682
|
}
|
|
681
|
-
function
|
|
683
|
+
function te(e) {
|
|
682
684
|
let t = e.target.value;
|
|
683
685
|
R.value = t, I.value = t && parseInt(t, 10) || void 0;
|
|
684
686
|
}
|
|
685
|
-
function
|
|
687
|
+
function Y(e) {
|
|
686
688
|
let t = e.target.value;
|
|
687
689
|
z.value = t, L.value = t && parseInt(t, 10) || void 0;
|
|
688
690
|
}
|
|
689
|
-
async function
|
|
691
|
+
async function ne() {
|
|
690
692
|
let e = C.value.trim();
|
|
691
693
|
if (!e || !n.item || U.value) return;
|
|
692
694
|
let t = x(n.item.mime_type), i;
|
|
@@ -695,8 +697,8 @@ var Se = Symbol("templaticalMediaPopoverTarget"), Ce = ["data-tpl-theme"], we =
|
|
|
695
697
|
try {
|
|
696
698
|
let { canvas: e } = O.value.getResult();
|
|
697
699
|
if (e) {
|
|
698
|
-
let t =
|
|
699
|
-
i = { file: await
|
|
700
|
+
let t = Se(e, I.value, L.value), r = xe(n.item.mime_type);
|
|
701
|
+
i = { file: await Ce(t, n.item.filename, r) };
|
|
700
702
|
}
|
|
701
703
|
} catch {
|
|
702
704
|
U.value = !1;
|
|
@@ -706,8 +708,8 @@ var Se = Symbol("templaticalMediaPopoverTarget"), Ce = ["data-tpl-theme"], we =
|
|
|
706
708
|
}
|
|
707
709
|
r("save", n.item.id, e, t ? E.value : void 0, i), r("close");
|
|
708
710
|
}
|
|
709
|
-
function
|
|
710
|
-
e.key === "Enter" && !U.value && (e.preventDefault(),
|
|
711
|
+
function re(e) {
|
|
712
|
+
e.key === "Enter" && !U.value && (e.preventDefault(), ne()), e.key === "Escape" && r("close");
|
|
711
713
|
}
|
|
712
714
|
return (t, n) => (S(), l(a, { to: k(g) || "body" }, [m(o, {
|
|
713
715
|
"enter-active-class": "tpl:transition tpl:ease-out tpl:duration-150",
|
|
@@ -723,24 +725,24 @@ var Se = Symbol("templaticalMediaPopoverTarget"), Ce = ["data-tpl-theme"], we =
|
|
|
723
725
|
class: "tpl tpl:fixed tpl:inset-0 tpl:z-[10000] tpl:flex tpl:items-center tpl:justify-center",
|
|
724
726
|
style: { "background-color": "var(--tpl-overlay)" },
|
|
725
727
|
onClick: n[3] ||= F((e) => r("close"), ["self"]),
|
|
726
|
-
onKeydown:
|
|
728
|
+
onKeydown: re
|
|
727
729
|
}, [f("div", {
|
|
728
730
|
class: y(["tpl:mx-4 tpl:flex tpl:max-h-[90vh] tpl:w-full tpl:flex-col tpl:overflow-hidden tpl:rounded-lg tpl:shadow-xl", G.value ? "tpl:max-w-2xl" : "tpl:max-w-sm"]),
|
|
729
731
|
style: { "background-color": "var(--tpl-bg-elevated)" }
|
|
730
732
|
}, [
|
|
731
|
-
f("div",
|
|
732
|
-
f("div",
|
|
733
|
-
G.value ? (S(), d("div",
|
|
733
|
+
f("div", Ee, [f("h3", De, D(k(c).mediaLibrary.editFile), 1)]),
|
|
734
|
+
f("div", Oe, [
|
|
735
|
+
G.value ? (S(), d("div", ke, [f("div", Ae, [m(k(ie), {
|
|
734
736
|
ref_key: "cropperRef",
|
|
735
737
|
ref: O,
|
|
736
738
|
src: e.item.url,
|
|
737
739
|
"stencil-props": { aspectRatio: K.value },
|
|
738
740
|
class: "tpl:h-full tpl:w-full",
|
|
739
741
|
"background-class": "tpl-cropper-background",
|
|
740
|
-
onChange:
|
|
741
|
-
onReady:
|
|
742
|
-
}, null, 8, ["src", "stencil-props"])]), f("div",
|
|
743
|
-
f("div", null, [f("label",
|
|
742
|
+
onChange: ee,
|
|
743
|
+
onReady: J
|
|
744
|
+
}, null, 8, ["src", "stencil-props"])]), f("div", je, [
|
|
745
|
+
f("div", null, [f("label", Me, D(k(c).mediaLibrary.cropAspectRatio), 1), f("div", Ne, [(S(), d(i, null, T([
|
|
744
746
|
"free",
|
|
745
747
|
"square",
|
|
746
748
|
"landscape43",
|
|
@@ -756,8 +758,8 @@ var Se = Symbol("templaticalMediaPopoverTarget"), Ce = ["data-tpl-theme"], we =
|
|
|
756
758
|
color: P.value === e ? "var(--tpl-primary)" : "var(--tpl-text)"
|
|
757
759
|
}),
|
|
758
760
|
onClick: (t) => P.value = e
|
|
759
|
-
}, D(k(v)[`crop${e.charAt(0).toUpperCase()}${e.slice(1)}`]), 13,
|
|
760
|
-
f("div",
|
|
761
|
+
}, D(k(v)[`crop${e.charAt(0).toUpperCase()}${e.slice(1)}`]), 13, Pe)), 64))])]),
|
|
762
|
+
f("div", Fe, [f("div", Ie, [f("label", Le, [p(D(k(c).mediaLibrary.cropMaxWidth) + " ", 1), f("span", Re, D(k(c).mediaLibrary.cropOptional), 1)]), f("div", ze, [f("input", {
|
|
761
763
|
value: R.value,
|
|
762
764
|
type: "number",
|
|
763
765
|
min: "1",
|
|
@@ -768,8 +770,8 @@ var Se = Symbol("templaticalMediaPopoverTarget"), Ce = ["data-tpl-theme"], we =
|
|
|
768
770
|
color: "var(--tpl-text)"
|
|
769
771
|
},
|
|
770
772
|
placeholder: V.value?.width?.toString() || "",
|
|
771
|
-
onInput:
|
|
772
|
-
}, null, 40,
|
|
773
|
+
onInput: te
|
|
774
|
+
}, null, 40, Be), f("span", Ve, D(k(c).mediaLibrary.cropPixels), 1)])]), f("div", He, [f("label", Ue, [p(D(k(c).mediaLibrary.cropMaxHeight) + " ", 1), f("span", We, D(k(c).mediaLibrary.cropOptional), 1)]), f("div", Ge, [f("input", {
|
|
773
775
|
value: z.value,
|
|
774
776
|
type: "number",
|
|
775
777
|
min: "1",
|
|
@@ -780,11 +782,11 @@ var Se = Symbol("templaticalMediaPopoverTarget"), Ce = ["data-tpl-theme"], we =
|
|
|
780
782
|
color: "var(--tpl-text)"
|
|
781
783
|
},
|
|
782
784
|
placeholder: V.value?.height?.toString() || "",
|
|
783
|
-
onInput:
|
|
784
|
-
}, null, 40,
|
|
785
|
-
q.value ? (S(), d("div",
|
|
785
|
+
onInput: Y
|
|
786
|
+
}, null, 40, Ke), f("span", qe, D(k(c).mediaLibrary.cropPixels), 1)])])]),
|
|
787
|
+
q.value ? (S(), d("div", Je, [f("span", null, D(k(c).mediaLibrary.cropOutputSize) + ": ", 1), f("span", Ye, D(q.value.width) + " x " + D(q.value.height) + " " + D(k(c).mediaLibrary.cropPixels), 1)])) : u("", !0)
|
|
786
788
|
])])) : u("", !0),
|
|
787
|
-
f("div",
|
|
789
|
+
f("div", Xe, [f("label", Ze, D(k(c).mediaLibrary.fileName), 1), N(f("input", {
|
|
788
790
|
"onUpdate:modelValue": n[0] ||= (e) => C.value = e,
|
|
789
791
|
type: "text",
|
|
790
792
|
class: "tpl:w-full tpl:rounded-md tpl:border tpl:px-3 tpl:py-1.5 tpl:text-xs tpl:outline-none",
|
|
@@ -794,8 +796,8 @@ var Se = Symbol("templaticalMediaPopoverTarget"), Ce = ["data-tpl-theme"], we =
|
|
|
794
796
|
color: "var(--tpl-text)"
|
|
795
797
|
},
|
|
796
798
|
autofocus: !G.value
|
|
797
|
-
}, null, 8,
|
|
798
|
-
k(x)(e.item.mime_type) ? (S(), d("div",
|
|
799
|
+
}, null, 8, Qe), [[A, C.value]])]),
|
|
800
|
+
k(x)(e.item.mime_type) ? (S(), d("div", $e, [f("label", et, D(k(c).mediaLibrary.altText), 1), N(f("input", {
|
|
799
801
|
"onUpdate:modelValue": n[1] ||= (e) => E.value = e,
|
|
800
802
|
type: "text",
|
|
801
803
|
class: "tpl:w-full tpl:rounded-md tpl:border tpl:px-3 tpl:py-1.5 tpl:text-xs tpl:outline-none",
|
|
@@ -805,9 +807,9 @@ var Se = Symbol("templaticalMediaPopoverTarget"), Ce = ["data-tpl-theme"], we =
|
|
|
805
807
|
color: "var(--tpl-text)"
|
|
806
808
|
},
|
|
807
809
|
placeholder: k(c).mediaLibrary.altTextPlaceholder
|
|
808
|
-
}, null, 8,
|
|
810
|
+
}, null, 8, tt), [[A, E.value]])])) : u("", !0)
|
|
809
811
|
]),
|
|
810
|
-
f("div",
|
|
812
|
+
f("div", nt, [f("button", {
|
|
811
813
|
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",
|
|
812
814
|
style: {
|
|
813
815
|
"border-color": "var(--tpl-border)",
|
|
@@ -819,26 +821,26 @@ var Se = Symbol("templaticalMediaPopoverTarget"), Ce = ["data-tpl-theme"], we =
|
|
|
819
821
|
class: "tpl:cursor-pointer tpl:rounded-md tpl:px-3 tpl:py-1.5 tpl:text-xs tpl:font-medium tpl:text-white tpl:transition-all tpl:duration-150 tpl:disabled:cursor-not-allowed tpl:disabled:opacity-50",
|
|
820
822
|
style: { background: "linear-gradient(\n 135deg,\n var(--tpl-primary),\n var(--tpl-primary-hover)\n )" },
|
|
821
823
|
disabled: U.value,
|
|
822
|
-
onClick:
|
|
823
|
-
}, D(U.value ? k(c).mediaLibrary.saving : k(c).mediaLibrary.saveChanges), 9,
|
|
824
|
-
], 2)], 40,
|
|
824
|
+
onClick: ne
|
|
825
|
+
}, D(U.value ? k(c).mediaLibrary.saving : k(c).mediaLibrary.saveChanges), 9, rt)])
|
|
826
|
+
], 2)], 40, Te)) : u("", !0)]),
|
|
825
827
|
_: 1
|
|
826
828
|
})], 8, ["to"]));
|
|
827
829
|
}
|
|
828
|
-
}),
|
|
830
|
+
}), at = (e, t) => {
|
|
829
831
|
let n = e.__vccOpts || e;
|
|
830
832
|
for (let [e, r] of t) n[e] = r;
|
|
831
833
|
return n;
|
|
832
|
-
},
|
|
834
|
+
}, ot = /*#__PURE__*/ at(it, [["__scopeId", "data-v-6b677237"]]), st = {
|
|
833
835
|
key: 1,
|
|
834
836
|
class: "tpl:size-4 tpl:shrink-0"
|
|
835
|
-
},
|
|
837
|
+
}, ct = {
|
|
836
838
|
key: 0,
|
|
837
839
|
class: "tpl:truncate"
|
|
838
|
-
},
|
|
840
|
+
}, lt = {
|
|
839
841
|
key: 3,
|
|
840
842
|
class: "tpl:flex tpl:shrink-0 tpl:items-center tpl:gap-0.5 tpl:opacity-0 tpl:transition-opacity tpl:group-hover:opacity-100"
|
|
841
|
-
},
|
|
843
|
+
}, ut = ["title"], dt = ["title"], ft = { key: 0 }, pt = ["placeholder"], mt = /* @__PURE__ */ h({
|
|
842
844
|
__name: "MediaFolderTreeNode",
|
|
843
845
|
props: {
|
|
844
846
|
folder: {},
|
|
@@ -852,7 +854,7 @@ var Se = Symbol("templaticalMediaPopoverTarget"), Ce = ["data-tpl-theme"], we =
|
|
|
852
854
|
"deleteFolder"
|
|
853
855
|
],
|
|
854
856
|
setup(e, { emit: t }) {
|
|
855
|
-
let n = e, r = t, { t: a } =
|
|
857
|
+
let n = e, r = t, { t: a } = X(), o = w(!1), c = w(!1), p = w(""), h = w(!1), g = w(""), _ = s(() => (n.folder.children?.length ?? 0) > 0), v = s(() => n.depth < 4), x = s(() => n.currentFolderId === n.folder.id), C = s(() => !n.currentFolderId || !n.folder.children ? !1 : j(n.folder.children, n.currentFolderId)), O = s(() => o.value || C.value);
|
|
856
858
|
function j(e, t) {
|
|
857
859
|
for (let n of e) if (n.id === t || n.children && j(n.children, t)) return !0;
|
|
858
860
|
return !1;
|
|
@@ -897,7 +899,7 @@ var Se = Symbol("templaticalMediaPopoverTarget"), Ce = ["data-tpl-theme"], we =
|
|
|
897
899
|
class: y(["tpl:transition-transform tpl:duration-150", { "tpl:rotate-90": O.value }]),
|
|
898
900
|
size: 10,
|
|
899
901
|
"stroke-width": 2
|
|
900
|
-
}, null, 8, ["class"])])) : (S(), d("span",
|
|
902
|
+
}, null, 8, ["class"])])) : (S(), d("span", st)),
|
|
901
903
|
f("button", {
|
|
902
904
|
class: "tpl:flex tpl:min-w-0 tpl:flex-1 tpl:items-center tpl:gap-1.5",
|
|
903
905
|
onClick: n[0] ||= (t) => r("navigate", e.folder.id)
|
|
@@ -905,7 +907,7 @@ var Se = Symbol("templaticalMediaPopoverTarget"), Ce = ["data-tpl-theme"], we =
|
|
|
905
907
|
class: "tpl:shrink-0",
|
|
906
908
|
size: 14,
|
|
907
909
|
"stroke-width": 1.5
|
|
908
|
-
}), c.value ? u("", !0) : (S(), d("span",
|
|
910
|
+
}), c.value ? u("", !0) : (S(), d("span", ct, D(e.folder.name), 1))]),
|
|
909
911
|
c.value ? N((S(), d("input", {
|
|
910
912
|
key: 2,
|
|
911
913
|
"onUpdate:modelValue": n[1] ||= (e) => p.value = e,
|
|
@@ -921,7 +923,7 @@ var Se = Symbol("templaticalMediaPopoverTarget"), Ce = ["data-tpl-theme"], we =
|
|
|
921
923
|
onBlur: R,
|
|
922
924
|
onClick: n[2] ||= F(() => {}, ["stop"])
|
|
923
925
|
}, null, 544)), [[A, p.value]]) : u("", !0),
|
|
924
|
-
c.value ? u("", !0) : (S(), d("span",
|
|
926
|
+
c.value ? u("", !0) : (S(), d("span", lt, [
|
|
925
927
|
v.value ? (S(), d("button", {
|
|
926
928
|
key: 0,
|
|
927
929
|
class: "tpl:flex tpl:size-6 tpl:items-center tpl:justify-center tpl:rounded tpl:transition-colors",
|
|
@@ -930,7 +932,7 @@ var Se = Symbol("templaticalMediaPopoverTarget"), Ce = ["data-tpl-theme"], we =
|
|
|
930
932
|
}, [m(k(q), {
|
|
931
933
|
size: 12,
|
|
932
934
|
"stroke-width": 2
|
|
933
|
-
})], 8,
|
|
935
|
+
})], 8, ut)) : u("", !0),
|
|
934
936
|
f("button", {
|
|
935
937
|
class: "tpl:flex tpl:size-6 tpl:items-center tpl:justify-center tpl:rounded tpl:transition-colors",
|
|
936
938
|
title: k(a).mediaLibrary.renameFolder,
|
|
@@ -938,17 +940,17 @@ var Se = Symbol("templaticalMediaPopoverTarget"), Ce = ["data-tpl-theme"], we =
|
|
|
938
940
|
}, [m(k(K), {
|
|
939
941
|
size: 12,
|
|
940
942
|
"stroke-width": 2
|
|
941
|
-
})], 8,
|
|
943
|
+
})], 8, dt),
|
|
942
944
|
f("button", {
|
|
943
945
|
class: "tpl:flex tpl:size-6 tpl:items-center tpl:justify-center tpl:rounded tpl:transition-colors",
|
|
944
946
|
onClick: n[3] ||= F((t) => r("deleteFolder", e.folder.id), ["stop"])
|
|
945
|
-
}, [m(k(
|
|
947
|
+
}, [m(k(Y), {
|
|
946
948
|
size: 12,
|
|
947
949
|
"stroke-width": 2,
|
|
948
950
|
style: { color: "var(--tpl-danger)" }
|
|
949
951
|
})])
|
|
950
952
|
]))
|
|
951
|
-
], 4), O.value ? (S(), d("div",
|
|
953
|
+
], 4), O.value ? (S(), d("div", ft, [(S(!0), d(i, null, T(e.folder.children, (t) => (S(), l(o, {
|
|
952
954
|
key: t.id,
|
|
953
955
|
folder: t,
|
|
954
956
|
"current-folder-id": e.currentFolderId,
|
|
@@ -978,13 +980,13 @@ var Se = Symbol("templaticalMediaPopoverTarget"), Ce = ["data-tpl-theme"], we =
|
|
|
978
980
|
autofocus: "",
|
|
979
981
|
onKeydown: [P(H, ["enter"]), P(U, ["escape"])],
|
|
980
982
|
onBlur: H
|
|
981
|
-
}, null, 40,
|
|
983
|
+
}, null, 40, pt), [[A, g.value]])], 4)) : u("", !0)])) : u("", !0)]);
|
|
982
984
|
};
|
|
983
985
|
}
|
|
984
|
-
}),
|
|
986
|
+
}), ht = { class: "tpl:flex tpl:h-full tpl:flex-col tpl:overflow-y-auto" }, gt = {
|
|
985
987
|
key: 0,
|
|
986
988
|
class: "tpl:px-3 tpl:py-2"
|
|
987
|
-
},
|
|
989
|
+
}, _t = ["placeholder"], vt = /* @__PURE__ */ h({
|
|
988
990
|
__name: "MediaFolderTree",
|
|
989
991
|
props: {
|
|
990
992
|
folders: {},
|
|
@@ -1000,7 +1002,7 @@ var Se = Symbol("templaticalMediaPopoverTarget"), Ce = ["data-tpl-theme"], we =
|
|
|
1000
1002
|
"showFrequentlyUsed"
|
|
1001
1003
|
],
|
|
1002
1004
|
setup(e, { emit: t }) {
|
|
1003
|
-
let n = t, { t: r } =
|
|
1005
|
+
let n = t, { t: r } = X(), a = w(!1), o = w("");
|
|
1004
1006
|
function s() {
|
|
1005
1007
|
a.value = !0, o.value = "";
|
|
1006
1008
|
}
|
|
@@ -1010,7 +1012,7 @@ var Se = Symbol("templaticalMediaPopoverTarget"), Ce = ["data-tpl-theme"], we =
|
|
|
1010
1012
|
function h() {
|
|
1011
1013
|
a.value = !1, o.value = "";
|
|
1012
1014
|
}
|
|
1013
|
-
return (t, g) => (S(), d("div",
|
|
1015
|
+
return (t, g) => (S(), d("div", ht, [
|
|
1014
1016
|
f("button", {
|
|
1015
1017
|
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",
|
|
1016
1018
|
style: b({
|
|
@@ -1022,7 +1024,7 @@ var Se = Symbol("templaticalMediaPopoverTarget"), Ce = ["data-tpl-theme"], we =
|
|
|
1022
1024
|
size: 14,
|
|
1023
1025
|
"stroke-width": 1.5
|
|
1024
1026
|
}), p(" " + D(k(r).mediaLibrary.allFiles), 1)], 4),
|
|
1025
|
-
(S(!0), d(i, null, T(e.folders, (t) => (S(), l(
|
|
1027
|
+
(S(!0), d(i, null, T(e.folders, (t) => (S(), l(mt, {
|
|
1026
1028
|
key: t.id,
|
|
1027
1029
|
folder: t,
|
|
1028
1030
|
"current-folder-id": e.currentFolderId,
|
|
@@ -1032,7 +1034,7 @@ var Se = Symbol("templaticalMediaPopoverTarget"), Ce = ["data-tpl-theme"], we =
|
|
|
1032
1034
|
onRenameFolder: g[3] ||= (e, t) => n("renameFolder", e, t),
|
|
1033
1035
|
onDeleteFolder: g[4] ||= (e) => n("deleteFolder", e)
|
|
1034
1036
|
}, null, 8, ["folder", "current-folder-id"]))), 128)),
|
|
1035
|
-
a.value ? (S(), d("div",
|
|
1037
|
+
a.value ? (S(), d("div", gt, [N(f("input", {
|
|
1036
1038
|
"onUpdate:modelValue": g[5] ||= (e) => o.value = e,
|
|
1037
1039
|
type: "text",
|
|
1038
1040
|
class: "tpl:w-full tpl:rounded tpl:border tpl:px-2 tpl:py-1 tpl:text-xs tpl:outline-none",
|
|
@@ -1045,7 +1047,7 @@ var Se = Symbol("templaticalMediaPopoverTarget"), Ce = ["data-tpl-theme"], we =
|
|
|
1045
1047
|
autofocus: "",
|
|
1046
1048
|
onKeydown: [P(c, ["enter"]), P(h, ["escape"])],
|
|
1047
1049
|
onBlur: c
|
|
1048
|
-
}, null, 40,
|
|
1050
|
+
}, null, 40, _t), [[A, o.value]])])) : u("", !0),
|
|
1049
1051
|
a.value ? u("", !0) : (S(), d("button", {
|
|
1050
1052
|
key: 1,
|
|
1051
1053
|
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",
|
|
@@ -1065,13 +1067,13 @@ var Se = Symbol("templaticalMediaPopoverTarget"), Ce = ["data-tpl-theme"], we =
|
|
|
1065
1067
|
color: e.viewMode === "frequently-used" ? "var(--tpl-primary)" : "var(--tpl-text)"
|
|
1066
1068
|
}),
|
|
1067
1069
|
onClick: g[6] ||= (e) => n("showFrequentlyUsed")
|
|
1068
|
-
}, [m(k(
|
|
1070
|
+
}, [m(k(te), {
|
|
1069
1071
|
size: 14,
|
|
1070
1072
|
"stroke-width": 1.5
|
|
1071
1073
|
}), p(" " + D(k(r).mediaLibrary.frequentlyUsed), 1)], 4)) : u("", !0)
|
|
1072
1074
|
]));
|
|
1073
1075
|
}
|
|
1074
|
-
}),
|
|
1076
|
+
}), yt = { class: "tpl:flex tpl:aspect-square tpl:flex-col tpl:items-center tpl:justify-center tpl:gap-2" }, bt = /* @__PURE__ */ h({
|
|
1075
1077
|
__name: "MediaFileIcon",
|
|
1076
1078
|
props: { mimeType: {} },
|
|
1077
1079
|
setup(e) {
|
|
@@ -1172,7 +1174,7 @@ var Se = Symbol("templaticalMediaPopoverTarget"), Ce = ["data-tpl-theme"], we =
|
|
|
1172
1174
|
bgColor: "#f9fafb",
|
|
1173
1175
|
icon: "document"
|
|
1174
1176
|
}, i = s(() => n[t.mimeType] ?? r);
|
|
1175
|
-
return (e, t) => (S(), d("div",
|
|
1177
|
+
return (e, t) => (S(), d("div", yt, [i.value.icon === "document" ? (S(), d("svg", {
|
|
1176
1178
|
key: 0,
|
|
1177
1179
|
width: "60",
|
|
1178
1180
|
height: "60",
|
|
@@ -1241,48 +1243,48 @@ var Se = Symbol("templaticalMediaPopoverTarget"), Ce = ["data-tpl-theme"], we =
|
|
|
1241
1243
|
style: b({ color: i.value.color })
|
|
1242
1244
|
}, D(i.value.label), 5)]));
|
|
1243
1245
|
}
|
|
1244
|
-
}),
|
|
1246
|
+
}), xt = { class: "tpl:p-4" }, St = {
|
|
1245
1247
|
key: 1,
|
|
1246
1248
|
class: "tpl:flex tpl:flex-col tpl:items-center tpl:justify-center tpl:py-16"
|
|
1247
|
-
},
|
|
1249
|
+
}, Ct = {
|
|
1248
1250
|
class: "tpl:text-xs",
|
|
1249
1251
|
style: { color: "var(--tpl-text-muted)" }
|
|
1250
|
-
},
|
|
1252
|
+
}, wt = {
|
|
1251
1253
|
key: 2,
|
|
1252
1254
|
class: "tpl:grid tpl:grid-cols-4 tpl:gap-3"
|
|
1253
|
-
},
|
|
1255
|
+
}, Tt = ["onClick"], Et = { class: "tpl:aspect-square" }, Dt = ["src", "alt"], Ot = { class: "tpl:px-2 tpl:py-1.5" }, kt = {
|
|
1254
1256
|
class: "tpl:truncate tpl:text-[10px] tpl:font-medium",
|
|
1255
1257
|
style: { color: "var(--tpl-text)" }
|
|
1256
|
-
},
|
|
1258
|
+
}, At = {
|
|
1257
1259
|
class: "tpl:flex tpl:justify-between tpl:text-[9px]",
|
|
1258
1260
|
style: { color: "var(--tpl-text-muted)" }
|
|
1259
|
-
},
|
|
1261
|
+
}, jt = { key: 0 }, Mt = { class: "tpl:absolute tpl:top-1.5 tpl:left-1.5 tpl:flex tpl:gap-1 tpl:opacity-0 tpl:transition-opacity tpl:duration-150 tpl:group-hover:opacity-100" }, Nt = ["title", "onClick"], Pt = ["title", "onClick"], Ft = {
|
|
1260
1262
|
key: 0,
|
|
1261
1263
|
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 tpl:text-white",
|
|
1262
1264
|
style: { "background-color": "var(--tpl-primary)" }
|
|
1263
|
-
},
|
|
1265
|
+
}, It = {
|
|
1264
1266
|
key: 3,
|
|
1265
1267
|
class: "tpl:flex tpl:flex-col tpl:gap-1"
|
|
1266
|
-
},
|
|
1268
|
+
}, Lt = ["onClick"], Rt = {
|
|
1267
1269
|
class: "tpl:size-10 tpl:shrink-0 tpl:overflow-hidden tpl:rounded",
|
|
1268
1270
|
style: { "background-color": "var(--tpl-bg-hover)" }
|
|
1269
|
-
},
|
|
1271
|
+
}, zt = ["src", "alt"], Bt = {
|
|
1270
1272
|
key: 1,
|
|
1271
1273
|
class: "tpl-list-icon tpl:size-full"
|
|
1272
|
-
},
|
|
1274
|
+
}, Vt = { class: "tpl:min-w-0 tpl:flex-1" }, Ht = {
|
|
1273
1275
|
class: "tpl:truncate tpl:text-xs tpl:font-medium",
|
|
1274
1276
|
style: { color: "var(--tpl-text)" }
|
|
1275
|
-
},
|
|
1277
|
+
}, Ut = {
|
|
1276
1278
|
class: "tpl:text-[10px]",
|
|
1277
1279
|
style: { color: "var(--tpl-text-muted)" }
|
|
1278
|
-
},
|
|
1280
|
+
}, Wt = { class: "tpl:flex tpl:gap-1 tpl:opacity-0 tpl:transition-opacity tpl:duration-150 tpl:group-hover:opacity-100" }, Gt = ["title", "onClick"], Kt = ["title", "onClick"], qt = {
|
|
1279
1281
|
key: 0,
|
|
1280
1282
|
class: "tpl:flex tpl:size-5 tpl:shrink-0 tpl:items-center tpl:justify-center tpl:rounded-full tpl:text-white",
|
|
1281
1283
|
style: { "background-color": "var(--tpl-primary)" }
|
|
1282
|
-
},
|
|
1284
|
+
}, Jt = {
|
|
1283
1285
|
key: 4,
|
|
1284
1286
|
class: "tpl:flex tpl:justify-center tpl:py-4"
|
|
1285
|
-
},
|
|
1287
|
+
}, Yt = /*#__PURE__*/ at(/* @__PURE__ */ h({
|
|
1286
1288
|
__name: "MediaGrid",
|
|
1287
1289
|
props: {
|
|
1288
1290
|
items: {},
|
|
@@ -1300,15 +1302,15 @@ var Se = Symbol("templaticalMediaPopoverTarget"), Ce = ["data-tpl-theme"], we =
|
|
|
1300
1302
|
"replace"
|
|
1301
1303
|
],
|
|
1302
1304
|
setup(e, { emit: t }) {
|
|
1303
|
-
let n = e, r = t, { isAcceptedMimeType: a, isImageMimeType: o } =
|
|
1305
|
+
let n = e, r = t, { isAcceptedMimeType: a, isImageMimeType: o } = Z();
|
|
1304
1306
|
function s(e) {
|
|
1305
1307
|
return !n.accept || n.accept.length === 0 || a(e.mime_type, n.accept);
|
|
1306
1308
|
}
|
|
1307
1309
|
function c(e) {
|
|
1308
1310
|
r("select", e);
|
|
1309
1311
|
}
|
|
1310
|
-
let { t: h } =
|
|
1311
|
-
|
|
1312
|
+
let { t: h } = X(), g = w(null);
|
|
1313
|
+
de(g, ([{ isIntersecting: e }]) => {
|
|
1312
1314
|
e && n.hasMore && !n.isLoading && r("loadMore");
|
|
1313
1315
|
}, { threshold: .1 });
|
|
1314
1316
|
function _(e) {
|
|
@@ -1321,7 +1323,7 @@ var Se = Symbol("templaticalMediaPopoverTarget"), Ce = ["data-tpl-theme"], we =
|
|
|
1321
1323
|
day: "numeric"
|
|
1322
1324
|
});
|
|
1323
1325
|
}
|
|
1324
|
-
return (t, n) => (S(), d("div",
|
|
1326
|
+
return (t, n) => (S(), d("div", xt, [
|
|
1325
1327
|
e.isLoading && e.items.length === 0 ? (S(), d("div", {
|
|
1326
1328
|
key: 0,
|
|
1327
1329
|
class: y(e.layout === "list" ? "tpl:flex tpl:flex-col tpl:gap-1" : "tpl:grid tpl:grid-cols-4 tpl:gap-3")
|
|
@@ -1329,26 +1331,26 @@ var Se = Symbol("templaticalMediaPopoverTarget"), Ce = ["data-tpl-theme"], we =
|
|
|
1329
1331
|
key: t,
|
|
1330
1332
|
class: y(["tpl-pulse tpl:rounded-lg", e.layout === "list" ? "tpl:h-12" : "tpl:aspect-square"]),
|
|
1331
1333
|
style: { "background-color": "var(--tpl-bg-hover)" }
|
|
1332
|
-
}, null, 2)), 64))], 2)) : e.items.length === 0 ? (S(), d("div",
|
|
1334
|
+
}, null, 2)), 64))], 2)) : e.items.length === 0 ? (S(), d("div", St, [m(k(z), {
|
|
1333
1335
|
class: "tpl:mb-3",
|
|
1334
1336
|
size: 40,
|
|
1335
1337
|
"stroke-width": 1,
|
|
1336
1338
|
style: { color: "var(--tpl-text-dim)" }
|
|
1337
|
-
}), f("p",
|
|
1339
|
+
}), f("p", Ct, D(k(h).mediaLibrary.noFiles), 1)])) : e.layout === "list" ? (S(), d("div", It, [(S(!0), d(i, null, T(e.items, (t) => (S(), d("div", {
|
|
1338
1340
|
key: t.id,
|
|
1339
1341
|
class: y(["tpl-media-list-item tpl:group tpl:flex tpl:cursor-pointer tpl:items-center tpl:gap-3 tpl:rounded-lg tpl:px-3 tpl:py-2 tpl:transition-all tpl:duration-150", [!s(t) && !e.selectedIds.has(t.id) ? "tpl:opacity-60" : ""]]),
|
|
1340
1342
|
style: b({ backgroundColor: e.selectedIds.has(t.id) ? "var(--tpl-bg-hover)" : "transparent" }),
|
|
1341
1343
|
onClick: (e) => c(t)
|
|
1342
1344
|
}, [
|
|
1343
|
-
f("div",
|
|
1345
|
+
f("div", Rt, [k(o)(t.mime_type) ? (S(), d("img", {
|
|
1344
1346
|
key: 0,
|
|
1345
1347
|
src: t.small_url || t.url,
|
|
1346
1348
|
alt: t.filename,
|
|
1347
1349
|
class: "tpl:size-full tpl:object-cover",
|
|
1348
1350
|
loading: "lazy"
|
|
1349
|
-
}, null, 8,
|
|
1350
|
-
f("div",
|
|
1351
|
-
f("div",
|
|
1351
|
+
}, null, 8, zt)) : (S(), d("div", Bt, [m(bt, { "mime-type": t.mime_type }, null, 8, ["mime-type"])]))]),
|
|
1352
|
+
f("div", Vt, [f("p", Ht, D(t.filename), 1), f("p", Ut, [p(D(_(t.size)) + " · " + D(v(t.created_at)) + " ", 1), k(o)(t.mime_type) && t.width && t.height ? (S(), d(i, { key: 0 }, [p(" · " + D(t.width) + "×" + D(t.height), 1)], 64)) : u("", !0)])]),
|
|
1353
|
+
f("div", Wt, [f("button", {
|
|
1352
1354
|
class: "tpl:flex tpl:size-6 tpl:shrink-0 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded",
|
|
1353
1355
|
style: { color: "var(--tpl-text-muted)" },
|
|
1354
1356
|
title: k(h).mediaLibrary.editFile,
|
|
@@ -1356,20 +1358,20 @@ var Se = Symbol("templaticalMediaPopoverTarget"), Ce = ["data-tpl-theme"], we =
|
|
|
1356
1358
|
}, [m(k(K), {
|
|
1357
1359
|
size: 12,
|
|
1358
1360
|
"stroke-width": 2
|
|
1359
|
-
})], 8,
|
|
1361
|
+
})], 8, Gt), f("button", {
|
|
1360
1362
|
class: "tpl:flex tpl:size-6 tpl:shrink-0 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded",
|
|
1361
1363
|
style: { color: "var(--tpl-text-muted)" },
|
|
1362
1364
|
title: k(h).mediaLibrary.replaceFile,
|
|
1363
1365
|
onClick: F((e) => r("replace", t), ["stop"])
|
|
1364
|
-
}, [m(k(
|
|
1366
|
+
}, [m(k(ee), {
|
|
1365
1367
|
size: 12,
|
|
1366
1368
|
"stroke-width": 2
|
|
1367
|
-
})], 8,
|
|
1368
|
-
e.selectedIds.has(t.id) ? (S(), d("div",
|
|
1369
|
+
})], 8, Kt)]),
|
|
1370
|
+
e.selectedIds.has(t.id) ? (S(), d("div", qt, [m(k(I), {
|
|
1369
1371
|
size: 12,
|
|
1370
1372
|
"stroke-width": 3
|
|
1371
1373
|
})])) : u("", !0)
|
|
1372
|
-
], 14,
|
|
1374
|
+
], 14, Lt))), 128))])) : (S(), d("div", wt, [(S(!0), d(i, null, T(e.items, (t) => (S(), d("div", {
|
|
1373
1375
|
key: t.id,
|
|
1374
1376
|
class: y(["tpl-media-item tpl:group tpl:relative tpl:overflow-hidden tpl:rounded-lg tpl:border-2 tpl:transition-all tpl:duration-150", [
|
|
1375
1377
|
"tpl:cursor-pointer",
|
|
@@ -1382,18 +1384,18 @@ var Se = Symbol("templaticalMediaPopoverTarget"), Ce = ["data-tpl-theme"], we =
|
|
|
1382
1384
|
}),
|
|
1383
1385
|
onClick: (e) => c(t)
|
|
1384
1386
|
}, [
|
|
1385
|
-
f("div",
|
|
1387
|
+
f("div", Et, [k(o)(t.mime_type) ? (S(), d("img", {
|
|
1386
1388
|
key: 0,
|
|
1387
1389
|
src: t.small_url || t.url,
|
|
1388
1390
|
alt: t.filename,
|
|
1389
1391
|
class: "tpl:size-full tpl:object-cover",
|
|
1390
1392
|
loading: "lazy"
|
|
1391
|
-
}, null, 8,
|
|
1393
|
+
}, null, 8, Dt)) : (S(), l(bt, {
|
|
1392
1394
|
key: 1,
|
|
1393
1395
|
"mime-type": t.mime_type
|
|
1394
1396
|
}, null, 8, ["mime-type"]))]),
|
|
1395
|
-
f("div",
|
|
1396
|
-
f("div",
|
|
1397
|
+
f("div", Ot, [f("p", kt, D(t.filename), 1), f("p", At, [f("span", null, D(_(t.size)), 1), k(o)(t.mime_type) && t.width && t.height ? (S(), d("span", jt, D(t.width) + "×" + D(t.height), 1)) : u("", !0)])]),
|
|
1398
|
+
f("div", Mt, [f("button", {
|
|
1397
1399
|
class: "tpl:flex tpl:size-6 tpl:items-center tpl:justify-center tpl:rounded-full tpl:text-white",
|
|
1398
1400
|
style: { "background-color": "rgba(0, 0, 0, 0.6)" },
|
|
1399
1401
|
title: k(h).mediaLibrary.editFile,
|
|
@@ -1401,26 +1403,26 @@ var Se = Symbol("templaticalMediaPopoverTarget"), Ce = ["data-tpl-theme"], we =
|
|
|
1401
1403
|
}, [m(k(K), {
|
|
1402
1404
|
size: 11,
|
|
1403
1405
|
"stroke-width": 2
|
|
1404
|
-
})], 8,
|
|
1406
|
+
})], 8, Nt), f("button", {
|
|
1405
1407
|
class: "tpl:flex tpl:size-6 tpl:items-center tpl:justify-center tpl:rounded-full tpl:text-white",
|
|
1406
1408
|
style: { "background-color": "rgba(0, 0, 0, 0.6)" },
|
|
1407
1409
|
title: k(h).mediaLibrary.replaceFile,
|
|
1408
1410
|
onClick: F((e) => r("replace", t), ["stop"])
|
|
1409
|
-
}, [m(k(
|
|
1411
|
+
}, [m(k(ee), {
|
|
1410
1412
|
size: 11,
|
|
1411
1413
|
"stroke-width": 2
|
|
1412
|
-
})], 8,
|
|
1413
|
-
e.selectedIds.has(t.id) ? (S(), d("div",
|
|
1414
|
+
})], 8, Pt)]),
|
|
1415
|
+
e.selectedIds.has(t.id) ? (S(), d("div", Ft, [m(k(I), {
|
|
1414
1416
|
size: 12,
|
|
1415
1417
|
"stroke-width": 3
|
|
1416
1418
|
})])) : u("", !0)
|
|
1417
|
-
], 14,
|
|
1419
|
+
], 14, Tt))), 128))])),
|
|
1418
1420
|
f("div", {
|
|
1419
1421
|
ref_key: "sentinelRef",
|
|
1420
1422
|
ref: g,
|
|
1421
1423
|
class: "tpl:h-4"
|
|
1422
1424
|
}, null, 512),
|
|
1423
|
-
e.isLoading && e.items.length > 0 ? (S(), d("div",
|
|
1425
|
+
e.isLoading && e.items.length > 0 ? (S(), d("div", Jt, [m(k(W), {
|
|
1424
1426
|
class: "tpl-spinner",
|
|
1425
1427
|
size: 20,
|
|
1426
1428
|
"stroke-width": 2,
|
|
@@ -1428,20 +1430,20 @@ var Se = Symbol("templaticalMediaPopoverTarget"), Ce = ["data-tpl-theme"], we =
|
|
|
1428
1430
|
})])) : u("", !0)
|
|
1429
1431
|
]));
|
|
1430
1432
|
}
|
|
1431
|
-
}), [["__scopeId", "data-v-9db961d1"]]),
|
|
1433
|
+
}), [["__scopeId", "data-v-9db961d1"]]), Xt = ["data-tpl-theme"], Zt = {
|
|
1432
1434
|
class: "tpl:mx-4 tpl:w-full tpl:max-w-sm tpl:rounded-lg tpl:p-5 tpl:shadow-xl",
|
|
1433
1435
|
style: { "background-color": "var(--tpl-bg-elevated)" }
|
|
1434
|
-
},
|
|
1436
|
+
}, Qt = {
|
|
1435
1437
|
class: "tpl:mb-4 tpl:text-sm tpl:font-semibold",
|
|
1436
1438
|
style: { color: "var(--tpl-text)" }
|
|
1437
|
-
},
|
|
1439
|
+
}, $t = { class: "tpl:mb-3" }, en = ["placeholder", "disabled"], tn = {
|
|
1438
1440
|
key: 0,
|
|
1439
1441
|
class: "tpl:mb-3 tpl:text-xs",
|
|
1440
1442
|
style: { color: "var(--tpl-danger)" }
|
|
1441
|
-
},
|
|
1443
|
+
}, nn = { class: "tpl:flex tpl:justify-end tpl:gap-2" }, rn = ["disabled"], an = ["disabled"], on = {
|
|
1442
1444
|
key: 0,
|
|
1443
1445
|
class: "tpl:flex tpl:items-center tpl:gap-1.5"
|
|
1444
|
-
},
|
|
1446
|
+
}, sn = { key: 1 }, cn = /* @__PURE__ */ h({
|
|
1445
1447
|
__name: "MediaImportUrlModal",
|
|
1446
1448
|
props: {
|
|
1447
1449
|
visible: { type: Boolean },
|
|
@@ -1450,7 +1452,7 @@ var Se = Symbol("templaticalMediaPopoverTarget"), Ce = ["data-tpl-theme"], we =
|
|
|
1450
1452
|
},
|
|
1451
1453
|
emits: ["import", "close"],
|
|
1452
1454
|
setup(e, { emit: t }) {
|
|
1453
|
-
let n = e, r = t, { t: i } =
|
|
1455
|
+
let n = e, r = t, { t: i } = X(), s = _("tplUiTheme"), c = _(ye, w(null)), h = w("");
|
|
1454
1456
|
j(() => n.visible, (e) => {
|
|
1455
1457
|
e && (h.value = "");
|
|
1456
1458
|
});
|
|
@@ -1479,9 +1481,9 @@ var Se = Symbol("templaticalMediaPopoverTarget"), Ce = ["data-tpl-theme"], we =
|
|
|
1479
1481
|
style: { "background-color": "var(--tpl-overlay)" },
|
|
1480
1482
|
onClick: F(v, ["self"]),
|
|
1481
1483
|
onKeydown: b
|
|
1482
|
-
}, [f("div",
|
|
1483
|
-
f("h3",
|
|
1484
|
-
f("div",
|
|
1484
|
+
}, [f("div", Zt, [
|
|
1485
|
+
f("h3", Qt, D(k(i).mediaLibrary.importFromUrl), 1),
|
|
1486
|
+
f("div", $t, [N(f("input", {
|
|
1485
1487
|
"onUpdate:modelValue": n[0] ||= (e) => h.value = e,
|
|
1486
1488
|
type: "url",
|
|
1487
1489
|
class: "tpl:w-full tpl:rounded-md tpl:border tpl:px-3 tpl:py-1.5 tpl:text-xs tpl:outline-none",
|
|
@@ -1493,9 +1495,9 @@ var Se = Symbol("templaticalMediaPopoverTarget"), Ce = ["data-tpl-theme"], we =
|
|
|
1493
1495
|
placeholder: k(i).mediaLibrary.importUrlPlaceholder,
|
|
1494
1496
|
disabled: e.isImporting,
|
|
1495
1497
|
autofocus: ""
|
|
1496
|
-
}, null, 8,
|
|
1497
|
-
e.error ? (S(), d("p",
|
|
1498
|
-
f("div",
|
|
1498
|
+
}, null, 8, en), [[A, h.value]])]),
|
|
1499
|
+
e.error ? (S(), d("p", tn, D(e.error), 1)) : u("", !0),
|
|
1500
|
+
f("div", nn, [f("button", {
|
|
1499
1501
|
class: y(["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 }]),
|
|
1500
1502
|
style: {
|
|
1501
1503
|
"border-color": "var(--tpl-border)",
|
|
@@ -1504,25 +1506,25 @@ var Se = Symbol("templaticalMediaPopoverTarget"), Ce = ["data-tpl-theme"], we =
|
|
|
1504
1506
|
},
|
|
1505
1507
|
disabled: e.isImporting,
|
|
1506
1508
|
onClick: v
|
|
1507
|
-
}, D(k(i).mediaLibrary.cancel), 11,
|
|
1509
|
+
}, D(k(i).mediaLibrary.cancel), 11, rn), f("button", {
|
|
1508
1510
|
class: "tpl:cursor-pointer tpl:rounded-md tpl:px-3 tpl:py-1.5 tpl:text-xs tpl:font-medium tpl:text-white tpl:transition-all tpl:duration-150 tpl:disabled:cursor-not-allowed tpl:disabled:opacity-50",
|
|
1509
1511
|
style: { background: "linear-gradient(\n 135deg,\n var(--tpl-primary),\n var(--tpl-primary-hover)\n )" },
|
|
1510
1512
|
disabled: !h.value.trim() || e.isImporting,
|
|
1511
1513
|
onClick: g
|
|
1512
|
-
}, [e.isImporting ? (S(), d("span",
|
|
1514
|
+
}, [e.isImporting ? (S(), d("span", on, [m(k(W), {
|
|
1513
1515
|
class: "tpl:animate-spin",
|
|
1514
1516
|
size: 12,
|
|
1515
1517
|
"stroke-width": 2
|
|
1516
|
-
}), p(" " + D(k(i).mediaLibrary.importing), 1)])) : (S(), d("span",
|
|
1517
|
-
])], 40,
|
|
1518
|
+
}), p(" " + D(k(i).mediaLibrary.importing), 1)])) : (S(), d("span", sn, D(k(i).mediaLibrary.import), 1))], 8, an)])
|
|
1519
|
+
])], 40, Xt)) : u("", !0)]),
|
|
1518
1520
|
_: 1
|
|
1519
1521
|
})], 8, ["to"]));
|
|
1520
1522
|
}
|
|
1521
|
-
}),
|
|
1523
|
+
}), ln = { class: "tpl:max-h-56 tpl:overflow-y-auto tpl:py-1" }, un = ["disabled", "onClick"], dn = { class: "tpl:truncate" }, fn = {
|
|
1522
1524
|
key: 0,
|
|
1523
1525
|
class: "tpl:shrink-0",
|
|
1524
1526
|
style: { color: "var(--tpl-text-dim)" }
|
|
1525
|
-
},
|
|
1527
|
+
}, pn = /* @__PURE__ */ h({
|
|
1526
1528
|
__name: "MediaMovePicker",
|
|
1527
1529
|
props: {
|
|
1528
1530
|
folders: {},
|
|
@@ -1530,7 +1532,7 @@ var Se = Symbol("templaticalMediaPopoverTarget"), Ce = ["data-tpl-theme"], we =
|
|
|
1530
1532
|
},
|
|
1531
1533
|
emits: ["select", "close"],
|
|
1532
1534
|
setup(e, { emit: t }) {
|
|
1533
|
-
let n = t, { t: r } =
|
|
1535
|
+
let n = t, { t: r } = X(), a = w(null);
|
|
1534
1536
|
function o(e, t = 0) {
|
|
1535
1537
|
let n = [];
|
|
1536
1538
|
for (let r of e) n.push({
|
|
@@ -1540,7 +1542,7 @@ var Se = Symbol("templaticalMediaPopoverTarget"), Ce = ["data-tpl-theme"], we =
|
|
|
1540
1542
|
}), r.children?.length && n.push(...o(r.children, t + 1));
|
|
1541
1543
|
return n;
|
|
1542
1544
|
}
|
|
1543
|
-
return
|
|
1545
|
+
return ae(a, () => {
|
|
1544
1546
|
n("close");
|
|
1545
1547
|
}), (t, s) => (S(), d("div", {
|
|
1546
1548
|
ref_key: "pickerRef",
|
|
@@ -1550,7 +1552,7 @@ var Se = Symbol("templaticalMediaPopoverTarget"), Ce = ["data-tpl-theme"], we =
|
|
|
1550
1552
|
"border-color": "var(--tpl-border)",
|
|
1551
1553
|
"background-color": "var(--tpl-bg-elevated)"
|
|
1552
1554
|
}
|
|
1553
|
-
}, [f("div",
|
|
1555
|
+
}, [f("div", ln, [e.currentFolderId === null ? u("", !0) : (S(), d("button", {
|
|
1554
1556
|
key: 0,
|
|
1555
1557
|
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",
|
|
1556
1558
|
style: { color: "var(--tpl-text)" },
|
|
@@ -1575,27 +1577,27 @@ var Se = Symbol("templaticalMediaPopoverTarget"), Ce = ["data-tpl-theme"], we =
|
|
|
1575
1577
|
size: 14,
|
|
1576
1578
|
"stroke-width": 1.5
|
|
1577
1579
|
}),
|
|
1578
|
-
f("span",
|
|
1579
|
-
t.id === e.currentFolderId ? (S(), d("span",
|
|
1580
|
-
], 12,
|
|
1580
|
+
f("span", dn, D(t.name), 1),
|
|
1581
|
+
t.id === e.currentFolderId ? (S(), d("span", fn, D(k(r).mediaLibrary.currentFolder), 1)) : u("", !0)
|
|
1582
|
+
], 12, un))), 128))])], 512));
|
|
1581
1583
|
}
|
|
1582
|
-
}),
|
|
1584
|
+
}), mn = { class: "tpl:flex tpl:items-center tpl:gap-3" }, hn = ["src", "alt"], gn = {
|
|
1583
1585
|
key: 1,
|
|
1584
1586
|
class: "tpl:flex tpl:size-10 tpl:shrink-0 tpl:items-center tpl:justify-center tpl:overflow-hidden tpl:rounded",
|
|
1585
1587
|
style: { border: "1px solid var(--tpl-border)" }
|
|
1586
|
-
},
|
|
1588
|
+
}, _n = { class: "tpl:min-w-0 tpl:flex-1" }, vn = {
|
|
1587
1589
|
class: "tpl:truncate tpl:text-xs tpl:font-medium",
|
|
1588
1590
|
style: { color: "var(--tpl-text)" }
|
|
1589
|
-
},
|
|
1591
|
+
}, yn = {
|
|
1590
1592
|
class: "tpl:mt-0.5 tpl:text-[10px]",
|
|
1591
1593
|
style: { color: "var(--tpl-text-muted)" }
|
|
1592
|
-
},
|
|
1594
|
+
}, bn = {
|
|
1593
1595
|
key: 2,
|
|
1594
1596
|
class: "tpl:shrink-0"
|
|
1595
|
-
},
|
|
1597
|
+
}, xn = {
|
|
1596
1598
|
class: "tpl:block tpl:text-[10px]",
|
|
1597
1599
|
style: { color: "var(--tpl-text-muted)" }
|
|
1598
|
-
},
|
|
1600
|
+
}, Sn = ["value"], Cn = ["value"], wn = /*#__PURE__*/ at(/* @__PURE__ */ h({
|
|
1599
1601
|
__name: "MediaPreviewPanel",
|
|
1600
1602
|
props: {
|
|
1601
1603
|
item: {},
|
|
@@ -1604,7 +1606,7 @@ var Se = Symbol("templaticalMediaPopoverTarget"), Ce = ["data-tpl-theme"], we =
|
|
|
1604
1606
|
},
|
|
1605
1607
|
emits: ["update:selectedConversion"],
|
|
1606
1608
|
setup(e, { emit: t }) {
|
|
1607
|
-
let n = e, r = t, { t: a } =
|
|
1609
|
+
let n = e, r = t, { t: a } = X(), { isImageMimeType: o } = Z(), c = s(() => {
|
|
1608
1610
|
if (!b.value || !n.item.conversions_generated) return [];
|
|
1609
1611
|
let e = [];
|
|
1610
1612
|
return n.item.small_url && e.push({
|
|
@@ -1663,20 +1665,20 @@ var Se = Symbol("templaticalMediaPopoverTarget"), Ce = ["data-tpl-theme"], we =
|
|
|
1663
1665
|
day: "numeric"
|
|
1664
1666
|
});
|
|
1665
1667
|
}
|
|
1666
|
-
return (t, n) => (S(), d("div",
|
|
1668
|
+
return (t, n) => (S(), d("div", mn, [
|
|
1667
1669
|
b.value ? (S(), d("img", {
|
|
1668
1670
|
key: 0,
|
|
1669
1671
|
src: h.value ?? void 0,
|
|
1670
1672
|
alt: e.item.alt_text || e.item.filename,
|
|
1671
1673
|
class: "tpl:size-10 tpl:shrink-0 tpl:rounded tpl:object-cover",
|
|
1672
1674
|
style: { border: "1px solid var(--tpl-border)" }
|
|
1673
|
-
}, null, 8,
|
|
1675
|
+
}, null, 8, hn)) : (S(), d("div", gn, [m(bt, {
|
|
1674
1676
|
"mime-type": e.item.mime_type,
|
|
1675
1677
|
class: "tpl-preview-icon"
|
|
1676
1678
|
}, null, 8, ["mime-type"])])),
|
|
1677
|
-
f("div",
|
|
1678
|
-
f("p",
|
|
1679
|
-
f("p",
|
|
1679
|
+
f("div", _n, [
|
|
1680
|
+
f("p", vn, D(e.item.filename), 1),
|
|
1681
|
+
f("p", yn, [
|
|
1680
1682
|
p(D(x(e.item.size)) + " · " + D(C(e.item.created_at)) + " ", 1),
|
|
1681
1683
|
b.value && e.item.width && e.item.height ? (S(), d(i, { key: 0 }, [p(" · " + D(e.item.width) + "×" + D(e.item.height) + "px ", 1)], 64)) : u("", !0),
|
|
1682
1684
|
v.value ? (S(), d(i, { key: 1 }, [
|
|
@@ -1695,7 +1697,7 @@ var Se = Symbol("templaticalMediaPopoverTarget"), Ce = ["data-tpl-theme"], we =
|
|
|
1695
1697
|
style: { color: "var(--tpl-text-dim)" }
|
|
1696
1698
|
}, D(e.item.alt_text || "\xA0"), 3)) : u("", !0)
|
|
1697
1699
|
]),
|
|
1698
|
-
l.value ? (S(), d("div",
|
|
1700
|
+
l.value ? (S(), d("div", bn, [f("label", xn, D(k(a).mediaLibrary.conversionLabel), 1), f("select", {
|
|
1699
1701
|
class: "tpl:mt-0.5 tpl:rounded-md tpl:border tpl:py-1 tpl:pr-6 tpl:pl-2 tpl:text-xs tpl:outline-none",
|
|
1700
1702
|
style: {
|
|
1701
1703
|
"border-color": "var(--tpl-border)",
|
|
@@ -1707,36 +1709,36 @@ var Se = Symbol("templaticalMediaPopoverTarget"), Ce = ["data-tpl-theme"], we =
|
|
|
1707
1709
|
}, [(S(!0), d(i, null, T(c.value, (e) => (S(), d("option", {
|
|
1708
1710
|
key: e.value,
|
|
1709
1711
|
value: e.value
|
|
1710
|
-
}, D(e.label), 9,
|
|
1712
|
+
}, D(e.label), 9, Cn))), 128))], 40, Sn)])) : u("", !0)
|
|
1711
1713
|
]));
|
|
1712
1714
|
}
|
|
1713
|
-
}), [["__scopeId", "data-v-060e36cd"]]),
|
|
1715
|
+
}), [["__scopeId", "data-v-060e36cd"]]), Tn = ["data-tpl-theme"], En = {
|
|
1714
1716
|
class: "tpl:mx-4 tpl:w-full tpl:max-w-sm tpl:rounded-lg tpl:p-5 tpl:shadow-xl",
|
|
1715
1717
|
style: { "background-color": "var(--tpl-bg-elevated)" }
|
|
1716
|
-
},
|
|
1718
|
+
}, Dn = {
|
|
1717
1719
|
class: "tpl:mb-2 tpl:text-sm tpl:font-semibold",
|
|
1718
1720
|
style: { color: "var(--tpl-text)" }
|
|
1719
|
-
},
|
|
1721
|
+
}, On = {
|
|
1720
1722
|
class: "tpl:mb-2 tpl:text-xs",
|
|
1721
1723
|
style: { color: "var(--tpl-text-muted)" }
|
|
1722
|
-
},
|
|
1724
|
+
}, kn = {
|
|
1723
1725
|
key: 0,
|
|
1724
1726
|
class: "tpl:mb-3 tpl:text-xs",
|
|
1725
1727
|
style: { color: "var(--tpl-warning)" }
|
|
1726
|
-
},
|
|
1728
|
+
}, An = {
|
|
1727
1729
|
class: "tpl:mb-3 tpl:rounded tpl:border tpl:p-2",
|
|
1728
1730
|
style: { "border-color": "var(--tpl-border)" }
|
|
1729
|
-
},
|
|
1731
|
+
}, jn = {
|
|
1730
1732
|
class: "tpl:truncate tpl:text-xs tpl:font-medium",
|
|
1731
1733
|
style: { color: "var(--tpl-text)" }
|
|
1732
|
-
},
|
|
1734
|
+
}, Mn = { class: "tpl:mb-4" }, Nn = {
|
|
1733
1735
|
class: "tpl:mb-1 tpl:block tpl:text-xs tpl:font-medium",
|
|
1734
1736
|
style: { color: "var(--tpl-text-muted)" }
|
|
1735
|
-
},
|
|
1737
|
+
}, Pn = ["accept"], Fn = {
|
|
1736
1738
|
key: 1,
|
|
1737
1739
|
class: "tpl:mb-3 tpl:text-xs",
|
|
1738
1740
|
style: { color: "var(--tpl-danger)" }
|
|
1739
|
-
},
|
|
1741
|
+
}, In = { class: "tpl:flex tpl:justify-end tpl:gap-2" }, Ln = ["disabled"], Rn = ["disabled"], zn = /* @__PURE__ */ h({
|
|
1740
1742
|
__name: "MediaReplaceModal",
|
|
1741
1743
|
props: {
|
|
1742
1744
|
visible: { type: Boolean },
|
|
@@ -1747,7 +1749,7 @@ var Se = Symbol("templaticalMediaPopoverTarget"), Ce = ["data-tpl-theme"], we =
|
|
|
1747
1749
|
},
|
|
1748
1750
|
emits: ["replace", "close"],
|
|
1749
1751
|
setup(e, { emit: t }) {
|
|
1750
|
-
let n = e, r = t, { t: i } =
|
|
1752
|
+
let n = e, r = t, { t: i } = X(), c = _("tplUiTheme"), p = _(ye, w(null)), h = w(null), g = w(null), v = s(() => {
|
|
1751
1753
|
if (!n.item) return "";
|
|
1752
1754
|
let e = n.item.filename.split(".");
|
|
1753
1755
|
return e.length > 1 ? e[e.length - 1].toLowerCase() : "";
|
|
@@ -1780,12 +1782,12 @@ var Se = Symbol("templaticalMediaPopoverTarget"), Ce = ["data-tpl-theme"], we =
|
|
|
1780
1782
|
style: { "background-color": "var(--tpl-overlay)" },
|
|
1781
1783
|
onClick: n[1] ||= F((e) => r("close"), ["self"]),
|
|
1782
1784
|
onKeydown: T
|
|
1783
|
-
}, [f("div",
|
|
1784
|
-
f("h3",
|
|
1785
|
-
f("p",
|
|
1786
|
-
b.value ? (S(), d("p",
|
|
1787
|
-
f("div",
|
|
1788
|
-
f("div",
|
|
1785
|
+
}, [f("div", En, [
|
|
1786
|
+
f("h3", Dn, D(k(i).mediaLibrary.replaceWarningTitle), 1),
|
|
1787
|
+
f("p", On, D(k(i).mediaLibrary.replaceWarningMessage.replace("{extension}", `.${v.value}`)), 1),
|
|
1788
|
+
b.value ? (S(), d("p", kn, D(k(i).mediaLibrary.replaceWarningUsageNote.replace("{count}", e.usageInfo.template_count.toString())), 1)) : u("", !0),
|
|
1789
|
+
f("div", An, [f("p", jn, D(e.item.filename), 1)]),
|
|
1790
|
+
f("div", Mn, [f("label", Nn, D(k(i).mediaLibrary.replaceSelectFile), 1), f("input", {
|
|
1789
1791
|
ref_key: "fileInputRef",
|
|
1790
1792
|
ref: h,
|
|
1791
1793
|
type: "file",
|
|
@@ -1797,9 +1799,9 @@ var Se = Symbol("templaticalMediaPopoverTarget"), Ce = ["data-tpl-theme"], we =
|
|
|
1797
1799
|
color: "var(--tpl-text)"
|
|
1798
1800
|
},
|
|
1799
1801
|
onChange: x
|
|
1800
|
-
}, null, 40,
|
|
1801
|
-
e.error ? (S(), d("p",
|
|
1802
|
-
f("div",
|
|
1802
|
+
}, null, 40, Pn)]),
|
|
1803
|
+
e.error ? (S(), d("p", Fn, D(e.error), 1)) : u("", !0),
|
|
1804
|
+
f("div", In, [f("button", {
|
|
1803
1805
|
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",
|
|
1804
1806
|
style: {
|
|
1805
1807
|
"border-color": "var(--tpl-border)",
|
|
@@ -1808,29 +1810,29 @@ var Se = Symbol("templaticalMediaPopoverTarget"), Ce = ["data-tpl-theme"], we =
|
|
|
1808
1810
|
},
|
|
1809
1811
|
disabled: e.isReplacing,
|
|
1810
1812
|
onClick: n[0] ||= (e) => r("close")
|
|
1811
|
-
}, D(k(i).mediaLibrary.cancel), 9,
|
|
1813
|
+
}, D(k(i).mediaLibrary.cancel), 9, Ln), f("button", {
|
|
1812
1814
|
class: "tpl:cursor-pointer tpl:rounded-md tpl:px-3 tpl:py-1.5 tpl:text-xs tpl:font-medium tpl:text-white tpl:transition-all tpl:duration-150 tpl:disabled:cursor-not-allowed tpl:disabled:opacity-50",
|
|
1813
1815
|
style: { background: "linear-gradient(\n 135deg,\n var(--tpl-primary),\n var(--tpl-primary-hover)\n )" },
|
|
1814
1816
|
disabled: !g.value || e.isReplacing,
|
|
1815
1817
|
onClick: C
|
|
1816
|
-
}, D(e.isReplacing ? k(i).mediaLibrary.replacing : k(i).mediaLibrary.replace), 9,
|
|
1817
|
-
])], 40,
|
|
1818
|
+
}, D(e.isReplacing ? k(i).mediaLibrary.replacing : k(i).mediaLibrary.replace), 9, Rn)])
|
|
1819
|
+
])], 40, Tn)) : u("", !0)]),
|
|
1818
1820
|
_: 1
|
|
1819
1821
|
})], 8, ["to"]));
|
|
1820
1822
|
}
|
|
1821
|
-
}),
|
|
1823
|
+
}), Bn = {
|
|
1822
1824
|
key: 0,
|
|
1823
1825
|
class: "tpl:flex tpl:items-center tpl:gap-2"
|
|
1824
|
-
},
|
|
1826
|
+
}, Vn = {
|
|
1825
1827
|
class: "tpl:text-xs",
|
|
1826
1828
|
style: { color: "var(--tpl-text-muted)" }
|
|
1827
|
-
},
|
|
1829
|
+
}, Hn = {
|
|
1828
1830
|
class: "tpl:text-xs",
|
|
1829
1831
|
style: { color: "var(--tpl-text-muted)" }
|
|
1830
|
-
},
|
|
1832
|
+
}, Un = {
|
|
1831
1833
|
class: "tpl:mt-1 tpl:text-[10px]",
|
|
1832
1834
|
style: { color: "var(--tpl-text-dim)" }
|
|
1833
|
-
},
|
|
1835
|
+
}, Wn = /* @__PURE__ */ h({
|
|
1834
1836
|
__name: "MediaUploadZone",
|
|
1835
1837
|
props: {
|
|
1836
1838
|
isUploading: { type: Boolean },
|
|
@@ -1838,7 +1840,7 @@ var Se = Symbol("templaticalMediaPopoverTarget"), Ce = ["data-tpl-theme"], we =
|
|
|
1838
1840
|
},
|
|
1839
1841
|
emits: ["upload"],
|
|
1840
1842
|
setup(e, { emit: t }) {
|
|
1841
|
-
let n = t, { t: r, format: a } =
|
|
1843
|
+
let n = t, { t: r, format: a } = X(), { allAcceptedMimeTypes: o, allAcceptedInputString: s, maxFileSize: c } = Z(), l = w();
|
|
1842
1844
|
function u(e) {
|
|
1843
1845
|
let t = [];
|
|
1844
1846
|
for (let n of Array.from(e)) o.value.includes(n.type) && n.size <= c.value && t.push(n);
|
|
@@ -1848,9 +1850,9 @@ var Se = Symbol("templaticalMediaPopoverTarget"), Ce = ["data-tpl-theme"], we =
|
|
|
1848
1850
|
let t = u(e);
|
|
1849
1851
|
t.length && n("upload", t);
|
|
1850
1852
|
}
|
|
1851
|
-
let { isOverDropZone: h } =
|
|
1853
|
+
let { isOverDropZone: h } = ce(l, { onDrop: (e) => {
|
|
1852
1854
|
e?.length && p(e);
|
|
1853
|
-
} }), { open: g, onChange: _ } =
|
|
1855
|
+
} }), { open: g, onChange: _ } = ue({
|
|
1854
1856
|
accept: s.value,
|
|
1855
1857
|
multiple: !0
|
|
1856
1858
|
});
|
|
@@ -1865,35 +1867,35 @@ var Se = Symbol("templaticalMediaPopoverTarget"), Ce = ["data-tpl-theme"], we =
|
|
|
1865
1867
|
"background-color": "var(--tpl-bg)"
|
|
1866
1868
|
},
|
|
1867
1869
|
onClick: n[0] ||= (e) => k(g)()
|
|
1868
|
-
}, [e.isUploading ? (S(), d("div",
|
|
1870
|
+
}, [e.isUploading ? (S(), d("div", Bn, [m(k(W), {
|
|
1869
1871
|
class: "tpl-spinner",
|
|
1870
1872
|
size: 20,
|
|
1871
1873
|
"stroke-width": 2,
|
|
1872
1874
|
style: { color: "var(--tpl-primary)" }
|
|
1873
|
-
}), f("span",
|
|
1875
|
+
}), f("span", Vn, D(e.uploadProgress && e.uploadProgress.total > 1 ? k(a)(k(r).mediaLibrary.uploadingProgress, {
|
|
1874
1876
|
current: e.uploadProgress.current,
|
|
1875
1877
|
total: e.uploadProgress.total
|
|
1876
1878
|
}) : k(r).mediaLibrary.uploading), 1)])) : (S(), d(i, { key: 1 }, [
|
|
1877
|
-
m(k(
|
|
1879
|
+
m(k(ne), {
|
|
1878
1880
|
class: "tpl:mb-2",
|
|
1879
1881
|
size: 24,
|
|
1880
1882
|
"stroke-width": 1.5,
|
|
1881
1883
|
style: { color: "var(--tpl-text-dim)" }
|
|
1882
1884
|
}),
|
|
1883
|
-
f("p",
|
|
1884
|
-
f("p",
|
|
1885
|
+
f("p", Hn, D(k(r).mediaLibrary.dropOrClick), 1),
|
|
1886
|
+
f("p", Un, D(k(r).mediaLibrary.acceptedFormats), 1)
|
|
1885
1887
|
], 64))], 2));
|
|
1886
1888
|
}
|
|
1887
|
-
}),
|
|
1889
|
+
}), Gn = [
|
|
1888
1890
|
"width",
|
|
1889
1891
|
"height",
|
|
1890
1892
|
"viewBox"
|
|
1891
|
-
],
|
|
1893
|
+
], Kn = [
|
|
1892
1894
|
"cx",
|
|
1893
1895
|
"cy",
|
|
1894
1896
|
"r",
|
|
1895
1897
|
"stroke-width"
|
|
1896
|
-
],
|
|
1898
|
+
], qn = [
|
|
1897
1899
|
"cx",
|
|
1898
1900
|
"cy",
|
|
1899
1901
|
"r",
|
|
@@ -1901,14 +1903,14 @@ var Se = Symbol("templaticalMediaPopoverTarget"), Ce = ["data-tpl-theme"], we =
|
|
|
1901
1903
|
"stroke",
|
|
1902
1904
|
"stroke-dasharray",
|
|
1903
1905
|
"stroke-dashoffset"
|
|
1904
|
-
],
|
|
1906
|
+
], Jn = {
|
|
1905
1907
|
key: 0,
|
|
1906
1908
|
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",
|
|
1907
1909
|
style: {
|
|
1908
1910
|
"background-color": "var(--tpl-text)",
|
|
1909
1911
|
color: "var(--tpl-bg-elevated)"
|
|
1910
1912
|
}
|
|
1911
|
-
},
|
|
1913
|
+
}, Yn = /* @__PURE__ */ h({
|
|
1912
1914
|
__name: "StorageProgressRing",
|
|
1913
1915
|
props: {
|
|
1914
1916
|
usedBytes: {},
|
|
@@ -1916,7 +1918,7 @@ var Se = Symbol("templaticalMediaPopoverTarget"), Ce = ["data-tpl-theme"], we =
|
|
|
1916
1918
|
size: {}
|
|
1917
1919
|
},
|
|
1918
1920
|
setup(e) {
|
|
1919
|
-
let t = e, { t: n, format: r } =
|
|
1921
|
+
let t = e, { t: n, format: r } = X(), i = w(!1), a = s(() => t.size ?? 24), c = s(() => Math.max(2, a.value / 8)), l = s(() => (a.value - c.value) / 2), h = s(() => 2 * Math.PI * l.value), g = s(() => t.limitBytes <= 0 ? 0 : Math.min(100, t.usedBytes / t.limitBytes * 100)), _ = s(() => h.value - g.value / 100 * h.value), v = s(() => g.value >= 95 ? "var(--tpl-danger)" : g.value >= 75 ? "var(--tpl-warning, #f59e0b)" : "var(--tpl-primary)");
|
|
1920
1922
|
function y(e) {
|
|
1921
1923
|
if (e === 0) return "0 B";
|
|
1922
1924
|
let t = 1024, n = [
|
|
@@ -1948,7 +1950,7 @@ var Se = Symbol("templaticalMediaPopoverTarget"), Ce = ["data-tpl-theme"], we =
|
|
|
1948
1950
|
fill: "none",
|
|
1949
1951
|
"stroke-width": c.value,
|
|
1950
1952
|
style: { stroke: "var(--tpl-border)" }
|
|
1951
|
-
}, null, 8,
|
|
1953
|
+
}, null, 8, Kn), f("circle", {
|
|
1952
1954
|
cx: a.value / 2,
|
|
1953
1955
|
cy: a.value / 2,
|
|
1954
1956
|
r: l.value,
|
|
@@ -1959,7 +1961,7 @@ var Se = Symbol("templaticalMediaPopoverTarget"), Ce = ["data-tpl-theme"], we =
|
|
|
1959
1961
|
"stroke-dasharray": h.value,
|
|
1960
1962
|
"stroke-dashoffset": _.value,
|
|
1961
1963
|
class: "tpl:transition-all tpl:duration-300 tpl:ease-out"
|
|
1962
|
-
}, null, 8,
|
|
1964
|
+
}, null, 8, qn)], 8, Gn)), m(o, {
|
|
1963
1965
|
"enter-active-class": "tpl:transition tpl:ease-out tpl:duration-150",
|
|
1964
1966
|
"enter-from-class": "tpl:opacity-0 tpl:translate-y-1",
|
|
1965
1967
|
"enter-to-class": "tpl:opacity-100 tpl:translate-y-0",
|
|
@@ -1967,7 +1969,7 @@ var Se = Symbol("templaticalMediaPopoverTarget"), Ce = ["data-tpl-theme"], we =
|
|
|
1967
1969
|
"leave-from-class": "tpl:opacity-100 tpl:translate-y-0",
|
|
1968
1970
|
"leave-to-class": "tpl:opacity-0 tpl:translate-y-1"
|
|
1969
1971
|
}, {
|
|
1970
|
-
default: M(() => [i.value ? (S(), d("div",
|
|
1972
|
+
default: M(() => [i.value ? (S(), d("div", Jn, [p(D(E.value) + " ", 1), t[2] ||= f("div", {
|
|
1971
1973
|
class: "tpl:absolute tpl:-top-1 tpl:left-1/2 tpl:size-2 tpl:-translate-x-1/2 tpl:rotate-45",
|
|
1972
1974
|
style: { "background-color": "var(--tpl-text)" }
|
|
1973
1975
|
}, null, -1)])) : u("", !0)]),
|
|
@@ -1977,117 +1979,117 @@ var Se = Symbol("templaticalMediaPopoverTarget"), Ce = ["data-tpl-theme"], we =
|
|
|
1977
1979
|
});
|
|
1978
1980
|
//#endregion
|
|
1979
1981
|
//#region src/composables/useMediaLibraryUI.ts
|
|
1980
|
-
function
|
|
1981
|
-
let { library: t,
|
|
1982
|
-
function
|
|
1983
|
-
return "value" in
|
|
1982
|
+
function Xn(e) {
|
|
1983
|
+
let { library: t, translations: n } = e;
|
|
1984
|
+
function r() {
|
|
1985
|
+
return "value" in n && typeof n.value == "object" ? n.value : n;
|
|
1984
1986
|
}
|
|
1985
|
-
let
|
|
1987
|
+
let i = w("grid"), a = w(!1), o = w(""), c = w("original"), l = w(null), u = w(!1), d = w(!1), f = s(() => {
|
|
1986
1988
|
let e = t.previewItem.value;
|
|
1987
1989
|
if (!e) return null;
|
|
1988
|
-
switch (
|
|
1990
|
+
switch (c.value) {
|
|
1989
1991
|
case "small": return e.small_url || e.url;
|
|
1990
1992
|
case "medium": return e.medium_url || e.url;
|
|
1991
1993
|
case "large": return e.large_url || e.url;
|
|
1992
1994
|
default: return e.url;
|
|
1993
1995
|
}
|
|
1994
|
-
}),
|
|
1995
|
-
images: () =>
|
|
1996
|
-
documents: () =>
|
|
1997
|
-
videos: () =>
|
|
1998
|
-
audio: () =>
|
|
1996
|
+
}), p = s(() => t.frequentlyUsedItems.value.length > 0), m = s(() => t.viewMode.value === "frequently-used" ? t.frequentlyUsedItems.value : t.items.value), h = s(() => Object.values(t.deleteUsageInfo.value).some((e) => e.template_count > 0)), g = {
|
|
1997
|
+
images: () => r().mediaLibrary.filterImages,
|
|
1998
|
+
documents: () => r().mediaLibrary.filterDocuments,
|
|
1999
|
+
videos: () => r().mediaLibrary.filterVideos,
|
|
2000
|
+
audio: () => r().mediaLibrary.filterAudio
|
|
1999
2001
|
};
|
|
2000
|
-
function
|
|
2001
|
-
return
|
|
2002
|
+
function _(e) {
|
|
2003
|
+
return g[e]?.() ?? e;
|
|
2002
2004
|
}
|
|
2003
|
-
j(
|
|
2004
|
-
e &&
|
|
2005
|
+
j(a, (e) => {
|
|
2006
|
+
e && t.loadFolders();
|
|
2005
2007
|
}), j(() => t.previewItem.value?.id, () => {
|
|
2006
|
-
|
|
2008
|
+
c.value = "original";
|
|
2007
2009
|
});
|
|
2008
|
-
let
|
|
2010
|
+
let v = se((e) => {
|
|
2009
2011
|
t.search(e);
|
|
2010
2012
|
}, 300);
|
|
2011
|
-
function
|
|
2012
|
-
|
|
2013
|
+
function y(e) {
|
|
2014
|
+
o.value = e, v(e);
|
|
2013
2015
|
}
|
|
2014
|
-
let { copy:
|
|
2016
|
+
let { copy: b, copied: x } = oe({
|
|
2015
2017
|
copiedDuring: 2e3,
|
|
2016
2018
|
legacy: !0
|
|
2017
2019
|
});
|
|
2018
|
-
async function
|
|
2020
|
+
async function S(e) {
|
|
2019
2021
|
await t.uploadFiles(e);
|
|
2020
2022
|
}
|
|
2021
|
-
function
|
|
2023
|
+
function C(e) {
|
|
2022
2024
|
t.selectItem(e);
|
|
2023
2025
|
}
|
|
2024
|
-
async function
|
|
2026
|
+
async function T(e, n) {
|
|
2025
2027
|
await t.createFolder(e, n);
|
|
2026
2028
|
}
|
|
2027
|
-
async function
|
|
2029
|
+
async function E(e, n) {
|
|
2028
2030
|
await t.renameFolder(e, n);
|
|
2029
2031
|
}
|
|
2030
|
-
async function
|
|
2032
|
+
async function D(e) {
|
|
2031
2033
|
await t.deleteFolder(e);
|
|
2032
2034
|
}
|
|
2033
|
-
function
|
|
2034
|
-
|
|
2035
|
+
function O(e) {
|
|
2036
|
+
l.value = e;
|
|
2035
2037
|
}
|
|
2036
|
-
async function
|
|
2037
|
-
i && await t.replaceMediaDirectly(e, i.file), await t.updateFile(e, n, r),
|
|
2038
|
+
async function k(e, n, r, i) {
|
|
2039
|
+
i && await t.replaceMediaDirectly(e, i.file), await t.updateFile(e, n, r), l.value = null;
|
|
2038
2040
|
}
|
|
2039
|
-
async function
|
|
2040
|
-
await t.importFromUrl(e) && (
|
|
2041
|
+
async function A(e) {
|
|
2042
|
+
await t.importFromUrl(e) && (u.value = !1);
|
|
2041
2043
|
}
|
|
2042
|
-
async function
|
|
2043
|
-
|
|
2044
|
+
async function M(e) {
|
|
2045
|
+
d.value = !1, await t.moveSelected(e);
|
|
2044
2046
|
}
|
|
2045
|
-
async function
|
|
2047
|
+
async function N() {
|
|
2046
2048
|
await t.checkUsageBeforeDelete();
|
|
2047
2049
|
}
|
|
2048
|
-
function
|
|
2050
|
+
function P(e) {
|
|
2049
2051
|
t.checkUsageBeforeReplace(e);
|
|
2050
2052
|
}
|
|
2051
|
-
async function
|
|
2053
|
+
async function F(e) {
|
|
2052
2054
|
await t.replaceFile(e);
|
|
2053
2055
|
}
|
|
2054
|
-
function
|
|
2055
|
-
t.clearSelection(), t.cancelDelete(), t.cancelReplace(),
|
|
2056
|
+
function I() {
|
|
2057
|
+
t.clearSelection(), t.cancelDelete(), t.cancelReplace(), o.value = "", t.categoryFilter.value = null, t.sortOption.value = "newest", t.viewMode.value = "files", l.value = null, u.value = !1, c.value = "original";
|
|
2056
2058
|
}
|
|
2057
2059
|
return {
|
|
2058
|
-
layoutMode:
|
|
2059
|
-
showSidebar:
|
|
2060
|
-
searchInput:
|
|
2061
|
-
selectedConversion:
|
|
2062
|
-
editingItem:
|
|
2063
|
-
showImportUrlModal:
|
|
2064
|
-
showMovePicker:
|
|
2065
|
-
selectedUrl:
|
|
2066
|
-
hasFrequentlyUsed:
|
|
2067
|
-
displayItems:
|
|
2068
|
-
hasUsedFiles:
|
|
2069
|
-
copy:
|
|
2070
|
-
copied:
|
|
2071
|
-
getCategoryLabel:
|
|
2072
|
-
handleSearchInput:
|
|
2073
|
-
handleUpload:
|
|
2074
|
-
handleSelect:
|
|
2075
|
-
handleCreateFolder:
|
|
2076
|
-
handleRenameFolder:
|
|
2077
|
-
handleDeleteFolder:
|
|
2078
|
-
handleEditItem:
|
|
2079
|
-
handleEditSave:
|
|
2080
|
-
handleImportFromUrl:
|
|
2081
|
-
handleMoveToFolder:
|
|
2082
|
-
handleDeleteClick:
|
|
2083
|
-
handleReplaceItem:
|
|
2084
|
-
handleReplaceFile:
|
|
2085
|
-
resetUI:
|
|
2060
|
+
layoutMode: i,
|
|
2061
|
+
showSidebar: a,
|
|
2062
|
+
searchInput: o,
|
|
2063
|
+
selectedConversion: c,
|
|
2064
|
+
editingItem: l,
|
|
2065
|
+
showImportUrlModal: u,
|
|
2066
|
+
showMovePicker: d,
|
|
2067
|
+
selectedUrl: f,
|
|
2068
|
+
hasFrequentlyUsed: p,
|
|
2069
|
+
displayItems: m,
|
|
2070
|
+
hasUsedFiles: h,
|
|
2071
|
+
copy: b,
|
|
2072
|
+
copied: x,
|
|
2073
|
+
getCategoryLabel: _,
|
|
2074
|
+
handleSearchInput: y,
|
|
2075
|
+
handleUpload: S,
|
|
2076
|
+
handleSelect: C,
|
|
2077
|
+
handleCreateFolder: T,
|
|
2078
|
+
handleRenameFolder: E,
|
|
2079
|
+
handleDeleteFolder: D,
|
|
2080
|
+
handleEditItem: O,
|
|
2081
|
+
handleEditSave: k,
|
|
2082
|
+
handleImportFromUrl: A,
|
|
2083
|
+
handleMoveToFolder: M,
|
|
2084
|
+
handleDeleteClick: N,
|
|
2085
|
+
handleReplaceItem: P,
|
|
2086
|
+
handleReplaceFile: F,
|
|
2087
|
+
resetUI: I
|
|
2086
2088
|
};
|
|
2087
2089
|
}
|
|
2088
2090
|
//#endregion
|
|
2089
2091
|
//#region src/components/MediaLibraryModal.vue?vue&type=script&setup=true&lang.ts
|
|
2090
|
-
var
|
|
2092
|
+
var Zn = ["data-tpl-theme"], Qn = {
|
|
2091
2093
|
class: "tpl-media-modal tpl-scale-in tpl:flex tpl:flex-col tpl:overflow-hidden tpl:rounded-[var(--tpl-radius-lg)]",
|
|
2092
2094
|
style: {
|
|
2093
2095
|
width: "900px",
|
|
@@ -2098,95 +2100,94 @@ var Yn = ["data-tpl-theme"], Xn = {
|
|
|
2098
2100
|
border: "1px solid var(--tpl-border)",
|
|
2099
2101
|
"box-shadow": "var(--tpl-shadow-xl)"
|
|
2100
2102
|
}
|
|
2101
|
-
},
|
|
2103
|
+
}, $n = {
|
|
2102
2104
|
class: "tpl:flex tpl:shrink-0 tpl:items-center tpl:justify-between tpl:border-b tpl:px-5 tpl:py-3.5",
|
|
2103
2105
|
style: { "border-color": "var(--tpl-border)" }
|
|
2104
|
-
},
|
|
2106
|
+
}, er = {
|
|
2105
2107
|
class: "tpl:text-sm tpl:font-semibold",
|
|
2106
2108
|
style: { color: "var(--tpl-text)" }
|
|
2107
|
-
},
|
|
2109
|
+
}, tr = { class: "tpl:flex tpl:items-center tpl:gap-3" }, nr = { class: "tpl:relative" }, rr = ["value", "placeholder"], ir = { class: "tpl:flex tpl:min-h-0 tpl:flex-1 tpl:overflow-hidden" }, ar = {
|
|
2108
2110
|
key: 0,
|
|
2109
2111
|
class: "tpl:flex tpl:w-48 tpl:shrink-0 tpl:flex-col tpl:border-r",
|
|
2110
2112
|
style: {
|
|
2111
2113
|
"border-color": "var(--tpl-border)",
|
|
2112
2114
|
"background-color": "var(--tpl-bg)"
|
|
2113
2115
|
}
|
|
2114
|
-
},
|
|
2116
|
+
}, or = { class: "tpl:flex tpl:min-w-0 tpl:flex-1 tpl:flex-col" }, sr = {
|
|
2115
2117
|
class: "tpl:flex tpl:shrink-0 tpl:items-center tpl:justify-between tpl:border-b tpl:px-4 tpl:py-2.5",
|
|
2116
2118
|
style: { "border-color": "var(--tpl-border)" }
|
|
2117
|
-
},
|
|
2118
|
-
key:
|
|
2119
|
+
}, cr = { class: "tpl:flex tpl:items-center tpl:gap-2" }, lr = ["title"], ur = {
|
|
2120
|
+
key: 0,
|
|
2119
2121
|
class: "tpl:text-xs tpl:font-medium",
|
|
2120
2122
|
style: { color: "var(--tpl-text)" }
|
|
2121
|
-
},
|
|
2123
|
+
}, dr = {
|
|
2122
2124
|
class: "tpl:flex tpl:rounded-md tpl:p-0.5",
|
|
2123
2125
|
style: {
|
|
2124
2126
|
border: "1px solid var(--tpl-border)",
|
|
2125
2127
|
"background-color": "var(--tpl-bg)"
|
|
2126
2128
|
}
|
|
2127
|
-
},
|
|
2129
|
+
}, fr = ["title"], pr = ["title"], mr = { class: "tpl:flex tpl:items-center tpl:gap-2" }, hr = ["value"], gr = { value: "" }, _r = ["value"], vr = ["value"], yr = { value: "newest" }, br = { value: "oldest" }, xr = { value: "name_asc" }, Sr = { value: "name_desc" }, Cr = { value: "size_asc" }, wr = { value: "size_desc" }, Tr = { class: "tpl:min-h-0 tpl:flex-1 tpl:overflow-y-auto" }, Er = {
|
|
2128
2130
|
key: 0,
|
|
2129
2131
|
class: "tpl:px-4 tpl:pt-3"
|
|
2130
|
-
},
|
|
2132
|
+
}, Dr = {
|
|
2131
2133
|
class: "tpl-scale-in tpl:mx-4 tpl:w-full tpl:max-w-sm tpl:rounded-[var(--tpl-radius-lg)] tpl:p-5",
|
|
2132
2134
|
style: {
|
|
2133
2135
|
"background-color": "var(--tpl-bg-elevated)",
|
|
2134
2136
|
"box-shadow": "var(--tpl-shadow-xl)"
|
|
2135
2137
|
}
|
|
2136
|
-
},
|
|
2138
|
+
}, Or = {
|
|
2137
2139
|
class: "tpl:mb-2 tpl:text-sm tpl:font-semibold",
|
|
2138
2140
|
style: { color: "var(--tpl-text)" }
|
|
2139
|
-
},
|
|
2141
|
+
}, kr = {
|
|
2140
2142
|
key: 0,
|
|
2141
2143
|
class: "tpl:mb-4 tpl:text-xs",
|
|
2142
2144
|
style: { color: "var(--tpl-text-muted)" }
|
|
2143
|
-
},
|
|
2145
|
+
}, Ar = {
|
|
2144
2146
|
key: 1,
|
|
2145
2147
|
class: "tpl:mb-4 tpl:max-h-32 tpl:overflow-y-auto tpl:rounded tpl:border tpl:p-2",
|
|
2146
2148
|
style: { "border-color": "var(--tpl-border)" }
|
|
2147
|
-
},
|
|
2149
|
+
}, jr = { class: "tpl:font-medium" }, Mr = { style: { color: "var(--tpl-text-muted)" } }, Nr = { class: "tpl:flex tpl:justify-end tpl:gap-2" }, Pr = {
|
|
2148
2150
|
class: "tpl:flex tpl:shrink-0 tpl:items-center tpl:justify-between tpl:border-t tpl:px-5 tpl:py-3",
|
|
2149
2151
|
style: { "border-color": "var(--tpl-border)" }
|
|
2150
|
-
},
|
|
2152
|
+
}, Fr = { class: "tpl:flex tpl:min-w-0 tpl:flex-1 tpl:items-center tpl:gap-3" }, Ir = { class: "tpl:flex tpl:items-center tpl:gap-5" }, Lr = {
|
|
2151
2153
|
key: 0,
|
|
2152
2154
|
class: "tpl:flex tpl:items-center tpl:gap-2"
|
|
2153
|
-
},
|
|
2154
|
-
key: 1,
|
|
2155
|
-
class: "tpl:relative"
|
|
2156
|
-
}, Lr = { class: "tpl:flex tpl:items-center tpl:gap-2" }, Rr = ["disabled"], zr = /* @__PURE__ */ h({
|
|
2155
|
+
}, Rr = { class: "tpl:relative" }, zr = { class: "tpl:flex tpl:items-center tpl:gap-2" }, Br = ["disabled"], Vr = /* @__PURE__ */ h({
|
|
2157
2156
|
__name: "MediaLibraryModal",
|
|
2158
2157
|
props: {
|
|
2159
2158
|
visible: { type: Boolean },
|
|
2160
2159
|
accept: {},
|
|
2160
|
+
authManager: {},
|
|
2161
|
+
projectId: {},
|
|
2162
|
+
planConfig: {},
|
|
2161
2163
|
popoverTarget: {}
|
|
2162
2164
|
},
|
|
2163
2165
|
emits: ["close", "select"],
|
|
2164
2166
|
setup(e, { emit: t }) {
|
|
2165
|
-
let n = e, r = t, { t: c } =
|
|
2166
|
-
C(
|
|
2167
|
-
let v =
|
|
2168
|
-
projectId:
|
|
2169
|
-
authManager:
|
|
2170
|
-
}),
|
|
2171
|
-
library:
|
|
2172
|
-
canUseMediaFolders: A,
|
|
2167
|
+
let n = e, r = t, { t: c } = X(), h = _("tplUiTheme"), g = O(() => n.popoverTarget ?? null);
|
|
2168
|
+
C(ye, g), C(ve, n.planConfig);
|
|
2169
|
+
let v = s(() => n.planConfig.config.value?.storage.used_bytes ?? 0), x = s(() => n.planConfig.config.value?.storage.limit_bytes ?? 0), { isAcceptedMimeType: w, availableCategories: E } = Z(), A = pe({
|
|
2170
|
+
projectId: n.projectId,
|
|
2171
|
+
authManager: n.authManager
|
|
2172
|
+
}), N = Xn({
|
|
2173
|
+
library: A,
|
|
2173
2174
|
translations: c
|
|
2174
2175
|
});
|
|
2175
2176
|
j(() => n.visible, (e) => {
|
|
2176
|
-
e ? (
|
|
2177
|
+
e ? (A.loadItems(), A.loadFrequentlyUsed()) : N.resetUI();
|
|
2177
2178
|
});
|
|
2178
|
-
function
|
|
2179
|
+
function P(e) {
|
|
2179
2180
|
e.key === "Escape" && r("close");
|
|
2180
2181
|
}
|
|
2181
|
-
|
|
2182
|
-
function
|
|
2183
|
-
return
|
|
2182
|
+
le(document, "keydown", P);
|
|
2183
|
+
function L() {
|
|
2184
|
+
return A.previewItem.value ? !n.accept?.length || w(A.previewItem.value.mime_type, n.accept) : !1;
|
|
2184
2185
|
}
|
|
2185
|
-
function
|
|
2186
|
-
if (
|
|
2187
|
-
let e =
|
|
2186
|
+
function z() {
|
|
2187
|
+
if (L()) {
|
|
2188
|
+
let e = A.previewItem.value, t = {
|
|
2188
2189
|
...e,
|
|
2189
|
-
url:
|
|
2190
|
+
url: N.selectedUrl.value || e.url
|
|
2190
2191
|
};
|
|
2191
2192
|
r("select", t), r("close");
|
|
2192
2193
|
}
|
|
@@ -2204,15 +2205,15 @@ var Yn = ["data-tpl-theme"], Xn = {
|
|
|
2204
2205
|
"data-tpl-theme": k(h),
|
|
2205
2206
|
class: "tpl tpl-media-overlay tpl:fixed tpl:inset-0 tpl:z-[9999]",
|
|
2206
2207
|
onClick: n[18] ||= F((e) => r("close"), ["self"])
|
|
2207
|
-
}, [f("div",
|
|
2208
|
-
f("div",
|
|
2209
|
-
m(
|
|
2210
|
-
"used-bytes":
|
|
2211
|
-
"limit-bytes":
|
|
2208
|
+
}, [f("div", Qn, [
|
|
2209
|
+
f("div", $n, [f("h2", er, D(k(c).mediaLibrary.title), 1), f("div", tr, [
|
|
2210
|
+
m(Yn, {
|
|
2211
|
+
"used-bytes": v.value,
|
|
2212
|
+
"limit-bytes": x.value,
|
|
2212
2213
|
size: 22
|
|
2213
2214
|
}, null, 8, ["used-bytes", "limit-bytes"]),
|
|
2214
|
-
f("div",
|
|
2215
|
-
value: k(
|
|
2215
|
+
f("div", nr, [f("input", {
|
|
2216
|
+
value: k(N).searchInput.value,
|
|
2216
2217
|
type: "text",
|
|
2217
2218
|
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)]",
|
|
2218
2219
|
style: {
|
|
@@ -2221,8 +2222,8 @@ var Yn = ["data-tpl-theme"], Xn = {
|
|
|
2221
2222
|
color: "var(--tpl-text)"
|
|
2222
2223
|
},
|
|
2223
2224
|
placeholder: k(c).mediaLibrary.searchPlaceholder,
|
|
2224
|
-
onInput: n[0] ||= (e) => k(
|
|
2225
|
-
}, null, 40,
|
|
2225
|
+
onInput: n[0] ||= (e) => k(N).handleSearchInput(e.target.value)
|
|
2226
|
+
}, null, 40, rr), m(k(J), {
|
|
2226
2227
|
class: "tpl:absolute tpl:top-1/2 tpl:left-2.5 tpl:-translate-y-1/2",
|
|
2227
2228
|
size: 13,
|
|
2228
2229
|
"stroke-width": 2,
|
|
@@ -2232,12 +2233,12 @@ var Yn = ["data-tpl-theme"], Xn = {
|
|
|
2232
2233
|
class: "tpl:flex tpl:size-7 tpl:items-center tpl:justify-center tpl:rounded-md tpl:transition-all tpl:duration-150",
|
|
2233
2234
|
style: { color: "var(--tpl-text-muted)" },
|
|
2234
2235
|
onClick: n[1] ||= (e) => r("close")
|
|
2235
|
-
}, [m(k(
|
|
2236
|
+
}, [m(k(re), {
|
|
2236
2237
|
size: 18,
|
|
2237
2238
|
"stroke-width": 2
|
|
2238
2239
|
})])
|
|
2239
2240
|
])]),
|
|
2240
|
-
f("div",
|
|
2241
|
+
f("div", ir, [m(o, {
|
|
2241
2242
|
"enter-active-class": "tpl:transition-all tpl:duration-200 tpl:ease-out",
|
|
2242
2243
|
"enter-from-class": "tpl:-ml-48 tpl:opacity-0",
|
|
2243
2244
|
"enter-to-class": "tpl:ml-0 tpl:opacity-100",
|
|
@@ -2245,16 +2246,16 @@ var Yn = ["data-tpl-theme"], Xn = {
|
|
|
2245
2246
|
"leave-from-class": "tpl:ml-0 tpl:opacity-100",
|
|
2246
2247
|
"leave-to-class": "tpl:-ml-48 tpl:opacity-0"
|
|
2247
2248
|
}, {
|
|
2248
|
-
default: M(() => [
|
|
2249
|
-
folders: k(
|
|
2250
|
-
"current-folder-id": k(
|
|
2251
|
-
"view-mode": k(
|
|
2252
|
-
"has-frequently-used": k(
|
|
2253
|
-
onNavigate: k(
|
|
2254
|
-
onCreateFolder: k(
|
|
2255
|
-
onRenameFolder: k(
|
|
2256
|
-
onDeleteFolder: k(
|
|
2257
|
-
onShowFrequentlyUsed: k(
|
|
2249
|
+
default: M(() => [k(N).showSidebar.value ? (S(), d("div", ar, [m(vt, {
|
|
2250
|
+
folders: k(A).folders.value,
|
|
2251
|
+
"current-folder-id": k(A).currentFolderId.value,
|
|
2252
|
+
"view-mode": k(A).viewMode.value,
|
|
2253
|
+
"has-frequently-used": k(N).hasFrequentlyUsed.value,
|
|
2254
|
+
onNavigate: k(A).navigateToFolder,
|
|
2255
|
+
onCreateFolder: k(N).handleCreateFolder,
|
|
2256
|
+
onRenameFolder: k(N).handleRenameFolder,
|
|
2257
|
+
onDeleteFolder: k(N).handleDeleteFolder,
|
|
2258
|
+
onShowFrequentlyUsed: k(A).showFrequentlyUsed
|
|
2258
2259
|
}, null, 8, [
|
|
2259
2260
|
"folders",
|
|
2260
2261
|
"current-folder-id",
|
|
@@ -2267,55 +2268,54 @@ var Yn = ["data-tpl-theme"], Xn = {
|
|
|
2267
2268
|
"onShowFrequentlyUsed"
|
|
2268
2269
|
])])) : u("", !0)]),
|
|
2269
2270
|
_: 1
|
|
2270
|
-
}), f("div",
|
|
2271
|
-
|
|
2272
|
-
key: 0,
|
|
2271
|
+
}), f("div", or, [f("div", sr, [f("div", cr, [
|
|
2272
|
+
f("button", {
|
|
2273
2273
|
class: "tpl:flex tpl:size-7 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded-md tpl:transition-all tpl:duration-150",
|
|
2274
2274
|
style: b({
|
|
2275
|
-
color: k(
|
|
2276
|
-
backgroundColor: k(
|
|
2277
|
-
border: k(
|
|
2275
|
+
color: k(N).showSidebar.value ? "var(--tpl-primary)" : "var(--tpl-text-muted)",
|
|
2276
|
+
backgroundColor: k(N).showSidebar.value ? "var(--tpl-bg)" : "transparent",
|
|
2277
|
+
border: k(N).showSidebar.value ? "1px solid var(--tpl-border)" : "1px solid transparent"
|
|
2278
2278
|
}),
|
|
2279
|
-
title: k(
|
|
2280
|
-
onClick: n[2] ||= (e) => k(
|
|
2279
|
+
title: k(N).showSidebar.value ? k(c).mediaLibrary.hideFolders : k(c).mediaLibrary.showFolders,
|
|
2280
|
+
onClick: n[2] ||= (e) => k(N).showSidebar.value = !k(N).showSidebar.value
|
|
2281
2281
|
}, [m(k(G), {
|
|
2282
2282
|
size: 16,
|
|
2283
2283
|
"stroke-width": 2
|
|
2284
|
-
})], 12,
|
|
2285
|
-
k(
|
|
2286
|
-
key:
|
|
2287
|
-
folders: k(
|
|
2288
|
-
"current-folder-id": k(
|
|
2289
|
-
onNavigate: k(
|
|
2284
|
+
})], 12, lr),
|
|
2285
|
+
k(A).viewMode.value === "frequently-used" ? (S(), d("span", ur, D(k(c).mediaLibrary.frequentlyUsed), 1)) : (S(), l(_e, {
|
|
2286
|
+
key: 1,
|
|
2287
|
+
folders: k(A).folders.value,
|
|
2288
|
+
"current-folder-id": k(A).currentFolderId.value,
|
|
2289
|
+
onNavigate: k(A).navigateToFolder
|
|
2290
2290
|
}, null, 8, [
|
|
2291
2291
|
"folders",
|
|
2292
2292
|
"current-folder-id",
|
|
2293
2293
|
"onNavigate"
|
|
2294
2294
|
])),
|
|
2295
|
-
f("div",
|
|
2295
|
+
f("div", dr, [f("button", {
|
|
2296
2296
|
class: "tpl:flex tpl:size-6 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded tpl:transition-all tpl:duration-150",
|
|
2297
2297
|
style: b({
|
|
2298
|
-
color: k(
|
|
2299
|
-
backgroundColor: k(
|
|
2298
|
+
color: k(N).layoutMode.value === "grid" ? "var(--tpl-primary)" : "var(--tpl-text-muted)",
|
|
2299
|
+
backgroundColor: k(N).layoutMode.value === "grid" ? "var(--tpl-bg-elevated)" : "transparent"
|
|
2300
2300
|
}),
|
|
2301
2301
|
title: k(c).mediaLibrary.viewGrid,
|
|
2302
|
-
onClick: n[3] ||= (e) => k(
|
|
2302
|
+
onClick: n[3] ||= (e) => k(N).layoutMode.value = "grid"
|
|
2303
2303
|
}, [m(k(V), {
|
|
2304
2304
|
size: 14,
|
|
2305
2305
|
"stroke-width": 2
|
|
2306
|
-
})], 12,
|
|
2306
|
+
})], 12, fr), f("button", {
|
|
2307
2307
|
class: "tpl:flex tpl:size-6 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded tpl:transition-all tpl:duration-150",
|
|
2308
2308
|
style: b({
|
|
2309
|
-
color: k(
|
|
2310
|
-
backgroundColor: k(
|
|
2309
|
+
color: k(N).layoutMode.value === "list" ? "var(--tpl-primary)" : "var(--tpl-text-muted)",
|
|
2310
|
+
backgroundColor: k(N).layoutMode.value === "list" ? "var(--tpl-bg-elevated)" : "transparent"
|
|
2311
2311
|
}),
|
|
2312
2312
|
title: k(c).mediaLibrary.viewList,
|
|
2313
|
-
onClick: n[4] ||= (e) => k(
|
|
2313
|
+
onClick: n[4] ||= (e) => k(N).layoutMode.value = "list"
|
|
2314
2314
|
}, [m(k(U), {
|
|
2315
2315
|
size: 14,
|
|
2316
2316
|
"stroke-width": 2
|
|
2317
|
-
})], 12,
|
|
2318
|
-
]), f("div",
|
|
2317
|
+
})], 12, pr)])
|
|
2318
|
+
]), f("div", mr, [k(E).length > 1 ? (S(), d("select", {
|
|
2319
2319
|
key: 0,
|
|
2320
2320
|
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",
|
|
2321
2321
|
style: {
|
|
@@ -2323,59 +2323,58 @@ var Yn = ["data-tpl-theme"], Xn = {
|
|
|
2323
2323
|
"background-color": "var(--tpl-bg)",
|
|
2324
2324
|
color: "var(--tpl-text)"
|
|
2325
2325
|
},
|
|
2326
|
-
value: k(
|
|
2327
|
-
onChange: n[5] ||= (e) => k(
|
|
2328
|
-
}, [f("option",
|
|
2326
|
+
value: k(A).categoryFilter.value ?? "",
|
|
2327
|
+
onChange: n[5] ||= (e) => k(A).filterByCategory(e.target.value || null)
|
|
2328
|
+
}, [f("option", gr, D(k(c).mediaLibrary.filterAll), 1), (S(!0), d(i, null, T(k(E), (e) => (S(), d("option", {
|
|
2329
2329
|
key: e,
|
|
2330
2330
|
value: e
|
|
2331
|
-
}, D(k(
|
|
2331
|
+
}, D(k(N).getCategoryLabel(e)), 9, _r))), 128))], 40, hr)) : u("", !0), f("select", {
|
|
2332
2332
|
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",
|
|
2333
2333
|
style: {
|
|
2334
2334
|
"border-color": "var(--tpl-border)",
|
|
2335
2335
|
"background-color": "var(--tpl-bg)",
|
|
2336
2336
|
color: "var(--tpl-text)"
|
|
2337
2337
|
},
|
|
2338
|
-
value: k(
|
|
2339
|
-
onChange: n[6] ||= (e) => k(
|
|
2338
|
+
value: k(A).sortOption.value,
|
|
2339
|
+
onChange: n[6] ||= (e) => k(A).sortBy(e.target.value)
|
|
2340
2340
|
}, [
|
|
2341
|
-
f("option",
|
|
2342
|
-
f("option",
|
|
2343
|
-
f("option",
|
|
2344
|
-
f("option",
|
|
2345
|
-
f("option",
|
|
2346
|
-
f("option",
|
|
2347
|
-
], 40,
|
|
2348
|
-
"is-uploading": k(
|
|
2349
|
-
"upload-progress": k(
|
|
2350
|
-
onUpload: k(
|
|
2341
|
+
f("option", yr, D(k(c).mediaLibrary.sortNewest), 1),
|
|
2342
|
+
f("option", br, D(k(c).mediaLibrary.sortOldest), 1),
|
|
2343
|
+
f("option", xr, D(k(c).mediaLibrary.sortNameAsc), 1),
|
|
2344
|
+
f("option", Sr, D(k(c).mediaLibrary.sortNameDesc), 1),
|
|
2345
|
+
f("option", Cr, D(k(c).mediaLibrary.sortSizeAsc), 1),
|
|
2346
|
+
f("option", wr, D(k(c).mediaLibrary.sortSizeDesc), 1)
|
|
2347
|
+
], 40, vr)])]), f("div", Tr, [k(A).viewMode.value === "files" ? (S(), d("div", Er, [m(Wn, {
|
|
2348
|
+
"is-uploading": k(A).isUploading.value,
|
|
2349
|
+
"upload-progress": k(A).uploadProgress.value,
|
|
2350
|
+
onUpload: k(N).handleUpload
|
|
2351
2351
|
}, null, 8, [
|
|
2352
2352
|
"is-uploading",
|
|
2353
2353
|
"upload-progress",
|
|
2354
2354
|
"onUpload"
|
|
2355
|
-
]),
|
|
2356
|
-
key: 0,
|
|
2355
|
+
]), f("button", {
|
|
2357
2356
|
class: "tpl:mt-2 tpl:flex tpl:w-full tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:gap-1.5 tpl:rounded-md tpl:border tpl:border-dashed tpl:px-3 tpl:py-1.5 tpl:text-xs tpl:font-medium tpl:transition-all tpl:duration-150",
|
|
2358
2357
|
style: {
|
|
2359
2358
|
"border-color": "var(--tpl-border)",
|
|
2360
2359
|
color: "var(--tpl-text-muted)",
|
|
2361
2360
|
"background-color": "var(--tpl-bg)"
|
|
2362
2361
|
},
|
|
2363
|
-
onClick: n[7] ||= (e) => k(
|
|
2362
|
+
onClick: n[7] ||= (e) => k(N).showImportUrlModal.value = !0
|
|
2364
2363
|
}, [m(k(H), {
|
|
2365
2364
|
size: 14,
|
|
2366
2365
|
"stroke-width": 2
|
|
2367
|
-
}), p(" " + D(k(c).mediaLibrary.importFromUrl), 1)])
|
|
2368
|
-
items: k(
|
|
2369
|
-
"selected-ids": k(
|
|
2370
|
-
"is-loading": k(
|
|
2371
|
-
"has-more": k(
|
|
2366
|
+
}), p(" " + D(k(c).mediaLibrary.importFromUrl), 1)])])) : u("", !0), m(Yt, {
|
|
2367
|
+
items: k(N).displayItems.value,
|
|
2368
|
+
"selected-ids": k(A).selectedItems.value,
|
|
2369
|
+
"is-loading": k(A).isLoading.value,
|
|
2370
|
+
"has-more": k(A).viewMode.value === "files" && k(A).hasMore.value,
|
|
2372
2371
|
accept: e.accept,
|
|
2373
|
-
layout: k(
|
|
2374
|
-
onSelect: k(
|
|
2375
|
-
onToggle: k(
|
|
2376
|
-
onLoadMore: k(
|
|
2377
|
-
onEdit: k(
|
|
2378
|
-
onReplace: k(
|
|
2372
|
+
layout: k(N).layoutMode.value,
|
|
2373
|
+
onSelect: k(N).handleSelect,
|
|
2374
|
+
onToggle: k(A).toggleSelection,
|
|
2375
|
+
onLoadMore: k(A).loadMore,
|
|
2376
|
+
onEdit: k(N).handleEditItem,
|
|
2377
|
+
onReplace: k(N).handleReplaceItem
|
|
2379
2378
|
}, null, 8, [
|
|
2380
2379
|
"items",
|
|
2381
2380
|
"selected-ids",
|
|
@@ -2389,36 +2388,36 @@ var Yn = ["data-tpl-theme"], Xn = {
|
|
|
2389
2388
|
"onEdit",
|
|
2390
2389
|
"onReplace"
|
|
2391
2390
|
])])])]),
|
|
2392
|
-
m(
|
|
2393
|
-
visible: k(
|
|
2394
|
-
"is-importing": k(
|
|
2395
|
-
error: k(
|
|
2396
|
-
onImport: k(
|
|
2397
|
-
onClose: n[8] ||= (e) => k(
|
|
2391
|
+
m(cn, {
|
|
2392
|
+
visible: k(N).showImportUrlModal.value,
|
|
2393
|
+
"is-importing": k(A).isImportingFromUrl.value,
|
|
2394
|
+
error: k(A).importFromUrlError.value,
|
|
2395
|
+
onImport: k(N).handleImportFromUrl,
|
|
2396
|
+
onClose: n[8] ||= (e) => k(N).showImportUrlModal.value = !1
|
|
2398
2397
|
}, null, 8, [
|
|
2399
2398
|
"visible",
|
|
2400
2399
|
"is-importing",
|
|
2401
2400
|
"error",
|
|
2402
2401
|
"onImport"
|
|
2403
2402
|
]),
|
|
2404
|
-
m(
|
|
2405
|
-
visible: !!k(
|
|
2406
|
-
item: k(
|
|
2407
|
-
onSave: k(
|
|
2408
|
-
onClose: n[9] ||= (e) => k(
|
|
2403
|
+
m(ot, {
|
|
2404
|
+
visible: !!k(N).editingItem.value,
|
|
2405
|
+
item: k(N).editingItem.value,
|
|
2406
|
+
onSave: k(N).handleEditSave,
|
|
2407
|
+
onClose: n[9] ||= (e) => k(N).editingItem.value = null
|
|
2409
2408
|
}, null, 8, [
|
|
2410
2409
|
"visible",
|
|
2411
2410
|
"item",
|
|
2412
2411
|
"onSave"
|
|
2413
2412
|
]),
|
|
2414
|
-
m(
|
|
2415
|
-
visible: k(
|
|
2416
|
-
item: k(
|
|
2417
|
-
"usage-info": k(
|
|
2418
|
-
"is-replacing": k(
|
|
2419
|
-
error: k(
|
|
2420
|
-
onReplace: k(
|
|
2421
|
-
onClose: k(
|
|
2413
|
+
m(zn, {
|
|
2414
|
+
visible: k(A).showReplaceWarning.value,
|
|
2415
|
+
item: k(A).pendingReplaceItem.value,
|
|
2416
|
+
"usage-info": k(A).replaceUsageInfo.value,
|
|
2417
|
+
"is-replacing": k(A).isReplacing.value,
|
|
2418
|
+
error: k(A).replaceError.value,
|
|
2419
|
+
onReplace: k(N).handleReplaceFile,
|
|
2420
|
+
onClose: k(A).cancelReplace
|
|
2422
2421
|
}, null, 8, [
|
|
2423
2422
|
"visible",
|
|
2424
2423
|
"item",
|
|
@@ -2436,7 +2435,7 @@ var Yn = ["data-tpl-theme"], Xn = {
|
|
|
2436
2435
|
"leave-from-class": "tpl:opacity-100",
|
|
2437
2436
|
"leave-to-class": "tpl:opacity-0"
|
|
2438
2437
|
}, {
|
|
2439
|
-
default: M(() => [k(
|
|
2438
|
+
default: M(() => [k(A).showDeleteWarning.value ? (S(), d("div", {
|
|
2440
2439
|
key: 0,
|
|
2441
2440
|
class: "tpl:absolute tpl:inset-0 tpl:z-10 tpl:flex tpl:items-center tpl:justify-center tpl:rounded-[var(--tpl-radius-lg)]",
|
|
2442
2441
|
style: {
|
|
@@ -2444,27 +2443,27 @@ var Yn = ["data-tpl-theme"], Xn = {
|
|
|
2444
2443
|
"backdrop-filter": "blur(8px)",
|
|
2445
2444
|
"-webkit-backdrop-filter": "blur(8px)"
|
|
2446
2445
|
},
|
|
2447
|
-
onClick: n[12] ||= F((...e) => k(
|
|
2448
|
-
}, [f("div",
|
|
2449
|
-
f("h3",
|
|
2446
|
+
onClick: n[12] ||= F((...e) => k(A).cancelDelete && k(A).cancelDelete(...e), ["self"])
|
|
2447
|
+
}, [f("div", Dr, [
|
|
2448
|
+
f("h3", Or, D(k(c).mediaLibrary.deleteWarningTitle), 1),
|
|
2450
2449
|
f("p", {
|
|
2451
|
-
class: y(["tpl:text-xs", k(
|
|
2450
|
+
class: y(["tpl:text-xs", k(N).hasUsedFiles.value ? "tpl:mb-2" : "tpl:mb-4"]),
|
|
2452
2451
|
style: { color: "var(--tpl-text-muted)" }
|
|
2453
2452
|
}, D(k(c).mediaLibrary.deleteWarningMessage), 3),
|
|
2454
|
-
k(
|
|
2455
|
-
k(
|
|
2453
|
+
k(N).hasUsedFiles.value ? (S(), d("p", kr, D(k(c).mediaLibrary.deleteWarningUsageNote), 1)) : u("", !0),
|
|
2454
|
+
k(N).hasUsedFiles.value ? (S(), d("div", Ar, [(S(!0), d(i, null, T(k(A).deleteUsageInfo.value, (e, t) => (S(), d("div", {
|
|
2456
2455
|
key: t,
|
|
2457
2456
|
class: "tpl:text-xs",
|
|
2458
2457
|
style: { color: "var(--tpl-text)" }
|
|
2459
|
-
}, [e.template_count > 0 ? (S(), d(i, { key: 0 }, [f("span",
|
|
2460
|
-
f("div",
|
|
2458
|
+
}, [e.template_count > 0 ? (S(), d(i, { key: 0 }, [f("span", jr, D(k(N).displayItems.value.find((e) => e.id === t)?.filename || t), 1), f("span", Mr, " - " + D(k(c).mediaLibrary.usedInTemplates.replace("{count}", e.template_count.toString())), 1)], 64)) : u("", !0)]))), 128))])) : u("", !0),
|
|
2459
|
+
f("div", Nr, [f("button", {
|
|
2461
2460
|
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",
|
|
2462
2461
|
style: {
|
|
2463
2462
|
"border-color": "var(--tpl-border)",
|
|
2464
2463
|
color: "var(--tpl-text)",
|
|
2465
2464
|
"background-color": "var(--tpl-bg)"
|
|
2466
2465
|
},
|
|
2467
|
-
onClick: n[10] ||= (...e) => k(
|
|
2466
|
+
onClick: n[10] ||= (...e) => k(A).cancelDelete && k(A).cancelDelete(...e)
|
|
2468
2467
|
}, D(k(c).mediaLibrary.cancel), 1), f("button", {
|
|
2469
2468
|
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",
|
|
2470
2469
|
style: {
|
|
@@ -2472,31 +2471,31 @@ var Yn = ["data-tpl-theme"], Xn = {
|
|
|
2472
2471
|
color: "var(--tpl-danger)",
|
|
2473
2472
|
"background-color": "var(--tpl-danger-light)"
|
|
2474
2473
|
},
|
|
2475
|
-
onClick: n[11] ||= (...e) => k(
|
|
2476
|
-
}, D(k(
|
|
2474
|
+
onClick: n[11] ||= (...e) => k(A).confirmDelete && k(A).confirmDelete(...e)
|
|
2475
|
+
}, D(k(N).hasUsedFiles.value ? k(c).mediaLibrary.deleteAnyway : k(c).mediaLibrary.confirmDelete), 1)])
|
|
2477
2476
|
])])) : u("", !0)]),
|
|
2478
2477
|
_: 1
|
|
2479
2478
|
}),
|
|
2480
|
-
f("div",
|
|
2479
|
+
f("div", Pr, [f("div", Fr, [k(A).previewItem.value ? (S(), l(wn, {
|
|
2481
2480
|
key: 0,
|
|
2482
|
-
"selected-conversion": k(
|
|
2483
|
-
"onUpdate:selectedConversion": n[13] ||= (e) => k(
|
|
2484
|
-
item: k(
|
|
2485
|
-
folders: k(
|
|
2481
|
+
"selected-conversion": k(N).selectedConversion.value,
|
|
2482
|
+
"onUpdate:selectedConversion": n[13] ||= (e) => k(N).selectedConversion.value = e,
|
|
2483
|
+
item: k(A).previewItem.value,
|
|
2484
|
+
folders: k(A).folders.value
|
|
2486
2485
|
}, null, 8, [
|
|
2487
2486
|
"selected-conversion",
|
|
2488
2487
|
"item",
|
|
2489
2488
|
"folders"
|
|
2490
|
-
])) : u("", !0)]), f("div",
|
|
2489
|
+
])) : u("", !0)]), f("div", Ir, [k(A).selectedItems.value.size > 0 ? (S(), d("div", Lr, [k(A).previewItem.value ? (S(), d("button", {
|
|
2491
2490
|
key: 0,
|
|
2492
2491
|
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",
|
|
2493
2492
|
style: b({
|
|
2494
|
-
borderColor: k(
|
|
2495
|
-
color: k(
|
|
2493
|
+
borderColor: k(N).copied.value ? "var(--tpl-success)" : "var(--tpl-border)",
|
|
2494
|
+
color: k(N).copied.value ? "var(--tpl-success)" : "var(--tpl-text)",
|
|
2496
2495
|
backgroundColor: "var(--tpl-bg)"
|
|
2497
2496
|
}),
|
|
2498
|
-
onClick: n[14] ||= (e) => k(
|
|
2499
|
-
}, [k(
|
|
2497
|
+
onClick: n[14] ||= (e) => k(N).copy(k(N).selectedUrl.value)
|
|
2498
|
+
}, [k(N).copied.value ? (S(), l(k(I), {
|
|
2500
2499
|
key: 1,
|
|
2501
2500
|
size: 12,
|
|
2502
2501
|
"stroke-width": 2
|
|
@@ -2504,25 +2503,25 @@ var Yn = ["data-tpl-theme"], Xn = {
|
|
|
2504
2503
|
key: 0,
|
|
2505
2504
|
size: 12,
|
|
2506
2505
|
"stroke-width": 2
|
|
2507
|
-
})), p(" " + D(k(
|
|
2506
|
+
})), p(" " + D(k(N).copied.value ? k(c).mediaLibrary.copied : k(c).mediaLibrary.copyUrl), 1)], 4)) : u("", !0), f("div", Rr, [f("button", {
|
|
2508
2507
|
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",
|
|
2509
2508
|
style: {
|
|
2510
2509
|
"border-color": "var(--tpl-border)",
|
|
2511
2510
|
color: "var(--tpl-text)",
|
|
2512
2511
|
"background-color": "var(--tpl-bg)"
|
|
2513
2512
|
},
|
|
2514
|
-
onClick: n[15] ||= (e) => k(
|
|
2515
|
-
}, D(k(c).mediaLibrary.moveSelected), 1), k(
|
|
2513
|
+
onClick: n[15] ||= (e) => k(N).showMovePicker.value = !k(N).showMovePicker.value
|
|
2514
|
+
}, D(k(c).mediaLibrary.moveSelected), 1), k(N).showMovePicker.value ? (S(), l(pn, {
|
|
2516
2515
|
key: 0,
|
|
2517
|
-
folders: k(
|
|
2518
|
-
"current-folder-id": k(
|
|
2519
|
-
onSelect: k(
|
|
2520
|
-
onClose: n[16] ||= (e) => k(
|
|
2516
|
+
folders: k(A).folders.value,
|
|
2517
|
+
"current-folder-id": k(A).currentFolderId.value,
|
|
2518
|
+
onSelect: k(N).handleMoveToFolder,
|
|
2519
|
+
onClose: n[16] ||= (e) => k(N).showMovePicker.value = !1
|
|
2521
2520
|
}, null, 8, [
|
|
2522
2521
|
"folders",
|
|
2523
2522
|
"current-folder-id",
|
|
2524
2523
|
"onSelect"
|
|
2525
|
-
])) : u("", !0)])
|
|
2524
|
+
])) : u("", !0)])])) : u("", !0), f("div", zr, [k(A).selectedItems.value.size > 0 ? (S(), d("button", {
|
|
2526
2525
|
key: 0,
|
|
2527
2526
|
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",
|
|
2528
2527
|
style: {
|
|
@@ -2530,43 +2529,43 @@ var Yn = ["data-tpl-theme"], Xn = {
|
|
|
2530
2529
|
color: "var(--tpl-danger)",
|
|
2531
2530
|
"background-color": "var(--tpl-danger-light)"
|
|
2532
2531
|
},
|
|
2533
|
-
onClick: n[17] ||= (...e) => k(
|
|
2532
|
+
onClick: n[17] ||= (...e) => k(N).handleDeleteClick && k(N).handleDeleteClick(...e)
|
|
2534
2533
|
}, D(k(c).mediaLibrary.deleteSelected), 1)) : u("", !0), f("button", {
|
|
2535
2534
|
class: "tpl:cursor-pointer tpl:rounded-md tpl:px-4 tpl:py-1.5 tpl:text-sm tpl:font-medium tpl:shadow-xs tpl:transition-all tpl:duration-150 tpl:hover:opacity-90 tpl:disabled:cursor-not-allowed tpl:disabled:opacity-50",
|
|
2536
2535
|
style: {
|
|
2537
2536
|
"background-color": "var(--tpl-primary)",
|
|
2538
2537
|
color: "var(--tpl-bg)"
|
|
2539
2538
|
},
|
|
2540
|
-
disabled: !
|
|
2541
|
-
onClick:
|
|
2542
|
-
}, D(e.accept?.length ? k(c).mediaLibrary.selectImage : k(c).mediaLibrary.selectFile), 9,
|
|
2543
|
-
])], 8,
|
|
2539
|
+
disabled: !L(),
|
|
2540
|
+
onClick: z
|
|
2541
|
+
}, D(e.accept?.length ? k(c).mediaLibrary.selectImage : k(c).mediaLibrary.selectFile), 9, Br)])])])
|
|
2542
|
+
])], 8, Zn)) : u("", !0)]),
|
|
2544
2543
|
_: 1
|
|
2545
2544
|
})], 8, ["to"]));
|
|
2546
2545
|
}
|
|
2547
2546
|
});
|
|
2548
2547
|
//#endregion
|
|
2549
2548
|
//#region src/composables/useMediaPicker.ts
|
|
2550
|
-
function
|
|
2551
|
-
let e = _("onRequestMedia"), t =
|
|
2552
|
-
async function
|
|
2549
|
+
function Hr() {
|
|
2550
|
+
let e = _("onRequestMedia"), t = w(!1), n = s(() => !!e);
|
|
2551
|
+
async function r(n) {
|
|
2553
2552
|
if (!e) return null;
|
|
2554
|
-
|
|
2553
|
+
t.value = !0;
|
|
2555
2554
|
try {
|
|
2556
|
-
return await e(
|
|
2555
|
+
return await e(n ?? {});
|
|
2557
2556
|
} finally {
|
|
2558
|
-
|
|
2557
|
+
t.value = !1;
|
|
2559
2558
|
}
|
|
2560
2559
|
}
|
|
2561
2560
|
return {
|
|
2562
|
-
isPluggableMediaEnabled:
|
|
2563
|
-
isRequesting:
|
|
2564
|
-
requestMedia:
|
|
2561
|
+
isPluggableMediaEnabled: n,
|
|
2562
|
+
isRequesting: t,
|
|
2563
|
+
requestMedia: r
|
|
2565
2564
|
};
|
|
2566
2565
|
}
|
|
2567
2566
|
//#endregion
|
|
2568
2567
|
//#region src/standalone/MediaLibrary.vue?vue&type=script&setup=true&lang.ts
|
|
2569
|
-
var
|
|
2568
|
+
var Ur = {
|
|
2570
2569
|
class: "tpl tpl:flex tpl:flex-col tpl:overflow-hidden tpl:rounded-[var(--tpl-radius-lg)]",
|
|
2571
2570
|
style: {
|
|
2572
2571
|
width: "100%",
|
|
@@ -2574,62 +2573,59 @@ var Vr = {
|
|
|
2574
2573
|
"background-color": "var(--tpl-bg-elevated)",
|
|
2575
2574
|
border: "1px solid var(--tpl-border)"
|
|
2576
2575
|
}
|
|
2577
|
-
},
|
|
2576
|
+
}, Wr = {
|
|
2578
2577
|
class: "tpl:flex tpl:shrink-0 tpl:items-center tpl:justify-between tpl:border-b tpl:px-5 tpl:py-3.5",
|
|
2579
2578
|
style: { "border-color": "var(--tpl-border)" }
|
|
2580
|
-
},
|
|
2579
|
+
}, Gr = {
|
|
2581
2580
|
class: "tpl:text-sm tpl:font-semibold",
|
|
2582
2581
|
style: { color: "var(--tpl-text)" }
|
|
2583
|
-
},
|
|
2582
|
+
}, Kr = { class: "tpl:flex tpl:items-center tpl:gap-3" }, qr = { class: "tpl:relative" }, Jr = ["value", "placeholder"], Yr = { class: "tpl:flex tpl:min-h-0 tpl:flex-1 tpl:overflow-hidden" }, Xr = {
|
|
2584
2583
|
key: 0,
|
|
2585
2584
|
class: "tpl:flex tpl:w-48 tpl:shrink-0 tpl:flex-col tpl:border-r",
|
|
2586
2585
|
style: {
|
|
2587
2586
|
"border-color": "var(--tpl-border)",
|
|
2588
2587
|
"background-color": "var(--tpl-bg)"
|
|
2589
2588
|
}
|
|
2590
|
-
},
|
|
2589
|
+
}, Zr = { class: "tpl:flex tpl:min-w-0 tpl:flex-1 tpl:flex-col" }, Qr = {
|
|
2591
2590
|
class: "tpl:flex tpl:shrink-0 tpl:items-center tpl:justify-between tpl:border-b tpl:px-4 tpl:py-2.5",
|
|
2592
2591
|
style: { "border-color": "var(--tpl-border)" }
|
|
2593
|
-
},
|
|
2594
|
-
key:
|
|
2592
|
+
}, $r = { class: "tpl:flex tpl:items-center tpl:gap-2" }, ei = ["title"], ti = {
|
|
2593
|
+
key: 0,
|
|
2595
2594
|
class: "tpl:text-xs tpl:font-medium",
|
|
2596
2595
|
style: { color: "var(--tpl-text)" }
|
|
2597
|
-
},
|
|
2596
|
+
}, ni = {
|
|
2598
2597
|
class: "tpl:flex tpl:rounded-md tpl:p-0.5",
|
|
2599
2598
|
style: {
|
|
2600
2599
|
border: "1px solid var(--tpl-border)",
|
|
2601
2600
|
"background-color": "var(--tpl-bg)"
|
|
2602
2601
|
}
|
|
2603
|
-
},
|
|
2602
|
+
}, ri = ["title"], ii = ["title"], ai = { class: "tpl:flex tpl:items-center tpl:gap-2" }, oi = ["value"], si = { value: "" }, ci = ["value"], li = ["value"], ui = { value: "newest" }, di = { value: "oldest" }, fi = { value: "name_asc" }, pi = { value: "name_desc" }, mi = { value: "size_asc" }, hi = { value: "size_desc" }, gi = { class: "tpl:min-h-0 tpl:flex-1 tpl:overflow-y-auto" }, _i = {
|
|
2604
2603
|
key: 0,
|
|
2605
2604
|
class: "tpl:px-4 tpl:pt-3"
|
|
2606
|
-
},
|
|
2605
|
+
}, vi = {
|
|
2607
2606
|
class: "tpl-scale-in tpl:mx-4 tpl:w-full tpl:max-w-sm tpl:rounded-[var(--tpl-radius-lg)] tpl:p-5",
|
|
2608
2607
|
style: {
|
|
2609
2608
|
"background-color": "var(--tpl-bg-elevated)",
|
|
2610
2609
|
"box-shadow": "var(--tpl-shadow-xl)"
|
|
2611
2610
|
}
|
|
2612
|
-
},
|
|
2611
|
+
}, yi = {
|
|
2613
2612
|
class: "tpl:mb-2 tpl:text-sm tpl:font-semibold",
|
|
2614
2613
|
style: { color: "var(--tpl-text)" }
|
|
2615
|
-
},
|
|
2614
|
+
}, bi = {
|
|
2616
2615
|
key: 0,
|
|
2617
2616
|
class: "tpl:mb-4 tpl:text-xs",
|
|
2618
2617
|
style: { color: "var(--tpl-text-muted)" }
|
|
2619
|
-
},
|
|
2618
|
+
}, xi = {
|
|
2620
2619
|
key: 1,
|
|
2621
2620
|
class: "tpl:mb-4 tpl:max-h-32 tpl:overflow-y-auto tpl:rounded tpl:border tpl:p-2",
|
|
2622
2621
|
style: { "border-color": "var(--tpl-border)" }
|
|
2623
|
-
},
|
|
2622
|
+
}, Si = { class: "tpl:font-medium" }, Ci = { style: { color: "var(--tpl-text-muted)" } }, wi = { class: "tpl:flex tpl:justify-end tpl:gap-2" }, Ti = {
|
|
2624
2623
|
class: "tpl:flex tpl:shrink-0 tpl:items-center tpl:justify-between tpl:border-t tpl:px-5 tpl:py-3",
|
|
2625
2624
|
style: { "border-color": "var(--tpl-border)" }
|
|
2626
|
-
},
|
|
2625
|
+
}, Ei = { class: "tpl:flex tpl:min-w-0 tpl:flex-1 tpl:items-center tpl:gap-3" }, Di = { class: "tpl:flex tpl:items-center tpl:gap-5" }, Oi = {
|
|
2627
2626
|
key: 0,
|
|
2628
2627
|
class: "tpl:flex tpl:items-center tpl:gap-2"
|
|
2629
|
-
},
|
|
2630
|
-
key: 1,
|
|
2631
|
-
class: "tpl:relative"
|
|
2632
|
-
}, Oi = { class: "tpl:flex tpl:items-center tpl:gap-2" }, ki = ["disabled"], Ai = /* @__PURE__ */ h({
|
|
2628
|
+
}, ki = { class: "tpl:relative" }, Ai = { class: "tpl:flex tpl:items-center tpl:gap-2" }, ji = ["disabled"], Mi = /* @__PURE__ */ h({
|
|
2633
2629
|
__name: "MediaLibrary",
|
|
2634
2630
|
props: {
|
|
2635
2631
|
authManager: {},
|
|
@@ -2642,41 +2638,40 @@ var Vr = {
|
|
|
2642
2638
|
emits: ["ready"],
|
|
2643
2639
|
setup(e, { emit: t }) {
|
|
2644
2640
|
let n = e, r = t, a = s(() => n.translations);
|
|
2645
|
-
C("translations", n.translations)
|
|
2641
|
+
C("translations", n.translations);
|
|
2646
2642
|
let c = w(n.planConfig);
|
|
2647
|
-
C(
|
|
2643
|
+
C(ve, {
|
|
2648
2644
|
config: c,
|
|
2649
2645
|
isLoading: w(!1),
|
|
2650
2646
|
hasFeature: (e) => n.planConfig.features[e] ?? !1,
|
|
2651
2647
|
features: s(() => n.planConfig.features),
|
|
2652
2648
|
fetchConfig: async () => {}
|
|
2653
2649
|
});
|
|
2654
|
-
let h = s(() => n.planConfig.
|
|
2650
|
+
let h = s(() => n.planConfig.storage.used_bytes ?? 0), g = s(() => n.planConfig.storage.limit_bytes ?? 0), { availableCategories: _ } = Z(), v = pe({
|
|
2655
2651
|
projectId: n.projectId,
|
|
2656
2652
|
authManager: n.authManager,
|
|
2657
2653
|
onError: n.onError
|
|
2658
|
-
}),
|
|
2659
|
-
library:
|
|
2660
|
-
canUseMediaFolders: h,
|
|
2654
|
+
}), E = Xn({
|
|
2655
|
+
library: v,
|
|
2661
2656
|
translations: a
|
|
2662
2657
|
});
|
|
2663
|
-
function
|
|
2664
|
-
if (!
|
|
2665
|
-
let e =
|
|
2658
|
+
function O() {
|
|
2659
|
+
if (!v.previewItem.value) return;
|
|
2660
|
+
let e = v.previewItem.value, t = {
|
|
2666
2661
|
...e,
|
|
2667
|
-
url:
|
|
2662
|
+
url: E.selectedUrl.value || e.url
|
|
2668
2663
|
};
|
|
2669
2664
|
n.onSelect?.(t);
|
|
2670
2665
|
}
|
|
2671
2666
|
return x(() => {
|
|
2672
|
-
|
|
2673
|
-
}), (t, n) => (S(), d("div",
|
|
2674
|
-
f("div",
|
|
2675
|
-
"used-bytes":
|
|
2676
|
-
"limit-bytes":
|
|
2667
|
+
v.loadItems(), v.loadFrequentlyUsed(), r("ready");
|
|
2668
|
+
}), (t, n) => (S(), d("div", Ur, [
|
|
2669
|
+
f("div", Wr, [f("h2", Gr, D(a.value.mediaLibrary.title), 1), f("div", Kr, [m(Yn, {
|
|
2670
|
+
"used-bytes": h.value,
|
|
2671
|
+
"limit-bytes": g.value,
|
|
2677
2672
|
size: 22
|
|
2678
|
-
}, null, 8, ["used-bytes", "limit-bytes"]), f("div",
|
|
2679
|
-
value: k(
|
|
2673
|
+
}, null, 8, ["used-bytes", "limit-bytes"]), f("div", qr, [f("input", {
|
|
2674
|
+
value: k(E).searchInput.value,
|
|
2680
2675
|
type: "text",
|
|
2681
2676
|
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)]",
|
|
2682
2677
|
style: {
|
|
@@ -2685,14 +2680,14 @@ var Vr = {
|
|
|
2685
2680
|
color: "var(--tpl-text)"
|
|
2686
2681
|
},
|
|
2687
2682
|
placeholder: a.value.mediaLibrary.searchPlaceholder,
|
|
2688
|
-
onInput: n[0] ||= (e) => k(
|
|
2689
|
-
}, null, 40,
|
|
2683
|
+
onInput: n[0] ||= (e) => k(E).handleSearchInput(e.target.value)
|
|
2684
|
+
}, null, 40, Jr), m(k(J), {
|
|
2690
2685
|
class: "tpl:absolute tpl:top-1/2 tpl:left-2.5 tpl:-translate-y-1/2",
|
|
2691
2686
|
size: 13,
|
|
2692
2687
|
"stroke-width": 2,
|
|
2693
2688
|
style: { color: "var(--tpl-text-dim)" }
|
|
2694
2689
|
})])])]),
|
|
2695
|
-
f("div",
|
|
2690
|
+
f("div", Yr, [m(o, {
|
|
2696
2691
|
"enter-active-class": "tpl:transition-all tpl:duration-200 tpl:ease-out",
|
|
2697
2692
|
"enter-from-class": "tpl:-ml-48 tpl:opacity-0",
|
|
2698
2693
|
"enter-to-class": "tpl:ml-0 tpl:opacity-100",
|
|
@@ -2700,16 +2695,16 @@ var Vr = {
|
|
|
2700
2695
|
"leave-from-class": "tpl:ml-0 tpl:opacity-100",
|
|
2701
2696
|
"leave-to-class": "tpl:-ml-48 tpl:opacity-0"
|
|
2702
2697
|
}, {
|
|
2703
|
-
default: M(() => [
|
|
2704
|
-
folders: k(
|
|
2705
|
-
"current-folder-id": k(
|
|
2706
|
-
"view-mode": k(
|
|
2707
|
-
"has-frequently-used": k(
|
|
2708
|
-
onNavigate: k(
|
|
2709
|
-
onCreateFolder: k(
|
|
2710
|
-
onRenameFolder: k(
|
|
2711
|
-
onDeleteFolder: k(
|
|
2712
|
-
onShowFrequentlyUsed: k(
|
|
2698
|
+
default: M(() => [k(E).showSidebar.value ? (S(), d("div", Xr, [m(vt, {
|
|
2699
|
+
folders: k(v).folders.value,
|
|
2700
|
+
"current-folder-id": k(v).currentFolderId.value,
|
|
2701
|
+
"view-mode": k(v).viewMode.value,
|
|
2702
|
+
"has-frequently-used": k(E).hasFrequentlyUsed.value,
|
|
2703
|
+
onNavigate: k(v).navigateToFolder,
|
|
2704
|
+
onCreateFolder: k(E).handleCreateFolder,
|
|
2705
|
+
onRenameFolder: k(E).handleRenameFolder,
|
|
2706
|
+
onDeleteFolder: k(E).handleDeleteFolder,
|
|
2707
|
+
onShowFrequentlyUsed: k(v).showFrequentlyUsed
|
|
2713
2708
|
}, null, 8, [
|
|
2714
2709
|
"folders",
|
|
2715
2710
|
"current-folder-id",
|
|
@@ -2722,55 +2717,54 @@ var Vr = {
|
|
|
2722
2717
|
"onShowFrequentlyUsed"
|
|
2723
2718
|
])])) : u("", !0)]),
|
|
2724
2719
|
_: 1
|
|
2725
|
-
}), f("div",
|
|
2726
|
-
|
|
2727
|
-
key: 0,
|
|
2720
|
+
}), f("div", Zr, [f("div", Qr, [f("div", $r, [
|
|
2721
|
+
f("button", {
|
|
2728
2722
|
class: "tpl:flex tpl:size-7 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded-md tpl:transition-all tpl:duration-150",
|
|
2729
2723
|
style: b({
|
|
2730
|
-
color: k(
|
|
2731
|
-
backgroundColor: k(
|
|
2732
|
-
border: k(
|
|
2724
|
+
color: k(E).showSidebar.value ? "var(--tpl-primary)" : "var(--tpl-text-muted)",
|
|
2725
|
+
backgroundColor: k(E).showSidebar.value ? "var(--tpl-bg)" : "transparent",
|
|
2726
|
+
border: k(E).showSidebar.value ? "1px solid var(--tpl-border)" : "1px solid transparent"
|
|
2733
2727
|
}),
|
|
2734
|
-
title: k(
|
|
2735
|
-
onClick: n[1] ||= (e) => k(
|
|
2728
|
+
title: k(E).showSidebar.value ? a.value.mediaLibrary.hideFolders : a.value.mediaLibrary.showFolders,
|
|
2729
|
+
onClick: n[1] ||= (e) => k(E).showSidebar.value = !k(E).showSidebar.value
|
|
2736
2730
|
}, [m(k(G), {
|
|
2737
2731
|
size: 16,
|
|
2738
2732
|
"stroke-width": 2
|
|
2739
|
-
})], 12,
|
|
2740
|
-
k(
|
|
2741
|
-
key:
|
|
2742
|
-
folders: k(
|
|
2743
|
-
"current-folder-id": k(
|
|
2744
|
-
onNavigate: k(
|
|
2733
|
+
})], 12, ei),
|
|
2734
|
+
k(v).viewMode.value === "frequently-used" ? (S(), d("span", ti, D(a.value.mediaLibrary.frequentlyUsed), 1)) : (S(), l(_e, {
|
|
2735
|
+
key: 1,
|
|
2736
|
+
folders: k(v).folders.value,
|
|
2737
|
+
"current-folder-id": k(v).currentFolderId.value,
|
|
2738
|
+
onNavigate: k(v).navigateToFolder
|
|
2745
2739
|
}, null, 8, [
|
|
2746
2740
|
"folders",
|
|
2747
2741
|
"current-folder-id",
|
|
2748
2742
|
"onNavigate"
|
|
2749
2743
|
])),
|
|
2750
|
-
f("div",
|
|
2744
|
+
f("div", ni, [f("button", {
|
|
2751
2745
|
class: "tpl:flex tpl:size-6 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded tpl:transition-all tpl:duration-150",
|
|
2752
2746
|
style: b({
|
|
2753
|
-
color: k(
|
|
2754
|
-
backgroundColor: k(
|
|
2747
|
+
color: k(E).layoutMode.value === "grid" ? "var(--tpl-primary)" : "var(--tpl-text-muted)",
|
|
2748
|
+
backgroundColor: k(E).layoutMode.value === "grid" ? "var(--tpl-bg-elevated)" : "transparent"
|
|
2755
2749
|
}),
|
|
2756
2750
|
title: a.value.mediaLibrary.viewGrid,
|
|
2757
|
-
onClick: n[2] ||= (e) => k(
|
|
2751
|
+
onClick: n[2] ||= (e) => k(E).layoutMode.value = "grid"
|
|
2758
2752
|
}, [m(k(V), {
|
|
2759
2753
|
size: 14,
|
|
2760
2754
|
"stroke-width": 2
|
|
2761
|
-
})], 12,
|
|
2755
|
+
})], 12, ri), f("button", {
|
|
2762
2756
|
class: "tpl:flex tpl:size-6 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded tpl:transition-all tpl:duration-150",
|
|
2763
2757
|
style: b({
|
|
2764
|
-
color: k(
|
|
2765
|
-
backgroundColor: k(
|
|
2758
|
+
color: k(E).layoutMode.value === "list" ? "var(--tpl-primary)" : "var(--tpl-text-muted)",
|
|
2759
|
+
backgroundColor: k(E).layoutMode.value === "list" ? "var(--tpl-bg-elevated)" : "transparent"
|
|
2766
2760
|
}),
|
|
2767
2761
|
title: a.value.mediaLibrary.viewList,
|
|
2768
|
-
onClick: n[3] ||= (e) => k(
|
|
2762
|
+
onClick: n[3] ||= (e) => k(E).layoutMode.value = "list"
|
|
2769
2763
|
}, [m(k(U), {
|
|
2770
2764
|
size: 14,
|
|
2771
2765
|
"stroke-width": 2
|
|
2772
|
-
})], 12,
|
|
2773
|
-
]), f("div",
|
|
2766
|
+
})], 12, ii)])
|
|
2767
|
+
]), f("div", ai, [k(_).length > 1 ? (S(), d("select", {
|
|
2774
2768
|
key: 0,
|
|
2775
2769
|
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",
|
|
2776
2770
|
style: {
|
|
@@ -2778,58 +2772,57 @@ var Vr = {
|
|
|
2778
2772
|
"background-color": "var(--tpl-bg)",
|
|
2779
2773
|
color: "var(--tpl-text)"
|
|
2780
2774
|
},
|
|
2781
|
-
value: k(
|
|
2782
|
-
onChange: n[4] ||= (e) => k(
|
|
2783
|
-
}, [f("option",
|
|
2775
|
+
value: k(v).categoryFilter.value ?? "",
|
|
2776
|
+
onChange: n[4] ||= (e) => k(v).filterByCategory(e.target.value || null)
|
|
2777
|
+
}, [f("option", si, D(a.value.mediaLibrary.filterAll), 1), (S(!0), d(i, null, T(k(_), (e) => (S(), d("option", {
|
|
2784
2778
|
key: e,
|
|
2785
2779
|
value: e
|
|
2786
|
-
}, D(k(
|
|
2780
|
+
}, D(k(E).getCategoryLabel(e)), 9, ci))), 128))], 40, oi)) : u("", !0), f("select", {
|
|
2787
2781
|
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",
|
|
2788
2782
|
style: {
|
|
2789
2783
|
"border-color": "var(--tpl-border)",
|
|
2790
2784
|
"background-color": "var(--tpl-bg)",
|
|
2791
2785
|
color: "var(--tpl-text)"
|
|
2792
2786
|
},
|
|
2793
|
-
value: k(
|
|
2794
|
-
onChange: n[5] ||= (e) => k(
|
|
2787
|
+
value: k(v).sortOption.value,
|
|
2788
|
+
onChange: n[5] ||= (e) => k(v).sortBy(e.target.value)
|
|
2795
2789
|
}, [
|
|
2796
|
-
f("option",
|
|
2797
|
-
f("option",
|
|
2798
|
-
f("option",
|
|
2799
|
-
f("option",
|
|
2800
|
-
f("option",
|
|
2801
|
-
f("option",
|
|
2802
|
-
], 40,
|
|
2803
|
-
"is-uploading": k(
|
|
2804
|
-
"upload-progress": k(
|
|
2805
|
-
onUpload: k(
|
|
2790
|
+
f("option", ui, D(a.value.mediaLibrary.sortNewest), 1),
|
|
2791
|
+
f("option", di, D(a.value.mediaLibrary.sortOldest), 1),
|
|
2792
|
+
f("option", fi, D(a.value.mediaLibrary.sortNameAsc), 1),
|
|
2793
|
+
f("option", pi, D(a.value.mediaLibrary.sortNameDesc), 1),
|
|
2794
|
+
f("option", mi, D(a.value.mediaLibrary.sortSizeAsc), 1),
|
|
2795
|
+
f("option", hi, D(a.value.mediaLibrary.sortSizeDesc), 1)
|
|
2796
|
+
], 40, li)])]), f("div", gi, [k(v).viewMode.value === "files" ? (S(), d("div", _i, [m(Wn, {
|
|
2797
|
+
"is-uploading": k(v).isUploading.value,
|
|
2798
|
+
"upload-progress": k(v).uploadProgress.value,
|
|
2799
|
+
onUpload: k(E).handleUpload
|
|
2806
2800
|
}, null, 8, [
|
|
2807
2801
|
"is-uploading",
|
|
2808
2802
|
"upload-progress",
|
|
2809
2803
|
"onUpload"
|
|
2810
|
-
]),
|
|
2811
|
-
key: 0,
|
|
2804
|
+
]), f("button", {
|
|
2812
2805
|
class: "tpl:mt-2 tpl:flex tpl:w-full tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:gap-1.5 tpl:rounded-md tpl:border tpl:border-dashed tpl:px-3 tpl:py-1.5 tpl:text-xs tpl:font-medium tpl:transition-all tpl:duration-150",
|
|
2813
2806
|
style: {
|
|
2814
2807
|
"border-color": "var(--tpl-border)",
|
|
2815
2808
|
color: "var(--tpl-text-muted)",
|
|
2816
2809
|
"background-color": "var(--tpl-bg)"
|
|
2817
2810
|
},
|
|
2818
|
-
onClick: n[6] ||= (e) => k(
|
|
2811
|
+
onClick: n[6] ||= (e) => k(E).showImportUrlModal.value = !0
|
|
2819
2812
|
}, [m(k(H), {
|
|
2820
2813
|
size: 14,
|
|
2821
2814
|
"stroke-width": 2
|
|
2822
|
-
}), p(" " + D(a.value.mediaLibrary.importFromUrl), 1)])
|
|
2823
|
-
items: k(
|
|
2824
|
-
"selected-ids": k(
|
|
2825
|
-
"is-loading": k(
|
|
2826
|
-
"has-more": k(
|
|
2827
|
-
layout: k(
|
|
2828
|
-
onSelect: k(
|
|
2829
|
-
onToggle: k(
|
|
2830
|
-
onLoadMore: k(
|
|
2831
|
-
onEdit: k(
|
|
2832
|
-
onReplace: k(
|
|
2815
|
+
}), p(" " + D(a.value.mediaLibrary.importFromUrl), 1)])])) : u("", !0), m(Yt, {
|
|
2816
|
+
items: k(E).displayItems.value,
|
|
2817
|
+
"selected-ids": k(v).selectedItems.value,
|
|
2818
|
+
"is-loading": k(v).isLoading.value,
|
|
2819
|
+
"has-more": k(v).viewMode.value === "files" && k(v).hasMore.value,
|
|
2820
|
+
layout: k(E).layoutMode.value,
|
|
2821
|
+
onSelect: k(E).handleSelect,
|
|
2822
|
+
onToggle: k(v).toggleSelection,
|
|
2823
|
+
onLoadMore: k(v).loadMore,
|
|
2824
|
+
onEdit: k(E).handleEditItem,
|
|
2825
|
+
onReplace: k(E).handleReplaceItem
|
|
2833
2826
|
}, null, 8, [
|
|
2834
2827
|
"items",
|
|
2835
2828
|
"selected-ids",
|
|
@@ -2842,36 +2835,36 @@ var Vr = {
|
|
|
2842
2835
|
"onEdit",
|
|
2843
2836
|
"onReplace"
|
|
2844
2837
|
])])])]),
|
|
2845
|
-
m(
|
|
2846
|
-
visible: k(
|
|
2847
|
-
"is-importing": k(
|
|
2848
|
-
error: k(
|
|
2849
|
-
onImport: k(
|
|
2850
|
-
onClose: n[7] ||= (e) => k(
|
|
2838
|
+
m(cn, {
|
|
2839
|
+
visible: k(E).showImportUrlModal.value,
|
|
2840
|
+
"is-importing": k(v).isImportingFromUrl.value,
|
|
2841
|
+
error: k(v).importFromUrlError.value,
|
|
2842
|
+
onImport: k(E).handleImportFromUrl,
|
|
2843
|
+
onClose: n[7] ||= (e) => k(E).showImportUrlModal.value = !1
|
|
2851
2844
|
}, null, 8, [
|
|
2852
2845
|
"visible",
|
|
2853
2846
|
"is-importing",
|
|
2854
2847
|
"error",
|
|
2855
2848
|
"onImport"
|
|
2856
2849
|
]),
|
|
2857
|
-
m(
|
|
2858
|
-
visible: !!k(
|
|
2859
|
-
item: k(
|
|
2860
|
-
onSave: k(
|
|
2861
|
-
onClose: n[8] ||= (e) => k(
|
|
2850
|
+
m(ot, {
|
|
2851
|
+
visible: !!k(E).editingItem.value,
|
|
2852
|
+
item: k(E).editingItem.value,
|
|
2853
|
+
onSave: k(E).handleEditSave,
|
|
2854
|
+
onClose: n[8] ||= (e) => k(E).editingItem.value = null
|
|
2862
2855
|
}, null, 8, [
|
|
2863
2856
|
"visible",
|
|
2864
2857
|
"item",
|
|
2865
2858
|
"onSave"
|
|
2866
2859
|
]),
|
|
2867
|
-
m(
|
|
2868
|
-
visible: k(
|
|
2869
|
-
item: k(
|
|
2870
|
-
"usage-info": k(
|
|
2871
|
-
"is-replacing": k(
|
|
2872
|
-
error: k(
|
|
2873
|
-
onReplace: k(
|
|
2874
|
-
onClose: k(
|
|
2860
|
+
m(zn, {
|
|
2861
|
+
visible: k(v).showReplaceWarning.value,
|
|
2862
|
+
item: k(v).pendingReplaceItem.value,
|
|
2863
|
+
"usage-info": k(v).replaceUsageInfo.value,
|
|
2864
|
+
"is-replacing": k(v).isReplacing.value,
|
|
2865
|
+
error: k(v).replaceError.value,
|
|
2866
|
+
onReplace: k(E).handleReplaceFile,
|
|
2867
|
+
onClose: k(v).cancelReplace
|
|
2875
2868
|
}, null, 8, [
|
|
2876
2869
|
"visible",
|
|
2877
2870
|
"item",
|
|
@@ -2889,7 +2882,7 @@ var Vr = {
|
|
|
2889
2882
|
"leave-from-class": "tpl:opacity-100",
|
|
2890
2883
|
"leave-to-class": "tpl:opacity-0"
|
|
2891
2884
|
}, {
|
|
2892
|
-
default: M(() => [k(
|
|
2885
|
+
default: M(() => [k(v).showDeleteWarning.value ? (S(), d("div", {
|
|
2893
2886
|
key: 0,
|
|
2894
2887
|
class: "tpl:absolute tpl:inset-0 tpl:z-10 tpl:flex tpl:items-center tpl:justify-center tpl:rounded-[var(--tpl-radius-lg)]",
|
|
2895
2888
|
style: {
|
|
@@ -2897,27 +2890,27 @@ var Vr = {
|
|
|
2897
2890
|
"backdrop-filter": "blur(8px)",
|
|
2898
2891
|
"-webkit-backdrop-filter": "blur(8px)"
|
|
2899
2892
|
},
|
|
2900
|
-
onClick: n[11] ||= F((...e) => k(
|
|
2901
|
-
}, [f("div",
|
|
2902
|
-
f("h3",
|
|
2893
|
+
onClick: n[11] ||= F((...e) => k(v).cancelDelete && k(v).cancelDelete(...e), ["self"])
|
|
2894
|
+
}, [f("div", vi, [
|
|
2895
|
+
f("h3", yi, D(a.value.mediaLibrary.deleteWarningTitle), 1),
|
|
2903
2896
|
f("p", {
|
|
2904
|
-
class: y(["tpl:text-xs", k(
|
|
2897
|
+
class: y(["tpl:text-xs", k(E).hasUsedFiles.value ? "tpl:mb-2" : "tpl:mb-4"]),
|
|
2905
2898
|
style: { color: "var(--tpl-text-muted)" }
|
|
2906
2899
|
}, D(a.value.mediaLibrary.deleteWarningMessage), 3),
|
|
2907
|
-
k(
|
|
2908
|
-
k(
|
|
2900
|
+
k(E).hasUsedFiles.value ? (S(), d("p", bi, D(a.value.mediaLibrary.deleteWarningUsageNote), 1)) : u("", !0),
|
|
2901
|
+
k(E).hasUsedFiles.value ? (S(), d("div", xi, [(S(!0), d(i, null, T(k(v).deleteUsageInfo.value, (e, t) => (S(), d("div", {
|
|
2909
2902
|
key: t,
|
|
2910
2903
|
class: "tpl:text-xs",
|
|
2911
2904
|
style: { color: "var(--tpl-text)" }
|
|
2912
|
-
}, [e.template_count > 0 ? (S(), d(i, { key: 0 }, [f("span",
|
|
2913
|
-
f("div",
|
|
2905
|
+
}, [e.template_count > 0 ? (S(), d(i, { key: 0 }, [f("span", Si, D(k(E).displayItems.value.find((e) => e.id === t)?.filename || t), 1), f("span", Ci, " - " + D(a.value.mediaLibrary.usedInTemplates.replace("{count}", e.template_count.toString())), 1)], 64)) : u("", !0)]))), 128))])) : u("", !0),
|
|
2906
|
+
f("div", wi, [f("button", {
|
|
2914
2907
|
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",
|
|
2915
2908
|
style: {
|
|
2916
2909
|
"border-color": "var(--tpl-border)",
|
|
2917
2910
|
color: "var(--tpl-text)",
|
|
2918
2911
|
"background-color": "var(--tpl-bg)"
|
|
2919
2912
|
},
|
|
2920
|
-
onClick: n[9] ||= (...e) => k(
|
|
2913
|
+
onClick: n[9] ||= (...e) => k(v).cancelDelete && k(v).cancelDelete(...e)
|
|
2921
2914
|
}, D(a.value.mediaLibrary.cancel), 1), f("button", {
|
|
2922
2915
|
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",
|
|
2923
2916
|
style: {
|
|
@@ -2925,31 +2918,31 @@ var Vr = {
|
|
|
2925
2918
|
color: "var(--tpl-danger)",
|
|
2926
2919
|
"background-color": "var(--tpl-danger-light)"
|
|
2927
2920
|
},
|
|
2928
|
-
onClick: n[10] ||= (...e) => k(
|
|
2929
|
-
}, D(k(
|
|
2921
|
+
onClick: n[10] ||= (...e) => k(v).confirmDelete && k(v).confirmDelete(...e)
|
|
2922
|
+
}, D(k(E).hasUsedFiles.value ? a.value.mediaLibrary.deleteAnyway : a.value.mediaLibrary.confirmDelete), 1)])
|
|
2930
2923
|
])])) : u("", !0)]),
|
|
2931
2924
|
_: 1
|
|
2932
2925
|
}),
|
|
2933
|
-
f("div",
|
|
2926
|
+
f("div", Ti, [f("div", Ei, [k(v).previewItem.value ? (S(), l(wn, {
|
|
2934
2927
|
key: 0,
|
|
2935
|
-
"selected-conversion": k(
|
|
2936
|
-
"onUpdate:selectedConversion": n[12] ||= (e) => k(
|
|
2937
|
-
item: k(
|
|
2938
|
-
folders: k(
|
|
2928
|
+
"selected-conversion": k(E).selectedConversion.value,
|
|
2929
|
+
"onUpdate:selectedConversion": n[12] ||= (e) => k(E).selectedConversion.value = e,
|
|
2930
|
+
item: k(v).previewItem.value,
|
|
2931
|
+
folders: k(v).folders.value
|
|
2939
2932
|
}, null, 8, [
|
|
2940
2933
|
"selected-conversion",
|
|
2941
2934
|
"item",
|
|
2942
2935
|
"folders"
|
|
2943
|
-
])) : u("", !0)]), f("div",
|
|
2936
|
+
])) : u("", !0)]), f("div", Di, [k(v).selectedItems.value.size > 0 ? (S(), d("div", Oi, [k(v).previewItem.value ? (S(), d("button", {
|
|
2944
2937
|
key: 0,
|
|
2945
2938
|
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",
|
|
2946
2939
|
style: b({
|
|
2947
|
-
borderColor: k(
|
|
2948
|
-
color: k(
|
|
2940
|
+
borderColor: k(E).copied.value ? "var(--tpl-success)" : "var(--tpl-border)",
|
|
2941
|
+
color: k(E).copied.value ? "var(--tpl-success)" : "var(--tpl-text)",
|
|
2949
2942
|
backgroundColor: "var(--tpl-bg)"
|
|
2950
2943
|
}),
|
|
2951
|
-
onClick: n[13] ||= (e) => k(
|
|
2952
|
-
}, [k(
|
|
2944
|
+
onClick: n[13] ||= (e) => k(E).copy(k(E).selectedUrl.value)
|
|
2945
|
+
}, [k(E).copied.value ? (S(), l(k(I), {
|
|
2953
2946
|
key: 1,
|
|
2954
2947
|
size: 12,
|
|
2955
2948
|
"stroke-width": 2
|
|
@@ -2957,25 +2950,25 @@ var Vr = {
|
|
|
2957
2950
|
key: 0,
|
|
2958
2951
|
size: 12,
|
|
2959
2952
|
"stroke-width": 2
|
|
2960
|
-
})), p(" " + D(k(
|
|
2953
|
+
})), p(" " + D(k(E).copied.value ? a.value.mediaLibrary.copied : a.value.mediaLibrary.copyUrl), 1)], 4)) : u("", !0), f("div", ki, [f("button", {
|
|
2961
2954
|
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",
|
|
2962
2955
|
style: {
|
|
2963
2956
|
"border-color": "var(--tpl-border)",
|
|
2964
2957
|
color: "var(--tpl-text)",
|
|
2965
2958
|
"background-color": "var(--tpl-bg)"
|
|
2966
2959
|
},
|
|
2967
|
-
onClick: n[14] ||= (e) => k(
|
|
2968
|
-
}, D(a.value.mediaLibrary.moveSelected), 1), k(
|
|
2960
|
+
onClick: n[14] ||= (e) => k(E).showMovePicker.value = !k(E).showMovePicker.value
|
|
2961
|
+
}, D(a.value.mediaLibrary.moveSelected), 1), k(E).showMovePicker.value ? (S(), l(pn, {
|
|
2969
2962
|
key: 0,
|
|
2970
|
-
folders: k(
|
|
2971
|
-
"current-folder-id": k(
|
|
2972
|
-
onSelect: k(
|
|
2973
|
-
onClose: n[15] ||= (e) => k(
|
|
2963
|
+
folders: k(v).folders.value,
|
|
2964
|
+
"current-folder-id": k(v).currentFolderId.value,
|
|
2965
|
+
onSelect: k(E).handleMoveToFolder,
|
|
2966
|
+
onClose: n[15] ||= (e) => k(E).showMovePicker.value = !1
|
|
2974
2967
|
}, null, 8, [
|
|
2975
2968
|
"folders",
|
|
2976
2969
|
"current-folder-id",
|
|
2977
2970
|
"onSelect"
|
|
2978
|
-
])) : u("", !0)])
|
|
2971
|
+
])) : u("", !0)])])) : u("", !0), f("div", Ai, [k(v).selectedItems.value.size > 0 ? (S(), d("button", {
|
|
2979
2972
|
key: 0,
|
|
2980
2973
|
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",
|
|
2981
2974
|
style: {
|
|
@@ -2983,7 +2976,7 @@ var Vr = {
|
|
|
2983
2976
|
color: "var(--tpl-danger)",
|
|
2984
2977
|
"background-color": "var(--tpl-danger-light)"
|
|
2985
2978
|
},
|
|
2986
|
-
onClick: n[16] ||= (...e) => k(
|
|
2979
|
+
onClick: n[16] ||= (...e) => k(E).handleDeleteClick && k(E).handleDeleteClick(...e)
|
|
2987
2980
|
}, D(a.value.mediaLibrary.deleteSelected), 1)) : u("", !0), e.onSelect ? (S(), d("button", {
|
|
2988
2981
|
key: 1,
|
|
2989
2982
|
class: "tpl:cursor-pointer tpl:rounded-md tpl:px-4 tpl:py-1.5 tpl:text-sm tpl:font-medium tpl:shadow-xs tpl:transition-all tpl:duration-150 tpl:hover:opacity-90 tpl:disabled:cursor-not-allowed tpl:disabled:opacity-50",
|
|
@@ -2991,12 +2984,12 @@ var Vr = {
|
|
|
2991
2984
|
"background-color": "var(--tpl-primary)",
|
|
2992
2985
|
color: "var(--tpl-bg)"
|
|
2993
2986
|
},
|
|
2994
|
-
disabled: !k(
|
|
2995
|
-
onClick:
|
|
2996
|
-
}, D(a.value.mediaLibrary.selectFile), 9,
|
|
2987
|
+
disabled: !k(v).previewItem.value,
|
|
2988
|
+
onClick: O
|
|
2989
|
+
}, D(a.value.mediaLibrary.selectFile), 9, ji)) : u("", !0)])])])
|
|
2997
2990
|
]));
|
|
2998
2991
|
}
|
|
2999
|
-
}),
|
|
2992
|
+
}), Ni = /* #__PURE__ */ Object.assign({
|
|
3000
2993
|
"./locales/ca.ts": () => import("./ca-DnghH5Xn.js"),
|
|
3001
2994
|
"./locales/de.ts": () => import("./de-ByQyu2jv.js"),
|
|
3002
2995
|
"./locales/en.ts": () => import("./en-B-xajqfh.js"),
|
|
@@ -3005,70 +2998,70 @@ var Vr = {
|
|
|
3005
2998
|
"./locales/nl.ts": () => import("./nl-DGT1t3Be.js"),
|
|
3006
2999
|
"./locales/pt-BR.ts": () => import("./pt-BR-C0Hzc26R.js")
|
|
3007
3000
|
});
|
|
3008
|
-
function
|
|
3001
|
+
function Pi(e) {
|
|
3009
3002
|
return Object.keys(e).map((e) => e.match(/\/([^/]+)\.ts$/)?.[1]).filter((e) => !!e);
|
|
3010
3003
|
}
|
|
3011
|
-
var
|
|
3012
|
-
function
|
|
3004
|
+
var Fi = Pi(Ni);
|
|
3005
|
+
function Ii(e) {
|
|
3013
3006
|
return e.trim().replace(/_/g, "-").toLowerCase();
|
|
3014
3007
|
}
|
|
3015
|
-
function
|
|
3016
|
-
let t =
|
|
3017
|
-
return
|
|
3008
|
+
function Li(e) {
|
|
3009
|
+
let t = Ii(e);
|
|
3010
|
+
return Fi.find((e) => Ii(e) === t);
|
|
3018
3011
|
}
|
|
3019
|
-
function
|
|
3020
|
-
return
|
|
3012
|
+
function Ri(e) {
|
|
3013
|
+
return Ii(e).split("-")[0];
|
|
3021
3014
|
}
|
|
3022
|
-
function
|
|
3023
|
-
return
|
|
3015
|
+
function zi(e) {
|
|
3016
|
+
return Li(e) ?? Li(Ri(e)) ?? "en";
|
|
3024
3017
|
}
|
|
3025
|
-
async function
|
|
3026
|
-
let t =
|
|
3018
|
+
async function Bi(e) {
|
|
3019
|
+
let t = Ni[`./locales/${zi(e)}.ts`];
|
|
3027
3020
|
return (await t()).default;
|
|
3028
3021
|
}
|
|
3029
3022
|
//#endregion
|
|
3030
3023
|
//#region src/standalone/visual.ts
|
|
3031
|
-
var
|
|
3032
|
-
async function
|
|
3024
|
+
var Q = null, Vi = w(null);
|
|
3025
|
+
async function Hi(e) {
|
|
3033
3026
|
let n = typeof e.container == "string" ? document.querySelector(e.container) : e.container;
|
|
3034
3027
|
if (!n) throw Error(`Container element not found: ${e.container}`);
|
|
3035
3028
|
let i = r(e.auth, e.onError);
|
|
3036
3029
|
await i.initialize();
|
|
3037
|
-
let a = await new t(i).fetchConfig(), o = await
|
|
3038
|
-
return
|
|
3030
|
+
let a = await new t(i).fetchConfig(), o = await Bi(e.locale ?? "en");
|
|
3031
|
+
return Ui(n, e.theme), Q && $(), new Promise((t, r) => {
|
|
3039
3032
|
try {
|
|
3040
|
-
|
|
3033
|
+
Q = c({ setup() {
|
|
3041
3034
|
let r = () => {
|
|
3042
3035
|
t({
|
|
3043
|
-
setTheme: (e) =>
|
|
3044
|
-
unmount:
|
|
3036
|
+
setTheme: (e) => Ui(n, e),
|
|
3037
|
+
unmount: $
|
|
3045
3038
|
});
|
|
3046
3039
|
};
|
|
3047
|
-
return () => g(
|
|
3040
|
+
return () => g(Mi, {
|
|
3048
3041
|
authManager: i,
|
|
3049
3042
|
projectId: i.projectId,
|
|
3050
3043
|
planConfig: a,
|
|
3051
3044
|
translations: o,
|
|
3052
3045
|
onSelect: e.onSelect,
|
|
3053
3046
|
onError: e.onError,
|
|
3054
|
-
ref:
|
|
3047
|
+
ref: Vi,
|
|
3055
3048
|
onReady: r
|
|
3056
3049
|
});
|
|
3057
|
-
} }),
|
|
3050
|
+
} }), Q.mount(n);
|
|
3058
3051
|
} catch (e) {
|
|
3059
3052
|
r(e);
|
|
3060
3053
|
}
|
|
3061
3054
|
});
|
|
3062
3055
|
}
|
|
3063
|
-
function
|
|
3064
|
-
|
|
3056
|
+
function $() {
|
|
3057
|
+
Q && (Q.unmount(), Q = null, Vi.value = null);
|
|
3065
3058
|
}
|
|
3066
|
-
function
|
|
3059
|
+
function Ui(e, t) {
|
|
3067
3060
|
t && (t.primaryColor && e.style.setProperty("--tpl-primary", t.primaryColor), t.borderRadius !== void 0 && (e.style.setProperty("--tpl-radius", `${t.borderRadius}px`), e.style.setProperty("--tpl-radius-sm", `${Math.max(0, t.borderRadius - 3)}px`), e.style.setProperty("--tpl-radius-lg", `${t.borderRadius + 4}px`)));
|
|
3068
3061
|
}
|
|
3069
3062
|
typeof window < "u" && (window.TemplaticalMedia = {
|
|
3070
|
-
init:
|
|
3071
|
-
unmount:
|
|
3063
|
+
init: Hi,
|
|
3064
|
+
unmount: $
|
|
3072
3065
|
});
|
|
3073
3066
|
//#endregion
|
|
3074
|
-
export {
|
|
3067
|
+
export { fe as MediaApiClient, Vr as MediaLibraryModal, Hi as init, $ as unmount, X as useI18n, Z as useMediaCategories, pe as useMediaLibrary, Hr as useMediaPicker };
|