@templatical/editor 0.0.4 → 0.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/AiChatSidebar-CNhSl_ty.js +228 -0
- package/dist/{AiFeatureMenu-K44aZa_P.js → AiFeatureMenu-BFVsjUJY.js} +23 -23
- package/dist/CloudEditor-Bz5Xkxej.js +1082 -0
- package/dist/{CollaboratorBar-BuCEcdbB.js → CollaboratorBar-D2Gu5Xj2.js} +3 -3
- package/dist/{CommentsSidebar-2lcqMfIP.js → CommentsSidebar-CTeEAZTj.js} +131 -131
- package/dist/{DesignReferenceSidebar-CNMu4Zrx.js → DesignReferenceSidebar-u2tKSQK0.js} +52 -52
- package/dist/{LoadingTrack-vK8W2PJf.js → LoadingTrack--aUassFH.js} +1 -1
- package/dist/{ModuleBrowserModal-CvQ0xyQf.js → ModuleBrowserModal-DNxODPlX.js} +58 -58
- package/dist/{ModulePreviewCanvas-Be2B3Y07.js → ModulePreviewCanvas-DnGe1Y-2.js} +32 -32
- package/dist/ParagraphEditor-CYrzYJO5.js +688 -0
- package/dist/{RichTextEditorContent-CHJlh7HJ.js → RichTextEditorContent-BeqlWlWB.js} +2 -2
- package/dist/{SaveModuleDialog-BaaeH5Xm.js → SaveModuleDialog-Kde6X13X.js} +25 -25
- package/dist/{SnapshotHistory-BPfjiuu1.js → SnapshotHistory-B3EfIcLW.js} +7 -7
- package/dist/TemplateScoringPanel-D2vCRGgx.js +254 -0
- package/dist/{TestEmailModal-DIAlB3e_.js → TestEmailModal-Egk0DFDf.js} +3 -3
- package/dist/{TitleEditor-D9DPjQkX.js → TitleEditor-DwUpo4gF.js} +11 -11
- package/dist/{TplModal-CmTSvCY-.js → TplModal-BCruYWks.js} +4 -4
- package/dist/{_plugin-vue_export-helper-B1-bu7yR.js → _plugin-vue_export-helper-5TQrnOhO.js} +2 -2
- package/dist/{blockTypeIcons-D1RTWOkx.js → blockTypeIcons-rW4BUUNC.js} +2 -2
- package/dist/cdn/chunks/{AiFeatureMenu-lxVm1RjH.js → AiFeatureMenu-Dcbshcfu.js} +16 -16
- package/dist/cdn/chunks/AiFeatureMenu-Dcbshcfu.js.map +1 -0
- package/dist/cdn/chunks/CloudEditor-Bca3RyBW.js +1056 -0
- package/dist/cdn/chunks/CloudEditor-Bca3RyBW.js.map +1 -0
- package/dist/cdn/chunks/{CollaboratorBar-D2PKtlOw.js → CollaboratorBar-sToKJfHi.js} +4 -4
- package/dist/cdn/chunks/{CollaboratorBar-D2PKtlOw.js.map → CollaboratorBar-sToKJfHi.js.map} +1 -1
- package/dist/cdn/chunks/{ModuleBrowserModal-CxDXzkKS.js → ModuleBrowserModal-BNhwXbWw.js} +52 -52
- package/dist/cdn/chunks/ModuleBrowserModal-BNhwXbWw.js.map +1 -0
- package/dist/cdn/chunks/{ModulePreviewCanvas-DEfHampA.js → ModulePreviewCanvas-DylUylPU.js} +3 -3
- package/dist/cdn/chunks/{ModulePreviewCanvas-DEfHampA.js.map → ModulePreviewCanvas-DylUylPU.js.map} +1 -1
- package/dist/cdn/chunks/ParagraphEditor-BBw90y_p.js +539 -0
- package/dist/cdn/chunks/ParagraphEditor-BBw90y_p.js.map +1 -0
- package/dist/cdn/chunks/{RichTextEditorContent-DWUzizsC.js → RichTextEditorContent-DvyIO3nR.js} +5 -5
- package/dist/cdn/chunks/{RichTextEditorContent-DWUzizsC.js.map → RichTextEditorContent-DvyIO3nR.js.map} +1 -1
- package/dist/cdn/chunks/{SaveModuleDialog-DVna2xUl.js → SaveModuleDialog-DvbSHvhF.js} +24 -24
- package/dist/cdn/chunks/SaveModuleDialog-DvbSHvhF.js.map +1 -0
- package/dist/cdn/chunks/{TitleEditor-DDf_OcHS.js → TitleEditor-tS3mgoVr.js} +10 -10
- package/dist/cdn/chunks/{TitleEditor-DDf_OcHS.js.map → TitleEditor-tS3mgoVr.js.map} +1 -1
- package/dist/cdn/chunks/{blockTypeIcons-BnobReQm.js → blockTypeIcons-DbnbyEQE.js} +3 -3
- package/dist/cdn/chunks/{blockTypeIcons-BnobReQm.js.map → blockTypeIcons-DbnbyEQE.js.map} +1 -1
- package/dist/cdn/chunks/{de-BvYD17KT.js → de-CgUR_S5I.js} +1 -1
- package/dist/cdn/chunks/{de-BvYD17KT.js.map → de-CgUR_S5I.js.map} +1 -1
- package/dist/cdn/chunks/{de-BB3dgVOc.js → de-D8oDPhBD.js} +1 -1
- package/dist/cdn/chunks/de-D8oDPhBD.js.map +1 -0
- package/dist/cdn/chunks/{dist-B878xb_62.js → dist-BUmN5e4r.js} +15 -12
- package/dist/cdn/chunks/dist-BUmN5e4r.js.map +1 -0
- package/dist/cdn/chunks/{draggable-BQNU47zu.js → draggable-m78lz0gI.js} +1591 -1563
- package/dist/cdn/chunks/draggable-m78lz0gI.js.map +1 -0
- package/dist/cdn/chunks/{emojiData-BVEJHcNH.js → emojiData-CNNgvDqx.js} +1 -1
- package/dist/cdn/chunks/{emojiData-BVEJHcNH.js.map → emojiData-CNNgvDqx.js.map} +1 -1
- package/dist/cdn/chunks/{en-CpotcOPr.js → en-BBmfBDqY.js} +1 -1
- package/dist/cdn/chunks/{en-CpotcOPr.js.map → en-BBmfBDqY.js.map} +1 -1
- package/dist/cdn/chunks/{en-DeDcpnoS.js → en-HseRPPeK.js} +1 -1
- package/dist/cdn/chunks/en-HseRPPeK.js.map +1 -0
- package/dist/cdn/chunks/{extensions-B_kcV0tK.js → extensions-ClpY3m0W.js} +31 -31
- package/dist/cdn/chunks/{extensions-B_kcV0tK.js.map → extensions-ClpY3m0W.js.map} +1 -1
- package/dist/cdn/chunks/{features-ofOGnSC0.js → features-B5dGxWLi.js} +1645 -1608
- package/dist/cdn/chunks/features-B5dGxWLi.js.map +1 -0
- package/dist/cdn/chunks/{icons-bIb7PBOE.js → icons-hflTyPmb.js} +8 -8
- package/dist/cdn/chunks/icons-hflTyPmb.js.map +1 -0
- package/dist/cdn/chunks/{liquid.browser-C1VIYISn.js → liquid.browser-BxyRVCKv.js} +24 -17
- package/dist/cdn/chunks/liquid.browser-BxyRVCKv.js.map +1 -0
- package/dist/cdn/chunks/{media-library-BIYzV2Y2.js → media-library-Dgy-V-JA.js} +547 -543
- package/dist/cdn/chunks/{media-library-BIYzV2Y2.js.map → media-library-Dgy-V-JA.js.map} +1 -1
- package/dist/cdn/chunks/{pusher-DJPhQnE8.js → pusher-D-m2WSdL.js} +10 -7
- package/dist/cdn/chunks/pusher-D-m2WSdL.js.map +1 -0
- package/dist/cdn/chunks/readableTextColor-Cd_cgWO_.js.map +1 -1
- package/dist/cdn/chunks/{rolldown-runtime-DPITmOBR.js → rolldown-runtime-BNuo_Jkg.js} +1 -1
- package/dist/cdn/chunks/{src-BuW9oYtm.js → src-TDwMmqm0.js} +7 -7
- package/dist/cdn/chunks/{src-BuW9oYtm.js.map → src-TDwMmqm0.js.map} +1 -1
- package/dist/cdn/chunks/{styleConstants-1KwsBMxJ.js → styleConstants-DFe3I4Op.js} +6 -6
- package/dist/cdn/chunks/{styleConstants-1KwsBMxJ.js.map → styleConstants-DFe3I4Op.js.map} +1 -1
- package/dist/cdn/chunks/{styles-DQFExz-T.js → styles-hCOCOR6K.js} +1229 -1101
- package/dist/cdn/chunks/styles-hCOCOR6K.js.map +1 -0
- package/dist/cdn/chunks/{tiptap-DplY-S-k.js → tiptap-C28NLMX8.js} +1531 -1309
- package/dist/cdn/chunks/tiptap-C28NLMX8.js.map +1 -0
- package/dist/cdn/editor.css +1 -1
- package/dist/cdn/editor.js +112 -141
- package/dist/cdn/editor.js.map +1 -1
- package/dist/{check-B7kDuZmP.js → check-B5S-C0bz.js} +1 -1
- package/dist/{chevron-down-DJLW2Q9Z.js → chevron-down-CjsV1T0W.js} +1 -1
- package/dist/{circle-alert-E2vYPs5r.js → circle-alert-CVTmJHKW.js} +1 -1
- package/dist/{clock-lWIIQA3C.js → clock-CAjdSHBy.js} +1 -1
- package/dist/{dist-CG-vEqSU.js → dist-Ac4o1O4a.js} +2 -2
- package/dist/{dist-BkIys9zn.js → dist-B4LTlrAn.js} +6 -6
- package/dist/{dist-ChAGLpWo.js → dist-BTtKPcd2.js} +2 -2
- package/dist/{dist-C1BIRHCQ.js → dist-CBr-qhie.js} +2 -2
- package/dist/{dist-DmOE-Ubp.js → dist-COOFiBFV.js} +2 -2
- package/dist/{dist-4LiM9FDd.js → dist-COguaIvm.js} +2 -2
- package/dist/{dist-Bu7veieH.js → dist-Crqkuf-w.js} +2 -2
- package/dist/{dist-DkypH7qG.js → dist-DEJZ9iAU.js} +2 -2
- package/dist/{dist-D_HQYSY-.js → dist-DHYuVJ_7.js} +2 -2
- package/dist/{dist-C_ymrGFi.js → dist-DJrDTuRr.js} +973 -958
- package/dist/{dist-DysAFIPy.js → dist-DPM-DFvh.js} +142 -114
- package/dist/{dist-DrvKRSU6.js → dist-DfqLGwSF.js} +2 -2
- package/dist/dist-DmVOCJjI.js +5 -0
- package/dist/{extensions-DEjfEFhD.js → extensions-C6xp_B7K.js} +3 -3
- package/dist/{image-up-X4xIq4ea.js → image-up-vZa1Txr-.js} +1 -1
- package/dist/index.d.ts +223 -0
- package/dist/{liquid.browser-BemTg3sZ.js → liquid.browser-C02owkex.js} +20 -15
- package/dist/{loader-circle-BTQQxC3l.js → loader-circle-DilFjHSk.js} +1 -1
- package/dist/{message-circle-Blgm6V_h.js → message-circle-Dpcnc2oa.js} +1 -1
- package/dist/{refresh-cw-Bb4PEeW1.js → refresh-cw-4r7rkHHX.js} +1 -1
- package/dist/rolldown-runtime-gEudmnaM.js +23 -0
- package/dist/{scan-line-7lZPfOdm.js → scan-line-684IxPQ0.js} +1 -1
- package/dist/{send-C0ltAQrv.js → send-ChDw64yL.js} +1 -1
- package/dist/{shield-check-f-qv4RKs.js → shield-check-9dhLdyST.js} +1 -1
- package/dist/{sparkles-KhBCGlqB.js → sparkles-Co9fkDcv.js} +1 -1
- package/dist/{styleConstants-D4SOZGBV.js → styleConstants-RV3eYwkD.js} +6 -6
- package/dist/styles-nvxFh6L6.js +3557 -0
- package/dist/templatical-editor.css +1 -1
- package/dist/templatical-editor.js +111 -141
- package/dist/templatical-editor.umd.cjs +63 -73
- package/dist/{trash-2-OwjZ-guZ.js → trash-2-CZkMtjeC.js} +1 -1
- package/dist/{triangle-alert-DOSRIUYZ.js → triangle-alert-Dvt51agD.js} +1 -1
- package/dist/{useEditorCore-CjwRMl7K.js → useEditorCore-ColJh1ST.js} +1183 -1182
- package/dist/{x-CGlq2XQe.js → x-CU2XZOkQ.js} +1 -1
- package/package.json +52 -49
- package/dist/AiChatSidebar-CjfhTZwo.js +0 -214
- package/dist/CloudEditor-DFyuRxUV.js +0 -926
- package/dist/ParagraphEditor-CcMPnbDr.js +0 -652
- package/dist/TemplateScoringPanel-D58A23Vq.js +0 -249
- package/dist/cdn/chunks/AiChatSidebar-CmPTbTFG.js +0 -2
- package/dist/cdn/chunks/AiFeatureMenu-lxVm1RjH.js.map +0 -1
- package/dist/cdn/chunks/CloudEditor-Bmp5IlWi.js +0 -900
- package/dist/cdn/chunks/CloudEditor-Bmp5IlWi.js.map +0 -1
- package/dist/cdn/chunks/CommentsSidebar-BOelj4Ca.js +0 -2
- package/dist/cdn/chunks/DesignReferenceSidebar-Bf6rg0A7.js +0 -2
- package/dist/cdn/chunks/ModuleBrowserModal-CxDXzkKS.js.map +0 -1
- package/dist/cdn/chunks/ParagraphEditor-DHdu6lb3.js +0 -503
- package/dist/cdn/chunks/ParagraphEditor-DHdu6lb3.js.map +0 -1
- package/dist/cdn/chunks/SaveModuleDialog-DVna2xUl.js.map +0 -1
- package/dist/cdn/chunks/SnapshotHistory-BFF2SsTN.js +0 -2
- package/dist/cdn/chunks/TemplateScoringPanel-gi8wc_m7.js +0 -2
- package/dist/cdn/chunks/TestEmailModal-Qtd6aC-6.js +0 -2
- package/dist/cdn/chunks/de-BB3dgVOc.js.map +0 -1
- package/dist/cdn/chunks/dist-B6AUkMyh.js +0 -2
- package/dist/cdn/chunks/dist-B878xb_62.js.map +0 -1
- package/dist/cdn/chunks/dist-Bf1Op9A1.js +0 -2
- package/dist/cdn/chunks/dist-BkETaOfw.js +0 -2
- package/dist/cdn/chunks/dist-CJcMnY7o.js +0 -2
- package/dist/cdn/chunks/dist-CWsl6S1K.js +0 -2
- package/dist/cdn/chunks/dist-CllLxIMQ.js +0 -2
- package/dist/cdn/chunks/dist-Cs0wFwdw.js +0 -2
- package/dist/cdn/chunks/dist-DLWHlekl.js +0 -2
- package/dist/cdn/chunks/dist-DS3_HVpX.js +0 -2
- package/dist/cdn/chunks/dist-DTXopj1a.js +0 -2
- package/dist/cdn/chunks/dist-DnwLoNLm.js +0 -2
- package/dist/cdn/chunks/draggable-BQNU47zu.js.map +0 -1
- package/dist/cdn/chunks/en-DeDcpnoS.js.map +0 -1
- package/dist/cdn/chunks/features-ofOGnSC0.js.map +0 -1
- package/dist/cdn/chunks/icons-bIb7PBOE.js.map +0 -1
- package/dist/cdn/chunks/liquid.browser-C1VIYISn.js.map +0 -1
- package/dist/cdn/chunks/pusher-DJPhQnE8.js.map +0 -1
- package/dist/cdn/chunks/styles-DQFExz-T.js.map +0 -1
- package/dist/cdn/chunks/tiptap-DplY-S-k.js.map +0 -1
- package/dist/dist-Dxnd0GRf.js +0 -5
- package/dist/styles-CgLaxDfu.js +0 -3428
- /package/dist/{de-D7TLGIPA.js → de-Dh8ON-dm.js} +0 -0
- /package/dist/{emojiData-BfWQS72m.js → emojiData-Qc8mH_zW.js} +0 -0
- /package/dist/{en-DvtiEMwP.js → en-C7IShRSD.js} +0 -0
- /package/dist/{formatRelativeTime-DX3FgqN9.js → formatRelativeTime-D8f6NR7i.js} +0 -0
- /package/dist/{readableTextColor-LDlmVEUv.js → readableTextColor-B809bF5J.js} +0 -0
- /package/dist/{useMergeTag-BZ3X0bNr.js → useMergeTag-CSXcnFBc.js} +0 -0
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { $ as e, B as t, E as n, F as r, H as i, I as a, J as o, L as s, N as c, O as l, R as u, S as d, U as f, _ as p, at as m, b as h, c as g, ct as _, d as v, f as y, g as b, h as x, l as S, lt as C, m as w, n as T, p as E, s as D, st as O, u as k, y as A } from "./draggable-
|
|
2
|
-
import { $ as j,
|
|
3
|
-
import { G as
|
|
1
|
+
import { $ as e, B as t, E as n, F as r, H as i, I as a, J as o, L as s, N as c, O as l, R as u, S as d, U as f, _ as p, at as m, b as h, c as g, ct as _, d as v, f as y, g as b, h as x, l as S, lt as C, m as w, n as T, p as E, s as D, st as O, u as k, y as A } from "./draggable-m78lz0gI.js";
|
|
2
|
+
import { $ as j, $t as ee, Ct as te, E as M, Qt as N, T as P, Tt as F, Zt as I, en as ne, lt as L, nn as re, nt as R, pt as ie, rn as ae, rt as oe, tn as se, tt as ce, ut as le, yt as ue } from "./features-B5dGxWLi.js";
|
|
3
|
+
import { G as de, L as fe, T as pe, U as me, W as he, k as ge, p as _e, y as ve, z as ye } from "./icons-hflTyPmb.js";
|
|
4
4
|
//#region ../media-library/src/api-client.ts
|
|
5
|
-
var
|
|
5
|
+
var be = class {
|
|
6
6
|
constructor(e) {
|
|
7
7
|
this.authManager = e;
|
|
8
8
|
}
|
|
@@ -36,7 +36,7 @@ var ye = class {
|
|
|
36
36
|
async browseMedia(e) {
|
|
37
37
|
let t = new URLSearchParams();
|
|
38
38
|
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 = `${M(
|
|
39
|
+
let n = t.toString(), r = `${M(P["media.browse"], this.baseParams)}${n ? `?${n}` : ""}`, i = await this.authManager.authenticatedFetch(r, { headers: { Accept: "application/json" } });
|
|
40
40
|
if (!i.ok) {
|
|
41
41
|
let e = await i.json().catch(() => ({ message: `HTTP error ${i.status}` }));
|
|
42
42
|
throw Error(e.message, { cause: e });
|
|
@@ -46,7 +46,7 @@ var ye = class {
|
|
|
46
46
|
async uploadMedia(e, t) {
|
|
47
47
|
let n = new FormData();
|
|
48
48
|
n.append("file", e), t && n.append("folder_id", t);
|
|
49
|
-
let r = M(
|
|
49
|
+
let r = M(P["media.upload"], this.baseParams), i = await this.authManager.authenticatedFetch(r, {
|
|
50
50
|
method: "POST",
|
|
51
51
|
headers: { Accept: "application/json" },
|
|
52
52
|
body: n
|
|
@@ -58,7 +58,7 @@ var ye = class {
|
|
|
58
58
|
return (await i.json()).data;
|
|
59
59
|
}
|
|
60
60
|
async updateMedia(e, t, n) {
|
|
61
|
-
return this.request(M(
|
|
61
|
+
return this.request(M(P["media.update"], {
|
|
62
62
|
...this.baseParams,
|
|
63
63
|
media: e
|
|
64
64
|
}), {
|
|
@@ -70,13 +70,13 @@ var ye = class {
|
|
|
70
70
|
});
|
|
71
71
|
}
|
|
72
72
|
async deleteMedia(e) {
|
|
73
|
-
return this.request(M(
|
|
73
|
+
return this.request(M(P["media.delete"], this.baseParams), {
|
|
74
74
|
method: "POST",
|
|
75
75
|
body: JSON.stringify({ ids: e })
|
|
76
76
|
});
|
|
77
77
|
}
|
|
78
78
|
async moveMedia(e, t) {
|
|
79
|
-
return this.request(M(
|
|
79
|
+
return this.request(M(P["media.move"], this.baseParams), {
|
|
80
80
|
method: "POST",
|
|
81
81
|
body: JSON.stringify({
|
|
82
82
|
ids: e,
|
|
@@ -85,10 +85,10 @@ var ye = class {
|
|
|
85
85
|
});
|
|
86
86
|
}
|
|
87
87
|
async getMediaFolders() {
|
|
88
|
-
return this.request(M(
|
|
88
|
+
return this.request(M(P["folders.index"], this.baseParams));
|
|
89
89
|
}
|
|
90
90
|
async createMediaFolder(e, t) {
|
|
91
|
-
return this.request(M(
|
|
91
|
+
return this.request(M(P["folders.store"], this.baseParams), {
|
|
92
92
|
method: "POST",
|
|
93
93
|
body: JSON.stringify({
|
|
94
94
|
name: e,
|
|
@@ -97,7 +97,7 @@ var ye = class {
|
|
|
97
97
|
});
|
|
98
98
|
}
|
|
99
99
|
async renameMediaFolder(e, t) {
|
|
100
|
-
return this.request(M(
|
|
100
|
+
return this.request(M(P["folders.update"], {
|
|
101
101
|
...this.baseParams,
|
|
102
102
|
mediaFolder: e
|
|
103
103
|
}), {
|
|
@@ -106,13 +106,13 @@ var ye = class {
|
|
|
106
106
|
});
|
|
107
107
|
}
|
|
108
108
|
async deleteMediaFolder(e) {
|
|
109
|
-
return this.request(M(
|
|
109
|
+
return this.request(M(P["folders.destroy"], {
|
|
110
110
|
...this.baseParams,
|
|
111
111
|
mediaFolder: e
|
|
112
112
|
}), { method: "DELETE" });
|
|
113
113
|
}
|
|
114
114
|
async checkMediaUsage(e) {
|
|
115
|
-
let t = await this.authManager.authenticatedFetch(M(
|
|
115
|
+
let t = await this.authManager.authenticatedFetch(M(P["media.checkUsage"], this.baseParams), {
|
|
116
116
|
method: "POST",
|
|
117
117
|
headers: {
|
|
118
118
|
"Content-Type": "application/json",
|
|
@@ -127,10 +127,10 @@ var ye = class {
|
|
|
127
127
|
return t.json();
|
|
128
128
|
}
|
|
129
129
|
async getFrequentlyUsed() {
|
|
130
|
-
return this.request(M(
|
|
130
|
+
return this.request(M(P["media.frequentlyUsed"], this.baseParams));
|
|
131
131
|
}
|
|
132
132
|
async importFromUrl(e, t) {
|
|
133
|
-
return this.request(M(
|
|
133
|
+
return this.request(M(P["media.importFromUrl"], this.baseParams), {
|
|
134
134
|
method: "POST",
|
|
135
135
|
body: JSON.stringify({
|
|
136
136
|
url: e,
|
|
@@ -141,7 +141,7 @@ var ye = class {
|
|
|
141
141
|
async replaceMedia(e, t) {
|
|
142
142
|
let n = new FormData();
|
|
143
143
|
n.append("file", t);
|
|
144
|
-
let r = M(
|
|
144
|
+
let r = M(P["media.replace"], {
|
|
145
145
|
...this.baseParams,
|
|
146
146
|
media: e
|
|
147
147
|
}), i = await this.authManager.authenticatedFetch(r, {
|
|
@@ -158,9 +158,9 @@ var ye = class {
|
|
|
158
158
|
};
|
|
159
159
|
//#endregion
|
|
160
160
|
//#region ../media-library/src/composable.ts
|
|
161
|
-
function
|
|
161
|
+
function xe(t) {
|
|
162
162
|
if (!t.projectId) throw Error("projectId is required for useMediaLibrary");
|
|
163
|
-
let n = new
|
|
163
|
+
let n = new be(t.authManager), r = e([]), i = e([]), a = e(null), o = e("files"), s = e(""), c = e(null), l = e("newest"), u = e(!1), d = e(!1), f = e(!1), p = e(null), m = e(null), h = e(/* @__PURE__ */ new Set()), g = e(null), _ = e([]), v = e({}), y = e(!1), b = e([]), x = e(!1), S = e(null), C = e(!1), w = e(null), T = e(!1), E = e(null), D = e(null);
|
|
164
164
|
async function O() {
|
|
165
165
|
u.value = !0;
|
|
166
166
|
try {
|
|
@@ -205,13 +205,13 @@ function be(t) {
|
|
|
205
205
|
async function ee(e) {
|
|
206
206
|
l.value = e, await O();
|
|
207
207
|
}
|
|
208
|
-
async function
|
|
208
|
+
async function te(e) {
|
|
209
209
|
o.value = "files", a.value = e, s.value = "", h.value = /* @__PURE__ */ new Set(), g.value = null, await O();
|
|
210
210
|
}
|
|
211
|
-
async function
|
|
212
|
-
o.value = "frequently-used", a.value = null, s.value = "", h.value = /* @__PURE__ */ new Set(), g.value = null, await
|
|
211
|
+
async function M() {
|
|
212
|
+
o.value = "frequently-used", a.value = null, s.value = "", h.value = /* @__PURE__ */ new Set(), g.value = null, await L();
|
|
213
213
|
}
|
|
214
|
-
async function
|
|
214
|
+
async function N(e) {
|
|
215
215
|
d.value = !0;
|
|
216
216
|
try {
|
|
217
217
|
let t = await n.uploadMedia(e, a.value);
|
|
@@ -222,7 +222,7 @@ function be(t) {
|
|
|
222
222
|
d.value = !1;
|
|
223
223
|
}
|
|
224
224
|
}
|
|
225
|
-
async function
|
|
225
|
+
async function P(e) {
|
|
226
226
|
d.value = !0, m.value = {
|
|
227
227
|
current: 0,
|
|
228
228
|
total: e.length
|
|
@@ -243,7 +243,7 @@ function be(t) {
|
|
|
243
243
|
d.value = !1, m.value = null;
|
|
244
244
|
}
|
|
245
245
|
}
|
|
246
|
-
async function
|
|
246
|
+
async function F(e) {
|
|
247
247
|
if (h.value.size !== 0) try {
|
|
248
248
|
let t = await n.moveMedia([...h.value], e);
|
|
249
249
|
if (a.value === null) {
|
|
@@ -263,21 +263,21 @@ function be(t) {
|
|
|
263
263
|
t.onError?.(e);
|
|
264
264
|
}
|
|
265
265
|
}
|
|
266
|
-
async function
|
|
266
|
+
async function ne() {
|
|
267
267
|
if (h.value.size !== 0) try {
|
|
268
268
|
await n.deleteMedia([...h.value]), r.value = r.value.filter((e) => !h.value.has(e.id)), _.value = _.value.filter((e) => !h.value.has(e.id)), h.value = /* @__PURE__ */ new Set(), g.value = null;
|
|
269
269
|
} catch (e) {
|
|
270
270
|
t.onError?.(e);
|
|
271
271
|
}
|
|
272
272
|
}
|
|
273
|
-
async function
|
|
273
|
+
async function L() {
|
|
274
274
|
try {
|
|
275
275
|
_.value = await n.getFrequentlyUsed();
|
|
276
276
|
} catch (e) {
|
|
277
277
|
t.onError?.(e);
|
|
278
278
|
}
|
|
279
279
|
}
|
|
280
|
-
async function
|
|
280
|
+
async function re() {
|
|
281
281
|
if (h.value.size === 0) return !1;
|
|
282
282
|
b.value = [...h.value];
|
|
283
283
|
try {
|
|
@@ -289,17 +289,17 @@ function be(t) {
|
|
|
289
289
|
return t.onError?.(e), !1;
|
|
290
290
|
}
|
|
291
291
|
}
|
|
292
|
-
async function
|
|
292
|
+
async function R() {
|
|
293
293
|
if (y.value = !1, b.value.length !== 0) try {
|
|
294
294
|
await n.deleteMedia(b.value), r.value = r.value.filter((e) => !b.value.includes(e.id)), _.value = _.value.filter((e) => !b.value.includes(e.id)), h.value = /* @__PURE__ */ new Set(), g.value = null, b.value = [], v.value = {};
|
|
295
295
|
} catch (e) {
|
|
296
296
|
t.onError?.(e);
|
|
297
297
|
}
|
|
298
298
|
}
|
|
299
|
-
function
|
|
299
|
+
function ie() {
|
|
300
300
|
y.value = !1, b.value = [], v.value = {};
|
|
301
301
|
}
|
|
302
|
-
async function
|
|
302
|
+
async function ae(e) {
|
|
303
303
|
x.value = !0, S.value = null;
|
|
304
304
|
try {
|
|
305
305
|
let t = await n.importFromUrl(e, a.value);
|
|
@@ -310,57 +310,57 @@ function be(t) {
|
|
|
310
310
|
x.value = !1;
|
|
311
311
|
}
|
|
312
312
|
}
|
|
313
|
-
function
|
|
313
|
+
function oe(e) {
|
|
314
314
|
let t = new Set(h.value);
|
|
315
315
|
t.has(e) ? t.delete(e) : t.add(e), h.value = t;
|
|
316
316
|
}
|
|
317
|
-
function
|
|
317
|
+
function se() {
|
|
318
318
|
h.value = /* @__PURE__ */ new Set(), g.value = null;
|
|
319
319
|
}
|
|
320
|
-
function
|
|
320
|
+
function ce(e) {
|
|
321
321
|
g.value = e, h.value = new Set([e.id]);
|
|
322
322
|
}
|
|
323
|
-
async function
|
|
323
|
+
async function le() {
|
|
324
324
|
try {
|
|
325
325
|
i.value = await n.getMediaFolders();
|
|
326
326
|
} catch (e) {
|
|
327
327
|
t.onError?.(e);
|
|
328
328
|
}
|
|
329
329
|
}
|
|
330
|
-
async function
|
|
330
|
+
async function ue(e, r) {
|
|
331
331
|
try {
|
|
332
332
|
let t = await n.createMediaFolder(e, r);
|
|
333
|
-
return await
|
|
333
|
+
return await le(), t;
|
|
334
334
|
} catch (e) {
|
|
335
335
|
return t.onError?.(e), null;
|
|
336
336
|
}
|
|
337
337
|
}
|
|
338
|
-
function
|
|
338
|
+
function de(e, t) {
|
|
339
339
|
for (let n of e) {
|
|
340
340
|
if (n.id === t) return n;
|
|
341
341
|
if (n.children) {
|
|
342
|
-
let e =
|
|
342
|
+
let e = de(n.children, t);
|
|
343
343
|
if (e) return e;
|
|
344
344
|
}
|
|
345
345
|
}
|
|
346
346
|
return null;
|
|
347
347
|
}
|
|
348
|
-
async function
|
|
348
|
+
async function fe(e, r) {
|
|
349
349
|
try {
|
|
350
|
-
await n.renameMediaFolder(e, r), await
|
|
350
|
+
await n.renameMediaFolder(e, r), await le();
|
|
351
351
|
} catch (e) {
|
|
352
352
|
t.onError?.(e);
|
|
353
353
|
}
|
|
354
354
|
}
|
|
355
|
-
async function
|
|
355
|
+
async function pe(e) {
|
|
356
356
|
try {
|
|
357
|
-
let t =
|
|
358
|
-
await n.deleteMediaFolder(e), a.value === e && (a.value = t), await
|
|
357
|
+
let t = de(i.value, e)?.parent_id ?? null;
|
|
358
|
+
await n.deleteMediaFolder(e), a.value === e && (a.value = t), await le(), await O();
|
|
359
359
|
} catch (e) {
|
|
360
360
|
t.onError?.(e);
|
|
361
361
|
}
|
|
362
362
|
}
|
|
363
|
-
async function
|
|
363
|
+
async function me(e) {
|
|
364
364
|
E.value = e, w.value = null;
|
|
365
365
|
try {
|
|
366
366
|
D.value = (await n.checkMediaUsage([e.id])).data[e.id] ?? null, T.value = !0;
|
|
@@ -368,10 +368,10 @@ function be(t) {
|
|
|
368
368
|
t.onError?.(e);
|
|
369
369
|
}
|
|
370
370
|
}
|
|
371
|
-
function
|
|
371
|
+
function he() {
|
|
372
372
|
T.value = !1, E.value = null, D.value = null, w.value = null;
|
|
373
373
|
}
|
|
374
|
-
async function
|
|
374
|
+
async function ge(e) {
|
|
375
375
|
if (!E.value) return null;
|
|
376
376
|
C.value = !0, w.value = null;
|
|
377
377
|
try {
|
|
@@ -383,7 +383,7 @@ function be(t) {
|
|
|
383
383
|
C.value = !1;
|
|
384
384
|
}
|
|
385
385
|
}
|
|
386
|
-
async function
|
|
386
|
+
async function _e(e, i) {
|
|
387
387
|
try {
|
|
388
388
|
let t = await n.replaceMedia(e, i);
|
|
389
389
|
return r.value = r.value.map((e) => e.id === t.id ? t : e), _.value = _.value.map((e) => e.id === t.id ? t : e), g.value?.id === t.id && (g.value = t), t;
|
|
@@ -413,42 +413,42 @@ function be(t) {
|
|
|
413
413
|
search: A,
|
|
414
414
|
filterByCategory: j,
|
|
415
415
|
sortBy: ee,
|
|
416
|
-
navigateToFolder:
|
|
417
|
-
showFrequentlyUsed:
|
|
418
|
-
uploadFile:
|
|
419
|
-
uploadFiles:
|
|
420
|
-
moveSelected:
|
|
416
|
+
navigateToFolder: te,
|
|
417
|
+
showFrequentlyUsed: M,
|
|
418
|
+
uploadFile: N,
|
|
419
|
+
uploadFiles: P,
|
|
420
|
+
moveSelected: F,
|
|
421
421
|
updateFile: I,
|
|
422
|
-
deleteSelected:
|
|
422
|
+
deleteSelected: ne,
|
|
423
423
|
isImportingFromUrl: x,
|
|
424
424
|
importFromUrlError: S,
|
|
425
|
-
importFromUrl:
|
|
426
|
-
toggleSelection:
|
|
427
|
-
clearSelection:
|
|
428
|
-
selectItem:
|
|
429
|
-
loadFolders:
|
|
430
|
-
createFolder:
|
|
431
|
-
renameFolder:
|
|
432
|
-
deleteFolder:
|
|
433
|
-
findFolderInTree:
|
|
434
|
-
loadFrequentlyUsed:
|
|
435
|
-
checkUsageBeforeDelete:
|
|
436
|
-
confirmDelete:
|
|
437
|
-
cancelDelete:
|
|
425
|
+
importFromUrl: ae,
|
|
426
|
+
toggleSelection: oe,
|
|
427
|
+
clearSelection: se,
|
|
428
|
+
selectItem: ce,
|
|
429
|
+
loadFolders: le,
|
|
430
|
+
createFolder: ue,
|
|
431
|
+
renameFolder: fe,
|
|
432
|
+
deleteFolder: pe,
|
|
433
|
+
findFolderInTree: de,
|
|
434
|
+
loadFrequentlyUsed: L,
|
|
435
|
+
checkUsageBeforeDelete: re,
|
|
436
|
+
confirmDelete: R,
|
|
437
|
+
cancelDelete: ie,
|
|
438
438
|
isReplacing: C,
|
|
439
439
|
replaceError: w,
|
|
440
440
|
showReplaceWarning: T,
|
|
441
441
|
pendingReplaceItem: E,
|
|
442
442
|
replaceUsageInfo: D,
|
|
443
|
-
checkUsageBeforeReplace:
|
|
444
|
-
cancelReplace:
|
|
445
|
-
replaceFile:
|
|
446
|
-
replaceMediaDirectly:
|
|
443
|
+
checkUsageBeforeReplace: me,
|
|
444
|
+
cancelReplace: he,
|
|
445
|
+
replaceFile: ge,
|
|
446
|
+
replaceMediaDirectly: _e
|
|
447
447
|
};
|
|
448
448
|
}
|
|
449
449
|
//#endregion
|
|
450
450
|
//#region ../media-library/src/composables/useI18n.ts
|
|
451
|
-
function
|
|
451
|
+
function z(e) {
|
|
452
452
|
let t = e ?? n("translations"), r = o(t) ? t.value : t;
|
|
453
453
|
function i(e, t) {
|
|
454
454
|
return e.replace(/\{(\w+)\}/g, (e, n) => n in t ? String(t[n]) : `{${n}}`);
|
|
@@ -460,14 +460,14 @@ function B(e) {
|
|
|
460
460
|
}
|
|
461
461
|
//#endregion
|
|
462
462
|
//#region ../media-library/src/components/media/MediaBreadcrumb.vue?vue&type=script&setup=true&lang.ts
|
|
463
|
-
var
|
|
463
|
+
var Se = {
|
|
464
464
|
key: 0,
|
|
465
465
|
class: "tpl:flex tpl:items-center tpl:gap-1 tpl:text-xs",
|
|
466
466
|
style: { color: "var(--tpl-text-muted)" }
|
|
467
|
-
},
|
|
467
|
+
}, Ce = ["onClick"], we = {
|
|
468
468
|
key: 1,
|
|
469
469
|
style: { color: "var(--tpl-text)" }
|
|
470
|
-
},
|
|
470
|
+
}, Te = /* @__PURE__ */ d({
|
|
471
471
|
__name: "MediaBreadcrumb",
|
|
472
472
|
props: {
|
|
473
473
|
folders: {},
|
|
@@ -475,7 +475,7 @@ var xe = {
|
|
|
475
475
|
},
|
|
476
476
|
emits: ["navigate"],
|
|
477
477
|
setup(e, { emit: t }) {
|
|
478
|
-
let n = e, i = t, { t: a } =
|
|
478
|
+
let n = e, i = t, { t: a } = z(), o = E(() => {
|
|
479
479
|
if (!n.currentFolderId) return [];
|
|
480
480
|
let e = [];
|
|
481
481
|
return s(n.folders, n.currentFolderId, e), e;
|
|
@@ -487,11 +487,11 @@ var xe = {
|
|
|
487
487
|
}
|
|
488
488
|
return !1;
|
|
489
489
|
}
|
|
490
|
-
return (e, t) => o.value.length > 0 ? (c(), p("div",
|
|
490
|
+
return (e, t) => o.value.length > 0 ? (c(), p("div", Se, [w("button", {
|
|
491
491
|
class: "tpl:transition-colors tpl:duration-150 tpl:hover:underline",
|
|
492
492
|
style: { color: "var(--tpl-primary)" },
|
|
493
493
|
onClick: t[0] ||= (e) => i("navigate", null)
|
|
494
|
-
}, C(m(a).mediaLibrary.allFiles), 1), (c(!0), p(v, null, r(o.value, (e, t) => (c(), p(v, { key: e.id }, [h(m(
|
|
494
|
+
}, C(m(a).mediaLibrary.allFiles), 1), (c(!0), p(v, null, r(o.value, (e, t) => (c(), p(v, { key: e.id }, [h(m(te), {
|
|
495
495
|
size: 12,
|
|
496
496
|
"stroke-width": 2
|
|
497
497
|
}), t < o.value.length - 1 ? (c(), p("button", {
|
|
@@ -499,12 +499,12 @@ var xe = {
|
|
|
499
499
|
class: "tpl:transition-colors tpl:duration-150 tpl:hover:underline",
|
|
500
500
|
style: { color: "var(--tpl-primary)" },
|
|
501
501
|
onClick: (t) => i("navigate", e.id)
|
|
502
|
-
}, C(e.name), 9,
|
|
502
|
+
}, C(e.name), 9, Ce)) : (c(), p("span", we, C(e.name), 1))], 64))), 128))])) : b("", !0);
|
|
503
503
|
}
|
|
504
504
|
});
|
|
505
505
|
//#endregion
|
|
506
506
|
//#region ../media-library/src/composables/useMediaCategories.ts
|
|
507
|
-
function
|
|
507
|
+
function Ee() {
|
|
508
508
|
let e = n("planConfig"), t = E(() => e.config.value?.media ?? null), r = E(() => t.value?.use_media_library ?? !0), i = E(() => t.value?.categories ?? null), a = E(() => i.value ? Object.values(i.value).flatMap((e) => e.mime_types) : []), o = E(() => a.value.join(",")), s = E(() => t.value?.max_file_size ?? 0);
|
|
509
509
|
function c(e, t) {
|
|
510
510
|
return i.value ? !t || t.length === 0 ? a.value.includes(e) : t.some((t) => i.value[t]?.mime_types.includes(e)) : !1;
|
|
@@ -530,14 +530,14 @@ function Te() {
|
|
|
530
530
|
}
|
|
531
531
|
//#endregion
|
|
532
532
|
//#region ../media-library/src/composables/useImageCrop.ts
|
|
533
|
-
var
|
|
533
|
+
var De = {
|
|
534
534
|
free: void 0,
|
|
535
535
|
square: 1,
|
|
536
536
|
landscape43: 4 / 3,
|
|
537
537
|
landscape169: 16 / 9,
|
|
538
538
|
original: void 0
|
|
539
539
|
};
|
|
540
|
-
function
|
|
540
|
+
function Oe(e) {
|
|
541
541
|
return e === "image/png" || e === "image/gif" ? {
|
|
542
542
|
mimeType: "image/png",
|
|
543
543
|
quality: 1
|
|
@@ -549,7 +549,7 @@ function De(e) {
|
|
|
549
549
|
quality: .92
|
|
550
550
|
};
|
|
551
551
|
}
|
|
552
|
-
function
|
|
552
|
+
function ke(e, t, n) {
|
|
553
553
|
let r = e.width, i = e.height;
|
|
554
554
|
if (!t && !n) return e;
|
|
555
555
|
let a = r, o = i;
|
|
@@ -559,7 +559,7 @@ function Oe(e, t, n) {
|
|
|
559
559
|
let c = s.getContext("2d");
|
|
560
560
|
return c && (c.imageSmoothingEnabled = !0, c.imageSmoothingQuality = "high", c.drawImage(e, 0, 0, a, o)), s;
|
|
561
561
|
}
|
|
562
|
-
function
|
|
562
|
+
function Ae(e, t, n) {
|
|
563
563
|
return new Promise((r, i) => {
|
|
564
564
|
e.toBlob((e) => {
|
|
565
565
|
if (!e) {
|
|
@@ -571,7 +571,7 @@ function ke(e, t, n) {
|
|
|
571
571
|
}, n.mimeType, n.quality);
|
|
572
572
|
});
|
|
573
573
|
}
|
|
574
|
-
function
|
|
574
|
+
function je(e, t, n, r) {
|
|
575
575
|
let i = e, a = t;
|
|
576
576
|
if (n && i > n) {
|
|
577
577
|
let e = n / i;
|
|
@@ -587,8 +587,8 @@ function Ae(e, t, n, r) {
|
|
|
587
587
|
};
|
|
588
588
|
}
|
|
589
589
|
//#endregion
|
|
590
|
-
//#region ../../node_modules/.bun/vue-advanced-cropper@2.8.9+
|
|
591
|
-
function
|
|
590
|
+
//#region ../../node_modules/.bun/vue-advanced-cropper@2.8.9+987b49219a7ab62d/node_modules/vue-advanced-cropper/dist/index.esm-bundler.js
|
|
591
|
+
function Me(e, t) {
|
|
592
592
|
var n = Object.keys(e);
|
|
593
593
|
if (Object.getOwnPropertySymbols) {
|
|
594
594
|
var r = Object.getOwnPropertySymbols(e);
|
|
@@ -598,18 +598,18 @@ function je(e, t) {
|
|
|
598
598
|
}
|
|
599
599
|
return n;
|
|
600
600
|
}
|
|
601
|
-
function
|
|
601
|
+
function B(e) {
|
|
602
602
|
for (var t = 1; t < arguments.length; t++) {
|
|
603
603
|
var n = arguments[t] == null ? {} : arguments[t];
|
|
604
|
-
t % 2 ?
|
|
605
|
-
|
|
606
|
-
})) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) :
|
|
604
|
+
t % 2 ? Me(Object(n), !0).forEach((function(t) {
|
|
605
|
+
V(e, t, n[t]);
|
|
606
|
+
})) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : Me(Object(n)).forEach((function(t) {
|
|
607
607
|
Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t));
|
|
608
608
|
}));
|
|
609
609
|
}
|
|
610
610
|
return e;
|
|
611
611
|
}
|
|
612
|
-
function
|
|
612
|
+
function V(e, t, n) {
|
|
613
613
|
return t in e ? Object.defineProperty(e, t, {
|
|
614
614
|
value: n,
|
|
615
615
|
enumerable: !0,
|
|
@@ -617,7 +617,7 @@ function H(e, t, n) {
|
|
|
617
617
|
writable: !0
|
|
618
618
|
}) : e[t] = n, e;
|
|
619
619
|
}
|
|
620
|
-
function
|
|
620
|
+
function Ne(e, t) {
|
|
621
621
|
if (e == null) return {};
|
|
622
622
|
var n, r, i = function(e, t) {
|
|
623
623
|
if (e == null) return {};
|
|
@@ -631,28 +631,28 @@ function Me(e, t) {
|
|
|
631
631
|
}
|
|
632
632
|
return i;
|
|
633
633
|
}
|
|
634
|
-
function
|
|
634
|
+
function Pe(e) {
|
|
635
635
|
return function(e) {
|
|
636
|
-
if (Array.isArray(e)) return
|
|
636
|
+
if (Array.isArray(e)) return Fe(e);
|
|
637
637
|
}(e) || function(e) {
|
|
638
638
|
if (typeof Symbol < "u" && e[Symbol.iterator] != null || e["@@iterator"] != null) return Array.from(e);
|
|
639
639
|
}(e) || function(e, t) {
|
|
640
640
|
if (e) {
|
|
641
|
-
if (typeof e == "string") return
|
|
641
|
+
if (typeof e == "string") return Fe(e, t);
|
|
642
642
|
var n = Object.prototype.toString.call(e).slice(8, -1);
|
|
643
643
|
if (n === "Object" && e.constructor && (n = e.constructor.name), n === "Map" || n === "Set") return Array.from(e);
|
|
644
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return
|
|
644
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return Fe(e, t);
|
|
645
645
|
}
|
|
646
646
|
}(e) || function() {
|
|
647
647
|
throw TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
648
648
|
}();
|
|
649
649
|
}
|
|
650
|
-
function
|
|
650
|
+
function Fe(e, t) {
|
|
651
651
|
(t == null || t > e.length) && (t = e.length);
|
|
652
652
|
for (var n = 0, r = Array(t); n < t; n++) r[n] = e[n];
|
|
653
653
|
return r;
|
|
654
654
|
}
|
|
655
|
-
var
|
|
655
|
+
var Ie, Le, Re, H = (Ie = function(e) {
|
|
656
656
|
(function() {
|
|
657
657
|
var t = {}.hasOwnProperty;
|
|
658
658
|
function n() {
|
|
@@ -674,15 +674,15 @@ var Fe, Ie, Le, U = (Fe = function(e) {
|
|
|
674
674
|
}
|
|
675
675
|
e.exports ? (n.default = n, e.exports = n) : window.classNames = n;
|
|
676
676
|
})();
|
|
677
|
-
},
|
|
678
|
-
path:
|
|
677
|
+
}, Ie(Re = {
|
|
678
|
+
path: Le,
|
|
679
679
|
exports: {},
|
|
680
680
|
require: function(e, t) {
|
|
681
681
|
return function() {
|
|
682
682
|
throw Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs");
|
|
683
|
-
}(t == null &&
|
|
683
|
+
}(t == null && Re.path);
|
|
684
684
|
}
|
|
685
|
-
},
|
|
685
|
+
}, Re.exports), Re.exports), U = function(e) {
|
|
686
686
|
return function(t, n) {
|
|
687
687
|
if (!t) return e;
|
|
688
688
|
var r;
|
|
@@ -694,7 +694,7 @@ var Fe, Ie, Le, U = (Fe = function(e) {
|
|
|
694
694
|
}), "") : "");
|
|
695
695
|
};
|
|
696
696
|
};
|
|
697
|
-
function
|
|
697
|
+
function ze(e, t, n) {
|
|
698
698
|
var r, i, a, o, s;
|
|
699
699
|
function c() {
|
|
700
700
|
var l = Date.now() - o;
|
|
@@ -712,65 +712,65 @@ function Re(e, t, n) {
|
|
|
712
712
|
r &&= (s = e.apply(a, i), a = i = null, clearTimeout(r), null);
|
|
713
713
|
}, l;
|
|
714
714
|
}
|
|
715
|
-
|
|
716
|
-
var
|
|
717
|
-
return
|
|
715
|
+
ze.debounce = ze;
|
|
716
|
+
var Be = ze, W = function() {
|
|
717
|
+
return W = Object.assign || function(e) {
|
|
718
718
|
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]);
|
|
719
719
|
return e;
|
|
720
|
-
},
|
|
720
|
+
}, W.apply(this, arguments);
|
|
721
721
|
};
|
|
722
|
-
function
|
|
722
|
+
function Ve(e, t) {
|
|
723
723
|
var n, r;
|
|
724
724
|
return e && t ? (n = "" + e + t[0].toUpperCase() + t.slice(1), r = e + "-" + t) : (n = e || t, r = e || t), {
|
|
725
725
|
name: n,
|
|
726
726
|
classname: r
|
|
727
727
|
};
|
|
728
728
|
}
|
|
729
|
-
function
|
|
729
|
+
function He(e) {
|
|
730
730
|
return /^blob:/.test(e);
|
|
731
731
|
}
|
|
732
|
-
function
|
|
733
|
-
return
|
|
732
|
+
function Ue(e) {
|
|
733
|
+
return He(e) || function(e) {
|
|
734
734
|
return /^data:/.test(e);
|
|
735
735
|
}(e);
|
|
736
736
|
}
|
|
737
|
-
function
|
|
737
|
+
function We(e) {
|
|
738
738
|
return !!(e && e.constructor && e.call && e.apply);
|
|
739
739
|
}
|
|
740
|
-
function
|
|
740
|
+
function G(e) {
|
|
741
741
|
return e === void 0;
|
|
742
742
|
}
|
|
743
|
-
function
|
|
743
|
+
function Ge(e) {
|
|
744
744
|
return typeof e == "object" && !!e;
|
|
745
745
|
}
|
|
746
|
-
function
|
|
746
|
+
function Ke(e, t, n) {
|
|
747
747
|
var r = {};
|
|
748
|
-
return
|
|
749
|
-
|
|
748
|
+
return Ge(e) ? (Object.keys(t).forEach((function(i) {
|
|
749
|
+
G(e[i]) ? r[i] = t[i] : Ge(t[i]) ? Ge(e[i]) ? r[i] = Ke(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];
|
|
750
750
|
})), r) : e ? t : n;
|
|
751
751
|
}
|
|
752
|
-
function
|
|
752
|
+
function qe(e) {
|
|
753
753
|
var t = Number(e);
|
|
754
754
|
return Number.isNaN(t) ? e : t;
|
|
755
755
|
}
|
|
756
|
-
function
|
|
756
|
+
function Je(e) {
|
|
757
757
|
return typeof (e == "number" || function(e) {
|
|
758
758
|
return typeof e == "object" && !!e;
|
|
759
|
-
}(e) && toString.call(e) == "[object Number]") && !
|
|
759
|
+
}(e) && toString.call(e) == "[object Number]") && !Ye(e);
|
|
760
760
|
}
|
|
761
|
-
function
|
|
761
|
+
function Ye(e) {
|
|
762
762
|
return e != e;
|
|
763
763
|
}
|
|
764
|
-
function
|
|
764
|
+
function Xe(e, t) {
|
|
765
765
|
return Math.sqrt((e.x - t.x) ** 2 + (e.y - t.y) ** 2);
|
|
766
766
|
}
|
|
767
|
-
var
|
|
767
|
+
var Ze = function(e, t) {
|
|
768
768
|
e === void 0 && (e = {}), t === void 0 && (t = {}), this.type = "manipulateImage", this.move = e, this.scale = t;
|
|
769
|
-
},
|
|
769
|
+
}, Qe = function(e, t) {
|
|
770
770
|
t === void 0 && (t = {}), this.type = "resize", this.directions = e, this.params = t;
|
|
771
|
-
},
|
|
771
|
+
}, $e = function(e) {
|
|
772
772
|
this.type = "move", this.directions = e;
|
|
773
|
-
},
|
|
773
|
+
}, et = function() {
|
|
774
774
|
function e(e, t, n, r, i) {
|
|
775
775
|
this.type = "drag", this.nativeEvent = e, this.position = n, this.previousPosition = r, this.element = t, this.anchor = i;
|
|
776
776
|
}
|
|
@@ -788,7 +788,7 @@ var Xe = function(e, t) {
|
|
|
788
788
|
top: 0
|
|
789
789
|
};
|
|
790
790
|
}, e;
|
|
791
|
-
}(),
|
|
791
|
+
}(), tt = {
|
|
792
792
|
name: "DraggableElement",
|
|
793
793
|
props: { classname: { type: String } },
|
|
794
794
|
beforeMount: function() {
|
|
@@ -809,7 +809,7 @@ var Xe = function(e, t) {
|
|
|
809
809
|
this.hovered && !this.touches.length && (this.hovered = !1, this.$emit("leave"));
|
|
810
810
|
},
|
|
811
811
|
onTouchStart: function(e) {
|
|
812
|
-
e.cancelable && !this.disabled && e.touches.length === 1 && (this.touches =
|
|
812
|
+
e.cancelable && !this.disabled && e.touches.length === 1 && (this.touches = Pe(e.touches), this.hovered ||= (this.$emit("enter"), !0), e.touches.length && this.initAnchor(this.touches.reduce((function(t, n) {
|
|
813
813
|
return {
|
|
814
814
|
clientX: t.clientX + n.clientX / e.touches.length,
|
|
815
815
|
clientY: t.clientY + n.clientY / e.touches.length
|
|
@@ -855,11 +855,11 @@ var Xe = function(e, t) {
|
|
|
855
855
|
};
|
|
856
856
|
},
|
|
857
857
|
processMove: function(e, t) {
|
|
858
|
-
var n =
|
|
858
|
+
var n = Pe(t);
|
|
859
859
|
if (this.touches.length) {
|
|
860
860
|
if (this.touches.length === 1 && n.length === 1) {
|
|
861
861
|
var r = this.$refs.draggable;
|
|
862
|
-
this.$emit("drag", new
|
|
862
|
+
this.$emit("drag", new et(e, r, {
|
|
863
863
|
left: n[0].clientX,
|
|
864
864
|
top: n[0].clientY
|
|
865
865
|
}, {
|
|
@@ -881,7 +881,7 @@ var Xe = function(e, t) {
|
|
|
881
881
|
"enter"
|
|
882
882
|
]
|
|
883
883
|
};
|
|
884
|
-
|
|
884
|
+
tt.render = function(e, t, n, r, i, o) {
|
|
885
885
|
return c(), x("div", {
|
|
886
886
|
ref: "draggable",
|
|
887
887
|
class: n.classname,
|
|
@@ -899,9 +899,9 @@ et.render = function(e, t, n, r, i, o) {
|
|
|
899
899
|
}
|
|
900
900
|
}, [a(e.$slots, "default")], 34);
|
|
901
901
|
};
|
|
902
|
-
var
|
|
902
|
+
var nt = U("vue-handler-wrapper"), rt = {
|
|
903
903
|
name: "HandlerWrapper",
|
|
904
|
-
components: { DraggableElement:
|
|
904
|
+
components: { DraggableElement: tt },
|
|
905
905
|
props: {
|
|
906
906
|
horizontalPosition: { type: String },
|
|
907
907
|
verticalPosition: { type: String },
|
|
@@ -913,12 +913,12 @@ var tt = W("vue-handler-wrapper"), nt = {
|
|
|
913
913
|
computed: { classes: function() {
|
|
914
914
|
var e;
|
|
915
915
|
if (this.horizontalPosition || this.verticalPosition) {
|
|
916
|
-
var t, n =
|
|
917
|
-
e =
|
|
918
|
-
} else e =
|
|
916
|
+
var t, n = Ve(this.horizontalPosition, this.verticalPosition);
|
|
917
|
+
e = nt((V(t = {}, n.classname, !0), V(t, "disabled", this.disabled), t));
|
|
918
|
+
} else e = nt({ disabled: this.disabled });
|
|
919
919
|
return {
|
|
920
920
|
root: e,
|
|
921
|
-
draggable:
|
|
921
|
+
draggable: nt("draggable")
|
|
922
922
|
};
|
|
923
923
|
} },
|
|
924
924
|
emits: [
|
|
@@ -928,7 +928,7 @@ var tt = W("vue-handler-wrapper"), nt = {
|
|
|
928
928
|
"drag-end"
|
|
929
929
|
]
|
|
930
930
|
};
|
|
931
|
-
|
|
931
|
+
rt.render = function(e, t, n, r, o, l) {
|
|
932
932
|
var u = s("DraggableElement");
|
|
933
933
|
return c(), x("div", { class: l.classes.root }, [h(u, {
|
|
934
934
|
class: l.classes.draggable,
|
|
@@ -951,9 +951,9 @@ nt.render = function(e, t, n, r, o, l) {
|
|
|
951
951
|
_: 3
|
|
952
952
|
}, 8, ["class"])], 2);
|
|
953
953
|
};
|
|
954
|
-
var
|
|
954
|
+
var it = U("vue-line-wrapper"), at = {
|
|
955
955
|
name: "LineWrapper",
|
|
956
|
-
components: { DraggableElement:
|
|
956
|
+
components: { DraggableElement: tt },
|
|
957
957
|
props: {
|
|
958
958
|
position: {
|
|
959
959
|
type: String,
|
|
@@ -966,7 +966,7 @@ var rt = W("vue-line-wrapper"), it = {
|
|
|
966
966
|
},
|
|
967
967
|
computed: { classname: function() {
|
|
968
968
|
var e;
|
|
969
|
-
return
|
|
969
|
+
return it((V(e = {}, this.position, !0), V(e, "disabled", this.disabled), e));
|
|
970
970
|
} },
|
|
971
971
|
emits: [
|
|
972
972
|
"leave",
|
|
@@ -975,7 +975,7 @@ var rt = W("vue-line-wrapper"), it = {
|
|
|
975
975
|
"drag-end"
|
|
976
976
|
]
|
|
977
977
|
};
|
|
978
|
-
|
|
978
|
+
at.render = function(e, t, n, r, o, l) {
|
|
979
979
|
var u = s("DraggableElement");
|
|
980
980
|
return c(), x(u, {
|
|
981
981
|
class: l.classname,
|
|
@@ -998,23 +998,23 @@ it.render = function(e, t, n, r, o, l) {
|
|
|
998
998
|
_: 3
|
|
999
999
|
}, 8, ["class"]);
|
|
1000
1000
|
};
|
|
1001
|
-
var
|
|
1001
|
+
var K = [
|
|
1002
1002
|
"left",
|
|
1003
1003
|
"right",
|
|
1004
1004
|
"top",
|
|
1005
1005
|
"bottom"
|
|
1006
|
-
],
|
|
1006
|
+
], ot = ["left", "right"], st = ["top", "bottom"], ct = ["left", "top"], lt = [
|
|
1007
1007
|
"fill-area",
|
|
1008
1008
|
"fit-area",
|
|
1009
1009
|
"stencil",
|
|
1010
1010
|
"none"
|
|
1011
|
-
],
|
|
1011
|
+
], ut = {
|
|
1012
1012
|
left: 0,
|
|
1013
1013
|
top: 0,
|
|
1014
1014
|
width: 0,
|
|
1015
1015
|
height: 0
|
|
1016
1016
|
};
|
|
1017
|
-
function
|
|
1017
|
+
function dt(e, t, n) {
|
|
1018
1018
|
return !(n ||= [
|
|
1019
1019
|
"width",
|
|
1020
1020
|
"height",
|
|
@@ -1024,7 +1024,7 @@ function ut(e, t, n) {
|
|
|
1024
1024
|
return e[n] !== t[n];
|
|
1025
1025
|
}));
|
|
1026
1026
|
}
|
|
1027
|
-
function
|
|
1027
|
+
function q(e) {
|
|
1028
1028
|
return {
|
|
1029
1029
|
left: e.left,
|
|
1030
1030
|
top: e.top,
|
|
@@ -1032,31 +1032,31 @@ function J(e) {
|
|
|
1032
1032
|
bottom: e.top + e.height
|
|
1033
1033
|
};
|
|
1034
1034
|
}
|
|
1035
|
-
function
|
|
1035
|
+
function ft(e, t) {
|
|
1036
1036
|
return {
|
|
1037
1037
|
left: e.left - t.left,
|
|
1038
1038
|
top: e.top - t.top
|
|
1039
1039
|
};
|
|
1040
1040
|
}
|
|
1041
|
-
function
|
|
1041
|
+
function J(e) {
|
|
1042
1042
|
return {
|
|
1043
1043
|
left: e.left + e.width / 2,
|
|
1044
1044
|
top: e.top + e.height / 2
|
|
1045
1045
|
};
|
|
1046
1046
|
}
|
|
1047
|
-
function
|
|
1047
|
+
function pt(e, t) {
|
|
1048
1048
|
var n = {
|
|
1049
1049
|
left: 0,
|
|
1050
1050
|
top: 0,
|
|
1051
1051
|
right: 0,
|
|
1052
1052
|
bottom: 0
|
|
1053
1053
|
};
|
|
1054
|
-
return
|
|
1055
|
-
var i = t[r], a =
|
|
1054
|
+
return K.forEach((function(r) {
|
|
1055
|
+
var i = t[r], a = q(e)[r];
|
|
1056
1056
|
n[r] = i !== void 0 && a !== void 0 ? r === "left" || r === "top" ? Math.max(0, i - a) : Math.max(0, a - i) : 0;
|
|
1057
1057
|
})), n;
|
|
1058
1058
|
}
|
|
1059
|
-
function
|
|
1059
|
+
function Y(e, t) {
|
|
1060
1060
|
return {
|
|
1061
1061
|
left: e.left - t.left,
|
|
1062
1062
|
top: e.top - t.top,
|
|
@@ -1071,7 +1071,7 @@ function mt(e) {
|
|
|
1071
1071
|
};
|
|
1072
1072
|
}
|
|
1073
1073
|
function X(e, t) {
|
|
1074
|
-
return
|
|
1074
|
+
return W(W({}, e), {
|
|
1075
1075
|
left: e.left + t.left,
|
|
1076
1076
|
top: e.top + t.top
|
|
1077
1077
|
});
|
|
@@ -1079,7 +1079,7 @@ function X(e, t) {
|
|
|
1079
1079
|
function Z(e, t, n, r) {
|
|
1080
1080
|
if (t !== 1) {
|
|
1081
1081
|
if (n) {
|
|
1082
|
-
var i =
|
|
1082
|
+
var i = J(e);
|
|
1083
1083
|
return {
|
|
1084
1084
|
width: e.width * t,
|
|
1085
1085
|
height: e.height * t,
|
|
@@ -1106,7 +1106,7 @@ function gt(e, t) {
|
|
|
1106
1106
|
var n = {
|
|
1107
1107
|
left: 0,
|
|
1108
1108
|
top: 0
|
|
1109
|
-
}, r =
|
|
1109
|
+
}, r = pt(e, t);
|
|
1110
1110
|
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;
|
|
1111
1111
|
}
|
|
1112
1112
|
function _t(e, t) {
|
|
@@ -1144,7 +1144,7 @@ function bt(e, t) {
|
|
|
1144
1144
|
};
|
|
1145
1145
|
}
|
|
1146
1146
|
function xt(e, t) {
|
|
1147
|
-
var n =
|
|
1147
|
+
var n = pt($(e, t), t);
|
|
1148
1148
|
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, ht(e, t)) : Math.min((e.height + n.top + n.bottom) / e.height, ht(e, t)) : 1;
|
|
1149
1149
|
}
|
|
1150
1150
|
function $(e, t, n) {
|
|
@@ -1159,7 +1159,7 @@ function St(e) {
|
|
|
1159
1159
|
};
|
|
1160
1160
|
}
|
|
1161
1161
|
function Ct(e, t) {
|
|
1162
|
-
return
|
|
1162
|
+
return W(W({}, e), {
|
|
1163
1163
|
minWidth: Math.min(t.width, e.minWidth),
|
|
1164
1164
|
minHeight: Math.min(t.height, e.minHeight),
|
|
1165
1165
|
maxWidth: Math.min(t.width, e.maxWidth),
|
|
@@ -1169,7 +1169,7 @@ function Ct(e, t) {
|
|
|
1169
1169
|
function wt(e, t, n) {
|
|
1170
1170
|
n === void 0 && (n = !0);
|
|
1171
1171
|
var r = {};
|
|
1172
|
-
return
|
|
1172
|
+
return K.forEach((function(i) {
|
|
1173
1173
|
var a = e[i], o = t[i];
|
|
1174
1174
|
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;
|
|
1175
1175
|
})), r;
|
|
@@ -1239,20 +1239,20 @@ function At(e) {
|
|
|
1239
1239
|
return kt({
|
|
1240
1240
|
coordinates: e,
|
|
1241
1241
|
positionRestrictions: a,
|
|
1242
|
-
event: new
|
|
1242
|
+
event: new $e({
|
|
1243
1243
|
left: t.left - e.left,
|
|
1244
1244
|
top: t.top - e.top
|
|
1245
1245
|
})
|
|
1246
1246
|
});
|
|
1247
|
-
}, l =
|
|
1247
|
+
}, l = W({}, t);
|
|
1248
1248
|
return (Array.isArray(n) ? n : [n]).forEach((function(e) {
|
|
1249
1249
|
var t = {};
|
|
1250
|
-
|
|
1250
|
+
G((t = typeof e == "function" ? e({
|
|
1251
1251
|
coordinates: l,
|
|
1252
1252
|
imageSize: r,
|
|
1253
1253
|
visibleArea: s
|
|
1254
|
-
}) : e).width) &&
|
|
1255
|
-
return c(
|
|
1254
|
+
}) : e).width) && G(t.height) || (l = function(e, t) {
|
|
1255
|
+
return c(W(W(W({}, e), Ot({
|
|
1256
1256
|
width: t.width,
|
|
1257
1257
|
height: t.height,
|
|
1258
1258
|
sizeRestrictions: i,
|
|
@@ -1264,12 +1264,12 @@ function At(e) {
|
|
|
1264
1264
|
left: e.left,
|
|
1265
1265
|
top: e.top
|
|
1266
1266
|
});
|
|
1267
|
-
}(l,
|
|
1267
|
+
}(l, W(W({}, l), t))), G(t.left) && G(t.top) || (l = c(l, W(W({}, l), t)));
|
|
1268
1268
|
})), l;
|
|
1269
1269
|
}
|
|
1270
1270
|
function jt(e) {
|
|
1271
|
-
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 =
|
|
1272
|
-
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 =
|
|
1271
|
+
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);
|
|
1272
|
+
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), Ot({
|
|
1273
1273
|
sizeRestrictions: o,
|
|
1274
1274
|
width: d.width,
|
|
1275
1275
|
height: d.height,
|
|
@@ -1282,16 +1282,16 @@ function jt(e) {
|
|
|
1282
1282
|
visibleArea: f,
|
|
1283
1283
|
type: "resize"
|
|
1284
1284
|
}));
|
|
1285
|
-
return m !== 1 && (f = Z(f, m), d = Z(d, m)), f = $(f = X(f,
|
|
1285
|
+
return m !== 1 && (f = Z(f, m), d = Z(d, m)), f = $(f = X(f, ft(J(d), J(f))), t({
|
|
1286
1286
|
visibleArea: f,
|
|
1287
1287
|
type: "move"
|
|
1288
1288
|
})), {
|
|
1289
|
-
coordinates: d = $(d, Tt(
|
|
1289
|
+
coordinates: d = $(d, Tt(q(f), s)),
|
|
1290
1290
|
visibleArea: f
|
|
1291
1291
|
};
|
|
1292
1292
|
}
|
|
1293
1293
|
function Mt(e) {
|
|
1294
|
-
var t = e.event, n = e.getAreaRestrictions, r = e.boundaries, i = e.coordinates, a = e.visibleArea, o = e.positionRestrictions, s =
|
|
1294
|
+
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);
|
|
1295
1295
|
if (i && a && t.type !== "manipulateImage") {
|
|
1296
1296
|
var l = {
|
|
1297
1297
|
width: 0,
|
|
@@ -1302,10 +1302,10 @@ function Mt(e) {
|
|
|
1302
1302
|
visibleArea: c,
|
|
1303
1303
|
type: "resize"
|
|
1304
1304
|
}));
|
|
1305
|
-
c = Z(c, u), u !== 1 && (l.height /= u, l.width /= u), c = $(c = X(c,
|
|
1305
|
+
c = Z(c, u), u !== 1 && (l.height /= u, l.width /= u), c = $(c = X(c, ft(J(s), J(c))), n({
|
|
1306
1306
|
visibleArea: c,
|
|
1307
1307
|
type: "move"
|
|
1308
|
-
})), s = $(s, Tt(
|
|
1308
|
+
})), s = $(s, Tt(q(c), o));
|
|
1309
1309
|
}
|
|
1310
1310
|
return {
|
|
1311
1311
|
coordinates: s,
|
|
@@ -1313,7 +1313,7 @@ function Mt(e) {
|
|
|
1313
1313
|
};
|
|
1314
1314
|
}
|
|
1315
1315
|
function Nt(e) {
|
|
1316
|
-
var t = e.event, n = e.coordinates, r = e.visibleArea, i = e.getAreaRestrictions, a =
|
|
1316
|
+
var t = e.event, n = e.coordinates, r = e.visibleArea, i = e.getAreaRestrictions, a = W({}, r), o = W({}, n);
|
|
1317
1317
|
if (t.type === "setCoordinates") {
|
|
1318
1318
|
var s = Math.max(0, o.width - a.width), c = Math.max(0, o.height - a.height);
|
|
1319
1319
|
s > c ? a = Z(a, Math.min(o.width / a.width, ht(a, i({
|
|
@@ -1322,7 +1322,7 @@ function Nt(e) {
|
|
|
1322
1322
|
})))) : c > s && (a = Z(a, Math.min(o.height / a.height, ht(a, i({
|
|
1323
1323
|
visibleArea: a,
|
|
1324
1324
|
type: "resize"
|
|
1325
|
-
}))))), a = $(a = X(a, mt(gt(o,
|
|
1325
|
+
}))))), a = $(a = X(a, mt(gt(o, q(a)))), i({
|
|
1326
1326
|
visibleArea: a,
|
|
1327
1327
|
type: "move"
|
|
1328
1328
|
}));
|
|
@@ -1347,7 +1347,7 @@ function Ft(e) {
|
|
|
1347
1347
|
height: .8 * a.height,
|
|
1348
1348
|
width: .8 * a.height * o
|
|
1349
1349
|
};
|
|
1350
|
-
return Ot(
|
|
1350
|
+
return Ot(W(W({}, s), {
|
|
1351
1351
|
aspectRatio: r,
|
|
1352
1352
|
sizeRestrictions: i
|
|
1353
1353
|
}));
|
|
@@ -1375,7 +1375,7 @@ function Lt(e) {
|
|
|
1375
1375
|
top: n.top + n.height / 2 - o.height / 2,
|
|
1376
1376
|
width: o.width,
|
|
1377
1377
|
height: o.height
|
|
1378
|
-
}, c =
|
|
1378
|
+
}, c = pt(n, q(W({
|
|
1379
1379
|
left: 0,
|
|
1380
1380
|
top: 0
|
|
1381
1381
|
}, r))), l = {};
|
|
@@ -1393,10 +1393,10 @@ function Lt(e) {
|
|
|
1393
1393
|
};
|
|
1394
1394
|
}
|
|
1395
1395
|
function Rt(e, t) {
|
|
1396
|
-
return wt(e,
|
|
1396
|
+
return wt(e, q(t));
|
|
1397
1397
|
}
|
|
1398
1398
|
function zt(e) {
|
|
1399
|
-
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 =
|
|
1399
|
+
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;
|
|
1400
1400
|
u = X(u, {
|
|
1401
1401
|
left: l.left || 0,
|
|
1402
1402
|
top: l.top || 0
|
|
@@ -1421,49 +1421,49 @@ function zt(e) {
|
|
|
1421
1421
|
})), a({
|
|
1422
1422
|
visibleArea: u,
|
|
1423
1423
|
type: "move"
|
|
1424
|
-
})), d.width *= p, d.height *= p, d.left = u.left + g * p, d.top = u.top + v * p, d = $(d, Tt(
|
|
1424
|
+
})), d.width *= p, d.height *= p, d.left = u.left + g * p, d.top = u.top + v * p, d = $(d, Tt(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({
|
|
1425
1425
|
visibleArea: u,
|
|
1426
1426
|
type: "move"
|
|
1427
|
-
})), mt(gt(d,
|
|
1427
|
+
})), mt(gt(d, q(u)))))), {
|
|
1428
1428
|
coordinates: d,
|
|
1429
1429
|
visibleArea: u
|
|
1430
1430
|
};
|
|
1431
1431
|
}
|
|
1432
1432
|
function Bt(e) {
|
|
1433
|
-
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 =
|
|
1433
|
+
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 = bt(J(W({
|
|
1434
1434
|
left: 0,
|
|
1435
1435
|
top: 0
|
|
1436
1436
|
}, c)), l);
|
|
1437
|
-
return (u =
|
|
1437
|
+
return (u = W(W({}, Ot({
|
|
1438
1438
|
sizeRestrictions: a,
|
|
1439
1439
|
aspectRatio: t,
|
|
1440
1440
|
width: u.width,
|
|
1441
1441
|
height: u.height
|
|
1442
|
-
})), bt(
|
|
1442
|
+
})), bt(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, xt(d, n({
|
|
1443
1443
|
visibleArea: d,
|
|
1444
1444
|
type: "resize"
|
|
1445
1445
|
}))), {
|
|
1446
1446
|
coordinates: u = $(u, o),
|
|
1447
|
-
visibleArea: d = $(d = X(d,
|
|
1447
|
+
visibleArea: d = $(d = X(d, ft(J(u), J(r))), n({
|
|
1448
1448
|
visibleArea: d,
|
|
1449
1449
|
type: "move"
|
|
1450
1450
|
}))
|
|
1451
1451
|
};
|
|
1452
1452
|
}
|
|
1453
1453
|
function Vt(e) {
|
|
1454
|
-
var t = e.flip, n = e.previousFlip, r = e.rotate, i = e.getAreaRestrictions, a = e.coordinates, o = e.visibleArea, s = e.imageSize, c =
|
|
1454
|
+
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;
|
|
1455
1455
|
if (u || d) {
|
|
1456
1456
|
var f = bt({
|
|
1457
1457
|
left: s.width / 2,
|
|
1458
1458
|
top: s.height / 2
|
|
1459
|
-
}, -r), p = bt(
|
|
1459
|
+
}, -r), p = bt(J(c), -r), m = bt({
|
|
1460
1460
|
left: u ? f.left - (p.left - f.left) : p.left,
|
|
1461
1461
|
top: d ? f.top - (p.top - f.top) : p.top
|
|
1462
1462
|
}, r);
|
|
1463
|
-
c = X(c,
|
|
1463
|
+
c = X(c, ft(m, J(c))), p = bt(J(l), -r), l = $(l = X(l, ft(m = bt({
|
|
1464
1464
|
left: u ? f.left - (p.left - f.left) : p.left,
|
|
1465
1465
|
top: d ? f.top - (p.top - f.top) : p.top
|
|
1466
|
-
}, r),
|
|
1466
|
+
}, r), J(l))), i({
|
|
1467
1467
|
visibleArea: l,
|
|
1468
1468
|
type: "move"
|
|
1469
1469
|
}));
|
|
@@ -1474,10 +1474,10 @@ function Vt(e) {
|
|
|
1474
1474
|
};
|
|
1475
1475
|
}
|
|
1476
1476
|
function Ht(e) {
|
|
1477
|
-
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 =
|
|
1477
|
+
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;
|
|
1478
1478
|
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)));
|
|
1479
|
-
var d =
|
|
1480
|
-
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 =
|
|
1479
|
+
var d = pt(Y(n, c), i);
|
|
1480
|
+
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 = pt(Y(n, c), i));
|
|
1481
1481
|
var f = {
|
|
1482
1482
|
width: Infinity,
|
|
1483
1483
|
height: Infinity,
|
|
@@ -1486,27 +1486,27 @@ function Ht(e) {
|
|
|
1486
1486
|
top: Infinity,
|
|
1487
1487
|
bottom: Infinity
|
|
1488
1488
|
};
|
|
1489
|
-
if (
|
|
1489
|
+
if (K.forEach((function(e) {
|
|
1490
1490
|
var t = d[e];
|
|
1491
1491
|
t && c[e] && (f[e] = Math.max(0, 1 - t / c[e]));
|
|
1492
1492
|
})), o) {
|
|
1493
|
-
var p = Math.min.apply(null,
|
|
1493
|
+
var p = Math.min.apply(null, K.map((function(e) {
|
|
1494
1494
|
return f[e];
|
|
1495
1495
|
})));
|
|
1496
|
-
p !== Infinity &&
|
|
1496
|
+
p !== Infinity && K.forEach((function(e) {
|
|
1497
1497
|
c[e] *= p;
|
|
1498
1498
|
}));
|
|
1499
|
-
} else
|
|
1499
|
+
} else K.forEach((function(e) {
|
|
1500
1500
|
f[e] !== Infinity && (c[e] *= f[e]);
|
|
1501
1501
|
}));
|
|
1502
|
-
if (l =
|
|
1502
|
+
if (l = Y(n, c).width, u = Y(n, c).height, c.right + c.left && (l > a.maxWidth ? f.width = (a.maxWidth - n.width) / (c.right + c.left) : l < a.minWidth && (f.width = (a.minWidth - n.width) / (c.right + c.left))), c.bottom + c.top && (u > a.maxHeight ? f.height = (a.maxHeight - n.height) / (c.bottom + c.top) : u < a.minHeight && (f.height = (a.minHeight - n.height) / (c.bottom + c.top))), o) {
|
|
1503
1503
|
var m = Math.min(f.width, f.height);
|
|
1504
|
-
m !== Infinity &&
|
|
1504
|
+
m !== Infinity && K.forEach((function(e) {
|
|
1505
1505
|
c[e] *= m;
|
|
1506
1506
|
}));
|
|
1507
|
-
} else f.width !== Infinity &&
|
|
1507
|
+
} else f.width !== Infinity && ot.forEach((function(e) {
|
|
1508
1508
|
c[e] *= f.width;
|
|
1509
|
-
})), f.height !== Infinity &&
|
|
1509
|
+
})), f.height !== Infinity && st.forEach((function(e) {
|
|
1510
1510
|
c[e] *= f.height;
|
|
1511
1511
|
}));
|
|
1512
1512
|
return c;
|
|
@@ -1514,9 +1514,9 @@ function Ht(e) {
|
|
|
1514
1514
|
function Ut(e, t, n) {
|
|
1515
1515
|
return t == 0 && n == 0 ? e / 2 : t == 0 ? 0 : n == 0 ? e : e * Math.abs(t / (t + n));
|
|
1516
1516
|
}
|
|
1517
|
-
var Wt =
|
|
1517
|
+
var Wt = U("vue-simple-handler"), Gt = U("vue-simple-handler-wrapper"), Kt = {
|
|
1518
1518
|
name: "SimpleHandler",
|
|
1519
|
-
components: { HandlerWrapper:
|
|
1519
|
+
components: { HandlerWrapper: rt },
|
|
1520
1520
|
props: {
|
|
1521
1521
|
defaultClass: { type: String },
|
|
1522
1522
|
hoverClass: { type: String },
|
|
@@ -1532,10 +1532,10 @@ var Wt = W("vue-simple-handler"), Gt = W("vue-simple-handler-wrapper"), Kt = {
|
|
|
1532
1532
|
return { hover: !1 };
|
|
1533
1533
|
},
|
|
1534
1534
|
computed: { classes: function() {
|
|
1535
|
-
var e, t = (
|
|
1535
|
+
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);
|
|
1536
1536
|
return {
|
|
1537
|
-
default:
|
|
1538
|
-
wrapper:
|
|
1537
|
+
default: H(Wt(t), this.defaultClass, this.hover && this.hoverClass),
|
|
1538
|
+
wrapper: H(Gt(t), this.wrapperClass)
|
|
1539
1539
|
};
|
|
1540
1540
|
} },
|
|
1541
1541
|
methods: {
|
|
@@ -1581,9 +1581,9 @@ Kt.render = function(e, t, n, r, a, o) {
|
|
|
1581
1581
|
"onLeave"
|
|
1582
1582
|
]);
|
|
1583
1583
|
};
|
|
1584
|
-
var qt =
|
|
1584
|
+
var qt = U("vue-simple-line"), Jt = U("vue-simple-line-wrapper"), Yt = {
|
|
1585
1585
|
name: "SimpleLine",
|
|
1586
|
-
components: { LineWrapper:
|
|
1586
|
+
components: { LineWrapper: at },
|
|
1587
1587
|
props: {
|
|
1588
1588
|
defaultClass: { type: String },
|
|
1589
1589
|
hoverClass: { type: String },
|
|
@@ -1599,8 +1599,8 @@ var qt = W("vue-simple-line"), Jt = W("vue-simple-line-wrapper"), Yt = {
|
|
|
1599
1599
|
},
|
|
1600
1600
|
computed: { classes: function() {
|
|
1601
1601
|
return {
|
|
1602
|
-
root:
|
|
1603
|
-
wrapper:
|
|
1602
|
+
root: H(qt(V({}, this.position, !0)), this.defaultClass, this.hover && this.hoverClass),
|
|
1603
|
+
wrapper: H(Jt(V({}, this.position, !0)), this.wrapperClass)
|
|
1604
1604
|
};
|
|
1605
1605
|
} },
|
|
1606
1606
|
methods: {
|
|
@@ -1644,7 +1644,7 @@ Yt.render = function(e, t, n, r, a, o) {
|
|
|
1644
1644
|
"onLeave"
|
|
1645
1645
|
]);
|
|
1646
1646
|
};
|
|
1647
|
-
var Xt =
|
|
1647
|
+
var Xt = U("vue-bounding-box"), Zt = [
|
|
1648
1648
|
"east",
|
|
1649
1649
|
"west",
|
|
1650
1650
|
null
|
|
@@ -1730,7 +1730,7 @@ var Xt = W("vue-bounding-box"), Zt = [
|
|
|
1730
1730
|
return Zt.forEach((function(t) {
|
|
1731
1731
|
Qt.forEach((function(n) {
|
|
1732
1732
|
if (t !== n) {
|
|
1733
|
-
var r =
|
|
1733
|
+
var r = Ve(t, n);
|
|
1734
1734
|
e.push({
|
|
1735
1735
|
name: r.name,
|
|
1736
1736
|
classname: r.classname,
|
|
@@ -1762,8 +1762,8 @@ var Xt = W("vue-bounding-box"), Zt = [
|
|
|
1762
1762
|
n.horizontalDirection && n.verticalDirection || !e.lines[n.name] || t.push({
|
|
1763
1763
|
name: n.name,
|
|
1764
1764
|
component: e.linesComponent,
|
|
1765
|
-
class:
|
|
1766
|
-
wrapperClass:
|
|
1765
|
+
class: H(e.classes.lines.default, e.classes.lines[n.name], !e.resizable && e.classes.lines.disabled),
|
|
1766
|
+
wrapperClass: H(e.classes.linesWrappers.default, e.classes.linesWrappers[n.name], !e.resizable && e.classes.linesWrappers.disabled),
|
|
1767
1767
|
hoverClass: e.classes.lines.hover,
|
|
1768
1768
|
verticalDirection: n.verticalDirection,
|
|
1769
1769
|
horizontalDirection: n.horizontalDirection,
|
|
@@ -1778,8 +1778,8 @@ var Xt = W("vue-bounding-box"), Zt = [
|
|
|
1778
1778
|
var a = {
|
|
1779
1779
|
name: i.name,
|
|
1780
1780
|
component: e.handlersComponent,
|
|
1781
|
-
class:
|
|
1782
|
-
wrapperClass:
|
|
1781
|
+
class: H(e.classes.handlers.default, e.classes.handlers[i.name]),
|
|
1782
|
+
wrapperClass: H(e.classes.handlersWrappers.default, e.classes.handlersWrappers[i.name]),
|
|
1783
1783
|
hoverClass: e.classes.handlers.hover,
|
|
1784
1784
|
verticalDirection: i.verticalDirection,
|
|
1785
1785
|
horizontalDirection: i.horizontalDirection,
|
|
@@ -1788,7 +1788,7 @@ var Xt = W("vue-bounding-box"), Zt = [
|
|
|
1788
1788
|
if (n && r) {
|
|
1789
1789
|
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;
|
|
1790
1790
|
a.wrapperClass = Xt("handler"), a.wrapperStyle = { transform: `translate(${c}px, ${l}px)` }, e.transitions && e.transitions.enabled && (a.wrapperStyle.transition = `${e.transitions.time}ms ${e.transitions.timingFunction}`);
|
|
1791
|
-
} else a.wrapperClass = Xt("handler",
|
|
1791
|
+
} else a.wrapperClass = Xt("handler", V({}, i.classname, !0));
|
|
1792
1792
|
t.push(a);
|
|
1793
1793
|
}
|
|
1794
1794
|
})), t;
|
|
@@ -1814,7 +1814,7 @@ var Xt = W("vue-bounding-box"), Zt = [
|
|
|
1814
1814
|
top: 0,
|
|
1815
1815
|
bottom: 0
|
|
1816
1816
|
};
|
|
1817
|
-
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
|
|
1817
|
+
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 Qe(s, {
|
|
1818
1818
|
allowedDirections: {
|
|
1819
1819
|
left: t === "west" || !t,
|
|
1820
1820
|
right: t === "east" || !t,
|
|
@@ -1888,7 +1888,7 @@ $t.render = function(e, t, n, i, o, s) {
|
|
|
1888
1888
|
})), 128))
|
|
1889
1889
|
], 6);
|
|
1890
1890
|
};
|
|
1891
|
-
var en =
|
|
1891
|
+
var en = U("vue-draggable-area"), tn = {
|
|
1892
1892
|
name: "DraggableArea",
|
|
1893
1893
|
props: {
|
|
1894
1894
|
movable: {
|
|
@@ -1916,14 +1916,14 @@ var en = W("vue-draggable-area"), tn = {
|
|
|
1916
1916
|
onTouchStart: function(e) {
|
|
1917
1917
|
if (e.cancelable) {
|
|
1918
1918
|
var t = this.movable && e.touches.length === 1;
|
|
1919
|
-
t && (this.touches =
|
|
1919
|
+
t && (this.touches = Pe(e.touches)), (this.touchStarted || t) && (e.preventDefault(), e.stopPropagation());
|
|
1920
1920
|
}
|
|
1921
1921
|
},
|
|
1922
1922
|
onTouchEnd: function() {
|
|
1923
1923
|
this.touchStarted = !1, this.processEnd();
|
|
1924
1924
|
},
|
|
1925
1925
|
onTouchMove: function(e) {
|
|
1926
|
-
this.touches.length >= 1 && (this.touchStarted ? (this.processMove(e, e.touches), e.preventDefault(), e.stopPropagation()) :
|
|
1926
|
+
this.touches.length >= 1 && (this.touchStarted ? (this.processMove(e, e.touches), e.preventDefault(), e.stopPropagation()) : Xe({
|
|
1927
1927
|
x: this.touches[0].clientX,
|
|
1928
1928
|
y: this.touches[0].clientY
|
|
1929
1929
|
}, {
|
|
@@ -1962,10 +1962,10 @@ var en = W("vue-draggable-area"), tn = {
|
|
|
1962
1962
|
};
|
|
1963
1963
|
},
|
|
1964
1964
|
processMove: function(e, t) {
|
|
1965
|
-
var n =
|
|
1965
|
+
var n = Pe(t);
|
|
1966
1966
|
if (this.touches.length) {
|
|
1967
1967
|
var r = this.$refs.container.getBoundingClientRect(), i = r.left, a = r.top;
|
|
1968
|
-
this.touches.length === 1 && n.length === 1 && this.$emit("move", new
|
|
1968
|
+
this.touches.length === 1 && n.length === 1 && this.$emit("move", new $e({
|
|
1969
1969
|
left: n[0].clientX - (i + this.anchor.x),
|
|
1970
1970
|
top: n[0].clientY - (a + this.anchor.y)
|
|
1971
1971
|
}));
|
|
@@ -2065,7 +2065,7 @@ function on(e) {
|
|
|
2065
2065
|
return null;
|
|
2066
2066
|
}
|
|
2067
2067
|
}
|
|
2068
|
-
var sn =
|
|
2068
|
+
var sn = U("vue-preview-result"), cn = {
|
|
2069
2069
|
name: "PreviewResult",
|
|
2070
2070
|
props: {
|
|
2071
2071
|
image: { type: Object },
|
|
@@ -2089,7 +2089,7 @@ var sn = W("vue-preview-result"), cn = {
|
|
|
2089
2089
|
root: sn(),
|
|
2090
2090
|
wrapper: sn("wrapper"),
|
|
2091
2091
|
imageWrapper: sn("image-wrapper"),
|
|
2092
|
-
image:
|
|
2092
|
+
image: H(sn("image"), this.imageClass)
|
|
2093
2093
|
};
|
|
2094
2094
|
},
|
|
2095
2095
|
wrapperStyle: function() {
|
|
@@ -2130,7 +2130,7 @@ function ln(e, t) {
|
|
|
2130
2130
|
return e.forEach((function(t) {
|
|
2131
2131
|
a.left += (t.clientX - r) / e.length, a.top += (t.clientY - i) / e.length;
|
|
2132
2132
|
})), e.forEach((function(e) {
|
|
2133
|
-
o +=
|
|
2133
|
+
o += Xe({
|
|
2134
2134
|
x: a.left,
|
|
2135
2135
|
y: a.top
|
|
2136
2136
|
}, {
|
|
@@ -2185,18 +2185,18 @@ var un = {
|
|
|
2185
2185
|
window.removeEventListener("mouseup", this.onMouseUp), window.removeEventListener("mousemove", this.onMouseMove), window.removeEventListener("touchmove", this.onTouchMove), window.removeEventListener("touchend", this.onTouchEnd);
|
|
2186
2186
|
},
|
|
2187
2187
|
created: function() {
|
|
2188
|
-
this.transforming = !1, this.debouncedProcessEnd =
|
|
2188
|
+
this.transforming = !1, this.debouncedProcessEnd = Be(this.processEnd), this.touches = [];
|
|
2189
2189
|
},
|
|
2190
2190
|
methods: {
|
|
2191
2191
|
processMove: function(e, t) {
|
|
2192
2192
|
if (this.touches.length) {
|
|
2193
|
-
if (this.touches.length === 1 && t.length === 1) this.$emit("move", new
|
|
2193
|
+
if (this.touches.length === 1 && t.length === 1) this.$emit("move", new Ze({
|
|
2194
2194
|
left: this.touches[0].clientX - t[0].clientX,
|
|
2195
2195
|
top: this.touches[0].clientY - t[0].clientY
|
|
2196
2196
|
}));
|
|
2197
2197
|
else if (this.touches.length > 1 && this.touchResize) {
|
|
2198
2198
|
var n = ln(t, this.$refs.container), r = this.oldGeometricProperties;
|
|
2199
|
-
r.count === n.count && r.count > 1 && this.$emit("resize", new
|
|
2199
|
+
r.count === n.count && r.count > 1 && this.$emit("resize", new Ze({
|
|
2200
2200
|
left: r.centerMass.left - n.centerMass.left,
|
|
2201
2201
|
top: r.centerMass.top - n.centerMass.top
|
|
2202
2202
|
}, {
|
|
@@ -2219,7 +2219,7 @@ var un = {
|
|
|
2219
2219
|
onTouchStart: function(e) {
|
|
2220
2220
|
if (e.cancelable && (this.touchMove || this.touchResize && e.touches.length > 1) && this.processEvent(e)) {
|
|
2221
2221
|
var t = this.$refs.container, n = t.getBoundingClientRect(), r = n.left, i = n.top, a = n.bottom, o = n.right;
|
|
2222
|
-
this.touches =
|
|
2222
|
+
this.touches = Pe(e.touches).filter((function(e) {
|
|
2223
2223
|
return e.clientX > r && e.clientX < o && e.clientY > i && e.clientY < a;
|
|
2224
2224
|
})), this.oldGeometricProperties = ln(this.touches, t);
|
|
2225
2225
|
}
|
|
@@ -2230,7 +2230,7 @@ var un = {
|
|
|
2230
2230
|
onTouchMove: function(e) {
|
|
2231
2231
|
var t = this;
|
|
2232
2232
|
if (this.touches.length) {
|
|
2233
|
-
var n =
|
|
2233
|
+
var n = Pe(e.touches).filter((function(e) {
|
|
2234
2234
|
return !e.identifier || t.touches.find((function(t) {
|
|
2235
2235
|
return t.identifier === e.identifier;
|
|
2236
2236
|
}));
|
|
@@ -2239,11 +2239,14 @@ var un = {
|
|
|
2239
2239
|
}
|
|
2240
2240
|
},
|
|
2241
2241
|
onMouseDown: function(e) {
|
|
2242
|
-
this.mouseMove && "buttons" in e && e.buttons === 1 && this.processEvent(e)
|
|
2243
|
-
|
|
2244
|
-
|
|
2245
|
-
|
|
2246
|
-
|
|
2242
|
+
if (this.mouseMove && "buttons" in e && e.buttons === 1 && this.processEvent(e)) {
|
|
2243
|
+
var t = {
|
|
2244
|
+
fake: !0,
|
|
2245
|
+
clientX: e.clientX,
|
|
2246
|
+
clientY: e.clientY
|
|
2247
|
+
};
|
|
2248
|
+
this.touches = [t], this.processStart();
|
|
2249
|
+
}
|
|
2247
2250
|
},
|
|
2248
2251
|
onMouseMove: function(e) {
|
|
2249
2252
|
this.touches.length && this.processEvent(e) && this.processMove(e, [{
|
|
@@ -2256,11 +2259,11 @@ var un = {
|
|
|
2256
2259
|
},
|
|
2257
2260
|
onWheel: function(e) {
|
|
2258
2261
|
if (this.wheelResize && this.processEvent(e)) {
|
|
2259
|
-
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 ||
|
|
2262
|
+
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 || Ye(s) ? s : s > 0 ? 1 : -1), a = {
|
|
2260
2263
|
left: e.clientX - n,
|
|
2261
2264
|
top: e.clientY - r
|
|
2262
2265
|
};
|
|
2263
|
-
this.$emit("resize", new
|
|
2266
|
+
this.$emit("resize", new Ze({}, {
|
|
2264
2267
|
factor: i,
|
|
2265
2268
|
center: a
|
|
2266
2269
|
})), this.touches.length || this.debouncedProcessEnd();
|
|
@@ -2335,7 +2338,7 @@ dn.render = function(e, t, n, r, o, l) {
|
|
|
2335
2338
|
"wheel-resize"
|
|
2336
2339
|
]);
|
|
2337
2340
|
};
|
|
2338
|
-
var fn =
|
|
2341
|
+
var fn = U("vue-preview"), pn = {
|
|
2339
2342
|
props: {
|
|
2340
2343
|
coordinates: { type: Object },
|
|
2341
2344
|
transitions: { type: Object },
|
|
@@ -2368,7 +2371,7 @@ var fn = W("vue-preview"), pn = {
|
|
|
2368
2371
|
root: fn({ fill: this.fill }),
|
|
2369
2372
|
wrapper: fn("wrapper"),
|
|
2370
2373
|
imageWrapper: fn("image-wrapper"),
|
|
2371
|
-
image:
|
|
2374
|
+
image: H(fn("image"), this.imageClass)
|
|
2372
2375
|
};
|
|
2373
2376
|
},
|
|
2374
2377
|
style: function() {
|
|
@@ -2387,7 +2390,7 @@ var fn = W("vue-preview"), pn = {
|
|
|
2387
2390
|
},
|
|
2388
2391
|
imageStyle: function() {
|
|
2389
2392
|
if (this.coordinates && this.image) {
|
|
2390
|
-
var e = this.coordinates.width / this.size.width, t =
|
|
2393
|
+
var e = this.coordinates.width / this.size.width, t = B(B({
|
|
2391
2394
|
rotate: 0,
|
|
2392
2395
|
flip: {
|
|
2393
2396
|
horizontal: !1,
|
|
@@ -2483,7 +2486,7 @@ mn.render = function(e, t, n, r, i, a) {
|
|
|
2483
2486
|
var o = s("preview");
|
|
2484
2487
|
return c(), x(o, l(e.$attrs, { fill: !0 }), null, 16);
|
|
2485
2488
|
};
|
|
2486
|
-
var hn =
|
|
2489
|
+
var hn = U("vue-rectangle-stencil"), gn = {
|
|
2487
2490
|
name: "RectangleStencil",
|
|
2488
2491
|
components: {
|
|
2489
2492
|
StencilPreview: mn,
|
|
@@ -2558,13 +2561,13 @@ var hn = W("vue-rectangle-stencil"), gn = {
|
|
|
2558
2561
|
computed: {
|
|
2559
2562
|
classes: function() {
|
|
2560
2563
|
return {
|
|
2561
|
-
stencil:
|
|
2564
|
+
stencil: H(hn({
|
|
2562
2565
|
movable: this.movable,
|
|
2563
2566
|
moving: this.moving,
|
|
2564
2567
|
resizing: this.resizing
|
|
2565
2568
|
}), this.moving && this.movingClass, this.resizing && this.resizingClass),
|
|
2566
|
-
preview:
|
|
2567
|
-
boundingBox:
|
|
2569
|
+
preview: H(hn("preview"), this.previewClass),
|
|
2570
|
+
boundingBox: H(hn("bounding-box"), this.boundingBoxClass)
|
|
2568
2571
|
};
|
|
2569
2572
|
},
|
|
2570
2573
|
style: function() {
|
|
@@ -2674,7 +2677,7 @@ gn.render = function(e, t, n, r, a, o) {
|
|
|
2674
2677
|
"onResizeEnd"
|
|
2675
2678
|
])], 6);
|
|
2676
2679
|
};
|
|
2677
|
-
var _n =
|
|
2680
|
+
var _n = U("vue-circle-stencil"), vn = {
|
|
2678
2681
|
components: {
|
|
2679
2682
|
StencilPreview: mn,
|
|
2680
2683
|
BoundingBox: $t,
|
|
@@ -2755,13 +2758,13 @@ var _n = W("vue-circle-stencil"), vn = {
|
|
|
2755
2758
|
computed: {
|
|
2756
2759
|
classes: function() {
|
|
2757
2760
|
return {
|
|
2758
|
-
stencil:
|
|
2761
|
+
stencil: H(_n({
|
|
2759
2762
|
movable: this.movable,
|
|
2760
2763
|
moving: this.moving,
|
|
2761
2764
|
resizing: this.resizing
|
|
2762
2765
|
}), this.moving && this.movingClass, this.resizing && this.resizingClass),
|
|
2763
|
-
preview:
|
|
2764
|
-
boundingBox:
|
|
2766
|
+
preview: H(_n("preview"), this.previewClass),
|
|
2767
|
+
boundingBox: H(_n("bounding-box"), this.boundingBoxClass)
|
|
2765
2768
|
};
|
|
2766
2769
|
},
|
|
2767
2770
|
style: function() {
|
|
@@ -2871,7 +2874,7 @@ vn.render = function(e, t, n, r, a, o) {
|
|
|
2871
2874
|
"onResizeEnd"
|
|
2872
2875
|
])], 6);
|
|
2873
2876
|
};
|
|
2874
|
-
var yn = ["transitions"], bn =
|
|
2877
|
+
var yn = ["transitions"], bn = U("vue-advanced-cropper"), xn = {
|
|
2875
2878
|
name: "Cropper",
|
|
2876
2879
|
components: { BackgroundWrapper: dn },
|
|
2877
2880
|
props: {
|
|
@@ -2937,7 +2940,7 @@ var yn = ["transitions"], bn = W("vue-advanced-cropper"), xn = {
|
|
|
2937
2940
|
type: String,
|
|
2938
2941
|
default: "fit-area",
|
|
2939
2942
|
validator: function(e) {
|
|
2940
|
-
return
|
|
2943
|
+
return lt.indexOf(e) !== -1;
|
|
2941
2944
|
}
|
|
2942
2945
|
},
|
|
2943
2946
|
roundResult: {
|
|
@@ -2971,24 +2974,24 @@ var yn = ["transitions"], bn = W("vue-advanced-cropper"), xn = {
|
|
|
2971
2974
|
resizeAlgorithm: {
|
|
2972
2975
|
type: Function,
|
|
2973
2976
|
default: function(e) {
|
|
2974
|
-
var t = e.event, n = e.coordinates, r = e.aspectRatio, i = e.positionRestrictions, a = e.sizeRestrictions, o =
|
|
2977
|
+
var t = e.event, n = e.coordinates, r = e.aspectRatio, i = e.positionRestrictions, a = e.sizeRestrictions, o = W(W({}, n), {
|
|
2975
2978
|
right: n.left + n.width,
|
|
2976
2979
|
bottom: n.top + n.height
|
|
2977
|
-
}), s = t.params || {}, c =
|
|
2980
|
+
}), s = t.params || {}, c = W({}, t.directions), l = s.allowedDirections || {
|
|
2978
2981
|
left: !0,
|
|
2979
2982
|
right: !0,
|
|
2980
2983
|
bottom: !0,
|
|
2981
2984
|
top: !0
|
|
2982
2985
|
};
|
|
2983
|
-
a.widthFrozen && (c.left = 0, c.right = 0), a.heightFrozen && (c.top = 0, c.bottom = 0),
|
|
2986
|
+
a.widthFrozen && (c.left = 0, c.right = 0), a.heightFrozen && (c.top = 0, c.bottom = 0), K.forEach((function(e) {
|
|
2984
2987
|
l[e] || (c[e] = 0);
|
|
2985
2988
|
}));
|
|
2986
|
-
var u =
|
|
2989
|
+
var u = Y(o, c = Ht({
|
|
2987
2990
|
coordinates: o,
|
|
2988
2991
|
directions: c,
|
|
2989
2992
|
sizeRestrictions: a,
|
|
2990
2993
|
positionRestrictions: i
|
|
2991
|
-
})).width, d =
|
|
2994
|
+
})).width, d = Y(o, c).height, f = s.preserveRatio ? Q(o) : _t(u / d, r);
|
|
2992
2995
|
if (f) {
|
|
2993
2996
|
var p = s.respectDirection;
|
|
2994
2997
|
if (p ||= o.width >= o.height || f === 1 ? "width" : "height", p === "width") {
|
|
@@ -3013,10 +3016,10 @@ var yn = ["transitions"], bn = W("vue-advanced-cropper"), xn = {
|
|
|
3013
3016
|
compensate: s.compensate
|
|
3014
3017
|
});
|
|
3015
3018
|
}
|
|
3016
|
-
return u =
|
|
3019
|
+
return u = Y(o, c).width, d = Y(o, c).height, (f = s.preserveRatio ? Q(o) : _t(u / d, r)) && Math.abs(f - u / d) > .001 && K.forEach((function(e) {
|
|
3017
3020
|
l[e] || (c[e] = 0);
|
|
3018
3021
|
})), kt({
|
|
3019
|
-
event: new
|
|
3022
|
+
event: new $e({
|
|
3020
3023
|
left: -c.left,
|
|
3021
3024
|
top: -c.top
|
|
3022
3025
|
}),
|
|
@@ -3044,7 +3047,7 @@ var yn = ["transitions"], bn = W("vue-advanced-cropper"), xn = {
|
|
|
3044
3047
|
fitCoordinates: {
|
|
3045
3048
|
type: Function,
|
|
3046
3049
|
default: function(e) {
|
|
3047
|
-
var t = e.visibleArea, n = e.coordinates, r = e.aspectRatio, i = e.sizeRestrictions, a = e.positionRestrictions, o =
|
|
3050
|
+
var t = e.visibleArea, n = e.coordinates, r = e.aspectRatio, i = e.sizeRestrictions, a = e.positionRestrictions, o = W(W({}, n), Ot({
|
|
3048
3051
|
width: n.width,
|
|
3049
3052
|
height: n.height,
|
|
3050
3053
|
aspectRatio: r,
|
|
@@ -3055,15 +3058,15 @@ var yn = ["transitions"], bn = W("vue-advanced-cropper"), xn = {
|
|
|
3055
3058
|
minWidth: Math.min(t.width, i.minWidth)
|
|
3056
3059
|
}
|
|
3057
3060
|
}));
|
|
3058
|
-
return o = $(o = X(o,
|
|
3061
|
+
return o = $(o = X(o, ft(J(n), J(o))), Tt(q(t), a));
|
|
3059
3062
|
}
|
|
3060
3063
|
},
|
|
3061
3064
|
fitVisibleArea: {
|
|
3062
3065
|
type: Function,
|
|
3063
3066
|
default: function(e) {
|
|
3064
|
-
var t = e.visibleArea, n = e.boundaries, r = e.getAreaRestrictions, i = e.coordinates, a =
|
|
3067
|
+
var t = e.visibleArea, n = e.boundaries, r = e.getAreaRestrictions, i = e.coordinates, a = W({}, t);
|
|
3065
3068
|
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)));
|
|
3066
|
-
var o = mt(gt(i,
|
|
3069
|
+
var o = mt(gt(i, q(a = Z(a, xt(a, r({
|
|
3067
3070
|
visibleArea: a,
|
|
3068
3071
|
type: "resize"
|
|
3069
3072
|
}))))));
|
|
@@ -3144,7 +3147,7 @@ var yn = ["transitions"], bn = W("vue-advanced-cropper"), xn = {
|
|
|
3144
3147
|
height: 0
|
|
3145
3148
|
},
|
|
3146
3149
|
visibleArea: null,
|
|
3147
|
-
coordinates:
|
|
3150
|
+
coordinates: B({}, ut)
|
|
3148
3151
|
};
|
|
3149
3152
|
},
|
|
3150
3153
|
computed: {
|
|
@@ -3182,7 +3185,7 @@ var yn = ["transitions"], bn = W("vue-advanced-cropper"), xn = {
|
|
|
3182
3185
|
return !!(this.visibleArea && this.imageLoaded);
|
|
3183
3186
|
},
|
|
3184
3187
|
settings: function() {
|
|
3185
|
-
var e =
|
|
3188
|
+
var e = Ke(this.resizeImage, {
|
|
3186
3189
|
touch: !0,
|
|
3187
3190
|
wheel: { ratio: .1 },
|
|
3188
3191
|
adjustStencil: !0
|
|
@@ -3192,7 +3195,7 @@ var yn = ["transitions"], bn = W("vue-advanced-cropper"), xn = {
|
|
|
3192
3195
|
adjustStencil: !1
|
|
3193
3196
|
});
|
|
3194
3197
|
return {
|
|
3195
|
-
moveImage:
|
|
3198
|
+
moveImage: Ke(this.moveImage, {
|
|
3196
3199
|
touch: !0,
|
|
3197
3200
|
mouse: !0
|
|
3198
3201
|
}, {
|
|
@@ -3223,13 +3226,13 @@ var yn = ["transitions"], bn = W("vue-advanced-cropper"), xn = {
|
|
|
3223
3226
|
if (this.boundaries.width && this.boundaries.height && this.imageSize.width && this.imageSize.height) {
|
|
3224
3227
|
var e = this.sizeRestrictionsAlgorithm({
|
|
3225
3228
|
imageSize: this.imageSize,
|
|
3226
|
-
minWidth:
|
|
3227
|
-
minHeight:
|
|
3228
|
-
maxWidth:
|
|
3229
|
-
maxHeight:
|
|
3229
|
+
minWidth: G(this.minWidth) ? 0 : qe(this.minWidth),
|
|
3230
|
+
minHeight: G(this.minHeight) ? 0 : qe(this.minHeight),
|
|
3231
|
+
maxWidth: G(this.maxWidth) ? Infinity : qe(this.maxWidth),
|
|
3232
|
+
maxHeight: G(this.maxHeight) ? Infinity : qe(this.maxHeight)
|
|
3230
3233
|
});
|
|
3231
3234
|
if (e = function(e) {
|
|
3232
|
-
var t = e.areaRestrictions, n = e.sizeRestrictions, r = e.boundaries, i = e.positionRestrictions, a =
|
|
3235
|
+
var t = e.areaRestrictions, n = e.sizeRestrictions, r = e.boundaries, i = e.positionRestrictions, a = W(W({}, n), {
|
|
3233
3236
|
minWidth: n.minWidth === void 0 ? 0 : n.minWidth,
|
|
3234
3237
|
minHeight: n.minHeight === void 0 ? 0 : n.minHeight,
|
|
3235
3238
|
maxWidth: n.maxWidth === void 0 ? Infinity : n.maxWidth,
|
|
@@ -3275,14 +3278,14 @@ var yn = ["transitions"], bn = W("vue-advanced-cropper"), xn = {
|
|
|
3275
3278
|
classes: function() {
|
|
3276
3279
|
return {
|
|
3277
3280
|
cropper: bn(),
|
|
3278
|
-
image:
|
|
3281
|
+
image: H(bn("image"), this.imageClass),
|
|
3279
3282
|
stencil: bn("stencil"),
|
|
3280
|
-
boundaries:
|
|
3281
|
-
stretcher:
|
|
3282
|
-
background:
|
|
3283
|
-
foreground:
|
|
3284
|
-
imageWrapper:
|
|
3285
|
-
cropperWrapper:
|
|
3283
|
+
boundaries: H(bn("boundaries"), this.boundariesClass),
|
|
3284
|
+
stretcher: H(bn("stretcher")),
|
|
3285
|
+
background: H(bn("background"), this.backgroundClass),
|
|
3286
|
+
foreground: H(bn("foreground"), this.foregroundClass),
|
|
3287
|
+
imageWrapper: H(bn("image-wrapper")),
|
|
3288
|
+
cropperWrapper: H(bn("cropper-wrapper"))
|
|
3286
3289
|
};
|
|
3287
3290
|
},
|
|
3288
3291
|
stencilCoordinates: function() {
|
|
@@ -3312,16 +3315,16 @@ var yn = ["transitions"], bn = W("vue-advanced-cropper"), xn = {
|
|
|
3312
3315
|
height: Math.min(1024, this.imageAttributes.width) / (this.imageAttributes.width / this.imageAttributes.height)
|
|
3313
3316
|
} : {
|
|
3314
3317
|
height: Math.min(1024, this.imageAttributes.height),
|
|
3315
|
-
width: this.imageAttributes.
|
|
3318
|
+
width: Math.min(1024, this.imageAttributes.height) * (this.imageAttributes.width / this.imageAttributes.height)
|
|
3316
3319
|
}, t = {
|
|
3317
3320
|
left: (e.width - this.imageSize.width) / (2 * this.coefficient),
|
|
3318
3321
|
top: (e.height - this.imageSize.height) / (2 * this.coefficient)
|
|
3319
3322
|
}, n = {
|
|
3320
3323
|
left: (1 - 1 / this.coefficient) * e.width / 2,
|
|
3321
3324
|
top: (1 - 1 / this.coefficient) * e.height / 2
|
|
3322
|
-
}, r =
|
|
3323
|
-
scaleX: this.imageAttributes.width / e.width
|
|
3324
|
-
scaleY: this.imageAttributes.height / e.height
|
|
3325
|
+
}, r = B(B({}, this.imageTransforms), {}, {
|
|
3326
|
+
scaleX: this.imageTransforms.scaleX * (this.imageAttributes.width / e.width),
|
|
3327
|
+
scaleY: this.imageTransforms.scaleY * (this.imageAttributes.height / e.height)
|
|
3325
3328
|
}), i = {
|
|
3326
3329
|
width: `${e.width}px`,
|
|
3327
3330
|
height: `${e.height}px`,
|
|
@@ -3368,7 +3371,7 @@ var yn = ["transitions"], bn = W("vue-advanced-cropper"), xn = {
|
|
|
3368
3371
|
}
|
|
3369
3372
|
},
|
|
3370
3373
|
created: function() {
|
|
3371
|
-
this.debouncedUpdate =
|
|
3374
|
+
this.debouncedUpdate = Be(this.update, this.debounce), this.debouncedDisableTransitions = Be(this.disableTransitions, this.transitionsOptions.time), this.awaiting = !1;
|
|
3372
3375
|
},
|
|
3373
3376
|
mounted: function() {
|
|
3374
3377
|
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);
|
|
@@ -3378,16 +3381,16 @@ var yn = ["transitions"], bn = W("vue-advanced-cropper"), xn = {
|
|
|
3378
3381
|
},
|
|
3379
3382
|
methods: {
|
|
3380
3383
|
getResult: function() {
|
|
3381
|
-
var e = this.initialized ? this.prepareResult(
|
|
3384
|
+
var e = this.initialized ? this.prepareResult(B({}, this.coordinates)) : this.defaultCoordinates(), t = {
|
|
3382
3385
|
rotate: this.imageTransforms.rotate % 360,
|
|
3383
|
-
flip:
|
|
3386
|
+
flip: B({}, this.imageTransforms.flip)
|
|
3384
3387
|
};
|
|
3385
3388
|
if (this.src && this.imageLoaded) {
|
|
3386
3389
|
var n = this;
|
|
3387
3390
|
return {
|
|
3388
3391
|
image: this.image,
|
|
3389
3392
|
coordinates: e,
|
|
3390
|
-
visibleArea: this.visibleArea ?
|
|
3393
|
+
visibleArea: this.visibleArea ? B({}, this.visibleArea) : null,
|
|
3391
3394
|
imageTransforms: t,
|
|
3392
3395
|
get canvas() {
|
|
3393
3396
|
return n.canvas ? n.getCanvas() : void 0;
|
|
@@ -3397,14 +3400,14 @@ var yn = ["transitions"], bn = W("vue-advanced-cropper"), xn = {
|
|
|
3397
3400
|
return {
|
|
3398
3401
|
image: this.image,
|
|
3399
3402
|
coordinates: e,
|
|
3400
|
-
visibleArea: this.visibleArea ?
|
|
3403
|
+
visibleArea: this.visibleArea ? B({}, this.visibleArea) : null,
|
|
3401
3404
|
canvas: void 0,
|
|
3402
3405
|
imageTransforms: t
|
|
3403
3406
|
};
|
|
3404
3407
|
},
|
|
3405
3408
|
zoom: function(e, t) {
|
|
3406
3409
|
var n = (arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}).transitions, r = n === void 0 || n;
|
|
3407
|
-
this.onManipulateImage(new
|
|
3410
|
+
this.onManipulateImage(new Ze({}, {
|
|
3408
3411
|
factor: 1 / e,
|
|
3409
3412
|
center: t
|
|
3410
3413
|
}), {
|
|
@@ -3414,7 +3417,7 @@ var yn = ["transitions"], bn = W("vue-advanced-cropper"), xn = {
|
|
|
3414
3417
|
},
|
|
3415
3418
|
move: function(e, t) {
|
|
3416
3419
|
var n = (arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}).transitions, r = n === void 0 || n;
|
|
3417
|
-
this.onManipulateImage(new
|
|
3420
|
+
this.onManipulateImage(new Ze({
|
|
3418
3421
|
left: e || 0,
|
|
3419
3422
|
top: t || 0
|
|
3420
3423
|
}), {
|
|
@@ -3429,8 +3432,8 @@ var yn = ["transitions"], bn = W("vue-advanced-cropper"), xn = {
|
|
|
3429
3432
|
}));
|
|
3430
3433
|
},
|
|
3431
3434
|
refresh: function() {
|
|
3432
|
-
var e = this;
|
|
3433
|
-
if (this.src &&
|
|
3435
|
+
var e = this, t = this.$refs.image;
|
|
3436
|
+
if (this.src && t) return this.initialized ? this.updateVisibleArea().then((function() {
|
|
3434
3437
|
e.onChange();
|
|
3435
3438
|
})) : this.resetVisibleArea().then((function() {
|
|
3436
3439
|
e.onChange();
|
|
@@ -3457,7 +3460,7 @@ var yn = ["transitions"], bn = W("vue-advanced-cropper"), xn = {
|
|
|
3457
3460
|
top: Math.round(t.top)
|
|
3458
3461
|
};
|
|
3459
3462
|
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);
|
|
3460
|
-
}(
|
|
3463
|
+
}(B(B({}, this.getPublicProperties()), {}, {
|
|
3461
3464
|
positionRestrictions: Rt(this.positionRestrictions, this.visibleArea),
|
|
3462
3465
|
coordinates: e
|
|
3463
3466
|
})) : e;
|
|
@@ -3479,16 +3482,16 @@ var yn = ["transitions"], bn = W("vue-advanced-cropper"), xn = {
|
|
|
3479
3482
|
sizeRestrictions: this.sizeRestrictions,
|
|
3480
3483
|
stencilSize: this.getStencilSize()
|
|
3481
3484
|
});
|
|
3482
|
-
return
|
|
3485
|
+
return B(B({}, a), {}, { changed: !dt(a.visibleArea, t) || !dt(a.coordinates, n) });
|
|
3483
3486
|
},
|
|
3484
3487
|
runAutoZoom: function(e) {
|
|
3485
|
-
var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, n = t.transitions, r = n !== void 0 && n, i =
|
|
3488
|
+
var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, n = t.transitions, r = n !== void 0 && n, i = Ne(t, yn), a = this.processAutoZoom(e, this.visibleArea, this.coordinates, i), o = a.visibleArea, s = a.coordinates, c = a.changed;
|
|
3486
3489
|
r && c && this.enableTransitions(), this.visibleArea = o, this.coordinates = s, r && c && this.debouncedDisableTransitions();
|
|
3487
3490
|
},
|
|
3488
3491
|
normalizeEvent: function(e) {
|
|
3489
3492
|
return function(e) {
|
|
3490
3493
|
var t = e.event, n = e.visibleArea, r = e.coefficient;
|
|
3491
|
-
if (t.type === "manipulateImage") return
|
|
3494
|
+
if (t.type === "manipulateImage") return W(W({}, t), {
|
|
3492
3495
|
move: {
|
|
3493
3496
|
left: t.move && t.move.left ? r * t.move.left : 0,
|
|
3494
3497
|
top: t.move && t.move.top ? r * t.move.top : 0
|
|
@@ -3502,19 +3505,19 @@ var yn = ["transitions"], bn = W("vue-advanced-cropper"), xn = {
|
|
|
3502
3505
|
}
|
|
3503
3506
|
});
|
|
3504
3507
|
if (t.type === "resize") {
|
|
3505
|
-
var i =
|
|
3506
|
-
return
|
|
3508
|
+
var i = W(W({}, t), { directions: W({}, t.directions) });
|
|
3509
|
+
return K.forEach((function(e) {
|
|
3507
3510
|
i.directions[e] *= r;
|
|
3508
3511
|
})), i;
|
|
3509
3512
|
}
|
|
3510
3513
|
if (t.type === "move") {
|
|
3511
|
-
var a =
|
|
3512
|
-
return
|
|
3514
|
+
var a = W(W({}, t), { directions: W({}, t.directions) });
|
|
3515
|
+
return ct.forEach((function(e) {
|
|
3513
3516
|
a.directions[e] *= r;
|
|
3514
3517
|
})), a;
|
|
3515
3518
|
}
|
|
3516
3519
|
return t;
|
|
3517
|
-
}(
|
|
3520
|
+
}(B(B({}, this.getPublicProperties()), {}, { event: e }));
|
|
3518
3521
|
},
|
|
3519
3522
|
getCanvas: function() {
|
|
3520
3523
|
if (this.$refs.canvas) {
|
|
@@ -3524,12 +3527,12 @@ var yn = ["transitions"], bn = W("vue-advanced-cropper"), xn = {
|
|
|
3524
3527
|
height: t.naturalHeight
|
|
3525
3528
|
}, o = yt(a, r), s = e.getContext("2d");
|
|
3526
3529
|
e.height = o.height, e.width = o.width, s.save();
|
|
3527
|
-
var c = bt(
|
|
3530
|
+
var c = bt(J(W({
|
|
3528
3531
|
left: 0,
|
|
3529
3532
|
top: 0
|
|
3530
3533
|
}, a)), r);
|
|
3531
3534
|
return s.translate(-(c.left - o.width / 2), -(c.top - o.height / 2)), s.rotate(r * Math.PI / 180), s.translate(i.horizontal ? a.width : 0, i.vertical ? a.height : 0), s.scale(i.horizontal ? -1 : 1, i.vertical ? -1 : 1), s.drawImage(t, 0, 0, a.width, a.height), s.restore(), e;
|
|
3532
|
-
}(this.$refs.sourceCanvas, t, this.imageTransforms) : t, r =
|
|
3535
|
+
}(this.$refs.sourceCanvas, t, this.imageTransforms) : t, r = B({
|
|
3533
3536
|
minWidth: 0,
|
|
3534
3537
|
minHeight: 0,
|
|
3535
3538
|
maxWidth: Infinity,
|
|
@@ -3591,9 +3594,10 @@ var yn = ["transitions"], bn = W("vue-advanced-cropper"), xn = {
|
|
|
3591
3594
|
resetCoordinates: function() {
|
|
3592
3595
|
var e = this;
|
|
3593
3596
|
if (this.$refs.image) {
|
|
3597
|
+
this.$refs.cropper, this.$refs.image;
|
|
3594
3598
|
var t = this.defaultSize;
|
|
3595
|
-
t ||= this.stencilSize ? It : Ft;
|
|
3596
|
-
var n =
|
|
3599
|
+
t ||= this.stencilSize ? It : Ft, this.sizeRestrictions;
|
|
3600
|
+
var n = We(t) ? t({
|
|
3597
3601
|
boundaries: this.boundaries,
|
|
3598
3602
|
imageSize: this.imageSize,
|
|
3599
3603
|
aspectRatio: this.getAspectRatio(),
|
|
@@ -3602,13 +3606,13 @@ var yn = ["transitions"], bn = W("vue-advanced-cropper"), xn = {
|
|
|
3602
3606
|
visibleArea: this.visibleArea
|
|
3603
3607
|
}) : t, r = this.defaultPosition || Pt, i = [n, function(t) {
|
|
3604
3608
|
var n = t.coordinates;
|
|
3605
|
-
return
|
|
3609
|
+
return B({}, We(r) ? r({
|
|
3606
3610
|
coordinates: n,
|
|
3607
3611
|
imageSize: e.imageSize,
|
|
3608
3612
|
visibleArea: e.visibleArea
|
|
3609
3613
|
}) : e.defaultPosition);
|
|
3610
3614
|
}];
|
|
3611
|
-
this.delayedTransforms && i.push.apply(i,
|
|
3615
|
+
this.delayedTransforms && i.push.apply(i, Pe(Array.isArray(this.delayedTransforms) ? this.delayedTransforms : [this.delayedTransforms])), this.coordinates = this.applyTransform(i, !0), this.delayedTransforms = null;
|
|
3612
3616
|
}
|
|
3613
3617
|
},
|
|
3614
3618
|
clearImage: function() {
|
|
@@ -3638,7 +3642,7 @@ var yn = ["transitions"], bn = W("vue-advanced-cropper"), xn = {
|
|
|
3638
3642
|
cropper: n,
|
|
3639
3643
|
imageSize: e.imageSize
|
|
3640
3644
|
};
|
|
3641
|
-
if (
|
|
3645
|
+
if (We(e.defaultBoundaries) ? e.boundaries = e.defaultBoundaries(t) : e.defaultBoundaries === "fit" ? e.boundaries = function(e) {
|
|
3642
3646
|
var t = e.cropper, n = e.imageSize, r = t.clientHeight, i = t.clientWidth, a = r, o = n.width * r / n.height;
|
|
3643
3647
|
return o > i && (o = i, a = n.height * i / n.width), {
|
|
3644
3648
|
width: o,
|
|
@@ -3655,10 +3659,10 @@ var yn = ["transitions"], bn = W("vue-advanced-cropper"), xn = {
|
|
|
3655
3659
|
},
|
|
3656
3660
|
resetVisibleArea: function() {
|
|
3657
3661
|
var e = this;
|
|
3658
|
-
return this.appliedImageTransforms =
|
|
3662
|
+
return this.appliedImageTransforms = B(B({}, this.defaultImageTransforms), {}, { flip: B({}, this.defaultImageTransforms.flip) }), this.updateBoundaries().then((function() {
|
|
3659
3663
|
e.priority !== "visible-area" && (e.visibleArea = null, e.resetCoordinates());
|
|
3660
3664
|
var t, n, r, i, a, o, s = e.defaultVisibleArea || Lt;
|
|
3661
|
-
e.visibleArea =
|
|
3665
|
+
e.visibleArea = We(s) ? s({
|
|
3662
3666
|
imageSize: e.imageSize,
|
|
3663
3667
|
boundaries: e.boundaries,
|
|
3664
3668
|
coordinates: e.priority === "visible-area" ? null : e.coordinates,
|
|
@@ -3668,7 +3672,7 @@ var yn = ["transitions"], bn = W("vue-advanced-cropper"), xn = {
|
|
|
3668
3672
|
visibleArea: e.visibleArea,
|
|
3669
3673
|
boundaries: e.boundaries,
|
|
3670
3674
|
getAreaRestrictions: e.getAreaRestrictions
|
|
3671
|
-
}, n = t.visibleArea, r = t.boundaries, i = t.getAreaRestrictions, a =
|
|
3675
|
+
}, n = t.visibleArea, r = t.boundaries, i = t.getAreaRestrictions, a = W({}, n), o = Q(r), a.width / a.height !== o && (a.height = a.width / o), $(a, i({
|
|
3672
3676
|
visibleArea: a,
|
|
3673
3677
|
type: "move"
|
|
3674
3678
|
}))), e.priority === "visible-area" ? e.resetCoordinates() : e.coordinates = e.fitCoordinates({
|
|
@@ -3709,7 +3713,7 @@ var yn = ["transitions"], bn = W("vue-advanced-cropper"), xn = {
|
|
|
3709
3713
|
var e, t = this;
|
|
3710
3714
|
if (this.imageLoaded = !1, this.delayedTransforms = null, this.src) {
|
|
3711
3715
|
if (function(e) {
|
|
3712
|
-
if (
|
|
3716
|
+
if (Ue(e)) return !1;
|
|
3713
3717
|
var t = window.location, n = /(\w+:)?(?:\/\/)([\w.-]+)?(?::(\d+))?\/?/.exec(e) || [], r = {
|
|
3714
3718
|
protocol: n[1] || "",
|
|
3715
3719
|
host: n[2] || "",
|
|
@@ -3719,7 +3723,7 @@ var yn = ["transitions"], bn = W("vue-advanced-cropper"), xn = {
|
|
|
3719
3723
|
};
|
|
3720
3724
|
return !(!r.protocol && !r.host && !r.port || r.protocol && r.protocol == t.protocol && r.host && r.host == t.host && r.host && i(r) == i(t));
|
|
3721
3725
|
}(this.src)) {
|
|
3722
|
-
var n =
|
|
3726
|
+
var n = G(this.crossOrigin) ? this.canvas : this.crossOrigin;
|
|
3723
3727
|
!0 === n && (n = "anonymous"), this.imageAttributes.crossOrigin = n || null;
|
|
3724
3728
|
}
|
|
3725
3729
|
if (this.checkOrientation) {
|
|
@@ -3762,13 +3766,13 @@ var yn = ["transitions"], bn = W("vue-advanced-cropper"), xn = {
|
|
|
3762
3766
|
},
|
|
3763
3767
|
onParseImage: function(e) {
|
|
3764
3768
|
var t = this, n = e.source, r = e.arrayBuffer, i = e.orientation;
|
|
3765
|
-
this.imageAttributes.revoke && this.imageAttributes.src && URL.revokeObjectURL(this.imageAttributes.src), this.imageAttributes.revoke = !1, r && i && i > 1 ?
|
|
3769
|
+
this.imageAttributes.revoke && this.imageAttributes.src && URL.revokeObjectURL(this.imageAttributes.src), this.imageAttributes.revoke = !1, r && i && i > 1 ? He(n) || !Ue(n) ? (this.imageAttributes.src = URL.createObjectURL(new Blob([r])), this.imageAttributes.revoke = !0) : this.imageAttributes.src = function(e) {
|
|
3766
3770
|
for (var t = [], n = new Uint8Array(e); n.length > 0;) {
|
|
3767
3771
|
var r = n.subarray(0, 8192);
|
|
3768
3772
|
t.push(String.fromCharCode.apply(null, Array.from ? Array.from(r) : r.slice())), n = n.subarray(8192);
|
|
3769
3773
|
}
|
|
3770
3774
|
return "data:image/jpeg;base64," + btoa(t.join(""));
|
|
3771
|
-
}(r) : this.imageAttributes.src = n,
|
|
3775
|
+
}(r) : this.imageAttributes.src = n, We(this.defaultTransforms) ? this.appliedImageTransforms = nn(this.defaultTransforms()) : Ge(this.defaultTransforms) ? this.appliedImageTransforms = nn(this.defaultTransforms) : this.appliedImageTransforms = function(e) {
|
|
3772
3776
|
var t = nn({});
|
|
3773
3777
|
if (e) switch (e) {
|
|
3774
3778
|
case 2:
|
|
@@ -3792,7 +3796,7 @@ var yn = ["transitions"], bn = W("vue-advanced-cropper"), xn = {
|
|
|
3792
3796
|
case 8: t.rotate = -90;
|
|
3793
3797
|
}
|
|
3794
3798
|
return t;
|
|
3795
|
-
}(i), this.defaultImageTransforms =
|
|
3799
|
+
}(i), this.defaultImageTransforms = B(B({}, this.appliedImageTransforms), {}, { flip: B({}, this.appliedImageTransforms.flip) }), this.$nextTick((function() {
|
|
3796
3800
|
var e = t.$refs.image;
|
|
3797
3801
|
e && e.complete && (function(e) {
|
|
3798
3802
|
return !!e.naturalWidth;
|
|
@@ -3808,7 +3812,7 @@ var yn = ["transitions"], bn = W("vue-advanced-cropper"), xn = {
|
|
|
3808
3812
|
onMove: function(e) {
|
|
3809
3813
|
var t = this;
|
|
3810
3814
|
this.transitionsOptions.enabled || this.awaitRender((function() {
|
|
3811
|
-
t.coordinates = t.moveAlgorithm(
|
|
3815
|
+
t.coordinates = t.moveAlgorithm(B(B({}, t.getPublicProperties()), {}, {
|
|
3812
3816
|
positionRestrictions: Rt(t.positionRestrictions, t.visibleArea),
|
|
3813
3817
|
coordinates: t.coordinates,
|
|
3814
3818
|
event: t.normalizeEvent(e)
|
|
@@ -3819,7 +3823,7 @@ var yn = ["transitions"], bn = W("vue-advanced-cropper"), xn = {
|
|
|
3819
3823
|
var t = this;
|
|
3820
3824
|
this.transitionsOptions.enabled || this.stencilSize && !this.autoZoom || this.awaitRender((function() {
|
|
3821
3825
|
var n = t.sizeRestrictions, r = Math.min(t.coordinates.width, t.coordinates.height, 20 * t.coefficient);
|
|
3822
|
-
t.coordinates = t.resizeAlgorithm(
|
|
3826
|
+
t.coordinates = t.resizeAlgorithm(B(B({}, t.getPublicProperties()), {}, {
|
|
3823
3827
|
positionRestrictions: Rt(t.positionRestrictions, t.visibleArea),
|
|
3824
3828
|
sizeRestrictions: {
|
|
3825
3829
|
maxWidth: Math.min(n.maxWidth, t.visibleArea.width),
|
|
@@ -3836,7 +3840,7 @@ var yn = ["transitions"], bn = W("vue-advanced-cropper"), xn = {
|
|
|
3836
3840
|
if (!this.transitionsOptions.enabled) {
|
|
3837
3841
|
var n = t.transitions, r = n !== void 0 && n, i = t.normalize, a = i === void 0 || i;
|
|
3838
3842
|
r && this.enableTransitions();
|
|
3839
|
-
var o = zt(
|
|
3843
|
+
var o = zt(B(B({}, this.getPublicProperties()), {}, {
|
|
3840
3844
|
event: a ? this.normalizeEvent(e) : e,
|
|
3841
3845
|
getAreaRestrictions: this.getAreaRestrictions,
|
|
3842
3846
|
imageRestriction: this.imageRestriction,
|
|
@@ -3849,13 +3853,13 @@ var yn = ["transitions"], bn = W("vue-advanced-cropper"), xn = {
|
|
|
3849
3853
|
this.coordinates = this.applyTransform(this.coordinates, !0), this.onChange(!1);
|
|
3850
3854
|
},
|
|
3851
3855
|
getAreaRestrictions: function() {
|
|
3852
|
-
var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, t = e.visibleArea, n = e.type;
|
|
3856
|
+
var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, t = e.visibleArea, n = e.type, r = n === void 0 ? "move" : n;
|
|
3853
3857
|
return this.areaRestrictionsAlgorithm({
|
|
3854
3858
|
boundaries: this.boundaries,
|
|
3855
3859
|
imageSize: this.imageSize,
|
|
3856
3860
|
imageRestriction: this.imageRestriction,
|
|
3857
3861
|
visibleArea: t,
|
|
3858
|
-
type:
|
|
3862
|
+
type: r
|
|
3859
3863
|
});
|
|
3860
3864
|
},
|
|
3861
3865
|
getAspectRatio: function(e) {
|
|
@@ -3864,9 +3868,9 @@ var yn = ["transitions"], bn = W("vue-advanced-cropper"), xn = {
|
|
|
3864
3868
|
var s = this.$refs.stencil.aspectRatios();
|
|
3865
3869
|
t = s.minimum, n = s.maximum;
|
|
3866
3870
|
}
|
|
3867
|
-
if (
|
|
3871
|
+
if (G(t) && (t = G(i) ? a : i), G(n) && (n = G(i) ? o : i), !e && (G(t) || G(n))) {
|
|
3868
3872
|
var c = this.getStencilSize(), l = c ? Q(c) : null;
|
|
3869
|
-
|
|
3873
|
+
G(t) && (t = Je(l) ? l : void 0), G(n) && (n = Je(l) ? l : void 0);
|
|
3870
3874
|
}
|
|
3871
3875
|
return {
|
|
3872
3876
|
minimum: t,
|
|
@@ -3884,7 +3888,7 @@ var yn = ["transitions"], bn = W("vue-advanced-cropper"), xn = {
|
|
|
3884
3888
|
coefficient: this.coefficient,
|
|
3885
3889
|
coordinates: this.coordinates,
|
|
3886
3890
|
aspectRatio: this.getAspectRatio(!0)
|
|
3887
|
-
}, t = e.boundaries, n = e.stencilSize, r = e.aspectRatio, _t(Q(i =
|
|
3891
|
+
}, t = e.boundaries, n = e.stencilSize, r = e.aspectRatio, _t(Q(i = We(n) ? n({
|
|
3888
3892
|
boundaries: t,
|
|
3889
3893
|
aspectRatio: r
|
|
3890
3894
|
}) : n), r) && (i = Ot({
|
|
@@ -3929,13 +3933,13 @@ var yn = ["transitions"], bn = W("vue-advanced-cropper"), xn = {
|
|
|
3929
3933
|
};
|
|
3930
3934
|
},
|
|
3931
3935
|
defaultCoordinates: function() {
|
|
3932
|
-
return
|
|
3936
|
+
return B({}, ut);
|
|
3933
3937
|
},
|
|
3934
3938
|
flip: function(e, t) {
|
|
3935
3939
|
var n = (arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}).transitions, r = n === void 0 || n;
|
|
3936
3940
|
if (!this.transitionsActive) {
|
|
3937
3941
|
r && this.enableTransitions();
|
|
3938
|
-
var i =
|
|
3942
|
+
var i = B({}, this.imageTransforms.flip), a = Vt({
|
|
3939
3943
|
flip: {
|
|
3940
3944
|
horizontal: e ? !i.horizontal : i.horizontal,
|
|
3941
3945
|
vertical: t ? !i.vertical : i.vertical
|
|
@@ -3957,7 +3961,7 @@ var yn = ["transitions"], bn = W("vue-advanced-cropper"), xn = {
|
|
|
3957
3961
|
var t = (arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}).transitions, n = t === void 0 || t;
|
|
3958
3962
|
if (!this.transitionsActive) {
|
|
3959
3963
|
n && this.enableTransitions();
|
|
3960
|
-
var r =
|
|
3964
|
+
var r = B({}, this.imageSize);
|
|
3961
3965
|
this.appliedImageTransforms.rotate += e;
|
|
3962
3966
|
var i = Bt({
|
|
3963
3967
|
visibleArea: this.visibleArea,
|
|
@@ -4121,54 +4125,54 @@ var wn = ["data-tpl-theme"], Tn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, En
|
|
|
4121
4125
|
},
|
|
4122
4126
|
emits: ["save", "close"],
|
|
4123
4127
|
setup(a, { emit: o }) {
|
|
4124
|
-
let s = a, l = o, { t: u } =
|
|
4128
|
+
let s = a, l = o, { t: u } = z(), d = n("tplUiTheme"), g = u.mediaLibrary, { isImageMimeType: S } = Ee(), j = e(""), ee = e(""), te = e(null), M = e("free"), N = e(void 0), P = e(void 0), F = e(""), I = e(""), ne = e(void 0), L = e(null), re = e(!1), R = e(!1), ie = e(!1), ae = E(() => s.item ? [
|
|
4125
4129
|
"image/jpeg",
|
|
4126
4130
|
"image/png",
|
|
4127
4131
|
"image/webp",
|
|
4128
4132
|
"image/gif"
|
|
4129
|
-
].includes(s.item.mime_type) : !1),
|
|
4133
|
+
].includes(s.item.mime_type) : !1), oe = E(() => M.value === "original" ? ne.value : De[M.value]), se = E(() => L.value ? je(L.value.width, L.value.height, N.value, P.value) : null);
|
|
4130
4134
|
t(() => s.visible, (e) => {
|
|
4131
|
-
e && s.item && (j.value = s.item.filename, ee.value = s.item.alt_text || "",
|
|
4135
|
+
e && s.item && (j.value = s.item.filename, ee.value = s.item.alt_text || "", M.value = "free", N.value = void 0, P.value = void 0, F.value = "", I.value = "", ne.value = void 0, L.value = null, re.value = !1, ie.value = !1, s.item.width && s.item.height && (ne.value = s.item.width / s.item.height));
|
|
4132
4136
|
});
|
|
4133
|
-
function
|
|
4134
|
-
e.coordinates && (
|
|
4137
|
+
function ce(e) {
|
|
4138
|
+
e.coordinates && (L.value = {
|
|
4135
4139
|
width: Math.round(e.coordinates.width),
|
|
4136
4140
|
height: Math.round(e.coordinates.height)
|
|
4137
|
-
},
|
|
4141
|
+
}, ie.value = !0);
|
|
4138
4142
|
}
|
|
4139
|
-
function
|
|
4140
|
-
|
|
4143
|
+
function le() {
|
|
4144
|
+
re.value = !0, !ne.value && s.item?.width && s.item?.height && (ne.value = s.item.width / s.item.height);
|
|
4141
4145
|
}
|
|
4142
|
-
function
|
|
4146
|
+
function ue(e) {
|
|
4143
4147
|
let t = e.target.value;
|
|
4144
|
-
|
|
4148
|
+
F.value = t, N.value = t && parseInt(t, 10) || void 0;
|
|
4145
4149
|
}
|
|
4146
|
-
function
|
|
4150
|
+
function de(e) {
|
|
4147
4151
|
let t = e.target.value;
|
|
4148
|
-
I.value = t,
|
|
4152
|
+
I.value = t, P.value = t && parseInt(t, 10) || void 0;
|
|
4149
4153
|
}
|
|
4150
|
-
async function
|
|
4154
|
+
async function fe() {
|
|
4151
4155
|
let e = j.value.trim();
|
|
4152
|
-
if (!e || !s.item ||
|
|
4156
|
+
if (!e || !s.item || R.value) return;
|
|
4153
4157
|
let t = S(s.item.mime_type), n;
|
|
4154
|
-
if (
|
|
4155
|
-
|
|
4158
|
+
if (ae.value && te.value && ie.value) {
|
|
4159
|
+
R.value = !0;
|
|
4156
4160
|
try {
|
|
4157
|
-
let { canvas: e } =
|
|
4161
|
+
let { canvas: e } = te.value.getResult();
|
|
4158
4162
|
if (e) {
|
|
4159
|
-
let t =
|
|
4160
|
-
n = { file: await
|
|
4163
|
+
let t = ke(e, N.value, P.value), r = Oe(s.item.mime_type);
|
|
4164
|
+
n = { file: await Ae(t, s.item.filename, r) };
|
|
4161
4165
|
}
|
|
4162
4166
|
} catch {
|
|
4163
|
-
|
|
4167
|
+
R.value = !1;
|
|
4164
4168
|
return;
|
|
4165
4169
|
}
|
|
4166
|
-
|
|
4170
|
+
R.value = !1;
|
|
4167
4171
|
}
|
|
4168
4172
|
l("save", s.item.id, e, t ? ee.value : void 0, n), l("close");
|
|
4169
4173
|
}
|
|
4170
|
-
function
|
|
4171
|
-
e.key === "Enter" && !
|
|
4174
|
+
function pe(e) {
|
|
4175
|
+
e.key === "Enter" && !R.value && (e.preventDefault(), fe()), e.key === "Escape" && l("close");
|
|
4172
4176
|
}
|
|
4173
4177
|
return (e, t) => (c(), x(y, { to: "body" }, [h(T, {
|
|
4174
4178
|
"enter-active-class": "tpl:transition tpl:ease-out tpl:duration-150",
|
|
@@ -4184,22 +4188,22 @@ var wn = ["data-tpl-theme"], Tn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, En
|
|
|
4184
4188
|
class: "tpl tpl:fixed tpl:inset-0 tpl:z-[10000] tpl:flex tpl:items-center tpl:justify-center",
|
|
4185
4189
|
style: { "background-color": "var(--tpl-overlay)" },
|
|
4186
4190
|
onClick: t[3] ||= k((e) => l("close"), ["self"]),
|
|
4187
|
-
onKeydown:
|
|
4191
|
+
onKeydown: pe
|
|
4188
4192
|
}, [w("div", {
|
|
4189
|
-
class: O(["tpl:mx-4 tpl:flex tpl:max-h-[90vh] tpl:w-full tpl:flex-col tpl:overflow-hidden tpl:rounded-lg tpl:shadow-xl",
|
|
4193
|
+
class: O(["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"]),
|
|
4190
4194
|
style: { "background-color": "var(--tpl-bg-elevated)" }
|
|
4191
4195
|
}, [
|
|
4192
4196
|
w("div", Tn, [w("h3", En, C(m(u).mediaLibrary.editFile), 1)]),
|
|
4193
4197
|
w("div", Dn, [
|
|
4194
|
-
|
|
4198
|
+
ae.value ? (c(), p("div", On, [w("div", kn, [h(m(xn), {
|
|
4195
4199
|
ref_key: "cropperRef",
|
|
4196
|
-
ref:
|
|
4200
|
+
ref: te,
|
|
4197
4201
|
src: a.item.url,
|
|
4198
|
-
"stencil-props": { aspectRatio:
|
|
4202
|
+
"stencil-props": { aspectRatio: oe.value },
|
|
4199
4203
|
class: "tpl:h-full tpl:w-full",
|
|
4200
4204
|
"background-class": "tpl-cropper-background",
|
|
4201
|
-
onChange:
|
|
4202
|
-
onReady:
|
|
4205
|
+
onChange: ce,
|
|
4206
|
+
onReady: le
|
|
4203
4207
|
}, null, 8, ["src", "stencil-props"])]), w("div", An, [
|
|
4204
4208
|
w("div", null, [w("label", jn, C(m(u).mediaLibrary.cropAspectRatio), 1), w("div", Mn, [(c(), p(v, null, r([
|
|
4205
4209
|
"free",
|
|
@@ -4212,14 +4216,14 @@ var wn = ["data-tpl-theme"], Tn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, En
|
|
|
4212
4216
|
type: "button",
|
|
4213
4217
|
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",
|
|
4214
4218
|
style: _({
|
|
4215
|
-
borderColor:
|
|
4216
|
-
backgroundColor:
|
|
4217
|
-
color:
|
|
4219
|
+
borderColor: M.value === e ? "var(--tpl-primary)" : "var(--tpl-border)",
|
|
4220
|
+
backgroundColor: M.value === e ? "var(--tpl-primary-light)" : "var(--tpl-bg)",
|
|
4221
|
+
color: M.value === e ? "var(--tpl-primary)" : "var(--tpl-text)"
|
|
4218
4222
|
}),
|
|
4219
|
-
onClick: (t) =>
|
|
4223
|
+
onClick: (t) => M.value = e
|
|
4220
4224
|
}, C(m(g)[`crop${e.charAt(0).toUpperCase()}${e.slice(1)}`]), 13, Nn)), 64))])]),
|
|
4221
4225
|
w("div", Pn, [w("div", Fn, [w("label", In, [A(C(m(u).mediaLibrary.cropMaxWidth) + " ", 1), w("span", Ln, C(m(u).mediaLibrary.cropOptional), 1)]), w("div", Rn, [w("input", {
|
|
4222
|
-
value:
|
|
4226
|
+
value: F.value,
|
|
4223
4227
|
type: "number",
|
|
4224
4228
|
min: "1",
|
|
4225
4229
|
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",
|
|
@@ -4228,8 +4232,8 @@ var wn = ["data-tpl-theme"], Tn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, En
|
|
|
4228
4232
|
"background-color": "var(--tpl-bg)",
|
|
4229
4233
|
color: "var(--tpl-text)"
|
|
4230
4234
|
},
|
|
4231
|
-
placeholder:
|
|
4232
|
-
onInput:
|
|
4235
|
+
placeholder: L.value?.width?.toString() || "",
|
|
4236
|
+
onInput: ue
|
|
4233
4237
|
}, null, 40, zn), w("span", Bn, C(m(u).mediaLibrary.cropPixels), 1)])]), w("div", Vn, [w("label", Hn, [A(C(m(u).mediaLibrary.cropMaxHeight) + " ", 1), w("span", Un, C(m(u).mediaLibrary.cropOptional), 1)]), w("div", Wn, [w("input", {
|
|
4234
4238
|
value: I.value,
|
|
4235
4239
|
type: "number",
|
|
@@ -4240,10 +4244,10 @@ var wn = ["data-tpl-theme"], Tn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, En
|
|
|
4240
4244
|
"background-color": "var(--tpl-bg)",
|
|
4241
4245
|
color: "var(--tpl-text)"
|
|
4242
4246
|
},
|
|
4243
|
-
placeholder:
|
|
4244
|
-
onInput:
|
|
4247
|
+
placeholder: L.value?.height?.toString() || "",
|
|
4248
|
+
onInput: de
|
|
4245
4249
|
}, null, 40, Gn), w("span", Kn, C(m(u).mediaLibrary.cropPixels), 1)])])]),
|
|
4246
|
-
|
|
4250
|
+
se.value ? (c(), p("div", qn, [w("span", null, C(m(u).mediaLibrary.cropOutputSize) + ": ", 1), w("span", Jn, C(se.value.width) + " x " + C(se.value.height) + " " + C(m(u).mediaLibrary.cropPixels), 1)])) : b("", !0)
|
|
4247
4251
|
])])) : b("", !0),
|
|
4248
4252
|
w("div", Yn, [w("label", Xn, C(m(u).mediaLibrary.fileName), 1), f(w("input", {
|
|
4249
4253
|
"onUpdate:modelValue": t[0] ||= (e) => j.value = e,
|
|
@@ -4254,7 +4258,7 @@ var wn = ["data-tpl-theme"], Tn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, En
|
|
|
4254
4258
|
"background-color": "var(--tpl-bg)",
|
|
4255
4259
|
color: "var(--tpl-text)"
|
|
4256
4260
|
},
|
|
4257
|
-
autofocus: !
|
|
4261
|
+
autofocus: !ae.value
|
|
4258
4262
|
}, null, 8, Zn), [[D, j.value]])]),
|
|
4259
4263
|
m(S)(a.item.mime_type) ? (c(), p("div", Qn, [w("label", $n, C(m(u).mediaLibrary.altText), 1), f(w("input", {
|
|
4260
4264
|
"onUpdate:modelValue": t[1] ||= (e) => ee.value = e,
|
|
@@ -4279,9 +4283,9 @@ var wn = ["data-tpl-theme"], Tn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, En
|
|
|
4279
4283
|
}, C(m(u).mediaLibrary.cancel), 1), w("button", {
|
|
4280
4284
|
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",
|
|
4281
4285
|
style: { background: "linear-gradient(\n 135deg,\n var(--tpl-primary),\n var(--tpl-primary-hover)\n )" },
|
|
4282
|
-
disabled:
|
|
4283
|
-
onClick:
|
|
4284
|
-
}, C(
|
|
4286
|
+
disabled: R.value,
|
|
4287
|
+
onClick: fe
|
|
4288
|
+
}, C(R.value ? m(u).mediaLibrary.saving : m(u).mediaLibrary.saveChanges), 9, nr)])
|
|
4285
4289
|
], 2)], 40, wn)) : b("", !0)]),
|
|
4286
4290
|
_: 1
|
|
4287
4291
|
})]));
|
|
@@ -4309,31 +4313,31 @@ var wn = ["data-tpl-theme"], Tn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, En
|
|
|
4309
4313
|
"deleteFolder"
|
|
4310
4314
|
],
|
|
4311
4315
|
setup(t, { emit: n }) {
|
|
4312
|
-
let i = t, a = n, { t: o } =
|
|
4313
|
-
function
|
|
4314
|
-
for (let n of e) if (n.id === t || n.children &&
|
|
4316
|
+
let i = t, a = n, { t: o } = z(), l = e(!1), u = e(!1), d = e(""), g = e(!1), y = e(""), T = E(() => (i.folder.children?.length ?? 0) > 0), A = E(() => i.depth < dr - 1), j = E(() => i.currentFolderId === i.folder.id), ee = E(() => !i.currentFolderId || !i.folder.children ? !1 : N(i.folder.children, i.currentFolderId)), M = E(() => l.value || ee.value);
|
|
4317
|
+
function N(e, t) {
|
|
4318
|
+
for (let n of e) if (n.id === t || n.children && N(n.children, t)) return !0;
|
|
4315
4319
|
return !1;
|
|
4316
4320
|
}
|
|
4317
|
-
function
|
|
4321
|
+
function P() {
|
|
4318
4322
|
l.value = !l.value;
|
|
4319
4323
|
}
|
|
4320
|
-
function
|
|
4324
|
+
function F() {
|
|
4321
4325
|
u.value = !0, d.value = i.folder.name;
|
|
4322
4326
|
}
|
|
4323
4327
|
function I() {
|
|
4324
4328
|
let e = d.value.trim();
|
|
4325
4329
|
e && e !== i.folder.name && a("renameFolder", i.folder.id, e), u.value = !1, d.value = "";
|
|
4326
4330
|
}
|
|
4327
|
-
function
|
|
4331
|
+
function ne() {
|
|
4328
4332
|
u.value = !1, d.value = "";
|
|
4329
4333
|
}
|
|
4330
|
-
function
|
|
4334
|
+
function L() {
|
|
4331
4335
|
g.value = !0, y.value = "", l.value = !0;
|
|
4332
4336
|
}
|
|
4333
|
-
function
|
|
4337
|
+
function re() {
|
|
4334
4338
|
y.value.trim() && a("createFolder", y.value.trim(), i.folder.id), g.value = !1, y.value = "";
|
|
4335
4339
|
}
|
|
4336
|
-
function
|
|
4340
|
+
function R() {
|
|
4337
4341
|
g.value = !1, y.value = "";
|
|
4338
4342
|
}
|
|
4339
4343
|
return (e, n) => {
|
|
@@ -4349,16 +4353,16 @@ var wn = ["data-tpl-theme"], Tn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, En
|
|
|
4349
4353
|
T.value || g.value ? (c(), p("button", {
|
|
4350
4354
|
key: 0,
|
|
4351
4355
|
class: "tpl:flex tpl:size-4 tpl:shrink-0 tpl:items-center tpl:justify-center tpl:rounded tpl:transition-colors",
|
|
4352
|
-
onClick: k(
|
|
4353
|
-
}, [h(m(
|
|
4354
|
-
class: O(["tpl:transition-transform tpl:duration-150", { "tpl:rotate-90":
|
|
4356
|
+
onClick: k(P, ["stop"])
|
|
4357
|
+
}, [h(m(te), {
|
|
4358
|
+
class: O(["tpl:transition-transform tpl:duration-150", { "tpl:rotate-90": M.value }]),
|
|
4355
4359
|
size: 10,
|
|
4356
4360
|
"stroke-width": 2
|
|
4357
4361
|
}, null, 8, ["class"])])) : (c(), p("span", ir)),
|
|
4358
4362
|
w("button", {
|
|
4359
4363
|
class: "tpl:flex tpl:min-w-0 tpl:flex-1 tpl:items-center tpl:gap-1.5",
|
|
4360
4364
|
onClick: n[0] ||= (e) => a("navigate", t.folder.id)
|
|
4361
|
-
}, [h(m(
|
|
4365
|
+
}, [h(m(he), {
|
|
4362
4366
|
class: "tpl:shrink-0",
|
|
4363
4367
|
size: 14,
|
|
4364
4368
|
"stroke-width": 1.5
|
|
@@ -4374,7 +4378,7 @@ var wn = ["data-tpl-theme"], Tn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, En
|
|
|
4374
4378
|
color: "var(--tpl-text)"
|
|
4375
4379
|
},
|
|
4376
4380
|
autofocus: "",
|
|
4377
|
-
onKeydown: [S(I, ["enter"]), S(
|
|
4381
|
+
onKeydown: [S(I, ["enter"]), S(ne, ["escape"])],
|
|
4378
4382
|
onBlur: I,
|
|
4379
4383
|
onClick: n[2] ||= k(() => {}, ["stop"])
|
|
4380
4384
|
}, null, 544)), [[D, d.value]]) : b("", !0),
|
|
@@ -4383,29 +4387,29 @@ var wn = ["data-tpl-theme"], Tn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, En
|
|
|
4383
4387
|
key: 0,
|
|
4384
4388
|
class: "tpl:flex tpl:size-6 tpl:items-center tpl:justify-center tpl:rounded tpl:transition-colors",
|
|
4385
4389
|
title: m(o).mediaLibrary.addSubfolder,
|
|
4386
|
-
onClick: k(
|
|
4387
|
-
}, [h(m(
|
|
4390
|
+
onClick: k(L, ["stop"])
|
|
4391
|
+
}, [h(m(pe), {
|
|
4388
4392
|
size: 12,
|
|
4389
4393
|
"stroke-width": 2
|
|
4390
4394
|
})], 8, sr)) : b("", !0),
|
|
4391
4395
|
w("button", {
|
|
4392
4396
|
class: "tpl:flex tpl:size-6 tpl:items-center tpl:justify-center tpl:rounded tpl:transition-colors",
|
|
4393
4397
|
title: m(o).mediaLibrary.renameFolder,
|
|
4394
|
-
onClick: k(
|
|
4395
|
-
}, [h(m(
|
|
4398
|
+
onClick: k(F, ["stop"])
|
|
4399
|
+
}, [h(m(le), {
|
|
4396
4400
|
size: 12,
|
|
4397
4401
|
"stroke-width": 2
|
|
4398
4402
|
})], 8, cr),
|
|
4399
4403
|
w("button", {
|
|
4400
4404
|
class: "tpl:flex tpl:size-6 tpl:items-center tpl:justify-center tpl:rounded tpl:transition-colors",
|
|
4401
4405
|
onClick: n[3] ||= k((e) => a("deleteFolder", t.folder.id), ["stop"])
|
|
4402
|
-
}, [h(m(
|
|
4406
|
+
}, [h(m(oe), {
|
|
4403
4407
|
size: 12,
|
|
4404
4408
|
"stroke-width": 2,
|
|
4405
4409
|
style: { color: "var(--tpl-danger)" }
|
|
4406
4410
|
})])
|
|
4407
4411
|
]))
|
|
4408
|
-
], 4),
|
|
4412
|
+
], 4), M.value ? (c(), p("div", lr, [(c(!0), p(v, null, r(t.folder.children, (e) => (c(), x(i, {
|
|
4409
4413
|
key: e.id,
|
|
4410
4414
|
folder: e,
|
|
4411
4415
|
"current-folder-id": t.currentFolderId,
|
|
@@ -4433,8 +4437,8 @@ var wn = ["data-tpl-theme"], Tn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, En
|
|
|
4433
4437
|
},
|
|
4434
4438
|
placeholder: m(o).mediaLibrary.subfolderName,
|
|
4435
4439
|
autofocus: "",
|
|
4436
|
-
onKeydown: [S(
|
|
4437
|
-
onBlur:
|
|
4440
|
+
onKeydown: [S(re, ["enter"]), S(R, ["escape"])],
|
|
4441
|
+
onBlur: re
|
|
4438
4442
|
}, null, 40, ur), [[D, y.value]])], 4)) : b("", !0)])) : b("", !0)]);
|
|
4439
4443
|
};
|
|
4440
4444
|
}
|
|
@@ -4457,7 +4461,7 @@ var wn = ["data-tpl-theme"], Tn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, En
|
|
|
4457
4461
|
"showFrequentlyUsed"
|
|
4458
4462
|
],
|
|
4459
4463
|
setup(t, { emit: n }) {
|
|
4460
|
-
let i = n, { t: a } =
|
|
4464
|
+
let i = n, { t: a } = z(), o = e(!1), s = e("");
|
|
4461
4465
|
function l() {
|
|
4462
4466
|
o.value = !0, s.value = "";
|
|
4463
4467
|
}
|
|
@@ -4475,7 +4479,7 @@ var wn = ["data-tpl-theme"], Tn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, En
|
|
|
4475
4479
|
color: t.viewMode === "files" && t.currentFolderId === null ? "var(--tpl-primary)" : "var(--tpl-text)"
|
|
4476
4480
|
}),
|
|
4477
4481
|
onClick: n[0] ||= (e) => i("navigate", null)
|
|
4478
|
-
}, [h(m(
|
|
4482
|
+
}, [h(m(de), {
|
|
4479
4483
|
size: 14,
|
|
4480
4484
|
"stroke-width": 1.5
|
|
4481
4485
|
}), A(" " + C(m(a).mediaLibrary.allFiles), 1)], 4),
|
|
@@ -4508,7 +4512,7 @@ var wn = ["data-tpl-theme"], Tn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, En
|
|
|
4508
4512
|
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",
|
|
4509
4513
|
style: { color: "var(--tpl-text-muted)" },
|
|
4510
4514
|
onClick: l
|
|
4511
|
-
}, [h(m(
|
|
4515
|
+
}, [h(m(pe), {
|
|
4512
4516
|
size: 14,
|
|
4513
4517
|
"stroke-width": 1.5
|
|
4514
4518
|
}), A(" " + C(m(a).mediaLibrary.newFolder), 1)])),
|
|
@@ -4522,7 +4526,7 @@ var wn = ["data-tpl-theme"], Tn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, En
|
|
|
4522
4526
|
color: t.viewMode === "frequently-used" ? "var(--tpl-primary)" : "var(--tpl-text)"
|
|
4523
4527
|
}),
|
|
4524
4528
|
onClick: n[6] ||= (e) => i("showFrequentlyUsed")
|
|
4525
|
-
}, [h(m(
|
|
4529
|
+
}, [h(m(_e), {
|
|
4526
4530
|
size: 14,
|
|
4527
4531
|
"stroke-width": 1.5
|
|
4528
4532
|
}), A(" " + C(m(a).mediaLibrary.frequentlyUsed), 1)], 4)) : b("", !0)
|
|
@@ -4757,15 +4761,15 @@ var wn = ["data-tpl-theme"], Tn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, En
|
|
|
4757
4761
|
"replace"
|
|
4758
4762
|
],
|
|
4759
4763
|
setup(t, { emit: n }) {
|
|
4760
|
-
let i = t, a = n, { isAcceptedMimeType: o, isImageMimeType: s } =
|
|
4764
|
+
let i = t, a = n, { isAcceptedMimeType: o, isImageMimeType: s } = Ee();
|
|
4761
4765
|
function l(e) {
|
|
4762
4766
|
return !i.accept || i.accept.length === 0 ? !0 : o(e.mime_type, i.accept);
|
|
4763
4767
|
}
|
|
4764
4768
|
function u(e) {
|
|
4765
4769
|
a("select", e);
|
|
4766
4770
|
}
|
|
4767
|
-
let { t: d } =
|
|
4768
|
-
|
|
4771
|
+
let { t: d } = z(), f = e(null);
|
|
4772
|
+
re(f, ([{ isIntersecting: e }]) => {
|
|
4769
4773
|
e && i.hasMore && !i.isLoading && a("loadMore");
|
|
4770
4774
|
}, { threshold: .1 });
|
|
4771
4775
|
function g(e) {
|
|
@@ -4786,7 +4790,7 @@ var wn = ["data-tpl-theme"], Tn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, En
|
|
|
4786
4790
|
key: e,
|
|
4787
4791
|
class: O(["tpl-pulse tpl:rounded-lg", t.layout === "list" ? "tpl:h-12" : "tpl:aspect-square"]),
|
|
4788
4792
|
style: { "background-color": "var(--tpl-bg-hover)" }
|
|
4789
|
-
}, null, 2)), 64))], 2)) : t.items.length === 0 ? (c(), p("div", br, [h(m(
|
|
4793
|
+
}, null, 2)), 64))], 2)) : t.items.length === 0 ? (c(), p("div", br, [h(m(de), {
|
|
4790
4794
|
class: "tpl:mb-3",
|
|
4791
4795
|
size: 40,
|
|
4792
4796
|
"stroke-width": 1,
|
|
@@ -4810,7 +4814,7 @@ var wn = ["data-tpl-theme"], Tn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, En
|
|
|
4810
4814
|
style: { color: "var(--tpl-text-muted)" },
|
|
4811
4815
|
title: m(d).mediaLibrary.editFile,
|
|
4812
4816
|
onClick: k((t) => a("edit", e), ["stop"])
|
|
4813
|
-
}, [h(m(
|
|
4817
|
+
}, [h(m(le), {
|
|
4814
4818
|
size: 12,
|
|
4815
4819
|
"stroke-width": 2
|
|
4816
4820
|
})], 8, Ur), w("button", {
|
|
@@ -4818,11 +4822,11 @@ var wn = ["data-tpl-theme"], Tn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, En
|
|
|
4818
4822
|
style: { color: "var(--tpl-text-muted)" },
|
|
4819
4823
|
title: m(d).mediaLibrary.replaceFile,
|
|
4820
4824
|
onClick: k((t) => a("replace", e), ["stop"])
|
|
4821
|
-
}, [h(m(
|
|
4825
|
+
}, [h(m(L), {
|
|
4822
4826
|
size: 12,
|
|
4823
4827
|
"stroke-width": 2
|
|
4824
4828
|
})], 8, Wr)]),
|
|
4825
|
-
t.selectedIds.has(e.id) ? (c(), p("div", Gr, [h(m(
|
|
4829
|
+
t.selectedIds.has(e.id) ? (c(), p("div", Gr, [h(m(F), {
|
|
4826
4830
|
size: 12,
|
|
4827
4831
|
"stroke-width": 3
|
|
4828
4832
|
})])) : b("", !0)
|
|
@@ -4855,7 +4859,7 @@ var wn = ["data-tpl-theme"], Tn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, En
|
|
|
4855
4859
|
style: { "background-color": "rgba(0, 0, 0, 0.6)" },
|
|
4856
4860
|
title: m(d).mediaLibrary.editFile,
|
|
4857
4861
|
onClick: k((t) => a("edit", e), ["stop"])
|
|
4858
|
-
}, [h(m(
|
|
4862
|
+
}, [h(m(le), {
|
|
4859
4863
|
size: 11,
|
|
4860
4864
|
"stroke-width": 2
|
|
4861
4865
|
})], 8, jr), w("button", {
|
|
@@ -4863,11 +4867,11 @@ var wn = ["data-tpl-theme"], Tn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, En
|
|
|
4863
4867
|
style: { "background-color": "rgba(0, 0, 0, 0.6)" },
|
|
4864
4868
|
title: m(d).mediaLibrary.replaceFile,
|
|
4865
4869
|
onClick: k((t) => a("replace", e), ["stop"])
|
|
4866
|
-
}, [h(m(
|
|
4870
|
+
}, [h(m(L), {
|
|
4867
4871
|
size: 11,
|
|
4868
4872
|
"stroke-width": 2
|
|
4869
4873
|
})], 8, Mr)]),
|
|
4870
|
-
t.selectedIds.has(e.id) ? (c(), p("div", Nr, [h(m(
|
|
4874
|
+
t.selectedIds.has(e.id) ? (c(), p("div", Nr, [h(m(F), {
|
|
4871
4875
|
size: 12,
|
|
4872
4876
|
"stroke-width": 3
|
|
4873
4877
|
})])) : b("", !0)
|
|
@@ -4877,7 +4881,7 @@ var wn = ["data-tpl-theme"], Tn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, En
|
|
|
4877
4881
|
ref: f,
|
|
4878
4882
|
class: "tpl:h-4"
|
|
4879
4883
|
}, null, 512),
|
|
4880
|
-
t.isLoading && t.items.length > 0 ? (c(), p("div", Kr, [h(m(
|
|
4884
|
+
t.isLoading && t.items.length > 0 ? (c(), p("div", Kr, [h(m(ie), {
|
|
4881
4885
|
class: "tpl-spinner",
|
|
4882
4886
|
size: 20,
|
|
4883
4887
|
"stroke-width": 2,
|
|
@@ -4907,7 +4911,7 @@ var wn = ["data-tpl-theme"], Tn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, En
|
|
|
4907
4911
|
},
|
|
4908
4912
|
emits: ["import", "close"],
|
|
4909
4913
|
setup(r, { emit: a }) {
|
|
4910
|
-
let o = r, s = a, { t: l } =
|
|
4914
|
+
let o = r, s = a, { t: l } = z(), u = n("tplUiTheme"), d = e("");
|
|
4911
4915
|
t(() => o.visible, (e) => {
|
|
4912
4916
|
e && (d.value = "");
|
|
4913
4917
|
});
|
|
@@ -4966,7 +4970,7 @@ var wn = ["data-tpl-theme"], Tn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, En
|
|
|
4966
4970
|
style: { background: "linear-gradient(\n 135deg,\n var(--tpl-primary),\n var(--tpl-primary-hover)\n )" },
|
|
4967
4971
|
disabled: !d.value.trim() || r.isImporting,
|
|
4968
4972
|
onClick: g
|
|
4969
|
-
}, [r.isImporting ? (c(), p("span", ri, [h(m(
|
|
4973
|
+
}, [r.isImporting ? (c(), p("span", ri, [h(m(ie), {
|
|
4970
4974
|
class: "tpl:animate-spin",
|
|
4971
4975
|
size: 12,
|
|
4972
4976
|
"stroke-width": 2
|
|
@@ -4987,7 +4991,7 @@ var wn = ["data-tpl-theme"], Tn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, En
|
|
|
4987
4991
|
},
|
|
4988
4992
|
emits: ["select", "close"],
|
|
4989
4993
|
setup(t, { emit: n }) {
|
|
4990
|
-
let i = n, { t: a } =
|
|
4994
|
+
let i = n, { t: a } = z(), o = e(null);
|
|
4991
4995
|
function s(e, t = 0) {
|
|
4992
4996
|
let n = [];
|
|
4993
4997
|
for (let r of e) n.push({
|
|
@@ -4997,7 +5001,7 @@ var wn = ["data-tpl-theme"], Tn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, En
|
|
|
4997
5001
|
}), r.children?.length && n.push(...s(r.children, t + 1));
|
|
4998
5002
|
return n;
|
|
4999
5003
|
}
|
|
5000
|
-
return
|
|
5004
|
+
return I(o, () => {
|
|
5001
5005
|
i("close");
|
|
5002
5006
|
}), (e, n) => (c(), p("div", {
|
|
5003
5007
|
ref_key: "pickerRef",
|
|
@@ -5012,7 +5016,7 @@ var wn = ["data-tpl-theme"], Tn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, En
|
|
|
5012
5016
|
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",
|
|
5013
5017
|
style: { color: "var(--tpl-text)" },
|
|
5014
5018
|
onClick: n[0] ||= (e) => i("select", null)
|
|
5015
|
-
}, [h(m(
|
|
5019
|
+
}, [h(m(de), {
|
|
5016
5020
|
class: "tpl:shrink-0",
|
|
5017
5021
|
size: 14,
|
|
5018
5022
|
"stroke-width": 1.5
|
|
@@ -5027,7 +5031,7 @@ var wn = ["data-tpl-theme"], Tn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, En
|
|
|
5027
5031
|
disabled: e.id === t.currentFolderId,
|
|
5028
5032
|
onClick: (t) => i("select", e.id)
|
|
5029
5033
|
}, [
|
|
5030
|
-
h(m(
|
|
5034
|
+
h(m(he), {
|
|
5031
5035
|
class: "tpl:shrink-0",
|
|
5032
5036
|
size: 14,
|
|
5033
5037
|
"stroke-width": 1.5
|
|
@@ -5061,7 +5065,7 @@ var wn = ["data-tpl-theme"], Tn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, En
|
|
|
5061
5065
|
},
|
|
5062
5066
|
emits: ["update:selectedConversion"],
|
|
5063
5067
|
setup(e, { emit: t }) {
|
|
5064
|
-
let n = e, i = t, { t: a } =
|
|
5068
|
+
let n = e, i = t, { t: a } = z(), { isImageMimeType: o } = Ee(), s = E(() => {
|
|
5065
5069
|
if (!_.value || !n.item.conversions_generated) return [];
|
|
5066
5070
|
let e = [];
|
|
5067
5071
|
return n.item.small_url && e.push({
|
|
@@ -5138,7 +5142,7 @@ var wn = ["data-tpl-theme"], Tn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, En
|
|
|
5138
5142
|
_.value && e.item.width && e.item.height ? (c(), p(v, { key: 0 }, [A(" · " + C(e.item.width) + "×" + C(e.item.height) + "px ", 1)], 64)) : b("", !0),
|
|
5139
5143
|
g.value ? (c(), p(v, { key: 1 }, [
|
|
5140
5144
|
n[0] ||= A(" · ", -1),
|
|
5141
|
-
h(m(
|
|
5145
|
+
h(m(he), {
|
|
5142
5146
|
class: "tpl:mb-px tpl:inline",
|
|
5143
5147
|
size: 9,
|
|
5144
5148
|
"stroke-width": 2
|
|
@@ -5204,7 +5208,7 @@ var wn = ["data-tpl-theme"], Tn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, En
|
|
|
5204
5208
|
},
|
|
5205
5209
|
emits: ["replace", "close"],
|
|
5206
5210
|
setup(r, { emit: a }) {
|
|
5207
|
-
let o = r, s = a, { t: l } =
|
|
5211
|
+
let o = r, s = a, { t: l } = z(), u = n("tplUiTheme"), d = e(null), f = e(null), g = E(() => {
|
|
5208
5212
|
if (!o.item) return "";
|
|
5209
5213
|
let e = o.item.filename.split(".");
|
|
5210
5214
|
return e.length > 1 ? e[e.length - 1].toLowerCase() : "";
|
|
@@ -5295,7 +5299,7 @@ var wn = ["data-tpl-theme"], Tn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, En
|
|
|
5295
5299
|
},
|
|
5296
5300
|
emits: ["upload"],
|
|
5297
5301
|
setup(t, { emit: n }) {
|
|
5298
|
-
let r = n, { t: i, format: a } =
|
|
5302
|
+
let r = n, { t: i, format: a } = z(), { allAcceptedMimeTypes: o, allAcceptedInputString: s, maxFileSize: l } = Ee(), u = e();
|
|
5299
5303
|
function d(e) {
|
|
5300
5304
|
let t = [];
|
|
5301
5305
|
for (let n of Array.from(e)) o.value.includes(n.type) && n.size <= l.value && t.push(n);
|
|
@@ -5305,9 +5309,9 @@ var wn = ["data-tpl-theme"], Tn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, En
|
|
|
5305
5309
|
let t = d(e);
|
|
5306
5310
|
t.length && r("upload", t);
|
|
5307
5311
|
}
|
|
5308
|
-
let { isOverDropZone: g } =
|
|
5312
|
+
let { isOverDropZone: g } = ee(u, { onDrop: (e) => {
|
|
5309
5313
|
e?.length && f(e);
|
|
5310
|
-
} }), { open: _, onChange: y } =
|
|
5314
|
+
} }), { open: _, onChange: y } = se({
|
|
5311
5315
|
accept: s.value,
|
|
5312
5316
|
multiple: !0
|
|
5313
5317
|
});
|
|
@@ -5322,7 +5326,7 @@ var wn = ["data-tpl-theme"], Tn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, En
|
|
|
5322
5326
|
"background-color": "var(--tpl-bg)"
|
|
5323
5327
|
},
|
|
5324
5328
|
onClick: n[0] ||= (e) => m(_)()
|
|
5325
|
-
}, [t.isUploading ? (c(), p("div", Li, [h(m(
|
|
5329
|
+
}, [t.isUploading ? (c(), p("div", Li, [h(m(ie), {
|
|
5326
5330
|
class: "tpl-spinner",
|
|
5327
5331
|
size: 20,
|
|
5328
5332
|
"stroke-width": 2,
|
|
@@ -5373,7 +5377,7 @@ var wn = ["data-tpl-theme"], Tn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, En
|
|
|
5373
5377
|
size: {}
|
|
5374
5378
|
},
|
|
5375
5379
|
setup(t) {
|
|
5376
|
-
let n = t, { t: r, format: a } =
|
|
5380
|
+
let n = t, { t: r, format: a } = z(), o = e(!1), s = E(() => n.size ?? 24), l = E(() => Math.max(2, s.value / 8)), u = E(() => (s.value - l.value) / 2), d = E(() => 2 * Math.PI * u.value), f = E(() => n.limitBytes <= 0 ? 0 : Math.min(100, n.usedBytes / n.limitBytes * 100)), m = E(() => d.value - f.value / 100 * d.value), g = E(() => f.value >= 95 ? "var(--tpl-danger)" : f.value >= 75 ? "var(--tpl-warning, #f59e0b)" : "var(--tpl-primary)");
|
|
5377
5381
|
function _(e) {
|
|
5378
5382
|
if (e === 0) return "0 B";
|
|
5379
5383
|
let t = 1024, n = [
|
|
@@ -5468,7 +5472,7 @@ function qi(n) {
|
|
|
5468
5472
|
function x(e) {
|
|
5469
5473
|
l.value = e, b(e);
|
|
5470
5474
|
}
|
|
5471
|
-
let { copy: S, copied: C } =
|
|
5475
|
+
let { copy: S, copied: C } = N({
|
|
5472
5476
|
copiedDuring: 2e3,
|
|
5473
5477
|
legacy: !0
|
|
5474
5478
|
});
|
|
@@ -5496,10 +5500,10 @@ function qi(n) {
|
|
|
5496
5500
|
async function ee(e) {
|
|
5497
5501
|
await r.importFromUrl(e) && (f.value = !1);
|
|
5498
5502
|
}
|
|
5499
|
-
async function
|
|
5503
|
+
async function te(e) {
|
|
5500
5504
|
p.value = !1, await r.moveSelected(e);
|
|
5501
5505
|
}
|
|
5502
|
-
async function
|
|
5506
|
+
async function M() {
|
|
5503
5507
|
await r.checkUsageBeforeDelete();
|
|
5504
5508
|
}
|
|
5505
5509
|
function P(e) {
|
|
@@ -5508,7 +5512,7 @@ function qi(n) {
|
|
|
5508
5512
|
async function F(e) {
|
|
5509
5513
|
await r.replaceFile(e);
|
|
5510
5514
|
}
|
|
5511
|
-
function
|
|
5515
|
+
function I() {
|
|
5512
5516
|
r.clearSelection(), r.cancelDelete(), r.cancelReplace(), l.value = "", r.categoryFilter.value = null, r.sortOption.value = "newest", r.viewMode.value = "files", d.value = null, f.value = !1, u.value = "original";
|
|
5513
5517
|
}
|
|
5514
5518
|
return {
|
|
@@ -5535,11 +5539,11 @@ function qi(n) {
|
|
|
5535
5539
|
handleEditItem: A,
|
|
5536
5540
|
handleEditSave: j,
|
|
5537
5541
|
handleImportFromUrl: ee,
|
|
5538
|
-
handleMoveToFolder:
|
|
5539
|
-
handleDeleteClick:
|
|
5542
|
+
handleMoveToFolder: te,
|
|
5543
|
+
handleDeleteClick: M,
|
|
5540
5544
|
handleReplaceItem: P,
|
|
5541
5545
|
handleReplaceFile: F,
|
|
5542
|
-
resetUI:
|
|
5546
|
+
resetUI: I
|
|
5543
5547
|
};
|
|
5544
5548
|
}
|
|
5545
5549
|
//#endregion
|
|
@@ -5618,30 +5622,30 @@ var Ji = ["data-tpl-theme"], Yi = {
|
|
|
5618
5622
|
},
|
|
5619
5623
|
emits: ["close", "select"],
|
|
5620
5624
|
setup(e, { emit: a }) {
|
|
5621
|
-
let o = e, s = a, { t: l } =
|
|
5625
|
+
let o = e, s = a, { t: l } = z(), u = n("tplUiTheme"), d = n("authManager"), f = n("projectId"), g = E(() => f.value), S = n("planConfig"), D = E(() => S.hasFeature("media_folders")), j = E(() => S.hasFeature("import_from_url")), ee = E(() => S.config.value?.storage.used_bytes ?? 0), te = E(() => S.config.value?.storage.limit_bytes ?? 0), { isAcceptedMimeType: M, availableCategories: N } = Ee(), P = xe({
|
|
5622
5626
|
projectId: g.value,
|
|
5623
5627
|
authManager: d
|
|
5624
|
-
}),
|
|
5625
|
-
library:
|
|
5628
|
+
}), I = qi({
|
|
5629
|
+
library: P,
|
|
5626
5630
|
canUseMediaFolders: D,
|
|
5627
5631
|
translations: l
|
|
5628
5632
|
});
|
|
5629
5633
|
t(() => o.visible, (e) => {
|
|
5630
|
-
e ? (
|
|
5634
|
+
e ? (P.loadItems(), P.loadFrequentlyUsed()) : I.resetUI();
|
|
5631
5635
|
});
|
|
5632
|
-
function
|
|
5636
|
+
function L(e) {
|
|
5633
5637
|
e.key === "Escape" && s("close");
|
|
5634
5638
|
}
|
|
5635
|
-
|
|
5636
|
-
function
|
|
5637
|
-
return
|
|
5639
|
+
ne(document, "keydown", L);
|
|
5640
|
+
function re() {
|
|
5641
|
+
return P.previewItem.value ? o.accept?.length ? M(P.previewItem.value.mime_type, o.accept) : !0 : !1;
|
|
5638
5642
|
}
|
|
5639
|
-
function
|
|
5640
|
-
if (
|
|
5641
|
-
let e =
|
|
5643
|
+
function R() {
|
|
5644
|
+
if (re()) {
|
|
5645
|
+
let e = P.previewItem.value;
|
|
5642
5646
|
s("select", {
|
|
5643
5647
|
...e,
|
|
5644
|
-
url:
|
|
5648
|
+
url: I.selectedUrl.value || e.url
|
|
5645
5649
|
}), s("close");
|
|
5646
5650
|
}
|
|
5647
5651
|
}
|
|
@@ -5662,11 +5666,11 @@ var Ji = ["data-tpl-theme"], Yi = {
|
|
|
5662
5666
|
w("div", Xi, [w("h2", Zi, C(m(l).mediaLibrary.title), 1), w("div", Qi, [
|
|
5663
5667
|
h(Ki, {
|
|
5664
5668
|
"used-bytes": ee.value,
|
|
5665
|
-
"limit-bytes":
|
|
5669
|
+
"limit-bytes": te.value,
|
|
5666
5670
|
size: 22
|
|
5667
5671
|
}, null, 8, ["used-bytes", "limit-bytes"]),
|
|
5668
5672
|
w("div", $i, [w("input", {
|
|
5669
|
-
value: m(
|
|
5673
|
+
value: m(I).searchInput.value,
|
|
5670
5674
|
type: "text",
|
|
5671
5675
|
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)]",
|
|
5672
5676
|
style: {
|
|
@@ -5675,8 +5679,8 @@ var Ji = ["data-tpl-theme"], Yi = {
|
|
|
5675
5679
|
color: "var(--tpl-text)"
|
|
5676
5680
|
},
|
|
5677
5681
|
placeholder: m(l).mediaLibrary.searchPlaceholder,
|
|
5678
|
-
onInput: n[0] ||= (e) => m(
|
|
5679
|
-
}, null, 40, ea), h(m(
|
|
5682
|
+
onInput: n[0] ||= (e) => m(I).handleSearchInput(e.target.value)
|
|
5683
|
+
}, null, 40, ea), h(m(ve), {
|
|
5680
5684
|
class: "tpl:absolute tpl:top-1/2 tpl:left-2.5 tpl:-translate-y-1/2",
|
|
5681
5685
|
size: 13,
|
|
5682
5686
|
"stroke-width": 2,
|
|
@@ -5686,7 +5690,7 @@ var Ji = ["data-tpl-theme"], Yi = {
|
|
|
5686
5690
|
class: "tpl:flex tpl:size-7 tpl:items-center tpl:justify-center tpl:rounded-md tpl:transition-all tpl:duration-150",
|
|
5687
5691
|
style: { color: "var(--tpl-text-muted)" },
|
|
5688
5692
|
onClick: n[1] ||= (e) => s("close")
|
|
5689
|
-
}, [h(m(
|
|
5693
|
+
}, [h(m(ce), {
|
|
5690
5694
|
size: 18,
|
|
5691
5695
|
"stroke-width": 2
|
|
5692
5696
|
})])
|
|
@@ -5699,16 +5703,16 @@ var Ji = ["data-tpl-theme"], Yi = {
|
|
|
5699
5703
|
"leave-from-class": "tpl:ml-0 tpl:opacity-100",
|
|
5700
5704
|
"leave-to-class": "tpl:-ml-48 tpl:opacity-0"
|
|
5701
5705
|
}, {
|
|
5702
|
-
default: i(() => [D.value && m(
|
|
5703
|
-
folders: m(
|
|
5704
|
-
"current-folder-id": m(
|
|
5705
|
-
"view-mode": m(
|
|
5706
|
-
"has-frequently-used": m(
|
|
5707
|
-
onNavigate: m(
|
|
5708
|
-
onCreateFolder: m(
|
|
5709
|
-
onRenameFolder: m(
|
|
5710
|
-
onDeleteFolder: m(
|
|
5711
|
-
onShowFrequentlyUsed: m(
|
|
5706
|
+
default: i(() => [D.value && m(I).showSidebar.value ? (c(), p("div", na, [h(gr, {
|
|
5707
|
+
folders: m(P).folders.value,
|
|
5708
|
+
"current-folder-id": m(P).currentFolderId.value,
|
|
5709
|
+
"view-mode": m(P).viewMode.value,
|
|
5710
|
+
"has-frequently-used": m(I).hasFrequentlyUsed.value,
|
|
5711
|
+
onNavigate: m(P).navigateToFolder,
|
|
5712
|
+
onCreateFolder: m(I).handleCreateFolder,
|
|
5713
|
+
onRenameFolder: m(I).handleRenameFolder,
|
|
5714
|
+
onDeleteFolder: m(I).handleDeleteFolder,
|
|
5715
|
+
onShowFrequentlyUsed: m(P).showFrequentlyUsed
|
|
5712
5716
|
}, null, 8, [
|
|
5713
5717
|
"folders",
|
|
5714
5718
|
"current-folder-id",
|
|
@@ -5726,21 +5730,21 @@ var Ji = ["data-tpl-theme"], Yi = {
|
|
|
5726
5730
|
key: 0,
|
|
5727
5731
|
class: "tpl:flex tpl:size-7 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded-md tpl:transition-all tpl:duration-150",
|
|
5728
5732
|
style: _({
|
|
5729
|
-
color: m(
|
|
5730
|
-
backgroundColor: m(
|
|
5731
|
-
border: m(
|
|
5733
|
+
color: m(I).showSidebar.value ? "var(--tpl-primary)" : "var(--tpl-text-muted)",
|
|
5734
|
+
backgroundColor: m(I).showSidebar.value ? "var(--tpl-bg)" : "transparent",
|
|
5735
|
+
border: m(I).showSidebar.value ? "1px solid var(--tpl-border)" : "1px solid transparent"
|
|
5732
5736
|
}),
|
|
5733
|
-
title: m(
|
|
5734
|
-
onClick: n[2] ||= (e) => m(
|
|
5735
|
-
}, [h(m(
|
|
5737
|
+
title: m(I).showSidebar.value ? m(l).mediaLibrary.hideFolders : m(l).mediaLibrary.showFolders,
|
|
5738
|
+
onClick: n[2] ||= (e) => m(I).showSidebar.value = !m(I).showSidebar.value
|
|
5739
|
+
}, [h(m(ge), {
|
|
5736
5740
|
size: 16,
|
|
5737
5741
|
"stroke-width": 2
|
|
5738
5742
|
})], 12, oa)) : b("", !0),
|
|
5739
|
-
m(
|
|
5743
|
+
m(P).viewMode.value === "frequently-used" ? (c(), p("span", sa, C(m(l).mediaLibrary.frequentlyUsed), 1)) : (c(), x(Te, {
|
|
5740
5744
|
key: 2,
|
|
5741
|
-
folders: m(
|
|
5742
|
-
"current-folder-id": m(
|
|
5743
|
-
onNavigate: m(
|
|
5745
|
+
folders: m(P).folders.value,
|
|
5746
|
+
"current-folder-id": m(P).currentFolderId.value,
|
|
5747
|
+
onNavigate: m(P).navigateToFolder
|
|
5744
5748
|
}, null, 8, [
|
|
5745
5749
|
"folders",
|
|
5746
5750
|
"current-folder-id",
|
|
@@ -5749,27 +5753,27 @@ var Ji = ["data-tpl-theme"], Yi = {
|
|
|
5749
5753
|
w("div", ca, [w("button", {
|
|
5750
5754
|
class: "tpl:flex tpl:size-6 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded tpl:transition-all tpl:duration-150",
|
|
5751
5755
|
style: _({
|
|
5752
|
-
color: m(
|
|
5753
|
-
backgroundColor: m(
|
|
5756
|
+
color: m(I).layoutMode.value === "grid" ? "var(--tpl-primary)" : "var(--tpl-text-muted)",
|
|
5757
|
+
backgroundColor: m(I).layoutMode.value === "grid" ? "var(--tpl-bg-elevated)" : "transparent"
|
|
5754
5758
|
}),
|
|
5755
5759
|
title: m(l).mediaLibrary.viewGrid,
|
|
5756
|
-
onClick: n[3] ||= (e) => m(
|
|
5757
|
-
}, [h(m(
|
|
5760
|
+
onClick: n[3] ||= (e) => m(I).layoutMode.value = "grid"
|
|
5761
|
+
}, [h(m(me), {
|
|
5758
5762
|
size: 14,
|
|
5759
5763
|
"stroke-width": 2
|
|
5760
5764
|
})], 12, la), w("button", {
|
|
5761
5765
|
class: "tpl:flex tpl:size-6 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded tpl:transition-all tpl:duration-150",
|
|
5762
5766
|
style: _({
|
|
5763
|
-
color: m(
|
|
5764
|
-
backgroundColor: m(
|
|
5767
|
+
color: m(I).layoutMode.value === "list" ? "var(--tpl-primary)" : "var(--tpl-text-muted)",
|
|
5768
|
+
backgroundColor: m(I).layoutMode.value === "list" ? "var(--tpl-bg-elevated)" : "transparent"
|
|
5765
5769
|
}),
|
|
5766
5770
|
title: m(l).mediaLibrary.viewList,
|
|
5767
|
-
onClick: n[4] ||= (e) => m(
|
|
5768
|
-
}, [h(m(
|
|
5771
|
+
onClick: n[4] ||= (e) => m(I).layoutMode.value = "list"
|
|
5772
|
+
}, [h(m(fe), {
|
|
5769
5773
|
size: 14,
|
|
5770
5774
|
"stroke-width": 2
|
|
5771
5775
|
})], 12, ua)])
|
|
5772
|
-
]), w("div", da, [m(
|
|
5776
|
+
]), w("div", da, [m(N).length > 1 ? (c(), p("select", {
|
|
5773
5777
|
key: 0,
|
|
5774
5778
|
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",
|
|
5775
5779
|
style: {
|
|
@@ -5777,20 +5781,20 @@ var Ji = ["data-tpl-theme"], Yi = {
|
|
|
5777
5781
|
"background-color": "var(--tpl-bg)",
|
|
5778
5782
|
color: "var(--tpl-text)"
|
|
5779
5783
|
},
|
|
5780
|
-
value: m(
|
|
5781
|
-
onChange: n[5] ||= (e) => m(
|
|
5782
|
-
}, [w("option", pa, C(m(l).mediaLibrary.filterAll), 1), (c(!0), p(v, null, r(m(
|
|
5784
|
+
value: m(P).categoryFilter.value ?? "",
|
|
5785
|
+
onChange: n[5] ||= (e) => m(P).filterByCategory(e.target.value || null)
|
|
5786
|
+
}, [w("option", pa, C(m(l).mediaLibrary.filterAll), 1), (c(!0), p(v, null, r(m(N), (e) => (c(), p("option", {
|
|
5783
5787
|
key: e,
|
|
5784
5788
|
value: e
|
|
5785
|
-
}, C(m(
|
|
5789
|
+
}, C(m(I).getCategoryLabel(e)), 9, ma))), 128))], 40, fa)) : b("", !0), w("select", {
|
|
5786
5790
|
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",
|
|
5787
5791
|
style: {
|
|
5788
5792
|
"border-color": "var(--tpl-border)",
|
|
5789
5793
|
"background-color": "var(--tpl-bg)",
|
|
5790
5794
|
color: "var(--tpl-text)"
|
|
5791
5795
|
},
|
|
5792
|
-
value: m(
|
|
5793
|
-
onChange: n[6] ||= (e) => m(
|
|
5796
|
+
value: m(P).sortOption.value,
|
|
5797
|
+
onChange: n[6] ||= (e) => m(P).sortBy(e.target.value)
|
|
5794
5798
|
}, [
|
|
5795
5799
|
w("option", ga, C(m(l).mediaLibrary.sortNewest), 1),
|
|
5796
5800
|
w("option", _a, C(m(l).mediaLibrary.sortOldest), 1),
|
|
@@ -5798,10 +5802,10 @@ var Ji = ["data-tpl-theme"], Yi = {
|
|
|
5798
5802
|
w("option", ya, C(m(l).mediaLibrary.sortNameDesc), 1),
|
|
5799
5803
|
w("option", ba, C(m(l).mediaLibrary.sortSizeAsc), 1),
|
|
5800
5804
|
w("option", xa, C(m(l).mediaLibrary.sortSizeDesc), 1)
|
|
5801
|
-
], 40, ha)])]), w("div", Sa, [m(
|
|
5802
|
-
"is-uploading": m(
|
|
5803
|
-
"upload-progress": m(
|
|
5804
|
-
onUpload: m(
|
|
5805
|
+
], 40, ha)])]), w("div", Sa, [m(P).viewMode.value === "files" ? (c(), p("div", Ca, [h(Vi, {
|
|
5806
|
+
"is-uploading": m(P).isUploading.value,
|
|
5807
|
+
"upload-progress": m(P).uploadProgress.value,
|
|
5808
|
+
onUpload: m(I).handleUpload
|
|
5805
5809
|
}, null, 8, [
|
|
5806
5810
|
"is-uploading",
|
|
5807
5811
|
"upload-progress",
|
|
@@ -5814,22 +5818,22 @@ var Ji = ["data-tpl-theme"], Yi = {
|
|
|
5814
5818
|
color: "var(--tpl-text-muted)",
|
|
5815
5819
|
"background-color": "var(--tpl-bg)"
|
|
5816
5820
|
},
|
|
5817
|
-
onClick: n[7] ||= (e) => m(
|
|
5818
|
-
}, [h(m(
|
|
5821
|
+
onClick: n[7] ||= (e) => m(I).showImportUrlModal.value = !0
|
|
5822
|
+
}, [h(m(ye), {
|
|
5819
5823
|
size: 14,
|
|
5820
5824
|
"stroke-width": 2
|
|
5821
5825
|
}), A(" " + C(m(l).mediaLibrary.importFromUrl), 1)])) : b("", !0)])) : b("", !0), h(qr, {
|
|
5822
|
-
items: m(
|
|
5823
|
-
"selected-ids": m(
|
|
5824
|
-
"is-loading": m(
|
|
5825
|
-
"has-more": m(
|
|
5826
|
+
items: m(I).displayItems.value,
|
|
5827
|
+
"selected-ids": m(P).selectedItems.value,
|
|
5828
|
+
"is-loading": m(P).isLoading.value,
|
|
5829
|
+
"has-more": m(P).viewMode.value === "files" && m(P).hasMore.value,
|
|
5826
5830
|
accept: e.accept,
|
|
5827
|
-
layout: m(
|
|
5828
|
-
onSelect: m(
|
|
5829
|
-
onToggle: m(
|
|
5830
|
-
onLoadMore: m(
|
|
5831
|
-
onEdit: m(
|
|
5832
|
-
onReplace: m(
|
|
5831
|
+
layout: m(I).layoutMode.value,
|
|
5832
|
+
onSelect: m(I).handleSelect,
|
|
5833
|
+
onToggle: m(P).toggleSelection,
|
|
5834
|
+
onLoadMore: m(P).loadMore,
|
|
5835
|
+
onEdit: m(I).handleEditItem,
|
|
5836
|
+
onReplace: m(I).handleReplaceItem
|
|
5833
5837
|
}, null, 8, [
|
|
5834
5838
|
"items",
|
|
5835
5839
|
"selected-ids",
|
|
@@ -5844,11 +5848,11 @@ var Ji = ["data-tpl-theme"], Yi = {
|
|
|
5844
5848
|
"onReplace"
|
|
5845
5849
|
])])])]),
|
|
5846
5850
|
h(ai, {
|
|
5847
|
-
visible: m(
|
|
5848
|
-
"is-importing": m(
|
|
5849
|
-
error: m(
|
|
5850
|
-
onImport: m(
|
|
5851
|
-
onClose: n[8] ||= (e) => m(
|
|
5851
|
+
visible: m(I).showImportUrlModal.value,
|
|
5852
|
+
"is-importing": m(P).isImportingFromUrl.value,
|
|
5853
|
+
error: m(P).importFromUrlError.value,
|
|
5854
|
+
onImport: m(I).handleImportFromUrl,
|
|
5855
|
+
onClose: n[8] ||= (e) => m(I).showImportUrlModal.value = !1
|
|
5852
5856
|
}, null, 8, [
|
|
5853
5857
|
"visible",
|
|
5854
5858
|
"is-importing",
|
|
@@ -5856,23 +5860,23 @@ var Ji = ["data-tpl-theme"], Yi = {
|
|
|
5856
5860
|
"onImport"
|
|
5857
5861
|
]),
|
|
5858
5862
|
h(rr, {
|
|
5859
|
-
visible: !!m(
|
|
5860
|
-
item: m(
|
|
5861
|
-
onSave: m(
|
|
5862
|
-
onClose: n[9] ||= (e) => m(
|
|
5863
|
+
visible: !!m(I).editingItem.value,
|
|
5864
|
+
item: m(I).editingItem.value,
|
|
5865
|
+
onSave: m(I).handleEditSave,
|
|
5866
|
+
onClose: n[9] ||= (e) => m(I).editingItem.value = null
|
|
5863
5867
|
}, null, 8, [
|
|
5864
5868
|
"visible",
|
|
5865
5869
|
"item",
|
|
5866
5870
|
"onSave"
|
|
5867
5871
|
]),
|
|
5868
5872
|
h(Ii, {
|
|
5869
|
-
visible: m(
|
|
5870
|
-
item: m(
|
|
5871
|
-
"usage-info": m(
|
|
5872
|
-
"is-replacing": m(
|
|
5873
|
-
error: m(
|
|
5874
|
-
onReplace: m(
|
|
5875
|
-
onClose: m(
|
|
5873
|
+
visible: m(P).showReplaceWarning.value,
|
|
5874
|
+
item: m(P).pendingReplaceItem.value,
|
|
5875
|
+
"usage-info": m(P).replaceUsageInfo.value,
|
|
5876
|
+
"is-replacing": m(P).isReplacing.value,
|
|
5877
|
+
error: m(P).replaceError.value,
|
|
5878
|
+
onReplace: m(I).handleReplaceFile,
|
|
5879
|
+
onClose: m(P).cancelReplace
|
|
5876
5880
|
}, null, 8, [
|
|
5877
5881
|
"visible",
|
|
5878
5882
|
"item",
|
|
@@ -5890,7 +5894,7 @@ var Ji = ["data-tpl-theme"], Yi = {
|
|
|
5890
5894
|
"leave-from-class": "tpl:opacity-100",
|
|
5891
5895
|
"leave-to-class": "tpl:opacity-0"
|
|
5892
5896
|
}, {
|
|
5893
|
-
default: i(() => [m(
|
|
5897
|
+
default: i(() => [m(P).showDeleteWarning.value ? (c(), p("div", {
|
|
5894
5898
|
key: 0,
|
|
5895
5899
|
class: "tpl:absolute tpl:inset-0 tpl:z-10 tpl:flex tpl:items-center tpl:justify-center tpl:rounded-[var(--tpl-radius-lg)]",
|
|
5896
5900
|
style: {
|
|
@@ -5898,19 +5902,19 @@ var Ji = ["data-tpl-theme"], Yi = {
|
|
|
5898
5902
|
"backdrop-filter": "blur(8px)",
|
|
5899
5903
|
"-webkit-backdrop-filter": "blur(8px)"
|
|
5900
5904
|
},
|
|
5901
|
-
onClick: n[12] ||= k((...e) => m(
|
|
5905
|
+
onClick: n[12] ||= k((...e) => m(P).cancelDelete && m(P).cancelDelete(...e), ["self"])
|
|
5902
5906
|
}, [w("div", wa, [
|
|
5903
5907
|
w("h3", Ta, C(m(l).mediaLibrary.deleteWarningTitle), 1),
|
|
5904
5908
|
w("p", {
|
|
5905
|
-
class: O(["tpl:text-xs", m(
|
|
5909
|
+
class: O(["tpl:text-xs", m(I).hasUsedFiles.value ? "tpl:mb-2" : "tpl:mb-4"]),
|
|
5906
5910
|
style: { color: "var(--tpl-text-muted)" }
|
|
5907
5911
|
}, C(m(l).mediaLibrary.deleteWarningMessage), 3),
|
|
5908
|
-
m(
|
|
5909
|
-
m(
|
|
5912
|
+
m(I).hasUsedFiles.value ? (c(), p("p", Ea, C(m(l).mediaLibrary.deleteWarningUsageNote), 1)) : b("", !0),
|
|
5913
|
+
m(I).hasUsedFiles.value ? (c(), p("div", Da, [(c(!0), p(v, null, r(m(P).deleteUsageInfo.value, (e, t) => (c(), p("div", {
|
|
5910
5914
|
key: t,
|
|
5911
5915
|
class: "tpl:text-xs",
|
|
5912
5916
|
style: { color: "var(--tpl-text)" }
|
|
5913
|
-
}, [e.template_count > 0 ? (c(), p(v, { key: 0 }, [w("span", Oa, C(m(
|
|
5917
|
+
}, [e.template_count > 0 ? (c(), p(v, { key: 0 }, [w("span", Oa, C(m(I).displayItems.value.find((e) => e.id === t)?.filename || t), 1), w("span", ka, " - " + C(m(l).mediaLibrary.usedInTemplates.replace("{count}", e.template_count.toString())), 1)], 64)) : b("", !0)]))), 128))])) : b("", !0),
|
|
5914
5918
|
w("div", Aa, [w("button", {
|
|
5915
5919
|
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",
|
|
5916
5920
|
style: {
|
|
@@ -5918,7 +5922,7 @@ var Ji = ["data-tpl-theme"], Yi = {
|
|
|
5918
5922
|
color: "var(--tpl-text)",
|
|
5919
5923
|
"background-color": "var(--tpl-bg)"
|
|
5920
5924
|
},
|
|
5921
|
-
onClick: n[10] ||= (...e) => m(
|
|
5925
|
+
onClick: n[10] ||= (...e) => m(P).cancelDelete && m(P).cancelDelete(...e)
|
|
5922
5926
|
}, C(m(l).mediaLibrary.cancel), 1), w("button", {
|
|
5923
5927
|
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",
|
|
5924
5928
|
style: {
|
|
@@ -5926,57 +5930,57 @@ var Ji = ["data-tpl-theme"], Yi = {
|
|
|
5926
5930
|
color: "var(--tpl-danger)",
|
|
5927
5931
|
"background-color": "var(--tpl-danger-light)"
|
|
5928
5932
|
},
|
|
5929
|
-
onClick: n[11] ||= (...e) => m(
|
|
5930
|
-
}, C(m(
|
|
5933
|
+
onClick: n[11] ||= (...e) => m(P).confirmDelete && m(P).confirmDelete(...e)
|
|
5934
|
+
}, C(m(I).hasUsedFiles.value ? m(l).mediaLibrary.deleteAnyway : m(l).mediaLibrary.confirmDelete), 1)])
|
|
5931
5935
|
])])) : b("", !0)]),
|
|
5932
5936
|
_: 1
|
|
5933
5937
|
}),
|
|
5934
|
-
w("div", ja, [w("div", Ma, [m(
|
|
5938
|
+
w("div", ja, [w("div", Ma, [m(P).previewItem.value ? (c(), x(xi, {
|
|
5935
5939
|
key: 0,
|
|
5936
|
-
"selected-conversion": m(
|
|
5937
|
-
"onUpdate:selectedConversion": n[13] ||= (e) => m(
|
|
5938
|
-
item: m(
|
|
5939
|
-
folders: m(
|
|
5940
|
+
"selected-conversion": m(I).selectedConversion.value,
|
|
5941
|
+
"onUpdate:selectedConversion": n[13] ||= (e) => m(I).selectedConversion.value = e,
|
|
5942
|
+
item: m(P).previewItem.value,
|
|
5943
|
+
folders: m(P).folders.value
|
|
5940
5944
|
}, null, 8, [
|
|
5941
5945
|
"selected-conversion",
|
|
5942
5946
|
"item",
|
|
5943
5947
|
"folders"
|
|
5944
|
-
])) : b("", !0)]), w("div", Na, [m(
|
|
5948
|
+
])) : b("", !0)]), w("div", Na, [m(P).selectedItems.value.size > 0 ? (c(), p("div", Pa, [m(P).previewItem.value ? (c(), p("button", {
|
|
5945
5949
|
key: 0,
|
|
5946
5950
|
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",
|
|
5947
5951
|
style: _({
|
|
5948
|
-
borderColor: m(
|
|
5949
|
-
color: m(
|
|
5952
|
+
borderColor: m(I).copied.value ? "var(--tpl-success)" : "var(--tpl-border)",
|
|
5953
|
+
color: m(I).copied.value ? "var(--tpl-success)" : "var(--tpl-text)",
|
|
5950
5954
|
backgroundColor: "var(--tpl-bg)"
|
|
5951
5955
|
}),
|
|
5952
|
-
onClick: n[14] ||= (e) => m(
|
|
5953
|
-
}, [m(
|
|
5956
|
+
onClick: n[14] ||= (e) => m(I).copy(m(I).selectedUrl.value)
|
|
5957
|
+
}, [m(I).copied.value ? (c(), x(m(F), {
|
|
5954
5958
|
key: 1,
|
|
5955
5959
|
size: 12,
|
|
5956
5960
|
"stroke-width": 2
|
|
5957
|
-
})) : (c(), x(m(
|
|
5961
|
+
})) : (c(), x(m(ue), {
|
|
5958
5962
|
key: 0,
|
|
5959
5963
|
size: 12,
|
|
5960
5964
|
"stroke-width": 2
|
|
5961
|
-
})), A(" " + C(m(
|
|
5965
|
+
})), A(" " + C(m(I).copied.value ? m(l).mediaLibrary.copied : m(l).mediaLibrary.copyUrl), 1)], 4)) : b("", !0), D.value ? (c(), p("div", Fa, [w("button", {
|
|
5962
5966
|
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",
|
|
5963
5967
|
style: {
|
|
5964
5968
|
"border-color": "var(--tpl-border)",
|
|
5965
5969
|
color: "var(--tpl-text)",
|
|
5966
5970
|
"background-color": "var(--tpl-bg)"
|
|
5967
5971
|
},
|
|
5968
|
-
onClick: n[15] ||= (e) => m(
|
|
5969
|
-
}, C(m(l).mediaLibrary.moveSelected), 1), m(
|
|
5972
|
+
onClick: n[15] ||= (e) => m(I).showMovePicker.value = !m(I).showMovePicker.value
|
|
5973
|
+
}, C(m(l).mediaLibrary.moveSelected), 1), m(I).showMovePicker.value ? (c(), x(ui, {
|
|
5970
5974
|
key: 0,
|
|
5971
|
-
folders: m(
|
|
5972
|
-
"current-folder-id": m(
|
|
5973
|
-
onSelect: m(
|
|
5974
|
-
onClose: n[16] ||= (e) => m(
|
|
5975
|
+
folders: m(P).folders.value,
|
|
5976
|
+
"current-folder-id": m(P).currentFolderId.value,
|
|
5977
|
+
onSelect: m(I).handleMoveToFolder,
|
|
5978
|
+
onClose: n[16] ||= (e) => m(I).showMovePicker.value = !1
|
|
5975
5979
|
}, null, 8, [
|
|
5976
5980
|
"folders",
|
|
5977
5981
|
"current-folder-id",
|
|
5978
5982
|
"onSelect"
|
|
5979
|
-
])) : b("", !0)])) : b("", !0)])) : b("", !0), w("div", Ia, [m(
|
|
5983
|
+
])) : b("", !0)])) : b("", !0)])) : b("", !0), w("div", Ia, [m(P).selectedItems.value.size > 0 ? (c(), p("button", {
|
|
5980
5984
|
key: 0,
|
|
5981
5985
|
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",
|
|
5982
5986
|
style: {
|
|
@@ -5984,15 +5988,15 @@ var Ji = ["data-tpl-theme"], Yi = {
|
|
|
5984
5988
|
color: "var(--tpl-danger)",
|
|
5985
5989
|
"background-color": "var(--tpl-danger-light)"
|
|
5986
5990
|
},
|
|
5987
|
-
onClick: n[17] ||= (...e) => m(
|
|
5991
|
+
onClick: n[17] ||= (...e) => m(I).handleDeleteClick && m(I).handleDeleteClick(...e)
|
|
5988
5992
|
}, C(m(l).mediaLibrary.deleteSelected), 1)) : b("", !0), w("button", {
|
|
5989
5993
|
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",
|
|
5990
5994
|
style: {
|
|
5991
5995
|
"background-color": "var(--tpl-primary)",
|
|
5992
5996
|
color: "var(--tpl-bg)"
|
|
5993
5997
|
},
|
|
5994
|
-
disabled: !
|
|
5995
|
-
onClick:
|
|
5998
|
+
disabled: !re(),
|
|
5999
|
+
onClick: R
|
|
5996
6000
|
}, C(e.accept?.length ? m(l).mediaLibrary.selectImage : m(l).mediaLibrary.selectFile), 9, La)])])])
|
|
5997
6001
|
])], 8, Ji)) : b("", !0)]),
|
|
5998
6002
|
_: 1
|
|
@@ -6000,6 +6004,6 @@ var Ji = ["data-tpl-theme"], Yi = {
|
|
|
6000
6004
|
}
|
|
6001
6005
|
});
|
|
6002
6006
|
//#endregion
|
|
6003
|
-
export { Ii as a, ai as c, rr as d,
|
|
6007
|
+
export { Ii as a, ai as c, rr as d, Ee as f, be as g, xe as h, Vi as i, qr as l, z as m, qi as n, xi as o, Te as p, Ki as r, ui as s, Ra as t, gr as u };
|
|
6004
6008
|
|
|
6005
|
-
//# sourceMappingURL=media-library-
|
|
6009
|
+
//# sourceMappingURL=media-library-Dgy-V-JA.js.map
|