@orangelogic/design-system 2.151.0 → 2.152.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.Bctc22QM.js → asset-link-format.DzYh0_YS.js} +1127 -883
- package/library/chunks/{folder-select.TPHiDGrX.js → folder-select.BKAuh4GE.js} +1 -1
- package/library/chunks/{tree.BDAj1Xs2.js → tree.C2dPd6gt.js} +219 -245
- package/library/chunks/v4.CKZ6klMF.js +29 -0
- package/library/components/asset-link-format.js +1 -1
- package/library/components/atoms.js +1 -1
- package/library/components/file-on-demand.js +1 -1
- package/library/components/folder-select.js +2 -2
- package/library/components/molecules.js +1 -1
- package/library/components/organisms.js +1 -1
- package/library/components/tree-item.js +1 -1
- package/library/components/tree.js +6 -5
- package/library/components/types.js +16959 -17191
- package/library/package.json +1 -1
- package/library/packages/organisms/src/asset-link-format/asset-link-format.d.ts +7 -0
- package/package.json +1 -1
|
@@ -1,47 +1,48 @@
|
|
|
1
1
|
import "../components/cropper.js";
|
|
2
|
-
import { C as
|
|
3
|
-
import
|
|
4
|
-
import { C as
|
|
5
|
-
import { n, C as
|
|
6
|
-
import { h as
|
|
7
|
-
import { M as
|
|
2
|
+
import { C as K } from "./button.8syoJXYs.js";
|
|
3
|
+
import O from "../components/space.js";
|
|
4
|
+
import { C as L } from "./typography.IqHbnd3C.js";
|
|
5
|
+
import { n as l, C as U } from "./lib-cortex-element.CVMmyPMC.js";
|
|
6
|
+
import { h as M, a as Wt, C as Dt, S as Bt, b as qt, c as jt, d as Vt } from "./endpoints.CwgTrs4A.js";
|
|
7
|
+
import { M as Rt, U as o, T as u } from "./asset-link-format.QzzboHHE.js";
|
|
8
8
|
import "./browser.BHOCIF_A.js";
|
|
9
|
-
import { i as
|
|
9
|
+
import { i as B, x as A, E as Gt } from "./lit-element.jLBm65_O.js";
|
|
10
10
|
import "./form.CP9KLGjF.js";
|
|
11
|
-
import { L as
|
|
12
|
-
import { a as
|
|
11
|
+
import { L as q } from "./i18n.Bchq8v1d.js";
|
|
12
|
+
import { a as Qt } from "./string.BhJ0Zogu.js";
|
|
13
13
|
import "./date-picker.BGHn6qg8.js";
|
|
14
14
|
import "./content-builder.BU8X7I6V.js";
|
|
15
15
|
import "./unsafe-html.Dff7-rCx.js";
|
|
16
|
-
import { b as
|
|
17
|
-
import { c as
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import
|
|
25
|
-
import
|
|
26
|
-
import
|
|
27
|
-
import { C as
|
|
28
|
-
import { C as
|
|
29
|
-
import { C as
|
|
30
|
-
import
|
|
31
|
-
import
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
34
|
-
import {
|
|
35
|
-
import
|
|
36
|
-
import
|
|
37
|
-
import
|
|
38
|
-
|
|
39
|
-
|
|
16
|
+
import { b as Xt } from "./_baseUniq.je-HWbb3.js";
|
|
17
|
+
import { c as j } from "./component.styles.CRO4Odto.js";
|
|
18
|
+
import { b as Y } from "./transformation.DGzjBg6V.js";
|
|
19
|
+
import { v as Kt } from "./v4.CKZ6klMF.js";
|
|
20
|
+
import { c as V } from "./custom-element.L4WJXn1j.js";
|
|
21
|
+
import { w as F } from "./watch.DOt4Mabe.js";
|
|
22
|
+
import { s as $t, c as rt } from "./number.CtCaI0T_.js";
|
|
23
|
+
import { r as k } from "./state.CSDxrqLd.js";
|
|
24
|
+
import { n as _ } from "./when.Dr1es41R.js";
|
|
25
|
+
import tt from "../components/details.js";
|
|
26
|
+
import Zt from "../components/divider.js";
|
|
27
|
+
import { C as et } from "./icon.mxNZ85k0.js";
|
|
28
|
+
import { C as vt } from "./icon-button.DbVIFgu7.js";
|
|
29
|
+
import { C as bt } from "./input.BcyLZUmv.js";
|
|
30
|
+
import { C as ft } from "./option.qN3aaqVI.js";
|
|
31
|
+
import gt from "../components/select.js";
|
|
32
|
+
import { c as Yt } from "./image.QVlPFadX.js";
|
|
33
|
+
import { e as it } from "./query.BBf1UFkC.js";
|
|
34
|
+
import { c as ot } from "./repeat.CFjcER6_.js";
|
|
35
|
+
import { o as W } from "./style-map.llVFPd__.js";
|
|
36
|
+
import Nt from "../components/tooltip.js";
|
|
37
|
+
import Jt from "../components/button-group.js";
|
|
38
|
+
import { C as te } from "./checkbox.3i2j3PHc.js";
|
|
39
|
+
function ee(t) {
|
|
40
|
+
return t && t.length ? Xt(t) : [];
|
|
40
41
|
}
|
|
41
|
-
function
|
|
42
|
+
function ie(t) {
|
|
42
43
|
return typeof t == "object" && t !== null && "URI" in t;
|
|
43
44
|
}
|
|
44
|
-
const
|
|
45
|
+
const se = {
|
|
45
46
|
artist: "Artist",
|
|
46
47
|
color: "Color",
|
|
47
48
|
createDate: "CreateDate",
|
|
@@ -63,35 +64,35 @@ const Yt = {
|
|
|
63
64
|
systemIdentifier: "SystemIdentifier",
|
|
64
65
|
text: "Text",
|
|
65
66
|
title: "Title"
|
|
66
|
-
},
|
|
67
|
-
function
|
|
67
|
+
}, ae = /* @__PURE__ */ new Set(["mediaDate", "createDate", "editDate"]);
|
|
68
|
+
function zt(t) {
|
|
68
69
|
return !/[\s&+/*"\\:(),'<>~|[\]{}]/.test(t) && !/^(?:OR|AND|NOT)$/.test(t) ? t : `"${t.replace(/\\/g, "\\\\").replace(/"/g, '\\"')}"`;
|
|
69
70
|
}
|
|
70
|
-
function
|
|
71
|
-
const s = (Array.isArray(e) ? e : [e]).map((a) => `${t}:${
|
|
71
|
+
function Pt(t, e) {
|
|
72
|
+
const s = (Array.isArray(e) ? e : [e]).map((a) => `${t}:${zt(a)}`);
|
|
72
73
|
return s.length > 1 ? `(${s.join(" OR ")})` : s[0] ?? "";
|
|
73
74
|
}
|
|
74
|
-
function
|
|
75
|
+
function oe(t, e) {
|
|
75
76
|
return (Array.isArray(e) ? e : [e]).map((s) => `${t}${s.operator}${s.value}`).join(" AND ");
|
|
76
77
|
}
|
|
77
|
-
function
|
|
78
|
+
function re(t) {
|
|
78
79
|
const e = [];
|
|
79
80
|
for (const i of Object.keys(t)) {
|
|
80
81
|
const s = i, a = t[s];
|
|
81
82
|
if (a == null)
|
|
82
83
|
continue;
|
|
83
84
|
if (s === "custom") {
|
|
84
|
-
for (const [h,
|
|
85
|
+
for (const [h, n] of Object.entries(
|
|
85
86
|
a
|
|
86
87
|
))
|
|
87
|
-
e.push(
|
|
88
|
+
e.push(Pt(h, n));
|
|
88
89
|
continue;
|
|
89
90
|
}
|
|
90
|
-
const r =
|
|
91
|
+
const r = se[s];
|
|
91
92
|
if (r) {
|
|
92
|
-
if (
|
|
93
|
+
if (ae.has(s)) {
|
|
93
94
|
e.push(
|
|
94
|
-
|
|
95
|
+
oe(r, a)
|
|
95
96
|
);
|
|
96
97
|
continue;
|
|
97
98
|
}
|
|
@@ -103,57 +104,57 @@ function ee(t) {
|
|
|
103
104
|
const h = Array.isArray(a) ? a : [a];
|
|
104
105
|
if (h.length === 0)
|
|
105
106
|
continue;
|
|
106
|
-
const
|
|
107
|
-
...h.map((
|
|
108
|
-
...h.map((
|
|
107
|
+
const n = [
|
|
108
|
+
...h.map((d) => `ParentFolderIdentifier:${zt(String(d))}`),
|
|
109
|
+
...h.map((d) => `ParentAlbumIdentifier:${zt(String(d))}`)
|
|
109
110
|
];
|
|
110
|
-
e.push(`(${
|
|
111
|
+
e.push(`(${n.join(" OR ")})`);
|
|
111
112
|
continue;
|
|
112
113
|
}
|
|
113
|
-
e.push(
|
|
114
|
+
e.push(Pt(r, a));
|
|
114
115
|
}
|
|
115
116
|
}
|
|
116
117
|
return e.join(" AND ");
|
|
117
118
|
}
|
|
118
|
-
function
|
|
119
|
+
function ht(t) {
|
|
119
120
|
if ("and" in t)
|
|
120
|
-
return t.and.map(
|
|
121
|
+
return t.and.map(ht).filter(Boolean).join(" AND ");
|
|
121
122
|
if ("or" in t) {
|
|
122
|
-
const e = t.or.map(
|
|
123
|
+
const e = t.or.map(ht).filter(Boolean);
|
|
123
124
|
return e.length > 1 ? `(${e.join(" OR ")})` : e[0] ?? "";
|
|
124
125
|
}
|
|
125
126
|
if ("not" in t) {
|
|
126
|
-
const e =
|
|
127
|
+
const e = ht(t.not);
|
|
127
128
|
return e ? `NOT (${e})` : "";
|
|
128
129
|
}
|
|
129
|
-
return
|
|
130
|
+
return re(t);
|
|
130
131
|
}
|
|
131
|
-
const
|
|
132
|
+
const wt = "CoreField.LargeSizePreview", nt = "CoreField.DocType", he = "Document.Title", ne = "Document.CaptionLong", lt = "Document.FileExtension", Ft = "CoreField.FileSize", Mt = "CoreField.Identifier", _t = "CoreField.Keywords", ct = "CoreField.MaxHeight", pt = "CoreField.MaxWidth", dt = "Document.RecordID", It = "CoreField.DocSubType", Ot = "CoreField.TitleWithFallback", ut = "CoreField.OriginalFileName", mt = "CoreField.UpdatedFileName", J = "CoreField.OriginalPreview", St = {
|
|
132
133
|
DEFAULT_VIEW_SIZE: "Document.LargeSizePreview",
|
|
133
134
|
FIELD_TITLE_WITH_FALLBACK: "Document.TitleWithFallback",
|
|
134
135
|
ORIGINAL_VIEW_SIZE: "Document.OriginalPreview"
|
|
135
|
-
},
|
|
136
|
-
[
|
|
137
|
-
[
|
|
138
|
-
[
|
|
139
|
-
},
|
|
140
|
-
Object.entries(
|
|
136
|
+
}, Lt = {
|
|
137
|
+
[wt]: St.DEFAULT_VIEW_SIZE,
|
|
138
|
+
[Ot]: St.FIELD_TITLE_WITH_FALLBACK,
|
|
139
|
+
[J]: St.ORIGINAL_VIEW_SIZE
|
|
140
|
+
}, le = Object.fromEntries(
|
|
141
|
+
Object.entries(Lt).map(([t, e]) => [
|
|
141
142
|
e,
|
|
142
143
|
t
|
|
143
144
|
])
|
|
144
145
|
);
|
|
145
|
-
function
|
|
146
|
-
return
|
|
146
|
+
function ce(t) {
|
|
147
|
+
return Lt[t] ?? t;
|
|
147
148
|
}
|
|
148
|
-
function
|
|
149
|
+
function Et(t) {
|
|
149
150
|
const e = {};
|
|
150
151
|
for (const [i, s] of Object.entries(t)) {
|
|
151
|
-
const a =
|
|
152
|
+
const a = le[i] ?? i;
|
|
152
153
|
e[a] = s;
|
|
153
154
|
}
|
|
154
155
|
return e;
|
|
155
156
|
}
|
|
156
|
-
async function
|
|
157
|
+
async function Ut({
|
|
157
158
|
countPerPage: t,
|
|
158
159
|
fields: e,
|
|
159
160
|
getPermanentAssetsPaths: i,
|
|
@@ -161,49 +162,49 @@ async function Dt({
|
|
|
161
162
|
pageNumber: a,
|
|
162
163
|
query: r,
|
|
163
164
|
securityByPassToken: h,
|
|
164
|
-
siteUrl:
|
|
165
|
-
sort:
|
|
166
|
-
token:
|
|
165
|
+
siteUrl: n,
|
|
166
|
+
sort: d,
|
|
167
|
+
token: m,
|
|
167
168
|
useSession: c
|
|
168
169
|
}) {
|
|
169
|
-
const
|
|
170
|
+
const f = e?.map(ce);
|
|
170
171
|
try {
|
|
171
|
-
return (await
|
|
172
|
-
baseURL:
|
|
173
|
-
headers:
|
|
172
|
+
return (await M.request({
|
|
173
|
+
baseURL: n,
|
|
174
|
+
headers: m ? { Authorization: `Bearer ${m}` } : void 0,
|
|
174
175
|
method: "GET",
|
|
175
176
|
params: {
|
|
176
177
|
CountPerPage: t,
|
|
177
|
-
Fields:
|
|
178
|
+
Fields: ee(f),
|
|
178
179
|
Format: "json",
|
|
179
180
|
GetPermanentAssetsPaths: i || void 0,
|
|
180
181
|
PageNumber: a,
|
|
181
|
-
Query:
|
|
182
|
+
Query: ht(r),
|
|
182
183
|
SecurityByPassToken: h || void 0,
|
|
183
|
-
Sort:
|
|
184
|
+
Sort: d || void 0,
|
|
184
185
|
UseSession: c || void 0
|
|
185
186
|
},
|
|
186
187
|
paramsSerializer: { indexes: null },
|
|
187
188
|
responseType: "json",
|
|
188
189
|
transformResponse: [
|
|
189
|
-
...Array.isArray(
|
|
190
|
-
s ? (
|
|
191
|
-
items: (
|
|
192
|
-
sort:
|
|
193
|
-
totalCount:
|
|
194
|
-
}) : (
|
|
195
|
-
items: (
|
|
196
|
-
sort:
|
|
197
|
-
totalCount:
|
|
190
|
+
...Array.isArray(M.defaults.transformResponse) ? M.defaults.transformResponse : [],
|
|
191
|
+
s ? (p) => ({
|
|
192
|
+
items: (p.results?.Items ?? []).map(Et),
|
|
193
|
+
sort: p.results?.GlobalInfo?.Sort ?? "",
|
|
194
|
+
totalCount: p.results?.GlobalInfo?.TotalCount ?? 0
|
|
195
|
+
}) : (p) => ({
|
|
196
|
+
items: (p.APIResponse?.Items ?? []).map(Et),
|
|
197
|
+
sort: p.APIResponse?.GlobalInfo?.Sort ?? "",
|
|
198
|
+
totalCount: p.APIResponse?.GlobalInfo?.TotalCount ?? 0
|
|
198
199
|
})
|
|
199
200
|
],
|
|
200
|
-
url: s ?
|
|
201
|
+
url: s ? Dt.SEARCH_ASSETS : Bt["4.0"]
|
|
201
202
|
})).data;
|
|
202
203
|
} catch {
|
|
203
204
|
return { items: [], sort: "", totalCount: 0 };
|
|
204
205
|
}
|
|
205
206
|
}
|
|
206
|
-
async function
|
|
207
|
+
async function pe({
|
|
207
208
|
assetId: t,
|
|
208
209
|
extension: e,
|
|
209
210
|
format: i,
|
|
@@ -213,13 +214,13 @@ async function re({
|
|
|
213
214
|
useSession: h
|
|
214
215
|
}) {
|
|
215
216
|
try {
|
|
216
|
-
return (await
|
|
217
|
+
return (await M.request({
|
|
217
218
|
baseURL: s,
|
|
218
219
|
method: "GET",
|
|
219
220
|
params: {
|
|
220
221
|
SourceAssetFormat: i,
|
|
221
222
|
SourceAssetRecordID: t,
|
|
222
|
-
TargetExtension:
|
|
223
|
+
TargetExtension: Qt(e),
|
|
223
224
|
Token: a || void 0,
|
|
224
225
|
Transformations: r,
|
|
225
226
|
UseSession: h || void 0
|
|
@@ -229,20 +230,20 @@ async function re({
|
|
|
229
230
|
*/
|
|
230
231
|
timeout: 3e5,
|
|
231
232
|
// 5 minutes
|
|
232
|
-
url:
|
|
233
|
+
url: Wt.GET_TRANSFORM_ASSET_LINK
|
|
233
234
|
})).data;
|
|
234
235
|
} catch {
|
|
235
236
|
return null;
|
|
236
237
|
}
|
|
237
238
|
}
|
|
238
|
-
const
|
|
239
|
-
function
|
|
239
|
+
const de = 50;
|
|
240
|
+
function ue(t, e) {
|
|
240
241
|
const i = [];
|
|
241
242
|
for (let s = 0; s < t.length; s += e)
|
|
242
243
|
i.push(t.slice(s, s + e));
|
|
243
244
|
return i;
|
|
244
245
|
}
|
|
245
|
-
async function
|
|
246
|
+
async function me({
|
|
246
247
|
extraFields: t,
|
|
247
248
|
getPermanentAssetsPaths: e,
|
|
248
249
|
isSiteBuilder: i,
|
|
@@ -252,51 +253,51 @@ async function xi({
|
|
|
252
253
|
}) {
|
|
253
254
|
if (!Array.isArray(s) || s.length === 0)
|
|
254
255
|
return { facets: [], items: [], totalCount: 0 };
|
|
255
|
-
const h = t?.filter((
|
|
256
|
+
const h = t?.filter((p) => p && typeof p == "string") ?? [], n = [
|
|
256
257
|
...h,
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
],
|
|
264
|
-
|
|
265
|
-
(
|
|
266
|
-
countPerPage:
|
|
267
|
-
fields:
|
|
258
|
+
J,
|
|
259
|
+
mt,
|
|
260
|
+
ut,
|
|
261
|
+
he,
|
|
262
|
+
ne,
|
|
263
|
+
dt
|
|
264
|
+
], d = ue(s, de), m = await Promise.all(
|
|
265
|
+
d.map(
|
|
266
|
+
(p) => Ut({
|
|
267
|
+
countPerPage: p.length,
|
|
268
|
+
fields: n,
|
|
268
269
|
getPermanentAssetsPaths: e,
|
|
269
270
|
isSiteBuilder: i,
|
|
270
271
|
pageNumber: 1,
|
|
271
|
-
query: { recordId:
|
|
272
|
+
query: { recordId: p },
|
|
272
273
|
securityByPassToken: a,
|
|
273
274
|
token: r
|
|
274
275
|
})
|
|
275
276
|
)
|
|
276
|
-
), c = new Map(s.map((
|
|
277
|
-
let
|
|
278
|
-
return
|
|
279
|
-
name:
|
|
280
|
-
originalUrl:
|
|
281
|
-
recordId:
|
|
277
|
+
), c = new Map(s.map((p, w) => [p, w])), f = m.flatMap((p) => p.items).map((p) => {
|
|
278
|
+
let w = C(p, mt);
|
|
279
|
+
return w === "" && (w = C(p, ut)), {
|
|
280
|
+
name: w,
|
|
281
|
+
originalUrl: C(p, J),
|
|
282
|
+
recordId: C(p, dt),
|
|
282
283
|
...h.reduce(
|
|
283
|
-
(
|
|
284
|
+
(R, x) => (R[x] = C(p, x), R),
|
|
284
285
|
{}
|
|
285
286
|
)
|
|
286
287
|
};
|
|
287
288
|
}).sort(
|
|
288
|
-
(
|
|
289
|
-
),
|
|
290
|
-
(
|
|
289
|
+
(p, w) => (c.get(p.recordId) ?? 1 / 0) - (c.get(w.recordId) ?? 1 / 0)
|
|
290
|
+
), S = m.reduce(
|
|
291
|
+
(p, w) => p + w.totalCount,
|
|
291
292
|
0
|
|
292
293
|
);
|
|
293
|
-
return { facets: [], items:
|
|
294
|
+
return { facets: [], items: f, totalCount: S };
|
|
294
295
|
}
|
|
295
|
-
function
|
|
296
|
+
function C(t, e) {
|
|
296
297
|
const i = t[e];
|
|
297
|
-
return i == null ? "" : typeof i == "string" ? i : typeof i == "number" || typeof i == "boolean" ? String(i) :
|
|
298
|
+
return i == null ? "" : typeof i == "string" ? i : typeof i == "number" || typeof i == "boolean" ? String(i) : ie(i) ? i.URI : "";
|
|
298
299
|
}
|
|
299
|
-
async function
|
|
300
|
+
async function fe({
|
|
300
301
|
countPerPage: t,
|
|
301
302
|
directParentFolderIdentifier: e,
|
|
302
303
|
extraFields: i,
|
|
@@ -304,75 +305,75 @@ async function yi({
|
|
|
304
305
|
isSiteBuilder: a,
|
|
305
306
|
limitedDocTypes: r,
|
|
306
307
|
pageNumber: h,
|
|
307
|
-
parentFolderIdentifier:
|
|
308
|
-
searchTerm:
|
|
309
|
-
securityByPassToken:
|
|
308
|
+
parentFolderIdentifier: n,
|
|
309
|
+
searchTerm: d,
|
|
310
|
+
securityByPassToken: m,
|
|
310
311
|
sortOrder: c,
|
|
311
|
-
token:
|
|
312
|
+
token: f
|
|
312
313
|
}) {
|
|
313
|
-
if (!e && !
|
|
314
|
+
if (!e && !n)
|
|
314
315
|
return { facets: [], items: [], totalCount: 0 };
|
|
315
|
-
const
|
|
316
|
+
const S = (i?.filter((x) => x && typeof x == "string") ?? []).map((x) => x.replace("%20", " ")), p = {
|
|
316
317
|
directParentFolderIdentifier: e,
|
|
317
|
-
parentFolderIdentifier:
|
|
318
|
-
...r.length > 0 ? { docType: [
|
|
319
|
-
},
|
|
318
|
+
parentFolderIdentifier: n,
|
|
319
|
+
...r.length > 0 ? { docType: [Rt.Image, Rt.Audio] } : {}
|
|
320
|
+
}, w = await Ut({
|
|
320
321
|
countPerPage: t,
|
|
321
322
|
fields: [
|
|
322
|
-
...
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
$t,
|
|
327
|
-
Mt,
|
|
323
|
+
...S,
|
|
324
|
+
Ot,
|
|
325
|
+
wt,
|
|
326
|
+
J,
|
|
328
327
|
_t,
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
328
|
+
pt,
|
|
329
|
+
ct,
|
|
330
|
+
Ft,
|
|
331
|
+
nt,
|
|
332
|
+
It,
|
|
333
|
+
Mt,
|
|
334
|
+
lt,
|
|
335
|
+
dt,
|
|
336
|
+
ut,
|
|
337
|
+
mt
|
|
337
338
|
],
|
|
338
339
|
getPermanentAssetsPaths: s,
|
|
339
340
|
isSiteBuilder: a,
|
|
340
341
|
pageNumber: h,
|
|
341
|
-
query:
|
|
342
|
-
securityByPassToken:
|
|
342
|
+
query: p,
|
|
343
|
+
securityByPassToken: m,
|
|
343
344
|
sort: void 0,
|
|
344
|
-
token:
|
|
345
|
-
}),
|
|
346
|
-
let
|
|
347
|
-
|
|
348
|
-
const yt =
|
|
345
|
+
token: f
|
|
346
|
+
}), R = w.items.map((x) => {
|
|
347
|
+
let E = C(x, lt), P = C(x, mt), st = C(x, wt);
|
|
348
|
+
E && !E.startsWith(".") && (E = "." + E), P === "" && (P = C(x, ut)), E.toLowerCase() === ".gif" && (st = C(x, J));
|
|
349
|
+
const yt = C(x, dt);
|
|
349
350
|
return {
|
|
350
|
-
docSubType:
|
|
351
|
-
docType:
|
|
352
|
-
extension:
|
|
353
|
-
height:
|
|
351
|
+
docSubType: C(x, It),
|
|
352
|
+
docType: C(x, nt) || "",
|
|
353
|
+
extension: E,
|
|
354
|
+
height: C(x, ct) || "0",
|
|
354
355
|
id: yt,
|
|
355
|
-
identifier:
|
|
356
|
-
imageUrl:
|
|
357
|
-
name:
|
|
358
|
-
originalUrl:
|
|
356
|
+
identifier: C(x, Mt),
|
|
357
|
+
imageUrl: st,
|
|
358
|
+
name: P,
|
|
359
|
+
originalUrl: C(x, J),
|
|
359
360
|
recordId: yt,
|
|
360
|
-
size:
|
|
361
|
-
tags:
|
|
362
|
-
width:
|
|
363
|
-
...
|
|
364
|
-
(
|
|
361
|
+
size: C(x, Ft) || "0 MB",
|
|
362
|
+
tags: C(x, _t),
|
|
363
|
+
width: C(x, pt) || "0",
|
|
364
|
+
...S.reduce(
|
|
365
|
+
(Q, at) => (Q[at] = C(x, at), Q),
|
|
365
366
|
{}
|
|
366
367
|
)
|
|
367
368
|
};
|
|
368
369
|
});
|
|
369
370
|
return {
|
|
370
371
|
facets: [],
|
|
371
|
-
items:
|
|
372
|
-
totalCount:
|
|
372
|
+
items: R,
|
|
373
|
+
totalCount: w.totalCount
|
|
373
374
|
};
|
|
374
375
|
}
|
|
375
|
-
async function
|
|
376
|
+
async function ge({
|
|
376
377
|
autoCropMode: t,
|
|
377
378
|
cropHeight: e,
|
|
378
379
|
cropWidth: i,
|
|
@@ -380,7 +381,7 @@ async function le({
|
|
|
380
381
|
useSession: a
|
|
381
382
|
}) {
|
|
382
383
|
try {
|
|
383
|
-
return (await
|
|
384
|
+
return (await M.request({
|
|
384
385
|
method: "GET",
|
|
385
386
|
params: {
|
|
386
387
|
AutoCropMode: t,
|
|
@@ -393,7 +394,7 @@ async function le({
|
|
|
393
394
|
timeout: 3e5,
|
|
394
395
|
// 5 minutes
|
|
395
396
|
transformResponse: [
|
|
396
|
-
...Array.isArray(
|
|
397
|
+
...Array.isArray(M.defaults.transformResponse) ? M.defaults.transformResponse : [],
|
|
397
398
|
(h) => ({
|
|
398
399
|
height: h.cropHeight,
|
|
399
400
|
width: h.cropWidth,
|
|
@@ -401,13 +402,13 @@ async function le({
|
|
|
401
402
|
y: h.cropY
|
|
402
403
|
})
|
|
403
404
|
],
|
|
404
|
-
url:
|
|
405
|
+
url: Wt.GET_CROP_ZONE_SUGGESTION
|
|
405
406
|
})).data;
|
|
406
407
|
} catch {
|
|
407
408
|
return null;
|
|
408
409
|
}
|
|
409
410
|
}
|
|
410
|
-
async function
|
|
411
|
+
async function ki({
|
|
411
412
|
assetRecordId: t,
|
|
412
413
|
isSiteBuilder: e,
|
|
413
414
|
siteUrl: i,
|
|
@@ -415,7 +416,7 @@ async function Si({
|
|
|
415
416
|
useSession: a
|
|
416
417
|
}) {
|
|
417
418
|
try {
|
|
418
|
-
return (await
|
|
419
|
+
return (await M.request({
|
|
419
420
|
baseURL: i,
|
|
420
421
|
method: "GET",
|
|
421
422
|
params: {
|
|
@@ -425,35 +426,35 @@ async function Si({
|
|
|
425
426
|
},
|
|
426
427
|
responseType: "json",
|
|
427
428
|
transformResponse: [
|
|
428
|
-
...Array.isArray(
|
|
429
|
-
(h) => !h || typeof h != "object" ? [] : h.proxies?.map((
|
|
430
|
-
cdnName:
|
|
431
|
-
extension:
|
|
432
|
-
formatHeight:
|
|
433
|
-
formatWidth:
|
|
434
|
-
height:
|
|
435
|
-
permanentLink:
|
|
436
|
-
proxyLabel:
|
|
437
|
-
proxyName:
|
|
438
|
-
width:
|
|
429
|
+
...Array.isArray(M.defaults.transformResponse) ? M.defaults.transformResponse : [],
|
|
430
|
+
(h) => !h || typeof h != "object" ? [] : h.proxies?.map((n) => ({
|
|
431
|
+
cdnName: n.cdnName,
|
|
432
|
+
extension: n.extension,
|
|
433
|
+
formatHeight: n.formatHeight,
|
|
434
|
+
formatWidth: n.formatWidth,
|
|
435
|
+
height: n.height,
|
|
436
|
+
permanentLink: n.permanentLink,
|
|
437
|
+
proxyLabel: n.proxyLabel,
|
|
438
|
+
proxyName: n.proxyName,
|
|
439
|
+
width: n.width
|
|
439
440
|
})) ?? []
|
|
440
441
|
],
|
|
441
|
-
url: e ?
|
|
442
|
+
url: e ? Dt.GET_AVAILABLE_PROXIES : Vt
|
|
442
443
|
})).data;
|
|
443
444
|
} catch {
|
|
444
445
|
return [];
|
|
445
446
|
}
|
|
446
447
|
}
|
|
447
|
-
async function
|
|
448
|
+
async function Ri({
|
|
448
449
|
siteUrl: t
|
|
449
450
|
} = {}) {
|
|
450
451
|
try {
|
|
451
|
-
return (await
|
|
452
|
+
return (await M.request({
|
|
452
453
|
baseURL: t,
|
|
453
454
|
method: "GET",
|
|
454
455
|
responseType: "json",
|
|
455
456
|
transformResponse: [
|
|
456
|
-
...Array.isArray(
|
|
457
|
+
...Array.isArray(M.defaults.transformResponse) ? M.defaults.transformResponse : [],
|
|
457
458
|
(i) => !i || typeof i != "object" ? {
|
|
458
459
|
formatsByDocType: {
|
|
459
460
|
Audio: {},
|
|
@@ -465,13 +466,13 @@ async function zi({
|
|
|
465
466
|
formatsByDocType: i.formatsByDocType ?? {}
|
|
466
467
|
}
|
|
467
468
|
],
|
|
468
|
-
url:
|
|
469
|
+
url: qt
|
|
469
470
|
})).data;
|
|
470
471
|
} catch {
|
|
471
472
|
return { formatsByDocType: {} };
|
|
472
473
|
}
|
|
473
474
|
}
|
|
474
|
-
async function
|
|
475
|
+
async function $i({
|
|
475
476
|
recordIds: t,
|
|
476
477
|
rightsToCheck: e
|
|
477
478
|
}) {
|
|
@@ -482,27 +483,260 @@ async function Ai({
|
|
|
482
483
|
invalidObjects: []
|
|
483
484
|
};
|
|
484
485
|
try {
|
|
485
|
-
const { data: s } = await
|
|
486
|
+
const { data: s } = await M.request({
|
|
486
487
|
method: "GET",
|
|
487
488
|
params: { RecordIDs: t, RightsToCheck: e },
|
|
488
489
|
paramsSerializer: { indexes: null },
|
|
489
490
|
responseType: "json",
|
|
490
|
-
url:
|
|
491
|
+
url: jt.GET_AUTHORIZED_OBJECTS
|
|
491
492
|
});
|
|
492
493
|
return s;
|
|
493
494
|
} catch {
|
|
494
495
|
return i;
|
|
495
496
|
}
|
|
496
497
|
}
|
|
497
|
-
const
|
|
498
|
-
|
|
499
|
-
|
|
498
|
+
const Ht = 20, Tt = "TR1", xe = /* @__PURE__ */ new Set([
|
|
499
|
+
".avif",
|
|
500
|
+
".bmp",
|
|
501
|
+
".gif",
|
|
502
|
+
".ico",
|
|
503
|
+
".jpeg",
|
|
504
|
+
".jpg",
|
|
505
|
+
".png",
|
|
506
|
+
".svg",
|
|
507
|
+
".webp"
|
|
508
|
+
]);
|
|
509
|
+
function At(t) {
|
|
510
|
+
const e = t.toLowerCase(), i = e.startsWith(".") ? e : `.${e}`;
|
|
511
|
+
return xe.has(i);
|
|
512
|
+
}
|
|
513
|
+
class Pi {
|
|
514
|
+
constructor(e, i) {
|
|
515
|
+
this.data = [], this.folderId = "", this.fetchedPages = /* @__PURE__ */ new Set(), this.totalCount = 0, this.maxEnd = 1 / 0, this.pageSize = Ht, this.requestEpoch = 0, this.host = e, this.host.addController?.(this);
|
|
516
|
+
const s = i?.maxEnd;
|
|
517
|
+
this.maxEnd = typeof s == "number" && Number.isFinite(s) && s >= 0 ? Math.floor(s) : 1 / 0;
|
|
518
|
+
const a = i?.pageSize;
|
|
519
|
+
this.pageSize = typeof a == "number" && Number.isFinite(a) && a >= 1 ? Math.floor(a) : Ht, this.authToken = i?.token, this.securityByPassToken = i?.securityByPassToken, this.isSiteBuilder = i?.isSiteBuilder ?? !1;
|
|
520
|
+
}
|
|
521
|
+
get totalDataCount() {
|
|
522
|
+
return this.totalCount;
|
|
523
|
+
}
|
|
524
|
+
setSecurityByPassToken(e) {
|
|
525
|
+
this.securityByPassToken !== e && (this.securityByPassToken = e, this.resetPageCache());
|
|
526
|
+
}
|
|
527
|
+
async fetchImages({
|
|
528
|
+
end: e,
|
|
529
|
+
extraFields: i = [],
|
|
530
|
+
format: s,
|
|
531
|
+
start: a,
|
|
532
|
+
transformations: r
|
|
533
|
+
}) {
|
|
534
|
+
if (e < a)
|
|
535
|
+
return this.data;
|
|
536
|
+
if (this.totalCount > 0 && e >= this.totalCount && (e = this.totalCount - 1, e < a))
|
|
537
|
+
return this.data;
|
|
538
|
+
const h = this.requestEpoch;
|
|
539
|
+
if (!this.folderId || h !== this.requestEpoch)
|
|
540
|
+
return this.data;
|
|
541
|
+
const n = s ? `path_${s}` : void 0, d = s === "TRX", m = `path_${Tt}`, c = n ? d && n !== m ? [n, m] : [n] : [], f = Math.floor(a / this.pageSize) + 1, S = Math.floor(e / this.pageSize) + 1;
|
|
542
|
+
for (let p = f; p <= S; p++) {
|
|
543
|
+
if (this.fetchedPages.has(p))
|
|
544
|
+
continue;
|
|
545
|
+
const w = await fe({
|
|
546
|
+
countPerPage: this.pageSize,
|
|
547
|
+
directParentFolderIdentifier: this.folderId,
|
|
548
|
+
extraFields: [...i, ...c],
|
|
549
|
+
getPermanentAssetsPaths: c.length > 0 || void 0,
|
|
550
|
+
isSiteBuilder: this.isSiteBuilder,
|
|
551
|
+
limitedDocTypes: ["DO_DOCUMENTS.Image_DbBO.*"],
|
|
552
|
+
pageNumber: p,
|
|
553
|
+
searchTerm: "",
|
|
554
|
+
securityByPassToken: this.securityByPassToken,
|
|
555
|
+
sortOrder: "",
|
|
556
|
+
token: this.authToken
|
|
557
|
+
});
|
|
558
|
+
if (h !== this.requestEpoch)
|
|
559
|
+
return this.data;
|
|
560
|
+
if (this.fetchedPages.add(p), !this.totalCount && w.totalCount) {
|
|
561
|
+
const x = Math.min(this.maxEnd, w.totalCount);
|
|
562
|
+
this.totalCount = x, this.data = Array.from({ length: x }, () => ({
|
|
563
|
+
alt: "",
|
|
564
|
+
id: `temp-${Kt()}`,
|
|
565
|
+
name: "",
|
|
566
|
+
src: ""
|
|
567
|
+
}));
|
|
568
|
+
}
|
|
569
|
+
const R = (p - 1) * this.pageSize;
|
|
570
|
+
for (let x = 0; x < w.items.length; x++) {
|
|
571
|
+
const E = R + x;
|
|
572
|
+
if (E < this.data.length) {
|
|
573
|
+
const P = w.items[x], st = !P.extension || At(P.extension);
|
|
574
|
+
let Q = n && (!d || st) && P[n] || d && !st && P[m] || P.imageUrl;
|
|
575
|
+
Q && r && r.length > 0 && (Q = Y({ baseUrl: Q, transformations: r })), this.data[E] = {
|
|
576
|
+
alt: P.name,
|
|
577
|
+
docType: P.docType,
|
|
578
|
+
id: P.id,
|
|
579
|
+
name: P.name,
|
|
580
|
+
src: Q,
|
|
581
|
+
...i.reduce(
|
|
582
|
+
(at, kt) => (at[kt] = P[kt] ?? "", at),
|
|
583
|
+
{}
|
|
584
|
+
)
|
|
585
|
+
};
|
|
586
|
+
}
|
|
587
|
+
}
|
|
588
|
+
}
|
|
589
|
+
}
|
|
590
|
+
async fetchImagesInFolderBySlide({
|
|
591
|
+
activeSlide: e,
|
|
592
|
+
extraFields: i = [],
|
|
593
|
+
folderId: s,
|
|
594
|
+
forceRefetch: a = !1,
|
|
595
|
+
format: r,
|
|
596
|
+
minLimit: h = 5,
|
|
597
|
+
noPlaceholders: n = !1,
|
|
598
|
+
transformations: d
|
|
599
|
+
}) {
|
|
600
|
+
(!this.folderId || this.folderId !== s) && (this.folderId = s, this.resetFolderState()), a && this.resetPageCache();
|
|
601
|
+
const m = Math.max(5, h), c = e, f = e + m, S = [
|
|
602
|
+
...i,
|
|
603
|
+
ct,
|
|
604
|
+
pt
|
|
605
|
+
];
|
|
606
|
+
await this.fetchImages({
|
|
607
|
+
end: f,
|
|
608
|
+
extraFields: S.filter((R) => R !== ""),
|
|
609
|
+
format: r,
|
|
610
|
+
start: c,
|
|
611
|
+
transformations: d
|
|
612
|
+
});
|
|
613
|
+
let p = e - m;
|
|
614
|
+
p < 0 && (this.totalCount === 0 ? p = 0 : p = Math.max(0, this.totalCount + p));
|
|
615
|
+
const w = p + m;
|
|
616
|
+
return await this.fetchImages({
|
|
617
|
+
end: w,
|
|
618
|
+
extraFields: S.filter((R) => R !== ""),
|
|
619
|
+
format: r,
|
|
620
|
+
start: p,
|
|
621
|
+
transformations: d
|
|
622
|
+
}), n ? this.data.filter((R) => R.id && !R.id.startsWith("temp-")) : this.data;
|
|
623
|
+
}
|
|
624
|
+
async fetchImagesByIDs({
|
|
625
|
+
extraFields: e = [],
|
|
626
|
+
format: i,
|
|
627
|
+
recordIds: s,
|
|
628
|
+
transformations: a
|
|
629
|
+
}) {
|
|
630
|
+
if (s.length === 0)
|
|
631
|
+
return [];
|
|
632
|
+
const r = i ? `path_${i}` : void 0, h = i === "TRX", n = `path_${Tt}`, d = r ? h && r !== n ? [r, n] : [r] : [], m = h ? [lt] : [], c = [
|
|
633
|
+
...e,
|
|
634
|
+
nt,
|
|
635
|
+
ct,
|
|
636
|
+
pt
|
|
637
|
+
];
|
|
638
|
+
return (await me({
|
|
639
|
+
extraFields: [...c, ...d, ...m].filter((S) => S !== ""),
|
|
640
|
+
getPermanentAssetsPaths: d.length > 0 || void 0,
|
|
641
|
+
isSiteBuilder: this.isSiteBuilder,
|
|
642
|
+
recordIds: s,
|
|
643
|
+
securityByPassToken: this.securityByPassToken,
|
|
644
|
+
token: this.authToken
|
|
645
|
+
})).items.map((S) => {
|
|
646
|
+
const p = h && S[lt] || "", w = !p || At(p);
|
|
647
|
+
let x = r && (!h || w) && S[r] || h && !w && S[n] || S.originalUrl;
|
|
648
|
+
return x && a && a.length > 0 && (x = Y({ baseUrl: x, transformations: a })), {
|
|
649
|
+
alt: S.name,
|
|
650
|
+
docType: S[nt],
|
|
651
|
+
id: S.recordId,
|
|
652
|
+
name: S.name,
|
|
653
|
+
src: x,
|
|
654
|
+
...c.reduce(
|
|
655
|
+
(E, P) => (E[P] = S[P] ?? "", E),
|
|
656
|
+
{}
|
|
657
|
+
)
|
|
658
|
+
};
|
|
659
|
+
});
|
|
660
|
+
}
|
|
661
|
+
async fetchImagesInFolderByPage({
|
|
662
|
+
extraFields: e = [],
|
|
663
|
+
folderId: i,
|
|
664
|
+
forceRefetch: s = !1,
|
|
665
|
+
format: a,
|
|
666
|
+
noPlaceholders: r = !1,
|
|
667
|
+
page: h,
|
|
668
|
+
pageSize: n = 10,
|
|
669
|
+
transformations: d
|
|
670
|
+
}) {
|
|
671
|
+
(!this.folderId || this.folderId !== i) && (this.folderId = i, this.resetFolderState()), s && this.resetPageCache();
|
|
672
|
+
const m = h * n, c = m + n - 1;
|
|
673
|
+
return await this.fetchImages({
|
|
674
|
+
end: c,
|
|
675
|
+
extraFields: e,
|
|
676
|
+
format: a,
|
|
677
|
+
start: m,
|
|
678
|
+
transformations: d
|
|
679
|
+
}), r ? this.data.filter((f) => f.id && !f.id.startsWith("temp-")) : this.data;
|
|
680
|
+
}
|
|
681
|
+
async *fetchImagesInFolderByChunk({
|
|
682
|
+
chunkSize: e = 10,
|
|
683
|
+
end: i = 0,
|
|
684
|
+
extraFields: s = [],
|
|
685
|
+
folderId: a,
|
|
686
|
+
forceRefetch: r = !1,
|
|
687
|
+
format: h,
|
|
688
|
+
start: n = 0,
|
|
689
|
+
transformations: d
|
|
690
|
+
}) {
|
|
691
|
+
const m = Math.max(1, e);
|
|
692
|
+
if ((!this.folderId || this.folderId !== a) && (this.folderId = a, this.resetFolderState()), r && this.resetPageCache(), i !== -1) {
|
|
693
|
+
await this.fetchImages({
|
|
694
|
+
end: i,
|
|
695
|
+
extraFields: s,
|
|
696
|
+
format: h,
|
|
697
|
+
start: n,
|
|
698
|
+
transformations: d
|
|
699
|
+
}), yield this.data;
|
|
700
|
+
return;
|
|
701
|
+
}
|
|
702
|
+
let c = n, f = n + m;
|
|
703
|
+
if (await this.fetchImages({
|
|
704
|
+
end: f,
|
|
705
|
+
extraFields: s,
|
|
706
|
+
format: h,
|
|
707
|
+
start: c,
|
|
708
|
+
transformations: d
|
|
709
|
+
}), yield this.data, !(!this.totalCount || this.totalCount <= f))
|
|
710
|
+
for (; f < this.totalCount; )
|
|
711
|
+
c = f, f = Math.min(f + m, this.totalCount), await this.fetchImages({
|
|
712
|
+
end: f,
|
|
713
|
+
extraFields: s,
|
|
714
|
+
format: h,
|
|
715
|
+
start: c,
|
|
716
|
+
transformations: d
|
|
717
|
+
}), yield this.data;
|
|
718
|
+
}
|
|
719
|
+
hostConnected() {
|
|
720
|
+
}
|
|
721
|
+
hostDisconnected() {
|
|
722
|
+
this.resetFolderState();
|
|
723
|
+
}
|
|
724
|
+
resetPageCache() {
|
|
725
|
+
this.requestEpoch += 1, this.data = [], this.totalCount = 0, this.fetchedPages.clear();
|
|
726
|
+
}
|
|
727
|
+
resetFolderState() {
|
|
728
|
+
this.resetPageCache();
|
|
729
|
+
}
|
|
730
|
+
}
|
|
731
|
+
const ye = B`.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}`, Se = B`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}`;
|
|
732
|
+
var ze = Object.defineProperty, we = Object.getOwnPropertyDescriptor, v = (t, e, i, s) => {
|
|
733
|
+
for (var a = s > 1 ? void 0 : s ? we(e, i) : e, r = t.length - 1, h; r >= 0; r--)
|
|
500
734
|
(h = t[r]) && (a = (s ? h(e, i, a) : h(a)) || a);
|
|
501
|
-
return s && a &&
|
|
735
|
+
return s && a && ze(e, i, a), a;
|
|
502
736
|
};
|
|
503
|
-
let
|
|
737
|
+
let z = class extends U {
|
|
504
738
|
constructor() {
|
|
505
|
-
super(...arguments), this.localize = new
|
|
739
|
+
super(...arguments), this.localize = new q(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 = o.Pixel, this.disabledApply = !1, this.noRatioModes = !1, this.lastAppliedSetting = {
|
|
506
740
|
[o.Pixel]: {
|
|
507
741
|
height: 0,
|
|
508
742
|
percentageHeight: 100,
|
|
@@ -614,7 +848,7 @@ let g = class extends O {
|
|
|
614
848
|
const [s, a] = e.split(":").map(Number);
|
|
615
849
|
if (this.unit === o.Pixel) {
|
|
616
850
|
let r = s, h = a;
|
|
617
|
-
Number.isFinite(this.maxWidth) && Number.isFinite(this.maxHeight) && ({ height: h, width: r } =
|
|
851
|
+
Number.isFinite(this.maxWidth) && Number.isFinite(this.maxHeight) && ({ height: h, width: r } = Yt(
|
|
618
852
|
this.maxWidth,
|
|
619
853
|
this.maxHeight,
|
|
620
854
|
s,
|
|
@@ -724,150 +958,150 @@ let g = class extends O {
|
|
|
724
958
|
}
|
|
725
959
|
render() {
|
|
726
960
|
const t = this.cropModes.filter((i) => !i.auto), e = this.cropModes.filter((i) => i.auto);
|
|
727
|
-
return
|
|
961
|
+
return A`<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">${_(
|
|
728
962
|
!this.noRatioModes,
|
|
729
|
-
() =>
|
|
963
|
+
() => A`<cx-select data-testid="cx-asset-link-format-crop-mode" value=${this.cropMode} hoist style=${W({
|
|
730
964
|
width: "100%"
|
|
731
|
-
})} @cx-change=${this.onCropModeChange} ?disabled=${this.loading}>${
|
|
965
|
+
})} @cx-change=${this.onCropModeChange} ?disabled=${this.loading}>${ot(
|
|
732
966
|
t,
|
|
733
967
|
(i) => i.value,
|
|
734
|
-
({ label: i, value: s }) =>
|
|
968
|
+
({ label: i, value: s }) => A`<cx-option value=${s}>${i}</cx-option>`
|
|
735
969
|
)}
|
|
736
|
-
${
|
|
970
|
+
${_(
|
|
737
971
|
e.length > 0,
|
|
738
|
-
() =>
|
|
972
|
+
() => A`<cx-divider></cx-divider><small>${this.localize.term("autoCropping")}</small>`
|
|
739
973
|
)}
|
|
740
|
-
${
|
|
974
|
+
${ot(
|
|
741
975
|
e,
|
|
742
976
|
(i) => i.value,
|
|
743
|
-
({ label: i, value: s }) =>
|
|
977
|
+
({ label: i, value: s }) => A`<cx-option value=${s}>${i}</cx-option>`
|
|
744
978
|
)}</cx-select>`
|
|
745
979
|
)}<cx-space spacing="small"><div class="crop__input-group"><cx-input data-testid="cx-asset-link-format-crop-width" placeholder=${this.localize.term("width")} mask="num" .maskBlocks=${{ num: { mask: Number, min: 1 } }} value=${this.unit === o.Pixel ? this.width.toString() : this.ratioWidth.toString()} @cx-change=${this.handleInputChange} @cx-input=${this.handleWidthChange} required ?disabled=${this.loading}><cx-typography slot="prefix" variant="body3" part="input-label">
|
|
746
980
|
W
|
|
747
|
-
</cx-typography></cx-input><cx-icon-button data-testid="cx-asset-link-format-crop-aspect-ratio" name=${this.keepAspectRatio ? "insert_link" : "link_off"} @click=${this.handleAspectRatioClick} style=${
|
|
981
|
+
</cx-typography></cx-input><cx-icon-button data-testid="cx-asset-link-format-crop-aspect-ratio" name=${this.keepAspectRatio ? "insert_link" : "link_off"} @click=${this.handleAspectRatioClick} style=${W({
|
|
748
982
|
color: this.keepAspectRatio ? "var(--cx-color-primary)" : void 0
|
|
749
983
|
})} ?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 === o.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">
|
|
750
984
|
H
|
|
751
|
-
</cx-typography></cx-input></div>${
|
|
985
|
+
</cx-typography></cx-input></div>${_(
|
|
752
986
|
!this.noRatioModes,
|
|
753
|
-
() =>
|
|
754
|
-
)}</cx-space>${
|
|
987
|
+
() => A`<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=${o.Pixel}>${this.localize.term("pixels")}</cx-option><cx-option value=${o.AspectRatio}>${this.localize.term("aspectRatio")}</cx-option></cx-select>`
|
|
988
|
+
)}</cx-space>${_(
|
|
755
989
|
this.focusModes.length > 0,
|
|
756
|
-
() =>
|
|
990
|
+
() => A`<cx-select data-testid="cx-asset-link-format-crop-focus-mode" value=${this.focusMode} hoist style=${W({
|
|
757
991
|
width: "100%"
|
|
758
|
-
})} @cx-change=${this.onFocusModeChange} ?disabled=${this.loading || this.selectedMode?.disabledSize}>${
|
|
992
|
+
})} @cx-change=${this.onFocusModeChange} ?disabled=${this.loading || this.selectedMode?.disabledSize}>${ot(
|
|
759
993
|
this.focusModes,
|
|
760
994
|
(i) => i.value,
|
|
761
|
-
({ label: i, value: s }) =>
|
|
995
|
+
({ label: i, value: s }) => A`<cx-option value=${s}>${i}</cx-option>`
|
|
762
996
|
)}</cx-select>`
|
|
763
|
-
)}<cx-button data-testid="cx-asset-link-format-crop-apply" variant="primary" ?disabled=${this.disabledApply || this.invalidHeight || this.invalidWidth} ?loading=${this.loading} style=${
|
|
997
|
+
)}<cx-button data-testid="cx-asset-link-format-crop-apply" variant="primary" ?disabled=${this.disabledApply || this.invalidHeight || this.invalidWidth} ?loading=${this.loading} style=${W({
|
|
764
998
|
marginLeft: "auto"
|
|
765
999
|
})} @click=${this.handleApply}>${this.localize.term("apply")}</cx-button></cx-space></cx-details>`;
|
|
766
1000
|
}
|
|
767
1001
|
};
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
"cx-button":
|
|
771
|
-
"cx-details":
|
|
772
|
-
"cx-divider":
|
|
773
|
-
"cx-icon":
|
|
774
|
-
"cx-icon-button":
|
|
775
|
-
"cx-input":
|
|
776
|
-
"cx-option":
|
|
777
|
-
"cx-select":
|
|
778
|
-
"cx-space":
|
|
779
|
-
"cx-typography":
|
|
1002
|
+
z.styles = [j, Se];
|
|
1003
|
+
z.dependencies = {
|
|
1004
|
+
"cx-button": K,
|
|
1005
|
+
"cx-details": tt,
|
|
1006
|
+
"cx-divider": Zt,
|
|
1007
|
+
"cx-icon": et,
|
|
1008
|
+
"cx-icon-button": vt,
|
|
1009
|
+
"cx-input": bt,
|
|
1010
|
+
"cx-option": ft,
|
|
1011
|
+
"cx-select": gt,
|
|
1012
|
+
"cx-space": O,
|
|
1013
|
+
"cx-typography": L
|
|
780
1014
|
};
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
],
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
],
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
],
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
],
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
],
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
],
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
],
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
],
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
],
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
],
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
],
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
],
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
],
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
],
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
],
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
],
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
],
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
],
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
],
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
],
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
],
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
],
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
],
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
],
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
],
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
],
|
|
862
|
-
const
|
|
863
|
-
var
|
|
864
|
-
for (var a = s > 1 ? void 0 : s ?
|
|
1015
|
+
v([
|
|
1016
|
+
it(".details")
|
|
1017
|
+
], z.prototype, "base", 2);
|
|
1018
|
+
v([
|
|
1019
|
+
l({ reflect: !0, type: Boolean })
|
|
1020
|
+
], z.prototype, "open", 2);
|
|
1021
|
+
v([
|
|
1022
|
+
l({ reflect: !0, type: Number })
|
|
1023
|
+
], z.prototype, "width", 2);
|
|
1024
|
+
v([
|
|
1025
|
+
l({ reflect: !0, type: Number })
|
|
1026
|
+
], z.prototype, "height", 2);
|
|
1027
|
+
v([
|
|
1028
|
+
l({ attribute: "max-width", reflect: !0, type: Number })
|
|
1029
|
+
], z.prototype, "maxWidth", 2);
|
|
1030
|
+
v([
|
|
1031
|
+
l({ attribute: "max-height", reflect: !0, type: Number })
|
|
1032
|
+
], z.prototype, "maxHeight", 2);
|
|
1033
|
+
v([
|
|
1034
|
+
l({ attribute: "ratio-width", reflect: !0, type: Number })
|
|
1035
|
+
], z.prototype, "ratioWidth", 2);
|
|
1036
|
+
v([
|
|
1037
|
+
l({ attribute: "ratio-height", reflect: !0, type: Number })
|
|
1038
|
+
], z.prototype, "ratioHeight", 2);
|
|
1039
|
+
v([
|
|
1040
|
+
l({ attribute: "percentage-width", reflect: !0, type: Number })
|
|
1041
|
+
], z.prototype, "percentageWidth", 2);
|
|
1042
|
+
v([
|
|
1043
|
+
l({ attribute: "percentage-height", reflect: !0, type: Number })
|
|
1044
|
+
], z.prototype, "percentageHeight", 2);
|
|
1045
|
+
v([
|
|
1046
|
+
l({ reflect: !0, type: String })
|
|
1047
|
+
], z.prototype, "unit", 2);
|
|
1048
|
+
v([
|
|
1049
|
+
l({ attribute: "disabled-apply", reflect: !0, type: Boolean })
|
|
1050
|
+
], z.prototype, "disabledApply", 2);
|
|
1051
|
+
v([
|
|
1052
|
+
l({ attribute: "no-ratio-modes", reflect: !0, type: Boolean })
|
|
1053
|
+
], z.prototype, "noRatioModes", 2);
|
|
1054
|
+
v([
|
|
1055
|
+
l({ attribute: "last-applied-setting", reflect: !1, type: Object })
|
|
1056
|
+
], z.prototype, "lastAppliedSetting", 2);
|
|
1057
|
+
v([
|
|
1058
|
+
l({ reflect: !0, type: Boolean })
|
|
1059
|
+
], z.prototype, "loading", 2);
|
|
1060
|
+
v([
|
|
1061
|
+
l({ attribute: "crop-modes", reflect: !1, type: Array })
|
|
1062
|
+
], z.prototype, "cropModes", 2);
|
|
1063
|
+
v([
|
|
1064
|
+
l({ attribute: "focus-modes", reflect: !1, type: Object })
|
|
1065
|
+
], z.prototype, "focusModes", 2);
|
|
1066
|
+
v([
|
|
1067
|
+
l({ attribute: "focus-mode", reflect: !0, type: String })
|
|
1068
|
+
], z.prototype, "focusMode", 2);
|
|
1069
|
+
v([
|
|
1070
|
+
l({ attribute: "crop-mode", reflect: !0, type: String })
|
|
1071
|
+
], z.prototype, "cropMode", 2);
|
|
1072
|
+
v([
|
|
1073
|
+
l({ attribute: "keep-aspect-ratio", reflect: !0, type: Boolean })
|
|
1074
|
+
], z.prototype, "keepAspectRatio", 2);
|
|
1075
|
+
v([
|
|
1076
|
+
k()
|
|
1077
|
+
], z.prototype, "invalidWidth", 2);
|
|
1078
|
+
v([
|
|
1079
|
+
k()
|
|
1080
|
+
], z.prototype, "invalidHeight", 2);
|
|
1081
|
+
v([
|
|
1082
|
+
k()
|
|
1083
|
+
], z.prototype, "aspectRatio", 2);
|
|
1084
|
+
v([
|
|
1085
|
+
F("cropMode", { waitUntilFirstUpdate: !0 }),
|
|
1086
|
+
F("maxWidth", { waitUntilFirstUpdate: !0 }),
|
|
1087
|
+
F("maxHeight", { waitUntilFirstUpdate: !0 }),
|
|
1088
|
+
F("keepAspectRatio")
|
|
1089
|
+
], z.prototype, "handleCropModeChange", 1);
|
|
1090
|
+
v([
|
|
1091
|
+
F("open", { waitUntilFirstUpdate: !0 })
|
|
1092
|
+
], z.prototype, "handleOpenChange", 1);
|
|
1093
|
+
z = v([
|
|
1094
|
+
V("cx-asset-link-format-crop")
|
|
1095
|
+
], z);
|
|
1096
|
+
const Ae = B`.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%}}`;
|
|
1097
|
+
var ve = Object.defineProperty, be = Object.getOwnPropertyDescriptor, Ct = (t, e, i, s) => {
|
|
1098
|
+
for (var a = s > 1 ? void 0 : s ? be(e, i) : e, r = t.length - 1, h; r >= 0; r--)
|
|
865
1099
|
(h = t[r]) && (a = (s ? h(e, i, a) : h(a)) || a);
|
|
866
|
-
return s && a &&
|
|
1100
|
+
return s && a && ve(e, i, a), a;
|
|
867
1101
|
};
|
|
868
|
-
let
|
|
1102
|
+
let X = class extends U {
|
|
869
1103
|
constructor() {
|
|
870
|
-
super(...arguments), this.localize = new
|
|
1104
|
+
super(...arguments), this.localize = new q(this), this.value = "", this.items = [];
|
|
871
1105
|
}
|
|
872
1106
|
handleExtensionChange(t) {
|
|
873
1107
|
const e = t.target.value;
|
|
@@ -876,38 +1110,38 @@ let V = class extends O {
|
|
|
876
1110
|
});
|
|
877
1111
|
}
|
|
878
1112
|
render() {
|
|
879
|
-
return
|
|
1113
|
+
return A`<cx-space direction="vertical" spacing="small" class="extension"><cx-typography variant="body2">${this.localize.term("extension")}</cx-typography><cx-select data-label=${this.localize.term("extension")} data-testid="cx-asset-link-format-extension-select" value=${this.value} hoist @cx-change=${this.handleExtensionChange}>${ot(
|
|
880
1114
|
this.items,
|
|
881
1115
|
(t) => t.value,
|
|
882
|
-
(t) =>
|
|
1116
|
+
(t) => A`<cx-option value=${t.value}>${t.displayName}</cx-option>`
|
|
883
1117
|
)}</cx-select></cx-space>`;
|
|
884
1118
|
}
|
|
885
1119
|
};
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
"cx-option":
|
|
889
|
-
"cx-select":
|
|
890
|
-
"cx-space":
|
|
891
|
-
"cx-typography":
|
|
1120
|
+
X.styles = [j, Ae];
|
|
1121
|
+
X.dependencies = {
|
|
1122
|
+
"cx-option": ft,
|
|
1123
|
+
"cx-select": gt,
|
|
1124
|
+
"cx-space": O,
|
|
1125
|
+
"cx-typography": L
|
|
892
1126
|
};
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
],
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
],
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
],
|
|
902
|
-
const
|
|
903
|
-
var
|
|
904
|
-
for (var a = s > 1 ? void 0 : s ?
|
|
1127
|
+
Ct([
|
|
1128
|
+
l({ reflect: !0, type: String })
|
|
1129
|
+
], X.prototype, "value", 2);
|
|
1130
|
+
Ct([
|
|
1131
|
+
l({ reflect: !1, type: Array })
|
|
1132
|
+
], X.prototype, "items", 2);
|
|
1133
|
+
X = Ct([
|
|
1134
|
+
V("cx-asset-link-format-extension")
|
|
1135
|
+
], X);
|
|
1136
|
+
const Ce = B`cx-details::part(base){border-bottom-width:0}`;
|
|
1137
|
+
var ke = Object.defineProperty, Re = Object.getOwnPropertyDescriptor, D = (t, e, i, s) => {
|
|
1138
|
+
for (var a = s > 1 ? void 0 : s ? Re(e, i) : e, r = t.length - 1, h; r >= 0; r--)
|
|
905
1139
|
(h = t[r]) && (a = (s ? h(e, i, a) : h(a)) || a);
|
|
906
|
-
return s && a &&
|
|
1140
|
+
return s && a && ke(e, i, a), a;
|
|
907
1141
|
};
|
|
908
|
-
let
|
|
1142
|
+
let I = class extends U {
|
|
909
1143
|
constructor() {
|
|
910
|
-
super(...arguments), this.localize = new
|
|
1144
|
+
super(...arguments), this.localize = new q(this), this.open = !1, this.value = "", this.items = [], this.loading = !1, this.scopedValue = "";
|
|
911
1145
|
}
|
|
912
1146
|
handleValueChange() {
|
|
913
1147
|
this.scopedValue = this.value;
|
|
@@ -951,61 +1185,61 @@ let P = class extends O {
|
|
|
951
1185
|
t.target !== this.base && t.stopPropagation();
|
|
952
1186
|
}
|
|
953
1187
|
render() {
|
|
954
|
-
return
|
|
1188
|
+
return A`<cx-details class="details" ?open=${this.open} @cx-show=${this.onShowDetails} @cx-hide=${this.onHideDetails}><cx-space slot="summary" align-items="center"><div part="icon"><cx-icon name="photo_size_select_large"></cx-icon></div><cx-typography variant="body2">${this.localize.term("format")}</cx-typography></cx-space><cx-space direction="vertical" spacing="small" class="format"><cx-select data-label=${this.localize.term("imageFormat")} data-testid="cx-asset-link-format-proxy-select" value=${this.scopedValue} hoist @cx-change=${this.handleProxyChange} ?disabled=${this.loading}>${ot(
|
|
955
1189
|
this.items,
|
|
956
1190
|
(t) => t.id,
|
|
957
|
-
(t) =>
|
|
958
|
-
)}</cx-select><cx-button data-testid="cx-asset-link-format-proxy-apply" variant="primary" style=${
|
|
1191
|
+
(t) => A`<cx-option value=${t.id}>${t.proxyLabel}</cx-option>`
|
|
1192
|
+
)}</cx-select><cx-button data-testid="cx-asset-link-format-proxy-apply" variant="primary" style=${W({
|
|
959
1193
|
"margin-left": "auto"
|
|
960
1194
|
})} ?disabled=${this.scopedValue === this.value} ?loading=${this.loading} @click=${this.handleApply}>${this.localize.term("apply")}</cx-button></cx-space></cx-details>`;
|
|
961
1195
|
}
|
|
962
1196
|
};
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
"cx-button":
|
|
966
|
-
"cx-details":
|
|
967
|
-
"cx-icon":
|
|
968
|
-
"cx-option":
|
|
969
|
-
"cx-select":
|
|
970
|
-
"cx-space":
|
|
971
|
-
"cx-typography":
|
|
1197
|
+
I.styles = [j, Ce];
|
|
1198
|
+
I.dependencies = {
|
|
1199
|
+
"cx-button": K,
|
|
1200
|
+
"cx-details": tt,
|
|
1201
|
+
"cx-icon": et,
|
|
1202
|
+
"cx-option": ft,
|
|
1203
|
+
"cx-select": gt,
|
|
1204
|
+
"cx-space": O,
|
|
1205
|
+
"cx-typography": L
|
|
972
1206
|
};
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
],
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
],
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
],
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
],
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
],
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
],
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
],
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
],
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
],
|
|
1000
|
-
const
|
|
1001
|
-
var
|
|
1002
|
-
for (var a = s > 1 ? void 0 : s ?
|
|
1207
|
+
D([
|
|
1208
|
+
it(".details")
|
|
1209
|
+
], I.prototype, "base", 2);
|
|
1210
|
+
D([
|
|
1211
|
+
l({ reflect: !0, type: Boolean })
|
|
1212
|
+
], I.prototype, "open", 2);
|
|
1213
|
+
D([
|
|
1214
|
+
l({ reflect: !0, type: String })
|
|
1215
|
+
], I.prototype, "value", 2);
|
|
1216
|
+
D([
|
|
1217
|
+
l({ reflect: !1, type: Array })
|
|
1218
|
+
], I.prototype, "items", 2);
|
|
1219
|
+
D([
|
|
1220
|
+
l({ reflect: !0, type: Boolean })
|
|
1221
|
+
], I.prototype, "loading", 2);
|
|
1222
|
+
D([
|
|
1223
|
+
k()
|
|
1224
|
+
], I.prototype, "scopedValue", 2);
|
|
1225
|
+
D([
|
|
1226
|
+
F("value")
|
|
1227
|
+
], I.prototype, "handleValueChange", 1);
|
|
1228
|
+
D([
|
|
1229
|
+
F("open", { waitUntilFirstUpdate: !0 })
|
|
1230
|
+
], I.prototype, "handleOpenChange", 1);
|
|
1231
|
+
I = D([
|
|
1232
|
+
V("cx-asset-link-format-proxy")
|
|
1233
|
+
], I);
|
|
1234
|
+
const $e = B`cx-details::part(base){border-bottom-width:0}`;
|
|
1235
|
+
var Pe = Object.defineProperty, Fe = Object.getOwnPropertyDescriptor, Z = (t, e, i, s) => {
|
|
1236
|
+
for (var a = s > 1 ? void 0 : s ? Fe(e, i) : e, r = t.length - 1, h; r >= 0; r--)
|
|
1003
1237
|
(h = t[r]) && (a = (s ? h(e, i, a) : h(a)) || a);
|
|
1004
|
-
return s && a &&
|
|
1238
|
+
return s && a && Pe(e, i, a), a;
|
|
1005
1239
|
};
|
|
1006
|
-
let
|
|
1240
|
+
let T = class extends U {
|
|
1007
1241
|
constructor() {
|
|
1008
|
-
super(...arguments), this.localize = new
|
|
1242
|
+
super(...arguments), this.localize = new q(this), this.open = !1, this.value = 100, this.loading = !1, this.scopedValue = 100;
|
|
1009
1243
|
}
|
|
1010
1244
|
/**
|
|
1011
1245
|
* A computed property that checks if the current quality value is invalid.
|
|
@@ -1049,51 +1283,51 @@ let H = class extends O {
|
|
|
1049
1283
|
t.target !== this.base && t.stopPropagation();
|
|
1050
1284
|
}
|
|
1051
1285
|
render() {
|
|
1052
|
-
return
|
|
1286
|
+
return A`<cx-details class="details" ?open=${this.open} @cx-show=${this.onShowDetails} @cx-hide=${this.onHideDetails}><cx-space slot="summary" align-items="center"><div class="details__summary__icon"><div part="icon"><cx-icon name="blur_on"></cx-icon></div></div><cx-typography variant="body2">${this.localize.term("quality")}</cx-typography></cx-space><cx-space spacing="small"><cx-tooltip data-testid="cx-asset-link-format-quality-tooltip" content=${this.localize.term("qualityHelpText")} hoist><cx-input data-testid="cx-asset-link-format-quality" class="details__checkbox" mask="num" .maskBlocks=${{ num: { mask: Number, max: 100, min: 1 } }} value=${this.scopedValue.toString()} style=${W({
|
|
1053
1287
|
flex: "1"
|
|
1054
1288
|
})} @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>`;
|
|
1055
1289
|
}
|
|
1056
1290
|
};
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
"cx-button":
|
|
1060
|
-
"cx-details":
|
|
1061
|
-
"cx-icon":
|
|
1062
|
-
"cx-input":
|
|
1063
|
-
"cx-space":
|
|
1064
|
-
"cx-tooltip":
|
|
1065
|
-
"cx-typography":
|
|
1291
|
+
T.styles = [j, $e];
|
|
1292
|
+
T.dependencies = {
|
|
1293
|
+
"cx-button": K,
|
|
1294
|
+
"cx-details": tt,
|
|
1295
|
+
"cx-icon": et,
|
|
1296
|
+
"cx-input": bt,
|
|
1297
|
+
"cx-space": O,
|
|
1298
|
+
"cx-tooltip": Nt,
|
|
1299
|
+
"cx-typography": L
|
|
1066
1300
|
};
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
],
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
],
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
],
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
],
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
],
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
],
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
],
|
|
1088
|
-
const
|
|
1089
|
-
var
|
|
1090
|
-
for (var a = s > 1 ? void 0 : s ?
|
|
1301
|
+
Z([
|
|
1302
|
+
it(".details")
|
|
1303
|
+
], T.prototype, "base", 2);
|
|
1304
|
+
Z([
|
|
1305
|
+
l({ reflect: !0, type: Boolean })
|
|
1306
|
+
], T.prototype, "open", 2);
|
|
1307
|
+
Z([
|
|
1308
|
+
l({ reflect: !0, type: Number })
|
|
1309
|
+
], T.prototype, "value", 2);
|
|
1310
|
+
Z([
|
|
1311
|
+
l({ reflect: !0, type: Boolean })
|
|
1312
|
+
], T.prototype, "loading", 2);
|
|
1313
|
+
Z([
|
|
1314
|
+
k()
|
|
1315
|
+
], T.prototype, "scopedValue", 2);
|
|
1316
|
+
Z([
|
|
1317
|
+
F("value")
|
|
1318
|
+
], T.prototype, "handleValueChange", 1);
|
|
1319
|
+
T = Z([
|
|
1320
|
+
V("cx-asset-link-format-quality")
|
|
1321
|
+
], T);
|
|
1322
|
+
const Me = B`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}`;
|
|
1323
|
+
var _e = Object.defineProperty, Ie = Object.getOwnPropertyDescriptor, $ = (t, e, i, s) => {
|
|
1324
|
+
for (var a = s > 1 ? void 0 : s ? Ie(e, i) : e, r = t.length - 1, h; r >= 0; r--)
|
|
1091
1325
|
(h = t[r]) && (a = (s ? h(e, i, a) : h(a)) || a);
|
|
1092
|
-
return s && a &&
|
|
1326
|
+
return s && a && _e(e, i, a), a;
|
|
1093
1327
|
};
|
|
1094
|
-
let
|
|
1328
|
+
let b = class extends U {
|
|
1095
1329
|
constructor() {
|
|
1096
|
-
super(...arguments), this.localize = new
|
|
1330
|
+
super(...arguments), this.localize = new q(this), this.open = !1, this.width = 0, this.height = 0, this.maxWidth = 0, this.maxHeight = 0, this.ratioWidth = 1, this.ratioHeight = 1, this.unit = o.Pixel, this.lastAppliedSetting = {
|
|
1097
1331
|
[o.Pixel]: { height: 0, width: 0 },
|
|
1098
1332
|
[o.AspectRatio]: { height: 1, width: 1 }
|
|
1099
1333
|
}, this.loading = !1, this.noRatioModes = !1, this.keepAspectRatio = !1, this.invalidWidth = !1, this.invalidHeight = !1, this.aspectRatio = 0;
|
|
@@ -1230,101 +1464,101 @@ let v = class extends O {
|
|
|
1230
1464
|
});
|
|
1231
1465
|
}
|
|
1232
1466
|
render() {
|
|
1233
|
-
return
|
|
1467
|
+
return A`<cx-details class="details" ?open=${this.open} @cx-show=${this.onShowDetails} @cx-hide=${this.onHideDetails}><cx-space slot="summary" align-items="center"><div part="icon"><cx-icon name="aspect_ratio"></cx-icon></div><cx-typography variant="body2">${this.localize.term("resize")}</cx-typography></cx-space><cx-space direction="vertical" spacing="small"><cx-space spacing="small"><div class="resize__input-group"><cx-input data-testid="cx-asset-link-format-resize-width" placeholder=${this.localize.term("width")} mask="num" .maskBlocks=${{ num: { mask: Number, min: 1 } }} value=${this.unit === o.Pixel ? this.width.toString() : this.ratioWidth.toString()} @cx-input=${this.handleWidthChange} required ?disabled=${this.loading}><cx-typography slot="prefix" variant="body3" part="input-label">
|
|
1234
1468
|
W
|
|
1235
|
-
</cx-typography></cx-input><cx-icon-button data-testid="cx-asset-link-format-resize-aspect-ratio" name=${this.keepAspectRatio ? "insert_link" : "link_off"} @click=${this.handleAspectRatioClick} style=${
|
|
1469
|
+
</cx-typography></cx-input><cx-icon-button data-testid="cx-asset-link-format-resize-aspect-ratio" name=${this.keepAspectRatio ? "insert_link" : "link_off"} @click=${this.handleAspectRatioClick} style=${W({
|
|
1236
1470
|
color: this.keepAspectRatio ? "var(--cx-color-primary)" : void 0
|
|
1237
1471
|
})} ?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 === o.Pixel ? this.height.toString() : this.ratioHeight.toString()} @cx-input=${this.handleHeightChange} required ?disabled=${this.loading}><cx-typography slot="prefix" variant="body3" part="input-label">
|
|
1238
1472
|
H
|
|
1239
|
-
</cx-typography></cx-input></div>${
|
|
1473
|
+
</cx-typography></cx-input></div>${_(
|
|
1240
1474
|
!this.noRatioModes,
|
|
1241
|
-
() =>
|
|
1242
|
-
)}</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=${
|
|
1475
|
+
() => A`<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=${o.Pixel}>${this.localize.term("pixels")}</cx-option><cx-option value=${o.AspectRatio}>${this.localize.term("aspectRatio")}</cx-option></cx-select>`
|
|
1476
|
+
)}</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=${W({
|
|
1243
1477
|
marginLeft: "auto"
|
|
1244
1478
|
})} @click=${this.handleApply}>${this.localize.term("apply")}</cx-button></cx-space></cx-details>`;
|
|
1245
1479
|
}
|
|
1246
1480
|
};
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
"cx-button":
|
|
1250
|
-
"cx-details":
|
|
1251
|
-
"cx-icon":
|
|
1252
|
-
"cx-icon-button":
|
|
1253
|
-
"cx-input":
|
|
1254
|
-
"cx-option":
|
|
1255
|
-
"cx-select":
|
|
1256
|
-
"cx-space":
|
|
1257
|
-
"cx-typography":
|
|
1481
|
+
b.styles = [j, Me];
|
|
1482
|
+
b.dependencies = {
|
|
1483
|
+
"cx-button": K,
|
|
1484
|
+
"cx-details": tt,
|
|
1485
|
+
"cx-icon": et,
|
|
1486
|
+
"cx-icon-button": vt,
|
|
1487
|
+
"cx-input": bt,
|
|
1488
|
+
"cx-option": ft,
|
|
1489
|
+
"cx-select": gt,
|
|
1490
|
+
"cx-space": O,
|
|
1491
|
+
"cx-typography": L
|
|
1258
1492
|
};
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
],
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
],
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
],
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
],
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
],
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
],
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
],
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
],
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
],
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
],
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
],
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
],
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
],
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
],
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
],
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
],
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
],
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
],
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
],
|
|
1319
|
-
const
|
|
1320
|
-
var
|
|
1321
|
-
for (var a = s > 1 ? void 0 : s ?
|
|
1493
|
+
$([
|
|
1494
|
+
it(".details")
|
|
1495
|
+
], b.prototype, "base", 2);
|
|
1496
|
+
$([
|
|
1497
|
+
l({ reflect: !0, type: Boolean })
|
|
1498
|
+
], b.prototype, "open", 2);
|
|
1499
|
+
$([
|
|
1500
|
+
l({ reflect: !0, type: Number })
|
|
1501
|
+
], b.prototype, "width", 2);
|
|
1502
|
+
$([
|
|
1503
|
+
l({ reflect: !0, type: Number })
|
|
1504
|
+
], b.prototype, "height", 2);
|
|
1505
|
+
$([
|
|
1506
|
+
l({ attribute: "max-width", reflect: !0, type: Number })
|
|
1507
|
+
], b.prototype, "maxWidth", 2);
|
|
1508
|
+
$([
|
|
1509
|
+
l({ attribute: "max-height", reflect: !0, type: Number })
|
|
1510
|
+
], b.prototype, "maxHeight", 2);
|
|
1511
|
+
$([
|
|
1512
|
+
l({ attribute: "ratio-width", reflect: !0, type: Number })
|
|
1513
|
+
], b.prototype, "ratioWidth", 2);
|
|
1514
|
+
$([
|
|
1515
|
+
l({ attribute: "ratio-height", reflect: !0, type: Number })
|
|
1516
|
+
], b.prototype, "ratioHeight", 2);
|
|
1517
|
+
$([
|
|
1518
|
+
l({ reflect: !0, type: String })
|
|
1519
|
+
], b.prototype, "unit", 2);
|
|
1520
|
+
$([
|
|
1521
|
+
l({ attribute: "last-applied-setting", reflect: !1, type: Object })
|
|
1522
|
+
], b.prototype, "lastAppliedSetting", 2);
|
|
1523
|
+
$([
|
|
1524
|
+
l({ reflect: !0, type: Boolean })
|
|
1525
|
+
], b.prototype, "loading", 2);
|
|
1526
|
+
$([
|
|
1527
|
+
l({ attribute: "no-ratio-modes", reflect: !0, type: Boolean })
|
|
1528
|
+
], b.prototype, "noRatioModes", 2);
|
|
1529
|
+
$([
|
|
1530
|
+
l({ attribute: "keep-aspect-ratio", reflect: !0, type: Boolean })
|
|
1531
|
+
], b.prototype, "keepAspectRatio", 2);
|
|
1532
|
+
$([
|
|
1533
|
+
k()
|
|
1534
|
+
], b.prototype, "invalidWidth", 2);
|
|
1535
|
+
$([
|
|
1536
|
+
k()
|
|
1537
|
+
], b.prototype, "invalidHeight", 2);
|
|
1538
|
+
$([
|
|
1539
|
+
k()
|
|
1540
|
+
], b.prototype, "aspectRatio", 2);
|
|
1541
|
+
$([
|
|
1542
|
+
F("cropMode", { waitUntilFirstUpdate: !0 }),
|
|
1543
|
+
F("maxWidth", { waitUntilFirstUpdate: !0 }),
|
|
1544
|
+
F("maxHeight", { waitUntilFirstUpdate: !0 }),
|
|
1545
|
+
F("keepAspectRatio")
|
|
1546
|
+
], b.prototype, "handleCropModeChange", 1);
|
|
1547
|
+
$([
|
|
1548
|
+
F("open", { waitUntilFirstUpdate: !0 })
|
|
1549
|
+
], b.prototype, "handleOpenChange", 1);
|
|
1550
|
+
b = $([
|
|
1551
|
+
V("cx-asset-link-format-resize")
|
|
1552
|
+
], b);
|
|
1553
|
+
const Ee = B`cx-details::part(base){border-bottom-width:0}`;
|
|
1554
|
+
var He = Object.defineProperty, Te = Object.getOwnPropertyDescriptor, G = (t, e, i, s) => {
|
|
1555
|
+
for (var a = s > 1 ? void 0 : s ? Te(e, i) : e, r = t.length - 1, h; r >= 0; r--)
|
|
1322
1556
|
(h = t[r]) && (a = (s ? h(e, i, a) : h(a)) || a);
|
|
1323
|
-
return s && a &&
|
|
1557
|
+
return s && a && He(e, i, a), a;
|
|
1324
1558
|
};
|
|
1325
|
-
let
|
|
1559
|
+
let H = class extends U {
|
|
1326
1560
|
constructor() {
|
|
1327
|
-
super(...arguments), this.localize = new
|
|
1561
|
+
super(...arguments), this.localize = new q(this), this.open = !1, this.value = 0, this.defaultValue = 0, this.loading = !1, this.lastAppliedValue = 0;
|
|
1328
1562
|
}
|
|
1329
1563
|
handleOpenChange() {
|
|
1330
1564
|
this.open || this.emit("cx-asset-link-format-rotation-change", {
|
|
@@ -1335,14 +1569,14 @@ let F = class extends O {
|
|
|
1335
1569
|
const e = t.target.value, i = Number(e);
|
|
1336
1570
|
if (Number.isNaN(i))
|
|
1337
1571
|
return;
|
|
1338
|
-
const s =
|
|
1572
|
+
const s = $t(i);
|
|
1339
1573
|
(i > 360 || i < -360) && (t.target.value = s.toString()), this.emit("cx-asset-link-format-rotation-change", {
|
|
1340
1574
|
detail: s
|
|
1341
1575
|
});
|
|
1342
1576
|
}
|
|
1343
1577
|
handleButtonClick(t) {
|
|
1344
1578
|
this.emit("cx-asset-link-format-rotation-change", {
|
|
1345
|
-
detail:
|
|
1579
|
+
detail: $t(t)
|
|
1346
1580
|
});
|
|
1347
1581
|
}
|
|
1348
1582
|
handleClockwiseClick() {
|
|
@@ -1362,55 +1596,55 @@ let F = class extends O {
|
|
|
1362
1596
|
});
|
|
1363
1597
|
}
|
|
1364
1598
|
render() {
|
|
1365
|
-
return
|
|
1599
|
+
return A`<cx-details class="details" ?open=${this.open}><cx-space slot="summary" align-items="center"><div part="icon"><cx-icon name="rotate_90_degrees_cw"></cx-icon></div><cx-typography variant="body2">Rotate</cx-typography></cx-space><cx-space spacing="small"><cx-button-group label=${this.localize.term("history")}><cx-icon-button data-testid="cx-asset-link-format-rotation-ccw" name="rotate_90_degrees_ccw" label=${this.localize.term("undo")} outline size="small" ?disabled=${this.loading || this.value === -360} @click=${this.handleCounterClockwiseClick}></cx-icon-button><cx-icon-button data-testid="cx-asset-link-format-rotation-cw" name="rotate_90_degrees_cw" label=${this.localize.term("redo")} outline size="small" ?disabled=${this.loading || this.value === 360} @click=${this.handleClockwiseClick}></cx-icon-button></cx-button-group><cx-input data-testid="cx-asset-link-format-rotation" value=${(this.value + this.defaultValue).toString()} placeholder="0" mask="num" .maskBlocks=${{ num: { mask: Number, max: 360, min: -360, signed: !0 } }} ?disabled=${this.loading} style=${W({
|
|
1366
1600
|
flex: "none",
|
|
1367
1601
|
width: "80px"
|
|
1368
1602
|
})} @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>`;
|
|
1369
1603
|
}
|
|
1370
1604
|
};
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
"cx-button":
|
|
1374
|
-
"cx-button-group":
|
|
1375
|
-
"cx-details":
|
|
1376
|
-
"cx-icon":
|
|
1377
|
-
"cx-icon-button":
|
|
1378
|
-
"cx-space":
|
|
1379
|
-
"cx-typography":
|
|
1605
|
+
H.styles = [j, Ee];
|
|
1606
|
+
H.dependencies = {
|
|
1607
|
+
"cx-button": K,
|
|
1608
|
+
"cx-button-group": Jt,
|
|
1609
|
+
"cx-details": tt,
|
|
1610
|
+
"cx-icon": et,
|
|
1611
|
+
"cx-icon-button": vt,
|
|
1612
|
+
"cx-space": O,
|
|
1613
|
+
"cx-typography": L
|
|
1380
1614
|
};
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
],
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
],
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
],
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
],
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
],
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
],
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
],
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
],
|
|
1405
|
-
const
|
|
1406
|
-
var
|
|
1407
|
-
for (var a = s > 1 ? void 0 : s ?
|
|
1615
|
+
G([
|
|
1616
|
+
it(".details")
|
|
1617
|
+
], H.prototype, "base", 2);
|
|
1618
|
+
G([
|
|
1619
|
+
l({ reflect: !0, type: Boolean })
|
|
1620
|
+
], H.prototype, "open", 2);
|
|
1621
|
+
G([
|
|
1622
|
+
l({ reflect: !0, type: Number })
|
|
1623
|
+
], H.prototype, "value", 2);
|
|
1624
|
+
G([
|
|
1625
|
+
l({ attribute: "default-value", reflect: !0, type: Number })
|
|
1626
|
+
], H.prototype, "defaultValue", 2);
|
|
1627
|
+
G([
|
|
1628
|
+
l({ reflect: !0, type: Boolean })
|
|
1629
|
+
], H.prototype, "loading", 2);
|
|
1630
|
+
G([
|
|
1631
|
+
l({ attribute: "last-applied-value", reflect: !0, type: Number })
|
|
1632
|
+
], H.prototype, "lastAppliedValue", 2);
|
|
1633
|
+
G([
|
|
1634
|
+
F("open", { waitUntilFirstUpdate: !0 })
|
|
1635
|
+
], H.prototype, "handleOpenChange", 1);
|
|
1636
|
+
H = G([
|
|
1637
|
+
V("cx-asset-link-format-rotation")
|
|
1638
|
+
], H);
|
|
1639
|
+
const We = B`cx-details::part(base){border-bottom-width:0}`;
|
|
1640
|
+
var De = Object.defineProperty, Ne = Object.getOwnPropertyDescriptor, xt = (t, e, i, s) => {
|
|
1641
|
+
for (var a = s > 1 ? void 0 : s ? Ne(e, i) : e, r = t.length - 1, h; r >= 0; r--)
|
|
1408
1642
|
(h = t[r]) && (a = (s ? h(e, i, a) : h(a)) || a);
|
|
1409
|
-
return s && a &&
|
|
1643
|
+
return s && a && De(e, i, a), a;
|
|
1410
1644
|
};
|
|
1411
|
-
let
|
|
1645
|
+
let N = class extends U {
|
|
1412
1646
|
constructor() {
|
|
1413
|
-
super(...arguments), this.localize = new
|
|
1647
|
+
super(...arguments), this.localize = new q(this), this.open = !1, this.value = !1;
|
|
1414
1648
|
}
|
|
1415
1649
|
handleApply(t) {
|
|
1416
1650
|
this.emit("cx-asset-link-format-metadata-change", {
|
|
@@ -1434,39 +1668,39 @@ let T = class extends O {
|
|
|
1434
1668
|
t.target !== this.base && t.stopPropagation();
|
|
1435
1669
|
}
|
|
1436
1670
|
render() {
|
|
1437
|
-
return
|
|
1671
|
+
return A`<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>`;
|
|
1438
1672
|
}
|
|
1439
1673
|
};
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
"cx-button":
|
|
1443
|
-
"cx-checkbox":
|
|
1444
|
-
"cx-details":
|
|
1445
|
-
"cx-icon":
|
|
1446
|
-
"cx-space":
|
|
1447
|
-
"cx-tooltip":
|
|
1448
|
-
"cx-typography":
|
|
1674
|
+
N.styles = [j, We];
|
|
1675
|
+
N.dependencies = {
|
|
1676
|
+
"cx-button": K,
|
|
1677
|
+
"cx-checkbox": te,
|
|
1678
|
+
"cx-details": tt,
|
|
1679
|
+
"cx-icon": et,
|
|
1680
|
+
"cx-space": O,
|
|
1681
|
+
"cx-tooltip": Nt,
|
|
1682
|
+
"cx-typography": L
|
|
1449
1683
|
};
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
],
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
],
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
],
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
],
|
|
1462
|
-
var
|
|
1463
|
-
for (var a = s > 1 ? void 0 : s ?
|
|
1684
|
+
xt([
|
|
1685
|
+
it(".details")
|
|
1686
|
+
], N.prototype, "base", 2);
|
|
1687
|
+
xt([
|
|
1688
|
+
l({ reflect: !0, type: Boolean })
|
|
1689
|
+
], N.prototype, "open", 2);
|
|
1690
|
+
xt([
|
|
1691
|
+
l({ reflect: !0, type: Boolean })
|
|
1692
|
+
], N.prototype, "value", 2);
|
|
1693
|
+
N = xt([
|
|
1694
|
+
V("cx-asset-link-format-metadata")
|
|
1695
|
+
], N);
|
|
1696
|
+
var Oe = Object.defineProperty, Le = Object.getOwnPropertyDescriptor, y = (t, e, i, s) => {
|
|
1697
|
+
for (var a = s > 1 ? void 0 : s ? Le(e, i) : e, r = t.length - 1, h; r >= 0; r--)
|
|
1464
1698
|
(h = t[r]) && (a = (s ? h(e, i, a) : h(a)) || a);
|
|
1465
|
-
return s && a &&
|
|
1699
|
+
return s && a && Oe(e, i, a), a;
|
|
1466
1700
|
};
|
|
1467
|
-
let
|
|
1701
|
+
let g = class extends U {
|
|
1468
1702
|
constructor() {
|
|
1469
|
-
super(), this.localize = new
|
|
1703
|
+
super(), this.localize = new q(this), this.baseUrl = void 0, this.token = void 0, this.asset = void 0, this.cropModes = [
|
|
1470
1704
|
{
|
|
1471
1705
|
label: "Free",
|
|
1472
1706
|
value: "free"
|
|
@@ -1561,7 +1795,16 @@ let d = class extends O {
|
|
|
1561
1795
|
}, this.rotation = 0, this.defaultSize = {
|
|
1562
1796
|
height: 0,
|
|
1563
1797
|
width: 0
|
|
1564
|
-
}, this.cropperElement = null, this.parameters = [], this.loading = !1, this.lastAction = void 0, this.frozenIndex = void 0, this.preResetTransformations = void 0, this.apiGetTransformAssetLink =
|
|
1798
|
+
}, this.cropperElement = null, this.parameters = [], this.loading = !1, this.lastAction = void 0, this.frozenIndex = void 0, this.preResetTransformations = void 0, this.apiGetTransformAssetLink = pe, this.apiGetCropFocusMode = ge, this.onCropComplete = this.onCropComplete.bind(this), this.onCropDragStart = this.onCropDragStart.bind(this);
|
|
1799
|
+
}
|
|
1800
|
+
/**
|
|
1801
|
+
* Transform requests must resolve to a web-displayable image (the browser renders the
|
|
1802
|
+
* response directly), so extensions like PSD/TIFF/AI that the source asset may carry are not
|
|
1803
|
+
* valid targets for the transformed link — fall back to JPG for those, same as the source
|
|
1804
|
+
* extension fallback in asset-transformation-dialog.
|
|
1805
|
+
*/
|
|
1806
|
+
static getTransformExtension(t) {
|
|
1807
|
+
return !t || At(t) ? t : "jpg";
|
|
1565
1808
|
}
|
|
1566
1809
|
/** True when there are transformations beyond the frozen index (i.e. user has added new ones). */
|
|
1567
1810
|
get hasUnfrozenTransformations() {
|
|
@@ -1574,7 +1817,7 @@ let d = class extends O {
|
|
|
1574
1817
|
*/
|
|
1575
1818
|
get lastAppliedCropUnit() {
|
|
1576
1819
|
return this.transformations.findLast(
|
|
1577
|
-
(e) => e.key ===
|
|
1820
|
+
(e) => e.key === u.Crop
|
|
1578
1821
|
)?.value.unit ?? o.Pixel;
|
|
1579
1822
|
}
|
|
1580
1823
|
/**
|
|
@@ -1584,7 +1827,7 @@ let d = class extends O {
|
|
|
1584
1827
|
*/
|
|
1585
1828
|
get lastAppliedCropFocusMode() {
|
|
1586
1829
|
return this.transformations.findLast(
|
|
1587
|
-
(e) => e.key ===
|
|
1830
|
+
(e) => e.key === u.Crop
|
|
1588
1831
|
)?.value.focusMode ?? "manual";
|
|
1589
1832
|
}
|
|
1590
1833
|
/**
|
|
@@ -1636,7 +1879,7 @@ let d = class extends O {
|
|
|
1636
1879
|
get lastCropSize() {
|
|
1637
1880
|
if (!this.asset) {
|
|
1638
1881
|
const e = this.transformations.findLast(
|
|
1639
|
-
(i) => i.key ===
|
|
1882
|
+
(i) => i.key === u.Crop
|
|
1640
1883
|
);
|
|
1641
1884
|
if (e?.value.unit === o.AspectRatio && e.value.ratioWidth && e.value.ratioHeight)
|
|
1642
1885
|
return {
|
|
@@ -1666,7 +1909,7 @@ let d = class extends O {
|
|
|
1666
1909
|
}
|
|
1667
1910
|
};
|
|
1668
1911
|
if (e?.value.width && e?.value.height) {
|
|
1669
|
-
const { height: i, width: s, x: a = 0, y: r = 0 } = e.value, h =
|
|
1912
|
+
const { height: i, width: s, x: a = 0, y: r = 0 } = e.value, h = rt(s, i);
|
|
1670
1913
|
return {
|
|
1671
1914
|
[o.AspectRatio]: {
|
|
1672
1915
|
height: h.height,
|
|
@@ -1689,7 +1932,7 @@ let d = class extends O {
|
|
|
1689
1932
|
};
|
|
1690
1933
|
}
|
|
1691
1934
|
}
|
|
1692
|
-
const t = this.lastImageSize.width && this.lastImageSize.height ?
|
|
1935
|
+
const t = this.lastImageSize.width && this.lastImageSize.height ? rt(this.lastImageSize.width, this.lastImageSize.height) : { height: 1, width: 1 };
|
|
1693
1936
|
return {
|
|
1694
1937
|
[o.AspectRatio]: {
|
|
1695
1938
|
height: t.height,
|
|
@@ -1719,7 +1962,7 @@ let d = class extends O {
|
|
|
1719
1962
|
get lastResizeSize() {
|
|
1720
1963
|
if (!this.asset) {
|
|
1721
1964
|
const e = this.transformations.findLast(
|
|
1722
|
-
(i) => i.key ===
|
|
1965
|
+
(i) => i.key === u.Resize
|
|
1723
1966
|
);
|
|
1724
1967
|
if (e?.value.unit === o.AspectRatio && e.value.ratioWidth && e.value.ratioHeight)
|
|
1725
1968
|
return {
|
|
@@ -1736,7 +1979,7 @@ let d = class extends O {
|
|
|
1736
1979
|
}
|
|
1737
1980
|
};
|
|
1738
1981
|
if (e?.value.width && e?.value.height) {
|
|
1739
|
-
const { height: i, width: s } = e.value, a =
|
|
1982
|
+
const { height: i, width: s } = e.value, a = rt(s, i);
|
|
1740
1983
|
return {
|
|
1741
1984
|
[o.AspectRatio]: {
|
|
1742
1985
|
height: a.height,
|
|
@@ -1751,7 +1994,7 @@ let d = class extends O {
|
|
|
1751
1994
|
};
|
|
1752
1995
|
}
|
|
1753
1996
|
}
|
|
1754
|
-
const t = this.lastImageSize.width && this.lastImageSize.height ?
|
|
1997
|
+
const t = this.lastImageSize.width && this.lastImageSize.height ? rt(this.lastImageSize.width, this.lastImageSize.height) : { height: 1, width: 1 };
|
|
1755
1998
|
return {
|
|
1756
1999
|
[o.AspectRatio]: {
|
|
1757
2000
|
height: t.height,
|
|
@@ -1775,14 +2018,14 @@ let d = class extends O {
|
|
|
1775
2018
|
*/
|
|
1776
2019
|
get lastRotation() {
|
|
1777
2020
|
return this.asset ? 0 : this.transformations.findLast(
|
|
1778
|
-
(e) => e.key ===
|
|
2021
|
+
(e) => e.key === u.Rotate
|
|
1779
2022
|
)?.value.rotation ?? 0;
|
|
1780
2023
|
}
|
|
1781
2024
|
/**
|
|
1782
2025
|
* Returns the transformation string for the asset link.
|
|
1783
2026
|
*/
|
|
1784
2027
|
get transformationString() {
|
|
1785
|
-
return
|
|
2028
|
+
return Y({
|
|
1786
2029
|
asset: this.asset,
|
|
1787
2030
|
baseUrl: "",
|
|
1788
2031
|
parameters: this.parameters,
|
|
@@ -1817,13 +2060,13 @@ let d = class extends O {
|
|
|
1817
2060
|
);
|
|
1818
2061
|
this.loading = !0, this.apiGetTransformAssetLink({
|
|
1819
2062
|
assetId: this.asset.id,
|
|
1820
|
-
extension: this.asset.extension,
|
|
2063
|
+
extension: g.getTransformExtension(this.asset.extension),
|
|
1821
2064
|
format: e?.proxyName ?? "",
|
|
1822
2065
|
siteUrl: this.baseUrl,
|
|
1823
2066
|
token: this.token,
|
|
1824
2067
|
transformations: this.transformationString
|
|
1825
2068
|
}).then((s) => {
|
|
1826
|
-
this.loading = !1, !(!s?.relativePath || !this.selectedFormat) && (this.lastAction ===
|
|
2069
|
+
this.loading = !1, !(!s?.relativePath || !this.selectedFormat) && (this.lastAction === u.Rotate && (this.rotation = 0), this.lastAction = void 0, this.lastImageSize = {
|
|
1827
2070
|
height: s.height,
|
|
1828
2071
|
width: s.width
|
|
1829
2072
|
}, this.selectedFormat = {
|
|
@@ -1837,7 +2080,7 @@ let d = class extends O {
|
|
|
1837
2080
|
*/
|
|
1838
2081
|
});
|
|
1839
2082
|
});
|
|
1840
|
-
const i =
|
|
2083
|
+
const i = Y({
|
|
1841
2084
|
asset: this.asset,
|
|
1842
2085
|
baseUrl: "",
|
|
1843
2086
|
extension: this.selectedFormat.extension,
|
|
@@ -1870,7 +2113,7 @@ let d = class extends O {
|
|
|
1870
2113
|
async handleTransformationsChange() {
|
|
1871
2114
|
if (await this.updateComplete, !this.asset) {
|
|
1872
2115
|
this.emit("cx-asset-link-format-change", {
|
|
1873
|
-
detail:
|
|
2116
|
+
detail: Y({
|
|
1874
2117
|
asset: this.asset,
|
|
1875
2118
|
baseUrl: "",
|
|
1876
2119
|
options: {
|
|
@@ -1882,33 +2125,33 @@ let d = class extends O {
|
|
|
1882
2125
|
}).replace(/\/t\//g, "")
|
|
1883
2126
|
});
|
|
1884
2127
|
const r = this.transformations.findLast(
|
|
1885
|
-
(c) => c.key ===
|
|
2128
|
+
(c) => c.key === u.Crop && (c.value.unit === o.AspectRatio && c.value.ratioWidth && c.value.ratioHeight || c.value.width && c.value.height)
|
|
1886
2129
|
);
|
|
1887
2130
|
if (r?.value.unit === o.AspectRatio && r.value.ratioWidth && r.value.ratioHeight) {
|
|
1888
|
-
const { focusMode: c, ratioHeight:
|
|
2131
|
+
const { focusMode: c, ratioHeight: f, ratioWidth: S } = r.value;
|
|
1889
2132
|
this.cropSize = {
|
|
1890
2133
|
...this.cropSize,
|
|
1891
2134
|
cropMode: "free",
|
|
1892
2135
|
focusMode: c ?? "manual",
|
|
1893
2136
|
percentageHeight: 100,
|
|
1894
2137
|
percentageWidth: 100,
|
|
1895
|
-
ratioHeight:
|
|
1896
|
-
ratioWidth:
|
|
2138
|
+
ratioHeight: f,
|
|
2139
|
+
ratioWidth: S,
|
|
1897
2140
|
unit: o.AspectRatio
|
|
1898
2141
|
};
|
|
1899
2142
|
} else if (r) {
|
|
1900
|
-
const { focusMode: c, height:
|
|
2143
|
+
const { focusMode: c, height: f, unit: S, width: p, x: w = 0, y: R = 0 } = r.value;
|
|
1901
2144
|
this.cropSize = {
|
|
1902
2145
|
...this.cropSize,
|
|
1903
2146
|
cropMode: "free",
|
|
1904
2147
|
focusMode: c ?? "manual",
|
|
1905
|
-
height:
|
|
2148
|
+
height: f,
|
|
1906
2149
|
percentageHeight: 100,
|
|
1907
2150
|
percentageWidth: 100,
|
|
1908
|
-
unit:
|
|
1909
|
-
width:
|
|
1910
|
-
x:
|
|
1911
|
-
y:
|
|
2151
|
+
unit: S ?? o.Pixel,
|
|
2152
|
+
width: p,
|
|
2153
|
+
x: w,
|
|
2154
|
+
y: R
|
|
1912
2155
|
};
|
|
1913
2156
|
} else
|
|
1914
2157
|
this.cropSize = {
|
|
@@ -1930,23 +2173,23 @@ let d = class extends O {
|
|
|
1930
2173
|
y: 0
|
|
1931
2174
|
};
|
|
1932
2175
|
const h = this.transformations.findLast(
|
|
1933
|
-
(c) => c.key ===
|
|
2176
|
+
(c) => c.key === u.Resize && (c.value.unit === o.AspectRatio && c.value.ratioWidth && c.value.ratioHeight || c.value.width || c.value.height)
|
|
1934
2177
|
);
|
|
1935
2178
|
if (h?.value.unit === o.AspectRatio && h.value.ratioWidth && h.value.ratioHeight) {
|
|
1936
|
-
const { ratioHeight: c, ratioWidth:
|
|
2179
|
+
const { ratioHeight: c, ratioWidth: f } = h.value;
|
|
1937
2180
|
this.resizeSize = {
|
|
1938
2181
|
...this.resizeSize,
|
|
1939
2182
|
ratioHeight: c,
|
|
1940
|
-
ratioWidth:
|
|
2183
|
+
ratioWidth: f,
|
|
1941
2184
|
unit: o.AspectRatio
|
|
1942
2185
|
};
|
|
1943
2186
|
} else if (h) {
|
|
1944
|
-
const { height: c = 0, unit:
|
|
2187
|
+
const { height: c = 0, unit: f, width: S = 0 } = h.value;
|
|
1945
2188
|
this.resizeSize = {
|
|
1946
2189
|
...this.resizeSize,
|
|
1947
2190
|
height: c,
|
|
1948
|
-
unit:
|
|
1949
|
-
width:
|
|
2191
|
+
unit: f ?? o.Pixel,
|
|
2192
|
+
width: S
|
|
1950
2193
|
};
|
|
1951
2194
|
} else
|
|
1952
2195
|
this.resizeSize = {
|
|
@@ -1960,19 +2203,19 @@ let d = class extends O {
|
|
|
1960
2203
|
unit: o.Pixel,
|
|
1961
2204
|
width: 1
|
|
1962
2205
|
};
|
|
1963
|
-
const
|
|
1964
|
-
(c) => c.key ===
|
|
2206
|
+
const n = this.transformations.findLast(
|
|
2207
|
+
(c) => c.key === u.Rotate
|
|
1965
2208
|
);
|
|
1966
|
-
this.rotation =
|
|
1967
|
-
const
|
|
1968
|
-
(c) => c.key ===
|
|
2209
|
+
this.rotation = n?.value.rotation ?? 0;
|
|
2210
|
+
const d = this.transformations.findLast((c) => c.key === u.Quality)?.value.quality ?? 100, m = this.transformations.some(
|
|
2211
|
+
(c) => c.key === u.Metadata
|
|
1969
2212
|
);
|
|
1970
|
-
this.selectedFormat ? this.selectedFormat = { ...this.selectedFormat, keepMetadata:
|
|
2213
|
+
this.selectedFormat ? this.selectedFormat = { ...this.selectedFormat, keepMetadata: m, quality: d } : this.selectedFormat = {
|
|
1971
2214
|
extension: "",
|
|
1972
2215
|
height: 0,
|
|
1973
|
-
keepMetadata:
|
|
2216
|
+
keepMetadata: m,
|
|
1974
2217
|
originalUrl: "",
|
|
1975
|
-
quality:
|
|
2218
|
+
quality: d,
|
|
1976
2219
|
rotation: 0,
|
|
1977
2220
|
url: "",
|
|
1978
2221
|
width: 0,
|
|
@@ -1989,7 +2232,7 @@ let d = class extends O {
|
|
|
1989
2232
|
this.loading = !0;
|
|
1990
2233
|
const e = await this.apiGetTransformAssetLink({
|
|
1991
2234
|
assetId: this.asset.id,
|
|
1992
|
-
extension: this.selectedFormat.extension,
|
|
2235
|
+
extension: g.getTransformExtension(this.selectedFormat.extension),
|
|
1993
2236
|
format: t?.proxyName ?? "",
|
|
1994
2237
|
siteUrl: this.baseUrl,
|
|
1995
2238
|
token: this.token,
|
|
@@ -2020,11 +2263,11 @@ let d = class extends O {
|
|
|
2020
2263
|
width: e.width,
|
|
2021
2264
|
x: 0,
|
|
2022
2265
|
y: 0
|
|
2023
|
-
}, this.lastAction ===
|
|
2266
|
+
}, this.lastAction === u.Rotate && (this.rotation = 0), this.lastAction = void 0;
|
|
2024
2267
|
const i = this.transformations.some(
|
|
2025
|
-
(r) => r.key ===
|
|
2268
|
+
(r) => r.key === u.Metadata
|
|
2026
2269
|
), s = this.transformations.findLast(
|
|
2027
|
-
(r) => r.key ===
|
|
2270
|
+
(r) => r.key === u.Quality
|
|
2028
2271
|
);
|
|
2029
2272
|
this.selectedFormat = {
|
|
2030
2273
|
...this.selectedFormat,
|
|
@@ -2038,7 +2281,7 @@ let d = class extends O {
|
|
|
2038
2281
|
* url: `${this.baseUrl}/${response.relativePath}`,
|
|
2039
2282
|
*/
|
|
2040
2283
|
};
|
|
2041
|
-
const a =
|
|
2284
|
+
const a = Y({
|
|
2042
2285
|
asset: this.asset,
|
|
2043
2286
|
baseUrl: "",
|
|
2044
2287
|
extension: this.selectedFormat.extension,
|
|
@@ -2070,7 +2313,7 @@ let d = class extends O {
|
|
|
2070
2313
|
width: Number.parseInt(this.asset.width, 10)
|
|
2071
2314
|
});
|
|
2072
2315
|
const t = this.transformations.findLast(
|
|
2073
|
-
(e) => e.key ===
|
|
2316
|
+
(e) => e.key === u.Quality
|
|
2074
2317
|
);
|
|
2075
2318
|
this.selectedFormat = {
|
|
2076
2319
|
extension: this.asset.extension,
|
|
@@ -2116,20 +2359,20 @@ let d = class extends O {
|
|
|
2116
2359
|
e.proxyName === "TRX" && (e.formatHeight = Number(this.asset.height), e.formatWidth = Number(this.asset.width));
|
|
2117
2360
|
const i = this.proxies?.find((s) => s.id === t);
|
|
2118
2361
|
i && (this.asset && i.proxyName === "TRX" && (i.formatHeight = Number(this.asset.height), i.formatWidth = Number(this.asset.width)), this.transformations = this.transformations.map((s) => {
|
|
2119
|
-
if (s.key ===
|
|
2120
|
-
const a = s.value, r = a.width / i.formatWidth * e.formatWidth, h = a.height / i.formatHeight * e.formatHeight,
|
|
2362
|
+
if (s.key === u.Crop) {
|
|
2363
|
+
const a = s.value, r = a.width / i.formatWidth * e.formatWidth, h = a.height / i.formatHeight * e.formatHeight, n = a.x / i.formatWidth * e.formatWidth, d = a.y / i.formatHeight * e.formatHeight;
|
|
2121
2364
|
return {
|
|
2122
2365
|
...s,
|
|
2123
2366
|
value: {
|
|
2124
2367
|
...s.value,
|
|
2125
2368
|
height: h,
|
|
2126
2369
|
width: r,
|
|
2127
|
-
x:
|
|
2128
|
-
y:
|
|
2370
|
+
x: n,
|
|
2371
|
+
y: d
|
|
2129
2372
|
}
|
|
2130
2373
|
};
|
|
2131
2374
|
}
|
|
2132
|
-
if (s.key ===
|
|
2375
|
+
if (s.key === u.Resize) {
|
|
2133
2376
|
const a = s.value, r = a.width / i.formatWidth * e.formatWidth, h = a.height / i.formatHeight * e.formatHeight;
|
|
2134
2377
|
return {
|
|
2135
2378
|
...s,
|
|
@@ -2202,31 +2445,31 @@ let d = class extends O {
|
|
|
2202
2445
|
percentageHeight: a,
|
|
2203
2446
|
percentageWidth: r,
|
|
2204
2447
|
ratioHeight: h,
|
|
2205
|
-
ratioWidth:
|
|
2206
|
-
unit:
|
|
2207
|
-
useCropMode:
|
|
2448
|
+
ratioWidth: n,
|
|
2449
|
+
unit: d,
|
|
2450
|
+
useCropMode: m,
|
|
2208
2451
|
width: c
|
|
2209
2452
|
}) {
|
|
2210
2453
|
if (!this.selectedFormat?.url || e === "manual")
|
|
2211
2454
|
return;
|
|
2212
|
-
this.loading = !0, this.lastAction =
|
|
2213
|
-
const
|
|
2455
|
+
this.loading = !0, this.lastAction = u.Crop;
|
|
2456
|
+
const f = await this.apiGetCropFocusMode({
|
|
2214
2457
|
autoCropMode: e,
|
|
2215
2458
|
cropHeight: i,
|
|
2216
2459
|
cropWidth: c,
|
|
2217
2460
|
imageUrl: this.selectedFormat.url
|
|
2218
2461
|
});
|
|
2219
|
-
if (
|
|
2220
|
-
let
|
|
2221
|
-
i || (
|
|
2462
|
+
if (f) {
|
|
2463
|
+
let S = a, p = r;
|
|
2464
|
+
i || (S = f.height * 100 / this.selectedFormat.height), c || (p = f.width * 100 / this.selectedFormat.width), this.cropSize = {
|
|
2222
2465
|
...this.cropSize,
|
|
2223
|
-
height:
|
|
2224
|
-
percentageHeight:
|
|
2225
|
-
percentageWidth:
|
|
2226
|
-
width:
|
|
2227
|
-
x:
|
|
2228
|
-
y:
|
|
2229
|
-
...
|
|
2466
|
+
height: f.height,
|
|
2467
|
+
percentageHeight: S ?? this.cropSize.percentageHeight,
|
|
2468
|
+
percentageWidth: p ?? this.cropSize.percentageWidth,
|
|
2469
|
+
width: f.width,
|
|
2470
|
+
x: f.x * 100 / this.selectedFormat.width,
|
|
2471
|
+
y: f.y * 100 / this.selectedFormat.height,
|
|
2472
|
+
...m ? {
|
|
2230
2473
|
cropMode: e,
|
|
2231
2474
|
focusMode: "manual",
|
|
2232
2475
|
keepAspectRatio: !1
|
|
@@ -2236,8 +2479,8 @@ let d = class extends O {
|
|
|
2236
2479
|
},
|
|
2237
2480
|
keepAspectRatio: s ?? this.cropSize.keepAspectRatio,
|
|
2238
2481
|
ratioHeight: h ?? this.cropSize.ratioHeight,
|
|
2239
|
-
ratioWidth:
|
|
2240
|
-
unit:
|
|
2482
|
+
ratioWidth: n ?? this.cropSize.ratioWidth,
|
|
2483
|
+
unit: d ?? this.cropSize.unit
|
|
2241
2484
|
};
|
|
2242
2485
|
}
|
|
2243
2486
|
this.loading = !1, this.lastAction = void 0;
|
|
@@ -2251,26 +2494,26 @@ let d = class extends O {
|
|
|
2251
2494
|
} = e;
|
|
2252
2495
|
if (s === 0 || i === 0)
|
|
2253
2496
|
return;
|
|
2254
|
-
const h = this.cropSize.percentageWidth !== s,
|
|
2255
|
-
let
|
|
2256
|
-
h && (
|
|
2497
|
+
const h = this.cropSize.percentageWidth !== s, n = this.cropSize.percentageHeight !== i;
|
|
2498
|
+
let d = this.cropSize.height, m = this.cropSize.width;
|
|
2499
|
+
h && (m = Math.round(s * this.selectedFormat.width / 100)), n && (d = Math.round(
|
|
2257
2500
|
i * this.selectedFormat.height / 100
|
|
2258
2501
|
));
|
|
2259
2502
|
const c = this.cropSize.focusMode;
|
|
2260
2503
|
this.focusModes.find(
|
|
2261
|
-
(
|
|
2504
|
+
(S) => S.value === c
|
|
2262
2505
|
)?.auto && this.selectedFormat?.url && this.cropperElement ? await this.handleRequestAutoCropSuggestion({
|
|
2263
2506
|
focusMode: c,
|
|
2264
|
-
height:
|
|
2507
|
+
height: d,
|
|
2265
2508
|
percentageHeight: i,
|
|
2266
2509
|
percentageWidth: s,
|
|
2267
|
-
width:
|
|
2510
|
+
width: m
|
|
2268
2511
|
}) : this.cropSize = {
|
|
2269
2512
|
...this.cropSize,
|
|
2270
|
-
height:
|
|
2513
|
+
height: d,
|
|
2271
2514
|
percentageHeight: i,
|
|
2272
2515
|
percentageWidth: s,
|
|
2273
|
-
width:
|
|
2516
|
+
width: m,
|
|
2274
2517
|
x: a,
|
|
2275
2518
|
y: r
|
|
2276
2519
|
};
|
|
@@ -2295,7 +2538,7 @@ let d = class extends O {
|
|
|
2295
2538
|
}
|
|
2296
2539
|
onProxyChange(t) {
|
|
2297
2540
|
const e = t.detail;
|
|
2298
|
-
this.lastAction =
|
|
2541
|
+
this.lastAction = u.Proxy, this.selectedProxy = e.id;
|
|
2299
2542
|
}
|
|
2300
2543
|
async onCropModeChange(t) {
|
|
2301
2544
|
const { mode: e } = t.detail;
|
|
@@ -2306,10 +2549,10 @@ let d = class extends O {
|
|
|
2306
2549
|
});
|
|
2307
2550
|
else {
|
|
2308
2551
|
const s = this.focusModes.find(
|
|
2309
|
-
(
|
|
2552
|
+
(d) => d.value === this.cropSize.focusMode
|
|
2310
2553
|
)?.auto;
|
|
2311
|
-
let a = this.cropSize.keepAspectRatio, r = this.cropSize.focusMode, h = this.cropSize.x,
|
|
2312
|
-
e === "free" ? (a = !1, r = "manual") : this.cropSize.unit === o.Pixel && !s && (h = 0,
|
|
2554
|
+
let a = this.cropSize.keepAspectRatio, r = this.cropSize.focusMode, h = this.cropSize.x, n = this.cropSize.y;
|
|
2555
|
+
e === "free" ? (a = !1, r = "manual") : this.cropSize.unit === o.Pixel && !s && (h = 0, n = 0), s ? await this.handleRequestAutoCropSuggestion({
|
|
2313
2556
|
cropMode: e,
|
|
2314
2557
|
focusMode: r,
|
|
2315
2558
|
height: this.cropSize.height,
|
|
@@ -2321,7 +2564,7 @@ let d = class extends O {
|
|
|
2321
2564
|
focusMode: r,
|
|
2322
2565
|
keepAspectRatio: a,
|
|
2323
2566
|
x: h,
|
|
2324
|
-
y:
|
|
2567
|
+
y: n
|
|
2325
2568
|
};
|
|
2326
2569
|
}
|
|
2327
2570
|
}
|
|
@@ -2346,14 +2589,14 @@ let d = class extends O {
|
|
|
2346
2589
|
Math.max(Math.round(s / i), 0),
|
|
2347
2590
|
this.resizeSize.height
|
|
2348
2591
|
) : 0, r = this.asset ? a * 100 / this.selectedFormat.height : 100, h = this.asset ? s * 100 / this.selectedFormat.width : 100;
|
|
2349
|
-
let
|
|
2350
|
-
|
|
2351
|
-
let
|
|
2592
|
+
let n = this.cropSize.x, d = this.cropSize.y;
|
|
2593
|
+
n + h > 100 && (n = 100 - h), d + r > 100 && (d = 100 - r);
|
|
2594
|
+
let m = this.cropSize.cropMode;
|
|
2352
2595
|
this.cropModes.find(
|
|
2353
|
-
(
|
|
2354
|
-
)?.auto && (
|
|
2596
|
+
(f) => f.value === m
|
|
2597
|
+
)?.auto && (m = "free"), t.detail.silent ? (this.cropSize.height = a, this.cropSize.keepAspectRatio = t.detail.keepAspectRatio, this.cropSize.percentageHeight = r, this.cropSize.percentageWidth = h, this.cropSize.ratioHeight = t.detail.height, this.cropSize.ratioWidth = t.detail.width, this.cropSize.unit = o.AspectRatio, this.cropSize.width = s) : this.cropSize = {
|
|
2355
2598
|
...this.cropSize,
|
|
2356
|
-
cropMode:
|
|
2599
|
+
cropMode: m,
|
|
2357
2600
|
height: a,
|
|
2358
2601
|
keepAspectRatio: t.detail.keepAspectRatio,
|
|
2359
2602
|
percentageHeight: r,
|
|
@@ -2362,18 +2605,18 @@ let d = class extends O {
|
|
|
2362
2605
|
ratioWidth: t.detail.width,
|
|
2363
2606
|
unit: o.AspectRatio,
|
|
2364
2607
|
width: s,
|
|
2365
|
-
x:
|
|
2366
|
-
y:
|
|
2608
|
+
x: n,
|
|
2609
|
+
y: d
|
|
2367
2610
|
};
|
|
2368
2611
|
} else {
|
|
2369
2612
|
const i = this.asset ? t.detail.height * 100 / this.selectedFormat.height : 100, s = this.asset ? t.detail.width * 100 / this.selectedFormat.width : 100;
|
|
2370
2613
|
let a = this.cropSize.x, r = this.cropSize.y;
|
|
2371
2614
|
a + s > 100 && (a = 100 - s), r + i > 100 && (r = 100 - i);
|
|
2372
2615
|
let h = this.cropSize.cropMode;
|
|
2373
|
-
const
|
|
2374
|
-
(
|
|
2616
|
+
const n = this.cropModes.find(
|
|
2617
|
+
(d) => d.value === h
|
|
2375
2618
|
)?.auto;
|
|
2376
|
-
(t.detail.breakAspectRatio ||
|
|
2619
|
+
(t.detail.breakAspectRatio || n) && (h = "free"), t.detail.silent ? (this.cropSize.cropMode = h, this.cropSize.height = t.detail.height, this.cropSize.keepAspectRatio = t.detail.keepAspectRatio, this.cropSize.percentageHeight = i, this.cropSize.percentageWidth = s, this.cropSize.unit = o.Pixel, this.cropSize.width = t.detail.width, this.cropSize.x = a, this.cropSize.y = r) : this.cropSize = {
|
|
2377
2620
|
...this.cropSize,
|
|
2378
2621
|
cropMode: h,
|
|
2379
2622
|
height: t.detail.height,
|
|
@@ -2401,42 +2644,42 @@ let d = class extends O {
|
|
|
2401
2644
|
});
|
|
2402
2645
|
}
|
|
2403
2646
|
onCropApply(t) {
|
|
2404
|
-
if (this.preResetTransformations = void 0, this.lastAction =
|
|
2647
|
+
if (this.preResetTransformations = void 0, this.lastAction = u.Crop, !this.asset) {
|
|
2405
2648
|
const {
|
|
2406
|
-
focusMode:
|
|
2407
|
-
height:
|
|
2408
|
-
ratioHeight:
|
|
2649
|
+
focusMode: n,
|
|
2650
|
+
height: d,
|
|
2651
|
+
ratioHeight: m,
|
|
2409
2652
|
ratioWidth: c,
|
|
2410
|
-
unit:
|
|
2411
|
-
width:
|
|
2412
|
-
x:
|
|
2413
|
-
y:
|
|
2414
|
-
} = this.cropSize,
|
|
2415
|
-
(
|
|
2653
|
+
unit: f,
|
|
2654
|
+
width: S,
|
|
2655
|
+
x: p,
|
|
2656
|
+
y: w
|
|
2657
|
+
} = this.cropSize, R = this.focusModes.find(
|
|
2658
|
+
(x) => x.value === n
|
|
2416
2659
|
)?.auto ?? !1;
|
|
2417
|
-
if (
|
|
2418
|
-
c &&
|
|
2419
|
-
key:
|
|
2660
|
+
if (f === o.AspectRatio) {
|
|
2661
|
+
c && m && this.upsertTransformation({
|
|
2662
|
+
key: u.Crop,
|
|
2420
2663
|
value: {
|
|
2421
|
-
focusMode:
|
|
2422
|
-
isFocusModeAuto:
|
|
2423
|
-
ratioHeight:
|
|
2664
|
+
focusMode: n,
|
|
2665
|
+
isFocusModeAuto: R,
|
|
2666
|
+
ratioHeight: m,
|
|
2424
2667
|
ratioWidth: c,
|
|
2425
|
-
unit:
|
|
2668
|
+
unit: f
|
|
2426
2669
|
}
|
|
2427
2670
|
});
|
|
2428
2671
|
return;
|
|
2429
2672
|
}
|
|
2430
|
-
(
|
|
2431
|
-
key:
|
|
2673
|
+
(d || S) && this.upsertTransformation({
|
|
2674
|
+
key: u.Crop,
|
|
2432
2675
|
value: {
|
|
2433
|
-
focusMode:
|
|
2434
|
-
height:
|
|
2435
|
-
isFocusModeAuto:
|
|
2436
|
-
unit:
|
|
2437
|
-
width:
|
|
2438
|
-
x: Number.isFinite(
|
|
2439
|
-
y: Number.isFinite(
|
|
2676
|
+
focusMode: n,
|
|
2677
|
+
height: d,
|
|
2678
|
+
isFocusModeAuto: R,
|
|
2679
|
+
unit: f,
|
|
2680
|
+
width: S,
|
|
2681
|
+
x: Number.isFinite(p) ? p : void 0,
|
|
2682
|
+
y: Number.isFinite(w) ? w : void 0
|
|
2440
2683
|
}
|
|
2441
2684
|
});
|
|
2442
2685
|
return;
|
|
@@ -2445,37 +2688,37 @@ let d = class extends O {
|
|
|
2445
2688
|
if (!this.cropperElement || !this.selectedFormat)
|
|
2446
2689
|
return;
|
|
2447
2690
|
const r = this.cropSize.focusMode, h = this.focusModes.find(
|
|
2448
|
-
(
|
|
2691
|
+
(n) => n.value === r
|
|
2449
2692
|
)?.auto ?? !1;
|
|
2450
2693
|
if (e && a && s) {
|
|
2451
|
-
let
|
|
2452
|
-
if (s === o.AspectRatio && (
|
|
2694
|
+
let n = a, d = e;
|
|
2695
|
+
if (s === o.AspectRatio && (n = this.cropSize.percentageWidth * this.selectedFormat.width / 100, d = this.cropSize.percentageHeight * this.selectedFormat.height / 100), i)
|
|
2453
2696
|
this.transformations = [
|
|
2454
2697
|
...this.transformations,
|
|
2455
2698
|
{
|
|
2456
|
-
key:
|
|
2699
|
+
key: u.Crop,
|
|
2457
2700
|
value: {
|
|
2458
2701
|
focusMode: r,
|
|
2459
|
-
height:
|
|
2702
|
+
height: d,
|
|
2460
2703
|
isFocusModeAuto: h,
|
|
2461
2704
|
mode: i,
|
|
2462
|
-
width:
|
|
2705
|
+
width: n
|
|
2463
2706
|
}
|
|
2464
2707
|
}
|
|
2465
2708
|
];
|
|
2466
2709
|
else {
|
|
2467
|
-
const
|
|
2710
|
+
const m = this.cropSize.x / 100 * this.selectedFormat.width, c = this.cropSize.y / 100 * this.selectedFormat.height;
|
|
2468
2711
|
this.transformations = [
|
|
2469
2712
|
...this.transformations,
|
|
2470
2713
|
{
|
|
2471
|
-
key:
|
|
2714
|
+
key: u.Crop,
|
|
2472
2715
|
value: {
|
|
2473
2716
|
focusMode: r,
|
|
2474
|
-
height:
|
|
2717
|
+
height: d,
|
|
2475
2718
|
isFocusModeAuto: h,
|
|
2476
2719
|
unit: s,
|
|
2477
|
-
width:
|
|
2478
|
-
x,
|
|
2720
|
+
width: n,
|
|
2721
|
+
x: m,
|
|
2479
2722
|
y: c
|
|
2480
2723
|
}
|
|
2481
2724
|
}
|
|
@@ -2484,7 +2727,7 @@ let d = class extends O {
|
|
|
2484
2727
|
} else i && (this.transformations = [
|
|
2485
2728
|
...this.transformations,
|
|
2486
2729
|
{
|
|
2487
|
-
key:
|
|
2730
|
+
key: u.Crop,
|
|
2488
2731
|
value: {
|
|
2489
2732
|
focusMode: r,
|
|
2490
2733
|
isFocusModeAuto: h,
|
|
@@ -2519,21 +2762,21 @@ let d = class extends O {
|
|
|
2519
2762
|
}
|
|
2520
2763
|
onResizeApply(t) {
|
|
2521
2764
|
const { height: e, unit: i, width: s } = t.detail;
|
|
2522
|
-
if (this.preResetTransformations = void 0, this.lastAction =
|
|
2765
|
+
if (this.preResetTransformations = void 0, this.lastAction = u.Resize, !this.asset) {
|
|
2523
2766
|
if (i === o.AspectRatio) {
|
|
2524
|
-
const { ratioHeight:
|
|
2525
|
-
|
|
2526
|
-
key:
|
|
2767
|
+
const { ratioHeight: d, ratioWidth: m } = this.resizeSize;
|
|
2768
|
+
m && d && this.upsertTransformation({
|
|
2769
|
+
key: u.Resize,
|
|
2527
2770
|
value: {
|
|
2528
|
-
ratioHeight:
|
|
2529
|
-
ratioWidth:
|
|
2771
|
+
ratioHeight: d,
|
|
2772
|
+
ratioWidth: m,
|
|
2530
2773
|
unit: i
|
|
2531
2774
|
}
|
|
2532
2775
|
});
|
|
2533
2776
|
return;
|
|
2534
2777
|
}
|
|
2535
2778
|
(e || s) && this.upsertTransformation({
|
|
2536
|
-
key:
|
|
2779
|
+
key: u.Resize,
|
|
2537
2780
|
value: {
|
|
2538
2781
|
height: e,
|
|
2539
2782
|
unit: i,
|
|
@@ -2545,13 +2788,13 @@ let d = class extends O {
|
|
|
2545
2788
|
if (!this.selectedFormat)
|
|
2546
2789
|
return;
|
|
2547
2790
|
const a = this.selectedFormat.width || this.defaultSize.width, r = this.selectedFormat.height || this.defaultSize.height;
|
|
2548
|
-
let h = s,
|
|
2549
|
-
this.resizeSize.unit !== i ? (h = a,
|
|
2791
|
+
let h = s, n = e;
|
|
2792
|
+
this.resizeSize.unit !== i ? (h = a, n = r) : i === o.AspectRatio && (h = Math.round(s / e * r), n = r), this.transformations = [
|
|
2550
2793
|
...this.transformations,
|
|
2551
2794
|
{
|
|
2552
|
-
key:
|
|
2795
|
+
key: u.Resize,
|
|
2553
2796
|
value: {
|
|
2554
|
-
height:
|
|
2797
|
+
height: n,
|
|
2555
2798
|
unit: i,
|
|
2556
2799
|
width: h
|
|
2557
2800
|
}
|
|
@@ -2563,21 +2806,21 @@ let d = class extends O {
|
|
|
2563
2806
|
}
|
|
2564
2807
|
onRotationApply(t) {
|
|
2565
2808
|
const e = t.detail;
|
|
2566
|
-
if (this.preResetTransformations = void 0, this.lastAction =
|
|
2809
|
+
if (this.preResetTransformations = void 0, this.lastAction = u.Rotate, !this.asset) {
|
|
2567
2810
|
e ? this.upsertTransformation({
|
|
2568
|
-
key:
|
|
2811
|
+
key: u.Rotate,
|
|
2569
2812
|
value: {
|
|
2570
2813
|
rotation: e
|
|
2571
2814
|
}
|
|
2572
2815
|
}) : this.transformations = this.transformations.filter(
|
|
2573
|
-
(i) => i.key !==
|
|
2816
|
+
(i) => i.key !== u.Rotate
|
|
2574
2817
|
);
|
|
2575
2818
|
return;
|
|
2576
2819
|
}
|
|
2577
2820
|
this.selectedFormat && (this.transformations = [
|
|
2578
2821
|
...this.transformations,
|
|
2579
2822
|
{
|
|
2580
|
-
key:
|
|
2823
|
+
key: u.Rotate,
|
|
2581
2824
|
value: {
|
|
2582
2825
|
rotation: e
|
|
2583
2826
|
}
|
|
@@ -2586,9 +2829,9 @@ let d = class extends O {
|
|
|
2586
2829
|
}
|
|
2587
2830
|
onQualityChange(t) {
|
|
2588
2831
|
const e = t.detail;
|
|
2589
|
-
this.selectedFormat && (this.selectedFormat.quality = e), this.preResetTransformations = void 0, this.lastAction =
|
|
2832
|
+
this.selectedFormat && (this.selectedFormat.quality = e), this.preResetTransformations = void 0, this.lastAction = u.Quality;
|
|
2590
2833
|
const i = {
|
|
2591
|
-
key:
|
|
2834
|
+
key: u.Quality,
|
|
2592
2835
|
value: {
|
|
2593
2836
|
quality: e
|
|
2594
2837
|
}
|
|
@@ -2602,22 +2845,22 @@ let d = class extends O {
|
|
|
2602
2845
|
keepMetadata: e
|
|
2603
2846
|
}), !this.asset) {
|
|
2604
2847
|
e ? this.upsertTransformation({
|
|
2605
|
-
key:
|
|
2848
|
+
key: u.Metadata,
|
|
2606
2849
|
value: {
|
|
2607
2850
|
keepMetadata: e
|
|
2608
2851
|
}
|
|
2609
2852
|
}) : this.transformations = this.transformations.filter(
|
|
2610
|
-
(i) => i.key !==
|
|
2853
|
+
(i) => i.key !== u.Metadata
|
|
2611
2854
|
);
|
|
2612
2855
|
return;
|
|
2613
2856
|
}
|
|
2614
2857
|
e ? this.upsertTransformation({
|
|
2615
|
-
key:
|
|
2858
|
+
key: u.Metadata,
|
|
2616
2859
|
value: {
|
|
2617
2860
|
keepMetadata: e
|
|
2618
2861
|
}
|
|
2619
2862
|
}) : this.transformations = this.transformations.filter(
|
|
2620
|
-
(i) => i.key !==
|
|
2863
|
+
(i) => i.key !== u.Metadata
|
|
2621
2864
|
);
|
|
2622
2865
|
}
|
|
2623
2866
|
onExtensionChange(t) {
|
|
@@ -2629,7 +2872,7 @@ let d = class extends O {
|
|
|
2629
2872
|
}
|
|
2630
2873
|
syncQuality() {
|
|
2631
2874
|
const t = this.transformations.findLast(
|
|
2632
|
-
(e) => e.key ===
|
|
2875
|
+
(e) => e.key === u.Quality
|
|
2633
2876
|
)?.value?.quality;
|
|
2634
2877
|
this.selectedFormat && (this.selectedFormat = {
|
|
2635
2878
|
...this.selectedFormat,
|
|
@@ -2645,183 +2888,184 @@ let d = class extends O {
|
|
|
2645
2888
|
this.selectedProxy = t ? this.defaultProxy : this.selectedProxy || this.proxies?.[0]?.id || "", this.transformations = [], this.frozenIndex = -1, this.syncQuality();
|
|
2646
2889
|
}
|
|
2647
2890
|
render() {
|
|
2648
|
-
return
|
|
2891
|
+
return A`<div class="asset-link-format" @cx-show=${this.onDetailsShow} @cx-hide=${this.onDetailsHide}>${_(
|
|
2649
2892
|
!this.hideHeader,
|
|
2650
|
-
() =>
|
|
2651
|
-
() =>
|
|
2893
|
+
() => A`<cx-space class="asset-link-format__section-header" direction="horizontal" spacing="small" align-items="center" justify-content="space-between"><cx-typography variant="body3">${this.localize.term("transformations")}</cx-typography><cx-space direction="horizontal" spacing="3x-small" align-items="center"><cx-button class="asset-link-format__undo" variant="custom" ?disabled=${!this.hasUnfrozenTransformations && this.preResetTransformations === void 0} @click=${this.handleUndo}>${this.localize.term("undo")}</cx-button>${_(this.canReset, () => A`<cx-button class="asset-link-format__reset" variant="custom" ?disabled=${this.transformations.length === 0} @click=${this.handleReset}>${this.localize.term("reset")}</cx-button>`)}</cx-space></cx-space>`,
|
|
2894
|
+
() => Gt
|
|
2652
2895
|
)}
|
|
2653
|
-
${
|
|
2896
|
+
${_(
|
|
2654
2897
|
!this.noFormat,
|
|
2655
|
-
() =>
|
|
2898
|
+
() => A`<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"} .items=${this.formats} ?loading=${this.loading && this.lastAction === u.Proxy} @cx-asset-link-format-proxy-change=${this.onProxyChange}></cx-asset-link-format-proxy>`
|
|
2656
2899
|
)}
|
|
2657
|
-
${
|
|
2900
|
+
${_(
|
|
2658
2901
|
!this.noCrop,
|
|
2659
|
-
() =>
|
|
2902
|
+
() => A`<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 === u.Crop} ?no-ratio-modes=${!this.asset} ?keep-aspect-ratio=${this.cropSize.keepAspectRatio} focus-mode=${this.cropSize.focusMode} crop-mode=${this.cropSize.cropMode} width=${this.cropSize.width} height=${this.cropSize.height} max-width=${this.asset ? this.lastResizeSize[o.Pixel].width : 1 / 0} max-height=${this.asset ? this.lastResizeSize[o.Pixel].height : 1 / 0} percentage-width=${this.cropSize.percentageWidth} percentage-height=${this.cropSize.percentageHeight} 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-change=${this.onCropChange} @cx-asset-link-format-crop-changed=${this.onCropChanged} @cx-asset-link-format-crop-apply=${this.onCropApply}></cx-asset-link-format-crop>`
|
|
2660
2903
|
)}
|
|
2661
|
-
${
|
|
2904
|
+
${_(
|
|
2662
2905
|
!this.noResize,
|
|
2663
|
-
() =>
|
|
2906
|
+
() => A`<cx-asset-link-format-resize class="asset-link-format__details" ?open=${this.activeSetting === "cx-asset-link-format-resize"} ?loading=${this.loading && this.lastAction === u.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>`
|
|
2664
2907
|
)}
|
|
2665
|
-
${
|
|
2908
|
+
${_(
|
|
2666
2909
|
!this.noRotate,
|
|
2667
|
-
() =>
|
|
2668
|
-
)}<cx-asset-link-format-quality class="asset-link-format__details" ?loading=${this.loading && this.lastAction ===
|
|
2910
|
+
() => A`<cx-asset-link-format-rotation class="asset-link-format__details" ?loading=${this.loading && this.lastAction === u.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>`
|
|
2911
|
+
)}<cx-asset-link-format-quality class="asset-link-format__details" ?loading=${this.loading && this.lastAction === u.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>${_(
|
|
2669
2912
|
!this.noMetadata,
|
|
2670
|
-
() =>
|
|
2913
|
+
() => A`<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>`
|
|
2671
2914
|
)}
|
|
2672
|
-
${
|
|
2915
|
+
${_(
|
|
2673
2916
|
this.useCustomExtension,
|
|
2674
|
-
() =>
|
|
2917
|
+
() => A`<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>`
|
|
2675
2918
|
)}</div>`;
|
|
2676
2919
|
}
|
|
2677
2920
|
};
|
|
2678
|
-
|
|
2679
|
-
|
|
2680
|
-
"cx-asset-link-format-crop":
|
|
2681
|
-
"cx-asset-link-format-extension":
|
|
2682
|
-
"cx-asset-link-format-metadata":
|
|
2683
|
-
"cx-asset-link-format-proxy":
|
|
2684
|
-
"cx-asset-link-format-quality":
|
|
2685
|
-
"cx-asset-link-format-resize":
|
|
2686
|
-
"cx-asset-link-format-rotation":
|
|
2687
|
-
"cx-button":
|
|
2688
|
-
"cx-space":
|
|
2689
|
-
"cx-typography":
|
|
2921
|
+
g.styles = [j, ye];
|
|
2922
|
+
g.dependencies = {
|
|
2923
|
+
"cx-asset-link-format-crop": z,
|
|
2924
|
+
"cx-asset-link-format-extension": X,
|
|
2925
|
+
"cx-asset-link-format-metadata": N,
|
|
2926
|
+
"cx-asset-link-format-proxy": I,
|
|
2927
|
+
"cx-asset-link-format-quality": T,
|
|
2928
|
+
"cx-asset-link-format-resize": b,
|
|
2929
|
+
"cx-asset-link-format-rotation": H,
|
|
2930
|
+
"cx-button": K,
|
|
2931
|
+
"cx-space": O,
|
|
2932
|
+
"cx-typography": L
|
|
2690
2933
|
};
|
|
2691
|
-
|
|
2692
|
-
|
|
2693
|
-
],
|
|
2694
|
-
|
|
2695
|
-
|
|
2696
|
-
],
|
|
2697
|
-
|
|
2698
|
-
|
|
2699
|
-
],
|
|
2700
|
-
|
|
2701
|
-
|
|
2702
|
-
],
|
|
2703
|
-
|
|
2704
|
-
|
|
2705
|
-
],
|
|
2706
|
-
|
|
2707
|
-
|
|
2708
|
-
],
|
|
2709
|
-
|
|
2710
|
-
|
|
2711
|
-
],
|
|
2712
|
-
|
|
2713
|
-
|
|
2714
|
-
],
|
|
2715
|
-
|
|
2716
|
-
|
|
2717
|
-
],
|
|
2718
|
-
|
|
2719
|
-
|
|
2720
|
-
],
|
|
2721
|
-
|
|
2722
|
-
|
|
2723
|
-
],
|
|
2724
|
-
|
|
2725
|
-
|
|
2726
|
-
],
|
|
2727
|
-
|
|
2728
|
-
|
|
2729
|
-
],
|
|
2730
|
-
|
|
2731
|
-
|
|
2732
|
-
],
|
|
2733
|
-
|
|
2734
|
-
|
|
2735
|
-
],
|
|
2736
|
-
|
|
2737
|
-
|
|
2738
|
-
],
|
|
2739
|
-
|
|
2740
|
-
|
|
2741
|
-
],
|
|
2742
|
-
|
|
2743
|
-
|
|
2744
|
-
],
|
|
2745
|
-
|
|
2746
|
-
|
|
2747
|
-
],
|
|
2748
|
-
|
|
2749
|
-
|
|
2750
|
-
],
|
|
2751
|
-
|
|
2752
|
-
|
|
2753
|
-
],
|
|
2754
|
-
|
|
2755
|
-
|
|
2756
|
-
],
|
|
2757
|
-
|
|
2758
|
-
|
|
2759
|
-
],
|
|
2760
|
-
|
|
2761
|
-
|
|
2762
|
-
],
|
|
2763
|
-
|
|
2764
|
-
|
|
2765
|
-
],
|
|
2766
|
-
|
|
2767
|
-
|
|
2768
|
-
],
|
|
2769
|
-
|
|
2770
|
-
|
|
2771
|
-
],
|
|
2772
|
-
|
|
2773
|
-
|
|
2774
|
-
],
|
|
2775
|
-
|
|
2776
|
-
|
|
2777
|
-
],
|
|
2778
|
-
|
|
2779
|
-
|
|
2780
|
-
],
|
|
2781
|
-
|
|
2782
|
-
|
|
2783
|
-
],
|
|
2784
|
-
|
|
2785
|
-
|
|
2786
|
-
],
|
|
2787
|
-
|
|
2788
|
-
|
|
2789
|
-
],
|
|
2790
|
-
|
|
2791
|
-
|
|
2792
|
-
],
|
|
2793
|
-
|
|
2794
|
-
|
|
2795
|
-
],
|
|
2796
|
-
|
|
2797
|
-
|
|
2798
|
-
],
|
|
2799
|
-
|
|
2800
|
-
|
|
2801
|
-
],
|
|
2802
|
-
|
|
2803
|
-
|
|
2804
|
-
],
|
|
2934
|
+
y([
|
|
2935
|
+
l({ attribute: "base-url", type: String })
|
|
2936
|
+
], g.prototype, "baseUrl", 2);
|
|
2937
|
+
y([
|
|
2938
|
+
l({ attribute: "token", type: String })
|
|
2939
|
+
], g.prototype, "token", 2);
|
|
2940
|
+
y([
|
|
2941
|
+
l({ reflect: !1, type: Object })
|
|
2942
|
+
], g.prototype, "asset", 2);
|
|
2943
|
+
y([
|
|
2944
|
+
l({ attribute: "crop-modes", reflect: !1, type: Array })
|
|
2945
|
+
], g.prototype, "cropModes", 2);
|
|
2946
|
+
y([
|
|
2947
|
+
l({ attribute: "focus-modes", reflect: !1, type: Object })
|
|
2948
|
+
], g.prototype, "focusModes", 2);
|
|
2949
|
+
y([
|
|
2950
|
+
l({ reflect: !1, type: Array })
|
|
2951
|
+
], g.prototype, "extensions", 2);
|
|
2952
|
+
y([
|
|
2953
|
+
l({ reflect: !1, type: Array })
|
|
2954
|
+
], g.prototype, "proxies", 2);
|
|
2955
|
+
y([
|
|
2956
|
+
l({ attribute: "for-cropper", reflect: !0, type: String })
|
|
2957
|
+
], g.prototype, "forCropper", 2);
|
|
2958
|
+
y([
|
|
2959
|
+
l({ attribute: "use-session", reflect: !0, type: String })
|
|
2960
|
+
], g.prototype, "useSession", 2);
|
|
2961
|
+
y([
|
|
2962
|
+
l({ reflect: !1, type: Array })
|
|
2963
|
+
], g.prototype, "transformations", 2);
|
|
2964
|
+
y([
|
|
2965
|
+
l({ attribute: "selected-proxy", reflect: !0, type: String })
|
|
2966
|
+
], g.prototype, "selectedProxy", 2);
|
|
2967
|
+
y([
|
|
2968
|
+
l({ attribute: "default-proxy", reflect: !0, type: String })
|
|
2969
|
+
], g.prototype, "defaultProxy", 2);
|
|
2970
|
+
y([
|
|
2971
|
+
l({ attribute: "use-custom-extension", reflect: !0, type: Boolean })
|
|
2972
|
+
], g.prototype, "useCustomExtension", 2);
|
|
2973
|
+
y([
|
|
2974
|
+
l({ attribute: "no-metadata", reflect: !0, type: Boolean })
|
|
2975
|
+
], g.prototype, "noMetadata", 2);
|
|
2976
|
+
y([
|
|
2977
|
+
l({ attribute: "no-format", reflect: !0, type: Boolean })
|
|
2978
|
+
], g.prototype, "noFormat", 2);
|
|
2979
|
+
y([
|
|
2980
|
+
l({ attribute: "no-crop", reflect: !0, type: Boolean })
|
|
2981
|
+
], g.prototype, "noCrop", 2);
|
|
2982
|
+
y([
|
|
2983
|
+
l({ attribute: "no-resize", reflect: !0, type: Boolean })
|
|
2984
|
+
], g.prototype, "noResize", 2);
|
|
2985
|
+
y([
|
|
2986
|
+
l({ attribute: "no-rotate", reflect: !0, type: Boolean })
|
|
2987
|
+
], g.prototype, "noRotate", 2);
|
|
2988
|
+
y([
|
|
2989
|
+
l({ attribute: "last-image-size", reflect: !1, type: Object })
|
|
2990
|
+
], g.prototype, "lastImageSize", 2);
|
|
2991
|
+
y([
|
|
2992
|
+
l({ attribute: "hide-header", reflect: !1, type: Boolean })
|
|
2993
|
+
], g.prototype, "hideHeader", 2);
|
|
2994
|
+
y([
|
|
2995
|
+
l({ attribute: "can-reset", type: Boolean })
|
|
2996
|
+
], g.prototype, "canReset", 2);
|
|
2997
|
+
y([
|
|
2998
|
+
l({ attribute: !1, reflect: !1, type: Object })
|
|
2999
|
+
], g.prototype, "queryElement", 2);
|
|
3000
|
+
y([
|
|
3001
|
+
k()
|
|
3002
|
+
], g.prototype, "activeSetting", 2);
|
|
3003
|
+
y([
|
|
3004
|
+
k()
|
|
3005
|
+
], g.prototype, "selectedFormat", 2);
|
|
3006
|
+
y([
|
|
3007
|
+
k()
|
|
3008
|
+
], g.prototype, "resizeSize", 2);
|
|
3009
|
+
y([
|
|
3010
|
+
k()
|
|
3011
|
+
], g.prototype, "cropSize", 2);
|
|
3012
|
+
y([
|
|
3013
|
+
k()
|
|
3014
|
+
], g.prototype, "rotation", 2);
|
|
3015
|
+
y([
|
|
3016
|
+
k()
|
|
3017
|
+
], g.prototype, "defaultSize", 2);
|
|
3018
|
+
y([
|
|
3019
|
+
k()
|
|
3020
|
+
], g.prototype, "cropperElement", 2);
|
|
3021
|
+
y([
|
|
3022
|
+
k()
|
|
3023
|
+
], g.prototype, "parameters", 2);
|
|
3024
|
+
y([
|
|
3025
|
+
k()
|
|
3026
|
+
], g.prototype, "loading", 2);
|
|
3027
|
+
y([
|
|
3028
|
+
k()
|
|
3029
|
+
], g.prototype, "lastAction", 2);
|
|
3030
|
+
y([
|
|
3031
|
+
k()
|
|
3032
|
+
], g.prototype, "frozenIndex", 2);
|
|
3033
|
+
y([
|
|
3034
|
+
k()
|
|
3035
|
+
], g.prototype, "preResetTransformations", 2);
|
|
3036
|
+
y([
|
|
3037
|
+
F("transformations")
|
|
3038
|
+
], g.prototype, "handleTransformationsChange", 1);
|
|
3039
|
+
y([
|
|
3040
|
+
F("selectedProxy")
|
|
3041
|
+
], g.prototype, "handleSelectedProxyChange", 1);
|
|
3042
|
+
y([
|
|
3043
|
+
F("loading")
|
|
3044
|
+
], g.prototype, "handleLoadingChange", 1);
|
|
3045
|
+
g = y([
|
|
3046
|
+
V("cx-asset-link-format")
|
|
3047
|
+
], g);
|
|
2805
3048
|
export {
|
|
2806
|
-
|
|
2807
|
-
|
|
2808
|
-
|
|
2809
|
-
|
|
2810
|
-
|
|
2811
|
-
|
|
2812
|
-
|
|
2813
|
-
|
|
2814
|
-
|
|
2815
|
-
|
|
2816
|
-
|
|
2817
|
-
|
|
2818
|
-
|
|
2819
|
-
|
|
2820
|
-
|
|
2821
|
-
|
|
2822
|
-
|
|
2823
|
-
|
|
2824
|
-
|
|
2825
|
-
|
|
2826
|
-
|
|
3049
|
+
g as C,
|
|
3050
|
+
wt as D,
|
|
3051
|
+
lt as F,
|
|
3052
|
+
J as O,
|
|
3053
|
+
me as a,
|
|
3054
|
+
he as b,
|
|
3055
|
+
Ot as c,
|
|
3056
|
+
Ri as d,
|
|
3057
|
+
$i as e,
|
|
3058
|
+
ki as f,
|
|
3059
|
+
Ut as g,
|
|
3060
|
+
dt as h,
|
|
3061
|
+
At as i,
|
|
3062
|
+
nt as j,
|
|
3063
|
+
Ft as k,
|
|
3064
|
+
Mt as l,
|
|
3065
|
+
ct as m,
|
|
3066
|
+
pt as n,
|
|
3067
|
+
It as o,
|
|
3068
|
+
Pi as p,
|
|
3069
|
+
ie as q,
|
|
3070
|
+
ee as u
|
|
2827
3071
|
};
|