@templatical/editor 0.11.0 → 0.11.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{AiFeatureMenu-D4D2Sqfk.js → AiFeatureMenu-DBWcfcWl.js} +1 -1
- package/dist/{CloudEditor-CLwyq3kf.js → CloudEditor-C6cSXtcP.js} +155 -154
- package/dist/{CollaboratorBar-DjX-o5Pi.js → CollaboratorBar-B8-AQfG2.js} +1 -1
- package/dist/{ModuleBrowserModal-CVS4Sf7H.js → ModuleBrowserModal-B_tLzFAk.js} +4 -4
- package/dist/{ModulePreviewCanvas-C10YXsL_.js → ModulePreviewCanvas-B7pNpAHM.js} +1 -1
- package/dist/{ParagraphEditor-BKoqcKIt.js → ParagraphEditor-DmA9K7dx.js} +6 -6
- package/dist/{SaveModuleDialog-BMuIjxVn.js → SaveModuleDialog-B8ypoxdj.js} +2 -2
- package/dist/{SnapshotHistory-DZ5_W7e4.js → SnapshotHistory-BTHd7CVP.js} +1 -1
- package/dist/{TestEmailModal-EjpH-F-W.js → TestEmailModal-CBIFMzK6.js} +2 -2
- package/dist/{TitleEditor-Rv1deuV7.js → TitleEditor-C9jDA5lI.js} +1 -1
- package/dist/{TplModal-DSmCQIm4.js → TplModal-ND4fiqOS.js} +1 -1
- package/dist/{blockTypeIcons-OhEkQhYj.js → blockTypeIcons-Bn-_Smlm.js} +4 -4
- package/dist/bundle-stats.json +6 -6
- package/dist/cdn/chunks/{AiFeatureMenu-Dm9CL3u0.js → AiFeatureMenu-BuSO0dXP.js} +8 -8
- package/dist/cdn/chunks/{AiFeatureMenu-Dm9CL3u0.js.map → AiFeatureMenu-BuSO0dXP.js.map} +1 -1
- package/dist/cdn/chunks/{BlockIssueBadge-DjnFAeWq.js → BlockIssueBadge-sv3IZ1Pb.js} +5 -5
- package/dist/cdn/chunks/{BlockIssueBadge-DjnFAeWq.js.map → BlockIssueBadge-sv3IZ1Pb.js.map} +1 -1
- package/dist/cdn/chunks/{CloudEditor-XSmLmdgp.js → CloudEditor-hxoqsTsq.js} +236 -235
- package/dist/cdn/chunks/{CloudEditor-XSmLmdgp.js.map → CloudEditor-hxoqsTsq.js.map} +1 -1
- package/dist/cdn/chunks/{CollaboratorBar-BfoGJhns.js → CollaboratorBar-DFqsaNX0.js} +3 -3
- package/dist/cdn/chunks/{CollaboratorBar-BfoGJhns.js.map → CollaboratorBar-DFqsaNX0.js.map} +1 -1
- package/dist/cdn/chunks/{CountdownBlock-GRio55a1.js → CountdownBlock-PpH3fxAX.js} +2 -2
- package/dist/cdn/chunks/{CountdownBlock-GRio55a1.js.map → CountdownBlock-PpH3fxAX.js.map} +1 -1
- package/dist/cdn/chunks/{CountdownToolbar-Cd1oEopw.js → CountdownToolbar-CZN92Bhz.js} +3 -3
- package/dist/cdn/chunks/{CountdownToolbar-Cd1oEopw.js.map → CountdownToolbar-CZN92Bhz.js.map} +1 -1
- package/dist/cdn/chunks/{IssuesPanel-C-BiFQDQ.js → IssuesPanel-wQjrnuyc.js} +6 -6
- package/dist/cdn/chunks/{IssuesPanel-C-BiFQDQ.js.map → IssuesPanel-wQjrnuyc.js.map} +1 -1
- package/dist/cdn/chunks/{ModuleBrowserModal-Dj7gRT4Q.js → ModuleBrowserModal-348wCgft.js} +8 -8
- package/dist/cdn/chunks/{ModuleBrowserModal-Dj7gRT4Q.js.map → ModuleBrowserModal-348wCgft.js.map} +1 -1
- package/dist/cdn/chunks/{ModulePreviewCanvas-hwdveKb0.js → ModulePreviewCanvas-Cf6DUHml.js} +22 -22
- package/dist/cdn/chunks/{ModulePreviewCanvas-hwdveKb0.js.map → ModulePreviewCanvas-Cf6DUHml.js.map} +1 -1
- package/dist/cdn/chunks/{NumberWithSuffix-bE_6cfiA.js → NumberWithSuffix-Deo8EOSz.js} +2 -2
- package/dist/cdn/chunks/{NumberWithSuffix-bE_6cfiA.js.map → NumberWithSuffix-Deo8EOSz.js.map} +1 -1
- package/dist/cdn/chunks/{ParagraphEditor-y1kGJRBX.js → ParagraphEditor-Cbl_gBYM.js} +40 -40
- package/dist/cdn/chunks/{ParagraphEditor-y1kGJRBX.js.map → ParagraphEditor-Cbl_gBYM.js.map} +1 -1
- package/dist/cdn/chunks/{RichTextEditorContent-DPy9D4hc.js → RichTextEditorContent-TBPzn3RC.js} +4 -4
- package/dist/cdn/chunks/{RichTextEditorContent-DPy9D4hc.js.map → RichTextEditorContent-TBPzn3RC.js.map} +1 -1
- package/dist/cdn/chunks/{SaveModuleDialog-CPu5e2VG.js → SaveModuleDialog-CxdYMutK.js} +4 -4
- package/dist/cdn/chunks/{SaveModuleDialog-CPu5e2VG.js.map → SaveModuleDialog-CxdYMutK.js.map} +1 -1
- package/dist/cdn/chunks/{TitleEditor-CMzzOPye.js → TitleEditor--XulEf7R.js} +6 -6
- package/dist/cdn/chunks/{TitleEditor-CMzzOPye.js.map → TitleEditor--XulEf7R.js.map} +1 -1
- package/dist/cdn/chunks/{blockTypeIcons-BC5qpvuV.js → blockTypeIcons-BJND4L-A.js} +6 -6
- package/dist/cdn/chunks/{blockTypeIcons-BC5qpvuV.js.map → blockTypeIcons-BJND4L-A.js.map} +1 -1
- package/dist/{de-DIAGP7yH.js → cdn/chunks/de-BJMLpg_p.js} +6 -0
- package/dist/cdn/chunks/{de-DIAGP7yH.js.map → de-BJMLpg_p.js.map} +1 -1
- package/dist/{en-nqIW8Q9W.js → cdn/chunks/en-DFMMw7SL.js} +6 -0
- package/dist/cdn/chunks/{en-nqIW8Q9W.js.map → en-DFMMw7SL.js.map} +1 -1
- package/dist/cdn/chunks/{extensions-DH7ESsaz.js → extensions-BtWoLy6E.js} +23 -23
- package/dist/cdn/chunks/{extensions-DH7ESsaz.js.map → extensions-BtWoLy6E.js.map} +1 -1
- package/dist/cdn/chunks/{features-DmUOSthI.js → features-mO5NzwnN.js} +442 -432
- package/dist/cdn/chunks/features-mO5NzwnN.js.map +1 -0
- package/dist/cdn/chunks/{icons-DguD4x_X.js → icons-CuXm6XAT.js} +2 -2
- package/dist/cdn/chunks/{icons-DguD4x_X.js.map → icons-CuXm6XAT.js.map} +1 -1
- package/dist/cdn/chunks/{media-library-ClQUPxRM.js → media-library-BtNzYUTi.js} +525 -525
- package/dist/cdn/chunks/{media-library-ClQUPxRM.js.map → media-library-BtNzYUTi.js.map} +1 -1
- package/dist/cdn/chunks/{pt-BR-DCNnLLx9.js → pt-BR-C-9aWLlR.js} +5 -1
- package/dist/cdn/chunks/{pt-BR-DCNnLLx9.js.map → pt-BR-C-9aWLlR.js.map} +1 -1
- package/dist/cdn/chunks/{quality-CIw_7cXv.js → quality-YKe19zp8.js} +83 -83
- package/dist/cdn/chunks/{quality-CIw_7cXv.js.map → quality-YKe19zp8.js.map} +1 -1
- package/dist/cdn/chunks/{renderer-Bx8I7_Rb.js → renderer-BcOaxCs6.js} +20 -20
- package/dist/cdn/chunks/{renderer-Bx8I7_Rb.js.map → renderer-BcOaxCs6.js.map} +1 -1
- package/dist/cdn/chunks/{src-C-GlM149.js → src-B_ZRmuit.js} +63 -63
- package/dist/cdn/chunks/{src-C-GlM149.js.map → src-B_ZRmuit.js.map} +1 -1
- package/dist/cdn/chunks/{styles-CfqCvq0Z.js → styles-DDBCCJ-l.js} +218 -200
- package/dist/cdn/chunks/styles-DDBCCJ-l.js.map +1 -0
- package/dist/cdn/editor.css +1 -1
- package/dist/cdn/editor.js +105 -104
- package/dist/cdn/editor.js.map +1 -1
- package/dist/{cdn/chunks/de-DIAGP7yH.js → de-BJMLpg_p.js} +4 -2
- package/dist/{cdn/chunks/en-nqIW8Q9W.js → en-DFMMw7SL.js} +4 -2
- package/dist/index.d.ts +32 -0
- package/dist/{pt-BR-DCNnLLx9.js → pt-BR-C-9aWLlR.js} +4 -0
- package/dist/style.css +1 -1
- package/dist/{styles-D_ztiOsh.js → styles-DZcQGzsN.js} +514 -496
- package/dist/templatical-editor.js +117 -116
- package/dist/{useEditorCore-tZGAVvNz.js → useEditorCore-D00QzW07.js} +731 -721
- package/package.json +8 -8
- package/dist/cdn/chunks/features-DmUOSthI.js.map +0 -1
- package/dist/cdn/chunks/styles-CfqCvq0Z.js.map +0 -1
|
@@ -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-iAb7QVJo.js";
|
|
2
|
-
import {
|
|
3
|
-
import { B as
|
|
2
|
+
import { T as M, Tt as te, cn as N, dn as ne, fn as P, gt as F, ht as I, it as L, jt as R, kt as re, ln as z, lt as ie, mn as ae, ot as oe, sn as se, st as ce, un as le, w as B, yt as ue } from "./features-mO5NzwnN.js";
|
|
3
|
+
import { B as de, K as fe, L as pe, T as me, W as he, k as ge, p as _e, q as ve, y as ye } from "./icons-CuXm6XAT.js";
|
|
4
4
|
//#region ../media-library/src/api-client.ts
|
|
5
|
-
var
|
|
5
|
+
var be = 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 = `${
|
|
40
|
+
let n = t.toString(), r = `${M(B["media.browse"], this.baseParams)}${n ? `?${n}` : ""}`, i = await this.authManager.authenticatedFetch(r, { headers: { Accept: "application/json" } });
|
|
41
41
|
if (!i.ok) {
|
|
42
42
|
let e = await i.json().catch(() => ({ message: `HTTP error ${i.status}` }));
|
|
43
43
|
throw Error(e.message, { cause: e });
|
|
@@ -47,7 +47,7 @@ var Se = class {
|
|
|
47
47
|
async uploadMedia(e, t) {
|
|
48
48
|
let n = new FormData();
|
|
49
49
|
n.append("file", e), t && n.append("folder_id", t);
|
|
50
|
-
let r =
|
|
50
|
+
let r = M(B["media.upload"], this.baseParams), i = await this.authManager.authenticatedFetch(r, {
|
|
51
51
|
method: "POST",
|
|
52
52
|
headers: { Accept: "application/json" },
|
|
53
53
|
body: n
|
|
@@ -59,7 +59,7 @@ var Se = class {
|
|
|
59
59
|
return (await i.json()).data;
|
|
60
60
|
}
|
|
61
61
|
async updateMedia(e, t, n) {
|
|
62
|
-
return this.request(
|
|
62
|
+
return this.request(M(B["media.update"], {
|
|
63
63
|
...this.baseParams,
|
|
64
64
|
media: e
|
|
65
65
|
}), {
|
|
@@ -71,13 +71,13 @@ var Se = class {
|
|
|
71
71
|
});
|
|
72
72
|
}
|
|
73
73
|
async deleteMedia(e) {
|
|
74
|
-
return this.request(
|
|
74
|
+
return this.request(M(B["media.delete"], this.baseParams), {
|
|
75
75
|
method: "POST",
|
|
76
76
|
body: JSON.stringify({ ids: e })
|
|
77
77
|
});
|
|
78
78
|
}
|
|
79
79
|
async moveMedia(e, t) {
|
|
80
|
-
return this.request(
|
|
80
|
+
return this.request(M(B["media.move"], this.baseParams), {
|
|
81
81
|
method: "POST",
|
|
82
82
|
body: JSON.stringify({
|
|
83
83
|
ids: e,
|
|
@@ -86,10 +86,10 @@ var Se = class {
|
|
|
86
86
|
});
|
|
87
87
|
}
|
|
88
88
|
async getMediaFolders() {
|
|
89
|
-
return this.request(
|
|
89
|
+
return this.request(M(B["folders.index"], this.baseParams));
|
|
90
90
|
}
|
|
91
91
|
async createMediaFolder(e, t) {
|
|
92
|
-
return this.request(
|
|
92
|
+
return this.request(M(B["folders.store"], this.baseParams), {
|
|
93
93
|
method: "POST",
|
|
94
94
|
body: JSON.stringify({
|
|
95
95
|
name: e,
|
|
@@ -98,7 +98,7 @@ var Se = class {
|
|
|
98
98
|
});
|
|
99
99
|
}
|
|
100
100
|
async renameMediaFolder(e, t) {
|
|
101
|
-
return this.request(
|
|
101
|
+
return this.request(M(B["folders.update"], {
|
|
102
102
|
...this.baseParams,
|
|
103
103
|
mediaFolder: e
|
|
104
104
|
}), {
|
|
@@ -107,13 +107,13 @@ var Se = class {
|
|
|
107
107
|
});
|
|
108
108
|
}
|
|
109
109
|
async deleteMediaFolder(e) {
|
|
110
|
-
return this.request(
|
|
110
|
+
return this.request(M(B["folders.destroy"], {
|
|
111
111
|
...this.baseParams,
|
|
112
112
|
mediaFolder: e
|
|
113
113
|
}), { method: "DELETE" });
|
|
114
114
|
}
|
|
115
115
|
async checkMediaUsage(e) {
|
|
116
|
-
let t = await this.authManager.authenticatedFetch(
|
|
116
|
+
let t = await this.authManager.authenticatedFetch(M(B["media.checkUsage"], this.baseParams), {
|
|
117
117
|
method: "POST",
|
|
118
118
|
headers: {
|
|
119
119
|
"Content-Type": "application/json",
|
|
@@ -128,10 +128,10 @@ var Se = class {
|
|
|
128
128
|
return t.json();
|
|
129
129
|
}
|
|
130
130
|
async getFrequentlyUsed() {
|
|
131
|
-
return this.request(
|
|
131
|
+
return this.request(M(B["media.frequentlyUsed"], this.baseParams));
|
|
132
132
|
}
|
|
133
133
|
async importFromUrl(e, t) {
|
|
134
|
-
return this.request(
|
|
134
|
+
return this.request(M(B["media.importFromUrl"], this.baseParams), {
|
|
135
135
|
method: "POST",
|
|
136
136
|
body: JSON.stringify({
|
|
137
137
|
url: e,
|
|
@@ -142,7 +142,7 @@ var Se = class {
|
|
|
142
142
|
async replaceMedia(e, t) {
|
|
143
143
|
let n = new FormData();
|
|
144
144
|
n.append("file", t);
|
|
145
|
-
let r =
|
|
145
|
+
let r = M(B["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 xe(e) {
|
|
163
163
|
if (!e.projectId) throw Error("projectId is required for useMediaLibrary");
|
|
164
|
-
let t = new
|
|
164
|
+
let t = new be(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;
|
|
@@ -215,7 +215,7 @@ function Ce(e) {
|
|
|
215
215
|
a.value = "files", i.value = e, o.value = "", h.value = /* @__PURE__ */ new Set(), g.value = null, await k();
|
|
216
216
|
}
|
|
217
217
|
async function N() {
|
|
218
|
-
a.value = "frequently-used", i.value = null, o.value = "", h.value = /* @__PURE__ */ new Set(), g.value = null, await
|
|
218
|
+
a.value = "frequently-used", i.value = null, o.value = "", h.value = /* @__PURE__ */ new Set(), g.value = null, await R();
|
|
219
219
|
}
|
|
220
220
|
async function ne(r) {
|
|
221
221
|
u.value = !0;
|
|
@@ -228,7 +228,7 @@ function Ce(e) {
|
|
|
228
228
|
u.value = !1;
|
|
229
229
|
}
|
|
230
230
|
}
|
|
231
|
-
async function
|
|
231
|
+
async function P(r) {
|
|
232
232
|
u.value = !0, m.value = {
|
|
233
233
|
current: 0,
|
|
234
234
|
total: r.length
|
|
@@ -249,7 +249,7 @@ function Ce(e) {
|
|
|
249
249
|
u.value = !1, m.value = null;
|
|
250
250
|
}
|
|
251
251
|
}
|
|
252
|
-
async function
|
|
252
|
+
async function F(r) {
|
|
253
253
|
if (h.value.size !== 0) try {
|
|
254
254
|
let e = await t.moveMedia([...h.value], r);
|
|
255
255
|
if (i.value === null) {
|
|
@@ -261,7 +261,7 @@ function Ce(e) {
|
|
|
261
261
|
e.onError?.(t);
|
|
262
262
|
}
|
|
263
263
|
}
|
|
264
|
-
async function
|
|
264
|
+
async function I(r, i, a) {
|
|
265
265
|
try {
|
|
266
266
|
let e = await t.updateMedia(r, i, a);
|
|
267
267
|
n.value = n.value.map((t) => t.id === r ? e : t), g.value?.id === r && (g.value = e);
|
|
@@ -269,21 +269,21 @@ function Ce(e) {
|
|
|
269
269
|
e.onError?.(t);
|
|
270
270
|
}
|
|
271
271
|
}
|
|
272
|
-
async function
|
|
272
|
+
async function L() {
|
|
273
273
|
if (h.value.size !== 0) try {
|
|
274
274
|
await t.deleteMedia([...h.value]), n.value = n.value.filter((e) => !h.value.has(e.id)), _.value = _.value.filter((e) => !h.value.has(e.id)), h.value = /* @__PURE__ */ new Set(), g.value = null;
|
|
275
275
|
} catch (t) {
|
|
276
276
|
e.onError?.(t);
|
|
277
277
|
}
|
|
278
278
|
}
|
|
279
|
-
async function
|
|
279
|
+
async function R() {
|
|
280
280
|
try {
|
|
281
281
|
_.value = await t.getFrequentlyUsed();
|
|
282
282
|
} catch (t) {
|
|
283
283
|
e.onError?.(t);
|
|
284
284
|
}
|
|
285
285
|
}
|
|
286
|
-
async function
|
|
286
|
+
async function re() {
|
|
287
287
|
if (h.value.size === 0) return !1;
|
|
288
288
|
b.value = [...h.value];
|
|
289
289
|
try {
|
|
@@ -295,17 +295,17 @@ function Ce(e) {
|
|
|
295
295
|
return e.onError?.(t), !1;
|
|
296
296
|
}
|
|
297
297
|
}
|
|
298
|
-
async function
|
|
298
|
+
async function z() {
|
|
299
299
|
if (y.value = !1, b.value.length !== 0) try {
|
|
300
300
|
await t.deleteMedia(b.value), n.value = n.value.filter((e) => !b.value.includes(e.id)), _.value = _.value.filter((e) => !b.value.includes(e.id)), h.value = /* @__PURE__ */ new Set(), g.value = null, b.value = [], v.value = {};
|
|
301
301
|
} catch (t) {
|
|
302
302
|
e.onError?.(t);
|
|
303
303
|
}
|
|
304
304
|
}
|
|
305
|
-
function
|
|
305
|
+
function ie() {
|
|
306
306
|
y.value = !1, b.value = [], v.value = {};
|
|
307
307
|
}
|
|
308
|
-
async function
|
|
308
|
+
async function ae(r) {
|
|
309
309
|
x.value = !0, S.value = null;
|
|
310
310
|
try {
|
|
311
311
|
let e = await t.importFromUrl(r, i.value);
|
|
@@ -316,57 +316,57 @@ function Ce(e) {
|
|
|
316
316
|
x.value = !1;
|
|
317
317
|
}
|
|
318
318
|
}
|
|
319
|
-
function
|
|
319
|
+
function oe(e) {
|
|
320
320
|
let t = new Set(h.value);
|
|
321
321
|
t.has(e) ? t.delete(e) : t.add(e), h.value = t;
|
|
322
322
|
}
|
|
323
|
-
function
|
|
323
|
+
function se() {
|
|
324
324
|
h.value = /* @__PURE__ */ new Set(), g.value = null;
|
|
325
325
|
}
|
|
326
|
-
function
|
|
326
|
+
function ce(e) {
|
|
327
327
|
g.value = e, h.value = new Set([e.id]);
|
|
328
328
|
}
|
|
329
|
-
async function
|
|
329
|
+
async function le() {
|
|
330
330
|
try {
|
|
331
331
|
r.value = await t.getMediaFolders();
|
|
332
332
|
} catch (t) {
|
|
333
333
|
e.onError?.(t);
|
|
334
334
|
}
|
|
335
335
|
}
|
|
336
|
-
async function
|
|
336
|
+
async function B(n, r) {
|
|
337
337
|
try {
|
|
338
338
|
let e = await t.createMediaFolder(n, r);
|
|
339
|
-
return await
|
|
339
|
+
return await le(), e;
|
|
340
340
|
} catch (t) {
|
|
341
341
|
return e.onError?.(t), null;
|
|
342
342
|
}
|
|
343
343
|
}
|
|
344
|
-
function
|
|
344
|
+
function ue(e, t) {
|
|
345
345
|
for (let n of e) {
|
|
346
346
|
if (n.id === t) return n;
|
|
347
347
|
if (n.children) {
|
|
348
|
-
let e =
|
|
348
|
+
let e = ue(n.children, t);
|
|
349
349
|
if (e) return e;
|
|
350
350
|
}
|
|
351
351
|
}
|
|
352
352
|
return null;
|
|
353
353
|
}
|
|
354
|
-
async function
|
|
354
|
+
async function de(n, r) {
|
|
355
355
|
try {
|
|
356
|
-
await t.renameMediaFolder(n, r), await
|
|
356
|
+
await t.renameMediaFolder(n, r), await le();
|
|
357
357
|
} catch (t) {
|
|
358
358
|
e.onError?.(t);
|
|
359
359
|
}
|
|
360
360
|
}
|
|
361
|
-
async function
|
|
361
|
+
async function fe(n) {
|
|
362
362
|
try {
|
|
363
|
-
let e =
|
|
364
|
-
await t.deleteMediaFolder(n), i.value === n && (i.value = e), await
|
|
363
|
+
let e = ue(r.value, n)?.parent_id ?? null;
|
|
364
|
+
await t.deleteMediaFolder(n), i.value === n && (i.value = e), await le(), await k();
|
|
365
365
|
} catch (t) {
|
|
366
366
|
e.onError?.(t);
|
|
367
367
|
}
|
|
368
368
|
}
|
|
369
|
-
async function
|
|
369
|
+
async function pe(n) {
|
|
370
370
|
E.value = n, w.value = null;
|
|
371
371
|
try {
|
|
372
372
|
D.value = (await t.checkMediaUsage([n.id])).data[n.id] ?? null, T.value = !0;
|
|
@@ -374,10 +374,10 @@ function Ce(e) {
|
|
|
374
374
|
e.onError?.(t);
|
|
375
375
|
}
|
|
376
376
|
}
|
|
377
|
-
function
|
|
377
|
+
function me() {
|
|
378
378
|
T.value = !1, E.value = null, D.value = null, w.value = null;
|
|
379
379
|
}
|
|
380
|
-
async function
|
|
380
|
+
async function he(r) {
|
|
381
381
|
if (!E.value) return null;
|
|
382
382
|
C.value = !0, w.value = null;
|
|
383
383
|
try {
|
|
@@ -389,7 +389,7 @@ function Ce(e) {
|
|
|
389
389
|
C.value = !1;
|
|
390
390
|
}
|
|
391
391
|
}
|
|
392
|
-
async function
|
|
392
|
+
async function ge(r, i) {
|
|
393
393
|
try {
|
|
394
394
|
let e = await t.replaceMedia(r, i);
|
|
395
395
|
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;
|
|
@@ -422,39 +422,39 @@ function Ce(e) {
|
|
|
422
422
|
navigateToFolder: te,
|
|
423
423
|
showFrequentlyUsed: N,
|
|
424
424
|
uploadFile: ne,
|
|
425
|
-
uploadFiles:
|
|
426
|
-
moveSelected:
|
|
427
|
-
updateFile:
|
|
428
|
-
deleteSelected:
|
|
425
|
+
uploadFiles: P,
|
|
426
|
+
moveSelected: F,
|
|
427
|
+
updateFile: I,
|
|
428
|
+
deleteSelected: L,
|
|
429
429
|
isImportingFromUrl: x,
|
|
430
430
|
importFromUrlError: S,
|
|
431
|
-
importFromUrl:
|
|
432
|
-
toggleSelection:
|
|
433
|
-
clearSelection:
|
|
434
|
-
selectItem:
|
|
435
|
-
loadFolders:
|
|
436
|
-
createFolder:
|
|
437
|
-
renameFolder:
|
|
438
|
-
deleteFolder:
|
|
439
|
-
findFolderInTree:
|
|
440
|
-
loadFrequentlyUsed:
|
|
441
|
-
checkUsageBeforeDelete:
|
|
442
|
-
confirmDelete:
|
|
443
|
-
cancelDelete:
|
|
431
|
+
importFromUrl: ae,
|
|
432
|
+
toggleSelection: oe,
|
|
433
|
+
clearSelection: se,
|
|
434
|
+
selectItem: ce,
|
|
435
|
+
loadFolders: le,
|
|
436
|
+
createFolder: B,
|
|
437
|
+
renameFolder: de,
|
|
438
|
+
deleteFolder: fe,
|
|
439
|
+
findFolderInTree: ue,
|
|
440
|
+
loadFrequentlyUsed: R,
|
|
441
|
+
checkUsageBeforeDelete: re,
|
|
442
|
+
confirmDelete: z,
|
|
443
|
+
cancelDelete: ie,
|
|
444
444
|
isReplacing: C,
|
|
445
445
|
replaceError: w,
|
|
446
446
|
showReplaceWarning: T,
|
|
447
447
|
pendingReplaceItem: E,
|
|
448
448
|
replaceUsageInfo: D,
|
|
449
|
-
checkUsageBeforeReplace:
|
|
450
|
-
cancelReplace:
|
|
451
|
-
replaceFile:
|
|
452
|
-
replaceMediaDirectly:
|
|
449
|
+
checkUsageBeforeReplace: pe,
|
|
450
|
+
cancelReplace: me,
|
|
451
|
+
replaceFile: he,
|
|
452
|
+
replaceMediaDirectly: ge
|
|
453
453
|
};
|
|
454
454
|
}
|
|
455
455
|
//#endregion
|
|
456
456
|
//#region ../media-library/src/composables/useI18n.ts
|
|
457
|
-
function
|
|
457
|
+
function V(e) {
|
|
458
458
|
let t = e ?? l("translations"), n = i(t) ? t.value : t;
|
|
459
459
|
function r(e, t) {
|
|
460
460
|
return e.replace(/\{(\w+)\}/g, (e, n) => n in t ? String(t[n]) : `{${n}}`);
|
|
@@ -466,14 +466,14 @@ function z(e) {
|
|
|
466
466
|
}
|
|
467
467
|
//#endregion
|
|
468
468
|
//#region ../media-library/src/components/media/MediaBreadcrumb.vue?vue&type=script&setup=true&lang.ts
|
|
469
|
-
var
|
|
469
|
+
var Se = {
|
|
470
470
|
key: 0,
|
|
471
471
|
class: "tpl:flex tpl:items-center tpl:gap-1 tpl:text-xs",
|
|
472
472
|
style: { color: "var(--tpl-text-muted)" }
|
|
473
|
-
},
|
|
473
|
+
}, Ce = ["onClick"], we = {
|
|
474
474
|
key: 1,
|
|
475
475
|
style: { color: "var(--tpl-text)" }
|
|
476
|
-
},
|
|
476
|
+
}, Te = /* @__PURE__ */ A({
|
|
477
477
|
__name: "MediaBreadcrumb",
|
|
478
478
|
props: {
|
|
479
479
|
folders: {},
|
|
@@ -481,7 +481,7 @@ var we = {
|
|
|
481
481
|
},
|
|
482
482
|
emits: ["navigate"],
|
|
483
483
|
setup(e, { emit: t }) {
|
|
484
|
-
let n = e, r = t, { t: i } =
|
|
484
|
+
let n = e, r = t, { t: i } = V(), a = h(() => {
|
|
485
485
|
if (!n.currentFolderId) return [];
|
|
486
486
|
let e = [];
|
|
487
487
|
return s(n.folders, n.currentFolderId, e), e;
|
|
@@ -493,11 +493,11 @@ var we = {
|
|
|
493
493
|
}
|
|
494
494
|
return !1;
|
|
495
495
|
}
|
|
496
|
-
return (e, t) => a.value.length > 0 ? (o(), g("div",
|
|
496
|
+
return (e, t) => a.value.length > 0 ? (o(), g("div", Se, [w("button", {
|
|
497
497
|
class: "tpl:transition-colors tpl:duration-150 tpl:hover:underline",
|
|
498
498
|
style: { color: "var(--tpl-primary)" },
|
|
499
499
|
onClick: t[0] ||= (e) => r("navigate", null)
|
|
500
|
-
}, p(v(i).mediaLibrary.allFiles), 1), (o(!0), g(O, null, c(a.value, (e, t) => (o(), g(O, { key: e.id }, [j(v(
|
|
500
|
+
}, p(v(i).mediaLibrary.allFiles), 1), (o(!0), g(O, null, c(a.value, (e, t) => (o(), g(O, { key: e.id }, [j(v(re), {
|
|
501
501
|
size: 12,
|
|
502
502
|
"stroke-width": 2
|
|
503
503
|
}), t < a.value.length - 1 ? (o(), g("button", {
|
|
@@ -505,12 +505,12 @@ var we = {
|
|
|
505
505
|
class: "tpl:transition-colors tpl:duration-150 tpl:hover:underline",
|
|
506
506
|
style: { color: "var(--tpl-primary)" },
|
|
507
507
|
onClick: (t) => r("navigate", e.id)
|
|
508
|
-
}, p(e.name), 9,
|
|
508
|
+
}, p(e.name), 9, Ce)) : (o(), g("span", we, p(e.name), 1))], 64))), 128))])) : _("", !0);
|
|
509
509
|
}
|
|
510
510
|
});
|
|
511
511
|
//#endregion
|
|
512
512
|
//#region ../media-library/src/composables/useMediaCategories.ts
|
|
513
|
-
function
|
|
513
|
+
function Ee() {
|
|
514
514
|
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);
|
|
515
515
|
function s(e, t) {
|
|
516
516
|
return r.value ? !t || t.length === 0 ? i.value.includes(e) : t.some((t) => r.value[t]?.mime_types.includes(e)) : !1;
|
|
@@ -536,14 +536,14 @@ function Oe() {
|
|
|
536
536
|
}
|
|
537
537
|
//#endregion
|
|
538
538
|
//#region ../media-library/src/composables/useImageCrop.ts
|
|
539
|
-
var
|
|
539
|
+
var De = {
|
|
540
540
|
free: void 0,
|
|
541
541
|
square: 1,
|
|
542
542
|
landscape43: 4 / 3,
|
|
543
543
|
landscape169: 16 / 9,
|
|
544
544
|
original: void 0
|
|
545
545
|
};
|
|
546
|
-
function
|
|
546
|
+
function Oe(e) {
|
|
547
547
|
return e === "image/png" || e === "image/gif" ? {
|
|
548
548
|
mimeType: "image/png",
|
|
549
549
|
quality: 1
|
|
@@ -555,7 +555,7 @@ function Ae(e) {
|
|
|
555
555
|
quality: .92
|
|
556
556
|
};
|
|
557
557
|
}
|
|
558
|
-
function
|
|
558
|
+
function ke(e, t, n) {
|
|
559
559
|
let r = e.width, i = e.height;
|
|
560
560
|
if (!t && !n) return e;
|
|
561
561
|
let a = r, o = i;
|
|
@@ -569,7 +569,7 @@ function je(e, t, n) {
|
|
|
569
569
|
let c = s.getContext("2d");
|
|
570
570
|
return c && (c.imageSmoothingEnabled = !0, c.imageSmoothingQuality = "high", c.drawImage(e, 0, 0, a, o)), s;
|
|
571
571
|
}
|
|
572
|
-
function
|
|
572
|
+
function Ae(e, t, n) {
|
|
573
573
|
return new Promise((r, i) => {
|
|
574
574
|
e.toBlob((e) => {
|
|
575
575
|
if (!e) {
|
|
@@ -581,7 +581,7 @@ function Me(e, t, n) {
|
|
|
581
581
|
}, n.mimeType, n.quality);
|
|
582
582
|
});
|
|
583
583
|
}
|
|
584
|
-
function
|
|
584
|
+
function je(e, t, n, r) {
|
|
585
585
|
let i = e, a = t;
|
|
586
586
|
if (n && i > n) {
|
|
587
587
|
let e = n / i;
|
|
@@ -598,10 +598,10 @@ function Ne(e, t, n, r) {
|
|
|
598
598
|
}
|
|
599
599
|
//#endregion
|
|
600
600
|
//#region ../media-library/src/keys.ts
|
|
601
|
-
var
|
|
601
|
+
var Me = Symbol("templaticalMediaPopoverTarget");
|
|
602
602
|
//#endregion
|
|
603
603
|
//#region ../../node_modules/.pnpm/vue-advanced-cropper@2.8.9_vue@3.5.38_typescript@6.0.3_/node_modules/vue-advanced-cropper/dist/index.esm-bundler.js
|
|
604
|
-
function
|
|
604
|
+
function Ne(e, t) {
|
|
605
605
|
var n = Object.keys(e);
|
|
606
606
|
if (Object.getOwnPropertySymbols) {
|
|
607
607
|
var r = Object.getOwnPropertySymbols(e);
|
|
@@ -611,18 +611,18 @@ function Fe(e, t) {
|
|
|
611
611
|
}
|
|
612
612
|
return n;
|
|
613
613
|
}
|
|
614
|
-
function
|
|
614
|
+
function H(e) {
|
|
615
615
|
for (var t = 1; t < arguments.length; t++) {
|
|
616
616
|
var n = arguments[t] == null ? {} : arguments[t];
|
|
617
|
-
t % 2 ?
|
|
618
|
-
|
|
619
|
-
})) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) :
|
|
617
|
+
t % 2 ? Ne(Object(n), !0).forEach((function(t) {
|
|
618
|
+
U(e, t, n[t]);
|
|
619
|
+
})) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : Ne(Object(n)).forEach((function(t) {
|
|
620
620
|
Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t));
|
|
621
621
|
}));
|
|
622
622
|
}
|
|
623
623
|
return e;
|
|
624
624
|
}
|
|
625
|
-
function
|
|
625
|
+
function U(e, t, n) {
|
|
626
626
|
return t in e ? Object.defineProperty(e, t, {
|
|
627
627
|
value: n,
|
|
628
628
|
enumerable: !0,
|
|
@@ -630,7 +630,7 @@ function V(e, t, n) {
|
|
|
630
630
|
writable: !0
|
|
631
631
|
}) : e[t] = n, e;
|
|
632
632
|
}
|
|
633
|
-
function
|
|
633
|
+
function Pe(e, t) {
|
|
634
634
|
if (e == null) return {};
|
|
635
635
|
var n, r, i = function(e, t) {
|
|
636
636
|
if (e == null) return {};
|
|
@@ -644,28 +644,28 @@ function Ie(e, t) {
|
|
|
644
644
|
}
|
|
645
645
|
return i;
|
|
646
646
|
}
|
|
647
|
-
function
|
|
647
|
+
function Fe(e) {
|
|
648
648
|
return function(e) {
|
|
649
|
-
if (Array.isArray(e)) return
|
|
649
|
+
if (Array.isArray(e)) return Ie(e);
|
|
650
650
|
}(e) || function(e) {
|
|
651
651
|
if (typeof Symbol < "u" && e[Symbol.iterator] != null || e["@@iterator"] != null) return Array.from(e);
|
|
652
652
|
}(e) || function(e, t) {
|
|
653
653
|
if (e) {
|
|
654
|
-
if (typeof e == "string") return
|
|
654
|
+
if (typeof e == "string") return Ie(e, t);
|
|
655
655
|
var n = Object.prototype.toString.call(e).slice(8, -1);
|
|
656
656
|
if (n === "Object" && e.constructor && (n = e.constructor.name), n === "Map" || n === "Set") return Array.from(e);
|
|
657
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return
|
|
657
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return Ie(e, t);
|
|
658
658
|
}
|
|
659
659
|
}(e) || function() {
|
|
660
660
|
throw TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
661
661
|
}();
|
|
662
662
|
}
|
|
663
|
-
function
|
|
663
|
+
function Ie(e, t) {
|
|
664
664
|
(t == null || t > e.length) && (t = e.length);
|
|
665
665
|
for (var n = 0, r = Array(t); n < t; n++) r[n] = e[n];
|
|
666
666
|
return r;
|
|
667
667
|
}
|
|
668
|
-
var
|
|
668
|
+
var Le, Re, ze, W = (Le = function(e) {
|
|
669
669
|
(function() {
|
|
670
670
|
var t = {}.hasOwnProperty;
|
|
671
671
|
function n() {
|
|
@@ -687,15 +687,15 @@ var ze, Be, Ve, H = (ze = function(e) {
|
|
|
687
687
|
}
|
|
688
688
|
e.exports ? (n.default = n, e.exports = n) : window.classNames = n;
|
|
689
689
|
})();
|
|
690
|
-
}, ze
|
|
691
|
-
path:
|
|
690
|
+
}, Le(ze = {
|
|
691
|
+
path: Re,
|
|
692
692
|
exports: {},
|
|
693
693
|
require: function(e, t) {
|
|
694
694
|
return function() {
|
|
695
695
|
throw Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs");
|
|
696
|
-
}(t == null &&
|
|
696
|
+
}(t == null && ze.path);
|
|
697
697
|
}
|
|
698
|
-
},
|
|
698
|
+
}, ze.exports), ze.exports), G = function(e) {
|
|
699
699
|
return function(t, n) {
|
|
700
700
|
if (!t) return e;
|
|
701
701
|
var r;
|
|
@@ -707,7 +707,7 @@ var ze, Be, Ve, H = (ze = function(e) {
|
|
|
707
707
|
}), "") : "");
|
|
708
708
|
};
|
|
709
709
|
};
|
|
710
|
-
function
|
|
710
|
+
function Be(e, t, n) {
|
|
711
711
|
var r, i, a, o, s;
|
|
712
712
|
function c() {
|
|
713
713
|
var l = Date.now() - o;
|
|
@@ -725,65 +725,65 @@ function He(e, t, n) {
|
|
|
725
725
|
r &&= (s = e.apply(a, i), a = i = null, clearTimeout(r), null);
|
|
726
726
|
}, l;
|
|
727
727
|
}
|
|
728
|
-
|
|
729
|
-
var
|
|
730
|
-
return
|
|
728
|
+
Be.debounce = Be;
|
|
729
|
+
var Ve = Be, K = function() {
|
|
730
|
+
return K = Object.assign || function(e) {
|
|
731
731
|
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]);
|
|
732
732
|
return e;
|
|
733
|
-
},
|
|
733
|
+
}, K.apply(this, arguments);
|
|
734
734
|
};
|
|
735
|
-
function
|
|
735
|
+
function He(e, t) {
|
|
736
736
|
var n, r;
|
|
737
737
|
return e && t ? (n = "" + e + t[0].toUpperCase() + t.slice(1), r = e + "-" + t) : (n = e || t, r = e || t), {
|
|
738
738
|
name: n,
|
|
739
739
|
classname: r
|
|
740
740
|
};
|
|
741
741
|
}
|
|
742
|
-
function
|
|
742
|
+
function Ue(e) {
|
|
743
743
|
return /^blob:/.test(e);
|
|
744
744
|
}
|
|
745
|
-
function
|
|
746
|
-
return
|
|
745
|
+
function We(e) {
|
|
746
|
+
return Ue(e) || function(e) {
|
|
747
747
|
return /^data:/.test(e);
|
|
748
748
|
}(e);
|
|
749
749
|
}
|
|
750
|
-
function
|
|
750
|
+
function Ge(e) {
|
|
751
751
|
return !!(e && e.constructor && e.call && e.apply);
|
|
752
752
|
}
|
|
753
|
-
function
|
|
753
|
+
function q(e) {
|
|
754
754
|
return e === void 0;
|
|
755
755
|
}
|
|
756
|
-
function
|
|
756
|
+
function Ke(e) {
|
|
757
757
|
return typeof e == "object" && !!e;
|
|
758
758
|
}
|
|
759
|
-
function
|
|
759
|
+
function qe(e, t, n) {
|
|
760
760
|
var r = {};
|
|
761
|
-
return
|
|
762
|
-
|
|
761
|
+
return Ke(e) ? (Object.keys(t).forEach((function(i) {
|
|
762
|
+
q(e[i]) ? r[i] = t[i] : Ke(t[i]) ? Ke(e[i]) ? r[i] = qe(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];
|
|
763
763
|
})), r) : e ? t : n;
|
|
764
764
|
}
|
|
765
|
-
function
|
|
765
|
+
function Je(e) {
|
|
766
766
|
var t = Number(e);
|
|
767
767
|
return Number.isNaN(t) ? e : t;
|
|
768
768
|
}
|
|
769
|
-
function
|
|
769
|
+
function Ye(e) {
|
|
770
770
|
return typeof (e == "number" || function(e) {
|
|
771
771
|
return typeof e == "object" && !!e;
|
|
772
|
-
}(e) && toString.call(e) == "[object Number]") && !
|
|
772
|
+
}(e) && toString.call(e) == "[object Number]") && !Xe(e);
|
|
773
773
|
}
|
|
774
|
-
function
|
|
774
|
+
function Xe(e) {
|
|
775
775
|
return e != e;
|
|
776
776
|
}
|
|
777
|
-
function
|
|
777
|
+
function Ze(e, t) {
|
|
778
778
|
return Math.sqrt((e.x - t.x) ** 2 + (e.y - t.y) ** 2);
|
|
779
779
|
}
|
|
780
|
-
var
|
|
780
|
+
var Qe = function(e, t) {
|
|
781
781
|
e === void 0 && (e = {}), t === void 0 && (t = {}), this.type = "manipulateImage", this.move = e, this.scale = t;
|
|
782
|
-
},
|
|
782
|
+
}, $e = function(e, t) {
|
|
783
783
|
t === void 0 && (t = {}), this.type = "resize", this.directions = e, this.params = t;
|
|
784
|
-
},
|
|
784
|
+
}, et = function(e) {
|
|
785
785
|
this.type = "move", this.directions = e;
|
|
786
|
-
},
|
|
786
|
+
}, tt = function() {
|
|
787
787
|
function e(e, t, n, r, i) {
|
|
788
788
|
this.type = "drag", this.nativeEvent = e, this.position = n, this.previousPosition = r, this.element = t, this.anchor = i;
|
|
789
789
|
}
|
|
@@ -801,7 +801,7 @@ var et = function(e, t) {
|
|
|
801
801
|
top: 0
|
|
802
802
|
};
|
|
803
803
|
}, e;
|
|
804
|
-
}(),
|
|
804
|
+
}(), nt = {
|
|
805
805
|
name: "DraggableElement",
|
|
806
806
|
props: { classname: { type: String } },
|
|
807
807
|
beforeMount: function() {
|
|
@@ -822,7 +822,7 @@ var et = function(e, t) {
|
|
|
822
822
|
this.hovered && !this.touches.length && (this.hovered = !1, this.$emit("leave"));
|
|
823
823
|
},
|
|
824
824
|
onTouchStart: function(e) {
|
|
825
|
-
e.cancelable && !this.disabled && e.touches.length === 1 && (this.touches =
|
|
825
|
+
e.cancelable && !this.disabled && e.touches.length === 1 && (this.touches = Fe(e.touches), this.hovered ||= (this.$emit("enter"), !0), e.touches.length && this.initAnchor(this.touches.reduce((function(t, n) {
|
|
826
826
|
return {
|
|
827
827
|
clientX: t.clientX + n.clientX / e.touches.length,
|
|
828
828
|
clientY: t.clientY + n.clientY / e.touches.length
|
|
@@ -868,11 +868,11 @@ var et = function(e, t) {
|
|
|
868
868
|
};
|
|
869
869
|
},
|
|
870
870
|
processMove: function(e, t) {
|
|
871
|
-
var n =
|
|
871
|
+
var n = Fe(t);
|
|
872
872
|
if (this.touches.length) {
|
|
873
873
|
if (this.touches.length === 1 && n.length === 1) {
|
|
874
874
|
var r = this.$refs.draggable;
|
|
875
|
-
this.$emit("drag", new
|
|
875
|
+
this.$emit("drag", new tt(e, r, {
|
|
876
876
|
left: n[0].clientX,
|
|
877
877
|
top: n[0].clientY
|
|
878
878
|
}, {
|
|
@@ -894,7 +894,7 @@ var et = function(e, t) {
|
|
|
894
894
|
"enter"
|
|
895
895
|
]
|
|
896
896
|
};
|
|
897
|
-
|
|
897
|
+
nt.render = function(e, n, r, i, a, s) {
|
|
898
898
|
return o(), b("div", {
|
|
899
899
|
ref: "draggable",
|
|
900
900
|
class: r.classname,
|
|
@@ -912,9 +912,9 @@ it.render = function(e, n, r, i, a, s) {
|
|
|
912
912
|
}
|
|
913
913
|
}, [t(e.$slots, "default")], 34);
|
|
914
914
|
};
|
|
915
|
-
var
|
|
915
|
+
var rt = G("vue-handler-wrapper"), it = {
|
|
916
916
|
name: "HandlerWrapper",
|
|
917
|
-
components: { DraggableElement:
|
|
917
|
+
components: { DraggableElement: nt },
|
|
918
918
|
props: {
|
|
919
919
|
horizontalPosition: { type: String },
|
|
920
920
|
verticalPosition: { type: String },
|
|
@@ -926,12 +926,12 @@ var at = U("vue-handler-wrapper"), ot = {
|
|
|
926
926
|
computed: { classes: function() {
|
|
927
927
|
var e;
|
|
928
928
|
if (this.horizontalPosition || this.verticalPosition) {
|
|
929
|
-
var t, n =
|
|
930
|
-
e =
|
|
931
|
-
} else e =
|
|
929
|
+
var t, n = He(this.horizontalPosition, this.verticalPosition);
|
|
930
|
+
e = rt((U(t = {}, n.classname, !0), U(t, "disabled", this.disabled), t));
|
|
931
|
+
} else e = rt({ disabled: this.disabled });
|
|
932
932
|
return {
|
|
933
933
|
root: e,
|
|
934
|
-
draggable:
|
|
934
|
+
draggable: rt("draggable")
|
|
935
935
|
};
|
|
936
936
|
} },
|
|
937
937
|
emits: [
|
|
@@ -941,7 +941,7 @@ var at = U("vue-handler-wrapper"), ot = {
|
|
|
941
941
|
"drag-end"
|
|
942
942
|
]
|
|
943
943
|
};
|
|
944
|
-
|
|
944
|
+
it.render = function(e, n, i, a, s, c) {
|
|
945
945
|
var l = r("DraggableElement");
|
|
946
946
|
return o(), b("div", { class: c.classes.root }, [j(l, {
|
|
947
947
|
class: c.classes.draggable,
|
|
@@ -964,9 +964,9 @@ ot.render = function(e, n, i, a, s, c) {
|
|
|
964
964
|
_: 3
|
|
965
965
|
}, 8, ["class"])], 2);
|
|
966
966
|
};
|
|
967
|
-
var
|
|
967
|
+
var at = G("vue-line-wrapper"), ot = {
|
|
968
968
|
name: "LineWrapper",
|
|
969
|
-
components: { DraggableElement:
|
|
969
|
+
components: { DraggableElement: nt },
|
|
970
970
|
props: {
|
|
971
971
|
position: {
|
|
972
972
|
type: String,
|
|
@@ -979,7 +979,7 @@ var st = U("vue-line-wrapper"), ct = {
|
|
|
979
979
|
},
|
|
980
980
|
computed: { classname: function() {
|
|
981
981
|
var e;
|
|
982
|
-
return
|
|
982
|
+
return at((U(e = {}, this.position, !0), U(e, "disabled", this.disabled), e));
|
|
983
983
|
} },
|
|
984
984
|
emits: [
|
|
985
985
|
"leave",
|
|
@@ -988,7 +988,7 @@ var st = U("vue-line-wrapper"), ct = {
|
|
|
988
988
|
"drag-end"
|
|
989
989
|
]
|
|
990
990
|
};
|
|
991
|
-
|
|
991
|
+
ot.render = function(e, n, i, a, s, c) {
|
|
992
992
|
var l = r("DraggableElement");
|
|
993
993
|
return o(), b(l, {
|
|
994
994
|
class: c.classname,
|
|
@@ -1011,23 +1011,23 @@ ct.render = function(e, n, i, a, s, c) {
|
|
|
1011
1011
|
_: 3
|
|
1012
1012
|
}, 8, ["class"]);
|
|
1013
1013
|
};
|
|
1014
|
-
var
|
|
1014
|
+
var J = [
|
|
1015
1015
|
"left",
|
|
1016
1016
|
"right",
|
|
1017
1017
|
"top",
|
|
1018
1018
|
"bottom"
|
|
1019
|
-
],
|
|
1019
|
+
], st = ["left", "right"], ct = ["top", "bottom"], lt = ["left", "top"], ut = [
|
|
1020
1020
|
"fill-area",
|
|
1021
1021
|
"fit-area",
|
|
1022
1022
|
"stencil",
|
|
1023
1023
|
"none"
|
|
1024
|
-
],
|
|
1024
|
+
], dt = {
|
|
1025
1025
|
left: 0,
|
|
1026
1026
|
top: 0,
|
|
1027
1027
|
width: 0,
|
|
1028
1028
|
height: 0
|
|
1029
1029
|
};
|
|
1030
|
-
function
|
|
1030
|
+
function ft(e, t, n) {
|
|
1031
1031
|
return !(n ||= [
|
|
1032
1032
|
"width",
|
|
1033
1033
|
"height",
|
|
@@ -1037,7 +1037,7 @@ function mt(e, t, n) {
|
|
|
1037
1037
|
return e[n] !== t[n];
|
|
1038
1038
|
}));
|
|
1039
1039
|
}
|
|
1040
|
-
function
|
|
1040
|
+
function pt(e) {
|
|
1041
1041
|
return {
|
|
1042
1042
|
left: e.left,
|
|
1043
1043
|
top: e.top,
|
|
@@ -1045,31 +1045,31 @@ function q(e) {
|
|
|
1045
1045
|
bottom: e.top + e.height
|
|
1046
1046
|
};
|
|
1047
1047
|
}
|
|
1048
|
-
function
|
|
1048
|
+
function mt(e, t) {
|
|
1049
1049
|
return {
|
|
1050
1050
|
left: e.left - t.left,
|
|
1051
1051
|
top: e.top - t.top
|
|
1052
1052
|
};
|
|
1053
1053
|
}
|
|
1054
|
-
function
|
|
1054
|
+
function Y(e) {
|
|
1055
1055
|
return {
|
|
1056
1056
|
left: e.left + e.width / 2,
|
|
1057
1057
|
top: e.top + e.height / 2
|
|
1058
1058
|
};
|
|
1059
1059
|
}
|
|
1060
|
-
function
|
|
1060
|
+
function ht(e, t) {
|
|
1061
1061
|
var n = {
|
|
1062
1062
|
left: 0,
|
|
1063
1063
|
top: 0,
|
|
1064
1064
|
right: 0,
|
|
1065
1065
|
bottom: 0
|
|
1066
1066
|
};
|
|
1067
|
-
return
|
|
1068
|
-
var i = t[r], a =
|
|
1067
|
+
return J.forEach((function(r) {
|
|
1068
|
+
var i = t[r], a = pt(e)[r];
|
|
1069
1069
|
n[r] = i !== void 0 && a !== void 0 ? r === "left" || r === "top" ? Math.max(0, i - a) : Math.max(0, a - i) : 0;
|
|
1070
1070
|
})), n;
|
|
1071
1071
|
}
|
|
1072
|
-
function
|
|
1072
|
+
function gt(e, t) {
|
|
1073
1073
|
return {
|
|
1074
1074
|
left: e.left - t.left,
|
|
1075
1075
|
top: e.top - t.top,
|
|
@@ -1084,7 +1084,7 @@ function _t(e) {
|
|
|
1084
1084
|
};
|
|
1085
1085
|
}
|
|
1086
1086
|
function X(e, t) {
|
|
1087
|
-
return
|
|
1087
|
+
return K(K({}, e), {
|
|
1088
1088
|
left: e.left + t.left,
|
|
1089
1089
|
top: e.top + t.top
|
|
1090
1090
|
});
|
|
@@ -1092,7 +1092,7 @@ function X(e, t) {
|
|
|
1092
1092
|
function Z(e, t, n, r) {
|
|
1093
1093
|
if (t !== 1) {
|
|
1094
1094
|
if (n) {
|
|
1095
|
-
var i =
|
|
1095
|
+
var i = Y(e);
|
|
1096
1096
|
return {
|
|
1097
1097
|
width: e.width * t,
|
|
1098
1098
|
height: e.height * t,
|
|
@@ -1119,7 +1119,7 @@ function yt(e, t) {
|
|
|
1119
1119
|
var n = {
|
|
1120
1120
|
left: 0,
|
|
1121
1121
|
top: 0
|
|
1122
|
-
}, r =
|
|
1122
|
+
}, r = ht(e, t);
|
|
1123
1123
|
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;
|
|
1124
1124
|
}
|
|
1125
1125
|
function bt(e, t) {
|
|
@@ -1157,7 +1157,7 @@ function Ct(e, t) {
|
|
|
1157
1157
|
};
|
|
1158
1158
|
}
|
|
1159
1159
|
function wt(e, t) {
|
|
1160
|
-
var n =
|
|
1160
|
+
var n = ht($(e, t), t);
|
|
1161
1161
|
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;
|
|
1162
1162
|
}
|
|
1163
1163
|
function $(e, t, n) {
|
|
@@ -1172,7 +1172,7 @@ function Tt(e) {
|
|
|
1172
1172
|
};
|
|
1173
1173
|
}
|
|
1174
1174
|
function Et(e, t) {
|
|
1175
|
-
return
|
|
1175
|
+
return K(K({}, e), {
|
|
1176
1176
|
minWidth: Math.min(t.width, e.minWidth),
|
|
1177
1177
|
minHeight: Math.min(t.height, e.minHeight),
|
|
1178
1178
|
maxWidth: Math.min(t.width, e.maxWidth),
|
|
@@ -1182,7 +1182,7 @@ function Et(e, t) {
|
|
|
1182
1182
|
function Dt(e, t, n) {
|
|
1183
1183
|
n === void 0 && (n = !0);
|
|
1184
1184
|
var r = {};
|
|
1185
|
-
return
|
|
1185
|
+
return J.forEach((function(i) {
|
|
1186
1186
|
var a = e[i], o = t[i];
|
|
1187
1187
|
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;
|
|
1188
1188
|
})), r;
|
|
@@ -1252,20 +1252,20 @@ function Nt(e) {
|
|
|
1252
1252
|
return Mt({
|
|
1253
1253
|
coordinates: e,
|
|
1254
1254
|
positionRestrictions: a,
|
|
1255
|
-
event: new
|
|
1255
|
+
event: new et({
|
|
1256
1256
|
left: t.left - e.left,
|
|
1257
1257
|
top: t.top - e.top
|
|
1258
1258
|
})
|
|
1259
1259
|
});
|
|
1260
|
-
}, l =
|
|
1260
|
+
}, l = K({}, t);
|
|
1261
1261
|
return (Array.isArray(n) ? n : [n]).forEach((function(e) {
|
|
1262
1262
|
var t = {};
|
|
1263
|
-
|
|
1263
|
+
q((t = typeof e == "function" ? e({
|
|
1264
1264
|
coordinates: l,
|
|
1265
1265
|
imageSize: r,
|
|
1266
1266
|
visibleArea: s
|
|
1267
|
-
}) : e).width) &&
|
|
1268
|
-
return c(
|
|
1267
|
+
}) : e).width) && q(t.height) || (l = function(e, t) {
|
|
1268
|
+
return c(K(K(K({}, e), jt({
|
|
1269
1269
|
width: t.width,
|
|
1270
1270
|
height: t.height,
|
|
1271
1271
|
sizeRestrictions: i,
|
|
@@ -1277,12 +1277,12 @@ function Nt(e) {
|
|
|
1277
1277
|
left: e.left,
|
|
1278
1278
|
top: e.top
|
|
1279
1279
|
});
|
|
1280
|
-
}(l,
|
|
1280
|
+
}(l, K(K({}, l), t))), q(t.left) && q(t.top) || (l = c(l, K(K({}, l), t)));
|
|
1281
1281
|
})), l;
|
|
1282
1282
|
}
|
|
1283
1283
|
function Pt(e) {
|
|
1284
|
-
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 =
|
|
1285
|
-
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 =
|
|
1284
|
+
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 = K({}, r), f = K({}, i), p = K({}, a);
|
|
1285
|
+
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 = K(K({}, d), jt({
|
|
1286
1286
|
sizeRestrictions: o,
|
|
1287
1287
|
width: d.width,
|
|
1288
1288
|
height: d.height,
|
|
@@ -1295,16 +1295,16 @@ function Pt(e) {
|
|
|
1295
1295
|
visibleArea: f,
|
|
1296
1296
|
type: "resize"
|
|
1297
1297
|
}));
|
|
1298
|
-
return m !== 1 && (f = Z(f, m), d = Z(d, m)), f = $(f = X(f,
|
|
1298
|
+
return m !== 1 && (f = Z(f, m), d = Z(d, m)), f = $(f = X(f, mt(Y(d), Y(f))), t({
|
|
1299
1299
|
visibleArea: f,
|
|
1300
1300
|
type: "move"
|
|
1301
1301
|
})), {
|
|
1302
|
-
coordinates: d = $(d, Ot(
|
|
1302
|
+
coordinates: d = $(d, Ot(pt(f), s)),
|
|
1303
1303
|
visibleArea: f
|
|
1304
1304
|
};
|
|
1305
1305
|
}
|
|
1306
1306
|
function Ft(e) {
|
|
1307
|
-
var t = e.event, n = e.getAreaRestrictions, r = e.boundaries, i = e.coordinates, a = e.visibleArea, o = e.positionRestrictions, s =
|
|
1307
|
+
var t = e.event, n = e.getAreaRestrictions, r = e.boundaries, i = e.coordinates, a = e.visibleArea, o = e.positionRestrictions, s = K({}, i), c = K({}, a);
|
|
1308
1308
|
if (i && a && t.type !== "manipulateImage") {
|
|
1309
1309
|
var l = {
|
|
1310
1310
|
width: 0,
|
|
@@ -1315,10 +1315,10 @@ function Ft(e) {
|
|
|
1315
1315
|
visibleArea: c,
|
|
1316
1316
|
type: "resize"
|
|
1317
1317
|
}));
|
|
1318
|
-
c = Z(c, u), u !== 1 && (l.height /= u, l.width /= u), c = $(c = X(c,
|
|
1318
|
+
c = Z(c, u), u !== 1 && (l.height /= u, l.width /= u), c = $(c = X(c, mt(Y(s), Y(c))), n({
|
|
1319
1319
|
visibleArea: c,
|
|
1320
1320
|
type: "move"
|
|
1321
|
-
})), s = $(s, Ot(
|
|
1321
|
+
})), s = $(s, Ot(pt(c), o));
|
|
1322
1322
|
}
|
|
1323
1323
|
return {
|
|
1324
1324
|
coordinates: s,
|
|
@@ -1326,7 +1326,7 @@ function Ft(e) {
|
|
|
1326
1326
|
};
|
|
1327
1327
|
}
|
|
1328
1328
|
function It(e) {
|
|
1329
|
-
var t = e.event, n = e.coordinates, r = e.visibleArea, i = e.getAreaRestrictions, a =
|
|
1329
|
+
var t = e.event, n = e.coordinates, r = e.visibleArea, i = e.getAreaRestrictions, a = K({}, r), o = K({}, n);
|
|
1330
1330
|
if (t.type === "setCoordinates") {
|
|
1331
1331
|
var s = Math.max(0, o.width - a.width), c = Math.max(0, o.height - a.height);
|
|
1332
1332
|
s > c ? a = Z(a, Math.min(o.width / a.width, vt(a, i({
|
|
@@ -1335,7 +1335,7 @@ function It(e) {
|
|
|
1335
1335
|
})))) : c > s && (a = Z(a, Math.min(o.height / a.height, vt(a, i({
|
|
1336
1336
|
visibleArea: a,
|
|
1337
1337
|
type: "resize"
|
|
1338
|
-
}))))), a = $(a = X(a, _t(yt(o,
|
|
1338
|
+
}))))), a = $(a = X(a, _t(yt(o, pt(a)))), i({
|
|
1339
1339
|
visibleArea: a,
|
|
1340
1340
|
type: "move"
|
|
1341
1341
|
}));
|
|
@@ -1360,7 +1360,7 @@ function Rt(e) {
|
|
|
1360
1360
|
height: .8 * a.height,
|
|
1361
1361
|
width: .8 * a.height * o
|
|
1362
1362
|
};
|
|
1363
|
-
return jt(
|
|
1363
|
+
return jt(K(K({}, s), {
|
|
1364
1364
|
aspectRatio: r,
|
|
1365
1365
|
sizeRestrictions: i
|
|
1366
1366
|
}));
|
|
@@ -1388,7 +1388,7 @@ function Bt(e) {
|
|
|
1388
1388
|
top: n.top + n.height / 2 - o.height / 2,
|
|
1389
1389
|
width: o.width,
|
|
1390
1390
|
height: o.height
|
|
1391
|
-
}, c =
|
|
1391
|
+
}, c = ht(n, pt(K({
|
|
1392
1392
|
left: 0,
|
|
1393
1393
|
top: 0
|
|
1394
1394
|
}, r))), l = {};
|
|
@@ -1406,10 +1406,10 @@ function Bt(e) {
|
|
|
1406
1406
|
};
|
|
1407
1407
|
}
|
|
1408
1408
|
function Vt(e, t) {
|
|
1409
|
-
return Dt(e,
|
|
1409
|
+
return Dt(e, pt(t));
|
|
1410
1410
|
}
|
|
1411
1411
|
function Ht(e) {
|
|
1412
|
-
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 =
|
|
1412
|
+
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 = K({}, r), d = K({}, n), f = 1, p = 1, m = c.factor && Math.abs(c.factor - 1) > .001;
|
|
1413
1413
|
u = X(u, {
|
|
1414
1414
|
left: l.left || 0,
|
|
1415
1415
|
top: l.top || 0
|
|
@@ -1434,49 +1434,49 @@ function Ht(e) {
|
|
|
1434
1434
|
})), a({
|
|
1435
1435
|
visibleArea: u,
|
|
1436
1436
|
type: "move"
|
|
1437
|
-
})), d.width *= p, d.height *= p, d.left = u.left + g * p, d.top = u.top + v * p, d = $(d, Ot(
|
|
1437
|
+
})), d.width *= p, d.height *= p, d.left = u.left + g * p, d.top = u.top + v * p, d = $(d, Ot(pt(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({
|
|
1438
1438
|
visibleArea: u,
|
|
1439
1439
|
type: "move"
|
|
1440
|
-
})), _t(yt(d,
|
|
1440
|
+
})), _t(yt(d, pt(u)))))), {
|
|
1441
1441
|
coordinates: d,
|
|
1442
1442
|
visibleArea: u
|
|
1443
1443
|
};
|
|
1444
1444
|
}
|
|
1445
1445
|
function Ut(e) {
|
|
1446
|
-
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 =
|
|
1446
|
+
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 = K({}, r), d = K({}, i), f = Ct(Y(K({
|
|
1447
1447
|
left: 0,
|
|
1448
1448
|
top: 0
|
|
1449
1449
|
}, c)), l);
|
|
1450
|
-
return (u =
|
|
1450
|
+
return (u = K(K({}, jt({
|
|
1451
1451
|
sizeRestrictions: a,
|
|
1452
1452
|
aspectRatio: t,
|
|
1453
1453
|
width: u.width,
|
|
1454
1454
|
height: u.height
|
|
1455
|
-
})), Ct(
|
|
1455
|
+
})), 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({
|
|
1456
1456
|
visibleArea: d,
|
|
1457
1457
|
type: "resize"
|
|
1458
1458
|
}))), {
|
|
1459
1459
|
coordinates: u = $(u, o),
|
|
1460
|
-
visibleArea: d = $(d = X(d,
|
|
1460
|
+
visibleArea: d = $(d = X(d, mt(Y(u), Y(r))), n({
|
|
1461
1461
|
visibleArea: d,
|
|
1462
1462
|
type: "move"
|
|
1463
1463
|
}))
|
|
1464
1464
|
};
|
|
1465
1465
|
}
|
|
1466
1466
|
function Wt(e) {
|
|
1467
|
-
var t = e.flip, n = e.previousFlip, r = e.rotate, i = e.getAreaRestrictions, a = e.coordinates, o = e.visibleArea, s = e.imageSize, c =
|
|
1467
|
+
var t = e.flip, n = e.previousFlip, r = e.rotate, i = e.getAreaRestrictions, a = e.coordinates, o = e.visibleArea, s = e.imageSize, c = K({}, a), l = K({}, o), u = n.horizontal !== t.horizontal, d = n.vertical !== t.vertical;
|
|
1468
1468
|
if (u || d) {
|
|
1469
1469
|
var f = Ct({
|
|
1470
1470
|
left: s.width / 2,
|
|
1471
1471
|
top: s.height / 2
|
|
1472
|
-
}, -r), p = Ct(
|
|
1472
|
+
}, -r), p = Ct(Y(c), -r), m = Ct({
|
|
1473
1473
|
left: u ? f.left - (p.left - f.left) : p.left,
|
|
1474
1474
|
top: d ? f.top - (p.top - f.top) : p.top
|
|
1475
1475
|
}, r);
|
|
1476
|
-
c = X(c,
|
|
1476
|
+
c = X(c, mt(m, Y(c))), p = Ct(Y(l), -r), l = $(l = X(l, mt(m = Ct({
|
|
1477
1477
|
left: u ? f.left - (p.left - f.left) : p.left,
|
|
1478
1478
|
top: d ? f.top - (p.top - f.top) : p.top
|
|
1479
|
-
}, r),
|
|
1479
|
+
}, r), Y(l))), i({
|
|
1480
1480
|
visibleArea: l,
|
|
1481
1481
|
type: "move"
|
|
1482
1482
|
}));
|
|
@@ -1487,10 +1487,10 @@ function Wt(e) {
|
|
|
1487
1487
|
};
|
|
1488
1488
|
}
|
|
1489
1489
|
function Gt(e) {
|
|
1490
|
-
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 =
|
|
1490
|
+
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 = K({}, t), l = gt(n, c).width, u = gt(n, c).height;
|
|
1491
1491
|
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)));
|
|
1492
|
-
var d = gt(
|
|
1493
|
-
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(
|
|
1492
|
+
var d = ht(gt(n, c), i);
|
|
1493
|
+
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));
|
|
1494
1494
|
var f = {
|
|
1495
1495
|
width: Infinity,
|
|
1496
1496
|
height: Infinity,
|
|
@@ -1499,27 +1499,27 @@ function Gt(e) {
|
|
|
1499
1499
|
top: Infinity,
|
|
1500
1500
|
bottom: Infinity
|
|
1501
1501
|
};
|
|
1502
|
-
if (
|
|
1502
|
+
if (J.forEach((function(e) {
|
|
1503
1503
|
var t = d[e];
|
|
1504
1504
|
t && c[e] && (f[e] = Math.max(0, 1 - t / c[e]));
|
|
1505
1505
|
})), o) {
|
|
1506
|
-
var p = Math.min.apply(null,
|
|
1506
|
+
var p = Math.min.apply(null, J.map((function(e) {
|
|
1507
1507
|
return f[e];
|
|
1508
1508
|
})));
|
|
1509
|
-
p !== Infinity &&
|
|
1509
|
+
p !== Infinity && J.forEach((function(e) {
|
|
1510
1510
|
c[e] *= p;
|
|
1511
1511
|
}));
|
|
1512
|
-
} else
|
|
1512
|
+
} else J.forEach((function(e) {
|
|
1513
1513
|
f[e] !== Infinity && (c[e] *= f[e]);
|
|
1514
1514
|
}));
|
|
1515
|
-
if (l =
|
|
1515
|
+
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) {
|
|
1516
1516
|
var m = Math.min(f.width, f.height);
|
|
1517
|
-
m !== Infinity &&
|
|
1517
|
+
m !== Infinity && J.forEach((function(e) {
|
|
1518
1518
|
c[e] *= m;
|
|
1519
1519
|
}));
|
|
1520
|
-
} else f.width !== Infinity &&
|
|
1520
|
+
} else f.width !== Infinity && st.forEach((function(e) {
|
|
1521
1521
|
c[e] *= f.width;
|
|
1522
|
-
})), f.height !== Infinity &&
|
|
1522
|
+
})), f.height !== Infinity && ct.forEach((function(e) {
|
|
1523
1523
|
c[e] *= f.height;
|
|
1524
1524
|
}));
|
|
1525
1525
|
return c;
|
|
@@ -1527,9 +1527,9 @@ function Gt(e) {
|
|
|
1527
1527
|
function Kt(e, t, n) {
|
|
1528
1528
|
return t == 0 && n == 0 ? e / 2 : t == 0 ? 0 : n == 0 ? e : e * Math.abs(t / (t + n));
|
|
1529
1529
|
}
|
|
1530
|
-
var qt =
|
|
1530
|
+
var qt = G("vue-simple-handler"), Jt = G("vue-simple-handler-wrapper"), Yt = {
|
|
1531
1531
|
name: "SimpleHandler",
|
|
1532
|
-
components: { HandlerWrapper:
|
|
1532
|
+
components: { HandlerWrapper: it },
|
|
1533
1533
|
props: {
|
|
1534
1534
|
defaultClass: { type: String },
|
|
1535
1535
|
hoverClass: { type: String },
|
|
@@ -1545,10 +1545,10 @@ var qt = U("vue-simple-handler"), Jt = U("vue-simple-handler-wrapper"), Yt = {
|
|
|
1545
1545
|
return { hover: !1 };
|
|
1546
1546
|
},
|
|
1547
1547
|
computed: { classes: function() {
|
|
1548
|
-
var e, t = (
|
|
1548
|
+
var e, t = (U(e = {}, this.horizontalPosition, !!this.horizontalPosition), U(e, this.verticalPosition, !!this.verticalPosition), U(e, `${this.horizontalPosition}-${this.verticalPosition}`, !!(this.verticalPosition && this.horizontalPosition)), U(e, "hover", this.hover), e);
|
|
1549
1549
|
return {
|
|
1550
|
-
default:
|
|
1551
|
-
wrapper:
|
|
1550
|
+
default: W(qt(t), this.defaultClass, this.hover && this.hoverClass),
|
|
1551
|
+
wrapper: W(Jt(t), this.wrapperClass)
|
|
1552
1552
|
};
|
|
1553
1553
|
} },
|
|
1554
1554
|
methods: {
|
|
@@ -1594,9 +1594,9 @@ Yt.render = function(e, t, n, i, a, s) {
|
|
|
1594
1594
|
"onLeave"
|
|
1595
1595
|
]);
|
|
1596
1596
|
};
|
|
1597
|
-
var Xt =
|
|
1597
|
+
var Xt = G("vue-simple-line"), Zt = G("vue-simple-line-wrapper"), Qt = {
|
|
1598
1598
|
name: "SimpleLine",
|
|
1599
|
-
components: { LineWrapper:
|
|
1599
|
+
components: { LineWrapper: ot },
|
|
1600
1600
|
props: {
|
|
1601
1601
|
defaultClass: { type: String },
|
|
1602
1602
|
hoverClass: { type: String },
|
|
@@ -1612,8 +1612,8 @@ var Xt = U("vue-simple-line"), Zt = U("vue-simple-line-wrapper"), Qt = {
|
|
|
1612
1612
|
},
|
|
1613
1613
|
computed: { classes: function() {
|
|
1614
1614
|
return {
|
|
1615
|
-
root:
|
|
1616
|
-
wrapper:
|
|
1615
|
+
root: W(Xt(U({}, this.position, !0)), this.defaultClass, this.hover && this.hoverClass),
|
|
1616
|
+
wrapper: W(Zt(U({}, this.position, !0)), this.wrapperClass)
|
|
1617
1617
|
};
|
|
1618
1618
|
} },
|
|
1619
1619
|
methods: {
|
|
@@ -1657,7 +1657,7 @@ Qt.render = function(e, t, n, i, a, s) {
|
|
|
1657
1657
|
"onLeave"
|
|
1658
1658
|
]);
|
|
1659
1659
|
};
|
|
1660
|
-
var $t =
|
|
1660
|
+
var $t = G("vue-bounding-box"), en = [
|
|
1661
1661
|
"east",
|
|
1662
1662
|
"west",
|
|
1663
1663
|
null
|
|
@@ -1743,7 +1743,7 @@ var $t = U("vue-bounding-box"), en = [
|
|
|
1743
1743
|
return en.forEach((function(t) {
|
|
1744
1744
|
tn.forEach((function(n) {
|
|
1745
1745
|
if (t !== n) {
|
|
1746
|
-
var r =
|
|
1746
|
+
var r = He(t, n);
|
|
1747
1747
|
e.push({
|
|
1748
1748
|
name: r.name,
|
|
1749
1749
|
classname: r.classname,
|
|
@@ -1775,8 +1775,8 @@ var $t = U("vue-bounding-box"), en = [
|
|
|
1775
1775
|
n.horizontalDirection && n.verticalDirection || !e.lines[n.name] || t.push({
|
|
1776
1776
|
name: n.name,
|
|
1777
1777
|
component: e.linesComponent,
|
|
1778
|
-
class:
|
|
1779
|
-
wrapperClass:
|
|
1778
|
+
class: W(e.classes.lines.default, e.classes.lines[n.name], !e.resizable && e.classes.lines.disabled),
|
|
1779
|
+
wrapperClass: W(e.classes.linesWrappers.default, e.classes.linesWrappers[n.name], !e.resizable && e.classes.linesWrappers.disabled),
|
|
1780
1780
|
hoverClass: e.classes.lines.hover,
|
|
1781
1781
|
verticalDirection: n.verticalDirection,
|
|
1782
1782
|
horizontalDirection: n.horizontalDirection,
|
|
@@ -1791,8 +1791,8 @@ var $t = U("vue-bounding-box"), en = [
|
|
|
1791
1791
|
var a = {
|
|
1792
1792
|
name: i.name,
|
|
1793
1793
|
component: e.handlersComponent,
|
|
1794
|
-
class:
|
|
1795
|
-
wrapperClass:
|
|
1794
|
+
class: W(e.classes.handlers.default, e.classes.handlers[i.name]),
|
|
1795
|
+
wrapperClass: W(e.classes.handlersWrappers.default, e.classes.handlersWrappers[i.name]),
|
|
1796
1796
|
hoverClass: e.classes.handlers.hover,
|
|
1797
1797
|
verticalDirection: i.verticalDirection,
|
|
1798
1798
|
horizontalDirection: i.horizontalDirection,
|
|
@@ -1801,7 +1801,7 @@ var $t = U("vue-bounding-box"), en = [
|
|
|
1801
1801
|
if (n && r) {
|
|
1802
1802
|
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;
|
|
1803
1803
|
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}`);
|
|
1804
|
-
} else a.wrapperClass = $t("handler",
|
|
1804
|
+
} else a.wrapperClass = $t("handler", U({}, i.classname, !0));
|
|
1805
1805
|
t.push(a);
|
|
1806
1806
|
}
|
|
1807
1807
|
})), t;
|
|
@@ -1827,7 +1827,7 @@ var $t = U("vue-bounding-box"), en = [
|
|
|
1827
1827
|
top: 0,
|
|
1828
1828
|
bottom: 0
|
|
1829
1829
|
};
|
|
1830
|
-
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
|
|
1830
|
+
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 $e(s, {
|
|
1831
1831
|
allowedDirections: {
|
|
1832
1832
|
left: t === "west" || !t,
|
|
1833
1833
|
right: t === "east" || !t,
|
|
@@ -1901,7 +1901,7 @@ nn.render = function(e, n, r, i, s, l) {
|
|
|
1901
1901
|
})), 128))
|
|
1902
1902
|
], 6);
|
|
1903
1903
|
};
|
|
1904
|
-
var rn =
|
|
1904
|
+
var rn = G("vue-draggable-area"), an = {
|
|
1905
1905
|
name: "DraggableArea",
|
|
1906
1906
|
props: {
|
|
1907
1907
|
movable: {
|
|
@@ -1929,14 +1929,14 @@ var rn = U("vue-draggable-area"), an = {
|
|
|
1929
1929
|
onTouchStart: function(e) {
|
|
1930
1930
|
if (e.cancelable) {
|
|
1931
1931
|
var t = this.movable && e.touches.length === 1;
|
|
1932
|
-
t && (this.touches =
|
|
1932
|
+
t && (this.touches = Fe(e.touches)), (this.touchStarted || t) && (e.preventDefault(), e.stopPropagation());
|
|
1933
1933
|
}
|
|
1934
1934
|
},
|
|
1935
1935
|
onTouchEnd: function() {
|
|
1936
1936
|
this.touchStarted = !1, this.processEnd();
|
|
1937
1937
|
},
|
|
1938
1938
|
onTouchMove: function(e) {
|
|
1939
|
-
this.touches.length >= 1 && (this.touchStarted ? (this.processMove(e, e.touches), e.preventDefault(), e.stopPropagation()) :
|
|
1939
|
+
this.touches.length >= 1 && (this.touchStarted ? (this.processMove(e, e.touches), e.preventDefault(), e.stopPropagation()) : Ze({
|
|
1940
1940
|
x: this.touches[0].clientX,
|
|
1941
1941
|
y: this.touches[0].clientY
|
|
1942
1942
|
}, {
|
|
@@ -1975,10 +1975,10 @@ var rn = U("vue-draggable-area"), an = {
|
|
|
1975
1975
|
};
|
|
1976
1976
|
},
|
|
1977
1977
|
processMove: function(e, t) {
|
|
1978
|
-
var n =
|
|
1978
|
+
var n = Fe(t);
|
|
1979
1979
|
if (this.touches.length) {
|
|
1980
1980
|
var r = this.$refs.container.getBoundingClientRect(), i = r.left, a = r.top;
|
|
1981
|
-
this.touches.length === 1 && n.length === 1 && this.$emit("move", new
|
|
1981
|
+
this.touches.length === 1 && n.length === 1 && this.$emit("move", new et({
|
|
1982
1982
|
left: n[0].clientX - (i + this.anchor.x),
|
|
1983
1983
|
top: n[0].clientY - (a + this.anchor.y)
|
|
1984
1984
|
}));
|
|
@@ -2078,7 +2078,7 @@ function ln(e) {
|
|
|
2078
2078
|
return null;
|
|
2079
2079
|
}
|
|
2080
2080
|
}
|
|
2081
|
-
var un =
|
|
2081
|
+
var un = G("vue-preview-result"), dn = {
|
|
2082
2082
|
name: "PreviewResult",
|
|
2083
2083
|
props: {
|
|
2084
2084
|
image: { type: Object },
|
|
@@ -2102,7 +2102,7 @@ var un = U("vue-preview-result"), dn = {
|
|
|
2102
2102
|
root: un(),
|
|
2103
2103
|
wrapper: un("wrapper"),
|
|
2104
2104
|
imageWrapper: un("image-wrapper"),
|
|
2105
|
-
image:
|
|
2105
|
+
image: W(un("image"), this.imageClass)
|
|
2106
2106
|
};
|
|
2107
2107
|
},
|
|
2108
2108
|
wrapperStyle: function() {
|
|
@@ -2143,7 +2143,7 @@ function fn(e, t) {
|
|
|
2143
2143
|
return e.forEach((function(t) {
|
|
2144
2144
|
a.left += (t.clientX - r) / e.length, a.top += (t.clientY - i) / e.length;
|
|
2145
2145
|
})), e.forEach((function(e) {
|
|
2146
|
-
o +=
|
|
2146
|
+
o += Ze({
|
|
2147
2147
|
x: a.left,
|
|
2148
2148
|
y: a.top
|
|
2149
2149
|
}, {
|
|
@@ -2198,18 +2198,18 @@ var pn = {
|
|
|
2198
2198
|
window.removeEventListener("mouseup", this.onMouseUp), window.removeEventListener("mousemove", this.onMouseMove), window.removeEventListener("touchmove", this.onTouchMove), window.removeEventListener("touchend", this.onTouchEnd);
|
|
2199
2199
|
},
|
|
2200
2200
|
created: function() {
|
|
2201
|
-
this.transforming = !1, this.debouncedProcessEnd =
|
|
2201
|
+
this.transforming = !1, this.debouncedProcessEnd = Ve(this.processEnd), this.touches = [];
|
|
2202
2202
|
},
|
|
2203
2203
|
methods: {
|
|
2204
2204
|
processMove: function(e, t) {
|
|
2205
2205
|
if (this.touches.length) {
|
|
2206
|
-
if (this.touches.length === 1 && t.length === 1) this.$emit("move", new
|
|
2206
|
+
if (this.touches.length === 1 && t.length === 1) this.$emit("move", new Qe({
|
|
2207
2207
|
left: this.touches[0].clientX - t[0].clientX,
|
|
2208
2208
|
top: this.touches[0].clientY - t[0].clientY
|
|
2209
2209
|
}));
|
|
2210
2210
|
else if (this.touches.length > 1 && this.touchResize) {
|
|
2211
2211
|
var n = fn(t, this.$refs.container), r = this.oldGeometricProperties;
|
|
2212
|
-
r.count === n.count && r.count > 1 && this.$emit("resize", new
|
|
2212
|
+
r.count === n.count && r.count > 1 && this.$emit("resize", new Qe({
|
|
2213
2213
|
left: r.centerMass.left - n.centerMass.left,
|
|
2214
2214
|
top: r.centerMass.top - n.centerMass.top
|
|
2215
2215
|
}, {
|
|
@@ -2232,7 +2232,7 @@ var pn = {
|
|
|
2232
2232
|
onTouchStart: function(e) {
|
|
2233
2233
|
if (e.cancelable && (this.touchMove || this.touchResize && e.touches.length > 1) && this.processEvent(e)) {
|
|
2234
2234
|
var t = this.$refs.container, n = t.getBoundingClientRect(), r = n.left, i = n.top, a = n.bottom, o = n.right;
|
|
2235
|
-
this.touches =
|
|
2235
|
+
this.touches = Fe(e.touches).filter((function(e) {
|
|
2236
2236
|
return e.clientX > r && e.clientX < o && e.clientY > i && e.clientY < a;
|
|
2237
2237
|
})), this.oldGeometricProperties = fn(this.touches, t);
|
|
2238
2238
|
}
|
|
@@ -2243,7 +2243,7 @@ var pn = {
|
|
|
2243
2243
|
onTouchMove: function(e) {
|
|
2244
2244
|
var t = this;
|
|
2245
2245
|
if (this.touches.length) {
|
|
2246
|
-
var n =
|
|
2246
|
+
var n = Fe(e.touches).filter((function(e) {
|
|
2247
2247
|
return !e.identifier || t.touches.find((function(t) {
|
|
2248
2248
|
return t.identifier === e.identifier;
|
|
2249
2249
|
}));
|
|
@@ -2272,11 +2272,11 @@ var pn = {
|
|
|
2272
2272
|
},
|
|
2273
2273
|
onWheel: function(e) {
|
|
2274
2274
|
if (this.wheelResize && this.processEvent(e)) {
|
|
2275
|
-
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 ||
|
|
2275
|
+
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 || Xe(s) ? s : s > 0 ? 1 : -1), a = {
|
|
2276
2276
|
left: e.clientX - n,
|
|
2277
2277
|
top: e.clientY - r
|
|
2278
2278
|
};
|
|
2279
|
-
this.$emit("resize", new
|
|
2279
|
+
this.$emit("resize", new Qe({}, {
|
|
2280
2280
|
factor: i,
|
|
2281
2281
|
center: a
|
|
2282
2282
|
})), this.touches.length || this.debouncedProcessEnd();
|
|
@@ -2351,7 +2351,7 @@ mn.render = function(e, n, i, a, s, c) {
|
|
|
2351
2351
|
"wheel-resize"
|
|
2352
2352
|
]);
|
|
2353
2353
|
};
|
|
2354
|
-
var hn =
|
|
2354
|
+
var hn = G("vue-preview"), gn = {
|
|
2355
2355
|
props: {
|
|
2356
2356
|
coordinates: { type: Object },
|
|
2357
2357
|
transitions: { type: Object },
|
|
@@ -2384,7 +2384,7 @@ var hn = U("vue-preview"), gn = {
|
|
|
2384
2384
|
root: hn({ fill: this.fill }),
|
|
2385
2385
|
wrapper: hn("wrapper"),
|
|
2386
2386
|
imageWrapper: hn("image-wrapper"),
|
|
2387
|
-
image:
|
|
2387
|
+
image: W(hn("image"), this.imageClass)
|
|
2388
2388
|
};
|
|
2389
2389
|
},
|
|
2390
2390
|
style: function() {
|
|
@@ -2403,7 +2403,7 @@ var hn = U("vue-preview"), gn = {
|
|
|
2403
2403
|
},
|
|
2404
2404
|
imageStyle: function() {
|
|
2405
2405
|
if (this.coordinates && this.image) {
|
|
2406
|
-
var e = this.coordinates.width / this.size.width, t =
|
|
2406
|
+
var e = this.coordinates.width / this.size.width, t = H(H({
|
|
2407
2407
|
rotate: 0,
|
|
2408
2408
|
flip: {
|
|
2409
2409
|
horizontal: !1,
|
|
@@ -2499,7 +2499,7 @@ _n.render = function(t, n, i, a, s, c) {
|
|
|
2499
2499
|
var l = r("preview");
|
|
2500
2500
|
return o(), b(l, e(t.$attrs, { fill: !0 }), null, 16);
|
|
2501
2501
|
};
|
|
2502
|
-
var vn =
|
|
2502
|
+
var vn = G("vue-rectangle-stencil"), yn = {
|
|
2503
2503
|
name: "RectangleStencil",
|
|
2504
2504
|
components: {
|
|
2505
2505
|
StencilPreview: _n,
|
|
@@ -2574,13 +2574,13 @@ var vn = U("vue-rectangle-stencil"), yn = {
|
|
|
2574
2574
|
computed: {
|
|
2575
2575
|
classes: function() {
|
|
2576
2576
|
return {
|
|
2577
|
-
stencil:
|
|
2577
|
+
stencil: W(vn({
|
|
2578
2578
|
movable: this.movable,
|
|
2579
2579
|
moving: this.moving,
|
|
2580
2580
|
resizing: this.resizing
|
|
2581
2581
|
}), this.moving && this.movingClass, this.resizing && this.resizingClass),
|
|
2582
|
-
preview:
|
|
2583
|
-
boundingBox:
|
|
2582
|
+
preview: W(vn("preview"), this.previewClass),
|
|
2583
|
+
boundingBox: W(vn("bounding-box"), this.boundingBoxClass)
|
|
2584
2584
|
};
|
|
2585
2585
|
},
|
|
2586
2586
|
style: function() {
|
|
@@ -2690,7 +2690,7 @@ yn.render = function(e, t, n, i, a, s) {
|
|
|
2690
2690
|
"onResizeEnd"
|
|
2691
2691
|
])], 6);
|
|
2692
2692
|
};
|
|
2693
|
-
var bn =
|
|
2693
|
+
var bn = G("vue-circle-stencil"), xn = {
|
|
2694
2694
|
components: {
|
|
2695
2695
|
StencilPreview: _n,
|
|
2696
2696
|
BoundingBox: nn,
|
|
@@ -2771,13 +2771,13 @@ var bn = U("vue-circle-stencil"), xn = {
|
|
|
2771
2771
|
computed: {
|
|
2772
2772
|
classes: function() {
|
|
2773
2773
|
return {
|
|
2774
|
-
stencil:
|
|
2774
|
+
stencil: W(bn({
|
|
2775
2775
|
movable: this.movable,
|
|
2776
2776
|
moving: this.moving,
|
|
2777
2777
|
resizing: this.resizing
|
|
2778
2778
|
}), this.moving && this.movingClass, this.resizing && this.resizingClass),
|
|
2779
|
-
preview:
|
|
2780
|
-
boundingBox:
|
|
2779
|
+
preview: W(bn("preview"), this.previewClass),
|
|
2780
|
+
boundingBox: W(bn("bounding-box"), this.boundingBoxClass)
|
|
2781
2781
|
};
|
|
2782
2782
|
},
|
|
2783
2783
|
style: function() {
|
|
@@ -2887,7 +2887,7 @@ xn.render = function(e, t, n, i, a, s) {
|
|
|
2887
2887
|
"onResizeEnd"
|
|
2888
2888
|
])], 6);
|
|
2889
2889
|
};
|
|
2890
|
-
var Sn = ["transitions"], Cn =
|
|
2890
|
+
var Sn = ["transitions"], Cn = G("vue-advanced-cropper"), wn = {
|
|
2891
2891
|
name: "Cropper",
|
|
2892
2892
|
components: { BackgroundWrapper: mn },
|
|
2893
2893
|
props: {
|
|
@@ -2953,7 +2953,7 @@ var Sn = ["transitions"], Cn = U("vue-advanced-cropper"), wn = {
|
|
|
2953
2953
|
type: String,
|
|
2954
2954
|
default: "fit-area",
|
|
2955
2955
|
validator: function(e) {
|
|
2956
|
-
return
|
|
2956
|
+
return ut.indexOf(e) !== -1;
|
|
2957
2957
|
}
|
|
2958
2958
|
},
|
|
2959
2959
|
roundResult: {
|
|
@@ -2987,24 +2987,24 @@ var Sn = ["transitions"], Cn = U("vue-advanced-cropper"), wn = {
|
|
|
2987
2987
|
resizeAlgorithm: {
|
|
2988
2988
|
type: Function,
|
|
2989
2989
|
default: function(e) {
|
|
2990
|
-
var t = e.event, n = e.coordinates, r = e.aspectRatio, i = e.positionRestrictions, a = e.sizeRestrictions, o =
|
|
2990
|
+
var t = e.event, n = e.coordinates, r = e.aspectRatio, i = e.positionRestrictions, a = e.sizeRestrictions, o = K(K({}, n), {
|
|
2991
2991
|
right: n.left + n.width,
|
|
2992
2992
|
bottom: n.top + n.height
|
|
2993
|
-
}), s = t.params || {}, c =
|
|
2993
|
+
}), s = t.params || {}, c = K({}, t.directions), l = s.allowedDirections || {
|
|
2994
2994
|
left: !0,
|
|
2995
2995
|
right: !0,
|
|
2996
2996
|
bottom: !0,
|
|
2997
2997
|
top: !0
|
|
2998
2998
|
};
|
|
2999
|
-
a.widthFrozen && (c.left = 0, c.right = 0), a.heightFrozen && (c.top = 0, c.bottom = 0),
|
|
2999
|
+
a.widthFrozen && (c.left = 0, c.right = 0), a.heightFrozen && (c.top = 0, c.bottom = 0), J.forEach((function(e) {
|
|
3000
3000
|
l[e] || (c[e] = 0);
|
|
3001
3001
|
}));
|
|
3002
|
-
var u =
|
|
3002
|
+
var u = gt(o, c = Gt({
|
|
3003
3003
|
coordinates: o,
|
|
3004
3004
|
directions: c,
|
|
3005
3005
|
sizeRestrictions: a,
|
|
3006
3006
|
positionRestrictions: i
|
|
3007
|
-
})).width, d =
|
|
3007
|
+
})).width, d = gt(o, c).height, f = s.preserveRatio ? Q(o) : bt(u / d, r);
|
|
3008
3008
|
if (f) {
|
|
3009
3009
|
var p = s.respectDirection;
|
|
3010
3010
|
if (p ||= o.width >= o.height || f === 1 ? "width" : "height", p === "width") {
|
|
@@ -3029,10 +3029,10 @@ var Sn = ["transitions"], Cn = U("vue-advanced-cropper"), wn = {
|
|
|
3029
3029
|
compensate: s.compensate
|
|
3030
3030
|
});
|
|
3031
3031
|
}
|
|
3032
|
-
return u =
|
|
3032
|
+
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 && J.forEach((function(e) {
|
|
3033
3033
|
l[e] || (c[e] = 0);
|
|
3034
3034
|
})), Mt({
|
|
3035
|
-
event: new
|
|
3035
|
+
event: new et({
|
|
3036
3036
|
left: -c.left,
|
|
3037
3037
|
top: -c.top
|
|
3038
3038
|
}),
|
|
@@ -3060,7 +3060,7 @@ var Sn = ["transitions"], Cn = U("vue-advanced-cropper"), wn = {
|
|
|
3060
3060
|
fitCoordinates: {
|
|
3061
3061
|
type: Function,
|
|
3062
3062
|
default: function(e) {
|
|
3063
|
-
var t = e.visibleArea, n = e.coordinates, r = e.aspectRatio, i = e.sizeRestrictions, a = e.positionRestrictions, o =
|
|
3063
|
+
var t = e.visibleArea, n = e.coordinates, r = e.aspectRatio, i = e.sizeRestrictions, a = e.positionRestrictions, o = K(K({}, n), jt({
|
|
3064
3064
|
width: n.width,
|
|
3065
3065
|
height: n.height,
|
|
3066
3066
|
aspectRatio: r,
|
|
@@ -3071,15 +3071,15 @@ var Sn = ["transitions"], Cn = U("vue-advanced-cropper"), wn = {
|
|
|
3071
3071
|
minWidth: Math.min(t.width, i.minWidth)
|
|
3072
3072
|
}
|
|
3073
3073
|
}));
|
|
3074
|
-
return o = $(o = X(o,
|
|
3074
|
+
return o = $(o = X(o, mt(Y(n), Y(o))), Ot(pt(t), a));
|
|
3075
3075
|
}
|
|
3076
3076
|
},
|
|
3077
3077
|
fitVisibleArea: {
|
|
3078
3078
|
type: Function,
|
|
3079
3079
|
default: function(e) {
|
|
3080
|
-
var t = e.visibleArea, n = e.boundaries, r = e.getAreaRestrictions, i = e.coordinates, a =
|
|
3080
|
+
var t = e.visibleArea, n = e.boundaries, r = e.getAreaRestrictions, i = e.coordinates, a = K({}, t);
|
|
3081
3081
|
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)));
|
|
3082
|
-
var o = _t(yt(i,
|
|
3082
|
+
var o = _t(yt(i, pt(a = Z(a, wt(a, r({
|
|
3083
3083
|
visibleArea: a,
|
|
3084
3084
|
type: "resize"
|
|
3085
3085
|
}))))));
|
|
@@ -3160,7 +3160,7 @@ var Sn = ["transitions"], Cn = U("vue-advanced-cropper"), wn = {
|
|
|
3160
3160
|
height: 0
|
|
3161
3161
|
},
|
|
3162
3162
|
visibleArea: null,
|
|
3163
|
-
coordinates:
|
|
3163
|
+
coordinates: H({}, dt)
|
|
3164
3164
|
};
|
|
3165
3165
|
},
|
|
3166
3166
|
computed: {
|
|
@@ -3198,7 +3198,7 @@ var Sn = ["transitions"], Cn = U("vue-advanced-cropper"), wn = {
|
|
|
3198
3198
|
return !!(this.visibleArea && this.imageLoaded);
|
|
3199
3199
|
},
|
|
3200
3200
|
settings: function() {
|
|
3201
|
-
var e =
|
|
3201
|
+
var e = qe(this.resizeImage, {
|
|
3202
3202
|
touch: !0,
|
|
3203
3203
|
wheel: { ratio: .1 },
|
|
3204
3204
|
adjustStencil: !0
|
|
@@ -3208,7 +3208,7 @@ var Sn = ["transitions"], Cn = U("vue-advanced-cropper"), wn = {
|
|
|
3208
3208
|
adjustStencil: !1
|
|
3209
3209
|
});
|
|
3210
3210
|
return {
|
|
3211
|
-
moveImage:
|
|
3211
|
+
moveImage: qe(this.moveImage, {
|
|
3212
3212
|
touch: !0,
|
|
3213
3213
|
mouse: !0
|
|
3214
3214
|
}, {
|
|
@@ -3239,13 +3239,13 @@ var Sn = ["transitions"], Cn = U("vue-advanced-cropper"), wn = {
|
|
|
3239
3239
|
if (this.boundaries.width && this.boundaries.height && this.imageSize.width && this.imageSize.height) {
|
|
3240
3240
|
var e = this.sizeRestrictionsAlgorithm({
|
|
3241
3241
|
imageSize: this.imageSize,
|
|
3242
|
-
minWidth:
|
|
3243
|
-
minHeight:
|
|
3244
|
-
maxWidth:
|
|
3245
|
-
maxHeight:
|
|
3242
|
+
minWidth: q(this.minWidth) ? 0 : Je(this.minWidth),
|
|
3243
|
+
minHeight: q(this.minHeight) ? 0 : Je(this.minHeight),
|
|
3244
|
+
maxWidth: q(this.maxWidth) ? Infinity : Je(this.maxWidth),
|
|
3245
|
+
maxHeight: q(this.maxHeight) ? Infinity : Je(this.maxHeight)
|
|
3246
3246
|
});
|
|
3247
3247
|
if (e = function(e) {
|
|
3248
|
-
var t = e.areaRestrictions, n = e.sizeRestrictions, r = e.boundaries, i = e.positionRestrictions, a =
|
|
3248
|
+
var t = e.areaRestrictions, n = e.sizeRestrictions, r = e.boundaries, i = e.positionRestrictions, a = K(K({}, n), {
|
|
3249
3249
|
minWidth: n.minWidth === void 0 ? 0 : n.minWidth,
|
|
3250
3250
|
minHeight: n.minHeight === void 0 ? 0 : n.minHeight,
|
|
3251
3251
|
maxWidth: n.maxWidth === void 0 ? Infinity : n.maxWidth,
|
|
@@ -3291,14 +3291,14 @@ var Sn = ["transitions"], Cn = U("vue-advanced-cropper"), wn = {
|
|
|
3291
3291
|
classes: function() {
|
|
3292
3292
|
return {
|
|
3293
3293
|
cropper: Cn(),
|
|
3294
|
-
image:
|
|
3294
|
+
image: W(Cn("image"), this.imageClass),
|
|
3295
3295
|
stencil: Cn("stencil"),
|
|
3296
|
-
boundaries:
|
|
3297
|
-
stretcher:
|
|
3298
|
-
background:
|
|
3299
|
-
foreground:
|
|
3300
|
-
imageWrapper:
|
|
3301
|
-
cropperWrapper:
|
|
3296
|
+
boundaries: W(Cn("boundaries"), this.boundariesClass),
|
|
3297
|
+
stretcher: W(Cn("stretcher")),
|
|
3298
|
+
background: W(Cn("background"), this.backgroundClass),
|
|
3299
|
+
foreground: W(Cn("foreground"), this.foregroundClass),
|
|
3300
|
+
imageWrapper: W(Cn("image-wrapper")),
|
|
3301
|
+
cropperWrapper: W(Cn("cropper-wrapper"))
|
|
3302
3302
|
};
|
|
3303
3303
|
},
|
|
3304
3304
|
stencilCoordinates: function() {
|
|
@@ -3335,7 +3335,7 @@ var Sn = ["transitions"], Cn = U("vue-advanced-cropper"), wn = {
|
|
|
3335
3335
|
}, n = {
|
|
3336
3336
|
left: (1 - 1 / this.coefficient) * e.width / 2,
|
|
3337
3337
|
top: (1 - 1 / this.coefficient) * e.height / 2
|
|
3338
|
-
}, r =
|
|
3338
|
+
}, r = H(H({}, this.imageTransforms), {}, {
|
|
3339
3339
|
scaleX: this.imageTransforms.scaleX * (this.imageAttributes.width / e.width),
|
|
3340
3340
|
scaleY: this.imageTransforms.scaleY * (this.imageAttributes.height / e.height)
|
|
3341
3341
|
}), i = {
|
|
@@ -3384,7 +3384,7 @@ var Sn = ["transitions"], Cn = U("vue-advanced-cropper"), wn = {
|
|
|
3384
3384
|
}
|
|
3385
3385
|
},
|
|
3386
3386
|
created: function() {
|
|
3387
|
-
this.debouncedUpdate =
|
|
3387
|
+
this.debouncedUpdate = Ve(this.update, this.debounce), this.debouncedDisableTransitions = Ve(this.disableTransitions, this.transitionsOptions.time), this.awaiting = !1;
|
|
3388
3388
|
},
|
|
3389
3389
|
mounted: function() {
|
|
3390
3390
|
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);
|
|
@@ -3394,16 +3394,16 @@ var Sn = ["transitions"], Cn = U("vue-advanced-cropper"), wn = {
|
|
|
3394
3394
|
},
|
|
3395
3395
|
methods: {
|
|
3396
3396
|
getResult: function() {
|
|
3397
|
-
var e = this.initialized ? this.prepareResult(
|
|
3397
|
+
var e = this.initialized ? this.prepareResult(H({}, this.coordinates)) : this.defaultCoordinates(), t = {
|
|
3398
3398
|
rotate: this.imageTransforms.rotate % 360,
|
|
3399
|
-
flip:
|
|
3399
|
+
flip: H({}, this.imageTransforms.flip)
|
|
3400
3400
|
};
|
|
3401
3401
|
if (this.src && this.imageLoaded) {
|
|
3402
3402
|
var n = this;
|
|
3403
3403
|
return {
|
|
3404
3404
|
image: this.image,
|
|
3405
3405
|
coordinates: e,
|
|
3406
|
-
visibleArea: this.visibleArea ?
|
|
3406
|
+
visibleArea: this.visibleArea ? H({}, this.visibleArea) : null,
|
|
3407
3407
|
imageTransforms: t,
|
|
3408
3408
|
get canvas() {
|
|
3409
3409
|
return n.canvas ? n.getCanvas() : void 0;
|
|
@@ -3413,14 +3413,14 @@ var Sn = ["transitions"], Cn = U("vue-advanced-cropper"), wn = {
|
|
|
3413
3413
|
return {
|
|
3414
3414
|
image: this.image,
|
|
3415
3415
|
coordinates: e,
|
|
3416
|
-
visibleArea: this.visibleArea ?
|
|
3416
|
+
visibleArea: this.visibleArea ? H({}, this.visibleArea) : null,
|
|
3417
3417
|
canvas: void 0,
|
|
3418
3418
|
imageTransforms: t
|
|
3419
3419
|
};
|
|
3420
3420
|
},
|
|
3421
3421
|
zoom: function(e, t) {
|
|
3422
3422
|
var n = (arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}).transitions, r = n === void 0 || n;
|
|
3423
|
-
this.onManipulateImage(new
|
|
3423
|
+
this.onManipulateImage(new Qe({}, {
|
|
3424
3424
|
factor: 1 / e,
|
|
3425
3425
|
center: t
|
|
3426
3426
|
}), {
|
|
@@ -3430,7 +3430,7 @@ var Sn = ["transitions"], Cn = U("vue-advanced-cropper"), wn = {
|
|
|
3430
3430
|
},
|
|
3431
3431
|
move: function(e, t) {
|
|
3432
3432
|
var n = (arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}).transitions, r = n === void 0 || n;
|
|
3433
|
-
this.onManipulateImage(new
|
|
3433
|
+
this.onManipulateImage(new Qe({
|
|
3434
3434
|
left: e || 0,
|
|
3435
3435
|
top: t || 0
|
|
3436
3436
|
}), {
|
|
@@ -3473,7 +3473,7 @@ var Sn = ["transitions"], Cn = U("vue-advanced-cropper"), wn = {
|
|
|
3473
3473
|
top: Math.round(t.top)
|
|
3474
3474
|
};
|
|
3475
3475
|
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);
|
|
3476
|
-
}(
|
|
3476
|
+
}(H(H({}, this.getPublicProperties()), {}, {
|
|
3477
3477
|
positionRestrictions: Vt(this.positionRestrictions, this.visibleArea),
|
|
3478
3478
|
coordinates: e
|
|
3479
3479
|
})) : e;
|
|
@@ -3495,16 +3495,16 @@ var Sn = ["transitions"], Cn = U("vue-advanced-cropper"), wn = {
|
|
|
3495
3495
|
sizeRestrictions: this.sizeRestrictions,
|
|
3496
3496
|
stencilSize: this.getStencilSize()
|
|
3497
3497
|
});
|
|
3498
|
-
return
|
|
3498
|
+
return H(H({}, a), {}, { changed: !ft(a.visibleArea, t) || !ft(a.coordinates, n) });
|
|
3499
3499
|
},
|
|
3500
3500
|
runAutoZoom: function(e) {
|
|
3501
|
-
var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, n = t.transitions, r = n !== void 0 && n, i =
|
|
3501
|
+
var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, n = t.transitions, r = n !== void 0 && n, i = Pe(t, Sn), a = this.processAutoZoom(e, this.visibleArea, this.coordinates, i), o = a.visibleArea, s = a.coordinates, c = a.changed;
|
|
3502
3502
|
r && c && this.enableTransitions(), this.visibleArea = o, this.coordinates = s, r && c && this.debouncedDisableTransitions();
|
|
3503
3503
|
},
|
|
3504
3504
|
normalizeEvent: function(e) {
|
|
3505
3505
|
return function(e) {
|
|
3506
3506
|
var t = e.event, n = e.visibleArea, r = e.coefficient;
|
|
3507
|
-
if (t.type === "manipulateImage") return
|
|
3507
|
+
if (t.type === "manipulateImage") return K(K({}, t), {
|
|
3508
3508
|
move: {
|
|
3509
3509
|
left: t.move && t.move.left ? r * t.move.left : 0,
|
|
3510
3510
|
top: t.move && t.move.top ? r * t.move.top : 0
|
|
@@ -3518,19 +3518,19 @@ var Sn = ["transitions"], Cn = U("vue-advanced-cropper"), wn = {
|
|
|
3518
3518
|
}
|
|
3519
3519
|
});
|
|
3520
3520
|
if (t.type === "resize") {
|
|
3521
|
-
var i =
|
|
3522
|
-
return
|
|
3521
|
+
var i = K(K({}, t), { directions: K({}, t.directions) });
|
|
3522
|
+
return J.forEach((function(e) {
|
|
3523
3523
|
i.directions[e] *= r;
|
|
3524
3524
|
})), i;
|
|
3525
3525
|
}
|
|
3526
3526
|
if (t.type === "move") {
|
|
3527
|
-
var a =
|
|
3528
|
-
return
|
|
3527
|
+
var a = K(K({}, t), { directions: K({}, t.directions) });
|
|
3528
|
+
return lt.forEach((function(e) {
|
|
3529
3529
|
a.directions[e] *= r;
|
|
3530
3530
|
})), a;
|
|
3531
3531
|
}
|
|
3532
3532
|
return t;
|
|
3533
|
-
}(
|
|
3533
|
+
}(H(H({}, this.getPublicProperties()), {}, { event: e }));
|
|
3534
3534
|
},
|
|
3535
3535
|
getCanvas: function() {
|
|
3536
3536
|
if (this.$refs.canvas) {
|
|
@@ -3540,12 +3540,12 @@ var Sn = ["transitions"], Cn = U("vue-advanced-cropper"), wn = {
|
|
|
3540
3540
|
height: t.naturalHeight
|
|
3541
3541
|
}, o = St(a, r), s = e.getContext("2d");
|
|
3542
3542
|
e.height = o.height, e.width = o.width, s.save();
|
|
3543
|
-
var c = Ct(
|
|
3543
|
+
var c = Ct(Y(K({
|
|
3544
3544
|
left: 0,
|
|
3545
3545
|
top: 0
|
|
3546
3546
|
}, a)), r);
|
|
3547
3547
|
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;
|
|
3548
|
-
}(this.$refs.sourceCanvas, t, this.imageTransforms) : t, r =
|
|
3548
|
+
}(this.$refs.sourceCanvas, t, this.imageTransforms) : t, r = H({
|
|
3549
3549
|
minWidth: 0,
|
|
3550
3550
|
minHeight: 0,
|
|
3551
3551
|
maxWidth: Infinity,
|
|
@@ -3610,7 +3610,7 @@ var Sn = ["transitions"], Cn = U("vue-advanced-cropper"), wn = {
|
|
|
3610
3610
|
this.$refs.cropper, this.$refs.image;
|
|
3611
3611
|
var t = this.defaultSize;
|
|
3612
3612
|
t ||= this.stencilSize ? zt : Rt, this.sizeRestrictions;
|
|
3613
|
-
var n =
|
|
3613
|
+
var n = Ge(t) ? t({
|
|
3614
3614
|
boundaries: this.boundaries,
|
|
3615
3615
|
imageSize: this.imageSize,
|
|
3616
3616
|
aspectRatio: this.getAspectRatio(),
|
|
@@ -3619,13 +3619,13 @@ var Sn = ["transitions"], Cn = U("vue-advanced-cropper"), wn = {
|
|
|
3619
3619
|
visibleArea: this.visibleArea
|
|
3620
3620
|
}) : t, r = this.defaultPosition || Lt, i = [n, function(t) {
|
|
3621
3621
|
var n = t.coordinates;
|
|
3622
|
-
return
|
|
3622
|
+
return H({}, Ge(r) ? r({
|
|
3623
3623
|
coordinates: n,
|
|
3624
3624
|
imageSize: e.imageSize,
|
|
3625
3625
|
visibleArea: e.visibleArea
|
|
3626
3626
|
}) : e.defaultPosition);
|
|
3627
3627
|
}];
|
|
3628
|
-
this.delayedTransforms && i.push.apply(i,
|
|
3628
|
+
this.delayedTransforms && i.push.apply(i, Fe(Array.isArray(this.delayedTransforms) ? this.delayedTransforms : [this.delayedTransforms])), this.coordinates = this.applyTransform(i, !0), this.delayedTransforms = null;
|
|
3629
3629
|
}
|
|
3630
3630
|
},
|
|
3631
3631
|
clearImage: function() {
|
|
@@ -3655,7 +3655,7 @@ var Sn = ["transitions"], Cn = U("vue-advanced-cropper"), wn = {
|
|
|
3655
3655
|
cropper: n,
|
|
3656
3656
|
imageSize: e.imageSize
|
|
3657
3657
|
};
|
|
3658
|
-
if (
|
|
3658
|
+
if (Ge(e.defaultBoundaries) ? e.boundaries = e.defaultBoundaries(t) : e.defaultBoundaries === "fit" ? e.boundaries = function(e) {
|
|
3659
3659
|
var t = e.cropper, n = e.imageSize, r = t.clientHeight, i = t.clientWidth, a = r, o = n.width * r / n.height;
|
|
3660
3660
|
return o > i && (o = i, a = n.height * i / n.width), {
|
|
3661
3661
|
width: o,
|
|
@@ -3672,10 +3672,10 @@ var Sn = ["transitions"], Cn = U("vue-advanced-cropper"), wn = {
|
|
|
3672
3672
|
},
|
|
3673
3673
|
resetVisibleArea: function() {
|
|
3674
3674
|
var e = this;
|
|
3675
|
-
return this.appliedImageTransforms =
|
|
3675
|
+
return this.appliedImageTransforms = H(H({}, this.defaultImageTransforms), {}, { flip: H({}, this.defaultImageTransforms.flip) }), this.updateBoundaries().then((function() {
|
|
3676
3676
|
e.priority !== "visible-area" && (e.visibleArea = null, e.resetCoordinates());
|
|
3677
3677
|
var t, n, r, i, a, o, s = e.defaultVisibleArea || Bt;
|
|
3678
|
-
e.visibleArea =
|
|
3678
|
+
e.visibleArea = Ge(s) ? s({
|
|
3679
3679
|
imageSize: e.imageSize,
|
|
3680
3680
|
boundaries: e.boundaries,
|
|
3681
3681
|
coordinates: e.priority === "visible-area" ? null : e.coordinates,
|
|
@@ -3685,7 +3685,7 @@ var Sn = ["transitions"], Cn = U("vue-advanced-cropper"), wn = {
|
|
|
3685
3685
|
visibleArea: e.visibleArea,
|
|
3686
3686
|
boundaries: e.boundaries,
|
|
3687
3687
|
getAreaRestrictions: e.getAreaRestrictions
|
|
3688
|
-
}, n = t.visibleArea, r = t.boundaries, i = t.getAreaRestrictions, a =
|
|
3688
|
+
}, n = t.visibleArea, r = t.boundaries, i = t.getAreaRestrictions, a = K({}, n), o = Q(r), a.width / a.height !== o && (a.height = a.width / o), $(a, i({
|
|
3689
3689
|
visibleArea: a,
|
|
3690
3690
|
type: "move"
|
|
3691
3691
|
}))), e.priority === "visible-area" ? e.resetCoordinates() : e.coordinates = e.fitCoordinates({
|
|
@@ -3726,7 +3726,7 @@ var Sn = ["transitions"], Cn = U("vue-advanced-cropper"), wn = {
|
|
|
3726
3726
|
var e, t = this;
|
|
3727
3727
|
if (this.imageLoaded = !1, this.delayedTransforms = null, this.src) {
|
|
3728
3728
|
if (function(e) {
|
|
3729
|
-
if (
|
|
3729
|
+
if (We(e)) return !1;
|
|
3730
3730
|
var t = window.location, n = /(\w+:)?(?:\/\/)([\w.-]+)?(?::(\d+))?\/?/.exec(e) || [], r = {
|
|
3731
3731
|
protocol: n[1] || "",
|
|
3732
3732
|
host: n[2] || "",
|
|
@@ -3736,7 +3736,7 @@ var Sn = ["transitions"], Cn = U("vue-advanced-cropper"), wn = {
|
|
|
3736
3736
|
};
|
|
3737
3737
|
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));
|
|
3738
3738
|
}(this.src)) {
|
|
3739
|
-
var n =
|
|
3739
|
+
var n = q(this.crossOrigin) ? this.canvas : this.crossOrigin;
|
|
3740
3740
|
!0 === n && (n = "anonymous"), this.imageAttributes.crossOrigin = n || null;
|
|
3741
3741
|
}
|
|
3742
3742
|
if (this.checkOrientation) {
|
|
@@ -3779,13 +3779,13 @@ var Sn = ["transitions"], Cn = U("vue-advanced-cropper"), wn = {
|
|
|
3779
3779
|
},
|
|
3780
3780
|
onParseImage: function(e) {
|
|
3781
3781
|
var t = this, n = e.source, r = e.arrayBuffer, i = e.orientation;
|
|
3782
|
-
this.imageAttributes.revoke && this.imageAttributes.src && URL.revokeObjectURL(this.imageAttributes.src), this.imageAttributes.revoke = !1, r && i && i > 1 ?
|
|
3782
|
+
this.imageAttributes.revoke && this.imageAttributes.src && URL.revokeObjectURL(this.imageAttributes.src), this.imageAttributes.revoke = !1, r && i && i > 1 ? Ue(n) || !We(n) ? (this.imageAttributes.src = URL.createObjectURL(new Blob([r])), this.imageAttributes.revoke = !0) : this.imageAttributes.src = function(e) {
|
|
3783
3783
|
for (var t = [], n = new Uint8Array(e); n.length > 0;) {
|
|
3784
3784
|
var r = n.subarray(0, 8192);
|
|
3785
3785
|
t.push(String.fromCharCode.apply(null, Array.from ? Array.from(r) : r.slice())), n = n.subarray(8192);
|
|
3786
3786
|
}
|
|
3787
3787
|
return "data:image/jpeg;base64," + btoa(t.join(""));
|
|
3788
|
-
}(r) : this.imageAttributes.src = n,
|
|
3788
|
+
}(r) : this.imageAttributes.src = n, Ge(this.defaultTransforms) ? this.appliedImageTransforms = on(this.defaultTransforms()) : Ke(this.defaultTransforms) ? this.appliedImageTransforms = on(this.defaultTransforms) : this.appliedImageTransforms = function(e) {
|
|
3789
3789
|
var t = on({});
|
|
3790
3790
|
if (e) switch (e) {
|
|
3791
3791
|
case 2:
|
|
@@ -3809,7 +3809,7 @@ var Sn = ["transitions"], Cn = U("vue-advanced-cropper"), wn = {
|
|
|
3809
3809
|
case 8: t.rotate = -90;
|
|
3810
3810
|
}
|
|
3811
3811
|
return t;
|
|
3812
|
-
}(i), this.defaultImageTransforms =
|
|
3812
|
+
}(i), this.defaultImageTransforms = H(H({}, this.appliedImageTransforms), {}, { flip: H({}, this.appliedImageTransforms.flip) }), this.$nextTick((function() {
|
|
3813
3813
|
var e = t.$refs.image;
|
|
3814
3814
|
e && e.complete && (function(e) {
|
|
3815
3815
|
return !!e.naturalWidth;
|
|
@@ -3825,7 +3825,7 @@ var Sn = ["transitions"], Cn = U("vue-advanced-cropper"), wn = {
|
|
|
3825
3825
|
onMove: function(e) {
|
|
3826
3826
|
var t = this;
|
|
3827
3827
|
this.transitionsOptions.enabled || this.awaitRender((function() {
|
|
3828
|
-
t.coordinates = t.moveAlgorithm(
|
|
3828
|
+
t.coordinates = t.moveAlgorithm(H(H({}, t.getPublicProperties()), {}, {
|
|
3829
3829
|
positionRestrictions: Vt(t.positionRestrictions, t.visibleArea),
|
|
3830
3830
|
coordinates: t.coordinates,
|
|
3831
3831
|
event: t.normalizeEvent(e)
|
|
@@ -3836,7 +3836,7 @@ var Sn = ["transitions"], Cn = U("vue-advanced-cropper"), wn = {
|
|
|
3836
3836
|
var t = this;
|
|
3837
3837
|
this.transitionsOptions.enabled || this.stencilSize && !this.autoZoom || this.awaitRender((function() {
|
|
3838
3838
|
var n = t.sizeRestrictions, r = Math.min(t.coordinates.width, t.coordinates.height, 20 * t.coefficient);
|
|
3839
|
-
t.coordinates = t.resizeAlgorithm(
|
|
3839
|
+
t.coordinates = t.resizeAlgorithm(H(H({}, t.getPublicProperties()), {}, {
|
|
3840
3840
|
positionRestrictions: Vt(t.positionRestrictions, t.visibleArea),
|
|
3841
3841
|
sizeRestrictions: {
|
|
3842
3842
|
maxWidth: Math.min(n.maxWidth, t.visibleArea.width),
|
|
@@ -3853,7 +3853,7 @@ var Sn = ["transitions"], Cn = U("vue-advanced-cropper"), wn = {
|
|
|
3853
3853
|
if (!this.transitionsOptions.enabled) {
|
|
3854
3854
|
var n = t.transitions, r = n !== void 0 && n, i = t.normalize, a = i === void 0 || i;
|
|
3855
3855
|
r && this.enableTransitions();
|
|
3856
|
-
var o = Ht(
|
|
3856
|
+
var o = Ht(H(H({}, this.getPublicProperties()), {}, {
|
|
3857
3857
|
event: a ? this.normalizeEvent(e) : e,
|
|
3858
3858
|
getAreaRestrictions: this.getAreaRestrictions,
|
|
3859
3859
|
imageRestriction: this.imageRestriction,
|
|
@@ -3881,9 +3881,9 @@ var Sn = ["transitions"], Cn = U("vue-advanced-cropper"), wn = {
|
|
|
3881
3881
|
var s = this.$refs.stencil.aspectRatios();
|
|
3882
3882
|
t = s.minimum, n = s.maximum;
|
|
3883
3883
|
}
|
|
3884
|
-
if (
|
|
3884
|
+
if (q(t) && (t = q(i) ? a : i), q(n) && (n = q(i) ? o : i), !e && (q(t) || q(n))) {
|
|
3885
3885
|
var c = this.getStencilSize(), l = c ? Q(c) : null;
|
|
3886
|
-
|
|
3886
|
+
q(t) && (t = Ye(l) ? l : void 0), q(n) && (n = Ye(l) ? l : void 0);
|
|
3887
3887
|
}
|
|
3888
3888
|
return {
|
|
3889
3889
|
minimum: t,
|
|
@@ -3901,7 +3901,7 @@ var Sn = ["transitions"], Cn = U("vue-advanced-cropper"), wn = {
|
|
|
3901
3901
|
coefficient: this.coefficient,
|
|
3902
3902
|
coordinates: this.coordinates,
|
|
3903
3903
|
aspectRatio: this.getAspectRatio(!0)
|
|
3904
|
-
}, t = e.boundaries, n = e.stencilSize, r = e.aspectRatio, bt(Q(i =
|
|
3904
|
+
}, t = e.boundaries, n = e.stencilSize, r = e.aspectRatio, bt(Q(i = Ge(n) ? n({
|
|
3905
3905
|
boundaries: t,
|
|
3906
3906
|
aspectRatio: r
|
|
3907
3907
|
}) : n), r) && (i = jt({
|
|
@@ -3946,13 +3946,13 @@ var Sn = ["transitions"], Cn = U("vue-advanced-cropper"), wn = {
|
|
|
3946
3946
|
};
|
|
3947
3947
|
},
|
|
3948
3948
|
defaultCoordinates: function() {
|
|
3949
|
-
return
|
|
3949
|
+
return H({}, dt);
|
|
3950
3950
|
},
|
|
3951
3951
|
flip: function(e, t) {
|
|
3952
3952
|
var n = (arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}).transitions, r = n === void 0 || n;
|
|
3953
3953
|
if (!this.transitionsActive) {
|
|
3954
3954
|
r && this.enableTransitions();
|
|
3955
|
-
var i =
|
|
3955
|
+
var i = H({}, this.imageTransforms.flip), a = Wt({
|
|
3956
3956
|
flip: {
|
|
3957
3957
|
horizontal: e ? !i.horizontal : i.horizontal,
|
|
3958
3958
|
vertical: t ? !i.vertical : i.vertical
|
|
@@ -3974,7 +3974,7 @@ var Sn = ["transitions"], Cn = U("vue-advanced-cropper"), wn = {
|
|
|
3974
3974
|
var t = (arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}).transitions, n = t === void 0 || t;
|
|
3975
3975
|
if (!this.transitionsActive) {
|
|
3976
3976
|
n && this.enableTransitions();
|
|
3977
|
-
var r =
|
|
3977
|
+
var r = H({}, this.imageSize);
|
|
3978
3978
|
this.appliedImageTransforms.rotate += e;
|
|
3979
3979
|
var i = Ut({
|
|
3980
3980
|
visibleArea: this.visibleArea,
|
|
@@ -4130,7 +4130,7 @@ var Dn = ["data-tpl-theme"], On = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, kn
|
|
|
4130
4130
|
}, nr = {
|
|
4131
4131
|
class: "tpl:mb-1 tpl:block tpl:text-xs tpl:font-medium",
|
|
4132
4132
|
style: { color: "var(--tpl-text-muted)" }
|
|
4133
|
-
}, 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__*/
|
|
4133
|
+
}, 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__*/ L(/* @__PURE__ */ A({
|
|
4134
4134
|
__name: "MediaEditModal",
|
|
4135
4135
|
props: {
|
|
4136
4136
|
visible: { type: Boolean },
|
|
@@ -4138,54 +4138,54 @@ var Dn = ["data-tpl-theme"], On = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, kn
|
|
|
4138
4138
|
},
|
|
4139
4139
|
emits: ["save", "close"],
|
|
4140
4140
|
setup(e, { emit: t }) {
|
|
4141
|
-
let r = e, i = t, { t: a } =
|
|
4141
|
+
let r = e, i = t, { t: a } = V(), s = l("tplUiTheme"), f = l(Me, d(null)), T = a.mediaLibrary, { isImageMimeType: D } = Ee(), A = d(""), M = d(""), te = d(null), N = d("free"), ne = d(void 0), P = d(void 0), F = d(""), I = d(""), L = d(void 0), R = d(null), re = d(!1), z = d(!1), ie = d(!1), ae = h(() => r.item ? [
|
|
4142
4142
|
"image/jpeg",
|
|
4143
4143
|
"image/png",
|
|
4144
4144
|
"image/webp",
|
|
4145
4145
|
"image/gif"
|
|
4146
|
-
].includes(r.item.mime_type) : !1),
|
|
4146
|
+
].includes(r.item.mime_type) : !1), oe = h(() => N.value === "original" ? L.value : De[N.value]), se = h(() => R.value ? je(R.value.width, R.value.height, ne.value, P.value) : null);
|
|
4147
4147
|
ee(() => r.visible, (e) => {
|
|
4148
|
-
e && r.item && (A.value = r.item.filename, M.value = r.item.alt_text || "", N.value = "free", ne.value = void 0,
|
|
4148
|
+
e && r.item && (A.value = r.item.filename, M.value = r.item.alt_text || "", N.value = "free", ne.value = void 0, P.value = void 0, F.value = "", I.value = "", L.value = void 0, R.value = null, re.value = !1, ie.value = !1, r.item.width && r.item.height && (L.value = r.item.width / r.item.height));
|
|
4149
4149
|
});
|
|
4150
|
-
function
|
|
4151
|
-
e.coordinates && (
|
|
4150
|
+
function ce(e) {
|
|
4151
|
+
e.coordinates && (R.value = {
|
|
4152
4152
|
width: Math.round(e.coordinates.width),
|
|
4153
4153
|
height: Math.round(e.coordinates.height)
|
|
4154
|
-
},
|
|
4154
|
+
}, ie.value = !0);
|
|
4155
4155
|
}
|
|
4156
|
-
function
|
|
4157
|
-
|
|
4156
|
+
function le() {
|
|
4157
|
+
re.value = !0, !L.value && r.item?.width && r.item?.height && (L.value = r.item.width / r.item.height);
|
|
4158
4158
|
}
|
|
4159
|
-
function
|
|
4159
|
+
function B(e) {
|
|
4160
4160
|
let t = e.target.value;
|
|
4161
|
-
|
|
4161
|
+
F.value = t, ne.value = t && parseInt(t, 10) || void 0;
|
|
4162
4162
|
}
|
|
4163
|
-
function
|
|
4163
|
+
function ue(e) {
|
|
4164
4164
|
let t = e.target.value;
|
|
4165
|
-
|
|
4165
|
+
I.value = t, P.value = t && parseInt(t, 10) || void 0;
|
|
4166
4166
|
}
|
|
4167
|
-
async function
|
|
4167
|
+
async function de() {
|
|
4168
4168
|
let e = A.value.trim();
|
|
4169
|
-
if (!e || !r.item ||
|
|
4169
|
+
if (!e || !r.item || z.value) return;
|
|
4170
4170
|
let t = D(r.item.mime_type), n;
|
|
4171
|
-
if (
|
|
4172
|
-
|
|
4171
|
+
if (ae.value && te.value && ie.value) {
|
|
4172
|
+
z.value = !0;
|
|
4173
4173
|
try {
|
|
4174
4174
|
let { canvas: e } = te.value.getResult();
|
|
4175
4175
|
if (e) {
|
|
4176
|
-
let t =
|
|
4177
|
-
n = { file: await
|
|
4176
|
+
let t = ke(e, ne.value, P.value), i = Oe(r.item.mime_type);
|
|
4177
|
+
n = { file: await Ae(t, r.item.filename, i) };
|
|
4178
4178
|
}
|
|
4179
4179
|
} catch {
|
|
4180
|
-
|
|
4180
|
+
z.value = !1;
|
|
4181
4181
|
return;
|
|
4182
4182
|
}
|
|
4183
|
-
|
|
4183
|
+
z.value = !1;
|
|
4184
4184
|
}
|
|
4185
4185
|
i("save", r.item.id, e, t ? M.value : void 0, n), i("close");
|
|
4186
4186
|
}
|
|
4187
|
-
function
|
|
4188
|
-
e.key === "Enter" && !
|
|
4187
|
+
function fe(e) {
|
|
4188
|
+
e.key === "Enter" && !z.value && (e.preventDefault(), de()), e.key === "Escape" && i("close");
|
|
4189
4189
|
}
|
|
4190
4190
|
return (t, r) => (o(), b(m, { to: v(f) || "body" }, [j(x, {
|
|
4191
4191
|
"enter-active-class": "tpl:transition tpl:ease-out tpl:duration-150",
|
|
@@ -4201,22 +4201,22 @@ var Dn = ["data-tpl-theme"], On = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, kn
|
|
|
4201
4201
|
class: "tpl tpl:fixed tpl:inset-0 tpl:z-[10000] tpl:flex tpl:items-center tpl:justify-center",
|
|
4202
4202
|
style: { "background-color": "var(--tpl-overlay)" },
|
|
4203
4203
|
onClick: r[3] ||= y((e) => i("close"), ["self"]),
|
|
4204
|
-
onKeydown:
|
|
4204
|
+
onKeydown: fe
|
|
4205
4205
|
}, [w("div", {
|
|
4206
|
-
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",
|
|
4206
|
+
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", ae.value ? "tpl:max-w-2xl" : "tpl:max-w-sm"]),
|
|
4207
4207
|
style: { "background-color": "var(--tpl-bg-elevated)" }
|
|
4208
4208
|
}, [
|
|
4209
4209
|
w("div", On, [w("h3", kn, p(v(a).mediaLibrary.editFile), 1)]),
|
|
4210
4210
|
w("div", An, [
|
|
4211
|
-
|
|
4211
|
+
ae.value ? (o(), g("div", jn, [w("div", Mn, [j(v(wn), {
|
|
4212
4212
|
ref_key: "cropperRef",
|
|
4213
4213
|
ref: te,
|
|
4214
4214
|
src: e.item.url,
|
|
4215
|
-
"stencil-props": { aspectRatio:
|
|
4215
|
+
"stencil-props": { aspectRatio: oe.value },
|
|
4216
4216
|
class: "tpl:h-full tpl:w-full",
|
|
4217
4217
|
"background-class": "tpl-cropper-background",
|
|
4218
|
-
onChange:
|
|
4219
|
-
onReady:
|
|
4218
|
+
onChange: ce,
|
|
4219
|
+
onReady: le
|
|
4220
4220
|
}, null, 8, ["src", "stencil-props"])]), w("div", Nn, [
|
|
4221
4221
|
w("div", null, [w("label", Pn, p(v(a).mediaLibrary.cropAspectRatio), 1), w("div", Fn, [(o(), g(O, null, c([
|
|
4222
4222
|
"free",
|
|
@@ -4236,7 +4236,7 @@ var Dn = ["data-tpl-theme"], On = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, kn
|
|
|
4236
4236
|
onClick: (t) => N.value = e
|
|
4237
4237
|
}, p(v(T)[`crop${e.charAt(0).toUpperCase()}${e.slice(1)}`]), 13, In)), 64))])]),
|
|
4238
4238
|
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", {
|
|
4239
|
-
value:
|
|
4239
|
+
value: F.value,
|
|
4240
4240
|
type: "number",
|
|
4241
4241
|
min: "1",
|
|
4242
4242
|
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",
|
|
@@ -4245,10 +4245,10 @@ var Dn = ["data-tpl-theme"], On = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, kn
|
|
|
4245
4245
|
"background-color": "var(--tpl-bg)",
|
|
4246
4246
|
color: "var(--tpl-text)"
|
|
4247
4247
|
},
|
|
4248
|
-
placeholder:
|
|
4249
|
-
onInput:
|
|
4248
|
+
placeholder: R.value?.width?.toString() || "",
|
|
4249
|
+
onInput: B
|
|
4250
4250
|
}, 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", {
|
|
4251
|
-
value:
|
|
4251
|
+
value: I.value,
|
|
4252
4252
|
type: "number",
|
|
4253
4253
|
min: "1",
|
|
4254
4254
|
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",
|
|
@@ -4257,10 +4257,10 @@ var Dn = ["data-tpl-theme"], On = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, kn
|
|
|
4257
4257
|
"background-color": "var(--tpl-bg)",
|
|
4258
4258
|
color: "var(--tpl-text)"
|
|
4259
4259
|
},
|
|
4260
|
-
placeholder:
|
|
4261
|
-
onInput:
|
|
4260
|
+
placeholder: R.value?.height?.toString() || "",
|
|
4261
|
+
onInput: ue
|
|
4262
4262
|
}, null, 40, Jn), w("span", Yn, p(v(a).mediaLibrary.cropPixels), 1)])])]),
|
|
4263
|
-
|
|
4263
|
+
se.value ? (o(), g("div", Xn, [w("span", null, p(v(a).mediaLibrary.cropOutputSize) + ": ", 1), w("span", Zn, p(se.value.width) + " x " + p(se.value.height) + " " + p(v(a).mediaLibrary.cropPixels), 1)])) : _("", !0)
|
|
4264
4264
|
])])) : _("", !0),
|
|
4265
4265
|
w("div", Qn, [w("label", $n, p(v(a).mediaLibrary.fileName), 1), n(w("input", {
|
|
4266
4266
|
"onUpdate:modelValue": r[0] ||= (e) => A.value = e,
|
|
@@ -4271,7 +4271,7 @@ var Dn = ["data-tpl-theme"], On = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, kn
|
|
|
4271
4271
|
"background-color": "var(--tpl-bg)",
|
|
4272
4272
|
color: "var(--tpl-text)"
|
|
4273
4273
|
},
|
|
4274
|
-
autofocus: !
|
|
4274
|
+
autofocus: !ae.value
|
|
4275
4275
|
}, null, 8, er), [[S, A.value]])]),
|
|
4276
4276
|
v(D)(e.item.mime_type) ? (o(), g("div", tr, [w("label", nr, p(v(a).mediaLibrary.altText), 1), n(w("input", {
|
|
4277
4277
|
"onUpdate:modelValue": r[1] ||= (e) => M.value = e,
|
|
@@ -4296,9 +4296,9 @@ var Dn = ["data-tpl-theme"], On = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, kn
|
|
|
4296
4296
|
}, p(v(a).mediaLibrary.cancel), 1), w("button", {
|
|
4297
4297
|
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",
|
|
4298
4298
|
style: { background: "linear-gradient(\n 135deg,\n var(--tpl-primary),\n var(--tpl-primary-hover)\n )" },
|
|
4299
|
-
disabled:
|
|
4300
|
-
onClick:
|
|
4301
|
-
}, p(
|
|
4299
|
+
disabled: z.value,
|
|
4300
|
+
onClick: de
|
|
4301
|
+
}, p(z.value ? v(a).mediaLibrary.saving : v(a).mediaLibrary.saveChanges), 9, ar)])
|
|
4302
4302
|
], 2)], 40, Dn)) : _("", !0)]),
|
|
4303
4303
|
_: 1
|
|
4304
4304
|
})], 8, ["to"]));
|
|
@@ -4326,31 +4326,31 @@ var Dn = ["data-tpl-theme"], On = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, kn
|
|
|
4326
4326
|
"deleteFolder"
|
|
4327
4327
|
],
|
|
4328
4328
|
setup(e, { emit: t }) {
|
|
4329
|
-
let i = e, a = t, { t: s } =
|
|
4330
|
-
function
|
|
4331
|
-
for (let n of e) if (n.id === t || n.children &&
|
|
4329
|
+
let i = e, a = t, { t: s } = V(), 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);
|
|
4330
|
+
function te(e, t) {
|
|
4331
|
+
for (let n of e) if (n.id === t || n.children && te(n.children, t)) return !0;
|
|
4332
4332
|
return !1;
|
|
4333
4333
|
}
|
|
4334
|
-
function
|
|
4334
|
+
function N() {
|
|
4335
4335
|
l.value = !l.value;
|
|
4336
4336
|
}
|
|
4337
|
-
function
|
|
4337
|
+
function ne() {
|
|
4338
4338
|
u.value = !0, m.value = i.folder.name;
|
|
4339
4339
|
}
|
|
4340
|
-
function
|
|
4340
|
+
function P() {
|
|
4341
4341
|
let e = m.value.trim();
|
|
4342
4342
|
e && e !== i.folder.name && a("renameFolder", i.folder.id, e), u.value = !1, m.value = "";
|
|
4343
4343
|
}
|
|
4344
|
-
function
|
|
4344
|
+
function I() {
|
|
4345
4345
|
u.value = !1, m.value = "";
|
|
4346
4346
|
}
|
|
4347
|
-
function
|
|
4347
|
+
function L() {
|
|
4348
4348
|
x.value = !0, T.value = "", l.value = !0;
|
|
4349
4349
|
}
|
|
4350
|
-
function
|
|
4350
|
+
function R() {
|
|
4351
4351
|
T.value.trim() && a("createFolder", T.value.trim(), i.folder.id), x.value = !1, T.value = "";
|
|
4352
4352
|
}
|
|
4353
|
-
function
|
|
4353
|
+
function z() {
|
|
4354
4354
|
x.value = !1, T.value = "";
|
|
4355
4355
|
}
|
|
4356
4356
|
return (t, i) => {
|
|
@@ -4366,8 +4366,8 @@ var Dn = ["data-tpl-theme"], On = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, kn
|
|
|
4366
4366
|
D.value || x.value ? (o(), g("button", {
|
|
4367
4367
|
key: 0,
|
|
4368
4368
|
class: "tpl:flex tpl:size-4 tpl:shrink-0 tpl:items-center tpl:justify-center tpl:rounded tpl:transition-colors",
|
|
4369
|
-
onClick: y(
|
|
4370
|
-
}, [j(v(
|
|
4369
|
+
onClick: y(N, ["stop"])
|
|
4370
|
+
}, [j(v(re), {
|
|
4371
4371
|
class: C(["tpl:transition-transform tpl:duration-150", { "tpl:rotate-90": M.value }]),
|
|
4372
4372
|
size: 10,
|
|
4373
4373
|
"stroke-width": 2
|
|
@@ -4375,7 +4375,7 @@ var Dn = ["data-tpl-theme"], On = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, kn
|
|
|
4375
4375
|
w("button", {
|
|
4376
4376
|
class: "tpl:flex tpl:min-w-0 tpl:flex-1 tpl:items-center tpl:gap-1.5",
|
|
4377
4377
|
onClick: i[0] ||= (t) => a("navigate", e.folder.id)
|
|
4378
|
-
}, [j(v(
|
|
4378
|
+
}, [j(v(fe), {
|
|
4379
4379
|
class: "tpl:shrink-0",
|
|
4380
4380
|
size: 14,
|
|
4381
4381
|
"stroke-width": 1.5
|
|
@@ -4391,8 +4391,8 @@ var Dn = ["data-tpl-theme"], On = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, kn
|
|
|
4391
4391
|
color: "var(--tpl-text)"
|
|
4392
4392
|
},
|
|
4393
4393
|
autofocus: "",
|
|
4394
|
-
onKeydown: [f(
|
|
4395
|
-
onBlur:
|
|
4394
|
+
onKeydown: [f(P, ["enter"]), f(I, ["escape"])],
|
|
4395
|
+
onBlur: P,
|
|
4396
4396
|
onClick: i[2] ||= y(() => {}, ["stop"])
|
|
4397
4397
|
}, null, 544)), [[S, m.value]]) : _("", !0),
|
|
4398
4398
|
u.value ? _("", !0) : (o(), g("span", lr, [
|
|
@@ -4400,16 +4400,16 @@ var Dn = ["data-tpl-theme"], On = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, kn
|
|
|
4400
4400
|
key: 0,
|
|
4401
4401
|
class: "tpl:flex tpl:size-6 tpl:items-center tpl:justify-center tpl:rounded tpl:transition-colors",
|
|
4402
4402
|
title: v(s).mediaLibrary.addSubfolder,
|
|
4403
|
-
onClick: y(
|
|
4404
|
-
}, [j(v(
|
|
4403
|
+
onClick: y(L, ["stop"])
|
|
4404
|
+
}, [j(v(me), {
|
|
4405
4405
|
size: 12,
|
|
4406
4406
|
"stroke-width": 2
|
|
4407
4407
|
})], 8, ur)) : _("", !0),
|
|
4408
4408
|
w("button", {
|
|
4409
4409
|
class: "tpl:flex tpl:size-6 tpl:items-center tpl:justify-center tpl:rounded tpl:transition-colors",
|
|
4410
4410
|
title: v(s).mediaLibrary.renameFolder,
|
|
4411
|
-
onClick: y(
|
|
4412
|
-
}, [j(v(
|
|
4411
|
+
onClick: y(ne, ["stop"])
|
|
4412
|
+
}, [j(v(F), {
|
|
4413
4413
|
size: 12,
|
|
4414
4414
|
"stroke-width": 2
|
|
4415
4415
|
})], 8, dr),
|
|
@@ -4450,8 +4450,8 @@ var Dn = ["data-tpl-theme"], On = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, kn
|
|
|
4450
4450
|
},
|
|
4451
4451
|
placeholder: v(s).mediaLibrary.subfolderName,
|
|
4452
4452
|
autofocus: "",
|
|
4453
|
-
onKeydown: [f(
|
|
4454
|
-
onBlur:
|
|
4453
|
+
onKeydown: [f(R, ["enter"]), f(z, ["escape"])],
|
|
4454
|
+
onBlur: R
|
|
4455
4455
|
}, null, 40, pr), [[S, T.value]])], 4)) : _("", !0)])) : _("", !0)]);
|
|
4456
4456
|
};
|
|
4457
4457
|
}
|
|
@@ -4474,7 +4474,7 @@ var Dn = ["data-tpl-theme"], On = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, kn
|
|
|
4474
4474
|
"showFrequentlyUsed"
|
|
4475
4475
|
],
|
|
4476
4476
|
setup(e, { emit: t }) {
|
|
4477
|
-
let r = t, { t: i } =
|
|
4477
|
+
let r = t, { t: i } = V(), a = d(!1), s = d("");
|
|
4478
4478
|
function l() {
|
|
4479
4479
|
a.value = !0, s.value = "";
|
|
4480
4480
|
}
|
|
@@ -4492,7 +4492,7 @@ var Dn = ["data-tpl-theme"], On = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, kn
|
|
|
4492
4492
|
color: e.viewMode === "files" && e.currentFolderId === null ? "var(--tpl-primary)" : "var(--tpl-text)"
|
|
4493
4493
|
}),
|
|
4494
4494
|
onClick: d[0] ||= (e) => r("navigate", null)
|
|
4495
|
-
}, [j(v(
|
|
4495
|
+
}, [j(v(ve), {
|
|
4496
4496
|
size: 14,
|
|
4497
4497
|
"stroke-width": 1.5
|
|
4498
4498
|
}), k(" " + p(v(i).mediaLibrary.allFiles), 1)], 4),
|
|
@@ -4525,7 +4525,7 @@ var Dn = ["data-tpl-theme"], On = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, kn
|
|
|
4525
4525
|
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",
|
|
4526
4526
|
style: { color: "var(--tpl-text-muted)" },
|
|
4527
4527
|
onClick: l
|
|
4528
|
-
}, [j(v(
|
|
4528
|
+
}, [j(v(me), {
|
|
4529
4529
|
size: 14,
|
|
4530
4530
|
"stroke-width": 1.5
|
|
4531
4531
|
}), k(" " + p(v(i).mediaLibrary.newFolder), 1)])),
|
|
@@ -4539,7 +4539,7 @@ var Dn = ["data-tpl-theme"], On = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, kn
|
|
|
4539
4539
|
color: e.viewMode === "frequently-used" ? "var(--tpl-primary)" : "var(--tpl-text)"
|
|
4540
4540
|
}),
|
|
4541
4541
|
onClick: d[6] ||= (e) => r("showFrequentlyUsed")
|
|
4542
|
-
}, [j(v(
|
|
4542
|
+
}, [j(v(_e), {
|
|
4543
4543
|
size: 14,
|
|
4544
4544
|
"stroke-width": 1.5
|
|
4545
4545
|
}), k(" " + p(v(i).mediaLibrary.frequentlyUsed), 1)], 4)) : _("", !0)
|
|
@@ -4756,7 +4756,7 @@ var Dn = ["data-tpl-theme"], On = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, kn
|
|
|
4756
4756
|
}, Yr = {
|
|
4757
4757
|
key: 4,
|
|
4758
4758
|
class: "tpl:flex tpl:justify-center tpl:py-4"
|
|
4759
|
-
}, Xr = /*#__PURE__*/
|
|
4759
|
+
}, Xr = /*#__PURE__*/ L(/* @__PURE__ */ A({
|
|
4760
4760
|
__name: "MediaGrid",
|
|
4761
4761
|
props: {
|
|
4762
4762
|
items: {},
|
|
@@ -4774,15 +4774,15 @@ var Dn = ["data-tpl-theme"], On = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, kn
|
|
|
4774
4774
|
"replace"
|
|
4775
4775
|
],
|
|
4776
4776
|
setup(e, { emit: t }) {
|
|
4777
|
-
let n = e, r = t, { isAcceptedMimeType: i, isImageMimeType: a } =
|
|
4777
|
+
let n = e, r = t, { isAcceptedMimeType: i, isImageMimeType: a } = Ee();
|
|
4778
4778
|
function s(e) {
|
|
4779
4779
|
return !n.accept || n.accept.length === 0 ? !0 : i(e.mime_type, n.accept);
|
|
4780
4780
|
}
|
|
4781
4781
|
function l(e) {
|
|
4782
4782
|
r("select", e);
|
|
4783
4783
|
}
|
|
4784
|
-
let { t: u } =
|
|
4785
|
-
|
|
4784
|
+
let { t: u } = V(), f = d(null);
|
|
4785
|
+
P(f, ([{ isIntersecting: e }]) => {
|
|
4786
4786
|
e && n.hasMore && !n.isLoading && r("loadMore");
|
|
4787
4787
|
}, { threshold: .1 });
|
|
4788
4788
|
function m(e) {
|
|
@@ -4803,7 +4803,7 @@ var Dn = ["data-tpl-theme"], On = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, kn
|
|
|
4803
4803
|
key: t,
|
|
4804
4804
|
class: C(["tpl-pulse tpl:rounded-lg", e.layout === "list" ? "tpl:h-12" : "tpl:aspect-square"]),
|
|
4805
4805
|
style: { "background-color": "var(--tpl-bg-hover)" }
|
|
4806
|
-
}, null, 2)), 64))], 2)) : e.items.length === 0 ? (o(), g("div", Cr, [j(v(
|
|
4806
|
+
}, null, 2)), 64))], 2)) : e.items.length === 0 ? (o(), g("div", Cr, [j(v(ve), {
|
|
4807
4807
|
class: "tpl:mb-3",
|
|
4808
4808
|
size: 40,
|
|
4809
4809
|
"stroke-width": 1,
|
|
@@ -4827,7 +4827,7 @@ var Dn = ["data-tpl-theme"], On = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, kn
|
|
|
4827
4827
|
style: { color: "var(--tpl-text-muted)" },
|
|
4828
4828
|
title: v(u).mediaLibrary.editFile,
|
|
4829
4829
|
onClick: y((e) => r("edit", t), ["stop"])
|
|
4830
|
-
}, [j(v(
|
|
4830
|
+
}, [j(v(F), {
|
|
4831
4831
|
size: 12,
|
|
4832
4832
|
"stroke-width": 2
|
|
4833
4833
|
})], 8, Kr), w("button", {
|
|
@@ -4839,7 +4839,7 @@ var Dn = ["data-tpl-theme"], On = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, kn
|
|
|
4839
4839
|
size: 12,
|
|
4840
4840
|
"stroke-width": 2
|
|
4841
4841
|
})], 8, qr)]),
|
|
4842
|
-
e.selectedIds.has(t.id) ? (o(), g("div", Jr, [j(v(
|
|
4842
|
+
e.selectedIds.has(t.id) ? (o(), g("div", Jr, [j(v(R), {
|
|
4843
4843
|
size: 12,
|
|
4844
4844
|
"stroke-width": 3
|
|
4845
4845
|
})])) : _("", !0)
|
|
@@ -4872,7 +4872,7 @@ var Dn = ["data-tpl-theme"], On = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, kn
|
|
|
4872
4872
|
style: { "background-color": "rgba(0, 0, 0, 0.6)" },
|
|
4873
4873
|
title: v(u).mediaLibrary.editFile,
|
|
4874
4874
|
onClick: y((e) => r("edit", t), ["stop"])
|
|
4875
|
-
}, [j(v(
|
|
4875
|
+
}, [j(v(F), {
|
|
4876
4876
|
size: 11,
|
|
4877
4877
|
"stroke-width": 2
|
|
4878
4878
|
})], 8, Pr), w("button", {
|
|
@@ -4884,7 +4884,7 @@ var Dn = ["data-tpl-theme"], On = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, kn
|
|
|
4884
4884
|
size: 11,
|
|
4885
4885
|
"stroke-width": 2
|
|
4886
4886
|
})], 8, Fr)]),
|
|
4887
|
-
e.selectedIds.has(t.id) ? (o(), g("div", Ir, [j(v(
|
|
4887
|
+
e.selectedIds.has(t.id) ? (o(), g("div", Ir, [j(v(R), {
|
|
4888
4888
|
size: 12,
|
|
4889
4889
|
"stroke-width": 3
|
|
4890
4890
|
})])) : _("", !0)
|
|
@@ -4894,7 +4894,7 @@ var Dn = ["data-tpl-theme"], On = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, kn
|
|
|
4894
4894
|
ref: f,
|
|
4895
4895
|
class: "tpl:h-4"
|
|
4896
4896
|
}, null, 512),
|
|
4897
|
-
e.isLoading && e.items.length > 0 ? (o(), g("div", Yr, [j(v(
|
|
4897
|
+
e.isLoading && e.items.length > 0 ? (o(), g("div", Yr, [j(v(ue), {
|
|
4898
4898
|
class: "tpl-spinner",
|
|
4899
4899
|
size: 20,
|
|
4900
4900
|
"stroke-width": 2,
|
|
@@ -4924,7 +4924,7 @@ var Dn = ["data-tpl-theme"], On = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, kn
|
|
|
4924
4924
|
},
|
|
4925
4925
|
emits: ["import", "close"],
|
|
4926
4926
|
setup(e, { emit: t }) {
|
|
4927
|
-
let r = e, i = t, { t: a } =
|
|
4927
|
+
let r = e, i = t, { t: a } = V(), s = l("tplUiTheme"), c = l(Me, d(null)), f = d("");
|
|
4928
4928
|
ee(() => r.visible, (e) => {
|
|
4929
4929
|
e && (f.value = "");
|
|
4930
4930
|
});
|
|
@@ -4983,7 +4983,7 @@ var Dn = ["data-tpl-theme"], On = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, kn
|
|
|
4983
4983
|
style: { background: "linear-gradient(\n 135deg,\n var(--tpl-primary),\n var(--tpl-primary-hover)\n )" },
|
|
4984
4984
|
disabled: !f.value.trim() || e.isImporting,
|
|
4985
4985
|
onClick: h
|
|
4986
|
-
}, [e.isImporting ? (o(), g("span", oi, [j(v(
|
|
4986
|
+
}, [e.isImporting ? (o(), g("span", oi, [j(v(ue), {
|
|
4987
4987
|
class: "tpl:animate-spin",
|
|
4988
4988
|
size: 12,
|
|
4989
4989
|
"stroke-width": 2
|
|
@@ -5004,7 +5004,7 @@ var Dn = ["data-tpl-theme"], On = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, kn
|
|
|
5004
5004
|
},
|
|
5005
5005
|
emits: ["select", "close"],
|
|
5006
5006
|
setup(e, { emit: t }) {
|
|
5007
|
-
let n = t, { t: r } =
|
|
5007
|
+
let n = t, { t: r } = V(), i = d(null);
|
|
5008
5008
|
function a(e, t = 0) {
|
|
5009
5009
|
let n = [];
|
|
5010
5010
|
for (let r of e) n.push({
|
|
@@ -5014,7 +5014,7 @@ var Dn = ["data-tpl-theme"], On = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, kn
|
|
|
5014
5014
|
}), r.children?.length && n.push(...a(r.children, t + 1));
|
|
5015
5015
|
return n;
|
|
5016
5016
|
}
|
|
5017
|
-
return
|
|
5017
|
+
return se(i, () => {
|
|
5018
5018
|
n("close");
|
|
5019
5019
|
}), (t, s) => (o(), g("div", {
|
|
5020
5020
|
ref_key: "pickerRef",
|
|
@@ -5029,7 +5029,7 @@ var Dn = ["data-tpl-theme"], On = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, kn
|
|
|
5029
5029
|
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",
|
|
5030
5030
|
style: { color: "var(--tpl-text)" },
|
|
5031
5031
|
onClick: s[0] ||= (e) => n("select", null)
|
|
5032
|
-
}, [j(v(
|
|
5032
|
+
}, [j(v(ve), {
|
|
5033
5033
|
class: "tpl:shrink-0",
|
|
5034
5034
|
size: 14,
|
|
5035
5035
|
"stroke-width": 1.5
|
|
@@ -5044,7 +5044,7 @@ var Dn = ["data-tpl-theme"], On = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, kn
|
|
|
5044
5044
|
disabled: t.id === e.currentFolderId,
|
|
5045
5045
|
onClick: (e) => n("select", t.id)
|
|
5046
5046
|
}, [
|
|
5047
|
-
j(v(
|
|
5047
|
+
j(v(fe), {
|
|
5048
5048
|
class: "tpl:shrink-0",
|
|
5049
5049
|
size: 14,
|
|
5050
5050
|
"stroke-width": 1.5
|
|
@@ -5069,7 +5069,7 @@ var Dn = ["data-tpl-theme"], On = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, kn
|
|
|
5069
5069
|
}, xi = {
|
|
5070
5070
|
class: "tpl:block tpl:text-[10px]",
|
|
5071
5071
|
style: { color: "var(--tpl-text-muted)" }
|
|
5072
|
-
}, Si = ["value"], Ci = ["value"], wi = /*#__PURE__*/
|
|
5072
|
+
}, Si = ["value"], Ci = ["value"], wi = /*#__PURE__*/ L(/* @__PURE__ */ A({
|
|
5073
5073
|
__name: "MediaPreviewPanel",
|
|
5074
5074
|
props: {
|
|
5075
5075
|
item: {},
|
|
@@ -5078,7 +5078,7 @@ var Dn = ["data-tpl-theme"], On = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, kn
|
|
|
5078
5078
|
},
|
|
5079
5079
|
emits: ["update:selectedConversion"],
|
|
5080
5080
|
setup(e, { emit: t }) {
|
|
5081
|
-
let n = e, r = t, { t: i } =
|
|
5081
|
+
let n = e, r = t, { t: i } = V(), { isImageMimeType: a } = Ee(), s = h(() => {
|
|
5082
5082
|
if (!y.value || !n.item.conversions_generated) return [];
|
|
5083
5083
|
let e = [];
|
|
5084
5084
|
return n.item.small_url && e.push({
|
|
@@ -5155,7 +5155,7 @@ var Dn = ["data-tpl-theme"], On = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, kn
|
|
|
5155
5155
|
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),
|
|
5156
5156
|
m.value ? (o(), g(O, { key: 1 }, [
|
|
5157
5157
|
n[0] ||= k(" · ", -1),
|
|
5158
|
-
j(v(
|
|
5158
|
+
j(v(fe), {
|
|
5159
5159
|
class: "tpl:mb-px tpl:inline",
|
|
5160
5160
|
size: 9,
|
|
5161
5161
|
"stroke-width": 2
|
|
@@ -5221,7 +5221,7 @@ var Dn = ["data-tpl-theme"], On = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, kn
|
|
|
5221
5221
|
},
|
|
5222
5222
|
emits: ["replace", "close"],
|
|
5223
5223
|
setup(e, { emit: t }) {
|
|
5224
|
-
let n = e, r = t, { t: i } =
|
|
5224
|
+
let n = e, r = t, { t: i } = V(), a = l("tplUiTheme"), s = l(Me, d(null)), c = d(null), f = d(null), S = h(() => {
|
|
5225
5225
|
if (!n.item) return "";
|
|
5226
5226
|
let e = n.item.filename.split(".");
|
|
5227
5227
|
return e.length > 1 ? e[e.length - 1].toLowerCase() : "";
|
|
@@ -5312,7 +5312,7 @@ var Dn = ["data-tpl-theme"], On = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, kn
|
|
|
5312
5312
|
},
|
|
5313
5313
|
emits: ["upload"],
|
|
5314
5314
|
setup(e, { emit: t }) {
|
|
5315
|
-
let n = t, { t: r, format: i } =
|
|
5315
|
+
let n = t, { t: r, format: i } = V(), { allAcceptedMimeTypes: a, allAcceptedInputString: s, maxFileSize: c } = Ee(), l = d();
|
|
5316
5316
|
function u(e) {
|
|
5317
5317
|
let t = [];
|
|
5318
5318
|
for (let n of Array.from(e)) a.value.includes(n.type) && n.size <= c.value && t.push(n);
|
|
@@ -5322,9 +5322,9 @@ var Dn = ["data-tpl-theme"], On = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, kn
|
|
|
5322
5322
|
let t = u(e);
|
|
5323
5323
|
t.length && n("upload", t);
|
|
5324
5324
|
}
|
|
5325
|
-
let { isOverDropZone: m } =
|
|
5325
|
+
let { isOverDropZone: m } = z(l, { onDrop: (e) => {
|
|
5326
5326
|
e?.length && f(e);
|
|
5327
|
-
} }), { open: h, onChange: _ } =
|
|
5327
|
+
} }), { open: h, onChange: _ } = ne({
|
|
5328
5328
|
accept: s.value,
|
|
5329
5329
|
multiple: !0
|
|
5330
5330
|
});
|
|
@@ -5339,7 +5339,7 @@ var Dn = ["data-tpl-theme"], On = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, kn
|
|
|
5339
5339
|
"background-color": "var(--tpl-bg)"
|
|
5340
5340
|
},
|
|
5341
5341
|
onClick: n[0] ||= (e) => v(h)()
|
|
5342
|
-
}, [e.isUploading ? (o(), g("div", Bi, [j(v(
|
|
5342
|
+
}, [e.isUploading ? (o(), g("div", Bi, [j(v(ue), {
|
|
5343
5343
|
class: "tpl-spinner",
|
|
5344
5344
|
size: 20,
|
|
5345
5345
|
"stroke-width": 2,
|
|
@@ -5348,7 +5348,7 @@ var Dn = ["data-tpl-theme"], On = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, kn
|
|
|
5348
5348
|
current: e.uploadProgress.current,
|
|
5349
5349
|
total: e.uploadProgress.total
|
|
5350
5350
|
}) : v(r).mediaLibrary.uploading), 1)])) : (o(), g(O, { key: 1 }, [
|
|
5351
|
-
j(v(
|
|
5351
|
+
j(v(ce), {
|
|
5352
5352
|
class: "tpl:mb-2",
|
|
5353
5353
|
size: 24,
|
|
5354
5354
|
"stroke-width": 1.5,
|
|
@@ -5390,7 +5390,7 @@ var Dn = ["data-tpl-theme"], On = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, kn
|
|
|
5390
5390
|
size: {}
|
|
5391
5391
|
},
|
|
5392
5392
|
setup(e) {
|
|
5393
|
-
let t = e, { t: n, format: r } =
|
|
5393
|
+
let t = e, { t: n, format: r } = V(), 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)");
|
|
5394
5394
|
function y(e) {
|
|
5395
5395
|
if (e === 0) return "0 B";
|
|
5396
5396
|
let t = 1024, n = [
|
|
@@ -5479,13 +5479,13 @@ function Xi(e) {
|
|
|
5479
5479
|
}), ee(() => t.previewItem.value?.id, () => {
|
|
5480
5480
|
c.value = "original";
|
|
5481
5481
|
});
|
|
5482
|
-
let b =
|
|
5482
|
+
let b = ae((e) => {
|
|
5483
5483
|
t.search(e);
|
|
5484
5484
|
}, 300);
|
|
5485
5485
|
function x(e) {
|
|
5486
5486
|
s.value = e, b(e);
|
|
5487
5487
|
}
|
|
5488
|
-
let { copy: S, copied: C } =
|
|
5488
|
+
let { copy: S, copied: C } = N({
|
|
5489
5489
|
copiedDuring: 2e3,
|
|
5490
5490
|
legacy: !0
|
|
5491
5491
|
});
|
|
@@ -5519,13 +5519,13 @@ function Xi(e) {
|
|
|
5519
5519
|
async function te() {
|
|
5520
5520
|
await t.checkUsageBeforeDelete();
|
|
5521
5521
|
}
|
|
5522
|
-
function
|
|
5522
|
+
function ne(e) {
|
|
5523
5523
|
t.checkUsageBeforeReplace(e);
|
|
5524
5524
|
}
|
|
5525
|
-
async function
|
|
5525
|
+
async function P(e) {
|
|
5526
5526
|
await t.replaceFile(e);
|
|
5527
5527
|
}
|
|
5528
|
-
function
|
|
5528
|
+
function F() {
|
|
5529
5529
|
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";
|
|
5530
5530
|
}
|
|
5531
5531
|
return {
|
|
@@ -5554,9 +5554,9 @@ function Xi(e) {
|
|
|
5554
5554
|
handleImportFromUrl: j,
|
|
5555
5555
|
handleMoveToFolder: M,
|
|
5556
5556
|
handleDeleteClick: te,
|
|
5557
|
-
handleReplaceItem:
|
|
5558
|
-
handleReplaceFile:
|
|
5559
|
-
resetUI:
|
|
5557
|
+
handleReplaceItem: ne,
|
|
5558
|
+
handleReplaceFile: P,
|
|
5559
|
+
resetUI: F
|
|
5560
5560
|
};
|
|
5561
5561
|
}
|
|
5562
5562
|
//#endregion
|
|
@@ -5636,32 +5636,32 @@ var Zi = ["data-tpl-theme"], Qi = {
|
|
|
5636
5636
|
},
|
|
5637
5637
|
emits: ["close", "select"],
|
|
5638
5638
|
setup(e, { emit: t }) {
|
|
5639
|
-
let n = e, r = t, { t: i } =
|
|
5640
|
-
s(
|
|
5641
|
-
let d = l("authManager"), f = l("projectId"), S = h(() => f.value), T = l("planConfig"), A = h(() => T.hasFeature("media_folders")),
|
|
5639
|
+
let n = e, r = t, { t: i } = V(), a = l("tplUiTheme");
|
|
5640
|
+
s(Me, D(() => n.popoverTarget ?? null));
|
|
5641
|
+
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), ne = h(() => T.config.value?.storage.limit_bytes ?? 0), { isAcceptedMimeType: P, availableCategories: F } = Ee(), I = xe({
|
|
5642
5642
|
projectId: S.value,
|
|
5643
5643
|
authManager: d
|
|
5644
|
-
}),
|
|
5645
|
-
library:
|
|
5644
|
+
}), L = Xi({
|
|
5645
|
+
library: I,
|
|
5646
5646
|
canUseMediaFolders: A,
|
|
5647
5647
|
translations: i
|
|
5648
5648
|
});
|
|
5649
5649
|
ee(() => n.visible, (e) => {
|
|
5650
|
-
e ? (
|
|
5650
|
+
e ? (I.loadItems(), I.loadFrequentlyUsed()) : L.resetUI();
|
|
5651
5651
|
});
|
|
5652
|
-
function
|
|
5652
|
+
function re(e) {
|
|
5653
5653
|
e.key === "Escape" && r("close");
|
|
5654
5654
|
}
|
|
5655
|
-
|
|
5656
|
-
function
|
|
5657
|
-
return
|
|
5655
|
+
le(document, "keydown", re);
|
|
5656
|
+
function z() {
|
|
5657
|
+
return I.previewItem.value ? n.accept?.length ? P(I.previewItem.value.mime_type, n.accept) : !0 : !1;
|
|
5658
5658
|
}
|
|
5659
|
-
function
|
|
5660
|
-
if (
|
|
5661
|
-
let e =
|
|
5659
|
+
function ie() {
|
|
5660
|
+
if (z()) {
|
|
5661
|
+
let e = I.previewItem.value;
|
|
5662
5662
|
r("select", {
|
|
5663
5663
|
...e,
|
|
5664
|
-
url:
|
|
5664
|
+
url: L.selectedUrl.value || e.url
|
|
5665
5665
|
}), r("close");
|
|
5666
5666
|
}
|
|
5667
5667
|
}
|
|
@@ -5682,11 +5682,11 @@ var Zi = ["data-tpl-theme"], Qi = {
|
|
|
5682
5682
|
w("div", $i, [w("h2", ea, p(v(i).mediaLibrary.title), 1), w("div", ta, [
|
|
5683
5683
|
j(Yi, {
|
|
5684
5684
|
"used-bytes": N.value,
|
|
5685
|
-
"limit-bytes":
|
|
5685
|
+
"limit-bytes": ne.value,
|
|
5686
5686
|
size: 22
|
|
5687
5687
|
}, null, 8, ["used-bytes", "limit-bytes"]),
|
|
5688
5688
|
w("div", na, [w("input", {
|
|
5689
|
-
value: v(
|
|
5689
|
+
value: v(L).searchInput.value,
|
|
5690
5690
|
type: "text",
|
|
5691
5691
|
class: "tpl:w-52 tpl:rounded-md tpl:border tpl:py-1.5 tpl:pr-3 tpl:pl-8 tpl:text-xs tpl:shadow-xs tpl:transition-all tpl:duration-150 tpl:outline-none tpl:focus:shadow-[var(--tpl-ring)]",
|
|
5692
5692
|
style: {
|
|
@@ -5695,8 +5695,8 @@ var Zi = ["data-tpl-theme"], Qi = {
|
|
|
5695
5695
|
color: "var(--tpl-text)"
|
|
5696
5696
|
},
|
|
5697
5697
|
placeholder: v(i).mediaLibrary.searchPlaceholder,
|
|
5698
|
-
onInput: n[0] ||= (e) => v(
|
|
5699
|
-
}, null, 40, ra), j(v(
|
|
5698
|
+
onInput: n[0] ||= (e) => v(L).handleSearchInput(e.target.value)
|
|
5699
|
+
}, null, 40, ra), j(v(ye), {
|
|
5700
5700
|
class: "tpl:absolute tpl:top-1/2 tpl:left-2.5 tpl:-translate-y-1/2",
|
|
5701
5701
|
size: 13,
|
|
5702
5702
|
"stroke-width": 2,
|
|
@@ -5706,7 +5706,7 @@ var Zi = ["data-tpl-theme"], Qi = {
|
|
|
5706
5706
|
class: "tpl:flex tpl:size-7 tpl:items-center tpl:justify-center tpl:rounded-md tpl:transition-all tpl:duration-150",
|
|
5707
5707
|
style: { color: "var(--tpl-text-muted)" },
|
|
5708
5708
|
onClick: n[1] ||= (e) => r("close")
|
|
5709
|
-
}, [j(v(
|
|
5709
|
+
}, [j(v(oe), {
|
|
5710
5710
|
size: 18,
|
|
5711
5711
|
"stroke-width": 2
|
|
5712
5712
|
})])
|
|
@@ -5719,16 +5719,16 @@ var Zi = ["data-tpl-theme"], Qi = {
|
|
|
5719
5719
|
"leave-from-class": "tpl:ml-0 tpl:opacity-100",
|
|
5720
5720
|
"leave-to-class": "tpl:-ml-48 tpl:opacity-0"
|
|
5721
5721
|
}, {
|
|
5722
|
-
default: u(() => [A.value && v(
|
|
5723
|
-
folders: v(
|
|
5724
|
-
"current-folder-id": v(
|
|
5725
|
-
"view-mode": v(
|
|
5726
|
-
"has-frequently-used": v(
|
|
5727
|
-
onNavigate: v(
|
|
5728
|
-
onCreateFolder: v(
|
|
5729
|
-
onRenameFolder: v(
|
|
5730
|
-
onDeleteFolder: v(
|
|
5731
|
-
onShowFrequentlyUsed: v(
|
|
5722
|
+
default: u(() => [A.value && v(L).showSidebar.value ? (o(), g("div", aa, [j(yr, {
|
|
5723
|
+
folders: v(I).folders.value,
|
|
5724
|
+
"current-folder-id": v(I).currentFolderId.value,
|
|
5725
|
+
"view-mode": v(I).viewMode.value,
|
|
5726
|
+
"has-frequently-used": v(L).hasFrequentlyUsed.value,
|
|
5727
|
+
onNavigate: v(I).navigateToFolder,
|
|
5728
|
+
onCreateFolder: v(L).handleCreateFolder,
|
|
5729
|
+
onRenameFolder: v(L).handleRenameFolder,
|
|
5730
|
+
onDeleteFolder: v(L).handleDeleteFolder,
|
|
5731
|
+
onShowFrequentlyUsed: v(I).showFrequentlyUsed
|
|
5732
5732
|
}, null, 8, [
|
|
5733
5733
|
"folders",
|
|
5734
5734
|
"current-folder-id",
|
|
@@ -5746,21 +5746,21 @@ var Zi = ["data-tpl-theme"], Qi = {
|
|
|
5746
5746
|
key: 0,
|
|
5747
5747
|
class: "tpl:flex tpl:size-7 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded-md tpl:transition-all tpl:duration-150",
|
|
5748
5748
|
style: E({
|
|
5749
|
-
color: v(
|
|
5750
|
-
backgroundColor: v(
|
|
5751
|
-
border: v(
|
|
5749
|
+
color: v(L).showSidebar.value ? "var(--tpl-primary)" : "var(--tpl-text-muted)",
|
|
5750
|
+
backgroundColor: v(L).showSidebar.value ? "var(--tpl-bg)" : "transparent",
|
|
5751
|
+
border: v(L).showSidebar.value ? "1px solid var(--tpl-border)" : "1px solid transparent"
|
|
5752
5752
|
}),
|
|
5753
|
-
title: v(
|
|
5754
|
-
onClick: n[2] ||= (e) => v(
|
|
5755
|
-
}, [j(v(
|
|
5753
|
+
title: v(L).showSidebar.value ? v(i).mediaLibrary.hideFolders : v(i).mediaLibrary.showFolders,
|
|
5754
|
+
onClick: n[2] ||= (e) => v(L).showSidebar.value = !v(L).showSidebar.value
|
|
5755
|
+
}, [j(v(ge), {
|
|
5756
5756
|
size: 16,
|
|
5757
5757
|
"stroke-width": 2
|
|
5758
5758
|
})], 12, la)) : _("", !0),
|
|
5759
|
-
v(
|
|
5759
|
+
v(I).viewMode.value === "frequently-used" ? (o(), g("span", ua, p(v(i).mediaLibrary.frequentlyUsed), 1)) : (o(), b(Te, {
|
|
5760
5760
|
key: 2,
|
|
5761
|
-
folders: v(
|
|
5762
|
-
"current-folder-id": v(
|
|
5763
|
-
onNavigate: v(
|
|
5761
|
+
folders: v(I).folders.value,
|
|
5762
|
+
"current-folder-id": v(I).currentFolderId.value,
|
|
5763
|
+
onNavigate: v(I).navigateToFolder
|
|
5764
5764
|
}, null, 8, [
|
|
5765
5765
|
"folders",
|
|
5766
5766
|
"current-folder-id",
|
|
@@ -5769,27 +5769,27 @@ var Zi = ["data-tpl-theme"], Qi = {
|
|
|
5769
5769
|
w("div", da, [w("button", {
|
|
5770
5770
|
class: "tpl:flex tpl:size-6 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded tpl:transition-all tpl:duration-150",
|
|
5771
5771
|
style: E({
|
|
5772
|
-
color: v(
|
|
5773
|
-
backgroundColor: v(
|
|
5772
|
+
color: v(L).layoutMode.value === "grid" ? "var(--tpl-primary)" : "var(--tpl-text-muted)",
|
|
5773
|
+
backgroundColor: v(L).layoutMode.value === "grid" ? "var(--tpl-bg-elevated)" : "transparent"
|
|
5774
5774
|
}),
|
|
5775
5775
|
title: v(i).mediaLibrary.viewGrid,
|
|
5776
|
-
onClick: n[3] ||= (e) => v(
|
|
5777
|
-
}, [j(v(
|
|
5776
|
+
onClick: n[3] ||= (e) => v(L).layoutMode.value = "grid"
|
|
5777
|
+
}, [j(v(he), {
|
|
5778
5778
|
size: 14,
|
|
5779
5779
|
"stroke-width": 2
|
|
5780
5780
|
})], 12, fa), w("button", {
|
|
5781
5781
|
class: "tpl:flex tpl:size-6 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded tpl:transition-all tpl:duration-150",
|
|
5782
5782
|
style: E({
|
|
5783
|
-
color: v(
|
|
5784
|
-
backgroundColor: v(
|
|
5783
|
+
color: v(L).layoutMode.value === "list" ? "var(--tpl-primary)" : "var(--tpl-text-muted)",
|
|
5784
|
+
backgroundColor: v(L).layoutMode.value === "list" ? "var(--tpl-bg-elevated)" : "transparent"
|
|
5785
5785
|
}),
|
|
5786
5786
|
title: v(i).mediaLibrary.viewList,
|
|
5787
|
-
onClick: n[4] ||= (e) => v(
|
|
5788
|
-
}, [j(v(
|
|
5787
|
+
onClick: n[4] ||= (e) => v(L).layoutMode.value = "list"
|
|
5788
|
+
}, [j(v(pe), {
|
|
5789
5789
|
size: 14,
|
|
5790
5790
|
"stroke-width": 2
|
|
5791
5791
|
})], 12, pa)])
|
|
5792
|
-
]), w("div", ma, [v(
|
|
5792
|
+
]), w("div", ma, [v(F).length > 1 ? (o(), g("select", {
|
|
5793
5793
|
key: 0,
|
|
5794
5794
|
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",
|
|
5795
5795
|
style: {
|
|
@@ -5797,20 +5797,20 @@ var Zi = ["data-tpl-theme"], Qi = {
|
|
|
5797
5797
|
"background-color": "var(--tpl-bg)",
|
|
5798
5798
|
color: "var(--tpl-text)"
|
|
5799
5799
|
},
|
|
5800
|
-
value: v(
|
|
5801
|
-
onChange: n[5] ||= (e) => v(
|
|
5802
|
-
}, [w("option", ga, p(v(i).mediaLibrary.filterAll), 1), (o(!0), g(O, null, c(v(
|
|
5800
|
+
value: v(I).categoryFilter.value ?? "",
|
|
5801
|
+
onChange: n[5] ||= (e) => v(I).filterByCategory(e.target.value || null)
|
|
5802
|
+
}, [w("option", ga, p(v(i).mediaLibrary.filterAll), 1), (o(!0), g(O, null, c(v(F), (e) => (o(), g("option", {
|
|
5803
5803
|
key: e,
|
|
5804
5804
|
value: e
|
|
5805
|
-
}, p(v(
|
|
5805
|
+
}, p(v(L).getCategoryLabel(e)), 9, _a))), 128))], 40, ha)) : _("", !0), w("select", {
|
|
5806
5806
|
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",
|
|
5807
5807
|
style: {
|
|
5808
5808
|
"border-color": "var(--tpl-border)",
|
|
5809
5809
|
"background-color": "var(--tpl-bg)",
|
|
5810
5810
|
color: "var(--tpl-text)"
|
|
5811
5811
|
},
|
|
5812
|
-
value: v(
|
|
5813
|
-
onChange: n[6] ||= (e) => v(
|
|
5812
|
+
value: v(I).sortOption.value,
|
|
5813
|
+
onChange: n[6] ||= (e) => v(I).sortBy(e.target.value)
|
|
5814
5814
|
}, [
|
|
5815
5815
|
w("option", ya, p(v(i).mediaLibrary.sortNewest), 1),
|
|
5816
5816
|
w("option", ba, p(v(i).mediaLibrary.sortOldest), 1),
|
|
@@ -5818,15 +5818,15 @@ var Zi = ["data-tpl-theme"], Qi = {
|
|
|
5818
5818
|
w("option", Sa, p(v(i).mediaLibrary.sortNameDesc), 1),
|
|
5819
5819
|
w("option", Ca, p(v(i).mediaLibrary.sortSizeAsc), 1),
|
|
5820
5820
|
w("option", wa, p(v(i).mediaLibrary.sortSizeDesc), 1)
|
|
5821
|
-
], 40, va)])]), w("div", Ta, [v(
|
|
5822
|
-
"is-uploading": v(
|
|
5823
|
-
"upload-progress": v(
|
|
5824
|
-
onUpload: v(
|
|
5821
|
+
], 40, va)])]), w("div", Ta, [v(I).viewMode.value === "files" ? (o(), g("div", Ea, [j(Wi, {
|
|
5822
|
+
"is-uploading": v(I).isUploading.value,
|
|
5823
|
+
"upload-progress": v(I).uploadProgress.value,
|
|
5824
|
+
onUpload: v(L).handleUpload
|
|
5825
5825
|
}, null, 8, [
|
|
5826
5826
|
"is-uploading",
|
|
5827
5827
|
"upload-progress",
|
|
5828
5828
|
"onUpload"
|
|
5829
|
-
]),
|
|
5829
|
+
]), M.value ? (o(), g("button", {
|
|
5830
5830
|
key: 0,
|
|
5831
5831
|
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",
|
|
5832
5832
|
style: {
|
|
@@ -5834,22 +5834,22 @@ var Zi = ["data-tpl-theme"], Qi = {
|
|
|
5834
5834
|
color: "var(--tpl-text-muted)",
|
|
5835
5835
|
"background-color": "var(--tpl-bg)"
|
|
5836
5836
|
},
|
|
5837
|
-
onClick: n[7] ||= (e) => v(
|
|
5838
|
-
}, [j(v(
|
|
5837
|
+
onClick: n[7] ||= (e) => v(L).showImportUrlModal.value = !0
|
|
5838
|
+
}, [j(v(de), {
|
|
5839
5839
|
size: 14,
|
|
5840
5840
|
"stroke-width": 2
|
|
5841
5841
|
}), k(" " + p(v(i).mediaLibrary.importFromUrl), 1)])) : _("", !0)])) : _("", !0), j(Xr, {
|
|
5842
|
-
items: v(
|
|
5843
|
-
"selected-ids": v(
|
|
5844
|
-
"is-loading": v(
|
|
5845
|
-
"has-more": v(
|
|
5842
|
+
items: v(L).displayItems.value,
|
|
5843
|
+
"selected-ids": v(I).selectedItems.value,
|
|
5844
|
+
"is-loading": v(I).isLoading.value,
|
|
5845
|
+
"has-more": v(I).viewMode.value === "files" && v(I).hasMore.value,
|
|
5846
5846
|
accept: e.accept,
|
|
5847
|
-
layout: v(
|
|
5848
|
-
onSelect: v(
|
|
5849
|
-
onToggle: v(
|
|
5850
|
-
onLoadMore: v(
|
|
5851
|
-
onEdit: v(
|
|
5852
|
-
onReplace: v(
|
|
5847
|
+
layout: v(L).layoutMode.value,
|
|
5848
|
+
onSelect: v(L).handleSelect,
|
|
5849
|
+
onToggle: v(I).toggleSelection,
|
|
5850
|
+
onLoadMore: v(I).loadMore,
|
|
5851
|
+
onEdit: v(L).handleEditItem,
|
|
5852
|
+
onReplace: v(L).handleReplaceItem
|
|
5853
5853
|
}, null, 8, [
|
|
5854
5854
|
"items",
|
|
5855
5855
|
"selected-ids",
|
|
@@ -5864,11 +5864,11 @@ var Zi = ["data-tpl-theme"], Qi = {
|
|
|
5864
5864
|
"onReplace"
|
|
5865
5865
|
])])])]),
|
|
5866
5866
|
j(ci, {
|
|
5867
|
-
visible: v(
|
|
5868
|
-
"is-importing": v(
|
|
5869
|
-
error: v(
|
|
5870
|
-
onImport: v(
|
|
5871
|
-
onClose: n[8] ||= (e) => v(
|
|
5867
|
+
visible: v(L).showImportUrlModal.value,
|
|
5868
|
+
"is-importing": v(I).isImportingFromUrl.value,
|
|
5869
|
+
error: v(I).importFromUrlError.value,
|
|
5870
|
+
onImport: v(L).handleImportFromUrl,
|
|
5871
|
+
onClose: n[8] ||= (e) => v(L).showImportUrlModal.value = !1
|
|
5872
5872
|
}, null, 8, [
|
|
5873
5873
|
"visible",
|
|
5874
5874
|
"is-importing",
|
|
@@ -5876,23 +5876,23 @@ var Zi = ["data-tpl-theme"], Qi = {
|
|
|
5876
5876
|
"onImport"
|
|
5877
5877
|
]),
|
|
5878
5878
|
j(or, {
|
|
5879
|
-
visible: !!v(
|
|
5880
|
-
item: v(
|
|
5881
|
-
onSave: v(
|
|
5882
|
-
onClose: n[9] ||= (e) => v(
|
|
5879
|
+
visible: !!v(L).editingItem.value,
|
|
5880
|
+
item: v(L).editingItem.value,
|
|
5881
|
+
onSave: v(L).handleEditSave,
|
|
5882
|
+
onClose: n[9] ||= (e) => v(L).editingItem.value = null
|
|
5883
5883
|
}, null, 8, [
|
|
5884
5884
|
"visible",
|
|
5885
5885
|
"item",
|
|
5886
5886
|
"onSave"
|
|
5887
5887
|
]),
|
|
5888
5888
|
j(zi, {
|
|
5889
|
-
visible: v(
|
|
5890
|
-
item: v(
|
|
5891
|
-
"usage-info": v(
|
|
5892
|
-
"is-replacing": v(
|
|
5893
|
-
error: v(
|
|
5894
|
-
onReplace: v(
|
|
5895
|
-
onClose: v(
|
|
5889
|
+
visible: v(I).showReplaceWarning.value,
|
|
5890
|
+
item: v(I).pendingReplaceItem.value,
|
|
5891
|
+
"usage-info": v(I).replaceUsageInfo.value,
|
|
5892
|
+
"is-replacing": v(I).isReplacing.value,
|
|
5893
|
+
error: v(I).replaceError.value,
|
|
5894
|
+
onReplace: v(L).handleReplaceFile,
|
|
5895
|
+
onClose: v(I).cancelReplace
|
|
5896
5896
|
}, null, 8, [
|
|
5897
5897
|
"visible",
|
|
5898
5898
|
"item",
|
|
@@ -5910,7 +5910,7 @@ var Zi = ["data-tpl-theme"], Qi = {
|
|
|
5910
5910
|
"leave-from-class": "tpl:opacity-100",
|
|
5911
5911
|
"leave-to-class": "tpl:opacity-0"
|
|
5912
5912
|
}, {
|
|
5913
|
-
default: u(() => [v(
|
|
5913
|
+
default: u(() => [v(I).showDeleteWarning.value ? (o(), g("div", {
|
|
5914
5914
|
key: 0,
|
|
5915
5915
|
class: "tpl:absolute tpl:inset-0 tpl:z-10 tpl:flex tpl:items-center tpl:justify-center tpl:rounded-[var(--tpl-radius-lg)]",
|
|
5916
5916
|
style: {
|
|
@@ -5918,19 +5918,19 @@ var Zi = ["data-tpl-theme"], Qi = {
|
|
|
5918
5918
|
"backdrop-filter": "blur(8px)",
|
|
5919
5919
|
"-webkit-backdrop-filter": "blur(8px)"
|
|
5920
5920
|
},
|
|
5921
|
-
onClick: n[12] ||= y((...e) => v(
|
|
5921
|
+
onClick: n[12] ||= y((...e) => v(I).cancelDelete && v(I).cancelDelete(...e), ["self"])
|
|
5922
5922
|
}, [w("div", Da, [
|
|
5923
5923
|
w("h3", Oa, p(v(i).mediaLibrary.deleteWarningTitle), 1),
|
|
5924
5924
|
w("p", {
|
|
5925
|
-
class: C(["tpl:text-xs", v(
|
|
5925
|
+
class: C(["tpl:text-xs", v(L).hasUsedFiles.value ? "tpl:mb-2" : "tpl:mb-4"]),
|
|
5926
5926
|
style: { color: "var(--tpl-text-muted)" }
|
|
5927
5927
|
}, p(v(i).mediaLibrary.deleteWarningMessage), 3),
|
|
5928
|
-
v(
|
|
5929
|
-
v(
|
|
5928
|
+
v(L).hasUsedFiles.value ? (o(), g("p", ka, p(v(i).mediaLibrary.deleteWarningUsageNote), 1)) : _("", !0),
|
|
5929
|
+
v(L).hasUsedFiles.value ? (o(), g("div", Aa, [(o(!0), g(O, null, c(v(I).deleteUsageInfo.value, (e, t) => (o(), g("div", {
|
|
5930
5930
|
key: t,
|
|
5931
5931
|
class: "tpl:text-xs",
|
|
5932
5932
|
style: { color: "var(--tpl-text)" }
|
|
5933
|
-
}, [e.template_count > 0 ? (o(), g(O, { key: 0 }, [w("span", ja, p(v(
|
|
5933
|
+
}, [e.template_count > 0 ? (o(), g(O, { key: 0 }, [w("span", ja, p(v(L).displayItems.value.find((e) => e.id === t)?.filename || t), 1), w("span", Ma, " - " + p(v(i).mediaLibrary.usedInTemplates.replace("{count}", e.template_count.toString())), 1)], 64)) : _("", !0)]))), 128))])) : _("", !0),
|
|
5934
5934
|
w("div", Na, [w("button", {
|
|
5935
5935
|
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",
|
|
5936
5936
|
style: {
|
|
@@ -5938,7 +5938,7 @@ var Zi = ["data-tpl-theme"], Qi = {
|
|
|
5938
5938
|
color: "var(--tpl-text)",
|
|
5939
5939
|
"background-color": "var(--tpl-bg)"
|
|
5940
5940
|
},
|
|
5941
|
-
onClick: n[10] ||= (...e) => v(
|
|
5941
|
+
onClick: n[10] ||= (...e) => v(I).cancelDelete && v(I).cancelDelete(...e)
|
|
5942
5942
|
}, p(v(i).mediaLibrary.cancel), 1), w("button", {
|
|
5943
5943
|
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",
|
|
5944
5944
|
style: {
|
|
@@ -5946,57 +5946,57 @@ var Zi = ["data-tpl-theme"], Qi = {
|
|
|
5946
5946
|
color: "var(--tpl-danger)",
|
|
5947
5947
|
"background-color": "var(--tpl-danger-light)"
|
|
5948
5948
|
},
|
|
5949
|
-
onClick: n[11] ||= (...e) => v(
|
|
5950
|
-
}, p(v(
|
|
5949
|
+
onClick: n[11] ||= (...e) => v(I).confirmDelete && v(I).confirmDelete(...e)
|
|
5950
|
+
}, p(v(L).hasUsedFiles.value ? v(i).mediaLibrary.deleteAnyway : v(i).mediaLibrary.confirmDelete), 1)])
|
|
5951
5951
|
])])) : _("", !0)]),
|
|
5952
5952
|
_: 1
|
|
5953
5953
|
}),
|
|
5954
|
-
w("div", Pa, [w("div", Fa, [v(
|
|
5954
|
+
w("div", Pa, [w("div", Fa, [v(I).previewItem.value ? (o(), b(wi, {
|
|
5955
5955
|
key: 0,
|
|
5956
|
-
"selected-conversion": v(
|
|
5957
|
-
"onUpdate:selectedConversion": n[13] ||= (e) => v(
|
|
5958
|
-
item: v(
|
|
5959
|
-
folders: v(
|
|
5956
|
+
"selected-conversion": v(L).selectedConversion.value,
|
|
5957
|
+
"onUpdate:selectedConversion": n[13] ||= (e) => v(L).selectedConversion.value = e,
|
|
5958
|
+
item: v(I).previewItem.value,
|
|
5959
|
+
folders: v(I).folders.value
|
|
5960
5960
|
}, null, 8, [
|
|
5961
5961
|
"selected-conversion",
|
|
5962
5962
|
"item",
|
|
5963
5963
|
"folders"
|
|
5964
|
-
])) : _("", !0)]), w("div", Ia, [v(
|
|
5964
|
+
])) : _("", !0)]), w("div", Ia, [v(I).selectedItems.value.size > 0 ? (o(), g("div", La, [v(I).previewItem.value ? (o(), g("button", {
|
|
5965
5965
|
key: 0,
|
|
5966
5966
|
class: "tpl:flex tpl:cursor-pointer tpl:items-center tpl:gap-1 tpl:rounded-md tpl:border tpl:px-3 tpl:py-1.5 tpl:text-xs tpl:font-medium tpl:transition-all tpl:duration-150",
|
|
5967
5967
|
style: E({
|
|
5968
|
-
borderColor: v(
|
|
5969
|
-
color: v(
|
|
5968
|
+
borderColor: v(L).copied.value ? "var(--tpl-success)" : "var(--tpl-border)",
|
|
5969
|
+
color: v(L).copied.value ? "var(--tpl-success)" : "var(--tpl-text)",
|
|
5970
5970
|
backgroundColor: "var(--tpl-bg)"
|
|
5971
5971
|
}),
|
|
5972
|
-
onClick: n[14] ||= (e) => v(
|
|
5973
|
-
}, [v(
|
|
5972
|
+
onClick: n[14] ||= (e) => v(L).copy(v(L).selectedUrl.value)
|
|
5973
|
+
}, [v(L).copied.value ? (o(), b(v(R), {
|
|
5974
5974
|
key: 1,
|
|
5975
5975
|
size: 12,
|
|
5976
5976
|
"stroke-width": 2
|
|
5977
|
-
})) : (o(), b(v(
|
|
5977
|
+
})) : (o(), b(v(te), {
|
|
5978
5978
|
key: 0,
|
|
5979
5979
|
size: 12,
|
|
5980
5980
|
"stroke-width": 2
|
|
5981
|
-
})), k(" " + p(v(
|
|
5981
|
+
})), k(" " + p(v(L).copied.value ? v(i).mediaLibrary.copied : v(i).mediaLibrary.copyUrl), 1)], 4)) : _("", !0), A.value ? (o(), g("div", Ra, [w("button", {
|
|
5982
5982
|
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",
|
|
5983
5983
|
style: {
|
|
5984
5984
|
"border-color": "var(--tpl-border)",
|
|
5985
5985
|
color: "var(--tpl-text)",
|
|
5986
5986
|
"background-color": "var(--tpl-bg)"
|
|
5987
5987
|
},
|
|
5988
|
-
onClick: n[15] ||= (e) => v(
|
|
5989
|
-
}, p(v(i).mediaLibrary.moveSelected), 1), v(
|
|
5988
|
+
onClick: n[15] ||= (e) => v(L).showMovePicker.value = !v(L).showMovePicker.value
|
|
5989
|
+
}, p(v(i).mediaLibrary.moveSelected), 1), v(L).showMovePicker.value ? (o(), b(pi, {
|
|
5990
5990
|
key: 0,
|
|
5991
|
-
folders: v(
|
|
5992
|
-
"current-folder-id": v(
|
|
5993
|
-
onSelect: v(
|
|
5994
|
-
onClose: n[16] ||= (e) => v(
|
|
5991
|
+
folders: v(I).folders.value,
|
|
5992
|
+
"current-folder-id": v(I).currentFolderId.value,
|
|
5993
|
+
onSelect: v(L).handleMoveToFolder,
|
|
5994
|
+
onClose: n[16] ||= (e) => v(L).showMovePicker.value = !1
|
|
5995
5995
|
}, null, 8, [
|
|
5996
5996
|
"folders",
|
|
5997
5997
|
"current-folder-id",
|
|
5998
5998
|
"onSelect"
|
|
5999
|
-
])) : _("", !0)])) : _("", !0)])) : _("", !0), w("div", za, [v(
|
|
5999
|
+
])) : _("", !0)])) : _("", !0)])) : _("", !0), w("div", za, [v(I).selectedItems.value.size > 0 ? (o(), g("button", {
|
|
6000
6000
|
key: 0,
|
|
6001
6001
|
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",
|
|
6002
6002
|
style: {
|
|
@@ -6004,15 +6004,15 @@ var Zi = ["data-tpl-theme"], Qi = {
|
|
|
6004
6004
|
color: "var(--tpl-danger)",
|
|
6005
6005
|
"background-color": "var(--tpl-danger-light)"
|
|
6006
6006
|
},
|
|
6007
|
-
onClick: n[17] ||= (...e) => v(
|
|
6007
|
+
onClick: n[17] ||= (...e) => v(L).handleDeleteClick && v(L).handleDeleteClick(...e)
|
|
6008
6008
|
}, p(v(i).mediaLibrary.deleteSelected), 1)) : _("", !0), w("button", {
|
|
6009
6009
|
class: "tpl:cursor-pointer tpl:rounded-md tpl:px-4 tpl:py-1.5 tpl:text-sm tpl:font-medium tpl:shadow-xs tpl:transition-all tpl:duration-150 tpl:hover:opacity-90 tpl:disabled:cursor-not-allowed tpl:disabled:opacity-50",
|
|
6010
6010
|
style: {
|
|
6011
6011
|
"background-color": "var(--tpl-primary)",
|
|
6012
6012
|
color: "var(--tpl-bg)"
|
|
6013
6013
|
},
|
|
6014
|
-
disabled: !
|
|
6015
|
-
onClick:
|
|
6014
|
+
disabled: !z(),
|
|
6015
|
+
onClick: ie
|
|
6016
6016
|
}, p(e.accept?.length ? v(i).mediaLibrary.selectImage : v(i).mediaLibrary.selectFile), 9, Ba)])])])
|
|
6017
6017
|
])], 8, Zi)) : _("", !0)]),
|
|
6018
6018
|
_: 1
|
|
@@ -6020,6 +6020,6 @@ var Zi = ["data-tpl-theme"], Qi = {
|
|
|
6020
6020
|
}
|
|
6021
6021
|
});
|
|
6022
6022
|
//#endregion
|
|
6023
|
-
export { zi as a, ci as c, or as d,
|
|
6023
|
+
export { zi as a, ci as c, or as d, Ee as f, be as g, xe as h, Wi as i, Xr as l, V as m, Xi as n, wi as o, Te as p, Yi as r, pi as s, Va as t, yr as u };
|
|
6024
6024
|
|
|
6025
|
-
//# sourceMappingURL=media-library-
|
|
6025
|
+
//# sourceMappingURL=media-library-BtNzYUTi.js.map
|