@orangelogic/design-system 2.193.0 → 2.195.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.BX1hdLgZ.js → asset-link-format.BFxmPgwt.js} +898 -868
- package/library/chunks/{color-swatch-group.BpEQJM1b.js → color-swatch-group.C0BXFL4I.js} +2 -3
- package/library/chunks/{document-viewer.DZsbpf0x.js → document-viewer.C5IT7M61.js} +1 -2
- package/library/chunks/{toast.C5Ir5yKA.js → toast.COzwhRI6.js} +1 -1
- package/library/chunks/transformation.CkEA7Ymz.js +392 -0
- 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 +93 -106
- package/library/components/organisms.js +2 -2
- package/library/components/types.js +14599 -14597
- package/library/package.json +1 -1
- package/library/packages/molecules/src/masonry/masonry.d.ts +0 -2
- package/library/packages/organisms/src/content-builder/blocks/image/image.d.ts +6 -0
- package/library/packages/organisms/src/content-builder-viewer/content-builder-viewer.d.ts +5 -5
- package/library/packages/services/src/api/asset/asset.d.ts +0 -1
- package/library/packages/tools/src/fetch-image/fetch-image.d.ts +10 -0
- package/library/packages/types/src/gallery-item.d.ts +1 -0
- package/library/packages/types/src/masonry.d.ts +2 -0
- package/library/packages/utils/src/transformation/transformation.d.ts +42 -7
- package/library/react-web-component.d.ts +4 -4
- package/library/utils.js +121 -120
- package/package.json +1 -1
- package/library/chunks/content-builder.BX4pHujE.js +0 -60
- package/library/chunks/transformation.CkwgrwKQ.js +0 -312
|
@@ -1,50 +1,49 @@
|
|
|
1
1
|
import "../components/cropper.js";
|
|
2
2
|
import { C as Y } from "./button.BnkkUqiI.js";
|
|
3
|
-
import
|
|
4
|
-
import { C as
|
|
5
|
-
import { n as h, C as
|
|
6
|
-
import { h as
|
|
3
|
+
import B from "../components/space.js";
|
|
4
|
+
import { C as q } from "./typography.IqHbnd3C.js";
|
|
5
|
+
import { n as h, C as j } from "./lib-cortex-element.CVMmyPMC.js";
|
|
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
|
|
8
|
+
import { i as V, x as C, E as qt } from "./lit-element.jLBm65_O.js";
|
|
9
9
|
import "./form.DSsy3Fcy.js";
|
|
10
|
-
import { L as
|
|
11
|
-
import { a as
|
|
10
|
+
import { L as G } from "./i18n.DbXTTLXx.js";
|
|
11
|
+
import { a as ae } from "./string.CfI2ejyR.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.CkEA7Ymz.js";
|
|
14
14
|
import "./unsafe-html.Dff7-rCx.js";
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import { v as
|
|
19
|
-
import { U as r, T as f } from "./asset-link-format.ClaYu_v8.js";
|
|
15
|
+
import { b as he } from "./_baseUniq.lwMgmtt2.js";
|
|
16
|
+
import { c as Q } from "./component.styles.CRO4Odto.js";
|
|
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
|
-
import { c as
|
|
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
|
|
24
|
-
import { r as
|
|
25
|
-
import { n as
|
|
26
|
-
import
|
|
27
|
-
import
|
|
28
|
-
import { C as
|
|
29
|
-
import { C as
|
|
30
|
-
import { C as
|
|
31
|
-
import { C as
|
|
32
|
-
import
|
|
33
|
-
import
|
|
34
|
-
import { c as
|
|
22
|
+
import { s as Ht, a as pt } from "./number.Cx2ncfJJ.js";
|
|
23
|
+
import { r as R } from "./state.CSDxrqLd.js";
|
|
24
|
+
import { n as M } from "./when.Dr1es41R.js";
|
|
25
|
+
import st from "../components/details.js";
|
|
26
|
+
import Vt from "../components/divider.js";
|
|
27
|
+
import { C as at } from "./icon.CpHbi8tH.js";
|
|
28
|
+
import { C as $t } from "./icon-button.CVrxJcZq.js";
|
|
29
|
+
import { C as Pt } from "./input.33UmFGqR.js";
|
|
30
|
+
import { C as vt } from "./option.B6odSlS2.js";
|
|
31
|
+
import zt from "../components/select.js";
|
|
32
|
+
import ce from "../components/position-picker.js";
|
|
33
|
+
import { c as pe } from "./image.Y5c_hFx8.js";
|
|
35
34
|
import { e as J } from "./query.BBf1UFkC.js";
|
|
36
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,320 +65,318 @@ const ce = {
|
|
|
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];
|
|
84
83
|
if (a == null)
|
|
85
84
|
continue;
|
|
86
85
|
if (s === "custom") {
|
|
87
|
-
for (const [
|
|
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
|
|
94
|
-
if (
|
|
95
|
-
if (
|
|
92
|
+
const n = fe[s];
|
|
93
|
+
if (n) {
|
|
94
|
+
if (ge.has(s)) {
|
|
96
95
|
e.push(
|
|
97
|
-
|
|
96
|
+
xe(n, a)
|
|
98
97
|
);
|
|
99
98
|
continue;
|
|
100
99
|
}
|
|
101
100
|
if (s === "color") {
|
|
102
|
-
e.push(`${
|
|
101
|
+
e.push(`${n}:${a}`);
|
|
103
102
|
continue;
|
|
104
103
|
}
|
|
105
104
|
if (s === "parentFolderIdentifier") {
|
|
106
|
-
const
|
|
107
|
-
if (
|
|
105
|
+
const o = Array.isArray(a) ? a : [a];
|
|
106
|
+
if (o.length === 0)
|
|
108
107
|
continue;
|
|
109
108
|
const l = [
|
|
110
|
-
...
|
|
111
|
-
...
|
|
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 ");
|
|
120
119
|
}
|
|
121
|
-
function
|
|
120
|
+
function dt(t) {
|
|
122
121
|
if ("and" in t)
|
|
123
|
-
return t.and.map(
|
|
122
|
+
return t.and.map(dt).filter(Boolean).join(" AND ");
|
|
124
123
|
if ("or" in t) {
|
|
125
|
-
const e = t.or.map(
|
|
124
|
+
const e = t.or.map(dt).filter(Boolean);
|
|
126
125
|
return e.length > 1 ? `(${e.join(" OR ")})` : e[0] ?? "";
|
|
127
126
|
}
|
|
128
127
|
if ("not" in t) {
|
|
129
|
-
const e =
|
|
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,
|
|
169
168
|
httpMethod: s = "GET",
|
|
170
169
|
isSiteBuilder: a,
|
|
171
|
-
pageNumber:
|
|
172
|
-
query:
|
|
170
|
+
pageNumber: n,
|
|
171
|
+
query: o,
|
|
173
172
|
securityByPassToken: l,
|
|
174
|
-
siteUrl:
|
|
175
|
-
sort:
|
|
173
|
+
siteUrl: d,
|
|
174
|
+
sort: m,
|
|
176
175
|
token: c,
|
|
177
|
-
useSession:
|
|
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
|
-
PageNumber:
|
|
185
|
-
Query:
|
|
183
|
+
PageNumber: n,
|
|
184
|
+
Query: dt(o),
|
|
186
185
|
SecurityByPassToken: l || void 0,
|
|
187
|
-
Sort:
|
|
188
|
-
UseSession:
|
|
189
|
-
},
|
|
186
|
+
Sort: m || void 0,
|
|
187
|
+
UseSession: y || void 0
|
|
188
|
+
}, x = s === "POST";
|
|
190
189
|
try {
|
|
191
|
-
return (await
|
|
192
|
-
baseURL:
|
|
190
|
+
return (await E.request({
|
|
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(
|
|
199
|
+
...Array.isArray(E.defaults.transformResponse) ? E.defaults.transformResponse : [],
|
|
201
200
|
a ? (u) => ({
|
|
202
|
-
items: (u.results?.Items ?? []).map(
|
|
201
|
+
items: (u.results?.Items ?? []).map(Ot),
|
|
203
202
|
sort: u.results?.GlobalInfo?.Sort ?? "",
|
|
204
203
|
totalCount: u.results?.GlobalInfo?.TotalCount ?? 0
|
|
205
204
|
}) : (u) => ({
|
|
206
|
-
items: (u.APIResponse?.Items ?? []).map(
|
|
205
|
+
items: (u.APIResponse?.Items ?? []).map(Ot),
|
|
207
206
|
sort: u.APIResponse?.GlobalInfo?.Sort ?? "",
|
|
208
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,
|
|
221
220
|
siteUrl: s,
|
|
222
221
|
token: a,
|
|
223
|
-
transformations:
|
|
224
|
-
useSession:
|
|
222
|
+
transformations: n,
|
|
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
|
-
Transformations:
|
|
236
|
-
UseSession:
|
|
234
|
+
Transformations: n,
|
|
235
|
+
UseSession: o || void 0
|
|
237
236
|
},
|
|
238
237
|
/**
|
|
239
238
|
* https://link.orangelogic.com/Tasks/41S1XH
|
|
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,
|
|
260
259
|
recordIds: s,
|
|
261
260
|
securityByPassToken: a,
|
|
262
|
-
token:
|
|
261
|
+
token: n
|
|
263
262
|
}) {
|
|
264
263
|
if (!Array.isArray(s) || s.length === 0)
|
|
265
264
|
return { facets: [], items: [], totalCount: 0 };
|
|
266
|
-
const
|
|
267
|
-
...
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
],
|
|
274
|
-
|
|
275
|
-
(
|
|
276
|
-
countPerPage:
|
|
265
|
+
const o = t?.filter((p) => p && typeof p == "string") ?? [], l = [
|
|
266
|
+
...o,
|
|
267
|
+
St,
|
|
268
|
+
yt,
|
|
269
|
+
Ae,
|
|
270
|
+
ve,
|
|
271
|
+
xt
|
|
272
|
+
], d = $e(s, Re), m = await Promise.all(
|
|
273
|
+
d.map(
|
|
274
|
+
(p) => Zt({
|
|
275
|
+
countPerPage: p.length,
|
|
277
276
|
fields: l,
|
|
278
277
|
getPermanentAssetsPaths: e,
|
|
279
278
|
httpMethod: i ? "GET" : "POST",
|
|
280
279
|
isSiteBuilder: i,
|
|
281
280
|
pageNumber: 1,
|
|
282
|
-
query: { recordId:
|
|
281
|
+
query: { recordId: p },
|
|
283
282
|
securityByPassToken: a,
|
|
284
|
-
token:
|
|
283
|
+
token: n
|
|
285
284
|
})
|
|
286
285
|
)
|
|
287
|
-
), c = new Map(s.map((
|
|
288
|
-
let
|
|
289
|
-
return
|
|
290
|
-
name:
|
|
291
|
-
recordId:
|
|
292
|
-
...
|
|
293
|
-
(
|
|
294
|
-
|
|
295
|
-
const
|
|
296
|
-
return
|
|
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),
|
|
291
|
+
...o.reduce(
|
|
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
|
-
(
|
|
303
|
-
),
|
|
304
|
-
(
|
|
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:
|
|
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
320
|
extraFields: i,
|
|
322
321
|
getPermanentAssetsPaths: s,
|
|
323
322
|
isSiteBuilder: a,
|
|
324
|
-
limitedDocTypes:
|
|
325
|
-
pageNumber:
|
|
323
|
+
limitedDocTypes: n,
|
|
324
|
+
pageNumber: o,
|
|
326
325
|
parentFolderIdentifier: l,
|
|
327
|
-
searchTerm:
|
|
328
|
-
securityByPassToken:
|
|
326
|
+
searchTerm: d,
|
|
327
|
+
securityByPassToken: m,
|
|
329
328
|
sortOrder: c,
|
|
330
|
-
token:
|
|
329
|
+
token: y
|
|
331
330
|
}) {
|
|
332
331
|
if (!e && !l)
|
|
333
332
|
return { facets: [], items: [], totalCount: 0 };
|
|
334
|
-
const
|
|
333
|
+
const A = (i?.filter((u) => u && typeof u == "string") ?? []).map((u) => u.replace("%20", " ")), p = {
|
|
335
334
|
directParentFolderIdentifier: e,
|
|
336
335
|
parentFolderIdentifier: l,
|
|
337
|
-
...
|
|
338
|
-
},
|
|
336
|
+
...n && n.length > 0 ? { docType: n } : {}
|
|
337
|
+
}, x = await Zt({
|
|
339
338
|
countPerPage: t,
|
|
340
339
|
fields: [
|
|
341
|
-
...
|
|
342
|
-
|
|
343
|
-
|
|
340
|
+
...A,
|
|
341
|
+
Xt,
|
|
342
|
+
gt,
|
|
343
|
+
ft,
|
|
344
|
+
mt,
|
|
344
345
|
ut,
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
ct,
|
|
348
|
-
Wt,
|
|
349
|
-
Ht,
|
|
346
|
+
Nt,
|
|
347
|
+
Dt,
|
|
350
348
|
rt,
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
349
|
+
xt,
|
|
350
|
+
yt,
|
|
351
|
+
St
|
|
354
352
|
],
|
|
355
353
|
getPermanentAssetsPaths: s,
|
|
356
354
|
isSiteBuilder: a,
|
|
357
|
-
pageNumber:
|
|
358
|
-
query:
|
|
359
|
-
securityByPassToken:
|
|
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:
|
|
365
|
+
docSubType: _(u, Nt),
|
|
366
|
+
docType: _(u, ut) || "",
|
|
367
|
+
extension: w,
|
|
368
|
+
height: _(u, ft) || "0",
|
|
369
|
+
id: F,
|
|
370
|
+
identifier: _(u, Dt),
|
|
373
371
|
name: D,
|
|
374
|
-
recordId:
|
|
375
|
-
size:
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
return K !== void 0 && (at[`${et}${$t}`] = String(K)), at;
|
|
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;
|
|
383
380
|
},
|
|
384
381
|
{}
|
|
385
382
|
)
|
|
@@ -387,11 +384,11 @@ async function be({
|
|
|
387
384
|
});
|
|
388
385
|
return {
|
|
389
386
|
facets: [],
|
|
390
|
-
items:
|
|
391
|
-
totalCount:
|
|
387
|
+
items: b,
|
|
388
|
+
totalCount: x.totalCount
|
|
392
389
|
};
|
|
393
390
|
}
|
|
394
|
-
async function
|
|
391
|
+
async function _e({
|
|
395
392
|
autoCropMode: t,
|
|
396
393
|
cropHeight: e,
|
|
397
394
|
cropWidth: i,
|
|
@@ -399,7 +396,7 @@ async function ke({
|
|
|
399
396
|
useSession: a
|
|
400
397
|
}) {
|
|
401
398
|
try {
|
|
402
|
-
return (await
|
|
399
|
+
return (await E.request({
|
|
403
400
|
method: "GET",
|
|
404
401
|
params: {
|
|
405
402
|
AutoCropMode: t,
|
|
@@ -412,21 +409,21 @@ async function ke({
|
|
|
412
409
|
timeout: 3e5,
|
|
413
410
|
// 5 minutes
|
|
414
411
|
transformResponse: [
|
|
415
|
-
...Array.isArray(
|
|
416
|
-
(
|
|
417
|
-
height:
|
|
418
|
-
width:
|
|
419
|
-
x:
|
|
420
|
-
y:
|
|
412
|
+
...Array.isArray(E.defaults.transformResponse) ? E.defaults.transformResponse : [],
|
|
413
|
+
(o) => ({
|
|
414
|
+
height: o.cropHeight,
|
|
415
|
+
width: o.cropWidth,
|
|
416
|
+
x: o.cropX,
|
|
417
|
+
y: o.cropY
|
|
421
418
|
})
|
|
422
419
|
],
|
|
423
|
-
url:
|
|
420
|
+
url: Ut.GET_CROP_ZONE_SUGGESTION
|
|
424
421
|
})).data;
|
|
425
422
|
} catch {
|
|
426
423
|
return null;
|
|
427
424
|
}
|
|
428
425
|
}
|
|
429
|
-
async function
|
|
426
|
+
async function Vi({
|
|
430
427
|
assetRecordId: t,
|
|
431
428
|
isSiteBuilder: e,
|
|
432
429
|
siteUrl: i,
|
|
@@ -434,7 +431,7 @@ async function Ui({
|
|
|
434
431
|
useSession: a
|
|
435
432
|
}) {
|
|
436
433
|
try {
|
|
437
|
-
return (await
|
|
434
|
+
return (await E.request({
|
|
438
435
|
baseURL: i,
|
|
439
436
|
method: "GET",
|
|
440
437
|
params: {
|
|
@@ -444,8 +441,8 @@ async function Ui({
|
|
|
444
441
|
},
|
|
445
442
|
responseType: "json",
|
|
446
443
|
transformResponse: [
|
|
447
|
-
...Array.isArray(
|
|
448
|
-
(
|
|
444
|
+
...Array.isArray(E.defaults.transformResponse) ? E.defaults.transformResponse : [],
|
|
445
|
+
(o) => !o || typeof o != "object" ? [] : o.proxies?.map((l) => ({
|
|
449
446
|
cdnName: l.cdnName,
|
|
450
447
|
extension: l.extension,
|
|
451
448
|
formatHeight: l.formatHeight,
|
|
@@ -457,22 +454,22 @@ async function Ui({
|
|
|
457
454
|
width: l.width
|
|
458
455
|
})) ?? []
|
|
459
456
|
],
|
|
460
|
-
url: e ?
|
|
457
|
+
url: e ? Bt.GET_AVAILABLE_PROXIES : se
|
|
461
458
|
})).data;
|
|
462
459
|
} catch {
|
|
463
460
|
return [];
|
|
464
461
|
}
|
|
465
462
|
}
|
|
466
|
-
async function
|
|
463
|
+
async function Gi({
|
|
467
464
|
siteUrl: t
|
|
468
465
|
} = {}) {
|
|
469
466
|
try {
|
|
470
|
-
return (await
|
|
467
|
+
return (await E.request({
|
|
471
468
|
baseURL: t,
|
|
472
469
|
method: "GET",
|
|
473
470
|
responseType: "json",
|
|
474
471
|
transformResponse: [
|
|
475
|
-
...Array.isArray(
|
|
472
|
+
...Array.isArray(E.defaults.transformResponse) ? E.defaults.transformResponse : [],
|
|
476
473
|
(i) => !i || typeof i != "object" ? {
|
|
477
474
|
formatsByDocType: {
|
|
478
475
|
Audio: {},
|
|
@@ -484,13 +481,13 @@ async function Bi({
|
|
|
484
481
|
formatsByDocType: i.formatsByDocType ?? {}
|
|
485
482
|
}
|
|
486
483
|
],
|
|
487
|
-
url:
|
|
484
|
+
url: ee
|
|
488
485
|
})).data;
|
|
489
486
|
} catch {
|
|
490
487
|
return { formatsByDocType: {} };
|
|
491
488
|
}
|
|
492
489
|
}
|
|
493
|
-
async function
|
|
490
|
+
async function Qi({
|
|
494
491
|
recordIds: t,
|
|
495
492
|
rightsToCheck: e
|
|
496
493
|
}) {
|
|
@@ -501,19 +498,19 @@ async function qi({
|
|
|
501
498
|
invalidObjects: []
|
|
502
499
|
};
|
|
503
500
|
try {
|
|
504
|
-
const { data: s } = await
|
|
501
|
+
const { data: s } = await E.request({
|
|
505
502
|
method: "GET",
|
|
506
503
|
params: { RecordIDs: t, RightsToCheck: e },
|
|
507
504
|
paramsSerializer: { indexes: null },
|
|
508
505
|
responseType: "json",
|
|
509
|
-
url:
|
|
506
|
+
url: ie.GET_AUTHORIZED_OBJECTS
|
|
510
507
|
});
|
|
511
508
|
return s;
|
|
512
509
|
} catch {
|
|
513
510
|
return i;
|
|
514
511
|
}
|
|
515
512
|
}
|
|
516
|
-
const
|
|
513
|
+
const bt = 20, it = "TR1", At = "TRX", Me = /* @__PURE__ */ new Set([".gif"]), Ie = /* @__PURE__ */ new Set([
|
|
517
514
|
".avif",
|
|
518
515
|
".bmp",
|
|
519
516
|
".gif",
|
|
@@ -524,32 +521,52 @@ const vt = 20, wt = "TR1", bt = "TRX", Re = /* @__PURE__ */ new Set([".gif"]), $
|
|
|
524
521
|
".svg",
|
|
525
522
|
".webp"
|
|
526
523
|
]);
|
|
527
|
-
function
|
|
524
|
+
function Jt(t) {
|
|
528
525
|
const e = t.toLowerCase(), i = e.startsWith(".") ? e : `.${e}`;
|
|
529
|
-
return
|
|
526
|
+
return Ie.has(i);
|
|
530
527
|
}
|
|
531
|
-
function
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
528
|
+
function Lt({
|
|
529
|
+
autoFormat: t,
|
|
530
|
+
extension: e,
|
|
531
|
+
format: i,
|
|
532
|
+
item: s,
|
|
533
|
+
manualFormat: a,
|
|
534
|
+
size: n
|
|
537
535
|
}) {
|
|
538
|
-
const o =
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
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
|
+
};
|
|
553
|
+
};
|
|
554
|
+
if (!a) {
|
|
555
|
+
const p = jt(o, n), x = `path_${p}`;
|
|
556
|
+
return m(x, p) ?? m(d, it) ?? {};
|
|
557
|
+
}
|
|
558
|
+
if (!!o && Me.has(l))
|
|
559
|
+
return m(`path_${At}`, At) ?? m(d, it) ?? {};
|
|
560
|
+
const y = !o || Jt(o), A = i ? `path_${i}` : void 0;
|
|
561
|
+
return A && y && s[A] ? m(A, i) ?? {} : m(d, it) ?? {};
|
|
545
562
|
}
|
|
546
|
-
class
|
|
563
|
+
class Xi {
|
|
547
564
|
constructor(e, i) {
|
|
548
|
-
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);
|
|
549
566
|
const s = i?.maxEnd;
|
|
550
567
|
this.maxEnd = typeof s == "number" && Number.isFinite(s) && s >= 0 ? Math.floor(s) : 1 / 0;
|
|
551
568
|
const a = i?.pageSize;
|
|
552
|
-
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;
|
|
553
570
|
}
|
|
554
571
|
get totalDataCount() {
|
|
555
572
|
return this.totalCount;
|
|
@@ -567,7 +584,7 @@ class ji {
|
|
|
567
584
|
* Shrinking is ignored once pages are cached: collapsing already has what it needs.
|
|
568
585
|
*/
|
|
569
586
|
setPageSize(e) {
|
|
570
|
-
const i = Number.isFinite(e) && e >= 1 ? Math.floor(e) :
|
|
587
|
+
const i = Number.isFinite(e) && e >= 1 ? Math.floor(e) : bt;
|
|
571
588
|
if (this.pageSize === i)
|
|
572
589
|
return;
|
|
573
590
|
const s = this.fetchedPages.size > 0;
|
|
@@ -578,33 +595,34 @@ class ji {
|
|
|
578
595
|
extraFields: i = [],
|
|
579
596
|
format: s,
|
|
580
597
|
manualFormat: a = !0,
|
|
581
|
-
start:
|
|
582
|
-
transformations:
|
|
598
|
+
start: n,
|
|
599
|
+
transformations: o
|
|
583
600
|
}) {
|
|
584
|
-
if (e <
|
|
601
|
+
if (e < n)
|
|
585
602
|
return this.data;
|
|
586
|
-
if (this.totalCount > 0 && e >= this.totalCount && (e = this.totalCount - 1, e <
|
|
603
|
+
if (this.totalCount > 0 && e >= this.totalCount && (e = this.totalCount - 1, e < n))
|
|
587
604
|
return this.data;
|
|
588
605
|
const l = this.requestEpoch;
|
|
589
606
|
if (!this.folderId || l !== this.requestEpoch)
|
|
590
607
|
return this.data;
|
|
591
|
-
const
|
|
608
|
+
const d = s ? `path_${s}` : void 0, m = `path_${it}`, c = `path_${At}`, y = [
|
|
592
609
|
...new Set(
|
|
593
|
-
[
|
|
594
|
-
(
|
|
610
|
+
[d, m, c].filter(
|
|
611
|
+
(x) => !!x
|
|
595
612
|
)
|
|
596
613
|
)
|
|
597
|
-
],
|
|
598
|
-
for (let
|
|
599
|
-
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))
|
|
600
617
|
continue;
|
|
601
|
-
const
|
|
618
|
+
const b = await Fe({
|
|
602
619
|
countPerPage: this.pageSize,
|
|
603
620
|
directParentFolderIdentifier: this.folderId,
|
|
604
|
-
extraFields: [...i, ...
|
|
621
|
+
extraFields: [...i, ...y],
|
|
605
622
|
getPermanentAssetsPaths: !0,
|
|
606
623
|
isSiteBuilder: this.isSiteBuilder,
|
|
607
|
-
|
|
624
|
+
limitedDocTypes: [ct.Image, ct.Audio, ct.Video, ct.Multimedia],
|
|
625
|
+
pageNumber: x,
|
|
608
626
|
searchTerm: "",
|
|
609
627
|
securityByPassToken: this.securityByPassToken,
|
|
610
628
|
sortOrder: "",
|
|
@@ -612,37 +630,43 @@ class ji {
|
|
|
612
630
|
});
|
|
613
631
|
if (l !== this.requestEpoch)
|
|
614
632
|
return this.data;
|
|
615
|
-
if (this.fetchedPages.add(
|
|
616
|
-
const
|
|
617
|
-
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 }, () => ({
|
|
618
636
|
alt: "",
|
|
619
|
-
id: `temp-${
|
|
637
|
+
id: `temp-${le()}`,
|
|
620
638
|
name: "",
|
|
621
639
|
src: ""
|
|
622
640
|
}));
|
|
623
641
|
}
|
|
624
|
-
const u = (
|
|
625
|
-
for (let
|
|
626
|
-
const D = u +
|
|
642
|
+
const u = (x - 1) * this.pageSize;
|
|
643
|
+
for (let w = 0; w < b.items.length; w++) {
|
|
644
|
+
const D = u + w;
|
|
627
645
|
if (D < this.data.length) {
|
|
628
|
-
const
|
|
629
|
-
|
|
646
|
+
const F = b.items[w], {
|
|
647
|
+
maxWidth: L,
|
|
648
|
+
src: et,
|
|
649
|
+
srcset: nt
|
|
650
|
+
} = Lt({
|
|
651
|
+
autoFormat: this.autoFormat,
|
|
652
|
+
extension: F.extension,
|
|
630
653
|
format: s,
|
|
631
|
-
item:
|
|
654
|
+
item: F,
|
|
632
655
|
manualFormat: a,
|
|
633
|
-
size:
|
|
656
|
+
size: F.size
|
|
634
657
|
});
|
|
635
|
-
let
|
|
636
|
-
|
|
637
|
-
alt:
|
|
638
|
-
docType:
|
|
639
|
-
extension:
|
|
640
|
-
id:
|
|
641
|
-
maxWidth:
|
|
642
|
-
name:
|
|
643
|
-
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,
|
|
644
668
|
...i.reduce(
|
|
645
|
-
(
|
|
669
|
+
(It, Et) => (It[Et] = F[Et] ?? "", It),
|
|
646
670
|
{}
|
|
647
671
|
)
|
|
648
672
|
};
|
|
@@ -655,85 +679,91 @@ class ji {
|
|
|
655
679
|
extraFields: i = [],
|
|
656
680
|
folderId: s,
|
|
657
681
|
forceRefetch: a = !1,
|
|
658
|
-
format:
|
|
659
|
-
manualFormat:
|
|
682
|
+
format: n,
|
|
683
|
+
manualFormat: o = !0,
|
|
660
684
|
minLimit: l = 5,
|
|
661
|
-
noPlaceholders:
|
|
662
|
-
transformations:
|
|
685
|
+
noPlaceholders: d = !1,
|
|
686
|
+
transformations: m
|
|
663
687
|
}) {
|
|
664
688
|
(!this.folderId || this.folderId !== s) && (this.folderId = s, this.resetFolderState()), a && this.resetPageCache();
|
|
665
|
-
const c = Math.max(5, l),
|
|
689
|
+
const c = Math.max(5, l), y = e, A = e + c, p = [
|
|
666
690
|
...i,
|
|
667
|
-
|
|
668
|
-
|
|
691
|
+
ft,
|
|
692
|
+
gt
|
|
669
693
|
];
|
|
670
694
|
await this.fetchImages({
|
|
671
|
-
end:
|
|
672
|
-
extraFields:
|
|
673
|
-
format:
|
|
674
|
-
manualFormat:
|
|
675
|
-
start:
|
|
676
|
-
transformations:
|
|
695
|
+
end: A,
|
|
696
|
+
extraFields: p.filter((u) => u !== ""),
|
|
697
|
+
format: n,
|
|
698
|
+
manualFormat: o,
|
|
699
|
+
start: y,
|
|
700
|
+
transformations: m
|
|
677
701
|
});
|
|
678
|
-
let
|
|
679
|
-
|
|
680
|
-
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;
|
|
681
705
|
return await this.fetchImages({
|
|
682
|
-
end:
|
|
683
|
-
extraFields:
|
|
684
|
-
format:
|
|
685
|
-
manualFormat:
|
|
686
|
-
start:
|
|
687
|
-
transformations:
|
|
688
|
-
}),
|
|
706
|
+
end: b,
|
|
707
|
+
extraFields: p.filter((u) => u !== ""),
|
|
708
|
+
format: n,
|
|
709
|
+
manualFormat: o,
|
|
710
|
+
start: x,
|
|
711
|
+
transformations: m
|
|
712
|
+
}), d ? this.data.filter((u) => u.id && !u.id.startsWith("temp-")) : this.data;
|
|
689
713
|
}
|
|
690
714
|
async fetchImagesByIDs({
|
|
691
715
|
extraFields: e = [],
|
|
692
716
|
format: i,
|
|
693
717
|
manualFormat: s = !0,
|
|
694
718
|
recordIds: a,
|
|
695
|
-
transformations:
|
|
719
|
+
transformations: n
|
|
696
720
|
}) {
|
|
697
721
|
if (a.length === 0)
|
|
698
722
|
return [];
|
|
699
|
-
const
|
|
723
|
+
const o = i ? `path_${i}` : void 0, l = `path_${it}`, d = `path_${At}`, m = [
|
|
700
724
|
...new Set(
|
|
701
|
-
[
|
|
702
|
-
(
|
|
725
|
+
[o, l, d].filter(
|
|
726
|
+
(p) => !!p
|
|
703
727
|
)
|
|
704
728
|
)
|
|
705
|
-
], c = [rt,
|
|
729
|
+
], c = [rt, mt], y = [
|
|
706
730
|
...e,
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
731
|
+
ut,
|
|
732
|
+
ft,
|
|
733
|
+
gt
|
|
710
734
|
];
|
|
711
|
-
return (await
|
|
712
|
-
extraFields: [...
|
|
735
|
+
return (await Pe({
|
|
736
|
+
extraFields: [...y, ...m, ...c].filter((p) => p !== ""),
|
|
713
737
|
getPermanentAssetsPaths: !0,
|
|
714
738
|
isSiteBuilder: this.isSiteBuilder,
|
|
715
739
|
recordIds: a,
|
|
716
740
|
securityByPassToken: this.securityByPassToken,
|
|
717
741
|
token: this.authToken
|
|
718
|
-
})).items.map((
|
|
719
|
-
const {
|
|
720
|
-
|
|
742
|
+
})).items.map((p) => {
|
|
743
|
+
const {
|
|
744
|
+
maxWidth: x,
|
|
745
|
+
src: b,
|
|
746
|
+
srcset: u
|
|
747
|
+
} = Lt({
|
|
748
|
+
autoFormat: this.autoFormat,
|
|
749
|
+
extension: p[rt],
|
|
721
750
|
format: i,
|
|
722
|
-
item:
|
|
751
|
+
item: p,
|
|
723
752
|
manualFormat: s,
|
|
724
|
-
size:
|
|
753
|
+
size: p[mt]
|
|
725
754
|
});
|
|
726
|
-
let
|
|
727
|
-
return
|
|
728
|
-
alt:
|
|
729
|
-
docType:
|
|
730
|
-
extension:
|
|
731
|
-
id:
|
|
732
|
-
maxWidth:
|
|
733
|
-
name:
|
|
734
|
-
src:
|
|
735
|
-
|
|
736
|
-
|
|
755
|
+
let w = b, D = u;
|
|
756
|
+
return w && n && n.length > 0 && (w = Tt(w, n), D = ""), {
|
|
757
|
+
alt: p.name,
|
|
758
|
+
docType: p[ut],
|
|
759
|
+
extension: p[rt] || "",
|
|
760
|
+
id: p.recordId,
|
|
761
|
+
maxWidth: x,
|
|
762
|
+
name: p.name,
|
|
763
|
+
src: w,
|
|
764
|
+
srcset: D,
|
|
765
|
+
...y.reduce(
|
|
766
|
+
(F, L) => (F[L] = p[L] ?? "", F),
|
|
737
767
|
{}
|
|
738
768
|
)
|
|
739
769
|
};
|
|
@@ -744,63 +774,63 @@ class ji {
|
|
|
744
774
|
folderId: i,
|
|
745
775
|
forceRefetch: s = !1,
|
|
746
776
|
format: a,
|
|
747
|
-
manualFormat:
|
|
748
|
-
noPlaceholders:
|
|
777
|
+
manualFormat: n = !0,
|
|
778
|
+
noPlaceholders: o = !1,
|
|
749
779
|
page: l,
|
|
750
|
-
pageSize:
|
|
751
|
-
transformations:
|
|
780
|
+
pageSize: d = 10,
|
|
781
|
+
transformations: m
|
|
752
782
|
}) {
|
|
753
783
|
(!this.folderId || this.folderId !== i) && (this.folderId = i, this.resetFolderState()), s && this.resetPageCache();
|
|
754
|
-
const c = l *
|
|
784
|
+
const c = l * d, y = c + d - 1;
|
|
755
785
|
return await this.fetchImages({
|
|
756
|
-
end:
|
|
786
|
+
end: y,
|
|
757
787
|
extraFields: e,
|
|
758
788
|
format: a,
|
|
759
|
-
manualFormat:
|
|
789
|
+
manualFormat: n,
|
|
760
790
|
start: c,
|
|
761
|
-
transformations:
|
|
762
|
-
}),
|
|
791
|
+
transformations: m
|
|
792
|
+
}), o ? this.data.filter((A) => A.id && !A.id.startsWith("temp-")) : this.data;
|
|
763
793
|
}
|
|
764
794
|
async *fetchImagesInFolderByChunk({
|
|
765
795
|
chunkSize: e = 10,
|
|
766
796
|
end: i = 0,
|
|
767
797
|
extraFields: s = [],
|
|
768
798
|
folderId: a,
|
|
769
|
-
forceRefetch:
|
|
770
|
-
format:
|
|
799
|
+
forceRefetch: n = !1,
|
|
800
|
+
format: o,
|
|
771
801
|
manualFormat: l = !0,
|
|
772
|
-
start:
|
|
773
|
-
transformations:
|
|
802
|
+
start: d = 0,
|
|
803
|
+
transformations: m
|
|
774
804
|
}) {
|
|
775
805
|
const c = Math.max(1, e);
|
|
776
|
-
if ((!this.folderId || this.folderId !== a) && (this.folderId = a, this.resetFolderState()),
|
|
806
|
+
if ((!this.folderId || this.folderId !== a) && (this.folderId = a, this.resetFolderState()), n && this.resetPageCache(), i !== -1) {
|
|
777
807
|
await this.fetchImages({
|
|
778
808
|
end: i,
|
|
779
809
|
extraFields: s,
|
|
780
|
-
format:
|
|
810
|
+
format: o,
|
|
781
811
|
manualFormat: l,
|
|
782
|
-
start:
|
|
783
|
-
transformations:
|
|
812
|
+
start: d,
|
|
813
|
+
transformations: m
|
|
784
814
|
}), yield this.data;
|
|
785
815
|
return;
|
|
786
816
|
}
|
|
787
|
-
let
|
|
817
|
+
let y = d, A = d + c;
|
|
788
818
|
if (await this.fetchImages({
|
|
789
|
-
end:
|
|
819
|
+
end: A,
|
|
790
820
|
extraFields: s,
|
|
791
|
-
format:
|
|
821
|
+
format: o,
|
|
792
822
|
manualFormat: l,
|
|
793
|
-
start:
|
|
794
|
-
transformations:
|
|
795
|
-
}), yield this.data, !(!this.totalCount || this.totalCount <=
|
|
796
|
-
for (;
|
|
797
|
-
|
|
798
|
-
end:
|
|
823
|
+
start: y,
|
|
824
|
+
transformations: m
|
|
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,
|
|
799
829
|
extraFields: s,
|
|
800
|
-
format:
|
|
830
|
+
format: o,
|
|
801
831
|
manualFormat: l,
|
|
802
|
-
start:
|
|
803
|
-
transformations:
|
|
832
|
+
start: y,
|
|
833
|
+
transformations: m
|
|
804
834
|
}), yield this.data;
|
|
805
835
|
}
|
|
806
836
|
hostConnected() {
|
|
@@ -815,15 +845,15 @@ class ji {
|
|
|
815
845
|
this.resetPageCache();
|
|
816
846
|
}
|
|
817
847
|
}
|
|
818
|
-
const
|
|
819
|
-
var
|
|
820
|
-
for (var a = s > 1 ? void 0 : s ?
|
|
821
|
-
(
|
|
822
|
-
return s && a &&
|
|
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--)
|
|
851
|
+
(o = t[n]) && (a = (s ? o(e, i, a) : o(a)) || a);
|
|
852
|
+
return s && a && He(e, i, a), a;
|
|
823
853
|
};
|
|
824
|
-
let v = class extends
|
|
854
|
+
let v = class extends j {
|
|
825
855
|
constructor() {
|
|
826
|
-
super(...arguments), this.localize = new
|
|
856
|
+
super(...arguments), this.localize = new G(this), this.open = !1, this.width = 0, this.height = 0, this.maxWidth = 0, this.maxHeight = 0, this.ratioWidth = 1, this.ratioHeight = 1, this.percentageWidth = 0, this.percentageHeight = 0, this.unit = r.Pixel, this.disabledApply = !1, this.noRatioModes = !1, this.showPositionPicker = !1, this.lastAppliedSetting = {
|
|
827
857
|
[r.Pixel]: {
|
|
828
858
|
height: 0,
|
|
829
859
|
percentageHeight: 100,
|
|
@@ -934,19 +964,19 @@ let v = class extends q {
|
|
|
934
964
|
else if (!i) {
|
|
935
965
|
const [s, a] = e.split(":").map(Number);
|
|
936
966
|
if (this.unit === r.Pixel) {
|
|
937
|
-
let
|
|
938
|
-
Number.isFinite(this.maxWidth) && Number.isFinite(this.maxHeight) && ({ height:
|
|
967
|
+
let n = s, o = a;
|
|
968
|
+
Number.isFinite(this.maxWidth) && Number.isFinite(this.maxHeight) && ({ height: o, width: n } = pe(
|
|
939
969
|
this.maxWidth,
|
|
940
970
|
this.maxHeight,
|
|
941
971
|
s,
|
|
942
972
|
a
|
|
943
973
|
)), this.emit("cx-asset-link-format-crop-change", {
|
|
944
974
|
detail: {
|
|
945
|
-
height:
|
|
975
|
+
height: o,
|
|
946
976
|
keepAspectRatio: !0,
|
|
947
977
|
silent: !0,
|
|
948
978
|
unit: r.Pixel,
|
|
949
|
-
width:
|
|
979
|
+
width: n
|
|
950
980
|
}
|
|
951
981
|
});
|
|
952
982
|
} else
|
|
@@ -1053,7 +1083,7 @@ let v = class extends q {
|
|
|
1053
1083
|
}
|
|
1054
1084
|
render() {
|
|
1055
1085
|
const t = this.cropModes.filter((i) => !i.auto), e = this.cropModes.filter((i) => i.auto);
|
|
1056
|
-
return C`<cx-details class="details" ?open=${this.open} @cx-show=${this.onShowDetails} @cx-hide=${this.onHideDetails}><cx-space slot="summary" align-items="center"><div part="icon"><cx-icon name="crop"></cx-icon></div><cx-typography variant="body2">${this.localize.term("crop")}</cx-typography></cx-space><cx-space direction="vertical" spacing="small">${
|
|
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(
|
|
1057
1087
|
!this.noRatioModes,
|
|
1058
1088
|
() => C`<cx-select data-testid="cx-asset-link-format-crop-mode" value=${this.cropMode} hoist style=${O({
|
|
1059
1089
|
width: "100%"
|
|
@@ -1062,7 +1092,7 @@ let v = class extends q {
|
|
|
1062
1092
|
(i) => i.value,
|
|
1063
1093
|
({ label: i, value: s }) => C`<cx-option value=${s}>${i}</cx-option>`
|
|
1064
1094
|
)}
|
|
1065
|
-
${
|
|
1095
|
+
${M(
|
|
1066
1096
|
e.length > 0,
|
|
1067
1097
|
() => C`<cx-divider></cx-divider><small>${this.localize.term("autoCropping")}</small>`
|
|
1068
1098
|
)}
|
|
@@ -1077,10 +1107,10 @@ let v = class extends q {
|
|
|
1077
1107
|
color: this.keepAspectRatio ? "var(--cx-color-primary)" : void 0
|
|
1078
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">
|
|
1079
1109
|
H
|
|
1080
|
-
</cx-typography></cx-input></div>${
|
|
1110
|
+
</cx-typography></cx-input></div>${M(
|
|
1081
1111
|
!this.noRatioModes,
|
|
1082
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>`
|
|
1083
|
-
)}</cx-space>${
|
|
1113
|
+
)}</cx-space>${M(
|
|
1084
1114
|
this.focusModes.length > 0,
|
|
1085
1115
|
() => C`<cx-select data-testid="cx-asset-link-format-crop-focus-mode" value=${this.focusMode} hoist style=${O({
|
|
1086
1116
|
width: "100%"
|
|
@@ -1090,7 +1120,7 @@ let v = class extends q {
|
|
|
1090
1120
|
({ label: i, value: s }) => C`<cx-option value=${s}>${i}</cx-option>`
|
|
1091
1121
|
)}</cx-select>`
|
|
1092
1122
|
)}
|
|
1093
|
-
${
|
|
1123
|
+
${M(
|
|
1094
1124
|
this.showPositionPicker && this.focusMode === "manual",
|
|
1095
1125
|
() => C`<cx-position-picker data-testid="cx-asset-link-format-crop-position" value=${this.position} @cx-change=${this.onPositionChange}></cx-position-picker>`
|
|
1096
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({
|
|
@@ -1098,19 +1128,19 @@ let v = class extends q {
|
|
|
1098
1128
|
})} @click=${this.handleApply}>${this.localize.term("apply")}</cx-button></cx-space></cx-details>`;
|
|
1099
1129
|
}
|
|
1100
1130
|
};
|
|
1101
|
-
v.styles = [
|
|
1131
|
+
v.styles = [Q, Te];
|
|
1102
1132
|
v.dependencies = {
|
|
1103
1133
|
"cx-button": Y,
|
|
1104
|
-
"cx-details":
|
|
1105
|
-
"cx-divider":
|
|
1106
|
-
"cx-icon":
|
|
1107
|
-
"cx-icon-button":
|
|
1108
|
-
"cx-input":
|
|
1109
|
-
"cx-option":
|
|
1110
|
-
"cx-position-picker":
|
|
1111
|
-
"cx-select":
|
|
1112
|
-
"cx-space":
|
|
1113
|
-
"cx-typography":
|
|
1134
|
+
"cx-details": st,
|
|
1135
|
+
"cx-divider": Vt,
|
|
1136
|
+
"cx-icon": at,
|
|
1137
|
+
"cx-icon-button": $t,
|
|
1138
|
+
"cx-input": Pt,
|
|
1139
|
+
"cx-option": vt,
|
|
1140
|
+
"cx-position-picker": ce,
|
|
1141
|
+
"cx-select": zt,
|
|
1142
|
+
"cx-space": B,
|
|
1143
|
+
"cx-typography": q
|
|
1114
1144
|
};
|
|
1115
1145
|
z([
|
|
1116
1146
|
J(".details")
|
|
@@ -1182,13 +1212,13 @@ z([
|
|
|
1182
1212
|
h({ attribute: "keep-aspect-ratio", reflect: !0, type: Boolean })
|
|
1183
1213
|
], v.prototype, "keepAspectRatio", 2);
|
|
1184
1214
|
z([
|
|
1185
|
-
|
|
1215
|
+
R()
|
|
1186
1216
|
], v.prototype, "invalidWidth", 2);
|
|
1187
1217
|
z([
|
|
1188
|
-
|
|
1218
|
+
R()
|
|
1189
1219
|
], v.prototype, "invalidHeight", 2);
|
|
1190
1220
|
z([
|
|
1191
|
-
|
|
1221
|
+
R()
|
|
1192
1222
|
], v.prototype, "aspectRatio", 2);
|
|
1193
1223
|
z([
|
|
1194
1224
|
P("cropMode", { waitUntilFirstUpdate: !0 }),
|
|
@@ -1200,17 +1230,17 @@ z([
|
|
|
1200
1230
|
P("open", { waitUntilFirstUpdate: !0 })
|
|
1201
1231
|
], v.prototype, "handleOpenChange", 1);
|
|
1202
1232
|
v = z([
|
|
1203
|
-
|
|
1233
|
+
X("cx-asset-link-format-crop")
|
|
1204
1234
|
], v);
|
|
1205
|
-
const
|
|
1206
|
-
var
|
|
1207
|
-
for (var a = s > 1 ? void 0 : s ?
|
|
1208
|
-
(
|
|
1209
|
-
return s && a &&
|
|
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--)
|
|
1238
|
+
(o = t[n]) && (a = (s ? o(e, i, a) : o(a)) || a);
|
|
1239
|
+
return s && a && Ne(e, i, a), a;
|
|
1210
1240
|
};
|
|
1211
|
-
let Z = class extends
|
|
1241
|
+
let Z = class extends j {
|
|
1212
1242
|
constructor() {
|
|
1213
|
-
super(...arguments), this.localize = new
|
|
1243
|
+
super(...arguments), this.localize = new G(this), this.value = "", this.items = [];
|
|
1214
1244
|
}
|
|
1215
1245
|
handleExtensionChange(t) {
|
|
1216
1246
|
const e = t.target.value;
|
|
@@ -1226,39 +1256,39 @@ let Z = class extends q {
|
|
|
1226
1256
|
)}</cx-select></cx-space>`;
|
|
1227
1257
|
}
|
|
1228
1258
|
};
|
|
1229
|
-
Z.styles = [
|
|
1259
|
+
Z.styles = [Q, De];
|
|
1230
1260
|
Z.dependencies = {
|
|
1231
|
-
"cx-option":
|
|
1232
|
-
"cx-select":
|
|
1233
|
-
"cx-space":
|
|
1234
|
-
"cx-typography":
|
|
1261
|
+
"cx-option": vt,
|
|
1262
|
+
"cx-select": zt,
|
|
1263
|
+
"cx-space": B,
|
|
1264
|
+
"cx-typography": q
|
|
1235
1265
|
};
|
|
1236
|
-
|
|
1266
|
+
_t([
|
|
1237
1267
|
h({ reflect: !0, type: String })
|
|
1238
1268
|
], Z.prototype, "value", 2);
|
|
1239
|
-
|
|
1269
|
+
_t([
|
|
1240
1270
|
h({ reflect: !1, type: Array })
|
|
1241
1271
|
], Z.prototype, "items", 2);
|
|
1242
|
-
Z =
|
|
1243
|
-
|
|
1272
|
+
Z = _t([
|
|
1273
|
+
X("cx-asset-link-format-extension")
|
|
1244
1274
|
], Z);
|
|
1245
|
-
const
|
|
1246
|
-
var
|
|
1247
|
-
for (var a = s > 1 ? void 0 : s ?
|
|
1248
|
-
(
|
|
1249
|
-
return s && a &&
|
|
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--)
|
|
1278
|
+
(o = t[n]) && (a = (s ? o(e, i, a) : o(a)) || a);
|
|
1279
|
+
return s && a && Ue(e, i, a), a;
|
|
1250
1280
|
};
|
|
1251
|
-
const
|
|
1252
|
-
let
|
|
1281
|
+
const kt = "auto";
|
|
1282
|
+
let I = class extends j {
|
|
1253
1283
|
constructor() {
|
|
1254
|
-
super(...arguments), this.localize = new
|
|
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 = "";
|
|
1255
1285
|
}
|
|
1256
1286
|
/**
|
|
1257
1287
|
* The listbox value that represents the committed choice: the `Auto` entry when that is
|
|
1258
1288
|
* active, otherwise the resolved proxy id.
|
|
1259
1289
|
*/
|
|
1260
1290
|
get committedValue() {
|
|
1261
|
-
return this.autoFormat ?
|
|
1291
|
+
return this.autoFormat ? kt : this.value;
|
|
1262
1292
|
}
|
|
1263
1293
|
handleValueChange() {
|
|
1264
1294
|
this.scopedValue = this.committedValue;
|
|
@@ -1278,7 +1308,7 @@ let M = class extends q {
|
|
|
1278
1308
|
handleApply() {
|
|
1279
1309
|
if (this.loading)
|
|
1280
1310
|
return;
|
|
1281
|
-
if (this.scopedValue ===
|
|
1311
|
+
if (this.scopedValue === kt) {
|
|
1282
1312
|
this.emit("cx-asset-link-format-proxy-change", {
|
|
1283
1313
|
detail: { autoFormat: !0 }
|
|
1284
1314
|
});
|
|
@@ -1313,69 +1343,69 @@ let M = class extends q {
|
|
|
1313
1343
|
(t) => t.id,
|
|
1314
1344
|
(t) => C`<cx-option value=${t.id}>${t.proxyLabel}</cx-option>`
|
|
1315
1345
|
)}
|
|
1316
|
-
${
|
|
1346
|
+
${M(
|
|
1317
1347
|
this.canAutoFormat,
|
|
1318
|
-
() => C`<cx-divider></cx-divider><cx-option data-testid="cx-asset-link-format-proxy-auto-option" value=${
|
|
1319
|
-
() =>
|
|
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
|
|
1320
1350
|
)}</cx-select><cx-button data-testid="cx-asset-link-format-proxy-apply" variant="primary" style=${O({
|
|
1321
1351
|
"margin-left": "auto"
|
|
1322
1352
|
})} ?disabled=${this.scopedValue === this.committedValue} ?loading=${this.loading} @click=${this.handleApply}>${this.localize.term("apply")}</cx-button></cx-space></cx-details>`;
|
|
1323
1353
|
}
|
|
1324
1354
|
};
|
|
1325
|
-
|
|
1326
|
-
|
|
1355
|
+
I.styles = [Q, Le];
|
|
1356
|
+
I.dependencies = {
|
|
1327
1357
|
"cx-button": Y,
|
|
1328
|
-
"cx-details":
|
|
1329
|
-
"cx-divider":
|
|
1330
|
-
"cx-icon":
|
|
1331
|
-
"cx-option":
|
|
1332
|
-
"cx-select":
|
|
1333
|
-
"cx-space":
|
|
1334
|
-
"cx-typography":
|
|
1358
|
+
"cx-details": st,
|
|
1359
|
+
"cx-divider": Vt,
|
|
1360
|
+
"cx-icon": at,
|
|
1361
|
+
"cx-option": vt,
|
|
1362
|
+
"cx-select": zt,
|
|
1363
|
+
"cx-space": B,
|
|
1364
|
+
"cx-typography": q
|
|
1335
1365
|
};
|
|
1336
1366
|
W([
|
|
1337
1367
|
J(".details")
|
|
1338
|
-
],
|
|
1368
|
+
], I.prototype, "base", 2);
|
|
1339
1369
|
W([
|
|
1340
1370
|
h({ reflect: !0, type: Boolean })
|
|
1341
|
-
],
|
|
1371
|
+
], I.prototype, "open", 2);
|
|
1342
1372
|
W([
|
|
1343
1373
|
h({ reflect: !0, type: String })
|
|
1344
|
-
],
|
|
1374
|
+
], I.prototype, "value", 2);
|
|
1345
1375
|
W([
|
|
1346
1376
|
h({ reflect: !1, type: Array })
|
|
1347
|
-
],
|
|
1377
|
+
], I.prototype, "items", 2);
|
|
1348
1378
|
W([
|
|
1349
1379
|
h({ attribute: "can-auto-format", reflect: !0, type: Boolean })
|
|
1350
|
-
],
|
|
1380
|
+
], I.prototype, "canAutoFormat", 2);
|
|
1351
1381
|
W([
|
|
1352
1382
|
h({ attribute: "auto-format", reflect: !0, type: Boolean })
|
|
1353
|
-
],
|
|
1383
|
+
], I.prototype, "autoFormat", 2);
|
|
1354
1384
|
W([
|
|
1355
1385
|
h({ reflect: !0, type: Boolean })
|
|
1356
|
-
],
|
|
1386
|
+
], I.prototype, "loading", 2);
|
|
1357
1387
|
W([
|
|
1358
|
-
|
|
1359
|
-
],
|
|
1388
|
+
R()
|
|
1389
|
+
], I.prototype, "scopedValue", 2);
|
|
1360
1390
|
W([
|
|
1361
1391
|
P("autoFormat"),
|
|
1362
1392
|
P("value")
|
|
1363
|
-
],
|
|
1393
|
+
], I.prototype, "handleValueChange", 1);
|
|
1364
1394
|
W([
|
|
1365
1395
|
P("open", { waitUntilFirstUpdate: !0 })
|
|
1366
|
-
],
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
],
|
|
1370
|
-
const
|
|
1371
|
-
var
|
|
1372
|
-
for (var a = s > 1 ? void 0 : s ?
|
|
1373
|
-
(
|
|
1374
|
-
return s && a &&
|
|
1396
|
+
], I.prototype, "handleOpenChange", 1);
|
|
1397
|
+
I = W([
|
|
1398
|
+
X("cx-asset-link-format-proxy")
|
|
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--)
|
|
1403
|
+
(o = t[n]) && (a = (s ? o(e, i, a) : o(a)) || a);
|
|
1404
|
+
return s && a && je(e, i, a), a;
|
|
1375
1405
|
};
|
|
1376
|
-
let
|
|
1406
|
+
let H = class extends j {
|
|
1377
1407
|
constructor() {
|
|
1378
|
-
super(...arguments), this.localize = new
|
|
1408
|
+
super(...arguments), this.localize = new G(this), this.open = !1, this.value = 100, this.loading = !1, this.scopedValue = 100;
|
|
1379
1409
|
}
|
|
1380
1410
|
/**
|
|
1381
1411
|
* A computed property that checks if the current quality value is invalid.
|
|
@@ -1424,46 +1454,46 @@ let T = class extends q {
|
|
|
1424
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>`;
|
|
1425
1455
|
}
|
|
1426
1456
|
};
|
|
1427
|
-
|
|
1428
|
-
|
|
1457
|
+
H.styles = [Q, qe];
|
|
1458
|
+
H.dependencies = {
|
|
1429
1459
|
"cx-button": Y,
|
|
1430
|
-
"cx-details":
|
|
1431
|
-
"cx-icon":
|
|
1432
|
-
"cx-input":
|
|
1433
|
-
"cx-space":
|
|
1434
|
-
"cx-tooltip":
|
|
1435
|
-
"cx-typography":
|
|
1460
|
+
"cx-details": st,
|
|
1461
|
+
"cx-icon": at,
|
|
1462
|
+
"cx-input": Pt,
|
|
1463
|
+
"cx-space": B,
|
|
1464
|
+
"cx-tooltip": Gt,
|
|
1465
|
+
"cx-typography": q
|
|
1436
1466
|
};
|
|
1437
1467
|
tt([
|
|
1438
1468
|
J(".details")
|
|
1439
|
-
],
|
|
1469
|
+
], H.prototype, "base", 2);
|
|
1440
1470
|
tt([
|
|
1441
1471
|
h({ reflect: !0, type: Boolean })
|
|
1442
|
-
],
|
|
1472
|
+
], H.prototype, "open", 2);
|
|
1443
1473
|
tt([
|
|
1444
1474
|
h({ reflect: !0, type: Number })
|
|
1445
|
-
],
|
|
1475
|
+
], H.prototype, "value", 2);
|
|
1446
1476
|
tt([
|
|
1447
1477
|
h({ reflect: !0, type: Boolean })
|
|
1448
|
-
],
|
|
1478
|
+
], H.prototype, "loading", 2);
|
|
1449
1479
|
tt([
|
|
1450
|
-
|
|
1451
|
-
],
|
|
1480
|
+
R()
|
|
1481
|
+
], H.prototype, "scopedValue", 2);
|
|
1452
1482
|
tt([
|
|
1453
1483
|
P("value")
|
|
1454
|
-
],
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
],
|
|
1458
|
-
const
|
|
1459
|
-
var
|
|
1460
|
-
for (var a = s > 1 ? void 0 : s ?
|
|
1461
|
-
(
|
|
1462
|
-
return s && a &&
|
|
1484
|
+
], H.prototype, "handleValueChange", 1);
|
|
1485
|
+
H = tt([
|
|
1486
|
+
X("cx-asset-link-format-quality")
|
|
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--)
|
|
1491
|
+
(o = t[n]) && (a = (s ? o(e, i, a) : o(a)) || a);
|
|
1492
|
+
return s && a && Qe(e, i, a), a;
|
|
1463
1493
|
};
|
|
1464
|
-
let
|
|
1494
|
+
let k = class extends j {
|
|
1465
1495
|
constructor() {
|
|
1466
|
-
super(...arguments), this.localize = new
|
|
1496
|
+
super(...arguments), this.localize = new G(this), this.open = !1, this.width = 0, this.height = 0, this.maxWidth = 0, this.maxHeight = 0, this.ratioWidth = 1, this.ratioHeight = 1, this.unit = r.Pixel, this.lastAppliedSetting = {
|
|
1467
1497
|
[r.Pixel]: { height: 0, width: 0 },
|
|
1468
1498
|
[r.AspectRatio]: { height: 1, width: 1 }
|
|
1469
1499
|
}, this.loading = !1, this.noRatioModes = !1, this.keepAspectRatio = !1, this.invalidWidth = !1, this.invalidHeight = !1, this.aspectRatio = 0;
|
|
@@ -1608,7 +1638,7 @@ let w = class extends q {
|
|
|
1608
1638
|
color: this.keepAspectRatio ? "var(--cx-color-primary)" : void 0
|
|
1609
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">
|
|
1610
1640
|
H
|
|
1611
|
-
</cx-typography></cx-input></div>${
|
|
1641
|
+
</cx-typography></cx-input></div>${M(
|
|
1612
1642
|
!this.noRatioModes,
|
|
1613
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>`
|
|
1614
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({
|
|
@@ -1616,87 +1646,87 @@ let w = class extends q {
|
|
|
1616
1646
|
})} @click=${this.handleApply}>${this.localize.term("apply")}</cx-button></cx-space></cx-details>`;
|
|
1617
1647
|
}
|
|
1618
1648
|
};
|
|
1619
|
-
|
|
1620
|
-
|
|
1649
|
+
k.styles = [Q, Ge];
|
|
1650
|
+
k.dependencies = {
|
|
1621
1651
|
"cx-button": Y,
|
|
1622
|
-
"cx-details":
|
|
1623
|
-
"cx-icon":
|
|
1624
|
-
"cx-icon-button":
|
|
1625
|
-
"cx-input":
|
|
1626
|
-
"cx-option":
|
|
1627
|
-
"cx-select":
|
|
1628
|
-
"cx-space":
|
|
1629
|
-
"cx-typography":
|
|
1652
|
+
"cx-details": st,
|
|
1653
|
+
"cx-icon": at,
|
|
1654
|
+
"cx-icon-button": $t,
|
|
1655
|
+
"cx-input": Pt,
|
|
1656
|
+
"cx-option": vt,
|
|
1657
|
+
"cx-select": zt,
|
|
1658
|
+
"cx-space": B,
|
|
1659
|
+
"cx-typography": q
|
|
1630
1660
|
};
|
|
1631
1661
|
$([
|
|
1632
1662
|
J(".details")
|
|
1633
|
-
],
|
|
1663
|
+
], k.prototype, "base", 2);
|
|
1634
1664
|
$([
|
|
1635
1665
|
h({ reflect: !0, type: Boolean })
|
|
1636
|
-
],
|
|
1666
|
+
], k.prototype, "open", 2);
|
|
1637
1667
|
$([
|
|
1638
1668
|
h({ reflect: !0, type: Number })
|
|
1639
|
-
],
|
|
1669
|
+
], k.prototype, "width", 2);
|
|
1640
1670
|
$([
|
|
1641
1671
|
h({ reflect: !0, type: Number })
|
|
1642
|
-
],
|
|
1672
|
+
], k.prototype, "height", 2);
|
|
1643
1673
|
$([
|
|
1644
1674
|
h({ attribute: "max-width", reflect: !0, type: Number })
|
|
1645
|
-
],
|
|
1675
|
+
], k.prototype, "maxWidth", 2);
|
|
1646
1676
|
$([
|
|
1647
1677
|
h({ attribute: "max-height", reflect: !0, type: Number })
|
|
1648
|
-
],
|
|
1678
|
+
], k.prototype, "maxHeight", 2);
|
|
1649
1679
|
$([
|
|
1650
1680
|
h({ attribute: "ratio-width", reflect: !0, type: Number })
|
|
1651
|
-
],
|
|
1681
|
+
], k.prototype, "ratioWidth", 2);
|
|
1652
1682
|
$([
|
|
1653
1683
|
h({ attribute: "ratio-height", reflect: !0, type: Number })
|
|
1654
|
-
],
|
|
1684
|
+
], k.prototype, "ratioHeight", 2);
|
|
1655
1685
|
$([
|
|
1656
1686
|
h({ reflect: !0, type: String })
|
|
1657
|
-
],
|
|
1687
|
+
], k.prototype, "unit", 2);
|
|
1658
1688
|
$([
|
|
1659
1689
|
h({ attribute: "last-applied-setting", reflect: !1, type: Object })
|
|
1660
|
-
],
|
|
1690
|
+
], k.prototype, "lastAppliedSetting", 2);
|
|
1661
1691
|
$([
|
|
1662
1692
|
h({ reflect: !0, type: Boolean })
|
|
1663
|
-
],
|
|
1693
|
+
], k.prototype, "loading", 2);
|
|
1664
1694
|
$([
|
|
1665
1695
|
h({ attribute: "no-ratio-modes", reflect: !0, type: Boolean })
|
|
1666
|
-
],
|
|
1696
|
+
], k.prototype, "noRatioModes", 2);
|
|
1667
1697
|
$([
|
|
1668
1698
|
h({ attribute: "keep-aspect-ratio", reflect: !0, type: Boolean })
|
|
1669
|
-
],
|
|
1699
|
+
], k.prototype, "keepAspectRatio", 2);
|
|
1670
1700
|
$([
|
|
1671
|
-
|
|
1672
|
-
],
|
|
1701
|
+
R()
|
|
1702
|
+
], k.prototype, "invalidWidth", 2);
|
|
1673
1703
|
$([
|
|
1674
|
-
|
|
1675
|
-
],
|
|
1704
|
+
R()
|
|
1705
|
+
], k.prototype, "invalidHeight", 2);
|
|
1676
1706
|
$([
|
|
1677
|
-
|
|
1678
|
-
],
|
|
1707
|
+
R()
|
|
1708
|
+
], k.prototype, "aspectRatio", 2);
|
|
1679
1709
|
$([
|
|
1680
1710
|
P("cropMode", { waitUntilFirstUpdate: !0 }),
|
|
1681
1711
|
P("maxWidth", { waitUntilFirstUpdate: !0 }),
|
|
1682
1712
|
P("maxHeight", { waitUntilFirstUpdate: !0 }),
|
|
1683
1713
|
P("keepAspectRatio")
|
|
1684
|
-
],
|
|
1714
|
+
], k.prototype, "handleCropModeChange", 1);
|
|
1685
1715
|
$([
|
|
1686
1716
|
P("open", { waitUntilFirstUpdate: !0 })
|
|
1687
|
-
],
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
],
|
|
1691
|
-
const
|
|
1692
|
-
var
|
|
1693
|
-
for (var a = s > 1 ? void 0 : s ?
|
|
1694
|
-
(
|
|
1695
|
-
return s && a &&
|
|
1717
|
+
], k.prototype, "handleOpenChange", 1);
|
|
1718
|
+
k = $([
|
|
1719
|
+
X("cx-asset-link-format-resize")
|
|
1720
|
+
], k);
|
|
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--)
|
|
1724
|
+
(o = t[n]) && (a = (s ? o(e, i, a) : o(a)) || a);
|
|
1725
|
+
return s && a && Ze(e, i, a), a;
|
|
1696
1726
|
};
|
|
1697
|
-
let
|
|
1727
|
+
let T = class extends j {
|
|
1698
1728
|
constructor() {
|
|
1699
|
-
super(...arguments), this.localize = new
|
|
1729
|
+
super(...arguments), this.localize = new G(this), this.open = !1, this.value = 0, this.defaultValue = 0, this.loading = !1, this.lastAppliedValue = 0;
|
|
1700
1730
|
}
|
|
1701
1731
|
handleOpenChange() {
|
|
1702
1732
|
this.open || this.emit("cx-asset-link-format-rotation-change", {
|
|
@@ -1707,14 +1737,14 @@ let H = class extends q {
|
|
|
1707
1737
|
const e = t.target.value, i = Number(e);
|
|
1708
1738
|
if (Number.isNaN(i))
|
|
1709
1739
|
return;
|
|
1710
|
-
const s =
|
|
1740
|
+
const s = Ht(i);
|
|
1711
1741
|
(i > 360 || i < -360) && (t.target.value = s.toString()), this.emit("cx-asset-link-format-rotation-change", {
|
|
1712
1742
|
detail: s
|
|
1713
1743
|
});
|
|
1714
1744
|
}
|
|
1715
1745
|
handleButtonClick(t) {
|
|
1716
1746
|
this.emit("cx-asset-link-format-rotation-change", {
|
|
1717
|
-
detail:
|
|
1747
|
+
detail: Ht(t)
|
|
1718
1748
|
});
|
|
1719
1749
|
}
|
|
1720
1750
|
handleClockwiseClick() {
|
|
@@ -1740,49 +1770,49 @@ let H = class extends q {
|
|
|
1740
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>`;
|
|
1741
1771
|
}
|
|
1742
1772
|
};
|
|
1743
|
-
|
|
1744
|
-
|
|
1773
|
+
T.styles = [Q, Ke];
|
|
1774
|
+
T.dependencies = {
|
|
1745
1775
|
"cx-button": Y,
|
|
1746
|
-
"cx-button-group":
|
|
1747
|
-
"cx-details":
|
|
1748
|
-
"cx-icon":
|
|
1749
|
-
"cx-icon-button":
|
|
1750
|
-
"cx-space":
|
|
1751
|
-
"cx-typography":
|
|
1776
|
+
"cx-button-group": de,
|
|
1777
|
+
"cx-details": st,
|
|
1778
|
+
"cx-icon": at,
|
|
1779
|
+
"cx-icon-button": $t,
|
|
1780
|
+
"cx-space": B,
|
|
1781
|
+
"cx-typography": q
|
|
1752
1782
|
};
|
|
1753
|
-
|
|
1783
|
+
K([
|
|
1754
1784
|
J(".details")
|
|
1755
|
-
],
|
|
1756
|
-
|
|
1785
|
+
], T.prototype, "base", 2);
|
|
1786
|
+
K([
|
|
1757
1787
|
h({ reflect: !0, type: Boolean })
|
|
1758
|
-
],
|
|
1759
|
-
|
|
1788
|
+
], T.prototype, "open", 2);
|
|
1789
|
+
K([
|
|
1760
1790
|
h({ reflect: !0, type: Number })
|
|
1761
|
-
],
|
|
1762
|
-
|
|
1791
|
+
], T.prototype, "value", 2);
|
|
1792
|
+
K([
|
|
1763
1793
|
h({ attribute: "default-value", reflect: !0, type: Number })
|
|
1764
|
-
],
|
|
1765
|
-
|
|
1794
|
+
], T.prototype, "defaultValue", 2);
|
|
1795
|
+
K([
|
|
1766
1796
|
h({ reflect: !0, type: Boolean })
|
|
1767
|
-
],
|
|
1768
|
-
|
|
1797
|
+
], T.prototype, "loading", 2);
|
|
1798
|
+
K([
|
|
1769
1799
|
h({ attribute: "last-applied-value", reflect: !0, type: Number })
|
|
1770
|
-
],
|
|
1771
|
-
|
|
1800
|
+
], T.prototype, "lastAppliedValue", 2);
|
|
1801
|
+
K([
|
|
1772
1802
|
P("open", { waitUntilFirstUpdate: !0 })
|
|
1773
|
-
],
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
],
|
|
1777
|
-
const
|
|
1778
|
-
var
|
|
1779
|
-
for (var a = s > 1 ? void 0 : s ?
|
|
1780
|
-
(
|
|
1781
|
-
return s && a &&
|
|
1803
|
+
], T.prototype, "handleOpenChange", 1);
|
|
1804
|
+
T = K([
|
|
1805
|
+
X("cx-asset-link-format-rotation")
|
|
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--)
|
|
1810
|
+
(o = t[n]) && (a = (s ? o(e, i, a) : o(a)) || a);
|
|
1811
|
+
return s && a && ti(e, i, a), a;
|
|
1782
1812
|
};
|
|
1783
|
-
let
|
|
1813
|
+
let U = class extends j {
|
|
1784
1814
|
constructor() {
|
|
1785
|
-
super(...arguments), this.localize = new
|
|
1815
|
+
super(...arguments), this.localize = new G(this), this.open = !1, this.value = !1;
|
|
1786
1816
|
}
|
|
1787
1817
|
handleApply(t) {
|
|
1788
1818
|
this.emit("cx-asset-link-format-metadata-change", {
|
|
@@ -1809,36 +1839,36 @@ let L = class extends q {
|
|
|
1809
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>`;
|
|
1810
1840
|
}
|
|
1811
1841
|
};
|
|
1812
|
-
|
|
1813
|
-
|
|
1842
|
+
U.styles = [Q, Je];
|
|
1843
|
+
U.dependencies = {
|
|
1814
1844
|
"cx-button": Y,
|
|
1815
|
-
"cx-checkbox":
|
|
1816
|
-
"cx-details":
|
|
1817
|
-
"cx-icon":
|
|
1818
|
-
"cx-space":
|
|
1819
|
-
"cx-tooltip":
|
|
1820
|
-
"cx-typography":
|
|
1845
|
+
"cx-checkbox": ue,
|
|
1846
|
+
"cx-details": st,
|
|
1847
|
+
"cx-icon": at,
|
|
1848
|
+
"cx-space": B,
|
|
1849
|
+
"cx-tooltip": Gt,
|
|
1850
|
+
"cx-typography": q
|
|
1821
1851
|
};
|
|
1822
|
-
|
|
1852
|
+
Ct([
|
|
1823
1853
|
J(".details")
|
|
1824
|
-
],
|
|
1825
|
-
|
|
1854
|
+
], U.prototype, "base", 2);
|
|
1855
|
+
Ct([
|
|
1826
1856
|
h({ reflect: !0, type: Boolean })
|
|
1827
|
-
],
|
|
1828
|
-
|
|
1857
|
+
], U.prototype, "open", 2);
|
|
1858
|
+
Ct([
|
|
1829
1859
|
h({ reflect: !0, type: Boolean })
|
|
1830
|
-
],
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
],
|
|
1834
|
-
var
|
|
1835
|
-
for (var a = s > 1 ? void 0 : s ?
|
|
1836
|
-
(
|
|
1837
|
-
return s && a &&
|
|
1860
|
+
], U.prototype, "value", 2);
|
|
1861
|
+
U = Ct([
|
|
1862
|
+
X("cx-asset-link-format-metadata")
|
|
1863
|
+
], U);
|
|
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--)
|
|
1866
|
+
(o = t[n]) && (a = (s ? o(e, i, a) : o(a)) || a);
|
|
1867
|
+
return s && a && ii(e, i, a), a;
|
|
1838
1868
|
};
|
|
1839
|
-
let
|
|
1869
|
+
let f = class extends j {
|
|
1840
1870
|
constructor() {
|
|
1841
|
-
super(), this.localize = new
|
|
1871
|
+
super(), this.localize = new G(this), this.baseUrl = void 0, this.token = void 0, this.asset = void 0, this.cropModes = [
|
|
1842
1872
|
{
|
|
1843
1873
|
label: "Free",
|
|
1844
1874
|
value: "free"
|
|
@@ -1934,7 +1964,7 @@ let m = class extends q {
|
|
|
1934
1964
|
}, this.rotation = 0, this.defaultSize = {
|
|
1935
1965
|
height: 0,
|
|
1936
1966
|
width: 0
|
|
1937
|
-
}, this.cropperElement = null, this.parameters = [], this.loading = !1, this.lastAction = void 0, this.frozenIndex = void 0, this.preResetTransformations = void 0, this.preResetAutoFormat = void 0, this.preResetSelectedProxy = void 0, this.apiGetTransformAssetLink =
|
|
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);
|
|
1938
1968
|
}
|
|
1939
1969
|
/**
|
|
1940
1970
|
* Transform requests must resolve to a web-displayable image (the browser renders the
|
|
@@ -1943,7 +1973,7 @@ let m = class extends q {
|
|
|
1943
1973
|
* extension fallback in asset-transformation-dialog.
|
|
1944
1974
|
*/
|
|
1945
1975
|
static getTransformExtension(t) {
|
|
1946
|
-
return !t ||
|
|
1976
|
+
return !t || Jt(t) ? t : "jpg";
|
|
1947
1977
|
}
|
|
1948
1978
|
/** True when there are transformations beyond the frozen index (i.e. user has added new ones). */
|
|
1949
1979
|
get hasUnfrozenTransformations() {
|
|
@@ -1956,7 +1986,7 @@ let m = class extends q {
|
|
|
1956
1986
|
*/
|
|
1957
1987
|
get lastAppliedCropUnit() {
|
|
1958
1988
|
return this.transformations.findLast(
|
|
1959
|
-
(e) => e.key ===
|
|
1989
|
+
(e) => e.key === g.Crop
|
|
1960
1990
|
)?.value.unit ?? r.Pixel;
|
|
1961
1991
|
}
|
|
1962
1992
|
/**
|
|
@@ -1966,7 +1996,7 @@ let m = class extends q {
|
|
|
1966
1996
|
*/
|
|
1967
1997
|
get lastAppliedCropFocusMode() {
|
|
1968
1998
|
return this.transformations.findLast(
|
|
1969
|
-
(e) => e.key ===
|
|
1999
|
+
(e) => e.key === g.Crop
|
|
1970
2000
|
)?.value.focusMode ?? "manual";
|
|
1971
2001
|
}
|
|
1972
2002
|
/**
|
|
@@ -1976,7 +2006,7 @@ let m = class extends q {
|
|
|
1976
2006
|
*/
|
|
1977
2007
|
get lastAppliedCropPosition() {
|
|
1978
2008
|
return this.transformations.findLast(
|
|
1979
|
-
(e) => e.key ===
|
|
2009
|
+
(e) => e.key === g.Crop
|
|
1980
2010
|
)?.value.position ?? N.CenterCenter;
|
|
1981
2011
|
}
|
|
1982
2012
|
/**
|
|
@@ -2028,7 +2058,7 @@ let m = class extends q {
|
|
|
2028
2058
|
get lastCropSize() {
|
|
2029
2059
|
if (!this.asset) {
|
|
2030
2060
|
const e = this.transformations.findLast(
|
|
2031
|
-
(i) => i.key ===
|
|
2061
|
+
(i) => i.key === g.Crop
|
|
2032
2062
|
);
|
|
2033
2063
|
if (e?.value.unit === r.AspectRatio && e.value.ratioWidth && e.value.ratioHeight)
|
|
2034
2064
|
return {
|
|
@@ -2058,14 +2088,14 @@ let m = class extends q {
|
|
|
2058
2088
|
}
|
|
2059
2089
|
};
|
|
2060
2090
|
if (e?.value.width && e?.value.height) {
|
|
2061
|
-
const { height: i, width: s, x: a = 0, y:
|
|
2091
|
+
const { height: i, width: s, x: a = 0, y: n = 0 } = e.value, o = pt(s, i);
|
|
2062
2092
|
return {
|
|
2063
2093
|
[r.AspectRatio]: {
|
|
2064
|
-
height:
|
|
2094
|
+
height: o.height,
|
|
2065
2095
|
percentageHeight: 100,
|
|
2066
2096
|
percentageWidth: 100,
|
|
2067
2097
|
unit: r.AspectRatio,
|
|
2068
|
-
width:
|
|
2098
|
+
width: o.width,
|
|
2069
2099
|
x: 0,
|
|
2070
2100
|
y: 0
|
|
2071
2101
|
},
|
|
@@ -2076,12 +2106,12 @@ let m = class extends q {
|
|
|
2076
2106
|
unit: r.Pixel,
|
|
2077
2107
|
width: s,
|
|
2078
2108
|
x: a,
|
|
2079
|
-
y:
|
|
2109
|
+
y: n
|
|
2080
2110
|
}
|
|
2081
2111
|
};
|
|
2082
2112
|
}
|
|
2083
2113
|
}
|
|
2084
|
-
const t = this.lastImageSize.width && this.lastImageSize.height ?
|
|
2114
|
+
const t = this.lastImageSize.width && this.lastImageSize.height ? pt(this.lastImageSize.width, this.lastImageSize.height) : { height: 1, width: 1 };
|
|
2085
2115
|
return {
|
|
2086
2116
|
[r.AspectRatio]: {
|
|
2087
2117
|
height: t.height,
|
|
@@ -2111,7 +2141,7 @@ let m = class extends q {
|
|
|
2111
2141
|
get lastResizeSize() {
|
|
2112
2142
|
if (!this.asset) {
|
|
2113
2143
|
const e = this.transformations.findLast(
|
|
2114
|
-
(i) => i.key ===
|
|
2144
|
+
(i) => i.key === g.Resize
|
|
2115
2145
|
);
|
|
2116
2146
|
if (e?.value.unit === r.AspectRatio && e.value.ratioWidth && e.value.ratioHeight)
|
|
2117
2147
|
return {
|
|
@@ -2128,7 +2158,7 @@ let m = class extends q {
|
|
|
2128
2158
|
}
|
|
2129
2159
|
};
|
|
2130
2160
|
if (e?.value.width && e?.value.height) {
|
|
2131
|
-
const { height: i, width: s } = e.value, a =
|
|
2161
|
+
const { height: i, width: s } = e.value, a = pt(s, i);
|
|
2132
2162
|
return {
|
|
2133
2163
|
[r.AspectRatio]: {
|
|
2134
2164
|
height: a.height,
|
|
@@ -2143,7 +2173,7 @@ let m = class extends q {
|
|
|
2143
2173
|
};
|
|
2144
2174
|
}
|
|
2145
2175
|
}
|
|
2146
|
-
const t = this.lastImageSize.width && this.lastImageSize.height ?
|
|
2176
|
+
const t = this.lastImageSize.width && this.lastImageSize.height ? pt(this.lastImageSize.width, this.lastImageSize.height) : { height: 1, width: 1 };
|
|
2147
2177
|
return {
|
|
2148
2178
|
[r.AspectRatio]: {
|
|
2149
2179
|
height: t.height,
|
|
@@ -2167,14 +2197,14 @@ let m = class extends q {
|
|
|
2167
2197
|
*/
|
|
2168
2198
|
get lastRotation() {
|
|
2169
2199
|
return this.asset ? 0 : this.transformations.findLast(
|
|
2170
|
-
(e) => e.key ===
|
|
2200
|
+
(e) => e.key === g.Rotate
|
|
2171
2201
|
)?.value.rotation ?? 0;
|
|
2172
2202
|
}
|
|
2173
2203
|
/**
|
|
2174
2204
|
* Returns the transformation string for the asset link.
|
|
2175
2205
|
*/
|
|
2176
2206
|
get transformationString() {
|
|
2177
|
-
return
|
|
2207
|
+
return lt({
|
|
2178
2208
|
asset: this.asset,
|
|
2179
2209
|
baseUrl: "",
|
|
2180
2210
|
parameters: this.parameters,
|
|
@@ -2213,13 +2243,13 @@ let m = class extends q {
|
|
|
2213
2243
|
);
|
|
2214
2244
|
this.loading = !0, this.apiGetTransformAssetLink({
|
|
2215
2245
|
assetId: this.asset.id,
|
|
2216
|
-
extension:
|
|
2246
|
+
extension: f.getTransformExtension(this.asset.extension),
|
|
2217
2247
|
format: e?.proxyName ?? "",
|
|
2218
2248
|
siteUrl: this.baseUrl,
|
|
2219
2249
|
token: this.token,
|
|
2220
2250
|
transformations: this.transformationString
|
|
2221
2251
|
}).then((s) => {
|
|
2222
|
-
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 = {
|
|
2223
2253
|
height: s.height,
|
|
2224
2254
|
width: s.width
|
|
2225
2255
|
}, this.selectedFormat = {
|
|
@@ -2233,7 +2263,7 @@ let m = class extends q {
|
|
|
2233
2263
|
*/
|
|
2234
2264
|
});
|
|
2235
2265
|
});
|
|
2236
|
-
const i =
|
|
2266
|
+
const i = lt({
|
|
2237
2267
|
asset: this.asset,
|
|
2238
2268
|
baseUrl: "",
|
|
2239
2269
|
extension: this.selectedFormat.extension,
|
|
@@ -2266,7 +2296,7 @@ let m = class extends q {
|
|
|
2266
2296
|
async handleTransformationsChange() {
|
|
2267
2297
|
if (await this.updateComplete, !this.asset) {
|
|
2268
2298
|
this.emit("cx-asset-link-format-change", {
|
|
2269
|
-
detail:
|
|
2299
|
+
detail: lt({
|
|
2270
2300
|
asset: this.asset,
|
|
2271
2301
|
baseUrl: "",
|
|
2272
2302
|
options: {
|
|
@@ -2277,35 +2307,35 @@ let m = class extends q {
|
|
|
2277
2307
|
useSession: this.useSession
|
|
2278
2308
|
}).replace(/\/t\//g, "")
|
|
2279
2309
|
});
|
|
2280
|
-
const
|
|
2281
|
-
(c) => c.key ===
|
|
2310
|
+
const n = this.transformations.findLast(
|
|
2311
|
+
(c) => c.key === g.Crop && (c.value.unit === r.AspectRatio && c.value.ratioWidth && c.value.ratioHeight || c.value.width && c.value.height)
|
|
2282
2312
|
);
|
|
2283
|
-
if (
|
|
2284
|
-
const { focusMode: c, position:
|
|
2313
|
+
if (n?.value.unit === r.AspectRatio && n.value.ratioWidth && n.value.ratioHeight) {
|
|
2314
|
+
const { focusMode: c, position: y, ratioHeight: A, ratioWidth: p } = n.value;
|
|
2285
2315
|
this.cropSize = {
|
|
2286
2316
|
...this.cropSize,
|
|
2287
2317
|
cropMode: "free",
|
|
2288
2318
|
focusMode: c ?? "manual",
|
|
2289
2319
|
percentageHeight: 100,
|
|
2290
2320
|
percentageWidth: 100,
|
|
2291
|
-
position:
|
|
2292
|
-
ratioHeight:
|
|
2293
|
-
ratioWidth:
|
|
2321
|
+
position: y ?? N.CenterCenter,
|
|
2322
|
+
ratioHeight: A,
|
|
2323
|
+
ratioWidth: p,
|
|
2294
2324
|
unit: r.AspectRatio
|
|
2295
2325
|
};
|
|
2296
|
-
} else if (
|
|
2297
|
-
const { focusMode: c, height:
|
|
2326
|
+
} else if (n) {
|
|
2327
|
+
const { focusMode: c, height: y, position: A, unit: p, width: x, x: b = 0, y: u = 0 } = n.value;
|
|
2298
2328
|
this.cropSize = {
|
|
2299
2329
|
...this.cropSize,
|
|
2300
2330
|
cropMode: "free",
|
|
2301
2331
|
focusMode: c ?? "manual",
|
|
2302
|
-
height:
|
|
2332
|
+
height: y,
|
|
2303
2333
|
percentageHeight: 100,
|
|
2304
2334
|
percentageWidth: 100,
|
|
2305
|
-
position:
|
|
2306
|
-
unit:
|
|
2307
|
-
width:
|
|
2308
|
-
x:
|
|
2335
|
+
position: A ?? N.CenterCenter,
|
|
2336
|
+
unit: p ?? r.Pixel,
|
|
2337
|
+
width: x,
|
|
2338
|
+
x: b,
|
|
2309
2339
|
y: u
|
|
2310
2340
|
};
|
|
2311
2341
|
} else
|
|
@@ -2328,24 +2358,24 @@ let m = class extends q {
|
|
|
2328
2358
|
x: 0,
|
|
2329
2359
|
y: 0
|
|
2330
2360
|
};
|
|
2331
|
-
const
|
|
2332
|
-
(c) => c.key ===
|
|
2361
|
+
const o = this.transformations.findLast(
|
|
2362
|
+
(c) => c.key === g.Resize && (c.value.unit === r.AspectRatio && c.value.ratioWidth && c.value.ratioHeight || c.value.width || c.value.height)
|
|
2333
2363
|
);
|
|
2334
|
-
if (
|
|
2335
|
-
const { ratioHeight: c, ratioWidth:
|
|
2364
|
+
if (o?.value.unit === r.AspectRatio && o.value.ratioWidth && o.value.ratioHeight) {
|
|
2365
|
+
const { ratioHeight: c, ratioWidth: y } = o.value;
|
|
2336
2366
|
this.resizeSize = {
|
|
2337
2367
|
...this.resizeSize,
|
|
2338
2368
|
ratioHeight: c,
|
|
2339
|
-
ratioWidth:
|
|
2369
|
+
ratioWidth: y,
|
|
2340
2370
|
unit: r.AspectRatio
|
|
2341
2371
|
};
|
|
2342
|
-
} else if (
|
|
2343
|
-
const { height: c = 0, unit:
|
|
2372
|
+
} else if (o) {
|
|
2373
|
+
const { height: c = 0, unit: y, width: A = 0 } = o.value;
|
|
2344
2374
|
this.resizeSize = {
|
|
2345
2375
|
...this.resizeSize,
|
|
2346
2376
|
height: c,
|
|
2347
|
-
unit:
|
|
2348
|
-
width:
|
|
2377
|
+
unit: y ?? r.Pixel,
|
|
2378
|
+
width: A
|
|
2349
2379
|
};
|
|
2350
2380
|
} else
|
|
2351
2381
|
this.resizeSize = {
|
|
@@ -2360,17 +2390,17 @@ let m = class extends q {
|
|
|
2360
2390
|
width: 1
|
|
2361
2391
|
};
|
|
2362
2392
|
const l = this.transformations.findLast(
|
|
2363
|
-
(c) => c.key ===
|
|
2393
|
+
(c) => c.key === g.Rotate
|
|
2364
2394
|
);
|
|
2365
2395
|
this.rotation = l?.value.rotation ?? 0;
|
|
2366
|
-
const
|
|
2367
|
-
(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
|
|
2368
2398
|
);
|
|
2369
|
-
this.selectedFormat ? this.selectedFormat = { ...this.selectedFormat, keepMetadata:
|
|
2399
|
+
this.selectedFormat ? this.selectedFormat = { ...this.selectedFormat, keepMetadata: m, quality: d } : this.selectedFormat = {
|
|
2370
2400
|
extension: "",
|
|
2371
2401
|
height: 0,
|
|
2372
|
-
keepMetadata:
|
|
2373
|
-
quality:
|
|
2402
|
+
keepMetadata: m,
|
|
2403
|
+
quality: d,
|
|
2374
2404
|
rotation: 0,
|
|
2375
2405
|
url: "",
|
|
2376
2406
|
width: 0,
|
|
@@ -2382,12 +2412,12 @@ let m = class extends q {
|
|
|
2382
2412
|
if (!this.selectedFormat)
|
|
2383
2413
|
return;
|
|
2384
2414
|
const t = this.proxies?.find(
|
|
2385
|
-
(
|
|
2415
|
+
(n) => n.id === this.selectedProxy
|
|
2386
2416
|
);
|
|
2387
2417
|
this.loading = !0;
|
|
2388
2418
|
const e = await this.apiGetTransformAssetLink({
|
|
2389
2419
|
assetId: this.asset.id,
|
|
2390
|
-
extension:
|
|
2420
|
+
extension: f.getTransformExtension(this.selectedFormat.extension),
|
|
2391
2421
|
format: t?.proxyName ?? "",
|
|
2392
2422
|
siteUrl: this.baseUrl,
|
|
2393
2423
|
token: this.token,
|
|
@@ -2419,11 +2449,11 @@ let m = class extends q {
|
|
|
2419
2449
|
width: e.width,
|
|
2420
2450
|
x: 0,
|
|
2421
2451
|
y: 0
|
|
2422
|
-
}, this.lastAction ===
|
|
2452
|
+
}, this.lastAction === g.Rotate && (this.rotation = 0), this.lastAction = void 0;
|
|
2423
2453
|
const i = this.transformations.some(
|
|
2424
|
-
(
|
|
2454
|
+
(n) => n.key === g.Metadata
|
|
2425
2455
|
), s = this.transformations.findLast(
|
|
2426
|
-
(
|
|
2456
|
+
(n) => n.key === g.Quality
|
|
2427
2457
|
);
|
|
2428
2458
|
this.selectedFormat = {
|
|
2429
2459
|
...this.selectedFormat,
|
|
@@ -2437,7 +2467,7 @@ let m = class extends q {
|
|
|
2437
2467
|
* url: `${this.baseUrl}/${response.relativePath}`,
|
|
2438
2468
|
*/
|
|
2439
2469
|
};
|
|
2440
|
-
const a =
|
|
2470
|
+
const a = lt({
|
|
2441
2471
|
asset: this.asset,
|
|
2442
2472
|
baseUrl: "",
|
|
2443
2473
|
extension: this.selectedFormat.extension,
|
|
@@ -2469,7 +2499,7 @@ let m = class extends q {
|
|
|
2469
2499
|
width: Number.parseInt(this.asset.width, 10)
|
|
2470
2500
|
});
|
|
2471
2501
|
const t = this.transformations.findLast(
|
|
2472
|
-
(e) => e.key ===
|
|
2502
|
+
(e) => e.key === g.Quality
|
|
2473
2503
|
);
|
|
2474
2504
|
this.selectedFormat = {
|
|
2475
2505
|
extension: this.asset.extension,
|
|
@@ -2524,26 +2554,26 @@ let m = class extends q {
|
|
|
2524
2554
|
e.proxyName === "TRX" && (e.formatHeight = Number(this.asset.height), e.formatWidth = Number(this.asset.width));
|
|
2525
2555
|
const i = this.proxies?.find((s) => s.id === t);
|
|
2526
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) => {
|
|
2527
|
-
if (s.key ===
|
|
2528
|
-
const a = s.value,
|
|
2557
|
+
if (s.key === g.Crop) {
|
|
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;
|
|
2529
2559
|
return {
|
|
2530
2560
|
...s,
|
|
2531
2561
|
value: {
|
|
2532
2562
|
...s.value,
|
|
2533
|
-
height:
|
|
2534
|
-
width:
|
|
2563
|
+
height: o,
|
|
2564
|
+
width: n,
|
|
2535
2565
|
x: l,
|
|
2536
|
-
y:
|
|
2566
|
+
y: d
|
|
2537
2567
|
}
|
|
2538
2568
|
};
|
|
2539
2569
|
}
|
|
2540
|
-
if (s.key ===
|
|
2541
|
-
const a = s.value,
|
|
2570
|
+
if (s.key === g.Resize) {
|
|
2571
|
+
const a = s.value, n = a.width / i.formatWidth * e.formatWidth, o = a.height / i.formatHeight * e.formatHeight;
|
|
2542
2572
|
return {
|
|
2543
2573
|
...s,
|
|
2544
2574
|
value: {
|
|
2545
|
-
height:
|
|
2546
|
-
width:
|
|
2575
|
+
height: o,
|
|
2576
|
+
width: n
|
|
2547
2577
|
}
|
|
2548
2578
|
};
|
|
2549
2579
|
}
|
|
@@ -2609,33 +2639,33 @@ let m = class extends q {
|
|
|
2609
2639
|
height: i,
|
|
2610
2640
|
keepAspectRatio: s,
|
|
2611
2641
|
percentageHeight: a,
|
|
2612
|
-
percentageWidth:
|
|
2613
|
-
ratioHeight:
|
|
2642
|
+
percentageWidth: n,
|
|
2643
|
+
ratioHeight: o,
|
|
2614
2644
|
ratioWidth: l,
|
|
2615
|
-
unit:
|
|
2616
|
-
useCropMode:
|
|
2645
|
+
unit: d,
|
|
2646
|
+
useCropMode: m,
|
|
2617
2647
|
width: c
|
|
2618
2648
|
}) {
|
|
2619
2649
|
if (!this.selectedFormat?.url || e === "manual")
|
|
2620
2650
|
return;
|
|
2621
|
-
this.loading = !0, this.lastAction =
|
|
2622
|
-
const
|
|
2651
|
+
this.loading = !0, this.lastAction = g.Crop;
|
|
2652
|
+
const y = await this.apiGetCropFocusMode({
|
|
2623
2653
|
autoCropMode: e,
|
|
2624
2654
|
cropHeight: i,
|
|
2625
2655
|
cropWidth: c,
|
|
2626
2656
|
imageUrl: this.selectedFormat.url
|
|
2627
2657
|
});
|
|
2628
|
-
if (
|
|
2629
|
-
let
|
|
2630
|
-
i || (
|
|
2658
|
+
if (y) {
|
|
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 = {
|
|
2631
2661
|
...this.cropSize,
|
|
2632
|
-
height:
|
|
2633
|
-
percentageHeight:
|
|
2634
|
-
percentageWidth:
|
|
2635
|
-
width:
|
|
2636
|
-
x:
|
|
2637
|
-
y:
|
|
2638
|
-
...
|
|
2662
|
+
height: y.height,
|
|
2663
|
+
percentageHeight: A ?? this.cropSize.percentageHeight,
|
|
2664
|
+
percentageWidth: p ?? this.cropSize.percentageWidth,
|
|
2665
|
+
width: y.width,
|
|
2666
|
+
x: y.x * 100 / this.selectedFormat.width,
|
|
2667
|
+
y: y.y * 100 / this.selectedFormat.height,
|
|
2668
|
+
...m ? {
|
|
2639
2669
|
cropMode: e,
|
|
2640
2670
|
focusMode: "manual",
|
|
2641
2671
|
keepAspectRatio: !1
|
|
@@ -2644,9 +2674,9 @@ let m = class extends q {
|
|
|
2644
2674
|
focusMode: e
|
|
2645
2675
|
},
|
|
2646
2676
|
keepAspectRatio: s ?? this.cropSize.keepAspectRatio,
|
|
2647
|
-
ratioHeight:
|
|
2677
|
+
ratioHeight: o ?? this.cropSize.ratioHeight,
|
|
2648
2678
|
ratioWidth: l ?? this.cropSize.ratioWidth,
|
|
2649
|
-
unit:
|
|
2679
|
+
unit: d ?? this.cropSize.unit
|
|
2650
2680
|
};
|
|
2651
2681
|
}
|
|
2652
2682
|
this.loading = !1, this.lastAction = void 0;
|
|
@@ -2656,32 +2686,32 @@ let m = class extends q {
|
|
|
2656
2686
|
height: i,
|
|
2657
2687
|
width: s,
|
|
2658
2688
|
x: a,
|
|
2659
|
-
y:
|
|
2689
|
+
y: n
|
|
2660
2690
|
} = e;
|
|
2661
2691
|
if (s === 0 || i === 0)
|
|
2662
2692
|
return;
|
|
2663
|
-
const
|
|
2664
|
-
let
|
|
2665
|
-
|
|
2693
|
+
const o = this.cropSize.percentageWidth !== s, l = this.cropSize.percentageHeight !== i;
|
|
2694
|
+
let d = this.cropSize.height, m = this.cropSize.width;
|
|
2695
|
+
o && (m = Math.round(s * this.selectedFormat.width / 100)), l && (d = Math.round(
|
|
2666
2696
|
i * this.selectedFormat.height / 100
|
|
2667
2697
|
));
|
|
2668
2698
|
const c = this.cropSize.focusMode;
|
|
2669
2699
|
this.focusModes.find(
|
|
2670
|
-
(
|
|
2700
|
+
(A) => A.value === c
|
|
2671
2701
|
)?.auto && this.selectedFormat?.url && this.cropperElement ? await this.handleRequestAutoCropSuggestion({
|
|
2672
2702
|
focusMode: c,
|
|
2673
|
-
height:
|
|
2703
|
+
height: d,
|
|
2674
2704
|
percentageHeight: i,
|
|
2675
2705
|
percentageWidth: s,
|
|
2676
|
-
width:
|
|
2706
|
+
width: m
|
|
2677
2707
|
}) : this.cropSize = {
|
|
2678
2708
|
...this.cropSize,
|
|
2679
|
-
height:
|
|
2709
|
+
height: d,
|
|
2680
2710
|
percentageHeight: i,
|
|
2681
2711
|
percentageWidth: s,
|
|
2682
|
-
width:
|
|
2712
|
+
width: m,
|
|
2683
2713
|
x: a,
|
|
2684
|
-
y:
|
|
2714
|
+
y: n
|
|
2685
2715
|
};
|
|
2686
2716
|
}
|
|
2687
2717
|
onCropDragStart() {
|
|
@@ -2710,12 +2740,12 @@ let m = class extends q {
|
|
|
2710
2740
|
* a proxy *id*, so the name has to be looked up in `proxies` rather than used directly.
|
|
2711
2741
|
*/
|
|
2712
2742
|
get autoResolvedProxyId() {
|
|
2713
|
-
const t =
|
|
2743
|
+
const t = jt(this.asset?.extension, this.asset?.size);
|
|
2714
2744
|
return this.proxies?.find((e) => e.proxyName === t)?.id ?? "";
|
|
2715
2745
|
}
|
|
2716
2746
|
onProxyChange(t) {
|
|
2717
2747
|
const e = t.detail;
|
|
2718
|
-
if (this.lastAction =
|
|
2748
|
+
if (this.lastAction = g.Proxy, e.autoFormat) {
|
|
2719
2749
|
this.autoFormat = !0;
|
|
2720
2750
|
const i = this.autoResolvedProxyId;
|
|
2721
2751
|
i && (this.selectedProxy = i);
|
|
@@ -2732,21 +2762,21 @@ let m = class extends q {
|
|
|
2732
2762
|
});
|
|
2733
2763
|
else {
|
|
2734
2764
|
const s = this.focusModes.find(
|
|
2735
|
-
(
|
|
2765
|
+
(d) => d.value === this.cropSize.focusMode
|
|
2736
2766
|
)?.auto;
|
|
2737
|
-
let a = this.cropSize.keepAspectRatio,
|
|
2738
|
-
e === "free" ? (a = !1,
|
|
2767
|
+
let a = this.cropSize.keepAspectRatio, n = this.cropSize.focusMode, o = this.cropSize.x, l = this.cropSize.y;
|
|
2768
|
+
e === "free" ? (a = !1, n = "manual") : this.cropSize.unit === r.Pixel && !s && (o = 0, l = 0), s ? await this.handleRequestAutoCropSuggestion({
|
|
2739
2769
|
cropMode: e,
|
|
2740
|
-
focusMode:
|
|
2770
|
+
focusMode: n,
|
|
2741
2771
|
height: this.cropSize.height,
|
|
2742
2772
|
keepAspectRatio: a,
|
|
2743
2773
|
width: this.cropSize.width
|
|
2744
2774
|
}) : this.cropSize = {
|
|
2745
2775
|
...this.cropSize,
|
|
2746
2776
|
cropMode: e,
|
|
2747
|
-
focusMode:
|
|
2777
|
+
focusMode: n,
|
|
2748
2778
|
keepAspectRatio: a,
|
|
2749
|
-
x:
|
|
2779
|
+
x: o,
|
|
2750
2780
|
y: l
|
|
2751
2781
|
};
|
|
2752
2782
|
}
|
|
@@ -2777,37 +2807,37 @@ let m = class extends q {
|
|
|
2777
2807
|
) : 0, a = this.asset ? Math.min(
|
|
2778
2808
|
Math.max(Math.round(s / i), 0),
|
|
2779
2809
|
this.resizeSize.height
|
|
2780
|
-
) : 0,
|
|
2781
|
-
let l = this.cropSize.x,
|
|
2782
|
-
l +
|
|
2783
|
-
let
|
|
2810
|
+
) : 0, n = this.asset ? a * 100 / this.selectedFormat.height : 100, o = this.asset ? s * 100 / this.selectedFormat.width : 100;
|
|
2811
|
+
let l = this.cropSize.x, d = this.cropSize.y;
|
|
2812
|
+
l + o > 100 && (l = 100 - o), d + n > 100 && (d = 100 - n);
|
|
2813
|
+
let m = this.cropSize.cropMode;
|
|
2784
2814
|
this.cropModes.find(
|
|
2785
|
-
(
|
|
2786
|
-
)?.auto && (
|
|
2815
|
+
(y) => y.value === m
|
|
2816
|
+
)?.auto && (m = "free"), t.detail.silent ? (this.cropSize.height = a, this.cropSize.keepAspectRatio = t.detail.keepAspectRatio, this.cropSize.percentageHeight = n, this.cropSize.percentageWidth = o, this.cropSize.ratioHeight = t.detail.height, this.cropSize.ratioWidth = t.detail.width, this.cropSize.unit = r.AspectRatio, this.cropSize.width = s) : this.cropSize = {
|
|
2787
2817
|
...this.cropSize,
|
|
2788
|
-
cropMode:
|
|
2818
|
+
cropMode: m,
|
|
2789
2819
|
height: a,
|
|
2790
2820
|
keepAspectRatio: t.detail.keepAspectRatio,
|
|
2791
|
-
percentageHeight:
|
|
2792
|
-
percentageWidth:
|
|
2821
|
+
percentageHeight: n,
|
|
2822
|
+
percentageWidth: o,
|
|
2793
2823
|
ratioHeight: t.detail.height,
|
|
2794
2824
|
ratioWidth: t.detail.width,
|
|
2795
2825
|
unit: r.AspectRatio,
|
|
2796
2826
|
width: s,
|
|
2797
2827
|
x: l,
|
|
2798
|
-
y:
|
|
2828
|
+
y: d
|
|
2799
2829
|
};
|
|
2800
2830
|
} else {
|
|
2801
2831
|
const i = this.asset ? t.detail.height * 100 / this.selectedFormat.height : 100, s = this.asset ? t.detail.width * 100 / this.selectedFormat.width : 100;
|
|
2802
|
-
let a = this.cropSize.x,
|
|
2803
|
-
a + s > 100 && (a = 100 - s),
|
|
2804
|
-
let
|
|
2832
|
+
let a = this.cropSize.x, n = this.cropSize.y;
|
|
2833
|
+
a + s > 100 && (a = 100 - s), n + i > 100 && (n = 100 - i);
|
|
2834
|
+
let o = this.cropSize.cropMode;
|
|
2805
2835
|
const l = this.cropModes.find(
|
|
2806
|
-
(
|
|
2836
|
+
(d) => d.value === o
|
|
2807
2837
|
)?.auto;
|
|
2808
|
-
(t.detail.breakAspectRatio || l) && (
|
|
2838
|
+
(t.detail.breakAspectRatio || l) && (o = "free"), t.detail.silent ? (this.cropSize.cropMode = o, this.cropSize.height = t.detail.height, this.cropSize.keepAspectRatio = t.detail.keepAspectRatio, this.cropSize.percentageHeight = i, this.cropSize.percentageWidth = s, this.cropSize.unit = r.Pixel, this.cropSize.width = t.detail.width, this.cropSize.x = a, this.cropSize.y = n) : this.cropSize = {
|
|
2809
2839
|
...this.cropSize,
|
|
2810
|
-
cropMode:
|
|
2840
|
+
cropMode: o,
|
|
2811
2841
|
height: t.detail.height,
|
|
2812
2842
|
keepAspectRatio: t.detail.keepAspectRatio,
|
|
2813
2843
|
percentageHeight: i,
|
|
@@ -2815,7 +2845,7 @@ let m = class extends q {
|
|
|
2815
2845
|
unit: r.Pixel,
|
|
2816
2846
|
width: t.detail.width,
|
|
2817
2847
|
x: a,
|
|
2818
|
-
y:
|
|
2848
|
+
y: n
|
|
2819
2849
|
};
|
|
2820
2850
|
}
|
|
2821
2851
|
e !== this.cropSize.unit && (this.cropSize = {
|
|
@@ -2833,43 +2863,43 @@ let m = class extends q {
|
|
|
2833
2863
|
});
|
|
2834
2864
|
}
|
|
2835
2865
|
onCropApply(t) {
|
|
2836
|
-
if (this.clearResetSnapshot(), this.lastAction =
|
|
2866
|
+
if (this.clearResetSnapshot(), this.lastAction = g.Crop, !this.asset) {
|
|
2837
2867
|
const {
|
|
2838
2868
|
focusMode: l,
|
|
2839
|
-
height:
|
|
2840
|
-
position:
|
|
2869
|
+
height: d,
|
|
2870
|
+
position: m,
|
|
2841
2871
|
ratioHeight: c,
|
|
2842
|
-
ratioWidth:
|
|
2843
|
-
unit:
|
|
2844
|
-
width:
|
|
2845
|
-
x
|
|
2846
|
-
y:
|
|
2872
|
+
ratioWidth: y,
|
|
2873
|
+
unit: A,
|
|
2874
|
+
width: p,
|
|
2875
|
+
x,
|
|
2876
|
+
y: b
|
|
2847
2877
|
} = this.cropSize, u = this.focusModes.find(
|
|
2848
|
-
(
|
|
2878
|
+
(w) => w.value === l
|
|
2849
2879
|
)?.auto ?? !1;
|
|
2850
|
-
if (
|
|
2851
|
-
|
|
2852
|
-
key:
|
|
2880
|
+
if (A === r.AspectRatio) {
|
|
2881
|
+
y && c && this.upsertTransformation({
|
|
2882
|
+
key: g.Crop,
|
|
2853
2883
|
value: {
|
|
2854
2884
|
focusMode: l,
|
|
2855
2885
|
isFocusModeAuto: u,
|
|
2856
|
-
position:
|
|
2886
|
+
position: m,
|
|
2857
2887
|
ratioHeight: c,
|
|
2858
|
-
ratioWidth:
|
|
2859
|
-
unit:
|
|
2888
|
+
ratioWidth: y,
|
|
2889
|
+
unit: A
|
|
2860
2890
|
}
|
|
2861
2891
|
});
|
|
2862
2892
|
return;
|
|
2863
2893
|
}
|
|
2864
|
-
(
|
|
2865
|
-
key:
|
|
2894
|
+
(d || p) && this.upsertTransformation({
|
|
2895
|
+
key: g.Crop,
|
|
2866
2896
|
value: {
|
|
2867
2897
|
focusMode: l,
|
|
2868
|
-
height:
|
|
2898
|
+
height: d,
|
|
2869
2899
|
isFocusModeAuto: u,
|
|
2870
|
-
position:
|
|
2871
|
-
unit:
|
|
2872
|
-
width:
|
|
2900
|
+
position: m,
|
|
2901
|
+
unit: A,
|
|
2902
|
+
width: p,
|
|
2873
2903
|
/**
|
|
2874
2904
|
* Without an asset there is no cropper to drag, so x/y are always the 0
|
|
2875
2905
|
* placeholder from cropSize's default — never a real manual offset. Omit
|
|
@@ -2877,8 +2907,8 @@ let m = class extends q {
|
|
|
2877
2907
|
* string) so `hasManualXY` in buildTransformationString doesn't spuriously
|
|
2878
2908
|
* suppress the focus mode / position `c_g_` gravity value.
|
|
2879
2909
|
*/
|
|
2880
|
-
x: Number.isFinite(
|
|
2881
|
-
y: Number.isFinite(
|
|
2910
|
+
x: Number.isFinite(x) && x !== 0 ? x : void 0,
|
|
2911
|
+
y: Number.isFinite(b) && b !== 0 ? b : void 0
|
|
2882
2912
|
}
|
|
2883
2913
|
});
|
|
2884
2914
|
return;
|
|
@@ -2886,38 +2916,38 @@ let m = class extends q {
|
|
|
2886
2916
|
const { height: e, mode: i, unit: s, width: a } = t.detail;
|
|
2887
2917
|
if (!this.cropperElement || !this.selectedFormat)
|
|
2888
2918
|
return;
|
|
2889
|
-
const
|
|
2890
|
-
(l) => l.value ===
|
|
2919
|
+
const n = this.cropSize.focusMode, o = this.focusModes.find(
|
|
2920
|
+
(l) => l.value === n
|
|
2891
2921
|
)?.auto ?? !1;
|
|
2892
2922
|
if (e && a && s) {
|
|
2893
|
-
let l = a,
|
|
2894
|
-
if (s === r.AspectRatio && (l = this.cropSize.percentageWidth * this.selectedFormat.width / 100,
|
|
2923
|
+
let l = a, d = e;
|
|
2924
|
+
if (s === r.AspectRatio && (l = this.cropSize.percentageWidth * this.selectedFormat.width / 100, d = this.cropSize.percentageHeight * this.selectedFormat.height / 100), i)
|
|
2895
2925
|
this.transformations = [
|
|
2896
2926
|
...this.transformations,
|
|
2897
2927
|
{
|
|
2898
|
-
key:
|
|
2928
|
+
key: g.Crop,
|
|
2899
2929
|
value: {
|
|
2900
|
-
focusMode:
|
|
2901
|
-
height:
|
|
2902
|
-
isFocusModeAuto:
|
|
2930
|
+
focusMode: n,
|
|
2931
|
+
height: d,
|
|
2932
|
+
isFocusModeAuto: o,
|
|
2903
2933
|
mode: i,
|
|
2904
2934
|
width: l
|
|
2905
2935
|
}
|
|
2906
2936
|
}
|
|
2907
2937
|
];
|
|
2908
2938
|
else {
|
|
2909
|
-
const
|
|
2939
|
+
const m = this.cropSize.x / 100 * this.selectedFormat.width, c = this.cropSize.y / 100 * this.selectedFormat.height;
|
|
2910
2940
|
this.transformations = [
|
|
2911
2941
|
...this.transformations,
|
|
2912
2942
|
{
|
|
2913
|
-
key:
|
|
2943
|
+
key: g.Crop,
|
|
2914
2944
|
value: {
|
|
2915
|
-
focusMode:
|
|
2916
|
-
height:
|
|
2917
|
-
isFocusModeAuto:
|
|
2945
|
+
focusMode: n,
|
|
2946
|
+
height: d,
|
|
2947
|
+
isFocusModeAuto: o,
|
|
2918
2948
|
unit: s,
|
|
2919
2949
|
width: l,
|
|
2920
|
-
x:
|
|
2950
|
+
x: m,
|
|
2921
2951
|
y: c
|
|
2922
2952
|
}
|
|
2923
2953
|
}
|
|
@@ -2926,10 +2956,10 @@ let m = class extends q {
|
|
|
2926
2956
|
} else i && (this.transformations = [
|
|
2927
2957
|
...this.transformations,
|
|
2928
2958
|
{
|
|
2929
|
-
key:
|
|
2959
|
+
key: g.Crop,
|
|
2930
2960
|
value: {
|
|
2931
|
-
focusMode:
|
|
2932
|
-
isFocusModeAuto:
|
|
2961
|
+
focusMode: n,
|
|
2962
|
+
isFocusModeAuto: o,
|
|
2933
2963
|
mode: i
|
|
2934
2964
|
}
|
|
2935
2965
|
}
|
|
@@ -2961,21 +2991,21 @@ let m = class extends q {
|
|
|
2961
2991
|
}
|
|
2962
2992
|
onResizeApply(t) {
|
|
2963
2993
|
const { height: e, unit: i, width: s } = t.detail;
|
|
2964
|
-
if (this.clearResetSnapshot(), this.lastAction =
|
|
2994
|
+
if (this.clearResetSnapshot(), this.lastAction = g.Resize, !this.asset) {
|
|
2965
2995
|
if (i === r.AspectRatio) {
|
|
2966
|
-
const { ratioHeight:
|
|
2967
|
-
|
|
2968
|
-
key:
|
|
2996
|
+
const { ratioHeight: d, ratioWidth: m } = this.resizeSize;
|
|
2997
|
+
m && d && this.upsertTransformation({
|
|
2998
|
+
key: g.Resize,
|
|
2969
2999
|
value: {
|
|
2970
|
-
ratioHeight:
|
|
2971
|
-
ratioWidth:
|
|
3000
|
+
ratioHeight: d,
|
|
3001
|
+
ratioWidth: m,
|
|
2972
3002
|
unit: i
|
|
2973
3003
|
}
|
|
2974
3004
|
});
|
|
2975
3005
|
return;
|
|
2976
3006
|
}
|
|
2977
3007
|
(e || s) && this.upsertTransformation({
|
|
2978
|
-
key:
|
|
3008
|
+
key: g.Resize,
|
|
2979
3009
|
value: {
|
|
2980
3010
|
height: e,
|
|
2981
3011
|
unit: i,
|
|
@@ -2986,16 +3016,16 @@ let m = class extends q {
|
|
|
2986
3016
|
}
|
|
2987
3017
|
if (!this.selectedFormat)
|
|
2988
3018
|
return;
|
|
2989
|
-
const a = this.selectedFormat.width || this.defaultSize.width,
|
|
2990
|
-
let
|
|
2991
|
-
this.resizeSize.unit !== i ? (
|
|
3019
|
+
const a = this.selectedFormat.width || this.defaultSize.width, n = this.selectedFormat.height || this.defaultSize.height;
|
|
3020
|
+
let o = s, l = e;
|
|
3021
|
+
this.resizeSize.unit !== i ? (o = a, l = n) : i === r.AspectRatio && (o = Math.round(s / e * n), l = n), this.transformations = [
|
|
2992
3022
|
...this.transformations,
|
|
2993
3023
|
{
|
|
2994
|
-
key:
|
|
3024
|
+
key: g.Resize,
|
|
2995
3025
|
value: {
|
|
2996
3026
|
height: l,
|
|
2997
3027
|
unit: i,
|
|
2998
|
-
width:
|
|
3028
|
+
width: o
|
|
2999
3029
|
}
|
|
3000
3030
|
}
|
|
3001
3031
|
];
|
|
@@ -3005,21 +3035,21 @@ let m = class extends q {
|
|
|
3005
3035
|
}
|
|
3006
3036
|
onRotationApply(t) {
|
|
3007
3037
|
const e = t.detail;
|
|
3008
|
-
if (this.clearResetSnapshot(), this.lastAction =
|
|
3038
|
+
if (this.clearResetSnapshot(), this.lastAction = g.Rotate, !this.asset) {
|
|
3009
3039
|
e ? this.upsertTransformation({
|
|
3010
|
-
key:
|
|
3040
|
+
key: g.Rotate,
|
|
3011
3041
|
value: {
|
|
3012
3042
|
rotation: e
|
|
3013
3043
|
}
|
|
3014
3044
|
}) : this.transformations = this.transformations.filter(
|
|
3015
|
-
(i) => i.key !==
|
|
3045
|
+
(i) => i.key !== g.Rotate
|
|
3016
3046
|
);
|
|
3017
3047
|
return;
|
|
3018
3048
|
}
|
|
3019
3049
|
this.selectedFormat && (this.transformations = [
|
|
3020
3050
|
...this.transformations,
|
|
3021
3051
|
{
|
|
3022
|
-
key:
|
|
3052
|
+
key: g.Rotate,
|
|
3023
3053
|
value: {
|
|
3024
3054
|
rotation: e
|
|
3025
3055
|
}
|
|
@@ -3028,9 +3058,9 @@ let m = class extends q {
|
|
|
3028
3058
|
}
|
|
3029
3059
|
onQualityChange(t) {
|
|
3030
3060
|
const e = t.detail;
|
|
3031
|
-
this.selectedFormat && (this.selectedFormat.quality = e), this.clearResetSnapshot(), this.lastAction =
|
|
3061
|
+
this.selectedFormat && (this.selectedFormat.quality = e), this.clearResetSnapshot(), this.lastAction = g.Quality;
|
|
3032
3062
|
const i = {
|
|
3033
|
-
key:
|
|
3063
|
+
key: g.Quality,
|
|
3034
3064
|
value: {
|
|
3035
3065
|
quality: e
|
|
3036
3066
|
}
|
|
@@ -3044,22 +3074,22 @@ let m = class extends q {
|
|
|
3044
3074
|
keepMetadata: e
|
|
3045
3075
|
}), !this.asset) {
|
|
3046
3076
|
e ? this.upsertTransformation({
|
|
3047
|
-
key:
|
|
3077
|
+
key: g.Metadata,
|
|
3048
3078
|
value: {
|
|
3049
3079
|
keepMetadata: e
|
|
3050
3080
|
}
|
|
3051
3081
|
}) : this.transformations = this.transformations.filter(
|
|
3052
|
-
(i) => i.key !==
|
|
3082
|
+
(i) => i.key !== g.Metadata
|
|
3053
3083
|
);
|
|
3054
3084
|
return;
|
|
3055
3085
|
}
|
|
3056
3086
|
e ? this.upsertTransformation({
|
|
3057
|
-
key:
|
|
3087
|
+
key: g.Metadata,
|
|
3058
3088
|
value: {
|
|
3059
3089
|
keepMetadata: e
|
|
3060
3090
|
}
|
|
3061
3091
|
}) : this.transformations = this.transformations.filter(
|
|
3062
|
-
(i) => i.key !==
|
|
3092
|
+
(i) => i.key !== g.Metadata
|
|
3063
3093
|
);
|
|
3064
3094
|
}
|
|
3065
3095
|
onExtensionChange(t) {
|
|
@@ -3071,7 +3101,7 @@ let m = class extends q {
|
|
|
3071
3101
|
}
|
|
3072
3102
|
syncQuality() {
|
|
3073
3103
|
const t = this.transformations.findLast(
|
|
3074
|
-
(e) => e.key ===
|
|
3104
|
+
(e) => e.key === g.Quality
|
|
3075
3105
|
)?.value?.quality;
|
|
3076
3106
|
this.selectedFormat && (this.selectedFormat = {
|
|
3077
3107
|
...this.selectedFormat,
|
|
@@ -3109,198 +3139,198 @@ let m = class extends q {
|
|
|
3109
3139
|
this.transformations = [], this.frozenIndex = -1, this.syncQuality();
|
|
3110
3140
|
}
|
|
3111
3141
|
render() {
|
|
3112
|
-
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(
|
|
3113
3143
|
!this.hideHeader,
|
|
3114
|
-
() => C`<cx-space class="asset-link-format__section-header" direction="horizontal" spacing="small" align-items="center" justify-content="space-between"><cx-typography variant="body3">${this.localize.term("transformations")}</cx-typography><cx-space direction="horizontal" spacing="3x-small" align-items="center"><cx-button class="asset-link-format__undo" variant="custom" ?disabled=${!this.hasUnfrozenTransformations && this.preResetTransformations === void 0} @click=${this.handleUndo}>${this.localize.term("undo")}</cx-button>${
|
|
3115
|
-
() =>
|
|
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
|
|
3116
3146
|
)}
|
|
3117
|
-
${
|
|
3147
|
+
${M(
|
|
3118
3148
|
!this.noFormat,
|
|
3119
|
-
() => C`<cx-asset-link-format-proxy class="asset-link-format__details" value=${this.selectedProxy || this.proxies?.[0]?.id || ""} ?open=${this.activeSetting === "cx-asset-link-format-proxy"} ?auto-format=${this.autoFormat} ?can-auto-format=${this.canAutoFormat} .items=${this.formats} ?loading=${this.loading && this.lastAction ===
|
|
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>`
|
|
3120
3150
|
)}
|
|
3121
|
-
${
|
|
3151
|
+
${M(
|
|
3122
3152
|
!this.noCrop,
|
|
3123
|
-
() => C`<cx-asset-link-format-crop class="asset-link-format__details" ?open=${this.activeSetting === "cx-asset-link-format-crop"} ?disabled-apply=${this.disabledCropApply} ?loading=${this.loading && this.lastAction ===
|
|
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>`
|
|
3124
3154
|
)}
|
|
3125
|
-
${
|
|
3155
|
+
${M(
|
|
3126
3156
|
!this.noResize,
|
|
3127
|
-
() => C`<cx-asset-link-format-resize class="asset-link-format__details" ?open=${this.activeSetting === "cx-asset-link-format-resize"} ?loading=${this.loading && this.lastAction ===
|
|
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>`
|
|
3128
3158
|
)}
|
|
3129
|
-
${
|
|
3159
|
+
${M(
|
|
3130
3160
|
!this.noRotate,
|
|
3131
|
-
() => C`<cx-asset-link-format-rotation class="asset-link-format__details" ?loading=${this.loading && this.lastAction ===
|
|
3132
|
-
)}<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(
|
|
3133
3163
|
!this.noMetadata,
|
|
3134
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>`
|
|
3135
3165
|
)}
|
|
3136
|
-
${
|
|
3166
|
+
${M(
|
|
3137
3167
|
this.useCustomExtension,
|
|
3138
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>`
|
|
3139
3169
|
)}</div>`;
|
|
3140
3170
|
}
|
|
3141
3171
|
};
|
|
3142
|
-
|
|
3143
|
-
|
|
3172
|
+
f.styles = [Q, Ee];
|
|
3173
|
+
f.dependencies = {
|
|
3144
3174
|
"cx-asset-link-format-crop": v,
|
|
3145
3175
|
"cx-asset-link-format-extension": Z,
|
|
3146
|
-
"cx-asset-link-format-metadata":
|
|
3147
|
-
"cx-asset-link-format-proxy":
|
|
3148
|
-
"cx-asset-link-format-quality":
|
|
3149
|
-
"cx-asset-link-format-resize":
|
|
3150
|
-
"cx-asset-link-format-rotation":
|
|
3176
|
+
"cx-asset-link-format-metadata": U,
|
|
3177
|
+
"cx-asset-link-format-proxy": I,
|
|
3178
|
+
"cx-asset-link-format-quality": H,
|
|
3179
|
+
"cx-asset-link-format-resize": k,
|
|
3180
|
+
"cx-asset-link-format-rotation": T,
|
|
3151
3181
|
"cx-button": Y,
|
|
3152
|
-
"cx-space":
|
|
3153
|
-
"cx-typography":
|
|
3182
|
+
"cx-space": B,
|
|
3183
|
+
"cx-typography": q
|
|
3154
3184
|
};
|
|
3155
|
-
|
|
3185
|
+
S([
|
|
3156
3186
|
h({ attribute: "base-url", type: String })
|
|
3157
|
-
],
|
|
3158
|
-
|
|
3187
|
+
], f.prototype, "baseUrl", 2);
|
|
3188
|
+
S([
|
|
3159
3189
|
h({ attribute: "token", type: String })
|
|
3160
|
-
],
|
|
3161
|
-
|
|
3190
|
+
], f.prototype, "token", 2);
|
|
3191
|
+
S([
|
|
3162
3192
|
h({ reflect: !1, type: Object })
|
|
3163
|
-
],
|
|
3164
|
-
|
|
3193
|
+
], f.prototype, "asset", 2);
|
|
3194
|
+
S([
|
|
3165
3195
|
h({ attribute: "crop-modes", reflect: !1, type: Array })
|
|
3166
|
-
],
|
|
3167
|
-
|
|
3196
|
+
], f.prototype, "cropModes", 2);
|
|
3197
|
+
S([
|
|
3168
3198
|
h({ attribute: "focus-modes", reflect: !1, type: Object })
|
|
3169
|
-
],
|
|
3170
|
-
|
|
3199
|
+
], f.prototype, "focusModes", 2);
|
|
3200
|
+
S([
|
|
3171
3201
|
h({ reflect: !1, type: Array })
|
|
3172
|
-
],
|
|
3173
|
-
|
|
3202
|
+
], f.prototype, "extensions", 2);
|
|
3203
|
+
S([
|
|
3174
3204
|
h({ reflect: !1, type: Array })
|
|
3175
|
-
],
|
|
3176
|
-
|
|
3205
|
+
], f.prototype, "proxies", 2);
|
|
3206
|
+
S([
|
|
3177
3207
|
h({ attribute: "for-cropper", reflect: !0, type: String })
|
|
3178
|
-
],
|
|
3179
|
-
|
|
3208
|
+
], f.prototype, "forCropper", 2);
|
|
3209
|
+
S([
|
|
3180
3210
|
h({ attribute: "use-session", reflect: !0, type: String })
|
|
3181
|
-
],
|
|
3182
|
-
|
|
3211
|
+
], f.prototype, "useSession", 2);
|
|
3212
|
+
S([
|
|
3183
3213
|
h({ reflect: !1, type: Array })
|
|
3184
|
-
],
|
|
3185
|
-
|
|
3214
|
+
], f.prototype, "transformations", 2);
|
|
3215
|
+
S([
|
|
3186
3216
|
h({ attribute: "selected-proxy", reflect: !0, type: String })
|
|
3187
|
-
],
|
|
3188
|
-
|
|
3217
|
+
], f.prototype, "selectedProxy", 2);
|
|
3218
|
+
S([
|
|
3189
3219
|
h({ attribute: "default-proxy", reflect: !0, type: String })
|
|
3190
|
-
],
|
|
3191
|
-
|
|
3220
|
+
], f.prototype, "defaultProxy", 2);
|
|
3221
|
+
S([
|
|
3192
3222
|
h({ attribute: "can-auto-format", reflect: !0, type: Boolean })
|
|
3193
|
-
],
|
|
3194
|
-
|
|
3223
|
+
], f.prototype, "canAutoFormat", 2);
|
|
3224
|
+
S([
|
|
3195
3225
|
h({ attribute: "auto-format", reflect: !0, type: Boolean })
|
|
3196
|
-
],
|
|
3197
|
-
|
|
3226
|
+
], f.prototype, "autoFormat", 2);
|
|
3227
|
+
S([
|
|
3198
3228
|
h({ attribute: "use-custom-extension", reflect: !0, type: Boolean })
|
|
3199
|
-
],
|
|
3200
|
-
|
|
3229
|
+
], f.prototype, "useCustomExtension", 2);
|
|
3230
|
+
S([
|
|
3201
3231
|
h({ attribute: "no-metadata", reflect: !0, type: Boolean })
|
|
3202
|
-
],
|
|
3203
|
-
|
|
3232
|
+
], f.prototype, "noMetadata", 2);
|
|
3233
|
+
S([
|
|
3204
3234
|
h({ attribute: "no-format", reflect: !0, type: Boolean })
|
|
3205
|
-
],
|
|
3206
|
-
|
|
3235
|
+
], f.prototype, "noFormat", 2);
|
|
3236
|
+
S([
|
|
3207
3237
|
h({ attribute: "no-crop", reflect: !0, type: Boolean })
|
|
3208
|
-
],
|
|
3209
|
-
|
|
3238
|
+
], f.prototype, "noCrop", 2);
|
|
3239
|
+
S([
|
|
3210
3240
|
h({ attribute: "no-resize", reflect: !0, type: Boolean })
|
|
3211
|
-
],
|
|
3212
|
-
|
|
3241
|
+
], f.prototype, "noResize", 2);
|
|
3242
|
+
S([
|
|
3213
3243
|
h({ attribute: "no-rotate", reflect: !0, type: Boolean })
|
|
3214
|
-
],
|
|
3215
|
-
|
|
3244
|
+
], f.prototype, "noRotate", 2);
|
|
3245
|
+
S([
|
|
3216
3246
|
h({ attribute: "last-image-size", reflect: !1, type: Object })
|
|
3217
|
-
],
|
|
3218
|
-
|
|
3247
|
+
], f.prototype, "lastImageSize", 2);
|
|
3248
|
+
S([
|
|
3219
3249
|
h({ attribute: "hide-header", reflect: !1, type: Boolean })
|
|
3220
|
-
],
|
|
3221
|
-
|
|
3250
|
+
], f.prototype, "hideHeader", 2);
|
|
3251
|
+
S([
|
|
3222
3252
|
h({ attribute: "can-reset", type: Boolean })
|
|
3223
|
-
],
|
|
3224
|
-
|
|
3253
|
+
], f.prototype, "canReset", 2);
|
|
3254
|
+
S([
|
|
3225
3255
|
h({ attribute: !1, reflect: !1, type: Object })
|
|
3226
|
-
],
|
|
3227
|
-
|
|
3228
|
-
|
|
3229
|
-
],
|
|
3230
|
-
|
|
3231
|
-
|
|
3232
|
-
],
|
|
3233
|
-
|
|
3234
|
-
|
|
3235
|
-
],
|
|
3236
|
-
|
|
3237
|
-
|
|
3238
|
-
],
|
|
3239
|
-
|
|
3240
|
-
|
|
3241
|
-
],
|
|
3242
|
-
|
|
3243
|
-
|
|
3244
|
-
],
|
|
3245
|
-
|
|
3246
|
-
|
|
3247
|
-
],
|
|
3248
|
-
|
|
3249
|
-
|
|
3250
|
-
],
|
|
3251
|
-
|
|
3252
|
-
|
|
3253
|
-
],
|
|
3254
|
-
|
|
3255
|
-
|
|
3256
|
-
],
|
|
3257
|
-
|
|
3258
|
-
|
|
3259
|
-
],
|
|
3260
|
-
|
|
3261
|
-
|
|
3262
|
-
],
|
|
3263
|
-
|
|
3264
|
-
|
|
3265
|
-
],
|
|
3266
|
-
|
|
3267
|
-
|
|
3268
|
-
],
|
|
3269
|
-
|
|
3256
|
+
], f.prototype, "queryElement", 2);
|
|
3257
|
+
S([
|
|
3258
|
+
R()
|
|
3259
|
+
], f.prototype, "activeSetting", 2);
|
|
3260
|
+
S([
|
|
3261
|
+
R()
|
|
3262
|
+
], f.prototype, "selectedFormat", 2);
|
|
3263
|
+
S([
|
|
3264
|
+
R()
|
|
3265
|
+
], f.prototype, "resizeSize", 2);
|
|
3266
|
+
S([
|
|
3267
|
+
R()
|
|
3268
|
+
], f.prototype, "cropSize", 2);
|
|
3269
|
+
S([
|
|
3270
|
+
R()
|
|
3271
|
+
], f.prototype, "rotation", 2);
|
|
3272
|
+
S([
|
|
3273
|
+
R()
|
|
3274
|
+
], f.prototype, "defaultSize", 2);
|
|
3275
|
+
S([
|
|
3276
|
+
R()
|
|
3277
|
+
], f.prototype, "cropperElement", 2);
|
|
3278
|
+
S([
|
|
3279
|
+
R()
|
|
3280
|
+
], f.prototype, "parameters", 2);
|
|
3281
|
+
S([
|
|
3282
|
+
R()
|
|
3283
|
+
], f.prototype, "loading", 2);
|
|
3284
|
+
S([
|
|
3285
|
+
R()
|
|
3286
|
+
], f.prototype, "lastAction", 2);
|
|
3287
|
+
S([
|
|
3288
|
+
R()
|
|
3289
|
+
], f.prototype, "frozenIndex", 2);
|
|
3290
|
+
S([
|
|
3291
|
+
R()
|
|
3292
|
+
], f.prototype, "preResetTransformations", 2);
|
|
3293
|
+
S([
|
|
3294
|
+
R()
|
|
3295
|
+
], f.prototype, "preResetAutoFormat", 2);
|
|
3296
|
+
S([
|
|
3297
|
+
R()
|
|
3298
|
+
], f.prototype, "preResetSelectedProxy", 2);
|
|
3299
|
+
S([
|
|
3270
3300
|
P("transformations")
|
|
3271
|
-
],
|
|
3272
|
-
|
|
3301
|
+
], f.prototype, "handleTransformationsChange", 1);
|
|
3302
|
+
S([
|
|
3273
3303
|
P("selectedProxy")
|
|
3274
|
-
],
|
|
3275
|
-
|
|
3304
|
+
], f.prototype, "handleSelectedProxyChange", 1);
|
|
3305
|
+
S([
|
|
3276
3306
|
P("loading")
|
|
3277
|
-
],
|
|
3278
|
-
|
|
3279
|
-
|
|
3280
|
-
],
|
|
3307
|
+
], f.prototype, "handleLoadingChange", 1);
|
|
3308
|
+
f = S([
|
|
3309
|
+
X("cx-asset-link-format")
|
|
3310
|
+
], f);
|
|
3281
3311
|
export {
|
|
3282
|
-
|
|
3312
|
+
f as C,
|
|
3283
3313
|
rt as F,
|
|
3284
|
-
|
|
3285
|
-
|
|
3286
|
-
|
|
3287
|
-
|
|
3288
|
-
|
|
3289
|
-
|
|
3290
|
-
|
|
3291
|
-
|
|
3292
|
-
|
|
3293
|
-
|
|
3294
|
-
|
|
3295
|
-
|
|
3296
|
-
|
|
3297
|
-
|
|
3298
|
-
|
|
3299
|
-
|
|
3300
|
-
|
|
3301
|
-
|
|
3302
|
-
|
|
3303
|
-
|
|
3304
|
-
|
|
3305
|
-
|
|
3314
|
+
Ft as M,
|
|
3315
|
+
Pe as a,
|
|
3316
|
+
Ae as b,
|
|
3317
|
+
Xt as c,
|
|
3318
|
+
Gi as d,
|
|
3319
|
+
Qi as e,
|
|
3320
|
+
Vi as f,
|
|
3321
|
+
Zt as g,
|
|
3322
|
+
xt as h,
|
|
3323
|
+
Jt as i,
|
|
3324
|
+
ut as j,
|
|
3325
|
+
mt as k,
|
|
3326
|
+
Dt as l,
|
|
3327
|
+
ft as m,
|
|
3328
|
+
gt as n,
|
|
3329
|
+
Nt as o,
|
|
3330
|
+
Xi as p,
|
|
3331
|
+
Qt as q,
|
|
3332
|
+
Bi as r,
|
|
3333
|
+
qi as s,
|
|
3334
|
+
ji as t,
|
|
3335
|
+
me as u
|
|
3306
3336
|
};
|