@templatical/editor 0.8.4 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{AiChatSidebar-CnRXeK77.js → AiChatSidebar-BUKj9n02.js} +5 -5
- package/dist/{AiFeatureMenu-BYDDrpj6.js → AiFeatureMenu-Co14YVJt.js} +3 -3
- package/dist/{BlockIssueBadge-DM-vXeD6.js → BlockIssueBadge-DThKKeub.js} +2 -2
- package/dist/{CloudEditor-B9a_K6Cm.js → CloudEditor-CAtw_sFC.js} +218 -217
- package/dist/{CollaboratorBar-HN4whzM-.js → CollaboratorBar-Bc6q0gB9.js} +2 -2
- package/dist/{CommentsSidebar-_llWQ4VT.js → CommentsSidebar-DiH4R4F0.js} +3 -3
- package/dist/{CountdownBlock-I99sC0C5.js → CountdownBlock-BTPefclD.js} +2 -2
- package/dist/{CountdownToolbar-BUhOUiQ9.js → CountdownToolbar-Dvr2icg-.js} +2 -2
- package/dist/{DesignReferenceSidebar-0GwjUn2V.js → DesignReferenceSidebar-BP32MgpS.js} +3 -3
- package/dist/{IssuesPanel-4MKZe8yP.js → IssuesPanel-B1LT91IX.js} +2 -2
- package/dist/{ModuleBrowserModal-DPZBsvqk.js → ModuleBrowserModal-CWegFoOA.js} +77 -85
- package/dist/{ModulePreviewCanvas-CK4j11-e.js → ModulePreviewCanvas-D9WUSSRT.js} +2 -2
- package/dist/{NumberWithSuffix-CxMFy_j3.js → NumberWithSuffix-CxUBW_V2.js} +2 -2
- package/dist/{ParagraphEditor-DBus_iHH.js → ParagraphEditor-DrAz2yot.js} +126 -126
- package/dist/{RichTextEditorContent-B_KCY6T1.js → RichTextEditorContent-gR169m1-.js} +4 -4
- package/dist/{SaveModuleDialog-DORRSbBo.js → SaveModuleDialog-DWidA0c9.js} +6 -6
- package/dist/{SnapshotHistory-DTMVEk03.js → SnapshotHistory-CIo2Jaw-.js} +4 -4
- package/dist/{TemplateScoringPanel-BIwEwFxD.js → TemplateScoringPanel-seBvvn8O.js} +2 -2
- package/dist/{TestEmailModal-DJmYp0Qi.js → TestEmailModal-BuCuWp3N.js} +3 -3
- package/dist/{TitleEditor-70d9AF1V.js → TitleEditor-BmW0uMl7.js} +67 -67
- package/dist/{TplModal-BEfwlvPC.js → TplModal-YFpBaiLj.js} +4 -4
- package/dist/{blockTypeIcons-2DRoPa3K.js → blockTypeIcons-DCkHXPhx.js} +19 -11
- package/dist/bundle-stats.json +8 -8
- package/dist/cdn/chunks/{AiFeatureMenu-CcuKnisc.js → AiFeatureMenu-Dayzk2H7.js} +2 -2
- package/dist/cdn/chunks/{AiFeatureMenu-CcuKnisc.js.map → AiFeatureMenu-Dayzk2H7.js.map} +1 -1
- package/dist/cdn/chunks/{BlockIssueBadge-Sr3is7Wr.js → BlockIssueBadge-D_US2wqo.js} +4 -4
- package/dist/cdn/chunks/{BlockIssueBadge-Sr3is7Wr.js.map → BlockIssueBadge-D_US2wqo.js.map} +1 -1
- package/dist/cdn/chunks/{CloudEditor-Bi10d2Gq.js → CloudEditor-CyJItWsK.js} +186 -185
- package/dist/cdn/chunks/{CloudEditor-Bi10d2Gq.js.map → CloudEditor-CyJItWsK.js.map} +1 -1
- package/dist/cdn/chunks/{CollaboratorBar-C0zeecvl.js → CollaboratorBar-C4CFs5EJ.js} +3 -3
- package/dist/cdn/chunks/{CollaboratorBar-C0zeecvl.js.map → CollaboratorBar-C4CFs5EJ.js.map} +1 -1
- package/dist/cdn/chunks/{CountdownBlock-CpSUUDDs.js → CountdownBlock-D6lCXhZA.js} +2 -2
- package/dist/cdn/chunks/{CountdownBlock-CpSUUDDs.js.map → CountdownBlock-D6lCXhZA.js.map} +1 -1
- package/dist/cdn/chunks/{CountdownToolbar-BBzdR-00.js → CountdownToolbar-BsGUxoRv.js} +3 -3
- package/dist/cdn/chunks/{CountdownToolbar-BBzdR-00.js.map → CountdownToolbar-BsGUxoRv.js.map} +1 -1
- package/dist/cdn/chunks/{IssuesPanel-Bthq6qoZ.js → IssuesPanel-DeHTmRDz.js} +5 -5
- package/dist/cdn/chunks/{IssuesPanel-Bthq6qoZ.js.map → IssuesPanel-DeHTmRDz.js.map} +1 -1
- package/dist/cdn/chunks/{ModuleBrowserModal-CFMd6M7E.js → ModuleBrowserModal-Cgjz4xAz.js} +8 -8
- package/dist/cdn/chunks/ModuleBrowserModal-Cgjz4xAz.js.map +1 -0
- package/dist/cdn/chunks/{ModulePreviewCanvas-BkcPcF5C.js → ModulePreviewCanvas-CeS9PsAA.js} +2 -2
- package/dist/cdn/chunks/{ModulePreviewCanvas-BkcPcF5C.js.map → ModulePreviewCanvas-CeS9PsAA.js.map} +1 -1
- package/dist/cdn/chunks/{NumberWithSuffix-C2hH_ZIK.js → NumberWithSuffix-Bp-idLCc.js} +2 -2
- package/dist/cdn/chunks/{NumberWithSuffix-C2hH_ZIK.js.map → NumberWithSuffix-Bp-idLCc.js.map} +1 -1
- package/dist/cdn/chunks/{ParagraphEditor-BIWXLPfu.js → ParagraphEditor-fM9aFu8T.js} +116 -116
- package/dist/cdn/chunks/ParagraphEditor-fM9aFu8T.js.map +1 -0
- package/dist/cdn/chunks/{RichTextEditorContent-DU0gc4bi.js → RichTextEditorContent-DwNPE5H5.js} +4 -4
- package/dist/cdn/chunks/{RichTextEditorContent-DU0gc4bi.js.map → RichTextEditorContent-DwNPE5H5.js.map} +1 -1
- package/dist/cdn/chunks/{SaveModuleDialog-DR9EZlWe.js → SaveModuleDialog-BrtDXzIz.js} +4 -4
- package/dist/cdn/chunks/SaveModuleDialog-BrtDXzIz.js.map +1 -0
- package/dist/cdn/chunks/TitleEditor-D0rSnye0.js +175 -0
- package/dist/cdn/chunks/TitleEditor-D0rSnye0.js.map +1 -0
- package/dist/cdn/chunks/{blockTypeIcons-eVGGIdne.js → blockTypeIcons-YOEe5mDE.js} +3 -3
- package/dist/cdn/chunks/{blockTypeIcons-eVGGIdne.js.map → blockTypeIcons-YOEe5mDE.js.map} +1 -1
- package/dist/{de-ED7c5RpG.js → cdn/chunks/de-CATfXDKV.js} +14 -1
- package/dist/cdn/chunks/{de-ED7c5RpG.js.map → de-CATfXDKV.js.map} +1 -1
- package/dist/cdn/chunks/{en-ivilDUn0.js → en-CwCAgYL5.js} +13 -2
- package/dist/cdn/chunks/{en-ivilDUn0.js.map → en-CwCAgYL5.js.map} +1 -1
- package/dist/cdn/chunks/{extensions-CvCoOuWB.js → extensions-GYsbQFPr.js} +26 -23
- package/dist/cdn/chunks/extensions-GYsbQFPr.js.map +1 -0
- package/dist/cdn/chunks/{features-CUYy5kZQ.js → features-D-2kVhHY.js} +1264 -1188
- package/dist/cdn/chunks/features-D-2kVhHY.js.map +1 -0
- package/dist/cdn/chunks/{icons-C4zY5-I3.js → icons-fZoyKV_s.js} +2 -2
- package/dist/cdn/chunks/{icons-C4zY5-I3.js.map → icons-fZoyKV_s.js.map} +1 -1
- package/dist/cdn/chunks/{media-library-BNt3msId.js → media-library-CO2WOETY.js} +240 -240
- package/dist/cdn/chunks/{media-library-BNt3msId.js.map → media-library-CO2WOETY.js.map} +1 -1
- package/dist/{pt-BR-B5tm2iBl.js → cdn/chunks/pt-BR-D3Mg7AKe.js} +14 -1
- package/dist/cdn/chunks/{pt-BR-B5tm2iBl.js.map → pt-BR-D3Mg7AKe.js.map} +1 -1
- package/dist/cdn/chunks/{quality-BTPRPGB-.js → quality-BxPiS-wv.js} +603 -577
- package/dist/cdn/chunks/{quality-BTPRPGB-.js.map → quality-BxPiS-wv.js.map} +1 -1
- package/dist/cdn/chunks/{renderer-IOmuuZjJ.js → renderer-7z2t_bYQ.js} +142 -108
- package/dist/cdn/chunks/{renderer-IOmuuZjJ.js.map → renderer-7z2t_bYQ.js.map} +1 -1
- package/dist/cdn/chunks/{src-Dp0ZFQ4-.js → src-ftxPuuQh.js} +4 -4
- package/dist/cdn/chunks/{src-Dp0ZFQ4-.js.map → src-ftxPuuQh.js.map} +1 -1
- package/dist/cdn/chunks/{styles-DtgjgsBH.js → styles-o0HIrw9F.js} +877 -622
- package/dist/cdn/chunks/styles-o0HIrw9F.js.map +1 -0
- package/dist/cdn/chunks/{tiptap-BErAJEvo.js → tiptap-BBbH3IT9.js} +849 -725
- package/dist/cdn/chunks/tiptap-BBbH3IT9.js.map +1 -0
- package/dist/cdn/editor.css +1 -1
- package/dist/cdn/editor.js +102 -101
- package/dist/cdn/editor.js.map +1 -1
- package/dist/{cloud-Dz8Ay2FM.js → cloud-VxYMtfXC.js} +1 -1
- package/dist/{cdn/chunks/de-ED7c5RpG.js → de-CATfXDKV.js} +12 -3
- package/dist/{dist-BygsE-n3.js → dist-BDgf2G-V.js} +453 -314
- package/dist/{dist-BtDBsF3N.js → dist-BxP6TB0l.js} +2 -2
- package/dist/{dist-DWhP3Dp2.js → dist-BzuC8o3y.js} +1209 -1217
- package/dist/{dist-v-O2Subd.js → dist-C0jo8wtG.js} +2 -2
- package/dist/{dist-BTgujVMy.js → dist-C8wMh_gi.js} +2 -2
- package/dist/{dist-Cipw2HFH.js → dist-CIV3Brg-.js} +37 -4
- package/dist/{dist-HO0vjY5Z.js → dist-CNLAS2v2.js} +130 -124
- package/dist/{dist-BS5Oi67L.js → dist-CUpJmrjt.js} +2 -2
- package/dist/dist-D5lmdi1F.js +5 -0
- package/dist/{dist-T-ORzNfM.js → dist-D8C6jIXM.js} +168 -175
- package/dist/dist-DILjuzSv.js +5 -0
- package/dist/{dist-CDtcJMB2.js → dist-DXaxGLsw.js} +33 -33
- package/dist/{dist-DnGTaPRX.js → dist-DYO-w_Jf.js} +2 -2
- package/dist/{dist-CDZCyoRy.js → dist-UK-lbEBc.js} +2 -2
- package/dist/{en-ivilDUn0.js → en-CwCAgYL5.js} +12 -1
- package/dist/{extensions-BmGiz8Oo.js → extensions-Mj2-D8uK.js} +32 -29
- package/dist/{keys-B8K7Z7Ef.js → keys-BiQlvx51.js} +3 -3
- package/dist/{cdn/chunks/pt-BR-B5tm2iBl.js → pt-BR-D3Mg7AKe.js} +12 -3
- package/dist/style.css +1 -1
- package/dist/{styles-DFeOGKa_.js → styles-CJtcKmsx.js} +857 -601
- package/dist/templatical-editor.js +104 -103
- package/dist/{useCloudI18n-DFzVgYhJ.js → useCloudI18n-DKWJg6rJ.js} +1 -1
- package/dist/{useEditorCore-BXz-UXPd.js → useEditorCore-CEkf_VWX.js} +663 -633
- package/dist/{useI18n-CBbStVlD.js → useI18n-Besvmtxy.js} +1 -1
- package/dist/useMergeTag-WNzaCpXR.js +44 -0
- package/dist/{usePopoverRoot-62PlZQQ3.js → usePopoverRoot-CKt956u-.js} +1 -1
- package/package.json +21 -21
- package/dist/cdn/chunks/ModuleBrowserModal-CFMd6M7E.js.map +0 -1
- package/dist/cdn/chunks/ParagraphEditor-BIWXLPfu.js.map +0 -1
- package/dist/cdn/chunks/SaveModuleDialog-DR9EZlWe.js.map +0 -1
- package/dist/cdn/chunks/TitleEditor-DZcx2N4R.js +0 -175
- package/dist/cdn/chunks/TitleEditor-DZcx2N4R.js.map +0 -1
- package/dist/cdn/chunks/extensions-CvCoOuWB.js.map +0 -1
- package/dist/cdn/chunks/features-CUYy5kZQ.js.map +0 -1
- package/dist/cdn/chunks/styles-DtgjgsBH.js.map +0 -1
- package/dist/cdn/chunks/tiptap-BErAJEvo.js.map +0 -1
- package/dist/dist-BySzGkeC.js +0 -5
- package/dist/dist-D7JUZ2Kd.js +0 -5
- package/dist/useMergeTag-CS2bmWA0.js +0 -34
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { D as e, F as t, H as n, I as r, K as i, L as a, M as o, N as s, P as c, T as l, V as u, Z as d, c as f, ct as p, d as m, f as h, g, h as _, it as v, l as y, m as b, n as x, o as S, ot as C, p as w, s as T, st as E, tt as D, u as O, v as k, x as A, y as j, z as ee } from "./draggable-BwWMFq33.js";
|
|
2
|
-
import { At as M,
|
|
3
|
-
import { A as pe, E as me, G as he, J as ge, R as _e, V as ve, b as ye, m as be, q as xe } from "./icons-
|
|
2
|
+
import { At as M, Ot as te, T as N, an as ne, at as re, cn as P, ct as ie, dn as F, ht as I, in as ae, ln as L, mt as oe, on as se, ot as ce, rt as le, sn as ue, vt as de, w as R, wt as fe } from "./features-D-2kVhHY.js";
|
|
3
|
+
import { A as pe, E as me, G as he, J as ge, R as _e, V as ve, b as ye, m as be, q as xe } from "./icons-fZoyKV_s.js";
|
|
4
4
|
//#region ../media-library/src/api-client.ts
|
|
5
5
|
var Se = class {
|
|
6
6
|
authManager;
|
|
@@ -37,7 +37,7 @@ var Se = class {
|
|
|
37
37
|
async browseMedia(e) {
|
|
38
38
|
let t = new URLSearchParams();
|
|
39
39
|
e.folder_id && t.set("folder_id", e.folder_id), e.search && t.set("search", e.search), e.category && t.set("category", e.category), e.sort && t.set("sort", e.sort), e.cursor && t.set("cursor", e.cursor);
|
|
40
|
-
let n = t.toString(), r = `${N(
|
|
40
|
+
let n = t.toString(), r = `${N(R["media.browse"], this.baseParams)}${n ? `?${n}` : ""}`, i = await this.authManager.authenticatedFetch(r, { headers: { Accept: "application/json" } });
|
|
41
41
|
if (!i.ok) {
|
|
42
42
|
let e = await i.json().catch(() => ({ message: `HTTP error ${i.status}` }));
|
|
43
43
|
throw Error(e.message, { cause: e });
|
|
@@ -47,7 +47,7 @@ var Se = class {
|
|
|
47
47
|
async uploadMedia(e, t) {
|
|
48
48
|
let n = new FormData();
|
|
49
49
|
n.append("file", e), t && n.append("folder_id", t);
|
|
50
|
-
let r = N(
|
|
50
|
+
let r = N(R["media.upload"], this.baseParams), i = await this.authManager.authenticatedFetch(r, {
|
|
51
51
|
method: "POST",
|
|
52
52
|
headers: { Accept: "application/json" },
|
|
53
53
|
body: n
|
|
@@ -59,7 +59,7 @@ var Se = class {
|
|
|
59
59
|
return (await i.json()).data;
|
|
60
60
|
}
|
|
61
61
|
async updateMedia(e, t, n) {
|
|
62
|
-
return this.request(N(
|
|
62
|
+
return this.request(N(R["media.update"], {
|
|
63
63
|
...this.baseParams,
|
|
64
64
|
media: e
|
|
65
65
|
}), {
|
|
@@ -71,13 +71,13 @@ var Se = class {
|
|
|
71
71
|
});
|
|
72
72
|
}
|
|
73
73
|
async deleteMedia(e) {
|
|
74
|
-
return this.request(N(
|
|
74
|
+
return this.request(N(R["media.delete"], this.baseParams), {
|
|
75
75
|
method: "POST",
|
|
76
76
|
body: JSON.stringify({ ids: e })
|
|
77
77
|
});
|
|
78
78
|
}
|
|
79
79
|
async moveMedia(e, t) {
|
|
80
|
-
return this.request(N(
|
|
80
|
+
return this.request(N(R["media.move"], this.baseParams), {
|
|
81
81
|
method: "POST",
|
|
82
82
|
body: JSON.stringify({
|
|
83
83
|
ids: e,
|
|
@@ -86,10 +86,10 @@ var Se = class {
|
|
|
86
86
|
});
|
|
87
87
|
}
|
|
88
88
|
async getMediaFolders() {
|
|
89
|
-
return this.request(N(
|
|
89
|
+
return this.request(N(R["folders.index"], this.baseParams));
|
|
90
90
|
}
|
|
91
91
|
async createMediaFolder(e, t) {
|
|
92
|
-
return this.request(N(
|
|
92
|
+
return this.request(N(R["folders.store"], this.baseParams), {
|
|
93
93
|
method: "POST",
|
|
94
94
|
body: JSON.stringify({
|
|
95
95
|
name: e,
|
|
@@ -98,7 +98,7 @@ var Se = class {
|
|
|
98
98
|
});
|
|
99
99
|
}
|
|
100
100
|
async renameMediaFolder(e, t) {
|
|
101
|
-
return this.request(N(
|
|
101
|
+
return this.request(N(R["folders.update"], {
|
|
102
102
|
...this.baseParams,
|
|
103
103
|
mediaFolder: e
|
|
104
104
|
}), {
|
|
@@ -107,13 +107,13 @@ var Se = class {
|
|
|
107
107
|
});
|
|
108
108
|
}
|
|
109
109
|
async deleteMediaFolder(e) {
|
|
110
|
-
return this.request(N(
|
|
110
|
+
return this.request(N(R["folders.destroy"], {
|
|
111
111
|
...this.baseParams,
|
|
112
112
|
mediaFolder: e
|
|
113
113
|
}), { method: "DELETE" });
|
|
114
114
|
}
|
|
115
115
|
async checkMediaUsage(e) {
|
|
116
|
-
let t = await this.authManager.authenticatedFetch(N(
|
|
116
|
+
let t = await this.authManager.authenticatedFetch(N(R["media.checkUsage"], this.baseParams), {
|
|
117
117
|
method: "POST",
|
|
118
118
|
headers: {
|
|
119
119
|
"Content-Type": "application/json",
|
|
@@ -128,10 +128,10 @@ var Se = class {
|
|
|
128
128
|
return t.json();
|
|
129
129
|
}
|
|
130
130
|
async getFrequentlyUsed() {
|
|
131
|
-
return this.request(N(
|
|
131
|
+
return this.request(N(R["media.frequentlyUsed"], this.baseParams));
|
|
132
132
|
}
|
|
133
133
|
async importFromUrl(e, t) {
|
|
134
|
-
return this.request(N(
|
|
134
|
+
return this.request(N(R["media.importFromUrl"], this.baseParams), {
|
|
135
135
|
method: "POST",
|
|
136
136
|
body: JSON.stringify({
|
|
137
137
|
url: e,
|
|
@@ -142,7 +142,7 @@ var Se = class {
|
|
|
142
142
|
async replaceMedia(e, t) {
|
|
143
143
|
let n = new FormData();
|
|
144
144
|
n.append("file", t);
|
|
145
|
-
let r = N(
|
|
145
|
+
let r = N(R["media.replace"], {
|
|
146
146
|
...this.baseParams,
|
|
147
147
|
media: e
|
|
148
148
|
}), i = await this.authManager.authenticatedFetch(r, {
|
|
@@ -211,13 +211,13 @@ function Ce(e) {
|
|
|
211
211
|
async function M(e) {
|
|
212
212
|
c.value = e, await k();
|
|
213
213
|
}
|
|
214
|
-
async function
|
|
214
|
+
async function te(e) {
|
|
215
215
|
a.value = "files", i.value = e, o.value = "", h.value = /* @__PURE__ */ new Set(), g.value = null, await k();
|
|
216
216
|
}
|
|
217
|
-
async function
|
|
218
|
-
a.value = "frequently-used", i.value = null, o.value = "", h.value = /* @__PURE__ */ new Set(), g.value = null, await
|
|
217
|
+
async function N() {
|
|
218
|
+
a.value = "frequently-used", i.value = null, o.value = "", h.value = /* @__PURE__ */ new Set(), g.value = null, await I();
|
|
219
219
|
}
|
|
220
|
-
async function
|
|
220
|
+
async function ne(r) {
|
|
221
221
|
u.value = !0;
|
|
222
222
|
try {
|
|
223
223
|
let e = await t.uploadMedia(r, i.value);
|
|
@@ -228,7 +228,7 @@ function Ce(e) {
|
|
|
228
228
|
u.value = !1;
|
|
229
229
|
}
|
|
230
230
|
}
|
|
231
|
-
async function
|
|
231
|
+
async function re(r) {
|
|
232
232
|
u.value = !0, m.value = {
|
|
233
233
|
current: 0,
|
|
234
234
|
total: r.length
|
|
@@ -249,7 +249,7 @@ function Ce(e) {
|
|
|
249
249
|
u.value = !1, m.value = null;
|
|
250
250
|
}
|
|
251
251
|
}
|
|
252
|
-
async function
|
|
252
|
+
async function P(r) {
|
|
253
253
|
if (h.value.size !== 0) try {
|
|
254
254
|
let e = await t.moveMedia([...h.value], r);
|
|
255
255
|
if (i.value === null) {
|
|
@@ -261,7 +261,7 @@ function Ce(e) {
|
|
|
261
261
|
e.onError?.(t);
|
|
262
262
|
}
|
|
263
263
|
}
|
|
264
|
-
async function
|
|
264
|
+
async function ie(r, i, a) {
|
|
265
265
|
try {
|
|
266
266
|
let e = await t.updateMedia(r, i, a);
|
|
267
267
|
n.value = n.value.map((t) => t.id === r ? e : t), g.value?.id === r && (g.value = e);
|
|
@@ -269,21 +269,21 @@ function Ce(e) {
|
|
|
269
269
|
e.onError?.(t);
|
|
270
270
|
}
|
|
271
271
|
}
|
|
272
|
-
async function
|
|
272
|
+
async function F() {
|
|
273
273
|
if (h.value.size !== 0) try {
|
|
274
274
|
await t.deleteMedia([...h.value]), n.value = n.value.filter((e) => !h.value.has(e.id)), _.value = _.value.filter((e) => !h.value.has(e.id)), h.value = /* @__PURE__ */ new Set(), g.value = null;
|
|
275
275
|
} catch (t) {
|
|
276
276
|
e.onError?.(t);
|
|
277
277
|
}
|
|
278
278
|
}
|
|
279
|
-
async function
|
|
279
|
+
async function I() {
|
|
280
280
|
try {
|
|
281
281
|
_.value = await t.getFrequentlyUsed();
|
|
282
282
|
} catch (t) {
|
|
283
283
|
e.onError?.(t);
|
|
284
284
|
}
|
|
285
285
|
}
|
|
286
|
-
async function
|
|
286
|
+
async function ae() {
|
|
287
287
|
if (h.value.size === 0) return !1;
|
|
288
288
|
b.value = [...h.value];
|
|
289
289
|
try {
|
|
@@ -295,17 +295,17 @@ function Ce(e) {
|
|
|
295
295
|
return e.onError?.(t), !1;
|
|
296
296
|
}
|
|
297
297
|
}
|
|
298
|
-
async function
|
|
298
|
+
async function L() {
|
|
299
299
|
if (y.value = !1, b.value.length !== 0) try {
|
|
300
300
|
await t.deleteMedia(b.value), n.value = n.value.filter((e) => !b.value.includes(e.id)), _.value = _.value.filter((e) => !b.value.includes(e.id)), h.value = /* @__PURE__ */ new Set(), g.value = null, b.value = [], v.value = {};
|
|
301
301
|
} catch (t) {
|
|
302
302
|
e.onError?.(t);
|
|
303
303
|
}
|
|
304
304
|
}
|
|
305
|
-
function
|
|
305
|
+
function oe() {
|
|
306
306
|
y.value = !1, b.value = [], v.value = {};
|
|
307
307
|
}
|
|
308
|
-
async function
|
|
308
|
+
async function se(r) {
|
|
309
309
|
x.value = !0, S.value = null;
|
|
310
310
|
try {
|
|
311
311
|
let e = await t.importFromUrl(r, i.value);
|
|
@@ -316,27 +316,27 @@ function Ce(e) {
|
|
|
316
316
|
x.value = !1;
|
|
317
317
|
}
|
|
318
318
|
}
|
|
319
|
-
function
|
|
319
|
+
function ce(e) {
|
|
320
320
|
let t = new Set(h.value);
|
|
321
321
|
t.has(e) ? t.delete(e) : t.add(e), h.value = t;
|
|
322
322
|
}
|
|
323
|
-
function
|
|
323
|
+
function le() {
|
|
324
324
|
h.value = /* @__PURE__ */ new Set(), g.value = null;
|
|
325
325
|
}
|
|
326
|
-
function
|
|
326
|
+
function ue(e) {
|
|
327
327
|
g.value = e, h.value = new Set([e.id]);
|
|
328
328
|
}
|
|
329
|
-
async function
|
|
329
|
+
async function de() {
|
|
330
330
|
try {
|
|
331
331
|
r.value = await t.getMediaFolders();
|
|
332
332
|
} catch (t) {
|
|
333
333
|
e.onError?.(t);
|
|
334
334
|
}
|
|
335
335
|
}
|
|
336
|
-
async function
|
|
336
|
+
async function R(n, r) {
|
|
337
337
|
try {
|
|
338
338
|
let e = await t.createMediaFolder(n, r);
|
|
339
|
-
return await
|
|
339
|
+
return await de(), e;
|
|
340
340
|
} catch (t) {
|
|
341
341
|
return e.onError?.(t), null;
|
|
342
342
|
}
|
|
@@ -353,7 +353,7 @@ function Ce(e) {
|
|
|
353
353
|
}
|
|
354
354
|
async function pe(n, r) {
|
|
355
355
|
try {
|
|
356
|
-
await t.renameMediaFolder(n, r), await
|
|
356
|
+
await t.renameMediaFolder(n, r), await de();
|
|
357
357
|
} catch (t) {
|
|
358
358
|
e.onError?.(t);
|
|
359
359
|
}
|
|
@@ -361,7 +361,7 @@ function Ce(e) {
|
|
|
361
361
|
async function me(n) {
|
|
362
362
|
try {
|
|
363
363
|
let e = fe(r.value, n)?.parent_id ?? null;
|
|
364
|
-
await t.deleteMediaFolder(n), i.value === n && (i.value = e), await
|
|
364
|
+
await t.deleteMediaFolder(n), i.value === n && (i.value = e), await de(), await k();
|
|
365
365
|
} catch (t) {
|
|
366
366
|
e.onError?.(t);
|
|
367
367
|
}
|
|
@@ -419,28 +419,28 @@ function Ce(e) {
|
|
|
419
419
|
search: j,
|
|
420
420
|
filterByCategory: ee,
|
|
421
421
|
sortBy: M,
|
|
422
|
-
navigateToFolder:
|
|
423
|
-
showFrequentlyUsed:
|
|
424
|
-
uploadFile:
|
|
425
|
-
uploadFiles:
|
|
426
|
-
moveSelected:
|
|
427
|
-
updateFile:
|
|
428
|
-
deleteSelected:
|
|
422
|
+
navigateToFolder: te,
|
|
423
|
+
showFrequentlyUsed: N,
|
|
424
|
+
uploadFile: ne,
|
|
425
|
+
uploadFiles: re,
|
|
426
|
+
moveSelected: P,
|
|
427
|
+
updateFile: ie,
|
|
428
|
+
deleteSelected: F,
|
|
429
429
|
isImportingFromUrl: x,
|
|
430
430
|
importFromUrlError: S,
|
|
431
|
-
importFromUrl:
|
|
432
|
-
toggleSelection:
|
|
433
|
-
clearSelection:
|
|
434
|
-
selectItem:
|
|
435
|
-
loadFolders:
|
|
436
|
-
createFolder:
|
|
431
|
+
importFromUrl: se,
|
|
432
|
+
toggleSelection: ce,
|
|
433
|
+
clearSelection: le,
|
|
434
|
+
selectItem: ue,
|
|
435
|
+
loadFolders: de,
|
|
436
|
+
createFolder: R,
|
|
437
437
|
renameFolder: pe,
|
|
438
438
|
deleteFolder: me,
|
|
439
439
|
findFolderInTree: fe,
|
|
440
|
-
loadFrequentlyUsed:
|
|
441
|
-
checkUsageBeforeDelete:
|
|
442
|
-
confirmDelete:
|
|
443
|
-
cancelDelete:
|
|
440
|
+
loadFrequentlyUsed: I,
|
|
441
|
+
checkUsageBeforeDelete: ae,
|
|
442
|
+
confirmDelete: L,
|
|
443
|
+
cancelDelete: oe,
|
|
444
444
|
isReplacing: C,
|
|
445
445
|
replaceError: w,
|
|
446
446
|
showReplaceWarning: T,
|
|
@@ -497,7 +497,7 @@ var we = {
|
|
|
497
497
|
class: "tpl:transition-colors tpl:duration-150 tpl:hover:underline",
|
|
498
498
|
style: { color: "var(--tpl-primary)" },
|
|
499
499
|
onClick: t[0] ||= (e) => r("navigate", null)
|
|
500
|
-
}, p(v(i).mediaLibrary.allFiles), 1), (o(!0), g(O, null, c(a.value, (e, t) => (o(), g(O, { key: e.id }, [j(v(
|
|
500
|
+
}, p(v(i).mediaLibrary.allFiles), 1), (o(!0), g(O, null, c(a.value, (e, t) => (o(), g(O, { key: e.id }, [j(v(te), {
|
|
501
501
|
size: 12,
|
|
502
502
|
"stroke-width": 2
|
|
503
503
|
}), t < a.value.length - 1 ? (o(), g("button", {
|
|
@@ -4134,54 +4134,54 @@ var Dn = ["data-tpl-theme"], On = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, kn
|
|
|
4134
4134
|
},
|
|
4135
4135
|
emits: ["save", "close"],
|
|
4136
4136
|
setup(e, { emit: t }) {
|
|
4137
|
-
let r = e, i = t, { t: a } = z(), s = l("tplUiTheme"), f = l(Pe, d(null)), T = a.mediaLibrary, { isImageMimeType: D } = Oe(), A = d(""), M = d(""),
|
|
4137
|
+
let r = e, i = t, { t: a } = z(), s = l("tplUiTheme"), f = l(Pe, d(null)), T = a.mediaLibrary, { isImageMimeType: D } = Oe(), A = d(""), M = d(""), te = d(null), N = d("free"), ne = d(void 0), re = d(void 0), P = d(""), ie = d(""), F = d(void 0), I = d(null), ae = d(!1), L = d(!1), oe = d(!1), se = h(() => r.item ? [
|
|
4138
4138
|
"image/jpeg",
|
|
4139
4139
|
"image/png",
|
|
4140
4140
|
"image/webp",
|
|
4141
4141
|
"image/gif"
|
|
4142
|
-
].includes(r.item.mime_type) : !1),
|
|
4142
|
+
].includes(r.item.mime_type) : !1), ce = h(() => N.value === "original" ? F.value : ke[N.value]), le = h(() => I.value ? Ne(I.value.width, I.value.height, ne.value, re.value) : null);
|
|
4143
4143
|
ee(() => r.visible, (e) => {
|
|
4144
|
-
e && r.item && (A.value = r.item.filename, M.value = r.item.alt_text || "",
|
|
4144
|
+
e && r.item && (A.value = r.item.filename, M.value = r.item.alt_text || "", N.value = "free", ne.value = void 0, re.value = void 0, P.value = "", ie.value = "", F.value = void 0, I.value = null, ae.value = !1, oe.value = !1, r.item.width && r.item.height && (F.value = r.item.width / r.item.height));
|
|
4145
4145
|
});
|
|
4146
|
-
function
|
|
4147
|
-
e.coordinates && (
|
|
4146
|
+
function ue(e) {
|
|
4147
|
+
e.coordinates && (I.value = {
|
|
4148
4148
|
width: Math.round(e.coordinates.width),
|
|
4149
4149
|
height: Math.round(e.coordinates.height)
|
|
4150
|
-
},
|
|
4150
|
+
}, oe.value = !0);
|
|
4151
4151
|
}
|
|
4152
|
-
function
|
|
4153
|
-
|
|
4152
|
+
function de() {
|
|
4153
|
+
ae.value = !0, !F.value && r.item?.width && r.item?.height && (F.value = r.item.width / r.item.height);
|
|
4154
4154
|
}
|
|
4155
|
-
function
|
|
4155
|
+
function R(e) {
|
|
4156
4156
|
let t = e.target.value;
|
|
4157
|
-
|
|
4157
|
+
P.value = t, ne.value = t && parseInt(t, 10) || void 0;
|
|
4158
4158
|
}
|
|
4159
4159
|
function fe(e) {
|
|
4160
4160
|
let t = e.target.value;
|
|
4161
|
-
|
|
4161
|
+
ie.value = t, re.value = t && parseInt(t, 10) || void 0;
|
|
4162
4162
|
}
|
|
4163
4163
|
async function pe() {
|
|
4164
4164
|
let e = A.value.trim();
|
|
4165
|
-
if (!e || !r.item ||
|
|
4165
|
+
if (!e || !r.item || L.value) return;
|
|
4166
4166
|
let t = D(r.item.mime_type), n;
|
|
4167
|
-
if (
|
|
4168
|
-
|
|
4167
|
+
if (se.value && te.value && oe.value) {
|
|
4168
|
+
L.value = !0;
|
|
4169
4169
|
try {
|
|
4170
|
-
let { canvas: e } =
|
|
4170
|
+
let { canvas: e } = te.value.getResult();
|
|
4171
4171
|
if (e) {
|
|
4172
|
-
let t = je(e,
|
|
4172
|
+
let t = je(e, ne.value, re.value), i = Ae(r.item.mime_type);
|
|
4173
4173
|
n = { file: await Me(t, r.item.filename, i) };
|
|
4174
4174
|
}
|
|
4175
4175
|
} catch {
|
|
4176
|
-
|
|
4176
|
+
L.value = !1;
|
|
4177
4177
|
return;
|
|
4178
4178
|
}
|
|
4179
|
-
|
|
4179
|
+
L.value = !1;
|
|
4180
4180
|
}
|
|
4181
4181
|
i("save", r.item.id, e, t ? M.value : void 0, n), i("close");
|
|
4182
4182
|
}
|
|
4183
4183
|
function me(e) {
|
|
4184
|
-
e.key === "Enter" && !
|
|
4184
|
+
e.key === "Enter" && !L.value && (e.preventDefault(), pe()), e.key === "Escape" && i("close");
|
|
4185
4185
|
}
|
|
4186
4186
|
return (t, r) => (o(), b(m, { to: v(f) || "body" }, [j(x, {
|
|
4187
4187
|
"enter-active-class": "tpl:transition tpl:ease-out tpl:duration-150",
|
|
@@ -4199,20 +4199,20 @@ var Dn = ["data-tpl-theme"], On = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, kn
|
|
|
4199
4199
|
onClick: r[3] ||= y((e) => i("close"), ["self"]),
|
|
4200
4200
|
onKeydown: me
|
|
4201
4201
|
}, [w("div", {
|
|
4202
|
-
class: C(["tpl:mx-4 tpl:flex tpl:max-h-[90vh] tpl:w-full tpl:flex-col tpl:overflow-hidden tpl:rounded-lg tpl:shadow-xl",
|
|
4202
|
+
class: C(["tpl:mx-4 tpl:flex tpl:max-h-[90vh] tpl:w-full tpl:flex-col tpl:overflow-hidden tpl:rounded-lg tpl:shadow-xl", se.value ? "tpl:max-w-2xl" : "tpl:max-w-sm"]),
|
|
4203
4203
|
style: { "background-color": "var(--tpl-bg-elevated)" }
|
|
4204
4204
|
}, [
|
|
4205
4205
|
w("div", On, [w("h3", kn, p(v(a).mediaLibrary.editFile), 1)]),
|
|
4206
4206
|
w("div", An, [
|
|
4207
|
-
|
|
4207
|
+
se.value ? (o(), g("div", jn, [w("div", Mn, [j(v(wn), {
|
|
4208
4208
|
ref_key: "cropperRef",
|
|
4209
|
-
ref:
|
|
4209
|
+
ref: te,
|
|
4210
4210
|
src: e.item.url,
|
|
4211
|
-
"stencil-props": { aspectRatio:
|
|
4211
|
+
"stencil-props": { aspectRatio: ce.value },
|
|
4212
4212
|
class: "tpl:h-full tpl:w-full",
|
|
4213
4213
|
"background-class": "tpl-cropper-background",
|
|
4214
|
-
onChange:
|
|
4215
|
-
onReady:
|
|
4214
|
+
onChange: ue,
|
|
4215
|
+
onReady: de
|
|
4216
4216
|
}, null, 8, ["src", "stencil-props"])]), w("div", Nn, [
|
|
4217
4217
|
w("div", null, [w("label", Pn, p(v(a).mediaLibrary.cropAspectRatio), 1), w("div", Fn, [(o(), g(O, null, c([
|
|
4218
4218
|
"free",
|
|
@@ -4225,14 +4225,14 @@ var Dn = ["data-tpl-theme"], On = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, kn
|
|
|
4225
4225
|
type: "button",
|
|
4226
4226
|
class: "tpl:cursor-pointer tpl:rounded-md tpl:border tpl:px-2.5 tpl:py-1 tpl:text-xs tpl:font-medium tpl:transition-all tpl:duration-150",
|
|
4227
4227
|
style: E({
|
|
4228
|
-
borderColor:
|
|
4229
|
-
backgroundColor:
|
|
4230
|
-
color:
|
|
4228
|
+
borderColor: N.value === e ? "var(--tpl-primary)" : "var(--tpl-border)",
|
|
4229
|
+
backgroundColor: N.value === e ? "var(--tpl-primary-light)" : "var(--tpl-bg)",
|
|
4230
|
+
color: N.value === e ? "var(--tpl-primary)" : "var(--tpl-text)"
|
|
4231
4231
|
}),
|
|
4232
|
-
onClick: (t) =>
|
|
4232
|
+
onClick: (t) => N.value = e
|
|
4233
4233
|
}, p(v(T)[`crop${e.charAt(0).toUpperCase()}${e.slice(1)}`]), 13, In)), 64))])]),
|
|
4234
4234
|
w("div", Ln, [w("div", Rn, [w("label", zn, [k(p(v(a).mediaLibrary.cropMaxWidth) + " ", 1), w("span", Bn, p(v(a).mediaLibrary.cropOptional), 1)]), w("div", Vn, [w("input", {
|
|
4235
|
-
value:
|
|
4235
|
+
value: P.value,
|
|
4236
4236
|
type: "number",
|
|
4237
4237
|
min: "1",
|
|
4238
4238
|
class: "tpl:w-full tpl:rounded-md tpl:border tpl:py-1.5 tpl:pr-8 tpl:pl-3 tpl:text-xs tpl:outline-none",
|
|
@@ -4241,10 +4241,10 @@ var Dn = ["data-tpl-theme"], On = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, kn
|
|
|
4241
4241
|
"background-color": "var(--tpl-bg)",
|
|
4242
4242
|
color: "var(--tpl-text)"
|
|
4243
4243
|
},
|
|
4244
|
-
placeholder:
|
|
4245
|
-
onInput:
|
|
4244
|
+
placeholder: I.value?.width?.toString() || "",
|
|
4245
|
+
onInput: R
|
|
4246
4246
|
}, null, 40, Hn), w("span", Un, p(v(a).mediaLibrary.cropPixels), 1)])]), w("div", Wn, [w("label", Gn, [k(p(v(a).mediaLibrary.cropMaxHeight) + " ", 1), w("span", Kn, p(v(a).mediaLibrary.cropOptional), 1)]), w("div", qn, [w("input", {
|
|
4247
|
-
value:
|
|
4247
|
+
value: ie.value,
|
|
4248
4248
|
type: "number",
|
|
4249
4249
|
min: "1",
|
|
4250
4250
|
class: "tpl:w-full tpl:rounded-md tpl:border tpl:py-1.5 tpl:pr-8 tpl:pl-3 tpl:text-xs tpl:outline-none",
|
|
@@ -4253,10 +4253,10 @@ var Dn = ["data-tpl-theme"], On = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, kn
|
|
|
4253
4253
|
"background-color": "var(--tpl-bg)",
|
|
4254
4254
|
color: "var(--tpl-text)"
|
|
4255
4255
|
},
|
|
4256
|
-
placeholder:
|
|
4256
|
+
placeholder: I.value?.height?.toString() || "",
|
|
4257
4257
|
onInput: fe
|
|
4258
4258
|
}, null, 40, Jn), w("span", Yn, p(v(a).mediaLibrary.cropPixels), 1)])])]),
|
|
4259
|
-
|
|
4259
|
+
le.value ? (o(), g("div", Xn, [w("span", null, p(v(a).mediaLibrary.cropOutputSize) + ": ", 1), w("span", Zn, p(le.value.width) + " x " + p(le.value.height) + " " + p(v(a).mediaLibrary.cropPixels), 1)])) : _("", !0)
|
|
4260
4260
|
])])) : _("", !0),
|
|
4261
4261
|
w("div", Qn, [w("label", $n, p(v(a).mediaLibrary.fileName), 1), n(w("input", {
|
|
4262
4262
|
"onUpdate:modelValue": r[0] ||= (e) => A.value = e,
|
|
@@ -4267,7 +4267,7 @@ var Dn = ["data-tpl-theme"], On = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, kn
|
|
|
4267
4267
|
"background-color": "var(--tpl-bg)",
|
|
4268
4268
|
color: "var(--tpl-text)"
|
|
4269
4269
|
},
|
|
4270
|
-
autofocus: !
|
|
4270
|
+
autofocus: !se.value
|
|
4271
4271
|
}, null, 8, er), [[S, A.value]])]),
|
|
4272
4272
|
v(D)(e.item.mime_type) ? (o(), g("div", tr, [w("label", nr, p(v(a).mediaLibrary.altText), 1), n(w("input", {
|
|
4273
4273
|
"onUpdate:modelValue": r[1] ||= (e) => M.value = e,
|
|
@@ -4292,9 +4292,9 @@ var Dn = ["data-tpl-theme"], On = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, kn
|
|
|
4292
4292
|
}, p(v(a).mediaLibrary.cancel), 1), w("button", {
|
|
4293
4293
|
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",
|
|
4294
4294
|
style: { background: "linear-gradient(\n 135deg,\n var(--tpl-primary),\n var(--tpl-primary-hover)\n )" },
|
|
4295
|
-
disabled:
|
|
4295
|
+
disabled: L.value,
|
|
4296
4296
|
onClick: pe
|
|
4297
|
-
}, p(
|
|
4297
|
+
}, p(L.value ? v(a).mediaLibrary.saving : v(a).mediaLibrary.saveChanges), 9, ar)])
|
|
4298
4298
|
], 2)], 40, Dn)) : _("", !0)]),
|
|
4299
4299
|
_: 1
|
|
4300
4300
|
})], 8, ["to"]));
|
|
@@ -4327,26 +4327,26 @@ var Dn = ["data-tpl-theme"], On = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, kn
|
|
|
4327
4327
|
for (let n of e) if (n.id === t || n.children && N(n.children, t)) return !0;
|
|
4328
4328
|
return !1;
|
|
4329
4329
|
}
|
|
4330
|
-
function
|
|
4330
|
+
function ne() {
|
|
4331
4331
|
l.value = !l.value;
|
|
4332
4332
|
}
|
|
4333
|
-
function
|
|
4333
|
+
function re() {
|
|
4334
4334
|
u.value = !0, m.value = i.folder.name;
|
|
4335
4335
|
}
|
|
4336
|
-
function
|
|
4336
|
+
function P() {
|
|
4337
4337
|
let e = m.value.trim();
|
|
4338
4338
|
e && e !== i.folder.name && a("renameFolder", i.folder.id, e), u.value = !1, m.value = "";
|
|
4339
4339
|
}
|
|
4340
|
-
function
|
|
4340
|
+
function F() {
|
|
4341
4341
|
u.value = !1, m.value = "";
|
|
4342
4342
|
}
|
|
4343
|
-
function
|
|
4343
|
+
function ae() {
|
|
4344
4344
|
x.value = !0, T.value = "", l.value = !0;
|
|
4345
4345
|
}
|
|
4346
|
-
function
|
|
4346
|
+
function L() {
|
|
4347
4347
|
T.value.trim() && a("createFolder", T.value.trim(), i.folder.id), x.value = !1, T.value = "";
|
|
4348
4348
|
}
|
|
4349
|
-
function
|
|
4349
|
+
function oe() {
|
|
4350
4350
|
x.value = !1, T.value = "";
|
|
4351
4351
|
}
|
|
4352
4352
|
return (t, i) => {
|
|
@@ -4362,8 +4362,8 @@ var Dn = ["data-tpl-theme"], On = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, kn
|
|
|
4362
4362
|
D.value || x.value ? (o(), g("button", {
|
|
4363
4363
|
key: 0,
|
|
4364
4364
|
class: "tpl:flex tpl:size-4 tpl:shrink-0 tpl:items-center tpl:justify-center tpl:rounded tpl:transition-colors",
|
|
4365
|
-
onClick: y(
|
|
4366
|
-
}, [j(v(
|
|
4365
|
+
onClick: y(ne, ["stop"])
|
|
4366
|
+
}, [j(v(te), {
|
|
4367
4367
|
class: C(["tpl:transition-transform tpl:duration-150", { "tpl:rotate-90": M.value }]),
|
|
4368
4368
|
size: 10,
|
|
4369
4369
|
"stroke-width": 2
|
|
@@ -4387,8 +4387,8 @@ var Dn = ["data-tpl-theme"], On = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, kn
|
|
|
4387
4387
|
color: "var(--tpl-text)"
|
|
4388
4388
|
},
|
|
4389
4389
|
autofocus: "",
|
|
4390
|
-
onKeydown: [f(
|
|
4391
|
-
onBlur:
|
|
4390
|
+
onKeydown: [f(P, ["enter"]), f(F, ["escape"])],
|
|
4391
|
+
onBlur: P,
|
|
4392
4392
|
onClick: i[2] ||= y(() => {}, ["stop"])
|
|
4393
4393
|
}, null, 544)), [[S, m.value]]) : _("", !0),
|
|
4394
4394
|
u.value ? _("", !0) : (o(), g("span", lr, [
|
|
@@ -4396,7 +4396,7 @@ var Dn = ["data-tpl-theme"], On = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, kn
|
|
|
4396
4396
|
key: 0,
|
|
4397
4397
|
class: "tpl:flex tpl:size-6 tpl:items-center tpl:justify-center tpl:rounded tpl:transition-colors",
|
|
4398
4398
|
title: v(s).mediaLibrary.addSubfolder,
|
|
4399
|
-
onClick: y(
|
|
4399
|
+
onClick: y(ae, ["stop"])
|
|
4400
4400
|
}, [j(v(me), {
|
|
4401
4401
|
size: 12,
|
|
4402
4402
|
"stroke-width": 2
|
|
@@ -4404,15 +4404,15 @@ var Dn = ["data-tpl-theme"], On = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, kn
|
|
|
4404
4404
|
w("button", {
|
|
4405
4405
|
class: "tpl:flex tpl:size-6 tpl:items-center tpl:justify-center tpl:rounded tpl:transition-colors",
|
|
4406
4406
|
title: v(s).mediaLibrary.renameFolder,
|
|
4407
|
-
onClick: y(
|
|
4408
|
-
}, [j(v(
|
|
4407
|
+
onClick: y(re, ["stop"])
|
|
4408
|
+
}, [j(v(I), {
|
|
4409
4409
|
size: 12,
|
|
4410
4410
|
"stroke-width": 2
|
|
4411
4411
|
})], 8, dr),
|
|
4412
4412
|
w("button", {
|
|
4413
4413
|
class: "tpl:flex tpl:size-6 tpl:items-center tpl:justify-center tpl:rounded tpl:transition-colors",
|
|
4414
4414
|
onClick: i[3] ||= y((t) => a("deleteFolder", e.folder.id), ["stop"])
|
|
4415
|
-
}, [j(v(
|
|
4415
|
+
}, [j(v(ie), {
|
|
4416
4416
|
size: 12,
|
|
4417
4417
|
"stroke-width": 2,
|
|
4418
4418
|
style: { color: "var(--tpl-danger)" }
|
|
@@ -4446,8 +4446,8 @@ var Dn = ["data-tpl-theme"], On = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, kn
|
|
|
4446
4446
|
},
|
|
4447
4447
|
placeholder: v(s).mediaLibrary.subfolderName,
|
|
4448
4448
|
autofocus: "",
|
|
4449
|
-
onKeydown: [f(
|
|
4450
|
-
onBlur:
|
|
4449
|
+
onKeydown: [f(L, ["enter"]), f(oe, ["escape"])],
|
|
4450
|
+
onBlur: L
|
|
4451
4451
|
}, null, 40, pr), [[S, T.value]])], 4)) : _("", !0)])) : _("", !0)]);
|
|
4452
4452
|
};
|
|
4453
4453
|
}
|
|
@@ -4778,7 +4778,7 @@ var Dn = ["data-tpl-theme"], On = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, kn
|
|
|
4778
4778
|
r("select", e);
|
|
4779
4779
|
}
|
|
4780
4780
|
let { t: u } = z(), f = d(null);
|
|
4781
|
-
|
|
4781
|
+
L(f, ([{ isIntersecting: e }]) => {
|
|
4782
4782
|
e && n.hasMore && !n.isLoading && r("loadMore");
|
|
4783
4783
|
}, { threshold: .1 });
|
|
4784
4784
|
function m(e) {
|
|
@@ -4823,7 +4823,7 @@ var Dn = ["data-tpl-theme"], On = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, kn
|
|
|
4823
4823
|
style: { color: "var(--tpl-text-muted)" },
|
|
4824
4824
|
title: v(u).mediaLibrary.editFile,
|
|
4825
4825
|
onClick: y((e) => r("edit", t), ["stop"])
|
|
4826
|
-
}, [j(v(
|
|
4826
|
+
}, [j(v(I), {
|
|
4827
4827
|
size: 12,
|
|
4828
4828
|
"stroke-width": 2
|
|
4829
4829
|
})], 8, Kr), w("button", {
|
|
@@ -4831,7 +4831,7 @@ var Dn = ["data-tpl-theme"], On = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, kn
|
|
|
4831
4831
|
style: { color: "var(--tpl-text-muted)" },
|
|
4832
4832
|
title: v(u).mediaLibrary.replaceFile,
|
|
4833
4833
|
onClick: y((e) => r("replace", t), ["stop"])
|
|
4834
|
-
}, [j(v(
|
|
4834
|
+
}, [j(v(oe), {
|
|
4835
4835
|
size: 12,
|
|
4836
4836
|
"stroke-width": 2
|
|
4837
4837
|
})], 8, qr)]),
|
|
@@ -4868,7 +4868,7 @@ var Dn = ["data-tpl-theme"], On = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, kn
|
|
|
4868
4868
|
style: { "background-color": "rgba(0, 0, 0, 0.6)" },
|
|
4869
4869
|
title: v(u).mediaLibrary.editFile,
|
|
4870
4870
|
onClick: y((e) => r("edit", t), ["stop"])
|
|
4871
|
-
}, [j(v(
|
|
4871
|
+
}, [j(v(I), {
|
|
4872
4872
|
size: 11,
|
|
4873
4873
|
"stroke-width": 2
|
|
4874
4874
|
})], 8, Pr), w("button", {
|
|
@@ -4876,7 +4876,7 @@ var Dn = ["data-tpl-theme"], On = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, kn
|
|
|
4876
4876
|
style: { "background-color": "rgba(0, 0, 0, 0.6)" },
|
|
4877
4877
|
title: v(u).mediaLibrary.replaceFile,
|
|
4878
4878
|
onClick: y((e) => r("replace", t), ["stop"])
|
|
4879
|
-
}, [j(v(
|
|
4879
|
+
}, [j(v(oe), {
|
|
4880
4880
|
size: 11,
|
|
4881
4881
|
"stroke-width": 2
|
|
4882
4882
|
})], 8, Fr)]),
|
|
@@ -5010,7 +5010,7 @@ var Dn = ["data-tpl-theme"], On = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, kn
|
|
|
5010
5010
|
}), r.children?.length && n.push(...a(r.children, t + 1));
|
|
5011
5011
|
return n;
|
|
5012
5012
|
}
|
|
5013
|
-
return
|
|
5013
|
+
return ae(i, () => {
|
|
5014
5014
|
n("close");
|
|
5015
5015
|
}), (t, s) => (o(), g("div", {
|
|
5016
5016
|
ref_key: "pickerRef",
|
|
@@ -5318,9 +5318,9 @@ var Dn = ["data-tpl-theme"], On = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, kn
|
|
|
5318
5318
|
let t = u(e);
|
|
5319
5319
|
t.length && n("upload", t);
|
|
5320
5320
|
}
|
|
5321
|
-
let { isOverDropZone: m } =
|
|
5321
|
+
let { isOverDropZone: m } = se(l, { onDrop: (e) => {
|
|
5322
5322
|
e?.length && f(e);
|
|
5323
|
-
} }), { open: h, onChange: _ } =
|
|
5323
|
+
} }), { open: h, onChange: _ } = P({
|
|
5324
5324
|
accept: s.value,
|
|
5325
5325
|
multiple: !0
|
|
5326
5326
|
});
|
|
@@ -5344,7 +5344,7 @@ var Dn = ["data-tpl-theme"], On = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, kn
|
|
|
5344
5344
|
current: e.uploadProgress.current,
|
|
5345
5345
|
total: e.uploadProgress.total
|
|
5346
5346
|
}) : v(r).mediaLibrary.uploading), 1)])) : (o(), g(O, { key: 1 }, [
|
|
5347
|
-
j(v(
|
|
5347
|
+
j(v(ce), {
|
|
5348
5348
|
class: "tpl:mb-2",
|
|
5349
5349
|
size: 24,
|
|
5350
5350
|
"stroke-width": 1.5,
|
|
@@ -5475,13 +5475,13 @@ function Xi(e) {
|
|
|
5475
5475
|
}), ee(() => t.previewItem.value?.id, () => {
|
|
5476
5476
|
c.value = "original";
|
|
5477
5477
|
});
|
|
5478
|
-
let b =
|
|
5478
|
+
let b = F((e) => {
|
|
5479
5479
|
t.search(e);
|
|
5480
5480
|
}, 300);
|
|
5481
5481
|
function x(e) {
|
|
5482
5482
|
s.value = e, b(e);
|
|
5483
5483
|
}
|
|
5484
|
-
let { copy: S, copied: C } =
|
|
5484
|
+
let { copy: S, copied: C } = ne({
|
|
5485
5485
|
copiedDuring: 2e3,
|
|
5486
5486
|
legacy: !0
|
|
5487
5487
|
});
|
|
@@ -5512,16 +5512,16 @@ function Xi(e) {
|
|
|
5512
5512
|
async function M(e) {
|
|
5513
5513
|
f.value = !1, await t.moveSelected(e);
|
|
5514
5514
|
}
|
|
5515
|
-
async function
|
|
5515
|
+
async function te() {
|
|
5516
5516
|
await t.checkUsageBeforeDelete();
|
|
5517
5517
|
}
|
|
5518
|
-
function
|
|
5518
|
+
function N(e) {
|
|
5519
5519
|
t.checkUsageBeforeReplace(e);
|
|
5520
5520
|
}
|
|
5521
|
-
async function
|
|
5521
|
+
async function re(e) {
|
|
5522
5522
|
await t.replaceFile(e);
|
|
5523
5523
|
}
|
|
5524
|
-
function
|
|
5524
|
+
function P() {
|
|
5525
5525
|
t.clearSelection(), t.cancelDelete(), t.cancelReplace(), s.value = "", t.categoryFilter.value = null, t.sortOption.value = "newest", t.viewMode.value = "files", l.value = null, u.value = !1, c.value = "original";
|
|
5526
5526
|
}
|
|
5527
5527
|
return {
|
|
@@ -5549,10 +5549,10 @@ function Xi(e) {
|
|
|
5549
5549
|
handleEditSave: A,
|
|
5550
5550
|
handleImportFromUrl: j,
|
|
5551
5551
|
handleMoveToFolder: M,
|
|
5552
|
-
handleDeleteClick:
|
|
5553
|
-
handleReplaceItem:
|
|
5554
|
-
handleReplaceFile:
|
|
5555
|
-
resetUI:
|
|
5552
|
+
handleDeleteClick: te,
|
|
5553
|
+
handleReplaceItem: N,
|
|
5554
|
+
handleReplaceFile: re,
|
|
5555
|
+
resetUI: P
|
|
5556
5556
|
};
|
|
5557
5557
|
}
|
|
5558
5558
|
//#endregion
|
|
@@ -5634,30 +5634,30 @@ var Zi = ["data-tpl-theme"], Qi = {
|
|
|
5634
5634
|
setup(e, { emit: t }) {
|
|
5635
5635
|
let n = e, r = t, { t: i } = z(), a = l("tplUiTheme");
|
|
5636
5636
|
s(Pe, D(() => n.popoverTarget ?? null));
|
|
5637
|
-
let d = l("authManager"), f = l("projectId"), S = h(() => f.value), T = l("planConfig"), A = h(() => T.hasFeature("media_folders")),
|
|
5637
|
+
let d = l("authManager"), f = l("projectId"), S = h(() => f.value), T = l("planConfig"), A = h(() => T.hasFeature("media_folders")), te = h(() => T.hasFeature("import_from_url")), N = h(() => T.config.value?.storage.used_bytes ?? 0), ne = h(() => T.config.value?.storage.limit_bytes ?? 0), { isAcceptedMimeType: P, availableCategories: ie } = Oe(), F = Ce({
|
|
5638
5638
|
projectId: S.value,
|
|
5639
5639
|
authManager: d
|
|
5640
|
-
}),
|
|
5641
|
-
library:
|
|
5640
|
+
}), I = Xi({
|
|
5641
|
+
library: F,
|
|
5642
5642
|
canUseMediaFolders: A,
|
|
5643
5643
|
translations: i
|
|
5644
5644
|
});
|
|
5645
5645
|
ee(() => n.visible, (e) => {
|
|
5646
|
-
e ? (
|
|
5646
|
+
e ? (F.loadItems(), F.loadFrequentlyUsed()) : I.resetUI();
|
|
5647
5647
|
});
|
|
5648
|
-
function
|
|
5648
|
+
function ae(e) {
|
|
5649
5649
|
e.key === "Escape" && r("close");
|
|
5650
5650
|
}
|
|
5651
|
-
|
|
5652
|
-
function
|
|
5653
|
-
return
|
|
5651
|
+
ue(document, "keydown", ae);
|
|
5652
|
+
function L() {
|
|
5653
|
+
return F.previewItem.value ? n.accept?.length ? P(F.previewItem.value.mime_type, n.accept) : !0 : !1;
|
|
5654
5654
|
}
|
|
5655
|
-
function
|
|
5656
|
-
if (
|
|
5657
|
-
let e =
|
|
5655
|
+
function oe() {
|
|
5656
|
+
if (L()) {
|
|
5657
|
+
let e = F.previewItem.value;
|
|
5658
5658
|
r("select", {
|
|
5659
5659
|
...e,
|
|
5660
|
-
url:
|
|
5660
|
+
url: I.selectedUrl.value || e.url
|
|
5661
5661
|
}), r("close");
|
|
5662
5662
|
}
|
|
5663
5663
|
}
|
|
@@ -5677,12 +5677,12 @@ var Zi = ["data-tpl-theme"], Qi = {
|
|
|
5677
5677
|
}, [w("div", Qi, [
|
|
5678
5678
|
w("div", $i, [w("h2", ea, p(v(i).mediaLibrary.title), 1), w("div", ta, [
|
|
5679
5679
|
j(Yi, {
|
|
5680
|
-
"used-bytes":
|
|
5681
|
-
"limit-bytes":
|
|
5680
|
+
"used-bytes": N.value,
|
|
5681
|
+
"limit-bytes": ne.value,
|
|
5682
5682
|
size: 22
|
|
5683
5683
|
}, null, 8, ["used-bytes", "limit-bytes"]),
|
|
5684
5684
|
w("div", na, [w("input", {
|
|
5685
|
-
value: v(
|
|
5685
|
+
value: v(I).searchInput.value,
|
|
5686
5686
|
type: "text",
|
|
5687
5687
|
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)]",
|
|
5688
5688
|
style: {
|
|
@@ -5691,7 +5691,7 @@ var Zi = ["data-tpl-theme"], Qi = {
|
|
|
5691
5691
|
color: "var(--tpl-text)"
|
|
5692
5692
|
},
|
|
5693
5693
|
placeholder: v(i).mediaLibrary.searchPlaceholder,
|
|
5694
|
-
onInput: n[0] ||= (e) => v(
|
|
5694
|
+
onInput: n[0] ||= (e) => v(I).handleSearchInput(e.target.value)
|
|
5695
5695
|
}, null, 40, ra), j(v(ye), {
|
|
5696
5696
|
class: "tpl:absolute tpl:top-1/2 tpl:left-2.5 tpl:-translate-y-1/2",
|
|
5697
5697
|
size: 13,
|
|
@@ -5702,7 +5702,7 @@ var Zi = ["data-tpl-theme"], Qi = {
|
|
|
5702
5702
|
class: "tpl:flex tpl:size-7 tpl:items-center tpl:justify-center tpl:rounded-md tpl:transition-all tpl:duration-150",
|
|
5703
5703
|
style: { color: "var(--tpl-text-muted)" },
|
|
5704
5704
|
onClick: n[1] ||= (e) => r("close")
|
|
5705
|
-
}, [j(v(
|
|
5705
|
+
}, [j(v(re), {
|
|
5706
5706
|
size: 18,
|
|
5707
5707
|
"stroke-width": 2
|
|
5708
5708
|
})])
|
|
@@ -5715,16 +5715,16 @@ var Zi = ["data-tpl-theme"], Qi = {
|
|
|
5715
5715
|
"leave-from-class": "tpl:ml-0 tpl:opacity-100",
|
|
5716
5716
|
"leave-to-class": "tpl:-ml-48 tpl:opacity-0"
|
|
5717
5717
|
}, {
|
|
5718
|
-
default: u(() => [A.value && v(
|
|
5719
|
-
folders: v(
|
|
5720
|
-
"current-folder-id": v(
|
|
5721
|
-
"view-mode": v(
|
|
5722
|
-
"has-frequently-used": v(
|
|
5723
|
-
onNavigate: v(
|
|
5724
|
-
onCreateFolder: v(
|
|
5725
|
-
onRenameFolder: v(
|
|
5726
|
-
onDeleteFolder: v(
|
|
5727
|
-
onShowFrequentlyUsed: v(
|
|
5718
|
+
default: u(() => [A.value && v(I).showSidebar.value ? (o(), g("div", aa, [j(yr, {
|
|
5719
|
+
folders: v(F).folders.value,
|
|
5720
|
+
"current-folder-id": v(F).currentFolderId.value,
|
|
5721
|
+
"view-mode": v(F).viewMode.value,
|
|
5722
|
+
"has-frequently-used": v(I).hasFrequentlyUsed.value,
|
|
5723
|
+
onNavigate: v(F).navigateToFolder,
|
|
5724
|
+
onCreateFolder: v(I).handleCreateFolder,
|
|
5725
|
+
onRenameFolder: v(I).handleRenameFolder,
|
|
5726
|
+
onDeleteFolder: v(I).handleDeleteFolder,
|
|
5727
|
+
onShowFrequentlyUsed: v(F).showFrequentlyUsed
|
|
5728
5728
|
}, null, 8, [
|
|
5729
5729
|
"folders",
|
|
5730
5730
|
"current-folder-id",
|
|
@@ -5742,21 +5742,21 @@ var Zi = ["data-tpl-theme"], Qi = {
|
|
|
5742
5742
|
key: 0,
|
|
5743
5743
|
class: "tpl:flex tpl:size-7 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded-md tpl:transition-all tpl:duration-150",
|
|
5744
5744
|
style: E({
|
|
5745
|
-
color: v(
|
|
5746
|
-
backgroundColor: v(
|
|
5747
|
-
border: v(
|
|
5745
|
+
color: v(I).showSidebar.value ? "var(--tpl-primary)" : "var(--tpl-text-muted)",
|
|
5746
|
+
backgroundColor: v(I).showSidebar.value ? "var(--tpl-bg)" : "transparent",
|
|
5747
|
+
border: v(I).showSidebar.value ? "1px solid var(--tpl-border)" : "1px solid transparent"
|
|
5748
5748
|
}),
|
|
5749
|
-
title: v(
|
|
5750
|
-
onClick: n[2] ||= (e) => v(
|
|
5749
|
+
title: v(I).showSidebar.value ? v(i).mediaLibrary.hideFolders : v(i).mediaLibrary.showFolders,
|
|
5750
|
+
onClick: n[2] ||= (e) => v(I).showSidebar.value = !v(I).showSidebar.value
|
|
5751
5751
|
}, [j(v(pe), {
|
|
5752
5752
|
size: 16,
|
|
5753
5753
|
"stroke-width": 2
|
|
5754
5754
|
})], 12, la)) : _("", !0),
|
|
5755
|
-
v(
|
|
5755
|
+
v(F).viewMode.value === "frequently-used" ? (o(), g("span", ua, p(v(i).mediaLibrary.frequentlyUsed), 1)) : (o(), b(De, {
|
|
5756
5756
|
key: 2,
|
|
5757
|
-
folders: v(
|
|
5758
|
-
"current-folder-id": v(
|
|
5759
|
-
onNavigate: v(
|
|
5757
|
+
folders: v(F).folders.value,
|
|
5758
|
+
"current-folder-id": v(F).currentFolderId.value,
|
|
5759
|
+
onNavigate: v(F).navigateToFolder
|
|
5760
5760
|
}, null, 8, [
|
|
5761
5761
|
"folders",
|
|
5762
5762
|
"current-folder-id",
|
|
@@ -5765,27 +5765,27 @@ var Zi = ["data-tpl-theme"], Qi = {
|
|
|
5765
5765
|
w("div", da, [w("button", {
|
|
5766
5766
|
class: "tpl:flex tpl:size-6 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded tpl:transition-all tpl:duration-150",
|
|
5767
5767
|
style: E({
|
|
5768
|
-
color: v(
|
|
5769
|
-
backgroundColor: v(
|
|
5768
|
+
color: v(I).layoutMode.value === "grid" ? "var(--tpl-primary)" : "var(--tpl-text-muted)",
|
|
5769
|
+
backgroundColor: v(I).layoutMode.value === "grid" ? "var(--tpl-bg-elevated)" : "transparent"
|
|
5770
5770
|
}),
|
|
5771
5771
|
title: v(i).mediaLibrary.viewGrid,
|
|
5772
|
-
onClick: n[3] ||= (e) => v(
|
|
5772
|
+
onClick: n[3] ||= (e) => v(I).layoutMode.value = "grid"
|
|
5773
5773
|
}, [j(v(he), {
|
|
5774
5774
|
size: 14,
|
|
5775
5775
|
"stroke-width": 2
|
|
5776
5776
|
})], 12, fa), w("button", {
|
|
5777
5777
|
class: "tpl:flex tpl:size-6 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded tpl:transition-all tpl:duration-150",
|
|
5778
5778
|
style: E({
|
|
5779
|
-
color: v(
|
|
5780
|
-
backgroundColor: v(
|
|
5779
|
+
color: v(I).layoutMode.value === "list" ? "var(--tpl-primary)" : "var(--tpl-text-muted)",
|
|
5780
|
+
backgroundColor: v(I).layoutMode.value === "list" ? "var(--tpl-bg-elevated)" : "transparent"
|
|
5781
5781
|
}),
|
|
5782
5782
|
title: v(i).mediaLibrary.viewList,
|
|
5783
|
-
onClick: n[4] ||= (e) => v(
|
|
5783
|
+
onClick: n[4] ||= (e) => v(I).layoutMode.value = "list"
|
|
5784
5784
|
}, [j(v(_e), {
|
|
5785
5785
|
size: 14,
|
|
5786
5786
|
"stroke-width": 2
|
|
5787
5787
|
})], 12, pa)])
|
|
5788
|
-
]), w("div", ma, [v(
|
|
5788
|
+
]), w("div", ma, [v(ie).length > 1 ? (o(), g("select", {
|
|
5789
5789
|
key: 0,
|
|
5790
5790
|
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",
|
|
5791
5791
|
style: {
|
|
@@ -5793,20 +5793,20 @@ var Zi = ["data-tpl-theme"], Qi = {
|
|
|
5793
5793
|
"background-color": "var(--tpl-bg)",
|
|
5794
5794
|
color: "var(--tpl-text)"
|
|
5795
5795
|
},
|
|
5796
|
-
value: v(
|
|
5797
|
-
onChange: n[5] ||= (e) => v(
|
|
5798
|
-
}, [w("option", ga, p(v(i).mediaLibrary.filterAll), 1), (o(!0), g(O, null, c(v(
|
|
5796
|
+
value: v(F).categoryFilter.value ?? "",
|
|
5797
|
+
onChange: n[5] ||= (e) => v(F).filterByCategory(e.target.value || null)
|
|
5798
|
+
}, [w("option", ga, p(v(i).mediaLibrary.filterAll), 1), (o(!0), g(O, null, c(v(ie), (e) => (o(), g("option", {
|
|
5799
5799
|
key: e,
|
|
5800
5800
|
value: e
|
|
5801
|
-
}, p(v(
|
|
5801
|
+
}, p(v(I).getCategoryLabel(e)), 9, _a))), 128))], 40, ha)) : _("", !0), w("select", {
|
|
5802
5802
|
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",
|
|
5803
5803
|
style: {
|
|
5804
5804
|
"border-color": "var(--tpl-border)",
|
|
5805
5805
|
"background-color": "var(--tpl-bg)",
|
|
5806
5806
|
color: "var(--tpl-text)"
|
|
5807
5807
|
},
|
|
5808
|
-
value: v(
|
|
5809
|
-
onChange: n[6] ||= (e) => v(
|
|
5808
|
+
value: v(F).sortOption.value,
|
|
5809
|
+
onChange: n[6] ||= (e) => v(F).sortBy(e.target.value)
|
|
5810
5810
|
}, [
|
|
5811
5811
|
w("option", ya, p(v(i).mediaLibrary.sortNewest), 1),
|
|
5812
5812
|
w("option", ba, p(v(i).mediaLibrary.sortOldest), 1),
|
|
@@ -5814,15 +5814,15 @@ var Zi = ["data-tpl-theme"], Qi = {
|
|
|
5814
5814
|
w("option", Sa, p(v(i).mediaLibrary.sortNameDesc), 1),
|
|
5815
5815
|
w("option", Ca, p(v(i).mediaLibrary.sortSizeAsc), 1),
|
|
5816
5816
|
w("option", wa, p(v(i).mediaLibrary.sortSizeDesc), 1)
|
|
5817
|
-
], 40, va)])]), w("div", Ta, [v(
|
|
5818
|
-
"is-uploading": v(
|
|
5819
|
-
"upload-progress": v(
|
|
5820
|
-
onUpload: v(
|
|
5817
|
+
], 40, va)])]), w("div", Ta, [v(F).viewMode.value === "files" ? (o(), g("div", Ea, [j(Wi, {
|
|
5818
|
+
"is-uploading": v(F).isUploading.value,
|
|
5819
|
+
"upload-progress": v(F).uploadProgress.value,
|
|
5820
|
+
onUpload: v(I).handleUpload
|
|
5821
5821
|
}, null, 8, [
|
|
5822
5822
|
"is-uploading",
|
|
5823
5823
|
"upload-progress",
|
|
5824
5824
|
"onUpload"
|
|
5825
|
-
]),
|
|
5825
|
+
]), te.value ? (o(), g("button", {
|
|
5826
5826
|
key: 0,
|
|
5827
5827
|
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",
|
|
5828
5828
|
style: {
|
|
@@ -5830,22 +5830,22 @@ var Zi = ["data-tpl-theme"], Qi = {
|
|
|
5830
5830
|
color: "var(--tpl-text-muted)",
|
|
5831
5831
|
"background-color": "var(--tpl-bg)"
|
|
5832
5832
|
},
|
|
5833
|
-
onClick: n[7] ||= (e) => v(
|
|
5833
|
+
onClick: n[7] ||= (e) => v(I).showImportUrlModal.value = !0
|
|
5834
5834
|
}, [j(v(ve), {
|
|
5835
5835
|
size: 14,
|
|
5836
5836
|
"stroke-width": 2
|
|
5837
5837
|
}), k(" " + p(v(i).mediaLibrary.importFromUrl), 1)])) : _("", !0)])) : _("", !0), j(Xr, {
|
|
5838
|
-
items: v(
|
|
5839
|
-
"selected-ids": v(
|
|
5840
|
-
"is-loading": v(
|
|
5841
|
-
"has-more": v(
|
|
5838
|
+
items: v(I).displayItems.value,
|
|
5839
|
+
"selected-ids": v(F).selectedItems.value,
|
|
5840
|
+
"is-loading": v(F).isLoading.value,
|
|
5841
|
+
"has-more": v(F).viewMode.value === "files" && v(F).hasMore.value,
|
|
5842
5842
|
accept: e.accept,
|
|
5843
|
-
layout: v(
|
|
5844
|
-
onSelect: v(
|
|
5845
|
-
onToggle: v(
|
|
5846
|
-
onLoadMore: v(
|
|
5847
|
-
onEdit: v(
|
|
5848
|
-
onReplace: v(
|
|
5843
|
+
layout: v(I).layoutMode.value,
|
|
5844
|
+
onSelect: v(I).handleSelect,
|
|
5845
|
+
onToggle: v(F).toggleSelection,
|
|
5846
|
+
onLoadMore: v(F).loadMore,
|
|
5847
|
+
onEdit: v(I).handleEditItem,
|
|
5848
|
+
onReplace: v(I).handleReplaceItem
|
|
5849
5849
|
}, null, 8, [
|
|
5850
5850
|
"items",
|
|
5851
5851
|
"selected-ids",
|
|
@@ -5860,11 +5860,11 @@ var Zi = ["data-tpl-theme"], Qi = {
|
|
|
5860
5860
|
"onReplace"
|
|
5861
5861
|
])])])]),
|
|
5862
5862
|
j(ci, {
|
|
5863
|
-
visible: v(
|
|
5864
|
-
"is-importing": v(
|
|
5865
|
-
error: v(
|
|
5866
|
-
onImport: v(
|
|
5867
|
-
onClose: n[8] ||= (e) => v(
|
|
5863
|
+
visible: v(I).showImportUrlModal.value,
|
|
5864
|
+
"is-importing": v(F).isImportingFromUrl.value,
|
|
5865
|
+
error: v(F).importFromUrlError.value,
|
|
5866
|
+
onImport: v(I).handleImportFromUrl,
|
|
5867
|
+
onClose: n[8] ||= (e) => v(I).showImportUrlModal.value = !1
|
|
5868
5868
|
}, null, 8, [
|
|
5869
5869
|
"visible",
|
|
5870
5870
|
"is-importing",
|
|
@@ -5872,23 +5872,23 @@ var Zi = ["data-tpl-theme"], Qi = {
|
|
|
5872
5872
|
"onImport"
|
|
5873
5873
|
]),
|
|
5874
5874
|
j(or, {
|
|
5875
|
-
visible: !!v(
|
|
5876
|
-
item: v(
|
|
5877
|
-
onSave: v(
|
|
5878
|
-
onClose: n[9] ||= (e) => v(
|
|
5875
|
+
visible: !!v(I).editingItem.value,
|
|
5876
|
+
item: v(I).editingItem.value,
|
|
5877
|
+
onSave: v(I).handleEditSave,
|
|
5878
|
+
onClose: n[9] ||= (e) => v(I).editingItem.value = null
|
|
5879
5879
|
}, null, 8, [
|
|
5880
5880
|
"visible",
|
|
5881
5881
|
"item",
|
|
5882
5882
|
"onSave"
|
|
5883
5883
|
]),
|
|
5884
5884
|
j(zi, {
|
|
5885
|
-
visible: v(
|
|
5886
|
-
item: v(
|
|
5887
|
-
"usage-info": v(
|
|
5888
|
-
"is-replacing": v(
|
|
5889
|
-
error: v(
|
|
5890
|
-
onReplace: v(
|
|
5891
|
-
onClose: v(
|
|
5885
|
+
visible: v(F).showReplaceWarning.value,
|
|
5886
|
+
item: v(F).pendingReplaceItem.value,
|
|
5887
|
+
"usage-info": v(F).replaceUsageInfo.value,
|
|
5888
|
+
"is-replacing": v(F).isReplacing.value,
|
|
5889
|
+
error: v(F).replaceError.value,
|
|
5890
|
+
onReplace: v(I).handleReplaceFile,
|
|
5891
|
+
onClose: v(F).cancelReplace
|
|
5892
5892
|
}, null, 8, [
|
|
5893
5893
|
"visible",
|
|
5894
5894
|
"item",
|
|
@@ -5906,7 +5906,7 @@ var Zi = ["data-tpl-theme"], Qi = {
|
|
|
5906
5906
|
"leave-from-class": "tpl:opacity-100",
|
|
5907
5907
|
"leave-to-class": "tpl:opacity-0"
|
|
5908
5908
|
}, {
|
|
5909
|
-
default: u(() => [v(
|
|
5909
|
+
default: u(() => [v(F).showDeleteWarning.value ? (o(), g("div", {
|
|
5910
5910
|
key: 0,
|
|
5911
5911
|
class: "tpl:absolute tpl:inset-0 tpl:z-10 tpl:flex tpl:items-center tpl:justify-center tpl:rounded-[var(--tpl-radius-lg)]",
|
|
5912
5912
|
style: {
|
|
@@ -5914,19 +5914,19 @@ var Zi = ["data-tpl-theme"], Qi = {
|
|
|
5914
5914
|
"backdrop-filter": "blur(8px)",
|
|
5915
5915
|
"-webkit-backdrop-filter": "blur(8px)"
|
|
5916
5916
|
},
|
|
5917
|
-
onClick: n[12] ||= y((...e) => v(
|
|
5917
|
+
onClick: n[12] ||= y((...e) => v(F).cancelDelete && v(F).cancelDelete(...e), ["self"])
|
|
5918
5918
|
}, [w("div", Da, [
|
|
5919
5919
|
w("h3", Oa, p(v(i).mediaLibrary.deleteWarningTitle), 1),
|
|
5920
5920
|
w("p", {
|
|
5921
|
-
class: C(["tpl:text-xs", v(
|
|
5921
|
+
class: C(["tpl:text-xs", v(I).hasUsedFiles.value ? "tpl:mb-2" : "tpl:mb-4"]),
|
|
5922
5922
|
style: { color: "var(--tpl-text-muted)" }
|
|
5923
5923
|
}, p(v(i).mediaLibrary.deleteWarningMessage), 3),
|
|
5924
|
-
v(
|
|
5925
|
-
v(
|
|
5924
|
+
v(I).hasUsedFiles.value ? (o(), g("p", ka, p(v(i).mediaLibrary.deleteWarningUsageNote), 1)) : _("", !0),
|
|
5925
|
+
v(I).hasUsedFiles.value ? (o(), g("div", Aa, [(o(!0), g(O, null, c(v(F).deleteUsageInfo.value, (e, t) => (o(), g("div", {
|
|
5926
5926
|
key: t,
|
|
5927
5927
|
class: "tpl:text-xs",
|
|
5928
5928
|
style: { color: "var(--tpl-text)" }
|
|
5929
|
-
}, [e.template_count > 0 ? (o(), g(O, { key: 0 }, [w("span", ja, p(v(
|
|
5929
|
+
}, [e.template_count > 0 ? (o(), g(O, { key: 0 }, [w("span", ja, p(v(I).displayItems.value.find((e) => e.id === t)?.filename || t), 1), w("span", Ma, " - " + p(v(i).mediaLibrary.usedInTemplates.replace("{count}", e.template_count.toString())), 1)], 64)) : _("", !0)]))), 128))])) : _("", !0),
|
|
5930
5930
|
w("div", Na, [w("button", {
|
|
5931
5931
|
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",
|
|
5932
5932
|
style: {
|
|
@@ -5934,7 +5934,7 @@ var Zi = ["data-tpl-theme"], Qi = {
|
|
|
5934
5934
|
color: "var(--tpl-text)",
|
|
5935
5935
|
"background-color": "var(--tpl-bg)"
|
|
5936
5936
|
},
|
|
5937
|
-
onClick: n[10] ||= (...e) => v(
|
|
5937
|
+
onClick: n[10] ||= (...e) => v(F).cancelDelete && v(F).cancelDelete(...e)
|
|
5938
5938
|
}, p(v(i).mediaLibrary.cancel), 1), w("button", {
|
|
5939
5939
|
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",
|
|
5940
5940
|
style: {
|
|
@@ -5942,31 +5942,31 @@ var Zi = ["data-tpl-theme"], Qi = {
|
|
|
5942
5942
|
color: "var(--tpl-danger)",
|
|
5943
5943
|
"background-color": "var(--tpl-danger-light)"
|
|
5944
5944
|
},
|
|
5945
|
-
onClick: n[11] ||= (...e) => v(
|
|
5946
|
-
}, p(v(
|
|
5945
|
+
onClick: n[11] ||= (...e) => v(F).confirmDelete && v(F).confirmDelete(...e)
|
|
5946
|
+
}, p(v(I).hasUsedFiles.value ? v(i).mediaLibrary.deleteAnyway : v(i).mediaLibrary.confirmDelete), 1)])
|
|
5947
5947
|
])])) : _("", !0)]),
|
|
5948
5948
|
_: 1
|
|
5949
5949
|
}),
|
|
5950
|
-
w("div", Pa, [w("div", Fa, [v(
|
|
5950
|
+
w("div", Pa, [w("div", Fa, [v(F).previewItem.value ? (o(), b(wi, {
|
|
5951
5951
|
key: 0,
|
|
5952
|
-
"selected-conversion": v(
|
|
5953
|
-
"onUpdate:selectedConversion": n[13] ||= (e) => v(
|
|
5954
|
-
item: v(
|
|
5955
|
-
folders: v(
|
|
5952
|
+
"selected-conversion": v(I).selectedConversion.value,
|
|
5953
|
+
"onUpdate:selectedConversion": n[13] ||= (e) => v(I).selectedConversion.value = e,
|
|
5954
|
+
item: v(F).previewItem.value,
|
|
5955
|
+
folders: v(F).folders.value
|
|
5956
5956
|
}, null, 8, [
|
|
5957
5957
|
"selected-conversion",
|
|
5958
5958
|
"item",
|
|
5959
5959
|
"folders"
|
|
5960
|
-
])) : _("", !0)]), w("div", Ia, [v(
|
|
5960
|
+
])) : _("", !0)]), w("div", Ia, [v(F).selectedItems.value.size > 0 ? (o(), g("div", La, [v(F).previewItem.value ? (o(), g("button", {
|
|
5961
5961
|
key: 0,
|
|
5962
5962
|
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",
|
|
5963
5963
|
style: E({
|
|
5964
|
-
borderColor: v(
|
|
5965
|
-
color: v(
|
|
5964
|
+
borderColor: v(I).copied.value ? "var(--tpl-success)" : "var(--tpl-border)",
|
|
5965
|
+
color: v(I).copied.value ? "var(--tpl-success)" : "var(--tpl-text)",
|
|
5966
5966
|
backgroundColor: "var(--tpl-bg)"
|
|
5967
5967
|
}),
|
|
5968
|
-
onClick: n[14] ||= (e) => v(
|
|
5969
|
-
}, [v(
|
|
5968
|
+
onClick: n[14] ||= (e) => v(I).copy(v(I).selectedUrl.value)
|
|
5969
|
+
}, [v(I).copied.value ? (o(), b(v(M), {
|
|
5970
5970
|
key: 1,
|
|
5971
5971
|
size: 12,
|
|
5972
5972
|
"stroke-width": 2
|
|
@@ -5974,25 +5974,25 @@ var Zi = ["data-tpl-theme"], Qi = {
|
|
|
5974
5974
|
key: 0,
|
|
5975
5975
|
size: 12,
|
|
5976
5976
|
"stroke-width": 2
|
|
5977
|
-
})), k(" " + p(v(
|
|
5977
|
+
})), k(" " + p(v(I).copied.value ? v(i).mediaLibrary.copied : v(i).mediaLibrary.copyUrl), 1)], 4)) : _("", !0), A.value ? (o(), g("div", Ra, [w("button", {
|
|
5978
5978
|
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",
|
|
5979
5979
|
style: {
|
|
5980
5980
|
"border-color": "var(--tpl-border)",
|
|
5981
5981
|
color: "var(--tpl-text)",
|
|
5982
5982
|
"background-color": "var(--tpl-bg)"
|
|
5983
5983
|
},
|
|
5984
|
-
onClick: n[15] ||= (e) => v(
|
|
5985
|
-
}, p(v(i).mediaLibrary.moveSelected), 1), v(
|
|
5984
|
+
onClick: n[15] ||= (e) => v(I).showMovePicker.value = !v(I).showMovePicker.value
|
|
5985
|
+
}, p(v(i).mediaLibrary.moveSelected), 1), v(I).showMovePicker.value ? (o(), b(pi, {
|
|
5986
5986
|
key: 0,
|
|
5987
|
-
folders: v(
|
|
5988
|
-
"current-folder-id": v(
|
|
5989
|
-
onSelect: v(
|
|
5990
|
-
onClose: n[16] ||= (e) => v(
|
|
5987
|
+
folders: v(F).folders.value,
|
|
5988
|
+
"current-folder-id": v(F).currentFolderId.value,
|
|
5989
|
+
onSelect: v(I).handleMoveToFolder,
|
|
5990
|
+
onClose: n[16] ||= (e) => v(I).showMovePicker.value = !1
|
|
5991
5991
|
}, null, 8, [
|
|
5992
5992
|
"folders",
|
|
5993
5993
|
"current-folder-id",
|
|
5994
5994
|
"onSelect"
|
|
5995
|
-
])) : _("", !0)])) : _("", !0)])) : _("", !0), w("div", za, [v(
|
|
5995
|
+
])) : _("", !0)])) : _("", !0)])) : _("", !0), w("div", za, [v(F).selectedItems.value.size > 0 ? (o(), g("button", {
|
|
5996
5996
|
key: 0,
|
|
5997
5997
|
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",
|
|
5998
5998
|
style: {
|
|
@@ -6000,15 +6000,15 @@ var Zi = ["data-tpl-theme"], Qi = {
|
|
|
6000
6000
|
color: "var(--tpl-danger)",
|
|
6001
6001
|
"background-color": "var(--tpl-danger-light)"
|
|
6002
6002
|
},
|
|
6003
|
-
onClick: n[17] ||= (...e) => v(
|
|
6003
|
+
onClick: n[17] ||= (...e) => v(I).handleDeleteClick && v(I).handleDeleteClick(...e)
|
|
6004
6004
|
}, p(v(i).mediaLibrary.deleteSelected), 1)) : _("", !0), w("button", {
|
|
6005
6005
|
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",
|
|
6006
6006
|
style: {
|
|
6007
6007
|
"background-color": "var(--tpl-primary)",
|
|
6008
6008
|
color: "var(--tpl-bg)"
|
|
6009
6009
|
},
|
|
6010
|
-
disabled: !
|
|
6011
|
-
onClick:
|
|
6010
|
+
disabled: !L(),
|
|
6011
|
+
onClick: oe
|
|
6012
6012
|
}, p(e.accept?.length ? v(i).mediaLibrary.selectImage : v(i).mediaLibrary.selectFile), 9, Ba)])])])
|
|
6013
6013
|
])], 8, Zi)) : _("", !0)]),
|
|
6014
6014
|
_: 1
|
|
@@ -6018,4 +6018,4 @@ var Zi = ["data-tpl-theme"], Qi = {
|
|
|
6018
6018
|
//#endregion
|
|
6019
6019
|
export { zi as a, ci as c, or as d, Oe as f, Se as g, Ce as h, Wi as i, Xr as l, z as m, Xi as n, wi as o, De as p, Yi as r, pi as s, Va as t, yr as u };
|
|
6020
6020
|
|
|
6021
|
-
//# sourceMappingURL=media-library-
|
|
6021
|
+
//# sourceMappingURL=media-library-CO2WOETY.js.map
|