@templatical/editor 0.16.4 → 0.17.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-CYAbVB2G.js → AiChatSidebar-LxCHMdcj.js} +1 -1
- package/dist/{AiFeatureMenu-BPCkrHAS.js → AiFeatureMenu-zwSmx9ZW.js} +3 -3
- package/dist/{BlockIssueBadge-BLytBabN.js → BlockIssueBadge-BQ1yB1me.js} +2 -2
- package/dist/{CloudEditor-v8ARYaFW.js → CloudEditor-5ahgKRX8.js} +11 -10
- package/dist/{CollaboratorBar-BQzKZ2zo.js → CollaboratorBar-6PtX-1AS.js} +2 -2
- package/dist/{ColorPicker-Cab6U2sH.js → ColorPicker-DfzDyNKe.js} +57 -58
- package/dist/{CommentsSidebar-C_XLBbo3.js → CommentsSidebar-Cl93TN96.js} +3 -3
- package/dist/{CountdownBlock-173fiO5Z.js → CountdownBlock-DbXfzwae.js} +1 -1
- package/dist/{CountdownToolbar-q3umZ7TZ.js → CountdownToolbar-BqaMWRyB.js} +3 -3
- package/dist/{DesignReferenceSidebar-Bh9uAZ4B.js → DesignReferenceSidebar-jVrdS8wW.js} +2 -2
- package/dist/{IssuesPanel-DltSuU6H.js → IssuesPanel-Bq3yXg6M.js} +2 -2
- package/dist/{MergeTagSuggestion-DrT3LiZ4.js → MergeTagSuggestion-jIpT_jmz.js} +7 -5
- package/dist/{ModuleBrowserModal-CzzChPmN.js → ModuleBrowserModal-B5IH3-1I.js} +7 -7
- package/dist/{ModulePreviewCanvas-C0Q2n3FL.js → ModulePreviewCanvas-CYOLWoZ9.js} +2 -2
- package/dist/{NumberWithSuffix-Bhm2ByHs.js → NumberWithSuffix-9FG7mNnn.js} +1 -1
- package/dist/{ParagraphEditor-BhsBi8p8.js → ParagraphEditor-duWYA6Vv.js} +38 -39
- package/dist/{RichTextEditorContent-ef0fdj6e.js → RichTextEditorContent-DCzmVeyb.js} +13 -13
- package/dist/{SaveModuleDialog-BNN3dcxD.js → SaveModuleDialog-BPUly5h3.js} +6 -6
- package/dist/{SnapshotHistory-tWvgMCe6.js → SnapshotHistory-CmwU3nlN.js} +4 -4
- package/dist/{TemplateScoringPanel-ZhObHWeb.js → TemplateScoringPanel-CMrfa9Rd.js} +3 -3
- package/dist/{TestEmailModal-EdwEcsrD.js → TestEmailModal-zfomMz9i.js} +3 -3
- package/dist/{TitleEditor-DdvRepBq.js → TitleEditor-v0gtezZE.js} +18 -18
- package/dist/{TplModal-Niu4Y96-.js → TplModal-eGFG7k-y.js} +4 -4
- package/dist/{blockTypeIcons-DHcYPMB8.js → blockTypeIcons-Dd0w4T0I.js} +1 -1
- package/dist/bundle-stats.json +7 -7
- package/dist/{ca-DI1ViqMa.js → ca-CSl--oWR.js} +1 -1
- package/dist/cdn/chunks/{AiFeatureMenu-AoUwsqor.js → AiFeatureMenu-CtXsam7G.js} +6 -6
- package/dist/cdn/chunks/{AiFeatureMenu-AoUwsqor.js.map → AiFeatureMenu-CtXsam7G.js.map} +1 -1
- package/dist/cdn/chunks/{BlockIssueBadge-DZU3CfEN.js → BlockIssueBadge-DR7cpDfQ.js} +4 -4
- package/dist/cdn/chunks/{BlockIssueBadge-DZU3CfEN.js.map → BlockIssueBadge-DR7cpDfQ.js.map} +1 -1
- package/dist/cdn/chunks/{CloudEditor-BrZLF_m1.js → CloudEditor-YC5y3AwC.js} +131 -130
- package/dist/cdn/chunks/CloudEditor-YC5y3AwC.js.map +1 -0
- package/dist/cdn/chunks/{CollaboratorBar-BAC56ez6.js → CollaboratorBar-BOD2j8Kl.js} +3 -3
- package/dist/cdn/chunks/{CollaboratorBar-BAC56ez6.js.map → CollaboratorBar-BOD2j8Kl.js.map} +1 -1
- package/dist/cdn/chunks/{ColorPicker-DLEoT419.js → ColorPicker-CPMWLHpa.js} +144 -144
- package/dist/cdn/chunks/ColorPicker-CPMWLHpa.js.map +1 -0
- package/dist/cdn/chunks/{CountdownBlock-BOF9aTXF.js → CountdownBlock-BmGqb7Zi.js} +4 -4
- package/dist/cdn/chunks/{CountdownBlock-BOF9aTXF.js.map → CountdownBlock-BmGqb7Zi.js.map} +1 -1
- package/dist/cdn/chunks/{CountdownToolbar-C9bQ5k4E.js → CountdownToolbar-BBwsdGbV.js} +4 -4
- package/dist/cdn/chunks/{CountdownToolbar-C9bQ5k4E.js.map → CountdownToolbar-BBwsdGbV.js.map} +1 -1
- package/dist/cdn/chunks/{IssuesPanel-CHwYahKK.js → IssuesPanel-G0z-j3JS.js} +7 -7
- package/dist/cdn/chunks/{IssuesPanel-CHwYahKK.js.map → IssuesPanel-G0z-j3JS.js.map} +1 -1
- package/dist/cdn/chunks/{MergeTagSuggestion-jesxS7An.js → MergeTagSuggestion-rpZ6Ol-i.js} +8 -6
- package/dist/cdn/chunks/MergeTagSuggestion-rpZ6Ol-i.js.map +1 -0
- package/dist/cdn/chunks/{ModuleBrowserModal-iSXXpAUk.js → ModuleBrowserModal-DiLTY0ec.js} +8 -8
- package/dist/cdn/chunks/{ModuleBrowserModal-iSXXpAUk.js.map → ModuleBrowserModal-DiLTY0ec.js.map} +1 -1
- package/dist/cdn/chunks/{ModulePreviewCanvas-DIy0MZj2.js → ModulePreviewCanvas-CdV5mEQ6.js} +32 -32
- package/dist/cdn/chunks/{ModulePreviewCanvas-DIy0MZj2.js.map → ModulePreviewCanvas-CdV5mEQ6.js.map} +1 -1
- package/dist/cdn/chunks/{NumberWithSuffix-vPdOG2lO.js → NumberWithSuffix-lqQlf0Uk.js} +2 -2
- package/dist/cdn/chunks/{NumberWithSuffix-vPdOG2lO.js.map → NumberWithSuffix-lqQlf0Uk.js.map} +1 -1
- package/dist/cdn/chunks/{ParagraphEditor-D7znI_X1.js → ParagraphEditor-BYoZfURd.js} +75 -75
- package/dist/cdn/chunks/ParagraphEditor-BYoZfURd.js.map +1 -0
- package/dist/cdn/chunks/{RichTextEditorContent-DVwGHbO6.js → RichTextEditorContent-BnPRnXxy.js} +6 -6
- package/dist/cdn/chunks/{RichTextEditorContent-DVwGHbO6.js.map → RichTextEditorContent-BnPRnXxy.js.map} +1 -1
- package/dist/cdn/chunks/{SaveModuleDialog-D2_qPtE9.js → SaveModuleDialog-C9hUeWyG.js} +20 -20
- package/dist/cdn/chunks/{SaveModuleDialog-D2_qPtE9.js.map → SaveModuleDialog-C9hUeWyG.js.map} +1 -1
- package/dist/cdn/chunks/{TitleEditor-CKjZ6Cgp.js → TitleEditor-wFvnU3Jr.js} +9 -9
- package/dist/cdn/chunks/TitleEditor-wFvnU3Jr.js.map +1 -0
- package/dist/cdn/chunks/{blockTypeIcons-BKecgdgr.js → blockTypeIcons-DNMvDz5B.js} +7 -7
- package/dist/cdn/chunks/{blockTypeIcons-BKecgdgr.js.map → blockTypeIcons-DNMvDz5B.js.map} +1 -1
- package/dist/cdn/chunks/{ca-DI1ViqMa.js → ca-CSl--oWR.js} +2 -2
- package/dist/cdn/chunks/ca-CSl--oWR.js.map +1 -0
- package/dist/cdn/chunks/{de-q9lTCMre.js → de-ZaffrKDP.js} +2 -2
- package/dist/cdn/chunks/de-ZaffrKDP.js.map +1 -0
- package/dist/cdn/chunks/{en-CR4LItrX.js → en-CHuXeJDt.js} +2 -2
- package/dist/cdn/chunks/en-CHuXeJDt.js.map +1 -0
- package/dist/cdn/chunks/{es-CEt-lrGd.js → es-CaC8VQjO.js} +2 -2
- package/dist/cdn/chunks/es-CaC8VQjO.js.map +1 -0
- package/dist/cdn/chunks/{extensions-OZTN_skA.js → extensions-DxcxIlwT.js} +29 -29
- package/dist/cdn/chunks/{extensions-OZTN_skA.js.map → extensions-DxcxIlwT.js.map} +1 -1
- package/dist/cdn/chunks/{features-Bo7H8WNI.js → features-B3qgDBHf.js} +727 -677
- package/dist/cdn/chunks/features-B3qgDBHf.js.map +1 -0
- package/dist/cdn/chunks/{icons-BrNSrnyT.js → icons-kiMqh99T.js} +2 -2
- package/dist/cdn/chunks/{icons-BrNSrnyT.js.map → icons-kiMqh99T.js.map} +1 -1
- package/dist/cdn/chunks/{media-library-Cec5DMR3.js → media-library-C5ogiZ4f.js} +451 -451
- package/dist/cdn/chunks/{media-library-Cec5DMR3.js.map → media-library-C5ogiZ4f.js.map} +1 -1
- package/dist/cdn/chunks/{pt-BR-DvBHY0AA.js → pt-BR-C74zfEWH.js} +2 -2
- package/dist/cdn/chunks/pt-BR-C74zfEWH.js.map +1 -0
- package/dist/cdn/chunks/{quality-Dd2iYgRf.js → quality-BftAn_AJ.js} +512 -512
- package/dist/cdn/chunks/{quality-Dd2iYgRf.js.map → quality-BftAn_AJ.js.map} +1 -1
- package/dist/cdn/chunks/{renderer-Br-qXdnQ.js → renderer-Cdlo4MVX.js} +16 -16
- package/dist/cdn/chunks/{renderer-Br-qXdnQ.js.map → renderer-Cdlo4MVX.js.map} +1 -1
- package/dist/cdn/chunks/{src-BH8PABpF.js → src-GBA8oUL2.js} +6 -6
- package/dist/cdn/chunks/{src-BH8PABpF.js.map → src-GBA8oUL2.js.map} +1 -1
- package/dist/cdn/chunks/{styles-nqo5BynI.js → styles-B6rdq9JB.js} +219 -219
- package/dist/cdn/chunks/styles-B6rdq9JB.js.map +1 -0
- package/dist/cdn/editor.css +1 -1
- package/dist/cdn/editor.js +53 -52
- package/dist/cdn/editor.js.map +1 -1
- package/dist/{de-q9lTCMre.js → de-ZaffrKDP.js} +1 -1
- package/dist/{en-CR4LItrX.js → en-CHuXeJDt.js} +1 -1
- package/dist/{es-CEt-lrGd.js → es-CaC8VQjO.js} +1 -1
- package/dist/{extensions-B2poxDIo.js → extensions-B4lu0KkE.js} +3 -3
- package/dist/index.d.ts +56 -0
- package/dist/keys-WVNarXg8.js +10 -0
- package/dist/{pt-BR-DvBHY0AA.js → pt-BR-C74zfEWH.js} +1 -1
- package/dist/style.css +1 -1
- package/dist/{styles-DN4J7w-C.js → styles-mBSbDYeX.js} +98 -98
- package/dist/templatical-editor.js +11 -10
- package/dist/{useCloudI18n-WbfVWq5k.js → useCloudI18n-CIKI0hCd.js} +1 -1
- package/dist/{useEditorCore-DBq2689h.js → useEditorCore-CaaHPKjm.js} +715 -684
- package/dist/{useI18n-eR1yVW0v.js → useI18n-0EU_JVe7.js} +1 -1
- package/dist/{useMergeTag-C3GfSktg.js → useMergeTag-C7v6MVah.js} +2 -2
- package/dist/usePopoverPosition-BDqqnMeo.js +281 -0
- package/package.json +7 -7
- package/dist/cdn/chunks/CloudEditor-BrZLF_m1.js.map +0 -1
- package/dist/cdn/chunks/ColorPicker-DLEoT419.js.map +0 -1
- package/dist/cdn/chunks/MergeTagSuggestion-jesxS7An.js.map +0 -1
- package/dist/cdn/chunks/ParagraphEditor-D7znI_X1.js.map +0 -1
- package/dist/cdn/chunks/TitleEditor-CKjZ6Cgp.js.map +0 -1
- package/dist/cdn/chunks/ca-DI1ViqMa.js.map +0 -1
- package/dist/cdn/chunks/de-q9lTCMre.js.map +0 -1
- package/dist/cdn/chunks/en-CR4LItrX.js.map +0 -1
- package/dist/cdn/chunks/es-CEt-lrGd.js.map +0 -1
- package/dist/cdn/chunks/features-Bo7H8WNI.js.map +0 -1
- package/dist/cdn/chunks/pt-BR-DvBHY0AA.js.map +0 -1
- package/dist/cdn/chunks/styles-nqo5BynI.js.map +0 -1
- package/dist/color-DhoxCSMv.js +0 -259
- package/dist/keys-BbDgCU6K.js +0 -10
- package/dist/usePopoverRoot-C1j0D7cc.js +0 -8
|
@@ -1,8 +1,8 @@
|
|
|
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
|
|
2
|
+
import { Ct as M, Ft as te, Nt as N, T as P, _n as ne, bn as re, bt as F, ct as I, dt as L, gn as ie, hn as R, kt as ae, mn as oe, pn as se, pt as ce, ut as le, vn as ue, w as z, yt as de } from "./features-B3qgDBHf.js";
|
|
3
|
+
import { B as fe, K as pe, L as me, T as he, W as ge, k as _e, p as ve, q as ye, y as be } from "./icons-kiMqh99T.js";
|
|
4
4
|
//#region ../media-library/src/api-client.ts
|
|
5
|
-
var
|
|
5
|
+
var xe = class {
|
|
6
6
|
authManager;
|
|
7
7
|
constructor(e) {
|
|
8
8
|
this.authManager = e;
|
|
@@ -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 = `${P(
|
|
40
|
+
let n = t.toString(), r = `${P(z["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 = P(
|
|
50
|
+
let r = P(z["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(P(
|
|
62
|
+
return this.request(P(z["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(P(
|
|
74
|
+
return this.request(P(z["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(P(
|
|
80
|
+
return this.request(P(z["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(P(
|
|
89
|
+
return this.request(P(z["folders.index"], this.baseParams));
|
|
90
90
|
}
|
|
91
91
|
async createMediaFolder(e, t) {
|
|
92
|
-
return this.request(P(
|
|
92
|
+
return this.request(P(z["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(P(
|
|
101
|
+
return this.request(P(z["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(P(
|
|
110
|
+
return this.request(P(z["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(P(
|
|
116
|
+
let t = await this.authManager.authenticatedFetch(P(z["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(P(
|
|
131
|
+
return this.request(P(z["media.frequentlyUsed"], this.baseParams));
|
|
132
132
|
}
|
|
133
133
|
async importFromUrl(e, t) {
|
|
134
|
-
return this.request(P(
|
|
134
|
+
return this.request(P(z["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 = P(
|
|
145
|
+
let r = P(z["media.replace"], {
|
|
146
146
|
...this.baseParams,
|
|
147
147
|
media: e
|
|
148
148
|
}), i = await this.authManager.authenticatedFetch(r, {
|
|
@@ -159,9 +159,9 @@ var Se = class {
|
|
|
159
159
|
};
|
|
160
160
|
//#endregion
|
|
161
161
|
//#region ../media-library/src/composable.ts
|
|
162
|
-
function
|
|
162
|
+
function Se(e) {
|
|
163
163
|
if (!e.projectId) throw Error("projectId is required for useMediaLibrary");
|
|
164
|
-
let t = new
|
|
164
|
+
let t = new xe(e.authManager), n = d([]), r = d([]), i = d(null), a = d("files"), o = d(""), s = d(null), c = d("newest"), l = d(!1), u = d(!1), f = d(!1), p = d(null), m = d(null), h = d(/* @__PURE__ */ new Set()), g = d(null), _ = d([]), v = d({}), y = d(!1), b = d([]), x = d(!1), S = d(null), C = d(!1), w = d(null), T = d(!1), E = d(null), D = d(null), O = 0;
|
|
165
165
|
async function k() {
|
|
166
166
|
let r = ++O;
|
|
167
167
|
l.value = !0;
|
|
@@ -208,16 +208,16 @@ function Ce(e) {
|
|
|
208
208
|
async function ee(e) {
|
|
209
209
|
s.value = e, await k();
|
|
210
210
|
}
|
|
211
|
-
async function
|
|
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 L();
|
|
219
219
|
}
|
|
220
|
-
async function
|
|
220
|
+
async function P(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 ne(r) {
|
|
232
232
|
u.value = !0, m.value = {
|
|
233
233
|
current: 0,
|
|
234
234
|
total: r.length
|
|
@@ -262,7 +262,7 @@ function Ce(e) {
|
|
|
262
262
|
e.onError?.(t);
|
|
263
263
|
}
|
|
264
264
|
}
|
|
265
|
-
async function
|
|
265
|
+
async function F(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 I() {
|
|
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 L() {
|
|
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 ie() {
|
|
288
288
|
if (h.value.size === 0) return !1;
|
|
289
289
|
b.value = [...h.value];
|
|
290
290
|
try {
|
|
@@ -296,17 +296,17 @@ function Ce(e) {
|
|
|
296
296
|
return e.onError?.(t), !1;
|
|
297
297
|
}
|
|
298
298
|
}
|
|
299
|
-
async function
|
|
299
|
+
async function R() {
|
|
300
300
|
if (y.value = !1, b.value.length !== 0) try {
|
|
301
301
|
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 = {};
|
|
302
302
|
} catch (t) {
|
|
303
303
|
e.onError?.(t);
|
|
304
304
|
}
|
|
305
305
|
}
|
|
306
|
-
function
|
|
306
|
+
function ae() {
|
|
307
307
|
y.value = !1, b.value = [], v.value = {};
|
|
308
308
|
}
|
|
309
|
-
async function
|
|
309
|
+
async function oe(r) {
|
|
310
310
|
x.value = !0, S.value = null;
|
|
311
311
|
try {
|
|
312
312
|
let e = await t.importFromUrl(r, i.value);
|
|
@@ -317,57 +317,57 @@ function Ce(e) {
|
|
|
317
317
|
x.value = !1;
|
|
318
318
|
}
|
|
319
319
|
}
|
|
320
|
-
function
|
|
320
|
+
function se(e) {
|
|
321
321
|
let t = new Set(h.value);
|
|
322
322
|
t.has(e) ? t.delete(e) : t.add(e), h.value = t;
|
|
323
323
|
}
|
|
324
|
-
function
|
|
324
|
+
function ce() {
|
|
325
325
|
h.value = /* @__PURE__ */ new Set(), g.value = null;
|
|
326
326
|
}
|
|
327
|
-
function
|
|
327
|
+
function le(e) {
|
|
328
328
|
g.value = e, h.value = /* @__PURE__ */ new Set([e.id]);
|
|
329
329
|
}
|
|
330
|
-
async function
|
|
330
|
+
async function ue() {
|
|
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 z(n, r) {
|
|
338
338
|
try {
|
|
339
339
|
let e = await t.createMediaFolder(n, r);
|
|
340
|
-
return await
|
|
340
|
+
return await ue(), e;
|
|
341
341
|
} catch (t) {
|
|
342
342
|
return e.onError?.(t), null;
|
|
343
343
|
}
|
|
344
344
|
}
|
|
345
|
-
function
|
|
345
|
+
function de(e, t) {
|
|
346
346
|
for (let n of e) {
|
|
347
347
|
if (n.id === t) return n;
|
|
348
348
|
if (n.children) {
|
|
349
|
-
let e =
|
|
349
|
+
let e = de(n.children, t);
|
|
350
350
|
if (e) return e;
|
|
351
351
|
}
|
|
352
352
|
}
|
|
353
353
|
return null;
|
|
354
354
|
}
|
|
355
|
-
async function
|
|
355
|
+
async function fe(n, r) {
|
|
356
356
|
try {
|
|
357
|
-
await t.renameMediaFolder(n, r), await
|
|
357
|
+
await t.renameMediaFolder(n, r), await ue();
|
|
358
358
|
} catch (t) {
|
|
359
359
|
e.onError?.(t);
|
|
360
360
|
}
|
|
361
361
|
}
|
|
362
|
-
async function
|
|
362
|
+
async function pe(n) {
|
|
363
363
|
try {
|
|
364
|
-
let e =
|
|
365
|
-
await t.deleteMediaFolder(n), i.value === n && (i.value = e), await
|
|
364
|
+
let e = de(r.value, n)?.parent_id ?? null;
|
|
365
|
+
await t.deleteMediaFolder(n), i.value === n && (i.value = e), await ue(), await k();
|
|
366
366
|
} catch (t) {
|
|
367
367
|
e.onError?.(t);
|
|
368
368
|
}
|
|
369
369
|
}
|
|
370
|
-
async function
|
|
370
|
+
async function me(n) {
|
|
371
371
|
E.value = n, w.value = null;
|
|
372
372
|
try {
|
|
373
373
|
let e = await t.checkMediaUsage([n.id]);
|
|
@@ -376,10 +376,10 @@ function Ce(e) {
|
|
|
376
376
|
e.onError?.(t);
|
|
377
377
|
}
|
|
378
378
|
}
|
|
379
|
-
function
|
|
379
|
+
function he() {
|
|
380
380
|
T.value = !1, E.value = null, D.value = null, w.value = null;
|
|
381
381
|
}
|
|
382
|
-
async function
|
|
382
|
+
async function ge(r) {
|
|
383
383
|
if (!E.value) return null;
|
|
384
384
|
C.value = !0, w.value = null;
|
|
385
385
|
try {
|
|
@@ -391,7 +391,7 @@ function Ce(e) {
|
|
|
391
391
|
C.value = !1;
|
|
392
392
|
}
|
|
393
393
|
}
|
|
394
|
-
async function
|
|
394
|
+
async function _e(r, i) {
|
|
395
395
|
try {
|
|
396
396
|
let e = await t.replaceMedia(r, i);
|
|
397
397
|
return n.value = n.value.map((t) => t.id === e.id ? e : t), _.value = _.value.map((t) => t.id === e.id ? e : t), g.value?.id === e.id && (g.value = e), e;
|
|
@@ -420,43 +420,43 @@ function Ce(e) {
|
|
|
420
420
|
loadMore: A,
|
|
421
421
|
search: j,
|
|
422
422
|
filterByCategory: ee,
|
|
423
|
-
sortBy:
|
|
424
|
-
navigateToFolder:
|
|
425
|
-
showFrequentlyUsed:
|
|
426
|
-
uploadFile:
|
|
427
|
-
uploadFiles:
|
|
423
|
+
sortBy: M,
|
|
424
|
+
navigateToFolder: te,
|
|
425
|
+
showFrequentlyUsed: N,
|
|
426
|
+
uploadFile: P,
|
|
427
|
+
uploadFiles: ne,
|
|
428
428
|
moveSelected: re,
|
|
429
|
-
updateFile:
|
|
430
|
-
deleteSelected:
|
|
429
|
+
updateFile: F,
|
|
430
|
+
deleteSelected: I,
|
|
431
431
|
isImportingFromUrl: x,
|
|
432
432
|
importFromUrlError: S,
|
|
433
|
-
importFromUrl:
|
|
434
|
-
toggleSelection:
|
|
435
|
-
clearSelection:
|
|
436
|
-
selectItem:
|
|
437
|
-
loadFolders:
|
|
438
|
-
createFolder:
|
|
439
|
-
renameFolder:
|
|
440
|
-
deleteFolder:
|
|
441
|
-
findFolderInTree:
|
|
442
|
-
loadFrequentlyUsed:
|
|
443
|
-
checkUsageBeforeDelete:
|
|
444
|
-
confirmDelete:
|
|
445
|
-
cancelDelete:
|
|
433
|
+
importFromUrl: oe,
|
|
434
|
+
toggleSelection: se,
|
|
435
|
+
clearSelection: ce,
|
|
436
|
+
selectItem: le,
|
|
437
|
+
loadFolders: ue,
|
|
438
|
+
createFolder: z,
|
|
439
|
+
renameFolder: fe,
|
|
440
|
+
deleteFolder: pe,
|
|
441
|
+
findFolderInTree: de,
|
|
442
|
+
loadFrequentlyUsed: L,
|
|
443
|
+
checkUsageBeforeDelete: ie,
|
|
444
|
+
confirmDelete: R,
|
|
445
|
+
cancelDelete: ae,
|
|
446
446
|
isReplacing: C,
|
|
447
447
|
replaceError: w,
|
|
448
448
|
showReplaceWarning: T,
|
|
449
449
|
pendingReplaceItem: E,
|
|
450
450
|
replaceUsageInfo: D,
|
|
451
|
-
checkUsageBeforeReplace:
|
|
452
|
-
cancelReplace:
|
|
453
|
-
replaceFile:
|
|
454
|
-
replaceMediaDirectly:
|
|
451
|
+
checkUsageBeforeReplace: me,
|
|
452
|
+
cancelReplace: he,
|
|
453
|
+
replaceFile: ge,
|
|
454
|
+
replaceMediaDirectly: _e
|
|
455
455
|
};
|
|
456
456
|
}
|
|
457
457
|
//#endregion
|
|
458
458
|
//#region ../media-library/src/composables/useI18n.ts
|
|
459
|
-
function
|
|
459
|
+
function B(e) {
|
|
460
460
|
let t = e ?? l("translations"), n = i(t) ? t.value : t;
|
|
461
461
|
function r(e, t) {
|
|
462
462
|
return e.replace(/\{(\w+)\}/g, (e, n) => n in t ? String(t[n]) : `{${n}}`);
|
|
@@ -468,14 +468,14 @@ function z(e) {
|
|
|
468
468
|
}
|
|
469
469
|
//#endregion
|
|
470
470
|
//#region ../media-library/src/components/media/MediaBreadcrumb.vue?vue&type=script&setup=true&lang.ts
|
|
471
|
-
var
|
|
471
|
+
var Ce = {
|
|
472
472
|
key: 0,
|
|
473
473
|
class: "tpl:flex tpl:items-center tpl:gap-1 tpl:text-xs",
|
|
474
474
|
style: { color: "var(--tpl-text-muted)" }
|
|
475
|
-
},
|
|
475
|
+
}, we = ["onClick"], Te = {
|
|
476
476
|
key: 1,
|
|
477
477
|
style: { color: "var(--tpl-text)" }
|
|
478
|
-
},
|
|
478
|
+
}, Ee = /* @__PURE__ */ A({
|
|
479
479
|
__name: "MediaBreadcrumb",
|
|
480
480
|
props: {
|
|
481
481
|
folders: {},
|
|
@@ -483,7 +483,7 @@ var we = {
|
|
|
483
483
|
},
|
|
484
484
|
emits: ["navigate"],
|
|
485
485
|
setup(e, { emit: t }) {
|
|
486
|
-
let n = e, r = t, { t: i } =
|
|
486
|
+
let n = e, r = t, { t: i } = B(), a = h(() => {
|
|
487
487
|
if (!n.currentFolderId) return [];
|
|
488
488
|
let e = [];
|
|
489
489
|
return s(n.folders, n.currentFolderId, e), e;
|
|
@@ -495,11 +495,11 @@ var we = {
|
|
|
495
495
|
}
|
|
496
496
|
return !1;
|
|
497
497
|
}
|
|
498
|
-
return (e, t) => a.value.length > 0 ? (o(), g("div",
|
|
498
|
+
return (e, t) => a.value.length > 0 ? (o(), g("div", Ce, [w("button", {
|
|
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(N), {
|
|
503
503
|
size: 12,
|
|
504
504
|
"stroke-width": 2
|
|
505
505
|
}), t < a.value.length - 1 ? (o(), g("button", {
|
|
@@ -507,12 +507,12 @@ var we = {
|
|
|
507
507
|
class: "tpl:transition-colors tpl:duration-150 tpl:hover:underline",
|
|
508
508
|
style: { color: "var(--tpl-primary)" },
|
|
509
509
|
onClick: (t) => r("navigate", e.id)
|
|
510
|
-
}, p(e.name), 9,
|
|
510
|
+
}, p(e.name), 9, we)) : (o(), g("span", Te, p(e.name), 1))], 64))), 128))])) : _("", !0);
|
|
511
511
|
}
|
|
512
512
|
});
|
|
513
513
|
//#endregion
|
|
514
514
|
//#region ../media-library/src/composables/useMediaCategories.ts
|
|
515
|
-
function
|
|
515
|
+
function De() {
|
|
516
516
|
let e = l("planConfig"), t = h(() => e.config.value?.media ?? null), n = h(() => t.value?.use_media_library ?? !0), r = h(() => t.value?.categories ?? null), i = h(() => r.value ? Object.values(r.value).flatMap((e) => e.mime_types) : []), a = h(() => i.value.join(",")), o = h(() => t.value?.max_file_size ?? 0);
|
|
517
517
|
function s(e, t) {
|
|
518
518
|
return r.value ? !t || t.length === 0 ? i.value.includes(e) : t.some((t) => r.value[t]?.mime_types.includes(e)) : !1;
|
|
@@ -538,14 +538,14 @@ function Oe() {
|
|
|
538
538
|
}
|
|
539
539
|
//#endregion
|
|
540
540
|
//#region ../media-library/src/composables/useImageCrop.ts
|
|
541
|
-
var
|
|
541
|
+
var Oe = {
|
|
542
542
|
free: void 0,
|
|
543
543
|
square: 1,
|
|
544
544
|
landscape43: 4 / 3,
|
|
545
545
|
landscape169: 16 / 9,
|
|
546
546
|
original: void 0
|
|
547
547
|
};
|
|
548
|
-
function
|
|
548
|
+
function ke(e) {
|
|
549
549
|
return e === "image/png" || e === "image/gif" ? {
|
|
550
550
|
mimeType: "image/png",
|
|
551
551
|
quality: 1
|
|
@@ -557,7 +557,7 @@ function Ae(e) {
|
|
|
557
557
|
quality: .92
|
|
558
558
|
};
|
|
559
559
|
}
|
|
560
|
-
function
|
|
560
|
+
function Ae(e, t, n) {
|
|
561
561
|
let r = e.width, i = e.height;
|
|
562
562
|
if (!t && !n) return e;
|
|
563
563
|
let a = r, o = i;
|
|
@@ -571,7 +571,7 @@ function je(e, t, n) {
|
|
|
571
571
|
let c = s.getContext("2d");
|
|
572
572
|
return c && (c.imageSmoothingEnabled = !0, c.imageSmoothingQuality = "high", c.drawImage(e, 0, 0, a, o)), s;
|
|
573
573
|
}
|
|
574
|
-
function
|
|
574
|
+
function je(e, t, n) {
|
|
575
575
|
return new Promise((r, i) => {
|
|
576
576
|
e.toBlob((e) => {
|
|
577
577
|
if (!e) {
|
|
@@ -583,7 +583,7 @@ function Me(e, t, n) {
|
|
|
583
583
|
}, n.mimeType, n.quality);
|
|
584
584
|
});
|
|
585
585
|
}
|
|
586
|
-
function
|
|
586
|
+
function Me(e, t, n, r) {
|
|
587
587
|
let i = e, a = t;
|
|
588
588
|
if (n && i > n) {
|
|
589
589
|
let e = n / i;
|
|
@@ -600,10 +600,10 @@ function Ne(e, t, n, r) {
|
|
|
600
600
|
}
|
|
601
601
|
//#endregion
|
|
602
602
|
//#region ../media-library/src/keys.ts
|
|
603
|
-
var
|
|
603
|
+
var Ne = Symbol("templaticalMediaPopoverTarget");
|
|
604
604
|
//#endregion
|
|
605
605
|
//#region ../../node_modules/.pnpm/vue-advanced-cropper@2.8.9_vue@3.5.40_typescript@6.0.3_/node_modules/vue-advanced-cropper/dist/index.esm-bundler.js
|
|
606
|
-
function
|
|
606
|
+
function Pe(e, t) {
|
|
607
607
|
var n = Object.keys(e);
|
|
608
608
|
if (Object.getOwnPropertySymbols) {
|
|
609
609
|
var r = Object.getOwnPropertySymbols(e);
|
|
@@ -613,18 +613,18 @@ function Fe(e, t) {
|
|
|
613
613
|
}
|
|
614
614
|
return n;
|
|
615
615
|
}
|
|
616
|
-
function
|
|
616
|
+
function V(e) {
|
|
617
617
|
for (var t = 1; t < arguments.length; t++) {
|
|
618
618
|
var n = arguments[t] == null ? {} : arguments[t];
|
|
619
|
-
t % 2 ?
|
|
620
|
-
|
|
621
|
-
})) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) :
|
|
619
|
+
t % 2 ? Pe(Object(n), !0).forEach((function(t) {
|
|
620
|
+
H(e, t, n[t]);
|
|
621
|
+
})) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : Pe(Object(n)).forEach((function(t) {
|
|
622
622
|
Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t));
|
|
623
623
|
}));
|
|
624
624
|
}
|
|
625
625
|
return e;
|
|
626
626
|
}
|
|
627
|
-
function
|
|
627
|
+
function H(e, t, n) {
|
|
628
628
|
return t in e ? Object.defineProperty(e, t, {
|
|
629
629
|
value: n,
|
|
630
630
|
enumerable: !0,
|
|
@@ -632,7 +632,7 @@ function V(e, t, n) {
|
|
|
632
632
|
writable: !0
|
|
633
633
|
}) : e[t] = n, e;
|
|
634
634
|
}
|
|
635
|
-
function
|
|
635
|
+
function Fe(e, t) {
|
|
636
636
|
if (e == null) return {};
|
|
637
637
|
var n, r, i = function(e, t) {
|
|
638
638
|
if (e == null) return {};
|
|
@@ -646,28 +646,28 @@ function Ie(e, t) {
|
|
|
646
646
|
}
|
|
647
647
|
return i;
|
|
648
648
|
}
|
|
649
|
-
function
|
|
649
|
+
function Ie(e) {
|
|
650
650
|
return function(e) {
|
|
651
|
-
if (Array.isArray(e)) return
|
|
651
|
+
if (Array.isArray(e)) return Le(e);
|
|
652
652
|
}(e) || function(e) {
|
|
653
653
|
if (typeof Symbol < "u" && e[Symbol.iterator] != null || e["@@iterator"] != null) return Array.from(e);
|
|
654
654
|
}(e) || function(e, t) {
|
|
655
655
|
if (e) {
|
|
656
|
-
if (typeof e == "string") return
|
|
656
|
+
if (typeof e == "string") return Le(e, t);
|
|
657
657
|
var n = Object.prototype.toString.call(e).slice(8, -1);
|
|
658
658
|
if (n === "Object" && e.constructor && (n = e.constructor.name), n === "Map" || n === "Set") return Array.from(e);
|
|
659
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return
|
|
659
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return Le(e, t);
|
|
660
660
|
}
|
|
661
661
|
}(e) || function() {
|
|
662
662
|
throw TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
663
663
|
}();
|
|
664
664
|
}
|
|
665
|
-
function
|
|
665
|
+
function Le(e, t) {
|
|
666
666
|
(t == null || t > e.length) && (t = e.length);
|
|
667
667
|
for (var n = 0, r = Array(t); n < t; n++) r[n] = e[n];
|
|
668
668
|
return r;
|
|
669
669
|
}
|
|
670
|
-
var ze, Be,
|
|
670
|
+
var Re, ze, Be, U = (Re = function(e) {
|
|
671
671
|
(function() {
|
|
672
672
|
var t = {}.hasOwnProperty;
|
|
673
673
|
function n() {
|
|
@@ -689,15 +689,15 @@ var ze, Be, Ve, H = (ze = function(e) {
|
|
|
689
689
|
}
|
|
690
690
|
e.exports ? (n.default = n, e.exports = n) : window.classNames = n;
|
|
691
691
|
})();
|
|
692
|
-
},
|
|
693
|
-
path:
|
|
692
|
+
}, Re(Be = {
|
|
693
|
+
path: ze,
|
|
694
694
|
exports: {},
|
|
695
695
|
require: function(e, t) {
|
|
696
696
|
return function() {
|
|
697
697
|
throw Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs");
|
|
698
|
-
}(t == null &&
|
|
698
|
+
}(t == null && Be.path);
|
|
699
699
|
}
|
|
700
|
-
},
|
|
700
|
+
}, Be.exports), Be.exports), W = function(e) {
|
|
701
701
|
return function(t, n) {
|
|
702
702
|
if (!t) return e;
|
|
703
703
|
var r;
|
|
@@ -709,7 +709,7 @@ var ze, Be, Ve, H = (ze = function(e) {
|
|
|
709
709
|
}), "") : "");
|
|
710
710
|
};
|
|
711
711
|
};
|
|
712
|
-
function
|
|
712
|
+
function Ve(e, t, n) {
|
|
713
713
|
var r, i, a, o, s;
|
|
714
714
|
function c() {
|
|
715
715
|
var l = Date.now() - o;
|
|
@@ -727,65 +727,65 @@ function He(e, t, n) {
|
|
|
727
727
|
r &&= (s = e.apply(a, i), a = i = null, clearTimeout(r), null);
|
|
728
728
|
}, l;
|
|
729
729
|
}
|
|
730
|
-
|
|
731
|
-
var
|
|
732
|
-
return
|
|
730
|
+
Ve.debounce = Ve;
|
|
731
|
+
var He = Ve, G = function() {
|
|
732
|
+
return G = Object.assign || function(e) {
|
|
733
733
|
for (var t, n = 1, r = arguments.length; n < r; n++) for (var i in t = arguments[n]) Object.prototype.hasOwnProperty.call(t, i) && (e[i] = t[i]);
|
|
734
734
|
return e;
|
|
735
|
-
},
|
|
735
|
+
}, G.apply(this, arguments);
|
|
736
736
|
};
|
|
737
|
-
function
|
|
737
|
+
function Ue(e, t) {
|
|
738
738
|
var n, r;
|
|
739
739
|
return e && t ? (n = "" + e + t[0].toUpperCase() + t.slice(1), r = e + "-" + t) : (n = e || t, r = e || t), {
|
|
740
740
|
name: n,
|
|
741
741
|
classname: r
|
|
742
742
|
};
|
|
743
743
|
}
|
|
744
|
-
function
|
|
744
|
+
function We(e) {
|
|
745
745
|
return /^blob:/.test(e);
|
|
746
746
|
}
|
|
747
|
-
function
|
|
748
|
-
return
|
|
747
|
+
function Ge(e) {
|
|
748
|
+
return We(e) || function(e) {
|
|
749
749
|
return /^data:/.test(e);
|
|
750
750
|
}(e);
|
|
751
751
|
}
|
|
752
|
-
function
|
|
752
|
+
function Ke(e) {
|
|
753
753
|
return !!(e && e.constructor && e.call && e.apply);
|
|
754
754
|
}
|
|
755
|
-
function
|
|
755
|
+
function K(e) {
|
|
756
756
|
return e === void 0;
|
|
757
757
|
}
|
|
758
|
-
function
|
|
758
|
+
function qe(e) {
|
|
759
759
|
return typeof e == "object" && !!e;
|
|
760
760
|
}
|
|
761
|
-
function
|
|
761
|
+
function Je(e, t, n) {
|
|
762
762
|
var r = {};
|
|
763
|
-
return
|
|
764
|
-
|
|
763
|
+
return qe(e) ? (Object.keys(t).forEach((function(i) {
|
|
764
|
+
K(e[i]) ? r[i] = t[i] : qe(t[i]) ? qe(e[i]) ? r[i] = Je(e[i], t[i], n[i]) : r[i] = e[i] ? t[i] : n[i] : !0 === t[i] || !1 === t[i] ? r[i] = !!e[i] : r[i] = e[i];
|
|
765
765
|
})), r) : e ? t : n;
|
|
766
766
|
}
|
|
767
|
-
function
|
|
767
|
+
function Ye(e) {
|
|
768
768
|
var t = Number(e);
|
|
769
769
|
return Number.isNaN(t) ? e : t;
|
|
770
770
|
}
|
|
771
|
-
function
|
|
771
|
+
function Xe(e) {
|
|
772
772
|
return typeof (e == "number" || function(e) {
|
|
773
773
|
return typeof e == "object" && !!e;
|
|
774
|
-
}(e) && toString.call(e) == "[object Number]") && !
|
|
774
|
+
}(e) && toString.call(e) == "[object Number]") && !Ze(e);
|
|
775
775
|
}
|
|
776
|
-
function
|
|
776
|
+
function Ze(e) {
|
|
777
777
|
return e != e;
|
|
778
778
|
}
|
|
779
|
-
function
|
|
779
|
+
function Qe(e, t) {
|
|
780
780
|
return Math.sqrt((e.x - t.x) ** 2 + (e.y - t.y) ** 2);
|
|
781
781
|
}
|
|
782
|
-
var
|
|
782
|
+
var $e = function(e, t) {
|
|
783
783
|
e === void 0 && (e = {}), t === void 0 && (t = {}), this.type = "manipulateImage", this.move = e, this.scale = t;
|
|
784
|
-
},
|
|
784
|
+
}, et = function(e, t) {
|
|
785
785
|
t === void 0 && (t = {}), this.type = "resize", this.directions = e, this.params = t;
|
|
786
|
-
},
|
|
786
|
+
}, tt = function(e) {
|
|
787
787
|
this.type = "move", this.directions = e;
|
|
788
|
-
},
|
|
788
|
+
}, nt = function() {
|
|
789
789
|
function e(e, t, n, r, i) {
|
|
790
790
|
this.type = "drag", this.nativeEvent = e, this.position = n, this.previousPosition = r, this.element = t, this.anchor = i;
|
|
791
791
|
}
|
|
@@ -803,7 +803,7 @@ var et = function(e, t) {
|
|
|
803
803
|
top: 0
|
|
804
804
|
};
|
|
805
805
|
}, e;
|
|
806
|
-
}(),
|
|
806
|
+
}(), rt = {
|
|
807
807
|
name: "DraggableElement",
|
|
808
808
|
props: { classname: { type: String } },
|
|
809
809
|
beforeMount: function() {
|
|
@@ -824,7 +824,7 @@ var et = function(e, t) {
|
|
|
824
824
|
this.hovered && !this.touches.length && (this.hovered = !1, this.$emit("leave"));
|
|
825
825
|
},
|
|
826
826
|
onTouchStart: function(e) {
|
|
827
|
-
e.cancelable && !this.disabled && e.touches.length === 1 && (this.touches =
|
|
827
|
+
e.cancelable && !this.disabled && e.touches.length === 1 && (this.touches = Ie(e.touches), this.hovered ||= (this.$emit("enter"), !0), e.touches.length && this.initAnchor(this.touches.reduce((function(t, n) {
|
|
828
828
|
return {
|
|
829
829
|
clientX: t.clientX + n.clientX / e.touches.length,
|
|
830
830
|
clientY: t.clientY + n.clientY / e.touches.length
|
|
@@ -870,11 +870,11 @@ var et = function(e, t) {
|
|
|
870
870
|
};
|
|
871
871
|
},
|
|
872
872
|
processMove: function(e, t) {
|
|
873
|
-
var n =
|
|
873
|
+
var n = Ie(t);
|
|
874
874
|
if (this.touches.length) {
|
|
875
875
|
if (this.touches.length === 1 && n.length === 1) {
|
|
876
876
|
var r = this.$refs.draggable;
|
|
877
|
-
this.$emit("drag", new
|
|
877
|
+
this.$emit("drag", new nt(e, r, {
|
|
878
878
|
left: n[0].clientX,
|
|
879
879
|
top: n[0].clientY
|
|
880
880
|
}, {
|
|
@@ -896,7 +896,7 @@ var et = function(e, t) {
|
|
|
896
896
|
"enter"
|
|
897
897
|
]
|
|
898
898
|
};
|
|
899
|
-
|
|
899
|
+
rt.render = function(e, n, r, i, a, s) {
|
|
900
900
|
return o(), b("div", {
|
|
901
901
|
ref: "draggable",
|
|
902
902
|
class: r.classname,
|
|
@@ -914,9 +914,9 @@ it.render = function(e, n, r, i, a, s) {
|
|
|
914
914
|
}
|
|
915
915
|
}, [t(e.$slots, "default")], 34);
|
|
916
916
|
};
|
|
917
|
-
var
|
|
917
|
+
var it = W("vue-handler-wrapper"), at = {
|
|
918
918
|
name: "HandlerWrapper",
|
|
919
|
-
components: { DraggableElement:
|
|
919
|
+
components: { DraggableElement: rt },
|
|
920
920
|
props: {
|
|
921
921
|
horizontalPosition: { type: String },
|
|
922
922
|
verticalPosition: { type: String },
|
|
@@ -928,12 +928,12 @@ var at = U("vue-handler-wrapper"), ot = {
|
|
|
928
928
|
computed: { classes: function() {
|
|
929
929
|
var e;
|
|
930
930
|
if (this.horizontalPosition || this.verticalPosition) {
|
|
931
|
-
var t, n =
|
|
932
|
-
e =
|
|
933
|
-
} else e =
|
|
931
|
+
var t, n = Ue(this.horizontalPosition, this.verticalPosition);
|
|
932
|
+
e = it((H(t = {}, n.classname, !0), H(t, "disabled", this.disabled), t));
|
|
933
|
+
} else e = it({ disabled: this.disabled });
|
|
934
934
|
return {
|
|
935
935
|
root: e,
|
|
936
|
-
draggable:
|
|
936
|
+
draggable: it("draggable")
|
|
937
937
|
};
|
|
938
938
|
} },
|
|
939
939
|
emits: [
|
|
@@ -943,7 +943,7 @@ var at = U("vue-handler-wrapper"), ot = {
|
|
|
943
943
|
"drag-end"
|
|
944
944
|
]
|
|
945
945
|
};
|
|
946
|
-
|
|
946
|
+
at.render = function(e, n, i, a, s, c) {
|
|
947
947
|
var l = r("DraggableElement");
|
|
948
948
|
return o(), b("div", { class: c.classes.root }, [j(l, {
|
|
949
949
|
class: c.classes.draggable,
|
|
@@ -966,9 +966,9 @@ ot.render = function(e, n, i, a, s, c) {
|
|
|
966
966
|
_: 3
|
|
967
967
|
}, 8, ["class"])], 2);
|
|
968
968
|
};
|
|
969
|
-
var
|
|
969
|
+
var ot = W("vue-line-wrapper"), st = {
|
|
970
970
|
name: "LineWrapper",
|
|
971
|
-
components: { DraggableElement:
|
|
971
|
+
components: { DraggableElement: rt },
|
|
972
972
|
props: {
|
|
973
973
|
position: {
|
|
974
974
|
type: String,
|
|
@@ -981,7 +981,7 @@ var st = U("vue-line-wrapper"), ct = {
|
|
|
981
981
|
},
|
|
982
982
|
computed: { classname: function() {
|
|
983
983
|
var e;
|
|
984
|
-
return
|
|
984
|
+
return ot((H(e = {}, this.position, !0), H(e, "disabled", this.disabled), e));
|
|
985
985
|
} },
|
|
986
986
|
emits: [
|
|
987
987
|
"leave",
|
|
@@ -990,7 +990,7 @@ var st = U("vue-line-wrapper"), ct = {
|
|
|
990
990
|
"drag-end"
|
|
991
991
|
]
|
|
992
992
|
};
|
|
993
|
-
|
|
993
|
+
st.render = function(e, n, i, a, s, c) {
|
|
994
994
|
var l = r("DraggableElement");
|
|
995
995
|
return o(), b(l, {
|
|
996
996
|
class: c.classname,
|
|
@@ -1013,23 +1013,23 @@ ct.render = function(e, n, i, a, s, c) {
|
|
|
1013
1013
|
_: 3
|
|
1014
1014
|
}, 8, ["class"]);
|
|
1015
1015
|
};
|
|
1016
|
-
var
|
|
1016
|
+
var q = [
|
|
1017
1017
|
"left",
|
|
1018
1018
|
"right",
|
|
1019
1019
|
"top",
|
|
1020
1020
|
"bottom"
|
|
1021
|
-
],
|
|
1021
|
+
], ct = ["left", "right"], lt = ["top", "bottom"], ut = ["left", "top"], dt = [
|
|
1022
1022
|
"fill-area",
|
|
1023
1023
|
"fit-area",
|
|
1024
1024
|
"stencil",
|
|
1025
1025
|
"none"
|
|
1026
|
-
],
|
|
1026
|
+
], ft = {
|
|
1027
1027
|
left: 0,
|
|
1028
1028
|
top: 0,
|
|
1029
1029
|
width: 0,
|
|
1030
1030
|
height: 0
|
|
1031
1031
|
};
|
|
1032
|
-
function
|
|
1032
|
+
function pt(e, t, n) {
|
|
1033
1033
|
return !(n ||= [
|
|
1034
1034
|
"width",
|
|
1035
1035
|
"height",
|
|
@@ -1039,7 +1039,7 @@ function mt(e, t, n) {
|
|
|
1039
1039
|
return e[n] !== t[n];
|
|
1040
1040
|
}));
|
|
1041
1041
|
}
|
|
1042
|
-
function
|
|
1042
|
+
function J(e) {
|
|
1043
1043
|
return {
|
|
1044
1044
|
left: e.left,
|
|
1045
1045
|
top: e.top,
|
|
@@ -1047,31 +1047,31 @@ function q(e) {
|
|
|
1047
1047
|
bottom: e.top + e.height
|
|
1048
1048
|
};
|
|
1049
1049
|
}
|
|
1050
|
-
function
|
|
1050
|
+
function mt(e, t) {
|
|
1051
1051
|
return {
|
|
1052
1052
|
left: e.left - t.left,
|
|
1053
1053
|
top: e.top - t.top
|
|
1054
1054
|
};
|
|
1055
1055
|
}
|
|
1056
|
-
function
|
|
1056
|
+
function Y(e) {
|
|
1057
1057
|
return {
|
|
1058
1058
|
left: e.left + e.width / 2,
|
|
1059
1059
|
top: e.top + e.height / 2
|
|
1060
1060
|
};
|
|
1061
1061
|
}
|
|
1062
|
-
function
|
|
1062
|
+
function ht(e, t) {
|
|
1063
1063
|
var n = {
|
|
1064
1064
|
left: 0,
|
|
1065
1065
|
top: 0,
|
|
1066
1066
|
right: 0,
|
|
1067
1067
|
bottom: 0
|
|
1068
1068
|
};
|
|
1069
|
-
return
|
|
1070
|
-
var i = t[r], a =
|
|
1069
|
+
return q.forEach((function(r) {
|
|
1070
|
+
var i = t[r], a = J(e)[r];
|
|
1071
1071
|
n[r] = i !== void 0 && a !== void 0 ? r === "left" || r === "top" ? Math.max(0, i - a) : Math.max(0, a - i) : 0;
|
|
1072
1072
|
})), n;
|
|
1073
1073
|
}
|
|
1074
|
-
function
|
|
1074
|
+
function gt(e, t) {
|
|
1075
1075
|
return {
|
|
1076
1076
|
left: e.left - t.left,
|
|
1077
1077
|
top: e.top - t.top,
|
|
@@ -1086,7 +1086,7 @@ function _t(e) {
|
|
|
1086
1086
|
};
|
|
1087
1087
|
}
|
|
1088
1088
|
function X(e, t) {
|
|
1089
|
-
return
|
|
1089
|
+
return G(G({}, e), {
|
|
1090
1090
|
left: e.left + t.left,
|
|
1091
1091
|
top: e.top + t.top
|
|
1092
1092
|
});
|
|
@@ -1094,7 +1094,7 @@ function X(e, t) {
|
|
|
1094
1094
|
function Z(e, t, n, r) {
|
|
1095
1095
|
if (t !== 1) {
|
|
1096
1096
|
if (n) {
|
|
1097
|
-
var i =
|
|
1097
|
+
var i = Y(e);
|
|
1098
1098
|
return {
|
|
1099
1099
|
width: e.width * t,
|
|
1100
1100
|
height: e.height * t,
|
|
@@ -1121,7 +1121,7 @@ function yt(e, t) {
|
|
|
1121
1121
|
var n = {
|
|
1122
1122
|
left: 0,
|
|
1123
1123
|
top: 0
|
|
1124
|
-
}, r =
|
|
1124
|
+
}, r = ht(e, t);
|
|
1125
1125
|
return r.left && r.left > 0 ? n.left = r.left : r.right && r.right > 0 && (n.left = -r.right), r.top && r.top > 0 ? n.top = r.top : r.bottom && r.bottom > 0 && (n.top = -r.bottom), n;
|
|
1126
1126
|
}
|
|
1127
1127
|
function bt(e, t) {
|
|
@@ -1159,7 +1159,7 @@ function Ct(e, t) {
|
|
|
1159
1159
|
};
|
|
1160
1160
|
}
|
|
1161
1161
|
function wt(e, t) {
|
|
1162
|
-
var n =
|
|
1162
|
+
var n = ht($(e, t), t);
|
|
1163
1163
|
return n.left + n.right + n.top + n.bottom ? n.left + n.right > n.top + n.bottom ? Math.min((e.width + n.left + n.right) / e.width, vt(e, t)) : Math.min((e.height + n.top + n.bottom) / e.height, vt(e, t)) : 1;
|
|
1164
1164
|
}
|
|
1165
1165
|
function $(e, t, n) {
|
|
@@ -1174,7 +1174,7 @@ function Tt(e) {
|
|
|
1174
1174
|
};
|
|
1175
1175
|
}
|
|
1176
1176
|
function Et(e, t) {
|
|
1177
|
-
return
|
|
1177
|
+
return G(G({}, e), {
|
|
1178
1178
|
minWidth: Math.min(t.width, e.minWidth),
|
|
1179
1179
|
minHeight: Math.min(t.height, e.minHeight),
|
|
1180
1180
|
maxWidth: Math.min(t.width, e.maxWidth),
|
|
@@ -1184,7 +1184,7 @@ function Et(e, t) {
|
|
|
1184
1184
|
function Dt(e, t, n) {
|
|
1185
1185
|
n === void 0 && (n = !0);
|
|
1186
1186
|
var r = {};
|
|
1187
|
-
return
|
|
1187
|
+
return q.forEach((function(i) {
|
|
1188
1188
|
var a = e[i], o = t[i];
|
|
1189
1189
|
a !== void 0 && o !== void 0 ? r[i] = i === "left" || i === "top" ? n ? Math.max(a, o) : Math.min(a, o) : n ? Math.min(a, o) : Math.max(a, o) : o === void 0 ? a !== void 0 && (r[i] = a) : r[i] = o;
|
|
1190
1190
|
})), r;
|
|
@@ -1254,20 +1254,20 @@ function Nt(e) {
|
|
|
1254
1254
|
return Mt({
|
|
1255
1255
|
coordinates: e,
|
|
1256
1256
|
positionRestrictions: a,
|
|
1257
|
-
event: new
|
|
1257
|
+
event: new tt({
|
|
1258
1258
|
left: t.left - e.left,
|
|
1259
1259
|
top: t.top - e.top
|
|
1260
1260
|
})
|
|
1261
1261
|
});
|
|
1262
|
-
}, l =
|
|
1262
|
+
}, l = G({}, t);
|
|
1263
1263
|
return (Array.isArray(n) ? n : [n]).forEach((function(e) {
|
|
1264
1264
|
var t = {};
|
|
1265
|
-
|
|
1265
|
+
K((t = typeof e == "function" ? e({
|
|
1266
1266
|
coordinates: l,
|
|
1267
1267
|
imageSize: r,
|
|
1268
1268
|
visibleArea: s
|
|
1269
|
-
}) : e).width) &&
|
|
1270
|
-
return c(
|
|
1269
|
+
}) : e).width) && K(t.height) || (l = function(e, t) {
|
|
1270
|
+
return c(G(G(G({}, e), jt({
|
|
1271
1271
|
width: t.width,
|
|
1272
1272
|
height: t.height,
|
|
1273
1273
|
sizeRestrictions: i,
|
|
@@ -1279,12 +1279,12 @@ function Nt(e) {
|
|
|
1279
1279
|
left: e.left,
|
|
1280
1280
|
top: e.top
|
|
1281
1281
|
});
|
|
1282
|
-
}(l,
|
|
1282
|
+
}(l, G(G({}, l), t))), K(t.left) && K(t.top) || (l = c(l, G(G({}, l), t)));
|
|
1283
1283
|
})), l;
|
|
1284
1284
|
}
|
|
1285
1285
|
function Pt(e) {
|
|
1286
|
-
var t = e.getAreaRestrictions, n = e.boundaries, r = e.coordinates, i = e.visibleArea, a = e.stencilSize, o = e.sizeRestrictions, s = e.positionRestrictions, c, l, u, d =
|
|
1287
|
-
c = Q(p), l = Q(d), u === void 0 && (u = .001), (c === 0 || l === 0 ? Math.abs(l - c) < u : Math.abs(l / c) < 1 + u && Math.abs(l / c) > 1 - u) || (d =
|
|
1286
|
+
var t = e.getAreaRestrictions, n = e.boundaries, r = e.coordinates, i = e.visibleArea, a = e.stencilSize, o = e.sizeRestrictions, s = e.positionRestrictions, c, l, u, d = G({}, r), f = G({}, i), p = G({}, a);
|
|
1287
|
+
c = Q(p), l = Q(d), u === void 0 && (u = .001), (c === 0 || l === 0 ? Math.abs(l - c) < u : Math.abs(l / c) < 1 + u && Math.abs(l / c) > 1 - u) || (d = G(G({}, d), jt({
|
|
1288
1288
|
sizeRestrictions: o,
|
|
1289
1289
|
width: d.width,
|
|
1290
1290
|
height: d.height,
|
|
@@ -1297,16 +1297,16 @@ function Pt(e) {
|
|
|
1297
1297
|
visibleArea: f,
|
|
1298
1298
|
type: "resize"
|
|
1299
1299
|
}));
|
|
1300
|
-
return m !== 1 && (f = Z(f, m), d = Z(d, m)), f = $(f = X(f,
|
|
1300
|
+
return m !== 1 && (f = Z(f, m), d = Z(d, m)), f = $(f = X(f, mt(Y(d), Y(f))), t({
|
|
1301
1301
|
visibleArea: f,
|
|
1302
1302
|
type: "move"
|
|
1303
1303
|
})), {
|
|
1304
|
-
coordinates: d = $(d, Ot(
|
|
1304
|
+
coordinates: d = $(d, Ot(J(f), s)),
|
|
1305
1305
|
visibleArea: f
|
|
1306
1306
|
};
|
|
1307
1307
|
}
|
|
1308
1308
|
function Ft(e) {
|
|
1309
|
-
var t = e.event, n = e.getAreaRestrictions, r = e.boundaries, i = e.coordinates, a = e.visibleArea, o = e.positionRestrictions, s =
|
|
1309
|
+
var t = e.event, n = e.getAreaRestrictions, r = e.boundaries, i = e.coordinates, a = e.visibleArea, o = e.positionRestrictions, s = G({}, i), c = G({}, a);
|
|
1310
1310
|
if (i && a && t.type !== "manipulateImage") {
|
|
1311
1311
|
var l = {
|
|
1312
1312
|
width: 0,
|
|
@@ -1317,10 +1317,10 @@ function Ft(e) {
|
|
|
1317
1317
|
visibleArea: c,
|
|
1318
1318
|
type: "resize"
|
|
1319
1319
|
}));
|
|
1320
|
-
c = Z(c, u), u !== 1 && (l.height /= u, l.width /= u), c = $(c = X(c,
|
|
1320
|
+
c = Z(c, u), u !== 1 && (l.height /= u, l.width /= u), c = $(c = X(c, mt(Y(s), Y(c))), n({
|
|
1321
1321
|
visibleArea: c,
|
|
1322
1322
|
type: "move"
|
|
1323
|
-
})), s = $(s, Ot(
|
|
1323
|
+
})), s = $(s, Ot(J(c), o));
|
|
1324
1324
|
}
|
|
1325
1325
|
return {
|
|
1326
1326
|
coordinates: s,
|
|
@@ -1328,7 +1328,7 @@ function Ft(e) {
|
|
|
1328
1328
|
};
|
|
1329
1329
|
}
|
|
1330
1330
|
function It(e) {
|
|
1331
|
-
var t = e.event, n = e.coordinates, r = e.visibleArea, i = e.getAreaRestrictions, a =
|
|
1331
|
+
var t = e.event, n = e.coordinates, r = e.visibleArea, i = e.getAreaRestrictions, a = G({}, r), o = G({}, n);
|
|
1332
1332
|
if (t.type === "setCoordinates") {
|
|
1333
1333
|
var s = Math.max(0, o.width - a.width), c = Math.max(0, o.height - a.height);
|
|
1334
1334
|
s > c ? a = Z(a, Math.min(o.width / a.width, vt(a, i({
|
|
@@ -1337,7 +1337,7 @@ function It(e) {
|
|
|
1337
1337
|
})))) : c > s && (a = Z(a, Math.min(o.height / a.height, vt(a, i({
|
|
1338
1338
|
visibleArea: a,
|
|
1339
1339
|
type: "resize"
|
|
1340
|
-
}))))), a = $(a = X(a, _t(yt(o,
|
|
1340
|
+
}))))), a = $(a = X(a, _t(yt(o, J(a)))), i({
|
|
1341
1341
|
visibleArea: a,
|
|
1342
1342
|
type: "move"
|
|
1343
1343
|
}));
|
|
@@ -1362,7 +1362,7 @@ function Rt(e) {
|
|
|
1362
1362
|
height: .8 * a.height,
|
|
1363
1363
|
width: .8 * a.height * o
|
|
1364
1364
|
};
|
|
1365
|
-
return jt(
|
|
1365
|
+
return jt(G(G({}, s), {
|
|
1366
1366
|
aspectRatio: r,
|
|
1367
1367
|
sizeRestrictions: i
|
|
1368
1368
|
}));
|
|
@@ -1390,7 +1390,7 @@ function Bt(e) {
|
|
|
1390
1390
|
top: n.top + n.height / 2 - o.height / 2,
|
|
1391
1391
|
width: o.width,
|
|
1392
1392
|
height: o.height
|
|
1393
|
-
}, c =
|
|
1393
|
+
}, c = ht(n, J(G({
|
|
1394
1394
|
left: 0,
|
|
1395
1395
|
top: 0
|
|
1396
1396
|
}, r))), l = {};
|
|
@@ -1408,10 +1408,10 @@ function Bt(e) {
|
|
|
1408
1408
|
};
|
|
1409
1409
|
}
|
|
1410
1410
|
function Vt(e, t) {
|
|
1411
|
-
return Dt(e,
|
|
1411
|
+
return Dt(e, J(t));
|
|
1412
1412
|
}
|
|
1413
1413
|
function Ht(e) {
|
|
1414
|
-
var t = e.event, n = e.coordinates, r = e.visibleArea, i = e.sizeRestrictions, a = e.getAreaRestrictions, o = e.positionRestrictions, s = e.adjustStencil, c = t.scale, l = t.move, u =
|
|
1414
|
+
var t = e.event, n = e.coordinates, r = e.visibleArea, i = e.sizeRestrictions, a = e.getAreaRestrictions, o = e.positionRestrictions, s = e.adjustStencil, c = t.scale, l = t.move, u = G({}, r), d = G({}, n), f = 1, p = 1, m = c.factor && Math.abs(c.factor - 1) > .001;
|
|
1415
1415
|
u = X(u, {
|
|
1416
1416
|
left: l.left || 0,
|
|
1417
1417
|
top: l.top || 0
|
|
@@ -1436,49 +1436,49 @@ function Ht(e) {
|
|
|
1436
1436
|
})), a({
|
|
1437
1437
|
visibleArea: u,
|
|
1438
1438
|
type: "move"
|
|
1439
|
-
})), d.width *= p, d.height *= p, d.left = u.left + g * p, d.top = u.top + v * p, d = $(d, Ot(
|
|
1439
|
+
})), d.width *= p, d.height *= p, d.left = u.left + g * p, d.top = u.top + v * p, d = $(d, Ot(J(u), o)), c.factor && m && s && (c.factor > 1 ? f = Math.min(h.area.maximum, c.factor) / p : c.factor < 1 && (f = Math.max(d.height / u.height, d.width / u.width, c.factor / p)), f !== 1 && (u = X(u = $(u = Z(u, f, c.factor > 1 ? c.center : Y(d)), a({
|
|
1440
1440
|
visibleArea: u,
|
|
1441
1441
|
type: "move"
|
|
1442
|
-
})), _t(yt(d,
|
|
1442
|
+
})), _t(yt(d, J(u)))))), {
|
|
1443
1443
|
coordinates: d,
|
|
1444
1444
|
visibleArea: u
|
|
1445
1445
|
};
|
|
1446
1446
|
}
|
|
1447
1447
|
function Ut(e) {
|
|
1448
|
-
var t = e.aspectRatio, n = e.getAreaRestrictions, r = e.coordinates, i = e.visibleArea, a = e.sizeRestrictions, o = e.positionRestrictions, s = e.imageSize, c = e.previousImageSize, l = e.angle, u =
|
|
1448
|
+
var t = e.aspectRatio, n = e.getAreaRestrictions, r = e.coordinates, i = e.visibleArea, a = e.sizeRestrictions, o = e.positionRestrictions, s = e.imageSize, c = e.previousImageSize, l = e.angle, u = G({}, r), d = G({}, i), f = Ct(Y(G({
|
|
1449
1449
|
left: 0,
|
|
1450
1450
|
top: 0
|
|
1451
1451
|
}, c)), l);
|
|
1452
|
-
return (u =
|
|
1452
|
+
return (u = G(G({}, jt({
|
|
1453
1453
|
sizeRestrictions: a,
|
|
1454
1454
|
aspectRatio: t,
|
|
1455
1455
|
width: u.width,
|
|
1456
1456
|
height: u.height
|
|
1457
|
-
})), Ct(
|
|
1457
|
+
})), Ct(Y(u), l))).left -= f.left - s.width / 2 + u.width / 2, u.top -= f.top - s.height / 2 + u.height / 2, d = Z(d, wt(d, n({
|
|
1458
1458
|
visibleArea: d,
|
|
1459
1459
|
type: "resize"
|
|
1460
1460
|
}))), {
|
|
1461
1461
|
coordinates: u = $(u, o),
|
|
1462
|
-
visibleArea: d = $(d = X(d,
|
|
1462
|
+
visibleArea: d = $(d = X(d, mt(Y(u), Y(r))), n({
|
|
1463
1463
|
visibleArea: d,
|
|
1464
1464
|
type: "move"
|
|
1465
1465
|
}))
|
|
1466
1466
|
};
|
|
1467
1467
|
}
|
|
1468
1468
|
function Wt(e) {
|
|
1469
|
-
var t = e.flip, n = e.previousFlip, r = e.rotate, i = e.getAreaRestrictions, a = e.coordinates, o = e.visibleArea, s = e.imageSize, c =
|
|
1469
|
+
var t = e.flip, n = e.previousFlip, r = e.rotate, i = e.getAreaRestrictions, a = e.coordinates, o = e.visibleArea, s = e.imageSize, c = G({}, a), l = G({}, o), u = n.horizontal !== t.horizontal, d = n.vertical !== t.vertical;
|
|
1470
1470
|
if (u || d) {
|
|
1471
1471
|
var f = Ct({
|
|
1472
1472
|
left: s.width / 2,
|
|
1473
1473
|
top: s.height / 2
|
|
1474
|
-
}, -r), p = Ct(
|
|
1474
|
+
}, -r), p = Ct(Y(c), -r), m = Ct({
|
|
1475
1475
|
left: u ? f.left - (p.left - f.left) : p.left,
|
|
1476
1476
|
top: d ? f.top - (p.top - f.top) : p.top
|
|
1477
1477
|
}, r);
|
|
1478
|
-
c = X(c,
|
|
1478
|
+
c = X(c, mt(m, Y(c))), p = Ct(Y(l), -r), l = $(l = X(l, mt(m = Ct({
|
|
1479
1479
|
left: u ? f.left - (p.left - f.left) : p.left,
|
|
1480
1480
|
top: d ? f.top - (p.top - f.top) : p.top
|
|
1481
|
-
}, r),
|
|
1481
|
+
}, r), Y(l))), i({
|
|
1482
1482
|
visibleArea: l,
|
|
1483
1483
|
type: "move"
|
|
1484
1484
|
}));
|
|
@@ -1489,10 +1489,10 @@ function Wt(e) {
|
|
|
1489
1489
|
};
|
|
1490
1490
|
}
|
|
1491
1491
|
function Gt(e) {
|
|
1492
|
-
var t = e.directions, n = e.coordinates, r = e.positionRestrictions, i = r === void 0 ? {} : r, a = e.sizeRestrictions, o = e.preserveRatio, s = e.compensate, c =
|
|
1492
|
+
var t = e.directions, n = e.coordinates, r = e.positionRestrictions, i = r === void 0 ? {} : r, a = e.sizeRestrictions, o = e.preserveRatio, s = e.compensate, c = G({}, t), l = gt(n, c).width, u = gt(n, c).height;
|
|
1493
1493
|
l < 0 && (c.left < 0 && c.right < 0 ? (c.left = -(n.width - a.minWidth) / (c.left / c.right), c.right = -(n.width - a.minWidth) / (c.right / c.left)) : c.left < 0 ? c.left = -(n.width - a.minWidth) : c.right < 0 && (c.right = -(n.width - a.minWidth))), u < 0 && (c.top < 0 && c.bottom < 0 ? (c.top = -(n.height - a.minHeight) / (c.top / c.bottom), c.bottom = -(n.height - a.minHeight) / (c.bottom / c.top)) : c.top < 0 ? c.top = -(n.height - a.minHeight) : c.bottom < 0 && (c.bottom = -(n.height - a.minHeight)));
|
|
1494
|
-
var d = gt(
|
|
1495
|
-
s && (d.left && d.left > 0 && d.right === 0 ? (c.right += d.left, c.left -= d.left) : d.right && d.right > 0 && d.left === 0 && (c.left += d.right, c.right -= d.right), d.top && d.top > 0 && d.bottom === 0 ? (c.bottom += d.top, c.top -= d.top) : d.bottom && d.bottom > 0 && d.top === 0 && (c.top += d.bottom, c.bottom -= d.bottom), d = gt(
|
|
1494
|
+
var d = ht(gt(n, c), i);
|
|
1495
|
+
s && (d.left && d.left > 0 && d.right === 0 ? (c.right += d.left, c.left -= d.left) : d.right && d.right > 0 && d.left === 0 && (c.left += d.right, c.right -= d.right), d.top && d.top > 0 && d.bottom === 0 ? (c.bottom += d.top, c.top -= d.top) : d.bottom && d.bottom > 0 && d.top === 0 && (c.top += d.bottom, c.bottom -= d.bottom), d = ht(gt(n, c), i));
|
|
1496
1496
|
var f = {
|
|
1497
1497
|
width: Infinity,
|
|
1498
1498
|
height: Infinity,
|
|
@@ -1501,27 +1501,27 @@ function Gt(e) {
|
|
|
1501
1501
|
top: Infinity,
|
|
1502
1502
|
bottom: Infinity
|
|
1503
1503
|
};
|
|
1504
|
-
if (
|
|
1504
|
+
if (q.forEach((function(e) {
|
|
1505
1505
|
var t = d[e];
|
|
1506
1506
|
t && c[e] && (f[e] = Math.max(0, 1 - t / c[e]));
|
|
1507
1507
|
})), o) {
|
|
1508
|
-
var p = Math.min.apply(null,
|
|
1508
|
+
var p = Math.min.apply(null, q.map((function(e) {
|
|
1509
1509
|
return f[e];
|
|
1510
1510
|
})));
|
|
1511
|
-
p !== Infinity &&
|
|
1511
|
+
p !== Infinity && q.forEach((function(e) {
|
|
1512
1512
|
c[e] *= p;
|
|
1513
1513
|
}));
|
|
1514
|
-
} else
|
|
1514
|
+
} else q.forEach((function(e) {
|
|
1515
1515
|
f[e] !== Infinity && (c[e] *= f[e]);
|
|
1516
1516
|
}));
|
|
1517
|
-
if (l =
|
|
1517
|
+
if (l = gt(n, c).width, u = gt(n, c).height, c.right + c.left && (l > a.maxWidth ? f.width = (a.maxWidth - n.width) / (c.right + c.left) : l < a.minWidth && (f.width = (a.minWidth - n.width) / (c.right + c.left))), c.bottom + c.top && (u > a.maxHeight ? f.height = (a.maxHeight - n.height) / (c.bottom + c.top) : u < a.minHeight && (f.height = (a.minHeight - n.height) / (c.bottom + c.top))), o) {
|
|
1518
1518
|
var m = Math.min(f.width, f.height);
|
|
1519
|
-
m !== Infinity &&
|
|
1519
|
+
m !== Infinity && q.forEach((function(e) {
|
|
1520
1520
|
c[e] *= m;
|
|
1521
1521
|
}));
|
|
1522
|
-
} else f.width !== Infinity &&
|
|
1522
|
+
} else f.width !== Infinity && ct.forEach((function(e) {
|
|
1523
1523
|
c[e] *= f.width;
|
|
1524
|
-
})), f.height !== Infinity &&
|
|
1524
|
+
})), f.height !== Infinity && lt.forEach((function(e) {
|
|
1525
1525
|
c[e] *= f.height;
|
|
1526
1526
|
}));
|
|
1527
1527
|
return c;
|
|
@@ -1529,9 +1529,9 @@ function Gt(e) {
|
|
|
1529
1529
|
function Kt(e, t, n) {
|
|
1530
1530
|
return t == 0 && n == 0 ? e / 2 : t == 0 ? 0 : n == 0 ? e : e * Math.abs(t / (t + n));
|
|
1531
1531
|
}
|
|
1532
|
-
var qt =
|
|
1532
|
+
var qt = W("vue-simple-handler"), Jt = W("vue-simple-handler-wrapper"), Yt = {
|
|
1533
1533
|
name: "SimpleHandler",
|
|
1534
|
-
components: { HandlerWrapper:
|
|
1534
|
+
components: { HandlerWrapper: at },
|
|
1535
1535
|
props: {
|
|
1536
1536
|
defaultClass: { type: String },
|
|
1537
1537
|
hoverClass: { type: String },
|
|
@@ -1547,10 +1547,10 @@ var qt = U("vue-simple-handler"), Jt = U("vue-simple-handler-wrapper"), Yt = {
|
|
|
1547
1547
|
return { hover: !1 };
|
|
1548
1548
|
},
|
|
1549
1549
|
computed: { classes: function() {
|
|
1550
|
-
var e, t = (
|
|
1550
|
+
var e, t = (H(e = {}, this.horizontalPosition, !!this.horizontalPosition), H(e, this.verticalPosition, !!this.verticalPosition), H(e, `${this.horizontalPosition}-${this.verticalPosition}`, !!(this.verticalPosition && this.horizontalPosition)), H(e, "hover", this.hover), e);
|
|
1551
1551
|
return {
|
|
1552
|
-
default:
|
|
1553
|
-
wrapper:
|
|
1552
|
+
default: U(qt(t), this.defaultClass, this.hover && this.hoverClass),
|
|
1553
|
+
wrapper: U(Jt(t), this.wrapperClass)
|
|
1554
1554
|
};
|
|
1555
1555
|
} },
|
|
1556
1556
|
methods: {
|
|
@@ -1596,9 +1596,9 @@ Yt.render = function(e, t, n, i, a, s) {
|
|
|
1596
1596
|
"onLeave"
|
|
1597
1597
|
]);
|
|
1598
1598
|
};
|
|
1599
|
-
var Xt =
|
|
1599
|
+
var Xt = W("vue-simple-line"), Zt = W("vue-simple-line-wrapper"), Qt = {
|
|
1600
1600
|
name: "SimpleLine",
|
|
1601
|
-
components: { LineWrapper:
|
|
1601
|
+
components: { LineWrapper: st },
|
|
1602
1602
|
props: {
|
|
1603
1603
|
defaultClass: { type: String },
|
|
1604
1604
|
hoverClass: { type: String },
|
|
@@ -1614,8 +1614,8 @@ var Xt = U("vue-simple-line"), Zt = U("vue-simple-line-wrapper"), Qt = {
|
|
|
1614
1614
|
},
|
|
1615
1615
|
computed: { classes: function() {
|
|
1616
1616
|
return {
|
|
1617
|
-
root:
|
|
1618
|
-
wrapper:
|
|
1617
|
+
root: U(Xt(H({}, this.position, !0)), this.defaultClass, this.hover && this.hoverClass),
|
|
1618
|
+
wrapper: U(Zt(H({}, this.position, !0)), this.wrapperClass)
|
|
1619
1619
|
};
|
|
1620
1620
|
} },
|
|
1621
1621
|
methods: {
|
|
@@ -1659,7 +1659,7 @@ Qt.render = function(e, t, n, i, a, s) {
|
|
|
1659
1659
|
"onLeave"
|
|
1660
1660
|
]);
|
|
1661
1661
|
};
|
|
1662
|
-
var $t =
|
|
1662
|
+
var $t = W("vue-bounding-box"), en = [
|
|
1663
1663
|
"east",
|
|
1664
1664
|
"west",
|
|
1665
1665
|
null
|
|
@@ -1745,7 +1745,7 @@ var $t = U("vue-bounding-box"), en = [
|
|
|
1745
1745
|
return en.forEach((function(t) {
|
|
1746
1746
|
tn.forEach((function(n) {
|
|
1747
1747
|
if (t !== n) {
|
|
1748
|
-
var r =
|
|
1748
|
+
var r = Ue(t, n);
|
|
1749
1749
|
e.push({
|
|
1750
1750
|
name: r.name,
|
|
1751
1751
|
classname: r.classname,
|
|
@@ -1777,8 +1777,8 @@ var $t = U("vue-bounding-box"), en = [
|
|
|
1777
1777
|
n.horizontalDirection && n.verticalDirection || !e.lines[n.name] || t.push({
|
|
1778
1778
|
name: n.name,
|
|
1779
1779
|
component: e.linesComponent,
|
|
1780
|
-
class:
|
|
1781
|
-
wrapperClass:
|
|
1780
|
+
class: U(e.classes.lines.default, e.classes.lines[n.name], !e.resizable && e.classes.lines.disabled),
|
|
1781
|
+
wrapperClass: U(e.classes.linesWrappers.default, e.classes.linesWrappers[n.name], !e.resizable && e.classes.linesWrappers.disabled),
|
|
1782
1782
|
hoverClass: e.classes.lines.hover,
|
|
1783
1783
|
verticalDirection: n.verticalDirection,
|
|
1784
1784
|
horizontalDirection: n.horizontalDirection,
|
|
@@ -1793,8 +1793,8 @@ var $t = U("vue-bounding-box"), en = [
|
|
|
1793
1793
|
var a = {
|
|
1794
1794
|
name: i.name,
|
|
1795
1795
|
component: e.handlersComponent,
|
|
1796
|
-
class:
|
|
1797
|
-
wrapperClass:
|
|
1796
|
+
class: U(e.classes.handlers.default, e.classes.handlers[i.name]),
|
|
1797
|
+
wrapperClass: U(e.classes.handlersWrappers.default, e.classes.handlersWrappers[i.name]),
|
|
1798
1798
|
hoverClass: e.classes.handlers.hover,
|
|
1799
1799
|
verticalDirection: i.verticalDirection,
|
|
1800
1800
|
horizontalDirection: i.horizontalDirection,
|
|
@@ -1803,7 +1803,7 @@ var $t = U("vue-bounding-box"), en = [
|
|
|
1803
1803
|
if (n && r) {
|
|
1804
1804
|
var o = i.horizontalDirection, s = i.verticalDirection, c = o === "east" ? n : o === "west" ? 0 : n / 2, l = s === "south" ? r : s === "north" ? 0 : r / 2;
|
|
1805
1805
|
a.wrapperClass = $t("handler"), a.wrapperStyle = { transform: `translate(${c}px, ${l}px)` }, e.transitions && e.transitions.enabled && (a.wrapperStyle.transition = `${e.transitions.time}ms ${e.transitions.timingFunction}`);
|
|
1806
|
-
} else a.wrapperClass = $t("handler",
|
|
1806
|
+
} else a.wrapperClass = $t("handler", H({}, i.classname, !0));
|
|
1807
1807
|
t.push(a);
|
|
1808
1808
|
}
|
|
1809
1809
|
})), t;
|
|
@@ -1829,7 +1829,7 @@ var $t = U("vue-bounding-box"), en = [
|
|
|
1829
1829
|
top: 0,
|
|
1830
1830
|
bottom: 0
|
|
1831
1831
|
};
|
|
1832
|
-
t === "west" ? s.left -= a : t === "east" && (s.right += a), n === "north" ? s.top -= o : n === "south" && (s.bottom += o), !n && t ? r = "width" : n && !t && (r = "height"), this.resizable && this.$emit("resize", new
|
|
1832
|
+
t === "west" ? s.left -= a : t === "east" && (s.right += a), n === "north" ? s.top -= o : n === "south" && (s.bottom += o), !n && t ? r = "width" : n && !t && (r = "height"), this.resizable && this.$emit("resize", new et(s, {
|
|
1833
1833
|
allowedDirections: {
|
|
1834
1834
|
left: t === "west" || !t,
|
|
1835
1835
|
right: t === "east" || !t,
|
|
@@ -1903,7 +1903,7 @@ nn.render = function(e, n, r, i, s, l) {
|
|
|
1903
1903
|
})), 128))
|
|
1904
1904
|
], 6);
|
|
1905
1905
|
};
|
|
1906
|
-
var rn =
|
|
1906
|
+
var rn = W("vue-draggable-area"), an = {
|
|
1907
1907
|
name: "DraggableArea",
|
|
1908
1908
|
props: {
|
|
1909
1909
|
movable: {
|
|
@@ -1931,14 +1931,14 @@ var rn = U("vue-draggable-area"), an = {
|
|
|
1931
1931
|
onTouchStart: function(e) {
|
|
1932
1932
|
if (e.cancelable) {
|
|
1933
1933
|
var t = this.movable && e.touches.length === 1;
|
|
1934
|
-
t && (this.touches =
|
|
1934
|
+
t && (this.touches = Ie(e.touches)), (this.touchStarted || t) && (e.preventDefault(), e.stopPropagation());
|
|
1935
1935
|
}
|
|
1936
1936
|
},
|
|
1937
1937
|
onTouchEnd: function() {
|
|
1938
1938
|
this.touchStarted = !1, this.processEnd();
|
|
1939
1939
|
},
|
|
1940
1940
|
onTouchMove: function(e) {
|
|
1941
|
-
this.touches.length >= 1 && (this.touchStarted ? (this.processMove(e, e.touches), e.preventDefault(), e.stopPropagation()) :
|
|
1941
|
+
this.touches.length >= 1 && (this.touchStarted ? (this.processMove(e, e.touches), e.preventDefault(), e.stopPropagation()) : Qe({
|
|
1942
1942
|
x: this.touches[0].clientX,
|
|
1943
1943
|
y: this.touches[0].clientY
|
|
1944
1944
|
}, {
|
|
@@ -1977,10 +1977,10 @@ var rn = U("vue-draggable-area"), an = {
|
|
|
1977
1977
|
};
|
|
1978
1978
|
},
|
|
1979
1979
|
processMove: function(e, t) {
|
|
1980
|
-
var n =
|
|
1980
|
+
var n = Ie(t);
|
|
1981
1981
|
if (this.touches.length) {
|
|
1982
1982
|
var r = this.$refs.container.getBoundingClientRect(), i = r.left, a = r.top;
|
|
1983
|
-
this.touches.length === 1 && n.length === 1 && this.$emit("move", new
|
|
1983
|
+
this.touches.length === 1 && n.length === 1 && this.$emit("move", new tt({
|
|
1984
1984
|
left: n[0].clientX - (i + this.anchor.x),
|
|
1985
1985
|
top: n[0].clientY - (a + this.anchor.y)
|
|
1986
1986
|
}));
|
|
@@ -2080,7 +2080,7 @@ function ln(e) {
|
|
|
2080
2080
|
return null;
|
|
2081
2081
|
}
|
|
2082
2082
|
}
|
|
2083
|
-
var un =
|
|
2083
|
+
var un = W("vue-preview-result"), dn = {
|
|
2084
2084
|
name: "PreviewResult",
|
|
2085
2085
|
props: {
|
|
2086
2086
|
image: { type: Object },
|
|
@@ -2104,7 +2104,7 @@ var un = U("vue-preview-result"), dn = {
|
|
|
2104
2104
|
root: un(),
|
|
2105
2105
|
wrapper: un("wrapper"),
|
|
2106
2106
|
imageWrapper: un("image-wrapper"),
|
|
2107
|
-
image:
|
|
2107
|
+
image: U(un("image"), this.imageClass)
|
|
2108
2108
|
};
|
|
2109
2109
|
},
|
|
2110
2110
|
wrapperStyle: function() {
|
|
@@ -2145,7 +2145,7 @@ function fn(e, t) {
|
|
|
2145
2145
|
return e.forEach((function(t) {
|
|
2146
2146
|
a.left += (t.clientX - r) / e.length, a.top += (t.clientY - i) / e.length;
|
|
2147
2147
|
})), e.forEach((function(e) {
|
|
2148
|
-
o +=
|
|
2148
|
+
o += Qe({
|
|
2149
2149
|
x: a.left,
|
|
2150
2150
|
y: a.top
|
|
2151
2151
|
}, {
|
|
@@ -2200,18 +2200,18 @@ var pn = {
|
|
|
2200
2200
|
window.removeEventListener("mouseup", this.onMouseUp), window.removeEventListener("mousemove", this.onMouseMove), window.removeEventListener("touchmove", this.onTouchMove), window.removeEventListener("touchend", this.onTouchEnd);
|
|
2201
2201
|
},
|
|
2202
2202
|
created: function() {
|
|
2203
|
-
this.transforming = !1, this.debouncedProcessEnd =
|
|
2203
|
+
this.transforming = !1, this.debouncedProcessEnd = He(this.processEnd), this.touches = [];
|
|
2204
2204
|
},
|
|
2205
2205
|
methods: {
|
|
2206
2206
|
processMove: function(e, t) {
|
|
2207
2207
|
if (this.touches.length) {
|
|
2208
|
-
if (this.touches.length === 1 && t.length === 1) this.$emit("move", new
|
|
2208
|
+
if (this.touches.length === 1 && t.length === 1) this.$emit("move", new $e({
|
|
2209
2209
|
left: this.touches[0].clientX - t[0].clientX,
|
|
2210
2210
|
top: this.touches[0].clientY - t[0].clientY
|
|
2211
2211
|
}));
|
|
2212
2212
|
else if (this.touches.length > 1 && this.touchResize) {
|
|
2213
2213
|
var n = fn(t, this.$refs.container), r = this.oldGeometricProperties;
|
|
2214
|
-
r.count === n.count && r.count > 1 && this.$emit("resize", new
|
|
2214
|
+
r.count === n.count && r.count > 1 && this.$emit("resize", new $e({
|
|
2215
2215
|
left: r.centerMass.left - n.centerMass.left,
|
|
2216
2216
|
top: r.centerMass.top - n.centerMass.top
|
|
2217
2217
|
}, {
|
|
@@ -2234,7 +2234,7 @@ var pn = {
|
|
|
2234
2234
|
onTouchStart: function(e) {
|
|
2235
2235
|
if (e.cancelable && (this.touchMove || this.touchResize && e.touches.length > 1) && this.processEvent(e)) {
|
|
2236
2236
|
var t = this.$refs.container, n = t.getBoundingClientRect(), r = n.left, i = n.top, a = n.bottom, o = n.right;
|
|
2237
|
-
this.touches =
|
|
2237
|
+
this.touches = Ie(e.touches).filter((function(e) {
|
|
2238
2238
|
return e.clientX > r && e.clientX < o && e.clientY > i && e.clientY < a;
|
|
2239
2239
|
})), this.oldGeometricProperties = fn(this.touches, t);
|
|
2240
2240
|
}
|
|
@@ -2245,7 +2245,7 @@ var pn = {
|
|
|
2245
2245
|
onTouchMove: function(e) {
|
|
2246
2246
|
var t = this;
|
|
2247
2247
|
if (this.touches.length) {
|
|
2248
|
-
var n =
|
|
2248
|
+
var n = Ie(e.touches).filter((function(e) {
|
|
2249
2249
|
return !e.identifier || t.touches.find((function(t) {
|
|
2250
2250
|
return t.identifier === e.identifier;
|
|
2251
2251
|
}));
|
|
@@ -2274,11 +2274,11 @@ var pn = {
|
|
|
2274
2274
|
},
|
|
2275
2275
|
onWheel: function(e) {
|
|
2276
2276
|
if (this.wheelResize && this.processEvent(e)) {
|
|
2277
|
-
var t = this.$refs.container.getBoundingClientRect(), n = t.left, r = t.top, i = 1 + this.wheelResize.ratio * (o = e.deltaY || e.detail || e.wheelDelta, (s = +o) == 0 ||
|
|
2277
|
+
var t = this.$refs.container.getBoundingClientRect(), n = t.left, r = t.top, i = 1 + this.wheelResize.ratio * (o = e.deltaY || e.detail || e.wheelDelta, (s = +o) == 0 || Ze(s) ? s : s > 0 ? 1 : -1), a = {
|
|
2278
2278
|
left: e.clientX - n,
|
|
2279
2279
|
top: e.clientY - r
|
|
2280
2280
|
};
|
|
2281
|
-
this.$emit("resize", new
|
|
2281
|
+
this.$emit("resize", new $e({}, {
|
|
2282
2282
|
factor: i,
|
|
2283
2283
|
center: a
|
|
2284
2284
|
})), this.touches.length || this.debouncedProcessEnd();
|
|
@@ -2353,7 +2353,7 @@ mn.render = function(e, n, i, a, s, c) {
|
|
|
2353
2353
|
"wheel-resize"
|
|
2354
2354
|
]);
|
|
2355
2355
|
};
|
|
2356
|
-
var hn =
|
|
2356
|
+
var hn = W("vue-preview"), gn = {
|
|
2357
2357
|
props: {
|
|
2358
2358
|
coordinates: { type: Object },
|
|
2359
2359
|
transitions: { type: Object },
|
|
@@ -2386,7 +2386,7 @@ var hn = U("vue-preview"), gn = {
|
|
|
2386
2386
|
root: hn({ fill: this.fill }),
|
|
2387
2387
|
wrapper: hn("wrapper"),
|
|
2388
2388
|
imageWrapper: hn("image-wrapper"),
|
|
2389
|
-
image:
|
|
2389
|
+
image: U(hn("image"), this.imageClass)
|
|
2390
2390
|
};
|
|
2391
2391
|
},
|
|
2392
2392
|
style: function() {
|
|
@@ -2405,7 +2405,7 @@ var hn = U("vue-preview"), gn = {
|
|
|
2405
2405
|
},
|
|
2406
2406
|
imageStyle: function() {
|
|
2407
2407
|
if (this.coordinates && this.image) {
|
|
2408
|
-
var e = this.coordinates.width / this.size.width, t =
|
|
2408
|
+
var e = this.coordinates.width / this.size.width, t = V(V({
|
|
2409
2409
|
rotate: 0,
|
|
2410
2410
|
flip: {
|
|
2411
2411
|
horizontal: !1,
|
|
@@ -2501,7 +2501,7 @@ _n.render = function(t, n, i, a, s, c) {
|
|
|
2501
2501
|
var l = r("preview");
|
|
2502
2502
|
return o(), b(l, e(t.$attrs, { fill: !0 }), null, 16);
|
|
2503
2503
|
};
|
|
2504
|
-
var vn =
|
|
2504
|
+
var vn = W("vue-rectangle-stencil"), yn = {
|
|
2505
2505
|
name: "RectangleStencil",
|
|
2506
2506
|
components: {
|
|
2507
2507
|
StencilPreview: _n,
|
|
@@ -2576,13 +2576,13 @@ var vn = U("vue-rectangle-stencil"), yn = {
|
|
|
2576
2576
|
computed: {
|
|
2577
2577
|
classes: function() {
|
|
2578
2578
|
return {
|
|
2579
|
-
stencil:
|
|
2579
|
+
stencil: U(vn({
|
|
2580
2580
|
movable: this.movable,
|
|
2581
2581
|
moving: this.moving,
|
|
2582
2582
|
resizing: this.resizing
|
|
2583
2583
|
}), this.moving && this.movingClass, this.resizing && this.resizingClass),
|
|
2584
|
-
preview:
|
|
2585
|
-
boundingBox:
|
|
2584
|
+
preview: U(vn("preview"), this.previewClass),
|
|
2585
|
+
boundingBox: U(vn("bounding-box"), this.boundingBoxClass)
|
|
2586
2586
|
};
|
|
2587
2587
|
},
|
|
2588
2588
|
style: function() {
|
|
@@ -2692,7 +2692,7 @@ yn.render = function(e, t, n, i, a, s) {
|
|
|
2692
2692
|
"onResizeEnd"
|
|
2693
2693
|
])], 6);
|
|
2694
2694
|
};
|
|
2695
|
-
var bn =
|
|
2695
|
+
var bn = W("vue-circle-stencil"), xn = {
|
|
2696
2696
|
components: {
|
|
2697
2697
|
StencilPreview: _n,
|
|
2698
2698
|
BoundingBox: nn,
|
|
@@ -2773,13 +2773,13 @@ var bn = U("vue-circle-stencil"), xn = {
|
|
|
2773
2773
|
computed: {
|
|
2774
2774
|
classes: function() {
|
|
2775
2775
|
return {
|
|
2776
|
-
stencil:
|
|
2776
|
+
stencil: U(bn({
|
|
2777
2777
|
movable: this.movable,
|
|
2778
2778
|
moving: this.moving,
|
|
2779
2779
|
resizing: this.resizing
|
|
2780
2780
|
}), this.moving && this.movingClass, this.resizing && this.resizingClass),
|
|
2781
|
-
preview:
|
|
2782
|
-
boundingBox:
|
|
2781
|
+
preview: U(bn("preview"), this.previewClass),
|
|
2782
|
+
boundingBox: U(bn("bounding-box"), this.boundingBoxClass)
|
|
2783
2783
|
};
|
|
2784
2784
|
},
|
|
2785
2785
|
style: function() {
|
|
@@ -2889,7 +2889,7 @@ xn.render = function(e, t, n, i, a, s) {
|
|
|
2889
2889
|
"onResizeEnd"
|
|
2890
2890
|
])], 6);
|
|
2891
2891
|
};
|
|
2892
|
-
var Sn = ["transitions"], Cn =
|
|
2892
|
+
var Sn = ["transitions"], Cn = W("vue-advanced-cropper"), wn = {
|
|
2893
2893
|
name: "Cropper",
|
|
2894
2894
|
components: { BackgroundWrapper: mn },
|
|
2895
2895
|
props: {
|
|
@@ -2955,7 +2955,7 @@ var Sn = ["transitions"], Cn = U("vue-advanced-cropper"), wn = {
|
|
|
2955
2955
|
type: String,
|
|
2956
2956
|
default: "fit-area",
|
|
2957
2957
|
validator: function(e) {
|
|
2958
|
-
return
|
|
2958
|
+
return dt.indexOf(e) !== -1;
|
|
2959
2959
|
}
|
|
2960
2960
|
},
|
|
2961
2961
|
roundResult: {
|
|
@@ -2989,24 +2989,24 @@ var Sn = ["transitions"], Cn = U("vue-advanced-cropper"), wn = {
|
|
|
2989
2989
|
resizeAlgorithm: {
|
|
2990
2990
|
type: Function,
|
|
2991
2991
|
default: function(e) {
|
|
2992
|
-
var t = e.event, n = e.coordinates, r = e.aspectRatio, i = e.positionRestrictions, a = e.sizeRestrictions, o =
|
|
2992
|
+
var t = e.event, n = e.coordinates, r = e.aspectRatio, i = e.positionRestrictions, a = e.sizeRestrictions, o = G(G({}, n), {
|
|
2993
2993
|
right: n.left + n.width,
|
|
2994
2994
|
bottom: n.top + n.height
|
|
2995
|
-
}), s = t.params || {}, c =
|
|
2995
|
+
}), s = t.params || {}, c = G({}, t.directions), l = s.allowedDirections || {
|
|
2996
2996
|
left: !0,
|
|
2997
2997
|
right: !0,
|
|
2998
2998
|
bottom: !0,
|
|
2999
2999
|
top: !0
|
|
3000
3000
|
};
|
|
3001
|
-
a.widthFrozen && (c.left = 0, c.right = 0), a.heightFrozen && (c.top = 0, c.bottom = 0),
|
|
3001
|
+
a.widthFrozen && (c.left = 0, c.right = 0), a.heightFrozen && (c.top = 0, c.bottom = 0), q.forEach((function(e) {
|
|
3002
3002
|
l[e] || (c[e] = 0);
|
|
3003
3003
|
}));
|
|
3004
|
-
var u =
|
|
3004
|
+
var u = gt(o, c = Gt({
|
|
3005
3005
|
coordinates: o,
|
|
3006
3006
|
directions: c,
|
|
3007
3007
|
sizeRestrictions: a,
|
|
3008
3008
|
positionRestrictions: i
|
|
3009
|
-
})).width, d =
|
|
3009
|
+
})).width, d = gt(o, c).height, f = s.preserveRatio ? Q(o) : bt(u / d, r);
|
|
3010
3010
|
if (f) {
|
|
3011
3011
|
var p = s.respectDirection;
|
|
3012
3012
|
if (p ||= o.width >= o.height || f === 1 ? "width" : "height", p === "width") {
|
|
@@ -3031,10 +3031,10 @@ var Sn = ["transitions"], Cn = U("vue-advanced-cropper"), wn = {
|
|
|
3031
3031
|
compensate: s.compensate
|
|
3032
3032
|
});
|
|
3033
3033
|
}
|
|
3034
|
-
return u =
|
|
3034
|
+
return u = gt(o, c).width, d = gt(o, c).height, (f = s.preserveRatio ? Q(o) : bt(u / d, r)) && Math.abs(f - u / d) > .001 && q.forEach((function(e) {
|
|
3035
3035
|
l[e] || (c[e] = 0);
|
|
3036
3036
|
})), Mt({
|
|
3037
|
-
event: new
|
|
3037
|
+
event: new tt({
|
|
3038
3038
|
left: -c.left,
|
|
3039
3039
|
top: -c.top
|
|
3040
3040
|
}),
|
|
@@ -3062,7 +3062,7 @@ var Sn = ["transitions"], Cn = U("vue-advanced-cropper"), wn = {
|
|
|
3062
3062
|
fitCoordinates: {
|
|
3063
3063
|
type: Function,
|
|
3064
3064
|
default: function(e) {
|
|
3065
|
-
var t = e.visibleArea, n = e.coordinates, r = e.aspectRatio, i = e.sizeRestrictions, a = e.positionRestrictions, o =
|
|
3065
|
+
var t = e.visibleArea, n = e.coordinates, r = e.aspectRatio, i = e.sizeRestrictions, a = e.positionRestrictions, o = G(G({}, n), jt({
|
|
3066
3066
|
width: n.width,
|
|
3067
3067
|
height: n.height,
|
|
3068
3068
|
aspectRatio: r,
|
|
@@ -3073,15 +3073,15 @@ var Sn = ["transitions"], Cn = U("vue-advanced-cropper"), wn = {
|
|
|
3073
3073
|
minWidth: Math.min(t.width, i.minWidth)
|
|
3074
3074
|
}
|
|
3075
3075
|
}));
|
|
3076
|
-
return o = $(o = X(o,
|
|
3076
|
+
return o = $(o = X(o, mt(Y(n), Y(o))), Ot(J(t), a));
|
|
3077
3077
|
}
|
|
3078
3078
|
},
|
|
3079
3079
|
fitVisibleArea: {
|
|
3080
3080
|
type: Function,
|
|
3081
3081
|
default: function(e) {
|
|
3082
|
-
var t = e.visibleArea, n = e.boundaries, r = e.getAreaRestrictions, i = e.coordinates, a =
|
|
3082
|
+
var t = e.visibleArea, n = e.boundaries, r = e.getAreaRestrictions, i = e.coordinates, a = G({}, t);
|
|
3083
3083
|
a.height = a.width / Q(n), a.top += (t.height - a.height) / 2, (i.height - a.height > 0 || i.width - a.width > 0) && (a = Z(a, Math.max(i.height / a.height, i.width / a.width)));
|
|
3084
|
-
var o = _t(yt(i,
|
|
3084
|
+
var o = _t(yt(i, J(a = Z(a, wt(a, r({
|
|
3085
3085
|
visibleArea: a,
|
|
3086
3086
|
type: "resize"
|
|
3087
3087
|
}))))));
|
|
@@ -3162,7 +3162,7 @@ var Sn = ["transitions"], Cn = U("vue-advanced-cropper"), wn = {
|
|
|
3162
3162
|
height: 0
|
|
3163
3163
|
},
|
|
3164
3164
|
visibleArea: null,
|
|
3165
|
-
coordinates:
|
|
3165
|
+
coordinates: V({}, ft)
|
|
3166
3166
|
};
|
|
3167
3167
|
},
|
|
3168
3168
|
computed: {
|
|
@@ -3200,7 +3200,7 @@ var Sn = ["transitions"], Cn = U("vue-advanced-cropper"), wn = {
|
|
|
3200
3200
|
return !!(this.visibleArea && this.imageLoaded);
|
|
3201
3201
|
},
|
|
3202
3202
|
settings: function() {
|
|
3203
|
-
var e =
|
|
3203
|
+
var e = Je(this.resizeImage, {
|
|
3204
3204
|
touch: !0,
|
|
3205
3205
|
wheel: { ratio: .1 },
|
|
3206
3206
|
adjustStencil: !0
|
|
@@ -3210,7 +3210,7 @@ var Sn = ["transitions"], Cn = U("vue-advanced-cropper"), wn = {
|
|
|
3210
3210
|
adjustStencil: !1
|
|
3211
3211
|
});
|
|
3212
3212
|
return {
|
|
3213
|
-
moveImage:
|
|
3213
|
+
moveImage: Je(this.moveImage, {
|
|
3214
3214
|
touch: !0,
|
|
3215
3215
|
mouse: !0
|
|
3216
3216
|
}, {
|
|
@@ -3241,13 +3241,13 @@ var Sn = ["transitions"], Cn = U("vue-advanced-cropper"), wn = {
|
|
|
3241
3241
|
if (this.boundaries.width && this.boundaries.height && this.imageSize.width && this.imageSize.height) {
|
|
3242
3242
|
var e = this.sizeRestrictionsAlgorithm({
|
|
3243
3243
|
imageSize: this.imageSize,
|
|
3244
|
-
minWidth:
|
|
3245
|
-
minHeight:
|
|
3246
|
-
maxWidth:
|
|
3247
|
-
maxHeight:
|
|
3244
|
+
minWidth: K(this.minWidth) ? 0 : Ye(this.minWidth),
|
|
3245
|
+
minHeight: K(this.minHeight) ? 0 : Ye(this.minHeight),
|
|
3246
|
+
maxWidth: K(this.maxWidth) ? Infinity : Ye(this.maxWidth),
|
|
3247
|
+
maxHeight: K(this.maxHeight) ? Infinity : Ye(this.maxHeight)
|
|
3248
3248
|
});
|
|
3249
3249
|
if (e = function(e) {
|
|
3250
|
-
var t = e.areaRestrictions, n = e.sizeRestrictions, r = e.boundaries, i = e.positionRestrictions, a =
|
|
3250
|
+
var t = e.areaRestrictions, n = e.sizeRestrictions, r = e.boundaries, i = e.positionRestrictions, a = G(G({}, n), {
|
|
3251
3251
|
minWidth: n.minWidth === void 0 ? 0 : n.minWidth,
|
|
3252
3252
|
minHeight: n.minHeight === void 0 ? 0 : n.minHeight,
|
|
3253
3253
|
maxWidth: n.maxWidth === void 0 ? Infinity : n.maxWidth,
|
|
@@ -3293,14 +3293,14 @@ var Sn = ["transitions"], Cn = U("vue-advanced-cropper"), wn = {
|
|
|
3293
3293
|
classes: function() {
|
|
3294
3294
|
return {
|
|
3295
3295
|
cropper: Cn(),
|
|
3296
|
-
image:
|
|
3296
|
+
image: U(Cn("image"), this.imageClass),
|
|
3297
3297
|
stencil: Cn("stencil"),
|
|
3298
|
-
boundaries:
|
|
3299
|
-
stretcher:
|
|
3300
|
-
background:
|
|
3301
|
-
foreground:
|
|
3302
|
-
imageWrapper:
|
|
3303
|
-
cropperWrapper:
|
|
3298
|
+
boundaries: U(Cn("boundaries"), this.boundariesClass),
|
|
3299
|
+
stretcher: U(Cn("stretcher")),
|
|
3300
|
+
background: U(Cn("background"), this.backgroundClass),
|
|
3301
|
+
foreground: U(Cn("foreground"), this.foregroundClass),
|
|
3302
|
+
imageWrapper: U(Cn("image-wrapper")),
|
|
3303
|
+
cropperWrapper: U(Cn("cropper-wrapper"))
|
|
3304
3304
|
};
|
|
3305
3305
|
},
|
|
3306
3306
|
stencilCoordinates: function() {
|
|
@@ -3337,7 +3337,7 @@ var Sn = ["transitions"], Cn = U("vue-advanced-cropper"), wn = {
|
|
|
3337
3337
|
}, n = {
|
|
3338
3338
|
left: (1 - 1 / this.coefficient) * e.width / 2,
|
|
3339
3339
|
top: (1 - 1 / this.coefficient) * e.height / 2
|
|
3340
|
-
}, r =
|
|
3340
|
+
}, r = V(V({}, this.imageTransforms), {}, {
|
|
3341
3341
|
scaleX: this.imageTransforms.scaleX * (this.imageAttributes.width / e.width),
|
|
3342
3342
|
scaleY: this.imageTransforms.scaleY * (this.imageAttributes.height / e.height)
|
|
3343
3343
|
}), i = {
|
|
@@ -3386,7 +3386,7 @@ var Sn = ["transitions"], Cn = U("vue-advanced-cropper"), wn = {
|
|
|
3386
3386
|
}
|
|
3387
3387
|
},
|
|
3388
3388
|
created: function() {
|
|
3389
|
-
this.debouncedUpdate =
|
|
3389
|
+
this.debouncedUpdate = He(this.update, this.debounce), this.debouncedDisableTransitions = He(this.disableTransitions, this.transitionsOptions.time), this.awaiting = !1;
|
|
3390
3390
|
},
|
|
3391
3391
|
mounted: function() {
|
|
3392
3392
|
this.$refs.image.addEventListener("load", this.onSuccessLoadImage), this.$refs.image.addEventListener("error", this.onFailLoadImage), this.onChangeImage(), window.addEventListener("resize", this.refresh), window.addEventListener("orientationchange", this.refresh);
|
|
@@ -3396,16 +3396,16 @@ var Sn = ["transitions"], Cn = U("vue-advanced-cropper"), wn = {
|
|
|
3396
3396
|
},
|
|
3397
3397
|
methods: {
|
|
3398
3398
|
getResult: function() {
|
|
3399
|
-
var e = this.initialized ? this.prepareResult(
|
|
3399
|
+
var e = this.initialized ? this.prepareResult(V({}, this.coordinates)) : this.defaultCoordinates(), t = {
|
|
3400
3400
|
rotate: this.imageTransforms.rotate % 360,
|
|
3401
|
-
flip:
|
|
3401
|
+
flip: V({}, this.imageTransforms.flip)
|
|
3402
3402
|
};
|
|
3403
3403
|
if (this.src && this.imageLoaded) {
|
|
3404
3404
|
var n = this;
|
|
3405
3405
|
return {
|
|
3406
3406
|
image: this.image,
|
|
3407
3407
|
coordinates: e,
|
|
3408
|
-
visibleArea: this.visibleArea ?
|
|
3408
|
+
visibleArea: this.visibleArea ? V({}, this.visibleArea) : null,
|
|
3409
3409
|
imageTransforms: t,
|
|
3410
3410
|
get canvas() {
|
|
3411
3411
|
return n.canvas ? n.getCanvas() : void 0;
|
|
@@ -3415,14 +3415,14 @@ var Sn = ["transitions"], Cn = U("vue-advanced-cropper"), wn = {
|
|
|
3415
3415
|
return {
|
|
3416
3416
|
image: this.image,
|
|
3417
3417
|
coordinates: e,
|
|
3418
|
-
visibleArea: this.visibleArea ?
|
|
3418
|
+
visibleArea: this.visibleArea ? V({}, this.visibleArea) : null,
|
|
3419
3419
|
canvas: void 0,
|
|
3420
3420
|
imageTransforms: t
|
|
3421
3421
|
};
|
|
3422
3422
|
},
|
|
3423
3423
|
zoom: function(e, t) {
|
|
3424
3424
|
var n = (arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}).transitions, r = n === void 0 || n;
|
|
3425
|
-
this.onManipulateImage(new
|
|
3425
|
+
this.onManipulateImage(new $e({}, {
|
|
3426
3426
|
factor: 1 / e,
|
|
3427
3427
|
center: t
|
|
3428
3428
|
}), {
|
|
@@ -3432,7 +3432,7 @@ var Sn = ["transitions"], Cn = U("vue-advanced-cropper"), wn = {
|
|
|
3432
3432
|
},
|
|
3433
3433
|
move: function(e, t) {
|
|
3434
3434
|
var n = (arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}).transitions, r = n === void 0 || n;
|
|
3435
|
-
this.onManipulateImage(new
|
|
3435
|
+
this.onManipulateImage(new $e({
|
|
3436
3436
|
left: e || 0,
|
|
3437
3437
|
top: t || 0
|
|
3438
3438
|
}), {
|
|
@@ -3475,7 +3475,7 @@ var Sn = ["transitions"], Cn = U("vue-advanced-cropper"), wn = {
|
|
|
3475
3475
|
top: Math.round(t.top)
|
|
3476
3476
|
};
|
|
3477
3477
|
return i.width > n.maxWidth ? i.width = Math.floor(t.width) : i.width < n.minWidth && (i.width = Math.ceil(t.width)), i.height > n.maxHeight ? i.height = Math.floor(t.height) : i.height < n.minHeight && (i.height = Math.ceil(t.height)), $(i, r);
|
|
3478
|
-
}(
|
|
3478
|
+
}(V(V({}, this.getPublicProperties()), {}, {
|
|
3479
3479
|
positionRestrictions: Vt(this.positionRestrictions, this.visibleArea),
|
|
3480
3480
|
coordinates: e
|
|
3481
3481
|
})) : e;
|
|
@@ -3497,16 +3497,16 @@ var Sn = ["transitions"], Cn = U("vue-advanced-cropper"), wn = {
|
|
|
3497
3497
|
sizeRestrictions: this.sizeRestrictions,
|
|
3498
3498
|
stencilSize: this.getStencilSize()
|
|
3499
3499
|
});
|
|
3500
|
-
return
|
|
3500
|
+
return V(V({}, a), {}, { changed: !pt(a.visibleArea, t) || !pt(a.coordinates, n) });
|
|
3501
3501
|
},
|
|
3502
3502
|
runAutoZoom: function(e) {
|
|
3503
|
-
var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, n = t.transitions, r = n !== void 0 && n, i =
|
|
3503
|
+
var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, n = t.transitions, r = n !== void 0 && n, i = Fe(t, Sn), a = this.processAutoZoom(e, this.visibleArea, this.coordinates, i), o = a.visibleArea, s = a.coordinates, c = a.changed;
|
|
3504
3504
|
r && c && this.enableTransitions(), this.visibleArea = o, this.coordinates = s, r && c && this.debouncedDisableTransitions();
|
|
3505
3505
|
},
|
|
3506
3506
|
normalizeEvent: function(e) {
|
|
3507
3507
|
return function(e) {
|
|
3508
3508
|
var t = e.event, n = e.visibleArea, r = e.coefficient;
|
|
3509
|
-
if (t.type === "manipulateImage") return
|
|
3509
|
+
if (t.type === "manipulateImage") return G(G({}, t), {
|
|
3510
3510
|
move: {
|
|
3511
3511
|
left: t.move && t.move.left ? r * t.move.left : 0,
|
|
3512
3512
|
top: t.move && t.move.top ? r * t.move.top : 0
|
|
@@ -3520,19 +3520,19 @@ var Sn = ["transitions"], Cn = U("vue-advanced-cropper"), wn = {
|
|
|
3520
3520
|
}
|
|
3521
3521
|
});
|
|
3522
3522
|
if (t.type === "resize") {
|
|
3523
|
-
var i =
|
|
3524
|
-
return
|
|
3523
|
+
var i = G(G({}, t), { directions: G({}, t.directions) });
|
|
3524
|
+
return q.forEach((function(e) {
|
|
3525
3525
|
i.directions[e] *= r;
|
|
3526
3526
|
})), i;
|
|
3527
3527
|
}
|
|
3528
3528
|
if (t.type === "move") {
|
|
3529
|
-
var a =
|
|
3530
|
-
return
|
|
3529
|
+
var a = G(G({}, t), { directions: G({}, t.directions) });
|
|
3530
|
+
return ut.forEach((function(e) {
|
|
3531
3531
|
a.directions[e] *= r;
|
|
3532
3532
|
})), a;
|
|
3533
3533
|
}
|
|
3534
3534
|
return t;
|
|
3535
|
-
}(
|
|
3535
|
+
}(V(V({}, this.getPublicProperties()), {}, { event: e }));
|
|
3536
3536
|
},
|
|
3537
3537
|
getCanvas: function() {
|
|
3538
3538
|
if (this.$refs.canvas) {
|
|
@@ -3542,12 +3542,12 @@ var Sn = ["transitions"], Cn = U("vue-advanced-cropper"), wn = {
|
|
|
3542
3542
|
height: t.naturalHeight
|
|
3543
3543
|
}, o = St(a, r), s = e.getContext("2d");
|
|
3544
3544
|
e.height = o.height, e.width = o.width, s.save();
|
|
3545
|
-
var c = Ct(
|
|
3545
|
+
var c = Ct(Y(G({
|
|
3546
3546
|
left: 0,
|
|
3547
3547
|
top: 0
|
|
3548
3548
|
}, a)), r);
|
|
3549
3549
|
return s.translate(-(c.left - o.width / 2), -(c.top - o.height / 2)), s.rotate(r * Math.PI / 180), s.translate(i.horizontal ? a.width : 0, i.vertical ? a.height : 0), s.scale(i.horizontal ? -1 : 1, i.vertical ? -1 : 1), s.drawImage(t, 0, 0, a.width, a.height), s.restore(), e;
|
|
3550
|
-
}(this.$refs.sourceCanvas, t, this.imageTransforms) : t, r =
|
|
3550
|
+
}(this.$refs.sourceCanvas, t, this.imageTransforms) : t, r = V({
|
|
3551
3551
|
minWidth: 0,
|
|
3552
3552
|
minHeight: 0,
|
|
3553
3553
|
maxWidth: Infinity,
|
|
@@ -3612,7 +3612,7 @@ var Sn = ["transitions"], Cn = U("vue-advanced-cropper"), wn = {
|
|
|
3612
3612
|
this.$refs.cropper, this.$refs.image;
|
|
3613
3613
|
var t = this.defaultSize;
|
|
3614
3614
|
t ||= this.stencilSize ? zt : Rt, this.sizeRestrictions;
|
|
3615
|
-
var n =
|
|
3615
|
+
var n = Ke(t) ? t({
|
|
3616
3616
|
boundaries: this.boundaries,
|
|
3617
3617
|
imageSize: this.imageSize,
|
|
3618
3618
|
aspectRatio: this.getAspectRatio(),
|
|
@@ -3621,13 +3621,13 @@ var Sn = ["transitions"], Cn = U("vue-advanced-cropper"), wn = {
|
|
|
3621
3621
|
visibleArea: this.visibleArea
|
|
3622
3622
|
}) : t, r = this.defaultPosition || Lt, i = [n, function(t) {
|
|
3623
3623
|
var n = t.coordinates;
|
|
3624
|
-
return
|
|
3624
|
+
return V({}, Ke(r) ? r({
|
|
3625
3625
|
coordinates: n,
|
|
3626
3626
|
imageSize: e.imageSize,
|
|
3627
3627
|
visibleArea: e.visibleArea
|
|
3628
3628
|
}) : e.defaultPosition);
|
|
3629
3629
|
}];
|
|
3630
|
-
this.delayedTransforms && i.push.apply(i,
|
|
3630
|
+
this.delayedTransforms && i.push.apply(i, Ie(Array.isArray(this.delayedTransforms) ? this.delayedTransforms : [this.delayedTransforms])), this.coordinates = this.applyTransform(i, !0), this.delayedTransforms = null;
|
|
3631
3631
|
}
|
|
3632
3632
|
},
|
|
3633
3633
|
clearImage: function() {
|
|
@@ -3657,7 +3657,7 @@ var Sn = ["transitions"], Cn = U("vue-advanced-cropper"), wn = {
|
|
|
3657
3657
|
cropper: n,
|
|
3658
3658
|
imageSize: e.imageSize
|
|
3659
3659
|
};
|
|
3660
|
-
if (
|
|
3660
|
+
if (Ke(e.defaultBoundaries) ? e.boundaries = e.defaultBoundaries(t) : e.defaultBoundaries === "fit" ? e.boundaries = function(e) {
|
|
3661
3661
|
var t = e.cropper, n = e.imageSize, r = t.clientHeight, i = t.clientWidth, a = r, o = n.width * r / n.height;
|
|
3662
3662
|
return o > i && (o = i, a = n.height * i / n.width), {
|
|
3663
3663
|
width: o,
|
|
@@ -3674,10 +3674,10 @@ var Sn = ["transitions"], Cn = U("vue-advanced-cropper"), wn = {
|
|
|
3674
3674
|
},
|
|
3675
3675
|
resetVisibleArea: function() {
|
|
3676
3676
|
var e = this;
|
|
3677
|
-
return this.appliedImageTransforms =
|
|
3677
|
+
return this.appliedImageTransforms = V(V({}, this.defaultImageTransforms), {}, { flip: V({}, this.defaultImageTransforms.flip) }), this.updateBoundaries().then((function() {
|
|
3678
3678
|
e.priority !== "visible-area" && (e.visibleArea = null, e.resetCoordinates());
|
|
3679
3679
|
var t, n, r, i, a, o, s = e.defaultVisibleArea || Bt;
|
|
3680
|
-
e.visibleArea =
|
|
3680
|
+
e.visibleArea = Ke(s) ? s({
|
|
3681
3681
|
imageSize: e.imageSize,
|
|
3682
3682
|
boundaries: e.boundaries,
|
|
3683
3683
|
coordinates: e.priority === "visible-area" ? null : e.coordinates,
|
|
@@ -3687,7 +3687,7 @@ var Sn = ["transitions"], Cn = U("vue-advanced-cropper"), wn = {
|
|
|
3687
3687
|
visibleArea: e.visibleArea,
|
|
3688
3688
|
boundaries: e.boundaries,
|
|
3689
3689
|
getAreaRestrictions: e.getAreaRestrictions
|
|
3690
|
-
}, n = t.visibleArea, r = t.boundaries, i = t.getAreaRestrictions, a =
|
|
3690
|
+
}, n = t.visibleArea, r = t.boundaries, i = t.getAreaRestrictions, a = G({}, n), o = Q(r), a.width / a.height !== o && (a.height = a.width / o), $(a, i({
|
|
3691
3691
|
visibleArea: a,
|
|
3692
3692
|
type: "move"
|
|
3693
3693
|
}))), e.priority === "visible-area" ? e.resetCoordinates() : e.coordinates = e.fitCoordinates({
|
|
@@ -3728,7 +3728,7 @@ var Sn = ["transitions"], Cn = U("vue-advanced-cropper"), wn = {
|
|
|
3728
3728
|
var e, t = this;
|
|
3729
3729
|
if (this.imageLoaded = !1, this.delayedTransforms = null, this.src) {
|
|
3730
3730
|
if (function(e) {
|
|
3731
|
-
if (
|
|
3731
|
+
if (Ge(e)) return !1;
|
|
3732
3732
|
var t = window.location, n = /(\w+:)?(?:\/\/)([\w.-]+)?(?::(\d+))?\/?/.exec(e) || [], r = {
|
|
3733
3733
|
protocol: n[1] || "",
|
|
3734
3734
|
host: n[2] || "",
|
|
@@ -3738,7 +3738,7 @@ var Sn = ["transitions"], Cn = U("vue-advanced-cropper"), wn = {
|
|
|
3738
3738
|
};
|
|
3739
3739
|
return !(!r.protocol && !r.host && !r.port || r.protocol && r.protocol == t.protocol && r.host && r.host == t.host && r.host && i(r) == i(t));
|
|
3740
3740
|
}(this.src)) {
|
|
3741
|
-
var n =
|
|
3741
|
+
var n = K(this.crossOrigin) ? this.canvas : this.crossOrigin;
|
|
3742
3742
|
!0 === n && (n = "anonymous"), this.imageAttributes.crossOrigin = n || null;
|
|
3743
3743
|
}
|
|
3744
3744
|
if (this.checkOrientation) {
|
|
@@ -3781,13 +3781,13 @@ var Sn = ["transitions"], Cn = U("vue-advanced-cropper"), wn = {
|
|
|
3781
3781
|
},
|
|
3782
3782
|
onParseImage: function(e) {
|
|
3783
3783
|
var t = this, n = e.source, r = e.arrayBuffer, i = e.orientation;
|
|
3784
|
-
this.imageAttributes.revoke && this.imageAttributes.src && URL.revokeObjectURL(this.imageAttributes.src), this.imageAttributes.revoke = !1, r && i && i > 1 ?
|
|
3784
|
+
this.imageAttributes.revoke && this.imageAttributes.src && URL.revokeObjectURL(this.imageAttributes.src), this.imageAttributes.revoke = !1, r && i && i > 1 ? We(n) || !Ge(n) ? (this.imageAttributes.src = URL.createObjectURL(new Blob([r])), this.imageAttributes.revoke = !0) : this.imageAttributes.src = function(e) {
|
|
3785
3785
|
for (var t = [], n = new Uint8Array(e); n.length > 0;) {
|
|
3786
3786
|
var r = n.subarray(0, 8192);
|
|
3787
3787
|
t.push(String.fromCharCode.apply(null, Array.from ? Array.from(r) : r.slice())), n = n.subarray(8192);
|
|
3788
3788
|
}
|
|
3789
3789
|
return "data:image/jpeg;base64," + btoa(t.join(""));
|
|
3790
|
-
}(r) : this.imageAttributes.src = n,
|
|
3790
|
+
}(r) : this.imageAttributes.src = n, Ke(this.defaultTransforms) ? this.appliedImageTransforms = on(this.defaultTransforms()) : qe(this.defaultTransforms) ? this.appliedImageTransforms = on(this.defaultTransforms) : this.appliedImageTransforms = function(e) {
|
|
3791
3791
|
var t = on({});
|
|
3792
3792
|
if (e) switch (e) {
|
|
3793
3793
|
case 2:
|
|
@@ -3811,7 +3811,7 @@ var Sn = ["transitions"], Cn = U("vue-advanced-cropper"), wn = {
|
|
|
3811
3811
|
case 8: t.rotate = -90;
|
|
3812
3812
|
}
|
|
3813
3813
|
return t;
|
|
3814
|
-
}(i), this.defaultImageTransforms =
|
|
3814
|
+
}(i), this.defaultImageTransforms = V(V({}, this.appliedImageTransforms), {}, { flip: V({}, this.appliedImageTransforms.flip) }), this.$nextTick((function() {
|
|
3815
3815
|
var e = t.$refs.image;
|
|
3816
3816
|
e && e.complete && (function(e) {
|
|
3817
3817
|
return !!e.naturalWidth;
|
|
@@ -3827,7 +3827,7 @@ var Sn = ["transitions"], Cn = U("vue-advanced-cropper"), wn = {
|
|
|
3827
3827
|
onMove: function(e) {
|
|
3828
3828
|
var t = this;
|
|
3829
3829
|
this.transitionsOptions.enabled || this.awaitRender((function() {
|
|
3830
|
-
t.coordinates = t.moveAlgorithm(
|
|
3830
|
+
t.coordinates = t.moveAlgorithm(V(V({}, t.getPublicProperties()), {}, {
|
|
3831
3831
|
positionRestrictions: Vt(t.positionRestrictions, t.visibleArea),
|
|
3832
3832
|
coordinates: t.coordinates,
|
|
3833
3833
|
event: t.normalizeEvent(e)
|
|
@@ -3838,7 +3838,7 @@ var Sn = ["transitions"], Cn = U("vue-advanced-cropper"), wn = {
|
|
|
3838
3838
|
var t = this;
|
|
3839
3839
|
this.transitionsOptions.enabled || this.stencilSize && !this.autoZoom || this.awaitRender((function() {
|
|
3840
3840
|
var n = t.sizeRestrictions, r = Math.min(t.coordinates.width, t.coordinates.height, 20 * t.coefficient);
|
|
3841
|
-
t.coordinates = t.resizeAlgorithm(
|
|
3841
|
+
t.coordinates = t.resizeAlgorithm(V(V({}, t.getPublicProperties()), {}, {
|
|
3842
3842
|
positionRestrictions: Vt(t.positionRestrictions, t.visibleArea),
|
|
3843
3843
|
sizeRestrictions: {
|
|
3844
3844
|
maxWidth: Math.min(n.maxWidth, t.visibleArea.width),
|
|
@@ -3855,7 +3855,7 @@ var Sn = ["transitions"], Cn = U("vue-advanced-cropper"), wn = {
|
|
|
3855
3855
|
if (!this.transitionsOptions.enabled) {
|
|
3856
3856
|
var n = t.transitions, r = n !== void 0 && n, i = t.normalize, a = i === void 0 || i;
|
|
3857
3857
|
r && this.enableTransitions();
|
|
3858
|
-
var o = Ht(
|
|
3858
|
+
var o = Ht(V(V({}, this.getPublicProperties()), {}, {
|
|
3859
3859
|
event: a ? this.normalizeEvent(e) : e,
|
|
3860
3860
|
getAreaRestrictions: this.getAreaRestrictions,
|
|
3861
3861
|
imageRestriction: this.imageRestriction,
|
|
@@ -3883,9 +3883,9 @@ var Sn = ["transitions"], Cn = U("vue-advanced-cropper"), wn = {
|
|
|
3883
3883
|
var s = this.$refs.stencil.aspectRatios();
|
|
3884
3884
|
t = s.minimum, n = s.maximum;
|
|
3885
3885
|
}
|
|
3886
|
-
if (
|
|
3886
|
+
if (K(t) && (t = K(i) ? a : i), K(n) && (n = K(i) ? o : i), !e && (K(t) || K(n))) {
|
|
3887
3887
|
var c = this.getStencilSize(), l = c ? Q(c) : null;
|
|
3888
|
-
|
|
3888
|
+
K(t) && (t = Xe(l) ? l : void 0), K(n) && (n = Xe(l) ? l : void 0);
|
|
3889
3889
|
}
|
|
3890
3890
|
return {
|
|
3891
3891
|
minimum: t,
|
|
@@ -3903,7 +3903,7 @@ var Sn = ["transitions"], Cn = U("vue-advanced-cropper"), wn = {
|
|
|
3903
3903
|
coefficient: this.coefficient,
|
|
3904
3904
|
coordinates: this.coordinates,
|
|
3905
3905
|
aspectRatio: this.getAspectRatio(!0)
|
|
3906
|
-
}, t = e.boundaries, n = e.stencilSize, r = e.aspectRatio, bt(Q(i =
|
|
3906
|
+
}, t = e.boundaries, n = e.stencilSize, r = e.aspectRatio, bt(Q(i = Ke(n) ? n({
|
|
3907
3907
|
boundaries: t,
|
|
3908
3908
|
aspectRatio: r
|
|
3909
3909
|
}) : n), r) && (i = jt({
|
|
@@ -3948,13 +3948,13 @@ var Sn = ["transitions"], Cn = U("vue-advanced-cropper"), wn = {
|
|
|
3948
3948
|
};
|
|
3949
3949
|
},
|
|
3950
3950
|
defaultCoordinates: function() {
|
|
3951
|
-
return
|
|
3951
|
+
return V({}, ft);
|
|
3952
3952
|
},
|
|
3953
3953
|
flip: function(e, t) {
|
|
3954
3954
|
var n = (arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}).transitions, r = n === void 0 || n;
|
|
3955
3955
|
if (!this.transitionsActive) {
|
|
3956
3956
|
r && this.enableTransitions();
|
|
3957
|
-
var i =
|
|
3957
|
+
var i = V({}, this.imageTransforms.flip), a = Wt({
|
|
3958
3958
|
flip: {
|
|
3959
3959
|
horizontal: e ? !i.horizontal : i.horizontal,
|
|
3960
3960
|
vertical: t ? !i.vertical : i.vertical
|
|
@@ -3976,7 +3976,7 @@ var Sn = ["transitions"], Cn = U("vue-advanced-cropper"), wn = {
|
|
|
3976
3976
|
var t = (arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}).transitions, n = t === void 0 || t;
|
|
3977
3977
|
if (!this.transitionsActive) {
|
|
3978
3978
|
n && this.enableTransitions();
|
|
3979
|
-
var r =
|
|
3979
|
+
var r = V({}, this.imageSize);
|
|
3980
3980
|
this.appliedImageTransforms.rotate += e;
|
|
3981
3981
|
var i = Ut({
|
|
3982
3982
|
visibleArea: this.visibleArea,
|
|
@@ -4132,7 +4132,7 @@ var Dn = ["data-tpl-theme"], On = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, kn
|
|
|
4132
4132
|
}, nr = {
|
|
4133
4133
|
class: "tpl:mb-1 tpl:block tpl:text-xs tpl:font-medium",
|
|
4134
4134
|
style: { color: "var(--tpl-text-muted)" }
|
|
4135
|
-
}, 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__*/
|
|
4135
|
+
}, 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__*/ I(/* @__PURE__ */ A({
|
|
4136
4136
|
__name: "MediaEditModal",
|
|
4137
4137
|
props: {
|
|
4138
4138
|
visible: { type: Boolean },
|
|
@@ -4140,54 +4140,54 @@ 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 } =
|
|
4143
|
+
let r = e, i = t, { t: a } = B(), s = l("tplUiTheme"), f = l(Ne, d(null)), T = a.mediaLibrary, { isImageMimeType: D } = De(), A = d(""), M = d(""), te = d(null), N = d("free"), P = d(void 0), ne = d(void 0), re = d(""), F = d(""), I = d(void 0), L = d(null), ie = d(!1), R = d(!1), ae = d(!1), oe = 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),
|
|
4148
|
+
].includes(r.item.mime_type) : !1), se = h(() => N.value === "original" ? I.value : Oe[N.value]), ce = h(() => L.value ? Me(L.value.width, L.value.height, P.value, ne.value) : null);
|
|
4149
4149
|
ee(() => r.visible, (e) => {
|
|
4150
|
-
e && r.item && (A.value = r.item.filename,
|
|
4150
|
+
e && r.item && (A.value = r.item.filename, M.value = r.item.alt_text || "", N.value = "free", P.value = void 0, ne.value = void 0, re.value = "", F.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));
|
|
4151
4151
|
});
|
|
4152
|
-
function
|
|
4153
|
-
e.coordinates && (
|
|
4152
|
+
function le(e) {
|
|
4153
|
+
e.coordinates && (L.value = {
|
|
4154
4154
|
width: Math.round(e.coordinates.width),
|
|
4155
4155
|
height: Math.round(e.coordinates.height)
|
|
4156
|
-
},
|
|
4156
|
+
}, ae.value = !0);
|
|
4157
4157
|
}
|
|
4158
|
-
function
|
|
4159
|
-
|
|
4158
|
+
function ue() {
|
|
4159
|
+
ie.value = !0, !I.value && r.item?.width && r.item?.height && (I.value = r.item.width / r.item.height);
|
|
4160
4160
|
}
|
|
4161
|
-
function
|
|
4161
|
+
function z(e) {
|
|
4162
4162
|
let t = e.target.value;
|
|
4163
|
-
re.value = t,
|
|
4163
|
+
re.value = t, P.value = t && parseInt(t, 10) || void 0;
|
|
4164
4164
|
}
|
|
4165
|
-
function
|
|
4165
|
+
function de(e) {
|
|
4166
4166
|
let t = e.target.value;
|
|
4167
|
-
|
|
4167
|
+
F.value = t, ne.value = t && parseInt(t, 10) || void 0;
|
|
4168
4168
|
}
|
|
4169
|
-
async function
|
|
4169
|
+
async function fe() {
|
|
4170
4170
|
let e = A.value.trim();
|
|
4171
|
-
if (!e || !r.item ||
|
|
4171
|
+
if (!e || !r.item || R.value) return;
|
|
4172
4172
|
let t = D(r.item.mime_type), n;
|
|
4173
|
-
if (
|
|
4174
|
-
|
|
4173
|
+
if (oe.value && te.value && ae.value) {
|
|
4174
|
+
R.value = !0;
|
|
4175
4175
|
try {
|
|
4176
|
-
let { canvas: e } =
|
|
4176
|
+
let { canvas: e } = te.value.getResult();
|
|
4177
4177
|
if (e) {
|
|
4178
|
-
let t =
|
|
4179
|
-
n = { file: await
|
|
4178
|
+
let t = Ae(e, P.value, ne.value), i = ke(r.item.mime_type);
|
|
4179
|
+
n = { file: await je(t, r.item.filename, i) };
|
|
4180
4180
|
}
|
|
4181
4181
|
} catch {
|
|
4182
|
-
|
|
4182
|
+
R.value = !1;
|
|
4183
4183
|
return;
|
|
4184
4184
|
}
|
|
4185
|
-
|
|
4185
|
+
R.value = !1;
|
|
4186
4186
|
}
|
|
4187
|
-
i("save", r.item.id, e, t ?
|
|
4187
|
+
i("save", r.item.id, e, t ? M.value : void 0, n), i("close");
|
|
4188
4188
|
}
|
|
4189
|
-
function
|
|
4190
|
-
e.key === "Enter" && !
|
|
4189
|
+
function pe(e) {
|
|
4190
|
+
e.key === "Enter" && !R.value && (e.preventDefault(), fe()), e.key === "Escape" && i("close");
|
|
4191
4191
|
}
|
|
4192
4192
|
return (t, r) => (o(), b(m, { to: v(f) || "body" }, [j(x, {
|
|
4193
4193
|
"enter-active-class": "tpl:transition tpl:ease-out tpl:duration-150",
|
|
@@ -4203,22 +4203,22 @@ var Dn = ["data-tpl-theme"], On = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, kn
|
|
|
4203
4203
|
class: "tpl tpl:fixed tpl:inset-0 tpl:z-[10000] tpl:flex tpl:items-center tpl:justify-center",
|
|
4204
4204
|
style: { "background-color": "var(--tpl-overlay)" },
|
|
4205
4205
|
onClick: r[3] ||= y((e) => i("close"), ["self"]),
|
|
4206
|
-
onKeydown:
|
|
4206
|
+
onKeydown: pe
|
|
4207
4207
|
}, [w("div", {
|
|
4208
|
-
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",
|
|
4208
|
+
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", oe.value ? "tpl:max-w-2xl" : "tpl:max-w-sm"]),
|
|
4209
4209
|
style: { "background-color": "var(--tpl-bg-elevated)" }
|
|
4210
4210
|
}, [
|
|
4211
4211
|
w("div", On, [w("h3", kn, p(v(a).mediaLibrary.editFile), 1)]),
|
|
4212
4212
|
w("div", An, [
|
|
4213
|
-
|
|
4213
|
+
oe.value ? (o(), g("div", jn, [w("div", Mn, [j(v(wn), {
|
|
4214
4214
|
ref_key: "cropperRef",
|
|
4215
|
-
ref:
|
|
4215
|
+
ref: te,
|
|
4216
4216
|
src: e.item.url,
|
|
4217
|
-
"stencil-props": { aspectRatio:
|
|
4217
|
+
"stencil-props": { aspectRatio: se.value },
|
|
4218
4218
|
class: "tpl:h-full tpl:w-full",
|
|
4219
4219
|
"background-class": "tpl-cropper-background",
|
|
4220
|
-
onChange:
|
|
4221
|
-
onReady:
|
|
4220
|
+
onChange: le,
|
|
4221
|
+
onReady: ue
|
|
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",
|
|
@@ -4231,11 +4231,11 @@ var Dn = ["data-tpl-theme"], On = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, kn
|
|
|
4231
4231
|
type: "button",
|
|
4232
4232
|
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",
|
|
4233
4233
|
style: E({
|
|
4234
|
-
borderColor:
|
|
4235
|
-
backgroundColor:
|
|
4236
|
-
color:
|
|
4234
|
+
borderColor: N.value === e ? "var(--tpl-primary)" : "var(--tpl-border)",
|
|
4235
|
+
backgroundColor: N.value === e ? "var(--tpl-primary-light)" : "var(--tpl-bg)",
|
|
4236
|
+
color: N.value === e ? "var(--tpl-primary)" : "var(--tpl-text)"
|
|
4237
4237
|
}),
|
|
4238
|
-
onClick: (t) =>
|
|
4238
|
+
onClick: (t) => N.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
4241
|
value: re.value,
|
|
@@ -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: L.value?.width?.toString() || "",
|
|
4251
|
+
onInput: z
|
|
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: F.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,10 +4259,10 @@ 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:
|
|
4263
|
-
onInput:
|
|
4262
|
+
placeholder: L.value?.height?.toString() || "",
|
|
4263
|
+
onInput: de
|
|
4264
4264
|
}, null, 40, Jn), w("span", Yn, p(v(a).mediaLibrary.cropPixels), 1)])])]),
|
|
4265
|
-
|
|
4265
|
+
ce.value ? (o(), g("div", Xn, [w("span", null, p(v(a).mediaLibrary.cropOutputSize) + ": ", 1), w("span", Zn, p(ce.value.width) + " x " + p(ce.value.height) + " " + p(v(a).mediaLibrary.cropPixels), 1)])) : _("", !0)
|
|
4266
4266
|
])])) : _("", !0),
|
|
4267
4267
|
w("div", Qn, [w("label", $n, p(v(a).mediaLibrary.fileName), 1), n(w("input", {
|
|
4268
4268
|
"onUpdate:modelValue": r[0] ||= (e) => A.value = e,
|
|
@@ -4273,10 +4273,10 @@ var Dn = ["data-tpl-theme"], On = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, kn
|
|
|
4273
4273
|
"background-color": "var(--tpl-bg)",
|
|
4274
4274
|
color: "var(--tpl-text)"
|
|
4275
4275
|
},
|
|
4276
|
-
autofocus: !
|
|
4276
|
+
autofocus: !oe.value
|
|
4277
4277
|
}, null, 8, er), [[S, A.value]])]),
|
|
4278
4278
|
v(D)(e.item.mime_type) ? (o(), g("div", tr, [w("label", nr, p(v(a).mediaLibrary.altText), 1), n(w("input", {
|
|
4279
|
-
"onUpdate:modelValue": r[1] ||= (e) =>
|
|
4279
|
+
"onUpdate:modelValue": r[1] ||= (e) => M.value = e,
|
|
4280
4280
|
type: "text",
|
|
4281
4281
|
class: "tpl:w-full tpl:rounded-md tpl:border tpl:px-3 tpl:py-1.5 tpl:text-xs tpl:outline-none",
|
|
4282
4282
|
style: {
|
|
@@ -4285,7 +4285,7 @@ var Dn = ["data-tpl-theme"], On = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, kn
|
|
|
4285
4285
|
color: "var(--tpl-text)"
|
|
4286
4286
|
},
|
|
4287
4287
|
placeholder: v(a).mediaLibrary.altTextPlaceholder
|
|
4288
|
-
}, null, 8, rr), [[S,
|
|
4288
|
+
}, null, 8, rr), [[S, M.value]])])) : _("", !0)
|
|
4289
4289
|
]),
|
|
4290
4290
|
w("div", ir, [w("button", {
|
|
4291
4291
|
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",
|
|
@@ -4298,9 +4298,9 @@ var Dn = ["data-tpl-theme"], On = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, kn
|
|
|
4298
4298
|
}, p(v(a).mediaLibrary.cancel), 1), w("button", {
|
|
4299
4299
|
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",
|
|
4300
4300
|
style: { background: "linear-gradient(\n 135deg,\n var(--tpl-primary),\n var(--tpl-primary-hover)\n )" },
|
|
4301
|
-
disabled:
|
|
4302
|
-
onClick:
|
|
4303
|
-
}, p(
|
|
4301
|
+
disabled: R.value,
|
|
4302
|
+
onClick: fe
|
|
4303
|
+
}, p(R.value ? v(a).mediaLibrary.saving : v(a).mediaLibrary.saveChanges), 9, ar)])
|
|
4304
4304
|
], 2)], 40, Dn)) : _("", !0)]),
|
|
4305
4305
|
_: 1
|
|
4306
4306
|
})], 8, ["to"]));
|
|
@@ -4328,31 +4328,31 @@ 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 } =
|
|
4332
|
-
function
|
|
4333
|
-
for (let n of e) if (n.id === t || n.children &&
|
|
4331
|
+
let i = e, a = t, { t: s } = B(), 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 : te(i.folder.children, i.currentFolderId)), M = h(() => l.value || ee.value);
|
|
4332
|
+
function te(e, t) {
|
|
4333
|
+
for (let n of e) if (n.id === t || n.children && te(n.children, t)) return !0;
|
|
4334
4334
|
return !1;
|
|
4335
4335
|
}
|
|
4336
|
-
function
|
|
4336
|
+
function P() {
|
|
4337
4337
|
l.value = !l.value;
|
|
4338
4338
|
}
|
|
4339
|
-
function
|
|
4339
|
+
function ne() {
|
|
4340
4340
|
u.value = !0, m.value = i.folder.name;
|
|
4341
4341
|
}
|
|
4342
4342
|
function re() {
|
|
4343
4343
|
let e = m.value.trim();
|
|
4344
4344
|
e && e !== i.folder.name && a("renameFolder", i.folder.id, e), u.value = !1, m.value = "";
|
|
4345
4345
|
}
|
|
4346
|
-
function
|
|
4346
|
+
function I() {
|
|
4347
4347
|
u.value = !1, m.value = "";
|
|
4348
4348
|
}
|
|
4349
|
-
function
|
|
4349
|
+
function L() {
|
|
4350
4350
|
x.value = !0, T.value = "", l.value = !0;
|
|
4351
4351
|
}
|
|
4352
|
-
function
|
|
4352
|
+
function ie() {
|
|
4353
4353
|
T.value.trim() && a("createFolder", T.value.trim(), i.folder.id), x.value = !1, T.value = "";
|
|
4354
4354
|
}
|
|
4355
|
-
function
|
|
4355
|
+
function R() {
|
|
4356
4356
|
x.value = !1, T.value = "";
|
|
4357
4357
|
}
|
|
4358
4358
|
return (t, i) => {
|
|
@@ -4368,16 +4368,16 @@ 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(P, ["stop"])
|
|
4372
|
+
}, [j(v(N), {
|
|
4373
|
+
class: C(["tpl:transition-transform tpl:duration-150", { "tpl:rotate-90": M.value }]),
|
|
4374
4374
|
size: 10,
|
|
4375
4375
|
"stroke-width": 2
|
|
4376
4376
|
}, null, 8, ["class"])])) : (o(), g("span", sr)),
|
|
4377
4377
|
w("button", {
|
|
4378
4378
|
class: "tpl:flex tpl:min-w-0 tpl:flex-1 tpl:items-center tpl:gap-1.5",
|
|
4379
4379
|
onClick: i[0] ||= (t) => a("navigate", e.folder.id)
|
|
4380
|
-
}, [j(v(
|
|
4380
|
+
}, [j(v(pe), {
|
|
4381
4381
|
class: "tpl:shrink-0",
|
|
4382
4382
|
size: 14,
|
|
4383
4383
|
"stroke-width": 1.5
|
|
@@ -4393,7 +4393,7 @@ var Dn = ["data-tpl-theme"], On = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, kn
|
|
|
4393
4393
|
color: "var(--tpl-text)"
|
|
4394
4394
|
},
|
|
4395
4395
|
autofocus: "",
|
|
4396
|
-
onKeydown: [f(re, ["enter"]), f(
|
|
4396
|
+
onKeydown: [f(re, ["enter"]), f(I, ["escape"])],
|
|
4397
4397
|
onBlur: re,
|
|
4398
4398
|
onClick: i[2] ||= y(() => {}, ["stop"])
|
|
4399
4399
|
}, null, 544)), [[S, m.value]]) : _("", !0),
|
|
@@ -4402,29 +4402,29 @@ 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(
|
|
4406
|
-
}, [j(v(
|
|
4405
|
+
onClick: y(L, ["stop"])
|
|
4406
|
+
}, [j(v(he), {
|
|
4407
4407
|
size: 12,
|
|
4408
4408
|
"stroke-width": 2
|
|
4409
4409
|
})], 8, ur)) : _("", !0),
|
|
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(ne, ["stop"])
|
|
4414
|
+
}, [j(v(F), {
|
|
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(ce), {
|
|
4422
4422
|
size: 12,
|
|
4423
4423
|
"stroke-width": 2,
|
|
4424
4424
|
style: { color: "var(--tpl-danger)" }
|
|
4425
4425
|
})])
|
|
4426
4426
|
]))
|
|
4427
|
-
], 4),
|
|
4427
|
+
], 4), M.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(ie, ["enter"]), f(R, ["escape"])],
|
|
4456
|
+
onBlur: ie
|
|
4457
4457
|
}, null, 40, pr), [[S, T.value]])], 4)) : _("", !0)])) : _("", !0)]);
|
|
4458
4458
|
};
|
|
4459
4459
|
}
|
|
@@ -4476,7 +4476,7 @@ var Dn = ["data-tpl-theme"], On = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, kn
|
|
|
4476
4476
|
"showFrequentlyUsed"
|
|
4477
4477
|
],
|
|
4478
4478
|
setup(e, { emit: t }) {
|
|
4479
|
-
let r = t, { t: i } =
|
|
4479
|
+
let r = t, { t: i } = B(), a = d(!1), s = d("");
|
|
4480
4480
|
function l() {
|
|
4481
4481
|
a.value = !0, s.value = "";
|
|
4482
4482
|
}
|
|
@@ -4494,7 +4494,7 @@ var Dn = ["data-tpl-theme"], On = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, kn
|
|
|
4494
4494
|
color: e.viewMode === "files" && e.currentFolderId === null ? "var(--tpl-primary)" : "var(--tpl-text)"
|
|
4495
4495
|
}),
|
|
4496
4496
|
onClick: d[0] ||= (e) => r("navigate", null)
|
|
4497
|
-
}, [j(v(
|
|
4497
|
+
}, [j(v(ye), {
|
|
4498
4498
|
size: 14,
|
|
4499
4499
|
"stroke-width": 1.5
|
|
4500
4500
|
}), k(" " + p(v(i).mediaLibrary.allFiles), 1)], 4),
|
|
@@ -4527,7 +4527,7 @@ var Dn = ["data-tpl-theme"], On = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, kn
|
|
|
4527
4527
|
class: "tpl:flex tpl:w-full tpl:items-center tpl:gap-2 tpl:px-3 tpl:py-2 tpl:text-left tpl:text-xs tpl:transition-all tpl:duration-150",
|
|
4528
4528
|
style: { color: "var(--tpl-text-muted)" },
|
|
4529
4529
|
onClick: l
|
|
4530
|
-
}, [j(v(
|
|
4530
|
+
}, [j(v(he), {
|
|
4531
4531
|
size: 14,
|
|
4532
4532
|
"stroke-width": 1.5
|
|
4533
4533
|
}), k(" " + p(v(i).mediaLibrary.newFolder), 1)])),
|
|
@@ -4541,7 +4541,7 @@ var Dn = ["data-tpl-theme"], On = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, kn
|
|
|
4541
4541
|
color: e.viewMode === "frequently-used" ? "var(--tpl-primary)" : "var(--tpl-text)"
|
|
4542
4542
|
}),
|
|
4543
4543
|
onClick: d[6] ||= (e) => r("showFrequentlyUsed")
|
|
4544
|
-
}, [j(v(
|
|
4544
|
+
}, [j(v(ve), {
|
|
4545
4545
|
size: 14,
|
|
4546
4546
|
"stroke-width": 1.5
|
|
4547
4547
|
}), k(" " + p(v(i).mediaLibrary.frequentlyUsed), 1)], 4)) : _("", !0)
|
|
@@ -4758,7 +4758,7 @@ var Dn = ["data-tpl-theme"], On = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, kn
|
|
|
4758
4758
|
}, Yr = {
|
|
4759
4759
|
key: 4,
|
|
4760
4760
|
class: "tpl:flex tpl:justify-center tpl:py-4"
|
|
4761
|
-
}, Xr = /*#__PURE__*/
|
|
4761
|
+
}, Xr = /*#__PURE__*/ I(/* @__PURE__ */ A({
|
|
4762
4762
|
__name: "MediaGrid",
|
|
4763
4763
|
props: {
|
|
4764
4764
|
items: {},
|
|
@@ -4776,15 +4776,15 @@ var Dn = ["data-tpl-theme"], On = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, kn
|
|
|
4776
4776
|
"replace"
|
|
4777
4777
|
],
|
|
4778
4778
|
setup(e, { emit: t }) {
|
|
4779
|
-
let n = e, r = t, { isAcceptedMimeType: i, isImageMimeType: a } =
|
|
4779
|
+
let n = e, r = t, { isAcceptedMimeType: i, isImageMimeType: a } = De();
|
|
4780
4780
|
function s(e) {
|
|
4781
4781
|
return !n.accept || n.accept.length === 0 || i(e.mime_type, n.accept);
|
|
4782
4782
|
}
|
|
4783
4783
|
function l(e) {
|
|
4784
4784
|
r("select", e);
|
|
4785
4785
|
}
|
|
4786
|
-
let { t: u } =
|
|
4787
|
-
|
|
4786
|
+
let { t: u } = B(), f = d(null);
|
|
4787
|
+
ue(f, ([{ isIntersecting: e }]) => {
|
|
4788
4788
|
e && n.hasMore && !n.isLoading && r("loadMore");
|
|
4789
4789
|
}, { threshold: .1 });
|
|
4790
4790
|
function m(e) {
|
|
@@ -4805,7 +4805,7 @@ var Dn = ["data-tpl-theme"], On = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, kn
|
|
|
4805
4805
|
key: t,
|
|
4806
4806
|
class: C(["tpl-pulse tpl:rounded-lg", e.layout === "list" ? "tpl:h-12" : "tpl:aspect-square"]),
|
|
4807
4807
|
style: { "background-color": "var(--tpl-bg-hover)" }
|
|
4808
|
-
}, null, 2)), 64))], 2)) : e.items.length === 0 ? (o(), g("div", Cr, [j(v(
|
|
4808
|
+
}, null, 2)), 64))], 2)) : e.items.length === 0 ? (o(), g("div", Cr, [j(v(ye), {
|
|
4809
4809
|
class: "tpl:mb-3",
|
|
4810
4810
|
size: 40,
|
|
4811
4811
|
"stroke-width": 1,
|
|
@@ -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(F), {
|
|
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(de), {
|
|
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(te), {
|
|
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(F), {
|
|
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(de), {
|
|
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(te), {
|
|
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(M), {
|
|
4900
4900
|
class: "tpl-spinner",
|
|
4901
4901
|
size: 20,
|
|
4902
4902
|
"stroke-width": 2,
|
|
@@ -4926,7 +4926,7 @@ var Dn = ["data-tpl-theme"], On = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, kn
|
|
|
4926
4926
|
},
|
|
4927
4927
|
emits: ["import", "close"],
|
|
4928
4928
|
setup(e, { emit: t }) {
|
|
4929
|
-
let r = e, i = t, { t: a } =
|
|
4929
|
+
let r = e, i = t, { t: a } = B(), s = l("tplUiTheme"), c = l(Ne, d(null)), f = d("");
|
|
4930
4930
|
ee(() => r.visible, (e) => {
|
|
4931
4931
|
e && (f.value = "");
|
|
4932
4932
|
});
|
|
@@ -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(M), {
|
|
4989
4989
|
class: "tpl:animate-spin",
|
|
4990
4990
|
size: 12,
|
|
4991
4991
|
"stroke-width": 2
|
|
@@ -5006,7 +5006,7 @@ var Dn = ["data-tpl-theme"], On = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, kn
|
|
|
5006
5006
|
},
|
|
5007
5007
|
emits: ["select", "close"],
|
|
5008
5008
|
setup(e, { emit: t }) {
|
|
5009
|
-
let n = t, { t: r } =
|
|
5009
|
+
let n = t, { t: r } = B(), i = d(null);
|
|
5010
5010
|
function a(e, t = 0) {
|
|
5011
5011
|
let n = [];
|
|
5012
5012
|
for (let r of e) n.push({
|
|
@@ -5016,7 +5016,7 @@ var Dn = ["data-tpl-theme"], On = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, kn
|
|
|
5016
5016
|
}), r.children?.length && n.push(...a(r.children, t + 1));
|
|
5017
5017
|
return n;
|
|
5018
5018
|
}
|
|
5019
|
-
return
|
|
5019
|
+
return se(i, () => {
|
|
5020
5020
|
n("close");
|
|
5021
5021
|
}), (t, s) => (o(), g("div", {
|
|
5022
5022
|
ref_key: "pickerRef",
|
|
@@ -5031,7 +5031,7 @@ var Dn = ["data-tpl-theme"], On = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, kn
|
|
|
5031
5031
|
class: "tpl:flex tpl:w-full tpl:items-center tpl:gap-1.5 tpl:px-3 tpl:py-1.5 tpl:text-left tpl:text-xs tpl:transition-colors tpl:duration-100",
|
|
5032
5032
|
style: { color: "var(--tpl-text)" },
|
|
5033
5033
|
onClick: s[0] ||= (e) => n("select", null)
|
|
5034
|
-
}, [j(v(
|
|
5034
|
+
}, [j(v(ye), {
|
|
5035
5035
|
class: "tpl:shrink-0",
|
|
5036
5036
|
size: 14,
|
|
5037
5037
|
"stroke-width": 1.5
|
|
@@ -5046,7 +5046,7 @@ var Dn = ["data-tpl-theme"], On = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, kn
|
|
|
5046
5046
|
disabled: t.id === e.currentFolderId,
|
|
5047
5047
|
onClick: (e) => n("select", t.id)
|
|
5048
5048
|
}, [
|
|
5049
|
-
j(v(
|
|
5049
|
+
j(v(pe), {
|
|
5050
5050
|
class: "tpl:shrink-0",
|
|
5051
5051
|
size: 14,
|
|
5052
5052
|
"stroke-width": 1.5
|
|
@@ -5071,7 +5071,7 @@ var Dn = ["data-tpl-theme"], On = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, kn
|
|
|
5071
5071
|
}, xi = {
|
|
5072
5072
|
class: "tpl:block tpl:text-[10px]",
|
|
5073
5073
|
style: { color: "var(--tpl-text-muted)" }
|
|
5074
|
-
}, Si = ["value"], Ci = ["value"], wi = /*#__PURE__*/
|
|
5074
|
+
}, Si = ["value"], Ci = ["value"], wi = /*#__PURE__*/ I(/* @__PURE__ */ A({
|
|
5075
5075
|
__name: "MediaPreviewPanel",
|
|
5076
5076
|
props: {
|
|
5077
5077
|
item: {},
|
|
@@ -5080,7 +5080,7 @@ var Dn = ["data-tpl-theme"], On = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, kn
|
|
|
5080
5080
|
},
|
|
5081
5081
|
emits: ["update:selectedConversion"],
|
|
5082
5082
|
setup(e, { emit: t }) {
|
|
5083
|
-
let n = e, r = t, { t: i } =
|
|
5083
|
+
let n = e, r = t, { t: i } = B(), { isImageMimeType: a } = De(), s = h(() => {
|
|
5084
5084
|
if (!y.value || !n.item.conversions_generated) return [];
|
|
5085
5085
|
let e = [];
|
|
5086
5086
|
return n.item.small_url && e.push({
|
|
@@ -5157,7 +5157,7 @@ var Dn = ["data-tpl-theme"], On = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, kn
|
|
|
5157
5157
|
y.value && e.item.width && e.item.height ? (o(), g(O, { key: 0 }, [k(" · " + p(e.item.width) + "×" + p(e.item.height) + "px ", 1)], 64)) : _("", !0),
|
|
5158
5158
|
m.value ? (o(), g(O, { key: 1 }, [
|
|
5159
5159
|
n[0] ||= k(" · ", -1),
|
|
5160
|
-
j(v(
|
|
5160
|
+
j(v(pe), {
|
|
5161
5161
|
class: "tpl:mb-px tpl:inline",
|
|
5162
5162
|
size: 9,
|
|
5163
5163
|
"stroke-width": 2
|
|
@@ -5223,7 +5223,7 @@ var Dn = ["data-tpl-theme"], On = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, kn
|
|
|
5223
5223
|
},
|
|
5224
5224
|
emits: ["replace", "close"],
|
|
5225
5225
|
setup(e, { emit: t }) {
|
|
5226
|
-
let n = e, r = t, { t: i } =
|
|
5226
|
+
let n = e, r = t, { t: i } = B(), a = l("tplUiTheme"), s = l(Ne, d(null)), c = d(null), f = d(null), S = h(() => {
|
|
5227
5227
|
if (!n.item) return "";
|
|
5228
5228
|
let e = n.item.filename.split(".");
|
|
5229
5229
|
return e.length > 1 ? e[e.length - 1].toLowerCase() : "";
|
|
@@ -5314,7 +5314,7 @@ var Dn = ["data-tpl-theme"], On = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, kn
|
|
|
5314
5314
|
},
|
|
5315
5315
|
emits: ["upload"],
|
|
5316
5316
|
setup(e, { emit: t }) {
|
|
5317
|
-
let n = t, { t: r, format: i } =
|
|
5317
|
+
let n = t, { t: r, format: i } = B(), { allAcceptedMimeTypes: a, allAcceptedInputString: s, maxFileSize: c } = De(), l = d();
|
|
5318
5318
|
function u(e) {
|
|
5319
5319
|
let t = [];
|
|
5320
5320
|
for (let n of Array.from(e)) a.value.includes(n.type) && n.size <= c.value && t.push(n);
|
|
@@ -5324,9 +5324,9 @@ 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 } = R(l, { onDrop: (e) => {
|
|
5328
5328
|
e?.length && f(e);
|
|
5329
|
-
} }), { open: h, onChange: _ } =
|
|
5329
|
+
} }), { open: h, onChange: _ } = ne({
|
|
5330
5330
|
accept: s.value,
|
|
5331
5331
|
multiple: !0
|
|
5332
5332
|
});
|
|
@@ -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(M), {
|
|
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(L), {
|
|
5354
5354
|
class: "tpl:mb-2",
|
|
5355
5355
|
size: 24,
|
|
5356
5356
|
"stroke-width": 1.5,
|
|
@@ -5392,7 +5392,7 @@ var Dn = ["data-tpl-theme"], On = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, kn
|
|
|
5392
5392
|
size: {}
|
|
5393
5393
|
},
|
|
5394
5394
|
setup(e) {
|
|
5395
|
-
let t = e, { t: n, format: r } =
|
|
5395
|
+
let t = e, { t: n, format: r } = B(), i = d(!1), a = h(() => t.size ?? 24), s = h(() => Math.max(2, a.value / 8)), c = h(() => (a.value - s.value) / 2), l = h(() => 2 * Math.PI * c.value), f = h(() => t.limitBytes <= 0 ? 0 : Math.min(100, t.usedBytes / t.limitBytes * 100)), m = h(() => l.value - f.value / 100 * l.value), v = h(() => f.value >= 95 ? "var(--tpl-danger)" : f.value >= 75 ? "var(--tpl-warning, #f59e0b)" : "var(--tpl-primary)");
|
|
5396
5396
|
function y(e) {
|
|
5397
5397
|
if (e === 0) return "0 B";
|
|
5398
5398
|
let t = 1024, n = [
|
|
@@ -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 = re((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 } = oe({
|
|
5491
5491
|
copiedDuring: 2e3,
|
|
5492
5492
|
legacy: !0
|
|
5493
5493
|
});
|
|
@@ -5515,19 +5515,19 @@ function Xi(e) {
|
|
|
5515
5515
|
async function j(e) {
|
|
5516
5516
|
await t.importFromUrl(e) && (u.value = !1);
|
|
5517
5517
|
}
|
|
5518
|
-
async function
|
|
5518
|
+
async function M(e) {
|
|
5519
5519
|
f.value = !1, await t.moveSelected(e);
|
|
5520
5520
|
}
|
|
5521
|
-
async function
|
|
5521
|
+
async function te() {
|
|
5522
5522
|
await t.checkUsageBeforeDelete();
|
|
5523
5523
|
}
|
|
5524
|
-
function
|
|
5524
|
+
function N(e) {
|
|
5525
5525
|
t.checkUsageBeforeReplace(e);
|
|
5526
5526
|
}
|
|
5527
|
-
async function
|
|
5527
|
+
async function P(e) {
|
|
5528
5528
|
await t.replaceFile(e);
|
|
5529
5529
|
}
|
|
5530
|
-
function
|
|
5530
|
+
function ne() {
|
|
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 {
|
|
@@ -5554,11 +5554,11 @@ function Xi(e) {
|
|
|
5554
5554
|
handleEditItem: k,
|
|
5555
5555
|
handleEditSave: A,
|
|
5556
5556
|
handleImportFromUrl: j,
|
|
5557
|
-
handleMoveToFolder:
|
|
5558
|
-
handleDeleteClick:
|
|
5559
|
-
handleReplaceItem:
|
|
5560
|
-
handleReplaceFile:
|
|
5561
|
-
resetUI:
|
|
5557
|
+
handleMoveToFolder: M,
|
|
5558
|
+
handleDeleteClick: te,
|
|
5559
|
+
handleReplaceItem: N,
|
|
5560
|
+
handleReplaceFile: P,
|
|
5561
|
+
resetUI: ne
|
|
5562
5562
|
};
|
|
5563
5563
|
}
|
|
5564
5564
|
//#endregion
|
|
@@ -5638,9 +5638,9 @@ var Zi = ["data-tpl-theme"], Qi = {
|
|
|
5638
5638
|
},
|
|
5639
5639
|
emits: ["close", "select"],
|
|
5640
5640
|
setup(e, { emit: t }) {
|
|
5641
|
-
let n = e, r = t, { t: i } =
|
|
5642
|
-
s(
|
|
5643
|
-
let d = l("authManager"), f = l("projectId"), S = h(() => f.value), T = l("planConfig"), A = h(() => T.hasFeature("media_folders")),
|
|
5641
|
+
let n = e, r = t, { t: i } = B(), a = l("tplUiTheme");
|
|
5642
|
+
s(Ne, 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")), M = 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: ne, availableCategories: re } = De(), F = Se({
|
|
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 L(e) {
|
|
5655
5655
|
e.key === "Escape" && r("close");
|
|
5656
5656
|
}
|
|
5657
|
-
|
|
5658
|
-
function
|
|
5659
|
-
return F.previewItem.value ? !n.accept?.length ||
|
|
5657
|
+
ie(document, "keydown", L);
|
|
5658
|
+
function R() {
|
|
5659
|
+
return F.previewItem.value ? !n.accept?.length || ne(F.previewItem.value.mime_type, n.accept) : !1;
|
|
5660
5660
|
}
|
|
5661
|
-
function
|
|
5662
|
-
if (
|
|
5661
|
+
function oe() {
|
|
5662
|
+
if (R()) {
|
|
5663
5663
|
let e = F.previewItem.value;
|
|
5664
5664
|
r("select", {
|
|
5665
5665
|
...e,
|
|
@@ -5698,7 +5698,7 @@ var Zi = ["data-tpl-theme"], Qi = {
|
|
|
5698
5698
|
},
|
|
5699
5699
|
placeholder: v(i).mediaLibrary.searchPlaceholder,
|
|
5700
5700
|
onInput: n[0] ||= (e) => v(I).handleSearchInput(e.target.value)
|
|
5701
|
-
}, null, 40, ra), j(v(
|
|
5701
|
+
}, null, 40, ra), j(v(be), {
|
|
5702
5702
|
class: "tpl:absolute tpl:top-1/2 tpl:left-2.5 tpl:-translate-y-1/2",
|
|
5703
5703
|
size: 13,
|
|
5704
5704
|
"stroke-width": 2,
|
|
@@ -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(le), {
|
|
5712
5712
|
size: 18,
|
|
5713
5713
|
"stroke-width": 2
|
|
5714
5714
|
})])
|
|
@@ -5754,11 +5754,11 @@ var Zi = ["data-tpl-theme"], Qi = {
|
|
|
5754
5754
|
}),
|
|
5755
5755
|
title: v(I).showSidebar.value ? v(i).mediaLibrary.hideFolders : v(i).mediaLibrary.showFolders,
|
|
5756
5756
|
onClick: n[2] ||= (e) => v(I).showSidebar.value = !v(I).showSidebar.value
|
|
5757
|
-
}, [j(v(
|
|
5757
|
+
}, [j(v(_e), {
|
|
5758
5758
|
size: 16,
|
|
5759
5759
|
"stroke-width": 2
|
|
5760
5760
|
})], 12, la)) : _("", !0),
|
|
5761
|
-
v(F).viewMode.value === "frequently-used" ? (o(), g("span", ua, p(v(i).mediaLibrary.frequentlyUsed), 1)) : (o(), b(
|
|
5761
|
+
v(F).viewMode.value === "frequently-used" ? (o(), g("span", ua, p(v(i).mediaLibrary.frequentlyUsed), 1)) : (o(), b(Ee, {
|
|
5762
5762
|
key: 2,
|
|
5763
5763
|
folders: v(F).folders.value,
|
|
5764
5764
|
"current-folder-id": v(F).currentFolderId.value,
|
|
@@ -5776,7 +5776,7 @@ var Zi = ["data-tpl-theme"], Qi = {
|
|
|
5776
5776
|
}),
|
|
5777
5777
|
title: v(i).mediaLibrary.viewGrid,
|
|
5778
5778
|
onClick: n[3] ||= (e) => v(I).layoutMode.value = "grid"
|
|
5779
|
-
}, [j(v(
|
|
5779
|
+
}, [j(v(ge), {
|
|
5780
5780
|
size: 14,
|
|
5781
5781
|
"stroke-width": 2
|
|
5782
5782
|
})], 12, fa), w("button", {
|
|
@@ -5787,11 +5787,11 @@ var Zi = ["data-tpl-theme"], Qi = {
|
|
|
5787
5787
|
}),
|
|
5788
5788
|
title: v(i).mediaLibrary.viewList,
|
|
5789
5789
|
onClick: n[4] ||= (e) => v(I).layoutMode.value = "list"
|
|
5790
|
-
}, [j(v(
|
|
5790
|
+
}, [j(v(me), {
|
|
5791
5791
|
size: 14,
|
|
5792
5792
|
"stroke-width": 2
|
|
5793
5793
|
})], 12, pa)])
|
|
5794
|
-
]), w("div", ma, [v(
|
|
5794
|
+
]), w("div", ma, [v(re).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(re), (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
|
+
]), M.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: {
|
|
@@ -5837,7 +5837,7 @@ var Zi = ["data-tpl-theme"], Qi = {
|
|
|
5837
5837
|
"background-color": "var(--tpl-bg)"
|
|
5838
5838
|
},
|
|
5839
5839
|
onClick: n[7] ||= (e) => v(I).showImportUrlModal.value = !0
|
|
5840
|
-
}, [j(v(
|
|
5840
|
+
}, [j(v(fe), {
|
|
5841
5841
|
size: 14,
|
|
5842
5842
|
"stroke-width": 2
|
|
5843
5843
|
}), k(" " + p(v(i).mediaLibrary.importFromUrl), 1)])) : _("", !0)])) : _("", !0), j(Xr, {
|
|
@@ -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(te), {
|
|
5976
5976
|
key: 1,
|
|
5977
5977
|
size: 12,
|
|
5978
5978
|
"stroke-width": 2
|
|
5979
|
-
})) : (o(), b(v(
|
|
5979
|
+
})) : (o(), b(v(ae), {
|
|
5980
5980
|
key: 0,
|
|
5981
5981
|
size: 12,
|
|
5982
5982
|
"stroke-width": 2
|
|
@@ -6013,8 +6013,8 @@ var Zi = ["data-tpl-theme"], Qi = {
|
|
|
6013
6013
|
"background-color": "var(--tpl-primary)",
|
|
6014
6014
|
color: "var(--tpl-bg)"
|
|
6015
6015
|
},
|
|
6016
|
-
disabled: !
|
|
6017
|
-
onClick:
|
|
6016
|
+
disabled: !R(),
|
|
6017
|
+
onClick: oe
|
|
6018
6018
|
}, p(e.accept?.length ? v(i).mediaLibrary.selectImage : v(i).mediaLibrary.selectFile), 9, Ba)])])])
|
|
6019
6019
|
])], 8, Zi)) : _("", !0)]),
|
|
6020
6020
|
_: 1
|
|
@@ -6022,6 +6022,6 @@ var Zi = ["data-tpl-theme"], Qi = {
|
|
|
6022
6022
|
}
|
|
6023
6023
|
});
|
|
6024
6024
|
//#endregion
|
|
6025
|
-
export { zi as a, ci as c, or as d,
|
|
6025
|
+
export { zi as a, ci as c, or as d, De as f, xe as g, Se as h, Wi as i, Xr as l, B as m, Xi as n, wi as o, Ee as p, Yi as r, pi as s, Va as t, yr as u };
|
|
6026
6026
|
|
|
6027
|
-
//# sourceMappingURL=media-library-
|
|
6027
|
+
//# sourceMappingURL=media-library-C5ogiZ4f.js.map
|