@orangelogic/design-system 3.8.0 → 3.9.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.B-tXtkr4.js → asset-link-format.BLKOUD2l.js} +595 -584
- package/library/chunks/{color-swatch-group.D1evXBSR.js → color-swatch-group.Bvq6xkM-.js} +2 -3
- package/library/chunks/{document-viewer.C_3p-Fr2.js → document-viewer.CRMRT7Ou.js} +1 -2
- package/library/chunks/{index.B60ncEsL.js → index.4gEMGYGn.js} +4 -4
- package/library/chunks/{toast.C5Ir5yKA.js → toast.CCWVobz5.js} +1 -1
- package/library/chunks/transformation.D27sTUdZ.js +392 -0
- package/library/chunks/{types.CRoGmgCO.js → types.Bin5fi-e.js} +5539 -5548
- package/library/components/asset-link-format.js +2 -2
- package/library/components/atoms.js +1 -1
- package/library/components/color-swatch-group.js +3 -3
- package/library/components/document-viewer.js +1 -1
- package/library/components/masonry.js +95 -108
- package/library/components/organisms.js +2 -2
- package/library/components/types.js +130 -131
- package/library/package.json +1 -1
- package/library/packages/molecules/src/masonry/masonry.d.ts +0 -2
- package/library/packages/services/src/api/asset/asset.d.ts +1 -1
- package/library/packages/types/src/gallery-item.d.ts +1 -0
- package/library/packages/types/src/masonry.d.ts +1 -0
- package/library/react-web-component.d.ts +4 -4
- package/library/utils.js +96 -97
- package/package.json +1 -1
- package/library/chunks/content-builder.BX4pHujE.js +0 -60
- package/library/chunks/transformation.DNl_AZs1.js +0 -334
|
@@ -1,50 +1,49 @@
|
|
|
1
1
|
import "../components/cropper.js";
|
|
2
|
-
import { C as
|
|
2
|
+
import { C as Y } from "./button.w0zH5Ivx.js";
|
|
3
3
|
import B from "../components/space.js";
|
|
4
4
|
import { C as q } from "./typography.IqHbnd3C.js";
|
|
5
5
|
import { n as h, C as j } from "./lib-cortex-element.CVMmyPMC.js";
|
|
6
|
-
import { h as
|
|
6
|
+
import { h as E, a as Ut, C as Bt, S as te, b as ee, c as ie, d as se } from "./endpoints.mJ5S-tIs.js";
|
|
7
7
|
import "./browser.BHOCIF_A.js";
|
|
8
|
-
import { i as V, x as C, E as
|
|
8
|
+
import { i as V, x as C, E as qt } from "./lit-element.jLBm65_O.js";
|
|
9
9
|
import "./form.C8LMdQB4.js";
|
|
10
10
|
import { L as G } from "./i18n.BA19xtyU.js";
|
|
11
|
-
import { a as
|
|
11
|
+
import { a as ae } from "./string.Demn8Xmk.js";
|
|
12
12
|
import "./date-picker.BGHn6qg8.js";
|
|
13
|
-
import "./
|
|
13
|
+
import { a as Tt, r as jt, b as oe, c as re, d as ne, e as lt } from "./transformation.D27sTUdZ.js";
|
|
14
14
|
import "./unsafe-html.Dff7-rCx.js";
|
|
15
|
-
import {
|
|
16
|
-
import { b as ae } from "./_baseUniq.lwMgmtt2.js";
|
|
15
|
+
import { b as he } from "./_baseUniq.lwMgmtt2.js";
|
|
17
16
|
import { c as Q } from "./component.styles.CRO4Odto.js";
|
|
18
|
-
import { M as
|
|
19
|
-
import { v as
|
|
17
|
+
import { M as ct, U as r, T as g } from "./asset-link-format.ClaYu_v8.js";
|
|
18
|
+
import { v as le } from "./v4.CKZ6klMF.js";
|
|
20
19
|
import { P as N } from "./position-picker.DjnhxIKF.js";
|
|
21
20
|
import { c as X } from "./custom-element.L4WJXn1j.js";
|
|
22
21
|
import { w as P } from "./watch.DJF5K-8U.js";
|
|
23
|
-
import { s as
|
|
22
|
+
import { s as Ht, a as pt } from "./number.Cx2ncfJJ.js";
|
|
24
23
|
import { r as R } from "./state.CSDxrqLd.js";
|
|
25
|
-
import { n as
|
|
24
|
+
import { n as M } from "./when.Dr1es41R.js";
|
|
26
25
|
import st from "../components/details.js";
|
|
27
|
-
import
|
|
26
|
+
import Vt from "../components/divider.js";
|
|
28
27
|
import { C as at } from "./icon.CpHbi8tH.js";
|
|
29
|
-
import { C as
|
|
30
|
-
import { C as
|
|
28
|
+
import { C as $t } from "./icon-button.BWJ1Vqn5.js";
|
|
29
|
+
import { C as Pt } from "./input.D1TGTsxj.js";
|
|
31
30
|
import { C as vt } from "./option.jeaj7_Lr.js";
|
|
32
31
|
import zt from "../components/select.js";
|
|
33
|
-
import
|
|
34
|
-
import { c as
|
|
35
|
-
import { e as
|
|
36
|
-
import { c as
|
|
32
|
+
import ce from "../components/position-picker.js";
|
|
33
|
+
import { c as pe } from "./image.Y5c_hFx8.js";
|
|
34
|
+
import { e as J } from "./query.BBf1UFkC.js";
|
|
35
|
+
import { c as ot } from "./repeat.CFjcER6_.js";
|
|
37
36
|
import { o as O } from "./style-map.llVFPd__.js";
|
|
38
|
-
import
|
|
39
|
-
import
|
|
40
|
-
import
|
|
41
|
-
function
|
|
42
|
-
return t && t.length ?
|
|
37
|
+
import Gt from "../components/tooltip.js";
|
|
38
|
+
import de from "../components/button-group.js";
|
|
39
|
+
import ue from "../components/checkbox.js";
|
|
40
|
+
function me(t) {
|
|
41
|
+
return t && t.length ? he(t) : [];
|
|
43
42
|
}
|
|
44
|
-
function
|
|
43
|
+
function Qt(t) {
|
|
45
44
|
return typeof t == "object" && t !== null && "URI" in t;
|
|
46
45
|
}
|
|
47
|
-
const
|
|
46
|
+
const fe = {
|
|
48
47
|
artist: "Artist",
|
|
49
48
|
color: "Color",
|
|
50
49
|
createDate: "CreateDate",
|
|
@@ -66,18 +65,18 @@ const pe = {
|
|
|
66
65
|
systemIdentifier: "SystemIdentifier",
|
|
67
66
|
text: "Text",
|
|
68
67
|
title: "Title"
|
|
69
|
-
},
|
|
70
|
-
function
|
|
68
|
+
}, ge = /* @__PURE__ */ new Set(["mediaDate", "createDate", "editDate"]);
|
|
69
|
+
function Rt(t) {
|
|
71
70
|
return !/[\s&+/*"\\:(),'<>~|[\]{}]/.test(t) && !/^(?:OR|AND|NOT)$/.test(t) ? t : `"${t.replace(/\\/g, "\\\\").replace(/"/g, '\\"')}"`;
|
|
72
71
|
}
|
|
73
|
-
function
|
|
74
|
-
const s = (Array.isArray(e) ? e : [e]).map((a) => `${t}:${
|
|
72
|
+
function Wt(t, e) {
|
|
73
|
+
const s = (Array.isArray(e) ? e : [e]).map((a) => `${t}:${Rt(a)}`);
|
|
75
74
|
return s.length > 1 ? `(${s.join(" OR ")})` : s[0] ?? "";
|
|
76
75
|
}
|
|
77
|
-
function
|
|
76
|
+
function xe(t, e) {
|
|
78
77
|
return (Array.isArray(e) ? e : [e]).map((s) => `${t}${s.operator}${s.value}`).join(" AND ");
|
|
79
78
|
}
|
|
80
|
-
function
|
|
79
|
+
function ye(t) {
|
|
81
80
|
const e = [];
|
|
82
81
|
for (const i of Object.keys(t)) {
|
|
83
82
|
const s = i, a = t[s];
|
|
@@ -87,14 +86,14 @@ function me(t) {
|
|
|
87
86
|
for (const [o, l] of Object.entries(
|
|
88
87
|
a
|
|
89
88
|
))
|
|
90
|
-
e.push(
|
|
89
|
+
e.push(Wt(o, l));
|
|
91
90
|
continue;
|
|
92
91
|
}
|
|
93
|
-
const n =
|
|
92
|
+
const n = fe[s];
|
|
94
93
|
if (n) {
|
|
95
|
-
if (
|
|
94
|
+
if (ge.has(s)) {
|
|
96
95
|
e.push(
|
|
97
|
-
|
|
96
|
+
xe(n, a)
|
|
98
97
|
);
|
|
99
98
|
continue;
|
|
100
99
|
}
|
|
@@ -107,13 +106,13 @@ function me(t) {
|
|
|
107
106
|
if (o.length === 0)
|
|
108
107
|
continue;
|
|
109
108
|
const l = [
|
|
110
|
-
...o.map((d) => `ParentFolderIdentifier:${
|
|
111
|
-
...o.map((d) => `ParentAlbumIdentifier:${
|
|
109
|
+
...o.map((d) => `ParentFolderIdentifier:${Rt(String(d))}`),
|
|
110
|
+
...o.map((d) => `ParentAlbumIdentifier:${Rt(String(d))}`)
|
|
112
111
|
];
|
|
113
112
|
e.push(`(${l.join(" OR ")})`);
|
|
114
113
|
continue;
|
|
115
114
|
}
|
|
116
|
-
e.push(
|
|
115
|
+
e.push(Wt(n, a));
|
|
117
116
|
}
|
|
118
117
|
}
|
|
119
118
|
return e.join(" AND ");
|
|
@@ -129,40 +128,40 @@ function dt(t) {
|
|
|
129
128
|
const e = dt(t.not);
|
|
130
129
|
return e ? `NOT (${e})` : "";
|
|
131
130
|
}
|
|
132
|
-
return
|
|
131
|
+
return ye(t);
|
|
133
132
|
}
|
|
134
|
-
const
|
|
133
|
+
const Se = "CoreField.LargeSizePreview", ut = "CoreField.DocType", Ae = "Document.Title", ve = "Document.CaptionLong", rt = "Document.FileExtension", mt = "CoreField.FileSize", Dt = "CoreField.Identifier", ft = "CoreField.MaxHeight", gt = "CoreField.MaxWidth", xt = "Document.RecordID", Nt = "CoreField.DocSubType", Xt = "CoreField.TitleWithFallback", yt = "CoreField.OriginalFileName", St = "CoreField.UpdatedFileName", Ft = "__width", ze = "CoreField.OriginalPreview", Bi = "Document.DocSubType", qi = "Document.InPoint", ji = "Document.OutPoint", wt = {
|
|
135
134
|
DEFAULT_VIEW_SIZE: "Document.LargeSizePreview",
|
|
136
135
|
FIELD_TITLE_WITH_FALLBACK: "Document.TitleWithFallback",
|
|
137
136
|
ORIGINAL_VIEW_SIZE: "Document.OriginalPreview"
|
|
138
|
-
},
|
|
139
|
-
[
|
|
140
|
-
[
|
|
141
|
-
[
|
|
142
|
-
},
|
|
143
|
-
Object.entries(
|
|
137
|
+
}, Kt = {
|
|
138
|
+
[Se]: wt.DEFAULT_VIEW_SIZE,
|
|
139
|
+
[Xt]: wt.FIELD_TITLE_WITH_FALLBACK,
|
|
140
|
+
[ze]: wt.ORIGINAL_VIEW_SIZE
|
|
141
|
+
}, Ce = Object.fromEntries(
|
|
142
|
+
Object.entries(Kt).map(([t, e]) => [
|
|
144
143
|
e,
|
|
145
144
|
t
|
|
146
145
|
])
|
|
147
146
|
);
|
|
148
|
-
function
|
|
149
|
-
return
|
|
147
|
+
function we(t) {
|
|
148
|
+
return Kt[t] ?? t;
|
|
150
149
|
}
|
|
151
|
-
function
|
|
150
|
+
function Ot(t) {
|
|
152
151
|
const e = {};
|
|
153
152
|
for (const [i, s] of Object.entries(t)) {
|
|
154
|
-
const a =
|
|
153
|
+
const a = Ce[i] ?? i;
|
|
155
154
|
e[a] = s;
|
|
156
155
|
}
|
|
157
156
|
return e;
|
|
158
157
|
}
|
|
159
|
-
function
|
|
158
|
+
function be(t) {
|
|
160
159
|
const e = new URLSearchParams();
|
|
161
160
|
for (const [i, s] of Object.entries(t))
|
|
162
161
|
s != null && (Array.isArray(s) ? s.forEach((a) => e.append(i, String(a))) : e.append(i, String(s)));
|
|
163
162
|
return e;
|
|
164
163
|
}
|
|
165
|
-
async function
|
|
164
|
+
async function Zt({
|
|
166
165
|
countPerPage: t,
|
|
167
166
|
fields: e,
|
|
168
167
|
getPermanentAssetsPaths: i,
|
|
@@ -176,9 +175,9 @@ async function Xt({
|
|
|
176
175
|
token: c,
|
|
177
176
|
useSession: y
|
|
178
177
|
}) {
|
|
179
|
-
const
|
|
178
|
+
const A = e?.map(we), p = {
|
|
180
179
|
CountPerPage: t,
|
|
181
|
-
Fields:
|
|
180
|
+
Fields: me(A),
|
|
182
181
|
Format: "json",
|
|
183
182
|
GetPermanentAssetsPaths: i || void 0,
|
|
184
183
|
PageNumber: n,
|
|
@@ -186,35 +185,35 @@ async function Xt({
|
|
|
186
185
|
SecurityByPassToken: l || void 0,
|
|
187
186
|
Sort: m || void 0,
|
|
188
187
|
UseSession: y || void 0
|
|
189
|
-
},
|
|
188
|
+
}, x = s === "POST";
|
|
190
189
|
try {
|
|
191
|
-
return (await
|
|
190
|
+
return (await E.request({
|
|
192
191
|
baseURL: d,
|
|
193
192
|
headers: c ? { Authorization: `Bearer ${c}` } : void 0,
|
|
194
193
|
method: s,
|
|
195
194
|
// POST large RecordID queries as a urlencoded body to dodge the ~2KB URL cap;
|
|
196
195
|
// GET keeps the same fields on the query string.
|
|
197
|
-
...
|
|
196
|
+
...x ? { data: be(p) } : { params: p, paramsSerializer: { indexes: null } },
|
|
198
197
|
responseType: "json",
|
|
199
198
|
transformResponse: [
|
|
200
|
-
...Array.isArray(
|
|
201
|
-
a ? (
|
|
202
|
-
items: (
|
|
203
|
-
sort:
|
|
204
|
-
totalCount:
|
|
205
|
-
}) : (
|
|
206
|
-
items: (
|
|
207
|
-
sort:
|
|
208
|
-
totalCount:
|
|
199
|
+
...Array.isArray(E.defaults.transformResponse) ? E.defaults.transformResponse : [],
|
|
200
|
+
a ? (u) => ({
|
|
201
|
+
items: (u.results?.Items ?? []).map(Ot),
|
|
202
|
+
sort: u.results?.GlobalInfo?.Sort ?? "",
|
|
203
|
+
totalCount: u.results?.GlobalInfo?.TotalCount ?? 0
|
|
204
|
+
}) : (u) => ({
|
|
205
|
+
items: (u.APIResponse?.Items ?? []).map(Ot),
|
|
206
|
+
sort: u.APIResponse?.GlobalInfo?.Sort ?? "",
|
|
207
|
+
totalCount: u.APIResponse?.GlobalInfo?.TotalCount ?? 0
|
|
209
208
|
})
|
|
210
209
|
],
|
|
211
|
-
url: a ?
|
|
210
|
+
url: a ? Bt.SEARCH_ASSETS : te["4.0"]
|
|
212
211
|
})).data;
|
|
213
212
|
} catch {
|
|
214
213
|
return { items: [], sort: "", totalCount: 0 };
|
|
215
214
|
}
|
|
216
215
|
}
|
|
217
|
-
async function
|
|
216
|
+
async function ke({
|
|
218
217
|
assetId: t,
|
|
219
218
|
extension: e,
|
|
220
219
|
format: i,
|
|
@@ -224,13 +223,13 @@ async function ze({
|
|
|
224
223
|
useSession: o
|
|
225
224
|
}) {
|
|
226
225
|
try {
|
|
227
|
-
return (await
|
|
226
|
+
return (await E.request({
|
|
228
227
|
baseURL: s,
|
|
229
228
|
method: "GET",
|
|
230
229
|
params: {
|
|
231
230
|
SourceAssetFormat: i,
|
|
232
231
|
SourceAssetRecordID: t,
|
|
233
|
-
TargetExtension:
|
|
232
|
+
TargetExtension: ae(e),
|
|
234
233
|
Token: a || void 0,
|
|
235
234
|
Transformations: n,
|
|
236
235
|
UseSession: o || void 0
|
|
@@ -240,20 +239,20 @@ async function ze({
|
|
|
240
239
|
*/
|
|
241
240
|
timeout: 3e5,
|
|
242
241
|
// 5 minutes
|
|
243
|
-
url:
|
|
242
|
+
url: Ut.GET_TRANSFORM_ASSET_LINK
|
|
244
243
|
})).data;
|
|
245
244
|
} catch {
|
|
246
245
|
return null;
|
|
247
246
|
}
|
|
248
247
|
}
|
|
249
|
-
const
|
|
250
|
-
function
|
|
248
|
+
const Re = 50;
|
|
249
|
+
function $e(t, e) {
|
|
251
250
|
const i = [];
|
|
252
251
|
for (let s = 0; s < t.length; s += e)
|
|
253
252
|
i.push(t.slice(s, s + e));
|
|
254
253
|
return i;
|
|
255
254
|
}
|
|
256
|
-
async function
|
|
255
|
+
async function Pe({
|
|
257
256
|
extraFields: t,
|
|
258
257
|
getPermanentAssetsPaths: e,
|
|
259
258
|
isSiteBuilder: i,
|
|
@@ -267,12 +266,12 @@ async function be({
|
|
|
267
266
|
...o,
|
|
268
267
|
St,
|
|
269
268
|
yt,
|
|
270
|
-
|
|
271
|
-
|
|
269
|
+
Ae,
|
|
270
|
+
ve,
|
|
272
271
|
xt
|
|
273
|
-
], d =
|
|
272
|
+
], d = $e(s, Re), m = await Promise.all(
|
|
274
273
|
d.map(
|
|
275
|
-
(p) =>
|
|
274
|
+
(p) => Zt({
|
|
276
275
|
countPerPage: p.length,
|
|
277
276
|
fields: l,
|
|
278
277
|
getPermanentAssetsPaths: e,
|
|
@@ -284,101 +283,100 @@ async function be({
|
|
|
284
283
|
token: n
|
|
285
284
|
})
|
|
286
285
|
)
|
|
287
|
-
), c = new Map(s.map((p,
|
|
288
|
-
let
|
|
289
|
-
return
|
|
290
|
-
name:
|
|
291
|
-
recordId:
|
|
286
|
+
), c = new Map(s.map((p, x) => [p, x])), y = m.flatMap((p) => p.items).map((p) => {
|
|
287
|
+
let x = _(p, St);
|
|
288
|
+
return x === "" && (x = _(p, yt)), {
|
|
289
|
+
name: x,
|
|
290
|
+
recordId: _(p, xt),
|
|
292
291
|
...o.reduce(
|
|
293
|
-
(
|
|
294
|
-
|
|
295
|
-
const
|
|
296
|
-
return
|
|
292
|
+
(b, u) => {
|
|
293
|
+
b[u] = _(p, u);
|
|
294
|
+
const w = Yt(p, u);
|
|
295
|
+
return w !== void 0 && (b[`${u}${Ft}`] = String(w)), b;
|
|
297
296
|
},
|
|
298
297
|
{}
|
|
299
298
|
)
|
|
300
299
|
};
|
|
301
300
|
}).sort(
|
|
302
|
-
(p,
|
|
303
|
-
),
|
|
304
|
-
(p,
|
|
301
|
+
(p, x) => (c.get(p.recordId) ?? 1 / 0) - (c.get(x.recordId) ?? 1 / 0)
|
|
302
|
+
), A = m.reduce(
|
|
303
|
+
(p, x) => p + x.totalCount,
|
|
305
304
|
0
|
|
306
305
|
);
|
|
307
|
-
return { facets: [], items: y, totalCount:
|
|
306
|
+
return { facets: [], items: y, totalCount: A };
|
|
308
307
|
}
|
|
309
|
-
function
|
|
308
|
+
function _(t, e) {
|
|
310
309
|
const i = t[e];
|
|
311
|
-
return i == null ? "" : typeof i == "string" ? i : typeof i == "number" || typeof i == "boolean" ? String(i) :
|
|
310
|
+
return i == null ? "" : typeof i == "string" ? i : typeof i == "number" || typeof i == "boolean" ? String(i) : Qt(i) ? i.URI : "";
|
|
312
311
|
}
|
|
313
|
-
function
|
|
312
|
+
function Yt(t, e) {
|
|
314
313
|
const i = t[e];
|
|
315
|
-
if (!(i == null || !
|
|
314
|
+
if (!(i == null || !Qt(i)))
|
|
316
315
|
return typeof i.Width == "number" && i.Width > 0 ? i.Width : void 0;
|
|
317
316
|
}
|
|
318
|
-
async function
|
|
317
|
+
async function Fe({
|
|
319
318
|
countPerPage: t,
|
|
320
319
|
directParentFolderIdentifier: e,
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
token: S
|
|
320
|
+
extraFields: i,
|
|
321
|
+
getPermanentAssetsPaths: s,
|
|
322
|
+
isSiteBuilder: a,
|
|
323
|
+
limitedDocTypes: n,
|
|
324
|
+
pageNumber: o,
|
|
325
|
+
parentFolderIdentifier: l,
|
|
326
|
+
searchTerm: d,
|
|
327
|
+
securityByPassToken: m,
|
|
328
|
+
sortOrder: c,
|
|
329
|
+
token: y
|
|
332
330
|
}) {
|
|
333
|
-
if (!e && !
|
|
331
|
+
if (!e && !l)
|
|
334
332
|
return { facets: [], items: [], totalCount: 0 };
|
|
335
|
-
const
|
|
333
|
+
const A = (i?.filter((u) => u && typeof u == "string") ?? []).map((u) => u.replace("%20", " ")), p = {
|
|
336
334
|
directParentFolderIdentifier: e,
|
|
337
|
-
parentFolderIdentifier:
|
|
338
|
-
...
|
|
339
|
-
},
|
|
335
|
+
parentFolderIdentifier: l,
|
|
336
|
+
...n && n.length > 0 ? { docType: n } : {}
|
|
337
|
+
}, x = await Zt({
|
|
340
338
|
countPerPage: t,
|
|
341
339
|
fields: [
|
|
342
|
-
...
|
|
343
|
-
|
|
340
|
+
...A,
|
|
341
|
+
Xt,
|
|
344
342
|
gt,
|
|
345
343
|
ft,
|
|
346
344
|
mt,
|
|
347
345
|
ut,
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
346
|
+
Nt,
|
|
347
|
+
Dt,
|
|
348
|
+
rt,
|
|
351
349
|
xt,
|
|
352
350
|
yt,
|
|
353
351
|
St
|
|
354
352
|
],
|
|
355
|
-
getPermanentAssetsPaths:
|
|
356
|
-
isSiteBuilder:
|
|
357
|
-
pageNumber:
|
|
358
|
-
query:
|
|
359
|
-
securityByPassToken:
|
|
353
|
+
getPermanentAssetsPaths: s,
|
|
354
|
+
isSiteBuilder: a,
|
|
355
|
+
pageNumber: o,
|
|
356
|
+
query: p,
|
|
357
|
+
securityByPassToken: m,
|
|
360
358
|
sort: void 0,
|
|
361
|
-
token:
|
|
362
|
-
}),
|
|
363
|
-
let
|
|
364
|
-
|
|
365
|
-
const
|
|
359
|
+
token: y
|
|
360
|
+
}), b = x.items.map((u) => {
|
|
361
|
+
let w = _(u, rt), D = _(u, St);
|
|
362
|
+
w && !w.startsWith(".") && (w = "." + w), D === "" && (D = _(u, yt));
|
|
363
|
+
const F = _(u, xt);
|
|
366
364
|
return {
|
|
367
|
-
docSubType:
|
|
368
|
-
docType:
|
|
369
|
-
extension:
|
|
370
|
-
height:
|
|
371
|
-
id:
|
|
372
|
-
identifier:
|
|
373
|
-
name:
|
|
374
|
-
recordId:
|
|
375
|
-
size:
|
|
376
|
-
width:
|
|
377
|
-
...
|
|
378
|
-
(L,
|
|
379
|
-
L[
|
|
380
|
-
const
|
|
381
|
-
return
|
|
365
|
+
docSubType: _(u, Nt),
|
|
366
|
+
docType: _(u, ut) || "",
|
|
367
|
+
extension: w,
|
|
368
|
+
height: _(u, ft) || "0",
|
|
369
|
+
id: F,
|
|
370
|
+
identifier: _(u, Dt),
|
|
371
|
+
name: D,
|
|
372
|
+
recordId: F,
|
|
373
|
+
size: _(u, mt) || "0 MB",
|
|
374
|
+
width: _(u, gt) || "0",
|
|
375
|
+
...A.reduce(
|
|
376
|
+
(L, et) => {
|
|
377
|
+
L[et] = _(u, et);
|
|
378
|
+
const nt = Yt(u, et);
|
|
379
|
+
return nt !== void 0 && (L[`${et}${Ft}`] = String(nt)), L;
|
|
382
380
|
},
|
|
383
381
|
{}
|
|
384
382
|
)
|
|
@@ -386,11 +384,11 @@ async function ke({
|
|
|
386
384
|
});
|
|
387
385
|
return {
|
|
388
386
|
facets: [],
|
|
389
|
-
items:
|
|
390
|
-
totalCount:
|
|
387
|
+
items: b,
|
|
388
|
+
totalCount: x.totalCount
|
|
391
389
|
};
|
|
392
390
|
}
|
|
393
|
-
async function
|
|
391
|
+
async function _e({
|
|
394
392
|
autoCropMode: t,
|
|
395
393
|
cropHeight: e,
|
|
396
394
|
cropWidth: i,
|
|
@@ -398,7 +396,7 @@ async function Re({
|
|
|
398
396
|
useSession: a
|
|
399
397
|
}) {
|
|
400
398
|
try {
|
|
401
|
-
return (await
|
|
399
|
+
return (await E.request({
|
|
402
400
|
method: "GET",
|
|
403
401
|
params: {
|
|
404
402
|
AutoCropMode: t,
|
|
@@ -411,7 +409,7 @@ async function Re({
|
|
|
411
409
|
timeout: 3e5,
|
|
412
410
|
// 5 minutes
|
|
413
411
|
transformResponse: [
|
|
414
|
-
...Array.isArray(
|
|
412
|
+
...Array.isArray(E.defaults.transformResponse) ? E.defaults.transformResponse : [],
|
|
415
413
|
(o) => ({
|
|
416
414
|
height: o.cropHeight,
|
|
417
415
|
width: o.cropWidth,
|
|
@@ -419,13 +417,13 @@ async function Re({
|
|
|
419
417
|
y: o.cropY
|
|
420
418
|
})
|
|
421
419
|
],
|
|
422
|
-
url:
|
|
420
|
+
url: Ut.GET_CROP_ZONE_SUGGESTION
|
|
423
421
|
})).data;
|
|
424
422
|
} catch {
|
|
425
423
|
return null;
|
|
426
424
|
}
|
|
427
425
|
}
|
|
428
|
-
async function
|
|
426
|
+
async function Vi({
|
|
429
427
|
assetRecordId: t,
|
|
430
428
|
isSiteBuilder: e,
|
|
431
429
|
siteUrl: i,
|
|
@@ -433,7 +431,7 @@ async function qi({
|
|
|
433
431
|
useSession: a
|
|
434
432
|
}) {
|
|
435
433
|
try {
|
|
436
|
-
return (await
|
|
434
|
+
return (await E.request({
|
|
437
435
|
baseURL: i,
|
|
438
436
|
method: "GET",
|
|
439
437
|
params: {
|
|
@@ -443,7 +441,7 @@ async function qi({
|
|
|
443
441
|
},
|
|
444
442
|
responseType: "json",
|
|
445
443
|
transformResponse: [
|
|
446
|
-
...Array.isArray(
|
|
444
|
+
...Array.isArray(E.defaults.transformResponse) ? E.defaults.transformResponse : [],
|
|
447
445
|
(o) => !o || typeof o != "object" ? [] : o.proxies?.map((l) => ({
|
|
448
446
|
cdnName: l.cdnName,
|
|
449
447
|
extension: l.extension,
|
|
@@ -456,22 +454,22 @@ async function qi({
|
|
|
456
454
|
width: l.width
|
|
457
455
|
})) ?? []
|
|
458
456
|
],
|
|
459
|
-
url: e ?
|
|
457
|
+
url: e ? Bt.GET_AVAILABLE_PROXIES : se
|
|
460
458
|
})).data;
|
|
461
459
|
} catch {
|
|
462
460
|
return [];
|
|
463
461
|
}
|
|
464
462
|
}
|
|
465
|
-
async function
|
|
463
|
+
async function Gi({
|
|
466
464
|
siteUrl: t
|
|
467
465
|
} = {}) {
|
|
468
466
|
try {
|
|
469
|
-
return (await
|
|
467
|
+
return (await E.request({
|
|
470
468
|
baseURL: t,
|
|
471
469
|
method: "GET",
|
|
472
470
|
responseType: "json",
|
|
473
471
|
transformResponse: [
|
|
474
|
-
...Array.isArray(
|
|
472
|
+
...Array.isArray(E.defaults.transformResponse) ? E.defaults.transformResponse : [],
|
|
475
473
|
(i) => !i || typeof i != "object" ? {
|
|
476
474
|
formatsByDocType: {
|
|
477
475
|
Audio: {},
|
|
@@ -483,13 +481,13 @@ async function ji({
|
|
|
483
481
|
formatsByDocType: i.formatsByDocType ?? {}
|
|
484
482
|
}
|
|
485
483
|
],
|
|
486
|
-
url:
|
|
484
|
+
url: ee
|
|
487
485
|
})).data;
|
|
488
486
|
} catch {
|
|
489
487
|
return { formatsByDocType: {} };
|
|
490
488
|
}
|
|
491
489
|
}
|
|
492
|
-
async function
|
|
490
|
+
async function Qi({
|
|
493
491
|
recordIds: t,
|
|
494
492
|
rightsToCheck: e
|
|
495
493
|
}) {
|
|
@@ -500,23 +498,19 @@ async function Vi({
|
|
|
500
498
|
invalidObjects: []
|
|
501
499
|
};
|
|
502
500
|
try {
|
|
503
|
-
const { data: s } = await
|
|
501
|
+
const { data: s } = await E.request({
|
|
504
502
|
method: "GET",
|
|
505
503
|
params: { RecordIDs: t, RightsToCheck: e },
|
|
506
504
|
paramsSerializer: { indexes: null },
|
|
507
505
|
responseType: "json",
|
|
508
|
-
url:
|
|
506
|
+
url: ie.GET_AUTHORIZED_OBJECTS
|
|
509
507
|
});
|
|
510
508
|
return s;
|
|
511
509
|
} catch {
|
|
512
510
|
return i;
|
|
513
511
|
}
|
|
514
512
|
}
|
|
515
|
-
const
|
|
516
|
-
wt.Album,
|
|
517
|
-
wt.ProjectDocument,
|
|
518
|
-
wt.Story
|
|
519
|
-
], it = "TR1", At = "TRX", Pe = /* @__PURE__ */ new Set([".gif"]), Fe = /* @__PURE__ */ new Set([
|
|
513
|
+
const bt = 20, it = "TR1", At = "TRX", Me = /* @__PURE__ */ new Set([".gif"]), Ie = /* @__PURE__ */ new Set([
|
|
520
514
|
".avif",
|
|
521
515
|
".bmp",
|
|
522
516
|
".gif",
|
|
@@ -527,11 +521,11 @@ const kt = 20, $e = [
|
|
|
527
521
|
".svg",
|
|
528
522
|
".webp"
|
|
529
523
|
]);
|
|
530
|
-
function
|
|
524
|
+
function Jt(t) {
|
|
531
525
|
const e = t.toLowerCase(), i = e.startsWith(".") ? e : `.${e}`;
|
|
532
|
-
return
|
|
526
|
+
return Ie.has(i);
|
|
533
527
|
}
|
|
534
|
-
function
|
|
528
|
+
function Lt({
|
|
535
529
|
autoFormat: t,
|
|
536
530
|
extension: e,
|
|
537
531
|
format: i,
|
|
@@ -539,33 +533,40 @@ function Nt({
|
|
|
539
533
|
manualFormat: a,
|
|
540
534
|
size: n
|
|
541
535
|
}) {
|
|
542
|
-
const o = e?.toLowerCase() ?? "", l = o.startsWith(".") ? o : `.${o}`, d = `path_${it}`, m = (p,
|
|
543
|
-
const
|
|
544
|
-
if (
|
|
545
|
-
return
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
536
|
+
const o = e?.toLowerCase() ?? "", l = o.startsWith(".") ? o : `.${o}`, d = `path_${it}`, m = (p, x) => {
|
|
537
|
+
const b = s[p];
|
|
538
|
+
if (!b)
|
|
539
|
+
return;
|
|
540
|
+
const u = s[`${p}${Ft}`], w = t ? oe(b, {
|
|
541
|
+
extension: o,
|
|
542
|
+
format: x
|
|
543
|
+
}) : b;
|
|
544
|
+
return {
|
|
545
|
+
maxWidth: u,
|
|
546
|
+
src: w,
|
|
547
|
+
srcset: re(w, {
|
|
548
|
+
extension: o,
|
|
549
|
+
format: x,
|
|
550
|
+
maxWidth: ne(a, u)
|
|
551
|
+
})
|
|
552
|
+
};
|
|
552
553
|
};
|
|
553
554
|
if (!a) {
|
|
554
|
-
const p =
|
|
555
|
-
return m(
|
|
555
|
+
const p = jt(o, n), x = `path_${p}`;
|
|
556
|
+
return m(x, p) ?? m(d, it) ?? {};
|
|
556
557
|
}
|
|
557
|
-
if (!!o &&
|
|
558
|
+
if (!!o && Me.has(l))
|
|
558
559
|
return m(`path_${At}`, At) ?? m(d, it) ?? {};
|
|
559
|
-
const y = !o ||
|
|
560
|
-
return
|
|
560
|
+
const y = !o || Jt(o), A = i ? `path_${i}` : void 0;
|
|
561
|
+
return A && y && s[A] ? m(A, i) ?? {} : m(d, it) ?? {};
|
|
561
562
|
}
|
|
562
|
-
class
|
|
563
|
+
class Xi {
|
|
563
564
|
constructor(e, i) {
|
|
564
|
-
this.data = [], this.folderId = "", this.fetchedPages = /* @__PURE__ */ new Set(), this.totalCount = 0, this.maxEnd = 1 / 0, this.pageSize =
|
|
565
|
+
this.data = [], this.folderId = "", this.fetchedPages = /* @__PURE__ */ new Set(), this.totalCount = 0, this.maxEnd = 1 / 0, this.pageSize = bt, this.requestEpoch = 0, this.host = e, this.host.addController?.(this);
|
|
565
566
|
const s = i?.maxEnd;
|
|
566
567
|
this.maxEnd = typeof s == "number" && Number.isFinite(s) && s >= 0 ? Math.floor(s) : 1 / 0;
|
|
567
568
|
const a = i?.pageSize;
|
|
568
|
-
this.pageSize = typeof a == "number" && Number.isFinite(a) && a >= 1 ? Math.floor(a) :
|
|
569
|
+
this.pageSize = typeof a == "number" && Number.isFinite(a) && a >= 1 ? Math.floor(a) : bt, this.authToken = i?.token, this.securityByPassToken = i?.securityByPassToken, this.isSiteBuilder = i?.isSiteBuilder ?? !1, this.autoFormat = i?.autoFormat ?? !1;
|
|
569
570
|
}
|
|
570
571
|
get totalDataCount() {
|
|
571
572
|
return this.totalCount;
|
|
@@ -583,7 +584,7 @@ class Gi {
|
|
|
583
584
|
* Shrinking is ignored once pages are cached: collapsing already has what it needs.
|
|
584
585
|
*/
|
|
585
586
|
setPageSize(e) {
|
|
586
|
-
const i = Number.isFinite(e) && e >= 1 ? Math.floor(e) :
|
|
587
|
+
const i = Number.isFinite(e) && e >= 1 ? Math.floor(e) : bt;
|
|
587
588
|
if (this.pageSize === i)
|
|
588
589
|
return;
|
|
589
590
|
const s = this.fetchedPages.size > 0;
|
|
@@ -607,21 +608,21 @@ class Gi {
|
|
|
607
608
|
const d = s ? `path_${s}` : void 0, m = `path_${it}`, c = `path_${At}`, y = [
|
|
608
609
|
...new Set(
|
|
609
610
|
[d, m, c].filter(
|
|
610
|
-
(
|
|
611
|
+
(x) => !!x
|
|
611
612
|
)
|
|
612
613
|
)
|
|
613
|
-
],
|
|
614
|
-
for (let
|
|
615
|
-
if (this.fetchedPages.has(
|
|
614
|
+
], A = Math.floor(n / this.pageSize) + 1, p = Math.floor(e / this.pageSize) + 1;
|
|
615
|
+
for (let x = A; x <= p; x++) {
|
|
616
|
+
if (this.fetchedPages.has(x))
|
|
616
617
|
continue;
|
|
617
|
-
const
|
|
618
|
+
const b = await Fe({
|
|
618
619
|
countPerPage: this.pageSize,
|
|
619
620
|
directParentFolderIdentifier: this.folderId,
|
|
620
|
-
excludedDocTypes: $e,
|
|
621
621
|
extraFields: [...i, ...y],
|
|
622
622
|
getPermanentAssetsPaths: !0,
|
|
623
623
|
isSiteBuilder: this.isSiteBuilder,
|
|
624
|
-
|
|
624
|
+
limitedDocTypes: [ct.Image, ct.Audio, ct.Video, ct.Multimedia],
|
|
625
|
+
pageNumber: x,
|
|
625
626
|
searchTerm: "",
|
|
626
627
|
securityByPassToken: this.securityByPassToken,
|
|
627
628
|
sortOrder: "",
|
|
@@ -629,38 +630,43 @@ class Gi {
|
|
|
629
630
|
});
|
|
630
631
|
if (l !== this.requestEpoch)
|
|
631
632
|
return this.data;
|
|
632
|
-
if (this.fetchedPages.add(
|
|
633
|
-
const
|
|
634
|
-
this.totalCount =
|
|
633
|
+
if (this.fetchedPages.add(x), !this.totalCount && b.totalCount) {
|
|
634
|
+
const w = Math.min(this.maxEnd, b.totalCount);
|
|
635
|
+
this.totalCount = w, this.data = Array.from({ length: w }, () => ({
|
|
635
636
|
alt: "",
|
|
636
|
-
id: `temp-${
|
|
637
|
+
id: `temp-${le()}`,
|
|
637
638
|
name: "",
|
|
638
639
|
src: ""
|
|
639
640
|
}));
|
|
640
641
|
}
|
|
641
|
-
const
|
|
642
|
-
for (let
|
|
643
|
-
const
|
|
644
|
-
if (
|
|
645
|
-
const
|
|
642
|
+
const u = (x - 1) * this.pageSize;
|
|
643
|
+
for (let w = 0; w < b.items.length; w++) {
|
|
644
|
+
const D = u + w;
|
|
645
|
+
if (D < this.data.length) {
|
|
646
|
+
const F = b.items[w], {
|
|
647
|
+
maxWidth: L,
|
|
648
|
+
src: et,
|
|
649
|
+
srcset: nt
|
|
650
|
+
} = Lt({
|
|
646
651
|
autoFormat: this.autoFormat,
|
|
647
|
-
extension:
|
|
652
|
+
extension: F.extension,
|
|
648
653
|
format: s,
|
|
649
|
-
item:
|
|
654
|
+
item: F,
|
|
650
655
|
manualFormat: a,
|
|
651
|
-
size:
|
|
656
|
+
size: F.size
|
|
652
657
|
});
|
|
653
|
-
let
|
|
654
|
-
|
|
655
|
-
alt:
|
|
656
|
-
docType:
|
|
657
|
-
extension:
|
|
658
|
-
id:
|
|
659
|
-
maxWidth:
|
|
660
|
-
name:
|
|
661
|
-
src:
|
|
658
|
+
let ht = et, Mt = nt;
|
|
659
|
+
ht && o && o.length > 0 && (ht = Tt(ht, o), Mt = ""), this.data[D] = {
|
|
660
|
+
alt: F.name,
|
|
661
|
+
docType: F.docType,
|
|
662
|
+
extension: F.extension,
|
|
663
|
+
id: F.id,
|
|
664
|
+
maxWidth: L,
|
|
665
|
+
name: F.name,
|
|
666
|
+
src: ht,
|
|
667
|
+
srcset: Mt,
|
|
662
668
|
...i.reduce(
|
|
663
|
-
(
|
|
669
|
+
(It, Et) => (It[Et] = F[Et] ?? "", It),
|
|
664
670
|
{}
|
|
665
671
|
)
|
|
666
672
|
};
|
|
@@ -680,30 +686,30 @@ class Gi {
|
|
|
680
686
|
transformations: m
|
|
681
687
|
}) {
|
|
682
688
|
(!this.folderId || this.folderId !== s) && (this.folderId = s, this.resetFolderState()), a && this.resetPageCache();
|
|
683
|
-
const c = Math.max(5, l), y = e,
|
|
689
|
+
const c = Math.max(5, l), y = e, A = e + c, p = [
|
|
684
690
|
...i,
|
|
685
691
|
ft,
|
|
686
692
|
gt
|
|
687
693
|
];
|
|
688
694
|
await this.fetchImages({
|
|
689
|
-
end:
|
|
690
|
-
extraFields: p.filter((
|
|
695
|
+
end: A,
|
|
696
|
+
extraFields: p.filter((u) => u !== ""),
|
|
691
697
|
format: n,
|
|
692
698
|
manualFormat: o,
|
|
693
699
|
start: y,
|
|
694
700
|
transformations: m
|
|
695
701
|
});
|
|
696
|
-
let
|
|
697
|
-
|
|
698
|
-
const
|
|
702
|
+
let x = e - c;
|
|
703
|
+
x < 0 && (this.totalCount === 0 ? x = 0 : x = Math.max(0, this.totalCount + x));
|
|
704
|
+
const b = x + c;
|
|
699
705
|
return await this.fetchImages({
|
|
700
|
-
end:
|
|
701
|
-
extraFields: p.filter((
|
|
706
|
+
end: b,
|
|
707
|
+
extraFields: p.filter((u) => u !== ""),
|
|
702
708
|
format: n,
|
|
703
709
|
manualFormat: o,
|
|
704
|
-
start:
|
|
710
|
+
start: x,
|
|
705
711
|
transformations: m
|
|
706
|
-
}), d ? this.data.filter((
|
|
712
|
+
}), d ? this.data.filter((u) => u.id && !u.id.startsWith("temp-")) : this.data;
|
|
707
713
|
}
|
|
708
714
|
async fetchImagesByIDs({
|
|
709
715
|
extraFields: e = [],
|
|
@@ -720,13 +726,13 @@ class Gi {
|
|
|
720
726
|
(p) => !!p
|
|
721
727
|
)
|
|
722
728
|
)
|
|
723
|
-
], c = [
|
|
729
|
+
], c = [rt, mt], y = [
|
|
724
730
|
...e,
|
|
725
731
|
ut,
|
|
726
732
|
ft,
|
|
727
733
|
gt
|
|
728
734
|
];
|
|
729
|
-
return (await
|
|
735
|
+
return (await Pe({
|
|
730
736
|
extraFields: [...y, ...m, ...c].filter((p) => p !== ""),
|
|
731
737
|
getPermanentAssetsPaths: !0,
|
|
732
738
|
isSiteBuilder: this.isSiteBuilder,
|
|
@@ -734,25 +740,30 @@ class Gi {
|
|
|
734
740
|
securityByPassToken: this.securityByPassToken,
|
|
735
741
|
token: this.authToken
|
|
736
742
|
})).items.map((p) => {
|
|
737
|
-
const {
|
|
743
|
+
const {
|
|
744
|
+
maxWidth: x,
|
|
745
|
+
src: b,
|
|
746
|
+
srcset: u
|
|
747
|
+
} = Lt({
|
|
738
748
|
autoFormat: this.autoFormat,
|
|
739
|
-
extension: p[
|
|
749
|
+
extension: p[rt],
|
|
740
750
|
format: i,
|
|
741
751
|
item: p,
|
|
742
752
|
manualFormat: s,
|
|
743
753
|
size: p[mt]
|
|
744
754
|
});
|
|
745
|
-
let
|
|
746
|
-
return
|
|
755
|
+
let w = b, D = u;
|
|
756
|
+
return w && n && n.length > 0 && (w = Tt(w, n), D = ""), {
|
|
747
757
|
alt: p.name,
|
|
748
758
|
docType: p[ut],
|
|
749
|
-
extension: p[
|
|
759
|
+
extension: p[rt] || "",
|
|
750
760
|
id: p.recordId,
|
|
751
|
-
maxWidth:
|
|
761
|
+
maxWidth: x,
|
|
752
762
|
name: p.name,
|
|
753
|
-
src:
|
|
763
|
+
src: w,
|
|
764
|
+
srcset: D,
|
|
754
765
|
...y.reduce(
|
|
755
|
-
(F,
|
|
766
|
+
(F, L) => (F[L] = p[L] ?? "", F),
|
|
756
767
|
{}
|
|
757
768
|
)
|
|
758
769
|
};
|
|
@@ -778,7 +789,7 @@ class Gi {
|
|
|
778
789
|
manualFormat: n,
|
|
779
790
|
start: c,
|
|
780
791
|
transformations: m
|
|
781
|
-
}), o ? this.data.filter((
|
|
792
|
+
}), o ? this.data.filter((A) => A.id && !A.id.startsWith("temp-")) : this.data;
|
|
782
793
|
}
|
|
783
794
|
async *fetchImagesInFolderByChunk({
|
|
784
795
|
chunkSize: e = 10,
|
|
@@ -803,18 +814,18 @@ class Gi {
|
|
|
803
814
|
}), yield this.data;
|
|
804
815
|
return;
|
|
805
816
|
}
|
|
806
|
-
let y = d,
|
|
817
|
+
let y = d, A = d + c;
|
|
807
818
|
if (await this.fetchImages({
|
|
808
|
-
end:
|
|
819
|
+
end: A,
|
|
809
820
|
extraFields: s,
|
|
810
821
|
format: o,
|
|
811
822
|
manualFormat: l,
|
|
812
823
|
start: y,
|
|
813
824
|
transformations: m
|
|
814
|
-
}), yield this.data, !(!this.totalCount || this.totalCount <=
|
|
815
|
-
for (;
|
|
816
|
-
y =
|
|
817
|
-
end:
|
|
825
|
+
}), yield this.data, !(!this.totalCount || this.totalCount <= A))
|
|
826
|
+
for (; A < this.totalCount; )
|
|
827
|
+
y = A, A = Math.min(A + c, this.totalCount), await this.fetchImages({
|
|
828
|
+
end: A,
|
|
818
829
|
extraFields: s,
|
|
819
830
|
format: o,
|
|
820
831
|
manualFormat: l,
|
|
@@ -834,11 +845,11 @@ class Gi {
|
|
|
834
845
|
this.resetPageCache();
|
|
835
846
|
}
|
|
836
847
|
}
|
|
837
|
-
const
|
|
838
|
-
var
|
|
839
|
-
for (var a = s > 1 ? void 0 : s ?
|
|
848
|
+
const Ee = V`.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}`, Te = V`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}`;
|
|
849
|
+
var He = Object.defineProperty, We = Object.getOwnPropertyDescriptor, z = (t, e, i, s) => {
|
|
850
|
+
for (var a = s > 1 ? void 0 : s ? We(e, i) : e, n = t.length - 1, o; n >= 0; n--)
|
|
840
851
|
(o = t[n]) && (a = (s ? o(e, i, a) : o(a)) || a);
|
|
841
|
-
return s && a &&
|
|
852
|
+
return s && a && He(e, i, a), a;
|
|
842
853
|
};
|
|
843
854
|
let v = class extends j {
|
|
844
855
|
constructor() {
|
|
@@ -954,7 +965,7 @@ let v = class extends j {
|
|
|
954
965
|
const [s, a] = e.split(":").map(Number);
|
|
955
966
|
if (this.unit === r.Pixel) {
|
|
956
967
|
let n = s, o = a;
|
|
957
|
-
Number.isFinite(this.maxWidth) && Number.isFinite(this.maxHeight) && ({ height: o, width: n } =
|
|
968
|
+
Number.isFinite(this.maxWidth) && Number.isFinite(this.maxHeight) && ({ height: o, width: n } = pe(
|
|
958
969
|
this.maxWidth,
|
|
959
970
|
this.maxHeight,
|
|
960
971
|
s,
|
|
@@ -1072,20 +1083,20 @@ let v = class extends j {
|
|
|
1072
1083
|
}
|
|
1073
1084
|
render() {
|
|
1074
1085
|
const t = this.cropModes.filter((i) => !i.auto), e = this.cropModes.filter((i) => i.auto);
|
|
1075
|
-
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">${
|
|
1086
|
+
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">${M(
|
|
1076
1087
|
!this.noRatioModes,
|
|
1077
1088
|
() => C`<cx-select data-testid="cx-asset-link-format-crop-mode" value=${this.cropMode} hoist style=${O({
|
|
1078
1089
|
width: "100%"
|
|
1079
|
-
})} @cx-change=${this.onCropModeChange} ?disabled=${this.loading}>${
|
|
1090
|
+
})} @cx-change=${this.onCropModeChange} ?disabled=${this.loading}>${ot(
|
|
1080
1091
|
t,
|
|
1081
1092
|
(i) => i.value,
|
|
1082
1093
|
({ label: i, value: s }) => C`<cx-option value=${s}>${i}</cx-option>`
|
|
1083
1094
|
)}
|
|
1084
|
-
${
|
|
1095
|
+
${M(
|
|
1085
1096
|
e.length > 0,
|
|
1086
1097
|
() => C`<cx-divider></cx-divider><small>${this.localize.term("autoCropping")}</small>`
|
|
1087
1098
|
)}
|
|
1088
|
-
${
|
|
1099
|
+
${ot(
|
|
1089
1100
|
e,
|
|
1090
1101
|
(i) => i.value,
|
|
1091
1102
|
({ label: i, value: s }) => C`<cx-option value=${s}>${i}</cx-option>`
|
|
@@ -1096,20 +1107,20 @@ let v = class extends j {
|
|
|
1096
1107
|
color: this.keepAspectRatio ? "var(--cx-color-primary)" : void 0
|
|
1097
1108
|
})} ?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">
|
|
1098
1109
|
H
|
|
1099
|
-
</cx-typography></cx-input></div>${
|
|
1110
|
+
</cx-typography></cx-input></div>${M(
|
|
1100
1111
|
!this.noRatioModes,
|
|
1101
1112
|
() => 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>`
|
|
1102
|
-
)}</cx-space>${
|
|
1113
|
+
)}</cx-space>${M(
|
|
1103
1114
|
this.focusModes.length > 0,
|
|
1104
1115
|
() => C`<cx-select data-testid="cx-asset-link-format-crop-focus-mode" value=${this.focusMode} hoist style=${O({
|
|
1105
1116
|
width: "100%"
|
|
1106
|
-
})} @cx-change=${this.onFocusModeChange} ?disabled=${this.loading || this.selectedMode?.disabledSize}>${
|
|
1117
|
+
})} @cx-change=${this.onFocusModeChange} ?disabled=${this.loading || this.selectedMode?.disabledSize}>${ot(
|
|
1107
1118
|
this.focusModes,
|
|
1108
1119
|
(i) => i.value,
|
|
1109
1120
|
({ label: i, value: s }) => C`<cx-option value=${s}>${i}</cx-option>`
|
|
1110
1121
|
)}</cx-select>`
|
|
1111
1122
|
)}
|
|
1112
|
-
${
|
|
1123
|
+
${M(
|
|
1113
1124
|
this.showPositionPicker && this.focusMode === "manual",
|
|
1114
1125
|
() => C`<cx-position-picker data-testid="cx-asset-link-format-crop-position" value=${this.position} @cx-change=${this.onPositionChange}></cx-position-picker>`
|
|
1115
1126
|
)}<cx-button data-testid="cx-asset-link-format-crop-apply" variant="primary" ?disabled=${this.disabledApply || this.invalidHeight || this.invalidWidth} ?loading=${this.loading} style=${O({
|
|
@@ -1117,25 +1128,25 @@ let v = class extends j {
|
|
|
1117
1128
|
})} @click=${this.handleApply}>${this.localize.term("apply")}</cx-button></cx-space></cx-details>`;
|
|
1118
1129
|
}
|
|
1119
1130
|
};
|
|
1120
|
-
v.styles = [Q,
|
|
1131
|
+
v.styles = [Q, Te];
|
|
1121
1132
|
v.dependencies = {
|
|
1122
|
-
"cx-button":
|
|
1133
|
+
"cx-button": Y,
|
|
1123
1134
|
"cx-details": st,
|
|
1124
|
-
"cx-divider":
|
|
1135
|
+
"cx-divider": Vt,
|
|
1125
1136
|
"cx-icon": at,
|
|
1126
|
-
"cx-icon-button":
|
|
1127
|
-
"cx-input":
|
|
1137
|
+
"cx-icon-button": $t,
|
|
1138
|
+
"cx-input": Pt,
|
|
1128
1139
|
"cx-option": vt,
|
|
1129
|
-
"cx-position-picker":
|
|
1140
|
+
"cx-position-picker": ce,
|
|
1130
1141
|
"cx-select": zt,
|
|
1131
1142
|
"cx-space": B,
|
|
1132
1143
|
"cx-typography": q
|
|
1133
1144
|
};
|
|
1134
1145
|
z([
|
|
1135
|
-
|
|
1146
|
+
J(".details")
|
|
1136
1147
|
], v.prototype, "base", 2);
|
|
1137
1148
|
z([
|
|
1138
|
-
|
|
1149
|
+
J("cx-position-picker")
|
|
1139
1150
|
], v.prototype, "positionPicker", 2);
|
|
1140
1151
|
z([
|
|
1141
1152
|
h({ reflect: !0, type: Boolean })
|
|
@@ -1221,13 +1232,13 @@ z([
|
|
|
1221
1232
|
v = z([
|
|
1222
1233
|
X("cx-asset-link-format-crop")
|
|
1223
1234
|
], v);
|
|
1224
|
-
const
|
|
1225
|
-
var
|
|
1226
|
-
for (var a = s > 1 ? void 0 : s ?
|
|
1235
|
+
const De = V`.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%}}`;
|
|
1236
|
+
var Ne = Object.defineProperty, Oe = Object.getOwnPropertyDescriptor, _t = (t, e, i, s) => {
|
|
1237
|
+
for (var a = s > 1 ? void 0 : s ? Oe(e, i) : e, n = t.length - 1, o; n >= 0; n--)
|
|
1227
1238
|
(o = t[n]) && (a = (s ? o(e, i, a) : o(a)) || a);
|
|
1228
|
-
return s && a &&
|
|
1239
|
+
return s && a && Ne(e, i, a), a;
|
|
1229
1240
|
};
|
|
1230
|
-
let
|
|
1241
|
+
let Z = class extends j {
|
|
1231
1242
|
constructor() {
|
|
1232
1243
|
super(...arguments), this.localize = new G(this), this.value = "", this.items = [];
|
|
1233
1244
|
}
|
|
@@ -1238,37 +1249,37 @@ let Y = class extends j {
|
|
|
1238
1249
|
});
|
|
1239
1250
|
}
|
|
1240
1251
|
render() {
|
|
1241
|
-
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}>${
|
|
1252
|
+
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(
|
|
1242
1253
|
this.items,
|
|
1243
1254
|
(t) => t.value,
|
|
1244
1255
|
(t) => C`<cx-option value=${t.value}>${t.displayName}</cx-option>`
|
|
1245
1256
|
)}</cx-select></cx-space>`;
|
|
1246
1257
|
}
|
|
1247
1258
|
};
|
|
1248
|
-
|
|
1249
|
-
|
|
1259
|
+
Z.styles = [Q, De];
|
|
1260
|
+
Z.dependencies = {
|
|
1250
1261
|
"cx-option": vt,
|
|
1251
1262
|
"cx-select": zt,
|
|
1252
1263
|
"cx-space": B,
|
|
1253
1264
|
"cx-typography": q
|
|
1254
1265
|
};
|
|
1255
|
-
|
|
1266
|
+
_t([
|
|
1256
1267
|
h({ reflect: !0, type: String })
|
|
1257
|
-
],
|
|
1258
|
-
|
|
1268
|
+
], Z.prototype, "value", 2);
|
|
1269
|
+
_t([
|
|
1259
1270
|
h({ reflect: !1, type: Array })
|
|
1260
|
-
],
|
|
1261
|
-
|
|
1271
|
+
], Z.prototype, "items", 2);
|
|
1272
|
+
Z = _t([
|
|
1262
1273
|
X("cx-asset-link-format-extension")
|
|
1263
|
-
],
|
|
1264
|
-
const
|
|
1265
|
-
var
|
|
1266
|
-
for (var a = s > 1 ? void 0 : s ?
|
|
1274
|
+
], Z);
|
|
1275
|
+
const Le = V`cx-details::part(base){border-bottom-width:0}`;
|
|
1276
|
+
var Ue = Object.defineProperty, Be = Object.getOwnPropertyDescriptor, W = (t, e, i, s) => {
|
|
1277
|
+
for (var a = s > 1 ? void 0 : s ? Be(e, i) : e, n = t.length - 1, o; n >= 0; n--)
|
|
1267
1278
|
(o = t[n]) && (a = (s ? o(e, i, a) : o(a)) || a);
|
|
1268
|
-
return s && a &&
|
|
1279
|
+
return s && a && Ue(e, i, a), a;
|
|
1269
1280
|
};
|
|
1270
|
-
const
|
|
1271
|
-
let
|
|
1281
|
+
const kt = "auto";
|
|
1282
|
+
let I = class extends j {
|
|
1272
1283
|
constructor() {
|
|
1273
1284
|
super(...arguments), this.localize = new G(this), this.open = !1, this.value = "", this.items = [], this.canAutoFormat = !1, this.autoFormat = !1, this.loading = !1, this.scopedValue = "";
|
|
1274
1285
|
}
|
|
@@ -1277,7 +1288,7 @@ let E = class extends j {
|
|
|
1277
1288
|
* active, otherwise the resolved proxy id.
|
|
1278
1289
|
*/
|
|
1279
1290
|
get committedValue() {
|
|
1280
|
-
return this.autoFormat ?
|
|
1291
|
+
return this.autoFormat ? kt : this.value;
|
|
1281
1292
|
}
|
|
1282
1293
|
handleValueChange() {
|
|
1283
1294
|
this.scopedValue = this.committedValue;
|
|
@@ -1297,7 +1308,7 @@ let E = class extends j {
|
|
|
1297
1308
|
handleApply() {
|
|
1298
1309
|
if (this.loading)
|
|
1299
1310
|
return;
|
|
1300
|
-
if (this.scopedValue ===
|
|
1311
|
+
if (this.scopedValue === kt) {
|
|
1301
1312
|
this.emit("cx-asset-link-format-proxy-change", {
|
|
1302
1313
|
detail: { autoFormat: !0 }
|
|
1303
1314
|
});
|
|
@@ -1327,72 +1338,72 @@ let E = class extends j {
|
|
|
1327
1338
|
t.target !== this.base && t.stopPropagation();
|
|
1328
1339
|
}
|
|
1329
1340
|
render() {
|
|
1330
|
-
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}>${
|
|
1341
|
+
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(
|
|
1331
1342
|
this.items,
|
|
1332
1343
|
(t) => t.id,
|
|
1333
1344
|
(t) => C`<cx-option value=${t.id}>${t.proxyLabel}</cx-option>`
|
|
1334
1345
|
)}
|
|
1335
|
-
${
|
|
1346
|
+
${M(
|
|
1336
1347
|
this.canAutoFormat,
|
|
1337
|
-
() => C`<cx-divider></cx-divider><cx-option data-testid="cx-asset-link-format-proxy-auto-option" value=${
|
|
1338
|
-
() =>
|
|
1348
|
+
() => C`<cx-divider></cx-divider><cx-option data-testid="cx-asset-link-format-proxy-auto-option" value=${kt}>${this.localize.term("auto")}</cx-option>`,
|
|
1349
|
+
() => qt
|
|
1339
1350
|
)}</cx-select><cx-button data-testid="cx-asset-link-format-proxy-apply" variant="primary" style=${O({
|
|
1340
1351
|
"margin-left": "auto"
|
|
1341
1352
|
})} ?disabled=${this.scopedValue === this.committedValue} ?loading=${this.loading} @click=${this.handleApply}>${this.localize.term("apply")}</cx-button></cx-space></cx-details>`;
|
|
1342
1353
|
}
|
|
1343
1354
|
};
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
"cx-button":
|
|
1355
|
+
I.styles = [Q, Le];
|
|
1356
|
+
I.dependencies = {
|
|
1357
|
+
"cx-button": Y,
|
|
1347
1358
|
"cx-details": st,
|
|
1348
|
-
"cx-divider":
|
|
1359
|
+
"cx-divider": Vt,
|
|
1349
1360
|
"cx-icon": at,
|
|
1350
1361
|
"cx-option": vt,
|
|
1351
1362
|
"cx-select": zt,
|
|
1352
1363
|
"cx-space": B,
|
|
1353
1364
|
"cx-typography": q
|
|
1354
1365
|
};
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
],
|
|
1358
|
-
|
|
1366
|
+
W([
|
|
1367
|
+
J(".details")
|
|
1368
|
+
], I.prototype, "base", 2);
|
|
1369
|
+
W([
|
|
1359
1370
|
h({ reflect: !0, type: Boolean })
|
|
1360
|
-
],
|
|
1361
|
-
|
|
1371
|
+
], I.prototype, "open", 2);
|
|
1372
|
+
W([
|
|
1362
1373
|
h({ reflect: !0, type: String })
|
|
1363
|
-
],
|
|
1364
|
-
|
|
1374
|
+
], I.prototype, "value", 2);
|
|
1375
|
+
W([
|
|
1365
1376
|
h({ reflect: !1, type: Array })
|
|
1366
|
-
],
|
|
1367
|
-
|
|
1377
|
+
], I.prototype, "items", 2);
|
|
1378
|
+
W([
|
|
1368
1379
|
h({ attribute: "can-auto-format", reflect: !0, type: Boolean })
|
|
1369
|
-
],
|
|
1370
|
-
|
|
1380
|
+
], I.prototype, "canAutoFormat", 2);
|
|
1381
|
+
W([
|
|
1371
1382
|
h({ attribute: "auto-format", reflect: !0, type: Boolean })
|
|
1372
|
-
],
|
|
1373
|
-
|
|
1383
|
+
], I.prototype, "autoFormat", 2);
|
|
1384
|
+
W([
|
|
1374
1385
|
h({ reflect: !0, type: Boolean })
|
|
1375
|
-
],
|
|
1376
|
-
|
|
1386
|
+
], I.prototype, "loading", 2);
|
|
1387
|
+
W([
|
|
1377
1388
|
R()
|
|
1378
|
-
],
|
|
1379
|
-
|
|
1389
|
+
], I.prototype, "scopedValue", 2);
|
|
1390
|
+
W([
|
|
1380
1391
|
P("autoFormat"),
|
|
1381
1392
|
P("value")
|
|
1382
|
-
],
|
|
1383
|
-
|
|
1393
|
+
], I.prototype, "handleValueChange", 1);
|
|
1394
|
+
W([
|
|
1384
1395
|
P("open", { waitUntilFirstUpdate: !0 })
|
|
1385
|
-
],
|
|
1386
|
-
|
|
1396
|
+
], I.prototype, "handleOpenChange", 1);
|
|
1397
|
+
I = W([
|
|
1387
1398
|
X("cx-asset-link-format-proxy")
|
|
1388
|
-
],
|
|
1389
|
-
const
|
|
1390
|
-
var
|
|
1391
|
-
for (var a = s > 1 ? void 0 : s ?
|
|
1399
|
+
], I);
|
|
1400
|
+
const qe = V`cx-details::part(base){border-bottom-width:0}`;
|
|
1401
|
+
var je = Object.defineProperty, Ve = Object.getOwnPropertyDescriptor, tt = (t, e, i, s) => {
|
|
1402
|
+
for (var a = s > 1 ? void 0 : s ? Ve(e, i) : e, n = t.length - 1, o; n >= 0; n--)
|
|
1392
1403
|
(o = t[n]) && (a = (s ? o(e, i, a) : o(a)) || a);
|
|
1393
|
-
return s && a &&
|
|
1404
|
+
return s && a && je(e, i, a), a;
|
|
1394
1405
|
};
|
|
1395
|
-
let
|
|
1406
|
+
let H = class extends j {
|
|
1396
1407
|
constructor() {
|
|
1397
1408
|
super(...arguments), this.localize = new G(this), this.open = !1, this.value = 100, this.loading = !1, this.scopedValue = 100;
|
|
1398
1409
|
}
|
|
@@ -1443,42 +1454,42 @@ let W = class extends j {
|
|
|
1443
1454
|
})} @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>`;
|
|
1444
1455
|
}
|
|
1445
1456
|
};
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
"cx-button":
|
|
1457
|
+
H.styles = [Q, qe];
|
|
1458
|
+
H.dependencies = {
|
|
1459
|
+
"cx-button": Y,
|
|
1449
1460
|
"cx-details": st,
|
|
1450
1461
|
"cx-icon": at,
|
|
1451
|
-
"cx-input":
|
|
1462
|
+
"cx-input": Pt,
|
|
1452
1463
|
"cx-space": B,
|
|
1453
|
-
"cx-tooltip":
|
|
1464
|
+
"cx-tooltip": Gt,
|
|
1454
1465
|
"cx-typography": q
|
|
1455
1466
|
};
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
],
|
|
1459
|
-
|
|
1467
|
+
tt([
|
|
1468
|
+
J(".details")
|
|
1469
|
+
], H.prototype, "base", 2);
|
|
1470
|
+
tt([
|
|
1460
1471
|
h({ reflect: !0, type: Boolean })
|
|
1461
|
-
],
|
|
1462
|
-
|
|
1472
|
+
], H.prototype, "open", 2);
|
|
1473
|
+
tt([
|
|
1463
1474
|
h({ reflect: !0, type: Number })
|
|
1464
|
-
],
|
|
1465
|
-
|
|
1475
|
+
], H.prototype, "value", 2);
|
|
1476
|
+
tt([
|
|
1466
1477
|
h({ reflect: !0, type: Boolean })
|
|
1467
|
-
],
|
|
1468
|
-
|
|
1478
|
+
], H.prototype, "loading", 2);
|
|
1479
|
+
tt([
|
|
1469
1480
|
R()
|
|
1470
|
-
],
|
|
1471
|
-
|
|
1481
|
+
], H.prototype, "scopedValue", 2);
|
|
1482
|
+
tt([
|
|
1472
1483
|
P("value")
|
|
1473
|
-
],
|
|
1474
|
-
|
|
1484
|
+
], H.prototype, "handleValueChange", 1);
|
|
1485
|
+
H = tt([
|
|
1475
1486
|
X("cx-asset-link-format-quality")
|
|
1476
|
-
],
|
|
1477
|
-
const
|
|
1478
|
-
var
|
|
1479
|
-
for (var a = s > 1 ? void 0 : s ?
|
|
1487
|
+
], H);
|
|
1488
|
+
const Ge = V`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}`;
|
|
1489
|
+
var Qe = Object.defineProperty, Xe = Object.getOwnPropertyDescriptor, $ = (t, e, i, s) => {
|
|
1490
|
+
for (var a = s > 1 ? void 0 : s ? Xe(e, i) : e, n = t.length - 1, o; n >= 0; n--)
|
|
1480
1491
|
(o = t[n]) && (a = (s ? o(e, i, a) : o(a)) || a);
|
|
1481
|
-
return s && a &&
|
|
1492
|
+
return s && a && Qe(e, i, a), a;
|
|
1482
1493
|
};
|
|
1483
1494
|
let k = class extends j {
|
|
1484
1495
|
constructor() {
|
|
@@ -1627,7 +1638,7 @@ let k = class extends j {
|
|
|
1627
1638
|
color: this.keepAspectRatio ? "var(--cx-color-primary)" : void 0
|
|
1628
1639
|
})} ?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">
|
|
1629
1640
|
H
|
|
1630
|
-
</cx-typography></cx-input></div>${
|
|
1641
|
+
</cx-typography></cx-input></div>${M(
|
|
1631
1642
|
!this.noRatioModes,
|
|
1632
1643
|
() => 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>`
|
|
1633
1644
|
)}</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({
|
|
@@ -1635,20 +1646,20 @@ let k = class extends j {
|
|
|
1635
1646
|
})} @click=${this.handleApply}>${this.localize.term("apply")}</cx-button></cx-space></cx-details>`;
|
|
1636
1647
|
}
|
|
1637
1648
|
};
|
|
1638
|
-
k.styles = [Q,
|
|
1649
|
+
k.styles = [Q, Ge];
|
|
1639
1650
|
k.dependencies = {
|
|
1640
|
-
"cx-button":
|
|
1651
|
+
"cx-button": Y,
|
|
1641
1652
|
"cx-details": st,
|
|
1642
1653
|
"cx-icon": at,
|
|
1643
|
-
"cx-icon-button":
|
|
1644
|
-
"cx-input":
|
|
1654
|
+
"cx-icon-button": $t,
|
|
1655
|
+
"cx-input": Pt,
|
|
1645
1656
|
"cx-option": vt,
|
|
1646
1657
|
"cx-select": zt,
|
|
1647
1658
|
"cx-space": B,
|
|
1648
1659
|
"cx-typography": q
|
|
1649
1660
|
};
|
|
1650
1661
|
$([
|
|
1651
|
-
|
|
1662
|
+
J(".details")
|
|
1652
1663
|
], k.prototype, "base", 2);
|
|
1653
1664
|
$([
|
|
1654
1665
|
h({ reflect: !0, type: Boolean })
|
|
@@ -1707,13 +1718,13 @@ $([
|
|
|
1707
1718
|
k = $([
|
|
1708
1719
|
X("cx-asset-link-format-resize")
|
|
1709
1720
|
], k);
|
|
1710
|
-
const
|
|
1711
|
-
var
|
|
1712
|
-
for (var a = s > 1 ? void 0 : s ?
|
|
1721
|
+
const Ke = V`cx-details::part(base){border-bottom-width:0}`;
|
|
1722
|
+
var Ze = Object.defineProperty, Ye = Object.getOwnPropertyDescriptor, K = (t, e, i, s) => {
|
|
1723
|
+
for (var a = s > 1 ? void 0 : s ? Ye(e, i) : e, n = t.length - 1, o; n >= 0; n--)
|
|
1713
1724
|
(o = t[n]) && (a = (s ? o(e, i, a) : o(a)) || a);
|
|
1714
|
-
return s && a &&
|
|
1725
|
+
return s && a && Ze(e, i, a), a;
|
|
1715
1726
|
};
|
|
1716
|
-
let
|
|
1727
|
+
let T = class extends j {
|
|
1717
1728
|
constructor() {
|
|
1718
1729
|
super(...arguments), this.localize = new G(this), this.open = !1, this.value = 0, this.defaultValue = 0, this.loading = !1, this.lastAppliedValue = 0;
|
|
1719
1730
|
}
|
|
@@ -1726,14 +1737,14 @@ let H = class extends j {
|
|
|
1726
1737
|
const e = t.target.value, i = Number(e);
|
|
1727
1738
|
if (Number.isNaN(i))
|
|
1728
1739
|
return;
|
|
1729
|
-
const s =
|
|
1740
|
+
const s = Ht(i);
|
|
1730
1741
|
(i > 360 || i < -360) && (t.target.value = s.toString()), this.emit("cx-asset-link-format-rotation-change", {
|
|
1731
1742
|
detail: s
|
|
1732
1743
|
});
|
|
1733
1744
|
}
|
|
1734
1745
|
handleButtonClick(t) {
|
|
1735
1746
|
this.emit("cx-asset-link-format-rotation-change", {
|
|
1736
|
-
detail:
|
|
1747
|
+
detail: Ht(t)
|
|
1737
1748
|
});
|
|
1738
1749
|
}
|
|
1739
1750
|
handleClockwiseClick() {
|
|
@@ -1759,45 +1770,45 @@ let H = class extends j {
|
|
|
1759
1770
|
})} @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>`;
|
|
1760
1771
|
}
|
|
1761
1772
|
};
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
"cx-button":
|
|
1765
|
-
"cx-button-group":
|
|
1773
|
+
T.styles = [Q, Ke];
|
|
1774
|
+
T.dependencies = {
|
|
1775
|
+
"cx-button": Y,
|
|
1776
|
+
"cx-button-group": de,
|
|
1766
1777
|
"cx-details": st,
|
|
1767
1778
|
"cx-icon": at,
|
|
1768
|
-
"cx-icon-button":
|
|
1779
|
+
"cx-icon-button": $t,
|
|
1769
1780
|
"cx-space": B,
|
|
1770
1781
|
"cx-typography": q
|
|
1771
1782
|
};
|
|
1772
1783
|
K([
|
|
1773
|
-
|
|
1774
|
-
],
|
|
1784
|
+
J(".details")
|
|
1785
|
+
], T.prototype, "base", 2);
|
|
1775
1786
|
K([
|
|
1776
1787
|
h({ reflect: !0, type: Boolean })
|
|
1777
|
-
],
|
|
1788
|
+
], T.prototype, "open", 2);
|
|
1778
1789
|
K([
|
|
1779
1790
|
h({ reflect: !0, type: Number })
|
|
1780
|
-
],
|
|
1791
|
+
], T.prototype, "value", 2);
|
|
1781
1792
|
K([
|
|
1782
1793
|
h({ attribute: "default-value", reflect: !0, type: Number })
|
|
1783
|
-
],
|
|
1794
|
+
], T.prototype, "defaultValue", 2);
|
|
1784
1795
|
K([
|
|
1785
1796
|
h({ reflect: !0, type: Boolean })
|
|
1786
|
-
],
|
|
1797
|
+
], T.prototype, "loading", 2);
|
|
1787
1798
|
K([
|
|
1788
1799
|
h({ attribute: "last-applied-value", reflect: !0, type: Number })
|
|
1789
|
-
],
|
|
1800
|
+
], T.prototype, "lastAppliedValue", 2);
|
|
1790
1801
|
K([
|
|
1791
1802
|
P("open", { waitUntilFirstUpdate: !0 })
|
|
1792
|
-
],
|
|
1793
|
-
|
|
1803
|
+
], T.prototype, "handleOpenChange", 1);
|
|
1804
|
+
T = K([
|
|
1794
1805
|
X("cx-asset-link-format-rotation")
|
|
1795
|
-
],
|
|
1796
|
-
const
|
|
1797
|
-
var
|
|
1798
|
-
for (var a = s > 1 ? void 0 : s ?
|
|
1806
|
+
], T);
|
|
1807
|
+
const Je = V`cx-details::part(base){border-bottom-width:0}`;
|
|
1808
|
+
var ti = Object.defineProperty, ei = Object.getOwnPropertyDescriptor, Ct = (t, e, i, s) => {
|
|
1809
|
+
for (var a = s > 1 ? void 0 : s ? ei(e, i) : e, n = t.length - 1, o; n >= 0; n--)
|
|
1799
1810
|
(o = t[n]) && (a = (s ? o(e, i, a) : o(a)) || a);
|
|
1800
|
-
return s && a &&
|
|
1811
|
+
return s && a && ti(e, i, a), a;
|
|
1801
1812
|
};
|
|
1802
1813
|
let U = class extends j {
|
|
1803
1814
|
constructor() {
|
|
@@ -1828,18 +1839,18 @@ let U = class extends j {
|
|
|
1828
1839
|
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>`;
|
|
1829
1840
|
}
|
|
1830
1841
|
};
|
|
1831
|
-
U.styles = [Q,
|
|
1842
|
+
U.styles = [Q, Je];
|
|
1832
1843
|
U.dependencies = {
|
|
1833
|
-
"cx-button":
|
|
1834
|
-
"cx-checkbox":
|
|
1844
|
+
"cx-button": Y,
|
|
1845
|
+
"cx-checkbox": ue,
|
|
1835
1846
|
"cx-details": st,
|
|
1836
1847
|
"cx-icon": at,
|
|
1837
1848
|
"cx-space": B,
|
|
1838
|
-
"cx-tooltip":
|
|
1849
|
+
"cx-tooltip": Gt,
|
|
1839
1850
|
"cx-typography": q
|
|
1840
1851
|
};
|
|
1841
1852
|
Ct([
|
|
1842
|
-
|
|
1853
|
+
J(".details")
|
|
1843
1854
|
], U.prototype, "base", 2);
|
|
1844
1855
|
Ct([
|
|
1845
1856
|
h({ reflect: !0, type: Boolean })
|
|
@@ -1850,12 +1861,12 @@ Ct([
|
|
|
1850
1861
|
U = Ct([
|
|
1851
1862
|
X("cx-asset-link-format-metadata")
|
|
1852
1863
|
], U);
|
|
1853
|
-
var
|
|
1854
|
-
for (var a = s > 1 ? void 0 : s ?
|
|
1864
|
+
var ii = Object.defineProperty, si = Object.getOwnPropertyDescriptor, S = (t, e, i, s) => {
|
|
1865
|
+
for (var a = s > 1 ? void 0 : s ? si(e, i) : e, n = t.length - 1, o; n >= 0; n--)
|
|
1855
1866
|
(o = t[n]) && (a = (s ? o(e, i, a) : o(a)) || a);
|
|
1856
|
-
return s && a &&
|
|
1867
|
+
return s && a && ii(e, i, a), a;
|
|
1857
1868
|
};
|
|
1858
|
-
let
|
|
1869
|
+
let f = class extends j {
|
|
1859
1870
|
constructor() {
|
|
1860
1871
|
super(), this.localize = new G(this), this.baseUrl = void 0, this.token = void 0, this.asset = void 0, this.cropModes = [
|
|
1861
1872
|
{
|
|
@@ -1953,7 +1964,7 @@ let u = class extends j {
|
|
|
1953
1964
|
}, this.rotation = 0, this.defaultSize = {
|
|
1954
1965
|
height: 0,
|
|
1955
1966
|
width: 0
|
|
1956
|
-
}, 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 =
|
|
1967
|
+
}, 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 = ke, this.apiGetCropFocusMode = _e, this.onCropComplete = this.onCropComplete.bind(this), this.onCropDragStart = this.onCropDragStart.bind(this);
|
|
1957
1968
|
}
|
|
1958
1969
|
/**
|
|
1959
1970
|
* Transform requests must resolve to a web-displayable image (the browser renders the
|
|
@@ -1962,7 +1973,7 @@ let u = class extends j {
|
|
|
1962
1973
|
* extension fallback in asset-transformation-dialog.
|
|
1963
1974
|
*/
|
|
1964
1975
|
static getTransformExtension(t) {
|
|
1965
|
-
return !t ||
|
|
1976
|
+
return !t || Jt(t) ? t : "jpg";
|
|
1966
1977
|
}
|
|
1967
1978
|
/** True when there are transformations beyond the frozen index (i.e. user has added new ones). */
|
|
1968
1979
|
get hasUnfrozenTransformations() {
|
|
@@ -1975,7 +1986,7 @@ let u = class extends j {
|
|
|
1975
1986
|
*/
|
|
1976
1987
|
get lastAppliedCropUnit() {
|
|
1977
1988
|
return this.transformations.findLast(
|
|
1978
|
-
(e) => e.key ===
|
|
1989
|
+
(e) => e.key === g.Crop
|
|
1979
1990
|
)?.value.unit ?? r.Pixel;
|
|
1980
1991
|
}
|
|
1981
1992
|
/**
|
|
@@ -1985,7 +1996,7 @@ let u = class extends j {
|
|
|
1985
1996
|
*/
|
|
1986
1997
|
get lastAppliedCropFocusMode() {
|
|
1987
1998
|
return this.transformations.findLast(
|
|
1988
|
-
(e) => e.key ===
|
|
1999
|
+
(e) => e.key === g.Crop
|
|
1989
2000
|
)?.value.focusMode ?? "manual";
|
|
1990
2001
|
}
|
|
1991
2002
|
/**
|
|
@@ -1995,7 +2006,7 @@ let u = class extends j {
|
|
|
1995
2006
|
*/
|
|
1996
2007
|
get lastAppliedCropPosition() {
|
|
1997
2008
|
return this.transformations.findLast(
|
|
1998
|
-
(e) => e.key ===
|
|
2009
|
+
(e) => e.key === g.Crop
|
|
1999
2010
|
)?.value.position ?? N.CenterCenter;
|
|
2000
2011
|
}
|
|
2001
2012
|
/**
|
|
@@ -2047,7 +2058,7 @@ let u = class extends j {
|
|
|
2047
2058
|
get lastCropSize() {
|
|
2048
2059
|
if (!this.asset) {
|
|
2049
2060
|
const e = this.transformations.findLast(
|
|
2050
|
-
(i) => i.key ===
|
|
2061
|
+
(i) => i.key === g.Crop
|
|
2051
2062
|
);
|
|
2052
2063
|
if (e?.value.unit === r.AspectRatio && e.value.ratioWidth && e.value.ratioHeight)
|
|
2053
2064
|
return {
|
|
@@ -2130,7 +2141,7 @@ let u = class extends j {
|
|
|
2130
2141
|
get lastResizeSize() {
|
|
2131
2142
|
if (!this.asset) {
|
|
2132
2143
|
const e = this.transformations.findLast(
|
|
2133
|
-
(i) => i.key ===
|
|
2144
|
+
(i) => i.key === g.Resize
|
|
2134
2145
|
);
|
|
2135
2146
|
if (e?.value.unit === r.AspectRatio && e.value.ratioWidth && e.value.ratioHeight)
|
|
2136
2147
|
return {
|
|
@@ -2186,14 +2197,14 @@ let u = class extends j {
|
|
|
2186
2197
|
*/
|
|
2187
2198
|
get lastRotation() {
|
|
2188
2199
|
return this.asset ? 0 : this.transformations.findLast(
|
|
2189
|
-
(e) => e.key ===
|
|
2200
|
+
(e) => e.key === g.Rotate
|
|
2190
2201
|
)?.value.rotation ?? 0;
|
|
2191
2202
|
}
|
|
2192
2203
|
/**
|
|
2193
2204
|
* Returns the transformation string for the asset link.
|
|
2194
2205
|
*/
|
|
2195
2206
|
get transformationString() {
|
|
2196
|
-
return
|
|
2207
|
+
return lt({
|
|
2197
2208
|
asset: this.asset,
|
|
2198
2209
|
baseUrl: "",
|
|
2199
2210
|
parameters: this.parameters,
|
|
@@ -2232,13 +2243,13 @@ let u = class extends j {
|
|
|
2232
2243
|
);
|
|
2233
2244
|
this.loading = !0, this.apiGetTransformAssetLink({
|
|
2234
2245
|
assetId: this.asset.id,
|
|
2235
|
-
extension:
|
|
2246
|
+
extension: f.getTransformExtension(this.asset.extension),
|
|
2236
2247
|
format: e?.proxyName ?? "",
|
|
2237
2248
|
siteUrl: this.baseUrl,
|
|
2238
2249
|
token: this.token,
|
|
2239
2250
|
transformations: this.transformationString
|
|
2240
2251
|
}).then((s) => {
|
|
2241
|
-
this.loading = !1, !(!s?.relativePath || !this.selectedFormat) && (this.lastAction ===
|
|
2252
|
+
this.loading = !1, !(!s?.relativePath || !this.selectedFormat) && (this.lastAction === g.Rotate && (this.rotation = 0), this.lastAction = void 0, this.lastImageSize = {
|
|
2242
2253
|
height: s.height,
|
|
2243
2254
|
width: s.width
|
|
2244
2255
|
}, this.selectedFormat = {
|
|
@@ -2252,7 +2263,7 @@ let u = class extends j {
|
|
|
2252
2263
|
*/
|
|
2253
2264
|
});
|
|
2254
2265
|
});
|
|
2255
|
-
const i =
|
|
2266
|
+
const i = lt({
|
|
2256
2267
|
asset: this.asset,
|
|
2257
2268
|
baseUrl: "",
|
|
2258
2269
|
extension: this.selectedFormat.extension,
|
|
@@ -2285,7 +2296,7 @@ let u = class extends j {
|
|
|
2285
2296
|
async handleTransformationsChange() {
|
|
2286
2297
|
if (await this.updateComplete, !this.asset) {
|
|
2287
2298
|
this.emit("cx-asset-link-format-change", {
|
|
2288
|
-
detail:
|
|
2299
|
+
detail: lt({
|
|
2289
2300
|
asset: this.asset,
|
|
2290
2301
|
baseUrl: "",
|
|
2291
2302
|
options: {
|
|
@@ -2297,10 +2308,10 @@ let u = class extends j {
|
|
|
2297
2308
|
}).replace(/\/t\//g, "")
|
|
2298
2309
|
});
|
|
2299
2310
|
const n = this.transformations.findLast(
|
|
2300
|
-
(c) => c.key ===
|
|
2311
|
+
(c) => c.key === g.Crop && (c.value.unit === r.AspectRatio && c.value.ratioWidth && c.value.ratioHeight || c.value.width && c.value.height)
|
|
2301
2312
|
);
|
|
2302
2313
|
if (n?.value.unit === r.AspectRatio && n.value.ratioWidth && n.value.ratioHeight) {
|
|
2303
|
-
const { focusMode: c, position: y, ratioHeight:
|
|
2314
|
+
const { focusMode: c, position: y, ratioHeight: A, ratioWidth: p } = n.value;
|
|
2304
2315
|
this.cropSize = {
|
|
2305
2316
|
...this.cropSize,
|
|
2306
2317
|
cropMode: "free",
|
|
@@ -2308,12 +2319,12 @@ let u = class extends j {
|
|
|
2308
2319
|
percentageHeight: 100,
|
|
2309
2320
|
percentageWidth: 100,
|
|
2310
2321
|
position: y ?? N.CenterCenter,
|
|
2311
|
-
ratioHeight:
|
|
2322
|
+
ratioHeight: A,
|
|
2312
2323
|
ratioWidth: p,
|
|
2313
2324
|
unit: r.AspectRatio
|
|
2314
2325
|
};
|
|
2315
2326
|
} else if (n) {
|
|
2316
|
-
const { focusMode: c, height: y, position:
|
|
2327
|
+
const { focusMode: c, height: y, position: A, unit: p, width: x, x: b = 0, y: u = 0 } = n.value;
|
|
2317
2328
|
this.cropSize = {
|
|
2318
2329
|
...this.cropSize,
|
|
2319
2330
|
cropMode: "free",
|
|
@@ -2321,11 +2332,11 @@ let u = class extends j {
|
|
|
2321
2332
|
height: y,
|
|
2322
2333
|
percentageHeight: 100,
|
|
2323
2334
|
percentageWidth: 100,
|
|
2324
|
-
position:
|
|
2335
|
+
position: A ?? N.CenterCenter,
|
|
2325
2336
|
unit: p ?? r.Pixel,
|
|
2326
|
-
width:
|
|
2327
|
-
x:
|
|
2328
|
-
y:
|
|
2337
|
+
width: x,
|
|
2338
|
+
x: b,
|
|
2339
|
+
y: u
|
|
2329
2340
|
};
|
|
2330
2341
|
} else
|
|
2331
2342
|
this.cropSize = {
|
|
@@ -2348,7 +2359,7 @@ let u = class extends j {
|
|
|
2348
2359
|
y: 0
|
|
2349
2360
|
};
|
|
2350
2361
|
const o = this.transformations.findLast(
|
|
2351
|
-
(c) => c.key ===
|
|
2362
|
+
(c) => c.key === g.Resize && (c.value.unit === r.AspectRatio && c.value.ratioWidth && c.value.ratioHeight || c.value.width || c.value.height)
|
|
2352
2363
|
);
|
|
2353
2364
|
if (o?.value.unit === r.AspectRatio && o.value.ratioWidth && o.value.ratioHeight) {
|
|
2354
2365
|
const { ratioHeight: c, ratioWidth: y } = o.value;
|
|
@@ -2359,12 +2370,12 @@ let u = class extends j {
|
|
|
2359
2370
|
unit: r.AspectRatio
|
|
2360
2371
|
};
|
|
2361
2372
|
} else if (o) {
|
|
2362
|
-
const { height: c = 0, unit: y, width:
|
|
2373
|
+
const { height: c = 0, unit: y, width: A = 0 } = o.value;
|
|
2363
2374
|
this.resizeSize = {
|
|
2364
2375
|
...this.resizeSize,
|
|
2365
2376
|
height: c,
|
|
2366
2377
|
unit: y ?? r.Pixel,
|
|
2367
|
-
width:
|
|
2378
|
+
width: A
|
|
2368
2379
|
};
|
|
2369
2380
|
} else
|
|
2370
2381
|
this.resizeSize = {
|
|
@@ -2379,11 +2390,11 @@ let u = class extends j {
|
|
|
2379
2390
|
width: 1
|
|
2380
2391
|
};
|
|
2381
2392
|
const l = this.transformations.findLast(
|
|
2382
|
-
(c) => c.key ===
|
|
2393
|
+
(c) => c.key === g.Rotate
|
|
2383
2394
|
);
|
|
2384
2395
|
this.rotation = l?.value.rotation ?? 0;
|
|
2385
|
-
const d = this.transformations.findLast((c) => c.key ===
|
|
2386
|
-
(c) => c.key ===
|
|
2396
|
+
const d = this.transformations.findLast((c) => c.key === g.Quality)?.value.quality ?? 100, m = this.transformations.some(
|
|
2397
|
+
(c) => c.key === g.Metadata
|
|
2387
2398
|
);
|
|
2388
2399
|
this.selectedFormat ? this.selectedFormat = { ...this.selectedFormat, keepMetadata: m, quality: d } : this.selectedFormat = {
|
|
2389
2400
|
extension: "",
|
|
@@ -2406,7 +2417,7 @@ let u = class extends j {
|
|
|
2406
2417
|
this.loading = !0;
|
|
2407
2418
|
const e = await this.apiGetTransformAssetLink({
|
|
2408
2419
|
assetId: this.asset.id,
|
|
2409
|
-
extension:
|
|
2420
|
+
extension: f.getTransformExtension(this.selectedFormat.extension),
|
|
2410
2421
|
format: t?.proxyName ?? "",
|
|
2411
2422
|
siteUrl: this.baseUrl,
|
|
2412
2423
|
token: this.token,
|
|
@@ -2438,11 +2449,11 @@ let u = class extends j {
|
|
|
2438
2449
|
width: e.width,
|
|
2439
2450
|
x: 0,
|
|
2440
2451
|
y: 0
|
|
2441
|
-
}, this.lastAction ===
|
|
2452
|
+
}, this.lastAction === g.Rotate && (this.rotation = 0), this.lastAction = void 0;
|
|
2442
2453
|
const i = this.transformations.some(
|
|
2443
|
-
(n) => n.key ===
|
|
2454
|
+
(n) => n.key === g.Metadata
|
|
2444
2455
|
), s = this.transformations.findLast(
|
|
2445
|
-
(n) => n.key ===
|
|
2456
|
+
(n) => n.key === g.Quality
|
|
2446
2457
|
);
|
|
2447
2458
|
this.selectedFormat = {
|
|
2448
2459
|
...this.selectedFormat,
|
|
@@ -2456,7 +2467,7 @@ let u = class extends j {
|
|
|
2456
2467
|
* url: `${this.baseUrl}/${response.relativePath}`,
|
|
2457
2468
|
*/
|
|
2458
2469
|
};
|
|
2459
|
-
const a =
|
|
2470
|
+
const a = lt({
|
|
2460
2471
|
asset: this.asset,
|
|
2461
2472
|
baseUrl: "",
|
|
2462
2473
|
extension: this.selectedFormat.extension,
|
|
@@ -2488,7 +2499,7 @@ let u = class extends j {
|
|
|
2488
2499
|
width: Number.parseInt(this.asset.width, 10)
|
|
2489
2500
|
});
|
|
2490
2501
|
const t = this.transformations.findLast(
|
|
2491
|
-
(e) => e.key ===
|
|
2502
|
+
(e) => e.key === g.Quality
|
|
2492
2503
|
);
|
|
2493
2504
|
this.selectedFormat = {
|
|
2494
2505
|
extension: this.asset.extension,
|
|
@@ -2543,7 +2554,7 @@ let u = class extends j {
|
|
|
2543
2554
|
e.proxyName === "TRX" && (e.formatHeight = Number(this.asset.height), e.formatWidth = Number(this.asset.width));
|
|
2544
2555
|
const i = this.proxies?.find((s) => s.id === t);
|
|
2545
2556
|
i && (this.asset && i.proxyName === "TRX" && (i.formatHeight = Number(this.asset.height), i.formatWidth = Number(this.asset.width)), this.transformations = this.transformations.map((s) => {
|
|
2546
|
-
if (s.key ===
|
|
2557
|
+
if (s.key === g.Crop) {
|
|
2547
2558
|
const a = s.value, n = a.width / i.formatWidth * e.formatWidth, o = a.height / i.formatHeight * e.formatHeight, l = a.x / i.formatWidth * e.formatWidth, d = a.y / i.formatHeight * e.formatHeight;
|
|
2548
2559
|
return {
|
|
2549
2560
|
...s,
|
|
@@ -2556,7 +2567,7 @@ let u = class extends j {
|
|
|
2556
2567
|
}
|
|
2557
2568
|
};
|
|
2558
2569
|
}
|
|
2559
|
-
if (s.key ===
|
|
2570
|
+
if (s.key === g.Resize) {
|
|
2560
2571
|
const a = s.value, n = a.width / i.formatWidth * e.formatWidth, o = a.height / i.formatHeight * e.formatHeight;
|
|
2561
2572
|
return {
|
|
2562
2573
|
...s,
|
|
@@ -2637,7 +2648,7 @@ let u = class extends j {
|
|
|
2637
2648
|
}) {
|
|
2638
2649
|
if (!this.selectedFormat?.url || e === "manual")
|
|
2639
2650
|
return;
|
|
2640
|
-
this.loading = !0, this.lastAction =
|
|
2651
|
+
this.loading = !0, this.lastAction = g.Crop;
|
|
2641
2652
|
const y = await this.apiGetCropFocusMode({
|
|
2642
2653
|
autoCropMode: e,
|
|
2643
2654
|
cropHeight: i,
|
|
@@ -2645,11 +2656,11 @@ let u = class extends j {
|
|
|
2645
2656
|
imageUrl: this.selectedFormat.url
|
|
2646
2657
|
});
|
|
2647
2658
|
if (y) {
|
|
2648
|
-
let
|
|
2649
|
-
i || (
|
|
2659
|
+
let A = a, p = n;
|
|
2660
|
+
i || (A = y.height * 100 / this.selectedFormat.height), c || (p = y.width * 100 / this.selectedFormat.width), this.cropSize = {
|
|
2650
2661
|
...this.cropSize,
|
|
2651
2662
|
height: y.height,
|
|
2652
|
-
percentageHeight:
|
|
2663
|
+
percentageHeight: A ?? this.cropSize.percentageHeight,
|
|
2653
2664
|
percentageWidth: p ?? this.cropSize.percentageWidth,
|
|
2654
2665
|
width: y.width,
|
|
2655
2666
|
x: y.x * 100 / this.selectedFormat.width,
|
|
@@ -2686,7 +2697,7 @@ let u = class extends j {
|
|
|
2686
2697
|
));
|
|
2687
2698
|
const c = this.cropSize.focusMode;
|
|
2688
2699
|
this.focusModes.find(
|
|
2689
|
-
(
|
|
2700
|
+
(A) => A.value === c
|
|
2690
2701
|
)?.auto && this.selectedFormat?.url && this.cropperElement ? await this.handleRequestAutoCropSuggestion({
|
|
2691
2702
|
focusMode: c,
|
|
2692
2703
|
height: d,
|
|
@@ -2729,12 +2740,12 @@ let u = class extends j {
|
|
|
2729
2740
|
* a proxy *id*, so the name has to be looked up in `proxies` rather than used directly.
|
|
2730
2741
|
*/
|
|
2731
2742
|
get autoResolvedProxyId() {
|
|
2732
|
-
const t =
|
|
2743
|
+
const t = jt(this.asset?.extension, this.asset?.size);
|
|
2733
2744
|
return this.proxies?.find((e) => e.proxyName === t)?.id ?? "";
|
|
2734
2745
|
}
|
|
2735
2746
|
onProxyChange(t) {
|
|
2736
2747
|
const e = t.detail;
|
|
2737
|
-
if (this.lastAction =
|
|
2748
|
+
if (this.lastAction = g.Proxy, e.autoFormat) {
|
|
2738
2749
|
this.autoFormat = !0;
|
|
2739
2750
|
const i = this.autoResolvedProxyId;
|
|
2740
2751
|
i && (this.selectedProxy = i);
|
|
@@ -2852,42 +2863,42 @@ let u = class extends j {
|
|
|
2852
2863
|
});
|
|
2853
2864
|
}
|
|
2854
2865
|
onCropApply(t) {
|
|
2855
|
-
if (this.clearResetSnapshot(), this.lastAction =
|
|
2866
|
+
if (this.clearResetSnapshot(), this.lastAction = g.Crop, !this.asset) {
|
|
2856
2867
|
const {
|
|
2857
2868
|
focusMode: l,
|
|
2858
2869
|
height: d,
|
|
2859
2870
|
position: m,
|
|
2860
2871
|
ratioHeight: c,
|
|
2861
2872
|
ratioWidth: y,
|
|
2862
|
-
unit:
|
|
2873
|
+
unit: A,
|
|
2863
2874
|
width: p,
|
|
2864
|
-
x
|
|
2865
|
-
y:
|
|
2866
|
-
} = this.cropSize,
|
|
2867
|
-
(
|
|
2875
|
+
x,
|
|
2876
|
+
y: b
|
|
2877
|
+
} = this.cropSize, u = this.focusModes.find(
|
|
2878
|
+
(w) => w.value === l
|
|
2868
2879
|
)?.auto ?? !1;
|
|
2869
|
-
if (
|
|
2880
|
+
if (A === r.AspectRatio) {
|
|
2870
2881
|
y && c && this.upsertTransformation({
|
|
2871
|
-
key:
|
|
2882
|
+
key: g.Crop,
|
|
2872
2883
|
value: {
|
|
2873
2884
|
focusMode: l,
|
|
2874
|
-
isFocusModeAuto:
|
|
2885
|
+
isFocusModeAuto: u,
|
|
2875
2886
|
position: m,
|
|
2876
2887
|
ratioHeight: c,
|
|
2877
2888
|
ratioWidth: y,
|
|
2878
|
-
unit:
|
|
2889
|
+
unit: A
|
|
2879
2890
|
}
|
|
2880
2891
|
});
|
|
2881
2892
|
return;
|
|
2882
2893
|
}
|
|
2883
2894
|
(d || p) && this.upsertTransformation({
|
|
2884
|
-
key:
|
|
2895
|
+
key: g.Crop,
|
|
2885
2896
|
value: {
|
|
2886
2897
|
focusMode: l,
|
|
2887
2898
|
height: d,
|
|
2888
|
-
isFocusModeAuto:
|
|
2899
|
+
isFocusModeAuto: u,
|
|
2889
2900
|
position: m,
|
|
2890
|
-
unit:
|
|
2901
|
+
unit: A,
|
|
2891
2902
|
width: p,
|
|
2892
2903
|
/**
|
|
2893
2904
|
* Without an asset there is no cropper to drag, so x/y are always the 0
|
|
@@ -2896,8 +2907,8 @@ let u = class extends j {
|
|
|
2896
2907
|
* string) so `hasManualXY` in buildTransformationString doesn't spuriously
|
|
2897
2908
|
* suppress the focus mode / position `c_g_` gravity value.
|
|
2898
2909
|
*/
|
|
2899
|
-
x: Number.isFinite(
|
|
2900
|
-
y: Number.isFinite(
|
|
2910
|
+
x: Number.isFinite(x) && x !== 0 ? x : void 0,
|
|
2911
|
+
y: Number.isFinite(b) && b !== 0 ? b : void 0
|
|
2901
2912
|
}
|
|
2902
2913
|
});
|
|
2903
2914
|
return;
|
|
@@ -2914,7 +2925,7 @@ let u = class extends j {
|
|
|
2914
2925
|
this.transformations = [
|
|
2915
2926
|
...this.transformations,
|
|
2916
2927
|
{
|
|
2917
|
-
key:
|
|
2928
|
+
key: g.Crop,
|
|
2918
2929
|
value: {
|
|
2919
2930
|
focusMode: n,
|
|
2920
2931
|
height: d,
|
|
@@ -2929,7 +2940,7 @@ let u = class extends j {
|
|
|
2929
2940
|
this.transformations = [
|
|
2930
2941
|
...this.transformations,
|
|
2931
2942
|
{
|
|
2932
|
-
key:
|
|
2943
|
+
key: g.Crop,
|
|
2933
2944
|
value: {
|
|
2934
2945
|
focusMode: n,
|
|
2935
2946
|
height: d,
|
|
@@ -2945,7 +2956,7 @@ let u = class extends j {
|
|
|
2945
2956
|
} else i && (this.transformations = [
|
|
2946
2957
|
...this.transformations,
|
|
2947
2958
|
{
|
|
2948
|
-
key:
|
|
2959
|
+
key: g.Crop,
|
|
2949
2960
|
value: {
|
|
2950
2961
|
focusMode: n,
|
|
2951
2962
|
isFocusModeAuto: o,
|
|
@@ -2980,11 +2991,11 @@ let u = class extends j {
|
|
|
2980
2991
|
}
|
|
2981
2992
|
onResizeApply(t) {
|
|
2982
2993
|
const { height: e, unit: i, width: s } = t.detail;
|
|
2983
|
-
if (this.clearResetSnapshot(), this.lastAction =
|
|
2994
|
+
if (this.clearResetSnapshot(), this.lastAction = g.Resize, !this.asset) {
|
|
2984
2995
|
if (i === r.AspectRatio) {
|
|
2985
2996
|
const { ratioHeight: d, ratioWidth: m } = this.resizeSize;
|
|
2986
2997
|
m && d && this.upsertTransformation({
|
|
2987
|
-
key:
|
|
2998
|
+
key: g.Resize,
|
|
2988
2999
|
value: {
|
|
2989
3000
|
ratioHeight: d,
|
|
2990
3001
|
ratioWidth: m,
|
|
@@ -2994,7 +3005,7 @@ let u = class extends j {
|
|
|
2994
3005
|
return;
|
|
2995
3006
|
}
|
|
2996
3007
|
(e || s) && this.upsertTransformation({
|
|
2997
|
-
key:
|
|
3008
|
+
key: g.Resize,
|
|
2998
3009
|
value: {
|
|
2999
3010
|
height: e,
|
|
3000
3011
|
unit: i,
|
|
@@ -3010,7 +3021,7 @@ let u = class extends j {
|
|
|
3010
3021
|
this.resizeSize.unit !== i ? (o = a, l = n) : i === r.AspectRatio && (o = Math.round(s / e * n), l = n), this.transformations = [
|
|
3011
3022
|
...this.transformations,
|
|
3012
3023
|
{
|
|
3013
|
-
key:
|
|
3024
|
+
key: g.Resize,
|
|
3014
3025
|
value: {
|
|
3015
3026
|
height: l,
|
|
3016
3027
|
unit: i,
|
|
@@ -3024,21 +3035,21 @@ let u = class extends j {
|
|
|
3024
3035
|
}
|
|
3025
3036
|
onRotationApply(t) {
|
|
3026
3037
|
const e = t.detail;
|
|
3027
|
-
if (this.clearResetSnapshot(), this.lastAction =
|
|
3038
|
+
if (this.clearResetSnapshot(), this.lastAction = g.Rotate, !this.asset) {
|
|
3028
3039
|
e ? this.upsertTransformation({
|
|
3029
|
-
key:
|
|
3040
|
+
key: g.Rotate,
|
|
3030
3041
|
value: {
|
|
3031
3042
|
rotation: e
|
|
3032
3043
|
}
|
|
3033
3044
|
}) : this.transformations = this.transformations.filter(
|
|
3034
|
-
(i) => i.key !==
|
|
3045
|
+
(i) => i.key !== g.Rotate
|
|
3035
3046
|
);
|
|
3036
3047
|
return;
|
|
3037
3048
|
}
|
|
3038
3049
|
this.selectedFormat && (this.transformations = [
|
|
3039
3050
|
...this.transformations,
|
|
3040
3051
|
{
|
|
3041
|
-
key:
|
|
3052
|
+
key: g.Rotate,
|
|
3042
3053
|
value: {
|
|
3043
3054
|
rotation: e
|
|
3044
3055
|
}
|
|
@@ -3047,9 +3058,9 @@ let u = class extends j {
|
|
|
3047
3058
|
}
|
|
3048
3059
|
onQualityChange(t) {
|
|
3049
3060
|
const e = t.detail;
|
|
3050
|
-
this.selectedFormat && (this.selectedFormat.quality = e), this.clearResetSnapshot(), this.lastAction =
|
|
3061
|
+
this.selectedFormat && (this.selectedFormat.quality = e), this.clearResetSnapshot(), this.lastAction = g.Quality;
|
|
3051
3062
|
const i = {
|
|
3052
|
-
key:
|
|
3063
|
+
key: g.Quality,
|
|
3053
3064
|
value: {
|
|
3054
3065
|
quality: e
|
|
3055
3066
|
}
|
|
@@ -3063,22 +3074,22 @@ let u = class extends j {
|
|
|
3063
3074
|
keepMetadata: e
|
|
3064
3075
|
}), !this.asset) {
|
|
3065
3076
|
e ? this.upsertTransformation({
|
|
3066
|
-
key:
|
|
3077
|
+
key: g.Metadata,
|
|
3067
3078
|
value: {
|
|
3068
3079
|
keepMetadata: e
|
|
3069
3080
|
}
|
|
3070
3081
|
}) : this.transformations = this.transformations.filter(
|
|
3071
|
-
(i) => i.key !==
|
|
3082
|
+
(i) => i.key !== g.Metadata
|
|
3072
3083
|
);
|
|
3073
3084
|
return;
|
|
3074
3085
|
}
|
|
3075
3086
|
e ? this.upsertTransformation({
|
|
3076
|
-
key:
|
|
3087
|
+
key: g.Metadata,
|
|
3077
3088
|
value: {
|
|
3078
3089
|
keepMetadata: e
|
|
3079
3090
|
}
|
|
3080
3091
|
}) : this.transformations = this.transformations.filter(
|
|
3081
|
-
(i) => i.key !==
|
|
3092
|
+
(i) => i.key !== g.Metadata
|
|
3082
3093
|
);
|
|
3083
3094
|
}
|
|
3084
3095
|
onExtensionChange(t) {
|
|
@@ -3090,7 +3101,7 @@ let u = class extends j {
|
|
|
3090
3101
|
}
|
|
3091
3102
|
syncQuality() {
|
|
3092
3103
|
const t = this.transformations.findLast(
|
|
3093
|
-
(e) => e.key ===
|
|
3104
|
+
(e) => e.key === g.Quality
|
|
3094
3105
|
)?.value?.quality;
|
|
3095
3106
|
this.selectedFormat && (this.selectedFormat = {
|
|
3096
3107
|
...this.selectedFormat,
|
|
@@ -3128,198 +3139,198 @@ let u = class extends j {
|
|
|
3128
3139
|
this.transformations = [], this.frozenIndex = -1, this.syncQuality();
|
|
3129
3140
|
}
|
|
3130
3141
|
render() {
|
|
3131
|
-
return C`<div class="asset-link-format" @cx-show=${this.onDetailsShow} @cx-hide=${this.onDetailsHide}>${
|
|
3142
|
+
return C`<div class="asset-link-format" @cx-show=${this.onDetailsShow} @cx-hide=${this.onDetailsHide}>${M(
|
|
3132
3143
|
!this.hideHeader,
|
|
3133
|
-
() => 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>${
|
|
3134
|
-
() =>
|
|
3144
|
+
() => 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>${M(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>`,
|
|
3145
|
+
() => qt
|
|
3135
3146
|
)}
|
|
3136
|
-
${
|
|
3147
|
+
${M(
|
|
3137
3148
|
!this.noFormat,
|
|
3138
|
-
() => 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 ===
|
|
3149
|
+
() => 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 === g.Proxy} @cx-asset-link-format-proxy-change=${this.onProxyChange}></cx-asset-link-format-proxy>`
|
|
3139
3150
|
)}
|
|
3140
|
-
${
|
|
3151
|
+
${M(
|
|
3141
3152
|
!this.noCrop,
|
|
3142
|
-
() => 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 ===
|
|
3153
|
+
() => 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 === g.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>`
|
|
3143
3154
|
)}
|
|
3144
|
-
${
|
|
3155
|
+
${M(
|
|
3145
3156
|
!this.noResize,
|
|
3146
|
-
() => C`<cx-asset-link-format-resize class="asset-link-format__details" ?open=${this.activeSetting === "cx-asset-link-format-resize"} ?loading=${this.loading && this.lastAction ===
|
|
3157
|
+
() => C`<cx-asset-link-format-resize class="asset-link-format__details" ?open=${this.activeSetting === "cx-asset-link-format-resize"} ?loading=${this.loading && this.lastAction === g.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>`
|
|
3147
3158
|
)}
|
|
3148
|
-
${
|
|
3159
|
+
${M(
|
|
3149
3160
|
!this.noRotate,
|
|
3150
|
-
() => C`<cx-asset-link-format-rotation class="asset-link-format__details" ?loading=${this.loading && this.lastAction ===
|
|
3151
|
-
)}<cx-asset-link-format-quality class="asset-link-format__details" ?loading=${this.loading && this.lastAction ===
|
|
3161
|
+
() => C`<cx-asset-link-format-rotation class="asset-link-format__details" ?loading=${this.loading && this.lastAction === g.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>`
|
|
3162
|
+
)}<cx-asset-link-format-quality class="asset-link-format__details" ?loading=${this.loading && this.lastAction === g.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>${M(
|
|
3152
3163
|
!this.noMetadata,
|
|
3153
3164
|
() => 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>`
|
|
3154
3165
|
)}
|
|
3155
|
-
${
|
|
3166
|
+
${M(
|
|
3156
3167
|
this.useCustomExtension,
|
|
3157
3168
|
() => C`<cx-asset-link-format-extension .items=${this.extensions} value=${this.selectedFormat?.extension ?? ""} @cx-asset-link-format-extension-change=${this.onExtensionChange}></cx-asset-link-format-extension>`
|
|
3158
3169
|
)}</div>`;
|
|
3159
3170
|
}
|
|
3160
3171
|
};
|
|
3161
|
-
|
|
3162
|
-
|
|
3172
|
+
f.styles = [Q, Ee];
|
|
3173
|
+
f.dependencies = {
|
|
3163
3174
|
"cx-asset-link-format-crop": v,
|
|
3164
|
-
"cx-asset-link-format-extension":
|
|
3175
|
+
"cx-asset-link-format-extension": Z,
|
|
3165
3176
|
"cx-asset-link-format-metadata": U,
|
|
3166
|
-
"cx-asset-link-format-proxy":
|
|
3167
|
-
"cx-asset-link-format-quality":
|
|
3177
|
+
"cx-asset-link-format-proxy": I,
|
|
3178
|
+
"cx-asset-link-format-quality": H,
|
|
3168
3179
|
"cx-asset-link-format-resize": k,
|
|
3169
|
-
"cx-asset-link-format-rotation":
|
|
3170
|
-
"cx-button":
|
|
3180
|
+
"cx-asset-link-format-rotation": T,
|
|
3181
|
+
"cx-button": Y,
|
|
3171
3182
|
"cx-space": B,
|
|
3172
3183
|
"cx-typography": q
|
|
3173
3184
|
};
|
|
3174
|
-
|
|
3185
|
+
S([
|
|
3175
3186
|
h({ attribute: "base-url", type: String })
|
|
3176
|
-
],
|
|
3177
|
-
|
|
3187
|
+
], f.prototype, "baseUrl", 2);
|
|
3188
|
+
S([
|
|
3178
3189
|
h({ attribute: "token", type: String })
|
|
3179
|
-
],
|
|
3180
|
-
|
|
3190
|
+
], f.prototype, "token", 2);
|
|
3191
|
+
S([
|
|
3181
3192
|
h({ reflect: !1, type: Object })
|
|
3182
|
-
],
|
|
3183
|
-
|
|
3193
|
+
], f.prototype, "asset", 2);
|
|
3194
|
+
S([
|
|
3184
3195
|
h({ attribute: "crop-modes", reflect: !1, type: Array })
|
|
3185
|
-
],
|
|
3186
|
-
|
|
3196
|
+
], f.prototype, "cropModes", 2);
|
|
3197
|
+
S([
|
|
3187
3198
|
h({ attribute: "focus-modes", reflect: !1, type: Object })
|
|
3188
|
-
],
|
|
3189
|
-
|
|
3199
|
+
], f.prototype, "focusModes", 2);
|
|
3200
|
+
S([
|
|
3190
3201
|
h({ reflect: !1, type: Array })
|
|
3191
|
-
],
|
|
3192
|
-
|
|
3202
|
+
], f.prototype, "extensions", 2);
|
|
3203
|
+
S([
|
|
3193
3204
|
h({ reflect: !1, type: Array })
|
|
3194
|
-
],
|
|
3195
|
-
|
|
3205
|
+
], f.prototype, "proxies", 2);
|
|
3206
|
+
S([
|
|
3196
3207
|
h({ attribute: "for-cropper", reflect: !0, type: String })
|
|
3197
|
-
],
|
|
3198
|
-
|
|
3208
|
+
], f.prototype, "forCropper", 2);
|
|
3209
|
+
S([
|
|
3199
3210
|
h({ attribute: "use-session", reflect: !0, type: String })
|
|
3200
|
-
],
|
|
3201
|
-
|
|
3211
|
+
], f.prototype, "useSession", 2);
|
|
3212
|
+
S([
|
|
3202
3213
|
h({ reflect: !1, type: Array })
|
|
3203
|
-
],
|
|
3204
|
-
|
|
3214
|
+
], f.prototype, "transformations", 2);
|
|
3215
|
+
S([
|
|
3205
3216
|
h({ attribute: "selected-proxy", reflect: !0, type: String })
|
|
3206
|
-
],
|
|
3207
|
-
|
|
3217
|
+
], f.prototype, "selectedProxy", 2);
|
|
3218
|
+
S([
|
|
3208
3219
|
h({ attribute: "default-proxy", reflect: !0, type: String })
|
|
3209
|
-
],
|
|
3210
|
-
|
|
3220
|
+
], f.prototype, "defaultProxy", 2);
|
|
3221
|
+
S([
|
|
3211
3222
|
h({ attribute: "can-auto-format", reflect: !0, type: Boolean })
|
|
3212
|
-
],
|
|
3213
|
-
|
|
3223
|
+
], f.prototype, "canAutoFormat", 2);
|
|
3224
|
+
S([
|
|
3214
3225
|
h({ attribute: "auto-format", reflect: !0, type: Boolean })
|
|
3215
|
-
],
|
|
3216
|
-
|
|
3226
|
+
], f.prototype, "autoFormat", 2);
|
|
3227
|
+
S([
|
|
3217
3228
|
h({ attribute: "use-custom-extension", reflect: !0, type: Boolean })
|
|
3218
|
-
],
|
|
3219
|
-
|
|
3229
|
+
], f.prototype, "useCustomExtension", 2);
|
|
3230
|
+
S([
|
|
3220
3231
|
h({ attribute: "no-metadata", reflect: !0, type: Boolean })
|
|
3221
|
-
],
|
|
3222
|
-
|
|
3232
|
+
], f.prototype, "noMetadata", 2);
|
|
3233
|
+
S([
|
|
3223
3234
|
h({ attribute: "no-format", reflect: !0, type: Boolean })
|
|
3224
|
-
],
|
|
3225
|
-
|
|
3235
|
+
], f.prototype, "noFormat", 2);
|
|
3236
|
+
S([
|
|
3226
3237
|
h({ attribute: "no-crop", reflect: !0, type: Boolean })
|
|
3227
|
-
],
|
|
3228
|
-
|
|
3238
|
+
], f.prototype, "noCrop", 2);
|
|
3239
|
+
S([
|
|
3229
3240
|
h({ attribute: "no-resize", reflect: !0, type: Boolean })
|
|
3230
|
-
],
|
|
3231
|
-
|
|
3241
|
+
], f.prototype, "noResize", 2);
|
|
3242
|
+
S([
|
|
3232
3243
|
h({ attribute: "no-rotate", reflect: !0, type: Boolean })
|
|
3233
|
-
],
|
|
3234
|
-
|
|
3244
|
+
], f.prototype, "noRotate", 2);
|
|
3245
|
+
S([
|
|
3235
3246
|
h({ attribute: "last-image-size", reflect: !1, type: Object })
|
|
3236
|
-
],
|
|
3237
|
-
|
|
3247
|
+
], f.prototype, "lastImageSize", 2);
|
|
3248
|
+
S([
|
|
3238
3249
|
h({ attribute: "hide-header", reflect: !1, type: Boolean })
|
|
3239
|
-
],
|
|
3240
|
-
|
|
3250
|
+
], f.prototype, "hideHeader", 2);
|
|
3251
|
+
S([
|
|
3241
3252
|
h({ attribute: "can-reset", type: Boolean })
|
|
3242
|
-
],
|
|
3243
|
-
|
|
3253
|
+
], f.prototype, "canReset", 2);
|
|
3254
|
+
S([
|
|
3244
3255
|
h({ attribute: !1, reflect: !1, type: Object })
|
|
3245
|
-
],
|
|
3246
|
-
|
|
3256
|
+
], f.prototype, "queryElement", 2);
|
|
3257
|
+
S([
|
|
3247
3258
|
R()
|
|
3248
|
-
],
|
|
3249
|
-
|
|
3259
|
+
], f.prototype, "activeSetting", 2);
|
|
3260
|
+
S([
|
|
3250
3261
|
R()
|
|
3251
|
-
],
|
|
3252
|
-
|
|
3262
|
+
], f.prototype, "selectedFormat", 2);
|
|
3263
|
+
S([
|
|
3253
3264
|
R()
|
|
3254
|
-
],
|
|
3255
|
-
|
|
3265
|
+
], f.prototype, "resizeSize", 2);
|
|
3266
|
+
S([
|
|
3256
3267
|
R()
|
|
3257
|
-
],
|
|
3258
|
-
|
|
3268
|
+
], f.prototype, "cropSize", 2);
|
|
3269
|
+
S([
|
|
3259
3270
|
R()
|
|
3260
|
-
],
|
|
3261
|
-
|
|
3271
|
+
], f.prototype, "rotation", 2);
|
|
3272
|
+
S([
|
|
3262
3273
|
R()
|
|
3263
|
-
],
|
|
3264
|
-
|
|
3274
|
+
], f.prototype, "defaultSize", 2);
|
|
3275
|
+
S([
|
|
3265
3276
|
R()
|
|
3266
|
-
],
|
|
3267
|
-
|
|
3277
|
+
], f.prototype, "cropperElement", 2);
|
|
3278
|
+
S([
|
|
3268
3279
|
R()
|
|
3269
|
-
],
|
|
3270
|
-
|
|
3280
|
+
], f.prototype, "parameters", 2);
|
|
3281
|
+
S([
|
|
3271
3282
|
R()
|
|
3272
|
-
],
|
|
3273
|
-
|
|
3283
|
+
], f.prototype, "loading", 2);
|
|
3284
|
+
S([
|
|
3274
3285
|
R()
|
|
3275
|
-
],
|
|
3276
|
-
|
|
3286
|
+
], f.prototype, "lastAction", 2);
|
|
3287
|
+
S([
|
|
3277
3288
|
R()
|
|
3278
|
-
],
|
|
3279
|
-
|
|
3289
|
+
], f.prototype, "frozenIndex", 2);
|
|
3290
|
+
S([
|
|
3280
3291
|
R()
|
|
3281
|
-
],
|
|
3282
|
-
|
|
3292
|
+
], f.prototype, "preResetTransformations", 2);
|
|
3293
|
+
S([
|
|
3283
3294
|
R()
|
|
3284
|
-
],
|
|
3285
|
-
|
|
3295
|
+
], f.prototype, "preResetAutoFormat", 2);
|
|
3296
|
+
S([
|
|
3286
3297
|
R()
|
|
3287
|
-
],
|
|
3288
|
-
|
|
3298
|
+
], f.prototype, "preResetSelectedProxy", 2);
|
|
3299
|
+
S([
|
|
3289
3300
|
P("transformations")
|
|
3290
|
-
],
|
|
3291
|
-
|
|
3301
|
+
], f.prototype, "handleTransformationsChange", 1);
|
|
3302
|
+
S([
|
|
3292
3303
|
P("selectedProxy")
|
|
3293
|
-
],
|
|
3294
|
-
|
|
3304
|
+
], f.prototype, "handleSelectedProxyChange", 1);
|
|
3305
|
+
S([
|
|
3295
3306
|
P("loading")
|
|
3296
|
-
],
|
|
3297
|
-
|
|
3307
|
+
], f.prototype, "handleLoadingChange", 1);
|
|
3308
|
+
f = S([
|
|
3298
3309
|
X("cx-asset-link-format")
|
|
3299
|
-
],
|
|
3310
|
+
], f);
|
|
3300
3311
|
export {
|
|
3301
|
-
|
|
3302
|
-
|
|
3303
|
-
|
|
3304
|
-
|
|
3305
|
-
|
|
3306
|
-
|
|
3312
|
+
f as C,
|
|
3313
|
+
Xi as F,
|
|
3314
|
+
Ft as M,
|
|
3315
|
+
Pe as a,
|
|
3316
|
+
Zt as b,
|
|
3317
|
+
rt as c,
|
|
3307
3318
|
xt as d,
|
|
3308
|
-
|
|
3309
|
-
|
|
3310
|
-
|
|
3311
|
-
|
|
3312
|
-
|
|
3313
|
-
|
|
3314
|
-
|
|
3319
|
+
Qt as e,
|
|
3320
|
+
Ae as f,
|
|
3321
|
+
Xt as g,
|
|
3322
|
+
Gi as h,
|
|
3323
|
+
Jt as i,
|
|
3324
|
+
Qi as j,
|
|
3325
|
+
Vi as k,
|
|
3315
3326
|
ut as l,
|
|
3316
3327
|
mt as m,
|
|
3317
|
-
|
|
3328
|
+
Dt as n,
|
|
3318
3329
|
ft as o,
|
|
3319
3330
|
gt as p,
|
|
3320
|
-
|
|
3321
|
-
|
|
3322
|
-
|
|
3323
|
-
|
|
3324
|
-
|
|
3331
|
+
Nt as q,
|
|
3332
|
+
Bi as r,
|
|
3333
|
+
qi as s,
|
|
3334
|
+
ji as t,
|
|
3335
|
+
me as u
|
|
3325
3336
|
};
|