@orangelogic/design-system 2.191.0 → 2.192.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/library/chunks/{asset-link-format.CEDcHah6.js → asset-link-format.CDd4iPA2.js} +1141 -992
- package/library/chunks/{color-swatch-group.tnhiQ0jp.js → color-swatch-group.NOcRP-23.js} +4 -3
- package/library/chunks/{confirm-popover.CrQKEChc.js → confirm-popover.jCP9CdcD.js} +1 -1
- package/library/chunks/content-builder.BX4pHujE.js +60 -0
- package/library/chunks/{dialog.CWGtufDA.js → dialog.B6hZ7fvn.js} +2 -2
- package/library/chunks/{document-viewer.C90j1Xrr.js → document-viewer.CRluR-_W.js} +3 -2
- package/library/chunks/{image.CTMzUqCC.js → image.CiQwSDfe.js} +186 -187
- package/library/chunks/{toast.CXEAfCvN.js → toast.C5Ir5yKA.js} +1 -1
- package/library/chunks/transformation.BfIEi4p4.js +300 -0
- package/library/components/asset-link-format.js +2 -2
- package/library/components/atoms.js +3 -3
- package/library/components/color-swatch-group.js +3 -3
- package/library/components/confirm-popover.js +2 -2
- package/library/components/cropper.js +1 -1
- package/library/components/dialog.js +1 -1
- package/library/components/document-viewer.js +2 -2
- package/library/components/drawer.js +2 -2
- package/library/components/file-on-demand.js +2 -2
- package/library/components/image.js +2 -3
- package/library/components/masonry.js +136 -107
- package/library/components/molecules.js +1 -1
- package/library/components/organisms.js +2 -2
- package/library/components/popup.js +100 -97
- package/library/components/select.js +16 -11
- package/library/components/types.js +21757 -21460
- package/library/components/video.js +1 -1
- package/library/package.json +1 -1
- package/library/packages/atoms/src/components/image/image.d.ts +36 -4
- package/library/packages/atoms/src/components/popup/popup.d.ts +11 -0
- package/library/packages/atoms/src/components/select/select.d.ts +8 -0
- package/library/packages/events/src/cx-asset-transformation-dialog-confirm.d.ts +2 -0
- package/library/packages/molecules/src/cropper/cropper.d.ts +0 -1
- package/library/packages/molecules/src/cropper/react/Cropper.d.ts +0 -1
- package/library/packages/molecules/src/gallery-item/gallery-item.d.ts +10 -0
- package/library/packages/molecules/src/masonry/masonry.d.ts +24 -0
- package/library/packages/organisms/src/asset-link-format/asset-link-format.d.ts +46 -2
- package/library/packages/organisms/src/asset-link-format/components/asset-link-format-proxy/asset-link-format-proxy.d.ts +36 -1
- package/library/packages/organisms/src/asset-transformation-dialog/asset-transformation-dialog.d.ts +20 -2
- package/library/packages/organisms/src/bento-grid/bento-grid.d.ts +101 -0
- package/library/packages/organisms/src/carousel/carousel.d.ts +26 -0
- package/library/packages/organisms/src/content-builder/blocks/image/image.d.ts +65 -1
- package/library/packages/organisms/src/content-builder/blocks/video/video.d.ts +5 -0
- package/library/packages/organisms/src/content-builder/components/config-form/config-form.d.ts +2 -1
- package/library/packages/organisms/src/content-builder/components/gallery-picker/gallery-picker.d.ts +6 -0
- package/library/packages/organisms/src/content-builder/configs/carousel.d.ts +1 -0
- package/library/packages/organisms/src/content-builder/configs/gallery.d.ts +1 -0
- package/library/packages/organisms/src/content-builder/configs/image.d.ts +2 -0
- package/library/packages/organisms/src/content-builder/configs/timeline.d.ts +1 -0
- package/library/packages/organisms/src/content-builder/configs/video.d.ts +1 -0
- package/library/packages/organisms/src/content-builder/configs-controller.d.ts +10 -0
- package/library/packages/organisms/src/content-builder/styleController.d.ts +2 -0
- package/library/packages/tools/src/fetch-image/fetch-image.d.ts +28 -5
- package/library/packages/types/src/asset-link-format.d.ts +0 -1
- package/library/packages/types/src/content-builder.d.ts +7 -0
- package/library/packages/types/src/gallery-item.d.ts +1 -0
- package/library/packages/types/src/masonry.d.ts +1 -0
- package/library/packages/utils/src/transformation/transformation.d.ts +91 -0
- package/library/react-web-component.d.ts +63 -7
- package/library/utils.js +192 -182
- package/package.json +1 -1
- package/library/chunks/transformation.8uLv6uwG.js +0 -264
|
@@ -2,48 +2,49 @@ import "../components/cropper.js";
|
|
|
2
2
|
import { C as Z } from "./button.BnkkUqiI.js";
|
|
3
3
|
import L from "../components/space.js";
|
|
4
4
|
import { C as U } from "./typography.IqHbnd3C.js";
|
|
5
|
-
import { n as
|
|
6
|
-
import { h as I, a as
|
|
5
|
+
import { n as h, C as B } from "./lib-cortex-element.CVMmyPMC.js";
|
|
6
|
+
import { h as I, a as Wt, C as Dt, S as Gt, b as Qt, c as Kt, d as Xt } from "./endpoints.mJ5S-tIs.js";
|
|
7
7
|
import "./browser.BHOCIF_A.js";
|
|
8
|
-
import { i as q, x as
|
|
8
|
+
import { i as q, x as C, E as Nt } from "./lit-element.jLBm65_O.js";
|
|
9
9
|
import "./form.DSsy3Fcy.js";
|
|
10
10
|
import { L as j } from "./i18n.DbXTTLXx.js";
|
|
11
|
-
import { a as
|
|
11
|
+
import { a as Zt } from "./string.CfI2ejyR.js";
|
|
12
12
|
import "./date-picker.BGHn6qg8.js";
|
|
13
|
-
import
|
|
13
|
+
import "./content-builder.BX4pHujE.js";
|
|
14
14
|
import "./unsafe-html.Dff7-rCx.js";
|
|
15
|
-
import {
|
|
15
|
+
import { a as $t, r as Ot, c as rt } from "./transformation.BfIEi4p4.js";
|
|
16
|
+
import { b as Yt } from "./_baseUniq.lwMgmtt2.js";
|
|
16
17
|
import { c as V } from "./component.styles.CRO4Odto.js";
|
|
17
|
-
import { v as
|
|
18
|
-
import { U as
|
|
19
|
-
import { P as
|
|
18
|
+
import { v as Jt } from "./v4.CKZ6klMF.js";
|
|
19
|
+
import { U as r, T as m } from "./asset-link-format.ClaYu_v8.js";
|
|
20
|
+
import { P as D } from "./position-picker.DjnhxIKF.js";
|
|
20
21
|
import { c as G } from "./custom-element.L4WJXn1j.js";
|
|
21
|
-
import { w as
|
|
22
|
-
import { s as
|
|
23
|
-
import { r as
|
|
24
|
-
import { n as
|
|
22
|
+
import { w as P } from "./watch.DJF5K-8U.js";
|
|
23
|
+
import { s as Ft, a as nt } from "./number.Cx2ncfJJ.js";
|
|
24
|
+
import { r as b } from "./state.CSDxrqLd.js";
|
|
25
|
+
import { n as _ } from "./when.Dr1es41R.js";
|
|
25
26
|
import et from "../components/details.js";
|
|
26
|
-
import
|
|
27
|
+
import Lt from "../components/divider.js";
|
|
27
28
|
import { C as it } from "./icon.CpHbi8tH.js";
|
|
28
|
-
import { C as
|
|
29
|
-
import { C as
|
|
29
|
+
import { C as bt } from "./icon-button.CVrxJcZq.js";
|
|
30
|
+
import { C as kt } from "./input.33UmFGqR.js";
|
|
30
31
|
import { C as gt } from "./option.B6odSlS2.js";
|
|
31
32
|
import xt from "../components/select.js";
|
|
32
|
-
import
|
|
33
|
-
import { c as
|
|
33
|
+
import te from "../components/position-picker.js";
|
|
34
|
+
import { c as ee } from "./image.Y5c_hFx8.js";
|
|
34
35
|
import { e as Y } from "./query.BBf1UFkC.js";
|
|
35
|
-
import { c as
|
|
36
|
-
import { o as
|
|
37
|
-
import
|
|
38
|
-
import
|
|
39
|
-
import
|
|
40
|
-
function se(t) {
|
|
41
|
-
return t && t.length ? Kt(t) : [];
|
|
42
|
-
}
|
|
36
|
+
import { c as at } from "./repeat.CFjcER6_.js";
|
|
37
|
+
import { o as N } from "./style-map.llVFPd__.js";
|
|
38
|
+
import Ut from "../components/tooltip.js";
|
|
39
|
+
import ie from "../components/button-group.js";
|
|
40
|
+
import se from "../components/checkbox.js";
|
|
43
41
|
function ae(t) {
|
|
42
|
+
return t && t.length ? Yt(t) : [];
|
|
43
|
+
}
|
|
44
|
+
function oe(t) {
|
|
44
45
|
return typeof t == "object" && t !== null && "URI" in t;
|
|
45
46
|
}
|
|
46
|
-
const
|
|
47
|
+
const re = {
|
|
47
48
|
artist: "Artist",
|
|
48
49
|
color: "Color",
|
|
49
50
|
createDate: "CreateDate",
|
|
@@ -65,54 +66,54 @@ const oe = {
|
|
|
65
66
|
systemIdentifier: "SystemIdentifier",
|
|
66
67
|
text: "Text",
|
|
67
68
|
title: "Title"
|
|
68
|
-
},
|
|
69
|
+
}, ne = /* @__PURE__ */ new Set(["mediaDate", "createDate", "editDate"]);
|
|
69
70
|
function zt(t) {
|
|
70
71
|
return !/[\s&+/*"\\:(),'<>~|[\]{}]/.test(t) && !/^(?:OR|AND|NOT)$/.test(t) ? t : `"${t.replace(/\\/g, "\\\\").replace(/"/g, '\\"')}"`;
|
|
71
72
|
}
|
|
72
|
-
function
|
|
73
|
+
function _t(t, e) {
|
|
73
74
|
const s = (Array.isArray(e) ? e : [e]).map((a) => `${t}:${zt(a)}`);
|
|
74
75
|
return s.length > 1 ? `(${s.join(" OR ")})` : s[0] ?? "";
|
|
75
76
|
}
|
|
76
|
-
function
|
|
77
|
+
function he(t, e) {
|
|
77
78
|
return (Array.isArray(e) ? e : [e]).map((s) => `${t}${s.operator}${s.value}`).join(" AND ");
|
|
78
79
|
}
|
|
79
|
-
function
|
|
80
|
+
function le(t) {
|
|
80
81
|
const e = [];
|
|
81
82
|
for (const i of Object.keys(t)) {
|
|
82
83
|
const s = i, a = t[s];
|
|
83
84
|
if (a == null)
|
|
84
85
|
continue;
|
|
85
86
|
if (s === "custom") {
|
|
86
|
-
for (const [n,
|
|
87
|
+
for (const [n, l] of Object.entries(
|
|
87
88
|
a
|
|
88
89
|
))
|
|
89
|
-
e.push(
|
|
90
|
+
e.push(_t(n, l));
|
|
90
91
|
continue;
|
|
91
92
|
}
|
|
92
|
-
const
|
|
93
|
-
if (
|
|
94
|
-
if (
|
|
93
|
+
const o = re[s];
|
|
94
|
+
if (o) {
|
|
95
|
+
if (ne.has(s)) {
|
|
95
96
|
e.push(
|
|
96
|
-
|
|
97
|
+
he(o, a)
|
|
97
98
|
);
|
|
98
99
|
continue;
|
|
99
100
|
}
|
|
100
101
|
if (s === "color") {
|
|
101
|
-
e.push(`${
|
|
102
|
+
e.push(`${o}:${a}`);
|
|
102
103
|
continue;
|
|
103
104
|
}
|
|
104
105
|
if (s === "parentFolderIdentifier") {
|
|
105
106
|
const n = Array.isArray(a) ? a : [a];
|
|
106
107
|
if (n.length === 0)
|
|
107
108
|
continue;
|
|
108
|
-
const
|
|
109
|
-
...n.map((
|
|
110
|
-
...n.map((
|
|
109
|
+
const l = [
|
|
110
|
+
...n.map((d) => `ParentFolderIdentifier:${zt(String(d))}`),
|
|
111
|
+
...n.map((d) => `ParentAlbumIdentifier:${zt(String(d))}`)
|
|
111
112
|
];
|
|
112
|
-
e.push(`(${
|
|
113
|
+
e.push(`(${l.join(" OR ")})`);
|
|
113
114
|
continue;
|
|
114
115
|
}
|
|
115
|
-
e.push(
|
|
116
|
+
e.push(_t(o, a));
|
|
116
117
|
}
|
|
117
118
|
}
|
|
118
119
|
return e.join(" AND ");
|
|
@@ -128,98 +129,98 @@ function ht(t) {
|
|
|
128
129
|
const e = ht(t.not);
|
|
129
130
|
return e ? `NOT (${e})` : "";
|
|
130
131
|
}
|
|
131
|
-
return
|
|
132
|
+
return le(t);
|
|
132
133
|
}
|
|
133
|
-
const
|
|
134
|
+
const ce = "CoreField.LargeSizePreview", lt = "CoreField.DocType", pe = "Document.Title", de = "Document.CaptionLong", ot = "Document.FileExtension", ct = "CoreField.FileSize", Mt = "CoreField.Identifier", It = "CoreField.Keywords", pt = "CoreField.MaxHeight", dt = "CoreField.MaxWidth", ut = "Document.RecordID", Et = "CoreField.DocSubType", Bt = "CoreField.TitleWithFallback", mt = "CoreField.OriginalFileName", ft = "CoreField.UpdatedFileName", ue = "CoreField.OriginalPreview", Hi = "Document.DocSubType", Ti = "Document.InPoint", Wi = "Document.OutPoint", St = {
|
|
134
135
|
DEFAULT_VIEW_SIZE: "Document.LargeSizePreview",
|
|
135
136
|
FIELD_TITLE_WITH_FALLBACK: "Document.TitleWithFallback",
|
|
136
137
|
ORIGINAL_VIEW_SIZE: "Document.OriginalPreview"
|
|
137
|
-
},
|
|
138
|
-
[
|
|
139
|
-
[
|
|
140
|
-
[
|
|
141
|
-
},
|
|
142
|
-
Object.entries(
|
|
138
|
+
}, qt = {
|
|
139
|
+
[ce]: St.DEFAULT_VIEW_SIZE,
|
|
140
|
+
[Bt]: St.FIELD_TITLE_WITH_FALLBACK,
|
|
141
|
+
[ue]: St.ORIGINAL_VIEW_SIZE
|
|
142
|
+
}, me = Object.fromEntries(
|
|
143
|
+
Object.entries(qt).map(([t, e]) => [
|
|
143
144
|
e,
|
|
144
145
|
t
|
|
145
146
|
])
|
|
146
147
|
);
|
|
147
|
-
function
|
|
148
|
-
return
|
|
148
|
+
function fe(t) {
|
|
149
|
+
return qt[t] ?? t;
|
|
149
150
|
}
|
|
150
151
|
function Ht(t) {
|
|
151
152
|
const e = {};
|
|
152
153
|
for (const [i, s] of Object.entries(t)) {
|
|
153
|
-
const a =
|
|
154
|
+
const a = me[i] ?? i;
|
|
154
155
|
e[a] = s;
|
|
155
156
|
}
|
|
156
157
|
return e;
|
|
157
158
|
}
|
|
158
|
-
function
|
|
159
|
+
function ge(t) {
|
|
159
160
|
const e = new URLSearchParams();
|
|
160
161
|
for (const [i, s] of Object.entries(t))
|
|
161
162
|
s != null && (Array.isArray(s) ? s.forEach((a) => e.append(i, String(a))) : e.append(i, String(s)));
|
|
162
163
|
return e;
|
|
163
164
|
}
|
|
164
|
-
async function
|
|
165
|
+
async function jt({
|
|
165
166
|
countPerPage: t,
|
|
166
167
|
fields: e,
|
|
167
168
|
getPermanentAssetsPaths: i,
|
|
168
169
|
httpMethod: s = "GET",
|
|
169
170
|
isSiteBuilder: a,
|
|
170
|
-
pageNumber:
|
|
171
|
+
pageNumber: o,
|
|
171
172
|
query: n,
|
|
172
|
-
securityByPassToken:
|
|
173
|
-
siteUrl:
|
|
174
|
-
sort:
|
|
173
|
+
securityByPassToken: l,
|
|
174
|
+
siteUrl: d,
|
|
175
|
+
sort: g,
|
|
175
176
|
token: c,
|
|
176
|
-
useSession:
|
|
177
|
+
useSession: S
|
|
177
178
|
}) {
|
|
178
|
-
const
|
|
179
|
+
const A = e?.map(fe), p = {
|
|
179
180
|
CountPerPage: t,
|
|
180
|
-
Fields:
|
|
181
|
+
Fields: ae(A),
|
|
181
182
|
Format: "json",
|
|
182
183
|
GetPermanentAssetsPaths: i || void 0,
|
|
183
|
-
PageNumber:
|
|
184
|
+
PageNumber: o,
|
|
184
185
|
Query: ht(n),
|
|
185
|
-
SecurityByPassToken:
|
|
186
|
-
Sort:
|
|
187
|
-
UseSession:
|
|
188
|
-
},
|
|
186
|
+
SecurityByPassToken: l || void 0,
|
|
187
|
+
Sort: g || void 0,
|
|
188
|
+
UseSession: S || void 0
|
|
189
|
+
}, y = s === "POST";
|
|
189
190
|
try {
|
|
190
191
|
return (await I.request({
|
|
191
|
-
baseURL:
|
|
192
|
+
baseURL: d,
|
|
192
193
|
headers: c ? { Authorization: `Bearer ${c}` } : void 0,
|
|
193
194
|
method: s,
|
|
194
195
|
// POST large RecordID queries as a urlencoded body to dodge the ~2KB URL cap;
|
|
195
196
|
// GET keeps the same fields on the query string.
|
|
196
|
-
...
|
|
197
|
+
...y ? { data: ge(p) } : { params: p, paramsSerializer: { indexes: null } },
|
|
197
198
|
responseType: "json",
|
|
198
199
|
transformResponse: [
|
|
199
200
|
...Array.isArray(I.defaults.transformResponse) ? I.defaults.transformResponse : [],
|
|
200
|
-
a ? (
|
|
201
|
-
items: (
|
|
202
|
-
sort:
|
|
203
|
-
totalCount:
|
|
204
|
-
}) : (
|
|
205
|
-
items: (
|
|
206
|
-
sort:
|
|
207
|
-
totalCount:
|
|
201
|
+
a ? (f) => ({
|
|
202
|
+
items: (f.results?.Items ?? []).map(Ht),
|
|
203
|
+
sort: f.results?.GlobalInfo?.Sort ?? "",
|
|
204
|
+
totalCount: f.results?.GlobalInfo?.TotalCount ?? 0
|
|
205
|
+
}) : (f) => ({
|
|
206
|
+
items: (f.APIResponse?.Items ?? []).map(Ht),
|
|
207
|
+
sort: f.APIResponse?.GlobalInfo?.Sort ?? "",
|
|
208
|
+
totalCount: f.APIResponse?.GlobalInfo?.TotalCount ?? 0
|
|
208
209
|
})
|
|
209
210
|
],
|
|
210
|
-
url: a ?
|
|
211
|
+
url: a ? Dt.SEARCH_ASSETS : Gt["4.0"]
|
|
211
212
|
})).data;
|
|
212
213
|
} catch {
|
|
213
214
|
return { items: [], sort: "", totalCount: 0 };
|
|
214
215
|
}
|
|
215
216
|
}
|
|
216
|
-
async function
|
|
217
|
+
async function xe({
|
|
217
218
|
assetId: t,
|
|
218
219
|
extension: e,
|
|
219
220
|
format: i,
|
|
220
221
|
siteUrl: s,
|
|
221
222
|
token: a,
|
|
222
|
-
transformations:
|
|
223
|
+
transformations: o,
|
|
223
224
|
useSession: n
|
|
224
225
|
}) {
|
|
225
226
|
try {
|
|
@@ -229,9 +230,9 @@ async function me({
|
|
|
229
230
|
params: {
|
|
230
231
|
SourceAssetFormat: i,
|
|
231
232
|
SourceAssetRecordID: t,
|
|
232
|
-
TargetExtension:
|
|
233
|
+
TargetExtension: Zt(e),
|
|
233
234
|
Token: a || void 0,
|
|
234
|
-
Transformations:
|
|
235
|
+
Transformations: o,
|
|
235
236
|
UseSession: n || void 0
|
|
236
237
|
},
|
|
237
238
|
/**
|
|
@@ -239,109 +240,105 @@ async function me({
|
|
|
239
240
|
*/
|
|
240
241
|
timeout: 3e5,
|
|
241
242
|
// 5 minutes
|
|
242
|
-
url:
|
|
243
|
+
url: Wt.GET_TRANSFORM_ASSET_LINK
|
|
243
244
|
})).data;
|
|
244
245
|
} catch {
|
|
245
246
|
return null;
|
|
246
247
|
}
|
|
247
248
|
}
|
|
248
|
-
const
|
|
249
|
-
function
|
|
249
|
+
const ye = 50;
|
|
250
|
+
function Se(t, e) {
|
|
250
251
|
const i = [];
|
|
251
252
|
for (let s = 0; s < t.length; s += e)
|
|
252
253
|
i.push(t.slice(s, s + e));
|
|
253
254
|
return i;
|
|
254
255
|
}
|
|
255
|
-
async function
|
|
256
|
+
async function Ae({
|
|
256
257
|
extraFields: t,
|
|
257
258
|
getPermanentAssetsPaths: e,
|
|
258
259
|
isSiteBuilder: i,
|
|
259
260
|
recordIds: s,
|
|
260
261
|
securityByPassToken: a,
|
|
261
|
-
token:
|
|
262
|
+
token: o
|
|
262
263
|
}) {
|
|
263
264
|
if (!Array.isArray(s) || s.length === 0)
|
|
264
265
|
return { facets: [], items: [], totalCount: 0 };
|
|
265
|
-
const n = t?.filter((
|
|
266
|
+
const n = t?.filter((p) => p && typeof p == "string") ?? [], l = [
|
|
266
267
|
...n,
|
|
267
|
-
tt,
|
|
268
268
|
ft,
|
|
269
269
|
mt,
|
|
270
|
-
|
|
271
|
-
|
|
270
|
+
pe,
|
|
271
|
+
de,
|
|
272
272
|
ut
|
|
273
|
-
],
|
|
274
|
-
|
|
275
|
-
(
|
|
276
|
-
countPerPage:
|
|
277
|
-
fields:
|
|
273
|
+
], d = Se(s, ye), g = await Promise.all(
|
|
274
|
+
d.map(
|
|
275
|
+
(p) => jt({
|
|
276
|
+
countPerPage: p.length,
|
|
277
|
+
fields: l,
|
|
278
278
|
getPermanentAssetsPaths: e,
|
|
279
279
|
httpMethod: i ? "GET" : "POST",
|
|
280
280
|
isSiteBuilder: i,
|
|
281
281
|
pageNumber: 1,
|
|
282
|
-
query: { recordId:
|
|
282
|
+
query: { recordId: p },
|
|
283
283
|
securityByPassToken: a,
|
|
284
|
-
token:
|
|
284
|
+
token: o
|
|
285
285
|
})
|
|
286
286
|
)
|
|
287
|
-
), c = new Map(s.map((
|
|
288
|
-
let
|
|
289
|
-
return
|
|
290
|
-
name:
|
|
291
|
-
|
|
292
|
-
recordId: k(d, ut),
|
|
287
|
+
), c = new Map(s.map((p, y) => [p, y])), S = g.flatMap((p) => p.items).map((p) => {
|
|
288
|
+
let y = $(p, ft);
|
|
289
|
+
return y === "" && (y = $(p, mt)), {
|
|
290
|
+
name: y,
|
|
291
|
+
recordId: $(p, ut),
|
|
293
292
|
...n.reduce(
|
|
294
|
-
(
|
|
293
|
+
(k, f) => (k[f] = $(p, f), k),
|
|
295
294
|
{}
|
|
296
295
|
)
|
|
297
296
|
};
|
|
298
297
|
}).sort(
|
|
299
|
-
(
|
|
300
|
-
),
|
|
301
|
-
(
|
|
298
|
+
(p, y) => (c.get(p.recordId) ?? 1 / 0) - (c.get(y.recordId) ?? 1 / 0)
|
|
299
|
+
), A = g.reduce(
|
|
300
|
+
(p, y) => p + y.totalCount,
|
|
302
301
|
0
|
|
303
302
|
);
|
|
304
|
-
return { facets: [], items:
|
|
303
|
+
return { facets: [], items: S, totalCount: A };
|
|
305
304
|
}
|
|
306
|
-
function
|
|
305
|
+
function $(t, e) {
|
|
307
306
|
const i = t[e];
|
|
308
|
-
return i == null ? "" : typeof i == "string" ? i : typeof i == "number" || typeof i == "boolean" ? String(i) :
|
|
307
|
+
return i == null ? "" : typeof i == "string" ? i : typeof i == "number" || typeof i == "boolean" ? String(i) : oe(i) ? i.URI : "";
|
|
309
308
|
}
|
|
310
|
-
async function
|
|
309
|
+
async function ve({
|
|
311
310
|
countPerPage: t,
|
|
312
311
|
directParentFolderIdentifier: e,
|
|
313
312
|
extraFields: i,
|
|
314
313
|
getPermanentAssetsPaths: s,
|
|
315
314
|
isSiteBuilder: a,
|
|
316
|
-
limitedDocTypes:
|
|
315
|
+
limitedDocTypes: o,
|
|
317
316
|
pageNumber: n,
|
|
318
|
-
parentFolderIdentifier:
|
|
319
|
-
searchTerm:
|
|
320
|
-
securityByPassToken:
|
|
317
|
+
parentFolderIdentifier: l,
|
|
318
|
+
searchTerm: d,
|
|
319
|
+
securityByPassToken: g,
|
|
321
320
|
sortOrder: c,
|
|
322
|
-
token:
|
|
321
|
+
token: S
|
|
323
322
|
}) {
|
|
324
|
-
if (!e && !
|
|
323
|
+
if (!e && !l)
|
|
325
324
|
return { facets: [], items: [], totalCount: 0 };
|
|
326
|
-
const
|
|
325
|
+
const A = (i?.filter((f) => f && typeof f == "string") ?? []).map((f) => f.replace("%20", " ")), p = {
|
|
327
326
|
directParentFolderIdentifier: e,
|
|
328
|
-
parentFolderIdentifier:
|
|
329
|
-
...
|
|
330
|
-
},
|
|
327
|
+
parentFolderIdentifier: l,
|
|
328
|
+
...o && o.length > 0 ? { docType: o } : {}
|
|
329
|
+
}, y = await jt({
|
|
331
330
|
countPerPage: t,
|
|
332
331
|
fields: [
|
|
333
|
-
...
|
|
334
|
-
|
|
335
|
-
wt,
|
|
336
|
-
tt,
|
|
332
|
+
...A,
|
|
333
|
+
Bt,
|
|
337
334
|
It,
|
|
338
335
|
dt,
|
|
339
336
|
pt,
|
|
340
|
-
|
|
337
|
+
ct,
|
|
341
338
|
lt,
|
|
342
339
|
Et,
|
|
343
340
|
Mt,
|
|
344
|
-
|
|
341
|
+
ot,
|
|
345
342
|
ut,
|
|
346
343
|
mt,
|
|
347
344
|
ft
|
|
@@ -349,41 +346,39 @@ async function ye({
|
|
|
349
346
|
getPermanentAssetsPaths: s,
|
|
350
347
|
isSiteBuilder: a,
|
|
351
348
|
pageNumber: n,
|
|
352
|
-
query:
|
|
353
|
-
securityByPassToken:
|
|
349
|
+
query: p,
|
|
350
|
+
securityByPassToken: g,
|
|
354
351
|
sort: void 0,
|
|
355
|
-
token:
|
|
356
|
-
}),
|
|
357
|
-
let
|
|
358
|
-
|
|
359
|
-
const
|
|
352
|
+
token: S
|
|
353
|
+
}), k = y.items.map((f) => {
|
|
354
|
+
let F = $(f, ot), tt = $(f, ft);
|
|
355
|
+
F && !F.startsWith(".") && (F = "." + F), tt === "" && (tt = $(f, mt));
|
|
356
|
+
const E = $(f, ut);
|
|
360
357
|
return {
|
|
361
|
-
docSubType:
|
|
362
|
-
docType:
|
|
363
|
-
extension:
|
|
364
|
-
height:
|
|
365
|
-
id:
|
|
366
|
-
identifier:
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
...y.reduce(
|
|
375
|
-
(X, at) => (X[at] = k(u, at), X),
|
|
358
|
+
docSubType: $(f, Et),
|
|
359
|
+
docType: $(f, lt) || "",
|
|
360
|
+
extension: F,
|
|
361
|
+
height: $(f, pt) || "0",
|
|
362
|
+
id: E,
|
|
363
|
+
identifier: $(f, Mt),
|
|
364
|
+
name: tt,
|
|
365
|
+
recordId: E,
|
|
366
|
+
size: $(f, ct) || "0 MB",
|
|
367
|
+
tags: $(f, It),
|
|
368
|
+
width: $(f, dt) || "0",
|
|
369
|
+
...A.reduce(
|
|
370
|
+
(K, st) => (K[st] = $(f, st), K),
|
|
376
371
|
{}
|
|
377
372
|
)
|
|
378
373
|
};
|
|
379
374
|
});
|
|
380
375
|
return {
|
|
381
376
|
facets: [],
|
|
382
|
-
items:
|
|
383
|
-
totalCount:
|
|
377
|
+
items: k,
|
|
378
|
+
totalCount: y.totalCount
|
|
384
379
|
};
|
|
385
380
|
}
|
|
386
|
-
async function
|
|
381
|
+
async function ze({
|
|
387
382
|
autoCropMode: t,
|
|
388
383
|
cropHeight: e,
|
|
389
384
|
cropWidth: i,
|
|
@@ -412,13 +407,13 @@ async function Se({
|
|
|
412
407
|
y: n.cropY
|
|
413
408
|
})
|
|
414
409
|
],
|
|
415
|
-
url:
|
|
410
|
+
url: Wt.GET_CROP_ZONE_SUGGESTION
|
|
416
411
|
})).data;
|
|
417
412
|
} catch {
|
|
418
413
|
return null;
|
|
419
414
|
}
|
|
420
415
|
}
|
|
421
|
-
async function
|
|
416
|
+
async function Di({
|
|
422
417
|
assetRecordId: t,
|
|
423
418
|
isSiteBuilder: e,
|
|
424
419
|
siteUrl: i,
|
|
@@ -437,25 +432,25 @@ async function Ii({
|
|
|
437
432
|
responseType: "json",
|
|
438
433
|
transformResponse: [
|
|
439
434
|
...Array.isArray(I.defaults.transformResponse) ? I.defaults.transformResponse : [],
|
|
440
|
-
(n) => !n || typeof n != "object" ? [] : n.proxies?.map((
|
|
441
|
-
cdnName:
|
|
442
|
-
extension:
|
|
443
|
-
formatHeight:
|
|
444
|
-
formatWidth:
|
|
445
|
-
height:
|
|
446
|
-
permanentLink:
|
|
447
|
-
proxyLabel:
|
|
448
|
-
proxyName:
|
|
449
|
-
width:
|
|
435
|
+
(n) => !n || typeof n != "object" ? [] : n.proxies?.map((l) => ({
|
|
436
|
+
cdnName: l.cdnName,
|
|
437
|
+
extension: l.extension,
|
|
438
|
+
formatHeight: l.formatHeight,
|
|
439
|
+
formatWidth: l.formatWidth,
|
|
440
|
+
height: l.height,
|
|
441
|
+
permanentLink: l.permanentLink,
|
|
442
|
+
proxyLabel: l.proxyLabel,
|
|
443
|
+
proxyName: l.proxyName,
|
|
444
|
+
width: l.width
|
|
450
445
|
})) ?? []
|
|
451
446
|
],
|
|
452
|
-
url: e ?
|
|
447
|
+
url: e ? Dt.GET_AVAILABLE_PROXIES : Xt
|
|
453
448
|
})).data;
|
|
454
449
|
} catch {
|
|
455
450
|
return [];
|
|
456
451
|
}
|
|
457
452
|
}
|
|
458
|
-
async function
|
|
453
|
+
async function Ni({
|
|
459
454
|
siteUrl: t
|
|
460
455
|
} = {}) {
|
|
461
456
|
try {
|
|
@@ -476,13 +471,13 @@ async function Ei({
|
|
|
476
471
|
formatsByDocType: i.formatsByDocType ?? {}
|
|
477
472
|
}
|
|
478
473
|
],
|
|
479
|
-
url:
|
|
474
|
+
url: Qt
|
|
480
475
|
})).data;
|
|
481
476
|
} catch {
|
|
482
477
|
return { formatsByDocType: {} };
|
|
483
478
|
}
|
|
484
479
|
}
|
|
485
|
-
async function
|
|
480
|
+
async function Oi({
|
|
486
481
|
recordIds: t,
|
|
487
482
|
rightsToCheck: e
|
|
488
483
|
}) {
|
|
@@ -498,14 +493,14 @@ async function Hi({
|
|
|
498
493
|
params: { RecordIDs: t, RightsToCheck: e },
|
|
499
494
|
paramsSerializer: { indexes: null },
|
|
500
495
|
responseType: "json",
|
|
501
|
-
url:
|
|
496
|
+
url: Kt.GET_AUTHORIZED_OBJECTS
|
|
502
497
|
});
|
|
503
498
|
return s;
|
|
504
499
|
} catch {
|
|
505
500
|
return i;
|
|
506
501
|
}
|
|
507
502
|
}
|
|
508
|
-
const
|
|
503
|
+
const At = 20, Ct = "TR1", wt = "TRX", Ce = /* @__PURE__ */ new Set([".gif"]), we = /* @__PURE__ */ new Set([
|
|
509
504
|
".avif",
|
|
510
505
|
".bmp",
|
|
511
506
|
".gif",
|
|
@@ -516,17 +511,32 @@ const Tt = 20, Wt = "TR1", Ce = /* @__PURE__ */ new Set([
|
|
|
516
511
|
".svg",
|
|
517
512
|
".webp"
|
|
518
513
|
]);
|
|
519
|
-
function
|
|
514
|
+
function Vt(t) {
|
|
520
515
|
const e = t.toLowerCase(), i = e.startsWith(".") ? e : `.${e}`;
|
|
521
|
-
return
|
|
516
|
+
return we.has(i);
|
|
522
517
|
}
|
|
523
|
-
|
|
518
|
+
function Tt({
|
|
519
|
+
extension: t,
|
|
520
|
+
format: e,
|
|
521
|
+
item: i,
|
|
522
|
+
manualFormat: s,
|
|
523
|
+
size: a
|
|
524
|
+
}) {
|
|
525
|
+
const o = t?.toLowerCase() ?? "", n = o.startsWith(".") ? o : `.${o}`, l = `path_${Ct}`;
|
|
526
|
+
if (!s)
|
|
527
|
+
return i[`path_${Ot(o, a)}`] || i[l];
|
|
528
|
+
if (!!o && Ce.has(n))
|
|
529
|
+
return i[`path_${wt}`] || i[l];
|
|
530
|
+
const g = !o || Vt(o), c = e ? `path_${e}` : void 0;
|
|
531
|
+
return c && g && i[c] ? i[c] : i[l];
|
|
532
|
+
}
|
|
533
|
+
class Li {
|
|
524
534
|
constructor(e, i) {
|
|
525
|
-
this.data = [], this.folderId = "", this.fetchedPages = /* @__PURE__ */ new Set(), this.totalCount = 0, this.maxEnd = 1 / 0, this.pageSize =
|
|
535
|
+
this.data = [], this.folderId = "", this.fetchedPages = /* @__PURE__ */ new Set(), this.totalCount = 0, this.maxEnd = 1 / 0, this.pageSize = At, this.requestEpoch = 0, this.host = e, this.host.addController?.(this);
|
|
526
536
|
const s = i?.maxEnd;
|
|
527
537
|
this.maxEnd = typeof s == "number" && Number.isFinite(s) && s >= 0 ? Math.floor(s) : 1 / 0;
|
|
528
538
|
const a = i?.pageSize;
|
|
529
|
-
this.pageSize = typeof a == "number" && Number.isFinite(a) && a >= 1 ? Math.floor(a) :
|
|
539
|
+
this.pageSize = typeof a == "number" && Number.isFinite(a) && a >= 1 ? Math.floor(a) : At, this.authToken = i?.token, this.securityByPassToken = i?.securityByPassToken, this.isSiteBuilder = i?.isSiteBuilder ?? !1;
|
|
530
540
|
}
|
|
531
541
|
get totalDataCount() {
|
|
532
542
|
return this.totalCount;
|
|
@@ -534,61 +544,91 @@ class Ti {
|
|
|
534
544
|
setSecurityByPassToken(e) {
|
|
535
545
|
this.securityByPassToken !== e && (this.securityByPassToken = e, this.resetPageCache());
|
|
536
546
|
}
|
|
547
|
+
/**
|
|
548
|
+
* Changes how many items each request asks for.
|
|
549
|
+
*
|
|
550
|
+
* A new size moves every page boundary, so cached pages are dropped and the next fetch
|
|
551
|
+
* starts from page 1. `data` is kept — it is indexed absolutely, so the refetch
|
|
552
|
+
* overwrites in place instead of blanking the grid.
|
|
553
|
+
*
|
|
554
|
+
* Shrinking is ignored once pages are cached: collapsing already has what it needs.
|
|
555
|
+
*/
|
|
556
|
+
setPageSize(e) {
|
|
557
|
+
const i = Number.isFinite(e) && e >= 1 ? Math.floor(e) : At;
|
|
558
|
+
if (this.pageSize === i)
|
|
559
|
+
return;
|
|
560
|
+
const s = this.fetchedPages.size > 0;
|
|
561
|
+
s && i < this.pageSize || (this.pageSize = i, s && (this.requestEpoch += 1, this.fetchedPages.clear()));
|
|
562
|
+
}
|
|
537
563
|
async fetchImages({
|
|
538
564
|
end: e,
|
|
539
565
|
extraFields: i = [],
|
|
540
566
|
format: s,
|
|
541
|
-
|
|
542
|
-
|
|
567
|
+
manualFormat: a = !0,
|
|
568
|
+
start: o,
|
|
569
|
+
transformations: n
|
|
543
570
|
}) {
|
|
544
|
-
if (e <
|
|
571
|
+
if (e < o)
|
|
545
572
|
return this.data;
|
|
546
|
-
if (this.totalCount > 0 && e >= this.totalCount && (e = this.totalCount - 1, e <
|
|
573
|
+
if (this.totalCount > 0 && e >= this.totalCount && (e = this.totalCount - 1, e < o))
|
|
547
574
|
return this.data;
|
|
548
|
-
const
|
|
549
|
-
if (!this.folderId ||
|
|
575
|
+
const l = this.requestEpoch;
|
|
576
|
+
if (!this.folderId || l !== this.requestEpoch)
|
|
550
577
|
return this.data;
|
|
551
|
-
const
|
|
552
|
-
|
|
553
|
-
|
|
578
|
+
const d = s ? `path_${s}` : void 0, g = `path_${Ct}`, c = `path_${wt}`, S = [
|
|
579
|
+
...new Set(
|
|
580
|
+
[d, g, c].filter(
|
|
581
|
+
(y) => !!y
|
|
582
|
+
)
|
|
583
|
+
)
|
|
584
|
+
], A = Math.floor(o / this.pageSize) + 1, p = Math.floor(e / this.pageSize) + 1;
|
|
585
|
+
for (let y = A; y <= p; y++) {
|
|
586
|
+
if (this.fetchedPages.has(y))
|
|
554
587
|
continue;
|
|
555
|
-
const
|
|
588
|
+
const k = await ve({
|
|
556
589
|
countPerPage: this.pageSize,
|
|
557
590
|
directParentFolderIdentifier: this.folderId,
|
|
558
|
-
extraFields: [...i, ...
|
|
559
|
-
getPermanentAssetsPaths:
|
|
591
|
+
extraFields: [...i, ...S],
|
|
592
|
+
getPermanentAssetsPaths: !0,
|
|
560
593
|
isSiteBuilder: this.isSiteBuilder,
|
|
561
|
-
pageNumber:
|
|
594
|
+
pageNumber: y,
|
|
562
595
|
searchTerm: "",
|
|
563
596
|
securityByPassToken: this.securityByPassToken,
|
|
564
597
|
sortOrder: "",
|
|
565
598
|
token: this.authToken
|
|
566
599
|
});
|
|
567
|
-
if (
|
|
600
|
+
if (l !== this.requestEpoch)
|
|
568
601
|
return this.data;
|
|
569
|
-
if (this.fetchedPages.add(
|
|
570
|
-
const
|
|
571
|
-
this.totalCount =
|
|
602
|
+
if (this.fetchedPages.add(y), !this.totalCount && k.totalCount) {
|
|
603
|
+
const F = Math.min(this.maxEnd, k.totalCount);
|
|
604
|
+
this.totalCount = F, this.data = Array.from({ length: F }, () => ({
|
|
572
605
|
alt: "",
|
|
573
|
-
id: `temp-${
|
|
606
|
+
id: `temp-${Jt()}`,
|
|
574
607
|
name: "",
|
|
575
608
|
src: ""
|
|
576
609
|
}));
|
|
577
610
|
}
|
|
578
|
-
const
|
|
579
|
-
for (let
|
|
580
|
-
const
|
|
581
|
-
if (
|
|
582
|
-
const
|
|
583
|
-
let
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
611
|
+
const f = (y - 1) * this.pageSize;
|
|
612
|
+
for (let F = 0; F < k.items.length; F++) {
|
|
613
|
+
const tt = f + F;
|
|
614
|
+
if (tt < this.data.length) {
|
|
615
|
+
const E = k.items[F];
|
|
616
|
+
let K = Tt({
|
|
617
|
+
extension: E.extension,
|
|
618
|
+
format: s,
|
|
619
|
+
item: E,
|
|
620
|
+
manualFormat: a,
|
|
621
|
+
size: E.size
|
|
622
|
+
});
|
|
623
|
+
K && n && n.length > 0 && (K = $t(K, n)), this.data[tt] = {
|
|
624
|
+
alt: E.name,
|
|
625
|
+
docType: E.docType,
|
|
626
|
+
extension: E.extension,
|
|
627
|
+
id: E.id,
|
|
628
|
+
name: E.name,
|
|
629
|
+
src: K,
|
|
590
630
|
...i.reduce(
|
|
591
|
-
(
|
|
631
|
+
(st, Pt) => (st[Pt] = E[Pt] ?? "", st),
|
|
592
632
|
{}
|
|
593
633
|
)
|
|
594
634
|
};
|
|
@@ -601,67 +641,83 @@ class Ti {
|
|
|
601
641
|
extraFields: i = [],
|
|
602
642
|
folderId: s,
|
|
603
643
|
forceRefetch: a = !1,
|
|
604
|
-
format:
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
644
|
+
format: o,
|
|
645
|
+
manualFormat: n = !0,
|
|
646
|
+
minLimit: l = 5,
|
|
647
|
+
noPlaceholders: d = !1,
|
|
648
|
+
transformations: g
|
|
608
649
|
}) {
|
|
609
650
|
(!this.folderId || this.folderId !== s) && (this.folderId = s, this.resetFolderState()), a && this.resetPageCache();
|
|
610
|
-
const
|
|
651
|
+
const c = Math.max(5, l), S = e, A = e + c, p = [
|
|
611
652
|
...i,
|
|
612
653
|
pt,
|
|
613
654
|
dt
|
|
614
655
|
];
|
|
615
656
|
await this.fetchImages({
|
|
616
|
-
end:
|
|
617
|
-
extraFields:
|
|
618
|
-
format:
|
|
619
|
-
|
|
620
|
-
|
|
657
|
+
end: A,
|
|
658
|
+
extraFields: p.filter((f) => f !== ""),
|
|
659
|
+
format: o,
|
|
660
|
+
manualFormat: n,
|
|
661
|
+
start: S,
|
|
662
|
+
transformations: g
|
|
621
663
|
});
|
|
622
|
-
let
|
|
623
|
-
|
|
624
|
-
const
|
|
664
|
+
let y = e - c;
|
|
665
|
+
y < 0 && (this.totalCount === 0 ? y = 0 : y = Math.max(0, this.totalCount + y));
|
|
666
|
+
const k = y + c;
|
|
625
667
|
return await this.fetchImages({
|
|
626
|
-
end:
|
|
627
|
-
extraFields:
|
|
628
|
-
format:
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
668
|
+
end: k,
|
|
669
|
+
extraFields: p.filter((f) => f !== ""),
|
|
670
|
+
format: o,
|
|
671
|
+
manualFormat: n,
|
|
672
|
+
start: y,
|
|
673
|
+
transformations: g
|
|
674
|
+
}), d ? this.data.filter((f) => f.id && !f.id.startsWith("temp-")) : this.data;
|
|
632
675
|
}
|
|
633
676
|
async fetchImagesByIDs({
|
|
634
677
|
extraFields: e = [],
|
|
635
678
|
format: i,
|
|
636
|
-
|
|
637
|
-
|
|
679
|
+
manualFormat: s = !0,
|
|
680
|
+
recordIds: a,
|
|
681
|
+
transformations: o
|
|
638
682
|
}) {
|
|
639
|
-
if (
|
|
683
|
+
if (a.length === 0)
|
|
640
684
|
return [];
|
|
641
|
-
const
|
|
685
|
+
const n = i ? `path_${i}` : void 0, l = `path_${Ct}`, d = `path_${wt}`, g = [
|
|
686
|
+
...new Set(
|
|
687
|
+
[n, l, d].filter(
|
|
688
|
+
(p) => !!p
|
|
689
|
+
)
|
|
690
|
+
)
|
|
691
|
+
], c = [ot, ct], S = [
|
|
642
692
|
...e,
|
|
643
693
|
lt,
|
|
644
694
|
pt,
|
|
645
695
|
dt
|
|
646
696
|
];
|
|
647
|
-
return (await
|
|
648
|
-
extraFields: [...
|
|
649
|
-
getPermanentAssetsPaths:
|
|
697
|
+
return (await Ae({
|
|
698
|
+
extraFields: [...S, ...g, ...c].filter((p) => p !== ""),
|
|
699
|
+
getPermanentAssetsPaths: !0,
|
|
650
700
|
isSiteBuilder: this.isSiteBuilder,
|
|
651
|
-
recordIds:
|
|
701
|
+
recordIds: a,
|
|
652
702
|
securityByPassToken: this.securityByPassToken,
|
|
653
703
|
token: this.authToken
|
|
654
|
-
})).items.map((
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
704
|
+
})).items.map((p) => {
|
|
705
|
+
let y = Tt({
|
|
706
|
+
extension: p[ot],
|
|
707
|
+
format: i,
|
|
708
|
+
item: p,
|
|
709
|
+
manualFormat: s,
|
|
710
|
+
size: p[ct]
|
|
711
|
+
});
|
|
712
|
+
return y && o && o.length > 0 && (y = $t(y, o)), {
|
|
713
|
+
alt: p.name,
|
|
714
|
+
docType: p[lt],
|
|
715
|
+
extension: p[ot] || "",
|
|
716
|
+
id: p.recordId,
|
|
717
|
+
name: p.name,
|
|
718
|
+
src: y,
|
|
719
|
+
...S.reduce(
|
|
720
|
+
(k, f) => (k[f] = p[f] ?? "", k),
|
|
665
721
|
{}
|
|
666
722
|
)
|
|
667
723
|
};
|
|
@@ -672,57 +728,63 @@ class Ti {
|
|
|
672
728
|
folderId: i,
|
|
673
729
|
forceRefetch: s = !1,
|
|
674
730
|
format: a,
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
731
|
+
manualFormat: o = !0,
|
|
732
|
+
noPlaceholders: n = !1,
|
|
733
|
+
page: l,
|
|
734
|
+
pageSize: d = 10,
|
|
735
|
+
transformations: g
|
|
679
736
|
}) {
|
|
680
737
|
(!this.folderId || this.folderId !== i) && (this.folderId = i, this.resetFolderState()), s && this.resetPageCache();
|
|
681
|
-
const
|
|
738
|
+
const c = l * d, S = c + d - 1;
|
|
682
739
|
return await this.fetchImages({
|
|
683
|
-
end:
|
|
740
|
+
end: S,
|
|
684
741
|
extraFields: e,
|
|
685
742
|
format: a,
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
743
|
+
manualFormat: o,
|
|
744
|
+
start: c,
|
|
745
|
+
transformations: g
|
|
746
|
+
}), n ? this.data.filter((A) => A.id && !A.id.startsWith("temp-")) : this.data;
|
|
689
747
|
}
|
|
690
748
|
async *fetchImagesInFolderByChunk({
|
|
691
749
|
chunkSize: e = 10,
|
|
692
750
|
end: i = 0,
|
|
693
751
|
extraFields: s = [],
|
|
694
752
|
folderId: a,
|
|
695
|
-
forceRefetch:
|
|
753
|
+
forceRefetch: o = !1,
|
|
696
754
|
format: n,
|
|
697
|
-
|
|
698
|
-
|
|
755
|
+
manualFormat: l = !0,
|
|
756
|
+
start: d = 0,
|
|
757
|
+
transformations: g
|
|
699
758
|
}) {
|
|
700
|
-
const
|
|
701
|
-
if ((!this.folderId || this.folderId !== a) && (this.folderId = a, this.resetFolderState()),
|
|
759
|
+
const c = Math.max(1, e);
|
|
760
|
+
if ((!this.folderId || this.folderId !== a) && (this.folderId = a, this.resetFolderState()), o && this.resetPageCache(), i !== -1) {
|
|
702
761
|
await this.fetchImages({
|
|
703
762
|
end: i,
|
|
704
763
|
extraFields: s,
|
|
705
764
|
format: n,
|
|
706
|
-
|
|
707
|
-
|
|
765
|
+
manualFormat: l,
|
|
766
|
+
start: d,
|
|
767
|
+
transformations: g
|
|
708
768
|
}), yield this.data;
|
|
709
769
|
return;
|
|
710
770
|
}
|
|
711
|
-
let
|
|
771
|
+
let S = d, A = d + c;
|
|
712
772
|
if (await this.fetchImages({
|
|
713
|
-
end:
|
|
773
|
+
end: A,
|
|
714
774
|
extraFields: s,
|
|
715
775
|
format: n,
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
776
|
+
manualFormat: l,
|
|
777
|
+
start: S,
|
|
778
|
+
transformations: g
|
|
779
|
+
}), yield this.data, !(!this.totalCount || this.totalCount <= A))
|
|
780
|
+
for (; A < this.totalCount; )
|
|
781
|
+
S = A, A = Math.min(A + c, this.totalCount), await this.fetchImages({
|
|
782
|
+
end: A,
|
|
722
783
|
extraFields: s,
|
|
723
784
|
format: n,
|
|
724
|
-
|
|
725
|
-
|
|
785
|
+
manualFormat: l,
|
|
786
|
+
start: S,
|
|
787
|
+
transformations: g
|
|
726
788
|
}), yield this.data;
|
|
727
789
|
}
|
|
728
790
|
hostConnected() {
|
|
@@ -737,34 +799,34 @@ class Ti {
|
|
|
737
799
|
this.resetPageCache();
|
|
738
800
|
}
|
|
739
801
|
}
|
|
740
|
-
const
|
|
741
|
-
var
|
|
742
|
-
for (var a = s > 1 ? void 0 : s ?
|
|
743
|
-
(n = t[
|
|
744
|
-
return s && a &&
|
|
802
|
+
const be = q`.asset-link-format__details{--header-padding:var(--cx-spacing-small) var(--cx-spacing-medium)}.asset-link-format__details::part(icon){width:var(--cx-font-size-3x-large);height:var(--cx-font-size-3x-large);background-color:var(--cx-color-neutral-100);border-radius:var(--cx-border-radius-large);color:var(--cx-color-neutral-600);font-size:var(--cx-font-size-large);justify-content:center;align-items:center;display:flex}.asset-link-format__details::part(input-label){color:var(--cx-color-neutral-400);margin-inline-start:var(--cx-spacing-small)}.asset-link-format__header{padding:var(--cx-spacing-medium)}.asset-link-format__section-header{padding:0 var(--cx-spacing-medium);border-top:var(--section-header-border-width,1px) solid var(--cx-color-neutral-200);background-color:var(--cx-color-neutral-50)}.asset-link-format__undo,.asset-link-format__reset{--color:var(--cx-color-primary);--background-color:transparent}`, ke = q`cx-details::part(base){border-bottom-width:0}cx-space{width:100%}cx-space cx-input{flex:1}.crop__unit-select{width:120px}.crop__input-group{flex:1;display:flex}`;
|
|
803
|
+
var Re = Object.defineProperty, Pe = Object.getOwnPropertyDescriptor, z = (t, e, i, s) => {
|
|
804
|
+
for (var a = s > 1 ? void 0 : s ? Pe(e, i) : e, o = t.length - 1, n; o >= 0; o--)
|
|
805
|
+
(n = t[o]) && (a = (s ? n(e, i, a) : n(a)) || a);
|
|
806
|
+
return s && a && Re(e, i, a), a;
|
|
745
807
|
};
|
|
746
|
-
let
|
|
808
|
+
let v = class extends B {
|
|
747
809
|
constructor() {
|
|
748
|
-
super(...arguments), this.localize = new j(this), this.open = !1, this.width = 0, this.height = 0, this.maxWidth = 0, this.maxHeight = 0, this.ratioWidth = 1, this.ratioHeight = 1, this.percentageWidth = 0, this.percentageHeight = 0, this.unit =
|
|
749
|
-
[
|
|
810
|
+
super(...arguments), this.localize = new j(this), this.open = !1, this.width = 0, this.height = 0, this.maxWidth = 0, this.maxHeight = 0, this.ratioWidth = 1, this.ratioHeight = 1, this.percentageWidth = 0, this.percentageHeight = 0, this.unit = r.Pixel, this.disabledApply = !1, this.noRatioModes = !1, this.showPositionPicker = !1, this.lastAppliedSetting = {
|
|
811
|
+
[r.Pixel]: {
|
|
750
812
|
height: 0,
|
|
751
813
|
percentageHeight: 100,
|
|
752
814
|
percentageWidth: 100,
|
|
753
|
-
unit:
|
|
815
|
+
unit: r.Pixel,
|
|
754
816
|
width: 0,
|
|
755
817
|
x: 0,
|
|
756
818
|
y: 0
|
|
757
819
|
},
|
|
758
|
-
[
|
|
820
|
+
[r.AspectRatio]: {
|
|
759
821
|
height: 1,
|
|
760
822
|
percentageHeight: 100,
|
|
761
823
|
percentageWidth: 100,
|
|
762
|
-
unit:
|
|
824
|
+
unit: r.AspectRatio,
|
|
763
825
|
width: 1,
|
|
764
826
|
x: 0,
|
|
765
827
|
y: 0
|
|
766
828
|
}
|
|
767
|
-
}, this.loading = !1, this.cropModes = [], this.focusModes = [], this.focusMode = "manual", this.cropMode = "free", this.position =
|
|
829
|
+
}, this.loading = !1, this.cropModes = [], this.focusModes = [], this.focusMode = "manual", this.cropMode = "free", this.position = D.CenterCenter, this.keepAspectRatio = !1, this.invalidWidth = !1, this.invalidHeight = !1, this.aspectRatio = 0;
|
|
768
830
|
}
|
|
769
831
|
get selectedMode() {
|
|
770
832
|
return this.cropModes.find((t) => t.value === this.cropMode);
|
|
@@ -776,10 +838,10 @@ let C = class extends B {
|
|
|
776
838
|
return;
|
|
777
839
|
}
|
|
778
840
|
if (this.keepAspectRatio) {
|
|
779
|
-
if (this.unit ===
|
|
841
|
+
if (this.unit === r.Pixel && this.width && this.height) {
|
|
780
842
|
this.aspectRatio = this.width / this.height;
|
|
781
843
|
return;
|
|
782
|
-
} else if (this.unit ===
|
|
844
|
+
} else if (this.unit === r.AspectRatio && this.ratioWidth && this.ratioHeight) {
|
|
783
845
|
this.aspectRatio = this.ratioWidth / this.ratioHeight;
|
|
784
846
|
return;
|
|
785
847
|
}
|
|
@@ -810,9 +872,9 @@ let C = class extends B {
|
|
|
810
872
|
}
|
|
811
873
|
this.invalidWidth = !1;
|
|
812
874
|
let e = Number(t.target.value);
|
|
813
|
-
this.unit ===
|
|
814
|
-
let i = this.unit ===
|
|
815
|
-
this.keepAspectRatio && (i = Math.round(e / this.aspectRatio), this.unit ===
|
|
875
|
+
this.unit === r.Pixel && (e = Math.max(Math.min(e, this.maxWidth), 1)), t.target.value = e.toString();
|
|
876
|
+
let i = this.unit === r.Pixel ? this.height : this.ratioHeight, s = !1;
|
|
877
|
+
this.keepAspectRatio && (i = Math.round(e / this.aspectRatio), this.unit === r.Pixel && i > this.maxHeight && (i = this.maxHeight, s = !0)), this.invalidHeight = !1, this.emit("cx-asset-link-format-crop-change", {
|
|
816
878
|
detail: {
|
|
817
879
|
breakAspectRatio: s,
|
|
818
880
|
height: i,
|
|
@@ -829,9 +891,9 @@ let C = class extends B {
|
|
|
829
891
|
}
|
|
830
892
|
this.invalidHeight = !1;
|
|
831
893
|
let e = Number(t.target.value);
|
|
832
|
-
this.unit ===
|
|
833
|
-
let i = this.unit ===
|
|
834
|
-
this.keepAspectRatio && (i = Math.round(e * this.aspectRatio), this.unit ===
|
|
894
|
+
this.unit === r.Pixel && (e = Math.max(Math.min(e, this.maxHeight), 1)), t.target.value = e.toString();
|
|
895
|
+
let i = this.unit === r.Pixel ? this.width : this.ratioWidth, s = !1;
|
|
896
|
+
this.keepAspectRatio && (i = Math.round(e * this.aspectRatio), this.unit === r.Pixel && i > this.maxWidth && (i = this.maxWidth, s = !0)), this.invalidWidth = !1, this.emit("cx-asset-link-format-crop-change", {
|
|
835
897
|
detail: {
|
|
836
898
|
breakAspectRatio: s,
|
|
837
899
|
height: e,
|
|
@@ -846,18 +908,18 @@ let C = class extends B {
|
|
|
846
908
|
if (e === "free")
|
|
847
909
|
this.selectedMode?.auto && this.emit("cx-asset-link-format-crop-change", {
|
|
848
910
|
detail: {
|
|
849
|
-
height: this.lastAppliedSetting[
|
|
911
|
+
height: this.lastAppliedSetting[r.Pixel].height,
|
|
850
912
|
keepAspectRatio: !1,
|
|
851
913
|
silent: !0,
|
|
852
|
-
unit:
|
|
853
|
-
width: this.lastAppliedSetting[
|
|
914
|
+
unit: r.Pixel,
|
|
915
|
+
width: this.lastAppliedSetting[r.Pixel].width
|
|
854
916
|
}
|
|
855
917
|
});
|
|
856
918
|
else if (!i) {
|
|
857
919
|
const [s, a] = e.split(":").map(Number);
|
|
858
|
-
if (this.unit ===
|
|
859
|
-
let
|
|
860
|
-
Number.isFinite(this.maxWidth) && Number.isFinite(this.maxHeight) && ({ height: n, width:
|
|
920
|
+
if (this.unit === r.Pixel) {
|
|
921
|
+
let o = s, n = a;
|
|
922
|
+
Number.isFinite(this.maxWidth) && Number.isFinite(this.maxHeight) && ({ height: n, width: o } = ee(
|
|
861
923
|
this.maxWidth,
|
|
862
924
|
this.maxHeight,
|
|
863
925
|
s,
|
|
@@ -867,8 +929,8 @@ let C = class extends B {
|
|
|
867
929
|
height: n,
|
|
868
930
|
keepAspectRatio: !0,
|
|
869
931
|
silent: !0,
|
|
870
|
-
unit:
|
|
871
|
-
width:
|
|
932
|
+
unit: r.Pixel,
|
|
933
|
+
width: o
|
|
872
934
|
}
|
|
873
935
|
});
|
|
874
936
|
} else
|
|
@@ -877,7 +939,7 @@ let C = class extends B {
|
|
|
877
939
|
height: a,
|
|
878
940
|
keepAspectRatio: !0,
|
|
879
941
|
silent: !0,
|
|
880
|
-
unit:
|
|
942
|
+
unit: r.AspectRatio,
|
|
881
943
|
width: s
|
|
882
944
|
}
|
|
883
945
|
});
|
|
@@ -910,19 +972,19 @@ let C = class extends B {
|
|
|
910
972
|
* This allows the parent component to update the crop settings accordingly.
|
|
911
973
|
*/
|
|
912
974
|
onUnitChange(t) {
|
|
913
|
-
t.target.value ===
|
|
975
|
+
t.target.value === r.AspectRatio ? this.emit("cx-asset-link-format-crop-change", {
|
|
914
976
|
detail: {
|
|
915
|
-
height: this.lastAppliedSetting[
|
|
977
|
+
height: this.lastAppliedSetting[r.AspectRatio].height,
|
|
916
978
|
keepAspectRatio: this.keepAspectRatio,
|
|
917
|
-
unit:
|
|
918
|
-
width: this.lastAppliedSetting[
|
|
979
|
+
unit: r.AspectRatio,
|
|
980
|
+
width: this.lastAppliedSetting[r.AspectRatio].width
|
|
919
981
|
}
|
|
920
982
|
}) : this.emit("cx-asset-link-format-crop-change", {
|
|
921
983
|
detail: {
|
|
922
|
-
height: this.lastAppliedSetting[
|
|
984
|
+
height: this.lastAppliedSetting[r.Pixel].height,
|
|
923
985
|
keepAspectRatio: this.keepAspectRatio,
|
|
924
|
-
unit:
|
|
925
|
-
width: this.lastAppliedSetting[
|
|
986
|
+
unit: r.Pixel,
|
|
987
|
+
width: this.lastAppliedSetting[r.Pixel].width
|
|
926
988
|
}
|
|
927
989
|
}), this.emit("cx-asset-link-format-crop-mode-change", {
|
|
928
990
|
detail: {
|
|
@@ -966,171 +1028,171 @@ let C = class extends B {
|
|
|
966
1028
|
}
|
|
967
1029
|
}), this.emit("cx-asset-link-format-crop-change", {
|
|
968
1030
|
detail: {
|
|
969
|
-
height: this.unit ===
|
|
1031
|
+
height: this.unit === r.Pixel ? this.height : this.ratioHeight,
|
|
970
1032
|
keepAspectRatio: !this.keepAspectRatio,
|
|
971
1033
|
unit: this.unit,
|
|
972
|
-
width: this.unit ===
|
|
1034
|
+
width: this.unit === r.Pixel ? this.width : this.ratioWidth
|
|
973
1035
|
}
|
|
974
1036
|
});
|
|
975
1037
|
}
|
|
976
1038
|
render() {
|
|
977
1039
|
const t = this.cropModes.filter((i) => !i.auto), e = this.cropModes.filter((i) => i.auto);
|
|
978
|
-
return
|
|
1040
|
+
return C`<cx-details class="details" ?open=${this.open} @cx-show=${this.onShowDetails} @cx-hide=${this.onHideDetails}><cx-space slot="summary" align-items="center"><div part="icon"><cx-icon name="crop"></cx-icon></div><cx-typography variant="body2">${this.localize.term("crop")}</cx-typography></cx-space><cx-space direction="vertical" spacing="small">${_(
|
|
979
1041
|
!this.noRatioModes,
|
|
980
|
-
() =>
|
|
1042
|
+
() => C`<cx-select data-testid="cx-asset-link-format-crop-mode" value=${this.cropMode} hoist style=${N({
|
|
981
1043
|
width: "100%"
|
|
982
|
-
})} @cx-change=${this.onCropModeChange} ?disabled=${this.loading}>${
|
|
1044
|
+
})} @cx-change=${this.onCropModeChange} ?disabled=${this.loading}>${at(
|
|
983
1045
|
t,
|
|
984
1046
|
(i) => i.value,
|
|
985
|
-
({ label: i, value: s }) =>
|
|
1047
|
+
({ label: i, value: s }) => C`<cx-option value=${s}>${i}</cx-option>`
|
|
986
1048
|
)}
|
|
987
|
-
${
|
|
1049
|
+
${_(
|
|
988
1050
|
e.length > 0,
|
|
989
|
-
() =>
|
|
1051
|
+
() => C`<cx-divider></cx-divider><small>${this.localize.term("autoCropping")}</small>`
|
|
990
1052
|
)}
|
|
991
|
-
${
|
|
1053
|
+
${at(
|
|
992
1054
|
e,
|
|
993
1055
|
(i) => i.value,
|
|
994
|
-
({ label: i, value: s }) =>
|
|
1056
|
+
({ label: i, value: s }) => C`<cx-option value=${s}>${i}</cx-option>`
|
|
995
1057
|
)}</cx-select>`
|
|
996
|
-
)}<cx-space spacing="small"><div class="crop__input-group"><cx-input data-testid="cx-asset-link-format-crop-width" placeholder=${this.localize.term("width")} mask="num" .maskBlocks=${{ num: { mask: Number, min: 1 } }} value=${this.unit ===
|
|
1058
|
+
)}<cx-space spacing="small"><div class="crop__input-group"><cx-input data-testid="cx-asset-link-format-crop-width" placeholder=${this.localize.term("width")} mask="num" .maskBlocks=${{ num: { mask: Number, min: 1 } }} value=${this.unit === r.Pixel ? this.width.toString() : this.ratioWidth.toString()} @cx-change=${this.handleInputChange} @cx-input=${this.handleWidthChange} required ?disabled=${this.loading}><cx-typography slot="prefix" variant="body3" part="input-label">
|
|
997
1059
|
W
|
|
998
|
-
</cx-typography></cx-input><cx-icon-button data-testid="cx-asset-link-format-crop-aspect-ratio" name=${this.keepAspectRatio ? "insert_link" : "link_off"} @click=${this.handleAspectRatioClick} style=${
|
|
1060
|
+
</cx-typography></cx-input><cx-icon-button data-testid="cx-asset-link-format-crop-aspect-ratio" name=${this.keepAspectRatio ? "insert_link" : "link_off"} @click=${this.handleAspectRatioClick} style=${N({
|
|
999
1061
|
color: this.keepAspectRatio ? "var(--cx-color-primary)" : void 0
|
|
1000
|
-
})} ?disabled=${this.loading}></cx-icon-button><cx-input data-testid="cx-asset-link-format-crop-height" placeholder=${this.localize.term("height")} mask="num" .maskBlocks=${{ num: { mask: Number, min: 1 } }} value=${this.unit ===
|
|
1062
|
+
})} ?disabled=${this.loading}></cx-icon-button><cx-input data-testid="cx-asset-link-format-crop-height" placeholder=${this.localize.term("height")} mask="num" .maskBlocks=${{ num: { mask: Number, min: 1 } }} value=${this.unit === r.Pixel ? this.height.toString() : this.ratioHeight.toString()} ?disabled=${this.loading} @cx-change=${this.handleInputChange} @cx-input=${this.handleHeightChange} required><cx-typography slot="prefix" variant="body3" part="input-label">
|
|
1001
1063
|
H
|
|
1002
|
-
</cx-typography></cx-input></div>${
|
|
1064
|
+
</cx-typography></cx-input></div>${_(
|
|
1003
1065
|
!this.noRatioModes,
|
|
1004
|
-
() =>
|
|
1005
|
-
)}</cx-space>${
|
|
1066
|
+
() => C`<cx-select data-testid="cx-asset-link-format-crop-unit" value=${this.unit} hoist class="crop__unit-select" ?disabled=${this.loading} @cx-change=${this.onUnitChange}><cx-option value=${r.Pixel}>${this.localize.term("pixels")}</cx-option><cx-option value=${r.AspectRatio}>${this.localize.term("aspectRatio")}</cx-option></cx-select>`
|
|
1067
|
+
)}</cx-space>${_(
|
|
1006
1068
|
this.focusModes.length > 0,
|
|
1007
|
-
() =>
|
|
1069
|
+
() => C`<cx-select data-testid="cx-asset-link-format-crop-focus-mode" value=${this.focusMode} hoist style=${N({
|
|
1008
1070
|
width: "100%"
|
|
1009
|
-
})} @cx-change=${this.onFocusModeChange} ?disabled=${this.loading || this.selectedMode?.disabledSize}>${
|
|
1071
|
+
})} @cx-change=${this.onFocusModeChange} ?disabled=${this.loading || this.selectedMode?.disabledSize}>${at(
|
|
1010
1072
|
this.focusModes,
|
|
1011
1073
|
(i) => i.value,
|
|
1012
|
-
({ label: i, value: s }) =>
|
|
1074
|
+
({ label: i, value: s }) => C`<cx-option value=${s}>${i}</cx-option>`
|
|
1013
1075
|
)}</cx-select>`
|
|
1014
1076
|
)}
|
|
1015
|
-
${
|
|
1077
|
+
${_(
|
|
1016
1078
|
this.showPositionPicker && this.focusMode === "manual",
|
|
1017
|
-
() =>
|
|
1018
|
-
)}<cx-button data-testid="cx-asset-link-format-crop-apply" variant="primary" ?disabled=${this.disabledApply || this.invalidHeight || this.invalidWidth} ?loading=${this.loading} style=${
|
|
1079
|
+
() => C`<cx-position-picker data-testid="cx-asset-link-format-crop-position" value=${this.position} @cx-change=${this.onPositionChange}></cx-position-picker>`
|
|
1080
|
+
)}<cx-button data-testid="cx-asset-link-format-crop-apply" variant="primary" ?disabled=${this.disabledApply || this.invalidHeight || this.invalidWidth} ?loading=${this.loading} style=${N({
|
|
1019
1081
|
marginLeft: "auto"
|
|
1020
1082
|
})} @click=${this.handleApply}>${this.localize.term("apply")}</cx-button></cx-space></cx-details>`;
|
|
1021
1083
|
}
|
|
1022
1084
|
};
|
|
1023
|
-
|
|
1024
|
-
|
|
1085
|
+
v.styles = [V, ke];
|
|
1086
|
+
v.dependencies = {
|
|
1025
1087
|
"cx-button": Z,
|
|
1026
1088
|
"cx-details": et,
|
|
1027
|
-
"cx-divider":
|
|
1089
|
+
"cx-divider": Lt,
|
|
1028
1090
|
"cx-icon": it,
|
|
1029
|
-
"cx-icon-button":
|
|
1030
|
-
"cx-input":
|
|
1091
|
+
"cx-icon-button": bt,
|
|
1092
|
+
"cx-input": kt,
|
|
1031
1093
|
"cx-option": gt,
|
|
1032
|
-
"cx-position-picker":
|
|
1094
|
+
"cx-position-picker": te,
|
|
1033
1095
|
"cx-select": xt,
|
|
1034
1096
|
"cx-space": L,
|
|
1035
1097
|
"cx-typography": U
|
|
1036
1098
|
};
|
|
1037
|
-
|
|
1099
|
+
z([
|
|
1038
1100
|
Y(".details")
|
|
1039
|
-
],
|
|
1040
|
-
|
|
1101
|
+
], v.prototype, "base", 2);
|
|
1102
|
+
z([
|
|
1041
1103
|
Y("cx-position-picker")
|
|
1042
|
-
],
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
],
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
],
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
],
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
],
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
],
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
],
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
],
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
],
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
],
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
],
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
],
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
],
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
],
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
],
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
],
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
],
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
],
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
],
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
],
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
],
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
],
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
],
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
],
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
],
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
],
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
],
|
|
1124
|
-
|
|
1104
|
+
], v.prototype, "positionPicker", 2);
|
|
1105
|
+
z([
|
|
1106
|
+
h({ reflect: !0, type: Boolean })
|
|
1107
|
+
], v.prototype, "open", 2);
|
|
1108
|
+
z([
|
|
1109
|
+
h({ reflect: !0, type: Number })
|
|
1110
|
+
], v.prototype, "width", 2);
|
|
1111
|
+
z([
|
|
1112
|
+
h({ reflect: !0, type: Number })
|
|
1113
|
+
], v.prototype, "height", 2);
|
|
1114
|
+
z([
|
|
1115
|
+
h({ attribute: "max-width", reflect: !0, type: Number })
|
|
1116
|
+
], v.prototype, "maxWidth", 2);
|
|
1117
|
+
z([
|
|
1118
|
+
h({ attribute: "max-height", reflect: !0, type: Number })
|
|
1119
|
+
], v.prototype, "maxHeight", 2);
|
|
1120
|
+
z([
|
|
1121
|
+
h({ attribute: "ratio-width", reflect: !0, type: Number })
|
|
1122
|
+
], v.prototype, "ratioWidth", 2);
|
|
1123
|
+
z([
|
|
1124
|
+
h({ attribute: "ratio-height", reflect: !0, type: Number })
|
|
1125
|
+
], v.prototype, "ratioHeight", 2);
|
|
1126
|
+
z([
|
|
1127
|
+
h({ attribute: "percentage-width", reflect: !0, type: Number })
|
|
1128
|
+
], v.prototype, "percentageWidth", 2);
|
|
1129
|
+
z([
|
|
1130
|
+
h({ attribute: "percentage-height", reflect: !0, type: Number })
|
|
1131
|
+
], v.prototype, "percentageHeight", 2);
|
|
1132
|
+
z([
|
|
1133
|
+
h({ reflect: !0, type: String })
|
|
1134
|
+
], v.prototype, "unit", 2);
|
|
1135
|
+
z([
|
|
1136
|
+
h({ attribute: "disabled-apply", reflect: !0, type: Boolean })
|
|
1137
|
+
], v.prototype, "disabledApply", 2);
|
|
1138
|
+
z([
|
|
1139
|
+
h({ attribute: "no-ratio-modes", reflect: !0, type: Boolean })
|
|
1140
|
+
], v.prototype, "noRatioModes", 2);
|
|
1141
|
+
z([
|
|
1142
|
+
h({ attribute: "show-position-picker", reflect: !0, type: Boolean })
|
|
1143
|
+
], v.prototype, "showPositionPicker", 2);
|
|
1144
|
+
z([
|
|
1145
|
+
h({ attribute: "last-applied-setting", reflect: !1, type: Object })
|
|
1146
|
+
], v.prototype, "lastAppliedSetting", 2);
|
|
1147
|
+
z([
|
|
1148
|
+
h({ reflect: !0, type: Boolean })
|
|
1149
|
+
], v.prototype, "loading", 2);
|
|
1150
|
+
z([
|
|
1151
|
+
h({ attribute: "crop-modes", reflect: !1, type: Array })
|
|
1152
|
+
], v.prototype, "cropModes", 2);
|
|
1153
|
+
z([
|
|
1154
|
+
h({ attribute: "focus-modes", reflect: !1, type: Object })
|
|
1155
|
+
], v.prototype, "focusModes", 2);
|
|
1156
|
+
z([
|
|
1157
|
+
h({ attribute: "focus-mode", reflect: !0, type: String })
|
|
1158
|
+
], v.prototype, "focusMode", 2);
|
|
1159
|
+
z([
|
|
1160
|
+
h({ attribute: "crop-mode", reflect: !0, type: String })
|
|
1161
|
+
], v.prototype, "cropMode", 2);
|
|
1162
|
+
z([
|
|
1163
|
+
h({ reflect: !0, type: String })
|
|
1164
|
+
], v.prototype, "position", 2);
|
|
1165
|
+
z([
|
|
1166
|
+
h({ attribute: "keep-aspect-ratio", reflect: !0, type: Boolean })
|
|
1167
|
+
], v.prototype, "keepAspectRatio", 2);
|
|
1168
|
+
z([
|
|
1169
|
+
b()
|
|
1170
|
+
], v.prototype, "invalidWidth", 2);
|
|
1171
|
+
z([
|
|
1172
|
+
b()
|
|
1173
|
+
], v.prototype, "invalidHeight", 2);
|
|
1174
|
+
z([
|
|
1175
|
+
b()
|
|
1176
|
+
], v.prototype, "aspectRatio", 2);
|
|
1177
|
+
z([
|
|
1178
|
+
P("cropMode", { waitUntilFirstUpdate: !0 }),
|
|
1179
|
+
P("maxWidth", { waitUntilFirstUpdate: !0 }),
|
|
1180
|
+
P("maxHeight", { waitUntilFirstUpdate: !0 }),
|
|
1181
|
+
P("keepAspectRatio")
|
|
1182
|
+
], v.prototype, "handleCropModeChange", 1);
|
|
1183
|
+
z([
|
|
1184
|
+
P("open", { waitUntilFirstUpdate: !0 })
|
|
1185
|
+
], v.prototype, "handleOpenChange", 1);
|
|
1186
|
+
v = z([
|
|
1125
1187
|
G("cx-asset-link-format-crop")
|
|
1126
|
-
],
|
|
1127
|
-
const
|
|
1128
|
-
var
|
|
1129
|
-
for (var a = s > 1 ? void 0 : s ?
|
|
1130
|
-
(n = t[
|
|
1131
|
-
return s && a &&
|
|
1188
|
+
], v);
|
|
1189
|
+
const $e = q`.extension{padding:var(--cx-spacing-small) var(--cx-spacing-medium);border:solid 1px var(--cx-color-neutral-200);background-color:var(--cx-color-neutral-0);& cx-select{flex:1;width:100%}}`;
|
|
1190
|
+
var Fe = Object.defineProperty, _e = Object.getOwnPropertyDescriptor, Rt = (t, e, i, s) => {
|
|
1191
|
+
for (var a = s > 1 ? void 0 : s ? _e(e, i) : e, o = t.length - 1, n; o >= 0; o--)
|
|
1192
|
+
(n = t[o]) && (a = (s ? n(e, i, a) : n(a)) || a);
|
|
1193
|
+
return s && a && Fe(e, i, a), a;
|
|
1132
1194
|
};
|
|
1133
|
-
let
|
|
1195
|
+
let X = class extends B {
|
|
1134
1196
|
constructor() {
|
|
1135
1197
|
super(...arguments), this.localize = new j(this), this.value = "", this.items = [];
|
|
1136
1198
|
}
|
|
@@ -1141,44 +1203,52 @@ let K = class extends B {
|
|
|
1141
1203
|
});
|
|
1142
1204
|
}
|
|
1143
1205
|
render() {
|
|
1144
|
-
return
|
|
1206
|
+
return C`<cx-space direction="vertical" spacing="small" class="extension"><cx-typography variant="body2">${this.localize.term("extension")}</cx-typography><cx-select data-label=${this.localize.term("extension")} data-testid="cx-asset-link-format-extension-select" value=${this.value} hoist @cx-change=${this.handleExtensionChange}>${at(
|
|
1145
1207
|
this.items,
|
|
1146
1208
|
(t) => t.value,
|
|
1147
|
-
(t) =>
|
|
1209
|
+
(t) => C`<cx-option value=${t.value}>${t.displayName}</cx-option>`
|
|
1148
1210
|
)}</cx-select></cx-space>`;
|
|
1149
1211
|
}
|
|
1150
1212
|
};
|
|
1151
|
-
|
|
1152
|
-
|
|
1213
|
+
X.styles = [V, $e];
|
|
1214
|
+
X.dependencies = {
|
|
1153
1215
|
"cx-option": gt,
|
|
1154
1216
|
"cx-select": xt,
|
|
1155
1217
|
"cx-space": L,
|
|
1156
1218
|
"cx-typography": U
|
|
1157
1219
|
};
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
],
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
],
|
|
1164
|
-
|
|
1220
|
+
Rt([
|
|
1221
|
+
h({ reflect: !0, type: String })
|
|
1222
|
+
], X.prototype, "value", 2);
|
|
1223
|
+
Rt([
|
|
1224
|
+
h({ reflect: !1, type: Array })
|
|
1225
|
+
], X.prototype, "items", 2);
|
|
1226
|
+
X = Rt([
|
|
1165
1227
|
G("cx-asset-link-format-extension")
|
|
1166
|
-
],
|
|
1167
|
-
const
|
|
1168
|
-
var
|
|
1169
|
-
for (var a = s > 1 ? void 0 : s ?
|
|
1170
|
-
(n = t[
|
|
1171
|
-
return s && a &&
|
|
1228
|
+
], X);
|
|
1229
|
+
const Me = q`cx-details::part(base){border-bottom-width:0}`;
|
|
1230
|
+
var Ie = Object.defineProperty, Ee = Object.getOwnPropertyDescriptor, W = (t, e, i, s) => {
|
|
1231
|
+
for (var a = s > 1 ? void 0 : s ? Ee(e, i) : e, o = t.length - 1, n; o >= 0; o--)
|
|
1232
|
+
(n = t[o]) && (a = (s ? n(e, i, a) : n(a)) || a);
|
|
1233
|
+
return s && a && Ie(e, i, a), a;
|
|
1172
1234
|
};
|
|
1173
|
-
|
|
1235
|
+
const vt = "auto";
|
|
1236
|
+
let M = class extends B {
|
|
1174
1237
|
constructor() {
|
|
1175
|
-
super(...arguments), this.localize = new j(this), this.open = !1, this.value = "", this.items = [], this.loading = !1, this.scopedValue = "";
|
|
1238
|
+
super(...arguments), this.localize = new j(this), this.open = !1, this.value = "", this.items = [], this.canAutoFormat = !1, this.autoFormat = !1, this.loading = !1, this.scopedValue = "";
|
|
1239
|
+
}
|
|
1240
|
+
/**
|
|
1241
|
+
* The listbox value that represents the committed choice: the `Auto` entry when that is
|
|
1242
|
+
* active, otherwise the resolved proxy id.
|
|
1243
|
+
*/
|
|
1244
|
+
get committedValue() {
|
|
1245
|
+
return this.autoFormat ? vt : this.value;
|
|
1176
1246
|
}
|
|
1177
1247
|
handleValueChange() {
|
|
1178
|
-
this.scopedValue = this.
|
|
1248
|
+
this.scopedValue = this.committedValue;
|
|
1179
1249
|
}
|
|
1180
1250
|
handleOpenChange() {
|
|
1181
|
-
this.open || (this.scopedValue = this.
|
|
1251
|
+
this.open || (this.scopedValue = this.committedValue);
|
|
1182
1252
|
}
|
|
1183
1253
|
handleProxyChange(t) {
|
|
1184
1254
|
const e = t.target.value;
|
|
@@ -1192,11 +1262,17 @@ let E = class extends B {
|
|
|
1192
1262
|
handleApply() {
|
|
1193
1263
|
if (this.loading)
|
|
1194
1264
|
return;
|
|
1195
|
-
|
|
1196
|
-
(
|
|
1265
|
+
if (this.scopedValue === vt) {
|
|
1266
|
+
this.emit("cx-asset-link-format-proxy-change", {
|
|
1267
|
+
detail: { autoFormat: !0 }
|
|
1268
|
+
});
|
|
1269
|
+
return;
|
|
1270
|
+
}
|
|
1271
|
+
const e = this.items.find(
|
|
1272
|
+
(i) => i.id === this.scopedValue
|
|
1197
1273
|
);
|
|
1198
|
-
|
|
1199
|
-
detail:
|
|
1274
|
+
e && this.emit("cx-asset-link-format-proxy-change", {
|
|
1275
|
+
detail: { ...e, autoFormat: !1 }
|
|
1200
1276
|
});
|
|
1201
1277
|
}
|
|
1202
1278
|
/**
|
|
@@ -1216,57 +1292,70 @@ let E = class extends B {
|
|
|
1216
1292
|
t.target !== this.base && t.stopPropagation();
|
|
1217
1293
|
}
|
|
1218
1294
|
render() {
|
|
1219
|
-
return
|
|
1295
|
+
return C`<cx-details class="details" ?open=${this.open} @cx-show=${this.onShowDetails} @cx-hide=${this.onHideDetails}><cx-space slot="summary" align-items="center"><div part="icon"><cx-icon name="photo_size_select_large"></cx-icon></div><cx-typography variant="body2">${this.localize.term("format")}</cx-typography></cx-space><cx-space direction="vertical" spacing="small" class="format"><cx-select data-label=${this.localize.term("imageFormat")} data-testid="cx-asset-link-format-proxy-select" value=${this.scopedValue} hoist @cx-change=${this.handleProxyChange} ?disabled=${this.loading}>${at(
|
|
1220
1296
|
this.items,
|
|
1221
1297
|
(t) => t.id,
|
|
1222
|
-
(t) =>
|
|
1223
|
-
)}
|
|
1298
|
+
(t) => C`<cx-option value=${t.id}>${t.proxyLabel}</cx-option>`
|
|
1299
|
+
)}
|
|
1300
|
+
${_(
|
|
1301
|
+
this.canAutoFormat,
|
|
1302
|
+
() => C`<cx-divider></cx-divider><cx-option data-testid="cx-asset-link-format-proxy-auto-option" value=${vt}>${this.localize.term("auto")}</cx-option>`,
|
|
1303
|
+
() => Nt
|
|
1304
|
+
)}</cx-select><cx-button data-testid="cx-asset-link-format-proxy-apply" variant="primary" style=${N({
|
|
1224
1305
|
"margin-left": "auto"
|
|
1225
|
-
})} ?disabled=${this.scopedValue === this.
|
|
1306
|
+
})} ?disabled=${this.scopedValue === this.committedValue} ?loading=${this.loading} @click=${this.handleApply}>${this.localize.term("apply")}</cx-button></cx-space></cx-details>`;
|
|
1226
1307
|
}
|
|
1227
1308
|
};
|
|
1228
|
-
|
|
1229
|
-
|
|
1309
|
+
M.styles = [V, Me];
|
|
1310
|
+
M.dependencies = {
|
|
1230
1311
|
"cx-button": Z,
|
|
1231
1312
|
"cx-details": et,
|
|
1313
|
+
"cx-divider": Lt,
|
|
1232
1314
|
"cx-icon": it,
|
|
1233
1315
|
"cx-option": gt,
|
|
1234
1316
|
"cx-select": xt,
|
|
1235
1317
|
"cx-space": L,
|
|
1236
1318
|
"cx-typography": U
|
|
1237
1319
|
};
|
|
1238
|
-
|
|
1320
|
+
W([
|
|
1239
1321
|
Y(".details")
|
|
1240
|
-
],
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
],
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
],
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
],
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
],
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
],
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
],
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
],
|
|
1262
|
-
|
|
1322
|
+
], M.prototype, "base", 2);
|
|
1323
|
+
W([
|
|
1324
|
+
h({ reflect: !0, type: Boolean })
|
|
1325
|
+
], M.prototype, "open", 2);
|
|
1326
|
+
W([
|
|
1327
|
+
h({ reflect: !0, type: String })
|
|
1328
|
+
], M.prototype, "value", 2);
|
|
1329
|
+
W([
|
|
1330
|
+
h({ reflect: !1, type: Array })
|
|
1331
|
+
], M.prototype, "items", 2);
|
|
1332
|
+
W([
|
|
1333
|
+
h({ attribute: "can-auto-format", reflect: !0, type: Boolean })
|
|
1334
|
+
], M.prototype, "canAutoFormat", 2);
|
|
1335
|
+
W([
|
|
1336
|
+
h({ attribute: "auto-format", reflect: !0, type: Boolean })
|
|
1337
|
+
], M.prototype, "autoFormat", 2);
|
|
1338
|
+
W([
|
|
1339
|
+
h({ reflect: !0, type: Boolean })
|
|
1340
|
+
], M.prototype, "loading", 2);
|
|
1341
|
+
W([
|
|
1342
|
+
b()
|
|
1343
|
+
], M.prototype, "scopedValue", 2);
|
|
1344
|
+
W([
|
|
1345
|
+
P("autoFormat"),
|
|
1346
|
+
P("value")
|
|
1347
|
+
], M.prototype, "handleValueChange", 1);
|
|
1348
|
+
W([
|
|
1349
|
+
P("open", { waitUntilFirstUpdate: !0 })
|
|
1350
|
+
], M.prototype, "handleOpenChange", 1);
|
|
1351
|
+
M = W([
|
|
1263
1352
|
G("cx-asset-link-format-proxy")
|
|
1264
|
-
],
|
|
1265
|
-
const
|
|
1266
|
-
var
|
|
1267
|
-
for (var a = s > 1 ? void 0 : s ?
|
|
1268
|
-
(n = t[
|
|
1269
|
-
return s && a &&
|
|
1353
|
+
], M);
|
|
1354
|
+
const He = q`cx-details::part(base){border-bottom-width:0}`;
|
|
1355
|
+
var Te = Object.defineProperty, We = Object.getOwnPropertyDescriptor, J = (t, e, i, s) => {
|
|
1356
|
+
for (var a = s > 1 ? void 0 : s ? We(e, i) : e, o = t.length - 1, n; o >= 0; o--)
|
|
1357
|
+
(n = t[o]) && (a = (s ? n(e, i, a) : n(a)) || a);
|
|
1358
|
+
return s && a && Te(e, i, a), a;
|
|
1270
1359
|
};
|
|
1271
1360
|
let T = class extends B {
|
|
1272
1361
|
constructor() {
|
|
@@ -1314,53 +1403,53 @@ let T = class extends B {
|
|
|
1314
1403
|
t.target !== this.base && t.stopPropagation();
|
|
1315
1404
|
}
|
|
1316
1405
|
render() {
|
|
1317
|
-
return
|
|
1406
|
+
return C`<cx-details class="details" ?open=${this.open} @cx-show=${this.onShowDetails} @cx-hide=${this.onHideDetails}><cx-space slot="summary" align-items="center"><div class="details__summary__icon"><div part="icon"><cx-icon name="blur_on"></cx-icon></div></div><cx-typography variant="body2">${this.localize.term("quality")}</cx-typography></cx-space><cx-space spacing="small"><cx-tooltip data-testid="cx-asset-link-format-quality-tooltip" content=${this.localize.term("qualityHelpText")} hoist><cx-input data-testid="cx-asset-link-format-quality" class="details__checkbox" mask="num" .maskBlocks=${{ num: { mask: Number, max: 100, min: 1 } }} value=${this.scopedValue.toString()} style=${N({
|
|
1318
1407
|
flex: "1"
|
|
1319
1408
|
})} @cx-input=${this.handleQualityChange}></cx-input></cx-tooltip><cx-button data-testid="cx-asset-link-format-quality-apply" variant="primary" ?disabled=${this.invalidValue} ?loading=${this.loading} @click=${this.handleApply}>${this.localize.term("apply")}</cx-button></cx-space></cx-details>`;
|
|
1320
1409
|
}
|
|
1321
1410
|
};
|
|
1322
|
-
T.styles = [V,
|
|
1411
|
+
T.styles = [V, He];
|
|
1323
1412
|
T.dependencies = {
|
|
1324
1413
|
"cx-button": Z,
|
|
1325
1414
|
"cx-details": et,
|
|
1326
1415
|
"cx-icon": it,
|
|
1327
|
-
"cx-input":
|
|
1416
|
+
"cx-input": kt,
|
|
1328
1417
|
"cx-space": L,
|
|
1329
|
-
"cx-tooltip":
|
|
1418
|
+
"cx-tooltip": Ut,
|
|
1330
1419
|
"cx-typography": U
|
|
1331
1420
|
};
|
|
1332
1421
|
J([
|
|
1333
1422
|
Y(".details")
|
|
1334
1423
|
], T.prototype, "base", 2);
|
|
1335
1424
|
J([
|
|
1336
|
-
|
|
1425
|
+
h({ reflect: !0, type: Boolean })
|
|
1337
1426
|
], T.prototype, "open", 2);
|
|
1338
1427
|
J([
|
|
1339
|
-
|
|
1428
|
+
h({ reflect: !0, type: Number })
|
|
1340
1429
|
], T.prototype, "value", 2);
|
|
1341
1430
|
J([
|
|
1342
|
-
|
|
1431
|
+
h({ reflect: !0, type: Boolean })
|
|
1343
1432
|
], T.prototype, "loading", 2);
|
|
1344
1433
|
J([
|
|
1345
|
-
|
|
1434
|
+
b()
|
|
1346
1435
|
], T.prototype, "scopedValue", 2);
|
|
1347
1436
|
J([
|
|
1348
|
-
|
|
1437
|
+
P("value")
|
|
1349
1438
|
], T.prototype, "handleValueChange", 1);
|
|
1350
1439
|
T = J([
|
|
1351
1440
|
G("cx-asset-link-format-quality")
|
|
1352
1441
|
], T);
|
|
1353
|
-
const
|
|
1354
|
-
var
|
|
1355
|
-
for (var a = s > 1 ? void 0 : s ?
|
|
1356
|
-
(n = t[
|
|
1357
|
-
return s && a &&
|
|
1442
|
+
const De = q`cx-details::part(base){border-bottom-width:0}cx-space{width:100%}cx-space cx-input{flex:1}.resize__unit-select{width:120px}.resize__input-group{flex:1;display:flex}`;
|
|
1443
|
+
var Ne = Object.defineProperty, Oe = Object.getOwnPropertyDescriptor, R = (t, e, i, s) => {
|
|
1444
|
+
for (var a = s > 1 ? void 0 : s ? Oe(e, i) : e, o = t.length - 1, n; o >= 0; o--)
|
|
1445
|
+
(n = t[o]) && (a = (s ? n(e, i, a) : n(a)) || a);
|
|
1446
|
+
return s && a && Ne(e, i, a), a;
|
|
1358
1447
|
};
|
|
1359
|
-
let
|
|
1448
|
+
let w = class extends B {
|
|
1360
1449
|
constructor() {
|
|
1361
|
-
super(...arguments), this.localize = new j(this), this.open = !1, this.width = 0, this.height = 0, this.maxWidth = 0, this.maxHeight = 0, this.ratioWidth = 1, this.ratioHeight = 1, this.unit =
|
|
1362
|
-
[
|
|
1363
|
-
[
|
|
1450
|
+
super(...arguments), this.localize = new j(this), this.open = !1, this.width = 0, this.height = 0, this.maxWidth = 0, this.maxHeight = 0, this.ratioWidth = 1, this.ratioHeight = 1, this.unit = r.Pixel, this.lastAppliedSetting = {
|
|
1451
|
+
[r.Pixel]: { height: 0, width: 0 },
|
|
1452
|
+
[r.AspectRatio]: { height: 1, width: 1 }
|
|
1364
1453
|
}, this.loading = !1, this.noRatioModes = !1, this.keepAspectRatio = !1, this.invalidWidth = !1, this.invalidHeight = !1, this.aspectRatio = 0;
|
|
1365
1454
|
}
|
|
1366
1455
|
/**
|
|
@@ -1374,11 +1463,11 @@ let v = class extends B {
|
|
|
1374
1463
|
async handleCropModeChange() {
|
|
1375
1464
|
const t = Number.isFinite(this.maxWidth) && Number.isFinite(this.maxHeight) && this.maxWidth > 0 && this.maxHeight > 0;
|
|
1376
1465
|
if (this.keepAspectRatio) {
|
|
1377
|
-
if (this.unit ===
|
|
1466
|
+
if (this.unit === r.AspectRatio && this.ratioWidth && this.ratioHeight) {
|
|
1378
1467
|
this.aspectRatio = this.ratioWidth / this.ratioHeight;
|
|
1379
1468
|
return;
|
|
1380
1469
|
}
|
|
1381
|
-
if (this.unit ===
|
|
1470
|
+
if (this.unit === r.Pixel && !t && this.width && this.height) {
|
|
1382
1471
|
this.aspectRatio = this.width / this.height;
|
|
1383
1472
|
return;
|
|
1384
1473
|
}
|
|
@@ -1409,8 +1498,8 @@ let v = class extends B {
|
|
|
1409
1498
|
}
|
|
1410
1499
|
this.invalidWidth = !1;
|
|
1411
1500
|
let e = Number(t.target.value);
|
|
1412
|
-
this.unit ===
|
|
1413
|
-
let i = this.unit ===
|
|
1501
|
+
this.unit === r.Pixel && (e = Math.max(Math.min(e, this.maxWidth), 1)), t.target.value = e.toString();
|
|
1502
|
+
let i = this.unit === r.Pixel ? this.height : this.ratioHeight;
|
|
1414
1503
|
this.keepAspectRatio && (i = Math.min(
|
|
1415
1504
|
Math.round(e / this.aspectRatio),
|
|
1416
1505
|
this.maxHeight
|
|
@@ -1430,8 +1519,8 @@ let v = class extends B {
|
|
|
1430
1519
|
}
|
|
1431
1520
|
this.invalidHeight = !1;
|
|
1432
1521
|
let e = Number(t.target.value);
|
|
1433
|
-
this.unit ===
|
|
1434
|
-
let i = this.unit ===
|
|
1522
|
+
this.unit === r.Pixel && (e = Math.max(Math.min(e, this.maxHeight), 1)), t.target.value = e.toString();
|
|
1523
|
+
let i = this.unit === r.Pixel ? this.width : this.ratioWidth;
|
|
1435
1524
|
this.keepAspectRatio && (i = Math.min(
|
|
1436
1525
|
Math.round(e * this.aspectRatio),
|
|
1437
1526
|
this.maxWidth
|
|
@@ -1445,19 +1534,19 @@ let v = class extends B {
|
|
|
1445
1534
|
});
|
|
1446
1535
|
}
|
|
1447
1536
|
onUnitChange(t) {
|
|
1448
|
-
t.target.value ===
|
|
1537
|
+
t.target.value === r.AspectRatio ? this.emit("cx-asset-link-format-resize-change", {
|
|
1449
1538
|
detail: {
|
|
1450
|
-
height: this.lastAppliedSetting[
|
|
1539
|
+
height: this.lastAppliedSetting[r.AspectRatio].height,
|
|
1451
1540
|
keepAspectRatio: this.keepAspectRatio,
|
|
1452
|
-
unit:
|
|
1453
|
-
width: this.lastAppliedSetting[
|
|
1541
|
+
unit: r.AspectRatio,
|
|
1542
|
+
width: this.lastAppliedSetting[r.AspectRatio].width
|
|
1454
1543
|
}
|
|
1455
1544
|
}) : this.emit("cx-asset-link-format-resize-change", {
|
|
1456
1545
|
detail: {
|
|
1457
|
-
height: this.lastAppliedSetting[
|
|
1546
|
+
height: this.lastAppliedSetting[r.Pixel].height,
|
|
1458
1547
|
keepAspectRatio: this.keepAspectRatio,
|
|
1459
|
-
unit:
|
|
1460
|
-
width: this.lastAppliedSetting[
|
|
1548
|
+
unit: r.Pixel,
|
|
1549
|
+
width: this.lastAppliedSetting[r.Pixel].width
|
|
1461
1550
|
}
|
|
1462
1551
|
});
|
|
1463
1552
|
}
|
|
@@ -1489,105 +1578,105 @@ let v = class extends B {
|
|
|
1489
1578
|
handleAspectRatioClick() {
|
|
1490
1579
|
this.emit("cx-asset-link-format-resize-change", {
|
|
1491
1580
|
detail: {
|
|
1492
|
-
height: this.unit ===
|
|
1581
|
+
height: this.unit === r.Pixel ? this.height : this.ratioHeight,
|
|
1493
1582
|
keepAspectRatio: !this.keepAspectRatio,
|
|
1494
1583
|
unit: this.unit,
|
|
1495
|
-
width: this.unit ===
|
|
1584
|
+
width: this.unit === r.Pixel ? this.width : this.ratioWidth
|
|
1496
1585
|
}
|
|
1497
1586
|
});
|
|
1498
1587
|
}
|
|
1499
1588
|
render() {
|
|
1500
|
-
return
|
|
1589
|
+
return C`<cx-details class="details" ?open=${this.open} @cx-show=${this.onShowDetails} @cx-hide=${this.onHideDetails}><cx-space slot="summary" align-items="center"><div part="icon"><cx-icon name="aspect_ratio"></cx-icon></div><cx-typography variant="body2">${this.localize.term("resize")}</cx-typography></cx-space><cx-space direction="vertical" spacing="small"><cx-space spacing="small"><div class="resize__input-group"><cx-input data-testid="cx-asset-link-format-resize-width" placeholder=${this.localize.term("width")} mask="num" .maskBlocks=${{ num: { mask: Number, min: 1 } }} value=${this.unit === r.Pixel ? this.width.toString() : this.ratioWidth.toString()} @cx-input=${this.handleWidthChange} required ?disabled=${this.loading}><cx-typography slot="prefix" variant="body3" part="input-label">
|
|
1501
1590
|
W
|
|
1502
|
-
</cx-typography></cx-input><cx-icon-button data-testid="cx-asset-link-format-resize-aspect-ratio" name=${this.keepAspectRatio ? "insert_link" : "link_off"} @click=${this.handleAspectRatioClick} style=${
|
|
1591
|
+
</cx-typography></cx-input><cx-icon-button data-testid="cx-asset-link-format-resize-aspect-ratio" name=${this.keepAspectRatio ? "insert_link" : "link_off"} @click=${this.handleAspectRatioClick} style=${N({
|
|
1503
1592
|
color: this.keepAspectRatio ? "var(--cx-color-primary)" : void 0
|
|
1504
|
-
})} ?disabled=${this.loading}></cx-icon-button><cx-input data-testid="cx-asset-link-format-resize-height" placeholder=${this.localize.term("height")} mask="num" .maskBlocks=${{ num: { mask: Number, min: 1 } }} value=${this.unit ===
|
|
1593
|
+
})} ?disabled=${this.loading}></cx-icon-button><cx-input data-testid="cx-asset-link-format-resize-height" placeholder=${this.localize.term("height")} mask="num" .maskBlocks=${{ num: { mask: Number, min: 1 } }} value=${this.unit === r.Pixel ? this.height.toString() : this.ratioHeight.toString()} @cx-input=${this.handleHeightChange} required ?disabled=${this.loading}><cx-typography slot="prefix" variant="body3" part="input-label">
|
|
1505
1594
|
H
|
|
1506
|
-
</cx-typography></cx-input></div>${
|
|
1595
|
+
</cx-typography></cx-input></div>${_(
|
|
1507
1596
|
!this.noRatioModes,
|
|
1508
|
-
() =>
|
|
1509
|
-
)}</cx-space><cx-button data-testid="cx-asset-link-format-resize-apply" variant="primary" ?disabled=${this.disabledApply || this.invalidHeight || this.invalidWidth} ?loading=${this.loading} style=${
|
|
1597
|
+
() => C`<cx-select data-testid="cx-asset-link-format-resize-unit" value=${this.unit} hoist class="resize__unit-select" @cx-change=${this.onUnitChange}><cx-option value=${r.Pixel}>${this.localize.term("pixels")}</cx-option><cx-option value=${r.AspectRatio}>${this.localize.term("aspectRatio")}</cx-option></cx-select>`
|
|
1598
|
+
)}</cx-space><cx-button data-testid="cx-asset-link-format-resize-apply" variant="primary" ?disabled=${this.disabledApply || this.invalidHeight || this.invalidWidth} ?loading=${this.loading} style=${N({
|
|
1510
1599
|
marginLeft: "auto"
|
|
1511
1600
|
})} @click=${this.handleApply}>${this.localize.term("apply")}</cx-button></cx-space></cx-details>`;
|
|
1512
1601
|
}
|
|
1513
1602
|
};
|
|
1514
|
-
|
|
1515
|
-
|
|
1603
|
+
w.styles = [V, De];
|
|
1604
|
+
w.dependencies = {
|
|
1516
1605
|
"cx-button": Z,
|
|
1517
1606
|
"cx-details": et,
|
|
1518
1607
|
"cx-icon": it,
|
|
1519
|
-
"cx-icon-button":
|
|
1520
|
-
"cx-input":
|
|
1608
|
+
"cx-icon-button": bt,
|
|
1609
|
+
"cx-input": kt,
|
|
1521
1610
|
"cx-option": gt,
|
|
1522
1611
|
"cx-select": xt,
|
|
1523
1612
|
"cx-space": L,
|
|
1524
1613
|
"cx-typography": U
|
|
1525
1614
|
};
|
|
1526
|
-
|
|
1615
|
+
R([
|
|
1527
1616
|
Y(".details")
|
|
1528
|
-
],
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
],
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
],
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
],
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
],
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
],
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
],
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
],
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
],
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
],
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
],
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
],
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
],
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
],
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
],
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
],
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
],
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
],
|
|
1583
|
-
|
|
1617
|
+
], w.prototype, "base", 2);
|
|
1618
|
+
R([
|
|
1619
|
+
h({ reflect: !0, type: Boolean })
|
|
1620
|
+
], w.prototype, "open", 2);
|
|
1621
|
+
R([
|
|
1622
|
+
h({ reflect: !0, type: Number })
|
|
1623
|
+
], w.prototype, "width", 2);
|
|
1624
|
+
R([
|
|
1625
|
+
h({ reflect: !0, type: Number })
|
|
1626
|
+
], w.prototype, "height", 2);
|
|
1627
|
+
R([
|
|
1628
|
+
h({ attribute: "max-width", reflect: !0, type: Number })
|
|
1629
|
+
], w.prototype, "maxWidth", 2);
|
|
1630
|
+
R([
|
|
1631
|
+
h({ attribute: "max-height", reflect: !0, type: Number })
|
|
1632
|
+
], w.prototype, "maxHeight", 2);
|
|
1633
|
+
R([
|
|
1634
|
+
h({ attribute: "ratio-width", reflect: !0, type: Number })
|
|
1635
|
+
], w.prototype, "ratioWidth", 2);
|
|
1636
|
+
R([
|
|
1637
|
+
h({ attribute: "ratio-height", reflect: !0, type: Number })
|
|
1638
|
+
], w.prototype, "ratioHeight", 2);
|
|
1639
|
+
R([
|
|
1640
|
+
h({ reflect: !0, type: String })
|
|
1641
|
+
], w.prototype, "unit", 2);
|
|
1642
|
+
R([
|
|
1643
|
+
h({ attribute: "last-applied-setting", reflect: !1, type: Object })
|
|
1644
|
+
], w.prototype, "lastAppliedSetting", 2);
|
|
1645
|
+
R([
|
|
1646
|
+
h({ reflect: !0, type: Boolean })
|
|
1647
|
+
], w.prototype, "loading", 2);
|
|
1648
|
+
R([
|
|
1649
|
+
h({ attribute: "no-ratio-modes", reflect: !0, type: Boolean })
|
|
1650
|
+
], w.prototype, "noRatioModes", 2);
|
|
1651
|
+
R([
|
|
1652
|
+
h({ attribute: "keep-aspect-ratio", reflect: !0, type: Boolean })
|
|
1653
|
+
], w.prototype, "keepAspectRatio", 2);
|
|
1654
|
+
R([
|
|
1655
|
+
b()
|
|
1656
|
+
], w.prototype, "invalidWidth", 2);
|
|
1657
|
+
R([
|
|
1658
|
+
b()
|
|
1659
|
+
], w.prototype, "invalidHeight", 2);
|
|
1660
|
+
R([
|
|
1661
|
+
b()
|
|
1662
|
+
], w.prototype, "aspectRatio", 2);
|
|
1663
|
+
R([
|
|
1664
|
+
P("cropMode", { waitUntilFirstUpdate: !0 }),
|
|
1665
|
+
P("maxWidth", { waitUntilFirstUpdate: !0 }),
|
|
1666
|
+
P("maxHeight", { waitUntilFirstUpdate: !0 }),
|
|
1667
|
+
P("keepAspectRatio")
|
|
1668
|
+
], w.prototype, "handleCropModeChange", 1);
|
|
1669
|
+
R([
|
|
1670
|
+
P("open", { waitUntilFirstUpdate: !0 })
|
|
1671
|
+
], w.prototype, "handleOpenChange", 1);
|
|
1672
|
+
w = R([
|
|
1584
1673
|
G("cx-asset-link-format-resize")
|
|
1585
|
-
],
|
|
1586
|
-
const
|
|
1587
|
-
var
|
|
1588
|
-
for (var a = s > 1 ? void 0 : s ?
|
|
1589
|
-
(n = t[
|
|
1590
|
-
return s && a &&
|
|
1674
|
+
], w);
|
|
1675
|
+
const Le = q`cx-details::part(base){border-bottom-width:0}`;
|
|
1676
|
+
var Ue = Object.defineProperty, Be = Object.getOwnPropertyDescriptor, Q = (t, e, i, s) => {
|
|
1677
|
+
for (var a = s > 1 ? void 0 : s ? Be(e, i) : e, o = t.length - 1, n; o >= 0; o--)
|
|
1678
|
+
(n = t[o]) && (a = (s ? n(e, i, a) : n(a)) || a);
|
|
1679
|
+
return s && a && Ue(e, i, a), a;
|
|
1591
1680
|
};
|
|
1592
1681
|
let H = class extends B {
|
|
1593
1682
|
constructor() {
|
|
@@ -1602,14 +1691,14 @@ let H = class extends B {
|
|
|
1602
1691
|
const e = t.target.value, i = Number(e);
|
|
1603
1692
|
if (Number.isNaN(i))
|
|
1604
1693
|
return;
|
|
1605
|
-
const s =
|
|
1694
|
+
const s = Ft(i);
|
|
1606
1695
|
(i > 360 || i < -360) && (t.target.value = s.toString()), this.emit("cx-asset-link-format-rotation-change", {
|
|
1607
1696
|
detail: s
|
|
1608
1697
|
});
|
|
1609
1698
|
}
|
|
1610
1699
|
handleButtonClick(t) {
|
|
1611
1700
|
this.emit("cx-asset-link-format-rotation-change", {
|
|
1612
|
-
detail:
|
|
1701
|
+
detail: Ft(t)
|
|
1613
1702
|
});
|
|
1614
1703
|
}
|
|
1615
1704
|
handleClockwiseClick() {
|
|
@@ -1629,19 +1718,19 @@ let H = class extends B {
|
|
|
1629
1718
|
});
|
|
1630
1719
|
}
|
|
1631
1720
|
render() {
|
|
1632
|
-
return
|
|
1721
|
+
return C`<cx-details class="details" ?open=${this.open}><cx-space slot="summary" align-items="center"><div part="icon"><cx-icon name="rotate_90_degrees_cw"></cx-icon></div><cx-typography variant="body2">Rotate</cx-typography></cx-space><cx-space spacing="small"><cx-button-group label=${this.localize.term("history")}><cx-icon-button data-testid="cx-asset-link-format-rotation-ccw" name="rotate_90_degrees_ccw" label=${this.localize.term("undo")} outline size="small" ?disabled=${this.loading || this.value === -360} @click=${this.handleCounterClockwiseClick}></cx-icon-button><cx-icon-button data-testid="cx-asset-link-format-rotation-cw" name="rotate_90_degrees_cw" label=${this.localize.term("redo")} outline size="small" ?disabled=${this.loading || this.value === 360} @click=${this.handleClockwiseClick}></cx-icon-button></cx-button-group><cx-input data-testid="cx-asset-link-format-rotation" value=${(this.value + this.defaultValue).toString()} placeholder="0" mask="num" .maskBlocks=${{ num: { mask: Number, max: 360, min: -360, signed: !0 } }} ?disabled=${this.loading} style=${N({
|
|
1633
1722
|
flex: "none",
|
|
1634
1723
|
width: "80px"
|
|
1635
1724
|
})} @cx-input=${this.handleRotationChange}></cx-input><cx-button data-testid="cx-asset-link-format-rotation-apply" variant="primary" ?disabled=${this.value === this.lastAppliedValue} ?loading=${this.loading} @click=${this.handleApply}>${this.localize.term("apply")}</cx-button></cx-space></cx-details>`;
|
|
1636
1725
|
}
|
|
1637
1726
|
};
|
|
1638
|
-
H.styles = [V,
|
|
1727
|
+
H.styles = [V, Le];
|
|
1639
1728
|
H.dependencies = {
|
|
1640
1729
|
"cx-button": Z,
|
|
1641
|
-
"cx-button-group":
|
|
1730
|
+
"cx-button-group": ie,
|
|
1642
1731
|
"cx-details": et,
|
|
1643
1732
|
"cx-icon": it,
|
|
1644
|
-
"cx-icon-button":
|
|
1733
|
+
"cx-icon-button": bt,
|
|
1645
1734
|
"cx-space": L,
|
|
1646
1735
|
"cx-typography": U
|
|
1647
1736
|
};
|
|
@@ -1649,31 +1738,31 @@ Q([
|
|
|
1649
1738
|
Y(".details")
|
|
1650
1739
|
], H.prototype, "base", 2);
|
|
1651
1740
|
Q([
|
|
1652
|
-
|
|
1741
|
+
h({ reflect: !0, type: Boolean })
|
|
1653
1742
|
], H.prototype, "open", 2);
|
|
1654
1743
|
Q([
|
|
1655
|
-
|
|
1744
|
+
h({ reflect: !0, type: Number })
|
|
1656
1745
|
], H.prototype, "value", 2);
|
|
1657
1746
|
Q([
|
|
1658
|
-
|
|
1747
|
+
h({ attribute: "default-value", reflect: !0, type: Number })
|
|
1659
1748
|
], H.prototype, "defaultValue", 2);
|
|
1660
1749
|
Q([
|
|
1661
|
-
|
|
1750
|
+
h({ reflect: !0, type: Boolean })
|
|
1662
1751
|
], H.prototype, "loading", 2);
|
|
1663
1752
|
Q([
|
|
1664
|
-
|
|
1753
|
+
h({ attribute: "last-applied-value", reflect: !0, type: Number })
|
|
1665
1754
|
], H.prototype, "lastAppliedValue", 2);
|
|
1666
1755
|
Q([
|
|
1667
|
-
|
|
1756
|
+
P("open", { waitUntilFirstUpdate: !0 })
|
|
1668
1757
|
], H.prototype, "handleOpenChange", 1);
|
|
1669
1758
|
H = Q([
|
|
1670
1759
|
G("cx-asset-link-format-rotation")
|
|
1671
1760
|
], H);
|
|
1672
|
-
const
|
|
1673
|
-
var
|
|
1674
|
-
for (var a = s > 1 ? void 0 : s ?
|
|
1675
|
-
(n = t[
|
|
1676
|
-
return s && a &&
|
|
1761
|
+
const qe = q`cx-details::part(base){border-bottom-width:0}`;
|
|
1762
|
+
var je = Object.defineProperty, Ve = Object.getOwnPropertyDescriptor, yt = (t, e, i, s) => {
|
|
1763
|
+
for (var a = s > 1 ? void 0 : s ? Ve(e, i) : e, o = t.length - 1, n; o >= 0; o--)
|
|
1764
|
+
(n = t[o]) && (a = (s ? n(e, i, a) : n(a)) || a);
|
|
1765
|
+
return s && a && je(e, i, a), a;
|
|
1677
1766
|
};
|
|
1678
1767
|
let O = class extends B {
|
|
1679
1768
|
constructor() {
|
|
@@ -1701,37 +1790,37 @@ let O = class extends B {
|
|
|
1701
1790
|
t.target !== this.base && t.stopPropagation();
|
|
1702
1791
|
}
|
|
1703
1792
|
render() {
|
|
1704
|
-
return
|
|
1793
|
+
return C`<cx-details class="details" ?open=${this.open} @cx-show=${this.onShowDetails} @cx-hide=${this.onHideDetails}><cx-space slot="summary" align-items="center"><div class="details__summary__icon"><div part="icon"><cx-icon name="short_text"></cx-icon></div></div><cx-typography variant="body2">${this.localize.term("metadata")}</cx-typography></cx-space><cx-space spacing="small"><cx-tooltip data-testid="cx-asset-link-format-metadata-tooltip" content=${this.localize.term("metadataHelpText")} hoist><cx-checkbox data-testid="cx-asset-link-format-metadata" class="details__checkbox" ?checked=${this.value} @cx-change=${this.handleApply}>${this.localize.term("preserveMetadata")}</cx-checkbox></cx-tooltip></cx-space></cx-details>`;
|
|
1705
1794
|
}
|
|
1706
1795
|
};
|
|
1707
|
-
O.styles = [V,
|
|
1796
|
+
O.styles = [V, qe];
|
|
1708
1797
|
O.dependencies = {
|
|
1709
1798
|
"cx-button": Z,
|
|
1710
|
-
"cx-checkbox":
|
|
1799
|
+
"cx-checkbox": se,
|
|
1711
1800
|
"cx-details": et,
|
|
1712
1801
|
"cx-icon": it,
|
|
1713
1802
|
"cx-space": L,
|
|
1714
|
-
"cx-tooltip":
|
|
1803
|
+
"cx-tooltip": Ut,
|
|
1715
1804
|
"cx-typography": U
|
|
1716
1805
|
};
|
|
1717
1806
|
yt([
|
|
1718
1807
|
Y(".details")
|
|
1719
1808
|
], O.prototype, "base", 2);
|
|
1720
1809
|
yt([
|
|
1721
|
-
|
|
1810
|
+
h({ reflect: !0, type: Boolean })
|
|
1722
1811
|
], O.prototype, "open", 2);
|
|
1723
1812
|
yt([
|
|
1724
|
-
|
|
1813
|
+
h({ reflect: !0, type: Boolean })
|
|
1725
1814
|
], O.prototype, "value", 2);
|
|
1726
1815
|
O = yt([
|
|
1727
1816
|
G("cx-asset-link-format-metadata")
|
|
1728
1817
|
], O);
|
|
1729
|
-
var
|
|
1730
|
-
for (var a = s > 1 ? void 0 : s ?
|
|
1731
|
-
(n = t[
|
|
1732
|
-
return s && a &&
|
|
1818
|
+
var Ge = Object.defineProperty, Qe = Object.getOwnPropertyDescriptor, x = (t, e, i, s) => {
|
|
1819
|
+
for (var a = s > 1 ? void 0 : s ? Qe(e, i) : e, o = t.length - 1, n; o >= 0; o--)
|
|
1820
|
+
(n = t[o]) && (a = (s ? n(e, i, a) : n(a)) || a);
|
|
1821
|
+
return s && a && Ge(e, i, a), a;
|
|
1733
1822
|
};
|
|
1734
|
-
let
|
|
1823
|
+
let u = class extends B {
|
|
1735
1824
|
constructor() {
|
|
1736
1825
|
super(), this.localize = new j(this), this.baseUrl = void 0, this.token = void 0, this.asset = void 0, this.cropModes = [
|
|
1737
1826
|
{
|
|
@@ -1792,7 +1881,7 @@ let x = class extends B {
|
|
|
1792
1881
|
label: "Smart Swatch",
|
|
1793
1882
|
value: "SmartSwatch"
|
|
1794
1883
|
}
|
|
1795
|
-
], this.extensions = [], this.proxies = void 0, this.forCropper = void 0, this.useSession = "", this.transformations = [], this.selectedProxy = "", this.defaultProxy = "", this.useCustomExtension = !1, this.noMetadata = !1, this.noFormat = !1, this.noCrop = !1, this.noResize = !1, this.noRotate = !1, this.lastImageSize = {
|
|
1884
|
+
], this.extensions = [], this.proxies = void 0, this.forCropper = void 0, this.useSession = "", this.transformations = [], this.selectedProxy = "", this.defaultProxy = "", this.canAutoFormat = !1, this.autoFormat = !1, this.useCustomExtension = !1, this.noMetadata = !1, this.noFormat = !1, this.noCrop = !1, this.noResize = !1, this.noRotate = !1, this.lastImageSize = {
|
|
1796
1885
|
height: 0,
|
|
1797
1886
|
width: 0
|
|
1798
1887
|
}, this.hideHeader = !1, this.canReset = !1, this.queryElement = null, this.activeSetting = "cx-asset-link-format-proxy", this.selectedFormat = void 0, this.resizeSize = {
|
|
@@ -1805,7 +1894,7 @@ let x = class extends B {
|
|
|
1805
1894
|
keepAspectRatio: !0,
|
|
1806
1895
|
ratioHeight: 1,
|
|
1807
1896
|
ratioWidth: 1,
|
|
1808
|
-
unit:
|
|
1897
|
+
unit: r.Pixel,
|
|
1809
1898
|
width: 1
|
|
1810
1899
|
}, this.cropSize = {
|
|
1811
1900
|
cropMode: "free",
|
|
@@ -1819,17 +1908,17 @@ let x = class extends B {
|
|
|
1819
1908
|
keepAspectRatio: !0,
|
|
1820
1909
|
percentageHeight: 0,
|
|
1821
1910
|
percentageWidth: 0,
|
|
1822
|
-
position:
|
|
1911
|
+
position: D.CenterCenter,
|
|
1823
1912
|
ratioHeight: 1,
|
|
1824
1913
|
ratioWidth: 1,
|
|
1825
|
-
unit:
|
|
1914
|
+
unit: r.Pixel,
|
|
1826
1915
|
width: 1,
|
|
1827
1916
|
x: 0,
|
|
1828
1917
|
y: 0
|
|
1829
1918
|
}, this.rotation = 0, this.defaultSize = {
|
|
1830
1919
|
height: 0,
|
|
1831
1920
|
width: 0
|
|
1832
|
-
}, this.cropperElement = null, this.parameters = [], this.loading = !1, this.lastAction = void 0, this.frozenIndex = void 0, this.preResetTransformations = void 0, this.apiGetTransformAssetLink =
|
|
1921
|
+
}, this.cropperElement = null, this.parameters = [], this.loading = !1, this.lastAction = void 0, this.frozenIndex = void 0, this.preResetTransformations = void 0, this.preResetAutoFormat = void 0, this.preResetSelectedProxy = void 0, this.apiGetTransformAssetLink = xe, this.apiGetCropFocusMode = ze, this.onCropComplete = this.onCropComplete.bind(this), this.onCropDragStart = this.onCropDragStart.bind(this);
|
|
1833
1922
|
}
|
|
1834
1923
|
/**
|
|
1835
1924
|
* Transform requests must resolve to a web-displayable image (the browser renders the
|
|
@@ -1838,7 +1927,7 @@ let x = class extends B {
|
|
|
1838
1927
|
* extension fallback in asset-transformation-dialog.
|
|
1839
1928
|
*/
|
|
1840
1929
|
static getTransformExtension(t) {
|
|
1841
|
-
return !t ||
|
|
1930
|
+
return !t || Vt(t) ? t : "jpg";
|
|
1842
1931
|
}
|
|
1843
1932
|
/** True when there are transformations beyond the frozen index (i.e. user has added new ones). */
|
|
1844
1933
|
get hasUnfrozenTransformations() {
|
|
@@ -1852,7 +1941,7 @@ let x = class extends B {
|
|
|
1852
1941
|
get lastAppliedCropUnit() {
|
|
1853
1942
|
return this.transformations.findLast(
|
|
1854
1943
|
(e) => e.key === m.Crop
|
|
1855
|
-
)?.value.unit ??
|
|
1944
|
+
)?.value.unit ?? r.Pixel;
|
|
1856
1945
|
}
|
|
1857
1946
|
/**
|
|
1858
1947
|
* The focus mode of the last applied crop transformation, for the no-asset case only.
|
|
@@ -1872,7 +1961,7 @@ let x = class extends B {
|
|
|
1872
1961
|
get lastAppliedCropPosition() {
|
|
1873
1962
|
return this.transformations.findLast(
|
|
1874
1963
|
(e) => e.key === m.Crop
|
|
1875
|
-
)?.value.position ??
|
|
1964
|
+
)?.value.position ?? D.CenterCenter;
|
|
1876
1965
|
}
|
|
1877
1966
|
/**
|
|
1878
1967
|
* Checks if the crop apply button should be disabled.
|
|
@@ -1883,8 +1972,8 @@ let x = class extends B {
|
|
|
1883
1972
|
get disabledCropApply() {
|
|
1884
1973
|
if (!this.asset && this.cropSize.unit !== this.lastAppliedCropUnit)
|
|
1885
1974
|
return !1;
|
|
1886
|
-
if (this.cropSize.unit ===
|
|
1887
|
-
const e = this.lastCropSize[
|
|
1975
|
+
if (this.cropSize.unit === r.AspectRatio && !this.asset) {
|
|
1976
|
+
const e = this.lastCropSize[r.AspectRatio];
|
|
1888
1977
|
return this.cropSize.ratioWidth === e.width && this.cropSize.ratioHeight === e.height && this.cropSize.focusMode === this.lastAppliedCropFocusMode && this.cropSize.position === this.lastAppliedCropPosition;
|
|
1889
1978
|
}
|
|
1890
1979
|
if (!this.asset && this.cropSize.focusMode !== this.lastAppliedCropFocusMode || !this.asset && this.cropSize.position !== this.lastAppliedCropPosition)
|
|
@@ -1898,7 +1987,7 @@ let x = class extends B {
|
|
|
1898
1987
|
"y"
|
|
1899
1988
|
];
|
|
1900
1989
|
for (const e of t)
|
|
1901
|
-
if (this.cropSize[e] !== this.lastCropSize[
|
|
1990
|
+
if (this.cropSize[e] !== this.lastCropSize[r.Pixel][e])
|
|
1902
1991
|
return !1;
|
|
1903
1992
|
return !0;
|
|
1904
1993
|
}
|
|
@@ -1925,13 +2014,13 @@ let x = class extends B {
|
|
|
1925
2014
|
const e = this.transformations.findLast(
|
|
1926
2015
|
(i) => i.key === m.Crop
|
|
1927
2016
|
);
|
|
1928
|
-
if (e?.value.unit ===
|
|
2017
|
+
if (e?.value.unit === r.AspectRatio && e.value.ratioWidth && e.value.ratioHeight)
|
|
1929
2018
|
return {
|
|
1930
|
-
[
|
|
2019
|
+
[r.AspectRatio]: {
|
|
1931
2020
|
height: e.value.ratioHeight,
|
|
1932
2021
|
percentageHeight: 100,
|
|
1933
2022
|
percentageWidth: 100,
|
|
1934
|
-
unit:
|
|
2023
|
+
unit: r.AspectRatio,
|
|
1935
2024
|
width: e.value.ratioWidth,
|
|
1936
2025
|
x: 0,
|
|
1937
2026
|
y: 0
|
|
@@ -1942,56 +2031,56 @@ let x = class extends B {
|
|
|
1942
2031
|
* `min: 1`) instead of 0x0, so switching the unit selector back to Pixel and
|
|
1943
2032
|
* clicking Apply immediately still commits a meaningful crop instead of a no-op.
|
|
1944
2033
|
*/
|
|
1945
|
-
[
|
|
2034
|
+
[r.Pixel]: {
|
|
1946
2035
|
height: 1,
|
|
1947
2036
|
percentageHeight: 100,
|
|
1948
2037
|
percentageWidth: 100,
|
|
1949
|
-
unit:
|
|
2038
|
+
unit: r.Pixel,
|
|
1950
2039
|
width: 1,
|
|
1951
2040
|
x: 0,
|
|
1952
2041
|
y: 0
|
|
1953
2042
|
}
|
|
1954
2043
|
};
|
|
1955
2044
|
if (e?.value.width && e?.value.height) {
|
|
1956
|
-
const { height: i, width: s, x: a = 0, y:
|
|
2045
|
+
const { height: i, width: s, x: a = 0, y: o = 0 } = e.value, n = nt(s, i);
|
|
1957
2046
|
return {
|
|
1958
|
-
[
|
|
2047
|
+
[r.AspectRatio]: {
|
|
1959
2048
|
height: n.height,
|
|
1960
2049
|
percentageHeight: 100,
|
|
1961
2050
|
percentageWidth: 100,
|
|
1962
|
-
unit:
|
|
2051
|
+
unit: r.AspectRatio,
|
|
1963
2052
|
width: n.width,
|
|
1964
2053
|
x: 0,
|
|
1965
2054
|
y: 0
|
|
1966
2055
|
},
|
|
1967
|
-
[
|
|
2056
|
+
[r.Pixel]: {
|
|
1968
2057
|
height: i,
|
|
1969
2058
|
percentageHeight: 100,
|
|
1970
2059
|
percentageWidth: 100,
|
|
1971
|
-
unit:
|
|
2060
|
+
unit: r.Pixel,
|
|
1972
2061
|
width: s,
|
|
1973
2062
|
x: a,
|
|
1974
|
-
y:
|
|
2063
|
+
y: o
|
|
1975
2064
|
}
|
|
1976
2065
|
};
|
|
1977
2066
|
}
|
|
1978
2067
|
}
|
|
1979
2068
|
const t = this.lastImageSize.width && this.lastImageSize.height ? nt(this.lastImageSize.width, this.lastImageSize.height) : { height: 1, width: 1 };
|
|
1980
2069
|
return {
|
|
1981
|
-
[
|
|
2070
|
+
[r.AspectRatio]: {
|
|
1982
2071
|
height: t.height,
|
|
1983
2072
|
percentageHeight: 100,
|
|
1984
2073
|
percentageWidth: 100,
|
|
1985
|
-
unit:
|
|
2074
|
+
unit: r.AspectRatio,
|
|
1986
2075
|
width: t.width,
|
|
1987
2076
|
x: 0,
|
|
1988
2077
|
y: 0
|
|
1989
2078
|
},
|
|
1990
|
-
[
|
|
2079
|
+
[r.Pixel]: {
|
|
1991
2080
|
height: this.lastImageSize.height,
|
|
1992
2081
|
percentageHeight: 100,
|
|
1993
2082
|
percentageWidth: 100,
|
|
1994
|
-
unit:
|
|
2083
|
+
unit: r.Pixel,
|
|
1995
2084
|
width: this.lastImageSize.width,
|
|
1996
2085
|
x: 0,
|
|
1997
2086
|
y: 0
|
|
@@ -2008,31 +2097,31 @@ let x = class extends B {
|
|
|
2008
2097
|
const e = this.transformations.findLast(
|
|
2009
2098
|
(i) => i.key === m.Resize
|
|
2010
2099
|
);
|
|
2011
|
-
if (e?.value.unit ===
|
|
2100
|
+
if (e?.value.unit === r.AspectRatio && e.value.ratioWidth && e.value.ratioHeight)
|
|
2012
2101
|
return {
|
|
2013
|
-
[
|
|
2102
|
+
[r.AspectRatio]: {
|
|
2014
2103
|
height: e.value.ratioHeight,
|
|
2015
|
-
unit:
|
|
2104
|
+
unit: r.AspectRatio,
|
|
2016
2105
|
width: e.value.ratioWidth
|
|
2017
2106
|
},
|
|
2018
2107
|
// See lastCropSize's equivalent branch for why this falls back to 1x1, not 0x0.
|
|
2019
|
-
[
|
|
2108
|
+
[r.Pixel]: {
|
|
2020
2109
|
height: 1,
|
|
2021
|
-
unit:
|
|
2110
|
+
unit: r.Pixel,
|
|
2022
2111
|
width: 1
|
|
2023
2112
|
}
|
|
2024
2113
|
};
|
|
2025
2114
|
if (e?.value.width && e?.value.height) {
|
|
2026
2115
|
const { height: i, width: s } = e.value, a = nt(s, i);
|
|
2027
2116
|
return {
|
|
2028
|
-
[
|
|
2117
|
+
[r.AspectRatio]: {
|
|
2029
2118
|
height: a.height,
|
|
2030
|
-
unit:
|
|
2119
|
+
unit: r.AspectRatio,
|
|
2031
2120
|
width: a.width
|
|
2032
2121
|
},
|
|
2033
|
-
[
|
|
2122
|
+
[r.Pixel]: {
|
|
2034
2123
|
height: i,
|
|
2035
|
-
unit:
|
|
2124
|
+
unit: r.Pixel,
|
|
2036
2125
|
width: s
|
|
2037
2126
|
}
|
|
2038
2127
|
};
|
|
@@ -2040,14 +2129,14 @@ let x = class extends B {
|
|
|
2040
2129
|
}
|
|
2041
2130
|
const t = this.lastImageSize.width && this.lastImageSize.height ? nt(this.lastImageSize.width, this.lastImageSize.height) : { height: 1, width: 1 };
|
|
2042
2131
|
return {
|
|
2043
|
-
[
|
|
2132
|
+
[r.AspectRatio]: {
|
|
2044
2133
|
height: t.height,
|
|
2045
|
-
unit:
|
|
2134
|
+
unit: r.AspectRatio,
|
|
2046
2135
|
width: t.width
|
|
2047
2136
|
},
|
|
2048
|
-
[
|
|
2137
|
+
[r.Pixel]: {
|
|
2049
2138
|
height: this.lastImageSize.height,
|
|
2050
|
-
unit:
|
|
2139
|
+
unit: r.Pixel,
|
|
2051
2140
|
width: this.lastImageSize.width
|
|
2052
2141
|
}
|
|
2053
2142
|
};
|
|
@@ -2096,7 +2185,11 @@ let x = class extends B {
|
|
|
2096
2185
|
));
|
|
2097
2186
|
}
|
|
2098
2187
|
updated(t) {
|
|
2099
|
-
if ((t.has("forCropper") || t.has("queryElement")) && this.handleCropperSelectorChange(), t.has("asset") && this.handleAssetChange(), t.has("proxies") && this.handleProxiesChange(),
|
|
2188
|
+
if ((t.has("forCropper") || t.has("queryElement")) && this.handleCropperSelectorChange(), t.has("asset") && this.handleAssetChange(), t.has("proxies") && this.handleProxiesChange(), this.autoFormat && (t.has("asset") || t.has("proxies"))) {
|
|
2189
|
+
const e = this.autoResolvedProxyId;
|
|
2190
|
+
e && (this.selectedProxy = e);
|
|
2191
|
+
}
|
|
2192
|
+
if (t.has("activeSetting") && this.handleActiveSettingChange(), t.has("selectedFormat") && this.handleSelectedFormatChange(), t.has("resizeSize") && this.handleResizeSizeChange(), t.has("cropSize") && this.handleCropSizeChange(), t.has("rotation") && this.handleRotationChange(), t.has("cropperElement") && this.handleCropperElementChange(), t.has("selectedFormat")) {
|
|
2100
2193
|
if (!this.asset || !this.selectedFormat || this.selectedFormat.extension === t.get("selectedFormat")?.extension)
|
|
2101
2194
|
return;
|
|
2102
2195
|
const e = this.proxies?.find(
|
|
@@ -2104,7 +2197,7 @@ let x = class extends B {
|
|
|
2104
2197
|
);
|
|
2105
2198
|
this.loading = !0, this.apiGetTransformAssetLink({
|
|
2106
2199
|
assetId: this.asset.id,
|
|
2107
|
-
extension:
|
|
2200
|
+
extension: u.getTransformExtension(this.asset.extension),
|
|
2108
2201
|
format: e?.proxyName ?? "",
|
|
2109
2202
|
siteUrl: this.baseUrl,
|
|
2110
2203
|
token: this.token,
|
|
@@ -2168,36 +2261,36 @@ let x = class extends B {
|
|
|
2168
2261
|
useSession: this.useSession
|
|
2169
2262
|
}).replace(/\/t\//g, "")
|
|
2170
2263
|
});
|
|
2171
|
-
const
|
|
2172
|
-
(c) => c.key === m.Crop && (c.value.unit ===
|
|
2264
|
+
const o = this.transformations.findLast(
|
|
2265
|
+
(c) => c.key === m.Crop && (c.value.unit === r.AspectRatio && c.value.ratioWidth && c.value.ratioHeight || c.value.width && c.value.height)
|
|
2173
2266
|
);
|
|
2174
|
-
if (
|
|
2175
|
-
const { focusMode: c, position:
|
|
2267
|
+
if (o?.value.unit === r.AspectRatio && o.value.ratioWidth && o.value.ratioHeight) {
|
|
2268
|
+
const { focusMode: c, position: S, ratioHeight: A, ratioWidth: p } = o.value;
|
|
2176
2269
|
this.cropSize = {
|
|
2177
2270
|
...this.cropSize,
|
|
2178
2271
|
cropMode: "free",
|
|
2179
2272
|
focusMode: c ?? "manual",
|
|
2180
2273
|
percentageHeight: 100,
|
|
2181
2274
|
percentageWidth: 100,
|
|
2182
|
-
position:
|
|
2183
|
-
ratioHeight:
|
|
2184
|
-
ratioWidth:
|
|
2185
|
-
unit:
|
|
2275
|
+
position: S ?? D.CenterCenter,
|
|
2276
|
+
ratioHeight: A,
|
|
2277
|
+
ratioWidth: p,
|
|
2278
|
+
unit: r.AspectRatio
|
|
2186
2279
|
};
|
|
2187
|
-
} else if (
|
|
2188
|
-
const { focusMode: c, height:
|
|
2280
|
+
} else if (o) {
|
|
2281
|
+
const { focusMode: c, height: S, position: A, unit: p, width: y, x: k = 0, y: f = 0 } = o.value;
|
|
2189
2282
|
this.cropSize = {
|
|
2190
2283
|
...this.cropSize,
|
|
2191
2284
|
cropMode: "free",
|
|
2192
2285
|
focusMode: c ?? "manual",
|
|
2193
|
-
height:
|
|
2286
|
+
height: S,
|
|
2194
2287
|
percentageHeight: 100,
|
|
2195
2288
|
percentageWidth: 100,
|
|
2196
|
-
position:
|
|
2197
|
-
unit:
|
|
2198
|
-
width:
|
|
2199
|
-
x:
|
|
2200
|
-
y:
|
|
2289
|
+
position: A ?? D.CenterCenter,
|
|
2290
|
+
unit: p ?? r.Pixel,
|
|
2291
|
+
width: y,
|
|
2292
|
+
x: k,
|
|
2293
|
+
y: f
|
|
2201
2294
|
};
|
|
2202
2295
|
} else
|
|
2203
2296
|
this.cropSize = {
|
|
@@ -2213,30 +2306,30 @@ let x = class extends B {
|
|
|
2213
2306
|
height: 1,
|
|
2214
2307
|
percentageHeight: 0,
|
|
2215
2308
|
percentageWidth: 0,
|
|
2216
|
-
position:
|
|
2217
|
-
unit:
|
|
2309
|
+
position: D.CenterCenter,
|
|
2310
|
+
unit: r.Pixel,
|
|
2218
2311
|
width: 1,
|
|
2219
2312
|
x: 0,
|
|
2220
2313
|
y: 0
|
|
2221
2314
|
};
|
|
2222
2315
|
const n = this.transformations.findLast(
|
|
2223
|
-
(c) => c.key === m.Resize && (c.value.unit ===
|
|
2316
|
+
(c) => c.key === m.Resize && (c.value.unit === r.AspectRatio && c.value.ratioWidth && c.value.ratioHeight || c.value.width || c.value.height)
|
|
2224
2317
|
);
|
|
2225
|
-
if (n?.value.unit ===
|
|
2226
|
-
const { ratioHeight: c, ratioWidth:
|
|
2318
|
+
if (n?.value.unit === r.AspectRatio && n.value.ratioWidth && n.value.ratioHeight) {
|
|
2319
|
+
const { ratioHeight: c, ratioWidth: S } = n.value;
|
|
2227
2320
|
this.resizeSize = {
|
|
2228
2321
|
...this.resizeSize,
|
|
2229
2322
|
ratioHeight: c,
|
|
2230
|
-
ratioWidth:
|
|
2231
|
-
unit:
|
|
2323
|
+
ratioWidth: S,
|
|
2324
|
+
unit: r.AspectRatio
|
|
2232
2325
|
};
|
|
2233
2326
|
} else if (n) {
|
|
2234
|
-
const { height: c = 0, unit:
|
|
2327
|
+
const { height: c = 0, unit: S, width: A = 0 } = n.value;
|
|
2235
2328
|
this.resizeSize = {
|
|
2236
2329
|
...this.resizeSize,
|
|
2237
2330
|
height: c,
|
|
2238
|
-
unit:
|
|
2239
|
-
width:
|
|
2331
|
+
unit: S ?? r.Pixel,
|
|
2332
|
+
width: A
|
|
2240
2333
|
};
|
|
2241
2334
|
} else
|
|
2242
2335
|
this.resizeSize = {
|
|
@@ -2247,22 +2340,21 @@ let x = class extends B {
|
|
|
2247
2340
|
* Apply silently no-op.
|
|
2248
2341
|
*/
|
|
2249
2342
|
height: 1,
|
|
2250
|
-
unit:
|
|
2343
|
+
unit: r.Pixel,
|
|
2251
2344
|
width: 1
|
|
2252
2345
|
};
|
|
2253
|
-
const
|
|
2346
|
+
const l = this.transformations.findLast(
|
|
2254
2347
|
(c) => c.key === m.Rotate
|
|
2255
2348
|
);
|
|
2256
|
-
this.rotation =
|
|
2257
|
-
const
|
|
2349
|
+
this.rotation = l?.value.rotation ?? 0;
|
|
2350
|
+
const d = this.transformations.findLast((c) => c.key === m.Quality)?.value.quality ?? 100, g = this.transformations.some(
|
|
2258
2351
|
(c) => c.key === m.Metadata
|
|
2259
2352
|
);
|
|
2260
|
-
this.selectedFormat ? this.selectedFormat = { ...this.selectedFormat, keepMetadata:
|
|
2353
|
+
this.selectedFormat ? this.selectedFormat = { ...this.selectedFormat, keepMetadata: g, quality: d } : this.selectedFormat = {
|
|
2261
2354
|
extension: "",
|
|
2262
2355
|
height: 0,
|
|
2263
|
-
keepMetadata:
|
|
2264
|
-
|
|
2265
|
-
quality: p,
|
|
2356
|
+
keepMetadata: g,
|
|
2357
|
+
quality: d,
|
|
2266
2358
|
rotation: 0,
|
|
2267
2359
|
url: "",
|
|
2268
2360
|
width: 0,
|
|
@@ -2274,12 +2366,12 @@ let x = class extends B {
|
|
|
2274
2366
|
if (!this.selectedFormat)
|
|
2275
2367
|
return;
|
|
2276
2368
|
const t = this.proxies?.find(
|
|
2277
|
-
(
|
|
2369
|
+
(o) => o.id === this.selectedProxy
|
|
2278
2370
|
);
|
|
2279
2371
|
this.loading = !0;
|
|
2280
2372
|
const e = await this.apiGetTransformAssetLink({
|
|
2281
2373
|
assetId: this.asset.id,
|
|
2282
|
-
extension:
|
|
2374
|
+
extension: u.getTransformExtension(this.selectedFormat.extension),
|
|
2283
2375
|
format: t?.proxyName ?? "",
|
|
2284
2376
|
siteUrl: this.baseUrl,
|
|
2285
2377
|
token: this.token,
|
|
@@ -2295,7 +2387,7 @@ let x = class extends B {
|
|
|
2295
2387
|
keepAspectRatio: !0,
|
|
2296
2388
|
ratioHeight: 1,
|
|
2297
2389
|
ratioWidth: 1,
|
|
2298
|
-
unit:
|
|
2390
|
+
unit: r.Pixel,
|
|
2299
2391
|
width: e.width
|
|
2300
2392
|
}, this.cropSize = {
|
|
2301
2393
|
cropMode: "free",
|
|
@@ -2304,18 +2396,18 @@ let x = class extends B {
|
|
|
2304
2396
|
keepAspectRatio: this.cropSize.keepAspectRatio,
|
|
2305
2397
|
percentageHeight: 100,
|
|
2306
2398
|
percentageWidth: 100,
|
|
2307
|
-
position:
|
|
2399
|
+
position: D.CenterCenter,
|
|
2308
2400
|
ratioHeight: 1,
|
|
2309
2401
|
ratioWidth: 1,
|
|
2310
|
-
unit:
|
|
2402
|
+
unit: r.Pixel,
|
|
2311
2403
|
width: e.width,
|
|
2312
2404
|
x: 0,
|
|
2313
2405
|
y: 0
|
|
2314
2406
|
}, this.lastAction === m.Rotate && (this.rotation = 0), this.lastAction = void 0;
|
|
2315
2407
|
const i = this.transformations.some(
|
|
2316
|
-
(
|
|
2408
|
+
(o) => o.key === m.Metadata
|
|
2317
2409
|
), s = this.transformations.findLast(
|
|
2318
|
-
(
|
|
2410
|
+
(o) => o.key === m.Quality
|
|
2319
2411
|
);
|
|
2320
2412
|
this.selectedFormat = {
|
|
2321
2413
|
...this.selectedFormat,
|
|
@@ -2367,7 +2459,6 @@ let x = class extends B {
|
|
|
2367
2459
|
extension: this.asset.extension,
|
|
2368
2460
|
height: this.defaultSize.height,
|
|
2369
2461
|
keepMetadata: !1,
|
|
2370
|
-
originalUrl: this.asset.originalUrl,
|
|
2371
2462
|
quality: t?.value?.quality || 100,
|
|
2372
2463
|
rotation: 0,
|
|
2373
2464
|
url: this.asset.imageUrl,
|
|
@@ -2385,17 +2476,26 @@ let x = class extends B {
|
|
|
2385
2476
|
keepAspectRatio: !0,
|
|
2386
2477
|
percentageHeight: 100,
|
|
2387
2478
|
percentageWidth: 100,
|
|
2388
|
-
position:
|
|
2479
|
+
position: D.CenterCenter,
|
|
2389
2480
|
ratioHeight: 1,
|
|
2390
2481
|
ratioWidth: 1,
|
|
2391
|
-
unit:
|
|
2482
|
+
unit: r.Pixel,
|
|
2392
2483
|
width: this.defaultSize.width,
|
|
2393
2484
|
x: 0,
|
|
2394
2485
|
y: 0
|
|
2395
|
-
}, this.selectedProxy || (this.selectedProxy = this.
|
|
2486
|
+
}, this.selectedProxy || (this.selectedProxy = this.resolveFallbackProxyId());
|
|
2487
|
+
}
|
|
2488
|
+
/**
|
|
2489
|
+
* The proxy id to fall back to when none is set or the current one is not in the list.
|
|
2490
|
+
*
|
|
2491
|
+
* Under `Auto` the asset's extension decides, so the first proxy in the list is only a
|
|
2492
|
+
* last resort — used when the mapped format is not offered for this asset.
|
|
2493
|
+
*/
|
|
2494
|
+
resolveFallbackProxyId() {
|
|
2495
|
+
return !this.proxies || this.proxies.length === 0 ? "" : this.autoFormat ? this.autoResolvedProxyId || this.proxies[0].id : this.proxies[0].id;
|
|
2396
2496
|
}
|
|
2397
2497
|
handleProxiesChange() {
|
|
2398
|
-
!this.proxies || this.proxies.length === 0 || (!this.selectedProxy || !this.proxies.some((t) => t.id === this.selectedProxy)) && (this.selectedProxy = this.
|
|
2498
|
+
!this.proxies || this.proxies.length === 0 || (!this.selectedProxy || !this.proxies.some((t) => t.id === this.selectedProxy)) && (this.selectedProxy = this.resolveFallbackProxyId());
|
|
2399
2499
|
}
|
|
2400
2500
|
async handleSelectedProxyChange(t) {
|
|
2401
2501
|
if (!this.asset || !this.selectedProxy)
|
|
@@ -2409,25 +2509,25 @@ let x = class extends B {
|
|
|
2409
2509
|
const i = this.proxies?.find((s) => s.id === t);
|
|
2410
2510
|
i && (this.asset && i.proxyName === "TRX" && (i.formatHeight = Number(this.asset.height), i.formatWidth = Number(this.asset.width)), this.transformations = this.transformations.map((s) => {
|
|
2411
2511
|
if (s.key === m.Crop) {
|
|
2412
|
-
const a = s.value,
|
|
2512
|
+
const a = s.value, o = a.width / i.formatWidth * e.formatWidth, n = a.height / i.formatHeight * e.formatHeight, l = a.x / i.formatWidth * e.formatWidth, d = a.y / i.formatHeight * e.formatHeight;
|
|
2413
2513
|
return {
|
|
2414
2514
|
...s,
|
|
2415
2515
|
value: {
|
|
2416
2516
|
...s.value,
|
|
2417
2517
|
height: n,
|
|
2418
|
-
width:
|
|
2419
|
-
x:
|
|
2420
|
-
y:
|
|
2518
|
+
width: o,
|
|
2519
|
+
x: l,
|
|
2520
|
+
y: d
|
|
2421
2521
|
}
|
|
2422
2522
|
};
|
|
2423
2523
|
}
|
|
2424
2524
|
if (s.key === m.Resize) {
|
|
2425
|
-
const a = s.value,
|
|
2525
|
+
const a = s.value, o = a.width / i.formatWidth * e.formatWidth, n = a.height / i.formatHeight * e.formatHeight;
|
|
2426
2526
|
return {
|
|
2427
2527
|
...s,
|
|
2428
2528
|
value: {
|
|
2429
2529
|
height: n,
|
|
2430
|
-
width:
|
|
2530
|
+
width: o
|
|
2431
2531
|
}
|
|
2432
2532
|
};
|
|
2433
2533
|
}
|
|
@@ -2442,24 +2542,24 @@ let x = class extends B {
|
|
|
2442
2542
|
}, await this.updateComplete, this.cropSize = {
|
|
2443
2543
|
cropMode: "free",
|
|
2444
2544
|
focusMode: "manual",
|
|
2445
|
-
height: this.lastCropSize[
|
|
2545
|
+
height: this.lastCropSize[r.Pixel].height,
|
|
2446
2546
|
keepAspectRatio: !0,
|
|
2447
2547
|
percentageHeight: 100,
|
|
2448
2548
|
percentageWidth: 100,
|
|
2449
|
-
position:
|
|
2549
|
+
position: D.CenterCenter,
|
|
2450
2550
|
ratioHeight: 1,
|
|
2451
2551
|
ratioWidth: 1,
|
|
2452
|
-
unit:
|
|
2453
|
-
width: this.lastCropSize[
|
|
2552
|
+
unit: r.Pixel,
|
|
2553
|
+
width: this.lastCropSize[r.Pixel].width,
|
|
2454
2554
|
x: 0,
|
|
2455
2555
|
y: 0
|
|
2456
2556
|
}, this.resizeSize = {
|
|
2457
|
-
height: this.lastResizeSize[
|
|
2557
|
+
height: this.lastResizeSize[r.Pixel].height,
|
|
2458
2558
|
keepAspectRatio: !0,
|
|
2459
2559
|
ratioHeight: 1,
|
|
2460
2560
|
ratioWidth: 1,
|
|
2461
|
-
unit:
|
|
2462
|
-
width: this.lastResizeSize[
|
|
2561
|
+
unit: r.Pixel,
|
|
2562
|
+
width: this.lastResizeSize[r.Pixel].width
|
|
2463
2563
|
};
|
|
2464
2564
|
}
|
|
2465
2565
|
handleLoadingChange() {
|
|
@@ -2479,12 +2579,12 @@ let x = class extends B {
|
|
|
2479
2579
|
}
|
|
2480
2580
|
handleActiveSettingChange() {
|
|
2481
2581
|
this.cropperElement && (this.resizeSize = {
|
|
2482
|
-
height: this.lastResizeSize[
|
|
2582
|
+
height: this.lastResizeSize[r.Pixel].height,
|
|
2483
2583
|
keepAspectRatio: !0,
|
|
2484
2584
|
ratioHeight: 1,
|
|
2485
2585
|
ratioWidth: 1,
|
|
2486
|
-
unit:
|
|
2487
|
-
width: this.lastResizeSize[
|
|
2586
|
+
unit: r.Pixel,
|
|
2587
|
+
width: this.lastResizeSize[r.Pixel].width
|
|
2488
2588
|
}, this.cropperElement.disabled = this.activeSetting !== "cx-asset-link-format-crop");
|
|
2489
2589
|
}
|
|
2490
2590
|
async handleRequestAutoCropSuggestion({
|
|
@@ -2493,33 +2593,33 @@ let x = class extends B {
|
|
|
2493
2593
|
height: i,
|
|
2494
2594
|
keepAspectRatio: s,
|
|
2495
2595
|
percentageHeight: a,
|
|
2496
|
-
percentageWidth:
|
|
2596
|
+
percentageWidth: o,
|
|
2497
2597
|
ratioHeight: n,
|
|
2498
|
-
ratioWidth:
|
|
2499
|
-
unit:
|
|
2500
|
-
useCropMode:
|
|
2598
|
+
ratioWidth: l,
|
|
2599
|
+
unit: d,
|
|
2600
|
+
useCropMode: g,
|
|
2501
2601
|
width: c
|
|
2502
2602
|
}) {
|
|
2503
2603
|
if (!this.selectedFormat?.url || e === "manual")
|
|
2504
2604
|
return;
|
|
2505
2605
|
this.loading = !0, this.lastAction = m.Crop;
|
|
2506
|
-
const
|
|
2606
|
+
const S = await this.apiGetCropFocusMode({
|
|
2507
2607
|
autoCropMode: e,
|
|
2508
2608
|
cropHeight: i,
|
|
2509
2609
|
cropWidth: c,
|
|
2510
2610
|
imageUrl: this.selectedFormat.url
|
|
2511
2611
|
});
|
|
2512
|
-
if (
|
|
2513
|
-
let
|
|
2514
|
-
i || (
|
|
2612
|
+
if (S) {
|
|
2613
|
+
let A = a, p = o;
|
|
2614
|
+
i || (A = S.height * 100 / this.selectedFormat.height), c || (p = S.width * 100 / this.selectedFormat.width), this.cropSize = {
|
|
2515
2615
|
...this.cropSize,
|
|
2516
|
-
height:
|
|
2517
|
-
percentageHeight:
|
|
2518
|
-
percentageWidth:
|
|
2519
|
-
width:
|
|
2520
|
-
x:
|
|
2521
|
-
y:
|
|
2522
|
-
...
|
|
2616
|
+
height: S.height,
|
|
2617
|
+
percentageHeight: A ?? this.cropSize.percentageHeight,
|
|
2618
|
+
percentageWidth: p ?? this.cropSize.percentageWidth,
|
|
2619
|
+
width: S.width,
|
|
2620
|
+
x: S.x * 100 / this.selectedFormat.width,
|
|
2621
|
+
y: S.y * 100 / this.selectedFormat.height,
|
|
2622
|
+
...g ? {
|
|
2523
2623
|
cropMode: e,
|
|
2524
2624
|
focusMode: "manual",
|
|
2525
2625
|
keepAspectRatio: !1
|
|
@@ -2529,8 +2629,8 @@ let x = class extends B {
|
|
|
2529
2629
|
},
|
|
2530
2630
|
keepAspectRatio: s ?? this.cropSize.keepAspectRatio,
|
|
2531
2631
|
ratioHeight: n ?? this.cropSize.ratioHeight,
|
|
2532
|
-
ratioWidth:
|
|
2533
|
-
unit:
|
|
2632
|
+
ratioWidth: l ?? this.cropSize.ratioWidth,
|
|
2633
|
+
unit: d ?? this.cropSize.unit
|
|
2534
2634
|
};
|
|
2535
2635
|
}
|
|
2536
2636
|
this.loading = !1, this.lastAction = void 0;
|
|
@@ -2540,32 +2640,32 @@ let x = class extends B {
|
|
|
2540
2640
|
height: i,
|
|
2541
2641
|
width: s,
|
|
2542
2642
|
x: a,
|
|
2543
|
-
y:
|
|
2643
|
+
y: o
|
|
2544
2644
|
} = e;
|
|
2545
2645
|
if (s === 0 || i === 0)
|
|
2546
2646
|
return;
|
|
2547
|
-
const n = this.cropSize.percentageWidth !== s,
|
|
2548
|
-
let
|
|
2549
|
-
n && (
|
|
2647
|
+
const n = this.cropSize.percentageWidth !== s, l = this.cropSize.percentageHeight !== i;
|
|
2648
|
+
let d = this.cropSize.height, g = this.cropSize.width;
|
|
2649
|
+
n && (g = Math.round(s * this.selectedFormat.width / 100)), l && (d = Math.round(
|
|
2550
2650
|
i * this.selectedFormat.height / 100
|
|
2551
2651
|
));
|
|
2552
2652
|
const c = this.cropSize.focusMode;
|
|
2553
2653
|
this.focusModes.find(
|
|
2554
|
-
(
|
|
2654
|
+
(A) => A.value === c
|
|
2555
2655
|
)?.auto && this.selectedFormat?.url && this.cropperElement ? await this.handleRequestAutoCropSuggestion({
|
|
2556
2656
|
focusMode: c,
|
|
2557
|
-
height:
|
|
2657
|
+
height: d,
|
|
2558
2658
|
percentageHeight: i,
|
|
2559
2659
|
percentageWidth: s,
|
|
2560
|
-
width:
|
|
2660
|
+
width: g
|
|
2561
2661
|
}) : this.cropSize = {
|
|
2562
2662
|
...this.cropSize,
|
|
2563
|
-
height:
|
|
2663
|
+
height: d,
|
|
2564
2664
|
percentageHeight: i,
|
|
2565
2665
|
percentageWidth: s,
|
|
2566
|
-
width:
|
|
2666
|
+
width: g,
|
|
2567
2667
|
x: a,
|
|
2568
|
-
y:
|
|
2668
|
+
y: o
|
|
2569
2669
|
};
|
|
2570
2670
|
}
|
|
2571
2671
|
onCropDragStart() {
|
|
@@ -2586,9 +2686,26 @@ let x = class extends B {
|
|
|
2586
2686
|
onDetailsHide(t) {
|
|
2587
2687
|
this.activeSetting === t.target.localName && (this.activeSetting = "");
|
|
2588
2688
|
}
|
|
2689
|
+
/**
|
|
2690
|
+
* The proxy id that `Auto` resolves to for the current asset, or `''` when the mapped
|
|
2691
|
+
* format is not among the available proxies.
|
|
2692
|
+
*
|
|
2693
|
+
* `resolveAutoFormat` yields a proxy *name* (`TRX` / `TR1`) while `selectedProxy` holds
|
|
2694
|
+
* a proxy *id*, so the name has to be looked up in `proxies` rather than used directly.
|
|
2695
|
+
*/
|
|
2696
|
+
get autoResolvedProxyId() {
|
|
2697
|
+
const t = Ot(this.asset?.extension);
|
|
2698
|
+
return this.proxies?.find((e) => e.proxyName === t)?.id ?? "";
|
|
2699
|
+
}
|
|
2589
2700
|
onProxyChange(t) {
|
|
2590
2701
|
const e = t.detail;
|
|
2591
|
-
this.lastAction = m.Proxy,
|
|
2702
|
+
if (this.lastAction = m.Proxy, e.autoFormat) {
|
|
2703
|
+
this.autoFormat = !0;
|
|
2704
|
+
const i = this.autoResolvedProxyId;
|
|
2705
|
+
i && (this.selectedProxy = i);
|
|
2706
|
+
return;
|
|
2707
|
+
}
|
|
2708
|
+
this.autoFormat = !1, this.selectedProxy = e.id;
|
|
2592
2709
|
}
|
|
2593
2710
|
async onCropModeChange(t) {
|
|
2594
2711
|
const { mode: e } = t.detail;
|
|
@@ -2599,22 +2716,22 @@ let x = class extends B {
|
|
|
2599
2716
|
});
|
|
2600
2717
|
else {
|
|
2601
2718
|
const s = this.focusModes.find(
|
|
2602
|
-
(
|
|
2719
|
+
(d) => d.value === this.cropSize.focusMode
|
|
2603
2720
|
)?.auto;
|
|
2604
|
-
let a = this.cropSize.keepAspectRatio,
|
|
2605
|
-
e === "free" ? (a = !1,
|
|
2721
|
+
let a = this.cropSize.keepAspectRatio, o = this.cropSize.focusMode, n = this.cropSize.x, l = this.cropSize.y;
|
|
2722
|
+
e === "free" ? (a = !1, o = "manual") : this.cropSize.unit === r.Pixel && !s && (n = 0, l = 0), s ? await this.handleRequestAutoCropSuggestion({
|
|
2606
2723
|
cropMode: e,
|
|
2607
|
-
focusMode:
|
|
2724
|
+
focusMode: o,
|
|
2608
2725
|
height: this.cropSize.height,
|
|
2609
2726
|
keepAspectRatio: a,
|
|
2610
2727
|
width: this.cropSize.width
|
|
2611
2728
|
}) : this.cropSize = {
|
|
2612
2729
|
...this.cropSize,
|
|
2613
2730
|
cropMode: e,
|
|
2614
|
-
focusMode:
|
|
2731
|
+
focusMode: o,
|
|
2615
2732
|
keepAspectRatio: a,
|
|
2616
2733
|
x: n,
|
|
2617
|
-
y:
|
|
2734
|
+
y: l
|
|
2618
2735
|
};
|
|
2619
2736
|
}
|
|
2620
2737
|
}
|
|
@@ -2637,52 +2754,52 @@ let x = class extends B {
|
|
|
2637
2754
|
}
|
|
2638
2755
|
async onCropChange(t) {
|
|
2639
2756
|
const e = this.cropSize.unit;
|
|
2640
|
-
if (t.detail.unit ===
|
|
2757
|
+
if (t.detail.unit === r.AspectRatio) {
|
|
2641
2758
|
const i = t.detail.width / t.detail.height, s = this.asset ? Math.min(
|
|
2642
2759
|
Math.max(Math.round(this.cropSize.height * i), 0),
|
|
2643
2760
|
this.resizeSize.width
|
|
2644
2761
|
) : 0, a = this.asset ? Math.min(
|
|
2645
2762
|
Math.max(Math.round(s / i), 0),
|
|
2646
2763
|
this.resizeSize.height
|
|
2647
|
-
) : 0,
|
|
2648
|
-
let
|
|
2649
|
-
|
|
2650
|
-
let
|
|
2764
|
+
) : 0, o = this.asset ? a * 100 / this.selectedFormat.height : 100, n = this.asset ? s * 100 / this.selectedFormat.width : 100;
|
|
2765
|
+
let l = this.cropSize.x, d = this.cropSize.y;
|
|
2766
|
+
l + n > 100 && (l = 100 - n), d + o > 100 && (d = 100 - o);
|
|
2767
|
+
let g = this.cropSize.cropMode;
|
|
2651
2768
|
this.cropModes.find(
|
|
2652
|
-
(
|
|
2653
|
-
)?.auto && (
|
|
2769
|
+
(S) => S.value === g
|
|
2770
|
+
)?.auto && (g = "free"), t.detail.silent ? (this.cropSize.height = a, this.cropSize.keepAspectRatio = t.detail.keepAspectRatio, this.cropSize.percentageHeight = o, this.cropSize.percentageWidth = n, this.cropSize.ratioHeight = t.detail.height, this.cropSize.ratioWidth = t.detail.width, this.cropSize.unit = r.AspectRatio, this.cropSize.width = s) : this.cropSize = {
|
|
2654
2771
|
...this.cropSize,
|
|
2655
|
-
cropMode:
|
|
2772
|
+
cropMode: g,
|
|
2656
2773
|
height: a,
|
|
2657
2774
|
keepAspectRatio: t.detail.keepAspectRatio,
|
|
2658
|
-
percentageHeight:
|
|
2775
|
+
percentageHeight: o,
|
|
2659
2776
|
percentageWidth: n,
|
|
2660
2777
|
ratioHeight: t.detail.height,
|
|
2661
2778
|
ratioWidth: t.detail.width,
|
|
2662
|
-
unit:
|
|
2779
|
+
unit: r.AspectRatio,
|
|
2663
2780
|
width: s,
|
|
2664
|
-
x:
|
|
2665
|
-
y:
|
|
2781
|
+
x: l,
|
|
2782
|
+
y: d
|
|
2666
2783
|
};
|
|
2667
2784
|
} else {
|
|
2668
2785
|
const i = this.asset ? t.detail.height * 100 / this.selectedFormat.height : 100, s = this.asset ? t.detail.width * 100 / this.selectedFormat.width : 100;
|
|
2669
|
-
let a = this.cropSize.x,
|
|
2670
|
-
a + s > 100 && (a = 100 - s),
|
|
2786
|
+
let a = this.cropSize.x, o = this.cropSize.y;
|
|
2787
|
+
a + s > 100 && (a = 100 - s), o + i > 100 && (o = 100 - i);
|
|
2671
2788
|
let n = this.cropSize.cropMode;
|
|
2672
|
-
const
|
|
2673
|
-
(
|
|
2789
|
+
const l = this.cropModes.find(
|
|
2790
|
+
(d) => d.value === n
|
|
2674
2791
|
)?.auto;
|
|
2675
|
-
(t.detail.breakAspectRatio ||
|
|
2792
|
+
(t.detail.breakAspectRatio || l) && (n = "free"), t.detail.silent ? (this.cropSize.cropMode = n, this.cropSize.height = t.detail.height, this.cropSize.keepAspectRatio = t.detail.keepAspectRatio, this.cropSize.percentageHeight = i, this.cropSize.percentageWidth = s, this.cropSize.unit = r.Pixel, this.cropSize.width = t.detail.width, this.cropSize.x = a, this.cropSize.y = o) : this.cropSize = {
|
|
2676
2793
|
...this.cropSize,
|
|
2677
2794
|
cropMode: n,
|
|
2678
2795
|
height: t.detail.height,
|
|
2679
2796
|
keepAspectRatio: t.detail.keepAspectRatio,
|
|
2680
2797
|
percentageHeight: i,
|
|
2681
2798
|
percentageWidth: s,
|
|
2682
|
-
unit:
|
|
2799
|
+
unit: r.Pixel,
|
|
2683
2800
|
width: t.detail.width,
|
|
2684
2801
|
x: a,
|
|
2685
|
-
y:
|
|
2802
|
+
y: o
|
|
2686
2803
|
};
|
|
2687
2804
|
}
|
|
2688
2805
|
e !== this.cropSize.unit && (this.cropSize = {
|
|
@@ -2700,43 +2817,43 @@ let x = class extends B {
|
|
|
2700
2817
|
});
|
|
2701
2818
|
}
|
|
2702
2819
|
onCropApply(t) {
|
|
2703
|
-
if (this.
|
|
2820
|
+
if (this.clearResetSnapshot(), this.lastAction = m.Crop, !this.asset) {
|
|
2704
2821
|
const {
|
|
2705
|
-
focusMode:
|
|
2706
|
-
height:
|
|
2707
|
-
position:
|
|
2822
|
+
focusMode: l,
|
|
2823
|
+
height: d,
|
|
2824
|
+
position: g,
|
|
2708
2825
|
ratioHeight: c,
|
|
2709
|
-
ratioWidth:
|
|
2710
|
-
unit:
|
|
2711
|
-
width:
|
|
2712
|
-
x:
|
|
2713
|
-
y:
|
|
2714
|
-
} = this.cropSize,
|
|
2715
|
-
(
|
|
2826
|
+
ratioWidth: S,
|
|
2827
|
+
unit: A,
|
|
2828
|
+
width: p,
|
|
2829
|
+
x: y,
|
|
2830
|
+
y: k
|
|
2831
|
+
} = this.cropSize, f = this.focusModes.find(
|
|
2832
|
+
(F) => F.value === l
|
|
2716
2833
|
)?.auto ?? !1;
|
|
2717
|
-
if (
|
|
2718
|
-
|
|
2834
|
+
if (A === r.AspectRatio) {
|
|
2835
|
+
S && c && this.upsertTransformation({
|
|
2719
2836
|
key: m.Crop,
|
|
2720
2837
|
value: {
|
|
2721
|
-
focusMode:
|
|
2722
|
-
isFocusModeAuto:
|
|
2723
|
-
position:
|
|
2838
|
+
focusMode: l,
|
|
2839
|
+
isFocusModeAuto: f,
|
|
2840
|
+
position: g,
|
|
2724
2841
|
ratioHeight: c,
|
|
2725
|
-
ratioWidth:
|
|
2726
|
-
unit:
|
|
2842
|
+
ratioWidth: S,
|
|
2843
|
+
unit: A
|
|
2727
2844
|
}
|
|
2728
2845
|
});
|
|
2729
2846
|
return;
|
|
2730
2847
|
}
|
|
2731
|
-
(
|
|
2848
|
+
(d || p) && this.upsertTransformation({
|
|
2732
2849
|
key: m.Crop,
|
|
2733
2850
|
value: {
|
|
2734
|
-
focusMode:
|
|
2735
|
-
height:
|
|
2736
|
-
isFocusModeAuto:
|
|
2737
|
-
position:
|
|
2738
|
-
unit:
|
|
2739
|
-
width:
|
|
2851
|
+
focusMode: l,
|
|
2852
|
+
height: d,
|
|
2853
|
+
isFocusModeAuto: f,
|
|
2854
|
+
position: g,
|
|
2855
|
+
unit: A,
|
|
2856
|
+
width: p,
|
|
2740
2857
|
/**
|
|
2741
2858
|
* Without an asset there is no cropper to drag, so x/y are always the 0
|
|
2742
2859
|
* placeholder from cropSize's default — never a real manual offset. Omit
|
|
@@ -2744,8 +2861,8 @@ let x = class extends B {
|
|
|
2744
2861
|
* string) so `hasManualXY` in buildTransformationString doesn't spuriously
|
|
2745
2862
|
* suppress the focus mode / position `c_g_` gravity value.
|
|
2746
2863
|
*/
|
|
2747
|
-
x: Number.isFinite(
|
|
2748
|
-
y: Number.isFinite(
|
|
2864
|
+
x: Number.isFinite(y) && y !== 0 ? y : void 0,
|
|
2865
|
+
y: Number.isFinite(k) && k !== 0 ? k : void 0
|
|
2749
2866
|
}
|
|
2750
2867
|
});
|
|
2751
2868
|
return;
|
|
@@ -2753,38 +2870,38 @@ let x = class extends B {
|
|
|
2753
2870
|
const { height: e, mode: i, unit: s, width: a } = t.detail;
|
|
2754
2871
|
if (!this.cropperElement || !this.selectedFormat)
|
|
2755
2872
|
return;
|
|
2756
|
-
const
|
|
2757
|
-
(
|
|
2873
|
+
const o = this.cropSize.focusMode, n = this.focusModes.find(
|
|
2874
|
+
(l) => l.value === o
|
|
2758
2875
|
)?.auto ?? !1;
|
|
2759
2876
|
if (e && a && s) {
|
|
2760
|
-
let
|
|
2761
|
-
if (s ===
|
|
2877
|
+
let l = a, d = e;
|
|
2878
|
+
if (s === r.AspectRatio && (l = this.cropSize.percentageWidth * this.selectedFormat.width / 100, d = this.cropSize.percentageHeight * this.selectedFormat.height / 100), i)
|
|
2762
2879
|
this.transformations = [
|
|
2763
2880
|
...this.transformations,
|
|
2764
2881
|
{
|
|
2765
2882
|
key: m.Crop,
|
|
2766
2883
|
value: {
|
|
2767
|
-
focusMode:
|
|
2768
|
-
height:
|
|
2884
|
+
focusMode: o,
|
|
2885
|
+
height: d,
|
|
2769
2886
|
isFocusModeAuto: n,
|
|
2770
2887
|
mode: i,
|
|
2771
|
-
width:
|
|
2888
|
+
width: l
|
|
2772
2889
|
}
|
|
2773
2890
|
}
|
|
2774
2891
|
];
|
|
2775
2892
|
else {
|
|
2776
|
-
const
|
|
2893
|
+
const g = this.cropSize.x / 100 * this.selectedFormat.width, c = this.cropSize.y / 100 * this.selectedFormat.height;
|
|
2777
2894
|
this.transformations = [
|
|
2778
2895
|
...this.transformations,
|
|
2779
2896
|
{
|
|
2780
2897
|
key: m.Crop,
|
|
2781
2898
|
value: {
|
|
2782
|
-
focusMode:
|
|
2783
|
-
height:
|
|
2899
|
+
focusMode: o,
|
|
2900
|
+
height: d,
|
|
2784
2901
|
isFocusModeAuto: n,
|
|
2785
2902
|
unit: s,
|
|
2786
|
-
width:
|
|
2787
|
-
x:
|
|
2903
|
+
width: l,
|
|
2904
|
+
x: g,
|
|
2788
2905
|
y: c
|
|
2789
2906
|
}
|
|
2790
2907
|
}
|
|
@@ -2795,7 +2912,7 @@ let x = class extends B {
|
|
|
2795
2912
|
{
|
|
2796
2913
|
key: m.Crop,
|
|
2797
2914
|
value: {
|
|
2798
|
-
focusMode:
|
|
2915
|
+
focusMode: o,
|
|
2799
2916
|
isFocusModeAuto: n,
|
|
2800
2917
|
mode: i
|
|
2801
2918
|
}
|
|
@@ -2803,9 +2920,9 @@ let x = class extends B {
|
|
|
2803
2920
|
]);
|
|
2804
2921
|
}
|
|
2805
2922
|
onResizeChange(t) {
|
|
2806
|
-
if (t.detail.unit ===
|
|
2923
|
+
if (t.detail.unit === r.AspectRatio) {
|
|
2807
2924
|
const e = t.detail.width / t.detail.height, i = Math.max(
|
|
2808
|
-
Math.round(this.lastResizeSize[
|
|
2925
|
+
Math.round(this.lastResizeSize[r.Pixel].height * e),
|
|
2809
2926
|
0
|
|
2810
2927
|
), s = Math.max(Math.round(i / e), 0);
|
|
2811
2928
|
this.resizeSize = {
|
|
@@ -2828,14 +2945,14 @@ let x = class extends B {
|
|
|
2828
2945
|
}
|
|
2829
2946
|
onResizeApply(t) {
|
|
2830
2947
|
const { height: e, unit: i, width: s } = t.detail;
|
|
2831
|
-
if (this.
|
|
2832
|
-
if (i ===
|
|
2833
|
-
const { ratioHeight:
|
|
2834
|
-
|
|
2948
|
+
if (this.clearResetSnapshot(), this.lastAction = m.Resize, !this.asset) {
|
|
2949
|
+
if (i === r.AspectRatio) {
|
|
2950
|
+
const { ratioHeight: d, ratioWidth: g } = this.resizeSize;
|
|
2951
|
+
g && d && this.upsertTransformation({
|
|
2835
2952
|
key: m.Resize,
|
|
2836
2953
|
value: {
|
|
2837
|
-
ratioHeight:
|
|
2838
|
-
ratioWidth:
|
|
2954
|
+
ratioHeight: d,
|
|
2955
|
+
ratioWidth: g,
|
|
2839
2956
|
unit: i
|
|
2840
2957
|
}
|
|
2841
2958
|
});
|
|
@@ -2853,14 +2970,14 @@ let x = class extends B {
|
|
|
2853
2970
|
}
|
|
2854
2971
|
if (!this.selectedFormat)
|
|
2855
2972
|
return;
|
|
2856
|
-
const a = this.selectedFormat.width || this.defaultSize.width,
|
|
2857
|
-
let n = s,
|
|
2858
|
-
this.resizeSize.unit !== i ? (n = a,
|
|
2973
|
+
const a = this.selectedFormat.width || this.defaultSize.width, o = this.selectedFormat.height || this.defaultSize.height;
|
|
2974
|
+
let n = s, l = e;
|
|
2975
|
+
this.resizeSize.unit !== i ? (n = a, l = o) : i === r.AspectRatio && (n = Math.round(s / e * o), l = o), this.transformations = [
|
|
2859
2976
|
...this.transformations,
|
|
2860
2977
|
{
|
|
2861
2978
|
key: m.Resize,
|
|
2862
2979
|
value: {
|
|
2863
|
-
height:
|
|
2980
|
+
height: l,
|
|
2864
2981
|
unit: i,
|
|
2865
2982
|
width: n
|
|
2866
2983
|
}
|
|
@@ -2872,7 +2989,7 @@ let x = class extends B {
|
|
|
2872
2989
|
}
|
|
2873
2990
|
onRotationApply(t) {
|
|
2874
2991
|
const e = t.detail;
|
|
2875
|
-
if (this.
|
|
2992
|
+
if (this.clearResetSnapshot(), this.lastAction = m.Rotate, !this.asset) {
|
|
2876
2993
|
e ? this.upsertTransformation({
|
|
2877
2994
|
key: m.Rotate,
|
|
2878
2995
|
value: {
|
|
@@ -2895,7 +3012,7 @@ let x = class extends B {
|
|
|
2895
3012
|
}
|
|
2896
3013
|
onQualityChange(t) {
|
|
2897
3014
|
const e = t.detail;
|
|
2898
|
-
this.selectedFormat && (this.selectedFormat.quality = e), this.
|
|
3015
|
+
this.selectedFormat && (this.selectedFormat.quality = e), this.clearResetSnapshot(), this.lastAction = m.Quality;
|
|
2899
3016
|
const i = {
|
|
2900
3017
|
key: m.Quality,
|
|
2901
3018
|
value: {
|
|
@@ -2906,7 +3023,7 @@ let x = class extends B {
|
|
|
2906
3023
|
}
|
|
2907
3024
|
onMetadataChange(t) {
|
|
2908
3025
|
const e = t.detail;
|
|
2909
|
-
if (this.
|
|
3026
|
+
if (this.clearResetSnapshot(), this.selectedFormat && (this.selectedFormat = {
|
|
2910
3027
|
...this.selectedFormat,
|
|
2911
3028
|
keepMetadata: e
|
|
2912
3029
|
}), !this.asset) {
|
|
@@ -2945,196 +3062,228 @@ let x = class extends B {
|
|
|
2945
3062
|
quality: t ?? 100
|
|
2946
3063
|
});
|
|
2947
3064
|
}
|
|
3065
|
+
/**
|
|
3066
|
+
* Whether there is anything for Reset to undo.
|
|
3067
|
+
*
|
|
3068
|
+
* Transformations are one way to diverge from the defaults; leaving `Auto` for an
|
|
3069
|
+
* explicit format is another, and Reset is what puts that back.
|
|
3070
|
+
*/
|
|
3071
|
+
get hasResettableState() {
|
|
3072
|
+
return this.transformations.length > 0 ? !0 : this.canAutoFormat && !this.autoFormat;
|
|
3073
|
+
}
|
|
3074
|
+
/**
|
|
3075
|
+
* Drops the one-step Reset snapshot.
|
|
3076
|
+
*
|
|
3077
|
+
* Called whenever the user applies a new transformation: at that point Undo means
|
|
3078
|
+
* "remove that transformation", not "go back to before the Reset".
|
|
3079
|
+
*/
|
|
3080
|
+
clearResetSnapshot() {
|
|
3081
|
+
this.preResetTransformations = void 0, this.preResetAutoFormat = void 0, this.preResetSelectedProxy = void 0;
|
|
3082
|
+
}
|
|
2948
3083
|
handleUndo() {
|
|
2949
|
-
!this.hasUnfrozenTransformations && this.preResetTransformations !== void 0 ? (this.transformations = this.preResetTransformations, this.preResetTransformations = void 0) : this.transformations = this.transformations.slice(0, -1), this.syncQuality();
|
|
3084
|
+
!this.hasUnfrozenTransformations && this.preResetTransformations !== void 0 ? (this.transformations = this.preResetTransformations, this.preResetTransformations = void 0, this.preResetAutoFormat !== void 0 && (this.autoFormat = this.preResetAutoFormat, this.preResetAutoFormat = void 0), this.preResetSelectedProxy !== void 0 && (this.selectedProxy = this.preResetSelectedProxy, this.preResetSelectedProxy = void 0)) : this.transformations = this.transformations.slice(0, -1), this.syncQuality();
|
|
2950
3085
|
}
|
|
2951
3086
|
handleReset() {
|
|
2952
|
-
this.preResetTransformations = [...this.transformations]
|
|
2953
|
-
|
|
2954
|
-
|
|
3087
|
+
if (this.preResetTransformations = [...this.transformations], this.preResetAutoFormat = this.autoFormat, this.preResetSelectedProxy = this.selectedProxy, this.canAutoFormat)
|
|
3088
|
+
this.autoFormat = !0, this.selectedProxy = this.autoResolvedProxyId || this.selectedProxy;
|
|
3089
|
+
else {
|
|
3090
|
+
const t = !!this.defaultProxy && !!this.proxies?.some((e) => e.id === this.defaultProxy);
|
|
3091
|
+
this.selectedProxy = t ? this.defaultProxy : this.selectedProxy || this.proxies?.[0]?.id || "";
|
|
3092
|
+
}
|
|
3093
|
+
this.transformations = [], this.frozenIndex = -1, this.syncQuality();
|
|
2955
3094
|
}
|
|
2956
3095
|
render() {
|
|
2957
|
-
return
|
|
3096
|
+
return C`<div class="asset-link-format" @cx-show=${this.onDetailsShow} @cx-hide=${this.onDetailsHide}>${_(
|
|
2958
3097
|
!this.hideHeader,
|
|
2959
|
-
() =>
|
|
2960
|
-
() =>
|
|
3098
|
+
() => C`<cx-space class="asset-link-format__section-header" direction="horizontal" spacing="small" align-items="center" justify-content="space-between"><cx-typography variant="body3">${this.localize.term("transformations")}</cx-typography><cx-space direction="horizontal" spacing="3x-small" align-items="center"><cx-button class="asset-link-format__undo" variant="custom" ?disabled=${!this.hasUnfrozenTransformations && this.preResetTransformations === void 0} @click=${this.handleUndo}>${this.localize.term("undo")}</cx-button>${_(this.canReset, () => C`<cx-button class="asset-link-format__reset" variant="custom" ?disabled=${!this.hasResettableState} @click=${this.handleReset}>${this.localize.term("reset")}</cx-button>`)}</cx-space></cx-space>`,
|
|
3099
|
+
() => Nt
|
|
2961
3100
|
)}
|
|
2962
|
-
${
|
|
3101
|
+
${_(
|
|
2963
3102
|
!this.noFormat,
|
|
2964
|
-
() =>
|
|
3103
|
+
() => C`<cx-asset-link-format-proxy class="asset-link-format__details" value=${this.selectedProxy || this.proxies?.[0]?.id || ""} ?open=${this.activeSetting === "cx-asset-link-format-proxy"} ?auto-format=${this.autoFormat} ?can-auto-format=${this.canAutoFormat} .items=${this.formats} ?loading=${this.loading && this.lastAction === m.Proxy} @cx-asset-link-format-proxy-change=${this.onProxyChange}></cx-asset-link-format-proxy>`
|
|
2965
3104
|
)}
|
|
2966
|
-
${
|
|
3105
|
+
${_(
|
|
2967
3106
|
!this.noCrop,
|
|
2968
|
-
() =>
|
|
3107
|
+
() => C`<cx-asset-link-format-crop class="asset-link-format__details" ?open=${this.activeSetting === "cx-asset-link-format-crop"} ?disabled-apply=${this.disabledCropApply} ?loading=${this.loading && this.lastAction === m.Crop} ?keep-aspect-ratio=${this.cropSize.keepAspectRatio} ?show-position-picker=${!this.asset} focus-mode=${this.cropSize.focusMode} crop-mode=${this.cropSize.cropMode} width=${this.cropSize.width} height=${this.cropSize.height} max-width=${this.asset ? this.lastResizeSize[r.Pixel].width : 1 / 0} max-height=${this.asset ? this.lastResizeSize[r.Pixel].height : 1 / 0} percentage-width=${this.cropSize.percentageWidth} percentage-height=${this.cropSize.percentageHeight} position=${this.cropSize.position} ratio-width=${this.cropSize.ratioWidth} ratio-height=${this.cropSize.ratioHeight} unit=${this.cropSize.unit} .lastAppliedSetting=${this.lastCropSize} .cropModes=${this.cropModes} .focusModes=${this.focusModes} @cx-asset-link-format-crop-mode-change=${this.onCropModeChange} @cx-asset-link-format-crop-focus-mode-change=${this.onCropFocusModeChange} @cx-asset-link-format-crop-position-change=${this.onCropPositionChange} @cx-asset-link-format-crop-change=${this.onCropChange} @cx-asset-link-format-crop-changed=${this.onCropChanged} @cx-asset-link-format-crop-apply=${this.onCropApply}></cx-asset-link-format-crop>`
|
|
2969
3108
|
)}
|
|
2970
|
-
${
|
|
3109
|
+
${_(
|
|
2971
3110
|
!this.noResize,
|
|
2972
|
-
() =>
|
|
3111
|
+
() => C`<cx-asset-link-format-resize class="asset-link-format__details" ?open=${this.activeSetting === "cx-asset-link-format-resize"} ?loading=${this.loading && this.lastAction === m.Resize} ?no-ratio-modes=${!this.asset} ?keep-aspect-ratio=${this.resizeSize.keepAspectRatio} width=${this.resizeSize.width} height=${this.resizeSize.height} max-width=${this.asset ? this.imageSize.width : 1 / 0} max-height=${this.asset ? this.imageSize.height : 1 / 0} ratio-width=${this.resizeSize.ratioWidth} ratio-height=${this.resizeSize.ratioHeight} unit=${this.resizeSize.unit} .lastAppliedSetting=${this.lastResizeSize} @cx-asset-link-format-resize-change=${this.onResizeChange} @cx-asset-link-format-resize-apply=${this.onResizeApply}></cx-asset-link-format-resize>`
|
|
2973
3112
|
)}
|
|
2974
|
-
${
|
|
3113
|
+
${_(
|
|
2975
3114
|
!this.noRotate,
|
|
2976
|
-
() =>
|
|
2977
|
-
)}<cx-asset-link-format-quality class="asset-link-format__details" ?loading=${this.loading && this.lastAction === m.Quality} ?open=${this.activeSetting === "cx-asset-link-format-quality"} value=${this.selectedFormat?.quality ?? 100} @cx-asset-link-format-quality-change=${this.onQualityChange}></cx-asset-link-format-quality>${
|
|
3115
|
+
() => C`<cx-asset-link-format-rotation class="asset-link-format__details" ?loading=${this.loading && this.lastAction === m.Rotate} ?open=${this.activeSetting === "cx-asset-link-format-rotation"} default-value=${this.selectedFormat?.rotation ?? 0} last-applied-value=${this.lastRotation} value=${this.rotation} @cx-asset-link-format-rotation-change=${this.onRotationChange} @cx-asset-link-format-rotation-apply=${this.onRotationApply}></cx-asset-link-format-rotation>`
|
|
3116
|
+
)}<cx-asset-link-format-quality class="asset-link-format__details" ?loading=${this.loading && this.lastAction === m.Quality} ?open=${this.activeSetting === "cx-asset-link-format-quality"} value=${this.selectedFormat?.quality ?? 100} @cx-asset-link-format-quality-change=${this.onQualityChange}></cx-asset-link-format-quality>${_(
|
|
2978
3117
|
!this.noMetadata,
|
|
2979
|
-
() =>
|
|
3118
|
+
() => C`<cx-asset-link-format-metadata class="asset-link-format__details" ?open=${this.activeSetting === "cx-asset-link-format-metadata"} .value=${this.selectedFormat?.keepMetadata ?? !1} @cx-asset-link-format-metadata-change=${this.onMetadataChange}></cx-asset-link-format-metadata>`
|
|
2980
3119
|
)}
|
|
2981
|
-
${
|
|
3120
|
+
${_(
|
|
2982
3121
|
this.useCustomExtension,
|
|
2983
|
-
() =>
|
|
3122
|
+
() => C`<cx-asset-link-format-extension .items=${this.extensions} value=${this.selectedFormat?.extension ?? ""} @cx-asset-link-format-extension-change=${this.onExtensionChange}></cx-asset-link-format-extension>`
|
|
2984
3123
|
)}</div>`;
|
|
2985
3124
|
}
|
|
2986
3125
|
};
|
|
2987
|
-
|
|
2988
|
-
|
|
2989
|
-
"cx-asset-link-format-crop":
|
|
2990
|
-
"cx-asset-link-format-extension":
|
|
3126
|
+
u.styles = [V, be];
|
|
3127
|
+
u.dependencies = {
|
|
3128
|
+
"cx-asset-link-format-crop": v,
|
|
3129
|
+
"cx-asset-link-format-extension": X,
|
|
2991
3130
|
"cx-asset-link-format-metadata": O,
|
|
2992
|
-
"cx-asset-link-format-proxy":
|
|
3131
|
+
"cx-asset-link-format-proxy": M,
|
|
2993
3132
|
"cx-asset-link-format-quality": T,
|
|
2994
|
-
"cx-asset-link-format-resize":
|
|
3133
|
+
"cx-asset-link-format-resize": w,
|
|
2995
3134
|
"cx-asset-link-format-rotation": H,
|
|
2996
3135
|
"cx-button": Z,
|
|
2997
3136
|
"cx-space": L,
|
|
2998
3137
|
"cx-typography": U
|
|
2999
3138
|
};
|
|
3000
|
-
|
|
3001
|
-
|
|
3002
|
-
],
|
|
3003
|
-
|
|
3004
|
-
|
|
3005
|
-
],
|
|
3006
|
-
|
|
3007
|
-
|
|
3008
|
-
],
|
|
3009
|
-
|
|
3010
|
-
|
|
3011
|
-
],
|
|
3012
|
-
|
|
3013
|
-
|
|
3014
|
-
],
|
|
3015
|
-
|
|
3016
|
-
|
|
3017
|
-
],
|
|
3018
|
-
|
|
3019
|
-
|
|
3020
|
-
],
|
|
3021
|
-
|
|
3022
|
-
|
|
3023
|
-
],
|
|
3024
|
-
|
|
3025
|
-
|
|
3026
|
-
],
|
|
3027
|
-
|
|
3028
|
-
|
|
3029
|
-
],
|
|
3030
|
-
|
|
3031
|
-
|
|
3032
|
-
],
|
|
3033
|
-
|
|
3034
|
-
|
|
3035
|
-
],
|
|
3036
|
-
|
|
3037
|
-
|
|
3038
|
-
],
|
|
3039
|
-
|
|
3040
|
-
|
|
3041
|
-
],
|
|
3042
|
-
|
|
3043
|
-
|
|
3044
|
-
],
|
|
3045
|
-
|
|
3046
|
-
|
|
3047
|
-
],
|
|
3048
|
-
|
|
3049
|
-
|
|
3050
|
-
],
|
|
3051
|
-
|
|
3052
|
-
|
|
3053
|
-
],
|
|
3054
|
-
|
|
3055
|
-
|
|
3056
|
-
],
|
|
3057
|
-
|
|
3058
|
-
|
|
3059
|
-
],
|
|
3060
|
-
|
|
3061
|
-
|
|
3062
|
-
],
|
|
3063
|
-
|
|
3064
|
-
|
|
3065
|
-
],
|
|
3066
|
-
|
|
3067
|
-
|
|
3068
|
-
],
|
|
3069
|
-
|
|
3070
|
-
|
|
3071
|
-
],
|
|
3072
|
-
|
|
3073
|
-
|
|
3074
|
-
],
|
|
3075
|
-
|
|
3076
|
-
|
|
3077
|
-
],
|
|
3078
|
-
|
|
3079
|
-
|
|
3080
|
-
],
|
|
3081
|
-
|
|
3082
|
-
|
|
3083
|
-
],
|
|
3084
|
-
|
|
3085
|
-
|
|
3086
|
-
],
|
|
3087
|
-
|
|
3088
|
-
|
|
3089
|
-
],
|
|
3090
|
-
|
|
3091
|
-
|
|
3092
|
-
],
|
|
3093
|
-
|
|
3094
|
-
|
|
3095
|
-
],
|
|
3096
|
-
|
|
3097
|
-
|
|
3098
|
-
],
|
|
3099
|
-
|
|
3100
|
-
|
|
3101
|
-
],
|
|
3102
|
-
|
|
3103
|
-
|
|
3104
|
-
],
|
|
3105
|
-
|
|
3106
|
-
|
|
3107
|
-
],
|
|
3108
|
-
|
|
3109
|
-
|
|
3110
|
-
],
|
|
3111
|
-
x
|
|
3139
|
+
x([
|
|
3140
|
+
h({ attribute: "base-url", type: String })
|
|
3141
|
+
], u.prototype, "baseUrl", 2);
|
|
3142
|
+
x([
|
|
3143
|
+
h({ attribute: "token", type: String })
|
|
3144
|
+
], u.prototype, "token", 2);
|
|
3145
|
+
x([
|
|
3146
|
+
h({ reflect: !1, type: Object })
|
|
3147
|
+
], u.prototype, "asset", 2);
|
|
3148
|
+
x([
|
|
3149
|
+
h({ attribute: "crop-modes", reflect: !1, type: Array })
|
|
3150
|
+
], u.prototype, "cropModes", 2);
|
|
3151
|
+
x([
|
|
3152
|
+
h({ attribute: "focus-modes", reflect: !1, type: Object })
|
|
3153
|
+
], u.prototype, "focusModes", 2);
|
|
3154
|
+
x([
|
|
3155
|
+
h({ reflect: !1, type: Array })
|
|
3156
|
+
], u.prototype, "extensions", 2);
|
|
3157
|
+
x([
|
|
3158
|
+
h({ reflect: !1, type: Array })
|
|
3159
|
+
], u.prototype, "proxies", 2);
|
|
3160
|
+
x([
|
|
3161
|
+
h({ attribute: "for-cropper", reflect: !0, type: String })
|
|
3162
|
+
], u.prototype, "forCropper", 2);
|
|
3163
|
+
x([
|
|
3164
|
+
h({ attribute: "use-session", reflect: !0, type: String })
|
|
3165
|
+
], u.prototype, "useSession", 2);
|
|
3166
|
+
x([
|
|
3167
|
+
h({ reflect: !1, type: Array })
|
|
3168
|
+
], u.prototype, "transformations", 2);
|
|
3169
|
+
x([
|
|
3170
|
+
h({ attribute: "selected-proxy", reflect: !0, type: String })
|
|
3171
|
+
], u.prototype, "selectedProxy", 2);
|
|
3172
|
+
x([
|
|
3173
|
+
h({ attribute: "default-proxy", reflect: !0, type: String })
|
|
3174
|
+
], u.prototype, "defaultProxy", 2);
|
|
3175
|
+
x([
|
|
3176
|
+
h({ attribute: "can-auto-format", reflect: !0, type: Boolean })
|
|
3177
|
+
], u.prototype, "canAutoFormat", 2);
|
|
3178
|
+
x([
|
|
3179
|
+
h({ attribute: "auto-format", reflect: !0, type: Boolean })
|
|
3180
|
+
], u.prototype, "autoFormat", 2);
|
|
3181
|
+
x([
|
|
3182
|
+
h({ attribute: "use-custom-extension", reflect: !0, type: Boolean })
|
|
3183
|
+
], u.prototype, "useCustomExtension", 2);
|
|
3184
|
+
x([
|
|
3185
|
+
h({ attribute: "no-metadata", reflect: !0, type: Boolean })
|
|
3186
|
+
], u.prototype, "noMetadata", 2);
|
|
3187
|
+
x([
|
|
3188
|
+
h({ attribute: "no-format", reflect: !0, type: Boolean })
|
|
3189
|
+
], u.prototype, "noFormat", 2);
|
|
3190
|
+
x([
|
|
3191
|
+
h({ attribute: "no-crop", reflect: !0, type: Boolean })
|
|
3192
|
+
], u.prototype, "noCrop", 2);
|
|
3193
|
+
x([
|
|
3194
|
+
h({ attribute: "no-resize", reflect: !0, type: Boolean })
|
|
3195
|
+
], u.prototype, "noResize", 2);
|
|
3196
|
+
x([
|
|
3197
|
+
h({ attribute: "no-rotate", reflect: !0, type: Boolean })
|
|
3198
|
+
], u.prototype, "noRotate", 2);
|
|
3199
|
+
x([
|
|
3200
|
+
h({ attribute: "last-image-size", reflect: !1, type: Object })
|
|
3201
|
+
], u.prototype, "lastImageSize", 2);
|
|
3202
|
+
x([
|
|
3203
|
+
h({ attribute: "hide-header", reflect: !1, type: Boolean })
|
|
3204
|
+
], u.prototype, "hideHeader", 2);
|
|
3205
|
+
x([
|
|
3206
|
+
h({ attribute: "can-reset", type: Boolean })
|
|
3207
|
+
], u.prototype, "canReset", 2);
|
|
3208
|
+
x([
|
|
3209
|
+
h({ attribute: !1, reflect: !1, type: Object })
|
|
3210
|
+
], u.prototype, "queryElement", 2);
|
|
3211
|
+
x([
|
|
3212
|
+
b()
|
|
3213
|
+
], u.prototype, "activeSetting", 2);
|
|
3214
|
+
x([
|
|
3215
|
+
b()
|
|
3216
|
+
], u.prototype, "selectedFormat", 2);
|
|
3217
|
+
x([
|
|
3218
|
+
b()
|
|
3219
|
+
], u.prototype, "resizeSize", 2);
|
|
3220
|
+
x([
|
|
3221
|
+
b()
|
|
3222
|
+
], u.prototype, "cropSize", 2);
|
|
3223
|
+
x([
|
|
3224
|
+
b()
|
|
3225
|
+
], u.prototype, "rotation", 2);
|
|
3226
|
+
x([
|
|
3227
|
+
b()
|
|
3228
|
+
], u.prototype, "defaultSize", 2);
|
|
3229
|
+
x([
|
|
3230
|
+
b()
|
|
3231
|
+
], u.prototype, "cropperElement", 2);
|
|
3232
|
+
x([
|
|
3233
|
+
b()
|
|
3234
|
+
], u.prototype, "parameters", 2);
|
|
3235
|
+
x([
|
|
3236
|
+
b()
|
|
3237
|
+
], u.prototype, "loading", 2);
|
|
3238
|
+
x([
|
|
3239
|
+
b()
|
|
3240
|
+
], u.prototype, "lastAction", 2);
|
|
3241
|
+
x([
|
|
3242
|
+
b()
|
|
3243
|
+
], u.prototype, "frozenIndex", 2);
|
|
3244
|
+
x([
|
|
3245
|
+
b()
|
|
3246
|
+
], u.prototype, "preResetTransformations", 2);
|
|
3247
|
+
x([
|
|
3248
|
+
b()
|
|
3249
|
+
], u.prototype, "preResetAutoFormat", 2);
|
|
3250
|
+
x([
|
|
3251
|
+
b()
|
|
3252
|
+
], u.prototype, "preResetSelectedProxy", 2);
|
|
3253
|
+
x([
|
|
3254
|
+
P("transformations")
|
|
3255
|
+
], u.prototype, "handleTransformationsChange", 1);
|
|
3256
|
+
x([
|
|
3257
|
+
P("selectedProxy")
|
|
3258
|
+
], u.prototype, "handleSelectedProxyChange", 1);
|
|
3259
|
+
x([
|
|
3260
|
+
P("loading")
|
|
3261
|
+
], u.prototype, "handleLoadingChange", 1);
|
|
3262
|
+
u = x([
|
|
3112
3263
|
G("cx-asset-link-format")
|
|
3113
|
-
],
|
|
3264
|
+
], u);
|
|
3114
3265
|
export {
|
|
3115
|
-
|
|
3116
|
-
|
|
3117
|
-
|
|
3118
|
-
|
|
3119
|
-
|
|
3120
|
-
|
|
3121
|
-
|
|
3122
|
-
|
|
3123
|
-
|
|
3124
|
-
Ii as f,
|
|
3125
|
-
Bt as g,
|
|
3266
|
+
u as C,
|
|
3267
|
+
ot as F,
|
|
3268
|
+
Ae as a,
|
|
3269
|
+
pe as b,
|
|
3270
|
+
Bt as c,
|
|
3271
|
+
Ni as d,
|
|
3272
|
+
Oi as e,
|
|
3273
|
+
Di as f,
|
|
3274
|
+
jt as g,
|
|
3126
3275
|
ut as h,
|
|
3127
|
-
|
|
3276
|
+
Vt as i,
|
|
3128
3277
|
lt as j,
|
|
3129
|
-
|
|
3278
|
+
ct as k,
|
|
3130
3279
|
Mt as l,
|
|
3131
3280
|
pt as m,
|
|
3132
3281
|
dt as n,
|
|
3133
3282
|
Et as o,
|
|
3134
|
-
|
|
3135
|
-
|
|
3136
|
-
|
|
3137
|
-
|
|
3138
|
-
|
|
3139
|
-
|
|
3283
|
+
Li as p,
|
|
3284
|
+
oe as q,
|
|
3285
|
+
Hi as r,
|
|
3286
|
+
Ti as s,
|
|
3287
|
+
Wi as t,
|
|
3288
|
+
ae as u
|
|
3140
3289
|
};
|