@orangelogic/design-system 3.15.0 → 3.17.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.GZb85GYh.js → asset-link-format.FmSSysED.js} +890 -893
- package/library/chunks/{button.BQoebhw_.js → button.DCyoZrRj.js} +1 -1
- package/library/chunks/{color-swatch-group.D25fjSK-.js → color-swatch-group.CvApE9bf.js} +5 -5
- package/library/chunks/{confirm-popover.C35rVtVI.js → confirm-popover.-_1n24v-.js} +1 -1
- package/library/chunks/{document-viewer.sz5uTo3c.js → document-viewer.DY5s9zRW.js} +3 -3
- package/library/chunks/{dom.DShN_5Jh.js → dom.DL-cNKsj.js} +40 -38
- package/library/chunks/{folder-select.CHY44KlA.js → folder-select.CsuADJH9.js} +2 -2
- package/library/chunks/{form.C8LMdQB4.js → form.DN2v7-DH.js} +1 -1
- package/library/chunks/{index.D8AuAxXl.js → index.CW7LXCxo.js} +9 -9
- package/library/chunks/{input.BRZzv6Zk.js → input.Csf-S2nB.js} +1 -1
- package/library/chunks/{pagination.DtdNeZZD.js → pagination.C9NblxKt.js} +2 -2
- package/library/chunks/{tab-group.BQh_hMDd.js → tab-group.B6Aej-jM.js} +2 -2
- package/library/chunks/{types.Bc8Tgozj.js → types.BNc8NEZr.js} +10879 -10646
- package/library/components/asset-link-format.js +2 -2
- package/library/components/atoms.js +5 -5
- package/library/components/border-input-group.js +1 -1
- package/library/components/button.js +2 -2
- package/library/components/checkbox.js +1 -1
- package/library/components/color-picker.js +3 -3
- package/library/components/color-swatch-group.js +1 -1
- package/library/components/confirm-popover.js +2 -2
- package/library/components/corner-position-input-group.js +1 -1
- package/library/components/document-viewer.js +1 -1
- package/library/components/dropdown.js +1 -1
- package/library/components/dynamic-select.js +1 -1
- package/library/components/element-clamp.js +1 -1
- package/library/components/file-on-demand.js +4 -4
- package/library/components/folder-select.js +2 -2
- package/library/components/input.js +2 -2
- package/library/components/line-clamp.js +1 -1
- package/library/components/molecules.js +2 -2
- package/library/components/organisms.js +2 -2
- package/library/components/padding-input-group.js +1 -1
- package/library/components/pagination.js +3 -3
- package/library/components/radio-group.js +1 -1
- package/library/components/range.js +1 -1
- package/library/components/select.js +1 -1
- package/library/components/shadow-input-group.js +1 -1
- package/library/components/share-option-list.js +1 -1
- package/library/components/size-input-group.js +1 -1
- package/library/components/switch.js +1 -1
- package/library/components/tab-group.js +3 -3
- package/library/components/textarea.js +1 -1
- package/library/components/types.js +128 -127
- package/library/package.json +1 -1
- package/library/packages/events/src/cx-comment-task-mention-select.d.ts +13 -0
- package/library/packages/events/src/events.d.ts +1 -0
- package/library/packages/organisms/src/comment/comment.d.ts +72 -0
- package/library/packages/services/src/api/asset/asset.d.ts +6 -25
- package/library/packages/tools/src/fetch-image/fetch-image.d.ts +4 -0
- package/library/packages/tools/src/tiptap/extensions/task-mention/index.d.ts +77 -0
- package/library/packages/types/src/gallery-item.d.ts +1 -0
- package/library/packages/types/src/xml-editor.d.ts +1 -1
- package/library/packages/utils/src/dom/dom.d.ts +9 -0
- package/library/react-web-component.d.ts +86 -2
- package/library/utils.js +105 -104
- package/package.json +1 -1
|
@@ -1,49 +1,49 @@
|
|
|
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 E, a as
|
|
2
|
+
import { C as K } from "./button.DCyoZrRj.js";
|
|
3
|
+
import U from "../components/space.js";
|
|
4
|
+
import { C as B } from "./typography.T72DuoCa.js";
|
|
5
|
+
import { n as h, C as q } from "./lib-cortex-element.CVMmyPMC.js";
|
|
6
|
+
import { h as E, a as Dt, C as Nt, 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
|
|
9
|
-
import "./form.
|
|
10
|
-
import { L as
|
|
11
|
-
import { a as
|
|
8
|
+
import { i as j, x as C, E as Ot } from "./lit-element.jLBm65_O.js";
|
|
9
|
+
import "./form.DN2v7-DH.js";
|
|
10
|
+
import { L as V } from "./i18n.CNnI4-0K.js";
|
|
11
|
+
import { a as ie } from "./string.Demn8Xmk.js";
|
|
12
12
|
import "./date-picker.BGHn6qg8.js";
|
|
13
|
-
import { a as
|
|
13
|
+
import { a as bt, r as Lt, b as se, c as ae, d as lt } from "./transformation.OaRYixzE.js";
|
|
14
14
|
import "./unsafe-html.Dff7-rCx.js";
|
|
15
|
-
import { b as
|
|
16
|
-
import { c as
|
|
17
|
-
import { M as ct, U as o, T as
|
|
18
|
-
import { v as
|
|
15
|
+
import { b as oe } from "./_baseUniq.lwMgmtt2.js";
|
|
16
|
+
import { c as G } from "./component.styles.CAS3c9pM.js";
|
|
17
|
+
import { M as ct, U as o, T as m } from "./asset-link-format.ClaYu_v8.js";
|
|
18
|
+
import { v as re } from "./v4.CKZ6klMF.js";
|
|
19
19
|
import { P as N } from "./position-picker.DjnhxIKF.js";
|
|
20
|
-
import { c as
|
|
21
|
-
import { w as
|
|
22
|
-
import { s as
|
|
23
|
-
import { r as
|
|
20
|
+
import { c as Q } from "./custom-element.L4WJXn1j.js";
|
|
21
|
+
import { w as _ } from "./watch.DJF5K-8U.js";
|
|
22
|
+
import { s as Mt, a as pt } from "./number.Cx2ncfJJ.js";
|
|
23
|
+
import { r as $ } from "./state.CSDxrqLd.js";
|
|
24
24
|
import { n as M } from "./when.Dr1es41R.js";
|
|
25
|
-
import
|
|
26
|
-
import
|
|
27
|
-
import { C as
|
|
28
|
-
import { C as
|
|
29
|
-
import { C as
|
|
30
|
-
import { C as
|
|
31
|
-
import
|
|
32
|
-
import
|
|
33
|
-
import { c as
|
|
34
|
-
import { e as
|
|
35
|
-
import { c as
|
|
25
|
+
import at from "../components/details.js";
|
|
26
|
+
import Ut from "../components/divider.js";
|
|
27
|
+
import { C as ot } from "./icon.BLXWp6CU.js";
|
|
28
|
+
import { C as Ct } from "./icon-button.5-oAlIkv.js";
|
|
29
|
+
import { C as kt } from "./input.Csf-S2nB.js";
|
|
30
|
+
import { C as yt } from "./option.DgxoCq1j.js";
|
|
31
|
+
import St from "../components/select.js";
|
|
32
|
+
import ne from "../components/position-picker.js";
|
|
33
|
+
import { c as he } from "./image.Y5c_hFx8.js";
|
|
34
|
+
import { e as Y } from "./query.BBf1UFkC.js";
|
|
35
|
+
import { c as rt } from "./repeat.CFjcER6_.js";
|
|
36
36
|
import { o as O } from "./style-map.llVFPd__.js";
|
|
37
|
-
import
|
|
38
|
-
import
|
|
39
|
-
import
|
|
40
|
-
function
|
|
41
|
-
return t && t.length ?
|
|
37
|
+
import Bt from "../components/tooltip.js";
|
|
38
|
+
import le from "../components/button-group.js";
|
|
39
|
+
import ce from "../components/checkbox.js";
|
|
40
|
+
function pe(t) {
|
|
41
|
+
return t && t.length ? oe(t) : [];
|
|
42
42
|
}
|
|
43
|
-
function
|
|
43
|
+
function qt(t) {
|
|
44
44
|
return typeof t == "object" && t !== null && "URI" in t;
|
|
45
45
|
}
|
|
46
|
-
const
|
|
46
|
+
const de = {
|
|
47
47
|
artist: "Artist",
|
|
48
48
|
color: "Color",
|
|
49
49
|
createDate: "CreateDate",
|
|
@@ -65,18 +65,18 @@ const ue = {
|
|
|
65
65
|
systemIdentifier: "SystemIdentifier",
|
|
66
66
|
text: "Text",
|
|
67
67
|
title: "Title"
|
|
68
|
-
},
|
|
69
|
-
function
|
|
68
|
+
}, ue = /* @__PURE__ */ new Set(["mediaDate", "createDate", "editDate"]);
|
|
69
|
+
function wt(t) {
|
|
70
70
|
return !/[\s&+/*"\\:(),'<>~|[\]{}]/.test(t) && !/^(?:OR|AND|NOT)$/.test(t) ? t : `"${t.replace(/\\/g, "\\\\").replace(/"/g, '\\"')}"`;
|
|
71
71
|
}
|
|
72
|
-
function
|
|
73
|
-
const s = (Array.isArray(e) ? e : [e]).map((a) => `${t}:${
|
|
72
|
+
function It(t, e) {
|
|
73
|
+
const s = (Array.isArray(e) ? e : [e]).map((a) => `${t}:${wt(a)}`);
|
|
74
74
|
return s.length > 1 ? `(${s.join(" OR ")})` : s[0] ?? "";
|
|
75
75
|
}
|
|
76
|
-
function
|
|
76
|
+
function me(t, e) {
|
|
77
77
|
return (Array.isArray(e) ? e : [e]).map((s) => `${t}${s.operator}${s.value}`).join(" AND ");
|
|
78
78
|
}
|
|
79
|
-
function
|
|
79
|
+
function fe(t) {
|
|
80
80
|
const e = [];
|
|
81
81
|
for (const i of Object.keys(t)) {
|
|
82
82
|
const s = i, a = t[s];
|
|
@@ -86,14 +86,14 @@ function ge(t) {
|
|
|
86
86
|
for (const [n, l] of Object.entries(
|
|
87
87
|
a
|
|
88
88
|
))
|
|
89
|
-
e.push(
|
|
89
|
+
e.push(It(n, l));
|
|
90
90
|
continue;
|
|
91
91
|
}
|
|
92
|
-
const r =
|
|
92
|
+
const r = de[s];
|
|
93
93
|
if (r) {
|
|
94
|
-
if (
|
|
94
|
+
if (ue.has(s)) {
|
|
95
95
|
e.push(
|
|
96
|
-
|
|
96
|
+
me(r, a)
|
|
97
97
|
);
|
|
98
98
|
continue;
|
|
99
99
|
}
|
|
@@ -106,13 +106,13 @@ function ge(t) {
|
|
|
106
106
|
if (n.length === 0)
|
|
107
107
|
continue;
|
|
108
108
|
const l = [
|
|
109
|
-
...n.map((
|
|
110
|
-
...n.map((
|
|
109
|
+
...n.map((p) => `ParentFolderIdentifier:${wt(String(p))}`),
|
|
110
|
+
...n.map((p) => `ParentAlbumIdentifier:${wt(String(p))}`)
|
|
111
111
|
];
|
|
112
112
|
e.push(`(${l.join(" OR ")})`);
|
|
113
113
|
continue;
|
|
114
114
|
}
|
|
115
|
-
e.push(
|
|
115
|
+
e.push(It(r, a));
|
|
116
116
|
}
|
|
117
117
|
}
|
|
118
118
|
return e.join(" AND ");
|
|
@@ -128,92 +128,109 @@ function dt(t) {
|
|
|
128
128
|
const e = dt(t.not);
|
|
129
129
|
return e ? `NOT (${e})` : "";
|
|
130
130
|
}
|
|
131
|
-
return
|
|
131
|
+
return fe(t);
|
|
132
132
|
}
|
|
133
|
-
const
|
|
133
|
+
const ge = "CoreField.LargeSizePreview", ut = "CoreField.DocType", Rt = "Document.Title", xe = "Document.CaptionLong", nt = "Document.FileExtension", mt = "CoreField.FileSize", Et = "CoreField.Identifier", Ui = "CoreField.MaxHeight", Bi = "CoreField.MaxWidth", ft = "Document.RecordID", Ht = "CoreField.DocSubType", gt = "CoreField.TitleWithFallback", st = "CoreField.OriginalFileName", jt = "__width", Vt = "__height", ye = "CoreField.OriginalPreview", qi = "Document.DocSubType", ji = "Document.InPoint", Vi = "Document.OutPoint", Tt = {
|
|
134
134
|
DEFAULT_VIEW_SIZE: "Document.LargeSizePreview",
|
|
135
|
-
FIELD_TITLE_WITH_FALLBACK: "Document.TitleWithFallback",
|
|
136
135
|
ORIGINAL_VIEW_SIZE: "Document.OriginalPreview"
|
|
137
|
-
},
|
|
138
|
-
[
|
|
139
|
-
[
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
Object.entries(Kt).map(([t, e]) => [
|
|
136
|
+
}, Gt = {
|
|
137
|
+
[ge]: Tt.DEFAULT_VIEW_SIZE,
|
|
138
|
+
[ye]: Tt.ORIGINAL_VIEW_SIZE
|
|
139
|
+
}, Se = Object.fromEntries(
|
|
140
|
+
Object.entries(Gt).map(([t, e]) => [
|
|
143
141
|
e,
|
|
144
142
|
t
|
|
145
143
|
])
|
|
146
144
|
);
|
|
147
|
-
function
|
|
148
|
-
return
|
|
145
|
+
function Ae(t) {
|
|
146
|
+
return Gt[t] ?? t;
|
|
147
|
+
}
|
|
148
|
+
function ve(t) {
|
|
149
|
+
return t === gt ? [Rt, st] : [Ae(t)];
|
|
149
150
|
}
|
|
150
|
-
function
|
|
151
|
+
function ze(t) {
|
|
151
152
|
const e = {};
|
|
152
153
|
for (const [i, s] of Object.entries(t)) {
|
|
153
|
-
const a =
|
|
154
|
+
const a = Se[i] ?? i;
|
|
154
155
|
e[a] = s;
|
|
155
156
|
}
|
|
156
157
|
return e;
|
|
157
158
|
}
|
|
159
|
+
function Qt(t, e, i) {
|
|
160
|
+
t[i] = H(e, i);
|
|
161
|
+
const s = e[i];
|
|
162
|
+
return s != null && qt(s) && (typeof s.Width == "number" && s.Width > 0 && (t[`${i}${jt}`] = String(s.Width)), typeof s.Height == "number" && s.Height > 0 && (t[`${i}${Vt}`] = String(s.Height))), t;
|
|
163
|
+
}
|
|
158
164
|
function be(t) {
|
|
159
165
|
const e = new URLSearchParams();
|
|
160
166
|
for (const [i, s] of Object.entries(t))
|
|
161
167
|
s != null && (Array.isArray(s) ? s.forEach((a) => e.append(i, String(a))) : e.append(i, String(s)));
|
|
162
168
|
return e;
|
|
163
169
|
}
|
|
164
|
-
async function
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
170
|
+
async function Xt({
|
|
171
|
+
consistency: t,
|
|
172
|
+
countPerPage: e,
|
|
173
|
+
fields: i,
|
|
174
|
+
getPermanentAssetsPaths: s,
|
|
175
|
+
httpMethod: a = "GET",
|
|
176
|
+
isSiteBuilder: r,
|
|
177
|
+
pageNumber: n,
|
|
178
|
+
query: l,
|
|
179
|
+
securityByPassToken: p,
|
|
180
|
+
siteUrl: g,
|
|
181
|
+
sort: c,
|
|
182
|
+
token: f,
|
|
183
|
+
useSession: S
|
|
177
184
|
}) {
|
|
178
|
-
const
|
|
179
|
-
|
|
180
|
-
|
|
185
|
+
const x = i?.flatMap(ve), d = i?.includes(gt) ?? !1, v = (P) => {
|
|
186
|
+
const w = ze(P);
|
|
187
|
+
return d && (w[gt] = H(w, Rt) || H(w, st)), w;
|
|
188
|
+
}, k = {
|
|
189
|
+
/*
|
|
190
|
+
* Opt-in only, never inferred from `isSiteBuilder`: that flag picks the endpoint, and callers set
|
|
191
|
+
* it while AUTHORING (see the gallery block, which passes its edit-mode state), so inferring from
|
|
192
|
+
* it would ask for possibly-stale values in the one place a caller writes and reads back.
|
|
193
|
+
* Both endpoints understand the mode - CMS5 forwards it to the same Search v4.0 service.
|
|
194
|
+
*/
|
|
195
|
+
Consistency: t || void 0,
|
|
196
|
+
CountPerPage: e,
|
|
197
|
+
Fields: pe(x),
|
|
181
198
|
Format: "json",
|
|
182
|
-
GetPermanentAssetsPaths:
|
|
183
|
-
PageNumber:
|
|
184
|
-
Query: dt(
|
|
185
|
-
SecurityByPassToken:
|
|
186
|
-
Sort:
|
|
187
|
-
UseSession:
|
|
188
|
-
},
|
|
199
|
+
GetPermanentAssetsPaths: s || void 0,
|
|
200
|
+
PageNumber: n,
|
|
201
|
+
Query: dt(l),
|
|
202
|
+
SecurityByPassToken: p || void 0,
|
|
203
|
+
Sort: c || void 0,
|
|
204
|
+
UseSession: S || void 0
|
|
205
|
+
}, z = a === "POST";
|
|
189
206
|
try {
|
|
190
207
|
return (await E.request({
|
|
191
|
-
baseURL:
|
|
192
|
-
headers:
|
|
193
|
-
method:
|
|
208
|
+
baseURL: g,
|
|
209
|
+
headers: f ? { Authorization: `Bearer ${f}` } : void 0,
|
|
210
|
+
method: a,
|
|
194
211
|
// POST large RecordID queries as a urlencoded body to dodge the ~2KB URL cap;
|
|
195
212
|
// GET keeps the same fields on the query string.
|
|
196
|
-
...
|
|
213
|
+
...z ? { data: be(k) } : { params: k, paramsSerializer: { indexes: null } },
|
|
197
214
|
responseType: "json",
|
|
198
215
|
transformResponse: [
|
|
199
216
|
...Array.isArray(E.defaults.transformResponse) ? E.defaults.transformResponse : [],
|
|
200
|
-
|
|
201
|
-
items: (
|
|
202
|
-
sort:
|
|
203
|
-
totalCount:
|
|
204
|
-
}) : (
|
|
205
|
-
items: (
|
|
206
|
-
sort:
|
|
207
|
-
totalCount:
|
|
217
|
+
r ? (w) => ({
|
|
218
|
+
items: (w.results?.Items ?? []).map(v),
|
|
219
|
+
sort: w.results?.GlobalInfo?.Sort ?? "",
|
|
220
|
+
totalCount: w.results?.GlobalInfo?.TotalCount ?? 0
|
|
221
|
+
}) : (w) => ({
|
|
222
|
+
items: (w.APIResponse?.Items ?? []).map(v),
|
|
223
|
+
sort: w.APIResponse?.GlobalInfo?.Sort ?? "",
|
|
224
|
+
totalCount: w.APIResponse?.GlobalInfo?.TotalCount ?? 0
|
|
208
225
|
})
|
|
209
226
|
],
|
|
210
|
-
url:
|
|
227
|
+
url: r ? Nt.SEARCH_ASSETS : Yt["4.0"]
|
|
211
228
|
})).data;
|
|
212
229
|
} catch {
|
|
213
230
|
return { items: [], sort: "", totalCount: 0 };
|
|
214
231
|
}
|
|
215
232
|
}
|
|
216
|
-
async function
|
|
233
|
+
async function we({
|
|
217
234
|
assetId: t,
|
|
218
235
|
extension: e,
|
|
219
236
|
format: i,
|
|
@@ -229,7 +246,7 @@ async function Ce({
|
|
|
229
246
|
params: {
|
|
230
247
|
SourceAssetFormat: i,
|
|
231
248
|
SourceAssetRecordID: t,
|
|
232
|
-
TargetExtension:
|
|
249
|
+
TargetExtension: ie(e),
|
|
233
250
|
Token: a || void 0,
|
|
234
251
|
Transformations: r,
|
|
235
252
|
UseSession: n || void 0
|
|
@@ -239,13 +256,13 @@ async function Ce({
|
|
|
239
256
|
*/
|
|
240
257
|
timeout: 3e5,
|
|
241
258
|
// 5 minutes
|
|
242
|
-
url:
|
|
259
|
+
url: Dt.GET_TRANSFORM_ASSET_LINK
|
|
243
260
|
})).data;
|
|
244
261
|
} catch {
|
|
245
262
|
return null;
|
|
246
263
|
}
|
|
247
264
|
}
|
|
248
|
-
const
|
|
265
|
+
const Ce = 50;
|
|
249
266
|
function ke(t, e) {
|
|
250
267
|
const i = [];
|
|
251
268
|
for (let s = 0; s < t.length; s += e)
|
|
@@ -253,139 +270,121 @@ function ke(t, e) {
|
|
|
253
270
|
return i;
|
|
254
271
|
}
|
|
255
272
|
async function Re({
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
273
|
+
consistency: t,
|
|
274
|
+
extraFields: e,
|
|
275
|
+
getPermanentAssetsPaths: i,
|
|
276
|
+
isSiteBuilder: s,
|
|
277
|
+
recordIds: a,
|
|
278
|
+
securityByPassToken: r,
|
|
279
|
+
token: n
|
|
262
280
|
}) {
|
|
263
|
-
if (!Array.isArray(
|
|
281
|
+
if (!Array.isArray(a) || a.length === 0)
|
|
264
282
|
return { facets: [], items: [], totalCount: 0 };
|
|
265
|
-
const
|
|
266
|
-
...
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
countPerPage:
|
|
276
|
-
fields:
|
|
277
|
-
getPermanentAssetsPaths:
|
|
278
|
-
httpMethod:
|
|
279
|
-
isSiteBuilder:
|
|
283
|
+
const l = e?.filter((d) => d && typeof d == "string") ?? [], p = [
|
|
284
|
+
...l,
|
|
285
|
+
st,
|
|
286
|
+
Rt,
|
|
287
|
+
xe,
|
|
288
|
+
ft
|
|
289
|
+
], g = ke(a, Ce), c = await Promise.all(
|
|
290
|
+
g.map(
|
|
291
|
+
(d) => Xt({
|
|
292
|
+
consistency: t,
|
|
293
|
+
countPerPage: d.length,
|
|
294
|
+
fields: p,
|
|
295
|
+
getPermanentAssetsPaths: i,
|
|
296
|
+
httpMethod: s ? "GET" : "POST",
|
|
297
|
+
isSiteBuilder: s,
|
|
280
298
|
pageNumber: 1,
|
|
281
|
-
query: { recordId:
|
|
282
|
-
securityByPassToken:
|
|
283
|
-
token:
|
|
299
|
+
query: { recordId: d },
|
|
300
|
+
securityByPassToken: r,
|
|
301
|
+
token: n
|
|
284
302
|
})
|
|
285
303
|
)
|
|
286
|
-
),
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
{}
|
|
298
|
-
)
|
|
299
|
-
};
|
|
300
|
-
}).sort(
|
|
301
|
-
(p, y) => (c.get(p.recordId) ?? 1 / 0) - (c.get(y.recordId) ?? 1 / 0)
|
|
302
|
-
), A = g.reduce(
|
|
303
|
-
(p, y) => p + y.totalCount,
|
|
304
|
+
), f = new Map(a.map((d, v) => [d, v])), S = c.flatMap((d) => d.items).map((d) => ({
|
|
305
|
+
name: H(d, st),
|
|
306
|
+
recordId: H(d, ft),
|
|
307
|
+
...l.reduce(
|
|
308
|
+
(v, k) => Qt(v, d, k),
|
|
309
|
+
{}
|
|
310
|
+
)
|
|
311
|
+
})).sort(
|
|
312
|
+
(d, v) => (f.get(d.recordId) ?? 1 / 0) - (f.get(v.recordId) ?? 1 / 0)
|
|
313
|
+
), x = c.reduce(
|
|
314
|
+
(d, v) => d + v.totalCount,
|
|
304
315
|
0
|
|
305
316
|
);
|
|
306
|
-
return { facets: [], items:
|
|
307
|
-
}
|
|
308
|
-
function _(t, e) {
|
|
309
|
-
const i = t[e];
|
|
310
|
-
return i == null ? "" : typeof i == "string" ? i : typeof i == "number" || typeof i == "boolean" ? String(i) : Qt(i) ? i.URI : "";
|
|
317
|
+
return { facets: [], items: S, totalCount: x };
|
|
311
318
|
}
|
|
312
|
-
function
|
|
319
|
+
function H(t, e) {
|
|
313
320
|
const i = t[e];
|
|
314
|
-
|
|
315
|
-
return typeof i.Width == "number" && i.Width > 0 ? i.Width : void 0;
|
|
321
|
+
return i == null ? "" : typeof i == "string" ? i : typeof i == "number" || typeof i == "boolean" ? String(i) : qt(i) ? i.URI : "";
|
|
316
322
|
}
|
|
317
323
|
async function $e({
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
324
|
+
consistency: t,
|
|
325
|
+
countPerPage: e,
|
|
326
|
+
directParentFolderIdentifier: i,
|
|
327
|
+
extraFields: s,
|
|
328
|
+
getPermanentAssetsPaths: a,
|
|
329
|
+
isSiteBuilder: r,
|
|
330
|
+
limitedDocTypes: n,
|
|
331
|
+
pageNumber: l,
|
|
332
|
+
parentFolderIdentifier: p,
|
|
333
|
+
searchTerm: g,
|
|
334
|
+
securityByPassToken: c,
|
|
335
|
+
sortOrder: f,
|
|
336
|
+
token: S
|
|
330
337
|
}) {
|
|
331
|
-
if (!
|
|
338
|
+
if (!i && !p)
|
|
332
339
|
return { facets: [], items: [], totalCount: 0 };
|
|
333
|
-
const
|
|
334
|
-
directParentFolderIdentifier:
|
|
335
|
-
parentFolderIdentifier:
|
|
336
|
-
...
|
|
337
|
-
},
|
|
338
|
-
|
|
340
|
+
const x = (s?.filter((z) => z && typeof z == "string") ?? []).map((z) => z.replace("%20", " ")), d = {
|
|
341
|
+
directParentFolderIdentifier: i,
|
|
342
|
+
parentFolderIdentifier: p,
|
|
343
|
+
...n && n.length > 0 ? { docType: n } : {}
|
|
344
|
+
}, v = await Xt({
|
|
345
|
+
consistency: t,
|
|
346
|
+
countPerPage: e,
|
|
339
347
|
fields: [
|
|
340
|
-
...
|
|
341
|
-
Xt,
|
|
348
|
+
...x,
|
|
342
349
|
gt,
|
|
343
|
-
ft,
|
|
344
350
|
mt,
|
|
345
351
|
ut,
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
St
|
|
352
|
+
Ht,
|
|
353
|
+
Et,
|
|
354
|
+
nt,
|
|
355
|
+
ft,
|
|
356
|
+
st
|
|
352
357
|
],
|
|
353
|
-
getPermanentAssetsPaths:
|
|
354
|
-
isSiteBuilder:
|
|
355
|
-
pageNumber:
|
|
356
|
-
query:
|
|
357
|
-
securityByPassToken:
|
|
358
|
+
getPermanentAssetsPaths: a,
|
|
359
|
+
isSiteBuilder: r,
|
|
360
|
+
pageNumber: l,
|
|
361
|
+
query: d,
|
|
362
|
+
securityByPassToken: c,
|
|
358
363
|
sort: void 0,
|
|
359
|
-
token:
|
|
360
|
-
}),
|
|
361
|
-
let
|
|
362
|
-
|
|
363
|
-
const
|
|
364
|
+
token: S
|
|
365
|
+
}), k = v.items.map((z) => {
|
|
366
|
+
let P = H(z, nt);
|
|
367
|
+
P && !P.startsWith(".") && (P = "." + P);
|
|
368
|
+
const w = H(z, ft);
|
|
364
369
|
return {
|
|
365
|
-
docSubType:
|
|
366
|
-
docType:
|
|
367
|
-
extension:
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
...A.reduce(
|
|
376
|
-
(L, et) => {
|
|
377
|
-
L[et] = _(u, et);
|
|
378
|
-
const nt = Yt(u, et);
|
|
379
|
-
return nt !== void 0 && (L[`${et}${_t}`] = String(nt)), L;
|
|
380
|
-
},
|
|
370
|
+
docSubType: H(z, Ht),
|
|
371
|
+
docType: H(z, ut) || "",
|
|
372
|
+
extension: P,
|
|
373
|
+
id: w,
|
|
374
|
+
identifier: H(z, Et),
|
|
375
|
+
name: H(z, st),
|
|
376
|
+
recordId: w,
|
|
377
|
+
size: H(z, mt) || "0 MB",
|
|
378
|
+
...x.reduce(
|
|
379
|
+
(tt, et) => Qt(tt, z, et),
|
|
381
380
|
{}
|
|
382
381
|
)
|
|
383
382
|
};
|
|
384
383
|
});
|
|
385
384
|
return {
|
|
386
385
|
facets: [],
|
|
387
|
-
items:
|
|
388
|
-
totalCount:
|
|
386
|
+
items: k,
|
|
387
|
+
totalCount: v.totalCount
|
|
389
388
|
};
|
|
390
389
|
}
|
|
391
390
|
async function Pe({
|
|
@@ -417,13 +416,13 @@ async function Pe({
|
|
|
417
416
|
y: n.cropY
|
|
418
417
|
})
|
|
419
418
|
],
|
|
420
|
-
url:
|
|
419
|
+
url: Dt.GET_CROP_ZONE_SUGGESTION
|
|
421
420
|
})).data;
|
|
422
421
|
} catch {
|
|
423
422
|
return null;
|
|
424
423
|
}
|
|
425
424
|
}
|
|
426
|
-
async function
|
|
425
|
+
async function Gi({
|
|
427
426
|
assetRecordId: t,
|
|
428
427
|
isSiteBuilder: e,
|
|
429
428
|
siteUrl: i,
|
|
@@ -454,13 +453,13 @@ async function ji({
|
|
|
454
453
|
width: l.width
|
|
455
454
|
})) ?? []
|
|
456
455
|
],
|
|
457
|
-
url: e ?
|
|
456
|
+
url: e ? Nt.GET_AVAILABLE_PROXIES : ee
|
|
458
457
|
})).data;
|
|
459
458
|
} catch {
|
|
460
459
|
return [];
|
|
461
460
|
}
|
|
462
461
|
}
|
|
463
|
-
async function
|
|
462
|
+
async function Qi({
|
|
464
463
|
siteUrl: t
|
|
465
464
|
} = {}) {
|
|
466
465
|
try {
|
|
@@ -481,13 +480,13 @@ async function Vi({
|
|
|
481
480
|
formatsByDocType: i.formatsByDocType ?? {}
|
|
482
481
|
}
|
|
483
482
|
],
|
|
484
|
-
url:
|
|
483
|
+
url: Jt
|
|
485
484
|
})).data;
|
|
486
485
|
} catch {
|
|
487
486
|
return { formatsByDocType: {} };
|
|
488
487
|
}
|
|
489
488
|
}
|
|
490
|
-
async function
|
|
489
|
+
async function Xi({
|
|
491
490
|
recordIds: t,
|
|
492
491
|
rightsToCheck: e
|
|
493
492
|
}) {
|
|
@@ -503,14 +502,14 @@ async function Gi({
|
|
|
503
502
|
params: { RecordIDs: t, RightsToCheck: e },
|
|
504
503
|
paramsSerializer: { indexes: null },
|
|
505
504
|
responseType: "json",
|
|
506
|
-
url:
|
|
505
|
+
url: te.GET_AUTHORIZED_OBJECTS
|
|
507
506
|
});
|
|
508
507
|
return s;
|
|
509
508
|
} catch {
|
|
510
509
|
return i;
|
|
511
510
|
}
|
|
512
511
|
}
|
|
513
|
-
const
|
|
512
|
+
const vt = 20, it = "TR1", xt = "TRX", Fe = /* @__PURE__ */ new Set([".gif"]), _e = /* @__PURE__ */ new Set([
|
|
514
513
|
".avif",
|
|
515
514
|
".bmp",
|
|
516
515
|
".gif",
|
|
@@ -525,7 +524,7 @@ function Me(t) {
|
|
|
525
524
|
const e = t.toLowerCase(), i = e.startsWith(".") ? e : `.${e}`;
|
|
526
525
|
return _e.has(i);
|
|
527
526
|
}
|
|
528
|
-
function
|
|
527
|
+
function Wt({
|
|
529
528
|
autoFormat: t,
|
|
530
529
|
buildSrcset: e,
|
|
531
530
|
extension: i,
|
|
@@ -534,39 +533,40 @@ function Lt({
|
|
|
534
533
|
manualFormat: r,
|
|
535
534
|
size: n
|
|
536
535
|
}) {
|
|
537
|
-
const l = i?.toLowerCase() ?? "",
|
|
538
|
-
const
|
|
539
|
-
if (!
|
|
536
|
+
const l = i?.toLowerCase() ?? "", p = l.startsWith(".") ? l : `.${l}`, g = `path_${it}`, c = (x, d) => {
|
|
537
|
+
const v = a[x];
|
|
538
|
+
if (!v)
|
|
540
539
|
return;
|
|
541
|
-
const
|
|
540
|
+
const k = a[`${x}${jt}`], z = a[`${x}${Vt}`], P = t ? bt(v, [], {
|
|
542
541
|
autoFormat: !r,
|
|
543
542
|
extension: l,
|
|
544
|
-
format:
|
|
545
|
-
}) :
|
|
543
|
+
format: d
|
|
544
|
+
}) : v;
|
|
546
545
|
return {
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
546
|
+
maxHeight: z,
|
|
547
|
+
maxWidth: k,
|
|
548
|
+
src: P,
|
|
549
|
+
srcset: e ? se(P, {
|
|
550
550
|
extension: l,
|
|
551
|
-
format:
|
|
552
|
-
maxWidth:
|
|
551
|
+
format: d,
|
|
552
|
+
maxWidth: ae(r, k)
|
|
553
553
|
}) : ""
|
|
554
554
|
};
|
|
555
555
|
};
|
|
556
556
|
if (!r) {
|
|
557
|
-
const
|
|
558
|
-
return c(
|
|
557
|
+
const x = Lt(l, n), d = `path_${x}`;
|
|
558
|
+
return c(d, x) ?? c(g, it) ?? {};
|
|
559
559
|
}
|
|
560
|
-
const
|
|
561
|
-
return
|
|
560
|
+
const f = s ? `path_${s}` : void 0;
|
|
561
|
+
return f && a[f] ? c(f, s) ?? {} : !!l && Fe.has(p) ? c(`path_${xt}`, xt) ?? c(g, it) ?? {} : c(g, it) ?? {};
|
|
562
562
|
}
|
|
563
|
-
class
|
|
563
|
+
class Zi {
|
|
564
564
|
constructor(e, i) {
|
|
565
|
-
this.data = [], this.folderId = "", this.fetchedPages = /* @__PURE__ */ new Set(), this.totalCount = 0, this.maxEnd = 1 / 0, this.pageSize =
|
|
565
|
+
this.data = [], this.folderId = "", this.fetchedPages = /* @__PURE__ */ new Set(), this.totalCount = 0, this.maxEnd = 1 / 0, this.pageSize = vt, this.requestEpoch = 0, this.host = e, this.host.addController?.(this);
|
|
566
566
|
const s = i?.maxEnd;
|
|
567
567
|
this.maxEnd = typeof s == "number" && Number.isFinite(s) && s >= 0 ? Math.floor(s) : 1 / 0;
|
|
568
568
|
const a = i?.pageSize;
|
|
569
|
-
this.pageSize = typeof a == "number" && Number.isFinite(a) && a >= 1 ? Math.floor(a) :
|
|
569
|
+
this.pageSize = typeof a == "number" && Number.isFinite(a) && a >= 1 ? Math.floor(a) : vt, this.authToken = i?.token, this.securityByPassToken = i?.securityByPassToken, this.isSiteBuilder = i?.isSiteBuilder ?? !1, this.autoFormat = i?.autoFormat ?? !1, this.buildSrcset = i?.buildSrcset ?? !1, this.consistency = i?.consistency;
|
|
570
570
|
}
|
|
571
571
|
get totalDataCount() {
|
|
572
572
|
return this.totalCount;
|
|
@@ -584,7 +584,7 @@ class Qi {
|
|
|
584
584
|
* Shrinking is ignored once pages are cached: collapsing already has what it needs.
|
|
585
585
|
*/
|
|
586
586
|
setPageSize(e) {
|
|
587
|
-
const i = Number.isFinite(e) && e >= 1 ? Math.floor(e) :
|
|
587
|
+
const i = Number.isFinite(e) && e >= 1 ? Math.floor(e) : vt;
|
|
588
588
|
if (this.pageSize === i)
|
|
589
589
|
return;
|
|
590
590
|
const s = this.fetchedPages.size > 0;
|
|
@@ -605,24 +605,25 @@ class Qi {
|
|
|
605
605
|
const l = this.requestEpoch;
|
|
606
606
|
if (!this.folderId || l !== this.requestEpoch)
|
|
607
607
|
return this.data;
|
|
608
|
-
const
|
|
608
|
+
const p = s ? `path_${s}` : void 0, g = `path_${it}`, c = `path_${xt}`, f = [
|
|
609
609
|
...new Set(
|
|
610
|
-
[
|
|
611
|
-
(
|
|
610
|
+
[p, g, c].filter(
|
|
611
|
+
(d) => !!d
|
|
612
612
|
)
|
|
613
613
|
)
|
|
614
|
-
],
|
|
615
|
-
for (let
|
|
616
|
-
if (this.fetchedPages.has(
|
|
614
|
+
], S = Math.floor(r / this.pageSize) + 1, x = Math.floor(e / this.pageSize) + 1;
|
|
615
|
+
for (let d = S; d <= x; d++) {
|
|
616
|
+
if (this.fetchedPages.has(d))
|
|
617
617
|
continue;
|
|
618
|
-
const
|
|
618
|
+
const v = await $e({
|
|
619
|
+
consistency: this.consistency,
|
|
619
620
|
countPerPage: this.pageSize,
|
|
620
621
|
directParentFolderIdentifier: this.folderId,
|
|
621
|
-
extraFields: [...i, ...
|
|
622
|
+
extraFields: [...i, ...f],
|
|
622
623
|
getPermanentAssetsPaths: !0,
|
|
623
624
|
isSiteBuilder: this.isSiteBuilder,
|
|
624
625
|
limitedDocTypes: [ct.Image, ct.Audio, ct.Video, ct.Multimedia],
|
|
625
|
-
pageNumber:
|
|
626
|
+
pageNumber: d,
|
|
626
627
|
searchTerm: "",
|
|
627
628
|
securityByPassToken: this.securityByPassToken,
|
|
628
629
|
sortOrder: "",
|
|
@@ -630,44 +631,46 @@ class Qi {
|
|
|
630
631
|
});
|
|
631
632
|
if (l !== this.requestEpoch)
|
|
632
633
|
return this.data;
|
|
633
|
-
if (this.fetchedPages.add(
|
|
634
|
-
const
|
|
635
|
-
this.totalCount =
|
|
634
|
+
if (this.fetchedPages.add(d), !this.totalCount && v.totalCount) {
|
|
635
|
+
const z = Math.min(this.maxEnd, v.totalCount);
|
|
636
|
+
this.totalCount = z, this.data = Array.from({ length: z }, () => ({
|
|
636
637
|
alt: "",
|
|
637
|
-
id: `temp-${
|
|
638
|
+
id: `temp-${re()}`,
|
|
638
639
|
name: "",
|
|
639
640
|
src: ""
|
|
640
641
|
}));
|
|
641
642
|
}
|
|
642
|
-
const
|
|
643
|
-
for (let
|
|
644
|
-
const
|
|
645
|
-
if (
|
|
646
|
-
const
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
643
|
+
const k = (d - 1) * this.pageSize;
|
|
644
|
+
for (let z = 0; z < v.items.length; z++) {
|
|
645
|
+
const P = k + z;
|
|
646
|
+
if (P < this.data.length) {
|
|
647
|
+
const w = v.items[z], {
|
|
648
|
+
maxHeight: tt,
|
|
649
|
+
maxWidth: et,
|
|
650
|
+
src: Zt,
|
|
651
|
+
srcset: Kt
|
|
652
|
+
} = Wt({
|
|
651
653
|
autoFormat: this.autoFormat,
|
|
652
654
|
buildSrcset: this.buildSrcset,
|
|
653
|
-
extension:
|
|
655
|
+
extension: w.extension,
|
|
654
656
|
format: s,
|
|
655
|
-
item:
|
|
657
|
+
item: w,
|
|
656
658
|
manualFormat: a,
|
|
657
|
-
size:
|
|
659
|
+
size: w.size
|
|
658
660
|
});
|
|
659
|
-
let ht =
|
|
660
|
-
ht && n && n.length > 0 && (ht =
|
|
661
|
-
alt:
|
|
662
|
-
docType:
|
|
663
|
-
extension:
|
|
664
|
-
id:
|
|
665
|
-
|
|
666
|
-
|
|
661
|
+
let ht = Zt, Pt = Kt;
|
|
662
|
+
ht && n && n.length > 0 && (ht = bt(ht, n), Pt = ""), this.data[P] = {
|
|
663
|
+
alt: w.name,
|
|
664
|
+
docType: w.docType,
|
|
665
|
+
extension: w.extension,
|
|
666
|
+
id: w.id,
|
|
667
|
+
maxHeight: tt,
|
|
668
|
+
maxWidth: et,
|
|
669
|
+
name: w.name,
|
|
667
670
|
src: ht,
|
|
668
|
-
srcset:
|
|
671
|
+
srcset: Pt,
|
|
669
672
|
...i.reduce(
|
|
670
|
-
(
|
|
673
|
+
(Ft, _t) => (Ft[_t] = w[_t] ?? "", Ft),
|
|
671
674
|
{}
|
|
672
675
|
)
|
|
673
676
|
};
|
|
@@ -683,34 +686,30 @@ class Qi {
|
|
|
683
686
|
format: r,
|
|
684
687
|
manualFormat: n = !0,
|
|
685
688
|
minLimit: l = 5,
|
|
686
|
-
noPlaceholders:
|
|
689
|
+
noPlaceholders: p = !1,
|
|
687
690
|
transformations: g
|
|
688
691
|
}) {
|
|
689
692
|
(!this.folderId || this.folderId !== s) && (this.folderId = s, this.resetFolderState()), a && this.resetPageCache();
|
|
690
|
-
const c = Math.max(5, l),
|
|
691
|
-
...i,
|
|
692
|
-
ft,
|
|
693
|
-
gt
|
|
694
|
-
];
|
|
693
|
+
const c = Math.max(5, l), f = e, S = e + c, x = [...i];
|
|
695
694
|
await this.fetchImages({
|
|
696
|
-
end:
|
|
697
|
-
extraFields:
|
|
695
|
+
end: S,
|
|
696
|
+
extraFields: x.filter((k) => k !== ""),
|
|
698
697
|
format: r,
|
|
699
698
|
manualFormat: n,
|
|
700
|
-
start:
|
|
699
|
+
start: f,
|
|
701
700
|
transformations: g
|
|
702
701
|
});
|
|
703
|
-
let
|
|
704
|
-
|
|
705
|
-
const
|
|
702
|
+
let d = e - c;
|
|
703
|
+
d < 0 && (this.totalCount === 0 ? d = 0 : d = Math.max(0, this.totalCount + d));
|
|
704
|
+
const v = d + c;
|
|
706
705
|
return await this.fetchImages({
|
|
707
|
-
end:
|
|
708
|
-
extraFields:
|
|
706
|
+
end: v,
|
|
707
|
+
extraFields: x.filter((k) => k !== ""),
|
|
709
708
|
format: r,
|
|
710
709
|
manualFormat: n,
|
|
711
|
-
start:
|
|
710
|
+
start: d,
|
|
712
711
|
transformations: g
|
|
713
|
-
}),
|
|
712
|
+
}), p ? this.data.filter((k) => k.id && !k.id.startsWith("temp-")) : this.data;
|
|
714
713
|
}
|
|
715
714
|
async fetchImagesByIDs({
|
|
716
715
|
extraFields: e = [],
|
|
@@ -721,51 +720,49 @@ class Qi {
|
|
|
721
720
|
}) {
|
|
722
721
|
if (a.length === 0)
|
|
723
722
|
return [];
|
|
724
|
-
const n = i ? `path_${i}` : void 0, l = `path_${it}`,
|
|
723
|
+
const n = i ? `path_${i}` : void 0, l = `path_${it}`, p = `path_${xt}`, g = [
|
|
725
724
|
...new Set(
|
|
726
|
-
[n, l,
|
|
727
|
-
(
|
|
725
|
+
[n, l, p].filter(
|
|
726
|
+
(x) => !!x
|
|
728
727
|
)
|
|
729
728
|
)
|
|
730
|
-
], c = [
|
|
731
|
-
...e,
|
|
732
|
-
ut,
|
|
733
|
-
ft,
|
|
734
|
-
gt
|
|
735
|
-
];
|
|
729
|
+
], c = [nt, mt], f = [...e, ut];
|
|
736
730
|
return (await Re({
|
|
737
|
-
|
|
731
|
+
consistency: this.consistency,
|
|
732
|
+
extraFields: [...f, ...g, ...c].filter((x) => x !== ""),
|
|
738
733
|
getPermanentAssetsPaths: !0,
|
|
739
734
|
isSiteBuilder: this.isSiteBuilder,
|
|
740
735
|
recordIds: a,
|
|
741
736
|
securityByPassToken: this.securityByPassToken,
|
|
742
737
|
token: this.authToken
|
|
743
|
-
})).items.map((
|
|
738
|
+
})).items.map((x) => {
|
|
744
739
|
const {
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
740
|
+
maxHeight: d,
|
|
741
|
+
maxWidth: v,
|
|
742
|
+
src: k,
|
|
743
|
+
srcset: z
|
|
744
|
+
} = Wt({
|
|
749
745
|
autoFormat: this.autoFormat,
|
|
750
746
|
buildSrcset: this.buildSrcset,
|
|
751
|
-
extension:
|
|
747
|
+
extension: x[nt],
|
|
752
748
|
format: i,
|
|
753
|
-
item:
|
|
749
|
+
item: x,
|
|
754
750
|
manualFormat: s,
|
|
755
|
-
size:
|
|
751
|
+
size: x[mt]
|
|
756
752
|
});
|
|
757
|
-
let
|
|
758
|
-
return
|
|
759
|
-
alt:
|
|
760
|
-
docType:
|
|
761
|
-
extension:
|
|
762
|
-
id:
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
753
|
+
let P = k, w = z;
|
|
754
|
+
return P && r && r.length > 0 && (P = bt(P, r), w = ""), {
|
|
755
|
+
alt: x.name,
|
|
756
|
+
docType: x[ut],
|
|
757
|
+
extension: x[nt] || "",
|
|
758
|
+
id: x.recordId,
|
|
759
|
+
maxHeight: d,
|
|
760
|
+
maxWidth: v,
|
|
761
|
+
name: x.name,
|
|
762
|
+
src: P,
|
|
763
|
+
srcset: w,
|
|
764
|
+
...f.reduce(
|
|
765
|
+
(tt, et) => (tt[et] = x[et] ?? "", tt),
|
|
769
766
|
{}
|
|
770
767
|
)
|
|
771
768
|
};
|
|
@@ -779,19 +776,19 @@ class Qi {
|
|
|
779
776
|
manualFormat: r = !0,
|
|
780
777
|
noPlaceholders: n = !1,
|
|
781
778
|
page: l,
|
|
782
|
-
pageSize:
|
|
779
|
+
pageSize: p = 10,
|
|
783
780
|
transformations: g
|
|
784
781
|
}) {
|
|
785
782
|
(!this.folderId || this.folderId !== i) && (this.folderId = i, this.resetFolderState()), s && this.resetPageCache();
|
|
786
|
-
const c = l *
|
|
783
|
+
const c = l * p, f = c + p - 1;
|
|
787
784
|
return await this.fetchImages({
|
|
788
|
-
end:
|
|
785
|
+
end: f,
|
|
789
786
|
extraFields: e,
|
|
790
787
|
format: a,
|
|
791
788
|
manualFormat: r,
|
|
792
789
|
start: c,
|
|
793
790
|
transformations: g
|
|
794
|
-
}), n ? this.data.filter((
|
|
791
|
+
}), n ? this.data.filter((S) => S.id && !S.id.startsWith("temp-")) : this.data;
|
|
795
792
|
}
|
|
796
793
|
async *fetchImagesInFolderByChunk({
|
|
797
794
|
chunkSize: e = 10,
|
|
@@ -801,7 +798,7 @@ class Qi {
|
|
|
801
798
|
forceRefetch: r = !1,
|
|
802
799
|
format: n,
|
|
803
800
|
manualFormat: l = !0,
|
|
804
|
-
start:
|
|
801
|
+
start: p = 0,
|
|
805
802
|
transformations: g
|
|
806
803
|
}) {
|
|
807
804
|
const c = Math.max(1, e);
|
|
@@ -811,27 +808,27 @@ class Qi {
|
|
|
811
808
|
extraFields: s,
|
|
812
809
|
format: n,
|
|
813
810
|
manualFormat: l,
|
|
814
|
-
start:
|
|
811
|
+
start: p,
|
|
815
812
|
transformations: g
|
|
816
813
|
}), yield this.data;
|
|
817
814
|
return;
|
|
818
815
|
}
|
|
819
|
-
let
|
|
816
|
+
let f = p, S = p + c;
|
|
820
817
|
if (await this.fetchImages({
|
|
821
|
-
end:
|
|
818
|
+
end: S,
|
|
822
819
|
extraFields: s,
|
|
823
820
|
format: n,
|
|
824
821
|
manualFormat: l,
|
|
825
|
-
start:
|
|
822
|
+
start: f,
|
|
826
823
|
transformations: g
|
|
827
|
-
}), yield this.data, !(!this.totalCount || this.totalCount <=
|
|
828
|
-
for (;
|
|
829
|
-
|
|
830
|
-
end:
|
|
824
|
+
}), yield this.data, !(!this.totalCount || this.totalCount <= S))
|
|
825
|
+
for (; S < this.totalCount; )
|
|
826
|
+
f = S, S = Math.min(S + c, this.totalCount), await this.fetchImages({
|
|
827
|
+
end: S,
|
|
831
828
|
extraFields: s,
|
|
832
829
|
format: n,
|
|
833
830
|
manualFormat: l,
|
|
834
|
-
start:
|
|
831
|
+
start: f,
|
|
835
832
|
transformations: g
|
|
836
833
|
}), yield this.data;
|
|
837
834
|
}
|
|
@@ -847,15 +844,15 @@ class Qi {
|
|
|
847
844
|
this.resetPageCache();
|
|
848
845
|
}
|
|
849
846
|
}
|
|
850
|
-
const Ie =
|
|
851
|
-
var
|
|
852
|
-
for (var a = s > 1 ? void 0 : s ?
|
|
847
|
+
const Ie = j`.asset-link-format__details{--header-padding:var(--cx-spacing-small) var(--cx-spacing-medium)}.asset-link-format__details::part(icon){width:var(--cx-font-size-3x-large);height:var(--cx-font-size-3x-large);background-color:var(--cx-color-neutral-100);border-radius:var(--cx-border-radius-large);color:var(--cx-color-neutral-600);font-size:var(--cx-font-size-large);justify-content:center;align-items:center;display:flex}.asset-link-format__details::part(input-label){color:var(--cx-color-neutral-400);margin-inline-start:var(--cx-spacing-small)}.asset-link-format__header{padding:var(--cx-spacing-medium)}.asset-link-format__section-header{padding:0 var(--cx-spacing-medium);border-top:var(--section-header-border-width,1px) solid var(--cx-color-neutral-200);background-color:var(--cx-color-neutral-50)}.asset-link-format__undo,.asset-link-format__reset{--color:var(--cx-color-primary);--background-color:transparent}`, Ee = j`cx-details::part(base){border-bottom-width:0}cx-space{width:100%}cx-space cx-input{flex:1}.crop__unit-select{width:120px}.crop__input-group{flex:1;display:flex}`;
|
|
848
|
+
var He = Object.defineProperty, Te = Object.getOwnPropertyDescriptor, b = (t, e, i, s) => {
|
|
849
|
+
for (var a = s > 1 ? void 0 : s ? Te(e, i) : e, r = t.length - 1, n; r >= 0; r--)
|
|
853
850
|
(n = t[r]) && (a = (s ? n(e, i, a) : n(a)) || a);
|
|
854
|
-
return s && a &&
|
|
851
|
+
return s && a && He(e, i, a), a;
|
|
855
852
|
};
|
|
856
|
-
let
|
|
853
|
+
let A = class extends q {
|
|
857
854
|
constructor() {
|
|
858
|
-
super(...arguments), this.localize = new
|
|
855
|
+
super(...arguments), this.localize = new V(this), this.open = !1, this.width = 0, this.height = 0, this.maxWidth = 0, this.maxHeight = 0, this.ratioWidth = 1, this.ratioHeight = 1, this.percentageWidth = 0, this.percentageHeight = 0, this.unit = o.Pixel, this.disabledApply = !1, this.noRatioModes = !1, this.showPositionPicker = !1, this.lastAppliedSetting = {
|
|
859
856
|
[o.Pixel]: {
|
|
860
857
|
height: 0,
|
|
861
858
|
percentageHeight: 100,
|
|
@@ -967,7 +964,7 @@ let v = class extends j {
|
|
|
967
964
|
const [s, a] = e.split(":").map(Number);
|
|
968
965
|
if (this.unit === o.Pixel) {
|
|
969
966
|
let r = s, n = a;
|
|
970
|
-
Number.isFinite(this.maxWidth) && Number.isFinite(this.maxHeight) && ({ height: n, width: r } =
|
|
967
|
+
Number.isFinite(this.maxWidth) && Number.isFinite(this.maxHeight) && ({ height: n, width: r } = he(
|
|
971
968
|
this.maxWidth,
|
|
972
969
|
this.maxHeight,
|
|
973
970
|
s,
|
|
@@ -1085,23 +1082,23 @@ let v = class extends j {
|
|
|
1085
1082
|
}
|
|
1086
1083
|
render() {
|
|
1087
1084
|
const t = this.cropModes.filter((i) => !i.auto), e = this.cropModes.filter((i) => i.auto);
|
|
1088
|
-
return
|
|
1085
|
+
return C`<cx-details class="details" ?open=${this.open} @cx-show=${this.onShowDetails} @cx-hide=${this.onHideDetails}><cx-space slot="summary" align-items="center"><div part="icon"><cx-icon name="crop"></cx-icon></div><cx-typography variant="body2">${this.localize.term("crop")}</cx-typography></cx-space><cx-space direction="vertical" spacing="small">${M(
|
|
1089
1086
|
!this.noRatioModes,
|
|
1090
|
-
() =>
|
|
1087
|
+
() => C`<cx-select data-testid="cx-asset-link-format-crop-mode" value=${this.cropMode} hoist style=${O({
|
|
1091
1088
|
width: "100%"
|
|
1092
|
-
})} @cx-change=${this.onCropModeChange} ?disabled=${this.loading}>${
|
|
1089
|
+
})} @cx-change=${this.onCropModeChange} ?disabled=${this.loading}>${rt(
|
|
1093
1090
|
t,
|
|
1094
1091
|
(i) => i.value,
|
|
1095
|
-
({ label: i, value: s }) =>
|
|
1092
|
+
({ label: i, value: s }) => C`<cx-option value=${s}>${i}</cx-option>`
|
|
1096
1093
|
)}
|
|
1097
1094
|
${M(
|
|
1098
1095
|
e.length > 0,
|
|
1099
|
-
() =>
|
|
1096
|
+
() => C`<cx-divider></cx-divider><small>${this.localize.term("autoCropping")}</small>`
|
|
1100
1097
|
)}
|
|
1101
|
-
${
|
|
1098
|
+
${rt(
|
|
1102
1099
|
e,
|
|
1103
1100
|
(i) => i.value,
|
|
1104
|
-
({ label: i, value: s }) =>
|
|
1101
|
+
({ label: i, value: s }) => C`<cx-option value=${s}>${i}</cx-option>`
|
|
1105
1102
|
)}</cx-select>`
|
|
1106
1103
|
)}<cx-space spacing="small"><div class="crop__input-group"><cx-input data-testid="cx-asset-link-format-crop-width" placeholder=${this.localize.term("width")} mask="num" .maskBlocks=${{ num: { mask: Number, min: 1 } }} value=${this.unit === o.Pixel ? this.width.toString() : this.ratioWidth.toString()} @cx-change=${this.handleInputChange} @cx-input=${this.handleWidthChange} required ?disabled=${this.loading}><cx-typography slot="prefix" variant="body3" part="input-label">
|
|
1107
1104
|
W
|
|
@@ -1111,138 +1108,138 @@ let v = class extends j {
|
|
|
1111
1108
|
H
|
|
1112
1109
|
</cx-typography></cx-input></div>${M(
|
|
1113
1110
|
!this.noRatioModes,
|
|
1114
|
-
() =>
|
|
1111
|
+
() => 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=${o.Pixel}>${this.localize.term("pixels")}</cx-option><cx-option value=${o.AspectRatio}>${this.localize.term("aspectRatio")}</cx-option></cx-select>`
|
|
1115
1112
|
)}</cx-space>${M(
|
|
1116
1113
|
this.focusModes.length > 0,
|
|
1117
|
-
() =>
|
|
1114
|
+
() => C`<cx-select data-testid="cx-asset-link-format-crop-focus-mode" value=${this.focusMode} hoist style=${O({
|
|
1118
1115
|
width: "100%"
|
|
1119
|
-
})} @cx-change=${this.onFocusModeChange} ?disabled=${this.loading || this.selectedMode?.disabledSize}>${
|
|
1116
|
+
})} @cx-change=${this.onFocusModeChange} ?disabled=${this.loading || this.selectedMode?.disabledSize}>${rt(
|
|
1120
1117
|
this.focusModes,
|
|
1121
1118
|
(i) => i.value,
|
|
1122
|
-
({ label: i, value: s }) =>
|
|
1119
|
+
({ label: i, value: s }) => C`<cx-option value=${s}>${i}</cx-option>`
|
|
1123
1120
|
)}</cx-select>`
|
|
1124
1121
|
)}
|
|
1125
1122
|
${M(
|
|
1126
1123
|
this.showPositionPicker && this.focusMode === "manual",
|
|
1127
|
-
() =>
|
|
1124
|
+
() => C`<cx-position-picker data-testid="cx-asset-link-format-crop-position" value=${this.position} @cx-change=${this.onPositionChange}></cx-position-picker>`
|
|
1128
1125
|
)}<cx-button data-testid="cx-asset-link-format-crop-apply" variant="primary" ?disabled=${this.disabledApply || this.invalidHeight || this.invalidWidth} ?loading=${this.loading} style=${O({
|
|
1129
1126
|
marginLeft: "auto"
|
|
1130
1127
|
})} @click=${this.handleApply}>${this.localize.term("apply")}</cx-button></cx-space></cx-details>`;
|
|
1131
1128
|
}
|
|
1132
1129
|
};
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
"cx-button":
|
|
1136
|
-
"cx-details":
|
|
1137
|
-
"cx-divider":
|
|
1138
|
-
"cx-icon":
|
|
1139
|
-
"cx-icon-button":
|
|
1140
|
-
"cx-input":
|
|
1141
|
-
"cx-option":
|
|
1142
|
-
"cx-position-picker":
|
|
1143
|
-
"cx-select":
|
|
1144
|
-
"cx-space":
|
|
1145
|
-
"cx-typography":
|
|
1130
|
+
A.styles = [G, Ee];
|
|
1131
|
+
A.dependencies = {
|
|
1132
|
+
"cx-button": K,
|
|
1133
|
+
"cx-details": at,
|
|
1134
|
+
"cx-divider": Ut,
|
|
1135
|
+
"cx-icon": ot,
|
|
1136
|
+
"cx-icon-button": Ct,
|
|
1137
|
+
"cx-input": kt,
|
|
1138
|
+
"cx-option": yt,
|
|
1139
|
+
"cx-position-picker": ne,
|
|
1140
|
+
"cx-select": St,
|
|
1141
|
+
"cx-space": U,
|
|
1142
|
+
"cx-typography": B
|
|
1146
1143
|
};
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
],
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
],
|
|
1153
|
-
|
|
1144
|
+
b([
|
|
1145
|
+
Y(".details")
|
|
1146
|
+
], A.prototype, "base", 2);
|
|
1147
|
+
b([
|
|
1148
|
+
Y("cx-position-picker")
|
|
1149
|
+
], A.prototype, "positionPicker", 2);
|
|
1150
|
+
b([
|
|
1154
1151
|
h({ reflect: !0, type: Boolean })
|
|
1155
|
-
],
|
|
1156
|
-
|
|
1152
|
+
], A.prototype, "open", 2);
|
|
1153
|
+
b([
|
|
1157
1154
|
h({ reflect: !0, type: Number })
|
|
1158
|
-
],
|
|
1159
|
-
|
|
1155
|
+
], A.prototype, "width", 2);
|
|
1156
|
+
b([
|
|
1160
1157
|
h({ reflect: !0, type: Number })
|
|
1161
|
-
],
|
|
1162
|
-
|
|
1158
|
+
], A.prototype, "height", 2);
|
|
1159
|
+
b([
|
|
1163
1160
|
h({ attribute: "max-width", reflect: !0, type: Number })
|
|
1164
|
-
],
|
|
1165
|
-
|
|
1161
|
+
], A.prototype, "maxWidth", 2);
|
|
1162
|
+
b([
|
|
1166
1163
|
h({ attribute: "max-height", reflect: !0, type: Number })
|
|
1167
|
-
],
|
|
1168
|
-
|
|
1164
|
+
], A.prototype, "maxHeight", 2);
|
|
1165
|
+
b([
|
|
1169
1166
|
h({ attribute: "ratio-width", reflect: !0, type: Number })
|
|
1170
|
-
],
|
|
1171
|
-
|
|
1167
|
+
], A.prototype, "ratioWidth", 2);
|
|
1168
|
+
b([
|
|
1172
1169
|
h({ attribute: "ratio-height", reflect: !0, type: Number })
|
|
1173
|
-
],
|
|
1174
|
-
|
|
1170
|
+
], A.prototype, "ratioHeight", 2);
|
|
1171
|
+
b([
|
|
1175
1172
|
h({ attribute: "percentage-width", reflect: !0, type: Number })
|
|
1176
|
-
],
|
|
1177
|
-
|
|
1173
|
+
], A.prototype, "percentageWidth", 2);
|
|
1174
|
+
b([
|
|
1178
1175
|
h({ attribute: "percentage-height", reflect: !0, type: Number })
|
|
1179
|
-
],
|
|
1180
|
-
|
|
1176
|
+
], A.prototype, "percentageHeight", 2);
|
|
1177
|
+
b([
|
|
1181
1178
|
h({ reflect: !0, type: String })
|
|
1182
|
-
],
|
|
1183
|
-
|
|
1179
|
+
], A.prototype, "unit", 2);
|
|
1180
|
+
b([
|
|
1184
1181
|
h({ attribute: "disabled-apply", reflect: !0, type: Boolean })
|
|
1185
|
-
],
|
|
1186
|
-
|
|
1182
|
+
], A.prototype, "disabledApply", 2);
|
|
1183
|
+
b([
|
|
1187
1184
|
h({ attribute: "no-ratio-modes", reflect: !0, type: Boolean })
|
|
1188
|
-
],
|
|
1189
|
-
|
|
1185
|
+
], A.prototype, "noRatioModes", 2);
|
|
1186
|
+
b([
|
|
1190
1187
|
h({ attribute: "show-position-picker", reflect: !0, type: Boolean })
|
|
1191
|
-
],
|
|
1192
|
-
|
|
1188
|
+
], A.prototype, "showPositionPicker", 2);
|
|
1189
|
+
b([
|
|
1193
1190
|
h({ attribute: "last-applied-setting", reflect: !1, type: Object })
|
|
1194
|
-
],
|
|
1195
|
-
|
|
1191
|
+
], A.prototype, "lastAppliedSetting", 2);
|
|
1192
|
+
b([
|
|
1196
1193
|
h({ reflect: !0, type: Boolean })
|
|
1197
|
-
],
|
|
1198
|
-
|
|
1194
|
+
], A.prototype, "loading", 2);
|
|
1195
|
+
b([
|
|
1199
1196
|
h({ attribute: "crop-modes", reflect: !1, type: Array })
|
|
1200
|
-
],
|
|
1201
|
-
|
|
1197
|
+
], A.prototype, "cropModes", 2);
|
|
1198
|
+
b([
|
|
1202
1199
|
h({ attribute: "focus-modes", reflect: !1, type: Object })
|
|
1203
|
-
],
|
|
1204
|
-
|
|
1200
|
+
], A.prototype, "focusModes", 2);
|
|
1201
|
+
b([
|
|
1205
1202
|
h({ attribute: "focus-mode", reflect: !0, type: String })
|
|
1206
|
-
],
|
|
1207
|
-
|
|
1203
|
+
], A.prototype, "focusMode", 2);
|
|
1204
|
+
b([
|
|
1208
1205
|
h({ attribute: "crop-mode", reflect: !0, type: String })
|
|
1209
|
-
],
|
|
1210
|
-
|
|
1206
|
+
], A.prototype, "cropMode", 2);
|
|
1207
|
+
b([
|
|
1211
1208
|
h({ reflect: !0, type: String })
|
|
1212
|
-
],
|
|
1213
|
-
|
|
1209
|
+
], A.prototype, "position", 2);
|
|
1210
|
+
b([
|
|
1214
1211
|
h({ attribute: "keep-aspect-ratio", reflect: !0, type: Boolean })
|
|
1215
|
-
],
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
],
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
],
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
],
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
],
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
],
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
],
|
|
1237
|
-
const We =
|
|
1238
|
-
var De = Object.defineProperty, Ne = Object.getOwnPropertyDescriptor,
|
|
1212
|
+
], A.prototype, "keepAspectRatio", 2);
|
|
1213
|
+
b([
|
|
1214
|
+
$()
|
|
1215
|
+
], A.prototype, "invalidWidth", 2);
|
|
1216
|
+
b([
|
|
1217
|
+
$()
|
|
1218
|
+
], A.prototype, "invalidHeight", 2);
|
|
1219
|
+
b([
|
|
1220
|
+
$()
|
|
1221
|
+
], A.prototype, "aspectRatio", 2);
|
|
1222
|
+
b([
|
|
1223
|
+
_("cropMode", { waitUntilFirstUpdate: !0 }),
|
|
1224
|
+
_("maxWidth", { waitUntilFirstUpdate: !0 }),
|
|
1225
|
+
_("maxHeight", { waitUntilFirstUpdate: !0 }),
|
|
1226
|
+
_("keepAspectRatio")
|
|
1227
|
+
], A.prototype, "handleCropModeChange", 1);
|
|
1228
|
+
b([
|
|
1229
|
+
_("open", { waitUntilFirstUpdate: !0 })
|
|
1230
|
+
], A.prototype, "handleOpenChange", 1);
|
|
1231
|
+
A = b([
|
|
1232
|
+
Q("cx-asset-link-format-crop")
|
|
1233
|
+
], A);
|
|
1234
|
+
const We = j`.extension{padding:var(--cx-spacing-small) var(--cx-spacing-medium);border:solid 1px var(--cx-color-neutral-200);background-color:var(--cx-color-neutral-0);& cx-select{flex:1;width:100%}}`;
|
|
1235
|
+
var De = Object.defineProperty, Ne = Object.getOwnPropertyDescriptor, $t = (t, e, i, s) => {
|
|
1239
1236
|
for (var a = s > 1 ? void 0 : s ? Ne(e, i) : e, r = t.length - 1, n; r >= 0; r--)
|
|
1240
1237
|
(n = t[r]) && (a = (s ? n(e, i, a) : n(a)) || a);
|
|
1241
1238
|
return s && a && De(e, i, a), a;
|
|
1242
1239
|
};
|
|
1243
|
-
let Z = class extends
|
|
1240
|
+
let Z = class extends q {
|
|
1244
1241
|
constructor() {
|
|
1245
|
-
super(...arguments), this.localize = new
|
|
1242
|
+
super(...arguments), this.localize = new V(this), this.value = "", this.items = [];
|
|
1246
1243
|
}
|
|
1247
1244
|
handleExtensionChange(t) {
|
|
1248
1245
|
const e = t.target.value;
|
|
@@ -1251,46 +1248,46 @@ let Z = class extends j {
|
|
|
1251
1248
|
});
|
|
1252
1249
|
}
|
|
1253
1250
|
render() {
|
|
1254
|
-
return
|
|
1251
|
+
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}>${rt(
|
|
1255
1252
|
this.items,
|
|
1256
1253
|
(t) => t.value,
|
|
1257
|
-
(t) =>
|
|
1254
|
+
(t) => C`<cx-option value=${t.value}>${t.displayName}</cx-option>`
|
|
1258
1255
|
)}</cx-select></cx-space>`;
|
|
1259
1256
|
}
|
|
1260
1257
|
};
|
|
1261
|
-
Z.styles = [
|
|
1258
|
+
Z.styles = [G, We];
|
|
1262
1259
|
Z.dependencies = {
|
|
1263
|
-
"cx-option":
|
|
1264
|
-
"cx-select":
|
|
1265
|
-
"cx-space":
|
|
1266
|
-
"cx-typography":
|
|
1260
|
+
"cx-option": yt,
|
|
1261
|
+
"cx-select": St,
|
|
1262
|
+
"cx-space": U,
|
|
1263
|
+
"cx-typography": B
|
|
1267
1264
|
};
|
|
1268
|
-
|
|
1265
|
+
$t([
|
|
1269
1266
|
h({ reflect: !0, type: String })
|
|
1270
1267
|
], Z.prototype, "value", 2);
|
|
1271
|
-
|
|
1268
|
+
$t([
|
|
1272
1269
|
h({ reflect: !1, type: Array })
|
|
1273
1270
|
], Z.prototype, "items", 2);
|
|
1274
|
-
Z =
|
|
1275
|
-
|
|
1271
|
+
Z = $t([
|
|
1272
|
+
Q("cx-asset-link-format-extension")
|
|
1276
1273
|
], Z);
|
|
1277
|
-
const Oe =
|
|
1278
|
-
var Le = Object.defineProperty, Ue = Object.getOwnPropertyDescriptor,
|
|
1274
|
+
const Oe = j`cx-details::part(base){border-bottom-width:0}`;
|
|
1275
|
+
var Le = Object.defineProperty, Ue = Object.getOwnPropertyDescriptor, D = (t, e, i, s) => {
|
|
1279
1276
|
for (var a = s > 1 ? void 0 : s ? Ue(e, i) : e, r = t.length - 1, n; r >= 0; r--)
|
|
1280
1277
|
(n = t[r]) && (a = (s ? n(e, i, a) : n(a)) || a);
|
|
1281
1278
|
return s && a && Le(e, i, a), a;
|
|
1282
1279
|
};
|
|
1283
|
-
const
|
|
1284
|
-
let I = class extends
|
|
1280
|
+
const zt = "auto";
|
|
1281
|
+
let I = class extends q {
|
|
1285
1282
|
constructor() {
|
|
1286
|
-
super(...arguments), this.localize = new
|
|
1283
|
+
super(...arguments), this.localize = new V(this), this.open = !1, this.value = "", this.items = [], this.canAutoFormat = !1, this.autoFormat = !1, this.loading = !1, this.scopedValue = "";
|
|
1287
1284
|
}
|
|
1288
1285
|
/**
|
|
1289
1286
|
* The listbox value that represents the committed choice: the `Auto` entry when that is
|
|
1290
1287
|
* active, otherwise the resolved proxy id.
|
|
1291
1288
|
*/
|
|
1292
1289
|
get committedValue() {
|
|
1293
|
-
return this.autoFormat ?
|
|
1290
|
+
return this.autoFormat ? zt : this.value;
|
|
1294
1291
|
}
|
|
1295
1292
|
handleValueChange() {
|
|
1296
1293
|
this.scopedValue = this.committedValue;
|
|
@@ -1310,7 +1307,7 @@ let I = class extends j {
|
|
|
1310
1307
|
handleApply() {
|
|
1311
1308
|
if (this.loading)
|
|
1312
1309
|
return;
|
|
1313
|
-
if (this.scopedValue ===
|
|
1310
|
+
if (this.scopedValue === zt) {
|
|
1314
1311
|
this.emit("cx-asset-link-format-proxy-change", {
|
|
1315
1312
|
detail: { autoFormat: !0 }
|
|
1316
1313
|
});
|
|
@@ -1340,74 +1337,74 @@ let I = class extends j {
|
|
|
1340
1337
|
t.target !== this.base && t.stopPropagation();
|
|
1341
1338
|
}
|
|
1342
1339
|
render() {
|
|
1343
|
-
return
|
|
1340
|
+
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}>${rt(
|
|
1344
1341
|
this.items,
|
|
1345
1342
|
(t) => t.id,
|
|
1346
|
-
(t) =>
|
|
1343
|
+
(t) => C`<cx-option value=${t.id}>${t.proxyLabel}</cx-option>`
|
|
1347
1344
|
)}
|
|
1348
1345
|
${M(
|
|
1349
1346
|
this.canAutoFormat,
|
|
1350
|
-
() =>
|
|
1351
|
-
() =>
|
|
1347
|
+
() => C`<cx-divider></cx-divider><cx-option data-testid="cx-asset-link-format-proxy-auto-option" value=${zt}>${this.localize.term("auto")}</cx-option>`,
|
|
1348
|
+
() => Ot
|
|
1352
1349
|
)}</cx-select><cx-button data-testid="cx-asset-link-format-proxy-apply" variant="primary" style=${O({
|
|
1353
1350
|
"margin-left": "auto"
|
|
1354
1351
|
})} ?disabled=${this.scopedValue === this.committedValue} ?loading=${this.loading} @click=${this.handleApply}>${this.localize.term("apply")}</cx-button></cx-space></cx-details>`;
|
|
1355
1352
|
}
|
|
1356
1353
|
};
|
|
1357
|
-
I.styles = [
|
|
1354
|
+
I.styles = [G, Oe];
|
|
1358
1355
|
I.dependencies = {
|
|
1359
|
-
"cx-button":
|
|
1360
|
-
"cx-details":
|
|
1361
|
-
"cx-divider":
|
|
1362
|
-
"cx-icon":
|
|
1363
|
-
"cx-option":
|
|
1364
|
-
"cx-select":
|
|
1365
|
-
"cx-space":
|
|
1366
|
-
"cx-typography":
|
|
1356
|
+
"cx-button": K,
|
|
1357
|
+
"cx-details": at,
|
|
1358
|
+
"cx-divider": Ut,
|
|
1359
|
+
"cx-icon": ot,
|
|
1360
|
+
"cx-option": yt,
|
|
1361
|
+
"cx-select": St,
|
|
1362
|
+
"cx-space": U,
|
|
1363
|
+
"cx-typography": B
|
|
1367
1364
|
};
|
|
1368
|
-
|
|
1369
|
-
|
|
1365
|
+
D([
|
|
1366
|
+
Y(".details")
|
|
1370
1367
|
], I.prototype, "base", 2);
|
|
1371
|
-
|
|
1368
|
+
D([
|
|
1372
1369
|
h({ reflect: !0, type: Boolean })
|
|
1373
1370
|
], I.prototype, "open", 2);
|
|
1374
|
-
|
|
1371
|
+
D([
|
|
1375
1372
|
h({ reflect: !0, type: String })
|
|
1376
1373
|
], I.prototype, "value", 2);
|
|
1377
|
-
|
|
1374
|
+
D([
|
|
1378
1375
|
h({ reflect: !1, type: Array })
|
|
1379
1376
|
], I.prototype, "items", 2);
|
|
1380
|
-
|
|
1377
|
+
D([
|
|
1381
1378
|
h({ attribute: "can-auto-format", reflect: !0, type: Boolean })
|
|
1382
1379
|
], I.prototype, "canAutoFormat", 2);
|
|
1383
|
-
|
|
1380
|
+
D([
|
|
1384
1381
|
h({ attribute: "auto-format", reflect: !0, type: Boolean })
|
|
1385
1382
|
], I.prototype, "autoFormat", 2);
|
|
1386
|
-
|
|
1383
|
+
D([
|
|
1387
1384
|
h({ reflect: !0, type: Boolean })
|
|
1388
1385
|
], I.prototype, "loading", 2);
|
|
1389
|
-
|
|
1390
|
-
|
|
1386
|
+
D([
|
|
1387
|
+
$()
|
|
1391
1388
|
], I.prototype, "scopedValue", 2);
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1389
|
+
D([
|
|
1390
|
+
_("autoFormat"),
|
|
1391
|
+
_("value")
|
|
1395
1392
|
], I.prototype, "handleValueChange", 1);
|
|
1396
|
-
|
|
1397
|
-
|
|
1393
|
+
D([
|
|
1394
|
+
_("open", { waitUntilFirstUpdate: !0 })
|
|
1398
1395
|
], I.prototype, "handleOpenChange", 1);
|
|
1399
|
-
I =
|
|
1400
|
-
|
|
1396
|
+
I = D([
|
|
1397
|
+
Q("cx-asset-link-format-proxy")
|
|
1401
1398
|
], I);
|
|
1402
|
-
const Be =
|
|
1403
|
-
var qe = Object.defineProperty, je = Object.getOwnPropertyDescriptor,
|
|
1399
|
+
const Be = j`cx-details::part(base){border-bottom-width:0}`;
|
|
1400
|
+
var qe = Object.defineProperty, je = Object.getOwnPropertyDescriptor, J = (t, e, i, s) => {
|
|
1404
1401
|
for (var a = s > 1 ? void 0 : s ? je(e, i) : e, r = t.length - 1, n; r >= 0; r--)
|
|
1405
1402
|
(n = t[r]) && (a = (s ? n(e, i, a) : n(a)) || a);
|
|
1406
1403
|
return s && a && qe(e, i, a), a;
|
|
1407
1404
|
};
|
|
1408
|
-
let
|
|
1405
|
+
let W = class extends q {
|
|
1409
1406
|
constructor() {
|
|
1410
|
-
super(...arguments), this.localize = new
|
|
1407
|
+
super(...arguments), this.localize = new V(this), this.open = !1, this.value = 100, this.loading = !1, this.scopedValue = 100;
|
|
1411
1408
|
}
|
|
1412
1409
|
/**
|
|
1413
1410
|
* A computed property that checks if the current quality value is invalid.
|
|
@@ -1451,51 +1448,51 @@ let H = class extends j {
|
|
|
1451
1448
|
t.target !== this.base && t.stopPropagation();
|
|
1452
1449
|
}
|
|
1453
1450
|
render() {
|
|
1454
|
-
return
|
|
1451
|
+
return C`<cx-details class="details" ?open=${this.open} @cx-show=${this.onShowDetails} @cx-hide=${this.onHideDetails}><cx-space slot="summary" align-items="center"><div class="details__summary__icon"><div part="icon"><cx-icon name="blur_on"></cx-icon></div></div><cx-typography variant="body2">${this.localize.term("quality")}</cx-typography></cx-space><cx-space spacing="small"><cx-tooltip data-testid="cx-asset-link-format-quality-tooltip" content=${this.localize.term("qualityHelpText")} hoist><cx-input data-testid="cx-asset-link-format-quality" class="details__checkbox" mask="num" .maskBlocks=${{ num: { mask: Number, max: 100, min: 1 } }} value=${this.scopedValue.toString()} style=${O({
|
|
1455
1452
|
flex: "1"
|
|
1456
1453
|
})} @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>`;
|
|
1457
1454
|
}
|
|
1458
1455
|
};
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
"cx-button":
|
|
1462
|
-
"cx-details":
|
|
1463
|
-
"cx-icon":
|
|
1464
|
-
"cx-input":
|
|
1465
|
-
"cx-space":
|
|
1466
|
-
"cx-tooltip":
|
|
1467
|
-
"cx-typography":
|
|
1456
|
+
W.styles = [G, Be];
|
|
1457
|
+
W.dependencies = {
|
|
1458
|
+
"cx-button": K,
|
|
1459
|
+
"cx-details": at,
|
|
1460
|
+
"cx-icon": ot,
|
|
1461
|
+
"cx-input": kt,
|
|
1462
|
+
"cx-space": U,
|
|
1463
|
+
"cx-tooltip": Bt,
|
|
1464
|
+
"cx-typography": B
|
|
1468
1465
|
};
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
],
|
|
1472
|
-
|
|
1466
|
+
J([
|
|
1467
|
+
Y(".details")
|
|
1468
|
+
], W.prototype, "base", 2);
|
|
1469
|
+
J([
|
|
1473
1470
|
h({ reflect: !0, type: Boolean })
|
|
1474
|
-
],
|
|
1475
|
-
|
|
1471
|
+
], W.prototype, "open", 2);
|
|
1472
|
+
J([
|
|
1476
1473
|
h({ reflect: !0, type: Number })
|
|
1477
|
-
],
|
|
1478
|
-
|
|
1474
|
+
], W.prototype, "value", 2);
|
|
1475
|
+
J([
|
|
1479
1476
|
h({ reflect: !0, type: Boolean })
|
|
1480
|
-
],
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
],
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
],
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
],
|
|
1490
|
-
const Ve =
|
|
1491
|
-
var Ge = Object.defineProperty, Qe = Object.getOwnPropertyDescriptor,
|
|
1477
|
+
], W.prototype, "loading", 2);
|
|
1478
|
+
J([
|
|
1479
|
+
$()
|
|
1480
|
+
], W.prototype, "scopedValue", 2);
|
|
1481
|
+
J([
|
|
1482
|
+
_("value")
|
|
1483
|
+
], W.prototype, "handleValueChange", 1);
|
|
1484
|
+
W = J([
|
|
1485
|
+
Q("cx-asset-link-format-quality")
|
|
1486
|
+
], W);
|
|
1487
|
+
const Ve = j`cx-details::part(base){border-bottom-width:0}cx-space{width:100%}cx-space cx-input{flex:1}.resize__unit-select{width:120px}.resize__input-group{flex:1;display:flex}`;
|
|
1488
|
+
var Ge = Object.defineProperty, Qe = Object.getOwnPropertyDescriptor, F = (t, e, i, s) => {
|
|
1492
1489
|
for (var a = s > 1 ? void 0 : s ? Qe(e, i) : e, r = t.length - 1, n; r >= 0; r--)
|
|
1493
1490
|
(n = t[r]) && (a = (s ? n(e, i, a) : n(a)) || a);
|
|
1494
1491
|
return s && a && Ge(e, i, a), a;
|
|
1495
1492
|
};
|
|
1496
|
-
let
|
|
1493
|
+
let R = class extends q {
|
|
1497
1494
|
constructor() {
|
|
1498
|
-
super(...arguments), this.localize = new
|
|
1495
|
+
super(...arguments), this.localize = new V(this), this.open = !1, this.width = 0, this.height = 0, this.maxWidth = 0, this.maxHeight = 0, this.ratioWidth = 1, this.ratioHeight = 1, this.unit = o.Pixel, this.lastAppliedSetting = {
|
|
1499
1496
|
[o.Pixel]: { height: 0, width: 0 },
|
|
1500
1497
|
[o.AspectRatio]: { height: 1, width: 1 }
|
|
1501
1498
|
}, this.loading = !1, this.noRatioModes = !1, this.keepAspectRatio = !1, this.invalidWidth = !1, this.invalidHeight = !1, this.aspectRatio = 0;
|
|
@@ -1634,7 +1631,7 @@ let k = class extends j {
|
|
|
1634
1631
|
});
|
|
1635
1632
|
}
|
|
1636
1633
|
render() {
|
|
1637
|
-
return
|
|
1634
|
+
return C`<cx-details class="details" ?open=${this.open} @cx-show=${this.onShowDetails} @cx-hide=${this.onHideDetails}><cx-space slot="summary" align-items="center"><div part="icon"><cx-icon name="aspect_ratio"></cx-icon></div><cx-typography variant="body2">${this.localize.term("resize")}</cx-typography></cx-space><cx-space direction="vertical" spacing="small"><cx-space spacing="small"><div class="resize__input-group"><cx-input data-testid="cx-asset-link-format-resize-width" placeholder=${this.localize.term("width")} mask="num" .maskBlocks=${{ num: { mask: Number, min: 1 } }} value=${this.unit === o.Pixel ? this.width.toString() : this.ratioWidth.toString()} @cx-input=${this.handleWidthChange} required ?disabled=${this.loading}><cx-typography slot="prefix" variant="body3" part="input-label">
|
|
1638
1635
|
W
|
|
1639
1636
|
</cx-typography></cx-input><cx-icon-button data-testid="cx-asset-link-format-resize-aspect-ratio" name=${this.keepAspectRatio ? "insert_link" : "link_off"} @click=${this.handleAspectRatioClick} style=${O({
|
|
1640
1637
|
color: this.keepAspectRatio ? "var(--cx-color-primary)" : void 0
|
|
@@ -1642,93 +1639,93 @@ let k = class extends j {
|
|
|
1642
1639
|
H
|
|
1643
1640
|
</cx-typography></cx-input></div>${M(
|
|
1644
1641
|
!this.noRatioModes,
|
|
1645
|
-
() =>
|
|
1642
|
+
() => 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=${o.Pixel}>${this.localize.term("pixels")}</cx-option><cx-option value=${o.AspectRatio}>${this.localize.term("aspectRatio")}</cx-option></cx-select>`
|
|
1646
1643
|
)}</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({
|
|
1647
1644
|
marginLeft: "auto"
|
|
1648
1645
|
})} @click=${this.handleApply}>${this.localize.term("apply")}</cx-button></cx-space></cx-details>`;
|
|
1649
1646
|
}
|
|
1650
1647
|
};
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
"cx-button":
|
|
1654
|
-
"cx-details":
|
|
1655
|
-
"cx-icon":
|
|
1656
|
-
"cx-icon-button":
|
|
1657
|
-
"cx-input":
|
|
1658
|
-
"cx-option":
|
|
1659
|
-
"cx-select":
|
|
1660
|
-
"cx-space":
|
|
1661
|
-
"cx-typography":
|
|
1648
|
+
R.styles = [G, Ve];
|
|
1649
|
+
R.dependencies = {
|
|
1650
|
+
"cx-button": K,
|
|
1651
|
+
"cx-details": at,
|
|
1652
|
+
"cx-icon": ot,
|
|
1653
|
+
"cx-icon-button": Ct,
|
|
1654
|
+
"cx-input": kt,
|
|
1655
|
+
"cx-option": yt,
|
|
1656
|
+
"cx-select": St,
|
|
1657
|
+
"cx-space": U,
|
|
1658
|
+
"cx-typography": B
|
|
1662
1659
|
};
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
],
|
|
1666
|
-
|
|
1660
|
+
F([
|
|
1661
|
+
Y(".details")
|
|
1662
|
+
], R.prototype, "base", 2);
|
|
1663
|
+
F([
|
|
1667
1664
|
h({ reflect: !0, type: Boolean })
|
|
1668
|
-
],
|
|
1669
|
-
|
|
1665
|
+
], R.prototype, "open", 2);
|
|
1666
|
+
F([
|
|
1670
1667
|
h({ reflect: !0, type: Number })
|
|
1671
|
-
],
|
|
1672
|
-
|
|
1668
|
+
], R.prototype, "width", 2);
|
|
1669
|
+
F([
|
|
1673
1670
|
h({ reflect: !0, type: Number })
|
|
1674
|
-
],
|
|
1675
|
-
|
|
1671
|
+
], R.prototype, "height", 2);
|
|
1672
|
+
F([
|
|
1676
1673
|
h({ attribute: "max-width", reflect: !0, type: Number })
|
|
1677
|
-
],
|
|
1678
|
-
|
|
1674
|
+
], R.prototype, "maxWidth", 2);
|
|
1675
|
+
F([
|
|
1679
1676
|
h({ attribute: "max-height", reflect: !0, type: Number })
|
|
1680
|
-
],
|
|
1681
|
-
|
|
1677
|
+
], R.prototype, "maxHeight", 2);
|
|
1678
|
+
F([
|
|
1682
1679
|
h({ attribute: "ratio-width", reflect: !0, type: Number })
|
|
1683
|
-
],
|
|
1684
|
-
|
|
1680
|
+
], R.prototype, "ratioWidth", 2);
|
|
1681
|
+
F([
|
|
1685
1682
|
h({ attribute: "ratio-height", reflect: !0, type: Number })
|
|
1686
|
-
],
|
|
1687
|
-
|
|
1683
|
+
], R.prototype, "ratioHeight", 2);
|
|
1684
|
+
F([
|
|
1688
1685
|
h({ reflect: !0, type: String })
|
|
1689
|
-
],
|
|
1690
|
-
|
|
1686
|
+
], R.prototype, "unit", 2);
|
|
1687
|
+
F([
|
|
1691
1688
|
h({ attribute: "last-applied-setting", reflect: !1, type: Object })
|
|
1692
|
-
],
|
|
1693
|
-
|
|
1689
|
+
], R.prototype, "lastAppliedSetting", 2);
|
|
1690
|
+
F([
|
|
1694
1691
|
h({ reflect: !0, type: Boolean })
|
|
1695
|
-
],
|
|
1696
|
-
|
|
1692
|
+
], R.prototype, "loading", 2);
|
|
1693
|
+
F([
|
|
1697
1694
|
h({ attribute: "no-ratio-modes", reflect: !0, type: Boolean })
|
|
1698
|
-
],
|
|
1699
|
-
|
|
1695
|
+
], R.prototype, "noRatioModes", 2);
|
|
1696
|
+
F([
|
|
1700
1697
|
h({ attribute: "keep-aspect-ratio", reflect: !0, type: Boolean })
|
|
1701
|
-
],
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
],
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
],
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
],
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
],
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
],
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
],
|
|
1723
|
-
const Xe =
|
|
1724
|
-
var
|
|
1725
|
-
for (var a = s > 1 ? void 0 : s ?
|
|
1698
|
+
], R.prototype, "keepAspectRatio", 2);
|
|
1699
|
+
F([
|
|
1700
|
+
$()
|
|
1701
|
+
], R.prototype, "invalidWidth", 2);
|
|
1702
|
+
F([
|
|
1703
|
+
$()
|
|
1704
|
+
], R.prototype, "invalidHeight", 2);
|
|
1705
|
+
F([
|
|
1706
|
+
$()
|
|
1707
|
+
], R.prototype, "aspectRatio", 2);
|
|
1708
|
+
F([
|
|
1709
|
+
_("cropMode", { waitUntilFirstUpdate: !0 }),
|
|
1710
|
+
_("maxWidth", { waitUntilFirstUpdate: !0 }),
|
|
1711
|
+
_("maxHeight", { waitUntilFirstUpdate: !0 }),
|
|
1712
|
+
_("keepAspectRatio")
|
|
1713
|
+
], R.prototype, "handleCropModeChange", 1);
|
|
1714
|
+
F([
|
|
1715
|
+
_("open", { waitUntilFirstUpdate: !0 })
|
|
1716
|
+
], R.prototype, "handleOpenChange", 1);
|
|
1717
|
+
R = F([
|
|
1718
|
+
Q("cx-asset-link-format-resize")
|
|
1719
|
+
], R);
|
|
1720
|
+
const Xe = j`cx-details::part(base){border-bottom-width:0}`;
|
|
1721
|
+
var Ze = Object.defineProperty, Ke = Object.getOwnPropertyDescriptor, X = (t, e, i, s) => {
|
|
1722
|
+
for (var a = s > 1 ? void 0 : s ? Ke(e, i) : e, r = t.length - 1, n; r >= 0; r--)
|
|
1726
1723
|
(n = t[r]) && (a = (s ? n(e, i, a) : n(a)) || a);
|
|
1727
|
-
return s && a &&
|
|
1724
|
+
return s && a && Ze(e, i, a), a;
|
|
1728
1725
|
};
|
|
1729
|
-
let T = class extends
|
|
1726
|
+
let T = class extends q {
|
|
1730
1727
|
constructor() {
|
|
1731
|
-
super(...arguments), this.localize = new
|
|
1728
|
+
super(...arguments), this.localize = new V(this), this.open = !1, this.value = 0, this.defaultValue = 0, this.loading = !1, this.lastAppliedValue = 0;
|
|
1732
1729
|
}
|
|
1733
1730
|
handleOpenChange() {
|
|
1734
1731
|
this.open || this.emit("cx-asset-link-format-rotation-change", {
|
|
@@ -1739,14 +1736,14 @@ let T = class extends j {
|
|
|
1739
1736
|
const e = t.target.value, i = Number(e);
|
|
1740
1737
|
if (Number.isNaN(i))
|
|
1741
1738
|
return;
|
|
1742
|
-
const s =
|
|
1739
|
+
const s = Mt(i);
|
|
1743
1740
|
(i > 360 || i < -360) && (t.target.value = s.toString()), this.emit("cx-asset-link-format-rotation-change", {
|
|
1744
1741
|
detail: s
|
|
1745
1742
|
});
|
|
1746
1743
|
}
|
|
1747
1744
|
handleButtonClick(t) {
|
|
1748
1745
|
this.emit("cx-asset-link-format-rotation-change", {
|
|
1749
|
-
detail:
|
|
1746
|
+
detail: Mt(t)
|
|
1750
1747
|
});
|
|
1751
1748
|
}
|
|
1752
1749
|
handleClockwiseClick() {
|
|
@@ -1766,55 +1763,55 @@ let T = class extends j {
|
|
|
1766
1763
|
});
|
|
1767
1764
|
}
|
|
1768
1765
|
render() {
|
|
1769
|
-
return
|
|
1766
|
+
return C`<cx-details class="details" ?open=${this.open}><cx-space slot="summary" align-items="center"><div part="icon"><cx-icon name="rotate_90_degrees_cw"></cx-icon></div><cx-typography variant="body2">Rotate</cx-typography></cx-space><cx-space spacing="small"><cx-button-group label=${this.localize.term("history")}><cx-icon-button data-testid="cx-asset-link-format-rotation-ccw" name="rotate_90_degrees_ccw" label=${this.localize.term("undo")} outline size="small" ?disabled=${this.loading || this.value === -360} @click=${this.handleCounterClockwiseClick}></cx-icon-button><cx-icon-button data-testid="cx-asset-link-format-rotation-cw" name="rotate_90_degrees_cw" label=${this.localize.term("redo")} outline size="small" ?disabled=${this.loading || this.value === 360} @click=${this.handleClockwiseClick}></cx-icon-button></cx-button-group><cx-input data-testid="cx-asset-link-format-rotation" value=${(this.value + this.defaultValue).toString()} placeholder="0" mask="num" .maskBlocks=${{ num: { mask: Number, max: 360, min: -360, signed: !0 } }} ?disabled=${this.loading} style=${O({
|
|
1770
1767
|
flex: "none",
|
|
1771
1768
|
width: "80px"
|
|
1772
1769
|
})} @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>`;
|
|
1773
1770
|
}
|
|
1774
1771
|
};
|
|
1775
|
-
T.styles = [
|
|
1772
|
+
T.styles = [G, Xe];
|
|
1776
1773
|
T.dependencies = {
|
|
1777
|
-
"cx-button":
|
|
1778
|
-
"cx-button-group":
|
|
1779
|
-
"cx-details":
|
|
1780
|
-
"cx-icon":
|
|
1781
|
-
"cx-icon-button":
|
|
1782
|
-
"cx-space":
|
|
1783
|
-
"cx-typography":
|
|
1774
|
+
"cx-button": K,
|
|
1775
|
+
"cx-button-group": le,
|
|
1776
|
+
"cx-details": at,
|
|
1777
|
+
"cx-icon": ot,
|
|
1778
|
+
"cx-icon-button": Ct,
|
|
1779
|
+
"cx-space": U,
|
|
1780
|
+
"cx-typography": B
|
|
1784
1781
|
};
|
|
1785
|
-
|
|
1786
|
-
|
|
1782
|
+
X([
|
|
1783
|
+
Y(".details")
|
|
1787
1784
|
], T.prototype, "base", 2);
|
|
1788
|
-
|
|
1785
|
+
X([
|
|
1789
1786
|
h({ reflect: !0, type: Boolean })
|
|
1790
1787
|
], T.prototype, "open", 2);
|
|
1791
|
-
|
|
1788
|
+
X([
|
|
1792
1789
|
h({ reflect: !0, type: Number })
|
|
1793
1790
|
], T.prototype, "value", 2);
|
|
1794
|
-
|
|
1791
|
+
X([
|
|
1795
1792
|
h({ attribute: "default-value", reflect: !0, type: Number })
|
|
1796
1793
|
], T.prototype, "defaultValue", 2);
|
|
1797
|
-
|
|
1794
|
+
X([
|
|
1798
1795
|
h({ reflect: !0, type: Boolean })
|
|
1799
1796
|
], T.prototype, "loading", 2);
|
|
1800
|
-
|
|
1797
|
+
X([
|
|
1801
1798
|
h({ attribute: "last-applied-value", reflect: !0, type: Number })
|
|
1802
1799
|
], T.prototype, "lastAppliedValue", 2);
|
|
1803
|
-
|
|
1804
|
-
|
|
1800
|
+
X([
|
|
1801
|
+
_("open", { waitUntilFirstUpdate: !0 })
|
|
1805
1802
|
], T.prototype, "handleOpenChange", 1);
|
|
1806
|
-
T =
|
|
1807
|
-
|
|
1803
|
+
T = X([
|
|
1804
|
+
Q("cx-asset-link-format-rotation")
|
|
1808
1805
|
], T);
|
|
1809
|
-
const Ye =
|
|
1810
|
-
var Je = Object.defineProperty, ti = Object.getOwnPropertyDescriptor,
|
|
1806
|
+
const Ye = j`cx-details::part(base){border-bottom-width:0}`;
|
|
1807
|
+
var Je = Object.defineProperty, ti = Object.getOwnPropertyDescriptor, At = (t, e, i, s) => {
|
|
1811
1808
|
for (var a = s > 1 ? void 0 : s ? ti(e, i) : e, r = t.length - 1, n; r >= 0; r--)
|
|
1812
1809
|
(n = t[r]) && (a = (s ? n(e, i, a) : n(a)) || a);
|
|
1813
1810
|
return s && a && Je(e, i, a), a;
|
|
1814
1811
|
};
|
|
1815
|
-
let
|
|
1812
|
+
let L = class extends q {
|
|
1816
1813
|
constructor() {
|
|
1817
|
-
super(...arguments), this.localize = new
|
|
1814
|
+
super(...arguments), this.localize = new V(this), this.open = !1, this.value = !1;
|
|
1818
1815
|
}
|
|
1819
1816
|
handleApply(t) {
|
|
1820
1817
|
this.emit("cx-asset-link-format-metadata-change", {
|
|
@@ -1838,39 +1835,39 @@ let U = class extends j {
|
|
|
1838
1835
|
t.target !== this.base && t.stopPropagation();
|
|
1839
1836
|
}
|
|
1840
1837
|
render() {
|
|
1841
|
-
return
|
|
1838
|
+
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>`;
|
|
1842
1839
|
}
|
|
1843
1840
|
};
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
"cx-button":
|
|
1847
|
-
"cx-checkbox":
|
|
1848
|
-
"cx-details":
|
|
1849
|
-
"cx-icon":
|
|
1850
|
-
"cx-space":
|
|
1851
|
-
"cx-tooltip":
|
|
1852
|
-
"cx-typography":
|
|
1841
|
+
L.styles = [G, Ye];
|
|
1842
|
+
L.dependencies = {
|
|
1843
|
+
"cx-button": K,
|
|
1844
|
+
"cx-checkbox": ce,
|
|
1845
|
+
"cx-details": at,
|
|
1846
|
+
"cx-icon": ot,
|
|
1847
|
+
"cx-space": U,
|
|
1848
|
+
"cx-tooltip": Bt,
|
|
1849
|
+
"cx-typography": B
|
|
1853
1850
|
};
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
],
|
|
1857
|
-
|
|
1851
|
+
At([
|
|
1852
|
+
Y(".details")
|
|
1853
|
+
], L.prototype, "base", 2);
|
|
1854
|
+
At([
|
|
1858
1855
|
h({ reflect: !0, type: Boolean })
|
|
1859
|
-
],
|
|
1860
|
-
|
|
1856
|
+
], L.prototype, "open", 2);
|
|
1857
|
+
At([
|
|
1861
1858
|
h({ reflect: !0, type: Boolean })
|
|
1862
|
-
],
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
],
|
|
1866
|
-
var ei = Object.defineProperty, ii = Object.getOwnPropertyDescriptor,
|
|
1859
|
+
], L.prototype, "value", 2);
|
|
1860
|
+
L = At([
|
|
1861
|
+
Q("cx-asset-link-format-metadata")
|
|
1862
|
+
], L);
|
|
1863
|
+
var ei = Object.defineProperty, ii = Object.getOwnPropertyDescriptor, y = (t, e, i, s) => {
|
|
1867
1864
|
for (var a = s > 1 ? void 0 : s ? ii(e, i) : e, r = t.length - 1, n; r >= 0; r--)
|
|
1868
1865
|
(n = t[r]) && (a = (s ? n(e, i, a) : n(a)) || a);
|
|
1869
1866
|
return s && a && ei(e, i, a), a;
|
|
1870
1867
|
};
|
|
1871
|
-
let
|
|
1868
|
+
let u = class extends q {
|
|
1872
1869
|
constructor() {
|
|
1873
|
-
super(), this.localize = new
|
|
1870
|
+
super(), this.localize = new V(this), this.baseUrl = void 0, this.token = void 0, this.asset = void 0, this.cropModes = [
|
|
1874
1871
|
{
|
|
1875
1872
|
label: "Free",
|
|
1876
1873
|
value: "free"
|
|
@@ -1966,7 +1963,7 @@ let m = class extends j {
|
|
|
1966
1963
|
}, this.rotation = 0, this.defaultSize = {
|
|
1967
1964
|
height: 0,
|
|
1968
1965
|
width: 0
|
|
1969
|
-
}, 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 =
|
|
1966
|
+
}, 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 = we, this.apiGetCropFocusMode = Pe, this.onCropComplete = this.onCropComplete.bind(this), this.onCropDragStart = this.onCropDragStart.bind(this);
|
|
1970
1967
|
}
|
|
1971
1968
|
/**
|
|
1972
1969
|
* Transform requests must resolve to a web-displayable image (the browser renders the
|
|
@@ -1988,7 +1985,7 @@ let m = class extends j {
|
|
|
1988
1985
|
*/
|
|
1989
1986
|
get lastAppliedCropUnit() {
|
|
1990
1987
|
return this.transformations.findLast(
|
|
1991
|
-
(e) => e.key ===
|
|
1988
|
+
(e) => e.key === m.Crop
|
|
1992
1989
|
)?.value.unit ?? o.Pixel;
|
|
1993
1990
|
}
|
|
1994
1991
|
/**
|
|
@@ -1998,7 +1995,7 @@ let m = class extends j {
|
|
|
1998
1995
|
*/
|
|
1999
1996
|
get lastAppliedCropFocusMode() {
|
|
2000
1997
|
return this.transformations.findLast(
|
|
2001
|
-
(e) => e.key ===
|
|
1998
|
+
(e) => e.key === m.Crop
|
|
2002
1999
|
)?.value.focusMode ?? "manual";
|
|
2003
2000
|
}
|
|
2004
2001
|
/**
|
|
@@ -2008,7 +2005,7 @@ let m = class extends j {
|
|
|
2008
2005
|
*/
|
|
2009
2006
|
get lastAppliedCropPosition() {
|
|
2010
2007
|
return this.transformations.findLast(
|
|
2011
|
-
(e) => e.key ===
|
|
2008
|
+
(e) => e.key === m.Crop
|
|
2012
2009
|
)?.value.position ?? N.CenterCenter;
|
|
2013
2010
|
}
|
|
2014
2011
|
/**
|
|
@@ -2060,7 +2057,7 @@ let m = class extends j {
|
|
|
2060
2057
|
get lastCropSize() {
|
|
2061
2058
|
if (!this.asset) {
|
|
2062
2059
|
const e = this.transformations.findLast(
|
|
2063
|
-
(i) => i.key ===
|
|
2060
|
+
(i) => i.key === m.Crop
|
|
2064
2061
|
);
|
|
2065
2062
|
if (e?.value.unit === o.AspectRatio && e.value.ratioWidth && e.value.ratioHeight)
|
|
2066
2063
|
return {
|
|
@@ -2143,7 +2140,7 @@ let m = class extends j {
|
|
|
2143
2140
|
get lastResizeSize() {
|
|
2144
2141
|
if (!this.asset) {
|
|
2145
2142
|
const e = this.transformations.findLast(
|
|
2146
|
-
(i) => i.key ===
|
|
2143
|
+
(i) => i.key === m.Resize
|
|
2147
2144
|
);
|
|
2148
2145
|
if (e?.value.unit === o.AspectRatio && e.value.ratioWidth && e.value.ratioHeight)
|
|
2149
2146
|
return {
|
|
@@ -2199,7 +2196,7 @@ let m = class extends j {
|
|
|
2199
2196
|
*/
|
|
2200
2197
|
get lastRotation() {
|
|
2201
2198
|
return this.asset ? 0 : this.transformations.findLast(
|
|
2202
|
-
(e) => e.key ===
|
|
2199
|
+
(e) => e.key === m.Rotate
|
|
2203
2200
|
)?.value.rotation ?? 0;
|
|
2204
2201
|
}
|
|
2205
2202
|
/**
|
|
@@ -2245,13 +2242,13 @@ let m = class extends j {
|
|
|
2245
2242
|
);
|
|
2246
2243
|
this.loading = !0, this.apiGetTransformAssetLink({
|
|
2247
2244
|
assetId: this.asset.id,
|
|
2248
|
-
extension:
|
|
2245
|
+
extension: u.getTransformExtension(this.asset.extension),
|
|
2249
2246
|
format: e?.proxyName ?? "",
|
|
2250
2247
|
siteUrl: this.baseUrl,
|
|
2251
2248
|
token: this.token,
|
|
2252
2249
|
transformations: this.transformationString
|
|
2253
2250
|
}).then((s) => {
|
|
2254
|
-
this.loading = !1, !(!s?.relativePath || !this.selectedFormat) && (this.lastAction ===
|
|
2251
|
+
this.loading = !1, !(!s?.relativePath || !this.selectedFormat) && (this.lastAction === m.Rotate && (this.rotation = 0), this.lastAction = void 0, this.lastImageSize = {
|
|
2255
2252
|
height: s.height,
|
|
2256
2253
|
width: s.width
|
|
2257
2254
|
}, this.selectedFormat = {
|
|
@@ -2310,35 +2307,35 @@ let m = class extends j {
|
|
|
2310
2307
|
}).replace(/\/t\//g, "")
|
|
2311
2308
|
});
|
|
2312
2309
|
const r = this.transformations.findLast(
|
|
2313
|
-
(c) => c.key ===
|
|
2310
|
+
(c) => c.key === m.Crop && (c.value.unit === o.AspectRatio && c.value.ratioWidth && c.value.ratioHeight || c.value.width && c.value.height)
|
|
2314
2311
|
);
|
|
2315
2312
|
if (r?.value.unit === o.AspectRatio && r.value.ratioWidth && r.value.ratioHeight) {
|
|
2316
|
-
const { focusMode: c, position:
|
|
2313
|
+
const { focusMode: c, position: f, ratioHeight: S, ratioWidth: x } = r.value;
|
|
2317
2314
|
this.cropSize = {
|
|
2318
2315
|
...this.cropSize,
|
|
2319
2316
|
cropMode: "free",
|
|
2320
2317
|
focusMode: c ?? "manual",
|
|
2321
2318
|
percentageHeight: 100,
|
|
2322
2319
|
percentageWidth: 100,
|
|
2323
|
-
position:
|
|
2324
|
-
ratioHeight:
|
|
2325
|
-
ratioWidth:
|
|
2320
|
+
position: f ?? N.CenterCenter,
|
|
2321
|
+
ratioHeight: S,
|
|
2322
|
+
ratioWidth: x,
|
|
2326
2323
|
unit: o.AspectRatio
|
|
2327
2324
|
};
|
|
2328
2325
|
} else if (r) {
|
|
2329
|
-
const { focusMode: c, height:
|
|
2326
|
+
const { focusMode: c, height: f, position: S, unit: x, width: d, x: v = 0, y: k = 0 } = r.value;
|
|
2330
2327
|
this.cropSize = {
|
|
2331
2328
|
...this.cropSize,
|
|
2332
2329
|
cropMode: "free",
|
|
2333
2330
|
focusMode: c ?? "manual",
|
|
2334
|
-
height:
|
|
2331
|
+
height: f,
|
|
2335
2332
|
percentageHeight: 100,
|
|
2336
2333
|
percentageWidth: 100,
|
|
2337
|
-
position:
|
|
2338
|
-
unit:
|
|
2339
|
-
width:
|
|
2340
|
-
x:
|
|
2341
|
-
y:
|
|
2334
|
+
position: S ?? N.CenterCenter,
|
|
2335
|
+
unit: x ?? o.Pixel,
|
|
2336
|
+
width: d,
|
|
2337
|
+
x: v,
|
|
2338
|
+
y: k
|
|
2342
2339
|
};
|
|
2343
2340
|
} else
|
|
2344
2341
|
this.cropSize = {
|
|
@@ -2361,23 +2358,23 @@ let m = class extends j {
|
|
|
2361
2358
|
y: 0
|
|
2362
2359
|
};
|
|
2363
2360
|
const n = this.transformations.findLast(
|
|
2364
|
-
(c) => c.key ===
|
|
2361
|
+
(c) => c.key === m.Resize && (c.value.unit === o.AspectRatio && c.value.ratioWidth && c.value.ratioHeight || c.value.width || c.value.height)
|
|
2365
2362
|
);
|
|
2366
2363
|
if (n?.value.unit === o.AspectRatio && n.value.ratioWidth && n.value.ratioHeight) {
|
|
2367
|
-
const { ratioHeight: c, ratioWidth:
|
|
2364
|
+
const { ratioHeight: c, ratioWidth: f } = n.value;
|
|
2368
2365
|
this.resizeSize = {
|
|
2369
2366
|
...this.resizeSize,
|
|
2370
2367
|
ratioHeight: c,
|
|
2371
|
-
ratioWidth:
|
|
2368
|
+
ratioWidth: f,
|
|
2372
2369
|
unit: o.AspectRatio
|
|
2373
2370
|
};
|
|
2374
2371
|
} else if (n) {
|
|
2375
|
-
const { height: c = 0, unit:
|
|
2372
|
+
const { height: c = 0, unit: f, width: S = 0 } = n.value;
|
|
2376
2373
|
this.resizeSize = {
|
|
2377
2374
|
...this.resizeSize,
|
|
2378
2375
|
height: c,
|
|
2379
|
-
unit:
|
|
2380
|
-
width:
|
|
2376
|
+
unit: f ?? o.Pixel,
|
|
2377
|
+
width: S
|
|
2381
2378
|
};
|
|
2382
2379
|
} else
|
|
2383
2380
|
this.resizeSize = {
|
|
@@ -2392,17 +2389,17 @@ let m = class extends j {
|
|
|
2392
2389
|
width: 1
|
|
2393
2390
|
};
|
|
2394
2391
|
const l = this.transformations.findLast(
|
|
2395
|
-
(c) => c.key ===
|
|
2392
|
+
(c) => c.key === m.Rotate
|
|
2396
2393
|
);
|
|
2397
2394
|
this.rotation = l?.value.rotation ?? 0;
|
|
2398
|
-
const
|
|
2399
|
-
(c) => c.key ===
|
|
2395
|
+
const p = this.transformations.findLast((c) => c.key === m.Quality)?.value.quality ?? 100, g = this.transformations.some(
|
|
2396
|
+
(c) => c.key === m.Metadata
|
|
2400
2397
|
);
|
|
2401
|
-
this.selectedFormat ? this.selectedFormat = { ...this.selectedFormat, keepMetadata: g, quality:
|
|
2398
|
+
this.selectedFormat ? this.selectedFormat = { ...this.selectedFormat, keepMetadata: g, quality: p } : this.selectedFormat = {
|
|
2402
2399
|
extension: "",
|
|
2403
2400
|
height: 0,
|
|
2404
2401
|
keepMetadata: g,
|
|
2405
|
-
quality:
|
|
2402
|
+
quality: p,
|
|
2406
2403
|
rotation: 0,
|
|
2407
2404
|
url: "",
|
|
2408
2405
|
width: 0,
|
|
@@ -2419,7 +2416,7 @@ let m = class extends j {
|
|
|
2419
2416
|
this.loading = !0;
|
|
2420
2417
|
const e = await this.apiGetTransformAssetLink({
|
|
2421
2418
|
assetId: this.asset.id,
|
|
2422
|
-
extension:
|
|
2419
|
+
extension: u.getTransformExtension(this.selectedFormat.extension),
|
|
2423
2420
|
format: t?.proxyName ?? "",
|
|
2424
2421
|
siteUrl: this.baseUrl,
|
|
2425
2422
|
token: this.token,
|
|
@@ -2451,11 +2448,11 @@ let m = class extends j {
|
|
|
2451
2448
|
width: e.width,
|
|
2452
2449
|
x: 0,
|
|
2453
2450
|
y: 0
|
|
2454
|
-
}, this.lastAction ===
|
|
2451
|
+
}, this.lastAction === m.Rotate && (this.rotation = 0), this.lastAction = void 0;
|
|
2455
2452
|
const i = this.transformations.some(
|
|
2456
|
-
(r) => r.key ===
|
|
2453
|
+
(r) => r.key === m.Metadata
|
|
2457
2454
|
), s = this.transformations.findLast(
|
|
2458
|
-
(r) => r.key ===
|
|
2455
|
+
(r) => r.key === m.Quality
|
|
2459
2456
|
);
|
|
2460
2457
|
this.selectedFormat = {
|
|
2461
2458
|
...this.selectedFormat,
|
|
@@ -2501,7 +2498,7 @@ let m = class extends j {
|
|
|
2501
2498
|
width: Number.parseInt(this.asset.width, 10)
|
|
2502
2499
|
});
|
|
2503
2500
|
const t = this.transformations.findLast(
|
|
2504
|
-
(e) => e.key ===
|
|
2501
|
+
(e) => e.key === m.Quality
|
|
2505
2502
|
);
|
|
2506
2503
|
this.selectedFormat = {
|
|
2507
2504
|
extension: this.asset.extension,
|
|
@@ -2556,8 +2553,8 @@ let m = class extends j {
|
|
|
2556
2553
|
e.proxyName === "TRX" && (e.formatHeight = Number(this.asset.height), e.formatWidth = Number(this.asset.width));
|
|
2557
2554
|
const i = this.proxies?.find((s) => s.id === t);
|
|
2558
2555
|
i && (this.asset && i.proxyName === "TRX" && (i.formatHeight = Number(this.asset.height), i.formatWidth = Number(this.asset.width)), this.transformations = this.transformations.map((s) => {
|
|
2559
|
-
if (s.key ===
|
|
2560
|
-
const a = s.value, r = a.width / i.formatWidth * e.formatWidth, n = a.height / i.formatHeight * e.formatHeight, l = a.x / i.formatWidth * e.formatWidth,
|
|
2556
|
+
if (s.key === m.Crop) {
|
|
2557
|
+
const a = s.value, r = a.width / i.formatWidth * e.formatWidth, n = a.height / i.formatHeight * e.formatHeight, l = a.x / i.formatWidth * e.formatWidth, p = a.y / i.formatHeight * e.formatHeight;
|
|
2561
2558
|
return {
|
|
2562
2559
|
...s,
|
|
2563
2560
|
value: {
|
|
@@ -2565,11 +2562,11 @@ let m = class extends j {
|
|
|
2565
2562
|
height: n,
|
|
2566
2563
|
width: r,
|
|
2567
2564
|
x: l,
|
|
2568
|
-
y:
|
|
2565
|
+
y: p
|
|
2569
2566
|
}
|
|
2570
2567
|
};
|
|
2571
2568
|
}
|
|
2572
|
-
if (s.key ===
|
|
2569
|
+
if (s.key === m.Resize) {
|
|
2573
2570
|
const a = s.value, r = a.width / i.formatWidth * e.formatWidth, n = a.height / i.formatHeight * e.formatHeight;
|
|
2574
2571
|
return {
|
|
2575
2572
|
...s,
|
|
@@ -2644,29 +2641,29 @@ let m = class extends j {
|
|
|
2644
2641
|
percentageWidth: r,
|
|
2645
2642
|
ratioHeight: n,
|
|
2646
2643
|
ratioWidth: l,
|
|
2647
|
-
unit:
|
|
2644
|
+
unit: p,
|
|
2648
2645
|
useCropMode: g,
|
|
2649
2646
|
width: c
|
|
2650
2647
|
}) {
|
|
2651
2648
|
if (!this.selectedFormat?.url || e === "manual")
|
|
2652
2649
|
return;
|
|
2653
|
-
this.loading = !0, this.lastAction =
|
|
2654
|
-
const
|
|
2650
|
+
this.loading = !0, this.lastAction = m.Crop;
|
|
2651
|
+
const f = await this.apiGetCropFocusMode({
|
|
2655
2652
|
autoCropMode: e,
|
|
2656
2653
|
cropHeight: i,
|
|
2657
2654
|
cropWidth: c,
|
|
2658
2655
|
imageUrl: this.selectedFormat.url
|
|
2659
2656
|
});
|
|
2660
|
-
if (
|
|
2661
|
-
let
|
|
2662
|
-
i || (
|
|
2657
|
+
if (f) {
|
|
2658
|
+
let S = a, x = r;
|
|
2659
|
+
i || (S = f.height * 100 / this.selectedFormat.height), c || (x = f.width * 100 / this.selectedFormat.width), this.cropSize = {
|
|
2663
2660
|
...this.cropSize,
|
|
2664
|
-
height:
|
|
2665
|
-
percentageHeight:
|
|
2666
|
-
percentageWidth:
|
|
2667
|
-
width:
|
|
2668
|
-
x:
|
|
2669
|
-
y:
|
|
2661
|
+
height: f.height,
|
|
2662
|
+
percentageHeight: S ?? this.cropSize.percentageHeight,
|
|
2663
|
+
percentageWidth: x ?? this.cropSize.percentageWidth,
|
|
2664
|
+
width: f.width,
|
|
2665
|
+
x: f.x * 100 / this.selectedFormat.width,
|
|
2666
|
+
y: f.y * 100 / this.selectedFormat.height,
|
|
2670
2667
|
...g ? {
|
|
2671
2668
|
cropMode: e,
|
|
2672
2669
|
focusMode: "manual",
|
|
@@ -2678,7 +2675,7 @@ let m = class extends j {
|
|
|
2678
2675
|
keepAspectRatio: s ?? this.cropSize.keepAspectRatio,
|
|
2679
2676
|
ratioHeight: n ?? this.cropSize.ratioHeight,
|
|
2680
2677
|
ratioWidth: l ?? this.cropSize.ratioWidth,
|
|
2681
|
-
unit:
|
|
2678
|
+
unit: p ?? this.cropSize.unit
|
|
2682
2679
|
};
|
|
2683
2680
|
}
|
|
2684
2681
|
this.loading = !1, this.lastAction = void 0;
|
|
@@ -2693,22 +2690,22 @@ let m = class extends j {
|
|
|
2693
2690
|
if (s === 0 || i === 0)
|
|
2694
2691
|
return;
|
|
2695
2692
|
const n = this.cropSize.percentageWidth !== s, l = this.cropSize.percentageHeight !== i;
|
|
2696
|
-
let
|
|
2697
|
-
n && (g = Math.round(s * this.selectedFormat.width / 100)), l && (
|
|
2693
|
+
let p = this.cropSize.height, g = this.cropSize.width;
|
|
2694
|
+
n && (g = Math.round(s * this.selectedFormat.width / 100)), l && (p = Math.round(
|
|
2698
2695
|
i * this.selectedFormat.height / 100
|
|
2699
2696
|
));
|
|
2700
2697
|
const c = this.cropSize.focusMode;
|
|
2701
2698
|
this.focusModes.find(
|
|
2702
|
-
(
|
|
2699
|
+
(S) => S.value === c
|
|
2703
2700
|
)?.auto && this.selectedFormat?.url && this.cropperElement ? await this.handleRequestAutoCropSuggestion({
|
|
2704
2701
|
focusMode: c,
|
|
2705
|
-
height:
|
|
2702
|
+
height: p,
|
|
2706
2703
|
percentageHeight: i,
|
|
2707
2704
|
percentageWidth: s,
|
|
2708
2705
|
width: g
|
|
2709
2706
|
}) : this.cropSize = {
|
|
2710
2707
|
...this.cropSize,
|
|
2711
|
-
height:
|
|
2708
|
+
height: p,
|
|
2712
2709
|
percentageHeight: i,
|
|
2713
2710
|
percentageWidth: s,
|
|
2714
2711
|
width: g,
|
|
@@ -2742,12 +2739,12 @@ let m = class extends j {
|
|
|
2742
2739
|
* a proxy *id*, so the name has to be looked up in `proxies` rather than used directly.
|
|
2743
2740
|
*/
|
|
2744
2741
|
get autoResolvedProxyId() {
|
|
2745
|
-
const t =
|
|
2742
|
+
const t = Lt(this.asset?.extension, this.asset?.size);
|
|
2746
2743
|
return this.proxies?.find((e) => e.proxyName === t)?.id ?? "";
|
|
2747
2744
|
}
|
|
2748
2745
|
onProxyChange(t) {
|
|
2749
2746
|
const e = t.detail;
|
|
2750
|
-
if (this.lastAction =
|
|
2747
|
+
if (this.lastAction = m.Proxy, e.autoFormat) {
|
|
2751
2748
|
this.autoFormat = !0;
|
|
2752
2749
|
const i = this.autoResolvedProxyId;
|
|
2753
2750
|
i && (this.selectedProxy = i);
|
|
@@ -2764,7 +2761,7 @@ let m = class extends j {
|
|
|
2764
2761
|
});
|
|
2765
2762
|
else {
|
|
2766
2763
|
const s = this.focusModes.find(
|
|
2767
|
-
(
|
|
2764
|
+
(p) => p.value === this.cropSize.focusMode
|
|
2768
2765
|
)?.auto;
|
|
2769
2766
|
let a = this.cropSize.keepAspectRatio, r = this.cropSize.focusMode, n = this.cropSize.x, l = this.cropSize.y;
|
|
2770
2767
|
e === "free" ? (a = !1, r = "manual") : this.cropSize.unit === o.Pixel && !s && (n = 0, l = 0), s ? await this.handleRequestAutoCropSuggestion({
|
|
@@ -2810,11 +2807,11 @@ let m = class extends j {
|
|
|
2810
2807
|
Math.max(Math.round(s / i), 0),
|
|
2811
2808
|
this.resizeSize.height
|
|
2812
2809
|
) : 0, r = this.asset ? a * 100 / this.selectedFormat.height : 100, n = this.asset ? s * 100 / this.selectedFormat.width : 100;
|
|
2813
|
-
let l = this.cropSize.x,
|
|
2814
|
-
l + n > 100 && (l = 100 - n),
|
|
2810
|
+
let l = this.cropSize.x, p = this.cropSize.y;
|
|
2811
|
+
l + n > 100 && (l = 100 - n), p + r > 100 && (p = 100 - r);
|
|
2815
2812
|
let g = this.cropSize.cropMode;
|
|
2816
2813
|
this.cropModes.find(
|
|
2817
|
-
(
|
|
2814
|
+
(f) => f.value === g
|
|
2818
2815
|
)?.auto && (g = "free"), t.detail.silent ? (this.cropSize.height = a, this.cropSize.keepAspectRatio = t.detail.keepAspectRatio, this.cropSize.percentageHeight = r, this.cropSize.percentageWidth = n, this.cropSize.ratioHeight = t.detail.height, this.cropSize.ratioWidth = t.detail.width, this.cropSize.unit = o.AspectRatio, this.cropSize.width = s) : this.cropSize = {
|
|
2819
2816
|
...this.cropSize,
|
|
2820
2817
|
cropMode: g,
|
|
@@ -2827,7 +2824,7 @@ let m = class extends j {
|
|
|
2827
2824
|
unit: o.AspectRatio,
|
|
2828
2825
|
width: s,
|
|
2829
2826
|
x: l,
|
|
2830
|
-
y:
|
|
2827
|
+
y: p
|
|
2831
2828
|
};
|
|
2832
2829
|
} else {
|
|
2833
2830
|
const i = this.asset ? t.detail.height * 100 / this.selectedFormat.height : 100, s = this.asset ? t.detail.width * 100 / this.selectedFormat.width : 100;
|
|
@@ -2835,7 +2832,7 @@ let m = class extends j {
|
|
|
2835
2832
|
a + s > 100 && (a = 100 - s), r + i > 100 && (r = 100 - i);
|
|
2836
2833
|
let n = this.cropSize.cropMode;
|
|
2837
2834
|
const l = this.cropModes.find(
|
|
2838
|
-
(
|
|
2835
|
+
(p) => p.value === n
|
|
2839
2836
|
)?.auto;
|
|
2840
2837
|
(t.detail.breakAspectRatio || l) && (n = "free"), t.detail.silent ? (this.cropSize.cropMode = n, this.cropSize.height = t.detail.height, this.cropSize.keepAspectRatio = t.detail.keepAspectRatio, this.cropSize.percentageHeight = i, this.cropSize.percentageWidth = s, this.cropSize.unit = o.Pixel, this.cropSize.width = t.detail.width, this.cropSize.x = a, this.cropSize.y = r) : this.cropSize = {
|
|
2841
2838
|
...this.cropSize,
|
|
@@ -2865,43 +2862,43 @@ let m = class extends j {
|
|
|
2865
2862
|
});
|
|
2866
2863
|
}
|
|
2867
2864
|
onCropApply(t) {
|
|
2868
|
-
if (this.clearResetSnapshot(), this.lastAction =
|
|
2865
|
+
if (this.clearResetSnapshot(), this.lastAction = m.Crop, !this.asset) {
|
|
2869
2866
|
const {
|
|
2870
2867
|
focusMode: l,
|
|
2871
|
-
height:
|
|
2868
|
+
height: p,
|
|
2872
2869
|
position: g,
|
|
2873
2870
|
ratioHeight: c,
|
|
2874
|
-
ratioWidth:
|
|
2875
|
-
unit:
|
|
2876
|
-
width:
|
|
2877
|
-
x:
|
|
2878
|
-
y:
|
|
2879
|
-
} = this.cropSize,
|
|
2880
|
-
(
|
|
2871
|
+
ratioWidth: f,
|
|
2872
|
+
unit: S,
|
|
2873
|
+
width: x,
|
|
2874
|
+
x: d,
|
|
2875
|
+
y: v
|
|
2876
|
+
} = this.cropSize, k = this.focusModes.find(
|
|
2877
|
+
(z) => z.value === l
|
|
2881
2878
|
)?.auto ?? !1;
|
|
2882
|
-
if (
|
|
2883
|
-
|
|
2884
|
-
key:
|
|
2879
|
+
if (S === o.AspectRatio) {
|
|
2880
|
+
f && c && this.upsertTransformation({
|
|
2881
|
+
key: m.Crop,
|
|
2885
2882
|
value: {
|
|
2886
2883
|
focusMode: l,
|
|
2887
|
-
isFocusModeAuto:
|
|
2884
|
+
isFocusModeAuto: k,
|
|
2888
2885
|
position: g,
|
|
2889
2886
|
ratioHeight: c,
|
|
2890
|
-
ratioWidth:
|
|
2891
|
-
unit:
|
|
2887
|
+
ratioWidth: f,
|
|
2888
|
+
unit: S
|
|
2892
2889
|
}
|
|
2893
2890
|
});
|
|
2894
2891
|
return;
|
|
2895
2892
|
}
|
|
2896
|
-
(
|
|
2897
|
-
key:
|
|
2893
|
+
(p || x) && this.upsertTransformation({
|
|
2894
|
+
key: m.Crop,
|
|
2898
2895
|
value: {
|
|
2899
2896
|
focusMode: l,
|
|
2900
|
-
height:
|
|
2901
|
-
isFocusModeAuto:
|
|
2897
|
+
height: p,
|
|
2898
|
+
isFocusModeAuto: k,
|
|
2902
2899
|
position: g,
|
|
2903
|
-
unit:
|
|
2904
|
-
width:
|
|
2900
|
+
unit: S,
|
|
2901
|
+
width: x,
|
|
2905
2902
|
/**
|
|
2906
2903
|
* Without an asset there is no cropper to drag, so x/y are always the 0
|
|
2907
2904
|
* placeholder from cropSize's default — never a real manual offset. Omit
|
|
@@ -2909,8 +2906,8 @@ let m = class extends j {
|
|
|
2909
2906
|
* string) so `hasManualXY` in buildTransformationString doesn't spuriously
|
|
2910
2907
|
* suppress the focus mode / position `c_g_` gravity value.
|
|
2911
2908
|
*/
|
|
2912
|
-
x: Number.isFinite(
|
|
2913
|
-
y: Number.isFinite(
|
|
2909
|
+
x: Number.isFinite(d) && d !== 0 ? d : void 0,
|
|
2910
|
+
y: Number.isFinite(v) && v !== 0 ? v : void 0
|
|
2914
2911
|
}
|
|
2915
2912
|
});
|
|
2916
2913
|
return;
|
|
@@ -2922,15 +2919,15 @@ let m = class extends j {
|
|
|
2922
2919
|
(l) => l.value === r
|
|
2923
2920
|
)?.auto ?? !1;
|
|
2924
2921
|
if (e && a && s) {
|
|
2925
|
-
let l = a,
|
|
2926
|
-
if (s === o.AspectRatio && (l = this.cropSize.percentageWidth * this.selectedFormat.width / 100,
|
|
2922
|
+
let l = a, p = e;
|
|
2923
|
+
if (s === o.AspectRatio && (l = this.cropSize.percentageWidth * this.selectedFormat.width / 100, p = this.cropSize.percentageHeight * this.selectedFormat.height / 100), i)
|
|
2927
2924
|
this.transformations = [
|
|
2928
2925
|
...this.transformations,
|
|
2929
2926
|
{
|
|
2930
|
-
key:
|
|
2927
|
+
key: m.Crop,
|
|
2931
2928
|
value: {
|
|
2932
2929
|
focusMode: r,
|
|
2933
|
-
height:
|
|
2930
|
+
height: p,
|
|
2934
2931
|
isFocusModeAuto: n,
|
|
2935
2932
|
mode: i,
|
|
2936
2933
|
width: l
|
|
@@ -2942,10 +2939,10 @@ let m = class extends j {
|
|
|
2942
2939
|
this.transformations = [
|
|
2943
2940
|
...this.transformations,
|
|
2944
2941
|
{
|
|
2945
|
-
key:
|
|
2942
|
+
key: m.Crop,
|
|
2946
2943
|
value: {
|
|
2947
2944
|
focusMode: r,
|
|
2948
|
-
height:
|
|
2945
|
+
height: p,
|
|
2949
2946
|
isFocusModeAuto: n,
|
|
2950
2947
|
unit: s,
|
|
2951
2948
|
width: l,
|
|
@@ -2958,7 +2955,7 @@ let m = class extends j {
|
|
|
2958
2955
|
} else i && (this.transformations = [
|
|
2959
2956
|
...this.transformations,
|
|
2960
2957
|
{
|
|
2961
|
-
key:
|
|
2958
|
+
key: m.Crop,
|
|
2962
2959
|
value: {
|
|
2963
2960
|
focusMode: r,
|
|
2964
2961
|
isFocusModeAuto: n,
|
|
@@ -2993,13 +2990,13 @@ let m = class extends j {
|
|
|
2993
2990
|
}
|
|
2994
2991
|
onResizeApply(t) {
|
|
2995
2992
|
const { height: e, unit: i, width: s } = t.detail;
|
|
2996
|
-
if (this.clearResetSnapshot(), this.lastAction =
|
|
2993
|
+
if (this.clearResetSnapshot(), this.lastAction = m.Resize, !this.asset) {
|
|
2997
2994
|
if (i === o.AspectRatio) {
|
|
2998
|
-
const { ratioHeight:
|
|
2999
|
-
g &&
|
|
3000
|
-
key:
|
|
2995
|
+
const { ratioHeight: p, ratioWidth: g } = this.resizeSize;
|
|
2996
|
+
g && p && this.upsertTransformation({
|
|
2997
|
+
key: m.Resize,
|
|
3001
2998
|
value: {
|
|
3002
|
-
ratioHeight:
|
|
2999
|
+
ratioHeight: p,
|
|
3003
3000
|
ratioWidth: g,
|
|
3004
3001
|
unit: i
|
|
3005
3002
|
}
|
|
@@ -3007,7 +3004,7 @@ let m = class extends j {
|
|
|
3007
3004
|
return;
|
|
3008
3005
|
}
|
|
3009
3006
|
(e || s) && this.upsertTransformation({
|
|
3010
|
-
key:
|
|
3007
|
+
key: m.Resize,
|
|
3011
3008
|
value: {
|
|
3012
3009
|
height: e,
|
|
3013
3010
|
unit: i,
|
|
@@ -3023,7 +3020,7 @@ let m = class extends j {
|
|
|
3023
3020
|
this.resizeSize.unit !== i ? (n = a, l = r) : i === o.AspectRatio && (n = Math.round(s / e * r), l = r), this.transformations = [
|
|
3024
3021
|
...this.transformations,
|
|
3025
3022
|
{
|
|
3026
|
-
key:
|
|
3023
|
+
key: m.Resize,
|
|
3027
3024
|
value: {
|
|
3028
3025
|
height: l,
|
|
3029
3026
|
unit: i,
|
|
@@ -3037,21 +3034,21 @@ let m = class extends j {
|
|
|
3037
3034
|
}
|
|
3038
3035
|
onRotationApply(t) {
|
|
3039
3036
|
const e = t.detail;
|
|
3040
|
-
if (this.clearResetSnapshot(), this.lastAction =
|
|
3037
|
+
if (this.clearResetSnapshot(), this.lastAction = m.Rotate, !this.asset) {
|
|
3041
3038
|
e ? this.upsertTransformation({
|
|
3042
|
-
key:
|
|
3039
|
+
key: m.Rotate,
|
|
3043
3040
|
value: {
|
|
3044
3041
|
rotation: e
|
|
3045
3042
|
}
|
|
3046
3043
|
}) : this.transformations = this.transformations.filter(
|
|
3047
|
-
(i) => i.key !==
|
|
3044
|
+
(i) => i.key !== m.Rotate
|
|
3048
3045
|
);
|
|
3049
3046
|
return;
|
|
3050
3047
|
}
|
|
3051
3048
|
this.selectedFormat && (this.transformations = [
|
|
3052
3049
|
...this.transformations,
|
|
3053
3050
|
{
|
|
3054
|
-
key:
|
|
3051
|
+
key: m.Rotate,
|
|
3055
3052
|
value: {
|
|
3056
3053
|
rotation: e
|
|
3057
3054
|
}
|
|
@@ -3060,9 +3057,9 @@ let m = class extends j {
|
|
|
3060
3057
|
}
|
|
3061
3058
|
onQualityChange(t) {
|
|
3062
3059
|
const e = t.detail;
|
|
3063
|
-
this.selectedFormat && (this.selectedFormat.quality = e), this.clearResetSnapshot(), this.lastAction =
|
|
3060
|
+
this.selectedFormat && (this.selectedFormat.quality = e), this.clearResetSnapshot(), this.lastAction = m.Quality;
|
|
3064
3061
|
const i = {
|
|
3065
|
-
key:
|
|
3062
|
+
key: m.Quality,
|
|
3066
3063
|
value: {
|
|
3067
3064
|
quality: e
|
|
3068
3065
|
}
|
|
@@ -3076,22 +3073,22 @@ let m = class extends j {
|
|
|
3076
3073
|
keepMetadata: e
|
|
3077
3074
|
}), !this.asset) {
|
|
3078
3075
|
e ? this.upsertTransformation({
|
|
3079
|
-
key:
|
|
3076
|
+
key: m.Metadata,
|
|
3080
3077
|
value: {
|
|
3081
3078
|
keepMetadata: e
|
|
3082
3079
|
}
|
|
3083
3080
|
}) : this.transformations = this.transformations.filter(
|
|
3084
|
-
(i) => i.key !==
|
|
3081
|
+
(i) => i.key !== m.Metadata
|
|
3085
3082
|
);
|
|
3086
3083
|
return;
|
|
3087
3084
|
}
|
|
3088
3085
|
e ? this.upsertTransformation({
|
|
3089
|
-
key:
|
|
3086
|
+
key: m.Metadata,
|
|
3090
3087
|
value: {
|
|
3091
3088
|
keepMetadata: e
|
|
3092
3089
|
}
|
|
3093
3090
|
}) : this.transformations = this.transformations.filter(
|
|
3094
|
-
(i) => i.key !==
|
|
3091
|
+
(i) => i.key !== m.Metadata
|
|
3095
3092
|
);
|
|
3096
3093
|
}
|
|
3097
3094
|
onExtensionChange(t) {
|
|
@@ -3103,7 +3100,7 @@ let m = class extends j {
|
|
|
3103
3100
|
}
|
|
3104
3101
|
syncQuality() {
|
|
3105
3102
|
const t = this.transformations.findLast(
|
|
3106
|
-
(e) => e.key ===
|
|
3103
|
+
(e) => e.key === m.Quality
|
|
3107
3104
|
)?.value?.quality;
|
|
3108
3105
|
this.selectedFormat && (this.selectedFormat = {
|
|
3109
3106
|
...this.selectedFormat,
|
|
@@ -3141,198 +3138,198 @@ let m = class extends j {
|
|
|
3141
3138
|
this.transformations = [], this.frozenIndex = -1, this.syncQuality();
|
|
3142
3139
|
}
|
|
3143
3140
|
render() {
|
|
3144
|
-
return
|
|
3141
|
+
return C`<div class="asset-link-format" @cx-show=${this.onDetailsShow} @cx-hide=${this.onDetailsHide}>${M(
|
|
3145
3142
|
!this.hideHeader,
|
|
3146
|
-
() =>
|
|
3147
|
-
() =>
|
|
3143
|
+
() => C`<cx-space class="asset-link-format__section-header" direction="horizontal" spacing="small" align-items="center" justify-content="space-between"><cx-typography variant="body3">${this.localize.term("transformations")}</cx-typography><cx-space direction="horizontal" spacing="3x-small" align-items="center"><cx-button class="asset-link-format__undo" variant="custom" ?disabled=${!this.hasUnfrozenTransformations && this.preResetTransformations === void 0} @click=${this.handleUndo}>${this.localize.term("undo")}</cx-button>${M(this.canReset, () => C`<cx-button class="asset-link-format__reset" variant="custom" ?disabled=${!this.hasResettableState} @click=${this.handleReset}>${this.localize.term("reset")}</cx-button>`)}</cx-space></cx-space>`,
|
|
3144
|
+
() => Ot
|
|
3148
3145
|
)}
|
|
3149
3146
|
${M(
|
|
3150
3147
|
!this.noFormat,
|
|
3151
|
-
() =>
|
|
3148
|
+
() => 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 === m.Proxy} @cx-asset-link-format-proxy-change=${this.onProxyChange}></cx-asset-link-format-proxy>`
|
|
3152
3149
|
)}
|
|
3153
3150
|
${M(
|
|
3154
3151
|
!this.noCrop,
|
|
3155
|
-
() =>
|
|
3152
|
+
() => 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 === m.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[o.Pixel].width : 1 / 0} max-height=${this.asset ? this.lastResizeSize[o.Pixel].height : 1 / 0} percentage-width=${this.cropSize.percentageWidth} percentage-height=${this.cropSize.percentageHeight} 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>`
|
|
3156
3153
|
)}
|
|
3157
3154
|
${M(
|
|
3158
3155
|
!this.noResize,
|
|
3159
|
-
() =>
|
|
3156
|
+
() => C`<cx-asset-link-format-resize class="asset-link-format__details" ?open=${this.activeSetting === "cx-asset-link-format-resize"} ?loading=${this.loading && this.lastAction === m.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>`
|
|
3160
3157
|
)}
|
|
3161
3158
|
${M(
|
|
3162
3159
|
!this.noRotate,
|
|
3163
|
-
() =>
|
|
3164
|
-
)}<cx-asset-link-format-quality class="asset-link-format__details" ?loading=${this.loading && this.lastAction ===
|
|
3160
|
+
() => C`<cx-asset-link-format-rotation class="asset-link-format__details" ?loading=${this.loading && this.lastAction === m.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>`
|
|
3161
|
+
)}<cx-asset-link-format-quality class="asset-link-format__details" ?loading=${this.loading && this.lastAction === m.Quality} ?open=${this.activeSetting === "cx-asset-link-format-quality"} value=${this.selectedFormat?.quality ?? 100} @cx-asset-link-format-quality-change=${this.onQualityChange}></cx-asset-link-format-quality>${M(
|
|
3165
3162
|
!this.noMetadata,
|
|
3166
|
-
() =>
|
|
3163
|
+
() => 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>`
|
|
3167
3164
|
)}
|
|
3168
3165
|
${M(
|
|
3169
3166
|
this.useCustomExtension,
|
|
3170
|
-
() =>
|
|
3167
|
+
() => 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>`
|
|
3171
3168
|
)}</div>`;
|
|
3172
3169
|
}
|
|
3173
3170
|
};
|
|
3174
|
-
|
|
3175
|
-
|
|
3176
|
-
"cx-asset-link-format-crop":
|
|
3171
|
+
u.styles = [G, Ie];
|
|
3172
|
+
u.dependencies = {
|
|
3173
|
+
"cx-asset-link-format-crop": A,
|
|
3177
3174
|
"cx-asset-link-format-extension": Z,
|
|
3178
|
-
"cx-asset-link-format-metadata":
|
|
3175
|
+
"cx-asset-link-format-metadata": L,
|
|
3179
3176
|
"cx-asset-link-format-proxy": I,
|
|
3180
|
-
"cx-asset-link-format-quality":
|
|
3181
|
-
"cx-asset-link-format-resize":
|
|
3177
|
+
"cx-asset-link-format-quality": W,
|
|
3178
|
+
"cx-asset-link-format-resize": R,
|
|
3182
3179
|
"cx-asset-link-format-rotation": T,
|
|
3183
|
-
"cx-button":
|
|
3184
|
-
"cx-space":
|
|
3185
|
-
"cx-typography":
|
|
3180
|
+
"cx-button": K,
|
|
3181
|
+
"cx-space": U,
|
|
3182
|
+
"cx-typography": B
|
|
3186
3183
|
};
|
|
3187
|
-
|
|
3184
|
+
y([
|
|
3188
3185
|
h({ attribute: "base-url", type: String })
|
|
3189
|
-
],
|
|
3190
|
-
|
|
3186
|
+
], u.prototype, "baseUrl", 2);
|
|
3187
|
+
y([
|
|
3191
3188
|
h({ attribute: "token", type: String })
|
|
3192
|
-
],
|
|
3193
|
-
|
|
3189
|
+
], u.prototype, "token", 2);
|
|
3190
|
+
y([
|
|
3194
3191
|
h({ reflect: !1, type: Object })
|
|
3195
|
-
],
|
|
3196
|
-
|
|
3192
|
+
], u.prototype, "asset", 2);
|
|
3193
|
+
y([
|
|
3197
3194
|
h({ attribute: "crop-modes", reflect: !1, type: Array })
|
|
3198
|
-
],
|
|
3199
|
-
|
|
3195
|
+
], u.prototype, "cropModes", 2);
|
|
3196
|
+
y([
|
|
3200
3197
|
h({ attribute: "focus-modes", reflect: !1, type: Object })
|
|
3201
|
-
],
|
|
3202
|
-
|
|
3198
|
+
], u.prototype, "focusModes", 2);
|
|
3199
|
+
y([
|
|
3203
3200
|
h({ reflect: !1, type: Array })
|
|
3204
|
-
],
|
|
3205
|
-
|
|
3201
|
+
], u.prototype, "extensions", 2);
|
|
3202
|
+
y([
|
|
3206
3203
|
h({ reflect: !1, type: Array })
|
|
3207
|
-
],
|
|
3208
|
-
|
|
3204
|
+
], u.prototype, "proxies", 2);
|
|
3205
|
+
y([
|
|
3209
3206
|
h({ attribute: "for-cropper", reflect: !0, type: String })
|
|
3210
|
-
],
|
|
3211
|
-
|
|
3207
|
+
], u.prototype, "forCropper", 2);
|
|
3208
|
+
y([
|
|
3212
3209
|
h({ attribute: "use-session", reflect: !0, type: String })
|
|
3213
|
-
],
|
|
3214
|
-
|
|
3210
|
+
], u.prototype, "useSession", 2);
|
|
3211
|
+
y([
|
|
3215
3212
|
h({ reflect: !1, type: Array })
|
|
3216
|
-
],
|
|
3217
|
-
|
|
3213
|
+
], u.prototype, "transformations", 2);
|
|
3214
|
+
y([
|
|
3218
3215
|
h({ attribute: "selected-proxy", reflect: !0, type: String })
|
|
3219
|
-
],
|
|
3220
|
-
|
|
3216
|
+
], u.prototype, "selectedProxy", 2);
|
|
3217
|
+
y([
|
|
3221
3218
|
h({ attribute: "default-proxy", reflect: !0, type: String })
|
|
3222
|
-
],
|
|
3223
|
-
|
|
3219
|
+
], u.prototype, "defaultProxy", 2);
|
|
3220
|
+
y([
|
|
3224
3221
|
h({ attribute: "can-auto-format", reflect: !0, type: Boolean })
|
|
3225
|
-
],
|
|
3226
|
-
|
|
3222
|
+
], u.prototype, "canAutoFormat", 2);
|
|
3223
|
+
y([
|
|
3227
3224
|
h({ attribute: "auto-format", reflect: !0, type: Boolean })
|
|
3228
|
-
],
|
|
3229
|
-
|
|
3225
|
+
], u.prototype, "autoFormat", 2);
|
|
3226
|
+
y([
|
|
3230
3227
|
h({ attribute: "use-custom-extension", reflect: !0, type: Boolean })
|
|
3231
|
-
],
|
|
3232
|
-
|
|
3228
|
+
], u.prototype, "useCustomExtension", 2);
|
|
3229
|
+
y([
|
|
3233
3230
|
h({ attribute: "no-metadata", reflect: !0, type: Boolean })
|
|
3234
|
-
],
|
|
3235
|
-
|
|
3231
|
+
], u.prototype, "noMetadata", 2);
|
|
3232
|
+
y([
|
|
3236
3233
|
h({ attribute: "no-format", reflect: !0, type: Boolean })
|
|
3237
|
-
],
|
|
3238
|
-
|
|
3234
|
+
], u.prototype, "noFormat", 2);
|
|
3235
|
+
y([
|
|
3239
3236
|
h({ attribute: "no-crop", reflect: !0, type: Boolean })
|
|
3240
|
-
],
|
|
3241
|
-
|
|
3237
|
+
], u.prototype, "noCrop", 2);
|
|
3238
|
+
y([
|
|
3242
3239
|
h({ attribute: "no-resize", reflect: !0, type: Boolean })
|
|
3243
|
-
],
|
|
3244
|
-
|
|
3240
|
+
], u.prototype, "noResize", 2);
|
|
3241
|
+
y([
|
|
3245
3242
|
h({ attribute: "no-rotate", reflect: !0, type: Boolean })
|
|
3246
|
-
],
|
|
3247
|
-
|
|
3243
|
+
], u.prototype, "noRotate", 2);
|
|
3244
|
+
y([
|
|
3248
3245
|
h({ attribute: "last-image-size", reflect: !1, type: Object })
|
|
3249
|
-
],
|
|
3250
|
-
|
|
3246
|
+
], u.prototype, "lastImageSize", 2);
|
|
3247
|
+
y([
|
|
3251
3248
|
h({ attribute: "hide-header", reflect: !1, type: Boolean })
|
|
3252
|
-
],
|
|
3253
|
-
|
|
3249
|
+
], u.prototype, "hideHeader", 2);
|
|
3250
|
+
y([
|
|
3254
3251
|
h({ attribute: "can-reset", type: Boolean })
|
|
3255
|
-
],
|
|
3256
|
-
|
|
3252
|
+
], u.prototype, "canReset", 2);
|
|
3253
|
+
y([
|
|
3257
3254
|
h({ attribute: !1, reflect: !1, type: Object })
|
|
3258
|
-
],
|
|
3259
|
-
|
|
3260
|
-
|
|
3261
|
-
],
|
|
3262
|
-
|
|
3263
|
-
|
|
3264
|
-
],
|
|
3265
|
-
|
|
3266
|
-
|
|
3267
|
-
],
|
|
3268
|
-
|
|
3269
|
-
|
|
3270
|
-
],
|
|
3271
|
-
|
|
3272
|
-
|
|
3273
|
-
],
|
|
3274
|
-
|
|
3275
|
-
|
|
3276
|
-
],
|
|
3277
|
-
|
|
3278
|
-
|
|
3279
|
-
],
|
|
3280
|
-
|
|
3281
|
-
|
|
3282
|
-
],
|
|
3283
|
-
|
|
3284
|
-
|
|
3285
|
-
],
|
|
3286
|
-
|
|
3287
|
-
|
|
3288
|
-
],
|
|
3289
|
-
|
|
3290
|
-
|
|
3291
|
-
],
|
|
3292
|
-
|
|
3293
|
-
|
|
3294
|
-
],
|
|
3295
|
-
|
|
3296
|
-
|
|
3297
|
-
],
|
|
3298
|
-
|
|
3299
|
-
|
|
3300
|
-
],
|
|
3301
|
-
|
|
3302
|
-
|
|
3303
|
-
],
|
|
3304
|
-
|
|
3305
|
-
|
|
3306
|
-
],
|
|
3307
|
-
|
|
3308
|
-
|
|
3309
|
-
],
|
|
3310
|
-
|
|
3311
|
-
|
|
3312
|
-
],
|
|
3255
|
+
], u.prototype, "queryElement", 2);
|
|
3256
|
+
y([
|
|
3257
|
+
$()
|
|
3258
|
+
], u.prototype, "activeSetting", 2);
|
|
3259
|
+
y([
|
|
3260
|
+
$()
|
|
3261
|
+
], u.prototype, "selectedFormat", 2);
|
|
3262
|
+
y([
|
|
3263
|
+
$()
|
|
3264
|
+
], u.prototype, "resizeSize", 2);
|
|
3265
|
+
y([
|
|
3266
|
+
$()
|
|
3267
|
+
], u.prototype, "cropSize", 2);
|
|
3268
|
+
y([
|
|
3269
|
+
$()
|
|
3270
|
+
], u.prototype, "rotation", 2);
|
|
3271
|
+
y([
|
|
3272
|
+
$()
|
|
3273
|
+
], u.prototype, "defaultSize", 2);
|
|
3274
|
+
y([
|
|
3275
|
+
$()
|
|
3276
|
+
], u.prototype, "cropperElement", 2);
|
|
3277
|
+
y([
|
|
3278
|
+
$()
|
|
3279
|
+
], u.prototype, "parameters", 2);
|
|
3280
|
+
y([
|
|
3281
|
+
$()
|
|
3282
|
+
], u.prototype, "loading", 2);
|
|
3283
|
+
y([
|
|
3284
|
+
$()
|
|
3285
|
+
], u.prototype, "lastAction", 2);
|
|
3286
|
+
y([
|
|
3287
|
+
$()
|
|
3288
|
+
], u.prototype, "frozenIndex", 2);
|
|
3289
|
+
y([
|
|
3290
|
+
$()
|
|
3291
|
+
], u.prototype, "preResetTransformations", 2);
|
|
3292
|
+
y([
|
|
3293
|
+
$()
|
|
3294
|
+
], u.prototype, "preResetAutoFormat", 2);
|
|
3295
|
+
y([
|
|
3296
|
+
$()
|
|
3297
|
+
], u.prototype, "preResetSelectedProxy", 2);
|
|
3298
|
+
y([
|
|
3299
|
+
_("transformations")
|
|
3300
|
+
], u.prototype, "handleTransformationsChange", 1);
|
|
3301
|
+
y([
|
|
3302
|
+
_("selectedProxy")
|
|
3303
|
+
], u.prototype, "handleSelectedProxyChange", 1);
|
|
3304
|
+
y([
|
|
3305
|
+
_("loading")
|
|
3306
|
+
], u.prototype, "handleLoadingChange", 1);
|
|
3307
|
+
u = y([
|
|
3308
|
+
Q("cx-asset-link-format")
|
|
3309
|
+
], u);
|
|
3313
3310
|
export {
|
|
3314
|
-
|
|
3315
|
-
|
|
3316
|
-
|
|
3311
|
+
u as C,
|
|
3312
|
+
Zi as F,
|
|
3313
|
+
jt as M,
|
|
3317
3314
|
Re as a,
|
|
3318
|
-
|
|
3319
|
-
|
|
3315
|
+
Xt as b,
|
|
3316
|
+
nt as c,
|
|
3320
3317
|
mt as d,
|
|
3321
|
-
|
|
3322
|
-
|
|
3323
|
-
|
|
3324
|
-
|
|
3318
|
+
ft as e,
|
|
3319
|
+
qt as f,
|
|
3320
|
+
Rt as g,
|
|
3321
|
+
gt as h,
|
|
3325
3322
|
Me as i,
|
|
3326
|
-
|
|
3327
|
-
|
|
3328
|
-
|
|
3323
|
+
Qi as j,
|
|
3324
|
+
Xi as k,
|
|
3325
|
+
Gi as l,
|
|
3329
3326
|
ut as m,
|
|
3330
|
-
|
|
3331
|
-
|
|
3332
|
-
|
|
3333
|
-
|
|
3334
|
-
|
|
3335
|
-
|
|
3336
|
-
|
|
3337
|
-
|
|
3327
|
+
Et as n,
|
|
3328
|
+
Ui as o,
|
|
3329
|
+
Bi as p,
|
|
3330
|
+
Ht as q,
|
|
3331
|
+
qi as r,
|
|
3332
|
+
ji as s,
|
|
3333
|
+
Vi as t,
|
|
3334
|
+
pe as u
|
|
3338
3335
|
};
|