@orangelogic/design-system 4.3.0 → 4.4.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.C5Ue4EGP.js → asset-link-format.DTLA2CFh.js} +407 -388
- package/library/chunks/{button.DbAUlIXG.js → button.cbDkxJHn.js} +1 -1
- package/library/chunks/{color-swatch-group.B10yWbVM.js → color-swatch-group.CZSeCrot.js} +7 -7
- package/library/chunks/{confirm-popover.Cd4HM5-B.js → confirm-popover.Dvgoz-oA.js} +3 -3
- package/library/chunks/{dialog.CXphbq8N.js → dialog.BvSMV36r.js} +2 -2
- package/library/chunks/{document-viewer.B_ESlazf.js → document-viewer.BLdEjbza.js} +7 -7
- package/library/chunks/{dot-pagination.CzT-MZmt.js → dot-pagination.CukHxNBk.js} +1 -1
- package/library/chunks/{folder-select.BWeanVkA.js → folder-select.DAZQRdLq.js} +4 -4
- package/library/chunks/{header.Dy57RuQW.js → header.2RH_nPmz.js} +1 -1
- package/library/chunks/{i18n.Q5_2aVLU.js → i18n.BSPmBQ73.js} +1 -0
- package/library/chunks/{icon-button.BjAbCuH8.js → icon-button.DV5Fks8j.js} +1 -1
- package/library/chunks/{iframe.CdktjPCB.js → iframe.ddX2kGu3.js} +1 -1
- package/library/chunks/{image.CCo__54F.js → image.BM7bPTub.js} +174 -143
- package/library/chunks/{index.DiZGZkHv.js → index.DKKvxBAi.js} +70 -66
- package/library/chunks/{input.ftEf4GS6.js → input.7pumTpdu.js} +1 -1
- package/library/chunks/{markdown.RljldBNb.js → markdown.LHSzm035.js} +2 -2
- package/library/chunks/{menu-item.BNs1Ji48.js → menu-item.CqPvDGeN.js} +1 -1
- package/library/chunks/{option.C8IEnv5Q.js → option.dBUWN4sF.js} +1 -1
- package/library/chunks/{pagination.Bke9vgl4.js → pagination.C2f8lUVb.js} +5 -5
- package/library/chunks/{resizable-component.styles.CAfXABBc.js → resizable-component.styles.kMFDlGgv.js} +2 -2
- package/library/chunks/{tab-group.DZ32f41G.js → tab-group.DOnaT12G.js} +4 -4
- package/library/chunks/{tree.Umn7TAkc.js → tree.CHQ1WjZV.js} +1 -1
- package/library/chunks/{types.BW36Gr9c.js → types.PdpKNndx.js} +2519 -2411
- package/library/components/alert.js +2 -2
- package/library/components/asset-link-format.js +3 -3
- package/library/components/atoms.js +15 -15
- package/library/components/audio.js +3 -3
- package/library/components/border-input-group.js +2 -2
- package/library/components/breadcrumb.js +1 -1
- package/library/components/button.js +2 -2
- package/library/components/color-picker.js +6 -6
- package/library/components/color-swatch-group.js +2 -2
- package/library/components/color-swatch.js +1 -1
- package/library/components/confirm-popover.js +4 -4
- package/library/components/copy-button.js +1 -1
- package/library/components/corner-position-input-group.js +3 -3
- package/library/components/date-calendar.js +1 -1
- package/library/components/details.js +1 -1
- package/library/components/dialog.js +3 -3
- package/library/components/document-viewer.js +4 -4
- package/library/components/dot-pagination.js +2 -2
- package/library/components/drawer.js +2 -2
- package/library/components/dropdown.js +2 -2
- package/library/components/dynamic-select.js +4 -4
- package/library/components/e-chart.js +1 -1
- package/library/components/element-clamp.js +2 -2
- package/library/components/file-on-demand.js +9 -9
- package/library/components/folder-select.js +4 -4
- package/library/components/format-bytes.js +1 -1
- package/library/components/format-date.js +1 -1
- package/library/components/format-number.js +1 -1
- package/library/components/format-time.js +1 -1
- package/library/components/header.js +2 -2
- package/library/components/icon-button.js +2 -2
- package/library/components/iframe.js +2 -2
- package/library/components/image-comparer.js +1 -1
- package/library/components/image.js +3 -3
- package/library/components/input.js +2 -2
- package/library/components/line-clamp.js +1 -1
- package/library/components/markdown.js +3 -3
- package/library/components/masonry.js +2 -2
- package/library/components/menu-item.js +2 -2
- package/library/components/menu.js +2 -2
- package/library/components/molecules.js +2 -2
- package/library/components/option.js +2 -2
- package/library/components/organisms.js +2 -2
- package/library/components/padding-input-group.js +1 -1
- package/library/components/pagination.js +6 -6
- package/library/components/popup.js +1 -1
- package/library/components/position-picker.js +1 -1
- package/library/components/progress-bar.js +1 -1
- package/library/components/progress-ring.js +1 -1
- package/library/components/range.js +1 -1
- package/library/components/rating.js +1 -1
- package/library/components/relative-time.js +1 -1
- package/library/components/select.js +2 -2
- package/library/components/shadow-input-group.js +1 -1
- package/library/components/share-option-list.js +1 -1
- package/library/components/sidebar.js +1 -1
- package/library/components/size-input-group.js +3 -3
- package/library/components/spinner.js +1 -1
- package/library/components/split-panel.js +1 -1
- package/library/components/tab-group.js +5 -5
- package/library/components/tab.js +2 -2
- package/library/components/tag.js +2 -2
- package/library/components/tooltip.js +1 -1
- package/library/components/tree-item.js +2 -2
- package/library/components/tree.js +2 -2
- package/library/components/typeface.js +2 -2
- package/library/components/types.js +21 -21
- package/library/components/video.js +1341 -1294
- package/library/package.json +1 -1
- package/library/packages/atoms/src/components/image/image.d.ts +16 -0
- package/library/packages/atoms/src/components/video/video.d.ts +6 -0
- package/library/packages/events/src/cx-asset-transformation-dialog-confirm.d.ts +2 -0
- package/library/packages/molecules/src/icon-picker/icon-picker.d.ts +5 -6
- package/library/packages/organisms/src/asset-link-format/asset-link-format.d.ts +6 -0
- package/library/packages/organisms/src/asset-transformation-dialog/asset-transformation-dialog.d.ts +5 -1
- package/library/packages/organisms/src/content-builder/blocks/image/image.d.ts +10 -3
- package/library/packages/organisms/src/content-builder/configs/header.d.ts +1 -1
- package/library/packages/organisms/src/content-builder/configs/image.d.ts +2 -0
- package/library/packages/organisms/src/content-builder/configs-controller.d.ts +13 -0
- package/library/packages/organisms/src/content-builder/styleController.d.ts +2 -0
- package/library/packages/organisms/src/form/control-renderer/control-renderer.d.ts +6 -0
- package/library/packages/types/src/content-builder.d.ts +6 -2
- package/library/packages/utils/src/custom-element/i18n.d.ts +1 -0
- package/library/react-web-component.d.ts +4 -0
- package/library/utils.js +1 -1
- package/package.json +1 -1
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import "../components/cropper.js";
|
|
2
|
-
import { C as Y } from "./button.
|
|
3
|
-
import
|
|
4
|
-
import { C as
|
|
5
|
-
import { n as h, C as
|
|
2
|
+
import { C as Y } from "./button.cbDkxJHn.js";
|
|
3
|
+
import q from "../components/space.js";
|
|
4
|
+
import { C as U } from "./typography.BLYdTF0n.js";
|
|
5
|
+
import { n as h, C as B } from "./lib-cortex-element.CVMmyPMC.js";
|
|
6
6
|
import { h as E, a as Dt, C as Nt, S as Jt, b as te, c as ee, d as ie } from "./endpoints.mJ5S-tIs.js";
|
|
7
7
|
import "./browser.BHOCIF_A.js";
|
|
8
8
|
import { i as j, x as C, E as Ot } from "./lit-element.jLBm65_O.js";
|
|
9
9
|
import "./form.LpappO1d.js";
|
|
10
|
-
import { L as V } from "./i18n.
|
|
10
|
+
import { L as V } from "./i18n.BSPmBQ73.js";
|
|
11
11
|
import { a as se } from "./string.CfI2ejyR.js";
|
|
12
12
|
import "./date-picker.BGHn6qg8.js";
|
|
13
13
|
import { a as bt, r as Lt, b as ae, c as oe, d as dt } from "./transformation.Dm-pK2ft.js";
|
|
@@ -15,7 +15,7 @@ import "./content-builder.CBBdfVOl.js";
|
|
|
15
15
|
import "./unsafe-html.Dff7-rCx.js";
|
|
16
16
|
import { b as re } from "./_baseUniq.lwMgmtt2.js";
|
|
17
17
|
import { c as G } from "./component.styles.CAS3c9pM.js";
|
|
18
|
-
import { M as rt, U as o, T as
|
|
18
|
+
import { M as rt, U as o, T as m } from "./asset-link-format.ClaYu_v8.js";
|
|
19
19
|
import { v as ne } from "./v4.CKZ6klMF.js";
|
|
20
20
|
import { P as N } from "./position-picker.qkbJlboF.js";
|
|
21
21
|
import { c as Q } from "./custom-element.L4WJXn1j.js";
|
|
@@ -24,24 +24,24 @@ import { s as Mt, a as ut } from "./number.Cx2ncfJJ.js";
|
|
|
24
24
|
import { r as $ } from "./state.CSDxrqLd.js";
|
|
25
25
|
import { n as M } from "./when.Dr1es41R.js";
|
|
26
26
|
import at from "../components/details.js";
|
|
27
|
-
import
|
|
27
|
+
import qt from "../components/divider.js";
|
|
28
28
|
import { C as ot } from "./icon.BLXWp6CU.js";
|
|
29
|
-
import { C as Ct } from "./icon-button.
|
|
30
|
-
import { C as kt } from "./input.
|
|
31
|
-
import { C as yt } from "./option.
|
|
29
|
+
import { C as Ct } from "./icon-button.DV5Fks8j.js";
|
|
30
|
+
import { C as kt } from "./input.7pumTpdu.js";
|
|
31
|
+
import { C as yt } from "./option.dBUWN4sF.js";
|
|
32
32
|
import St from "../components/select.js";
|
|
33
33
|
import he from "../components/position-picker.js";
|
|
34
34
|
import { c as le } from "./image.Y5c_hFx8.js";
|
|
35
35
|
import { e as J } from "./query.BBf1UFkC.js";
|
|
36
36
|
import { c as nt } from "./repeat.CFjcER6_.js";
|
|
37
37
|
import { o as O } from "./style-map.llVFPd__.js";
|
|
38
|
-
import
|
|
38
|
+
import Ut from "../components/tooltip.js";
|
|
39
39
|
import ce from "../components/button-group.js";
|
|
40
40
|
import pe from "../components/checkbox.js";
|
|
41
41
|
function de(t) {
|
|
42
42
|
return t && t.length ? re(t) : [];
|
|
43
43
|
}
|
|
44
|
-
function
|
|
44
|
+
function Bt(t) {
|
|
45
45
|
return typeof t == "object" && t !== null && "URI" in t;
|
|
46
46
|
}
|
|
47
47
|
const ue = {
|
|
@@ -131,28 +131,28 @@ function mt(t) {
|
|
|
131
131
|
}
|
|
132
132
|
return ge(t);
|
|
133
133
|
}
|
|
134
|
-
const xe = "CoreField.LargeSizePreview", ht = "CoreField.DocType", Rt = "Document.Title", ye = "Document.CaptionLong", lt = "Document.FileExtension", ft = "CoreField.FileSize", Et = "CoreField.Identifier",
|
|
134
|
+
const xe = "CoreField.LargeSizePreview", ht = "CoreField.DocType", Rt = "Document.Title", ye = "Document.CaptionLong", lt = "Document.FileExtension", ft = "CoreField.FileSize", Et = "CoreField.Identifier", Bi = "CoreField.MaxHeight", ji = "CoreField.MaxWidth", gt = "Document.RecordID", Ht = "CoreField.DocSubType", xt = "CoreField.TitleWithFallback", st = "CoreField.OriginalFileName", jt = "__width", Vt = "__height", Se = "CoreField.OriginalPreview", Vi = "Document.DocSubType", Gi = "Document.InPoint", Qi = "Document.OutPoint", Tt = {
|
|
135
135
|
DEFAULT_VIEW_SIZE: "Document.LargeSizePreview",
|
|
136
136
|
ORIGINAL_VIEW_SIZE: "Document.OriginalPreview"
|
|
137
137
|
}, Gt = {
|
|
138
138
|
[xe]: Tt.DEFAULT_VIEW_SIZE,
|
|
139
139
|
[Se]: Tt.ORIGINAL_VIEW_SIZE
|
|
140
|
-
},
|
|
140
|
+
}, ve = Object.fromEntries(
|
|
141
141
|
Object.entries(Gt).map(([t, e]) => [
|
|
142
142
|
e,
|
|
143
143
|
t
|
|
144
144
|
])
|
|
145
145
|
);
|
|
146
|
-
function
|
|
146
|
+
function Ae(t) {
|
|
147
147
|
return Gt[t] ?? t;
|
|
148
148
|
}
|
|
149
149
|
function ze(t) {
|
|
150
|
-
return t === xt ? [Rt, st] : [
|
|
150
|
+
return t === xt ? [Rt, st] : [Ae(t)];
|
|
151
151
|
}
|
|
152
152
|
function be(t) {
|
|
153
153
|
const e = {};
|
|
154
154
|
for (const [i, s] of Object.entries(t)) {
|
|
155
|
-
const a =
|
|
155
|
+
const a = ve[i] ?? i;
|
|
156
156
|
e[a] = s;
|
|
157
157
|
}
|
|
158
158
|
return e;
|
|
@@ -160,7 +160,7 @@ function be(t) {
|
|
|
160
160
|
function Qt(t, e, i) {
|
|
161
161
|
t[i] = H(e, i);
|
|
162
162
|
const s = e[i];
|
|
163
|
-
return s != null &&
|
|
163
|
+
return s != null && Bt(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;
|
|
164
164
|
}
|
|
165
165
|
function we(t) {
|
|
166
166
|
const e = new URLSearchParams();
|
|
@@ -178,12 +178,12 @@ async function Xt({
|
|
|
178
178
|
pageNumber: n,
|
|
179
179
|
query: l,
|
|
180
180
|
securityByPassToken: p,
|
|
181
|
-
siteUrl:
|
|
182
|
-
sort:
|
|
181
|
+
siteUrl: c,
|
|
182
|
+
sort: g,
|
|
183
183
|
token: u,
|
|
184
184
|
useSession: y
|
|
185
185
|
}) {
|
|
186
|
-
const S = i?.flatMap(ze), d = i?.includes(xt) ?? !1,
|
|
186
|
+
const S = i?.flatMap(ze), d = i?.includes(xt) ?? !1, v = (F) => {
|
|
187
187
|
const z = be(F);
|
|
188
188
|
return d && (z[xt] = H(z, Rt) || H(z, st)), z;
|
|
189
189
|
}, k = {
|
|
@@ -201,12 +201,12 @@ async function Xt({
|
|
|
201
201
|
PageNumber: n,
|
|
202
202
|
Query: mt(l),
|
|
203
203
|
SecurityByPassToken: p || void 0,
|
|
204
|
-
Sort:
|
|
204
|
+
Sort: g || void 0,
|
|
205
205
|
UseSession: y || void 0
|
|
206
206
|
}, b = a === "POST";
|
|
207
207
|
try {
|
|
208
208
|
return (await E.request({
|
|
209
|
-
baseURL:
|
|
209
|
+
baseURL: c,
|
|
210
210
|
headers: u ? { Authorization: `Bearer ${u}` } : void 0,
|
|
211
211
|
method: a,
|
|
212
212
|
// POST large RecordID queries as a urlencoded body to dodge the ~2KB URL cap;
|
|
@@ -216,11 +216,11 @@ async function Xt({
|
|
|
216
216
|
transformResponse: [
|
|
217
217
|
...Array.isArray(E.defaults.transformResponse) ? E.defaults.transformResponse : [],
|
|
218
218
|
r ? (z) => ({
|
|
219
|
-
items: (z.results?.Items ?? []).map(
|
|
219
|
+
items: (z.results?.Items ?? []).map(v),
|
|
220
220
|
sort: z.results?.GlobalInfo?.Sort ?? "",
|
|
221
221
|
totalCount: z.results?.GlobalInfo?.TotalCount ?? 0
|
|
222
222
|
}) : (z) => ({
|
|
223
|
-
items: (z.APIResponse?.Items ?? []).map(
|
|
223
|
+
items: (z.APIResponse?.Items ?? []).map(v),
|
|
224
224
|
sort: z.APIResponse?.GlobalInfo?.Sort ?? "",
|
|
225
225
|
totalCount: z.APIResponse?.GlobalInfo?.TotalCount ?? 0
|
|
226
226
|
})
|
|
@@ -287,8 +287,8 @@ async function $e({
|
|
|
287
287
|
Rt,
|
|
288
288
|
ye,
|
|
289
289
|
gt
|
|
290
|
-
],
|
|
291
|
-
|
|
290
|
+
], c = Re(a, ke), g = await Promise.all(
|
|
291
|
+
c.map(
|
|
292
292
|
(d) => Xt({
|
|
293
293
|
consistency: t,
|
|
294
294
|
countPerPage: d.length,
|
|
@@ -302,24 +302,24 @@ async function $e({
|
|
|
302
302
|
token: n
|
|
303
303
|
})
|
|
304
304
|
)
|
|
305
|
-
), u = new Map(a.map((d,
|
|
305
|
+
), u = new Map(a.map((d, v) => [d, v])), y = g.flatMap((d) => d.items).map((d) => ({
|
|
306
306
|
name: H(d, st),
|
|
307
307
|
recordId: H(d, gt),
|
|
308
308
|
...l.reduce(
|
|
309
|
-
(
|
|
309
|
+
(v, k) => Qt(v, d, k),
|
|
310
310
|
{}
|
|
311
311
|
)
|
|
312
312
|
})).sort(
|
|
313
|
-
(d,
|
|
314
|
-
), S =
|
|
315
|
-
(d,
|
|
313
|
+
(d, v) => (u.get(d.recordId) ?? 1 / 0) - (u.get(v.recordId) ?? 1 / 0)
|
|
314
|
+
), S = g.reduce(
|
|
315
|
+
(d, v) => d + v.totalCount,
|
|
316
316
|
0
|
|
317
317
|
);
|
|
318
318
|
return { facets: [], items: y, totalCount: S };
|
|
319
319
|
}
|
|
320
320
|
function H(t, e) {
|
|
321
321
|
const i = t[e];
|
|
322
|
-
return i == null ? "" : typeof i == "string" ? i : typeof i == "number" || typeof i == "boolean" ? String(i) :
|
|
322
|
+
return i == null ? "" : typeof i == "string" ? i : typeof i == "number" || typeof i == "boolean" ? String(i) : Bt(i) ? i.URI : "";
|
|
323
323
|
}
|
|
324
324
|
async function Pe({
|
|
325
325
|
consistency: t,
|
|
@@ -331,8 +331,8 @@ async function Pe({
|
|
|
331
331
|
limitedDocTypes: n,
|
|
332
332
|
pageNumber: l,
|
|
333
333
|
parentFolderIdentifier: p,
|
|
334
|
-
searchTerm:
|
|
335
|
-
securityByPassToken:
|
|
334
|
+
searchTerm: c,
|
|
335
|
+
securityByPassToken: g,
|
|
336
336
|
sortOrder: u,
|
|
337
337
|
token: y
|
|
338
338
|
}) {
|
|
@@ -342,7 +342,7 @@ async function Pe({
|
|
|
342
342
|
directParentFolderIdentifier: i,
|
|
343
343
|
parentFolderIdentifier: p,
|
|
344
344
|
...n && n.length > 0 ? { docType: n } : {}
|
|
345
|
-
},
|
|
345
|
+
}, v = await Xt({
|
|
346
346
|
consistency: t,
|
|
347
347
|
countPerPage: e,
|
|
348
348
|
fields: [
|
|
@@ -360,10 +360,10 @@ async function Pe({
|
|
|
360
360
|
isSiteBuilder: r,
|
|
361
361
|
pageNumber: l,
|
|
362
362
|
query: d,
|
|
363
|
-
securityByPassToken:
|
|
363
|
+
securityByPassToken: g,
|
|
364
364
|
sort: void 0,
|
|
365
365
|
token: y
|
|
366
|
-
}), k =
|
|
366
|
+
}), k = v.items.map((b) => {
|
|
367
367
|
let F = H(b, lt);
|
|
368
368
|
F && !F.startsWith(".") && (F = "." + F);
|
|
369
369
|
const z = H(b, gt);
|
|
@@ -385,7 +385,7 @@ async function Pe({
|
|
|
385
385
|
return {
|
|
386
386
|
facets: [],
|
|
387
387
|
items: k,
|
|
388
|
-
totalCount:
|
|
388
|
+
totalCount: v.totalCount
|
|
389
389
|
};
|
|
390
390
|
}
|
|
391
391
|
async function Fe({
|
|
@@ -510,7 +510,7 @@ async function Ki({
|
|
|
510
510
|
return i;
|
|
511
511
|
}
|
|
512
512
|
}
|
|
513
|
-
const
|
|
513
|
+
const At = 20, Z = "TR1", ct = "TRX", _e = /* @__PURE__ */ new Set([".gif"]), Me = /* @__PURE__ */ new Set([
|
|
514
514
|
".avif",
|
|
515
515
|
".bmp",
|
|
516
516
|
".gif",
|
|
@@ -538,14 +538,14 @@ function Wt({
|
|
|
538
538
|
manualFormat: n,
|
|
539
539
|
size: l
|
|
540
540
|
}) {
|
|
541
|
-
const p = s?.toLowerCase() ?? "",
|
|
541
|
+
const p = s?.toLowerCase() ?? "", c = p.startsWith(".") ? p : `.${p}`, g = `path_${Z}`, u = (d, v) => {
|
|
542
542
|
const k = r[d];
|
|
543
543
|
if (!k)
|
|
544
544
|
return;
|
|
545
545
|
const b = r[`${d}${jt}`], F = r[`${d}${Vt}`], z = t ? bt(k, [], {
|
|
546
546
|
autoFormat: !n,
|
|
547
547
|
extension: p,
|
|
548
|
-
format:
|
|
548
|
+
format: v
|
|
549
549
|
}) : k;
|
|
550
550
|
return {
|
|
551
551
|
maxHeight: F,
|
|
@@ -553,25 +553,25 @@ function Wt({
|
|
|
553
553
|
src: z,
|
|
554
554
|
srcset: e ? ae(z, {
|
|
555
555
|
extension: p,
|
|
556
|
-
format:
|
|
556
|
+
format: v,
|
|
557
557
|
maxWidth: oe(n, b)
|
|
558
558
|
}) : ""
|
|
559
559
|
};
|
|
560
560
|
};
|
|
561
561
|
if (!n) {
|
|
562
|
-
const d = Lt(p, l),
|
|
563
|
-
return u(
|
|
562
|
+
const d = Lt(p, l), v = `path_${d}`;
|
|
563
|
+
return u(v, d) ?? u(g, Z) ?? {};
|
|
564
564
|
}
|
|
565
565
|
const y = a ? `path_${a}` : void 0;
|
|
566
|
-
return y && r[y] ? a !== ct || Ie(i, p) ? u(y, a) ?? {} : u(
|
|
566
|
+
return y && r[y] ? a !== ct || Ie(i, p) ? u(y, a) ?? {} : u(g, Z) ?? {} : !!p && _e.has(c) ? u(`path_${ct}`, ct) ?? u(g, Z) ?? {} : u(g, Z) ?? {};
|
|
567
567
|
}
|
|
568
568
|
class Yi {
|
|
569
569
|
constructor(e, i) {
|
|
570
|
-
this.data = [], this.folderId = "", this.fetchedPages = /* @__PURE__ */ new Set(), this.totalCount = 0, this.maxEnd = 1 / 0, this.pageSize =
|
|
570
|
+
this.data = [], this.folderId = "", this.fetchedPages = /* @__PURE__ */ new Set(), this.totalCount = 0, this.maxEnd = 1 / 0, this.pageSize = At, this.requestEpoch = 0, this.host = e, this.host.addController?.(this);
|
|
571
571
|
const s = i?.maxEnd;
|
|
572
572
|
this.maxEnd = typeof s == "number" && Number.isFinite(s) && s >= 0 ? Math.floor(s) : 1 / 0;
|
|
573
573
|
const a = i?.pageSize;
|
|
574
|
-
this.pageSize = typeof a == "number" && Number.isFinite(a) && a >= 1 ? Math.floor(a) :
|
|
574
|
+
this.pageSize = typeof a == "number" && Number.isFinite(a) && a >= 1 ? Math.floor(a) : At, 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;
|
|
575
575
|
}
|
|
576
576
|
get totalDataCount() {
|
|
577
577
|
return this.totalCount;
|
|
@@ -589,7 +589,7 @@ class Yi {
|
|
|
589
589
|
* Shrinking is ignored once pages are cached: collapsing already has what it needs.
|
|
590
590
|
*/
|
|
591
591
|
setPageSize(e) {
|
|
592
|
-
const i = Number.isFinite(e) && e >= 1 ? Math.floor(e) :
|
|
592
|
+
const i = Number.isFinite(e) && e >= 1 ? Math.floor(e) : At;
|
|
593
593
|
if (this.pageSize === i)
|
|
594
594
|
return;
|
|
595
595
|
const s = this.fetchedPages.size > 0;
|
|
@@ -610,9 +610,9 @@ class Yi {
|
|
|
610
610
|
const l = this.requestEpoch;
|
|
611
611
|
if (!this.folderId || l !== this.requestEpoch)
|
|
612
612
|
return this.data;
|
|
613
|
-
const p = s ? `path_${s}` : void 0,
|
|
613
|
+
const p = s ? `path_${s}` : void 0, c = `path_${Z}`, g = `path_${ct}`, u = [
|
|
614
614
|
...new Set(
|
|
615
|
-
[p,
|
|
615
|
+
[p, c, g].filter(
|
|
616
616
|
(d) => !!d
|
|
617
617
|
)
|
|
618
618
|
)
|
|
@@ -620,7 +620,7 @@ class Yi {
|
|
|
620
620
|
for (let d = y; d <= S; d++) {
|
|
621
621
|
if (this.fetchedPages.has(d))
|
|
622
622
|
continue;
|
|
623
|
-
const
|
|
623
|
+
const v = await Pe({
|
|
624
624
|
consistency: this.consistency,
|
|
625
625
|
countPerPage: this.pageSize,
|
|
626
626
|
directParentFolderIdentifier: this.folderId,
|
|
@@ -636,8 +636,8 @@ class Yi {
|
|
|
636
636
|
});
|
|
637
637
|
if (l !== this.requestEpoch)
|
|
638
638
|
return this.data;
|
|
639
|
-
if (this.fetchedPages.add(d), !this.totalCount &&
|
|
640
|
-
const b = Math.min(this.maxEnd,
|
|
639
|
+
if (this.fetchedPages.add(d), !this.totalCount && v.totalCount) {
|
|
640
|
+
const b = Math.min(this.maxEnd, v.totalCount);
|
|
641
641
|
this.totalCount = b, this.data = Array.from({ length: b }, () => ({
|
|
642
642
|
alt: "",
|
|
643
643
|
id: `temp-${ne()}`,
|
|
@@ -646,10 +646,10 @@ class Yi {
|
|
|
646
646
|
}));
|
|
647
647
|
}
|
|
648
648
|
const k = (d - 1) * this.pageSize;
|
|
649
|
-
for (let b = 0; b <
|
|
649
|
+
for (let b = 0; b < v.items.length; b++) {
|
|
650
650
|
const F = k + b;
|
|
651
651
|
if (F < this.data.length) {
|
|
652
|
-
const z =
|
|
652
|
+
const z = v.items[b], {
|
|
653
653
|
maxHeight: et,
|
|
654
654
|
maxWidth: it,
|
|
655
655
|
src: Kt,
|
|
@@ -693,28 +693,28 @@ class Yi {
|
|
|
693
693
|
manualFormat: n = !0,
|
|
694
694
|
minLimit: l = 5,
|
|
695
695
|
noPlaceholders: p = !1,
|
|
696
|
-
transformations:
|
|
696
|
+
transformations: c
|
|
697
697
|
}) {
|
|
698
698
|
(!this.folderId || this.folderId !== s) && (this.folderId = s, this.resetFolderState()), a && this.resetPageCache();
|
|
699
|
-
const
|
|
699
|
+
const g = Math.max(5, l), u = e, y = e + g, S = [...i];
|
|
700
700
|
await this.fetchImages({
|
|
701
701
|
end: y,
|
|
702
702
|
extraFields: S.filter((k) => k !== ""),
|
|
703
703
|
format: r,
|
|
704
704
|
manualFormat: n,
|
|
705
705
|
start: u,
|
|
706
|
-
transformations:
|
|
706
|
+
transformations: c
|
|
707
707
|
});
|
|
708
|
-
let d = e -
|
|
708
|
+
let d = e - g;
|
|
709
709
|
d < 0 && (this.totalCount === 0 ? d = 0 : d = Math.max(0, this.totalCount + d));
|
|
710
|
-
const
|
|
710
|
+
const v = d + g;
|
|
711
711
|
return await this.fetchImages({
|
|
712
|
-
end:
|
|
712
|
+
end: v,
|
|
713
713
|
extraFields: S.filter((k) => k !== ""),
|
|
714
714
|
format: r,
|
|
715
715
|
manualFormat: n,
|
|
716
716
|
start: d,
|
|
717
|
-
transformations:
|
|
717
|
+
transformations: c
|
|
718
718
|
}), p ? this.data.filter((k) => k.id && !k.id.startsWith("temp-")) : this.data;
|
|
719
719
|
}
|
|
720
720
|
async fetchImagesByIDs({
|
|
@@ -726,16 +726,16 @@ class Yi {
|
|
|
726
726
|
}) {
|
|
727
727
|
if (a.length === 0)
|
|
728
728
|
return [];
|
|
729
|
-
const n = i ? `path_${i}` : void 0, l = `path_${Z}`, p = `path_${ct}`,
|
|
729
|
+
const n = i ? `path_${i}` : void 0, l = `path_${Z}`, p = `path_${ct}`, c = [
|
|
730
730
|
...new Set(
|
|
731
731
|
[n, l, p].filter(
|
|
732
732
|
(S) => !!S
|
|
733
733
|
)
|
|
734
734
|
)
|
|
735
|
-
],
|
|
735
|
+
], g = [lt, ft], u = [...e, ht];
|
|
736
736
|
return (await $e({
|
|
737
737
|
consistency: this.consistency,
|
|
738
|
-
extraFields: [...u, ...
|
|
738
|
+
extraFields: [...u, ...c, ...g].filter((S) => S !== ""),
|
|
739
739
|
getPermanentAssetsPaths: !0,
|
|
740
740
|
isSiteBuilder: this.isSiteBuilder,
|
|
741
741
|
recordIds: a,
|
|
@@ -744,7 +744,7 @@ class Yi {
|
|
|
744
744
|
})).items.map((S) => {
|
|
745
745
|
const {
|
|
746
746
|
maxHeight: d,
|
|
747
|
-
maxWidth:
|
|
747
|
+
maxWidth: v,
|
|
748
748
|
src: k,
|
|
749
749
|
srcset: b
|
|
750
750
|
} = Wt({
|
|
@@ -764,7 +764,7 @@ class Yi {
|
|
|
764
764
|
extension: S[lt] || "",
|
|
765
765
|
id: S.recordId,
|
|
766
766
|
maxHeight: d,
|
|
767
|
-
maxWidth:
|
|
767
|
+
maxWidth: v,
|
|
768
768
|
name: S.name,
|
|
769
769
|
src: F,
|
|
770
770
|
srcset: z,
|
|
@@ -784,17 +784,17 @@ class Yi {
|
|
|
784
784
|
noPlaceholders: n = !1,
|
|
785
785
|
page: l,
|
|
786
786
|
pageSize: p = 10,
|
|
787
|
-
transformations:
|
|
787
|
+
transformations: c
|
|
788
788
|
}) {
|
|
789
789
|
(!this.folderId || this.folderId !== i) && (this.folderId = i, this.resetFolderState()), s && this.resetPageCache();
|
|
790
|
-
const
|
|
790
|
+
const g = l * p, u = g + p - 1;
|
|
791
791
|
return await this.fetchImages({
|
|
792
792
|
end: u,
|
|
793
793
|
extraFields: e,
|
|
794
794
|
format: a,
|
|
795
795
|
manualFormat: r,
|
|
796
|
-
start:
|
|
797
|
-
transformations:
|
|
796
|
+
start: g,
|
|
797
|
+
transformations: c
|
|
798
798
|
}), n ? this.data.filter((y) => y.id && !y.id.startsWith("temp-")) : this.data;
|
|
799
799
|
}
|
|
800
800
|
async *fetchImagesInFolderByChunk({
|
|
@@ -806,9 +806,9 @@ class Yi {
|
|
|
806
806
|
format: n,
|
|
807
807
|
manualFormat: l = !0,
|
|
808
808
|
start: p = 0,
|
|
809
|
-
transformations:
|
|
809
|
+
transformations: c
|
|
810
810
|
}) {
|
|
811
|
-
const
|
|
811
|
+
const g = Math.max(1, e);
|
|
812
812
|
if ((!this.folderId || this.folderId !== a) && (this.folderId = a, this.resetFolderState()), r && this.resetPageCache(), i !== -1) {
|
|
813
813
|
await this.fetchImages({
|
|
814
814
|
end: i,
|
|
@@ -816,27 +816,27 @@ class Yi {
|
|
|
816
816
|
format: n,
|
|
817
817
|
manualFormat: l,
|
|
818
818
|
start: p,
|
|
819
|
-
transformations:
|
|
819
|
+
transformations: c
|
|
820
820
|
}), yield this.data;
|
|
821
821
|
return;
|
|
822
822
|
}
|
|
823
|
-
let u = p, y = p +
|
|
823
|
+
let u = p, y = p + g;
|
|
824
824
|
if (await this.fetchImages({
|
|
825
825
|
end: y,
|
|
826
826
|
extraFields: s,
|
|
827
827
|
format: n,
|
|
828
828
|
manualFormat: l,
|
|
829
829
|
start: u,
|
|
830
|
-
transformations:
|
|
830
|
+
transformations: c
|
|
831
831
|
}), yield this.data, !(!this.totalCount || this.totalCount <= y))
|
|
832
832
|
for (; y < this.totalCount; )
|
|
833
|
-
u = y, y = Math.min(y +
|
|
833
|
+
u = y, y = Math.min(y + g, this.totalCount), await this.fetchImages({
|
|
834
834
|
end: y,
|
|
835
835
|
extraFields: s,
|
|
836
836
|
format: n,
|
|
837
837
|
manualFormat: l,
|
|
838
838
|
start: u,
|
|
839
|
-
transformations:
|
|
839
|
+
transformations: c
|
|
840
840
|
}), yield this.data;
|
|
841
841
|
}
|
|
842
842
|
hostConnected() {
|
|
@@ -857,7 +857,7 @@ var Te = Object.defineProperty, We = Object.getOwnPropertyDescriptor, w = (t, e,
|
|
|
857
857
|
(n = t[r]) && (a = (s ? n(e, i, a) : n(a)) || a);
|
|
858
858
|
return s && a && Te(e, i, a), a;
|
|
859
859
|
};
|
|
860
|
-
let
|
|
860
|
+
let A = class extends B {
|
|
861
861
|
constructor() {
|
|
862
862
|
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 = {
|
|
863
863
|
[o.Pixel]: {
|
|
@@ -1134,117 +1134,117 @@ let v = class extends q {
|
|
|
1134
1134
|
})} @click=${this.handleApply}>${this.localize.term("apply")}</cx-button></cx-space></cx-details>`;
|
|
1135
1135
|
}
|
|
1136
1136
|
};
|
|
1137
|
-
|
|
1138
|
-
|
|
1137
|
+
A.styles = [G, He];
|
|
1138
|
+
A.dependencies = {
|
|
1139
1139
|
"cx-button": Y,
|
|
1140
1140
|
"cx-details": at,
|
|
1141
|
-
"cx-divider":
|
|
1141
|
+
"cx-divider": qt,
|
|
1142
1142
|
"cx-icon": ot,
|
|
1143
1143
|
"cx-icon-button": Ct,
|
|
1144
1144
|
"cx-input": kt,
|
|
1145
1145
|
"cx-option": yt,
|
|
1146
1146
|
"cx-position-picker": he,
|
|
1147
1147
|
"cx-select": St,
|
|
1148
|
-
"cx-space":
|
|
1149
|
-
"cx-typography":
|
|
1148
|
+
"cx-space": q,
|
|
1149
|
+
"cx-typography": U
|
|
1150
1150
|
};
|
|
1151
1151
|
w([
|
|
1152
1152
|
J(".details")
|
|
1153
|
-
],
|
|
1153
|
+
], A.prototype, "base", 2);
|
|
1154
1154
|
w([
|
|
1155
1155
|
J("cx-position-picker")
|
|
1156
|
-
],
|
|
1156
|
+
], A.prototype, "positionPicker", 2);
|
|
1157
1157
|
w([
|
|
1158
1158
|
h({ reflect: !0, type: Boolean })
|
|
1159
|
-
],
|
|
1159
|
+
], A.prototype, "open", 2);
|
|
1160
1160
|
w([
|
|
1161
1161
|
h({ reflect: !0, type: Number })
|
|
1162
|
-
],
|
|
1162
|
+
], A.prototype, "width", 2);
|
|
1163
1163
|
w([
|
|
1164
1164
|
h({ reflect: !0, type: Number })
|
|
1165
|
-
],
|
|
1165
|
+
], A.prototype, "height", 2);
|
|
1166
1166
|
w([
|
|
1167
1167
|
h({ attribute: "max-width", reflect: !0, type: Number })
|
|
1168
|
-
],
|
|
1168
|
+
], A.prototype, "maxWidth", 2);
|
|
1169
1169
|
w([
|
|
1170
1170
|
h({ attribute: "max-height", reflect: !0, type: Number })
|
|
1171
|
-
],
|
|
1171
|
+
], A.prototype, "maxHeight", 2);
|
|
1172
1172
|
w([
|
|
1173
1173
|
h({ attribute: "ratio-width", reflect: !0, type: Number })
|
|
1174
|
-
],
|
|
1174
|
+
], A.prototype, "ratioWidth", 2);
|
|
1175
1175
|
w([
|
|
1176
1176
|
h({ attribute: "ratio-height", reflect: !0, type: Number })
|
|
1177
|
-
],
|
|
1177
|
+
], A.prototype, "ratioHeight", 2);
|
|
1178
1178
|
w([
|
|
1179
1179
|
h({ attribute: "percentage-width", reflect: !0, type: Number })
|
|
1180
|
-
],
|
|
1180
|
+
], A.prototype, "percentageWidth", 2);
|
|
1181
1181
|
w([
|
|
1182
1182
|
h({ attribute: "percentage-height", reflect: !0, type: Number })
|
|
1183
|
-
],
|
|
1183
|
+
], A.prototype, "percentageHeight", 2);
|
|
1184
1184
|
w([
|
|
1185
1185
|
h({ reflect: !0, type: String })
|
|
1186
|
-
],
|
|
1186
|
+
], A.prototype, "unit", 2);
|
|
1187
1187
|
w([
|
|
1188
1188
|
h({ attribute: "disabled-apply", reflect: !0, type: Boolean })
|
|
1189
|
-
],
|
|
1189
|
+
], A.prototype, "disabledApply", 2);
|
|
1190
1190
|
w([
|
|
1191
1191
|
h({ attribute: "no-ratio-modes", reflect: !0, type: Boolean })
|
|
1192
|
-
],
|
|
1192
|
+
], A.prototype, "noRatioModes", 2);
|
|
1193
1193
|
w([
|
|
1194
1194
|
h({ attribute: "show-position-picker", reflect: !0, type: Boolean })
|
|
1195
|
-
],
|
|
1195
|
+
], A.prototype, "showPositionPicker", 2);
|
|
1196
1196
|
w([
|
|
1197
1197
|
h({ attribute: "last-applied-setting", reflect: !1, type: Object })
|
|
1198
|
-
],
|
|
1198
|
+
], A.prototype, "lastAppliedSetting", 2);
|
|
1199
1199
|
w([
|
|
1200
1200
|
h({ reflect: !0, type: Boolean })
|
|
1201
|
-
],
|
|
1201
|
+
], A.prototype, "loading", 2);
|
|
1202
1202
|
w([
|
|
1203
1203
|
h({ attribute: "crop-modes", reflect: !1, type: Array })
|
|
1204
|
-
],
|
|
1204
|
+
], A.prototype, "cropModes", 2);
|
|
1205
1205
|
w([
|
|
1206
1206
|
h({ attribute: "focus-modes", reflect: !1, type: Object })
|
|
1207
|
-
],
|
|
1207
|
+
], A.prototype, "focusModes", 2);
|
|
1208
1208
|
w([
|
|
1209
1209
|
h({ attribute: "focus-mode", reflect: !0, type: String })
|
|
1210
|
-
],
|
|
1210
|
+
], A.prototype, "focusMode", 2);
|
|
1211
1211
|
w([
|
|
1212
1212
|
h({ attribute: "crop-mode", reflect: !0, type: String })
|
|
1213
|
-
],
|
|
1213
|
+
], A.prototype, "cropMode", 2);
|
|
1214
1214
|
w([
|
|
1215
1215
|
h({ reflect: !0, type: String })
|
|
1216
|
-
],
|
|
1216
|
+
], A.prototype, "position", 2);
|
|
1217
1217
|
w([
|
|
1218
1218
|
h({ attribute: "keep-aspect-ratio", reflect: !0, type: Boolean })
|
|
1219
|
-
],
|
|
1219
|
+
], A.prototype, "keepAspectRatio", 2);
|
|
1220
1220
|
w([
|
|
1221
1221
|
$()
|
|
1222
|
-
],
|
|
1222
|
+
], A.prototype, "invalidWidth", 2);
|
|
1223
1223
|
w([
|
|
1224
1224
|
$()
|
|
1225
|
-
],
|
|
1225
|
+
], A.prototype, "invalidHeight", 2);
|
|
1226
1226
|
w([
|
|
1227
1227
|
$()
|
|
1228
|
-
],
|
|
1228
|
+
], A.prototype, "aspectRatio", 2);
|
|
1229
1229
|
w([
|
|
1230
1230
|
_("cropMode", { waitUntilFirstUpdate: !0 }),
|
|
1231
1231
|
_("maxWidth", { waitUntilFirstUpdate: !0 }),
|
|
1232
1232
|
_("maxHeight", { waitUntilFirstUpdate: !0 }),
|
|
1233
1233
|
_("keepAspectRatio")
|
|
1234
|
-
],
|
|
1234
|
+
], A.prototype, "handleCropModeChange", 1);
|
|
1235
1235
|
w([
|
|
1236
1236
|
_("open", { waitUntilFirstUpdate: !0 })
|
|
1237
|
-
],
|
|
1238
|
-
|
|
1237
|
+
], A.prototype, "handleOpenChange", 1);
|
|
1238
|
+
A = w([
|
|
1239
1239
|
Q("cx-asset-link-format-crop")
|
|
1240
|
-
],
|
|
1240
|
+
], A);
|
|
1241
1241
|
const De = 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%}}`;
|
|
1242
1242
|
var Ne = Object.defineProperty, Oe = Object.getOwnPropertyDescriptor, $t = (t, e, i, s) => {
|
|
1243
1243
|
for (var a = s > 1 ? void 0 : s ? Oe(e, i) : e, r = t.length - 1, n; r >= 0; r--)
|
|
1244
1244
|
(n = t[r]) && (a = (s ? n(e, i, a) : n(a)) || a);
|
|
1245
1245
|
return s && a && Ne(e, i, a), a;
|
|
1246
1246
|
};
|
|
1247
|
-
let K = class extends
|
|
1247
|
+
let K = class extends B {
|
|
1248
1248
|
constructor() {
|
|
1249
1249
|
super(...arguments), this.localize = new V(this), this.value = "", this.items = [];
|
|
1250
1250
|
}
|
|
@@ -1266,8 +1266,8 @@ K.styles = [G, De];
|
|
|
1266
1266
|
K.dependencies = {
|
|
1267
1267
|
"cx-option": yt,
|
|
1268
1268
|
"cx-select": St,
|
|
1269
|
-
"cx-space":
|
|
1270
|
-
"cx-typography":
|
|
1269
|
+
"cx-space": q,
|
|
1270
|
+
"cx-typography": U
|
|
1271
1271
|
};
|
|
1272
1272
|
$t([
|
|
1273
1273
|
h({ reflect: !0, type: String })
|
|
@@ -1279,13 +1279,13 @@ K = $t([
|
|
|
1279
1279
|
Q("cx-asset-link-format-extension")
|
|
1280
1280
|
], K);
|
|
1281
1281
|
const Le = j`cx-details::part(base){border-bottom-width:0}`;
|
|
1282
|
-
var
|
|
1283
|
-
for (var a = s > 1 ? void 0 : s ?
|
|
1282
|
+
var qe = Object.defineProperty, Ue = Object.getOwnPropertyDescriptor, D = (t, e, i, s) => {
|
|
1283
|
+
for (var a = s > 1 ? void 0 : s ? Ue(e, i) : e, r = t.length - 1, n; r >= 0; r--)
|
|
1284
1284
|
(n = t[r]) && (a = (s ? n(e, i, a) : n(a)) || a);
|
|
1285
|
-
return s && a &&
|
|
1285
|
+
return s && a && qe(e, i, a), a;
|
|
1286
1286
|
};
|
|
1287
1287
|
const zt = "auto";
|
|
1288
|
-
let I = class extends
|
|
1288
|
+
let I = class extends B {
|
|
1289
1289
|
constructor() {
|
|
1290
1290
|
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 = "";
|
|
1291
1291
|
}
|
|
@@ -1362,12 +1362,12 @@ I.styles = [G, Le];
|
|
|
1362
1362
|
I.dependencies = {
|
|
1363
1363
|
"cx-button": Y,
|
|
1364
1364
|
"cx-details": at,
|
|
1365
|
-
"cx-divider":
|
|
1365
|
+
"cx-divider": qt,
|
|
1366
1366
|
"cx-icon": ot,
|
|
1367
1367
|
"cx-option": yt,
|
|
1368
1368
|
"cx-select": St,
|
|
1369
|
-
"cx-space":
|
|
1370
|
-
"cx-typography":
|
|
1369
|
+
"cx-space": q,
|
|
1370
|
+
"cx-typography": U
|
|
1371
1371
|
};
|
|
1372
1372
|
D([
|
|
1373
1373
|
J(".details")
|
|
@@ -1403,13 +1403,13 @@ D([
|
|
|
1403
1403
|
I = D([
|
|
1404
1404
|
Q("cx-asset-link-format-proxy")
|
|
1405
1405
|
], I);
|
|
1406
|
-
const
|
|
1406
|
+
const Be = j`cx-details::part(base){border-bottom-width:0}`;
|
|
1407
1407
|
var je = Object.defineProperty, Ve = Object.getOwnPropertyDescriptor, tt = (t, e, i, s) => {
|
|
1408
1408
|
for (var a = s > 1 ? void 0 : s ? Ve(e, i) : e, r = t.length - 1, n; r >= 0; r--)
|
|
1409
1409
|
(n = t[r]) && (a = (s ? n(e, i, a) : n(a)) || a);
|
|
1410
1410
|
return s && a && je(e, i, a), a;
|
|
1411
1411
|
};
|
|
1412
|
-
let W = class extends
|
|
1412
|
+
let W = class extends B {
|
|
1413
1413
|
constructor() {
|
|
1414
1414
|
super(...arguments), this.localize = new V(this), this.open = !1, this.value = 100, this.loading = !1, this.scopedValue = 100;
|
|
1415
1415
|
}
|
|
@@ -1460,15 +1460,15 @@ let W = class extends q {
|
|
|
1460
1460
|
})} @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>`;
|
|
1461
1461
|
}
|
|
1462
1462
|
};
|
|
1463
|
-
W.styles = [G,
|
|
1463
|
+
W.styles = [G, Be];
|
|
1464
1464
|
W.dependencies = {
|
|
1465
1465
|
"cx-button": Y,
|
|
1466
1466
|
"cx-details": at,
|
|
1467
1467
|
"cx-icon": ot,
|
|
1468
1468
|
"cx-input": kt,
|
|
1469
|
-
"cx-space":
|
|
1470
|
-
"cx-tooltip":
|
|
1471
|
-
"cx-typography":
|
|
1469
|
+
"cx-space": q,
|
|
1470
|
+
"cx-tooltip": Ut,
|
|
1471
|
+
"cx-typography": U
|
|
1472
1472
|
};
|
|
1473
1473
|
tt([
|
|
1474
1474
|
J(".details")
|
|
@@ -1497,7 +1497,7 @@ var Qe = Object.defineProperty, Xe = Object.getOwnPropertyDescriptor, P = (t, e,
|
|
|
1497
1497
|
(n = t[r]) && (a = (s ? n(e, i, a) : n(a)) || a);
|
|
1498
1498
|
return s && a && Qe(e, i, a), a;
|
|
1499
1499
|
};
|
|
1500
|
-
let R = class extends
|
|
1500
|
+
let R = class extends B {
|
|
1501
1501
|
constructor() {
|
|
1502
1502
|
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 = {
|
|
1503
1503
|
[o.Pixel]: { height: 0, width: 0 },
|
|
@@ -1661,8 +1661,8 @@ R.dependencies = {
|
|
|
1661
1661
|
"cx-input": kt,
|
|
1662
1662
|
"cx-option": yt,
|
|
1663
1663
|
"cx-select": St,
|
|
1664
|
-
"cx-space":
|
|
1665
|
-
"cx-typography":
|
|
1664
|
+
"cx-space": q,
|
|
1665
|
+
"cx-typography": U
|
|
1666
1666
|
};
|
|
1667
1667
|
P([
|
|
1668
1668
|
J(".details")
|
|
@@ -1730,7 +1730,7 @@ var Ke = Object.defineProperty, Ye = Object.getOwnPropertyDescriptor, X = (t, e,
|
|
|
1730
1730
|
(n = t[r]) && (a = (s ? n(e, i, a) : n(a)) || a);
|
|
1731
1731
|
return s && a && Ke(e, i, a), a;
|
|
1732
1732
|
};
|
|
1733
|
-
let T = class extends
|
|
1733
|
+
let T = class extends B {
|
|
1734
1734
|
constructor() {
|
|
1735
1735
|
super(...arguments), this.localize = new V(this), this.open = !1, this.value = 0, this.defaultValue = 0, this.loading = !1, this.lastAppliedValue = 0;
|
|
1736
1736
|
}
|
|
@@ -1783,8 +1783,8 @@ T.dependencies = {
|
|
|
1783
1783
|
"cx-details": at,
|
|
1784
1784
|
"cx-icon": ot,
|
|
1785
1785
|
"cx-icon-button": Ct,
|
|
1786
|
-
"cx-space":
|
|
1787
|
-
"cx-typography":
|
|
1786
|
+
"cx-space": q,
|
|
1787
|
+
"cx-typography": U
|
|
1788
1788
|
};
|
|
1789
1789
|
X([
|
|
1790
1790
|
J(".details")
|
|
@@ -1811,12 +1811,12 @@ T = X([
|
|
|
1811
1811
|
Q("cx-asset-link-format-rotation")
|
|
1812
1812
|
], T);
|
|
1813
1813
|
const Je = j`cx-details::part(base){border-bottom-width:0}`;
|
|
1814
|
-
var ti = Object.defineProperty, ei = Object.getOwnPropertyDescriptor,
|
|
1814
|
+
var ti = Object.defineProperty, ei = Object.getOwnPropertyDescriptor, vt = (t, e, i, s) => {
|
|
1815
1815
|
for (var a = s > 1 ? void 0 : s ? ei(e, i) : e, r = t.length - 1, n; r >= 0; r--)
|
|
1816
1816
|
(n = t[r]) && (a = (s ? n(e, i, a) : n(a)) || a);
|
|
1817
1817
|
return s && a && ti(e, i, a), a;
|
|
1818
1818
|
};
|
|
1819
|
-
let L = class extends
|
|
1819
|
+
let L = class extends B {
|
|
1820
1820
|
constructor() {
|
|
1821
1821
|
super(...arguments), this.localize = new V(this), this.open = !1, this.value = !1;
|
|
1822
1822
|
}
|
|
@@ -1851,28 +1851,28 @@ L.dependencies = {
|
|
|
1851
1851
|
"cx-checkbox": pe,
|
|
1852
1852
|
"cx-details": at,
|
|
1853
1853
|
"cx-icon": ot,
|
|
1854
|
-
"cx-space":
|
|
1855
|
-
"cx-tooltip":
|
|
1856
|
-
"cx-typography":
|
|
1854
|
+
"cx-space": q,
|
|
1855
|
+
"cx-tooltip": Ut,
|
|
1856
|
+
"cx-typography": U
|
|
1857
1857
|
};
|
|
1858
|
-
|
|
1858
|
+
vt([
|
|
1859
1859
|
J(".details")
|
|
1860
1860
|
], L.prototype, "base", 2);
|
|
1861
|
-
|
|
1861
|
+
vt([
|
|
1862
1862
|
h({ reflect: !0, type: Boolean })
|
|
1863
1863
|
], L.prototype, "open", 2);
|
|
1864
|
-
|
|
1864
|
+
vt([
|
|
1865
1865
|
h({ reflect: !0, type: Boolean })
|
|
1866
1866
|
], L.prototype, "value", 2);
|
|
1867
|
-
L =
|
|
1867
|
+
L = vt([
|
|
1868
1868
|
Q("cx-asset-link-format-metadata")
|
|
1869
1869
|
], L);
|
|
1870
|
-
var ii = Object.defineProperty, si = Object.getOwnPropertyDescriptor,
|
|
1870
|
+
var ii = Object.defineProperty, si = Object.getOwnPropertyDescriptor, x = (t, e, i, s) => {
|
|
1871
1871
|
for (var a = s > 1 ? void 0 : s ? si(e, i) : e, r = t.length - 1, n; r >= 0; r--)
|
|
1872
1872
|
(n = t[r]) && (a = (s ? n(e, i, a) : n(a)) || a);
|
|
1873
1873
|
return s && a && ii(e, i, a), a;
|
|
1874
1874
|
};
|
|
1875
|
-
let
|
|
1875
|
+
let f = class extends B {
|
|
1876
1876
|
constructor() {
|
|
1877
1877
|
super(), this.localize = new V(this), this.baseUrl = void 0, this.token = void 0, this.asset = void 0, this.cropModes = [
|
|
1878
1878
|
{
|
|
@@ -1992,7 +1992,7 @@ let m = class extends q {
|
|
|
1992
1992
|
*/
|
|
1993
1993
|
get lastAppliedCropUnit() {
|
|
1994
1994
|
return this.transformations.findLast(
|
|
1995
|
-
(e) => e.key ===
|
|
1995
|
+
(e) => e.key === m.Crop
|
|
1996
1996
|
)?.value.unit ?? o.Pixel;
|
|
1997
1997
|
}
|
|
1998
1998
|
/**
|
|
@@ -2002,7 +2002,7 @@ let m = class extends q {
|
|
|
2002
2002
|
*/
|
|
2003
2003
|
get lastAppliedCropFocusMode() {
|
|
2004
2004
|
return this.transformations.findLast(
|
|
2005
|
-
(e) => e.key ===
|
|
2005
|
+
(e) => e.key === m.Crop
|
|
2006
2006
|
)?.value.focusMode ?? "manual";
|
|
2007
2007
|
}
|
|
2008
2008
|
/**
|
|
@@ -2012,7 +2012,7 @@ let m = class extends q {
|
|
|
2012
2012
|
*/
|
|
2013
2013
|
get lastAppliedCropPosition() {
|
|
2014
2014
|
return this.transformations.findLast(
|
|
2015
|
-
(e) => e.key ===
|
|
2015
|
+
(e) => e.key === m.Crop
|
|
2016
2016
|
)?.value.position ?? N.CenterCenter;
|
|
2017
2017
|
}
|
|
2018
2018
|
/**
|
|
@@ -2064,7 +2064,7 @@ let m = class extends q {
|
|
|
2064
2064
|
get lastCropSize() {
|
|
2065
2065
|
if (!this.asset) {
|
|
2066
2066
|
const e = this.transformations.findLast(
|
|
2067
|
-
(i) => i.key ===
|
|
2067
|
+
(i) => i.key === m.Crop
|
|
2068
2068
|
);
|
|
2069
2069
|
if (e?.value.unit === o.AspectRatio && e.value.ratioWidth && e.value.ratioHeight)
|
|
2070
2070
|
return {
|
|
@@ -2147,7 +2147,7 @@ let m = class extends q {
|
|
|
2147
2147
|
get lastResizeSize() {
|
|
2148
2148
|
if (!this.asset) {
|
|
2149
2149
|
const e = this.transformations.findLast(
|
|
2150
|
-
(i) => i.key ===
|
|
2150
|
+
(i) => i.key === m.Resize
|
|
2151
2151
|
);
|
|
2152
2152
|
if (e?.value.unit === o.AspectRatio && e.value.ratioWidth && e.value.ratioHeight)
|
|
2153
2153
|
return {
|
|
@@ -2203,7 +2203,7 @@ let m = class extends q {
|
|
|
2203
2203
|
*/
|
|
2204
2204
|
get lastRotation() {
|
|
2205
2205
|
return this.asset ? 0 : this.transformations.findLast(
|
|
2206
|
-
(e) => e.key ===
|
|
2206
|
+
(e) => e.key === m.Rotate
|
|
2207
2207
|
)?.value.rotation ?? 0;
|
|
2208
2208
|
}
|
|
2209
2209
|
/**
|
|
@@ -2244,32 +2244,22 @@ let m = class extends q {
|
|
|
2244
2244
|
if (t.has("activeSetting") && this.handleActiveSettingChange(), t.has("selectedFormat") && this.handleSelectedFormatChange(), t.has("resizeSize") && this.handleResizeSizeChange(), t.has("cropSize") && this.handleCropSizeChange(), t.has("rotation") && this.handleRotationChange(), t.has("cropperElement") && this.handleCropperElementChange(), t.has("selectedFormat")) {
|
|
2245
2245
|
if (!this.asset || !this.selectedFormat || this.selectedFormat.extension === t.get("selectedFormat")?.extension)
|
|
2246
2246
|
return;
|
|
2247
|
-
|
|
2248
|
-
(
|
|
2249
|
-
|
|
2250
|
-
|
|
2251
|
-
assetId: this.asset.id,
|
|
2252
|
-
extension: m.getTransformExtension(this.asset.extension),
|
|
2253
|
-
format: e?.proxyName ?? "",
|
|
2254
|
-
siteUrl: this.baseUrl,
|
|
2255
|
-
token: this.token,
|
|
2256
|
-
transformations: this.transformationString
|
|
2257
|
-
}).then((s) => {
|
|
2258
|
-
this.loading = !1, !(!s?.relativePath || !this.selectedFormat) && (this.lastAction === f.Rotate && (this.rotation = 0), this.lastAction = void 0, this.lastImageSize = {
|
|
2259
|
-
height: s.height,
|
|
2260
|
-
width: s.width
|
|
2247
|
+
this.loading = !0, this.requestTransformAsset().then((i) => {
|
|
2248
|
+
this.loading = !1, !(!i?.relativePath || !this.selectedFormat) && (this.lastAction === m.Rotate && (this.rotation = 0), this.lastAction = void 0, this.lastImageSize = {
|
|
2249
|
+
height: i.height,
|
|
2250
|
+
width: i.width
|
|
2261
2251
|
}, this.selectedFormat = {
|
|
2262
2252
|
...this.selectedFormat,
|
|
2263
|
-
height:
|
|
2264
|
-
url: this.baseUrl && this.baseUrl.length > 0 ? `${this.baseUrl}/${
|
|
2265
|
-
width:
|
|
2253
|
+
height: i.height,
|
|
2254
|
+
url: this.baseUrl && this.baseUrl.length > 0 ? `${this.baseUrl}/${i.relativePath}` : i.relativePath,
|
|
2255
|
+
width: i.width
|
|
2266
2256
|
/**
|
|
2267
2257
|
* For local development uses the base URL to construct the full URL.
|
|
2268
2258
|
* url: `${this.baseUrl}/${response.relativePath}`,
|
|
2269
2259
|
*/
|
|
2270
2260
|
});
|
|
2271
2261
|
});
|
|
2272
|
-
const
|
|
2262
|
+
const e = dt({
|
|
2273
2263
|
asset: this.asset,
|
|
2274
2264
|
baseUrl: "",
|
|
2275
2265
|
extension: this.selectedFormat.extension,
|
|
@@ -2278,13 +2268,52 @@ let m = class extends q {
|
|
|
2278
2268
|
useSession: this.useSession
|
|
2279
2269
|
});
|
|
2280
2270
|
this.emit("cx-asset-link-format-change", {
|
|
2281
|
-
detail:
|
|
2271
|
+
detail: e
|
|
2282
2272
|
});
|
|
2283
2273
|
}
|
|
2284
2274
|
}
|
|
2285
2275
|
getCropSize() {
|
|
2286
2276
|
return this.cropSize;
|
|
2287
2277
|
}
|
|
2278
|
+
/** Captures the current request synchronously; later edits cannot change Save's ratio. */
|
|
2279
|
+
async getAppliedAspectRatio() {
|
|
2280
|
+
if (!this.asset || !this.selectedFormat)
|
|
2281
|
+
return;
|
|
2282
|
+
const e = await this.getTransformRequest(this.transformRequestOptions).promise.catch(() => {
|
|
2283
|
+
});
|
|
2284
|
+
if (!e?.relativePath)
|
|
2285
|
+
return;
|
|
2286
|
+
const i = Number(e?.width) / Number(e?.height);
|
|
2287
|
+
return Number(e?.width) > 0 && Number(e?.height) > 0 && Number.isFinite(i) ? i : void 0;
|
|
2288
|
+
}
|
|
2289
|
+
get transformRequestOptions() {
|
|
2290
|
+
return {
|
|
2291
|
+
assetId: this.asset?.id ?? "",
|
|
2292
|
+
// The API sends this as TargetExtension, so both preview paths and Save
|
|
2293
|
+
// must use the selected output extension, not the original asset's extension.
|
|
2294
|
+
extension: f.getTransformExtension(this.selectedFormat?.extension ?? ""),
|
|
2295
|
+
format: this.proxies?.find((t) => t.id === this.selectedProxy)?.proxyName ?? "",
|
|
2296
|
+
siteUrl: this.baseUrl,
|
|
2297
|
+
token: this.token,
|
|
2298
|
+
transformations: this.transformationString
|
|
2299
|
+
};
|
|
2300
|
+
}
|
|
2301
|
+
getTransformRequest(t) {
|
|
2302
|
+
const e = JSON.stringify(t);
|
|
2303
|
+
if (this.transformRequest?.key !== e) {
|
|
2304
|
+
const i = { key: e, promise: this.apiGetTransformAssetLink(t) };
|
|
2305
|
+
i.promise = i.promise.catch(() => null).then((s) => (!s?.relativePath && this.transformRequest === i && (this.transformRequest = void 0), s)), this.transformRequest = i;
|
|
2306
|
+
}
|
|
2307
|
+
return this.transformRequest;
|
|
2308
|
+
}
|
|
2309
|
+
async requestTransformAsset() {
|
|
2310
|
+
if (!this.asset || !this.selectedFormat)
|
|
2311
|
+
return;
|
|
2312
|
+
const t = this.getTransformRequest(this.transformRequestOptions), e = await t.promise.catch(() => {
|
|
2313
|
+
});
|
|
2314
|
+
if (!(this.transformRequest !== t || JSON.stringify(this.transformRequestOptions) !== t.key))
|
|
2315
|
+
return e;
|
|
2316
|
+
}
|
|
2288
2317
|
setActiveSetting(t) {
|
|
2289
2318
|
this.activeSetting = t;
|
|
2290
2319
|
}
|
|
@@ -2313,36 +2342,36 @@ let m = class extends q {
|
|
|
2313
2342
|
useSession: this.useSession
|
|
2314
2343
|
}).replace(/\/t\//g, "")
|
|
2315
2344
|
});
|
|
2316
|
-
const
|
|
2317
|
-
(c) => c.key ===
|
|
2345
|
+
const a = this.transformations.findLast(
|
|
2346
|
+
(c) => c.key === m.Crop && (c.value.unit === o.AspectRatio && c.value.ratioWidth && c.value.ratioHeight || c.value.width && c.value.height)
|
|
2318
2347
|
);
|
|
2319
|
-
if (
|
|
2320
|
-
const { focusMode: c, position:
|
|
2348
|
+
if (a?.value.unit === o.AspectRatio && a.value.ratioWidth && a.value.ratioHeight) {
|
|
2349
|
+
const { focusMode: c, position: g, ratioHeight: u, ratioWidth: y } = a.value;
|
|
2321
2350
|
this.cropSize = {
|
|
2322
2351
|
...this.cropSize,
|
|
2323
2352
|
cropMode: "free",
|
|
2324
2353
|
focusMode: c ?? "manual",
|
|
2325
2354
|
percentageHeight: 100,
|
|
2326
2355
|
percentageWidth: 100,
|
|
2327
|
-
position:
|
|
2328
|
-
ratioHeight:
|
|
2329
|
-
ratioWidth:
|
|
2356
|
+
position: g ?? N.CenterCenter,
|
|
2357
|
+
ratioHeight: u,
|
|
2358
|
+
ratioWidth: y,
|
|
2330
2359
|
unit: o.AspectRatio
|
|
2331
2360
|
};
|
|
2332
|
-
} else if (
|
|
2333
|
-
const { focusMode: c, height:
|
|
2361
|
+
} else if (a) {
|
|
2362
|
+
const { focusMode: c, height: g, position: u, unit: y, width: S, x: d = 0, y: v = 0 } = a.value;
|
|
2334
2363
|
this.cropSize = {
|
|
2335
2364
|
...this.cropSize,
|
|
2336
2365
|
cropMode: "free",
|
|
2337
2366
|
focusMode: c ?? "manual",
|
|
2338
|
-
height:
|
|
2367
|
+
height: g,
|
|
2339
2368
|
percentageHeight: 100,
|
|
2340
2369
|
percentageWidth: 100,
|
|
2341
|
-
position:
|
|
2342
|
-
unit:
|
|
2343
|
-
width:
|
|
2344
|
-
x:
|
|
2345
|
-
y:
|
|
2370
|
+
position: u ?? N.CenterCenter,
|
|
2371
|
+
unit: y ?? o.Pixel,
|
|
2372
|
+
width: S,
|
|
2373
|
+
x: d,
|
|
2374
|
+
y: v
|
|
2346
2375
|
};
|
|
2347
2376
|
} else
|
|
2348
2377
|
this.cropSize = {
|
|
@@ -2364,24 +2393,24 @@ let m = class extends q {
|
|
|
2364
2393
|
x: 0,
|
|
2365
2394
|
y: 0
|
|
2366
2395
|
};
|
|
2367
|
-
const
|
|
2368
|
-
(c) => c.key ===
|
|
2396
|
+
const r = this.transformations.findLast(
|
|
2397
|
+
(c) => c.key === m.Resize && (c.value.unit === o.AspectRatio && c.value.ratioWidth && c.value.ratioHeight || c.value.width || c.value.height)
|
|
2369
2398
|
);
|
|
2370
|
-
if (
|
|
2371
|
-
const { ratioHeight: c, ratioWidth:
|
|
2399
|
+
if (r?.value.unit === o.AspectRatio && r.value.ratioWidth && r.value.ratioHeight) {
|
|
2400
|
+
const { ratioHeight: c, ratioWidth: g } = r.value;
|
|
2372
2401
|
this.resizeSize = {
|
|
2373
2402
|
...this.resizeSize,
|
|
2374
2403
|
ratioHeight: c,
|
|
2375
|
-
ratioWidth:
|
|
2404
|
+
ratioWidth: g,
|
|
2376
2405
|
unit: o.AspectRatio
|
|
2377
2406
|
};
|
|
2378
|
-
} else if (
|
|
2379
|
-
const { height: c = 0, unit:
|
|
2407
|
+
} else if (r) {
|
|
2408
|
+
const { height: c = 0, unit: g, width: u = 0 } = r.value;
|
|
2380
2409
|
this.resizeSize = {
|
|
2381
2410
|
...this.resizeSize,
|
|
2382
2411
|
height: c,
|
|
2383
|
-
unit:
|
|
2384
|
-
width:
|
|
2412
|
+
unit: g ?? o.Pixel,
|
|
2413
|
+
width: u
|
|
2385
2414
|
};
|
|
2386
2415
|
} else
|
|
2387
2416
|
this.resizeSize = {
|
|
@@ -2395,18 +2424,18 @@ let m = class extends q {
|
|
|
2395
2424
|
unit: o.Pixel,
|
|
2396
2425
|
width: 1
|
|
2397
2426
|
};
|
|
2398
|
-
const
|
|
2399
|
-
(c) => c.key ===
|
|
2427
|
+
const n = this.transformations.findLast(
|
|
2428
|
+
(c) => c.key === m.Rotate
|
|
2400
2429
|
);
|
|
2401
|
-
this.rotation =
|
|
2402
|
-
const
|
|
2403
|
-
(c) => c.key ===
|
|
2430
|
+
this.rotation = n?.value.rotation ?? 0;
|
|
2431
|
+
const l = this.transformations.findLast((c) => c.key === m.Quality)?.value.quality ?? 100, p = this.transformations.some(
|
|
2432
|
+
(c) => c.key === m.Metadata
|
|
2404
2433
|
);
|
|
2405
|
-
this.selectedFormat ? this.selectedFormat = { ...this.selectedFormat, keepMetadata:
|
|
2434
|
+
this.selectedFormat ? this.selectedFormat = { ...this.selectedFormat, keepMetadata: p, quality: l } : this.selectedFormat = {
|
|
2406
2435
|
extension: "",
|
|
2407
2436
|
height: 0,
|
|
2408
|
-
keepMetadata:
|
|
2409
|
-
quality:
|
|
2437
|
+
keepMetadata: p,
|
|
2438
|
+
quality: l,
|
|
2410
2439
|
rotation: 0,
|
|
2411
2440
|
url: "",
|
|
2412
2441
|
width: 0,
|
|
@@ -2417,34 +2446,24 @@ let m = class extends q {
|
|
|
2417
2446
|
}
|
|
2418
2447
|
if (!this.selectedFormat)
|
|
2419
2448
|
return;
|
|
2420
|
-
const t = this.proxies?.find(
|
|
2421
|
-
(r) => r.id === this.selectedProxy
|
|
2422
|
-
);
|
|
2423
2449
|
this.loading = !0;
|
|
2424
|
-
const
|
|
2425
|
-
|
|
2426
|
-
extension: m.getTransformExtension(this.selectedFormat.extension),
|
|
2427
|
-
format: t?.proxyName ?? "",
|
|
2428
|
-
siteUrl: this.baseUrl,
|
|
2429
|
-
token: this.token,
|
|
2430
|
-
transformations: this.transformationString
|
|
2431
|
-
});
|
|
2432
|
-
if (this.loading = !1, !e?.relativePath || !this.selectedFormat)
|
|
2450
|
+
const t = await this.requestTransformAsset();
|
|
2451
|
+
if (this.loading = !1, !t?.relativePath || !this.selectedFormat)
|
|
2433
2452
|
return;
|
|
2434
2453
|
this.lastImageSize = {
|
|
2435
|
-
height:
|
|
2436
|
-
width:
|
|
2454
|
+
height: t.height,
|
|
2455
|
+
width: t.width
|
|
2437
2456
|
}, this.resizeSize = {
|
|
2438
|
-
height:
|
|
2457
|
+
height: t.height,
|
|
2439
2458
|
keepAspectRatio: !0,
|
|
2440
2459
|
ratioHeight: 1,
|
|
2441
2460
|
ratioWidth: 1,
|
|
2442
2461
|
unit: o.Pixel,
|
|
2443
|
-
width:
|
|
2462
|
+
width: t.width
|
|
2444
2463
|
}, this.cropSize = {
|
|
2445
2464
|
cropMode: "free",
|
|
2446
2465
|
focusMode: "manual",
|
|
2447
|
-
height:
|
|
2466
|
+
height: t.height,
|
|
2448
2467
|
keepAspectRatio: this.cropSize.keepAspectRatio,
|
|
2449
2468
|
percentageHeight: 100,
|
|
2450
2469
|
percentageWidth: 100,
|
|
@@ -2452,28 +2471,28 @@ let m = class extends q {
|
|
|
2452
2471
|
ratioHeight: 1,
|
|
2453
2472
|
ratioWidth: 1,
|
|
2454
2473
|
unit: o.Pixel,
|
|
2455
|
-
width:
|
|
2474
|
+
width: t.width,
|
|
2456
2475
|
x: 0,
|
|
2457
2476
|
y: 0
|
|
2458
|
-
}, this.lastAction ===
|
|
2459
|
-
const
|
|
2460
|
-
(
|
|
2461
|
-
),
|
|
2462
|
-
(
|
|
2477
|
+
}, this.lastAction === m.Rotate && (this.rotation = 0), this.lastAction = void 0;
|
|
2478
|
+
const e = this.transformations.some(
|
|
2479
|
+
(a) => a.key === m.Metadata
|
|
2480
|
+
), i = this.transformations.findLast(
|
|
2481
|
+
(a) => a.key === m.Quality
|
|
2463
2482
|
);
|
|
2464
2483
|
this.selectedFormat = {
|
|
2465
2484
|
...this.selectedFormat,
|
|
2466
|
-
height:
|
|
2467
|
-
keepMetadata:
|
|
2468
|
-
quality:
|
|
2469
|
-
url: this.baseUrl && this.baseUrl.length > 0 ? `${this.baseUrl}/${
|
|
2470
|
-
width:
|
|
2485
|
+
height: t.height,
|
|
2486
|
+
keepMetadata: e,
|
|
2487
|
+
quality: i?.value?.quality ?? this.selectedFormat.quality,
|
|
2488
|
+
url: this.baseUrl && this.baseUrl.length > 0 ? `${this.baseUrl}/${t.relativePath}` : t.relativePath,
|
|
2489
|
+
width: t.width
|
|
2471
2490
|
/**
|
|
2472
2491
|
* For local development uses the base URL to construct the full URL.
|
|
2473
2492
|
* url: `${this.baseUrl}/${response.relativePath}`,
|
|
2474
2493
|
*/
|
|
2475
2494
|
};
|
|
2476
|
-
const
|
|
2495
|
+
const s = dt({
|
|
2477
2496
|
asset: this.asset,
|
|
2478
2497
|
baseUrl: "",
|
|
2479
2498
|
extension: this.selectedFormat.extension,
|
|
@@ -2482,7 +2501,7 @@ let m = class extends q {
|
|
|
2482
2501
|
useSession: this.useSession
|
|
2483
2502
|
});
|
|
2484
2503
|
this.emit("cx-asset-link-format-change", {
|
|
2485
|
-
detail:
|
|
2504
|
+
detail: s
|
|
2486
2505
|
});
|
|
2487
2506
|
}
|
|
2488
2507
|
handleCropperElementChange() {
|
|
@@ -2505,7 +2524,7 @@ let m = class extends q {
|
|
|
2505
2524
|
width: Number.parseInt(this.asset.width, 10)
|
|
2506
2525
|
});
|
|
2507
2526
|
const t = this.transformations.findLast(
|
|
2508
|
-
(e) => e.key ===
|
|
2527
|
+
(e) => e.key === m.Quality
|
|
2509
2528
|
);
|
|
2510
2529
|
this.selectedFormat = {
|
|
2511
2530
|
extension: this.asset.extension,
|
|
@@ -2560,7 +2579,7 @@ let m = class extends q {
|
|
|
2560
2579
|
e.proxyName === "TRX" && (e.formatHeight = Number(this.asset.height), e.formatWidth = Number(this.asset.width));
|
|
2561
2580
|
const i = this.proxies?.find((s) => s.id === t);
|
|
2562
2581
|
i && (this.asset && i.proxyName === "TRX" && (i.formatHeight = Number(this.asset.height), i.formatWidth = Number(this.asset.width)), this.transformations = this.transformations.map((s) => {
|
|
2563
|
-
if (s.key ===
|
|
2582
|
+
if (s.key === m.Crop) {
|
|
2564
2583
|
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;
|
|
2565
2584
|
return {
|
|
2566
2585
|
...s,
|
|
@@ -2573,7 +2592,7 @@ let m = class extends q {
|
|
|
2573
2592
|
}
|
|
2574
2593
|
};
|
|
2575
2594
|
}
|
|
2576
|
-
if (s.key ===
|
|
2595
|
+
if (s.key === m.Resize) {
|
|
2577
2596
|
const a = s.value, r = a.width / i.formatWidth * e.formatWidth, n = a.height / i.formatHeight * e.formatHeight;
|
|
2578
2597
|
return {
|
|
2579
2598
|
...s,
|
|
@@ -2649,21 +2668,21 @@ let m = class extends q {
|
|
|
2649
2668
|
ratioHeight: n,
|
|
2650
2669
|
ratioWidth: l,
|
|
2651
2670
|
unit: p,
|
|
2652
|
-
useCropMode:
|
|
2653
|
-
width:
|
|
2671
|
+
useCropMode: c,
|
|
2672
|
+
width: g
|
|
2654
2673
|
}) {
|
|
2655
2674
|
if (!this.selectedFormat?.url || e === "manual")
|
|
2656
2675
|
return;
|
|
2657
|
-
this.loading = !0, this.lastAction =
|
|
2676
|
+
this.loading = !0, this.lastAction = m.Crop;
|
|
2658
2677
|
const u = await this.apiGetCropFocusMode({
|
|
2659
2678
|
autoCropMode: e,
|
|
2660
2679
|
cropHeight: i,
|
|
2661
|
-
cropWidth:
|
|
2680
|
+
cropWidth: g,
|
|
2662
2681
|
imageUrl: this.selectedFormat.url
|
|
2663
2682
|
});
|
|
2664
2683
|
if (u) {
|
|
2665
2684
|
let y = a, S = r;
|
|
2666
|
-
i || (y = u.height * 100 / this.selectedFormat.height),
|
|
2685
|
+
i || (y = u.height * 100 / this.selectedFormat.height), g || (S = u.width * 100 / this.selectedFormat.width), this.cropSize = {
|
|
2667
2686
|
...this.cropSize,
|
|
2668
2687
|
height: u.height,
|
|
2669
2688
|
percentageHeight: y ?? this.cropSize.percentageHeight,
|
|
@@ -2671,7 +2690,7 @@ let m = class extends q {
|
|
|
2671
2690
|
width: u.width,
|
|
2672
2691
|
x: u.x * 100 / this.selectedFormat.width,
|
|
2673
2692
|
y: u.y * 100 / this.selectedFormat.height,
|
|
2674
|
-
...
|
|
2693
|
+
...c ? {
|
|
2675
2694
|
cropMode: e,
|
|
2676
2695
|
focusMode: "manual",
|
|
2677
2696
|
keepAspectRatio: !1
|
|
@@ -2697,25 +2716,25 @@ let m = class extends q {
|
|
|
2697
2716
|
if (s === 0 || i === 0)
|
|
2698
2717
|
return;
|
|
2699
2718
|
const n = this.cropSize.percentageWidth !== s, l = this.cropSize.percentageHeight !== i;
|
|
2700
|
-
let p = this.cropSize.height,
|
|
2701
|
-
n && (
|
|
2719
|
+
let p = this.cropSize.height, c = this.cropSize.width;
|
|
2720
|
+
n && (c = Math.round(s * this.selectedFormat.width / 100)), l && (p = Math.round(
|
|
2702
2721
|
i * this.selectedFormat.height / 100
|
|
2703
2722
|
));
|
|
2704
|
-
const
|
|
2723
|
+
const g = this.cropSize.focusMode;
|
|
2705
2724
|
this.focusModes.find(
|
|
2706
|
-
(y) => y.value ===
|
|
2725
|
+
(y) => y.value === g
|
|
2707
2726
|
)?.auto && this.selectedFormat?.url && this.cropperElement ? await this.handleRequestAutoCropSuggestion({
|
|
2708
|
-
focusMode:
|
|
2727
|
+
focusMode: g,
|
|
2709
2728
|
height: p,
|
|
2710
2729
|
percentageHeight: i,
|
|
2711
2730
|
percentageWidth: s,
|
|
2712
|
-
width:
|
|
2731
|
+
width: c
|
|
2713
2732
|
}) : this.cropSize = {
|
|
2714
2733
|
...this.cropSize,
|
|
2715
2734
|
height: p,
|
|
2716
2735
|
percentageHeight: i,
|
|
2717
2736
|
percentageWidth: s,
|
|
2718
|
-
width:
|
|
2737
|
+
width: c,
|
|
2719
2738
|
x: a,
|
|
2720
2739
|
y: r
|
|
2721
2740
|
};
|
|
@@ -2751,7 +2770,7 @@ let m = class extends q {
|
|
|
2751
2770
|
}
|
|
2752
2771
|
onProxyChange(t) {
|
|
2753
2772
|
const e = t.detail;
|
|
2754
|
-
if (this.lastAction =
|
|
2773
|
+
if (this.lastAction = m.Proxy, e.autoFormat) {
|
|
2755
2774
|
this.autoFormat = !0;
|
|
2756
2775
|
const i = this.autoResolvedProxyId;
|
|
2757
2776
|
i && (this.selectedProxy = i);
|
|
@@ -2816,12 +2835,12 @@ let m = class extends q {
|
|
|
2816
2835
|
) : 0, r = this.asset ? a * 100 / this.selectedFormat.height : 100, n = this.asset ? s * 100 / this.selectedFormat.width : 100;
|
|
2817
2836
|
let l = this.cropSize.x, p = this.cropSize.y;
|
|
2818
2837
|
l + n > 100 && (l = 100 - n), p + r > 100 && (p = 100 - r);
|
|
2819
|
-
let
|
|
2838
|
+
let c = this.cropSize.cropMode;
|
|
2820
2839
|
this.cropModes.find(
|
|
2821
|
-
(u) => u.value ===
|
|
2822
|
-
)?.auto && (
|
|
2840
|
+
(u) => u.value === c
|
|
2841
|
+
)?.auto && (c = "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 = {
|
|
2823
2842
|
...this.cropSize,
|
|
2824
|
-
cropMode:
|
|
2843
|
+
cropMode: c,
|
|
2825
2844
|
height: a,
|
|
2826
2845
|
keepAspectRatio: t.detail.keepAspectRatio,
|
|
2827
2846
|
percentageHeight: r,
|
|
@@ -2869,28 +2888,28 @@ let m = class extends q {
|
|
|
2869
2888
|
});
|
|
2870
2889
|
}
|
|
2871
2890
|
onCropApply(t) {
|
|
2872
|
-
if (this.clearResetSnapshot(), this.lastAction =
|
|
2891
|
+
if (this.clearResetSnapshot(), this.lastAction = m.Crop, !this.asset) {
|
|
2873
2892
|
const {
|
|
2874
2893
|
focusMode: l,
|
|
2875
2894
|
height: p,
|
|
2876
|
-
position:
|
|
2877
|
-
ratioHeight:
|
|
2895
|
+
position: c,
|
|
2896
|
+
ratioHeight: g,
|
|
2878
2897
|
ratioWidth: u,
|
|
2879
2898
|
unit: y,
|
|
2880
2899
|
width: S,
|
|
2881
2900
|
x: d,
|
|
2882
|
-
y:
|
|
2901
|
+
y: v
|
|
2883
2902
|
} = this.cropSize, k = this.focusModes.find(
|
|
2884
2903
|
(b) => b.value === l
|
|
2885
2904
|
)?.auto ?? !1;
|
|
2886
2905
|
if (y === o.AspectRatio) {
|
|
2887
|
-
u &&
|
|
2888
|
-
key:
|
|
2906
|
+
u && g && this.upsertTransformation({
|
|
2907
|
+
key: m.Crop,
|
|
2889
2908
|
value: {
|
|
2890
2909
|
focusMode: l,
|
|
2891
2910
|
isFocusModeAuto: k,
|
|
2892
|
-
position:
|
|
2893
|
-
ratioHeight:
|
|
2911
|
+
position: c,
|
|
2912
|
+
ratioHeight: g,
|
|
2894
2913
|
ratioWidth: u,
|
|
2895
2914
|
unit: y
|
|
2896
2915
|
}
|
|
@@ -2898,12 +2917,12 @@ let m = class extends q {
|
|
|
2898
2917
|
return;
|
|
2899
2918
|
}
|
|
2900
2919
|
(p || S) && this.upsertTransformation({
|
|
2901
|
-
key:
|
|
2920
|
+
key: m.Crop,
|
|
2902
2921
|
value: {
|
|
2903
2922
|
focusMode: l,
|
|
2904
2923
|
height: p,
|
|
2905
2924
|
isFocusModeAuto: k,
|
|
2906
|
-
position:
|
|
2925
|
+
position: c,
|
|
2907
2926
|
unit: y,
|
|
2908
2927
|
width: S,
|
|
2909
2928
|
/**
|
|
@@ -2914,7 +2933,7 @@ let m = class extends q {
|
|
|
2914
2933
|
* suppress the focus mode / position `c_g_` gravity value.
|
|
2915
2934
|
*/
|
|
2916
2935
|
x: Number.isFinite(d) && d !== 0 ? d : void 0,
|
|
2917
|
-
y: Number.isFinite(
|
|
2936
|
+
y: Number.isFinite(v) && v !== 0 ? v : void 0
|
|
2918
2937
|
}
|
|
2919
2938
|
});
|
|
2920
2939
|
return;
|
|
@@ -2931,7 +2950,7 @@ let m = class extends q {
|
|
|
2931
2950
|
this.transformations = [
|
|
2932
2951
|
...this.transformations,
|
|
2933
2952
|
{
|
|
2934
|
-
key:
|
|
2953
|
+
key: m.Crop,
|
|
2935
2954
|
value: {
|
|
2936
2955
|
focusMode: r,
|
|
2937
2956
|
height: p,
|
|
@@ -2942,19 +2961,19 @@ let m = class extends q {
|
|
|
2942
2961
|
}
|
|
2943
2962
|
];
|
|
2944
2963
|
else {
|
|
2945
|
-
const
|
|
2964
|
+
const c = this.cropSize.x / 100 * this.selectedFormat.width, g = this.cropSize.y / 100 * this.selectedFormat.height;
|
|
2946
2965
|
this.transformations = [
|
|
2947
2966
|
...this.transformations,
|
|
2948
2967
|
{
|
|
2949
|
-
key:
|
|
2968
|
+
key: m.Crop,
|
|
2950
2969
|
value: {
|
|
2951
2970
|
focusMode: r,
|
|
2952
2971
|
height: p,
|
|
2953
2972
|
isFocusModeAuto: n,
|
|
2954
2973
|
unit: s,
|
|
2955
2974
|
width: l,
|
|
2956
|
-
x,
|
|
2957
|
-
y:
|
|
2975
|
+
x: c,
|
|
2976
|
+
y: g
|
|
2958
2977
|
}
|
|
2959
2978
|
}
|
|
2960
2979
|
];
|
|
@@ -2962,7 +2981,7 @@ let m = class extends q {
|
|
|
2962
2981
|
} else i && (this.transformations = [
|
|
2963
2982
|
...this.transformations,
|
|
2964
2983
|
{
|
|
2965
|
-
key:
|
|
2984
|
+
key: m.Crop,
|
|
2966
2985
|
value: {
|
|
2967
2986
|
focusMode: r,
|
|
2968
2987
|
isFocusModeAuto: n,
|
|
@@ -2997,21 +3016,21 @@ let m = class extends q {
|
|
|
2997
3016
|
}
|
|
2998
3017
|
onResizeApply(t) {
|
|
2999
3018
|
const { height: e, unit: i, width: s } = t.detail;
|
|
3000
|
-
if (this.clearResetSnapshot(), this.lastAction =
|
|
3019
|
+
if (this.clearResetSnapshot(), this.lastAction = m.Resize, !this.asset) {
|
|
3001
3020
|
if (i === o.AspectRatio) {
|
|
3002
|
-
const { ratioHeight: p, ratioWidth:
|
|
3003
|
-
|
|
3004
|
-
key:
|
|
3021
|
+
const { ratioHeight: p, ratioWidth: c } = this.resizeSize;
|
|
3022
|
+
c && p && this.upsertTransformation({
|
|
3023
|
+
key: m.Resize,
|
|
3005
3024
|
value: {
|
|
3006
3025
|
ratioHeight: p,
|
|
3007
|
-
ratioWidth:
|
|
3026
|
+
ratioWidth: c,
|
|
3008
3027
|
unit: i
|
|
3009
3028
|
}
|
|
3010
3029
|
});
|
|
3011
3030
|
return;
|
|
3012
3031
|
}
|
|
3013
3032
|
(e || s) && this.upsertTransformation({
|
|
3014
|
-
key:
|
|
3033
|
+
key: m.Resize,
|
|
3015
3034
|
value: {
|
|
3016
3035
|
height: e,
|
|
3017
3036
|
unit: i,
|
|
@@ -3027,7 +3046,7 @@ let m = class extends q {
|
|
|
3027
3046
|
this.resizeSize.unit !== i ? (n = a, l = r) : i === o.AspectRatio && (n = Math.round(s / e * r), l = r), this.transformations = [
|
|
3028
3047
|
...this.transformations,
|
|
3029
3048
|
{
|
|
3030
|
-
key:
|
|
3049
|
+
key: m.Resize,
|
|
3031
3050
|
value: {
|
|
3032
3051
|
height: l,
|
|
3033
3052
|
unit: i,
|
|
@@ -3041,21 +3060,21 @@ let m = class extends q {
|
|
|
3041
3060
|
}
|
|
3042
3061
|
onRotationApply(t) {
|
|
3043
3062
|
const e = t.detail;
|
|
3044
|
-
if (this.clearResetSnapshot(), this.lastAction =
|
|
3063
|
+
if (this.clearResetSnapshot(), this.lastAction = m.Rotate, !this.asset) {
|
|
3045
3064
|
e ? this.upsertTransformation({
|
|
3046
|
-
key:
|
|
3065
|
+
key: m.Rotate,
|
|
3047
3066
|
value: {
|
|
3048
3067
|
rotation: e
|
|
3049
3068
|
}
|
|
3050
3069
|
}) : this.transformations = this.transformations.filter(
|
|
3051
|
-
(i) => i.key !==
|
|
3070
|
+
(i) => i.key !== m.Rotate
|
|
3052
3071
|
);
|
|
3053
3072
|
return;
|
|
3054
3073
|
}
|
|
3055
3074
|
this.selectedFormat && (this.transformations = [
|
|
3056
3075
|
...this.transformations,
|
|
3057
3076
|
{
|
|
3058
|
-
key:
|
|
3077
|
+
key: m.Rotate,
|
|
3059
3078
|
value: {
|
|
3060
3079
|
rotation: e
|
|
3061
3080
|
}
|
|
@@ -3064,9 +3083,9 @@ let m = class extends q {
|
|
|
3064
3083
|
}
|
|
3065
3084
|
onQualityChange(t) {
|
|
3066
3085
|
const e = t.detail;
|
|
3067
|
-
this.selectedFormat && (this.selectedFormat.quality = e), this.clearResetSnapshot(), this.lastAction =
|
|
3086
|
+
this.selectedFormat && (this.selectedFormat.quality = e), this.clearResetSnapshot(), this.lastAction = m.Quality;
|
|
3068
3087
|
const i = {
|
|
3069
|
-
key:
|
|
3088
|
+
key: m.Quality,
|
|
3070
3089
|
value: {
|
|
3071
3090
|
quality: e
|
|
3072
3091
|
}
|
|
@@ -3080,22 +3099,22 @@ let m = class extends q {
|
|
|
3080
3099
|
keepMetadata: e
|
|
3081
3100
|
}), !this.asset) {
|
|
3082
3101
|
e ? this.upsertTransformation({
|
|
3083
|
-
key:
|
|
3102
|
+
key: m.Metadata,
|
|
3084
3103
|
value: {
|
|
3085
3104
|
keepMetadata: e
|
|
3086
3105
|
}
|
|
3087
3106
|
}) : this.transformations = this.transformations.filter(
|
|
3088
|
-
(i) => i.key !==
|
|
3107
|
+
(i) => i.key !== m.Metadata
|
|
3089
3108
|
);
|
|
3090
3109
|
return;
|
|
3091
3110
|
}
|
|
3092
3111
|
e ? this.upsertTransformation({
|
|
3093
|
-
key:
|
|
3112
|
+
key: m.Metadata,
|
|
3094
3113
|
value: {
|
|
3095
3114
|
keepMetadata: e
|
|
3096
3115
|
}
|
|
3097
3116
|
}) : this.transformations = this.transformations.filter(
|
|
3098
|
-
(i) => i.key !==
|
|
3117
|
+
(i) => i.key !== m.Metadata
|
|
3099
3118
|
);
|
|
3100
3119
|
}
|
|
3101
3120
|
onExtensionChange(t) {
|
|
@@ -3107,7 +3126,7 @@ let m = class extends q {
|
|
|
3107
3126
|
}
|
|
3108
3127
|
syncQuality() {
|
|
3109
3128
|
const t = this.transformations.findLast(
|
|
3110
|
-
(e) => e.key ===
|
|
3129
|
+
(e) => e.key === m.Quality
|
|
3111
3130
|
)?.value?.quality;
|
|
3112
3131
|
this.selectedFormat && (this.selectedFormat = {
|
|
3113
3132
|
...this.selectedFormat,
|
|
@@ -3152,20 +3171,20 @@ let m = class extends q {
|
|
|
3152
3171
|
)}
|
|
3153
3172
|
${M(
|
|
3154
3173
|
!this.noFormat,
|
|
3155
|
-
() => 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 ===
|
|
3174
|
+
() => 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>`
|
|
3156
3175
|
)}
|
|
3157
3176
|
${M(
|
|
3158
3177
|
!this.noCrop,
|
|
3159
|
-
() => 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 ===
|
|
3178
|
+
() => 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>`
|
|
3160
3179
|
)}
|
|
3161
3180
|
${M(
|
|
3162
3181
|
!this.noResize,
|
|
3163
|
-
() => C`<cx-asset-link-format-resize class="asset-link-format__details" ?open=${this.activeSetting === "cx-asset-link-format-resize"} ?loading=${this.loading && this.lastAction ===
|
|
3182
|
+
() => 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>`
|
|
3164
3183
|
)}
|
|
3165
3184
|
${M(
|
|
3166
3185
|
!this.noRotate,
|
|
3167
|
-
() => C`<cx-asset-link-format-rotation class="asset-link-format__details" ?loading=${this.loading && this.lastAction ===
|
|
3168
|
-
)}<cx-asset-link-format-quality class="asset-link-format__details" ?loading=${this.loading && this.lastAction ===
|
|
3186
|
+
() => 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>`
|
|
3187
|
+
)}<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(
|
|
3169
3188
|
!this.noMetadata,
|
|
3170
3189
|
() => 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>`
|
|
3171
3190
|
)}
|
|
@@ -3175,9 +3194,9 @@ let m = class extends q {
|
|
|
3175
3194
|
)}</div>`;
|
|
3176
3195
|
}
|
|
3177
3196
|
};
|
|
3178
|
-
|
|
3179
|
-
|
|
3180
|
-
"cx-asset-link-format-crop":
|
|
3197
|
+
f.styles = [G, Ee];
|
|
3198
|
+
f.dependencies = {
|
|
3199
|
+
"cx-asset-link-format-crop": A,
|
|
3181
3200
|
"cx-asset-link-format-extension": K,
|
|
3182
3201
|
"cx-asset-link-format-metadata": L,
|
|
3183
3202
|
"cx-asset-link-format-proxy": I,
|
|
@@ -3185,137 +3204,137 @@ m.dependencies = {
|
|
|
3185
3204
|
"cx-asset-link-format-resize": R,
|
|
3186
3205
|
"cx-asset-link-format-rotation": T,
|
|
3187
3206
|
"cx-button": Y,
|
|
3188
|
-
"cx-space":
|
|
3189
|
-
"cx-typography":
|
|
3207
|
+
"cx-space": q,
|
|
3208
|
+
"cx-typography": U
|
|
3190
3209
|
};
|
|
3191
|
-
|
|
3210
|
+
x([
|
|
3192
3211
|
h({ attribute: "base-url", type: String })
|
|
3193
|
-
],
|
|
3194
|
-
|
|
3212
|
+
], f.prototype, "baseUrl", 2);
|
|
3213
|
+
x([
|
|
3195
3214
|
h({ attribute: "token", type: String })
|
|
3196
|
-
],
|
|
3197
|
-
|
|
3215
|
+
], f.prototype, "token", 2);
|
|
3216
|
+
x([
|
|
3198
3217
|
h({ reflect: !1, type: Object })
|
|
3199
|
-
],
|
|
3200
|
-
|
|
3218
|
+
], f.prototype, "asset", 2);
|
|
3219
|
+
x([
|
|
3201
3220
|
h({ attribute: "crop-modes", reflect: !1, type: Array })
|
|
3202
|
-
],
|
|
3203
|
-
|
|
3221
|
+
], f.prototype, "cropModes", 2);
|
|
3222
|
+
x([
|
|
3204
3223
|
h({ attribute: "focus-modes", reflect: !1, type: Object })
|
|
3205
|
-
],
|
|
3206
|
-
|
|
3224
|
+
], f.prototype, "focusModes", 2);
|
|
3225
|
+
x([
|
|
3207
3226
|
h({ reflect: !1, type: Array })
|
|
3208
|
-
],
|
|
3209
|
-
|
|
3227
|
+
], f.prototype, "extensions", 2);
|
|
3228
|
+
x([
|
|
3210
3229
|
h({ reflect: !1, type: Array })
|
|
3211
|
-
],
|
|
3212
|
-
|
|
3230
|
+
], f.prototype, "proxies", 2);
|
|
3231
|
+
x([
|
|
3213
3232
|
h({ attribute: "for-cropper", reflect: !0, type: String })
|
|
3214
|
-
],
|
|
3215
|
-
|
|
3233
|
+
], f.prototype, "forCropper", 2);
|
|
3234
|
+
x([
|
|
3216
3235
|
h({ attribute: "use-session", reflect: !0, type: String })
|
|
3217
|
-
],
|
|
3218
|
-
|
|
3236
|
+
], f.prototype, "useSession", 2);
|
|
3237
|
+
x([
|
|
3219
3238
|
h({ reflect: !1, type: Array })
|
|
3220
|
-
],
|
|
3221
|
-
|
|
3239
|
+
], f.prototype, "transformations", 2);
|
|
3240
|
+
x([
|
|
3222
3241
|
h({ attribute: "selected-proxy", reflect: !0, type: String })
|
|
3223
|
-
],
|
|
3224
|
-
|
|
3242
|
+
], f.prototype, "selectedProxy", 2);
|
|
3243
|
+
x([
|
|
3225
3244
|
h({ attribute: "default-proxy", reflect: !0, type: String })
|
|
3226
|
-
],
|
|
3227
|
-
|
|
3245
|
+
], f.prototype, "defaultProxy", 2);
|
|
3246
|
+
x([
|
|
3228
3247
|
h({ attribute: "can-auto-format", reflect: !0, type: Boolean })
|
|
3229
|
-
],
|
|
3230
|
-
|
|
3248
|
+
], f.prototype, "canAutoFormat", 2);
|
|
3249
|
+
x([
|
|
3231
3250
|
h({ attribute: "auto-format", reflect: !0, type: Boolean })
|
|
3232
|
-
],
|
|
3233
|
-
|
|
3251
|
+
], f.prototype, "autoFormat", 2);
|
|
3252
|
+
x([
|
|
3234
3253
|
h({ attribute: "use-custom-extension", reflect: !0, type: Boolean })
|
|
3235
|
-
],
|
|
3236
|
-
|
|
3254
|
+
], f.prototype, "useCustomExtension", 2);
|
|
3255
|
+
x([
|
|
3237
3256
|
h({ attribute: "no-metadata", reflect: !0, type: Boolean })
|
|
3238
|
-
],
|
|
3239
|
-
|
|
3257
|
+
], f.prototype, "noMetadata", 2);
|
|
3258
|
+
x([
|
|
3240
3259
|
h({ attribute: "no-format", reflect: !0, type: Boolean })
|
|
3241
|
-
],
|
|
3242
|
-
|
|
3260
|
+
], f.prototype, "noFormat", 2);
|
|
3261
|
+
x([
|
|
3243
3262
|
h({ attribute: "no-crop", reflect: !0, type: Boolean })
|
|
3244
|
-
],
|
|
3245
|
-
|
|
3263
|
+
], f.prototype, "noCrop", 2);
|
|
3264
|
+
x([
|
|
3246
3265
|
h({ attribute: "no-resize", reflect: !0, type: Boolean })
|
|
3247
|
-
],
|
|
3248
|
-
|
|
3266
|
+
], f.prototype, "noResize", 2);
|
|
3267
|
+
x([
|
|
3249
3268
|
h({ attribute: "no-rotate", reflect: !0, type: Boolean })
|
|
3250
|
-
],
|
|
3251
|
-
|
|
3269
|
+
], f.prototype, "noRotate", 2);
|
|
3270
|
+
x([
|
|
3252
3271
|
h({ attribute: "last-image-size", reflect: !1, type: Object })
|
|
3253
|
-
],
|
|
3254
|
-
|
|
3272
|
+
], f.prototype, "lastImageSize", 2);
|
|
3273
|
+
x([
|
|
3255
3274
|
h({ attribute: "hide-header", reflect: !1, type: Boolean })
|
|
3256
|
-
],
|
|
3257
|
-
|
|
3275
|
+
], f.prototype, "hideHeader", 2);
|
|
3276
|
+
x([
|
|
3258
3277
|
h({ attribute: "can-reset", type: Boolean })
|
|
3259
|
-
],
|
|
3260
|
-
|
|
3278
|
+
], f.prototype, "canReset", 2);
|
|
3279
|
+
x([
|
|
3261
3280
|
h({ attribute: !1, reflect: !1, type: Object })
|
|
3262
|
-
],
|
|
3263
|
-
|
|
3281
|
+
], f.prototype, "queryElement", 2);
|
|
3282
|
+
x([
|
|
3264
3283
|
$()
|
|
3265
|
-
],
|
|
3266
|
-
|
|
3284
|
+
], f.prototype, "activeSetting", 2);
|
|
3285
|
+
x([
|
|
3267
3286
|
$()
|
|
3268
|
-
],
|
|
3269
|
-
|
|
3287
|
+
], f.prototype, "selectedFormat", 2);
|
|
3288
|
+
x([
|
|
3270
3289
|
$()
|
|
3271
|
-
],
|
|
3272
|
-
|
|
3290
|
+
], f.prototype, "resizeSize", 2);
|
|
3291
|
+
x([
|
|
3273
3292
|
$()
|
|
3274
|
-
],
|
|
3275
|
-
|
|
3293
|
+
], f.prototype, "cropSize", 2);
|
|
3294
|
+
x([
|
|
3276
3295
|
$()
|
|
3277
|
-
],
|
|
3278
|
-
|
|
3296
|
+
], f.prototype, "rotation", 2);
|
|
3297
|
+
x([
|
|
3279
3298
|
$()
|
|
3280
|
-
],
|
|
3281
|
-
|
|
3299
|
+
], f.prototype, "defaultSize", 2);
|
|
3300
|
+
x([
|
|
3282
3301
|
$()
|
|
3283
|
-
],
|
|
3284
|
-
|
|
3302
|
+
], f.prototype, "cropperElement", 2);
|
|
3303
|
+
x([
|
|
3285
3304
|
$()
|
|
3286
|
-
],
|
|
3287
|
-
|
|
3305
|
+
], f.prototype, "parameters", 2);
|
|
3306
|
+
x([
|
|
3288
3307
|
$()
|
|
3289
|
-
],
|
|
3290
|
-
|
|
3308
|
+
], f.prototype, "loading", 2);
|
|
3309
|
+
x([
|
|
3291
3310
|
$()
|
|
3292
|
-
],
|
|
3293
|
-
|
|
3311
|
+
], f.prototype, "lastAction", 2);
|
|
3312
|
+
x([
|
|
3294
3313
|
$()
|
|
3295
|
-
],
|
|
3296
|
-
|
|
3314
|
+
], f.prototype, "frozenIndex", 2);
|
|
3315
|
+
x([
|
|
3297
3316
|
$()
|
|
3298
|
-
],
|
|
3299
|
-
|
|
3317
|
+
], f.prototype, "preResetTransformations", 2);
|
|
3318
|
+
x([
|
|
3300
3319
|
$()
|
|
3301
|
-
],
|
|
3302
|
-
|
|
3320
|
+
], f.prototype, "preResetAutoFormat", 2);
|
|
3321
|
+
x([
|
|
3303
3322
|
$()
|
|
3304
|
-
],
|
|
3305
|
-
|
|
3323
|
+
], f.prototype, "preResetSelectedProxy", 2);
|
|
3324
|
+
x([
|
|
3306
3325
|
_("transformations")
|
|
3307
|
-
],
|
|
3308
|
-
|
|
3326
|
+
], f.prototype, "handleTransformationsChange", 1);
|
|
3327
|
+
x([
|
|
3309
3328
|
_("selectedProxy")
|
|
3310
|
-
],
|
|
3311
|
-
|
|
3329
|
+
], f.prototype, "handleSelectedProxyChange", 1);
|
|
3330
|
+
x([
|
|
3312
3331
|
_("loading")
|
|
3313
|
-
],
|
|
3314
|
-
|
|
3332
|
+
], f.prototype, "handleLoadingChange", 1);
|
|
3333
|
+
f = x([
|
|
3315
3334
|
Q("cx-asset-link-format")
|
|
3316
|
-
],
|
|
3335
|
+
], f);
|
|
3317
3336
|
export {
|
|
3318
|
-
|
|
3337
|
+
f as C,
|
|
3319
3338
|
lt as F,
|
|
3320
3339
|
jt as M,
|
|
3321
3340
|
$e as a,
|
|
@@ -3330,12 +3349,12 @@ export {
|
|
|
3330
3349
|
gt as j,
|
|
3331
3350
|
ft as k,
|
|
3332
3351
|
Et as l,
|
|
3333
|
-
|
|
3352
|
+
Bi as m,
|
|
3334
3353
|
ji as n,
|
|
3335
3354
|
Ht as o,
|
|
3336
3355
|
Zt as p,
|
|
3337
3356
|
Yi as q,
|
|
3338
|
-
|
|
3357
|
+
Bt as r,
|
|
3339
3358
|
Vi as s,
|
|
3340
3359
|
Gi as t,
|
|
3341
3360
|
de as u,
|