@orangelogic/design-system 2.145.0 → 2.146.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.D6XVEha7.js → asset-link-format.CU3qvBEO.js} +120 -114
- package/library/chunks/{image.BzmclWBR.js → image.QVlPFadX.js} +1 -1
- package/library/chunks/{number.B4PQLJIg.js → number.CtCaI0T_.js} +23 -17
- package/library/chunks/{time.BSmpFe2G.js → time.DWfbnPnM.js} +1 -1
- package/library/components/asset-link-format.js +2 -2
- package/library/components/audio.js +1 -1
- package/library/components/cropper.js +2 -2
- package/library/components/file-on-demand.js +1 -1
- package/library/components/format-time.js +1 -1
- package/library/components/organisms.js +1 -1
- package/library/components/types.js +7895 -7835
- package/library/css/ol-base.css +6 -6
- package/library/package.json +1 -1
- package/library/packages/molecules/src/icon-picker/icon-picker.d.ts +4 -0
- package/library/packages/organisms/src/asset-link-format/components/asset-link-format-crop/asset-link-format-crop.d.ts +8 -0
- package/library/packages/organisms/src/dam-custom-toolbar-buttons-editor/dam-custom-toolbar-buttons-editor.d.ts +12 -0
- package/library/packages/services/src/api/cms5/cms5.d.ts +7 -0
- package/library/packages/types/src/dam-view.d.ts +23 -0
- package/library/react-web-component.d.ts +4 -0
- package/library/utils.js +3 -3
- package/package.json +1 -1
|
@@ -6,21 +6,21 @@ import { n as h, C as N } from "./lib-cortex-element.CVMmyPMC.js";
|
|
|
6
6
|
import { h as P, a as Et, C as It, S as Nt, b as Ot, c as Lt, d as Ut } from "./endpoints.Bn_YviaU.js";
|
|
7
7
|
import { M as At, U as o, T as c } from "./asset-link-format.QzzboHHE.js";
|
|
8
8
|
import "./browser.BHOCIF_A.js";
|
|
9
|
-
import { i as O, x as
|
|
9
|
+
import { i as O, x as S, E as qt } from "./lit-element.jLBm65_O.js";
|
|
10
10
|
import "./form.BSqXLytJ.js";
|
|
11
11
|
import { L } from "./i18n.DYXys45m.js";
|
|
12
|
-
import { a as
|
|
12
|
+
import { a as Bt } from "./string.BmBJ_BLT.js";
|
|
13
13
|
import "./date-picker.DTUICGb9.js";
|
|
14
14
|
import "./content-builder.DZRw6hpX.js";
|
|
15
15
|
import "./unsafe-html.Dff7-rCx.js";
|
|
16
|
-
import { b as
|
|
16
|
+
import { b as jt } from "./_baseUniq.CoXu-orP.js";
|
|
17
17
|
import { c as U } from "./component.styles.CRO4Odto.js";
|
|
18
18
|
import { c as q } from "./custom-element.L4WJXn1j.js";
|
|
19
19
|
import { w as R } from "./watch.K-dbDP6P.js";
|
|
20
|
-
import { s as zt, c as et } from "./number.
|
|
20
|
+
import { s as zt, c as et } from "./number.CtCaI0T_.js";
|
|
21
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 F } from "./when.Dr1es41R.js";
|
|
24
24
|
import Z from "../components/details.js";
|
|
25
25
|
import Vt from "../components/divider.js";
|
|
26
26
|
import { C as Y } from "./icon.CsF1BoUl.js";
|
|
@@ -28,7 +28,7 @@ import { C as mt } from "./icon-button.B0L-_zT9.js";
|
|
|
28
28
|
import { C as ft } from "./input.CSI9KLz7.js";
|
|
29
29
|
import { C as nt } from "./option.BweUpygr.js";
|
|
30
30
|
import ht from "../components/select.js";
|
|
31
|
-
import { c as Gt } from "./image.
|
|
31
|
+
import { c as Gt } from "./image.QVlPFadX.js";
|
|
32
32
|
import { e as J } from "./query.BBf1UFkC.js";
|
|
33
33
|
import { c as tt } from "./repeat.CFjcER6_.js";
|
|
34
34
|
import { o as I } from "./style-map.llVFPd__.js";
|
|
@@ -36,7 +36,7 @@ import Ht from "../components/tooltip.js";
|
|
|
36
36
|
import Qt from "../components/button-group.js";
|
|
37
37
|
import { C as Kt } from "./checkbox.aQnF4Zc3.js";
|
|
38
38
|
function Xt(t) {
|
|
39
|
-
return t && t.length ?
|
|
39
|
+
return t && t.length ? jt(t) : [];
|
|
40
40
|
}
|
|
41
41
|
function Zt(t) {
|
|
42
42
|
return typeof t == "object" && t !== null && "URI" in t;
|
|
@@ -166,7 +166,7 @@ async function Tt({
|
|
|
166
166
|
token: y,
|
|
167
167
|
useSession: m
|
|
168
168
|
}) {
|
|
169
|
-
const
|
|
169
|
+
const b = e?.map(oe);
|
|
170
170
|
try {
|
|
171
171
|
return (await P.request({
|
|
172
172
|
baseURL: l,
|
|
@@ -174,7 +174,7 @@ async function Tt({
|
|
|
174
174
|
method: "GET",
|
|
175
175
|
params: {
|
|
176
176
|
CountPerPage: t,
|
|
177
|
-
Fields: Xt(
|
|
177
|
+
Fields: Xt(b),
|
|
178
178
|
Format: "json",
|
|
179
179
|
GetPermanentAssetsPaths: i || void 0,
|
|
180
180
|
PageNumber: a,
|
|
@@ -219,7 +219,7 @@ async function re({
|
|
|
219
219
|
params: {
|
|
220
220
|
SourceAssetFormat: i,
|
|
221
221
|
SourceAssetRecordID: t,
|
|
222
|
-
TargetExtension:
|
|
222
|
+
TargetExtension: Bt(e),
|
|
223
223
|
Token: a || void 0,
|
|
224
224
|
Transformations: r,
|
|
225
225
|
UseSession: n || void 0
|
|
@@ -273,14 +273,14 @@ async function xi({
|
|
|
273
273
|
token: r
|
|
274
274
|
})
|
|
275
275
|
)
|
|
276
|
-
), m = new Map(s.map((u, $) => [u, $])),
|
|
276
|
+
), m = new Map(s.map((u, $) => [u, $])), b = y.flatMap((u) => u.items).map((u) => {
|
|
277
277
|
let $ = w(u, rt);
|
|
278
278
|
return $ === "" && ($ = w(u, ot)), {
|
|
279
279
|
name: $,
|
|
280
280
|
originalUrl: w(u, X),
|
|
281
281
|
recordId: w(u, at),
|
|
282
282
|
...n.reduce(
|
|
283
|
-
(Q,
|
|
283
|
+
(Q, A) => (Q[A] = w(u, A), Q),
|
|
284
284
|
{}
|
|
285
285
|
)
|
|
286
286
|
};
|
|
@@ -290,7 +290,7 @@ async function xi({
|
|
|
290
290
|
(u, $) => u + $.totalCount,
|
|
291
291
|
0
|
|
292
292
|
);
|
|
293
|
-
return { facets: [], items:
|
|
293
|
+
return { facets: [], items: b, totalCount: C };
|
|
294
294
|
}
|
|
295
295
|
function w(t, e) {
|
|
296
296
|
const i = t[e];
|
|
@@ -308,11 +308,11 @@ async function yi({
|
|
|
308
308
|
searchTerm: f,
|
|
309
309
|
securityByPassToken: y,
|
|
310
310
|
sortOrder: m,
|
|
311
|
-
token:
|
|
311
|
+
token: b
|
|
312
312
|
}) {
|
|
313
313
|
if (!e && !l)
|
|
314
314
|
return { facets: [], items: [], totalCount: 0 };
|
|
315
|
-
const C = (i?.filter((
|
|
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
318
|
...r.length > 0 ? { docType: [At.Image, At.Audio] } : {}
|
|
@@ -341,27 +341,27 @@ async function yi({
|
|
|
341
341
|
query: u,
|
|
342
342
|
securityByPassToken: y,
|
|
343
343
|
sort: void 0,
|
|
344
|
-
token:
|
|
345
|
-
}), Q = $.items.map((
|
|
346
|
-
let K = w(
|
|
347
|
-
K && !K.startsWith(".") && (K = "." + K), ct === "" && (ct = w(
|
|
348
|
-
const yt = w(
|
|
344
|
+
token: b
|
|
345
|
+
}), Q = $.items.map((A) => {
|
|
346
|
+
let K = w(A, kt), ct = w(A, rt), xt = w(A, ut);
|
|
347
|
+
K && !K.startsWith(".") && (K = "." + K), ct === "" && (ct = w(A, ot)), K.toLowerCase() === ".gif" && (xt = w(A, X));
|
|
348
|
+
const yt = w(A, at);
|
|
349
349
|
return {
|
|
350
|
-
docSubType: w(
|
|
351
|
-
docType: w(
|
|
350
|
+
docSubType: w(A, Mt),
|
|
351
|
+
docType: w(A, vt) || "",
|
|
352
352
|
extension: K,
|
|
353
|
-
height: w(
|
|
353
|
+
height: w(A, Pt) || "0",
|
|
354
354
|
id: yt,
|
|
355
|
-
identifier: w(
|
|
355
|
+
identifier: w(A, Rt),
|
|
356
356
|
imageUrl: xt,
|
|
357
357
|
name: ct,
|
|
358
|
-
originalUrl: w(
|
|
358
|
+
originalUrl: w(A, X),
|
|
359
359
|
recordId: yt,
|
|
360
|
-
size: w(
|
|
361
|
-
tags: w(
|
|
362
|
-
width: w(
|
|
360
|
+
size: w(A, Ct) || "0 MB",
|
|
361
|
+
tags: w(A, $t),
|
|
362
|
+
width: w(A, _t) || "0",
|
|
363
363
|
...C.reduce(
|
|
364
|
-
(St, bt) => (St[bt] = w(
|
|
364
|
+
(St, bt) => (St[bt] = w(A, bt), St),
|
|
365
365
|
{}
|
|
366
366
|
)
|
|
367
367
|
};
|
|
@@ -502,7 +502,7 @@ var de = Object.defineProperty, ue = Object.getOwnPropertyDescriptor, x = (t, e,
|
|
|
502
502
|
};
|
|
503
503
|
let g = class extends N {
|
|
504
504
|
constructor() {
|
|
505
|
-
super(...arguments), this.localize = new L(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 = {
|
|
505
|
+
super(...arguments), this.localize = new L(this), this.open = !1, this.width = 0, this.height = 0, this.maxWidth = 0, this.maxHeight = 0, this.ratioWidth = 1, this.ratioHeight = 1, this.percentageWidth = 0, this.percentageHeight = 0, this.unit = o.Pixel, this.disabledApply = !1, this.noRatioModes = !1, this.lastAppliedSetting = {
|
|
506
506
|
[o.Pixel]: {
|
|
507
507
|
height: 0,
|
|
508
508
|
percentageHeight: 100,
|
|
@@ -721,35 +721,38 @@ let g = class extends N {
|
|
|
721
721
|
}
|
|
722
722
|
render() {
|
|
723
723
|
const t = this.cropModes.filter((i) => !i.auto), e = this.cropModes.filter((i) => i.auto);
|
|
724
|
-
return
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
724
|
+
return S`<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">${F(
|
|
725
|
+
!this.noRatioModes,
|
|
726
|
+
() => S`<cx-select data-testid="cx-asset-link-format-crop-mode" value=${this.cropMode} hoist style=${I({
|
|
727
|
+
width: "100%"
|
|
728
|
+
})} @cx-change=${this.onCropModeChange} ?disabled=${this.loading}>${tt(
|
|
729
|
+
t,
|
|
730
|
+
(i) => i.value,
|
|
731
|
+
({ label: i, value: s }) => S`<cx-option value=${s}>${i}</cx-option>`
|
|
732
|
+
)}
|
|
733
|
+
${F(
|
|
734
|
+
e.length > 0,
|
|
735
|
+
() => S`<cx-divider></cx-divider><small>${this.localize.term("autoCropping")}</small>`
|
|
736
|
+
)}
|
|
737
|
+
${tt(
|
|
738
|
+
e,
|
|
739
|
+
(i) => i.value,
|
|
740
|
+
({ label: i, value: s }) => S`<cx-option value=${s}>${i}</cx-option>`
|
|
741
|
+
)}</cx-select>`
|
|
742
|
+
)}<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">
|
|
740
743
|
W
|
|
741
744
|
</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=${I({
|
|
742
745
|
color: this.keepAspectRatio ? "var(--cx-color-primary)" : void 0
|
|
743
746
|
})} ?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">
|
|
744
747
|
H
|
|
745
|
-
</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>${
|
|
748
|
+
</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>${F(
|
|
746
749
|
this.focusModes.length > 0,
|
|
747
|
-
() =>
|
|
750
|
+
() => S`<cx-select data-testid="cx-asset-link-format-crop-focus-mode" value=${this.focusMode} hoist style=${I({
|
|
748
751
|
width: "100%"
|
|
749
752
|
})} @cx-change=${this.onFocusModeChange} ?disabled=${this.loading || this.selectedMode?.disabledSize}>${tt(
|
|
750
753
|
this.focusModes,
|
|
751
754
|
(i) => i.value,
|
|
752
|
-
({ label: i, value: s }) =>
|
|
755
|
+
({ label: i, value: s }) => S`<cx-option value=${s}>${i}</cx-option>`
|
|
753
756
|
)}</cx-select>`
|
|
754
757
|
)}<cx-button data-testid="cx-asset-link-format-crop-apply" variant="primary" ?disabled=${this.disabledApply || this.invalidHeight || this.invalidWidth} ?loading=${this.loading} style=${I({
|
|
755
758
|
marginLeft: "auto"
|
|
@@ -805,6 +808,9 @@ x([
|
|
|
805
808
|
x([
|
|
806
809
|
h({ attribute: "disabled-apply", reflect: !0, type: Boolean })
|
|
807
810
|
], g.prototype, "disabledApply", 2);
|
|
811
|
+
x([
|
|
812
|
+
h({ attribute: "no-ratio-modes", reflect: !0, type: Boolean })
|
|
813
|
+
], g.prototype, "noRatioModes", 2);
|
|
808
814
|
x([
|
|
809
815
|
h({ attribute: "last-applied-setting", reflect: !1, type: Object })
|
|
810
816
|
], g.prototype, "lastAppliedSetting", 2);
|
|
@@ -853,7 +859,7 @@ var fe = Object.defineProperty, ge = Object.getOwnPropertyDescriptor, gt = (t, e
|
|
|
853
859
|
(n = t[r]) && (a = (s ? n(e, i, a) : n(a)) || a);
|
|
854
860
|
return s && a && fe(e, i, a), a;
|
|
855
861
|
};
|
|
856
|
-
let
|
|
862
|
+
let j = class extends N {
|
|
857
863
|
constructor() {
|
|
858
864
|
super(...arguments), this.localize = new L(this), this.value = "", this.items = [];
|
|
859
865
|
}
|
|
@@ -864,15 +870,15 @@ let B = class extends N {
|
|
|
864
870
|
});
|
|
865
871
|
}
|
|
866
872
|
render() {
|
|
867
|
-
return
|
|
873
|
+
return S`<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(
|
|
868
874
|
this.items,
|
|
869
875
|
(t) => t.value,
|
|
870
|
-
(t) =>
|
|
876
|
+
(t) => S`<cx-option value=${t.value}>${t.displayName}</cx-option>`
|
|
871
877
|
)}</cx-select></cx-space>`;
|
|
872
878
|
}
|
|
873
879
|
};
|
|
874
|
-
|
|
875
|
-
|
|
880
|
+
j.styles = [U, me];
|
|
881
|
+
j.dependencies = {
|
|
876
882
|
"cx-option": nt,
|
|
877
883
|
"cx-select": ht,
|
|
878
884
|
"cx-space": D,
|
|
@@ -880,13 +886,13 @@ B.dependencies = {
|
|
|
880
886
|
};
|
|
881
887
|
gt([
|
|
882
888
|
h({ reflect: !0, type: String })
|
|
883
|
-
],
|
|
889
|
+
], j.prototype, "value", 2);
|
|
884
890
|
gt([
|
|
885
891
|
h({ reflect: !1, type: Array })
|
|
886
|
-
],
|
|
887
|
-
|
|
892
|
+
], j.prototype, "items", 2);
|
|
893
|
+
j = gt([
|
|
888
894
|
q("cx-asset-link-format-extension")
|
|
889
|
-
],
|
|
895
|
+
], j);
|
|
890
896
|
const xe = O`cx-details::part(base){border-bottom-width:0}`;
|
|
891
897
|
var ye = Object.defineProperty, Se = Object.getOwnPropertyDescriptor, H = (t, e, i, s) => {
|
|
892
898
|
for (var a = s > 1 ? void 0 : s ? Se(e, i) : e, r = t.length - 1, n; r >= 0; r--)
|
|
@@ -939,10 +945,10 @@ let _ = class extends N {
|
|
|
939
945
|
t.target !== this.base && t.stopPropagation();
|
|
940
946
|
}
|
|
941
947
|
render() {
|
|
942
|
-
return
|
|
948
|
+
return S`<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(
|
|
943
949
|
this.items,
|
|
944
950
|
(t) => t.id,
|
|
945
|
-
(t) =>
|
|
951
|
+
(t) => S`<cx-option value=${t.id}>${t.proxyLabel}</cx-option>`
|
|
946
952
|
)}</cx-select><cx-button data-testid="cx-asset-link-format-proxy-apply" variant="primary" style=${I({
|
|
947
953
|
"margin-left": "auto"
|
|
948
954
|
})} ?disabled=${this.scopedValue === this.value} ?loading=${this.loading} @click=${this.handleApply}>${this.localize.term("apply")}</cx-button></cx-space></cx-details>`;
|
|
@@ -991,7 +997,7 @@ var Ae = Object.defineProperty, ze = Object.getOwnPropertyDescriptor, G = (t, e,
|
|
|
991
997
|
(n = t[r]) && (a = (s ? n(e, i, a) : n(a)) || a);
|
|
992
998
|
return s && a && Ae(e, i, a), a;
|
|
993
999
|
};
|
|
994
|
-
let
|
|
1000
|
+
let E = class extends N {
|
|
995
1001
|
constructor() {
|
|
996
1002
|
super(...arguments), this.localize = new L(this), this.open = !1, this.value = 100, this.loading = !1, this.scopedValue = 100;
|
|
997
1003
|
}
|
|
@@ -1037,13 +1043,13 @@ let F = class extends N {
|
|
|
1037
1043
|
t.target !== this.base && t.stopPropagation();
|
|
1038
1044
|
}
|
|
1039
1045
|
render() {
|
|
1040
|
-
return
|
|
1046
|
+
return S`<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=${I({
|
|
1041
1047
|
flex: "1"
|
|
1042
1048
|
})} @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>`;
|
|
1043
1049
|
}
|
|
1044
1050
|
};
|
|
1045
|
-
|
|
1046
|
-
|
|
1051
|
+
E.styles = [U, be];
|
|
1052
|
+
E.dependencies = {
|
|
1047
1053
|
"cx-button": V,
|
|
1048
1054
|
"cx-details": Z,
|
|
1049
1055
|
"cx-icon": Y,
|
|
@@ -1054,25 +1060,25 @@ F.dependencies = {
|
|
|
1054
1060
|
};
|
|
1055
1061
|
G([
|
|
1056
1062
|
J(".details")
|
|
1057
|
-
],
|
|
1063
|
+
], E.prototype, "base", 2);
|
|
1058
1064
|
G([
|
|
1059
1065
|
h({ reflect: !0, type: Boolean })
|
|
1060
|
-
],
|
|
1066
|
+
], E.prototype, "open", 2);
|
|
1061
1067
|
G([
|
|
1062
1068
|
h({ reflect: !0, type: Number })
|
|
1063
|
-
],
|
|
1069
|
+
], E.prototype, "value", 2);
|
|
1064
1070
|
G([
|
|
1065
1071
|
h({ reflect: !0, type: Boolean })
|
|
1066
|
-
],
|
|
1072
|
+
], E.prototype, "loading", 2);
|
|
1067
1073
|
G([
|
|
1068
1074
|
v()
|
|
1069
|
-
],
|
|
1075
|
+
], E.prototype, "scopedValue", 2);
|
|
1070
1076
|
G([
|
|
1071
1077
|
R("value")
|
|
1072
|
-
],
|
|
1073
|
-
|
|
1078
|
+
], E.prototype, "handleValueChange", 1);
|
|
1079
|
+
E = G([
|
|
1074
1080
|
q("cx-asset-link-format-quality")
|
|
1075
|
-
],
|
|
1081
|
+
], E);
|
|
1076
1082
|
const we = O`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}`;
|
|
1077
1083
|
var ve = Object.defineProperty, ke = Object.getOwnPropertyDescriptor, k = (t, e, i, s) => {
|
|
1078
1084
|
for (var a = s > 1 ? void 0 : s ? ke(e, i) : e, r = t.length - 1, n; r >= 0; r--)
|
|
@@ -1215,7 +1221,7 @@ let z = class extends N {
|
|
|
1215
1221
|
});
|
|
1216
1222
|
}
|
|
1217
1223
|
render() {
|
|
1218
|
-
return
|
|
1224
|
+
return S`<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">
|
|
1219
1225
|
W
|
|
1220
1226
|
</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=${I({
|
|
1221
1227
|
color: this.keepAspectRatio ? "var(--cx-color-primary)" : void 0
|
|
@@ -1296,7 +1302,7 @@ z = k([
|
|
|
1296
1302
|
q("cx-asset-link-format-resize")
|
|
1297
1303
|
], z);
|
|
1298
1304
|
const Ce = O`cx-details::part(base){border-bottom-width:0}`;
|
|
1299
|
-
var Re = Object.defineProperty, $e = Object.getOwnPropertyDescriptor,
|
|
1305
|
+
var Re = Object.defineProperty, $e = Object.getOwnPropertyDescriptor, B = (t, e, i, s) => {
|
|
1300
1306
|
for (var a = s > 1 ? void 0 : s ? $e(e, i) : e, r = t.length - 1, n; r >= 0; r--)
|
|
1301
1307
|
(n = t[r]) && (a = (s ? n(e, i, a) : n(a)) || a);
|
|
1302
1308
|
return s && a && Re(e, i, a), a;
|
|
@@ -1338,7 +1344,7 @@ let M = class extends N {
|
|
|
1338
1344
|
});
|
|
1339
1345
|
}
|
|
1340
1346
|
render() {
|
|
1341
|
-
return
|
|
1347
|
+
return S`<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=${I({
|
|
1342
1348
|
flex: "none",
|
|
1343
1349
|
width: "80px"
|
|
1344
1350
|
})} @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>`;
|
|
@@ -1354,28 +1360,28 @@ M.dependencies = {
|
|
|
1354
1360
|
"cx-space": D,
|
|
1355
1361
|
"cx-typography": T
|
|
1356
1362
|
};
|
|
1357
|
-
|
|
1363
|
+
B([
|
|
1358
1364
|
J(".details")
|
|
1359
1365
|
], M.prototype, "base", 2);
|
|
1360
|
-
|
|
1366
|
+
B([
|
|
1361
1367
|
h({ reflect: !0, type: Boolean })
|
|
1362
1368
|
], M.prototype, "open", 2);
|
|
1363
|
-
|
|
1369
|
+
B([
|
|
1364
1370
|
h({ reflect: !0, type: Number })
|
|
1365
1371
|
], M.prototype, "value", 2);
|
|
1366
|
-
|
|
1372
|
+
B([
|
|
1367
1373
|
h({ attribute: "default-value", reflect: !0, type: Number })
|
|
1368
1374
|
], M.prototype, "defaultValue", 2);
|
|
1369
|
-
|
|
1375
|
+
B([
|
|
1370
1376
|
h({ reflect: !0, type: Boolean })
|
|
1371
1377
|
], M.prototype, "loading", 2);
|
|
1372
|
-
|
|
1378
|
+
B([
|
|
1373
1379
|
h({ attribute: "last-applied-value", reflect: !0, type: Number })
|
|
1374
1380
|
], M.prototype, "lastAppliedValue", 2);
|
|
1375
|
-
|
|
1381
|
+
B([
|
|
1376
1382
|
R("open", { waitUntilFirstUpdate: !0 })
|
|
1377
1383
|
], M.prototype, "handleOpenChange", 1);
|
|
1378
|
-
M =
|
|
1384
|
+
M = B([
|
|
1379
1385
|
q("cx-asset-link-format-rotation")
|
|
1380
1386
|
], M);
|
|
1381
1387
|
const Pe = O`cx-details::part(base){border-bottom-width:0}`;
|
|
@@ -1410,7 +1416,7 @@ let W = class extends N {
|
|
|
1410
1416
|
t.target !== this.base && t.stopPropagation();
|
|
1411
1417
|
}
|
|
1412
1418
|
render() {
|
|
1413
|
-
return
|
|
1419
|
+
return S`<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>`;
|
|
1414
1420
|
}
|
|
1415
1421
|
};
|
|
1416
1422
|
W.styles = [U, Pe];
|
|
@@ -1825,12 +1831,12 @@ let p = class extends N {
|
|
|
1825
1831
|
(m) => m.key === c.Crop && m.value.width && m.value.height
|
|
1826
1832
|
);
|
|
1827
1833
|
if (r) {
|
|
1828
|
-
const { focusMode: m, height:
|
|
1834
|
+
const { focusMode: m, height: b, unit: C, width: u, x: $ = 0, y: Q = 0 } = r.value;
|
|
1829
1835
|
this.cropSize = {
|
|
1830
1836
|
...this.cropSize,
|
|
1831
1837
|
cropMode: "free",
|
|
1832
1838
|
focusMode: m ?? "manual",
|
|
1833
|
-
height:
|
|
1839
|
+
height: b,
|
|
1834
1840
|
percentageHeight: 100,
|
|
1835
1841
|
percentageWidth: 100,
|
|
1836
1842
|
unit: C ?? o.Pixel,
|
|
@@ -1855,11 +1861,11 @@ let p = class extends N {
|
|
|
1855
1861
|
(m) => m.key === c.Resize && (m.value.width || m.value.height)
|
|
1856
1862
|
);
|
|
1857
1863
|
if (n) {
|
|
1858
|
-
const { height: m = 0, unit:
|
|
1864
|
+
const { height: m = 0, unit: b, width: C = 0 } = n.value;
|
|
1859
1865
|
this.resizeSize = {
|
|
1860
1866
|
...this.resizeSize,
|
|
1861
1867
|
height: m,
|
|
1862
|
-
unit:
|
|
1868
|
+
unit: b ?? o.Pixel,
|
|
1863
1869
|
width: C
|
|
1864
1870
|
};
|
|
1865
1871
|
} else
|
|
@@ -2119,22 +2125,22 @@ let p = class extends N {
|
|
|
2119
2125
|
if (!this.selectedFormat?.url || e === "manual")
|
|
2120
2126
|
return;
|
|
2121
2127
|
this.loading = !0, this.lastAction = c.Crop;
|
|
2122
|
-
const
|
|
2128
|
+
const b = await this.apiGetCropFocusMode({
|
|
2123
2129
|
autoCropMode: e,
|
|
2124
2130
|
cropHeight: i,
|
|
2125
2131
|
cropWidth: m,
|
|
2126
2132
|
imageUrl: this.selectedFormat.url
|
|
2127
2133
|
});
|
|
2128
|
-
if (
|
|
2134
|
+
if (b) {
|
|
2129
2135
|
let C = a, u = r;
|
|
2130
|
-
i || (C =
|
|
2136
|
+
i || (C = b.height * 100 / this.selectedFormat.height), m || (u = b.width * 100 / this.selectedFormat.width), this.cropSize = {
|
|
2131
2137
|
...this.cropSize,
|
|
2132
|
-
height:
|
|
2138
|
+
height: b.height,
|
|
2133
2139
|
percentageHeight: C ?? this.cropSize.percentageHeight,
|
|
2134
2140
|
percentageWidth: u ?? this.cropSize.percentageWidth,
|
|
2135
|
-
width:
|
|
2136
|
-
x:
|
|
2137
|
-
y:
|
|
2141
|
+
width: b.width,
|
|
2142
|
+
x: b.x * 100 / this.selectedFormat.width,
|
|
2143
|
+
y: b.y * 100 / this.selectedFormat.height,
|
|
2138
2144
|
...y ? {
|
|
2139
2145
|
cropMode: e,
|
|
2140
2146
|
focusMode: "manual",
|
|
@@ -2259,7 +2265,7 @@ let p = class extends N {
|
|
|
2259
2265
|
l + n > 100 && (l = 100 - n), f + r > 100 && (f = 100 - r);
|
|
2260
2266
|
let y = this.cropSize.cropMode;
|
|
2261
2267
|
this.cropModes.find(
|
|
2262
|
-
(
|
|
2268
|
+
(b) => b.value === y
|
|
2263
2269
|
)?.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 = {
|
|
2264
2270
|
...this.cropSize,
|
|
2265
2271
|
cropMode: y,
|
|
@@ -2311,7 +2317,7 @@ let p = class extends N {
|
|
|
2311
2317
|
}
|
|
2312
2318
|
onCropApply(t) {
|
|
2313
2319
|
if (this.preResetTransformations = void 0, this.lastAction = c.Crop, !this.asset) {
|
|
2314
|
-
const { focusMode: l, height: f, unit: y, width: m, x:
|
|
2320
|
+
const { focusMode: l, height: f, unit: y, width: m, x: b, y: C } = this.cropSize, u = this.focusModes.find(
|
|
2315
2321
|
($) => $.value === l
|
|
2316
2322
|
)?.auto ?? !1;
|
|
2317
2323
|
(f || m) && this.upsertTransformation({
|
|
@@ -2322,7 +2328,7 @@ let p = class extends N {
|
|
|
2322
2328
|
isFocusModeAuto: u,
|
|
2323
2329
|
unit: y,
|
|
2324
2330
|
width: m,
|
|
2325
|
-
x: Number.isFinite(
|
|
2331
|
+
x: Number.isFinite(b) ? b : void 0,
|
|
2326
2332
|
y: Number.isFinite(C) ? C : void 0
|
|
2327
2333
|
}
|
|
2328
2334
|
});
|
|
@@ -2525,43 +2531,43 @@ let p = class extends N {
|
|
|
2525
2531
|
this.selectedProxy = t ? this.defaultProxy : this.selectedProxy || this.proxies?.[0]?.id || "", this.transformations = [], this.frozenIndex = -1, this.syncQuality();
|
|
2526
2532
|
}
|
|
2527
2533
|
render() {
|
|
2528
|
-
return
|
|
2534
|
+
return S`<div class="asset-link-format" @cx-show=${this.onDetailsShow} @cx-hide=${this.onDetailsHide}>${F(
|
|
2529
2535
|
!this.hideHeader,
|
|
2530
|
-
() =>
|
|
2536
|
+
() => S`<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>${F(this.canReset, () => S`<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>`,
|
|
2531
2537
|
() => qt
|
|
2532
2538
|
)}
|
|
2533
|
-
${
|
|
2539
|
+
${F(
|
|
2534
2540
|
!this.noFormat,
|
|
2535
|
-
() =>
|
|
2541
|
+
() => S`<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>`
|
|
2536
2542
|
)}
|
|
2537
|
-
${
|
|
2543
|
+
${F(
|
|
2538
2544
|
!this.noCrop,
|
|
2539
|
-
() =>
|
|
2545
|
+
() => S`<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} ?no-ratio-modes=${!this.asset} ?keep-aspect-ratio=${this.cropSize.keepAspectRatio} focus-mode=${this.cropSize.focusMode} crop-mode=${this.cropSize.cropMode} width=${this.cropSize.width} height=${this.cropSize.height} max-width=${this.asset ? this.lastResizeSize[o.Pixel].width : 1 / 0} max-height=${this.asset ? this.lastResizeSize[o.Pixel].height : 1 / 0} percentage-width=${this.cropSize.percentageWidth} percentage-height=${this.cropSize.percentageHeight} ratio-width=${this.cropSize.ratioWidth} ratio-height=${this.cropSize.ratioHeight} unit=${this.cropSize.unit} .lastAppliedSetting=${this.lastCropSize} .cropModes=${this.cropModes} .focusModes=${this.focusModes} @cx-asset-link-format-crop-mode-change=${this.onCropModeChange} @cx-asset-link-format-crop-focus-mode-change=${this.onCropFocusModeChange} @cx-asset-link-format-crop-change=${this.onCropChange} @cx-asset-link-format-crop-changed=${this.onCropChanged} @cx-asset-link-format-crop-apply=${this.onCropApply}></cx-asset-link-format-crop>`
|
|
2540
2546
|
)}
|
|
2541
|
-
${
|
|
2547
|
+
${F(
|
|
2542
2548
|
!this.noResize,
|
|
2543
|
-
() =>
|
|
2549
|
+
() => S`<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>`
|
|
2544
2550
|
)}
|
|
2545
|
-
${
|
|
2551
|
+
${F(
|
|
2546
2552
|
!this.noRotate,
|
|
2547
|
-
() =>
|
|
2548
|
-
)}<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>${
|
|
2553
|
+
() => S`<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>`
|
|
2554
|
+
)}<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>${F(
|
|
2549
2555
|
!this.noMetadata,
|
|
2550
|
-
() =>
|
|
2556
|
+
() => S`<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>`
|
|
2551
2557
|
)}
|
|
2552
|
-
${
|
|
2558
|
+
${F(
|
|
2553
2559
|
this.useCustomExtension,
|
|
2554
|
-
() =>
|
|
2560
|
+
() => S`<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>`
|
|
2555
2561
|
)}</div>`;
|
|
2556
2562
|
}
|
|
2557
2563
|
};
|
|
2558
2564
|
p.styles = [U, ce];
|
|
2559
2565
|
p.dependencies = {
|
|
2560
2566
|
"cx-asset-link-format-crop": g,
|
|
2561
|
-
"cx-asset-link-format-extension":
|
|
2567
|
+
"cx-asset-link-format-extension": j,
|
|
2562
2568
|
"cx-asset-link-format-metadata": W,
|
|
2563
2569
|
"cx-asset-link-format-proxy": _,
|
|
2564
|
-
"cx-asset-link-format-quality":
|
|
2570
|
+
"cx-asset-link-format-quality": E,
|
|
2565
2571
|
"cx-asset-link-format-resize": z,
|
|
2566
2572
|
"cx-asset-link-format-rotation": M,
|
|
2567
2573
|
"cx-button": V,
|