@orangelogic/design-system 2.192.0 → 2.193.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.CDd4iPA2.js → asset-link-format.BX1hdLgZ.js} +682 -665
- package/library/chunks/{color-swatch-group.NOcRP-23.js → color-swatch-group.BpEQJM1b.js} +1 -1
- package/library/chunks/{document-viewer.CRluR-_W.js → document-viewer.DZsbpf0x.js} +2 -2
- package/library/chunks/{image.CiQwSDfe.js → image.BSvc6eti.js} +10 -6
- package/library/chunks/transformation.CkwgrwKQ.js +312 -0
- package/library/components/asset-link-format.js +2 -2
- package/library/components/atoms.js +2 -2
- package/library/components/color-swatch-group.js +1 -1
- package/library/components/document-viewer.js +2 -2
- package/library/components/image.js +1 -1
- package/library/components/masonry.js +68 -66
- package/library/components/organisms.js +2 -2
- package/library/components/types.js +12609 -12583
- package/library/components/video.js +1 -1
- package/library/package.json +1 -1
- package/library/packages/atoms/src/components/image/image.d.ts +2 -0
- package/library/packages/organisms/src/content-builder/blocks/image/image.d.ts +2 -0
- package/library/packages/services/src/api/asset/asset.d.ts +10 -1
- 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 +13 -4
- package/library/react-web-component.d.ts +4 -4
- package/library/utils.js +34 -33
- package/package.json +1 -1
- package/library/chunks/transformation.BfIEi4p4.js +0 -300
|
@@ -1,50 +1,50 @@
|
|
|
1
1
|
import "../components/cropper.js";
|
|
2
|
-
import { C as
|
|
3
|
-
import
|
|
4
|
-
import { C as
|
|
5
|
-
import { n as h, C as
|
|
6
|
-
import { h as I, a as
|
|
2
|
+
import { C as Y } from "./button.BnkkUqiI.js";
|
|
3
|
+
import U from "../components/space.js";
|
|
4
|
+
import { C as B } from "./typography.IqHbnd3C.js";
|
|
5
|
+
import { n as h, C as q } from "./lib-cortex-element.CVMmyPMC.js";
|
|
6
|
+
import { h as I, a as Ot, C as Lt, S as Yt, b as Jt, c as te, d as ee } from "./endpoints.mJ5S-tIs.js";
|
|
7
7
|
import "./browser.BHOCIF_A.js";
|
|
8
|
-
import { i as
|
|
8
|
+
import { i as j, x as C, E as Ut } from "./lit-element.jLBm65_O.js";
|
|
9
9
|
import "./form.DSsy3Fcy.js";
|
|
10
|
-
import { L as
|
|
11
|
-
import { a as
|
|
10
|
+
import { L as V } from "./i18n.DbXTTLXx.js";
|
|
11
|
+
import { a as ie } from "./string.CfI2ejyR.js";
|
|
12
12
|
import "./date-picker.BGHn6qg8.js";
|
|
13
13
|
import "./content-builder.BX4pHujE.js";
|
|
14
14
|
import "./unsafe-html.Dff7-rCx.js";
|
|
15
|
-
import {
|
|
16
|
-
import { b as
|
|
17
|
-
import { c as
|
|
18
|
-
import { v as
|
|
19
|
-
import { U as r, T as
|
|
20
|
-
import { P as
|
|
21
|
-
import { c as
|
|
15
|
+
import { c as Mt, r as Bt, d as nt } from "./transformation.CkwgrwKQ.js";
|
|
16
|
+
import { b as se } from "./_baseUniq.lwMgmtt2.js";
|
|
17
|
+
import { c as G } from "./component.styles.CRO4Odto.js";
|
|
18
|
+
import { v as ae } from "./v4.CKZ6klMF.js";
|
|
19
|
+
import { U as r, T as f } from "./asset-link-format.ClaYu_v8.js";
|
|
20
|
+
import { P as N } from "./position-picker.DjnhxIKF.js";
|
|
21
|
+
import { c as Q } from "./custom-element.L4WJXn1j.js";
|
|
22
22
|
import { w as P } from "./watch.DJF5K-8U.js";
|
|
23
|
-
import { s as
|
|
23
|
+
import { s as It, a as ht } from "./number.Cx2ncfJJ.js";
|
|
24
24
|
import { r as b } from "./state.CSDxrqLd.js";
|
|
25
25
|
import { n as _ } from "./when.Dr1es41R.js";
|
|
26
|
-
import
|
|
27
|
-
import
|
|
28
|
-
import { C as
|
|
29
|
-
import { C as
|
|
30
|
-
import { C as
|
|
31
|
-
import { C as
|
|
32
|
-
import
|
|
33
|
-
import
|
|
34
|
-
import { c as
|
|
35
|
-
import { e as
|
|
36
|
-
import { c as
|
|
37
|
-
import { o as
|
|
38
|
-
import
|
|
39
|
-
import
|
|
40
|
-
import
|
|
41
|
-
function
|
|
42
|
-
return t && t.length ?
|
|
26
|
+
import it from "../components/details.js";
|
|
27
|
+
import qt from "../components/divider.js";
|
|
28
|
+
import { C as st } from "./icon.CpHbi8tH.js";
|
|
29
|
+
import { C as kt } from "./icon-button.CVrxJcZq.js";
|
|
30
|
+
import { C as Rt } from "./input.33UmFGqR.js";
|
|
31
|
+
import { C as xt } from "./option.B6odSlS2.js";
|
|
32
|
+
import yt from "../components/select.js";
|
|
33
|
+
import oe from "../components/position-picker.js";
|
|
34
|
+
import { c as re } from "./image.Y5c_hFx8.js";
|
|
35
|
+
import { e as J } from "./query.BBf1UFkC.js";
|
|
36
|
+
import { c as ot } from "./repeat.CFjcER6_.js";
|
|
37
|
+
import { o as O } from "./style-map.llVFPd__.js";
|
|
38
|
+
import jt from "../components/tooltip.js";
|
|
39
|
+
import ne from "../components/button-group.js";
|
|
40
|
+
import he from "../components/checkbox.js";
|
|
41
|
+
function le(t) {
|
|
42
|
+
return t && t.length ? se(t) : [];
|
|
43
43
|
}
|
|
44
|
-
function
|
|
44
|
+
function Vt(t) {
|
|
45
45
|
return typeof t == "object" && t !== null && "URI" in t;
|
|
46
46
|
}
|
|
47
|
-
const
|
|
47
|
+
const ce = {
|
|
48
48
|
artist: "Artist",
|
|
49
49
|
color: "Color",
|
|
50
50
|
createDate: "CreateDate",
|
|
@@ -66,18 +66,18 @@ const re = {
|
|
|
66
66
|
systemIdentifier: "SystemIdentifier",
|
|
67
67
|
text: "Text",
|
|
68
68
|
title: "Title"
|
|
69
|
-
},
|
|
70
|
-
function
|
|
69
|
+
}, pe = /* @__PURE__ */ new Set(["mediaDate", "createDate", "editDate"]);
|
|
70
|
+
function Ct(t) {
|
|
71
71
|
return !/[\s&+/*"\\:(),'<>~|[\]{}]/.test(t) && !/^(?:OR|AND|NOT)$/.test(t) ? t : `"${t.replace(/\\/g, "\\\\").replace(/"/g, '\\"')}"`;
|
|
72
72
|
}
|
|
73
|
-
function
|
|
74
|
-
const s = (Array.isArray(e) ? e : [e]).map((a) => `${t}:${
|
|
73
|
+
function Et(t, e) {
|
|
74
|
+
const s = (Array.isArray(e) ? e : [e]).map((a) => `${t}:${Ct(a)}`);
|
|
75
75
|
return s.length > 1 ? `(${s.join(" OR ")})` : s[0] ?? "";
|
|
76
76
|
}
|
|
77
|
-
function
|
|
77
|
+
function de(t, e) {
|
|
78
78
|
return (Array.isArray(e) ? e : [e]).map((s) => `${t}${s.operator}${s.value}`).join(" AND ");
|
|
79
79
|
}
|
|
80
|
-
function
|
|
80
|
+
function ue(t) {
|
|
81
81
|
const e = [];
|
|
82
82
|
for (const i of Object.keys(t)) {
|
|
83
83
|
const s = i, a = t[s];
|
|
@@ -87,14 +87,14 @@ function le(t) {
|
|
|
87
87
|
for (const [n, l] of Object.entries(
|
|
88
88
|
a
|
|
89
89
|
))
|
|
90
|
-
e.push(
|
|
90
|
+
e.push(Et(n, l));
|
|
91
91
|
continue;
|
|
92
92
|
}
|
|
93
|
-
const o =
|
|
93
|
+
const o = ce[s];
|
|
94
94
|
if (o) {
|
|
95
|
-
if (
|
|
95
|
+
if (pe.has(s)) {
|
|
96
96
|
e.push(
|
|
97
|
-
|
|
97
|
+
de(o, a)
|
|
98
98
|
);
|
|
99
99
|
continue;
|
|
100
100
|
}
|
|
@@ -107,62 +107,62 @@ function le(t) {
|
|
|
107
107
|
if (n.length === 0)
|
|
108
108
|
continue;
|
|
109
109
|
const l = [
|
|
110
|
-
...n.map((
|
|
111
|
-
...n.map((
|
|
110
|
+
...n.map((p) => `ParentFolderIdentifier:${Ct(String(p))}`),
|
|
111
|
+
...n.map((p) => `ParentAlbumIdentifier:${Ct(String(p))}`)
|
|
112
112
|
];
|
|
113
113
|
e.push(`(${l.join(" OR ")})`);
|
|
114
114
|
continue;
|
|
115
115
|
}
|
|
116
|
-
e.push(
|
|
116
|
+
e.push(Et(o, a));
|
|
117
117
|
}
|
|
118
118
|
}
|
|
119
119
|
return e.join(" AND ");
|
|
120
120
|
}
|
|
121
|
-
function
|
|
121
|
+
function lt(t) {
|
|
122
122
|
if ("and" in t)
|
|
123
|
-
return t.and.map(
|
|
123
|
+
return t.and.map(lt).filter(Boolean).join(" AND ");
|
|
124
124
|
if ("or" in t) {
|
|
125
|
-
const e = t.or.map(
|
|
125
|
+
const e = t.or.map(lt).filter(Boolean);
|
|
126
126
|
return e.length > 1 ? `(${e.join(" OR ")})` : e[0] ?? "";
|
|
127
127
|
}
|
|
128
128
|
if ("not" in t) {
|
|
129
|
-
const e =
|
|
129
|
+
const e = lt(t.not);
|
|
130
130
|
return e ? `NOT (${e})` : "";
|
|
131
131
|
}
|
|
132
|
-
return
|
|
132
|
+
return ue(t);
|
|
133
133
|
}
|
|
134
|
-
const
|
|
134
|
+
const me = "CoreField.LargeSizePreview", ct = "CoreField.DocType", fe = "Document.Title", ge = "Document.CaptionLong", rt = "Document.FileExtension", pt = "CoreField.FileSize", Ht = "CoreField.Identifier", Tt = "CoreField.Keywords", dt = "CoreField.MaxHeight", ut = "CoreField.MaxWidth", mt = "Document.RecordID", Wt = "CoreField.DocSubType", Gt = "CoreField.TitleWithFallback", ft = "CoreField.OriginalFileName", gt = "CoreField.UpdatedFileName", $t = "__width", xe = "CoreField.OriginalPreview", Ni = "Document.DocSubType", Oi = "Document.InPoint", Li = "Document.OutPoint", At = {
|
|
135
135
|
DEFAULT_VIEW_SIZE: "Document.LargeSizePreview",
|
|
136
136
|
FIELD_TITLE_WITH_FALLBACK: "Document.TitleWithFallback",
|
|
137
137
|
ORIGINAL_VIEW_SIZE: "Document.OriginalPreview"
|
|
138
|
-
},
|
|
139
|
-
[
|
|
140
|
-
[
|
|
141
|
-
[
|
|
142
|
-
},
|
|
143
|
-
Object.entries(
|
|
138
|
+
}, Qt = {
|
|
139
|
+
[me]: At.DEFAULT_VIEW_SIZE,
|
|
140
|
+
[Gt]: At.FIELD_TITLE_WITH_FALLBACK,
|
|
141
|
+
[xe]: At.ORIGINAL_VIEW_SIZE
|
|
142
|
+
}, ye = Object.fromEntries(
|
|
143
|
+
Object.entries(Qt).map(([t, e]) => [
|
|
144
144
|
e,
|
|
145
145
|
t
|
|
146
146
|
])
|
|
147
147
|
);
|
|
148
|
-
function
|
|
149
|
-
return
|
|
148
|
+
function Se(t) {
|
|
149
|
+
return Qt[t] ?? t;
|
|
150
150
|
}
|
|
151
|
-
function
|
|
151
|
+
function Dt(t) {
|
|
152
152
|
const e = {};
|
|
153
153
|
for (const [i, s] of Object.entries(t)) {
|
|
154
|
-
const a =
|
|
154
|
+
const a = ye[i] ?? i;
|
|
155
155
|
e[a] = s;
|
|
156
156
|
}
|
|
157
157
|
return e;
|
|
158
158
|
}
|
|
159
|
-
function
|
|
159
|
+
function Ae(t) {
|
|
160
160
|
const e = new URLSearchParams();
|
|
161
161
|
for (const [i, s] of Object.entries(t))
|
|
162
162
|
s != null && (Array.isArray(s) ? s.forEach((a) => e.append(i, String(a))) : e.append(i, String(s)));
|
|
163
163
|
return e;
|
|
164
164
|
}
|
|
165
|
-
async function
|
|
165
|
+
async function Xt({
|
|
166
166
|
countPerPage: t,
|
|
167
167
|
fields: e,
|
|
168
168
|
getPermanentAssetsPaths: i,
|
|
@@ -171,50 +171,50 @@ async function jt({
|
|
|
171
171
|
pageNumber: o,
|
|
172
172
|
query: n,
|
|
173
173
|
securityByPassToken: l,
|
|
174
|
-
siteUrl:
|
|
175
|
-
sort:
|
|
174
|
+
siteUrl: p,
|
|
175
|
+
sort: y,
|
|
176
176
|
token: c,
|
|
177
|
-
useSession:
|
|
177
|
+
useSession: g
|
|
178
178
|
}) {
|
|
179
|
-
const
|
|
179
|
+
const S = e?.map(Se), d = {
|
|
180
180
|
CountPerPage: t,
|
|
181
|
-
Fields:
|
|
181
|
+
Fields: le(S),
|
|
182
182
|
Format: "json",
|
|
183
183
|
GetPermanentAssetsPaths: i || void 0,
|
|
184
184
|
PageNumber: o,
|
|
185
|
-
Query:
|
|
185
|
+
Query: lt(n),
|
|
186
186
|
SecurityByPassToken: l || void 0,
|
|
187
|
-
Sort:
|
|
188
|
-
UseSession:
|
|
189
|
-
},
|
|
187
|
+
Sort: y || void 0,
|
|
188
|
+
UseSession: g || void 0
|
|
189
|
+
}, A = s === "POST";
|
|
190
190
|
try {
|
|
191
191
|
return (await I.request({
|
|
192
|
-
baseURL:
|
|
192
|
+
baseURL: p,
|
|
193
193
|
headers: c ? { Authorization: `Bearer ${c}` } : void 0,
|
|
194
194
|
method: s,
|
|
195
195
|
// POST large RecordID queries as a urlencoded body to dodge the ~2KB URL cap;
|
|
196
196
|
// GET keeps the same fields on the query string.
|
|
197
|
-
...
|
|
197
|
+
...A ? { data: Ae(d) } : { params: d, paramsSerializer: { indexes: null } },
|
|
198
198
|
responseType: "json",
|
|
199
199
|
transformResponse: [
|
|
200
200
|
...Array.isArray(I.defaults.transformResponse) ? I.defaults.transformResponse : [],
|
|
201
|
-
a ? (
|
|
202
|
-
items: (
|
|
203
|
-
sort:
|
|
204
|
-
totalCount:
|
|
205
|
-
}) : (
|
|
206
|
-
items: (
|
|
207
|
-
sort:
|
|
208
|
-
totalCount:
|
|
201
|
+
a ? (u) => ({
|
|
202
|
+
items: (u.results?.Items ?? []).map(Dt),
|
|
203
|
+
sort: u.results?.GlobalInfo?.Sort ?? "",
|
|
204
|
+
totalCount: u.results?.GlobalInfo?.TotalCount ?? 0
|
|
205
|
+
}) : (u) => ({
|
|
206
|
+
items: (u.APIResponse?.Items ?? []).map(Dt),
|
|
207
|
+
sort: u.APIResponse?.GlobalInfo?.Sort ?? "",
|
|
208
|
+
totalCount: u.APIResponse?.GlobalInfo?.TotalCount ?? 0
|
|
209
209
|
})
|
|
210
210
|
],
|
|
211
|
-
url: a ?
|
|
211
|
+
url: a ? Lt.SEARCH_ASSETS : Yt["4.0"]
|
|
212
212
|
})).data;
|
|
213
213
|
} catch {
|
|
214
214
|
return { items: [], sort: "", totalCount: 0 };
|
|
215
215
|
}
|
|
216
216
|
}
|
|
217
|
-
async function
|
|
217
|
+
async function ve({
|
|
218
218
|
assetId: t,
|
|
219
219
|
extension: e,
|
|
220
220
|
format: i,
|
|
@@ -230,7 +230,7 @@ async function xe({
|
|
|
230
230
|
params: {
|
|
231
231
|
SourceAssetFormat: i,
|
|
232
232
|
SourceAssetRecordID: t,
|
|
233
|
-
TargetExtension:
|
|
233
|
+
TargetExtension: ie(e),
|
|
234
234
|
Token: a || void 0,
|
|
235
235
|
Transformations: o,
|
|
236
236
|
UseSession: n || void 0
|
|
@@ -240,20 +240,20 @@ async function xe({
|
|
|
240
240
|
*/
|
|
241
241
|
timeout: 3e5,
|
|
242
242
|
// 5 minutes
|
|
243
|
-
url:
|
|
243
|
+
url: Ot.GET_TRANSFORM_ASSET_LINK
|
|
244
244
|
})).data;
|
|
245
245
|
} catch {
|
|
246
246
|
return null;
|
|
247
247
|
}
|
|
248
248
|
}
|
|
249
|
-
const
|
|
250
|
-
function
|
|
249
|
+
const ze = 50;
|
|
250
|
+
function Ce(t, e) {
|
|
251
251
|
const i = [];
|
|
252
252
|
for (let s = 0; s < t.length; s += e)
|
|
253
253
|
i.push(t.slice(s, s + e));
|
|
254
254
|
return i;
|
|
255
255
|
}
|
|
256
|
-
async function
|
|
256
|
+
async function we({
|
|
257
257
|
extraFields: t,
|
|
258
258
|
getPermanentAssetsPaths: e,
|
|
259
259
|
isSiteBuilder: i,
|
|
@@ -263,50 +263,59 @@ async function Ae({
|
|
|
263
263
|
}) {
|
|
264
264
|
if (!Array.isArray(s) || s.length === 0)
|
|
265
265
|
return { facets: [], items: [], totalCount: 0 };
|
|
266
|
-
const n = t?.filter((
|
|
266
|
+
const n = t?.filter((d) => d && typeof d == "string") ?? [], l = [
|
|
267
267
|
...n,
|
|
268
|
+
gt,
|
|
268
269
|
ft,
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
countPerPage: p.length,
|
|
270
|
+
fe,
|
|
271
|
+
ge,
|
|
272
|
+
mt
|
|
273
|
+
], p = Ce(s, ze), y = await Promise.all(
|
|
274
|
+
p.map(
|
|
275
|
+
(d) => Xt({
|
|
276
|
+
countPerPage: d.length,
|
|
277
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: d },
|
|
283
283
|
securityByPassToken: a,
|
|
284
284
|
token: o
|
|
285
285
|
})
|
|
286
286
|
)
|
|
287
|
-
), c = new Map(s.map((
|
|
288
|
-
let
|
|
289
|
-
return
|
|
290
|
-
name:
|
|
291
|
-
recordId:
|
|
287
|
+
), c = new Map(s.map((d, A) => [d, A])), g = y.flatMap((d) => d.items).map((d) => {
|
|
288
|
+
let A = F(d, gt);
|
|
289
|
+
return A === "" && (A = F(d, ft)), {
|
|
290
|
+
name: A,
|
|
291
|
+
recordId: F(d, mt),
|
|
292
292
|
...n.reduce(
|
|
293
|
-
(k,
|
|
293
|
+
(k, u) => {
|
|
294
|
+
k[u] = F(d, u);
|
|
295
|
+
const R = Kt(d, u);
|
|
296
|
+
return R !== void 0 && (k[`${u}${$t}`] = String(R)), k;
|
|
297
|
+
},
|
|
294
298
|
{}
|
|
295
299
|
)
|
|
296
300
|
};
|
|
297
301
|
}).sort(
|
|
298
|
-
(
|
|
299
|
-
),
|
|
300
|
-
(
|
|
302
|
+
(d, A) => (c.get(d.recordId) ?? 1 / 0) - (c.get(A.recordId) ?? 1 / 0)
|
|
303
|
+
), S = y.reduce(
|
|
304
|
+
(d, A) => d + A.totalCount,
|
|
301
305
|
0
|
|
302
306
|
);
|
|
303
|
-
return { facets: [], items:
|
|
307
|
+
return { facets: [], items: g, totalCount: S };
|
|
304
308
|
}
|
|
305
|
-
function
|
|
309
|
+
function F(t, e) {
|
|
306
310
|
const i = t[e];
|
|
307
|
-
return i == null ? "" : typeof i == "string" ? i : typeof i == "number" || typeof i == "boolean" ? String(i) :
|
|
311
|
+
return i == null ? "" : typeof i == "string" ? i : typeof i == "number" || typeof i == "boolean" ? String(i) : Vt(i) ? i.URI : "";
|
|
308
312
|
}
|
|
309
|
-
|
|
313
|
+
function Kt(t, e) {
|
|
314
|
+
const i = t[e];
|
|
315
|
+
if (!(i == null || !Vt(i)))
|
|
316
|
+
return typeof i.Width == "number" && i.Width > 0 ? i.Width : void 0;
|
|
317
|
+
}
|
|
318
|
+
async function be({
|
|
310
319
|
countPerPage: t,
|
|
311
320
|
directParentFolderIdentifier: e,
|
|
312
321
|
extraFields: i,
|
|
@@ -315,59 +324,63 @@ async function ve({
|
|
|
315
324
|
limitedDocTypes: o,
|
|
316
325
|
pageNumber: n,
|
|
317
326
|
parentFolderIdentifier: l,
|
|
318
|
-
searchTerm:
|
|
319
|
-
securityByPassToken:
|
|
327
|
+
searchTerm: p,
|
|
328
|
+
securityByPassToken: y,
|
|
320
329
|
sortOrder: c,
|
|
321
|
-
token:
|
|
330
|
+
token: g
|
|
322
331
|
}) {
|
|
323
332
|
if (!e && !l)
|
|
324
333
|
return { facets: [], items: [], totalCount: 0 };
|
|
325
|
-
const
|
|
334
|
+
const S = (i?.filter((u) => u && typeof u == "string") ?? []).map((u) => u.replace("%20", " ")), d = {
|
|
326
335
|
directParentFolderIdentifier: e,
|
|
327
336
|
parentFolderIdentifier: l,
|
|
328
337
|
...o && o.length > 0 ? { docType: o } : {}
|
|
329
|
-
},
|
|
338
|
+
}, A = await Xt({
|
|
330
339
|
countPerPage: t,
|
|
331
340
|
fields: [
|
|
332
|
-
...
|
|
333
|
-
|
|
334
|
-
|
|
341
|
+
...S,
|
|
342
|
+
Gt,
|
|
343
|
+
Tt,
|
|
344
|
+
ut,
|
|
335
345
|
dt,
|
|
336
346
|
pt,
|
|
337
347
|
ct,
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
ot,
|
|
342
|
-
ut,
|
|
348
|
+
Wt,
|
|
349
|
+
Ht,
|
|
350
|
+
rt,
|
|
343
351
|
mt,
|
|
344
|
-
ft
|
|
352
|
+
ft,
|
|
353
|
+
gt
|
|
345
354
|
],
|
|
346
355
|
getPermanentAssetsPaths: s,
|
|
347
356
|
isSiteBuilder: a,
|
|
348
357
|
pageNumber: n,
|
|
349
|
-
query:
|
|
350
|
-
securityByPassToken:
|
|
358
|
+
query: d,
|
|
359
|
+
securityByPassToken: y,
|
|
351
360
|
sort: void 0,
|
|
352
|
-
token:
|
|
353
|
-
}), k =
|
|
354
|
-
let
|
|
355
|
-
|
|
356
|
-
const E =
|
|
361
|
+
token: g
|
|
362
|
+
}), k = A.items.map((u) => {
|
|
363
|
+
let R = F(u, rt), D = F(u, gt);
|
|
364
|
+
R && !R.startsWith(".") && (R = "." + R), D === "" && (D = F(u, ft));
|
|
365
|
+
const E = F(u, mt);
|
|
357
366
|
return {
|
|
358
|
-
docSubType:
|
|
359
|
-
docType:
|
|
360
|
-
extension:
|
|
361
|
-
height:
|
|
367
|
+
docSubType: F(u, Wt),
|
|
368
|
+
docType: F(u, ct) || "",
|
|
369
|
+
extension: R,
|
|
370
|
+
height: F(u, dt) || "0",
|
|
362
371
|
id: E,
|
|
363
|
-
identifier:
|
|
364
|
-
name:
|
|
372
|
+
identifier: F(u, Ht),
|
|
373
|
+
name: D,
|
|
365
374
|
recordId: E,
|
|
366
|
-
size:
|
|
367
|
-
tags:
|
|
368
|
-
width:
|
|
369
|
-
...
|
|
370
|
-
(
|
|
375
|
+
size: F(u, pt) || "0 MB",
|
|
376
|
+
tags: F(u, Tt),
|
|
377
|
+
width: F(u, ut) || "0",
|
|
378
|
+
...S.reduce(
|
|
379
|
+
(at, et) => {
|
|
380
|
+
at[et] = F(u, et);
|
|
381
|
+
const K = Kt(u, et);
|
|
382
|
+
return K !== void 0 && (at[`${et}${$t}`] = String(K)), at;
|
|
383
|
+
},
|
|
371
384
|
{}
|
|
372
385
|
)
|
|
373
386
|
};
|
|
@@ -375,10 +388,10 @@ async function ve({
|
|
|
375
388
|
return {
|
|
376
389
|
facets: [],
|
|
377
390
|
items: k,
|
|
378
|
-
totalCount:
|
|
391
|
+
totalCount: A.totalCount
|
|
379
392
|
};
|
|
380
393
|
}
|
|
381
|
-
async function
|
|
394
|
+
async function ke({
|
|
382
395
|
autoCropMode: t,
|
|
383
396
|
cropHeight: e,
|
|
384
397
|
cropWidth: i,
|
|
@@ -407,13 +420,13 @@ async function ze({
|
|
|
407
420
|
y: n.cropY
|
|
408
421
|
})
|
|
409
422
|
],
|
|
410
|
-
url:
|
|
423
|
+
url: Ot.GET_CROP_ZONE_SUGGESTION
|
|
411
424
|
})).data;
|
|
412
425
|
} catch {
|
|
413
426
|
return null;
|
|
414
427
|
}
|
|
415
428
|
}
|
|
416
|
-
async function
|
|
429
|
+
async function Ui({
|
|
417
430
|
assetRecordId: t,
|
|
418
431
|
isSiteBuilder: e,
|
|
419
432
|
siteUrl: i,
|
|
@@ -444,13 +457,13 @@ async function Di({
|
|
|
444
457
|
width: l.width
|
|
445
458
|
})) ?? []
|
|
446
459
|
],
|
|
447
|
-
url: e ?
|
|
460
|
+
url: e ? Lt.GET_AVAILABLE_PROXIES : ee
|
|
448
461
|
})).data;
|
|
449
462
|
} catch {
|
|
450
463
|
return [];
|
|
451
464
|
}
|
|
452
465
|
}
|
|
453
|
-
async function
|
|
466
|
+
async function Bi({
|
|
454
467
|
siteUrl: t
|
|
455
468
|
} = {}) {
|
|
456
469
|
try {
|
|
@@ -471,13 +484,13 @@ async function Ni({
|
|
|
471
484
|
formatsByDocType: i.formatsByDocType ?? {}
|
|
472
485
|
}
|
|
473
486
|
],
|
|
474
|
-
url:
|
|
487
|
+
url: Jt
|
|
475
488
|
})).data;
|
|
476
489
|
} catch {
|
|
477
490
|
return { formatsByDocType: {} };
|
|
478
491
|
}
|
|
479
492
|
}
|
|
480
|
-
async function
|
|
493
|
+
async function qi({
|
|
481
494
|
recordIds: t,
|
|
482
495
|
rightsToCheck: e
|
|
483
496
|
}) {
|
|
@@ -493,14 +506,14 @@ async function Oi({
|
|
|
493
506
|
params: { RecordIDs: t, RightsToCheck: e },
|
|
494
507
|
paramsSerializer: { indexes: null },
|
|
495
508
|
responseType: "json",
|
|
496
|
-
url:
|
|
509
|
+
url: te.GET_AUTHORIZED_OBJECTS
|
|
497
510
|
});
|
|
498
511
|
return s;
|
|
499
512
|
} catch {
|
|
500
513
|
return i;
|
|
501
514
|
}
|
|
502
515
|
}
|
|
503
|
-
const
|
|
516
|
+
const vt = 20, wt = "TR1", bt = "TRX", Re = /* @__PURE__ */ new Set([".gif"]), $e = /* @__PURE__ */ new Set([
|
|
504
517
|
".avif",
|
|
505
518
|
".bmp",
|
|
506
519
|
".gif",
|
|
@@ -511,32 +524,32 @@ const At = 20, Ct = "TR1", wt = "TRX", Ce = /* @__PURE__ */ new Set([".gif"]), w
|
|
|
511
524
|
".svg",
|
|
512
525
|
".webp"
|
|
513
526
|
]);
|
|
514
|
-
function
|
|
527
|
+
function Zt(t) {
|
|
515
528
|
const e = t.toLowerCase(), i = e.startsWith(".") ? e : `.${e}`;
|
|
516
|
-
return
|
|
529
|
+
return $e.has(i);
|
|
517
530
|
}
|
|
518
|
-
function
|
|
531
|
+
function Nt({
|
|
519
532
|
extension: t,
|
|
520
533
|
format: e,
|
|
521
534
|
item: i,
|
|
522
535
|
manualFormat: s,
|
|
523
536
|
size: a
|
|
524
537
|
}) {
|
|
525
|
-
const o = t?.toLowerCase() ?? "", n = o.startsWith(".") ? o : `.${o}`, l = `path_${
|
|
538
|
+
const o = t?.toLowerCase() ?? "", n = o.startsWith(".") ? o : `.${o}`, l = `path_${wt}`, p = (S) => i[S] ? { maxWidth: i[`${S}${$t}`], src: i[S] } : void 0;
|
|
526
539
|
if (!s)
|
|
527
|
-
return
|
|
528
|
-
if (!!o &&
|
|
529
|
-
return
|
|
530
|
-
const
|
|
531
|
-
return
|
|
540
|
+
return p(`path_${Bt(o, a)}`) ?? p(l) ?? {};
|
|
541
|
+
if (!!o && Re.has(n))
|
|
542
|
+
return p(`path_${bt}`) ?? p(l) ?? {};
|
|
543
|
+
const c = !o || Zt(o), g = e ? `path_${e}` : void 0;
|
|
544
|
+
return g && c && i[g] ? p(g) ?? {} : p(l) ?? {};
|
|
532
545
|
}
|
|
533
|
-
class
|
|
546
|
+
class ji {
|
|
534
547
|
constructor(e, i) {
|
|
535
|
-
this.data = [], this.folderId = "", this.fetchedPages = /* @__PURE__ */ new Set(), this.totalCount = 0, this.maxEnd = 1 / 0, this.pageSize =
|
|
548
|
+
this.data = [], this.folderId = "", this.fetchedPages = /* @__PURE__ */ new Set(), this.totalCount = 0, this.maxEnd = 1 / 0, this.pageSize = vt, this.requestEpoch = 0, this.host = e, this.host.addController?.(this);
|
|
536
549
|
const s = i?.maxEnd;
|
|
537
550
|
this.maxEnd = typeof s == "number" && Number.isFinite(s) && s >= 0 ? Math.floor(s) : 1 / 0;
|
|
538
551
|
const a = i?.pageSize;
|
|
539
|
-
this.pageSize = typeof a == "number" && Number.isFinite(a) && a >= 1 ? Math.floor(a) :
|
|
552
|
+
this.pageSize = typeof a == "number" && Number.isFinite(a) && a >= 1 ? Math.floor(a) : vt, this.authToken = i?.token, this.securityByPassToken = i?.securityByPassToken, this.isSiteBuilder = i?.isSiteBuilder ?? !1;
|
|
540
553
|
}
|
|
541
554
|
get totalDataCount() {
|
|
542
555
|
return this.totalCount;
|
|
@@ -554,7 +567,7 @@ class Li {
|
|
|
554
567
|
* Shrinking is ignored once pages are cached: collapsing already has what it needs.
|
|
555
568
|
*/
|
|
556
569
|
setPageSize(e) {
|
|
557
|
-
const i = Number.isFinite(e) && e >= 1 ? Math.floor(e) :
|
|
570
|
+
const i = Number.isFinite(e) && e >= 1 ? Math.floor(e) : vt;
|
|
558
571
|
if (this.pageSize === i)
|
|
559
572
|
return;
|
|
560
573
|
const s = this.fetchedPages.size > 0;
|
|
@@ -575,23 +588,23 @@ class Li {
|
|
|
575
588
|
const l = this.requestEpoch;
|
|
576
589
|
if (!this.folderId || l !== this.requestEpoch)
|
|
577
590
|
return this.data;
|
|
578
|
-
const
|
|
591
|
+
const p = s ? `path_${s}` : void 0, y = `path_${wt}`, c = `path_${bt}`, g = [
|
|
579
592
|
...new Set(
|
|
580
|
-
[
|
|
581
|
-
(
|
|
593
|
+
[p, y, c].filter(
|
|
594
|
+
(A) => !!A
|
|
582
595
|
)
|
|
583
596
|
)
|
|
584
|
-
],
|
|
585
|
-
for (let
|
|
586
|
-
if (this.fetchedPages.has(
|
|
597
|
+
], S = Math.floor(o / this.pageSize) + 1, d = Math.floor(e / this.pageSize) + 1;
|
|
598
|
+
for (let A = S; A <= d; A++) {
|
|
599
|
+
if (this.fetchedPages.has(A))
|
|
587
600
|
continue;
|
|
588
|
-
const k = await
|
|
601
|
+
const k = await be({
|
|
589
602
|
countPerPage: this.pageSize,
|
|
590
603
|
directParentFolderIdentifier: this.folderId,
|
|
591
|
-
extraFields: [...i, ...
|
|
604
|
+
extraFields: [...i, ...g],
|
|
592
605
|
getPermanentAssetsPaths: !0,
|
|
593
606
|
isSiteBuilder: this.isSiteBuilder,
|
|
594
|
-
pageNumber:
|
|
607
|
+
pageNumber: A,
|
|
595
608
|
searchTerm: "",
|
|
596
609
|
securityByPassToken: this.securityByPassToken,
|
|
597
610
|
sortOrder: "",
|
|
@@ -599,36 +612,37 @@ class Li {
|
|
|
599
612
|
});
|
|
600
613
|
if (l !== this.requestEpoch)
|
|
601
614
|
return this.data;
|
|
602
|
-
if (this.fetchedPages.add(
|
|
603
|
-
const
|
|
604
|
-
this.totalCount =
|
|
615
|
+
if (this.fetchedPages.add(A), !this.totalCount && k.totalCount) {
|
|
616
|
+
const R = Math.min(this.maxEnd, k.totalCount);
|
|
617
|
+
this.totalCount = R, this.data = Array.from({ length: R }, () => ({
|
|
605
618
|
alt: "",
|
|
606
|
-
id: `temp-${
|
|
619
|
+
id: `temp-${ae()}`,
|
|
607
620
|
name: "",
|
|
608
621
|
src: ""
|
|
609
622
|
}));
|
|
610
623
|
}
|
|
611
|
-
const
|
|
612
|
-
for (let
|
|
613
|
-
const
|
|
614
|
-
if (
|
|
615
|
-
const E = k.items[
|
|
616
|
-
let K = Tt({
|
|
624
|
+
const u = (A - 1) * this.pageSize;
|
|
625
|
+
for (let R = 0; R < k.items.length; R++) {
|
|
626
|
+
const D = u + R;
|
|
627
|
+
if (D < this.data.length) {
|
|
628
|
+
const E = k.items[R], { maxWidth: at, src: et } = Nt({
|
|
617
629
|
extension: E.extension,
|
|
618
630
|
format: s,
|
|
619
631
|
item: E,
|
|
620
632
|
manualFormat: a,
|
|
621
633
|
size: E.size
|
|
622
634
|
});
|
|
623
|
-
|
|
635
|
+
let K = et;
|
|
636
|
+
K && n && n.length > 0 && (K = Mt(K, n)), this.data[D] = {
|
|
624
637
|
alt: E.name,
|
|
625
638
|
docType: E.docType,
|
|
626
639
|
extension: E.extension,
|
|
627
640
|
id: E.id,
|
|
641
|
+
maxWidth: at,
|
|
628
642
|
name: E.name,
|
|
629
643
|
src: K,
|
|
630
644
|
...i.reduce(
|
|
631
|
-
(
|
|
645
|
+
(Ft, _t) => (Ft[_t] = E[_t] ?? "", Ft),
|
|
632
646
|
{}
|
|
633
647
|
)
|
|
634
648
|
};
|
|
@@ -644,34 +658,34 @@ class Li {
|
|
|
644
658
|
format: o,
|
|
645
659
|
manualFormat: n = !0,
|
|
646
660
|
minLimit: l = 5,
|
|
647
|
-
noPlaceholders:
|
|
648
|
-
transformations:
|
|
661
|
+
noPlaceholders: p = !1,
|
|
662
|
+
transformations: y
|
|
649
663
|
}) {
|
|
650
664
|
(!this.folderId || this.folderId !== s) && (this.folderId = s, this.resetFolderState()), a && this.resetPageCache();
|
|
651
|
-
const c = Math.max(5, l),
|
|
665
|
+
const c = Math.max(5, l), g = e, S = e + c, d = [
|
|
652
666
|
...i,
|
|
653
|
-
|
|
654
|
-
|
|
667
|
+
dt,
|
|
668
|
+
ut
|
|
655
669
|
];
|
|
656
670
|
await this.fetchImages({
|
|
657
|
-
end:
|
|
658
|
-
extraFields:
|
|
671
|
+
end: S,
|
|
672
|
+
extraFields: d.filter((u) => u !== ""),
|
|
659
673
|
format: o,
|
|
660
674
|
manualFormat: n,
|
|
661
|
-
start:
|
|
662
|
-
transformations:
|
|
675
|
+
start: g,
|
|
676
|
+
transformations: y
|
|
663
677
|
});
|
|
664
|
-
let
|
|
665
|
-
|
|
666
|
-
const k =
|
|
678
|
+
let A = e - c;
|
|
679
|
+
A < 0 && (this.totalCount === 0 ? A = 0 : A = Math.max(0, this.totalCount + A));
|
|
680
|
+
const k = A + c;
|
|
667
681
|
return await this.fetchImages({
|
|
668
682
|
end: k,
|
|
669
|
-
extraFields:
|
|
683
|
+
extraFields: d.filter((u) => u !== ""),
|
|
670
684
|
format: o,
|
|
671
685
|
manualFormat: n,
|
|
672
|
-
start:
|
|
673
|
-
transformations:
|
|
674
|
-
}),
|
|
686
|
+
start: A,
|
|
687
|
+
transformations: y
|
|
688
|
+
}), p ? this.data.filter((u) => u.id && !u.id.startsWith("temp-")) : this.data;
|
|
675
689
|
}
|
|
676
690
|
async fetchImagesByIDs({
|
|
677
691
|
extraFields: e = [],
|
|
@@ -682,42 +696,44 @@ class Li {
|
|
|
682
696
|
}) {
|
|
683
697
|
if (a.length === 0)
|
|
684
698
|
return [];
|
|
685
|
-
const n = i ? `path_${i}` : void 0, l = `path_${
|
|
699
|
+
const n = i ? `path_${i}` : void 0, l = `path_${wt}`, p = `path_${bt}`, y = [
|
|
686
700
|
...new Set(
|
|
687
|
-
[n, l,
|
|
688
|
-
(
|
|
701
|
+
[n, l, p].filter(
|
|
702
|
+
(d) => !!d
|
|
689
703
|
)
|
|
690
704
|
)
|
|
691
|
-
], c = [
|
|
705
|
+
], c = [rt, pt], g = [
|
|
692
706
|
...e,
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
707
|
+
ct,
|
|
708
|
+
dt,
|
|
709
|
+
ut
|
|
696
710
|
];
|
|
697
|
-
return (await
|
|
698
|
-
extraFields: [...
|
|
711
|
+
return (await we({
|
|
712
|
+
extraFields: [...g, ...y, ...c].filter((d) => d !== ""),
|
|
699
713
|
getPermanentAssetsPaths: !0,
|
|
700
714
|
isSiteBuilder: this.isSiteBuilder,
|
|
701
715
|
recordIds: a,
|
|
702
716
|
securityByPassToken: this.securityByPassToken,
|
|
703
717
|
token: this.authToken
|
|
704
|
-
})).items.map((
|
|
705
|
-
|
|
706
|
-
extension:
|
|
718
|
+
})).items.map((d) => {
|
|
719
|
+
const { maxWidth: A, src: k } = Nt({
|
|
720
|
+
extension: d[rt],
|
|
707
721
|
format: i,
|
|
708
|
-
item:
|
|
722
|
+
item: d,
|
|
709
723
|
manualFormat: s,
|
|
710
|
-
size:
|
|
724
|
+
size: d[pt]
|
|
711
725
|
});
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
726
|
+
let u = k;
|
|
727
|
+
return u && o && o.length > 0 && (u = Mt(u, o)), {
|
|
728
|
+
alt: d.name,
|
|
729
|
+
docType: d[ct],
|
|
730
|
+
extension: d[rt] || "",
|
|
731
|
+
id: d.recordId,
|
|
732
|
+
maxWidth: A,
|
|
733
|
+
name: d.name,
|
|
734
|
+
src: u,
|
|
735
|
+
...g.reduce(
|
|
736
|
+
(R, D) => (R[D] = d[D] ?? "", R),
|
|
721
737
|
{}
|
|
722
738
|
)
|
|
723
739
|
};
|
|
@@ -731,19 +747,19 @@ class Li {
|
|
|
731
747
|
manualFormat: o = !0,
|
|
732
748
|
noPlaceholders: n = !1,
|
|
733
749
|
page: l,
|
|
734
|
-
pageSize:
|
|
735
|
-
transformations:
|
|
750
|
+
pageSize: p = 10,
|
|
751
|
+
transformations: y
|
|
736
752
|
}) {
|
|
737
753
|
(!this.folderId || this.folderId !== i) && (this.folderId = i, this.resetFolderState()), s && this.resetPageCache();
|
|
738
|
-
const c = l *
|
|
754
|
+
const c = l * p, g = c + p - 1;
|
|
739
755
|
return await this.fetchImages({
|
|
740
|
-
end:
|
|
756
|
+
end: g,
|
|
741
757
|
extraFields: e,
|
|
742
758
|
format: a,
|
|
743
759
|
manualFormat: o,
|
|
744
760
|
start: c,
|
|
745
|
-
transformations:
|
|
746
|
-
}), n ? this.data.filter((
|
|
761
|
+
transformations: y
|
|
762
|
+
}), n ? this.data.filter((S) => S.id && !S.id.startsWith("temp-")) : this.data;
|
|
747
763
|
}
|
|
748
764
|
async *fetchImagesInFolderByChunk({
|
|
749
765
|
chunkSize: e = 10,
|
|
@@ -753,8 +769,8 @@ class Li {
|
|
|
753
769
|
forceRefetch: o = !1,
|
|
754
770
|
format: n,
|
|
755
771
|
manualFormat: l = !0,
|
|
756
|
-
start:
|
|
757
|
-
transformations:
|
|
772
|
+
start: p = 0,
|
|
773
|
+
transformations: y
|
|
758
774
|
}) {
|
|
759
775
|
const c = Math.max(1, e);
|
|
760
776
|
if ((!this.folderId || this.folderId !== a) && (this.folderId = a, this.resetFolderState()), o && this.resetPageCache(), i !== -1) {
|
|
@@ -763,28 +779,28 @@ class Li {
|
|
|
763
779
|
extraFields: s,
|
|
764
780
|
format: n,
|
|
765
781
|
manualFormat: l,
|
|
766
|
-
start:
|
|
767
|
-
transformations:
|
|
782
|
+
start: p,
|
|
783
|
+
transformations: y
|
|
768
784
|
}), yield this.data;
|
|
769
785
|
return;
|
|
770
786
|
}
|
|
771
|
-
let
|
|
787
|
+
let g = p, S = p + c;
|
|
772
788
|
if (await this.fetchImages({
|
|
773
|
-
end:
|
|
789
|
+
end: S,
|
|
774
790
|
extraFields: s,
|
|
775
791
|
format: n,
|
|
776
792
|
manualFormat: l,
|
|
777
|
-
start:
|
|
778
|
-
transformations:
|
|
779
|
-
}), yield this.data, !(!this.totalCount || this.totalCount <=
|
|
780
|
-
for (;
|
|
781
|
-
|
|
782
|
-
end:
|
|
793
|
+
start: g,
|
|
794
|
+
transformations: y
|
|
795
|
+
}), yield this.data, !(!this.totalCount || this.totalCount <= S))
|
|
796
|
+
for (; S < this.totalCount; )
|
|
797
|
+
g = S, S = Math.min(S + c, this.totalCount), await this.fetchImages({
|
|
798
|
+
end: S,
|
|
783
799
|
extraFields: s,
|
|
784
800
|
format: n,
|
|
785
801
|
manualFormat: l,
|
|
786
|
-
start:
|
|
787
|
-
transformations:
|
|
802
|
+
start: g,
|
|
803
|
+
transformations: y
|
|
788
804
|
}), yield this.data;
|
|
789
805
|
}
|
|
790
806
|
hostConnected() {
|
|
@@ -799,15 +815,15 @@ class Li {
|
|
|
799
815
|
this.resetPageCache();
|
|
800
816
|
}
|
|
801
817
|
}
|
|
802
|
-
const
|
|
803
|
-
var
|
|
804
|
-
for (var a = s > 1 ? void 0 : s ?
|
|
818
|
+
const Pe = j`.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}`, Fe = j`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}`;
|
|
819
|
+
var _e = Object.defineProperty, Me = Object.getOwnPropertyDescriptor, z = (t, e, i, s) => {
|
|
820
|
+
for (var a = s > 1 ? void 0 : s ? Me(e, i) : e, o = t.length - 1, n; o >= 0; o--)
|
|
805
821
|
(n = t[o]) && (a = (s ? n(e, i, a) : n(a)) || a);
|
|
806
|
-
return s && a &&
|
|
822
|
+
return s && a && _e(e, i, a), a;
|
|
807
823
|
};
|
|
808
|
-
let v = class extends
|
|
824
|
+
let v = class extends q {
|
|
809
825
|
constructor() {
|
|
810
|
-
super(...arguments), this.localize = new
|
|
826
|
+
super(...arguments), this.localize = new V(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
827
|
[r.Pixel]: {
|
|
812
828
|
height: 0,
|
|
813
829
|
percentageHeight: 100,
|
|
@@ -826,7 +842,7 @@ let v = class extends B {
|
|
|
826
842
|
x: 0,
|
|
827
843
|
y: 0
|
|
828
844
|
}
|
|
829
|
-
}, this.loading = !1, this.cropModes = [], this.focusModes = [], this.focusMode = "manual", this.cropMode = "free", this.position =
|
|
845
|
+
}, this.loading = !1, this.cropModes = [], this.focusModes = [], this.focusMode = "manual", this.cropMode = "free", this.position = N.CenterCenter, this.keepAspectRatio = !1, this.invalidWidth = !1, this.invalidHeight = !1, this.aspectRatio = 0;
|
|
830
846
|
}
|
|
831
847
|
get selectedMode() {
|
|
832
848
|
return this.cropModes.find((t) => t.value === this.cropMode);
|
|
@@ -919,7 +935,7 @@ let v = class extends B {
|
|
|
919
935
|
const [s, a] = e.split(":").map(Number);
|
|
920
936
|
if (this.unit === r.Pixel) {
|
|
921
937
|
let o = s, n = a;
|
|
922
|
-
Number.isFinite(this.maxWidth) && Number.isFinite(this.maxHeight) && ({ height: n, width: o } =
|
|
938
|
+
Number.isFinite(this.maxWidth) && Number.isFinite(this.maxHeight) && ({ height: n, width: o } = re(
|
|
923
939
|
this.maxWidth,
|
|
924
940
|
this.maxHeight,
|
|
925
941
|
s,
|
|
@@ -1039,9 +1055,9 @@ let v = class extends B {
|
|
|
1039
1055
|
const t = this.cropModes.filter((i) => !i.auto), e = this.cropModes.filter((i) => i.auto);
|
|
1040
1056
|
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">${_(
|
|
1041
1057
|
!this.noRatioModes,
|
|
1042
|
-
() => C`<cx-select data-testid="cx-asset-link-format-crop-mode" value=${this.cropMode} hoist style=${
|
|
1058
|
+
() => C`<cx-select data-testid="cx-asset-link-format-crop-mode" value=${this.cropMode} hoist style=${O({
|
|
1043
1059
|
width: "100%"
|
|
1044
|
-
})} @cx-change=${this.onCropModeChange} ?disabled=${this.loading}>${
|
|
1060
|
+
})} @cx-change=${this.onCropModeChange} ?disabled=${this.loading}>${ot(
|
|
1045
1061
|
t,
|
|
1046
1062
|
(i) => i.value,
|
|
1047
1063
|
({ label: i, value: s }) => C`<cx-option value=${s}>${i}</cx-option>`
|
|
@@ -1050,14 +1066,14 @@ let v = class extends B {
|
|
|
1050
1066
|
e.length > 0,
|
|
1051
1067
|
() => C`<cx-divider></cx-divider><small>${this.localize.term("autoCropping")}</small>`
|
|
1052
1068
|
)}
|
|
1053
|
-
${
|
|
1069
|
+
${ot(
|
|
1054
1070
|
e,
|
|
1055
1071
|
(i) => i.value,
|
|
1056
1072
|
({ label: i, value: s }) => C`<cx-option value=${s}>${i}</cx-option>`
|
|
1057
1073
|
)}</cx-select>`
|
|
1058
1074
|
)}<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">
|
|
1059
1075
|
W
|
|
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=${
|
|
1076
|
+
</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=${O({
|
|
1061
1077
|
color: this.keepAspectRatio ? "var(--cx-color-primary)" : void 0
|
|
1062
1078
|
})} ?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">
|
|
1063
1079
|
H
|
|
@@ -1066,9 +1082,9 @@ let v = class extends B {
|
|
|
1066
1082
|
() => 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
1083
|
)}</cx-space>${_(
|
|
1068
1084
|
this.focusModes.length > 0,
|
|
1069
|
-
() => C`<cx-select data-testid="cx-asset-link-format-crop-focus-mode" value=${this.focusMode} hoist style=${
|
|
1085
|
+
() => C`<cx-select data-testid="cx-asset-link-format-crop-focus-mode" value=${this.focusMode} hoist style=${O({
|
|
1070
1086
|
width: "100%"
|
|
1071
|
-
})} @cx-change=${this.onFocusModeChange} ?disabled=${this.loading || this.selectedMode?.disabledSize}>${
|
|
1087
|
+
})} @cx-change=${this.onFocusModeChange} ?disabled=${this.loading || this.selectedMode?.disabledSize}>${ot(
|
|
1072
1088
|
this.focusModes,
|
|
1073
1089
|
(i) => i.value,
|
|
1074
1090
|
({ label: i, value: s }) => C`<cx-option value=${s}>${i}</cx-option>`
|
|
@@ -1077,30 +1093,30 @@ let v = class extends B {
|
|
|
1077
1093
|
${_(
|
|
1078
1094
|
this.showPositionPicker && this.focusMode === "manual",
|
|
1079
1095
|
() => 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=${
|
|
1096
|
+
)}<cx-button data-testid="cx-asset-link-format-crop-apply" variant="primary" ?disabled=${this.disabledApply || this.invalidHeight || this.invalidWidth} ?loading=${this.loading} style=${O({
|
|
1081
1097
|
marginLeft: "auto"
|
|
1082
1098
|
})} @click=${this.handleApply}>${this.localize.term("apply")}</cx-button></cx-space></cx-details>`;
|
|
1083
1099
|
}
|
|
1084
1100
|
};
|
|
1085
|
-
v.styles = [
|
|
1101
|
+
v.styles = [G, Fe];
|
|
1086
1102
|
v.dependencies = {
|
|
1087
|
-
"cx-button":
|
|
1088
|
-
"cx-details":
|
|
1089
|
-
"cx-divider":
|
|
1090
|
-
"cx-icon":
|
|
1091
|
-
"cx-icon-button":
|
|
1092
|
-
"cx-input":
|
|
1093
|
-
"cx-option":
|
|
1094
|
-
"cx-position-picker":
|
|
1095
|
-
"cx-select":
|
|
1096
|
-
"cx-space":
|
|
1097
|
-
"cx-typography":
|
|
1103
|
+
"cx-button": Y,
|
|
1104
|
+
"cx-details": it,
|
|
1105
|
+
"cx-divider": qt,
|
|
1106
|
+
"cx-icon": st,
|
|
1107
|
+
"cx-icon-button": kt,
|
|
1108
|
+
"cx-input": Rt,
|
|
1109
|
+
"cx-option": xt,
|
|
1110
|
+
"cx-position-picker": oe,
|
|
1111
|
+
"cx-select": yt,
|
|
1112
|
+
"cx-space": U,
|
|
1113
|
+
"cx-typography": B
|
|
1098
1114
|
};
|
|
1099
1115
|
z([
|
|
1100
|
-
|
|
1116
|
+
J(".details")
|
|
1101
1117
|
], v.prototype, "base", 2);
|
|
1102
1118
|
z([
|
|
1103
|
-
|
|
1119
|
+
J("cx-position-picker")
|
|
1104
1120
|
], v.prototype, "positionPicker", 2);
|
|
1105
1121
|
z([
|
|
1106
1122
|
h({ reflect: !0, type: Boolean })
|
|
@@ -1184,17 +1200,17 @@ z([
|
|
|
1184
1200
|
P("open", { waitUntilFirstUpdate: !0 })
|
|
1185
1201
|
], v.prototype, "handleOpenChange", 1);
|
|
1186
1202
|
v = z([
|
|
1187
|
-
|
|
1203
|
+
Q("cx-asset-link-format-crop")
|
|
1188
1204
|
], v);
|
|
1189
|
-
const
|
|
1190
|
-
var
|
|
1191
|
-
for (var a = s > 1 ? void 0 : s ?
|
|
1205
|
+
const Ie = j`.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%}}`;
|
|
1206
|
+
var Ee = Object.defineProperty, He = Object.getOwnPropertyDescriptor, Pt = (t, e, i, s) => {
|
|
1207
|
+
for (var a = s > 1 ? void 0 : s ? He(e, i) : e, o = t.length - 1, n; o >= 0; o--)
|
|
1192
1208
|
(n = t[o]) && (a = (s ? n(e, i, a) : n(a)) || a);
|
|
1193
|
-
return s && a &&
|
|
1209
|
+
return s && a && Ee(e, i, a), a;
|
|
1194
1210
|
};
|
|
1195
|
-
let
|
|
1211
|
+
let Z = class extends q {
|
|
1196
1212
|
constructor() {
|
|
1197
|
-
super(...arguments), this.localize = new
|
|
1213
|
+
super(...arguments), this.localize = new V(this), this.value = "", this.items = [];
|
|
1198
1214
|
}
|
|
1199
1215
|
handleExtensionChange(t) {
|
|
1200
1216
|
const e = t.target.value;
|
|
@@ -1203,46 +1219,46 @@ let X = class extends B {
|
|
|
1203
1219
|
});
|
|
1204
1220
|
}
|
|
1205
1221
|
render() {
|
|
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}>${
|
|
1222
|
+
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}>${ot(
|
|
1207
1223
|
this.items,
|
|
1208
1224
|
(t) => t.value,
|
|
1209
1225
|
(t) => C`<cx-option value=${t.value}>${t.displayName}</cx-option>`
|
|
1210
1226
|
)}</cx-select></cx-space>`;
|
|
1211
1227
|
}
|
|
1212
1228
|
};
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
"cx-option":
|
|
1216
|
-
"cx-select":
|
|
1217
|
-
"cx-space":
|
|
1218
|
-
"cx-typography":
|
|
1229
|
+
Z.styles = [G, Ie];
|
|
1230
|
+
Z.dependencies = {
|
|
1231
|
+
"cx-option": xt,
|
|
1232
|
+
"cx-select": yt,
|
|
1233
|
+
"cx-space": U,
|
|
1234
|
+
"cx-typography": B
|
|
1219
1235
|
};
|
|
1220
|
-
|
|
1236
|
+
Pt([
|
|
1221
1237
|
h({ reflect: !0, type: String })
|
|
1222
|
-
],
|
|
1223
|
-
|
|
1238
|
+
], Z.prototype, "value", 2);
|
|
1239
|
+
Pt([
|
|
1224
1240
|
h({ reflect: !1, type: Array })
|
|
1225
|
-
],
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
],
|
|
1229
|
-
const
|
|
1230
|
-
var
|
|
1231
|
-
for (var a = s > 1 ? void 0 : s ?
|
|
1241
|
+
], Z.prototype, "items", 2);
|
|
1242
|
+
Z = Pt([
|
|
1243
|
+
Q("cx-asset-link-format-extension")
|
|
1244
|
+
], Z);
|
|
1245
|
+
const Te = j`cx-details::part(base){border-bottom-width:0}`;
|
|
1246
|
+
var We = Object.defineProperty, De = Object.getOwnPropertyDescriptor, W = (t, e, i, s) => {
|
|
1247
|
+
for (var a = s > 1 ? void 0 : s ? De(e, i) : e, o = t.length - 1, n; o >= 0; o--)
|
|
1232
1248
|
(n = t[o]) && (a = (s ? n(e, i, a) : n(a)) || a);
|
|
1233
|
-
return s && a &&
|
|
1249
|
+
return s && a && We(e, i, a), a;
|
|
1234
1250
|
};
|
|
1235
|
-
const
|
|
1236
|
-
let M = class extends
|
|
1251
|
+
const zt = "auto";
|
|
1252
|
+
let M = class extends q {
|
|
1237
1253
|
constructor() {
|
|
1238
|
-
super(...arguments), this.localize = new
|
|
1254
|
+
super(...arguments), this.localize = new V(this), this.open = !1, this.value = "", this.items = [], this.canAutoFormat = !1, this.autoFormat = !1, this.loading = !1, this.scopedValue = "";
|
|
1239
1255
|
}
|
|
1240
1256
|
/**
|
|
1241
1257
|
* The listbox value that represents the committed choice: the `Auto` entry when that is
|
|
1242
1258
|
* active, otherwise the resolved proxy id.
|
|
1243
1259
|
*/
|
|
1244
1260
|
get committedValue() {
|
|
1245
|
-
return this.autoFormat ?
|
|
1261
|
+
return this.autoFormat ? zt : this.value;
|
|
1246
1262
|
}
|
|
1247
1263
|
handleValueChange() {
|
|
1248
1264
|
this.scopedValue = this.committedValue;
|
|
@@ -1262,7 +1278,7 @@ let M = class extends B {
|
|
|
1262
1278
|
handleApply() {
|
|
1263
1279
|
if (this.loading)
|
|
1264
1280
|
return;
|
|
1265
|
-
if (this.scopedValue ===
|
|
1281
|
+
if (this.scopedValue === zt) {
|
|
1266
1282
|
this.emit("cx-asset-link-format-proxy-change", {
|
|
1267
1283
|
detail: { autoFormat: !0 }
|
|
1268
1284
|
});
|
|
@@ -1292,33 +1308,33 @@ let M = class extends B {
|
|
|
1292
1308
|
t.target !== this.base && t.stopPropagation();
|
|
1293
1309
|
}
|
|
1294
1310
|
render() {
|
|
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}>${
|
|
1311
|
+
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}>${ot(
|
|
1296
1312
|
this.items,
|
|
1297
1313
|
(t) => t.id,
|
|
1298
1314
|
(t) => C`<cx-option value=${t.id}>${t.proxyLabel}</cx-option>`
|
|
1299
1315
|
)}
|
|
1300
1316
|
${_(
|
|
1301
1317
|
this.canAutoFormat,
|
|
1302
|
-
() => C`<cx-divider></cx-divider><cx-option data-testid="cx-asset-link-format-proxy-auto-option" value=${
|
|
1303
|
-
() =>
|
|
1304
|
-
)}</cx-select><cx-button data-testid="cx-asset-link-format-proxy-apply" variant="primary" style=${
|
|
1318
|
+
() => C`<cx-divider></cx-divider><cx-option data-testid="cx-asset-link-format-proxy-auto-option" value=${zt}>${this.localize.term("auto")}</cx-option>`,
|
|
1319
|
+
() => Ut
|
|
1320
|
+
)}</cx-select><cx-button data-testid="cx-asset-link-format-proxy-apply" variant="primary" style=${O({
|
|
1305
1321
|
"margin-left": "auto"
|
|
1306
1322
|
})} ?disabled=${this.scopedValue === this.committedValue} ?loading=${this.loading} @click=${this.handleApply}>${this.localize.term("apply")}</cx-button></cx-space></cx-details>`;
|
|
1307
1323
|
}
|
|
1308
1324
|
};
|
|
1309
|
-
M.styles = [
|
|
1325
|
+
M.styles = [G, Te];
|
|
1310
1326
|
M.dependencies = {
|
|
1311
|
-
"cx-button":
|
|
1312
|
-
"cx-details":
|
|
1313
|
-
"cx-divider":
|
|
1314
|
-
"cx-icon":
|
|
1315
|
-
"cx-option":
|
|
1316
|
-
"cx-select":
|
|
1317
|
-
"cx-space":
|
|
1318
|
-
"cx-typography":
|
|
1327
|
+
"cx-button": Y,
|
|
1328
|
+
"cx-details": it,
|
|
1329
|
+
"cx-divider": qt,
|
|
1330
|
+
"cx-icon": st,
|
|
1331
|
+
"cx-option": xt,
|
|
1332
|
+
"cx-select": yt,
|
|
1333
|
+
"cx-space": U,
|
|
1334
|
+
"cx-typography": B
|
|
1319
1335
|
};
|
|
1320
1336
|
W([
|
|
1321
|
-
|
|
1337
|
+
J(".details")
|
|
1322
1338
|
], M.prototype, "base", 2);
|
|
1323
1339
|
W([
|
|
1324
1340
|
h({ reflect: !0, type: Boolean })
|
|
@@ -1349,17 +1365,17 @@ W([
|
|
|
1349
1365
|
P("open", { waitUntilFirstUpdate: !0 })
|
|
1350
1366
|
], M.prototype, "handleOpenChange", 1);
|
|
1351
1367
|
M = W([
|
|
1352
|
-
|
|
1368
|
+
Q("cx-asset-link-format-proxy")
|
|
1353
1369
|
], M);
|
|
1354
|
-
const
|
|
1355
|
-
var
|
|
1356
|
-
for (var a = s > 1 ? void 0 : s ?
|
|
1370
|
+
const Ne = j`cx-details::part(base){border-bottom-width:0}`;
|
|
1371
|
+
var Oe = Object.defineProperty, Le = Object.getOwnPropertyDescriptor, tt = (t, e, i, s) => {
|
|
1372
|
+
for (var a = s > 1 ? void 0 : s ? Le(e, i) : e, o = t.length - 1, n; o >= 0; o--)
|
|
1357
1373
|
(n = t[o]) && (a = (s ? n(e, i, a) : n(a)) || a);
|
|
1358
|
-
return s && a &&
|
|
1374
|
+
return s && a && Oe(e, i, a), a;
|
|
1359
1375
|
};
|
|
1360
|
-
let T = class extends
|
|
1376
|
+
let T = class extends q {
|
|
1361
1377
|
constructor() {
|
|
1362
|
-
super(...arguments), this.localize = new
|
|
1378
|
+
super(...arguments), this.localize = new V(this), this.open = !1, this.value = 100, this.loading = !1, this.scopedValue = 100;
|
|
1363
1379
|
}
|
|
1364
1380
|
/**
|
|
1365
1381
|
* A computed property that checks if the current quality value is invalid.
|
|
@@ -1403,51 +1419,51 @@ let T = class extends B {
|
|
|
1403
1419
|
t.target !== this.base && t.stopPropagation();
|
|
1404
1420
|
}
|
|
1405
1421
|
render() {
|
|
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=${
|
|
1422
|
+
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=${O({
|
|
1407
1423
|
flex: "1"
|
|
1408
1424
|
})} @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>`;
|
|
1409
1425
|
}
|
|
1410
1426
|
};
|
|
1411
|
-
T.styles = [
|
|
1427
|
+
T.styles = [G, Ne];
|
|
1412
1428
|
T.dependencies = {
|
|
1413
|
-
"cx-button":
|
|
1414
|
-
"cx-details":
|
|
1415
|
-
"cx-icon":
|
|
1416
|
-
"cx-input":
|
|
1417
|
-
"cx-space":
|
|
1418
|
-
"cx-tooltip":
|
|
1419
|
-
"cx-typography":
|
|
1429
|
+
"cx-button": Y,
|
|
1430
|
+
"cx-details": it,
|
|
1431
|
+
"cx-icon": st,
|
|
1432
|
+
"cx-input": Rt,
|
|
1433
|
+
"cx-space": U,
|
|
1434
|
+
"cx-tooltip": jt,
|
|
1435
|
+
"cx-typography": B
|
|
1420
1436
|
};
|
|
1421
|
-
|
|
1422
|
-
|
|
1437
|
+
tt([
|
|
1438
|
+
J(".details")
|
|
1423
1439
|
], T.prototype, "base", 2);
|
|
1424
|
-
|
|
1440
|
+
tt([
|
|
1425
1441
|
h({ reflect: !0, type: Boolean })
|
|
1426
1442
|
], T.prototype, "open", 2);
|
|
1427
|
-
|
|
1443
|
+
tt([
|
|
1428
1444
|
h({ reflect: !0, type: Number })
|
|
1429
1445
|
], T.prototype, "value", 2);
|
|
1430
|
-
|
|
1446
|
+
tt([
|
|
1431
1447
|
h({ reflect: !0, type: Boolean })
|
|
1432
1448
|
], T.prototype, "loading", 2);
|
|
1433
|
-
|
|
1449
|
+
tt([
|
|
1434
1450
|
b()
|
|
1435
1451
|
], T.prototype, "scopedValue", 2);
|
|
1436
|
-
|
|
1452
|
+
tt([
|
|
1437
1453
|
P("value")
|
|
1438
1454
|
], T.prototype, "handleValueChange", 1);
|
|
1439
|
-
T =
|
|
1440
|
-
|
|
1455
|
+
T = tt([
|
|
1456
|
+
Q("cx-asset-link-format-quality")
|
|
1441
1457
|
], T);
|
|
1442
|
-
const
|
|
1443
|
-
var
|
|
1444
|
-
for (var a = s > 1 ? void 0 : s ?
|
|
1458
|
+
const Ue = j`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}`;
|
|
1459
|
+
var Be = Object.defineProperty, qe = Object.getOwnPropertyDescriptor, $ = (t, e, i, s) => {
|
|
1460
|
+
for (var a = s > 1 ? void 0 : s ? qe(e, i) : e, o = t.length - 1, n; o >= 0; o--)
|
|
1445
1461
|
(n = t[o]) && (a = (s ? n(e, i, a) : n(a)) || a);
|
|
1446
|
-
return s && a &&
|
|
1462
|
+
return s && a && Be(e, i, a), a;
|
|
1447
1463
|
};
|
|
1448
|
-
let w = class extends
|
|
1464
|
+
let w = class extends q {
|
|
1449
1465
|
constructor() {
|
|
1450
|
-
super(...arguments), this.localize = new
|
|
1466
|
+
super(...arguments), this.localize = new V(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
1467
|
[r.Pixel]: { height: 0, width: 0 },
|
|
1452
1468
|
[r.AspectRatio]: { height: 1, width: 1 }
|
|
1453
1469
|
}, this.loading = !1, this.noRatioModes = !1, this.keepAspectRatio = !1, this.invalidWidth = !1, this.invalidHeight = !1, this.aspectRatio = 0;
|
|
@@ -1588,99 +1604,99 @@ let w = class extends B {
|
|
|
1588
1604
|
render() {
|
|
1589
1605
|
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">
|
|
1590
1606
|
W
|
|
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=${
|
|
1607
|
+
</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=${O({
|
|
1592
1608
|
color: this.keepAspectRatio ? "var(--cx-color-primary)" : void 0
|
|
1593
1609
|
})} ?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">
|
|
1594
1610
|
H
|
|
1595
1611
|
</cx-typography></cx-input></div>${_(
|
|
1596
1612
|
!this.noRatioModes,
|
|
1597
1613
|
() => 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=${
|
|
1614
|
+
)}</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=${O({
|
|
1599
1615
|
marginLeft: "auto"
|
|
1600
1616
|
})} @click=${this.handleApply}>${this.localize.term("apply")}</cx-button></cx-space></cx-details>`;
|
|
1601
1617
|
}
|
|
1602
1618
|
};
|
|
1603
|
-
w.styles = [
|
|
1619
|
+
w.styles = [G, Ue];
|
|
1604
1620
|
w.dependencies = {
|
|
1605
|
-
"cx-button":
|
|
1606
|
-
"cx-details":
|
|
1607
|
-
"cx-icon":
|
|
1608
|
-
"cx-icon-button":
|
|
1609
|
-
"cx-input":
|
|
1610
|
-
"cx-option":
|
|
1611
|
-
"cx-select":
|
|
1612
|
-
"cx-space":
|
|
1613
|
-
"cx-typography":
|
|
1621
|
+
"cx-button": Y,
|
|
1622
|
+
"cx-details": it,
|
|
1623
|
+
"cx-icon": st,
|
|
1624
|
+
"cx-icon-button": kt,
|
|
1625
|
+
"cx-input": Rt,
|
|
1626
|
+
"cx-option": xt,
|
|
1627
|
+
"cx-select": yt,
|
|
1628
|
+
"cx-space": U,
|
|
1629
|
+
"cx-typography": B
|
|
1614
1630
|
};
|
|
1615
|
-
|
|
1616
|
-
|
|
1631
|
+
$([
|
|
1632
|
+
J(".details")
|
|
1617
1633
|
], w.prototype, "base", 2);
|
|
1618
|
-
|
|
1634
|
+
$([
|
|
1619
1635
|
h({ reflect: !0, type: Boolean })
|
|
1620
1636
|
], w.prototype, "open", 2);
|
|
1621
|
-
|
|
1637
|
+
$([
|
|
1622
1638
|
h({ reflect: !0, type: Number })
|
|
1623
1639
|
], w.prototype, "width", 2);
|
|
1624
|
-
|
|
1640
|
+
$([
|
|
1625
1641
|
h({ reflect: !0, type: Number })
|
|
1626
1642
|
], w.prototype, "height", 2);
|
|
1627
|
-
|
|
1643
|
+
$([
|
|
1628
1644
|
h({ attribute: "max-width", reflect: !0, type: Number })
|
|
1629
1645
|
], w.prototype, "maxWidth", 2);
|
|
1630
|
-
|
|
1646
|
+
$([
|
|
1631
1647
|
h({ attribute: "max-height", reflect: !0, type: Number })
|
|
1632
1648
|
], w.prototype, "maxHeight", 2);
|
|
1633
|
-
|
|
1649
|
+
$([
|
|
1634
1650
|
h({ attribute: "ratio-width", reflect: !0, type: Number })
|
|
1635
1651
|
], w.prototype, "ratioWidth", 2);
|
|
1636
|
-
|
|
1652
|
+
$([
|
|
1637
1653
|
h({ attribute: "ratio-height", reflect: !0, type: Number })
|
|
1638
1654
|
], w.prototype, "ratioHeight", 2);
|
|
1639
|
-
|
|
1655
|
+
$([
|
|
1640
1656
|
h({ reflect: !0, type: String })
|
|
1641
1657
|
], w.prototype, "unit", 2);
|
|
1642
|
-
|
|
1658
|
+
$([
|
|
1643
1659
|
h({ attribute: "last-applied-setting", reflect: !1, type: Object })
|
|
1644
1660
|
], w.prototype, "lastAppliedSetting", 2);
|
|
1645
|
-
|
|
1661
|
+
$([
|
|
1646
1662
|
h({ reflect: !0, type: Boolean })
|
|
1647
1663
|
], w.prototype, "loading", 2);
|
|
1648
|
-
|
|
1664
|
+
$([
|
|
1649
1665
|
h({ attribute: "no-ratio-modes", reflect: !0, type: Boolean })
|
|
1650
1666
|
], w.prototype, "noRatioModes", 2);
|
|
1651
|
-
|
|
1667
|
+
$([
|
|
1652
1668
|
h({ attribute: "keep-aspect-ratio", reflect: !0, type: Boolean })
|
|
1653
1669
|
], w.prototype, "keepAspectRatio", 2);
|
|
1654
|
-
|
|
1670
|
+
$([
|
|
1655
1671
|
b()
|
|
1656
1672
|
], w.prototype, "invalidWidth", 2);
|
|
1657
|
-
|
|
1673
|
+
$([
|
|
1658
1674
|
b()
|
|
1659
1675
|
], w.prototype, "invalidHeight", 2);
|
|
1660
|
-
|
|
1676
|
+
$([
|
|
1661
1677
|
b()
|
|
1662
1678
|
], w.prototype, "aspectRatio", 2);
|
|
1663
|
-
|
|
1679
|
+
$([
|
|
1664
1680
|
P("cropMode", { waitUntilFirstUpdate: !0 }),
|
|
1665
1681
|
P("maxWidth", { waitUntilFirstUpdate: !0 }),
|
|
1666
1682
|
P("maxHeight", { waitUntilFirstUpdate: !0 }),
|
|
1667
1683
|
P("keepAspectRatio")
|
|
1668
1684
|
], w.prototype, "handleCropModeChange", 1);
|
|
1669
|
-
|
|
1685
|
+
$([
|
|
1670
1686
|
P("open", { waitUntilFirstUpdate: !0 })
|
|
1671
1687
|
], w.prototype, "handleOpenChange", 1);
|
|
1672
|
-
w =
|
|
1673
|
-
|
|
1688
|
+
w = $([
|
|
1689
|
+
Q("cx-asset-link-format-resize")
|
|
1674
1690
|
], w);
|
|
1675
|
-
const
|
|
1676
|
-
var
|
|
1677
|
-
for (var a = s > 1 ? void 0 : s ?
|
|
1691
|
+
const je = j`cx-details::part(base){border-bottom-width:0}`;
|
|
1692
|
+
var Ve = Object.defineProperty, Ge = Object.getOwnPropertyDescriptor, X = (t, e, i, s) => {
|
|
1693
|
+
for (var a = s > 1 ? void 0 : s ? Ge(e, i) : e, o = t.length - 1, n; o >= 0; o--)
|
|
1678
1694
|
(n = t[o]) && (a = (s ? n(e, i, a) : n(a)) || a);
|
|
1679
|
-
return s && a &&
|
|
1695
|
+
return s && a && Ve(e, i, a), a;
|
|
1680
1696
|
};
|
|
1681
|
-
let H = class extends
|
|
1697
|
+
let H = class extends q {
|
|
1682
1698
|
constructor() {
|
|
1683
|
-
super(...arguments), this.localize = new
|
|
1699
|
+
super(...arguments), this.localize = new V(this), this.open = !1, this.value = 0, this.defaultValue = 0, this.loading = !1, this.lastAppliedValue = 0;
|
|
1684
1700
|
}
|
|
1685
1701
|
handleOpenChange() {
|
|
1686
1702
|
this.open || this.emit("cx-asset-link-format-rotation-change", {
|
|
@@ -1691,14 +1707,14 @@ let H = class extends B {
|
|
|
1691
1707
|
const e = t.target.value, i = Number(e);
|
|
1692
1708
|
if (Number.isNaN(i))
|
|
1693
1709
|
return;
|
|
1694
|
-
const s =
|
|
1710
|
+
const s = It(i);
|
|
1695
1711
|
(i > 360 || i < -360) && (t.target.value = s.toString()), this.emit("cx-asset-link-format-rotation-change", {
|
|
1696
1712
|
detail: s
|
|
1697
1713
|
});
|
|
1698
1714
|
}
|
|
1699
1715
|
handleButtonClick(t) {
|
|
1700
1716
|
this.emit("cx-asset-link-format-rotation-change", {
|
|
1701
|
-
detail:
|
|
1717
|
+
detail: It(t)
|
|
1702
1718
|
});
|
|
1703
1719
|
}
|
|
1704
1720
|
handleClockwiseClick() {
|
|
@@ -1718,55 +1734,55 @@ let H = class extends B {
|
|
|
1718
1734
|
});
|
|
1719
1735
|
}
|
|
1720
1736
|
render() {
|
|
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=${
|
|
1737
|
+
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=${O({
|
|
1722
1738
|
flex: "none",
|
|
1723
1739
|
width: "80px"
|
|
1724
1740
|
})} @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>`;
|
|
1725
1741
|
}
|
|
1726
1742
|
};
|
|
1727
|
-
H.styles = [
|
|
1743
|
+
H.styles = [G, je];
|
|
1728
1744
|
H.dependencies = {
|
|
1729
|
-
"cx-button":
|
|
1730
|
-
"cx-button-group":
|
|
1731
|
-
"cx-details":
|
|
1732
|
-
"cx-icon":
|
|
1733
|
-
"cx-icon-button":
|
|
1734
|
-
"cx-space":
|
|
1735
|
-
"cx-typography":
|
|
1745
|
+
"cx-button": Y,
|
|
1746
|
+
"cx-button-group": ne,
|
|
1747
|
+
"cx-details": it,
|
|
1748
|
+
"cx-icon": st,
|
|
1749
|
+
"cx-icon-button": kt,
|
|
1750
|
+
"cx-space": U,
|
|
1751
|
+
"cx-typography": B
|
|
1736
1752
|
};
|
|
1737
|
-
|
|
1738
|
-
|
|
1753
|
+
X([
|
|
1754
|
+
J(".details")
|
|
1739
1755
|
], H.prototype, "base", 2);
|
|
1740
|
-
|
|
1756
|
+
X([
|
|
1741
1757
|
h({ reflect: !0, type: Boolean })
|
|
1742
1758
|
], H.prototype, "open", 2);
|
|
1743
|
-
|
|
1759
|
+
X([
|
|
1744
1760
|
h({ reflect: !0, type: Number })
|
|
1745
1761
|
], H.prototype, "value", 2);
|
|
1746
|
-
|
|
1762
|
+
X([
|
|
1747
1763
|
h({ attribute: "default-value", reflect: !0, type: Number })
|
|
1748
1764
|
], H.prototype, "defaultValue", 2);
|
|
1749
|
-
|
|
1765
|
+
X([
|
|
1750
1766
|
h({ reflect: !0, type: Boolean })
|
|
1751
1767
|
], H.prototype, "loading", 2);
|
|
1752
|
-
|
|
1768
|
+
X([
|
|
1753
1769
|
h({ attribute: "last-applied-value", reflect: !0, type: Number })
|
|
1754
1770
|
], H.prototype, "lastAppliedValue", 2);
|
|
1755
|
-
|
|
1771
|
+
X([
|
|
1756
1772
|
P("open", { waitUntilFirstUpdate: !0 })
|
|
1757
1773
|
], H.prototype, "handleOpenChange", 1);
|
|
1758
|
-
H =
|
|
1759
|
-
|
|
1774
|
+
H = X([
|
|
1775
|
+
Q("cx-asset-link-format-rotation")
|
|
1760
1776
|
], H);
|
|
1761
|
-
const
|
|
1762
|
-
var
|
|
1763
|
-
for (var a = s > 1 ? void 0 : s ?
|
|
1777
|
+
const Qe = j`cx-details::part(base){border-bottom-width:0}`;
|
|
1778
|
+
var Xe = Object.defineProperty, Ke = Object.getOwnPropertyDescriptor, St = (t, e, i, s) => {
|
|
1779
|
+
for (var a = s > 1 ? void 0 : s ? Ke(e, i) : e, o = t.length - 1, n; o >= 0; o--)
|
|
1764
1780
|
(n = t[o]) && (a = (s ? n(e, i, a) : n(a)) || a);
|
|
1765
|
-
return s && a &&
|
|
1781
|
+
return s && a && Xe(e, i, a), a;
|
|
1766
1782
|
};
|
|
1767
|
-
let
|
|
1783
|
+
let L = class extends q {
|
|
1768
1784
|
constructor() {
|
|
1769
|
-
super(...arguments), this.localize = new
|
|
1785
|
+
super(...arguments), this.localize = new V(this), this.open = !1, this.value = !1;
|
|
1770
1786
|
}
|
|
1771
1787
|
handleApply(t) {
|
|
1772
1788
|
this.emit("cx-asset-link-format-metadata-change", {
|
|
@@ -1793,36 +1809,36 @@ let O = class extends B {
|
|
|
1793
1809
|
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>`;
|
|
1794
1810
|
}
|
|
1795
1811
|
};
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
"cx-button":
|
|
1799
|
-
"cx-checkbox":
|
|
1800
|
-
"cx-details":
|
|
1801
|
-
"cx-icon":
|
|
1802
|
-
"cx-space":
|
|
1803
|
-
"cx-tooltip":
|
|
1804
|
-
"cx-typography":
|
|
1812
|
+
L.styles = [G, Qe];
|
|
1813
|
+
L.dependencies = {
|
|
1814
|
+
"cx-button": Y,
|
|
1815
|
+
"cx-checkbox": he,
|
|
1816
|
+
"cx-details": it,
|
|
1817
|
+
"cx-icon": st,
|
|
1818
|
+
"cx-space": U,
|
|
1819
|
+
"cx-tooltip": jt,
|
|
1820
|
+
"cx-typography": B
|
|
1805
1821
|
};
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
],
|
|
1809
|
-
|
|
1822
|
+
St([
|
|
1823
|
+
J(".details")
|
|
1824
|
+
], L.prototype, "base", 2);
|
|
1825
|
+
St([
|
|
1810
1826
|
h({ reflect: !0, type: Boolean })
|
|
1811
|
-
],
|
|
1812
|
-
|
|
1827
|
+
], L.prototype, "open", 2);
|
|
1828
|
+
St([
|
|
1813
1829
|
h({ reflect: !0, type: Boolean })
|
|
1814
|
-
],
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
],
|
|
1818
|
-
var
|
|
1819
|
-
for (var a = s > 1 ? void 0 : s ?
|
|
1830
|
+
], L.prototype, "value", 2);
|
|
1831
|
+
L = St([
|
|
1832
|
+
Q("cx-asset-link-format-metadata")
|
|
1833
|
+
], L);
|
|
1834
|
+
var Ze = Object.defineProperty, Ye = Object.getOwnPropertyDescriptor, x = (t, e, i, s) => {
|
|
1835
|
+
for (var a = s > 1 ? void 0 : s ? Ye(e, i) : e, o = t.length - 1, n; o >= 0; o--)
|
|
1820
1836
|
(n = t[o]) && (a = (s ? n(e, i, a) : n(a)) || a);
|
|
1821
|
-
return s && a &&
|
|
1837
|
+
return s && a && Ze(e, i, a), a;
|
|
1822
1838
|
};
|
|
1823
|
-
let
|
|
1839
|
+
let m = class extends q {
|
|
1824
1840
|
constructor() {
|
|
1825
|
-
super(), this.localize = new
|
|
1841
|
+
super(), this.localize = new V(this), this.baseUrl = void 0, this.token = void 0, this.asset = void 0, this.cropModes = [
|
|
1826
1842
|
{
|
|
1827
1843
|
label: "Free",
|
|
1828
1844
|
value: "free"
|
|
@@ -1908,7 +1924,7 @@ let u = class extends B {
|
|
|
1908
1924
|
keepAspectRatio: !0,
|
|
1909
1925
|
percentageHeight: 0,
|
|
1910
1926
|
percentageWidth: 0,
|
|
1911
|
-
position:
|
|
1927
|
+
position: N.CenterCenter,
|
|
1912
1928
|
ratioHeight: 1,
|
|
1913
1929
|
ratioWidth: 1,
|
|
1914
1930
|
unit: r.Pixel,
|
|
@@ -1918,7 +1934,7 @@ let u = class extends B {
|
|
|
1918
1934
|
}, this.rotation = 0, this.defaultSize = {
|
|
1919
1935
|
height: 0,
|
|
1920
1936
|
width: 0
|
|
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 =
|
|
1937
|
+
}, 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 = ve, this.apiGetCropFocusMode = ke, this.onCropComplete = this.onCropComplete.bind(this), this.onCropDragStart = this.onCropDragStart.bind(this);
|
|
1922
1938
|
}
|
|
1923
1939
|
/**
|
|
1924
1940
|
* Transform requests must resolve to a web-displayable image (the browser renders the
|
|
@@ -1927,7 +1943,7 @@ let u = class extends B {
|
|
|
1927
1943
|
* extension fallback in asset-transformation-dialog.
|
|
1928
1944
|
*/
|
|
1929
1945
|
static getTransformExtension(t) {
|
|
1930
|
-
return !t ||
|
|
1946
|
+
return !t || Zt(t) ? t : "jpg";
|
|
1931
1947
|
}
|
|
1932
1948
|
/** True when there are transformations beyond the frozen index (i.e. user has added new ones). */
|
|
1933
1949
|
get hasUnfrozenTransformations() {
|
|
@@ -1940,7 +1956,7 @@ let u = class extends B {
|
|
|
1940
1956
|
*/
|
|
1941
1957
|
get lastAppliedCropUnit() {
|
|
1942
1958
|
return this.transformations.findLast(
|
|
1943
|
-
(e) => e.key ===
|
|
1959
|
+
(e) => e.key === f.Crop
|
|
1944
1960
|
)?.value.unit ?? r.Pixel;
|
|
1945
1961
|
}
|
|
1946
1962
|
/**
|
|
@@ -1950,7 +1966,7 @@ let u = class extends B {
|
|
|
1950
1966
|
*/
|
|
1951
1967
|
get lastAppliedCropFocusMode() {
|
|
1952
1968
|
return this.transformations.findLast(
|
|
1953
|
-
(e) => e.key ===
|
|
1969
|
+
(e) => e.key === f.Crop
|
|
1954
1970
|
)?.value.focusMode ?? "manual";
|
|
1955
1971
|
}
|
|
1956
1972
|
/**
|
|
@@ -1960,8 +1976,8 @@ let u = class extends B {
|
|
|
1960
1976
|
*/
|
|
1961
1977
|
get lastAppliedCropPosition() {
|
|
1962
1978
|
return this.transformations.findLast(
|
|
1963
|
-
(e) => e.key ===
|
|
1964
|
-
)?.value.position ??
|
|
1979
|
+
(e) => e.key === f.Crop
|
|
1980
|
+
)?.value.position ?? N.CenterCenter;
|
|
1965
1981
|
}
|
|
1966
1982
|
/**
|
|
1967
1983
|
* Checks if the crop apply button should be disabled.
|
|
@@ -2012,7 +2028,7 @@ let u = class extends B {
|
|
|
2012
2028
|
get lastCropSize() {
|
|
2013
2029
|
if (!this.asset) {
|
|
2014
2030
|
const e = this.transformations.findLast(
|
|
2015
|
-
(i) => i.key ===
|
|
2031
|
+
(i) => i.key === f.Crop
|
|
2016
2032
|
);
|
|
2017
2033
|
if (e?.value.unit === r.AspectRatio && e.value.ratioWidth && e.value.ratioHeight)
|
|
2018
2034
|
return {
|
|
@@ -2042,7 +2058,7 @@ let u = class extends B {
|
|
|
2042
2058
|
}
|
|
2043
2059
|
};
|
|
2044
2060
|
if (e?.value.width && e?.value.height) {
|
|
2045
|
-
const { height: i, width: s, x: a = 0, y: o = 0 } = e.value, n =
|
|
2061
|
+
const { height: i, width: s, x: a = 0, y: o = 0 } = e.value, n = ht(s, i);
|
|
2046
2062
|
return {
|
|
2047
2063
|
[r.AspectRatio]: {
|
|
2048
2064
|
height: n.height,
|
|
@@ -2065,7 +2081,7 @@ let u = class extends B {
|
|
|
2065
2081
|
};
|
|
2066
2082
|
}
|
|
2067
2083
|
}
|
|
2068
|
-
const t = this.lastImageSize.width && this.lastImageSize.height ?
|
|
2084
|
+
const t = this.lastImageSize.width && this.lastImageSize.height ? ht(this.lastImageSize.width, this.lastImageSize.height) : { height: 1, width: 1 };
|
|
2069
2085
|
return {
|
|
2070
2086
|
[r.AspectRatio]: {
|
|
2071
2087
|
height: t.height,
|
|
@@ -2095,7 +2111,7 @@ let u = class extends B {
|
|
|
2095
2111
|
get lastResizeSize() {
|
|
2096
2112
|
if (!this.asset) {
|
|
2097
2113
|
const e = this.transformations.findLast(
|
|
2098
|
-
(i) => i.key ===
|
|
2114
|
+
(i) => i.key === f.Resize
|
|
2099
2115
|
);
|
|
2100
2116
|
if (e?.value.unit === r.AspectRatio && e.value.ratioWidth && e.value.ratioHeight)
|
|
2101
2117
|
return {
|
|
@@ -2112,7 +2128,7 @@ let u = class extends B {
|
|
|
2112
2128
|
}
|
|
2113
2129
|
};
|
|
2114
2130
|
if (e?.value.width && e?.value.height) {
|
|
2115
|
-
const { height: i, width: s } = e.value, a =
|
|
2131
|
+
const { height: i, width: s } = e.value, a = ht(s, i);
|
|
2116
2132
|
return {
|
|
2117
2133
|
[r.AspectRatio]: {
|
|
2118
2134
|
height: a.height,
|
|
@@ -2127,7 +2143,7 @@ let u = class extends B {
|
|
|
2127
2143
|
};
|
|
2128
2144
|
}
|
|
2129
2145
|
}
|
|
2130
|
-
const t = this.lastImageSize.width && this.lastImageSize.height ?
|
|
2146
|
+
const t = this.lastImageSize.width && this.lastImageSize.height ? ht(this.lastImageSize.width, this.lastImageSize.height) : { height: 1, width: 1 };
|
|
2131
2147
|
return {
|
|
2132
2148
|
[r.AspectRatio]: {
|
|
2133
2149
|
height: t.height,
|
|
@@ -2151,14 +2167,14 @@ let u = class extends B {
|
|
|
2151
2167
|
*/
|
|
2152
2168
|
get lastRotation() {
|
|
2153
2169
|
return this.asset ? 0 : this.transformations.findLast(
|
|
2154
|
-
(e) => e.key ===
|
|
2170
|
+
(e) => e.key === f.Rotate
|
|
2155
2171
|
)?.value.rotation ?? 0;
|
|
2156
2172
|
}
|
|
2157
2173
|
/**
|
|
2158
2174
|
* Returns the transformation string for the asset link.
|
|
2159
2175
|
*/
|
|
2160
2176
|
get transformationString() {
|
|
2161
|
-
return
|
|
2177
|
+
return nt({
|
|
2162
2178
|
asset: this.asset,
|
|
2163
2179
|
baseUrl: "",
|
|
2164
2180
|
parameters: this.parameters,
|
|
@@ -2197,13 +2213,13 @@ let u = class extends B {
|
|
|
2197
2213
|
);
|
|
2198
2214
|
this.loading = !0, this.apiGetTransformAssetLink({
|
|
2199
2215
|
assetId: this.asset.id,
|
|
2200
|
-
extension:
|
|
2216
|
+
extension: m.getTransformExtension(this.asset.extension),
|
|
2201
2217
|
format: e?.proxyName ?? "",
|
|
2202
2218
|
siteUrl: this.baseUrl,
|
|
2203
2219
|
token: this.token,
|
|
2204
2220
|
transformations: this.transformationString
|
|
2205
2221
|
}).then((s) => {
|
|
2206
|
-
this.loading = !1, !(!s?.relativePath || !this.selectedFormat) && (this.lastAction ===
|
|
2222
|
+
this.loading = !1, !(!s?.relativePath || !this.selectedFormat) && (this.lastAction === f.Rotate && (this.rotation = 0), this.lastAction = void 0, this.lastImageSize = {
|
|
2207
2223
|
height: s.height,
|
|
2208
2224
|
width: s.width
|
|
2209
2225
|
}, this.selectedFormat = {
|
|
@@ -2217,7 +2233,7 @@ let u = class extends B {
|
|
|
2217
2233
|
*/
|
|
2218
2234
|
});
|
|
2219
2235
|
});
|
|
2220
|
-
const i =
|
|
2236
|
+
const i = nt({
|
|
2221
2237
|
asset: this.asset,
|
|
2222
2238
|
baseUrl: "",
|
|
2223
2239
|
extension: this.selectedFormat.extension,
|
|
@@ -2250,7 +2266,7 @@ let u = class extends B {
|
|
|
2250
2266
|
async handleTransformationsChange() {
|
|
2251
2267
|
if (await this.updateComplete, !this.asset) {
|
|
2252
2268
|
this.emit("cx-asset-link-format-change", {
|
|
2253
|
-
detail:
|
|
2269
|
+
detail: nt({
|
|
2254
2270
|
asset: this.asset,
|
|
2255
2271
|
baseUrl: "",
|
|
2256
2272
|
options: {
|
|
@@ -2262,35 +2278,35 @@ let u = class extends B {
|
|
|
2262
2278
|
}).replace(/\/t\//g, "")
|
|
2263
2279
|
});
|
|
2264
2280
|
const o = this.transformations.findLast(
|
|
2265
|
-
(c) => c.key ===
|
|
2281
|
+
(c) => c.key === f.Crop && (c.value.unit === r.AspectRatio && c.value.ratioWidth && c.value.ratioHeight || c.value.width && c.value.height)
|
|
2266
2282
|
);
|
|
2267
2283
|
if (o?.value.unit === r.AspectRatio && o.value.ratioWidth && o.value.ratioHeight) {
|
|
2268
|
-
const { focusMode: c, position:
|
|
2284
|
+
const { focusMode: c, position: g, ratioHeight: S, ratioWidth: d } = o.value;
|
|
2269
2285
|
this.cropSize = {
|
|
2270
2286
|
...this.cropSize,
|
|
2271
2287
|
cropMode: "free",
|
|
2272
2288
|
focusMode: c ?? "manual",
|
|
2273
2289
|
percentageHeight: 100,
|
|
2274
2290
|
percentageWidth: 100,
|
|
2275
|
-
position:
|
|
2276
|
-
ratioHeight:
|
|
2277
|
-
ratioWidth:
|
|
2291
|
+
position: g ?? N.CenterCenter,
|
|
2292
|
+
ratioHeight: S,
|
|
2293
|
+
ratioWidth: d,
|
|
2278
2294
|
unit: r.AspectRatio
|
|
2279
2295
|
};
|
|
2280
2296
|
} else if (o) {
|
|
2281
|
-
const { focusMode: c, height:
|
|
2297
|
+
const { focusMode: c, height: g, position: S, unit: d, width: A, x: k = 0, y: u = 0 } = o.value;
|
|
2282
2298
|
this.cropSize = {
|
|
2283
2299
|
...this.cropSize,
|
|
2284
2300
|
cropMode: "free",
|
|
2285
2301
|
focusMode: c ?? "manual",
|
|
2286
|
-
height:
|
|
2302
|
+
height: g,
|
|
2287
2303
|
percentageHeight: 100,
|
|
2288
2304
|
percentageWidth: 100,
|
|
2289
|
-
position:
|
|
2290
|
-
unit:
|
|
2291
|
-
width:
|
|
2305
|
+
position: S ?? N.CenterCenter,
|
|
2306
|
+
unit: d ?? r.Pixel,
|
|
2307
|
+
width: A,
|
|
2292
2308
|
x: k,
|
|
2293
|
-
y:
|
|
2309
|
+
y: u
|
|
2294
2310
|
};
|
|
2295
2311
|
} else
|
|
2296
2312
|
this.cropSize = {
|
|
@@ -2306,30 +2322,30 @@ let u = class extends B {
|
|
|
2306
2322
|
height: 1,
|
|
2307
2323
|
percentageHeight: 0,
|
|
2308
2324
|
percentageWidth: 0,
|
|
2309
|
-
position:
|
|
2325
|
+
position: N.CenterCenter,
|
|
2310
2326
|
unit: r.Pixel,
|
|
2311
2327
|
width: 1,
|
|
2312
2328
|
x: 0,
|
|
2313
2329
|
y: 0
|
|
2314
2330
|
};
|
|
2315
2331
|
const n = this.transformations.findLast(
|
|
2316
|
-
(c) => c.key ===
|
|
2332
|
+
(c) => c.key === f.Resize && (c.value.unit === r.AspectRatio && c.value.ratioWidth && c.value.ratioHeight || c.value.width || c.value.height)
|
|
2317
2333
|
);
|
|
2318
2334
|
if (n?.value.unit === r.AspectRatio && n.value.ratioWidth && n.value.ratioHeight) {
|
|
2319
|
-
const { ratioHeight: c, ratioWidth:
|
|
2335
|
+
const { ratioHeight: c, ratioWidth: g } = n.value;
|
|
2320
2336
|
this.resizeSize = {
|
|
2321
2337
|
...this.resizeSize,
|
|
2322
2338
|
ratioHeight: c,
|
|
2323
|
-
ratioWidth:
|
|
2339
|
+
ratioWidth: g,
|
|
2324
2340
|
unit: r.AspectRatio
|
|
2325
2341
|
};
|
|
2326
2342
|
} else if (n) {
|
|
2327
|
-
const { height: c = 0, unit:
|
|
2343
|
+
const { height: c = 0, unit: g, width: S = 0 } = n.value;
|
|
2328
2344
|
this.resizeSize = {
|
|
2329
2345
|
...this.resizeSize,
|
|
2330
2346
|
height: c,
|
|
2331
|
-
unit:
|
|
2332
|
-
width:
|
|
2347
|
+
unit: g ?? r.Pixel,
|
|
2348
|
+
width: S
|
|
2333
2349
|
};
|
|
2334
2350
|
} else
|
|
2335
2351
|
this.resizeSize = {
|
|
@@ -2344,17 +2360,17 @@ let u = class extends B {
|
|
|
2344
2360
|
width: 1
|
|
2345
2361
|
};
|
|
2346
2362
|
const l = this.transformations.findLast(
|
|
2347
|
-
(c) => c.key ===
|
|
2363
|
+
(c) => c.key === f.Rotate
|
|
2348
2364
|
);
|
|
2349
2365
|
this.rotation = l?.value.rotation ?? 0;
|
|
2350
|
-
const
|
|
2351
|
-
(c) => c.key ===
|
|
2366
|
+
const p = this.transformations.findLast((c) => c.key === f.Quality)?.value.quality ?? 100, y = this.transformations.some(
|
|
2367
|
+
(c) => c.key === f.Metadata
|
|
2352
2368
|
);
|
|
2353
|
-
this.selectedFormat ? this.selectedFormat = { ...this.selectedFormat, keepMetadata:
|
|
2369
|
+
this.selectedFormat ? this.selectedFormat = { ...this.selectedFormat, keepMetadata: y, quality: p } : this.selectedFormat = {
|
|
2354
2370
|
extension: "",
|
|
2355
2371
|
height: 0,
|
|
2356
|
-
keepMetadata:
|
|
2357
|
-
quality:
|
|
2372
|
+
keepMetadata: y,
|
|
2373
|
+
quality: p,
|
|
2358
2374
|
rotation: 0,
|
|
2359
2375
|
url: "",
|
|
2360
2376
|
width: 0,
|
|
@@ -2371,7 +2387,7 @@ let u = class extends B {
|
|
|
2371
2387
|
this.loading = !0;
|
|
2372
2388
|
const e = await this.apiGetTransformAssetLink({
|
|
2373
2389
|
assetId: this.asset.id,
|
|
2374
|
-
extension:
|
|
2390
|
+
extension: m.getTransformExtension(this.selectedFormat.extension),
|
|
2375
2391
|
format: t?.proxyName ?? "",
|
|
2376
2392
|
siteUrl: this.baseUrl,
|
|
2377
2393
|
token: this.token,
|
|
@@ -2396,18 +2412,18 @@ let u = class extends B {
|
|
|
2396
2412
|
keepAspectRatio: this.cropSize.keepAspectRatio,
|
|
2397
2413
|
percentageHeight: 100,
|
|
2398
2414
|
percentageWidth: 100,
|
|
2399
|
-
position:
|
|
2415
|
+
position: N.CenterCenter,
|
|
2400
2416
|
ratioHeight: 1,
|
|
2401
2417
|
ratioWidth: 1,
|
|
2402
2418
|
unit: r.Pixel,
|
|
2403
2419
|
width: e.width,
|
|
2404
2420
|
x: 0,
|
|
2405
2421
|
y: 0
|
|
2406
|
-
}, this.lastAction ===
|
|
2422
|
+
}, this.lastAction === f.Rotate && (this.rotation = 0), this.lastAction = void 0;
|
|
2407
2423
|
const i = this.transformations.some(
|
|
2408
|
-
(o) => o.key ===
|
|
2424
|
+
(o) => o.key === f.Metadata
|
|
2409
2425
|
), s = this.transformations.findLast(
|
|
2410
|
-
(o) => o.key ===
|
|
2426
|
+
(o) => o.key === f.Quality
|
|
2411
2427
|
);
|
|
2412
2428
|
this.selectedFormat = {
|
|
2413
2429
|
...this.selectedFormat,
|
|
@@ -2421,7 +2437,7 @@ let u = class extends B {
|
|
|
2421
2437
|
* url: `${this.baseUrl}/${response.relativePath}`,
|
|
2422
2438
|
*/
|
|
2423
2439
|
};
|
|
2424
|
-
const a =
|
|
2440
|
+
const a = nt({
|
|
2425
2441
|
asset: this.asset,
|
|
2426
2442
|
baseUrl: "",
|
|
2427
2443
|
extension: this.selectedFormat.extension,
|
|
@@ -2453,7 +2469,7 @@ let u = class extends B {
|
|
|
2453
2469
|
width: Number.parseInt(this.asset.width, 10)
|
|
2454
2470
|
});
|
|
2455
2471
|
const t = this.transformations.findLast(
|
|
2456
|
-
(e) => e.key ===
|
|
2472
|
+
(e) => e.key === f.Quality
|
|
2457
2473
|
);
|
|
2458
2474
|
this.selectedFormat = {
|
|
2459
2475
|
extension: this.asset.extension,
|
|
@@ -2476,7 +2492,7 @@ let u = class extends B {
|
|
|
2476
2492
|
keepAspectRatio: !0,
|
|
2477
2493
|
percentageHeight: 100,
|
|
2478
2494
|
percentageWidth: 100,
|
|
2479
|
-
position:
|
|
2495
|
+
position: N.CenterCenter,
|
|
2480
2496
|
ratioHeight: 1,
|
|
2481
2497
|
ratioWidth: 1,
|
|
2482
2498
|
unit: r.Pixel,
|
|
@@ -2508,8 +2524,8 @@ let u = class extends B {
|
|
|
2508
2524
|
e.proxyName === "TRX" && (e.formatHeight = Number(this.asset.height), e.formatWidth = Number(this.asset.width));
|
|
2509
2525
|
const i = this.proxies?.find((s) => s.id === t);
|
|
2510
2526
|
i && (this.asset && i.proxyName === "TRX" && (i.formatHeight = Number(this.asset.height), i.formatWidth = Number(this.asset.width)), this.transformations = this.transformations.map((s) => {
|
|
2511
|
-
if (s.key ===
|
|
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,
|
|
2527
|
+
if (s.key === f.Crop) {
|
|
2528
|
+
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, p = a.y / i.formatHeight * e.formatHeight;
|
|
2513
2529
|
return {
|
|
2514
2530
|
...s,
|
|
2515
2531
|
value: {
|
|
@@ -2517,11 +2533,11 @@ let u = class extends B {
|
|
|
2517
2533
|
height: n,
|
|
2518
2534
|
width: o,
|
|
2519
2535
|
x: l,
|
|
2520
|
-
y:
|
|
2536
|
+
y: p
|
|
2521
2537
|
}
|
|
2522
2538
|
};
|
|
2523
2539
|
}
|
|
2524
|
-
if (s.key ===
|
|
2540
|
+
if (s.key === f.Resize) {
|
|
2525
2541
|
const a = s.value, o = a.width / i.formatWidth * e.formatWidth, n = a.height / i.formatHeight * e.formatHeight;
|
|
2526
2542
|
return {
|
|
2527
2543
|
...s,
|
|
@@ -2546,7 +2562,7 @@ let u = class extends B {
|
|
|
2546
2562
|
keepAspectRatio: !0,
|
|
2547
2563
|
percentageHeight: 100,
|
|
2548
2564
|
percentageWidth: 100,
|
|
2549
|
-
position:
|
|
2565
|
+
position: N.CenterCenter,
|
|
2550
2566
|
ratioHeight: 1,
|
|
2551
2567
|
ratioWidth: 1,
|
|
2552
2568
|
unit: r.Pixel,
|
|
@@ -2596,30 +2612,30 @@ let u = class extends B {
|
|
|
2596
2612
|
percentageWidth: o,
|
|
2597
2613
|
ratioHeight: n,
|
|
2598
2614
|
ratioWidth: l,
|
|
2599
|
-
unit:
|
|
2600
|
-
useCropMode:
|
|
2615
|
+
unit: p,
|
|
2616
|
+
useCropMode: y,
|
|
2601
2617
|
width: c
|
|
2602
2618
|
}) {
|
|
2603
2619
|
if (!this.selectedFormat?.url || e === "manual")
|
|
2604
2620
|
return;
|
|
2605
|
-
this.loading = !0, this.lastAction =
|
|
2606
|
-
const
|
|
2621
|
+
this.loading = !0, this.lastAction = f.Crop;
|
|
2622
|
+
const g = await this.apiGetCropFocusMode({
|
|
2607
2623
|
autoCropMode: e,
|
|
2608
2624
|
cropHeight: i,
|
|
2609
2625
|
cropWidth: c,
|
|
2610
2626
|
imageUrl: this.selectedFormat.url
|
|
2611
2627
|
});
|
|
2612
|
-
if (
|
|
2613
|
-
let
|
|
2614
|
-
i || (
|
|
2628
|
+
if (g) {
|
|
2629
|
+
let S = a, d = o;
|
|
2630
|
+
i || (S = g.height * 100 / this.selectedFormat.height), c || (d = g.width * 100 / this.selectedFormat.width), this.cropSize = {
|
|
2615
2631
|
...this.cropSize,
|
|
2616
|
-
height:
|
|
2617
|
-
percentageHeight:
|
|
2618
|
-
percentageWidth:
|
|
2619
|
-
width:
|
|
2620
|
-
x:
|
|
2621
|
-
y:
|
|
2622
|
-
...
|
|
2632
|
+
height: g.height,
|
|
2633
|
+
percentageHeight: S ?? this.cropSize.percentageHeight,
|
|
2634
|
+
percentageWidth: d ?? this.cropSize.percentageWidth,
|
|
2635
|
+
width: g.width,
|
|
2636
|
+
x: g.x * 100 / this.selectedFormat.width,
|
|
2637
|
+
y: g.y * 100 / this.selectedFormat.height,
|
|
2638
|
+
...y ? {
|
|
2623
2639
|
cropMode: e,
|
|
2624
2640
|
focusMode: "manual",
|
|
2625
2641
|
keepAspectRatio: !1
|
|
@@ -2630,7 +2646,7 @@ let u = class extends B {
|
|
|
2630
2646
|
keepAspectRatio: s ?? this.cropSize.keepAspectRatio,
|
|
2631
2647
|
ratioHeight: n ?? this.cropSize.ratioHeight,
|
|
2632
2648
|
ratioWidth: l ?? this.cropSize.ratioWidth,
|
|
2633
|
-
unit:
|
|
2649
|
+
unit: p ?? this.cropSize.unit
|
|
2634
2650
|
};
|
|
2635
2651
|
}
|
|
2636
2652
|
this.loading = !1, this.lastAction = void 0;
|
|
@@ -2645,25 +2661,25 @@ let u = class extends B {
|
|
|
2645
2661
|
if (s === 0 || i === 0)
|
|
2646
2662
|
return;
|
|
2647
2663
|
const n = this.cropSize.percentageWidth !== s, l = this.cropSize.percentageHeight !== i;
|
|
2648
|
-
let
|
|
2649
|
-
n && (
|
|
2664
|
+
let p = this.cropSize.height, y = this.cropSize.width;
|
|
2665
|
+
n && (y = Math.round(s * this.selectedFormat.width / 100)), l && (p = Math.round(
|
|
2650
2666
|
i * this.selectedFormat.height / 100
|
|
2651
2667
|
));
|
|
2652
2668
|
const c = this.cropSize.focusMode;
|
|
2653
2669
|
this.focusModes.find(
|
|
2654
|
-
(
|
|
2670
|
+
(S) => S.value === c
|
|
2655
2671
|
)?.auto && this.selectedFormat?.url && this.cropperElement ? await this.handleRequestAutoCropSuggestion({
|
|
2656
2672
|
focusMode: c,
|
|
2657
|
-
height:
|
|
2673
|
+
height: p,
|
|
2658
2674
|
percentageHeight: i,
|
|
2659
2675
|
percentageWidth: s,
|
|
2660
|
-
width:
|
|
2676
|
+
width: y
|
|
2661
2677
|
}) : this.cropSize = {
|
|
2662
2678
|
...this.cropSize,
|
|
2663
|
-
height:
|
|
2679
|
+
height: p,
|
|
2664
2680
|
percentageHeight: i,
|
|
2665
2681
|
percentageWidth: s,
|
|
2666
|
-
width:
|
|
2682
|
+
width: y,
|
|
2667
2683
|
x: a,
|
|
2668
2684
|
y: o
|
|
2669
2685
|
};
|
|
@@ -2694,12 +2710,12 @@ let u = class extends B {
|
|
|
2694
2710
|
* a proxy *id*, so the name has to be looked up in `proxies` rather than used directly.
|
|
2695
2711
|
*/
|
|
2696
2712
|
get autoResolvedProxyId() {
|
|
2697
|
-
const t =
|
|
2713
|
+
const t = Bt(this.asset?.extension);
|
|
2698
2714
|
return this.proxies?.find((e) => e.proxyName === t)?.id ?? "";
|
|
2699
2715
|
}
|
|
2700
2716
|
onProxyChange(t) {
|
|
2701
2717
|
const e = t.detail;
|
|
2702
|
-
if (this.lastAction =
|
|
2718
|
+
if (this.lastAction = f.Proxy, e.autoFormat) {
|
|
2703
2719
|
this.autoFormat = !0;
|
|
2704
2720
|
const i = this.autoResolvedProxyId;
|
|
2705
2721
|
i && (this.selectedProxy = i);
|
|
@@ -2716,7 +2732,7 @@ let u = class extends B {
|
|
|
2716
2732
|
});
|
|
2717
2733
|
else {
|
|
2718
2734
|
const s = this.focusModes.find(
|
|
2719
|
-
(
|
|
2735
|
+
(p) => p.value === this.cropSize.focusMode
|
|
2720
2736
|
)?.auto;
|
|
2721
2737
|
let a = this.cropSize.keepAspectRatio, o = this.cropSize.focusMode, n = this.cropSize.x, l = this.cropSize.y;
|
|
2722
2738
|
e === "free" ? (a = !1, o = "manual") : this.cropSize.unit === r.Pixel && !s && (n = 0, l = 0), s ? await this.handleRequestAutoCropSuggestion({
|
|
@@ -2762,14 +2778,14 @@ let u = class extends B {
|
|
|
2762
2778
|
Math.max(Math.round(s / i), 0),
|
|
2763
2779
|
this.resizeSize.height
|
|
2764
2780
|
) : 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,
|
|
2766
|
-
l + n > 100 && (l = 100 - n),
|
|
2767
|
-
let
|
|
2781
|
+
let l = this.cropSize.x, p = this.cropSize.y;
|
|
2782
|
+
l + n > 100 && (l = 100 - n), p + o > 100 && (p = 100 - o);
|
|
2783
|
+
let y = this.cropSize.cropMode;
|
|
2768
2784
|
this.cropModes.find(
|
|
2769
|
-
(
|
|
2770
|
-
)?.auto && (
|
|
2785
|
+
(g) => g.value === y
|
|
2786
|
+
)?.auto && (y = "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 = {
|
|
2771
2787
|
...this.cropSize,
|
|
2772
|
-
cropMode:
|
|
2788
|
+
cropMode: y,
|
|
2773
2789
|
height: a,
|
|
2774
2790
|
keepAspectRatio: t.detail.keepAspectRatio,
|
|
2775
2791
|
percentageHeight: o,
|
|
@@ -2779,7 +2795,7 @@ let u = class extends B {
|
|
|
2779
2795
|
unit: r.AspectRatio,
|
|
2780
2796
|
width: s,
|
|
2781
2797
|
x: l,
|
|
2782
|
-
y:
|
|
2798
|
+
y: p
|
|
2783
2799
|
};
|
|
2784
2800
|
} else {
|
|
2785
2801
|
const i = this.asset ? t.detail.height * 100 / this.selectedFormat.height : 100, s = this.asset ? t.detail.width * 100 / this.selectedFormat.width : 100;
|
|
@@ -2787,7 +2803,7 @@ let u = class extends B {
|
|
|
2787
2803
|
a + s > 100 && (a = 100 - s), o + i > 100 && (o = 100 - i);
|
|
2788
2804
|
let n = this.cropSize.cropMode;
|
|
2789
2805
|
const l = this.cropModes.find(
|
|
2790
|
-
(
|
|
2806
|
+
(p) => p.value === n
|
|
2791
2807
|
)?.auto;
|
|
2792
2808
|
(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 = {
|
|
2793
2809
|
...this.cropSize,
|
|
@@ -2817,43 +2833,43 @@ let u = class extends B {
|
|
|
2817
2833
|
});
|
|
2818
2834
|
}
|
|
2819
2835
|
onCropApply(t) {
|
|
2820
|
-
if (this.clearResetSnapshot(), this.lastAction =
|
|
2836
|
+
if (this.clearResetSnapshot(), this.lastAction = f.Crop, !this.asset) {
|
|
2821
2837
|
const {
|
|
2822
2838
|
focusMode: l,
|
|
2823
|
-
height:
|
|
2824
|
-
position:
|
|
2839
|
+
height: p,
|
|
2840
|
+
position: y,
|
|
2825
2841
|
ratioHeight: c,
|
|
2826
|
-
ratioWidth:
|
|
2827
|
-
unit:
|
|
2828
|
-
width:
|
|
2829
|
-
x:
|
|
2842
|
+
ratioWidth: g,
|
|
2843
|
+
unit: S,
|
|
2844
|
+
width: d,
|
|
2845
|
+
x: A,
|
|
2830
2846
|
y: k
|
|
2831
|
-
} = this.cropSize,
|
|
2832
|
-
(
|
|
2847
|
+
} = this.cropSize, u = this.focusModes.find(
|
|
2848
|
+
(R) => R.value === l
|
|
2833
2849
|
)?.auto ?? !1;
|
|
2834
|
-
if (
|
|
2835
|
-
|
|
2836
|
-
key:
|
|
2850
|
+
if (S === r.AspectRatio) {
|
|
2851
|
+
g && c && this.upsertTransformation({
|
|
2852
|
+
key: f.Crop,
|
|
2837
2853
|
value: {
|
|
2838
2854
|
focusMode: l,
|
|
2839
|
-
isFocusModeAuto:
|
|
2840
|
-
position:
|
|
2855
|
+
isFocusModeAuto: u,
|
|
2856
|
+
position: y,
|
|
2841
2857
|
ratioHeight: c,
|
|
2842
|
-
ratioWidth:
|
|
2843
|
-
unit:
|
|
2858
|
+
ratioWidth: g,
|
|
2859
|
+
unit: S
|
|
2844
2860
|
}
|
|
2845
2861
|
});
|
|
2846
2862
|
return;
|
|
2847
2863
|
}
|
|
2848
|
-
(
|
|
2849
|
-
key:
|
|
2864
|
+
(p || d) && this.upsertTransformation({
|
|
2865
|
+
key: f.Crop,
|
|
2850
2866
|
value: {
|
|
2851
2867
|
focusMode: l,
|
|
2852
|
-
height:
|
|
2853
|
-
isFocusModeAuto:
|
|
2854
|
-
position:
|
|
2855
|
-
unit:
|
|
2856
|
-
width:
|
|
2868
|
+
height: p,
|
|
2869
|
+
isFocusModeAuto: u,
|
|
2870
|
+
position: y,
|
|
2871
|
+
unit: S,
|
|
2872
|
+
width: d,
|
|
2857
2873
|
/**
|
|
2858
2874
|
* Without an asset there is no cropper to drag, so x/y are always the 0
|
|
2859
2875
|
* placeholder from cropSize's default — never a real manual offset. Omit
|
|
@@ -2861,7 +2877,7 @@ let u = class extends B {
|
|
|
2861
2877
|
* string) so `hasManualXY` in buildTransformationString doesn't spuriously
|
|
2862
2878
|
* suppress the focus mode / position `c_g_` gravity value.
|
|
2863
2879
|
*/
|
|
2864
|
-
x: Number.isFinite(
|
|
2880
|
+
x: Number.isFinite(A) && A !== 0 ? A : void 0,
|
|
2865
2881
|
y: Number.isFinite(k) && k !== 0 ? k : void 0
|
|
2866
2882
|
}
|
|
2867
2883
|
});
|
|
@@ -2874,15 +2890,15 @@ let u = class extends B {
|
|
|
2874
2890
|
(l) => l.value === o
|
|
2875
2891
|
)?.auto ?? !1;
|
|
2876
2892
|
if (e && a && s) {
|
|
2877
|
-
let l = a,
|
|
2878
|
-
if (s === r.AspectRatio && (l = this.cropSize.percentageWidth * this.selectedFormat.width / 100,
|
|
2893
|
+
let l = a, p = e;
|
|
2894
|
+
if (s === r.AspectRatio && (l = this.cropSize.percentageWidth * this.selectedFormat.width / 100, p = this.cropSize.percentageHeight * this.selectedFormat.height / 100), i)
|
|
2879
2895
|
this.transformations = [
|
|
2880
2896
|
...this.transformations,
|
|
2881
2897
|
{
|
|
2882
|
-
key:
|
|
2898
|
+
key: f.Crop,
|
|
2883
2899
|
value: {
|
|
2884
2900
|
focusMode: o,
|
|
2885
|
-
height:
|
|
2901
|
+
height: p,
|
|
2886
2902
|
isFocusModeAuto: n,
|
|
2887
2903
|
mode: i,
|
|
2888
2904
|
width: l
|
|
@@ -2890,18 +2906,18 @@ let u = class extends B {
|
|
|
2890
2906
|
}
|
|
2891
2907
|
];
|
|
2892
2908
|
else {
|
|
2893
|
-
const
|
|
2909
|
+
const y = this.cropSize.x / 100 * this.selectedFormat.width, c = this.cropSize.y / 100 * this.selectedFormat.height;
|
|
2894
2910
|
this.transformations = [
|
|
2895
2911
|
...this.transformations,
|
|
2896
2912
|
{
|
|
2897
|
-
key:
|
|
2913
|
+
key: f.Crop,
|
|
2898
2914
|
value: {
|
|
2899
2915
|
focusMode: o,
|
|
2900
|
-
height:
|
|
2916
|
+
height: p,
|
|
2901
2917
|
isFocusModeAuto: n,
|
|
2902
2918
|
unit: s,
|
|
2903
2919
|
width: l,
|
|
2904
|
-
x:
|
|
2920
|
+
x: y,
|
|
2905
2921
|
y: c
|
|
2906
2922
|
}
|
|
2907
2923
|
}
|
|
@@ -2910,7 +2926,7 @@ let u = class extends B {
|
|
|
2910
2926
|
} else i && (this.transformations = [
|
|
2911
2927
|
...this.transformations,
|
|
2912
2928
|
{
|
|
2913
|
-
key:
|
|
2929
|
+
key: f.Crop,
|
|
2914
2930
|
value: {
|
|
2915
2931
|
focusMode: o,
|
|
2916
2932
|
isFocusModeAuto: n,
|
|
@@ -2945,21 +2961,21 @@ let u = class extends B {
|
|
|
2945
2961
|
}
|
|
2946
2962
|
onResizeApply(t) {
|
|
2947
2963
|
const { height: e, unit: i, width: s } = t.detail;
|
|
2948
|
-
if (this.clearResetSnapshot(), this.lastAction =
|
|
2964
|
+
if (this.clearResetSnapshot(), this.lastAction = f.Resize, !this.asset) {
|
|
2949
2965
|
if (i === r.AspectRatio) {
|
|
2950
|
-
const { ratioHeight:
|
|
2951
|
-
|
|
2952
|
-
key:
|
|
2966
|
+
const { ratioHeight: p, ratioWidth: y } = this.resizeSize;
|
|
2967
|
+
y && p && this.upsertTransformation({
|
|
2968
|
+
key: f.Resize,
|
|
2953
2969
|
value: {
|
|
2954
|
-
ratioHeight:
|
|
2955
|
-
ratioWidth:
|
|
2970
|
+
ratioHeight: p,
|
|
2971
|
+
ratioWidth: y,
|
|
2956
2972
|
unit: i
|
|
2957
2973
|
}
|
|
2958
2974
|
});
|
|
2959
2975
|
return;
|
|
2960
2976
|
}
|
|
2961
2977
|
(e || s) && this.upsertTransformation({
|
|
2962
|
-
key:
|
|
2978
|
+
key: f.Resize,
|
|
2963
2979
|
value: {
|
|
2964
2980
|
height: e,
|
|
2965
2981
|
unit: i,
|
|
@@ -2975,7 +2991,7 @@ let u = class extends B {
|
|
|
2975
2991
|
this.resizeSize.unit !== i ? (n = a, l = o) : i === r.AspectRatio && (n = Math.round(s / e * o), l = o), this.transformations = [
|
|
2976
2992
|
...this.transformations,
|
|
2977
2993
|
{
|
|
2978
|
-
key:
|
|
2994
|
+
key: f.Resize,
|
|
2979
2995
|
value: {
|
|
2980
2996
|
height: l,
|
|
2981
2997
|
unit: i,
|
|
@@ -2989,21 +3005,21 @@ let u = class extends B {
|
|
|
2989
3005
|
}
|
|
2990
3006
|
onRotationApply(t) {
|
|
2991
3007
|
const e = t.detail;
|
|
2992
|
-
if (this.clearResetSnapshot(), this.lastAction =
|
|
3008
|
+
if (this.clearResetSnapshot(), this.lastAction = f.Rotate, !this.asset) {
|
|
2993
3009
|
e ? this.upsertTransformation({
|
|
2994
|
-
key:
|
|
3010
|
+
key: f.Rotate,
|
|
2995
3011
|
value: {
|
|
2996
3012
|
rotation: e
|
|
2997
3013
|
}
|
|
2998
3014
|
}) : this.transformations = this.transformations.filter(
|
|
2999
|
-
(i) => i.key !==
|
|
3015
|
+
(i) => i.key !== f.Rotate
|
|
3000
3016
|
);
|
|
3001
3017
|
return;
|
|
3002
3018
|
}
|
|
3003
3019
|
this.selectedFormat && (this.transformations = [
|
|
3004
3020
|
...this.transformations,
|
|
3005
3021
|
{
|
|
3006
|
-
key:
|
|
3022
|
+
key: f.Rotate,
|
|
3007
3023
|
value: {
|
|
3008
3024
|
rotation: e
|
|
3009
3025
|
}
|
|
@@ -3012,9 +3028,9 @@ let u = class extends B {
|
|
|
3012
3028
|
}
|
|
3013
3029
|
onQualityChange(t) {
|
|
3014
3030
|
const e = t.detail;
|
|
3015
|
-
this.selectedFormat && (this.selectedFormat.quality = e), this.clearResetSnapshot(), this.lastAction =
|
|
3031
|
+
this.selectedFormat && (this.selectedFormat.quality = e), this.clearResetSnapshot(), this.lastAction = f.Quality;
|
|
3016
3032
|
const i = {
|
|
3017
|
-
key:
|
|
3033
|
+
key: f.Quality,
|
|
3018
3034
|
value: {
|
|
3019
3035
|
quality: e
|
|
3020
3036
|
}
|
|
@@ -3028,22 +3044,22 @@ let u = class extends B {
|
|
|
3028
3044
|
keepMetadata: e
|
|
3029
3045
|
}), !this.asset) {
|
|
3030
3046
|
e ? this.upsertTransformation({
|
|
3031
|
-
key:
|
|
3047
|
+
key: f.Metadata,
|
|
3032
3048
|
value: {
|
|
3033
3049
|
keepMetadata: e
|
|
3034
3050
|
}
|
|
3035
3051
|
}) : this.transformations = this.transformations.filter(
|
|
3036
|
-
(i) => i.key !==
|
|
3052
|
+
(i) => i.key !== f.Metadata
|
|
3037
3053
|
);
|
|
3038
3054
|
return;
|
|
3039
3055
|
}
|
|
3040
3056
|
e ? this.upsertTransformation({
|
|
3041
|
-
key:
|
|
3057
|
+
key: f.Metadata,
|
|
3042
3058
|
value: {
|
|
3043
3059
|
keepMetadata: e
|
|
3044
3060
|
}
|
|
3045
3061
|
}) : this.transformations = this.transformations.filter(
|
|
3046
|
-
(i) => i.key !==
|
|
3062
|
+
(i) => i.key !== f.Metadata
|
|
3047
3063
|
);
|
|
3048
3064
|
}
|
|
3049
3065
|
onExtensionChange(t) {
|
|
@@ -3055,7 +3071,7 @@ let u = class extends B {
|
|
|
3055
3071
|
}
|
|
3056
3072
|
syncQuality() {
|
|
3057
3073
|
const t = this.transformations.findLast(
|
|
3058
|
-
(e) => e.key ===
|
|
3074
|
+
(e) => e.key === f.Quality
|
|
3059
3075
|
)?.value?.quality;
|
|
3060
3076
|
this.selectedFormat && (this.selectedFormat = {
|
|
3061
3077
|
...this.selectedFormat,
|
|
@@ -3096,24 +3112,24 @@ let u = class extends B {
|
|
|
3096
3112
|
return C`<div class="asset-link-format" @cx-show=${this.onDetailsShow} @cx-hide=${this.onDetailsHide}>${_(
|
|
3097
3113
|
!this.hideHeader,
|
|
3098
3114
|
() => 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
|
-
() =>
|
|
3115
|
+
() => Ut
|
|
3100
3116
|
)}
|
|
3101
3117
|
${_(
|
|
3102
3118
|
!this.noFormat,
|
|
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 ===
|
|
3119
|
+
() => 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 === f.Proxy} @cx-asset-link-format-proxy-change=${this.onProxyChange}></cx-asset-link-format-proxy>`
|
|
3104
3120
|
)}
|
|
3105
3121
|
${_(
|
|
3106
3122
|
!this.noCrop,
|
|
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 ===
|
|
3123
|
+
() => 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 === f.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>`
|
|
3108
3124
|
)}
|
|
3109
3125
|
${_(
|
|
3110
3126
|
!this.noResize,
|
|
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 ===
|
|
3127
|
+
() => C`<cx-asset-link-format-resize class="asset-link-format__details" ?open=${this.activeSetting === "cx-asset-link-format-resize"} ?loading=${this.loading && this.lastAction === f.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>`
|
|
3112
3128
|
)}
|
|
3113
3129
|
${_(
|
|
3114
3130
|
!this.noRotate,
|
|
3115
|
-
() => C`<cx-asset-link-format-rotation class="asset-link-format__details" ?loading=${this.loading && this.lastAction ===
|
|
3116
|
-
)}<cx-asset-link-format-quality class="asset-link-format__details" ?loading=${this.loading && this.lastAction ===
|
|
3131
|
+
() => C`<cx-asset-link-format-rotation class="asset-link-format__details" ?loading=${this.loading && this.lastAction === f.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>`
|
|
3132
|
+
)}<cx-asset-link-format-quality class="asset-link-format__details" ?loading=${this.loading && this.lastAction === f.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>${_(
|
|
3117
3133
|
!this.noMetadata,
|
|
3118
3134
|
() => 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>`
|
|
3119
3135
|
)}
|
|
@@ -3123,167 +3139,168 @@ let u = class extends B {
|
|
|
3123
3139
|
)}</div>`;
|
|
3124
3140
|
}
|
|
3125
3141
|
};
|
|
3126
|
-
|
|
3127
|
-
|
|
3142
|
+
m.styles = [G, Pe];
|
|
3143
|
+
m.dependencies = {
|
|
3128
3144
|
"cx-asset-link-format-crop": v,
|
|
3129
|
-
"cx-asset-link-format-extension":
|
|
3130
|
-
"cx-asset-link-format-metadata":
|
|
3145
|
+
"cx-asset-link-format-extension": Z,
|
|
3146
|
+
"cx-asset-link-format-metadata": L,
|
|
3131
3147
|
"cx-asset-link-format-proxy": M,
|
|
3132
3148
|
"cx-asset-link-format-quality": T,
|
|
3133
3149
|
"cx-asset-link-format-resize": w,
|
|
3134
3150
|
"cx-asset-link-format-rotation": H,
|
|
3135
|
-
"cx-button":
|
|
3136
|
-
"cx-space":
|
|
3137
|
-
"cx-typography":
|
|
3151
|
+
"cx-button": Y,
|
|
3152
|
+
"cx-space": U,
|
|
3153
|
+
"cx-typography": B
|
|
3138
3154
|
};
|
|
3139
3155
|
x([
|
|
3140
3156
|
h({ attribute: "base-url", type: String })
|
|
3141
|
-
],
|
|
3157
|
+
], m.prototype, "baseUrl", 2);
|
|
3142
3158
|
x([
|
|
3143
3159
|
h({ attribute: "token", type: String })
|
|
3144
|
-
],
|
|
3160
|
+
], m.prototype, "token", 2);
|
|
3145
3161
|
x([
|
|
3146
3162
|
h({ reflect: !1, type: Object })
|
|
3147
|
-
],
|
|
3163
|
+
], m.prototype, "asset", 2);
|
|
3148
3164
|
x([
|
|
3149
3165
|
h({ attribute: "crop-modes", reflect: !1, type: Array })
|
|
3150
|
-
],
|
|
3166
|
+
], m.prototype, "cropModes", 2);
|
|
3151
3167
|
x([
|
|
3152
3168
|
h({ attribute: "focus-modes", reflect: !1, type: Object })
|
|
3153
|
-
],
|
|
3169
|
+
], m.prototype, "focusModes", 2);
|
|
3154
3170
|
x([
|
|
3155
3171
|
h({ reflect: !1, type: Array })
|
|
3156
|
-
],
|
|
3172
|
+
], m.prototype, "extensions", 2);
|
|
3157
3173
|
x([
|
|
3158
3174
|
h({ reflect: !1, type: Array })
|
|
3159
|
-
],
|
|
3175
|
+
], m.prototype, "proxies", 2);
|
|
3160
3176
|
x([
|
|
3161
3177
|
h({ attribute: "for-cropper", reflect: !0, type: String })
|
|
3162
|
-
],
|
|
3178
|
+
], m.prototype, "forCropper", 2);
|
|
3163
3179
|
x([
|
|
3164
3180
|
h({ attribute: "use-session", reflect: !0, type: String })
|
|
3165
|
-
],
|
|
3181
|
+
], m.prototype, "useSession", 2);
|
|
3166
3182
|
x([
|
|
3167
3183
|
h({ reflect: !1, type: Array })
|
|
3168
|
-
],
|
|
3184
|
+
], m.prototype, "transformations", 2);
|
|
3169
3185
|
x([
|
|
3170
3186
|
h({ attribute: "selected-proxy", reflect: !0, type: String })
|
|
3171
|
-
],
|
|
3187
|
+
], m.prototype, "selectedProxy", 2);
|
|
3172
3188
|
x([
|
|
3173
3189
|
h({ attribute: "default-proxy", reflect: !0, type: String })
|
|
3174
|
-
],
|
|
3190
|
+
], m.prototype, "defaultProxy", 2);
|
|
3175
3191
|
x([
|
|
3176
3192
|
h({ attribute: "can-auto-format", reflect: !0, type: Boolean })
|
|
3177
|
-
],
|
|
3193
|
+
], m.prototype, "canAutoFormat", 2);
|
|
3178
3194
|
x([
|
|
3179
3195
|
h({ attribute: "auto-format", reflect: !0, type: Boolean })
|
|
3180
|
-
],
|
|
3196
|
+
], m.prototype, "autoFormat", 2);
|
|
3181
3197
|
x([
|
|
3182
3198
|
h({ attribute: "use-custom-extension", reflect: !0, type: Boolean })
|
|
3183
|
-
],
|
|
3199
|
+
], m.prototype, "useCustomExtension", 2);
|
|
3184
3200
|
x([
|
|
3185
3201
|
h({ attribute: "no-metadata", reflect: !0, type: Boolean })
|
|
3186
|
-
],
|
|
3202
|
+
], m.prototype, "noMetadata", 2);
|
|
3187
3203
|
x([
|
|
3188
3204
|
h({ attribute: "no-format", reflect: !0, type: Boolean })
|
|
3189
|
-
],
|
|
3205
|
+
], m.prototype, "noFormat", 2);
|
|
3190
3206
|
x([
|
|
3191
3207
|
h({ attribute: "no-crop", reflect: !0, type: Boolean })
|
|
3192
|
-
],
|
|
3208
|
+
], m.prototype, "noCrop", 2);
|
|
3193
3209
|
x([
|
|
3194
3210
|
h({ attribute: "no-resize", reflect: !0, type: Boolean })
|
|
3195
|
-
],
|
|
3211
|
+
], m.prototype, "noResize", 2);
|
|
3196
3212
|
x([
|
|
3197
3213
|
h({ attribute: "no-rotate", reflect: !0, type: Boolean })
|
|
3198
|
-
],
|
|
3214
|
+
], m.prototype, "noRotate", 2);
|
|
3199
3215
|
x([
|
|
3200
3216
|
h({ attribute: "last-image-size", reflect: !1, type: Object })
|
|
3201
|
-
],
|
|
3217
|
+
], m.prototype, "lastImageSize", 2);
|
|
3202
3218
|
x([
|
|
3203
3219
|
h({ attribute: "hide-header", reflect: !1, type: Boolean })
|
|
3204
|
-
],
|
|
3220
|
+
], m.prototype, "hideHeader", 2);
|
|
3205
3221
|
x([
|
|
3206
3222
|
h({ attribute: "can-reset", type: Boolean })
|
|
3207
|
-
],
|
|
3223
|
+
], m.prototype, "canReset", 2);
|
|
3208
3224
|
x([
|
|
3209
3225
|
h({ attribute: !1, reflect: !1, type: Object })
|
|
3210
|
-
],
|
|
3226
|
+
], m.prototype, "queryElement", 2);
|
|
3211
3227
|
x([
|
|
3212
3228
|
b()
|
|
3213
|
-
],
|
|
3229
|
+
], m.prototype, "activeSetting", 2);
|
|
3214
3230
|
x([
|
|
3215
3231
|
b()
|
|
3216
|
-
],
|
|
3232
|
+
], m.prototype, "selectedFormat", 2);
|
|
3217
3233
|
x([
|
|
3218
3234
|
b()
|
|
3219
|
-
],
|
|
3235
|
+
], m.prototype, "resizeSize", 2);
|
|
3220
3236
|
x([
|
|
3221
3237
|
b()
|
|
3222
|
-
],
|
|
3238
|
+
], m.prototype, "cropSize", 2);
|
|
3223
3239
|
x([
|
|
3224
3240
|
b()
|
|
3225
|
-
],
|
|
3241
|
+
], m.prototype, "rotation", 2);
|
|
3226
3242
|
x([
|
|
3227
3243
|
b()
|
|
3228
|
-
],
|
|
3244
|
+
], m.prototype, "defaultSize", 2);
|
|
3229
3245
|
x([
|
|
3230
3246
|
b()
|
|
3231
|
-
],
|
|
3247
|
+
], m.prototype, "cropperElement", 2);
|
|
3232
3248
|
x([
|
|
3233
3249
|
b()
|
|
3234
|
-
],
|
|
3250
|
+
], m.prototype, "parameters", 2);
|
|
3235
3251
|
x([
|
|
3236
3252
|
b()
|
|
3237
|
-
],
|
|
3253
|
+
], m.prototype, "loading", 2);
|
|
3238
3254
|
x([
|
|
3239
3255
|
b()
|
|
3240
|
-
],
|
|
3256
|
+
], m.prototype, "lastAction", 2);
|
|
3241
3257
|
x([
|
|
3242
3258
|
b()
|
|
3243
|
-
],
|
|
3259
|
+
], m.prototype, "frozenIndex", 2);
|
|
3244
3260
|
x([
|
|
3245
3261
|
b()
|
|
3246
|
-
],
|
|
3262
|
+
], m.prototype, "preResetTransformations", 2);
|
|
3247
3263
|
x([
|
|
3248
3264
|
b()
|
|
3249
|
-
],
|
|
3265
|
+
], m.prototype, "preResetAutoFormat", 2);
|
|
3250
3266
|
x([
|
|
3251
3267
|
b()
|
|
3252
|
-
],
|
|
3268
|
+
], m.prototype, "preResetSelectedProxy", 2);
|
|
3253
3269
|
x([
|
|
3254
3270
|
P("transformations")
|
|
3255
|
-
],
|
|
3271
|
+
], m.prototype, "handleTransformationsChange", 1);
|
|
3256
3272
|
x([
|
|
3257
3273
|
P("selectedProxy")
|
|
3258
|
-
],
|
|
3274
|
+
], m.prototype, "handleSelectedProxyChange", 1);
|
|
3259
3275
|
x([
|
|
3260
3276
|
P("loading")
|
|
3261
|
-
],
|
|
3262
|
-
|
|
3263
|
-
|
|
3264
|
-
],
|
|
3277
|
+
], m.prototype, "handleLoadingChange", 1);
|
|
3278
|
+
m = x([
|
|
3279
|
+
Q("cx-asset-link-format")
|
|
3280
|
+
], m);
|
|
3265
3281
|
export {
|
|
3266
|
-
|
|
3267
|
-
|
|
3268
|
-
|
|
3269
|
-
|
|
3270
|
-
|
|
3271
|
-
|
|
3272
|
-
|
|
3273
|
-
|
|
3274
|
-
|
|
3275
|
-
|
|
3276
|
-
|
|
3277
|
-
|
|
3278
|
-
ct as
|
|
3279
|
-
|
|
3280
|
-
|
|
3281
|
-
dt as
|
|
3282
|
-
|
|
3283
|
-
|
|
3284
|
-
|
|
3285
|
-
|
|
3286
|
-
|
|
3287
|
-
|
|
3288
|
-
|
|
3282
|
+
m as C,
|
|
3283
|
+
rt as F,
|
|
3284
|
+
$t as M,
|
|
3285
|
+
we as a,
|
|
3286
|
+
fe as b,
|
|
3287
|
+
Gt as c,
|
|
3288
|
+
Bi as d,
|
|
3289
|
+
qi as e,
|
|
3290
|
+
Ui as f,
|
|
3291
|
+
Xt as g,
|
|
3292
|
+
mt as h,
|
|
3293
|
+
Zt as i,
|
|
3294
|
+
ct as j,
|
|
3295
|
+
pt as k,
|
|
3296
|
+
Ht as l,
|
|
3297
|
+
dt as m,
|
|
3298
|
+
ut as n,
|
|
3299
|
+
Wt as o,
|
|
3300
|
+
ji as p,
|
|
3301
|
+
Vt as q,
|
|
3302
|
+
Ni as r,
|
|
3303
|
+
Oi as s,
|
|
3304
|
+
Li as t,
|
|
3305
|
+
le as u
|
|
3289
3306
|
};
|