@orangelogic/design-system 3.10.0 → 3.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/library/chunks/{asset-link-format.BLKOUD2l.js → asset-link-format.CxDu37Om.js} +591 -588
- package/library/chunks/{button.w0zH5Ivx.js → button.-Jl_NdgM.js} +1 -1
- package/library/chunks/{color-swatch-group.Bvq6xkM-.js → color-swatch-group.DGPlxYsp.js} +8 -8
- package/library/chunks/{color-swatch.Caved2kL.js → color-swatch.Dc-IqxsX.js} +1 -1
- package/library/chunks/{confirm-popover.BpYjy5nJ.js → confirm-popover.mgYIjZdo.js} +3 -3
- package/library/chunks/{dialog.ICoCAj6Z.js → dialog.YFc-HBc5.js} +2 -2
- package/library/chunks/{document-viewer.CRMRT7Ou.js → document-viewer.DhJ4jBNe.js} +6 -6
- package/library/chunks/{dot-pagination.CzVpiv00.js → dot-pagination.BgETAL2j.js} +1 -1
- package/library/chunks/{folder-select.CP0NPc0S.js → folder-select.Hl51n0ge.js} +4 -4
- package/library/chunks/{header.BQg_JjHw.js → header.BeZml2NV.js} +2 -2
- package/library/chunks/{i18n.BA19xtyU.js → i18n.CNnI4-0K.js} +4 -0
- package/library/chunks/{icon-button.BWJ1Vqn5.js → icon-button.ENVA7x3u.js} +1 -1
- package/library/chunks/{iframe.Dm-nXSBv.js → iframe.Cgy_DE7W.js} +1 -1
- package/library/chunks/{image.BsLsWySo.js → image.1ufrCtW1.js} +1 -1
- package/library/chunks/{index.CExDr5Lh.js → index.BAJfz5QI.js} +584 -619
- package/library/chunks/{input.D1TGTsxj.js → input.BJ5LN8of.js} +1 -1
- package/library/chunks/{markdown.CnX2rNeb.js → markdown.CrIkpd0h.js} +2 -2
- package/library/chunks/{menu-item.uFqeX_J6.js → menu-item.DfsfX25P.js} +1 -1
- package/library/chunks/{option.jeaj7_Lr.js → option.B34is9Z5.js} +1 -1
- package/library/chunks/{pagination.DDW-Lw16.js → pagination.DMAcWRyI.js} +5 -5
- package/library/chunks/{tab-group.Dpj7Lx8_.js → tab-group.D14m1Kel.js} +4 -4
- package/library/chunks/{tree.DYFFjW1-.js → tree.BEFWro0D.js} +1 -1
- package/library/chunks/{types.CQDQXXnW.js → types.D0NvE1EB.js} +21492 -21290
- package/library/components/alert.js +2 -2
- package/library/components/asset-link-format.js +3 -3
- package/library/components/atoms.js +15 -15
- package/library/components/audio.js +2 -2
- package/library/components/border-input-group.js +2 -2
- package/library/components/breadcrumb.js +1 -1
- package/library/components/button.js +2 -2
- package/library/components/color-picker.js +3 -3
- package/library/components/color-swatch-group.js +3 -3
- 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 +3 -3
- package/library/components/date-calendar.js +1 -1
- package/library/components/details.js +1 -1
- package/library/components/dialog.js +3 -3
- package/library/components/document-viewer.js +3 -3
- package/library/components/dot-pagination.js +2 -2
- package/library/components/drawer.js +2 -2
- package/library/components/dropdown.js +2 -2
- package/library/components/dynamic-select.js +4 -4
- package/library/components/e-chart.js +1 -1
- package/library/components/element-clamp.js +2 -2
- package/library/components/file-on-demand.js +9 -9
- package/library/components/folder-select.js +4 -4
- package/library/components/format-bytes.js +1 -1
- package/library/components/format-date.js +1 -1
- package/library/components/format-number.js +1 -1
- package/library/components/format-time.js +1 -1
- package/library/components/header.js +2 -2
- package/library/components/icon-button.js +2 -2
- package/library/components/iframe.js +2 -2
- package/library/components/image-comparer.js +1 -1
- package/library/components/image.js +2 -2
- package/library/components/input.js +2 -2
- package/library/components/line-clamp.js +1 -1
- package/library/components/markdown.js +3 -3
- package/library/components/masonry.js +2 -2
- package/library/components/menu-item.js +2 -2
- package/library/components/menu.js +2 -2
- package/library/components/molecules.js +3 -3
- package/library/components/option.js +2 -2
- package/library/components/organisms.js +2 -2
- package/library/components/padding-input-group.js +1 -1
- package/library/components/pagination.js +6 -6
- package/library/components/popup.js +1 -1
- package/library/components/position-picker.js +1 -1
- package/library/components/progress-bar.js +1 -1
- package/library/components/progress-ring.js +1 -1
- package/library/components/range.js +1 -1
- package/library/components/rating.js +1 -1
- package/library/components/relative-time.js +1 -1
- package/library/components/select.js +2 -2
- package/library/components/shadow-input-group.js +1 -1
- package/library/components/share-option-list.js +1 -1
- package/library/components/sidebar.js +1 -1
- package/library/components/size-input-group.js +3 -3
- package/library/components/spinner.js +1 -1
- package/library/components/split-panel.js +1 -1
- package/library/components/tab-group.js +5 -5
- package/library/components/tab.js +2 -2
- package/library/components/tag.js +2 -2
- package/library/components/tooltip.js +1 -1
- package/library/components/tree-item.js +2 -2
- package/library/components/tree.js +2 -2
- package/library/components/typeface.js +2 -2
- package/library/components/types.js +328 -327
- package/library/components/video.js +2 -2
- package/library/package.json +1 -1
- package/library/packages/events/src/cx-publish-page-cancel.d.ts +6 -0
- package/library/packages/events/src/cx-publish-page-submit.d.ts +9 -0
- package/library/packages/events/src/cx-view-and-sort-action-click.d.ts +11 -0
- package/library/packages/events/src/events.d.ts +3 -0
- package/library/packages/molecules/src/index.d.ts +1 -0
- package/library/packages/molecules/src/publish-page/publish-page.d.ts +169 -0
- package/library/packages/molecules/src/publish-page/publish-page.styles.d.ts +2 -0
- package/library/packages/molecules/src/view-and-sort/view-and-sort.d.ts +7 -0
- package/library/packages/organisms/src/content-builder/components/config-manager/config-manager.d.ts +0 -25
- package/library/packages/organisms/src/content-builder/components/gallery-picker/gallery-picker.d.ts +8 -0
- package/library/packages/organisms/src/content-builder/content-builder.d.ts +39 -25
- package/library/packages/organisms/src/content-builder/plugins/plugin-factory.d.ts +0 -5
- package/library/packages/organisms/src/content-builder/styleController.d.ts +1 -1
- package/library/packages/organisms/src/dam-custom-toolbar-buttons-editor/dam-custom-toolbar-buttons-editor.d.ts +11 -1
- package/library/packages/organisms/src/template-switcher/template-switcher-example.data.d.ts +1 -0
- package/library/packages/organisms/src/template-switcher/template-switcher.d.ts +3 -0
- package/library/packages/tools/src/fetch-image/fetch-image.d.ts +10 -0
- package/library/packages/tools/src/tiptap/utils/md/schema.d.ts +1 -1
- package/library/packages/types/src/content-builder.d.ts +0 -5
- package/library/react-web-component.d.ts +116 -13
- package/library/utils.js +1 -1
- package/package.json +1 -1
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import "../components/cropper.js";
|
|
2
|
-
import { C as Y } from "./button.
|
|
2
|
+
import { C as Y } from "./button.-Jl_NdgM.js";
|
|
3
3
|
import B from "../components/space.js";
|
|
4
4
|
import { C as q } from "./typography.IqHbnd3C.js";
|
|
5
5
|
import { n as h, C as j } from "./lib-cortex-element.CVMmyPMC.js";
|
|
6
|
-
import { h as E, a as Ut, C as Bt, S as
|
|
6
|
+
import { h as E, a as Ut, C as Bt, S as Jt, b as te, c as ee, d as ie } from "./endpoints.mJ5S-tIs.js";
|
|
7
7
|
import "./browser.BHOCIF_A.js";
|
|
8
|
-
import { i as V, x as
|
|
8
|
+
import { i as V, x as b, E as qt } from "./lit-element.jLBm65_O.js";
|
|
9
9
|
import "./form.C8LMdQB4.js";
|
|
10
|
-
import { L as G } from "./i18n.
|
|
11
|
-
import { a as
|
|
10
|
+
import { L as G } from "./i18n.CNnI4-0K.js";
|
|
11
|
+
import { a as se } from "./string.Demn8Xmk.js";
|
|
12
12
|
import "./date-picker.BGHn6qg8.js";
|
|
13
|
-
import { a as Tt, r as jt, b as
|
|
13
|
+
import { a as Tt, r as jt, b as ae, c as oe, d as re, e as lt } from "./transformation.D27sTUdZ.js";
|
|
14
14
|
import "./unsafe-html.Dff7-rCx.js";
|
|
15
|
-
import { b as
|
|
15
|
+
import { b as ne } from "./_baseUniq.lwMgmtt2.js";
|
|
16
16
|
import { c as Q } from "./component.styles.CRO4Odto.js";
|
|
17
|
-
import { M as ct, U as
|
|
18
|
-
import { v as
|
|
17
|
+
import { M as ct, U as o, T as f } from "./asset-link-format.ClaYu_v8.js";
|
|
18
|
+
import { v as he } from "./v4.CKZ6klMF.js";
|
|
19
19
|
import { P as N } from "./position-picker.DjnhxIKF.js";
|
|
20
20
|
import { c as X } from "./custom-element.L4WJXn1j.js";
|
|
21
21
|
import { w as P } from "./watch.DJF5K-8U.js";
|
|
@@ -25,25 +25,25 @@ import { n as M } from "./when.Dr1es41R.js";
|
|
|
25
25
|
import st from "../components/details.js";
|
|
26
26
|
import Vt from "../components/divider.js";
|
|
27
27
|
import { C as at } from "./icon.CpHbi8tH.js";
|
|
28
|
-
import { C as $t } from "./icon-button.
|
|
29
|
-
import { C as Pt } from "./input.
|
|
30
|
-
import { C as vt } from "./option.
|
|
28
|
+
import { C as $t } from "./icon-button.ENVA7x3u.js";
|
|
29
|
+
import { C as Pt } from "./input.BJ5LN8of.js";
|
|
30
|
+
import { C as vt } from "./option.B34is9Z5.js";
|
|
31
31
|
import zt from "../components/select.js";
|
|
32
|
-
import
|
|
33
|
-
import { c as
|
|
32
|
+
import le from "../components/position-picker.js";
|
|
33
|
+
import { c as ce } from "./image.Y5c_hFx8.js";
|
|
34
34
|
import { e as J } from "./query.BBf1UFkC.js";
|
|
35
35
|
import { c as ot } from "./repeat.CFjcER6_.js";
|
|
36
36
|
import { o as O } from "./style-map.llVFPd__.js";
|
|
37
37
|
import Gt from "../components/tooltip.js";
|
|
38
|
-
import
|
|
39
|
-
import
|
|
40
|
-
function
|
|
41
|
-
return t && t.length ?
|
|
38
|
+
import pe from "../components/button-group.js";
|
|
39
|
+
import de from "../components/checkbox.js";
|
|
40
|
+
function ue(t) {
|
|
41
|
+
return t && t.length ? ne(t) : [];
|
|
42
42
|
}
|
|
43
43
|
function Qt(t) {
|
|
44
44
|
return typeof t == "object" && t !== null && "URI" in t;
|
|
45
45
|
}
|
|
46
|
-
const
|
|
46
|
+
const me = {
|
|
47
47
|
artist: "Artist",
|
|
48
48
|
color: "Color",
|
|
49
49
|
createDate: "CreateDate",
|
|
@@ -65,7 +65,7 @@ const fe = {
|
|
|
65
65
|
systemIdentifier: "SystemIdentifier",
|
|
66
66
|
text: "Text",
|
|
67
67
|
title: "Title"
|
|
68
|
-
},
|
|
68
|
+
}, fe = /* @__PURE__ */ new Set(["mediaDate", "createDate", "editDate"]);
|
|
69
69
|
function Rt(t) {
|
|
70
70
|
return !/[\s&+/*"\\:(),'<>~|[\]{}]/.test(t) && !/^(?:OR|AND|NOT)$/.test(t) ? t : `"${t.replace(/\\/g, "\\\\").replace(/"/g, '\\"')}"`;
|
|
71
71
|
}
|
|
@@ -73,46 +73,46 @@ function Wt(t, e) {
|
|
|
73
73
|
const s = (Array.isArray(e) ? e : [e]).map((a) => `${t}:${Rt(a)}`);
|
|
74
74
|
return s.length > 1 ? `(${s.join(" OR ")})` : s[0] ?? "";
|
|
75
75
|
}
|
|
76
|
-
function
|
|
76
|
+
function ge(t, e) {
|
|
77
77
|
return (Array.isArray(e) ? e : [e]).map((s) => `${t}${s.operator}${s.value}`).join(" AND ");
|
|
78
78
|
}
|
|
79
|
-
function
|
|
79
|
+
function xe(t) {
|
|
80
80
|
const e = [];
|
|
81
81
|
for (const i of Object.keys(t)) {
|
|
82
82
|
const s = i, a = t[s];
|
|
83
83
|
if (a == null)
|
|
84
84
|
continue;
|
|
85
85
|
if (s === "custom") {
|
|
86
|
-
for (const [
|
|
86
|
+
for (const [n, l] of Object.entries(
|
|
87
87
|
a
|
|
88
88
|
))
|
|
89
|
-
e.push(Wt(
|
|
89
|
+
e.push(Wt(n, l));
|
|
90
90
|
continue;
|
|
91
91
|
}
|
|
92
|
-
const
|
|
93
|
-
if (
|
|
94
|
-
if (
|
|
92
|
+
const r = me[s];
|
|
93
|
+
if (r) {
|
|
94
|
+
if (fe.has(s)) {
|
|
95
95
|
e.push(
|
|
96
|
-
|
|
96
|
+
ge(r, a)
|
|
97
97
|
);
|
|
98
98
|
continue;
|
|
99
99
|
}
|
|
100
100
|
if (s === "color") {
|
|
101
|
-
e.push(`${
|
|
101
|
+
e.push(`${r}:${a}`);
|
|
102
102
|
continue;
|
|
103
103
|
}
|
|
104
104
|
if (s === "parentFolderIdentifier") {
|
|
105
|
-
const
|
|
106
|
-
if (
|
|
105
|
+
const n = Array.isArray(a) ? a : [a];
|
|
106
|
+
if (n.length === 0)
|
|
107
107
|
continue;
|
|
108
108
|
const l = [
|
|
109
|
-
...
|
|
110
|
-
...
|
|
109
|
+
...n.map((d) => `ParentFolderIdentifier:${Rt(String(d))}`),
|
|
110
|
+
...n.map((d) => `ParentAlbumIdentifier:${Rt(String(d))}`)
|
|
111
111
|
];
|
|
112
112
|
e.push(`(${l.join(" OR ")})`);
|
|
113
113
|
continue;
|
|
114
114
|
}
|
|
115
|
-
e.push(Wt(
|
|
115
|
+
e.push(Wt(r, a));
|
|
116
116
|
}
|
|
117
117
|
}
|
|
118
118
|
return e.join(" AND ");
|
|
@@ -128,34 +128,34 @@ function dt(t) {
|
|
|
128
128
|
const e = dt(t.not);
|
|
129
129
|
return e ? `NOT (${e})` : "";
|
|
130
130
|
}
|
|
131
|
-
return
|
|
131
|
+
return xe(t);
|
|
132
132
|
}
|
|
133
|
-
const
|
|
133
|
+
const ye = "CoreField.LargeSizePreview", ut = "CoreField.DocType", Se = "Document.Title", Ae = "Document.CaptionLong", rt = "Document.FileExtension", mt = "CoreField.FileSize", Dt = "CoreField.Identifier", ft = "CoreField.MaxHeight", gt = "CoreField.MaxWidth", xt = "Document.RecordID", Nt = "CoreField.DocSubType", Xt = "CoreField.TitleWithFallback", yt = "CoreField.OriginalFileName", St = "CoreField.UpdatedFileName", Ft = "__width", ve = "CoreField.OriginalPreview", Bi = "Document.DocSubType", qi = "Document.InPoint", ji = "Document.OutPoint", Ct = {
|
|
134
134
|
DEFAULT_VIEW_SIZE: "Document.LargeSizePreview",
|
|
135
135
|
FIELD_TITLE_WITH_FALLBACK: "Document.TitleWithFallback",
|
|
136
136
|
ORIGINAL_VIEW_SIZE: "Document.OriginalPreview"
|
|
137
137
|
}, Kt = {
|
|
138
|
-
[
|
|
139
|
-
[Xt]:
|
|
140
|
-
[
|
|
141
|
-
},
|
|
138
|
+
[ye]: Ct.DEFAULT_VIEW_SIZE,
|
|
139
|
+
[Xt]: Ct.FIELD_TITLE_WITH_FALLBACK,
|
|
140
|
+
[ve]: Ct.ORIGINAL_VIEW_SIZE
|
|
141
|
+
}, ze = Object.fromEntries(
|
|
142
142
|
Object.entries(Kt).map(([t, e]) => [
|
|
143
143
|
e,
|
|
144
144
|
t
|
|
145
145
|
])
|
|
146
146
|
);
|
|
147
|
-
function
|
|
147
|
+
function be(t) {
|
|
148
148
|
return Kt[t] ?? t;
|
|
149
149
|
}
|
|
150
150
|
function Ot(t) {
|
|
151
151
|
const e = {};
|
|
152
152
|
for (const [i, s] of Object.entries(t)) {
|
|
153
|
-
const a =
|
|
153
|
+
const a = ze[i] ?? i;
|
|
154
154
|
e[a] = s;
|
|
155
155
|
}
|
|
156
156
|
return e;
|
|
157
157
|
}
|
|
158
|
-
function
|
|
158
|
+
function Ce(t) {
|
|
159
159
|
const e = new URLSearchParams();
|
|
160
160
|
for (const [i, s] of Object.entries(t))
|
|
161
161
|
s != null && (Array.isArray(s) ? s.forEach((a) => e.append(i, String(a))) : e.append(i, String(s)));
|
|
@@ -167,24 +167,24 @@ async function Zt({
|
|
|
167
167
|
getPermanentAssetsPaths: i,
|
|
168
168
|
httpMethod: s = "GET",
|
|
169
169
|
isSiteBuilder: a,
|
|
170
|
-
pageNumber:
|
|
171
|
-
query:
|
|
170
|
+
pageNumber: r,
|
|
171
|
+
query: n,
|
|
172
172
|
securityByPassToken: l,
|
|
173
173
|
siteUrl: d,
|
|
174
|
-
sort:
|
|
174
|
+
sort: g,
|
|
175
175
|
token: c,
|
|
176
|
-
useSession:
|
|
176
|
+
useSession: S
|
|
177
177
|
}) {
|
|
178
|
-
const A = e?.map(
|
|
178
|
+
const A = e?.map(be), p = {
|
|
179
179
|
CountPerPage: t,
|
|
180
|
-
Fields:
|
|
180
|
+
Fields: ue(A),
|
|
181
181
|
Format: "json",
|
|
182
182
|
GetPermanentAssetsPaths: i || void 0,
|
|
183
|
-
PageNumber:
|
|
184
|
-
Query: dt(
|
|
183
|
+
PageNumber: r,
|
|
184
|
+
Query: dt(n),
|
|
185
185
|
SecurityByPassToken: l || void 0,
|
|
186
|
-
Sort:
|
|
187
|
-
UseSession:
|
|
186
|
+
Sort: g || void 0,
|
|
187
|
+
UseSession: S || void 0
|
|
188
188
|
}, x = s === "POST";
|
|
189
189
|
try {
|
|
190
190
|
return (await E.request({
|
|
@@ -193,7 +193,7 @@ async function Zt({
|
|
|
193
193
|
method: s,
|
|
194
194
|
// POST large RecordID queries as a urlencoded body to dodge the ~2KB URL cap;
|
|
195
195
|
// GET keeps the same fields on the query string.
|
|
196
|
-
...x ? { data:
|
|
196
|
+
...x ? { data: Ce(p) } : { params: p, paramsSerializer: { indexes: null } },
|
|
197
197
|
responseType: "json",
|
|
198
198
|
transformResponse: [
|
|
199
199
|
...Array.isArray(E.defaults.transformResponse) ? E.defaults.transformResponse : [],
|
|
@@ -207,20 +207,20 @@ async function Zt({
|
|
|
207
207
|
totalCount: u.APIResponse?.GlobalInfo?.TotalCount ?? 0
|
|
208
208
|
})
|
|
209
209
|
],
|
|
210
|
-
url: a ? Bt.SEARCH_ASSETS :
|
|
210
|
+
url: a ? Bt.SEARCH_ASSETS : Jt["4.0"]
|
|
211
211
|
})).data;
|
|
212
212
|
} catch {
|
|
213
213
|
return { items: [], sort: "", totalCount: 0 };
|
|
214
214
|
}
|
|
215
215
|
}
|
|
216
|
-
async function
|
|
216
|
+
async function we({
|
|
217
217
|
assetId: t,
|
|
218
218
|
extension: e,
|
|
219
219
|
format: i,
|
|
220
220
|
siteUrl: s,
|
|
221
221
|
token: a,
|
|
222
|
-
transformations:
|
|
223
|
-
useSession:
|
|
222
|
+
transformations: r,
|
|
223
|
+
useSession: n
|
|
224
224
|
}) {
|
|
225
225
|
try {
|
|
226
226
|
return (await E.request({
|
|
@@ -229,10 +229,10 @@ async function ke({
|
|
|
229
229
|
params: {
|
|
230
230
|
SourceAssetFormat: i,
|
|
231
231
|
SourceAssetRecordID: t,
|
|
232
|
-
TargetExtension:
|
|
232
|
+
TargetExtension: se(e),
|
|
233
233
|
Token: a || void 0,
|
|
234
|
-
Transformations:
|
|
235
|
-
UseSession:
|
|
234
|
+
Transformations: r,
|
|
235
|
+
UseSession: n || void 0
|
|
236
236
|
},
|
|
237
237
|
/**
|
|
238
238
|
* https://link.orangelogic.com/Tasks/41S1XH
|
|
@@ -245,31 +245,31 @@ async function ke({
|
|
|
245
245
|
return null;
|
|
246
246
|
}
|
|
247
247
|
}
|
|
248
|
-
const
|
|
249
|
-
function
|
|
248
|
+
const ke = 50;
|
|
249
|
+
function Re(t, e) {
|
|
250
250
|
const i = [];
|
|
251
251
|
for (let s = 0; s < t.length; s += e)
|
|
252
252
|
i.push(t.slice(s, s + e));
|
|
253
253
|
return i;
|
|
254
254
|
}
|
|
255
|
-
async function
|
|
255
|
+
async function $e({
|
|
256
256
|
extraFields: t,
|
|
257
257
|
getPermanentAssetsPaths: e,
|
|
258
258
|
isSiteBuilder: i,
|
|
259
259
|
recordIds: s,
|
|
260
260
|
securityByPassToken: a,
|
|
261
|
-
token:
|
|
261
|
+
token: r
|
|
262
262
|
}) {
|
|
263
263
|
if (!Array.isArray(s) || s.length === 0)
|
|
264
264
|
return { facets: [], items: [], totalCount: 0 };
|
|
265
|
-
const
|
|
266
|
-
...
|
|
265
|
+
const n = t?.filter((p) => p && typeof p == "string") ?? [], l = [
|
|
266
|
+
...n,
|
|
267
267
|
St,
|
|
268
268
|
yt,
|
|
269
|
+
Se,
|
|
269
270
|
Ae,
|
|
270
|
-
ve,
|
|
271
271
|
xt
|
|
272
|
-
], d =
|
|
272
|
+
], d = Re(s, ke), g = await Promise.all(
|
|
273
273
|
d.map(
|
|
274
274
|
(p) => Zt({
|
|
275
275
|
countPerPage: p.length,
|
|
@@ -280,30 +280,30 @@ async function Pe({
|
|
|
280
280
|
pageNumber: 1,
|
|
281
281
|
query: { recordId: p },
|
|
282
282
|
securityByPassToken: a,
|
|
283
|
-
token:
|
|
283
|
+
token: r
|
|
284
284
|
})
|
|
285
285
|
)
|
|
286
|
-
), c = new Map(s.map((p, x) => [p, x])),
|
|
286
|
+
), c = new Map(s.map((p, x) => [p, x])), S = g.flatMap((p) => p.items).map((p) => {
|
|
287
287
|
let x = _(p, St);
|
|
288
288
|
return x === "" && (x = _(p, yt)), {
|
|
289
289
|
name: x,
|
|
290
290
|
recordId: _(p, xt),
|
|
291
|
-
...
|
|
292
|
-
(
|
|
293
|
-
|
|
294
|
-
const
|
|
295
|
-
return
|
|
291
|
+
...n.reduce(
|
|
292
|
+
(w, u) => {
|
|
293
|
+
w[u] = _(p, u);
|
|
294
|
+
const C = Yt(p, u);
|
|
295
|
+
return C !== void 0 && (w[`${u}${Ft}`] = String(C)), w;
|
|
296
296
|
},
|
|
297
297
|
{}
|
|
298
298
|
)
|
|
299
299
|
};
|
|
300
300
|
}).sort(
|
|
301
301
|
(p, x) => (c.get(p.recordId) ?? 1 / 0) - (c.get(x.recordId) ?? 1 / 0)
|
|
302
|
-
), A =
|
|
302
|
+
), A = g.reduce(
|
|
303
303
|
(p, x) => p + x.totalCount,
|
|
304
304
|
0
|
|
305
305
|
);
|
|
306
|
-
return { facets: [], items:
|
|
306
|
+
return { facets: [], items: S, totalCount: A };
|
|
307
307
|
}
|
|
308
308
|
function _(t, e) {
|
|
309
309
|
const i = t[e];
|
|
@@ -314,26 +314,26 @@ function Yt(t, e) {
|
|
|
314
314
|
if (!(i == null || !Qt(i)))
|
|
315
315
|
return typeof i.Width == "number" && i.Width > 0 ? i.Width : void 0;
|
|
316
316
|
}
|
|
317
|
-
async function
|
|
317
|
+
async function Pe({
|
|
318
318
|
countPerPage: t,
|
|
319
319
|
directParentFolderIdentifier: e,
|
|
320
320
|
extraFields: i,
|
|
321
321
|
getPermanentAssetsPaths: s,
|
|
322
322
|
isSiteBuilder: a,
|
|
323
|
-
limitedDocTypes:
|
|
324
|
-
pageNumber:
|
|
323
|
+
limitedDocTypes: r,
|
|
324
|
+
pageNumber: n,
|
|
325
325
|
parentFolderIdentifier: l,
|
|
326
326
|
searchTerm: d,
|
|
327
|
-
securityByPassToken:
|
|
327
|
+
securityByPassToken: g,
|
|
328
328
|
sortOrder: c,
|
|
329
|
-
token:
|
|
329
|
+
token: S
|
|
330
330
|
}) {
|
|
331
331
|
if (!e && !l)
|
|
332
332
|
return { facets: [], items: [], totalCount: 0 };
|
|
333
333
|
const A = (i?.filter((u) => u && typeof u == "string") ?? []).map((u) => u.replace("%20", " ")), p = {
|
|
334
334
|
directParentFolderIdentifier: e,
|
|
335
335
|
parentFolderIdentifier: l,
|
|
336
|
-
...
|
|
336
|
+
...r && r.length > 0 ? { docType: r } : {}
|
|
337
337
|
}, x = await Zt({
|
|
338
338
|
countPerPage: t,
|
|
339
339
|
fields: [
|
|
@@ -352,19 +352,19 @@ async function Fe({
|
|
|
352
352
|
],
|
|
353
353
|
getPermanentAssetsPaths: s,
|
|
354
354
|
isSiteBuilder: a,
|
|
355
|
-
pageNumber:
|
|
355
|
+
pageNumber: n,
|
|
356
356
|
query: p,
|
|
357
|
-
securityByPassToken:
|
|
357
|
+
securityByPassToken: g,
|
|
358
358
|
sort: void 0,
|
|
359
|
-
token:
|
|
360
|
-
}),
|
|
361
|
-
let
|
|
362
|
-
|
|
359
|
+
token: S
|
|
360
|
+
}), w = x.items.map((u) => {
|
|
361
|
+
let C = _(u, rt), D = _(u, St);
|
|
362
|
+
C && !C.startsWith(".") && (C = "." + C), D === "" && (D = _(u, yt));
|
|
363
363
|
const F = _(u, xt);
|
|
364
364
|
return {
|
|
365
365
|
docSubType: _(u, Nt),
|
|
366
366
|
docType: _(u, ut) || "",
|
|
367
|
-
extension:
|
|
367
|
+
extension: C,
|
|
368
368
|
height: _(u, ft) || "0",
|
|
369
369
|
id: F,
|
|
370
370
|
identifier: _(u, Dt),
|
|
@@ -384,11 +384,11 @@ async function Fe({
|
|
|
384
384
|
});
|
|
385
385
|
return {
|
|
386
386
|
facets: [],
|
|
387
|
-
items:
|
|
387
|
+
items: w,
|
|
388
388
|
totalCount: x.totalCount
|
|
389
389
|
};
|
|
390
390
|
}
|
|
391
|
-
async function
|
|
391
|
+
async function Fe({
|
|
392
392
|
autoCropMode: t,
|
|
393
393
|
cropHeight: e,
|
|
394
394
|
cropWidth: i,
|
|
@@ -410,11 +410,11 @@ async function _e({
|
|
|
410
410
|
// 5 minutes
|
|
411
411
|
transformResponse: [
|
|
412
412
|
...Array.isArray(E.defaults.transformResponse) ? E.defaults.transformResponse : [],
|
|
413
|
-
(
|
|
414
|
-
height:
|
|
415
|
-
width:
|
|
416
|
-
x:
|
|
417
|
-
y:
|
|
413
|
+
(n) => ({
|
|
414
|
+
height: n.cropHeight,
|
|
415
|
+
width: n.cropWidth,
|
|
416
|
+
x: n.cropX,
|
|
417
|
+
y: n.cropY
|
|
418
418
|
})
|
|
419
419
|
],
|
|
420
420
|
url: Ut.GET_CROP_ZONE_SUGGESTION
|
|
@@ -442,7 +442,7 @@ async function Vi({
|
|
|
442
442
|
responseType: "json",
|
|
443
443
|
transformResponse: [
|
|
444
444
|
...Array.isArray(E.defaults.transformResponse) ? E.defaults.transformResponse : [],
|
|
445
|
-
(
|
|
445
|
+
(n) => !n || typeof n != "object" ? [] : n.proxies?.map((l) => ({
|
|
446
446
|
cdnName: l.cdnName,
|
|
447
447
|
extension: l.extension,
|
|
448
448
|
formatHeight: l.formatHeight,
|
|
@@ -454,7 +454,7 @@ async function Vi({
|
|
|
454
454
|
width: l.width
|
|
455
455
|
})) ?? []
|
|
456
456
|
],
|
|
457
|
-
url: e ? Bt.GET_AVAILABLE_PROXIES :
|
|
457
|
+
url: e ? Bt.GET_AVAILABLE_PROXIES : ie
|
|
458
458
|
})).data;
|
|
459
459
|
} catch {
|
|
460
460
|
return [];
|
|
@@ -481,7 +481,7 @@ async function Gi({
|
|
|
481
481
|
formatsByDocType: i.formatsByDocType ?? {}
|
|
482
482
|
}
|
|
483
483
|
],
|
|
484
|
-
url:
|
|
484
|
+
url: te
|
|
485
485
|
})).data;
|
|
486
486
|
} catch {
|
|
487
487
|
return { formatsByDocType: {} };
|
|
@@ -503,14 +503,14 @@ async function Qi({
|
|
|
503
503
|
params: { RecordIDs: t, RightsToCheck: e },
|
|
504
504
|
paramsSerializer: { indexes: null },
|
|
505
505
|
responseType: "json",
|
|
506
|
-
url:
|
|
506
|
+
url: ee.GET_AUTHORIZED_OBJECTS
|
|
507
507
|
});
|
|
508
508
|
return s;
|
|
509
509
|
} catch {
|
|
510
510
|
return i;
|
|
511
511
|
}
|
|
512
512
|
}
|
|
513
|
-
const
|
|
513
|
+
const wt = 20, it = "TR1", At = "TRX", _e = /* @__PURE__ */ new Set([".gif"]), Me = /* @__PURE__ */ new Set([
|
|
514
514
|
".avif",
|
|
515
515
|
".bmp",
|
|
516
516
|
".gif",
|
|
@@ -521,52 +521,53 @@ const bt = 20, it = "TR1", At = "TRX", Me = /* @__PURE__ */ new Set([".gif"]), I
|
|
|
521
521
|
".svg",
|
|
522
522
|
".webp"
|
|
523
523
|
]);
|
|
524
|
-
function
|
|
524
|
+
function Ie(t) {
|
|
525
525
|
const e = t.toLowerCase(), i = e.startsWith(".") ? e : `.${e}`;
|
|
526
|
-
return
|
|
526
|
+
return Me.has(i);
|
|
527
527
|
}
|
|
528
528
|
function Lt({
|
|
529
529
|
autoFormat: t,
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
530
|
+
buildSrcset: e,
|
|
531
|
+
extension: i,
|
|
532
|
+
format: s,
|
|
533
|
+
item: a,
|
|
534
|
+
manualFormat: r,
|
|
534
535
|
size: n
|
|
535
536
|
}) {
|
|
536
|
-
const
|
|
537
|
-
const
|
|
538
|
-
if (!
|
|
537
|
+
const l = i?.toLowerCase() ?? "", d = l.startsWith(".") ? l : `.${l}`, g = `path_${it}`, c = (p, x) => {
|
|
538
|
+
const w = a[p];
|
|
539
|
+
if (!w)
|
|
539
540
|
return;
|
|
540
|
-
const u =
|
|
541
|
-
extension:
|
|
541
|
+
const u = a[`${p}${Ft}`], C = t ? ae(w, {
|
|
542
|
+
extension: l,
|
|
542
543
|
format: x
|
|
543
|
-
}) :
|
|
544
|
+
}) : w;
|
|
544
545
|
return {
|
|
545
546
|
maxWidth: u,
|
|
546
|
-
src:
|
|
547
|
-
srcset:
|
|
548
|
-
extension:
|
|
547
|
+
src: C,
|
|
548
|
+
srcset: e ? oe(C, {
|
|
549
|
+
extension: l,
|
|
549
550
|
format: x,
|
|
550
|
-
maxWidth:
|
|
551
|
-
})
|
|
551
|
+
maxWidth: re(r, u)
|
|
552
|
+
}) : ""
|
|
552
553
|
};
|
|
553
554
|
};
|
|
554
|
-
if (!
|
|
555
|
-
const p = jt(
|
|
556
|
-
return
|
|
557
|
-
}
|
|
558
|
-
if (!!
|
|
559
|
-
return
|
|
560
|
-
const
|
|
561
|
-
return A &&
|
|
555
|
+
if (!r) {
|
|
556
|
+
const p = jt(l, n), x = `path_${p}`;
|
|
557
|
+
return c(x, p) ?? c(g, it) ?? {};
|
|
558
|
+
}
|
|
559
|
+
if (!!l && _e.has(d))
|
|
560
|
+
return c(`path_${At}`, At) ?? c(g, it) ?? {};
|
|
561
|
+
const A = s ? `path_${s}` : void 0;
|
|
562
|
+
return A && a[A] ? c(A, s) ?? {} : c(g, it) ?? {};
|
|
562
563
|
}
|
|
563
564
|
class Xi {
|
|
564
565
|
constructor(e, i) {
|
|
565
|
-
this.data = [], this.folderId = "", this.fetchedPages = /* @__PURE__ */ new Set(), this.totalCount = 0, this.maxEnd = 1 / 0, this.pageSize =
|
|
566
|
+
this.data = [], this.folderId = "", this.fetchedPages = /* @__PURE__ */ new Set(), this.totalCount = 0, this.maxEnd = 1 / 0, this.pageSize = wt, this.requestEpoch = 0, this.host = e, this.host.addController?.(this);
|
|
566
567
|
const s = i?.maxEnd;
|
|
567
568
|
this.maxEnd = typeof s == "number" && Number.isFinite(s) && s >= 0 ? Math.floor(s) : 1 / 0;
|
|
568
569
|
const a = i?.pageSize;
|
|
569
|
-
this.pageSize = typeof a == "number" && Number.isFinite(a) && a >= 1 ? Math.floor(a) :
|
|
570
|
+
this.pageSize = typeof a == "number" && Number.isFinite(a) && a >= 1 ? Math.floor(a) : wt, this.authToken = i?.token, this.securityByPassToken = i?.securityByPassToken, this.isSiteBuilder = i?.isSiteBuilder ?? !1, this.autoFormat = i?.autoFormat ?? !1, this.buildSrcset = i?.buildSrcset ?? !1;
|
|
570
571
|
}
|
|
571
572
|
get totalDataCount() {
|
|
572
573
|
return this.totalCount;
|
|
@@ -584,7 +585,7 @@ class Xi {
|
|
|
584
585
|
* Shrinking is ignored once pages are cached: collapsing already has what it needs.
|
|
585
586
|
*/
|
|
586
587
|
setPageSize(e) {
|
|
587
|
-
const i = Number.isFinite(e) && e >= 1 ? Math.floor(e) :
|
|
588
|
+
const i = Number.isFinite(e) && e >= 1 ? Math.floor(e) : wt;
|
|
588
589
|
if (this.pageSize === i)
|
|
589
590
|
return;
|
|
590
591
|
const s = this.fetchedPages.size > 0;
|
|
@@ -595,30 +596,30 @@ class Xi {
|
|
|
595
596
|
extraFields: i = [],
|
|
596
597
|
format: s,
|
|
597
598
|
manualFormat: a = !0,
|
|
598
|
-
start:
|
|
599
|
-
transformations:
|
|
599
|
+
start: r,
|
|
600
|
+
transformations: n
|
|
600
601
|
}) {
|
|
601
|
-
if (e <
|
|
602
|
+
if (e < r)
|
|
602
603
|
return this.data;
|
|
603
|
-
if (this.totalCount > 0 && e >= this.totalCount && (e = this.totalCount - 1, e <
|
|
604
|
+
if (this.totalCount > 0 && e >= this.totalCount && (e = this.totalCount - 1, e < r))
|
|
604
605
|
return this.data;
|
|
605
606
|
const l = this.requestEpoch;
|
|
606
607
|
if (!this.folderId || l !== this.requestEpoch)
|
|
607
608
|
return this.data;
|
|
608
|
-
const d = s ? `path_${s}` : void 0,
|
|
609
|
+
const d = s ? `path_${s}` : void 0, g = `path_${it}`, c = `path_${At}`, S = [
|
|
609
610
|
...new Set(
|
|
610
|
-
[d,
|
|
611
|
+
[d, g, c].filter(
|
|
611
612
|
(x) => !!x
|
|
612
613
|
)
|
|
613
614
|
)
|
|
614
|
-
], A = Math.floor(
|
|
615
|
+
], A = Math.floor(r / this.pageSize) + 1, p = Math.floor(e / this.pageSize) + 1;
|
|
615
616
|
for (let x = A; x <= p; x++) {
|
|
616
617
|
if (this.fetchedPages.has(x))
|
|
617
618
|
continue;
|
|
618
|
-
const
|
|
619
|
+
const w = await Pe({
|
|
619
620
|
countPerPage: this.pageSize,
|
|
620
621
|
directParentFolderIdentifier: this.folderId,
|
|
621
|
-
extraFields: [...i, ...
|
|
622
|
+
extraFields: [...i, ...S],
|
|
622
623
|
getPermanentAssetsPaths: !0,
|
|
623
624
|
isSiteBuilder: this.isSiteBuilder,
|
|
624
625
|
limitedDocTypes: [ct.Image, ct.Audio, ct.Video, ct.Multimedia],
|
|
@@ -630,25 +631,26 @@ class Xi {
|
|
|
630
631
|
});
|
|
631
632
|
if (l !== this.requestEpoch)
|
|
632
633
|
return this.data;
|
|
633
|
-
if (this.fetchedPages.add(x), !this.totalCount &&
|
|
634
|
-
const
|
|
635
|
-
this.totalCount =
|
|
634
|
+
if (this.fetchedPages.add(x), !this.totalCount && w.totalCount) {
|
|
635
|
+
const C = Math.min(this.maxEnd, w.totalCount);
|
|
636
|
+
this.totalCount = C, this.data = Array.from({ length: C }, () => ({
|
|
636
637
|
alt: "",
|
|
637
|
-
id: `temp-${
|
|
638
|
+
id: `temp-${he()}`,
|
|
638
639
|
name: "",
|
|
639
640
|
src: ""
|
|
640
641
|
}));
|
|
641
642
|
}
|
|
642
643
|
const u = (x - 1) * this.pageSize;
|
|
643
|
-
for (let
|
|
644
|
-
const D = u +
|
|
644
|
+
for (let C = 0; C < w.items.length; C++) {
|
|
645
|
+
const D = u + C;
|
|
645
646
|
if (D < this.data.length) {
|
|
646
|
-
const F =
|
|
647
|
+
const F = w.items[C], {
|
|
647
648
|
maxWidth: L,
|
|
648
649
|
src: et,
|
|
649
650
|
srcset: nt
|
|
650
651
|
} = Lt({
|
|
651
652
|
autoFormat: this.autoFormat,
|
|
653
|
+
buildSrcset: this.buildSrcset,
|
|
652
654
|
extension: F.extension,
|
|
653
655
|
format: s,
|
|
654
656
|
item: F,
|
|
@@ -656,7 +658,7 @@ class Xi {
|
|
|
656
658
|
size: F.size
|
|
657
659
|
});
|
|
658
660
|
let ht = et, Mt = nt;
|
|
659
|
-
ht &&
|
|
661
|
+
ht && n && n.length > 0 && (ht = Tt(ht, n), Mt = ""), this.data[D] = {
|
|
660
662
|
alt: F.name,
|
|
661
663
|
docType: F.docType,
|
|
662
664
|
extension: F.extension,
|
|
@@ -679,14 +681,14 @@ class Xi {
|
|
|
679
681
|
extraFields: i = [],
|
|
680
682
|
folderId: s,
|
|
681
683
|
forceRefetch: a = !1,
|
|
682
|
-
format:
|
|
683
|
-
manualFormat:
|
|
684
|
+
format: r,
|
|
685
|
+
manualFormat: n = !0,
|
|
684
686
|
minLimit: l = 5,
|
|
685
687
|
noPlaceholders: d = !1,
|
|
686
|
-
transformations:
|
|
688
|
+
transformations: g
|
|
687
689
|
}) {
|
|
688
690
|
(!this.folderId || this.folderId !== s) && (this.folderId = s, this.resetFolderState()), a && this.resetPageCache();
|
|
689
|
-
const c = Math.max(5, l),
|
|
691
|
+
const c = Math.max(5, l), S = e, A = e + c, p = [
|
|
690
692
|
...i,
|
|
691
693
|
ft,
|
|
692
694
|
gt
|
|
@@ -694,21 +696,21 @@ class Xi {
|
|
|
694
696
|
await this.fetchImages({
|
|
695
697
|
end: A,
|
|
696
698
|
extraFields: p.filter((u) => u !== ""),
|
|
697
|
-
format:
|
|
698
|
-
manualFormat:
|
|
699
|
-
start:
|
|
700
|
-
transformations:
|
|
699
|
+
format: r,
|
|
700
|
+
manualFormat: n,
|
|
701
|
+
start: S,
|
|
702
|
+
transformations: g
|
|
701
703
|
});
|
|
702
704
|
let x = e - c;
|
|
703
705
|
x < 0 && (this.totalCount === 0 ? x = 0 : x = Math.max(0, this.totalCount + x));
|
|
704
|
-
const
|
|
706
|
+
const w = x + c;
|
|
705
707
|
return await this.fetchImages({
|
|
706
|
-
end:
|
|
708
|
+
end: w,
|
|
707
709
|
extraFields: p.filter((u) => u !== ""),
|
|
708
|
-
format:
|
|
709
|
-
manualFormat:
|
|
710
|
+
format: r,
|
|
711
|
+
manualFormat: n,
|
|
710
712
|
start: x,
|
|
711
|
-
transformations:
|
|
713
|
+
transformations: g
|
|
712
714
|
}), d ? this.data.filter((u) => u.id && !u.id.startsWith("temp-")) : this.data;
|
|
713
715
|
}
|
|
714
716
|
async fetchImagesByIDs({
|
|
@@ -716,24 +718,24 @@ class Xi {
|
|
|
716
718
|
format: i,
|
|
717
719
|
manualFormat: s = !0,
|
|
718
720
|
recordIds: a,
|
|
719
|
-
transformations:
|
|
721
|
+
transformations: r
|
|
720
722
|
}) {
|
|
721
723
|
if (a.length === 0)
|
|
722
724
|
return [];
|
|
723
|
-
const
|
|
725
|
+
const n = i ? `path_${i}` : void 0, l = `path_${it}`, d = `path_${At}`, g = [
|
|
724
726
|
...new Set(
|
|
725
|
-
[
|
|
727
|
+
[n, l, d].filter(
|
|
726
728
|
(p) => !!p
|
|
727
729
|
)
|
|
728
730
|
)
|
|
729
|
-
], c = [rt, mt],
|
|
731
|
+
], c = [rt, mt], S = [
|
|
730
732
|
...e,
|
|
731
733
|
ut,
|
|
732
734
|
ft,
|
|
733
735
|
gt
|
|
734
736
|
];
|
|
735
|
-
return (await
|
|
736
|
-
extraFields: [...
|
|
737
|
+
return (await $e({
|
|
738
|
+
extraFields: [...S, ...g, ...c].filter((p) => p !== ""),
|
|
737
739
|
getPermanentAssetsPaths: !0,
|
|
738
740
|
isSiteBuilder: this.isSiteBuilder,
|
|
739
741
|
recordIds: a,
|
|
@@ -742,27 +744,28 @@ class Xi {
|
|
|
742
744
|
})).items.map((p) => {
|
|
743
745
|
const {
|
|
744
746
|
maxWidth: x,
|
|
745
|
-
src:
|
|
747
|
+
src: w,
|
|
746
748
|
srcset: u
|
|
747
749
|
} = Lt({
|
|
748
750
|
autoFormat: this.autoFormat,
|
|
751
|
+
buildSrcset: this.buildSrcset,
|
|
749
752
|
extension: p[rt],
|
|
750
753
|
format: i,
|
|
751
754
|
item: p,
|
|
752
755
|
manualFormat: s,
|
|
753
756
|
size: p[mt]
|
|
754
757
|
});
|
|
755
|
-
let
|
|
756
|
-
return
|
|
758
|
+
let C = w, D = u;
|
|
759
|
+
return C && r && r.length > 0 && (C = Tt(C, r), D = ""), {
|
|
757
760
|
alt: p.name,
|
|
758
761
|
docType: p[ut],
|
|
759
762
|
extension: p[rt] || "",
|
|
760
763
|
id: p.recordId,
|
|
761
764
|
maxWidth: x,
|
|
762
765
|
name: p.name,
|
|
763
|
-
src:
|
|
766
|
+
src: C,
|
|
764
767
|
srcset: D,
|
|
765
|
-
...
|
|
768
|
+
...S.reduce(
|
|
766
769
|
(F, L) => (F[L] = p[L] ?? "", F),
|
|
767
770
|
{}
|
|
768
771
|
)
|
|
@@ -774,63 +777,63 @@ class Xi {
|
|
|
774
777
|
folderId: i,
|
|
775
778
|
forceRefetch: s = !1,
|
|
776
779
|
format: a,
|
|
777
|
-
manualFormat:
|
|
778
|
-
noPlaceholders:
|
|
780
|
+
manualFormat: r = !0,
|
|
781
|
+
noPlaceholders: n = !1,
|
|
779
782
|
page: l,
|
|
780
783
|
pageSize: d = 10,
|
|
781
|
-
transformations:
|
|
784
|
+
transformations: g
|
|
782
785
|
}) {
|
|
783
786
|
(!this.folderId || this.folderId !== i) && (this.folderId = i, this.resetFolderState()), s && this.resetPageCache();
|
|
784
|
-
const c = l * d,
|
|
787
|
+
const c = l * d, S = c + d - 1;
|
|
785
788
|
return await this.fetchImages({
|
|
786
|
-
end:
|
|
789
|
+
end: S,
|
|
787
790
|
extraFields: e,
|
|
788
791
|
format: a,
|
|
789
|
-
manualFormat:
|
|
792
|
+
manualFormat: r,
|
|
790
793
|
start: c,
|
|
791
|
-
transformations:
|
|
792
|
-
}),
|
|
794
|
+
transformations: g
|
|
795
|
+
}), n ? this.data.filter((A) => A.id && !A.id.startsWith("temp-")) : this.data;
|
|
793
796
|
}
|
|
794
797
|
async *fetchImagesInFolderByChunk({
|
|
795
798
|
chunkSize: e = 10,
|
|
796
799
|
end: i = 0,
|
|
797
800
|
extraFields: s = [],
|
|
798
801
|
folderId: a,
|
|
799
|
-
forceRefetch:
|
|
800
|
-
format:
|
|
802
|
+
forceRefetch: r = !1,
|
|
803
|
+
format: n,
|
|
801
804
|
manualFormat: l = !0,
|
|
802
805
|
start: d = 0,
|
|
803
|
-
transformations:
|
|
806
|
+
transformations: g
|
|
804
807
|
}) {
|
|
805
808
|
const c = Math.max(1, e);
|
|
806
|
-
if ((!this.folderId || this.folderId !== a) && (this.folderId = a, this.resetFolderState()),
|
|
809
|
+
if ((!this.folderId || this.folderId !== a) && (this.folderId = a, this.resetFolderState()), r && this.resetPageCache(), i !== -1) {
|
|
807
810
|
await this.fetchImages({
|
|
808
811
|
end: i,
|
|
809
812
|
extraFields: s,
|
|
810
|
-
format:
|
|
813
|
+
format: n,
|
|
811
814
|
manualFormat: l,
|
|
812
815
|
start: d,
|
|
813
|
-
transformations:
|
|
816
|
+
transformations: g
|
|
814
817
|
}), yield this.data;
|
|
815
818
|
return;
|
|
816
819
|
}
|
|
817
|
-
let
|
|
820
|
+
let S = d, A = d + c;
|
|
818
821
|
if (await this.fetchImages({
|
|
819
822
|
end: A,
|
|
820
823
|
extraFields: s,
|
|
821
|
-
format:
|
|
824
|
+
format: n,
|
|
822
825
|
manualFormat: l,
|
|
823
|
-
start:
|
|
824
|
-
transformations:
|
|
826
|
+
start: S,
|
|
827
|
+
transformations: g
|
|
825
828
|
}), yield this.data, !(!this.totalCount || this.totalCount <= A))
|
|
826
829
|
for (; A < this.totalCount; )
|
|
827
|
-
|
|
830
|
+
S = A, A = Math.min(A + c, this.totalCount), await this.fetchImages({
|
|
828
831
|
end: A,
|
|
829
832
|
extraFields: s,
|
|
830
|
-
format:
|
|
833
|
+
format: n,
|
|
831
834
|
manualFormat: l,
|
|
832
|
-
start:
|
|
833
|
-
transformations:
|
|
835
|
+
start: S,
|
|
836
|
+
transformations: g
|
|
834
837
|
}), yield this.data;
|
|
835
838
|
}
|
|
836
839
|
hostConnected() {
|
|
@@ -847,27 +850,27 @@ class Xi {
|
|
|
847
850
|
}
|
|
848
851
|
const Ee = V`.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}`, Te = V`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}`;
|
|
849
852
|
var He = Object.defineProperty, We = Object.getOwnPropertyDescriptor, z = (t, e, i, s) => {
|
|
850
|
-
for (var a = s > 1 ? void 0 : s ? We(e, i) : e,
|
|
851
|
-
(
|
|
853
|
+
for (var a = s > 1 ? void 0 : s ? We(e, i) : e, r = t.length - 1, n; r >= 0; r--)
|
|
854
|
+
(n = t[r]) && (a = (s ? n(e, i, a) : n(a)) || a);
|
|
852
855
|
return s && a && He(e, i, a), a;
|
|
853
856
|
};
|
|
854
857
|
let v = class extends j {
|
|
855
858
|
constructor() {
|
|
856
|
-
super(...arguments), this.localize = new G(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 =
|
|
857
|
-
[
|
|
859
|
+
super(...arguments), this.localize = new G(this), this.open = !1, this.width = 0, this.height = 0, this.maxWidth = 0, this.maxHeight = 0, this.ratioWidth = 1, this.ratioHeight = 1, this.percentageWidth = 0, this.percentageHeight = 0, this.unit = o.Pixel, this.disabledApply = !1, this.noRatioModes = !1, this.showPositionPicker = !1, this.lastAppliedSetting = {
|
|
860
|
+
[o.Pixel]: {
|
|
858
861
|
height: 0,
|
|
859
862
|
percentageHeight: 100,
|
|
860
863
|
percentageWidth: 100,
|
|
861
|
-
unit:
|
|
864
|
+
unit: o.Pixel,
|
|
862
865
|
width: 0,
|
|
863
866
|
x: 0,
|
|
864
867
|
y: 0
|
|
865
868
|
},
|
|
866
|
-
[
|
|
869
|
+
[o.AspectRatio]: {
|
|
867
870
|
height: 1,
|
|
868
871
|
percentageHeight: 100,
|
|
869
872
|
percentageWidth: 100,
|
|
870
|
-
unit:
|
|
873
|
+
unit: o.AspectRatio,
|
|
871
874
|
width: 1,
|
|
872
875
|
x: 0,
|
|
873
876
|
y: 0
|
|
@@ -884,10 +887,10 @@ let v = class extends j {
|
|
|
884
887
|
return;
|
|
885
888
|
}
|
|
886
889
|
if (this.keepAspectRatio) {
|
|
887
|
-
if (this.unit ===
|
|
890
|
+
if (this.unit === o.Pixel && this.width && this.height) {
|
|
888
891
|
this.aspectRatio = this.width / this.height;
|
|
889
892
|
return;
|
|
890
|
-
} else if (this.unit ===
|
|
893
|
+
} else if (this.unit === o.AspectRatio && this.ratioWidth && this.ratioHeight) {
|
|
891
894
|
this.aspectRatio = this.ratioWidth / this.ratioHeight;
|
|
892
895
|
return;
|
|
893
896
|
}
|
|
@@ -918,9 +921,9 @@ let v = class extends j {
|
|
|
918
921
|
}
|
|
919
922
|
this.invalidWidth = !1;
|
|
920
923
|
let e = Number(t.target.value);
|
|
921
|
-
this.unit ===
|
|
922
|
-
let i = this.unit ===
|
|
923
|
-
this.keepAspectRatio && (i = Math.round(e / this.aspectRatio), this.unit ===
|
|
924
|
+
this.unit === o.Pixel && (e = Math.max(Math.min(e, this.maxWidth), 1)), t.target.value = e.toString();
|
|
925
|
+
let i = this.unit === o.Pixel ? this.height : this.ratioHeight, s = !1;
|
|
926
|
+
this.keepAspectRatio && (i = Math.round(e / this.aspectRatio), this.unit === o.Pixel && i > this.maxHeight && (i = this.maxHeight, s = !0)), this.invalidHeight = !1, this.emit("cx-asset-link-format-crop-change", {
|
|
924
927
|
detail: {
|
|
925
928
|
breakAspectRatio: s,
|
|
926
929
|
height: i,
|
|
@@ -937,9 +940,9 @@ let v = class extends j {
|
|
|
937
940
|
}
|
|
938
941
|
this.invalidHeight = !1;
|
|
939
942
|
let e = Number(t.target.value);
|
|
940
|
-
this.unit ===
|
|
941
|
-
let i = this.unit ===
|
|
942
|
-
this.keepAspectRatio && (i = Math.round(e * this.aspectRatio), this.unit ===
|
|
943
|
+
this.unit === o.Pixel && (e = Math.max(Math.min(e, this.maxHeight), 1)), t.target.value = e.toString();
|
|
944
|
+
let i = this.unit === o.Pixel ? this.width : this.ratioWidth, s = !1;
|
|
945
|
+
this.keepAspectRatio && (i = Math.round(e * this.aspectRatio), this.unit === o.Pixel && i > this.maxWidth && (i = this.maxWidth, s = !0)), this.invalidWidth = !1, this.emit("cx-asset-link-format-crop-change", {
|
|
943
946
|
detail: {
|
|
944
947
|
breakAspectRatio: s,
|
|
945
948
|
height: e,
|
|
@@ -954,29 +957,29 @@ let v = class extends j {
|
|
|
954
957
|
if (e === "free")
|
|
955
958
|
this.selectedMode?.auto && this.emit("cx-asset-link-format-crop-change", {
|
|
956
959
|
detail: {
|
|
957
|
-
height: this.lastAppliedSetting[
|
|
960
|
+
height: this.lastAppliedSetting[o.Pixel].height,
|
|
958
961
|
keepAspectRatio: !1,
|
|
959
962
|
silent: !0,
|
|
960
|
-
unit:
|
|
961
|
-
width: this.lastAppliedSetting[
|
|
963
|
+
unit: o.Pixel,
|
|
964
|
+
width: this.lastAppliedSetting[o.Pixel].width
|
|
962
965
|
}
|
|
963
966
|
});
|
|
964
967
|
else if (!i) {
|
|
965
968
|
const [s, a] = e.split(":").map(Number);
|
|
966
|
-
if (this.unit ===
|
|
967
|
-
let
|
|
968
|
-
Number.isFinite(this.maxWidth) && Number.isFinite(this.maxHeight) && ({ height:
|
|
969
|
+
if (this.unit === o.Pixel) {
|
|
970
|
+
let r = s, n = a;
|
|
971
|
+
Number.isFinite(this.maxWidth) && Number.isFinite(this.maxHeight) && ({ height: n, width: r } = ce(
|
|
969
972
|
this.maxWidth,
|
|
970
973
|
this.maxHeight,
|
|
971
974
|
s,
|
|
972
975
|
a
|
|
973
976
|
)), this.emit("cx-asset-link-format-crop-change", {
|
|
974
977
|
detail: {
|
|
975
|
-
height:
|
|
978
|
+
height: n,
|
|
976
979
|
keepAspectRatio: !0,
|
|
977
980
|
silent: !0,
|
|
978
|
-
unit:
|
|
979
|
-
width:
|
|
981
|
+
unit: o.Pixel,
|
|
982
|
+
width: r
|
|
980
983
|
}
|
|
981
984
|
});
|
|
982
985
|
} else
|
|
@@ -985,7 +988,7 @@ let v = class extends j {
|
|
|
985
988
|
height: a,
|
|
986
989
|
keepAspectRatio: !0,
|
|
987
990
|
silent: !0,
|
|
988
|
-
unit:
|
|
991
|
+
unit: o.AspectRatio,
|
|
989
992
|
width: s
|
|
990
993
|
}
|
|
991
994
|
});
|
|
@@ -1018,19 +1021,19 @@ let v = class extends j {
|
|
|
1018
1021
|
* This allows the parent component to update the crop settings accordingly.
|
|
1019
1022
|
*/
|
|
1020
1023
|
onUnitChange(t) {
|
|
1021
|
-
t.target.value ===
|
|
1024
|
+
t.target.value === o.AspectRatio ? this.emit("cx-asset-link-format-crop-change", {
|
|
1022
1025
|
detail: {
|
|
1023
|
-
height: this.lastAppliedSetting[
|
|
1026
|
+
height: this.lastAppliedSetting[o.AspectRatio].height,
|
|
1024
1027
|
keepAspectRatio: this.keepAspectRatio,
|
|
1025
|
-
unit:
|
|
1026
|
-
width: this.lastAppliedSetting[
|
|
1028
|
+
unit: o.AspectRatio,
|
|
1029
|
+
width: this.lastAppliedSetting[o.AspectRatio].width
|
|
1027
1030
|
}
|
|
1028
1031
|
}) : this.emit("cx-asset-link-format-crop-change", {
|
|
1029
1032
|
detail: {
|
|
1030
|
-
height: this.lastAppliedSetting[
|
|
1033
|
+
height: this.lastAppliedSetting[o.Pixel].height,
|
|
1031
1034
|
keepAspectRatio: this.keepAspectRatio,
|
|
1032
|
-
unit:
|
|
1033
|
-
width: this.lastAppliedSetting[
|
|
1035
|
+
unit: o.Pixel,
|
|
1036
|
+
width: this.lastAppliedSetting[o.Pixel].width
|
|
1034
1037
|
}
|
|
1035
1038
|
}), this.emit("cx-asset-link-format-crop-mode-change", {
|
|
1036
1039
|
detail: {
|
|
@@ -1074,55 +1077,55 @@ let v = class extends j {
|
|
|
1074
1077
|
}
|
|
1075
1078
|
}), this.emit("cx-asset-link-format-crop-change", {
|
|
1076
1079
|
detail: {
|
|
1077
|
-
height: this.unit ===
|
|
1080
|
+
height: this.unit === o.Pixel ? this.height : this.ratioHeight,
|
|
1078
1081
|
keepAspectRatio: !this.keepAspectRatio,
|
|
1079
1082
|
unit: this.unit,
|
|
1080
|
-
width: this.unit ===
|
|
1083
|
+
width: this.unit === o.Pixel ? this.width : this.ratioWidth
|
|
1081
1084
|
}
|
|
1082
1085
|
});
|
|
1083
1086
|
}
|
|
1084
1087
|
render() {
|
|
1085
1088
|
const t = this.cropModes.filter((i) => !i.auto), e = this.cropModes.filter((i) => i.auto);
|
|
1086
|
-
return
|
|
1089
|
+
return b`<cx-details class="details" ?open=${this.open} @cx-show=${this.onShowDetails} @cx-hide=${this.onHideDetails}><cx-space slot="summary" align-items="center"><div part="icon"><cx-icon name="crop"></cx-icon></div><cx-typography variant="body2">${this.localize.term("crop")}</cx-typography></cx-space><cx-space direction="vertical" spacing="small">${M(
|
|
1087
1090
|
!this.noRatioModes,
|
|
1088
|
-
() =>
|
|
1091
|
+
() => b`<cx-select data-testid="cx-asset-link-format-crop-mode" value=${this.cropMode} hoist style=${O({
|
|
1089
1092
|
width: "100%"
|
|
1090
1093
|
})} @cx-change=${this.onCropModeChange} ?disabled=${this.loading}>${ot(
|
|
1091
1094
|
t,
|
|
1092
1095
|
(i) => i.value,
|
|
1093
|
-
({ label: i, value: s }) =>
|
|
1096
|
+
({ label: i, value: s }) => b`<cx-option value=${s}>${i}</cx-option>`
|
|
1094
1097
|
)}
|
|
1095
1098
|
${M(
|
|
1096
1099
|
e.length > 0,
|
|
1097
|
-
() =>
|
|
1100
|
+
() => b`<cx-divider></cx-divider><small>${this.localize.term("autoCropping")}</small>`
|
|
1098
1101
|
)}
|
|
1099
1102
|
${ot(
|
|
1100
1103
|
e,
|
|
1101
1104
|
(i) => i.value,
|
|
1102
|
-
({ label: i, value: s }) =>
|
|
1105
|
+
({ label: i, value: s }) => b`<cx-option value=${s}>${i}</cx-option>`
|
|
1103
1106
|
)}</cx-select>`
|
|
1104
|
-
)}<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 ===
|
|
1107
|
+
)}<cx-space spacing="small"><div class="crop__input-group"><cx-input data-testid="cx-asset-link-format-crop-width" placeholder=${this.localize.term("width")} mask="num" .maskBlocks=${{ num: { mask: Number, min: 1 } }} value=${this.unit === o.Pixel ? this.width.toString() : this.ratioWidth.toString()} @cx-change=${this.handleInputChange} @cx-input=${this.handleWidthChange} required ?disabled=${this.loading}><cx-typography slot="prefix" variant="body3" part="input-label">
|
|
1105
1108
|
W
|
|
1106
1109
|
</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=${O({
|
|
1107
1110
|
color: this.keepAspectRatio ? "var(--cx-color-primary)" : void 0
|
|
1108
|
-
})} ?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 ===
|
|
1111
|
+
})} ?disabled=${this.loading}></cx-icon-button><cx-input data-testid="cx-asset-link-format-crop-height" placeholder=${this.localize.term("height")} mask="num" .maskBlocks=${{ num: { mask: Number, min: 1 } }} value=${this.unit === o.Pixel ? this.height.toString() : this.ratioHeight.toString()} ?disabled=${this.loading} @cx-change=${this.handleInputChange} @cx-input=${this.handleHeightChange} required><cx-typography slot="prefix" variant="body3" part="input-label">
|
|
1109
1112
|
H
|
|
1110
1113
|
</cx-typography></cx-input></div>${M(
|
|
1111
1114
|
!this.noRatioModes,
|
|
1112
|
-
() =>
|
|
1115
|
+
() => b`<cx-select data-testid="cx-asset-link-format-crop-unit" value=${this.unit} hoist class="crop__unit-select" ?disabled=${this.loading} @cx-change=${this.onUnitChange}><cx-option value=${o.Pixel}>${this.localize.term("pixels")}</cx-option><cx-option value=${o.AspectRatio}>${this.localize.term("aspectRatio")}</cx-option></cx-select>`
|
|
1113
1116
|
)}</cx-space>${M(
|
|
1114
1117
|
this.focusModes.length > 0,
|
|
1115
|
-
() =>
|
|
1118
|
+
() => b`<cx-select data-testid="cx-asset-link-format-crop-focus-mode" value=${this.focusMode} hoist style=${O({
|
|
1116
1119
|
width: "100%"
|
|
1117
1120
|
})} @cx-change=${this.onFocusModeChange} ?disabled=${this.loading || this.selectedMode?.disabledSize}>${ot(
|
|
1118
1121
|
this.focusModes,
|
|
1119
1122
|
(i) => i.value,
|
|
1120
|
-
({ label: i, value: s }) =>
|
|
1123
|
+
({ label: i, value: s }) => b`<cx-option value=${s}>${i}</cx-option>`
|
|
1121
1124
|
)}</cx-select>`
|
|
1122
1125
|
)}
|
|
1123
1126
|
${M(
|
|
1124
1127
|
this.showPositionPicker && this.focusMode === "manual",
|
|
1125
|
-
() =>
|
|
1128
|
+
() => b`<cx-position-picker data-testid="cx-asset-link-format-crop-position" value=${this.position} @cx-change=${this.onPositionChange}></cx-position-picker>`
|
|
1126
1129
|
)}<cx-button data-testid="cx-asset-link-format-crop-apply" variant="primary" ?disabled=${this.disabledApply || this.invalidHeight || this.invalidWidth} ?loading=${this.loading} style=${O({
|
|
1127
1130
|
marginLeft: "auto"
|
|
1128
1131
|
})} @click=${this.handleApply}>${this.localize.term("apply")}</cx-button></cx-space></cx-details>`;
|
|
@@ -1137,7 +1140,7 @@ v.dependencies = {
|
|
|
1137
1140
|
"cx-icon-button": $t,
|
|
1138
1141
|
"cx-input": Pt,
|
|
1139
1142
|
"cx-option": vt,
|
|
1140
|
-
"cx-position-picker":
|
|
1143
|
+
"cx-position-picker": le,
|
|
1141
1144
|
"cx-select": zt,
|
|
1142
1145
|
"cx-space": B,
|
|
1143
1146
|
"cx-typography": q
|
|
@@ -1234,8 +1237,8 @@ v = z([
|
|
|
1234
1237
|
], v);
|
|
1235
1238
|
const De = V`.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%}}`;
|
|
1236
1239
|
var Ne = Object.defineProperty, Oe = Object.getOwnPropertyDescriptor, _t = (t, e, i, s) => {
|
|
1237
|
-
for (var a = s > 1 ? void 0 : s ? Oe(e, i) : e,
|
|
1238
|
-
(
|
|
1240
|
+
for (var a = s > 1 ? void 0 : s ? Oe(e, i) : e, r = t.length - 1, n; r >= 0; r--)
|
|
1241
|
+
(n = t[r]) && (a = (s ? n(e, i, a) : n(a)) || a);
|
|
1239
1242
|
return s && a && Ne(e, i, a), a;
|
|
1240
1243
|
};
|
|
1241
1244
|
let Z = class extends j {
|
|
@@ -1249,10 +1252,10 @@ let Z = class extends j {
|
|
|
1249
1252
|
});
|
|
1250
1253
|
}
|
|
1251
1254
|
render() {
|
|
1252
|
-
return
|
|
1255
|
+
return b`<cx-space direction="vertical" spacing="small" class="extension"><cx-typography variant="body2">${this.localize.term("extension")}</cx-typography><cx-select data-label=${this.localize.term("extension")} data-testid="cx-asset-link-format-extension-select" value=${this.value} hoist @cx-change=${this.handleExtensionChange}>${ot(
|
|
1253
1256
|
this.items,
|
|
1254
1257
|
(t) => t.value,
|
|
1255
|
-
(t) =>
|
|
1258
|
+
(t) => b`<cx-option value=${t.value}>${t.displayName}</cx-option>`
|
|
1256
1259
|
)}</cx-select></cx-space>`;
|
|
1257
1260
|
}
|
|
1258
1261
|
};
|
|
@@ -1274,8 +1277,8 @@ Z = _t([
|
|
|
1274
1277
|
], Z);
|
|
1275
1278
|
const Le = V`cx-details::part(base){border-bottom-width:0}`;
|
|
1276
1279
|
var Ue = Object.defineProperty, Be = Object.getOwnPropertyDescriptor, W = (t, e, i, s) => {
|
|
1277
|
-
for (var a = s > 1 ? void 0 : s ? Be(e, i) : e,
|
|
1278
|
-
(
|
|
1280
|
+
for (var a = s > 1 ? void 0 : s ? Be(e, i) : e, r = t.length - 1, n; r >= 0; r--)
|
|
1281
|
+
(n = t[r]) && (a = (s ? n(e, i, a) : n(a)) || a);
|
|
1279
1282
|
return s && a && Ue(e, i, a), a;
|
|
1280
1283
|
};
|
|
1281
1284
|
const kt = "auto";
|
|
@@ -1338,14 +1341,14 @@ let I = class extends j {
|
|
|
1338
1341
|
t.target !== this.base && t.stopPropagation();
|
|
1339
1342
|
}
|
|
1340
1343
|
render() {
|
|
1341
|
-
return
|
|
1344
|
+
return b`<cx-details class="details" ?open=${this.open} @cx-show=${this.onShowDetails} @cx-hide=${this.onHideDetails}><cx-space slot="summary" align-items="center"><div part="icon"><cx-icon name="photo_size_select_large"></cx-icon></div><cx-typography variant="body2">${this.localize.term("format")}</cx-typography></cx-space><cx-space direction="vertical" spacing="small" class="format"><cx-select data-label=${this.localize.term("imageFormat")} data-testid="cx-asset-link-format-proxy-select" value=${this.scopedValue} hoist @cx-change=${this.handleProxyChange} ?disabled=${this.loading}>${ot(
|
|
1342
1345
|
this.items,
|
|
1343
1346
|
(t) => t.id,
|
|
1344
|
-
(t) =>
|
|
1347
|
+
(t) => b`<cx-option value=${t.id}>${t.proxyLabel}</cx-option>`
|
|
1345
1348
|
)}
|
|
1346
1349
|
${M(
|
|
1347
1350
|
this.canAutoFormat,
|
|
1348
|
-
() =>
|
|
1351
|
+
() => b`<cx-divider></cx-divider><cx-option data-testid="cx-asset-link-format-proxy-auto-option" value=${kt}>${this.localize.term("auto")}</cx-option>`,
|
|
1349
1352
|
() => qt
|
|
1350
1353
|
)}</cx-select><cx-button data-testid="cx-asset-link-format-proxy-apply" variant="primary" style=${O({
|
|
1351
1354
|
"margin-left": "auto"
|
|
@@ -1399,8 +1402,8 @@ I = W([
|
|
|
1399
1402
|
], I);
|
|
1400
1403
|
const qe = V`cx-details::part(base){border-bottom-width:0}`;
|
|
1401
1404
|
var je = Object.defineProperty, Ve = Object.getOwnPropertyDescriptor, tt = (t, e, i, s) => {
|
|
1402
|
-
for (var a = s > 1 ? void 0 : s ? Ve(e, i) : e,
|
|
1403
|
-
(
|
|
1405
|
+
for (var a = s > 1 ? void 0 : s ? Ve(e, i) : e, r = t.length - 1, n; r >= 0; r--)
|
|
1406
|
+
(n = t[r]) && (a = (s ? n(e, i, a) : n(a)) || a);
|
|
1404
1407
|
return s && a && je(e, i, a), a;
|
|
1405
1408
|
};
|
|
1406
1409
|
let H = class extends j {
|
|
@@ -1449,7 +1452,7 @@ let H = class extends j {
|
|
|
1449
1452
|
t.target !== this.base && t.stopPropagation();
|
|
1450
1453
|
}
|
|
1451
1454
|
render() {
|
|
1452
|
-
return
|
|
1455
|
+
return b`<cx-details class="details" ?open=${this.open} @cx-show=${this.onShowDetails} @cx-hide=${this.onHideDetails}><cx-space slot="summary" align-items="center"><div class="details__summary__icon"><div part="icon"><cx-icon name="blur_on"></cx-icon></div></div><cx-typography variant="body2">${this.localize.term("quality")}</cx-typography></cx-space><cx-space spacing="small"><cx-tooltip data-testid="cx-asset-link-format-quality-tooltip" content=${this.localize.term("qualityHelpText")} hoist><cx-input data-testid="cx-asset-link-format-quality" class="details__checkbox" mask="num" .maskBlocks=${{ num: { mask: Number, max: 100, min: 1 } }} value=${this.scopedValue.toString()} style=${O({
|
|
1453
1456
|
flex: "1"
|
|
1454
1457
|
})} @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>`;
|
|
1455
1458
|
}
|
|
@@ -1487,15 +1490,15 @@ H = tt([
|
|
|
1487
1490
|
], H);
|
|
1488
1491
|
const Ge = V`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}`;
|
|
1489
1492
|
var Qe = Object.defineProperty, Xe = Object.getOwnPropertyDescriptor, $ = (t, e, i, s) => {
|
|
1490
|
-
for (var a = s > 1 ? void 0 : s ? Xe(e, i) : e,
|
|
1491
|
-
(
|
|
1493
|
+
for (var a = s > 1 ? void 0 : s ? Xe(e, i) : e, r = t.length - 1, n; r >= 0; r--)
|
|
1494
|
+
(n = t[r]) && (a = (s ? n(e, i, a) : n(a)) || a);
|
|
1492
1495
|
return s && a && Qe(e, i, a), a;
|
|
1493
1496
|
};
|
|
1494
1497
|
let k = class extends j {
|
|
1495
1498
|
constructor() {
|
|
1496
|
-
super(...arguments), this.localize = new G(this), this.open = !1, this.width = 0, this.height = 0, this.maxWidth = 0, this.maxHeight = 0, this.ratioWidth = 1, this.ratioHeight = 1, this.unit =
|
|
1497
|
-
[
|
|
1498
|
-
[
|
|
1499
|
+
super(...arguments), this.localize = new G(this), this.open = !1, this.width = 0, this.height = 0, this.maxWidth = 0, this.maxHeight = 0, this.ratioWidth = 1, this.ratioHeight = 1, this.unit = o.Pixel, this.lastAppliedSetting = {
|
|
1500
|
+
[o.Pixel]: { height: 0, width: 0 },
|
|
1501
|
+
[o.AspectRatio]: { height: 1, width: 1 }
|
|
1499
1502
|
}, this.loading = !1, this.noRatioModes = !1, this.keepAspectRatio = !1, this.invalidWidth = !1, this.invalidHeight = !1, this.aspectRatio = 0;
|
|
1500
1503
|
}
|
|
1501
1504
|
/**
|
|
@@ -1509,11 +1512,11 @@ let k = class extends j {
|
|
|
1509
1512
|
async handleCropModeChange() {
|
|
1510
1513
|
const t = Number.isFinite(this.maxWidth) && Number.isFinite(this.maxHeight) && this.maxWidth > 0 && this.maxHeight > 0;
|
|
1511
1514
|
if (this.keepAspectRatio) {
|
|
1512
|
-
if (this.unit ===
|
|
1515
|
+
if (this.unit === o.AspectRatio && this.ratioWidth && this.ratioHeight) {
|
|
1513
1516
|
this.aspectRatio = this.ratioWidth / this.ratioHeight;
|
|
1514
1517
|
return;
|
|
1515
1518
|
}
|
|
1516
|
-
if (this.unit ===
|
|
1519
|
+
if (this.unit === o.Pixel && !t && this.width && this.height) {
|
|
1517
1520
|
this.aspectRatio = this.width / this.height;
|
|
1518
1521
|
return;
|
|
1519
1522
|
}
|
|
@@ -1544,8 +1547,8 @@ let k = class extends j {
|
|
|
1544
1547
|
}
|
|
1545
1548
|
this.invalidWidth = !1;
|
|
1546
1549
|
let e = Number(t.target.value);
|
|
1547
|
-
this.unit ===
|
|
1548
|
-
let i = this.unit ===
|
|
1550
|
+
this.unit === o.Pixel && (e = Math.max(Math.min(e, this.maxWidth), 1)), t.target.value = e.toString();
|
|
1551
|
+
let i = this.unit === o.Pixel ? this.height : this.ratioHeight;
|
|
1549
1552
|
this.keepAspectRatio && (i = Math.min(
|
|
1550
1553
|
Math.round(e / this.aspectRatio),
|
|
1551
1554
|
this.maxHeight
|
|
@@ -1565,8 +1568,8 @@ let k = class extends j {
|
|
|
1565
1568
|
}
|
|
1566
1569
|
this.invalidHeight = !1;
|
|
1567
1570
|
let e = Number(t.target.value);
|
|
1568
|
-
this.unit ===
|
|
1569
|
-
let i = this.unit ===
|
|
1571
|
+
this.unit === o.Pixel && (e = Math.max(Math.min(e, this.maxHeight), 1)), t.target.value = e.toString();
|
|
1572
|
+
let i = this.unit === o.Pixel ? this.width : this.ratioWidth;
|
|
1570
1573
|
this.keepAspectRatio && (i = Math.min(
|
|
1571
1574
|
Math.round(e * this.aspectRatio),
|
|
1572
1575
|
this.maxWidth
|
|
@@ -1580,19 +1583,19 @@ let k = class extends j {
|
|
|
1580
1583
|
});
|
|
1581
1584
|
}
|
|
1582
1585
|
onUnitChange(t) {
|
|
1583
|
-
t.target.value ===
|
|
1586
|
+
t.target.value === o.AspectRatio ? this.emit("cx-asset-link-format-resize-change", {
|
|
1584
1587
|
detail: {
|
|
1585
|
-
height: this.lastAppliedSetting[
|
|
1588
|
+
height: this.lastAppliedSetting[o.AspectRatio].height,
|
|
1586
1589
|
keepAspectRatio: this.keepAspectRatio,
|
|
1587
|
-
unit:
|
|
1588
|
-
width: this.lastAppliedSetting[
|
|
1590
|
+
unit: o.AspectRatio,
|
|
1591
|
+
width: this.lastAppliedSetting[o.AspectRatio].width
|
|
1589
1592
|
}
|
|
1590
1593
|
}) : this.emit("cx-asset-link-format-resize-change", {
|
|
1591
1594
|
detail: {
|
|
1592
|
-
height: this.lastAppliedSetting[
|
|
1595
|
+
height: this.lastAppliedSetting[o.Pixel].height,
|
|
1593
1596
|
keepAspectRatio: this.keepAspectRatio,
|
|
1594
|
-
unit:
|
|
1595
|
-
width: this.lastAppliedSetting[
|
|
1597
|
+
unit: o.Pixel,
|
|
1598
|
+
width: this.lastAppliedSetting[o.Pixel].width
|
|
1596
1599
|
}
|
|
1597
1600
|
});
|
|
1598
1601
|
}
|
|
@@ -1624,23 +1627,23 @@ let k = class extends j {
|
|
|
1624
1627
|
handleAspectRatioClick() {
|
|
1625
1628
|
this.emit("cx-asset-link-format-resize-change", {
|
|
1626
1629
|
detail: {
|
|
1627
|
-
height: this.unit ===
|
|
1630
|
+
height: this.unit === o.Pixel ? this.height : this.ratioHeight,
|
|
1628
1631
|
keepAspectRatio: !this.keepAspectRatio,
|
|
1629
1632
|
unit: this.unit,
|
|
1630
|
-
width: this.unit ===
|
|
1633
|
+
width: this.unit === o.Pixel ? this.width : this.ratioWidth
|
|
1631
1634
|
}
|
|
1632
1635
|
});
|
|
1633
1636
|
}
|
|
1634
1637
|
render() {
|
|
1635
|
-
return
|
|
1638
|
+
return b`<cx-details class="details" ?open=${this.open} @cx-show=${this.onShowDetails} @cx-hide=${this.onHideDetails}><cx-space slot="summary" align-items="center"><div part="icon"><cx-icon name="aspect_ratio"></cx-icon></div><cx-typography variant="body2">${this.localize.term("resize")}</cx-typography></cx-space><cx-space direction="vertical" spacing="small"><cx-space spacing="small"><div class="resize__input-group"><cx-input data-testid="cx-asset-link-format-resize-width" placeholder=${this.localize.term("width")} mask="num" .maskBlocks=${{ num: { mask: Number, min: 1 } }} value=${this.unit === o.Pixel ? this.width.toString() : this.ratioWidth.toString()} @cx-input=${this.handleWidthChange} required ?disabled=${this.loading}><cx-typography slot="prefix" variant="body3" part="input-label">
|
|
1636
1639
|
W
|
|
1637
1640
|
</cx-typography></cx-input><cx-icon-button data-testid="cx-asset-link-format-resize-aspect-ratio" name=${this.keepAspectRatio ? "insert_link" : "link_off"} @click=${this.handleAspectRatioClick} style=${O({
|
|
1638
1641
|
color: this.keepAspectRatio ? "var(--cx-color-primary)" : void 0
|
|
1639
|
-
})} ?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 ===
|
|
1642
|
+
})} ?disabled=${this.loading}></cx-icon-button><cx-input data-testid="cx-asset-link-format-resize-height" placeholder=${this.localize.term("height")} mask="num" .maskBlocks=${{ num: { mask: Number, min: 1 } }} value=${this.unit === o.Pixel ? this.height.toString() : this.ratioHeight.toString()} @cx-input=${this.handleHeightChange} required ?disabled=${this.loading}><cx-typography slot="prefix" variant="body3" part="input-label">
|
|
1640
1643
|
H
|
|
1641
1644
|
</cx-typography></cx-input></div>${M(
|
|
1642
1645
|
!this.noRatioModes,
|
|
1643
|
-
() =>
|
|
1646
|
+
() => b`<cx-select data-testid="cx-asset-link-format-resize-unit" value=${this.unit} hoist class="resize__unit-select" @cx-change=${this.onUnitChange}><cx-option value=${o.Pixel}>${this.localize.term("pixels")}</cx-option><cx-option value=${o.AspectRatio}>${this.localize.term("aspectRatio")}</cx-option></cx-select>`
|
|
1644
1647
|
)}</cx-space><cx-button data-testid="cx-asset-link-format-resize-apply" variant="primary" ?disabled=${this.disabledApply || this.invalidHeight || this.invalidWidth} ?loading=${this.loading} style=${O({
|
|
1645
1648
|
marginLeft: "auto"
|
|
1646
1649
|
})} @click=${this.handleApply}>${this.localize.term("apply")}</cx-button></cx-space></cx-details>`;
|
|
@@ -1720,8 +1723,8 @@ k = $([
|
|
|
1720
1723
|
], k);
|
|
1721
1724
|
const Ke = V`cx-details::part(base){border-bottom-width:0}`;
|
|
1722
1725
|
var Ze = Object.defineProperty, Ye = Object.getOwnPropertyDescriptor, K = (t, e, i, s) => {
|
|
1723
|
-
for (var a = s > 1 ? void 0 : s ? Ye(e, i) : e,
|
|
1724
|
-
(
|
|
1726
|
+
for (var a = s > 1 ? void 0 : s ? Ye(e, i) : e, r = t.length - 1, n; r >= 0; r--)
|
|
1727
|
+
(n = t[r]) && (a = (s ? n(e, i, a) : n(a)) || a);
|
|
1725
1728
|
return s && a && Ze(e, i, a), a;
|
|
1726
1729
|
};
|
|
1727
1730
|
let T = class extends j {
|
|
@@ -1764,7 +1767,7 @@ let T = class extends j {
|
|
|
1764
1767
|
});
|
|
1765
1768
|
}
|
|
1766
1769
|
render() {
|
|
1767
|
-
return
|
|
1770
|
+
return b`<cx-details class="details" ?open=${this.open}><cx-space slot="summary" align-items="center"><div part="icon"><cx-icon name="rotate_90_degrees_cw"></cx-icon></div><cx-typography variant="body2">Rotate</cx-typography></cx-space><cx-space spacing="small"><cx-button-group label=${this.localize.term("history")}><cx-icon-button data-testid="cx-asset-link-format-rotation-ccw" name="rotate_90_degrees_ccw" label=${this.localize.term("undo")} outline size="small" ?disabled=${this.loading || this.value === -360} @click=${this.handleCounterClockwiseClick}></cx-icon-button><cx-icon-button data-testid="cx-asset-link-format-rotation-cw" name="rotate_90_degrees_cw" label=${this.localize.term("redo")} outline size="small" ?disabled=${this.loading || this.value === 360} @click=${this.handleClockwiseClick}></cx-icon-button></cx-button-group><cx-input data-testid="cx-asset-link-format-rotation" value=${(this.value + this.defaultValue).toString()} placeholder="0" mask="num" .maskBlocks=${{ num: { mask: Number, max: 360, min: -360, signed: !0 } }} ?disabled=${this.loading} style=${O({
|
|
1768
1771
|
flex: "none",
|
|
1769
1772
|
width: "80px"
|
|
1770
1773
|
})} @cx-input=${this.handleRotationChange}></cx-input><cx-button data-testid="cx-asset-link-format-rotation-apply" variant="primary" ?disabled=${this.value === this.lastAppliedValue} ?loading=${this.loading} @click=${this.handleApply}>${this.localize.term("apply")}</cx-button></cx-space></cx-details>`;
|
|
@@ -1773,7 +1776,7 @@ let T = class extends j {
|
|
|
1773
1776
|
T.styles = [Q, Ke];
|
|
1774
1777
|
T.dependencies = {
|
|
1775
1778
|
"cx-button": Y,
|
|
1776
|
-
"cx-button-group":
|
|
1779
|
+
"cx-button-group": pe,
|
|
1777
1780
|
"cx-details": st,
|
|
1778
1781
|
"cx-icon": at,
|
|
1779
1782
|
"cx-icon-button": $t,
|
|
@@ -1805,9 +1808,9 @@ T = K([
|
|
|
1805
1808
|
X("cx-asset-link-format-rotation")
|
|
1806
1809
|
], T);
|
|
1807
1810
|
const Je = V`cx-details::part(base){border-bottom-width:0}`;
|
|
1808
|
-
var ti = Object.defineProperty, ei = Object.getOwnPropertyDescriptor,
|
|
1809
|
-
for (var a = s > 1 ? void 0 : s ? ei(e, i) : e,
|
|
1810
|
-
(
|
|
1811
|
+
var ti = Object.defineProperty, ei = Object.getOwnPropertyDescriptor, bt = (t, e, i, s) => {
|
|
1812
|
+
for (var a = s > 1 ? void 0 : s ? ei(e, i) : e, r = t.length - 1, n; r >= 0; r--)
|
|
1813
|
+
(n = t[r]) && (a = (s ? n(e, i, a) : n(a)) || a);
|
|
1811
1814
|
return s && a && ti(e, i, a), a;
|
|
1812
1815
|
};
|
|
1813
1816
|
let U = class extends j {
|
|
@@ -1836,37 +1839,37 @@ let U = class extends j {
|
|
|
1836
1839
|
t.target !== this.base && t.stopPropagation();
|
|
1837
1840
|
}
|
|
1838
1841
|
render() {
|
|
1839
|
-
return
|
|
1842
|
+
return b`<cx-details class="details" ?open=${this.open} @cx-show=${this.onShowDetails} @cx-hide=${this.onHideDetails}><cx-space slot="summary" align-items="center"><div class="details__summary__icon"><div part="icon"><cx-icon name="short_text"></cx-icon></div></div><cx-typography variant="body2">${this.localize.term("metadata")}</cx-typography></cx-space><cx-space spacing="small"><cx-tooltip data-testid="cx-asset-link-format-metadata-tooltip" content=${this.localize.term("metadataHelpText")} hoist><cx-checkbox data-testid="cx-asset-link-format-metadata" class="details__checkbox" ?checked=${this.value} @cx-change=${this.handleApply}>${this.localize.term("preserveMetadata")}</cx-checkbox></cx-tooltip></cx-space></cx-details>`;
|
|
1840
1843
|
}
|
|
1841
1844
|
};
|
|
1842
1845
|
U.styles = [Q, Je];
|
|
1843
1846
|
U.dependencies = {
|
|
1844
1847
|
"cx-button": Y,
|
|
1845
|
-
"cx-checkbox":
|
|
1848
|
+
"cx-checkbox": de,
|
|
1846
1849
|
"cx-details": st,
|
|
1847
1850
|
"cx-icon": at,
|
|
1848
1851
|
"cx-space": B,
|
|
1849
1852
|
"cx-tooltip": Gt,
|
|
1850
1853
|
"cx-typography": q
|
|
1851
1854
|
};
|
|
1852
|
-
|
|
1855
|
+
bt([
|
|
1853
1856
|
J(".details")
|
|
1854
1857
|
], U.prototype, "base", 2);
|
|
1855
|
-
|
|
1858
|
+
bt([
|
|
1856
1859
|
h({ reflect: !0, type: Boolean })
|
|
1857
1860
|
], U.prototype, "open", 2);
|
|
1858
|
-
|
|
1861
|
+
bt([
|
|
1859
1862
|
h({ reflect: !0, type: Boolean })
|
|
1860
1863
|
], U.prototype, "value", 2);
|
|
1861
|
-
U =
|
|
1864
|
+
U = bt([
|
|
1862
1865
|
X("cx-asset-link-format-metadata")
|
|
1863
1866
|
], U);
|
|
1864
|
-
var ii = Object.defineProperty, si = Object.getOwnPropertyDescriptor,
|
|
1865
|
-
for (var a = s > 1 ? void 0 : s ? si(e, i) : e,
|
|
1866
|
-
(
|
|
1867
|
+
var ii = Object.defineProperty, si = Object.getOwnPropertyDescriptor, y = (t, e, i, s) => {
|
|
1868
|
+
for (var a = s > 1 ? void 0 : s ? si(e, i) : e, r = t.length - 1, n; r >= 0; r--)
|
|
1869
|
+
(n = t[r]) && (a = (s ? n(e, i, a) : n(a)) || a);
|
|
1867
1870
|
return s && a && ii(e, i, a), a;
|
|
1868
1871
|
};
|
|
1869
|
-
let
|
|
1872
|
+
let m = class extends j {
|
|
1870
1873
|
constructor() {
|
|
1871
1874
|
super(), this.localize = new G(this), this.baseUrl = void 0, this.token = void 0, this.asset = void 0, this.cropModes = [
|
|
1872
1875
|
{
|
|
@@ -1940,7 +1943,7 @@ let f = class extends j {
|
|
|
1940
1943
|
keepAspectRatio: !0,
|
|
1941
1944
|
ratioHeight: 1,
|
|
1942
1945
|
ratioWidth: 1,
|
|
1943
|
-
unit:
|
|
1946
|
+
unit: o.Pixel,
|
|
1944
1947
|
width: 1
|
|
1945
1948
|
}, this.cropSize = {
|
|
1946
1949
|
cropMode: "free",
|
|
@@ -1957,14 +1960,14 @@ let f = class extends j {
|
|
|
1957
1960
|
position: N.CenterCenter,
|
|
1958
1961
|
ratioHeight: 1,
|
|
1959
1962
|
ratioWidth: 1,
|
|
1960
|
-
unit:
|
|
1963
|
+
unit: o.Pixel,
|
|
1961
1964
|
width: 1,
|
|
1962
1965
|
x: 0,
|
|
1963
1966
|
y: 0
|
|
1964
1967
|
}, this.rotation = 0, this.defaultSize = {
|
|
1965
1968
|
height: 0,
|
|
1966
1969
|
width: 0
|
|
1967
|
-
}, this.cropperElement = null, this.parameters = [], this.loading = !1, this.lastAction = void 0, this.frozenIndex = void 0, this.preResetTransformations = void 0, this.preResetAutoFormat = void 0, this.preResetSelectedProxy = void 0, this.apiGetTransformAssetLink =
|
|
1970
|
+
}, this.cropperElement = null, this.parameters = [], this.loading = !1, this.lastAction = void 0, this.frozenIndex = void 0, this.preResetTransformations = void 0, this.preResetAutoFormat = void 0, this.preResetSelectedProxy = void 0, this.apiGetTransformAssetLink = we, this.apiGetCropFocusMode = Fe, this.onCropComplete = this.onCropComplete.bind(this), this.onCropDragStart = this.onCropDragStart.bind(this);
|
|
1968
1971
|
}
|
|
1969
1972
|
/**
|
|
1970
1973
|
* Transform requests must resolve to a web-displayable image (the browser renders the
|
|
@@ -1973,7 +1976,7 @@ let f = class extends j {
|
|
|
1973
1976
|
* extension fallback in asset-transformation-dialog.
|
|
1974
1977
|
*/
|
|
1975
1978
|
static getTransformExtension(t) {
|
|
1976
|
-
return !t ||
|
|
1979
|
+
return !t || Ie(t) ? t : "jpg";
|
|
1977
1980
|
}
|
|
1978
1981
|
/** True when there are transformations beyond the frozen index (i.e. user has added new ones). */
|
|
1979
1982
|
get hasUnfrozenTransformations() {
|
|
@@ -1986,8 +1989,8 @@ let f = class extends j {
|
|
|
1986
1989
|
*/
|
|
1987
1990
|
get lastAppliedCropUnit() {
|
|
1988
1991
|
return this.transformations.findLast(
|
|
1989
|
-
(e) => e.key ===
|
|
1990
|
-
)?.value.unit ??
|
|
1992
|
+
(e) => e.key === f.Crop
|
|
1993
|
+
)?.value.unit ?? o.Pixel;
|
|
1991
1994
|
}
|
|
1992
1995
|
/**
|
|
1993
1996
|
* The focus mode of the last applied crop transformation, for the no-asset case only.
|
|
@@ -1996,7 +1999,7 @@ let f = class extends j {
|
|
|
1996
1999
|
*/
|
|
1997
2000
|
get lastAppliedCropFocusMode() {
|
|
1998
2001
|
return this.transformations.findLast(
|
|
1999
|
-
(e) => e.key ===
|
|
2002
|
+
(e) => e.key === f.Crop
|
|
2000
2003
|
)?.value.focusMode ?? "manual";
|
|
2001
2004
|
}
|
|
2002
2005
|
/**
|
|
@@ -2006,7 +2009,7 @@ let f = class extends j {
|
|
|
2006
2009
|
*/
|
|
2007
2010
|
get lastAppliedCropPosition() {
|
|
2008
2011
|
return this.transformations.findLast(
|
|
2009
|
-
(e) => e.key ===
|
|
2012
|
+
(e) => e.key === f.Crop
|
|
2010
2013
|
)?.value.position ?? N.CenterCenter;
|
|
2011
2014
|
}
|
|
2012
2015
|
/**
|
|
@@ -2018,8 +2021,8 @@ let f = class extends j {
|
|
|
2018
2021
|
get disabledCropApply() {
|
|
2019
2022
|
if (!this.asset && this.cropSize.unit !== this.lastAppliedCropUnit)
|
|
2020
2023
|
return !1;
|
|
2021
|
-
if (this.cropSize.unit ===
|
|
2022
|
-
const e = this.lastCropSize[
|
|
2024
|
+
if (this.cropSize.unit === o.AspectRatio && !this.asset) {
|
|
2025
|
+
const e = this.lastCropSize[o.AspectRatio];
|
|
2023
2026
|
return this.cropSize.ratioWidth === e.width && this.cropSize.ratioHeight === e.height && this.cropSize.focusMode === this.lastAppliedCropFocusMode && this.cropSize.position === this.lastAppliedCropPosition;
|
|
2024
2027
|
}
|
|
2025
2028
|
if (!this.asset && this.cropSize.focusMode !== this.lastAppliedCropFocusMode || !this.asset && this.cropSize.position !== this.lastAppliedCropPosition)
|
|
@@ -2033,7 +2036,7 @@ let f = class extends j {
|
|
|
2033
2036
|
"y"
|
|
2034
2037
|
];
|
|
2035
2038
|
for (const e of t)
|
|
2036
|
-
if (this.cropSize[e] !== this.lastCropSize[
|
|
2039
|
+
if (this.cropSize[e] !== this.lastCropSize[o.Pixel][e])
|
|
2037
2040
|
return !1;
|
|
2038
2041
|
return !0;
|
|
2039
2042
|
}
|
|
@@ -2058,15 +2061,15 @@ let f = class extends j {
|
|
|
2058
2061
|
get lastCropSize() {
|
|
2059
2062
|
if (!this.asset) {
|
|
2060
2063
|
const e = this.transformations.findLast(
|
|
2061
|
-
(i) => i.key ===
|
|
2064
|
+
(i) => i.key === f.Crop
|
|
2062
2065
|
);
|
|
2063
|
-
if (e?.value.unit ===
|
|
2066
|
+
if (e?.value.unit === o.AspectRatio && e.value.ratioWidth && e.value.ratioHeight)
|
|
2064
2067
|
return {
|
|
2065
|
-
[
|
|
2068
|
+
[o.AspectRatio]: {
|
|
2066
2069
|
height: e.value.ratioHeight,
|
|
2067
2070
|
percentageHeight: 100,
|
|
2068
2071
|
percentageWidth: 100,
|
|
2069
|
-
unit:
|
|
2072
|
+
unit: o.AspectRatio,
|
|
2070
2073
|
width: e.value.ratioWidth,
|
|
2071
2074
|
x: 0,
|
|
2072
2075
|
y: 0
|
|
@@ -2077,56 +2080,56 @@ let f = class extends j {
|
|
|
2077
2080
|
* `min: 1`) instead of 0x0, so switching the unit selector back to Pixel and
|
|
2078
2081
|
* clicking Apply immediately still commits a meaningful crop instead of a no-op.
|
|
2079
2082
|
*/
|
|
2080
|
-
[
|
|
2083
|
+
[o.Pixel]: {
|
|
2081
2084
|
height: 1,
|
|
2082
2085
|
percentageHeight: 100,
|
|
2083
2086
|
percentageWidth: 100,
|
|
2084
|
-
unit:
|
|
2087
|
+
unit: o.Pixel,
|
|
2085
2088
|
width: 1,
|
|
2086
2089
|
x: 0,
|
|
2087
2090
|
y: 0
|
|
2088
2091
|
}
|
|
2089
2092
|
};
|
|
2090
2093
|
if (e?.value.width && e?.value.height) {
|
|
2091
|
-
const { height: i, width: s, x: a = 0, y:
|
|
2094
|
+
const { height: i, width: s, x: a = 0, y: r = 0 } = e.value, n = pt(s, i);
|
|
2092
2095
|
return {
|
|
2093
|
-
[
|
|
2094
|
-
height:
|
|
2096
|
+
[o.AspectRatio]: {
|
|
2097
|
+
height: n.height,
|
|
2095
2098
|
percentageHeight: 100,
|
|
2096
2099
|
percentageWidth: 100,
|
|
2097
|
-
unit:
|
|
2098
|
-
width:
|
|
2100
|
+
unit: o.AspectRatio,
|
|
2101
|
+
width: n.width,
|
|
2099
2102
|
x: 0,
|
|
2100
2103
|
y: 0
|
|
2101
2104
|
},
|
|
2102
|
-
[
|
|
2105
|
+
[o.Pixel]: {
|
|
2103
2106
|
height: i,
|
|
2104
2107
|
percentageHeight: 100,
|
|
2105
2108
|
percentageWidth: 100,
|
|
2106
|
-
unit:
|
|
2109
|
+
unit: o.Pixel,
|
|
2107
2110
|
width: s,
|
|
2108
2111
|
x: a,
|
|
2109
|
-
y:
|
|
2112
|
+
y: r
|
|
2110
2113
|
}
|
|
2111
2114
|
};
|
|
2112
2115
|
}
|
|
2113
2116
|
}
|
|
2114
2117
|
const t = this.lastImageSize.width && this.lastImageSize.height ? pt(this.lastImageSize.width, this.lastImageSize.height) : { height: 1, width: 1 };
|
|
2115
2118
|
return {
|
|
2116
|
-
[
|
|
2119
|
+
[o.AspectRatio]: {
|
|
2117
2120
|
height: t.height,
|
|
2118
2121
|
percentageHeight: 100,
|
|
2119
2122
|
percentageWidth: 100,
|
|
2120
|
-
unit:
|
|
2123
|
+
unit: o.AspectRatio,
|
|
2121
2124
|
width: t.width,
|
|
2122
2125
|
x: 0,
|
|
2123
2126
|
y: 0
|
|
2124
2127
|
},
|
|
2125
|
-
[
|
|
2128
|
+
[o.Pixel]: {
|
|
2126
2129
|
height: this.lastImageSize.height,
|
|
2127
2130
|
percentageHeight: 100,
|
|
2128
2131
|
percentageWidth: 100,
|
|
2129
|
-
unit:
|
|
2132
|
+
unit: o.Pixel,
|
|
2130
2133
|
width: this.lastImageSize.width,
|
|
2131
2134
|
x: 0,
|
|
2132
2135
|
y: 0
|
|
@@ -2141,33 +2144,33 @@ let f = class extends j {
|
|
|
2141
2144
|
get lastResizeSize() {
|
|
2142
2145
|
if (!this.asset) {
|
|
2143
2146
|
const e = this.transformations.findLast(
|
|
2144
|
-
(i) => i.key ===
|
|
2147
|
+
(i) => i.key === f.Resize
|
|
2145
2148
|
);
|
|
2146
|
-
if (e?.value.unit ===
|
|
2149
|
+
if (e?.value.unit === o.AspectRatio && e.value.ratioWidth && e.value.ratioHeight)
|
|
2147
2150
|
return {
|
|
2148
|
-
[
|
|
2151
|
+
[o.AspectRatio]: {
|
|
2149
2152
|
height: e.value.ratioHeight,
|
|
2150
|
-
unit:
|
|
2153
|
+
unit: o.AspectRatio,
|
|
2151
2154
|
width: e.value.ratioWidth
|
|
2152
2155
|
},
|
|
2153
2156
|
// See lastCropSize's equivalent branch for why this falls back to 1x1, not 0x0.
|
|
2154
|
-
[
|
|
2157
|
+
[o.Pixel]: {
|
|
2155
2158
|
height: 1,
|
|
2156
|
-
unit:
|
|
2159
|
+
unit: o.Pixel,
|
|
2157
2160
|
width: 1
|
|
2158
2161
|
}
|
|
2159
2162
|
};
|
|
2160
2163
|
if (e?.value.width && e?.value.height) {
|
|
2161
2164
|
const { height: i, width: s } = e.value, a = pt(s, i);
|
|
2162
2165
|
return {
|
|
2163
|
-
[
|
|
2166
|
+
[o.AspectRatio]: {
|
|
2164
2167
|
height: a.height,
|
|
2165
|
-
unit:
|
|
2168
|
+
unit: o.AspectRatio,
|
|
2166
2169
|
width: a.width
|
|
2167
2170
|
},
|
|
2168
|
-
[
|
|
2171
|
+
[o.Pixel]: {
|
|
2169
2172
|
height: i,
|
|
2170
|
-
unit:
|
|
2173
|
+
unit: o.Pixel,
|
|
2171
2174
|
width: s
|
|
2172
2175
|
}
|
|
2173
2176
|
};
|
|
@@ -2175,14 +2178,14 @@ let f = class extends j {
|
|
|
2175
2178
|
}
|
|
2176
2179
|
const t = this.lastImageSize.width && this.lastImageSize.height ? pt(this.lastImageSize.width, this.lastImageSize.height) : { height: 1, width: 1 };
|
|
2177
2180
|
return {
|
|
2178
|
-
[
|
|
2181
|
+
[o.AspectRatio]: {
|
|
2179
2182
|
height: t.height,
|
|
2180
|
-
unit:
|
|
2183
|
+
unit: o.AspectRatio,
|
|
2181
2184
|
width: t.width
|
|
2182
2185
|
},
|
|
2183
|
-
[
|
|
2186
|
+
[o.Pixel]: {
|
|
2184
2187
|
height: this.lastImageSize.height,
|
|
2185
|
-
unit:
|
|
2188
|
+
unit: o.Pixel,
|
|
2186
2189
|
width: this.lastImageSize.width
|
|
2187
2190
|
}
|
|
2188
2191
|
};
|
|
@@ -2197,7 +2200,7 @@ let f = class extends j {
|
|
|
2197
2200
|
*/
|
|
2198
2201
|
get lastRotation() {
|
|
2199
2202
|
return this.asset ? 0 : this.transformations.findLast(
|
|
2200
|
-
(e) => e.key ===
|
|
2203
|
+
(e) => e.key === f.Rotate
|
|
2201
2204
|
)?.value.rotation ?? 0;
|
|
2202
2205
|
}
|
|
2203
2206
|
/**
|
|
@@ -2243,13 +2246,13 @@ let f = class extends j {
|
|
|
2243
2246
|
);
|
|
2244
2247
|
this.loading = !0, this.apiGetTransformAssetLink({
|
|
2245
2248
|
assetId: this.asset.id,
|
|
2246
|
-
extension:
|
|
2249
|
+
extension: m.getTransformExtension(this.asset.extension),
|
|
2247
2250
|
format: e?.proxyName ?? "",
|
|
2248
2251
|
siteUrl: this.baseUrl,
|
|
2249
2252
|
token: this.token,
|
|
2250
2253
|
transformations: this.transformationString
|
|
2251
2254
|
}).then((s) => {
|
|
2252
|
-
this.loading = !1, !(!s?.relativePath || !this.selectedFormat) && (this.lastAction ===
|
|
2255
|
+
this.loading = !1, !(!s?.relativePath || !this.selectedFormat) && (this.lastAction === f.Rotate && (this.rotation = 0), this.lastAction = void 0, this.lastImageSize = {
|
|
2253
2256
|
height: s.height,
|
|
2254
2257
|
width: s.width
|
|
2255
2258
|
}, this.selectedFormat = {
|
|
@@ -2307,35 +2310,35 @@ let f = class extends j {
|
|
|
2307
2310
|
useSession: this.useSession
|
|
2308
2311
|
}).replace(/\/t\//g, "")
|
|
2309
2312
|
});
|
|
2310
|
-
const
|
|
2311
|
-
(c) => c.key ===
|
|
2313
|
+
const r = this.transformations.findLast(
|
|
2314
|
+
(c) => c.key === f.Crop && (c.value.unit === o.AspectRatio && c.value.ratioWidth && c.value.ratioHeight || c.value.width && c.value.height)
|
|
2312
2315
|
);
|
|
2313
|
-
if (
|
|
2314
|
-
const { focusMode: c, position:
|
|
2316
|
+
if (r?.value.unit === o.AspectRatio && r.value.ratioWidth && r.value.ratioHeight) {
|
|
2317
|
+
const { focusMode: c, position: S, ratioHeight: A, ratioWidth: p } = r.value;
|
|
2315
2318
|
this.cropSize = {
|
|
2316
2319
|
...this.cropSize,
|
|
2317
2320
|
cropMode: "free",
|
|
2318
2321
|
focusMode: c ?? "manual",
|
|
2319
2322
|
percentageHeight: 100,
|
|
2320
2323
|
percentageWidth: 100,
|
|
2321
|
-
position:
|
|
2324
|
+
position: S ?? N.CenterCenter,
|
|
2322
2325
|
ratioHeight: A,
|
|
2323
2326
|
ratioWidth: p,
|
|
2324
|
-
unit:
|
|
2327
|
+
unit: o.AspectRatio
|
|
2325
2328
|
};
|
|
2326
|
-
} else if (
|
|
2327
|
-
const { focusMode: c, height:
|
|
2329
|
+
} else if (r) {
|
|
2330
|
+
const { focusMode: c, height: S, position: A, unit: p, width: x, x: w = 0, y: u = 0 } = r.value;
|
|
2328
2331
|
this.cropSize = {
|
|
2329
2332
|
...this.cropSize,
|
|
2330
2333
|
cropMode: "free",
|
|
2331
2334
|
focusMode: c ?? "manual",
|
|
2332
|
-
height:
|
|
2335
|
+
height: S,
|
|
2333
2336
|
percentageHeight: 100,
|
|
2334
2337
|
percentageWidth: 100,
|
|
2335
2338
|
position: A ?? N.CenterCenter,
|
|
2336
|
-
unit: p ??
|
|
2339
|
+
unit: p ?? o.Pixel,
|
|
2337
2340
|
width: x,
|
|
2338
|
-
x:
|
|
2341
|
+
x: w,
|
|
2339
2342
|
y: u
|
|
2340
2343
|
};
|
|
2341
2344
|
} else
|
|
@@ -2353,28 +2356,28 @@ let f = class extends j {
|
|
|
2353
2356
|
percentageHeight: 0,
|
|
2354
2357
|
percentageWidth: 0,
|
|
2355
2358
|
position: N.CenterCenter,
|
|
2356
|
-
unit:
|
|
2359
|
+
unit: o.Pixel,
|
|
2357
2360
|
width: 1,
|
|
2358
2361
|
x: 0,
|
|
2359
2362
|
y: 0
|
|
2360
2363
|
};
|
|
2361
|
-
const
|
|
2362
|
-
(c) => c.key ===
|
|
2364
|
+
const n = this.transformations.findLast(
|
|
2365
|
+
(c) => c.key === f.Resize && (c.value.unit === o.AspectRatio && c.value.ratioWidth && c.value.ratioHeight || c.value.width || c.value.height)
|
|
2363
2366
|
);
|
|
2364
|
-
if (
|
|
2365
|
-
const { ratioHeight: c, ratioWidth:
|
|
2367
|
+
if (n?.value.unit === o.AspectRatio && n.value.ratioWidth && n.value.ratioHeight) {
|
|
2368
|
+
const { ratioHeight: c, ratioWidth: S } = n.value;
|
|
2366
2369
|
this.resizeSize = {
|
|
2367
2370
|
...this.resizeSize,
|
|
2368
2371
|
ratioHeight: c,
|
|
2369
|
-
ratioWidth:
|
|
2370
|
-
unit:
|
|
2372
|
+
ratioWidth: S,
|
|
2373
|
+
unit: o.AspectRatio
|
|
2371
2374
|
};
|
|
2372
|
-
} else if (
|
|
2373
|
-
const { height: c = 0, unit:
|
|
2375
|
+
} else if (n) {
|
|
2376
|
+
const { height: c = 0, unit: S, width: A = 0 } = n.value;
|
|
2374
2377
|
this.resizeSize = {
|
|
2375
2378
|
...this.resizeSize,
|
|
2376
2379
|
height: c,
|
|
2377
|
-
unit:
|
|
2380
|
+
unit: S ?? o.Pixel,
|
|
2378
2381
|
width: A
|
|
2379
2382
|
};
|
|
2380
2383
|
} else
|
|
@@ -2386,20 +2389,20 @@ let f = class extends j {
|
|
|
2386
2389
|
* Apply silently no-op.
|
|
2387
2390
|
*/
|
|
2388
2391
|
height: 1,
|
|
2389
|
-
unit:
|
|
2392
|
+
unit: o.Pixel,
|
|
2390
2393
|
width: 1
|
|
2391
2394
|
};
|
|
2392
2395
|
const l = this.transformations.findLast(
|
|
2393
|
-
(c) => c.key ===
|
|
2396
|
+
(c) => c.key === f.Rotate
|
|
2394
2397
|
);
|
|
2395
2398
|
this.rotation = l?.value.rotation ?? 0;
|
|
2396
|
-
const d = this.transformations.findLast((c) => c.key ===
|
|
2397
|
-
(c) => c.key ===
|
|
2399
|
+
const d = this.transformations.findLast((c) => c.key === f.Quality)?.value.quality ?? 100, g = this.transformations.some(
|
|
2400
|
+
(c) => c.key === f.Metadata
|
|
2398
2401
|
);
|
|
2399
|
-
this.selectedFormat ? this.selectedFormat = { ...this.selectedFormat, keepMetadata:
|
|
2402
|
+
this.selectedFormat ? this.selectedFormat = { ...this.selectedFormat, keepMetadata: g, quality: d } : this.selectedFormat = {
|
|
2400
2403
|
extension: "",
|
|
2401
2404
|
height: 0,
|
|
2402
|
-
keepMetadata:
|
|
2405
|
+
keepMetadata: g,
|
|
2403
2406
|
quality: d,
|
|
2404
2407
|
rotation: 0,
|
|
2405
2408
|
url: "",
|
|
@@ -2412,12 +2415,12 @@ let f = class extends j {
|
|
|
2412
2415
|
if (!this.selectedFormat)
|
|
2413
2416
|
return;
|
|
2414
2417
|
const t = this.proxies?.find(
|
|
2415
|
-
(
|
|
2418
|
+
(r) => r.id === this.selectedProxy
|
|
2416
2419
|
);
|
|
2417
2420
|
this.loading = !0;
|
|
2418
2421
|
const e = await this.apiGetTransformAssetLink({
|
|
2419
2422
|
assetId: this.asset.id,
|
|
2420
|
-
extension:
|
|
2423
|
+
extension: m.getTransformExtension(this.selectedFormat.extension),
|
|
2421
2424
|
format: t?.proxyName ?? "",
|
|
2422
2425
|
siteUrl: this.baseUrl,
|
|
2423
2426
|
token: this.token,
|
|
@@ -2433,7 +2436,7 @@ let f = class extends j {
|
|
|
2433
2436
|
keepAspectRatio: !0,
|
|
2434
2437
|
ratioHeight: 1,
|
|
2435
2438
|
ratioWidth: 1,
|
|
2436
|
-
unit:
|
|
2439
|
+
unit: o.Pixel,
|
|
2437
2440
|
width: e.width
|
|
2438
2441
|
}, this.cropSize = {
|
|
2439
2442
|
cropMode: "free",
|
|
@@ -2445,15 +2448,15 @@ let f = class extends j {
|
|
|
2445
2448
|
position: N.CenterCenter,
|
|
2446
2449
|
ratioHeight: 1,
|
|
2447
2450
|
ratioWidth: 1,
|
|
2448
|
-
unit:
|
|
2451
|
+
unit: o.Pixel,
|
|
2449
2452
|
width: e.width,
|
|
2450
2453
|
x: 0,
|
|
2451
2454
|
y: 0
|
|
2452
|
-
}, this.lastAction ===
|
|
2455
|
+
}, this.lastAction === f.Rotate && (this.rotation = 0), this.lastAction = void 0;
|
|
2453
2456
|
const i = this.transformations.some(
|
|
2454
|
-
(
|
|
2457
|
+
(r) => r.key === f.Metadata
|
|
2455
2458
|
), s = this.transformations.findLast(
|
|
2456
|
-
(
|
|
2459
|
+
(r) => r.key === f.Quality
|
|
2457
2460
|
);
|
|
2458
2461
|
this.selectedFormat = {
|
|
2459
2462
|
...this.selectedFormat,
|
|
@@ -2499,7 +2502,7 @@ let f = class extends j {
|
|
|
2499
2502
|
width: Number.parseInt(this.asset.width, 10)
|
|
2500
2503
|
});
|
|
2501
2504
|
const t = this.transformations.findLast(
|
|
2502
|
-
(e) => e.key ===
|
|
2505
|
+
(e) => e.key === f.Quality
|
|
2503
2506
|
);
|
|
2504
2507
|
this.selectedFormat = {
|
|
2505
2508
|
extension: this.asset.extension,
|
|
@@ -2525,7 +2528,7 @@ let f = class extends j {
|
|
|
2525
2528
|
position: N.CenterCenter,
|
|
2526
2529
|
ratioHeight: 1,
|
|
2527
2530
|
ratioWidth: 1,
|
|
2528
|
-
unit:
|
|
2531
|
+
unit: o.Pixel,
|
|
2529
2532
|
width: this.defaultSize.width,
|
|
2530
2533
|
x: 0,
|
|
2531
2534
|
y: 0
|
|
@@ -2554,26 +2557,26 @@ let f = class extends j {
|
|
|
2554
2557
|
e.proxyName === "TRX" && (e.formatHeight = Number(this.asset.height), e.formatWidth = Number(this.asset.width));
|
|
2555
2558
|
const i = this.proxies?.find((s) => s.id === t);
|
|
2556
2559
|
i && (this.asset && i.proxyName === "TRX" && (i.formatHeight = Number(this.asset.height), i.formatWidth = Number(this.asset.width)), this.transformations = this.transformations.map((s) => {
|
|
2557
|
-
if (s.key ===
|
|
2558
|
-
const a = s.value,
|
|
2560
|
+
if (s.key === f.Crop) {
|
|
2561
|
+
const a = s.value, r = a.width / i.formatWidth * e.formatWidth, n = a.height / i.formatHeight * e.formatHeight, l = a.x / i.formatWidth * e.formatWidth, d = a.y / i.formatHeight * e.formatHeight;
|
|
2559
2562
|
return {
|
|
2560
2563
|
...s,
|
|
2561
2564
|
value: {
|
|
2562
2565
|
...s.value,
|
|
2563
|
-
height:
|
|
2564
|
-
width:
|
|
2566
|
+
height: n,
|
|
2567
|
+
width: r,
|
|
2565
2568
|
x: l,
|
|
2566
2569
|
y: d
|
|
2567
2570
|
}
|
|
2568
2571
|
};
|
|
2569
2572
|
}
|
|
2570
|
-
if (s.key ===
|
|
2571
|
-
const a = s.value,
|
|
2573
|
+
if (s.key === f.Resize) {
|
|
2574
|
+
const a = s.value, r = a.width / i.formatWidth * e.formatWidth, n = a.height / i.formatHeight * e.formatHeight;
|
|
2572
2575
|
return {
|
|
2573
2576
|
...s,
|
|
2574
2577
|
value: {
|
|
2575
|
-
height:
|
|
2576
|
-
width:
|
|
2578
|
+
height: n,
|
|
2579
|
+
width: r
|
|
2577
2580
|
}
|
|
2578
2581
|
};
|
|
2579
2582
|
}
|
|
@@ -2588,24 +2591,24 @@ let f = class extends j {
|
|
|
2588
2591
|
}, await this.updateComplete, this.cropSize = {
|
|
2589
2592
|
cropMode: "free",
|
|
2590
2593
|
focusMode: "manual",
|
|
2591
|
-
height: this.lastCropSize[
|
|
2594
|
+
height: this.lastCropSize[o.Pixel].height,
|
|
2592
2595
|
keepAspectRatio: !0,
|
|
2593
2596
|
percentageHeight: 100,
|
|
2594
2597
|
percentageWidth: 100,
|
|
2595
2598
|
position: N.CenterCenter,
|
|
2596
2599
|
ratioHeight: 1,
|
|
2597
2600
|
ratioWidth: 1,
|
|
2598
|
-
unit:
|
|
2599
|
-
width: this.lastCropSize[
|
|
2601
|
+
unit: o.Pixel,
|
|
2602
|
+
width: this.lastCropSize[o.Pixel].width,
|
|
2600
2603
|
x: 0,
|
|
2601
2604
|
y: 0
|
|
2602
2605
|
}, this.resizeSize = {
|
|
2603
|
-
height: this.lastResizeSize[
|
|
2606
|
+
height: this.lastResizeSize[o.Pixel].height,
|
|
2604
2607
|
keepAspectRatio: !0,
|
|
2605
2608
|
ratioHeight: 1,
|
|
2606
2609
|
ratioWidth: 1,
|
|
2607
|
-
unit:
|
|
2608
|
-
width: this.lastResizeSize[
|
|
2610
|
+
unit: o.Pixel,
|
|
2611
|
+
width: this.lastResizeSize[o.Pixel].width
|
|
2609
2612
|
};
|
|
2610
2613
|
}
|
|
2611
2614
|
handleLoadingChange() {
|
|
@@ -2625,12 +2628,12 @@ let f = class extends j {
|
|
|
2625
2628
|
}
|
|
2626
2629
|
handleActiveSettingChange() {
|
|
2627
2630
|
this.cropperElement && (this.resizeSize = {
|
|
2628
|
-
height: this.lastResizeSize[
|
|
2631
|
+
height: this.lastResizeSize[o.Pixel].height,
|
|
2629
2632
|
keepAspectRatio: !0,
|
|
2630
2633
|
ratioHeight: 1,
|
|
2631
2634
|
ratioWidth: 1,
|
|
2632
|
-
unit:
|
|
2633
|
-
width: this.lastResizeSize[
|
|
2635
|
+
unit: o.Pixel,
|
|
2636
|
+
width: this.lastResizeSize[o.Pixel].width
|
|
2634
2637
|
}, this.cropperElement.disabled = this.activeSetting !== "cx-asset-link-format-crop");
|
|
2635
2638
|
}
|
|
2636
2639
|
async handleRequestAutoCropSuggestion({
|
|
@@ -2639,33 +2642,33 @@ let f = class extends j {
|
|
|
2639
2642
|
height: i,
|
|
2640
2643
|
keepAspectRatio: s,
|
|
2641
2644
|
percentageHeight: a,
|
|
2642
|
-
percentageWidth:
|
|
2643
|
-
ratioHeight:
|
|
2645
|
+
percentageWidth: r,
|
|
2646
|
+
ratioHeight: n,
|
|
2644
2647
|
ratioWidth: l,
|
|
2645
2648
|
unit: d,
|
|
2646
|
-
useCropMode:
|
|
2649
|
+
useCropMode: g,
|
|
2647
2650
|
width: c
|
|
2648
2651
|
}) {
|
|
2649
2652
|
if (!this.selectedFormat?.url || e === "manual")
|
|
2650
2653
|
return;
|
|
2651
|
-
this.loading = !0, this.lastAction =
|
|
2652
|
-
const
|
|
2654
|
+
this.loading = !0, this.lastAction = f.Crop;
|
|
2655
|
+
const S = await this.apiGetCropFocusMode({
|
|
2653
2656
|
autoCropMode: e,
|
|
2654
2657
|
cropHeight: i,
|
|
2655
2658
|
cropWidth: c,
|
|
2656
2659
|
imageUrl: this.selectedFormat.url
|
|
2657
2660
|
});
|
|
2658
|
-
if (
|
|
2659
|
-
let A = a, p =
|
|
2660
|
-
i || (A =
|
|
2661
|
+
if (S) {
|
|
2662
|
+
let A = a, p = r;
|
|
2663
|
+
i || (A = S.height * 100 / this.selectedFormat.height), c || (p = S.width * 100 / this.selectedFormat.width), this.cropSize = {
|
|
2661
2664
|
...this.cropSize,
|
|
2662
|
-
height:
|
|
2665
|
+
height: S.height,
|
|
2663
2666
|
percentageHeight: A ?? this.cropSize.percentageHeight,
|
|
2664
2667
|
percentageWidth: p ?? this.cropSize.percentageWidth,
|
|
2665
|
-
width:
|
|
2666
|
-
x:
|
|
2667
|
-
y:
|
|
2668
|
-
...
|
|
2668
|
+
width: S.width,
|
|
2669
|
+
x: S.x * 100 / this.selectedFormat.width,
|
|
2670
|
+
y: S.y * 100 / this.selectedFormat.height,
|
|
2671
|
+
...g ? {
|
|
2669
2672
|
cropMode: e,
|
|
2670
2673
|
focusMode: "manual",
|
|
2671
2674
|
keepAspectRatio: !1
|
|
@@ -2674,7 +2677,7 @@ let f = class extends j {
|
|
|
2674
2677
|
focusMode: e
|
|
2675
2678
|
},
|
|
2676
2679
|
keepAspectRatio: s ?? this.cropSize.keepAspectRatio,
|
|
2677
|
-
ratioHeight:
|
|
2680
|
+
ratioHeight: n ?? this.cropSize.ratioHeight,
|
|
2678
2681
|
ratioWidth: l ?? this.cropSize.ratioWidth,
|
|
2679
2682
|
unit: d ?? this.cropSize.unit
|
|
2680
2683
|
};
|
|
@@ -2686,13 +2689,13 @@ let f = class extends j {
|
|
|
2686
2689
|
height: i,
|
|
2687
2690
|
width: s,
|
|
2688
2691
|
x: a,
|
|
2689
|
-
y:
|
|
2692
|
+
y: r
|
|
2690
2693
|
} = e;
|
|
2691
2694
|
if (s === 0 || i === 0)
|
|
2692
2695
|
return;
|
|
2693
|
-
const
|
|
2694
|
-
let d = this.cropSize.height,
|
|
2695
|
-
|
|
2696
|
+
const n = this.cropSize.percentageWidth !== s, l = this.cropSize.percentageHeight !== i;
|
|
2697
|
+
let d = this.cropSize.height, g = this.cropSize.width;
|
|
2698
|
+
n && (g = Math.round(s * this.selectedFormat.width / 100)), l && (d = Math.round(
|
|
2696
2699
|
i * this.selectedFormat.height / 100
|
|
2697
2700
|
));
|
|
2698
2701
|
const c = this.cropSize.focusMode;
|
|
@@ -2703,15 +2706,15 @@ let f = class extends j {
|
|
|
2703
2706
|
height: d,
|
|
2704
2707
|
percentageHeight: i,
|
|
2705
2708
|
percentageWidth: s,
|
|
2706
|
-
width:
|
|
2709
|
+
width: g
|
|
2707
2710
|
}) : this.cropSize = {
|
|
2708
2711
|
...this.cropSize,
|
|
2709
2712
|
height: d,
|
|
2710
2713
|
percentageHeight: i,
|
|
2711
2714
|
percentageWidth: s,
|
|
2712
|
-
width:
|
|
2715
|
+
width: g,
|
|
2713
2716
|
x: a,
|
|
2714
|
-
y:
|
|
2717
|
+
y: r
|
|
2715
2718
|
};
|
|
2716
2719
|
}
|
|
2717
2720
|
onCropDragStart() {
|
|
@@ -2745,7 +2748,7 @@ let f = class extends j {
|
|
|
2745
2748
|
}
|
|
2746
2749
|
onProxyChange(t) {
|
|
2747
2750
|
const e = t.detail;
|
|
2748
|
-
if (this.lastAction =
|
|
2751
|
+
if (this.lastAction = f.Proxy, e.autoFormat) {
|
|
2749
2752
|
this.autoFormat = !0;
|
|
2750
2753
|
const i = this.autoResolvedProxyId;
|
|
2751
2754
|
i && (this.selectedProxy = i);
|
|
@@ -2764,19 +2767,19 @@ let f = class extends j {
|
|
|
2764
2767
|
const s = this.focusModes.find(
|
|
2765
2768
|
(d) => d.value === this.cropSize.focusMode
|
|
2766
2769
|
)?.auto;
|
|
2767
|
-
let a = this.cropSize.keepAspectRatio,
|
|
2768
|
-
e === "free" ? (a = !1,
|
|
2770
|
+
let a = this.cropSize.keepAspectRatio, r = this.cropSize.focusMode, n = this.cropSize.x, l = this.cropSize.y;
|
|
2771
|
+
e === "free" ? (a = !1, r = "manual") : this.cropSize.unit === o.Pixel && !s && (n = 0, l = 0), s ? await this.handleRequestAutoCropSuggestion({
|
|
2769
2772
|
cropMode: e,
|
|
2770
|
-
focusMode:
|
|
2773
|
+
focusMode: r,
|
|
2771
2774
|
height: this.cropSize.height,
|
|
2772
2775
|
keepAspectRatio: a,
|
|
2773
2776
|
width: this.cropSize.width
|
|
2774
2777
|
}) : this.cropSize = {
|
|
2775
2778
|
...this.cropSize,
|
|
2776
2779
|
cropMode: e,
|
|
2777
|
-
focusMode:
|
|
2780
|
+
focusMode: r,
|
|
2778
2781
|
keepAspectRatio: a,
|
|
2779
|
-
x:
|
|
2782
|
+
x: n,
|
|
2780
2783
|
y: l
|
|
2781
2784
|
};
|
|
2782
2785
|
}
|
|
@@ -2800,52 +2803,52 @@ let f = class extends j {
|
|
|
2800
2803
|
}
|
|
2801
2804
|
async onCropChange(t) {
|
|
2802
2805
|
const e = this.cropSize.unit;
|
|
2803
|
-
if (t.detail.unit ===
|
|
2806
|
+
if (t.detail.unit === o.AspectRatio) {
|
|
2804
2807
|
const i = t.detail.width / t.detail.height, s = this.asset ? Math.min(
|
|
2805
2808
|
Math.max(Math.round(this.cropSize.height * i), 0),
|
|
2806
2809
|
this.resizeSize.width
|
|
2807
2810
|
) : 0, a = this.asset ? Math.min(
|
|
2808
2811
|
Math.max(Math.round(s / i), 0),
|
|
2809
2812
|
this.resizeSize.height
|
|
2810
|
-
) : 0,
|
|
2813
|
+
) : 0, r = this.asset ? a * 100 / this.selectedFormat.height : 100, n = this.asset ? s * 100 / this.selectedFormat.width : 100;
|
|
2811
2814
|
let l = this.cropSize.x, d = this.cropSize.y;
|
|
2812
|
-
l +
|
|
2813
|
-
let
|
|
2815
|
+
l + n > 100 && (l = 100 - n), d + r > 100 && (d = 100 - r);
|
|
2816
|
+
let g = this.cropSize.cropMode;
|
|
2814
2817
|
this.cropModes.find(
|
|
2815
|
-
(
|
|
2816
|
-
)?.auto && (
|
|
2818
|
+
(S) => S.value === g
|
|
2819
|
+
)?.auto && (g = "free"), t.detail.silent ? (this.cropSize.height = a, this.cropSize.keepAspectRatio = t.detail.keepAspectRatio, this.cropSize.percentageHeight = r, this.cropSize.percentageWidth = n, this.cropSize.ratioHeight = t.detail.height, this.cropSize.ratioWidth = t.detail.width, this.cropSize.unit = o.AspectRatio, this.cropSize.width = s) : this.cropSize = {
|
|
2817
2820
|
...this.cropSize,
|
|
2818
|
-
cropMode:
|
|
2821
|
+
cropMode: g,
|
|
2819
2822
|
height: a,
|
|
2820
2823
|
keepAspectRatio: t.detail.keepAspectRatio,
|
|
2821
|
-
percentageHeight:
|
|
2822
|
-
percentageWidth:
|
|
2824
|
+
percentageHeight: r,
|
|
2825
|
+
percentageWidth: n,
|
|
2823
2826
|
ratioHeight: t.detail.height,
|
|
2824
2827
|
ratioWidth: t.detail.width,
|
|
2825
|
-
unit:
|
|
2828
|
+
unit: o.AspectRatio,
|
|
2826
2829
|
width: s,
|
|
2827
2830
|
x: l,
|
|
2828
2831
|
y: d
|
|
2829
2832
|
};
|
|
2830
2833
|
} else {
|
|
2831
2834
|
const i = this.asset ? t.detail.height * 100 / this.selectedFormat.height : 100, s = this.asset ? t.detail.width * 100 / this.selectedFormat.width : 100;
|
|
2832
|
-
let a = this.cropSize.x,
|
|
2833
|
-
a + s > 100 && (a = 100 - s),
|
|
2834
|
-
let
|
|
2835
|
+
let a = this.cropSize.x, r = this.cropSize.y;
|
|
2836
|
+
a + s > 100 && (a = 100 - s), r + i > 100 && (r = 100 - i);
|
|
2837
|
+
let n = this.cropSize.cropMode;
|
|
2835
2838
|
const l = this.cropModes.find(
|
|
2836
|
-
(d) => d.value ===
|
|
2839
|
+
(d) => d.value === n
|
|
2837
2840
|
)?.auto;
|
|
2838
|
-
(t.detail.breakAspectRatio || l) && (
|
|
2841
|
+
(t.detail.breakAspectRatio || l) && (n = "free"), t.detail.silent ? (this.cropSize.cropMode = n, this.cropSize.height = t.detail.height, this.cropSize.keepAspectRatio = t.detail.keepAspectRatio, this.cropSize.percentageHeight = i, this.cropSize.percentageWidth = s, this.cropSize.unit = o.Pixel, this.cropSize.width = t.detail.width, this.cropSize.x = a, this.cropSize.y = r) : this.cropSize = {
|
|
2839
2842
|
...this.cropSize,
|
|
2840
|
-
cropMode:
|
|
2843
|
+
cropMode: n,
|
|
2841
2844
|
height: t.detail.height,
|
|
2842
2845
|
keepAspectRatio: t.detail.keepAspectRatio,
|
|
2843
2846
|
percentageHeight: i,
|
|
2844
2847
|
percentageWidth: s,
|
|
2845
|
-
unit:
|
|
2848
|
+
unit: o.Pixel,
|
|
2846
2849
|
width: t.detail.width,
|
|
2847
2850
|
x: a,
|
|
2848
|
-
y:
|
|
2851
|
+
y: r
|
|
2849
2852
|
};
|
|
2850
2853
|
}
|
|
2851
2854
|
e !== this.cropSize.unit && (this.cropSize = {
|
|
@@ -2863,41 +2866,41 @@ let f = class extends j {
|
|
|
2863
2866
|
});
|
|
2864
2867
|
}
|
|
2865
2868
|
onCropApply(t) {
|
|
2866
|
-
if (this.clearResetSnapshot(), this.lastAction =
|
|
2869
|
+
if (this.clearResetSnapshot(), this.lastAction = f.Crop, !this.asset) {
|
|
2867
2870
|
const {
|
|
2868
2871
|
focusMode: l,
|
|
2869
2872
|
height: d,
|
|
2870
|
-
position:
|
|
2873
|
+
position: g,
|
|
2871
2874
|
ratioHeight: c,
|
|
2872
|
-
ratioWidth:
|
|
2875
|
+
ratioWidth: S,
|
|
2873
2876
|
unit: A,
|
|
2874
2877
|
width: p,
|
|
2875
2878
|
x,
|
|
2876
|
-
y:
|
|
2879
|
+
y: w
|
|
2877
2880
|
} = this.cropSize, u = this.focusModes.find(
|
|
2878
|
-
(
|
|
2881
|
+
(C) => C.value === l
|
|
2879
2882
|
)?.auto ?? !1;
|
|
2880
|
-
if (A ===
|
|
2881
|
-
|
|
2882
|
-
key:
|
|
2883
|
+
if (A === o.AspectRatio) {
|
|
2884
|
+
S && c && this.upsertTransformation({
|
|
2885
|
+
key: f.Crop,
|
|
2883
2886
|
value: {
|
|
2884
2887
|
focusMode: l,
|
|
2885
2888
|
isFocusModeAuto: u,
|
|
2886
|
-
position:
|
|
2889
|
+
position: g,
|
|
2887
2890
|
ratioHeight: c,
|
|
2888
|
-
ratioWidth:
|
|
2891
|
+
ratioWidth: S,
|
|
2889
2892
|
unit: A
|
|
2890
2893
|
}
|
|
2891
2894
|
});
|
|
2892
2895
|
return;
|
|
2893
2896
|
}
|
|
2894
2897
|
(d || p) && this.upsertTransformation({
|
|
2895
|
-
key:
|
|
2898
|
+
key: f.Crop,
|
|
2896
2899
|
value: {
|
|
2897
2900
|
focusMode: l,
|
|
2898
2901
|
height: d,
|
|
2899
2902
|
isFocusModeAuto: u,
|
|
2900
|
-
position:
|
|
2903
|
+
position: g,
|
|
2901
2904
|
unit: A,
|
|
2902
2905
|
width: p,
|
|
2903
2906
|
/**
|
|
@@ -2908,7 +2911,7 @@ let f = class extends j {
|
|
|
2908
2911
|
* suppress the focus mode / position `c_g_` gravity value.
|
|
2909
2912
|
*/
|
|
2910
2913
|
x: Number.isFinite(x) && x !== 0 ? x : void 0,
|
|
2911
|
-
y: Number.isFinite(
|
|
2914
|
+
y: Number.isFinite(w) && w !== 0 ? w : void 0
|
|
2912
2915
|
}
|
|
2913
2916
|
});
|
|
2914
2917
|
return;
|
|
@@ -2916,38 +2919,38 @@ let f = class extends j {
|
|
|
2916
2919
|
const { height: e, mode: i, unit: s, width: a } = t.detail;
|
|
2917
2920
|
if (!this.cropperElement || !this.selectedFormat)
|
|
2918
2921
|
return;
|
|
2919
|
-
const
|
|
2920
|
-
(l) => l.value ===
|
|
2922
|
+
const r = this.cropSize.focusMode, n = this.focusModes.find(
|
|
2923
|
+
(l) => l.value === r
|
|
2921
2924
|
)?.auto ?? !1;
|
|
2922
2925
|
if (e && a && s) {
|
|
2923
2926
|
let l = a, d = e;
|
|
2924
|
-
if (s ===
|
|
2927
|
+
if (s === o.AspectRatio && (l = this.cropSize.percentageWidth * this.selectedFormat.width / 100, d = this.cropSize.percentageHeight * this.selectedFormat.height / 100), i)
|
|
2925
2928
|
this.transformations = [
|
|
2926
2929
|
...this.transformations,
|
|
2927
2930
|
{
|
|
2928
|
-
key:
|
|
2931
|
+
key: f.Crop,
|
|
2929
2932
|
value: {
|
|
2930
|
-
focusMode:
|
|
2933
|
+
focusMode: r,
|
|
2931
2934
|
height: d,
|
|
2932
|
-
isFocusModeAuto:
|
|
2935
|
+
isFocusModeAuto: n,
|
|
2933
2936
|
mode: i,
|
|
2934
2937
|
width: l
|
|
2935
2938
|
}
|
|
2936
2939
|
}
|
|
2937
2940
|
];
|
|
2938
2941
|
else {
|
|
2939
|
-
const
|
|
2942
|
+
const g = this.cropSize.x / 100 * this.selectedFormat.width, c = this.cropSize.y / 100 * this.selectedFormat.height;
|
|
2940
2943
|
this.transformations = [
|
|
2941
2944
|
...this.transformations,
|
|
2942
2945
|
{
|
|
2943
|
-
key:
|
|
2946
|
+
key: f.Crop,
|
|
2944
2947
|
value: {
|
|
2945
|
-
focusMode:
|
|
2948
|
+
focusMode: r,
|
|
2946
2949
|
height: d,
|
|
2947
|
-
isFocusModeAuto:
|
|
2950
|
+
isFocusModeAuto: n,
|
|
2948
2951
|
unit: s,
|
|
2949
2952
|
width: l,
|
|
2950
|
-
x:
|
|
2953
|
+
x: g,
|
|
2951
2954
|
y: c
|
|
2952
2955
|
}
|
|
2953
2956
|
}
|
|
@@ -2956,19 +2959,19 @@ let f = class extends j {
|
|
|
2956
2959
|
} else i && (this.transformations = [
|
|
2957
2960
|
...this.transformations,
|
|
2958
2961
|
{
|
|
2959
|
-
key:
|
|
2962
|
+
key: f.Crop,
|
|
2960
2963
|
value: {
|
|
2961
|
-
focusMode:
|
|
2962
|
-
isFocusModeAuto:
|
|
2964
|
+
focusMode: r,
|
|
2965
|
+
isFocusModeAuto: n,
|
|
2963
2966
|
mode: i
|
|
2964
2967
|
}
|
|
2965
2968
|
}
|
|
2966
2969
|
]);
|
|
2967
2970
|
}
|
|
2968
2971
|
onResizeChange(t) {
|
|
2969
|
-
if (t.detail.unit ===
|
|
2972
|
+
if (t.detail.unit === o.AspectRatio) {
|
|
2970
2973
|
const e = t.detail.width / t.detail.height, i = Math.max(
|
|
2971
|
-
Math.round(this.lastResizeSize[
|
|
2974
|
+
Math.round(this.lastResizeSize[o.Pixel].height * e),
|
|
2972
2975
|
0
|
|
2973
2976
|
), s = Math.max(Math.round(i / e), 0);
|
|
2974
2977
|
this.resizeSize = {
|
|
@@ -2991,21 +2994,21 @@ let f = class extends j {
|
|
|
2991
2994
|
}
|
|
2992
2995
|
onResizeApply(t) {
|
|
2993
2996
|
const { height: e, unit: i, width: s } = t.detail;
|
|
2994
|
-
if (this.clearResetSnapshot(), this.lastAction =
|
|
2995
|
-
if (i ===
|
|
2996
|
-
const { ratioHeight: d, ratioWidth:
|
|
2997
|
-
|
|
2998
|
-
key:
|
|
2997
|
+
if (this.clearResetSnapshot(), this.lastAction = f.Resize, !this.asset) {
|
|
2998
|
+
if (i === o.AspectRatio) {
|
|
2999
|
+
const { ratioHeight: d, ratioWidth: g } = this.resizeSize;
|
|
3000
|
+
g && d && this.upsertTransformation({
|
|
3001
|
+
key: f.Resize,
|
|
2999
3002
|
value: {
|
|
3000
3003
|
ratioHeight: d,
|
|
3001
|
-
ratioWidth:
|
|
3004
|
+
ratioWidth: g,
|
|
3002
3005
|
unit: i
|
|
3003
3006
|
}
|
|
3004
3007
|
});
|
|
3005
3008
|
return;
|
|
3006
3009
|
}
|
|
3007
3010
|
(e || s) && this.upsertTransformation({
|
|
3008
|
-
key:
|
|
3011
|
+
key: f.Resize,
|
|
3009
3012
|
value: {
|
|
3010
3013
|
height: e,
|
|
3011
3014
|
unit: i,
|
|
@@ -3016,16 +3019,16 @@ let f = class extends j {
|
|
|
3016
3019
|
}
|
|
3017
3020
|
if (!this.selectedFormat)
|
|
3018
3021
|
return;
|
|
3019
|
-
const a = this.selectedFormat.width || this.defaultSize.width,
|
|
3020
|
-
let
|
|
3021
|
-
this.resizeSize.unit !== i ? (
|
|
3022
|
+
const a = this.selectedFormat.width || this.defaultSize.width, r = this.selectedFormat.height || this.defaultSize.height;
|
|
3023
|
+
let n = s, l = e;
|
|
3024
|
+
this.resizeSize.unit !== i ? (n = a, l = r) : i === o.AspectRatio && (n = Math.round(s / e * r), l = r), this.transformations = [
|
|
3022
3025
|
...this.transformations,
|
|
3023
3026
|
{
|
|
3024
|
-
key:
|
|
3027
|
+
key: f.Resize,
|
|
3025
3028
|
value: {
|
|
3026
3029
|
height: l,
|
|
3027
3030
|
unit: i,
|
|
3028
|
-
width:
|
|
3031
|
+
width: n
|
|
3029
3032
|
}
|
|
3030
3033
|
}
|
|
3031
3034
|
];
|
|
@@ -3035,21 +3038,21 @@ let f = class extends j {
|
|
|
3035
3038
|
}
|
|
3036
3039
|
onRotationApply(t) {
|
|
3037
3040
|
const e = t.detail;
|
|
3038
|
-
if (this.clearResetSnapshot(), this.lastAction =
|
|
3041
|
+
if (this.clearResetSnapshot(), this.lastAction = f.Rotate, !this.asset) {
|
|
3039
3042
|
e ? this.upsertTransformation({
|
|
3040
|
-
key:
|
|
3043
|
+
key: f.Rotate,
|
|
3041
3044
|
value: {
|
|
3042
3045
|
rotation: e
|
|
3043
3046
|
}
|
|
3044
3047
|
}) : this.transformations = this.transformations.filter(
|
|
3045
|
-
(i) => i.key !==
|
|
3048
|
+
(i) => i.key !== f.Rotate
|
|
3046
3049
|
);
|
|
3047
3050
|
return;
|
|
3048
3051
|
}
|
|
3049
3052
|
this.selectedFormat && (this.transformations = [
|
|
3050
3053
|
...this.transformations,
|
|
3051
3054
|
{
|
|
3052
|
-
key:
|
|
3055
|
+
key: f.Rotate,
|
|
3053
3056
|
value: {
|
|
3054
3057
|
rotation: e
|
|
3055
3058
|
}
|
|
@@ -3058,9 +3061,9 @@ let f = class extends j {
|
|
|
3058
3061
|
}
|
|
3059
3062
|
onQualityChange(t) {
|
|
3060
3063
|
const e = t.detail;
|
|
3061
|
-
this.selectedFormat && (this.selectedFormat.quality = e), this.clearResetSnapshot(), this.lastAction =
|
|
3064
|
+
this.selectedFormat && (this.selectedFormat.quality = e), this.clearResetSnapshot(), this.lastAction = f.Quality;
|
|
3062
3065
|
const i = {
|
|
3063
|
-
key:
|
|
3066
|
+
key: f.Quality,
|
|
3064
3067
|
value: {
|
|
3065
3068
|
quality: e
|
|
3066
3069
|
}
|
|
@@ -3074,22 +3077,22 @@ let f = class extends j {
|
|
|
3074
3077
|
keepMetadata: e
|
|
3075
3078
|
}), !this.asset) {
|
|
3076
3079
|
e ? this.upsertTransformation({
|
|
3077
|
-
key:
|
|
3080
|
+
key: f.Metadata,
|
|
3078
3081
|
value: {
|
|
3079
3082
|
keepMetadata: e
|
|
3080
3083
|
}
|
|
3081
3084
|
}) : this.transformations = this.transformations.filter(
|
|
3082
|
-
(i) => i.key !==
|
|
3085
|
+
(i) => i.key !== f.Metadata
|
|
3083
3086
|
);
|
|
3084
3087
|
return;
|
|
3085
3088
|
}
|
|
3086
3089
|
e ? this.upsertTransformation({
|
|
3087
|
-
key:
|
|
3090
|
+
key: f.Metadata,
|
|
3088
3091
|
value: {
|
|
3089
3092
|
keepMetadata: e
|
|
3090
3093
|
}
|
|
3091
3094
|
}) : this.transformations = this.transformations.filter(
|
|
3092
|
-
(i) => i.key !==
|
|
3095
|
+
(i) => i.key !== f.Metadata
|
|
3093
3096
|
);
|
|
3094
3097
|
}
|
|
3095
3098
|
onExtensionChange(t) {
|
|
@@ -3101,7 +3104,7 @@ let f = class extends j {
|
|
|
3101
3104
|
}
|
|
3102
3105
|
syncQuality() {
|
|
3103
3106
|
const t = this.transformations.findLast(
|
|
3104
|
-
(e) => e.key ===
|
|
3107
|
+
(e) => e.key === f.Quality
|
|
3105
3108
|
)?.value?.quality;
|
|
3106
3109
|
this.selectedFormat && (this.selectedFormat = {
|
|
3107
3110
|
...this.selectedFormat,
|
|
@@ -3139,38 +3142,38 @@ let f = class extends j {
|
|
|
3139
3142
|
this.transformations = [], this.frozenIndex = -1, this.syncQuality();
|
|
3140
3143
|
}
|
|
3141
3144
|
render() {
|
|
3142
|
-
return
|
|
3145
|
+
return b`<div class="asset-link-format" @cx-show=${this.onDetailsShow} @cx-hide=${this.onDetailsHide}>${M(
|
|
3143
3146
|
!this.hideHeader,
|
|
3144
|
-
() =>
|
|
3147
|
+
() => b`<cx-space class="asset-link-format__section-header" direction="horizontal" spacing="small" align-items="center" justify-content="space-between"><cx-typography variant="body3">${this.localize.term("transformations")}</cx-typography><cx-space direction="horizontal" spacing="3x-small" align-items="center"><cx-button class="asset-link-format__undo" variant="custom" ?disabled=${!this.hasUnfrozenTransformations && this.preResetTransformations === void 0} @click=${this.handleUndo}>${this.localize.term("undo")}</cx-button>${M(this.canReset, () => b`<cx-button class="asset-link-format__reset" variant="custom" ?disabled=${!this.hasResettableState} @click=${this.handleReset}>${this.localize.term("reset")}</cx-button>`)}</cx-space></cx-space>`,
|
|
3145
3148
|
() => qt
|
|
3146
3149
|
)}
|
|
3147
3150
|
${M(
|
|
3148
3151
|
!this.noFormat,
|
|
3149
|
-
() =>
|
|
3152
|
+
() => b`<cx-asset-link-format-proxy class="asset-link-format__details" value=${this.selectedProxy || this.proxies?.[0]?.id || ""} ?open=${this.activeSetting === "cx-asset-link-format-proxy"} ?auto-format=${this.autoFormat} ?can-auto-format=${this.canAutoFormat} .items=${this.formats} ?loading=${this.loading && this.lastAction === f.Proxy} @cx-asset-link-format-proxy-change=${this.onProxyChange}></cx-asset-link-format-proxy>`
|
|
3150
3153
|
)}
|
|
3151
3154
|
${M(
|
|
3152
3155
|
!this.noCrop,
|
|
3153
|
-
() =>
|
|
3156
|
+
() => b`<cx-asset-link-format-crop class="asset-link-format__details" ?open=${this.activeSetting === "cx-asset-link-format-crop"} ?disabled-apply=${this.disabledCropApply} ?loading=${this.loading && this.lastAction === f.Crop} ?keep-aspect-ratio=${this.cropSize.keepAspectRatio} ?show-position-picker=${!this.asset} focus-mode=${this.cropSize.focusMode} crop-mode=${this.cropSize.cropMode} width=${this.cropSize.width} height=${this.cropSize.height} max-width=${this.asset ? this.lastResizeSize[o.Pixel].width : 1 / 0} max-height=${this.asset ? this.lastResizeSize[o.Pixel].height : 1 / 0} percentage-width=${this.cropSize.percentageWidth} percentage-height=${this.cropSize.percentageHeight} position=${this.cropSize.position} ratio-width=${this.cropSize.ratioWidth} ratio-height=${this.cropSize.ratioHeight} unit=${this.cropSize.unit} .lastAppliedSetting=${this.lastCropSize} .cropModes=${this.cropModes} .focusModes=${this.focusModes} @cx-asset-link-format-crop-mode-change=${this.onCropModeChange} @cx-asset-link-format-crop-focus-mode-change=${this.onCropFocusModeChange} @cx-asset-link-format-crop-position-change=${this.onCropPositionChange} @cx-asset-link-format-crop-change=${this.onCropChange} @cx-asset-link-format-crop-changed=${this.onCropChanged} @cx-asset-link-format-crop-apply=${this.onCropApply}></cx-asset-link-format-crop>`
|
|
3154
3157
|
)}
|
|
3155
3158
|
${M(
|
|
3156
3159
|
!this.noResize,
|
|
3157
|
-
() =>
|
|
3160
|
+
() => b`<cx-asset-link-format-resize class="asset-link-format__details" ?open=${this.activeSetting === "cx-asset-link-format-resize"} ?loading=${this.loading && this.lastAction === f.Resize} ?no-ratio-modes=${!this.asset} ?keep-aspect-ratio=${this.resizeSize.keepAspectRatio} width=${this.resizeSize.width} height=${this.resizeSize.height} max-width=${this.asset ? this.imageSize.width : 1 / 0} max-height=${this.asset ? this.imageSize.height : 1 / 0} ratio-width=${this.resizeSize.ratioWidth} ratio-height=${this.resizeSize.ratioHeight} unit=${this.resizeSize.unit} .lastAppliedSetting=${this.lastResizeSize} @cx-asset-link-format-resize-change=${this.onResizeChange} @cx-asset-link-format-resize-apply=${this.onResizeApply}></cx-asset-link-format-resize>`
|
|
3158
3161
|
)}
|
|
3159
3162
|
${M(
|
|
3160
3163
|
!this.noRotate,
|
|
3161
|
-
() =>
|
|
3162
|
-
)}<cx-asset-link-format-quality class="asset-link-format__details" ?loading=${this.loading && this.lastAction ===
|
|
3164
|
+
() => b`<cx-asset-link-format-rotation class="asset-link-format__details" ?loading=${this.loading && this.lastAction === f.Rotate} ?open=${this.activeSetting === "cx-asset-link-format-rotation"} default-value=${this.selectedFormat?.rotation ?? 0} last-applied-value=${this.lastRotation} value=${this.rotation} @cx-asset-link-format-rotation-change=${this.onRotationChange} @cx-asset-link-format-rotation-apply=${this.onRotationApply}></cx-asset-link-format-rotation>`
|
|
3165
|
+
)}<cx-asset-link-format-quality class="asset-link-format__details" ?loading=${this.loading && this.lastAction === f.Quality} ?open=${this.activeSetting === "cx-asset-link-format-quality"} value=${this.selectedFormat?.quality ?? 100} @cx-asset-link-format-quality-change=${this.onQualityChange}></cx-asset-link-format-quality>${M(
|
|
3163
3166
|
!this.noMetadata,
|
|
3164
|
-
() =>
|
|
3167
|
+
() => b`<cx-asset-link-format-metadata class="asset-link-format__details" ?open=${this.activeSetting === "cx-asset-link-format-metadata"} .value=${this.selectedFormat?.keepMetadata ?? !1} @cx-asset-link-format-metadata-change=${this.onMetadataChange}></cx-asset-link-format-metadata>`
|
|
3165
3168
|
)}
|
|
3166
3169
|
${M(
|
|
3167
3170
|
this.useCustomExtension,
|
|
3168
|
-
() =>
|
|
3171
|
+
() => b`<cx-asset-link-format-extension .items=${this.extensions} value=${this.selectedFormat?.extension ?? ""} @cx-asset-link-format-extension-change=${this.onExtensionChange}></cx-asset-link-format-extension>`
|
|
3169
3172
|
)}</div>`;
|
|
3170
3173
|
}
|
|
3171
3174
|
};
|
|
3172
|
-
|
|
3173
|
-
|
|
3175
|
+
m.styles = [Q, Ee];
|
|
3176
|
+
m.dependencies = {
|
|
3174
3177
|
"cx-asset-link-format-crop": v,
|
|
3175
3178
|
"cx-asset-link-format-extension": Z,
|
|
3176
3179
|
"cx-asset-link-format-metadata": U,
|
|
@@ -3182,145 +3185,145 @@ f.dependencies = {
|
|
|
3182
3185
|
"cx-space": B,
|
|
3183
3186
|
"cx-typography": q
|
|
3184
3187
|
};
|
|
3185
|
-
|
|
3188
|
+
y([
|
|
3186
3189
|
h({ attribute: "base-url", type: String })
|
|
3187
|
-
],
|
|
3188
|
-
|
|
3190
|
+
], m.prototype, "baseUrl", 2);
|
|
3191
|
+
y([
|
|
3189
3192
|
h({ attribute: "token", type: String })
|
|
3190
|
-
],
|
|
3191
|
-
|
|
3193
|
+
], m.prototype, "token", 2);
|
|
3194
|
+
y([
|
|
3192
3195
|
h({ reflect: !1, type: Object })
|
|
3193
|
-
],
|
|
3194
|
-
|
|
3196
|
+
], m.prototype, "asset", 2);
|
|
3197
|
+
y([
|
|
3195
3198
|
h({ attribute: "crop-modes", reflect: !1, type: Array })
|
|
3196
|
-
],
|
|
3197
|
-
|
|
3199
|
+
], m.prototype, "cropModes", 2);
|
|
3200
|
+
y([
|
|
3198
3201
|
h({ attribute: "focus-modes", reflect: !1, type: Object })
|
|
3199
|
-
],
|
|
3200
|
-
|
|
3202
|
+
], m.prototype, "focusModes", 2);
|
|
3203
|
+
y([
|
|
3201
3204
|
h({ reflect: !1, type: Array })
|
|
3202
|
-
],
|
|
3203
|
-
|
|
3205
|
+
], m.prototype, "extensions", 2);
|
|
3206
|
+
y([
|
|
3204
3207
|
h({ reflect: !1, type: Array })
|
|
3205
|
-
],
|
|
3206
|
-
|
|
3208
|
+
], m.prototype, "proxies", 2);
|
|
3209
|
+
y([
|
|
3207
3210
|
h({ attribute: "for-cropper", reflect: !0, type: String })
|
|
3208
|
-
],
|
|
3209
|
-
|
|
3211
|
+
], m.prototype, "forCropper", 2);
|
|
3212
|
+
y([
|
|
3210
3213
|
h({ attribute: "use-session", reflect: !0, type: String })
|
|
3211
|
-
],
|
|
3212
|
-
|
|
3214
|
+
], m.prototype, "useSession", 2);
|
|
3215
|
+
y([
|
|
3213
3216
|
h({ reflect: !1, type: Array })
|
|
3214
|
-
],
|
|
3215
|
-
|
|
3217
|
+
], m.prototype, "transformations", 2);
|
|
3218
|
+
y([
|
|
3216
3219
|
h({ attribute: "selected-proxy", reflect: !0, type: String })
|
|
3217
|
-
],
|
|
3218
|
-
|
|
3220
|
+
], m.prototype, "selectedProxy", 2);
|
|
3221
|
+
y([
|
|
3219
3222
|
h({ attribute: "default-proxy", reflect: !0, type: String })
|
|
3220
|
-
],
|
|
3221
|
-
|
|
3223
|
+
], m.prototype, "defaultProxy", 2);
|
|
3224
|
+
y([
|
|
3222
3225
|
h({ attribute: "can-auto-format", reflect: !0, type: Boolean })
|
|
3223
|
-
],
|
|
3224
|
-
|
|
3226
|
+
], m.prototype, "canAutoFormat", 2);
|
|
3227
|
+
y([
|
|
3225
3228
|
h({ attribute: "auto-format", reflect: !0, type: Boolean })
|
|
3226
|
-
],
|
|
3227
|
-
|
|
3229
|
+
], m.prototype, "autoFormat", 2);
|
|
3230
|
+
y([
|
|
3228
3231
|
h({ attribute: "use-custom-extension", reflect: !0, type: Boolean })
|
|
3229
|
-
],
|
|
3230
|
-
|
|
3232
|
+
], m.prototype, "useCustomExtension", 2);
|
|
3233
|
+
y([
|
|
3231
3234
|
h({ attribute: "no-metadata", reflect: !0, type: Boolean })
|
|
3232
|
-
],
|
|
3233
|
-
|
|
3235
|
+
], m.prototype, "noMetadata", 2);
|
|
3236
|
+
y([
|
|
3234
3237
|
h({ attribute: "no-format", reflect: !0, type: Boolean })
|
|
3235
|
-
],
|
|
3236
|
-
|
|
3238
|
+
], m.prototype, "noFormat", 2);
|
|
3239
|
+
y([
|
|
3237
3240
|
h({ attribute: "no-crop", reflect: !0, type: Boolean })
|
|
3238
|
-
],
|
|
3239
|
-
|
|
3241
|
+
], m.prototype, "noCrop", 2);
|
|
3242
|
+
y([
|
|
3240
3243
|
h({ attribute: "no-resize", reflect: !0, type: Boolean })
|
|
3241
|
-
],
|
|
3242
|
-
|
|
3244
|
+
], m.prototype, "noResize", 2);
|
|
3245
|
+
y([
|
|
3243
3246
|
h({ attribute: "no-rotate", reflect: !0, type: Boolean })
|
|
3244
|
-
],
|
|
3245
|
-
|
|
3247
|
+
], m.prototype, "noRotate", 2);
|
|
3248
|
+
y([
|
|
3246
3249
|
h({ attribute: "last-image-size", reflect: !1, type: Object })
|
|
3247
|
-
],
|
|
3248
|
-
|
|
3250
|
+
], m.prototype, "lastImageSize", 2);
|
|
3251
|
+
y([
|
|
3249
3252
|
h({ attribute: "hide-header", reflect: !1, type: Boolean })
|
|
3250
|
-
],
|
|
3251
|
-
|
|
3253
|
+
], m.prototype, "hideHeader", 2);
|
|
3254
|
+
y([
|
|
3252
3255
|
h({ attribute: "can-reset", type: Boolean })
|
|
3253
|
-
],
|
|
3254
|
-
|
|
3256
|
+
], m.prototype, "canReset", 2);
|
|
3257
|
+
y([
|
|
3255
3258
|
h({ attribute: !1, reflect: !1, type: Object })
|
|
3256
|
-
],
|
|
3257
|
-
|
|
3259
|
+
], m.prototype, "queryElement", 2);
|
|
3260
|
+
y([
|
|
3258
3261
|
R()
|
|
3259
|
-
],
|
|
3260
|
-
|
|
3262
|
+
], m.prototype, "activeSetting", 2);
|
|
3263
|
+
y([
|
|
3261
3264
|
R()
|
|
3262
|
-
],
|
|
3263
|
-
|
|
3265
|
+
], m.prototype, "selectedFormat", 2);
|
|
3266
|
+
y([
|
|
3264
3267
|
R()
|
|
3265
|
-
],
|
|
3266
|
-
|
|
3268
|
+
], m.prototype, "resizeSize", 2);
|
|
3269
|
+
y([
|
|
3267
3270
|
R()
|
|
3268
|
-
],
|
|
3269
|
-
|
|
3271
|
+
], m.prototype, "cropSize", 2);
|
|
3272
|
+
y([
|
|
3270
3273
|
R()
|
|
3271
|
-
],
|
|
3272
|
-
|
|
3274
|
+
], m.prototype, "rotation", 2);
|
|
3275
|
+
y([
|
|
3273
3276
|
R()
|
|
3274
|
-
],
|
|
3275
|
-
|
|
3277
|
+
], m.prototype, "defaultSize", 2);
|
|
3278
|
+
y([
|
|
3276
3279
|
R()
|
|
3277
|
-
],
|
|
3278
|
-
|
|
3280
|
+
], m.prototype, "cropperElement", 2);
|
|
3281
|
+
y([
|
|
3279
3282
|
R()
|
|
3280
|
-
],
|
|
3281
|
-
|
|
3283
|
+
], m.prototype, "parameters", 2);
|
|
3284
|
+
y([
|
|
3282
3285
|
R()
|
|
3283
|
-
],
|
|
3284
|
-
|
|
3286
|
+
], m.prototype, "loading", 2);
|
|
3287
|
+
y([
|
|
3285
3288
|
R()
|
|
3286
|
-
],
|
|
3287
|
-
|
|
3289
|
+
], m.prototype, "lastAction", 2);
|
|
3290
|
+
y([
|
|
3288
3291
|
R()
|
|
3289
|
-
],
|
|
3290
|
-
|
|
3292
|
+
], m.prototype, "frozenIndex", 2);
|
|
3293
|
+
y([
|
|
3291
3294
|
R()
|
|
3292
|
-
],
|
|
3293
|
-
|
|
3295
|
+
], m.prototype, "preResetTransformations", 2);
|
|
3296
|
+
y([
|
|
3294
3297
|
R()
|
|
3295
|
-
],
|
|
3296
|
-
|
|
3298
|
+
], m.prototype, "preResetAutoFormat", 2);
|
|
3299
|
+
y([
|
|
3297
3300
|
R()
|
|
3298
|
-
],
|
|
3299
|
-
|
|
3301
|
+
], m.prototype, "preResetSelectedProxy", 2);
|
|
3302
|
+
y([
|
|
3300
3303
|
P("transformations")
|
|
3301
|
-
],
|
|
3302
|
-
|
|
3304
|
+
], m.prototype, "handleTransformationsChange", 1);
|
|
3305
|
+
y([
|
|
3303
3306
|
P("selectedProxy")
|
|
3304
|
-
],
|
|
3305
|
-
|
|
3307
|
+
], m.prototype, "handleSelectedProxyChange", 1);
|
|
3308
|
+
y([
|
|
3306
3309
|
P("loading")
|
|
3307
|
-
],
|
|
3308
|
-
|
|
3310
|
+
], m.prototype, "handleLoadingChange", 1);
|
|
3311
|
+
m = y([
|
|
3309
3312
|
X("cx-asset-link-format")
|
|
3310
|
-
],
|
|
3313
|
+
], m);
|
|
3311
3314
|
export {
|
|
3312
|
-
|
|
3315
|
+
m as C,
|
|
3313
3316
|
Xi as F,
|
|
3314
3317
|
Ft as M,
|
|
3315
|
-
|
|
3318
|
+
$e as a,
|
|
3316
3319
|
Zt as b,
|
|
3317
3320
|
rt as c,
|
|
3318
3321
|
xt as d,
|
|
3319
3322
|
Qt as e,
|
|
3320
|
-
|
|
3323
|
+
Se as f,
|
|
3321
3324
|
Xt as g,
|
|
3322
3325
|
Gi as h,
|
|
3323
|
-
|
|
3326
|
+
Ie as i,
|
|
3324
3327
|
Qi as j,
|
|
3325
3328
|
Vi as k,
|
|
3326
3329
|
ut as l,
|
|
@@ -3332,5 +3335,5 @@ export {
|
|
|
3332
3335
|
Bi as r,
|
|
3333
3336
|
qi as s,
|
|
3334
3337
|
ji as t,
|
|
3335
|
-
|
|
3338
|
+
ue as u
|
|
3336
3339
|
};
|