@templatical/media-library 0.27.0 → 0.27.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cdn/media-library.css +1 -1
- package/dist/cdn/media-library.js +796 -706
- package/dist/cdn/media-library.js.map +1 -1
- package/dist/index.d.ts +46 -2
- package/dist/templatical-media-library.css +1 -1
- package/dist/templatical-media-library.js +566 -465
- package/package.json +3 -3
- package/dist/cdn/chunks/en-B-xajqfh.js +0 -89
- package/dist/cdn/chunks/en-B-xajqfh.js.map +0 -1
- package/dist/en-B-xajqfh.js +0 -87
|
@@ -3,8 +3,15 @@ import { Fragment as i, Teleport as a, Transition as o, computed as s, createApp
|
|
|
3
3
|
import { Check as I, ChevronRight as L, Copy as R, File as z, Folder as B, Grid2x2 as V, Link as H, List as U, LoaderCircle as W, PanelLeft as G, Pencil as K, Plus as q, RefreshCw as ee, Search as J, Star as te, Trash2 as Y, Upload as ne, X as re } from "@lucide/vue";
|
|
4
4
|
import { Cropper as ie } from "vue-advanced-cropper";
|
|
5
5
|
import { onClickOutside as ae, useClipboard as oe, useDebounceFn as se, useDropZone as ce, useEventListener as le, useFileDialog as ue, useIntersectionObserver as de } from "@vueuse/core";
|
|
6
|
-
//#region
|
|
7
|
-
var fe =
|
|
6
|
+
//#region \0rolldown/runtime.js
|
|
7
|
+
var fe = Object.defineProperty, pe = (e, t) => {
|
|
8
|
+
let n = {};
|
|
9
|
+
for (var r in e) fe(n, r, {
|
|
10
|
+
get: e[r],
|
|
11
|
+
enumerable: !0
|
|
12
|
+
});
|
|
13
|
+
return t || fe(n, Symbol.toStringTag, { value: "Module" }), n;
|
|
14
|
+
}, me = class {
|
|
8
15
|
authManager;
|
|
9
16
|
constructor(e) {
|
|
10
17
|
this.authManager = e;
|
|
@@ -161,9 +168,9 @@ var fe = class {
|
|
|
161
168
|
};
|
|
162
169
|
//#endregion
|
|
163
170
|
//#region src/composable.ts
|
|
164
|
-
function
|
|
171
|
+
function he(e) {
|
|
165
172
|
if (!e.projectId) throw Error("projectId is required for useMediaLibrary");
|
|
166
|
-
let t = new
|
|
173
|
+
let t = new me(e.authManager), n = w([]), r = w([]), i = w(null), a = w("files"), o = w(""), s = w(null), c = w("newest"), l = w(!1), u = w(!1), d = w(!1), f = w(null), p = w(null), m = w(/* @__PURE__ */ new Set()), h = w(null), g = w([]), _ = w({}), v = w(!1), y = w([]), b = w(!1), x = w(null), S = w(!1), C = w(null), T = w(!1), E = w(null), D = w(null), O = 0;
|
|
167
174
|
async function k() {
|
|
168
175
|
let r = ++O;
|
|
169
176
|
l.value = !0;
|
|
@@ -457,9 +464,95 @@ function pe(e) {
|
|
|
457
464
|
};
|
|
458
465
|
}
|
|
459
466
|
//#endregion
|
|
467
|
+
//#region src/keys.ts
|
|
468
|
+
var ge = Symbol("templaticalMediaPlanConfig"), _e = Symbol("templaticalMediaPopoverTarget"), ve = Symbol("templaticalMediaTranslations"), ye = Symbol("templaticalMediaUiTheme"), be = /* @__PURE__ */ pe({ default: () => xe }), xe = { mediaLibrary: {
|
|
469
|
+
title: "Media Library",
|
|
470
|
+
searchPlaceholder: "Search files...",
|
|
471
|
+
allFiles: "All Files",
|
|
472
|
+
filterAll: "All Types",
|
|
473
|
+
filterImages: "Images",
|
|
474
|
+
filterDocuments: "Documents",
|
|
475
|
+
filterVideos: "Videos",
|
|
476
|
+
filterAudio: "Audio",
|
|
477
|
+
newFolder: "New Folder",
|
|
478
|
+
folderName: "Folder name",
|
|
479
|
+
noFiles: "No files found",
|
|
480
|
+
dropOrClick: "Drop files here or click to upload",
|
|
481
|
+
acceptedFormats: "Images, PDF, Video, Audio, Documents (max 10MB)",
|
|
482
|
+
uploading: "Uploading...",
|
|
483
|
+
uploadingProgress: "Uploading {current} of {total}...",
|
|
484
|
+
selectImage: "Select Image",
|
|
485
|
+
selectFile: "Select File",
|
|
486
|
+
deleteSelected: "Delete",
|
|
487
|
+
copyUrl: "Copy URL",
|
|
488
|
+
copied: "Copied!",
|
|
489
|
+
browseMedia: "Browse Media Library",
|
|
490
|
+
renameFolder: "Rename folder",
|
|
491
|
+
addSubfolder: "Add subfolder",
|
|
492
|
+
subfolderName: "Subfolder name",
|
|
493
|
+
sortNewest: "Newest First",
|
|
494
|
+
sortOldest: "Oldest First",
|
|
495
|
+
sortNameAsc: "Name A-Z",
|
|
496
|
+
sortNameDesc: "Name Z-A",
|
|
497
|
+
sortSizeAsc: "Smallest First",
|
|
498
|
+
sortSizeDesc: "Largest First",
|
|
499
|
+
moveSelected: "Move",
|
|
500
|
+
moveToRoot: "All Files",
|
|
501
|
+
currentFolder: "(current)",
|
|
502
|
+
confirmDelete: "Confirm?",
|
|
503
|
+
renameFile: "Rename",
|
|
504
|
+
editFile: "Edit File",
|
|
505
|
+
fileName: "Filename",
|
|
506
|
+
altText: "Alt Text",
|
|
507
|
+
altTextPlaceholder: "Describe this image for accessibility",
|
|
508
|
+
saveChanges: "Save",
|
|
509
|
+
cancel: "Cancel",
|
|
510
|
+
frequentlyUsed: "Frequently Used",
|
|
511
|
+
deleteWarningTitle: "Delete File",
|
|
512
|
+
deleteWarningMessage: "Are you sure? This action is irreversible.",
|
|
513
|
+
deleteWarningUsageNote: "The following files are used in templates. Deleting them may break those templates.",
|
|
514
|
+
deleteAnyway: "Delete",
|
|
515
|
+
usedInTemplates: "Used in {count} template(s)",
|
|
516
|
+
viewGrid: "Grid view",
|
|
517
|
+
viewList: "List view",
|
|
518
|
+
showFolders: "Show folders",
|
|
519
|
+
hideFolders: "Hide folders",
|
|
520
|
+
importFromUrl: "Import from URL",
|
|
521
|
+
importUrlPlaceholder: "https://example.com/image.jpg",
|
|
522
|
+
import: "Import",
|
|
523
|
+
importing: "Importing...",
|
|
524
|
+
importError: "Failed to import from URL",
|
|
525
|
+
conversionLabel: "Size",
|
|
526
|
+
conversionOriginal: "Original",
|
|
527
|
+
conversionSmall: "Small (150px)",
|
|
528
|
+
conversionMedium: "Medium (600px)",
|
|
529
|
+
conversionLarge: "Large (1200px)",
|
|
530
|
+
replaceFile: "Replace File",
|
|
531
|
+
replaceWarningTitle: "Replace File",
|
|
532
|
+
replaceWarningMessage: "You are about to replace this file. The replacement must have the same file extension ({extension}).",
|
|
533
|
+
replaceWarningUsageNote: "This file is used in {count} template(s). Replacing it will update all references.",
|
|
534
|
+
replaceSelectFile: "Select replacement file",
|
|
535
|
+
replace: "Replace",
|
|
536
|
+
replacing: "Replacing...",
|
|
537
|
+
replaceError: "Failed to replace file",
|
|
538
|
+
saving: "Saving...",
|
|
539
|
+
cropAspectRatio: "Aspect Ratio",
|
|
540
|
+
cropFree: "Free",
|
|
541
|
+
cropSquare: "1:1",
|
|
542
|
+
cropLandscape43: "4:3",
|
|
543
|
+
cropLandscape169: "16:9",
|
|
544
|
+
cropOriginal: "Original",
|
|
545
|
+
cropMaxWidth: "Max Width",
|
|
546
|
+
cropMaxHeight: "Max Height",
|
|
547
|
+
cropOutputSize: "Output Size",
|
|
548
|
+
cropPixels: "px",
|
|
549
|
+
cropOptional: "(optional)",
|
|
550
|
+
storageTooltip: "{used} of {total} used ({remaining} remaining)"
|
|
551
|
+
} };
|
|
552
|
+
//#endregion
|
|
460
553
|
//#region src/composables/useI18n.ts
|
|
461
554
|
function X(e) {
|
|
462
|
-
let t = e ?? _(
|
|
555
|
+
let t = e ?? _(ve, null), n = (v(t) ? t.value : t) ?? xe;
|
|
463
556
|
function r(e, t) {
|
|
464
557
|
return e.replace(/\{(\w+)\}/g, (e, n) => n in t ? String(t[n]) : `{${n}}`);
|
|
465
558
|
}
|
|
@@ -470,14 +563,14 @@ function X(e) {
|
|
|
470
563
|
}
|
|
471
564
|
//#endregion
|
|
472
565
|
//#region src/components/media/MediaBreadcrumb.vue?vue&type=script&setup=true&lang.ts
|
|
473
|
-
var
|
|
566
|
+
var Se = {
|
|
474
567
|
key: 0,
|
|
475
568
|
class: "tpl:flex tpl:items-center tpl:gap-1 tpl:text-xs",
|
|
476
569
|
style: { color: "var(--tpl-text-muted)" }
|
|
477
|
-
},
|
|
570
|
+
}, Ce = ["onClick"], we = {
|
|
478
571
|
key: 1,
|
|
479
572
|
style: { color: "var(--tpl-text)" }
|
|
480
|
-
},
|
|
573
|
+
}, Te = /* @__PURE__ */ h({
|
|
481
574
|
__name: "MediaBreadcrumb",
|
|
482
575
|
props: {
|
|
483
576
|
folders: {},
|
|
@@ -497,7 +590,7 @@ var me = {
|
|
|
497
590
|
}
|
|
498
591
|
return !1;
|
|
499
592
|
}
|
|
500
|
-
return (e, t) => o.value.length > 0 ? (S(), d("div",
|
|
593
|
+
return (e, t) => o.value.length > 0 ? (S(), d("div", Se, [f("button", {
|
|
501
594
|
class: "tpl:transition-colors tpl:duration-150 tpl:hover:underline",
|
|
502
595
|
style: { color: "var(--tpl-primary)" },
|
|
503
596
|
onClick: t[0] ||= (e) => r("navigate", null)
|
|
@@ -509,47 +602,47 @@ var me = {
|
|
|
509
602
|
class: "tpl:transition-colors tpl:duration-150 tpl:hover:underline",
|
|
510
603
|
style: { color: "var(--tpl-primary)" },
|
|
511
604
|
onClick: (t) => r("navigate", e.id)
|
|
512
|
-
}, D(e.name), 9,
|
|
605
|
+
}, D(e.name), 9, Ce)) : (S(), d("span", we, D(e.name), 1))], 64))), 128))])) : u("", !0);
|
|
513
606
|
}
|
|
514
|
-
})
|
|
607
|
+
});
|
|
515
608
|
//#endregion
|
|
516
609
|
//#region src/composables/useMediaCategories.ts
|
|
517
|
-
function Z() {
|
|
518
|
-
let
|
|
519
|
-
if (!
|
|
520
|
-
let
|
|
521
|
-
function
|
|
522
|
-
return
|
|
523
|
-
}
|
|
524
|
-
function l(e) {
|
|
525
|
-
return r.value ? r.value.images?.mime_types.includes(e) ?? !1 : !1;
|
|
610
|
+
function Z(e) {
|
|
611
|
+
let t = e ?? _(ge, null);
|
|
612
|
+
if (!t) throw Error("[Templatical] useMediaCategories() needs a plan config in scope. Render it under <MediaLibraryModal> (pass its `planConfig` prop) or provide PLAN_CONFIG_KEY yourself.");
|
|
613
|
+
let n = s(() => t.config.value?.media ?? null), r = s(() => n.value?.use_media_library ?? !0), i = s(() => n.value?.categories ?? null), a = s(() => i.value ? Object.values(i.value).flatMap((e) => e.mime_types) : []), o = s(() => a.value.join(",")), c = s(() => n.value?.max_file_size ?? 0);
|
|
614
|
+
function l(e, t) {
|
|
615
|
+
return i.value ? !t || t.length === 0 ? a.value.includes(e) : t.some((t) => i.value[t]?.mime_types.includes(e)) : !1;
|
|
526
616
|
}
|
|
527
617
|
function u(e) {
|
|
528
|
-
|
|
529
|
-
|
|
618
|
+
return i.value ? i.value.images?.mime_types.includes(e) ?? !1 : !1;
|
|
619
|
+
}
|
|
620
|
+
function d(e) {
|
|
621
|
+
if (!i.value) return null;
|
|
622
|
+
for (let [t, n] of Object.entries(i.value)) if (n.mime_types.includes(e)) return t;
|
|
530
623
|
return null;
|
|
531
624
|
}
|
|
532
625
|
return {
|
|
533
|
-
isMediaLibraryEnabled:
|
|
534
|
-
allAcceptedMimeTypes:
|
|
535
|
-
allAcceptedInputString:
|
|
536
|
-
maxFileSize:
|
|
537
|
-
availableCategories: s(() =>
|
|
538
|
-
isAcceptedMimeType:
|
|
539
|
-
isImageMimeType:
|
|
540
|
-
getCategoryForMimeType:
|
|
626
|
+
isMediaLibraryEnabled: r,
|
|
627
|
+
allAcceptedMimeTypes: a,
|
|
628
|
+
allAcceptedInputString: o,
|
|
629
|
+
maxFileSize: c,
|
|
630
|
+
availableCategories: s(() => i.value ? Object.keys(i.value) : []),
|
|
631
|
+
isAcceptedMimeType: l,
|
|
632
|
+
isImageMimeType: u,
|
|
633
|
+
getCategoryForMimeType: d
|
|
541
634
|
};
|
|
542
635
|
}
|
|
543
636
|
//#endregion
|
|
544
637
|
//#region src/composables/useImageCrop.ts
|
|
545
|
-
var
|
|
638
|
+
var Ee = {
|
|
546
639
|
free: void 0,
|
|
547
640
|
square: 1,
|
|
548
641
|
landscape43: 4 / 3,
|
|
549
642
|
landscape169: 16 / 9,
|
|
550
643
|
original: void 0
|
|
551
644
|
};
|
|
552
|
-
function
|
|
645
|
+
function De(e) {
|
|
553
646
|
return e === "image/png" || e === "image/gif" ? {
|
|
554
647
|
mimeType: "image/png",
|
|
555
648
|
quality: 1
|
|
@@ -561,7 +654,7 @@ function xe(e) {
|
|
|
561
654
|
quality: .92
|
|
562
655
|
};
|
|
563
656
|
}
|
|
564
|
-
function
|
|
657
|
+
function Oe(e, t, n) {
|
|
565
658
|
let r = e.width, i = e.height;
|
|
566
659
|
if (!t && !n) return e;
|
|
567
660
|
let a = r, o = i;
|
|
@@ -575,7 +668,7 @@ function Se(e, t, n) {
|
|
|
575
668
|
let c = s.getContext("2d");
|
|
576
669
|
return c && (c.imageSmoothingEnabled = !0, c.imageSmoothingQuality = "high", c.drawImage(e, 0, 0, a, o)), s;
|
|
577
670
|
}
|
|
578
|
-
function
|
|
671
|
+
function ke(e, t, n) {
|
|
579
672
|
return new Promise((r, i) => {
|
|
580
673
|
e.toBlob((e) => {
|
|
581
674
|
if (!e) {
|
|
@@ -587,7 +680,7 @@ function Ce(e, t, n) {
|
|
|
587
680
|
}, n.mimeType, n.quality);
|
|
588
681
|
});
|
|
589
682
|
}
|
|
590
|
-
function
|
|
683
|
+
function Ae(e, t, n, r) {
|
|
591
684
|
let i = e, a = t;
|
|
592
685
|
if (n && i > n) {
|
|
593
686
|
let e = n / i;
|
|
@@ -604,57 +697,57 @@ function we(e, t, n, r) {
|
|
|
604
697
|
}
|
|
605
698
|
//#endregion
|
|
606
699
|
//#region src/components/media/MediaEditModal.vue?vue&type=script&setup=true&lang.ts
|
|
607
|
-
var
|
|
700
|
+
var je = ["data-tpl-theme"], Me = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, Ne = {
|
|
608
701
|
class: "tpl:text-sm tpl:font-semibold",
|
|
609
702
|
style: { color: "var(--tpl-text)" }
|
|
610
|
-
},
|
|
703
|
+
}, Pe = { class: "tpl:min-h-0 tpl:flex-1 tpl:overflow-y-auto tpl:px-5" }, Fe = {
|
|
611
704
|
key: 0,
|
|
612
705
|
class: "tpl:mb-4"
|
|
613
|
-
},
|
|
706
|
+
}, Ie = {
|
|
614
707
|
class: "tpl:relative tpl:mb-3 tpl:overflow-hidden tpl:rounded-md tpl:border",
|
|
615
708
|
style: {
|
|
616
709
|
"border-color": "var(--tpl-border)",
|
|
617
710
|
height: "300px",
|
|
618
711
|
"background-color": "var(--tpl-bg)"
|
|
619
712
|
}
|
|
620
|
-
},
|
|
713
|
+
}, Le = { class: "tpl:space-y-3" }, Re = {
|
|
621
714
|
class: "tpl:mb-1.5 tpl:block tpl:text-xs tpl:font-medium",
|
|
622
715
|
style: { color: "var(--tpl-text-muted)" }
|
|
623
|
-
},
|
|
716
|
+
}, ze = { class: "tpl:flex tpl:flex-wrap tpl:gap-1.5" }, Be = ["onClick"], Ve = { class: "tpl:flex tpl:gap-3" }, He = { class: "tpl:flex-1" }, Ue = {
|
|
624
717
|
class: "tpl:mb-1 tpl:block tpl:text-xs tpl:font-medium",
|
|
625
718
|
style: { color: "var(--tpl-text-muted)" }
|
|
626
|
-
},
|
|
719
|
+
}, We = {
|
|
627
720
|
class: "tpl:font-normal",
|
|
628
721
|
style: { color: "var(--tpl-text-dim)" }
|
|
629
|
-
},
|
|
722
|
+
}, Ge = { class: "tpl:relative" }, Ke = ["value", "placeholder"], qe = {
|
|
630
723
|
class: "tpl:absolute tpl:top-1/2 tpl:right-2.5 tpl:-translate-y-1/2 tpl:text-xs",
|
|
631
724
|
style: { color: "var(--tpl-text-dim)" }
|
|
632
|
-
},
|
|
725
|
+
}, Je = { class: "tpl:flex-1" }, Ye = {
|
|
633
726
|
class: "tpl:mb-1 tpl:block tpl:text-xs tpl:font-medium",
|
|
634
727
|
style: { color: "var(--tpl-text-muted)" }
|
|
635
|
-
},
|
|
728
|
+
}, Xe = {
|
|
636
729
|
class: "tpl:font-normal",
|
|
637
730
|
style: { color: "var(--tpl-text-dim)" }
|
|
638
|
-
},
|
|
731
|
+
}, Ze = { class: "tpl:relative" }, Qe = ["value", "placeholder"], $e = {
|
|
639
732
|
class: "tpl:absolute tpl:top-1/2 tpl:right-2.5 tpl:-translate-y-1/2 tpl:text-xs",
|
|
640
733
|
style: { color: "var(--tpl-text-dim)" }
|
|
641
|
-
},
|
|
734
|
+
}, et = {
|
|
642
735
|
key: 0,
|
|
643
736
|
class: "tpl:flex tpl:items-center tpl:gap-1 tpl:text-xs",
|
|
644
737
|
style: { color: "var(--tpl-text-muted)" }
|
|
645
|
-
},
|
|
738
|
+
}, tt = {
|
|
646
739
|
class: "tpl:font-medium",
|
|
647
740
|
style: { color: "var(--tpl-text)" }
|
|
648
|
-
},
|
|
741
|
+
}, nt = { class: "tpl:mb-3" }, rt = {
|
|
649
742
|
class: "tpl:mb-1 tpl:block tpl:text-xs tpl:font-medium",
|
|
650
743
|
style: { color: "var(--tpl-text-muted)" }
|
|
651
|
-
},
|
|
744
|
+
}, it = ["autofocus"], at = {
|
|
652
745
|
key: 1,
|
|
653
746
|
class: "tpl:mb-4"
|
|
654
|
-
},
|
|
747
|
+
}, ot = {
|
|
655
748
|
class: "tpl:mb-1 tpl:block tpl:text-xs tpl:font-medium",
|
|
656
749
|
style: { color: "var(--tpl-text-muted)" }
|
|
657
|
-
},
|
|
750
|
+
}, st = ["placeholder"], ct = { class: "tpl:flex tpl:shrink-0 tpl:justify-end tpl:gap-2 tpl:p-5 tpl:pt-4" }, lt = ["disabled"], ut = /*@__PURE__*/ h({
|
|
658
751
|
__name: "MediaEditModal",
|
|
659
752
|
props: {
|
|
660
753
|
visible: { type: Boolean },
|
|
@@ -662,12 +755,12 @@ var Te = ["data-tpl-theme"], Ee = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, De
|
|
|
662
755
|
},
|
|
663
756
|
emits: ["save", "close"],
|
|
664
757
|
setup(e, { emit: t }) {
|
|
665
|
-
let n = e, r = t, { t: c } = X(), h = _(
|
|
758
|
+
let n = e, r = t, { t: c } = X(), h = _(ye, null), g = _(_e, w(null)), v = c.mediaLibrary, { isImageMimeType: x } = Z(), C = w(""), E = w(""), O = w(null), P = w("free"), I = w(void 0), L = w(void 0), R = w(""), z = w(""), B = w(void 0), V = w(null), H = w(!1), U = w(!1), W = w(!1), G = s(() => n.item ? [
|
|
666
759
|
"image/jpeg",
|
|
667
760
|
"image/png",
|
|
668
761
|
"image/webp",
|
|
669
762
|
"image/gif"
|
|
670
|
-
].includes(n.item.mime_type) : !1), K = s(() => P.value === "original" ? B.value :
|
|
763
|
+
].includes(n.item.mime_type) : !1), K = s(() => P.value === "original" ? B.value : Ee[P.value]), q = s(() => V.value ? Ae(V.value.width, V.value.height, I.value, L.value) : null);
|
|
671
764
|
j(() => n.visible, (e) => {
|
|
672
765
|
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));
|
|
673
766
|
});
|
|
@@ -697,8 +790,8 @@ var Te = ["data-tpl-theme"], Ee = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, De
|
|
|
697
790
|
try {
|
|
698
791
|
let { canvas: e } = O.value.getResult();
|
|
699
792
|
if (e) {
|
|
700
|
-
let t =
|
|
701
|
-
i = { file: await
|
|
793
|
+
let t = Oe(e, I.value, L.value), r = De(n.item.mime_type);
|
|
794
|
+
i = { file: await ke(t, n.item.filename, r) };
|
|
702
795
|
}
|
|
703
796
|
} catch {
|
|
704
797
|
U.value = !1;
|
|
@@ -730,9 +823,9 @@ var Te = ["data-tpl-theme"], Ee = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, De
|
|
|
730
823
|
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"]),
|
|
731
824
|
style: { "background-color": "var(--tpl-bg-elevated)" }
|
|
732
825
|
}, [
|
|
733
|
-
f("div",
|
|
734
|
-
f("div",
|
|
735
|
-
G.value ? (S(), d("div",
|
|
826
|
+
f("div", Me, [f("h3", Ne, D(k(c).mediaLibrary.editFile), 1)]),
|
|
827
|
+
f("div", Pe, [
|
|
828
|
+
G.value ? (S(), d("div", Fe, [f("div", Ie, [m(k(ie), {
|
|
736
829
|
ref_key: "cropperRef",
|
|
737
830
|
ref: O,
|
|
738
831
|
src: e.item.url,
|
|
@@ -741,8 +834,8 @@ var Te = ["data-tpl-theme"], Ee = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, De
|
|
|
741
834
|
"background-class": "tpl-cropper-background",
|
|
742
835
|
onChange: ee,
|
|
743
836
|
onReady: J
|
|
744
|
-
}, null, 8, ["src", "stencil-props"])]), f("div",
|
|
745
|
-
f("div", null, [f("label",
|
|
837
|
+
}, null, 8, ["src", "stencil-props"])]), f("div", Le, [
|
|
838
|
+
f("div", null, [f("label", Re, D(k(c).mediaLibrary.cropAspectRatio), 1), f("div", ze, [(S(), d(i, null, T([
|
|
746
839
|
"free",
|
|
747
840
|
"square",
|
|
748
841
|
"landscape43",
|
|
@@ -758,8 +851,8 @@ var Te = ["data-tpl-theme"], Ee = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, De
|
|
|
758
851
|
color: P.value === e ? "var(--tpl-primary)" : "var(--tpl-text)"
|
|
759
852
|
}),
|
|
760
853
|
onClick: (t) => P.value = e
|
|
761
|
-
}, D(k(v)[`crop${e.charAt(0).toUpperCase()}${e.slice(1)}`]), 13,
|
|
762
|
-
f("div",
|
|
854
|
+
}, D(k(v)[`crop${e.charAt(0).toUpperCase()}${e.slice(1)}`]), 13, Be)), 64))])]),
|
|
855
|
+
f("div", Ve, [f("div", He, [f("label", Ue, [p(D(k(c).mediaLibrary.cropMaxWidth) + " ", 1), f("span", We, D(k(c).mediaLibrary.cropOptional), 1)]), f("div", Ge, [f("input", {
|
|
763
856
|
value: R.value,
|
|
764
857
|
type: "number",
|
|
765
858
|
min: "1",
|
|
@@ -771,7 +864,7 @@ var Te = ["data-tpl-theme"], Ee = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, De
|
|
|
771
864
|
},
|
|
772
865
|
placeholder: V.value?.width?.toString() || "",
|
|
773
866
|
onInput: te
|
|
774
|
-
}, null, 40,
|
|
867
|
+
}, null, 40, Ke), f("span", qe, D(k(c).mediaLibrary.cropPixels), 1)])]), f("div", Je, [f("label", Ye, [p(D(k(c).mediaLibrary.cropMaxHeight) + " ", 1), f("span", Xe, D(k(c).mediaLibrary.cropOptional), 1)]), f("div", Ze, [f("input", {
|
|
775
868
|
value: z.value,
|
|
776
869
|
type: "number",
|
|
777
870
|
min: "1",
|
|
@@ -783,10 +876,10 @@ var Te = ["data-tpl-theme"], Ee = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, De
|
|
|
783
876
|
},
|
|
784
877
|
placeholder: V.value?.height?.toString() || "",
|
|
785
878
|
onInput: Y
|
|
786
|
-
}, null, 40,
|
|
787
|
-
q.value ? (S(), d("div",
|
|
879
|
+
}, null, 40, Qe), f("span", $e, D(k(c).mediaLibrary.cropPixels), 1)])])]),
|
|
880
|
+
q.value ? (S(), d("div", et, [f("span", null, D(k(c).mediaLibrary.cropOutputSize) + ": ", 1), f("span", tt, D(q.value.width) + " x " + D(q.value.height) + " " + D(k(c).mediaLibrary.cropPixels), 1)])) : u("", !0)
|
|
788
881
|
])])) : u("", !0),
|
|
789
|
-
f("div",
|
|
882
|
+
f("div", nt, [f("label", rt, D(k(c).mediaLibrary.fileName), 1), N(f("input", {
|
|
790
883
|
"onUpdate:modelValue": n[0] ||= (e) => C.value = e,
|
|
791
884
|
type: "text",
|
|
792
885
|
class: "tpl:w-full tpl:rounded-md tpl:border tpl:px-3 tpl:py-1.5 tpl:text-xs tpl:outline-none",
|
|
@@ -796,8 +889,8 @@ var Te = ["data-tpl-theme"], Ee = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, De
|
|
|
796
889
|
color: "var(--tpl-text)"
|
|
797
890
|
},
|
|
798
891
|
autofocus: !G.value
|
|
799
|
-
}, null, 8,
|
|
800
|
-
k(x)(e.item.mime_type) ? (S(), d("div",
|
|
892
|
+
}, null, 8, it), [[A, C.value]])]),
|
|
893
|
+
k(x)(e.item.mime_type) ? (S(), d("div", at, [f("label", ot, D(k(c).mediaLibrary.altText), 1), N(f("input", {
|
|
801
894
|
"onUpdate:modelValue": n[1] ||= (e) => E.value = e,
|
|
802
895
|
type: "text",
|
|
803
896
|
class: "tpl:w-full tpl:rounded-md tpl:border tpl:px-3 tpl:py-1.5 tpl:text-xs tpl:outline-none",
|
|
@@ -807,9 +900,9 @@ var Te = ["data-tpl-theme"], Ee = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, De
|
|
|
807
900
|
color: "var(--tpl-text)"
|
|
808
901
|
},
|
|
809
902
|
placeholder: k(c).mediaLibrary.altTextPlaceholder
|
|
810
|
-
}, null, 8,
|
|
903
|
+
}, null, 8, st), [[A, E.value]])])) : u("", !0)
|
|
811
904
|
]),
|
|
812
|
-
f("div",
|
|
905
|
+
f("div", ct, [f("button", {
|
|
813
906
|
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",
|
|
814
907
|
style: {
|
|
815
908
|
"border-color": "var(--tpl-border)",
|
|
@@ -822,25 +915,25 @@ var Te = ["data-tpl-theme"], Ee = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, De
|
|
|
822
915
|
style: { background: "linear-gradient(\n 135deg,\n var(--tpl-primary),\n var(--tpl-primary-hover)\n )" },
|
|
823
916
|
disabled: U.value,
|
|
824
917
|
onClick: ne
|
|
825
|
-
}, D(U.value ? k(c).mediaLibrary.saving : k(c).mediaLibrary.saveChanges), 9,
|
|
826
|
-
], 2)], 40,
|
|
918
|
+
}, D(U.value ? k(c).mediaLibrary.saving : k(c).mediaLibrary.saveChanges), 9, lt)])
|
|
919
|
+
], 2)], 40, je)) : u("", !0)]),
|
|
827
920
|
_: 1
|
|
828
921
|
})], 8, ["to"]));
|
|
829
922
|
}
|
|
830
|
-
}),
|
|
923
|
+
}), dt = (e, t) => {
|
|
831
924
|
let n = e.__vccOpts || e;
|
|
832
925
|
for (let [e, r] of t) n[e] = r;
|
|
833
926
|
return n;
|
|
834
|
-
},
|
|
927
|
+
}, ft = /*#__PURE__*/ dt(ut, [["__scopeId", "data-v-a5653cc1"]]), pt = {
|
|
835
928
|
key: 1,
|
|
836
929
|
class: "tpl:size-4 tpl:shrink-0"
|
|
837
|
-
},
|
|
930
|
+
}, mt = {
|
|
838
931
|
key: 0,
|
|
839
932
|
class: "tpl:truncate"
|
|
840
|
-
},
|
|
933
|
+
}, ht = {
|
|
841
934
|
key: 3,
|
|
842
935
|
class: "tpl:flex tpl:shrink-0 tpl:items-center tpl:gap-0.5 tpl:opacity-0 tpl:transition-opacity tpl:group-hover:opacity-100"
|
|
843
|
-
},
|
|
936
|
+
}, gt = ["title"], _t = ["title"], vt = { key: 0 }, yt = ["placeholder"], bt = /* @__PURE__ */ h({
|
|
844
937
|
__name: "MediaFolderTreeNode",
|
|
845
938
|
props: {
|
|
846
939
|
folder: {},
|
|
@@ -899,7 +992,7 @@ var Te = ["data-tpl-theme"], Ee = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, De
|
|
|
899
992
|
class: y(["tpl:transition-transform tpl:duration-150", { "tpl:rotate-90": O.value }]),
|
|
900
993
|
size: 10,
|
|
901
994
|
"stroke-width": 2
|
|
902
|
-
}, null, 8, ["class"])])) : (S(), d("span",
|
|
995
|
+
}, null, 8, ["class"])])) : (S(), d("span", pt)),
|
|
903
996
|
f("button", {
|
|
904
997
|
class: "tpl:flex tpl:min-w-0 tpl:flex-1 tpl:items-center tpl:gap-1.5",
|
|
905
998
|
onClick: n[0] ||= (t) => r("navigate", e.folder.id)
|
|
@@ -907,7 +1000,7 @@ var Te = ["data-tpl-theme"], Ee = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, De
|
|
|
907
1000
|
class: "tpl:shrink-0",
|
|
908
1001
|
size: 14,
|
|
909
1002
|
"stroke-width": 1.5
|
|
910
|
-
}), c.value ? u("", !0) : (S(), d("span",
|
|
1003
|
+
}), c.value ? u("", !0) : (S(), d("span", mt, D(e.folder.name), 1))]),
|
|
911
1004
|
c.value ? N((S(), d("input", {
|
|
912
1005
|
key: 2,
|
|
913
1006
|
"onUpdate:modelValue": n[1] ||= (e) => p.value = e,
|
|
@@ -923,7 +1016,7 @@ var Te = ["data-tpl-theme"], Ee = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, De
|
|
|
923
1016
|
onBlur: R,
|
|
924
1017
|
onClick: n[2] ||= F(() => {}, ["stop"])
|
|
925
1018
|
}, null, 544)), [[A, p.value]]) : u("", !0),
|
|
926
|
-
c.value ? u("", !0) : (S(), d("span",
|
|
1019
|
+
c.value ? u("", !0) : (S(), d("span", ht, [
|
|
927
1020
|
v.value ? (S(), d("button", {
|
|
928
1021
|
key: 0,
|
|
929
1022
|
class: "tpl:flex tpl:size-6 tpl:items-center tpl:justify-center tpl:rounded tpl:transition-colors",
|
|
@@ -932,7 +1025,7 @@ var Te = ["data-tpl-theme"], Ee = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, De
|
|
|
932
1025
|
}, [m(k(q), {
|
|
933
1026
|
size: 12,
|
|
934
1027
|
"stroke-width": 2
|
|
935
|
-
})], 8,
|
|
1028
|
+
})], 8, gt)) : u("", !0),
|
|
936
1029
|
f("button", {
|
|
937
1030
|
class: "tpl:flex tpl:size-6 tpl:items-center tpl:justify-center tpl:rounded tpl:transition-colors",
|
|
938
1031
|
title: k(a).mediaLibrary.renameFolder,
|
|
@@ -940,7 +1033,7 @@ var Te = ["data-tpl-theme"], Ee = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, De
|
|
|
940
1033
|
}, [m(k(K), {
|
|
941
1034
|
size: 12,
|
|
942
1035
|
"stroke-width": 2
|
|
943
|
-
})], 8,
|
|
1036
|
+
})], 8, _t),
|
|
944
1037
|
f("button", {
|
|
945
1038
|
class: "tpl:flex tpl:size-6 tpl:items-center tpl:justify-center tpl:rounded tpl:transition-colors",
|
|
946
1039
|
onClick: n[3] ||= F((t) => r("deleteFolder", e.folder.id), ["stop"])
|
|
@@ -950,7 +1043,7 @@ var Te = ["data-tpl-theme"], Ee = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, De
|
|
|
950
1043
|
style: { color: "var(--tpl-danger)" }
|
|
951
1044
|
})])
|
|
952
1045
|
]))
|
|
953
|
-
], 4), O.value ? (S(), d("div",
|
|
1046
|
+
], 4), O.value ? (S(), d("div", vt, [(S(!0), d(i, null, T(e.folder.children, (t) => (S(), l(o, {
|
|
954
1047
|
key: t.id,
|
|
955
1048
|
folder: t,
|
|
956
1049
|
"current-folder-id": e.currentFolderId,
|
|
@@ -980,13 +1073,13 @@ var Te = ["data-tpl-theme"], Ee = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, De
|
|
|
980
1073
|
autofocus: "",
|
|
981
1074
|
onKeydown: [P(H, ["enter"]), P(U, ["escape"])],
|
|
982
1075
|
onBlur: H
|
|
983
|
-
}, null, 40,
|
|
1076
|
+
}, null, 40, yt), [[A, g.value]])], 4)) : u("", !0)])) : u("", !0)]);
|
|
984
1077
|
};
|
|
985
1078
|
}
|
|
986
|
-
}),
|
|
1079
|
+
}), xt = { class: "tpl:flex tpl:h-full tpl:flex-col tpl:overflow-y-auto" }, St = {
|
|
987
1080
|
key: 0,
|
|
988
1081
|
class: "tpl:px-3 tpl:py-2"
|
|
989
|
-
},
|
|
1082
|
+
}, Ct = ["placeholder"], wt = /* @__PURE__ */ h({
|
|
990
1083
|
__name: "MediaFolderTree",
|
|
991
1084
|
props: {
|
|
992
1085
|
folders: {},
|
|
@@ -1012,7 +1105,7 @@ var Te = ["data-tpl-theme"], Ee = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, De
|
|
|
1012
1105
|
function h() {
|
|
1013
1106
|
a.value = !1, o.value = "";
|
|
1014
1107
|
}
|
|
1015
|
-
return (t, g) => (S(), d("div",
|
|
1108
|
+
return (t, g) => (S(), d("div", xt, [
|
|
1016
1109
|
f("button", {
|
|
1017
1110
|
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",
|
|
1018
1111
|
style: b({
|
|
@@ -1024,7 +1117,7 @@ var Te = ["data-tpl-theme"], Ee = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, De
|
|
|
1024
1117
|
size: 14,
|
|
1025
1118
|
"stroke-width": 1.5
|
|
1026
1119
|
}), p(" " + D(k(r).mediaLibrary.allFiles), 1)], 4),
|
|
1027
|
-
(S(!0), d(i, null, T(e.folders, (t) => (S(), l(
|
|
1120
|
+
(S(!0), d(i, null, T(e.folders, (t) => (S(), l(bt, {
|
|
1028
1121
|
key: t.id,
|
|
1029
1122
|
folder: t,
|
|
1030
1123
|
"current-folder-id": e.currentFolderId,
|
|
@@ -1034,7 +1127,7 @@ var Te = ["data-tpl-theme"], Ee = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, De
|
|
|
1034
1127
|
onRenameFolder: g[3] ||= (e, t) => n("renameFolder", e, t),
|
|
1035
1128
|
onDeleteFolder: g[4] ||= (e) => n("deleteFolder", e)
|
|
1036
1129
|
}, null, 8, ["folder", "current-folder-id"]))), 128)),
|
|
1037
|
-
a.value ? (S(), d("div",
|
|
1130
|
+
a.value ? (S(), d("div", St, [N(f("input", {
|
|
1038
1131
|
"onUpdate:modelValue": g[5] ||= (e) => o.value = e,
|
|
1039
1132
|
type: "text",
|
|
1040
1133
|
class: "tpl:w-full tpl:rounded tpl:border tpl:px-2 tpl:py-1 tpl:text-xs tpl:outline-none",
|
|
@@ -1047,7 +1140,7 @@ var Te = ["data-tpl-theme"], Ee = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, De
|
|
|
1047
1140
|
autofocus: "",
|
|
1048
1141
|
onKeydown: [P(c, ["enter"]), P(h, ["escape"])],
|
|
1049
1142
|
onBlur: c
|
|
1050
|
-
}, null, 40,
|
|
1143
|
+
}, null, 40, Ct), [[A, o.value]])])) : u("", !0),
|
|
1051
1144
|
a.value ? u("", !0) : (S(), d("button", {
|
|
1052
1145
|
key: 1,
|
|
1053
1146
|
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",
|
|
@@ -1073,7 +1166,7 @@ var Te = ["data-tpl-theme"], Ee = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, De
|
|
|
1073
1166
|
}), p(" " + D(k(r).mediaLibrary.frequentlyUsed), 1)], 4)) : u("", !0)
|
|
1074
1167
|
]));
|
|
1075
1168
|
}
|
|
1076
|
-
}),
|
|
1169
|
+
}), Tt = { class: "tpl:flex tpl:aspect-square tpl:flex-col tpl:items-center tpl:justify-center tpl:gap-2" }, Et = /* @__PURE__ */ h({
|
|
1077
1170
|
__name: "MediaFileIcon",
|
|
1078
1171
|
props: { mimeType: {} },
|
|
1079
1172
|
setup(e) {
|
|
@@ -1174,7 +1267,7 @@ var Te = ["data-tpl-theme"], Ee = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, De
|
|
|
1174
1267
|
bgColor: "#f9fafb",
|
|
1175
1268
|
icon: "document"
|
|
1176
1269
|
}, i = s(() => n[t.mimeType] ?? r);
|
|
1177
|
-
return (e, t) => (S(), d("div",
|
|
1270
|
+
return (e, t) => (S(), d("div", Tt, [i.value.icon === "document" ? (S(), d("svg", {
|
|
1178
1271
|
key: 0,
|
|
1179
1272
|
width: "60",
|
|
1180
1273
|
height: "60",
|
|
@@ -1243,48 +1336,48 @@ var Te = ["data-tpl-theme"], Ee = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, De
|
|
|
1243
1336
|
style: b({ color: i.value.color })
|
|
1244
1337
|
}, D(i.value.label), 5)]));
|
|
1245
1338
|
}
|
|
1246
|
-
}),
|
|
1339
|
+
}), Dt = { class: "tpl:p-4" }, Ot = {
|
|
1247
1340
|
key: 1,
|
|
1248
1341
|
class: "tpl:flex tpl:flex-col tpl:items-center tpl:justify-center tpl:py-16"
|
|
1249
|
-
},
|
|
1342
|
+
}, kt = {
|
|
1250
1343
|
class: "tpl:text-xs",
|
|
1251
1344
|
style: { color: "var(--tpl-text-muted)" }
|
|
1252
|
-
},
|
|
1345
|
+
}, At = {
|
|
1253
1346
|
key: 2,
|
|
1254
1347
|
class: "tpl:grid tpl:grid-cols-4 tpl:gap-3"
|
|
1255
|
-
},
|
|
1348
|
+
}, jt = ["onClick"], Mt = { class: "tpl:aspect-square" }, Nt = ["src", "alt"], Pt = { class: "tpl:px-2 tpl:py-1.5" }, Ft = {
|
|
1256
1349
|
class: "tpl:truncate tpl:text-[10px] tpl:font-medium",
|
|
1257
1350
|
style: { color: "var(--tpl-text)" }
|
|
1258
|
-
},
|
|
1351
|
+
}, It = {
|
|
1259
1352
|
class: "tpl:flex tpl:justify-between tpl:text-[9px]",
|
|
1260
1353
|
style: { color: "var(--tpl-text-muted)" }
|
|
1261
|
-
},
|
|
1354
|
+
}, Lt = { key: 0 }, Rt = { 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" }, zt = ["title", "onClick"], Bt = ["title", "onClick"], Vt = {
|
|
1262
1355
|
key: 0,
|
|
1263
1356
|
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",
|
|
1264
1357
|
style: { "background-color": "var(--tpl-primary)" }
|
|
1265
|
-
},
|
|
1358
|
+
}, Ht = {
|
|
1266
1359
|
key: 3,
|
|
1267
1360
|
class: "tpl:flex tpl:flex-col tpl:gap-1"
|
|
1268
|
-
},
|
|
1361
|
+
}, Ut = ["onClick"], Wt = {
|
|
1269
1362
|
class: "tpl:size-10 tpl:shrink-0 tpl:overflow-hidden tpl:rounded",
|
|
1270
1363
|
style: { "background-color": "var(--tpl-bg-hover)" }
|
|
1271
|
-
},
|
|
1364
|
+
}, Gt = ["src", "alt"], Kt = {
|
|
1272
1365
|
key: 1,
|
|
1273
1366
|
class: "tpl-list-icon tpl:size-full"
|
|
1274
|
-
},
|
|
1367
|
+
}, qt = { class: "tpl:min-w-0 tpl:flex-1" }, Jt = {
|
|
1275
1368
|
class: "tpl:truncate tpl:text-xs tpl:font-medium",
|
|
1276
1369
|
style: { color: "var(--tpl-text)" }
|
|
1277
|
-
},
|
|
1370
|
+
}, Yt = {
|
|
1278
1371
|
class: "tpl:text-[10px]",
|
|
1279
1372
|
style: { color: "var(--tpl-text-muted)" }
|
|
1280
|
-
},
|
|
1373
|
+
}, Xt = { class: "tpl:flex tpl:gap-1 tpl:opacity-0 tpl:transition-opacity tpl:duration-150 tpl:group-hover:opacity-100" }, Zt = ["title", "onClick"], Qt = ["title", "onClick"], $t = {
|
|
1281
1374
|
key: 0,
|
|
1282
1375
|
class: "tpl:flex tpl:size-5 tpl:shrink-0 tpl:items-center tpl:justify-center tpl:rounded-full tpl:text-white",
|
|
1283
1376
|
style: { "background-color": "var(--tpl-primary)" }
|
|
1284
|
-
},
|
|
1377
|
+
}, en = {
|
|
1285
1378
|
key: 4,
|
|
1286
1379
|
class: "tpl:flex tpl:justify-center tpl:py-4"
|
|
1287
|
-
},
|
|
1380
|
+
}, tn = /*#__PURE__*/ dt(/* @__PURE__ */ h({
|
|
1288
1381
|
__name: "MediaGrid",
|
|
1289
1382
|
props: {
|
|
1290
1383
|
items: {},
|
|
@@ -1323,7 +1416,7 @@ var Te = ["data-tpl-theme"], Ee = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, De
|
|
|
1323
1416
|
day: "numeric"
|
|
1324
1417
|
});
|
|
1325
1418
|
}
|
|
1326
|
-
return (t, n) => (S(), d("div",
|
|
1419
|
+
return (t, n) => (S(), d("div", Dt, [
|
|
1327
1420
|
e.isLoading && e.items.length === 0 ? (S(), d("div", {
|
|
1328
1421
|
key: 0,
|
|
1329
1422
|
class: y(e.layout === "list" ? "tpl:flex tpl:flex-col tpl:gap-1" : "tpl:grid tpl:grid-cols-4 tpl:gap-3")
|
|
@@ -1331,26 +1424,26 @@ var Te = ["data-tpl-theme"], Ee = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, De
|
|
|
1331
1424
|
key: t,
|
|
1332
1425
|
class: y(["tpl-pulse tpl:rounded-lg", e.layout === "list" ? "tpl:h-12" : "tpl:aspect-square"]),
|
|
1333
1426
|
style: { "background-color": "var(--tpl-bg-hover)" }
|
|
1334
|
-
}, null, 2)), 64))], 2)) : e.items.length === 0 ? (S(), d("div",
|
|
1427
|
+
}, null, 2)), 64))], 2)) : e.items.length === 0 ? (S(), d("div", Ot, [m(k(z), {
|
|
1335
1428
|
class: "tpl:mb-3",
|
|
1336
1429
|
size: 40,
|
|
1337
1430
|
"stroke-width": 1,
|
|
1338
1431
|
style: { color: "var(--tpl-text-dim)" }
|
|
1339
|
-
}), f("p",
|
|
1432
|
+
}), f("p", kt, D(k(h).mediaLibrary.noFiles), 1)])) : e.layout === "list" ? (S(), d("div", Ht, [(S(!0), d(i, null, T(e.items, (t) => (S(), d("div", {
|
|
1340
1433
|
key: t.id,
|
|
1341
1434
|
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" : ""]]),
|
|
1342
1435
|
style: b({ backgroundColor: e.selectedIds.has(t.id) ? "var(--tpl-bg-hover)" : "transparent" }),
|
|
1343
1436
|
onClick: (e) => c(t)
|
|
1344
1437
|
}, [
|
|
1345
|
-
f("div",
|
|
1438
|
+
f("div", Wt, [k(o)(t.mime_type) ? (S(), d("img", {
|
|
1346
1439
|
key: 0,
|
|
1347
1440
|
src: t.small_url || t.url,
|
|
1348
1441
|
alt: t.filename,
|
|
1349
1442
|
class: "tpl:size-full tpl:object-cover",
|
|
1350
1443
|
loading: "lazy"
|
|
1351
|
-
}, null, 8,
|
|
1352
|
-
f("div",
|
|
1353
|
-
f("div",
|
|
1444
|
+
}, null, 8, Gt)) : (S(), d("div", Kt, [m(Et, { "mime-type": t.mime_type }, null, 8, ["mime-type"])]))]),
|
|
1445
|
+
f("div", qt, [f("p", Jt, D(t.filename), 1), f("p", Yt, [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)])]),
|
|
1446
|
+
f("div", Xt, [f("button", {
|
|
1354
1447
|
class: "tpl:flex tpl:size-6 tpl:shrink-0 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded",
|
|
1355
1448
|
style: { color: "var(--tpl-text-muted)" },
|
|
1356
1449
|
title: k(h).mediaLibrary.editFile,
|
|
@@ -1358,7 +1451,7 @@ var Te = ["data-tpl-theme"], Ee = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, De
|
|
|
1358
1451
|
}, [m(k(K), {
|
|
1359
1452
|
size: 12,
|
|
1360
1453
|
"stroke-width": 2
|
|
1361
|
-
})], 8,
|
|
1454
|
+
})], 8, Zt), f("button", {
|
|
1362
1455
|
class: "tpl:flex tpl:size-6 tpl:shrink-0 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded",
|
|
1363
1456
|
style: { color: "var(--tpl-text-muted)" },
|
|
1364
1457
|
title: k(h).mediaLibrary.replaceFile,
|
|
@@ -1366,12 +1459,12 @@ var Te = ["data-tpl-theme"], Ee = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, De
|
|
|
1366
1459
|
}, [m(k(ee), {
|
|
1367
1460
|
size: 12,
|
|
1368
1461
|
"stroke-width": 2
|
|
1369
|
-
})], 8,
|
|
1370
|
-
e.selectedIds.has(t.id) ? (S(), d("div",
|
|
1462
|
+
})], 8, Qt)]),
|
|
1463
|
+
e.selectedIds.has(t.id) ? (S(), d("div", $t, [m(k(I), {
|
|
1371
1464
|
size: 12,
|
|
1372
1465
|
"stroke-width": 3
|
|
1373
1466
|
})])) : u("", !0)
|
|
1374
|
-
], 14,
|
|
1467
|
+
], 14, Ut))), 128))])) : (S(), d("div", At, [(S(!0), d(i, null, T(e.items, (t) => (S(), d("div", {
|
|
1375
1468
|
key: t.id,
|
|
1376
1469
|
class: y(["tpl-media-item tpl:group tpl:relative tpl:overflow-hidden tpl:rounded-lg tpl:border-2 tpl:transition-all tpl:duration-150", [
|
|
1377
1470
|
"tpl:cursor-pointer",
|
|
@@ -1384,18 +1477,18 @@ var Te = ["data-tpl-theme"], Ee = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, De
|
|
|
1384
1477
|
}),
|
|
1385
1478
|
onClick: (e) => c(t)
|
|
1386
1479
|
}, [
|
|
1387
|
-
f("div",
|
|
1480
|
+
f("div", Mt, [k(o)(t.mime_type) ? (S(), d("img", {
|
|
1388
1481
|
key: 0,
|
|
1389
1482
|
src: t.small_url || t.url,
|
|
1390
1483
|
alt: t.filename,
|
|
1391
1484
|
class: "tpl:size-full tpl:object-cover",
|
|
1392
1485
|
loading: "lazy"
|
|
1393
|
-
}, null, 8,
|
|
1486
|
+
}, null, 8, Nt)) : (S(), l(Et, {
|
|
1394
1487
|
key: 1,
|
|
1395
1488
|
"mime-type": t.mime_type
|
|
1396
1489
|
}, null, 8, ["mime-type"]))]),
|
|
1397
|
-
f("div",
|
|
1398
|
-
f("div",
|
|
1490
|
+
f("div", Pt, [f("p", Ft, D(t.filename), 1), f("p", It, [f("span", null, D(_(t.size)), 1), k(o)(t.mime_type) && t.width && t.height ? (S(), d("span", Lt, D(t.width) + "×" + D(t.height), 1)) : u("", !0)])]),
|
|
1491
|
+
f("div", Rt, [f("button", {
|
|
1399
1492
|
class: "tpl:flex tpl:size-6 tpl:items-center tpl:justify-center tpl:rounded-full tpl:text-white",
|
|
1400
1493
|
style: { "background-color": "rgba(0, 0, 0, 0.6)" },
|
|
1401
1494
|
title: k(h).mediaLibrary.editFile,
|
|
@@ -1403,7 +1496,7 @@ var Te = ["data-tpl-theme"], Ee = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, De
|
|
|
1403
1496
|
}, [m(k(K), {
|
|
1404
1497
|
size: 11,
|
|
1405
1498
|
"stroke-width": 2
|
|
1406
|
-
})], 8,
|
|
1499
|
+
})], 8, zt), f("button", {
|
|
1407
1500
|
class: "tpl:flex tpl:size-6 tpl:items-center tpl:justify-center tpl:rounded-full tpl:text-white",
|
|
1408
1501
|
style: { "background-color": "rgba(0, 0, 0, 0.6)" },
|
|
1409
1502
|
title: k(h).mediaLibrary.replaceFile,
|
|
@@ -1411,18 +1504,18 @@ var Te = ["data-tpl-theme"], Ee = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, De
|
|
|
1411
1504
|
}, [m(k(ee), {
|
|
1412
1505
|
size: 11,
|
|
1413
1506
|
"stroke-width": 2
|
|
1414
|
-
})], 8,
|
|
1415
|
-
e.selectedIds.has(t.id) ? (S(), d("div",
|
|
1507
|
+
})], 8, Bt)]),
|
|
1508
|
+
e.selectedIds.has(t.id) ? (S(), d("div", Vt, [m(k(I), {
|
|
1416
1509
|
size: 12,
|
|
1417
1510
|
"stroke-width": 3
|
|
1418
1511
|
})])) : u("", !0)
|
|
1419
|
-
], 14,
|
|
1512
|
+
], 14, jt))), 128))])),
|
|
1420
1513
|
f("div", {
|
|
1421
1514
|
ref_key: "sentinelRef",
|
|
1422
1515
|
ref: g,
|
|
1423
1516
|
class: "tpl:h-4"
|
|
1424
1517
|
}, null, 512),
|
|
1425
|
-
e.isLoading && e.items.length > 0 ? (S(), d("div",
|
|
1518
|
+
e.isLoading && e.items.length > 0 ? (S(), d("div", en, [m(k(W), {
|
|
1426
1519
|
class: "tpl-spinner",
|
|
1427
1520
|
size: 20,
|
|
1428
1521
|
"stroke-width": 2,
|
|
@@ -1430,20 +1523,20 @@ var Te = ["data-tpl-theme"], Ee = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, De
|
|
|
1430
1523
|
})])) : u("", !0)
|
|
1431
1524
|
]));
|
|
1432
1525
|
}
|
|
1433
|
-
}), [["__scopeId", "data-v-9db961d1"]]),
|
|
1526
|
+
}), [["__scopeId", "data-v-9db961d1"]]), nn = ["data-tpl-theme"], rn = {
|
|
1434
1527
|
class: "tpl:mx-4 tpl:w-full tpl:max-w-sm tpl:rounded-lg tpl:p-5 tpl:shadow-xl",
|
|
1435
1528
|
style: { "background-color": "var(--tpl-bg-elevated)" }
|
|
1436
|
-
},
|
|
1529
|
+
}, an = {
|
|
1437
1530
|
class: "tpl:mb-4 tpl:text-sm tpl:font-semibold",
|
|
1438
1531
|
style: { color: "var(--tpl-text)" }
|
|
1439
|
-
},
|
|
1532
|
+
}, on = { class: "tpl:mb-3" }, sn = ["placeholder", "disabled"], cn = {
|
|
1440
1533
|
key: 0,
|
|
1441
1534
|
class: "tpl:mb-3 tpl:text-xs",
|
|
1442
1535
|
style: { color: "var(--tpl-danger)" }
|
|
1443
|
-
},
|
|
1536
|
+
}, ln = { class: "tpl:flex tpl:justify-end tpl:gap-2" }, un = ["disabled"], dn = ["disabled"], fn = {
|
|
1444
1537
|
key: 0,
|
|
1445
1538
|
class: "tpl:flex tpl:items-center tpl:gap-1.5"
|
|
1446
|
-
},
|
|
1539
|
+
}, pn = { key: 1 }, mn = /* @__PURE__ */ h({
|
|
1447
1540
|
__name: "MediaImportUrlModal",
|
|
1448
1541
|
props: {
|
|
1449
1542
|
visible: { type: Boolean },
|
|
@@ -1452,7 +1545,7 @@ var Te = ["data-tpl-theme"], Ee = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, De
|
|
|
1452
1545
|
},
|
|
1453
1546
|
emits: ["import", "close"],
|
|
1454
1547
|
setup(e, { emit: t }) {
|
|
1455
|
-
let n = e, r = t, { t: i } = X(), s = _(
|
|
1548
|
+
let n = e, r = t, { t: i } = X(), s = _(ye, null), c = _(_e, w(null)), h = w("");
|
|
1456
1549
|
j(() => n.visible, (e) => {
|
|
1457
1550
|
e && (h.value = "");
|
|
1458
1551
|
});
|
|
@@ -1481,9 +1574,9 @@ var Te = ["data-tpl-theme"], Ee = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, De
|
|
|
1481
1574
|
style: { "background-color": "var(--tpl-overlay)" },
|
|
1482
1575
|
onClick: F(v, ["self"]),
|
|
1483
1576
|
onKeydown: b
|
|
1484
|
-
}, [f("div",
|
|
1485
|
-
f("h3",
|
|
1486
|
-
f("div",
|
|
1577
|
+
}, [f("div", rn, [
|
|
1578
|
+
f("h3", an, D(k(i).mediaLibrary.importFromUrl), 1),
|
|
1579
|
+
f("div", on, [N(f("input", {
|
|
1487
1580
|
"onUpdate:modelValue": n[0] ||= (e) => h.value = e,
|
|
1488
1581
|
type: "url",
|
|
1489
1582
|
class: "tpl:w-full tpl:rounded-md tpl:border tpl:px-3 tpl:py-1.5 tpl:text-xs tpl:outline-none",
|
|
@@ -1495,9 +1588,9 @@ var Te = ["data-tpl-theme"], Ee = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, De
|
|
|
1495
1588
|
placeholder: k(i).mediaLibrary.importUrlPlaceholder,
|
|
1496
1589
|
disabled: e.isImporting,
|
|
1497
1590
|
autofocus: ""
|
|
1498
|
-
}, null, 8,
|
|
1499
|
-
e.error ? (S(), d("p",
|
|
1500
|
-
f("div",
|
|
1591
|
+
}, null, 8, sn), [[A, h.value]])]),
|
|
1592
|
+
e.error ? (S(), d("p", cn, D(e.error), 1)) : u("", !0),
|
|
1593
|
+
f("div", ln, [f("button", {
|
|
1501
1594
|
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 }]),
|
|
1502
1595
|
style: {
|
|
1503
1596
|
"border-color": "var(--tpl-border)",
|
|
@@ -1506,25 +1599,25 @@ var Te = ["data-tpl-theme"], Ee = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, De
|
|
|
1506
1599
|
},
|
|
1507
1600
|
disabled: e.isImporting,
|
|
1508
1601
|
onClick: v
|
|
1509
|
-
}, D(k(i).mediaLibrary.cancel), 11,
|
|
1602
|
+
}, D(k(i).mediaLibrary.cancel), 11, un), f("button", {
|
|
1510
1603
|
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",
|
|
1511
1604
|
style: { background: "linear-gradient(\n 135deg,\n var(--tpl-primary),\n var(--tpl-primary-hover)\n )" },
|
|
1512
1605
|
disabled: !h.value.trim() || e.isImporting,
|
|
1513
1606
|
onClick: g
|
|
1514
|
-
}, [e.isImporting ? (S(), d("span",
|
|
1607
|
+
}, [e.isImporting ? (S(), d("span", fn, [m(k(W), {
|
|
1515
1608
|
class: "tpl:animate-spin",
|
|
1516
1609
|
size: 12,
|
|
1517
1610
|
"stroke-width": 2
|
|
1518
|
-
}), p(" " + D(k(i).mediaLibrary.importing), 1)])) : (S(), d("span",
|
|
1519
|
-
])], 40,
|
|
1611
|
+
}), p(" " + D(k(i).mediaLibrary.importing), 1)])) : (S(), d("span", pn, D(k(i).mediaLibrary.import), 1))], 8, dn)])
|
|
1612
|
+
])], 40, nn)) : u("", !0)]),
|
|
1520
1613
|
_: 1
|
|
1521
1614
|
})], 8, ["to"]));
|
|
1522
1615
|
}
|
|
1523
|
-
}),
|
|
1616
|
+
}), hn = { class: "tpl:max-h-56 tpl:overflow-y-auto tpl:py-1" }, gn = ["disabled", "onClick"], _n = { class: "tpl:truncate" }, vn = {
|
|
1524
1617
|
key: 0,
|
|
1525
1618
|
class: "tpl:shrink-0",
|
|
1526
1619
|
style: { color: "var(--tpl-text-dim)" }
|
|
1527
|
-
},
|
|
1620
|
+
}, yn = /* @__PURE__ */ h({
|
|
1528
1621
|
__name: "MediaMovePicker",
|
|
1529
1622
|
props: {
|
|
1530
1623
|
folders: {},
|
|
@@ -1552,7 +1645,7 @@ var Te = ["data-tpl-theme"], Ee = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, De
|
|
|
1552
1645
|
"border-color": "var(--tpl-border)",
|
|
1553
1646
|
"background-color": "var(--tpl-bg-elevated)"
|
|
1554
1647
|
}
|
|
1555
|
-
}, [f("div",
|
|
1648
|
+
}, [f("div", hn, [e.currentFolderId === null ? u("", !0) : (S(), d("button", {
|
|
1556
1649
|
key: 0,
|
|
1557
1650
|
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",
|
|
1558
1651
|
style: { color: "var(--tpl-text)" },
|
|
@@ -1577,27 +1670,27 @@ var Te = ["data-tpl-theme"], Ee = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, De
|
|
|
1577
1670
|
size: 14,
|
|
1578
1671
|
"stroke-width": 1.5
|
|
1579
1672
|
}),
|
|
1580
|
-
f("span",
|
|
1581
|
-
t.id === e.currentFolderId ? (S(), d("span",
|
|
1582
|
-
], 12,
|
|
1673
|
+
f("span", _n, D(t.name), 1),
|
|
1674
|
+
t.id === e.currentFolderId ? (S(), d("span", vn, D(k(r).mediaLibrary.currentFolder), 1)) : u("", !0)
|
|
1675
|
+
], 12, gn))), 128))])], 512));
|
|
1583
1676
|
}
|
|
1584
|
-
}),
|
|
1677
|
+
}), bn = { class: "tpl:flex tpl:items-center tpl:gap-3" }, xn = ["src", "alt"], Sn = {
|
|
1585
1678
|
key: 1,
|
|
1586
1679
|
class: "tpl:flex tpl:size-10 tpl:shrink-0 tpl:items-center tpl:justify-center tpl:overflow-hidden tpl:rounded",
|
|
1587
1680
|
style: { border: "1px solid var(--tpl-border)" }
|
|
1588
|
-
},
|
|
1681
|
+
}, Cn = { class: "tpl:min-w-0 tpl:flex-1" }, wn = {
|
|
1589
1682
|
class: "tpl:truncate tpl:text-xs tpl:font-medium",
|
|
1590
1683
|
style: { color: "var(--tpl-text)" }
|
|
1591
|
-
},
|
|
1684
|
+
}, Tn = {
|
|
1592
1685
|
class: "tpl:mt-0.5 tpl:text-[10px]",
|
|
1593
1686
|
style: { color: "var(--tpl-text-muted)" }
|
|
1594
|
-
},
|
|
1687
|
+
}, En = {
|
|
1595
1688
|
key: 2,
|
|
1596
1689
|
class: "tpl:shrink-0"
|
|
1597
|
-
},
|
|
1690
|
+
}, Dn = {
|
|
1598
1691
|
class: "tpl:block tpl:text-[10px]",
|
|
1599
1692
|
style: { color: "var(--tpl-text-muted)" }
|
|
1600
|
-
},
|
|
1693
|
+
}, On = ["value"], kn = ["value"], An = /*#__PURE__*/ dt(/* @__PURE__ */ h({
|
|
1601
1694
|
__name: "MediaPreviewPanel",
|
|
1602
1695
|
props: {
|
|
1603
1696
|
item: {},
|
|
@@ -1665,20 +1758,20 @@ var Te = ["data-tpl-theme"], Ee = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, De
|
|
|
1665
1758
|
day: "numeric"
|
|
1666
1759
|
});
|
|
1667
1760
|
}
|
|
1668
|
-
return (t, n) => (S(), d("div",
|
|
1761
|
+
return (t, n) => (S(), d("div", bn, [
|
|
1669
1762
|
b.value ? (S(), d("img", {
|
|
1670
1763
|
key: 0,
|
|
1671
1764
|
src: h.value ?? void 0,
|
|
1672
1765
|
alt: e.item.alt_text || e.item.filename,
|
|
1673
1766
|
class: "tpl:size-10 tpl:shrink-0 tpl:rounded tpl:object-cover",
|
|
1674
1767
|
style: { border: "1px solid var(--tpl-border)" }
|
|
1675
|
-
}, null, 8,
|
|
1768
|
+
}, null, 8, xn)) : (S(), d("div", Sn, [m(Et, {
|
|
1676
1769
|
"mime-type": e.item.mime_type,
|
|
1677
1770
|
class: "tpl-preview-icon"
|
|
1678
1771
|
}, null, 8, ["mime-type"])])),
|
|
1679
|
-
f("div",
|
|
1680
|
-
f("p",
|
|
1681
|
-
f("p",
|
|
1772
|
+
f("div", Cn, [
|
|
1773
|
+
f("p", wn, D(e.item.filename), 1),
|
|
1774
|
+
f("p", Tn, [
|
|
1682
1775
|
p(D(x(e.item.size)) + " · " + D(C(e.item.created_at)) + " ", 1),
|
|
1683
1776
|
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),
|
|
1684
1777
|
v.value ? (S(), d(i, { key: 1 }, [
|
|
@@ -1697,7 +1790,7 @@ var Te = ["data-tpl-theme"], Ee = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, De
|
|
|
1697
1790
|
style: { color: "var(--tpl-text-dim)" }
|
|
1698
1791
|
}, D(e.item.alt_text || "\xA0"), 3)) : u("", !0)
|
|
1699
1792
|
]),
|
|
1700
|
-
l.value ? (S(), d("div",
|
|
1793
|
+
l.value ? (S(), d("div", En, [f("label", Dn, D(k(a).mediaLibrary.conversionLabel), 1), f("select", {
|
|
1701
1794
|
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",
|
|
1702
1795
|
style: {
|
|
1703
1796
|
"border-color": "var(--tpl-border)",
|
|
@@ -1709,36 +1802,36 @@ var Te = ["data-tpl-theme"], Ee = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, De
|
|
|
1709
1802
|
}, [(S(!0), d(i, null, T(c.value, (e) => (S(), d("option", {
|
|
1710
1803
|
key: e.value,
|
|
1711
1804
|
value: e.value
|
|
1712
|
-
}, D(e.label), 9,
|
|
1805
|
+
}, D(e.label), 9, kn))), 128))], 40, On)])) : u("", !0)
|
|
1713
1806
|
]));
|
|
1714
1807
|
}
|
|
1715
|
-
}), [["__scopeId", "data-v-060e36cd"]]),
|
|
1808
|
+
}), [["__scopeId", "data-v-060e36cd"]]), jn = ["data-tpl-theme"], Mn = {
|
|
1716
1809
|
class: "tpl:mx-4 tpl:w-full tpl:max-w-sm tpl:rounded-lg tpl:p-5 tpl:shadow-xl",
|
|
1717
1810
|
style: { "background-color": "var(--tpl-bg-elevated)" }
|
|
1718
|
-
},
|
|
1811
|
+
}, Nn = {
|
|
1719
1812
|
class: "tpl:mb-2 tpl:text-sm tpl:font-semibold",
|
|
1720
1813
|
style: { color: "var(--tpl-text)" }
|
|
1721
|
-
},
|
|
1814
|
+
}, Pn = {
|
|
1722
1815
|
class: "tpl:mb-2 tpl:text-xs",
|
|
1723
1816
|
style: { color: "var(--tpl-text-muted)" }
|
|
1724
|
-
},
|
|
1817
|
+
}, Fn = {
|
|
1725
1818
|
key: 0,
|
|
1726
1819
|
class: "tpl:mb-3 tpl:text-xs",
|
|
1727
1820
|
style: { color: "var(--tpl-warning)" }
|
|
1728
|
-
},
|
|
1821
|
+
}, In = {
|
|
1729
1822
|
class: "tpl:mb-3 tpl:rounded tpl:border tpl:p-2",
|
|
1730
1823
|
style: { "border-color": "var(--tpl-border)" }
|
|
1731
|
-
},
|
|
1824
|
+
}, Ln = {
|
|
1732
1825
|
class: "tpl:truncate tpl:text-xs tpl:font-medium",
|
|
1733
1826
|
style: { color: "var(--tpl-text)" }
|
|
1734
|
-
},
|
|
1827
|
+
}, Rn = { class: "tpl:mb-4" }, zn = {
|
|
1735
1828
|
class: "tpl:mb-1 tpl:block tpl:text-xs tpl:font-medium",
|
|
1736
1829
|
style: { color: "var(--tpl-text-muted)" }
|
|
1737
|
-
},
|
|
1830
|
+
}, Bn = ["accept"], Vn = {
|
|
1738
1831
|
key: 1,
|
|
1739
1832
|
class: "tpl:mb-3 tpl:text-xs",
|
|
1740
1833
|
style: { color: "var(--tpl-danger)" }
|
|
1741
|
-
},
|
|
1834
|
+
}, Hn = { class: "tpl:flex tpl:justify-end tpl:gap-2" }, Un = ["disabled"], Wn = ["disabled"], Gn = /* @__PURE__ */ h({
|
|
1742
1835
|
__name: "MediaReplaceModal",
|
|
1743
1836
|
props: {
|
|
1744
1837
|
visible: { type: Boolean },
|
|
@@ -1749,7 +1842,7 @@ var Te = ["data-tpl-theme"], Ee = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, De
|
|
|
1749
1842
|
},
|
|
1750
1843
|
emits: ["replace", "close"],
|
|
1751
1844
|
setup(e, { emit: t }) {
|
|
1752
|
-
let n = e, r = t, { t: i } = X(), c = _(
|
|
1845
|
+
let n = e, r = t, { t: i } = X(), c = _(ye, null), p = _(_e, w(null)), h = w(null), g = w(null), v = s(() => {
|
|
1753
1846
|
if (!n.item) return "";
|
|
1754
1847
|
let e = n.item.filename.split(".");
|
|
1755
1848
|
return e.length > 1 ? e[e.length - 1].toLowerCase() : "";
|
|
@@ -1782,12 +1875,12 @@ var Te = ["data-tpl-theme"], Ee = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, De
|
|
|
1782
1875
|
style: { "background-color": "var(--tpl-overlay)" },
|
|
1783
1876
|
onClick: n[1] ||= F((e) => r("close"), ["self"]),
|
|
1784
1877
|
onKeydown: T
|
|
1785
|
-
}, [f("div",
|
|
1786
|
-
f("h3",
|
|
1787
|
-
f("p",
|
|
1788
|
-
b.value ? (S(), d("p",
|
|
1789
|
-
f("div",
|
|
1790
|
-
f("div",
|
|
1878
|
+
}, [f("div", Mn, [
|
|
1879
|
+
f("h3", Nn, D(k(i).mediaLibrary.replaceWarningTitle), 1),
|
|
1880
|
+
f("p", Pn, D(k(i).mediaLibrary.replaceWarningMessage.replace("{extension}", `.${v.value}`)), 1),
|
|
1881
|
+
b.value ? (S(), d("p", Fn, D(k(i).mediaLibrary.replaceWarningUsageNote.replace("{count}", e.usageInfo.template_count.toString())), 1)) : u("", !0),
|
|
1882
|
+
f("div", In, [f("p", Ln, D(e.item.filename), 1)]),
|
|
1883
|
+
f("div", Rn, [f("label", zn, D(k(i).mediaLibrary.replaceSelectFile), 1), f("input", {
|
|
1791
1884
|
ref_key: "fileInputRef",
|
|
1792
1885
|
ref: h,
|
|
1793
1886
|
type: "file",
|
|
@@ -1799,9 +1892,9 @@ var Te = ["data-tpl-theme"], Ee = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, De
|
|
|
1799
1892
|
color: "var(--tpl-text)"
|
|
1800
1893
|
},
|
|
1801
1894
|
onChange: x
|
|
1802
|
-
}, null, 40,
|
|
1803
|
-
e.error ? (S(), d("p",
|
|
1804
|
-
f("div",
|
|
1895
|
+
}, null, 40, Bn)]),
|
|
1896
|
+
e.error ? (S(), d("p", Vn, D(e.error), 1)) : u("", !0),
|
|
1897
|
+
f("div", Hn, [f("button", {
|
|
1805
1898
|
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",
|
|
1806
1899
|
style: {
|
|
1807
1900
|
"border-color": "var(--tpl-border)",
|
|
@@ -1810,29 +1903,29 @@ var Te = ["data-tpl-theme"], Ee = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, De
|
|
|
1810
1903
|
},
|
|
1811
1904
|
disabled: e.isReplacing,
|
|
1812
1905
|
onClick: n[0] ||= (e) => r("close")
|
|
1813
|
-
}, D(k(i).mediaLibrary.cancel), 9,
|
|
1906
|
+
}, D(k(i).mediaLibrary.cancel), 9, Un), f("button", {
|
|
1814
1907
|
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",
|
|
1815
1908
|
style: { background: "linear-gradient(\n 135deg,\n var(--tpl-primary),\n var(--tpl-primary-hover)\n )" },
|
|
1816
1909
|
disabled: !g.value || e.isReplacing,
|
|
1817
1910
|
onClick: C
|
|
1818
|
-
}, D(e.isReplacing ? k(i).mediaLibrary.replacing : k(i).mediaLibrary.replace), 9,
|
|
1819
|
-
])], 40,
|
|
1911
|
+
}, D(e.isReplacing ? k(i).mediaLibrary.replacing : k(i).mediaLibrary.replace), 9, Wn)])
|
|
1912
|
+
])], 40, jn)) : u("", !0)]),
|
|
1820
1913
|
_: 1
|
|
1821
1914
|
})], 8, ["to"]));
|
|
1822
1915
|
}
|
|
1823
|
-
}),
|
|
1916
|
+
}), Kn = {
|
|
1824
1917
|
key: 0,
|
|
1825
1918
|
class: "tpl:flex tpl:items-center tpl:gap-2"
|
|
1826
|
-
},
|
|
1919
|
+
}, qn = {
|
|
1827
1920
|
class: "tpl:text-xs",
|
|
1828
1921
|
style: { color: "var(--tpl-text-muted)" }
|
|
1829
|
-
},
|
|
1922
|
+
}, Jn = {
|
|
1830
1923
|
class: "tpl:text-xs",
|
|
1831
1924
|
style: { color: "var(--tpl-text-muted)" }
|
|
1832
|
-
},
|
|
1925
|
+
}, Yn = {
|
|
1833
1926
|
class: "tpl:mt-1 tpl:text-[10px]",
|
|
1834
1927
|
style: { color: "var(--tpl-text-dim)" }
|
|
1835
|
-
},
|
|
1928
|
+
}, Xn = /* @__PURE__ */ h({
|
|
1836
1929
|
__name: "MediaUploadZone",
|
|
1837
1930
|
props: {
|
|
1838
1931
|
isUploading: { type: Boolean },
|
|
@@ -1867,12 +1960,12 @@ var Te = ["data-tpl-theme"], Ee = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, De
|
|
|
1867
1960
|
"background-color": "var(--tpl-bg)"
|
|
1868
1961
|
},
|
|
1869
1962
|
onClick: n[0] ||= (e) => k(g)()
|
|
1870
|
-
}, [e.isUploading ? (S(), d("div",
|
|
1963
|
+
}, [e.isUploading ? (S(), d("div", Kn, [m(k(W), {
|
|
1871
1964
|
class: "tpl-spinner",
|
|
1872
1965
|
size: 20,
|
|
1873
1966
|
"stroke-width": 2,
|
|
1874
1967
|
style: { color: "var(--tpl-primary)" }
|
|
1875
|
-
}), f("span",
|
|
1968
|
+
}), f("span", qn, D(e.uploadProgress && e.uploadProgress.total > 1 ? k(a)(k(r).mediaLibrary.uploadingProgress, {
|
|
1876
1969
|
current: e.uploadProgress.current,
|
|
1877
1970
|
total: e.uploadProgress.total
|
|
1878
1971
|
}) : k(r).mediaLibrary.uploading), 1)])) : (S(), d(i, { key: 1 }, [
|
|
@@ -1882,20 +1975,20 @@ var Te = ["data-tpl-theme"], Ee = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, De
|
|
|
1882
1975
|
"stroke-width": 1.5,
|
|
1883
1976
|
style: { color: "var(--tpl-text-dim)" }
|
|
1884
1977
|
}),
|
|
1885
|
-
f("p",
|
|
1886
|
-
f("p",
|
|
1978
|
+
f("p", Jn, D(k(r).mediaLibrary.dropOrClick), 1),
|
|
1979
|
+
f("p", Yn, D(k(r).mediaLibrary.acceptedFormats), 1)
|
|
1887
1980
|
], 64))], 2));
|
|
1888
1981
|
}
|
|
1889
|
-
}),
|
|
1982
|
+
}), Zn = [
|
|
1890
1983
|
"width",
|
|
1891
1984
|
"height",
|
|
1892
1985
|
"viewBox"
|
|
1893
|
-
],
|
|
1986
|
+
], Qn = [
|
|
1894
1987
|
"cx",
|
|
1895
1988
|
"cy",
|
|
1896
1989
|
"r",
|
|
1897
1990
|
"stroke-width"
|
|
1898
|
-
],
|
|
1991
|
+
], $n = [
|
|
1899
1992
|
"cx",
|
|
1900
1993
|
"cy",
|
|
1901
1994
|
"r",
|
|
@@ -1903,14 +1996,14 @@ var Te = ["data-tpl-theme"], Ee = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, De
|
|
|
1903
1996
|
"stroke",
|
|
1904
1997
|
"stroke-dasharray",
|
|
1905
1998
|
"stroke-dashoffset"
|
|
1906
|
-
],
|
|
1999
|
+
], er = {
|
|
1907
2000
|
key: 0,
|
|
1908
2001
|
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",
|
|
1909
2002
|
style: {
|
|
1910
2003
|
"background-color": "var(--tpl-text)",
|
|
1911
2004
|
color: "var(--tpl-bg-elevated)"
|
|
1912
2005
|
}
|
|
1913
|
-
},
|
|
2006
|
+
}, tr = /* @__PURE__ */ h({
|
|
1914
2007
|
__name: "StorageProgressRing",
|
|
1915
2008
|
props: {
|
|
1916
2009
|
usedBytes: {},
|
|
@@ -1950,7 +2043,7 @@ var Te = ["data-tpl-theme"], Ee = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, De
|
|
|
1950
2043
|
fill: "none",
|
|
1951
2044
|
"stroke-width": c.value,
|
|
1952
2045
|
style: { stroke: "var(--tpl-border)" }
|
|
1953
|
-
}, null, 8,
|
|
2046
|
+
}, null, 8, Qn), f("circle", {
|
|
1954
2047
|
cx: a.value / 2,
|
|
1955
2048
|
cy: a.value / 2,
|
|
1956
2049
|
r: l.value,
|
|
@@ -1961,7 +2054,7 @@ var Te = ["data-tpl-theme"], Ee = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, De
|
|
|
1961
2054
|
"stroke-dasharray": h.value,
|
|
1962
2055
|
"stroke-dashoffset": _.value,
|
|
1963
2056
|
class: "tpl:transition-all tpl:duration-300 tpl:ease-out"
|
|
1964
|
-
}, null, 8,
|
|
2057
|
+
}, null, 8, $n)], 8, Zn)), m(o, {
|
|
1965
2058
|
"enter-active-class": "tpl:transition tpl:ease-out tpl:duration-150",
|
|
1966
2059
|
"enter-from-class": "tpl:opacity-0 tpl:translate-y-1",
|
|
1967
2060
|
"enter-to-class": "tpl:opacity-100 tpl:translate-y-0",
|
|
@@ -1969,7 +2062,7 @@ var Te = ["data-tpl-theme"], Ee = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, De
|
|
|
1969
2062
|
"leave-from-class": "tpl:opacity-100 tpl:translate-y-0",
|
|
1970
2063
|
"leave-to-class": "tpl:opacity-0 tpl:translate-y-1"
|
|
1971
2064
|
}, {
|
|
1972
|
-
default: M(() => [i.value ? (S(), d("div",
|
|
2065
|
+
default: M(() => [i.value ? (S(), d("div", er, [p(D(E.value) + " ", 1), t[2] ||= f("div", {
|
|
1973
2066
|
class: "tpl:absolute tpl:-top-1 tpl:left-1/2 tpl:size-2 tpl:-translate-x-1/2 tpl:rotate-45",
|
|
1974
2067
|
style: { "background-color": "var(--tpl-text)" }
|
|
1975
2068
|
}, null, -1)])) : u("", !0)]),
|
|
@@ -1979,7 +2072,7 @@ var Te = ["data-tpl-theme"], Ee = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, De
|
|
|
1979
2072
|
});
|
|
1980
2073
|
//#endregion
|
|
1981
2074
|
//#region src/composables/useMediaLibraryUI.ts
|
|
1982
|
-
function
|
|
2075
|
+
function nr(e) {
|
|
1983
2076
|
let { library: t, translations: n } = e;
|
|
1984
2077
|
function r() {
|
|
1985
2078
|
return "value" in n && typeof n.value == "object" ? n.value : n;
|
|
@@ -2088,8 +2181,40 @@ function Xn(e) {
|
|
|
2088
2181
|
};
|
|
2089
2182
|
}
|
|
2090
2183
|
//#endregion
|
|
2184
|
+
//#region src/i18n/index.ts
|
|
2185
|
+
var rr = /* #__PURE__ */ Object.assign({
|
|
2186
|
+
"./locales/ca.ts": () => import("./ca-DnghH5Xn.js"),
|
|
2187
|
+
"./locales/de.ts": () => import("./de-ByQyu2jv.js"),
|
|
2188
|
+
"./locales/en.ts": () => Promise.resolve().then(() => be),
|
|
2189
|
+
"./locales/es.ts": () => import("./es-Bcp-DbmC.js"),
|
|
2190
|
+
"./locales/fr.ts": () => import("./fr-DXb0cCZG.js"),
|
|
2191
|
+
"./locales/nl.ts": () => import("./nl-DGT1t3Be.js"),
|
|
2192
|
+
"./locales/pt-BR.ts": () => import("./pt-BR-C0Hzc26R.js")
|
|
2193
|
+
});
|
|
2194
|
+
function ir(e) {
|
|
2195
|
+
return Object.keys(e).map((e) => e.match(/\/([^/]+)\.ts$/)?.[1]).filter((e) => !!e);
|
|
2196
|
+
}
|
|
2197
|
+
var ar = ir(rr);
|
|
2198
|
+
function or(e) {
|
|
2199
|
+
return e.trim().replace(/_/g, "-").toLowerCase();
|
|
2200
|
+
}
|
|
2201
|
+
function sr(e) {
|
|
2202
|
+
let t = or(e);
|
|
2203
|
+
return ar.find((e) => or(e) === t);
|
|
2204
|
+
}
|
|
2205
|
+
function cr(e) {
|
|
2206
|
+
return or(e).split("-")[0];
|
|
2207
|
+
}
|
|
2208
|
+
function lr(e) {
|
|
2209
|
+
return sr(e) ?? sr(cr(e)) ?? "en";
|
|
2210
|
+
}
|
|
2211
|
+
async function ur(e) {
|
|
2212
|
+
let t = rr[`./locales/${lr(e)}.ts`];
|
|
2213
|
+
return (await t()).default;
|
|
2214
|
+
}
|
|
2215
|
+
//#endregion
|
|
2091
2216
|
//#region src/components/MediaLibraryModal.vue?vue&type=script&setup=true&lang.ts
|
|
2092
|
-
var
|
|
2217
|
+
var dr = ["data-tpl-theme"], fr = {
|
|
2093
2218
|
class: "tpl-media-modal tpl-scale-in tpl:flex tpl:flex-col tpl:overflow-hidden tpl:rounded-[var(--tpl-radius-lg)]",
|
|
2094
2219
|
style: {
|
|
2095
2220
|
width: "900px",
|
|
@@ -2100,59 +2225,59 @@ var Zn = ["data-tpl-theme"], Qn = {
|
|
|
2100
2225
|
border: "1px solid var(--tpl-border)",
|
|
2101
2226
|
"box-shadow": "var(--tpl-shadow-xl)"
|
|
2102
2227
|
}
|
|
2103
|
-
},
|
|
2228
|
+
}, pr = {
|
|
2104
2229
|
class: "tpl:flex tpl:shrink-0 tpl:items-center tpl:justify-between tpl:border-b tpl:px-5 tpl:py-3.5",
|
|
2105
2230
|
style: { "border-color": "var(--tpl-border)" }
|
|
2106
|
-
},
|
|
2231
|
+
}, mr = {
|
|
2107
2232
|
class: "tpl:text-sm tpl:font-semibold",
|
|
2108
2233
|
style: { color: "var(--tpl-text)" }
|
|
2109
|
-
},
|
|
2234
|
+
}, hr = { class: "tpl:flex tpl:items-center tpl:gap-3" }, gr = { class: "tpl:relative" }, _r = ["value", "placeholder"], vr = { class: "tpl:flex tpl:min-h-0 tpl:flex-1 tpl:overflow-hidden" }, yr = {
|
|
2110
2235
|
key: 0,
|
|
2111
2236
|
class: "tpl:flex tpl:w-48 tpl:shrink-0 tpl:flex-col tpl:border-r",
|
|
2112
2237
|
style: {
|
|
2113
2238
|
"border-color": "var(--tpl-border)",
|
|
2114
2239
|
"background-color": "var(--tpl-bg)"
|
|
2115
2240
|
}
|
|
2116
|
-
},
|
|
2241
|
+
}, br = { class: "tpl:flex tpl:min-w-0 tpl:flex-1 tpl:flex-col" }, xr = {
|
|
2117
2242
|
class: "tpl:flex tpl:shrink-0 tpl:items-center tpl:justify-between tpl:border-b tpl:px-4 tpl:py-2.5",
|
|
2118
2243
|
style: { "border-color": "var(--tpl-border)" }
|
|
2119
|
-
},
|
|
2244
|
+
}, Sr = { class: "tpl:flex tpl:items-center tpl:gap-2" }, Cr = ["title"], wr = {
|
|
2120
2245
|
key: 0,
|
|
2121
2246
|
class: "tpl:text-xs tpl:font-medium",
|
|
2122
2247
|
style: { color: "var(--tpl-text)" }
|
|
2123
|
-
},
|
|
2248
|
+
}, Tr = {
|
|
2124
2249
|
class: "tpl:flex tpl:rounded-md tpl:p-0.5",
|
|
2125
2250
|
style: {
|
|
2126
2251
|
border: "1px solid var(--tpl-border)",
|
|
2127
2252
|
"background-color": "var(--tpl-bg)"
|
|
2128
2253
|
}
|
|
2129
|
-
},
|
|
2254
|
+
}, Er = ["title"], Dr = ["title"], Or = { class: "tpl:flex tpl:items-center tpl:gap-2" }, kr = ["value"], Ar = { value: "" }, jr = ["value"], Mr = ["value"], Nr = { value: "newest" }, Pr = { value: "oldest" }, Fr = { value: "name_asc" }, Ir = { value: "name_desc" }, Lr = { value: "size_asc" }, Rr = { value: "size_desc" }, zr = { class: "tpl:min-h-0 tpl:flex-1 tpl:overflow-y-auto" }, Br = {
|
|
2130
2255
|
key: 0,
|
|
2131
2256
|
class: "tpl:px-4 tpl:pt-3"
|
|
2132
|
-
},
|
|
2257
|
+
}, Vr = {
|
|
2133
2258
|
class: "tpl-scale-in tpl:mx-4 tpl:w-full tpl:max-w-sm tpl:rounded-[var(--tpl-radius-lg)] tpl:p-5",
|
|
2134
2259
|
style: {
|
|
2135
2260
|
"background-color": "var(--tpl-bg-elevated)",
|
|
2136
2261
|
"box-shadow": "var(--tpl-shadow-xl)"
|
|
2137
2262
|
}
|
|
2138
|
-
},
|
|
2263
|
+
}, Hr = {
|
|
2139
2264
|
class: "tpl:mb-2 tpl:text-sm tpl:font-semibold",
|
|
2140
2265
|
style: { color: "var(--tpl-text)" }
|
|
2141
|
-
},
|
|
2266
|
+
}, Ur = {
|
|
2142
2267
|
key: 0,
|
|
2143
2268
|
class: "tpl:mb-4 tpl:text-xs",
|
|
2144
2269
|
style: { color: "var(--tpl-text-muted)" }
|
|
2145
|
-
},
|
|
2270
|
+
}, Wr = {
|
|
2146
2271
|
key: 1,
|
|
2147
2272
|
class: "tpl:mb-4 tpl:max-h-32 tpl:overflow-y-auto tpl:rounded tpl:border tpl:p-2",
|
|
2148
2273
|
style: { "border-color": "var(--tpl-border)" }
|
|
2149
|
-
},
|
|
2274
|
+
}, Gr = { class: "tpl:font-medium" }, Kr = { style: { color: "var(--tpl-text-muted)" } }, qr = { class: "tpl:flex tpl:justify-end tpl:gap-2" }, Jr = {
|
|
2150
2275
|
class: "tpl:flex tpl:shrink-0 tpl:items-center tpl:justify-between tpl:border-t tpl:px-5 tpl:py-3",
|
|
2151
2276
|
style: { "border-color": "var(--tpl-border)" }
|
|
2152
|
-
},
|
|
2277
|
+
}, Yr = { class: "tpl:flex tpl:min-w-0 tpl:flex-1 tpl:items-center tpl:gap-3" }, Xr = { class: "tpl:flex tpl:items-center tpl:gap-5" }, Zr = {
|
|
2153
2278
|
key: 0,
|
|
2154
2279
|
class: "tpl:flex tpl:items-center tpl:gap-2"
|
|
2155
|
-
},
|
|
2280
|
+
}, Qr = { class: "tpl:relative" }, $r = { class: "tpl:flex tpl:items-center tpl:gap-2" }, ei = ["disabled"], ti = /* @__PURE__ */ h({
|
|
2156
2281
|
__name: "MediaLibraryModal",
|
|
2157
2282
|
props: {
|
|
2158
2283
|
visible: { type: Boolean },
|
|
@@ -2160,34 +2285,42 @@ var Zn = ["data-tpl-theme"], Qn = {
|
|
|
2160
2285
|
authManager: {},
|
|
2161
2286
|
projectId: {},
|
|
2162
2287
|
planConfig: {},
|
|
2163
|
-
popoverTarget: {}
|
|
2288
|
+
popoverTarget: {},
|
|
2289
|
+
locale: {},
|
|
2290
|
+
uiTheme: {}
|
|
2164
2291
|
},
|
|
2165
2292
|
emits: ["close", "select"],
|
|
2166
2293
|
setup(e, { emit: t }) {
|
|
2167
|
-
let n = e, r = t,
|
|
2168
|
-
|
|
2169
|
-
|
|
2294
|
+
let n = e, r = t, c = w(null);
|
|
2295
|
+
j(() => n.locale, async (e) => {
|
|
2296
|
+
c.value = await ur(e ?? "en");
|
|
2297
|
+
}, { immediate: !0 }), C(ve, c);
|
|
2298
|
+
let h = s(() => c.value), g = s(() => n.uiTheme);
|
|
2299
|
+
C(ye, g);
|
|
2300
|
+
let _ = O(() => n.popoverTarget ?? null);
|
|
2301
|
+
C(_e, _), C(ge, n.planConfig);
|
|
2302
|
+
let v = s(() => n.planConfig.config.value?.storage.used_bytes ?? 0), x = s(() => n.planConfig.config.value?.storage.limit_bytes ?? 0), { isAcceptedMimeType: E, availableCategories: A } = Z(n.planConfig), N = he({
|
|
2170
2303
|
projectId: n.projectId,
|
|
2171
2304
|
authManager: n.authManager
|
|
2172
|
-
}),
|
|
2173
|
-
library:
|
|
2174
|
-
translations:
|
|
2305
|
+
}), P = nr({
|
|
2306
|
+
library: N,
|
|
2307
|
+
translations: h
|
|
2175
2308
|
});
|
|
2176
2309
|
j(() => n.visible, (e) => {
|
|
2177
|
-
e ? (
|
|
2310
|
+
e ? (N.loadItems(), N.loadFrequentlyUsed()) : P.resetUI();
|
|
2178
2311
|
});
|
|
2179
|
-
function
|
|
2312
|
+
function L(e) {
|
|
2180
2313
|
e.key === "Escape" && r("close");
|
|
2181
2314
|
}
|
|
2182
|
-
le(document, "keydown",
|
|
2183
|
-
function L() {
|
|
2184
|
-
return A.previewItem.value ? !n.accept?.length || w(A.previewItem.value.mime_type, n.accept) : !1;
|
|
2185
|
-
}
|
|
2315
|
+
le(document, "keydown", L);
|
|
2186
2316
|
function z() {
|
|
2187
|
-
|
|
2188
|
-
|
|
2317
|
+
return N.previewItem.value ? !n.accept?.length || E(N.previewItem.value.mime_type, n.accept) : !1;
|
|
2318
|
+
}
|
|
2319
|
+
function B() {
|
|
2320
|
+
if (z()) {
|
|
2321
|
+
let e = N.previewItem.value, t = {
|
|
2189
2322
|
...e,
|
|
2190
|
-
url:
|
|
2323
|
+
url: P.selectedUrl.value || e.url
|
|
2191
2324
|
};
|
|
2192
2325
|
r("select", t), r("close");
|
|
2193
2326
|
}
|
|
@@ -2200,20 +2333,20 @@ var Zn = ["data-tpl-theme"], Qn = {
|
|
|
2200
2333
|
"leave-from-class": "tpl:opacity-100",
|
|
2201
2334
|
"leave-to-class": "tpl:opacity-0"
|
|
2202
2335
|
}, {
|
|
2203
|
-
default: M(() => [e.visible ? (S(), d("div", {
|
|
2336
|
+
default: M(() => [e.visible && c.value ? (S(), d("div", {
|
|
2204
2337
|
key: 0,
|
|
2205
|
-
"data-tpl-theme":
|
|
2338
|
+
"data-tpl-theme": g.value,
|
|
2206
2339
|
class: "tpl tpl-media-overlay tpl:fixed tpl:inset-0 tpl:z-[9999]",
|
|
2207
2340
|
onClick: n[18] ||= F((e) => r("close"), ["self"])
|
|
2208
|
-
}, [f("div",
|
|
2209
|
-
f("div",
|
|
2210
|
-
m(
|
|
2341
|
+
}, [f("div", fr, [
|
|
2342
|
+
f("div", pr, [f("h2", mr, D(h.value.mediaLibrary.title), 1), f("div", hr, [
|
|
2343
|
+
m(tr, {
|
|
2211
2344
|
"used-bytes": v.value,
|
|
2212
2345
|
"limit-bytes": x.value,
|
|
2213
2346
|
size: 22
|
|
2214
2347
|
}, null, 8, ["used-bytes", "limit-bytes"]),
|
|
2215
|
-
f("div",
|
|
2216
|
-
value: k(
|
|
2348
|
+
f("div", gr, [f("input", {
|
|
2349
|
+
value: k(P).searchInput.value,
|
|
2217
2350
|
type: "text",
|
|
2218
2351
|
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)]",
|
|
2219
2352
|
style: {
|
|
@@ -2221,9 +2354,9 @@ var Zn = ["data-tpl-theme"], Qn = {
|
|
|
2221
2354
|
"background-color": "var(--tpl-bg)",
|
|
2222
2355
|
color: "var(--tpl-text)"
|
|
2223
2356
|
},
|
|
2224
|
-
placeholder:
|
|
2225
|
-
onInput: n[0] ||= (e) => k(
|
|
2226
|
-
}, null, 40,
|
|
2357
|
+
placeholder: h.value.mediaLibrary.searchPlaceholder,
|
|
2358
|
+
onInput: n[0] ||= (e) => k(P).handleSearchInput(e.target.value)
|
|
2359
|
+
}, null, 40, _r), m(k(J), {
|
|
2227
2360
|
class: "tpl:absolute tpl:top-1/2 tpl:left-2.5 tpl:-translate-y-1/2",
|
|
2228
2361
|
size: 13,
|
|
2229
2362
|
"stroke-width": 2,
|
|
@@ -2238,7 +2371,7 @@ var Zn = ["data-tpl-theme"], Qn = {
|
|
|
2238
2371
|
"stroke-width": 2
|
|
2239
2372
|
})])
|
|
2240
2373
|
])]),
|
|
2241
|
-
f("div",
|
|
2374
|
+
f("div", vr, [m(o, {
|
|
2242
2375
|
"enter-active-class": "tpl:transition-all tpl:duration-200 tpl:ease-out",
|
|
2243
2376
|
"enter-from-class": "tpl:-ml-48 tpl:opacity-0",
|
|
2244
2377
|
"enter-to-class": "tpl:ml-0 tpl:opacity-100",
|
|
@@ -2246,16 +2379,16 @@ var Zn = ["data-tpl-theme"], Qn = {
|
|
|
2246
2379
|
"leave-from-class": "tpl:ml-0 tpl:opacity-100",
|
|
2247
2380
|
"leave-to-class": "tpl:-ml-48 tpl:opacity-0"
|
|
2248
2381
|
}, {
|
|
2249
|
-
default: M(() => [k(
|
|
2250
|
-
folders: k(
|
|
2251
|
-
"current-folder-id": k(
|
|
2252
|
-
"view-mode": k(
|
|
2253
|
-
"has-frequently-used": k(
|
|
2254
|
-
onNavigate: k(
|
|
2255
|
-
onCreateFolder: k(
|
|
2256
|
-
onRenameFolder: k(
|
|
2257
|
-
onDeleteFolder: k(
|
|
2258
|
-
onShowFrequentlyUsed: k(
|
|
2382
|
+
default: M(() => [k(P).showSidebar.value ? (S(), d("div", yr, [m(wt, {
|
|
2383
|
+
folders: k(N).folders.value,
|
|
2384
|
+
"current-folder-id": k(N).currentFolderId.value,
|
|
2385
|
+
"view-mode": k(N).viewMode.value,
|
|
2386
|
+
"has-frequently-used": k(P).hasFrequentlyUsed.value,
|
|
2387
|
+
onNavigate: k(N).navigateToFolder,
|
|
2388
|
+
onCreateFolder: k(P).handleCreateFolder,
|
|
2389
|
+
onRenameFolder: k(P).handleRenameFolder,
|
|
2390
|
+
onDeleteFolder: k(P).handleDeleteFolder,
|
|
2391
|
+
onShowFrequentlyUsed: k(N).showFrequentlyUsed
|
|
2259
2392
|
}, null, 8, [
|
|
2260
2393
|
"folders",
|
|
2261
2394
|
"current-folder-id",
|
|
@@ -2268,54 +2401,54 @@ var Zn = ["data-tpl-theme"], Qn = {
|
|
|
2268
2401
|
"onShowFrequentlyUsed"
|
|
2269
2402
|
])])) : u("", !0)]),
|
|
2270
2403
|
_: 1
|
|
2271
|
-
}), f("div",
|
|
2404
|
+
}), f("div", br, [f("div", xr, [f("div", Sr, [
|
|
2272
2405
|
f("button", {
|
|
2273
2406
|
class: "tpl:flex tpl:size-7 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded-md tpl:transition-all tpl:duration-150",
|
|
2274
2407
|
style: b({
|
|
2275
|
-
color: k(
|
|
2276
|
-
backgroundColor: k(
|
|
2277
|
-
border: k(
|
|
2408
|
+
color: k(P).showSidebar.value ? "var(--tpl-primary)" : "var(--tpl-text-muted)",
|
|
2409
|
+
backgroundColor: k(P).showSidebar.value ? "var(--tpl-bg)" : "transparent",
|
|
2410
|
+
border: k(P).showSidebar.value ? "1px solid var(--tpl-border)" : "1px solid transparent"
|
|
2278
2411
|
}),
|
|
2279
|
-
title: k(
|
|
2280
|
-
onClick: n[2] ||= (e) => k(
|
|
2412
|
+
title: k(P).showSidebar.value ? h.value.mediaLibrary.hideFolders : h.value.mediaLibrary.showFolders,
|
|
2413
|
+
onClick: n[2] ||= (e) => k(P).showSidebar.value = !k(P).showSidebar.value
|
|
2281
2414
|
}, [m(k(G), {
|
|
2282
2415
|
size: 16,
|
|
2283
2416
|
"stroke-width": 2
|
|
2284
|
-
})], 12,
|
|
2285
|
-
k(
|
|
2417
|
+
})], 12, Cr),
|
|
2418
|
+
k(N).viewMode.value === "frequently-used" ? (S(), d("span", wr, D(h.value.mediaLibrary.frequentlyUsed), 1)) : (S(), l(Te, {
|
|
2286
2419
|
key: 1,
|
|
2287
|
-
folders: k(
|
|
2288
|
-
"current-folder-id": k(
|
|
2289
|
-
onNavigate: k(
|
|
2420
|
+
folders: k(N).folders.value,
|
|
2421
|
+
"current-folder-id": k(N).currentFolderId.value,
|
|
2422
|
+
onNavigate: k(N).navigateToFolder
|
|
2290
2423
|
}, null, 8, [
|
|
2291
2424
|
"folders",
|
|
2292
2425
|
"current-folder-id",
|
|
2293
2426
|
"onNavigate"
|
|
2294
2427
|
])),
|
|
2295
|
-
f("div",
|
|
2428
|
+
f("div", Tr, [f("button", {
|
|
2296
2429
|
class: "tpl:flex tpl:size-6 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded tpl:transition-all tpl:duration-150",
|
|
2297
2430
|
style: b({
|
|
2298
|
-
color: k(
|
|
2299
|
-
backgroundColor: k(
|
|
2431
|
+
color: k(P).layoutMode.value === "grid" ? "var(--tpl-primary)" : "var(--tpl-text-muted)",
|
|
2432
|
+
backgroundColor: k(P).layoutMode.value === "grid" ? "var(--tpl-bg-elevated)" : "transparent"
|
|
2300
2433
|
}),
|
|
2301
|
-
title:
|
|
2302
|
-
onClick: n[3] ||= (e) => k(
|
|
2434
|
+
title: h.value.mediaLibrary.viewGrid,
|
|
2435
|
+
onClick: n[3] ||= (e) => k(P).layoutMode.value = "grid"
|
|
2303
2436
|
}, [m(k(V), {
|
|
2304
2437
|
size: 14,
|
|
2305
2438
|
"stroke-width": 2
|
|
2306
|
-
})], 12,
|
|
2439
|
+
})], 12, Er), f("button", {
|
|
2307
2440
|
class: "tpl:flex tpl:size-6 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded tpl:transition-all tpl:duration-150",
|
|
2308
2441
|
style: b({
|
|
2309
|
-
color: k(
|
|
2310
|
-
backgroundColor: k(
|
|
2442
|
+
color: k(P).layoutMode.value === "list" ? "var(--tpl-primary)" : "var(--tpl-text-muted)",
|
|
2443
|
+
backgroundColor: k(P).layoutMode.value === "list" ? "var(--tpl-bg-elevated)" : "transparent"
|
|
2311
2444
|
}),
|
|
2312
|
-
title:
|
|
2313
|
-
onClick: n[4] ||= (e) => k(
|
|
2445
|
+
title: h.value.mediaLibrary.viewList,
|
|
2446
|
+
onClick: n[4] ||= (e) => k(P).layoutMode.value = "list"
|
|
2314
2447
|
}, [m(k(U), {
|
|
2315
2448
|
size: 14,
|
|
2316
2449
|
"stroke-width": 2
|
|
2317
|
-
})], 12,
|
|
2318
|
-
]), f("div",
|
|
2450
|
+
})], 12, Dr)])
|
|
2451
|
+
]), f("div", Or, [k(A).length > 1 ? (S(), d("select", {
|
|
2319
2452
|
key: 0,
|
|
2320
2453
|
class: "tpl:rounded-md tpl:border tpl:py-1.5 tpl:pr-7 tpl:pl-2.5 tpl:text-xs tpl:transition-all tpl:duration-150 tpl:outline-none",
|
|
2321
2454
|
style: {
|
|
@@ -2323,31 +2456,31 @@ var Zn = ["data-tpl-theme"], Qn = {
|
|
|
2323
2456
|
"background-color": "var(--tpl-bg)",
|
|
2324
2457
|
color: "var(--tpl-text)"
|
|
2325
2458
|
},
|
|
2326
|
-
value: k(
|
|
2327
|
-
onChange: n[5] ||= (e) => k(
|
|
2328
|
-
}, [f("option",
|
|
2459
|
+
value: k(N).categoryFilter.value ?? "",
|
|
2460
|
+
onChange: n[5] ||= (e) => k(N).filterByCategory(e.target.value || null)
|
|
2461
|
+
}, [f("option", Ar, D(h.value.mediaLibrary.filterAll), 1), (S(!0), d(i, null, T(k(A), (e) => (S(), d("option", {
|
|
2329
2462
|
key: e,
|
|
2330
2463
|
value: e
|
|
2331
|
-
}, D(k(
|
|
2464
|
+
}, D(k(P).getCategoryLabel(e)), 9, jr))), 128))], 40, kr)) : u("", !0), f("select", {
|
|
2332
2465
|
class: "tpl:rounded-md tpl:border tpl:py-1.5 tpl:pr-7 tpl:pl-2.5 tpl:text-xs tpl:transition-all tpl:duration-150 tpl:outline-none",
|
|
2333
2466
|
style: {
|
|
2334
2467
|
"border-color": "var(--tpl-border)",
|
|
2335
2468
|
"background-color": "var(--tpl-bg)",
|
|
2336
2469
|
color: "var(--tpl-text)"
|
|
2337
2470
|
},
|
|
2338
|
-
value: k(
|
|
2339
|
-
onChange: n[6] ||= (e) => k(
|
|
2471
|
+
value: k(N).sortOption.value,
|
|
2472
|
+
onChange: n[6] ||= (e) => k(N).sortBy(e.target.value)
|
|
2340
2473
|
}, [
|
|
2341
|
-
f("option",
|
|
2342
|
-
f("option",
|
|
2343
|
-
f("option",
|
|
2344
|
-
f("option",
|
|
2345
|
-
f("option",
|
|
2346
|
-
f("option",
|
|
2347
|
-
], 40,
|
|
2348
|
-
"is-uploading": k(
|
|
2349
|
-
"upload-progress": k(
|
|
2350
|
-
onUpload: k(
|
|
2474
|
+
f("option", Nr, D(h.value.mediaLibrary.sortNewest), 1),
|
|
2475
|
+
f("option", Pr, D(h.value.mediaLibrary.sortOldest), 1),
|
|
2476
|
+
f("option", Fr, D(h.value.mediaLibrary.sortNameAsc), 1),
|
|
2477
|
+
f("option", Ir, D(h.value.mediaLibrary.sortNameDesc), 1),
|
|
2478
|
+
f("option", Lr, D(h.value.mediaLibrary.sortSizeAsc), 1),
|
|
2479
|
+
f("option", Rr, D(h.value.mediaLibrary.sortSizeDesc), 1)
|
|
2480
|
+
], 40, Mr)])]), f("div", zr, [k(N).viewMode.value === "files" ? (S(), d("div", Br, [m(Xn, {
|
|
2481
|
+
"is-uploading": k(N).isUploading.value,
|
|
2482
|
+
"upload-progress": k(N).uploadProgress.value,
|
|
2483
|
+
onUpload: k(P).handleUpload
|
|
2351
2484
|
}, null, 8, [
|
|
2352
2485
|
"is-uploading",
|
|
2353
2486
|
"upload-progress",
|
|
@@ -2359,22 +2492,22 @@ var Zn = ["data-tpl-theme"], Qn = {
|
|
|
2359
2492
|
color: "var(--tpl-text-muted)",
|
|
2360
2493
|
"background-color": "var(--tpl-bg)"
|
|
2361
2494
|
},
|
|
2362
|
-
onClick: n[7] ||= (e) => k(
|
|
2495
|
+
onClick: n[7] ||= (e) => k(P).showImportUrlModal.value = !0
|
|
2363
2496
|
}, [m(k(H), {
|
|
2364
2497
|
size: 14,
|
|
2365
2498
|
"stroke-width": 2
|
|
2366
|
-
}), p(" " + D(
|
|
2367
|
-
items: k(
|
|
2368
|
-
"selected-ids": k(
|
|
2369
|
-
"is-loading": k(
|
|
2370
|
-
"has-more": k(
|
|
2499
|
+
}), p(" " + D(h.value.mediaLibrary.importFromUrl), 1)])])) : u("", !0), m(tn, {
|
|
2500
|
+
items: k(P).displayItems.value,
|
|
2501
|
+
"selected-ids": k(N).selectedItems.value,
|
|
2502
|
+
"is-loading": k(N).isLoading.value,
|
|
2503
|
+
"has-more": k(N).viewMode.value === "files" && k(N).hasMore.value,
|
|
2371
2504
|
accept: e.accept,
|
|
2372
|
-
layout: k(
|
|
2373
|
-
onSelect: k(
|
|
2374
|
-
onToggle: k(
|
|
2375
|
-
onLoadMore: k(
|
|
2376
|
-
onEdit: k(
|
|
2377
|
-
onReplace: k(
|
|
2505
|
+
layout: k(P).layoutMode.value,
|
|
2506
|
+
onSelect: k(P).handleSelect,
|
|
2507
|
+
onToggle: k(N).toggleSelection,
|
|
2508
|
+
onLoadMore: k(N).loadMore,
|
|
2509
|
+
onEdit: k(P).handleEditItem,
|
|
2510
|
+
onReplace: k(P).handleReplaceItem
|
|
2378
2511
|
}, null, 8, [
|
|
2379
2512
|
"items",
|
|
2380
2513
|
"selected-ids",
|
|
@@ -2388,36 +2521,36 @@ var Zn = ["data-tpl-theme"], Qn = {
|
|
|
2388
2521
|
"onEdit",
|
|
2389
2522
|
"onReplace"
|
|
2390
2523
|
])])])]),
|
|
2391
|
-
m(
|
|
2392
|
-
visible: k(
|
|
2393
|
-
"is-importing": k(
|
|
2394
|
-
error: k(
|
|
2395
|
-
onImport: k(
|
|
2396
|
-
onClose: n[8] ||= (e) => k(
|
|
2524
|
+
m(mn, {
|
|
2525
|
+
visible: k(P).showImportUrlModal.value,
|
|
2526
|
+
"is-importing": k(N).isImportingFromUrl.value,
|
|
2527
|
+
error: k(N).importFromUrlError.value,
|
|
2528
|
+
onImport: k(P).handleImportFromUrl,
|
|
2529
|
+
onClose: n[8] ||= (e) => k(P).showImportUrlModal.value = !1
|
|
2397
2530
|
}, null, 8, [
|
|
2398
2531
|
"visible",
|
|
2399
2532
|
"is-importing",
|
|
2400
2533
|
"error",
|
|
2401
2534
|
"onImport"
|
|
2402
2535
|
]),
|
|
2403
|
-
m(
|
|
2404
|
-
visible: !!k(
|
|
2405
|
-
item: k(
|
|
2406
|
-
onSave: k(
|
|
2407
|
-
onClose: n[9] ||= (e) => k(
|
|
2536
|
+
m(ft, {
|
|
2537
|
+
visible: !!k(P).editingItem.value,
|
|
2538
|
+
item: k(P).editingItem.value,
|
|
2539
|
+
onSave: k(P).handleEditSave,
|
|
2540
|
+
onClose: n[9] ||= (e) => k(P).editingItem.value = null
|
|
2408
2541
|
}, null, 8, [
|
|
2409
2542
|
"visible",
|
|
2410
2543
|
"item",
|
|
2411
2544
|
"onSave"
|
|
2412
2545
|
]),
|
|
2413
|
-
m(
|
|
2414
|
-
visible: k(
|
|
2415
|
-
item: k(
|
|
2416
|
-
"usage-info": k(
|
|
2417
|
-
"is-replacing": k(
|
|
2418
|
-
error: k(
|
|
2419
|
-
onReplace: k(
|
|
2420
|
-
onClose: k(
|
|
2546
|
+
m(Gn, {
|
|
2547
|
+
visible: k(N).showReplaceWarning.value,
|
|
2548
|
+
item: k(N).pendingReplaceItem.value,
|
|
2549
|
+
"usage-info": k(N).replaceUsageInfo.value,
|
|
2550
|
+
"is-replacing": k(N).isReplacing.value,
|
|
2551
|
+
error: k(N).replaceError.value,
|
|
2552
|
+
onReplace: k(P).handleReplaceFile,
|
|
2553
|
+
onClose: k(N).cancelReplace
|
|
2421
2554
|
}, null, 8, [
|
|
2422
2555
|
"visible",
|
|
2423
2556
|
"item",
|
|
@@ -2435,7 +2568,7 @@ var Zn = ["data-tpl-theme"], Qn = {
|
|
|
2435
2568
|
"leave-from-class": "tpl:opacity-100",
|
|
2436
2569
|
"leave-to-class": "tpl:opacity-0"
|
|
2437
2570
|
}, {
|
|
2438
|
-
default: M(() => [k(
|
|
2571
|
+
default: M(() => [k(N).showDeleteWarning.value ? (S(), d("div", {
|
|
2439
2572
|
key: 0,
|
|
2440
2573
|
class: "tpl:absolute tpl:inset-0 tpl:z-10 tpl:flex tpl:items-center tpl:justify-center tpl:rounded-[var(--tpl-radius-lg)]",
|
|
2441
2574
|
style: {
|
|
@@ -2443,59 +2576,59 @@ var Zn = ["data-tpl-theme"], Qn = {
|
|
|
2443
2576
|
"backdrop-filter": "blur(8px)",
|
|
2444
2577
|
"-webkit-backdrop-filter": "blur(8px)"
|
|
2445
2578
|
},
|
|
2446
|
-
onClick: n[12] ||= F((...e) => k(
|
|
2447
|
-
}, [f("div",
|
|
2448
|
-
f("h3",
|
|
2579
|
+
onClick: n[12] ||= F((...e) => k(N).cancelDelete && k(N).cancelDelete(...e), ["self"])
|
|
2580
|
+
}, [f("div", Vr, [
|
|
2581
|
+
f("h3", Hr, D(h.value.mediaLibrary.deleteWarningTitle), 1),
|
|
2449
2582
|
f("p", {
|
|
2450
|
-
class: y(["tpl:text-xs", k(
|
|
2583
|
+
class: y(["tpl:text-xs", k(P).hasUsedFiles.value ? "tpl:mb-2" : "tpl:mb-4"]),
|
|
2451
2584
|
style: { color: "var(--tpl-text-muted)" }
|
|
2452
|
-
}, D(
|
|
2453
|
-
k(
|
|
2454
|
-
k(
|
|
2585
|
+
}, D(h.value.mediaLibrary.deleteWarningMessage), 3),
|
|
2586
|
+
k(P).hasUsedFiles.value ? (S(), d("p", Ur, D(h.value.mediaLibrary.deleteWarningUsageNote), 1)) : u("", !0),
|
|
2587
|
+
k(P).hasUsedFiles.value ? (S(), d("div", Wr, [(S(!0), d(i, null, T(k(N).deleteUsageInfo.value, (e, t) => (S(), d("div", {
|
|
2455
2588
|
key: t,
|
|
2456
2589
|
class: "tpl:text-xs",
|
|
2457
2590
|
style: { color: "var(--tpl-text)" }
|
|
2458
|
-
}, [e.template_count > 0 ? (S(), d(i, { key: 0 }, [f("span",
|
|
2459
|
-
f("div",
|
|
2591
|
+
}, [e.template_count > 0 ? (S(), d(i, { key: 0 }, [f("span", Gr, D(k(P).displayItems.value.find((e) => e.id === t)?.filename || t), 1), f("span", Kr, " - " + D(h.value.mediaLibrary.usedInTemplates.replace("{count}", e.template_count.toString())), 1)], 64)) : u("", !0)]))), 128))])) : u("", !0),
|
|
2592
|
+
f("div", qr, [f("button", {
|
|
2460
2593
|
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",
|
|
2461
2594
|
style: {
|
|
2462
2595
|
"border-color": "var(--tpl-border)",
|
|
2463
2596
|
color: "var(--tpl-text)",
|
|
2464
2597
|
"background-color": "var(--tpl-bg)"
|
|
2465
2598
|
},
|
|
2466
|
-
onClick: n[10] ||= (...e) => k(
|
|
2467
|
-
}, D(
|
|
2599
|
+
onClick: n[10] ||= (...e) => k(N).cancelDelete && k(N).cancelDelete(...e)
|
|
2600
|
+
}, D(h.value.mediaLibrary.cancel), 1), f("button", {
|
|
2468
2601
|
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",
|
|
2469
2602
|
style: {
|
|
2470
2603
|
"border-color": "var(--tpl-danger)",
|
|
2471
2604
|
color: "var(--tpl-danger)",
|
|
2472
2605
|
"background-color": "var(--tpl-danger-light)"
|
|
2473
2606
|
},
|
|
2474
|
-
onClick: n[11] ||= (...e) => k(
|
|
2475
|
-
}, D(k(
|
|
2607
|
+
onClick: n[11] ||= (...e) => k(N).confirmDelete && k(N).confirmDelete(...e)
|
|
2608
|
+
}, D(k(P).hasUsedFiles.value ? h.value.mediaLibrary.deleteAnyway : h.value.mediaLibrary.confirmDelete), 1)])
|
|
2476
2609
|
])])) : u("", !0)]),
|
|
2477
2610
|
_: 1
|
|
2478
2611
|
}),
|
|
2479
|
-
f("div",
|
|
2612
|
+
f("div", Jr, [f("div", Yr, [k(N).previewItem.value ? (S(), l(An, {
|
|
2480
2613
|
key: 0,
|
|
2481
|
-
"selected-conversion": k(
|
|
2482
|
-
"onUpdate:selectedConversion": n[13] ||= (e) => k(
|
|
2483
|
-
item: k(
|
|
2484
|
-
folders: k(
|
|
2614
|
+
"selected-conversion": k(P).selectedConversion.value,
|
|
2615
|
+
"onUpdate:selectedConversion": n[13] ||= (e) => k(P).selectedConversion.value = e,
|
|
2616
|
+
item: k(N).previewItem.value,
|
|
2617
|
+
folders: k(N).folders.value
|
|
2485
2618
|
}, null, 8, [
|
|
2486
2619
|
"selected-conversion",
|
|
2487
2620
|
"item",
|
|
2488
2621
|
"folders"
|
|
2489
|
-
])) : u("", !0)]), f("div",
|
|
2622
|
+
])) : u("", !0)]), f("div", Xr, [k(N).selectedItems.value.size > 0 ? (S(), d("div", Zr, [k(N).previewItem.value ? (S(), d("button", {
|
|
2490
2623
|
key: 0,
|
|
2491
2624
|
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",
|
|
2492
2625
|
style: b({
|
|
2493
|
-
borderColor: k(
|
|
2494
|
-
color: k(
|
|
2626
|
+
borderColor: k(P).copied.value ? "var(--tpl-success)" : "var(--tpl-border)",
|
|
2627
|
+
color: k(P).copied.value ? "var(--tpl-success)" : "var(--tpl-text)",
|
|
2495
2628
|
backgroundColor: "var(--tpl-bg)"
|
|
2496
2629
|
}),
|
|
2497
|
-
onClick: n[14] ||= (e) => k(
|
|
2498
|
-
}, [k(
|
|
2630
|
+
onClick: n[14] ||= (e) => k(P).copy(k(P).selectedUrl.value)
|
|
2631
|
+
}, [k(P).copied.value ? (S(), l(k(I), {
|
|
2499
2632
|
key: 1,
|
|
2500
2633
|
size: 12,
|
|
2501
2634
|
"stroke-width": 2
|
|
@@ -2503,25 +2636,25 @@ var Zn = ["data-tpl-theme"], Qn = {
|
|
|
2503
2636
|
key: 0,
|
|
2504
2637
|
size: 12,
|
|
2505
2638
|
"stroke-width": 2
|
|
2506
|
-
})), p(" " + D(k(
|
|
2639
|
+
})), p(" " + D(k(P).copied.value ? h.value.mediaLibrary.copied : h.value.mediaLibrary.copyUrl), 1)], 4)) : u("", !0), f("div", Qr, [f("button", {
|
|
2507
2640
|
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",
|
|
2508
2641
|
style: {
|
|
2509
2642
|
"border-color": "var(--tpl-border)",
|
|
2510
2643
|
color: "var(--tpl-text)",
|
|
2511
2644
|
"background-color": "var(--tpl-bg)"
|
|
2512
2645
|
},
|
|
2513
|
-
onClick: n[15] ||= (e) => k(
|
|
2514
|
-
}, D(
|
|
2646
|
+
onClick: n[15] ||= (e) => k(P).showMovePicker.value = !k(P).showMovePicker.value
|
|
2647
|
+
}, D(h.value.mediaLibrary.moveSelected), 1), k(P).showMovePicker.value ? (S(), l(yn, {
|
|
2515
2648
|
key: 0,
|
|
2516
|
-
folders: k(
|
|
2517
|
-
"current-folder-id": k(
|
|
2518
|
-
onSelect: k(
|
|
2519
|
-
onClose: n[16] ||= (e) => k(
|
|
2649
|
+
folders: k(N).folders.value,
|
|
2650
|
+
"current-folder-id": k(N).currentFolderId.value,
|
|
2651
|
+
onSelect: k(P).handleMoveToFolder,
|
|
2652
|
+
onClose: n[16] ||= (e) => k(P).showMovePicker.value = !1
|
|
2520
2653
|
}, null, 8, [
|
|
2521
2654
|
"folders",
|
|
2522
2655
|
"current-folder-id",
|
|
2523
2656
|
"onSelect"
|
|
2524
|
-
])) : u("", !0)])])) : u("", !0), f("div",
|
|
2657
|
+
])) : u("", !0)])])) : u("", !0), f("div", $r, [k(N).selectedItems.value.size > 0 ? (S(), d("button", {
|
|
2525
2658
|
key: 0,
|
|
2526
2659
|
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",
|
|
2527
2660
|
style: {
|
|
@@ -2529,24 +2662,24 @@ var Zn = ["data-tpl-theme"], Qn = {
|
|
|
2529
2662
|
color: "var(--tpl-danger)",
|
|
2530
2663
|
"background-color": "var(--tpl-danger-light)"
|
|
2531
2664
|
},
|
|
2532
|
-
onClick: n[17] ||= (...e) => k(
|
|
2533
|
-
}, D(
|
|
2665
|
+
onClick: n[17] ||= (...e) => k(P).handleDeleteClick && k(P).handleDeleteClick(...e)
|
|
2666
|
+
}, D(h.value.mediaLibrary.deleteSelected), 1)) : u("", !0), f("button", {
|
|
2534
2667
|
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",
|
|
2535
2668
|
style: {
|
|
2536
2669
|
"background-color": "var(--tpl-primary)",
|
|
2537
2670
|
color: "var(--tpl-bg)"
|
|
2538
2671
|
},
|
|
2539
|
-
disabled: !
|
|
2540
|
-
onClick:
|
|
2541
|
-
}, D(e.accept?.length ?
|
|
2542
|
-
])], 8,
|
|
2672
|
+
disabled: !z(),
|
|
2673
|
+
onClick: B
|
|
2674
|
+
}, D(e.accept?.length ? h.value.mediaLibrary.selectImage : h.value.mediaLibrary.selectFile), 9, ei)])])])
|
|
2675
|
+
])], 8, dr)) : u("", !0)]),
|
|
2543
2676
|
_: 1
|
|
2544
2677
|
})], 8, ["to"]));
|
|
2545
2678
|
}
|
|
2546
2679
|
});
|
|
2547
2680
|
//#endregion
|
|
2548
2681
|
//#region src/composables/useMediaPicker.ts
|
|
2549
|
-
function
|
|
2682
|
+
function ni() {
|
|
2550
2683
|
let e = _("onRequestMedia"), t = w(!1), n = s(() => !!e);
|
|
2551
2684
|
async function r(n) {
|
|
2552
2685
|
if (!e) return null;
|
|
@@ -2565,7 +2698,7 @@ function Hr() {
|
|
|
2565
2698
|
}
|
|
2566
2699
|
//#endregion
|
|
2567
2700
|
//#region src/standalone/MediaLibrary.vue?vue&type=script&setup=true&lang.ts
|
|
2568
|
-
var
|
|
2701
|
+
var ri = {
|
|
2569
2702
|
class: "tpl tpl:flex tpl:flex-col tpl:overflow-hidden tpl:rounded-[var(--tpl-radius-lg)]",
|
|
2570
2703
|
style: {
|
|
2571
2704
|
width: "100%",
|
|
@@ -2573,59 +2706,59 @@ var Ur = {
|
|
|
2573
2706
|
"background-color": "var(--tpl-bg-elevated)",
|
|
2574
2707
|
border: "1px solid var(--tpl-border)"
|
|
2575
2708
|
}
|
|
2576
|
-
},
|
|
2709
|
+
}, ii = {
|
|
2577
2710
|
class: "tpl:flex tpl:shrink-0 tpl:items-center tpl:justify-between tpl:border-b tpl:px-5 tpl:py-3.5",
|
|
2578
2711
|
style: { "border-color": "var(--tpl-border)" }
|
|
2579
|
-
},
|
|
2712
|
+
}, ai = {
|
|
2580
2713
|
class: "tpl:text-sm tpl:font-semibold",
|
|
2581
2714
|
style: { color: "var(--tpl-text)" }
|
|
2582
|
-
},
|
|
2715
|
+
}, oi = { class: "tpl:flex tpl:items-center tpl:gap-3" }, si = { class: "tpl:relative" }, ci = ["value", "placeholder"], li = { class: "tpl:flex tpl:min-h-0 tpl:flex-1 tpl:overflow-hidden" }, ui = {
|
|
2583
2716
|
key: 0,
|
|
2584
2717
|
class: "tpl:flex tpl:w-48 tpl:shrink-0 tpl:flex-col tpl:border-r",
|
|
2585
2718
|
style: {
|
|
2586
2719
|
"border-color": "var(--tpl-border)",
|
|
2587
2720
|
"background-color": "var(--tpl-bg)"
|
|
2588
2721
|
}
|
|
2589
|
-
},
|
|
2722
|
+
}, di = { class: "tpl:flex tpl:min-w-0 tpl:flex-1 tpl:flex-col" }, fi = {
|
|
2590
2723
|
class: "tpl:flex tpl:shrink-0 tpl:items-center tpl:justify-between tpl:border-b tpl:px-4 tpl:py-2.5",
|
|
2591
2724
|
style: { "border-color": "var(--tpl-border)" }
|
|
2592
|
-
},
|
|
2725
|
+
}, pi = { class: "tpl:flex tpl:items-center tpl:gap-2" }, mi = ["title"], hi = {
|
|
2593
2726
|
key: 0,
|
|
2594
2727
|
class: "tpl:text-xs tpl:font-medium",
|
|
2595
2728
|
style: { color: "var(--tpl-text)" }
|
|
2596
|
-
},
|
|
2729
|
+
}, gi = {
|
|
2597
2730
|
class: "tpl:flex tpl:rounded-md tpl:p-0.5",
|
|
2598
2731
|
style: {
|
|
2599
2732
|
border: "1px solid var(--tpl-border)",
|
|
2600
2733
|
"background-color": "var(--tpl-bg)"
|
|
2601
2734
|
}
|
|
2602
|
-
},
|
|
2735
|
+
}, _i = ["title"], vi = ["title"], yi = { class: "tpl:flex tpl:items-center tpl:gap-2" }, bi = ["value"], xi = { value: "" }, Si = ["value"], Ci = ["value"], wi = { value: "newest" }, Ti = { value: "oldest" }, Ei = { value: "name_asc" }, Di = { value: "name_desc" }, Oi = { value: "size_asc" }, ki = { value: "size_desc" }, Ai = { class: "tpl:min-h-0 tpl:flex-1 tpl:overflow-y-auto" }, ji = {
|
|
2603
2736
|
key: 0,
|
|
2604
2737
|
class: "tpl:px-4 tpl:pt-3"
|
|
2605
|
-
},
|
|
2738
|
+
}, Mi = {
|
|
2606
2739
|
class: "tpl-scale-in tpl:mx-4 tpl:w-full tpl:max-w-sm tpl:rounded-[var(--tpl-radius-lg)] tpl:p-5",
|
|
2607
2740
|
style: {
|
|
2608
2741
|
"background-color": "var(--tpl-bg-elevated)",
|
|
2609
2742
|
"box-shadow": "var(--tpl-shadow-xl)"
|
|
2610
2743
|
}
|
|
2611
|
-
},
|
|
2744
|
+
}, Ni = {
|
|
2612
2745
|
class: "tpl:mb-2 tpl:text-sm tpl:font-semibold",
|
|
2613
2746
|
style: { color: "var(--tpl-text)" }
|
|
2614
|
-
},
|
|
2747
|
+
}, Pi = {
|
|
2615
2748
|
key: 0,
|
|
2616
2749
|
class: "tpl:mb-4 tpl:text-xs",
|
|
2617
2750
|
style: { color: "var(--tpl-text-muted)" }
|
|
2618
|
-
},
|
|
2751
|
+
}, Fi = {
|
|
2619
2752
|
key: 1,
|
|
2620
2753
|
class: "tpl:mb-4 tpl:max-h-32 tpl:overflow-y-auto tpl:rounded tpl:border tpl:p-2",
|
|
2621
2754
|
style: { "border-color": "var(--tpl-border)" }
|
|
2622
|
-
},
|
|
2755
|
+
}, Ii = { class: "tpl:font-medium" }, Li = { style: { color: "var(--tpl-text-muted)" } }, Ri = { class: "tpl:flex tpl:justify-end tpl:gap-2" }, zi = {
|
|
2623
2756
|
class: "tpl:flex tpl:shrink-0 tpl:items-center tpl:justify-between tpl:border-t tpl:px-5 tpl:py-3",
|
|
2624
2757
|
style: { "border-color": "var(--tpl-border)" }
|
|
2625
|
-
},
|
|
2758
|
+
}, Bi = { class: "tpl:flex tpl:min-w-0 tpl:flex-1 tpl:items-center tpl:gap-3" }, Vi = { class: "tpl:flex tpl:items-center tpl:gap-5" }, Hi = {
|
|
2626
2759
|
key: 0,
|
|
2627
2760
|
class: "tpl:flex tpl:items-center tpl:gap-2"
|
|
2628
|
-
},
|
|
2761
|
+
}, Ui = { class: "tpl:relative" }, Wi = { class: "tpl:flex tpl:items-center tpl:gap-2" }, Gi = ["disabled"], Ki = /* @__PURE__ */ h({
|
|
2629
2762
|
__name: "MediaLibrary",
|
|
2630
2763
|
props: {
|
|
2631
2764
|
authManager: {},
|
|
@@ -2638,20 +2771,20 @@ var Ur = {
|
|
|
2638
2771
|
emits: ["ready"],
|
|
2639
2772
|
setup(e, { emit: t }) {
|
|
2640
2773
|
let n = e, r = t, a = s(() => n.translations);
|
|
2641
|
-
C(
|
|
2642
|
-
let c =
|
|
2643
|
-
|
|
2644
|
-
config: c,
|
|
2774
|
+
C(ve, w(n.translations));
|
|
2775
|
+
let c = {
|
|
2776
|
+
config: w(n.planConfig),
|
|
2645
2777
|
isLoading: w(!1),
|
|
2646
2778
|
hasFeature: (e) => n.planConfig.features[e] ?? !1,
|
|
2647
2779
|
features: s(() => n.planConfig.features),
|
|
2648
2780
|
fetchConfig: async () => {}
|
|
2649
|
-
}
|
|
2650
|
-
|
|
2781
|
+
};
|
|
2782
|
+
C(ge, c);
|
|
2783
|
+
let h = s(() => n.planConfig.storage.used_bytes ?? 0), g = s(() => n.planConfig.storage.limit_bytes ?? 0), { availableCategories: _ } = Z(c), v = he({
|
|
2651
2784
|
projectId: n.projectId,
|
|
2652
2785
|
authManager: n.authManager,
|
|
2653
2786
|
onError: n.onError
|
|
2654
|
-
}), E =
|
|
2787
|
+
}), E = nr({
|
|
2655
2788
|
library: v,
|
|
2656
2789
|
translations: a
|
|
2657
2790
|
});
|
|
@@ -2665,12 +2798,12 @@ var Ur = {
|
|
|
2665
2798
|
}
|
|
2666
2799
|
return x(() => {
|
|
2667
2800
|
v.loadItems(), v.loadFrequentlyUsed(), r("ready");
|
|
2668
|
-
}), (t, n) => (S(), d("div",
|
|
2669
|
-
f("div",
|
|
2801
|
+
}), (t, n) => (S(), d("div", ri, [
|
|
2802
|
+
f("div", ii, [f("h2", ai, D(a.value.mediaLibrary.title), 1), f("div", oi, [m(tr, {
|
|
2670
2803
|
"used-bytes": h.value,
|
|
2671
2804
|
"limit-bytes": g.value,
|
|
2672
2805
|
size: 22
|
|
2673
|
-
}, null, 8, ["used-bytes", "limit-bytes"]), f("div",
|
|
2806
|
+
}, null, 8, ["used-bytes", "limit-bytes"]), f("div", si, [f("input", {
|
|
2674
2807
|
value: k(E).searchInput.value,
|
|
2675
2808
|
type: "text",
|
|
2676
2809
|
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)]",
|
|
@@ -2681,13 +2814,13 @@ var Ur = {
|
|
|
2681
2814
|
},
|
|
2682
2815
|
placeholder: a.value.mediaLibrary.searchPlaceholder,
|
|
2683
2816
|
onInput: n[0] ||= (e) => k(E).handleSearchInput(e.target.value)
|
|
2684
|
-
}, null, 40,
|
|
2817
|
+
}, null, 40, ci), m(k(J), {
|
|
2685
2818
|
class: "tpl:absolute tpl:top-1/2 tpl:left-2.5 tpl:-translate-y-1/2",
|
|
2686
2819
|
size: 13,
|
|
2687
2820
|
"stroke-width": 2,
|
|
2688
2821
|
style: { color: "var(--tpl-text-dim)" }
|
|
2689
2822
|
})])])]),
|
|
2690
|
-
f("div",
|
|
2823
|
+
f("div", li, [m(o, {
|
|
2691
2824
|
"enter-active-class": "tpl:transition-all tpl:duration-200 tpl:ease-out",
|
|
2692
2825
|
"enter-from-class": "tpl:-ml-48 tpl:opacity-0",
|
|
2693
2826
|
"enter-to-class": "tpl:ml-0 tpl:opacity-100",
|
|
@@ -2695,7 +2828,7 @@ var Ur = {
|
|
|
2695
2828
|
"leave-from-class": "tpl:ml-0 tpl:opacity-100",
|
|
2696
2829
|
"leave-to-class": "tpl:-ml-48 tpl:opacity-0"
|
|
2697
2830
|
}, {
|
|
2698
|
-
default: M(() => [k(E).showSidebar.value ? (S(), d("div",
|
|
2831
|
+
default: M(() => [k(E).showSidebar.value ? (S(), d("div", ui, [m(wt, {
|
|
2699
2832
|
folders: k(v).folders.value,
|
|
2700
2833
|
"current-folder-id": k(v).currentFolderId.value,
|
|
2701
2834
|
"view-mode": k(v).viewMode.value,
|
|
@@ -2717,7 +2850,7 @@ var Ur = {
|
|
|
2717
2850
|
"onShowFrequentlyUsed"
|
|
2718
2851
|
])])) : u("", !0)]),
|
|
2719
2852
|
_: 1
|
|
2720
|
-
}), f("div",
|
|
2853
|
+
}), f("div", di, [f("div", fi, [f("div", pi, [
|
|
2721
2854
|
f("button", {
|
|
2722
2855
|
class: "tpl:flex tpl:size-7 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded-md tpl:transition-all tpl:duration-150",
|
|
2723
2856
|
style: b({
|
|
@@ -2730,8 +2863,8 @@ var Ur = {
|
|
|
2730
2863
|
}, [m(k(G), {
|
|
2731
2864
|
size: 16,
|
|
2732
2865
|
"stroke-width": 2
|
|
2733
|
-
})], 12,
|
|
2734
|
-
k(v).viewMode.value === "frequently-used" ? (S(), d("span",
|
|
2866
|
+
})], 12, mi),
|
|
2867
|
+
k(v).viewMode.value === "frequently-used" ? (S(), d("span", hi, D(a.value.mediaLibrary.frequentlyUsed), 1)) : (S(), l(Te, {
|
|
2735
2868
|
key: 1,
|
|
2736
2869
|
folders: k(v).folders.value,
|
|
2737
2870
|
"current-folder-id": k(v).currentFolderId.value,
|
|
@@ -2741,7 +2874,7 @@ var Ur = {
|
|
|
2741
2874
|
"current-folder-id",
|
|
2742
2875
|
"onNavigate"
|
|
2743
2876
|
])),
|
|
2744
|
-
f("div",
|
|
2877
|
+
f("div", gi, [f("button", {
|
|
2745
2878
|
class: "tpl:flex tpl:size-6 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded tpl:transition-all tpl:duration-150",
|
|
2746
2879
|
style: b({
|
|
2747
2880
|
color: k(E).layoutMode.value === "grid" ? "var(--tpl-primary)" : "var(--tpl-text-muted)",
|
|
@@ -2752,7 +2885,7 @@ var Ur = {
|
|
|
2752
2885
|
}, [m(k(V), {
|
|
2753
2886
|
size: 14,
|
|
2754
2887
|
"stroke-width": 2
|
|
2755
|
-
})], 12,
|
|
2888
|
+
})], 12, _i), f("button", {
|
|
2756
2889
|
class: "tpl:flex tpl:size-6 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded tpl:transition-all tpl:duration-150",
|
|
2757
2890
|
style: b({
|
|
2758
2891
|
color: k(E).layoutMode.value === "list" ? "var(--tpl-primary)" : "var(--tpl-text-muted)",
|
|
@@ -2763,8 +2896,8 @@ var Ur = {
|
|
|
2763
2896
|
}, [m(k(U), {
|
|
2764
2897
|
size: 14,
|
|
2765
2898
|
"stroke-width": 2
|
|
2766
|
-
})], 12,
|
|
2767
|
-
]), f("div",
|
|
2899
|
+
})], 12, vi)])
|
|
2900
|
+
]), f("div", yi, [k(_).length > 1 ? (S(), d("select", {
|
|
2768
2901
|
key: 0,
|
|
2769
2902
|
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",
|
|
2770
2903
|
style: {
|
|
@@ -2774,10 +2907,10 @@ var Ur = {
|
|
|
2774
2907
|
},
|
|
2775
2908
|
value: k(v).categoryFilter.value ?? "",
|
|
2776
2909
|
onChange: n[4] ||= (e) => k(v).filterByCategory(e.target.value || null)
|
|
2777
|
-
}, [f("option",
|
|
2910
|
+
}, [f("option", xi, D(a.value.mediaLibrary.filterAll), 1), (S(!0), d(i, null, T(k(_), (e) => (S(), d("option", {
|
|
2778
2911
|
key: e,
|
|
2779
2912
|
value: e
|
|
2780
|
-
}, D(k(E).getCategoryLabel(e)), 9,
|
|
2913
|
+
}, D(k(E).getCategoryLabel(e)), 9, Si))), 128))], 40, bi)) : u("", !0), f("select", {
|
|
2781
2914
|
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",
|
|
2782
2915
|
style: {
|
|
2783
2916
|
"border-color": "var(--tpl-border)",
|
|
@@ -2787,13 +2920,13 @@ var Ur = {
|
|
|
2787
2920
|
value: k(v).sortOption.value,
|
|
2788
2921
|
onChange: n[5] ||= (e) => k(v).sortBy(e.target.value)
|
|
2789
2922
|
}, [
|
|
2790
|
-
f("option",
|
|
2791
|
-
f("option",
|
|
2792
|
-
f("option",
|
|
2793
|
-
f("option",
|
|
2794
|
-
f("option",
|
|
2795
|
-
f("option",
|
|
2796
|
-
], 40,
|
|
2923
|
+
f("option", wi, D(a.value.mediaLibrary.sortNewest), 1),
|
|
2924
|
+
f("option", Ti, D(a.value.mediaLibrary.sortOldest), 1),
|
|
2925
|
+
f("option", Ei, D(a.value.mediaLibrary.sortNameAsc), 1),
|
|
2926
|
+
f("option", Di, D(a.value.mediaLibrary.sortNameDesc), 1),
|
|
2927
|
+
f("option", Oi, D(a.value.mediaLibrary.sortSizeAsc), 1),
|
|
2928
|
+
f("option", ki, D(a.value.mediaLibrary.sortSizeDesc), 1)
|
|
2929
|
+
], 40, Ci)])]), f("div", Ai, [k(v).viewMode.value === "files" ? (S(), d("div", ji, [m(Xn, {
|
|
2797
2930
|
"is-uploading": k(v).isUploading.value,
|
|
2798
2931
|
"upload-progress": k(v).uploadProgress.value,
|
|
2799
2932
|
onUpload: k(E).handleUpload
|
|
@@ -2812,7 +2945,7 @@ var Ur = {
|
|
|
2812
2945
|
}, [m(k(H), {
|
|
2813
2946
|
size: 14,
|
|
2814
2947
|
"stroke-width": 2
|
|
2815
|
-
}), p(" " + D(a.value.mediaLibrary.importFromUrl), 1)])])) : u("", !0), m(
|
|
2948
|
+
}), p(" " + D(a.value.mediaLibrary.importFromUrl), 1)])])) : u("", !0), m(tn, {
|
|
2816
2949
|
items: k(E).displayItems.value,
|
|
2817
2950
|
"selected-ids": k(v).selectedItems.value,
|
|
2818
2951
|
"is-loading": k(v).isLoading.value,
|
|
@@ -2835,7 +2968,7 @@ var Ur = {
|
|
|
2835
2968
|
"onEdit",
|
|
2836
2969
|
"onReplace"
|
|
2837
2970
|
])])])]),
|
|
2838
|
-
m(
|
|
2971
|
+
m(mn, {
|
|
2839
2972
|
visible: k(E).showImportUrlModal.value,
|
|
2840
2973
|
"is-importing": k(v).isImportingFromUrl.value,
|
|
2841
2974
|
error: k(v).importFromUrlError.value,
|
|
@@ -2847,7 +2980,7 @@ var Ur = {
|
|
|
2847
2980
|
"error",
|
|
2848
2981
|
"onImport"
|
|
2849
2982
|
]),
|
|
2850
|
-
m(
|
|
2983
|
+
m(ft, {
|
|
2851
2984
|
visible: !!k(E).editingItem.value,
|
|
2852
2985
|
item: k(E).editingItem.value,
|
|
2853
2986
|
onSave: k(E).handleEditSave,
|
|
@@ -2857,7 +2990,7 @@ var Ur = {
|
|
|
2857
2990
|
"item",
|
|
2858
2991
|
"onSave"
|
|
2859
2992
|
]),
|
|
2860
|
-
m(
|
|
2993
|
+
m(Gn, {
|
|
2861
2994
|
visible: k(v).showReplaceWarning.value,
|
|
2862
2995
|
item: k(v).pendingReplaceItem.value,
|
|
2863
2996
|
"usage-info": k(v).replaceUsageInfo.value,
|
|
@@ -2891,19 +3024,19 @@ var Ur = {
|
|
|
2891
3024
|
"-webkit-backdrop-filter": "blur(8px)"
|
|
2892
3025
|
},
|
|
2893
3026
|
onClick: n[11] ||= F((...e) => k(v).cancelDelete && k(v).cancelDelete(...e), ["self"])
|
|
2894
|
-
}, [f("div",
|
|
2895
|
-
f("h3",
|
|
3027
|
+
}, [f("div", Mi, [
|
|
3028
|
+
f("h3", Ni, D(a.value.mediaLibrary.deleteWarningTitle), 1),
|
|
2896
3029
|
f("p", {
|
|
2897
3030
|
class: y(["tpl:text-xs", k(E).hasUsedFiles.value ? "tpl:mb-2" : "tpl:mb-4"]),
|
|
2898
3031
|
style: { color: "var(--tpl-text-muted)" }
|
|
2899
3032
|
}, D(a.value.mediaLibrary.deleteWarningMessage), 3),
|
|
2900
|
-
k(E).hasUsedFiles.value ? (S(), d("p",
|
|
2901
|
-
k(E).hasUsedFiles.value ? (S(), d("div",
|
|
3033
|
+
k(E).hasUsedFiles.value ? (S(), d("p", Pi, D(a.value.mediaLibrary.deleteWarningUsageNote), 1)) : u("", !0),
|
|
3034
|
+
k(E).hasUsedFiles.value ? (S(), d("div", Fi, [(S(!0), d(i, null, T(k(v).deleteUsageInfo.value, (e, t) => (S(), d("div", {
|
|
2902
3035
|
key: t,
|
|
2903
3036
|
class: "tpl:text-xs",
|
|
2904
3037
|
style: { color: "var(--tpl-text)" }
|
|
2905
|
-
}, [e.template_count > 0 ? (S(), d(i, { key: 0 }, [f("span",
|
|
2906
|
-
f("div",
|
|
3038
|
+
}, [e.template_count > 0 ? (S(), d(i, { key: 0 }, [f("span", Ii, D(k(E).displayItems.value.find((e) => e.id === t)?.filename || t), 1), f("span", Li, " - " + D(a.value.mediaLibrary.usedInTemplates.replace("{count}", e.template_count.toString())), 1)], 64)) : u("", !0)]))), 128))])) : u("", !0),
|
|
3039
|
+
f("div", Ri, [f("button", {
|
|
2907
3040
|
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",
|
|
2908
3041
|
style: {
|
|
2909
3042
|
"border-color": "var(--tpl-border)",
|
|
@@ -2923,7 +3056,7 @@ var Ur = {
|
|
|
2923
3056
|
])])) : u("", !0)]),
|
|
2924
3057
|
_: 1
|
|
2925
3058
|
}),
|
|
2926
|
-
f("div",
|
|
3059
|
+
f("div", zi, [f("div", Bi, [k(v).previewItem.value ? (S(), l(An, {
|
|
2927
3060
|
key: 0,
|
|
2928
3061
|
"selected-conversion": k(E).selectedConversion.value,
|
|
2929
3062
|
"onUpdate:selectedConversion": n[12] ||= (e) => k(E).selectedConversion.value = e,
|
|
@@ -2933,7 +3066,7 @@ var Ur = {
|
|
|
2933
3066
|
"selected-conversion",
|
|
2934
3067
|
"item",
|
|
2935
3068
|
"folders"
|
|
2936
|
-
])) : u("", !0)]), f("div",
|
|
3069
|
+
])) : u("", !0)]), f("div", Vi, [k(v).selectedItems.value.size > 0 ? (S(), d("div", Hi, [k(v).previewItem.value ? (S(), d("button", {
|
|
2937
3070
|
key: 0,
|
|
2938
3071
|
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",
|
|
2939
3072
|
style: b({
|
|
@@ -2950,7 +3083,7 @@ var Ur = {
|
|
|
2950
3083
|
key: 0,
|
|
2951
3084
|
size: 12,
|
|
2952
3085
|
"stroke-width": 2
|
|
2953
|
-
})), p(" " + D(k(E).copied.value ? a.value.mediaLibrary.copied : a.value.mediaLibrary.copyUrl), 1)], 4)) : u("", !0), f("div",
|
|
3086
|
+
})), p(" " + D(k(E).copied.value ? a.value.mediaLibrary.copied : a.value.mediaLibrary.copyUrl), 1)], 4)) : u("", !0), f("div", Ui, [f("button", {
|
|
2954
3087
|
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",
|
|
2955
3088
|
style: {
|
|
2956
3089
|
"border-color": "var(--tpl-border)",
|
|
@@ -2958,7 +3091,7 @@ var Ur = {
|
|
|
2958
3091
|
"background-color": "var(--tpl-bg)"
|
|
2959
3092
|
},
|
|
2960
3093
|
onClick: n[14] ||= (e) => k(E).showMovePicker.value = !k(E).showMovePicker.value
|
|
2961
|
-
}, D(a.value.mediaLibrary.moveSelected), 1), k(E).showMovePicker.value ? (S(), l(
|
|
3094
|
+
}, D(a.value.mediaLibrary.moveSelected), 1), k(E).showMovePicker.value ? (S(), l(yn, {
|
|
2962
3095
|
key: 0,
|
|
2963
3096
|
folders: k(v).folders.value,
|
|
2964
3097
|
"current-folder-id": k(v).currentFolderId.value,
|
|
@@ -2968,7 +3101,7 @@ var Ur = {
|
|
|
2968
3101
|
"folders",
|
|
2969
3102
|
"current-folder-id",
|
|
2970
3103
|
"onSelect"
|
|
2971
|
-
])) : u("", !0)])])) : u("", !0), f("div",
|
|
3104
|
+
])) : u("", !0)])])) : u("", !0), f("div", Wi, [k(v).selectedItems.value.size > 0 ? (S(), d("button", {
|
|
2972
3105
|
key: 0,
|
|
2973
3106
|
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",
|
|
2974
3107
|
style: {
|
|
@@ -2986,65 +3119,33 @@ var Ur = {
|
|
|
2986
3119
|
},
|
|
2987
3120
|
disabled: !k(v).previewItem.value,
|
|
2988
3121
|
onClick: O
|
|
2989
|
-
}, D(a.value.mediaLibrary.selectFile), 9,
|
|
3122
|
+
}, D(a.value.mediaLibrary.selectFile), 9, Gi)) : u("", !0)])])])
|
|
2990
3123
|
]));
|
|
2991
3124
|
}
|
|
2992
|
-
}),
|
|
2993
|
-
|
|
2994
|
-
"./locales/de.ts": () => import("./de-ByQyu2jv.js"),
|
|
2995
|
-
"./locales/en.ts": () => import("./en-B-xajqfh.js"),
|
|
2996
|
-
"./locales/es.ts": () => import("./es-Bcp-DbmC.js"),
|
|
2997
|
-
"./locales/fr.ts": () => import("./fr-DXb0cCZG.js"),
|
|
2998
|
-
"./locales/nl.ts": () => import("./nl-DGT1t3Be.js"),
|
|
2999
|
-
"./locales/pt-BR.ts": () => import("./pt-BR-C0Hzc26R.js")
|
|
3000
|
-
});
|
|
3001
|
-
function Pi(e) {
|
|
3002
|
-
return Object.keys(e).map((e) => e.match(/\/([^/]+)\.ts$/)?.[1]).filter((e) => !!e);
|
|
3003
|
-
}
|
|
3004
|
-
var Fi = Pi(Ni);
|
|
3005
|
-
function Ii(e) {
|
|
3006
|
-
return e.trim().replace(/_/g, "-").toLowerCase();
|
|
3007
|
-
}
|
|
3008
|
-
function Li(e) {
|
|
3009
|
-
let t = Ii(e);
|
|
3010
|
-
return Fi.find((e) => Ii(e) === t);
|
|
3011
|
-
}
|
|
3012
|
-
function Ri(e) {
|
|
3013
|
-
return Ii(e).split("-")[0];
|
|
3014
|
-
}
|
|
3015
|
-
function zi(e) {
|
|
3016
|
-
return Li(e) ?? Li(Ri(e)) ?? "en";
|
|
3017
|
-
}
|
|
3018
|
-
async function Bi(e) {
|
|
3019
|
-
let t = Ni[`./locales/${zi(e)}.ts`];
|
|
3020
|
-
return (await t()).default;
|
|
3021
|
-
}
|
|
3022
|
-
//#endregion
|
|
3023
|
-
//#region src/standalone/visual.ts
|
|
3024
|
-
var Q = null, Vi = w(null);
|
|
3025
|
-
async function Hi(e) {
|
|
3125
|
+
}), Q = null, qi = w(null);
|
|
3126
|
+
async function Ji(e) {
|
|
3026
3127
|
let n = typeof e.container == "string" ? document.querySelector(e.container) : e.container;
|
|
3027
3128
|
if (!n) throw Error(`Container element not found: ${e.container}`);
|
|
3028
3129
|
let i = r(e.auth, e.onError);
|
|
3029
3130
|
await i.initialize();
|
|
3030
|
-
let a = await new t(i).fetchConfig(), o = await
|
|
3031
|
-
return
|
|
3131
|
+
let a = await new t(i).fetchConfig(), o = await ur(e.locale ?? "en");
|
|
3132
|
+
return Yi(n, e.theme), Q && $(), new Promise((t, r) => {
|
|
3032
3133
|
try {
|
|
3033
3134
|
Q = c({ setup() {
|
|
3034
3135
|
let r = () => {
|
|
3035
3136
|
t({
|
|
3036
|
-
setTheme: (e) =>
|
|
3137
|
+
setTheme: (e) => Yi(n, e),
|
|
3037
3138
|
unmount: $
|
|
3038
3139
|
});
|
|
3039
3140
|
};
|
|
3040
|
-
return () => g(
|
|
3141
|
+
return () => g(Ki, {
|
|
3041
3142
|
authManager: i,
|
|
3042
3143
|
projectId: i.projectId,
|
|
3043
3144
|
planConfig: a,
|
|
3044
3145
|
translations: o,
|
|
3045
3146
|
onSelect: e.onSelect,
|
|
3046
3147
|
onError: e.onError,
|
|
3047
|
-
ref:
|
|
3148
|
+
ref: qi,
|
|
3048
3149
|
onReady: r
|
|
3049
3150
|
});
|
|
3050
3151
|
} }), Q.mount(n);
|
|
@@ -3054,14 +3155,14 @@ async function Hi(e) {
|
|
|
3054
3155
|
});
|
|
3055
3156
|
}
|
|
3056
3157
|
function $() {
|
|
3057
|
-
Q && (Q.unmount(), Q = null,
|
|
3158
|
+
Q && (Q.unmount(), Q = null, qi.value = null);
|
|
3058
3159
|
}
|
|
3059
|
-
function
|
|
3160
|
+
function Yi(e, t) {
|
|
3060
3161
|
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`)));
|
|
3061
3162
|
}
|
|
3062
3163
|
typeof window < "u" && (window.TemplaticalMedia = {
|
|
3063
|
-
init:
|
|
3164
|
+
init: Ji,
|
|
3064
3165
|
unmount: $
|
|
3065
3166
|
});
|
|
3066
3167
|
//#endregion
|
|
3067
|
-
export {
|
|
3168
|
+
export { me as MediaApiClient, ti as MediaLibraryModal, Ji as init, $ as unmount, X as useI18n, Z as useMediaCategories, he as useMediaLibrary, ni as useMediaPicker };
|