@aswin.dev/editor 0.7.2 → 0.7.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{AccessibilityPanel-EmQ19wiS.js → AccessibilityPanel-COL6Wm7p.js} +1 -1
- package/dist/{AiChatSidebar-DeB0w_32.js → AiChatSidebar-Dt5pvG5t.js} +9 -9
- package/dist/{AiFeatureMenu-DoLD5Cde.js → AiFeatureMenu-BipxcGap.js} +5 -5
- package/dist/{BlockA11yBadge-DkNbDvJA.js → BlockA11yBadge-Qs6HtXid.js} +1 -1
- package/dist/{CloudEditor-zo9PjjvY.js → CloudEditor-CnUX0IOW.js} +327 -290
- package/dist/{CollaboratorBar-BsXMY-8e.js → CollaboratorBar-NaaZTjbs.js} +2 -2
- package/dist/{CommentsSidebar-DIWIa4rS.js → CommentsSidebar-DE6ZsM4D.js} +15 -16
- package/dist/CountdownBlock-Ba3T-i2X.js +1536 -0
- package/dist/{CountdownToolbar-BuS8p5ju.js → CountdownToolbar-CbhSp_uq.js} +2 -2
- package/dist/{DesignReferenceSidebar-RDlnhL-6.js → DesignReferenceSidebar-CZg97bbj.js} +5 -5
- package/dist/{LoadingTrack-BJ59h9ok.js → LoadingTrack-Ba2pfF57.js} +1 -1
- package/dist/{ModuleBrowserModal-b7HbpByz.js → ModuleBrowserModal-D2EVdexc.js} +7 -7
- package/dist/{ModulePreviewCanvas-D__YlOLS.js → ModulePreviewCanvas-P3N-nxkU.js} +52 -47
- package/dist/{NumberWithSuffix-Ca3vNY84.js → NumberWithSuffix-CihczoAd.js} +2 -2
- package/dist/{ParagraphEditor-B1aYPO-6.js → ParagraphEditor-BbRuKhWv.js} +23 -23
- package/dist/{RichTextEditorContent-BmEVMrkJ.js → RichTextEditorContent-CrqPQdnk.js} +1 -1
- package/dist/{SaveModuleDialog-ClovqI6h.js → SaveModuleDialog-DLZa3m3O.js} +3 -3
- package/dist/{SnapshotHistory-DoqtH0cw.js → SnapshotHistory-Csg1_jXi.js} +5 -5
- package/dist/{TemplateScoringPanel-DQv2ZAiL.js → TemplateScoringPanel-CS7o62zS.js} +7 -7
- package/dist/{TestEmailModal-iIeYJYsj.js → TestEmailModal-m3okLbJz.js} +3 -3
- package/dist/{TitleEditor-CTDIwRF_.js → TitleEditor-CtJIS5ER.js} +7 -7
- package/dist/{TplModal-CBq1J1pG.js → TplModal-CQCrKeKP.js} +1 -1
- package/dist/{blockTypeIcons-QkC6f5UE.js → blockTypeIcons-Dah0pgt-.js} +50 -19
- package/dist/bundle-stats.json +7 -7
- package/dist/cdn/chunks/{AccessibilityPanel-BeU8nz7A.js → AccessibilityPanel-Bt_fD7QT.js} +8 -8
- package/dist/cdn/chunks/{AccessibilityPanel-BeU8nz7A.js.map → AccessibilityPanel-Bt_fD7QT.js.map} +1 -1
- package/dist/cdn/chunks/{AiFeatureMenu-B2mhscyP.js → AiFeatureMenu-Bn-0rgfr.js} +8 -8
- package/dist/cdn/chunks/{AiFeatureMenu-B2mhscyP.js.map → AiFeatureMenu-Bn-0rgfr.js.map} +1 -1
- package/dist/cdn/chunks/{BlockA11yBadge-C4g77gF0.js → BlockA11yBadge-Cj18Iw0p.js} +4 -4
- package/dist/cdn/chunks/{BlockA11yBadge-C4g77gF0.js.map → BlockA11yBadge-Cj18Iw0p.js.map} +1 -1
- package/dist/cdn/chunks/{CloudEditor-Btyr0b0_.js → CloudEditor-56lVcdot.js} +312 -275
- package/dist/cdn/chunks/CloudEditor-56lVcdot.js.map +1 -0
- package/dist/cdn/chunks/{CollaboratorBar-YBiIjiRh.js → CollaboratorBar-B7DCV3xp.js} +3 -3
- package/dist/cdn/chunks/{CollaboratorBar-YBiIjiRh.js.map → CollaboratorBar-B7DCV3xp.js.map} +1 -1
- package/dist/cdn/chunks/{CountdownToolbar-C9XZr33O.js → CountdownToolbar-BtaD3d3-.js} +4 -4
- package/dist/cdn/chunks/{CountdownToolbar-C9XZr33O.js.map → CountdownToolbar-BtaD3d3-.js.map} +1 -1
- package/dist/cdn/chunks/{ModuleBrowserModal-C2CDWKW6.js → ModuleBrowserModal-CiIY7ZGv.js} +7 -7
- package/dist/cdn/chunks/{ModuleBrowserModal-C2CDWKW6.js.map → ModuleBrowserModal-CiIY7ZGv.js.map} +1 -1
- package/dist/cdn/chunks/{ModulePreviewCanvas-Drt8Evai.js → ModulePreviewCanvas-M7_OGV2m.js} +55 -51
- package/dist/cdn/chunks/ModulePreviewCanvas-M7_OGV2m.js.map +1 -0
- package/dist/cdn/chunks/{NumberWithSuffix-Ty1bp9vB.js → NumberWithSuffix-DfVBnsgc.js} +3 -3
- package/dist/cdn/chunks/{NumberWithSuffix-Ty1bp9vB.js.map → NumberWithSuffix-DfVBnsgc.js.map} +1 -1
- package/dist/cdn/chunks/{ParagraphEditor-BA1WbHI7.js → ParagraphEditor-1XJOpiLX.js} +45 -45
- package/dist/cdn/chunks/{ParagraphEditor-BA1WbHI7.js.map → ParagraphEditor-1XJOpiLX.js.map} +1 -1
- package/dist/cdn/chunks/{RichTextEditorContent-BtWCA_Oc.js → RichTextEditorContent-C2q8sbp2.js} +4 -4
- package/dist/cdn/chunks/{RichTextEditorContent-BtWCA_Oc.js.map → RichTextEditorContent-C2q8sbp2.js.map} +1 -1
- package/dist/cdn/chunks/{SaveModuleDialog-AwL0tkCV.js → SaveModuleDialog-BNxh1jPT.js} +4 -4
- package/dist/cdn/chunks/{SaveModuleDialog-AwL0tkCV.js.map → SaveModuleDialog-BNxh1jPT.js.map} +1 -1
- package/dist/cdn/chunks/{TitleEditor-DbSyeixS.js → TitleEditor-IF7VzLTk.js} +13 -13
- package/dist/cdn/chunks/{TitleEditor-DbSyeixS.js.map → TitleEditor-IF7VzLTk.js.map} +1 -1
- package/dist/cdn/chunks/blockTypeIcons-tPBKQ8WC.js +24 -0
- package/dist/cdn/chunks/blockTypeIcons-tPBKQ8WC.js.map +1 -0
- package/dist/{de-2LEvILeZ.js → cdn/chunks/de-B05yW8Gi.js} +74 -3
- package/dist/cdn/chunks/de-B05yW8Gi.js.map +1 -0
- package/dist/cdn/chunks/{de-RQrZR56a.js → de-BPHtelu7.js} +1 -1
- package/dist/cdn/chunks/{de-RQrZR56a.js.map → de-BPHtelu7.js.map} +1 -1
- package/dist/cdn/chunks/{de-Ce-LbJ2J.js → de-BRDqJwJe.js} +1 -1
- package/dist/cdn/chunks/{de-Ce-LbJ2J.js.map → de-BRDqJwJe.js.map} +1 -1
- package/dist/cdn/chunks/{emojiData-EMFlj6FJ.js → emojiData-DUHzsh4j.js} +1 -1
- package/dist/cdn/chunks/{emojiData-EMFlj6FJ.js.map → emojiData-DUHzsh4j.js.map} +1 -1
- package/dist/cdn/chunks/{en-CNqLoIm9.js → en-BII7695P.js} +73 -4
- package/dist/cdn/chunks/en-BII7695P.js.map +1 -0
- package/dist/cdn/chunks/{en-DiCWK5fG.js → en-Cdj_Ikl1.js} +1 -1
- package/dist/cdn/chunks/{en-DiCWK5fG.js.map → en-Cdj_Ikl1.js.map} +1 -1
- package/dist/cdn/chunks/{en-Bl1ecfRF.js → en-DejwuJhw.js} +1 -1
- package/dist/cdn/chunks/{en-Bl1ecfRF.js.map → en-DejwuJhw.js.map} +1 -1
- package/dist/cdn/chunks/{extensions-BVKQw_sp.js → extensions-B0eT-yjf.js} +22 -22
- package/dist/cdn/chunks/{extensions-BVKQw_sp.js.map → extensions-B0eT-yjf.js.map} +1 -1
- package/dist/cdn/chunks/{features-DIBEo4xl.js → features-BrvE2Fzv.js} +2934 -1170
- package/dist/cdn/chunks/features-BrvE2Fzv.js.map +1 -0
- package/dist/cdn/chunks/{icons-C1Gg-ov-.js → icons-C7wtAD8p.js} +111 -60
- package/dist/cdn/chunks/icons-C7wtAD8p.js.map +1 -0
- package/dist/cdn/chunks/{liquid.browser-lQbkge2E.js → liquid.browser-CllF-us3.js} +1 -1
- package/dist/cdn/chunks/{liquid.browser-lQbkge2E.js.map → liquid.browser-CllF-us3.js.map} +1 -1
- package/dist/cdn/chunks/{media-library-BTF_Ko70.js → media-library-Cl5XuaKy.js} +676 -660
- package/dist/cdn/chunks/media-library-Cl5XuaKy.js.map +1 -0
- package/dist/cdn/chunks/{pusher-CDbNlZBE.js → pusher-i7-OBujc.js} +1 -1
- package/dist/cdn/chunks/{pusher-CDbNlZBE.js.map → pusher-i7-OBujc.js.map} +1 -1
- package/dist/cdn/chunks/{quality-C5AmotmP.js → quality-Va91a3N8.js} +40 -40
- package/dist/cdn/chunks/{quality-C5AmotmP.js.map → quality-Va91a3N8.js.map} +1 -1
- package/dist/cdn/chunks/{renderer-D0L44Vlp.js → renderer-si0Zgxeb.js} +17 -17
- package/dist/cdn/chunks/{renderer-D0L44Vlp.js.map → renderer-si0Zgxeb.js.map} +1 -1
- package/dist/cdn/chunks/{src-RKexlYjA.js → src-BLyYIbdZ.js} +10 -10
- package/dist/cdn/chunks/{src-RKexlYjA.js.map → src-BLyYIbdZ.js.map} +1 -1
- package/dist/cdn/chunks/{styleConstants-PgmvNBzQ.js → styleConstants-DfcU8u_r.js} +1 -1
- package/dist/cdn/chunks/{styleConstants-PgmvNBzQ.js.map → styleConstants-DfcU8u_r.js.map} +1 -1
- package/dist/cdn/chunks/{styles-CQR6ed13.js → styles-C6BQLT9F.js} +2174 -1343
- package/dist/cdn/chunks/styles-C6BQLT9F.js.map +1 -0
- package/dist/cdn/chunks/{tiptap-CDzAbF2j.js → tiptap-D8whBv5F.js} +2 -2
- package/dist/cdn/chunks/{tiptap-CDzAbF2j.js.map → tiptap-D8whBv5F.js.map} +1 -1
- package/dist/cdn/editor.css +1 -1
- package/dist/cdn/editor.js +146 -117
- package/dist/cdn/editor.js.map +1 -1
- package/dist/{cloud-DJG4tb4_.js → cloud-BoS0J0vs.js} +1 -1
- package/dist/{cdn/chunks/de-_tooy3Q8.js → de-C74F9xK3.js} +72 -5
- package/dist/{dist-BSJvAvH3.js → dist-BUzw1buG.js} +1 -1
- package/dist/{dist-b-XUqAoF.js → dist-BZyY-SS4.js} +1 -1
- package/dist/{dist-Df4ie7vZ.js → dist-BadNx4qo.js} +1 -1
- package/dist/{dist-wfAedlzi.js → dist-BesOh2mk.js} +1 -1
- package/dist/{dist-kZfaVUpW.js → dist-Bz3M4RXG.js} +3 -3
- package/dist/{dist-Bmir0gYb.js → dist-C2grMquk.js} +233 -139
- package/dist/{dist-BvPgo-UK.js → dist-C3T2AKtB.js} +1 -1
- package/dist/{dist-CPVBKMmd.js → dist-C9ckKEZL.js} +1 -1
- package/dist/{dist-DxOoemkW.js → dist-CBItRG-Z.js} +1 -1
- package/dist/{dist-BeFnymxK.js → dist-COSzWQUs.js} +1 -1
- package/dist/{dist-CivF9P8b.js → dist-Djgi0A6k.js} +92 -77
- package/dist/{dist-BHAeXaUY.js → dist-DtiDUrX-.js} +1 -1
- package/dist/{dist-HEQ52gTJ.js → dist-Dzt5foyL.js} +1 -1
- package/dist/{en-D2RU2Poj.js → en-B24jVTeO.js} +72 -3
- package/dist/{extensions-BQ1xXx3d.js → extensions-DsmjHqBF.js} +21 -21
- package/dist/index.d.ts +8 -8
- package/dist/{pencil-BZJPNYWR.js → pencil-Bpimrzzw.js} +5 -2
- package/dist/style.css +1 -1
- package/dist/{styles-CavWjvol.js → styles-BMFMtR9R.js} +2121 -1267
- package/dist/templatical-editor.js +149 -120
- package/dist/{useEditorCore-BGnzcT7p.js → useEditorCore-CtNAo0uy.js} +2331 -2202
- package/dist/useMergeTag-2vTcVpNo.js +34 -0
- package/package.json +7 -7
- package/dist/CountdownBlock-BCi7-DAM.js +0 -92
- package/dist/cdn/chunks/CloudEditor-Btyr0b0_.js.map +0 -1
- package/dist/cdn/chunks/CountdownBlock-B06UZoWe.js +0 -93
- package/dist/cdn/chunks/CountdownBlock-B06UZoWe.js.map +0 -1
- package/dist/cdn/chunks/ModulePreviewCanvas-Drt8Evai.js.map +0 -1
- package/dist/cdn/chunks/blockTypeIcons-pQIkxJzc.js +0 -23
- package/dist/cdn/chunks/blockTypeIcons-pQIkxJzc.js.map +0 -1
- package/dist/cdn/chunks/de-_tooy3Q8.js.map +0 -1
- package/dist/cdn/chunks/en-CNqLoIm9.js.map +0 -1
- package/dist/cdn/chunks/features-DIBEo4xl.js.map +0 -1
- package/dist/cdn/chunks/icons-C1Gg-ov-.js.map +0 -1
- package/dist/cdn/chunks/media-library-BTF_Ko70.js.map +0 -1
- package/dist/cdn/chunks/styles-CQR6ed13.js.map +0 -1
- package/dist/check-DJrpDKO_.js +0 -7
- package/dist/useMergeTag-CfuZq2fF.js +0 -34
- /package/dist/{_plugin-vue_export-helper-Bwh4ceeO.js → _plugin-vue_export-helper-BVAJ4lgT.js} +0 -0
- /package/dist/{clock-ik2pRJKG.js → clock-Ba4p3rJM.js} +0 -0
- /package/dist/{de-D2npYjrZ.js → de-GOtR9DwW.js} +0 -0
- /package/dist/{dist-DvHLtWVP.js → dist-DXa1uAMh.js} +0 -0
- /package/dist/{emojiData-DvQBBzmO.js → emojiData-DrBuvEoP.js} +0 -0
- /package/dist/{en-ib-4h3_o.js → en-dFFQVzNn.js} +0 -0
- /package/dist/{formatRelativeTime-CFDZnEIs.js → formatRelativeTime-BhhO8yCl.js} +0 -0
- /package/dist/{liquid.browser-7Rv0QDiO.js → liquid.browser-BvCyLQII.js} +0 -0
- /package/dist/{scan-line-DlghmhNf.js → scan-line-CzfFJO1o.js} +0 -0
- /package/dist/{send-DDdhIRj8.js → send-D2eSo4GH.js} +0 -0
- /package/dist/{shield-check-OSQ-JVTX.js → shield-check-jkpgcC0-.js} +0 -0
- /package/dist/{sparkles-BN4a-CoF.js → sparkles-Chm5CZfb.js} +0 -0
- /package/dist/{styleConstants-wWRbcuEK.js → styleConstants-34eUKPOZ.js} +0 -0
- /package/dist/{text-align-start-D1weisjS.js → text-align-start-CzBnJsW8.js} +0 -0
- /package/dist/{trash-2-CMWvQ5KX.js → trash-2-CtK2apEH.js} +0 -0
- /package/dist/{triangle-alert-DyidRNX_.js → triangle-alert-KpDVNbpn.js} +0 -0
- /package/dist/{undo-2-Cg8I7obC.js → undo-2-m1EUDbUg.js} +0 -0
- /package/dist/{useCloudI18n-BTTNBk5i.js → useCloudI18n-DOKSZql1.js} +0 -0
- /package/dist/{x-CgIhNcT9.js → x-BkaOMosX.js} +0 -0
|
@@ -1,8 +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 { E as j,
|
|
3
|
-
import {
|
|
2
|
+
import { E as j, Ft as ee, Mt as te, Ot as M, Sn as ne, St as N, T as P, _n as F, _t as I, at as L, ct as re, dt as R, fn as ie, gn as ae, mn as oe, pn as se, st as ce, vn as le, yt as ue } from "./features-BrvE2Fzv.js";
|
|
3
|
+
import { P as de, S as fe, Y as pe, et as me, g as he, k as ge, nt as _e, q as ve, rt as ye } from "./icons-C7wtAD8p.js";
|
|
4
|
+
//#region ../media-library/src/types.ts
|
|
5
|
+
var be = {
|
|
6
|
+
small: 380,
|
|
7
|
+
medium: 600,
|
|
8
|
+
large: 700,
|
|
9
|
+
original: void 0
|
|
10
|
+
};
|
|
11
|
+
function xe(e) {
|
|
12
|
+
return be[e];
|
|
13
|
+
}
|
|
14
|
+
//#endregion
|
|
4
15
|
//#region ../media-library/src/api-client.ts
|
|
5
|
-
var
|
|
16
|
+
var Se = class {
|
|
6
17
|
constructor(e) {
|
|
7
18
|
this.authManager = e;
|
|
8
19
|
}
|
|
@@ -36,7 +47,7 @@ var be = class {
|
|
|
36
47
|
async browseMedia(e) {
|
|
37
48
|
let t = new URLSearchParams();
|
|
38
49
|
e.folder_id && t.set("folder_id", e.folder_id), e.search && t.set("search", e.search), e.category && t.set("category", e.category), e.sort && t.set("sort", e.sort), e.cursor && t.set("cursor", e.cursor);
|
|
39
|
-
let n = t.toString(), r = `${j(
|
|
50
|
+
let n = t.toString(), r = `${j(P["media.browse"], this.baseParams)}${n ? `?${n}` : ""}`, i = await this.authManager.authenticatedFetch(r, { headers: { Accept: "application/json" } });
|
|
40
51
|
if (!i.ok) {
|
|
41
52
|
let e = await i.json().catch(() => ({ message: `HTTP error ${i.status}` }));
|
|
42
53
|
throw Error(e.message, { cause: e });
|
|
@@ -46,7 +57,7 @@ var be = class {
|
|
|
46
57
|
async uploadMedia(e, t) {
|
|
47
58
|
let n = new FormData();
|
|
48
59
|
n.append("file", e), t && n.append("folder_id", t);
|
|
49
|
-
let r = j(
|
|
60
|
+
let r = j(P["media.upload"], this.baseParams), i = await this.authManager.authenticatedFetch(r, {
|
|
50
61
|
method: "POST",
|
|
51
62
|
headers: { Accept: "application/json" },
|
|
52
63
|
body: n
|
|
@@ -58,7 +69,7 @@ var be = class {
|
|
|
58
69
|
return (await i.json()).data;
|
|
59
70
|
}
|
|
60
71
|
async updateMedia(e, t, n) {
|
|
61
|
-
return this.request(j(
|
|
72
|
+
return this.request(j(P["media.update"], {
|
|
62
73
|
...this.baseParams,
|
|
63
74
|
media: e
|
|
64
75
|
}), {
|
|
@@ -70,13 +81,13 @@ var be = class {
|
|
|
70
81
|
});
|
|
71
82
|
}
|
|
72
83
|
async deleteMedia(e) {
|
|
73
|
-
return this.request(j(
|
|
84
|
+
return this.request(j(P["media.delete"], this.baseParams), {
|
|
74
85
|
method: "POST",
|
|
75
86
|
body: JSON.stringify({ ids: e })
|
|
76
87
|
});
|
|
77
88
|
}
|
|
78
89
|
async moveMedia(e, t) {
|
|
79
|
-
return this.request(j(
|
|
90
|
+
return this.request(j(P["media.move"], this.baseParams), {
|
|
80
91
|
method: "POST",
|
|
81
92
|
body: JSON.stringify({
|
|
82
93
|
ids: e,
|
|
@@ -85,10 +96,10 @@ var be = class {
|
|
|
85
96
|
});
|
|
86
97
|
}
|
|
87
98
|
async getMediaFolders() {
|
|
88
|
-
return this.request(j(
|
|
99
|
+
return this.request(j(P["folders.index"], this.baseParams));
|
|
89
100
|
}
|
|
90
101
|
async createMediaFolder(e, t) {
|
|
91
|
-
return this.request(j(
|
|
102
|
+
return this.request(j(P["folders.store"], this.baseParams), {
|
|
92
103
|
method: "POST",
|
|
93
104
|
body: JSON.stringify({
|
|
94
105
|
name: e,
|
|
@@ -97,7 +108,7 @@ var be = class {
|
|
|
97
108
|
});
|
|
98
109
|
}
|
|
99
110
|
async renameMediaFolder(e, t) {
|
|
100
|
-
return this.request(j(
|
|
111
|
+
return this.request(j(P["folders.update"], {
|
|
101
112
|
...this.baseParams,
|
|
102
113
|
mediaFolder: e
|
|
103
114
|
}), {
|
|
@@ -106,13 +117,13 @@ var be = class {
|
|
|
106
117
|
});
|
|
107
118
|
}
|
|
108
119
|
async deleteMediaFolder(e) {
|
|
109
|
-
return this.request(j(
|
|
120
|
+
return this.request(j(P["folders.destroy"], {
|
|
110
121
|
...this.baseParams,
|
|
111
122
|
mediaFolder: e
|
|
112
123
|
}), { method: "DELETE" });
|
|
113
124
|
}
|
|
114
125
|
async checkMediaUsage(e) {
|
|
115
|
-
let t = await this.authManager.authenticatedFetch(j(
|
|
126
|
+
let t = await this.authManager.authenticatedFetch(j(P["media.checkUsage"], this.baseParams), {
|
|
116
127
|
method: "POST",
|
|
117
128
|
headers: {
|
|
118
129
|
"Content-Type": "application/json",
|
|
@@ -127,10 +138,10 @@ var be = class {
|
|
|
127
138
|
return t.json();
|
|
128
139
|
}
|
|
129
140
|
async getFrequentlyUsed() {
|
|
130
|
-
return this.request(j(
|
|
141
|
+
return this.request(j(P["media.frequentlyUsed"], this.baseParams));
|
|
131
142
|
}
|
|
132
143
|
async importFromUrl(e, t) {
|
|
133
|
-
return this.request(j(
|
|
144
|
+
return this.request(j(P["media.importFromUrl"], this.baseParams), {
|
|
134
145
|
method: "POST",
|
|
135
146
|
body: JSON.stringify({
|
|
136
147
|
url: e,
|
|
@@ -141,7 +152,7 @@ var be = class {
|
|
|
141
152
|
async replaceMedia(e, t) {
|
|
142
153
|
let n = new FormData();
|
|
143
154
|
n.append("file", t);
|
|
144
|
-
let r = j(
|
|
155
|
+
let r = j(P["media.replace"], {
|
|
145
156
|
...this.baseParams,
|
|
146
157
|
media: e
|
|
147
158
|
}), i = await this.authManager.authenticatedFetch(r, {
|
|
@@ -158,9 +169,9 @@ var be = class {
|
|
|
158
169
|
};
|
|
159
170
|
//#endregion
|
|
160
171
|
//#region ../media-library/src/composable.ts
|
|
161
|
-
function
|
|
172
|
+
function Ce(e) {
|
|
162
173
|
if (!e.projectId) throw Error("projectId is required for useMediaLibrary");
|
|
163
|
-
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;
|
|
164
175
|
async function k() {
|
|
165
176
|
let r = ++O;
|
|
166
177
|
l.value = !0;
|
|
@@ -204,19 +215,19 @@ function xe(e) {
|
|
|
204
215
|
async function j(e) {
|
|
205
216
|
o.value = e, await k();
|
|
206
217
|
}
|
|
207
|
-
async function
|
|
218
|
+
async function ee(e) {
|
|
208
219
|
s.value = e, await k();
|
|
209
220
|
}
|
|
210
|
-
async function
|
|
221
|
+
async function te(e) {
|
|
211
222
|
c.value = e, await k();
|
|
212
223
|
}
|
|
213
|
-
async function
|
|
224
|
+
async function M(e) {
|
|
214
225
|
a.value = "files", i.value = e, o.value = "", m.value = /* @__PURE__ */ new Set(), h.value = null, await k();
|
|
215
226
|
}
|
|
216
|
-
async function
|
|
227
|
+
async function ne() {
|
|
217
228
|
a.value = "frequently-used", i.value = null, o.value = "", m.value = /* @__PURE__ */ new Set(), h.value = null, await re();
|
|
218
229
|
}
|
|
219
|
-
async function
|
|
230
|
+
async function N(r) {
|
|
220
231
|
u.value = !0;
|
|
221
232
|
try {
|
|
222
233
|
let e = await t.uploadMedia(r, i.value);
|
|
@@ -227,7 +238,7 @@ function xe(e) {
|
|
|
227
238
|
u.value = !1;
|
|
228
239
|
}
|
|
229
240
|
}
|
|
230
|
-
async function
|
|
241
|
+
async function P(r) {
|
|
231
242
|
u.value = !0, p.value = {
|
|
232
243
|
current: 0,
|
|
233
244
|
total: r.length
|
|
@@ -416,12 +427,12 @@ function xe(e) {
|
|
|
416
427
|
loadItems: k,
|
|
417
428
|
loadMore: A,
|
|
418
429
|
search: j,
|
|
419
|
-
filterByCategory:
|
|
420
|
-
sortBy:
|
|
421
|
-
navigateToFolder:
|
|
422
|
-
showFrequentlyUsed:
|
|
423
|
-
uploadFile:
|
|
424
|
-
uploadFiles:
|
|
430
|
+
filterByCategory: ee,
|
|
431
|
+
sortBy: te,
|
|
432
|
+
navigateToFolder: M,
|
|
433
|
+
showFrequentlyUsed: ne,
|
|
434
|
+
uploadFile: N,
|
|
435
|
+
uploadFiles: P,
|
|
425
436
|
moveSelected: F,
|
|
426
437
|
updateFile: I,
|
|
427
438
|
deleteSelected: L,
|
|
@@ -465,14 +476,14 @@ function z(e) {
|
|
|
465
476
|
}
|
|
466
477
|
//#endregion
|
|
467
478
|
//#region ../media-library/src/components/media/MediaBreadcrumb.vue?vue&type=script&setup=true&lang.ts
|
|
468
|
-
var
|
|
479
|
+
var we = {
|
|
469
480
|
key: 0,
|
|
470
481
|
class: "tpl:flex tpl:items-center tpl:gap-1 tpl:text-xs",
|
|
471
482
|
style: { color: "var(--tpl-text-muted)" }
|
|
472
|
-
},
|
|
483
|
+
}, Te = ["onClick"], Ee = {
|
|
473
484
|
key: 1,
|
|
474
485
|
style: { color: "var(--tpl-text)" }
|
|
475
|
-
},
|
|
486
|
+
}, De = /* @__PURE__ */ e({
|
|
476
487
|
__name: "MediaBreadcrumb",
|
|
477
488
|
props: {
|
|
478
489
|
folders: {},
|
|
@@ -492,11 +503,11 @@ var Se = {
|
|
|
492
503
|
}
|
|
493
504
|
return !1;
|
|
494
505
|
}
|
|
495
|
-
return (e, t) => s.value.length > 0 ? (o(), O("div",
|
|
506
|
+
return (e, t) => s.value.length > 0 ? (o(), O("div", we, [y("button", {
|
|
496
507
|
class: "tpl:transition-colors tpl:duration-150 tpl:hover:underline",
|
|
497
508
|
style: { color: "var(--tpl-primary)" },
|
|
498
509
|
onClick: t[0] ||= (e) => r("navigate", null)
|
|
499
|
-
}, _(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(te), {
|
|
500
511
|
size: 12,
|
|
501
512
|
"stroke-width": 2
|
|
502
513
|
}), t < s.value.length - 1 ? (o(), O("button", {
|
|
@@ -504,12 +515,12 @@ var Se = {
|
|
|
504
515
|
class: "tpl:transition-colors tpl:duration-150 tpl:hover:underline",
|
|
505
516
|
style: { color: "var(--tpl-primary)" },
|
|
506
517
|
onClick: (t) => r("navigate", e.id)
|
|
507
|
-
}, _(e.name), 9,
|
|
518
|
+
}, _(e.name), 9, Te)) : (o(), O("span", Ee, _(e.name), 1))], 64))), 128))])) : u("", !0);
|
|
508
519
|
}
|
|
509
520
|
});
|
|
510
521
|
//#endregion
|
|
511
522
|
//#region ../media-library/src/composables/useMediaCategories.ts
|
|
512
|
-
function
|
|
523
|
+
function Oe() {
|
|
513
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);
|
|
514
525
|
function c(e, t) {
|
|
515
526
|
return i.value ? !t || t.length === 0 ? a.value.includes(e) : t.some((t) => i.value[t]?.mime_types.includes(e)) : !1;
|
|
@@ -535,14 +546,14 @@ function Ee() {
|
|
|
535
546
|
}
|
|
536
547
|
//#endregion
|
|
537
548
|
//#region ../media-library/src/composables/useImageCrop.ts
|
|
538
|
-
var
|
|
549
|
+
var ke = {
|
|
539
550
|
free: void 0,
|
|
540
551
|
square: 1,
|
|
541
552
|
landscape43: 4 / 3,
|
|
542
553
|
landscape169: 16 / 9,
|
|
543
554
|
original: void 0
|
|
544
555
|
};
|
|
545
|
-
function
|
|
556
|
+
function Ae(e) {
|
|
546
557
|
return e === "image/png" || e === "image/gif" ? {
|
|
547
558
|
mimeType: "image/png",
|
|
548
559
|
quality: 1
|
|
@@ -554,7 +565,7 @@ function Oe(e) {
|
|
|
554
565
|
quality: .92
|
|
555
566
|
};
|
|
556
567
|
}
|
|
557
|
-
function
|
|
568
|
+
function je(e, t, n) {
|
|
558
569
|
let r = e.width, i = e.height;
|
|
559
570
|
if (!t && !n) return e;
|
|
560
571
|
let a = r, o = i;
|
|
@@ -564,7 +575,7 @@ function ke(e, t, n) {
|
|
|
564
575
|
let c = s.getContext("2d");
|
|
565
576
|
return c && (c.imageSmoothingEnabled = !0, c.imageSmoothingQuality = "high", c.drawImage(e, 0, 0, a, o)), s;
|
|
566
577
|
}
|
|
567
|
-
function
|
|
578
|
+
function Me(e, t, n) {
|
|
568
579
|
return new Promise((r, i) => {
|
|
569
580
|
e.toBlob((e) => {
|
|
570
581
|
if (!e) {
|
|
@@ -576,7 +587,7 @@ function Ae(e, t, n) {
|
|
|
576
587
|
}, n.mimeType, n.quality);
|
|
577
588
|
});
|
|
578
589
|
}
|
|
579
|
-
function
|
|
590
|
+
function Ne(e, t, n, r) {
|
|
580
591
|
let i = e, a = t;
|
|
581
592
|
if (n && i > n) {
|
|
582
593
|
let e = n / i;
|
|
@@ -593,7 +604,7 @@ function je(e, t, n, r) {
|
|
|
593
604
|
}
|
|
594
605
|
//#endregion
|
|
595
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
|
|
596
|
-
function
|
|
607
|
+
function Pe(e, t) {
|
|
597
608
|
var n = Object.keys(e);
|
|
598
609
|
if (Object.getOwnPropertySymbols) {
|
|
599
610
|
var r = Object.getOwnPropertySymbols(e);
|
|
@@ -606,9 +617,9 @@ function Me(e, t) {
|
|
|
606
617
|
function B(e) {
|
|
607
618
|
for (var t = 1; t < arguments.length; t++) {
|
|
608
619
|
var n = arguments[t] == null ? {} : arguments[t];
|
|
609
|
-
t % 2 ?
|
|
620
|
+
t % 2 ? Pe(Object(n), !0).forEach((function(t) {
|
|
610
621
|
V(e, t, n[t]);
|
|
611
|
-
})) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) :
|
|
622
|
+
})) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : Pe(Object(n)).forEach((function(t) {
|
|
612
623
|
Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t));
|
|
613
624
|
}));
|
|
614
625
|
}
|
|
@@ -622,7 +633,7 @@ function V(e, t, n) {
|
|
|
622
633
|
writable: !0
|
|
623
634
|
}) : e[t] = n, e;
|
|
624
635
|
}
|
|
625
|
-
function
|
|
636
|
+
function Fe(e, t) {
|
|
626
637
|
if (e == null) return {};
|
|
627
638
|
var n, r, i = function(e, t) {
|
|
628
639
|
if (e == null) return {};
|
|
@@ -636,28 +647,28 @@ function Ne(e, t) {
|
|
|
636
647
|
}
|
|
637
648
|
return i;
|
|
638
649
|
}
|
|
639
|
-
function
|
|
650
|
+
function Ie(e) {
|
|
640
651
|
return function(e) {
|
|
641
|
-
if (Array.isArray(e)) return
|
|
652
|
+
if (Array.isArray(e)) return Le(e);
|
|
642
653
|
}(e) || function(e) {
|
|
643
654
|
if (typeof Symbol < "u" && e[Symbol.iterator] != null || e["@@iterator"] != null) return Array.from(e);
|
|
644
655
|
}(e) || function(e, t) {
|
|
645
656
|
if (e) {
|
|
646
|
-
if (typeof e == "string") return
|
|
657
|
+
if (typeof e == "string") return Le(e, t);
|
|
647
658
|
var n = Object.prototype.toString.call(e).slice(8, -1);
|
|
648
659
|
if (n === "Object" && e.constructor && (n = e.constructor.name), n === "Map" || n === "Set") return Array.from(e);
|
|
649
|
-
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);
|
|
650
661
|
}
|
|
651
662
|
}(e) || function() {
|
|
652
663
|
throw TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
653
664
|
}();
|
|
654
665
|
}
|
|
655
|
-
function
|
|
666
|
+
function Le(e, t) {
|
|
656
667
|
(t == null || t > e.length) && (t = e.length);
|
|
657
668
|
for (var n = 0, r = Array(t); n < t; n++) r[n] = e[n];
|
|
658
669
|
return r;
|
|
659
670
|
}
|
|
660
|
-
var
|
|
671
|
+
var Re, ze, Be, H = (Re = function(e) {
|
|
661
672
|
(function() {
|
|
662
673
|
var t = {}.hasOwnProperty;
|
|
663
674
|
function n() {
|
|
@@ -679,15 +690,15 @@ var Ie, Le, Re, H = (Ie = function(e) {
|
|
|
679
690
|
}
|
|
680
691
|
e.exports ? (n.default = n, e.exports = n) : window.classNames = n;
|
|
681
692
|
})();
|
|
682
|
-
},
|
|
683
|
-
path:
|
|
693
|
+
}, Re(Be = {
|
|
694
|
+
path: ze,
|
|
684
695
|
exports: {},
|
|
685
696
|
require: function(e, t) {
|
|
686
697
|
return function() {
|
|
687
698
|
throw Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs");
|
|
688
|
-
}(t == null &&
|
|
699
|
+
}(t == null && Be.path);
|
|
689
700
|
}
|
|
690
|
-
},
|
|
701
|
+
}, Be.exports), Be.exports), U = function(e) {
|
|
691
702
|
return function(t, n) {
|
|
692
703
|
if (!t) return e;
|
|
693
704
|
var r;
|
|
@@ -699,7 +710,7 @@ var Ie, Le, Re, H = (Ie = function(e) {
|
|
|
699
710
|
}), "") : "");
|
|
700
711
|
};
|
|
701
712
|
};
|
|
702
|
-
function
|
|
713
|
+
function Ve(e, t, n) {
|
|
703
714
|
var r, i, a, o, s;
|
|
704
715
|
function c() {
|
|
705
716
|
var l = Date.now() - o;
|
|
@@ -717,65 +728,65 @@ function ze(e, t, n) {
|
|
|
717
728
|
r &&= (s = e.apply(a, i), a = i = null, clearTimeout(r), null);
|
|
718
729
|
}, l;
|
|
719
730
|
}
|
|
720
|
-
|
|
721
|
-
var
|
|
731
|
+
Ve.debounce = Ve;
|
|
732
|
+
var He = Ve, W = function() {
|
|
722
733
|
return W = Object.assign || function(e) {
|
|
723
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]);
|
|
724
735
|
return e;
|
|
725
736
|
}, W.apply(this, arguments);
|
|
726
737
|
};
|
|
727
|
-
function
|
|
738
|
+
function Ue(e, t) {
|
|
728
739
|
var n, r;
|
|
729
740
|
return e && t ? (n = "" + e + t[0].toUpperCase() + t.slice(1), r = e + "-" + t) : (n = e || t, r = e || t), {
|
|
730
741
|
name: n,
|
|
731
742
|
classname: r
|
|
732
743
|
};
|
|
733
744
|
}
|
|
734
|
-
function
|
|
745
|
+
function We(e) {
|
|
735
746
|
return /^blob:/.test(e);
|
|
736
747
|
}
|
|
737
|
-
function
|
|
738
|
-
return
|
|
748
|
+
function Ge(e) {
|
|
749
|
+
return We(e) || function(e) {
|
|
739
750
|
return /^data:/.test(e);
|
|
740
751
|
}(e);
|
|
741
752
|
}
|
|
742
|
-
function
|
|
753
|
+
function Ke(e) {
|
|
743
754
|
return !!(e && e.constructor && e.call && e.apply);
|
|
744
755
|
}
|
|
745
756
|
function G(e) {
|
|
746
757
|
return e === void 0;
|
|
747
758
|
}
|
|
748
|
-
function
|
|
759
|
+
function qe(e) {
|
|
749
760
|
return typeof e == "object" && !!e;
|
|
750
761
|
}
|
|
751
|
-
function
|
|
762
|
+
function Je(e, t, n) {
|
|
752
763
|
var r = {};
|
|
753
|
-
return
|
|
754
|
-
G(e[i]) ? r[i] = t[i] :
|
|
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];
|
|
755
766
|
})), r) : e ? t : n;
|
|
756
767
|
}
|
|
757
|
-
function
|
|
768
|
+
function Ye(e) {
|
|
758
769
|
var t = Number(e);
|
|
759
770
|
return Number.isNaN(t) ? e : t;
|
|
760
771
|
}
|
|
761
|
-
function
|
|
772
|
+
function Xe(e) {
|
|
762
773
|
return typeof (e == "number" || function(e) {
|
|
763
774
|
return typeof e == "object" && !!e;
|
|
764
|
-
}(e) && toString.call(e) == "[object Number]") && !
|
|
775
|
+
}(e) && toString.call(e) == "[object Number]") && !Ze(e);
|
|
765
776
|
}
|
|
766
|
-
function
|
|
777
|
+
function Ze(e) {
|
|
767
778
|
return e != e;
|
|
768
779
|
}
|
|
769
|
-
function
|
|
780
|
+
function Qe(e, t) {
|
|
770
781
|
return Math.sqrt((e.x - t.x) ** 2 + (e.y - t.y) ** 2);
|
|
771
782
|
}
|
|
772
|
-
var
|
|
783
|
+
var $e = function(e, t) {
|
|
773
784
|
e === void 0 && (e = {}), t === void 0 && (t = {}), this.type = "manipulateImage", this.move = e, this.scale = t;
|
|
774
|
-
},
|
|
785
|
+
}, et = function(e, t) {
|
|
775
786
|
t === void 0 && (t = {}), this.type = "resize", this.directions = e, this.params = t;
|
|
776
|
-
},
|
|
787
|
+
}, tt = function(e) {
|
|
777
788
|
this.type = "move", this.directions = e;
|
|
778
|
-
},
|
|
789
|
+
}, nt = function() {
|
|
779
790
|
function e(e, t, n, r, i) {
|
|
780
791
|
this.type = "drag", this.nativeEvent = e, this.position = n, this.previousPosition = r, this.element = t, this.anchor = i;
|
|
781
792
|
}
|
|
@@ -793,7 +804,7 @@ var Ze = function(e, t) {
|
|
|
793
804
|
top: 0
|
|
794
805
|
};
|
|
795
806
|
}, e;
|
|
796
|
-
}(),
|
|
807
|
+
}(), rt = {
|
|
797
808
|
name: "DraggableElement",
|
|
798
809
|
props: { classname: { type: String } },
|
|
799
810
|
beforeMount: function() {
|
|
@@ -814,7 +825,7 @@ var Ze = function(e, t) {
|
|
|
814
825
|
this.hovered && !this.touches.length && (this.hovered = !1, this.$emit("leave"));
|
|
815
826
|
},
|
|
816
827
|
onTouchStart: function(e) {
|
|
817
|
-
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) {
|
|
818
829
|
return {
|
|
819
830
|
clientX: t.clientX + n.clientX / e.touches.length,
|
|
820
831
|
clientY: t.clientY + n.clientY / e.touches.length
|
|
@@ -860,11 +871,11 @@ var Ze = function(e, t) {
|
|
|
860
871
|
};
|
|
861
872
|
},
|
|
862
873
|
processMove: function(e, t) {
|
|
863
|
-
var n =
|
|
874
|
+
var n = Ie(t);
|
|
864
875
|
if (this.touches.length) {
|
|
865
876
|
if (this.touches.length === 1 && n.length === 1) {
|
|
866
877
|
var r = this.$refs.draggable;
|
|
867
|
-
this.$emit("drag", new
|
|
878
|
+
this.$emit("drag", new nt(e, r, {
|
|
868
879
|
left: n[0].clientX,
|
|
869
880
|
top: n[0].clientY
|
|
870
881
|
}, {
|
|
@@ -886,7 +897,7 @@ var Ze = function(e, t) {
|
|
|
886
897
|
"enter"
|
|
887
898
|
]
|
|
888
899
|
};
|
|
889
|
-
|
|
900
|
+
rt.render = function(e, t, n, r, i, s) {
|
|
890
901
|
return o(), v("div", {
|
|
891
902
|
ref: "draggable",
|
|
892
903
|
class: n.classname,
|
|
@@ -904,9 +915,9 @@ tt.render = function(e, t, n, r, i, s) {
|
|
|
904
915
|
}
|
|
905
916
|
}, [a(e.$slots, "default")], 34);
|
|
906
917
|
};
|
|
907
|
-
var
|
|
918
|
+
var it = U("vue-handler-wrapper"), at = {
|
|
908
919
|
name: "HandlerWrapper",
|
|
909
|
-
components: { DraggableElement:
|
|
920
|
+
components: { DraggableElement: rt },
|
|
910
921
|
props: {
|
|
911
922
|
horizontalPosition: { type: String },
|
|
912
923
|
verticalPosition: { type: String },
|
|
@@ -918,12 +929,12 @@ var nt = U("vue-handler-wrapper"), rt = {
|
|
|
918
929
|
computed: { classes: function() {
|
|
919
930
|
var e;
|
|
920
931
|
if (this.horizontalPosition || this.verticalPosition) {
|
|
921
|
-
var t, n =
|
|
922
|
-
e =
|
|
923
|
-
} 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 });
|
|
924
935
|
return {
|
|
925
936
|
root: e,
|
|
926
|
-
draggable:
|
|
937
|
+
draggable: it("draggable")
|
|
927
938
|
};
|
|
928
939
|
} },
|
|
929
940
|
emits: [
|
|
@@ -933,7 +944,7 @@ var nt = U("vue-handler-wrapper"), rt = {
|
|
|
933
944
|
"drag-end"
|
|
934
945
|
]
|
|
935
946
|
};
|
|
936
|
-
|
|
947
|
+
at.render = function(e, t, n, r, i, l) {
|
|
937
948
|
var u = s("DraggableElement");
|
|
938
949
|
return o(), v("div", { class: l.classes.root }, [k(u, {
|
|
939
950
|
class: l.classes.draggable,
|
|
@@ -956,9 +967,9 @@ rt.render = function(e, t, n, r, i, l) {
|
|
|
956
967
|
_: 3
|
|
957
968
|
}, 8, ["class"])], 2);
|
|
958
969
|
};
|
|
959
|
-
var
|
|
970
|
+
var ot = U("vue-line-wrapper"), st = {
|
|
960
971
|
name: "LineWrapper",
|
|
961
|
-
components: { DraggableElement:
|
|
972
|
+
components: { DraggableElement: rt },
|
|
962
973
|
props: {
|
|
963
974
|
position: {
|
|
964
975
|
type: String,
|
|
@@ -971,7 +982,7 @@ var it = U("vue-line-wrapper"), at = {
|
|
|
971
982
|
},
|
|
972
983
|
computed: { classname: function() {
|
|
973
984
|
var e;
|
|
974
|
-
return
|
|
985
|
+
return ot((V(e = {}, this.position, !0), V(e, "disabled", this.disabled), e));
|
|
975
986
|
} },
|
|
976
987
|
emits: [
|
|
977
988
|
"leave",
|
|
@@ -980,7 +991,7 @@ var it = U("vue-line-wrapper"), at = {
|
|
|
980
991
|
"drag-end"
|
|
981
992
|
]
|
|
982
993
|
};
|
|
983
|
-
|
|
994
|
+
st.render = function(e, t, n, r, i, l) {
|
|
984
995
|
var u = s("DraggableElement");
|
|
985
996
|
return o(), v(u, {
|
|
986
997
|
class: l.classname,
|
|
@@ -1008,18 +1019,18 @@ var K = [
|
|
|
1008
1019
|
"right",
|
|
1009
1020
|
"top",
|
|
1010
1021
|
"bottom"
|
|
1011
|
-
],
|
|
1022
|
+
], ct = ["left", "right"], lt = ["top", "bottom"], ut = ["left", "top"], dt = [
|
|
1012
1023
|
"fill-area",
|
|
1013
1024
|
"fit-area",
|
|
1014
1025
|
"stencil",
|
|
1015
1026
|
"none"
|
|
1016
|
-
],
|
|
1027
|
+
], ft = {
|
|
1017
1028
|
left: 0,
|
|
1018
1029
|
top: 0,
|
|
1019
1030
|
width: 0,
|
|
1020
1031
|
height: 0
|
|
1021
1032
|
};
|
|
1022
|
-
function
|
|
1033
|
+
function pt(e, t, n) {
|
|
1023
1034
|
return !(n ||= [
|
|
1024
1035
|
"width",
|
|
1025
1036
|
"height",
|
|
@@ -1037,7 +1048,7 @@ function q(e) {
|
|
|
1037
1048
|
bottom: e.top + e.height
|
|
1038
1049
|
};
|
|
1039
1050
|
}
|
|
1040
|
-
function
|
|
1051
|
+
function mt(e, t) {
|
|
1041
1052
|
return {
|
|
1042
1053
|
left: e.left - t.left,
|
|
1043
1054
|
top: e.top - t.top
|
|
@@ -1049,7 +1060,7 @@ function J(e) {
|
|
|
1049
1060
|
top: e.top + e.height / 2
|
|
1050
1061
|
};
|
|
1051
1062
|
}
|
|
1052
|
-
function
|
|
1063
|
+
function ht(e, t) {
|
|
1053
1064
|
var n = {
|
|
1054
1065
|
left: 0,
|
|
1055
1066
|
top: 0,
|
|
@@ -1069,7 +1080,7 @@ function Y(e, t) {
|
|
|
1069
1080
|
height: e.height + t.top + t.bottom
|
|
1070
1081
|
};
|
|
1071
1082
|
}
|
|
1072
|
-
function
|
|
1083
|
+
function gt(e) {
|
|
1073
1084
|
return {
|
|
1074
1085
|
left: -e.left,
|
|
1075
1086
|
top: -e.top
|
|
@@ -1104,21 +1115,21 @@ function Z(e, t, n, r) {
|
|
|
1104
1115
|
function Q(e) {
|
|
1105
1116
|
return e.width / e.height;
|
|
1106
1117
|
}
|
|
1107
|
-
function
|
|
1118
|
+
function _t(e, t) {
|
|
1108
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);
|
|
1109
1120
|
}
|
|
1110
|
-
function
|
|
1121
|
+
function vt(e, t) {
|
|
1111
1122
|
var n = {
|
|
1112
1123
|
left: 0,
|
|
1113
1124
|
top: 0
|
|
1114
|
-
}, r =
|
|
1125
|
+
}, r = ht(e, t);
|
|
1115
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;
|
|
1116
1127
|
}
|
|
1117
|
-
function
|
|
1128
|
+
function yt(e, t) {
|
|
1118
1129
|
var n;
|
|
1119
1130
|
return t.minimum && e < t.minimum ? n = t.minimum : t.maximum && e > t.maximum && (n = t.maximum), n;
|
|
1120
1131
|
}
|
|
1121
|
-
function
|
|
1132
|
+
function bt(e, t) {
|
|
1122
1133
|
var n = Q(e), r = Q(t);
|
|
1123
1134
|
return t.width < Infinity && t.height < Infinity ? n > r ? {
|
|
1124
1135
|
width: t.width,
|
|
@@ -1134,36 +1145,36 @@ function vt(e, t) {
|
|
|
1134
1145
|
height: t.height
|
|
1135
1146
|
} : e;
|
|
1136
1147
|
}
|
|
1137
|
-
function
|
|
1148
|
+
function xt(e, t) {
|
|
1138
1149
|
var n = t * Math.PI / 180;
|
|
1139
1150
|
return {
|
|
1140
1151
|
width: Math.abs(e.width * Math.cos(n)) + Math.abs(e.height * Math.sin(n)),
|
|
1141
1152
|
height: Math.abs(e.width * Math.sin(n)) + Math.abs(e.height * Math.cos(n))
|
|
1142
1153
|
};
|
|
1143
1154
|
}
|
|
1144
|
-
function
|
|
1155
|
+
function St(e, t) {
|
|
1145
1156
|
var n = t * Math.PI / 180;
|
|
1146
1157
|
return {
|
|
1147
1158
|
left: e.left * Math.cos(n) - e.top * Math.sin(n),
|
|
1148
1159
|
top: e.left * Math.sin(n) + e.top * Math.cos(n)
|
|
1149
1160
|
};
|
|
1150
1161
|
}
|
|
1151
|
-
function
|
|
1152
|
-
var n =
|
|
1153
|
-
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;
|
|
1154
1165
|
}
|
|
1155
1166
|
function $(e, t, n) {
|
|
1156
1167
|
n === void 0 && (n = !1);
|
|
1157
|
-
var r =
|
|
1158
|
-
return X(e, n ?
|
|
1168
|
+
var r = vt(e, t);
|
|
1169
|
+
return X(e, n ? gt(r) : r);
|
|
1159
1170
|
}
|
|
1160
|
-
function
|
|
1171
|
+
function wt(e) {
|
|
1161
1172
|
return {
|
|
1162
1173
|
width: e.right !== void 0 && e.left !== void 0 ? e.right - e.left : Infinity,
|
|
1163
1174
|
height: e.bottom !== void 0 && e.top !== void 0 ? e.bottom - e.top : Infinity
|
|
1164
1175
|
};
|
|
1165
1176
|
}
|
|
1166
|
-
function
|
|
1177
|
+
function Tt(e, t) {
|
|
1167
1178
|
return W(W({}, e), {
|
|
1168
1179
|
minWidth: Math.min(t.width, e.minWidth),
|
|
1169
1180
|
minHeight: Math.min(t.height, e.minHeight),
|
|
@@ -1171,7 +1182,7 @@ function Ct(e, t) {
|
|
|
1171
1182
|
maxHeight: Math.min(t.height, e.maxHeight)
|
|
1172
1183
|
});
|
|
1173
1184
|
}
|
|
1174
|
-
function
|
|
1185
|
+
function Et(e, t, n) {
|
|
1175
1186
|
n === void 0 && (n = !0);
|
|
1176
1187
|
var r = {};
|
|
1177
1188
|
return K.forEach((function(i) {
|
|
@@ -1179,17 +1190,17 @@ function wt(e, t, n) {
|
|
|
1179
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;
|
|
1180
1191
|
})), r;
|
|
1181
1192
|
}
|
|
1182
|
-
function
|
|
1183
|
-
return
|
|
1193
|
+
function Dt(e, t) {
|
|
1194
|
+
return Et(e, t, !0);
|
|
1184
1195
|
}
|
|
1185
|
-
function
|
|
1196
|
+
function Ot(e) {
|
|
1186
1197
|
var t = e.size, n = e.aspectRatio, r = e.ignoreMinimum, i = e.sizeRestrictions;
|
|
1187
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));
|
|
1188
1199
|
}
|
|
1189
|
-
function
|
|
1200
|
+
function kt(e, t) {
|
|
1190
1201
|
return (e.width - t.width) ** 2 + (e.height - t.height) ** 2;
|
|
1191
1202
|
}
|
|
1192
|
-
function
|
|
1203
|
+
function At(e) {
|
|
1193
1204
|
var t = e.width, n = e.height, r = e.sizeRestrictions, i = {
|
|
1194
1205
|
minimum: e.aspectRatio && e.aspectRatio.minimum || 0,
|
|
1195
1206
|
maximum: e.aspectRatio && e.aspectRatio.maximum || Infinity
|
|
@@ -1199,15 +1210,15 @@ function Ot(e) {
|
|
|
1199
1210
|
};
|
|
1200
1211
|
function o(e, a) {
|
|
1201
1212
|
return a === void 0 && (a = !1), e.reduce((function(e, o) {
|
|
1202
|
-
return
|
|
1213
|
+
return Ot({
|
|
1203
1214
|
size: o,
|
|
1204
1215
|
aspectRatio: i,
|
|
1205
1216
|
sizeRestrictions: r,
|
|
1206
1217
|
ignoreMinimum: a
|
|
1207
|
-
}) && (!e ||
|
|
1218
|
+
}) && (!e || kt(o, {
|
|
1208
1219
|
width: t,
|
|
1209
1220
|
height: n
|
|
1210
|
-
}) <
|
|
1221
|
+
}) < kt(e, {
|
|
1211
1222
|
width: t,
|
|
1212
1223
|
height: n
|
|
1213
1224
|
})) ? o : e;
|
|
@@ -1224,7 +1235,7 @@ function Ot(e) {
|
|
|
1224
1235
|
height: a.height,
|
|
1225
1236
|
correctRatio: !0
|
|
1226
1237
|
});
|
|
1227
|
-
})),
|
|
1238
|
+
})), Ot({
|
|
1228
1239
|
size: a,
|
|
1229
1240
|
aspectRatio: i,
|
|
1230
1241
|
sizeRestrictions: r
|
|
@@ -1235,16 +1246,16 @@ function Ot(e) {
|
|
|
1235
1246
|
height: c.height
|
|
1236
1247
|
};
|
|
1237
1248
|
}
|
|
1238
|
-
function
|
|
1249
|
+
function jt(e) {
|
|
1239
1250
|
var t = e.event, n = e.coordinates, r = e.positionRestrictions, i = r === void 0 ? {} : r, a = X(n, t.directions);
|
|
1240
|
-
return X(a,
|
|
1251
|
+
return X(a, vt(a, i));
|
|
1241
1252
|
}
|
|
1242
|
-
function
|
|
1253
|
+
function Mt(e) {
|
|
1243
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) {
|
|
1244
|
-
return
|
|
1255
|
+
return jt({
|
|
1245
1256
|
coordinates: e,
|
|
1246
1257
|
positionRestrictions: a,
|
|
1247
|
-
event: new
|
|
1258
|
+
event: new tt({
|
|
1248
1259
|
left: t.left - e.left,
|
|
1249
1260
|
top: t.top - e.top
|
|
1250
1261
|
})
|
|
@@ -1257,7 +1268,7 @@ function At(e) {
|
|
|
1257
1268
|
imageSize: r,
|
|
1258
1269
|
visibleArea: s
|
|
1259
1270
|
}) : e).width) && G(t.height) || (l = function(e, t) {
|
|
1260
|
-
return c(W(W(W({}, e),
|
|
1271
|
+
return c(W(W(W({}, e), At({
|
|
1261
1272
|
width: t.width,
|
|
1262
1273
|
height: t.height,
|
|
1263
1274
|
sizeRestrictions: i,
|
|
@@ -1272,9 +1283,9 @@ function At(e) {
|
|
|
1272
1283
|
}(l, W(W({}, l), t))), G(t.left) && G(t.top) || (l = c(l, W(W({}, l), t)));
|
|
1273
1284
|
})), l;
|
|
1274
1285
|
}
|
|
1275
|
-
function
|
|
1286
|
+
function Nt(e) {
|
|
1276
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);
|
|
1277
|
-
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),
|
|
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({
|
|
1278
1289
|
sizeRestrictions: o,
|
|
1279
1290
|
width: d.width,
|
|
1280
1291
|
height: d.height,
|
|
@@ -1283,19 +1294,19 @@ function jt(e) {
|
|
|
1283
1294
|
maximum: Q(p)
|
|
1284
1295
|
}
|
|
1285
1296
|
})));
|
|
1286
|
-
var m =
|
|
1297
|
+
var m = Ct(f = Z(f, d.width * n.width / (f.width * p.width)), t({
|
|
1287
1298
|
visibleArea: f,
|
|
1288
1299
|
type: "resize"
|
|
1289
1300
|
}));
|
|
1290
|
-
return m !== 1 && (f = Z(f, m), d = Z(d, m)), f = $(f = X(f,
|
|
1301
|
+
return m !== 1 && (f = Z(f, m), d = Z(d, m)), f = $(f = X(f, mt(J(d), J(f))), t({
|
|
1291
1302
|
visibleArea: f,
|
|
1292
1303
|
type: "move"
|
|
1293
1304
|
})), {
|
|
1294
|
-
coordinates: d = $(d,
|
|
1305
|
+
coordinates: d = $(d, Dt(q(f), s)),
|
|
1295
1306
|
visibleArea: f
|
|
1296
1307
|
};
|
|
1297
1308
|
}
|
|
1298
|
-
function
|
|
1309
|
+
function Pt(e) {
|
|
1299
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);
|
|
1300
1311
|
if (i && a && t.type !== "manipulateImage") {
|
|
1301
1312
|
var l = {
|
|
@@ -1303,31 +1314,31 @@ function Mt(e) {
|
|
|
1303
1314
|
height: 0
|
|
1304
1315
|
};
|
|
1305
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));
|
|
1306
|
-
var u =
|
|
1317
|
+
var u = Ct(c = Z(c, s.width * r.width / (c.width * l.width)), n({
|
|
1307
1318
|
visibleArea: c,
|
|
1308
1319
|
type: "resize"
|
|
1309
1320
|
}));
|
|
1310
|
-
c = Z(c, u), u !== 1 && (l.height /= u, l.width /= u), c = $(c = X(c,
|
|
1321
|
+
c = Z(c, u), u !== 1 && (l.height /= u, l.width /= u), c = $(c = X(c, mt(J(s), J(c))), n({
|
|
1311
1322
|
visibleArea: c,
|
|
1312
1323
|
type: "move"
|
|
1313
|
-
})), s = $(s,
|
|
1324
|
+
})), s = $(s, Dt(q(c), o));
|
|
1314
1325
|
}
|
|
1315
1326
|
return {
|
|
1316
1327
|
coordinates: s,
|
|
1317
1328
|
visibleArea: c
|
|
1318
1329
|
};
|
|
1319
1330
|
}
|
|
1320
|
-
function
|
|
1331
|
+
function Ft(e) {
|
|
1321
1332
|
var t = e.event, n = e.coordinates, r = e.visibleArea, i = e.getAreaRestrictions, a = W({}, r), o = W({}, n);
|
|
1322
1333
|
if (t.type === "setCoordinates") {
|
|
1323
1334
|
var s = Math.max(0, o.width - a.width), c = Math.max(0, o.height - a.height);
|
|
1324
|
-
s > c ? a = Z(a, Math.min(o.width / a.width,
|
|
1335
|
+
s > c ? a = Z(a, Math.min(o.width / a.width, _t(a, i({
|
|
1325
1336
|
visibleArea: a,
|
|
1326
1337
|
type: "resize"
|
|
1327
|
-
})))) : c > s && (a = Z(a, Math.min(o.height / a.height,
|
|
1338
|
+
})))) : c > s && (a = Z(a, Math.min(o.height / a.height, _t(a, i({
|
|
1328
1339
|
visibleArea: a,
|
|
1329
1340
|
type: "resize"
|
|
1330
|
-
}))))), a = $(a = X(a,
|
|
1341
|
+
}))))), a = $(a = X(a, gt(vt(o, q(a)))), i({
|
|
1331
1342
|
visibleArea: a,
|
|
1332
1343
|
type: "move"
|
|
1333
1344
|
}));
|
|
@@ -1337,14 +1348,14 @@ function Nt(e) {
|
|
|
1337
1348
|
coordinates: o
|
|
1338
1349
|
};
|
|
1339
1350
|
}
|
|
1340
|
-
function
|
|
1351
|
+
function It(e) {
|
|
1341
1352
|
var t = e.imageSize, n = e.visibleArea, r = e.coordinates, i = n || t;
|
|
1342
1353
|
return {
|
|
1343
1354
|
left: (n ? n.left : 0) + i.width / 2 - r.width / 2,
|
|
1344
1355
|
top: (n ? n.top : 0) + i.height / 2 - r.height / 2
|
|
1345
1356
|
};
|
|
1346
1357
|
}
|
|
1347
|
-
function
|
|
1358
|
+
function Lt(e) {
|
|
1348
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 ? {
|
|
1349
1360
|
width: .8 * a.width,
|
|
1350
1361
|
height: .8 * a.width / o
|
|
@@ -1352,35 +1363,35 @@ function Ft(e) {
|
|
|
1352
1363
|
height: .8 * a.height,
|
|
1353
1364
|
width: .8 * a.height * o
|
|
1354
1365
|
};
|
|
1355
|
-
return
|
|
1366
|
+
return At(W(W({}, s), {
|
|
1356
1367
|
aspectRatio: r,
|
|
1357
1368
|
sizeRestrictions: i
|
|
1358
1369
|
}));
|
|
1359
1370
|
}
|
|
1360
|
-
function
|
|
1371
|
+
function Rt(e) {
|
|
1361
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;
|
|
1362
|
-
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),
|
|
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({
|
|
1363
1374
|
width: n,
|
|
1364
1375
|
height: t,
|
|
1365
1376
|
aspectRatio: o,
|
|
1366
1377
|
sizeRestrictions: s
|
|
1367
1378
|
});
|
|
1368
1379
|
}
|
|
1369
|
-
function
|
|
1380
|
+
function zt(e) {
|
|
1370
1381
|
var t = e.getAreaRestrictions, n = e.coordinates, r = e.imageSize, i = Q(e.boundaries);
|
|
1371
1382
|
if (n) {
|
|
1372
1383
|
var a = {
|
|
1373
1384
|
height: Math.max(n.height, r.height),
|
|
1374
1385
|
width: Math.max(n.width, r.width)
|
|
1375
|
-
}, o =
|
|
1386
|
+
}, o = bt({
|
|
1376
1387
|
width: Q(a) > i ? a.width : a.height * i,
|
|
1377
1388
|
height: Q(a) > i ? a.width / i : a.height
|
|
1378
|
-
},
|
|
1389
|
+
}, wt(t())), s = {
|
|
1379
1390
|
left: n.left + n.width / 2 - o.width / 2,
|
|
1380
1391
|
top: n.top + n.height / 2 - o.height / 2,
|
|
1381
1392
|
width: o.width,
|
|
1382
1393
|
height: o.height
|
|
1383
|
-
}, c =
|
|
1394
|
+
}, c = ht(n, q(W({
|
|
1384
1395
|
left: 0,
|
|
1385
1396
|
top: 0
|
|
1386
1397
|
}, r))), l = {};
|
|
@@ -1397,10 +1408,10 @@ function Lt(e) {
|
|
|
1397
1408
|
height: o.height
|
|
1398
1409
|
};
|
|
1399
1410
|
}
|
|
1400
|
-
function
|
|
1401
|
-
return
|
|
1411
|
+
function Bt(e, t) {
|
|
1412
|
+
return Et(e, q(t));
|
|
1402
1413
|
}
|
|
1403
|
-
function
|
|
1414
|
+
function Vt(e) {
|
|
1404
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;
|
|
1405
1416
|
u = X(u, {
|
|
1406
1417
|
left: l.left || 0,
|
|
@@ -1409,16 +1420,16 @@ function zt(e) {
|
|
|
1409
1420
|
var h = {
|
|
1410
1421
|
stencil: {
|
|
1411
1422
|
minimum: Math.max(i.minWidth ? i.minWidth / d.width : 0, i.minHeight ? i.minHeight / d.height : 0),
|
|
1412
|
-
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))
|
|
1413
1424
|
},
|
|
1414
|
-
area: { maximum:
|
|
1425
|
+
area: { maximum: _t(u, a({
|
|
1415
1426
|
visibleArea: u,
|
|
1416
1427
|
type: "resize"
|
|
1417
1428
|
})) }
|
|
1418
1429
|
};
|
|
1419
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));
|
|
1420
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);
|
|
1421
|
-
return u = $(u = X(u,
|
|
1432
|
+
return u = $(u = X(u, vt(u, {
|
|
1422
1433
|
left: o.left === void 0 ? void 0 : o.left - g * p,
|
|
1423
1434
|
top: o.top === void 0 ? void 0 : o.top - v * p,
|
|
1424
1435
|
bottom: o.bottom === void 0 ? void 0 : o.bottom + y * p,
|
|
@@ -1426,46 +1437,46 @@ function zt(e) {
|
|
|
1426
1437
|
})), a({
|
|
1427
1438
|
visibleArea: u,
|
|
1428
1439
|
type: "move"
|
|
1429
|
-
})), d.width *= p, d.height *= p, d.left = u.left + g * p, d.top = u.top + v * p, d = $(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({
|
|
1430
1441
|
visibleArea: u,
|
|
1431
1442
|
type: "move"
|
|
1432
|
-
})),
|
|
1443
|
+
})), gt(vt(d, q(u)))))), {
|
|
1433
1444
|
coordinates: d,
|
|
1434
1445
|
visibleArea: u
|
|
1435
1446
|
};
|
|
1436
1447
|
}
|
|
1437
|
-
function
|
|
1438
|
-
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 =
|
|
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 = W({}, r), d = W({}, i), f = St(J(W({
|
|
1439
1450
|
left: 0,
|
|
1440
1451
|
top: 0
|
|
1441
1452
|
}, c)), l);
|
|
1442
|
-
return (u = W(W({},
|
|
1453
|
+
return (u = W(W({}, At({
|
|
1443
1454
|
sizeRestrictions: a,
|
|
1444
1455
|
aspectRatio: t,
|
|
1445
1456
|
width: u.width,
|
|
1446
1457
|
height: u.height
|
|
1447
|
-
})),
|
|
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({
|
|
1448
1459
|
visibleArea: d,
|
|
1449
1460
|
type: "resize"
|
|
1450
1461
|
}))), {
|
|
1451
1462
|
coordinates: u = $(u, o),
|
|
1452
|
-
visibleArea: d = $(d = X(d,
|
|
1463
|
+
visibleArea: d = $(d = X(d, mt(J(u), J(r))), n({
|
|
1453
1464
|
visibleArea: d,
|
|
1454
1465
|
type: "move"
|
|
1455
1466
|
}))
|
|
1456
1467
|
};
|
|
1457
1468
|
}
|
|
1458
|
-
function
|
|
1469
|
+
function Ut(e) {
|
|
1459
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;
|
|
1460
1471
|
if (u || d) {
|
|
1461
|
-
var f =
|
|
1472
|
+
var f = St({
|
|
1462
1473
|
left: s.width / 2,
|
|
1463
1474
|
top: s.height / 2
|
|
1464
|
-
}, -r), p =
|
|
1475
|
+
}, -r), p = St(J(c), -r), m = St({
|
|
1465
1476
|
left: u ? f.left - (p.left - f.left) : p.left,
|
|
1466
1477
|
top: d ? f.top - (p.top - f.top) : p.top
|
|
1467
1478
|
}, r);
|
|
1468
|
-
c = X(c,
|
|
1479
|
+
c = X(c, mt(m, J(c))), p = St(J(l), -r), l = $(l = X(l, mt(m = St({
|
|
1469
1480
|
left: u ? f.left - (p.left - f.left) : p.left,
|
|
1470
1481
|
top: d ? f.top - (p.top - f.top) : p.top
|
|
1471
1482
|
}, r), J(l))), i({
|
|
@@ -1478,11 +1489,11 @@ function Vt(e) {
|
|
|
1478
1489
|
visibleArea: l
|
|
1479
1490
|
};
|
|
1480
1491
|
}
|
|
1481
|
-
function
|
|
1492
|
+
function Wt(e) {
|
|
1482
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;
|
|
1483
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)));
|
|
1484
|
-
var d =
|
|
1485
|
-
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));
|
|
1486
1497
|
var f = {
|
|
1487
1498
|
width: Infinity,
|
|
1488
1499
|
height: Infinity,
|
|
@@ -1509,19 +1520,19 @@ function Ht(e) {
|
|
|
1509
1520
|
m !== Infinity && K.forEach((function(e) {
|
|
1510
1521
|
c[e] *= m;
|
|
1511
1522
|
}));
|
|
1512
|
-
} else f.width !== Infinity &&
|
|
1523
|
+
} else f.width !== Infinity && ct.forEach((function(e) {
|
|
1513
1524
|
c[e] *= f.width;
|
|
1514
|
-
})), f.height !== Infinity &&
|
|
1525
|
+
})), f.height !== Infinity && lt.forEach((function(e) {
|
|
1515
1526
|
c[e] *= f.height;
|
|
1516
1527
|
}));
|
|
1517
1528
|
return c;
|
|
1518
1529
|
}
|
|
1519
|
-
function
|
|
1530
|
+
function Gt(e, t, n) {
|
|
1520
1531
|
return t == 0 && n == 0 ? e / 2 : t == 0 ? 0 : n == 0 ? e : e * Math.abs(t / (t + n));
|
|
1521
1532
|
}
|
|
1522
|
-
var
|
|
1533
|
+
var Kt = U("vue-simple-handler"), qt = U("vue-simple-handler-wrapper"), Jt = {
|
|
1523
1534
|
name: "SimpleHandler",
|
|
1524
|
-
components: { HandlerWrapper:
|
|
1535
|
+
components: { HandlerWrapper: at },
|
|
1525
1536
|
props: {
|
|
1526
1537
|
defaultClass: { type: String },
|
|
1527
1538
|
hoverClass: { type: String },
|
|
@@ -1539,8 +1550,8 @@ var Wt = U("vue-simple-handler"), Gt = U("vue-simple-handler-wrapper"), Kt = {
|
|
|
1539
1550
|
computed: { classes: function() {
|
|
1540
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);
|
|
1541
1552
|
return {
|
|
1542
|
-
default: H(
|
|
1543
|
-
wrapper: H(
|
|
1553
|
+
default: H(Kt(t), this.defaultClass, this.hover && this.hoverClass),
|
|
1554
|
+
wrapper: H(qt(t), this.wrapperClass)
|
|
1544
1555
|
};
|
|
1545
1556
|
} },
|
|
1546
1557
|
methods: {
|
|
@@ -1559,7 +1570,7 @@ var Wt = U("vue-simple-handler"), Gt = U("vue-simple-handler-wrapper"), Kt = {
|
|
|
1559
1570
|
},
|
|
1560
1571
|
emits: ["drag", "drag-end"]
|
|
1561
1572
|
};
|
|
1562
|
-
|
|
1573
|
+
Jt.render = function(e, t, n, r, i, a) {
|
|
1563
1574
|
var l = s("HandlerWrapper");
|
|
1564
1575
|
return o(), v(l, {
|
|
1565
1576
|
class: a.classes.wrapper,
|
|
@@ -1586,9 +1597,9 @@ Kt.render = function(e, t, n, r, i, a) {
|
|
|
1586
1597
|
"onLeave"
|
|
1587
1598
|
]);
|
|
1588
1599
|
};
|
|
1589
|
-
var
|
|
1600
|
+
var Yt = U("vue-simple-line"), Xt = U("vue-simple-line-wrapper"), Zt = {
|
|
1590
1601
|
name: "SimpleLine",
|
|
1591
|
-
components: { LineWrapper:
|
|
1602
|
+
components: { LineWrapper: st },
|
|
1592
1603
|
props: {
|
|
1593
1604
|
defaultClass: { type: String },
|
|
1594
1605
|
hoverClass: { type: String },
|
|
@@ -1604,8 +1615,8 @@ var qt = U("vue-simple-line"), Jt = U("vue-simple-line-wrapper"), Yt = {
|
|
|
1604
1615
|
},
|
|
1605
1616
|
computed: { classes: function() {
|
|
1606
1617
|
return {
|
|
1607
|
-
root: H(
|
|
1608
|
-
wrapper: H(
|
|
1618
|
+
root: H(Yt(V({}, this.position, !0)), this.defaultClass, this.hover && this.hoverClass),
|
|
1619
|
+
wrapper: H(Xt(V({}, this.position, !0)), this.wrapperClass)
|
|
1609
1620
|
};
|
|
1610
1621
|
} },
|
|
1611
1622
|
methods: {
|
|
@@ -1624,7 +1635,7 @@ var qt = U("vue-simple-line"), Jt = U("vue-simple-line-wrapper"), Yt = {
|
|
|
1624
1635
|
},
|
|
1625
1636
|
emits: ["drag", "drag-end"]
|
|
1626
1637
|
};
|
|
1627
|
-
|
|
1638
|
+
Zt.render = function(e, t, n, r, i, a) {
|
|
1628
1639
|
var l = s("LineWrapper");
|
|
1629
1640
|
return o(), v(l, {
|
|
1630
1641
|
class: a.classes.wrapper,
|
|
@@ -1649,15 +1660,15 @@ Yt.render = function(e, t, n, r, i, a) {
|
|
|
1649
1660
|
"onLeave"
|
|
1650
1661
|
]);
|
|
1651
1662
|
};
|
|
1652
|
-
var
|
|
1663
|
+
var Qt = U("vue-bounding-box"), $t = [
|
|
1653
1664
|
"east",
|
|
1654
1665
|
"west",
|
|
1655
1666
|
null
|
|
1656
|
-
],
|
|
1667
|
+
], en = [
|
|
1657
1668
|
"south",
|
|
1658
1669
|
"north",
|
|
1659
1670
|
null
|
|
1660
|
-
],
|
|
1671
|
+
], tn = {
|
|
1661
1672
|
name: "BoundingBox",
|
|
1662
1673
|
props: {
|
|
1663
1674
|
width: { type: Number },
|
|
@@ -1681,7 +1692,7 @@ var Xt = U("vue-bounding-box"), Zt = [
|
|
|
1681
1692
|
handlersComponent: {
|
|
1682
1693
|
type: [Object, String],
|
|
1683
1694
|
default: function() {
|
|
1684
|
-
return
|
|
1695
|
+
return Jt;
|
|
1685
1696
|
}
|
|
1686
1697
|
},
|
|
1687
1698
|
handlersClasses: {
|
|
@@ -1710,7 +1721,7 @@ var Xt = U("vue-bounding-box"), Zt = [
|
|
|
1710
1721
|
linesComponent: {
|
|
1711
1722
|
type: [Object, String],
|
|
1712
1723
|
default: function() {
|
|
1713
|
-
return
|
|
1724
|
+
return Zt;
|
|
1714
1725
|
}
|
|
1715
1726
|
},
|
|
1716
1727
|
linesClasses: {
|
|
@@ -1732,10 +1743,10 @@ var Xt = U("vue-bounding-box"), Zt = [
|
|
|
1732
1743
|
},
|
|
1733
1744
|
data: function() {
|
|
1734
1745
|
var e = [];
|
|
1735
|
-
return
|
|
1736
|
-
|
|
1746
|
+
return $t.forEach((function(t) {
|
|
1747
|
+
en.forEach((function(n) {
|
|
1737
1748
|
if (t !== n) {
|
|
1738
|
-
var r =
|
|
1749
|
+
var r = Ue(t, n);
|
|
1739
1750
|
e.push({
|
|
1740
1751
|
name: r.name,
|
|
1741
1752
|
classname: r.classname,
|
|
@@ -1754,7 +1765,7 @@ var Xt = U("vue-bounding-box"), Zt = [
|
|
|
1754
1765
|
classes: function() {
|
|
1755
1766
|
var e = this.handlersClasses, t = this.handlersWrappersClasses, n = this.linesClasses, r = this.linesWrappersClasses;
|
|
1756
1767
|
return {
|
|
1757
|
-
root:
|
|
1768
|
+
root: Qt(),
|
|
1758
1769
|
handlers: e,
|
|
1759
1770
|
handlersWrappers: t,
|
|
1760
1771
|
lines: n,
|
|
@@ -1792,8 +1803,8 @@ var Xt = U("vue-bounding-box"), Zt = [
|
|
|
1792
1803
|
};
|
|
1793
1804
|
if (n && r) {
|
|
1794
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;
|
|
1795
|
-
a.wrapperClass =
|
|
1796
|
-
} else a.wrapperClass =
|
|
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", V({}, i.classname, !0));
|
|
1797
1808
|
t.push(a);
|
|
1798
1809
|
}
|
|
1799
1810
|
})), t;
|
|
@@ -1819,7 +1830,7 @@ var Xt = U("vue-bounding-box"), Zt = [
|
|
|
1819
1830
|
top: 0,
|
|
1820
1831
|
bottom: 0
|
|
1821
1832
|
};
|
|
1822
|
-
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, {
|
|
1823
1834
|
allowedDirections: {
|
|
1824
1835
|
left: t === "west" || !t,
|
|
1825
1836
|
right: t === "east" || !t,
|
|
@@ -1833,7 +1844,7 @@ var Xt = U("vue-bounding-box"), Zt = [
|
|
|
1833
1844
|
},
|
|
1834
1845
|
emits: ["resize", "resize-end"]
|
|
1835
1846
|
};
|
|
1836
|
-
|
|
1847
|
+
tn.render = function(e, t, n, r, s, c) {
|
|
1837
1848
|
return o(), v("div", {
|
|
1838
1849
|
ref: "box",
|
|
1839
1850
|
class: c.classes.root,
|
|
@@ -1893,7 +1904,7 @@ $t.render = function(e, t, n, r, s, c) {
|
|
|
1893
1904
|
})), 128))
|
|
1894
1905
|
], 6);
|
|
1895
1906
|
};
|
|
1896
|
-
var
|
|
1907
|
+
var nn = U("vue-draggable-area"), rn = {
|
|
1897
1908
|
name: "DraggableArea",
|
|
1898
1909
|
props: {
|
|
1899
1910
|
movable: {
|
|
@@ -1906,7 +1917,7 @@ var en = U("vue-draggable-area"), tn = {
|
|
|
1906
1917
|
}
|
|
1907
1918
|
},
|
|
1908
1919
|
computed: { classnames: function() {
|
|
1909
|
-
return { default:
|
|
1920
|
+
return { default: nn() };
|
|
1910
1921
|
} },
|
|
1911
1922
|
beforeMount: function() {
|
|
1912
1923
|
window.addEventListener("mouseup", this.onMouseUp, { passive: !1 }), window.addEventListener("mousemove", this.onMouseMove, { passive: !1 }), window.addEventListener("touchmove", this.onTouchMove, { passive: !1 }), window.addEventListener("touchend", this.onTouchEnd, { passive: !1 });
|
|
@@ -1921,14 +1932,14 @@ var en = U("vue-draggable-area"), tn = {
|
|
|
1921
1932
|
onTouchStart: function(e) {
|
|
1922
1933
|
if (e.cancelable) {
|
|
1923
1934
|
var t = this.movable && e.touches.length === 1;
|
|
1924
|
-
t && (this.touches =
|
|
1935
|
+
t && (this.touches = Ie(e.touches)), (this.touchStarted || t) && (e.preventDefault(), e.stopPropagation());
|
|
1925
1936
|
}
|
|
1926
1937
|
},
|
|
1927
1938
|
onTouchEnd: function() {
|
|
1928
1939
|
this.touchStarted = !1, this.processEnd();
|
|
1929
1940
|
},
|
|
1930
1941
|
onTouchMove: function(e) {
|
|
1931
|
-
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({
|
|
1932
1943
|
x: this.touches[0].clientX,
|
|
1933
1944
|
y: this.touches[0].clientY
|
|
1934
1945
|
}, {
|
|
@@ -1967,10 +1978,10 @@ var en = U("vue-draggable-area"), tn = {
|
|
|
1967
1978
|
};
|
|
1968
1979
|
},
|
|
1969
1980
|
processMove: function(e, t) {
|
|
1970
|
-
var n =
|
|
1981
|
+
var n = Ie(t);
|
|
1971
1982
|
if (this.touches.length) {
|
|
1972
1983
|
var r = this.$refs.container.getBoundingClientRect(), i = r.left, a = r.top;
|
|
1973
|
-
this.touches.length === 1 && n.length === 1 && this.$emit("move", new
|
|
1984
|
+
this.touches.length === 1 && n.length === 1 && this.$emit("move", new tt({
|
|
1974
1985
|
left: n[0].clientX - (i + this.anchor.x),
|
|
1975
1986
|
top: n[0].clientY - (a + this.anchor.y)
|
|
1976
1987
|
}));
|
|
@@ -1982,7 +1993,7 @@ var en = U("vue-draggable-area"), tn = {
|
|
|
1982
1993
|
},
|
|
1983
1994
|
emits: ["move", "move-end"]
|
|
1984
1995
|
};
|
|
1985
|
-
|
|
1996
|
+
rn.render = function(e, t, n, r, i, s) {
|
|
1986
1997
|
return o(), v("div", {
|
|
1987
1998
|
ref: "container",
|
|
1988
1999
|
onTouchstart: t[1] ||= function() {
|
|
@@ -1993,7 +2004,7 @@ tn.render = function(e, t, n, r, i, s) {
|
|
|
1993
2004
|
}
|
|
1994
2005
|
}, [a(e.$slots, "default")], 544);
|
|
1995
2006
|
};
|
|
1996
|
-
function
|
|
2007
|
+
function an(e) {
|
|
1997
2008
|
return {
|
|
1998
2009
|
rotate: e.rotate || 0,
|
|
1999
2010
|
flip: {
|
|
@@ -2002,7 +2013,7 @@ function nn(e) {
|
|
|
2002
2013
|
}
|
|
2003
2014
|
};
|
|
2004
2015
|
}
|
|
2005
|
-
function
|
|
2016
|
+
function on(e) {
|
|
2006
2017
|
return new Promise((function(t, n) {
|
|
2007
2018
|
try {
|
|
2008
2019
|
if (e) if (/^data:/i.test(e)) t(function(e) {
|
|
@@ -2034,11 +2045,11 @@ function rn(e) {
|
|
|
2034
2045
|
var a, o, s;
|
|
2035
2046
|
}));
|
|
2036
2047
|
}
|
|
2037
|
-
function
|
|
2048
|
+
function sn(e) {
|
|
2038
2049
|
var t = e.rotate, n = e.flip, r = e.scaleX, i = e.scaleY, a = "";
|
|
2039
2050
|
return a += " rotate(" + t + "deg) ", a += " scaleX(" + r * (n.horizontal ? -1 : 1) + ") ", a += " scaleY(" + i * (n.vertical ? -1 : 1) + ") ";
|
|
2040
2051
|
}
|
|
2041
|
-
function
|
|
2052
|
+
function cn(e) {
|
|
2042
2053
|
try {
|
|
2043
2054
|
var t, n = new DataView(e), r = void 0, i = void 0, a = void 0, o = void 0;
|
|
2044
2055
|
if (n.getUint8(0) === 255 && n.getUint8(1) === 216) for (var s = n.byteLength, c = 2; c + 1 < s;) {
|
|
@@ -2070,7 +2081,7 @@ function on(e) {
|
|
|
2070
2081
|
return null;
|
|
2071
2082
|
}
|
|
2072
2083
|
}
|
|
2073
|
-
var
|
|
2084
|
+
var ln = U("vue-preview-result"), un = {
|
|
2074
2085
|
name: "PreviewResult",
|
|
2075
2086
|
props: {
|
|
2076
2087
|
image: { type: Object },
|
|
@@ -2091,10 +2102,10 @@ var sn = U("vue-preview-result"), cn = {
|
|
|
2091
2102
|
computed: {
|
|
2092
2103
|
classes: function() {
|
|
2093
2104
|
return {
|
|
2094
|
-
root:
|
|
2095
|
-
wrapper:
|
|
2096
|
-
imageWrapper:
|
|
2097
|
-
image: H(
|
|
2105
|
+
root: ln(),
|
|
2106
|
+
wrapper: ln("wrapper"),
|
|
2107
|
+
imageWrapper: ln("image-wrapper"),
|
|
2108
|
+
image: H(ln("image"), this.imageClass)
|
|
2098
2109
|
};
|
|
2099
2110
|
},
|
|
2100
2111
|
wrapperStyle: function() {
|
|
@@ -2107,7 +2118,7 @@ var sn = U("vue-preview-result"), cn = {
|
|
|
2107
2118
|
return this.transitions && this.transitions.enabled && (e.transition = `${this.transitions.time}ms ${this.transitions.timingFunction}`), e;
|
|
2108
2119
|
},
|
|
2109
2120
|
imageStyle: function() {
|
|
2110
|
-
var e = this.image.transforms, t =
|
|
2121
|
+
var e = this.image.transforms, t = xt({
|
|
2111
2122
|
width: this.image.width,
|
|
2112
2123
|
height: this.image.height
|
|
2113
2124
|
}, e.rotate), n = {
|
|
@@ -2123,11 +2134,11 @@ var sn = U("vue-preview-result"), cn = {
|
|
|
2123
2134
|
top: (1 - e.scaleY) * this.image.height / 2
|
|
2124
2135
|
};
|
|
2125
2136
|
return n.transform = `translate(
|
|
2126
|
-
${-this.stencilCoordinates.left - e.translateX - r.left - i.left}px,${-this.stencilCoordinates.top - e.translateY - r.top - i.top}px) ` +
|
|
2137
|
+
${-this.stencilCoordinates.left - e.translateX - r.left - i.left}px,${-this.stencilCoordinates.top - e.translateY - r.top - i.top}px) ` + sn(e), this.transitions && this.transitions.enabled && (n.transition = `${this.transitions.time}ms ${this.transitions.timingFunction}`), n;
|
|
2127
2138
|
}
|
|
2128
2139
|
}
|
|
2129
2140
|
};
|
|
2130
|
-
function
|
|
2141
|
+
function dn(e, t) {
|
|
2131
2142
|
var n = t.getBoundingClientRect(), r = n.left, i = n.top, a = {
|
|
2132
2143
|
left: 0,
|
|
2133
2144
|
top: 0
|
|
@@ -2135,7 +2146,7 @@ function ln(e, t) {
|
|
|
2135
2146
|
return e.forEach((function(t) {
|
|
2136
2147
|
a.left += (t.clientX - r) / e.length, a.top += (t.clientY - i) / e.length;
|
|
2137
2148
|
})), e.forEach((function(e) {
|
|
2138
|
-
o +=
|
|
2149
|
+
o += Qe({
|
|
2139
2150
|
x: a.left,
|
|
2140
2151
|
y: a.top
|
|
2141
2152
|
}, {
|
|
@@ -2148,7 +2159,7 @@ function ln(e, t) {
|
|
|
2148
2159
|
count: e.length
|
|
2149
2160
|
};
|
|
2150
2161
|
}
|
|
2151
|
-
|
|
2162
|
+
un.render = function(e, t, n, r, i, a) {
|
|
2152
2163
|
return o(), v("div", { class: a.classes.root }, [k("div", {
|
|
2153
2164
|
ref: "wrapper",
|
|
2154
2165
|
class: a.classes.wrapper,
|
|
@@ -2160,7 +2171,7 @@ cn.render = function(e, t, n, r, i, a) {
|
|
|
2160
2171
|
style: a.imageStyle
|
|
2161
2172
|
}, null, 14, ["src"])], 6)], 2);
|
|
2162
2173
|
};
|
|
2163
|
-
var
|
|
2174
|
+
var fn = {
|
|
2164
2175
|
props: {
|
|
2165
2176
|
touchMove: {
|
|
2166
2177
|
type: Boolean,
|
|
@@ -2190,18 +2201,18 @@ var un = {
|
|
|
2190
2201
|
window.removeEventListener("mouseup", this.onMouseUp), window.removeEventListener("mousemove", this.onMouseMove), window.removeEventListener("touchmove", this.onTouchMove), window.removeEventListener("touchend", this.onTouchEnd);
|
|
2191
2202
|
},
|
|
2192
2203
|
created: function() {
|
|
2193
|
-
this.transforming = !1, this.debouncedProcessEnd =
|
|
2204
|
+
this.transforming = !1, this.debouncedProcessEnd = He(this.processEnd), this.touches = [];
|
|
2194
2205
|
},
|
|
2195
2206
|
methods: {
|
|
2196
2207
|
processMove: function(e, t) {
|
|
2197
2208
|
if (this.touches.length) {
|
|
2198
|
-
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({
|
|
2199
2210
|
left: this.touches[0].clientX - t[0].clientX,
|
|
2200
2211
|
top: this.touches[0].clientY - t[0].clientY
|
|
2201
2212
|
}));
|
|
2202
2213
|
else if (this.touches.length > 1 && this.touchResize) {
|
|
2203
|
-
var n =
|
|
2204
|
-
r.count === n.count && r.count > 1 && this.$emit("resize", new
|
|
2214
|
+
var n = dn(t, this.$refs.container), r = this.oldGeometricProperties;
|
|
2215
|
+
r.count === n.count && r.count > 1 && this.$emit("resize", new $e({
|
|
2205
2216
|
left: r.centerMass.left - n.centerMass.left,
|
|
2206
2217
|
top: r.centerMass.top - n.centerMass.top
|
|
2207
2218
|
}, {
|
|
@@ -2224,9 +2235,9 @@ var un = {
|
|
|
2224
2235
|
onTouchStart: function(e) {
|
|
2225
2236
|
if (e.cancelable && (this.touchMove || this.touchResize && e.touches.length > 1) && this.processEvent(e)) {
|
|
2226
2237
|
var t = this.$refs.container, n = t.getBoundingClientRect(), r = n.left, i = n.top, a = n.bottom, o = n.right;
|
|
2227
|
-
this.touches =
|
|
2238
|
+
this.touches = Ie(e.touches).filter((function(e) {
|
|
2228
2239
|
return e.clientX > r && e.clientX < o && e.clientY > i && e.clientY < a;
|
|
2229
|
-
})), this.oldGeometricProperties =
|
|
2240
|
+
})), this.oldGeometricProperties = dn(this.touches, t);
|
|
2230
2241
|
}
|
|
2231
2242
|
},
|
|
2232
2243
|
onTouchEnd: function(e) {
|
|
@@ -2235,7 +2246,7 @@ var un = {
|
|
|
2235
2246
|
onTouchMove: function(e) {
|
|
2236
2247
|
var t = this;
|
|
2237
2248
|
if (this.touches.length) {
|
|
2238
|
-
var n =
|
|
2249
|
+
var n = Ie(e.touches).filter((function(e) {
|
|
2239
2250
|
return !e.identifier || t.touches.find((function(t) {
|
|
2240
2251
|
return t.identifier === e.identifier;
|
|
2241
2252
|
}));
|
|
@@ -2264,11 +2275,11 @@ var un = {
|
|
|
2264
2275
|
},
|
|
2265
2276
|
onWheel: function(e) {
|
|
2266
2277
|
if (this.wheelResize && this.processEvent(e)) {
|
|
2267
|
-
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 = {
|
|
2268
2279
|
left: e.clientX - n,
|
|
2269
2280
|
top: e.clientY - r
|
|
2270
2281
|
};
|
|
2271
|
-
this.$emit("resize", new
|
|
2282
|
+
this.$emit("resize", new $e({}, {
|
|
2272
2283
|
factor: i,
|
|
2273
2284
|
center: a
|
|
2274
2285
|
})), this.touches.length || this.debouncedProcessEnd();
|
|
@@ -2282,7 +2293,7 @@ var un = {
|
|
|
2282
2293
|
"transform-end"
|
|
2283
2294
|
]
|
|
2284
2295
|
};
|
|
2285
|
-
|
|
2296
|
+
fn.render = function(e, t, n, r, i, s) {
|
|
2286
2297
|
return o(), v("div", {
|
|
2287
2298
|
ref: "container",
|
|
2288
2299
|
onTouchstart: t[1] ||= function() {
|
|
@@ -2296,8 +2307,8 @@ un.render = function(e, t, n, r, i, s) {
|
|
|
2296
2307
|
}
|
|
2297
2308
|
}, [a(e.$slots, "default")], 544);
|
|
2298
2309
|
};
|
|
2299
|
-
var
|
|
2300
|
-
components: { TransformableImage:
|
|
2310
|
+
var pn = {
|
|
2311
|
+
components: { TransformableImage: fn },
|
|
2301
2312
|
props: {
|
|
2302
2313
|
touchMove: {
|
|
2303
2314
|
type: Boolean,
|
|
@@ -2318,7 +2329,7 @@ var dn = {
|
|
|
2318
2329
|
},
|
|
2319
2330
|
emits: ["resize", "move"]
|
|
2320
2331
|
};
|
|
2321
|
-
|
|
2332
|
+
pn.render = function(e, t, n, r, i, l) {
|
|
2322
2333
|
var u = s("transformable-image");
|
|
2323
2334
|
return o(), v(u, {
|
|
2324
2335
|
"touch-move": n.touchMove,
|
|
@@ -2343,7 +2354,7 @@ dn.render = function(e, t, n, r, i, l) {
|
|
|
2343
2354
|
"wheel-resize"
|
|
2344
2355
|
]);
|
|
2345
2356
|
};
|
|
2346
|
-
var
|
|
2357
|
+
var mn = U("vue-preview"), hn = {
|
|
2347
2358
|
props: {
|
|
2348
2359
|
coordinates: { type: Object },
|
|
2349
2360
|
transitions: { type: Object },
|
|
@@ -2373,10 +2384,10 @@ var fn = U("vue-preview"), pn = {
|
|
|
2373
2384
|
computed: {
|
|
2374
2385
|
classes: function() {
|
|
2375
2386
|
return {
|
|
2376
|
-
root:
|
|
2377
|
-
wrapper:
|
|
2378
|
-
imageWrapper:
|
|
2379
|
-
image: H(
|
|
2387
|
+
root: mn({ fill: this.fill }),
|
|
2388
|
+
wrapper: mn("wrapper"),
|
|
2389
|
+
imageWrapper: mn("image-wrapper"),
|
|
2390
|
+
image: H(mn("image"), this.imageClass)
|
|
2380
2391
|
};
|
|
2381
2392
|
},
|
|
2382
2393
|
style: function() {
|
|
@@ -2404,7 +2415,7 @@ var fn = U("vue-preview"), pn = {
|
|
|
2404
2415
|
}, this.image.transforms), {}, {
|
|
2405
2416
|
scaleX: 1 / e,
|
|
2406
2417
|
scaleY: 1 / e
|
|
2407
|
-
}), n = this.imageSize.width, r = this.imageSize.height, i =
|
|
2418
|
+
}), n = this.imageSize.width, r = this.imageSize.height, i = xt({
|
|
2408
2419
|
width: n,
|
|
2409
2420
|
height: r
|
|
2410
2421
|
}, t.rotate), a = {
|
|
@@ -2423,7 +2434,7 @@ var fn = U("vue-preview"), pn = {
|
|
|
2423
2434
|
}
|
|
2424
2435
|
};
|
|
2425
2436
|
return a.transform = `translate(
|
|
2426
|
-
${-this.coordinates.left / e - o.rotate.left - o.scale.left}px,${-this.coordinates.top / e - o.rotate.top - o.scale.top}px) ` +
|
|
2437
|
+
${-this.coordinates.left / e - o.rotate.left - o.scale.left}px,${-this.coordinates.top / e - o.rotate.top - o.scale.top}px) ` + sn(t), this.transitions && this.transitions.enabled && (a.transition = `${this.transitions.time}ms ${this.transitions.timingFunction}`), a;
|
|
2427
2438
|
}
|
|
2428
2439
|
return {};
|
|
2429
2440
|
},
|
|
@@ -2467,7 +2478,7 @@ var fn = U("vue-preview"), pn = {
|
|
|
2467
2478
|
}
|
|
2468
2479
|
}
|
|
2469
2480
|
};
|
|
2470
|
-
|
|
2481
|
+
hn.render = function(e, t, r, i, a, s) {
|
|
2471
2482
|
return o(), v("div", {
|
|
2472
2483
|
ref: "root",
|
|
2473
2484
|
class: s.classes.root,
|
|
@@ -2483,20 +2494,20 @@ pn.render = function(e, t, r, i, a, s) {
|
|
|
2483
2494
|
style: s.imageStyle
|
|
2484
2495
|
}, null, 14, ["src"]), [[x, r.image && r.image.src]])], 6)], 6);
|
|
2485
2496
|
};
|
|
2486
|
-
var
|
|
2487
|
-
components: { Preview:
|
|
2497
|
+
var gn = {
|
|
2498
|
+
components: { Preview: hn },
|
|
2488
2499
|
inheritAttrs: !1
|
|
2489
2500
|
};
|
|
2490
|
-
|
|
2501
|
+
gn.render = function(e, t, n, r, i, a) {
|
|
2491
2502
|
var c = s("preview");
|
|
2492
2503
|
return o(), v(c, b(e.$attrs, { fill: !0 }), null, 16);
|
|
2493
2504
|
};
|
|
2494
|
-
var
|
|
2505
|
+
var _n = U("vue-rectangle-stencil"), vn = {
|
|
2495
2506
|
name: "RectangleStencil",
|
|
2496
2507
|
components: {
|
|
2497
|
-
StencilPreview:
|
|
2498
|
-
BoundingBox:
|
|
2499
|
-
DraggableArea:
|
|
2508
|
+
StencilPreview: gn,
|
|
2509
|
+
BoundingBox: tn,
|
|
2510
|
+
DraggableArea: rn
|
|
2500
2511
|
},
|
|
2501
2512
|
props: {
|
|
2502
2513
|
image: { type: Object },
|
|
@@ -2506,14 +2517,14 @@ var hn = U("vue-rectangle-stencil"), gn = {
|
|
|
2506
2517
|
handlersComponent: {
|
|
2507
2518
|
type: [Object, String],
|
|
2508
2519
|
default: function() {
|
|
2509
|
-
return
|
|
2520
|
+
return Jt;
|
|
2510
2521
|
}
|
|
2511
2522
|
},
|
|
2512
2523
|
lines: { type: Object },
|
|
2513
2524
|
linesComponent: {
|
|
2514
2525
|
type: [Object, String],
|
|
2515
2526
|
default: function() {
|
|
2516
|
-
return
|
|
2527
|
+
return Zt;
|
|
2517
2528
|
}
|
|
2518
2529
|
},
|
|
2519
2530
|
aspectRatio: { type: [Number, String] },
|
|
@@ -2566,13 +2577,13 @@ var hn = U("vue-rectangle-stencil"), gn = {
|
|
|
2566
2577
|
computed: {
|
|
2567
2578
|
classes: function() {
|
|
2568
2579
|
return {
|
|
2569
|
-
stencil: H(
|
|
2580
|
+
stencil: H(_n({
|
|
2570
2581
|
movable: this.movable,
|
|
2571
2582
|
moving: this.moving,
|
|
2572
2583
|
resizing: this.resizing
|
|
2573
2584
|
}), this.moving && this.movingClass, this.resizing && this.resizingClass),
|
|
2574
|
-
preview: H(
|
|
2575
|
-
boundingBox: H(
|
|
2585
|
+
preview: H(_n("preview"), this.previewClass),
|
|
2586
|
+
boundingBox: H(_n("bounding-box"), this.boundingBoxClass)
|
|
2576
2587
|
};
|
|
2577
2588
|
},
|
|
2578
2589
|
style: function() {
|
|
@@ -2611,7 +2622,7 @@ var hn = U("vue-rectangle-stencil"), gn = {
|
|
|
2611
2622
|
"move-end"
|
|
2612
2623
|
]
|
|
2613
2624
|
};
|
|
2614
|
-
|
|
2625
|
+
vn.render = function(e, t, n, r, i, a) {
|
|
2615
2626
|
var l = s("stencil-preview"), u = s("draggable-area"), d = s("bounding-box");
|
|
2616
2627
|
return o(), v("div", {
|
|
2617
2628
|
class: a.classes.stencil,
|
|
@@ -2682,11 +2693,11 @@ gn.render = function(e, t, n, r, i, a) {
|
|
|
2682
2693
|
"onResizeEnd"
|
|
2683
2694
|
])], 6);
|
|
2684
2695
|
};
|
|
2685
|
-
var
|
|
2696
|
+
var yn = U("vue-circle-stencil"), bn = {
|
|
2686
2697
|
components: {
|
|
2687
|
-
StencilPreview:
|
|
2688
|
-
BoundingBox:
|
|
2689
|
-
DraggableArea:
|
|
2698
|
+
StencilPreview: gn,
|
|
2699
|
+
BoundingBox: tn,
|
|
2700
|
+
DraggableArea: rn
|
|
2690
2701
|
},
|
|
2691
2702
|
props: {
|
|
2692
2703
|
image: { type: Object },
|
|
@@ -2706,7 +2717,7 @@ var _n = U("vue-circle-stencil"), vn = {
|
|
|
2706
2717
|
handlersComponent: {
|
|
2707
2718
|
type: [Object, String],
|
|
2708
2719
|
default: function() {
|
|
2709
|
-
return
|
|
2720
|
+
return Jt;
|
|
2710
2721
|
}
|
|
2711
2722
|
},
|
|
2712
2723
|
handlersClasses: {
|
|
@@ -2725,7 +2736,7 @@ var _n = U("vue-circle-stencil"), vn = {
|
|
|
2725
2736
|
linesComponent: {
|
|
2726
2737
|
type: [Object, String],
|
|
2727
2738
|
default: function() {
|
|
2728
|
-
return
|
|
2739
|
+
return Zt;
|
|
2729
2740
|
}
|
|
2730
2741
|
},
|
|
2731
2742
|
linesClasses: {
|
|
@@ -2763,13 +2774,13 @@ var _n = U("vue-circle-stencil"), vn = {
|
|
|
2763
2774
|
computed: {
|
|
2764
2775
|
classes: function() {
|
|
2765
2776
|
return {
|
|
2766
|
-
stencil: H(
|
|
2777
|
+
stencil: H(yn({
|
|
2767
2778
|
movable: this.movable,
|
|
2768
2779
|
moving: this.moving,
|
|
2769
2780
|
resizing: this.resizing
|
|
2770
2781
|
}), this.moving && this.movingClass, this.resizing && this.resizingClass),
|
|
2771
|
-
preview: H(
|
|
2772
|
-
boundingBox: H(
|
|
2782
|
+
preview: H(yn("preview"), this.previewClass),
|
|
2783
|
+
boundingBox: H(yn("bounding-box"), this.boundingBoxClass)
|
|
2773
2784
|
};
|
|
2774
2785
|
},
|
|
2775
2786
|
style: function() {
|
|
@@ -2808,7 +2819,7 @@ var _n = U("vue-circle-stencil"), vn = {
|
|
|
2808
2819
|
"move-end"
|
|
2809
2820
|
]
|
|
2810
2821
|
};
|
|
2811
|
-
|
|
2822
|
+
bn.render = function(e, t, n, r, i, a) {
|
|
2812
2823
|
var l = s("stencil-preview"), u = s("draggable-area"), d = s("bounding-box");
|
|
2813
2824
|
return o(), v("div", {
|
|
2814
2825
|
class: a.classes.stencil,
|
|
@@ -2879,9 +2890,9 @@ vn.render = function(e, t, n, r, i, a) {
|
|
|
2879
2890
|
"onResizeEnd"
|
|
2880
2891
|
])], 6);
|
|
2881
2892
|
};
|
|
2882
|
-
var
|
|
2893
|
+
var xn = ["transitions"], Sn = U("vue-advanced-cropper"), Cn = {
|
|
2883
2894
|
name: "Cropper",
|
|
2884
|
-
components: { BackgroundWrapper:
|
|
2895
|
+
components: { BackgroundWrapper: pn },
|
|
2885
2896
|
props: {
|
|
2886
2897
|
src: {
|
|
2887
2898
|
type: String,
|
|
@@ -2890,13 +2901,13 @@ var yn = ["transitions"], bn = U("vue-advanced-cropper"), xn = {
|
|
|
2890
2901
|
stencilComponent: {
|
|
2891
2902
|
type: [Object, String],
|
|
2892
2903
|
default: function() {
|
|
2893
|
-
return
|
|
2904
|
+
return vn;
|
|
2894
2905
|
}
|
|
2895
2906
|
},
|
|
2896
2907
|
backgroundWrapperComponent: {
|
|
2897
2908
|
type: [Object, String],
|
|
2898
2909
|
default: function() {
|
|
2899
|
-
return
|
|
2910
|
+
return pn;
|
|
2900
2911
|
}
|
|
2901
2912
|
},
|
|
2902
2913
|
stencilProps: {
|
|
@@ -2945,7 +2956,7 @@ var yn = ["transitions"], bn = U("vue-advanced-cropper"), xn = {
|
|
|
2945
2956
|
type: String,
|
|
2946
2957
|
default: "fit-area",
|
|
2947
2958
|
validator: function(e) {
|
|
2948
|
-
return
|
|
2959
|
+
return dt.indexOf(e) !== -1;
|
|
2949
2960
|
}
|
|
2950
2961
|
},
|
|
2951
2962
|
roundResult: {
|
|
@@ -2991,28 +3002,28 @@ var yn = ["transitions"], bn = U("vue-advanced-cropper"), xn = {
|
|
|
2991
3002
|
a.widthFrozen && (c.left = 0, c.right = 0), a.heightFrozen && (c.top = 0, c.bottom = 0), K.forEach((function(e) {
|
|
2992
3003
|
l[e] || (c[e] = 0);
|
|
2993
3004
|
}));
|
|
2994
|
-
var u = Y(o, c =
|
|
3005
|
+
var u = Y(o, c = Wt({
|
|
2995
3006
|
coordinates: o,
|
|
2996
3007
|
directions: c,
|
|
2997
3008
|
sizeRestrictions: a,
|
|
2998
3009
|
positionRestrictions: i
|
|
2999
|
-
})).width, d = Y(o, c).height, f = s.preserveRatio ? Q(o) :
|
|
3010
|
+
})).width, d = Y(o, c).height, f = s.preserveRatio ? Q(o) : yt(u / d, r);
|
|
3000
3011
|
if (f) {
|
|
3001
3012
|
var p = s.respectDirection;
|
|
3002
3013
|
if (p ||= o.width >= o.height || f === 1 ? "width" : "height", p === "width") {
|
|
3003
3014
|
var m = u / f - o.height;
|
|
3004
3015
|
if (l.top && l.bottom) {
|
|
3005
3016
|
var h = c.top, g = c.bottom;
|
|
3006
|
-
c.bottom =
|
|
3017
|
+
c.bottom = Gt(m, g, h), c.top = Gt(m, h, g);
|
|
3007
3018
|
} else l.bottom ? c.bottom = m : l.top ? c.top = m : l.right ? c.right = 0 : l.left && (c.left = 0);
|
|
3008
3019
|
} else if (p === "height") {
|
|
3009
3020
|
var _ = o.width - d * f;
|
|
3010
3021
|
if (l.left && l.right) {
|
|
3011
3022
|
var v = c.left, y = c.right;
|
|
3012
|
-
c.left = -
|
|
3023
|
+
c.left = -Gt(_, v, y), c.right = -Gt(_, y, v);
|
|
3013
3024
|
} else l.left ? c.left = -_ : l.right ? c.right = -_ : l.top ? c.top = 0 : l.bottom && (c.bottom = 0);
|
|
3014
3025
|
}
|
|
3015
|
-
c =
|
|
3026
|
+
c = Wt({
|
|
3016
3027
|
directions: c,
|
|
3017
3028
|
coordinates: o,
|
|
3018
3029
|
sizeRestrictions: a,
|
|
@@ -3021,10 +3032,10 @@ var yn = ["transitions"], bn = U("vue-advanced-cropper"), xn = {
|
|
|
3021
3032
|
compensate: s.compensate
|
|
3022
3033
|
});
|
|
3023
3034
|
}
|
|
3024
|
-
return u = Y(o, c).width, d = Y(o, c).height, (f = s.preserveRatio ? Q(o) :
|
|
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) {
|
|
3025
3036
|
l[e] || (c[e] = 0);
|
|
3026
|
-
})),
|
|
3027
|
-
event: new
|
|
3037
|
+
})), jt({
|
|
3038
|
+
event: new tt({
|
|
3028
3039
|
left: -c.left,
|
|
3029
3040
|
top: -c.top
|
|
3030
3041
|
}),
|
|
@@ -3040,7 +3051,7 @@ var yn = ["transitions"], bn = U("vue-advanced-cropper"), xn = {
|
|
|
3040
3051
|
},
|
|
3041
3052
|
moveAlgorithm: {
|
|
3042
3053
|
type: Function,
|
|
3043
|
-
default:
|
|
3054
|
+
default: jt
|
|
3044
3055
|
},
|
|
3045
3056
|
initStretcher: {
|
|
3046
3057
|
type: Function,
|
|
@@ -3052,7 +3063,7 @@ var yn = ["transitions"], bn = U("vue-advanced-cropper"), xn = {
|
|
|
3052
3063
|
fitCoordinates: {
|
|
3053
3064
|
type: Function,
|
|
3054
3065
|
default: function(e) {
|
|
3055
|
-
var t = e.visibleArea, n = e.coordinates, r = e.aspectRatio, i = e.sizeRestrictions, a = e.positionRestrictions, o = W(W({}, n),
|
|
3066
|
+
var t = e.visibleArea, n = e.coordinates, r = e.aspectRatio, i = e.sizeRestrictions, a = e.positionRestrictions, o = W(W({}, n), At({
|
|
3056
3067
|
width: n.width,
|
|
3057
3068
|
height: n.height,
|
|
3058
3069
|
aspectRatio: r,
|
|
@@ -3063,7 +3074,7 @@ var yn = ["transitions"], bn = U("vue-advanced-cropper"), xn = {
|
|
|
3063
3074
|
minWidth: Math.min(t.width, i.minWidth)
|
|
3064
3075
|
}
|
|
3065
3076
|
}));
|
|
3066
|
-
return o = $(o = X(o,
|
|
3077
|
+
return o = $(o = X(o, mt(J(n), J(o))), Dt(q(t), a));
|
|
3067
3078
|
}
|
|
3068
3079
|
},
|
|
3069
3080
|
fitVisibleArea: {
|
|
@@ -3071,7 +3082,7 @@ var yn = ["transitions"], bn = U("vue-advanced-cropper"), xn = {
|
|
|
3071
3082
|
default: function(e) {
|
|
3072
3083
|
var t = e.visibleArea, n = e.boundaries, r = e.getAreaRestrictions, i = e.coordinates, a = W({}, t);
|
|
3073
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)));
|
|
3074
|
-
var o =
|
|
3085
|
+
var o = gt(vt(i, q(a = Z(a, Ct(a, r({
|
|
3075
3086
|
visibleArea: a,
|
|
3076
3087
|
type: "resize"
|
|
3077
3088
|
}))))));
|
|
@@ -3152,7 +3163,7 @@ var yn = ["transitions"], bn = U("vue-advanced-cropper"), xn = {
|
|
|
3152
3163
|
height: 0
|
|
3153
3164
|
},
|
|
3154
3165
|
visibleArea: null,
|
|
3155
|
-
coordinates: B({},
|
|
3166
|
+
coordinates: B({}, ft)
|
|
3156
3167
|
};
|
|
3157
3168
|
},
|
|
3158
3169
|
computed: {
|
|
@@ -3190,7 +3201,7 @@ var yn = ["transitions"], bn = U("vue-advanced-cropper"), xn = {
|
|
|
3190
3201
|
return !!(this.visibleArea && this.imageLoaded);
|
|
3191
3202
|
},
|
|
3192
3203
|
settings: function() {
|
|
3193
|
-
var e =
|
|
3204
|
+
var e = Je(this.resizeImage, {
|
|
3194
3205
|
touch: !0,
|
|
3195
3206
|
wheel: { ratio: .1 },
|
|
3196
3207
|
adjustStencil: !0
|
|
@@ -3200,7 +3211,7 @@ var yn = ["transitions"], bn = U("vue-advanced-cropper"), xn = {
|
|
|
3200
3211
|
adjustStencil: !1
|
|
3201
3212
|
});
|
|
3202
3213
|
return {
|
|
3203
|
-
moveImage:
|
|
3214
|
+
moveImage: Je(this.moveImage, {
|
|
3204
3215
|
touch: !0,
|
|
3205
3216
|
mouse: !0
|
|
3206
3217
|
}, {
|
|
@@ -3231,10 +3242,10 @@ var yn = ["transitions"], bn = U("vue-advanced-cropper"), xn = {
|
|
|
3231
3242
|
if (this.boundaries.width && this.boundaries.height && this.imageSize.width && this.imageSize.height) {
|
|
3232
3243
|
var e = this.sizeRestrictionsAlgorithm({
|
|
3233
3244
|
imageSize: this.imageSize,
|
|
3234
|
-
minWidth: G(this.minWidth) ? 0 :
|
|
3235
|
-
minHeight: G(this.minHeight) ? 0 :
|
|
3236
|
-
maxWidth: G(this.maxWidth) ? Infinity :
|
|
3237
|
-
maxHeight: G(this.maxHeight) ? Infinity :
|
|
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)
|
|
3238
3249
|
});
|
|
3239
3250
|
if (e = function(e) {
|
|
3240
3251
|
var t = e.areaRestrictions, n = e.sizeRestrictions, r = e.boundaries, i = e.positionRestrictions, a = W(W({}, n), {
|
|
@@ -3244,7 +3255,7 @@ var yn = ["transitions"], bn = U("vue-advanced-cropper"), xn = {
|
|
|
3244
3255
|
maxHeight: n.maxHeight === void 0 ? Infinity : n.maxHeight
|
|
3245
3256
|
});
|
|
3246
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));
|
|
3247
|
-
var o =
|
|
3258
|
+
var o = wt(t), s = bt(r, o);
|
|
3248
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;
|
|
3249
3260
|
}({
|
|
3250
3261
|
sizeRestrictions: e,
|
|
@@ -3259,7 +3270,7 @@ var yn = ["transitions"], bn = U("vue-advanced-cropper"), xn = {
|
|
|
3259
3270
|
visibleArea: this.visibleArea,
|
|
3260
3271
|
stencilSize: this.getStencilSize()
|
|
3261
3272
|
}), this.visibleArea && this.stencilSize) {
|
|
3262
|
-
var t = this.getStencilSize(), n =
|
|
3273
|
+
var t = this.getStencilSize(), n = wt(this.getAreaRestrictions({
|
|
3263
3274
|
visibleArea: this.visibleArea,
|
|
3264
3275
|
type: "resize"
|
|
3265
3276
|
}));
|
|
@@ -3282,15 +3293,15 @@ var yn = ["transitions"], bn = U("vue-advanced-cropper"), xn = {
|
|
|
3282
3293
|
},
|
|
3283
3294
|
classes: function() {
|
|
3284
3295
|
return {
|
|
3285
|
-
cropper:
|
|
3286
|
-
image: H(
|
|
3287
|
-
stencil:
|
|
3288
|
-
boundaries: H(
|
|
3289
|
-
stretcher: H(
|
|
3290
|
-
background: H(
|
|
3291
|
-
foreground: H(
|
|
3292
|
-
imageWrapper: H(
|
|
3293
|
-
cropperWrapper: H(
|
|
3296
|
+
cropper: Sn(),
|
|
3297
|
+
image: H(Sn("image"), this.imageClass),
|
|
3298
|
+
stencil: Sn("stencil"),
|
|
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"))
|
|
3294
3305
|
};
|
|
3295
3306
|
},
|
|
3296
3307
|
stencilCoordinates: function() {
|
|
@@ -3335,7 +3346,7 @@ var yn = ["transitions"], bn = U("vue-advanced-cropper"), xn = {
|
|
|
3335
3346
|
height: `${e.height}px`,
|
|
3336
3347
|
left: "0px",
|
|
3337
3348
|
top: "0px",
|
|
3338
|
-
transform: `translate(${-t.left - n.left - this.imageTransforms.translateX}px, ${-t.top - n.top - this.imageTransforms.translateY}px)` +
|
|
3349
|
+
transform: `translate(${-t.left - n.left - this.imageTransforms.translateX}px, ${-t.top - n.top - this.imageTransforms.translateY}px)` + sn(r)
|
|
3339
3350
|
};
|
|
3340
3351
|
return this.transitionsOptions.enabled && (i.transition = `${this.transitionsOptions.time}ms ${this.transitionsOptions.timingFunction}`), i;
|
|
3341
3352
|
}
|
|
@@ -3376,7 +3387,7 @@ var yn = ["transitions"], bn = U("vue-advanced-cropper"), xn = {
|
|
|
3376
3387
|
}
|
|
3377
3388
|
},
|
|
3378
3389
|
created: function() {
|
|
3379
|
-
this.debouncedUpdate =
|
|
3390
|
+
this.debouncedUpdate = He(this.update, this.debounce), this.debouncedDisableTransitions = He(this.disableTransitions, this.transitionsOptions.time), this.awaiting = !1;
|
|
3380
3391
|
},
|
|
3381
3392
|
mounted: function() {
|
|
3382
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);
|
|
@@ -3412,7 +3423,7 @@ var yn = ["transitions"], bn = U("vue-advanced-cropper"), xn = {
|
|
|
3412
3423
|
},
|
|
3413
3424
|
zoom: function(e, t) {
|
|
3414
3425
|
var n = (arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}).transitions, r = n === void 0 || n;
|
|
3415
|
-
this.onManipulateImage(new
|
|
3426
|
+
this.onManipulateImage(new $e({}, {
|
|
3416
3427
|
factor: 1 / e,
|
|
3417
3428
|
center: t
|
|
3418
3429
|
}), {
|
|
@@ -3422,7 +3433,7 @@ var yn = ["transitions"], bn = U("vue-advanced-cropper"), xn = {
|
|
|
3422
3433
|
},
|
|
3423
3434
|
move: function(e, t) {
|
|
3424
3435
|
var n = (arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}).transitions, r = n === void 0 || n;
|
|
3425
|
-
this.onManipulateImage(new
|
|
3436
|
+
this.onManipulateImage(new $e({
|
|
3426
3437
|
left: e || 0,
|
|
3427
3438
|
top: t || 0
|
|
3428
3439
|
}), {
|
|
@@ -3466,13 +3477,13 @@ var yn = ["transitions"], bn = U("vue-advanced-cropper"), xn = {
|
|
|
3466
3477
|
};
|
|
3467
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);
|
|
3468
3479
|
}(B(B({}, this.getPublicProperties()), {}, {
|
|
3469
|
-
positionRestrictions:
|
|
3480
|
+
positionRestrictions: Bt(this.positionRestrictions, this.visibleArea),
|
|
3470
3481
|
coordinates: e
|
|
3471
3482
|
})) : e;
|
|
3472
3483
|
},
|
|
3473
3484
|
processAutoZoom: function(e, t, n, r) {
|
|
3474
3485
|
var i = this.autoZoomAlgorithm;
|
|
3475
|
-
i ||= this.stencilSize ?
|
|
3486
|
+
i ||= this.stencilSize ? Nt : this.autoZoom ? Pt : Ft;
|
|
3476
3487
|
var a = i({
|
|
3477
3488
|
event: {
|
|
3478
3489
|
type: e,
|
|
@@ -3487,10 +3498,10 @@ var yn = ["transitions"], bn = U("vue-advanced-cropper"), xn = {
|
|
|
3487
3498
|
sizeRestrictions: this.sizeRestrictions,
|
|
3488
3499
|
stencilSize: this.getStencilSize()
|
|
3489
3500
|
});
|
|
3490
|
-
return B(B({}, a), {}, { changed: !
|
|
3501
|
+
return B(B({}, a), {}, { changed: !pt(a.visibleArea, t) || !pt(a.coordinates, n) });
|
|
3491
3502
|
},
|
|
3492
3503
|
runAutoZoom: function(e) {
|
|
3493
|
-
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;
|
|
3494
3505
|
r && c && this.enableTransitions(), this.visibleArea = o, this.coordinates = s, r && c && this.debouncedDisableTransitions();
|
|
3495
3506
|
},
|
|
3496
3507
|
normalizeEvent: function(e) {
|
|
@@ -3517,7 +3528,7 @@ var yn = ["transitions"], bn = U("vue-advanced-cropper"), xn = {
|
|
|
3517
3528
|
}
|
|
3518
3529
|
if (t.type === "move") {
|
|
3519
3530
|
var a = W(W({}, t), { directions: W({}, t.directions) });
|
|
3520
|
-
return
|
|
3531
|
+
return ut.forEach((function(e) {
|
|
3521
3532
|
a.directions[e] *= r;
|
|
3522
3533
|
})), a;
|
|
3523
3534
|
}
|
|
@@ -3530,9 +3541,9 @@ var yn = ["transitions"], bn = U("vue-advanced-cropper"), xn = {
|
|
|
3530
3541
|
var r = n.rotate, i = n.flip, a = {
|
|
3531
3542
|
width: t.naturalWidth,
|
|
3532
3543
|
height: t.naturalHeight
|
|
3533
|
-
}, o =
|
|
3544
|
+
}, o = xt(a, r), s = e.getContext("2d");
|
|
3534
3545
|
e.height = o.height, e.width = o.width, s.save();
|
|
3535
|
-
var c =
|
|
3546
|
+
var c = St(J(W({
|
|
3536
3547
|
left: 0,
|
|
3537
3548
|
top: 0
|
|
3538
3549
|
}, a)), r);
|
|
@@ -3551,7 +3562,7 @@ var yn = ["transitions"], bn = U("vue-advanced-cropper"), xn = {
|
|
|
3551
3562
|
return t = e, !Number.isNaN(parseFloat(t)) && isFinite(t);
|
|
3552
3563
|
var t;
|
|
3553
3564
|
}));
|
|
3554
|
-
}, a =
|
|
3565
|
+
}, a = At({
|
|
3555
3566
|
sizeRestrictions: {
|
|
3556
3567
|
minWidth: i([r.width, r.minWidth]) || 0,
|
|
3557
3568
|
minHeight: i([r.height, r.minHeight]) || 0,
|
|
@@ -3585,8 +3596,8 @@ var yn = ["transitions"], bn = U("vue-advanced-cropper"), xn = {
|
|
|
3585
3596
|
this.$emit("change", this.getResult());
|
|
3586
3597
|
},
|
|
3587
3598
|
applyTransform: function(e) {
|
|
3588
|
-
var t = arguments.length > 1 && arguments[1] !== void 0 && arguments[1], n = this.visibleArea && t ?
|
|
3589
|
-
return
|
|
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
|
+
return Mt({
|
|
3590
3601
|
transform: e,
|
|
3591
3602
|
coordinates: this.coordinates,
|
|
3592
3603
|
imageSize: this.imageSize,
|
|
@@ -3601,23 +3612,23 @@ var yn = ["transitions"], bn = U("vue-advanced-cropper"), xn = {
|
|
|
3601
3612
|
if (this.$refs.image) {
|
|
3602
3613
|
this.$refs.cropper, this.$refs.image;
|
|
3603
3614
|
var t = this.defaultSize;
|
|
3604
|
-
t ||= this.stencilSize ?
|
|
3605
|
-
var n =
|
|
3615
|
+
t ||= this.stencilSize ? Rt : Lt, this.sizeRestrictions;
|
|
3616
|
+
var n = Ke(t) ? t({
|
|
3606
3617
|
boundaries: this.boundaries,
|
|
3607
3618
|
imageSize: this.imageSize,
|
|
3608
3619
|
aspectRatio: this.getAspectRatio(),
|
|
3609
3620
|
sizeRestrictions: this.sizeRestrictions,
|
|
3610
3621
|
stencilSize: this.getStencilSize(),
|
|
3611
3622
|
visibleArea: this.visibleArea
|
|
3612
|
-
}) : t, r = this.defaultPosition ||
|
|
3623
|
+
}) : t, r = this.defaultPosition || It, i = [n, function(t) {
|
|
3613
3624
|
var n = t.coordinates;
|
|
3614
|
-
return B({},
|
|
3625
|
+
return B({}, Ke(r) ? r({
|
|
3615
3626
|
coordinates: n,
|
|
3616
3627
|
imageSize: e.imageSize,
|
|
3617
3628
|
visibleArea: e.visibleArea
|
|
3618
3629
|
}) : e.defaultPosition);
|
|
3619
3630
|
}];
|
|
3620
|
-
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;
|
|
3621
3632
|
}
|
|
3622
3633
|
},
|
|
3623
3634
|
clearImage: function() {
|
|
@@ -3647,7 +3658,7 @@ var yn = ["transitions"], bn = U("vue-advanced-cropper"), xn = {
|
|
|
3647
3658
|
cropper: n,
|
|
3648
3659
|
imageSize: e.imageSize
|
|
3649
3660
|
};
|
|
3650
|
-
if (
|
|
3661
|
+
if (Ke(e.defaultBoundaries) ? e.boundaries = e.defaultBoundaries(t) : e.defaultBoundaries === "fit" ? e.boundaries = function(e) {
|
|
3651
3662
|
var t = e.cropper, n = e.imageSize, r = t.clientHeight, i = t.clientWidth, a = r, o = n.width * r / n.height;
|
|
3652
3663
|
return o > i && (o = i, a = n.height * i / n.width), {
|
|
3653
3664
|
width: o,
|
|
@@ -3666,8 +3677,8 @@ var yn = ["transitions"], bn = U("vue-advanced-cropper"), xn = {
|
|
|
3666
3677
|
var e = this;
|
|
3667
3678
|
return this.appliedImageTransforms = B(B({}, this.defaultImageTransforms), {}, { flip: B({}, this.defaultImageTransforms.flip) }), this.updateBoundaries().then((function() {
|
|
3668
3679
|
e.priority !== "visible-area" && (e.visibleArea = null, e.resetCoordinates());
|
|
3669
|
-
var t, n, r, i, a, o, s = e.defaultVisibleArea ||
|
|
3670
|
-
e.visibleArea =
|
|
3680
|
+
var t, n, r, i, a, o, s = e.defaultVisibleArea || zt;
|
|
3681
|
+
e.visibleArea = Ke(s) ? s({
|
|
3671
3682
|
imageSize: e.imageSize,
|
|
3672
3683
|
boundaries: e.boundaries,
|
|
3673
3684
|
coordinates: e.priority === "visible-area" ? null : e.coordinates,
|
|
@@ -3718,7 +3729,7 @@ var yn = ["transitions"], bn = U("vue-advanced-cropper"), xn = {
|
|
|
3718
3729
|
var e, t = this;
|
|
3719
3730
|
if (this.imageLoaded = !1, this.delayedTransforms = null, this.src) {
|
|
3720
3731
|
if (function(e) {
|
|
3721
|
-
if (
|
|
3732
|
+
if (Ge(e)) return !1;
|
|
3722
3733
|
var t = window.location, n = /(\w+:)?(?:\/\/)([\w.-]+)?(?::(\d+))?\/?/.exec(e) || [], r = {
|
|
3723
3734
|
protocol: n[1] || "",
|
|
3724
3735
|
host: n[2] || "",
|
|
@@ -3733,8 +3744,8 @@ var yn = ["transitions"], bn = U("vue-advanced-cropper"), xn = {
|
|
|
3733
3744
|
}
|
|
3734
3745
|
if (this.checkOrientation) {
|
|
3735
3746
|
var r = (e = this.src, new Promise((function(t) {
|
|
3736
|
-
|
|
3737
|
-
var r =
|
|
3747
|
+
on(e).then((function(n) {
|
|
3748
|
+
var r = cn(n);
|
|
3738
3749
|
t(n ? {
|
|
3739
3750
|
source: e,
|
|
3740
3751
|
arrayBuffer: n,
|
|
@@ -3771,14 +3782,14 @@ var yn = ["transitions"], bn = U("vue-advanced-cropper"), xn = {
|
|
|
3771
3782
|
},
|
|
3772
3783
|
onParseImage: function(e) {
|
|
3773
3784
|
var t = this, n = e.source, r = e.arrayBuffer, i = e.orientation;
|
|
3774
|
-
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) {
|
|
3775
3786
|
for (var t = [], n = new Uint8Array(e); n.length > 0;) {
|
|
3776
3787
|
var r = n.subarray(0, 8192);
|
|
3777
3788
|
t.push(String.fromCharCode.apply(null, Array.from ? Array.from(r) : r.slice())), n = n.subarray(8192);
|
|
3778
3789
|
}
|
|
3779
3790
|
return "data:image/jpeg;base64," + btoa(t.join(""));
|
|
3780
|
-
}(r) : this.imageAttributes.src = n,
|
|
3781
|
-
var t =
|
|
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
|
+
var t = an({});
|
|
3782
3793
|
if (e) switch (e) {
|
|
3783
3794
|
case 2:
|
|
3784
3795
|
t.flip.horizontal = !0;
|
|
@@ -3818,7 +3829,7 @@ var yn = ["transitions"], bn = U("vue-advanced-cropper"), xn = {
|
|
|
3818
3829
|
var t = this;
|
|
3819
3830
|
this.transitionsOptions.enabled || this.awaitRender((function() {
|
|
3820
3831
|
t.coordinates = t.moveAlgorithm(B(B({}, t.getPublicProperties()), {}, {
|
|
3821
|
-
positionRestrictions:
|
|
3832
|
+
positionRestrictions: Bt(t.positionRestrictions, t.visibleArea),
|
|
3822
3833
|
coordinates: t.coordinates,
|
|
3823
3834
|
event: t.normalizeEvent(e)
|
|
3824
3835
|
})), t.onChange();
|
|
@@ -3829,7 +3840,7 @@ var yn = ["transitions"], bn = U("vue-advanced-cropper"), xn = {
|
|
|
3829
3840
|
this.transitionsOptions.enabled || this.stencilSize && !this.autoZoom || this.awaitRender((function() {
|
|
3830
3841
|
var n = t.sizeRestrictions, r = Math.min(t.coordinates.width, t.coordinates.height, 20 * t.coefficient);
|
|
3831
3842
|
t.coordinates = t.resizeAlgorithm(B(B({}, t.getPublicProperties()), {}, {
|
|
3832
|
-
positionRestrictions:
|
|
3843
|
+
positionRestrictions: Bt(t.positionRestrictions, t.visibleArea),
|
|
3833
3844
|
sizeRestrictions: {
|
|
3834
3845
|
maxWidth: Math.min(n.maxWidth, t.visibleArea.width),
|
|
3835
3846
|
maxHeight: Math.min(n.maxHeight, t.visibleArea.height),
|
|
@@ -3845,7 +3856,7 @@ var yn = ["transitions"], bn = U("vue-advanced-cropper"), xn = {
|
|
|
3845
3856
|
if (!this.transitionsOptions.enabled) {
|
|
3846
3857
|
var n = t.transitions, r = n !== void 0 && n, i = t.normalize, a = i === void 0 || i;
|
|
3847
3858
|
r && this.enableTransitions();
|
|
3848
|
-
var o =
|
|
3859
|
+
var o = Vt(B(B({}, this.getPublicProperties()), {}, {
|
|
3849
3860
|
event: a ? this.normalizeEvent(e) : e,
|
|
3850
3861
|
getAreaRestrictions: this.getAreaRestrictions,
|
|
3851
3862
|
imageRestriction: this.imageRestriction,
|
|
@@ -3875,7 +3886,7 @@ var yn = ["transitions"], bn = U("vue-advanced-cropper"), xn = {
|
|
|
3875
3886
|
}
|
|
3876
3887
|
if (G(t) && (t = G(i) ? a : i), G(n) && (n = G(i) ? o : i), !e && (G(t) || G(n))) {
|
|
3877
3888
|
var c = this.getStencilSize(), l = c ? Q(c) : null;
|
|
3878
|
-
G(t) && (t =
|
|
3889
|
+
G(t) && (t = Xe(l) ? l : void 0), G(n) && (n = Xe(l) ? l : void 0);
|
|
3879
3890
|
}
|
|
3880
3891
|
return {
|
|
3881
3892
|
minimum: t,
|
|
@@ -3893,10 +3904,10 @@ var yn = ["transitions"], bn = U("vue-advanced-cropper"), xn = {
|
|
|
3893
3904
|
coefficient: this.coefficient,
|
|
3894
3905
|
coordinates: this.coordinates,
|
|
3895
3906
|
aspectRatio: this.getAspectRatio(!0)
|
|
3896
|
-
}, 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({
|
|
3897
3908
|
boundaries: t,
|
|
3898
3909
|
aspectRatio: r
|
|
3899
|
-
}) : n), r) && (i =
|
|
3910
|
+
}) : n), r) && (i = At({
|
|
3900
3911
|
sizeRestrictions: {
|
|
3901
3912
|
maxWidth: t.width,
|
|
3902
3913
|
maxHeight: t.height,
|
|
@@ -3909,7 +3920,7 @@ var yn = ["transitions"], bn = U("vue-advanced-cropper"), xn = {
|
|
|
3909
3920
|
minimum: r.minimum,
|
|
3910
3921
|
maximum: r.maximum
|
|
3911
3922
|
}
|
|
3912
|
-
})), (i.width > t.width || i.height > t.height) && (i =
|
|
3923
|
+
})), (i.width > t.width || i.height > t.height) && (i = At({
|
|
3913
3924
|
sizeRestrictions: {
|
|
3914
3925
|
maxWidth: t.width,
|
|
3915
3926
|
maxHeight: t.height,
|
|
@@ -3938,13 +3949,13 @@ var yn = ["transitions"], bn = U("vue-advanced-cropper"), xn = {
|
|
|
3938
3949
|
};
|
|
3939
3950
|
},
|
|
3940
3951
|
defaultCoordinates: function() {
|
|
3941
|
-
return B({},
|
|
3952
|
+
return B({}, ft);
|
|
3942
3953
|
},
|
|
3943
3954
|
flip: function(e, t) {
|
|
3944
3955
|
var n = (arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}).transitions, r = n === void 0 || n;
|
|
3945
3956
|
if (!this.transitionsActive) {
|
|
3946
3957
|
r && this.enableTransitions();
|
|
3947
|
-
var i = B({}, this.imageTransforms.flip), a =
|
|
3958
|
+
var i = B({}, this.imageTransforms.flip), a = Ut({
|
|
3948
3959
|
flip: {
|
|
3949
3960
|
horizontal: e ? !i.horizontal : i.horizontal,
|
|
3950
3961
|
vertical: t ? !i.vertical : i.vertical
|
|
@@ -3968,7 +3979,7 @@ var yn = ["transitions"], bn = U("vue-advanced-cropper"), xn = {
|
|
|
3968
3979
|
n && this.enableTransitions();
|
|
3969
3980
|
var r = B({}, this.imageSize);
|
|
3970
3981
|
this.appliedImageTransforms.rotate += e;
|
|
3971
|
-
var i =
|
|
3982
|
+
var i = Ht({
|
|
3972
3983
|
visibleArea: this.visibleArea,
|
|
3973
3984
|
coordinates: this.coordinates,
|
|
3974
3985
|
previousImageSize: r,
|
|
@@ -3988,16 +3999,16 @@ var yn = ["transitions"], bn = U("vue-advanced-cropper"), xn = {
|
|
|
3988
3999
|
"error",
|
|
3989
4000
|
"ready"
|
|
3990
4001
|
]
|
|
3991
|
-
},
|
|
4002
|
+
}, wn = {
|
|
3992
4003
|
key: 0,
|
|
3993
4004
|
ref: "canvas",
|
|
3994
4005
|
style: { display: "none" }
|
|
3995
|
-
},
|
|
4006
|
+
}, Tn = {
|
|
3996
4007
|
key: 1,
|
|
3997
4008
|
ref: "sourceCanvas",
|
|
3998
4009
|
style: { display: "none" }
|
|
3999
4010
|
};
|
|
4000
|
-
|
|
4011
|
+
Cn.render = function(e, t, r, i, a, s) {
|
|
4001
4012
|
return o(), v("div", {
|
|
4002
4013
|
ref: "cropper",
|
|
4003
4014
|
class: s.classes.cropper
|
|
@@ -4055,8 +4066,8 @@ xn.render = function(e, t, r, i, a, s) {
|
|
|
4055
4066
|
"onMove",
|
|
4056
4067
|
"onMoveEnd"
|
|
4057
4068
|
])), [[x, a.imageLoaded]]),
|
|
4058
|
-
r.canvas ? (o(), v("canvas",
|
|
4059
|
-
r.canvas ? (o(), v("canvas",
|
|
4069
|
+
r.canvas ? (o(), v("canvas", wn, null, 512)) : u("", !0),
|
|
4070
|
+
r.canvas ? (o(), v("canvas", Tn, null, 512)) : u("", !0)
|
|
4060
4071
|
];
|
|
4061
4072
|
})),
|
|
4062
4073
|
_: 1
|
|
@@ -4072,57 +4083,57 @@ xn.render = function(e, t, r, i, a, s) {
|
|
|
4072
4083
|
};
|
|
4073
4084
|
//#endregion
|
|
4074
4085
|
//#region ../media-library/src/components/media/MediaEditModal.vue?vue&type=script&setup=true&lang.ts
|
|
4075
|
-
var
|
|
4086
|
+
var En = ["data-tpl-theme"], Dn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, On = {
|
|
4076
4087
|
class: "tpl:text-sm tpl:font-semibold",
|
|
4077
4088
|
style: { color: "var(--tpl-text)" }
|
|
4078
|
-
},
|
|
4089
|
+
}, kn = { class: "tpl:min-h-0 tpl:flex-1 tpl:overflow-y-auto tpl:px-5" }, An = {
|
|
4079
4090
|
key: 0,
|
|
4080
4091
|
class: "tpl:mb-4"
|
|
4081
|
-
},
|
|
4092
|
+
}, jn = {
|
|
4082
4093
|
class: "tpl:relative tpl:mb-3 tpl:overflow-hidden tpl:rounded-md tpl:border",
|
|
4083
4094
|
style: {
|
|
4084
4095
|
"border-color": "var(--tpl-border)",
|
|
4085
4096
|
height: "300px",
|
|
4086
4097
|
"background-color": "var(--tpl-bg)"
|
|
4087
4098
|
}
|
|
4088
|
-
},
|
|
4099
|
+
}, Mn = { class: "tpl:space-y-3" }, Nn = {
|
|
4089
4100
|
class: "tpl:mb-1.5 tpl:block tpl:text-xs tpl:font-medium",
|
|
4090
4101
|
style: { color: "var(--tpl-text-muted)" }
|
|
4091
|
-
},
|
|
4102
|
+
}, Pn = { class: "tpl:flex tpl:flex-wrap tpl:gap-1.5" }, Fn = ["onClick"], In = { class: "tpl:flex tpl:gap-3" }, Ln = { class: "tpl:flex-1" }, Rn = {
|
|
4092
4103
|
class: "tpl:mb-1 tpl:block tpl:text-xs tpl:font-medium",
|
|
4093
4104
|
style: { color: "var(--tpl-text-muted)" }
|
|
4094
|
-
},
|
|
4105
|
+
}, zn = {
|
|
4095
4106
|
class: "tpl:font-normal",
|
|
4096
4107
|
style: { color: "var(--tpl-text-dim)" }
|
|
4097
|
-
},
|
|
4108
|
+
}, Bn = { class: "tpl:relative" }, Vn = ["value", "placeholder"], Hn = {
|
|
4098
4109
|
class: "tpl:absolute tpl:top-1/2 tpl:right-2.5 tpl:-translate-y-1/2 tpl:text-xs",
|
|
4099
4110
|
style: { color: "var(--tpl-text-dim)" }
|
|
4100
|
-
},
|
|
4111
|
+
}, Un = { class: "tpl:flex-1" }, Wn = {
|
|
4101
4112
|
class: "tpl:mb-1 tpl:block tpl:text-xs tpl:font-medium",
|
|
4102
4113
|
style: { color: "var(--tpl-text-muted)" }
|
|
4103
|
-
},
|
|
4114
|
+
}, Gn = {
|
|
4104
4115
|
class: "tpl:font-normal",
|
|
4105
4116
|
style: { color: "var(--tpl-text-dim)" }
|
|
4106
|
-
},
|
|
4117
|
+
}, Kn = { class: "tpl:relative" }, qn = ["value", "placeholder"], Jn = {
|
|
4107
4118
|
class: "tpl:absolute tpl:top-1/2 tpl:right-2.5 tpl:-translate-y-1/2 tpl:text-xs",
|
|
4108
4119
|
style: { color: "var(--tpl-text-dim)" }
|
|
4109
|
-
},
|
|
4120
|
+
}, Yn = {
|
|
4110
4121
|
key: 0,
|
|
4111
4122
|
class: "tpl:flex tpl:items-center tpl:gap-1 tpl:text-xs",
|
|
4112
4123
|
style: { color: "var(--tpl-text-muted)" }
|
|
4113
|
-
},
|
|
4124
|
+
}, Xn = {
|
|
4114
4125
|
class: "tpl:font-medium",
|
|
4115
4126
|
style: { color: "var(--tpl-text)" }
|
|
4116
|
-
},
|
|
4127
|
+
}, Zn = { class: "tpl:mb-3" }, Qn = {
|
|
4117
4128
|
class: "tpl:mb-1 tpl:block tpl:text-xs tpl:font-medium",
|
|
4118
4129
|
style: { color: "var(--tpl-text-muted)" }
|
|
4119
|
-
},
|
|
4130
|
+
}, $n = ["autofocus"], er = {
|
|
4120
4131
|
key: 1,
|
|
4121
4132
|
class: "tpl:mb-4"
|
|
4122
|
-
},
|
|
4133
|
+
}, tr = {
|
|
4123
4134
|
class: "tpl:mb-1 tpl:block tpl:text-xs tpl:font-medium",
|
|
4124
4135
|
style: { color: "var(--tpl-text-muted)" }
|
|
4125
|
-
},
|
|
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__ */ L(/* @__PURE__ */ e({
|
|
4126
4137
|
__name: "MediaEditModal",
|
|
4127
4138
|
props: {
|
|
4128
4139
|
visible: { type: Boolean },
|
|
@@ -4130,14 +4141,14 @@ var wn = ["data-tpl-theme"], Tn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, En
|
|
|
4130
4141
|
},
|
|
4131
4142
|
emits: ["save", "close"],
|
|
4132
4143
|
setup(e, { emit: a }) {
|
|
4133
|
-
let s = e, l = a, { t: b } = z(), x = t("tplUiTheme"), E = b.mediaLibrary, { isImageMimeType: A } =
|
|
4144
|
+
let s = e, l = a, { t: b } = z(), x = t("tplUiTheme"), E = b.mediaLibrary, { isImageMimeType: A } = Oe(), j = T(""), ee = T(""), te = T(null), M = T("free"), ne = T(void 0), N = T(void 0), P = T(""), F = T(""), I = T(void 0), L = T(null), re = T(!1), R = T(!1), ie = T(!1), ae = S(() => s.item ? [
|
|
4134
4145
|
"image/jpeg",
|
|
4135
4146
|
"image/png",
|
|
4136
4147
|
"image/webp",
|
|
4137
4148
|
"image/gif"
|
|
4138
|
-
].includes(s.item.mime_type) : !1), oe = S(() =>
|
|
4149
|
+
].includes(s.item.mime_type) : !1), oe = S(() => M.value === "original" ? I.value : ke[M.value]), se = S(() => L.value ? Ne(L.value.width, L.value.height, ne.value, N.value) : null);
|
|
4139
4150
|
r(() => s.visible, (e) => {
|
|
4140
|
-
e && s.item && (j.value = s.item.filename,
|
|
4151
|
+
e && s.item && (j.value = s.item.filename, ee.value = s.item.alt_text || "", M.value = "free", ne.value = void 0, N.value = void 0, P.value = "", F.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));
|
|
4141
4152
|
});
|
|
4142
4153
|
function ce(e) {
|
|
4143
4154
|
e.coordinates && (L.value = {
|
|
@@ -4150,23 +4161,23 @@ var wn = ["data-tpl-theme"], Tn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, En
|
|
|
4150
4161
|
}
|
|
4151
4162
|
function ue(e) {
|
|
4152
4163
|
let t = e.target.value;
|
|
4153
|
-
|
|
4164
|
+
P.value = t, ne.value = t && parseInt(t, 10) || void 0;
|
|
4154
4165
|
}
|
|
4155
4166
|
function de(e) {
|
|
4156
4167
|
let t = e.target.value;
|
|
4157
|
-
F.value = t,
|
|
4168
|
+
F.value = t, N.value = t && parseInt(t, 10) || void 0;
|
|
4158
4169
|
}
|
|
4159
4170
|
async function fe() {
|
|
4160
4171
|
let e = j.value.trim();
|
|
4161
4172
|
if (!e || !s.item || R.value) return;
|
|
4162
4173
|
let t = A(s.item.mime_type), n;
|
|
4163
|
-
if (ae.value &&
|
|
4174
|
+
if (ae.value && te.value && ie.value) {
|
|
4164
4175
|
R.value = !0;
|
|
4165
4176
|
try {
|
|
4166
|
-
let { canvas: e } =
|
|
4177
|
+
let { canvas: e } = te.value.getResult();
|
|
4167
4178
|
if (e) {
|
|
4168
|
-
let t =
|
|
4169
|
-
n = { file: await
|
|
4179
|
+
let t = je(e, ne.value, N.value), r = Ae(s.item.mime_type);
|
|
4180
|
+
n = { file: await Me(t, s.item.filename, r) };
|
|
4170
4181
|
}
|
|
4171
4182
|
} catch {
|
|
4172
4183
|
R.value = !1;
|
|
@@ -4174,7 +4185,7 @@ var wn = ["data-tpl-theme"], Tn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, En
|
|
|
4174
4185
|
}
|
|
4175
4186
|
R.value = !1;
|
|
4176
4187
|
}
|
|
4177
|
-
l("save", s.item.id, e, t ?
|
|
4188
|
+
l("save", s.item.id, e, t ? ee.value : void 0, n), l("close");
|
|
4178
4189
|
}
|
|
4179
4190
|
function pe(e) {
|
|
4180
4191
|
e.key === "Enter" && !R.value && (e.preventDefault(), fe()), e.key === "Escape" && l("close");
|
|
@@ -4198,19 +4209,19 @@ var wn = ["data-tpl-theme"], Tn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, En
|
|
|
4198
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"]),
|
|
4199
4210
|
style: { "background-color": "var(--tpl-bg-elevated)" }
|
|
4200
4211
|
}, [
|
|
4201
|
-
y("div",
|
|
4202
|
-
y("div",
|
|
4203
|
-
ae.value ? (o(), O("div",
|
|
4212
|
+
y("div", Dn, [y("h3", On, _(p(b).mediaLibrary.editFile), 1)]),
|
|
4213
|
+
y("div", kn, [
|
|
4214
|
+
ae.value ? (o(), O("div", An, [y("div", jn, [k(p(Cn), {
|
|
4204
4215
|
ref_key: "cropperRef",
|
|
4205
|
-
ref:
|
|
4216
|
+
ref: te,
|
|
4206
4217
|
src: e.item.url,
|
|
4207
4218
|
"stencil-props": { aspectRatio: oe.value },
|
|
4208
4219
|
class: "tpl:h-full tpl:w-full",
|
|
4209
4220
|
"background-class": "tpl-cropper-background",
|
|
4210
4221
|
onChange: ce,
|
|
4211
4222
|
onReady: le
|
|
4212
|
-
}, null, 8, ["src", "stencil-props"])]), y("div",
|
|
4213
|
-
y("div", null, [y("label",
|
|
4223
|
+
}, null, 8, ["src", "stencil-props"])]), y("div", Mn, [
|
|
4224
|
+
y("div", null, [y("label", Nn, _(p(b).mediaLibrary.cropAspectRatio), 1), y("div", Pn, [(o(), O(g, null, i([
|
|
4214
4225
|
"free",
|
|
4215
4226
|
"square",
|
|
4216
4227
|
"landscape43",
|
|
@@ -4221,14 +4232,14 @@ var wn = ["data-tpl-theme"], Tn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, En
|
|
|
4221
4232
|
type: "button",
|
|
4222
4233
|
class: "tpl:cursor-pointer tpl:rounded-md tpl:border tpl:px-2.5 tpl:py-1 tpl:text-xs tpl:font-medium tpl:transition-all tpl:duration-150",
|
|
4223
4234
|
style: h({
|
|
4224
|
-
borderColor:
|
|
4225
|
-
backgroundColor:
|
|
4226
|
-
color:
|
|
4235
|
+
borderColor: M.value === e ? "var(--tpl-primary)" : "var(--tpl-border)",
|
|
4236
|
+
backgroundColor: M.value === e ? "var(--tpl-primary-light)" : "var(--tpl-bg)",
|
|
4237
|
+
color: M.value === e ? "var(--tpl-primary)" : "var(--tpl-text)"
|
|
4227
4238
|
}),
|
|
4228
|
-
onClick: (t) =>
|
|
4229
|
-
}, _(p(E)[`crop${e.charAt(0).toUpperCase()}${e.slice(1)}`]), 13,
|
|
4230
|
-
y("div",
|
|
4231
|
-
value:
|
|
4239
|
+
onClick: (t) => M.value = e
|
|
4240
|
+
}, _(p(E)[`crop${e.charAt(0).toUpperCase()}${e.slice(1)}`]), 13, Fn)), 64))])]),
|
|
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: P.value,
|
|
4232
4243
|
type: "number",
|
|
4233
4244
|
min: "1",
|
|
4234
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",
|
|
@@ -4239,7 +4250,7 @@ var wn = ["data-tpl-theme"], Tn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, En
|
|
|
4239
4250
|
},
|
|
4240
4251
|
placeholder: L.value?.width?.toString() || "",
|
|
4241
4252
|
onInput: ue
|
|
4242
|
-
}, null, 40,
|
|
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", {
|
|
4243
4254
|
value: F.value,
|
|
4244
4255
|
type: "number",
|
|
4245
4256
|
min: "1",
|
|
@@ -4251,10 +4262,10 @@ var wn = ["data-tpl-theme"], Tn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, En
|
|
|
4251
4262
|
},
|
|
4252
4263
|
placeholder: L.value?.height?.toString() || "",
|
|
4253
4264
|
onInput: de
|
|
4254
|
-
}, null, 40,
|
|
4255
|
-
se.value ? (o(), O("div",
|
|
4265
|
+
}, null, 40, qn), y("span", Jn, _(p(b).mediaLibrary.cropPixels), 1)])])]),
|
|
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)
|
|
4256
4267
|
])])) : u("", !0),
|
|
4257
|
-
y("div",
|
|
4268
|
+
y("div", Zn, [y("label", Qn, _(p(b).mediaLibrary.fileName), 1), n(y("input", {
|
|
4258
4269
|
"onUpdate:modelValue": r[0] ||= (e) => j.value = e,
|
|
4259
4270
|
type: "text",
|
|
4260
4271
|
class: "tpl:w-full tpl:rounded-md tpl:border tpl:px-3 tpl:py-1.5 tpl:text-xs tpl:outline-none",
|
|
@@ -4264,9 +4275,9 @@ var wn = ["data-tpl-theme"], Tn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, En
|
|
|
4264
4275
|
color: "var(--tpl-text)"
|
|
4265
4276
|
},
|
|
4266
4277
|
autofocus: !ae.value
|
|
4267
|
-
}, null, 8,
|
|
4268
|
-
p(A)(e.item.mime_type) ? (o(), O("div",
|
|
4269
|
-
"onUpdate:modelValue": r[1] ||= (e) =>
|
|
4278
|
+
}, null, 8, $n), [[f, j.value]])]),
|
|
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) => ee.value = e,
|
|
4270
4281
|
type: "text",
|
|
4271
4282
|
class: "tpl:w-full tpl:rounded-md tpl:border tpl:px-3 tpl:py-1.5 tpl:text-xs tpl:outline-none",
|
|
4272
4283
|
style: {
|
|
@@ -4275,9 +4286,9 @@ var wn = ["data-tpl-theme"], Tn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, En
|
|
|
4275
4286
|
color: "var(--tpl-text)"
|
|
4276
4287
|
},
|
|
4277
4288
|
placeholder: p(b).mediaLibrary.altTextPlaceholder
|
|
4278
|
-
}, null, 8,
|
|
4289
|
+
}, null, 8, nr), [[f, ee.value]])])) : u("", !0)
|
|
4279
4290
|
]),
|
|
4280
|
-
y("div",
|
|
4291
|
+
y("div", rr, [y("button", {
|
|
4281
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",
|
|
4282
4293
|
style: {
|
|
4283
4294
|
"border-color": "var(--tpl-border)",
|
|
@@ -4290,21 +4301,21 @@ var wn = ["data-tpl-theme"], Tn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, En
|
|
|
4290
4301
|
style: { background: "linear-gradient(\n 135deg,\n var(--tpl-primary),\n var(--tpl-primary-hover)\n )" },
|
|
4291
4302
|
disabled: R.value,
|
|
4292
4303
|
onClick: fe
|
|
4293
|
-
}, _(R.value ? p(b).mediaLibrary.saving : p(b).mediaLibrary.saveChanges), 9,
|
|
4294
|
-
], 2)], 40,
|
|
4304
|
+
}, _(R.value ? p(b).mediaLibrary.saving : p(b).mediaLibrary.saveChanges), 9, ir)])
|
|
4305
|
+
], 2)], 40, En)) : u("", !0)]),
|
|
4295
4306
|
_: 1
|
|
4296
4307
|
})]));
|
|
4297
4308
|
}
|
|
4298
|
-
}), [["__scopeId", "data-v-7c7d7d1f"]]),
|
|
4309
|
+
}), [["__scopeId", "data-v-7c7d7d1f"]]), or = {
|
|
4299
4310
|
key: 1,
|
|
4300
4311
|
class: "tpl:size-4 tpl:shrink-0"
|
|
4301
|
-
},
|
|
4312
|
+
}, sr = {
|
|
4302
4313
|
key: 0,
|
|
4303
4314
|
class: "tpl:truncate"
|
|
4304
|
-
},
|
|
4315
|
+
}, cr = {
|
|
4305
4316
|
key: 3,
|
|
4306
4317
|
class: "tpl:flex tpl:shrink-0 tpl:items-center tpl:gap-0.5 tpl:opacity-0 tpl:transition-opacity tpl:group-hover:opacity-100"
|
|
4307
|
-
},
|
|
4318
|
+
}, lr = ["title"], ur = ["title"], dr = { key: 0 }, fr = ["placeholder"], pr = 5, mr = /* @__PURE__ */ e({
|
|
4308
4319
|
__name: "MediaFolderTreeNode",
|
|
4309
4320
|
props: {
|
|
4310
4321
|
folder: {},
|
|
@@ -4318,31 +4329,31 @@ var wn = ["data-tpl-theme"], Tn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, En
|
|
|
4318
4329
|
"deleteFolder"
|
|
4319
4330
|
],
|
|
4320
4331
|
setup(e, { emit: t }) {
|
|
4321
|
-
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 <
|
|
4322
|
-
function
|
|
4323
|
-
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), ee = S(() => !r.currentFolderId || !r.folder.children ? !1 : ne(r.folder.children, r.currentFolderId)), M = S(() => l.value || ee.value);
|
|
4333
|
+
function ne(e, t) {
|
|
4334
|
+
for (let n of e) if (n.id === t || n.children && ne(n.children, t)) return !0;
|
|
4324
4335
|
return !1;
|
|
4325
4336
|
}
|
|
4326
|
-
function
|
|
4337
|
+
function N() {
|
|
4327
4338
|
l.value = !l.value;
|
|
4328
4339
|
}
|
|
4329
|
-
function
|
|
4340
|
+
function P() {
|
|
4330
4341
|
d.value = !0, b.value = r.folder.name;
|
|
4331
4342
|
}
|
|
4332
|
-
function
|
|
4343
|
+
function F() {
|
|
4333
4344
|
let e = b.value.trim();
|
|
4334
4345
|
e && e !== r.folder.name && a("renameFolder", r.folder.id, e), d.value = !1, b.value = "";
|
|
4335
4346
|
}
|
|
4336
|
-
function
|
|
4347
|
+
function I() {
|
|
4337
4348
|
d.value = !1, b.value = "";
|
|
4338
4349
|
}
|
|
4339
|
-
function
|
|
4350
|
+
function L() {
|
|
4340
4351
|
x.value = !0, C.value = "", l.value = !0;
|
|
4341
4352
|
}
|
|
4342
|
-
function
|
|
4353
|
+
function re() {
|
|
4343
4354
|
C.value.trim() && a("createFolder", C.value.trim(), r.folder.id), x.value = !1, C.value = "";
|
|
4344
4355
|
}
|
|
4345
|
-
function
|
|
4356
|
+
function ie() {
|
|
4346
4357
|
x.value = !1, C.value = "";
|
|
4347
4358
|
}
|
|
4348
4359
|
return (t, r) => {
|
|
@@ -4358,20 +4369,20 @@ var wn = ["data-tpl-theme"], Tn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, En
|
|
|
4358
4369
|
w.value || x.value ? (o(), O("button", {
|
|
4359
4370
|
key: 0,
|
|
4360
4371
|
class: "tpl:flex tpl:size-4 tpl:shrink-0 tpl:items-center tpl:justify-center tpl:rounded tpl:transition-colors",
|
|
4361
|
-
onClick: m(
|
|
4362
|
-
}, [k(p(
|
|
4363
|
-
class: D(["tpl:transition-transform tpl:duration-150", { "tpl:rotate-90":
|
|
4372
|
+
onClick: m(N, ["stop"])
|
|
4373
|
+
}, [k(p(te), {
|
|
4374
|
+
class: D(["tpl:transition-transform tpl:duration-150", { "tpl:rotate-90": M.value }]),
|
|
4364
4375
|
size: 10,
|
|
4365
4376
|
"stroke-width": 2
|
|
4366
|
-
}, null, 8, ["class"])])) : (o(), O("span",
|
|
4377
|
+
}, null, 8, ["class"])])) : (o(), O("span", or)),
|
|
4367
4378
|
y("button", {
|
|
4368
4379
|
class: "tpl:flex tpl:min-w-0 tpl:flex-1 tpl:items-center tpl:gap-1.5",
|
|
4369
4380
|
onClick: r[0] ||= (t) => a("navigate", e.folder.id)
|
|
4370
|
-
}, [k(p(
|
|
4381
|
+
}, [k(p(_e), {
|
|
4371
4382
|
class: "tpl:shrink-0",
|
|
4372
4383
|
size: 14,
|
|
4373
4384
|
"stroke-width": 1.5
|
|
4374
|
-
}), d.value ? u("", !0) : (o(), O("span",
|
|
4385
|
+
}), d.value ? u("", !0) : (o(), O("span", sr, _(e.folder.name), 1))]),
|
|
4375
4386
|
d.value ? n((o(), O("input", {
|
|
4376
4387
|
key: 2,
|
|
4377
4388
|
"onUpdate:modelValue": r[1] ||= (e) => b.value = e,
|
|
@@ -4383,38 +4394,38 @@ var wn = ["data-tpl-theme"], Tn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, En
|
|
|
4383
4394
|
color: "var(--tpl-text)"
|
|
4384
4395
|
},
|
|
4385
4396
|
autofocus: "",
|
|
4386
|
-
onKeydown: [E(
|
|
4387
|
-
onBlur:
|
|
4397
|
+
onKeydown: [E(F, ["enter"]), E(I, ["escape"])],
|
|
4398
|
+
onBlur: F,
|
|
4388
4399
|
onClick: r[2] ||= m(() => {}, ["stop"])
|
|
4389
4400
|
}, null, 544)), [[f, b.value]]) : u("", !0),
|
|
4390
|
-
d.value ? u("", !0) : (o(), O("span",
|
|
4401
|
+
d.value ? u("", !0) : (o(), O("span", cr, [
|
|
4391
4402
|
A.value ? (o(), O("button", {
|
|
4392
4403
|
key: 0,
|
|
4393
4404
|
class: "tpl:flex tpl:size-6 tpl:items-center tpl:justify-center tpl:rounded tpl:transition-colors",
|
|
4394
4405
|
title: p(c).mediaLibrary.addSubfolder,
|
|
4395
|
-
onClick: m(
|
|
4396
|
-
}, [k(p(
|
|
4406
|
+
onClick: m(L, ["stop"])
|
|
4407
|
+
}, [k(p(ge), {
|
|
4397
4408
|
size: 12,
|
|
4398
4409
|
"stroke-width": 2
|
|
4399
|
-
})], 8,
|
|
4410
|
+
})], 8, lr)) : u("", !0),
|
|
4400
4411
|
y("button", {
|
|
4401
4412
|
class: "tpl:flex tpl:size-6 tpl:items-center tpl:justify-center tpl:rounded tpl:transition-colors",
|
|
4402
4413
|
title: p(c).mediaLibrary.renameFolder,
|
|
4403
|
-
onClick: m(
|
|
4404
|
-
}, [k(p(
|
|
4414
|
+
onClick: m(P, ["stop"])
|
|
4415
|
+
}, [k(p(ue), {
|
|
4405
4416
|
size: 12,
|
|
4406
4417
|
"stroke-width": 2
|
|
4407
|
-
})], 8,
|
|
4418
|
+
})], 8, ur),
|
|
4408
4419
|
y("button", {
|
|
4409
4420
|
class: "tpl:flex tpl:size-6 tpl:items-center tpl:justify-center tpl:rounded tpl:transition-colors",
|
|
4410
4421
|
onClick: r[3] ||= m((t) => a("deleteFolder", e.folder.id), ["stop"])
|
|
4411
|
-
}, [k(p(
|
|
4422
|
+
}, [k(p(R), {
|
|
4412
4423
|
size: 12,
|
|
4413
4424
|
"stroke-width": 2,
|
|
4414
4425
|
style: { color: "var(--tpl-danger)" }
|
|
4415
4426
|
})])
|
|
4416
4427
|
]))
|
|
4417
|
-
], 4),
|
|
4428
|
+
], 4), M.value ? (o(), O("div", dr, [(o(!0), O(g, null, i(e.folder.children, (t) => (o(), v(l, {
|
|
4418
4429
|
key: t.id,
|
|
4419
4430
|
folder: t,
|
|
4420
4431
|
"current-folder-id": e.currentFolderId,
|
|
@@ -4442,15 +4453,15 @@ var wn = ["data-tpl-theme"], Tn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, En
|
|
|
4442
4453
|
},
|
|
4443
4454
|
placeholder: p(c).mediaLibrary.subfolderName,
|
|
4444
4455
|
autofocus: "",
|
|
4445
|
-
onKeydown: [E(
|
|
4446
|
-
onBlur:
|
|
4447
|
-
}, null, 40,
|
|
4456
|
+
onKeydown: [E(re, ["enter"]), E(ie, ["escape"])],
|
|
4457
|
+
onBlur: re
|
|
4458
|
+
}, null, 40, fr), [[f, C.value]])], 4)) : u("", !0)])) : u("", !0)]);
|
|
4448
4459
|
};
|
|
4449
4460
|
}
|
|
4450
|
-
}),
|
|
4461
|
+
}), hr = { class: "tpl:flex tpl:h-full tpl:flex-col tpl:overflow-y-auto" }, gr = {
|
|
4451
4462
|
key: 0,
|
|
4452
4463
|
class: "tpl:px-3 tpl:py-2"
|
|
4453
|
-
},
|
|
4464
|
+
}, _r = ["placeholder"], vr = /* @__PURE__ */ e({
|
|
4454
4465
|
__name: "MediaFolderTree",
|
|
4455
4466
|
props: {
|
|
4456
4467
|
folders: {},
|
|
@@ -4476,7 +4487,7 @@ var wn = ["data-tpl-theme"], Tn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, En
|
|
|
4476
4487
|
function b() {
|
|
4477
4488
|
s.value = !1, c.value = "";
|
|
4478
4489
|
}
|
|
4479
|
-
return (t, x) => (o(), O("div",
|
|
4490
|
+
return (t, x) => (o(), O("div", hr, [
|
|
4480
4491
|
y("button", {
|
|
4481
4492
|
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:font-medium tpl:transition-all tpl:duration-150",
|
|
4482
4493
|
style: h({
|
|
@@ -4484,11 +4495,11 @@ var wn = ["data-tpl-theme"], Tn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, En
|
|
|
4484
4495
|
color: e.viewMode === "files" && e.currentFolderId === null ? "var(--tpl-primary)" : "var(--tpl-text)"
|
|
4485
4496
|
}),
|
|
4486
4497
|
onClick: x[0] ||= (e) => r("navigate", null)
|
|
4487
|
-
}, [k(p(
|
|
4498
|
+
}, [k(p(ye), {
|
|
4488
4499
|
size: 14,
|
|
4489
4500
|
"stroke-width": 1.5
|
|
4490
4501
|
}), d(" " + _(p(a).mediaLibrary.allFiles), 1)], 4),
|
|
4491
|
-
(o(!0), O(g, null, i(e.folders, (t) => (o(), v(
|
|
4502
|
+
(o(!0), O(g, null, i(e.folders, (t) => (o(), v(mr, {
|
|
4492
4503
|
key: t.id,
|
|
4493
4504
|
folder: t,
|
|
4494
4505
|
"current-folder-id": e.currentFolderId,
|
|
@@ -4498,7 +4509,7 @@ var wn = ["data-tpl-theme"], Tn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, En
|
|
|
4498
4509
|
onRenameFolder: x[3] ||= (e, t) => r("renameFolder", e, t),
|
|
4499
4510
|
onDeleteFolder: x[4] ||= (e) => r("deleteFolder", e)
|
|
4500
4511
|
}, null, 8, ["folder", "current-folder-id"]))), 128)),
|
|
4501
|
-
s.value ? (o(), O("div",
|
|
4512
|
+
s.value ? (o(), O("div", gr, [n(y("input", {
|
|
4502
4513
|
"onUpdate:modelValue": x[5] ||= (e) => c.value = e,
|
|
4503
4514
|
type: "text",
|
|
4504
4515
|
class: "tpl:w-full tpl:rounded tpl:border tpl:px-2 tpl:py-1 tpl:text-xs tpl:outline-none",
|
|
@@ -4511,13 +4522,13 @@ var wn = ["data-tpl-theme"], Tn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, En
|
|
|
4511
4522
|
autofocus: "",
|
|
4512
4523
|
onKeydown: [E(m, ["enter"]), E(b, ["escape"])],
|
|
4513
4524
|
onBlur: m
|
|
4514
|
-
}, null, 40,
|
|
4525
|
+
}, null, 40, _r), [[f, c.value]])])) : u("", !0),
|
|
4515
4526
|
s.value ? u("", !0) : (o(), O("button", {
|
|
4516
4527
|
key: 1,
|
|
4517
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",
|
|
4518
4529
|
style: { color: "var(--tpl-text-muted)" },
|
|
4519
4530
|
onClick: l
|
|
4520
|
-
}, [k(p(
|
|
4531
|
+
}, [k(p(ge), {
|
|
4521
4532
|
size: 14,
|
|
4522
4533
|
"stroke-width": 1.5
|
|
4523
4534
|
}), d(" " + _(p(a).mediaLibrary.newFolder), 1)])),
|
|
@@ -4531,13 +4542,13 @@ var wn = ["data-tpl-theme"], Tn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, En
|
|
|
4531
4542
|
color: e.viewMode === "frequently-used" ? "var(--tpl-primary)" : "var(--tpl-text)"
|
|
4532
4543
|
}),
|
|
4533
4544
|
onClick: x[6] ||= (e) => r("showFrequentlyUsed")
|
|
4534
|
-
}, [k(p(
|
|
4545
|
+
}, [k(p(he), {
|
|
4535
4546
|
size: 14,
|
|
4536
4547
|
"stroke-width": 1.5
|
|
4537
4548
|
}), d(" " + _(p(a).mediaLibrary.frequentlyUsed), 1)], 4)) : u("", !0)
|
|
4538
4549
|
]));
|
|
4539
4550
|
}
|
|
4540
|
-
}),
|
|
4551
|
+
}), yr = { class: "tpl:flex tpl:aspect-square tpl:flex-col tpl:items-center tpl:justify-center tpl:gap-2" }, br = /* @__PURE__ */ e({
|
|
4541
4552
|
__name: "MediaFileIcon",
|
|
4542
4553
|
props: { mimeType: {} },
|
|
4543
4554
|
setup(e) {
|
|
@@ -4638,7 +4649,7 @@ var wn = ["data-tpl-theme"], Tn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, En
|
|
|
4638
4649
|
bgColor: "#f9fafb",
|
|
4639
4650
|
icon: "document"
|
|
4640
4651
|
}, i = S(() => n[t.mimeType] ?? r);
|
|
4641
|
-
return (e, t) => (o(), O("div",
|
|
4652
|
+
return (e, t) => (o(), O("div", yr, [i.value.icon === "document" ? (o(), O("svg", {
|
|
4642
4653
|
key: 0,
|
|
4643
4654
|
width: "60",
|
|
4644
4655
|
height: "60",
|
|
@@ -4707,48 +4718,48 @@ var wn = ["data-tpl-theme"], Tn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, En
|
|
|
4707
4718
|
style: h({ color: i.value.color })
|
|
4708
4719
|
}, _(i.value.label), 5)]));
|
|
4709
4720
|
}
|
|
4710
|
-
}),
|
|
4721
|
+
}), xr = { class: "tpl:p-4" }, Sr = {
|
|
4711
4722
|
key: 1,
|
|
4712
4723
|
class: "tpl:flex tpl:flex-col tpl:items-center tpl:justify-center tpl:py-16"
|
|
4713
|
-
},
|
|
4724
|
+
}, Cr = {
|
|
4714
4725
|
class: "tpl:text-xs",
|
|
4715
4726
|
style: { color: "var(--tpl-text-muted)" }
|
|
4716
|
-
},
|
|
4727
|
+
}, wr = {
|
|
4717
4728
|
key: 2,
|
|
4718
4729
|
class: "tpl:grid tpl:grid-cols-4 tpl:gap-3"
|
|
4719
|
-
},
|
|
4730
|
+
}, Tr = ["onClick"], Er = { class: "tpl:aspect-square" }, Dr = ["src", "alt"], Or = { class: "tpl:px-2 tpl:py-1.5" }, kr = {
|
|
4720
4731
|
class: "tpl:truncate tpl:text-[10px] tpl:font-medium",
|
|
4721
4732
|
style: { color: "var(--tpl-text)" }
|
|
4722
|
-
},
|
|
4733
|
+
}, Ar = {
|
|
4723
4734
|
class: "tpl:flex tpl:justify-between tpl:text-[9px]",
|
|
4724
4735
|
style: { color: "var(--tpl-text-muted)" }
|
|
4725
|
-
},
|
|
4736
|
+
}, jr = { key: 0 }, Mr = { class: "tpl:absolute tpl:top-1.5 tpl:left-1.5 tpl:flex tpl:gap-1 tpl:opacity-0 tpl:transition-opacity tpl:duration-150 tpl:group-hover:opacity-100" }, Nr = ["title", "onClick"], Pr = ["title", "onClick"], Fr = {
|
|
4726
4737
|
key: 0,
|
|
4727
4738
|
class: "tpl:absolute tpl:top-1.5 tpl:right-1.5 tpl:flex tpl:size-5 tpl:items-center tpl:justify-center tpl:rounded-full tpl:text-white",
|
|
4728
4739
|
style: { "background-color": "var(--tpl-primary)" }
|
|
4729
|
-
},
|
|
4740
|
+
}, Ir = {
|
|
4730
4741
|
key: 3,
|
|
4731
4742
|
class: "tpl:flex tpl:flex-col tpl:gap-1"
|
|
4732
|
-
},
|
|
4743
|
+
}, Lr = ["onClick"], Rr = {
|
|
4733
4744
|
class: "tpl:size-10 tpl:shrink-0 tpl:overflow-hidden tpl:rounded",
|
|
4734
4745
|
style: { "background-color": "var(--tpl-bg-hover)" }
|
|
4735
|
-
},
|
|
4746
|
+
}, zr = ["src", "alt"], Br = {
|
|
4736
4747
|
key: 1,
|
|
4737
4748
|
class: "tpl-list-icon tpl:size-full"
|
|
4738
|
-
},
|
|
4749
|
+
}, Vr = { class: "tpl:min-w-0 tpl:flex-1" }, Hr = {
|
|
4739
4750
|
class: "tpl:truncate tpl:text-xs tpl:font-medium",
|
|
4740
4751
|
style: { color: "var(--tpl-text)" }
|
|
4741
|
-
},
|
|
4752
|
+
}, Ur = {
|
|
4742
4753
|
class: "tpl:text-[10px]",
|
|
4743
4754
|
style: { color: "var(--tpl-text-muted)" }
|
|
4744
|
-
},
|
|
4755
|
+
}, Wr = { class: "tpl:flex tpl:gap-1 tpl:opacity-0 tpl:transition-opacity tpl:duration-150 tpl:group-hover:opacity-100" }, Gr = ["title", "onClick"], Kr = ["title", "onClick"], qr = {
|
|
4745
4756
|
key: 0,
|
|
4746
4757
|
class: "tpl:flex tpl:size-5 tpl:shrink-0 tpl:items-center tpl:justify-center tpl:rounded-full tpl:text-white",
|
|
4747
4758
|
style: { "background-color": "var(--tpl-primary)" }
|
|
4748
|
-
},
|
|
4759
|
+
}, Jr = {
|
|
4749
4760
|
key: 4,
|
|
4750
4761
|
class: "tpl:flex tpl:justify-center tpl:py-4"
|
|
4751
|
-
},
|
|
4762
|
+
}, Yr = /* @__PURE__ */ L(/* @__PURE__ */ e({
|
|
4752
4763
|
__name: "MediaGrid",
|
|
4753
4764
|
props: {
|
|
4754
4765
|
items: {},
|
|
@@ -4766,7 +4777,7 @@ var wn = ["data-tpl-theme"], Tn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, En
|
|
|
4766
4777
|
"replace"
|
|
4767
4778
|
],
|
|
4768
4779
|
setup(e, { emit: t }) {
|
|
4769
|
-
let n = e, r = t, { isAcceptedMimeType: a, isImageMimeType: s } =
|
|
4780
|
+
let n = e, r = t, { isAcceptedMimeType: a, isImageMimeType: s } = Oe();
|
|
4770
4781
|
function c(e) {
|
|
4771
4782
|
return !n.accept || n.accept.length === 0 ? !0 : a(e.mime_type, n.accept);
|
|
4772
4783
|
}
|
|
@@ -4774,7 +4785,7 @@ var wn = ["data-tpl-theme"], Tn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, En
|
|
|
4774
4785
|
r("select", e);
|
|
4775
4786
|
}
|
|
4776
4787
|
let { t: f } = z(), b = T(null);
|
|
4777
|
-
|
|
4788
|
+
le(b, ([{ isIntersecting: e }]) => {
|
|
4778
4789
|
e && n.hasMore && !n.isLoading && r("loadMore");
|
|
4779
4790
|
}, { threshold: .1 });
|
|
4780
4791
|
function x(e) {
|
|
@@ -4787,7 +4798,7 @@ var wn = ["data-tpl-theme"], Tn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, En
|
|
|
4787
4798
|
day: "numeric"
|
|
4788
4799
|
});
|
|
4789
4800
|
}
|
|
4790
|
-
return (t, n) => (o(), O("div",
|
|
4801
|
+
return (t, n) => (o(), O("div", xr, [
|
|
4791
4802
|
e.isLoading && e.items.length === 0 ? (o(), O("div", {
|
|
4792
4803
|
key: 0,
|
|
4793
4804
|
class: D(e.layout === "list" ? "tpl:flex tpl:flex-col tpl:gap-1" : "tpl:grid tpl:grid-cols-4 tpl:gap-3")
|
|
@@ -4795,47 +4806,47 @@ var wn = ["data-tpl-theme"], Tn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, En
|
|
|
4795
4806
|
key: t,
|
|
4796
4807
|
class: D(["tpl-pulse tpl:rounded-lg", e.layout === "list" ? "tpl:h-12" : "tpl:aspect-square"]),
|
|
4797
4808
|
style: { "background-color": "var(--tpl-bg-hover)" }
|
|
4798
|
-
}, null, 2)), 64))], 2)) : e.items.length === 0 ? (o(), O("div",
|
|
4809
|
+
}, null, 2)), 64))], 2)) : e.items.length === 0 ? (o(), O("div", Sr, [k(p(ye), {
|
|
4799
4810
|
class: "tpl:mb-3",
|
|
4800
4811
|
size: 40,
|
|
4801
4812
|
"stroke-width": 1,
|
|
4802
4813
|
style: { color: "var(--tpl-text-dim)" }
|
|
4803
|
-
}), y("p",
|
|
4814
|
+
}), y("p", Cr, _(p(f).mediaLibrary.noFiles), 1)])) : e.layout === "list" ? (o(), O("div", Ir, [(o(!0), O(g, null, i(e.items, (t) => (o(), O("div", {
|
|
4804
4815
|
key: t.id,
|
|
4805
4816
|
class: D(["tpl-media-list-item tpl:group tpl:flex tpl:cursor-pointer tpl:items-center tpl:gap-3 tpl:rounded-lg tpl:px-3 tpl:py-2 tpl:transition-all tpl:duration-150", [!c(t) && !e.selectedIds.has(t.id) ? "tpl:opacity-60" : ""]]),
|
|
4806
4817
|
style: h({ backgroundColor: e.selectedIds.has(t.id) ? "var(--tpl-bg-hover)" : "transparent" }),
|
|
4807
4818
|
onClick: (e) => l(t)
|
|
4808
4819
|
}, [
|
|
4809
|
-
y("div",
|
|
4820
|
+
y("div", Rr, [p(s)(t.mime_type) ? (o(), O("img", {
|
|
4810
4821
|
key: 0,
|
|
4811
4822
|
src: t.small_url || t.url,
|
|
4812
4823
|
alt: t.filename,
|
|
4813
4824
|
class: "tpl:size-full tpl:object-cover",
|
|
4814
4825
|
loading: "lazy"
|
|
4815
|
-
}, null, 8,
|
|
4816
|
-
y("div",
|
|
4817
|
-
y("div",
|
|
4826
|
+
}, null, 8, zr)) : (o(), O("div", Br, [k(br, { "mime-type": t.mime_type }, null, 8, ["mime-type"])]))]),
|
|
4827
|
+
y("div", Vr, [y("p", Hr, _(t.filename), 1), y("p", Ur, [d(_(x(t.size)) + " · " + _(S(t.created_at)) + " ", 1), p(s)(t.mime_type) && t.width && t.height ? (o(), O(g, { key: 0 }, [d(" · " + _(t.width) + "×" + _(t.height), 1)], 64)) : u("", !0)])]),
|
|
4828
|
+
y("div", Wr, [y("button", {
|
|
4818
4829
|
class: "tpl:flex tpl:size-6 tpl:shrink-0 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded",
|
|
4819
4830
|
style: { color: "var(--tpl-text-muted)" },
|
|
4820
4831
|
title: p(f).mediaLibrary.editFile,
|
|
4821
4832
|
onClick: m((e) => r("edit", t), ["stop"])
|
|
4822
|
-
}, [k(p(
|
|
4833
|
+
}, [k(p(ue), {
|
|
4823
4834
|
size: 12,
|
|
4824
4835
|
"stroke-width": 2
|
|
4825
|
-
})], 8,
|
|
4836
|
+
})], 8, Gr), y("button", {
|
|
4826
4837
|
class: "tpl:flex tpl:size-6 tpl:shrink-0 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded",
|
|
4827
4838
|
style: { color: "var(--tpl-text-muted)" },
|
|
4828
4839
|
title: p(f).mediaLibrary.replaceFile,
|
|
4829
4840
|
onClick: m((e) => r("replace", t), ["stop"])
|
|
4830
|
-
}, [k(p(
|
|
4841
|
+
}, [k(p(I), {
|
|
4831
4842
|
size: 12,
|
|
4832
4843
|
"stroke-width": 2
|
|
4833
|
-
})], 8,
|
|
4834
|
-
e.selectedIds.has(t.id) ? (o(), O("div",
|
|
4844
|
+
})], 8, Kr)]),
|
|
4845
|
+
e.selectedIds.has(t.id) ? (o(), O("div", qr, [k(p(ee), {
|
|
4835
4846
|
size: 12,
|
|
4836
4847
|
"stroke-width": 3
|
|
4837
4848
|
})])) : u("", !0)
|
|
4838
|
-
], 14,
|
|
4849
|
+
], 14, Lr))), 128))])) : (o(), O("div", wr, [(o(!0), O(g, null, i(e.items, (t) => (o(), O("div", {
|
|
4839
4850
|
key: t.id,
|
|
4840
4851
|
class: D(["tpl-media-item tpl:group tpl:relative tpl:overflow-hidden tpl:rounded-lg tpl:border-2 tpl:transition-all tpl:duration-150", [
|
|
4841
4852
|
"tpl:cursor-pointer",
|
|
@@ -4848,45 +4859,45 @@ var wn = ["data-tpl-theme"], Tn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, En
|
|
|
4848
4859
|
}),
|
|
4849
4860
|
onClick: (e) => l(t)
|
|
4850
4861
|
}, [
|
|
4851
|
-
y("div",
|
|
4862
|
+
y("div", Er, [p(s)(t.mime_type) ? (o(), O("img", {
|
|
4852
4863
|
key: 0,
|
|
4853
4864
|
src: t.small_url || t.url,
|
|
4854
4865
|
alt: t.filename,
|
|
4855
4866
|
class: "tpl:size-full tpl:object-cover",
|
|
4856
4867
|
loading: "lazy"
|
|
4857
|
-
}, null, 8,
|
|
4868
|
+
}, null, 8, Dr)) : (o(), v(br, {
|
|
4858
4869
|
key: 1,
|
|
4859
4870
|
"mime-type": t.mime_type
|
|
4860
4871
|
}, null, 8, ["mime-type"]))]),
|
|
4861
|
-
y("div",
|
|
4862
|
-
y("div",
|
|
4872
|
+
y("div", Or, [y("p", kr, _(t.filename), 1), y("p", Ar, [y("span", null, _(x(t.size)), 1), p(s)(t.mime_type) && t.width && t.height ? (o(), O("span", jr, _(t.width) + "×" + _(t.height), 1)) : u("", !0)])]),
|
|
4873
|
+
y("div", Mr, [y("button", {
|
|
4863
4874
|
class: "tpl:flex tpl:size-6 tpl:items-center tpl:justify-center tpl:rounded-full tpl:text-white",
|
|
4864
4875
|
style: { "background-color": "rgba(0, 0, 0, 0.6)" },
|
|
4865
4876
|
title: p(f).mediaLibrary.editFile,
|
|
4866
4877
|
onClick: m((e) => r("edit", t), ["stop"])
|
|
4867
|
-
}, [k(p(
|
|
4878
|
+
}, [k(p(ue), {
|
|
4868
4879
|
size: 11,
|
|
4869
4880
|
"stroke-width": 2
|
|
4870
|
-
})], 8,
|
|
4881
|
+
})], 8, Nr), y("button", {
|
|
4871
4882
|
class: "tpl:flex tpl:size-6 tpl:items-center tpl:justify-center tpl:rounded-full tpl:text-white",
|
|
4872
4883
|
style: { "background-color": "rgba(0, 0, 0, 0.6)" },
|
|
4873
4884
|
title: p(f).mediaLibrary.replaceFile,
|
|
4874
4885
|
onClick: m((e) => r("replace", t), ["stop"])
|
|
4875
|
-
}, [k(p(
|
|
4886
|
+
}, [k(p(I), {
|
|
4876
4887
|
size: 11,
|
|
4877
4888
|
"stroke-width": 2
|
|
4878
|
-
})], 8,
|
|
4879
|
-
e.selectedIds.has(t.id) ? (o(), O("div",
|
|
4889
|
+
})], 8, Pr)]),
|
|
4890
|
+
e.selectedIds.has(t.id) ? (o(), O("div", Fr, [k(p(ee), {
|
|
4880
4891
|
size: 12,
|
|
4881
4892
|
"stroke-width": 3
|
|
4882
4893
|
})])) : u("", !0)
|
|
4883
|
-
], 14,
|
|
4894
|
+
], 14, Tr))), 128))])),
|
|
4884
4895
|
y("div", {
|
|
4885
4896
|
ref_key: "sentinelRef",
|
|
4886
4897
|
ref: b,
|
|
4887
4898
|
class: "tpl:h-4"
|
|
4888
4899
|
}, null, 512),
|
|
4889
|
-
e.isLoading && e.items.length > 0 ? (o(), O("div",
|
|
4900
|
+
e.isLoading && e.items.length > 0 ? (o(), O("div", Jr, [k(p(N), {
|
|
4890
4901
|
class: "tpl-spinner",
|
|
4891
4902
|
size: 20,
|
|
4892
4903
|
"stroke-width": 2,
|
|
@@ -4894,20 +4905,20 @@ var wn = ["data-tpl-theme"], Tn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, En
|
|
|
4894
4905
|
})])) : u("", !0)
|
|
4895
4906
|
]));
|
|
4896
4907
|
}
|
|
4897
|
-
}), [["__scopeId", "data-v-78d7ed75"]]),
|
|
4908
|
+
}), [["__scopeId", "data-v-78d7ed75"]]), Xr = ["data-tpl-theme"], Zr = {
|
|
4898
4909
|
class: "tpl:mx-4 tpl:w-full tpl:max-w-sm tpl:rounded-lg tpl:p-5 tpl:shadow-xl",
|
|
4899
4910
|
style: { "background-color": "var(--tpl-bg-elevated)" }
|
|
4900
|
-
},
|
|
4911
|
+
}, Qr = {
|
|
4901
4912
|
class: "tpl:mb-4 tpl:text-sm tpl:font-semibold",
|
|
4902
4913
|
style: { color: "var(--tpl-text)" }
|
|
4903
|
-
},
|
|
4914
|
+
}, $r = { class: "tpl:mb-3" }, ei = ["placeholder", "disabled"], ti = {
|
|
4904
4915
|
key: 0,
|
|
4905
4916
|
class: "tpl:mb-3 tpl:text-xs",
|
|
4906
4917
|
style: { color: "var(--tpl-danger)" }
|
|
4907
|
-
},
|
|
4918
|
+
}, ni = { class: "tpl:flex tpl:justify-end tpl:gap-2" }, ri = ["disabled"], ii = ["disabled"], ai = {
|
|
4908
4919
|
key: 0,
|
|
4909
4920
|
class: "tpl:flex tpl:items-center tpl:gap-1.5"
|
|
4910
|
-
},
|
|
4921
|
+
}, oi = { key: 1 }, si = /* @__PURE__ */ e({
|
|
4911
4922
|
__name: "MediaImportUrlModal",
|
|
4912
4923
|
props: {
|
|
4913
4924
|
visible: { type: Boolean },
|
|
@@ -4945,9 +4956,9 @@ var wn = ["data-tpl-theme"], Tn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, En
|
|
|
4945
4956
|
style: { "background-color": "var(--tpl-overlay)" },
|
|
4946
4957
|
onClick: m(x, ["self"]),
|
|
4947
4958
|
onKeydown: S
|
|
4948
|
-
}, [y("div",
|
|
4949
|
-
y("h3",
|
|
4950
|
-
y("div",
|
|
4959
|
+
}, [y("div", Zr, [
|
|
4960
|
+
y("h3", Qr, _(p(l).mediaLibrary.importFromUrl), 1),
|
|
4961
|
+
y("div", $r, [n(y("input", {
|
|
4951
4962
|
"onUpdate:modelValue": r[0] ||= (e) => g.value = e,
|
|
4952
4963
|
type: "url",
|
|
4953
4964
|
class: "tpl:w-full tpl:rounded-md tpl:border tpl:px-3 tpl:py-1.5 tpl:text-xs tpl:outline-none",
|
|
@@ -4959,9 +4970,9 @@ var wn = ["data-tpl-theme"], Tn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, En
|
|
|
4959
4970
|
placeholder: p(l).mediaLibrary.importUrlPlaceholder,
|
|
4960
4971
|
disabled: e.isImporting,
|
|
4961
4972
|
autofocus: ""
|
|
4962
|
-
}, null, 8,
|
|
4963
|
-
e.error ? (o(), O("p",
|
|
4964
|
-
y("div",
|
|
4973
|
+
}, null, 8, ei), [[f, g.value]])]),
|
|
4974
|
+
e.error ? (o(), O("p", ti, _(e.error), 1)) : u("", !0),
|
|
4975
|
+
y("div", ni, [y("button", {
|
|
4965
4976
|
class: D(["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", { "tpl:cursor-not-allowed tpl:opacity-50": e.isImporting }]),
|
|
4966
4977
|
style: {
|
|
4967
4978
|
"border-color": "var(--tpl-border)",
|
|
@@ -4970,25 +4981,25 @@ var wn = ["data-tpl-theme"], Tn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, En
|
|
|
4970
4981
|
},
|
|
4971
4982
|
disabled: e.isImporting,
|
|
4972
4983
|
onClick: x
|
|
4973
|
-
}, _(p(l).mediaLibrary.cancel), 11,
|
|
4984
|
+
}, _(p(l).mediaLibrary.cancel), 11, ri), y("button", {
|
|
4974
4985
|
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",
|
|
4975
4986
|
style: { background: "linear-gradient(\n 135deg,\n var(--tpl-primary),\n var(--tpl-primary-hover)\n )" },
|
|
4976
4987
|
disabled: !g.value.trim() || e.isImporting,
|
|
4977
4988
|
onClick: b
|
|
4978
|
-
}, [e.isImporting ? (o(), O("span",
|
|
4989
|
+
}, [e.isImporting ? (o(), O("span", ai, [k(p(N), {
|
|
4979
4990
|
class: "tpl:animate-spin",
|
|
4980
4991
|
size: 12,
|
|
4981
4992
|
"stroke-width": 2
|
|
4982
|
-
}), d(" " + _(p(l).mediaLibrary.importing), 1)])) : (o(), O("span",
|
|
4983
|
-
])], 40,
|
|
4993
|
+
}), d(" " + _(p(l).mediaLibrary.importing), 1)])) : (o(), O("span", oi, _(p(l).mediaLibrary.import), 1))], 8, ii)])
|
|
4994
|
+
])], 40, Xr)) : u("", !0)]),
|
|
4984
4995
|
_: 1
|
|
4985
4996
|
})]));
|
|
4986
4997
|
}
|
|
4987
|
-
}),
|
|
4998
|
+
}), ci = { class: "tpl:max-h-56 tpl:overflow-y-auto tpl:py-1" }, li = ["disabled", "onClick"], ui = { class: "tpl:truncate" }, di = {
|
|
4988
4999
|
key: 0,
|
|
4989
5000
|
class: "tpl:shrink-0",
|
|
4990
5001
|
style: { color: "var(--tpl-text-dim)" }
|
|
4991
|
-
},
|
|
5002
|
+
}, fi = /* @__PURE__ */ e({
|
|
4992
5003
|
__name: "MediaMovePicker",
|
|
4993
5004
|
props: {
|
|
4994
5005
|
folders: {},
|
|
@@ -5006,7 +5017,7 @@ var wn = ["data-tpl-theme"], Tn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, En
|
|
|
5006
5017
|
}), r.children?.length && n.push(...s(r.children, t + 1));
|
|
5007
5018
|
return n;
|
|
5008
5019
|
}
|
|
5009
|
-
return
|
|
5020
|
+
return ie(a, () => {
|
|
5010
5021
|
n("close");
|
|
5011
5022
|
}), (t, c) => (o(), O("div", {
|
|
5012
5023
|
ref_key: "pickerRef",
|
|
@@ -5016,12 +5027,12 @@ var wn = ["data-tpl-theme"], Tn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, En
|
|
|
5016
5027
|
"border-color": "var(--tpl-border)",
|
|
5017
5028
|
"background-color": "var(--tpl-bg-elevated)"
|
|
5018
5029
|
}
|
|
5019
|
-
}, [y("div",
|
|
5030
|
+
}, [y("div", ci, [e.currentFolderId === null ? u("", !0) : (o(), O("button", {
|
|
5020
5031
|
key: 0,
|
|
5021
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",
|
|
5022
5033
|
style: { color: "var(--tpl-text)" },
|
|
5023
5034
|
onClick: c[0] ||= (e) => n("select", null)
|
|
5024
|
-
}, [k(p(
|
|
5035
|
+
}, [k(p(ye), {
|
|
5025
5036
|
class: "tpl:shrink-0",
|
|
5026
5037
|
size: 14,
|
|
5027
5038
|
"stroke-width": 1.5
|
|
@@ -5036,41 +5047,41 @@ var wn = ["data-tpl-theme"], Tn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, En
|
|
|
5036
5047
|
disabled: t.id === e.currentFolderId,
|
|
5037
5048
|
onClick: (e) => n("select", t.id)
|
|
5038
5049
|
}, [
|
|
5039
|
-
k(p(
|
|
5050
|
+
k(p(_e), {
|
|
5040
5051
|
class: "tpl:shrink-0",
|
|
5041
5052
|
size: 14,
|
|
5042
5053
|
"stroke-width": 1.5
|
|
5043
5054
|
}),
|
|
5044
|
-
y("span",
|
|
5045
|
-
t.id === e.currentFolderId ? (o(), O("span",
|
|
5046
|
-
], 12,
|
|
5055
|
+
y("span", ui, _(t.name), 1),
|
|
5056
|
+
t.id === e.currentFolderId ? (o(), O("span", di, _(p(r).mediaLibrary.currentFolder), 1)) : u("", !0)
|
|
5057
|
+
], 12, li))), 128))])], 512));
|
|
5047
5058
|
}
|
|
5048
|
-
}),
|
|
5059
|
+
}), pi = { class: "tpl:flex tpl:items-center tpl:gap-3" }, mi = ["src", "alt"], hi = {
|
|
5049
5060
|
key: 1,
|
|
5050
5061
|
class: "tpl:flex tpl:size-10 tpl:shrink-0 tpl:items-center tpl:justify-center tpl:overflow-hidden tpl:rounded",
|
|
5051
5062
|
style: { border: "1px solid var(--tpl-border)" }
|
|
5052
|
-
},
|
|
5063
|
+
}, gi = { class: "tpl:min-w-0 tpl:flex-1" }, _i = {
|
|
5053
5064
|
class: "tpl:truncate tpl:text-xs tpl:font-medium",
|
|
5054
5065
|
style: { color: "var(--tpl-text)" }
|
|
5055
|
-
},
|
|
5066
|
+
}, vi = {
|
|
5056
5067
|
class: "tpl:mt-0.5 tpl:text-[10px]",
|
|
5057
5068
|
style: { color: "var(--tpl-text-muted)" }
|
|
5058
|
-
},
|
|
5069
|
+
}, yi = {
|
|
5059
5070
|
key: 2,
|
|
5060
5071
|
class: "tpl:shrink-0"
|
|
5061
|
-
},
|
|
5072
|
+
}, bi = {
|
|
5062
5073
|
class: "tpl:block tpl:text-[10px]",
|
|
5063
5074
|
style: { color: "var(--tpl-text-muted)" }
|
|
5064
|
-
},
|
|
5075
|
+
}, xi = ["value"], Si = ["value"], Ci = /* @__PURE__ */ L(/* @__PURE__ */ e({
|
|
5065
5076
|
__name: "MediaPreviewPanel",
|
|
5066
5077
|
props: {
|
|
5067
5078
|
item: {},
|
|
5068
5079
|
folders: {},
|
|
5069
5080
|
selectedConversion: {}
|
|
5070
5081
|
},
|
|
5071
|
-
emits: ["update:selectedConversion"],
|
|
5082
|
+
emits: ["update:selectedConversion", "template-width"],
|
|
5072
5083
|
setup(e, { emit: t }) {
|
|
5073
|
-
let n = e, r = t, { t: a } = z(), { isImageMimeType: s } =
|
|
5084
|
+
let n = e, r = t, { t: a } = z(), { isImageMimeType: s } = Oe(), c = S(() => {
|
|
5074
5085
|
if (!b.value || !n.item.conversions_generated) return [];
|
|
5075
5086
|
let e = [];
|
|
5076
5087
|
return n.item.small_url && e.push({
|
|
@@ -5100,8 +5111,8 @@ var wn = ["data-tpl-theme"], Tn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, En
|
|
|
5100
5111
|
}
|
|
5101
5112
|
});
|
|
5102
5113
|
function m(e) {
|
|
5103
|
-
let t = e.target;
|
|
5104
|
-
r("update:selectedConversion", t
|
|
5114
|
+
let t = e.target.value;
|
|
5115
|
+
r("update:selectedConversion", t), r("template-width", xe(t));
|
|
5105
5116
|
}
|
|
5106
5117
|
function h(e, t, n = []) {
|
|
5107
5118
|
for (let r of e) {
|
|
@@ -5129,25 +5140,25 @@ var wn = ["data-tpl-theme"], Tn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, En
|
|
|
5129
5140
|
day: "numeric"
|
|
5130
5141
|
});
|
|
5131
5142
|
}
|
|
5132
|
-
return (t, n) => (o(), O("div",
|
|
5143
|
+
return (t, n) => (o(), O("div", pi, [
|
|
5133
5144
|
b.value ? (o(), O("img", {
|
|
5134
5145
|
key: 0,
|
|
5135
5146
|
src: f.value ?? void 0,
|
|
5136
5147
|
alt: e.item.alt_text || e.item.filename,
|
|
5137
5148
|
class: "tpl:size-10 tpl:shrink-0 tpl:rounded tpl:object-cover",
|
|
5138
5149
|
style: { border: "1px solid var(--tpl-border)" }
|
|
5139
|
-
}, null, 8,
|
|
5150
|
+
}, null, 8, mi)) : (o(), O("div", hi, [k(br, {
|
|
5140
5151
|
"mime-type": e.item.mime_type,
|
|
5141
5152
|
class: "tpl-preview-icon"
|
|
5142
5153
|
}, null, 8, ["mime-type"])])),
|
|
5143
|
-
y("div",
|
|
5144
|
-
y("p",
|
|
5145
|
-
y("p",
|
|
5154
|
+
y("div", gi, [
|
|
5155
|
+
y("p", _i, _(e.item.filename), 1),
|
|
5156
|
+
y("p", vi, [
|
|
5146
5157
|
d(_(x(e.item.size)) + " · " + _(C(e.item.created_at)) + " ", 1),
|
|
5147
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),
|
|
5148
5159
|
v.value ? (o(), O(g, { key: 1 }, [
|
|
5149
5160
|
n[0] ||= d(" · ", -1),
|
|
5150
|
-
k(p(
|
|
5161
|
+
k(p(_e), {
|
|
5151
5162
|
class: "tpl:mb-px tpl:inline",
|
|
5152
5163
|
size: 9,
|
|
5153
5164
|
"stroke-width": 2
|
|
@@ -5161,7 +5172,7 @@ var wn = ["data-tpl-theme"], Tn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, En
|
|
|
5161
5172
|
style: { color: "var(--tpl-text-dim)" }
|
|
5162
5173
|
}, _(e.item.alt_text || "\xA0"), 3)) : u("", !0)
|
|
5163
5174
|
]),
|
|
5164
|
-
l.value ? (o(), O("div",
|
|
5175
|
+
l.value ? (o(), O("div", yi, [y("label", bi, _(p(a).mediaLibrary.conversionLabel), 1), y("select", {
|
|
5165
5176
|
class: "tpl:mt-0.5 tpl:rounded-md tpl:border tpl:py-1 tpl:pr-6 tpl:pl-2 tpl:text-xs tpl:outline-none",
|
|
5166
5177
|
style: {
|
|
5167
5178
|
"border-color": "var(--tpl-border)",
|
|
@@ -5173,36 +5184,36 @@ var wn = ["data-tpl-theme"], Tn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, En
|
|
|
5173
5184
|
}, [(o(!0), O(g, null, i(c.value, (e) => (o(), O("option", {
|
|
5174
5185
|
key: e.value,
|
|
5175
5186
|
value: e.value
|
|
5176
|
-
}, _(e.label), 9,
|
|
5187
|
+
}, _(e.label), 9, Si))), 128))], 40, xi)])) : u("", !0)
|
|
5177
5188
|
]));
|
|
5178
5189
|
}
|
|
5179
|
-
}), [["__scopeId", "data-v-
|
|
5190
|
+
}), [["__scopeId", "data-v-a5a005e6"]]), wi = ["data-tpl-theme"], Ti = {
|
|
5180
5191
|
class: "tpl:mx-4 tpl:w-full tpl:max-w-sm tpl:rounded-lg tpl:p-5 tpl:shadow-xl",
|
|
5181
5192
|
style: { "background-color": "var(--tpl-bg-elevated)" }
|
|
5182
|
-
},
|
|
5193
|
+
}, Ei = {
|
|
5183
5194
|
class: "tpl:mb-2 tpl:text-sm tpl:font-semibold",
|
|
5184
5195
|
style: { color: "var(--tpl-text)" }
|
|
5185
|
-
},
|
|
5196
|
+
}, Di = {
|
|
5186
5197
|
class: "tpl:mb-2 tpl:text-xs",
|
|
5187
5198
|
style: { color: "var(--tpl-text-muted)" }
|
|
5188
|
-
},
|
|
5199
|
+
}, Oi = {
|
|
5189
5200
|
key: 0,
|
|
5190
5201
|
class: "tpl:mb-3 tpl:text-xs",
|
|
5191
5202
|
style: { color: "var(--tpl-warning)" }
|
|
5192
|
-
},
|
|
5203
|
+
}, ki = {
|
|
5193
5204
|
class: "tpl:mb-3 tpl:rounded tpl:border tpl:p-2",
|
|
5194
5205
|
style: { "border-color": "var(--tpl-border)" }
|
|
5195
|
-
},
|
|
5206
|
+
}, Ai = {
|
|
5196
5207
|
class: "tpl:truncate tpl:text-xs tpl:font-medium",
|
|
5197
5208
|
style: { color: "var(--tpl-text)" }
|
|
5198
|
-
},
|
|
5209
|
+
}, ji = { class: "tpl:mb-4" }, Mi = {
|
|
5199
5210
|
class: "tpl:mb-1 tpl:block tpl:text-xs tpl:font-medium",
|
|
5200
5211
|
style: { color: "var(--tpl-text-muted)" }
|
|
5201
|
-
},
|
|
5212
|
+
}, Ni = ["accept"], Pi = {
|
|
5202
5213
|
key: 1,
|
|
5203
5214
|
class: "tpl:mb-3 tpl:text-xs",
|
|
5204
5215
|
style: { color: "var(--tpl-danger)" }
|
|
5205
|
-
},
|
|
5216
|
+
}, Fi = { class: "tpl:flex tpl:justify-end tpl:gap-2" }, Ii = ["disabled"], Li = ["disabled"], Ri = /* @__PURE__ */ e({
|
|
5206
5217
|
__name: "MediaReplaceModal",
|
|
5207
5218
|
props: {
|
|
5208
5219
|
visible: { type: Boolean },
|
|
@@ -5246,12 +5257,12 @@ var wn = ["data-tpl-theme"], Tn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, En
|
|
|
5246
5257
|
style: { "background-color": "var(--tpl-overlay)" },
|
|
5247
5258
|
onClick: n[1] ||= m((e) => a("close"), ["self"]),
|
|
5248
5259
|
onKeydown: D
|
|
5249
|
-
}, [y("div",
|
|
5250
|
-
y("h3",
|
|
5251
|
-
y("p",
|
|
5252
|
-
b.value ? (o(), O("p",
|
|
5253
|
-
y("div",
|
|
5254
|
-
y("div",
|
|
5260
|
+
}, [y("div", Ti, [
|
|
5261
|
+
y("h3", Ei, _(p(s).mediaLibrary.replaceWarningTitle), 1),
|
|
5262
|
+
y("p", Di, _(p(s).mediaLibrary.replaceWarningMessage.replace("{extension}", `.${h.value}`)), 1),
|
|
5263
|
+
b.value ? (o(), O("p", Oi, _(p(s).mediaLibrary.replaceWarningUsageNote.replace("{count}", e.usageInfo.template_count.toString())), 1)) : u("", !0),
|
|
5264
|
+
y("div", ki, [y("p", Ai, _(e.item.filename), 1)]),
|
|
5265
|
+
y("div", ji, [y("label", Mi, _(p(s).mediaLibrary.replaceSelectFile), 1), y("input", {
|
|
5255
5266
|
ref_key: "fileInputRef",
|
|
5256
5267
|
ref: d,
|
|
5257
5268
|
type: "file",
|
|
@@ -5263,9 +5274,9 @@ var wn = ["data-tpl-theme"], Tn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, En
|
|
|
5263
5274
|
color: "var(--tpl-text)"
|
|
5264
5275
|
},
|
|
5265
5276
|
onChange: x
|
|
5266
|
-
}, null, 40,
|
|
5267
|
-
e.error ? (o(), O("p",
|
|
5268
|
-
y("div",
|
|
5277
|
+
}, null, 40, Ni)]),
|
|
5278
|
+
e.error ? (o(), O("p", Pi, _(e.error), 1)) : u("", !0),
|
|
5279
|
+
y("div", Fi, [y("button", {
|
|
5269
5280
|
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",
|
|
5270
5281
|
style: {
|
|
5271
5282
|
"border-color": "var(--tpl-border)",
|
|
@@ -5274,29 +5285,29 @@ var wn = ["data-tpl-theme"], Tn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, En
|
|
|
5274
5285
|
},
|
|
5275
5286
|
disabled: e.isReplacing,
|
|
5276
5287
|
onClick: n[0] ||= (e) => a("close")
|
|
5277
|
-
}, _(p(s).mediaLibrary.cancel), 9,
|
|
5288
|
+
}, _(p(s).mediaLibrary.cancel), 9, Ii), y("button", {
|
|
5278
5289
|
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",
|
|
5279
5290
|
style: { background: "linear-gradient(\n 135deg,\n var(--tpl-primary),\n var(--tpl-primary-hover)\n )" },
|
|
5280
5291
|
disabled: !f.value || e.isReplacing,
|
|
5281
5292
|
onClick: E
|
|
5282
|
-
}, _(e.isReplacing ? p(s).mediaLibrary.replacing : p(s).mediaLibrary.replace), 9,
|
|
5283
|
-
])], 40,
|
|
5293
|
+
}, _(e.isReplacing ? p(s).mediaLibrary.replacing : p(s).mediaLibrary.replace), 9, Li)])
|
|
5294
|
+
])], 40, wi)) : u("", !0)]),
|
|
5284
5295
|
_: 1
|
|
5285
5296
|
})]));
|
|
5286
5297
|
}
|
|
5287
|
-
}),
|
|
5298
|
+
}), zi = {
|
|
5288
5299
|
key: 0,
|
|
5289
5300
|
class: "tpl:flex tpl:items-center tpl:gap-2"
|
|
5290
|
-
},
|
|
5301
|
+
}, Bi = {
|
|
5291
5302
|
class: "tpl:text-xs",
|
|
5292
5303
|
style: { color: "var(--tpl-text-muted)" }
|
|
5293
|
-
},
|
|
5304
|
+
}, Vi = {
|
|
5294
5305
|
class: "tpl:text-xs",
|
|
5295
5306
|
style: { color: "var(--tpl-text-muted)" }
|
|
5296
|
-
},
|
|
5307
|
+
}, Hi = {
|
|
5297
5308
|
class: "tpl:mt-1 tpl:text-[10px]",
|
|
5298
5309
|
style: { color: "var(--tpl-text-dim)" }
|
|
5299
|
-
},
|
|
5310
|
+
}, Ui = /* @__PURE__ */ e({
|
|
5300
5311
|
__name: "MediaUploadZone",
|
|
5301
5312
|
props: {
|
|
5302
5313
|
isUploading: { type: Boolean },
|
|
@@ -5304,7 +5315,7 @@ var wn = ["data-tpl-theme"], Tn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, En
|
|
|
5304
5315
|
},
|
|
5305
5316
|
emits: ["upload"],
|
|
5306
5317
|
setup(e, { emit: t }) {
|
|
5307
|
-
let n = t, { t: r, format: i } = z(), { allAcceptedMimeTypes: a, allAcceptedInputString: s, maxFileSize: c } =
|
|
5318
|
+
let n = t, { t: r, format: i } = z(), { allAcceptedMimeTypes: a, allAcceptedInputString: s, maxFileSize: c } = Oe(), l = T();
|
|
5308
5319
|
function u(e) {
|
|
5309
5320
|
let t = [];
|
|
5310
5321
|
for (let n of Array.from(e)) a.value.includes(n.type) && n.size <= c.value && t.push(n);
|
|
@@ -5314,9 +5325,9 @@ var wn = ["data-tpl-theme"], Tn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, En
|
|
|
5314
5325
|
let t = u(e);
|
|
5315
5326
|
t.length && n("upload", t);
|
|
5316
5327
|
}
|
|
5317
|
-
let { isOverDropZone: f } =
|
|
5328
|
+
let { isOverDropZone: f } = oe(l, { onDrop: (e) => {
|
|
5318
5329
|
e?.length && d(e);
|
|
5319
|
-
} }), { open: m, onChange: h } =
|
|
5330
|
+
} }), { open: m, onChange: h } = F({
|
|
5320
5331
|
accept: s.value,
|
|
5321
5332
|
multiple: !0
|
|
5322
5333
|
});
|
|
@@ -5331,35 +5342,35 @@ var wn = ["data-tpl-theme"], Tn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, En
|
|
|
5331
5342
|
"background-color": "var(--tpl-bg)"
|
|
5332
5343
|
},
|
|
5333
5344
|
onClick: n[0] ||= (e) => p(m)()
|
|
5334
|
-
}, [e.isUploading ? (o(), O("div",
|
|
5345
|
+
}, [e.isUploading ? (o(), O("div", zi, [k(p(N), {
|
|
5335
5346
|
class: "tpl-spinner",
|
|
5336
5347
|
size: 20,
|
|
5337
5348
|
"stroke-width": 2,
|
|
5338
5349
|
style: { color: "var(--tpl-primary)" }
|
|
5339
|
-
}), y("span",
|
|
5350
|
+
}), y("span", Bi, _(e.uploadProgress && e.uploadProgress.total > 1 ? p(i)(p(r).mediaLibrary.uploadingProgress, {
|
|
5340
5351
|
current: e.uploadProgress.current,
|
|
5341
5352
|
total: e.uploadProgress.total
|
|
5342
5353
|
}) : p(r).mediaLibrary.uploading), 1)])) : (o(), O(g, { key: 1 }, [
|
|
5343
|
-
k(p(
|
|
5354
|
+
k(p(re), {
|
|
5344
5355
|
class: "tpl:mb-2",
|
|
5345
5356
|
size: 24,
|
|
5346
5357
|
"stroke-width": 1.5,
|
|
5347
5358
|
style: { color: "var(--tpl-text-dim)" }
|
|
5348
5359
|
}),
|
|
5349
|
-
y("p",
|
|
5350
|
-
y("p",
|
|
5360
|
+
y("p", Vi, _(p(r).mediaLibrary.dropOrClick), 1),
|
|
5361
|
+
y("p", Hi, _(p(r).mediaLibrary.acceptedFormats), 1)
|
|
5351
5362
|
], 64))], 2));
|
|
5352
5363
|
}
|
|
5353
|
-
}),
|
|
5364
|
+
}), Wi = [
|
|
5354
5365
|
"width",
|
|
5355
5366
|
"height",
|
|
5356
5367
|
"viewBox"
|
|
5357
|
-
],
|
|
5368
|
+
], Gi = [
|
|
5358
5369
|
"cx",
|
|
5359
5370
|
"cy",
|
|
5360
5371
|
"r",
|
|
5361
5372
|
"stroke-width"
|
|
5362
|
-
],
|
|
5373
|
+
], Ki = [
|
|
5363
5374
|
"cx",
|
|
5364
5375
|
"cy",
|
|
5365
5376
|
"r",
|
|
@@ -5367,14 +5378,14 @@ var wn = ["data-tpl-theme"], Tn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, En
|
|
|
5367
5378
|
"stroke",
|
|
5368
5379
|
"stroke-dasharray",
|
|
5369
5380
|
"stroke-dashoffset"
|
|
5370
|
-
],
|
|
5381
|
+
], qi = {
|
|
5371
5382
|
key: 0,
|
|
5372
5383
|
class: "tpl:absolute tpl:top-full tpl:left-1/2 tpl:z-50 tpl:mt-2 tpl:-translate-x-1/2 tpl:rounded-md tpl:px-2.5 tpl:py-1.5 tpl:text-xs tpl:whitespace-nowrap tpl:shadow-lg",
|
|
5373
5384
|
style: {
|
|
5374
5385
|
"background-color": "var(--tpl-text)",
|
|
5375
5386
|
color: "var(--tpl-bg-elevated)"
|
|
5376
5387
|
}
|
|
5377
|
-
},
|
|
5388
|
+
}, Ji = /* @__PURE__ */ e({
|
|
5378
5389
|
__name: "StorageProgressRing",
|
|
5379
5390
|
props: {
|
|
5380
5391
|
usedBytes: {},
|
|
@@ -5414,7 +5425,7 @@ var wn = ["data-tpl-theme"], Tn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, En
|
|
|
5414
5425
|
fill: "none",
|
|
5415
5426
|
"stroke-width": s.value,
|
|
5416
5427
|
style: { stroke: "var(--tpl-border)" }
|
|
5417
|
-
}, null, 8,
|
|
5428
|
+
}, null, 8, Gi), y("circle", {
|
|
5418
5429
|
cx: a.value / 2,
|
|
5419
5430
|
cy: a.value / 2,
|
|
5420
5431
|
r: l.value,
|
|
@@ -5425,7 +5436,7 @@ var wn = ["data-tpl-theme"], Tn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, En
|
|
|
5425
5436
|
"stroke-dasharray": f.value,
|
|
5426
5437
|
"stroke-dashoffset": m.value,
|
|
5427
5438
|
class: "tpl:transition-all tpl:duration-300 tpl:ease-out"
|
|
5428
|
-
}, null, 8,
|
|
5439
|
+
}, null, 8, Ki)], 8, Wi)), k(C, {
|
|
5429
5440
|
"enter-active-class": "tpl:transition tpl:ease-out tpl:duration-150",
|
|
5430
5441
|
"enter-from-class": "tpl:opacity-0 tpl:translate-y-1",
|
|
5431
5442
|
"enter-to-class": "tpl:opacity-100 tpl:translate-y-0",
|
|
@@ -5433,7 +5444,7 @@ var wn = ["data-tpl-theme"], Tn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, En
|
|
|
5433
5444
|
"leave-from-class": "tpl:opacity-100 tpl:translate-y-0",
|
|
5434
5445
|
"leave-to-class": "tpl:opacity-0 tpl:translate-y-1"
|
|
5435
5446
|
}, {
|
|
5436
|
-
default: c(() => [i.value ? (o(), O("div",
|
|
5447
|
+
default: c(() => [i.value ? (o(), O("div", qi, [d(_(E.value) + " ", 1), t[2] ||= y("div", {
|
|
5437
5448
|
class: "tpl:absolute tpl:-top-1 tpl:left-1/2 tpl:size-2 tpl:-translate-x-1/2 tpl:rotate-45",
|
|
5438
5449
|
style: { "background-color": "var(--tpl-text)" }
|
|
5439
5450
|
}, null, -1)])) : u("", !0)]),
|
|
@@ -5443,7 +5454,7 @@ var wn = ["data-tpl-theme"], Tn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, En
|
|
|
5443
5454
|
});
|
|
5444
5455
|
//#endregion
|
|
5445
5456
|
//#region ../media-library/src/composables/useMediaLibraryUI.ts
|
|
5446
|
-
function
|
|
5457
|
+
function Yi(e) {
|
|
5447
5458
|
let { library: t, canUseMediaFolders: n, translations: i } = e;
|
|
5448
5459
|
function a() {
|
|
5449
5460
|
return "value" in i && typeof i.value == "object" ? i.value : i;
|
|
@@ -5471,13 +5482,13 @@ function qi(e) {
|
|
|
5471
5482
|
}), r(() => t.previewItem.value?.id, () => {
|
|
5472
5483
|
l.value = "original";
|
|
5473
5484
|
});
|
|
5474
|
-
let y =
|
|
5485
|
+
let y = ne((e) => {
|
|
5475
5486
|
t.search(e);
|
|
5476
5487
|
}, 300);
|
|
5477
5488
|
function b(e) {
|
|
5478
5489
|
c.value = e, y(e);
|
|
5479
5490
|
}
|
|
5480
|
-
let { copy: x, copied: C } =
|
|
5491
|
+
let { copy: x, copied: C } = se({
|
|
5481
5492
|
copiedDuring: 2e3,
|
|
5482
5493
|
legacy: !0
|
|
5483
5494
|
});
|
|
@@ -5502,22 +5513,22 @@ function qi(e) {
|
|
|
5502
5513
|
async function j(e, n, r, i) {
|
|
5503
5514
|
i && await t.replaceMediaDirectly(e, i.file), await t.updateFile(e, n, r), u.value = null;
|
|
5504
5515
|
}
|
|
5505
|
-
async function
|
|
5516
|
+
async function ee(e) {
|
|
5506
5517
|
await t.importFromUrl(e) && (d.value = !1);
|
|
5507
5518
|
}
|
|
5508
|
-
async function
|
|
5519
|
+
async function te(e) {
|
|
5509
5520
|
f.value = !1, await t.moveSelected(e);
|
|
5510
5521
|
}
|
|
5511
|
-
async function
|
|
5522
|
+
async function M() {
|
|
5512
5523
|
await t.checkUsageBeforeDelete();
|
|
5513
5524
|
}
|
|
5514
|
-
function
|
|
5525
|
+
function N(e) {
|
|
5515
5526
|
t.checkUsageBeforeReplace(e);
|
|
5516
5527
|
}
|
|
5517
|
-
async function
|
|
5528
|
+
async function P(e) {
|
|
5518
5529
|
await t.replaceFile(e);
|
|
5519
5530
|
}
|
|
5520
|
-
function
|
|
5531
|
+
function F() {
|
|
5521
5532
|
t.clearSelection(), t.cancelDelete(), t.cancelReplace(), c.value = "", t.categoryFilter.value = null, t.sortOption.value = "newest", t.viewMode.value = "files", u.value = null, d.value = !1, l.value = "original";
|
|
5522
5533
|
}
|
|
5523
5534
|
return {
|
|
@@ -5543,17 +5554,17 @@ function qi(e) {
|
|
|
5543
5554
|
handleDeleteFolder: k,
|
|
5544
5555
|
handleEditItem: A,
|
|
5545
5556
|
handleEditSave: j,
|
|
5546
|
-
handleImportFromUrl:
|
|
5547
|
-
handleMoveToFolder:
|
|
5548
|
-
handleDeleteClick:
|
|
5549
|
-
handleReplaceItem:
|
|
5550
|
-
handleReplaceFile:
|
|
5551
|
-
resetUI:
|
|
5557
|
+
handleImportFromUrl: ee,
|
|
5558
|
+
handleMoveToFolder: te,
|
|
5559
|
+
handleDeleteClick: M,
|
|
5560
|
+
handleReplaceItem: N,
|
|
5561
|
+
handleReplaceFile: P,
|
|
5562
|
+
resetUI: F
|
|
5552
5563
|
};
|
|
5553
5564
|
}
|
|
5554
5565
|
//#endregion
|
|
5555
5566
|
//#region ../media-library/src/components/MediaLibraryModal.vue?vue&type=script&setup=true&lang.ts
|
|
5556
|
-
var
|
|
5567
|
+
var Xi = ["data-tpl-theme"], Zi = {
|
|
5557
5568
|
class: "tpl-media-modal tpl-scale-in tpl:flex tpl:flex-col tpl:overflow-hidden tpl:rounded-[var(--tpl-radius-lg)]",
|
|
5558
5569
|
style: {
|
|
5559
5570
|
width: "900px",
|
|
@@ -5564,73 +5575,77 @@ var Ji = ["data-tpl-theme"], Yi = {
|
|
|
5564
5575
|
border: "1px solid var(--tpl-border)",
|
|
5565
5576
|
"box-shadow": "var(--tpl-shadow-xl)"
|
|
5566
5577
|
}
|
|
5567
|
-
},
|
|
5578
|
+
}, Qi = {
|
|
5568
5579
|
class: "tpl:flex tpl:shrink-0 tpl:items-center tpl:justify-between tpl:border-b tpl:px-5 tpl:py-3.5",
|
|
5569
5580
|
style: { "border-color": "var(--tpl-border)" }
|
|
5570
|
-
},
|
|
5581
|
+
}, $i = {
|
|
5571
5582
|
class: "tpl:text-sm tpl:font-semibold",
|
|
5572
5583
|
style: { color: "var(--tpl-text)" }
|
|
5573
|
-
},
|
|
5584
|
+
}, ea = { class: "tpl:flex tpl:items-center tpl:gap-3" }, ta = { class: "tpl:relative" }, na = ["value", "placeholder"], ra = { class: "tpl:flex tpl:min-h-0 tpl:flex-1 tpl:overflow-hidden" }, ia = {
|
|
5574
5585
|
key: 0,
|
|
5575
5586
|
class: "tpl:flex tpl:w-48 tpl:shrink-0 tpl:flex-col tpl:border-r",
|
|
5576
5587
|
style: {
|
|
5577
5588
|
"border-color": "var(--tpl-border)",
|
|
5578
5589
|
"background-color": "var(--tpl-bg)"
|
|
5579
5590
|
}
|
|
5580
|
-
},
|
|
5591
|
+
}, aa = { class: "tpl:flex tpl:min-w-0 tpl:flex-1 tpl:flex-col" }, oa = {
|
|
5581
5592
|
class: "tpl:flex tpl:shrink-0 tpl:items-center tpl:justify-between tpl:border-b tpl:px-4 tpl:py-2.5",
|
|
5582
5593
|
style: { "border-color": "var(--tpl-border)" }
|
|
5583
|
-
},
|
|
5594
|
+
}, sa = { class: "tpl:flex tpl:items-center tpl:gap-2" }, ca = ["title"], la = {
|
|
5584
5595
|
key: 1,
|
|
5585
5596
|
class: "tpl:text-xs tpl:font-medium",
|
|
5586
5597
|
style: { color: "var(--tpl-text)" }
|
|
5587
|
-
},
|
|
5598
|
+
}, ua = {
|
|
5588
5599
|
class: "tpl:flex tpl:rounded-md tpl:p-0.5",
|
|
5589
5600
|
style: {
|
|
5590
5601
|
border: "1px solid var(--tpl-border)",
|
|
5591
5602
|
"background-color": "var(--tpl-bg)"
|
|
5592
5603
|
}
|
|
5593
|
-
},
|
|
5604
|
+
}, da = ["title"], fa = ["title"], pa = { class: "tpl:flex tpl:items-center tpl:gap-2" }, ma = ["value"], ha = { value: "" }, ga = ["value"], _a = ["value"], va = { value: "newest" }, ya = { value: "oldest" }, ba = { value: "name_asc" }, xa = { value: "name_desc" }, Sa = { value: "size_asc" }, Ca = { value: "size_desc" }, wa = { class: "tpl:min-h-0 tpl:flex-1 tpl:overflow-y-auto" }, Ta = {
|
|
5594
5605
|
key: 0,
|
|
5595
5606
|
class: "tpl:px-4 tpl:pt-3"
|
|
5596
|
-
},
|
|
5607
|
+
}, Ea = {
|
|
5597
5608
|
class: "tpl-scale-in tpl:mx-4 tpl:w-full tpl:max-w-sm tpl:rounded-[var(--tpl-radius-lg)] tpl:p-5",
|
|
5598
5609
|
style: {
|
|
5599
5610
|
"background-color": "var(--tpl-bg-elevated)",
|
|
5600
5611
|
"box-shadow": "var(--tpl-shadow-xl)"
|
|
5601
5612
|
}
|
|
5602
|
-
},
|
|
5613
|
+
}, Da = {
|
|
5603
5614
|
class: "tpl:mb-2 tpl:text-sm tpl:font-semibold",
|
|
5604
5615
|
style: { color: "var(--tpl-text)" }
|
|
5605
|
-
},
|
|
5616
|
+
}, Oa = {
|
|
5606
5617
|
key: 0,
|
|
5607
5618
|
class: "tpl:mb-4 tpl:text-xs",
|
|
5608
5619
|
style: { color: "var(--tpl-text-muted)" }
|
|
5609
|
-
},
|
|
5620
|
+
}, ka = {
|
|
5610
5621
|
key: 1,
|
|
5611
5622
|
class: "tpl:mb-4 tpl:max-h-32 tpl:overflow-y-auto tpl:rounded tpl:border tpl:p-2",
|
|
5612
5623
|
style: { "border-color": "var(--tpl-border)" }
|
|
5613
|
-
},
|
|
5624
|
+
}, Aa = { class: "tpl:font-medium" }, ja = { style: { color: "var(--tpl-text-muted)" } }, Ma = { class: "tpl:flex tpl:justify-end tpl:gap-2" }, Na = {
|
|
5614
5625
|
class: "tpl:flex tpl:shrink-0 tpl:items-center tpl:justify-between tpl:border-t tpl:px-5 tpl:py-3",
|
|
5615
5626
|
style: { "border-color": "var(--tpl-border)" }
|
|
5616
|
-
},
|
|
5627
|
+
}, Pa = { class: "tpl:flex tpl:min-w-0 tpl:flex-1 tpl:items-center tpl:gap-3" }, Fa = { class: "tpl:flex tpl:items-center tpl:gap-5" }, Ia = {
|
|
5617
5628
|
key: 0,
|
|
5618
5629
|
class: "tpl:flex tpl:items-center tpl:gap-2"
|
|
5619
|
-
},
|
|
5630
|
+
}, La = {
|
|
5620
5631
|
key: 1,
|
|
5621
5632
|
class: "tpl:relative"
|
|
5622
|
-
},
|
|
5633
|
+
}, Ra = { class: "tpl:flex tpl:items-center tpl:gap-2" }, za = ["disabled"], Ba = /* @__PURE__ */ e({
|
|
5623
5634
|
__name: "MediaLibraryModal",
|
|
5624
5635
|
props: {
|
|
5625
5636
|
visible: { type: Boolean },
|
|
5626
5637
|
accept: {}
|
|
5627
5638
|
},
|
|
5628
|
-
emits: [
|
|
5639
|
+
emits: [
|
|
5640
|
+
"close",
|
|
5641
|
+
"select",
|
|
5642
|
+
"template-width-preview"
|
|
5643
|
+
],
|
|
5629
5644
|
setup(e, { emit: n }) {
|
|
5630
|
-
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")),
|
|
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")), te = S(() => E.config.value?.storage.used_bytes ?? 0), ne = S(() => E.config.value?.storage.limit_bytes ?? 0), { isAcceptedMimeType: N, availableCategories: P } = Oe(), F = Ce({
|
|
5631
5646
|
projectId: T.value,
|
|
5632
5647
|
authManager: b
|
|
5633
|
-
}), I =
|
|
5648
|
+
}), I = Yi({
|
|
5634
5649
|
library: F,
|
|
5635
5650
|
canUseMediaFolders: A,
|
|
5636
5651
|
translations: l
|
|
@@ -5638,20 +5653,20 @@ var Ji = ["data-tpl-theme"], Yi = {
|
|
|
5638
5653
|
r(() => a.visible, (e) => {
|
|
5639
5654
|
e ? (F.loadItems(), F.loadFrequentlyUsed()) : I.resetUI();
|
|
5640
5655
|
});
|
|
5641
|
-
function
|
|
5656
|
+
function L(e) {
|
|
5642
5657
|
e.key === "Escape" && s("close");
|
|
5643
5658
|
}
|
|
5644
|
-
|
|
5645
|
-
function
|
|
5646
|
-
return F.previewItem.value ? a.accept?.length ?
|
|
5659
|
+
ae(document, "keydown", L);
|
|
5660
|
+
function re() {
|
|
5661
|
+
return F.previewItem.value ? a.accept?.length ? N(F.previewItem.value.mime_type, a.accept) : !0 : !1;
|
|
5647
5662
|
}
|
|
5648
|
-
function
|
|
5649
|
-
if (
|
|
5663
|
+
function R() {
|
|
5664
|
+
if (re()) {
|
|
5650
5665
|
let e = F.previewItem.value;
|
|
5651
5666
|
s("select", {
|
|
5652
5667
|
...e,
|
|
5653
5668
|
url: I.selectedUrl.value || e.url
|
|
5654
|
-
}), s("close");
|
|
5669
|
+
}, xe(I.selectedConversion.value)), s("close");
|
|
5655
5670
|
}
|
|
5656
5671
|
}
|
|
5657
5672
|
return (t, n) => (o(), v(w, { to: "body" }, [k(C, {
|
|
@@ -5666,15 +5681,15 @@ var Ji = ["data-tpl-theme"], Yi = {
|
|
|
5666
5681
|
key: 0,
|
|
5667
5682
|
"data-tpl-theme": p(f),
|
|
5668
5683
|
class: "tpl tpl-media-overlay tpl:fixed tpl:inset-0 tpl:z-[9999]",
|
|
5669
|
-
onClick: n[
|
|
5670
|
-
}, [y("div",
|
|
5671
|
-
y("div",
|
|
5672
|
-
k(
|
|
5673
|
-
"used-bytes":
|
|
5674
|
-
"limit-bytes":
|
|
5684
|
+
onClick: n[19] ||= m((e) => s("close"), ["self"])
|
|
5685
|
+
}, [y("div", Zi, [
|
|
5686
|
+
y("div", Qi, [y("h2", $i, _(p(l).mediaLibrary.title), 1), y("div", ea, [
|
|
5687
|
+
k(Ji, {
|
|
5688
|
+
"used-bytes": te.value,
|
|
5689
|
+
"limit-bytes": ne.value,
|
|
5675
5690
|
size: 22
|
|
5676
5691
|
}, null, 8, ["used-bytes", "limit-bytes"]),
|
|
5677
|
-
y("div",
|
|
5692
|
+
y("div", ta, [y("input", {
|
|
5678
5693
|
value: p(I).searchInput.value,
|
|
5679
5694
|
type: "text",
|
|
5680
5695
|
class: "tpl:w-52 tpl:rounded-md tpl:border tpl:py-1.5 tpl:pr-3 tpl:pl-8 tpl:text-xs tpl:shadow-xs tpl:transition-all tpl:duration-150 tpl:outline-none tpl:focus:shadow-[var(--tpl-ring)]",
|
|
@@ -5685,7 +5700,7 @@ var Ji = ["data-tpl-theme"], Yi = {
|
|
|
5685
5700
|
},
|
|
5686
5701
|
placeholder: p(l).mediaLibrary.searchPlaceholder,
|
|
5687
5702
|
onInput: n[0] ||= (e) => p(I).handleSearchInput(e.target.value)
|
|
5688
|
-
}, null, 40,
|
|
5703
|
+
}, null, 40, na), k(p(fe), {
|
|
5689
5704
|
class: "tpl:absolute tpl:top-1/2 tpl:left-2.5 tpl:-translate-y-1/2",
|
|
5690
5705
|
size: 13,
|
|
5691
5706
|
"stroke-width": 2,
|
|
@@ -5695,12 +5710,12 @@ var Ji = ["data-tpl-theme"], Yi = {
|
|
|
5695
5710
|
class: "tpl:flex tpl:size-7 tpl:items-center tpl:justify-center tpl:rounded-md tpl:transition-all tpl:duration-150",
|
|
5696
5711
|
style: { color: "var(--tpl-text-muted)" },
|
|
5697
5712
|
onClick: n[1] ||= (e) => s("close")
|
|
5698
|
-
}, [k(p(
|
|
5713
|
+
}, [k(p(ce), {
|
|
5699
5714
|
size: 18,
|
|
5700
5715
|
"stroke-width": 2
|
|
5701
5716
|
})])
|
|
5702
5717
|
])]),
|
|
5703
|
-
y("div",
|
|
5718
|
+
y("div", ra, [k(C, {
|
|
5704
5719
|
"enter-active-class": "tpl:transition-all tpl:duration-200 tpl:ease-out",
|
|
5705
5720
|
"enter-from-class": "tpl:-ml-48 tpl:opacity-0",
|
|
5706
5721
|
"enter-to-class": "tpl:ml-0 tpl:opacity-100",
|
|
@@ -5708,7 +5723,7 @@ var Ji = ["data-tpl-theme"], Yi = {
|
|
|
5708
5723
|
"leave-from-class": "tpl:ml-0 tpl:opacity-100",
|
|
5709
5724
|
"leave-to-class": "tpl:-ml-48 tpl:opacity-0"
|
|
5710
5725
|
}, {
|
|
5711
|
-
default: c(() => [A.value && p(I).showSidebar.value ? (o(), O("div",
|
|
5726
|
+
default: c(() => [A.value && p(I).showSidebar.value ? (o(), O("div", ia, [k(vr, {
|
|
5712
5727
|
folders: p(F).folders.value,
|
|
5713
5728
|
"current-folder-id": p(F).currentFolderId.value,
|
|
5714
5729
|
"view-mode": p(F).viewMode.value,
|
|
@@ -5730,7 +5745,7 @@ var Ji = ["data-tpl-theme"], Yi = {
|
|
|
5730
5745
|
"onShowFrequentlyUsed"
|
|
5731
5746
|
])])) : u("", !0)]),
|
|
5732
5747
|
_: 1
|
|
5733
|
-
}), y("div",
|
|
5748
|
+
}), y("div", aa, [y("div", oa, [y("div", sa, [
|
|
5734
5749
|
A.value ? (o(), O("button", {
|
|
5735
5750
|
key: 0,
|
|
5736
5751
|
class: "tpl:flex tpl:size-7 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded-md tpl:transition-all tpl:duration-150",
|
|
@@ -5741,11 +5756,11 @@ var Ji = ["data-tpl-theme"], Yi = {
|
|
|
5741
5756
|
}),
|
|
5742
5757
|
title: p(I).showSidebar.value ? p(l).mediaLibrary.hideFolders : p(l).mediaLibrary.showFolders,
|
|
5743
5758
|
onClick: n[2] ||= (e) => p(I).showSidebar.value = !p(I).showSidebar.value
|
|
5744
|
-
}, [k(p(
|
|
5759
|
+
}, [k(p(de), {
|
|
5745
5760
|
size: 16,
|
|
5746
5761
|
"stroke-width": 2
|
|
5747
|
-
})], 12,
|
|
5748
|
-
p(F).viewMode.value === "frequently-used" ? (o(), O("span",
|
|
5762
|
+
})], 12, ca)) : u("", !0),
|
|
5763
|
+
p(F).viewMode.value === "frequently-used" ? (o(), O("span", la, _(p(l).mediaLibrary.frequentlyUsed), 1)) : (o(), v(De, {
|
|
5749
5764
|
key: 2,
|
|
5750
5765
|
folders: p(F).folders.value,
|
|
5751
5766
|
"current-folder-id": p(F).currentFolderId.value,
|
|
@@ -5755,7 +5770,7 @@ var Ji = ["data-tpl-theme"], Yi = {
|
|
|
5755
5770
|
"current-folder-id",
|
|
5756
5771
|
"onNavigate"
|
|
5757
5772
|
])),
|
|
5758
|
-
y("div",
|
|
5773
|
+
y("div", ua, [y("button", {
|
|
5759
5774
|
class: "tpl:flex tpl:size-6 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded tpl:transition-all tpl:duration-150",
|
|
5760
5775
|
style: h({
|
|
5761
5776
|
color: p(I).layoutMode.value === "grid" ? "var(--tpl-primary)" : "var(--tpl-text-muted)",
|
|
@@ -5763,10 +5778,10 @@ var Ji = ["data-tpl-theme"], Yi = {
|
|
|
5763
5778
|
}),
|
|
5764
5779
|
title: p(l).mediaLibrary.viewGrid,
|
|
5765
5780
|
onClick: n[3] ||= (e) => p(I).layoutMode.value = "grid"
|
|
5766
|
-
}, [k(p(
|
|
5781
|
+
}, [k(p(me), {
|
|
5767
5782
|
size: 14,
|
|
5768
5783
|
"stroke-width": 2
|
|
5769
|
-
})], 12,
|
|
5784
|
+
})], 12, da), y("button", {
|
|
5770
5785
|
class: "tpl:flex tpl:size-6 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded tpl:transition-all tpl:duration-150",
|
|
5771
5786
|
style: h({
|
|
5772
5787
|
color: p(I).layoutMode.value === "list" ? "var(--tpl-primary)" : "var(--tpl-text-muted)",
|
|
@@ -5774,11 +5789,11 @@ var Ji = ["data-tpl-theme"], Yi = {
|
|
|
5774
5789
|
}),
|
|
5775
5790
|
title: p(l).mediaLibrary.viewList,
|
|
5776
5791
|
onClick: n[4] ||= (e) => p(I).layoutMode.value = "list"
|
|
5777
|
-
}, [k(p(
|
|
5792
|
+
}, [k(p(ve), {
|
|
5778
5793
|
size: 14,
|
|
5779
5794
|
"stroke-width": 2
|
|
5780
|
-
})], 12,
|
|
5781
|
-
]), y("div",
|
|
5795
|
+
})], 12, fa)])
|
|
5796
|
+
]), y("div", pa, [p(P).length > 1 ? (o(), O("select", {
|
|
5782
5797
|
key: 0,
|
|
5783
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",
|
|
5784
5799
|
style: {
|
|
@@ -5788,10 +5803,10 @@ var Ji = ["data-tpl-theme"], Yi = {
|
|
|
5788
5803
|
},
|
|
5789
5804
|
value: p(F).categoryFilter.value ?? "",
|
|
5790
5805
|
onChange: n[5] ||= (e) => p(F).filterByCategory(e.target.value || null)
|
|
5791
|
-
}, [y("option",
|
|
5806
|
+
}, [y("option", ha, _(p(l).mediaLibrary.filterAll), 1), (o(!0), O(g, null, i(p(P), (e) => (o(), O("option", {
|
|
5792
5807
|
key: e,
|
|
5793
5808
|
value: e
|
|
5794
|
-
}, _(p(I).getCategoryLabel(e)), 9,
|
|
5809
|
+
}, _(p(I).getCategoryLabel(e)), 9, ga))), 128))], 40, ma)) : u("", !0), y("select", {
|
|
5795
5810
|
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",
|
|
5796
5811
|
style: {
|
|
5797
5812
|
"border-color": "var(--tpl-border)",
|
|
@@ -5801,13 +5816,13 @@ var Ji = ["data-tpl-theme"], Yi = {
|
|
|
5801
5816
|
value: p(F).sortOption.value,
|
|
5802
5817
|
onChange: n[6] ||= (e) => p(F).sortBy(e.target.value)
|
|
5803
5818
|
}, [
|
|
5804
|
-
y("option",
|
|
5805
|
-
y("option",
|
|
5806
|
-
y("option",
|
|
5807
|
-
y("option",
|
|
5808
|
-
y("option",
|
|
5809
|
-
y("option",
|
|
5810
|
-
], 40,
|
|
5819
|
+
y("option", va, _(p(l).mediaLibrary.sortNewest), 1),
|
|
5820
|
+
y("option", ya, _(p(l).mediaLibrary.sortOldest), 1),
|
|
5821
|
+
y("option", ba, _(p(l).mediaLibrary.sortNameAsc), 1),
|
|
5822
|
+
y("option", xa, _(p(l).mediaLibrary.sortNameDesc), 1),
|
|
5823
|
+
y("option", Sa, _(p(l).mediaLibrary.sortSizeAsc), 1),
|
|
5824
|
+
y("option", Ca, _(p(l).mediaLibrary.sortSizeDesc), 1)
|
|
5825
|
+
], 40, _a)])]), y("div", wa, [p(F).viewMode.value === "files" ? (o(), O("div", Ta, [k(Ui, {
|
|
5811
5826
|
"is-uploading": p(F).isUploading.value,
|
|
5812
5827
|
"upload-progress": p(F).uploadProgress.value,
|
|
5813
5828
|
onUpload: p(I).handleUpload
|
|
@@ -5824,10 +5839,10 @@ var Ji = ["data-tpl-theme"], Yi = {
|
|
|
5824
5839
|
"background-color": "var(--tpl-bg)"
|
|
5825
5840
|
},
|
|
5826
5841
|
onClick: n[7] ||= (e) => p(I).showImportUrlModal.value = !0
|
|
5827
|
-
}, [k(p(
|
|
5842
|
+
}, [k(p(pe), {
|
|
5828
5843
|
size: 14,
|
|
5829
5844
|
"stroke-width": 2
|
|
5830
|
-
}), d(" " + _(p(l).mediaLibrary.importFromUrl), 1)])) : u("", !0)])) : u("", !0), k(
|
|
5845
|
+
}), d(" " + _(p(l).mediaLibrary.importFromUrl), 1)])) : u("", !0)])) : u("", !0), k(Yr, {
|
|
5831
5846
|
items: p(I).displayItems.value,
|
|
5832
5847
|
"selected-ids": p(F).selectedItems.value,
|
|
5833
5848
|
"is-loading": p(F).isLoading.value,
|
|
@@ -5852,7 +5867,7 @@ var Ji = ["data-tpl-theme"], Yi = {
|
|
|
5852
5867
|
"onEdit",
|
|
5853
5868
|
"onReplace"
|
|
5854
5869
|
])])])]),
|
|
5855
|
-
k(
|
|
5870
|
+
k(si, {
|
|
5856
5871
|
visible: p(I).showImportUrlModal.value,
|
|
5857
5872
|
"is-importing": p(F).isImportingFromUrl.value,
|
|
5858
5873
|
error: p(F).importFromUrlError.value,
|
|
@@ -5864,7 +5879,7 @@ var Ji = ["data-tpl-theme"], Yi = {
|
|
|
5864
5879
|
"error",
|
|
5865
5880
|
"onImport"
|
|
5866
5881
|
]),
|
|
5867
|
-
k(
|
|
5882
|
+
k(ar, {
|
|
5868
5883
|
visible: !!p(I).editingItem.value,
|
|
5869
5884
|
item: p(I).editingItem.value,
|
|
5870
5885
|
onSave: p(I).handleEditSave,
|
|
@@ -5874,7 +5889,7 @@ var Ji = ["data-tpl-theme"], Yi = {
|
|
|
5874
5889
|
"item",
|
|
5875
5890
|
"onSave"
|
|
5876
5891
|
]),
|
|
5877
|
-
k(
|
|
5892
|
+
k(Ri, {
|
|
5878
5893
|
visible: p(F).showReplaceWarning.value,
|
|
5879
5894
|
item: p(F).pendingReplaceItem.value,
|
|
5880
5895
|
"usage-info": p(F).replaceUsageInfo.value,
|
|
@@ -5908,19 +5923,19 @@ var Ji = ["data-tpl-theme"], Yi = {
|
|
|
5908
5923
|
"-webkit-backdrop-filter": "blur(8px)"
|
|
5909
5924
|
},
|
|
5910
5925
|
onClick: n[12] ||= m((...e) => p(F).cancelDelete && p(F).cancelDelete(...e), ["self"])
|
|
5911
|
-
}, [y("div",
|
|
5912
|
-
y("h3",
|
|
5926
|
+
}, [y("div", Ea, [
|
|
5927
|
+
y("h3", Da, _(p(l).mediaLibrary.deleteWarningTitle), 1),
|
|
5913
5928
|
y("p", {
|
|
5914
5929
|
class: D(["tpl:text-xs", p(I).hasUsedFiles.value ? "tpl:mb-2" : "tpl:mb-4"]),
|
|
5915
5930
|
style: { color: "var(--tpl-text-muted)" }
|
|
5916
5931
|
}, _(p(l).mediaLibrary.deleteWarningMessage), 3),
|
|
5917
|
-
p(I).hasUsedFiles.value ? (o(), O("p",
|
|
5918
|
-
p(I).hasUsedFiles.value ? (o(), O("div",
|
|
5932
|
+
p(I).hasUsedFiles.value ? (o(), O("p", Oa, _(p(l).mediaLibrary.deleteWarningUsageNote), 1)) : u("", !0),
|
|
5933
|
+
p(I).hasUsedFiles.value ? (o(), O("div", ka, [(o(!0), O(g, null, i(p(F).deleteUsageInfo.value, (e, t) => (o(), O("div", {
|
|
5919
5934
|
key: t,
|
|
5920
5935
|
class: "tpl:text-xs",
|
|
5921
5936
|
style: { color: "var(--tpl-text)" }
|
|
5922
|
-
}, [e.template_count > 0 ? (o(), O(g, { key: 0 }, [y("span",
|
|
5923
|
-
y("div",
|
|
5937
|
+
}, [e.template_count > 0 ? (o(), O(g, { key: 0 }, [y("span", Aa, _(p(I).displayItems.value.find((e) => e.id === t)?.filename || t), 1), y("span", ja, " - " + _(p(l).mediaLibrary.usedInTemplates.replace("{count}", e.template_count.toString())), 1)], 64)) : u("", !0)]))), 128))])) : u("", !0),
|
|
5938
|
+
y("div", Ma, [y("button", {
|
|
5924
5939
|
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",
|
|
5925
5940
|
style: {
|
|
5926
5941
|
"border-color": "var(--tpl-border)",
|
|
@@ -5940,17 +5955,18 @@ var Ji = ["data-tpl-theme"], Yi = {
|
|
|
5940
5955
|
])])) : u("", !0)]),
|
|
5941
5956
|
_: 1
|
|
5942
5957
|
}),
|
|
5943
|
-
y("div",
|
|
5958
|
+
y("div", Na, [y("div", Pa, [p(F).previewItem.value ? (o(), v(Ci, {
|
|
5944
5959
|
key: 0,
|
|
5945
5960
|
"selected-conversion": p(I).selectedConversion.value,
|
|
5946
5961
|
"onUpdate:selectedConversion": n[13] ||= (e) => p(I).selectedConversion.value = e,
|
|
5947
5962
|
item: p(F).previewItem.value,
|
|
5948
|
-
folders: p(F).folders.value
|
|
5963
|
+
folders: p(F).folders.value,
|
|
5964
|
+
onTemplateWidth: n[14] ||= (e) => s("template-width-preview", e)
|
|
5949
5965
|
}, null, 8, [
|
|
5950
5966
|
"selected-conversion",
|
|
5951
5967
|
"item",
|
|
5952
5968
|
"folders"
|
|
5953
|
-
])) : u("", !0)]), y("div",
|
|
5969
|
+
])) : u("", !0)]), y("div", Fa, [p(F).selectedItems.value.size > 0 ? (o(), O("div", Ia, [p(F).previewItem.value ? (o(), O("button", {
|
|
5954
5970
|
key: 0,
|
|
5955
5971
|
class: "tpl:flex tpl:cursor-pointer tpl:items-center tpl:gap-1 tpl:rounded-md tpl:border tpl:px-3 tpl:py-1.5 tpl:text-xs tpl:font-medium tpl:transition-all tpl:duration-150",
|
|
5956
5972
|
style: h({
|
|
@@ -5958,34 +5974,34 @@ var Ji = ["data-tpl-theme"], Yi = {
|
|
|
5958
5974
|
color: p(I).copied.value ? "var(--tpl-success)" : "var(--tpl-text)",
|
|
5959
5975
|
backgroundColor: "var(--tpl-bg)"
|
|
5960
5976
|
}),
|
|
5961
|
-
onClick: n[
|
|
5962
|
-
}, [p(I).copied.value ? (o(), v(p(
|
|
5977
|
+
onClick: n[15] ||= (e) => p(I).copy(p(I).selectedUrl.value)
|
|
5978
|
+
}, [p(I).copied.value ? (o(), v(p(ee), {
|
|
5963
5979
|
key: 1,
|
|
5964
5980
|
size: 12,
|
|
5965
5981
|
"stroke-width": 2
|
|
5966
|
-
})) : (o(), v(p(
|
|
5982
|
+
})) : (o(), v(p(M), {
|
|
5967
5983
|
key: 0,
|
|
5968
5984
|
size: 12,
|
|
5969
5985
|
"stroke-width": 2
|
|
5970
|
-
})), d(" " + _(p(I).copied.value ? p(l).mediaLibrary.copied : p(l).mediaLibrary.copyUrl), 1)], 4)) : u("", !0), A.value ? (o(), O("div",
|
|
5986
|
+
})), d(" " + _(p(I).copied.value ? p(l).mediaLibrary.copied : p(l).mediaLibrary.copyUrl), 1)], 4)) : u("", !0), A.value ? (o(), O("div", La, [y("button", {
|
|
5971
5987
|
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",
|
|
5972
5988
|
style: {
|
|
5973
5989
|
"border-color": "var(--tpl-border)",
|
|
5974
5990
|
color: "var(--tpl-text)",
|
|
5975
5991
|
"background-color": "var(--tpl-bg)"
|
|
5976
5992
|
},
|
|
5977
|
-
onClick: n[
|
|
5978
|
-
}, _(p(l).mediaLibrary.moveSelected), 1), p(I).showMovePicker.value ? (o(), v(
|
|
5993
|
+
onClick: n[16] ||= (e) => p(I).showMovePicker.value = !p(I).showMovePicker.value
|
|
5994
|
+
}, _(p(l).mediaLibrary.moveSelected), 1), p(I).showMovePicker.value ? (o(), v(fi, {
|
|
5979
5995
|
key: 0,
|
|
5980
5996
|
folders: p(F).folders.value,
|
|
5981
5997
|
"current-folder-id": p(F).currentFolderId.value,
|
|
5982
5998
|
onSelect: p(I).handleMoveToFolder,
|
|
5983
|
-
onClose: n[
|
|
5999
|
+
onClose: n[17] ||= (e) => p(I).showMovePicker.value = !1
|
|
5984
6000
|
}, null, 8, [
|
|
5985
6001
|
"folders",
|
|
5986
6002
|
"current-folder-id",
|
|
5987
6003
|
"onSelect"
|
|
5988
|
-
])) : u("", !0)])) : u("", !0)])) : u("", !0), y("div",
|
|
6004
|
+
])) : u("", !0)])) : u("", !0)])) : u("", !0), y("div", Ra, [p(F).selectedItems.value.size > 0 ? (o(), O("button", {
|
|
5989
6005
|
key: 0,
|
|
5990
6006
|
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",
|
|
5991
6007
|
style: {
|
|
@@ -5993,22 +6009,22 @@ var Ji = ["data-tpl-theme"], Yi = {
|
|
|
5993
6009
|
color: "var(--tpl-danger)",
|
|
5994
6010
|
"background-color": "var(--tpl-danger-light)"
|
|
5995
6011
|
},
|
|
5996
|
-
onClick: n[
|
|
6012
|
+
onClick: n[18] ||= (...e) => p(I).handleDeleteClick && p(I).handleDeleteClick(...e)
|
|
5997
6013
|
}, _(p(l).mediaLibrary.deleteSelected), 1)) : u("", !0), y("button", {
|
|
5998
6014
|
class: "tpl:cursor-pointer tpl:rounded-md tpl:px-4 tpl:py-1.5 tpl:text-sm tpl:font-medium tpl:shadow-xs tpl:transition-all tpl:duration-150 tpl:hover:opacity-90 tpl:disabled:cursor-not-allowed tpl:disabled:opacity-50",
|
|
5999
6015
|
style: {
|
|
6000
6016
|
"background-color": "var(--tpl-primary)",
|
|
6001
6017
|
color: "var(--tpl-bg)"
|
|
6002
6018
|
},
|
|
6003
|
-
disabled: !
|
|
6004
|
-
onClick:
|
|
6005
|
-
}, _(e.accept?.length ? p(l).mediaLibrary.selectImage : p(l).mediaLibrary.selectFile), 9,
|
|
6006
|
-
])], 8,
|
|
6019
|
+
disabled: !re(),
|
|
6020
|
+
onClick: R
|
|
6021
|
+
}, _(e.accept?.length ? p(l).mediaLibrary.selectImage : p(l).mediaLibrary.selectFile), 9, za)])])])
|
|
6022
|
+
])], 8, Xi)) : u("", !0)]),
|
|
6007
6023
|
_: 1
|
|
6008
6024
|
})]));
|
|
6009
6025
|
}
|
|
6010
6026
|
});
|
|
6011
6027
|
//#endregion
|
|
6012
|
-
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 };
|
|
6013
6029
|
|
|
6014
|
-
//# sourceMappingURL=media-library-
|
|
6030
|
+
//# sourceMappingURL=media-library-Cl5XuaKy.js.map
|