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