@orangelogic/design-system 3.6.0 → 3.8.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.Bj6HJXSZ.js → asset-link-format.B-tXtkr4.js} +804 -785
- package/library/chunks/{color-swatch-group.Bz2acokX.js → color-swatch-group.D1evXBSR.js} +1 -1
- package/library/chunks/{document-viewer.BZw451dy.js → document-viewer.C_3p-Fr2.js} +1 -1
- package/library/chunks/{index.Bf5ia_yC.js → index.B60ncEsL.js} +3 -3
- package/library/chunks/{transformation.CkwgrwKQ.js → transformation.DNl_AZs1.js} +128 -106
- package/library/chunks/{types.BjHMUzQj.js → types.CRoGmgCO.js} +8892 -8880
- package/library/components/asset-link-format.js +2 -2
- package/library/components/atoms.js +1 -1
- package/library/components/color-swatch-group.js +1 -1
- package/library/components/document-viewer.js +1 -1
- package/library/components/masonry.js +7 -7
- package/library/components/organisms.js +2 -2
- package/library/components/types.js +95 -93
- package/library/package.json +1 -1
- package/library/packages/molecules/src/icon-picker/icon-picker.d.ts +2 -0
- package/library/packages/molecules/src/masonry/masonry.d.ts +1 -1
- package/library/packages/organisms/src/content-builder/blocks/image/image.d.ts +6 -0
- package/library/packages/organisms/src/content-builder-viewer/content-builder-viewer.d.ts +5 -5
- package/library/packages/services/src/api/asset/asset.d.ts +1 -2
- package/library/packages/tools/src/fetch-image/fetch-image.d.ts +10 -0
- package/library/packages/types/src/masonry.d.ts +1 -0
- package/library/packages/utils/src/transformation/transformation.d.ts +42 -7
- package/library/react-web-component.d.ts +2 -2
- package/library/utils.js +83 -81
- package/package.json +1 -1
|
@@ -1,50 +1,50 @@
|
|
|
1
1
|
import "../components/cropper.js";
|
|
2
|
-
import { C as
|
|
3
|
-
import
|
|
4
|
-
import { C as
|
|
5
|
-
import { n as h, C as
|
|
6
|
-
import { h as
|
|
2
|
+
import { C as J } from "./button.w0zH5Ivx.js";
|
|
3
|
+
import B from "../components/space.js";
|
|
4
|
+
import { C as q } from "./typography.IqHbnd3C.js";
|
|
5
|
+
import { n as h, C as j } from "./lib-cortex-element.CVMmyPMC.js";
|
|
6
|
+
import { h as T, a as Ot, C as Lt, S as Yt, b as Jt, c as te, d as ee } from "./endpoints.mJ5S-tIs.js";
|
|
7
7
|
import "./browser.BHOCIF_A.js";
|
|
8
|
-
import { i as
|
|
8
|
+
import { i as V, x as C, E as Ut } from "./lit-element.jLBm65_O.js";
|
|
9
9
|
import "./form.C8LMdQB4.js";
|
|
10
|
-
import { L as
|
|
10
|
+
import { L as G } from "./i18n.BA19xtyU.js";
|
|
11
11
|
import { a as ie } from "./string.Demn8Xmk.js";
|
|
12
12
|
import "./date-picker.BGHn6qg8.js";
|
|
13
13
|
import "./content-builder.BX4pHujE.js";
|
|
14
14
|
import "./unsafe-html.Dff7-rCx.js";
|
|
15
|
-
import { c as
|
|
16
|
-
import { b as
|
|
17
|
-
import { c as
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
15
|
+
import { c as It, r as Bt, d as se, e as ct } from "./transformation.DNl_AZs1.js";
|
|
16
|
+
import { b as ae } from "./_baseUniq.lwMgmtt2.js";
|
|
17
|
+
import { c as Q } from "./component.styles.CRO4Odto.js";
|
|
18
|
+
import { M as wt, U as r, T as f } from "./asset-link-format.ClaYu_v8.js";
|
|
19
|
+
import { v as oe } from "./v4.CKZ6klMF.js";
|
|
20
20
|
import { P as N } from "./position-picker.DjnhxIKF.js";
|
|
21
|
-
import { c as
|
|
21
|
+
import { c as X } from "./custom-element.L4WJXn1j.js";
|
|
22
22
|
import { w as P } from "./watch.DJF5K-8U.js";
|
|
23
|
-
import { s as
|
|
24
|
-
import { r as
|
|
25
|
-
import { n as
|
|
26
|
-
import
|
|
23
|
+
import { s as Et, a as pt } from "./number.Cx2ncfJJ.js";
|
|
24
|
+
import { r as R } from "./state.CSDxrqLd.js";
|
|
25
|
+
import { n as I } from "./when.Dr1es41R.js";
|
|
26
|
+
import st from "../components/details.js";
|
|
27
27
|
import qt from "../components/divider.js";
|
|
28
|
-
import { C as
|
|
29
|
-
import { C as
|
|
30
|
-
import { C as
|
|
31
|
-
import { C as
|
|
32
|
-
import
|
|
33
|
-
import
|
|
34
|
-
import { c as
|
|
35
|
-
import { e as
|
|
36
|
-
import { c as
|
|
28
|
+
import { C as at } from "./icon.CpHbi8tH.js";
|
|
29
|
+
import { C as Pt } from "./icon-button.BWJ1Vqn5.js";
|
|
30
|
+
import { C as Ft } from "./input.D1TGTsxj.js";
|
|
31
|
+
import { C as vt } from "./option.jeaj7_Lr.js";
|
|
32
|
+
import zt from "../components/select.js";
|
|
33
|
+
import re from "../components/position-picker.js";
|
|
34
|
+
import { c as ne } from "./image.Y5c_hFx8.js";
|
|
35
|
+
import { e as tt } from "./query.BBf1UFkC.js";
|
|
36
|
+
import { c as nt } from "./repeat.CFjcER6_.js";
|
|
37
37
|
import { o as O } from "./style-map.llVFPd__.js";
|
|
38
38
|
import jt from "../components/tooltip.js";
|
|
39
|
-
import
|
|
40
|
-
import
|
|
41
|
-
function
|
|
42
|
-
return t && t.length ?
|
|
39
|
+
import he from "../components/button-group.js";
|
|
40
|
+
import le from "../components/checkbox.js";
|
|
41
|
+
function ce(t) {
|
|
42
|
+
return t && t.length ? ae(t) : [];
|
|
43
43
|
}
|
|
44
44
|
function Vt(t) {
|
|
45
45
|
return typeof t == "object" && t !== null && "URI" in t;
|
|
46
46
|
}
|
|
47
|
-
const
|
|
47
|
+
const pe = {
|
|
48
48
|
artist: "Artist",
|
|
49
49
|
color: "Color",
|
|
50
50
|
createDate: "CreateDate",
|
|
@@ -66,97 +66,97 @@ const ce = {
|
|
|
66
66
|
systemIdentifier: "SystemIdentifier",
|
|
67
67
|
text: "Text",
|
|
68
68
|
title: "Title"
|
|
69
|
-
},
|
|
70
|
-
function
|
|
69
|
+
}, de = /* @__PURE__ */ new Set(["mediaDate", "createDate", "editDate"]);
|
|
70
|
+
function $t(t) {
|
|
71
71
|
return !/[\s&+/*"\\:(),'<>~|[\]{}]/.test(t) && !/^(?:OR|AND|NOT)$/.test(t) ? t : `"${t.replace(/\\/g, "\\\\").replace(/"/g, '\\"')}"`;
|
|
72
72
|
}
|
|
73
|
-
function
|
|
74
|
-
const s = (Array.isArray(e) ? e : [e]).map((a) => `${t}:${
|
|
73
|
+
function Tt(t, e) {
|
|
74
|
+
const s = (Array.isArray(e) ? e : [e]).map((a) => `${t}:${$t(a)}`);
|
|
75
75
|
return s.length > 1 ? `(${s.join(" OR ")})` : s[0] ?? "";
|
|
76
76
|
}
|
|
77
|
-
function
|
|
77
|
+
function ue(t, e) {
|
|
78
78
|
return (Array.isArray(e) ? e : [e]).map((s) => `${t}${s.operator}${s.value}`).join(" AND ");
|
|
79
79
|
}
|
|
80
|
-
function
|
|
80
|
+
function me(t) {
|
|
81
81
|
const e = [];
|
|
82
82
|
for (const i of Object.keys(t)) {
|
|
83
83
|
const s = i, a = t[s];
|
|
84
84
|
if (a == null)
|
|
85
85
|
continue;
|
|
86
86
|
if (s === "custom") {
|
|
87
|
-
for (const [
|
|
87
|
+
for (const [o, l] of Object.entries(
|
|
88
88
|
a
|
|
89
89
|
))
|
|
90
|
-
e.push(
|
|
90
|
+
e.push(Tt(o, l));
|
|
91
91
|
continue;
|
|
92
92
|
}
|
|
93
|
-
const
|
|
94
|
-
if (
|
|
95
|
-
if (
|
|
93
|
+
const n = pe[s];
|
|
94
|
+
if (n) {
|
|
95
|
+
if (de.has(s)) {
|
|
96
96
|
e.push(
|
|
97
|
-
|
|
97
|
+
ue(n, a)
|
|
98
98
|
);
|
|
99
99
|
continue;
|
|
100
100
|
}
|
|
101
101
|
if (s === "color") {
|
|
102
|
-
e.push(`${
|
|
102
|
+
e.push(`${n}:${a}`);
|
|
103
103
|
continue;
|
|
104
104
|
}
|
|
105
105
|
if (s === "parentFolderIdentifier") {
|
|
106
|
-
const
|
|
107
|
-
if (
|
|
106
|
+
const o = Array.isArray(a) ? a : [a];
|
|
107
|
+
if (o.length === 0)
|
|
108
108
|
continue;
|
|
109
109
|
const l = [
|
|
110
|
-
...
|
|
111
|
-
...
|
|
110
|
+
...o.map((d) => `ParentFolderIdentifier:${$t(String(d))}`),
|
|
111
|
+
...o.map((d) => `ParentAlbumIdentifier:${$t(String(d))}`)
|
|
112
112
|
];
|
|
113
113
|
e.push(`(${l.join(" OR ")})`);
|
|
114
114
|
continue;
|
|
115
115
|
}
|
|
116
|
-
e.push(
|
|
116
|
+
e.push(Tt(n, a));
|
|
117
117
|
}
|
|
118
118
|
}
|
|
119
119
|
return e.join(" AND ");
|
|
120
120
|
}
|
|
121
|
-
function
|
|
121
|
+
function dt(t) {
|
|
122
122
|
if ("and" in t)
|
|
123
|
-
return t.and.map(
|
|
123
|
+
return t.and.map(dt).filter(Boolean).join(" AND ");
|
|
124
124
|
if ("or" in t) {
|
|
125
|
-
const e = t.or.map(
|
|
125
|
+
const e = t.or.map(dt).filter(Boolean);
|
|
126
126
|
return e.length > 1 ? `(${e.join(" OR ")})` : e[0] ?? "";
|
|
127
127
|
}
|
|
128
128
|
if ("not" in t) {
|
|
129
|
-
const e =
|
|
129
|
+
const e = dt(t.not);
|
|
130
130
|
return e ? `NOT (${e})` : "";
|
|
131
131
|
}
|
|
132
|
-
return
|
|
132
|
+
return me(t);
|
|
133
133
|
}
|
|
134
|
-
const
|
|
134
|
+
const fe = "CoreField.LargeSizePreview", ut = "CoreField.DocType", ge = "Document.Title", xe = "Document.CaptionLong", ht = "Document.FileExtension", mt = "CoreField.FileSize", Ht = "CoreField.Identifier", ft = "CoreField.MaxHeight", gt = "CoreField.MaxWidth", xt = "Document.RecordID", Wt = "CoreField.DocSubType", Gt = "CoreField.TitleWithFallback", yt = "CoreField.OriginalFileName", St = "CoreField.UpdatedFileName", _t = "__width", ye = "CoreField.OriginalPreview", Li = "Document.DocSubType", Ui = "Document.InPoint", Bi = "Document.OutPoint", bt = {
|
|
135
135
|
DEFAULT_VIEW_SIZE: "Document.LargeSizePreview",
|
|
136
136
|
FIELD_TITLE_WITH_FALLBACK: "Document.TitleWithFallback",
|
|
137
137
|
ORIGINAL_VIEW_SIZE: "Document.OriginalPreview"
|
|
138
138
|
}, Qt = {
|
|
139
|
-
[
|
|
140
|
-
[Gt]:
|
|
141
|
-
[
|
|
142
|
-
},
|
|
139
|
+
[fe]: bt.DEFAULT_VIEW_SIZE,
|
|
140
|
+
[Gt]: bt.FIELD_TITLE_WITH_FALLBACK,
|
|
141
|
+
[ye]: bt.ORIGINAL_VIEW_SIZE
|
|
142
|
+
}, Se = Object.fromEntries(
|
|
143
143
|
Object.entries(Qt).map(([t, e]) => [
|
|
144
144
|
e,
|
|
145
145
|
t
|
|
146
146
|
])
|
|
147
147
|
);
|
|
148
|
-
function
|
|
148
|
+
function Ae(t) {
|
|
149
149
|
return Qt[t] ?? t;
|
|
150
150
|
}
|
|
151
151
|
function Dt(t) {
|
|
152
152
|
const e = {};
|
|
153
153
|
for (const [i, s] of Object.entries(t)) {
|
|
154
|
-
const a =
|
|
154
|
+
const a = Se[i] ?? i;
|
|
155
155
|
e[a] = s;
|
|
156
156
|
}
|
|
157
157
|
return e;
|
|
158
158
|
}
|
|
159
|
-
function
|
|
159
|
+
function ve(t) {
|
|
160
160
|
const e = new URLSearchParams();
|
|
161
161
|
for (const [i, s] of Object.entries(t))
|
|
162
162
|
s != null && (Array.isArray(s) ? s.forEach((a) => e.append(i, String(a))) : e.append(i, String(s)));
|
|
@@ -168,44 +168,44 @@ async function Xt({
|
|
|
168
168
|
getPermanentAssetsPaths: i,
|
|
169
169
|
httpMethod: s = "GET",
|
|
170
170
|
isSiteBuilder: a,
|
|
171
|
-
pageNumber:
|
|
172
|
-
query:
|
|
171
|
+
pageNumber: n,
|
|
172
|
+
query: o,
|
|
173
173
|
securityByPassToken: l,
|
|
174
|
-
siteUrl:
|
|
175
|
-
sort:
|
|
174
|
+
siteUrl: d,
|
|
175
|
+
sort: m,
|
|
176
176
|
token: c,
|
|
177
|
-
useSession:
|
|
177
|
+
useSession: y
|
|
178
178
|
}) {
|
|
179
|
-
const S = e?.map(
|
|
179
|
+
const S = e?.map(Ae), p = {
|
|
180
180
|
CountPerPage: t,
|
|
181
|
-
Fields:
|
|
181
|
+
Fields: ce(S),
|
|
182
182
|
Format: "json",
|
|
183
183
|
GetPermanentAssetsPaths: i || void 0,
|
|
184
|
-
PageNumber:
|
|
185
|
-
Query:
|
|
184
|
+
PageNumber: n,
|
|
185
|
+
Query: dt(o),
|
|
186
186
|
SecurityByPassToken: l || void 0,
|
|
187
|
-
Sort:
|
|
188
|
-
UseSession:
|
|
189
|
-
},
|
|
187
|
+
Sort: m || void 0,
|
|
188
|
+
UseSession: y || void 0
|
|
189
|
+
}, g = s === "POST";
|
|
190
190
|
try {
|
|
191
|
-
return (await
|
|
192
|
-
baseURL:
|
|
191
|
+
return (await T.request({
|
|
192
|
+
baseURL: d,
|
|
193
193
|
headers: c ? { Authorization: `Bearer ${c}` } : void 0,
|
|
194
194
|
method: s,
|
|
195
195
|
// POST large RecordID queries as a urlencoded body to dodge the ~2KB URL cap;
|
|
196
196
|
// GET keeps the same fields on the query string.
|
|
197
|
-
...
|
|
197
|
+
...g ? { data: ve(p) } : { params: p, paramsSerializer: { indexes: null } },
|
|
198
198
|
responseType: "json",
|
|
199
199
|
transformResponse: [
|
|
200
|
-
...Array.isArray(
|
|
201
|
-
a ? (
|
|
202
|
-
items: (
|
|
203
|
-
sort:
|
|
204
|
-
totalCount:
|
|
205
|
-
}) : (
|
|
206
|
-
items: (
|
|
207
|
-
sort:
|
|
208
|
-
totalCount:
|
|
200
|
+
...Array.isArray(T.defaults.transformResponse) ? T.defaults.transformResponse : [],
|
|
201
|
+
a ? (A) => ({
|
|
202
|
+
items: (A.results?.Items ?? []).map(Dt),
|
|
203
|
+
sort: A.results?.GlobalInfo?.Sort ?? "",
|
|
204
|
+
totalCount: A.results?.GlobalInfo?.TotalCount ?? 0
|
|
205
|
+
}) : (A) => ({
|
|
206
|
+
items: (A.APIResponse?.Items ?? []).map(Dt),
|
|
207
|
+
sort: A.APIResponse?.GlobalInfo?.Sort ?? "",
|
|
208
|
+
totalCount: A.APIResponse?.GlobalInfo?.TotalCount ?? 0
|
|
209
209
|
})
|
|
210
210
|
],
|
|
211
211
|
url: a ? Lt.SEARCH_ASSETS : Yt["4.0"]
|
|
@@ -214,17 +214,17 @@ async function Xt({
|
|
|
214
214
|
return { items: [], sort: "", totalCount: 0 };
|
|
215
215
|
}
|
|
216
216
|
}
|
|
217
|
-
async function
|
|
217
|
+
async function ze({
|
|
218
218
|
assetId: t,
|
|
219
219
|
extension: e,
|
|
220
220
|
format: i,
|
|
221
221
|
siteUrl: s,
|
|
222
222
|
token: a,
|
|
223
|
-
transformations:
|
|
224
|
-
useSession:
|
|
223
|
+
transformations: n,
|
|
224
|
+
useSession: o
|
|
225
225
|
}) {
|
|
226
226
|
try {
|
|
227
|
-
return (await
|
|
227
|
+
return (await T.request({
|
|
228
228
|
baseURL: s,
|
|
229
229
|
method: "GET",
|
|
230
230
|
params: {
|
|
@@ -232,8 +232,8 @@ async function ve({
|
|
|
232
232
|
SourceAssetRecordID: t,
|
|
233
233
|
TargetExtension: ie(e),
|
|
234
234
|
Token: a || void 0,
|
|
235
|
-
Transformations:
|
|
236
|
-
UseSession:
|
|
235
|
+
Transformations: n,
|
|
236
|
+
UseSession: o || void 0
|
|
237
237
|
},
|
|
238
238
|
/**
|
|
239
239
|
* https://link.orangelogic.com/Tasks/41S1XH
|
|
@@ -246,67 +246,67 @@ async function ve({
|
|
|
246
246
|
return null;
|
|
247
247
|
}
|
|
248
248
|
}
|
|
249
|
-
const
|
|
250
|
-
function
|
|
249
|
+
const Ce = 50;
|
|
250
|
+
function we(t, e) {
|
|
251
251
|
const i = [];
|
|
252
252
|
for (let s = 0; s < t.length; s += e)
|
|
253
253
|
i.push(t.slice(s, s + e));
|
|
254
254
|
return i;
|
|
255
255
|
}
|
|
256
|
-
async function
|
|
256
|
+
async function be({
|
|
257
257
|
extraFields: t,
|
|
258
258
|
getPermanentAssetsPaths: e,
|
|
259
259
|
isSiteBuilder: i,
|
|
260
260
|
recordIds: s,
|
|
261
261
|
securityByPassToken: a,
|
|
262
|
-
token:
|
|
262
|
+
token: n
|
|
263
263
|
}) {
|
|
264
264
|
if (!Array.isArray(s) || s.length === 0)
|
|
265
265
|
return { facets: [], items: [], totalCount: 0 };
|
|
266
|
-
const
|
|
267
|
-
...
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
fe,
|
|
266
|
+
const o = t?.filter((p) => p && typeof p == "string") ?? [], l = [
|
|
267
|
+
...o,
|
|
268
|
+
St,
|
|
269
|
+
yt,
|
|
271
270
|
ge,
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
271
|
+
xe,
|
|
272
|
+
xt
|
|
273
|
+
], d = we(s, Ce), m = await Promise.all(
|
|
274
|
+
d.map(
|
|
275
|
+
(p) => Xt({
|
|
276
|
+
countPerPage: p.length,
|
|
277
277
|
fields: l,
|
|
278
278
|
getPermanentAssetsPaths: e,
|
|
279
279
|
httpMethod: i ? "GET" : "POST",
|
|
280
280
|
isSiteBuilder: i,
|
|
281
281
|
pageNumber: 1,
|
|
282
|
-
query: { recordId:
|
|
282
|
+
query: { recordId: p },
|
|
283
283
|
securityByPassToken: a,
|
|
284
|
-
token:
|
|
284
|
+
token: n
|
|
285
285
|
})
|
|
286
286
|
)
|
|
287
|
-
), c = new Map(s.map((
|
|
288
|
-
let
|
|
289
|
-
return
|
|
290
|
-
name:
|
|
291
|
-
recordId:
|
|
292
|
-
...
|
|
293
|
-
(
|
|
294
|
-
|
|
295
|
-
const
|
|
296
|
-
return
|
|
287
|
+
), c = new Map(s.map((p, g) => [p, g])), y = m.flatMap((p) => p.items).map((p) => {
|
|
288
|
+
let g = M(p, St);
|
|
289
|
+
return g === "" && (g = M(p, yt)), {
|
|
290
|
+
name: g,
|
|
291
|
+
recordId: M(p, xt),
|
|
292
|
+
...o.reduce(
|
|
293
|
+
(w, A) => {
|
|
294
|
+
w[A] = M(p, A);
|
|
295
|
+
const F = Kt(p, A);
|
|
296
|
+
return F !== void 0 && (w[`${A}${_t}`] = String(F)), w;
|
|
297
297
|
},
|
|
298
298
|
{}
|
|
299
299
|
)
|
|
300
300
|
};
|
|
301
301
|
}).sort(
|
|
302
|
-
(
|
|
303
|
-
), S =
|
|
304
|
-
(
|
|
302
|
+
(p, g) => (c.get(p.recordId) ?? 1 / 0) - (c.get(g.recordId) ?? 1 / 0)
|
|
303
|
+
), S = m.reduce(
|
|
304
|
+
(p, g) => p + g.totalCount,
|
|
305
305
|
0
|
|
306
306
|
);
|
|
307
|
-
return { facets: [], items:
|
|
307
|
+
return { facets: [], items: y, totalCount: S };
|
|
308
308
|
}
|
|
309
|
-
function
|
|
309
|
+
function M(t, e) {
|
|
310
310
|
const i = t[e];
|
|
311
311
|
return i == null ? "" : typeof i == "string" ? i : typeof i == "number" || typeof i == "boolean" ? String(i) : Vt(i) ? i.URI : "";
|
|
312
312
|
}
|
|
@@ -315,71 +315,70 @@ function Kt(t, e) {
|
|
|
315
315
|
if (!(i == null || !Vt(i)))
|
|
316
316
|
return typeof i.Width == "number" && i.Width > 0 ? i.Width : void 0;
|
|
317
317
|
}
|
|
318
|
-
async function
|
|
318
|
+
async function ke({
|
|
319
319
|
countPerPage: t,
|
|
320
320
|
directParentFolderIdentifier: e,
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
321
|
+
excludedDocTypes: i,
|
|
322
|
+
extraFields: s,
|
|
323
|
+
getPermanentAssetsPaths: a,
|
|
324
|
+
isSiteBuilder: n,
|
|
324
325
|
limitedDocTypes: o,
|
|
325
|
-
pageNumber:
|
|
326
|
-
parentFolderIdentifier:
|
|
327
|
-
searchTerm:
|
|
328
|
-
securityByPassToken:
|
|
329
|
-
sortOrder:
|
|
330
|
-
token:
|
|
326
|
+
pageNumber: l,
|
|
327
|
+
parentFolderIdentifier: d,
|
|
328
|
+
searchTerm: m,
|
|
329
|
+
securityByPassToken: c,
|
|
330
|
+
sortOrder: y,
|
|
331
|
+
token: S
|
|
331
332
|
}) {
|
|
332
|
-
if (!e && !
|
|
333
|
+
if (!e && !d)
|
|
333
334
|
return { facets: [], items: [], totalCount: 0 };
|
|
334
|
-
const
|
|
335
|
+
const p = (s?.filter((b) => b && typeof b == "string") ?? []).map((b) => b.replace("%20", " ")), g = {
|
|
335
336
|
directParentFolderIdentifier: e,
|
|
336
|
-
parentFolderIdentifier:
|
|
337
|
+
parentFolderIdentifier: d,
|
|
337
338
|
...o && o.length > 0 ? { docType: o } : {}
|
|
338
|
-
}, A = await Xt({
|
|
339
|
+
}, w = i && i.length > 0 ? { and: [g, { not: { docType: i } }] } : g, A = await Xt({
|
|
339
340
|
countPerPage: t,
|
|
340
341
|
fields: [
|
|
341
|
-
...
|
|
342
|
+
...p,
|
|
342
343
|
Gt,
|
|
343
|
-
|
|
344
|
+
gt,
|
|
345
|
+
ft,
|
|
346
|
+
mt,
|
|
344
347
|
ut,
|
|
345
|
-
dt,
|
|
346
|
-
pt,
|
|
347
|
-
ct,
|
|
348
348
|
Wt,
|
|
349
349
|
Ht,
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
350
|
+
ht,
|
|
351
|
+
xt,
|
|
352
|
+
yt,
|
|
353
|
+
St
|
|
354
354
|
],
|
|
355
|
-
getPermanentAssetsPaths:
|
|
356
|
-
isSiteBuilder:
|
|
357
|
-
pageNumber:
|
|
358
|
-
query:
|
|
359
|
-
securityByPassToken:
|
|
355
|
+
getPermanentAssetsPaths: a,
|
|
356
|
+
isSiteBuilder: n,
|
|
357
|
+
pageNumber: l,
|
|
358
|
+
query: w,
|
|
359
|
+
securityByPassToken: c,
|
|
360
360
|
sort: void 0,
|
|
361
|
-
token:
|
|
362
|
-
}),
|
|
363
|
-
let
|
|
364
|
-
|
|
365
|
-
const
|
|
361
|
+
token: S
|
|
362
|
+
}), F = A.items.map((b) => {
|
|
363
|
+
let _ = M(b, ht), ot = M(b, St);
|
|
364
|
+
_ && !_.startsWith(".") && (_ = "." + _), ot === "" && (ot = M(b, yt));
|
|
365
|
+
const lt = M(b, xt);
|
|
366
366
|
return {
|
|
367
|
-
docSubType:
|
|
368
|
-
docType:
|
|
369
|
-
extension:
|
|
370
|
-
height:
|
|
371
|
-
id:
|
|
372
|
-
identifier:
|
|
373
|
-
name:
|
|
374
|
-
recordId:
|
|
375
|
-
size:
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
return K !== void 0 && (at[`${et}${$t}`] = String(K)), at;
|
|
367
|
+
docSubType: M(b, Wt),
|
|
368
|
+
docType: M(b, ut) || "",
|
|
369
|
+
extension: _,
|
|
370
|
+
height: M(b, ft) || "0",
|
|
371
|
+
id: lt,
|
|
372
|
+
identifier: M(b, Ht),
|
|
373
|
+
name: ot,
|
|
374
|
+
recordId: lt,
|
|
375
|
+
size: M(b, mt) || "0 MB",
|
|
376
|
+
width: M(b, gt) || "0",
|
|
377
|
+
...p.reduce(
|
|
378
|
+
(L, Z) => {
|
|
379
|
+
L[Z] = M(b, Z);
|
|
380
|
+
const rt = Kt(b, Z);
|
|
381
|
+
return rt !== void 0 && (L[`${Z}${_t}`] = String(rt)), L;
|
|
383
382
|
},
|
|
384
383
|
{}
|
|
385
384
|
)
|
|
@@ -387,11 +386,11 @@ async function be({
|
|
|
387
386
|
});
|
|
388
387
|
return {
|
|
389
388
|
facets: [],
|
|
390
|
-
items:
|
|
389
|
+
items: F,
|
|
391
390
|
totalCount: A.totalCount
|
|
392
391
|
};
|
|
393
392
|
}
|
|
394
|
-
async function
|
|
393
|
+
async function Re({
|
|
395
394
|
autoCropMode: t,
|
|
396
395
|
cropHeight: e,
|
|
397
396
|
cropWidth: i,
|
|
@@ -399,7 +398,7 @@ async function ke({
|
|
|
399
398
|
useSession: a
|
|
400
399
|
}) {
|
|
401
400
|
try {
|
|
402
|
-
return (await
|
|
401
|
+
return (await T.request({
|
|
403
402
|
method: "GET",
|
|
404
403
|
params: {
|
|
405
404
|
AutoCropMode: t,
|
|
@@ -412,12 +411,12 @@ async function ke({
|
|
|
412
411
|
timeout: 3e5,
|
|
413
412
|
// 5 minutes
|
|
414
413
|
transformResponse: [
|
|
415
|
-
...Array.isArray(
|
|
416
|
-
(
|
|
417
|
-
height:
|
|
418
|
-
width:
|
|
419
|
-
x:
|
|
420
|
-
y:
|
|
414
|
+
...Array.isArray(T.defaults.transformResponse) ? T.defaults.transformResponse : [],
|
|
415
|
+
(o) => ({
|
|
416
|
+
height: o.cropHeight,
|
|
417
|
+
width: o.cropWidth,
|
|
418
|
+
x: o.cropX,
|
|
419
|
+
y: o.cropY
|
|
421
420
|
})
|
|
422
421
|
],
|
|
423
422
|
url: Ot.GET_CROP_ZONE_SUGGESTION
|
|
@@ -426,7 +425,7 @@ async function ke({
|
|
|
426
425
|
return null;
|
|
427
426
|
}
|
|
428
427
|
}
|
|
429
|
-
async function
|
|
428
|
+
async function qi({
|
|
430
429
|
assetRecordId: t,
|
|
431
430
|
isSiteBuilder: e,
|
|
432
431
|
siteUrl: i,
|
|
@@ -434,7 +433,7 @@ async function Ui({
|
|
|
434
433
|
useSession: a
|
|
435
434
|
}) {
|
|
436
435
|
try {
|
|
437
|
-
return (await
|
|
436
|
+
return (await T.request({
|
|
438
437
|
baseURL: i,
|
|
439
438
|
method: "GET",
|
|
440
439
|
params: {
|
|
@@ -444,8 +443,8 @@ async function Ui({
|
|
|
444
443
|
},
|
|
445
444
|
responseType: "json",
|
|
446
445
|
transformResponse: [
|
|
447
|
-
...Array.isArray(
|
|
448
|
-
(
|
|
446
|
+
...Array.isArray(T.defaults.transformResponse) ? T.defaults.transformResponse : [],
|
|
447
|
+
(o) => !o || typeof o != "object" ? [] : o.proxies?.map((l) => ({
|
|
449
448
|
cdnName: l.cdnName,
|
|
450
449
|
extension: l.extension,
|
|
451
450
|
formatHeight: l.formatHeight,
|
|
@@ -463,16 +462,16 @@ async function Ui({
|
|
|
463
462
|
return [];
|
|
464
463
|
}
|
|
465
464
|
}
|
|
466
|
-
async function
|
|
465
|
+
async function ji({
|
|
467
466
|
siteUrl: t
|
|
468
467
|
} = {}) {
|
|
469
468
|
try {
|
|
470
|
-
return (await
|
|
469
|
+
return (await T.request({
|
|
471
470
|
baseURL: t,
|
|
472
471
|
method: "GET",
|
|
473
472
|
responseType: "json",
|
|
474
473
|
transformResponse: [
|
|
475
|
-
...Array.isArray(
|
|
474
|
+
...Array.isArray(T.defaults.transformResponse) ? T.defaults.transformResponse : [],
|
|
476
475
|
(i) => !i || typeof i != "object" ? {
|
|
477
476
|
formatsByDocType: {
|
|
478
477
|
Audio: {},
|
|
@@ -490,7 +489,7 @@ async function Bi({
|
|
|
490
489
|
return { formatsByDocType: {} };
|
|
491
490
|
}
|
|
492
491
|
}
|
|
493
|
-
async function
|
|
492
|
+
async function Vi({
|
|
494
493
|
recordIds: t,
|
|
495
494
|
rightsToCheck: e
|
|
496
495
|
}) {
|
|
@@ -501,7 +500,7 @@ async function qi({
|
|
|
501
500
|
invalidObjects: []
|
|
502
501
|
};
|
|
503
502
|
try {
|
|
504
|
-
const { data: s } = await
|
|
503
|
+
const { data: s } = await T.request({
|
|
505
504
|
method: "GET",
|
|
506
505
|
params: { RecordIDs: t, RightsToCheck: e },
|
|
507
506
|
paramsSerializer: { indexes: null },
|
|
@@ -513,7 +512,11 @@ async function qi({
|
|
|
513
512
|
return i;
|
|
514
513
|
}
|
|
515
514
|
}
|
|
516
|
-
const
|
|
515
|
+
const kt = 20, $e = [
|
|
516
|
+
wt.Album,
|
|
517
|
+
wt.ProjectDocument,
|
|
518
|
+
wt.Story
|
|
519
|
+
], it = "TR1", At = "TRX", Pe = /* @__PURE__ */ new Set([".gif"]), Fe = /* @__PURE__ */ new Set([
|
|
517
520
|
".avif",
|
|
518
521
|
".bmp",
|
|
519
522
|
".gif",
|
|
@@ -526,30 +529,43 @@ const vt = 20, wt = "TR1", bt = "TRX", Re = /* @__PURE__ */ new Set([".gif"]), $
|
|
|
526
529
|
]);
|
|
527
530
|
function Zt(t) {
|
|
528
531
|
const e = t.toLowerCase(), i = e.startsWith(".") ? e : `.${e}`;
|
|
529
|
-
return
|
|
532
|
+
return Fe.has(i);
|
|
530
533
|
}
|
|
531
534
|
function Nt({
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
535
|
+
autoFormat: t,
|
|
536
|
+
extension: e,
|
|
537
|
+
format: i,
|
|
538
|
+
item: s,
|
|
539
|
+
manualFormat: a,
|
|
540
|
+
size: n
|
|
537
541
|
}) {
|
|
538
|
-
const o =
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
542
|
+
const o = e?.toLowerCase() ?? "", l = o.startsWith(".") ? o : `.${o}`, d = `path_${it}`, m = (p, g) => {
|
|
543
|
+
const w = s[p];
|
|
544
|
+
if (w)
|
|
545
|
+
return {
|
|
546
|
+
maxWidth: s[`${p}${_t}`],
|
|
547
|
+
src: t ? se(w, {
|
|
548
|
+
extension: o,
|
|
549
|
+
format: g
|
|
550
|
+
}) : w
|
|
551
|
+
};
|
|
552
|
+
};
|
|
553
|
+
if (!a) {
|
|
554
|
+
const p = Bt(o, n), g = `path_${p}`;
|
|
555
|
+
return m(g, p) ?? m(d, it) ?? {};
|
|
556
|
+
}
|
|
557
|
+
if (!!o && Pe.has(l))
|
|
558
|
+
return m(`path_${At}`, At) ?? m(d, it) ?? {};
|
|
559
|
+
const y = !o || Zt(o), S = i ? `path_${i}` : void 0;
|
|
560
|
+
return S && y && s[S] ? m(S, i) ?? {} : m(d, it) ?? {};
|
|
545
561
|
}
|
|
546
|
-
class
|
|
562
|
+
class Gi {
|
|
547
563
|
constructor(e, i) {
|
|
548
|
-
this.data = [], this.folderId = "", this.fetchedPages = /* @__PURE__ */ new Set(), this.totalCount = 0, this.maxEnd = 1 / 0, this.pageSize =
|
|
564
|
+
this.data = [], this.folderId = "", this.fetchedPages = /* @__PURE__ */ new Set(), this.totalCount = 0, this.maxEnd = 1 / 0, this.pageSize = kt, this.requestEpoch = 0, this.host = e, this.host.addController?.(this);
|
|
549
565
|
const s = i?.maxEnd;
|
|
550
566
|
this.maxEnd = typeof s == "number" && Number.isFinite(s) && s >= 0 ? Math.floor(s) : 1 / 0;
|
|
551
567
|
const a = i?.pageSize;
|
|
552
|
-
this.pageSize = typeof a == "number" && Number.isFinite(a) && a >= 1 ? Math.floor(a) :
|
|
568
|
+
this.pageSize = typeof a == "number" && Number.isFinite(a) && a >= 1 ? Math.floor(a) : kt, this.authToken = i?.token, this.securityByPassToken = i?.securityByPassToken, this.isSiteBuilder = i?.isSiteBuilder ?? !1, this.autoFormat = i?.autoFormat ?? !1;
|
|
553
569
|
}
|
|
554
570
|
get totalDataCount() {
|
|
555
571
|
return this.totalCount;
|
|
@@ -567,7 +583,7 @@ class ji {
|
|
|
567
583
|
* Shrinking is ignored once pages are cached: collapsing already has what it needs.
|
|
568
584
|
*/
|
|
569
585
|
setPageSize(e) {
|
|
570
|
-
const i = Number.isFinite(e) && e >= 1 ? Math.floor(e) :
|
|
586
|
+
const i = Number.isFinite(e) && e >= 1 ? Math.floor(e) : kt;
|
|
571
587
|
if (this.pageSize === i)
|
|
572
588
|
return;
|
|
573
589
|
const s = this.fetchedPages.size > 0;
|
|
@@ -578,33 +594,34 @@ class ji {
|
|
|
578
594
|
extraFields: i = [],
|
|
579
595
|
format: s,
|
|
580
596
|
manualFormat: a = !0,
|
|
581
|
-
start:
|
|
582
|
-
transformations:
|
|
597
|
+
start: n,
|
|
598
|
+
transformations: o
|
|
583
599
|
}) {
|
|
584
|
-
if (e <
|
|
600
|
+
if (e < n)
|
|
585
601
|
return this.data;
|
|
586
|
-
if (this.totalCount > 0 && e >= this.totalCount && (e = this.totalCount - 1, e <
|
|
602
|
+
if (this.totalCount > 0 && e >= this.totalCount && (e = this.totalCount - 1, e < n))
|
|
587
603
|
return this.data;
|
|
588
604
|
const l = this.requestEpoch;
|
|
589
605
|
if (!this.folderId || l !== this.requestEpoch)
|
|
590
606
|
return this.data;
|
|
591
|
-
const
|
|
607
|
+
const d = s ? `path_${s}` : void 0, m = `path_${it}`, c = `path_${At}`, y = [
|
|
592
608
|
...new Set(
|
|
593
|
-
[
|
|
594
|
-
(
|
|
609
|
+
[d, m, c].filter(
|
|
610
|
+
(g) => !!g
|
|
595
611
|
)
|
|
596
612
|
)
|
|
597
|
-
], S = Math.floor(
|
|
598
|
-
for (let
|
|
599
|
-
if (this.fetchedPages.has(
|
|
613
|
+
], S = Math.floor(n / this.pageSize) + 1, p = Math.floor(e / this.pageSize) + 1;
|
|
614
|
+
for (let g = S; g <= p; g++) {
|
|
615
|
+
if (this.fetchedPages.has(g))
|
|
600
616
|
continue;
|
|
601
|
-
const
|
|
617
|
+
const w = await ke({
|
|
602
618
|
countPerPage: this.pageSize,
|
|
603
619
|
directParentFolderIdentifier: this.folderId,
|
|
604
|
-
|
|
620
|
+
excludedDocTypes: $e,
|
|
621
|
+
extraFields: [...i, ...y],
|
|
605
622
|
getPermanentAssetsPaths: !0,
|
|
606
623
|
isSiteBuilder: this.isSiteBuilder,
|
|
607
|
-
pageNumber:
|
|
624
|
+
pageNumber: g,
|
|
608
625
|
searchTerm: "",
|
|
609
626
|
securityByPassToken: this.securityByPassToken,
|
|
610
627
|
sortOrder: "",
|
|
@@ -612,37 +629,38 @@ class ji {
|
|
|
612
629
|
});
|
|
613
630
|
if (l !== this.requestEpoch)
|
|
614
631
|
return this.data;
|
|
615
|
-
if (this.fetchedPages.add(
|
|
616
|
-
const
|
|
617
|
-
this.totalCount =
|
|
632
|
+
if (this.fetchedPages.add(g), !this.totalCount && w.totalCount) {
|
|
633
|
+
const F = Math.min(this.maxEnd, w.totalCount);
|
|
634
|
+
this.totalCount = F, this.data = Array.from({ length: F }, () => ({
|
|
618
635
|
alt: "",
|
|
619
|
-
id: `temp-${
|
|
636
|
+
id: `temp-${oe()}`,
|
|
620
637
|
name: "",
|
|
621
638
|
src: ""
|
|
622
639
|
}));
|
|
623
640
|
}
|
|
624
|
-
const
|
|
625
|
-
for (let
|
|
626
|
-
const
|
|
627
|
-
if (
|
|
628
|
-
const
|
|
629
|
-
|
|
641
|
+
const A = (g - 1) * this.pageSize;
|
|
642
|
+
for (let F = 0; F < w.items.length; F++) {
|
|
643
|
+
const b = A + F;
|
|
644
|
+
if (b < this.data.length) {
|
|
645
|
+
const _ = w.items[F], { maxWidth: ot, src: lt } = Nt({
|
|
646
|
+
autoFormat: this.autoFormat,
|
|
647
|
+
extension: _.extension,
|
|
630
648
|
format: s,
|
|
631
|
-
item:
|
|
649
|
+
item: _,
|
|
632
650
|
manualFormat: a,
|
|
633
|
-
size:
|
|
651
|
+
size: _.size
|
|
634
652
|
});
|
|
635
|
-
let
|
|
636
|
-
|
|
637
|
-
alt:
|
|
638
|
-
docType:
|
|
639
|
-
extension:
|
|
640
|
-
id:
|
|
641
|
-
maxWidth:
|
|
642
|
-
name:
|
|
643
|
-
src:
|
|
653
|
+
let L = lt;
|
|
654
|
+
L && o && o.length > 0 && (L = It(L, o)), this.data[b] = {
|
|
655
|
+
alt: _.name,
|
|
656
|
+
docType: _.docType,
|
|
657
|
+
extension: _.extension,
|
|
658
|
+
id: _.id,
|
|
659
|
+
maxWidth: ot,
|
|
660
|
+
name: _.name,
|
|
661
|
+
src: L,
|
|
644
662
|
...i.reduce(
|
|
645
|
-
(
|
|
663
|
+
(Z, rt) => (Z[rt] = _[rt] ?? "", Z),
|
|
646
664
|
{}
|
|
647
665
|
)
|
|
648
666
|
};
|
|
@@ -655,85 +673,86 @@ class ji {
|
|
|
655
673
|
extraFields: i = [],
|
|
656
674
|
folderId: s,
|
|
657
675
|
forceRefetch: a = !1,
|
|
658
|
-
format:
|
|
659
|
-
manualFormat:
|
|
676
|
+
format: n,
|
|
677
|
+
manualFormat: o = !0,
|
|
660
678
|
minLimit: l = 5,
|
|
661
|
-
noPlaceholders:
|
|
662
|
-
transformations:
|
|
679
|
+
noPlaceholders: d = !1,
|
|
680
|
+
transformations: m
|
|
663
681
|
}) {
|
|
664
682
|
(!this.folderId || this.folderId !== s) && (this.folderId = s, this.resetFolderState()), a && this.resetPageCache();
|
|
665
|
-
const c = Math.max(5, l),
|
|
683
|
+
const c = Math.max(5, l), y = e, S = e + c, p = [
|
|
666
684
|
...i,
|
|
667
|
-
|
|
668
|
-
|
|
685
|
+
ft,
|
|
686
|
+
gt
|
|
669
687
|
];
|
|
670
688
|
await this.fetchImages({
|
|
671
689
|
end: S,
|
|
672
|
-
extraFields:
|
|
673
|
-
format:
|
|
674
|
-
manualFormat:
|
|
675
|
-
start:
|
|
676
|
-
transformations:
|
|
690
|
+
extraFields: p.filter((A) => A !== ""),
|
|
691
|
+
format: n,
|
|
692
|
+
manualFormat: o,
|
|
693
|
+
start: y,
|
|
694
|
+
transformations: m
|
|
677
695
|
});
|
|
678
|
-
let
|
|
679
|
-
|
|
680
|
-
const
|
|
696
|
+
let g = e - c;
|
|
697
|
+
g < 0 && (this.totalCount === 0 ? g = 0 : g = Math.max(0, this.totalCount + g));
|
|
698
|
+
const w = g + c;
|
|
681
699
|
return await this.fetchImages({
|
|
682
|
-
end:
|
|
683
|
-
extraFields:
|
|
684
|
-
format:
|
|
685
|
-
manualFormat:
|
|
686
|
-
start:
|
|
687
|
-
transformations:
|
|
688
|
-
}),
|
|
700
|
+
end: w,
|
|
701
|
+
extraFields: p.filter((A) => A !== ""),
|
|
702
|
+
format: n,
|
|
703
|
+
manualFormat: o,
|
|
704
|
+
start: g,
|
|
705
|
+
transformations: m
|
|
706
|
+
}), d ? this.data.filter((A) => A.id && !A.id.startsWith("temp-")) : this.data;
|
|
689
707
|
}
|
|
690
708
|
async fetchImagesByIDs({
|
|
691
709
|
extraFields: e = [],
|
|
692
710
|
format: i,
|
|
693
711
|
manualFormat: s = !0,
|
|
694
712
|
recordIds: a,
|
|
695
|
-
transformations:
|
|
713
|
+
transformations: n
|
|
696
714
|
}) {
|
|
697
715
|
if (a.length === 0)
|
|
698
716
|
return [];
|
|
699
|
-
const
|
|
717
|
+
const o = i ? `path_${i}` : void 0, l = `path_${it}`, d = `path_${At}`, m = [
|
|
700
718
|
...new Set(
|
|
701
|
-
[
|
|
702
|
-
(
|
|
719
|
+
[o, l, d].filter(
|
|
720
|
+
(p) => !!p
|
|
703
721
|
)
|
|
704
722
|
)
|
|
705
|
-
], c = [
|
|
723
|
+
], c = [ht, mt], y = [
|
|
706
724
|
...e,
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
725
|
+
ut,
|
|
726
|
+
ft,
|
|
727
|
+
gt
|
|
710
728
|
];
|
|
711
|
-
return (await
|
|
712
|
-
extraFields: [...
|
|
729
|
+
return (await be({
|
|
730
|
+
extraFields: [...y, ...m, ...c].filter((p) => p !== ""),
|
|
713
731
|
getPermanentAssetsPaths: !0,
|
|
714
732
|
isSiteBuilder: this.isSiteBuilder,
|
|
715
733
|
recordIds: a,
|
|
716
734
|
securityByPassToken: this.securityByPassToken,
|
|
717
735
|
token: this.authToken
|
|
718
|
-
})).items.map((
|
|
719
|
-
const { maxWidth:
|
|
720
|
-
|
|
736
|
+
})).items.map((p) => {
|
|
737
|
+
const { maxWidth: g, src: w } = Nt({
|
|
738
|
+
autoFormat: this.autoFormat,
|
|
739
|
+
extension: p[ht],
|
|
721
740
|
format: i,
|
|
722
|
-
item:
|
|
741
|
+
item: p,
|
|
723
742
|
manualFormat: s,
|
|
724
|
-
size:
|
|
743
|
+
size: p[mt]
|
|
725
744
|
});
|
|
726
|
-
let
|
|
727
|
-
return
|
|
728
|
-
alt:
|
|
729
|
-
docType:
|
|
730
|
-
extension:
|
|
731
|
-
id:
|
|
732
|
-
maxWidth:
|
|
733
|
-
name:
|
|
734
|
-
src:
|
|
735
|
-
...
|
|
736
|
-
(
|
|
745
|
+
let A = w;
|
|
746
|
+
return A && n && n.length > 0 && (A = It(A, n)), {
|
|
747
|
+
alt: p.name,
|
|
748
|
+
docType: p[ut],
|
|
749
|
+
extension: p[ht] || "",
|
|
750
|
+
id: p.recordId,
|
|
751
|
+
maxWidth: g,
|
|
752
|
+
name: p.name,
|
|
753
|
+
src: A,
|
|
754
|
+
...y.reduce(
|
|
755
|
+
(F, b) => (F[b] = p[b] ?? "", F),
|
|
737
756
|
{}
|
|
738
757
|
)
|
|
739
758
|
};
|
|
@@ -744,63 +763,63 @@ class ji {
|
|
|
744
763
|
folderId: i,
|
|
745
764
|
forceRefetch: s = !1,
|
|
746
765
|
format: a,
|
|
747
|
-
manualFormat:
|
|
748
|
-
noPlaceholders:
|
|
766
|
+
manualFormat: n = !0,
|
|
767
|
+
noPlaceholders: o = !1,
|
|
749
768
|
page: l,
|
|
750
|
-
pageSize:
|
|
751
|
-
transformations:
|
|
769
|
+
pageSize: d = 10,
|
|
770
|
+
transformations: m
|
|
752
771
|
}) {
|
|
753
772
|
(!this.folderId || this.folderId !== i) && (this.folderId = i, this.resetFolderState()), s && this.resetPageCache();
|
|
754
|
-
const c = l *
|
|
773
|
+
const c = l * d, y = c + d - 1;
|
|
755
774
|
return await this.fetchImages({
|
|
756
|
-
end:
|
|
775
|
+
end: y,
|
|
757
776
|
extraFields: e,
|
|
758
777
|
format: a,
|
|
759
|
-
manualFormat:
|
|
778
|
+
manualFormat: n,
|
|
760
779
|
start: c,
|
|
761
|
-
transformations:
|
|
762
|
-
}),
|
|
780
|
+
transformations: m
|
|
781
|
+
}), o ? this.data.filter((S) => S.id && !S.id.startsWith("temp-")) : this.data;
|
|
763
782
|
}
|
|
764
783
|
async *fetchImagesInFolderByChunk({
|
|
765
784
|
chunkSize: e = 10,
|
|
766
785
|
end: i = 0,
|
|
767
786
|
extraFields: s = [],
|
|
768
787
|
folderId: a,
|
|
769
|
-
forceRefetch:
|
|
770
|
-
format:
|
|
788
|
+
forceRefetch: n = !1,
|
|
789
|
+
format: o,
|
|
771
790
|
manualFormat: l = !0,
|
|
772
|
-
start:
|
|
773
|
-
transformations:
|
|
791
|
+
start: d = 0,
|
|
792
|
+
transformations: m
|
|
774
793
|
}) {
|
|
775
794
|
const c = Math.max(1, e);
|
|
776
|
-
if ((!this.folderId || this.folderId !== a) && (this.folderId = a, this.resetFolderState()),
|
|
795
|
+
if ((!this.folderId || this.folderId !== a) && (this.folderId = a, this.resetFolderState()), n && this.resetPageCache(), i !== -1) {
|
|
777
796
|
await this.fetchImages({
|
|
778
797
|
end: i,
|
|
779
798
|
extraFields: s,
|
|
780
|
-
format:
|
|
799
|
+
format: o,
|
|
781
800
|
manualFormat: l,
|
|
782
|
-
start:
|
|
783
|
-
transformations:
|
|
801
|
+
start: d,
|
|
802
|
+
transformations: m
|
|
784
803
|
}), yield this.data;
|
|
785
804
|
return;
|
|
786
805
|
}
|
|
787
|
-
let
|
|
806
|
+
let y = d, S = d + c;
|
|
788
807
|
if (await this.fetchImages({
|
|
789
808
|
end: S,
|
|
790
809
|
extraFields: s,
|
|
791
|
-
format:
|
|
810
|
+
format: o,
|
|
792
811
|
manualFormat: l,
|
|
793
|
-
start:
|
|
794
|
-
transformations:
|
|
812
|
+
start: y,
|
|
813
|
+
transformations: m
|
|
795
814
|
}), yield this.data, !(!this.totalCount || this.totalCount <= S))
|
|
796
815
|
for (; S < this.totalCount; )
|
|
797
|
-
|
|
816
|
+
y = S, S = Math.min(S + c, this.totalCount), await this.fetchImages({
|
|
798
817
|
end: S,
|
|
799
818
|
extraFields: s,
|
|
800
|
-
format:
|
|
819
|
+
format: o,
|
|
801
820
|
manualFormat: l,
|
|
802
|
-
start:
|
|
803
|
-
transformations:
|
|
821
|
+
start: y,
|
|
822
|
+
transformations: m
|
|
804
823
|
}), yield this.data;
|
|
805
824
|
}
|
|
806
825
|
hostConnected() {
|
|
@@ -815,15 +834,15 @@ class ji {
|
|
|
815
834
|
this.resetPageCache();
|
|
816
835
|
}
|
|
817
836
|
}
|
|
818
|
-
const
|
|
819
|
-
var
|
|
820
|
-
for (var a = s > 1 ? void 0 : s ?
|
|
821
|
-
(
|
|
822
|
-
return s && a &&
|
|
837
|
+
const _e = V`.asset-link-format__details{--header-padding:var(--cx-spacing-small) var(--cx-spacing-medium)}.asset-link-format__details::part(icon){width:var(--cx-font-size-3x-large);height:var(--cx-font-size-3x-large);background-color:var(--cx-color-neutral-100);border-radius:var(--cx-border-radius-large);color:var(--cx-color-neutral-600);font-size:var(--cx-font-size-large);justify-content:center;align-items:center;display:flex}.asset-link-format__details::part(input-label){color:var(--cx-color-neutral-400);margin-inline-start:var(--cx-spacing-small)}.asset-link-format__header{padding:var(--cx-spacing-medium)}.asset-link-format__section-header{padding:0 var(--cx-spacing-medium);border-top:var(--section-header-border-width,1px) solid var(--cx-color-neutral-200);background-color:var(--cx-color-neutral-50)}.asset-link-format__undo,.asset-link-format__reset{--color:var(--cx-color-primary);--background-color:transparent}`, Me = V`cx-details::part(base){border-bottom-width:0}cx-space{width:100%}cx-space cx-input{flex:1}.crop__unit-select{width:120px}.crop__input-group{flex:1;display:flex}`;
|
|
838
|
+
var Ie = Object.defineProperty, Ee = Object.getOwnPropertyDescriptor, z = (t, e, i, s) => {
|
|
839
|
+
for (var a = s > 1 ? void 0 : s ? Ee(e, i) : e, n = t.length - 1, o; n >= 0; n--)
|
|
840
|
+
(o = t[n]) && (a = (s ? o(e, i, a) : o(a)) || a);
|
|
841
|
+
return s && a && Ie(e, i, a), a;
|
|
823
842
|
};
|
|
824
|
-
let v = class extends
|
|
843
|
+
let v = class extends j {
|
|
825
844
|
constructor() {
|
|
826
|
-
super(...arguments), this.localize = new
|
|
845
|
+
super(...arguments), this.localize = new G(this), this.open = !1, this.width = 0, this.height = 0, this.maxWidth = 0, this.maxHeight = 0, this.ratioWidth = 1, this.ratioHeight = 1, this.percentageWidth = 0, this.percentageHeight = 0, this.unit = r.Pixel, this.disabledApply = !1, this.noRatioModes = !1, this.showPositionPicker = !1, this.lastAppliedSetting = {
|
|
827
846
|
[r.Pixel]: {
|
|
828
847
|
height: 0,
|
|
829
848
|
percentageHeight: 100,
|
|
@@ -934,19 +953,19 @@ let v = class extends q {
|
|
|
934
953
|
else if (!i) {
|
|
935
954
|
const [s, a] = e.split(":").map(Number);
|
|
936
955
|
if (this.unit === r.Pixel) {
|
|
937
|
-
let
|
|
938
|
-
Number.isFinite(this.maxWidth) && Number.isFinite(this.maxHeight) && ({ height:
|
|
956
|
+
let n = s, o = a;
|
|
957
|
+
Number.isFinite(this.maxWidth) && Number.isFinite(this.maxHeight) && ({ height: o, width: n } = ne(
|
|
939
958
|
this.maxWidth,
|
|
940
959
|
this.maxHeight,
|
|
941
960
|
s,
|
|
942
961
|
a
|
|
943
962
|
)), this.emit("cx-asset-link-format-crop-change", {
|
|
944
963
|
detail: {
|
|
945
|
-
height:
|
|
964
|
+
height: o,
|
|
946
965
|
keepAspectRatio: !0,
|
|
947
966
|
silent: !0,
|
|
948
967
|
unit: r.Pixel,
|
|
949
|
-
width:
|
|
968
|
+
width: n
|
|
950
969
|
}
|
|
951
970
|
});
|
|
952
971
|
} else
|
|
@@ -1053,20 +1072,20 @@ let v = class extends q {
|
|
|
1053
1072
|
}
|
|
1054
1073
|
render() {
|
|
1055
1074
|
const t = this.cropModes.filter((i) => !i.auto), e = this.cropModes.filter((i) => i.auto);
|
|
1056
|
-
return C`<cx-details class="details" ?open=${this.open} @cx-show=${this.onShowDetails} @cx-hide=${this.onHideDetails}><cx-space slot="summary" align-items="center"><div part="icon"><cx-icon name="crop"></cx-icon></div><cx-typography variant="body2">${this.localize.term("crop")}</cx-typography></cx-space><cx-space direction="vertical" spacing="small">${
|
|
1075
|
+
return C`<cx-details class="details" ?open=${this.open} @cx-show=${this.onShowDetails} @cx-hide=${this.onHideDetails}><cx-space slot="summary" align-items="center"><div part="icon"><cx-icon name="crop"></cx-icon></div><cx-typography variant="body2">${this.localize.term("crop")}</cx-typography></cx-space><cx-space direction="vertical" spacing="small">${I(
|
|
1057
1076
|
!this.noRatioModes,
|
|
1058
1077
|
() => C`<cx-select data-testid="cx-asset-link-format-crop-mode" value=${this.cropMode} hoist style=${O({
|
|
1059
1078
|
width: "100%"
|
|
1060
|
-
})} @cx-change=${this.onCropModeChange} ?disabled=${this.loading}>${
|
|
1079
|
+
})} @cx-change=${this.onCropModeChange} ?disabled=${this.loading}>${nt(
|
|
1061
1080
|
t,
|
|
1062
1081
|
(i) => i.value,
|
|
1063
1082
|
({ label: i, value: s }) => C`<cx-option value=${s}>${i}</cx-option>`
|
|
1064
1083
|
)}
|
|
1065
|
-
${
|
|
1084
|
+
${I(
|
|
1066
1085
|
e.length > 0,
|
|
1067
1086
|
() => C`<cx-divider></cx-divider><small>${this.localize.term("autoCropping")}</small>`
|
|
1068
1087
|
)}
|
|
1069
|
-
${
|
|
1088
|
+
${nt(
|
|
1070
1089
|
e,
|
|
1071
1090
|
(i) => i.value,
|
|
1072
1091
|
({ label: i, value: s }) => C`<cx-option value=${s}>${i}</cx-option>`
|
|
@@ -1077,20 +1096,20 @@ let v = class extends q {
|
|
|
1077
1096
|
color: this.keepAspectRatio ? "var(--cx-color-primary)" : void 0
|
|
1078
1097
|
})} ?disabled=${this.loading}></cx-icon-button><cx-input data-testid="cx-asset-link-format-crop-height" placeholder=${this.localize.term("height")} mask="num" .maskBlocks=${{ num: { mask: Number, min: 1 } }} value=${this.unit === r.Pixel ? this.height.toString() : this.ratioHeight.toString()} ?disabled=${this.loading} @cx-change=${this.handleInputChange} @cx-input=${this.handleHeightChange} required><cx-typography slot="prefix" variant="body3" part="input-label">
|
|
1079
1098
|
H
|
|
1080
|
-
</cx-typography></cx-input></div>${
|
|
1099
|
+
</cx-typography></cx-input></div>${I(
|
|
1081
1100
|
!this.noRatioModes,
|
|
1082
1101
|
() => C`<cx-select data-testid="cx-asset-link-format-crop-unit" value=${this.unit} hoist class="crop__unit-select" ?disabled=${this.loading} @cx-change=${this.onUnitChange}><cx-option value=${r.Pixel}>${this.localize.term("pixels")}</cx-option><cx-option value=${r.AspectRatio}>${this.localize.term("aspectRatio")}</cx-option></cx-select>`
|
|
1083
|
-
)}</cx-space>${
|
|
1102
|
+
)}</cx-space>${I(
|
|
1084
1103
|
this.focusModes.length > 0,
|
|
1085
1104
|
() => C`<cx-select data-testid="cx-asset-link-format-crop-focus-mode" value=${this.focusMode} hoist style=${O({
|
|
1086
1105
|
width: "100%"
|
|
1087
|
-
})} @cx-change=${this.onFocusModeChange} ?disabled=${this.loading || this.selectedMode?.disabledSize}>${
|
|
1106
|
+
})} @cx-change=${this.onFocusModeChange} ?disabled=${this.loading || this.selectedMode?.disabledSize}>${nt(
|
|
1088
1107
|
this.focusModes,
|
|
1089
1108
|
(i) => i.value,
|
|
1090
1109
|
({ label: i, value: s }) => C`<cx-option value=${s}>${i}</cx-option>`
|
|
1091
1110
|
)}</cx-select>`
|
|
1092
1111
|
)}
|
|
1093
|
-
${
|
|
1112
|
+
${I(
|
|
1094
1113
|
this.showPositionPicker && this.focusMode === "manual",
|
|
1095
1114
|
() => C`<cx-position-picker data-testid="cx-asset-link-format-crop-position" value=${this.position} @cx-change=${this.onPositionChange}></cx-position-picker>`
|
|
1096
1115
|
)}<cx-button data-testid="cx-asset-link-format-crop-apply" variant="primary" ?disabled=${this.disabledApply || this.invalidHeight || this.invalidWidth} ?loading=${this.loading} style=${O({
|
|
@@ -1098,25 +1117,25 @@ let v = class extends q {
|
|
|
1098
1117
|
})} @click=${this.handleApply}>${this.localize.term("apply")}</cx-button></cx-space></cx-details>`;
|
|
1099
1118
|
}
|
|
1100
1119
|
};
|
|
1101
|
-
v.styles = [
|
|
1120
|
+
v.styles = [Q, Me];
|
|
1102
1121
|
v.dependencies = {
|
|
1103
|
-
"cx-button":
|
|
1104
|
-
"cx-details":
|
|
1122
|
+
"cx-button": J,
|
|
1123
|
+
"cx-details": st,
|
|
1105
1124
|
"cx-divider": qt,
|
|
1106
|
-
"cx-icon":
|
|
1107
|
-
"cx-icon-button":
|
|
1108
|
-
"cx-input":
|
|
1109
|
-
"cx-option":
|
|
1110
|
-
"cx-position-picker":
|
|
1111
|
-
"cx-select":
|
|
1112
|
-
"cx-space":
|
|
1113
|
-
"cx-typography":
|
|
1125
|
+
"cx-icon": at,
|
|
1126
|
+
"cx-icon-button": Pt,
|
|
1127
|
+
"cx-input": Ft,
|
|
1128
|
+
"cx-option": vt,
|
|
1129
|
+
"cx-position-picker": re,
|
|
1130
|
+
"cx-select": zt,
|
|
1131
|
+
"cx-space": B,
|
|
1132
|
+
"cx-typography": q
|
|
1114
1133
|
};
|
|
1115
1134
|
z([
|
|
1116
|
-
|
|
1135
|
+
tt(".details")
|
|
1117
1136
|
], v.prototype, "base", 2);
|
|
1118
1137
|
z([
|
|
1119
|
-
|
|
1138
|
+
tt("cx-position-picker")
|
|
1120
1139
|
], v.prototype, "positionPicker", 2);
|
|
1121
1140
|
z([
|
|
1122
1141
|
h({ reflect: !0, type: Boolean })
|
|
@@ -1182,13 +1201,13 @@ z([
|
|
|
1182
1201
|
h({ attribute: "keep-aspect-ratio", reflect: !0, type: Boolean })
|
|
1183
1202
|
], v.prototype, "keepAspectRatio", 2);
|
|
1184
1203
|
z([
|
|
1185
|
-
|
|
1204
|
+
R()
|
|
1186
1205
|
], v.prototype, "invalidWidth", 2);
|
|
1187
1206
|
z([
|
|
1188
|
-
|
|
1207
|
+
R()
|
|
1189
1208
|
], v.prototype, "invalidHeight", 2);
|
|
1190
1209
|
z([
|
|
1191
|
-
|
|
1210
|
+
R()
|
|
1192
1211
|
], v.prototype, "aspectRatio", 2);
|
|
1193
1212
|
z([
|
|
1194
1213
|
P("cropMode", { waitUntilFirstUpdate: !0 }),
|
|
@@ -1200,17 +1219,17 @@ z([
|
|
|
1200
1219
|
P("open", { waitUntilFirstUpdate: !0 })
|
|
1201
1220
|
], v.prototype, "handleOpenChange", 1);
|
|
1202
1221
|
v = z([
|
|
1203
|
-
|
|
1222
|
+
X("cx-asset-link-format-crop")
|
|
1204
1223
|
], v);
|
|
1205
|
-
const
|
|
1206
|
-
var
|
|
1207
|
-
for (var a = s > 1 ? void 0 : s ?
|
|
1208
|
-
(
|
|
1209
|
-
return s && a &&
|
|
1224
|
+
const Te = V`.extension{padding:var(--cx-spacing-small) var(--cx-spacing-medium);border:solid 1px var(--cx-color-neutral-200);background-color:var(--cx-color-neutral-0);& cx-select{flex:1;width:100%}}`;
|
|
1225
|
+
var He = Object.defineProperty, We = Object.getOwnPropertyDescriptor, Mt = (t, e, i, s) => {
|
|
1226
|
+
for (var a = s > 1 ? void 0 : s ? We(e, i) : e, n = t.length - 1, o; n >= 0; n--)
|
|
1227
|
+
(o = t[n]) && (a = (s ? o(e, i, a) : o(a)) || a);
|
|
1228
|
+
return s && a && He(e, i, a), a;
|
|
1210
1229
|
};
|
|
1211
|
-
let
|
|
1230
|
+
let Y = class extends j {
|
|
1212
1231
|
constructor() {
|
|
1213
|
-
super(...arguments), this.localize = new
|
|
1232
|
+
super(...arguments), this.localize = new G(this), this.value = "", this.items = [];
|
|
1214
1233
|
}
|
|
1215
1234
|
handleExtensionChange(t) {
|
|
1216
1235
|
const e = t.target.value;
|
|
@@ -1219,46 +1238,46 @@ let Z = class extends q {
|
|
|
1219
1238
|
});
|
|
1220
1239
|
}
|
|
1221
1240
|
render() {
|
|
1222
|
-
return C`<cx-space direction="vertical" spacing="small" class="extension"><cx-typography variant="body2">${this.localize.term("extension")}</cx-typography><cx-select data-label=${this.localize.term("extension")} data-testid="cx-asset-link-format-extension-select" value=${this.value} hoist @cx-change=${this.handleExtensionChange}>${
|
|
1241
|
+
return C`<cx-space direction="vertical" spacing="small" class="extension"><cx-typography variant="body2">${this.localize.term("extension")}</cx-typography><cx-select data-label=${this.localize.term("extension")} data-testid="cx-asset-link-format-extension-select" value=${this.value} hoist @cx-change=${this.handleExtensionChange}>${nt(
|
|
1223
1242
|
this.items,
|
|
1224
1243
|
(t) => t.value,
|
|
1225
1244
|
(t) => C`<cx-option value=${t.value}>${t.displayName}</cx-option>`
|
|
1226
1245
|
)}</cx-select></cx-space>`;
|
|
1227
1246
|
}
|
|
1228
1247
|
};
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
"cx-option":
|
|
1232
|
-
"cx-select":
|
|
1233
|
-
"cx-space":
|
|
1234
|
-
"cx-typography":
|
|
1248
|
+
Y.styles = [Q, Te];
|
|
1249
|
+
Y.dependencies = {
|
|
1250
|
+
"cx-option": vt,
|
|
1251
|
+
"cx-select": zt,
|
|
1252
|
+
"cx-space": B,
|
|
1253
|
+
"cx-typography": q
|
|
1235
1254
|
};
|
|
1236
|
-
|
|
1255
|
+
Mt([
|
|
1237
1256
|
h({ reflect: !0, type: String })
|
|
1238
|
-
],
|
|
1239
|
-
|
|
1257
|
+
], Y.prototype, "value", 2);
|
|
1258
|
+
Mt([
|
|
1240
1259
|
h({ reflect: !1, type: Array })
|
|
1241
|
-
],
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
],
|
|
1245
|
-
const
|
|
1246
|
-
var
|
|
1247
|
-
for (var a = s > 1 ? void 0 : s ?
|
|
1248
|
-
(
|
|
1249
|
-
return s && a &&
|
|
1260
|
+
], Y.prototype, "items", 2);
|
|
1261
|
+
Y = Mt([
|
|
1262
|
+
X("cx-asset-link-format-extension")
|
|
1263
|
+
], Y);
|
|
1264
|
+
const De = V`cx-details::part(base){border-bottom-width:0}`;
|
|
1265
|
+
var Ne = Object.defineProperty, Oe = Object.getOwnPropertyDescriptor, D = (t, e, i, s) => {
|
|
1266
|
+
for (var a = s > 1 ? void 0 : s ? Oe(e, i) : e, n = t.length - 1, o; n >= 0; n--)
|
|
1267
|
+
(o = t[n]) && (a = (s ? o(e, i, a) : o(a)) || a);
|
|
1268
|
+
return s && a && Ne(e, i, a), a;
|
|
1250
1269
|
};
|
|
1251
|
-
const
|
|
1252
|
-
let
|
|
1270
|
+
const Rt = "auto";
|
|
1271
|
+
let E = class extends j {
|
|
1253
1272
|
constructor() {
|
|
1254
|
-
super(...arguments), this.localize = new
|
|
1273
|
+
super(...arguments), this.localize = new G(this), this.open = !1, this.value = "", this.items = [], this.canAutoFormat = !1, this.autoFormat = !1, this.loading = !1, this.scopedValue = "";
|
|
1255
1274
|
}
|
|
1256
1275
|
/**
|
|
1257
1276
|
* The listbox value that represents the committed choice: the `Auto` entry when that is
|
|
1258
1277
|
* active, otherwise the resolved proxy id.
|
|
1259
1278
|
*/
|
|
1260
1279
|
get committedValue() {
|
|
1261
|
-
return this.autoFormat ?
|
|
1280
|
+
return this.autoFormat ? Rt : this.value;
|
|
1262
1281
|
}
|
|
1263
1282
|
handleValueChange() {
|
|
1264
1283
|
this.scopedValue = this.committedValue;
|
|
@@ -1278,7 +1297,7 @@ let M = class extends q {
|
|
|
1278
1297
|
handleApply() {
|
|
1279
1298
|
if (this.loading)
|
|
1280
1299
|
return;
|
|
1281
|
-
if (this.scopedValue ===
|
|
1300
|
+
if (this.scopedValue === Rt) {
|
|
1282
1301
|
this.emit("cx-asset-link-format-proxy-change", {
|
|
1283
1302
|
detail: { autoFormat: !0 }
|
|
1284
1303
|
});
|
|
@@ -1308,74 +1327,74 @@ let M = class extends q {
|
|
|
1308
1327
|
t.target !== this.base && t.stopPropagation();
|
|
1309
1328
|
}
|
|
1310
1329
|
render() {
|
|
1311
|
-
return C`<cx-details class="details" ?open=${this.open} @cx-show=${this.onShowDetails} @cx-hide=${this.onHideDetails}><cx-space slot="summary" align-items="center"><div part="icon"><cx-icon name="photo_size_select_large"></cx-icon></div><cx-typography variant="body2">${this.localize.term("format")}</cx-typography></cx-space><cx-space direction="vertical" spacing="small" class="format"><cx-select data-label=${this.localize.term("imageFormat")} data-testid="cx-asset-link-format-proxy-select" value=${this.scopedValue} hoist @cx-change=${this.handleProxyChange} ?disabled=${this.loading}>${
|
|
1330
|
+
return C`<cx-details class="details" ?open=${this.open} @cx-show=${this.onShowDetails} @cx-hide=${this.onHideDetails}><cx-space slot="summary" align-items="center"><div part="icon"><cx-icon name="photo_size_select_large"></cx-icon></div><cx-typography variant="body2">${this.localize.term("format")}</cx-typography></cx-space><cx-space direction="vertical" spacing="small" class="format"><cx-select data-label=${this.localize.term("imageFormat")} data-testid="cx-asset-link-format-proxy-select" value=${this.scopedValue} hoist @cx-change=${this.handleProxyChange} ?disabled=${this.loading}>${nt(
|
|
1312
1331
|
this.items,
|
|
1313
1332
|
(t) => t.id,
|
|
1314
1333
|
(t) => C`<cx-option value=${t.id}>${t.proxyLabel}</cx-option>`
|
|
1315
1334
|
)}
|
|
1316
|
-
${
|
|
1335
|
+
${I(
|
|
1317
1336
|
this.canAutoFormat,
|
|
1318
|
-
() => C`<cx-divider></cx-divider><cx-option data-testid="cx-asset-link-format-proxy-auto-option" value=${
|
|
1337
|
+
() => C`<cx-divider></cx-divider><cx-option data-testid="cx-asset-link-format-proxy-auto-option" value=${Rt}>${this.localize.term("auto")}</cx-option>`,
|
|
1319
1338
|
() => Ut
|
|
1320
1339
|
)}</cx-select><cx-button data-testid="cx-asset-link-format-proxy-apply" variant="primary" style=${O({
|
|
1321
1340
|
"margin-left": "auto"
|
|
1322
1341
|
})} ?disabled=${this.scopedValue === this.committedValue} ?loading=${this.loading} @click=${this.handleApply}>${this.localize.term("apply")}</cx-button></cx-space></cx-details>`;
|
|
1323
1342
|
}
|
|
1324
1343
|
};
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
"cx-button":
|
|
1328
|
-
"cx-details":
|
|
1344
|
+
E.styles = [Q, De];
|
|
1345
|
+
E.dependencies = {
|
|
1346
|
+
"cx-button": J,
|
|
1347
|
+
"cx-details": st,
|
|
1329
1348
|
"cx-divider": qt,
|
|
1330
|
-
"cx-icon":
|
|
1331
|
-
"cx-option":
|
|
1332
|
-
"cx-select":
|
|
1333
|
-
"cx-space":
|
|
1334
|
-
"cx-typography":
|
|
1349
|
+
"cx-icon": at,
|
|
1350
|
+
"cx-option": vt,
|
|
1351
|
+
"cx-select": zt,
|
|
1352
|
+
"cx-space": B,
|
|
1353
|
+
"cx-typography": q
|
|
1335
1354
|
};
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
],
|
|
1339
|
-
|
|
1355
|
+
D([
|
|
1356
|
+
tt(".details")
|
|
1357
|
+
], E.prototype, "base", 2);
|
|
1358
|
+
D([
|
|
1340
1359
|
h({ reflect: !0, type: Boolean })
|
|
1341
|
-
],
|
|
1342
|
-
|
|
1360
|
+
], E.prototype, "open", 2);
|
|
1361
|
+
D([
|
|
1343
1362
|
h({ reflect: !0, type: String })
|
|
1344
|
-
],
|
|
1345
|
-
|
|
1363
|
+
], E.prototype, "value", 2);
|
|
1364
|
+
D([
|
|
1346
1365
|
h({ reflect: !1, type: Array })
|
|
1347
|
-
],
|
|
1348
|
-
|
|
1366
|
+
], E.prototype, "items", 2);
|
|
1367
|
+
D([
|
|
1349
1368
|
h({ attribute: "can-auto-format", reflect: !0, type: Boolean })
|
|
1350
|
-
],
|
|
1351
|
-
|
|
1369
|
+
], E.prototype, "canAutoFormat", 2);
|
|
1370
|
+
D([
|
|
1352
1371
|
h({ attribute: "auto-format", reflect: !0, type: Boolean })
|
|
1353
|
-
],
|
|
1354
|
-
|
|
1372
|
+
], E.prototype, "autoFormat", 2);
|
|
1373
|
+
D([
|
|
1355
1374
|
h({ reflect: !0, type: Boolean })
|
|
1356
|
-
],
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
],
|
|
1360
|
-
|
|
1375
|
+
], E.prototype, "loading", 2);
|
|
1376
|
+
D([
|
|
1377
|
+
R()
|
|
1378
|
+
], E.prototype, "scopedValue", 2);
|
|
1379
|
+
D([
|
|
1361
1380
|
P("autoFormat"),
|
|
1362
1381
|
P("value")
|
|
1363
|
-
],
|
|
1364
|
-
|
|
1382
|
+
], E.prototype, "handleValueChange", 1);
|
|
1383
|
+
D([
|
|
1365
1384
|
P("open", { waitUntilFirstUpdate: !0 })
|
|
1366
|
-
],
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
],
|
|
1370
|
-
const
|
|
1371
|
-
var
|
|
1372
|
-
for (var a = s > 1 ? void 0 : s ?
|
|
1373
|
-
(
|
|
1374
|
-
return s && a &&
|
|
1385
|
+
], E.prototype, "handleOpenChange", 1);
|
|
1386
|
+
E = D([
|
|
1387
|
+
X("cx-asset-link-format-proxy")
|
|
1388
|
+
], E);
|
|
1389
|
+
const Le = V`cx-details::part(base){border-bottom-width:0}`;
|
|
1390
|
+
var Ue = Object.defineProperty, Be = Object.getOwnPropertyDescriptor, et = (t, e, i, s) => {
|
|
1391
|
+
for (var a = s > 1 ? void 0 : s ? Be(e, i) : e, n = t.length - 1, o; n >= 0; n--)
|
|
1392
|
+
(o = t[n]) && (a = (s ? o(e, i, a) : o(a)) || a);
|
|
1393
|
+
return s && a && Ue(e, i, a), a;
|
|
1375
1394
|
};
|
|
1376
|
-
let
|
|
1395
|
+
let W = class extends j {
|
|
1377
1396
|
constructor() {
|
|
1378
|
-
super(...arguments), this.localize = new
|
|
1397
|
+
super(...arguments), this.localize = new G(this), this.open = !1, this.value = 100, this.loading = !1, this.scopedValue = 100;
|
|
1379
1398
|
}
|
|
1380
1399
|
/**
|
|
1381
1400
|
* A computed property that checks if the current quality value is invalid.
|
|
@@ -1424,46 +1443,46 @@ let T = class extends q {
|
|
|
1424
1443
|
})} @cx-input=${this.handleQualityChange}></cx-input></cx-tooltip><cx-button data-testid="cx-asset-link-format-quality-apply" variant="primary" ?disabled=${this.invalidValue} ?loading=${this.loading} @click=${this.handleApply}>${this.localize.term("apply")}</cx-button></cx-space></cx-details>`;
|
|
1425
1444
|
}
|
|
1426
1445
|
};
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
"cx-button":
|
|
1430
|
-
"cx-details":
|
|
1431
|
-
"cx-icon":
|
|
1432
|
-
"cx-input":
|
|
1433
|
-
"cx-space":
|
|
1446
|
+
W.styles = [Q, Le];
|
|
1447
|
+
W.dependencies = {
|
|
1448
|
+
"cx-button": J,
|
|
1449
|
+
"cx-details": st,
|
|
1450
|
+
"cx-icon": at,
|
|
1451
|
+
"cx-input": Ft,
|
|
1452
|
+
"cx-space": B,
|
|
1434
1453
|
"cx-tooltip": jt,
|
|
1435
|
-
"cx-typography":
|
|
1454
|
+
"cx-typography": q
|
|
1436
1455
|
};
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
],
|
|
1440
|
-
|
|
1456
|
+
et([
|
|
1457
|
+
tt(".details")
|
|
1458
|
+
], W.prototype, "base", 2);
|
|
1459
|
+
et([
|
|
1441
1460
|
h({ reflect: !0, type: Boolean })
|
|
1442
|
-
],
|
|
1443
|
-
|
|
1461
|
+
], W.prototype, "open", 2);
|
|
1462
|
+
et([
|
|
1444
1463
|
h({ reflect: !0, type: Number })
|
|
1445
|
-
],
|
|
1446
|
-
|
|
1464
|
+
], W.prototype, "value", 2);
|
|
1465
|
+
et([
|
|
1447
1466
|
h({ reflect: !0, type: Boolean })
|
|
1448
|
-
],
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
],
|
|
1452
|
-
|
|
1467
|
+
], W.prototype, "loading", 2);
|
|
1468
|
+
et([
|
|
1469
|
+
R()
|
|
1470
|
+
], W.prototype, "scopedValue", 2);
|
|
1471
|
+
et([
|
|
1453
1472
|
P("value")
|
|
1454
|
-
],
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
],
|
|
1458
|
-
const
|
|
1459
|
-
var
|
|
1460
|
-
for (var a = s > 1 ? void 0 : s ?
|
|
1461
|
-
(
|
|
1462
|
-
return s && a &&
|
|
1473
|
+
], W.prototype, "handleValueChange", 1);
|
|
1474
|
+
W = et([
|
|
1475
|
+
X("cx-asset-link-format-quality")
|
|
1476
|
+
], W);
|
|
1477
|
+
const qe = V`cx-details::part(base){border-bottom-width:0}cx-space{width:100%}cx-space cx-input{flex:1}.resize__unit-select{width:120px}.resize__input-group{flex:1;display:flex}`;
|
|
1478
|
+
var je = Object.defineProperty, Ve = Object.getOwnPropertyDescriptor, $ = (t, e, i, s) => {
|
|
1479
|
+
for (var a = s > 1 ? void 0 : s ? Ve(e, i) : e, n = t.length - 1, o; n >= 0; n--)
|
|
1480
|
+
(o = t[n]) && (a = (s ? o(e, i, a) : o(a)) || a);
|
|
1481
|
+
return s && a && je(e, i, a), a;
|
|
1463
1482
|
};
|
|
1464
|
-
let
|
|
1483
|
+
let k = class extends j {
|
|
1465
1484
|
constructor() {
|
|
1466
|
-
super(...arguments), this.localize = new
|
|
1485
|
+
super(...arguments), this.localize = new G(this), this.open = !1, this.width = 0, this.height = 0, this.maxWidth = 0, this.maxHeight = 0, this.ratioWidth = 1, this.ratioHeight = 1, this.unit = r.Pixel, this.lastAppliedSetting = {
|
|
1467
1486
|
[r.Pixel]: { height: 0, width: 0 },
|
|
1468
1487
|
[r.AspectRatio]: { height: 1, width: 1 }
|
|
1469
1488
|
}, this.loading = !1, this.noRatioModes = !1, this.keepAspectRatio = !1, this.invalidWidth = !1, this.invalidHeight = !1, this.aspectRatio = 0;
|
|
@@ -1608,7 +1627,7 @@ let w = class extends q {
|
|
|
1608
1627
|
color: this.keepAspectRatio ? "var(--cx-color-primary)" : void 0
|
|
1609
1628
|
})} ?disabled=${this.loading}></cx-icon-button><cx-input data-testid="cx-asset-link-format-resize-height" placeholder=${this.localize.term("height")} mask="num" .maskBlocks=${{ num: { mask: Number, min: 1 } }} value=${this.unit === r.Pixel ? this.height.toString() : this.ratioHeight.toString()} @cx-input=${this.handleHeightChange} required ?disabled=${this.loading}><cx-typography slot="prefix" variant="body3" part="input-label">
|
|
1610
1629
|
H
|
|
1611
|
-
</cx-typography></cx-input></div>${
|
|
1630
|
+
</cx-typography></cx-input></div>${I(
|
|
1612
1631
|
!this.noRatioModes,
|
|
1613
1632
|
() => C`<cx-select data-testid="cx-asset-link-format-resize-unit" value=${this.unit} hoist class="resize__unit-select" @cx-change=${this.onUnitChange}><cx-option value=${r.Pixel}>${this.localize.term("pixels")}</cx-option><cx-option value=${r.AspectRatio}>${this.localize.term("aspectRatio")}</cx-option></cx-select>`
|
|
1614
1633
|
)}</cx-space><cx-button data-testid="cx-asset-link-format-resize-apply" variant="primary" ?disabled=${this.disabledApply || this.invalidHeight || this.invalidWidth} ?loading=${this.loading} style=${O({
|
|
@@ -1616,87 +1635,87 @@ let w = class extends q {
|
|
|
1616
1635
|
})} @click=${this.handleApply}>${this.localize.term("apply")}</cx-button></cx-space></cx-details>`;
|
|
1617
1636
|
}
|
|
1618
1637
|
};
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
"cx-button":
|
|
1622
|
-
"cx-details":
|
|
1623
|
-
"cx-icon":
|
|
1624
|
-
"cx-icon-button":
|
|
1625
|
-
"cx-input":
|
|
1626
|
-
"cx-option":
|
|
1627
|
-
"cx-select":
|
|
1628
|
-
"cx-space":
|
|
1629
|
-
"cx-typography":
|
|
1638
|
+
k.styles = [Q, qe];
|
|
1639
|
+
k.dependencies = {
|
|
1640
|
+
"cx-button": J,
|
|
1641
|
+
"cx-details": st,
|
|
1642
|
+
"cx-icon": at,
|
|
1643
|
+
"cx-icon-button": Pt,
|
|
1644
|
+
"cx-input": Ft,
|
|
1645
|
+
"cx-option": vt,
|
|
1646
|
+
"cx-select": zt,
|
|
1647
|
+
"cx-space": B,
|
|
1648
|
+
"cx-typography": q
|
|
1630
1649
|
};
|
|
1631
1650
|
$([
|
|
1632
|
-
|
|
1633
|
-
],
|
|
1651
|
+
tt(".details")
|
|
1652
|
+
], k.prototype, "base", 2);
|
|
1634
1653
|
$([
|
|
1635
1654
|
h({ reflect: !0, type: Boolean })
|
|
1636
|
-
],
|
|
1655
|
+
], k.prototype, "open", 2);
|
|
1637
1656
|
$([
|
|
1638
1657
|
h({ reflect: !0, type: Number })
|
|
1639
|
-
],
|
|
1658
|
+
], k.prototype, "width", 2);
|
|
1640
1659
|
$([
|
|
1641
1660
|
h({ reflect: !0, type: Number })
|
|
1642
|
-
],
|
|
1661
|
+
], k.prototype, "height", 2);
|
|
1643
1662
|
$([
|
|
1644
1663
|
h({ attribute: "max-width", reflect: !0, type: Number })
|
|
1645
|
-
],
|
|
1664
|
+
], k.prototype, "maxWidth", 2);
|
|
1646
1665
|
$([
|
|
1647
1666
|
h({ attribute: "max-height", reflect: !0, type: Number })
|
|
1648
|
-
],
|
|
1667
|
+
], k.prototype, "maxHeight", 2);
|
|
1649
1668
|
$([
|
|
1650
1669
|
h({ attribute: "ratio-width", reflect: !0, type: Number })
|
|
1651
|
-
],
|
|
1670
|
+
], k.prototype, "ratioWidth", 2);
|
|
1652
1671
|
$([
|
|
1653
1672
|
h({ attribute: "ratio-height", reflect: !0, type: Number })
|
|
1654
|
-
],
|
|
1673
|
+
], k.prototype, "ratioHeight", 2);
|
|
1655
1674
|
$([
|
|
1656
1675
|
h({ reflect: !0, type: String })
|
|
1657
|
-
],
|
|
1676
|
+
], k.prototype, "unit", 2);
|
|
1658
1677
|
$([
|
|
1659
1678
|
h({ attribute: "last-applied-setting", reflect: !1, type: Object })
|
|
1660
|
-
],
|
|
1679
|
+
], k.prototype, "lastAppliedSetting", 2);
|
|
1661
1680
|
$([
|
|
1662
1681
|
h({ reflect: !0, type: Boolean })
|
|
1663
|
-
],
|
|
1682
|
+
], k.prototype, "loading", 2);
|
|
1664
1683
|
$([
|
|
1665
1684
|
h({ attribute: "no-ratio-modes", reflect: !0, type: Boolean })
|
|
1666
|
-
],
|
|
1685
|
+
], k.prototype, "noRatioModes", 2);
|
|
1667
1686
|
$([
|
|
1668
1687
|
h({ attribute: "keep-aspect-ratio", reflect: !0, type: Boolean })
|
|
1669
|
-
],
|
|
1688
|
+
], k.prototype, "keepAspectRatio", 2);
|
|
1670
1689
|
$([
|
|
1671
|
-
|
|
1672
|
-
],
|
|
1690
|
+
R()
|
|
1691
|
+
], k.prototype, "invalidWidth", 2);
|
|
1673
1692
|
$([
|
|
1674
|
-
|
|
1675
|
-
],
|
|
1693
|
+
R()
|
|
1694
|
+
], k.prototype, "invalidHeight", 2);
|
|
1676
1695
|
$([
|
|
1677
|
-
|
|
1678
|
-
],
|
|
1696
|
+
R()
|
|
1697
|
+
], k.prototype, "aspectRatio", 2);
|
|
1679
1698
|
$([
|
|
1680
1699
|
P("cropMode", { waitUntilFirstUpdate: !0 }),
|
|
1681
1700
|
P("maxWidth", { waitUntilFirstUpdate: !0 }),
|
|
1682
1701
|
P("maxHeight", { waitUntilFirstUpdate: !0 }),
|
|
1683
1702
|
P("keepAspectRatio")
|
|
1684
|
-
],
|
|
1703
|
+
], k.prototype, "handleCropModeChange", 1);
|
|
1685
1704
|
$([
|
|
1686
1705
|
P("open", { waitUntilFirstUpdate: !0 })
|
|
1687
|
-
],
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
],
|
|
1691
|
-
const
|
|
1692
|
-
var
|
|
1693
|
-
for (var a = s > 1 ? void 0 : s ?
|
|
1694
|
-
(
|
|
1695
|
-
return s && a &&
|
|
1706
|
+
], k.prototype, "handleOpenChange", 1);
|
|
1707
|
+
k = $([
|
|
1708
|
+
X("cx-asset-link-format-resize")
|
|
1709
|
+
], k);
|
|
1710
|
+
const Ge = V`cx-details::part(base){border-bottom-width:0}`;
|
|
1711
|
+
var Qe = Object.defineProperty, Xe = Object.getOwnPropertyDescriptor, K = (t, e, i, s) => {
|
|
1712
|
+
for (var a = s > 1 ? void 0 : s ? Xe(e, i) : e, n = t.length - 1, o; n >= 0; n--)
|
|
1713
|
+
(o = t[n]) && (a = (s ? o(e, i, a) : o(a)) || a);
|
|
1714
|
+
return s && a && Qe(e, i, a), a;
|
|
1696
1715
|
};
|
|
1697
|
-
let H = class extends
|
|
1716
|
+
let H = class extends j {
|
|
1698
1717
|
constructor() {
|
|
1699
|
-
super(...arguments), this.localize = new
|
|
1718
|
+
super(...arguments), this.localize = new G(this), this.open = !1, this.value = 0, this.defaultValue = 0, this.loading = !1, this.lastAppliedValue = 0;
|
|
1700
1719
|
}
|
|
1701
1720
|
handleOpenChange() {
|
|
1702
1721
|
this.open || this.emit("cx-asset-link-format-rotation-change", {
|
|
@@ -1707,14 +1726,14 @@ let H = class extends q {
|
|
|
1707
1726
|
const e = t.target.value, i = Number(e);
|
|
1708
1727
|
if (Number.isNaN(i))
|
|
1709
1728
|
return;
|
|
1710
|
-
const s =
|
|
1729
|
+
const s = Et(i);
|
|
1711
1730
|
(i > 360 || i < -360) && (t.target.value = s.toString()), this.emit("cx-asset-link-format-rotation-change", {
|
|
1712
1731
|
detail: s
|
|
1713
1732
|
});
|
|
1714
1733
|
}
|
|
1715
1734
|
handleButtonClick(t) {
|
|
1716
1735
|
this.emit("cx-asset-link-format-rotation-change", {
|
|
1717
|
-
detail:
|
|
1736
|
+
detail: Et(t)
|
|
1718
1737
|
});
|
|
1719
1738
|
}
|
|
1720
1739
|
handleClockwiseClick() {
|
|
@@ -1740,49 +1759,49 @@ let H = class extends q {
|
|
|
1740
1759
|
})} @cx-input=${this.handleRotationChange}></cx-input><cx-button data-testid="cx-asset-link-format-rotation-apply" variant="primary" ?disabled=${this.value === this.lastAppliedValue} ?loading=${this.loading} @click=${this.handleApply}>${this.localize.term("apply")}</cx-button></cx-space></cx-details>`;
|
|
1741
1760
|
}
|
|
1742
1761
|
};
|
|
1743
|
-
H.styles = [
|
|
1762
|
+
H.styles = [Q, Ge];
|
|
1744
1763
|
H.dependencies = {
|
|
1745
|
-
"cx-button":
|
|
1746
|
-
"cx-button-group":
|
|
1747
|
-
"cx-details":
|
|
1748
|
-
"cx-icon":
|
|
1749
|
-
"cx-icon-button":
|
|
1750
|
-
"cx-space":
|
|
1751
|
-
"cx-typography":
|
|
1764
|
+
"cx-button": J,
|
|
1765
|
+
"cx-button-group": he,
|
|
1766
|
+
"cx-details": st,
|
|
1767
|
+
"cx-icon": at,
|
|
1768
|
+
"cx-icon-button": Pt,
|
|
1769
|
+
"cx-space": B,
|
|
1770
|
+
"cx-typography": q
|
|
1752
1771
|
};
|
|
1753
|
-
|
|
1754
|
-
|
|
1772
|
+
K([
|
|
1773
|
+
tt(".details")
|
|
1755
1774
|
], H.prototype, "base", 2);
|
|
1756
|
-
|
|
1775
|
+
K([
|
|
1757
1776
|
h({ reflect: !0, type: Boolean })
|
|
1758
1777
|
], H.prototype, "open", 2);
|
|
1759
|
-
|
|
1778
|
+
K([
|
|
1760
1779
|
h({ reflect: !0, type: Number })
|
|
1761
1780
|
], H.prototype, "value", 2);
|
|
1762
|
-
|
|
1781
|
+
K([
|
|
1763
1782
|
h({ attribute: "default-value", reflect: !0, type: Number })
|
|
1764
1783
|
], H.prototype, "defaultValue", 2);
|
|
1765
|
-
|
|
1784
|
+
K([
|
|
1766
1785
|
h({ reflect: !0, type: Boolean })
|
|
1767
1786
|
], H.prototype, "loading", 2);
|
|
1768
|
-
|
|
1787
|
+
K([
|
|
1769
1788
|
h({ attribute: "last-applied-value", reflect: !0, type: Number })
|
|
1770
1789
|
], H.prototype, "lastAppliedValue", 2);
|
|
1771
|
-
|
|
1790
|
+
K([
|
|
1772
1791
|
P("open", { waitUntilFirstUpdate: !0 })
|
|
1773
1792
|
], H.prototype, "handleOpenChange", 1);
|
|
1774
|
-
H =
|
|
1775
|
-
|
|
1793
|
+
H = K([
|
|
1794
|
+
X("cx-asset-link-format-rotation")
|
|
1776
1795
|
], H);
|
|
1777
|
-
const
|
|
1778
|
-
var
|
|
1779
|
-
for (var a = s > 1 ? void 0 : s ?
|
|
1780
|
-
(
|
|
1781
|
-
return s && a &&
|
|
1796
|
+
const Ke = V`cx-details::part(base){border-bottom-width:0}`;
|
|
1797
|
+
var Ze = Object.defineProperty, Ye = Object.getOwnPropertyDescriptor, Ct = (t, e, i, s) => {
|
|
1798
|
+
for (var a = s > 1 ? void 0 : s ? Ye(e, i) : e, n = t.length - 1, o; n >= 0; n--)
|
|
1799
|
+
(o = t[n]) && (a = (s ? o(e, i, a) : o(a)) || a);
|
|
1800
|
+
return s && a && Ze(e, i, a), a;
|
|
1782
1801
|
};
|
|
1783
|
-
let
|
|
1802
|
+
let U = class extends j {
|
|
1784
1803
|
constructor() {
|
|
1785
|
-
super(...arguments), this.localize = new
|
|
1804
|
+
super(...arguments), this.localize = new G(this), this.open = !1, this.value = !1;
|
|
1786
1805
|
}
|
|
1787
1806
|
handleApply(t) {
|
|
1788
1807
|
this.emit("cx-asset-link-format-metadata-change", {
|
|
@@ -1809,36 +1828,36 @@ let L = class extends q {
|
|
|
1809
1828
|
return C`<cx-details class="details" ?open=${this.open} @cx-show=${this.onShowDetails} @cx-hide=${this.onHideDetails}><cx-space slot="summary" align-items="center"><div class="details__summary__icon"><div part="icon"><cx-icon name="short_text"></cx-icon></div></div><cx-typography variant="body2">${this.localize.term("metadata")}</cx-typography></cx-space><cx-space spacing="small"><cx-tooltip data-testid="cx-asset-link-format-metadata-tooltip" content=${this.localize.term("metadataHelpText")} hoist><cx-checkbox data-testid="cx-asset-link-format-metadata" class="details__checkbox" ?checked=${this.value} @cx-change=${this.handleApply}>${this.localize.term("preserveMetadata")}</cx-checkbox></cx-tooltip></cx-space></cx-details>`;
|
|
1810
1829
|
}
|
|
1811
1830
|
};
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
"cx-button":
|
|
1815
|
-
"cx-checkbox":
|
|
1816
|
-
"cx-details":
|
|
1817
|
-
"cx-icon":
|
|
1818
|
-
"cx-space":
|
|
1831
|
+
U.styles = [Q, Ke];
|
|
1832
|
+
U.dependencies = {
|
|
1833
|
+
"cx-button": J,
|
|
1834
|
+
"cx-checkbox": le,
|
|
1835
|
+
"cx-details": st,
|
|
1836
|
+
"cx-icon": at,
|
|
1837
|
+
"cx-space": B,
|
|
1819
1838
|
"cx-tooltip": jt,
|
|
1820
|
-
"cx-typography":
|
|
1839
|
+
"cx-typography": q
|
|
1821
1840
|
};
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
],
|
|
1825
|
-
|
|
1841
|
+
Ct([
|
|
1842
|
+
tt(".details")
|
|
1843
|
+
], U.prototype, "base", 2);
|
|
1844
|
+
Ct([
|
|
1826
1845
|
h({ reflect: !0, type: Boolean })
|
|
1827
|
-
],
|
|
1828
|
-
|
|
1846
|
+
], U.prototype, "open", 2);
|
|
1847
|
+
Ct([
|
|
1829
1848
|
h({ reflect: !0, type: Boolean })
|
|
1830
|
-
],
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
],
|
|
1834
|
-
var
|
|
1835
|
-
for (var a = s > 1 ? void 0 : s ?
|
|
1836
|
-
(
|
|
1837
|
-
return s && a &&
|
|
1849
|
+
], U.prototype, "value", 2);
|
|
1850
|
+
U = Ct([
|
|
1851
|
+
X("cx-asset-link-format-metadata")
|
|
1852
|
+
], U);
|
|
1853
|
+
var Je = Object.defineProperty, ti = Object.getOwnPropertyDescriptor, x = (t, e, i, s) => {
|
|
1854
|
+
for (var a = s > 1 ? void 0 : s ? ti(e, i) : e, n = t.length - 1, o; n >= 0; n--)
|
|
1855
|
+
(o = t[n]) && (a = (s ? o(e, i, a) : o(a)) || a);
|
|
1856
|
+
return s && a && Je(e, i, a), a;
|
|
1838
1857
|
};
|
|
1839
|
-
let
|
|
1858
|
+
let u = class extends j {
|
|
1840
1859
|
constructor() {
|
|
1841
|
-
super(), this.localize = new
|
|
1860
|
+
super(), this.localize = new G(this), this.baseUrl = void 0, this.token = void 0, this.asset = void 0, this.cropModes = [
|
|
1842
1861
|
{
|
|
1843
1862
|
label: "Free",
|
|
1844
1863
|
value: "free"
|
|
@@ -1934,7 +1953,7 @@ let m = class extends q {
|
|
|
1934
1953
|
}, this.rotation = 0, this.defaultSize = {
|
|
1935
1954
|
height: 0,
|
|
1936
1955
|
width: 0
|
|
1937
|
-
}, this.cropperElement = null, this.parameters = [], this.loading = !1, this.lastAction = void 0, this.frozenIndex = void 0, this.preResetTransformations = void 0, this.preResetAutoFormat = void 0, this.preResetSelectedProxy = void 0, this.apiGetTransformAssetLink =
|
|
1956
|
+
}, this.cropperElement = null, this.parameters = [], this.loading = !1, this.lastAction = void 0, this.frozenIndex = void 0, this.preResetTransformations = void 0, this.preResetAutoFormat = void 0, this.preResetSelectedProxy = void 0, this.apiGetTransformAssetLink = ze, this.apiGetCropFocusMode = Re, this.onCropComplete = this.onCropComplete.bind(this), this.onCropDragStart = this.onCropDragStart.bind(this);
|
|
1938
1957
|
}
|
|
1939
1958
|
/**
|
|
1940
1959
|
* Transform requests must resolve to a web-displayable image (the browser renders the
|
|
@@ -2058,14 +2077,14 @@ let m = class extends q {
|
|
|
2058
2077
|
}
|
|
2059
2078
|
};
|
|
2060
2079
|
if (e?.value.width && e?.value.height) {
|
|
2061
|
-
const { height: i, width: s, x: a = 0, y:
|
|
2080
|
+
const { height: i, width: s, x: a = 0, y: n = 0 } = e.value, o = pt(s, i);
|
|
2062
2081
|
return {
|
|
2063
2082
|
[r.AspectRatio]: {
|
|
2064
|
-
height:
|
|
2083
|
+
height: o.height,
|
|
2065
2084
|
percentageHeight: 100,
|
|
2066
2085
|
percentageWidth: 100,
|
|
2067
2086
|
unit: r.AspectRatio,
|
|
2068
|
-
width:
|
|
2087
|
+
width: o.width,
|
|
2069
2088
|
x: 0,
|
|
2070
2089
|
y: 0
|
|
2071
2090
|
},
|
|
@@ -2076,12 +2095,12 @@ let m = class extends q {
|
|
|
2076
2095
|
unit: r.Pixel,
|
|
2077
2096
|
width: s,
|
|
2078
2097
|
x: a,
|
|
2079
|
-
y:
|
|
2098
|
+
y: n
|
|
2080
2099
|
}
|
|
2081
2100
|
};
|
|
2082
2101
|
}
|
|
2083
2102
|
}
|
|
2084
|
-
const t = this.lastImageSize.width && this.lastImageSize.height ?
|
|
2103
|
+
const t = this.lastImageSize.width && this.lastImageSize.height ? pt(this.lastImageSize.width, this.lastImageSize.height) : { height: 1, width: 1 };
|
|
2085
2104
|
return {
|
|
2086
2105
|
[r.AspectRatio]: {
|
|
2087
2106
|
height: t.height,
|
|
@@ -2128,7 +2147,7 @@ let m = class extends q {
|
|
|
2128
2147
|
}
|
|
2129
2148
|
};
|
|
2130
2149
|
if (e?.value.width && e?.value.height) {
|
|
2131
|
-
const { height: i, width: s } = e.value, a =
|
|
2150
|
+
const { height: i, width: s } = e.value, a = pt(s, i);
|
|
2132
2151
|
return {
|
|
2133
2152
|
[r.AspectRatio]: {
|
|
2134
2153
|
height: a.height,
|
|
@@ -2143,7 +2162,7 @@ let m = class extends q {
|
|
|
2143
2162
|
};
|
|
2144
2163
|
}
|
|
2145
2164
|
}
|
|
2146
|
-
const t = this.lastImageSize.width && this.lastImageSize.height ?
|
|
2165
|
+
const t = this.lastImageSize.width && this.lastImageSize.height ? pt(this.lastImageSize.width, this.lastImageSize.height) : { height: 1, width: 1 };
|
|
2147
2166
|
return {
|
|
2148
2167
|
[r.AspectRatio]: {
|
|
2149
2168
|
height: t.height,
|
|
@@ -2174,7 +2193,7 @@ let m = class extends q {
|
|
|
2174
2193
|
* Returns the transformation string for the asset link.
|
|
2175
2194
|
*/
|
|
2176
2195
|
get transformationString() {
|
|
2177
|
-
return
|
|
2196
|
+
return ct({
|
|
2178
2197
|
asset: this.asset,
|
|
2179
2198
|
baseUrl: "",
|
|
2180
2199
|
parameters: this.parameters,
|
|
@@ -2213,7 +2232,7 @@ let m = class extends q {
|
|
|
2213
2232
|
);
|
|
2214
2233
|
this.loading = !0, this.apiGetTransformAssetLink({
|
|
2215
2234
|
assetId: this.asset.id,
|
|
2216
|
-
extension:
|
|
2235
|
+
extension: u.getTransformExtension(this.asset.extension),
|
|
2217
2236
|
format: e?.proxyName ?? "",
|
|
2218
2237
|
siteUrl: this.baseUrl,
|
|
2219
2238
|
token: this.token,
|
|
@@ -2233,7 +2252,7 @@ let m = class extends q {
|
|
|
2233
2252
|
*/
|
|
2234
2253
|
});
|
|
2235
2254
|
});
|
|
2236
|
-
const i =
|
|
2255
|
+
const i = ct({
|
|
2237
2256
|
asset: this.asset,
|
|
2238
2257
|
baseUrl: "",
|
|
2239
2258
|
extension: this.selectedFormat.extension,
|
|
@@ -2266,7 +2285,7 @@ let m = class extends q {
|
|
|
2266
2285
|
async handleTransformationsChange() {
|
|
2267
2286
|
if (await this.updateComplete, !this.asset) {
|
|
2268
2287
|
this.emit("cx-asset-link-format-change", {
|
|
2269
|
-
detail:
|
|
2288
|
+
detail: ct({
|
|
2270
2289
|
asset: this.asset,
|
|
2271
2290
|
baseUrl: "",
|
|
2272
2291
|
options: {
|
|
@@ -2277,36 +2296,36 @@ let m = class extends q {
|
|
|
2277
2296
|
useSession: this.useSession
|
|
2278
2297
|
}).replace(/\/t\//g, "")
|
|
2279
2298
|
});
|
|
2280
|
-
const
|
|
2299
|
+
const n = this.transformations.findLast(
|
|
2281
2300
|
(c) => c.key === f.Crop && (c.value.unit === r.AspectRatio && c.value.ratioWidth && c.value.ratioHeight || c.value.width && c.value.height)
|
|
2282
2301
|
);
|
|
2283
|
-
if (
|
|
2284
|
-
const { focusMode: c, position:
|
|
2302
|
+
if (n?.value.unit === r.AspectRatio && n.value.ratioWidth && n.value.ratioHeight) {
|
|
2303
|
+
const { focusMode: c, position: y, ratioHeight: S, ratioWidth: p } = n.value;
|
|
2285
2304
|
this.cropSize = {
|
|
2286
2305
|
...this.cropSize,
|
|
2287
2306
|
cropMode: "free",
|
|
2288
2307
|
focusMode: c ?? "manual",
|
|
2289
2308
|
percentageHeight: 100,
|
|
2290
2309
|
percentageWidth: 100,
|
|
2291
|
-
position:
|
|
2310
|
+
position: y ?? N.CenterCenter,
|
|
2292
2311
|
ratioHeight: S,
|
|
2293
|
-
ratioWidth:
|
|
2312
|
+
ratioWidth: p,
|
|
2294
2313
|
unit: r.AspectRatio
|
|
2295
2314
|
};
|
|
2296
|
-
} else if (
|
|
2297
|
-
const { focusMode: c, height:
|
|
2315
|
+
} else if (n) {
|
|
2316
|
+
const { focusMode: c, height: y, position: S, unit: p, width: g, x: w = 0, y: A = 0 } = n.value;
|
|
2298
2317
|
this.cropSize = {
|
|
2299
2318
|
...this.cropSize,
|
|
2300
2319
|
cropMode: "free",
|
|
2301
2320
|
focusMode: c ?? "manual",
|
|
2302
|
-
height:
|
|
2321
|
+
height: y,
|
|
2303
2322
|
percentageHeight: 100,
|
|
2304
2323
|
percentageWidth: 100,
|
|
2305
2324
|
position: S ?? N.CenterCenter,
|
|
2306
|
-
unit:
|
|
2307
|
-
width:
|
|
2308
|
-
x:
|
|
2309
|
-
y:
|
|
2325
|
+
unit: p ?? r.Pixel,
|
|
2326
|
+
width: g,
|
|
2327
|
+
x: w,
|
|
2328
|
+
y: A
|
|
2310
2329
|
};
|
|
2311
2330
|
} else
|
|
2312
2331
|
this.cropSize = {
|
|
@@ -2328,23 +2347,23 @@ let m = class extends q {
|
|
|
2328
2347
|
x: 0,
|
|
2329
2348
|
y: 0
|
|
2330
2349
|
};
|
|
2331
|
-
const
|
|
2350
|
+
const o = this.transformations.findLast(
|
|
2332
2351
|
(c) => c.key === f.Resize && (c.value.unit === r.AspectRatio && c.value.ratioWidth && c.value.ratioHeight || c.value.width || c.value.height)
|
|
2333
2352
|
);
|
|
2334
|
-
if (
|
|
2335
|
-
const { ratioHeight: c, ratioWidth:
|
|
2353
|
+
if (o?.value.unit === r.AspectRatio && o.value.ratioWidth && o.value.ratioHeight) {
|
|
2354
|
+
const { ratioHeight: c, ratioWidth: y } = o.value;
|
|
2336
2355
|
this.resizeSize = {
|
|
2337
2356
|
...this.resizeSize,
|
|
2338
2357
|
ratioHeight: c,
|
|
2339
|
-
ratioWidth:
|
|
2358
|
+
ratioWidth: y,
|
|
2340
2359
|
unit: r.AspectRatio
|
|
2341
2360
|
};
|
|
2342
|
-
} else if (
|
|
2343
|
-
const { height: c = 0, unit:
|
|
2361
|
+
} else if (o) {
|
|
2362
|
+
const { height: c = 0, unit: y, width: S = 0 } = o.value;
|
|
2344
2363
|
this.resizeSize = {
|
|
2345
2364
|
...this.resizeSize,
|
|
2346
2365
|
height: c,
|
|
2347
|
-
unit:
|
|
2366
|
+
unit: y ?? r.Pixel,
|
|
2348
2367
|
width: S
|
|
2349
2368
|
};
|
|
2350
2369
|
} else
|
|
@@ -2363,14 +2382,14 @@ let m = class extends q {
|
|
|
2363
2382
|
(c) => c.key === f.Rotate
|
|
2364
2383
|
);
|
|
2365
2384
|
this.rotation = l?.value.rotation ?? 0;
|
|
2366
|
-
const
|
|
2385
|
+
const d = this.transformations.findLast((c) => c.key === f.Quality)?.value.quality ?? 100, m = this.transformations.some(
|
|
2367
2386
|
(c) => c.key === f.Metadata
|
|
2368
2387
|
);
|
|
2369
|
-
this.selectedFormat ? this.selectedFormat = { ...this.selectedFormat, keepMetadata:
|
|
2388
|
+
this.selectedFormat ? this.selectedFormat = { ...this.selectedFormat, keepMetadata: m, quality: d } : this.selectedFormat = {
|
|
2370
2389
|
extension: "",
|
|
2371
2390
|
height: 0,
|
|
2372
|
-
keepMetadata:
|
|
2373
|
-
quality:
|
|
2391
|
+
keepMetadata: m,
|
|
2392
|
+
quality: d,
|
|
2374
2393
|
rotation: 0,
|
|
2375
2394
|
url: "",
|
|
2376
2395
|
width: 0,
|
|
@@ -2382,12 +2401,12 @@ let m = class extends q {
|
|
|
2382
2401
|
if (!this.selectedFormat)
|
|
2383
2402
|
return;
|
|
2384
2403
|
const t = this.proxies?.find(
|
|
2385
|
-
(
|
|
2404
|
+
(n) => n.id === this.selectedProxy
|
|
2386
2405
|
);
|
|
2387
2406
|
this.loading = !0;
|
|
2388
2407
|
const e = await this.apiGetTransformAssetLink({
|
|
2389
2408
|
assetId: this.asset.id,
|
|
2390
|
-
extension:
|
|
2409
|
+
extension: u.getTransformExtension(this.selectedFormat.extension),
|
|
2391
2410
|
format: t?.proxyName ?? "",
|
|
2392
2411
|
siteUrl: this.baseUrl,
|
|
2393
2412
|
token: this.token,
|
|
@@ -2421,9 +2440,9 @@ let m = class extends q {
|
|
|
2421
2440
|
y: 0
|
|
2422
2441
|
}, this.lastAction === f.Rotate && (this.rotation = 0), this.lastAction = void 0;
|
|
2423
2442
|
const i = this.transformations.some(
|
|
2424
|
-
(
|
|
2443
|
+
(n) => n.key === f.Metadata
|
|
2425
2444
|
), s = this.transformations.findLast(
|
|
2426
|
-
(
|
|
2445
|
+
(n) => n.key === f.Quality
|
|
2427
2446
|
);
|
|
2428
2447
|
this.selectedFormat = {
|
|
2429
2448
|
...this.selectedFormat,
|
|
@@ -2437,7 +2456,7 @@ let m = class extends q {
|
|
|
2437
2456
|
* url: `${this.baseUrl}/${response.relativePath}`,
|
|
2438
2457
|
*/
|
|
2439
2458
|
};
|
|
2440
|
-
const a =
|
|
2459
|
+
const a = ct({
|
|
2441
2460
|
asset: this.asset,
|
|
2442
2461
|
baseUrl: "",
|
|
2443
2462
|
extension: this.selectedFormat.extension,
|
|
@@ -2525,25 +2544,25 @@ let m = class extends q {
|
|
|
2525
2544
|
const i = this.proxies?.find((s) => s.id === t);
|
|
2526
2545
|
i && (this.asset && i.proxyName === "TRX" && (i.formatHeight = Number(this.asset.height), i.formatWidth = Number(this.asset.width)), this.transformations = this.transformations.map((s) => {
|
|
2527
2546
|
if (s.key === f.Crop) {
|
|
2528
|
-
const a = s.value,
|
|
2547
|
+
const a = s.value, n = a.width / i.formatWidth * e.formatWidth, o = a.height / i.formatHeight * e.formatHeight, l = a.x / i.formatWidth * e.formatWidth, d = a.y / i.formatHeight * e.formatHeight;
|
|
2529
2548
|
return {
|
|
2530
2549
|
...s,
|
|
2531
2550
|
value: {
|
|
2532
2551
|
...s.value,
|
|
2533
|
-
height:
|
|
2534
|
-
width:
|
|
2552
|
+
height: o,
|
|
2553
|
+
width: n,
|
|
2535
2554
|
x: l,
|
|
2536
|
-
y:
|
|
2555
|
+
y: d
|
|
2537
2556
|
}
|
|
2538
2557
|
};
|
|
2539
2558
|
}
|
|
2540
2559
|
if (s.key === f.Resize) {
|
|
2541
|
-
const a = s.value,
|
|
2560
|
+
const a = s.value, n = a.width / i.formatWidth * e.formatWidth, o = a.height / i.formatHeight * e.formatHeight;
|
|
2542
2561
|
return {
|
|
2543
2562
|
...s,
|
|
2544
2563
|
value: {
|
|
2545
|
-
height:
|
|
2546
|
-
width:
|
|
2564
|
+
height: o,
|
|
2565
|
+
width: n
|
|
2547
2566
|
}
|
|
2548
2567
|
};
|
|
2549
2568
|
}
|
|
@@ -2609,33 +2628,33 @@ let m = class extends q {
|
|
|
2609
2628
|
height: i,
|
|
2610
2629
|
keepAspectRatio: s,
|
|
2611
2630
|
percentageHeight: a,
|
|
2612
|
-
percentageWidth:
|
|
2613
|
-
ratioHeight:
|
|
2631
|
+
percentageWidth: n,
|
|
2632
|
+
ratioHeight: o,
|
|
2614
2633
|
ratioWidth: l,
|
|
2615
|
-
unit:
|
|
2616
|
-
useCropMode:
|
|
2634
|
+
unit: d,
|
|
2635
|
+
useCropMode: m,
|
|
2617
2636
|
width: c
|
|
2618
2637
|
}) {
|
|
2619
2638
|
if (!this.selectedFormat?.url || e === "manual")
|
|
2620
2639
|
return;
|
|
2621
2640
|
this.loading = !0, this.lastAction = f.Crop;
|
|
2622
|
-
const
|
|
2641
|
+
const y = await this.apiGetCropFocusMode({
|
|
2623
2642
|
autoCropMode: e,
|
|
2624
2643
|
cropHeight: i,
|
|
2625
2644
|
cropWidth: c,
|
|
2626
2645
|
imageUrl: this.selectedFormat.url
|
|
2627
2646
|
});
|
|
2628
|
-
if (
|
|
2629
|
-
let S = a,
|
|
2630
|
-
i || (S =
|
|
2647
|
+
if (y) {
|
|
2648
|
+
let S = a, p = n;
|
|
2649
|
+
i || (S = y.height * 100 / this.selectedFormat.height), c || (p = y.width * 100 / this.selectedFormat.width), this.cropSize = {
|
|
2631
2650
|
...this.cropSize,
|
|
2632
|
-
height:
|
|
2651
|
+
height: y.height,
|
|
2633
2652
|
percentageHeight: S ?? this.cropSize.percentageHeight,
|
|
2634
|
-
percentageWidth:
|
|
2635
|
-
width:
|
|
2636
|
-
x:
|
|
2637
|
-
y:
|
|
2638
|
-
...
|
|
2653
|
+
percentageWidth: p ?? this.cropSize.percentageWidth,
|
|
2654
|
+
width: y.width,
|
|
2655
|
+
x: y.x * 100 / this.selectedFormat.width,
|
|
2656
|
+
y: y.y * 100 / this.selectedFormat.height,
|
|
2657
|
+
...m ? {
|
|
2639
2658
|
cropMode: e,
|
|
2640
2659
|
focusMode: "manual",
|
|
2641
2660
|
keepAspectRatio: !1
|
|
@@ -2644,9 +2663,9 @@ let m = class extends q {
|
|
|
2644
2663
|
focusMode: e
|
|
2645
2664
|
},
|
|
2646
2665
|
keepAspectRatio: s ?? this.cropSize.keepAspectRatio,
|
|
2647
|
-
ratioHeight:
|
|
2666
|
+
ratioHeight: o ?? this.cropSize.ratioHeight,
|
|
2648
2667
|
ratioWidth: l ?? this.cropSize.ratioWidth,
|
|
2649
|
-
unit:
|
|
2668
|
+
unit: d ?? this.cropSize.unit
|
|
2650
2669
|
};
|
|
2651
2670
|
}
|
|
2652
2671
|
this.loading = !1, this.lastAction = void 0;
|
|
@@ -2656,13 +2675,13 @@ let m = class extends q {
|
|
|
2656
2675
|
height: i,
|
|
2657
2676
|
width: s,
|
|
2658
2677
|
x: a,
|
|
2659
|
-
y:
|
|
2678
|
+
y: n
|
|
2660
2679
|
} = e;
|
|
2661
2680
|
if (s === 0 || i === 0)
|
|
2662
2681
|
return;
|
|
2663
|
-
const
|
|
2664
|
-
let
|
|
2665
|
-
|
|
2682
|
+
const o = this.cropSize.percentageWidth !== s, l = this.cropSize.percentageHeight !== i;
|
|
2683
|
+
let d = this.cropSize.height, m = this.cropSize.width;
|
|
2684
|
+
o && (m = Math.round(s * this.selectedFormat.width / 100)), l && (d = Math.round(
|
|
2666
2685
|
i * this.selectedFormat.height / 100
|
|
2667
2686
|
));
|
|
2668
2687
|
const c = this.cropSize.focusMode;
|
|
@@ -2670,18 +2689,18 @@ let m = class extends q {
|
|
|
2670
2689
|
(S) => S.value === c
|
|
2671
2690
|
)?.auto && this.selectedFormat?.url && this.cropperElement ? await this.handleRequestAutoCropSuggestion({
|
|
2672
2691
|
focusMode: c,
|
|
2673
|
-
height:
|
|
2692
|
+
height: d,
|
|
2674
2693
|
percentageHeight: i,
|
|
2675
2694
|
percentageWidth: s,
|
|
2676
|
-
width:
|
|
2695
|
+
width: m
|
|
2677
2696
|
}) : this.cropSize = {
|
|
2678
2697
|
...this.cropSize,
|
|
2679
|
-
height:
|
|
2698
|
+
height: d,
|
|
2680
2699
|
percentageHeight: i,
|
|
2681
2700
|
percentageWidth: s,
|
|
2682
|
-
width:
|
|
2701
|
+
width: m,
|
|
2683
2702
|
x: a,
|
|
2684
|
-
y:
|
|
2703
|
+
y: n
|
|
2685
2704
|
};
|
|
2686
2705
|
}
|
|
2687
2706
|
onCropDragStart() {
|
|
@@ -2710,7 +2729,7 @@ let m = class extends q {
|
|
|
2710
2729
|
* a proxy *id*, so the name has to be looked up in `proxies` rather than used directly.
|
|
2711
2730
|
*/
|
|
2712
2731
|
get autoResolvedProxyId() {
|
|
2713
|
-
const t = Bt(this.asset?.extension);
|
|
2732
|
+
const t = Bt(this.asset?.extension, this.asset?.size);
|
|
2714
2733
|
return this.proxies?.find((e) => e.proxyName === t)?.id ?? "";
|
|
2715
2734
|
}
|
|
2716
2735
|
onProxyChange(t) {
|
|
@@ -2732,21 +2751,21 @@ let m = class extends q {
|
|
|
2732
2751
|
});
|
|
2733
2752
|
else {
|
|
2734
2753
|
const s = this.focusModes.find(
|
|
2735
|
-
(
|
|
2754
|
+
(d) => d.value === this.cropSize.focusMode
|
|
2736
2755
|
)?.auto;
|
|
2737
|
-
let a = this.cropSize.keepAspectRatio,
|
|
2738
|
-
e === "free" ? (a = !1,
|
|
2756
|
+
let a = this.cropSize.keepAspectRatio, n = this.cropSize.focusMode, o = this.cropSize.x, l = this.cropSize.y;
|
|
2757
|
+
e === "free" ? (a = !1, n = "manual") : this.cropSize.unit === r.Pixel && !s && (o = 0, l = 0), s ? await this.handleRequestAutoCropSuggestion({
|
|
2739
2758
|
cropMode: e,
|
|
2740
|
-
focusMode:
|
|
2759
|
+
focusMode: n,
|
|
2741
2760
|
height: this.cropSize.height,
|
|
2742
2761
|
keepAspectRatio: a,
|
|
2743
2762
|
width: this.cropSize.width
|
|
2744
2763
|
}) : this.cropSize = {
|
|
2745
2764
|
...this.cropSize,
|
|
2746
2765
|
cropMode: e,
|
|
2747
|
-
focusMode:
|
|
2766
|
+
focusMode: n,
|
|
2748
2767
|
keepAspectRatio: a,
|
|
2749
|
-
x:
|
|
2768
|
+
x: o,
|
|
2750
2769
|
y: l
|
|
2751
2770
|
};
|
|
2752
2771
|
}
|
|
@@ -2777,37 +2796,37 @@ let m = class extends q {
|
|
|
2777
2796
|
) : 0, a = this.asset ? Math.min(
|
|
2778
2797
|
Math.max(Math.round(s / i), 0),
|
|
2779
2798
|
this.resizeSize.height
|
|
2780
|
-
) : 0,
|
|
2781
|
-
let l = this.cropSize.x,
|
|
2782
|
-
l +
|
|
2783
|
-
let
|
|
2799
|
+
) : 0, n = this.asset ? a * 100 / this.selectedFormat.height : 100, o = this.asset ? s * 100 / this.selectedFormat.width : 100;
|
|
2800
|
+
let l = this.cropSize.x, d = this.cropSize.y;
|
|
2801
|
+
l + o > 100 && (l = 100 - o), d + n > 100 && (d = 100 - n);
|
|
2802
|
+
let m = this.cropSize.cropMode;
|
|
2784
2803
|
this.cropModes.find(
|
|
2785
|
-
(
|
|
2786
|
-
)?.auto && (
|
|
2804
|
+
(y) => y.value === m
|
|
2805
|
+
)?.auto && (m = "free"), t.detail.silent ? (this.cropSize.height = a, this.cropSize.keepAspectRatio = t.detail.keepAspectRatio, this.cropSize.percentageHeight = n, this.cropSize.percentageWidth = o, this.cropSize.ratioHeight = t.detail.height, this.cropSize.ratioWidth = t.detail.width, this.cropSize.unit = r.AspectRatio, this.cropSize.width = s) : this.cropSize = {
|
|
2787
2806
|
...this.cropSize,
|
|
2788
|
-
cropMode:
|
|
2807
|
+
cropMode: m,
|
|
2789
2808
|
height: a,
|
|
2790
2809
|
keepAspectRatio: t.detail.keepAspectRatio,
|
|
2791
|
-
percentageHeight:
|
|
2792
|
-
percentageWidth:
|
|
2810
|
+
percentageHeight: n,
|
|
2811
|
+
percentageWidth: o,
|
|
2793
2812
|
ratioHeight: t.detail.height,
|
|
2794
2813
|
ratioWidth: t.detail.width,
|
|
2795
2814
|
unit: r.AspectRatio,
|
|
2796
2815
|
width: s,
|
|
2797
2816
|
x: l,
|
|
2798
|
-
y:
|
|
2817
|
+
y: d
|
|
2799
2818
|
};
|
|
2800
2819
|
} else {
|
|
2801
2820
|
const i = this.asset ? t.detail.height * 100 / this.selectedFormat.height : 100, s = this.asset ? t.detail.width * 100 / this.selectedFormat.width : 100;
|
|
2802
|
-
let a = this.cropSize.x,
|
|
2803
|
-
a + s > 100 && (a = 100 - s),
|
|
2804
|
-
let
|
|
2821
|
+
let a = this.cropSize.x, n = this.cropSize.y;
|
|
2822
|
+
a + s > 100 && (a = 100 - s), n + i > 100 && (n = 100 - i);
|
|
2823
|
+
let o = this.cropSize.cropMode;
|
|
2805
2824
|
const l = this.cropModes.find(
|
|
2806
|
-
(
|
|
2825
|
+
(d) => d.value === o
|
|
2807
2826
|
)?.auto;
|
|
2808
|
-
(t.detail.breakAspectRatio || l) && (
|
|
2827
|
+
(t.detail.breakAspectRatio || l) && (o = "free"), t.detail.silent ? (this.cropSize.cropMode = o, this.cropSize.height = t.detail.height, this.cropSize.keepAspectRatio = t.detail.keepAspectRatio, this.cropSize.percentageHeight = i, this.cropSize.percentageWidth = s, this.cropSize.unit = r.Pixel, this.cropSize.width = t.detail.width, this.cropSize.x = a, this.cropSize.y = n) : this.cropSize = {
|
|
2809
2828
|
...this.cropSize,
|
|
2810
|
-
cropMode:
|
|
2829
|
+
cropMode: o,
|
|
2811
2830
|
height: t.detail.height,
|
|
2812
2831
|
keepAspectRatio: t.detail.keepAspectRatio,
|
|
2813
2832
|
percentageHeight: i,
|
|
@@ -2815,7 +2834,7 @@ let m = class extends q {
|
|
|
2815
2834
|
unit: r.Pixel,
|
|
2816
2835
|
width: t.detail.width,
|
|
2817
2836
|
x: a,
|
|
2818
|
-
y:
|
|
2837
|
+
y: n
|
|
2819
2838
|
};
|
|
2820
2839
|
}
|
|
2821
2840
|
e !== this.cropSize.unit && (this.cropSize = {
|
|
@@ -2836,40 +2855,40 @@ let m = class extends q {
|
|
|
2836
2855
|
if (this.clearResetSnapshot(), this.lastAction = f.Crop, !this.asset) {
|
|
2837
2856
|
const {
|
|
2838
2857
|
focusMode: l,
|
|
2839
|
-
height:
|
|
2840
|
-
position:
|
|
2858
|
+
height: d,
|
|
2859
|
+
position: m,
|
|
2841
2860
|
ratioHeight: c,
|
|
2842
|
-
ratioWidth:
|
|
2861
|
+
ratioWidth: y,
|
|
2843
2862
|
unit: S,
|
|
2844
|
-
width:
|
|
2845
|
-
x:
|
|
2846
|
-
y:
|
|
2847
|
-
} = this.cropSize,
|
|
2848
|
-
(
|
|
2863
|
+
width: p,
|
|
2864
|
+
x: g,
|
|
2865
|
+
y: w
|
|
2866
|
+
} = this.cropSize, A = this.focusModes.find(
|
|
2867
|
+
(F) => F.value === l
|
|
2849
2868
|
)?.auto ?? !1;
|
|
2850
2869
|
if (S === r.AspectRatio) {
|
|
2851
|
-
|
|
2870
|
+
y && c && this.upsertTransformation({
|
|
2852
2871
|
key: f.Crop,
|
|
2853
2872
|
value: {
|
|
2854
2873
|
focusMode: l,
|
|
2855
|
-
isFocusModeAuto:
|
|
2856
|
-
position:
|
|
2874
|
+
isFocusModeAuto: A,
|
|
2875
|
+
position: m,
|
|
2857
2876
|
ratioHeight: c,
|
|
2858
|
-
ratioWidth:
|
|
2877
|
+
ratioWidth: y,
|
|
2859
2878
|
unit: S
|
|
2860
2879
|
}
|
|
2861
2880
|
});
|
|
2862
2881
|
return;
|
|
2863
2882
|
}
|
|
2864
|
-
(
|
|
2883
|
+
(d || p) && this.upsertTransformation({
|
|
2865
2884
|
key: f.Crop,
|
|
2866
2885
|
value: {
|
|
2867
2886
|
focusMode: l,
|
|
2868
|
-
height:
|
|
2869
|
-
isFocusModeAuto:
|
|
2870
|
-
position:
|
|
2887
|
+
height: d,
|
|
2888
|
+
isFocusModeAuto: A,
|
|
2889
|
+
position: m,
|
|
2871
2890
|
unit: S,
|
|
2872
|
-
width:
|
|
2891
|
+
width: p,
|
|
2873
2892
|
/**
|
|
2874
2893
|
* Without an asset there is no cropper to drag, so x/y are always the 0
|
|
2875
2894
|
* placeholder from cropSize's default — never a real manual offset. Omit
|
|
@@ -2877,8 +2896,8 @@ let m = class extends q {
|
|
|
2877
2896
|
* string) so `hasManualXY` in buildTransformationString doesn't spuriously
|
|
2878
2897
|
* suppress the focus mode / position `c_g_` gravity value.
|
|
2879
2898
|
*/
|
|
2880
|
-
x: Number.isFinite(
|
|
2881
|
-
y: Number.isFinite(
|
|
2899
|
+
x: Number.isFinite(g) && g !== 0 ? g : void 0,
|
|
2900
|
+
y: Number.isFinite(w) && w !== 0 ? w : void 0
|
|
2882
2901
|
}
|
|
2883
2902
|
});
|
|
2884
2903
|
return;
|
|
@@ -2886,38 +2905,38 @@ let m = class extends q {
|
|
|
2886
2905
|
const { height: e, mode: i, unit: s, width: a } = t.detail;
|
|
2887
2906
|
if (!this.cropperElement || !this.selectedFormat)
|
|
2888
2907
|
return;
|
|
2889
|
-
const
|
|
2890
|
-
(l) => l.value ===
|
|
2908
|
+
const n = this.cropSize.focusMode, o = this.focusModes.find(
|
|
2909
|
+
(l) => l.value === n
|
|
2891
2910
|
)?.auto ?? !1;
|
|
2892
2911
|
if (e && a && s) {
|
|
2893
|
-
let l = a,
|
|
2894
|
-
if (s === r.AspectRatio && (l = this.cropSize.percentageWidth * this.selectedFormat.width / 100,
|
|
2912
|
+
let l = a, d = e;
|
|
2913
|
+
if (s === r.AspectRatio && (l = this.cropSize.percentageWidth * this.selectedFormat.width / 100, d = this.cropSize.percentageHeight * this.selectedFormat.height / 100), i)
|
|
2895
2914
|
this.transformations = [
|
|
2896
2915
|
...this.transformations,
|
|
2897
2916
|
{
|
|
2898
2917
|
key: f.Crop,
|
|
2899
2918
|
value: {
|
|
2900
|
-
focusMode:
|
|
2901
|
-
height:
|
|
2902
|
-
isFocusModeAuto:
|
|
2919
|
+
focusMode: n,
|
|
2920
|
+
height: d,
|
|
2921
|
+
isFocusModeAuto: o,
|
|
2903
2922
|
mode: i,
|
|
2904
2923
|
width: l
|
|
2905
2924
|
}
|
|
2906
2925
|
}
|
|
2907
2926
|
];
|
|
2908
2927
|
else {
|
|
2909
|
-
const
|
|
2928
|
+
const m = this.cropSize.x / 100 * this.selectedFormat.width, c = this.cropSize.y / 100 * this.selectedFormat.height;
|
|
2910
2929
|
this.transformations = [
|
|
2911
2930
|
...this.transformations,
|
|
2912
2931
|
{
|
|
2913
2932
|
key: f.Crop,
|
|
2914
2933
|
value: {
|
|
2915
|
-
focusMode:
|
|
2916
|
-
height:
|
|
2917
|
-
isFocusModeAuto:
|
|
2934
|
+
focusMode: n,
|
|
2935
|
+
height: d,
|
|
2936
|
+
isFocusModeAuto: o,
|
|
2918
2937
|
unit: s,
|
|
2919
2938
|
width: l,
|
|
2920
|
-
x:
|
|
2939
|
+
x: m,
|
|
2921
2940
|
y: c
|
|
2922
2941
|
}
|
|
2923
2942
|
}
|
|
@@ -2928,8 +2947,8 @@ let m = class extends q {
|
|
|
2928
2947
|
{
|
|
2929
2948
|
key: f.Crop,
|
|
2930
2949
|
value: {
|
|
2931
|
-
focusMode:
|
|
2932
|
-
isFocusModeAuto:
|
|
2950
|
+
focusMode: n,
|
|
2951
|
+
isFocusModeAuto: o,
|
|
2933
2952
|
mode: i
|
|
2934
2953
|
}
|
|
2935
2954
|
}
|
|
@@ -2963,12 +2982,12 @@ let m = class extends q {
|
|
|
2963
2982
|
const { height: e, unit: i, width: s } = t.detail;
|
|
2964
2983
|
if (this.clearResetSnapshot(), this.lastAction = f.Resize, !this.asset) {
|
|
2965
2984
|
if (i === r.AspectRatio) {
|
|
2966
|
-
const { ratioHeight:
|
|
2967
|
-
|
|
2985
|
+
const { ratioHeight: d, ratioWidth: m } = this.resizeSize;
|
|
2986
|
+
m && d && this.upsertTransformation({
|
|
2968
2987
|
key: f.Resize,
|
|
2969
2988
|
value: {
|
|
2970
|
-
ratioHeight:
|
|
2971
|
-
ratioWidth:
|
|
2989
|
+
ratioHeight: d,
|
|
2990
|
+
ratioWidth: m,
|
|
2972
2991
|
unit: i
|
|
2973
2992
|
}
|
|
2974
2993
|
});
|
|
@@ -2986,16 +3005,16 @@ let m = class extends q {
|
|
|
2986
3005
|
}
|
|
2987
3006
|
if (!this.selectedFormat)
|
|
2988
3007
|
return;
|
|
2989
|
-
const a = this.selectedFormat.width || this.defaultSize.width,
|
|
2990
|
-
let
|
|
2991
|
-
this.resizeSize.unit !== i ? (
|
|
3008
|
+
const a = this.selectedFormat.width || this.defaultSize.width, n = this.selectedFormat.height || this.defaultSize.height;
|
|
3009
|
+
let o = s, l = e;
|
|
3010
|
+
this.resizeSize.unit !== i ? (o = a, l = n) : i === r.AspectRatio && (o = Math.round(s / e * n), l = n), this.transformations = [
|
|
2992
3011
|
...this.transformations,
|
|
2993
3012
|
{
|
|
2994
3013
|
key: f.Resize,
|
|
2995
3014
|
value: {
|
|
2996
3015
|
height: l,
|
|
2997
3016
|
unit: i,
|
|
2998
|
-
width:
|
|
3017
|
+
width: o
|
|
2999
3018
|
}
|
|
3000
3019
|
}
|
|
3001
3020
|
];
|
|
@@ -3109,198 +3128,198 @@ let m = class extends q {
|
|
|
3109
3128
|
this.transformations = [], this.frozenIndex = -1, this.syncQuality();
|
|
3110
3129
|
}
|
|
3111
3130
|
render() {
|
|
3112
|
-
return C`<div class="asset-link-format" @cx-show=${this.onDetailsShow} @cx-hide=${this.onDetailsHide}>${
|
|
3131
|
+
return C`<div class="asset-link-format" @cx-show=${this.onDetailsShow} @cx-hide=${this.onDetailsHide}>${I(
|
|
3113
3132
|
!this.hideHeader,
|
|
3114
|
-
() => C`<cx-space class="asset-link-format__section-header" direction="horizontal" spacing="small" align-items="center" justify-content="space-between"><cx-typography variant="body3">${this.localize.term("transformations")}</cx-typography><cx-space direction="horizontal" spacing="3x-small" align-items="center"><cx-button class="asset-link-format__undo" variant="custom" ?disabled=${!this.hasUnfrozenTransformations && this.preResetTransformations === void 0} @click=${this.handleUndo}>${this.localize.term("undo")}</cx-button>${
|
|
3133
|
+
() => C`<cx-space class="asset-link-format__section-header" direction="horizontal" spacing="small" align-items="center" justify-content="space-between"><cx-typography variant="body3">${this.localize.term("transformations")}</cx-typography><cx-space direction="horizontal" spacing="3x-small" align-items="center"><cx-button class="asset-link-format__undo" variant="custom" ?disabled=${!this.hasUnfrozenTransformations && this.preResetTransformations === void 0} @click=${this.handleUndo}>${this.localize.term("undo")}</cx-button>${I(this.canReset, () => C`<cx-button class="asset-link-format__reset" variant="custom" ?disabled=${!this.hasResettableState} @click=${this.handleReset}>${this.localize.term("reset")}</cx-button>`)}</cx-space></cx-space>`,
|
|
3115
3134
|
() => Ut
|
|
3116
3135
|
)}
|
|
3117
|
-
${
|
|
3136
|
+
${I(
|
|
3118
3137
|
!this.noFormat,
|
|
3119
3138
|
() => C`<cx-asset-link-format-proxy class="asset-link-format__details" value=${this.selectedProxy || this.proxies?.[0]?.id || ""} ?open=${this.activeSetting === "cx-asset-link-format-proxy"} ?auto-format=${this.autoFormat} ?can-auto-format=${this.canAutoFormat} .items=${this.formats} ?loading=${this.loading && this.lastAction === f.Proxy} @cx-asset-link-format-proxy-change=${this.onProxyChange}></cx-asset-link-format-proxy>`
|
|
3120
3139
|
)}
|
|
3121
|
-
${
|
|
3140
|
+
${I(
|
|
3122
3141
|
!this.noCrop,
|
|
3123
3142
|
() => C`<cx-asset-link-format-crop class="asset-link-format__details" ?open=${this.activeSetting === "cx-asset-link-format-crop"} ?disabled-apply=${this.disabledCropApply} ?loading=${this.loading && this.lastAction === f.Crop} ?keep-aspect-ratio=${this.cropSize.keepAspectRatio} ?show-position-picker=${!this.asset} focus-mode=${this.cropSize.focusMode} crop-mode=${this.cropSize.cropMode} width=${this.cropSize.width} height=${this.cropSize.height} max-width=${this.asset ? this.lastResizeSize[r.Pixel].width : 1 / 0} max-height=${this.asset ? this.lastResizeSize[r.Pixel].height : 1 / 0} percentage-width=${this.cropSize.percentageWidth} percentage-height=${this.cropSize.percentageHeight} position=${this.cropSize.position} ratio-width=${this.cropSize.ratioWidth} ratio-height=${this.cropSize.ratioHeight} unit=${this.cropSize.unit} .lastAppliedSetting=${this.lastCropSize} .cropModes=${this.cropModes} .focusModes=${this.focusModes} @cx-asset-link-format-crop-mode-change=${this.onCropModeChange} @cx-asset-link-format-crop-focus-mode-change=${this.onCropFocusModeChange} @cx-asset-link-format-crop-position-change=${this.onCropPositionChange} @cx-asset-link-format-crop-change=${this.onCropChange} @cx-asset-link-format-crop-changed=${this.onCropChanged} @cx-asset-link-format-crop-apply=${this.onCropApply}></cx-asset-link-format-crop>`
|
|
3124
3143
|
)}
|
|
3125
|
-
${
|
|
3144
|
+
${I(
|
|
3126
3145
|
!this.noResize,
|
|
3127
3146
|
() => C`<cx-asset-link-format-resize class="asset-link-format__details" ?open=${this.activeSetting === "cx-asset-link-format-resize"} ?loading=${this.loading && this.lastAction === f.Resize} ?no-ratio-modes=${!this.asset} ?keep-aspect-ratio=${this.resizeSize.keepAspectRatio} width=${this.resizeSize.width} height=${this.resizeSize.height} max-width=${this.asset ? this.imageSize.width : 1 / 0} max-height=${this.asset ? this.imageSize.height : 1 / 0} ratio-width=${this.resizeSize.ratioWidth} ratio-height=${this.resizeSize.ratioHeight} unit=${this.resizeSize.unit} .lastAppliedSetting=${this.lastResizeSize} @cx-asset-link-format-resize-change=${this.onResizeChange} @cx-asset-link-format-resize-apply=${this.onResizeApply}></cx-asset-link-format-resize>`
|
|
3128
3147
|
)}
|
|
3129
|
-
${
|
|
3148
|
+
${I(
|
|
3130
3149
|
!this.noRotate,
|
|
3131
3150
|
() => C`<cx-asset-link-format-rotation class="asset-link-format__details" ?loading=${this.loading && this.lastAction === f.Rotate} ?open=${this.activeSetting === "cx-asset-link-format-rotation"} default-value=${this.selectedFormat?.rotation ?? 0} last-applied-value=${this.lastRotation} value=${this.rotation} @cx-asset-link-format-rotation-change=${this.onRotationChange} @cx-asset-link-format-rotation-apply=${this.onRotationApply}></cx-asset-link-format-rotation>`
|
|
3132
|
-
)}<cx-asset-link-format-quality class="asset-link-format__details" ?loading=${this.loading && this.lastAction === f.Quality} ?open=${this.activeSetting === "cx-asset-link-format-quality"} value=${this.selectedFormat?.quality ?? 100} @cx-asset-link-format-quality-change=${this.onQualityChange}></cx-asset-link-format-quality>${
|
|
3151
|
+
)}<cx-asset-link-format-quality class="asset-link-format__details" ?loading=${this.loading && this.lastAction === f.Quality} ?open=${this.activeSetting === "cx-asset-link-format-quality"} value=${this.selectedFormat?.quality ?? 100} @cx-asset-link-format-quality-change=${this.onQualityChange}></cx-asset-link-format-quality>${I(
|
|
3133
3152
|
!this.noMetadata,
|
|
3134
3153
|
() => C`<cx-asset-link-format-metadata class="asset-link-format__details" ?open=${this.activeSetting === "cx-asset-link-format-metadata"} .value=${this.selectedFormat?.keepMetadata ?? !1} @cx-asset-link-format-metadata-change=${this.onMetadataChange}></cx-asset-link-format-metadata>`
|
|
3135
3154
|
)}
|
|
3136
|
-
${
|
|
3155
|
+
${I(
|
|
3137
3156
|
this.useCustomExtension,
|
|
3138
3157
|
() => C`<cx-asset-link-format-extension .items=${this.extensions} value=${this.selectedFormat?.extension ?? ""} @cx-asset-link-format-extension-change=${this.onExtensionChange}></cx-asset-link-format-extension>`
|
|
3139
3158
|
)}</div>`;
|
|
3140
3159
|
}
|
|
3141
3160
|
};
|
|
3142
|
-
|
|
3143
|
-
|
|
3161
|
+
u.styles = [Q, _e];
|
|
3162
|
+
u.dependencies = {
|
|
3144
3163
|
"cx-asset-link-format-crop": v,
|
|
3145
|
-
"cx-asset-link-format-extension":
|
|
3146
|
-
"cx-asset-link-format-metadata":
|
|
3147
|
-
"cx-asset-link-format-proxy":
|
|
3148
|
-
"cx-asset-link-format-quality":
|
|
3149
|
-
"cx-asset-link-format-resize":
|
|
3164
|
+
"cx-asset-link-format-extension": Y,
|
|
3165
|
+
"cx-asset-link-format-metadata": U,
|
|
3166
|
+
"cx-asset-link-format-proxy": E,
|
|
3167
|
+
"cx-asset-link-format-quality": W,
|
|
3168
|
+
"cx-asset-link-format-resize": k,
|
|
3150
3169
|
"cx-asset-link-format-rotation": H,
|
|
3151
|
-
"cx-button":
|
|
3152
|
-
"cx-space":
|
|
3153
|
-
"cx-typography":
|
|
3170
|
+
"cx-button": J,
|
|
3171
|
+
"cx-space": B,
|
|
3172
|
+
"cx-typography": q
|
|
3154
3173
|
};
|
|
3155
3174
|
x([
|
|
3156
3175
|
h({ attribute: "base-url", type: String })
|
|
3157
|
-
],
|
|
3176
|
+
], u.prototype, "baseUrl", 2);
|
|
3158
3177
|
x([
|
|
3159
3178
|
h({ attribute: "token", type: String })
|
|
3160
|
-
],
|
|
3179
|
+
], u.prototype, "token", 2);
|
|
3161
3180
|
x([
|
|
3162
3181
|
h({ reflect: !1, type: Object })
|
|
3163
|
-
],
|
|
3182
|
+
], u.prototype, "asset", 2);
|
|
3164
3183
|
x([
|
|
3165
3184
|
h({ attribute: "crop-modes", reflect: !1, type: Array })
|
|
3166
|
-
],
|
|
3185
|
+
], u.prototype, "cropModes", 2);
|
|
3167
3186
|
x([
|
|
3168
3187
|
h({ attribute: "focus-modes", reflect: !1, type: Object })
|
|
3169
|
-
],
|
|
3188
|
+
], u.prototype, "focusModes", 2);
|
|
3170
3189
|
x([
|
|
3171
3190
|
h({ reflect: !1, type: Array })
|
|
3172
|
-
],
|
|
3191
|
+
], u.prototype, "extensions", 2);
|
|
3173
3192
|
x([
|
|
3174
3193
|
h({ reflect: !1, type: Array })
|
|
3175
|
-
],
|
|
3194
|
+
], u.prototype, "proxies", 2);
|
|
3176
3195
|
x([
|
|
3177
3196
|
h({ attribute: "for-cropper", reflect: !0, type: String })
|
|
3178
|
-
],
|
|
3197
|
+
], u.prototype, "forCropper", 2);
|
|
3179
3198
|
x([
|
|
3180
3199
|
h({ attribute: "use-session", reflect: !0, type: String })
|
|
3181
|
-
],
|
|
3200
|
+
], u.prototype, "useSession", 2);
|
|
3182
3201
|
x([
|
|
3183
3202
|
h({ reflect: !1, type: Array })
|
|
3184
|
-
],
|
|
3203
|
+
], u.prototype, "transformations", 2);
|
|
3185
3204
|
x([
|
|
3186
3205
|
h({ attribute: "selected-proxy", reflect: !0, type: String })
|
|
3187
|
-
],
|
|
3206
|
+
], u.prototype, "selectedProxy", 2);
|
|
3188
3207
|
x([
|
|
3189
3208
|
h({ attribute: "default-proxy", reflect: !0, type: String })
|
|
3190
|
-
],
|
|
3209
|
+
], u.prototype, "defaultProxy", 2);
|
|
3191
3210
|
x([
|
|
3192
3211
|
h({ attribute: "can-auto-format", reflect: !0, type: Boolean })
|
|
3193
|
-
],
|
|
3212
|
+
], u.prototype, "canAutoFormat", 2);
|
|
3194
3213
|
x([
|
|
3195
3214
|
h({ attribute: "auto-format", reflect: !0, type: Boolean })
|
|
3196
|
-
],
|
|
3215
|
+
], u.prototype, "autoFormat", 2);
|
|
3197
3216
|
x([
|
|
3198
3217
|
h({ attribute: "use-custom-extension", reflect: !0, type: Boolean })
|
|
3199
|
-
],
|
|
3218
|
+
], u.prototype, "useCustomExtension", 2);
|
|
3200
3219
|
x([
|
|
3201
3220
|
h({ attribute: "no-metadata", reflect: !0, type: Boolean })
|
|
3202
|
-
],
|
|
3221
|
+
], u.prototype, "noMetadata", 2);
|
|
3203
3222
|
x([
|
|
3204
3223
|
h({ attribute: "no-format", reflect: !0, type: Boolean })
|
|
3205
|
-
],
|
|
3224
|
+
], u.prototype, "noFormat", 2);
|
|
3206
3225
|
x([
|
|
3207
3226
|
h({ attribute: "no-crop", reflect: !0, type: Boolean })
|
|
3208
|
-
],
|
|
3227
|
+
], u.prototype, "noCrop", 2);
|
|
3209
3228
|
x([
|
|
3210
3229
|
h({ attribute: "no-resize", reflect: !0, type: Boolean })
|
|
3211
|
-
],
|
|
3230
|
+
], u.prototype, "noResize", 2);
|
|
3212
3231
|
x([
|
|
3213
3232
|
h({ attribute: "no-rotate", reflect: !0, type: Boolean })
|
|
3214
|
-
],
|
|
3233
|
+
], u.prototype, "noRotate", 2);
|
|
3215
3234
|
x([
|
|
3216
3235
|
h({ attribute: "last-image-size", reflect: !1, type: Object })
|
|
3217
|
-
],
|
|
3236
|
+
], u.prototype, "lastImageSize", 2);
|
|
3218
3237
|
x([
|
|
3219
3238
|
h({ attribute: "hide-header", reflect: !1, type: Boolean })
|
|
3220
|
-
],
|
|
3239
|
+
], u.prototype, "hideHeader", 2);
|
|
3221
3240
|
x([
|
|
3222
3241
|
h({ attribute: "can-reset", type: Boolean })
|
|
3223
|
-
],
|
|
3242
|
+
], u.prototype, "canReset", 2);
|
|
3224
3243
|
x([
|
|
3225
3244
|
h({ attribute: !1, reflect: !1, type: Object })
|
|
3226
|
-
],
|
|
3245
|
+
], u.prototype, "queryElement", 2);
|
|
3227
3246
|
x([
|
|
3228
|
-
|
|
3229
|
-
],
|
|
3247
|
+
R()
|
|
3248
|
+
], u.prototype, "activeSetting", 2);
|
|
3230
3249
|
x([
|
|
3231
|
-
|
|
3232
|
-
],
|
|
3250
|
+
R()
|
|
3251
|
+
], u.prototype, "selectedFormat", 2);
|
|
3233
3252
|
x([
|
|
3234
|
-
|
|
3235
|
-
],
|
|
3253
|
+
R()
|
|
3254
|
+
], u.prototype, "resizeSize", 2);
|
|
3236
3255
|
x([
|
|
3237
|
-
|
|
3238
|
-
],
|
|
3256
|
+
R()
|
|
3257
|
+
], u.prototype, "cropSize", 2);
|
|
3239
3258
|
x([
|
|
3240
|
-
|
|
3241
|
-
],
|
|
3259
|
+
R()
|
|
3260
|
+
], u.prototype, "rotation", 2);
|
|
3242
3261
|
x([
|
|
3243
|
-
|
|
3244
|
-
],
|
|
3262
|
+
R()
|
|
3263
|
+
], u.prototype, "defaultSize", 2);
|
|
3245
3264
|
x([
|
|
3246
|
-
|
|
3247
|
-
],
|
|
3265
|
+
R()
|
|
3266
|
+
], u.prototype, "cropperElement", 2);
|
|
3248
3267
|
x([
|
|
3249
|
-
|
|
3250
|
-
],
|
|
3268
|
+
R()
|
|
3269
|
+
], u.prototype, "parameters", 2);
|
|
3251
3270
|
x([
|
|
3252
|
-
|
|
3253
|
-
],
|
|
3271
|
+
R()
|
|
3272
|
+
], u.prototype, "loading", 2);
|
|
3254
3273
|
x([
|
|
3255
|
-
|
|
3256
|
-
],
|
|
3274
|
+
R()
|
|
3275
|
+
], u.prototype, "lastAction", 2);
|
|
3257
3276
|
x([
|
|
3258
|
-
|
|
3259
|
-
],
|
|
3277
|
+
R()
|
|
3278
|
+
], u.prototype, "frozenIndex", 2);
|
|
3260
3279
|
x([
|
|
3261
|
-
|
|
3262
|
-
],
|
|
3280
|
+
R()
|
|
3281
|
+
], u.prototype, "preResetTransformations", 2);
|
|
3263
3282
|
x([
|
|
3264
|
-
|
|
3265
|
-
],
|
|
3283
|
+
R()
|
|
3284
|
+
], u.prototype, "preResetAutoFormat", 2);
|
|
3266
3285
|
x([
|
|
3267
|
-
|
|
3268
|
-
],
|
|
3286
|
+
R()
|
|
3287
|
+
], u.prototype, "preResetSelectedProxy", 2);
|
|
3269
3288
|
x([
|
|
3270
3289
|
P("transformations")
|
|
3271
|
-
],
|
|
3290
|
+
], u.prototype, "handleTransformationsChange", 1);
|
|
3272
3291
|
x([
|
|
3273
3292
|
P("selectedProxy")
|
|
3274
|
-
],
|
|
3293
|
+
], u.prototype, "handleSelectedProxyChange", 1);
|
|
3275
3294
|
x([
|
|
3276
3295
|
P("loading")
|
|
3277
|
-
],
|
|
3278
|
-
|
|
3279
|
-
|
|
3280
|
-
],
|
|
3296
|
+
], u.prototype, "handleLoadingChange", 1);
|
|
3297
|
+
u = x([
|
|
3298
|
+
X("cx-asset-link-format")
|
|
3299
|
+
], u);
|
|
3281
3300
|
export {
|
|
3282
|
-
|
|
3283
|
-
|
|
3284
|
-
|
|
3285
|
-
|
|
3301
|
+
u as C,
|
|
3302
|
+
Gi as F,
|
|
3303
|
+
_t as M,
|
|
3304
|
+
be as a,
|
|
3286
3305
|
Xt as b,
|
|
3287
|
-
|
|
3288
|
-
|
|
3306
|
+
ht as c,
|
|
3307
|
+
xt as d,
|
|
3289
3308
|
Vt as e,
|
|
3290
|
-
|
|
3309
|
+
ge as f,
|
|
3291
3310
|
Gt as g,
|
|
3292
|
-
|
|
3311
|
+
ji as h,
|
|
3293
3312
|
Zt as i,
|
|
3294
|
-
|
|
3295
|
-
|
|
3296
|
-
|
|
3297
|
-
|
|
3313
|
+
Vi as j,
|
|
3314
|
+
qi as k,
|
|
3315
|
+
ut as l,
|
|
3316
|
+
mt as m,
|
|
3298
3317
|
Ht as n,
|
|
3299
|
-
|
|
3300
|
-
|
|
3318
|
+
ft as o,
|
|
3319
|
+
gt as p,
|
|
3301
3320
|
Wt as q,
|
|
3302
|
-
|
|
3303
|
-
|
|
3304
|
-
|
|
3305
|
-
|
|
3321
|
+
Li as r,
|
|
3322
|
+
Ui as s,
|
|
3323
|
+
Bi as t,
|
|
3324
|
+
ce as u
|
|
3306
3325
|
};
|