@aswin.dev/editor 0.8.5 → 0.8.7
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/{AccessibilityPanel-COL6Wm7p.js → AccessibilityPanel-B39ct5ON.js} +2 -2
- package/dist/{AiChatSidebar-DAJOuHPG.js → AiChatSidebar-CYh7SPHW.js} +2 -2
- package/dist/{AiFeatureMenu-CKnEDzme.js → AiFeatureMenu-D9UhqJAa.js} +3 -3
- package/dist/{BlockA11yBadge-Qs6HtXid.js → BlockA11yBadge-Dr854uEe.js} +2 -2
- package/dist/{CloudEditor-BUlmUuhO.js → CloudEditor-BNEIze18.js} +281 -274
- package/dist/{CollaboratorBar-C6TfqpyV.js → CollaboratorBar-DZXuPSfU.js} +2 -2
- package/dist/{CommentsSidebar-DE6ZsM4D.js → CommentsSidebar-BVKFtxml.js} +4 -4
- package/dist/{CountdownBlock-Ba3T-i2X.js → CountdownBlock-CrpaDWze.js} +1 -1
- package/dist/{CountdownToolbar-B9IAZzeV.js → CountdownToolbar-D1tb2T_b.js} +2 -2
- package/dist/{DesignReferenceSidebar-C6yDJlD8.js → DesignReferenceSidebar-_QsmFpE_.js} +44 -44
- package/dist/{ModuleBrowserModal-DUKuDjS-.js → ModuleBrowserModal-Bth1crh_.js} +7 -7
- package/dist/{ModulePreviewCanvas-C9HTjfkN.js → ModulePreviewCanvas-96pndrb9.js} +3 -3
- package/dist/{ParagraphEditor-CFuaZKGk.js → ParagraphEditor-C2d9O2P4.js} +123 -123
- package/dist/{RichTextEditorContent-CrqPQdnk.js → RichTextEditorContent-Cn0ZU41b.js} +3 -3
- package/dist/{SaveModuleDialog-QjgPFEDg.js → SaveModuleDialog-B1EJtMGq.js} +17 -17
- package/dist/{SlidingPillSelect-DfcBdJqN.js → SlidingPillSelect-Dt34f5VF.js} +1 -1
- package/dist/{SnapshotHistory-Dblt21_W.js → SnapshotHistory-Cd-a_xGv.js} +3 -3
- package/dist/{TemplateScoringPanel-CS7o62zS.js → TemplateScoringPanel-C8WixDsv.js} +77 -77
- package/dist/{TestEmailModal-D_y3ZksG.js → TestEmailModal-CEj_81cQ.js} +3 -3
- package/dist/TitleEditor-C8Qyr_U3.js +172 -0
- package/dist/{TplModal-DinL7DhQ.js → TplModal-B_HcUS4S.js} +2 -2
- package/dist/{blockTypeIcons-JjmIZ_Vx.js → blockTypeIcons-CeaSm2Xd.js} +1 -1
- package/dist/bundle-stats.json +6 -6
- package/dist/cdn/chunks/{AccessibilityPanel-BTADkTp2.js → AccessibilityPanel-C8vY7QIF.js} +3 -3
- package/dist/cdn/chunks/{AccessibilityPanel-BTADkTp2.js.map → AccessibilityPanel-C8vY7QIF.js.map} +1 -1
- package/dist/cdn/chunks/{AiFeatureMenu-D99Pw32q.js → AiFeatureMenu-BaUpnF6T.js} +2 -2
- package/dist/cdn/chunks/{AiFeatureMenu-D99Pw32q.js.map → AiFeatureMenu-BaUpnF6T.js.map} +1 -1
- package/dist/cdn/chunks/{BlockA11yBadge-dtyeSSvY.js → BlockA11yBadge-BHkh4Otq.js} +2 -2
- package/dist/cdn/chunks/{BlockA11yBadge-dtyeSSvY.js.map → BlockA11yBadge-BHkh4Otq.js.map} +1 -1
- package/dist/cdn/chunks/{CloudEditor-BBBkTBfW.js → CloudEditor-DUIjZDAS.js} +264 -257
- package/dist/cdn/chunks/{CloudEditor-BBBkTBfW.js.map → CloudEditor-DUIjZDAS.js.map} +1 -1
- package/dist/cdn/chunks/{CollaboratorBar-Cuy1BusU.js → CollaboratorBar-pyuEO5Bm.js} +3 -3
- package/dist/cdn/chunks/{CollaboratorBar-Cuy1BusU.js.map → CollaboratorBar-pyuEO5Bm.js.map} +1 -1
- package/dist/cdn/chunks/{CountdownToolbar-CqFM85Xv.js → CountdownToolbar-CCGHm6Gg.js} +3 -3
- package/dist/cdn/chunks/{CountdownToolbar-CqFM85Xv.js.map → CountdownToolbar-CCGHm6Gg.js.map} +1 -1
- package/dist/cdn/chunks/{ModuleBrowserModal-Dcxtq_dC.js → ModuleBrowserModal-DKsMddYS.js} +6 -6
- package/dist/cdn/chunks/{ModuleBrowserModal-Dcxtq_dC.js.map → ModuleBrowserModal-DKsMddYS.js.map} +1 -1
- package/dist/cdn/chunks/{ModulePreviewCanvas-Didb4ZCU.js → ModulePreviewCanvas-E0mfCUJi.js} +2 -2
- package/dist/cdn/chunks/{ModulePreviewCanvas-Didb4ZCU.js.map → ModulePreviewCanvas-E0mfCUJi.js.map} +1 -1
- package/dist/cdn/chunks/{ParagraphEditor-BX2L35YF.js → ParagraphEditor-DwmzHg6F.js} +116 -116
- package/dist/cdn/chunks/ParagraphEditor-DwmzHg6F.js.map +1 -0
- package/dist/cdn/chunks/{RichTextEditorContent-ywrdsvHY.js → RichTextEditorContent-4-cNqB4H.js} +3 -3
- package/dist/cdn/chunks/{RichTextEditorContent-ywrdsvHY.js.map → RichTextEditorContent-4-cNqB4H.js.map} +1 -1
- package/dist/cdn/chunks/{SaveModuleDialog-Ddp-HCFB.js → SaveModuleDialog-COm3ptOF.js} +3 -3
- package/dist/cdn/chunks/{SaveModuleDialog-Ddp-HCFB.js.map → SaveModuleDialog-COm3ptOF.js.map} +1 -1
- package/dist/cdn/chunks/{SlidingPillSelect-CS6N3vGq.js → SlidingPillSelect-DlgRynQN.js} +2 -2
- package/dist/cdn/chunks/{SlidingPillSelect-CS6N3vGq.js.map → SlidingPillSelect-DlgRynQN.js.map} +1 -1
- package/dist/cdn/chunks/TitleEditor-CE8r8txX.js +171 -0
- package/dist/cdn/chunks/TitleEditor-CE8r8txX.js.map +1 -0
- package/dist/cdn/chunks/{blockTypeIcons-B2x3gJsz.js → blockTypeIcons-BOf7hTFU.js} +3 -3
- package/dist/cdn/chunks/{blockTypeIcons-B2x3gJsz.js.map → blockTypeIcons-BOf7hTFU.js.map} +1 -1
- package/dist/cdn/chunks/{extensions-CdYSoz4B.js → extensions-B5e8Ov02.js} +17 -17
- package/dist/cdn/chunks/{extensions-CdYSoz4B.js.map → extensions-B5e8Ov02.js.map} +1 -1
- package/dist/cdn/chunks/{features-BZeMkHMs.js → features-BHTP4oRU.js} +734 -734
- package/dist/cdn/chunks/features-BHTP4oRU.js.map +1 -0
- package/dist/cdn/chunks/{icons-nP0Wj6Eq.js → icons-DS4IYWzG.js} +2 -2
- package/dist/cdn/chunks/{icons-nP0Wj6Eq.js.map → icons-DS4IYWzG.js.map} +1 -1
- package/dist/cdn/chunks/{media-library-54Ezt5wL.js → media-library-BLLJsLwk.js} +508 -508
- package/dist/cdn/chunks/{media-library-54Ezt5wL.js.map → media-library-BLLJsLwk.js.map} +1 -1
- package/dist/cdn/chunks/{quality-Di1pUcCW.js → quality-DfKLOn8j.js} +290 -290
- package/dist/cdn/chunks/{quality-Di1pUcCW.js.map → quality-DfKLOn8j.js.map} +1 -1
- package/dist/cdn/chunks/{renderer-C4OuJhDG.js → renderer-fG9yLafB.js} +14 -14
- package/dist/cdn/chunks/{renderer-C4OuJhDG.js.map → renderer-fG9yLafB.js.map} +1 -1
- package/dist/cdn/chunks/{src-DF5NNH7S.js → src-DsfVhQaK.js} +4 -4
- package/dist/cdn/chunks/{src-DF5NNH7S.js.map → src-DsfVhQaK.js.map} +1 -1
- package/dist/cdn/chunks/{styles-C9P3yzMF.js → styles-CPUuKOlD.js} +210 -210
- package/dist/cdn/chunks/{styles-C9P3yzMF.js.map → styles-CPUuKOlD.js.map} +1 -1
- package/dist/cdn/chunks/{tiptap-CZ52Pj8k.js → tiptap-q69oUYhb.js} +2 -2
- package/dist/cdn/chunks/{tiptap-CZ52Pj8k.js.map → tiptap-q69oUYhb.js.map} +1 -1
- package/dist/cdn/editor.css +1 -1
- package/dist/cdn/editor.js +130 -123
- package/dist/cdn/editor.js.map +1 -1
- package/dist/{extensions-CNPdJw_8.js → extensions-mwqd2u9M.js} +2 -2
- package/dist/index.d.ts +6 -6
- package/dist/keys-CqdzeWhT.js +10 -0
- package/dist/style.css +1 -1
- package/dist/{styles-ZIYLQwFf.js → styles-BRNubGRJ.js} +287 -287
- package/dist/templatical-editor.js +134 -127
- package/dist/{useCloudI18n-DOKSZql1.js → useCloudI18n-CDhjmAgB.js} +1 -1
- package/dist/{useEditorCore-BHSyoxSK.js → useEditorCore-DB4A_cje.js} +22 -22
- package/dist/{useI18n-C2xQZ6K9.js → useI18n-DLZJ6wNn.js} +1 -1
- package/dist/{useMergeTag-BfVcyNSv.js → useMergeTag-D-kqWENN.js} +2 -2
- package/package.json +7 -7
- package/dist/TitleEditor-CHmL3FFR.js +0 -172
- package/dist/cdn/chunks/ParagraphEditor-BX2L35YF.js.map +0 -1
- package/dist/cdn/chunks/TitleEditor-BTtgZzci.js +0 -171
- package/dist/cdn/chunks/TitleEditor-BTtgZzci.js.map +0 -1
- package/dist/cdn/chunks/features-BZeMkHMs.js.map +0 -1
- package/dist/keys-CvX8D-8C.js +0 -10
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { C as e, D as t, G as n, H as r, I as i, L as a, P as o, R as s, W as c, X as l, _ as u, b as d, c as f, ct as p, d as m, dt as h, f as g, ft as _, g as v, h as y, k as b, l as x, m as S, n as C, p as w, tt as T, u as E, ut as D, v as O, x as k, z as A } from "./draggable-C-1_gch3.js";
|
|
2
|
-
import {
|
|
3
|
-
import { A as
|
|
2
|
+
import { Ct as j, E as M, It as ee, Nt as N, T as P, bn as te, bt as F, ct as ne, ft as I, gn as L, hn as re, kt as R, lt as ie, mn as ae, ot as oe, vn as se, vt as ce, wn as le, yn as ue } from "./features-BHTP4oRU.js";
|
|
3
|
+
import { A as de, C as fe, F as pe, J as me, X as he, _ as ge, it as _e, rt as ve, tt as ye } from "./icons-DS4IYWzG.js";
|
|
4
4
|
//#region ../media-library/src/types.ts
|
|
5
|
-
var
|
|
5
|
+
var be = {
|
|
6
6
|
small: 380,
|
|
7
7
|
medium: 600,
|
|
8
8
|
large: 700,
|
|
9
9
|
original: void 0
|
|
10
10
|
};
|
|
11
|
-
function
|
|
12
|
-
return
|
|
11
|
+
function xe(e) {
|
|
12
|
+
return be[e];
|
|
13
13
|
}
|
|
14
14
|
//#endregion
|
|
15
15
|
//#region ../media-library/src/api-client.ts
|
|
16
|
-
var
|
|
16
|
+
var Se = class {
|
|
17
17
|
constructor(e) {
|
|
18
18
|
this.authManager = e;
|
|
19
19
|
}
|
|
@@ -169,9 +169,9 @@ var Ce = class {
|
|
|
169
169
|
};
|
|
170
170
|
//#endregion
|
|
171
171
|
//#region ../media-library/src/composable.ts
|
|
172
|
-
function
|
|
172
|
+
function Ce(e) {
|
|
173
173
|
if (!e.projectId) throw Error("projectId is required for useMediaLibrary");
|
|
174
|
-
let t = new
|
|
174
|
+
let t = new Se(e.authManager), n = T([]), r = T([]), i = T(null), a = T("files"), o = T(""), s = T(null), c = T("newest"), l = T(!1), u = T(!1), d = T(!1), f = T(null), p = T(null), m = T(/* @__PURE__ */ new Set()), h = T(null), g = T([]), _ = T({}), v = T(!1), y = T([]), b = T(!1), x = T(null), S = T(!1), C = T(null), w = T(!1), E = T(null), D = T(null), O = 0;
|
|
175
175
|
async function k() {
|
|
176
176
|
let r = ++O;
|
|
177
177
|
l.value = !0;
|
|
@@ -212,22 +212,22 @@ function we(e) {
|
|
|
212
212
|
r === O && (l.value = !1);
|
|
213
213
|
}
|
|
214
214
|
}
|
|
215
|
-
async function
|
|
215
|
+
async function j(e) {
|
|
216
216
|
o.value = e, await k();
|
|
217
217
|
}
|
|
218
|
-
async function
|
|
218
|
+
async function M(e) {
|
|
219
219
|
s.value = e, await k();
|
|
220
220
|
}
|
|
221
|
-
async function
|
|
221
|
+
async function ee(e) {
|
|
222
222
|
c.value = e, await k();
|
|
223
223
|
}
|
|
224
224
|
async function N(e) {
|
|
225
225
|
a.value = "files", i.value = e, o.value = "", m.value = /* @__PURE__ */ new Set(), h.value = null, await k();
|
|
226
226
|
}
|
|
227
|
-
async function
|
|
228
|
-
a.value = "frequently-used", i.value = null, o.value = "", m.value = /* @__PURE__ */ new Set(), h.value = null, await
|
|
227
|
+
async function P() {
|
|
228
|
+
a.value = "frequently-used", i.value = null, o.value = "", m.value = /* @__PURE__ */ new Set(), h.value = null, await re();
|
|
229
229
|
}
|
|
230
|
-
async function
|
|
230
|
+
async function te(r) {
|
|
231
231
|
u.value = !0;
|
|
232
232
|
try {
|
|
233
233
|
let e = await t.uploadMedia(r, i.value);
|
|
@@ -238,7 +238,7 @@ function we(e) {
|
|
|
238
238
|
u.value = !1;
|
|
239
239
|
}
|
|
240
240
|
}
|
|
241
|
-
async function
|
|
241
|
+
async function F(r) {
|
|
242
242
|
u.value = !0, p.value = {
|
|
243
243
|
current: 0,
|
|
244
244
|
total: r.length
|
|
@@ -259,7 +259,7 @@ function we(e) {
|
|
|
259
259
|
u.value = !1, p.value = null;
|
|
260
260
|
}
|
|
261
261
|
}
|
|
262
|
-
async function
|
|
262
|
+
async function ne(r) {
|
|
263
263
|
if (m.value.size !== 0) try {
|
|
264
264
|
let e = await t.moveMedia([...m.value], r);
|
|
265
265
|
if (i.value === null) {
|
|
@@ -271,7 +271,7 @@ function we(e) {
|
|
|
271
271
|
e.onError?.(t);
|
|
272
272
|
}
|
|
273
273
|
}
|
|
274
|
-
async function
|
|
274
|
+
async function I(r, i, a) {
|
|
275
275
|
try {
|
|
276
276
|
let e = await t.updateMedia(r, i, a);
|
|
277
277
|
n.value = n.value.map((t) => t.id === r ? e : t), h.value?.id === r && (h.value = e);
|
|
@@ -279,21 +279,21 @@ function we(e) {
|
|
|
279
279
|
e.onError?.(t);
|
|
280
280
|
}
|
|
281
281
|
}
|
|
282
|
-
async function
|
|
282
|
+
async function L() {
|
|
283
283
|
if (m.value.size !== 0) try {
|
|
284
284
|
await t.deleteMedia([...m.value]), n.value = n.value.filter((e) => !m.value.has(e.id)), g.value = g.value.filter((e) => !m.value.has(e.id)), m.value = /* @__PURE__ */ new Set(), h.value = null;
|
|
285
285
|
} catch (t) {
|
|
286
286
|
e.onError?.(t);
|
|
287
287
|
}
|
|
288
288
|
}
|
|
289
|
-
async function
|
|
289
|
+
async function re() {
|
|
290
290
|
try {
|
|
291
291
|
g.value = await t.getFrequentlyUsed();
|
|
292
292
|
} catch (t) {
|
|
293
293
|
e.onError?.(t);
|
|
294
294
|
}
|
|
295
295
|
}
|
|
296
|
-
async function
|
|
296
|
+
async function R() {
|
|
297
297
|
if (m.value.size === 0) return !1;
|
|
298
298
|
y.value = [...m.value];
|
|
299
299
|
try {
|
|
@@ -305,17 +305,17 @@ function we(e) {
|
|
|
305
305
|
return e.onError?.(t), !1;
|
|
306
306
|
}
|
|
307
307
|
}
|
|
308
|
-
async function
|
|
308
|
+
async function ie() {
|
|
309
309
|
if (v.value = !1, y.value.length !== 0) try {
|
|
310
310
|
await t.deleteMedia(y.value), n.value = n.value.filter((e) => !y.value.includes(e.id)), g.value = g.value.filter((e) => !y.value.includes(e.id)), m.value = /* @__PURE__ */ new Set(), h.value = null, y.value = [], _.value = {};
|
|
311
311
|
} catch (t) {
|
|
312
312
|
e.onError?.(t);
|
|
313
313
|
}
|
|
314
314
|
}
|
|
315
|
-
function
|
|
315
|
+
function ae() {
|
|
316
316
|
v.value = !1, y.value = [], _.value = {};
|
|
317
317
|
}
|
|
318
|
-
async function
|
|
318
|
+
async function oe(r) {
|
|
319
319
|
b.value = !0, x.value = null;
|
|
320
320
|
try {
|
|
321
321
|
let e = await t.importFromUrl(r, i.value);
|
|
@@ -326,57 +326,57 @@ function we(e) {
|
|
|
326
326
|
b.value = !1;
|
|
327
327
|
}
|
|
328
328
|
}
|
|
329
|
-
function
|
|
329
|
+
function se(e) {
|
|
330
330
|
let t = new Set(m.value);
|
|
331
331
|
t.has(e) ? t.delete(e) : t.add(e), m.value = t;
|
|
332
332
|
}
|
|
333
|
-
function
|
|
333
|
+
function ce() {
|
|
334
334
|
m.value = /* @__PURE__ */ new Set(), h.value = null;
|
|
335
335
|
}
|
|
336
|
-
function
|
|
336
|
+
function le(e) {
|
|
337
337
|
h.value = e, m.value = new Set([e.id]);
|
|
338
338
|
}
|
|
339
|
-
async function
|
|
339
|
+
async function ue() {
|
|
340
340
|
try {
|
|
341
341
|
r.value = await t.getMediaFolders();
|
|
342
342
|
} catch (t) {
|
|
343
343
|
e.onError?.(t);
|
|
344
344
|
}
|
|
345
345
|
}
|
|
346
|
-
async function
|
|
346
|
+
async function de(n, r) {
|
|
347
347
|
try {
|
|
348
348
|
let e = await t.createMediaFolder(n, r);
|
|
349
|
-
return await
|
|
349
|
+
return await ue(), e;
|
|
350
350
|
} catch (t) {
|
|
351
351
|
return e.onError?.(t), null;
|
|
352
352
|
}
|
|
353
353
|
}
|
|
354
|
-
function
|
|
354
|
+
function fe(e, t) {
|
|
355
355
|
for (let n of e) {
|
|
356
356
|
if (n.id === t) return n;
|
|
357
357
|
if (n.children) {
|
|
358
|
-
let e =
|
|
358
|
+
let e = fe(n.children, t);
|
|
359
359
|
if (e) return e;
|
|
360
360
|
}
|
|
361
361
|
}
|
|
362
362
|
return null;
|
|
363
363
|
}
|
|
364
|
-
async function
|
|
364
|
+
async function pe(n, r) {
|
|
365
365
|
try {
|
|
366
|
-
await t.renameMediaFolder(n, r), await
|
|
366
|
+
await t.renameMediaFolder(n, r), await ue();
|
|
367
367
|
} catch (t) {
|
|
368
368
|
e.onError?.(t);
|
|
369
369
|
}
|
|
370
370
|
}
|
|
371
|
-
async function
|
|
371
|
+
async function me(n) {
|
|
372
372
|
try {
|
|
373
|
-
let e =
|
|
374
|
-
await t.deleteMediaFolder(n), i.value === n && (i.value = e), await
|
|
373
|
+
let e = fe(r.value, n)?.parent_id ?? null;
|
|
374
|
+
await t.deleteMediaFolder(n), i.value === n && (i.value = e), await ue(), await k();
|
|
375
375
|
} catch (t) {
|
|
376
376
|
e.onError?.(t);
|
|
377
377
|
}
|
|
378
378
|
}
|
|
379
|
-
async function
|
|
379
|
+
async function he(n) {
|
|
380
380
|
E.value = n, C.value = null;
|
|
381
381
|
try {
|
|
382
382
|
D.value = (await t.checkMediaUsage([n.id])).data[n.id] ?? null, w.value = !0;
|
|
@@ -384,10 +384,10 @@ function we(e) {
|
|
|
384
384
|
e.onError?.(t);
|
|
385
385
|
}
|
|
386
386
|
}
|
|
387
|
-
function
|
|
387
|
+
function ge() {
|
|
388
388
|
w.value = !1, E.value = null, D.value = null, C.value = null;
|
|
389
389
|
}
|
|
390
|
-
async function
|
|
390
|
+
async function _e(r) {
|
|
391
391
|
if (!E.value) return null;
|
|
392
392
|
S.value = !0, C.value = null;
|
|
393
393
|
try {
|
|
@@ -399,7 +399,7 @@ function we(e) {
|
|
|
399
399
|
S.value = !1;
|
|
400
400
|
}
|
|
401
401
|
}
|
|
402
|
-
async function
|
|
402
|
+
async function ve(r, i) {
|
|
403
403
|
try {
|
|
404
404
|
let e = await t.replaceMedia(r, i);
|
|
405
405
|
return n.value = n.value.map((t) => t.id === e.id ? e : t), g.value = g.value.map((t) => t.id === e.id ? e : t), h.value?.id === e.id && (h.value = e), e;
|
|
@@ -426,45 +426,45 @@ function we(e) {
|
|
|
426
426
|
showDeleteWarning: v,
|
|
427
427
|
loadItems: k,
|
|
428
428
|
loadMore: A,
|
|
429
|
-
search:
|
|
430
|
-
filterByCategory:
|
|
431
|
-
sortBy:
|
|
429
|
+
search: j,
|
|
430
|
+
filterByCategory: M,
|
|
431
|
+
sortBy: ee,
|
|
432
432
|
navigateToFolder: N,
|
|
433
|
-
showFrequentlyUsed:
|
|
434
|
-
uploadFile:
|
|
435
|
-
uploadFiles:
|
|
436
|
-
moveSelected:
|
|
437
|
-
updateFile:
|
|
438
|
-
deleteSelected:
|
|
433
|
+
showFrequentlyUsed: P,
|
|
434
|
+
uploadFile: te,
|
|
435
|
+
uploadFiles: F,
|
|
436
|
+
moveSelected: ne,
|
|
437
|
+
updateFile: I,
|
|
438
|
+
deleteSelected: L,
|
|
439
439
|
isImportingFromUrl: b,
|
|
440
440
|
importFromUrlError: x,
|
|
441
|
-
importFromUrl:
|
|
442
|
-
toggleSelection:
|
|
443
|
-
clearSelection:
|
|
444
|
-
selectItem:
|
|
445
|
-
loadFolders:
|
|
446
|
-
createFolder:
|
|
447
|
-
renameFolder:
|
|
448
|
-
deleteFolder:
|
|
449
|
-
findFolderInTree:
|
|
450
|
-
loadFrequentlyUsed:
|
|
451
|
-
checkUsageBeforeDelete:
|
|
452
|
-
confirmDelete:
|
|
453
|
-
cancelDelete:
|
|
441
|
+
importFromUrl: oe,
|
|
442
|
+
toggleSelection: se,
|
|
443
|
+
clearSelection: ce,
|
|
444
|
+
selectItem: le,
|
|
445
|
+
loadFolders: ue,
|
|
446
|
+
createFolder: de,
|
|
447
|
+
renameFolder: pe,
|
|
448
|
+
deleteFolder: me,
|
|
449
|
+
findFolderInTree: fe,
|
|
450
|
+
loadFrequentlyUsed: re,
|
|
451
|
+
checkUsageBeforeDelete: R,
|
|
452
|
+
confirmDelete: ie,
|
|
453
|
+
cancelDelete: ae,
|
|
454
454
|
isReplacing: S,
|
|
455
455
|
replaceError: C,
|
|
456
456
|
showReplaceWarning: w,
|
|
457
457
|
pendingReplaceItem: E,
|
|
458
458
|
replaceUsageInfo: D,
|
|
459
|
-
checkUsageBeforeReplace:
|
|
460
|
-
cancelReplace:
|
|
461
|
-
replaceFile:
|
|
462
|
-
replaceMediaDirectly:
|
|
459
|
+
checkUsageBeforeReplace: he,
|
|
460
|
+
cancelReplace: ge,
|
|
461
|
+
replaceFile: _e,
|
|
462
|
+
replaceMediaDirectly: ve
|
|
463
463
|
};
|
|
464
464
|
}
|
|
465
465
|
//#endregion
|
|
466
466
|
//#region ../media-library/src/composables/useI18n.ts
|
|
467
|
-
function
|
|
467
|
+
function z(e) {
|
|
468
468
|
let n = e ?? t("translations"), r = l(n) ? n.value : n;
|
|
469
469
|
function i(e, t) {
|
|
470
470
|
return e.replace(/\{(\w+)\}/g, (e, n) => n in t ? String(t[n]) : `{${n}}`);
|
|
@@ -476,14 +476,14 @@ function R(e) {
|
|
|
476
476
|
}
|
|
477
477
|
//#endregion
|
|
478
478
|
//#region ../media-library/src/components/media/MediaBreadcrumb.vue?vue&type=script&setup=true&lang.ts
|
|
479
|
-
var
|
|
479
|
+
var we = {
|
|
480
480
|
key: 0,
|
|
481
481
|
class: "tpl:flex tpl:items-center tpl:gap-1 tpl:text-xs",
|
|
482
482
|
style: { color: "var(--tpl-text-muted)" }
|
|
483
|
-
},
|
|
483
|
+
}, Te = ["onClick"], Ee = {
|
|
484
484
|
key: 1,
|
|
485
485
|
style: { color: "var(--tpl-text)" }
|
|
486
|
-
},
|
|
486
|
+
}, De = /* @__PURE__ */ e({
|
|
487
487
|
__name: "MediaBreadcrumb",
|
|
488
488
|
props: {
|
|
489
489
|
folders: {},
|
|
@@ -491,7 +491,7 @@ var Te = {
|
|
|
491
491
|
},
|
|
492
492
|
emits: ["navigate"],
|
|
493
493
|
setup(e, { emit: t }) {
|
|
494
|
-
let n = e, r = t, { t: a } =
|
|
494
|
+
let n = e, r = t, { t: a } = z(), s = S(() => {
|
|
495
495
|
if (!n.currentFolderId) return [];
|
|
496
496
|
let e = [];
|
|
497
497
|
return c(n.folders, n.currentFolderId, e), e;
|
|
@@ -503,11 +503,11 @@ var Te = {
|
|
|
503
503
|
}
|
|
504
504
|
return !1;
|
|
505
505
|
}
|
|
506
|
-
return (e, t) => s.value.length > 0 ? (o(), O("div",
|
|
506
|
+
return (e, t) => s.value.length > 0 ? (o(), O("div", we, [y("button", {
|
|
507
507
|
class: "tpl:transition-colors tpl:duration-150 tpl:hover:underline",
|
|
508
508
|
style: { color: "var(--tpl-primary)" },
|
|
509
509
|
onClick: t[0] ||= (e) => r("navigate", null)
|
|
510
|
-
}, _(p(a).mediaLibrary.allFiles), 1), (o(!0), O(g, null, i(s.value, (e, t) => (o(), O(g, { key: e.id }, [k(p(
|
|
510
|
+
}, _(p(a).mediaLibrary.allFiles), 1), (o(!0), O(g, null, i(s.value, (e, t) => (o(), O(g, { key: e.id }, [k(p(N), {
|
|
511
511
|
size: 12,
|
|
512
512
|
"stroke-width": 2
|
|
513
513
|
}), t < s.value.length - 1 ? (o(), O("button", {
|
|
@@ -515,12 +515,12 @@ var Te = {
|
|
|
515
515
|
class: "tpl:transition-colors tpl:duration-150 tpl:hover:underline",
|
|
516
516
|
style: { color: "var(--tpl-primary)" },
|
|
517
517
|
onClick: (t) => r("navigate", e.id)
|
|
518
|
-
}, _(e.name), 9,
|
|
518
|
+
}, _(e.name), 9, Te)) : (o(), O("span", Ee, _(e.name), 1))], 64))), 128))])) : u("", !0);
|
|
519
519
|
}
|
|
520
520
|
});
|
|
521
521
|
//#endregion
|
|
522
522
|
//#region ../media-library/src/composables/useMediaCategories.ts
|
|
523
|
-
function
|
|
523
|
+
function Oe() {
|
|
524
524
|
let e = t("planConfig"), n = S(() => e.config.value?.media ?? null), r = S(() => n.value?.use_media_library ?? !0), i = S(() => n.value?.categories ?? null), a = S(() => i.value ? Object.values(i.value).flatMap((e) => e.mime_types) : []), o = S(() => a.value.join(",")), s = S(() => n.value?.max_file_size ?? 0);
|
|
525
525
|
function c(e, t) {
|
|
526
526
|
return i.value ? !t || t.length === 0 ? a.value.includes(e) : t.some((t) => i.value[t]?.mime_types.includes(e)) : !1;
|
|
@@ -546,14 +546,14 @@ function ke() {
|
|
|
546
546
|
}
|
|
547
547
|
//#endregion
|
|
548
548
|
//#region ../media-library/src/composables/useImageCrop.ts
|
|
549
|
-
var
|
|
549
|
+
var ke = {
|
|
550
550
|
free: void 0,
|
|
551
551
|
square: 1,
|
|
552
552
|
landscape43: 4 / 3,
|
|
553
553
|
landscape169: 16 / 9,
|
|
554
554
|
original: void 0
|
|
555
555
|
};
|
|
556
|
-
function
|
|
556
|
+
function Ae(e) {
|
|
557
557
|
return e === "image/png" || e === "image/gif" ? {
|
|
558
558
|
mimeType: "image/png",
|
|
559
559
|
quality: 1
|
|
@@ -565,7 +565,7 @@ function je(e) {
|
|
|
565
565
|
quality: .92
|
|
566
566
|
};
|
|
567
567
|
}
|
|
568
|
-
function
|
|
568
|
+
function je(e, t, n) {
|
|
569
569
|
let r = e.width, i = e.height;
|
|
570
570
|
if (!t && !n) return e;
|
|
571
571
|
let a = r, o = i;
|
|
@@ -575,7 +575,7 @@ function Me(e, t, n) {
|
|
|
575
575
|
let c = s.getContext("2d");
|
|
576
576
|
return c && (c.imageSmoothingEnabled = !0, c.imageSmoothingQuality = "high", c.drawImage(e, 0, 0, a, o)), s;
|
|
577
577
|
}
|
|
578
|
-
function
|
|
578
|
+
function Me(e, t, n) {
|
|
579
579
|
return new Promise((r, i) => {
|
|
580
580
|
e.toBlob((e) => {
|
|
581
581
|
if (!e) {
|
|
@@ -587,7 +587,7 @@ function Ne(e, t, n) {
|
|
|
587
587
|
}, n.mimeType, n.quality);
|
|
588
588
|
});
|
|
589
589
|
}
|
|
590
|
-
function
|
|
590
|
+
function Ne(e, t, n, r) {
|
|
591
591
|
let i = e, a = t;
|
|
592
592
|
if (n && i > n) {
|
|
593
593
|
let e = n / i;
|
|
@@ -604,7 +604,7 @@ function Pe(e, t, n, r) {
|
|
|
604
604
|
}
|
|
605
605
|
//#endregion
|
|
606
606
|
//#region ../../node_modules/.pnpm/vue-advanced-cropper@2.8.9_vue@3.5.33_typescript@6.0.3_/node_modules/vue-advanced-cropper/dist/index.esm-bundler.js
|
|
607
|
-
function
|
|
607
|
+
function Pe(e, t) {
|
|
608
608
|
var n = Object.keys(e);
|
|
609
609
|
if (Object.getOwnPropertySymbols) {
|
|
610
610
|
var r = Object.getOwnPropertySymbols(e);
|
|
@@ -614,18 +614,18 @@ function Fe(e, t) {
|
|
|
614
614
|
}
|
|
615
615
|
return n;
|
|
616
616
|
}
|
|
617
|
-
function
|
|
617
|
+
function B(e) {
|
|
618
618
|
for (var t = 1; t < arguments.length; t++) {
|
|
619
619
|
var n = arguments[t] == null ? {} : arguments[t];
|
|
620
|
-
t % 2 ?
|
|
621
|
-
|
|
622
|
-
})) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) :
|
|
620
|
+
t % 2 ? Pe(Object(n), !0).forEach((function(t) {
|
|
621
|
+
V(e, t, n[t]);
|
|
622
|
+
})) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : Pe(Object(n)).forEach((function(t) {
|
|
623
623
|
Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t));
|
|
624
624
|
}));
|
|
625
625
|
}
|
|
626
626
|
return e;
|
|
627
627
|
}
|
|
628
|
-
function
|
|
628
|
+
function V(e, t, n) {
|
|
629
629
|
return t in e ? Object.defineProperty(e, t, {
|
|
630
630
|
value: n,
|
|
631
631
|
enumerable: !0,
|
|
@@ -633,7 +633,7 @@ function B(e, t, n) {
|
|
|
633
633
|
writable: !0
|
|
634
634
|
}) : e[t] = n, e;
|
|
635
635
|
}
|
|
636
|
-
function
|
|
636
|
+
function Fe(e, t) {
|
|
637
637
|
if (e == null) return {};
|
|
638
638
|
var n, r, i = function(e, t) {
|
|
639
639
|
if (e == null) return {};
|
|
@@ -647,28 +647,28 @@ function Ie(e, t) {
|
|
|
647
647
|
}
|
|
648
648
|
return i;
|
|
649
649
|
}
|
|
650
|
-
function
|
|
650
|
+
function Ie(e) {
|
|
651
651
|
return function(e) {
|
|
652
|
-
if (Array.isArray(e)) return
|
|
652
|
+
if (Array.isArray(e)) return Le(e);
|
|
653
653
|
}(e) || function(e) {
|
|
654
654
|
if (typeof Symbol < "u" && e[Symbol.iterator] != null || e["@@iterator"] != null) return Array.from(e);
|
|
655
655
|
}(e) || function(e, t) {
|
|
656
656
|
if (e) {
|
|
657
|
-
if (typeof e == "string") return
|
|
657
|
+
if (typeof e == "string") return Le(e, t);
|
|
658
658
|
var n = Object.prototype.toString.call(e).slice(8, -1);
|
|
659
659
|
if (n === "Object" && e.constructor && (n = e.constructor.name), n === "Map" || n === "Set") return Array.from(e);
|
|
660
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return
|
|
660
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return Le(e, t);
|
|
661
661
|
}
|
|
662
662
|
}(e) || function() {
|
|
663
663
|
throw TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
664
664
|
}();
|
|
665
665
|
}
|
|
666
|
-
function
|
|
666
|
+
function Le(e, t) {
|
|
667
667
|
(t == null || t > e.length) && (t = e.length);
|
|
668
668
|
for (var n = 0, r = Array(t); n < t; n++) r[n] = e[n];
|
|
669
669
|
return r;
|
|
670
670
|
}
|
|
671
|
-
var ze, Be,
|
|
671
|
+
var Re, ze, Be, H = (Re = function(e) {
|
|
672
672
|
(function() {
|
|
673
673
|
var t = {}.hasOwnProperty;
|
|
674
674
|
function n() {
|
|
@@ -690,15 +690,15 @@ var ze, Be, Ve, V = (ze = function(e) {
|
|
|
690
690
|
}
|
|
691
691
|
e.exports ? (n.default = n, e.exports = n) : window.classNames = n;
|
|
692
692
|
})();
|
|
693
|
-
},
|
|
694
|
-
path:
|
|
693
|
+
}, Re(Be = {
|
|
694
|
+
path: ze,
|
|
695
695
|
exports: {},
|
|
696
696
|
require: function(e, t) {
|
|
697
697
|
return function() {
|
|
698
698
|
throw Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs");
|
|
699
|
-
}(t == null &&
|
|
699
|
+
}(t == null && Be.path);
|
|
700
700
|
}
|
|
701
|
-
},
|
|
701
|
+
}, Be.exports), Be.exports), U = function(e) {
|
|
702
702
|
return function(t, n) {
|
|
703
703
|
if (!t) return e;
|
|
704
704
|
var r;
|
|
@@ -710,7 +710,7 @@ var ze, Be, Ve, V = (ze = function(e) {
|
|
|
710
710
|
}), "") : "");
|
|
711
711
|
};
|
|
712
712
|
};
|
|
713
|
-
function
|
|
713
|
+
function Ve(e, t, n) {
|
|
714
714
|
var r, i, a, o, s;
|
|
715
715
|
function c() {
|
|
716
716
|
var l = Date.now() - o;
|
|
@@ -728,65 +728,65 @@ function He(e, t, n) {
|
|
|
728
728
|
r &&= (s = e.apply(a, i), a = i = null, clearTimeout(r), null);
|
|
729
729
|
}, l;
|
|
730
730
|
}
|
|
731
|
-
|
|
732
|
-
var
|
|
733
|
-
return
|
|
731
|
+
Ve.debounce = Ve;
|
|
732
|
+
var He = Ve, W = function() {
|
|
733
|
+
return W = Object.assign || function(e) {
|
|
734
734
|
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]);
|
|
735
735
|
return e;
|
|
736
|
-
},
|
|
736
|
+
}, W.apply(this, arguments);
|
|
737
737
|
};
|
|
738
|
-
function
|
|
738
|
+
function Ue(e, t) {
|
|
739
739
|
var n, r;
|
|
740
740
|
return e && t ? (n = "" + e + t[0].toUpperCase() + t.slice(1), r = e + "-" + t) : (n = e || t, r = e || t), {
|
|
741
741
|
name: n,
|
|
742
742
|
classname: r
|
|
743
743
|
};
|
|
744
744
|
}
|
|
745
|
-
function
|
|
745
|
+
function We(e) {
|
|
746
746
|
return /^blob:/.test(e);
|
|
747
747
|
}
|
|
748
|
-
function
|
|
749
|
-
return
|
|
748
|
+
function Ge(e) {
|
|
749
|
+
return We(e) || function(e) {
|
|
750
750
|
return /^data:/.test(e);
|
|
751
751
|
}(e);
|
|
752
752
|
}
|
|
753
|
-
function
|
|
753
|
+
function Ke(e) {
|
|
754
754
|
return !!(e && e.constructor && e.call && e.apply);
|
|
755
755
|
}
|
|
756
|
-
function
|
|
756
|
+
function G(e) {
|
|
757
757
|
return e === void 0;
|
|
758
758
|
}
|
|
759
|
-
function
|
|
759
|
+
function qe(e) {
|
|
760
760
|
return typeof e == "object" && !!e;
|
|
761
761
|
}
|
|
762
|
-
function
|
|
762
|
+
function Je(e, t, n) {
|
|
763
763
|
var r = {};
|
|
764
|
-
return
|
|
765
|
-
|
|
764
|
+
return qe(e) ? (Object.keys(t).forEach((function(i) {
|
|
765
|
+
G(e[i]) ? r[i] = t[i] : qe(t[i]) ? qe(e[i]) ? r[i] = Je(e[i], t[i], n[i]) : r[i] = e[i] ? t[i] : n[i] : !0 === t[i] || !1 === t[i] ? r[i] = !!e[i] : r[i] = e[i];
|
|
766
766
|
})), r) : e ? t : n;
|
|
767
767
|
}
|
|
768
|
-
function
|
|
768
|
+
function Ye(e) {
|
|
769
769
|
var t = Number(e);
|
|
770
770
|
return Number.isNaN(t) ? e : t;
|
|
771
771
|
}
|
|
772
|
-
function
|
|
772
|
+
function Xe(e) {
|
|
773
773
|
return typeof (e == "number" || function(e) {
|
|
774
774
|
return typeof e == "object" && !!e;
|
|
775
|
-
}(e) && toString.call(e) == "[object Number]") && !
|
|
775
|
+
}(e) && toString.call(e) == "[object Number]") && !Ze(e);
|
|
776
776
|
}
|
|
777
|
-
function
|
|
777
|
+
function Ze(e) {
|
|
778
778
|
return e != e;
|
|
779
779
|
}
|
|
780
|
-
function
|
|
780
|
+
function Qe(e, t) {
|
|
781
781
|
return Math.sqrt((e.x - t.x) ** 2 + (e.y - t.y) ** 2);
|
|
782
782
|
}
|
|
783
|
-
var
|
|
783
|
+
var $e = function(e, t) {
|
|
784
784
|
e === void 0 && (e = {}), t === void 0 && (t = {}), this.type = "manipulateImage", this.move = e, this.scale = t;
|
|
785
|
-
},
|
|
785
|
+
}, et = function(e, t) {
|
|
786
786
|
t === void 0 && (t = {}), this.type = "resize", this.directions = e, this.params = t;
|
|
787
|
-
},
|
|
787
|
+
}, tt = function(e) {
|
|
788
788
|
this.type = "move", this.directions = e;
|
|
789
|
-
},
|
|
789
|
+
}, nt = function() {
|
|
790
790
|
function e(e, t, n, r, i) {
|
|
791
791
|
this.type = "drag", this.nativeEvent = e, this.position = n, this.previousPosition = r, this.element = t, this.anchor = i;
|
|
792
792
|
}
|
|
@@ -804,7 +804,7 @@ var et = function(e, t) {
|
|
|
804
804
|
top: 0
|
|
805
805
|
};
|
|
806
806
|
}, e;
|
|
807
|
-
}(),
|
|
807
|
+
}(), rt = {
|
|
808
808
|
name: "DraggableElement",
|
|
809
809
|
props: { classname: { type: String } },
|
|
810
810
|
beforeMount: function() {
|
|
@@ -825,7 +825,7 @@ var et = function(e, t) {
|
|
|
825
825
|
this.hovered && !this.touches.length && (this.hovered = !1, this.$emit("leave"));
|
|
826
826
|
},
|
|
827
827
|
onTouchStart: function(e) {
|
|
828
|
-
e.cancelable && !this.disabled && e.touches.length === 1 && (this.touches =
|
|
828
|
+
e.cancelable && !this.disabled && e.touches.length === 1 && (this.touches = Ie(e.touches), this.hovered ||= (this.$emit("enter"), !0), e.touches.length && this.initAnchor(this.touches.reduce((function(t, n) {
|
|
829
829
|
return {
|
|
830
830
|
clientX: t.clientX + n.clientX / e.touches.length,
|
|
831
831
|
clientY: t.clientY + n.clientY / e.touches.length
|
|
@@ -871,11 +871,11 @@ var et = function(e, t) {
|
|
|
871
871
|
};
|
|
872
872
|
},
|
|
873
873
|
processMove: function(e, t) {
|
|
874
|
-
var n =
|
|
874
|
+
var n = Ie(t);
|
|
875
875
|
if (this.touches.length) {
|
|
876
876
|
if (this.touches.length === 1 && n.length === 1) {
|
|
877
877
|
var r = this.$refs.draggable;
|
|
878
|
-
this.$emit("drag", new
|
|
878
|
+
this.$emit("drag", new nt(e, r, {
|
|
879
879
|
left: n[0].clientX,
|
|
880
880
|
top: n[0].clientY
|
|
881
881
|
}, {
|
|
@@ -897,7 +897,7 @@ var et = function(e, t) {
|
|
|
897
897
|
"enter"
|
|
898
898
|
]
|
|
899
899
|
};
|
|
900
|
-
|
|
900
|
+
rt.render = function(e, t, n, r, i, s) {
|
|
901
901
|
return o(), v("div", {
|
|
902
902
|
ref: "draggable",
|
|
903
903
|
class: n.classname,
|
|
@@ -915,9 +915,9 @@ it.render = function(e, t, n, r, i, s) {
|
|
|
915
915
|
}
|
|
916
916
|
}, [a(e.$slots, "default")], 34);
|
|
917
917
|
};
|
|
918
|
-
var
|
|
918
|
+
var it = U("vue-handler-wrapper"), at = {
|
|
919
919
|
name: "HandlerWrapper",
|
|
920
|
-
components: { DraggableElement:
|
|
920
|
+
components: { DraggableElement: rt },
|
|
921
921
|
props: {
|
|
922
922
|
horizontalPosition: { type: String },
|
|
923
923
|
verticalPosition: { type: String },
|
|
@@ -929,12 +929,12 @@ var at = H("vue-handler-wrapper"), ot = {
|
|
|
929
929
|
computed: { classes: function() {
|
|
930
930
|
var e;
|
|
931
931
|
if (this.horizontalPosition || this.verticalPosition) {
|
|
932
|
-
var t, n =
|
|
933
|
-
e =
|
|
934
|
-
} else e =
|
|
932
|
+
var t, n = Ue(this.horizontalPosition, this.verticalPosition);
|
|
933
|
+
e = it((V(t = {}, n.classname, !0), V(t, "disabled", this.disabled), t));
|
|
934
|
+
} else e = it({ disabled: this.disabled });
|
|
935
935
|
return {
|
|
936
936
|
root: e,
|
|
937
|
-
draggable:
|
|
937
|
+
draggable: it("draggable")
|
|
938
938
|
};
|
|
939
939
|
} },
|
|
940
940
|
emits: [
|
|
@@ -944,7 +944,7 @@ var at = H("vue-handler-wrapper"), ot = {
|
|
|
944
944
|
"drag-end"
|
|
945
945
|
]
|
|
946
946
|
};
|
|
947
|
-
|
|
947
|
+
at.render = function(e, t, n, r, i, l) {
|
|
948
948
|
var u = s("DraggableElement");
|
|
949
949
|
return o(), v("div", { class: l.classes.root }, [k(u, {
|
|
950
950
|
class: l.classes.draggable,
|
|
@@ -967,9 +967,9 @@ ot.render = function(e, t, n, r, i, l) {
|
|
|
967
967
|
_: 3
|
|
968
968
|
}, 8, ["class"])], 2);
|
|
969
969
|
};
|
|
970
|
-
var
|
|
970
|
+
var ot = U("vue-line-wrapper"), st = {
|
|
971
971
|
name: "LineWrapper",
|
|
972
|
-
components: { DraggableElement:
|
|
972
|
+
components: { DraggableElement: rt },
|
|
973
973
|
props: {
|
|
974
974
|
position: {
|
|
975
975
|
type: String,
|
|
@@ -982,7 +982,7 @@ var st = H("vue-line-wrapper"), ct = {
|
|
|
982
982
|
},
|
|
983
983
|
computed: { classname: function() {
|
|
984
984
|
var e;
|
|
985
|
-
return
|
|
985
|
+
return ot((V(e = {}, this.position, !0), V(e, "disabled", this.disabled), e));
|
|
986
986
|
} },
|
|
987
987
|
emits: [
|
|
988
988
|
"leave",
|
|
@@ -991,7 +991,7 @@ var st = H("vue-line-wrapper"), ct = {
|
|
|
991
991
|
"drag-end"
|
|
992
992
|
]
|
|
993
993
|
};
|
|
994
|
-
|
|
994
|
+
st.render = function(e, t, n, r, i, l) {
|
|
995
995
|
var u = s("DraggableElement");
|
|
996
996
|
return o(), v(u, {
|
|
997
997
|
class: l.classname,
|
|
@@ -1014,23 +1014,23 @@ ct.render = function(e, t, n, r, i, l) {
|
|
|
1014
1014
|
_: 3
|
|
1015
1015
|
}, 8, ["class"]);
|
|
1016
1016
|
};
|
|
1017
|
-
var
|
|
1017
|
+
var K = [
|
|
1018
1018
|
"left",
|
|
1019
1019
|
"right",
|
|
1020
1020
|
"top",
|
|
1021
1021
|
"bottom"
|
|
1022
|
-
],
|
|
1022
|
+
], ct = ["left", "right"], lt = ["top", "bottom"], ut = ["left", "top"], dt = [
|
|
1023
1023
|
"fill-area",
|
|
1024
1024
|
"fit-area",
|
|
1025
1025
|
"stencil",
|
|
1026
1026
|
"none"
|
|
1027
|
-
],
|
|
1027
|
+
], ft = {
|
|
1028
1028
|
left: 0,
|
|
1029
1029
|
top: 0,
|
|
1030
1030
|
width: 0,
|
|
1031
1031
|
height: 0
|
|
1032
1032
|
};
|
|
1033
|
-
function
|
|
1033
|
+
function pt(e, t, n) {
|
|
1034
1034
|
return !(n ||= [
|
|
1035
1035
|
"width",
|
|
1036
1036
|
"height",
|
|
@@ -1040,7 +1040,7 @@ function mt(e, t, n) {
|
|
|
1040
1040
|
return e[n] !== t[n];
|
|
1041
1041
|
}));
|
|
1042
1042
|
}
|
|
1043
|
-
function
|
|
1043
|
+
function q(e) {
|
|
1044
1044
|
return {
|
|
1045
1045
|
left: e.left,
|
|
1046
1046
|
top: e.top,
|
|
@@ -1048,31 +1048,31 @@ function K(e) {
|
|
|
1048
1048
|
bottom: e.top + e.height
|
|
1049
1049
|
};
|
|
1050
1050
|
}
|
|
1051
|
-
function
|
|
1051
|
+
function mt(e, t) {
|
|
1052
1052
|
return {
|
|
1053
1053
|
left: e.left - t.left,
|
|
1054
1054
|
top: e.top - t.top
|
|
1055
1055
|
};
|
|
1056
1056
|
}
|
|
1057
|
-
function
|
|
1057
|
+
function J(e) {
|
|
1058
1058
|
return {
|
|
1059
1059
|
left: e.left + e.width / 2,
|
|
1060
1060
|
top: e.top + e.height / 2
|
|
1061
1061
|
};
|
|
1062
1062
|
}
|
|
1063
|
-
function
|
|
1063
|
+
function ht(e, t) {
|
|
1064
1064
|
var n = {
|
|
1065
1065
|
left: 0,
|
|
1066
1066
|
top: 0,
|
|
1067
1067
|
right: 0,
|
|
1068
1068
|
bottom: 0
|
|
1069
1069
|
};
|
|
1070
|
-
return
|
|
1071
|
-
var i = t[r], a =
|
|
1070
|
+
return K.forEach((function(r) {
|
|
1071
|
+
var i = t[r], a = q(e)[r];
|
|
1072
1072
|
n[r] = i !== void 0 && a !== void 0 ? r === "left" || r === "top" ? Math.max(0, i - a) : Math.max(0, a - i) : 0;
|
|
1073
1073
|
})), n;
|
|
1074
1074
|
}
|
|
1075
|
-
function
|
|
1075
|
+
function Y(e, t) {
|
|
1076
1076
|
return {
|
|
1077
1077
|
left: e.left - t.left,
|
|
1078
1078
|
top: e.top - t.top,
|
|
@@ -1080,22 +1080,22 @@ function J(e, t) {
|
|
|
1080
1080
|
height: e.height + t.top + t.bottom
|
|
1081
1081
|
};
|
|
1082
1082
|
}
|
|
1083
|
-
function
|
|
1083
|
+
function gt(e) {
|
|
1084
1084
|
return {
|
|
1085
1085
|
left: -e.left,
|
|
1086
1086
|
top: -e.top
|
|
1087
1087
|
};
|
|
1088
1088
|
}
|
|
1089
|
-
function
|
|
1090
|
-
return
|
|
1089
|
+
function X(e, t) {
|
|
1090
|
+
return W(W({}, e), {
|
|
1091
1091
|
left: e.left + t.left,
|
|
1092
1092
|
top: e.top + t.top
|
|
1093
1093
|
});
|
|
1094
1094
|
}
|
|
1095
|
-
function
|
|
1095
|
+
function Z(e, t, n, r) {
|
|
1096
1096
|
if (t !== 1) {
|
|
1097
1097
|
if (n) {
|
|
1098
|
-
var i =
|
|
1098
|
+
var i = J(e);
|
|
1099
1099
|
return {
|
|
1100
1100
|
width: e.width * t,
|
|
1101
1101
|
height: e.height * t,
|
|
@@ -1112,25 +1112,25 @@ function X(e, t, n, r) {
|
|
|
1112
1112
|
}
|
|
1113
1113
|
return e;
|
|
1114
1114
|
}
|
|
1115
|
-
function
|
|
1115
|
+
function Q(e) {
|
|
1116
1116
|
return e.width / e.height;
|
|
1117
1117
|
}
|
|
1118
|
-
function
|
|
1118
|
+
function _t(e, t) {
|
|
1119
1119
|
return Math.min(t.right !== void 0 && t.left !== void 0 ? (t.right - t.left) / e.width : Infinity, t.bottom !== void 0 && t.top !== void 0 ? (t.bottom - t.top) / e.height : Infinity);
|
|
1120
1120
|
}
|
|
1121
|
-
function
|
|
1121
|
+
function vt(e, t) {
|
|
1122
1122
|
var n = {
|
|
1123
1123
|
left: 0,
|
|
1124
1124
|
top: 0
|
|
1125
|
-
}, r =
|
|
1125
|
+
}, r = ht(e, t);
|
|
1126
1126
|
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;
|
|
1127
1127
|
}
|
|
1128
|
-
function
|
|
1128
|
+
function yt(e, t) {
|
|
1129
1129
|
var n;
|
|
1130
1130
|
return t.minimum && e < t.minimum ? n = t.minimum : t.maximum && e > t.maximum && (n = t.maximum), n;
|
|
1131
1131
|
}
|
|
1132
|
-
function
|
|
1133
|
-
var n =
|
|
1132
|
+
function bt(e, t) {
|
|
1133
|
+
var n = Q(e), r = Q(t);
|
|
1134
1134
|
return t.width < Infinity && t.height < Infinity ? n > r ? {
|
|
1135
1135
|
width: t.width,
|
|
1136
1136
|
height: t.width / n
|
|
@@ -1145,62 +1145,62 @@ function xt(e, t) {
|
|
|
1145
1145
|
height: t.height
|
|
1146
1146
|
} : e;
|
|
1147
1147
|
}
|
|
1148
|
-
function
|
|
1148
|
+
function xt(e, t) {
|
|
1149
1149
|
var n = t * Math.PI / 180;
|
|
1150
1150
|
return {
|
|
1151
1151
|
width: Math.abs(e.width * Math.cos(n)) + Math.abs(e.height * Math.sin(n)),
|
|
1152
1152
|
height: Math.abs(e.width * Math.sin(n)) + Math.abs(e.height * Math.cos(n))
|
|
1153
1153
|
};
|
|
1154
1154
|
}
|
|
1155
|
-
function
|
|
1155
|
+
function St(e, t) {
|
|
1156
1156
|
var n = t * Math.PI / 180;
|
|
1157
1157
|
return {
|
|
1158
1158
|
left: e.left * Math.cos(n) - e.top * Math.sin(n),
|
|
1159
1159
|
top: e.left * Math.sin(n) + e.top * Math.cos(n)
|
|
1160
1160
|
};
|
|
1161
1161
|
}
|
|
1162
|
-
function
|
|
1163
|
-
var n =
|
|
1164
|
-
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,
|
|
1162
|
+
function Ct(e, t) {
|
|
1163
|
+
var n = ht($(e, t), t);
|
|
1164
|
+
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, _t(e, t)) : Math.min((e.height + n.top + n.bottom) / e.height, _t(e, t)) : 1;
|
|
1165
1165
|
}
|
|
1166
|
-
function
|
|
1166
|
+
function $(e, t, n) {
|
|
1167
1167
|
n === void 0 && (n = !1);
|
|
1168
|
-
var r =
|
|
1169
|
-
return
|
|
1168
|
+
var r = vt(e, t);
|
|
1169
|
+
return X(e, n ? gt(r) : r);
|
|
1170
1170
|
}
|
|
1171
|
-
function
|
|
1171
|
+
function wt(e) {
|
|
1172
1172
|
return {
|
|
1173
1173
|
width: e.right !== void 0 && e.left !== void 0 ? e.right - e.left : Infinity,
|
|
1174
1174
|
height: e.bottom !== void 0 && e.top !== void 0 ? e.bottom - e.top : Infinity
|
|
1175
1175
|
};
|
|
1176
1176
|
}
|
|
1177
|
-
function
|
|
1178
|
-
return
|
|
1177
|
+
function Tt(e, t) {
|
|
1178
|
+
return W(W({}, e), {
|
|
1179
1179
|
minWidth: Math.min(t.width, e.minWidth),
|
|
1180
1180
|
minHeight: Math.min(t.height, e.minHeight),
|
|
1181
1181
|
maxWidth: Math.min(t.width, e.maxWidth),
|
|
1182
1182
|
maxHeight: Math.min(t.height, e.maxHeight)
|
|
1183
1183
|
});
|
|
1184
1184
|
}
|
|
1185
|
-
function
|
|
1185
|
+
function Et(e, t, n) {
|
|
1186
1186
|
n === void 0 && (n = !0);
|
|
1187
1187
|
var r = {};
|
|
1188
|
-
return
|
|
1188
|
+
return K.forEach((function(i) {
|
|
1189
1189
|
var a = e[i], o = t[i];
|
|
1190
1190
|
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;
|
|
1191
1191
|
})), r;
|
|
1192
1192
|
}
|
|
1193
|
-
function
|
|
1194
|
-
return
|
|
1193
|
+
function Dt(e, t) {
|
|
1194
|
+
return Et(e, t, !0);
|
|
1195
1195
|
}
|
|
1196
|
-
function
|
|
1196
|
+
function Ot(e) {
|
|
1197
1197
|
var t = e.size, n = e.aspectRatio, r = e.ignoreMinimum, i = e.sizeRestrictions;
|
|
1198
|
-
return !!((t.correctRatio ||
|
|
1198
|
+
return !!((t.correctRatio || Q(t) >= n.minimum && Q(t) <= n.maximum) && t.height <= i.maxHeight && t.width <= i.maxWidth && t.width && t.height && (r || t.height >= i.minHeight && t.width >= i.minWidth));
|
|
1199
1199
|
}
|
|
1200
|
-
function
|
|
1200
|
+
function kt(e, t) {
|
|
1201
1201
|
return (e.width - t.width) ** 2 + (e.height - t.height) ** 2;
|
|
1202
1202
|
}
|
|
1203
|
-
function
|
|
1203
|
+
function At(e) {
|
|
1204
1204
|
var t = e.width, n = e.height, r = e.sizeRestrictions, i = {
|
|
1205
1205
|
minimum: e.aspectRatio && e.aspectRatio.minimum || 0,
|
|
1206
1206
|
maximum: e.aspectRatio && e.aspectRatio.maximum || Infinity
|
|
@@ -1210,15 +1210,15 @@ function $(e) {
|
|
|
1210
1210
|
};
|
|
1211
1211
|
function o(e, a) {
|
|
1212
1212
|
return a === void 0 && (a = !1), e.reduce((function(e, o) {
|
|
1213
|
-
return
|
|
1213
|
+
return Ot({
|
|
1214
1214
|
size: o,
|
|
1215
1215
|
aspectRatio: i,
|
|
1216
1216
|
sizeRestrictions: r,
|
|
1217
1217
|
ignoreMinimum: a
|
|
1218
|
-
}) && (!e ||
|
|
1218
|
+
}) && (!e || kt(o, {
|
|
1219
1219
|
width: t,
|
|
1220
1220
|
height: n
|
|
1221
|
-
}) <
|
|
1221
|
+
}) < kt(e, {
|
|
1222
1222
|
width: t,
|
|
1223
1223
|
height: n
|
|
1224
1224
|
})) ? o : e;
|
|
@@ -1235,7 +1235,7 @@ function $(e) {
|
|
|
1235
1235
|
height: a.height,
|
|
1236
1236
|
correctRatio: !0
|
|
1237
1237
|
});
|
|
1238
|
-
})),
|
|
1238
|
+
})), Ot({
|
|
1239
1239
|
size: a,
|
|
1240
1240
|
aspectRatio: i,
|
|
1241
1241
|
sizeRestrictions: r
|
|
@@ -1247,28 +1247,28 @@ function $(e) {
|
|
|
1247
1247
|
};
|
|
1248
1248
|
}
|
|
1249
1249
|
function jt(e) {
|
|
1250
|
-
var t = e.event, n = e.coordinates, r = e.positionRestrictions, i = r === void 0 ? {} : r, a =
|
|
1251
|
-
return
|
|
1250
|
+
var t = e.event, n = e.coordinates, r = e.positionRestrictions, i = r === void 0 ? {} : r, a = X(n, t.directions);
|
|
1251
|
+
return X(a, vt(a, i));
|
|
1252
1252
|
}
|
|
1253
1253
|
function Mt(e) {
|
|
1254
1254
|
var t = e.coordinates, n = e.transform, r = e.imageSize, i = e.sizeRestrictions, a = e.positionRestrictions, o = e.aspectRatio, s = e.visibleArea, c = function(e, t) {
|
|
1255
1255
|
return jt({
|
|
1256
1256
|
coordinates: e,
|
|
1257
1257
|
positionRestrictions: a,
|
|
1258
|
-
event: new
|
|
1258
|
+
event: new tt({
|
|
1259
1259
|
left: t.left - e.left,
|
|
1260
1260
|
top: t.top - e.top
|
|
1261
1261
|
})
|
|
1262
1262
|
});
|
|
1263
|
-
}, l =
|
|
1263
|
+
}, l = W({}, t);
|
|
1264
1264
|
return (Array.isArray(n) ? n : [n]).forEach((function(e) {
|
|
1265
1265
|
var t = {};
|
|
1266
|
-
|
|
1266
|
+
G((t = typeof e == "function" ? e({
|
|
1267
1267
|
coordinates: l,
|
|
1268
1268
|
imageSize: r,
|
|
1269
1269
|
visibleArea: s
|
|
1270
|
-
}) : e).width) &&
|
|
1271
|
-
return c(
|
|
1270
|
+
}) : e).width) && G(t.height) || (l = function(e, t) {
|
|
1271
|
+
return c(W(W(W({}, e), At({
|
|
1272
1272
|
width: t.width,
|
|
1273
1273
|
height: t.height,
|
|
1274
1274
|
sizeRestrictions: i,
|
|
@@ -1280,48 +1280,48 @@ function Mt(e) {
|
|
|
1280
1280
|
left: e.left,
|
|
1281
1281
|
top: e.top
|
|
1282
1282
|
});
|
|
1283
|
-
}(l,
|
|
1283
|
+
}(l, W(W({}, l), t))), G(t.left) && G(t.top) || (l = c(l, W(W({}, l), t)));
|
|
1284
1284
|
})), l;
|
|
1285
1285
|
}
|
|
1286
1286
|
function Nt(e) {
|
|
1287
|
-
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 =
|
|
1288
|
-
c =
|
|
1287
|
+
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 = W({}, r), f = W({}, i), p = W({}, a);
|
|
1288
|
+
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 = W(W({}, d), At({
|
|
1289
1289
|
sizeRestrictions: o,
|
|
1290
1290
|
width: d.width,
|
|
1291
1291
|
height: d.height,
|
|
1292
1292
|
aspectRatio: {
|
|
1293
|
-
minimum:
|
|
1294
|
-
maximum:
|
|
1293
|
+
minimum: Q(p),
|
|
1294
|
+
maximum: Q(p)
|
|
1295
1295
|
}
|
|
1296
1296
|
})));
|
|
1297
|
-
var m =
|
|
1297
|
+
var m = Ct(f = Z(f, d.width * n.width / (f.width * p.width)), t({
|
|
1298
1298
|
visibleArea: f,
|
|
1299
1299
|
type: "resize"
|
|
1300
1300
|
}));
|
|
1301
|
-
return m !== 1 && (f =
|
|
1301
|
+
return m !== 1 && (f = Z(f, m), d = Z(d, m)), f = $(f = X(f, mt(J(d), J(f))), t({
|
|
1302
1302
|
visibleArea: f,
|
|
1303
1303
|
type: "move"
|
|
1304
1304
|
})), {
|
|
1305
|
-
coordinates: d =
|
|
1305
|
+
coordinates: d = $(d, Dt(q(f), s)),
|
|
1306
1306
|
visibleArea: f
|
|
1307
1307
|
};
|
|
1308
1308
|
}
|
|
1309
1309
|
function Pt(e) {
|
|
1310
|
-
var t = e.event, n = e.getAreaRestrictions, r = e.boundaries, i = e.coordinates, a = e.visibleArea, o = e.positionRestrictions, s =
|
|
1310
|
+
var t = e.event, n = e.getAreaRestrictions, r = e.boundaries, i = e.coordinates, a = e.visibleArea, o = e.positionRestrictions, s = W({}, i), c = W({}, a);
|
|
1311
1311
|
if (i && a && t.type !== "manipulateImage") {
|
|
1312
1312
|
var l = {
|
|
1313
1313
|
width: 0,
|
|
1314
1314
|
height: 0
|
|
1315
1315
|
};
|
|
1316
|
-
|
|
1317
|
-
var u =
|
|
1316
|
+
Q(r) > Q(s) ? (l.height = .8 * r.height, l.width = l.height * Q(s)) : (l.width = .8 * r.width, l.height = l.width * Q(s));
|
|
1317
|
+
var u = Ct(c = Z(c, s.width * r.width / (c.width * l.width)), n({
|
|
1318
1318
|
visibleArea: c,
|
|
1319
1319
|
type: "resize"
|
|
1320
1320
|
}));
|
|
1321
|
-
c =
|
|
1321
|
+
c = Z(c, u), u !== 1 && (l.height /= u, l.width /= u), c = $(c = X(c, mt(J(s), J(c))), n({
|
|
1322
1322
|
visibleArea: c,
|
|
1323
1323
|
type: "move"
|
|
1324
|
-
})), s =
|
|
1324
|
+
})), s = $(s, Dt(q(c), o));
|
|
1325
1325
|
}
|
|
1326
1326
|
return {
|
|
1327
1327
|
coordinates: s,
|
|
@@ -1329,16 +1329,16 @@ function Pt(e) {
|
|
|
1329
1329
|
};
|
|
1330
1330
|
}
|
|
1331
1331
|
function Ft(e) {
|
|
1332
|
-
var t = e.event, n = e.coordinates, r = e.visibleArea, i = e.getAreaRestrictions, a =
|
|
1332
|
+
var t = e.event, n = e.coordinates, r = e.visibleArea, i = e.getAreaRestrictions, a = W({}, r), o = W({}, n);
|
|
1333
1333
|
if (t.type === "setCoordinates") {
|
|
1334
1334
|
var s = Math.max(0, o.width - a.width), c = Math.max(0, o.height - a.height);
|
|
1335
|
-
s > c ? a =
|
|
1335
|
+
s > c ? a = Z(a, Math.min(o.width / a.width, _t(a, i({
|
|
1336
1336
|
visibleArea: a,
|
|
1337
1337
|
type: "resize"
|
|
1338
|
-
})))) : c > s && (a =
|
|
1338
|
+
})))) : c > s && (a = Z(a, Math.min(o.height / a.height, _t(a, i({
|
|
1339
1339
|
visibleArea: a,
|
|
1340
1340
|
type: "resize"
|
|
1341
|
-
}))))), a =
|
|
1341
|
+
}))))), a = $(a = X(a, gt(vt(o, q(a)))), i({
|
|
1342
1342
|
visibleArea: a,
|
|
1343
1343
|
type: "move"
|
|
1344
1344
|
}));
|
|
@@ -1356,21 +1356,21 @@ function It(e) {
|
|
|
1356
1356
|
};
|
|
1357
1357
|
}
|
|
1358
1358
|
function Lt(e) {
|
|
1359
|
-
var t = e.imageSize, n = e.visibleArea, r = e.aspectRatio, i = e.sizeRestrictions, a = n || t, o = Math.min(r.maximum || Infinity, Math.max(r.minimum || 0,
|
|
1359
|
+
var t = e.imageSize, n = e.visibleArea, r = e.aspectRatio, i = e.sizeRestrictions, a = n || t, o = Math.min(r.maximum || Infinity, Math.max(r.minimum || 0, Q(a))), s = a.width < a.height ? {
|
|
1360
1360
|
width: .8 * a.width,
|
|
1361
1361
|
height: .8 * a.width / o
|
|
1362
1362
|
} : {
|
|
1363
1363
|
height: .8 * a.height,
|
|
1364
1364
|
width: .8 * a.height * o
|
|
1365
1365
|
};
|
|
1366
|
-
return
|
|
1366
|
+
return At(W(W({}, s), {
|
|
1367
1367
|
aspectRatio: r,
|
|
1368
1368
|
sizeRestrictions: i
|
|
1369
1369
|
}));
|
|
1370
1370
|
}
|
|
1371
1371
|
function Rt(e) {
|
|
1372
1372
|
var t, n, r = e.imageSize, i = e.visibleArea, a = e.boundaries, o = e.aspectRatio, s = e.sizeRestrictions, c = e.stencilSize, l = i || r;
|
|
1373
|
-
return
|
|
1373
|
+
return Q(l) > Q(a) ? n = (t = c.height * l.height / a.height) * Q(c) : t = (n = c.width * l.width / a.width) / Q(c), At({
|
|
1374
1374
|
width: n,
|
|
1375
1375
|
height: t,
|
|
1376
1376
|
aspectRatio: o,
|
|
@@ -1378,26 +1378,26 @@ function Rt(e) {
|
|
|
1378
1378
|
});
|
|
1379
1379
|
}
|
|
1380
1380
|
function zt(e) {
|
|
1381
|
-
var t = e.getAreaRestrictions, n = e.coordinates, r = e.imageSize, i =
|
|
1381
|
+
var t = e.getAreaRestrictions, n = e.coordinates, r = e.imageSize, i = Q(e.boundaries);
|
|
1382
1382
|
if (n) {
|
|
1383
1383
|
var a = {
|
|
1384
1384
|
height: Math.max(n.height, r.height),
|
|
1385
1385
|
width: Math.max(n.width, r.width)
|
|
1386
|
-
}, o =
|
|
1387
|
-
width:
|
|
1388
|
-
height:
|
|
1389
|
-
},
|
|
1386
|
+
}, o = bt({
|
|
1387
|
+
width: Q(a) > i ? a.width : a.height * i,
|
|
1388
|
+
height: Q(a) > i ? a.width / i : a.height
|
|
1389
|
+
}, wt(t())), s = {
|
|
1390
1390
|
left: n.left + n.width / 2 - o.width / 2,
|
|
1391
1391
|
top: n.top + n.height / 2 - o.height / 2,
|
|
1392
1392
|
width: o.width,
|
|
1393
1393
|
height: o.height
|
|
1394
|
-
}, c =
|
|
1394
|
+
}, c = ht(n, q(W({
|
|
1395
1395
|
left: 0,
|
|
1396
1396
|
top: 0
|
|
1397
1397
|
}, r))), l = {};
|
|
1398
|
-
return !c.left && !c.right && s.width <= r.width && (l.left = 0, l.right = r.width), !c.top && !c.bottom && s.height <= r.height && (l.top = 0, l.bottom = r.height),
|
|
1398
|
+
return !c.left && !c.right && s.width <= r.width && (l.left = 0, l.right = r.width), !c.top && !c.bottom && s.height <= r.height && (l.top = 0, l.bottom = r.height), $(s, l);
|
|
1399
1399
|
}
|
|
1400
|
-
var u =
|
|
1400
|
+
var u = Q(r);
|
|
1401
1401
|
return o = {
|
|
1402
1402
|
height: u > i ? r.height : r.width / i,
|
|
1403
1403
|
width: u > i ? r.height * i : r.width
|
|
@@ -1409,27 +1409,27 @@ function zt(e) {
|
|
|
1409
1409
|
};
|
|
1410
1410
|
}
|
|
1411
1411
|
function Bt(e, t) {
|
|
1412
|
-
return
|
|
1412
|
+
return Et(e, q(t));
|
|
1413
1413
|
}
|
|
1414
1414
|
function Vt(e) {
|
|
1415
|
-
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 =
|
|
1416
|
-
u =
|
|
1415
|
+
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 = W({}, r), d = W({}, n), f = 1, p = 1, m = c.factor && Math.abs(c.factor - 1) > .001;
|
|
1416
|
+
u = X(u, {
|
|
1417
1417
|
left: l.left || 0,
|
|
1418
1418
|
top: l.top || 0
|
|
1419
1419
|
});
|
|
1420
1420
|
var h = {
|
|
1421
1421
|
stencil: {
|
|
1422
1422
|
minimum: Math.max(i.minWidth ? i.minWidth / d.width : 0, i.minHeight ? i.minHeight / d.height : 0),
|
|
1423
|
-
maximum: Math.min(i.maxWidth ? i.maxWidth / d.width : Infinity, i.maxHeight ? i.maxHeight / d.height : Infinity,
|
|
1423
|
+
maximum: Math.min(i.maxWidth ? i.maxWidth / d.width : Infinity, i.maxHeight ? i.maxHeight / d.height : Infinity, _t(d, o))
|
|
1424
1424
|
},
|
|
1425
|
-
area: { maximum:
|
|
1425
|
+
area: { maximum: _t(u, a({
|
|
1426
1426
|
visibleArea: u,
|
|
1427
1427
|
type: "resize"
|
|
1428
1428
|
})) }
|
|
1429
1429
|
};
|
|
1430
|
-
c.factor && m && (c.factor < 1 ? (p = Math.max(c.factor, h.stencil.minimum)) > 1 && (p = 1) : c.factor > 1 && (p = Math.min(c.factor, Math.min(h.area.maximum, h.stencil.maximum))) < 1 && (p = 1)), p && (u =
|
|
1430
|
+
c.factor && m && (c.factor < 1 ? (p = Math.max(c.factor, h.stencil.minimum)) > 1 && (p = 1) : c.factor > 1 && (p = Math.min(c.factor, Math.min(h.area.maximum, h.stencil.maximum))) < 1 && (p = 1)), p && (u = Z(u, p, c.center));
|
|
1431
1431
|
var g = n.left - r.left, _ = r.width + r.left - (n.width + n.left), v = n.top - r.top, y = r.height + r.top - (n.height + n.top);
|
|
1432
|
-
return u =
|
|
1432
|
+
return u = $(u = X(u, vt(u, {
|
|
1433
1433
|
left: o.left === void 0 ? void 0 : o.left - g * p,
|
|
1434
1434
|
top: o.top === void 0 ? void 0 : o.top - v * p,
|
|
1435
1435
|
bottom: o.bottom === void 0 ? void 0 : o.bottom + y * p,
|
|
@@ -1437,49 +1437,49 @@ function Vt(e) {
|
|
|
1437
1437
|
})), a({
|
|
1438
1438
|
visibleArea: u,
|
|
1439
1439
|
type: "move"
|
|
1440
|
-
})), d.width *= p, d.height *= p, d.left = u.left + g * p, d.top = u.top + v * p, d =
|
|
1440
|
+
})), d.width *= p, d.height *= p, d.left = u.left + g * p, d.top = u.top + v * p, d = $(d, Dt(q(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 : J(d)), a({
|
|
1441
1441
|
visibleArea: u,
|
|
1442
1442
|
type: "move"
|
|
1443
|
-
})),
|
|
1443
|
+
})), gt(vt(d, q(u)))))), {
|
|
1444
1444
|
coordinates: d,
|
|
1445
1445
|
visibleArea: u
|
|
1446
1446
|
};
|
|
1447
1447
|
}
|
|
1448
1448
|
function Ht(e) {
|
|
1449
|
-
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 =
|
|
1449
|
+
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 = W({}, r), d = W({}, i), f = St(J(W({
|
|
1450
1450
|
left: 0,
|
|
1451
1451
|
top: 0
|
|
1452
1452
|
}, c)), l);
|
|
1453
|
-
return (u =
|
|
1453
|
+
return (u = W(W({}, At({
|
|
1454
1454
|
sizeRestrictions: a,
|
|
1455
1455
|
aspectRatio: t,
|
|
1456
1456
|
width: u.width,
|
|
1457
1457
|
height: u.height
|
|
1458
|
-
})),
|
|
1458
|
+
})), St(J(u), l))).left -= f.left - s.width / 2 + u.width / 2, u.top -= f.top - s.height / 2 + u.height / 2, d = Z(d, Ct(d, n({
|
|
1459
1459
|
visibleArea: d,
|
|
1460
1460
|
type: "resize"
|
|
1461
1461
|
}))), {
|
|
1462
|
-
coordinates: u =
|
|
1463
|
-
visibleArea: d =
|
|
1462
|
+
coordinates: u = $(u, o),
|
|
1463
|
+
visibleArea: d = $(d = X(d, mt(J(u), J(r))), n({
|
|
1464
1464
|
visibleArea: d,
|
|
1465
1465
|
type: "move"
|
|
1466
1466
|
}))
|
|
1467
1467
|
};
|
|
1468
1468
|
}
|
|
1469
1469
|
function Ut(e) {
|
|
1470
|
-
var t = e.flip, n = e.previousFlip, r = e.rotate, i = e.getAreaRestrictions, a = e.coordinates, o = e.visibleArea, s = e.imageSize, c =
|
|
1470
|
+
var t = e.flip, n = e.previousFlip, r = e.rotate, i = e.getAreaRestrictions, a = e.coordinates, o = e.visibleArea, s = e.imageSize, c = W({}, a), l = W({}, o), u = n.horizontal !== t.horizontal, d = n.vertical !== t.vertical;
|
|
1471
1471
|
if (u || d) {
|
|
1472
|
-
var f =
|
|
1472
|
+
var f = St({
|
|
1473
1473
|
left: s.width / 2,
|
|
1474
1474
|
top: s.height / 2
|
|
1475
|
-
}, -r), p =
|
|
1475
|
+
}, -r), p = St(J(c), -r), m = St({
|
|
1476
1476
|
left: u ? f.left - (p.left - f.left) : p.left,
|
|
1477
1477
|
top: d ? f.top - (p.top - f.top) : p.top
|
|
1478
1478
|
}, r);
|
|
1479
|
-
c =
|
|
1479
|
+
c = X(c, mt(m, J(c))), p = St(J(l), -r), l = $(l = X(l, mt(m = St({
|
|
1480
1480
|
left: u ? f.left - (p.left - f.left) : p.left,
|
|
1481
1481
|
top: d ? f.top - (p.top - f.top) : p.top
|
|
1482
|
-
}, r),
|
|
1482
|
+
}, r), J(l))), i({
|
|
1483
1483
|
visibleArea: l,
|
|
1484
1484
|
type: "move"
|
|
1485
1485
|
}));
|
|
@@ -1490,10 +1490,10 @@ function Ut(e) {
|
|
|
1490
1490
|
};
|
|
1491
1491
|
}
|
|
1492
1492
|
function Wt(e) {
|
|
1493
|
-
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 =
|
|
1493
|
+
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 = W({}, t), l = Y(n, c).width, u = Y(n, c).height;
|
|
1494
1494
|
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)));
|
|
1495
|
-
var d =
|
|
1496
|
-
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 =
|
|
1495
|
+
var d = ht(Y(n, c), i);
|
|
1496
|
+
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(Y(n, c), i));
|
|
1497
1497
|
var f = {
|
|
1498
1498
|
width: Infinity,
|
|
1499
1499
|
height: Infinity,
|
|
@@ -1502,27 +1502,27 @@ function Wt(e) {
|
|
|
1502
1502
|
top: Infinity,
|
|
1503
1503
|
bottom: Infinity
|
|
1504
1504
|
};
|
|
1505
|
-
if (
|
|
1505
|
+
if (K.forEach((function(e) {
|
|
1506
1506
|
var t = d[e];
|
|
1507
1507
|
t && c[e] && (f[e] = Math.max(0, 1 - t / c[e]));
|
|
1508
1508
|
})), o) {
|
|
1509
|
-
var p = Math.min.apply(null,
|
|
1509
|
+
var p = Math.min.apply(null, K.map((function(e) {
|
|
1510
1510
|
return f[e];
|
|
1511
1511
|
})));
|
|
1512
|
-
p !== Infinity &&
|
|
1512
|
+
p !== Infinity && K.forEach((function(e) {
|
|
1513
1513
|
c[e] *= p;
|
|
1514
1514
|
}));
|
|
1515
|
-
} else
|
|
1515
|
+
} else K.forEach((function(e) {
|
|
1516
1516
|
f[e] !== Infinity && (c[e] *= f[e]);
|
|
1517
1517
|
}));
|
|
1518
|
-
if (l =
|
|
1518
|
+
if (l = Y(n, c).width, u = Y(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) {
|
|
1519
1519
|
var m = Math.min(f.width, f.height);
|
|
1520
|
-
m !== Infinity &&
|
|
1520
|
+
m !== Infinity && K.forEach((function(e) {
|
|
1521
1521
|
c[e] *= m;
|
|
1522
1522
|
}));
|
|
1523
|
-
} else f.width !== Infinity &&
|
|
1523
|
+
} else f.width !== Infinity && ct.forEach((function(e) {
|
|
1524
1524
|
c[e] *= f.width;
|
|
1525
|
-
})), f.height !== Infinity &&
|
|
1525
|
+
})), f.height !== Infinity && lt.forEach((function(e) {
|
|
1526
1526
|
c[e] *= f.height;
|
|
1527
1527
|
}));
|
|
1528
1528
|
return c;
|
|
@@ -1530,9 +1530,9 @@ function Wt(e) {
|
|
|
1530
1530
|
function Gt(e, t, n) {
|
|
1531
1531
|
return t == 0 && n == 0 ? e / 2 : t == 0 ? 0 : n == 0 ? e : e * Math.abs(t / (t + n));
|
|
1532
1532
|
}
|
|
1533
|
-
var Kt =
|
|
1533
|
+
var Kt = U("vue-simple-handler"), qt = U("vue-simple-handler-wrapper"), Jt = {
|
|
1534
1534
|
name: "SimpleHandler",
|
|
1535
|
-
components: { HandlerWrapper:
|
|
1535
|
+
components: { HandlerWrapper: at },
|
|
1536
1536
|
props: {
|
|
1537
1537
|
defaultClass: { type: String },
|
|
1538
1538
|
hoverClass: { type: String },
|
|
@@ -1548,10 +1548,10 @@ var Kt = H("vue-simple-handler"), qt = H("vue-simple-handler-wrapper"), Jt = {
|
|
|
1548
1548
|
return { hover: !1 };
|
|
1549
1549
|
},
|
|
1550
1550
|
computed: { classes: function() {
|
|
1551
|
-
var e, t = (
|
|
1551
|
+
var e, t = (V(e = {}, this.horizontalPosition, !!this.horizontalPosition), V(e, this.verticalPosition, !!this.verticalPosition), V(e, `${this.horizontalPosition}-${this.verticalPosition}`, !!(this.verticalPosition && this.horizontalPosition)), V(e, "hover", this.hover), e);
|
|
1552
1552
|
return {
|
|
1553
|
-
default:
|
|
1554
|
-
wrapper:
|
|
1553
|
+
default: H(Kt(t), this.defaultClass, this.hover && this.hoverClass),
|
|
1554
|
+
wrapper: H(qt(t), this.wrapperClass)
|
|
1555
1555
|
};
|
|
1556
1556
|
} },
|
|
1557
1557
|
methods: {
|
|
@@ -1597,9 +1597,9 @@ Jt.render = function(e, t, n, r, i, a) {
|
|
|
1597
1597
|
"onLeave"
|
|
1598
1598
|
]);
|
|
1599
1599
|
};
|
|
1600
|
-
var Yt =
|
|
1600
|
+
var Yt = U("vue-simple-line"), Xt = U("vue-simple-line-wrapper"), Zt = {
|
|
1601
1601
|
name: "SimpleLine",
|
|
1602
|
-
components: { LineWrapper:
|
|
1602
|
+
components: { LineWrapper: st },
|
|
1603
1603
|
props: {
|
|
1604
1604
|
defaultClass: { type: String },
|
|
1605
1605
|
hoverClass: { type: String },
|
|
@@ -1615,8 +1615,8 @@ var Yt = H("vue-simple-line"), Xt = H("vue-simple-line-wrapper"), Zt = {
|
|
|
1615
1615
|
},
|
|
1616
1616
|
computed: { classes: function() {
|
|
1617
1617
|
return {
|
|
1618
|
-
root:
|
|
1619
|
-
wrapper:
|
|
1618
|
+
root: H(Yt(V({}, this.position, !0)), this.defaultClass, this.hover && this.hoverClass),
|
|
1619
|
+
wrapper: H(Xt(V({}, this.position, !0)), this.wrapperClass)
|
|
1620
1620
|
};
|
|
1621
1621
|
} },
|
|
1622
1622
|
methods: {
|
|
@@ -1660,7 +1660,7 @@ Zt.render = function(e, t, n, r, i, a) {
|
|
|
1660
1660
|
"onLeave"
|
|
1661
1661
|
]);
|
|
1662
1662
|
};
|
|
1663
|
-
var Qt =
|
|
1663
|
+
var Qt = U("vue-bounding-box"), $t = [
|
|
1664
1664
|
"east",
|
|
1665
1665
|
"west",
|
|
1666
1666
|
null
|
|
@@ -1746,7 +1746,7 @@ var Qt = H("vue-bounding-box"), $t = [
|
|
|
1746
1746
|
return $t.forEach((function(t) {
|
|
1747
1747
|
en.forEach((function(n) {
|
|
1748
1748
|
if (t !== n) {
|
|
1749
|
-
var r =
|
|
1749
|
+
var r = Ue(t, n);
|
|
1750
1750
|
e.push({
|
|
1751
1751
|
name: r.name,
|
|
1752
1752
|
classname: r.classname,
|
|
@@ -1778,8 +1778,8 @@ var Qt = H("vue-bounding-box"), $t = [
|
|
|
1778
1778
|
n.horizontalDirection && n.verticalDirection || !e.lines[n.name] || t.push({
|
|
1779
1779
|
name: n.name,
|
|
1780
1780
|
component: e.linesComponent,
|
|
1781
|
-
class:
|
|
1782
|
-
wrapperClass:
|
|
1781
|
+
class: H(e.classes.lines.default, e.classes.lines[n.name], !e.resizable && e.classes.lines.disabled),
|
|
1782
|
+
wrapperClass: H(e.classes.linesWrappers.default, e.classes.linesWrappers[n.name], !e.resizable && e.classes.linesWrappers.disabled),
|
|
1783
1783
|
hoverClass: e.classes.lines.hover,
|
|
1784
1784
|
verticalDirection: n.verticalDirection,
|
|
1785
1785
|
horizontalDirection: n.horizontalDirection,
|
|
@@ -1794,8 +1794,8 @@ var Qt = H("vue-bounding-box"), $t = [
|
|
|
1794
1794
|
var a = {
|
|
1795
1795
|
name: i.name,
|
|
1796
1796
|
component: e.handlersComponent,
|
|
1797
|
-
class:
|
|
1798
|
-
wrapperClass:
|
|
1797
|
+
class: H(e.classes.handlers.default, e.classes.handlers[i.name]),
|
|
1798
|
+
wrapperClass: H(e.classes.handlersWrappers.default, e.classes.handlersWrappers[i.name]),
|
|
1799
1799
|
hoverClass: e.classes.handlers.hover,
|
|
1800
1800
|
verticalDirection: i.verticalDirection,
|
|
1801
1801
|
horizontalDirection: i.horizontalDirection,
|
|
@@ -1804,7 +1804,7 @@ var Qt = H("vue-bounding-box"), $t = [
|
|
|
1804
1804
|
if (n && r) {
|
|
1805
1805
|
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;
|
|
1806
1806
|
a.wrapperClass = Qt("handler"), a.wrapperStyle = { transform: `translate(${c}px, ${l}px)` }, e.transitions && e.transitions.enabled && (a.wrapperStyle.transition = `${e.transitions.time}ms ${e.transitions.timingFunction}`);
|
|
1807
|
-
} else a.wrapperClass = Qt("handler",
|
|
1807
|
+
} else a.wrapperClass = Qt("handler", V({}, i.classname, !0));
|
|
1808
1808
|
t.push(a);
|
|
1809
1809
|
}
|
|
1810
1810
|
})), t;
|
|
@@ -1830,7 +1830,7 @@ var Qt = H("vue-bounding-box"), $t = [
|
|
|
1830
1830
|
top: 0,
|
|
1831
1831
|
bottom: 0
|
|
1832
1832
|
};
|
|
1833
|
-
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
|
|
1833
|
+
t === "west" ? s.left -= a : t === "east" && (s.right += a), n === "north" ? s.top -= o : n === "south" && (s.bottom += o), !n && t ? r = "width" : n && !t && (r = "height"), this.resizable && this.$emit("resize", new et(s, {
|
|
1834
1834
|
allowedDirections: {
|
|
1835
1835
|
left: t === "west" || !t,
|
|
1836
1836
|
right: t === "east" || !t,
|
|
@@ -1904,7 +1904,7 @@ tn.render = function(e, t, n, r, s, c) {
|
|
|
1904
1904
|
})), 128))
|
|
1905
1905
|
], 6);
|
|
1906
1906
|
};
|
|
1907
|
-
var nn =
|
|
1907
|
+
var nn = U("vue-draggable-area"), rn = {
|
|
1908
1908
|
name: "DraggableArea",
|
|
1909
1909
|
props: {
|
|
1910
1910
|
movable: {
|
|
@@ -1932,14 +1932,14 @@ var nn = H("vue-draggable-area"), rn = {
|
|
|
1932
1932
|
onTouchStart: function(e) {
|
|
1933
1933
|
if (e.cancelable) {
|
|
1934
1934
|
var t = this.movable && e.touches.length === 1;
|
|
1935
|
-
t && (this.touches =
|
|
1935
|
+
t && (this.touches = Ie(e.touches)), (this.touchStarted || t) && (e.preventDefault(), e.stopPropagation());
|
|
1936
1936
|
}
|
|
1937
1937
|
},
|
|
1938
1938
|
onTouchEnd: function() {
|
|
1939
1939
|
this.touchStarted = !1, this.processEnd();
|
|
1940
1940
|
},
|
|
1941
1941
|
onTouchMove: function(e) {
|
|
1942
|
-
this.touches.length >= 1 && (this.touchStarted ? (this.processMove(e, e.touches), e.preventDefault(), e.stopPropagation()) :
|
|
1942
|
+
this.touches.length >= 1 && (this.touchStarted ? (this.processMove(e, e.touches), e.preventDefault(), e.stopPropagation()) : Qe({
|
|
1943
1943
|
x: this.touches[0].clientX,
|
|
1944
1944
|
y: this.touches[0].clientY
|
|
1945
1945
|
}, {
|
|
@@ -1978,10 +1978,10 @@ var nn = H("vue-draggable-area"), rn = {
|
|
|
1978
1978
|
};
|
|
1979
1979
|
},
|
|
1980
1980
|
processMove: function(e, t) {
|
|
1981
|
-
var n =
|
|
1981
|
+
var n = Ie(t);
|
|
1982
1982
|
if (this.touches.length) {
|
|
1983
1983
|
var r = this.$refs.container.getBoundingClientRect(), i = r.left, a = r.top;
|
|
1984
|
-
this.touches.length === 1 && n.length === 1 && this.$emit("move", new
|
|
1984
|
+
this.touches.length === 1 && n.length === 1 && this.$emit("move", new tt({
|
|
1985
1985
|
left: n[0].clientX - (i + this.anchor.x),
|
|
1986
1986
|
top: n[0].clientY - (a + this.anchor.y)
|
|
1987
1987
|
}));
|
|
@@ -2081,7 +2081,7 @@ function cn(e) {
|
|
|
2081
2081
|
return null;
|
|
2082
2082
|
}
|
|
2083
2083
|
}
|
|
2084
|
-
var ln =
|
|
2084
|
+
var ln = U("vue-preview-result"), un = {
|
|
2085
2085
|
name: "PreviewResult",
|
|
2086
2086
|
props: {
|
|
2087
2087
|
image: { type: Object },
|
|
@@ -2105,7 +2105,7 @@ var ln = H("vue-preview-result"), un = {
|
|
|
2105
2105
|
root: ln(),
|
|
2106
2106
|
wrapper: ln("wrapper"),
|
|
2107
2107
|
imageWrapper: ln("image-wrapper"),
|
|
2108
|
-
image:
|
|
2108
|
+
image: H(ln("image"), this.imageClass)
|
|
2109
2109
|
};
|
|
2110
2110
|
},
|
|
2111
2111
|
wrapperStyle: function() {
|
|
@@ -2118,7 +2118,7 @@ var ln = H("vue-preview-result"), un = {
|
|
|
2118
2118
|
return this.transitions && this.transitions.enabled && (e.transition = `${this.transitions.time}ms ${this.transitions.timingFunction}`), e;
|
|
2119
2119
|
},
|
|
2120
2120
|
imageStyle: function() {
|
|
2121
|
-
var e = this.image.transforms, t =
|
|
2121
|
+
var e = this.image.transforms, t = xt({
|
|
2122
2122
|
width: this.image.width,
|
|
2123
2123
|
height: this.image.height
|
|
2124
2124
|
}, e.rotate), n = {
|
|
@@ -2146,7 +2146,7 @@ function dn(e, t) {
|
|
|
2146
2146
|
return e.forEach((function(t) {
|
|
2147
2147
|
a.left += (t.clientX - r) / e.length, a.top += (t.clientY - i) / e.length;
|
|
2148
2148
|
})), e.forEach((function(e) {
|
|
2149
|
-
o +=
|
|
2149
|
+
o += Qe({
|
|
2150
2150
|
x: a.left,
|
|
2151
2151
|
y: a.top
|
|
2152
2152
|
}, {
|
|
@@ -2201,18 +2201,18 @@ var fn = {
|
|
|
2201
2201
|
window.removeEventListener("mouseup", this.onMouseUp), window.removeEventListener("mousemove", this.onMouseMove), window.removeEventListener("touchmove", this.onTouchMove), window.removeEventListener("touchend", this.onTouchEnd);
|
|
2202
2202
|
},
|
|
2203
2203
|
created: function() {
|
|
2204
|
-
this.transforming = !1, this.debouncedProcessEnd =
|
|
2204
|
+
this.transforming = !1, this.debouncedProcessEnd = He(this.processEnd), this.touches = [];
|
|
2205
2205
|
},
|
|
2206
2206
|
methods: {
|
|
2207
2207
|
processMove: function(e, t) {
|
|
2208
2208
|
if (this.touches.length) {
|
|
2209
|
-
if (this.touches.length === 1 && t.length === 1) this.$emit("move", new
|
|
2209
|
+
if (this.touches.length === 1 && t.length === 1) this.$emit("move", new $e({
|
|
2210
2210
|
left: this.touches[0].clientX - t[0].clientX,
|
|
2211
2211
|
top: this.touches[0].clientY - t[0].clientY
|
|
2212
2212
|
}));
|
|
2213
2213
|
else if (this.touches.length > 1 && this.touchResize) {
|
|
2214
2214
|
var n = dn(t, this.$refs.container), r = this.oldGeometricProperties;
|
|
2215
|
-
r.count === n.count && r.count > 1 && this.$emit("resize", new
|
|
2215
|
+
r.count === n.count && r.count > 1 && this.$emit("resize", new $e({
|
|
2216
2216
|
left: r.centerMass.left - n.centerMass.left,
|
|
2217
2217
|
top: r.centerMass.top - n.centerMass.top
|
|
2218
2218
|
}, {
|
|
@@ -2235,7 +2235,7 @@ var fn = {
|
|
|
2235
2235
|
onTouchStart: function(e) {
|
|
2236
2236
|
if (e.cancelable && (this.touchMove || this.touchResize && e.touches.length > 1) && this.processEvent(e)) {
|
|
2237
2237
|
var t = this.$refs.container, n = t.getBoundingClientRect(), r = n.left, i = n.top, a = n.bottom, o = n.right;
|
|
2238
|
-
this.touches =
|
|
2238
|
+
this.touches = Ie(e.touches).filter((function(e) {
|
|
2239
2239
|
return e.clientX > r && e.clientX < o && e.clientY > i && e.clientY < a;
|
|
2240
2240
|
})), this.oldGeometricProperties = dn(this.touches, t);
|
|
2241
2241
|
}
|
|
@@ -2246,7 +2246,7 @@ var fn = {
|
|
|
2246
2246
|
onTouchMove: function(e) {
|
|
2247
2247
|
var t = this;
|
|
2248
2248
|
if (this.touches.length) {
|
|
2249
|
-
var n =
|
|
2249
|
+
var n = Ie(e.touches).filter((function(e) {
|
|
2250
2250
|
return !e.identifier || t.touches.find((function(t) {
|
|
2251
2251
|
return t.identifier === e.identifier;
|
|
2252
2252
|
}));
|
|
@@ -2275,11 +2275,11 @@ var fn = {
|
|
|
2275
2275
|
},
|
|
2276
2276
|
onWheel: function(e) {
|
|
2277
2277
|
if (this.wheelResize && this.processEvent(e)) {
|
|
2278
|
-
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 ||
|
|
2278
|
+
var t = this.$refs.container.getBoundingClientRect(), n = t.left, r = t.top, i = 1 + this.wheelResize.ratio * (o = e.deltaY || e.detail || e.wheelDelta, (s = +o) == 0 || Ze(s) ? s : s > 0 ? 1 : -1), a = {
|
|
2279
2279
|
left: e.clientX - n,
|
|
2280
2280
|
top: e.clientY - r
|
|
2281
2281
|
};
|
|
2282
|
-
this.$emit("resize", new
|
|
2282
|
+
this.$emit("resize", new $e({}, {
|
|
2283
2283
|
factor: i,
|
|
2284
2284
|
center: a
|
|
2285
2285
|
})), this.touches.length || this.debouncedProcessEnd();
|
|
@@ -2354,7 +2354,7 @@ pn.render = function(e, t, n, r, i, l) {
|
|
|
2354
2354
|
"wheel-resize"
|
|
2355
2355
|
]);
|
|
2356
2356
|
};
|
|
2357
|
-
var mn =
|
|
2357
|
+
var mn = U("vue-preview"), hn = {
|
|
2358
2358
|
props: {
|
|
2359
2359
|
coordinates: { type: Object },
|
|
2360
2360
|
transitions: { type: Object },
|
|
@@ -2387,7 +2387,7 @@ var mn = H("vue-preview"), hn = {
|
|
|
2387
2387
|
root: mn({ fill: this.fill }),
|
|
2388
2388
|
wrapper: mn("wrapper"),
|
|
2389
2389
|
imageWrapper: mn("image-wrapper"),
|
|
2390
|
-
image:
|
|
2390
|
+
image: H(mn("image"), this.imageClass)
|
|
2391
2391
|
};
|
|
2392
2392
|
},
|
|
2393
2393
|
style: function() {
|
|
@@ -2406,7 +2406,7 @@ var mn = H("vue-preview"), hn = {
|
|
|
2406
2406
|
},
|
|
2407
2407
|
imageStyle: function() {
|
|
2408
2408
|
if (this.coordinates && this.image) {
|
|
2409
|
-
var e = this.coordinates.width / this.size.width, t =
|
|
2409
|
+
var e = this.coordinates.width / this.size.width, t = B(B({
|
|
2410
2410
|
rotate: 0,
|
|
2411
2411
|
flip: {
|
|
2412
2412
|
horizontal: !1,
|
|
@@ -2415,7 +2415,7 @@ var mn = H("vue-preview"), hn = {
|
|
|
2415
2415
|
}, this.image.transforms), {}, {
|
|
2416
2416
|
scaleX: 1 / e,
|
|
2417
2417
|
scaleY: 1 / e
|
|
2418
|
-
}), n = this.imageSize.width, r = this.imageSize.height, i =
|
|
2418
|
+
}), n = this.imageSize.width, r = this.imageSize.height, i = xt({
|
|
2419
2419
|
width: n,
|
|
2420
2420
|
height: r
|
|
2421
2421
|
}, t.rotate), a = {
|
|
@@ -2502,7 +2502,7 @@ gn.render = function(e, t, n, r, i, a) {
|
|
|
2502
2502
|
var c = s("preview");
|
|
2503
2503
|
return o(), v(c, b(e.$attrs, { fill: !0 }), null, 16);
|
|
2504
2504
|
};
|
|
2505
|
-
var _n =
|
|
2505
|
+
var _n = U("vue-rectangle-stencil"), vn = {
|
|
2506
2506
|
name: "RectangleStencil",
|
|
2507
2507
|
components: {
|
|
2508
2508
|
StencilPreview: gn,
|
|
@@ -2577,13 +2577,13 @@ var _n = H("vue-rectangle-stencil"), vn = {
|
|
|
2577
2577
|
computed: {
|
|
2578
2578
|
classes: function() {
|
|
2579
2579
|
return {
|
|
2580
|
-
stencil:
|
|
2580
|
+
stencil: H(_n({
|
|
2581
2581
|
movable: this.movable,
|
|
2582
2582
|
moving: this.moving,
|
|
2583
2583
|
resizing: this.resizing
|
|
2584
2584
|
}), this.moving && this.movingClass, this.resizing && this.resizingClass),
|
|
2585
|
-
preview:
|
|
2586
|
-
boundingBox:
|
|
2585
|
+
preview: H(_n("preview"), this.previewClass),
|
|
2586
|
+
boundingBox: H(_n("bounding-box"), this.boundingBoxClass)
|
|
2587
2587
|
};
|
|
2588
2588
|
},
|
|
2589
2589
|
style: function() {
|
|
@@ -2693,7 +2693,7 @@ vn.render = function(e, t, n, r, i, a) {
|
|
|
2693
2693
|
"onResizeEnd"
|
|
2694
2694
|
])], 6);
|
|
2695
2695
|
};
|
|
2696
|
-
var yn =
|
|
2696
|
+
var yn = U("vue-circle-stencil"), bn = {
|
|
2697
2697
|
components: {
|
|
2698
2698
|
StencilPreview: gn,
|
|
2699
2699
|
BoundingBox: tn,
|
|
@@ -2774,13 +2774,13 @@ var yn = H("vue-circle-stencil"), bn = {
|
|
|
2774
2774
|
computed: {
|
|
2775
2775
|
classes: function() {
|
|
2776
2776
|
return {
|
|
2777
|
-
stencil:
|
|
2777
|
+
stencil: H(yn({
|
|
2778
2778
|
movable: this.movable,
|
|
2779
2779
|
moving: this.moving,
|
|
2780
2780
|
resizing: this.resizing
|
|
2781
2781
|
}), this.moving && this.movingClass, this.resizing && this.resizingClass),
|
|
2782
|
-
preview:
|
|
2783
|
-
boundingBox:
|
|
2782
|
+
preview: H(yn("preview"), this.previewClass),
|
|
2783
|
+
boundingBox: H(yn("bounding-box"), this.boundingBoxClass)
|
|
2784
2784
|
};
|
|
2785
2785
|
},
|
|
2786
2786
|
style: function() {
|
|
@@ -2890,7 +2890,7 @@ bn.render = function(e, t, n, r, i, a) {
|
|
|
2890
2890
|
"onResizeEnd"
|
|
2891
2891
|
])], 6);
|
|
2892
2892
|
};
|
|
2893
|
-
var xn = ["transitions"], Sn =
|
|
2893
|
+
var xn = ["transitions"], Sn = U("vue-advanced-cropper"), Cn = {
|
|
2894
2894
|
name: "Cropper",
|
|
2895
2895
|
components: { BackgroundWrapper: pn },
|
|
2896
2896
|
props: {
|
|
@@ -2956,7 +2956,7 @@ var xn = ["transitions"], Sn = H("vue-advanced-cropper"), Cn = {
|
|
|
2956
2956
|
type: String,
|
|
2957
2957
|
default: "fit-area",
|
|
2958
2958
|
validator: function(e) {
|
|
2959
|
-
return
|
|
2959
|
+
return dt.indexOf(e) !== -1;
|
|
2960
2960
|
}
|
|
2961
2961
|
},
|
|
2962
2962
|
roundResult: {
|
|
@@ -2990,24 +2990,24 @@ var xn = ["transitions"], Sn = H("vue-advanced-cropper"), Cn = {
|
|
|
2990
2990
|
resizeAlgorithm: {
|
|
2991
2991
|
type: Function,
|
|
2992
2992
|
default: function(e) {
|
|
2993
|
-
var t = e.event, n = e.coordinates, r = e.aspectRatio, i = e.positionRestrictions, a = e.sizeRestrictions, o =
|
|
2993
|
+
var t = e.event, n = e.coordinates, r = e.aspectRatio, i = e.positionRestrictions, a = e.sizeRestrictions, o = W(W({}, n), {
|
|
2994
2994
|
right: n.left + n.width,
|
|
2995
2995
|
bottom: n.top + n.height
|
|
2996
|
-
}), s = t.params || {}, c =
|
|
2996
|
+
}), s = t.params || {}, c = W({}, t.directions), l = s.allowedDirections || {
|
|
2997
2997
|
left: !0,
|
|
2998
2998
|
right: !0,
|
|
2999
2999
|
bottom: !0,
|
|
3000
3000
|
top: !0
|
|
3001
3001
|
};
|
|
3002
|
-
a.widthFrozen && (c.left = 0, c.right = 0), a.heightFrozen && (c.top = 0, c.bottom = 0),
|
|
3002
|
+
a.widthFrozen && (c.left = 0, c.right = 0), a.heightFrozen && (c.top = 0, c.bottom = 0), K.forEach((function(e) {
|
|
3003
3003
|
l[e] || (c[e] = 0);
|
|
3004
3004
|
}));
|
|
3005
|
-
var u =
|
|
3005
|
+
var u = Y(o, c = Wt({
|
|
3006
3006
|
coordinates: o,
|
|
3007
3007
|
directions: c,
|
|
3008
3008
|
sizeRestrictions: a,
|
|
3009
3009
|
positionRestrictions: i
|
|
3010
|
-
})).width, d =
|
|
3010
|
+
})).width, d = Y(o, c).height, f = s.preserveRatio ? Q(o) : yt(u / d, r);
|
|
3011
3011
|
if (f) {
|
|
3012
3012
|
var p = s.respectDirection;
|
|
3013
3013
|
if (p ||= o.width >= o.height || f === 1 ? "width" : "height", p === "width") {
|
|
@@ -3032,10 +3032,10 @@ var xn = ["transitions"], Sn = H("vue-advanced-cropper"), Cn = {
|
|
|
3032
3032
|
compensate: s.compensate
|
|
3033
3033
|
});
|
|
3034
3034
|
}
|
|
3035
|
-
return u =
|
|
3035
|
+
return u = Y(o, c).width, d = Y(o, c).height, (f = s.preserveRatio ? Q(o) : yt(u / d, r)) && Math.abs(f - u / d) > .001 && K.forEach((function(e) {
|
|
3036
3036
|
l[e] || (c[e] = 0);
|
|
3037
3037
|
})), jt({
|
|
3038
|
-
event: new
|
|
3038
|
+
event: new tt({
|
|
3039
3039
|
left: -c.left,
|
|
3040
3040
|
top: -c.top
|
|
3041
3041
|
}),
|
|
@@ -3056,14 +3056,14 @@ var xn = ["transitions"], Sn = H("vue-advanced-cropper"), Cn = {
|
|
|
3056
3056
|
initStretcher: {
|
|
3057
3057
|
type: Function,
|
|
3058
3058
|
default: function(e) {
|
|
3059
|
-
var t = e.stretcher, n = e.imageSize, r =
|
|
3059
|
+
var t = e.stretcher, n = e.imageSize, r = Q(n);
|
|
3060
3060
|
t.style.width = n.width + "px", t.style.height = t.clientWidth / r + "px", t.style.width = t.clientWidth + "px";
|
|
3061
3061
|
}
|
|
3062
3062
|
},
|
|
3063
3063
|
fitCoordinates: {
|
|
3064
3064
|
type: Function,
|
|
3065
3065
|
default: function(e) {
|
|
3066
|
-
var t = e.visibleArea, n = e.coordinates, r = e.aspectRatio, i = e.sizeRestrictions, a = e.positionRestrictions, o =
|
|
3066
|
+
var t = e.visibleArea, n = e.coordinates, r = e.aspectRatio, i = e.sizeRestrictions, a = e.positionRestrictions, o = W(W({}, n), At({
|
|
3067
3067
|
width: n.width,
|
|
3068
3068
|
height: n.height,
|
|
3069
3069
|
aspectRatio: r,
|
|
@@ -3074,19 +3074,19 @@ var xn = ["transitions"], Sn = H("vue-advanced-cropper"), Cn = {
|
|
|
3074
3074
|
minWidth: Math.min(t.width, i.minWidth)
|
|
3075
3075
|
}
|
|
3076
3076
|
}));
|
|
3077
|
-
return o =
|
|
3077
|
+
return o = $(o = X(o, mt(J(n), J(o))), Dt(q(t), a));
|
|
3078
3078
|
}
|
|
3079
3079
|
},
|
|
3080
3080
|
fitVisibleArea: {
|
|
3081
3081
|
type: Function,
|
|
3082
3082
|
default: function(e) {
|
|
3083
|
-
var t = e.visibleArea, n = e.boundaries, r = e.getAreaRestrictions, i = e.coordinates, a =
|
|
3084
|
-
a.height = a.width /
|
|
3085
|
-
var o =
|
|
3083
|
+
var t = e.visibleArea, n = e.boundaries, r = e.getAreaRestrictions, i = e.coordinates, a = W({}, t);
|
|
3084
|
+
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)));
|
|
3085
|
+
var o = gt(vt(i, q(a = Z(a, Ct(a, r({
|
|
3086
3086
|
visibleArea: a,
|
|
3087
3087
|
type: "resize"
|
|
3088
3088
|
}))))));
|
|
3089
|
-
return a.width < i.width && (o.left = 0), a.height < i.height && (o.top = 0), a =
|
|
3089
|
+
return a.width < i.width && (o.left = 0), a.height < i.height && (o.top = 0), a = $(a = X(a, o), r({
|
|
3090
3090
|
visibleArea: a,
|
|
3091
3091
|
type: "move"
|
|
3092
3092
|
}));
|
|
@@ -3101,7 +3101,7 @@ var xn = ["transitions"], Sn = H("vue-advanced-cropper"), Cn = {
|
|
|
3101
3101
|
top: 0,
|
|
3102
3102
|
right: r.width,
|
|
3103
3103
|
bottom: r.height
|
|
3104
|
-
} : i === "fit-area" && (
|
|
3104
|
+
} : i === "fit-area" && (Q(n) > Q(r) ? (o = {
|
|
3105
3105
|
top: 0,
|
|
3106
3106
|
bottom: r.height
|
|
3107
3107
|
}, t && a === "move" && (t.width > r.width ? (o.left = -(t.width - r.width) / 2, o.right = r.width - o.left) : (o.left = 0, o.right = r.width))) : (o = {
|
|
@@ -3163,7 +3163,7 @@ var xn = ["transitions"], Sn = H("vue-advanced-cropper"), Cn = {
|
|
|
3163
3163
|
height: 0
|
|
3164
3164
|
},
|
|
3165
3165
|
visibleArea: null,
|
|
3166
|
-
coordinates:
|
|
3166
|
+
coordinates: B({}, ft)
|
|
3167
3167
|
};
|
|
3168
3168
|
},
|
|
3169
3169
|
computed: {
|
|
@@ -3201,7 +3201,7 @@ var xn = ["transitions"], Sn = H("vue-advanced-cropper"), Cn = {
|
|
|
3201
3201
|
return !!(this.visibleArea && this.imageLoaded);
|
|
3202
3202
|
},
|
|
3203
3203
|
settings: function() {
|
|
3204
|
-
var e =
|
|
3204
|
+
var e = Je(this.resizeImage, {
|
|
3205
3205
|
touch: !0,
|
|
3206
3206
|
wheel: { ratio: .1 },
|
|
3207
3207
|
adjustStencil: !0
|
|
@@ -3211,7 +3211,7 @@ var xn = ["transitions"], Sn = H("vue-advanced-cropper"), Cn = {
|
|
|
3211
3211
|
adjustStencil: !1
|
|
3212
3212
|
});
|
|
3213
3213
|
return {
|
|
3214
|
-
moveImage:
|
|
3214
|
+
moveImage: Je(this.moveImage, {
|
|
3215
3215
|
touch: !0,
|
|
3216
3216
|
mouse: !0
|
|
3217
3217
|
}, {
|
|
@@ -3242,20 +3242,20 @@ var xn = ["transitions"], Sn = H("vue-advanced-cropper"), Cn = {
|
|
|
3242
3242
|
if (this.boundaries.width && this.boundaries.height && this.imageSize.width && this.imageSize.height) {
|
|
3243
3243
|
var e = this.sizeRestrictionsAlgorithm({
|
|
3244
3244
|
imageSize: this.imageSize,
|
|
3245
|
-
minWidth:
|
|
3246
|
-
minHeight:
|
|
3247
|
-
maxWidth:
|
|
3248
|
-
maxHeight:
|
|
3245
|
+
minWidth: G(this.minWidth) ? 0 : Ye(this.minWidth),
|
|
3246
|
+
minHeight: G(this.minHeight) ? 0 : Ye(this.minHeight),
|
|
3247
|
+
maxWidth: G(this.maxWidth) ? Infinity : Ye(this.maxWidth),
|
|
3248
|
+
maxHeight: G(this.maxHeight) ? Infinity : Ye(this.maxHeight)
|
|
3249
3249
|
});
|
|
3250
3250
|
if (e = function(e) {
|
|
3251
|
-
var t = e.areaRestrictions, n = e.sizeRestrictions, r = e.boundaries, i = e.positionRestrictions, a =
|
|
3251
|
+
var t = e.areaRestrictions, n = e.sizeRestrictions, r = e.boundaries, i = e.positionRestrictions, a = W(W({}, n), {
|
|
3252
3252
|
minWidth: n.minWidth === void 0 ? 0 : n.minWidth,
|
|
3253
3253
|
minHeight: n.minHeight === void 0 ? 0 : n.minHeight,
|
|
3254
3254
|
maxWidth: n.maxWidth === void 0 ? Infinity : n.maxWidth,
|
|
3255
3255
|
maxHeight: n.maxHeight === void 0 ? Infinity : n.maxHeight
|
|
3256
3256
|
});
|
|
3257
3257
|
i.left !== void 0 && i.right !== void 0 && (a.maxWidth = Math.min(a.maxWidth, i.right - i.left)), i.bottom !== void 0 && i.top !== void 0 && (a.maxHeight = Math.min(a.maxHeight, i.bottom - i.top));
|
|
3258
|
-
var o =
|
|
3258
|
+
var o = wt(t), s = bt(r, o);
|
|
3259
3259
|
return o.width < Infinity && (!a.maxWidth || a.maxWidth > s.width) && (a.maxWidth = Math.min(a.maxWidth, s.width)), o.height < Infinity && (!a.maxHeight || a.maxHeight > s.height) && (a.maxHeight = Math.min(a.maxHeight, s.height)), a.minWidth > a.maxWidth && (a.minWidth = a.maxWidth, a.widthFrozen = !0), a.minHeight > a.maxHeight && (a.minHeight = a.maxHeight, a.heightFrozen = !0), a;
|
|
3260
3260
|
}({
|
|
3261
3261
|
sizeRestrictions: e,
|
|
@@ -3270,7 +3270,7 @@ var xn = ["transitions"], Sn = H("vue-advanced-cropper"), Cn = {
|
|
|
3270
3270
|
visibleArea: this.visibleArea,
|
|
3271
3271
|
stencilSize: this.getStencilSize()
|
|
3272
3272
|
}), this.visibleArea && this.stencilSize) {
|
|
3273
|
-
var t = this.getStencilSize(), n =
|
|
3273
|
+
var t = this.getStencilSize(), n = wt(this.getAreaRestrictions({
|
|
3274
3274
|
visibleArea: this.visibleArea,
|
|
3275
3275
|
type: "resize"
|
|
3276
3276
|
}));
|
|
@@ -3294,14 +3294,14 @@ var xn = ["transitions"], Sn = H("vue-advanced-cropper"), Cn = {
|
|
|
3294
3294
|
classes: function() {
|
|
3295
3295
|
return {
|
|
3296
3296
|
cropper: Sn(),
|
|
3297
|
-
image:
|
|
3297
|
+
image: H(Sn("image"), this.imageClass),
|
|
3298
3298
|
stencil: Sn("stencil"),
|
|
3299
|
-
boundaries:
|
|
3300
|
-
stretcher:
|
|
3301
|
-
background:
|
|
3302
|
-
foreground:
|
|
3303
|
-
imageWrapper:
|
|
3304
|
-
cropperWrapper:
|
|
3299
|
+
boundaries: H(Sn("boundaries"), this.boundariesClass),
|
|
3300
|
+
stretcher: H(Sn("stretcher")),
|
|
3301
|
+
background: H(Sn("background"), this.backgroundClass),
|
|
3302
|
+
foreground: H(Sn("foreground"), this.foregroundClass),
|
|
3303
|
+
imageWrapper: H(Sn("image-wrapper")),
|
|
3304
|
+
cropperWrapper: H(Sn("cropper-wrapper"))
|
|
3305
3305
|
};
|
|
3306
3306
|
},
|
|
3307
3307
|
stencilCoordinates: function() {
|
|
@@ -3338,7 +3338,7 @@ var xn = ["transitions"], Sn = H("vue-advanced-cropper"), Cn = {
|
|
|
3338
3338
|
}, n = {
|
|
3339
3339
|
left: (1 - 1 / this.coefficient) * e.width / 2,
|
|
3340
3340
|
top: (1 - 1 / this.coefficient) * e.height / 2
|
|
3341
|
-
}, r =
|
|
3341
|
+
}, r = B(B({}, this.imageTransforms), {}, {
|
|
3342
3342
|
scaleX: this.imageTransforms.scaleX * (this.imageAttributes.width / e.width),
|
|
3343
3343
|
scaleY: this.imageTransforms.scaleY * (this.imageAttributes.height / e.height)
|
|
3344
3344
|
}), i = {
|
|
@@ -3387,7 +3387,7 @@ var xn = ["transitions"], Sn = H("vue-advanced-cropper"), Cn = {
|
|
|
3387
3387
|
}
|
|
3388
3388
|
},
|
|
3389
3389
|
created: function() {
|
|
3390
|
-
this.debouncedUpdate =
|
|
3390
|
+
this.debouncedUpdate = He(this.update, this.debounce), this.debouncedDisableTransitions = He(this.disableTransitions, this.transitionsOptions.time), this.awaiting = !1;
|
|
3391
3391
|
},
|
|
3392
3392
|
mounted: function() {
|
|
3393
3393
|
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);
|
|
@@ -3397,16 +3397,16 @@ var xn = ["transitions"], Sn = H("vue-advanced-cropper"), Cn = {
|
|
|
3397
3397
|
},
|
|
3398
3398
|
methods: {
|
|
3399
3399
|
getResult: function() {
|
|
3400
|
-
var e = this.initialized ? this.prepareResult(
|
|
3400
|
+
var e = this.initialized ? this.prepareResult(B({}, this.coordinates)) : this.defaultCoordinates(), t = {
|
|
3401
3401
|
rotate: this.imageTransforms.rotate % 360,
|
|
3402
|
-
flip:
|
|
3402
|
+
flip: B({}, this.imageTransforms.flip)
|
|
3403
3403
|
};
|
|
3404
3404
|
if (this.src && this.imageLoaded) {
|
|
3405
3405
|
var n = this;
|
|
3406
3406
|
return {
|
|
3407
3407
|
image: this.image,
|
|
3408
3408
|
coordinates: e,
|
|
3409
|
-
visibleArea: this.visibleArea ?
|
|
3409
|
+
visibleArea: this.visibleArea ? B({}, this.visibleArea) : null,
|
|
3410
3410
|
imageTransforms: t,
|
|
3411
3411
|
get canvas() {
|
|
3412
3412
|
return n.canvas ? n.getCanvas() : void 0;
|
|
@@ -3416,14 +3416,14 @@ var xn = ["transitions"], Sn = H("vue-advanced-cropper"), Cn = {
|
|
|
3416
3416
|
return {
|
|
3417
3417
|
image: this.image,
|
|
3418
3418
|
coordinates: e,
|
|
3419
|
-
visibleArea: this.visibleArea ?
|
|
3419
|
+
visibleArea: this.visibleArea ? B({}, this.visibleArea) : null,
|
|
3420
3420
|
canvas: void 0,
|
|
3421
3421
|
imageTransforms: t
|
|
3422
3422
|
};
|
|
3423
3423
|
},
|
|
3424
3424
|
zoom: function(e, t) {
|
|
3425
3425
|
var n = (arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}).transitions, r = n === void 0 || n;
|
|
3426
|
-
this.onManipulateImage(new
|
|
3426
|
+
this.onManipulateImage(new $e({}, {
|
|
3427
3427
|
factor: 1 / e,
|
|
3428
3428
|
center: t
|
|
3429
3429
|
}), {
|
|
@@ -3433,7 +3433,7 @@ var xn = ["transitions"], Sn = H("vue-advanced-cropper"), Cn = {
|
|
|
3433
3433
|
},
|
|
3434
3434
|
move: function(e, t) {
|
|
3435
3435
|
var n = (arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}).transitions, r = n === void 0 || n;
|
|
3436
|
-
this.onManipulateImage(new
|
|
3436
|
+
this.onManipulateImage(new $e({
|
|
3437
3437
|
left: e || 0,
|
|
3438
3438
|
top: t || 0
|
|
3439
3439
|
}), {
|
|
@@ -3475,8 +3475,8 @@ var xn = ["transitions"], Sn = H("vue-advanced-cropper"), Cn = {
|
|
|
3475
3475
|
left: Math.round(t.left),
|
|
3476
3476
|
top: Math.round(t.top)
|
|
3477
3477
|
};
|
|
3478
|
-
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)),
|
|
3479
|
-
}(
|
|
3478
|
+
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);
|
|
3479
|
+
}(B(B({}, this.getPublicProperties()), {}, {
|
|
3480
3480
|
positionRestrictions: Bt(this.positionRestrictions, this.visibleArea),
|
|
3481
3481
|
coordinates: e
|
|
3482
3482
|
})) : e;
|
|
@@ -3498,16 +3498,16 @@ var xn = ["transitions"], Sn = H("vue-advanced-cropper"), Cn = {
|
|
|
3498
3498
|
sizeRestrictions: this.sizeRestrictions,
|
|
3499
3499
|
stencilSize: this.getStencilSize()
|
|
3500
3500
|
});
|
|
3501
|
-
return
|
|
3501
|
+
return B(B({}, a), {}, { changed: !pt(a.visibleArea, t) || !pt(a.coordinates, n) });
|
|
3502
3502
|
},
|
|
3503
3503
|
runAutoZoom: function(e) {
|
|
3504
|
-
var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, n = t.transitions, r = n !== void 0 && n, i =
|
|
3504
|
+
var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, n = t.transitions, r = n !== void 0 && n, i = Fe(t, xn), a = this.processAutoZoom(e, this.visibleArea, this.coordinates, i), o = a.visibleArea, s = a.coordinates, c = a.changed;
|
|
3505
3505
|
r && c && this.enableTransitions(), this.visibleArea = o, this.coordinates = s, r && c && this.debouncedDisableTransitions();
|
|
3506
3506
|
},
|
|
3507
3507
|
normalizeEvent: function(e) {
|
|
3508
3508
|
return function(e) {
|
|
3509
3509
|
var t = e.event, n = e.visibleArea, r = e.coefficient;
|
|
3510
|
-
if (t.type === "manipulateImage") return
|
|
3510
|
+
if (t.type === "manipulateImage") return W(W({}, t), {
|
|
3511
3511
|
move: {
|
|
3512
3512
|
left: t.move && t.move.left ? r * t.move.left : 0,
|
|
3513
3513
|
top: t.move && t.move.top ? r * t.move.top : 0
|
|
@@ -3521,19 +3521,19 @@ var xn = ["transitions"], Sn = H("vue-advanced-cropper"), Cn = {
|
|
|
3521
3521
|
}
|
|
3522
3522
|
});
|
|
3523
3523
|
if (t.type === "resize") {
|
|
3524
|
-
var i =
|
|
3525
|
-
return
|
|
3524
|
+
var i = W(W({}, t), { directions: W({}, t.directions) });
|
|
3525
|
+
return K.forEach((function(e) {
|
|
3526
3526
|
i.directions[e] *= r;
|
|
3527
3527
|
})), i;
|
|
3528
3528
|
}
|
|
3529
3529
|
if (t.type === "move") {
|
|
3530
|
-
var a =
|
|
3531
|
-
return
|
|
3530
|
+
var a = W(W({}, t), { directions: W({}, t.directions) });
|
|
3531
|
+
return ut.forEach((function(e) {
|
|
3532
3532
|
a.directions[e] *= r;
|
|
3533
3533
|
})), a;
|
|
3534
3534
|
}
|
|
3535
3535
|
return t;
|
|
3536
|
-
}(
|
|
3536
|
+
}(B(B({}, this.getPublicProperties()), {}, { event: e }));
|
|
3537
3537
|
},
|
|
3538
3538
|
getCanvas: function() {
|
|
3539
3539
|
if (this.$refs.canvas) {
|
|
@@ -3541,14 +3541,14 @@ var xn = ["transitions"], Sn = H("vue-advanced-cropper"), Cn = {
|
|
|
3541
3541
|
var r = n.rotate, i = n.flip, a = {
|
|
3542
3542
|
width: t.naturalWidth,
|
|
3543
3543
|
height: t.naturalHeight
|
|
3544
|
-
}, o =
|
|
3544
|
+
}, o = xt(a, r), s = e.getContext("2d");
|
|
3545
3545
|
e.height = o.height, e.width = o.width, s.save();
|
|
3546
|
-
var c =
|
|
3546
|
+
var c = St(J(W({
|
|
3547
3547
|
left: 0,
|
|
3548
3548
|
top: 0
|
|
3549
3549
|
}, a)), r);
|
|
3550
3550
|
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;
|
|
3551
|
-
}(this.$refs.sourceCanvas, t, this.imageTransforms) : t, r =
|
|
3551
|
+
}(this.$refs.sourceCanvas, t, this.imageTransforms) : t, r = B({
|
|
3552
3552
|
minWidth: 0,
|
|
3553
3553
|
minHeight: 0,
|
|
3554
3554
|
maxWidth: Infinity,
|
|
@@ -3562,7 +3562,7 @@ var xn = ["transitions"], Sn = H("vue-advanced-cropper"), Cn = {
|
|
|
3562
3562
|
return t = e, !Number.isNaN(parseFloat(t)) && isFinite(t);
|
|
3563
3563
|
var t;
|
|
3564
3564
|
}));
|
|
3565
|
-
}, a =
|
|
3565
|
+
}, a = At({
|
|
3566
3566
|
sizeRestrictions: {
|
|
3567
3567
|
minWidth: i([r.width, r.minWidth]) || 0,
|
|
3568
3568
|
minHeight: i([r.height, r.minHeight]) || 0,
|
|
@@ -3596,7 +3596,7 @@ var xn = ["transitions"], Sn = H("vue-advanced-cropper"), Cn = {
|
|
|
3596
3596
|
this.$emit("change", this.getResult());
|
|
3597
3597
|
},
|
|
3598
3598
|
applyTransform: function(e) {
|
|
3599
|
-
var t = arguments.length > 1 && arguments[1] !== void 0 && arguments[1], n = this.visibleArea && t ?
|
|
3599
|
+
var t = arguments.length > 1 && arguments[1] !== void 0 && arguments[1], n = this.visibleArea && t ? Tt(this.sizeRestrictions, this.visibleArea) : this.sizeRestrictions, r = this.visibleArea && t ? Bt(this.positionRestrictions, this.visibleArea) : this.positionRestrictions;
|
|
3600
3600
|
return Mt({
|
|
3601
3601
|
transform: e,
|
|
3602
3602
|
coordinates: this.coordinates,
|
|
@@ -3613,7 +3613,7 @@ var xn = ["transitions"], Sn = H("vue-advanced-cropper"), Cn = {
|
|
|
3613
3613
|
this.$refs.cropper, this.$refs.image;
|
|
3614
3614
|
var t = this.defaultSize;
|
|
3615
3615
|
t ||= this.stencilSize ? Rt : Lt, this.sizeRestrictions;
|
|
3616
|
-
var n =
|
|
3616
|
+
var n = Ke(t) ? t({
|
|
3617
3617
|
boundaries: this.boundaries,
|
|
3618
3618
|
imageSize: this.imageSize,
|
|
3619
3619
|
aspectRatio: this.getAspectRatio(),
|
|
@@ -3622,13 +3622,13 @@ var xn = ["transitions"], Sn = H("vue-advanced-cropper"), Cn = {
|
|
|
3622
3622
|
visibleArea: this.visibleArea
|
|
3623
3623
|
}) : t, r = this.defaultPosition || It, i = [n, function(t) {
|
|
3624
3624
|
var n = t.coordinates;
|
|
3625
|
-
return
|
|
3625
|
+
return B({}, Ke(r) ? r({
|
|
3626
3626
|
coordinates: n,
|
|
3627
3627
|
imageSize: e.imageSize,
|
|
3628
3628
|
visibleArea: e.visibleArea
|
|
3629
3629
|
}) : e.defaultPosition);
|
|
3630
3630
|
}];
|
|
3631
|
-
this.delayedTransforms && i.push.apply(i,
|
|
3631
|
+
this.delayedTransforms && i.push.apply(i, Ie(Array.isArray(this.delayedTransforms) ? this.delayedTransforms : [this.delayedTransforms])), this.coordinates = this.applyTransform(i, !0), this.delayedTransforms = null;
|
|
3632
3632
|
}
|
|
3633
3633
|
},
|
|
3634
3634
|
clearImage: function() {
|
|
@@ -3658,7 +3658,7 @@ var xn = ["transitions"], Sn = H("vue-advanced-cropper"), Cn = {
|
|
|
3658
3658
|
cropper: n,
|
|
3659
3659
|
imageSize: e.imageSize
|
|
3660
3660
|
};
|
|
3661
|
-
if (
|
|
3661
|
+
if (Ke(e.defaultBoundaries) ? e.boundaries = e.defaultBoundaries(t) : e.defaultBoundaries === "fit" ? e.boundaries = function(e) {
|
|
3662
3662
|
var t = e.cropper, n = e.imageSize, r = t.clientHeight, i = t.clientWidth, a = r, o = n.width * r / n.height;
|
|
3663
3663
|
return o > i && (o = i, a = n.height * i / n.width), {
|
|
3664
3664
|
width: o,
|
|
@@ -3675,10 +3675,10 @@ var xn = ["transitions"], Sn = H("vue-advanced-cropper"), Cn = {
|
|
|
3675
3675
|
},
|
|
3676
3676
|
resetVisibleArea: function() {
|
|
3677
3677
|
var e = this;
|
|
3678
|
-
return this.appliedImageTransforms =
|
|
3678
|
+
return this.appliedImageTransforms = B(B({}, this.defaultImageTransforms), {}, { flip: B({}, this.defaultImageTransforms.flip) }), this.updateBoundaries().then((function() {
|
|
3679
3679
|
e.priority !== "visible-area" && (e.visibleArea = null, e.resetCoordinates());
|
|
3680
3680
|
var t, n, r, i, a, o, s = e.defaultVisibleArea || zt;
|
|
3681
|
-
e.visibleArea =
|
|
3681
|
+
e.visibleArea = Ke(s) ? s({
|
|
3682
3682
|
imageSize: e.imageSize,
|
|
3683
3683
|
boundaries: e.boundaries,
|
|
3684
3684
|
coordinates: e.priority === "visible-area" ? null : e.coordinates,
|
|
@@ -3688,7 +3688,7 @@ var xn = ["transitions"], Sn = H("vue-advanced-cropper"), Cn = {
|
|
|
3688
3688
|
visibleArea: e.visibleArea,
|
|
3689
3689
|
boundaries: e.boundaries,
|
|
3690
3690
|
getAreaRestrictions: e.getAreaRestrictions
|
|
3691
|
-
}, n = t.visibleArea, r = t.boundaries, i = t.getAreaRestrictions, a =
|
|
3691
|
+
}, n = t.visibleArea, r = t.boundaries, i = t.getAreaRestrictions, a = W({}, n), o = Q(r), a.width / a.height !== o && (a.height = a.width / o), $(a, i({
|
|
3692
3692
|
visibleArea: a,
|
|
3693
3693
|
type: "move"
|
|
3694
3694
|
}))), e.priority === "visible-area" ? e.resetCoordinates() : e.coordinates = e.fitCoordinates({
|
|
@@ -3729,7 +3729,7 @@ var xn = ["transitions"], Sn = H("vue-advanced-cropper"), Cn = {
|
|
|
3729
3729
|
var e, t = this;
|
|
3730
3730
|
if (this.imageLoaded = !1, this.delayedTransforms = null, this.src) {
|
|
3731
3731
|
if (function(e) {
|
|
3732
|
-
if (
|
|
3732
|
+
if (Ge(e)) return !1;
|
|
3733
3733
|
var t = window.location, n = /(\w+:)?(?:\/\/)([\w.-]+)?(?::(\d+))?\/?/.exec(e) || [], r = {
|
|
3734
3734
|
protocol: n[1] || "",
|
|
3735
3735
|
host: n[2] || "",
|
|
@@ -3739,7 +3739,7 @@ var xn = ["transitions"], Sn = H("vue-advanced-cropper"), Cn = {
|
|
|
3739
3739
|
};
|
|
3740
3740
|
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));
|
|
3741
3741
|
}(this.src)) {
|
|
3742
|
-
var n =
|
|
3742
|
+
var n = G(this.crossOrigin) ? this.canvas : this.crossOrigin;
|
|
3743
3743
|
!0 === n && (n = "anonymous"), this.imageAttributes.crossOrigin = n || null;
|
|
3744
3744
|
}
|
|
3745
3745
|
if (this.checkOrientation) {
|
|
@@ -3782,13 +3782,13 @@ var xn = ["transitions"], Sn = H("vue-advanced-cropper"), Cn = {
|
|
|
3782
3782
|
},
|
|
3783
3783
|
onParseImage: function(e) {
|
|
3784
3784
|
var t = this, n = e.source, r = e.arrayBuffer, i = e.orientation;
|
|
3785
|
-
this.imageAttributes.revoke && this.imageAttributes.src && URL.revokeObjectURL(this.imageAttributes.src), this.imageAttributes.revoke = !1, r && i && i > 1 ?
|
|
3785
|
+
this.imageAttributes.revoke && this.imageAttributes.src && URL.revokeObjectURL(this.imageAttributes.src), this.imageAttributes.revoke = !1, r && i && i > 1 ? We(n) || !Ge(n) ? (this.imageAttributes.src = URL.createObjectURL(new Blob([r])), this.imageAttributes.revoke = !0) : this.imageAttributes.src = function(e) {
|
|
3786
3786
|
for (var t = [], n = new Uint8Array(e); n.length > 0;) {
|
|
3787
3787
|
var r = n.subarray(0, 8192);
|
|
3788
3788
|
t.push(String.fromCharCode.apply(null, Array.from ? Array.from(r) : r.slice())), n = n.subarray(8192);
|
|
3789
3789
|
}
|
|
3790
3790
|
return "data:image/jpeg;base64," + btoa(t.join(""));
|
|
3791
|
-
}(r) : this.imageAttributes.src = n,
|
|
3791
|
+
}(r) : this.imageAttributes.src = n, Ke(this.defaultTransforms) ? this.appliedImageTransforms = an(this.defaultTransforms()) : qe(this.defaultTransforms) ? this.appliedImageTransforms = an(this.defaultTransforms) : this.appliedImageTransforms = function(e) {
|
|
3792
3792
|
var t = an({});
|
|
3793
3793
|
if (e) switch (e) {
|
|
3794
3794
|
case 2:
|
|
@@ -3812,7 +3812,7 @@ var xn = ["transitions"], Sn = H("vue-advanced-cropper"), Cn = {
|
|
|
3812
3812
|
case 8: t.rotate = -90;
|
|
3813
3813
|
}
|
|
3814
3814
|
return t;
|
|
3815
|
-
}(i), this.defaultImageTransforms =
|
|
3815
|
+
}(i), this.defaultImageTransforms = B(B({}, this.appliedImageTransforms), {}, { flip: B({}, this.appliedImageTransforms.flip) }), this.$nextTick((function() {
|
|
3816
3816
|
var e = t.$refs.image;
|
|
3817
3817
|
e && e.complete && (function(e) {
|
|
3818
3818
|
return !!e.naturalWidth;
|
|
@@ -3828,7 +3828,7 @@ var xn = ["transitions"], Sn = H("vue-advanced-cropper"), Cn = {
|
|
|
3828
3828
|
onMove: function(e) {
|
|
3829
3829
|
var t = this;
|
|
3830
3830
|
this.transitionsOptions.enabled || this.awaitRender((function() {
|
|
3831
|
-
t.coordinates = t.moveAlgorithm(
|
|
3831
|
+
t.coordinates = t.moveAlgorithm(B(B({}, t.getPublicProperties()), {}, {
|
|
3832
3832
|
positionRestrictions: Bt(t.positionRestrictions, t.visibleArea),
|
|
3833
3833
|
coordinates: t.coordinates,
|
|
3834
3834
|
event: t.normalizeEvent(e)
|
|
@@ -3839,7 +3839,7 @@ var xn = ["transitions"], Sn = H("vue-advanced-cropper"), Cn = {
|
|
|
3839
3839
|
var t = this;
|
|
3840
3840
|
this.transitionsOptions.enabled || this.stencilSize && !this.autoZoom || this.awaitRender((function() {
|
|
3841
3841
|
var n = t.sizeRestrictions, r = Math.min(t.coordinates.width, t.coordinates.height, 20 * t.coefficient);
|
|
3842
|
-
t.coordinates = t.resizeAlgorithm(
|
|
3842
|
+
t.coordinates = t.resizeAlgorithm(B(B({}, t.getPublicProperties()), {}, {
|
|
3843
3843
|
positionRestrictions: Bt(t.positionRestrictions, t.visibleArea),
|
|
3844
3844
|
sizeRestrictions: {
|
|
3845
3845
|
maxWidth: Math.min(n.maxWidth, t.visibleArea.width),
|
|
@@ -3856,7 +3856,7 @@ var xn = ["transitions"], Sn = H("vue-advanced-cropper"), Cn = {
|
|
|
3856
3856
|
if (!this.transitionsOptions.enabled) {
|
|
3857
3857
|
var n = t.transitions, r = n !== void 0 && n, i = t.normalize, a = i === void 0 || i;
|
|
3858
3858
|
r && this.enableTransitions();
|
|
3859
|
-
var o = Vt(
|
|
3859
|
+
var o = Vt(B(B({}, this.getPublicProperties()), {}, {
|
|
3860
3860
|
event: a ? this.normalizeEvent(e) : e,
|
|
3861
3861
|
getAreaRestrictions: this.getAreaRestrictions,
|
|
3862
3862
|
imageRestriction: this.imageRestriction,
|
|
@@ -3884,9 +3884,9 @@ var xn = ["transitions"], Sn = H("vue-advanced-cropper"), Cn = {
|
|
|
3884
3884
|
var s = this.$refs.stencil.aspectRatios();
|
|
3885
3885
|
t = s.minimum, n = s.maximum;
|
|
3886
3886
|
}
|
|
3887
|
-
if (
|
|
3888
|
-
var c = this.getStencilSize(), l = c ?
|
|
3889
|
-
|
|
3887
|
+
if (G(t) && (t = G(i) ? a : i), G(n) && (n = G(i) ? o : i), !e && (G(t) || G(n))) {
|
|
3888
|
+
var c = this.getStencilSize(), l = c ? Q(c) : null;
|
|
3889
|
+
G(t) && (t = Xe(l) ? l : void 0), G(n) && (n = Xe(l) ? l : void 0);
|
|
3890
3890
|
}
|
|
3891
3891
|
return {
|
|
3892
3892
|
minimum: t,
|
|
@@ -3904,10 +3904,10 @@ var xn = ["transitions"], Sn = H("vue-advanced-cropper"), Cn = {
|
|
|
3904
3904
|
coefficient: this.coefficient,
|
|
3905
3905
|
coordinates: this.coordinates,
|
|
3906
3906
|
aspectRatio: this.getAspectRatio(!0)
|
|
3907
|
-
}, t = e.boundaries, n = e.stencilSize, r = e.aspectRatio,
|
|
3907
|
+
}, t = e.boundaries, n = e.stencilSize, r = e.aspectRatio, yt(Q(i = Ke(n) ? n({
|
|
3908
3908
|
boundaries: t,
|
|
3909
3909
|
aspectRatio: r
|
|
3910
|
-
}) : n), r) && (i =
|
|
3910
|
+
}) : n), r) && (i = At({
|
|
3911
3911
|
sizeRestrictions: {
|
|
3912
3912
|
maxWidth: t.width,
|
|
3913
3913
|
maxHeight: t.height,
|
|
@@ -3920,7 +3920,7 @@ var xn = ["transitions"], Sn = H("vue-advanced-cropper"), Cn = {
|
|
|
3920
3920
|
minimum: r.minimum,
|
|
3921
3921
|
maximum: r.maximum
|
|
3922
3922
|
}
|
|
3923
|
-
})), (i.width > t.width || i.height > t.height) && (i =
|
|
3923
|
+
})), (i.width > t.width || i.height > t.height) && (i = At({
|
|
3924
3924
|
sizeRestrictions: {
|
|
3925
3925
|
maxWidth: t.width,
|
|
3926
3926
|
maxHeight: t.height,
|
|
@@ -3930,8 +3930,8 @@ var xn = ["transitions"], Sn = H("vue-advanced-cropper"), Cn = {
|
|
|
3930
3930
|
width: i.width,
|
|
3931
3931
|
height: i.height,
|
|
3932
3932
|
aspectRatio: {
|
|
3933
|
-
minimum:
|
|
3934
|
-
maximum:
|
|
3933
|
+
minimum: Q(i),
|
|
3934
|
+
maximum: Q(i)
|
|
3935
3935
|
}
|
|
3936
3936
|
})), i;
|
|
3937
3937
|
var e, t, n, r, i;
|
|
@@ -3949,13 +3949,13 @@ var xn = ["transitions"], Sn = H("vue-advanced-cropper"), Cn = {
|
|
|
3949
3949
|
};
|
|
3950
3950
|
},
|
|
3951
3951
|
defaultCoordinates: function() {
|
|
3952
|
-
return
|
|
3952
|
+
return B({}, ft);
|
|
3953
3953
|
},
|
|
3954
3954
|
flip: function(e, t) {
|
|
3955
3955
|
var n = (arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}).transitions, r = n === void 0 || n;
|
|
3956
3956
|
if (!this.transitionsActive) {
|
|
3957
3957
|
r && this.enableTransitions();
|
|
3958
|
-
var i =
|
|
3958
|
+
var i = B({}, this.imageTransforms.flip), a = Ut({
|
|
3959
3959
|
flip: {
|
|
3960
3960
|
horizontal: e ? !i.horizontal : i.horizontal,
|
|
3961
3961
|
vertical: t ? !i.vertical : i.vertical
|
|
@@ -3977,7 +3977,7 @@ var xn = ["transitions"], Sn = H("vue-advanced-cropper"), Cn = {
|
|
|
3977
3977
|
var t = (arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}).transitions, n = t === void 0 || t;
|
|
3978
3978
|
if (!this.transitionsActive) {
|
|
3979
3979
|
n && this.enableTransitions();
|
|
3980
|
-
var r =
|
|
3980
|
+
var r = B({}, this.imageSize);
|
|
3981
3981
|
this.appliedImageTransforms.rotate += e;
|
|
3982
3982
|
var i = Ht({
|
|
3983
3983
|
visibleArea: this.visibleArea,
|
|
@@ -4133,7 +4133,7 @@ var En = ["data-tpl-theme"], Dn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, On
|
|
|
4133
4133
|
}, tr = {
|
|
4134
4134
|
class: "tpl:mb-1 tpl:block tpl:text-xs tpl:font-medium",
|
|
4135
4135
|
style: { color: "var(--tpl-text-muted)" }
|
|
4136
|
-
}, nr = ["placeholder"], rr = { class: "tpl:flex tpl:shrink-0 tpl:justify-end tpl:gap-2 tpl:p-5 tpl:pt-4" }, ir = ["disabled"], ar = /* @__PURE__ */
|
|
4136
|
+
}, nr = ["placeholder"], rr = { class: "tpl:flex tpl:shrink-0 tpl:justify-end tpl:gap-2 tpl:p-5 tpl:pt-4" }, ir = ["disabled"], ar = /* @__PURE__ */ oe(/* @__PURE__ */ e({
|
|
4137
4137
|
__name: "MediaEditModal",
|
|
4138
4138
|
props: {
|
|
4139
4139
|
visible: { type: Boolean },
|
|
@@ -4141,54 +4141,54 @@ var En = ["data-tpl-theme"], Dn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, On
|
|
|
4141
4141
|
},
|
|
4142
4142
|
emits: ["save", "close"],
|
|
4143
4143
|
setup(e, { emit: a }) {
|
|
4144
|
-
let s = e, l = a, { t: b } =
|
|
4144
|
+
let s = e, l = a, { t: b } = z(), x = t("tplUiTheme"), E = b.mediaLibrary, { isImageMimeType: A } = Oe(), j = T(""), M = T(""), ee = T(null), N = T("free"), P = T(void 0), te = T(void 0), F = T(""), ne = T(""), I = T(void 0), L = T(null), re = T(!1), R = T(!1), ie = T(!1), ae = S(() => s.item ? [
|
|
4145
4145
|
"image/jpeg",
|
|
4146
4146
|
"image/png",
|
|
4147
4147
|
"image/webp",
|
|
4148
4148
|
"image/gif"
|
|
4149
|
-
].includes(s.item.mime_type) : !1),
|
|
4149
|
+
].includes(s.item.mime_type) : !1), oe = S(() => N.value === "original" ? I.value : ke[N.value]), se = S(() => L.value ? Ne(L.value.width, L.value.height, P.value, te.value) : null);
|
|
4150
4150
|
r(() => s.visible, (e) => {
|
|
4151
|
-
e && s.item && (
|
|
4151
|
+
e && s.item && (j.value = s.item.filename, M.value = s.item.alt_text || "", N.value = "free", P.value = void 0, te.value = void 0, F.value = "", ne.value = "", I.value = void 0, L.value = null, re.value = !1, ie.value = !1, s.item.width && s.item.height && (I.value = s.item.width / s.item.height));
|
|
4152
4152
|
});
|
|
4153
|
-
function
|
|
4154
|
-
e.coordinates && (
|
|
4153
|
+
function ce(e) {
|
|
4154
|
+
e.coordinates && (L.value = {
|
|
4155
4155
|
width: Math.round(e.coordinates.width),
|
|
4156
4156
|
height: Math.round(e.coordinates.height)
|
|
4157
|
-
},
|
|
4157
|
+
}, ie.value = !0);
|
|
4158
4158
|
}
|
|
4159
|
-
function
|
|
4160
|
-
|
|
4159
|
+
function le() {
|
|
4160
|
+
re.value = !0, !I.value && s.item?.width && s.item?.height && (I.value = s.item.width / s.item.height);
|
|
4161
4161
|
}
|
|
4162
|
-
function
|
|
4162
|
+
function ue(e) {
|
|
4163
4163
|
let t = e.target.value;
|
|
4164
|
-
|
|
4164
|
+
F.value = t, P.value = t && parseInt(t, 10) || void 0;
|
|
4165
4165
|
}
|
|
4166
|
-
function
|
|
4166
|
+
function de(e) {
|
|
4167
4167
|
let t = e.target.value;
|
|
4168
|
-
|
|
4168
|
+
ne.value = t, te.value = t && parseInt(t, 10) || void 0;
|
|
4169
4169
|
}
|
|
4170
|
-
async function
|
|
4171
|
-
let e =
|
|
4172
|
-
if (!e || !s.item ||
|
|
4170
|
+
async function fe() {
|
|
4171
|
+
let e = j.value.trim();
|
|
4172
|
+
if (!e || !s.item || R.value) return;
|
|
4173
4173
|
let t = A(s.item.mime_type), n;
|
|
4174
|
-
if (
|
|
4175
|
-
|
|
4174
|
+
if (ae.value && ee.value && ie.value) {
|
|
4175
|
+
R.value = !0;
|
|
4176
4176
|
try {
|
|
4177
|
-
let { canvas: e } =
|
|
4177
|
+
let { canvas: e } = ee.value.getResult();
|
|
4178
4178
|
if (e) {
|
|
4179
|
-
let t =
|
|
4180
|
-
n = { file: await
|
|
4179
|
+
let t = je(e, P.value, te.value), r = Ae(s.item.mime_type);
|
|
4180
|
+
n = { file: await Me(t, s.item.filename, r) };
|
|
4181
4181
|
}
|
|
4182
4182
|
} catch {
|
|
4183
|
-
|
|
4183
|
+
R.value = !1;
|
|
4184
4184
|
return;
|
|
4185
4185
|
}
|
|
4186
|
-
|
|
4186
|
+
R.value = !1;
|
|
4187
4187
|
}
|
|
4188
|
-
l("save", s.item.id, e, t ?
|
|
4188
|
+
l("save", s.item.id, e, t ? M.value : void 0, n), l("close");
|
|
4189
4189
|
}
|
|
4190
|
-
function
|
|
4191
|
-
e.key === "Enter" && !
|
|
4190
|
+
function pe(e) {
|
|
4191
|
+
e.key === "Enter" && !R.value && (e.preventDefault(), fe()), e.key === "Escape" && l("close");
|
|
4192
4192
|
}
|
|
4193
4193
|
return (t, r) => (o(), v(w, { to: "body" }, [k(C, {
|
|
4194
4194
|
"enter-active-class": "tpl:transition tpl:ease-out tpl:duration-150",
|
|
@@ -4204,22 +4204,22 @@ var En = ["data-tpl-theme"], Dn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, On
|
|
|
4204
4204
|
class: "tpl tpl:fixed tpl:inset-0 tpl:z-[10000] tpl:flex tpl:items-center tpl:justify-center",
|
|
4205
4205
|
style: { "background-color": "var(--tpl-overlay)" },
|
|
4206
4206
|
onClick: r[3] ||= m((e) => l("close"), ["self"]),
|
|
4207
|
-
onKeydown:
|
|
4207
|
+
onKeydown: pe
|
|
4208
4208
|
}, [y("div", {
|
|
4209
|
-
class: D(["tpl:mx-4 tpl:flex tpl:max-h-[90vh] tpl:w-full tpl:flex-col tpl:overflow-hidden tpl:rounded-lg tpl:shadow-xl",
|
|
4209
|
+
class: D(["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"]),
|
|
4210
4210
|
style: { "background-color": "var(--tpl-bg-elevated)" }
|
|
4211
4211
|
}, [
|
|
4212
4212
|
y("div", Dn, [y("h3", On, _(p(b).mediaLibrary.editFile), 1)]),
|
|
4213
4213
|
y("div", kn, [
|
|
4214
|
-
|
|
4214
|
+
ae.value ? (o(), O("div", An, [y("div", jn, [k(p(Cn), {
|
|
4215
4215
|
ref_key: "cropperRef",
|
|
4216
|
-
ref:
|
|
4216
|
+
ref: ee,
|
|
4217
4217
|
src: e.item.url,
|
|
4218
|
-
"stencil-props": { aspectRatio:
|
|
4218
|
+
"stencil-props": { aspectRatio: oe.value },
|
|
4219
4219
|
class: "tpl:h-full tpl:w-full",
|
|
4220
4220
|
"background-class": "tpl-cropper-background",
|
|
4221
|
-
onChange:
|
|
4222
|
-
onReady:
|
|
4221
|
+
onChange: ce,
|
|
4222
|
+
onReady: le
|
|
4223
4223
|
}, null, 8, ["src", "stencil-props"])]), y("div", Mn, [
|
|
4224
4224
|
y("div", null, [y("label", Nn, _(p(b).mediaLibrary.cropAspectRatio), 1), y("div", Pn, [(o(), O(g, null, i([
|
|
4225
4225
|
"free",
|
|
@@ -4239,7 +4239,7 @@ var En = ["data-tpl-theme"], Dn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, On
|
|
|
4239
4239
|
onClick: (t) => N.value = e
|
|
4240
4240
|
}, _(p(E)[`crop${e.charAt(0).toUpperCase()}${e.slice(1)}`]), 13, Fn)), 64))])]),
|
|
4241
4241
|
y("div", In, [y("div", Ln, [y("label", Rn, [d(_(p(b).mediaLibrary.cropMaxWidth) + " ", 1), y("span", zn, _(p(b).mediaLibrary.cropOptional), 1)]), y("div", Bn, [y("input", {
|
|
4242
|
-
value:
|
|
4242
|
+
value: F.value,
|
|
4243
4243
|
type: "number",
|
|
4244
4244
|
min: "1",
|
|
4245
4245
|
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",
|
|
@@ -4248,10 +4248,10 @@ var En = ["data-tpl-theme"], Dn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, On
|
|
|
4248
4248
|
"background-color": "var(--tpl-bg)",
|
|
4249
4249
|
color: "var(--tpl-text)"
|
|
4250
4250
|
},
|
|
4251
|
-
placeholder:
|
|
4252
|
-
onInput:
|
|
4251
|
+
placeholder: L.value?.width?.toString() || "",
|
|
4252
|
+
onInput: ue
|
|
4253
4253
|
}, null, 40, Vn), y("span", Hn, _(p(b).mediaLibrary.cropPixels), 1)])]), y("div", Un, [y("label", Wn, [d(_(p(b).mediaLibrary.cropMaxHeight) + " ", 1), y("span", Gn, _(p(b).mediaLibrary.cropOptional), 1)]), y("div", Kn, [y("input", {
|
|
4254
|
-
value:
|
|
4254
|
+
value: ne.value,
|
|
4255
4255
|
type: "number",
|
|
4256
4256
|
min: "1",
|
|
4257
4257
|
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",
|
|
@@ -4260,13 +4260,13 @@ var En = ["data-tpl-theme"], Dn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, On
|
|
|
4260
4260
|
"background-color": "var(--tpl-bg)",
|
|
4261
4261
|
color: "var(--tpl-text)"
|
|
4262
4262
|
},
|
|
4263
|
-
placeholder:
|
|
4264
|
-
onInput:
|
|
4263
|
+
placeholder: L.value?.height?.toString() || "",
|
|
4264
|
+
onInput: de
|
|
4265
4265
|
}, null, 40, qn), y("span", Jn, _(p(b).mediaLibrary.cropPixels), 1)])])]),
|
|
4266
|
-
|
|
4266
|
+
se.value ? (o(), O("div", Yn, [y("span", null, _(p(b).mediaLibrary.cropOutputSize) + ": ", 1), y("span", Xn, _(se.value.width) + " x " + _(se.value.height) + " " + _(p(b).mediaLibrary.cropPixels), 1)])) : u("", !0)
|
|
4267
4267
|
])])) : u("", !0),
|
|
4268
4268
|
y("div", Zn, [y("label", Qn, _(p(b).mediaLibrary.fileName), 1), n(y("input", {
|
|
4269
|
-
"onUpdate:modelValue": r[0] ||= (e) =>
|
|
4269
|
+
"onUpdate:modelValue": r[0] ||= (e) => j.value = e,
|
|
4270
4270
|
type: "text",
|
|
4271
4271
|
class: "tpl:w-full tpl:rounded-md tpl:border tpl:px-3 tpl:py-1.5 tpl:text-xs tpl:outline-none",
|
|
4272
4272
|
style: {
|
|
@@ -4274,10 +4274,10 @@ var En = ["data-tpl-theme"], Dn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, On
|
|
|
4274
4274
|
"background-color": "var(--tpl-bg)",
|
|
4275
4275
|
color: "var(--tpl-text)"
|
|
4276
4276
|
},
|
|
4277
|
-
autofocus: !
|
|
4278
|
-
}, null, 8, $n), [[f,
|
|
4277
|
+
autofocus: !ae.value
|
|
4278
|
+
}, null, 8, $n), [[f, j.value]])]),
|
|
4279
4279
|
p(A)(e.item.mime_type) ? (o(), O("div", er, [y("label", tr, _(p(b).mediaLibrary.altText), 1), n(y("input", {
|
|
4280
|
-
"onUpdate:modelValue": r[1] ||= (e) =>
|
|
4280
|
+
"onUpdate:modelValue": r[1] ||= (e) => M.value = e,
|
|
4281
4281
|
type: "text",
|
|
4282
4282
|
class: "tpl:w-full tpl:rounded-md tpl:border tpl:px-3 tpl:py-1.5 tpl:text-xs tpl:outline-none",
|
|
4283
4283
|
style: {
|
|
@@ -4286,7 +4286,7 @@ var En = ["data-tpl-theme"], Dn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, On
|
|
|
4286
4286
|
color: "var(--tpl-text)"
|
|
4287
4287
|
},
|
|
4288
4288
|
placeholder: p(b).mediaLibrary.altTextPlaceholder
|
|
4289
|
-
}, null, 8, nr), [[f,
|
|
4289
|
+
}, null, 8, nr), [[f, M.value]])])) : u("", !0)
|
|
4290
4290
|
]),
|
|
4291
4291
|
y("div", rr, [y("button", {
|
|
4292
4292
|
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",
|
|
@@ -4299,9 +4299,9 @@ var En = ["data-tpl-theme"], Dn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, On
|
|
|
4299
4299
|
}, _(p(b).mediaLibrary.cancel), 1), y("button", {
|
|
4300
4300
|
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",
|
|
4301
4301
|
style: { background: "linear-gradient(\n 135deg,\n var(--tpl-primary),\n var(--tpl-primary-hover)\n )" },
|
|
4302
|
-
disabled:
|
|
4303
|
-
onClick:
|
|
4304
|
-
}, _(
|
|
4302
|
+
disabled: R.value,
|
|
4303
|
+
onClick: fe
|
|
4304
|
+
}, _(R.value ? p(b).mediaLibrary.saving : p(b).mediaLibrary.saveChanges), 9, ir)])
|
|
4305
4305
|
], 2)], 40, En)) : u("", !0)]),
|
|
4306
4306
|
_: 1
|
|
4307
4307
|
})]));
|
|
@@ -4329,31 +4329,31 @@ var En = ["data-tpl-theme"], Dn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, On
|
|
|
4329
4329
|
"deleteFolder"
|
|
4330
4330
|
],
|
|
4331
4331
|
setup(e, { emit: t }) {
|
|
4332
|
-
let r = e, a = t, { t: c } =
|
|
4333
|
-
function
|
|
4334
|
-
for (let n of e) if (n.id === t || n.children &&
|
|
4332
|
+
let r = e, a = t, { t: c } = z(), l = T(!1), d = T(!1), b = T(""), x = T(!1), C = T(""), w = S(() => (r.folder.children?.length ?? 0) > 0), A = S(() => r.depth < pr - 1), j = S(() => r.currentFolderId === r.folder.id), M = S(() => !r.currentFolderId || !r.folder.children ? !1 : P(r.folder.children, r.currentFolderId)), ee = S(() => l.value || M.value);
|
|
4333
|
+
function P(e, t) {
|
|
4334
|
+
for (let n of e) if (n.id === t || n.children && P(n.children, t)) return !0;
|
|
4335
4335
|
return !1;
|
|
4336
4336
|
}
|
|
4337
|
-
function
|
|
4337
|
+
function te() {
|
|
4338
4338
|
l.value = !l.value;
|
|
4339
4339
|
}
|
|
4340
4340
|
function ne() {
|
|
4341
4341
|
d.value = !0, b.value = r.folder.name;
|
|
4342
4342
|
}
|
|
4343
|
-
function
|
|
4343
|
+
function L() {
|
|
4344
4344
|
let e = b.value.trim();
|
|
4345
4345
|
e && e !== r.folder.name && a("renameFolder", r.folder.id, e), d.value = !1, b.value = "";
|
|
4346
4346
|
}
|
|
4347
|
-
function
|
|
4347
|
+
function re() {
|
|
4348
4348
|
d.value = !1, b.value = "";
|
|
4349
4349
|
}
|
|
4350
|
-
function
|
|
4350
|
+
function R() {
|
|
4351
4351
|
x.value = !0, C.value = "", l.value = !0;
|
|
4352
4352
|
}
|
|
4353
|
-
function
|
|
4353
|
+
function ie() {
|
|
4354
4354
|
C.value.trim() && a("createFolder", C.value.trim(), r.folder.id), x.value = !1, C.value = "";
|
|
4355
4355
|
}
|
|
4356
|
-
function
|
|
4356
|
+
function ae() {
|
|
4357
4357
|
x.value = !1, C.value = "";
|
|
4358
4358
|
}
|
|
4359
4359
|
return (t, r) => {
|
|
@@ -4362,23 +4362,23 @@ var En = ["data-tpl-theme"], Dn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, On
|
|
|
4362
4362
|
class: "tpl:group tpl:flex tpl:w-full tpl:items-center tpl:gap-1 tpl:py-1.5 tpl:pr-2 tpl:text-left tpl:text-xs tpl:transition-all tpl:duration-150",
|
|
4363
4363
|
style: h({
|
|
4364
4364
|
paddingLeft: `${e.depth * 16 + 8}px`,
|
|
4365
|
-
backgroundColor:
|
|
4366
|
-
color:
|
|
4365
|
+
backgroundColor: j.value ? "var(--tpl-bg-active)" : "transparent",
|
|
4366
|
+
color: j.value ? "var(--tpl-primary)" : "var(--tpl-text)"
|
|
4367
4367
|
})
|
|
4368
4368
|
}, [
|
|
4369
4369
|
w.value || x.value ? (o(), O("button", {
|
|
4370
4370
|
key: 0,
|
|
4371
4371
|
class: "tpl:flex tpl:size-4 tpl:shrink-0 tpl:items-center tpl:justify-center tpl:rounded tpl:transition-colors",
|
|
4372
|
-
onClick: m(
|
|
4373
|
-
}, [k(p(
|
|
4374
|
-
class: D(["tpl:transition-transform tpl:duration-150", { "tpl:rotate-90":
|
|
4372
|
+
onClick: m(te, ["stop"])
|
|
4373
|
+
}, [k(p(N), {
|
|
4374
|
+
class: D(["tpl:transition-transform tpl:duration-150", { "tpl:rotate-90": ee.value }]),
|
|
4375
4375
|
size: 10,
|
|
4376
4376
|
"stroke-width": 2
|
|
4377
4377
|
}, null, 8, ["class"])])) : (o(), O("span", or)),
|
|
4378
4378
|
y("button", {
|
|
4379
4379
|
class: "tpl:flex tpl:min-w-0 tpl:flex-1 tpl:items-center tpl:gap-1.5",
|
|
4380
4380
|
onClick: r[0] ||= (t) => a("navigate", e.folder.id)
|
|
4381
|
-
}, [k(p(
|
|
4381
|
+
}, [k(p(ve), {
|
|
4382
4382
|
class: "tpl:shrink-0",
|
|
4383
4383
|
size: 14,
|
|
4384
4384
|
"stroke-width": 1.5
|
|
@@ -4394,8 +4394,8 @@ var En = ["data-tpl-theme"], Dn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, On
|
|
|
4394
4394
|
color: "var(--tpl-text)"
|
|
4395
4395
|
},
|
|
4396
4396
|
autofocus: "",
|
|
4397
|
-
onKeydown: [E(
|
|
4398
|
-
onBlur:
|
|
4397
|
+
onKeydown: [E(L, ["enter"]), E(re, ["escape"])],
|
|
4398
|
+
onBlur: L,
|
|
4399
4399
|
onClick: r[2] ||= m(() => {}, ["stop"])
|
|
4400
4400
|
}, null, 544)), [[f, b.value]]) : u("", !0),
|
|
4401
4401
|
d.value ? u("", !0) : (o(), O("span", cr, [
|
|
@@ -4403,8 +4403,8 @@ var En = ["data-tpl-theme"], Dn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, On
|
|
|
4403
4403
|
key: 0,
|
|
4404
4404
|
class: "tpl:flex tpl:size-6 tpl:items-center tpl:justify-center tpl:rounded tpl:transition-colors",
|
|
4405
4405
|
title: p(c).mediaLibrary.addSubfolder,
|
|
4406
|
-
onClick: m(
|
|
4407
|
-
}, [k(p(
|
|
4406
|
+
onClick: m(R, ["stop"])
|
|
4407
|
+
}, [k(p(de), {
|
|
4408
4408
|
size: 12,
|
|
4409
4409
|
"stroke-width": 2
|
|
4410
4410
|
})], 8, lr)) : u("", !0),
|
|
@@ -4425,7 +4425,7 @@ var En = ["data-tpl-theme"], Dn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, On
|
|
|
4425
4425
|
style: { color: "var(--tpl-danger)" }
|
|
4426
4426
|
})])
|
|
4427
4427
|
]))
|
|
4428
|
-
], 4),
|
|
4428
|
+
], 4), ee.value ? (o(), O("div", dr, [(o(!0), O(g, null, i(e.folder.children, (t) => (o(), v(l, {
|
|
4429
4429
|
key: t.id,
|
|
4430
4430
|
folder: t,
|
|
4431
4431
|
"current-folder-id": e.currentFolderId,
|
|
@@ -4453,8 +4453,8 @@ var En = ["data-tpl-theme"], Dn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, On
|
|
|
4453
4453
|
},
|
|
4454
4454
|
placeholder: p(c).mediaLibrary.subfolderName,
|
|
4455
4455
|
autofocus: "",
|
|
4456
|
-
onKeydown: [E(
|
|
4457
|
-
onBlur:
|
|
4456
|
+
onKeydown: [E(ie, ["enter"]), E(ae, ["escape"])],
|
|
4457
|
+
onBlur: ie
|
|
4458
4458
|
}, null, 40, fr), [[f, C.value]])], 4)) : u("", !0)])) : u("", !0)]);
|
|
4459
4459
|
};
|
|
4460
4460
|
}
|
|
@@ -4477,7 +4477,7 @@ var En = ["data-tpl-theme"], Dn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, On
|
|
|
4477
4477
|
"showFrequentlyUsed"
|
|
4478
4478
|
],
|
|
4479
4479
|
setup(e, { emit: t }) {
|
|
4480
|
-
let r = t, { t: a } =
|
|
4480
|
+
let r = t, { t: a } = z(), s = T(!1), c = T("");
|
|
4481
4481
|
function l() {
|
|
4482
4482
|
s.value = !0, c.value = "";
|
|
4483
4483
|
}
|
|
@@ -4495,7 +4495,7 @@ var En = ["data-tpl-theme"], Dn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, On
|
|
|
4495
4495
|
color: e.viewMode === "files" && e.currentFolderId === null ? "var(--tpl-primary)" : "var(--tpl-text)"
|
|
4496
4496
|
}),
|
|
4497
4497
|
onClick: x[0] ||= (e) => r("navigate", null)
|
|
4498
|
-
}, [k(p(
|
|
4498
|
+
}, [k(p(_e), {
|
|
4499
4499
|
size: 14,
|
|
4500
4500
|
"stroke-width": 1.5
|
|
4501
4501
|
}), d(" " + _(p(a).mediaLibrary.allFiles), 1)], 4),
|
|
@@ -4528,7 +4528,7 @@ var En = ["data-tpl-theme"], Dn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, On
|
|
|
4528
4528
|
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",
|
|
4529
4529
|
style: { color: "var(--tpl-text-muted)" },
|
|
4530
4530
|
onClick: l
|
|
4531
|
-
}, [k(p(
|
|
4531
|
+
}, [k(p(de), {
|
|
4532
4532
|
size: 14,
|
|
4533
4533
|
"stroke-width": 1.5
|
|
4534
4534
|
}), d(" " + _(p(a).mediaLibrary.newFolder), 1)])),
|
|
@@ -4542,7 +4542,7 @@ var En = ["data-tpl-theme"], Dn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, On
|
|
|
4542
4542
|
color: e.viewMode === "frequently-used" ? "var(--tpl-primary)" : "var(--tpl-text)"
|
|
4543
4543
|
}),
|
|
4544
4544
|
onClick: x[6] ||= (e) => r("showFrequentlyUsed")
|
|
4545
|
-
}, [k(p(
|
|
4545
|
+
}, [k(p(ge), {
|
|
4546
4546
|
size: 14,
|
|
4547
4547
|
"stroke-width": 1.5
|
|
4548
4548
|
}), d(" " + _(p(a).mediaLibrary.frequentlyUsed), 1)], 4)) : u("", !0)
|
|
@@ -4759,7 +4759,7 @@ var En = ["data-tpl-theme"], Dn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, On
|
|
|
4759
4759
|
}, Jr = {
|
|
4760
4760
|
key: 4,
|
|
4761
4761
|
class: "tpl:flex tpl:justify-center tpl:py-4"
|
|
4762
|
-
}, Yr = /* @__PURE__ */
|
|
4762
|
+
}, Yr = /* @__PURE__ */ oe(/* @__PURE__ */ e({
|
|
4763
4763
|
__name: "MediaGrid",
|
|
4764
4764
|
props: {
|
|
4765
4765
|
items: {},
|
|
@@ -4777,15 +4777,15 @@ var En = ["data-tpl-theme"], Dn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, On
|
|
|
4777
4777
|
"replace"
|
|
4778
4778
|
],
|
|
4779
4779
|
setup(e, { emit: t }) {
|
|
4780
|
-
let n = e, r = t, { isAcceptedMimeType: a, isImageMimeType: s } =
|
|
4780
|
+
let n = e, r = t, { isAcceptedMimeType: a, isImageMimeType: s } = Oe();
|
|
4781
4781
|
function c(e) {
|
|
4782
4782
|
return !n.accept || n.accept.length === 0 ? !0 : a(e.mime_type, n.accept);
|
|
4783
4783
|
}
|
|
4784
4784
|
function l(e) {
|
|
4785
4785
|
r("select", e);
|
|
4786
4786
|
}
|
|
4787
|
-
let { t: f } =
|
|
4788
|
-
|
|
4787
|
+
let { t: f } = z(), b = T(null);
|
|
4788
|
+
te(b, ([{ isIntersecting: e }]) => {
|
|
4789
4789
|
e && n.hasMore && !n.isLoading && r("loadMore");
|
|
4790
4790
|
}, { threshold: .1 });
|
|
4791
4791
|
function x(e) {
|
|
@@ -4806,7 +4806,7 @@ var En = ["data-tpl-theme"], Dn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, On
|
|
|
4806
4806
|
key: t,
|
|
4807
4807
|
class: D(["tpl-pulse tpl:rounded-lg", e.layout === "list" ? "tpl:h-12" : "tpl:aspect-square"]),
|
|
4808
4808
|
style: { "background-color": "var(--tpl-bg-hover)" }
|
|
4809
|
-
}, null, 2)), 64))], 2)) : e.items.length === 0 ? (o(), O("div", Sr, [k(p(
|
|
4809
|
+
}, null, 2)), 64))], 2)) : e.items.length === 0 ? (o(), O("div", Sr, [k(p(_e), {
|
|
4810
4810
|
class: "tpl:mb-3",
|
|
4811
4811
|
size: 40,
|
|
4812
4812
|
"stroke-width": 1,
|
|
@@ -4838,11 +4838,11 @@ var En = ["data-tpl-theme"], Dn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, On
|
|
|
4838
4838
|
style: { color: "var(--tpl-text-muted)" },
|
|
4839
4839
|
title: p(f).mediaLibrary.replaceFile,
|
|
4840
4840
|
onClick: m((e) => r("replace", t), ["stop"])
|
|
4841
|
-
}, [k(p(
|
|
4841
|
+
}, [k(p(ce), {
|
|
4842
4842
|
size: 12,
|
|
4843
4843
|
"stroke-width": 2
|
|
4844
4844
|
})], 8, Kr)]),
|
|
4845
|
-
e.selectedIds.has(t.id) ? (o(), O("div", qr, [k(p(
|
|
4845
|
+
e.selectedIds.has(t.id) ? (o(), O("div", qr, [k(p(ee), {
|
|
4846
4846
|
size: 12,
|
|
4847
4847
|
"stroke-width": 3
|
|
4848
4848
|
})])) : u("", !0)
|
|
@@ -4883,11 +4883,11 @@ var En = ["data-tpl-theme"], Dn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, On
|
|
|
4883
4883
|
style: { "background-color": "rgba(0, 0, 0, 0.6)" },
|
|
4884
4884
|
title: p(f).mediaLibrary.replaceFile,
|
|
4885
4885
|
onClick: m((e) => r("replace", t), ["stop"])
|
|
4886
|
-
}, [k(p(
|
|
4886
|
+
}, [k(p(ce), {
|
|
4887
4887
|
size: 11,
|
|
4888
4888
|
"stroke-width": 2
|
|
4889
4889
|
})], 8, Pr)]),
|
|
4890
|
-
e.selectedIds.has(t.id) ? (o(), O("div", Fr, [k(p(
|
|
4890
|
+
e.selectedIds.has(t.id) ? (o(), O("div", Fr, [k(p(ee), {
|
|
4891
4891
|
size: 12,
|
|
4892
4892
|
"stroke-width": 3
|
|
4893
4893
|
})])) : u("", !0)
|
|
@@ -4927,7 +4927,7 @@ var En = ["data-tpl-theme"], Dn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, On
|
|
|
4927
4927
|
},
|
|
4928
4928
|
emits: ["import", "close"],
|
|
4929
4929
|
setup(e, { emit: i }) {
|
|
4930
|
-
let a = e, s = i, { t: l } =
|
|
4930
|
+
let a = e, s = i, { t: l } = z(), h = t("tplUiTheme"), g = T("");
|
|
4931
4931
|
r(() => a.visible, (e) => {
|
|
4932
4932
|
e && (g.value = "");
|
|
4933
4933
|
});
|
|
@@ -5007,7 +5007,7 @@ var En = ["data-tpl-theme"], Dn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, On
|
|
|
5007
5007
|
},
|
|
5008
5008
|
emits: ["select", "close"],
|
|
5009
5009
|
setup(e, { emit: t }) {
|
|
5010
|
-
let n = t, { t: r } =
|
|
5010
|
+
let n = t, { t: r } = z(), a = T(null);
|
|
5011
5011
|
function s(e, t = 0) {
|
|
5012
5012
|
let n = [];
|
|
5013
5013
|
for (let r of e) n.push({
|
|
@@ -5017,7 +5017,7 @@ var En = ["data-tpl-theme"], Dn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, On
|
|
|
5017
5017
|
}), r.children?.length && n.push(...s(r.children, t + 1));
|
|
5018
5018
|
return n;
|
|
5019
5019
|
}
|
|
5020
|
-
return
|
|
5020
|
+
return ae(a, () => {
|
|
5021
5021
|
n("close");
|
|
5022
5022
|
}), (t, c) => (o(), O("div", {
|
|
5023
5023
|
ref_key: "pickerRef",
|
|
@@ -5032,7 +5032,7 @@ var En = ["data-tpl-theme"], Dn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, On
|
|
|
5032
5032
|
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",
|
|
5033
5033
|
style: { color: "var(--tpl-text)" },
|
|
5034
5034
|
onClick: c[0] ||= (e) => n("select", null)
|
|
5035
|
-
}, [k(p(
|
|
5035
|
+
}, [k(p(_e), {
|
|
5036
5036
|
class: "tpl:shrink-0",
|
|
5037
5037
|
size: 14,
|
|
5038
5038
|
"stroke-width": 1.5
|
|
@@ -5047,7 +5047,7 @@ var En = ["data-tpl-theme"], Dn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, On
|
|
|
5047
5047
|
disabled: t.id === e.currentFolderId,
|
|
5048
5048
|
onClick: (e) => n("select", t.id)
|
|
5049
5049
|
}, [
|
|
5050
|
-
k(p(
|
|
5050
|
+
k(p(ve), {
|
|
5051
5051
|
class: "tpl:shrink-0",
|
|
5052
5052
|
size: 14,
|
|
5053
5053
|
"stroke-width": 1.5
|
|
@@ -5072,7 +5072,7 @@ var En = ["data-tpl-theme"], Dn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, On
|
|
|
5072
5072
|
}, bi = {
|
|
5073
5073
|
class: "tpl:block tpl:text-[10px]",
|
|
5074
5074
|
style: { color: "var(--tpl-text-muted)" }
|
|
5075
|
-
}, xi = ["value"], Si = ["value"], Ci = /* @__PURE__ */
|
|
5075
|
+
}, xi = ["value"], Si = ["value"], Ci = /* @__PURE__ */ oe(/* @__PURE__ */ e({
|
|
5076
5076
|
__name: "MediaPreviewPanel",
|
|
5077
5077
|
props: {
|
|
5078
5078
|
item: {},
|
|
@@ -5081,7 +5081,7 @@ var En = ["data-tpl-theme"], Dn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, On
|
|
|
5081
5081
|
},
|
|
5082
5082
|
emits: ["update:selectedConversion", "template-width"],
|
|
5083
5083
|
setup(e, { emit: t }) {
|
|
5084
|
-
let n = e, r = t, { t: a } =
|
|
5084
|
+
let n = e, r = t, { t: a } = z(), { isImageMimeType: s } = Oe(), c = S(() => {
|
|
5085
5085
|
if (!b.value || !n.item.conversions_generated) return [];
|
|
5086
5086
|
let e = [];
|
|
5087
5087
|
return n.item.small_url && e.push({
|
|
@@ -5112,7 +5112,7 @@ var En = ["data-tpl-theme"], Dn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, On
|
|
|
5112
5112
|
});
|
|
5113
5113
|
function m(e) {
|
|
5114
5114
|
let t = e.target.value;
|
|
5115
|
-
r("update:selectedConversion", t), r("template-width",
|
|
5115
|
+
r("update:selectedConversion", t), r("template-width", xe(t));
|
|
5116
5116
|
}
|
|
5117
5117
|
function h(e, t, n = []) {
|
|
5118
5118
|
for (let r of e) {
|
|
@@ -5158,7 +5158,7 @@ var En = ["data-tpl-theme"], Dn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, On
|
|
|
5158
5158
|
b.value && e.item.width && e.item.height ? (o(), O(g, { key: 0 }, [d(" · " + _(e.item.width) + "×" + _(e.item.height) + "px ", 1)], 64)) : u("", !0),
|
|
5159
5159
|
v.value ? (o(), O(g, { key: 1 }, [
|
|
5160
5160
|
n[0] ||= d(" · ", -1),
|
|
5161
|
-
k(p(
|
|
5161
|
+
k(p(ve), {
|
|
5162
5162
|
class: "tpl:mb-px tpl:inline",
|
|
5163
5163
|
size: 9,
|
|
5164
5164
|
"stroke-width": 2
|
|
@@ -5224,7 +5224,7 @@ var En = ["data-tpl-theme"], Dn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, On
|
|
|
5224
5224
|
},
|
|
5225
5225
|
emits: ["replace", "close"],
|
|
5226
5226
|
setup(e, { emit: n }) {
|
|
5227
|
-
let i = e, a = n, { t: s } =
|
|
5227
|
+
let i = e, a = n, { t: s } = z(), l = t("tplUiTheme"), d = T(null), f = T(null), h = S(() => {
|
|
5228
5228
|
if (!i.item) return "";
|
|
5229
5229
|
let e = i.item.filename.split(".");
|
|
5230
5230
|
return e.length > 1 ? e[e.length - 1].toLowerCase() : "";
|
|
@@ -5315,7 +5315,7 @@ var En = ["data-tpl-theme"], Dn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, On
|
|
|
5315
5315
|
},
|
|
5316
5316
|
emits: ["upload"],
|
|
5317
5317
|
setup(e, { emit: t }) {
|
|
5318
|
-
let n = t, { t: r, format: i } =
|
|
5318
|
+
let n = t, { t: r, format: i } = z(), { allAcceptedMimeTypes: a, allAcceptedInputString: s, maxFileSize: c } = Oe(), l = T();
|
|
5319
5319
|
function u(e) {
|
|
5320
5320
|
let t = [];
|
|
5321
5321
|
for (let n of Array.from(e)) a.value.includes(n.type) && n.size <= c.value && t.push(n);
|
|
@@ -5325,9 +5325,9 @@ var En = ["data-tpl-theme"], Dn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, On
|
|
|
5325
5325
|
let t = u(e);
|
|
5326
5326
|
t.length && n("upload", t);
|
|
5327
5327
|
}
|
|
5328
|
-
let { isOverDropZone: f } =
|
|
5328
|
+
let { isOverDropZone: f } = L(l, { onDrop: (e) => {
|
|
5329
5329
|
e?.length && d(e);
|
|
5330
|
-
} }), { open: m, onChange: h } =
|
|
5330
|
+
} }), { open: m, onChange: h } = ue({
|
|
5331
5331
|
accept: s.value,
|
|
5332
5332
|
multiple: !0
|
|
5333
5333
|
});
|
|
@@ -5351,7 +5351,7 @@ var En = ["data-tpl-theme"], Dn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, On
|
|
|
5351
5351
|
current: e.uploadProgress.current,
|
|
5352
5352
|
total: e.uploadProgress.total
|
|
5353
5353
|
}) : p(r).mediaLibrary.uploading), 1)])) : (o(), O(g, { key: 1 }, [
|
|
5354
|
-
k(p(
|
|
5354
|
+
k(p(ie), {
|
|
5355
5355
|
class: "tpl:mb-2",
|
|
5356
5356
|
size: 24,
|
|
5357
5357
|
"stroke-width": 1.5,
|
|
@@ -5393,7 +5393,7 @@ var En = ["data-tpl-theme"], Dn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, On
|
|
|
5393
5393
|
size: {}
|
|
5394
5394
|
},
|
|
5395
5395
|
setup(e) {
|
|
5396
|
-
let t = e, { t: n, format: r } =
|
|
5396
|
+
let t = e, { t: n, format: r } = z(), i = T(!1), a = S(() => t.size ?? 24), s = S(() => Math.max(2, a.value / 8)), l = S(() => (a.value - s.value) / 2), f = S(() => 2 * Math.PI * l.value), p = S(() => t.limitBytes <= 0 ? 0 : Math.min(100, t.usedBytes / t.limitBytes * 100)), m = S(() => f.value - p.value / 100 * f.value), h = S(() => p.value >= 95 ? "var(--tpl-danger)" : p.value >= 75 ? "var(--tpl-warning, #f59e0b)" : "var(--tpl-primary)");
|
|
5397
5397
|
function g(e) {
|
|
5398
5398
|
if (e === 0) return "0 B";
|
|
5399
5399
|
let t = 1024, n = [
|
|
@@ -5482,13 +5482,13 @@ function Yi(e) {
|
|
|
5482
5482
|
}), r(() => t.previewItem.value?.id, () => {
|
|
5483
5483
|
l.value = "original";
|
|
5484
5484
|
});
|
|
5485
|
-
let y =
|
|
5485
|
+
let y = le((e) => {
|
|
5486
5486
|
t.search(e);
|
|
5487
5487
|
}, 300);
|
|
5488
5488
|
function b(e) {
|
|
5489
5489
|
c.value = e, y(e);
|
|
5490
5490
|
}
|
|
5491
|
-
let { copy: x, copied: C } =
|
|
5491
|
+
let { copy: x, copied: C } = re({
|
|
5492
5492
|
copiedDuring: 2e3,
|
|
5493
5493
|
legacy: !0
|
|
5494
5494
|
});
|
|
@@ -5516,16 +5516,16 @@ function Yi(e) {
|
|
|
5516
5516
|
async function M(e) {
|
|
5517
5517
|
await t.importFromUrl(e) && (d.value = !1);
|
|
5518
5518
|
}
|
|
5519
|
-
async function
|
|
5519
|
+
async function ee(e) {
|
|
5520
5520
|
f.value = !1, await t.moveSelected(e);
|
|
5521
5521
|
}
|
|
5522
|
-
async function
|
|
5522
|
+
async function N() {
|
|
5523
5523
|
await t.checkUsageBeforeDelete();
|
|
5524
5524
|
}
|
|
5525
5525
|
function P(e) {
|
|
5526
5526
|
t.checkUsageBeforeReplace(e);
|
|
5527
5527
|
}
|
|
5528
|
-
async function
|
|
5528
|
+
async function te(e) {
|
|
5529
5529
|
await t.replaceFile(e);
|
|
5530
5530
|
}
|
|
5531
5531
|
function F() {
|
|
@@ -5555,10 +5555,10 @@ function Yi(e) {
|
|
|
5555
5555
|
handleEditItem: A,
|
|
5556
5556
|
handleEditSave: j,
|
|
5557
5557
|
handleImportFromUrl: M,
|
|
5558
|
-
handleMoveToFolder:
|
|
5559
|
-
handleDeleteClick:
|
|
5558
|
+
handleMoveToFolder: ee,
|
|
5559
|
+
handleDeleteClick: N,
|
|
5560
5560
|
handleReplaceItem: P,
|
|
5561
|
-
handleReplaceFile:
|
|
5561
|
+
handleReplaceFile: te,
|
|
5562
5562
|
resetUI: F
|
|
5563
5563
|
};
|
|
5564
5564
|
}
|
|
@@ -5642,7 +5642,7 @@ var Xi = ["data-tpl-theme"], Zi = {
|
|
|
5642
5642
|
"template-width-preview"
|
|
5643
5643
|
],
|
|
5644
5644
|
setup(e, { emit: n }) {
|
|
5645
|
-
let a = e, s = n, { t: l } =
|
|
5645
|
+
let a = e, s = n, { t: l } = z(), f = t("tplUiTheme"), b = t("authManager"), x = t("projectId"), T = S(() => x.value), E = t("planConfig"), A = S(() => E.hasFeature("media_folders")), j = S(() => E.hasFeature("import_from_url")), M = S(() => E.config.value?.storage.used_bytes ?? 0), N = S(() => E.config.value?.storage.limit_bytes ?? 0), { isAcceptedMimeType: P, availableCategories: te } = Oe(), F = Ce({
|
|
5646
5646
|
projectId: T.value,
|
|
5647
5647
|
authManager: b
|
|
5648
5648
|
}), I = Yi({
|
|
@@ -5653,20 +5653,20 @@ var Xi = ["data-tpl-theme"], Zi = {
|
|
|
5653
5653
|
r(() => a.visible, (e) => {
|
|
5654
5654
|
e ? (F.loadItems(), F.loadFrequentlyUsed()) : I.resetUI();
|
|
5655
5655
|
});
|
|
5656
|
-
function
|
|
5656
|
+
function L(e) {
|
|
5657
5657
|
e.key === "Escape" && s("close");
|
|
5658
5658
|
}
|
|
5659
|
-
|
|
5660
|
-
function
|
|
5661
|
-
return F.previewItem.value ? a.accept?.length ?
|
|
5659
|
+
se(document, "keydown", L);
|
|
5660
|
+
function re() {
|
|
5661
|
+
return F.previewItem.value ? a.accept?.length ? P(F.previewItem.value.mime_type, a.accept) : !0 : !1;
|
|
5662
5662
|
}
|
|
5663
|
-
function
|
|
5664
|
-
if (
|
|
5663
|
+
function ie() {
|
|
5664
|
+
if (re()) {
|
|
5665
5665
|
let e = F.previewItem.value;
|
|
5666
5666
|
s("select", {
|
|
5667
5667
|
...e,
|
|
5668
5668
|
url: I.selectedUrl.value || e.url
|
|
5669
|
-
},
|
|
5669
|
+
}, xe(I.selectedConversion.value)), s("close");
|
|
5670
5670
|
}
|
|
5671
5671
|
}
|
|
5672
5672
|
return (t, n) => (o(), v(w, { to: "body" }, [k(C, {
|
|
@@ -5685,8 +5685,8 @@ var Xi = ["data-tpl-theme"], Zi = {
|
|
|
5685
5685
|
}, [y("div", Zi, [
|
|
5686
5686
|
y("div", Qi, [y("h2", $i, _(p(l).mediaLibrary.title), 1), y("div", ea, [
|
|
5687
5687
|
k(Ji, {
|
|
5688
|
-
"used-bytes":
|
|
5689
|
-
"limit-bytes":
|
|
5688
|
+
"used-bytes": M.value,
|
|
5689
|
+
"limit-bytes": N.value,
|
|
5690
5690
|
size: 22
|
|
5691
5691
|
}, null, 8, ["used-bytes", "limit-bytes"]),
|
|
5692
5692
|
y("div", ta, [y("input", {
|
|
@@ -5700,7 +5700,7 @@ var Xi = ["data-tpl-theme"], Zi = {
|
|
|
5700
5700
|
},
|
|
5701
5701
|
placeholder: p(l).mediaLibrary.searchPlaceholder,
|
|
5702
5702
|
onInput: n[0] ||= (e) => p(I).handleSearchInput(e.target.value)
|
|
5703
|
-
}, null, 40, na), k(p(
|
|
5703
|
+
}, null, 40, na), k(p(fe), {
|
|
5704
5704
|
class: "tpl:absolute tpl:top-1/2 tpl:left-2.5 tpl:-translate-y-1/2",
|
|
5705
5705
|
size: 13,
|
|
5706
5706
|
"stroke-width": 2,
|
|
@@ -5710,7 +5710,7 @@ var Xi = ["data-tpl-theme"], Zi = {
|
|
|
5710
5710
|
class: "tpl:flex tpl:size-7 tpl:items-center tpl:justify-center tpl:rounded-md tpl:transition-all tpl:duration-150",
|
|
5711
5711
|
style: { color: "var(--tpl-text-muted)" },
|
|
5712
5712
|
onClick: n[1] ||= (e) => s("close")
|
|
5713
|
-
}, [k(p(
|
|
5713
|
+
}, [k(p(ne), {
|
|
5714
5714
|
size: 18,
|
|
5715
5715
|
"stroke-width": 2
|
|
5716
5716
|
})])
|
|
@@ -5756,11 +5756,11 @@ var Xi = ["data-tpl-theme"], Zi = {
|
|
|
5756
5756
|
}),
|
|
5757
5757
|
title: p(I).showSidebar.value ? p(l).mediaLibrary.hideFolders : p(l).mediaLibrary.showFolders,
|
|
5758
5758
|
onClick: n[2] ||= (e) => p(I).showSidebar.value = !p(I).showSidebar.value
|
|
5759
|
-
}, [k(p(
|
|
5759
|
+
}, [k(p(pe), {
|
|
5760
5760
|
size: 16,
|
|
5761
5761
|
"stroke-width": 2
|
|
5762
5762
|
})], 12, ca)) : u("", !0),
|
|
5763
|
-
p(F).viewMode.value === "frequently-used" ? (o(), O("span", la, _(p(l).mediaLibrary.frequentlyUsed), 1)) : (o(), v(
|
|
5763
|
+
p(F).viewMode.value === "frequently-used" ? (o(), O("span", la, _(p(l).mediaLibrary.frequentlyUsed), 1)) : (o(), v(De, {
|
|
5764
5764
|
key: 2,
|
|
5765
5765
|
folders: p(F).folders.value,
|
|
5766
5766
|
"current-folder-id": p(F).currentFolderId.value,
|
|
@@ -5778,7 +5778,7 @@ var Xi = ["data-tpl-theme"], Zi = {
|
|
|
5778
5778
|
}),
|
|
5779
5779
|
title: p(l).mediaLibrary.viewGrid,
|
|
5780
5780
|
onClick: n[3] ||= (e) => p(I).layoutMode.value = "grid"
|
|
5781
|
-
}, [k(p(
|
|
5781
|
+
}, [k(p(ye), {
|
|
5782
5782
|
size: 14,
|
|
5783
5783
|
"stroke-width": 2
|
|
5784
5784
|
})], 12, da), y("button", {
|
|
@@ -5789,11 +5789,11 @@ var Xi = ["data-tpl-theme"], Zi = {
|
|
|
5789
5789
|
}),
|
|
5790
5790
|
title: p(l).mediaLibrary.viewList,
|
|
5791
5791
|
onClick: n[4] ||= (e) => p(I).layoutMode.value = "list"
|
|
5792
|
-
}, [k(p(
|
|
5792
|
+
}, [k(p(me), {
|
|
5793
5793
|
size: 14,
|
|
5794
5794
|
"stroke-width": 2
|
|
5795
5795
|
})], 12, fa)])
|
|
5796
|
-
]), y("div", pa, [p(
|
|
5796
|
+
]), y("div", pa, [p(te).length > 1 ? (o(), O("select", {
|
|
5797
5797
|
key: 0,
|
|
5798
5798
|
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",
|
|
5799
5799
|
style: {
|
|
@@ -5803,7 +5803,7 @@ var Xi = ["data-tpl-theme"], Zi = {
|
|
|
5803
5803
|
},
|
|
5804
5804
|
value: p(F).categoryFilter.value ?? "",
|
|
5805
5805
|
onChange: n[5] ||= (e) => p(F).filterByCategory(e.target.value || null)
|
|
5806
|
-
}, [y("option", ha, _(p(l).mediaLibrary.filterAll), 1), (o(!0), O(g, null, i(p(
|
|
5806
|
+
}, [y("option", ha, _(p(l).mediaLibrary.filterAll), 1), (o(!0), O(g, null, i(p(te), (e) => (o(), O("option", {
|
|
5807
5807
|
key: e,
|
|
5808
5808
|
value: e
|
|
5809
5809
|
}, _(p(I).getCategoryLabel(e)), 9, ga))), 128))], 40, ma)) : u("", !0), y("select", {
|
|
@@ -5830,7 +5830,7 @@ var Xi = ["data-tpl-theme"], Zi = {
|
|
|
5830
5830
|
"is-uploading",
|
|
5831
5831
|
"upload-progress",
|
|
5832
5832
|
"onUpload"
|
|
5833
|
-
]),
|
|
5833
|
+
]), j.value ? (o(), O("button", {
|
|
5834
5834
|
key: 0,
|
|
5835
5835
|
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",
|
|
5836
5836
|
style: {
|
|
@@ -5839,7 +5839,7 @@ var Xi = ["data-tpl-theme"], Zi = {
|
|
|
5839
5839
|
"background-color": "var(--tpl-bg)"
|
|
5840
5840
|
},
|
|
5841
5841
|
onClick: n[7] ||= (e) => p(I).showImportUrlModal.value = !0
|
|
5842
|
-
}, [k(p(
|
|
5842
|
+
}, [k(p(he), {
|
|
5843
5843
|
size: 14,
|
|
5844
5844
|
"stroke-width": 2
|
|
5845
5845
|
}), d(" " + _(p(l).mediaLibrary.importFromUrl), 1)])) : u("", !0)])) : u("", !0), k(Yr, {
|
|
@@ -5975,11 +5975,11 @@ var Xi = ["data-tpl-theme"], Zi = {
|
|
|
5975
5975
|
backgroundColor: "var(--tpl-bg)"
|
|
5976
5976
|
}),
|
|
5977
5977
|
onClick: n[15] ||= (e) => p(I).copy(p(I).selectedUrl.value)
|
|
5978
|
-
}, [p(I).copied.value ? (o(), v(p(
|
|
5978
|
+
}, [p(I).copied.value ? (o(), v(p(ee), {
|
|
5979
5979
|
key: 1,
|
|
5980
5980
|
size: 12,
|
|
5981
5981
|
"stroke-width": 2
|
|
5982
|
-
})) : (o(), v(p(
|
|
5982
|
+
})) : (o(), v(p(R), {
|
|
5983
5983
|
key: 0,
|
|
5984
5984
|
size: 12,
|
|
5985
5985
|
"stroke-width": 2
|
|
@@ -6016,8 +6016,8 @@ var Xi = ["data-tpl-theme"], Zi = {
|
|
|
6016
6016
|
"background-color": "var(--tpl-primary)",
|
|
6017
6017
|
color: "var(--tpl-bg)"
|
|
6018
6018
|
},
|
|
6019
|
-
disabled: !
|
|
6020
|
-
onClick:
|
|
6019
|
+
disabled: !re(),
|
|
6020
|
+
onClick: ie
|
|
6021
6021
|
}, _(e.accept?.length ? p(l).mediaLibrary.selectImage : p(l).mediaLibrary.selectFile), 9, za)])])])
|
|
6022
6022
|
])], 8, Xi)) : u("", !0)]),
|
|
6023
6023
|
_: 1
|
|
@@ -6025,6 +6025,6 @@ var Xi = ["data-tpl-theme"], Zi = {
|
|
|
6025
6025
|
}
|
|
6026
6026
|
});
|
|
6027
6027
|
//#endregion
|
|
6028
|
-
export {
|
|
6028
|
+
export { be as _, Ri as a, si as c, ar as d, Oe as f, Se as g, Ce as h, Ui as i, Yr as l, z as m, Yi as n, Ci as o, De as p, Ji as r, fi as s, Ba as t, vr as u, xe as v };
|
|
6029
6029
|
|
|
6030
|
-
//# sourceMappingURL=media-library-
|
|
6030
|
+
//# sourceMappingURL=media-library-BLLJsLwk.js.map
|