@templatical/editor 0.16.2 → 0.16.4
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-EaPCeDXr.js → AiChatSidebar-CYAbVB2G.js} +7 -7
- package/dist/{AiFeatureMenu-DfTYyExg.js → AiFeatureMenu-BPCkrHAS.js} +4 -4
- package/dist/{BlockIssueBadge-CZYgn-qg.js → BlockIssueBadge-BLytBabN.js} +2 -2
- package/dist/{CloudEditor-BQyZ_nFg.js → CloudEditor-v8ARYaFW.js} +15 -15
- package/dist/{CollaboratorBar-DeP7K-zk.js → CollaboratorBar-BQzKZ2zo.js} +2 -2
- package/dist/ColorPicker-Cab6U2sH.js +474 -0
- package/dist/{CommentsSidebar-DDKiFsSq.js → CommentsSidebar-C_XLBbo3.js} +8 -8
- package/dist/{CountdownToolbar-nY9H0BKd.js → CountdownToolbar-q3umZ7TZ.js} +53 -67
- package/dist/{DesignReferenceSidebar-D6TfC176.js → DesignReferenceSidebar-Bh9uAZ4B.js} +5 -5
- package/dist/{IssuesPanel-CQQipLQP.js → IssuesPanel-DltSuU6H.js} +5 -5
- package/dist/{ModuleBrowserModal-CkeYw1e3.js → ModuleBrowserModal-CzzChPmN.js} +6 -6
- package/dist/{ModulePreviewCanvas-BIMFyYaa.js → ModulePreviewCanvas-C0Q2n3FL.js} +1 -1
- package/dist/{NumberWithSuffix-BoZyUoNz.js → NumberWithSuffix-Bhm2ByHs.js} +1 -1
- package/dist/{ParagraphEditor-DGsTFMxg.js → ParagraphEditor-BhsBi8p8.js} +26 -26
- package/dist/{RichTextEditorContent-BB_n8vgB.js → RichTextEditorContent-ef0fdj6e.js} +3 -3
- package/dist/{SaveModuleDialog-Cypt_qOB.js → SaveModuleDialog-BNN3dcxD.js} +24 -23
- package/dist/{SnapshotHistory-DQTH8TCS.js → SnapshotHistory-tWvgMCe6.js} +6 -6
- package/dist/{TemplateScoringPanel-C8VOC6gn.js → TemplateScoringPanel-ZhObHWeb.js} +10 -10
- package/dist/{TestEmailModal-DqxrL-U9.js → TestEmailModal-EdwEcsrD.js} +3 -3
- package/dist/{TitleEditor-DoGgnrcb.js → TitleEditor-DdvRepBq.js} +4 -4
- package/dist/ToggleSwitch-DUNuUPsZ.js +37 -0
- package/dist/{TplModal-Ca-29YDD.js → TplModal-Niu4Y96-.js} +1 -1
- package/dist/{blockTypeIcons-DVJXg5si.js → blockTypeIcons-DHcYPMB8.js} +2 -2
- package/dist/bundle-stats.json +7 -7
- package/dist/{ca-B3eR47lE.js → ca-DI1ViqMa.js} +2 -1
- package/dist/cdn/chunks/{AiFeatureMenu-roPglhox.js → AiFeatureMenu-AoUwsqor.js} +8 -8
- package/dist/cdn/chunks/{AiFeatureMenu-roPglhox.js.map → AiFeatureMenu-AoUwsqor.js.map} +1 -1
- package/dist/cdn/chunks/{BlockIssueBadge-DW_Tt7Wg.js → BlockIssueBadge-DZU3CfEN.js} +5 -5
- package/dist/cdn/chunks/{BlockIssueBadge-DW_Tt7Wg.js.map → BlockIssueBadge-DZU3CfEN.js.map} +1 -1
- package/dist/cdn/chunks/{CloudEditor-CX6y1k3C.js → CloudEditor-BrZLF_m1.js} +159 -159
- package/dist/cdn/chunks/{CloudEditor-CX6y1k3C.js.map → CloudEditor-BrZLF_m1.js.map} +1 -1
- package/dist/cdn/chunks/{CollaboratorBar-Dyrab63H.js → CollaboratorBar-BAC56ez6.js} +3 -3
- package/dist/cdn/chunks/{CollaboratorBar-Dyrab63H.js.map → CollaboratorBar-BAC56ez6.js.map} +1 -1
- package/dist/cdn/chunks/ColorPicker-DLEoT419.js +471 -0
- package/dist/cdn/chunks/ColorPicker-DLEoT419.js.map +1 -0
- package/dist/cdn/chunks/{CountdownBlock-Bul4tczj.js → CountdownBlock-BOF9aTXF.js} +4 -4
- package/dist/cdn/chunks/{CountdownBlock-Bul4tczj.js.map → CountdownBlock-BOF9aTXF.js.map} +1 -1
- package/dist/cdn/chunks/CountdownToolbar-C9bQ5k4E.js +198 -0
- package/dist/cdn/chunks/CountdownToolbar-C9bQ5k4E.js.map +1 -0
- package/dist/cdn/chunks/{IssuesPanel-BhHU-hq3.js → IssuesPanel-CHwYahKK.js} +7 -7
- package/dist/cdn/chunks/{IssuesPanel-BhHU-hq3.js.map → IssuesPanel-CHwYahKK.js.map} +1 -1
- package/dist/cdn/chunks/{ModuleBrowserModal-BGd5Ryyx.js → ModuleBrowserModal-iSXXpAUk.js} +6 -6
- package/dist/cdn/chunks/{ModuleBrowserModal-BGd5Ryyx.js.map → ModuleBrowserModal-iSXXpAUk.js.map} +1 -1
- package/dist/cdn/chunks/{ModulePreviewCanvas-Hx6SCCjB.js → ModulePreviewCanvas-DIy0MZj2.js} +10 -10
- package/dist/cdn/chunks/{ModulePreviewCanvas-Hx6SCCjB.js.map → ModulePreviewCanvas-DIy0MZj2.js.map} +1 -1
- package/dist/cdn/chunks/{NumberWithSuffix-BImuhc9K.js → NumberWithSuffix-vPdOG2lO.js} +2 -2
- package/dist/cdn/chunks/{NumberWithSuffix-BImuhc9K.js.map → NumberWithSuffix-vPdOG2lO.js.map} +1 -1
- package/dist/cdn/chunks/{ParagraphEditor-K2vENidm.js → ParagraphEditor-D7znI_X1.js} +146 -146
- package/dist/cdn/chunks/{ParagraphEditor-K2vENidm.js.map → ParagraphEditor-D7znI_X1.js.map} +1 -1
- package/dist/cdn/chunks/{RichTextEditorContent-B_w3u5lN.js → RichTextEditorContent-DVwGHbO6.js} +6 -6
- package/dist/cdn/chunks/{RichTextEditorContent-B_w3u5lN.js.map → RichTextEditorContent-DVwGHbO6.js.map} +1 -1
- package/dist/cdn/chunks/{SaveModuleDialog-Cw-182CB.js → SaveModuleDialog-D2_qPtE9.js} +32 -31
- package/dist/cdn/chunks/SaveModuleDialog-D2_qPtE9.js.map +1 -0
- package/dist/cdn/chunks/{TitleEditor-CUKlo_Zj.js → TitleEditor-CKjZ6Cgp.js} +8 -8
- package/dist/cdn/chunks/{TitleEditor-CUKlo_Zj.js.map → TitleEditor-CKjZ6Cgp.js.map} +1 -1
- package/dist/cdn/chunks/ToggleSwitch-OrmX_w18.js +39 -0
- package/dist/cdn/chunks/ToggleSwitch-OrmX_w18.js.map +1 -0
- package/dist/cdn/chunks/{blockTypeIcons-Cx1FAqL6.js → blockTypeIcons-BKecgdgr.js} +8 -8
- package/dist/cdn/chunks/{blockTypeIcons-Cx1FAqL6.js.map → blockTypeIcons-BKecgdgr.js.map} +1 -1
- package/dist/cdn/chunks/{ca-B3eR47lE.js → ca-DI1ViqMa.js} +3 -2
- package/dist/cdn/chunks/ca-DI1ViqMa.js.map +1 -0
- package/dist/{de-Cy8FB-Ii.js → cdn/chunks/de-q9lTCMre.js} +4 -1
- package/dist/cdn/chunks/de-q9lTCMre.js.map +1 -0
- package/dist/cdn/chunks/{en-Bu-zS_5o.js → en-CR4LItrX.js} +3 -2
- package/dist/cdn/chunks/en-CR4LItrX.js.map +1 -0
- package/dist/cdn/chunks/{es-CD3ZD6hK.js → es-CEt-lrGd.js} +3 -2
- package/dist/cdn/chunks/es-CEt-lrGd.js.map +1 -0
- package/dist/cdn/chunks/{extensions-DSxG2wYf.js → extensions-OZTN_skA.js} +19 -19
- package/dist/cdn/chunks/{extensions-DSxG2wYf.js.map → extensions-OZTN_skA.js.map} +1 -1
- package/dist/cdn/chunks/{features-C-cjT_8L.js → features-Bo7H8WNI.js} +370 -368
- package/dist/cdn/chunks/features-Bo7H8WNI.js.map +1 -0
- package/dist/cdn/chunks/{icons-ay0_fN-T.js → icons-BrNSrnyT.js} +26 -26
- package/dist/cdn/chunks/{icons-ay0_fN-T.js.map → icons-BrNSrnyT.js.map} +1 -1
- package/dist/cdn/chunks/{media-library-CkmqPdO4.js → media-library-Cec5DMR3.js} +101 -101
- package/dist/cdn/chunks/{media-library-CkmqPdO4.js.map → media-library-Cec5DMR3.js.map} +1 -1
- package/dist/cdn/chunks/{pt-BR-CgICL-CQ.js → pt-BR-DvBHY0AA.js} +3 -2
- package/dist/cdn/chunks/pt-BR-DvBHY0AA.js.map +1 -0
- package/dist/cdn/chunks/{quality-CDNrMw2A.js → quality-Dd2iYgRf.js} +435 -435
- package/dist/cdn/chunks/{quality-CDNrMw2A.js.map → quality-Dd2iYgRf.js.map} +1 -1
- package/dist/cdn/chunks/{renderer-JQ91A09w.js → renderer-Br-qXdnQ.js} +15 -12
- package/dist/cdn/chunks/{renderer-JQ91A09w.js.map → renderer-Br-qXdnQ.js.map} +1 -1
- package/dist/cdn/chunks/{src-Cehu7Hqx.js → src-BH8PABpF.js} +4 -4
- package/dist/cdn/chunks/{src-Cehu7Hqx.js.map → src-BH8PABpF.js.map} +1 -1
- package/dist/cdn/chunks/{styles-DBjy3lz9.js → styles-nqo5BynI.js} +975 -973
- package/dist/cdn/chunks/styles-nqo5BynI.js.map +1 -0
- package/dist/cdn/editor.css +1 -1
- package/dist/cdn/editor.js +35 -35
- package/dist/{check-D1zYtCPK.js → check-Cg6Mc2pP.js} +1 -1
- package/dist/{chevron-down-ByXpufZD.js → chevron-down-dClfxKrJ.js} +1 -1
- package/dist/{circle-alert-CjcAORUw.js → circle-alert-Bhzm-fNA.js} +1 -1
- package/dist/{clock-5lWLadUn.js → clock-m7TwQw4b.js} +1 -1
- package/dist/{dist-CFOQvhSC.js → color-DhoxCSMv.js} +9 -1
- package/dist/{createLucideIcon-Bh9xOmlW.js → createLucideIcon-FSF4peHQ.js} +2 -2
- package/dist/{cdn/chunks/de-Cy8FB-Ii.js → de-q9lTCMre.js} +2 -3
- package/dist/{en-Bu-zS_5o.js → en-CR4LItrX.js} +2 -1
- package/dist/{es-CD3ZD6hK.js → es-CEt-lrGd.js} +2 -1
- package/dist/{image-up-Bj_nes3f.js → image-up-CDEgJqwA.js} +1 -1
- package/dist/{info-BhSQCxBV.js → info-BNP8yGsK.js} +1 -1
- package/dist/{list-checks-CgxyUg7i.js → list-checks-jepi4iYr.js} +1 -1
- package/dist/{loader-circle-DFU0HPAa.js → loader-circle-BT38qSm3.js} +1 -1
- package/dist/{message-circle-BEBsCHnk.js → message-circle-BAHcL9S-.js} +1 -1
- package/dist/{pt-BR-CgICL-CQ.js → pt-BR-DvBHY0AA.js} +2 -1
- package/dist/{refresh-cw--lvWGy0_.js → refresh-cw-as5Bmg4X.js} +1 -1
- package/dist/{scan-line-QgyDIgn_.js → scan-line-IAMjPtRw.js} +1 -1
- package/dist/{send-BMyisUim.js → send-DvMay6bt.js} +1 -1
- package/dist/{shield-check-C49M20le.js → shield-check-YYDhGroE.js} +1 -1
- package/dist/{sparkles-DV7Dman6.js → sparkles-CCwQMMMZ.js} +1 -1
- package/dist/style.css +1 -1
- package/dist/{styles-mvx3k1hf.js → styles-DN4J7w-C.js} +717 -715
- package/dist/templatical-editor.js +9 -9
- package/dist/{text-align-start-BMU70uAm.js → text-align-start-BwsA6QzC.js} +11 -11
- package/dist/{trash-2-B6M659Ey.js → trash-2-CRBDolnR.js} +1 -1
- package/dist/{triangle-alert-D1lzx6ds.js → triangle-alert-B2g0ALvq.js} +1 -1
- package/dist/{upload-3A1oZtOR.js → upload-BKg6hDRW.js} +1 -1
- package/dist/{useEditorCore-DtZkR7Vk.js → useEditorCore-DBq2689h.js} +249 -255
- package/dist/{x-CG_NV3nP.js → x-Ctg_250T.js} +1 -1
- package/package.json +8 -8
- package/dist/ColorPicker-CXAbjTaG.js +0 -446
- package/dist/cdn/chunks/ColorPicker-BggAWrc9.js +0 -443
- package/dist/cdn/chunks/ColorPicker-BggAWrc9.js.map +0 -1
- package/dist/cdn/chunks/CountdownToolbar-DYvATR0J.js +0 -212
- package/dist/cdn/chunks/CountdownToolbar-DYvATR0J.js.map +0 -1
- package/dist/cdn/chunks/SaveModuleDialog-Cw-182CB.js.map +0 -1
- package/dist/cdn/chunks/ca-B3eR47lE.js.map +0 -1
- package/dist/cdn/chunks/de-Cy8FB-Ii.js.map +0 -1
- package/dist/cdn/chunks/en-Bu-zS_5o.js.map +0 -1
- package/dist/cdn/chunks/es-CD3ZD6hK.js.map +0 -1
- package/dist/cdn/chunks/features-C-cjT_8L.js.map +0 -1
- package/dist/cdn/chunks/pt-BR-CgICL-CQ.js.map +0 -1
- package/dist/cdn/chunks/styles-DBjy3lz9.js.map +0 -1
|
@@ -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-D840DIZB.js";
|
|
2
|
-
import {
|
|
3
|
-
import { B as pe, K as me, L as he, T as ge, W as _e, k as ve, p as ye, q as be, y as xe } from "./icons-
|
|
2
|
+
import { Mt as te, Ot as ne, Pt as M, St as N, T as P, _n as re, fn as ie, ft as F, gn as I, hn as ae, lt as L, mn as oe, pn as se, st as ce, ut as le, vt as ue, w as R, yn as de, yt as fe } from "./features-Bo7H8WNI.js";
|
|
3
|
+
import { B as pe, K as me, L as he, T as ge, W as _e, k as ve, p as ye, q as be, y as xe } from "./icons-BrNSrnyT.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 = `${
|
|
40
|
+
let n = t.toString(), r = `${P(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 =
|
|
50
|
+
let r = P(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(
|
|
62
|
+
return this.request(P(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(
|
|
74
|
+
return this.request(P(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(
|
|
80
|
+
return this.request(P(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(
|
|
89
|
+
return this.request(P(R["folders.index"], this.baseParams));
|
|
90
90
|
}
|
|
91
91
|
async createMediaFolder(e, t) {
|
|
92
|
-
return this.request(
|
|
92
|
+
return this.request(P(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(
|
|
101
|
+
return this.request(P(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(
|
|
110
|
+
return this.request(P(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(
|
|
116
|
+
let t = await this.authManager.authenticatedFetch(P(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(
|
|
131
|
+
return this.request(P(R["media.frequentlyUsed"], this.baseParams));
|
|
132
132
|
}
|
|
133
133
|
async importFromUrl(e, t) {
|
|
134
|
-
return this.request(
|
|
134
|
+
return this.request(P(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 =
|
|
145
|
+
let r = P(R["media.replace"], {
|
|
146
146
|
...this.baseParams,
|
|
147
147
|
media: e
|
|
148
148
|
}), i = await this.authManager.authenticatedFetch(r, {
|
|
@@ -215,7 +215,7 @@ function Ce(e) {
|
|
|
215
215
|
a.value = "files", i.value = e, o.value = "", h.value = /* @__PURE__ */ new Set(), g.value = null, await k();
|
|
216
216
|
}
|
|
217
217
|
async function M() {
|
|
218
|
-
a.value = "frequently-used", i.value = null, o.value = "", h.value = /* @__PURE__ */ new Set(), g.value = null, await
|
|
218
|
+
a.value = "frequently-used", i.value = null, o.value = "", h.value = /* @__PURE__ */ new Set(), g.value = null, await I();
|
|
219
219
|
}
|
|
220
220
|
async function N(r) {
|
|
221
221
|
u.value = !0;
|
|
@@ -228,7 +228,7 @@ function Ce(e) {
|
|
|
228
228
|
u.value = !1;
|
|
229
229
|
}
|
|
230
230
|
}
|
|
231
|
-
async function
|
|
231
|
+
async function P(r) {
|
|
232
232
|
u.value = !0, m.value = {
|
|
233
233
|
current: 0,
|
|
234
234
|
total: r.length
|
|
@@ -250,7 +250,7 @@ function Ce(e) {
|
|
|
250
250
|
u.value = !1, m.value = null;
|
|
251
251
|
}
|
|
252
252
|
}
|
|
253
|
-
async function
|
|
253
|
+
async function re(r) {
|
|
254
254
|
if (h.value.size !== 0) try {
|
|
255
255
|
let e = await t.moveMedia([...h.value], r);
|
|
256
256
|
if (i.value === null) {
|
|
@@ -262,7 +262,7 @@ function Ce(e) {
|
|
|
262
262
|
e.onError?.(t);
|
|
263
263
|
}
|
|
264
264
|
}
|
|
265
|
-
async function
|
|
265
|
+
async function ie(r, i, a) {
|
|
266
266
|
try {
|
|
267
267
|
let e = await t.updateMedia(r, i, a);
|
|
268
268
|
n.value = n.value.map((t) => t.id === r ? e : t), g.value?.id === r && (g.value = e);
|
|
@@ -270,21 +270,21 @@ function Ce(e) {
|
|
|
270
270
|
e.onError?.(t);
|
|
271
271
|
}
|
|
272
272
|
}
|
|
273
|
-
async function
|
|
273
|
+
async function F() {
|
|
274
274
|
if (h.value.size !== 0) try {
|
|
275
275
|
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;
|
|
276
276
|
} catch (t) {
|
|
277
277
|
e.onError?.(t);
|
|
278
278
|
}
|
|
279
279
|
}
|
|
280
|
-
async function
|
|
280
|
+
async function I() {
|
|
281
281
|
try {
|
|
282
282
|
_.value = await t.getFrequentlyUsed();
|
|
283
283
|
} catch (t) {
|
|
284
284
|
e.onError?.(t);
|
|
285
285
|
}
|
|
286
286
|
}
|
|
287
|
-
async function
|
|
287
|
+
async function ae() {
|
|
288
288
|
if (h.value.size === 0) return !1;
|
|
289
289
|
b.value = [...h.value];
|
|
290
290
|
try {
|
|
@@ -327,17 +327,17 @@ function Ce(e) {
|
|
|
327
327
|
function ue(e) {
|
|
328
328
|
g.value = e, h.value = /* @__PURE__ */ new Set([e.id]);
|
|
329
329
|
}
|
|
330
|
-
async function
|
|
330
|
+
async function R() {
|
|
331
331
|
try {
|
|
332
332
|
r.value = await t.getMediaFolders();
|
|
333
333
|
} catch (t) {
|
|
334
334
|
e.onError?.(t);
|
|
335
335
|
}
|
|
336
336
|
}
|
|
337
|
-
async function
|
|
337
|
+
async function de(n, r) {
|
|
338
338
|
try {
|
|
339
339
|
let e = await t.createMediaFolder(n, r);
|
|
340
|
-
return await
|
|
340
|
+
return await R(), e;
|
|
341
341
|
} catch (t) {
|
|
342
342
|
return e.onError?.(t), null;
|
|
343
343
|
}
|
|
@@ -354,7 +354,7 @@ function Ce(e) {
|
|
|
354
354
|
}
|
|
355
355
|
async function pe(n, r) {
|
|
356
356
|
try {
|
|
357
|
-
await t.renameMediaFolder(n, r), await
|
|
357
|
+
await t.renameMediaFolder(n, r), await R();
|
|
358
358
|
} catch (t) {
|
|
359
359
|
e.onError?.(t);
|
|
360
360
|
}
|
|
@@ -362,7 +362,7 @@ function Ce(e) {
|
|
|
362
362
|
async function me(n) {
|
|
363
363
|
try {
|
|
364
364
|
let e = fe(r.value, n)?.parent_id ?? null;
|
|
365
|
-
await t.deleteMediaFolder(n), i.value === n && (i.value = e), await
|
|
365
|
+
await t.deleteMediaFolder(n), i.value === n && (i.value = e), await R(), await k();
|
|
366
366
|
} catch (t) {
|
|
367
367
|
e.onError?.(t);
|
|
368
368
|
}
|
|
@@ -424,23 +424,23 @@ function Ce(e) {
|
|
|
424
424
|
navigateToFolder: ne,
|
|
425
425
|
showFrequentlyUsed: M,
|
|
426
426
|
uploadFile: N,
|
|
427
|
-
uploadFiles:
|
|
428
|
-
moveSelected:
|
|
429
|
-
updateFile:
|
|
430
|
-
deleteSelected:
|
|
427
|
+
uploadFiles: P,
|
|
428
|
+
moveSelected: re,
|
|
429
|
+
updateFile: ie,
|
|
430
|
+
deleteSelected: F,
|
|
431
431
|
isImportingFromUrl: x,
|
|
432
432
|
importFromUrlError: S,
|
|
433
433
|
importFromUrl: se,
|
|
434
434
|
toggleSelection: ce,
|
|
435
435
|
clearSelection: le,
|
|
436
436
|
selectItem: ue,
|
|
437
|
-
loadFolders:
|
|
438
|
-
createFolder:
|
|
437
|
+
loadFolders: R,
|
|
438
|
+
createFolder: de,
|
|
439
439
|
renameFolder: pe,
|
|
440
440
|
deleteFolder: me,
|
|
441
441
|
findFolderInTree: fe,
|
|
442
|
-
loadFrequentlyUsed:
|
|
443
|
-
checkUsageBeforeDelete:
|
|
442
|
+
loadFrequentlyUsed: I,
|
|
443
|
+
checkUsageBeforeDelete: ae,
|
|
444
444
|
confirmDelete: L,
|
|
445
445
|
cancelDelete: oe,
|
|
446
446
|
isReplacing: C,
|
|
@@ -499,7 +499,7 @@ var we = {
|
|
|
499
499
|
class: "tpl:transition-colors tpl:duration-150 tpl:hover:underline",
|
|
500
500
|
style: { color: "var(--tpl-primary)" },
|
|
501
501
|
onClick: t[0] ||= (e) => r("navigate", null)
|
|
502
|
-
}, p(v(i).mediaLibrary.allFiles), 1), (o(!0), g(O, null, c(a.value, (e, t) => (o(), g(O, { key: e.id }, [j(v(
|
|
502
|
+
}, 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), {
|
|
503
503
|
size: 12,
|
|
504
504
|
"stroke-width": 2
|
|
505
505
|
}), t < a.value.length - 1 ? (o(), g("button", {
|
|
@@ -4140,31 +4140,31 @@ var Dn = ["data-tpl-theme"], On = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, kn
|
|
|
4140
4140
|
},
|
|
4141
4141
|
emits: ["save", "close"],
|
|
4142
4142
|
setup(e, { emit: t }) {
|
|
4143
|
-
let r = e, i = t, { t: a } = z(), s = l("tplUiTheme"), f = l(Pe, d(null)), T = a.mediaLibrary, { isImageMimeType: D } = Oe(), A = d(""), te = d(""), ne = d(null), M = d("free"), N = d(void 0),
|
|
4143
|
+
let r = e, i = t, { t: a } = z(), s = l("tplUiTheme"), f = l(Pe, d(null)), T = a.mediaLibrary, { isImageMimeType: D } = Oe(), A = d(""), te = d(""), ne = d(null), M = d("free"), N = d(void 0), P = d(void 0), re = d(""), ie = d(""), F = d(void 0), I = d(null), ae = d(!1), L = d(!1), oe = d(!1), se = h(() => r.item ? [
|
|
4144
4144
|
"image/jpeg",
|
|
4145
4145
|
"image/png",
|
|
4146
4146
|
"image/webp",
|
|
4147
4147
|
"image/gif"
|
|
4148
|
-
].includes(r.item.mime_type) : !1), ce = h(() => M.value === "original" ?
|
|
4148
|
+
].includes(r.item.mime_type) : !1), ce = h(() => M.value === "original" ? F.value : ke[M.value]), le = h(() => I.value ? Ne(I.value.width, I.value.height, N.value, P.value) : null);
|
|
4149
4149
|
ee(() => r.visible, (e) => {
|
|
4150
|
-
e && r.item && (A.value = r.item.filename, te.value = r.item.alt_text || "", M.value = "free", N.value = void 0,
|
|
4150
|
+
e && r.item && (A.value = r.item.filename, te.value = r.item.alt_text || "", M.value = "free", N.value = void 0, P.value = void 0, re.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));
|
|
4151
4151
|
});
|
|
4152
4152
|
function ue(e) {
|
|
4153
|
-
e.coordinates && (
|
|
4153
|
+
e.coordinates && (I.value = {
|
|
4154
4154
|
width: Math.round(e.coordinates.width),
|
|
4155
4155
|
height: Math.round(e.coordinates.height)
|
|
4156
4156
|
}, oe.value = !0);
|
|
4157
4157
|
}
|
|
4158
|
-
function
|
|
4159
|
-
|
|
4158
|
+
function R() {
|
|
4159
|
+
ae.value = !0, !F.value && r.item?.width && r.item?.height && (F.value = r.item.width / r.item.height);
|
|
4160
4160
|
}
|
|
4161
|
-
function
|
|
4161
|
+
function de(e) {
|
|
4162
4162
|
let t = e.target.value;
|
|
4163
|
-
|
|
4163
|
+
re.value = t, N.value = t && parseInt(t, 10) || void 0;
|
|
4164
4164
|
}
|
|
4165
4165
|
function fe(e) {
|
|
4166
4166
|
let t = e.target.value;
|
|
4167
|
-
|
|
4167
|
+
ie.value = t, P.value = t && parseInt(t, 10) || void 0;
|
|
4168
4168
|
}
|
|
4169
4169
|
async function pe() {
|
|
4170
4170
|
let e = A.value.trim();
|
|
@@ -4175,7 +4175,7 @@ var Dn = ["data-tpl-theme"], On = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, kn
|
|
|
4175
4175
|
try {
|
|
4176
4176
|
let { canvas: e } = ne.value.getResult();
|
|
4177
4177
|
if (e) {
|
|
4178
|
-
let t = je(e, N.value,
|
|
4178
|
+
let t = je(e, N.value, P.value), i = Ae(r.item.mime_type);
|
|
4179
4179
|
n = { file: await Me(t, r.item.filename, i) };
|
|
4180
4180
|
}
|
|
4181
4181
|
} catch {
|
|
@@ -4218,7 +4218,7 @@ var Dn = ["data-tpl-theme"], On = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, kn
|
|
|
4218
4218
|
class: "tpl:h-full tpl:w-full",
|
|
4219
4219
|
"background-class": "tpl-cropper-background",
|
|
4220
4220
|
onChange: ue,
|
|
4221
|
-
onReady:
|
|
4221
|
+
onReady: R
|
|
4222
4222
|
}, null, 8, ["src", "stencil-props"])]), w("div", Nn, [
|
|
4223
4223
|
w("div", null, [w("label", Pn, p(v(a).mediaLibrary.cropAspectRatio), 1), w("div", Fn, [(o(), g(O, null, c([
|
|
4224
4224
|
"free",
|
|
@@ -4238,7 +4238,7 @@ var Dn = ["data-tpl-theme"], On = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, kn
|
|
|
4238
4238
|
onClick: (t) => M.value = e
|
|
4239
4239
|
}, p(v(T)[`crop${e.charAt(0).toUpperCase()}${e.slice(1)}`]), 13, In)), 64))])]),
|
|
4240
4240
|
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", {
|
|
4241
|
-
value:
|
|
4241
|
+
value: re.value,
|
|
4242
4242
|
type: "number",
|
|
4243
4243
|
min: "1",
|
|
4244
4244
|
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",
|
|
@@ -4247,10 +4247,10 @@ var Dn = ["data-tpl-theme"], On = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, kn
|
|
|
4247
4247
|
"background-color": "var(--tpl-bg)",
|
|
4248
4248
|
color: "var(--tpl-text)"
|
|
4249
4249
|
},
|
|
4250
|
-
placeholder:
|
|
4251
|
-
onInput:
|
|
4250
|
+
placeholder: I.value?.width?.toString() || "",
|
|
4251
|
+
onInput: de
|
|
4252
4252
|
}, 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", {
|
|
4253
|
-
value:
|
|
4253
|
+
value: ie.value,
|
|
4254
4254
|
type: "number",
|
|
4255
4255
|
min: "1",
|
|
4256
4256
|
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",
|
|
@@ -4259,7 +4259,7 @@ var Dn = ["data-tpl-theme"], On = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, kn
|
|
|
4259
4259
|
"background-color": "var(--tpl-bg)",
|
|
4260
4260
|
color: "var(--tpl-text)"
|
|
4261
4261
|
},
|
|
4262
|
-
placeholder:
|
|
4262
|
+
placeholder: I.value?.height?.toString() || "",
|
|
4263
4263
|
onInput: fe
|
|
4264
4264
|
}, null, 40, Jn), w("span", Yn, p(v(a).mediaLibrary.cropPixels), 1)])])]),
|
|
4265
4265
|
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)
|
|
@@ -4328,15 +4328,15 @@ var Dn = ["data-tpl-theme"], On = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, kn
|
|
|
4328
4328
|
"deleteFolder"
|
|
4329
4329
|
],
|
|
4330
4330
|
setup(e, { emit: t }) {
|
|
4331
|
-
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 :
|
|
4332
|
-
function
|
|
4333
|
-
for (let n of e) if (n.id === t || n.children &&
|
|
4331
|
+
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 : M(i.folder.children, i.currentFolderId)), ne = h(() => l.value || ee.value);
|
|
4332
|
+
function M(e, t) {
|
|
4333
|
+
for (let n of e) if (n.id === t || n.children && M(n.children, t)) return !0;
|
|
4334
4334
|
return !1;
|
|
4335
4335
|
}
|
|
4336
|
-
function
|
|
4336
|
+
function N() {
|
|
4337
4337
|
l.value = !l.value;
|
|
4338
4338
|
}
|
|
4339
|
-
function
|
|
4339
|
+
function P() {
|
|
4340
4340
|
u.value = !0, m.value = i.folder.name;
|
|
4341
4341
|
}
|
|
4342
4342
|
function re() {
|
|
@@ -4346,13 +4346,13 @@ var Dn = ["data-tpl-theme"], On = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, kn
|
|
|
4346
4346
|
function ie() {
|
|
4347
4347
|
u.value = !1, m.value = "";
|
|
4348
4348
|
}
|
|
4349
|
-
function
|
|
4349
|
+
function I() {
|
|
4350
4350
|
x.value = !0, T.value = "", l.value = !0;
|
|
4351
4351
|
}
|
|
4352
|
-
function
|
|
4352
|
+
function ae() {
|
|
4353
4353
|
T.value.trim() && a("createFolder", T.value.trim(), i.folder.id), x.value = !1, T.value = "";
|
|
4354
4354
|
}
|
|
4355
|
-
function
|
|
4355
|
+
function L() {
|
|
4356
4356
|
x.value = !1, T.value = "";
|
|
4357
4357
|
}
|
|
4358
4358
|
return (t, i) => {
|
|
@@ -4368,9 +4368,9 @@ var Dn = ["data-tpl-theme"], On = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, kn
|
|
|
4368
4368
|
D.value || x.value ? (o(), g("button", {
|
|
4369
4369
|
key: 0,
|
|
4370
4370
|
class: "tpl:flex tpl:size-4 tpl:shrink-0 tpl:items-center tpl:justify-center tpl:rounded tpl:transition-colors",
|
|
4371
|
-
onClick: y(
|
|
4372
|
-
}, [j(v(
|
|
4373
|
-
class: C(["tpl:transition-transform tpl:duration-150", { "tpl:rotate-90":
|
|
4371
|
+
onClick: y(N, ["stop"])
|
|
4372
|
+
}, [j(v(te), {
|
|
4373
|
+
class: C(["tpl:transition-transform tpl:duration-150", { "tpl:rotate-90": ne.value }]),
|
|
4374
4374
|
size: 10,
|
|
4375
4375
|
"stroke-width": 2
|
|
4376
4376
|
}, null, 8, ["class"])])) : (o(), g("span", sr)),
|
|
@@ -4402,7 +4402,7 @@ var Dn = ["data-tpl-theme"], On = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, kn
|
|
|
4402
4402
|
key: 0,
|
|
4403
4403
|
class: "tpl:flex tpl:size-6 tpl:items-center tpl:justify-center tpl:rounded tpl:transition-colors",
|
|
4404
4404
|
title: v(s).mediaLibrary.addSubfolder,
|
|
4405
|
-
onClick: y(
|
|
4405
|
+
onClick: y(I, ["stop"])
|
|
4406
4406
|
}, [j(v(ge), {
|
|
4407
4407
|
size: 12,
|
|
4408
4408
|
"stroke-width": 2
|
|
@@ -4410,21 +4410,21 @@ var Dn = ["data-tpl-theme"], On = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, kn
|
|
|
4410
4410
|
w("button", {
|
|
4411
4411
|
class: "tpl:flex tpl:size-6 tpl:items-center tpl:justify-center tpl:rounded tpl:transition-colors",
|
|
4412
4412
|
title: v(s).mediaLibrary.renameFolder,
|
|
4413
|
-
onClick: y(
|
|
4414
|
-
}, [j(v(
|
|
4413
|
+
onClick: y(P, ["stop"])
|
|
4414
|
+
}, [j(v(fe), {
|
|
4415
4415
|
size: 12,
|
|
4416
4416
|
"stroke-width": 2
|
|
4417
4417
|
})], 8, dr),
|
|
4418
4418
|
w("button", {
|
|
4419
4419
|
class: "tpl:flex tpl:size-6 tpl:items-center tpl:justify-center tpl:rounded tpl:transition-colors",
|
|
4420
4420
|
onClick: i[3] ||= y((t) => a("deleteFolder", e.folder.id), ["stop"])
|
|
4421
|
-
}, [j(v(
|
|
4421
|
+
}, [j(v(F), {
|
|
4422
4422
|
size: 12,
|
|
4423
4423
|
"stroke-width": 2,
|
|
4424
4424
|
style: { color: "var(--tpl-danger)" }
|
|
4425
4425
|
})])
|
|
4426
4426
|
]))
|
|
4427
|
-
], 4),
|
|
4427
|
+
], 4), ne.value ? (o(), g("div", fr, [(o(!0), g(O, null, c(e.folder.children, (t) => (o(), b(l, {
|
|
4428
4428
|
key: t.id,
|
|
4429
4429
|
folder: t,
|
|
4430
4430
|
"current-folder-id": e.currentFolderId,
|
|
@@ -4452,8 +4452,8 @@ var Dn = ["data-tpl-theme"], On = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, kn
|
|
|
4452
4452
|
},
|
|
4453
4453
|
placeholder: v(s).mediaLibrary.subfolderName,
|
|
4454
4454
|
autofocus: "",
|
|
4455
|
-
onKeydown: [f(
|
|
4456
|
-
onBlur:
|
|
4455
|
+
onKeydown: [f(ae, ["enter"]), f(L, ["escape"])],
|
|
4456
|
+
onBlur: ae
|
|
4457
4457
|
}, null, 40, pr), [[S, T.value]])], 4)) : _("", !0)])) : _("", !0)]);
|
|
4458
4458
|
};
|
|
4459
4459
|
}
|
|
@@ -4784,7 +4784,7 @@ var Dn = ["data-tpl-theme"], On = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, kn
|
|
|
4784
4784
|
r("select", e);
|
|
4785
4785
|
}
|
|
4786
4786
|
let { t: u } = z(), f = d(null);
|
|
4787
|
-
|
|
4787
|
+
re(f, ([{ isIntersecting: e }]) => {
|
|
4788
4788
|
e && n.hasMore && !n.isLoading && r("loadMore");
|
|
4789
4789
|
}, { threshold: .1 });
|
|
4790
4790
|
function m(e) {
|
|
@@ -4829,7 +4829,7 @@ var Dn = ["data-tpl-theme"], On = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, kn
|
|
|
4829
4829
|
style: { color: "var(--tpl-text-muted)" },
|
|
4830
4830
|
title: v(u).mediaLibrary.editFile,
|
|
4831
4831
|
onClick: y((e) => r("edit", t), ["stop"])
|
|
4832
|
-
}, [j(v(
|
|
4832
|
+
}, [j(v(fe), {
|
|
4833
4833
|
size: 12,
|
|
4834
4834
|
"stroke-width": 2
|
|
4835
4835
|
})], 8, Kr), w("button", {
|
|
@@ -4837,11 +4837,11 @@ var Dn = ["data-tpl-theme"], On = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, kn
|
|
|
4837
4837
|
style: { color: "var(--tpl-text-muted)" },
|
|
4838
4838
|
title: v(u).mediaLibrary.replaceFile,
|
|
4839
4839
|
onClick: y((e) => r("replace", t), ["stop"])
|
|
4840
|
-
}, [j(v(
|
|
4840
|
+
}, [j(v(ue), {
|
|
4841
4841
|
size: 12,
|
|
4842
4842
|
"stroke-width": 2
|
|
4843
4843
|
})], 8, qr)]),
|
|
4844
|
-
e.selectedIds.has(t.id) ? (o(), g("div", Jr, [j(v(
|
|
4844
|
+
e.selectedIds.has(t.id) ? (o(), g("div", Jr, [j(v(M), {
|
|
4845
4845
|
size: 12,
|
|
4846
4846
|
"stroke-width": 3
|
|
4847
4847
|
})])) : _("", !0)
|
|
@@ -4874,7 +4874,7 @@ var Dn = ["data-tpl-theme"], On = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, kn
|
|
|
4874
4874
|
style: { "background-color": "rgba(0, 0, 0, 0.6)" },
|
|
4875
4875
|
title: v(u).mediaLibrary.editFile,
|
|
4876
4876
|
onClick: y((e) => r("edit", t), ["stop"])
|
|
4877
|
-
}, [j(v(
|
|
4877
|
+
}, [j(v(fe), {
|
|
4878
4878
|
size: 11,
|
|
4879
4879
|
"stroke-width": 2
|
|
4880
4880
|
})], 8, Pr), w("button", {
|
|
@@ -4882,11 +4882,11 @@ var Dn = ["data-tpl-theme"], On = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, kn
|
|
|
4882
4882
|
style: { "background-color": "rgba(0, 0, 0, 0.6)" },
|
|
4883
4883
|
title: v(u).mediaLibrary.replaceFile,
|
|
4884
4884
|
onClick: y((e) => r("replace", t), ["stop"])
|
|
4885
|
-
}, [j(v(
|
|
4885
|
+
}, [j(v(ue), {
|
|
4886
4886
|
size: 11,
|
|
4887
4887
|
"stroke-width": 2
|
|
4888
4888
|
})], 8, Fr)]),
|
|
4889
|
-
e.selectedIds.has(t.id) ? (o(), g("div", Ir, [j(v(
|
|
4889
|
+
e.selectedIds.has(t.id) ? (o(), g("div", Ir, [j(v(M), {
|
|
4890
4890
|
size: 12,
|
|
4891
4891
|
"stroke-width": 3
|
|
4892
4892
|
})])) : _("", !0)
|
|
@@ -4896,7 +4896,7 @@ var Dn = ["data-tpl-theme"], On = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, kn
|
|
|
4896
4896
|
ref: f,
|
|
4897
4897
|
class: "tpl:h-4"
|
|
4898
4898
|
}, null, 512),
|
|
4899
|
-
e.isLoading && e.items.length > 0 ? (o(), g("div", Yr, [j(v(
|
|
4899
|
+
e.isLoading && e.items.length > 0 ? (o(), g("div", Yr, [j(v(N), {
|
|
4900
4900
|
class: "tpl-spinner",
|
|
4901
4901
|
size: 20,
|
|
4902
4902
|
"stroke-width": 2,
|
|
@@ -4985,7 +4985,7 @@ var Dn = ["data-tpl-theme"], On = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, kn
|
|
|
4985
4985
|
style: { background: "linear-gradient(\n 135deg,\n var(--tpl-primary),\n var(--tpl-primary-hover)\n )" },
|
|
4986
4986
|
disabled: !f.value.trim() || e.isImporting,
|
|
4987
4987
|
onClick: h
|
|
4988
|
-
}, [e.isImporting ? (o(), g("span", oi, [j(v(
|
|
4988
|
+
}, [e.isImporting ? (o(), g("span", oi, [j(v(N), {
|
|
4989
4989
|
class: "tpl:animate-spin",
|
|
4990
4990
|
size: 12,
|
|
4991
4991
|
"stroke-width": 2
|
|
@@ -5324,7 +5324,7 @@ var Dn = ["data-tpl-theme"], On = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, kn
|
|
|
5324
5324
|
let t = u(e);
|
|
5325
5325
|
t.length && n("upload", t);
|
|
5326
5326
|
}
|
|
5327
|
-
let { isOverDropZone: m } =
|
|
5327
|
+
let { isOverDropZone: m } = oe(l, { onDrop: (e) => {
|
|
5328
5328
|
e?.length && f(e);
|
|
5329
5329
|
} }), { open: h, onChange: _ } = I({
|
|
5330
5330
|
accept: s.value,
|
|
@@ -5341,7 +5341,7 @@ var Dn = ["data-tpl-theme"], On = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, kn
|
|
|
5341
5341
|
"background-color": "var(--tpl-bg)"
|
|
5342
5342
|
},
|
|
5343
5343
|
onClick: n[0] ||= (e) => v(h)()
|
|
5344
|
-
}, [e.isUploading ? (o(), g("div", Bi, [j(v(
|
|
5344
|
+
}, [e.isUploading ? (o(), g("div", Bi, [j(v(N), {
|
|
5345
5345
|
class: "tpl-spinner",
|
|
5346
5346
|
size: 20,
|
|
5347
5347
|
"stroke-width": 2,
|
|
@@ -5350,7 +5350,7 @@ var Dn = ["data-tpl-theme"], On = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, kn
|
|
|
5350
5350
|
current: e.uploadProgress.current,
|
|
5351
5351
|
total: e.uploadProgress.total
|
|
5352
5352
|
}) : v(r).mediaLibrary.uploading), 1)])) : (o(), g(O, { key: 1 }, [
|
|
5353
|
-
j(v(
|
|
5353
|
+
j(v(le), {
|
|
5354
5354
|
class: "tpl:mb-2",
|
|
5355
5355
|
size: 24,
|
|
5356
5356
|
"stroke-width": 1.5,
|
|
@@ -5481,13 +5481,13 @@ function Xi(e) {
|
|
|
5481
5481
|
}), ee(() => t.previewItem.value?.id, () => {
|
|
5482
5482
|
c.value = "original";
|
|
5483
5483
|
});
|
|
5484
|
-
let b =
|
|
5484
|
+
let b = de((e) => {
|
|
5485
5485
|
t.search(e);
|
|
5486
5486
|
}, 300);
|
|
5487
5487
|
function x(e) {
|
|
5488
5488
|
s.value = e, b(e);
|
|
5489
5489
|
}
|
|
5490
|
-
let { copy: S, copied: C } =
|
|
5490
|
+
let { copy: S, copied: C } = se({
|
|
5491
5491
|
copiedDuring: 2e3,
|
|
5492
5492
|
legacy: !0
|
|
5493
5493
|
});
|
|
@@ -5527,7 +5527,7 @@ function Xi(e) {
|
|
|
5527
5527
|
async function N(e) {
|
|
5528
5528
|
await t.replaceFile(e);
|
|
5529
5529
|
}
|
|
5530
|
-
function
|
|
5530
|
+
function P() {
|
|
5531
5531
|
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";
|
|
5532
5532
|
}
|
|
5533
5533
|
return {
|
|
@@ -5558,7 +5558,7 @@ function Xi(e) {
|
|
|
5558
5558
|
handleDeleteClick: ne,
|
|
5559
5559
|
handleReplaceItem: M,
|
|
5560
5560
|
handleReplaceFile: N,
|
|
5561
|
-
resetUI:
|
|
5561
|
+
resetUI: P
|
|
5562
5562
|
};
|
|
5563
5563
|
}
|
|
5564
5564
|
//#endregion
|
|
@@ -5640,7 +5640,7 @@ var Zi = ["data-tpl-theme"], Qi = {
|
|
|
5640
5640
|
setup(e, { emit: t }) {
|
|
5641
5641
|
let n = e, r = t, { t: i } = z(), a = l("tplUiTheme");
|
|
5642
5642
|
s(Pe, D(() => n.popoverTarget ?? null));
|
|
5643
|
-
let d = l("authManager"), f = l("projectId"), S = h(() => f.value), T = l("planConfig"), A = h(() => T.hasFeature("media_folders")),
|
|
5643
|
+
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), P = h(() => T.config.value?.storage.limit_bytes ?? 0), { isAcceptedMimeType: re, availableCategories: ie } = Oe(), F = Ce({
|
|
5644
5644
|
projectId: S.value,
|
|
5645
5645
|
authManager: d
|
|
5646
5646
|
}), I = Xi({
|
|
@@ -5651,15 +5651,15 @@ var Zi = ["data-tpl-theme"], Qi = {
|
|
|
5651
5651
|
ee(() => n.visible, (e) => {
|
|
5652
5652
|
e ? (F.loadItems(), F.loadFrequentlyUsed()) : I.resetUI();
|
|
5653
5653
|
});
|
|
5654
|
-
function
|
|
5654
|
+
function oe(e) {
|
|
5655
5655
|
e.key === "Escape" && r("close");
|
|
5656
5656
|
}
|
|
5657
|
-
|
|
5658
|
-
function
|
|
5659
|
-
return F.previewItem.value ? !n.accept?.length ||
|
|
5657
|
+
ae(document, "keydown", oe);
|
|
5658
|
+
function se() {
|
|
5659
|
+
return F.previewItem.value ? !n.accept?.length || re(F.previewItem.value.mime_type, n.accept) : !1;
|
|
5660
5660
|
}
|
|
5661
5661
|
function ce() {
|
|
5662
|
-
if (
|
|
5662
|
+
if (se()) {
|
|
5663
5663
|
let e = F.previewItem.value;
|
|
5664
5664
|
r("select", {
|
|
5665
5665
|
...e,
|
|
@@ -5684,7 +5684,7 @@ var Zi = ["data-tpl-theme"], Qi = {
|
|
|
5684
5684
|
w("div", $i, [w("h2", ea, p(v(i).mediaLibrary.title), 1), w("div", ta, [
|
|
5685
5685
|
j(Yi, {
|
|
5686
5686
|
"used-bytes": N.value,
|
|
5687
|
-
"limit-bytes":
|
|
5687
|
+
"limit-bytes": P.value,
|
|
5688
5688
|
size: 22
|
|
5689
5689
|
}, null, 8, ["used-bytes", "limit-bytes"]),
|
|
5690
5690
|
w("div", na, [w("input", {
|
|
@@ -5708,7 +5708,7 @@ var Zi = ["data-tpl-theme"], Qi = {
|
|
|
5708
5708
|
class: "tpl:flex tpl:size-7 tpl:items-center tpl:justify-center tpl:rounded-md tpl:transition-all tpl:duration-150",
|
|
5709
5709
|
style: { color: "var(--tpl-text-muted)" },
|
|
5710
5710
|
onClick: n[1] ||= (e) => r("close")
|
|
5711
|
-
}, [j(v(
|
|
5711
|
+
}, [j(v(L), {
|
|
5712
5712
|
size: 18,
|
|
5713
5713
|
"stroke-width": 2
|
|
5714
5714
|
})])
|
|
@@ -5791,7 +5791,7 @@ var Zi = ["data-tpl-theme"], Qi = {
|
|
|
5791
5791
|
size: 14,
|
|
5792
5792
|
"stroke-width": 2
|
|
5793
5793
|
})], 12, pa)])
|
|
5794
|
-
]), w("div", ma, [v(
|
|
5794
|
+
]), w("div", ma, [v(ie).length > 1 ? (o(), g("select", {
|
|
5795
5795
|
key: 0,
|
|
5796
5796
|
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",
|
|
5797
5797
|
style: {
|
|
@@ -5801,7 +5801,7 @@ var Zi = ["data-tpl-theme"], Qi = {
|
|
|
5801
5801
|
},
|
|
5802
5802
|
value: v(F).categoryFilter.value ?? "",
|
|
5803
5803
|
onChange: n[5] ||= (e) => v(F).filterByCategory(e.target.value || null)
|
|
5804
|
-
}, [w("option", ga, p(v(i).mediaLibrary.filterAll), 1), (o(!0), g(O, null, c(v(
|
|
5804
|
+
}, [w("option", ga, p(v(i).mediaLibrary.filterAll), 1), (o(!0), g(O, null, c(v(ie), (e) => (o(), g("option", {
|
|
5805
5805
|
key: e,
|
|
5806
5806
|
value: e
|
|
5807
5807
|
}, p(v(I).getCategoryLabel(e)), 9, _a))), 128))], 40, ha)) : _("", !0), w("select", {
|
|
@@ -5828,7 +5828,7 @@ var Zi = ["data-tpl-theme"], Qi = {
|
|
|
5828
5828
|
"is-uploading",
|
|
5829
5829
|
"upload-progress",
|
|
5830
5830
|
"onUpload"
|
|
5831
|
-
]),
|
|
5831
|
+
]), te.value ? (o(), g("button", {
|
|
5832
5832
|
key: 0,
|
|
5833
5833
|
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",
|
|
5834
5834
|
style: {
|
|
@@ -5972,11 +5972,11 @@ var Zi = ["data-tpl-theme"], Qi = {
|
|
|
5972
5972
|
backgroundColor: "var(--tpl-bg)"
|
|
5973
5973
|
}),
|
|
5974
5974
|
onClick: n[14] ||= (e) => v(I).copy(v(I).selectedUrl.value)
|
|
5975
|
-
}, [v(I).copied.value ? (o(), b(v(
|
|
5975
|
+
}, [v(I).copied.value ? (o(), b(v(M), {
|
|
5976
5976
|
key: 1,
|
|
5977
5977
|
size: 12,
|
|
5978
5978
|
"stroke-width": 2
|
|
5979
|
-
})) : (o(), b(v(
|
|
5979
|
+
})) : (o(), b(v(ne), {
|
|
5980
5980
|
key: 0,
|
|
5981
5981
|
size: 12,
|
|
5982
5982
|
"stroke-width": 2
|
|
@@ -6013,7 +6013,7 @@ var Zi = ["data-tpl-theme"], Qi = {
|
|
|
6013
6013
|
"background-color": "var(--tpl-primary)",
|
|
6014
6014
|
color: "var(--tpl-bg)"
|
|
6015
6015
|
},
|
|
6016
|
-
disabled: !
|
|
6016
|
+
disabled: !se(),
|
|
6017
6017
|
onClick: ce
|
|
6018
6018
|
}, p(e.accept?.length ? v(i).mediaLibrary.selectImage : v(i).mediaLibrary.selectFile), 9, Ba)])])])
|
|
6019
6019
|
])], 8, Zi)) : _("", !0)]),
|
|
@@ -6024,4 +6024,4 @@ var Zi = ["data-tpl-theme"], Qi = {
|
|
|
6024
6024
|
//#endregion
|
|
6025
6025
|
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 };
|
|
6026
6026
|
|
|
6027
|
-
//# sourceMappingURL=media-library-
|
|
6027
|
+
//# sourceMappingURL=media-library-Cec5DMR3.js.map
|