@templatical/media-library 0.6.7 → 0.7.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/README.md +7 -0
- package/dist/cdn/media-library.css +1 -1
- package/dist/cdn/media-library.js +753 -750
- package/dist/cdn/media-library.js.map +1 -1
- package/dist/index.d.ts +9 -0
- package/dist/templatical-media-library.css +1 -1
- package/dist/templatical-media-library.js +680 -677
- 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
|
-
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,
|
|
3
|
-
import { Check as
|
|
4
|
-
import { Cropper as
|
|
5
|
-
import { onClickOutside as
|
|
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 J, Search as Y, Star as ee, Trash2 as X, Upload as te, X as ne } from "@lucide/vue";
|
|
4
|
+
import { Cropper as re } from "vue-advanced-cropper";
|
|
5
|
+
import { onClickOutside as ie, useClipboard as ae, useDebounceFn as oe, useDropZone as se, useEventListener as ce, useFileDialog as le, useIntersectionObserver as ue } from "@vueuse/core";
|
|
6
6
|
//#region src/api-client.ts
|
|
7
|
-
var
|
|
7
|
+
var de = class {
|
|
8
8
|
constructor(e) {
|
|
9
9
|
this.authManager = e;
|
|
10
10
|
}
|
|
@@ -160,9 +160,9 @@ var ue = class {
|
|
|
160
160
|
};
|
|
161
161
|
//#endregion
|
|
162
162
|
//#region src/composable.ts
|
|
163
|
-
function
|
|
163
|
+
function fe(e) {
|
|
164
164
|
if (!e.projectId) throw Error("projectId is required for useMediaLibrary");
|
|
165
|
-
let t = new
|
|
165
|
+
let t = new de(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;
|
|
166
166
|
async function k() {
|
|
167
167
|
let r = ++O;
|
|
168
168
|
l.value = !0;
|
|
@@ -467,14 +467,14 @@ function Z(e) {
|
|
|
467
467
|
}
|
|
468
468
|
//#endregion
|
|
469
469
|
//#region src/components/media/MediaBreadcrumb.vue?vue&type=script&setup=true&lang.ts
|
|
470
|
-
var
|
|
470
|
+
var pe = {
|
|
471
471
|
key: 0,
|
|
472
472
|
class: "tpl:flex tpl:items-center tpl:gap-1 tpl:text-xs",
|
|
473
473
|
style: { color: "var(--tpl-text-muted)" }
|
|
474
|
-
},
|
|
474
|
+
}, me = ["onClick"], he = {
|
|
475
475
|
key: 1,
|
|
476
476
|
style: { color: "var(--tpl-text)" }
|
|
477
|
-
},
|
|
477
|
+
}, ge = /* @__PURE__ */ h({
|
|
478
478
|
__name: "MediaBreadcrumb",
|
|
479
479
|
props: {
|
|
480
480
|
folders: {},
|
|
@@ -494,11 +494,11 @@ var fe = {
|
|
|
494
494
|
}
|
|
495
495
|
return !1;
|
|
496
496
|
}
|
|
497
|
-
return (e, t) => o.value.length > 0 ? (S(), d("div",
|
|
497
|
+
return (e, t) => o.value.length > 0 ? (S(), d("div", pe, [f("button", {
|
|
498
498
|
class: "tpl:transition-colors tpl:duration-150 tpl:hover:underline",
|
|
499
499
|
style: { color: "var(--tpl-primary)" },
|
|
500
500
|
onClick: t[0] ||= (e) => r("navigate", null)
|
|
501
|
-
}, D(
|
|
501
|
+
}, D(k(a).mediaLibrary.allFiles), 1), (S(!0), d(i, null, T(o.value, (e, t) => (S(), d(i, { key: e.id }, [m(k(L), {
|
|
502
502
|
size: 12,
|
|
503
503
|
"stroke-width": 2
|
|
504
504
|
}), t < o.value.length - 1 ? (S(), d("button", {
|
|
@@ -506,7 +506,7 @@ var fe = {
|
|
|
506
506
|
class: "tpl:transition-colors tpl:duration-150 tpl:hover:underline",
|
|
507
507
|
style: { color: "var(--tpl-primary)" },
|
|
508
508
|
onClick: (t) => r("navigate", e.id)
|
|
509
|
-
}, D(e.name), 9,
|
|
509
|
+
}, D(e.name), 9, me)) : (S(), d("span", he, D(e.name), 1))], 64))), 128))])) : u("", !0);
|
|
510
510
|
}
|
|
511
511
|
});
|
|
512
512
|
//#endregion
|
|
@@ -537,14 +537,14 @@ function Q() {
|
|
|
537
537
|
}
|
|
538
538
|
//#endregion
|
|
539
539
|
//#region src/composables/useImageCrop.ts
|
|
540
|
-
var
|
|
540
|
+
var _e = {
|
|
541
541
|
free: void 0,
|
|
542
542
|
square: 1,
|
|
543
543
|
landscape43: 4 / 3,
|
|
544
544
|
landscape169: 16 / 9,
|
|
545
545
|
original: void 0
|
|
546
546
|
};
|
|
547
|
-
function
|
|
547
|
+
function ve(e) {
|
|
548
548
|
return e === "image/png" || e === "image/gif" ? {
|
|
549
549
|
mimeType: "image/png",
|
|
550
550
|
quality: 1
|
|
@@ -556,7 +556,7 @@ function _e(e) {
|
|
|
556
556
|
quality: .92
|
|
557
557
|
};
|
|
558
558
|
}
|
|
559
|
-
function
|
|
559
|
+
function ye(e, t, n) {
|
|
560
560
|
let r = e.width, i = e.height;
|
|
561
561
|
if (!t && !n) return e;
|
|
562
562
|
let a = r, o = i;
|
|
@@ -566,7 +566,7 @@ function ve(e, t, n) {
|
|
|
566
566
|
let c = s.getContext("2d");
|
|
567
567
|
return c && (c.imageSmoothingEnabled = !0, c.imageSmoothingQuality = "high", c.drawImage(e, 0, 0, a, o)), s;
|
|
568
568
|
}
|
|
569
|
-
function
|
|
569
|
+
function be(e, t, n) {
|
|
570
570
|
return new Promise((r, i) => {
|
|
571
571
|
e.toBlob((e) => {
|
|
572
572
|
if (!e) {
|
|
@@ -578,7 +578,7 @@ function ye(e, t, n) {
|
|
|
578
578
|
}, n.mimeType, n.quality);
|
|
579
579
|
});
|
|
580
580
|
}
|
|
581
|
-
function
|
|
581
|
+
function xe(e, t, n, r) {
|
|
582
582
|
let i = e, a = t;
|
|
583
583
|
if (n && i > n) {
|
|
584
584
|
let e = n / i;
|
|
@@ -594,58 +594,58 @@ function be(e, t, n, r) {
|
|
|
594
594
|
};
|
|
595
595
|
}
|
|
596
596
|
//#endregion
|
|
597
|
-
//#region src/
|
|
598
|
-
var
|
|
597
|
+
//#region src/keys.ts
|
|
598
|
+
var Se = Symbol("templaticalMediaPopoverTarget"), Ce = ["data-tpl-theme"], we = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, Te = {
|
|
599
599
|
class: "tpl:text-sm tpl:font-semibold",
|
|
600
600
|
style: { color: "var(--tpl-text)" }
|
|
601
|
-
},
|
|
601
|
+
}, Ee = { class: "tpl:min-h-0 tpl:flex-1 tpl:overflow-y-auto tpl:px-5" }, De = {
|
|
602
602
|
key: 0,
|
|
603
603
|
class: "tpl:mb-4"
|
|
604
|
-
},
|
|
604
|
+
}, Oe = {
|
|
605
605
|
class: "tpl:relative tpl:mb-3 tpl:overflow-hidden tpl:rounded-md tpl:border",
|
|
606
606
|
style: {
|
|
607
607
|
"border-color": "var(--tpl-border)",
|
|
608
608
|
height: "300px",
|
|
609
609
|
"background-color": "var(--tpl-bg)"
|
|
610
610
|
}
|
|
611
|
-
},
|
|
611
|
+
}, ke = { class: "tpl:space-y-3" }, Ae = {
|
|
612
612
|
class: "tpl:mb-1.5 tpl:block tpl:text-xs tpl:font-medium",
|
|
613
613
|
style: { color: "var(--tpl-text-muted)" }
|
|
614
|
-
},
|
|
614
|
+
}, je = { class: "tpl:flex tpl:flex-wrap tpl:gap-1.5" }, Me = ["onClick"], Ne = { class: "tpl:flex tpl:gap-3" }, Pe = { class: "tpl:flex-1" }, Fe = {
|
|
615
615
|
class: "tpl:mb-1 tpl:block tpl:text-xs tpl:font-medium",
|
|
616
616
|
style: { color: "var(--tpl-text-muted)" }
|
|
617
|
-
},
|
|
617
|
+
}, Ie = {
|
|
618
618
|
class: "tpl:font-normal",
|
|
619
619
|
style: { color: "var(--tpl-text-dim)" }
|
|
620
|
-
},
|
|
620
|
+
}, Le = { class: "tpl:relative" }, Re = ["value", "placeholder"], ze = {
|
|
621
621
|
class: "tpl:absolute tpl:top-1/2 tpl:right-2.5 tpl:-translate-y-1/2 tpl:text-xs",
|
|
622
622
|
style: { color: "var(--tpl-text-dim)" }
|
|
623
|
-
},
|
|
623
|
+
}, Be = { class: "tpl:flex-1" }, Ve = {
|
|
624
624
|
class: "tpl:mb-1 tpl:block tpl:text-xs tpl:font-medium",
|
|
625
625
|
style: { color: "var(--tpl-text-muted)" }
|
|
626
|
-
},
|
|
626
|
+
}, He = {
|
|
627
627
|
class: "tpl:font-normal",
|
|
628
628
|
style: { color: "var(--tpl-text-dim)" }
|
|
629
|
-
},
|
|
629
|
+
}, Ue = { class: "tpl:relative" }, We = ["value", "placeholder"], Ge = {
|
|
630
630
|
class: "tpl:absolute tpl:top-1/2 tpl:right-2.5 tpl:-translate-y-1/2 tpl:text-xs",
|
|
631
631
|
style: { color: "var(--tpl-text-dim)" }
|
|
632
|
-
},
|
|
632
|
+
}, Ke = {
|
|
633
633
|
key: 0,
|
|
634
634
|
class: "tpl:flex tpl:items-center tpl:gap-1 tpl:text-xs",
|
|
635
635
|
style: { color: "var(--tpl-text-muted)" }
|
|
636
|
-
},
|
|
636
|
+
}, qe = {
|
|
637
637
|
class: "tpl:font-medium",
|
|
638
638
|
style: { color: "var(--tpl-text)" }
|
|
639
|
-
},
|
|
639
|
+
}, Je = { class: "tpl:mb-3" }, Ye = {
|
|
640
640
|
class: "tpl:mb-1 tpl:block tpl:text-xs tpl:font-medium",
|
|
641
641
|
style: { color: "var(--tpl-text-muted)" }
|
|
642
|
-
},
|
|
642
|
+
}, Xe = ["autofocus"], Ze = {
|
|
643
643
|
key: 1,
|
|
644
644
|
class: "tpl:mb-4"
|
|
645
|
-
},
|
|
645
|
+
}, Qe = {
|
|
646
646
|
class: "tpl:mb-1 tpl:block tpl:text-xs tpl:font-medium",
|
|
647
647
|
style: { color: "var(--tpl-text-muted)" }
|
|
648
|
-
},
|
|
648
|
+
}, $e = ["placeholder"], et = { class: "tpl:flex tpl:shrink-0 tpl:justify-end tpl:gap-2 tpl:p-5 tpl:pt-4" }, tt = ["disabled"], nt = /* @__PURE__ */ h({
|
|
649
649
|
__name: "MediaEditModal",
|
|
650
650
|
props: {
|
|
651
651
|
visible: { type: Boolean },
|
|
@@ -653,56 +653,56 @@ var xe = ["data-tpl-theme"], Se = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, Ce
|
|
|
653
653
|
},
|
|
654
654
|
emits: ["save", "close"],
|
|
655
655
|
setup(e, { emit: t }) {
|
|
656
|
-
let n = e, r = t, { t: c } = Z(), h = _("tplUiTheme"), g = c.mediaLibrary, { isImageMimeType:
|
|
656
|
+
let n = e, r = t, { t: c } = Z(), h = _("tplUiTheme"), g = _(Se, w(null)), v = c.mediaLibrary, { isImageMimeType: x } = Q(), 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 ? [
|
|
657
657
|
"image/jpeg",
|
|
658
658
|
"image/png",
|
|
659
659
|
"image/webp",
|
|
660
660
|
"image/gif"
|
|
661
|
-
].includes(n.item.mime_type) : !1),
|
|
662
|
-
|
|
663
|
-
e && n.item && (
|
|
661
|
+
].includes(n.item.mime_type) : !1), K = s(() => P.value === "original" ? B.value : _e[P.value]), q = s(() => V.value ? xe(V.value.width, V.value.height, I.value, L.value) : null);
|
|
662
|
+
j(() => n.visible, (e) => {
|
|
663
|
+
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));
|
|
664
664
|
});
|
|
665
|
-
function
|
|
666
|
-
e.coordinates && (
|
|
665
|
+
function J(e) {
|
|
666
|
+
e.coordinates && (V.value = {
|
|
667
667
|
width: Math.round(e.coordinates.width),
|
|
668
668
|
height: Math.round(e.coordinates.height)
|
|
669
|
-
},
|
|
670
|
-
}
|
|
671
|
-
function J() {
|
|
672
|
-
V.value = !0, !z.value && n.item?.width && n.item?.height && (z.value = n.item.width / n.item.height);
|
|
669
|
+
}, W.value = !0);
|
|
673
670
|
}
|
|
674
|
-
function Y(
|
|
675
|
-
|
|
676
|
-
L.value = t, F.value = t && parseInt(t, 10) || void 0;
|
|
671
|
+
function Y() {
|
|
672
|
+
H.value = !0, !B.value && n.item?.width && n.item?.height && (B.value = n.item.width / n.item.height);
|
|
677
673
|
}
|
|
678
674
|
function ee(e) {
|
|
679
675
|
let t = e.target.value;
|
|
680
676
|
R.value = t, I.value = t && parseInt(t, 10) || void 0;
|
|
681
677
|
}
|
|
682
|
-
|
|
683
|
-
let
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
678
|
+
function X(e) {
|
|
679
|
+
let t = e.target.value;
|
|
680
|
+
z.value = t, L.value = t && parseInt(t, 10) || void 0;
|
|
681
|
+
}
|
|
682
|
+
async function te() {
|
|
683
|
+
let e = C.value.trim();
|
|
684
|
+
if (!e || !n.item || U.value) return;
|
|
685
|
+
let t = x(n.item.mime_type), i;
|
|
686
|
+
if (G.value && O.value && W.value) {
|
|
687
|
+
U.value = !0;
|
|
688
688
|
try {
|
|
689
|
-
let { canvas: e } =
|
|
689
|
+
let { canvas: e } = O.value.getResult();
|
|
690
690
|
if (e) {
|
|
691
|
-
let t =
|
|
692
|
-
i = { file: await
|
|
691
|
+
let t = ye(e, I.value, L.value), r = ve(n.item.mime_type);
|
|
692
|
+
i = { file: await be(t, n.item.filename, r) };
|
|
693
693
|
}
|
|
694
694
|
} catch {
|
|
695
|
-
|
|
695
|
+
U.value = !1;
|
|
696
696
|
return;
|
|
697
697
|
}
|
|
698
|
-
|
|
698
|
+
U.value = !1;
|
|
699
699
|
}
|
|
700
|
-
r("save", n.item.id, e, t ?
|
|
700
|
+
r("save", n.item.id, e, t ? E.value : void 0, i), r("close");
|
|
701
701
|
}
|
|
702
|
-
function
|
|
703
|
-
e.key === "Enter" && !
|
|
702
|
+
function ne(e) {
|
|
703
|
+
e.key === "Enter" && !U.value && (e.preventDefault(), te()), e.key === "Escape" && r("close");
|
|
704
704
|
}
|
|
705
|
-
return (t, n) => (S(), l(a, { to: "body" }, [m(o, {
|
|
705
|
+
return (t, n) => (S(), l(a, { to: k(g) || "body" }, [m(o, {
|
|
706
706
|
"enter-active-class": "tpl:transition tpl:ease-out tpl:duration-150",
|
|
707
707
|
"enter-from-class": "tpl:opacity-0",
|
|
708
708
|
"enter-to-class": "tpl:opacity-100",
|
|
@@ -710,30 +710,30 @@ var xe = ["data-tpl-theme"], Se = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, Ce
|
|
|
710
710
|
"leave-from-class": "tpl:opacity-100",
|
|
711
711
|
"leave-to-class": "tpl:opacity-0"
|
|
712
712
|
}, {
|
|
713
|
-
default:
|
|
713
|
+
default: M(() => [e.visible && e.item ? (S(), d("div", {
|
|
714
714
|
key: 0,
|
|
715
|
-
"data-tpl-theme":
|
|
715
|
+
"data-tpl-theme": k(h),
|
|
716
716
|
class: "tpl tpl:fixed tpl:inset-0 tpl:z-[10000] tpl:flex tpl:items-center tpl:justify-center",
|
|
717
717
|
style: { "background-color": "var(--tpl-overlay)" },
|
|
718
|
-
onClick: n[3] ||=
|
|
719
|
-
onKeydown:
|
|
718
|
+
onClick: n[3] ||= F((e) => r("close"), ["self"]),
|
|
719
|
+
onKeydown: ne
|
|
720
720
|
}, [f("div", {
|
|
721
|
-
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",
|
|
721
|
+
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"]),
|
|
722
722
|
style: { "background-color": "var(--tpl-bg-elevated)" }
|
|
723
723
|
}, [
|
|
724
|
-
f("div",
|
|
725
|
-
f("div",
|
|
726
|
-
|
|
724
|
+
f("div", we, [f("h3", Te, D(k(c).mediaLibrary.editFile), 1)]),
|
|
725
|
+
f("div", Ee, [
|
|
726
|
+
G.value ? (S(), d("div", De, [f("div", Oe, [m(k(re), {
|
|
727
727
|
ref_key: "cropperRef",
|
|
728
|
-
ref:
|
|
728
|
+
ref: O,
|
|
729
729
|
src: e.item.url,
|
|
730
|
-
"stencil-props": { aspectRatio:
|
|
730
|
+
"stencil-props": { aspectRatio: K.value },
|
|
731
731
|
class: "tpl:h-full tpl:w-full",
|
|
732
732
|
"background-class": "tpl-cropper-background",
|
|
733
|
-
onChange:
|
|
734
|
-
onReady:
|
|
735
|
-
}, null, 8, ["src", "stencil-props"])]), f("div",
|
|
736
|
-
f("div", null, [f("label",
|
|
733
|
+
onChange: J,
|
|
734
|
+
onReady: Y
|
|
735
|
+
}, null, 8, ["src", "stencil-props"])]), f("div", ke, [
|
|
736
|
+
f("div", null, [f("label", Ae, D(k(c).mediaLibrary.cropAspectRatio), 1), f("div", je, [(S(), d(i, null, T([
|
|
737
737
|
"free",
|
|
738
738
|
"square",
|
|
739
739
|
"landscape43",
|
|
@@ -744,14 +744,14 @@ var xe = ["data-tpl-theme"], Se = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, Ce
|
|
|
744
744
|
type: "button",
|
|
745
745
|
class: "tpl:cursor-pointer tpl:rounded-md tpl:border tpl:px-2.5 tpl:py-1 tpl:text-xs tpl:font-medium tpl:transition-all tpl:duration-150",
|
|
746
746
|
style: b({
|
|
747
|
-
borderColor:
|
|
748
|
-
backgroundColor:
|
|
749
|
-
color:
|
|
747
|
+
borderColor: P.value === e ? "var(--tpl-primary)" : "var(--tpl-border)",
|
|
748
|
+
backgroundColor: P.value === e ? "var(--tpl-primary-light)" : "var(--tpl-bg)",
|
|
749
|
+
color: P.value === e ? "var(--tpl-primary)" : "var(--tpl-text)"
|
|
750
750
|
}),
|
|
751
|
-
onClick: (t) =>
|
|
752
|
-
}, D(
|
|
753
|
-
f("div",
|
|
754
|
-
value:
|
|
751
|
+
onClick: (t) => P.value = e
|
|
752
|
+
}, D(k(v)[`crop${e.charAt(0).toUpperCase()}${e.slice(1)}`]), 13, Me)), 64))])]),
|
|
753
|
+
f("div", Ne, [f("div", Pe, [f("label", Fe, [p(D(k(c).mediaLibrary.cropMaxWidth) + " ", 1), f("span", Ie, D(k(c).mediaLibrary.cropOptional), 1)]), f("div", Le, [f("input", {
|
|
754
|
+
value: R.value,
|
|
755
755
|
type: "number",
|
|
756
756
|
min: "1",
|
|
757
757
|
class: "tpl:w-full tpl:rounded-md tpl:border tpl:py-1.5 tpl:pr-8 tpl:pl-3 tpl:text-xs tpl:outline-none",
|
|
@@ -760,10 +760,10 @@ var xe = ["data-tpl-theme"], Se = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, Ce
|
|
|
760
760
|
"background-color": "var(--tpl-bg)",
|
|
761
761
|
color: "var(--tpl-text)"
|
|
762
762
|
},
|
|
763
|
-
placeholder:
|
|
764
|
-
onInput:
|
|
765
|
-
}, null, 40,
|
|
766
|
-
value:
|
|
763
|
+
placeholder: V.value?.width?.toString() || "",
|
|
764
|
+
onInput: ee
|
|
765
|
+
}, null, 40, Re), f("span", ze, D(k(c).mediaLibrary.cropPixels), 1)])]), f("div", Be, [f("label", Ve, [p(D(k(c).mediaLibrary.cropMaxHeight) + " ", 1), f("span", He, D(k(c).mediaLibrary.cropOptional), 1)]), f("div", Ue, [f("input", {
|
|
766
|
+
value: z.value,
|
|
767
767
|
type: "number",
|
|
768
768
|
min: "1",
|
|
769
769
|
class: "tpl:w-full tpl:rounded-md tpl:border tpl:py-1.5 tpl:pr-8 tpl:pl-3 tpl:text-xs tpl:outline-none",
|
|
@@ -772,13 +772,13 @@ var xe = ["data-tpl-theme"], Se = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, Ce
|
|
|
772
772
|
"background-color": "var(--tpl-bg)",
|
|
773
773
|
color: "var(--tpl-text)"
|
|
774
774
|
},
|
|
775
|
-
placeholder:
|
|
776
|
-
onInput:
|
|
777
|
-
}, null, 40,
|
|
778
|
-
|
|
775
|
+
placeholder: V.value?.height?.toString() || "",
|
|
776
|
+
onInput: X
|
|
777
|
+
}, null, 40, We), f("span", Ge, D(k(c).mediaLibrary.cropPixels), 1)])])]),
|
|
778
|
+
q.value ? (S(), d("div", Ke, [f("span", null, D(k(c).mediaLibrary.cropOutputSize) + ": ", 1), f("span", qe, D(q.value.width) + " x " + D(q.value.height) + " " + D(k(c).mediaLibrary.cropPixels), 1)])) : u("", !0)
|
|
779
779
|
])])) : u("", !0),
|
|
780
|
-
f("div",
|
|
781
|
-
"onUpdate:modelValue": n[0] ||= (e) =>
|
|
780
|
+
f("div", Je, [f("label", Ye, D(k(c).mediaLibrary.fileName), 1), N(f("input", {
|
|
781
|
+
"onUpdate:modelValue": n[0] ||= (e) => C.value = e,
|
|
782
782
|
type: "text",
|
|
783
783
|
class: "tpl:w-full tpl:rounded-md tpl:border tpl:px-3 tpl:py-1.5 tpl:text-xs tpl:outline-none",
|
|
784
784
|
style: {
|
|
@@ -786,10 +786,10 @@ var xe = ["data-tpl-theme"], Se = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, Ce
|
|
|
786
786
|
"background-color": "var(--tpl-bg)",
|
|
787
787
|
color: "var(--tpl-text)"
|
|
788
788
|
},
|
|
789
|
-
autofocus: !
|
|
790
|
-
}, null, 8,
|
|
791
|
-
|
|
792
|
-
"onUpdate:modelValue": n[1] ||= (e) =>
|
|
789
|
+
autofocus: !G.value
|
|
790
|
+
}, null, 8, Xe), [[A, C.value]])]),
|
|
791
|
+
k(x)(e.item.mime_type) ? (S(), d("div", Ze, [f("label", Qe, D(k(c).mediaLibrary.altText), 1), N(f("input", {
|
|
792
|
+
"onUpdate:modelValue": n[1] ||= (e) => E.value = e,
|
|
793
793
|
type: "text",
|
|
794
794
|
class: "tpl:w-full tpl:rounded-md tpl:border tpl:px-3 tpl:py-1.5 tpl:text-xs tpl:outline-none",
|
|
795
795
|
style: {
|
|
@@ -797,10 +797,10 @@ var xe = ["data-tpl-theme"], Se = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, Ce
|
|
|
797
797
|
"background-color": "var(--tpl-bg)",
|
|
798
798
|
color: "var(--tpl-text)"
|
|
799
799
|
},
|
|
800
|
-
placeholder:
|
|
801
|
-
}, null, 8,
|
|
800
|
+
placeholder: k(c).mediaLibrary.altTextPlaceholder
|
|
801
|
+
}, null, 8, $e), [[A, E.value]])])) : u("", !0)
|
|
802
802
|
]),
|
|
803
|
-
f("div",
|
|
803
|
+
f("div", et, [f("button", {
|
|
804
804
|
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",
|
|
805
805
|
style: {
|
|
806
806
|
"border-color": "var(--tpl-border)",
|
|
@@ -808,30 +808,30 @@ var xe = ["data-tpl-theme"], Se = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, Ce
|
|
|
808
808
|
"background-color": "var(--tpl-bg)"
|
|
809
809
|
},
|
|
810
810
|
onClick: n[2] ||= (e) => r("close")
|
|
811
|
-
}, D(
|
|
811
|
+
}, D(k(c).mediaLibrary.cancel), 1), f("button", {
|
|
812
812
|
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",
|
|
813
813
|
style: { background: "linear-gradient(\n 135deg,\n var(--tpl-primary),\n var(--tpl-primary-hover)\n )" },
|
|
814
|
-
disabled:
|
|
815
|
-
onClick:
|
|
816
|
-
}, D(
|
|
817
|
-
], 2)], 40,
|
|
814
|
+
disabled: U.value,
|
|
815
|
+
onClick: te
|
|
816
|
+
}, D(U.value ? k(c).mediaLibrary.saving : k(c).mediaLibrary.saveChanges), 9, tt)])
|
|
817
|
+
], 2)], 40, Ce)) : u("", !0)]),
|
|
818
818
|
_: 1
|
|
819
|
-
})]));
|
|
819
|
+
})], 8, ["to"]));
|
|
820
820
|
}
|
|
821
|
-
}),
|
|
821
|
+
}), rt = (e, t) => {
|
|
822
822
|
let n = e.__vccOpts || e;
|
|
823
823
|
for (let [e, r] of t) n[e] = r;
|
|
824
824
|
return n;
|
|
825
|
-
},
|
|
825
|
+
}, it = /* @__PURE__ */ rt(nt, [["__scopeId", "data-v-6b677237"]]), at = {
|
|
826
826
|
key: 1,
|
|
827
827
|
class: "tpl:size-4 tpl:shrink-0"
|
|
828
|
-
},
|
|
828
|
+
}, ot = {
|
|
829
829
|
key: 0,
|
|
830
830
|
class: "tpl:truncate"
|
|
831
|
-
},
|
|
831
|
+
}, st = {
|
|
832
832
|
key: 3,
|
|
833
833
|
class: "tpl:flex tpl:shrink-0 tpl:items-center tpl:gap-0.5 tpl:opacity-0 tpl:transition-opacity tpl:group-hover:opacity-100"
|
|
834
|
-
},
|
|
834
|
+
}, ct = ["title"], lt = ["title"], ut = { key: 0 }, dt = ["placeholder"], ft = 5, pt = /* @__PURE__ */ h({
|
|
835
835
|
__name: "MediaFolderTreeNode",
|
|
836
836
|
props: {
|
|
837
837
|
folder: {},
|
|
@@ -845,22 +845,22 @@ var xe = ["data-tpl-theme"], Se = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, Ce
|
|
|
845
845
|
"deleteFolder"
|
|
846
846
|
],
|
|
847
847
|
setup(e, { emit: t }) {
|
|
848
|
-
let n = e, r = t, { t: a } = Z(), o = w(!1), c = w(!1), p = w(""), h = w(!1), g = w(""), _ = s(() => (n.folder.children?.length ?? 0) > 0), v = s(() => n.depth <
|
|
848
|
+
let n = e, r = t, { t: a } = Z(), o = w(!1), c = w(!1), p = w(""), h = w(!1), g = w(""), _ = s(() => (n.folder.children?.length ?? 0) > 0), v = s(() => n.depth < ft - 1), 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);
|
|
849
849
|
function j(e, t) {
|
|
850
850
|
for (let n of e) if (n.id === t || n.children && j(n.children, t)) return !0;
|
|
851
851
|
return !1;
|
|
852
852
|
}
|
|
853
|
-
function
|
|
853
|
+
function M() {
|
|
854
854
|
o.value = !o.value;
|
|
855
855
|
}
|
|
856
|
-
function
|
|
856
|
+
function I() {
|
|
857
857
|
c.value = !0, p.value = n.folder.name;
|
|
858
858
|
}
|
|
859
859
|
function R() {
|
|
860
860
|
let e = p.value.trim();
|
|
861
861
|
e && e !== n.folder.name && r("renameFolder", n.folder.id, e), c.value = !1, p.value = "";
|
|
862
862
|
}
|
|
863
|
-
function
|
|
863
|
+
function z() {
|
|
864
864
|
c.value = !1, p.value = "";
|
|
865
865
|
}
|
|
866
866
|
function V() {
|
|
@@ -885,21 +885,21 @@ var xe = ["data-tpl-theme"], Se = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, Ce
|
|
|
885
885
|
_.value || h.value ? (S(), d("button", {
|
|
886
886
|
key: 0,
|
|
887
887
|
class: "tpl:flex tpl:size-4 tpl:shrink-0 tpl:items-center tpl:justify-center tpl:rounded tpl:transition-colors",
|
|
888
|
-
onClick:
|
|
889
|
-
}, [m(
|
|
890
|
-
class: y(["tpl:transition-transform tpl:duration-150", { "tpl:rotate-90":
|
|
888
|
+
onClick: F(M, ["stop"])
|
|
889
|
+
}, [m(k(L), {
|
|
890
|
+
class: y(["tpl:transition-transform tpl:duration-150", { "tpl:rotate-90": O.value }]),
|
|
891
891
|
size: 10,
|
|
892
892
|
"stroke-width": 2
|
|
893
|
-
}, null, 8, ["class"])])) : (S(), d("span",
|
|
893
|
+
}, null, 8, ["class"])])) : (S(), d("span", at)),
|
|
894
894
|
f("button", {
|
|
895
895
|
class: "tpl:flex tpl:min-w-0 tpl:flex-1 tpl:items-center tpl:gap-1.5",
|
|
896
896
|
onClick: n[0] ||= (t) => r("navigate", e.folder.id)
|
|
897
|
-
}, [m(
|
|
897
|
+
}, [m(k(B), {
|
|
898
898
|
class: "tpl:shrink-0",
|
|
899
899
|
size: 14,
|
|
900
900
|
"stroke-width": 1.5
|
|
901
|
-
}), c.value ? u("", !0) : (S(), d("span",
|
|
902
|
-
c.value ?
|
|
901
|
+
}), c.value ? u("", !0) : (S(), d("span", ot, D(e.folder.name), 1))]),
|
|
902
|
+
c.value ? N((S(), d("input", {
|
|
903
903
|
key: 2,
|
|
904
904
|
"onUpdate:modelValue": n[1] ||= (e) => p.value = e,
|
|
905
905
|
type: "text",
|
|
@@ -910,38 +910,38 @@ var xe = ["data-tpl-theme"], Se = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, Ce
|
|
|
910
910
|
color: "var(--tpl-text)"
|
|
911
911
|
},
|
|
912
912
|
autofocus: "",
|
|
913
|
-
onKeydown: [
|
|
913
|
+
onKeydown: [P(R, ["enter"]), P(z, ["escape"])],
|
|
914
914
|
onBlur: R,
|
|
915
|
-
onClick: n[2] ||=
|
|
916
|
-
}, null, 544)), [[
|
|
917
|
-
c.value ? u("", !0) : (S(), d("span",
|
|
915
|
+
onClick: n[2] ||= F(() => {}, ["stop"])
|
|
916
|
+
}, null, 544)), [[A, p.value]]) : u("", !0),
|
|
917
|
+
c.value ? u("", !0) : (S(), d("span", st, [
|
|
918
918
|
v.value ? (S(), d("button", {
|
|
919
919
|
key: 0,
|
|
920
920
|
class: "tpl:flex tpl:size-6 tpl:items-center tpl:justify-center tpl:rounded tpl:transition-colors",
|
|
921
|
-
title:
|
|
922
|
-
onClick:
|
|
923
|
-
}, [m(
|
|
921
|
+
title: k(a).mediaLibrary.addSubfolder,
|
|
922
|
+
onClick: F(V, ["stop"])
|
|
923
|
+
}, [m(k(q), {
|
|
924
924
|
size: 12,
|
|
925
925
|
"stroke-width": 2
|
|
926
|
-
})], 8,
|
|
926
|
+
})], 8, ct)) : u("", !0),
|
|
927
927
|
f("button", {
|
|
928
928
|
class: "tpl:flex tpl:size-6 tpl:items-center tpl:justify-center tpl:rounded tpl:transition-colors",
|
|
929
|
-
title:
|
|
930
|
-
onClick:
|
|
931
|
-
}, [m(
|
|
929
|
+
title: k(a).mediaLibrary.renameFolder,
|
|
930
|
+
onClick: F(I, ["stop"])
|
|
931
|
+
}, [m(k(K), {
|
|
932
932
|
size: 12,
|
|
933
933
|
"stroke-width": 2
|
|
934
|
-
})], 8,
|
|
934
|
+
})], 8, lt),
|
|
935
935
|
f("button", {
|
|
936
936
|
class: "tpl:flex tpl:size-6 tpl:items-center tpl:justify-center tpl:rounded tpl:transition-colors",
|
|
937
|
-
onClick: n[3] ||=
|
|
938
|
-
}, [m(
|
|
937
|
+
onClick: n[3] ||= F((t) => r("deleteFolder", e.folder.id), ["stop"])
|
|
938
|
+
}, [m(k(X), {
|
|
939
939
|
size: 12,
|
|
940
940
|
"stroke-width": 2,
|
|
941
941
|
style: { color: "var(--tpl-danger)" }
|
|
942
942
|
})])
|
|
943
943
|
]))
|
|
944
|
-
], 4),
|
|
944
|
+
], 4), O.value ? (S(), d("div", ut, [(S(!0), d(i, null, T(e.folder.children, (t) => (S(), l(o, {
|
|
945
945
|
key: t.id,
|
|
946
946
|
folder: t,
|
|
947
947
|
"current-folder-id": e.currentFolderId,
|
|
@@ -958,7 +958,7 @@ var xe = ["data-tpl-theme"], Se = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, Ce
|
|
|
958
958
|
key: 0,
|
|
959
959
|
style: b({ paddingLeft: `${(e.depth + 1) * 16 + 8}px` }),
|
|
960
960
|
class: "tpl:py-1.5 tpl:pr-2"
|
|
961
|
-
}, [
|
|
961
|
+
}, [N(f("input", {
|
|
962
962
|
"onUpdate:modelValue": n[8] ||= (e) => g.value = e,
|
|
963
963
|
type: "text",
|
|
964
964
|
class: "tpl:w-full tpl:rounded tpl:border tpl:px-2 tpl:py-1 tpl:text-xs tpl:outline-none",
|
|
@@ -967,17 +967,17 @@ var xe = ["data-tpl-theme"], Se = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, Ce
|
|
|
967
967
|
"background-color": "var(--tpl-bg)",
|
|
968
968
|
color: "var(--tpl-text)"
|
|
969
969
|
},
|
|
970
|
-
placeholder:
|
|
970
|
+
placeholder: k(a).mediaLibrary.subfolderName,
|
|
971
971
|
autofocus: "",
|
|
972
|
-
onKeydown: [
|
|
972
|
+
onKeydown: [P(H, ["enter"]), P(U, ["escape"])],
|
|
973
973
|
onBlur: H
|
|
974
|
-
}, null, 40,
|
|
974
|
+
}, null, 40, dt), [[A, g.value]])], 4)) : u("", !0)])) : u("", !0)]);
|
|
975
975
|
};
|
|
976
976
|
}
|
|
977
|
-
}),
|
|
977
|
+
}), mt = { class: "tpl:flex tpl:h-full tpl:flex-col tpl:overflow-y-auto" }, ht = {
|
|
978
978
|
key: 0,
|
|
979
979
|
class: "tpl:px-3 tpl:py-2"
|
|
980
|
-
},
|
|
980
|
+
}, gt = ["placeholder"], _t = /* @__PURE__ */ h({
|
|
981
981
|
__name: "MediaFolderTree",
|
|
982
982
|
props: {
|
|
983
983
|
folders: {},
|
|
@@ -1003,7 +1003,7 @@ var xe = ["data-tpl-theme"], Se = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, Ce
|
|
|
1003
1003
|
function h() {
|
|
1004
1004
|
a.value = !1, o.value = "";
|
|
1005
1005
|
}
|
|
1006
|
-
return (t, g) => (S(), d("div",
|
|
1006
|
+
return (t, g) => (S(), d("div", mt, [
|
|
1007
1007
|
f("button", {
|
|
1008
1008
|
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",
|
|
1009
1009
|
style: b({
|
|
@@ -1011,11 +1011,11 @@ var xe = ["data-tpl-theme"], Se = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, Ce
|
|
|
1011
1011
|
color: e.viewMode === "files" && e.currentFolderId === null ? "var(--tpl-primary)" : "var(--tpl-text)"
|
|
1012
1012
|
}),
|
|
1013
1013
|
onClick: g[0] ||= (e) => n("navigate", null)
|
|
1014
|
-
}, [m(
|
|
1014
|
+
}, [m(k(z), {
|
|
1015
1015
|
size: 14,
|
|
1016
1016
|
"stroke-width": 1.5
|
|
1017
|
-
}), p(" " + D(
|
|
1018
|
-
(S(!0), d(i, null, T(e.folders, (t) => (S(), l(
|
|
1017
|
+
}), p(" " + D(k(r).mediaLibrary.allFiles), 1)], 4),
|
|
1018
|
+
(S(!0), d(i, null, T(e.folders, (t) => (S(), l(pt, {
|
|
1019
1019
|
key: t.id,
|
|
1020
1020
|
folder: t,
|
|
1021
1021
|
"current-folder-id": e.currentFolderId,
|
|
@@ -1025,7 +1025,7 @@ var xe = ["data-tpl-theme"], Se = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, Ce
|
|
|
1025
1025
|
onRenameFolder: g[3] ||= (e, t) => n("renameFolder", e, t),
|
|
1026
1026
|
onDeleteFolder: g[4] ||= (e) => n("deleteFolder", e)
|
|
1027
1027
|
}, null, 8, ["folder", "current-folder-id"]))), 128)),
|
|
1028
|
-
a.value ? (S(), d("div",
|
|
1028
|
+
a.value ? (S(), d("div", ht, [N(f("input", {
|
|
1029
1029
|
"onUpdate:modelValue": g[5] ||= (e) => o.value = e,
|
|
1030
1030
|
type: "text",
|
|
1031
1031
|
class: "tpl:w-full tpl:rounded tpl:border tpl:px-2 tpl:py-1 tpl:text-xs tpl:outline-none",
|
|
@@ -1034,20 +1034,20 @@ var xe = ["data-tpl-theme"], Se = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, Ce
|
|
|
1034
1034
|
"background-color": "var(--tpl-bg)",
|
|
1035
1035
|
color: "var(--tpl-text)"
|
|
1036
1036
|
},
|
|
1037
|
-
placeholder:
|
|
1037
|
+
placeholder: k(r).mediaLibrary.folderName,
|
|
1038
1038
|
autofocus: "",
|
|
1039
|
-
onKeydown: [
|
|
1039
|
+
onKeydown: [P(c, ["enter"]), P(h, ["escape"])],
|
|
1040
1040
|
onBlur: c
|
|
1041
|
-
}, null, 40,
|
|
1041
|
+
}, null, 40, gt), [[A, o.value]])])) : u("", !0),
|
|
1042
1042
|
a.value ? u("", !0) : (S(), d("button", {
|
|
1043
1043
|
key: 1,
|
|
1044
1044
|
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",
|
|
1045
1045
|
style: { color: "var(--tpl-text-muted)" },
|
|
1046
1046
|
onClick: s
|
|
1047
|
-
}, [m(
|
|
1047
|
+
}, [m(k(q), {
|
|
1048
1048
|
size: 14,
|
|
1049
1049
|
"stroke-width": 1.5
|
|
1050
|
-
}), p(" " + D(
|
|
1050
|
+
}), p(" " + D(k(r).mediaLibrary.newFolder), 1)])),
|
|
1051
1051
|
g[7] ||= f("div", { class: "tpl:flex-1" }, null, -1),
|
|
1052
1052
|
e.hasFrequentlyUsed ? (S(), d("button", {
|
|
1053
1053
|
key: 2,
|
|
@@ -1058,13 +1058,13 @@ var xe = ["data-tpl-theme"], Se = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, Ce
|
|
|
1058
1058
|
color: e.viewMode === "frequently-used" ? "var(--tpl-primary)" : "var(--tpl-text)"
|
|
1059
1059
|
}),
|
|
1060
1060
|
onClick: g[6] ||= (e) => n("showFrequentlyUsed")
|
|
1061
|
-
}, [m(
|
|
1061
|
+
}, [m(k(ee), {
|
|
1062
1062
|
size: 14,
|
|
1063
1063
|
"stroke-width": 1.5
|
|
1064
|
-
}), p(" " + D(
|
|
1064
|
+
}), p(" " + D(k(r).mediaLibrary.frequentlyUsed), 1)], 4)) : u("", !0)
|
|
1065
1065
|
]));
|
|
1066
1066
|
}
|
|
1067
|
-
}),
|
|
1067
|
+
}), vt = { class: "tpl:flex tpl:aspect-square tpl:flex-col tpl:items-center tpl:justify-center tpl:gap-2" }, yt = /* @__PURE__ */ h({
|
|
1068
1068
|
__name: "MediaFileIcon",
|
|
1069
1069
|
props: { mimeType: {} },
|
|
1070
1070
|
setup(e) {
|
|
@@ -1165,7 +1165,7 @@ var xe = ["data-tpl-theme"], Se = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, Ce
|
|
|
1165
1165
|
bgColor: "#f9fafb",
|
|
1166
1166
|
icon: "document"
|
|
1167
1167
|
}, i = s(() => n[t.mimeType] ?? r);
|
|
1168
|
-
return (e, t) => (S(), d("div",
|
|
1168
|
+
return (e, t) => (S(), d("div", vt, [i.value.icon === "document" ? (S(), d("svg", {
|
|
1169
1169
|
key: 0,
|
|
1170
1170
|
width: "60",
|
|
1171
1171
|
height: "60",
|
|
@@ -1234,48 +1234,48 @@ var xe = ["data-tpl-theme"], Se = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, Ce
|
|
|
1234
1234
|
style: b({ color: i.value.color })
|
|
1235
1235
|
}, D(i.value.label), 5)]));
|
|
1236
1236
|
}
|
|
1237
|
-
}),
|
|
1237
|
+
}), bt = { class: "tpl:p-4" }, xt = {
|
|
1238
1238
|
key: 1,
|
|
1239
1239
|
class: "tpl:flex tpl:flex-col tpl:items-center tpl:justify-center tpl:py-16"
|
|
1240
|
-
},
|
|
1240
|
+
}, St = {
|
|
1241
1241
|
class: "tpl:text-xs",
|
|
1242
1242
|
style: { color: "var(--tpl-text-muted)" }
|
|
1243
|
-
},
|
|
1243
|
+
}, Ct = {
|
|
1244
1244
|
key: 2,
|
|
1245
1245
|
class: "tpl:grid tpl:grid-cols-4 tpl:gap-3"
|
|
1246
|
-
},
|
|
1246
|
+
}, wt = ["onClick"], Tt = { class: "tpl:aspect-square" }, Et = ["src", "alt"], Dt = { class: "tpl:px-2 tpl:py-1.5" }, Ot = {
|
|
1247
1247
|
class: "tpl:truncate tpl:text-[10px] tpl:font-medium",
|
|
1248
1248
|
style: { color: "var(--tpl-text)" }
|
|
1249
|
-
},
|
|
1249
|
+
}, kt = {
|
|
1250
1250
|
class: "tpl:flex tpl:justify-between tpl:text-[9px]",
|
|
1251
1251
|
style: { color: "var(--tpl-text-muted)" }
|
|
1252
|
-
},
|
|
1252
|
+
}, At = { key: 0 }, jt = { 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" }, Mt = ["title", "onClick"], Nt = ["title", "onClick"], Pt = {
|
|
1253
1253
|
key: 0,
|
|
1254
1254
|
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",
|
|
1255
1255
|
style: { "background-color": "var(--tpl-primary)" }
|
|
1256
|
-
},
|
|
1256
|
+
}, Ft = {
|
|
1257
1257
|
key: 3,
|
|
1258
1258
|
class: "tpl:flex tpl:flex-col tpl:gap-1"
|
|
1259
|
-
},
|
|
1259
|
+
}, It = ["onClick"], Lt = {
|
|
1260
1260
|
class: "tpl:size-10 tpl:shrink-0 tpl:overflow-hidden tpl:rounded",
|
|
1261
1261
|
style: { "background-color": "var(--tpl-bg-hover)" }
|
|
1262
|
-
},
|
|
1262
|
+
}, Rt = ["src", "alt"], zt = {
|
|
1263
1263
|
key: 1,
|
|
1264
1264
|
class: "tpl-list-icon tpl:size-full"
|
|
1265
|
-
},
|
|
1265
|
+
}, Bt = { class: "tpl:min-w-0 tpl:flex-1" }, Vt = {
|
|
1266
1266
|
class: "tpl:truncate tpl:text-xs tpl:font-medium",
|
|
1267
1267
|
style: { color: "var(--tpl-text)" }
|
|
1268
|
-
},
|
|
1268
|
+
}, Ht = {
|
|
1269
1269
|
class: "tpl:text-[10px]",
|
|
1270
1270
|
style: { color: "var(--tpl-text-muted)" }
|
|
1271
|
-
},
|
|
1271
|
+
}, Ut = { class: "tpl:flex tpl:gap-1 tpl:opacity-0 tpl:transition-opacity tpl:duration-150 tpl:group-hover:opacity-100" }, Wt = ["title", "onClick"], Gt = ["title", "onClick"], Kt = {
|
|
1272
1272
|
key: 0,
|
|
1273
1273
|
class: "tpl:flex tpl:size-5 tpl:shrink-0 tpl:items-center tpl:justify-center tpl:rounded-full tpl:text-white",
|
|
1274
1274
|
style: { "background-color": "var(--tpl-primary)" }
|
|
1275
|
-
},
|
|
1275
|
+
}, qt = {
|
|
1276
1276
|
key: 4,
|
|
1277
1277
|
class: "tpl:flex tpl:justify-center tpl:py-4"
|
|
1278
|
-
},
|
|
1278
|
+
}, Jt = /* @__PURE__ */ rt(/* @__PURE__ */ h({
|
|
1279
1279
|
__name: "MediaGrid",
|
|
1280
1280
|
props: {
|
|
1281
1281
|
items: {},
|
|
@@ -1301,7 +1301,7 @@ var xe = ["data-tpl-theme"], Se = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, Ce
|
|
|
1301
1301
|
r("select", e);
|
|
1302
1302
|
}
|
|
1303
1303
|
let { t: h } = Z(), g = w(null);
|
|
1304
|
-
|
|
1304
|
+
ue(g, ([{ isIntersecting: e }]) => {
|
|
1305
1305
|
e && n.hasMore && !n.isLoading && r("loadMore");
|
|
1306
1306
|
}, { threshold: .1 });
|
|
1307
1307
|
function _(e) {
|
|
@@ -1314,7 +1314,7 @@ var xe = ["data-tpl-theme"], Se = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, Ce
|
|
|
1314
1314
|
day: "numeric"
|
|
1315
1315
|
});
|
|
1316
1316
|
}
|
|
1317
|
-
return (t, n) => (S(), d("div",
|
|
1317
|
+
return (t, n) => (S(), d("div", bt, [
|
|
1318
1318
|
e.isLoading && e.items.length === 0 ? (S(), d("div", {
|
|
1319
1319
|
key: 0,
|
|
1320
1320
|
class: y(e.layout === "list" ? "tpl:flex tpl:flex-col tpl:gap-1" : "tpl:grid tpl:grid-cols-4 tpl:gap-3")
|
|
@@ -1322,47 +1322,47 @@ var xe = ["data-tpl-theme"], Se = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, Ce
|
|
|
1322
1322
|
key: t,
|
|
1323
1323
|
class: y(["tpl-pulse tpl:rounded-lg", e.layout === "list" ? "tpl:h-12" : "tpl:aspect-square"]),
|
|
1324
1324
|
style: { "background-color": "var(--tpl-bg-hover)" }
|
|
1325
|
-
}, null, 2)), 64))], 2)) : e.items.length === 0 ? (S(), d("div",
|
|
1325
|
+
}, null, 2)), 64))], 2)) : e.items.length === 0 ? (S(), d("div", xt, [m(k(z), {
|
|
1326
1326
|
class: "tpl:mb-3",
|
|
1327
1327
|
size: 40,
|
|
1328
1328
|
"stroke-width": 1,
|
|
1329
1329
|
style: { color: "var(--tpl-text-dim)" }
|
|
1330
|
-
}), f("p",
|
|
1330
|
+
}), f("p", St, D(k(h).mediaLibrary.noFiles), 1)])) : e.layout === "list" ? (S(), d("div", Ft, [(S(!0), d(i, null, T(e.items, (t) => (S(), d("div", {
|
|
1331
1331
|
key: t.id,
|
|
1332
1332
|
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" : ""]]),
|
|
1333
1333
|
style: b({ backgroundColor: e.selectedIds.has(t.id) ? "var(--tpl-bg-hover)" : "transparent" }),
|
|
1334
1334
|
onClick: (e) => c(t)
|
|
1335
1335
|
}, [
|
|
1336
|
-
f("div",
|
|
1336
|
+
f("div", Lt, [k(o)(t.mime_type) ? (S(), d("img", {
|
|
1337
1337
|
key: 0,
|
|
1338
1338
|
src: t.small_url || t.url,
|
|
1339
1339
|
alt: t.filename,
|
|
1340
1340
|
class: "tpl:size-full tpl:object-cover",
|
|
1341
1341
|
loading: "lazy"
|
|
1342
|
-
}, null, 8,
|
|
1343
|
-
f("div",
|
|
1344
|
-
f("div",
|
|
1342
|
+
}, null, 8, Rt)) : (S(), d("div", zt, [m(yt, { "mime-type": t.mime_type }, null, 8, ["mime-type"])]))]),
|
|
1343
|
+
f("div", Bt, [f("p", Vt, D(t.filename), 1), f("p", Ht, [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)])]),
|
|
1344
|
+
f("div", Ut, [f("button", {
|
|
1345
1345
|
class: "tpl:flex tpl:size-6 tpl:shrink-0 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded",
|
|
1346
1346
|
style: { color: "var(--tpl-text-muted)" },
|
|
1347
|
-
title:
|
|
1348
|
-
onClick:
|
|
1349
|
-
}, [m(
|
|
1347
|
+
title: k(h).mediaLibrary.editFile,
|
|
1348
|
+
onClick: F((e) => r("edit", t), ["stop"])
|
|
1349
|
+
}, [m(k(K), {
|
|
1350
1350
|
size: 12,
|
|
1351
1351
|
"stroke-width": 2
|
|
1352
|
-
})], 8,
|
|
1352
|
+
})], 8, Wt), f("button", {
|
|
1353
1353
|
class: "tpl:flex tpl:size-6 tpl:shrink-0 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded",
|
|
1354
1354
|
style: { color: "var(--tpl-text-muted)" },
|
|
1355
|
-
title:
|
|
1356
|
-
onClick:
|
|
1357
|
-
}, [m(
|
|
1355
|
+
title: k(h).mediaLibrary.replaceFile,
|
|
1356
|
+
onClick: F((e) => r("replace", t), ["stop"])
|
|
1357
|
+
}, [m(k(J), {
|
|
1358
1358
|
size: 12,
|
|
1359
1359
|
"stroke-width": 2
|
|
1360
|
-
})], 8,
|
|
1361
|
-
e.selectedIds.has(t.id) ? (S(), d("div",
|
|
1360
|
+
})], 8, Gt)]),
|
|
1361
|
+
e.selectedIds.has(t.id) ? (S(), d("div", Kt, [m(k(I), {
|
|
1362
1362
|
size: 12,
|
|
1363
1363
|
"stroke-width": 3
|
|
1364
1364
|
})])) : u("", !0)
|
|
1365
|
-
], 14,
|
|
1365
|
+
], 14, It))), 128))])) : (S(), d("div", Ct, [(S(!0), d(i, null, T(e.items, (t) => (S(), d("div", {
|
|
1366
1366
|
key: t.id,
|
|
1367
1367
|
class: y(["tpl-media-item tpl:group tpl:relative tpl:overflow-hidden tpl:rounded-lg tpl:border-2 tpl:transition-all tpl:duration-150", [
|
|
1368
1368
|
"tpl:cursor-pointer",
|
|
@@ -1375,45 +1375,45 @@ var xe = ["data-tpl-theme"], Se = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, Ce
|
|
|
1375
1375
|
}),
|
|
1376
1376
|
onClick: (e) => c(t)
|
|
1377
1377
|
}, [
|
|
1378
|
-
f("div",
|
|
1378
|
+
f("div", Tt, [k(o)(t.mime_type) ? (S(), d("img", {
|
|
1379
1379
|
key: 0,
|
|
1380
1380
|
src: t.small_url || t.url,
|
|
1381
1381
|
alt: t.filename,
|
|
1382
1382
|
class: "tpl:size-full tpl:object-cover",
|
|
1383
1383
|
loading: "lazy"
|
|
1384
|
-
}, null, 8,
|
|
1384
|
+
}, null, 8, Et)) : (S(), l(yt, {
|
|
1385
1385
|
key: 1,
|
|
1386
1386
|
"mime-type": t.mime_type
|
|
1387
1387
|
}, null, 8, ["mime-type"]))]),
|
|
1388
|
-
f("div",
|
|
1389
|
-
f("div",
|
|
1388
|
+
f("div", Dt, [f("p", Ot, D(t.filename), 1), f("p", kt, [f("span", null, D(_(t.size)), 1), k(o)(t.mime_type) && t.width && t.height ? (S(), d("span", At, D(t.width) + "×" + D(t.height), 1)) : u("", !0)])]),
|
|
1389
|
+
f("div", jt, [f("button", {
|
|
1390
1390
|
class: "tpl:flex tpl:size-6 tpl:items-center tpl:justify-center tpl:rounded-full tpl:text-white",
|
|
1391
1391
|
style: { "background-color": "rgba(0, 0, 0, 0.6)" },
|
|
1392
|
-
title:
|
|
1393
|
-
onClick:
|
|
1394
|
-
}, [m(
|
|
1392
|
+
title: k(h).mediaLibrary.editFile,
|
|
1393
|
+
onClick: F((e) => r("edit", t), ["stop"])
|
|
1394
|
+
}, [m(k(K), {
|
|
1395
1395
|
size: 11,
|
|
1396
1396
|
"stroke-width": 2
|
|
1397
|
-
})], 8,
|
|
1397
|
+
})], 8, Mt), f("button", {
|
|
1398
1398
|
class: "tpl:flex tpl:size-6 tpl:items-center tpl:justify-center tpl:rounded-full tpl:text-white",
|
|
1399
1399
|
style: { "background-color": "rgba(0, 0, 0, 0.6)" },
|
|
1400
|
-
title:
|
|
1401
|
-
onClick:
|
|
1402
|
-
}, [m(
|
|
1400
|
+
title: k(h).mediaLibrary.replaceFile,
|
|
1401
|
+
onClick: F((e) => r("replace", t), ["stop"])
|
|
1402
|
+
}, [m(k(J), {
|
|
1403
1403
|
size: 11,
|
|
1404
1404
|
"stroke-width": 2
|
|
1405
|
-
})], 8,
|
|
1406
|
-
e.selectedIds.has(t.id) ? (S(), d("div",
|
|
1405
|
+
})], 8, Nt)]),
|
|
1406
|
+
e.selectedIds.has(t.id) ? (S(), d("div", Pt, [m(k(I), {
|
|
1407
1407
|
size: 12,
|
|
1408
1408
|
"stroke-width": 3
|
|
1409
1409
|
})])) : u("", !0)
|
|
1410
|
-
], 14,
|
|
1410
|
+
], 14, wt))), 128))])),
|
|
1411
1411
|
f("div", {
|
|
1412
1412
|
ref_key: "sentinelRef",
|
|
1413
1413
|
ref: g,
|
|
1414
1414
|
class: "tpl:h-4"
|
|
1415
1415
|
}, null, 512),
|
|
1416
|
-
e.isLoading && e.items.length > 0 ? (S(), d("div",
|
|
1416
|
+
e.isLoading && e.items.length > 0 ? (S(), d("div", qt, [m(k(W), {
|
|
1417
1417
|
class: "tpl-spinner",
|
|
1418
1418
|
size: 20,
|
|
1419
1419
|
"stroke-width": 2,
|
|
@@ -1421,20 +1421,20 @@ var xe = ["data-tpl-theme"], Se = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, Ce
|
|
|
1421
1421
|
})])) : u("", !0)
|
|
1422
1422
|
]));
|
|
1423
1423
|
}
|
|
1424
|
-
}), [["__scopeId", "data-v-9db961d1"]]),
|
|
1424
|
+
}), [["__scopeId", "data-v-9db961d1"]]), Yt = ["data-tpl-theme"], Xt = {
|
|
1425
1425
|
class: "tpl:mx-4 tpl:w-full tpl:max-w-sm tpl:rounded-lg tpl:p-5 tpl:shadow-xl",
|
|
1426
1426
|
style: { "background-color": "var(--tpl-bg-elevated)" }
|
|
1427
|
-
},
|
|
1427
|
+
}, Zt = {
|
|
1428
1428
|
class: "tpl:mb-4 tpl:text-sm tpl:font-semibold",
|
|
1429
1429
|
style: { color: "var(--tpl-text)" }
|
|
1430
|
-
},
|
|
1430
|
+
}, Qt = { class: "tpl:mb-3" }, $t = ["placeholder", "disabled"], en = {
|
|
1431
1431
|
key: 0,
|
|
1432
1432
|
class: "tpl:mb-3 tpl:text-xs",
|
|
1433
1433
|
style: { color: "var(--tpl-danger)" }
|
|
1434
|
-
},
|
|
1434
|
+
}, tn = { class: "tpl:flex tpl:justify-end tpl:gap-2" }, nn = ["disabled"], rn = ["disabled"], an = {
|
|
1435
1435
|
key: 0,
|
|
1436
1436
|
class: "tpl:flex tpl:items-center tpl:gap-1.5"
|
|
1437
|
-
},
|
|
1437
|
+
}, on = { key: 1 }, sn = /* @__PURE__ */ h({
|
|
1438
1438
|
__name: "MediaImportUrlModal",
|
|
1439
1439
|
props: {
|
|
1440
1440
|
visible: { type: Boolean },
|
|
@@ -1443,21 +1443,21 @@ var xe = ["data-tpl-theme"], Se = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, Ce
|
|
|
1443
1443
|
},
|
|
1444
1444
|
emits: ["import", "close"],
|
|
1445
1445
|
setup(e, { emit: t }) {
|
|
1446
|
-
let n = e, r = t, { t: i } = Z(), s = _("tplUiTheme"), c = w("");
|
|
1447
|
-
|
|
1448
|
-
e && (
|
|
1446
|
+
let n = e, r = t, { t: i } = Z(), s = _("tplUiTheme"), c = _(Se, w(null)), h = w("");
|
|
1447
|
+
j(() => n.visible, (e) => {
|
|
1448
|
+
e && (h.value = "");
|
|
1449
1449
|
});
|
|
1450
|
-
function
|
|
1451
|
-
let e =
|
|
1450
|
+
function g() {
|
|
1451
|
+
let e = h.value.trim();
|
|
1452
1452
|
!e || n.isImporting || r("import", e);
|
|
1453
1453
|
}
|
|
1454
|
-
function
|
|
1454
|
+
function v() {
|
|
1455
1455
|
n.isImporting || r("close");
|
|
1456
1456
|
}
|
|
1457
|
-
function
|
|
1458
|
-
e.key === "Enter" && (e.preventDefault(),
|
|
1457
|
+
function b(e) {
|
|
1458
|
+
e.key === "Enter" && (e.preventDefault(), g()), e.key === "Escape" && v();
|
|
1459
1459
|
}
|
|
1460
|
-
return (t, n) => (S(), l(a, { to: "body" }, [m(o, {
|
|
1460
|
+
return (t, n) => (S(), l(a, { to: k(c) || "body" }, [m(o, {
|
|
1461
1461
|
"enter-active-class": "tpl:transition tpl:ease-out tpl:duration-150",
|
|
1462
1462
|
"enter-from-class": "tpl:opacity-0",
|
|
1463
1463
|
"enter-to-class": "tpl:opacity-100",
|
|
@@ -1465,17 +1465,17 @@ var xe = ["data-tpl-theme"], Se = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, Ce
|
|
|
1465
1465
|
"leave-from-class": "tpl:opacity-100",
|
|
1466
1466
|
"leave-to-class": "tpl:opacity-0"
|
|
1467
1467
|
}, {
|
|
1468
|
-
default:
|
|
1468
|
+
default: M(() => [e.visible ? (S(), d("div", {
|
|
1469
1469
|
key: 0,
|
|
1470
|
-
"data-tpl-theme":
|
|
1470
|
+
"data-tpl-theme": k(s),
|
|
1471
1471
|
class: "tpl tpl:fixed tpl:inset-0 tpl:z-[10000] tpl:flex tpl:items-center tpl:justify-center",
|
|
1472
1472
|
style: { "background-color": "var(--tpl-overlay)" },
|
|
1473
|
-
onClick:
|
|
1474
|
-
onKeydown:
|
|
1475
|
-
}, [f("div",
|
|
1476
|
-
f("h3",
|
|
1477
|
-
f("div",
|
|
1478
|
-
"onUpdate:modelValue": n[0] ||= (e) =>
|
|
1473
|
+
onClick: F(v, ["self"]),
|
|
1474
|
+
onKeydown: b
|
|
1475
|
+
}, [f("div", Xt, [
|
|
1476
|
+
f("h3", Zt, D(k(i).mediaLibrary.importFromUrl), 1),
|
|
1477
|
+
f("div", Qt, [N(f("input", {
|
|
1478
|
+
"onUpdate:modelValue": n[0] ||= (e) => h.value = e,
|
|
1479
1479
|
type: "url",
|
|
1480
1480
|
class: "tpl:w-full tpl:rounded-md tpl:border tpl:px-3 tpl:py-1.5 tpl:text-xs tpl:outline-none",
|
|
1481
1481
|
style: {
|
|
@@ -1483,12 +1483,12 @@ var xe = ["data-tpl-theme"], Se = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, Ce
|
|
|
1483
1483
|
"background-color": "var(--tpl-bg)",
|
|
1484
1484
|
color: "var(--tpl-text)"
|
|
1485
1485
|
},
|
|
1486
|
-
placeholder:
|
|
1486
|
+
placeholder: k(i).mediaLibrary.importUrlPlaceholder,
|
|
1487
1487
|
disabled: e.isImporting,
|
|
1488
1488
|
autofocus: ""
|
|
1489
|
-
}, null, 8,
|
|
1490
|
-
e.error ? (S(), d("p",
|
|
1491
|
-
f("div",
|
|
1489
|
+
}, null, 8, $t), [[A, h.value]])]),
|
|
1490
|
+
e.error ? (S(), d("p", en, D(e.error), 1)) : u("", !0),
|
|
1491
|
+
f("div", tn, [f("button", {
|
|
1492
1492
|
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 }]),
|
|
1493
1493
|
style: {
|
|
1494
1494
|
"border-color": "var(--tpl-border)",
|
|
@@ -1496,26 +1496,26 @@ var xe = ["data-tpl-theme"], Se = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, Ce
|
|
|
1496
1496
|
"background-color": "var(--tpl-bg)"
|
|
1497
1497
|
},
|
|
1498
1498
|
disabled: e.isImporting,
|
|
1499
|
-
onClick:
|
|
1500
|
-
}, D(
|
|
1499
|
+
onClick: v
|
|
1500
|
+
}, D(k(i).mediaLibrary.cancel), 11, nn), f("button", {
|
|
1501
1501
|
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",
|
|
1502
1502
|
style: { background: "linear-gradient(\n 135deg,\n var(--tpl-primary),\n var(--tpl-primary-hover)\n )" },
|
|
1503
|
-
disabled: !
|
|
1504
|
-
onClick:
|
|
1505
|
-
}, [e.isImporting ? (S(), d("span",
|
|
1503
|
+
disabled: !h.value.trim() || e.isImporting,
|
|
1504
|
+
onClick: g
|
|
1505
|
+
}, [e.isImporting ? (S(), d("span", an, [m(k(W), {
|
|
1506
1506
|
class: "tpl:animate-spin",
|
|
1507
1507
|
size: 12,
|
|
1508
1508
|
"stroke-width": 2
|
|
1509
|
-
}), p(" " + D(
|
|
1510
|
-
])], 40,
|
|
1509
|
+
}), p(" " + D(k(i).mediaLibrary.importing), 1)])) : (S(), d("span", on, D(k(i).mediaLibrary.import), 1))], 8, rn)])
|
|
1510
|
+
])], 40, Yt)) : u("", !0)]),
|
|
1511
1511
|
_: 1
|
|
1512
|
-
})]));
|
|
1512
|
+
})], 8, ["to"]));
|
|
1513
1513
|
}
|
|
1514
|
-
}),
|
|
1514
|
+
}), cn = { class: "tpl:max-h-56 tpl:overflow-y-auto tpl:py-1" }, ln = ["disabled", "onClick"], un = { class: "tpl:truncate" }, dn = {
|
|
1515
1515
|
key: 0,
|
|
1516
1516
|
class: "tpl:shrink-0",
|
|
1517
1517
|
style: { color: "var(--tpl-text-dim)" }
|
|
1518
|
-
},
|
|
1518
|
+
}, fn = /* @__PURE__ */ h({
|
|
1519
1519
|
__name: "MediaMovePicker",
|
|
1520
1520
|
props: {
|
|
1521
1521
|
folders: {},
|
|
@@ -1533,7 +1533,7 @@ var xe = ["data-tpl-theme"], Se = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, Ce
|
|
|
1533
1533
|
}), r.children?.length && n.push(...o(r.children, t + 1));
|
|
1534
1534
|
return n;
|
|
1535
1535
|
}
|
|
1536
|
-
return
|
|
1536
|
+
return ie(a, () => {
|
|
1537
1537
|
n("close");
|
|
1538
1538
|
}), (t, s) => (S(), d("div", {
|
|
1539
1539
|
ref_key: "pickerRef",
|
|
@@ -1543,16 +1543,16 @@ var xe = ["data-tpl-theme"], Se = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, Ce
|
|
|
1543
1543
|
"border-color": "var(--tpl-border)",
|
|
1544
1544
|
"background-color": "var(--tpl-bg-elevated)"
|
|
1545
1545
|
}
|
|
1546
|
-
}, [f("div",
|
|
1546
|
+
}, [f("div", cn, [e.currentFolderId === null ? u("", !0) : (S(), d("button", {
|
|
1547
1547
|
key: 0,
|
|
1548
1548
|
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",
|
|
1549
1549
|
style: { color: "var(--tpl-text)" },
|
|
1550
1550
|
onClick: s[0] ||= (e) => n("select", null)
|
|
1551
|
-
}, [m(
|
|
1551
|
+
}, [m(k(z), {
|
|
1552
1552
|
class: "tpl:shrink-0",
|
|
1553
1553
|
size: 14,
|
|
1554
1554
|
"stroke-width": 1.5
|
|
1555
|
-
}), p(" " + D(
|
|
1555
|
+
}), p(" " + D(k(r).mediaLibrary.moveToRoot), 1)])), (S(!0), d(i, null, T(o(e.folders), (t) => (S(), d("button", {
|
|
1556
1556
|
key: t.id,
|
|
1557
1557
|
class: "tpl:flex tpl:w-full tpl:items-center tpl:gap-1.5 tpl:py-1.5 tpl:pr-3 tpl:text-left tpl:text-xs tpl:transition-colors tpl:duration-100",
|
|
1558
1558
|
style: b({
|
|
@@ -1563,32 +1563,32 @@ var xe = ["data-tpl-theme"], Se = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, Ce
|
|
|
1563
1563
|
disabled: t.id === e.currentFolderId,
|
|
1564
1564
|
onClick: (e) => n("select", t.id)
|
|
1565
1565
|
}, [
|
|
1566
|
-
m(
|
|
1566
|
+
m(k(B), {
|
|
1567
1567
|
class: "tpl:shrink-0",
|
|
1568
1568
|
size: 14,
|
|
1569
1569
|
"stroke-width": 1.5
|
|
1570
1570
|
}),
|
|
1571
|
-
f("span",
|
|
1572
|
-
t.id === e.currentFolderId ? (S(), d("span",
|
|
1573
|
-
], 12,
|
|
1571
|
+
f("span", un, D(t.name), 1),
|
|
1572
|
+
t.id === e.currentFolderId ? (S(), d("span", dn, D(k(r).mediaLibrary.currentFolder), 1)) : u("", !0)
|
|
1573
|
+
], 12, ln))), 128))])], 512));
|
|
1574
1574
|
}
|
|
1575
|
-
}),
|
|
1575
|
+
}), pn = { class: "tpl:flex tpl:items-center tpl:gap-3" }, mn = ["src", "alt"], hn = {
|
|
1576
1576
|
key: 1,
|
|
1577
1577
|
class: "tpl:flex tpl:size-10 tpl:shrink-0 tpl:items-center tpl:justify-center tpl:overflow-hidden tpl:rounded",
|
|
1578
1578
|
style: { border: "1px solid var(--tpl-border)" }
|
|
1579
|
-
},
|
|
1579
|
+
}, gn = { class: "tpl:min-w-0 tpl:flex-1" }, _n = {
|
|
1580
1580
|
class: "tpl:truncate tpl:text-xs tpl:font-medium",
|
|
1581
1581
|
style: { color: "var(--tpl-text)" }
|
|
1582
|
-
},
|
|
1582
|
+
}, vn = {
|
|
1583
1583
|
class: "tpl:mt-0.5 tpl:text-[10px]",
|
|
1584
1584
|
style: { color: "var(--tpl-text-muted)" }
|
|
1585
|
-
},
|
|
1585
|
+
}, yn = {
|
|
1586
1586
|
key: 2,
|
|
1587
1587
|
class: "tpl:shrink-0"
|
|
1588
|
-
},
|
|
1588
|
+
}, bn = {
|
|
1589
1589
|
class: "tpl:block tpl:text-[10px]",
|
|
1590
1590
|
style: { color: "var(--tpl-text-muted)" }
|
|
1591
|
-
},
|
|
1591
|
+
}, xn = ["value"], Sn = ["value"], Cn = /* @__PURE__ */ rt(/* @__PURE__ */ h({
|
|
1592
1592
|
__name: "MediaPreviewPanel",
|
|
1593
1593
|
props: {
|
|
1594
1594
|
item: {},
|
|
@@ -1656,25 +1656,25 @@ var xe = ["data-tpl-theme"], Se = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, Ce
|
|
|
1656
1656
|
day: "numeric"
|
|
1657
1657
|
});
|
|
1658
1658
|
}
|
|
1659
|
-
return (t, n) => (S(), d("div",
|
|
1659
|
+
return (t, n) => (S(), d("div", pn, [
|
|
1660
1660
|
b.value ? (S(), d("img", {
|
|
1661
1661
|
key: 0,
|
|
1662
1662
|
src: h.value ?? void 0,
|
|
1663
1663
|
alt: e.item.alt_text || e.item.filename,
|
|
1664
1664
|
class: "tpl:size-10 tpl:shrink-0 tpl:rounded tpl:object-cover",
|
|
1665
1665
|
style: { border: "1px solid var(--tpl-border)" }
|
|
1666
|
-
}, null, 8,
|
|
1666
|
+
}, null, 8, mn)) : (S(), d("div", hn, [m(yt, {
|
|
1667
1667
|
"mime-type": e.item.mime_type,
|
|
1668
1668
|
class: "tpl-preview-icon"
|
|
1669
1669
|
}, null, 8, ["mime-type"])])),
|
|
1670
|
-
f("div",
|
|
1671
|
-
f("p",
|
|
1672
|
-
f("p",
|
|
1670
|
+
f("div", gn, [
|
|
1671
|
+
f("p", _n, D(e.item.filename), 1),
|
|
1672
|
+
f("p", vn, [
|
|
1673
1673
|
p(D(x(e.item.size)) + " · " + D(C(e.item.created_at)) + " ", 1),
|
|
1674
1674
|
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),
|
|
1675
1675
|
v.value ? (S(), d(i, { key: 1 }, [
|
|
1676
1676
|
n[0] ||= p(" · ", -1),
|
|
1677
|
-
m(
|
|
1677
|
+
m(k(B), {
|
|
1678
1678
|
class: "tpl:mb-px tpl:inline",
|
|
1679
1679
|
size: 9,
|
|
1680
1680
|
"stroke-width": 2
|
|
@@ -1688,7 +1688,7 @@ var xe = ["data-tpl-theme"], Se = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, Ce
|
|
|
1688
1688
|
style: { color: "var(--tpl-text-dim)" }
|
|
1689
1689
|
}, D(e.item.alt_text || "\xA0"), 3)) : u("", !0)
|
|
1690
1690
|
]),
|
|
1691
|
-
l.value ? (S(), d("div",
|
|
1691
|
+
l.value ? (S(), d("div", yn, [f("label", bn, D(k(a).mediaLibrary.conversionLabel), 1), f("select", {
|
|
1692
1692
|
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",
|
|
1693
1693
|
style: {
|
|
1694
1694
|
"border-color": "var(--tpl-border)",
|
|
@@ -1700,36 +1700,36 @@ var xe = ["data-tpl-theme"], Se = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, Ce
|
|
|
1700
1700
|
}, [(S(!0), d(i, null, T(c.value, (e) => (S(), d("option", {
|
|
1701
1701
|
key: e.value,
|
|
1702
1702
|
value: e.value
|
|
1703
|
-
}, D(e.label), 9,
|
|
1703
|
+
}, D(e.label), 9, Sn))), 128))], 40, xn)])) : u("", !0)
|
|
1704
1704
|
]));
|
|
1705
1705
|
}
|
|
1706
|
-
}), [["__scopeId", "data-v-060e36cd"]]),
|
|
1706
|
+
}), [["__scopeId", "data-v-060e36cd"]]), wn = ["data-tpl-theme"], Tn = {
|
|
1707
1707
|
class: "tpl:mx-4 tpl:w-full tpl:max-w-sm tpl:rounded-lg tpl:p-5 tpl:shadow-xl",
|
|
1708
1708
|
style: { "background-color": "var(--tpl-bg-elevated)" }
|
|
1709
|
-
},
|
|
1709
|
+
}, En = {
|
|
1710
1710
|
class: "tpl:mb-2 tpl:text-sm tpl:font-semibold",
|
|
1711
1711
|
style: { color: "var(--tpl-text)" }
|
|
1712
|
-
},
|
|
1712
|
+
}, Dn = {
|
|
1713
1713
|
class: "tpl:mb-2 tpl:text-xs",
|
|
1714
1714
|
style: { color: "var(--tpl-text-muted)" }
|
|
1715
|
-
},
|
|
1715
|
+
}, On = {
|
|
1716
1716
|
key: 0,
|
|
1717
1717
|
class: "tpl:mb-3 tpl:text-xs",
|
|
1718
1718
|
style: { color: "var(--tpl-warning)" }
|
|
1719
|
-
},
|
|
1719
|
+
}, kn = {
|
|
1720
1720
|
class: "tpl:mb-3 tpl:rounded tpl:border tpl:p-2",
|
|
1721
1721
|
style: { "border-color": "var(--tpl-border)" }
|
|
1722
|
-
},
|
|
1722
|
+
}, An = {
|
|
1723
1723
|
class: "tpl:truncate tpl:text-xs tpl:font-medium",
|
|
1724
1724
|
style: { color: "var(--tpl-text)" }
|
|
1725
|
-
},
|
|
1725
|
+
}, jn = { class: "tpl:mb-4" }, Mn = {
|
|
1726
1726
|
class: "tpl:mb-1 tpl:block tpl:text-xs tpl:font-medium",
|
|
1727
1727
|
style: { color: "var(--tpl-text-muted)" }
|
|
1728
|
-
},
|
|
1728
|
+
}, Nn = ["accept"], Pn = {
|
|
1729
1729
|
key: 1,
|
|
1730
1730
|
class: "tpl:mb-3 tpl:text-xs",
|
|
1731
1731
|
style: { color: "var(--tpl-danger)" }
|
|
1732
|
-
},
|
|
1732
|
+
}, Fn = { class: "tpl:flex tpl:justify-end tpl:gap-2" }, In = ["disabled"], Ln = ["disabled"], Rn = /* @__PURE__ */ h({
|
|
1733
1733
|
__name: "MediaReplaceModal",
|
|
1734
1734
|
props: {
|
|
1735
1735
|
visible: { type: Boolean },
|
|
@@ -1740,25 +1740,25 @@ var xe = ["data-tpl-theme"], Se = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, Ce
|
|
|
1740
1740
|
},
|
|
1741
1741
|
emits: ["replace", "close"],
|
|
1742
1742
|
setup(e, { emit: t }) {
|
|
1743
|
-
let n = e, r = t, { t: i } = Z(), c = _("tplUiTheme"), p = w(null), h = w(null), g = s(() => {
|
|
1743
|
+
let n = e, r = t, { t: i } = Z(), c = _("tplUiTheme"), p = _(Se, w(null)), h = w(null), g = w(null), v = s(() => {
|
|
1744
1744
|
if (!n.item) return "";
|
|
1745
1745
|
let e = n.item.filename.split(".");
|
|
1746
1746
|
return e.length > 1 ? e[e.length - 1].toLowerCase() : "";
|
|
1747
|
-
}),
|
|
1748
|
-
|
|
1749
|
-
e || (
|
|
1747
|
+
}), y = s(() => v.value ? `.${v.value}` : "*"), b = s(() => (n.usageInfo?.template_count ?? 0) > 0);
|
|
1748
|
+
j(() => n.visible, (e) => {
|
|
1749
|
+
e || (g.value = null, h.value && (h.value.value = ""));
|
|
1750
1750
|
});
|
|
1751
|
-
function
|
|
1751
|
+
function x(e) {
|
|
1752
1752
|
let t = e.target;
|
|
1753
|
-
t.files && t.files.length > 0 && (
|
|
1753
|
+
t.files && t.files.length > 0 && (g.value = t.files[0]);
|
|
1754
1754
|
}
|
|
1755
|
-
function
|
|
1756
|
-
|
|
1755
|
+
function C() {
|
|
1756
|
+
g.value && r("replace", g.value);
|
|
1757
1757
|
}
|
|
1758
|
-
function
|
|
1758
|
+
function T(e) {
|
|
1759
1759
|
e.key === "Escape" && r("close");
|
|
1760
1760
|
}
|
|
1761
|
-
return (t, n) => (S(), l(a, { to: "body" }, [m(o, {
|
|
1761
|
+
return (t, n) => (S(), l(a, { to: k(p) || "body" }, [m(o, {
|
|
1762
1762
|
"enter-active-class": "tpl:transition tpl:ease-out tpl:duration-150",
|
|
1763
1763
|
"enter-from-class": "tpl:opacity-0",
|
|
1764
1764
|
"enter-to-class": "tpl:opacity-100",
|
|
@@ -1766,33 +1766,33 @@ var xe = ["data-tpl-theme"], Se = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, Ce
|
|
|
1766
1766
|
"leave-from-class": "tpl:opacity-100",
|
|
1767
1767
|
"leave-to-class": "tpl:opacity-0"
|
|
1768
1768
|
}, {
|
|
1769
|
-
default:
|
|
1769
|
+
default: M(() => [e.visible && e.item ? (S(), d("div", {
|
|
1770
1770
|
key: 0,
|
|
1771
|
-
"data-tpl-theme":
|
|
1771
|
+
"data-tpl-theme": k(c),
|
|
1772
1772
|
class: "tpl tpl:fixed tpl:inset-0 tpl:z-[10000] tpl:flex tpl:items-center tpl:justify-center",
|
|
1773
1773
|
style: { "background-color": "var(--tpl-overlay)" },
|
|
1774
|
-
onClick: n[1] ||=
|
|
1775
|
-
onKeydown:
|
|
1776
|
-
}, [f("div",
|
|
1777
|
-
f("h3",
|
|
1778
|
-
f("p",
|
|
1779
|
-
|
|
1780
|
-
f("div",
|
|
1781
|
-
f("div",
|
|
1774
|
+
onClick: n[1] ||= F((e) => r("close"), ["self"]),
|
|
1775
|
+
onKeydown: T
|
|
1776
|
+
}, [f("div", Tn, [
|
|
1777
|
+
f("h3", En, D(k(i).mediaLibrary.replaceWarningTitle), 1),
|
|
1778
|
+
f("p", Dn, D(k(i).mediaLibrary.replaceWarningMessage.replace("{extension}", `.${v.value}`)), 1),
|
|
1779
|
+
b.value ? (S(), d("p", On, D(k(i).mediaLibrary.replaceWarningUsageNote.replace("{count}", e.usageInfo.template_count.toString())), 1)) : u("", !0),
|
|
1780
|
+
f("div", kn, [f("p", An, D(e.item.filename), 1)]),
|
|
1781
|
+
f("div", jn, [f("label", Mn, D(k(i).mediaLibrary.replaceSelectFile), 1), f("input", {
|
|
1782
1782
|
ref_key: "fileInputRef",
|
|
1783
|
-
ref:
|
|
1783
|
+
ref: h,
|
|
1784
1784
|
type: "file",
|
|
1785
|
-
accept:
|
|
1785
|
+
accept: y.value,
|
|
1786
1786
|
class: "tpl:w-full tpl:rounded-md tpl:border tpl:px-3 tpl:py-1.5 tpl:text-xs",
|
|
1787
1787
|
style: {
|
|
1788
1788
|
"border-color": "var(--tpl-border)",
|
|
1789
1789
|
"background-color": "var(--tpl-bg)",
|
|
1790
1790
|
color: "var(--tpl-text)"
|
|
1791
1791
|
},
|
|
1792
|
-
onChange:
|
|
1793
|
-
}, null, 40,
|
|
1794
|
-
e.error ? (S(), d("p",
|
|
1795
|
-
f("div",
|
|
1792
|
+
onChange: x
|
|
1793
|
+
}, null, 40, Nn)]),
|
|
1794
|
+
e.error ? (S(), d("p", Pn, D(e.error), 1)) : u("", !0),
|
|
1795
|
+
f("div", Fn, [f("button", {
|
|
1796
1796
|
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",
|
|
1797
1797
|
style: {
|
|
1798
1798
|
"border-color": "var(--tpl-border)",
|
|
@@ -1801,29 +1801,29 @@ var xe = ["data-tpl-theme"], Se = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, Ce
|
|
|
1801
1801
|
},
|
|
1802
1802
|
disabled: e.isReplacing,
|
|
1803
1803
|
onClick: n[0] ||= (e) => r("close")
|
|
1804
|
-
}, D(
|
|
1804
|
+
}, D(k(i).mediaLibrary.cancel), 9, In), f("button", {
|
|
1805
1805
|
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",
|
|
1806
1806
|
style: { background: "linear-gradient(\n 135deg,\n var(--tpl-primary),\n var(--tpl-primary-hover)\n )" },
|
|
1807
|
-
disabled: !
|
|
1808
|
-
onClick:
|
|
1809
|
-
}, D(e.isReplacing ?
|
|
1810
|
-
])], 40,
|
|
1807
|
+
disabled: !g.value || e.isReplacing,
|
|
1808
|
+
onClick: C
|
|
1809
|
+
}, D(e.isReplacing ? k(i).mediaLibrary.replacing : k(i).mediaLibrary.replace), 9, Ln)])
|
|
1810
|
+
])], 40, wn)) : u("", !0)]),
|
|
1811
1811
|
_: 1
|
|
1812
|
-
})]));
|
|
1812
|
+
})], 8, ["to"]));
|
|
1813
1813
|
}
|
|
1814
|
-
}),
|
|
1814
|
+
}), zn = {
|
|
1815
1815
|
key: 0,
|
|
1816
1816
|
class: "tpl:flex tpl:items-center tpl:gap-2"
|
|
1817
|
-
},
|
|
1817
|
+
}, Bn = {
|
|
1818
1818
|
class: "tpl:text-xs",
|
|
1819
1819
|
style: { color: "var(--tpl-text-muted)" }
|
|
1820
|
-
},
|
|
1820
|
+
}, Vn = {
|
|
1821
1821
|
class: "tpl:text-xs",
|
|
1822
1822
|
style: { color: "var(--tpl-text-muted)" }
|
|
1823
|
-
},
|
|
1823
|
+
}, Hn = {
|
|
1824
1824
|
class: "tpl:mt-1 tpl:text-[10px]",
|
|
1825
1825
|
style: { color: "var(--tpl-text-dim)" }
|
|
1826
|
-
},
|
|
1826
|
+
}, Un = /* @__PURE__ */ h({
|
|
1827
1827
|
__name: "MediaUploadZone",
|
|
1828
1828
|
props: {
|
|
1829
1829
|
isUploading: { type: Boolean },
|
|
@@ -1841,9 +1841,9 @@ var xe = ["data-tpl-theme"], Se = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, Ce
|
|
|
1841
1841
|
let t = u(e);
|
|
1842
1842
|
t.length && n("upload", t);
|
|
1843
1843
|
}
|
|
1844
|
-
let { isOverDropZone: h } =
|
|
1844
|
+
let { isOverDropZone: h } = se(l, { onDrop: (e) => {
|
|
1845
1845
|
e?.length && p(e);
|
|
1846
|
-
} }), { open: g, onChange: _ } =
|
|
1846
|
+
} }), { open: g, onChange: _ } = le({
|
|
1847
1847
|
accept: s.value,
|
|
1848
1848
|
multiple: !0
|
|
1849
1849
|
});
|
|
@@ -1852,41 +1852,41 @@ var xe = ["data-tpl-theme"], Se = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, Ce
|
|
|
1852
1852
|
}), (t, n) => (S(), d("div", {
|
|
1853
1853
|
ref_key: "dropZoneRef",
|
|
1854
1854
|
ref: l,
|
|
1855
|
-
class: y(["tpl-upload-zone tpl:flex tpl:cursor-pointer tpl:flex-col tpl:items-center tpl:justify-center tpl:rounded-lg tpl:border-2 tpl:border-dashed tpl:p-5 tpl:text-center tpl:transition-all tpl:duration-150",
|
|
1855
|
+
class: y(["tpl-upload-zone tpl:flex tpl:cursor-pointer tpl:flex-col tpl:items-center tpl:justify-center tpl:rounded-lg tpl:border-2 tpl:border-dashed tpl:p-5 tpl:text-center tpl:transition-all tpl:duration-150", k(h) ? "tpl-upload-zone-active" : ""]),
|
|
1856
1856
|
style: {
|
|
1857
1857
|
"border-color": "var(--tpl-border-light)",
|
|
1858
1858
|
"background-color": "var(--tpl-bg)"
|
|
1859
1859
|
},
|
|
1860
|
-
onClick: n[0] ||= (e) =>
|
|
1861
|
-
}, [e.isUploading ? (S(), d("div",
|
|
1860
|
+
onClick: n[0] ||= (e) => k(g)()
|
|
1861
|
+
}, [e.isUploading ? (S(), d("div", zn, [m(k(W), {
|
|
1862
1862
|
class: "tpl-spinner",
|
|
1863
1863
|
size: 20,
|
|
1864
1864
|
"stroke-width": 2,
|
|
1865
1865
|
style: { color: "var(--tpl-primary)" }
|
|
1866
|
-
}), f("span",
|
|
1866
|
+
}), f("span", Bn, D(e.uploadProgress && e.uploadProgress.total > 1 ? k(a)(k(r).mediaLibrary.uploadingProgress, {
|
|
1867
1867
|
current: e.uploadProgress.current,
|
|
1868
1868
|
total: e.uploadProgress.total
|
|
1869
|
-
}) :
|
|
1870
|
-
m(
|
|
1869
|
+
}) : k(r).mediaLibrary.uploading), 1)])) : (S(), d(i, { key: 1 }, [
|
|
1870
|
+
m(k(te), {
|
|
1871
1871
|
class: "tpl:mb-2",
|
|
1872
1872
|
size: 24,
|
|
1873
1873
|
"stroke-width": 1.5,
|
|
1874
1874
|
style: { color: "var(--tpl-text-dim)" }
|
|
1875
1875
|
}),
|
|
1876
|
-
f("p",
|
|
1877
|
-
f("p",
|
|
1876
|
+
f("p", Vn, D(k(r).mediaLibrary.dropOrClick), 1),
|
|
1877
|
+
f("p", Hn, D(k(r).mediaLibrary.acceptedFormats), 1)
|
|
1878
1878
|
], 64))], 2));
|
|
1879
1879
|
}
|
|
1880
|
-
}),
|
|
1880
|
+
}), Wn = [
|
|
1881
1881
|
"width",
|
|
1882
1882
|
"height",
|
|
1883
1883
|
"viewBox"
|
|
1884
|
-
],
|
|
1884
|
+
], Gn = [
|
|
1885
1885
|
"cx",
|
|
1886
1886
|
"cy",
|
|
1887
1887
|
"r",
|
|
1888
1888
|
"stroke-width"
|
|
1889
|
-
],
|
|
1889
|
+
], Kn = [
|
|
1890
1890
|
"cx",
|
|
1891
1891
|
"cy",
|
|
1892
1892
|
"r",
|
|
@@ -1894,14 +1894,14 @@ var xe = ["data-tpl-theme"], Se = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, Ce
|
|
|
1894
1894
|
"stroke",
|
|
1895
1895
|
"stroke-dasharray",
|
|
1896
1896
|
"stroke-dashoffset"
|
|
1897
|
-
],
|
|
1897
|
+
], qn = {
|
|
1898
1898
|
key: 0,
|
|
1899
1899
|
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",
|
|
1900
1900
|
style: {
|
|
1901
1901
|
"background-color": "var(--tpl-text)",
|
|
1902
1902
|
color: "var(--tpl-bg-elevated)"
|
|
1903
1903
|
}
|
|
1904
|
-
},
|
|
1904
|
+
}, Jn = /* @__PURE__ */ h({
|
|
1905
1905
|
__name: "StorageProgressRing",
|
|
1906
1906
|
props: {
|
|
1907
1907
|
usedBytes: {},
|
|
@@ -1941,7 +1941,7 @@ var xe = ["data-tpl-theme"], Se = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, Ce
|
|
|
1941
1941
|
fill: "none",
|
|
1942
1942
|
"stroke-width": c.value,
|
|
1943
1943
|
style: { stroke: "var(--tpl-border)" }
|
|
1944
|
-
}, null, 8,
|
|
1944
|
+
}, null, 8, Gn), f("circle", {
|
|
1945
1945
|
cx: a.value / 2,
|
|
1946
1946
|
cy: a.value / 2,
|
|
1947
1947
|
r: l.value,
|
|
@@ -1952,7 +1952,7 @@ var xe = ["data-tpl-theme"], Se = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, Ce
|
|
|
1952
1952
|
"stroke-dasharray": h.value,
|
|
1953
1953
|
"stroke-dashoffset": _.value,
|
|
1954
1954
|
class: "tpl:transition-all tpl:duration-300 tpl:ease-out"
|
|
1955
|
-
}, null, 8,
|
|
1955
|
+
}, null, 8, Kn)], 8, Wn)), m(o, {
|
|
1956
1956
|
"enter-active-class": "tpl:transition tpl:ease-out tpl:duration-150",
|
|
1957
1957
|
"enter-from-class": "tpl:opacity-0 tpl:translate-y-1",
|
|
1958
1958
|
"enter-to-class": "tpl:opacity-100 tpl:translate-y-0",
|
|
@@ -1960,7 +1960,7 @@ var xe = ["data-tpl-theme"], Se = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, Ce
|
|
|
1960
1960
|
"leave-from-class": "tpl:opacity-100 tpl:translate-y-0",
|
|
1961
1961
|
"leave-to-class": "tpl:opacity-0 tpl:translate-y-1"
|
|
1962
1962
|
}, {
|
|
1963
|
-
default:
|
|
1963
|
+
default: M(() => [i.value ? (S(), d("div", qn, [p(D(E.value) + " ", 1), t[2] ||= f("div", {
|
|
1964
1964
|
class: "tpl:absolute tpl:-top-1 tpl:left-1/2 tpl:size-2 tpl:-translate-x-1/2 tpl:rotate-45",
|
|
1965
1965
|
style: { "background-color": "var(--tpl-text)" }
|
|
1966
1966
|
}, null, -1)])) : u("", !0)]),
|
|
@@ -1970,7 +1970,7 @@ var xe = ["data-tpl-theme"], Se = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, Ce
|
|
|
1970
1970
|
});
|
|
1971
1971
|
//#endregion
|
|
1972
1972
|
//#region src/composables/useMediaLibraryUI.ts
|
|
1973
|
-
function
|
|
1973
|
+
function Yn(e) {
|
|
1974
1974
|
let { library: t, canUseMediaFolders: n, translations: r } = e;
|
|
1975
1975
|
function i() {
|
|
1976
1976
|
return "value" in r && typeof r.value == "object" ? r.value : r;
|
|
@@ -1993,18 +1993,18 @@ function qn(e) {
|
|
|
1993
1993
|
function v(e) {
|
|
1994
1994
|
return _[e]?.() ?? e;
|
|
1995
1995
|
}
|
|
1996
|
-
|
|
1996
|
+
j(o, (e) => {
|
|
1997
1997
|
e && n.value && t.loadFolders();
|
|
1998
|
-
}),
|
|
1998
|
+
}), j(() => t.previewItem.value?.id, () => {
|
|
1999
1999
|
l.value = "original";
|
|
2000
2000
|
});
|
|
2001
|
-
let y =
|
|
2001
|
+
let y = oe((e) => {
|
|
2002
2002
|
t.search(e);
|
|
2003
2003
|
}, 300);
|
|
2004
2004
|
function b(e) {
|
|
2005
2005
|
c.value = e, y(e);
|
|
2006
2006
|
}
|
|
2007
|
-
let { copy: x, copied: S } =
|
|
2007
|
+
let { copy: x, copied: S } = ae({
|
|
2008
2008
|
copiedDuring: 2e3,
|
|
2009
2009
|
legacy: !0
|
|
2010
2010
|
});
|
|
@@ -2026,7 +2026,7 @@ function qn(e) {
|
|
|
2026
2026
|
function k(e) {
|
|
2027
2027
|
u.value = e;
|
|
2028
2028
|
}
|
|
2029
|
-
async function
|
|
2029
|
+
async function A(e, n, r, i) {
|
|
2030
2030
|
i && await t.replaceMediaDirectly(e, i.file), await t.updateFile(e, n, r), u.value = null;
|
|
2031
2031
|
}
|
|
2032
2032
|
async function M(e) {
|
|
@@ -2069,7 +2069,7 @@ function qn(e) {
|
|
|
2069
2069
|
handleRenameFolder: D,
|
|
2070
2070
|
handleDeleteFolder: O,
|
|
2071
2071
|
handleEditItem: k,
|
|
2072
|
-
handleEditSave:
|
|
2072
|
+
handleEditSave: A,
|
|
2073
2073
|
handleImportFromUrl: M,
|
|
2074
2074
|
handleMoveToFolder: N,
|
|
2075
2075
|
handleDeleteClick: P,
|
|
@@ -2080,7 +2080,7 @@ function qn(e) {
|
|
|
2080
2080
|
}
|
|
2081
2081
|
//#endregion
|
|
2082
2082
|
//#region src/components/MediaLibraryModal.vue?vue&type=script&setup=true&lang.ts
|
|
2083
|
-
var
|
|
2083
|
+
var Xn = ["data-tpl-theme"], Zn = {
|
|
2084
2084
|
class: "tpl-media-modal tpl-scale-in tpl:flex tpl:flex-col tpl:overflow-hidden tpl:rounded-[var(--tpl-radius-lg)]",
|
|
2085
2085
|
style: {
|
|
2086
2086
|
width: "900px",
|
|
@@ -2091,97 +2091,100 @@ var Jn = ["data-tpl-theme"], Yn = {
|
|
|
2091
2091
|
border: "1px solid var(--tpl-border)",
|
|
2092
2092
|
"box-shadow": "var(--tpl-shadow-xl)"
|
|
2093
2093
|
}
|
|
2094
|
-
},
|
|
2094
|
+
}, Qn = {
|
|
2095
2095
|
class: "tpl:flex tpl:shrink-0 tpl:items-center tpl:justify-between tpl:border-b tpl:px-5 tpl:py-3.5",
|
|
2096
2096
|
style: { "border-color": "var(--tpl-border)" }
|
|
2097
|
-
},
|
|
2097
|
+
}, $n = {
|
|
2098
2098
|
class: "tpl:text-sm tpl:font-semibold",
|
|
2099
2099
|
style: { color: "var(--tpl-text)" }
|
|
2100
|
-
},
|
|
2100
|
+
}, er = { class: "tpl:flex tpl:items-center tpl:gap-3" }, tr = { class: "tpl:relative" }, nr = ["value", "placeholder"], rr = { class: "tpl:flex tpl:min-h-0 tpl:flex-1 tpl:overflow-hidden" }, ir = {
|
|
2101
2101
|
key: 0,
|
|
2102
2102
|
class: "tpl:flex tpl:w-48 tpl:shrink-0 tpl:flex-col tpl:border-r",
|
|
2103
2103
|
style: {
|
|
2104
2104
|
"border-color": "var(--tpl-border)",
|
|
2105
2105
|
"background-color": "var(--tpl-bg)"
|
|
2106
2106
|
}
|
|
2107
|
-
},
|
|
2107
|
+
}, ar = { class: "tpl:flex tpl:min-w-0 tpl:flex-1 tpl:flex-col" }, or = {
|
|
2108
2108
|
class: "tpl:flex tpl:shrink-0 tpl:items-center tpl:justify-between tpl:border-b tpl:px-4 tpl:py-2.5",
|
|
2109
2109
|
style: { "border-color": "var(--tpl-border)" }
|
|
2110
|
-
},
|
|
2110
|
+
}, sr = { class: "tpl:flex tpl:items-center tpl:gap-2" }, cr = ["title"], lr = {
|
|
2111
2111
|
key: 1,
|
|
2112
2112
|
class: "tpl:text-xs tpl:font-medium",
|
|
2113
2113
|
style: { color: "var(--tpl-text)" }
|
|
2114
|
-
},
|
|
2114
|
+
}, ur = {
|
|
2115
2115
|
class: "tpl:flex tpl:rounded-md tpl:p-0.5",
|
|
2116
2116
|
style: {
|
|
2117
2117
|
border: "1px solid var(--tpl-border)",
|
|
2118
2118
|
"background-color": "var(--tpl-bg)"
|
|
2119
2119
|
}
|
|
2120
|
-
},
|
|
2120
|
+
}, dr = ["title"], fr = ["title"], pr = { class: "tpl:flex tpl:items-center tpl:gap-2" }, mr = ["value"], hr = { value: "" }, gr = ["value"], _r = ["value"], vr = { value: "newest" }, yr = { value: "oldest" }, br = { value: "name_asc" }, xr = { value: "name_desc" }, Sr = { value: "size_asc" }, Cr = { value: "size_desc" }, wr = { class: "tpl:min-h-0 tpl:flex-1 tpl:overflow-y-auto" }, Tr = {
|
|
2121
2121
|
key: 0,
|
|
2122
2122
|
class: "tpl:px-4 tpl:pt-3"
|
|
2123
|
-
},
|
|
2123
|
+
}, Er = {
|
|
2124
2124
|
class: "tpl-scale-in tpl:mx-4 tpl:w-full tpl:max-w-sm tpl:rounded-[var(--tpl-radius-lg)] tpl:p-5",
|
|
2125
2125
|
style: {
|
|
2126
2126
|
"background-color": "var(--tpl-bg-elevated)",
|
|
2127
2127
|
"box-shadow": "var(--tpl-shadow-xl)"
|
|
2128
2128
|
}
|
|
2129
|
-
},
|
|
2129
|
+
}, Dr = {
|
|
2130
2130
|
class: "tpl:mb-2 tpl:text-sm tpl:font-semibold",
|
|
2131
2131
|
style: { color: "var(--tpl-text)" }
|
|
2132
|
-
},
|
|
2132
|
+
}, Or = {
|
|
2133
2133
|
key: 0,
|
|
2134
2134
|
class: "tpl:mb-4 tpl:text-xs",
|
|
2135
2135
|
style: { color: "var(--tpl-text-muted)" }
|
|
2136
|
-
},
|
|
2136
|
+
}, kr = {
|
|
2137
2137
|
key: 1,
|
|
2138
2138
|
class: "tpl:mb-4 tpl:max-h-32 tpl:overflow-y-auto tpl:rounded tpl:border tpl:p-2",
|
|
2139
2139
|
style: { "border-color": "var(--tpl-border)" }
|
|
2140
|
-
},
|
|
2140
|
+
}, Ar = { class: "tpl:font-medium" }, jr = { style: { color: "var(--tpl-text-muted)" } }, Mr = { class: "tpl:flex tpl:justify-end tpl:gap-2" }, Nr = {
|
|
2141
2141
|
class: "tpl:flex tpl:shrink-0 tpl:items-center tpl:justify-between tpl:border-t tpl:px-5 tpl:py-3",
|
|
2142
2142
|
style: { "border-color": "var(--tpl-border)" }
|
|
2143
|
-
},
|
|
2143
|
+
}, Pr = { class: "tpl:flex tpl:min-w-0 tpl:flex-1 tpl:items-center tpl:gap-3" }, Fr = { class: "tpl:flex tpl:items-center tpl:gap-5" }, Ir = {
|
|
2144
2144
|
key: 0,
|
|
2145
2145
|
class: "tpl:flex tpl:items-center tpl:gap-2"
|
|
2146
|
-
},
|
|
2146
|
+
}, Lr = {
|
|
2147
2147
|
key: 1,
|
|
2148
2148
|
class: "tpl:relative"
|
|
2149
|
-
},
|
|
2149
|
+
}, Rr = { class: "tpl:flex tpl:items-center tpl:gap-2" }, zr = ["disabled"], Br = /* @__PURE__ */ h({
|
|
2150
2150
|
__name: "MediaLibraryModal",
|
|
2151
2151
|
props: {
|
|
2152
2152
|
visible: { type: Boolean },
|
|
2153
|
-
accept: {}
|
|
2153
|
+
accept: {},
|
|
2154
|
+
popoverTarget: {}
|
|
2154
2155
|
},
|
|
2155
2156
|
emits: ["close", "select"],
|
|
2156
2157
|
setup(e, { emit: t }) {
|
|
2157
|
-
let n = e, r = t, { t: c } = Z(), h = _("tplUiTheme")
|
|
2158
|
+
let n = e, r = t, { t: c } = Z(), h = _("tplUiTheme");
|
|
2159
|
+
C(Se, O(() => n.popoverTarget ?? null));
|
|
2160
|
+
let g = _("authManager"), v = _("projectId"), x = s(() => v.value), w = _("planConfig"), E = s(() => w.hasFeature("media_folders")), A = s(() => w.hasFeature("import_from_url")), N = s(() => w.config.value?.storage.used_bytes ?? 0), P = s(() => w.config.value?.storage.limit_bytes ?? 0), { isAcceptedMimeType: L, availableCategories: z } = Q(), B = fe({
|
|
2158
2161
|
projectId: x.value,
|
|
2159
2162
|
authManager: g
|
|
2160
|
-
}),
|
|
2161
|
-
library:
|
|
2162
|
-
canUseMediaFolders:
|
|
2163
|
+
}), W = Yn({
|
|
2164
|
+
library: B,
|
|
2165
|
+
canUseMediaFolders: E,
|
|
2163
2166
|
translations: c
|
|
2164
2167
|
});
|
|
2165
|
-
|
|
2166
|
-
e ? (
|
|
2168
|
+
j(() => n.visible, (e) => {
|
|
2169
|
+
e ? (B.loadItems(), B.loadFrequentlyUsed()) : W.resetUI();
|
|
2167
2170
|
});
|
|
2168
|
-
function
|
|
2171
|
+
function K(e) {
|
|
2169
2172
|
e.key === "Escape" && r("close");
|
|
2170
2173
|
}
|
|
2171
|
-
|
|
2172
|
-
function
|
|
2173
|
-
return
|
|
2174
|
+
ce(document, "keydown", K);
|
|
2175
|
+
function q() {
|
|
2176
|
+
return B.previewItem.value ? n.accept?.length ? L(B.previewItem.value.mime_type, n.accept) : !0 : !1;
|
|
2174
2177
|
}
|
|
2175
|
-
function
|
|
2176
|
-
if (
|
|
2177
|
-
let e =
|
|
2178
|
+
function J() {
|
|
2179
|
+
if (q()) {
|
|
2180
|
+
let e = B.previewItem.value;
|
|
2178
2181
|
r("select", {
|
|
2179
2182
|
...e,
|
|
2180
|
-
url:
|
|
2183
|
+
url: W.selectedUrl.value || e.url
|
|
2181
2184
|
}), r("close");
|
|
2182
2185
|
}
|
|
2183
2186
|
}
|
|
2184
|
-
return (t, n) => (S(), l(a, { to: "body" }, [m(o, {
|
|
2187
|
+
return (t, n) => (S(), l(a, { to: e.popoverTarget || "body" }, [m(o, {
|
|
2185
2188
|
"enter-active-class": "tpl:transition tpl:duration-200",
|
|
2186
2189
|
"enter-from-class": "tpl:opacity-0",
|
|
2187
2190
|
"enter-to-class": "tpl:opacity-100",
|
|
@@ -2189,20 +2192,20 @@ var Jn = ["data-tpl-theme"], Yn = {
|
|
|
2189
2192
|
"leave-from-class": "tpl:opacity-100",
|
|
2190
2193
|
"leave-to-class": "tpl:opacity-0"
|
|
2191
2194
|
}, {
|
|
2192
|
-
default:
|
|
2195
|
+
default: M(() => [e.visible ? (S(), d("div", {
|
|
2193
2196
|
key: 0,
|
|
2194
|
-
"data-tpl-theme":
|
|
2197
|
+
"data-tpl-theme": k(h),
|
|
2195
2198
|
class: "tpl tpl-media-overlay tpl:fixed tpl:inset-0 tpl:z-[9999]",
|
|
2196
|
-
onClick: n[18] ||=
|
|
2197
|
-
}, [f("div",
|
|
2198
|
-
f("div",
|
|
2199
|
-
m(
|
|
2200
|
-
"used-bytes":
|
|
2201
|
-
"limit-bytes":
|
|
2199
|
+
onClick: n[18] ||= F((e) => r("close"), ["self"])
|
|
2200
|
+
}, [f("div", Zn, [
|
|
2201
|
+
f("div", Qn, [f("h2", $n, D(k(c).mediaLibrary.title), 1), f("div", er, [
|
|
2202
|
+
m(Jn, {
|
|
2203
|
+
"used-bytes": N.value,
|
|
2204
|
+
"limit-bytes": P.value,
|
|
2202
2205
|
size: 22
|
|
2203
2206
|
}, null, 8, ["used-bytes", "limit-bytes"]),
|
|
2204
|
-
f("div",
|
|
2205
|
-
value:
|
|
2207
|
+
f("div", tr, [f("input", {
|
|
2208
|
+
value: k(W).searchInput.value,
|
|
2206
2209
|
type: "text",
|
|
2207
2210
|
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)]",
|
|
2208
2211
|
style: {
|
|
@@ -2210,9 +2213,9 @@ var Jn = ["data-tpl-theme"], Yn = {
|
|
|
2210
2213
|
"background-color": "var(--tpl-bg)",
|
|
2211
2214
|
color: "var(--tpl-text)"
|
|
2212
2215
|
},
|
|
2213
|
-
placeholder:
|
|
2214
|
-
onInput: n[0] ||= (e) =>
|
|
2215
|
-
}, null, 40,
|
|
2216
|
+
placeholder: k(c).mediaLibrary.searchPlaceholder,
|
|
2217
|
+
onInput: n[0] ||= (e) => k(W).handleSearchInput(e.target.value)
|
|
2218
|
+
}, null, 40, nr), m(k(Y), {
|
|
2216
2219
|
class: "tpl:absolute tpl:top-1/2 tpl:left-2.5 tpl:-translate-y-1/2",
|
|
2217
2220
|
size: 13,
|
|
2218
2221
|
"stroke-width": 2,
|
|
@@ -2222,12 +2225,12 @@ var Jn = ["data-tpl-theme"], Yn = {
|
|
|
2222
2225
|
class: "tpl:flex tpl:size-7 tpl:items-center tpl:justify-center tpl:rounded-md tpl:transition-all tpl:duration-150",
|
|
2223
2226
|
style: { color: "var(--tpl-text-muted)" },
|
|
2224
2227
|
onClick: n[1] ||= (e) => r("close")
|
|
2225
|
-
}, [m(
|
|
2228
|
+
}, [m(k(ne), {
|
|
2226
2229
|
size: 18,
|
|
2227
2230
|
"stroke-width": 2
|
|
2228
2231
|
})])
|
|
2229
2232
|
])]),
|
|
2230
|
-
f("div",
|
|
2233
|
+
f("div", rr, [m(o, {
|
|
2231
2234
|
"enter-active-class": "tpl:transition-all tpl:duration-200 tpl:ease-out",
|
|
2232
2235
|
"enter-from-class": "tpl:-ml-48 tpl:opacity-0",
|
|
2233
2236
|
"enter-to-class": "tpl:ml-0 tpl:opacity-100",
|
|
@@ -2235,16 +2238,16 @@ var Jn = ["data-tpl-theme"], Yn = {
|
|
|
2235
2238
|
"leave-from-class": "tpl:ml-0 tpl:opacity-100",
|
|
2236
2239
|
"leave-to-class": "tpl:-ml-48 tpl:opacity-0"
|
|
2237
2240
|
}, {
|
|
2238
|
-
default:
|
|
2239
|
-
folders:
|
|
2240
|
-
"current-folder-id":
|
|
2241
|
-
"view-mode":
|
|
2242
|
-
"has-frequently-used":
|
|
2243
|
-
onNavigate:
|
|
2244
|
-
onCreateFolder:
|
|
2245
|
-
onRenameFolder:
|
|
2246
|
-
onDeleteFolder:
|
|
2247
|
-
onShowFrequentlyUsed:
|
|
2241
|
+
default: M(() => [E.value && k(W).showSidebar.value ? (S(), d("div", ir, [m(_t, {
|
|
2242
|
+
folders: k(B).folders.value,
|
|
2243
|
+
"current-folder-id": k(B).currentFolderId.value,
|
|
2244
|
+
"view-mode": k(B).viewMode.value,
|
|
2245
|
+
"has-frequently-used": k(W).hasFrequentlyUsed.value,
|
|
2246
|
+
onNavigate: k(B).navigateToFolder,
|
|
2247
|
+
onCreateFolder: k(W).handleCreateFolder,
|
|
2248
|
+
onRenameFolder: k(W).handleRenameFolder,
|
|
2249
|
+
onDeleteFolder: k(W).handleDeleteFolder,
|
|
2250
|
+
onShowFrequentlyUsed: k(B).showFrequentlyUsed
|
|
2248
2251
|
}, null, 8, [
|
|
2249
2252
|
"folders",
|
|
2250
2253
|
"current-folder-id",
|
|
@@ -2257,55 +2260,55 @@ var Jn = ["data-tpl-theme"], Yn = {
|
|
|
2257
2260
|
"onShowFrequentlyUsed"
|
|
2258
2261
|
])])) : u("", !0)]),
|
|
2259
2262
|
_: 1
|
|
2260
|
-
}), f("div",
|
|
2261
|
-
|
|
2263
|
+
}), f("div", ar, [f("div", or, [f("div", sr, [
|
|
2264
|
+
E.value ? (S(), d("button", {
|
|
2262
2265
|
key: 0,
|
|
2263
2266
|
class: "tpl:flex tpl:size-7 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded-md tpl:transition-all tpl:duration-150",
|
|
2264
2267
|
style: b({
|
|
2265
|
-
color:
|
|
2266
|
-
backgroundColor:
|
|
2267
|
-
border:
|
|
2268
|
+
color: k(W).showSidebar.value ? "var(--tpl-primary)" : "var(--tpl-text-muted)",
|
|
2269
|
+
backgroundColor: k(W).showSidebar.value ? "var(--tpl-bg)" : "transparent",
|
|
2270
|
+
border: k(W).showSidebar.value ? "1px solid var(--tpl-border)" : "1px solid transparent"
|
|
2268
2271
|
}),
|
|
2269
|
-
title:
|
|
2270
|
-
onClick: n[2] ||= (e) =>
|
|
2271
|
-
}, [m(
|
|
2272
|
+
title: k(W).showSidebar.value ? k(c).mediaLibrary.hideFolders : k(c).mediaLibrary.showFolders,
|
|
2273
|
+
onClick: n[2] ||= (e) => k(W).showSidebar.value = !k(W).showSidebar.value
|
|
2274
|
+
}, [m(k(G), {
|
|
2272
2275
|
size: 16,
|
|
2273
2276
|
"stroke-width": 2
|
|
2274
|
-
})], 12,
|
|
2275
|
-
|
|
2277
|
+
})], 12, cr)) : u("", !0),
|
|
2278
|
+
k(B).viewMode.value === "frequently-used" ? (S(), d("span", lr, D(k(c).mediaLibrary.frequentlyUsed), 1)) : (S(), l(ge, {
|
|
2276
2279
|
key: 2,
|
|
2277
|
-
folders:
|
|
2278
|
-
"current-folder-id":
|
|
2279
|
-
onNavigate:
|
|
2280
|
+
folders: k(B).folders.value,
|
|
2281
|
+
"current-folder-id": k(B).currentFolderId.value,
|
|
2282
|
+
onNavigate: k(B).navigateToFolder
|
|
2280
2283
|
}, null, 8, [
|
|
2281
2284
|
"folders",
|
|
2282
2285
|
"current-folder-id",
|
|
2283
2286
|
"onNavigate"
|
|
2284
2287
|
])),
|
|
2285
|
-
f("div",
|
|
2288
|
+
f("div", ur, [f("button", {
|
|
2286
2289
|
class: "tpl:flex tpl:size-6 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded tpl:transition-all tpl:duration-150",
|
|
2287
2290
|
style: b({
|
|
2288
|
-
color:
|
|
2289
|
-
backgroundColor:
|
|
2291
|
+
color: k(W).layoutMode.value === "grid" ? "var(--tpl-primary)" : "var(--tpl-text-muted)",
|
|
2292
|
+
backgroundColor: k(W).layoutMode.value === "grid" ? "var(--tpl-bg-elevated)" : "transparent"
|
|
2290
2293
|
}),
|
|
2291
|
-
title:
|
|
2292
|
-
onClick: n[3] ||= (e) =>
|
|
2293
|
-
}, [m(
|
|
2294
|
+
title: k(c).mediaLibrary.viewGrid,
|
|
2295
|
+
onClick: n[3] ||= (e) => k(W).layoutMode.value = "grid"
|
|
2296
|
+
}, [m(k(V), {
|
|
2294
2297
|
size: 14,
|
|
2295
2298
|
"stroke-width": 2
|
|
2296
|
-
})], 12,
|
|
2299
|
+
})], 12, dr), f("button", {
|
|
2297
2300
|
class: "tpl:flex tpl:size-6 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded tpl:transition-all tpl:duration-150",
|
|
2298
2301
|
style: b({
|
|
2299
|
-
color:
|
|
2300
|
-
backgroundColor:
|
|
2302
|
+
color: k(W).layoutMode.value === "list" ? "var(--tpl-primary)" : "var(--tpl-text-muted)",
|
|
2303
|
+
backgroundColor: k(W).layoutMode.value === "list" ? "var(--tpl-bg-elevated)" : "transparent"
|
|
2301
2304
|
}),
|
|
2302
|
-
title:
|
|
2303
|
-
onClick: n[4] ||= (e) =>
|
|
2304
|
-
}, [m(
|
|
2305
|
+
title: k(c).mediaLibrary.viewList,
|
|
2306
|
+
onClick: n[4] ||= (e) => k(W).layoutMode.value = "list"
|
|
2307
|
+
}, [m(k(U), {
|
|
2305
2308
|
size: 14,
|
|
2306
2309
|
"stroke-width": 2
|
|
2307
|
-
})], 12,
|
|
2308
|
-
]), f("div",
|
|
2310
|
+
})], 12, fr)])
|
|
2311
|
+
]), f("div", pr, [k(z).length > 1 ? (S(), d("select", {
|
|
2309
2312
|
key: 0,
|
|
2310
2313
|
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",
|
|
2311
2314
|
style: {
|
|
@@ -2313,36 +2316,36 @@ var Jn = ["data-tpl-theme"], Yn = {
|
|
|
2313
2316
|
"background-color": "var(--tpl-bg)",
|
|
2314
2317
|
color: "var(--tpl-text)"
|
|
2315
2318
|
},
|
|
2316
|
-
value:
|
|
2317
|
-
onChange: n[5] ||= (e) =>
|
|
2318
|
-
}, [f("option",
|
|
2319
|
+
value: k(B).categoryFilter.value ?? "",
|
|
2320
|
+
onChange: n[5] ||= (e) => k(B).filterByCategory(e.target.value || null)
|
|
2321
|
+
}, [f("option", hr, D(k(c).mediaLibrary.filterAll), 1), (S(!0), d(i, null, T(k(z), (e) => (S(), d("option", {
|
|
2319
2322
|
key: e,
|
|
2320
2323
|
value: e
|
|
2321
|
-
}, D(
|
|
2324
|
+
}, D(k(W).getCategoryLabel(e)), 9, gr))), 128))], 40, mr)) : u("", !0), f("select", {
|
|
2322
2325
|
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",
|
|
2323
2326
|
style: {
|
|
2324
2327
|
"border-color": "var(--tpl-border)",
|
|
2325
2328
|
"background-color": "var(--tpl-bg)",
|
|
2326
2329
|
color: "var(--tpl-text)"
|
|
2327
2330
|
},
|
|
2328
|
-
value:
|
|
2329
|
-
onChange: n[6] ||= (e) =>
|
|
2331
|
+
value: k(B).sortOption.value,
|
|
2332
|
+
onChange: n[6] ||= (e) => k(B).sortBy(e.target.value)
|
|
2330
2333
|
}, [
|
|
2331
|
-
f("option",
|
|
2332
|
-
f("option",
|
|
2333
|
-
f("option",
|
|
2334
|
-
f("option",
|
|
2335
|
-
f("option",
|
|
2336
|
-
f("option",
|
|
2337
|
-
], 40,
|
|
2338
|
-
"is-uploading":
|
|
2339
|
-
"upload-progress":
|
|
2340
|
-
onUpload:
|
|
2334
|
+
f("option", vr, D(k(c).mediaLibrary.sortNewest), 1),
|
|
2335
|
+
f("option", yr, D(k(c).mediaLibrary.sortOldest), 1),
|
|
2336
|
+
f("option", br, D(k(c).mediaLibrary.sortNameAsc), 1),
|
|
2337
|
+
f("option", xr, D(k(c).mediaLibrary.sortNameDesc), 1),
|
|
2338
|
+
f("option", Sr, D(k(c).mediaLibrary.sortSizeAsc), 1),
|
|
2339
|
+
f("option", Cr, D(k(c).mediaLibrary.sortSizeDesc), 1)
|
|
2340
|
+
], 40, _r)])]), f("div", wr, [k(B).viewMode.value === "files" ? (S(), d("div", Tr, [m(Un, {
|
|
2341
|
+
"is-uploading": k(B).isUploading.value,
|
|
2342
|
+
"upload-progress": k(B).uploadProgress.value,
|
|
2343
|
+
onUpload: k(W).handleUpload
|
|
2341
2344
|
}, null, 8, [
|
|
2342
2345
|
"is-uploading",
|
|
2343
2346
|
"upload-progress",
|
|
2344
2347
|
"onUpload"
|
|
2345
|
-
]),
|
|
2348
|
+
]), A.value ? (S(), d("button", {
|
|
2346
2349
|
key: 0,
|
|
2347
2350
|
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",
|
|
2348
2351
|
style: {
|
|
@@ -2350,22 +2353,22 @@ var Jn = ["data-tpl-theme"], Yn = {
|
|
|
2350
2353
|
color: "var(--tpl-text-muted)",
|
|
2351
2354
|
"background-color": "var(--tpl-bg)"
|
|
2352
2355
|
},
|
|
2353
|
-
onClick: n[7] ||= (e) =>
|
|
2354
|
-
}, [m(
|
|
2356
|
+
onClick: n[7] ||= (e) => k(W).showImportUrlModal.value = !0
|
|
2357
|
+
}, [m(k(H), {
|
|
2355
2358
|
size: 14,
|
|
2356
2359
|
"stroke-width": 2
|
|
2357
|
-
}), p(" " + D(
|
|
2358
|
-
items:
|
|
2359
|
-
"selected-ids":
|
|
2360
|
-
"is-loading":
|
|
2361
|
-
"has-more":
|
|
2360
|
+
}), p(" " + D(k(c).mediaLibrary.importFromUrl), 1)])) : u("", !0)])) : u("", !0), m(Jt, {
|
|
2361
|
+
items: k(W).displayItems.value,
|
|
2362
|
+
"selected-ids": k(B).selectedItems.value,
|
|
2363
|
+
"is-loading": k(B).isLoading.value,
|
|
2364
|
+
"has-more": k(B).viewMode.value === "files" && k(B).hasMore.value,
|
|
2362
2365
|
accept: e.accept,
|
|
2363
|
-
layout:
|
|
2364
|
-
onSelect:
|
|
2365
|
-
onToggle:
|
|
2366
|
-
onLoadMore:
|
|
2367
|
-
onEdit:
|
|
2368
|
-
onReplace:
|
|
2366
|
+
layout: k(W).layoutMode.value,
|
|
2367
|
+
onSelect: k(W).handleSelect,
|
|
2368
|
+
onToggle: k(B).toggleSelection,
|
|
2369
|
+
onLoadMore: k(B).loadMore,
|
|
2370
|
+
onEdit: k(W).handleEditItem,
|
|
2371
|
+
onReplace: k(W).handleReplaceItem
|
|
2369
2372
|
}, null, 8, [
|
|
2370
2373
|
"items",
|
|
2371
2374
|
"selected-ids",
|
|
@@ -2379,36 +2382,36 @@ var Jn = ["data-tpl-theme"], Yn = {
|
|
|
2379
2382
|
"onEdit",
|
|
2380
2383
|
"onReplace"
|
|
2381
2384
|
])])])]),
|
|
2382
|
-
m(
|
|
2383
|
-
visible:
|
|
2384
|
-
"is-importing":
|
|
2385
|
-
error:
|
|
2386
|
-
onImport:
|
|
2387
|
-
onClose: n[8] ||= (e) =>
|
|
2385
|
+
m(sn, {
|
|
2386
|
+
visible: k(W).showImportUrlModal.value,
|
|
2387
|
+
"is-importing": k(B).isImportingFromUrl.value,
|
|
2388
|
+
error: k(B).importFromUrlError.value,
|
|
2389
|
+
onImport: k(W).handleImportFromUrl,
|
|
2390
|
+
onClose: n[8] ||= (e) => k(W).showImportUrlModal.value = !1
|
|
2388
2391
|
}, null, 8, [
|
|
2389
2392
|
"visible",
|
|
2390
2393
|
"is-importing",
|
|
2391
2394
|
"error",
|
|
2392
2395
|
"onImport"
|
|
2393
2396
|
]),
|
|
2394
|
-
m(
|
|
2395
|
-
visible: !!
|
|
2396
|
-
item:
|
|
2397
|
-
onSave:
|
|
2398
|
-
onClose: n[9] ||= (e) =>
|
|
2397
|
+
m(it, {
|
|
2398
|
+
visible: !!k(W).editingItem.value,
|
|
2399
|
+
item: k(W).editingItem.value,
|
|
2400
|
+
onSave: k(W).handleEditSave,
|
|
2401
|
+
onClose: n[9] ||= (e) => k(W).editingItem.value = null
|
|
2399
2402
|
}, null, 8, [
|
|
2400
2403
|
"visible",
|
|
2401
2404
|
"item",
|
|
2402
2405
|
"onSave"
|
|
2403
2406
|
]),
|
|
2404
|
-
m(
|
|
2405
|
-
visible:
|
|
2406
|
-
item:
|
|
2407
|
-
"usage-info":
|
|
2408
|
-
"is-replacing":
|
|
2409
|
-
error:
|
|
2410
|
-
onReplace:
|
|
2411
|
-
onClose:
|
|
2407
|
+
m(Rn, {
|
|
2408
|
+
visible: k(B).showReplaceWarning.value,
|
|
2409
|
+
item: k(B).pendingReplaceItem.value,
|
|
2410
|
+
"usage-info": k(B).replaceUsageInfo.value,
|
|
2411
|
+
"is-replacing": k(B).isReplacing.value,
|
|
2412
|
+
error: k(B).replaceError.value,
|
|
2413
|
+
onReplace: k(W).handleReplaceFile,
|
|
2414
|
+
onClose: k(B).cancelReplace
|
|
2412
2415
|
}, null, 8, [
|
|
2413
2416
|
"visible",
|
|
2414
2417
|
"item",
|
|
@@ -2426,7 +2429,7 @@ var Jn = ["data-tpl-theme"], Yn = {
|
|
|
2426
2429
|
"leave-from-class": "tpl:opacity-100",
|
|
2427
2430
|
"leave-to-class": "tpl:opacity-0"
|
|
2428
2431
|
}, {
|
|
2429
|
-
default:
|
|
2432
|
+
default: M(() => [k(B).showDeleteWarning.value ? (S(), d("div", {
|
|
2430
2433
|
key: 0,
|
|
2431
2434
|
class: "tpl:absolute tpl:inset-0 tpl:z-10 tpl:flex tpl:items-center tpl:justify-center tpl:rounded-[var(--tpl-radius-lg)]",
|
|
2432
2435
|
style: {
|
|
@@ -2434,85 +2437,85 @@ var Jn = ["data-tpl-theme"], Yn = {
|
|
|
2434
2437
|
"backdrop-filter": "blur(8px)",
|
|
2435
2438
|
"-webkit-backdrop-filter": "blur(8px)"
|
|
2436
2439
|
},
|
|
2437
|
-
onClick: n[12] ||=
|
|
2438
|
-
}, [f("div",
|
|
2439
|
-
f("h3",
|
|
2440
|
+
onClick: n[12] ||= F((...e) => k(B).cancelDelete && k(B).cancelDelete(...e), ["self"])
|
|
2441
|
+
}, [f("div", Er, [
|
|
2442
|
+
f("h3", Dr, D(k(c).mediaLibrary.deleteWarningTitle), 1),
|
|
2440
2443
|
f("p", {
|
|
2441
|
-
class: y(["tpl:text-xs",
|
|
2444
|
+
class: y(["tpl:text-xs", k(W).hasUsedFiles.value ? "tpl:mb-2" : "tpl:mb-4"]),
|
|
2442
2445
|
style: { color: "var(--tpl-text-muted)" }
|
|
2443
|
-
}, D(
|
|
2444
|
-
|
|
2445
|
-
|
|
2446
|
+
}, D(k(c).mediaLibrary.deleteWarningMessage), 3),
|
|
2447
|
+
k(W).hasUsedFiles.value ? (S(), d("p", Or, D(k(c).mediaLibrary.deleteWarningUsageNote), 1)) : u("", !0),
|
|
2448
|
+
k(W).hasUsedFiles.value ? (S(), d("div", kr, [(S(!0), d(i, null, T(k(B).deleteUsageInfo.value, (e, t) => (S(), d("div", {
|
|
2446
2449
|
key: t,
|
|
2447
2450
|
class: "tpl:text-xs",
|
|
2448
2451
|
style: { color: "var(--tpl-text)" }
|
|
2449
|
-
}, [e.template_count > 0 ? (S(), d(i, { key: 0 }, [f("span",
|
|
2450
|
-
f("div",
|
|
2452
|
+
}, [e.template_count > 0 ? (S(), d(i, { key: 0 }, [f("span", Ar, D(k(W).displayItems.value.find((e) => e.id === t)?.filename || t), 1), f("span", jr, " - " + D(k(c).mediaLibrary.usedInTemplates.replace("{count}", e.template_count.toString())), 1)], 64)) : u("", !0)]))), 128))])) : u("", !0),
|
|
2453
|
+
f("div", Mr, [f("button", {
|
|
2451
2454
|
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",
|
|
2452
2455
|
style: {
|
|
2453
2456
|
"border-color": "var(--tpl-border)",
|
|
2454
2457
|
color: "var(--tpl-text)",
|
|
2455
2458
|
"background-color": "var(--tpl-bg)"
|
|
2456
2459
|
},
|
|
2457
|
-
onClick: n[10] ||= (...e) =>
|
|
2458
|
-
}, D(
|
|
2460
|
+
onClick: n[10] ||= (...e) => k(B).cancelDelete && k(B).cancelDelete(...e)
|
|
2461
|
+
}, D(k(c).mediaLibrary.cancel), 1), f("button", {
|
|
2459
2462
|
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",
|
|
2460
2463
|
style: {
|
|
2461
2464
|
"border-color": "var(--tpl-danger)",
|
|
2462
2465
|
color: "var(--tpl-danger)",
|
|
2463
2466
|
"background-color": "var(--tpl-danger-light)"
|
|
2464
2467
|
},
|
|
2465
|
-
onClick: n[11] ||= (...e) =>
|
|
2466
|
-
}, D(
|
|
2468
|
+
onClick: n[11] ||= (...e) => k(B).confirmDelete && k(B).confirmDelete(...e)
|
|
2469
|
+
}, D(k(W).hasUsedFiles.value ? k(c).mediaLibrary.deleteAnyway : k(c).mediaLibrary.confirmDelete), 1)])
|
|
2467
2470
|
])])) : u("", !0)]),
|
|
2468
2471
|
_: 1
|
|
2469
2472
|
}),
|
|
2470
|
-
f("div",
|
|
2473
|
+
f("div", Nr, [f("div", Pr, [k(B).previewItem.value ? (S(), l(Cn, {
|
|
2471
2474
|
key: 0,
|
|
2472
|
-
"selected-conversion":
|
|
2473
|
-
"onUpdate:selectedConversion": n[13] ||= (e) =>
|
|
2474
|
-
item:
|
|
2475
|
-
folders:
|
|
2475
|
+
"selected-conversion": k(W).selectedConversion.value,
|
|
2476
|
+
"onUpdate:selectedConversion": n[13] ||= (e) => k(W).selectedConversion.value = e,
|
|
2477
|
+
item: k(B).previewItem.value,
|
|
2478
|
+
folders: k(B).folders.value
|
|
2476
2479
|
}, null, 8, [
|
|
2477
2480
|
"selected-conversion",
|
|
2478
2481
|
"item",
|
|
2479
2482
|
"folders"
|
|
2480
|
-
])) : u("", !0)]), f("div",
|
|
2483
|
+
])) : u("", !0)]), f("div", Fr, [k(B).selectedItems.value.size > 0 ? (S(), d("div", Ir, [k(B).previewItem.value ? (S(), d("button", {
|
|
2481
2484
|
key: 0,
|
|
2482
2485
|
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",
|
|
2483
2486
|
style: b({
|
|
2484
|
-
borderColor:
|
|
2485
|
-
color:
|
|
2487
|
+
borderColor: k(W).copied.value ? "var(--tpl-success)" : "var(--tpl-border)",
|
|
2488
|
+
color: k(W).copied.value ? "var(--tpl-success)" : "var(--tpl-text)",
|
|
2486
2489
|
backgroundColor: "var(--tpl-bg)"
|
|
2487
2490
|
}),
|
|
2488
|
-
onClick: n[14] ||= (e) =>
|
|
2489
|
-
}, [
|
|
2491
|
+
onClick: n[14] ||= (e) => k(W).copy(k(W).selectedUrl.value)
|
|
2492
|
+
}, [k(W).copied.value ? (S(), l(k(I), {
|
|
2490
2493
|
key: 1,
|
|
2491
2494
|
size: 12,
|
|
2492
2495
|
"stroke-width": 2
|
|
2493
|
-
})) : (S(), l(
|
|
2496
|
+
})) : (S(), l(k(R), {
|
|
2494
2497
|
key: 0,
|
|
2495
2498
|
size: 12,
|
|
2496
2499
|
"stroke-width": 2
|
|
2497
|
-
})), p(" " + D(
|
|
2500
|
+
})), p(" " + D(k(W).copied.value ? k(c).mediaLibrary.copied : k(c).mediaLibrary.copyUrl), 1)], 4)) : u("", !0), E.value ? (S(), d("div", Lr, [f("button", {
|
|
2498
2501
|
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",
|
|
2499
2502
|
style: {
|
|
2500
2503
|
"border-color": "var(--tpl-border)",
|
|
2501
2504
|
color: "var(--tpl-text)",
|
|
2502
2505
|
"background-color": "var(--tpl-bg)"
|
|
2503
2506
|
},
|
|
2504
|
-
onClick: n[15] ||= (e) =>
|
|
2505
|
-
}, D(
|
|
2507
|
+
onClick: n[15] ||= (e) => k(W).showMovePicker.value = !k(W).showMovePicker.value
|
|
2508
|
+
}, D(k(c).mediaLibrary.moveSelected), 1), k(W).showMovePicker.value ? (S(), l(fn, {
|
|
2506
2509
|
key: 0,
|
|
2507
|
-
folders:
|
|
2508
|
-
"current-folder-id":
|
|
2509
|
-
onSelect:
|
|
2510
|
-
onClose: n[16] ||= (e) =>
|
|
2510
|
+
folders: k(B).folders.value,
|
|
2511
|
+
"current-folder-id": k(B).currentFolderId.value,
|
|
2512
|
+
onSelect: k(W).handleMoveToFolder,
|
|
2513
|
+
onClose: n[16] ||= (e) => k(W).showMovePicker.value = !1
|
|
2511
2514
|
}, null, 8, [
|
|
2512
2515
|
"folders",
|
|
2513
2516
|
"current-folder-id",
|
|
2514
2517
|
"onSelect"
|
|
2515
|
-
])) : u("", !0)])) : u("", !0)])) : u("", !0), f("div",
|
|
2518
|
+
])) : u("", !0)])) : u("", !0)])) : u("", !0), f("div", Rr, [k(B).selectedItems.value.size > 0 ? (S(), d("button", {
|
|
2516
2519
|
key: 0,
|
|
2517
2520
|
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",
|
|
2518
2521
|
style: {
|
|
@@ -2520,24 +2523,24 @@ var Jn = ["data-tpl-theme"], Yn = {
|
|
|
2520
2523
|
color: "var(--tpl-danger)",
|
|
2521
2524
|
"background-color": "var(--tpl-danger-light)"
|
|
2522
2525
|
},
|
|
2523
|
-
onClick: n[17] ||= (...e) =>
|
|
2524
|
-
}, D(
|
|
2526
|
+
onClick: n[17] ||= (...e) => k(W).handleDeleteClick && k(W).handleDeleteClick(...e)
|
|
2527
|
+
}, D(k(c).mediaLibrary.deleteSelected), 1)) : u("", !0), f("button", {
|
|
2525
2528
|
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",
|
|
2526
2529
|
style: {
|
|
2527
2530
|
"background-color": "var(--tpl-primary)",
|
|
2528
2531
|
color: "var(--tpl-bg)"
|
|
2529
2532
|
},
|
|
2530
|
-
disabled: !
|
|
2531
|
-
onClick:
|
|
2532
|
-
}, D(e.accept?.length ?
|
|
2533
|
-
])], 8,
|
|
2533
|
+
disabled: !q(),
|
|
2534
|
+
onClick: J
|
|
2535
|
+
}, D(e.accept?.length ? k(c).mediaLibrary.selectImage : k(c).mediaLibrary.selectFile), 9, zr)])])])
|
|
2536
|
+
])], 8, Xn)) : u("", !0)]),
|
|
2534
2537
|
_: 1
|
|
2535
|
-
})]));
|
|
2538
|
+
})], 8, ["to"]));
|
|
2536
2539
|
}
|
|
2537
2540
|
});
|
|
2538
2541
|
//#endregion
|
|
2539
2542
|
//#region src/composables/useMediaPicker.ts
|
|
2540
|
-
function
|
|
2543
|
+
function Vr() {
|
|
2541
2544
|
let e = _("onRequestMedia"), t = _("planConfig"), n = w(!1), r = s(() => !!e && t.hasFeature("pluggable_media"));
|
|
2542
2545
|
async function i(t) {
|
|
2543
2546
|
if (!e) return null;
|
|
@@ -2556,7 +2559,7 @@ function zr() {
|
|
|
2556
2559
|
}
|
|
2557
2560
|
//#endregion
|
|
2558
2561
|
//#region src/standalone/MediaLibrary.vue?vue&type=script&setup=true&lang.ts
|
|
2559
|
-
var
|
|
2562
|
+
var Hr = {
|
|
2560
2563
|
class: "tpl tpl:flex tpl:flex-col tpl:overflow-hidden tpl:rounded-[var(--tpl-radius-lg)]",
|
|
2561
2564
|
style: {
|
|
2562
2565
|
width: "100%",
|
|
@@ -2564,62 +2567,62 @@ var Br = {
|
|
|
2564
2567
|
"background-color": "var(--tpl-bg-elevated)",
|
|
2565
2568
|
border: "1px solid var(--tpl-border)"
|
|
2566
2569
|
}
|
|
2567
|
-
},
|
|
2570
|
+
}, Ur = {
|
|
2568
2571
|
class: "tpl:flex tpl:shrink-0 tpl:items-center tpl:justify-between tpl:border-b tpl:px-5 tpl:py-3.5",
|
|
2569
2572
|
style: { "border-color": "var(--tpl-border)" }
|
|
2570
|
-
},
|
|
2573
|
+
}, Wr = {
|
|
2571
2574
|
class: "tpl:text-sm tpl:font-semibold",
|
|
2572
2575
|
style: { color: "var(--tpl-text)" }
|
|
2573
|
-
},
|
|
2576
|
+
}, Gr = { class: "tpl:flex tpl:items-center tpl:gap-3" }, Kr = { class: "tpl:relative" }, qr = ["value", "placeholder"], Jr = { class: "tpl:flex tpl:min-h-0 tpl:flex-1 tpl:overflow-hidden" }, Yr = {
|
|
2574
2577
|
key: 0,
|
|
2575
2578
|
class: "tpl:flex tpl:w-48 tpl:shrink-0 tpl:flex-col tpl:border-r",
|
|
2576
2579
|
style: {
|
|
2577
2580
|
"border-color": "var(--tpl-border)",
|
|
2578
2581
|
"background-color": "var(--tpl-bg)"
|
|
2579
2582
|
}
|
|
2580
|
-
},
|
|
2583
|
+
}, Xr = { class: "tpl:flex tpl:min-w-0 tpl:flex-1 tpl:flex-col" }, Zr = {
|
|
2581
2584
|
class: "tpl:flex tpl:shrink-0 tpl:items-center tpl:justify-between tpl:border-b tpl:px-4 tpl:py-2.5",
|
|
2582
2585
|
style: { "border-color": "var(--tpl-border)" }
|
|
2583
|
-
},
|
|
2586
|
+
}, Qr = { class: "tpl:flex tpl:items-center tpl:gap-2" }, $r = ["title"], ei = {
|
|
2584
2587
|
key: 1,
|
|
2585
2588
|
class: "tpl:text-xs tpl:font-medium",
|
|
2586
2589
|
style: { color: "var(--tpl-text)" }
|
|
2587
|
-
},
|
|
2590
|
+
}, ti = {
|
|
2588
2591
|
class: "tpl:flex tpl:rounded-md tpl:p-0.5",
|
|
2589
2592
|
style: {
|
|
2590
2593
|
border: "1px solid var(--tpl-border)",
|
|
2591
2594
|
"background-color": "var(--tpl-bg)"
|
|
2592
2595
|
}
|
|
2593
|
-
},
|
|
2596
|
+
}, ni = ["title"], ri = ["title"], ii = { class: "tpl:flex tpl:items-center tpl:gap-2" }, ai = ["value"], oi = { value: "" }, si = ["value"], ci = ["value"], li = { value: "newest" }, ui = { value: "oldest" }, di = { value: "name_asc" }, fi = { value: "name_desc" }, pi = { value: "size_asc" }, mi = { value: "size_desc" }, hi = { class: "tpl:min-h-0 tpl:flex-1 tpl:overflow-y-auto" }, gi = {
|
|
2594
2597
|
key: 0,
|
|
2595
2598
|
class: "tpl:px-4 tpl:pt-3"
|
|
2596
|
-
},
|
|
2599
|
+
}, _i = {
|
|
2597
2600
|
class: "tpl-scale-in tpl:mx-4 tpl:w-full tpl:max-w-sm tpl:rounded-[var(--tpl-radius-lg)] tpl:p-5",
|
|
2598
2601
|
style: {
|
|
2599
2602
|
"background-color": "var(--tpl-bg-elevated)",
|
|
2600
2603
|
"box-shadow": "var(--tpl-shadow-xl)"
|
|
2601
2604
|
}
|
|
2602
|
-
},
|
|
2605
|
+
}, vi = {
|
|
2603
2606
|
class: "tpl:mb-2 tpl:text-sm tpl:font-semibold",
|
|
2604
2607
|
style: { color: "var(--tpl-text)" }
|
|
2605
|
-
},
|
|
2608
|
+
}, yi = {
|
|
2606
2609
|
key: 0,
|
|
2607
2610
|
class: "tpl:mb-4 tpl:text-xs",
|
|
2608
2611
|
style: { color: "var(--tpl-text-muted)" }
|
|
2609
|
-
},
|
|
2612
|
+
}, bi = {
|
|
2610
2613
|
key: 1,
|
|
2611
2614
|
class: "tpl:mb-4 tpl:max-h-32 tpl:overflow-y-auto tpl:rounded tpl:border tpl:p-2",
|
|
2612
2615
|
style: { "border-color": "var(--tpl-border)" }
|
|
2613
|
-
},
|
|
2616
|
+
}, xi = { class: "tpl:font-medium" }, Si = { style: { color: "var(--tpl-text-muted)" } }, Ci = { class: "tpl:flex tpl:justify-end tpl:gap-2" }, wi = {
|
|
2614
2617
|
class: "tpl:flex tpl:shrink-0 tpl:items-center tpl:justify-between tpl:border-t tpl:px-5 tpl:py-3",
|
|
2615
2618
|
style: { "border-color": "var(--tpl-border)" }
|
|
2616
|
-
},
|
|
2619
|
+
}, Ti = { class: "tpl:flex tpl:min-w-0 tpl:flex-1 tpl:items-center tpl:gap-3" }, Ei = { class: "tpl:flex tpl:items-center tpl:gap-5" }, Di = {
|
|
2617
2620
|
key: 0,
|
|
2618
2621
|
class: "tpl:flex tpl:items-center tpl:gap-2"
|
|
2619
|
-
},
|
|
2622
|
+
}, Oi = {
|
|
2620
2623
|
key: 1,
|
|
2621
2624
|
class: "tpl:relative"
|
|
2622
|
-
},
|
|
2625
|
+
}, ki = { class: "tpl:flex tpl:items-center tpl:gap-2" }, Ai = ["disabled"], ji = /* @__PURE__ */ h({
|
|
2623
2626
|
__name: "MediaLibrary",
|
|
2624
2627
|
props: {
|
|
2625
2628
|
authManager: {},
|
|
@@ -2639,11 +2642,11 @@ var Br = {
|
|
|
2639
2642
|
features: s(() => n.planConfig.features),
|
|
2640
2643
|
fetchConfig: async () => {}
|
|
2641
2644
|
});
|
|
2642
|
-
let c = s(() => n.planConfig.features.media_folders ?? !1), h = s(() => n.planConfig.features.import_from_url ?? !1), g = s(() => n.planConfig.storage.used_bytes ?? 0), _ = s(() => n.planConfig.storage.limit_bytes ?? 0), { availableCategories: v } = Q(), E =
|
|
2645
|
+
let c = s(() => n.planConfig.features.media_folders ?? !1), h = s(() => n.planConfig.features.import_from_url ?? !1), g = s(() => n.planConfig.storage.used_bytes ?? 0), _ = s(() => n.planConfig.storage.limit_bytes ?? 0), { availableCategories: v } = Q(), E = fe({
|
|
2643
2646
|
projectId: n.projectId,
|
|
2644
2647
|
authManager: n.authManager,
|
|
2645
2648
|
onError: n.onError
|
|
2646
|
-
}),
|
|
2649
|
+
}), O = Yn({
|
|
2647
2650
|
library: E,
|
|
2648
2651
|
canUseMediaFolders: c,
|
|
2649
2652
|
translations: a
|
|
@@ -2652,19 +2655,19 @@ var Br = {
|
|
|
2652
2655
|
if (!E.previewItem.value) return;
|
|
2653
2656
|
let e = E.previewItem.value, t = {
|
|
2654
2657
|
...e,
|
|
2655
|
-
url:
|
|
2658
|
+
url: O.selectedUrl.value || e.url
|
|
2656
2659
|
};
|
|
2657
2660
|
n.onSelect?.(t);
|
|
2658
2661
|
}
|
|
2659
2662
|
return x(() => {
|
|
2660
2663
|
E.loadItems(), E.loadFrequentlyUsed(), r("ready");
|
|
2661
|
-
}), (t, n) => (S(), d("div",
|
|
2662
|
-
f("div",
|
|
2664
|
+
}), (t, n) => (S(), d("div", Hr, [
|
|
2665
|
+
f("div", Ur, [f("h2", Wr, D(a.value.mediaLibrary.title), 1), f("div", Gr, [m(Jn, {
|
|
2663
2666
|
"used-bytes": g.value,
|
|
2664
2667
|
"limit-bytes": _.value,
|
|
2665
2668
|
size: 22
|
|
2666
|
-
}, null, 8, ["used-bytes", "limit-bytes"]), f("div",
|
|
2667
|
-
value: O
|
|
2669
|
+
}, null, 8, ["used-bytes", "limit-bytes"]), f("div", Kr, [f("input", {
|
|
2670
|
+
value: k(O).searchInput.value,
|
|
2668
2671
|
type: "text",
|
|
2669
2672
|
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)]",
|
|
2670
2673
|
style: {
|
|
@@ -2673,14 +2676,14 @@ var Br = {
|
|
|
2673
2676
|
color: "var(--tpl-text)"
|
|
2674
2677
|
},
|
|
2675
2678
|
placeholder: a.value.mediaLibrary.searchPlaceholder,
|
|
2676
|
-
onInput: n[0] ||= (e) => O
|
|
2677
|
-
}, null, 40,
|
|
2679
|
+
onInput: n[0] ||= (e) => k(O).handleSearchInput(e.target.value)
|
|
2680
|
+
}, null, 40, qr), m(k(Y), {
|
|
2678
2681
|
class: "tpl:absolute tpl:top-1/2 tpl:left-2.5 tpl:-translate-y-1/2",
|
|
2679
2682
|
size: 13,
|
|
2680
2683
|
"stroke-width": 2,
|
|
2681
2684
|
style: { color: "var(--tpl-text-dim)" }
|
|
2682
2685
|
})])])]),
|
|
2683
|
-
f("div",
|
|
2686
|
+
f("div", Jr, [m(o, {
|
|
2684
2687
|
"enter-active-class": "tpl:transition-all tpl:duration-200 tpl:ease-out",
|
|
2685
2688
|
"enter-from-class": "tpl:-ml-48 tpl:opacity-0",
|
|
2686
2689
|
"enter-to-class": "tpl:ml-0 tpl:opacity-100",
|
|
@@ -2688,16 +2691,16 @@ var Br = {
|
|
|
2688
2691
|
"leave-from-class": "tpl:ml-0 tpl:opacity-100",
|
|
2689
2692
|
"leave-to-class": "tpl:-ml-48 tpl:opacity-0"
|
|
2690
2693
|
}, {
|
|
2691
|
-
default:
|
|
2692
|
-
folders:
|
|
2693
|
-
"current-folder-id":
|
|
2694
|
-
"view-mode":
|
|
2695
|
-
"has-frequently-used": O
|
|
2696
|
-
onNavigate:
|
|
2697
|
-
onCreateFolder: O
|
|
2698
|
-
onRenameFolder: O
|
|
2699
|
-
onDeleteFolder: O
|
|
2700
|
-
onShowFrequentlyUsed:
|
|
2694
|
+
default: M(() => [c.value && k(O).showSidebar.value ? (S(), d("div", Yr, [m(_t, {
|
|
2695
|
+
folders: k(E).folders.value,
|
|
2696
|
+
"current-folder-id": k(E).currentFolderId.value,
|
|
2697
|
+
"view-mode": k(E).viewMode.value,
|
|
2698
|
+
"has-frequently-used": k(O).hasFrequentlyUsed.value,
|
|
2699
|
+
onNavigate: k(E).navigateToFolder,
|
|
2700
|
+
onCreateFolder: k(O).handleCreateFolder,
|
|
2701
|
+
onRenameFolder: k(O).handleRenameFolder,
|
|
2702
|
+
onDeleteFolder: k(O).handleDeleteFolder,
|
|
2703
|
+
onShowFrequentlyUsed: k(E).showFrequentlyUsed
|
|
2701
2704
|
}, null, 8, [
|
|
2702
2705
|
"folders",
|
|
2703
2706
|
"current-folder-id",
|
|
@@ -2710,55 +2713,55 @@ var Br = {
|
|
|
2710
2713
|
"onShowFrequentlyUsed"
|
|
2711
2714
|
])])) : u("", !0)]),
|
|
2712
2715
|
_: 1
|
|
2713
|
-
}), f("div",
|
|
2716
|
+
}), f("div", Xr, [f("div", Zr, [f("div", Qr, [
|
|
2714
2717
|
c.value ? (S(), d("button", {
|
|
2715
2718
|
key: 0,
|
|
2716
2719
|
class: "tpl:flex tpl:size-7 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded-md tpl:transition-all tpl:duration-150",
|
|
2717
2720
|
style: b({
|
|
2718
|
-
color: O
|
|
2719
|
-
backgroundColor: O
|
|
2720
|
-
border: O
|
|
2721
|
+
color: k(O).showSidebar.value ? "var(--tpl-primary)" : "var(--tpl-text-muted)",
|
|
2722
|
+
backgroundColor: k(O).showSidebar.value ? "var(--tpl-bg)" : "transparent",
|
|
2723
|
+
border: k(O).showSidebar.value ? "1px solid var(--tpl-border)" : "1px solid transparent"
|
|
2721
2724
|
}),
|
|
2722
|
-
title: O
|
|
2723
|
-
onClick: n[1] ||= (e) => O
|
|
2724
|
-
}, [m(
|
|
2725
|
+
title: k(O).showSidebar.value ? a.value.mediaLibrary.hideFolders : a.value.mediaLibrary.showFolders,
|
|
2726
|
+
onClick: n[1] ||= (e) => k(O).showSidebar.value = !k(O).showSidebar.value
|
|
2727
|
+
}, [m(k(G), {
|
|
2725
2728
|
size: 16,
|
|
2726
2729
|
"stroke-width": 2
|
|
2727
|
-
})], 12,
|
|
2728
|
-
|
|
2730
|
+
})], 12, $r)) : u("", !0),
|
|
2731
|
+
k(E).viewMode.value === "frequently-used" ? (S(), d("span", ei, D(a.value.mediaLibrary.frequentlyUsed), 1)) : (S(), l(ge, {
|
|
2729
2732
|
key: 2,
|
|
2730
|
-
folders:
|
|
2731
|
-
"current-folder-id":
|
|
2732
|
-
onNavigate:
|
|
2733
|
+
folders: k(E).folders.value,
|
|
2734
|
+
"current-folder-id": k(E).currentFolderId.value,
|
|
2735
|
+
onNavigate: k(E).navigateToFolder
|
|
2733
2736
|
}, null, 8, [
|
|
2734
2737
|
"folders",
|
|
2735
2738
|
"current-folder-id",
|
|
2736
2739
|
"onNavigate"
|
|
2737
2740
|
])),
|
|
2738
|
-
f("div",
|
|
2741
|
+
f("div", ti, [f("button", {
|
|
2739
2742
|
class: "tpl:flex tpl:size-6 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded tpl:transition-all tpl:duration-150",
|
|
2740
2743
|
style: b({
|
|
2741
|
-
color: O
|
|
2742
|
-
backgroundColor: O
|
|
2744
|
+
color: k(O).layoutMode.value === "grid" ? "var(--tpl-primary)" : "var(--tpl-text-muted)",
|
|
2745
|
+
backgroundColor: k(O).layoutMode.value === "grid" ? "var(--tpl-bg-elevated)" : "transparent"
|
|
2743
2746
|
}),
|
|
2744
2747
|
title: a.value.mediaLibrary.viewGrid,
|
|
2745
|
-
onClick: n[2] ||= (e) => O
|
|
2746
|
-
}, [m(
|
|
2748
|
+
onClick: n[2] ||= (e) => k(O).layoutMode.value = "grid"
|
|
2749
|
+
}, [m(k(V), {
|
|
2747
2750
|
size: 14,
|
|
2748
2751
|
"stroke-width": 2
|
|
2749
|
-
})], 12,
|
|
2752
|
+
})], 12, ni), f("button", {
|
|
2750
2753
|
class: "tpl:flex tpl:size-6 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded tpl:transition-all tpl:duration-150",
|
|
2751
2754
|
style: b({
|
|
2752
|
-
color: O
|
|
2753
|
-
backgroundColor: O
|
|
2755
|
+
color: k(O).layoutMode.value === "list" ? "var(--tpl-primary)" : "var(--tpl-text-muted)",
|
|
2756
|
+
backgroundColor: k(O).layoutMode.value === "list" ? "var(--tpl-bg-elevated)" : "transparent"
|
|
2754
2757
|
}),
|
|
2755
2758
|
title: a.value.mediaLibrary.viewList,
|
|
2756
|
-
onClick: n[3] ||= (e) => O
|
|
2757
|
-
}, [m(
|
|
2759
|
+
onClick: n[3] ||= (e) => k(O).layoutMode.value = "list"
|
|
2760
|
+
}, [m(k(U), {
|
|
2758
2761
|
size: 14,
|
|
2759
2762
|
"stroke-width": 2
|
|
2760
|
-
})], 12,
|
|
2761
|
-
]), f("div",
|
|
2763
|
+
})], 12, ri)])
|
|
2764
|
+
]), f("div", ii, [k(v).length > 1 ? (S(), d("select", {
|
|
2762
2765
|
key: 0,
|
|
2763
2766
|
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",
|
|
2764
2767
|
style: {
|
|
@@ -2766,31 +2769,31 @@ var Br = {
|
|
|
2766
2769
|
"background-color": "var(--tpl-bg)",
|
|
2767
2770
|
color: "var(--tpl-text)"
|
|
2768
2771
|
},
|
|
2769
|
-
value:
|
|
2770
|
-
onChange: n[4] ||= (e) =>
|
|
2771
|
-
}, [f("option",
|
|
2772
|
+
value: k(E).categoryFilter.value ?? "",
|
|
2773
|
+
onChange: n[4] ||= (e) => k(E).filterByCategory(e.target.value || null)
|
|
2774
|
+
}, [f("option", oi, D(a.value.mediaLibrary.filterAll), 1), (S(!0), d(i, null, T(k(v), (e) => (S(), d("option", {
|
|
2772
2775
|
key: e,
|
|
2773
2776
|
value: e
|
|
2774
|
-
}, D(O
|
|
2777
|
+
}, D(k(O).getCategoryLabel(e)), 9, si))), 128))], 40, ai)) : u("", !0), f("select", {
|
|
2775
2778
|
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
2779
|
style: {
|
|
2777
2780
|
"border-color": "var(--tpl-border)",
|
|
2778
2781
|
"background-color": "var(--tpl-bg)",
|
|
2779
2782
|
color: "var(--tpl-text)"
|
|
2780
2783
|
},
|
|
2781
|
-
value:
|
|
2782
|
-
onChange: n[5] ||= (e) =>
|
|
2784
|
+
value: k(E).sortOption.value,
|
|
2785
|
+
onChange: n[5] ||= (e) => k(E).sortBy(e.target.value)
|
|
2783
2786
|
}, [
|
|
2784
|
-
f("option",
|
|
2785
|
-
f("option",
|
|
2786
|
-
f("option",
|
|
2787
|
-
f("option",
|
|
2788
|
-
f("option",
|
|
2789
|
-
f("option",
|
|
2790
|
-
], 40,
|
|
2791
|
-
"is-uploading":
|
|
2792
|
-
"upload-progress":
|
|
2793
|
-
onUpload: O
|
|
2787
|
+
f("option", li, D(a.value.mediaLibrary.sortNewest), 1),
|
|
2788
|
+
f("option", ui, D(a.value.mediaLibrary.sortOldest), 1),
|
|
2789
|
+
f("option", di, D(a.value.mediaLibrary.sortNameAsc), 1),
|
|
2790
|
+
f("option", fi, D(a.value.mediaLibrary.sortNameDesc), 1),
|
|
2791
|
+
f("option", pi, D(a.value.mediaLibrary.sortSizeAsc), 1),
|
|
2792
|
+
f("option", mi, D(a.value.mediaLibrary.sortSizeDesc), 1)
|
|
2793
|
+
], 40, ci)])]), f("div", hi, [k(E).viewMode.value === "files" ? (S(), d("div", gi, [m(Un, {
|
|
2794
|
+
"is-uploading": k(E).isUploading.value,
|
|
2795
|
+
"upload-progress": k(E).uploadProgress.value,
|
|
2796
|
+
onUpload: k(O).handleUpload
|
|
2794
2797
|
}, null, 8, [
|
|
2795
2798
|
"is-uploading",
|
|
2796
2799
|
"upload-progress",
|
|
@@ -2803,21 +2806,21 @@ var Br = {
|
|
|
2803
2806
|
color: "var(--tpl-text-muted)",
|
|
2804
2807
|
"background-color": "var(--tpl-bg)"
|
|
2805
2808
|
},
|
|
2806
|
-
onClick: n[6] ||= (e) => O
|
|
2807
|
-
}, [m(
|
|
2809
|
+
onClick: n[6] ||= (e) => k(O).showImportUrlModal.value = !0
|
|
2810
|
+
}, [m(k(H), {
|
|
2808
2811
|
size: 14,
|
|
2809
2812
|
"stroke-width": 2
|
|
2810
|
-
}), p(" " + D(a.value.mediaLibrary.importFromUrl), 1)])) : u("", !0)])) : u("", !0), m(
|
|
2811
|
-
items: O
|
|
2812
|
-
"selected-ids":
|
|
2813
|
-
"is-loading":
|
|
2814
|
-
"has-more":
|
|
2815
|
-
layout: O
|
|
2816
|
-
onSelect: O
|
|
2817
|
-
onToggle:
|
|
2818
|
-
onLoadMore:
|
|
2819
|
-
onEdit: O
|
|
2820
|
-
onReplace: O
|
|
2813
|
+
}), p(" " + D(a.value.mediaLibrary.importFromUrl), 1)])) : u("", !0)])) : u("", !0), m(Jt, {
|
|
2814
|
+
items: k(O).displayItems.value,
|
|
2815
|
+
"selected-ids": k(E).selectedItems.value,
|
|
2816
|
+
"is-loading": k(E).isLoading.value,
|
|
2817
|
+
"has-more": k(E).viewMode.value === "files" && k(E).hasMore.value,
|
|
2818
|
+
layout: k(O).layoutMode.value,
|
|
2819
|
+
onSelect: k(O).handleSelect,
|
|
2820
|
+
onToggle: k(E).toggleSelection,
|
|
2821
|
+
onLoadMore: k(E).loadMore,
|
|
2822
|
+
onEdit: k(O).handleEditItem,
|
|
2823
|
+
onReplace: k(O).handleReplaceItem
|
|
2821
2824
|
}, null, 8, [
|
|
2822
2825
|
"items",
|
|
2823
2826
|
"selected-ids",
|
|
@@ -2830,36 +2833,36 @@ var Br = {
|
|
|
2830
2833
|
"onEdit",
|
|
2831
2834
|
"onReplace"
|
|
2832
2835
|
])])])]),
|
|
2833
|
-
m(
|
|
2834
|
-
visible: O
|
|
2835
|
-
"is-importing":
|
|
2836
|
-
error:
|
|
2837
|
-
onImport: O
|
|
2838
|
-
onClose: n[7] ||= (e) => O
|
|
2836
|
+
m(sn, {
|
|
2837
|
+
visible: k(O).showImportUrlModal.value,
|
|
2838
|
+
"is-importing": k(E).isImportingFromUrl.value,
|
|
2839
|
+
error: k(E).importFromUrlError.value,
|
|
2840
|
+
onImport: k(O).handleImportFromUrl,
|
|
2841
|
+
onClose: n[7] ||= (e) => k(O).showImportUrlModal.value = !1
|
|
2839
2842
|
}, null, 8, [
|
|
2840
2843
|
"visible",
|
|
2841
2844
|
"is-importing",
|
|
2842
2845
|
"error",
|
|
2843
2846
|
"onImport"
|
|
2844
2847
|
]),
|
|
2845
|
-
m(
|
|
2846
|
-
visible: !!O
|
|
2847
|
-
item: O
|
|
2848
|
-
onSave: O
|
|
2849
|
-
onClose: n[8] ||= (e) => O
|
|
2848
|
+
m(it, {
|
|
2849
|
+
visible: !!k(O).editingItem.value,
|
|
2850
|
+
item: k(O).editingItem.value,
|
|
2851
|
+
onSave: k(O).handleEditSave,
|
|
2852
|
+
onClose: n[8] ||= (e) => k(O).editingItem.value = null
|
|
2850
2853
|
}, null, 8, [
|
|
2851
2854
|
"visible",
|
|
2852
2855
|
"item",
|
|
2853
2856
|
"onSave"
|
|
2854
2857
|
]),
|
|
2855
|
-
m(
|
|
2856
|
-
visible:
|
|
2857
|
-
item:
|
|
2858
|
-
"usage-info":
|
|
2859
|
-
"is-replacing":
|
|
2860
|
-
error:
|
|
2861
|
-
onReplace: O
|
|
2862
|
-
onClose:
|
|
2858
|
+
m(Rn, {
|
|
2859
|
+
visible: k(E).showReplaceWarning.value,
|
|
2860
|
+
item: k(E).pendingReplaceItem.value,
|
|
2861
|
+
"usage-info": k(E).replaceUsageInfo.value,
|
|
2862
|
+
"is-replacing": k(E).isReplacing.value,
|
|
2863
|
+
error: k(E).replaceError.value,
|
|
2864
|
+
onReplace: k(O).handleReplaceFile,
|
|
2865
|
+
onClose: k(E).cancelReplace
|
|
2863
2866
|
}, null, 8, [
|
|
2864
2867
|
"visible",
|
|
2865
2868
|
"item",
|
|
@@ -2877,7 +2880,7 @@ var Br = {
|
|
|
2877
2880
|
"leave-from-class": "tpl:opacity-100",
|
|
2878
2881
|
"leave-to-class": "tpl:opacity-0"
|
|
2879
2882
|
}, {
|
|
2880
|
-
default:
|
|
2883
|
+
default: M(() => [k(E).showDeleteWarning.value ? (S(), d("div", {
|
|
2881
2884
|
key: 0,
|
|
2882
2885
|
class: "tpl:absolute tpl:inset-0 tpl:z-10 tpl:flex tpl:items-center tpl:justify-center tpl:rounded-[var(--tpl-radius-lg)]",
|
|
2883
2886
|
style: {
|
|
@@ -2885,27 +2888,27 @@ var Br = {
|
|
|
2885
2888
|
"backdrop-filter": "blur(8px)",
|
|
2886
2889
|
"-webkit-backdrop-filter": "blur(8px)"
|
|
2887
2890
|
},
|
|
2888
|
-
onClick: n[11] ||=
|
|
2889
|
-
}, [f("div",
|
|
2890
|
-
f("h3",
|
|
2891
|
+
onClick: n[11] ||= F((...e) => k(E).cancelDelete && k(E).cancelDelete(...e), ["self"])
|
|
2892
|
+
}, [f("div", _i, [
|
|
2893
|
+
f("h3", vi, D(a.value.mediaLibrary.deleteWarningTitle), 1),
|
|
2891
2894
|
f("p", {
|
|
2892
|
-
class: y(["tpl:text-xs", O
|
|
2895
|
+
class: y(["tpl:text-xs", k(O).hasUsedFiles.value ? "tpl:mb-2" : "tpl:mb-4"]),
|
|
2893
2896
|
style: { color: "var(--tpl-text-muted)" }
|
|
2894
2897
|
}, D(a.value.mediaLibrary.deleteWarningMessage), 3),
|
|
2895
|
-
O
|
|
2896
|
-
O
|
|
2898
|
+
k(O).hasUsedFiles.value ? (S(), d("p", yi, D(a.value.mediaLibrary.deleteWarningUsageNote), 1)) : u("", !0),
|
|
2899
|
+
k(O).hasUsedFiles.value ? (S(), d("div", bi, [(S(!0), d(i, null, T(k(E).deleteUsageInfo.value, (e, t) => (S(), d("div", {
|
|
2897
2900
|
key: t,
|
|
2898
2901
|
class: "tpl:text-xs",
|
|
2899
2902
|
style: { color: "var(--tpl-text)" }
|
|
2900
|
-
}, [e.template_count > 0 ? (S(), d(i, { key: 0 }, [f("span",
|
|
2901
|
-
f("div",
|
|
2903
|
+
}, [e.template_count > 0 ? (S(), d(i, { key: 0 }, [f("span", xi, D(k(O).displayItems.value.find((e) => e.id === t)?.filename || t), 1), f("span", Si, " - " + D(a.value.mediaLibrary.usedInTemplates.replace("{count}", e.template_count.toString())), 1)], 64)) : u("", !0)]))), 128))])) : u("", !0),
|
|
2904
|
+
f("div", Ci, [f("button", {
|
|
2902
2905
|
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",
|
|
2903
2906
|
style: {
|
|
2904
2907
|
"border-color": "var(--tpl-border)",
|
|
2905
2908
|
color: "var(--tpl-text)",
|
|
2906
2909
|
"background-color": "var(--tpl-bg)"
|
|
2907
2910
|
},
|
|
2908
|
-
onClick: n[9] ||= (...e) =>
|
|
2911
|
+
onClick: n[9] ||= (...e) => k(E).cancelDelete && k(E).cancelDelete(...e)
|
|
2909
2912
|
}, D(a.value.mediaLibrary.cancel), 1), f("button", {
|
|
2910
2913
|
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",
|
|
2911
2914
|
style: {
|
|
@@ -2913,57 +2916,57 @@ var Br = {
|
|
|
2913
2916
|
color: "var(--tpl-danger)",
|
|
2914
2917
|
"background-color": "var(--tpl-danger-light)"
|
|
2915
2918
|
},
|
|
2916
|
-
onClick: n[10] ||= (...e) =>
|
|
2917
|
-
}, D(O
|
|
2919
|
+
onClick: n[10] ||= (...e) => k(E).confirmDelete && k(E).confirmDelete(...e)
|
|
2920
|
+
}, D(k(O).hasUsedFiles.value ? a.value.mediaLibrary.deleteAnyway : a.value.mediaLibrary.confirmDelete), 1)])
|
|
2918
2921
|
])])) : u("", !0)]),
|
|
2919
2922
|
_: 1
|
|
2920
2923
|
}),
|
|
2921
|
-
f("div",
|
|
2924
|
+
f("div", wi, [f("div", Ti, [k(E).previewItem.value ? (S(), l(Cn, {
|
|
2922
2925
|
key: 0,
|
|
2923
|
-
"selected-conversion": O
|
|
2924
|
-
"onUpdate:selectedConversion": n[12] ||= (e) => O
|
|
2925
|
-
item:
|
|
2926
|
-
folders:
|
|
2926
|
+
"selected-conversion": k(O).selectedConversion.value,
|
|
2927
|
+
"onUpdate:selectedConversion": n[12] ||= (e) => k(O).selectedConversion.value = e,
|
|
2928
|
+
item: k(E).previewItem.value,
|
|
2929
|
+
folders: k(E).folders.value
|
|
2927
2930
|
}, null, 8, [
|
|
2928
2931
|
"selected-conversion",
|
|
2929
2932
|
"item",
|
|
2930
2933
|
"folders"
|
|
2931
|
-
])) : u("", !0)]), f("div",
|
|
2934
|
+
])) : u("", !0)]), f("div", Ei, [k(E).selectedItems.value.size > 0 ? (S(), d("div", Di, [k(E).previewItem.value ? (S(), d("button", {
|
|
2932
2935
|
key: 0,
|
|
2933
2936
|
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",
|
|
2934
2937
|
style: b({
|
|
2935
|
-
borderColor: O
|
|
2936
|
-
color: O
|
|
2938
|
+
borderColor: k(O).copied.value ? "var(--tpl-success)" : "var(--tpl-border)",
|
|
2939
|
+
color: k(O).copied.value ? "var(--tpl-success)" : "var(--tpl-text)",
|
|
2937
2940
|
backgroundColor: "var(--tpl-bg)"
|
|
2938
2941
|
}),
|
|
2939
|
-
onClick: n[13] ||= (e) => O
|
|
2940
|
-
}, [O
|
|
2942
|
+
onClick: n[13] ||= (e) => k(O).copy(k(O).selectedUrl.value)
|
|
2943
|
+
}, [k(O).copied.value ? (S(), l(k(I), {
|
|
2941
2944
|
key: 1,
|
|
2942
2945
|
size: 12,
|
|
2943
2946
|
"stroke-width": 2
|
|
2944
|
-
})) : (S(), l(
|
|
2947
|
+
})) : (S(), l(k(R), {
|
|
2945
2948
|
key: 0,
|
|
2946
2949
|
size: 12,
|
|
2947
2950
|
"stroke-width": 2
|
|
2948
|
-
})), p(" " + D(O
|
|
2951
|
+
})), p(" " + D(k(O).copied.value ? a.value.mediaLibrary.copied : a.value.mediaLibrary.copyUrl), 1)], 4)) : u("", !0), c.value ? (S(), d("div", Oi, [f("button", {
|
|
2949
2952
|
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",
|
|
2950
2953
|
style: {
|
|
2951
2954
|
"border-color": "var(--tpl-border)",
|
|
2952
2955
|
color: "var(--tpl-text)",
|
|
2953
2956
|
"background-color": "var(--tpl-bg)"
|
|
2954
2957
|
},
|
|
2955
|
-
onClick: n[14] ||= (e) => O
|
|
2956
|
-
}, D(a.value.mediaLibrary.moveSelected), 1), O
|
|
2958
|
+
onClick: n[14] ||= (e) => k(O).showMovePicker.value = !k(O).showMovePicker.value
|
|
2959
|
+
}, D(a.value.mediaLibrary.moveSelected), 1), k(O).showMovePicker.value ? (S(), l(fn, {
|
|
2957
2960
|
key: 0,
|
|
2958
|
-
folders:
|
|
2959
|
-
"current-folder-id":
|
|
2960
|
-
onSelect: O
|
|
2961
|
-
onClose: n[15] ||= (e) => O
|
|
2961
|
+
folders: k(E).folders.value,
|
|
2962
|
+
"current-folder-id": k(E).currentFolderId.value,
|
|
2963
|
+
onSelect: k(O).handleMoveToFolder,
|
|
2964
|
+
onClose: n[15] ||= (e) => k(O).showMovePicker.value = !1
|
|
2962
2965
|
}, null, 8, [
|
|
2963
2966
|
"folders",
|
|
2964
2967
|
"current-folder-id",
|
|
2965
2968
|
"onSelect"
|
|
2966
|
-
])) : u("", !0)])) : u("", !0)])) : u("", !0), f("div",
|
|
2969
|
+
])) : u("", !0)])) : u("", !0)])) : u("", !0), f("div", ki, [k(E).selectedItems.value.size > 0 ? (S(), d("button", {
|
|
2967
2970
|
key: 0,
|
|
2968
2971
|
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",
|
|
2969
2972
|
style: {
|
|
@@ -2971,7 +2974,7 @@ var Br = {
|
|
|
2971
2974
|
color: "var(--tpl-danger)",
|
|
2972
2975
|
"background-color": "var(--tpl-danger-light)"
|
|
2973
2976
|
},
|
|
2974
|
-
onClick: n[16] ||= (...e) => O
|
|
2977
|
+
onClick: n[16] ||= (...e) => k(O).handleDeleteClick && k(O).handleDeleteClick(...e)
|
|
2975
2978
|
}, D(a.value.mediaLibrary.deleteSelected), 1)) : u("", !0), e.onSelect ? (S(), d("button", {
|
|
2976
2979
|
key: 1,
|
|
2977
2980
|
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",
|
|
@@ -2979,37 +2982,37 @@ var Br = {
|
|
|
2979
2982
|
"background-color": "var(--tpl-primary)",
|
|
2980
2983
|
color: "var(--tpl-bg)"
|
|
2981
2984
|
},
|
|
2982
|
-
disabled: !
|
|
2985
|
+
disabled: !k(E).previewItem.value,
|
|
2983
2986
|
onClick: A
|
|
2984
|
-
}, D(a.value.mediaLibrary.selectFile), 9,
|
|
2987
|
+
}, D(a.value.mediaLibrary.selectFile), 9, Ai)) : u("", !0)])])])
|
|
2985
2988
|
]));
|
|
2986
2989
|
}
|
|
2987
|
-
}),
|
|
2990
|
+
}), Mi = (e, t, n) => {
|
|
2988
2991
|
let r = t.lastIndexOf("?"), i = e[r === -1 || r < t.lastIndexOf("/") ? t : t.slice(0, r)];
|
|
2989
2992
|
return i ? typeof i == "function" ? i() : Promise.resolve(i) : new Promise((e, r) => {
|
|
2990
2993
|
(typeof queueMicrotask == "function" ? queueMicrotask : setTimeout)(r.bind(null, /* @__PURE__ */ Error("Unknown variable dynamic import: " + t + (t.split("/").length === n ? "" : ". Note that variables only represent file names one level deep."))));
|
|
2991
2994
|
});
|
|
2992
|
-
},
|
|
2995
|
+
}, Ni = [
|
|
2993
2996
|
"en",
|
|
2994
2997
|
"de",
|
|
2995
2998
|
"pt-BR"
|
|
2996
2999
|
];
|
|
2997
|
-
function
|
|
3000
|
+
function Pi(e) {
|
|
2998
3001
|
return e.trim().replace(/_/g, "-").toLowerCase();
|
|
2999
3002
|
}
|
|
3000
|
-
function
|
|
3001
|
-
let t =
|
|
3002
|
-
return
|
|
3003
|
+
function Fi(e) {
|
|
3004
|
+
let t = Pi(e);
|
|
3005
|
+
return Ni.find((e) => Pi(e) === t);
|
|
3003
3006
|
}
|
|
3004
|
-
function
|
|
3005
|
-
return
|
|
3007
|
+
function Ii(e) {
|
|
3008
|
+
return Pi(e).split("-")[0];
|
|
3006
3009
|
}
|
|
3007
|
-
function
|
|
3008
|
-
return
|
|
3010
|
+
function Li(e) {
|
|
3011
|
+
return Fi(e) ?? Fi(Ii(e)) ?? "en";
|
|
3009
3012
|
}
|
|
3010
|
-
async function
|
|
3011
|
-
let t =
|
|
3012
|
-
return (await
|
|
3013
|
+
async function Ri(e) {
|
|
3014
|
+
let t = Li(e);
|
|
3015
|
+
return (await Mi(/* @__PURE__ */ Object.assign({
|
|
3013
3016
|
"./locales/de.ts": () => import("./de-BULkjF_s.js"),
|
|
3014
3017
|
"./locales/en.ts": () => import("./en-ivlOqPuR.js"),
|
|
3015
3018
|
"./locales/pt-BR.ts": () => import("./pt-BR-T5mPyHbx.js")
|
|
@@ -3017,30 +3020,30 @@ async function Ii(e) {
|
|
|
3017
3020
|
}
|
|
3018
3021
|
//#endregion
|
|
3019
3022
|
//#region src/standalone/visual.ts
|
|
3020
|
-
var $ = null,
|
|
3021
|
-
async function
|
|
3023
|
+
var $ = null, zi = w(null);
|
|
3024
|
+
async function Bi(e) {
|
|
3022
3025
|
let n = typeof e.container == "string" ? document.querySelector(e.container) : e.container;
|
|
3023
3026
|
if (!n) throw Error(`Container element not found: ${e.container}`);
|
|
3024
3027
|
let i = r(e.auth, e.onError);
|
|
3025
3028
|
await i.initialize();
|
|
3026
|
-
let a = await new t(i).fetchConfig(), o = await
|
|
3027
|
-
return
|
|
3029
|
+
let a = await new t(i).fetchConfig(), o = await Ri(e.locale ?? "en");
|
|
3030
|
+
return Hi(n, e.theme), $ && Vi(), new Promise((t, r) => {
|
|
3028
3031
|
try {
|
|
3029
3032
|
$ = c({ setup() {
|
|
3030
3033
|
let r = () => {
|
|
3031
3034
|
t({
|
|
3032
|
-
setTheme: (e) =>
|
|
3033
|
-
unmount:
|
|
3035
|
+
setTheme: (e) => Hi(n, e),
|
|
3036
|
+
unmount: Vi
|
|
3034
3037
|
});
|
|
3035
3038
|
};
|
|
3036
|
-
return () => g(
|
|
3039
|
+
return () => g(ji, {
|
|
3037
3040
|
authManager: i,
|
|
3038
3041
|
projectId: i.projectId,
|
|
3039
3042
|
planConfig: a,
|
|
3040
3043
|
translations: o,
|
|
3041
3044
|
onSelect: e.onSelect,
|
|
3042
3045
|
onError: e.onError,
|
|
3043
|
-
ref:
|
|
3046
|
+
ref: zi,
|
|
3044
3047
|
onReady: r
|
|
3045
3048
|
});
|
|
3046
3049
|
} }), $.mount(n);
|
|
@@ -3049,15 +3052,15 @@ async function Ri(e) {
|
|
|
3049
3052
|
}
|
|
3050
3053
|
});
|
|
3051
3054
|
}
|
|
3052
|
-
function
|
|
3053
|
-
$ && ($.unmount(), $ = null,
|
|
3055
|
+
function Vi() {
|
|
3056
|
+
$ && ($.unmount(), $ = null, zi.value = null);
|
|
3054
3057
|
}
|
|
3055
|
-
function
|
|
3058
|
+
function Hi(e, t) {
|
|
3056
3059
|
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`)));
|
|
3057
3060
|
}
|
|
3058
3061
|
typeof window < "u" && (window.TemplaticalMedia = {
|
|
3059
|
-
init:
|
|
3060
|
-
unmount:
|
|
3062
|
+
init: Bi,
|
|
3063
|
+
unmount: Vi
|
|
3061
3064
|
});
|
|
3062
3065
|
//#endregion
|
|
3063
|
-
export {
|
|
3066
|
+
export { de as MediaApiClient, Br as MediaLibraryModal, Bi as init, Vi as unmount, Z as useI18n, Q as useMediaCategories, fe as useMediaLibrary, Vr as useMediaPicker };
|