@orangelogic/design-system 2.96.0 → 2.97.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.B3vySOI-.js +431 -0
- package/library/chunks/{asset.types.6DCzTOQm.js → asset.types.KXRZEtBr.js} +127 -126
- package/library/chunks/{button.BZjbVq8t.js → button.CAa1kvwe.js} +2 -2
- package/library/chunks/{color-swatch-group.CKHEL4hJ.js → color-swatch-group.ChcPlkPU.js} +5 -5
- package/library/chunks/{color-swatch.CbL_TpRZ.js → color-swatch.DJ1kUnBQ.js} +1 -1
- package/library/chunks/{confirm-popover.bBo9aPlX.js → confirm-popover.D4x0nO5g.js} +3 -3
- package/library/chunks/content-builder.CcgZciZN.js +58 -0
- package/library/chunks/{cropper.uKGcvnPk.js → cropper.Bib8Abm3.js} +4937 -4932
- package/library/chunks/{dialog.DRW8iwh-.js → dialog.BLaxLMSc.js} +2 -2
- package/library/chunks/{dom.DURaLV1d.js → dom.0RpWet6y.js} +1 -1
- package/library/chunks/{dot-pagination.CvUr6R4S.js → dot-pagination.-nDdQxJN.js} +1 -1
- package/library/chunks/{file-on-demand.KQlA1JFF.js → file-on-demand.AzwoUvwB.js} +10 -10
- package/library/chunks/{folder-select.DxBOSyvo.js → folder-select.XpkOFzAW.js} +5 -5
- package/library/chunks/{form.nRqYei4e.js → form.Ch1cwYzO.js} +1 -1
- package/library/chunks/{header.ClxEkQPZ.js → header.BZxyeLPK.js} +1 -1
- package/library/chunks/{i18n.W6czbRms.js → i18n.BABe9hN4.js} +6 -0
- package/library/chunks/{icon-button.MqA-pNw8.js → icon-button.C2s3pHG4.js} +1 -1
- package/library/chunks/{iframe.PcSPtm_O.js → iframe.DPccxsnE.js} +1 -1
- package/library/chunks/{image.Dtdklw5q.js → image.9qwbjGNb.js} +1 -1
- package/library/chunks/{image.C-Covc0H.js → image.Cc4V85ID.js} +354 -311
- package/library/chunks/{list-editor.De7nc_Wd.js → list-editor.pVYc_70c.js} +183 -153
- package/library/chunks/{number.CCF6IxpN.js → number.B4PQLJIg.js} +32 -32
- package/library/chunks/{option.Cx54zrJq.js → option.DGXQzdtb.js} +1 -1
- package/library/chunks/{pagination.CG5odPWi.js → pagination.DZqKSA86.js} +4 -4
- package/library/chunks/{responsive.D9TUCX5p.js → responsive.Oz9HWjyQ.js} +1 -1
- package/library/chunks/{string.DfV21HEI.js → string.DUgD4c9f.js} +41 -34
- package/library/chunks/{tab-group.BLZ-qEpp.js → tab-group.BhCf9Smq.js} +4 -4
- package/library/chunks/{table.Cr0s-nqe.js → table.V5PGGTfO.js} +11 -10
- package/library/chunks/{time.BNrE47-8.js → time.BiQnh9wt.js} +1 -1
- package/library/chunks/toast.D3AW3RWv.js +94 -0
- package/library/chunks/transformation.Cqz3hPaQ.js +144 -0
- package/library/chunks/{tree.CKi63r95.js → tree.DZa7k-4E.js} +1 -1
- package/library/components/alert.js +2 -2
- package/library/components/asset-link-format.js +767 -862
- package/library/components/atoms.js +12 -12
- package/library/components/border-input-group.js +1 -1
- package/library/components/breadcrumb.js +1 -1
- package/library/components/button.js +3 -3
- package/library/components/checkbox.js +1 -1
- package/library/components/color-picker.js +3 -3
- package/library/components/color-swatch-group.js +6 -6
- package/library/components/color-swatch.js +2 -2
- package/library/components/confirm-popover.js +4 -4
- package/library/components/copy-button.js +1 -1
- package/library/components/corner-position-input-group.js +2 -2
- package/library/components/cropper.js +1 -1
- package/library/components/details.js +4 -4
- package/library/components/dialog.js +3 -3
- package/library/components/dot-pagination.js +2 -2
- package/library/components/drawer.js +2 -2
- package/library/components/dropdown.js +1 -1
- package/library/components/dynamic-select.js +4 -4
- package/library/components/e-chart.js +1 -1
- package/library/components/element-clamp.js +2 -2
- package/library/components/file-on-demand.js +11 -11
- package/library/components/folder-select.js +4 -4
- package/library/components/format-bytes.js +1 -1
- package/library/components/format-date.js +1 -1
- package/library/components/format-number.js +1 -1
- package/library/components/format-time.js +2 -2
- package/library/components/header.js +2 -2
- package/library/components/icon-button.js +2 -2
- package/library/components/iframe.js +2 -2
- package/library/components/image-comparer.js +1 -1
- package/library/components/image.js +2 -2
- package/library/components/input.js +4 -7
- package/library/components/line-clamp.js +1 -1
- package/library/components/list-editor.js +6 -6
- package/library/components/masonry.js +2 -2
- package/library/components/menu-item.js +1 -1
- package/library/components/menu.js +1 -1
- package/library/components/molecules.js +5 -5
- package/library/components/option.js +2 -2
- package/library/components/organisms.js +2 -2
- package/library/components/pagination.js +5 -5
- package/library/components/popup.js +1 -1
- package/library/components/position-picker.js +1 -1
- package/library/components/progress-bar.js +1 -1
- package/library/components/progress-ring.js +1 -1
- package/library/components/radio-group.js +1 -1
- package/library/components/range.js +2 -2
- package/library/components/rating.js +1 -1
- package/library/components/relative-time.js +1 -1
- package/library/components/select.js +3 -3
- package/library/components/share-option-list.js +2 -2
- package/library/components/sidebar.js +1 -1
- package/library/components/size-input-group.js +2 -2
- package/library/components/spinner.js +1 -1
- package/library/components/split-panel.js +1 -1
- package/library/components/switch.js +1 -1
- package/library/components/tab-group.js +5 -5
- package/library/components/tab.js +2 -2
- package/library/components/table.js +5 -5
- package/library/components/tag.js +2 -2
- package/library/components/textarea.js +1 -1
- package/library/components/timecode.js +1 -1
- package/library/components/tooltip.js +1 -1
- package/library/components/tree-item.js +2 -2
- package/library/components/tree.js +2 -2
- package/library/components/typeface.js +2 -2
- package/library/components/types.js +31066 -29848
- package/library/components/video.js +554 -545
- package/library/package.json +1 -1
- package/library/packages/atoms/src/components/image/image.d.ts +15 -1
- package/library/packages/atoms/src/components/input/input.d.ts +1 -2
- package/library/packages/atoms/src/components/video/video.d.ts +3 -1
- package/library/packages/events/src/cx-asset-format-picker-delete.d.ts +6 -0
- package/library/packages/events/src/cx-asset-format-picker-select.d.ts +8 -0
- package/library/packages/events/src/cx-asset-transformation-dialog-cancel.d.ts +6 -0
- package/library/packages/events/src/cx-asset-transformation-dialog-confirm.d.ts +11 -0
- package/library/packages/events/src/cx-asset-transformation-dialog-delete.d.ts +6 -0
- package/library/packages/events/src/cx-bento-range-change.d.ts +9 -0
- package/library/packages/events/src/cx-content-builder-gallery-fetched.d.ts +10 -0
- package/library/packages/events/src/cx-lightbox-close.d.ts +6 -0
- package/library/packages/events/src/cx-lightbox-download.d.ts +11 -0
- package/library/packages/events/src/cx-timeline-data-resolved.d.ts +10 -0
- package/library/packages/events/src/cx-video-thumbnail-resolved.d.ts +8 -0
- package/library/packages/events/src/events.d.ts +12 -1
- package/library/packages/molecules/src/asset-data-display/asset-data-display.d.ts +1 -0
- package/library/packages/molecules/src/asset-format-picker/asset-format-picker.d.ts +56 -0
- package/library/packages/molecules/src/asset-format-picker/asset-format-picker.styles.d.ts +2 -0
- package/library/packages/molecules/src/asset-picker/asset-picker.d.ts +7 -0
- package/library/packages/molecules/src/cropper/cropper.d.ts +1 -0
- package/library/packages/molecules/src/cropper/react/Cropper.d.ts +1 -0
- package/library/packages/molecules/src/download-format-picker/download-format-picker.d.ts +5 -1
- package/library/packages/molecules/src/index.d.ts +1 -0
- package/library/packages/molecules/src/timeline/timeline.d.ts +18 -0
- package/library/packages/organisms/src/asset-link-format/asset-link-format.d.ts +12 -0
- package/library/packages/organisms/src/asset-link-format/components/asset-link-format-rotation/asset-link-format-rotation.d.ts +7 -7
- package/library/packages/organisms/src/asset-transformation-dialog/asset-transformation-dialog.d.ts +102 -0
- package/library/packages/organisms/src/asset-transformation-dialog/asset-transformation-dialog.styles.d.ts +2 -0
- package/library/packages/organisms/src/bento-grid/bento-grid.d.ts +57 -26
- package/library/packages/organisms/src/bento-grid/bento-layout.d.ts +44 -0
- package/library/packages/organisms/src/carousel/carousel.d.ts +3 -1
- package/library/packages/organisms/src/content-builder/components/block-picker/block-picker.d.ts +7 -0
- package/library/packages/organisms/src/content-builder/components/config-form/config-form-controller.d.ts +4 -0
- package/library/packages/organisms/src/content-builder/components/config-form/config-form.d.ts +11 -0
- package/library/packages/organisms/src/content-builder/components/config-manager/config-manager.d.ts +10 -0
- package/library/packages/organisms/src/content-builder/components/gallery-picker/gallery-picker.d.ts +6 -0
- package/library/packages/organisms/src/content-builder/configs/carousel.d.ts +6 -2
- package/library/packages/organisms/src/content-builder/configs/gallery.d.ts +6 -2
- package/library/packages/organisms/src/content-builder/configs/image.d.ts +7 -4
- package/library/packages/organisms/src/content-builder/configs/timeline.d.ts +5 -2
- package/library/packages/organisms/src/content-builder/configs/video.d.ts +11 -2
- package/library/packages/organisms/src/content-builder/configs-controller.d.ts +45 -4
- package/library/packages/organisms/src/content-builder/content-builder-constants.d.ts +2 -2
- package/library/packages/organisms/src/content-builder/content-builder.d.ts +13 -0
- package/library/packages/organisms/src/content-builder/plugins/gallery.d.ts +45 -1
- package/library/packages/organisms/src/content-builder/styleController.d.ts +26 -1
- package/library/packages/organisms/src/index.d.ts +2 -0
- package/library/packages/organisms/src/lightbox/lightbox.d.ts +79 -0
- package/library/packages/organisms/src/lightbox/lightbox.styles.d.ts +2 -0
- package/library/packages/services/src/api/asset/asset.d.ts +2 -2
- package/library/packages/services/src/api/asset/asset.types.d.ts +4 -0
- package/library/packages/tools/src/fetch-asset/fetch-asset.d.ts +2 -1
- package/library/packages/tools/src/fetch-image/fetch-image.d.ts +19 -5
- package/library/packages/types/src/asset-click-action.d.ts +3 -1
- package/library/packages/types/src/asset-format-picker.d.ts +11 -0
- package/library/packages/types/src/bento-grid.d.ts +37 -0
- package/library/packages/types/src/content-builder.d.ts +37 -1
- package/library/packages/types/src/gallery.d.ts +0 -6
- package/library/packages/utils/src/actions/asset-click.d.ts +1 -3
- package/library/packages/utils/src/custom-element/i18n.d.ts +6 -0
- package/library/packages/utils/src/index.d.ts +1 -0
- package/library/packages/utils/src/string/string.d.ts +1 -0
- package/library/packages/utils/src/transformation/index.d.ts +1 -0
- package/library/react-web-component.d.ts +236 -8
- package/library/utils.js +517 -192
- package/package.json +1 -1
- package/library/chunks/asset.Duzr3O3z.js +0 -370
- package/library/chunks/index.BgXEXk4m.js +0 -398
- package/library/chunks/toast.Bc4wpYJ1.js +0 -150
- /package/library/packages/{organisms/src/asset-link-format/asset-link-format.utils.d.ts → utils/src/transformation/transformation.d.ts} +0 -0
|
@@ -1,194 +1,56 @@
|
|
|
1
|
-
import "../chunks/cropper.
|
|
2
|
-
import { C as
|
|
3
|
-
import
|
|
4
|
-
import { C as
|
|
5
|
-
import { n as
|
|
6
|
-
import { b as
|
|
7
|
-
import { c as
|
|
8
|
-
import {
|
|
9
|
-
import { c as
|
|
10
|
-
import { L as
|
|
11
|
-
import { w as
|
|
12
|
-
import { s as
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
import
|
|
19
|
-
import
|
|
20
|
-
import
|
|
21
|
-
import
|
|
22
|
-
import
|
|
23
|
-
import
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import
|
|
28
|
-
import
|
|
29
|
-
import
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
transformations: a,
|
|
37
|
-
useSession: h = ""
|
|
38
|
-
}) {
|
|
39
|
-
let r = e;
|
|
40
|
-
const y = a?.findLast(
|
|
41
|
-
(x) => x.key === c.Quality
|
|
42
|
-
);
|
|
43
|
-
if (y && (a = [
|
|
44
|
-
...a?.filter(
|
|
45
|
-
(x) => x.key !== c.Quality
|
|
46
|
-
) || [],
|
|
47
|
-
y
|
|
48
|
-
]), a) {
|
|
49
|
-
const x = [];
|
|
50
|
-
for (let g = 0; g < a.length; g++) {
|
|
51
|
-
const m = a[g];
|
|
52
|
-
if (m.key === c.Rotate) {
|
|
53
|
-
let n = m.value.rotation ?? 0;
|
|
54
|
-
for (; a[g + 1]?.key === c.Rotate; )
|
|
55
|
-
g++, n += a[g].value.rotation ?? 0;
|
|
56
|
-
n !== 0 && x.push({ key: c.Rotate, value: { rotation: n } });
|
|
57
|
-
} else
|
|
58
|
-
x.push(m);
|
|
59
|
-
}
|
|
60
|
-
a = x;
|
|
61
|
-
}
|
|
62
|
-
a && a.length > 0 && (r += "/t/"), a?.forEach(({ key: x, value: g }) => {
|
|
63
|
-
if (x === c.Resize) {
|
|
64
|
-
const m = [
|
|
65
|
-
...[
|
|
66
|
-
{
|
|
67
|
-
key: "re_w_",
|
|
68
|
-
value: Math.round(g.width ?? 0)
|
|
69
|
-
},
|
|
70
|
-
{
|
|
71
|
-
key: "re_h_",
|
|
72
|
-
value: Math.round(g.height ?? 0)
|
|
73
|
-
}
|
|
74
|
-
].filter((n) => n.value !== void 0).map((n) => ({
|
|
75
|
-
key: n.key,
|
|
76
|
-
value: Math.round(Number(n.value))
|
|
77
|
-
})),
|
|
78
|
-
{
|
|
79
|
-
key: "re_rm_",
|
|
80
|
-
value: "stretch"
|
|
81
|
-
}
|
|
82
|
-
];
|
|
83
|
-
m.forEach(({ key: n, value: $ }, B) => {
|
|
84
|
-
r += `${n}${$}${B < m.length - 1 ? "," : ""}`;
|
|
85
|
-
}), r += "/";
|
|
86
|
-
}
|
|
87
|
-
if (x === c.Crop) {
|
|
88
|
-
const m = [
|
|
89
|
-
...[
|
|
90
|
-
{
|
|
91
|
-
key: "c_",
|
|
92
|
-
value: g.mode
|
|
93
|
-
},
|
|
94
|
-
...g.disabledSize ? [] : [
|
|
95
|
-
{
|
|
96
|
-
key: "c_w_",
|
|
97
|
-
value: Math.round(g.width ?? 0)
|
|
98
|
-
},
|
|
99
|
-
{
|
|
100
|
-
key: "c_h_",
|
|
101
|
-
value: Math.round(g.height ?? 0)
|
|
102
|
-
},
|
|
103
|
-
{
|
|
104
|
-
key: "c_x_",
|
|
105
|
-
value: Math.round(g.x ?? 0)
|
|
106
|
-
},
|
|
107
|
-
{
|
|
108
|
-
key: "c_y_",
|
|
109
|
-
value: Math.round(g.y ?? 0)
|
|
110
|
-
}
|
|
111
|
-
]
|
|
112
|
-
].filter((n) => n.value !== void 0 && n.value !== null).map((n) => ({
|
|
113
|
-
key: n.key,
|
|
114
|
-
value: n.value
|
|
115
|
-
})),
|
|
116
|
-
{
|
|
117
|
-
key: "c_whu_",
|
|
118
|
-
value: "pixel"
|
|
119
|
-
}
|
|
120
|
-
];
|
|
121
|
-
m.forEach(({ key: n, value: $ }, B) => {
|
|
122
|
-
const ot = ["c_w_", "c_h_", "c_x_", "c_y_"].includes(n);
|
|
123
|
-
r += `${n}${ot ? Math.round(Number($)) : $}${B < m.length - 1 ? "," : ""}`;
|
|
124
|
-
}), r += "/";
|
|
125
|
-
}
|
|
126
|
-
if (x === c.Rotate && ([
|
|
127
|
-
{
|
|
128
|
-
key: "r_a_",
|
|
129
|
-
value: g.rotation
|
|
130
|
-
}
|
|
131
|
-
].filter((n) => n.value !== void 0).map((n) => ({
|
|
132
|
-
key: n.key,
|
|
133
|
-
value: Math.round(Number(n.value))
|
|
134
|
-
})).forEach(({ key: n, value: $ }) => {
|
|
135
|
-
r += `${n}${$}`;
|
|
136
|
-
}), r += "/"), x === c.Quality) {
|
|
137
|
-
const m = [
|
|
138
|
-
{
|
|
139
|
-
key: "q_level_",
|
|
140
|
-
value: g.quality
|
|
141
|
-
}
|
|
142
|
-
].filter((n) => n.value !== void 0).map((n) => ({
|
|
143
|
-
key: n.key,
|
|
144
|
-
value: Math.round(Number(n.value))
|
|
145
|
-
}));
|
|
146
|
-
m.forEach(({ key: n, value: $ }, B) => {
|
|
147
|
-
r += `${n}${$}${B < m.length - 1 ? "," : ""}`;
|
|
148
|
-
}), r += "/";
|
|
149
|
-
}
|
|
150
|
-
if (x === c.Metadata) {
|
|
151
|
-
const m = [
|
|
152
|
-
{
|
|
153
|
-
key: "fl_keep_metadata",
|
|
154
|
-
value: g.keepMetadata
|
|
155
|
-
}
|
|
156
|
-
].filter((n) => n.value !== void 0).map((n) => ({ key: n.key, value: n.value }));
|
|
157
|
-
m.forEach(({ key: n }, $) => {
|
|
158
|
-
r += `${n}${$ < m.length - 1 ? "," : ""}`;
|
|
159
|
-
}), r += "/";
|
|
160
|
-
}
|
|
161
|
-
}), i && (r += `${t?.identifier}${i}`);
|
|
162
|
-
const w = [];
|
|
163
|
-
return s && s.length > 0 && s.forEach(({ key: x, value: g }) => {
|
|
164
|
-
w.push(
|
|
165
|
-
`${encodeURIComponent(x.trim())}=${encodeURIComponent(g.trim())}`
|
|
166
|
-
);
|
|
167
|
-
}), w.length > 0 && (r += `?${w.join("&")}`), r.endsWith("/") && (r = r.slice(0, -1)), r;
|
|
168
|
-
}
|
|
169
|
-
const gt = U`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}`;
|
|
170
|
-
var mt = Object.defineProperty, xt = Object.getOwnPropertyDescriptor, f = (t, e, i, s) => {
|
|
171
|
-
for (var a = s > 1 ? void 0 : s ? xt(e, i) : e, h = t.length - 1, r; h >= 0; h--)
|
|
172
|
-
(r = t[h]) && (a = (s ? r(e, i, a) : r(a)) || a);
|
|
173
|
-
return s && a && mt(e, i, a), a;
|
|
1
|
+
import "../chunks/cropper.Bib8Abm3.js";
|
|
2
|
+
import { C as U } from "../chunks/button.CAa1kvwe.js";
|
|
3
|
+
import P from "./space.js";
|
|
4
|
+
import { C as _ } from "../chunks/typography.DJC_UXgs.js";
|
|
5
|
+
import { n as h, C as H } from "../chunks/lib-cortex-element.CVMmyPMC.js";
|
|
6
|
+
import { b as at, c as ot } from "../chunks/asset.B3vySOI-.js";
|
|
7
|
+
import { c as W } from "../chunks/component.styles.CRO4Odto.js";
|
|
8
|
+
import { U as a, T as d } from "../chunks/asset-link-format.BSRDqHg7.js";
|
|
9
|
+
import { c as F } from "../chunks/custom-element.L4WJXn1j.js";
|
|
10
|
+
import { L as E } from "../chunks/i18n.BABe9hN4.js";
|
|
11
|
+
import { w as S } from "../chunks/watch.BCJD77bD.js";
|
|
12
|
+
import { s as et, c as it } from "../chunks/number.B4PQLJIg.js";
|
|
13
|
+
import { b as Y } from "../chunks/transformation.Cqz3hPaQ.js";
|
|
14
|
+
import { i as N, x as m, E as rt } from "../chunks/lit-element.jLBm65_O.js";
|
|
15
|
+
import { r as f } from "../chunks/state.CSDxrqLd.js";
|
|
16
|
+
import { n as C } from "../chunks/when.Dr1es41R.js";
|
|
17
|
+
import T from "./details.js";
|
|
18
|
+
import ht from "./divider.js";
|
|
19
|
+
import I from "./icon.js";
|
|
20
|
+
import { C as K } from "../chunks/icon-button.C2s3pHG4.js";
|
|
21
|
+
import Z from "./input.js";
|
|
22
|
+
import { C as Q } from "../chunks/option.DGXQzdtb.js";
|
|
23
|
+
import G from "./select.js";
|
|
24
|
+
import { c as nt } from "../chunks/image.9qwbjGNb.js";
|
|
25
|
+
import { e as V } from "../chunks/query.BBf1UFkC.js";
|
|
26
|
+
import { c as L } from "../chunks/repeat.DbF2p5ae.js";
|
|
27
|
+
import { o as A } from "../chunks/style-map.llVFPd__.js";
|
|
28
|
+
import st from "./tooltip.js";
|
|
29
|
+
import lt from "./button-group.js";
|
|
30
|
+
import ct from "./checkbox.js";
|
|
31
|
+
const pt = N`.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}`, dt = N`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}`;
|
|
32
|
+
var ut = Object.defineProperty, mt = Object.getOwnPropertyDescriptor, u = (t, e, i, s) => {
|
|
33
|
+
for (var o = s > 1 ? void 0 : s ? mt(e, i) : e, r = t.length - 1, n; r >= 0; r--)
|
|
34
|
+
(n = t[r]) && (o = (s ? n(e, i, o) : n(o)) || o);
|
|
35
|
+
return s && o && ut(e, i, o), o;
|
|
174
36
|
};
|
|
175
|
-
let
|
|
37
|
+
let p = class extends H {
|
|
176
38
|
constructor() {
|
|
177
|
-
super(...arguments), this.localize = new
|
|
178
|
-
[
|
|
39
|
+
super(...arguments), this.localize = new E(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 = a.Pixel, this.disabledApply = !1, this.lastAppliedSetting = {
|
|
40
|
+
[a.Pixel]: {
|
|
179
41
|
height: 0,
|
|
180
42
|
percentageHeight: 100,
|
|
181
43
|
percentageWidth: 100,
|
|
182
|
-
unit:
|
|
44
|
+
unit: a.Pixel,
|
|
183
45
|
width: 0,
|
|
184
46
|
x: 0,
|
|
185
47
|
y: 0
|
|
186
48
|
},
|
|
187
|
-
[
|
|
49
|
+
[a.AspectRatio]: {
|
|
188
50
|
height: 1,
|
|
189
51
|
percentageHeight: 100,
|
|
190
52
|
percentageWidth: 100,
|
|
191
|
-
unit:
|
|
53
|
+
unit: a.AspectRatio,
|
|
192
54
|
width: 1,
|
|
193
55
|
x: 0,
|
|
194
56
|
y: 0
|
|
@@ -205,10 +67,10 @@ let u = class extends F {
|
|
|
205
67
|
return;
|
|
206
68
|
}
|
|
207
69
|
if (this.keepAspectRatio) {
|
|
208
|
-
if (this.unit ===
|
|
70
|
+
if (this.unit === a.Pixel && this.width && this.height) {
|
|
209
71
|
this.aspectRatio = this.width / this.height;
|
|
210
72
|
return;
|
|
211
|
-
} else if (this.unit ===
|
|
73
|
+
} else if (this.unit === a.AspectRatio && this.ratioWidth && this.ratioHeight) {
|
|
212
74
|
this.aspectRatio = this.ratioWidth / this.ratioHeight;
|
|
213
75
|
return;
|
|
214
76
|
}
|
|
@@ -220,12 +82,12 @@ let u = class extends F {
|
|
|
220
82
|
this.aspectRatio = 1;
|
|
221
83
|
}
|
|
222
84
|
async handleOpenChange() {
|
|
223
|
-
this.cropMode = "free", await this.updateComplete, this.open || (this.width = this.lastAppliedSetting[
|
|
85
|
+
this.cropMode = "free", await this.updateComplete, this.open || (this.width = this.lastAppliedSetting[a.Pixel].width, this.height = this.lastAppliedSetting[a.Pixel].height, this.unit = a.Pixel, this.emit("cx-asset-link-format-crop-change", {
|
|
224
86
|
detail: {
|
|
225
|
-
height: this.lastAppliedSetting[
|
|
87
|
+
height: this.lastAppliedSetting[a.Pixel].height,
|
|
226
88
|
keepAspectRatio: this.keepAspectRatio,
|
|
227
|
-
unit:
|
|
228
|
-
width: this.lastAppliedSetting[
|
|
89
|
+
unit: a.Pixel,
|
|
90
|
+
width: this.lastAppliedSetting[a.Pixel].width
|
|
229
91
|
}
|
|
230
92
|
}));
|
|
231
93
|
}
|
|
@@ -236,9 +98,9 @@ let u = class extends F {
|
|
|
236
98
|
}
|
|
237
99
|
this.invalidWidth = !1;
|
|
238
100
|
let e = Number(t.target.value);
|
|
239
|
-
this.unit ===
|
|
240
|
-
let i = this.unit ===
|
|
241
|
-
this.keepAspectRatio && (i = Math.round(e / this.aspectRatio), this.unit ===
|
|
101
|
+
this.unit === a.Pixel && (e = Math.max(Math.min(e, this.maxWidth), 1)), t.target.value = e.toString();
|
|
102
|
+
let i = this.unit === a.Pixel ? this.height : this.ratioHeight, s = !1;
|
|
103
|
+
this.keepAspectRatio && (i = Math.round(e / this.aspectRatio), this.unit === a.Pixel && i > this.maxHeight && (i = this.maxHeight, s = !0)), this.invalidHeight = !1, this.emit("cx-asset-link-format-crop-change", {
|
|
242
104
|
detail: {
|
|
243
105
|
breakAspectRatio: s,
|
|
244
106
|
height: i,
|
|
@@ -255,9 +117,9 @@ let u = class extends F {
|
|
|
255
117
|
}
|
|
256
118
|
this.invalidHeight = !1;
|
|
257
119
|
let e = Number(t.target.value);
|
|
258
|
-
this.unit ===
|
|
259
|
-
let i = this.unit ===
|
|
260
|
-
this.keepAspectRatio && (i = Math.round(e * this.aspectRatio), this.unit ===
|
|
120
|
+
this.unit === a.Pixel && (e = Math.max(Math.min(e, this.maxHeight), 1)), t.target.value = e.toString();
|
|
121
|
+
let i = this.unit === a.Pixel ? this.width : this.ratioWidth, s = !1;
|
|
122
|
+
this.keepAspectRatio && (i = Math.round(e * this.aspectRatio), this.unit === a.Pixel && i > this.maxWidth && (i = this.maxWidth, s = !0)), this.invalidWidth = !1, this.emit("cx-asset-link-format-crop-change", {
|
|
261
123
|
detail: {
|
|
262
124
|
breakAspectRatio: s,
|
|
263
125
|
height: e,
|
|
@@ -272,38 +134,38 @@ let u = class extends F {
|
|
|
272
134
|
if (e === "free")
|
|
273
135
|
this.selectedMode?.auto && this.emit("cx-asset-link-format-crop-change", {
|
|
274
136
|
detail: {
|
|
275
|
-
height: this.lastAppliedSetting[
|
|
137
|
+
height: this.lastAppliedSetting[a.Pixel].height,
|
|
276
138
|
keepAspectRatio: !1,
|
|
277
139
|
silent: !0,
|
|
278
|
-
unit:
|
|
279
|
-
width: this.lastAppliedSetting[
|
|
140
|
+
unit: a.Pixel,
|
|
141
|
+
width: this.lastAppliedSetting[a.Pixel].width
|
|
280
142
|
}
|
|
281
143
|
});
|
|
282
144
|
else if (!i) {
|
|
283
|
-
const [s,
|
|
284
|
-
if (this.unit ===
|
|
285
|
-
const { height:
|
|
145
|
+
const [s, o] = e.split(":").map(Number);
|
|
146
|
+
if (this.unit === a.Pixel) {
|
|
147
|
+
const { height: r, width: n } = nt(
|
|
286
148
|
this.maxWidth,
|
|
287
149
|
this.maxHeight,
|
|
288
150
|
s,
|
|
289
|
-
|
|
151
|
+
o
|
|
290
152
|
);
|
|
291
153
|
this.emit("cx-asset-link-format-crop-change", {
|
|
292
154
|
detail: {
|
|
293
|
-
height:
|
|
155
|
+
height: r,
|
|
294
156
|
keepAspectRatio: !0,
|
|
295
157
|
silent: !0,
|
|
296
|
-
unit:
|
|
297
|
-
width:
|
|
158
|
+
unit: a.Pixel,
|
|
159
|
+
width: n
|
|
298
160
|
}
|
|
299
161
|
});
|
|
300
162
|
} else
|
|
301
163
|
this.emit("cx-asset-link-format-crop-change", {
|
|
302
164
|
detail: {
|
|
303
|
-
height:
|
|
165
|
+
height: o,
|
|
304
166
|
keepAspectRatio: !0,
|
|
305
167
|
silent: !0,
|
|
306
|
-
unit:
|
|
168
|
+
unit: a.AspectRatio,
|
|
307
169
|
width: s
|
|
308
170
|
}
|
|
309
171
|
});
|
|
@@ -329,19 +191,19 @@ let u = class extends F {
|
|
|
329
191
|
* This allows the parent component to update the crop settings accordingly.
|
|
330
192
|
*/
|
|
331
193
|
onUnitChange(t) {
|
|
332
|
-
t.target.value ===
|
|
194
|
+
t.target.value === a.AspectRatio ? this.emit("cx-asset-link-format-crop-change", {
|
|
333
195
|
detail: {
|
|
334
|
-
height: this.lastAppliedSetting[
|
|
196
|
+
height: this.lastAppliedSetting[a.AspectRatio].height,
|
|
335
197
|
keepAspectRatio: this.keepAspectRatio,
|
|
336
|
-
unit:
|
|
337
|
-
width: this.lastAppliedSetting[
|
|
198
|
+
unit: a.AspectRatio,
|
|
199
|
+
width: this.lastAppliedSetting[a.AspectRatio].width
|
|
338
200
|
}
|
|
339
201
|
}) : this.emit("cx-asset-link-format-crop-change", {
|
|
340
202
|
detail: {
|
|
341
|
-
height: this.lastAppliedSetting[
|
|
203
|
+
height: this.lastAppliedSetting[a.Pixel].height,
|
|
342
204
|
keepAspectRatio: this.keepAspectRatio,
|
|
343
|
-
unit:
|
|
344
|
-
width: this.lastAppliedSetting[
|
|
205
|
+
unit: a.Pixel,
|
|
206
|
+
width: this.lastAppliedSetting[a.Pixel].width
|
|
345
207
|
}
|
|
346
208
|
}), this.emit("cx-asset-link-format-crop-mode-change", {
|
|
347
209
|
detail: {
|
|
@@ -384,150 +246,150 @@ let u = class extends F {
|
|
|
384
246
|
}
|
|
385
247
|
}), this.emit("cx-asset-link-format-crop-change", {
|
|
386
248
|
detail: {
|
|
387
|
-
height: this.unit ===
|
|
249
|
+
height: this.unit === a.Pixel ? this.height : this.ratioHeight,
|
|
388
250
|
keepAspectRatio: !this.keepAspectRatio,
|
|
389
251
|
unit: this.unit,
|
|
390
|
-
width: this.unit ===
|
|
252
|
+
width: this.unit === a.Pixel ? this.width : this.ratioWidth
|
|
391
253
|
}
|
|
392
254
|
});
|
|
393
255
|
}
|
|
394
256
|
render() {
|
|
395
257
|
const t = this.cropModes.filter((i) => !i.auto), e = this.cropModes.filter((i) => i.auto);
|
|
396
|
-
return
|
|
258
|
+
return m`<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=${A({
|
|
397
259
|
width: "100%"
|
|
398
|
-
})} @cx-change=${this.onCropModeChange} ?disabled=${this.loading}>${
|
|
260
|
+
})} @cx-change=${this.onCropModeChange} ?disabled=${this.loading}>${L(
|
|
399
261
|
t,
|
|
400
262
|
(i) => i.value,
|
|
401
|
-
({ label: i, value: s }) =>
|
|
263
|
+
({ label: i, value: s }) => m`<cx-option value=${s}>${i}</cx-option>`
|
|
402
264
|
)}
|
|
403
|
-
${
|
|
265
|
+
${C(
|
|
404
266
|
e.length > 0,
|
|
405
|
-
() =>
|
|
267
|
+
() => m`<cx-divider></cx-divider><small>${this.localize.term("autoCropping")}</small>`
|
|
406
268
|
)}
|
|
407
|
-
${
|
|
269
|
+
${L(
|
|
408
270
|
e,
|
|
409
271
|
(i) => i.value,
|
|
410
|
-
({ label: i, value: s }) =>
|
|
411
|
-
)}</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")}
|
|
272
|
+
({ label: i, value: s }) => m`<cx-option value=${s}>${i}</cx-option>`
|
|
273
|
+
)}</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 === a.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">
|
|
412
274
|
W
|
|
413
|
-
</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=${
|
|
275
|
+
</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=${A({
|
|
414
276
|
color: this.keepAspectRatio ? "var(--cx-color-primary)" : void 0
|
|
415
|
-
})} ?disabled=${this.loading}></cx-icon-button><cx-input data-testid="cx-asset-link-format-crop-height" placeholder=${this.localize.term("height")}
|
|
277
|
+
})} ?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 === a.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">
|
|
416
278
|
H
|
|
417
|
-
</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=${
|
|
279
|
+
</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=${a.Pixel}>${this.localize.term("pixels")}</cx-option><cx-option value=${a.AspectRatio}>${this.localize.term("aspectRatio")}</cx-option></cx-select></cx-space>${C(
|
|
418
280
|
this.focusModes.length > 0,
|
|
419
|
-
() =>
|
|
281
|
+
() => m`<cx-select data-testid="cx-asset-link-format-crop-focus-mode" value=${this.focusMode} hoist style=${A({
|
|
420
282
|
width: "100%"
|
|
421
|
-
})} @cx-change=${this.onFocusModeChange} ?disabled=${this.loading || this.selectedMode?.disabledSize}>${
|
|
283
|
+
})} @cx-change=${this.onFocusModeChange} ?disabled=${this.loading || this.selectedMode?.disabledSize}>${L(
|
|
422
284
|
this.focusModes,
|
|
423
285
|
(i) => i.value,
|
|
424
|
-
({ label: i, value: s }) =>
|
|
286
|
+
({ label: i, value: s }) => m`<cx-option value=${s}>${i}</cx-option>`
|
|
425
287
|
)}</cx-select>`
|
|
426
|
-
)}<cx-button data-testid="cx-asset-link-format-crop-apply" variant="primary" ?disabled=${this.disabledApply || this.invalidHeight || this.invalidWidth} ?loading=${this.loading} style=${
|
|
288
|
+
)}<cx-button data-testid="cx-asset-link-format-crop-apply" variant="primary" ?disabled=${this.disabledApply || this.invalidHeight || this.invalidWidth} ?loading=${this.loading} style=${A({
|
|
427
289
|
marginLeft: "auto"
|
|
428
290
|
})} @click=${this.handleApply}>${this.localize.term("apply")}</cx-button></cx-space></cx-details>`;
|
|
429
291
|
}
|
|
430
292
|
};
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
"cx-button":
|
|
434
|
-
"cx-details":
|
|
435
|
-
"cx-divider":
|
|
436
|
-
"cx-icon":
|
|
293
|
+
p.styles = [W, dt];
|
|
294
|
+
p.dependencies = {
|
|
295
|
+
"cx-button": U,
|
|
296
|
+
"cx-details": T,
|
|
297
|
+
"cx-divider": ht,
|
|
298
|
+
"cx-icon": I,
|
|
437
299
|
"cx-icon-button": K,
|
|
438
|
-
"cx-input":
|
|
439
|
-
"cx-option":
|
|
440
|
-
"cx-select":
|
|
441
|
-
"cx-space":
|
|
442
|
-
"cx-typography":
|
|
300
|
+
"cx-input": Z,
|
|
301
|
+
"cx-option": Q,
|
|
302
|
+
"cx-select": G,
|
|
303
|
+
"cx-space": P,
|
|
304
|
+
"cx-typography": _
|
|
443
305
|
};
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
],
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
],
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
],
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
],
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
],
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
],
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
],
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
],
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
],
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
],
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
],
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
],
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
],
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
],
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
],
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
],
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
],
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
],
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
],
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
],
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
],
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
],
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
],
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
],
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
],
|
|
522
|
-
const
|
|
523
|
-
var
|
|
524
|
-
for (var
|
|
525
|
-
(
|
|
526
|
-
return s &&
|
|
306
|
+
u([
|
|
307
|
+
V(".details")
|
|
308
|
+
], p.prototype, "base", 2);
|
|
309
|
+
u([
|
|
310
|
+
h({ reflect: !0, type: Boolean })
|
|
311
|
+
], p.prototype, "open", 2);
|
|
312
|
+
u([
|
|
313
|
+
h({ reflect: !0, type: Number })
|
|
314
|
+
], p.prototype, "width", 2);
|
|
315
|
+
u([
|
|
316
|
+
h({ reflect: !0, type: Number })
|
|
317
|
+
], p.prototype, "height", 2);
|
|
318
|
+
u([
|
|
319
|
+
h({ attribute: "max-width", reflect: !0, type: Number })
|
|
320
|
+
], p.prototype, "maxWidth", 2);
|
|
321
|
+
u([
|
|
322
|
+
h({ attribute: "max-height", reflect: !0, type: Number })
|
|
323
|
+
], p.prototype, "maxHeight", 2);
|
|
324
|
+
u([
|
|
325
|
+
h({ attribute: "ratio-width", reflect: !0, type: Number })
|
|
326
|
+
], p.prototype, "ratioWidth", 2);
|
|
327
|
+
u([
|
|
328
|
+
h({ attribute: "ratio-height", reflect: !0, type: Number })
|
|
329
|
+
], p.prototype, "ratioHeight", 2);
|
|
330
|
+
u([
|
|
331
|
+
h({ attribute: "percentage-width", reflect: !0, type: Number })
|
|
332
|
+
], p.prototype, "percentageWidth", 2);
|
|
333
|
+
u([
|
|
334
|
+
h({ attribute: "percentage-height", reflect: !0, type: Number })
|
|
335
|
+
], p.prototype, "percentageHeight", 2);
|
|
336
|
+
u([
|
|
337
|
+
h({ reflect: !0, type: String })
|
|
338
|
+
], p.prototype, "unit", 2);
|
|
339
|
+
u([
|
|
340
|
+
h({ attribute: "disabled-apply", reflect: !0, type: Boolean })
|
|
341
|
+
], p.prototype, "disabledApply", 2);
|
|
342
|
+
u([
|
|
343
|
+
h({ attribute: "last-applied-setting", reflect: !1, type: Object })
|
|
344
|
+
], p.prototype, "lastAppliedSetting", 2);
|
|
345
|
+
u([
|
|
346
|
+
h({ reflect: !0, type: Boolean })
|
|
347
|
+
], p.prototype, "loading", 2);
|
|
348
|
+
u([
|
|
349
|
+
h({ attribute: "crop-modes", reflect: !1, type: Array })
|
|
350
|
+
], p.prototype, "cropModes", 2);
|
|
351
|
+
u([
|
|
352
|
+
h({ attribute: "focus-modes", reflect: !1, type: Object })
|
|
353
|
+
], p.prototype, "focusModes", 2);
|
|
354
|
+
u([
|
|
355
|
+
h({ attribute: "focus-mode", reflect: !0, type: String })
|
|
356
|
+
], p.prototype, "focusMode", 2);
|
|
357
|
+
u([
|
|
358
|
+
h({ attribute: "crop-mode", reflect: !0, type: String })
|
|
359
|
+
], p.prototype, "cropMode", 2);
|
|
360
|
+
u([
|
|
361
|
+
h({ attribute: "keep-aspect-ratio", reflect: !0, type: Boolean })
|
|
362
|
+
], p.prototype, "keepAspectRatio", 2);
|
|
363
|
+
u([
|
|
364
|
+
f()
|
|
365
|
+
], p.prototype, "invalidWidth", 2);
|
|
366
|
+
u([
|
|
367
|
+
f()
|
|
368
|
+
], p.prototype, "invalidHeight", 2);
|
|
369
|
+
u([
|
|
370
|
+
f()
|
|
371
|
+
], p.prototype, "aspectRatio", 2);
|
|
372
|
+
u([
|
|
373
|
+
S("cropMode", { waitUntilFirstUpdate: !0 }),
|
|
374
|
+
S("maxWidth", { waitUntilFirstUpdate: !0 }),
|
|
375
|
+
S("maxHeight", { waitUntilFirstUpdate: !0 }),
|
|
376
|
+
S("keepAspectRatio")
|
|
377
|
+
], p.prototype, "handleCropModeChange", 1);
|
|
378
|
+
u([
|
|
379
|
+
S("open")
|
|
380
|
+
], p.prototype, "handleOpenChange", 1);
|
|
381
|
+
p = u([
|
|
382
|
+
F("cx-asset-link-format-crop")
|
|
383
|
+
], p);
|
|
384
|
+
const gt = N`.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%}}`;
|
|
385
|
+
var xt = Object.defineProperty, ft = Object.getOwnPropertyDescriptor, J = (t, e, i, s) => {
|
|
386
|
+
for (var o = s > 1 ? void 0 : s ? ft(e, i) : e, r = t.length - 1, n; r >= 0; r--)
|
|
387
|
+
(n = t[r]) && (o = (s ? n(e, i, o) : n(o)) || o);
|
|
388
|
+
return s && o && xt(e, i, o), o;
|
|
527
389
|
};
|
|
528
|
-
let
|
|
390
|
+
let O = class extends H {
|
|
529
391
|
constructor() {
|
|
530
|
-
super(...arguments), this.localize = new
|
|
392
|
+
super(...arguments), this.localize = new E(this), this.value = "", this.items = [];
|
|
531
393
|
}
|
|
532
394
|
handleExtensionChange(t) {
|
|
533
395
|
const e = t.target.value;
|
|
@@ -536,38 +398,38 @@ let D = class extends F {
|
|
|
536
398
|
});
|
|
537
399
|
}
|
|
538
400
|
render() {
|
|
539
|
-
return
|
|
401
|
+
return m`<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}>${L(
|
|
540
402
|
this.items,
|
|
541
403
|
(t) => t.value,
|
|
542
|
-
(t) =>
|
|
404
|
+
(t) => m`<cx-option value=${t.value}>${t.displayName}</cx-option>`
|
|
543
405
|
)}</cx-select></cx-space>`;
|
|
544
406
|
}
|
|
545
407
|
};
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
"cx-option":
|
|
549
|
-
"cx-select":
|
|
550
|
-
"cx-space":
|
|
551
|
-
"cx-typography":
|
|
408
|
+
O.styles = [W, gt];
|
|
409
|
+
O.dependencies = {
|
|
410
|
+
"cx-option": Q,
|
|
411
|
+
"cx-select": G,
|
|
412
|
+
"cx-space": P,
|
|
413
|
+
"cx-typography": _
|
|
552
414
|
};
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
],
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
],
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
],
|
|
562
|
-
const
|
|
563
|
-
var zt = Object.defineProperty, St = Object.getOwnPropertyDescriptor,
|
|
564
|
-
for (var
|
|
565
|
-
(
|
|
566
|
-
return s &&
|
|
415
|
+
J([
|
|
416
|
+
h({ reflect: !0, type: String })
|
|
417
|
+
], O.prototype, "value", 2);
|
|
418
|
+
J([
|
|
419
|
+
h({ reflect: !1, type: Array })
|
|
420
|
+
], O.prototype, "items", 2);
|
|
421
|
+
O = J([
|
|
422
|
+
F("cx-asset-link-format-extension")
|
|
423
|
+
], O);
|
|
424
|
+
const yt = N`cx-details::part(base){border-bottom-width:0}`;
|
|
425
|
+
var zt = Object.defineProperty, St = Object.getOwnPropertyDescriptor, R = (t, e, i, s) => {
|
|
426
|
+
for (var o = s > 1 ? void 0 : s ? St(e, i) : e, r = t.length - 1, n; r >= 0; r--)
|
|
427
|
+
(n = t[r]) && (o = (s ? n(e, i, o) : n(o)) || o);
|
|
428
|
+
return s && o && zt(e, i, o), o;
|
|
567
429
|
};
|
|
568
|
-
let
|
|
430
|
+
let w = class extends H {
|
|
569
431
|
constructor() {
|
|
570
|
-
super(...arguments), this.localize = new
|
|
432
|
+
super(...arguments), this.localize = new E(this), this.open = !1, this.value = "", this.items = [], this.loading = !1, this.scopedValue = "";
|
|
571
433
|
}
|
|
572
434
|
handleValueChange() {
|
|
573
435
|
this.scopedValue = this.value;
|
|
@@ -611,61 +473,61 @@ let C = class extends F {
|
|
|
611
473
|
t.target !== this.base && t.stopPropagation();
|
|
612
474
|
}
|
|
613
475
|
render() {
|
|
614
|
-
return
|
|
476
|
+
return m`<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}>${L(
|
|
615
477
|
this.items,
|
|
616
478
|
(t) => t.id,
|
|
617
|
-
(t) =>
|
|
618
|
-
)}</cx-select><cx-button data-testid="cx-asset-link-format-proxy-apply" variant="primary" style=${
|
|
479
|
+
(t) => m`<cx-option value=${t.id}>${t.proxyLabel}</cx-option>`
|
|
480
|
+
)}</cx-select><cx-button data-testid="cx-asset-link-format-proxy-apply" variant="primary" style=${A({
|
|
619
481
|
"margin-left": "auto"
|
|
620
482
|
})} ?disabled=${this.scopedValue === this.value} ?loading=${this.loading} @click=${this.handleApply}>${this.localize.term("apply")}</cx-button></cx-space></cx-details>`;
|
|
621
483
|
}
|
|
622
484
|
};
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
"cx-button":
|
|
626
|
-
"cx-details":
|
|
627
|
-
"cx-icon":
|
|
628
|
-
"cx-option":
|
|
629
|
-
"cx-select":
|
|
630
|
-
"cx-space":
|
|
631
|
-
"cx-typography":
|
|
485
|
+
w.styles = [W, yt];
|
|
486
|
+
w.dependencies = {
|
|
487
|
+
"cx-button": U,
|
|
488
|
+
"cx-details": T,
|
|
489
|
+
"cx-icon": I,
|
|
490
|
+
"cx-option": Q,
|
|
491
|
+
"cx-select": G,
|
|
492
|
+
"cx-space": P,
|
|
493
|
+
"cx-typography": _
|
|
632
494
|
};
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
],
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
],
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
],
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
],
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
],
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
],
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
],
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
],
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
],
|
|
660
|
-
const
|
|
661
|
-
var
|
|
662
|
-
for (var
|
|
663
|
-
(
|
|
664
|
-
return s &&
|
|
495
|
+
R([
|
|
496
|
+
V(".details")
|
|
497
|
+
], w.prototype, "base", 2);
|
|
498
|
+
R([
|
|
499
|
+
h({ reflect: !0, type: Boolean })
|
|
500
|
+
], w.prototype, "open", 2);
|
|
501
|
+
R([
|
|
502
|
+
h({ reflect: !0, type: String })
|
|
503
|
+
], w.prototype, "value", 2);
|
|
504
|
+
R([
|
|
505
|
+
h({ reflect: !1, type: Array })
|
|
506
|
+
], w.prototype, "items", 2);
|
|
507
|
+
R([
|
|
508
|
+
h({ reflect: !0, type: Boolean })
|
|
509
|
+
], w.prototype, "loading", 2);
|
|
510
|
+
R([
|
|
511
|
+
f()
|
|
512
|
+
], w.prototype, "scopedValue", 2);
|
|
513
|
+
R([
|
|
514
|
+
S("value")
|
|
515
|
+
], w.prototype, "handleValueChange", 1);
|
|
516
|
+
R([
|
|
517
|
+
S("open", { waitUntilFirstUpdate: !0 })
|
|
518
|
+
], w.prototype, "handleOpenChange", 1);
|
|
519
|
+
w = R([
|
|
520
|
+
F("cx-asset-link-format-proxy")
|
|
521
|
+
], w);
|
|
522
|
+
const wt = N`cx-details::part(base){border-bottom-width:0}`;
|
|
523
|
+
var bt = Object.defineProperty, vt = Object.getOwnPropertyDescriptor, D = (t, e, i, s) => {
|
|
524
|
+
for (var o = s > 1 ? void 0 : s ? vt(e, i) : e, r = t.length - 1, n; r >= 0; r--)
|
|
525
|
+
(n = t[r]) && (o = (s ? n(e, i, o) : n(o)) || o);
|
|
526
|
+
return s && o && bt(e, i, o), o;
|
|
665
527
|
};
|
|
666
|
-
let
|
|
528
|
+
let b = class extends H {
|
|
667
529
|
constructor() {
|
|
668
|
-
super(...arguments), this.localize = new
|
|
530
|
+
super(...arguments), this.localize = new E(this), this.open = !1, this.value = 100, this.loading = !1, this.scopedValue = 100;
|
|
669
531
|
}
|
|
670
532
|
/**
|
|
671
533
|
* A computed property that checks if the current quality value is invalid.
|
|
@@ -709,53 +571,53 @@ let A = class extends F {
|
|
|
709
571
|
t.target !== this.base && t.stopPropagation();
|
|
710
572
|
}
|
|
711
573
|
render() {
|
|
712
|
-
return
|
|
574
|
+
return m`<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=${A({
|
|
713
575
|
flex: "1"
|
|
714
576
|
})} @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>`;
|
|
715
577
|
}
|
|
716
578
|
};
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
"cx-button":
|
|
720
|
-
"cx-details":
|
|
721
|
-
"cx-icon":
|
|
722
|
-
"cx-input":
|
|
723
|
-
"cx-space":
|
|
724
|
-
"cx-tooltip":
|
|
725
|
-
"cx-typography":
|
|
579
|
+
b.styles = [W, wt];
|
|
580
|
+
b.dependencies = {
|
|
581
|
+
"cx-button": U,
|
|
582
|
+
"cx-details": T,
|
|
583
|
+
"cx-icon": I,
|
|
584
|
+
"cx-input": Z,
|
|
585
|
+
"cx-space": P,
|
|
586
|
+
"cx-tooltip": st,
|
|
587
|
+
"cx-typography": _
|
|
726
588
|
};
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
],
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
],
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
],
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
],
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
],
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
],
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
],
|
|
748
|
-
const
|
|
749
|
-
var
|
|
750
|
-
for (var
|
|
751
|
-
(
|
|
752
|
-
return s &&
|
|
589
|
+
D([
|
|
590
|
+
V(".details")
|
|
591
|
+
], b.prototype, "base", 2);
|
|
592
|
+
D([
|
|
593
|
+
h({ reflect: !0, type: Boolean })
|
|
594
|
+
], b.prototype, "open", 2);
|
|
595
|
+
D([
|
|
596
|
+
h({ reflect: !0, type: Number })
|
|
597
|
+
], b.prototype, "value", 2);
|
|
598
|
+
D([
|
|
599
|
+
h({ reflect: !0, type: Boolean })
|
|
600
|
+
], b.prototype, "loading", 2);
|
|
601
|
+
D([
|
|
602
|
+
f()
|
|
603
|
+
], b.prototype, "scopedValue", 2);
|
|
604
|
+
D([
|
|
605
|
+
S("value")
|
|
606
|
+
], b.prototype, "handleValueChange", 1);
|
|
607
|
+
b = D([
|
|
608
|
+
F("cx-asset-link-format-quality")
|
|
609
|
+
], b);
|
|
610
|
+
const kt = N`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}`;
|
|
611
|
+
var $t = Object.defineProperty, Ct = Object.getOwnPropertyDescriptor, y = (t, e, i, s) => {
|
|
612
|
+
for (var o = s > 1 ? void 0 : s ? Ct(e, i) : e, r = t.length - 1, n; r >= 0; r--)
|
|
613
|
+
(n = t[r]) && (o = (s ? n(e, i, o) : n(o)) || o);
|
|
614
|
+
return s && o && $t(e, i, o), o;
|
|
753
615
|
};
|
|
754
|
-
let
|
|
616
|
+
let g = class extends H {
|
|
755
617
|
constructor() {
|
|
756
|
-
super(...arguments), this.localize = new
|
|
757
|
-
[
|
|
758
|
-
[
|
|
618
|
+
super(...arguments), this.localize = new E(this), this.open = !1, this.width = 0, this.height = 0, this.maxWidth = 0, this.maxHeight = 0, this.ratioWidth = 1, this.ratioHeight = 1, this.unit = a.Pixel, this.lastAppliedSetting = {
|
|
619
|
+
[a.Pixel]: { height: 0, width: 0 },
|
|
620
|
+
[a.AspectRatio]: { height: 1, width: 1 }
|
|
759
621
|
}, this.loading = !1, this.keepAspectRatio = !1, this.invalidWidth = !1, this.invalidHeight = !1, this.aspectRatio = 0;
|
|
760
622
|
}
|
|
761
623
|
/**
|
|
@@ -768,10 +630,10 @@ let v = class extends F {
|
|
|
768
630
|
}
|
|
769
631
|
async handleCropModeChange() {
|
|
770
632
|
if (this.keepAspectRatio) {
|
|
771
|
-
if (this.unit ===
|
|
633
|
+
if (this.unit === a.Pixel && this.width && this.height) {
|
|
772
634
|
this.aspectRatio = this.width / this.height;
|
|
773
635
|
return;
|
|
774
|
-
} else if (this.unit ===
|
|
636
|
+
} else if (this.unit === a.AspectRatio && this.ratioWidth && this.ratioHeight) {
|
|
775
637
|
this.aspectRatio = this.ratioWidth / this.ratioHeight;
|
|
776
638
|
return;
|
|
777
639
|
}
|
|
@@ -783,12 +645,12 @@ let v = class extends F {
|
|
|
783
645
|
this.aspectRatio = 1;
|
|
784
646
|
}
|
|
785
647
|
async handleOpenChange() {
|
|
786
|
-
await this.updateComplete, this.open || (this.width = this.lastAppliedSetting[
|
|
648
|
+
await this.updateComplete, this.open || (this.width = this.lastAppliedSetting[a.Pixel].width, this.height = this.lastAppliedSetting[a.Pixel].height, this.unit = a.Pixel, this.emit("cx-asset-link-format-resize-change", {
|
|
787
649
|
detail: {
|
|
788
|
-
height: this.lastAppliedSetting[
|
|
650
|
+
height: this.lastAppliedSetting[a.Pixel].height,
|
|
789
651
|
keepAspectRatio: this.keepAspectRatio,
|
|
790
|
-
unit:
|
|
791
|
-
width: this.lastAppliedSetting[
|
|
652
|
+
unit: a.Pixel,
|
|
653
|
+
width: this.lastAppliedSetting[a.Pixel].width
|
|
792
654
|
}
|
|
793
655
|
}));
|
|
794
656
|
}
|
|
@@ -799,8 +661,8 @@ let v = class extends F {
|
|
|
799
661
|
}
|
|
800
662
|
this.invalidWidth = !1;
|
|
801
663
|
let e = Number(t.target.value);
|
|
802
|
-
this.unit ===
|
|
803
|
-
let i = this.unit ===
|
|
664
|
+
this.unit === a.Pixel && (e = Math.max(Math.min(e, this.maxWidth), 1)), t.target.value = e.toString();
|
|
665
|
+
let i = this.unit === a.Pixel ? this.height : this.ratioHeight;
|
|
804
666
|
this.keepAspectRatio && (i = Math.min(
|
|
805
667
|
Math.round(e / this.aspectRatio),
|
|
806
668
|
this.maxHeight
|
|
@@ -820,8 +682,8 @@ let v = class extends F {
|
|
|
820
682
|
}
|
|
821
683
|
this.invalidHeight = !1;
|
|
822
684
|
let e = Number(t.target.value);
|
|
823
|
-
this.unit ===
|
|
824
|
-
let i = this.unit ===
|
|
685
|
+
this.unit === a.Pixel && (e = Math.max(Math.min(e, this.maxHeight), 1)), t.target.value = e.toString();
|
|
686
|
+
let i = this.unit === a.Pixel ? this.width : this.ratioWidth;
|
|
825
687
|
this.keepAspectRatio && (i = Math.min(
|
|
826
688
|
Math.round(e * this.aspectRatio),
|
|
827
689
|
this.maxWidth
|
|
@@ -835,19 +697,19 @@ let v = class extends F {
|
|
|
835
697
|
});
|
|
836
698
|
}
|
|
837
699
|
onUnitChange(t) {
|
|
838
|
-
t.target.value ===
|
|
700
|
+
t.target.value === a.AspectRatio ? this.emit("cx-asset-link-format-resize-change", {
|
|
839
701
|
detail: {
|
|
840
|
-
height: this.lastAppliedSetting[
|
|
702
|
+
height: this.lastAppliedSetting[a.AspectRatio].height,
|
|
841
703
|
keepAspectRatio: this.keepAspectRatio,
|
|
842
|
-
unit:
|
|
843
|
-
width: this.lastAppliedSetting[
|
|
704
|
+
unit: a.AspectRatio,
|
|
705
|
+
width: this.lastAppliedSetting[a.AspectRatio].width
|
|
844
706
|
}
|
|
845
707
|
}) : this.emit("cx-asset-link-format-resize-change", {
|
|
846
708
|
detail: {
|
|
847
|
-
height: this.lastAppliedSetting[
|
|
709
|
+
height: this.lastAppliedSetting[a.Pixel].height,
|
|
848
710
|
keepAspectRatio: this.keepAspectRatio,
|
|
849
|
-
unit:
|
|
850
|
-
width: this.lastAppliedSetting[
|
|
711
|
+
unit: a.Pixel,
|
|
712
|
+
width: this.lastAppliedSetting[a.Pixel].width
|
|
851
713
|
}
|
|
852
714
|
});
|
|
853
715
|
}
|
|
@@ -879,103 +741,103 @@ let v = class extends F {
|
|
|
879
741
|
handleAspectRatioClick() {
|
|
880
742
|
this.emit("cx-asset-link-format-resize-change", {
|
|
881
743
|
detail: {
|
|
882
|
-
height: this.unit ===
|
|
744
|
+
height: this.unit === a.Pixel ? this.height : this.ratioHeight,
|
|
883
745
|
keepAspectRatio: !this.keepAspectRatio,
|
|
884
746
|
unit: this.unit,
|
|
885
|
-
width: this.unit ===
|
|
747
|
+
width: this.unit === a.Pixel ? this.width : this.ratioWidth
|
|
886
748
|
}
|
|
887
749
|
});
|
|
888
750
|
}
|
|
889
751
|
render() {
|
|
890
|
-
return
|
|
752
|
+
return m`<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 === a.Pixel ? this.width.toString() : this.ratioWidth.toString()} @cx-input=${this.handleWidthChange} required ?disabled=${this.loading}><cx-typography slot="prefix" variant="body3" part="input-label">
|
|
891
753
|
W
|
|
892
|
-
</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=${
|
|
754
|
+
</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=${A({
|
|
893
755
|
color: this.keepAspectRatio ? "var(--cx-color-primary)" : void 0
|
|
894
|
-
})} ?disabled=${this.loading}></cx-icon-button><cx-input data-testid="cx-asset-link-format-resize-height" placeholder=${this.localize.term("height")}
|
|
756
|
+
})} ?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 === a.Pixel ? this.height.toString() : this.ratioHeight.toString()} @cx-input=${this.handleHeightChange} required ?disabled=${this.loading}><cx-typography slot="prefix" variant="body3" part="input-label">
|
|
895
757
|
H
|
|
896
|
-
</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=${
|
|
758
|
+
</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=${a.Pixel}>${this.localize.term("pixels")}</cx-option><cx-option value=${a.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=${A({
|
|
897
759
|
marginLeft: "auto"
|
|
898
760
|
})} @click=${this.handleApply}>${this.localize.term("apply")}</cx-button></cx-space></cx-details>`;
|
|
899
761
|
}
|
|
900
762
|
};
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
"cx-button":
|
|
904
|
-
"cx-details":
|
|
905
|
-
"cx-icon":
|
|
763
|
+
g.styles = [W, kt];
|
|
764
|
+
g.dependencies = {
|
|
765
|
+
"cx-button": U,
|
|
766
|
+
"cx-details": T,
|
|
767
|
+
"cx-icon": I,
|
|
906
768
|
"cx-icon-button": K,
|
|
907
|
-
"cx-input":
|
|
908
|
-
"cx-option":
|
|
909
|
-
"cx-select":
|
|
910
|
-
"cx-space":
|
|
911
|
-
"cx-typography":
|
|
769
|
+
"cx-input": Z,
|
|
770
|
+
"cx-option": Q,
|
|
771
|
+
"cx-select": G,
|
|
772
|
+
"cx-space": P,
|
|
773
|
+
"cx-typography": _
|
|
912
774
|
};
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
],
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
],
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
],
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
],
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
],
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
],
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
],
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
],
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
],
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
],
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
],
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
],
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
],
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
],
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
],
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
],
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
],
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
],
|
|
970
|
-
const
|
|
971
|
-
var
|
|
972
|
-
for (var
|
|
973
|
-
(
|
|
974
|
-
return s &&
|
|
775
|
+
y([
|
|
776
|
+
V(".details")
|
|
777
|
+
], g.prototype, "base", 2);
|
|
778
|
+
y([
|
|
779
|
+
h({ reflect: !0, type: Boolean })
|
|
780
|
+
], g.prototype, "open", 2);
|
|
781
|
+
y([
|
|
782
|
+
h({ reflect: !0, type: Number })
|
|
783
|
+
], g.prototype, "width", 2);
|
|
784
|
+
y([
|
|
785
|
+
h({ reflect: !0, type: Number })
|
|
786
|
+
], g.prototype, "height", 2);
|
|
787
|
+
y([
|
|
788
|
+
h({ attribute: "max-width", reflect: !0, type: Number })
|
|
789
|
+
], g.prototype, "maxWidth", 2);
|
|
790
|
+
y([
|
|
791
|
+
h({ attribute: "max-height", reflect: !0, type: Number })
|
|
792
|
+
], g.prototype, "maxHeight", 2);
|
|
793
|
+
y([
|
|
794
|
+
h({ attribute: "ratio-width", reflect: !0, type: Number })
|
|
795
|
+
], g.prototype, "ratioWidth", 2);
|
|
796
|
+
y([
|
|
797
|
+
h({ attribute: "ratio-height", reflect: !0, type: Number })
|
|
798
|
+
], g.prototype, "ratioHeight", 2);
|
|
799
|
+
y([
|
|
800
|
+
h({ reflect: !0, type: String })
|
|
801
|
+
], g.prototype, "unit", 2);
|
|
802
|
+
y([
|
|
803
|
+
h({ attribute: "last-applied-setting", reflect: !1, type: Object })
|
|
804
|
+
], g.prototype, "lastAppliedSetting", 2);
|
|
805
|
+
y([
|
|
806
|
+
h({ reflect: !0, type: Boolean })
|
|
807
|
+
], g.prototype, "loading", 2);
|
|
808
|
+
y([
|
|
809
|
+
h({ attribute: "keep-aspect-ratio", reflect: !0, type: Boolean })
|
|
810
|
+
], g.prototype, "keepAspectRatio", 2);
|
|
811
|
+
y([
|
|
812
|
+
f()
|
|
813
|
+
], g.prototype, "invalidWidth", 2);
|
|
814
|
+
y([
|
|
815
|
+
f()
|
|
816
|
+
], g.prototype, "invalidHeight", 2);
|
|
817
|
+
y([
|
|
818
|
+
f()
|
|
819
|
+
], g.prototype, "aspectRatio", 2);
|
|
820
|
+
y([
|
|
821
|
+
S("cropMode", { waitUntilFirstUpdate: !0 }),
|
|
822
|
+
S("maxWidth", { waitUntilFirstUpdate: !0 }),
|
|
823
|
+
S("maxHeight", { waitUntilFirstUpdate: !0 }),
|
|
824
|
+
S("keepAspectRatio")
|
|
825
|
+
], g.prototype, "handleCropModeChange", 1);
|
|
826
|
+
y([
|
|
827
|
+
S("open")
|
|
828
|
+
], g.prototype, "handleOpenChange", 1);
|
|
829
|
+
g = y([
|
|
830
|
+
F("cx-asset-link-format-resize")
|
|
831
|
+
], g);
|
|
832
|
+
const At = N`cx-details::part(base){border-bottom-width:0}`;
|
|
833
|
+
var Rt = Object.defineProperty, Mt = Object.getOwnPropertyDescriptor, q = (t, e, i, s) => {
|
|
834
|
+
for (var o = s > 1 ? void 0 : s ? Mt(e, i) : e, r = t.length - 1, n; r >= 0; r--)
|
|
835
|
+
(n = t[r]) && (o = (s ? n(e, i, o) : n(o)) || o);
|
|
836
|
+
return s && o && Rt(e, i, o), o;
|
|
975
837
|
};
|
|
976
|
-
let
|
|
838
|
+
let v = class extends H {
|
|
977
839
|
constructor() {
|
|
978
|
-
super(...arguments), this.localize = new
|
|
840
|
+
super(...arguments), this.localize = new E(this), this.open = !1, this.value = 0, this.defaultValue = 0, this.loading = !1;
|
|
979
841
|
}
|
|
980
842
|
handleOpenChange() {
|
|
981
843
|
this.open || this.emit("cx-asset-link-format-rotation-change", {
|
|
@@ -983,16 +845,14 @@ let R = class extends F {
|
|
|
983
845
|
});
|
|
984
846
|
}
|
|
985
847
|
handleRotationChange(t) {
|
|
986
|
-
const e = t.target.value;
|
|
987
|
-
e ? this.invalidValue = !1 : this.invalidValue = !0;
|
|
988
|
-
const i = it(Number(e));
|
|
848
|
+
const e = t.target.value, i = et(Number(e));
|
|
989
849
|
(Number(e) > 360 || Number(e) < -360) && (t.target.value = i.toString()), this.emit("cx-asset-link-format-rotation-change", {
|
|
990
850
|
detail: i
|
|
991
851
|
});
|
|
992
852
|
}
|
|
993
853
|
handleButtonClick(t) {
|
|
994
854
|
this.emit("cx-asset-link-format-rotation-change", {
|
|
995
|
-
detail:
|
|
855
|
+
detail: et(t)
|
|
996
856
|
});
|
|
997
857
|
}
|
|
998
858
|
handleClockwiseClick() {
|
|
@@ -1007,57 +867,57 @@ let R = class extends F {
|
|
|
1007
867
|
* It prevents further actions if the component is currently loading.
|
|
1008
868
|
*/
|
|
1009
869
|
handleApply() {
|
|
1010
|
-
this.
|
|
870
|
+
this.value === 360 || this.value === -360 || this.loading || this.emit("cx-asset-link-format-rotation-apply", {
|
|
1011
871
|
detail: this.value
|
|
1012
872
|
});
|
|
1013
873
|
}
|
|
1014
874
|
render() {
|
|
1015
|
-
return
|
|
875
|
+
return m`<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=${A({
|
|
1016
876
|
flex: "none",
|
|
1017
877
|
width: "80px"
|
|
1018
|
-
})} @cx-input=${this.handleRotationChange}
|
|
878
|
+
})} @cx-input=${this.handleRotationChange}></cx-input><cx-button data-testid="cx-asset-link-format-rotation-apply" variant="primary" ?disabled=${this.value === 0} ?loading=${this.loading} @click=${this.handleApply}>${this.localize.term("apply")}</cx-button></cx-space></cx-details>`;
|
|
1019
879
|
}
|
|
1020
880
|
};
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
"cx-button":
|
|
1024
|
-
"cx-button-group":
|
|
1025
|
-
"cx-details":
|
|
1026
|
-
"cx-icon":
|
|
881
|
+
v.styles = [W, At];
|
|
882
|
+
v.dependencies = {
|
|
883
|
+
"cx-button": U,
|
|
884
|
+
"cx-button-group": lt,
|
|
885
|
+
"cx-details": T,
|
|
886
|
+
"cx-icon": I,
|
|
1027
887
|
"cx-icon-button": K,
|
|
1028
|
-
"cx-space":
|
|
1029
|
-
"cx-typography":
|
|
888
|
+
"cx-space": P,
|
|
889
|
+
"cx-typography": _
|
|
1030
890
|
};
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
],
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
],
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
],
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
],
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
],
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
],
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
],
|
|
1052
|
-
const
|
|
1053
|
-
var
|
|
1054
|
-
for (var
|
|
1055
|
-
(
|
|
1056
|
-
return s &&
|
|
891
|
+
q([
|
|
892
|
+
V(".details")
|
|
893
|
+
], v.prototype, "base", 2);
|
|
894
|
+
q([
|
|
895
|
+
h({ reflect: !0, type: Boolean })
|
|
896
|
+
], v.prototype, "open", 2);
|
|
897
|
+
q([
|
|
898
|
+
h({ reflect: !0, type: Number })
|
|
899
|
+
], v.prototype, "value", 2);
|
|
900
|
+
q([
|
|
901
|
+
h({ attribute: "default-value", reflect: !0, type: Number })
|
|
902
|
+
], v.prototype, "defaultValue", 2);
|
|
903
|
+
q([
|
|
904
|
+
h({ reflect: !0, type: Boolean })
|
|
905
|
+
], v.prototype, "loading", 2);
|
|
906
|
+
q([
|
|
907
|
+
S("open", { waitUntilFirstUpdate: !0 })
|
|
908
|
+
], v.prototype, "handleOpenChange", 1);
|
|
909
|
+
v = q([
|
|
910
|
+
F("cx-asset-link-format-rotation")
|
|
911
|
+
], v);
|
|
912
|
+
const Pt = N`cx-details::part(base){border-bottom-width:0}`;
|
|
913
|
+
var _t = Object.defineProperty, Ht = Object.getOwnPropertyDescriptor, X = (t, e, i, s) => {
|
|
914
|
+
for (var o = s > 1 ? void 0 : s ? Ht(e, i) : e, r = t.length - 1, n; r >= 0; r--)
|
|
915
|
+
(n = t[r]) && (o = (s ? n(e, i, o) : n(o)) || o);
|
|
916
|
+
return s && o && _t(e, i, o), o;
|
|
1057
917
|
};
|
|
1058
|
-
let
|
|
918
|
+
let M = class extends H {
|
|
1059
919
|
constructor() {
|
|
1060
|
-
super(...arguments), this.localize = new
|
|
920
|
+
super(...arguments), this.localize = new E(this), this.open = !1, this.value = !1;
|
|
1061
921
|
}
|
|
1062
922
|
handleApply(t) {
|
|
1063
923
|
this.emit("cx-asset-link-format-metadata-change", {
|
|
@@ -1081,39 +941,39 @@ let P = class extends F {
|
|
|
1081
941
|
t.target !== this.base && t.stopPropagation();
|
|
1082
942
|
}
|
|
1083
943
|
render() {
|
|
1084
|
-
return
|
|
944
|
+
return m`<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>`;
|
|
1085
945
|
}
|
|
1086
946
|
};
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
"cx-button":
|
|
1090
|
-
"cx-checkbox":
|
|
1091
|
-
"cx-details":
|
|
1092
|
-
"cx-icon":
|
|
1093
|
-
"cx-space":
|
|
1094
|
-
"cx-tooltip":
|
|
1095
|
-
"cx-typography":
|
|
947
|
+
M.styles = [W, Pt];
|
|
948
|
+
M.dependencies = {
|
|
949
|
+
"cx-button": U,
|
|
950
|
+
"cx-checkbox": ct,
|
|
951
|
+
"cx-details": T,
|
|
952
|
+
"cx-icon": I,
|
|
953
|
+
"cx-space": P,
|
|
954
|
+
"cx-tooltip": st,
|
|
955
|
+
"cx-typography": _
|
|
1096
956
|
};
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
],
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
],
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
],
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
],
|
|
1109
|
-
var
|
|
1110
|
-
for (var
|
|
1111
|
-
(
|
|
1112
|
-
return s &&
|
|
957
|
+
X([
|
|
958
|
+
V(".details")
|
|
959
|
+
], M.prototype, "base", 2);
|
|
960
|
+
X([
|
|
961
|
+
h({ reflect: !0, type: Boolean })
|
|
962
|
+
], M.prototype, "open", 2);
|
|
963
|
+
X([
|
|
964
|
+
h({ reflect: !0, type: Boolean })
|
|
965
|
+
], M.prototype, "value", 2);
|
|
966
|
+
M = X([
|
|
967
|
+
F("cx-asset-link-format-metadata")
|
|
968
|
+
], M);
|
|
969
|
+
var Wt = Object.defineProperty, Ft = Object.getOwnPropertyDescriptor, c = (t, e, i, s) => {
|
|
970
|
+
for (var o = s > 1 ? void 0 : s ? Ft(e, i) : e, r = t.length - 1, n; r >= 0; r--)
|
|
971
|
+
(n = t[r]) && (o = (s ? n(e, i, o) : n(o)) || o);
|
|
972
|
+
return s && o && Wt(e, i, o), o;
|
|
1113
973
|
};
|
|
1114
|
-
let
|
|
974
|
+
let l = class extends H {
|
|
1115
975
|
constructor() {
|
|
1116
|
-
super(), this.localize = new
|
|
976
|
+
super(), this.localize = new E(this), this.baseUrl = void 0, this.token = void 0, this.asset = void 0, this.cropModes = [
|
|
1117
977
|
{
|
|
1118
978
|
label: "Free",
|
|
1119
979
|
value: "free"
|
|
@@ -1172,15 +1032,15 @@ let p = class extends F {
|
|
|
1172
1032
|
label: "Smart Swatch",
|
|
1173
1033
|
value: "SmartSwatch"
|
|
1174
1034
|
}
|
|
1175
|
-
], this.extensions = [], this.proxies = void 0, this.forCropper = void 0, this.useSession = "", this.transformations = [], this.selectedProxy = "", this.useCustomExtension = !1, this.lastImageSize = {
|
|
1035
|
+
], this.extensions = [], this.proxies = void 0, this.forCropper = void 0, this.useSession = "", this.transformations = [], this.selectedProxy = "", this.useCustomExtension = !1, this.noMetadata = !1, this.noCrop = !1, this.noResize = !1, this.noRotate = !1, this.lastImageSize = {
|
|
1176
1036
|
height: 0,
|
|
1177
1037
|
width: 0
|
|
1178
|
-
}, this.hideHeader = !1, this.queryElement = null, this.activeSetting = "cx-asset-link-format-proxy", this.selectedFormat = void 0, this.resizeSize = {
|
|
1038
|
+
}, this.hideHeader = !1, this.canReset = !1, this.queryElement = null, this.activeSetting = "cx-asset-link-format-proxy", this.selectedFormat = void 0, this.resizeSize = {
|
|
1179
1039
|
height: 0,
|
|
1180
1040
|
keepAspectRatio: !0,
|
|
1181
1041
|
ratioHeight: 1,
|
|
1182
1042
|
ratioWidth: 1,
|
|
1183
|
-
unit:
|
|
1043
|
+
unit: a.Pixel,
|
|
1184
1044
|
width: 0
|
|
1185
1045
|
}, this.cropSize = {
|
|
1186
1046
|
cropMode: "free",
|
|
@@ -1191,14 +1051,18 @@ let p = class extends F {
|
|
|
1191
1051
|
percentageWidth: 0,
|
|
1192
1052
|
ratioHeight: 1,
|
|
1193
1053
|
ratioWidth: 1,
|
|
1194
|
-
unit:
|
|
1054
|
+
unit: a.Pixel,
|
|
1195
1055
|
width: 0,
|
|
1196
1056
|
x: 0,
|
|
1197
1057
|
y: 0
|
|
1198
1058
|
}, this.rotation = 0, this.defaultSize = {
|
|
1199
1059
|
height: 0,
|
|
1200
1060
|
width: 0
|
|
1201
|
-
}, this.cropperElement = null, this.parameters = [], this.loading = !1, this.lastAction = void 0, this.frozenIndex = void 0, this.apiGetTransformAssetLink =
|
|
1061
|
+
}, this.cropperElement = null, this.parameters = [], this.loading = !1, this.lastAction = void 0, this.frozenIndex = void 0, this.preResetTransformations = void 0, this.apiGetTransformAssetLink = at, this.apiGetCropFocusMode = ot, this.onCropComplete = this.onCropComplete.bind(this), this.onCropDragStart = this.onCropDragStart.bind(this);
|
|
1062
|
+
}
|
|
1063
|
+
/** True when there are transformations beyond the frozen index (i.e. user has added new ones). */
|
|
1064
|
+
get hasUnfrozenTransformations() {
|
|
1065
|
+
return !(this.transformations.length === 0 || this.frozenIndex !== void 0 && this.frozenIndex >= this.transformations.length - 1);
|
|
1202
1066
|
}
|
|
1203
1067
|
/**
|
|
1204
1068
|
* Checks if the crop apply button should be disabled.
|
|
@@ -1240,25 +1104,25 @@ let p = class extends F {
|
|
|
1240
1104
|
* It returns an object with the last crop size in both pixel and aspect ratio units.
|
|
1241
1105
|
*/
|
|
1242
1106
|
get lastCropSize() {
|
|
1243
|
-
const t =
|
|
1107
|
+
const t = it(
|
|
1244
1108
|
this.lastImageSize.width,
|
|
1245
1109
|
this.lastImageSize.height
|
|
1246
1110
|
);
|
|
1247
1111
|
return {
|
|
1248
|
-
[
|
|
1112
|
+
[a.AspectRatio]: {
|
|
1249
1113
|
height: t.height,
|
|
1250
1114
|
percentageHeight: 100,
|
|
1251
1115
|
percentageWidth: 100,
|
|
1252
|
-
unit:
|
|
1116
|
+
unit: a.AspectRatio,
|
|
1253
1117
|
width: t.width,
|
|
1254
1118
|
x: 0,
|
|
1255
1119
|
y: 0
|
|
1256
1120
|
},
|
|
1257
|
-
[
|
|
1121
|
+
[a.Pixel]: {
|
|
1258
1122
|
height: this.lastImageSize.height,
|
|
1259
1123
|
percentageHeight: 100,
|
|
1260
1124
|
percentageWidth: 100,
|
|
1261
|
-
unit:
|
|
1125
|
+
unit: a.Pixel,
|
|
1262
1126
|
width: this.lastImageSize.width,
|
|
1263
1127
|
x: 0,
|
|
1264
1128
|
y: 0
|
|
@@ -1271,19 +1135,19 @@ let p = class extends F {
|
|
|
1271
1135
|
* It returns an object with the last resize size in both pixel and aspect ratio units.
|
|
1272
1136
|
*/
|
|
1273
1137
|
get lastResizeSize() {
|
|
1274
|
-
const t =
|
|
1138
|
+
const t = it(
|
|
1275
1139
|
this.lastImageSize.width,
|
|
1276
1140
|
this.lastImageSize.height
|
|
1277
1141
|
);
|
|
1278
1142
|
return {
|
|
1279
|
-
[
|
|
1143
|
+
[a.AspectRatio]: {
|
|
1280
1144
|
height: t.height,
|
|
1281
|
-
unit:
|
|
1145
|
+
unit: a.AspectRatio,
|
|
1282
1146
|
width: t.width
|
|
1283
1147
|
},
|
|
1284
|
-
[
|
|
1148
|
+
[a.Pixel]: {
|
|
1285
1149
|
height: this.lastImageSize.height,
|
|
1286
|
-
unit:
|
|
1150
|
+
unit: a.Pixel,
|
|
1287
1151
|
width: this.lastImageSize.width
|
|
1288
1152
|
}
|
|
1289
1153
|
};
|
|
@@ -1292,7 +1156,7 @@ let p = class extends F {
|
|
|
1292
1156
|
* Returns the transformation string for the asset link.
|
|
1293
1157
|
*/
|
|
1294
1158
|
get transformationString() {
|
|
1295
|
-
return
|
|
1159
|
+
return Y({
|
|
1296
1160
|
asset: this.asset,
|
|
1297
1161
|
baseUrl: "",
|
|
1298
1162
|
parameters: this.parameters,
|
|
@@ -1333,7 +1197,7 @@ let p = class extends F {
|
|
|
1333
1197
|
token: this.token,
|
|
1334
1198
|
transformations: this.transformationString
|
|
1335
1199
|
}).then((s) => {
|
|
1336
|
-
this.loading = !1, !(!s?.relativePath || !this.selectedFormat) && (this.lastAction ===
|
|
1200
|
+
this.loading = !1, !(!s?.relativePath || !this.selectedFormat) && (this.lastAction === d.Rotate && (this.rotation = 0), this.lastAction = void 0, this.lastImageSize = {
|
|
1337
1201
|
height: s.height,
|
|
1338
1202
|
width: s.width
|
|
1339
1203
|
}, this.selectedFormat = {
|
|
@@ -1347,7 +1211,7 @@ let p = class extends F {
|
|
|
1347
1211
|
*/
|
|
1348
1212
|
});
|
|
1349
1213
|
});
|
|
1350
|
-
const i =
|
|
1214
|
+
const i = Y({
|
|
1351
1215
|
asset: this.asset,
|
|
1352
1216
|
baseUrl: "",
|
|
1353
1217
|
extension: this.selectedFormat.extension,
|
|
@@ -1373,7 +1237,7 @@ let p = class extends F {
|
|
|
1373
1237
|
if (await this.updateComplete, !this.asset || !this.selectedFormat)
|
|
1374
1238
|
return;
|
|
1375
1239
|
const t = this.proxies?.find(
|
|
1376
|
-
(
|
|
1240
|
+
(r) => r.id === this.selectedProxy
|
|
1377
1241
|
);
|
|
1378
1242
|
this.loading = !0;
|
|
1379
1243
|
const e = await this.apiGetTransformAssetLink({
|
|
@@ -1394,7 +1258,7 @@ let p = class extends F {
|
|
|
1394
1258
|
keepAspectRatio: !0,
|
|
1395
1259
|
ratioHeight: 1,
|
|
1396
1260
|
ratioWidth: 1,
|
|
1397
|
-
unit:
|
|
1261
|
+
unit: a.Pixel,
|
|
1398
1262
|
width: e.width
|
|
1399
1263
|
}, this.cropSize = {
|
|
1400
1264
|
cropMode: "free",
|
|
@@ -1405,18 +1269,21 @@ let p = class extends F {
|
|
|
1405
1269
|
percentageWidth: 100,
|
|
1406
1270
|
ratioHeight: 1,
|
|
1407
1271
|
ratioWidth: 1,
|
|
1408
|
-
unit:
|
|
1272
|
+
unit: a.Pixel,
|
|
1409
1273
|
width: e.width,
|
|
1410
1274
|
x: 0,
|
|
1411
1275
|
y: 0
|
|
1412
|
-
}, this.lastAction ===
|
|
1276
|
+
}, this.lastAction === d.Rotate && (this.rotation = 0), this.lastAction = void 0;
|
|
1413
1277
|
const i = this.transformations.some(
|
|
1414
|
-
(
|
|
1278
|
+
(r) => r.key === d.Metadata
|
|
1279
|
+
), s = this.transformations.findLast(
|
|
1280
|
+
(r) => r.key === d.Quality
|
|
1415
1281
|
);
|
|
1416
1282
|
this.selectedFormat = {
|
|
1417
1283
|
...this.selectedFormat,
|
|
1418
1284
|
height: e.height,
|
|
1419
1285
|
keepMetadata: i,
|
|
1286
|
+
quality: s?.value?.quality ?? this.selectedFormat.quality,
|
|
1420
1287
|
url: this.baseUrl && this.baseUrl.length > 0 ? `${this.baseUrl}/${e.relativePath}` : e.relativePath,
|
|
1421
1288
|
width: e.width
|
|
1422
1289
|
/**
|
|
@@ -1424,7 +1291,7 @@ let p = class extends F {
|
|
|
1424
1291
|
* url: `${this.baseUrl}/${response.relativePath}`,
|
|
1425
1292
|
*/
|
|
1426
1293
|
};
|
|
1427
|
-
const
|
|
1294
|
+
const o = Y({
|
|
1428
1295
|
asset: this.asset,
|
|
1429
1296
|
baseUrl: "",
|
|
1430
1297
|
extension: this.selectedFormat.extension,
|
|
@@ -1433,7 +1300,7 @@ let p = class extends F {
|
|
|
1433
1300
|
useSession: this.useSession
|
|
1434
1301
|
});
|
|
1435
1302
|
this.emit("cx-asset-link-format-change", {
|
|
1436
|
-
detail:
|
|
1303
|
+
detail: o
|
|
1437
1304
|
});
|
|
1438
1305
|
}
|
|
1439
1306
|
handleCropperElementChange() {
|
|
@@ -1456,7 +1323,7 @@ let p = class extends F {
|
|
|
1456
1323
|
width: Number.parseInt(this.asset.width, 10)
|
|
1457
1324
|
});
|
|
1458
1325
|
const t = this.transformations.findLast(
|
|
1459
|
-
(e) => e.key ===
|
|
1326
|
+
(e) => e.key === d.Quality
|
|
1460
1327
|
);
|
|
1461
1328
|
this.selectedFormat = {
|
|
1462
1329
|
extension: this.asset.extension,
|
|
@@ -1482,7 +1349,7 @@ let p = class extends F {
|
|
|
1482
1349
|
percentageWidth: 100,
|
|
1483
1350
|
ratioHeight: 1,
|
|
1484
1351
|
ratioWidth: 1,
|
|
1485
|
-
unit:
|
|
1352
|
+
unit: a.Pixel,
|
|
1486
1353
|
width: this.defaultSize.width,
|
|
1487
1354
|
x: 0,
|
|
1488
1355
|
y: 0
|
|
@@ -1502,25 +1369,25 @@ let p = class extends F {
|
|
|
1502
1369
|
e.proxyName === "TRX" && (e.formatHeight = Number(this.asset.height), e.formatWidth = Number(this.asset.width));
|
|
1503
1370
|
const i = this.proxies?.find((s) => s.id === t);
|
|
1504
1371
|
i && (this.asset && i.proxyName === "TRX" && (i.formatHeight = Number(this.asset.height), i.formatWidth = Number(this.asset.width)), this.transformations = this.transformations.map((s) => {
|
|
1505
|
-
if (s.key ===
|
|
1506
|
-
const
|
|
1372
|
+
if (s.key === d.Crop) {
|
|
1373
|
+
const o = s.value, r = o.width / i.formatWidth * e.formatWidth, n = o.height / i.formatHeight * e.formatHeight, x = o.x / i.formatWidth * e.formatWidth, z = o.y / i.formatHeight * e.formatHeight;
|
|
1507
1374
|
return {
|
|
1508
1375
|
...s,
|
|
1509
1376
|
value: {
|
|
1510
|
-
height:
|
|
1511
|
-
width:
|
|
1512
|
-
x
|
|
1513
|
-
y:
|
|
1377
|
+
height: n,
|
|
1378
|
+
width: r,
|
|
1379
|
+
x,
|
|
1380
|
+
y: z
|
|
1514
1381
|
}
|
|
1515
1382
|
};
|
|
1516
1383
|
}
|
|
1517
|
-
if (s.key ===
|
|
1518
|
-
const
|
|
1384
|
+
if (s.key === d.Resize) {
|
|
1385
|
+
const o = s.value, r = o.width / i.formatWidth * e.formatWidth, n = o.height / i.formatHeight * e.formatHeight;
|
|
1519
1386
|
return {
|
|
1520
1387
|
...s,
|
|
1521
1388
|
value: {
|
|
1522
|
-
height:
|
|
1523
|
-
width:
|
|
1389
|
+
height: n,
|
|
1390
|
+
width: r
|
|
1524
1391
|
}
|
|
1525
1392
|
};
|
|
1526
1393
|
}
|
|
@@ -1535,23 +1402,23 @@ let p = class extends F {
|
|
|
1535
1402
|
}, await this.updateComplete, this.cropSize = {
|
|
1536
1403
|
cropMode: "free",
|
|
1537
1404
|
focusMode: "manual",
|
|
1538
|
-
height: this.lastCropSize[
|
|
1405
|
+
height: this.lastCropSize[a.Pixel].height,
|
|
1539
1406
|
keepAspectRatio: !0,
|
|
1540
1407
|
percentageHeight: 100,
|
|
1541
1408
|
percentageWidth: 100,
|
|
1542
1409
|
ratioHeight: 1,
|
|
1543
1410
|
ratioWidth: 1,
|
|
1544
|
-
unit:
|
|
1545
|
-
width: this.lastCropSize[
|
|
1411
|
+
unit: a.Pixel,
|
|
1412
|
+
width: this.lastCropSize[a.Pixel].width,
|
|
1546
1413
|
x: 0,
|
|
1547
1414
|
y: 0
|
|
1548
1415
|
}, this.resizeSize = {
|
|
1549
|
-
height: this.lastResizeSize[
|
|
1416
|
+
height: this.lastResizeSize[a.Pixel].height,
|
|
1550
1417
|
keepAspectRatio: !0,
|
|
1551
1418
|
ratioHeight: 1,
|
|
1552
1419
|
ratioWidth: 1,
|
|
1553
|
-
unit:
|
|
1554
|
-
width: this.lastResizeSize[
|
|
1420
|
+
unit: a.Pixel,
|
|
1421
|
+
width: this.lastResizeSize[a.Pixel].width
|
|
1555
1422
|
};
|
|
1556
1423
|
}
|
|
1557
1424
|
handleLoadingChange() {
|
|
@@ -1571,12 +1438,12 @@ let p = class extends F {
|
|
|
1571
1438
|
}
|
|
1572
1439
|
handleActiveSettingChange() {
|
|
1573
1440
|
this.cropperElement && (this.resizeSize = {
|
|
1574
|
-
height: this.lastResizeSize[
|
|
1441
|
+
height: this.lastResizeSize[a.Pixel].height,
|
|
1575
1442
|
keepAspectRatio: !0,
|
|
1576
1443
|
ratioHeight: 1,
|
|
1577
1444
|
ratioWidth: 1,
|
|
1578
|
-
unit:
|
|
1579
|
-
width: this.lastResizeSize[
|
|
1445
|
+
unit: a.Pixel,
|
|
1446
|
+
width: this.lastResizeSize[a.Pixel].width
|
|
1580
1447
|
}, this.cropperElement.disabled = this.activeSetting !== "cx-asset-link-format-crop");
|
|
1581
1448
|
}
|
|
1582
1449
|
async handleRequestAutoCropSuggestion({
|
|
@@ -1584,34 +1451,34 @@ let p = class extends F {
|
|
|
1584
1451
|
focusMode: e,
|
|
1585
1452
|
height: i,
|
|
1586
1453
|
keepAspectRatio: s,
|
|
1587
|
-
percentageHeight:
|
|
1588
|
-
percentageWidth:
|
|
1589
|
-
ratioHeight:
|
|
1590
|
-
ratioWidth:
|
|
1591
|
-
unit:
|
|
1592
|
-
useCropMode:
|
|
1593
|
-
width:
|
|
1454
|
+
percentageHeight: o,
|
|
1455
|
+
percentageWidth: r,
|
|
1456
|
+
ratioHeight: n,
|
|
1457
|
+
ratioWidth: x,
|
|
1458
|
+
unit: z,
|
|
1459
|
+
useCropMode: $,
|
|
1460
|
+
width: B
|
|
1594
1461
|
}) {
|
|
1595
1462
|
if (!this.selectedFormat?.url || e === "manual")
|
|
1596
1463
|
return;
|
|
1597
|
-
this.loading = !0, this.lastAction =
|
|
1598
|
-
const
|
|
1464
|
+
this.loading = !0, this.lastAction = d.Crop;
|
|
1465
|
+
const k = await this.apiGetCropFocusMode({
|
|
1599
1466
|
autoCropMode: e,
|
|
1600
1467
|
cropHeight: i,
|
|
1601
|
-
cropWidth:
|
|
1468
|
+
cropWidth: B,
|
|
1602
1469
|
imageUrl: this.selectedFormat.url
|
|
1603
1470
|
});
|
|
1604
|
-
if (
|
|
1605
|
-
let
|
|
1606
|
-
i || (
|
|
1471
|
+
if (k) {
|
|
1472
|
+
let j = o, tt = r;
|
|
1473
|
+
i || (j = k.height * 100 / this.selectedFormat.height), B || (tt = k.width * 100 / this.selectedFormat.width), this.cropSize = {
|
|
1607
1474
|
...this.cropSize,
|
|
1608
|
-
height:
|
|
1609
|
-
percentageHeight:
|
|
1610
|
-
percentageWidth:
|
|
1611
|
-
width:
|
|
1612
|
-
x:
|
|
1613
|
-
y:
|
|
1614
|
-
|
|
1475
|
+
height: k.height,
|
|
1476
|
+
percentageHeight: j ?? this.cropSize.percentageHeight,
|
|
1477
|
+
percentageWidth: tt ?? this.cropSize.percentageWidth,
|
|
1478
|
+
width: k.width,
|
|
1479
|
+
x: k.x * 100 / this.selectedFormat.width,
|
|
1480
|
+
y: k.y * 100 / this.selectedFormat.height,
|
|
1481
|
+
...$ ? {
|
|
1615
1482
|
cropMode: e,
|
|
1616
1483
|
focusMode: "manual",
|
|
1617
1484
|
keepAspectRatio: !1
|
|
@@ -1620,9 +1487,9 @@ let p = class extends F {
|
|
|
1620
1487
|
focusMode: e
|
|
1621
1488
|
},
|
|
1622
1489
|
keepAspectRatio: s ?? this.cropSize.keepAspectRatio,
|
|
1623
|
-
ratioHeight:
|
|
1624
|
-
ratioWidth:
|
|
1625
|
-
unit:
|
|
1490
|
+
ratioHeight: n ?? this.cropSize.ratioHeight,
|
|
1491
|
+
ratioWidth: x ?? this.cropSize.ratioWidth,
|
|
1492
|
+
unit: z ?? this.cropSize.unit
|
|
1626
1493
|
};
|
|
1627
1494
|
}
|
|
1628
1495
|
this.loading = !1, this.lastAction = void 0;
|
|
@@ -1631,33 +1498,33 @@ let p = class extends F {
|
|
|
1631
1498
|
const { croppedArea: e } = t.detail, {
|
|
1632
1499
|
height: i,
|
|
1633
1500
|
width: s,
|
|
1634
|
-
x:
|
|
1635
|
-
y:
|
|
1501
|
+
x: o,
|
|
1502
|
+
y: r
|
|
1636
1503
|
} = e;
|
|
1637
1504
|
if (s === 0 || i === 0)
|
|
1638
1505
|
return;
|
|
1639
|
-
const
|
|
1640
|
-
let
|
|
1641
|
-
|
|
1506
|
+
const n = this.cropSize.percentageWidth !== s, x = this.cropSize.percentageHeight !== i;
|
|
1507
|
+
let z = this.cropSize.height, $ = this.cropSize.width;
|
|
1508
|
+
n && ($ = Math.round(s * this.selectedFormat.width / 100)), x && (z = Math.round(
|
|
1642
1509
|
i * this.selectedFormat.height / 100
|
|
1643
1510
|
));
|
|
1644
|
-
const
|
|
1511
|
+
const B = this.cropSize.focusMode;
|
|
1645
1512
|
this.focusModes.find(
|
|
1646
|
-
(
|
|
1513
|
+
(j) => j.value === B
|
|
1647
1514
|
)?.auto && this.selectedFormat?.url && this.cropperElement ? await this.handleRequestAutoCropSuggestion({
|
|
1648
|
-
focusMode:
|
|
1649
|
-
height:
|
|
1515
|
+
focusMode: B,
|
|
1516
|
+
height: z,
|
|
1650
1517
|
percentageHeight: i,
|
|
1651
1518
|
percentageWidth: s,
|
|
1652
|
-
width:
|
|
1519
|
+
width: $
|
|
1653
1520
|
}) : this.cropSize = {
|
|
1654
1521
|
...this.cropSize,
|
|
1655
|
-
height:
|
|
1522
|
+
height: z,
|
|
1656
1523
|
percentageHeight: i,
|
|
1657
1524
|
percentageWidth: s,
|
|
1658
|
-
width:
|
|
1659
|
-
x:
|
|
1660
|
-
y:
|
|
1525
|
+
width: $,
|
|
1526
|
+
x: o,
|
|
1527
|
+
y: r
|
|
1661
1528
|
};
|
|
1662
1529
|
}
|
|
1663
1530
|
onCropDragStart() {
|
|
@@ -1680,7 +1547,7 @@ let p = class extends F {
|
|
|
1680
1547
|
}
|
|
1681
1548
|
onProxyChange(t) {
|
|
1682
1549
|
const e = t.detail;
|
|
1683
|
-
this.lastAction =
|
|
1550
|
+
this.lastAction = d.Proxy, this.selectedProxy = e.id;
|
|
1684
1551
|
}
|
|
1685
1552
|
async onCropModeChange(t) {
|
|
1686
1553
|
const { mode: e } = t.detail;
|
|
@@ -1691,22 +1558,22 @@ let p = class extends F {
|
|
|
1691
1558
|
});
|
|
1692
1559
|
else {
|
|
1693
1560
|
const s = this.focusModes.find(
|
|
1694
|
-
(
|
|
1561
|
+
(z) => z.value === this.cropSize.focusMode
|
|
1695
1562
|
)?.auto;
|
|
1696
|
-
let
|
|
1697
|
-
e === "free" ? (
|
|
1563
|
+
let o = this.cropSize.keepAspectRatio, r = this.cropSize.focusMode, n = this.cropSize.x, x = this.cropSize.y;
|
|
1564
|
+
e === "free" ? (o = !1, r = "manual") : this.cropSize.unit === a.Pixel && !s && (n = 0, x = 0), s ? await this.handleRequestAutoCropSuggestion({
|
|
1698
1565
|
cropMode: e,
|
|
1699
|
-
focusMode:
|
|
1566
|
+
focusMode: r,
|
|
1700
1567
|
height: this.cropSize.height,
|
|
1701
|
-
keepAspectRatio:
|
|
1568
|
+
keepAspectRatio: o,
|
|
1702
1569
|
width: this.cropSize.width
|
|
1703
1570
|
}) : this.cropSize = {
|
|
1704
1571
|
...this.cropSize,
|
|
1705
1572
|
cropMode: e,
|
|
1706
|
-
focusMode:
|
|
1707
|
-
keepAspectRatio:
|
|
1708
|
-
x:
|
|
1709
|
-
y
|
|
1573
|
+
focusMode: r,
|
|
1574
|
+
keepAspectRatio: o,
|
|
1575
|
+
x: n,
|
|
1576
|
+
y: x
|
|
1710
1577
|
};
|
|
1711
1578
|
}
|
|
1712
1579
|
}
|
|
@@ -1723,52 +1590,52 @@ let p = class extends F {
|
|
|
1723
1590
|
}
|
|
1724
1591
|
async onCropChange(t) {
|
|
1725
1592
|
const e = this.cropSize.unit;
|
|
1726
|
-
if (t.detail.unit ===
|
|
1593
|
+
if (t.detail.unit === a.AspectRatio) {
|
|
1727
1594
|
const i = t.detail.width / t.detail.height, s = Math.min(
|
|
1728
1595
|
Math.max(Math.round(this.cropSize.height * i), 0),
|
|
1729
1596
|
this.resizeSize.width
|
|
1730
|
-
),
|
|
1597
|
+
), o = Math.min(
|
|
1731
1598
|
Math.max(Math.round(s / i), 0),
|
|
1732
1599
|
this.resizeSize.height
|
|
1733
|
-
),
|
|
1734
|
-
let
|
|
1735
|
-
|
|
1736
|
-
let
|
|
1600
|
+
), r = o * 100 / this.selectedFormat.height, n = s * 100 / this.selectedFormat.width;
|
|
1601
|
+
let x = this.cropSize.x, z = this.cropSize.y;
|
|
1602
|
+
x + n > 100 && (x = 100 - n), z + r > 100 && (z = 100 - r);
|
|
1603
|
+
let $ = this.cropSize.cropMode;
|
|
1737
1604
|
this.cropModes.find(
|
|
1738
|
-
(
|
|
1739
|
-
)?.auto && (
|
|
1605
|
+
(k) => k.value === $
|
|
1606
|
+
)?.auto && ($ = "free"), t.detail.silent ? (this.cropSize.height = o, 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 = a.AspectRatio, this.cropSize.width = s) : this.cropSize = {
|
|
1740
1607
|
...this.cropSize,
|
|
1741
|
-
cropMode:
|
|
1742
|
-
height:
|
|
1608
|
+
cropMode: $,
|
|
1609
|
+
height: o,
|
|
1743
1610
|
keepAspectRatio: t.detail.keepAspectRatio,
|
|
1744
|
-
percentageHeight:
|
|
1745
|
-
percentageWidth:
|
|
1611
|
+
percentageHeight: r,
|
|
1612
|
+
percentageWidth: n,
|
|
1746
1613
|
ratioHeight: t.detail.height,
|
|
1747
1614
|
ratioWidth: t.detail.width,
|
|
1748
|
-
unit:
|
|
1615
|
+
unit: a.AspectRatio,
|
|
1749
1616
|
width: s,
|
|
1750
|
-
x
|
|
1751
|
-
y:
|
|
1617
|
+
x,
|
|
1618
|
+
y: z
|
|
1752
1619
|
};
|
|
1753
1620
|
} else {
|
|
1754
1621
|
const i = this.selectedFormat ? t.detail.height * 100 / this.selectedFormat.height : 100, s = this.selectedFormat ? t.detail.width * 100 / this.selectedFormat.width : 100;
|
|
1755
|
-
let
|
|
1756
|
-
|
|
1757
|
-
let
|
|
1758
|
-
const
|
|
1759
|
-
(
|
|
1622
|
+
let o = this.cropSize.x, r = this.cropSize.y;
|
|
1623
|
+
o + s > 100 && (o = 100 - s), r + i > 100 && (r = 100 - i);
|
|
1624
|
+
let n = this.cropSize.cropMode;
|
|
1625
|
+
const x = this.cropModes.find(
|
|
1626
|
+
(z) => z.value === n
|
|
1760
1627
|
)?.auto;
|
|
1761
|
-
(t.detail.breakAspectRatio ||
|
|
1628
|
+
(t.detail.breakAspectRatio || x) && (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 = a.Pixel, this.cropSize.width = t.detail.width, this.cropSize.x = o, this.cropSize.y = r) : this.cropSize = {
|
|
1762
1629
|
...this.cropSize,
|
|
1763
|
-
cropMode:
|
|
1630
|
+
cropMode: n,
|
|
1764
1631
|
height: t.detail.height,
|
|
1765
1632
|
keepAspectRatio: t.detail.keepAspectRatio,
|
|
1766
1633
|
percentageHeight: i,
|
|
1767
1634
|
percentageWidth: s,
|
|
1768
|
-
unit:
|
|
1635
|
+
unit: a.Pixel,
|
|
1769
1636
|
width: t.detail.width,
|
|
1770
|
-
x:
|
|
1771
|
-
y:
|
|
1637
|
+
x: o,
|
|
1638
|
+
y: r
|
|
1772
1639
|
};
|
|
1773
1640
|
}
|
|
1774
1641
|
e !== this.cropSize.unit && (this.cropSize = {
|
|
@@ -1786,34 +1653,34 @@ let p = class extends F {
|
|
|
1786
1653
|
});
|
|
1787
1654
|
}
|
|
1788
1655
|
onCropApply(t) {
|
|
1789
|
-
const { height: e, mode: i, unit: s, width:
|
|
1790
|
-
if (this.lastAction =
|
|
1791
|
-
if (e &&
|
|
1792
|
-
let
|
|
1793
|
-
if (s ===
|
|
1656
|
+
const { height: e, mode: i, unit: s, width: o } = t.detail;
|
|
1657
|
+
if (this.preResetTransformations = void 0, this.lastAction = d.Crop, !(!this.cropperElement || !this.selectedFormat))
|
|
1658
|
+
if (e && o && s) {
|
|
1659
|
+
let r = o, n = e;
|
|
1660
|
+
if (s === a.AspectRatio && (r = this.cropSize.percentageWidth * this.selectedFormat.width / 100, n = this.cropSize.percentageHeight * this.selectedFormat.height / 100), i)
|
|
1794
1661
|
this.transformations = [
|
|
1795
1662
|
...this.transformations,
|
|
1796
1663
|
{
|
|
1797
|
-
key:
|
|
1664
|
+
key: d.Crop,
|
|
1798
1665
|
value: {
|
|
1799
|
-
height:
|
|
1666
|
+
height: n,
|
|
1800
1667
|
mode: i,
|
|
1801
|
-
width:
|
|
1668
|
+
width: r
|
|
1802
1669
|
}
|
|
1803
1670
|
}
|
|
1804
1671
|
];
|
|
1805
1672
|
else {
|
|
1806
|
-
const
|
|
1673
|
+
const x = this.cropSize.x / 100 * this.selectedFormat.width, z = this.cropSize.y / 100 * this.selectedFormat.height;
|
|
1807
1674
|
this.transformations = [
|
|
1808
1675
|
...this.transformations,
|
|
1809
1676
|
{
|
|
1810
|
-
key:
|
|
1677
|
+
key: d.Crop,
|
|
1811
1678
|
value: {
|
|
1812
|
-
height:
|
|
1679
|
+
height: n,
|
|
1813
1680
|
unit: s,
|
|
1814
|
-
width:
|
|
1815
|
-
x
|
|
1816
|
-
y:
|
|
1681
|
+
width: r,
|
|
1682
|
+
x,
|
|
1683
|
+
y: z
|
|
1817
1684
|
}
|
|
1818
1685
|
}
|
|
1819
1686
|
];
|
|
@@ -1821,7 +1688,7 @@ let p = class extends F {
|
|
|
1821
1688
|
} else i && (this.transformations = [
|
|
1822
1689
|
...this.transformations,
|
|
1823
1690
|
{
|
|
1824
|
-
key:
|
|
1691
|
+
key: d.Crop,
|
|
1825
1692
|
value: {
|
|
1826
1693
|
mode: i
|
|
1827
1694
|
}
|
|
@@ -1829,9 +1696,9 @@ let p = class extends F {
|
|
|
1829
1696
|
]);
|
|
1830
1697
|
}
|
|
1831
1698
|
onResizeChange(t) {
|
|
1832
|
-
if (t.detail.unit ===
|
|
1699
|
+
if (t.detail.unit === a.AspectRatio) {
|
|
1833
1700
|
const e = t.detail.width / t.detail.height, i = Math.max(
|
|
1834
|
-
Math.round(this.lastResizeSize[
|
|
1701
|
+
Math.round(this.lastResizeSize[a.Pixel].height * e),
|
|
1835
1702
|
0
|
|
1836
1703
|
), s = Math.max(Math.round(i / e), 0);
|
|
1837
1704
|
this.resizeSize = {
|
|
@@ -1856,17 +1723,17 @@ let p = class extends F {
|
|
|
1856
1723
|
if (!this.selectedFormat)
|
|
1857
1724
|
return;
|
|
1858
1725
|
const { height: e, unit: i, width: s } = t.detail;
|
|
1859
|
-
this.lastAction =
|
|
1860
|
-
const
|
|
1861
|
-
let
|
|
1862
|
-
this.resizeSize.unit !== i ? (
|
|
1726
|
+
this.preResetTransformations = void 0, this.lastAction = d.Resize;
|
|
1727
|
+
const o = this.selectedFormat.width || this.defaultSize.width, r = this.selectedFormat.height || this.defaultSize.height;
|
|
1728
|
+
let n = s, x = e;
|
|
1729
|
+
this.resizeSize.unit !== i ? (n = o, x = r) : i === a.AspectRatio && (n = Math.round(s / e * r), x = r), this.transformations = [
|
|
1863
1730
|
...this.transformations,
|
|
1864
1731
|
{
|
|
1865
|
-
key:
|
|
1732
|
+
key: d.Resize,
|
|
1866
1733
|
value: {
|
|
1867
|
-
height:
|
|
1734
|
+
height: x,
|
|
1868
1735
|
unit: i,
|
|
1869
|
-
width:
|
|
1736
|
+
width: n
|
|
1870
1737
|
}
|
|
1871
1738
|
}
|
|
1872
1739
|
];
|
|
@@ -1878,10 +1745,10 @@ let p = class extends F {
|
|
|
1878
1745
|
if (!this.selectedFormat)
|
|
1879
1746
|
return;
|
|
1880
1747
|
const e = t.detail;
|
|
1881
|
-
this.lastAction =
|
|
1748
|
+
this.preResetTransformations = void 0, this.lastAction = d.Rotate, this.transformations = [
|
|
1882
1749
|
...this.transformations,
|
|
1883
1750
|
{
|
|
1884
|
-
key:
|
|
1751
|
+
key: d.Rotate,
|
|
1885
1752
|
value: {
|
|
1886
1753
|
rotation: e
|
|
1887
1754
|
}
|
|
@@ -1892,10 +1759,10 @@ let p = class extends F {
|
|
|
1892
1759
|
if (!this.selectedFormat)
|
|
1893
1760
|
return;
|
|
1894
1761
|
const e = t.detail;
|
|
1895
|
-
this.selectedFormat.quality = e, this.lastAction =
|
|
1762
|
+
this.selectedFormat.quality = e, this.preResetTransformations = void 0, this.lastAction = d.Quality, this.transformations = [
|
|
1896
1763
|
...this.transformations,
|
|
1897
1764
|
{
|
|
1898
|
-
key:
|
|
1765
|
+
key: d.Quality,
|
|
1899
1766
|
value: {
|
|
1900
1767
|
quality: e
|
|
1901
1768
|
}
|
|
@@ -1906,21 +1773,21 @@ let p = class extends F {
|
|
|
1906
1773
|
if (!this.selectedFormat)
|
|
1907
1774
|
return;
|
|
1908
1775
|
const e = t.detail;
|
|
1909
|
-
this.selectedFormat = {
|
|
1776
|
+
this.preResetTransformations = void 0, this.selectedFormat = {
|
|
1910
1777
|
...this.selectedFormat,
|
|
1911
1778
|
keepMetadata: e
|
|
1912
1779
|
}, e ? this.transformations = [
|
|
1913
1780
|
...this.transformations.filter(
|
|
1914
|
-
(i) => i.key !==
|
|
1781
|
+
(i) => i.key !== d.Metadata
|
|
1915
1782
|
),
|
|
1916
1783
|
{
|
|
1917
|
-
key:
|
|
1784
|
+
key: d.Metadata,
|
|
1918
1785
|
value: {
|
|
1919
1786
|
keepMetadata: e
|
|
1920
1787
|
}
|
|
1921
1788
|
}
|
|
1922
1789
|
] : this.transformations = this.transformations.filter(
|
|
1923
|
-
(i) => i.key !==
|
|
1790
|
+
(i) => i.key !== d.Metadata
|
|
1924
1791
|
);
|
|
1925
1792
|
}
|
|
1926
1793
|
onExtensionChange(t) {
|
|
@@ -1932,130 +1799,168 @@ let p = class extends F {
|
|
|
1932
1799
|
extension: e
|
|
1933
1800
|
};
|
|
1934
1801
|
}
|
|
1935
|
-
|
|
1936
|
-
this.transformations = this.transformations.slice(0, -1);
|
|
1802
|
+
syncQuality() {
|
|
1937
1803
|
const t = this.transformations.findLast(
|
|
1938
|
-
(e) => e.key ===
|
|
1804
|
+
(e) => e.key === d.Quality
|
|
1939
1805
|
)?.value?.quality;
|
|
1940
1806
|
this.selectedFormat && (this.selectedFormat = {
|
|
1941
1807
|
...this.selectedFormat,
|
|
1942
1808
|
quality: t ?? 100
|
|
1943
1809
|
});
|
|
1944
1810
|
}
|
|
1811
|
+
handleUndo() {
|
|
1812
|
+
!this.hasUnfrozenTransformations && this.preResetTransformations !== void 0 ? (this.transformations = this.preResetTransformations, this.preResetTransformations = void 0) : this.transformations = this.transformations.slice(0, -1), this.syncQuality();
|
|
1813
|
+
}
|
|
1814
|
+
handleReset() {
|
|
1815
|
+
this.preResetTransformations = [...this.transformations], this.transformations = [], this.frozenIndex = -1, this.syncQuality();
|
|
1816
|
+
}
|
|
1945
1817
|
render() {
|
|
1946
|
-
return
|
|
1818
|
+
return m`<div class="asset-link-format" @cx-show=${this.onDetailsShow} @cx-hide=${this.onDetailsHide}>${C(
|
|
1947
1819
|
!this.hideHeader,
|
|
1948
|
-
() =>
|
|
1949
|
-
() =>
|
|
1950
|
-
)}<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 ===
|
|
1820
|
+
() => m`<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>${C(this.canReset, () => m`<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>`,
|
|
1821
|
+
() => rt
|
|
1822
|
+
)}<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 === d.Proxy} @cx-asset-link-format-proxy-change=${this.onProxyChange}></cx-asset-link-format-proxy>${C(
|
|
1823
|
+
!this.noCrop,
|
|
1824
|
+
() => m`<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 === d.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.lastResizeSize[a.Pixel].width} max-height=${this.lastResizeSize[a.Pixel].height} 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>`
|
|
1825
|
+
)}
|
|
1826
|
+
${C(
|
|
1827
|
+
!this.noResize,
|
|
1828
|
+
() => m`<cx-asset-link-format-resize class="asset-link-format__details" ?open=${this.activeSetting === "cx-asset-link-format-resize"} ?loading=${this.loading && this.lastAction === d.Resize} ?keep-aspect-ratio=${this.resizeSize.keepAspectRatio} width=${this.resizeSize.width} height=${this.resizeSize.height} max-width=${this.imageSize.width} max-height=${this.imageSize.height} 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>`
|
|
1829
|
+
)}
|
|
1830
|
+
${C(
|
|
1831
|
+
!this.noRotate,
|
|
1832
|
+
() => m`<cx-asset-link-format-rotation class="asset-link-format__details" ?loading=${this.loading && this.lastAction === d.Rotate} ?open=${this.activeSetting === "cx-asset-link-format-rotation"} default-value=${this.selectedFormat?.rotation ?? 0} value=${this.rotation} @cx-asset-link-format-rotation-change=${this.onRotationChange} @cx-asset-link-format-rotation-apply=${this.onRotationApply}></cx-asset-link-format-rotation>`
|
|
1833
|
+
)}<cx-asset-link-format-quality class="asset-link-format__details" ?loading=${this.loading && this.lastAction === d.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>${C(
|
|
1834
|
+
!this.noMetadata,
|
|
1835
|
+
() => m`<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>`
|
|
1836
|
+
)}
|
|
1837
|
+
${C(
|
|
1951
1838
|
this.useCustomExtension,
|
|
1952
|
-
() =>
|
|
1839
|
+
() => m`<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>`
|
|
1953
1840
|
)}</div>`;
|
|
1954
1841
|
}
|
|
1955
1842
|
};
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
"cx-asset-link-format-crop":
|
|
1959
|
-
"cx-asset-link-format-extension":
|
|
1960
|
-
"cx-asset-link-format-metadata":
|
|
1961
|
-
"cx-asset-link-format-proxy":
|
|
1962
|
-
"cx-asset-link-format-quality":
|
|
1963
|
-
"cx-asset-link-format-resize":
|
|
1964
|
-
"cx-asset-link-format-rotation":
|
|
1965
|
-
"cx-button":
|
|
1966
|
-
"cx-space":
|
|
1967
|
-
"cx-typography":
|
|
1843
|
+
l.styles = [W, pt];
|
|
1844
|
+
l.dependencies = {
|
|
1845
|
+
"cx-asset-link-format-crop": p,
|
|
1846
|
+
"cx-asset-link-format-extension": O,
|
|
1847
|
+
"cx-asset-link-format-metadata": M,
|
|
1848
|
+
"cx-asset-link-format-proxy": w,
|
|
1849
|
+
"cx-asset-link-format-quality": b,
|
|
1850
|
+
"cx-asset-link-format-resize": g,
|
|
1851
|
+
"cx-asset-link-format-rotation": v,
|
|
1852
|
+
"cx-button": U,
|
|
1853
|
+
"cx-space": P,
|
|
1854
|
+
"cx-typography": _
|
|
1968
1855
|
};
|
|
1969
|
-
|
|
1970
|
-
|
|
1971
|
-
],
|
|
1972
|
-
|
|
1973
|
-
|
|
1974
|
-
],
|
|
1975
|
-
|
|
1976
|
-
|
|
1977
|
-
],
|
|
1978
|
-
|
|
1979
|
-
|
|
1980
|
-
],
|
|
1981
|
-
|
|
1982
|
-
|
|
1983
|
-
],
|
|
1984
|
-
|
|
1985
|
-
|
|
1986
|
-
],
|
|
1987
|
-
|
|
1988
|
-
|
|
1989
|
-
],
|
|
1990
|
-
|
|
1991
|
-
|
|
1992
|
-
],
|
|
1993
|
-
|
|
1994
|
-
|
|
1995
|
-
],
|
|
1996
|
-
|
|
1997
|
-
|
|
1998
|
-
],
|
|
1999
|
-
|
|
2000
|
-
|
|
2001
|
-
],
|
|
2002
|
-
|
|
2003
|
-
|
|
2004
|
-
],
|
|
2005
|
-
|
|
2006
|
-
|
|
2007
|
-
],
|
|
2008
|
-
|
|
2009
|
-
|
|
2010
|
-
],
|
|
2011
|
-
|
|
2012
|
-
|
|
2013
|
-
],
|
|
2014
|
-
|
|
2015
|
-
|
|
2016
|
-
],
|
|
2017
|
-
|
|
2018
|
-
|
|
2019
|
-
],
|
|
2020
|
-
|
|
2021
|
-
|
|
2022
|
-
],
|
|
2023
|
-
|
|
2024
|
-
|
|
2025
|
-
],
|
|
2026
|
-
|
|
2027
|
-
|
|
2028
|
-
],
|
|
2029
|
-
|
|
2030
|
-
|
|
2031
|
-
],
|
|
2032
|
-
|
|
2033
|
-
|
|
2034
|
-
],
|
|
2035
|
-
|
|
2036
|
-
|
|
2037
|
-
],
|
|
2038
|
-
|
|
2039
|
-
|
|
2040
|
-
],
|
|
2041
|
-
|
|
2042
|
-
|
|
2043
|
-
],
|
|
2044
|
-
|
|
2045
|
-
|
|
2046
|
-
],
|
|
2047
|
-
|
|
2048
|
-
|
|
2049
|
-
],
|
|
2050
|
-
|
|
2051
|
-
|
|
2052
|
-
],
|
|
2053
|
-
|
|
2054
|
-
|
|
2055
|
-
],
|
|
2056
|
-
|
|
2057
|
-
|
|
2058
|
-
],
|
|
1856
|
+
c([
|
|
1857
|
+
h({ attribute: "base-url", type: String })
|
|
1858
|
+
], l.prototype, "baseUrl", 2);
|
|
1859
|
+
c([
|
|
1860
|
+
h({ attribute: "token", type: String })
|
|
1861
|
+
], l.prototype, "token", 2);
|
|
1862
|
+
c([
|
|
1863
|
+
h({ reflect: !1, type: Object })
|
|
1864
|
+
], l.prototype, "asset", 2);
|
|
1865
|
+
c([
|
|
1866
|
+
h({ attribute: "crop-modes", reflect: !1, type: Array })
|
|
1867
|
+
], l.prototype, "cropModes", 2);
|
|
1868
|
+
c([
|
|
1869
|
+
h({ attribute: "focus-modes", reflect: !1, type: Object })
|
|
1870
|
+
], l.prototype, "focusModes", 2);
|
|
1871
|
+
c([
|
|
1872
|
+
h({ reflect: !1, type: Array })
|
|
1873
|
+
], l.prototype, "extensions", 2);
|
|
1874
|
+
c([
|
|
1875
|
+
h({ reflect: !1, type: Array })
|
|
1876
|
+
], l.prototype, "proxies", 2);
|
|
1877
|
+
c([
|
|
1878
|
+
h({ attribute: "for-cropper", reflect: !0, type: String })
|
|
1879
|
+
], l.prototype, "forCropper", 2);
|
|
1880
|
+
c([
|
|
1881
|
+
h({ attribute: "use-session", reflect: !0, type: String })
|
|
1882
|
+
], l.prototype, "useSession", 2);
|
|
1883
|
+
c([
|
|
1884
|
+
h({ reflect: !1, type: Array })
|
|
1885
|
+
], l.prototype, "transformations", 2);
|
|
1886
|
+
c([
|
|
1887
|
+
h({ attribute: "selected-proxy", reflect: !0, type: String })
|
|
1888
|
+
], l.prototype, "selectedProxy", 2);
|
|
1889
|
+
c([
|
|
1890
|
+
h({ attribute: "use-custom-extension", reflect: !0, type: Boolean })
|
|
1891
|
+
], l.prototype, "useCustomExtension", 2);
|
|
1892
|
+
c([
|
|
1893
|
+
h({ attribute: "no-metadata", reflect: !0, type: Boolean })
|
|
1894
|
+
], l.prototype, "noMetadata", 2);
|
|
1895
|
+
c([
|
|
1896
|
+
h({ attribute: "no-crop", reflect: !0, type: Boolean })
|
|
1897
|
+
], l.prototype, "noCrop", 2);
|
|
1898
|
+
c([
|
|
1899
|
+
h({ attribute: "no-resize", reflect: !0, type: Boolean })
|
|
1900
|
+
], l.prototype, "noResize", 2);
|
|
1901
|
+
c([
|
|
1902
|
+
h({ attribute: "no-rotate", reflect: !0, type: Boolean })
|
|
1903
|
+
], l.prototype, "noRotate", 2);
|
|
1904
|
+
c([
|
|
1905
|
+
h({ attribute: "last-image-size", reflect: !1, type: Object })
|
|
1906
|
+
], l.prototype, "lastImageSize", 2);
|
|
1907
|
+
c([
|
|
1908
|
+
h({ attribute: "hide-header", reflect: !1, type: Boolean })
|
|
1909
|
+
], l.prototype, "hideHeader", 2);
|
|
1910
|
+
c([
|
|
1911
|
+
h({ attribute: "can-reset", type: Boolean })
|
|
1912
|
+
], l.prototype, "canReset", 2);
|
|
1913
|
+
c([
|
|
1914
|
+
h({ attribute: !1, reflect: !1, type: Object })
|
|
1915
|
+
], l.prototype, "queryElement", 2);
|
|
1916
|
+
c([
|
|
1917
|
+
f()
|
|
1918
|
+
], l.prototype, "activeSetting", 2);
|
|
1919
|
+
c([
|
|
1920
|
+
f()
|
|
1921
|
+
], l.prototype, "selectedFormat", 2);
|
|
1922
|
+
c([
|
|
1923
|
+
f()
|
|
1924
|
+
], l.prototype, "resizeSize", 2);
|
|
1925
|
+
c([
|
|
1926
|
+
f()
|
|
1927
|
+
], l.prototype, "cropSize", 2);
|
|
1928
|
+
c([
|
|
1929
|
+
f()
|
|
1930
|
+
], l.prototype, "rotation", 2);
|
|
1931
|
+
c([
|
|
1932
|
+
f()
|
|
1933
|
+
], l.prototype, "defaultSize", 2);
|
|
1934
|
+
c([
|
|
1935
|
+
f()
|
|
1936
|
+
], l.prototype, "cropperElement", 2);
|
|
1937
|
+
c([
|
|
1938
|
+
f()
|
|
1939
|
+
], l.prototype, "parameters", 2);
|
|
1940
|
+
c([
|
|
1941
|
+
f()
|
|
1942
|
+
], l.prototype, "loading", 2);
|
|
1943
|
+
c([
|
|
1944
|
+
f()
|
|
1945
|
+
], l.prototype, "lastAction", 2);
|
|
1946
|
+
c([
|
|
1947
|
+
f()
|
|
1948
|
+
], l.prototype, "frozenIndex", 2);
|
|
1949
|
+
c([
|
|
1950
|
+
f()
|
|
1951
|
+
], l.prototype, "preResetTransformations", 2);
|
|
1952
|
+
c([
|
|
1953
|
+
S(["transformations"])
|
|
1954
|
+
], l.prototype, "handleTransformationsChange", 1);
|
|
1955
|
+
c([
|
|
1956
|
+
S("selectedProxy")
|
|
1957
|
+
], l.prototype, "handleSelectedProxyChange", 1);
|
|
1958
|
+
c([
|
|
1959
|
+
S("loading")
|
|
1960
|
+
], l.prototype, "handleLoadingChange", 1);
|
|
1961
|
+
l = c([
|
|
1962
|
+
F("cx-asset-link-format")
|
|
1963
|
+
], l);
|
|
2059
1964
|
export {
|
|
2060
|
-
|
|
1965
|
+
l as default
|
|
2061
1966
|
};
|