@orangelogic/design-system 2.139.0 → 2.141.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.oOC8fxvV.js → asset-link-format.BDuHqEN5.js} +548 -493
- package/library/chunks/{button.J4LDuhyW.js → button.C6-GrLyD.js} +1 -1
- package/library/chunks/{checkbox.Cjcht4xR.js → checkbox.i5dgRvaf.js} +1 -1
- package/library/chunks/{color-swatch-group.CYI2N8gp.js → color-swatch-group.BqJHjmG5.js} +1099 -1026
- package/library/chunks/{confirm-popover.DV5q0KyE.js → confirm-popover.CTdjw4Mi.js} +1 -1
- package/library/chunks/{document-viewer.Ga2Ppgit.js → document-viewer.BqZzhJyR.js} +1267 -1245
- package/library/chunks/{dom.acWb8KCK.js → dom.CU_mBy9D.js} +1 -1
- package/library/chunks/{file-on-demand.C3ib6J00.js → file-on-demand.Bxq3-Dk1.js} +10 -10
- package/library/chunks/{folder-select.BQXuKb-8.js → folder-select.CpK1RX9O.js} +4 -4
- package/library/chunks/{form.K1XOtu3S.js → form.BSqXLytJ.js} +1 -1
- package/library/chunks/{input.DID1aXiO.js → input.ClJ4MEsk.js} +1 -1
- package/library/chunks/{pagination.BNU2UmTy.js → pagination.CNeaChqP.js} +2 -2
- package/library/chunks/{string.CjJ09HK3.js → string.BmBJ_BLT.js} +38 -34
- package/library/chunks/{tab-group.5O3lqvyG.js → tab-group.COQGzlw4.js} +2 -2
- package/library/chunks/{tree.CbwFiRJI.js → tree.DeIv5gWv.js} +1 -1
- package/library/components/asset-link-format.js +2 -2
- package/library/components/atoms.js +7 -7
- package/library/components/audio.js +6 -3
- package/library/components/border-input-group.js +1 -1
- package/library/components/button.js +2 -2
- package/library/components/checkbox.js +2 -2
- 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/diff.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 +7 -7
- package/library/components/folder-select.js +3 -3
- package/library/components/input.js +2 -2
- package/library/components/line-clamp.js +37 -31
- package/library/components/molecules.js +2 -2
- package/library/components/organisms.js +3 -3
- 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/timecode.js +1 -1
- package/library/components/tree-item.js +2 -2
- package/library/components/tree.js +1 -1
- package/library/components/types.js +17490 -17591
- package/library/package.json +1 -1
- package/library/packages/atoms/src/components/audio/audio.d.ts +5 -0
- package/library/packages/atoms/src/components/line-clamp/line-clamp.d.ts +6 -0
- package/library/packages/events/src/cx-annotator-tool-change.d.ts +11 -0
- package/library/packages/events/src/events.d.ts +1 -0
- package/library/packages/hybrid/book-reader/src/react/constant.d.ts +2 -0
- package/library/packages/hybrid/book-reader/src/react/types.d.ts +2 -2
- package/library/packages/hybrid/table-core/src/table/components/table-toolbar/table-toolbar.d.ts +24 -4
- package/library/packages/hybrid/table-core/src/table/table.d.ts +33 -1
- package/library/packages/hybrid/table-core/src/tabulator-tables/modules/Validate/Validate.d.ts +10 -0
- package/library/packages/molecules/src/annotator/annotator.d.ts +2 -0
- package/library/packages/molecules/src/index.d.ts +1 -0
- package/library/packages/organisms/src/annotator-comment/annotator-comment.d.ts +2 -0
- package/library/packages/organisms/src/asset-link-format/asset-link-format.d.ts +9 -0
- package/library/packages/organisms/src/asset-link-format/components/asset-link-format-crop/asset-link-format-crop.d.ts +0 -4
- package/library/packages/organisms/src/asset-link-format/components/asset-link-format-quality/asset-link-format-quality.d.ts +0 -4
- package/library/packages/organisms/src/asset-link-format/components/asset-link-format-resize/asset-link-format-resize.d.ts +0 -4
- package/library/packages/organisms/src/asset-link-format/components/asset-link-format-rotation/asset-link-format-rotation.d.ts +5 -2
- package/library/packages/organisms/src/index.d.ts +0 -1
- package/library/packages/types/src/table.d.ts +8 -0
- package/library/packages/utils/src/string/string.d.ts +1 -0
- package/library/react-web-component.d.ts +62 -50
- package/library/utils.js +42 -41
- package/package.json +1 -1
- package/library/packages/organisms/src/_v1/comment-v1/extensions/time.d.ts +0 -63
- /package/library/packages/{organisms → molecules}/src/multi-select/components/board/board.d.ts +0 -0
- /package/library/packages/{organisms → molecules}/src/multi-select/components/board/board.styles.d.ts +0 -0
- /package/library/packages/{organisms → molecules}/src/multi-select/components/board/board.utils.d.ts +0 -0
- /package/library/packages/{organisms → molecules}/src/multi-select/components/board-list-item/board-list-item.d.ts +0 -0
- /package/library/packages/{organisms → molecules}/src/multi-select/components/board-list-item/board-list-item.styles.d.ts +0 -0
- /package/library/packages/{organisms → molecules}/src/multi-select/multi-select.d.ts +0 -0
- /package/library/packages/{organisms → molecules}/src/multi-select/multi-select.styles.d.ts +0 -0
- /package/library/packages/{organisms → molecules}/src/multi-select/multi-select.utils.d.ts +0 -0
- /package/library/packages/organisms/src/{annotator-comment → comment}/extensions/time.d.ts +0 -0
|
@@ -1,40 +1,40 @@
|
|
|
1
1
|
import "../components/cropper.js";
|
|
2
|
-
import { C as
|
|
2
|
+
import { C as j } from "./button.C6-GrLyD.js";
|
|
3
3
|
import D from "../components/space.js";
|
|
4
4
|
import { C as T } from "./typography.DJC_UXgs.js";
|
|
5
5
|
import { n as h, C as N } from "./lib-cortex-element.CVMmyPMC.js";
|
|
6
|
-
import { h as P, a as Et, C as
|
|
7
|
-
import { M as
|
|
6
|
+
import { h as P, a as Et, C as Ht, S as Nt, b as Lt, c as Ot } from "./endpoints.BlywT4Gl.js";
|
|
7
|
+
import { M as bt, U as o, T as c } from "./asset-link-format.QzzboHHE.js";
|
|
8
8
|
import "./browser.BHOCIF_A.js";
|
|
9
|
-
import { i as L, x, E as Ut } from "./lit-element.jLBm65_O.js";
|
|
10
|
-
import "./form.
|
|
9
|
+
import { i as L, x as b, E as Ut } from "./lit-element.jLBm65_O.js";
|
|
10
|
+
import "./form.BSqXLytJ.js";
|
|
11
11
|
import { L as O } from "./i18n.DeUAP8n2.js";
|
|
12
|
-
import { a as qt } from "./string.
|
|
12
|
+
import { a as qt } from "./string.BmBJ_BLT.js";
|
|
13
13
|
import "./date-picker.DTUICGb9.js";
|
|
14
14
|
import "./content-builder.BGzxZUgi.js";
|
|
15
15
|
import "./unsafe-html.Dff7-rCx.js";
|
|
16
16
|
import { b as Bt } from "./_baseUniq.HFKneygy.js";
|
|
17
17
|
import { c as U } from "./component.styles.CRO4Odto.js";
|
|
18
18
|
import { c as q } from "./custom-element.L4WJXn1j.js";
|
|
19
|
-
import { w as
|
|
20
|
-
import { s as
|
|
21
|
-
import { b as
|
|
19
|
+
import { w as R } from "./watch.CThbualB.js";
|
|
20
|
+
import { s as wt, c as et } from "./number.B4PQLJIg.js";
|
|
21
|
+
import { b as it } from "./transformation.c-RS37zA.js";
|
|
22
22
|
import { r as v } from "./state.CSDxrqLd.js";
|
|
23
|
-
import { n as
|
|
23
|
+
import { n as E } from "./when.Dr1es41R.js";
|
|
24
24
|
import Z from "../components/details.js";
|
|
25
|
-
import
|
|
25
|
+
import Vt from "../components/divider.js";
|
|
26
26
|
import { C as Y } from "./icon.DnBh6-56.js";
|
|
27
|
-
import { C as
|
|
28
|
-
import { C as
|
|
29
|
-
import { C as
|
|
30
|
-
import
|
|
31
|
-
import { c as
|
|
27
|
+
import { C as mt } from "./icon-button.LhIEmHNF.js";
|
|
28
|
+
import { C as ft } from "./input.ClJ4MEsk.js";
|
|
29
|
+
import { C as nt } from "./option.n6PDuSs1.js";
|
|
30
|
+
import ht from "../components/select.js";
|
|
31
|
+
import { c as jt } from "./image.BzmclWBR.js";
|
|
32
32
|
import { e as J } from "./query.BBf1UFkC.js";
|
|
33
33
|
import { c as tt } from "./repeat.CFjcER6_.js";
|
|
34
|
-
import { o as
|
|
35
|
-
import
|
|
34
|
+
import { o as H } from "./style-map.llVFPd__.js";
|
|
35
|
+
import It from "../components/tooltip.js";
|
|
36
36
|
import Gt from "../components/button-group.js";
|
|
37
|
-
import { C as Qt } from "./checkbox.
|
|
37
|
+
import { C as Qt } from "./checkbox.i5dgRvaf.js";
|
|
38
38
|
function Kt(t) {
|
|
39
39
|
return t && t.length ? Bt(t) : [];
|
|
40
40
|
}
|
|
@@ -64,11 +64,11 @@ const Zt = {
|
|
|
64
64
|
text: "Text",
|
|
65
65
|
title: "Title"
|
|
66
66
|
}, Yt = /* @__PURE__ */ new Set(["mediaDate", "createDate", "editDate"]);
|
|
67
|
-
function
|
|
67
|
+
function dt(t) {
|
|
68
68
|
return !/[\s&+/*"\\:(),'<>~|[\]{}]/.test(t) && !/^(?:OR|AND|NOT)$/.test(t) ? t : `"${t.replace(/\\/g, "\\\\").replace(/"/g, '\\"')}"`;
|
|
69
69
|
}
|
|
70
|
-
function
|
|
71
|
-
const s = (Array.isArray(e) ? e : [e]).map((a) => `${t}:${
|
|
70
|
+
function zt(t, e) {
|
|
71
|
+
const s = (Array.isArray(e) ? e : [e]).map((a) => `${t}:${dt(a)}`);
|
|
72
72
|
return s.length > 1 ? `(${s.join(" OR ")})` : s[0] ?? "";
|
|
73
73
|
}
|
|
74
74
|
function Jt(t, e) {
|
|
@@ -84,7 +84,7 @@ function te(t) {
|
|
|
84
84
|
for (const [n, l] of Object.entries(
|
|
85
85
|
a
|
|
86
86
|
))
|
|
87
|
-
e.push(
|
|
87
|
+
e.push(zt(n, l));
|
|
88
88
|
continue;
|
|
89
89
|
}
|
|
90
90
|
const r = Zt[s];
|
|
@@ -104,38 +104,38 @@ function te(t) {
|
|
|
104
104
|
if (n.length === 0)
|
|
105
105
|
continue;
|
|
106
106
|
const l = [
|
|
107
|
-
...n.map((
|
|
108
|
-
...n.map((
|
|
107
|
+
...n.map((f) => `ParentFolderIdentifier:${dt(String(f))}`),
|
|
108
|
+
...n.map((f) => `ParentAlbumIdentifier:${dt(String(f))}`)
|
|
109
109
|
];
|
|
110
110
|
e.push(`(${l.join(" OR ")})`);
|
|
111
111
|
continue;
|
|
112
112
|
}
|
|
113
|
-
e.push(
|
|
113
|
+
e.push(zt(r, a));
|
|
114
114
|
}
|
|
115
115
|
}
|
|
116
116
|
return e.join(" AND ");
|
|
117
117
|
}
|
|
118
|
-
function
|
|
118
|
+
function st(t) {
|
|
119
119
|
if ("and" in t)
|
|
120
|
-
return t.and.map(
|
|
120
|
+
return t.and.map(st).filter(Boolean).join(" AND ");
|
|
121
121
|
if ("or" in t) {
|
|
122
|
-
const e = t.or.map(
|
|
122
|
+
const e = t.or.map(st).filter(Boolean);
|
|
123
123
|
return e.length > 1 ? `(${e.join(" OR ")})` : e[0] ?? "";
|
|
124
124
|
}
|
|
125
125
|
if ("not" in t) {
|
|
126
|
-
const e =
|
|
126
|
+
const e = st(t.not);
|
|
127
127
|
return e ? `NOT (${e})` : "";
|
|
128
128
|
}
|
|
129
129
|
return te(t);
|
|
130
130
|
}
|
|
131
|
-
const
|
|
131
|
+
const ut = "CoreField.LargeSizePreview", vt = "CoreField.DocType", ee = "Document.Title", ie = "Document.CaptionLong", kt = "Document.FileExtension", Ct = "CoreField.FileSize", Rt = "CoreField.Identifier", $t = "CoreField.Keywords", Pt = "CoreField.MaxHeight", _t = "CoreField.MaxWidth", at = "Document.RecordID", Mt = "CoreField.DocSubType", Wt = "CoreField.TitleWithFallback", ot = "CoreField.OriginalFileName", rt = "CoreField.UpdatedFileName", X = "CoreField.OriginalPreview", pt = {
|
|
132
132
|
DEFAULT_VIEW_SIZE: "Document.LargeSizePreview",
|
|
133
133
|
FIELD_TITLE_WITH_FALLBACK: "Document.TitleWithFallback",
|
|
134
134
|
ORIGINAL_VIEW_SIZE: "Document.OriginalPreview"
|
|
135
135
|
}, Dt = {
|
|
136
|
-
[
|
|
137
|
-
[Wt]:
|
|
138
|
-
[X]:
|
|
136
|
+
[ut]: pt.DEFAULT_VIEW_SIZE,
|
|
137
|
+
[Wt]: pt.FIELD_TITLE_WITH_FALLBACK,
|
|
138
|
+
[X]: pt.ORIGINAL_VIEW_SIZE
|
|
139
139
|
}, se = Object.fromEntries(
|
|
140
140
|
Object.entries(Dt).map(([t, e]) => [
|
|
141
141
|
e,
|
|
@@ -162,42 +162,42 @@ async function Tt({
|
|
|
162
162
|
query: r,
|
|
163
163
|
securityByPassToken: n,
|
|
164
164
|
siteUrl: l,
|
|
165
|
-
sort:
|
|
166
|
-
token:
|
|
167
|
-
useSession:
|
|
165
|
+
sort: f,
|
|
166
|
+
token: y,
|
|
167
|
+
useSession: m
|
|
168
168
|
}) {
|
|
169
|
-
const
|
|
169
|
+
const S = e?.map(ae);
|
|
170
170
|
try {
|
|
171
171
|
return (await P.request({
|
|
172
172
|
baseURL: l,
|
|
173
|
-
headers:
|
|
173
|
+
headers: y ? { Authorization: `Bearer ${y}` } : void 0,
|
|
174
174
|
method: "GET",
|
|
175
175
|
params: {
|
|
176
176
|
CountPerPage: t,
|
|
177
|
-
Fields: Kt(
|
|
177
|
+
Fields: Kt(S),
|
|
178
178
|
Format: "json",
|
|
179
179
|
GetPermanentAssetsPaths: i || void 0,
|
|
180
180
|
PageNumber: a,
|
|
181
|
-
Query:
|
|
181
|
+
Query: st(r),
|
|
182
182
|
SecurityByPassToken: n || void 0,
|
|
183
|
-
Sort:
|
|
184
|
-
UseSession:
|
|
183
|
+
Sort: f || void 0,
|
|
184
|
+
UseSession: m || void 0
|
|
185
185
|
},
|
|
186
186
|
paramsSerializer: { indexes: null },
|
|
187
187
|
responseType: "json",
|
|
188
188
|
transformResponse: [
|
|
189
189
|
...Array.isArray(P.defaults.transformResponse) ? P.defaults.transformResponse : [],
|
|
190
|
-
s ? (
|
|
191
|
-
items: (
|
|
192
|
-
sort:
|
|
193
|
-
totalCount:
|
|
194
|
-
}) : (
|
|
195
|
-
items: (
|
|
196
|
-
sort:
|
|
197
|
-
totalCount:
|
|
190
|
+
s ? (u) => ({
|
|
191
|
+
items: (u.results?.Items ?? []).map(Ft),
|
|
192
|
+
sort: u.results?.GlobalInfo?.Sort ?? "",
|
|
193
|
+
totalCount: u.results?.GlobalInfo?.TotalCount ?? 0
|
|
194
|
+
}) : (u) => ({
|
|
195
|
+
items: (u.APIResponse?.Items ?? []).map(Ft),
|
|
196
|
+
sort: u.APIResponse?.GlobalInfo?.Sort ?? "",
|
|
197
|
+
totalCount: u.APIResponse?.GlobalInfo?.TotalCount ?? 0
|
|
198
198
|
})
|
|
199
199
|
],
|
|
200
|
-
url: s ?
|
|
200
|
+
url: s ? Ht.SEARCH_ASSETS : Nt["4.0"]
|
|
201
201
|
})).data;
|
|
202
202
|
} catch {
|
|
203
203
|
return { items: [], sort: "", totalCount: 0 };
|
|
@@ -252,47 +252,47 @@ async function gi({
|
|
|
252
252
|
}) {
|
|
253
253
|
if (!Array.isArray(s) || s.length === 0)
|
|
254
254
|
return { facets: [], items: [], totalCount: 0 };
|
|
255
|
-
const n = t?.filter((
|
|
255
|
+
const n = t?.filter((u) => u && typeof u == "string") ?? [], l = [
|
|
256
256
|
...n,
|
|
257
257
|
X,
|
|
258
|
+
rt,
|
|
258
259
|
ot,
|
|
259
|
-
at,
|
|
260
260
|
ee,
|
|
261
261
|
ie,
|
|
262
|
-
|
|
263
|
-
],
|
|
264
|
-
|
|
265
|
-
(
|
|
266
|
-
countPerPage:
|
|
262
|
+
at
|
|
263
|
+
], f = ne(s, re), y = await Promise.all(
|
|
264
|
+
f.map(
|
|
265
|
+
(u) => Tt({
|
|
266
|
+
countPerPage: u.length,
|
|
267
267
|
fields: l,
|
|
268
268
|
getPermanentAssetsPaths: e,
|
|
269
269
|
isSiteBuilder: i,
|
|
270
270
|
pageNumber: 1,
|
|
271
|
-
query: { recordId:
|
|
271
|
+
query: { recordId: u },
|
|
272
272
|
securityByPassToken: a,
|
|
273
273
|
token: r
|
|
274
274
|
})
|
|
275
275
|
)
|
|
276
|
-
),
|
|
277
|
-
let
|
|
278
|
-
return
|
|
279
|
-
name:
|
|
280
|
-
originalUrl:
|
|
281
|
-
recordId:
|
|
276
|
+
), m = new Map(s.map((u, $) => [u, $])), S = y.flatMap((u) => u.items).map((u) => {
|
|
277
|
+
let $ = z(u, rt);
|
|
278
|
+
return $ === "" && ($ = z(u, ot)), {
|
|
279
|
+
name: $,
|
|
280
|
+
originalUrl: z(u, X),
|
|
281
|
+
recordId: z(u, at),
|
|
282
282
|
...n.reduce(
|
|
283
|
-
(Q, A) => (Q[A] =
|
|
283
|
+
(Q, A) => (Q[A] = z(u, A), Q),
|
|
284
284
|
{}
|
|
285
285
|
)
|
|
286
286
|
};
|
|
287
287
|
}).sort(
|
|
288
|
-
(
|
|
289
|
-
),
|
|
290
|
-
(
|
|
288
|
+
(u, $) => (m.get(u.recordId) ?? 1 / 0) - (m.get($.recordId) ?? 1 / 0)
|
|
289
|
+
), C = y.reduce(
|
|
290
|
+
(u, $) => u + $.totalCount,
|
|
291
291
|
0
|
|
292
292
|
);
|
|
293
|
-
return { facets: [], items:
|
|
293
|
+
return { facets: [], items: S, totalCount: C };
|
|
294
294
|
}
|
|
295
|
-
function
|
|
295
|
+
function z(t, e) {
|
|
296
296
|
const i = t[e];
|
|
297
297
|
return i == null ? "" : typeof i == "string" ? i : typeof i == "number" || typeof i == "boolean" ? String(i) : Xt(i) ? i.URI : "";
|
|
298
298
|
}
|
|
@@ -305,63 +305,63 @@ async function xi({
|
|
|
305
305
|
limitedDocTypes: r,
|
|
306
306
|
pageNumber: n,
|
|
307
307
|
parentFolderIdentifier: l,
|
|
308
|
-
searchTerm:
|
|
309
|
-
securityByPassToken:
|
|
310
|
-
sortOrder:
|
|
311
|
-
token:
|
|
308
|
+
searchTerm: f,
|
|
309
|
+
securityByPassToken: y,
|
|
310
|
+
sortOrder: m,
|
|
311
|
+
token: S
|
|
312
312
|
}) {
|
|
313
313
|
if (!e && !l)
|
|
314
314
|
return { facets: [], items: [], totalCount: 0 };
|
|
315
|
-
const
|
|
315
|
+
const C = (i?.filter((A) => A && typeof A == "string") ?? []).map((A) => A.replace("%20", " ")), u = {
|
|
316
316
|
directParentFolderIdentifier: e,
|
|
317
317
|
parentFolderIdentifier: l,
|
|
318
|
-
...r.length > 0 ? { docType: [
|
|
319
|
-
},
|
|
318
|
+
...r.length > 0 ? { docType: [bt.Image, bt.Audio] } : {}
|
|
319
|
+
}, $ = await Tt({
|
|
320
320
|
countPerPage: t,
|
|
321
321
|
fields: [
|
|
322
|
-
|
|
322
|
+
...C,
|
|
323
323
|
Wt,
|
|
324
|
-
|
|
324
|
+
ut,
|
|
325
325
|
X,
|
|
326
|
-
|
|
327
|
-
Pt,
|
|
326
|
+
$t,
|
|
328
327
|
_t,
|
|
328
|
+
Pt,
|
|
329
329
|
Ct,
|
|
330
330
|
vt,
|
|
331
331
|
Mt,
|
|
332
|
-
|
|
332
|
+
Rt,
|
|
333
333
|
kt,
|
|
334
|
-
st,
|
|
335
334
|
at,
|
|
336
|
-
ot
|
|
335
|
+
ot,
|
|
336
|
+
rt
|
|
337
337
|
],
|
|
338
338
|
getPermanentAssetsPaths: s,
|
|
339
339
|
isSiteBuilder: a,
|
|
340
340
|
pageNumber: n,
|
|
341
|
-
query:
|
|
342
|
-
securityByPassToken:
|
|
341
|
+
query: u,
|
|
342
|
+
securityByPassToken: y,
|
|
343
343
|
sort: void 0,
|
|
344
|
-
token:
|
|
345
|
-
}), Q =
|
|
346
|
-
let K =
|
|
347
|
-
K && !K.startsWith(".") && (K = "." + K),
|
|
348
|
-
const
|
|
344
|
+
token: S
|
|
345
|
+
}), Q = $.items.map((A) => {
|
|
346
|
+
let K = z(A, kt), ct = z(A, rt), xt = z(A, ut);
|
|
347
|
+
K && !K.startsWith(".") && (K = "." + K), ct === "" && (ct = z(A, ot)), K.toLowerCase() === ".gif" && (xt = z(A, X));
|
|
348
|
+
const yt = z(A, at);
|
|
349
349
|
return {
|
|
350
|
-
docSubType:
|
|
351
|
-
docType:
|
|
350
|
+
docSubType: z(A, Mt),
|
|
351
|
+
docType: z(A, vt) || "",
|
|
352
352
|
extension: K,
|
|
353
|
-
height:
|
|
354
|
-
id:
|
|
355
|
-
identifier:
|
|
356
|
-
imageUrl:
|
|
357
|
-
name:
|
|
358
|
-
originalUrl:
|
|
359
|
-
recordId:
|
|
360
|
-
size:
|
|
361
|
-
tags:
|
|
362
|
-
width:
|
|
363
|
-
|
|
364
|
-
(
|
|
353
|
+
height: z(A, Pt) || "0",
|
|
354
|
+
id: yt,
|
|
355
|
+
identifier: z(A, Rt),
|
|
356
|
+
imageUrl: xt,
|
|
357
|
+
name: ct,
|
|
358
|
+
originalUrl: z(A, X),
|
|
359
|
+
recordId: yt,
|
|
360
|
+
size: z(A, Ct) || "0 MB",
|
|
361
|
+
tags: z(A, $t),
|
|
362
|
+
width: z(A, _t) || "0",
|
|
363
|
+
...C.reduce(
|
|
364
|
+
(St, At) => (St[At] = z(A, At), St),
|
|
365
365
|
{}
|
|
366
366
|
)
|
|
367
367
|
};
|
|
@@ -369,7 +369,7 @@ async function xi({
|
|
|
369
369
|
return {
|
|
370
370
|
facets: [],
|
|
371
371
|
items: Q,
|
|
372
|
-
totalCount:
|
|
372
|
+
totalCount: $.totalCount
|
|
373
373
|
};
|
|
374
374
|
}
|
|
375
375
|
async function he({
|
|
@@ -438,7 +438,7 @@ async function yi({
|
|
|
438
438
|
width: l.width
|
|
439
439
|
})) ?? []
|
|
440
440
|
],
|
|
441
|
-
url: e ?
|
|
441
|
+
url: e ? Ht.GET_AVAILABLE_PROXIES : Ot
|
|
442
442
|
})).data;
|
|
443
443
|
} catch {
|
|
444
444
|
return [];
|
|
@@ -472,14 +472,14 @@ async function Si({
|
|
|
472
472
|
}
|
|
473
473
|
}
|
|
474
474
|
const le = L`.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}`, ce = L`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}`;
|
|
475
|
-
var pe = Object.defineProperty, de = Object.getOwnPropertyDescriptor,
|
|
475
|
+
var pe = Object.defineProperty, de = Object.getOwnPropertyDescriptor, x = (t, e, i, s) => {
|
|
476
476
|
for (var a = s > 1 ? void 0 : s ? de(e, i) : e, r = t.length - 1, n; r >= 0; r--)
|
|
477
477
|
(n = t[r]) && (a = (s ? n(e, i, a) : n(a)) || a);
|
|
478
478
|
return s && a && pe(e, i, a), a;
|
|
479
479
|
};
|
|
480
480
|
let g = class extends N {
|
|
481
481
|
constructor() {
|
|
482
|
-
super(...arguments), this.localize = new O(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.
|
|
482
|
+
super(...arguments), this.localize = new O(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.lastAppliedSetting = {
|
|
483
483
|
[o.Pixel]: {
|
|
484
484
|
height: 0,
|
|
485
485
|
percentageHeight: 100,
|
|
@@ -525,18 +525,14 @@ let g = class extends N {
|
|
|
525
525
|
this.aspectRatio = 1;
|
|
526
526
|
}
|
|
527
527
|
async handleOpenChange() {
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
width: this.lastAppliedSetting[o.Pixel].width
|
|
537
|
-
}
|
|
538
|
-
});
|
|
539
|
-
}
|
|
528
|
+
this.cropMode = "free", await this.updateComplete, this.open || (this.width = this.lastAppliedSetting[o.Pixel].width, this.height = this.lastAppliedSetting[o.Pixel].height, this.unit = o.Pixel, this.emit("cx-asset-link-format-crop-change", {
|
|
529
|
+
detail: {
|
|
530
|
+
height: this.lastAppliedSetting[o.Pixel].height,
|
|
531
|
+
keepAspectRatio: this.keepAspectRatio,
|
|
532
|
+
unit: o.Pixel,
|
|
533
|
+
width: this.lastAppliedSetting[o.Pixel].width
|
|
534
|
+
}
|
|
535
|
+
}));
|
|
540
536
|
}
|
|
541
537
|
handleWidthChange(t) {
|
|
542
538
|
if (!t.target.value) {
|
|
@@ -592,7 +588,7 @@ let g = class extends N {
|
|
|
592
588
|
const [s, a] = e.split(":").map(Number);
|
|
593
589
|
if (this.unit === o.Pixel) {
|
|
594
590
|
let r = s, n = a;
|
|
595
|
-
Number.isFinite(this.maxWidth) && Number.isFinite(this.maxHeight) && ({ height: n, width: r } =
|
|
591
|
+
Number.isFinite(this.maxWidth) && Number.isFinite(this.maxHeight) && ({ height: n, width: r } = jt(
|
|
596
592
|
this.maxWidth,
|
|
597
593
|
this.maxHeight,
|
|
598
594
|
s,
|
|
@@ -702,138 +698,134 @@ let g = class extends N {
|
|
|
702
698
|
}
|
|
703
699
|
render() {
|
|
704
700
|
const t = this.cropModes.filter((i) => !i.auto), e = this.cropModes.filter((i) => i.auto);
|
|
705
|
-
return
|
|
701
|
+
return b`<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"><cx-select data-testid="cx-asset-link-format-crop-mode" value=${this.cropMode} hoist style=${H({
|
|
706
702
|
width: "100%"
|
|
707
703
|
})} @cx-change=${this.onCropModeChange} ?disabled=${this.loading}>${tt(
|
|
708
704
|
t,
|
|
709
705
|
(i) => i.value,
|
|
710
|
-
({ label: i, value: s }) =>
|
|
706
|
+
({ label: i, value: s }) => b`<cx-option value=${s}>${i}</cx-option>`
|
|
711
707
|
)}
|
|
712
|
-
${
|
|
708
|
+
${E(
|
|
713
709
|
e.length > 0,
|
|
714
|
-
() =>
|
|
710
|
+
() => b`<cx-divider></cx-divider><small>${this.localize.term("autoCropping")}</small>`
|
|
715
711
|
)}
|
|
716
712
|
${tt(
|
|
717
713
|
e,
|
|
718
714
|
(i) => i.value,
|
|
719
|
-
({ label: i, value: s }) =>
|
|
715
|
+
({ label: i, value: s }) => b`<cx-option value=${s}>${i}</cx-option>`
|
|
720
716
|
)}</cx-select><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">
|
|
721
717
|
W
|
|
722
|
-
</cx-typography></cx-input><cx-icon-button data-testid="cx-asset-link-format-crop-aspect-ratio" name=${this.keepAspectRatio ? "insert_link" : "link_off"} @click=${this.handleAspectRatioClick} style=${
|
|
718
|
+
</cx-typography></cx-input><cx-icon-button data-testid="cx-asset-link-format-crop-aspect-ratio" name=${this.keepAspectRatio ? "insert_link" : "link_off"} @click=${this.handleAspectRatioClick} style=${H({
|
|
723
719
|
color: this.keepAspectRatio ? "var(--cx-color-primary)" : void 0
|
|
724
720
|
})} ?disabled=${this.loading}></cx-icon-button><cx-input data-testid="cx-asset-link-format-crop-height" placeholder=${this.localize.term("height")} mask="num" .maskBlocks=${{ num: { mask: Number, min: 1 } }} value=${this.unit === o.Pixel ? this.height.toString() : this.ratioHeight.toString()} ?disabled=${this.loading} @cx-change=${this.handleInputChange} @cx-input=${this.handleHeightChange} required><cx-typography slot="prefix" variant="body3" part="input-label">
|
|
725
721
|
H
|
|
726
|
-
</cx-typography></cx-input></div><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></cx-space>${
|
|
722
|
+
</cx-typography></cx-input></div><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></cx-space>${E(
|
|
727
723
|
this.focusModes.length > 0,
|
|
728
|
-
() =>
|
|
724
|
+
() => b`<cx-select data-testid="cx-asset-link-format-crop-focus-mode" value=${this.focusMode} hoist style=${H({
|
|
729
725
|
width: "100%"
|
|
730
726
|
})} @cx-change=${this.onFocusModeChange} ?disabled=${this.loading || this.selectedMode?.disabledSize}>${tt(
|
|
731
727
|
this.focusModes,
|
|
732
728
|
(i) => i.value,
|
|
733
|
-
({ label: i, value: s }) =>
|
|
729
|
+
({ label: i, value: s }) => b`<cx-option value=${s}>${i}</cx-option>`
|
|
734
730
|
)}</cx-select>`
|
|
735
|
-
)}
|
|
736
|
-
${_(this.canApply, () => x`<cx-button data-testid="cx-asset-link-format-crop-apply" variant="primary" ?disabled=${this.disabledApply || this.invalidHeight || this.invalidWidth} ?loading=${this.loading} style=${I({
|
|
731
|
+
)}<cx-button data-testid="cx-asset-link-format-crop-apply" variant="primary" ?disabled=${this.disabledApply || this.invalidHeight || this.invalidWidth} ?loading=${this.loading} style=${H({
|
|
737
732
|
marginLeft: "auto"
|
|
738
|
-
})} @click=${this.handleApply}>${this.localize.term("apply")}</cx-button
|
|
733
|
+
})} @click=${this.handleApply}>${this.localize.term("apply")}</cx-button></cx-space></cx-details>`;
|
|
739
734
|
}
|
|
740
735
|
};
|
|
741
736
|
g.styles = [U, ce];
|
|
742
737
|
g.dependencies = {
|
|
743
|
-
"cx-button":
|
|
738
|
+
"cx-button": j,
|
|
744
739
|
"cx-details": Z,
|
|
745
|
-
"cx-divider":
|
|
740
|
+
"cx-divider": Vt,
|
|
746
741
|
"cx-icon": Y,
|
|
747
|
-
"cx-icon-button":
|
|
748
|
-
"cx-input":
|
|
749
|
-
"cx-option":
|
|
750
|
-
"cx-select":
|
|
742
|
+
"cx-icon-button": mt,
|
|
743
|
+
"cx-input": ft,
|
|
744
|
+
"cx-option": nt,
|
|
745
|
+
"cx-select": ht,
|
|
751
746
|
"cx-space": D,
|
|
752
747
|
"cx-typography": T
|
|
753
748
|
};
|
|
754
|
-
|
|
749
|
+
x([
|
|
755
750
|
J(".details")
|
|
756
751
|
], g.prototype, "base", 2);
|
|
757
|
-
|
|
752
|
+
x([
|
|
758
753
|
h({ reflect: !0, type: Boolean })
|
|
759
754
|
], g.prototype, "open", 2);
|
|
760
|
-
|
|
755
|
+
x([
|
|
761
756
|
h({ reflect: !0, type: Number })
|
|
762
757
|
], g.prototype, "width", 2);
|
|
763
|
-
|
|
758
|
+
x([
|
|
764
759
|
h({ reflect: !0, type: Number })
|
|
765
760
|
], g.prototype, "height", 2);
|
|
766
|
-
|
|
761
|
+
x([
|
|
767
762
|
h({ attribute: "max-width", reflect: !0, type: Number })
|
|
768
763
|
], g.prototype, "maxWidth", 2);
|
|
769
|
-
|
|
764
|
+
x([
|
|
770
765
|
h({ attribute: "max-height", reflect: !0, type: Number })
|
|
771
766
|
], g.prototype, "maxHeight", 2);
|
|
772
|
-
|
|
767
|
+
x([
|
|
773
768
|
h({ attribute: "ratio-width", reflect: !0, type: Number })
|
|
774
769
|
], g.prototype, "ratioWidth", 2);
|
|
775
|
-
|
|
770
|
+
x([
|
|
776
771
|
h({ attribute: "ratio-height", reflect: !0, type: Number })
|
|
777
772
|
], g.prototype, "ratioHeight", 2);
|
|
778
|
-
|
|
773
|
+
x([
|
|
779
774
|
h({ attribute: "percentage-width", reflect: !0, type: Number })
|
|
780
775
|
], g.prototype, "percentageWidth", 2);
|
|
781
|
-
|
|
776
|
+
x([
|
|
782
777
|
h({ attribute: "percentage-height", reflect: !0, type: Number })
|
|
783
778
|
], g.prototype, "percentageHeight", 2);
|
|
784
|
-
|
|
779
|
+
x([
|
|
785
780
|
h({ reflect: !0, type: String })
|
|
786
781
|
], g.prototype, "unit", 2);
|
|
787
|
-
|
|
782
|
+
x([
|
|
788
783
|
h({ attribute: "disabled-apply", reflect: !0, type: Boolean })
|
|
789
784
|
], g.prototype, "disabledApply", 2);
|
|
790
|
-
|
|
791
|
-
h({ attribute: "can-apply", reflect: !0, type: Boolean })
|
|
792
|
-
], g.prototype, "canApply", 2);
|
|
793
|
-
y([
|
|
785
|
+
x([
|
|
794
786
|
h({ attribute: "last-applied-setting", reflect: !1, type: Object })
|
|
795
787
|
], g.prototype, "lastAppliedSetting", 2);
|
|
796
|
-
|
|
788
|
+
x([
|
|
797
789
|
h({ reflect: !0, type: Boolean })
|
|
798
790
|
], g.prototype, "loading", 2);
|
|
799
|
-
|
|
791
|
+
x([
|
|
800
792
|
h({ attribute: "crop-modes", reflect: !1, type: Array })
|
|
801
793
|
], g.prototype, "cropModes", 2);
|
|
802
|
-
|
|
794
|
+
x([
|
|
803
795
|
h({ attribute: "focus-modes", reflect: !1, type: Object })
|
|
804
796
|
], g.prototype, "focusModes", 2);
|
|
805
|
-
|
|
797
|
+
x([
|
|
806
798
|
h({ attribute: "focus-mode", reflect: !0, type: String })
|
|
807
799
|
], g.prototype, "focusMode", 2);
|
|
808
|
-
|
|
800
|
+
x([
|
|
809
801
|
h({ attribute: "crop-mode", reflect: !0, type: String })
|
|
810
802
|
], g.prototype, "cropMode", 2);
|
|
811
|
-
|
|
803
|
+
x([
|
|
812
804
|
h({ attribute: "keep-aspect-ratio", reflect: !0, type: Boolean })
|
|
813
805
|
], g.prototype, "keepAspectRatio", 2);
|
|
814
|
-
|
|
806
|
+
x([
|
|
815
807
|
v()
|
|
816
808
|
], g.prototype, "invalidWidth", 2);
|
|
817
|
-
|
|
809
|
+
x([
|
|
818
810
|
v()
|
|
819
811
|
], g.prototype, "invalidHeight", 2);
|
|
820
|
-
|
|
812
|
+
x([
|
|
821
813
|
v()
|
|
822
814
|
], g.prototype, "aspectRatio", 2);
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
815
|
+
x([
|
|
816
|
+
R("cropMode", { waitUntilFirstUpdate: !0 }),
|
|
817
|
+
R("maxWidth", { waitUntilFirstUpdate: !0 }),
|
|
818
|
+
R("maxHeight", { waitUntilFirstUpdate: !0 }),
|
|
819
|
+
R("keepAspectRatio")
|
|
828
820
|
], g.prototype, "handleCropModeChange", 1);
|
|
829
|
-
|
|
830
|
-
|
|
821
|
+
x([
|
|
822
|
+
R("open")
|
|
831
823
|
], g.prototype, "handleOpenChange", 1);
|
|
832
|
-
g =
|
|
824
|
+
g = x([
|
|
833
825
|
q("cx-asset-link-format-crop")
|
|
834
826
|
], g);
|
|
835
827
|
const ue = L`.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%}}`;
|
|
836
|
-
var me = Object.defineProperty, fe = Object.getOwnPropertyDescriptor,
|
|
828
|
+
var me = Object.defineProperty, fe = Object.getOwnPropertyDescriptor, gt = (t, e, i, s) => {
|
|
837
829
|
for (var a = s > 1 ? void 0 : s ? fe(e, i) : e, r = t.length - 1, n; r >= 0; r--)
|
|
838
830
|
(n = t[r]) && (a = (s ? n(e, i, a) : n(a)) || a);
|
|
839
831
|
return s && a && me(e, i, a), a;
|
|
@@ -849,36 +841,36 @@ let V = class extends N {
|
|
|
849
841
|
});
|
|
850
842
|
}
|
|
851
843
|
render() {
|
|
852
|
-
return
|
|
844
|
+
return b`<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}>${tt(
|
|
853
845
|
this.items,
|
|
854
846
|
(t) => t.value,
|
|
855
|
-
(t) =>
|
|
847
|
+
(t) => b`<cx-option value=${t.value}>${t.displayName}</cx-option>`
|
|
856
848
|
)}</cx-select></cx-space>`;
|
|
857
849
|
}
|
|
858
850
|
};
|
|
859
851
|
V.styles = [U, ue];
|
|
860
852
|
V.dependencies = {
|
|
861
|
-
"cx-option":
|
|
862
|
-
"cx-select":
|
|
853
|
+
"cx-option": nt,
|
|
854
|
+
"cx-select": ht,
|
|
863
855
|
"cx-space": D,
|
|
864
856
|
"cx-typography": T
|
|
865
857
|
};
|
|
866
|
-
|
|
858
|
+
gt([
|
|
867
859
|
h({ reflect: !0, type: String })
|
|
868
860
|
], V.prototype, "value", 2);
|
|
869
|
-
|
|
861
|
+
gt([
|
|
870
862
|
h({ reflect: !1, type: Array })
|
|
871
863
|
], V.prototype, "items", 2);
|
|
872
|
-
V =
|
|
864
|
+
V = gt([
|
|
873
865
|
q("cx-asset-link-format-extension")
|
|
874
866
|
], V);
|
|
875
867
|
const ge = L`cx-details::part(base){border-bottom-width:0}`;
|
|
876
|
-
var xe = Object.defineProperty, ye = Object.getOwnPropertyDescriptor,
|
|
868
|
+
var xe = Object.defineProperty, ye = Object.getOwnPropertyDescriptor, I = (t, e, i, s) => {
|
|
877
869
|
for (var a = s > 1 ? void 0 : s ? ye(e, i) : e, r = t.length - 1, n; r >= 0; r--)
|
|
878
870
|
(n = t[r]) && (a = (s ? n(e, i, a) : n(a)) || a);
|
|
879
871
|
return s && a && xe(e, i, a), a;
|
|
880
872
|
};
|
|
881
|
-
let
|
|
873
|
+
let _ = class extends N {
|
|
882
874
|
constructor() {
|
|
883
875
|
super(...arguments), this.localize = new O(this), this.open = !1, this.value = "", this.items = [], this.loading = !1, this.scopedValue = "";
|
|
884
876
|
}
|
|
@@ -924,61 +916,61 @@ let M = class extends N {
|
|
|
924
916
|
t.target !== this.base && t.stopPropagation();
|
|
925
917
|
}
|
|
926
918
|
render() {
|
|
927
|
-
return
|
|
919
|
+
return b`<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}>${tt(
|
|
928
920
|
this.items,
|
|
929
921
|
(t) => t.id,
|
|
930
|
-
(t) =>
|
|
931
|
-
)}</cx-select><cx-button data-testid="cx-asset-link-format-proxy-apply" variant="primary" style=${
|
|
922
|
+
(t) => b`<cx-option value=${t.id}>${t.proxyLabel}</cx-option>`
|
|
923
|
+
)}</cx-select><cx-button data-testid="cx-asset-link-format-proxy-apply" variant="primary" style=${H({
|
|
932
924
|
"margin-left": "auto"
|
|
933
925
|
})} ?disabled=${this.scopedValue === this.value} ?loading=${this.loading} @click=${this.handleApply}>${this.localize.term("apply")}</cx-button></cx-space></cx-details>`;
|
|
934
926
|
}
|
|
935
927
|
};
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
"cx-button":
|
|
928
|
+
_.styles = [U, ge];
|
|
929
|
+
_.dependencies = {
|
|
930
|
+
"cx-button": j,
|
|
939
931
|
"cx-details": Z,
|
|
940
932
|
"cx-icon": Y,
|
|
941
|
-
"cx-option":
|
|
942
|
-
"cx-select":
|
|
933
|
+
"cx-option": nt,
|
|
934
|
+
"cx-select": ht,
|
|
943
935
|
"cx-space": D,
|
|
944
936
|
"cx-typography": T
|
|
945
937
|
};
|
|
946
|
-
|
|
938
|
+
I([
|
|
947
939
|
J(".details")
|
|
948
|
-
],
|
|
949
|
-
|
|
940
|
+
], _.prototype, "base", 2);
|
|
941
|
+
I([
|
|
950
942
|
h({ reflect: !0, type: Boolean })
|
|
951
|
-
],
|
|
952
|
-
|
|
943
|
+
], _.prototype, "open", 2);
|
|
944
|
+
I([
|
|
953
945
|
h({ reflect: !0, type: String })
|
|
954
|
-
],
|
|
955
|
-
|
|
946
|
+
], _.prototype, "value", 2);
|
|
947
|
+
I([
|
|
956
948
|
h({ reflect: !1, type: Array })
|
|
957
|
-
],
|
|
958
|
-
|
|
949
|
+
], _.prototype, "items", 2);
|
|
950
|
+
I([
|
|
959
951
|
h({ reflect: !0, type: Boolean })
|
|
960
|
-
],
|
|
961
|
-
|
|
952
|
+
], _.prototype, "loading", 2);
|
|
953
|
+
I([
|
|
962
954
|
v()
|
|
963
|
-
],
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
],
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
],
|
|
970
|
-
|
|
955
|
+
], _.prototype, "scopedValue", 2);
|
|
956
|
+
I([
|
|
957
|
+
R("value")
|
|
958
|
+
], _.prototype, "handleValueChange", 1);
|
|
959
|
+
I([
|
|
960
|
+
R("open", { waitUntilFirstUpdate: !0 })
|
|
961
|
+
], _.prototype, "handleOpenChange", 1);
|
|
962
|
+
_ = I([
|
|
971
963
|
q("cx-asset-link-format-proxy")
|
|
972
|
-
],
|
|
964
|
+
], _);
|
|
973
965
|
const Se = L`cx-details::part(base){border-bottom-width:0}`;
|
|
974
|
-
var Ae = Object.defineProperty, be = Object.getOwnPropertyDescriptor,
|
|
966
|
+
var Ae = Object.defineProperty, be = Object.getOwnPropertyDescriptor, G = (t, e, i, s) => {
|
|
975
967
|
for (var a = s > 1 ? void 0 : s ? be(e, i) : e, r = t.length - 1, n; r >= 0; r--)
|
|
976
968
|
(n = t[r]) && (a = (s ? n(e, i, a) : n(a)) || a);
|
|
977
969
|
return s && a && Ae(e, i, a), a;
|
|
978
970
|
};
|
|
979
971
|
let F = class extends N {
|
|
980
972
|
constructor() {
|
|
981
|
-
super(...arguments), this.localize = new O(this), this.open = !1, this.value = 100, this.loading = !1, this.
|
|
973
|
+
super(...arguments), this.localize = new O(this), this.open = !1, this.value = 100, this.loading = !1, this.scopedValue = 100;
|
|
982
974
|
}
|
|
983
975
|
/**
|
|
984
976
|
* A computed property that checks if the current quality value is invalid.
|
|
@@ -993,9 +985,7 @@ let F = class extends N {
|
|
|
993
985
|
}
|
|
994
986
|
handleQualityChange(t) {
|
|
995
987
|
const e = t.target.value;
|
|
996
|
-
this.scopedValue = Number(e)
|
|
997
|
-
detail: this.scopedValue
|
|
998
|
-
});
|
|
988
|
+
this.scopedValue = Number(e);
|
|
999
989
|
}
|
|
1000
990
|
/**
|
|
1001
991
|
* Handles the application of the input quality.
|
|
@@ -1024,57 +1014,54 @@ let F = class extends N {
|
|
|
1024
1014
|
t.target !== this.base && t.stopPropagation();
|
|
1025
1015
|
}
|
|
1026
1016
|
render() {
|
|
1027
|
-
return
|
|
1017
|
+
return b`<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=${H({
|
|
1028
1018
|
flex: "1"
|
|
1029
|
-
})} @cx-input=${this.handleQualityChange}></cx-input></cx-tooltip
|
|
1019
|
+
})} @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>`;
|
|
1030
1020
|
}
|
|
1031
1021
|
};
|
|
1032
1022
|
F.styles = [U, Se];
|
|
1033
1023
|
F.dependencies = {
|
|
1034
|
-
"cx-button":
|
|
1024
|
+
"cx-button": j,
|
|
1035
1025
|
"cx-details": Z,
|
|
1036
1026
|
"cx-icon": Y,
|
|
1037
|
-
"cx-input":
|
|
1027
|
+
"cx-input": ft,
|
|
1038
1028
|
"cx-space": D,
|
|
1039
|
-
"cx-tooltip":
|
|
1029
|
+
"cx-tooltip": It,
|
|
1040
1030
|
"cx-typography": T
|
|
1041
1031
|
};
|
|
1042
|
-
|
|
1032
|
+
G([
|
|
1043
1033
|
J(".details")
|
|
1044
1034
|
], F.prototype, "base", 2);
|
|
1045
|
-
|
|
1035
|
+
G([
|
|
1046
1036
|
h({ reflect: !0, type: Boolean })
|
|
1047
1037
|
], F.prototype, "open", 2);
|
|
1048
|
-
|
|
1038
|
+
G([
|
|
1049
1039
|
h({ reflect: !0, type: Number })
|
|
1050
1040
|
], F.prototype, "value", 2);
|
|
1051
|
-
|
|
1041
|
+
G([
|
|
1052
1042
|
h({ reflect: !0, type: Boolean })
|
|
1053
1043
|
], F.prototype, "loading", 2);
|
|
1054
|
-
|
|
1055
|
-
h({ attribute: "can-apply", reflect: !0, type: Boolean })
|
|
1056
|
-
], F.prototype, "canApply", 2);
|
|
1057
|
-
B([
|
|
1044
|
+
G([
|
|
1058
1045
|
v()
|
|
1059
1046
|
], F.prototype, "scopedValue", 2);
|
|
1060
|
-
|
|
1061
|
-
|
|
1047
|
+
G([
|
|
1048
|
+
R("value")
|
|
1062
1049
|
], F.prototype, "handleValueChange", 1);
|
|
1063
|
-
F =
|
|
1050
|
+
F = G([
|
|
1064
1051
|
q("cx-asset-link-format-quality")
|
|
1065
1052
|
], F);
|
|
1066
|
-
const
|
|
1067
|
-
var
|
|
1053
|
+
const we = L`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}`;
|
|
1054
|
+
var ze = Object.defineProperty, ve = Object.getOwnPropertyDescriptor, k = (t, e, i, s) => {
|
|
1068
1055
|
for (var a = s > 1 ? void 0 : s ? ve(e, i) : e, r = t.length - 1, n; r >= 0; r--)
|
|
1069
1056
|
(n = t[r]) && (a = (s ? n(e, i, a) : n(a)) || a);
|
|
1070
|
-
return s && a &&
|
|
1057
|
+
return s && a && ze(e, i, a), a;
|
|
1071
1058
|
};
|
|
1072
|
-
let
|
|
1059
|
+
let w = class extends N {
|
|
1073
1060
|
constructor() {
|
|
1074
1061
|
super(...arguments), this.localize = new O(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 = {
|
|
1075
1062
|
[o.Pixel]: { height: 0, width: 0 },
|
|
1076
1063
|
[o.AspectRatio]: { height: 1, width: 1 }
|
|
1077
|
-
}, this.loading = !1, this.
|
|
1064
|
+
}, this.loading = !1, this.keepAspectRatio = !1, this.invalidWidth = !1, this.invalidHeight = !1, this.aspectRatio = 0;
|
|
1078
1065
|
}
|
|
1079
1066
|
/**
|
|
1080
1067
|
* A computed property that checks if the current resize settings match the last applied settings.
|
|
@@ -1101,18 +1088,14 @@ let b = class extends N {
|
|
|
1101
1088
|
this.aspectRatio = 1;
|
|
1102
1089
|
}
|
|
1103
1090
|
async handleOpenChange() {
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
width: this.lastAppliedSetting[o.Pixel].width
|
|
1113
|
-
}
|
|
1114
|
-
});
|
|
1115
|
-
}
|
|
1091
|
+
await this.updateComplete, this.open || (this.width = this.lastAppliedSetting[o.Pixel].width, this.height = this.lastAppliedSetting[o.Pixel].height, this.unit = o.Pixel, this.emit("cx-asset-link-format-resize-change", {
|
|
1092
|
+
detail: {
|
|
1093
|
+
height: this.lastAppliedSetting[o.Pixel].height,
|
|
1094
|
+
keepAspectRatio: this.keepAspectRatio,
|
|
1095
|
+
unit: o.Pixel,
|
|
1096
|
+
width: this.lastAppliedSetting[o.Pixel].width
|
|
1097
|
+
}
|
|
1098
|
+
}));
|
|
1116
1099
|
}
|
|
1117
1100
|
handleWidthChange(t) {
|
|
1118
1101
|
if (!t.target.value) {
|
|
@@ -1209,117 +1192,110 @@ let b = class extends N {
|
|
|
1209
1192
|
});
|
|
1210
1193
|
}
|
|
1211
1194
|
render() {
|
|
1212
|
-
return
|
|
1195
|
+
return b`<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">
|
|
1213
1196
|
W
|
|
1214
|
-
</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=${
|
|
1197
|
+
</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=${H({
|
|
1215
1198
|
color: this.keepAspectRatio ? "var(--cx-color-primary)" : void 0
|
|
1216
1199
|
})} ?disabled=${this.loading}></cx-icon-button><cx-input data-testid="cx-asset-link-format-resize-height" placeholder=${this.localize.term("height")} mask="num" .maskBlocks=${{ num: { mask: Number, min: 1 } }} value=${this.unit === o.Pixel ? this.height.toString() : this.ratioHeight.toString()} @cx-input=${this.handleHeightChange} required ?disabled=${this.loading}><cx-typography slot="prefix" variant="body3" part="input-label">
|
|
1217
1200
|
H
|
|
1218
|
-
</cx-typography></cx-input></div><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></cx-space
|
|
1201
|
+
</cx-typography></cx-input></div><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></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=${H({
|
|
1219
1202
|
marginLeft: "auto"
|
|
1220
|
-
})} @click=${this.handleApply}>${this.localize.term("apply")}</cx-button
|
|
1203
|
+
})} @click=${this.handleApply}>${this.localize.term("apply")}</cx-button></cx-space></cx-details>`;
|
|
1221
1204
|
}
|
|
1222
1205
|
};
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
"cx-button":
|
|
1206
|
+
w.styles = [U, we];
|
|
1207
|
+
w.dependencies = {
|
|
1208
|
+
"cx-button": j,
|
|
1226
1209
|
"cx-details": Z,
|
|
1227
1210
|
"cx-icon": Y,
|
|
1228
|
-
"cx-icon-button":
|
|
1229
|
-
"cx-input":
|
|
1230
|
-
"cx-option":
|
|
1231
|
-
"cx-select":
|
|
1211
|
+
"cx-icon-button": mt,
|
|
1212
|
+
"cx-input": ft,
|
|
1213
|
+
"cx-option": nt,
|
|
1214
|
+
"cx-select": ht,
|
|
1232
1215
|
"cx-space": D,
|
|
1233
1216
|
"cx-typography": T
|
|
1234
1217
|
};
|
|
1235
1218
|
k([
|
|
1236
1219
|
J(".details")
|
|
1237
|
-
],
|
|
1220
|
+
], w.prototype, "base", 2);
|
|
1238
1221
|
k([
|
|
1239
1222
|
h({ reflect: !0, type: Boolean })
|
|
1240
|
-
],
|
|
1223
|
+
], w.prototype, "open", 2);
|
|
1241
1224
|
k([
|
|
1242
1225
|
h({ reflect: !0, type: Number })
|
|
1243
|
-
],
|
|
1226
|
+
], w.prototype, "width", 2);
|
|
1244
1227
|
k([
|
|
1245
1228
|
h({ reflect: !0, type: Number })
|
|
1246
|
-
],
|
|
1229
|
+
], w.prototype, "height", 2);
|
|
1247
1230
|
k([
|
|
1248
1231
|
h({ attribute: "max-width", reflect: !0, type: Number })
|
|
1249
|
-
],
|
|
1232
|
+
], w.prototype, "maxWidth", 2);
|
|
1250
1233
|
k([
|
|
1251
1234
|
h({ attribute: "max-height", reflect: !0, type: Number })
|
|
1252
|
-
],
|
|
1235
|
+
], w.prototype, "maxHeight", 2);
|
|
1253
1236
|
k([
|
|
1254
1237
|
h({ attribute: "ratio-width", reflect: !0, type: Number })
|
|
1255
|
-
],
|
|
1238
|
+
], w.prototype, "ratioWidth", 2);
|
|
1256
1239
|
k([
|
|
1257
1240
|
h({ attribute: "ratio-height", reflect: !0, type: Number })
|
|
1258
|
-
],
|
|
1241
|
+
], w.prototype, "ratioHeight", 2);
|
|
1259
1242
|
k([
|
|
1260
1243
|
h({ reflect: !0, type: String })
|
|
1261
|
-
],
|
|
1244
|
+
], w.prototype, "unit", 2);
|
|
1262
1245
|
k([
|
|
1263
1246
|
h({ attribute: "last-applied-setting", reflect: !1, type: Object })
|
|
1264
|
-
],
|
|
1247
|
+
], w.prototype, "lastAppliedSetting", 2);
|
|
1265
1248
|
k([
|
|
1266
1249
|
h({ reflect: !0, type: Boolean })
|
|
1267
|
-
],
|
|
1268
|
-
k([
|
|
1269
|
-
h({ attribute: "can-apply", reflect: !0, type: Boolean })
|
|
1270
|
-
], b.prototype, "canApply", 2);
|
|
1250
|
+
], w.prototype, "loading", 2);
|
|
1271
1251
|
k([
|
|
1272
1252
|
h({ attribute: "keep-aspect-ratio", reflect: !0, type: Boolean })
|
|
1273
|
-
],
|
|
1253
|
+
], w.prototype, "keepAspectRatio", 2);
|
|
1274
1254
|
k([
|
|
1275
1255
|
v()
|
|
1276
|
-
],
|
|
1256
|
+
], w.prototype, "invalidWidth", 2);
|
|
1277
1257
|
k([
|
|
1278
1258
|
v()
|
|
1279
|
-
],
|
|
1259
|
+
], w.prototype, "invalidHeight", 2);
|
|
1280
1260
|
k([
|
|
1281
1261
|
v()
|
|
1282
|
-
],
|
|
1262
|
+
], w.prototype, "aspectRatio", 2);
|
|
1283
1263
|
k([
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
],
|
|
1264
|
+
R("cropMode", { waitUntilFirstUpdate: !0 }),
|
|
1265
|
+
R("maxWidth", { waitUntilFirstUpdate: !0 }),
|
|
1266
|
+
R("maxHeight", { waitUntilFirstUpdate: !0 }),
|
|
1267
|
+
R("keepAspectRatio")
|
|
1268
|
+
], w.prototype, "handleCropModeChange", 1);
|
|
1289
1269
|
k([
|
|
1290
|
-
|
|
1291
|
-
],
|
|
1292
|
-
|
|
1270
|
+
R("open")
|
|
1271
|
+
], w.prototype, "handleOpenChange", 1);
|
|
1272
|
+
w = k([
|
|
1293
1273
|
q("cx-asset-link-format-resize")
|
|
1294
|
-
],
|
|
1274
|
+
], w);
|
|
1295
1275
|
const ke = L`cx-details::part(base){border-bottom-width:0}`;
|
|
1296
|
-
var Ce = Object.defineProperty,
|
|
1297
|
-
for (var a = s > 1 ? void 0 : s ?
|
|
1276
|
+
var Ce = Object.defineProperty, Re = Object.getOwnPropertyDescriptor, B = (t, e, i, s) => {
|
|
1277
|
+
for (var a = s > 1 ? void 0 : s ? Re(e, i) : e, r = t.length - 1, n; r >= 0; r--)
|
|
1298
1278
|
(n = t[r]) && (a = (s ? n(e, i, a) : n(a)) || a);
|
|
1299
1279
|
return s && a && Ce(e, i, a), a;
|
|
1300
1280
|
};
|
|
1301
|
-
let
|
|
1281
|
+
let M = class extends N {
|
|
1302
1282
|
constructor() {
|
|
1303
|
-
super(...arguments), this.localize = new O(this), this.open = !1, this.value = 0, this.defaultValue = 0, this.loading = !1, this.
|
|
1283
|
+
super(...arguments), this.localize = new O(this), this.open = !1, this.value = 0, this.defaultValue = 0, this.loading = !1, this.lastAppliedValue = 0;
|
|
1304
1284
|
}
|
|
1305
1285
|
handleOpenChange() {
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
this.emit("cx-asset-link-format-rotation-change", {
|
|
1310
|
-
detail: 0
|
|
1311
|
-
});
|
|
1312
|
-
}
|
|
1286
|
+
this.open || this.emit("cx-asset-link-format-rotation-change", {
|
|
1287
|
+
detail: this.lastAppliedValue
|
|
1288
|
+
});
|
|
1313
1289
|
}
|
|
1314
1290
|
handleRotationChange(t) {
|
|
1315
|
-
const e = t.target.value, i =
|
|
1291
|
+
const e = t.target.value, i = wt(Number(e));
|
|
1316
1292
|
(Number(e) > 360 || Number(e) < -360) && (t.target.value = i.toString()), this.emit("cx-asset-link-format-rotation-change", {
|
|
1317
1293
|
detail: i
|
|
1318
1294
|
});
|
|
1319
1295
|
}
|
|
1320
1296
|
handleButtonClick(t) {
|
|
1321
1297
|
this.emit("cx-asset-link-format-rotation-change", {
|
|
1322
|
-
detail:
|
|
1298
|
+
detail: wt(t)
|
|
1323
1299
|
});
|
|
1324
1300
|
}
|
|
1325
1301
|
handleClockwiseClick() {
|
|
@@ -1339,51 +1315,51 @@ let E = class extends N {
|
|
|
1339
1315
|
});
|
|
1340
1316
|
}
|
|
1341
1317
|
render() {
|
|
1342
|
-
return
|
|
1318
|
+
return b`<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=${H({
|
|
1343
1319
|
flex: "none",
|
|
1344
1320
|
width: "80px"
|
|
1345
|
-
})} @cx-input=${this.handleRotationChange}></cx-input
|
|
1321
|
+
})} @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>`;
|
|
1346
1322
|
}
|
|
1347
1323
|
};
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
"cx-button":
|
|
1324
|
+
M.styles = [U, ke];
|
|
1325
|
+
M.dependencies = {
|
|
1326
|
+
"cx-button": j,
|
|
1351
1327
|
"cx-button-group": Gt,
|
|
1352
1328
|
"cx-details": Z,
|
|
1353
1329
|
"cx-icon": Y,
|
|
1354
|
-
"cx-icon-button":
|
|
1330
|
+
"cx-icon-button": mt,
|
|
1355
1331
|
"cx-space": D,
|
|
1356
1332
|
"cx-typography": T
|
|
1357
1333
|
};
|
|
1358
|
-
|
|
1334
|
+
B([
|
|
1359
1335
|
J(".details")
|
|
1360
|
-
],
|
|
1361
|
-
|
|
1336
|
+
], M.prototype, "base", 2);
|
|
1337
|
+
B([
|
|
1362
1338
|
h({ reflect: !0, type: Boolean })
|
|
1363
|
-
],
|
|
1364
|
-
|
|
1339
|
+
], M.prototype, "open", 2);
|
|
1340
|
+
B([
|
|
1365
1341
|
h({ reflect: !0, type: Number })
|
|
1366
|
-
],
|
|
1367
|
-
|
|
1342
|
+
], M.prototype, "value", 2);
|
|
1343
|
+
B([
|
|
1368
1344
|
h({ attribute: "default-value", reflect: !0, type: Number })
|
|
1369
|
-
],
|
|
1370
|
-
|
|
1345
|
+
], M.prototype, "defaultValue", 2);
|
|
1346
|
+
B([
|
|
1371
1347
|
h({ reflect: !0, type: Boolean })
|
|
1372
|
-
],
|
|
1373
|
-
|
|
1374
|
-
h({ attribute: "
|
|
1375
|
-
],
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
],
|
|
1379
|
-
|
|
1348
|
+
], M.prototype, "loading", 2);
|
|
1349
|
+
B([
|
|
1350
|
+
h({ attribute: "last-applied-value", reflect: !0, type: Number })
|
|
1351
|
+
], M.prototype, "lastAppliedValue", 2);
|
|
1352
|
+
B([
|
|
1353
|
+
R("open", { waitUntilFirstUpdate: !0 })
|
|
1354
|
+
], M.prototype, "handleOpenChange", 1);
|
|
1355
|
+
M = B([
|
|
1380
1356
|
q("cx-asset-link-format-rotation")
|
|
1381
|
-
],
|
|
1382
|
-
const
|
|
1383
|
-
var
|
|
1384
|
-
for (var a = s > 1 ? void 0 : s ?
|
|
1357
|
+
], M);
|
|
1358
|
+
const $e = L`cx-details::part(base){border-bottom-width:0}`;
|
|
1359
|
+
var Pe = Object.defineProperty, _e = Object.getOwnPropertyDescriptor, lt = (t, e, i, s) => {
|
|
1360
|
+
for (var a = s > 1 ? void 0 : s ? _e(e, i) : e, r = t.length - 1, n; r >= 0; r--)
|
|
1385
1361
|
(n = t[r]) && (a = (s ? n(e, i, a) : n(a)) || a);
|
|
1386
|
-
return s && a &&
|
|
1362
|
+
return s && a && Pe(e, i, a), a;
|
|
1387
1363
|
};
|
|
1388
1364
|
let W = class extends N {
|
|
1389
1365
|
constructor() {
|
|
@@ -1411,29 +1387,29 @@ let W = class extends N {
|
|
|
1411
1387
|
t.target !== this.base && t.stopPropagation();
|
|
1412
1388
|
}
|
|
1413
1389
|
render() {
|
|
1414
|
-
return
|
|
1390
|
+
return b`<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>`;
|
|
1415
1391
|
}
|
|
1416
1392
|
};
|
|
1417
|
-
W.styles = [U,
|
|
1393
|
+
W.styles = [U, $e];
|
|
1418
1394
|
W.dependencies = {
|
|
1419
|
-
"cx-button":
|
|
1395
|
+
"cx-button": j,
|
|
1420
1396
|
"cx-checkbox": Qt,
|
|
1421
1397
|
"cx-details": Z,
|
|
1422
1398
|
"cx-icon": Y,
|
|
1423
1399
|
"cx-space": D,
|
|
1424
|
-
"cx-tooltip":
|
|
1400
|
+
"cx-tooltip": It,
|
|
1425
1401
|
"cx-typography": T
|
|
1426
1402
|
};
|
|
1427
|
-
|
|
1403
|
+
lt([
|
|
1428
1404
|
J(".details")
|
|
1429
1405
|
], W.prototype, "base", 2);
|
|
1430
|
-
|
|
1406
|
+
lt([
|
|
1431
1407
|
h({ reflect: !0, type: Boolean })
|
|
1432
1408
|
], W.prototype, "open", 2);
|
|
1433
|
-
|
|
1409
|
+
lt([
|
|
1434
1410
|
h({ reflect: !0, type: Boolean })
|
|
1435
1411
|
], W.prototype, "value", 2);
|
|
1436
|
-
W =
|
|
1412
|
+
W = lt([
|
|
1437
1413
|
q("cx-asset-link-format-metadata")
|
|
1438
1414
|
], W);
|
|
1439
1415
|
var Me = Object.defineProperty, Fe = Object.getOwnPropertyDescriptor, d = (t, e, i, s) => {
|
|
@@ -1574,7 +1550,57 @@ let p = class extends N {
|
|
|
1574
1550
|
* It returns an object with the last crop size in both pixel and aspect ratio units.
|
|
1575
1551
|
*/
|
|
1576
1552
|
get lastCropSize() {
|
|
1577
|
-
|
|
1553
|
+
if (!this.asset) {
|
|
1554
|
+
const e = this.transformations.findLast(
|
|
1555
|
+
(i) => i.key === c.Crop
|
|
1556
|
+
);
|
|
1557
|
+
if (e?.value.width && e?.value.height) {
|
|
1558
|
+
const { height: i, unit: s, width: a, x: r = 0, y: n = 0 } = e.value;
|
|
1559
|
+
if (s === o.AspectRatio)
|
|
1560
|
+
return {
|
|
1561
|
+
[o.AspectRatio]: {
|
|
1562
|
+
height: i,
|
|
1563
|
+
percentageHeight: 100,
|
|
1564
|
+
percentageWidth: 100,
|
|
1565
|
+
unit: o.AspectRatio,
|
|
1566
|
+
width: a,
|
|
1567
|
+
x: 0,
|
|
1568
|
+
y: 0
|
|
1569
|
+
},
|
|
1570
|
+
[o.Pixel]: {
|
|
1571
|
+
height: 0,
|
|
1572
|
+
percentageHeight: 100,
|
|
1573
|
+
percentageWidth: 100,
|
|
1574
|
+
unit: o.Pixel,
|
|
1575
|
+
width: 0,
|
|
1576
|
+
x: 0,
|
|
1577
|
+
y: 0
|
|
1578
|
+
}
|
|
1579
|
+
};
|
|
1580
|
+
const l = et(a, i);
|
|
1581
|
+
return {
|
|
1582
|
+
[o.AspectRatio]: {
|
|
1583
|
+
height: l.height,
|
|
1584
|
+
percentageHeight: 100,
|
|
1585
|
+
percentageWidth: 100,
|
|
1586
|
+
unit: o.AspectRatio,
|
|
1587
|
+
width: l.width,
|
|
1588
|
+
x: 0,
|
|
1589
|
+
y: 0
|
|
1590
|
+
},
|
|
1591
|
+
[o.Pixel]: {
|
|
1592
|
+
height: i,
|
|
1593
|
+
percentageHeight: 100,
|
|
1594
|
+
percentageWidth: 100,
|
|
1595
|
+
unit: o.Pixel,
|
|
1596
|
+
width: a,
|
|
1597
|
+
x: r,
|
|
1598
|
+
y: n
|
|
1599
|
+
}
|
|
1600
|
+
};
|
|
1601
|
+
}
|
|
1602
|
+
}
|
|
1603
|
+
const t = et(
|
|
1578
1604
|
this.lastImageSize.width,
|
|
1579
1605
|
this.lastImageSize.height
|
|
1580
1606
|
);
|
|
@@ -1605,7 +1631,41 @@ let p = class extends N {
|
|
|
1605
1631
|
* It returns an object with the last resize size in both pixel and aspect ratio units.
|
|
1606
1632
|
*/
|
|
1607
1633
|
get lastResizeSize() {
|
|
1608
|
-
|
|
1634
|
+
if (!this.asset) {
|
|
1635
|
+
const e = this.transformations.findLast(
|
|
1636
|
+
(i) => i.key === c.Resize
|
|
1637
|
+
);
|
|
1638
|
+
if (e?.value.width && e?.value.height) {
|
|
1639
|
+
const { height: i, unit: s, width: a } = e.value;
|
|
1640
|
+
if (s === o.AspectRatio)
|
|
1641
|
+
return {
|
|
1642
|
+
[o.AspectRatio]: {
|
|
1643
|
+
height: i,
|
|
1644
|
+
unit: o.AspectRatio,
|
|
1645
|
+
width: a
|
|
1646
|
+
},
|
|
1647
|
+
[o.Pixel]: {
|
|
1648
|
+
height: 0,
|
|
1649
|
+
unit: o.Pixel,
|
|
1650
|
+
width: 0
|
|
1651
|
+
}
|
|
1652
|
+
};
|
|
1653
|
+
const r = et(a, i);
|
|
1654
|
+
return {
|
|
1655
|
+
[o.AspectRatio]: {
|
|
1656
|
+
height: r.height,
|
|
1657
|
+
unit: o.AspectRatio,
|
|
1658
|
+
width: r.width
|
|
1659
|
+
},
|
|
1660
|
+
[o.Pixel]: {
|
|
1661
|
+
height: i,
|
|
1662
|
+
unit: o.Pixel,
|
|
1663
|
+
width: a
|
|
1664
|
+
}
|
|
1665
|
+
};
|
|
1666
|
+
}
|
|
1667
|
+
}
|
|
1668
|
+
const t = et(
|
|
1609
1669
|
this.lastImageSize.width,
|
|
1610
1670
|
this.lastImageSize.height
|
|
1611
1671
|
);
|
|
@@ -1622,11 +1682,24 @@ let p = class extends N {
|
|
|
1622
1682
|
}
|
|
1623
1683
|
};
|
|
1624
1684
|
}
|
|
1685
|
+
/**
|
|
1686
|
+
* Returns the last applied rotation value. Without an asset, rotation applies replace
|
|
1687
|
+
* (dedupe) a single Rotate entry, so this reflects the exact committed value — used to
|
|
1688
|
+
* know when the rotation panel has no pending change to apply, and to restore this value
|
|
1689
|
+
* when the panel is closed without applying. With an asset, rotation applies are
|
|
1690
|
+
* cumulative deltas reprocessed by the backend, so there is no single "last applied"
|
|
1691
|
+
* value and this always returns 0.
|
|
1692
|
+
*/
|
|
1693
|
+
get lastRotation() {
|
|
1694
|
+
return this.asset ? 0 : this.transformations.findLast(
|
|
1695
|
+
(e) => e.key === c.Rotate
|
|
1696
|
+
)?.value.rotation ?? 0;
|
|
1697
|
+
}
|
|
1625
1698
|
/**
|
|
1626
1699
|
* Returns the transformation string for the asset link.
|
|
1627
1700
|
*/
|
|
1628
1701
|
get transformationString() {
|
|
1629
|
-
return
|
|
1702
|
+
return it({
|
|
1630
1703
|
asset: this.asset,
|
|
1631
1704
|
baseUrl: "",
|
|
1632
1705
|
parameters: this.parameters,
|
|
@@ -1681,7 +1754,7 @@ let p = class extends N {
|
|
|
1681
1754
|
*/
|
|
1682
1755
|
});
|
|
1683
1756
|
});
|
|
1684
|
-
const i =
|
|
1757
|
+
const i = it({
|
|
1685
1758
|
asset: this.asset,
|
|
1686
1759
|
baseUrl: "",
|
|
1687
1760
|
extension: this.selectedFormat.extension,
|
|
@@ -1714,7 +1787,7 @@ let p = class extends N {
|
|
|
1714
1787
|
async handleTransformationsChange() {
|
|
1715
1788
|
if (await this.updateComplete, !this.asset) {
|
|
1716
1789
|
this.emit("cx-asset-link-format-change", {
|
|
1717
|
-
detail:
|
|
1790
|
+
detail: it({
|
|
1718
1791
|
asset: this.asset,
|
|
1719
1792
|
baseUrl: "",
|
|
1720
1793
|
options: {
|
|
@@ -1726,20 +1799,20 @@ let p = class extends N {
|
|
|
1726
1799
|
}).replace(/\/t\//g, "")
|
|
1727
1800
|
});
|
|
1728
1801
|
const r = this.transformations.findLast(
|
|
1729
|
-
(
|
|
1802
|
+
(m) => m.key === c.Crop && m.value.width && m.value.height
|
|
1730
1803
|
);
|
|
1731
1804
|
if (r) {
|
|
1732
|
-
const { focusMode:
|
|
1805
|
+
const { focusMode: m, height: S, unit: C, width: u, x: $ = 0, y: Q = 0 } = r.value;
|
|
1733
1806
|
this.cropSize = {
|
|
1734
1807
|
...this.cropSize,
|
|
1735
1808
|
cropMode: "free",
|
|
1736
|
-
focusMode:
|
|
1737
|
-
height:
|
|
1809
|
+
focusMode: m ?? "manual",
|
|
1810
|
+
height: S,
|
|
1738
1811
|
percentageHeight: 100,
|
|
1739
1812
|
percentageWidth: 100,
|
|
1740
|
-
unit:
|
|
1741
|
-
width:
|
|
1742
|
-
x:
|
|
1813
|
+
unit: C ?? o.Pixel,
|
|
1814
|
+
width: u,
|
|
1815
|
+
x: $,
|
|
1743
1816
|
y: Q
|
|
1744
1817
|
};
|
|
1745
1818
|
} else
|
|
@@ -1756,15 +1829,15 @@ let p = class extends N {
|
|
|
1756
1829
|
y: 0
|
|
1757
1830
|
};
|
|
1758
1831
|
const n = this.transformations.findLast(
|
|
1759
|
-
(
|
|
1832
|
+
(m) => m.key === c.Resize && (m.value.width || m.value.height)
|
|
1760
1833
|
);
|
|
1761
1834
|
if (n) {
|
|
1762
|
-
const { height:
|
|
1835
|
+
const { height: m = 0, unit: S, width: C = 0 } = n.value;
|
|
1763
1836
|
this.resizeSize = {
|
|
1764
1837
|
...this.resizeSize,
|
|
1765
|
-
height:
|
|
1766
|
-
unit:
|
|
1767
|
-
width:
|
|
1838
|
+
height: m,
|
|
1839
|
+
unit: S ?? o.Pixel,
|
|
1840
|
+
width: C
|
|
1768
1841
|
};
|
|
1769
1842
|
} else
|
|
1770
1843
|
this.resizeSize = {
|
|
@@ -1774,18 +1847,18 @@ let p = class extends N {
|
|
|
1774
1847
|
width: 0
|
|
1775
1848
|
};
|
|
1776
1849
|
const l = this.transformations.findLast(
|
|
1777
|
-
(
|
|
1850
|
+
(m) => m.key === c.Rotate
|
|
1778
1851
|
);
|
|
1779
1852
|
this.rotation = l?.value.rotation ?? 0;
|
|
1780
|
-
const
|
|
1781
|
-
(
|
|
1853
|
+
const f = this.transformations.findLast((m) => m.key === c.Quality)?.value.quality ?? 100, y = this.transformations.some(
|
|
1854
|
+
(m) => m.key === c.Metadata
|
|
1782
1855
|
);
|
|
1783
|
-
this.selectedFormat ? this.selectedFormat = { ...this.selectedFormat, keepMetadata:
|
|
1856
|
+
this.selectedFormat ? this.selectedFormat = { ...this.selectedFormat, keepMetadata: y, quality: f } : this.selectedFormat = {
|
|
1784
1857
|
extension: "",
|
|
1785
1858
|
height: 0,
|
|
1786
|
-
keepMetadata:
|
|
1859
|
+
keepMetadata: y,
|
|
1787
1860
|
originalUrl: "",
|
|
1788
|
-
quality:
|
|
1861
|
+
quality: f,
|
|
1789
1862
|
rotation: 0,
|
|
1790
1863
|
url: "",
|
|
1791
1864
|
width: 0,
|
|
@@ -1851,7 +1924,7 @@ let p = class extends N {
|
|
|
1851
1924
|
* url: `${this.baseUrl}/${response.relativePath}`,
|
|
1852
1925
|
*/
|
|
1853
1926
|
};
|
|
1854
|
-
const a =
|
|
1927
|
+
const a = it({
|
|
1855
1928
|
asset: this.asset,
|
|
1856
1929
|
baseUrl: "",
|
|
1857
1930
|
extension: this.selectedFormat.extension,
|
|
@@ -1930,7 +2003,7 @@ let p = class extends N {
|
|
|
1930
2003
|
const i = this.proxies?.find((s) => s.id === t);
|
|
1931
2004
|
i && (this.asset && i.proxyName === "TRX" && (i.formatHeight = Number(this.asset.height), i.formatWidth = Number(this.asset.width)), this.transformations = this.transformations.map((s) => {
|
|
1932
2005
|
if (s.key === c.Crop) {
|
|
1933
|
-
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,
|
|
2006
|
+
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, f = a.y / i.formatHeight * e.formatHeight;
|
|
1934
2007
|
return {
|
|
1935
2008
|
...s,
|
|
1936
2009
|
value: {
|
|
@@ -1938,7 +2011,7 @@ let p = class extends N {
|
|
|
1938
2011
|
height: n,
|
|
1939
2012
|
width: r,
|
|
1940
2013
|
x: l,
|
|
1941
|
-
y:
|
|
2014
|
+
y: f
|
|
1942
2015
|
}
|
|
1943
2016
|
};
|
|
1944
2017
|
}
|
|
@@ -2016,30 +2089,30 @@ let p = class extends N {
|
|
|
2016
2089
|
percentageWidth: r,
|
|
2017
2090
|
ratioHeight: n,
|
|
2018
2091
|
ratioWidth: l,
|
|
2019
|
-
unit:
|
|
2020
|
-
useCropMode:
|
|
2021
|
-
width:
|
|
2092
|
+
unit: f,
|
|
2093
|
+
useCropMode: y,
|
|
2094
|
+
width: m
|
|
2022
2095
|
}) {
|
|
2023
2096
|
if (!this.selectedFormat?.url || e === "manual")
|
|
2024
2097
|
return;
|
|
2025
2098
|
this.loading = !0, this.lastAction = c.Crop;
|
|
2026
|
-
const
|
|
2099
|
+
const S = await this.apiGetCropFocusMode({
|
|
2027
2100
|
autoCropMode: e,
|
|
2028
2101
|
cropHeight: i,
|
|
2029
|
-
cropWidth:
|
|
2102
|
+
cropWidth: m,
|
|
2030
2103
|
imageUrl: this.selectedFormat.url
|
|
2031
2104
|
});
|
|
2032
|
-
if (
|
|
2033
|
-
let
|
|
2034
|
-
i || (
|
|
2105
|
+
if (S) {
|
|
2106
|
+
let C = a, u = r;
|
|
2107
|
+
i || (C = S.height * 100 / this.selectedFormat.height), m || (u = S.width * 100 / this.selectedFormat.width), this.cropSize = {
|
|
2035
2108
|
...this.cropSize,
|
|
2036
|
-
height:
|
|
2037
|
-
percentageHeight:
|
|
2038
|
-
percentageWidth:
|
|
2039
|
-
width:
|
|
2040
|
-
x:
|
|
2041
|
-
y:
|
|
2042
|
-
...
|
|
2109
|
+
height: S.height,
|
|
2110
|
+
percentageHeight: C ?? this.cropSize.percentageHeight,
|
|
2111
|
+
percentageWidth: u ?? this.cropSize.percentageWidth,
|
|
2112
|
+
width: S.width,
|
|
2113
|
+
x: S.x * 100 / this.selectedFormat.width,
|
|
2114
|
+
y: S.y * 100 / this.selectedFormat.height,
|
|
2115
|
+
...y ? {
|
|
2043
2116
|
cropMode: e,
|
|
2044
2117
|
focusMode: "manual",
|
|
2045
2118
|
keepAspectRatio: !1
|
|
@@ -2050,7 +2123,7 @@ let p = class extends N {
|
|
|
2050
2123
|
keepAspectRatio: s ?? this.cropSize.keepAspectRatio,
|
|
2051
2124
|
ratioHeight: n ?? this.cropSize.ratioHeight,
|
|
2052
2125
|
ratioWidth: l ?? this.cropSize.ratioWidth,
|
|
2053
|
-
unit:
|
|
2126
|
+
unit: f ?? this.cropSize.unit
|
|
2054
2127
|
};
|
|
2055
2128
|
}
|
|
2056
2129
|
this.loading = !1, this.lastAction = void 0;
|
|
@@ -2065,25 +2138,25 @@ let p = class extends N {
|
|
|
2065
2138
|
if (s === 0 || i === 0)
|
|
2066
2139
|
return;
|
|
2067
2140
|
const n = this.cropSize.percentageWidth !== s, l = this.cropSize.percentageHeight !== i;
|
|
2068
|
-
let
|
|
2069
|
-
n && (
|
|
2141
|
+
let f = this.cropSize.height, y = this.cropSize.width;
|
|
2142
|
+
n && (y = Math.round(s * this.selectedFormat.width / 100)), l && (f = Math.round(
|
|
2070
2143
|
i * this.selectedFormat.height / 100
|
|
2071
2144
|
));
|
|
2072
|
-
const
|
|
2145
|
+
const m = this.cropSize.focusMode;
|
|
2073
2146
|
this.focusModes.find(
|
|
2074
|
-
(
|
|
2147
|
+
(C) => C.value === m
|
|
2075
2148
|
)?.auto && this.selectedFormat?.url && this.cropperElement ? await this.handleRequestAutoCropSuggestion({
|
|
2076
|
-
focusMode:
|
|
2077
|
-
height:
|
|
2149
|
+
focusMode: m,
|
|
2150
|
+
height: f,
|
|
2078
2151
|
percentageHeight: i,
|
|
2079
2152
|
percentageWidth: s,
|
|
2080
|
-
width:
|
|
2153
|
+
width: y
|
|
2081
2154
|
}) : this.cropSize = {
|
|
2082
2155
|
...this.cropSize,
|
|
2083
|
-
height:
|
|
2156
|
+
height: f,
|
|
2084
2157
|
percentageHeight: i,
|
|
2085
2158
|
percentageWidth: s,
|
|
2086
|
-
width:
|
|
2159
|
+
width: y,
|
|
2087
2160
|
x: a,
|
|
2088
2161
|
y: r
|
|
2089
2162
|
};
|
|
@@ -2119,7 +2192,7 @@ let p = class extends N {
|
|
|
2119
2192
|
});
|
|
2120
2193
|
else {
|
|
2121
2194
|
const s = this.focusModes.find(
|
|
2122
|
-
(
|
|
2195
|
+
(f) => f.value === this.cropSize.focusMode
|
|
2123
2196
|
)?.auto;
|
|
2124
2197
|
let a = this.cropSize.keepAspectRatio, r = this.cropSize.focusMode, n = this.cropSize.x, l = this.cropSize.y;
|
|
2125
2198
|
e === "free" ? (a = !1, r = "manual") : this.cropSize.unit === o.Pixel && !s && (n = 0, l = 0), s ? await this.handleRequestAutoCropSuggestion({
|
|
@@ -2135,40 +2208,19 @@ let p = class extends N {
|
|
|
2135
2208
|
keepAspectRatio: a,
|
|
2136
2209
|
x: n,
|
|
2137
2210
|
y: l
|
|
2138
|
-
}
|
|
2139
|
-
key: c.Crop,
|
|
2140
|
-
value: {
|
|
2141
|
-
mode: e
|
|
2142
|
-
}
|
|
2143
|
-
}) : this.transformations = this.transformations.filter(
|
|
2144
|
-
(u) => u.key !== c.Crop
|
|
2145
|
-
));
|
|
2211
|
+
};
|
|
2146
2212
|
}
|
|
2147
2213
|
}
|
|
2148
2214
|
onCropFocusModeChange(t) {
|
|
2149
|
-
const { mode: e } = t.detail
|
|
2150
|
-
|
|
2215
|
+
const { mode: e } = t.detail;
|
|
2216
|
+
this.focusModes.find((s) => s.value === e)?.auto && this.selectedFormat?.url ? this.handleRequestAutoCropSuggestion({
|
|
2151
2217
|
focusMode: e,
|
|
2152
2218
|
height: this.cropSize.height,
|
|
2153
2219
|
width: this.cropSize.width
|
|
2154
2220
|
}) : this.cropSize = {
|
|
2155
2221
|
...this.cropSize,
|
|
2156
2222
|
focusMode: e
|
|
2157
|
-
}
|
|
2158
|
-
const { height: s, unit: a, width: r, x: n, y: l } = this.cropSize;
|
|
2159
|
-
(s || r) && this.upsertTransformation({
|
|
2160
|
-
key: c.Crop,
|
|
2161
|
-
value: {
|
|
2162
|
-
focusMode: e,
|
|
2163
|
-
height: s,
|
|
2164
|
-
isFocusModeAuto: i ?? !1,
|
|
2165
|
-
unit: a,
|
|
2166
|
-
width: r,
|
|
2167
|
-
x: n,
|
|
2168
|
-
y: l
|
|
2169
|
-
}
|
|
2170
|
-
});
|
|
2171
|
-
}
|
|
2223
|
+
};
|
|
2172
2224
|
}
|
|
2173
2225
|
async onCropChange(t) {
|
|
2174
2226
|
const e = this.cropSize.unit;
|
|
@@ -2180,14 +2232,14 @@ let p = class extends N {
|
|
|
2180
2232
|
Math.max(Math.round(s / i), 0),
|
|
2181
2233
|
this.resizeSize.height
|
|
2182
2234
|
), r = a * 100 / this.selectedFormat.height, n = s * 100 / this.selectedFormat.width;
|
|
2183
|
-
let l = this.cropSize.x,
|
|
2184
|
-
l + n > 100 && (l = 100 - n),
|
|
2185
|
-
let
|
|
2235
|
+
let l = this.cropSize.x, f = this.cropSize.y;
|
|
2236
|
+
l + n > 100 && (l = 100 - n), f + r > 100 && (f = 100 - r);
|
|
2237
|
+
let y = this.cropSize.cropMode;
|
|
2186
2238
|
this.cropModes.find(
|
|
2187
|
-
(
|
|
2188
|
-
)?.auto && (
|
|
2239
|
+
(S) => S.value === y
|
|
2240
|
+
)?.auto && (y = "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 = {
|
|
2189
2241
|
...this.cropSize,
|
|
2190
|
-
cropMode:
|
|
2242
|
+
cropMode: y,
|
|
2191
2243
|
height: a,
|
|
2192
2244
|
keepAspectRatio: t.detail.keepAspectRatio,
|
|
2193
2245
|
percentageHeight: r,
|
|
@@ -2197,7 +2249,7 @@ let p = class extends N {
|
|
|
2197
2249
|
unit: o.AspectRatio,
|
|
2198
2250
|
width: s,
|
|
2199
2251
|
x: l,
|
|
2200
|
-
y:
|
|
2252
|
+
y: f
|
|
2201
2253
|
};
|
|
2202
2254
|
} else {
|
|
2203
2255
|
const i = this.selectedFormat ? t.detail.height * 100 / this.selectedFormat.height : 100, s = this.selectedFormat ? t.detail.width * 100 / this.selectedFormat.width : 100;
|
|
@@ -2205,7 +2257,7 @@ let p = class extends N {
|
|
|
2205
2257
|
a + s > 100 && (a = 100 - s), r + i > 100 && (r = 100 - i);
|
|
2206
2258
|
let n = this.cropSize.cropMode;
|
|
2207
2259
|
const l = this.cropModes.find(
|
|
2208
|
-
(
|
|
2260
|
+
(f) => f.value === n
|
|
2209
2261
|
)?.auto;
|
|
2210
2262
|
(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 = {
|
|
2211
2263
|
...this.cropSize,
|
|
@@ -2220,26 +2272,10 @@ let p = class extends N {
|
|
|
2220
2272
|
y: r
|
|
2221
2273
|
};
|
|
2222
2274
|
}
|
|
2223
|
-
|
|
2275
|
+
e !== this.cropSize.unit && (this.cropSize = {
|
|
2224
2276
|
...this.cropSize,
|
|
2225
2277
|
cropMode: "free"
|
|
2226
|
-
}, this.onCropChanged())
|
|
2227
|
-
const { focusMode: i, height: s, unit: a, width: r, x: n, y: l } = this.cropSize, u = this.focusModes.find(
|
|
2228
|
-
(S) => S.value === i
|
|
2229
|
-
)?.auto ?? !1;
|
|
2230
|
-
(s || r) && this.upsertTransformation({
|
|
2231
|
-
key: c.Crop,
|
|
2232
|
-
value: {
|
|
2233
|
-
focusMode: i,
|
|
2234
|
-
height: s,
|
|
2235
|
-
isFocusModeAuto: u,
|
|
2236
|
-
unit: a,
|
|
2237
|
-
width: r,
|
|
2238
|
-
x: n,
|
|
2239
|
-
y: l
|
|
2240
|
-
}
|
|
2241
|
-
});
|
|
2242
|
-
}
|
|
2278
|
+
}, this.onCropChanged());
|
|
2243
2279
|
}
|
|
2244
2280
|
async onCropChanged() {
|
|
2245
2281
|
this.focusModes.find(
|
|
@@ -2251,22 +2287,40 @@ let p = class extends N {
|
|
|
2251
2287
|
});
|
|
2252
2288
|
}
|
|
2253
2289
|
onCropApply(t) {
|
|
2290
|
+
if (this.preResetTransformations = void 0, this.lastAction = c.Crop, !this.asset) {
|
|
2291
|
+
const { focusMode: l, height: f, unit: y, width: m, x: S, y: C } = this.cropSize, u = this.focusModes.find(
|
|
2292
|
+
($) => $.value === l
|
|
2293
|
+
)?.auto ?? !1;
|
|
2294
|
+
(f || m) && this.upsertTransformation({
|
|
2295
|
+
key: c.Crop,
|
|
2296
|
+
value: {
|
|
2297
|
+
focusMode: l,
|
|
2298
|
+
height: f,
|
|
2299
|
+
isFocusModeAuto: u,
|
|
2300
|
+
unit: y,
|
|
2301
|
+
width: m,
|
|
2302
|
+
x: Number.isFinite(S) ? S : void 0,
|
|
2303
|
+
y: Number.isFinite(C) ? C : void 0
|
|
2304
|
+
}
|
|
2305
|
+
});
|
|
2306
|
+
return;
|
|
2307
|
+
}
|
|
2254
2308
|
const { height: e, mode: i, unit: s, width: a } = t.detail;
|
|
2255
|
-
if (
|
|
2309
|
+
if (!this.cropperElement || !this.selectedFormat)
|
|
2256
2310
|
return;
|
|
2257
2311
|
const r = this.cropSize.focusMode, n = this.focusModes.find(
|
|
2258
2312
|
(l) => l.value === r
|
|
2259
2313
|
)?.auto ?? !1;
|
|
2260
2314
|
if (e && a && s) {
|
|
2261
|
-
let l = a,
|
|
2262
|
-
if (s === o.AspectRatio && (l = this.cropSize.percentageWidth * this.selectedFormat.width / 100,
|
|
2315
|
+
let l = a, f = e;
|
|
2316
|
+
if (s === o.AspectRatio && (l = this.cropSize.percentageWidth * this.selectedFormat.width / 100, f = this.cropSize.percentageHeight * this.selectedFormat.height / 100), i)
|
|
2263
2317
|
this.transformations = [
|
|
2264
2318
|
...this.transformations,
|
|
2265
2319
|
{
|
|
2266
2320
|
key: c.Crop,
|
|
2267
2321
|
value: {
|
|
2268
2322
|
focusMode: r,
|
|
2269
|
-
height:
|
|
2323
|
+
height: f,
|
|
2270
2324
|
isFocusModeAuto: n,
|
|
2271
2325
|
mode: i,
|
|
2272
2326
|
width: l
|
|
@@ -2274,19 +2328,19 @@ let p = class extends N {
|
|
|
2274
2328
|
}
|
|
2275
2329
|
];
|
|
2276
2330
|
else {
|
|
2277
|
-
const
|
|
2331
|
+
const y = this.cropSize.x / 100 * this.selectedFormat.width, m = this.cropSize.y / 100 * this.selectedFormat.height;
|
|
2278
2332
|
this.transformations = [
|
|
2279
2333
|
...this.transformations,
|
|
2280
2334
|
{
|
|
2281
2335
|
key: c.Crop,
|
|
2282
2336
|
value: {
|
|
2283
2337
|
focusMode: r,
|
|
2284
|
-
height:
|
|
2338
|
+
height: f,
|
|
2285
2339
|
isFocusModeAuto: n,
|
|
2286
2340
|
unit: s,
|
|
2287
2341
|
width: l,
|
|
2288
|
-
x:
|
|
2289
|
-
y:
|
|
2342
|
+
x: y,
|
|
2343
|
+
y: m
|
|
2290
2344
|
}
|
|
2291
2345
|
}
|
|
2292
2346
|
];
|
|
@@ -2326,8 +2380,10 @@ let p = class extends N {
|
|
|
2326
2380
|
unit: t.detail.unit,
|
|
2327
2381
|
width: Math.max(t.detail.width, 0)
|
|
2328
2382
|
};
|
|
2329
|
-
|
|
2330
|
-
|
|
2383
|
+
}
|
|
2384
|
+
onResizeApply(t) {
|
|
2385
|
+
const { height: e, unit: i, width: s } = t.detail;
|
|
2386
|
+
if (this.preResetTransformations = void 0, this.lastAction = c.Resize, !this.asset) {
|
|
2331
2387
|
(e || s) && this.upsertTransformation({
|
|
2332
2388
|
key: c.Resize,
|
|
2333
2389
|
value: {
|
|
@@ -2336,13 +2392,10 @@ let p = class extends N {
|
|
|
2336
2392
|
width: s
|
|
2337
2393
|
}
|
|
2338
2394
|
});
|
|
2395
|
+
return;
|
|
2339
2396
|
}
|
|
2340
|
-
}
|
|
2341
|
-
onResizeApply(t) {
|
|
2342
2397
|
if (!this.selectedFormat)
|
|
2343
2398
|
return;
|
|
2344
|
-
const { height: e, unit: i, width: s } = t.detail;
|
|
2345
|
-
this.preResetTransformations = void 0, this.lastAction = c.Resize;
|
|
2346
2399
|
const a = this.selectedFormat.width || this.defaultSize.width, r = this.selectedFormat.height || this.defaultSize.height;
|
|
2347
2400
|
let n = s, l = e;
|
|
2348
2401
|
this.resizeSize.unit !== i ? (n = a, l = r) : i === o.AspectRatio && (n = Math.round(s / e * r), l = r), this.transformations = [
|
|
@@ -2358,20 +2411,22 @@ let p = class extends N {
|
|
|
2358
2411
|
];
|
|
2359
2412
|
}
|
|
2360
2413
|
onRotationChange(t) {
|
|
2361
|
-
this.rotation = t.detail
|
|
2362
|
-
key: c.Rotate,
|
|
2363
|
-
value: {
|
|
2364
|
-
rotation: this.rotation
|
|
2365
|
-
}
|
|
2366
|
-
}) : this.transformations = this.transformations.filter(
|
|
2367
|
-
(e) => e.key !== c.Rotate
|
|
2368
|
-
));
|
|
2414
|
+
this.rotation = t.detail;
|
|
2369
2415
|
}
|
|
2370
2416
|
onRotationApply(t) {
|
|
2371
|
-
if (!this.selectedFormat)
|
|
2372
|
-
return;
|
|
2373
2417
|
const e = t.detail;
|
|
2374
|
-
this.preResetTransformations = void 0, this.lastAction = c.Rotate, this.
|
|
2418
|
+
if (this.preResetTransformations = void 0, this.lastAction = c.Rotate, !this.asset) {
|
|
2419
|
+
e ? this.upsertTransformation({
|
|
2420
|
+
key: c.Rotate,
|
|
2421
|
+
value: {
|
|
2422
|
+
rotation: e
|
|
2423
|
+
}
|
|
2424
|
+
}) : this.transformations = this.transformations.filter(
|
|
2425
|
+
(i) => i.key !== c.Rotate
|
|
2426
|
+
);
|
|
2427
|
+
return;
|
|
2428
|
+
}
|
|
2429
|
+
this.selectedFormat && (this.transformations = [
|
|
2375
2430
|
...this.transformations,
|
|
2376
2431
|
{
|
|
2377
2432
|
key: c.Rotate,
|
|
@@ -2379,7 +2434,7 @@ let p = class extends N {
|
|
|
2379
2434
|
rotation: e
|
|
2380
2435
|
}
|
|
2381
2436
|
}
|
|
2382
|
-
];
|
|
2437
|
+
]);
|
|
2383
2438
|
}
|
|
2384
2439
|
onQualityChange(t) {
|
|
2385
2440
|
const e = t.detail;
|
|
@@ -2447,33 +2502,33 @@ let p = class extends N {
|
|
|
2447
2502
|
this.selectedProxy = t ? this.defaultProxy : this.selectedProxy || this.proxies?.[0]?.id || "", this.transformations = [], this.frozenIndex = -1, this.syncQuality();
|
|
2448
2503
|
}
|
|
2449
2504
|
render() {
|
|
2450
|
-
return
|
|
2505
|
+
return b`<div class="asset-link-format" @cx-show=${this.onDetailsShow} @cx-hide=${this.onDetailsHide}>${E(
|
|
2451
2506
|
!this.hideHeader,
|
|
2452
|
-
() =>
|
|
2507
|
+
() => b`<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>${E(this.canReset, () => b`<cx-button class="asset-link-format__reset" variant="custom" ?disabled=${this.transformations.length === 0} @click=${this.handleReset}>${this.localize.term("reset")}</cx-button>`)}</cx-space></cx-space>`,
|
|
2453
2508
|
() => Ut
|
|
2454
2509
|
)}
|
|
2455
|
-
${
|
|
2510
|
+
${E(
|
|
2456
2511
|
!this.noFormat,
|
|
2457
|
-
() =>
|
|
2512
|
+
() => b`<cx-asset-link-format-proxy class="asset-link-format__details" value=${this.selectedProxy || this.proxies?.[0]?.id || ""} ?open=${this.activeSetting === "cx-asset-link-format-proxy"} .items=${this.formats} ?loading=${this.loading && this.lastAction === c.Proxy} @cx-asset-link-format-proxy-change=${this.onProxyChange}></cx-asset-link-format-proxy>`
|
|
2458
2513
|
)}
|
|
2459
|
-
${
|
|
2514
|
+
${E(
|
|
2460
2515
|
!this.noCrop,
|
|
2461
|
-
() =>
|
|
2516
|
+
() => b`<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 === c.Crop} ?keep-aspect-ratio=${this.cropSize.keepAspectRatio} focus-mode=${this.cropSize.focusMode} crop-mode=${this.cropSize.cropMode} width=${this.cropSize.width} height=${this.cropSize.height} max-width=${this.asset ? this.lastResizeSize[o.Pixel].width : 1 / 0} max-height=${this.asset ? this.lastResizeSize[o.Pixel].height : 1 / 0} percentage-width=${this.cropSize.percentageWidth} percentage-height=${this.cropSize.percentageHeight} ratio-width=${this.cropSize.ratioWidth} ratio-height=${this.cropSize.ratioHeight} unit=${this.cropSize.unit} .lastAppliedSetting=${this.lastCropSize} .cropModes=${this.cropModes} .focusModes=${this.focusModes} @cx-asset-link-format-crop-mode-change=${this.onCropModeChange} @cx-asset-link-format-crop-focus-mode-change=${this.onCropFocusModeChange} @cx-asset-link-format-crop-change=${this.onCropChange} @cx-asset-link-format-crop-changed=${this.onCropChanged} @cx-asset-link-format-crop-apply=${this.onCropApply}></cx-asset-link-format-crop>`
|
|
2462
2517
|
)}
|
|
2463
|
-
${
|
|
2518
|
+
${E(
|
|
2464
2519
|
!this.noResize,
|
|
2465
|
-
() =>
|
|
2520
|
+
() => b`<cx-asset-link-format-resize class="asset-link-format__details" ?open=${this.activeSetting === "cx-asset-link-format-resize"} ?loading=${this.loading && this.lastAction === c.Resize} ?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>`
|
|
2466
2521
|
)}
|
|
2467
|
-
${
|
|
2522
|
+
${E(
|
|
2468
2523
|
!this.noRotate,
|
|
2469
|
-
() =>
|
|
2470
|
-
)}<cx-asset-link-format-quality class="asset-link-format__details" ?
|
|
2524
|
+
() => b`<cx-asset-link-format-rotation class="asset-link-format__details" ?loading=${this.loading && this.lastAction === c.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>`
|
|
2525
|
+
)}<cx-asset-link-format-quality class="asset-link-format__details" ?loading=${this.loading && this.lastAction === c.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>${E(
|
|
2471
2526
|
!this.noMetadata,
|
|
2472
|
-
() =>
|
|
2527
|
+
() => b`<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>`
|
|
2473
2528
|
)}
|
|
2474
|
-
${
|
|
2529
|
+
${E(
|
|
2475
2530
|
this.useCustomExtension,
|
|
2476
|
-
() =>
|
|
2531
|
+
() => b`<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>`
|
|
2477
2532
|
)}</div>`;
|
|
2478
2533
|
}
|
|
2479
2534
|
};
|
|
@@ -2482,11 +2537,11 @@ p.dependencies = {
|
|
|
2482
2537
|
"cx-asset-link-format-crop": g,
|
|
2483
2538
|
"cx-asset-link-format-extension": V,
|
|
2484
2539
|
"cx-asset-link-format-metadata": W,
|
|
2485
|
-
"cx-asset-link-format-proxy":
|
|
2540
|
+
"cx-asset-link-format-proxy": _,
|
|
2486
2541
|
"cx-asset-link-format-quality": F,
|
|
2487
|
-
"cx-asset-link-format-resize":
|
|
2488
|
-
"cx-asset-link-format-rotation":
|
|
2489
|
-
"cx-button":
|
|
2542
|
+
"cx-asset-link-format-resize": w,
|
|
2543
|
+
"cx-asset-link-format-rotation": M,
|
|
2544
|
+
"cx-button": j,
|
|
2490
2545
|
"cx-space": D,
|
|
2491
2546
|
"cx-typography": T
|
|
2492
2547
|
};
|
|
@@ -2593,24 +2648,24 @@ d([
|
|
|
2593
2648
|
v()
|
|
2594
2649
|
], p.prototype, "preResetTransformations", 2);
|
|
2595
2650
|
d([
|
|
2596
|
-
|
|
2651
|
+
R("transformations")
|
|
2597
2652
|
], p.prototype, "handleTransformationsChange", 1);
|
|
2598
2653
|
d([
|
|
2599
|
-
|
|
2654
|
+
R("selectedProxy")
|
|
2600
2655
|
], p.prototype, "handleSelectedProxyChange", 1);
|
|
2601
2656
|
d([
|
|
2602
|
-
|
|
2657
|
+
R("loading")
|
|
2603
2658
|
], p.prototype, "handleLoadingChange", 1);
|
|
2604
2659
|
p = d([
|
|
2605
2660
|
q("cx-asset-link-format")
|
|
2606
2661
|
], p);
|
|
2607
2662
|
export {
|
|
2608
2663
|
p as C,
|
|
2609
|
-
|
|
2610
|
-
|
|
2664
|
+
ut as D,
|
|
2665
|
+
Pt as F,
|
|
2611
2666
|
X as O,
|
|
2612
2667
|
xi as a,
|
|
2613
|
-
|
|
2668
|
+
_t as b,
|
|
2614
2669
|
vt as c,
|
|
2615
2670
|
gi as d,
|
|
2616
2671
|
kt as e,
|
|
@@ -2619,9 +2674,9 @@ export {
|
|
|
2619
2674
|
Si as h,
|
|
2620
2675
|
yi as i,
|
|
2621
2676
|
Tt as j,
|
|
2622
|
-
|
|
2677
|
+
at as k,
|
|
2623
2678
|
Ct as l,
|
|
2624
|
-
|
|
2679
|
+
Rt as m,
|
|
2625
2680
|
Mt as n,
|
|
2626
2681
|
Xt as o,
|
|
2627
2682
|
Kt as u
|