@templatical/editor 0.7.2 → 0.7.3
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-DWRONNm6.js → AiChatSidebar-H7SIsxeC.js} +49 -59
- package/dist/{AiFeatureMenu-U7b4Z8OV.js → AiFeatureMenu-CJGX-fP5.js} +1 -1
- package/dist/{CloudEditor-DgiUCNMn.js → CloudEditor-BBs3p-mW.js} +124 -120
- package/dist/{CollaboratorBar-BgeaMhrV.js → CollaboratorBar-CiEo25lb.js} +2 -2
- package/dist/{CommentsSidebar-BiRtaXYD.js → CommentsSidebar-DikjSLtH.js} +1 -1
- package/dist/{CountdownToolbar-CojjlZet.js → CountdownToolbar-Bn4RwJVN.js} +2 -2
- package/dist/{DesignReferenceSidebar-C1W02bYt.js → DesignReferenceSidebar-D08CLZPA.js} +1 -1
- package/dist/{ModuleBrowserModal-Bjh99_5c.js → ModuleBrowserModal-D6637s8j.js} +4 -4
- package/dist/{ModulePreviewCanvas-DDDQmUI_.js → ModulePreviewCanvas-DBFmwq-y.js} +1 -1
- package/dist/{NumberWithSuffix-CLTBb2Rj.js → NumberWithSuffix-CyFX9w1e.js} +1 -1
- package/dist/{ParagraphEditor-BSaEdasm.js → ParagraphEditor-DC2jOjNh.js} +16 -16
- package/dist/{RichTextEditorContent-C3QSg7gd.js → RichTextEditorContent-8NkjTIua.js} +1 -1
- package/dist/{SaveModuleDialog-9fX6oSxf.js → SaveModuleDialog-NKT7bWWs.js} +2 -2
- package/dist/{SnapshotHistory-gYW-IXkE.js → SnapshotHistory-XNqYxPBj.js} +2 -2
- package/dist/{TestEmailModal-B_Rmnngq.js → TestEmailModal-B_-Qo5Us.js} +2 -2
- package/dist/{TitleEditor-XbFuw1Vy.js → TitleEditor-DnH3yyTr.js} +7 -7
- package/dist/{TplModal-LY9rkDph.js → TplModal-BoEZFe3U.js} +2 -2
- package/dist/{blockTypeIcons-CLT2H0yU.js → blockTypeIcons-CUcYuWAO.js} +1 -1
- package/dist/bundle-stats.json +7 -7
- package/dist/cdn/chunks/{AccessibilityPanel-DaqF4Xzy.js → AccessibilityPanel-CQt87OMk.js} +5 -5
- package/dist/cdn/chunks/{AccessibilityPanel-DaqF4Xzy.js.map → AccessibilityPanel-CQt87OMk.js.map} +1 -1
- package/dist/cdn/chunks/{AiFeatureMenu-WhZ7G-Wr.js → AiFeatureMenu-SxIqfqA0.js} +8 -8
- package/dist/cdn/chunks/{AiFeatureMenu-WhZ7G-Wr.js.map → AiFeatureMenu-SxIqfqA0.js.map} +1 -1
- package/dist/cdn/chunks/{BlockA11yBadge-BLKyO0lH.js → BlockA11yBadge-QqW6nomn.js} +3 -3
- package/dist/cdn/chunks/{BlockA11yBadge-BLKyO0lH.js.map → BlockA11yBadge-QqW6nomn.js.map} +1 -1
- package/dist/cdn/chunks/{CloudEditor-BKEXPt3g.js → CloudEditor-ChWUIMw7.js} +165 -161
- package/dist/cdn/chunks/CloudEditor-ChWUIMw7.js.map +1 -0
- package/dist/cdn/chunks/{CollaboratorBar-ASDiTitQ.js → CollaboratorBar-73LfbzqF.js} +3 -3
- package/dist/cdn/chunks/{CollaboratorBar-ASDiTitQ.js.map → CollaboratorBar-73LfbzqF.js.map} +1 -1
- package/dist/cdn/chunks/{CountdownBlock-LAlYJYWL.js → CountdownBlock-WYz9b9Ex.js} +2 -2
- package/dist/cdn/chunks/{CountdownBlock-LAlYJYWL.js.map → CountdownBlock-WYz9b9Ex.js.map} +1 -1
- package/dist/cdn/chunks/{CountdownToolbar-CbIKGP7u.js → CountdownToolbar-B9fPfFqp.js} +3 -3
- package/dist/cdn/chunks/{CountdownToolbar-CbIKGP7u.js.map → CountdownToolbar-B9fPfFqp.js.map} +1 -1
- package/dist/cdn/chunks/{ModuleBrowserModal-BjmdleNq.js → ModuleBrowserModal-DfnJQBkM.js} +8 -8
- package/dist/cdn/chunks/{ModuleBrowserModal-BjmdleNq.js.map → ModuleBrowserModal-DfnJQBkM.js.map} +1 -1
- package/dist/cdn/chunks/{ModulePreviewCanvas-DsmACAdb.js → ModulePreviewCanvas-DE4_oHA_.js} +20 -20
- package/dist/cdn/chunks/{ModulePreviewCanvas-DsmACAdb.js.map → ModulePreviewCanvas-DE4_oHA_.js.map} +1 -1
- package/dist/cdn/chunks/{NumberWithSuffix-EEDNj1my.js → NumberWithSuffix-BST0yRor.js} +2 -2
- package/dist/cdn/chunks/{NumberWithSuffix-EEDNj1my.js.map → NumberWithSuffix-BST0yRor.js.map} +1 -1
- package/dist/cdn/chunks/{ParagraphEditor-D6Dw5RtX.js → ParagraphEditor-CQfijF3i.js} +36 -36
- package/dist/cdn/chunks/{ParagraphEditor-D6Dw5RtX.js.map → ParagraphEditor-CQfijF3i.js.map} +1 -1
- package/dist/cdn/chunks/{RichTextEditorContent-C2yj_yPM.js → RichTextEditorContent-CBds8dnm.js} +5 -5
- package/dist/cdn/chunks/{RichTextEditorContent-C2yj_yPM.js.map → RichTextEditorContent-CBds8dnm.js.map} +1 -1
- package/dist/cdn/chunks/{SaveModuleDialog-DCcvwYat.js → SaveModuleDialog-DXhuZgZ4.js} +13 -13
- package/dist/cdn/chunks/{SaveModuleDialog-DCcvwYat.js.map → SaveModuleDialog-DXhuZgZ4.js.map} +1 -1
- package/dist/cdn/chunks/{TitleEditor-isN_t0MJ.js → TitleEditor-BdQvH7eK.js} +7 -7
- package/dist/cdn/chunks/{TitleEditor-isN_t0MJ.js.map → TitleEditor-BdQvH7eK.js.map} +1 -1
- package/dist/cdn/chunks/{blockTypeIcons-Bgn69Q1-.js → blockTypeIcons-D3CGFW5P.js} +8 -8
- package/dist/cdn/chunks/{blockTypeIcons-Bgn69Q1-.js.map → blockTypeIcons-D3CGFW5P.js.map} +1 -1
- package/dist/cdn/chunks/{extensions-BPsjY5N8.js → extensions-BE81zpqP.js} +50 -48
- package/dist/cdn/chunks/{extensions-BPsjY5N8.js.map → extensions-BE81zpqP.js.map} +1 -1
- package/dist/cdn/chunks/{features-BouLRfOO.js → features-CXF_YKlL.js} +1258 -1113
- package/dist/cdn/chunks/features-CXF_YKlL.js.map +1 -0
- package/dist/cdn/chunks/{icons-BBuZkqC3.js → icons-KbmhF7rg.js} +2 -2
- package/dist/cdn/chunks/{icons-BBuZkqC3.js.map → icons-KbmhF7rg.js.map} +1 -1
- package/dist/cdn/chunks/{media-library-C-DcHE6w.js → media-library-BERe10wA.js} +103 -103
- package/dist/cdn/chunks/{media-library-C-DcHE6w.js.map → media-library-BERe10wA.js.map} +1 -1
- package/dist/cdn/chunks/{quality-ConWSEB6.js → quality-CmkY1kMU.js} +309 -309
- package/dist/cdn/chunks/{quality-ConWSEB6.js.map → quality-CmkY1kMU.js.map} +1 -1
- package/dist/cdn/chunks/{renderer-F8cxEe3t.js → renderer-OttGEYkY.js} +50 -50
- package/dist/cdn/chunks/{renderer-F8cxEe3t.js.map → renderer-OttGEYkY.js.map} +1 -1
- package/dist/cdn/chunks/{src-C9rMok-R.js → src-C21GI0p6.js} +6 -6
- package/dist/cdn/chunks/{src-C9rMok-R.js.map → src-C21GI0p6.js.map} +1 -1
- package/dist/cdn/chunks/styles-Cy-My9zK.js +2976 -0
- package/dist/cdn/chunks/styles-Cy-My9zK.js.map +1 -0
- package/dist/cdn/editor.css +1 -1
- package/dist/cdn/editor.js +109 -106
- package/dist/cdn/editor.js.map +1 -1
- package/dist/{dist-DDJIWTRY.js → dist-B2jcQhv8.js} +1 -1
- package/dist/{dist-wzMIGj-D.js → dist-BYt3jdCR.js} +1 -1
- package/dist/{dist-aRzjfSRN.js → dist-CISFttkF.js} +1 -1
- package/dist/{dist-D6uC2xhi.js → dist-CfQPBf15.js} +1 -1
- package/dist/{dist-DjviJBCi.js → dist-DD-9hatO.js} +1 -1
- package/dist/{dist-KoBJjK1G.js → dist-DUvhjQ2-.js} +1 -1
- package/dist/{dist-BaQIYPsn.js → dist-DVwOAodp.js} +1 -1
- package/dist/{dist-Cp0zXPAD.js → dist-DxD1kSdH.js} +1 -1
- package/dist/{dist-Pk4MhWMP.js → dist-U5guDm2w.js} +1 -1
- package/dist/{dist-D90y8dvT.js → dist-hfu7I2rO.js} +3 -3
- package/dist/{dist-us-RpCWN.js → dist-v8h02hhE.js} +1 -1
- package/dist/{extensions-D-J02CiP.js → extensions-p6UBqXfg.js} +30 -28
- package/dist/index.d.ts +8 -8
- package/dist/style.css +1 -1
- package/dist/{styles-j_3bu0Bo.js → styles-BP15QmP3.js} +1058 -1052
- package/dist/templatical-editor.js +108 -105
- package/dist/useAliveFlag-D8GoB4VE.js +10 -0
- package/dist/{useEditorCore-B1XrI6fY.js → useEditorCore-_rbu6iMu.js} +921 -778
- package/package.json +7 -7
- package/dist/cdn/chunks/CloudEditor-BKEXPt3g.js.map +0 -1
- package/dist/cdn/chunks/features-BouLRfOO.js.map +0 -1
- package/dist/cdn/chunks/styles-BRN0i_zg.js +0 -2971
- package/dist/cdn/chunks/styles-BRN0i_zg.js.map +0 -1
- /package/dist/{AccessibilityPanel-D-PqmHdH.js → AccessibilityPanel-BeUibrUb.js} +0 -0
- /package/dist/{BlockA11yBadge-BFIw0h1m.js → BlockA11yBadge-BhyoMZJ9.js} +0 -0
- /package/dist/{CountdownBlock-Cq8A8WrM.js → CountdownBlock-ByJ0_8Pk.js} +0 -0
- /package/dist/{TemplateScoringPanel-V79yrEPC.js → TemplateScoringPanel-kYOGtac3.js} +0 -0
- /package/dist/{cloud-CTmfCSqf.js → cloud-k0DgeCo2.js} +0 -0
- /package/dist/{de-BhIWu_bO.js → de-C9hp3n_a.js} +0 -0
- /package/dist/{de-Di4MEjjx.js → de-GOtR9DwW.js} +0 -0
- /package/dist/{dist-iLBdeBDR.js → dist-CQQS9SRN.js} +0 -0
- /package/dist/{emojiData-DX3E0XT-.js → emojiData-DrBuvEoP.js} +0 -0
- /package/dist/{en-D7HRbYah.js → en-Dv776AqL.js} +0 -0
- /package/dist/{en-BSuzi-Pd.js → en-dFFQVzNn.js} +0 -0
- /package/dist/{formatRelativeTime-BOEf47hq.js → formatRelativeTime-bvx5sFh5.js} +0 -0
- /package/dist/{liquid.browser-CdMv1BTn.js → liquid.browser-DX8ZHRdq.js} +0 -0
- /package/dist/{pt-BR-K32lt6YP.js → pt-BR-6n58Fl_q.js} +0 -0
- /package/dist/{pt-BR-CCVBRais.js → pt-BR-iOr79aDg.js} +0 -0
- /package/dist/{readableTextColor-CY3SiRnt.js → readableTextColor-CXzrEnNb.js} +0 -0
- /package/dist/{styleConstants-fWzlIIwN.js → styleConstants-DkfOPzGu.js} +0 -0
- /package/dist/{usePopoverRoot-BxJrqnMD.js → usePopoverRoot-BwzFSPLy.js} +0 -0
|
@@ -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-P6QWzy4g.js";
|
|
2
|
-
import {
|
|
3
|
-
import { A as pe, B as me, E as he, K as ge, R as _e, W as ve, b as ye, m as be, q as xe } from "./icons-
|
|
2
|
+
import { At as M, D as N, E as P, Ot as F, an as te, at as ne, cn as re, ct as I, ht as L, in as ie, ln as R, mt as ae, on as oe, ot as se, rn as ce, rt as le, sn as ue, vt as de, wt as fe } from "./features-CXF_YKlL.js";
|
|
3
|
+
import { A as pe, B as me, E as he, K as ge, R as _e, W as ve, b as ye, m as be, q as xe } from "./icons-KbmhF7rg.js";
|
|
4
4
|
//#region ../media-library/src/api-client.ts
|
|
5
5
|
var Se = class {
|
|
6
6
|
constructor(e) {
|
|
@@ -36,7 +36,7 @@ var Se = class {
|
|
|
36
36
|
async browseMedia(e) {
|
|
37
37
|
let t = new URLSearchParams();
|
|
38
38
|
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);
|
|
39
|
-
let n = t.toString(), r = `${
|
|
39
|
+
let n = t.toString(), r = `${N(P["media.browse"], this.baseParams)}${n ? `?${n}` : ""}`, i = await this.authManager.authenticatedFetch(r, { headers: { Accept: "application/json" } });
|
|
40
40
|
if (!i.ok) {
|
|
41
41
|
let e = await i.json().catch(() => ({ message: `HTTP error ${i.status}` }));
|
|
42
42
|
throw Error(e.message, { cause: e });
|
|
@@ -46,7 +46,7 @@ var Se = class {
|
|
|
46
46
|
async uploadMedia(e, t) {
|
|
47
47
|
let n = new FormData();
|
|
48
48
|
n.append("file", e), t && n.append("folder_id", t);
|
|
49
|
-
let r =
|
|
49
|
+
let r = N(P["media.upload"], this.baseParams), i = await this.authManager.authenticatedFetch(r, {
|
|
50
50
|
method: "POST",
|
|
51
51
|
headers: { Accept: "application/json" },
|
|
52
52
|
body: n
|
|
@@ -58,7 +58,7 @@ var Se = class {
|
|
|
58
58
|
return (await i.json()).data;
|
|
59
59
|
}
|
|
60
60
|
async updateMedia(e, t, n) {
|
|
61
|
-
return this.request(
|
|
61
|
+
return this.request(N(P["media.update"], {
|
|
62
62
|
...this.baseParams,
|
|
63
63
|
media: e
|
|
64
64
|
}), {
|
|
@@ -70,13 +70,13 @@ var Se = class {
|
|
|
70
70
|
});
|
|
71
71
|
}
|
|
72
72
|
async deleteMedia(e) {
|
|
73
|
-
return this.request(
|
|
73
|
+
return this.request(N(P["media.delete"], this.baseParams), {
|
|
74
74
|
method: "POST",
|
|
75
75
|
body: JSON.stringify({ ids: e })
|
|
76
76
|
});
|
|
77
77
|
}
|
|
78
78
|
async moveMedia(e, t) {
|
|
79
|
-
return this.request(
|
|
79
|
+
return this.request(N(P["media.move"], this.baseParams), {
|
|
80
80
|
method: "POST",
|
|
81
81
|
body: JSON.stringify({
|
|
82
82
|
ids: e,
|
|
@@ -85,10 +85,10 @@ var Se = class {
|
|
|
85
85
|
});
|
|
86
86
|
}
|
|
87
87
|
async getMediaFolders() {
|
|
88
|
-
return this.request(
|
|
88
|
+
return this.request(N(P["folders.index"], this.baseParams));
|
|
89
89
|
}
|
|
90
90
|
async createMediaFolder(e, t) {
|
|
91
|
-
return this.request(
|
|
91
|
+
return this.request(N(P["folders.store"], this.baseParams), {
|
|
92
92
|
method: "POST",
|
|
93
93
|
body: JSON.stringify({
|
|
94
94
|
name: e,
|
|
@@ -97,7 +97,7 @@ var Se = class {
|
|
|
97
97
|
});
|
|
98
98
|
}
|
|
99
99
|
async renameMediaFolder(e, t) {
|
|
100
|
-
return this.request(
|
|
100
|
+
return this.request(N(P["folders.update"], {
|
|
101
101
|
...this.baseParams,
|
|
102
102
|
mediaFolder: e
|
|
103
103
|
}), {
|
|
@@ -106,13 +106,13 @@ var Se = class {
|
|
|
106
106
|
});
|
|
107
107
|
}
|
|
108
108
|
async deleteMediaFolder(e) {
|
|
109
|
-
return this.request(
|
|
109
|
+
return this.request(N(P["folders.destroy"], {
|
|
110
110
|
...this.baseParams,
|
|
111
111
|
mediaFolder: e
|
|
112
112
|
}), { method: "DELETE" });
|
|
113
113
|
}
|
|
114
114
|
async checkMediaUsage(e) {
|
|
115
|
-
let t = await this.authManager.authenticatedFetch(
|
|
115
|
+
let t = await this.authManager.authenticatedFetch(N(P["media.checkUsage"], this.baseParams), {
|
|
116
116
|
method: "POST",
|
|
117
117
|
headers: {
|
|
118
118
|
"Content-Type": "application/json",
|
|
@@ -127,10 +127,10 @@ var Se = class {
|
|
|
127
127
|
return t.json();
|
|
128
128
|
}
|
|
129
129
|
async getFrequentlyUsed() {
|
|
130
|
-
return this.request(
|
|
130
|
+
return this.request(N(P["media.frequentlyUsed"], this.baseParams));
|
|
131
131
|
}
|
|
132
132
|
async importFromUrl(e, t) {
|
|
133
|
-
return this.request(
|
|
133
|
+
return this.request(N(P["media.importFromUrl"], this.baseParams), {
|
|
134
134
|
method: "POST",
|
|
135
135
|
body: JSON.stringify({
|
|
136
136
|
url: e,
|
|
@@ -141,7 +141,7 @@ var Se = class {
|
|
|
141
141
|
async replaceMedia(e, t) {
|
|
142
142
|
let n = new FormData();
|
|
143
143
|
n.append("file", t);
|
|
144
|
-
let r =
|
|
144
|
+
let r = N(P["media.replace"], {
|
|
145
145
|
...this.baseParams,
|
|
146
146
|
media: e
|
|
147
147
|
}), i = await this.authManager.authenticatedFetch(r, {
|
|
@@ -207,16 +207,16 @@ function Ce(e) {
|
|
|
207
207
|
async function ee(e) {
|
|
208
208
|
s.value = e, await k();
|
|
209
209
|
}
|
|
210
|
-
async function
|
|
210
|
+
async function M(e) {
|
|
211
211
|
c.value = e, await k();
|
|
212
212
|
}
|
|
213
|
-
async function
|
|
213
|
+
async function N(e) {
|
|
214
214
|
a.value = "files", i.value = e, o.value = "", h.value = /* @__PURE__ */ new Set(), g.value = null, await k();
|
|
215
215
|
}
|
|
216
|
-
async function
|
|
216
|
+
async function P() {
|
|
217
217
|
a.value = "frequently-used", i.value = null, o.value = "", h.value = /* @__PURE__ */ new Set(), g.value = null, await L();
|
|
218
218
|
}
|
|
219
|
-
async function
|
|
219
|
+
async function F(r) {
|
|
220
220
|
u.value = !0;
|
|
221
221
|
try {
|
|
222
222
|
let e = await t.uploadMedia(r, i.value);
|
|
@@ -227,7 +227,7 @@ function Ce(e) {
|
|
|
227
227
|
u.value = !1;
|
|
228
228
|
}
|
|
229
229
|
}
|
|
230
|
-
async function
|
|
230
|
+
async function te(r) {
|
|
231
231
|
u.value = !0, m.value = {
|
|
232
232
|
current: 0,
|
|
233
233
|
total: r.length
|
|
@@ -417,11 +417,11 @@ function Ce(e) {
|
|
|
417
417
|
loadMore: A,
|
|
418
418
|
search: j,
|
|
419
419
|
filterByCategory: ee,
|
|
420
|
-
sortBy:
|
|
421
|
-
navigateToFolder:
|
|
422
|
-
showFrequentlyUsed:
|
|
423
|
-
uploadFile:
|
|
424
|
-
uploadFiles:
|
|
420
|
+
sortBy: M,
|
|
421
|
+
navigateToFolder: N,
|
|
422
|
+
showFrequentlyUsed: P,
|
|
423
|
+
uploadFile: F,
|
|
424
|
+
uploadFiles: te,
|
|
425
425
|
moveSelected: ne,
|
|
426
426
|
updateFile: re,
|
|
427
427
|
deleteSelected: I,
|
|
@@ -496,7 +496,7 @@ var we = {
|
|
|
496
496
|
class: "tpl:transition-colors tpl:duration-150 tpl:hover:underline",
|
|
497
497
|
style: { color: "var(--tpl-primary)" },
|
|
498
498
|
onClick: t[0] ||= (e) => r("navigate", null)
|
|
499
|
-
}, p(v(i).mediaLibrary.allFiles), 1), (o(!0), g(O, null, c(a.value, (e, t) => (o(), g(O, { key: e.id }, [j(v(
|
|
499
|
+
}, p(v(i).mediaLibrary.allFiles), 1), (o(!0), g(O, null, c(a.value, (e, t) => (o(), g(O, { key: e.id }, [j(v(F), {
|
|
500
500
|
size: 12,
|
|
501
501
|
"stroke-width": 2
|
|
502
502
|
}), t < a.value.length - 1 ? (o(), g("button", {
|
|
@@ -4125,7 +4125,7 @@ var Dn = ["data-tpl-theme"], On = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, kn
|
|
|
4125
4125
|
}, nr = {
|
|
4126
4126
|
class: "tpl:mb-1 tpl:block tpl:text-xs tpl:font-medium",
|
|
4127
4127
|
style: { color: "var(--tpl-text-muted)" }
|
|
4128
|
-
}, rr = ["placeholder"], ir = { class: "tpl:flex tpl:shrink-0 tpl:justify-end tpl:gap-2 tpl:p-5 tpl:pt-4" }, ar = ["disabled"], or = /* @__PURE__ */
|
|
4128
|
+
}, rr = ["placeholder"], ir = { class: "tpl:flex tpl:shrink-0 tpl:justify-end tpl:gap-2 tpl:p-5 tpl:pt-4" }, ar = ["disabled"], or = /* @__PURE__ */ le(/* @__PURE__ */ A({
|
|
4129
4129
|
__name: "MediaEditModal",
|
|
4130
4130
|
props: {
|
|
4131
4131
|
visible: { type: Boolean },
|
|
@@ -4133,14 +4133,14 @@ var Dn = ["data-tpl-theme"], On = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, kn
|
|
|
4133
4133
|
},
|
|
4134
4134
|
emits: ["save", "close"],
|
|
4135
4135
|
setup(e, { emit: t }) {
|
|
4136
|
-
let r = e, i = t, { t: a } = z(), s = l("tplUiTheme"), f = l(Pe, d(null)), T = a.mediaLibrary, { isImageMimeType: D } = Oe(), A = d(""),
|
|
4136
|
+
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(""), N = d(null), P = d("free"), F = d(void 0), te = d(void 0), ne = d(""), re = d(""), I = d(void 0), L = d(null), ie = d(!1), R = d(!1), ae = d(!1), oe = h(() => r.item ? [
|
|
4137
4137
|
"image/jpeg",
|
|
4138
4138
|
"image/png",
|
|
4139
4139
|
"image/webp",
|
|
4140
4140
|
"image/gif"
|
|
4141
|
-
].includes(r.item.mime_type) : !1), se = h(() =>
|
|
4141
|
+
].includes(r.item.mime_type) : !1), se = h(() => P.value === "original" ? I.value : ke[P.value]), ce = h(() => L.value ? Ne(L.value.width, L.value.height, F.value, te.value) : null);
|
|
4142
4142
|
ee(() => r.visible, (e) => {
|
|
4143
|
-
e && r.item && (A.value = r.item.filename,
|
|
4143
|
+
e && r.item && (A.value = r.item.filename, M.value = r.item.alt_text || "", P.value = "free", F.value = void 0, te.value = void 0, ne.value = "", re.value = "", I.value = void 0, L.value = null, ie.value = !1, ae.value = !1, r.item.width && r.item.height && (I.value = r.item.width / r.item.height));
|
|
4144
4144
|
});
|
|
4145
4145
|
function le(e) {
|
|
4146
4146
|
e.coordinates && (L.value = {
|
|
@@ -4153,22 +4153,22 @@ var Dn = ["data-tpl-theme"], On = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, kn
|
|
|
4153
4153
|
}
|
|
4154
4154
|
function de(e) {
|
|
4155
4155
|
let t = e.target.value;
|
|
4156
|
-
ne.value = t,
|
|
4156
|
+
ne.value = t, F.value = t && parseInt(t, 10) || void 0;
|
|
4157
4157
|
}
|
|
4158
4158
|
function fe(e) {
|
|
4159
4159
|
let t = e.target.value;
|
|
4160
|
-
re.value = t,
|
|
4160
|
+
re.value = t, te.value = t && parseInt(t, 10) || void 0;
|
|
4161
4161
|
}
|
|
4162
4162
|
async function pe() {
|
|
4163
4163
|
let e = A.value.trim();
|
|
4164
4164
|
if (!e || !r.item || R.value) return;
|
|
4165
4165
|
let t = D(r.item.mime_type), n;
|
|
4166
|
-
if (oe.value &&
|
|
4166
|
+
if (oe.value && N.value && ae.value) {
|
|
4167
4167
|
R.value = !0;
|
|
4168
4168
|
try {
|
|
4169
|
-
let { canvas: e } =
|
|
4169
|
+
let { canvas: e } = N.value.getResult();
|
|
4170
4170
|
if (e) {
|
|
4171
|
-
let t = je(e,
|
|
4171
|
+
let t = je(e, F.value, te.value), i = Ae(r.item.mime_type);
|
|
4172
4172
|
n = { file: await Me(t, r.item.filename, i) };
|
|
4173
4173
|
}
|
|
4174
4174
|
} catch {
|
|
@@ -4177,7 +4177,7 @@ var Dn = ["data-tpl-theme"], On = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, kn
|
|
|
4177
4177
|
}
|
|
4178
4178
|
R.value = !1;
|
|
4179
4179
|
}
|
|
4180
|
-
i("save", r.item.id, e, t ?
|
|
4180
|
+
i("save", r.item.id, e, t ? M.value : void 0, n), i("close");
|
|
4181
4181
|
}
|
|
4182
4182
|
function me(e) {
|
|
4183
4183
|
e.key === "Enter" && !R.value && (e.preventDefault(), pe()), e.key === "Escape" && i("close");
|
|
@@ -4205,7 +4205,7 @@ var Dn = ["data-tpl-theme"], On = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, kn
|
|
|
4205
4205
|
w("div", An, [
|
|
4206
4206
|
oe.value ? (o(), g("div", jn, [w("div", Mn, [j(v(wn), {
|
|
4207
4207
|
ref_key: "cropperRef",
|
|
4208
|
-
ref:
|
|
4208
|
+
ref: N,
|
|
4209
4209
|
src: e.item.url,
|
|
4210
4210
|
"stencil-props": { aspectRatio: se.value },
|
|
4211
4211
|
class: "tpl:h-full tpl:w-full",
|
|
@@ -4224,11 +4224,11 @@ var Dn = ["data-tpl-theme"], On = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, kn
|
|
|
4224
4224
|
type: "button",
|
|
4225
4225
|
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",
|
|
4226
4226
|
style: E({
|
|
4227
|
-
borderColor:
|
|
4228
|
-
backgroundColor:
|
|
4229
|
-
color:
|
|
4227
|
+
borderColor: P.value === e ? "var(--tpl-primary)" : "var(--tpl-border)",
|
|
4228
|
+
backgroundColor: P.value === e ? "var(--tpl-primary-light)" : "var(--tpl-bg)",
|
|
4229
|
+
color: P.value === e ? "var(--tpl-primary)" : "var(--tpl-text)"
|
|
4230
4230
|
}),
|
|
4231
|
-
onClick: (t) =>
|
|
4231
|
+
onClick: (t) => P.value = e
|
|
4232
4232
|
}, p(v(T)[`crop${e.charAt(0).toUpperCase()}${e.slice(1)}`]), 13, In)), 64))])]),
|
|
4233
4233
|
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", {
|
|
4234
4234
|
value: ne.value,
|
|
@@ -4269,7 +4269,7 @@ var Dn = ["data-tpl-theme"], On = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, kn
|
|
|
4269
4269
|
autofocus: !oe.value
|
|
4270
4270
|
}, null, 8, er), [[S, A.value]])]),
|
|
4271
4271
|
v(D)(e.item.mime_type) ? (o(), g("div", tr, [w("label", nr, p(v(a).mediaLibrary.altText), 1), n(w("input", {
|
|
4272
|
-
"onUpdate:modelValue": r[1] ||= (e) =>
|
|
4272
|
+
"onUpdate:modelValue": r[1] ||= (e) => M.value = e,
|
|
4273
4273
|
type: "text",
|
|
4274
4274
|
class: "tpl:w-full tpl:rounded-md tpl:border tpl:px-3 tpl:py-1.5 tpl:text-xs tpl:outline-none",
|
|
4275
4275
|
style: {
|
|
@@ -4278,7 +4278,7 @@ var Dn = ["data-tpl-theme"], On = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, kn
|
|
|
4278
4278
|
color: "var(--tpl-text)"
|
|
4279
4279
|
},
|
|
4280
4280
|
placeholder: v(a).mediaLibrary.altTextPlaceholder
|
|
4281
|
-
}, null, 8, rr), [[S,
|
|
4281
|
+
}, null, 8, rr), [[S, M.value]])])) : _("", !0)
|
|
4282
4282
|
]),
|
|
4283
4283
|
w("div", ir, [w("button", {
|
|
4284
4284
|
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",
|
|
@@ -4321,15 +4321,15 @@ var Dn = ["data-tpl-theme"], On = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, kn
|
|
|
4321
4321
|
"deleteFolder"
|
|
4322
4322
|
],
|
|
4323
4323
|
setup(e, { emit: t }) {
|
|
4324
|
-
let i = e, a = t, { t: s } = z(), l = d(!1), u = d(!1), m = d(""), x = d(!1), T = d(""), D = h(() => (i.folder.children?.length ?? 0) > 0), k = h(() => i.depth < mr - 1), A = h(() => i.currentFolderId === i.folder.id), ee = h(() => !i.currentFolderId || !i.folder.children ? !1 :
|
|
4325
|
-
function
|
|
4326
|
-
for (let n of e) if (n.id === t || n.children &&
|
|
4324
|
+
let i = e, a = t, { t: s } = z(), l = d(!1), u = d(!1), m = d(""), x = d(!1), T = d(""), D = h(() => (i.folder.children?.length ?? 0) > 0), k = h(() => i.depth < mr - 1), A = h(() => i.currentFolderId === i.folder.id), ee = h(() => !i.currentFolderId || !i.folder.children ? !1 : N(i.folder.children, i.currentFolderId)), M = h(() => l.value || ee.value);
|
|
4325
|
+
function N(e, t) {
|
|
4326
|
+
for (let n of e) if (n.id === t || n.children && N(n.children, t)) return !0;
|
|
4327
4327
|
return !1;
|
|
4328
4328
|
}
|
|
4329
4329
|
function P() {
|
|
4330
4330
|
l.value = !l.value;
|
|
4331
4331
|
}
|
|
4332
|
-
function
|
|
4332
|
+
function te() {
|
|
4333
4333
|
u.value = !0, m.value = i.folder.name;
|
|
4334
4334
|
}
|
|
4335
4335
|
function ne() {
|
|
@@ -4339,13 +4339,13 @@ var Dn = ["data-tpl-theme"], On = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, kn
|
|
|
4339
4339
|
function re() {
|
|
4340
4340
|
u.value = !1, m.value = "";
|
|
4341
4341
|
}
|
|
4342
|
-
function
|
|
4342
|
+
function ie() {
|
|
4343
4343
|
x.value = !0, T.value = "", l.value = !0;
|
|
4344
4344
|
}
|
|
4345
|
-
function
|
|
4345
|
+
function R() {
|
|
4346
4346
|
T.value.trim() && a("createFolder", T.value.trim(), i.folder.id), x.value = !1, T.value = "";
|
|
4347
4347
|
}
|
|
4348
|
-
function
|
|
4348
|
+
function ae() {
|
|
4349
4349
|
x.value = !1, T.value = "";
|
|
4350
4350
|
}
|
|
4351
4351
|
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
|
key: 0,
|
|
4363
4363
|
class: "tpl:flex tpl:size-4 tpl:shrink-0 tpl:items-center tpl:justify-center tpl:rounded tpl:transition-colors",
|
|
4364
4364
|
onClick: y(P, ["stop"])
|
|
4365
|
-
}, [j(v(
|
|
4366
|
-
class: C(["tpl:transition-transform tpl:duration-150", { "tpl:rotate-90":
|
|
4365
|
+
}, [j(v(F), {
|
|
4366
|
+
class: C(["tpl:transition-transform tpl:duration-150", { "tpl:rotate-90": M.value }]),
|
|
4367
4367
|
size: 10,
|
|
4368
4368
|
"stroke-width": 2
|
|
4369
4369
|
}, null, 8, ["class"])])) : (o(), g("span", sr)),
|
|
@@ -4395,7 +4395,7 @@ var Dn = ["data-tpl-theme"], On = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, kn
|
|
|
4395
4395
|
key: 0,
|
|
4396
4396
|
class: "tpl:flex tpl:size-6 tpl:items-center tpl:justify-center tpl:rounded tpl:transition-colors",
|
|
4397
4397
|
title: v(s).mediaLibrary.addSubfolder,
|
|
4398
|
-
onClick: y(
|
|
4398
|
+
onClick: y(ie, ["stop"])
|
|
4399
4399
|
}, [j(v(he), {
|
|
4400
4400
|
size: 12,
|
|
4401
4401
|
"stroke-width": 2
|
|
@@ -4403,21 +4403,21 @@ var Dn = ["data-tpl-theme"], On = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, kn
|
|
|
4403
4403
|
w("button", {
|
|
4404
4404
|
class: "tpl:flex tpl:size-6 tpl:items-center tpl:justify-center tpl:rounded tpl:transition-colors",
|
|
4405
4405
|
title: v(s).mediaLibrary.renameFolder,
|
|
4406
|
-
onClick: y(
|
|
4407
|
-
}, [j(v(
|
|
4406
|
+
onClick: y(te, ["stop"])
|
|
4407
|
+
}, [j(v(L), {
|
|
4408
4408
|
size: 12,
|
|
4409
4409
|
"stroke-width": 2
|
|
4410
4410
|
})], 8, dr),
|
|
4411
4411
|
w("button", {
|
|
4412
4412
|
class: "tpl:flex tpl:size-6 tpl:items-center tpl:justify-center tpl:rounded tpl:transition-colors",
|
|
4413
4413
|
onClick: i[3] ||= y((t) => a("deleteFolder", e.folder.id), ["stop"])
|
|
4414
|
-
}, [j(v(
|
|
4414
|
+
}, [j(v(I), {
|
|
4415
4415
|
size: 12,
|
|
4416
4416
|
"stroke-width": 2,
|
|
4417
4417
|
style: { color: "var(--tpl-danger)" }
|
|
4418
4418
|
})])
|
|
4419
4419
|
]))
|
|
4420
|
-
], 4),
|
|
4420
|
+
], 4), M.value ? (o(), g("div", fr, [(o(!0), g(O, null, c(e.folder.children, (t) => (o(), b(l, {
|
|
4421
4421
|
key: t.id,
|
|
4422
4422
|
folder: t,
|
|
4423
4423
|
"current-folder-id": e.currentFolderId,
|
|
@@ -4445,8 +4445,8 @@ var Dn = ["data-tpl-theme"], On = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, kn
|
|
|
4445
4445
|
},
|
|
4446
4446
|
placeholder: v(s).mediaLibrary.subfolderName,
|
|
4447
4447
|
autofocus: "",
|
|
4448
|
-
onKeydown: [f(
|
|
4449
|
-
onBlur:
|
|
4448
|
+
onKeydown: [f(R, ["enter"]), f(ae, ["escape"])],
|
|
4449
|
+
onBlur: R
|
|
4450
4450
|
}, null, 40, pr), [[S, T.value]])], 4)) : _("", !0)])) : _("", !0)]);
|
|
4451
4451
|
};
|
|
4452
4452
|
}
|
|
@@ -4751,7 +4751,7 @@ var Dn = ["data-tpl-theme"], On = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, kn
|
|
|
4751
4751
|
}, Yr = {
|
|
4752
4752
|
key: 4,
|
|
4753
4753
|
class: "tpl:flex tpl:justify-center tpl:py-4"
|
|
4754
|
-
}, Xr = /* @__PURE__ */
|
|
4754
|
+
}, Xr = /* @__PURE__ */ le(/* @__PURE__ */ A({
|
|
4755
4755
|
__name: "MediaGrid",
|
|
4756
4756
|
props: {
|
|
4757
4757
|
items: {},
|
|
@@ -4777,7 +4777,7 @@ var Dn = ["data-tpl-theme"], On = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, kn
|
|
|
4777
4777
|
r("select", e);
|
|
4778
4778
|
}
|
|
4779
4779
|
let { t: u } = z(), f = d(null);
|
|
4780
|
-
|
|
4780
|
+
re(f, ([{ isIntersecting: e }]) => {
|
|
4781
4781
|
e && n.hasMore && !n.isLoading && r("loadMore");
|
|
4782
4782
|
}, { threshold: .1 });
|
|
4783
4783
|
function m(e) {
|
|
@@ -4822,7 +4822,7 @@ var Dn = ["data-tpl-theme"], On = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, kn
|
|
|
4822
4822
|
style: { color: "var(--tpl-text-muted)" },
|
|
4823
4823
|
title: v(u).mediaLibrary.editFile,
|
|
4824
4824
|
onClick: y((e) => r("edit", t), ["stop"])
|
|
4825
|
-
}, [j(v(
|
|
4825
|
+
}, [j(v(L), {
|
|
4826
4826
|
size: 12,
|
|
4827
4827
|
"stroke-width": 2
|
|
4828
4828
|
})], 8, Kr), w("button", {
|
|
@@ -4830,11 +4830,11 @@ var Dn = ["data-tpl-theme"], On = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, kn
|
|
|
4830
4830
|
style: { color: "var(--tpl-text-muted)" },
|
|
4831
4831
|
title: v(u).mediaLibrary.replaceFile,
|
|
4832
4832
|
onClick: y((e) => r("replace", t), ["stop"])
|
|
4833
|
-
}, [j(v(
|
|
4833
|
+
}, [j(v(ae), {
|
|
4834
4834
|
size: 12,
|
|
4835
4835
|
"stroke-width": 2
|
|
4836
4836
|
})], 8, qr)]),
|
|
4837
|
-
e.selectedIds.has(t.id) ? (o(), g("div", Jr, [j(v(
|
|
4837
|
+
e.selectedIds.has(t.id) ? (o(), g("div", Jr, [j(v(M), {
|
|
4838
4838
|
size: 12,
|
|
4839
4839
|
"stroke-width": 3
|
|
4840
4840
|
})])) : _("", !0)
|
|
@@ -4867,7 +4867,7 @@ var Dn = ["data-tpl-theme"], On = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, kn
|
|
|
4867
4867
|
style: { "background-color": "rgba(0, 0, 0, 0.6)" },
|
|
4868
4868
|
title: v(u).mediaLibrary.editFile,
|
|
4869
4869
|
onClick: y((e) => r("edit", t), ["stop"])
|
|
4870
|
-
}, [j(v(
|
|
4870
|
+
}, [j(v(L), {
|
|
4871
4871
|
size: 11,
|
|
4872
4872
|
"stroke-width": 2
|
|
4873
4873
|
})], 8, Pr), w("button", {
|
|
@@ -4875,11 +4875,11 @@ var Dn = ["data-tpl-theme"], On = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, kn
|
|
|
4875
4875
|
style: { "background-color": "rgba(0, 0, 0, 0.6)" },
|
|
4876
4876
|
title: v(u).mediaLibrary.replaceFile,
|
|
4877
4877
|
onClick: y((e) => r("replace", t), ["stop"])
|
|
4878
|
-
}, [j(v(
|
|
4878
|
+
}, [j(v(ae), {
|
|
4879
4879
|
size: 11,
|
|
4880
4880
|
"stroke-width": 2
|
|
4881
4881
|
})], 8, Fr)]),
|
|
4882
|
-
e.selectedIds.has(t.id) ? (o(), g("div", Ir, [j(v(
|
|
4882
|
+
e.selectedIds.has(t.id) ? (o(), g("div", Ir, [j(v(M), {
|
|
4883
4883
|
size: 12,
|
|
4884
4884
|
"stroke-width": 3
|
|
4885
4885
|
})])) : _("", !0)
|
|
@@ -4889,7 +4889,7 @@ var Dn = ["data-tpl-theme"], On = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, kn
|
|
|
4889
4889
|
ref: f,
|
|
4890
4890
|
class: "tpl:h-4"
|
|
4891
4891
|
}, null, 512),
|
|
4892
|
-
e.isLoading && e.items.length > 0 ? (o(), g("div", Yr, [j(v(
|
|
4892
|
+
e.isLoading && e.items.length > 0 ? (o(), g("div", Yr, [j(v(de), {
|
|
4893
4893
|
class: "tpl-spinner",
|
|
4894
4894
|
size: 20,
|
|
4895
4895
|
"stroke-width": 2,
|
|
@@ -4978,7 +4978,7 @@ var Dn = ["data-tpl-theme"], On = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, kn
|
|
|
4978
4978
|
style: { background: "linear-gradient(\n 135deg,\n var(--tpl-primary),\n var(--tpl-primary-hover)\n )" },
|
|
4979
4979
|
disabled: !f.value.trim() || e.isImporting,
|
|
4980
4980
|
onClick: h
|
|
4981
|
-
}, [e.isImporting ? (o(), g("span", oi, [j(v(
|
|
4981
|
+
}, [e.isImporting ? (o(), g("span", oi, [j(v(de), {
|
|
4982
4982
|
class: "tpl:animate-spin",
|
|
4983
4983
|
size: 12,
|
|
4984
4984
|
"stroke-width": 2
|
|
@@ -5009,7 +5009,7 @@ var Dn = ["data-tpl-theme"], On = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, kn
|
|
|
5009
5009
|
}), r.children?.length && n.push(...a(r.children, t + 1));
|
|
5010
5010
|
return n;
|
|
5011
5011
|
}
|
|
5012
|
-
return
|
|
5012
|
+
return ce(i, () => {
|
|
5013
5013
|
n("close");
|
|
5014
5014
|
}), (t, s) => (o(), g("div", {
|
|
5015
5015
|
ref_key: "pickerRef",
|
|
@@ -5064,7 +5064,7 @@ var Dn = ["data-tpl-theme"], On = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, kn
|
|
|
5064
5064
|
}, xi = {
|
|
5065
5065
|
class: "tpl:block tpl:text-[10px]",
|
|
5066
5066
|
style: { color: "var(--tpl-text-muted)" }
|
|
5067
|
-
}, Si = ["value"], Ci = ["value"], wi = /* @__PURE__ */
|
|
5067
|
+
}, Si = ["value"], Ci = ["value"], wi = /* @__PURE__ */ le(/* @__PURE__ */ A({
|
|
5068
5068
|
__name: "MediaPreviewPanel",
|
|
5069
5069
|
props: {
|
|
5070
5070
|
item: {},
|
|
@@ -5317,9 +5317,9 @@ var Dn = ["data-tpl-theme"], On = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, kn
|
|
|
5317
5317
|
let t = u(e);
|
|
5318
5318
|
t.length && n("upload", t);
|
|
5319
5319
|
}
|
|
5320
|
-
let { isOverDropZone: m } =
|
|
5320
|
+
let { isOverDropZone: m } = te(l, { onDrop: (e) => {
|
|
5321
5321
|
e?.length && f(e);
|
|
5322
|
-
} }), { open: h, onChange: _ } =
|
|
5322
|
+
} }), { open: h, onChange: _ } = ue({
|
|
5323
5323
|
accept: s.value,
|
|
5324
5324
|
multiple: !0
|
|
5325
5325
|
});
|
|
@@ -5334,7 +5334,7 @@ var Dn = ["data-tpl-theme"], On = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, kn
|
|
|
5334
5334
|
"background-color": "var(--tpl-bg)"
|
|
5335
5335
|
},
|
|
5336
5336
|
onClick: n[0] ||= (e) => v(h)()
|
|
5337
|
-
}, [e.isUploading ? (o(), g("div", Bi, [j(v(
|
|
5337
|
+
}, [e.isUploading ? (o(), g("div", Bi, [j(v(de), {
|
|
5338
5338
|
class: "tpl-spinner",
|
|
5339
5339
|
size: 20,
|
|
5340
5340
|
"stroke-width": 2,
|
|
@@ -5343,7 +5343,7 @@ var Dn = ["data-tpl-theme"], On = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, kn
|
|
|
5343
5343
|
current: e.uploadProgress.current,
|
|
5344
5344
|
total: e.uploadProgress.total
|
|
5345
5345
|
}) : v(r).mediaLibrary.uploading), 1)])) : (o(), g(O, { key: 1 }, [
|
|
5346
|
-
j(v(
|
|
5346
|
+
j(v(se), {
|
|
5347
5347
|
class: "tpl:mb-2",
|
|
5348
5348
|
size: 24,
|
|
5349
5349
|
"stroke-width": 1.5,
|
|
@@ -5474,13 +5474,13 @@ function Xi(e) {
|
|
|
5474
5474
|
}), ee(() => t.previewItem.value?.id, () => {
|
|
5475
5475
|
c.value = "original";
|
|
5476
5476
|
});
|
|
5477
|
-
let b =
|
|
5477
|
+
let b = R((e) => {
|
|
5478
5478
|
t.search(e);
|
|
5479
5479
|
}, 300);
|
|
5480
5480
|
function x(e) {
|
|
5481
5481
|
s.value = e, b(e);
|
|
5482
5482
|
}
|
|
5483
|
-
let { copy: S, copied: C } =
|
|
5483
|
+
let { copy: S, copied: C } = ie({
|
|
5484
5484
|
copiedDuring: 2e3,
|
|
5485
5485
|
legacy: !0
|
|
5486
5486
|
});
|
|
@@ -5508,19 +5508,19 @@ function Xi(e) {
|
|
|
5508
5508
|
async function j(e) {
|
|
5509
5509
|
await t.importFromUrl(e) && (u.value = !1);
|
|
5510
5510
|
}
|
|
5511
|
-
async function
|
|
5511
|
+
async function M(e) {
|
|
5512
5512
|
f.value = !1, await t.moveSelected(e);
|
|
5513
5513
|
}
|
|
5514
|
-
async function
|
|
5514
|
+
async function N() {
|
|
5515
5515
|
await t.checkUsageBeforeDelete();
|
|
5516
5516
|
}
|
|
5517
|
-
function
|
|
5517
|
+
function P(e) {
|
|
5518
5518
|
t.checkUsageBeforeReplace(e);
|
|
5519
5519
|
}
|
|
5520
|
-
async function
|
|
5520
|
+
async function F(e) {
|
|
5521
5521
|
await t.replaceFile(e);
|
|
5522
5522
|
}
|
|
5523
|
-
function
|
|
5523
|
+
function te() {
|
|
5524
5524
|
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";
|
|
5525
5525
|
}
|
|
5526
5526
|
return {
|
|
@@ -5547,11 +5547,11 @@ function Xi(e) {
|
|
|
5547
5547
|
handleEditItem: k,
|
|
5548
5548
|
handleEditSave: A,
|
|
5549
5549
|
handleImportFromUrl: j,
|
|
5550
|
-
handleMoveToFolder:
|
|
5551
|
-
handleDeleteClick:
|
|
5552
|
-
handleReplaceItem:
|
|
5553
|
-
handleReplaceFile:
|
|
5554
|
-
resetUI:
|
|
5550
|
+
handleMoveToFolder: M,
|
|
5551
|
+
handleDeleteClick: N,
|
|
5552
|
+
handleReplaceItem: P,
|
|
5553
|
+
handleReplaceFile: F,
|
|
5554
|
+
resetUI: te
|
|
5555
5555
|
};
|
|
5556
5556
|
}
|
|
5557
5557
|
//#endregion
|
|
@@ -5633,7 +5633,7 @@ var Zi = ["data-tpl-theme"], Qi = {
|
|
|
5633
5633
|
setup(e, { emit: t }) {
|
|
5634
5634
|
let n = e, r = t, { t: i } = z(), a = l("tplUiTheme");
|
|
5635
5635
|
s(Pe, D(() => n.popoverTarget ?? null));
|
|
5636
|
-
let d = l("authManager"), f = l("projectId"), S = h(() => f.value), T = l("planConfig"), A = h(() => T.hasFeature("media_folders")),
|
|
5636
|
+
let d = l("authManager"), f = l("projectId"), S = h(() => f.value), T = l("planConfig"), A = h(() => T.hasFeature("media_folders")), N = h(() => T.hasFeature("import_from_url")), P = h(() => T.config.value?.storage.used_bytes ?? 0), F = h(() => T.config.value?.storage.limit_bytes ?? 0), { isAcceptedMimeType: te, availableCategories: re } = Oe(), I = Ce({
|
|
5637
5637
|
projectId: S.value,
|
|
5638
5638
|
authManager: d
|
|
5639
5639
|
}), L = Xi({
|
|
@@ -5644,15 +5644,15 @@ var Zi = ["data-tpl-theme"], Qi = {
|
|
|
5644
5644
|
ee(() => n.visible, (e) => {
|
|
5645
5645
|
e ? (I.loadItems(), I.loadFrequentlyUsed()) : L.resetUI();
|
|
5646
5646
|
});
|
|
5647
|
-
function
|
|
5647
|
+
function ie(e) {
|
|
5648
5648
|
e.key === "Escape" && r("close");
|
|
5649
5649
|
}
|
|
5650
|
-
|
|
5651
|
-
function
|
|
5652
|
-
return I.previewItem.value ? n.accept?.length ?
|
|
5650
|
+
oe(document, "keydown", ie);
|
|
5651
|
+
function R() {
|
|
5652
|
+
return I.previewItem.value ? n.accept?.length ? te(I.previewItem.value.mime_type, n.accept) : !0 : !1;
|
|
5653
5653
|
}
|
|
5654
|
-
function
|
|
5655
|
-
if (
|
|
5654
|
+
function ae() {
|
|
5655
|
+
if (R()) {
|
|
5656
5656
|
let e = I.previewItem.value;
|
|
5657
5657
|
r("select", {
|
|
5658
5658
|
...e,
|
|
@@ -5676,8 +5676,8 @@ var Zi = ["data-tpl-theme"], Qi = {
|
|
|
5676
5676
|
}, [w("div", Qi, [
|
|
5677
5677
|
w("div", $i, [w("h2", ea, p(v(i).mediaLibrary.title), 1), w("div", ta, [
|
|
5678
5678
|
j(Yi, {
|
|
5679
|
-
"used-bytes":
|
|
5680
|
-
"limit-bytes":
|
|
5679
|
+
"used-bytes": P.value,
|
|
5680
|
+
"limit-bytes": F.value,
|
|
5681
5681
|
size: 22
|
|
5682
5682
|
}, null, 8, ["used-bytes", "limit-bytes"]),
|
|
5683
5683
|
w("div", na, [w("input", {
|
|
@@ -5701,7 +5701,7 @@ var Zi = ["data-tpl-theme"], Qi = {
|
|
|
5701
5701
|
class: "tpl:flex tpl:size-7 tpl:items-center tpl:justify-center tpl:rounded-md tpl:transition-all tpl:duration-150",
|
|
5702
5702
|
style: { color: "var(--tpl-text-muted)" },
|
|
5703
5703
|
onClick: n[1] ||= (e) => r("close")
|
|
5704
|
-
}, [j(v(
|
|
5704
|
+
}, [j(v(ne), {
|
|
5705
5705
|
size: 18,
|
|
5706
5706
|
"stroke-width": 2
|
|
5707
5707
|
})])
|
|
@@ -5821,7 +5821,7 @@ var Zi = ["data-tpl-theme"], Qi = {
|
|
|
5821
5821
|
"is-uploading",
|
|
5822
5822
|
"upload-progress",
|
|
5823
5823
|
"onUpload"
|
|
5824
|
-
]),
|
|
5824
|
+
]), N.value ? (o(), g("button", {
|
|
5825
5825
|
key: 0,
|
|
5826
5826
|
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",
|
|
5827
5827
|
style: {
|
|
@@ -5965,11 +5965,11 @@ var Zi = ["data-tpl-theme"], Qi = {
|
|
|
5965
5965
|
backgroundColor: "var(--tpl-bg)"
|
|
5966
5966
|
}),
|
|
5967
5967
|
onClick: n[14] ||= (e) => v(L).copy(v(L).selectedUrl.value)
|
|
5968
|
-
}, [v(L).copied.value ? (o(), b(v(
|
|
5968
|
+
}, [v(L).copied.value ? (o(), b(v(M), {
|
|
5969
5969
|
key: 1,
|
|
5970
5970
|
size: 12,
|
|
5971
5971
|
"stroke-width": 2
|
|
5972
|
-
})) : (o(), b(v(
|
|
5972
|
+
})) : (o(), b(v(fe), {
|
|
5973
5973
|
key: 0,
|
|
5974
5974
|
size: 12,
|
|
5975
5975
|
"stroke-width": 2
|
|
@@ -6006,8 +6006,8 @@ var Zi = ["data-tpl-theme"], Qi = {
|
|
|
6006
6006
|
"background-color": "var(--tpl-primary)",
|
|
6007
6007
|
color: "var(--tpl-bg)"
|
|
6008
6008
|
},
|
|
6009
|
-
disabled: !
|
|
6010
|
-
onClick:
|
|
6009
|
+
disabled: !R(),
|
|
6010
|
+
onClick: ae
|
|
6011
6011
|
}, p(e.accept?.length ? v(i).mediaLibrary.selectImage : v(i).mediaLibrary.selectFile), 9, Ba)])])])
|
|
6012
6012
|
])], 8, Zi)) : _("", !0)]),
|
|
6013
6013
|
_: 1
|
|
@@ -6017,4 +6017,4 @@ var Zi = ["data-tpl-theme"], Qi = {
|
|
|
6017
6017
|
//#endregion
|
|
6018
6018
|
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 };
|
|
6019
6019
|
|
|
6020
|
-
//# sourceMappingURL=media-library-
|
|
6020
|
+
//# sourceMappingURL=media-library-BERe10wA.js.map
|