@orangelogic/design-system 2.137.0 → 2.138.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.C7qLkR5q.js → asset-link-format.Cj3Jb2A9.js} +220 -219
- package/library/chunks/{button.C1SliH9f.js → button.C8bgBiYj.js} +1 -1
- package/library/chunks/{color-swatch-group.-16VIoq6.js → color-swatch-group.CtRKXJDT.js} +14 -6
- package/library/chunks/{color-swatch.C26o9Mgz.js → color-swatch.BPKlNXIX.js} +1 -1
- package/library/chunks/{confirm-popover.UaaAL0w7.js → confirm-popover.CgXY2_uO.js} +3 -3
- package/library/chunks/{dialog.Bb0_EAwb.js → dialog.Bs7RQgSa.js} +2 -2
- package/library/chunks/{document-viewer.Bfg059Ip.js → document-viewer.Bs3U0_wd.js} +6 -5
- package/library/chunks/{dot-pagination.BzRjwmKy.js → dot-pagination.t0VzNnjC.js} +1 -1
- package/library/chunks/{endpoints.tU0_RZ_7.js → endpoints.BlywT4Gl.js} +1 -1
- package/library/chunks/{file-on-demand.j_V2IDwl.js → file-on-demand.BWrBwTOn.js} +9 -9
- package/library/chunks/{folder-select.B2trdP78.js → folder-select.CItC06TB.js} +5 -5
- package/library/chunks/{header.CAG_RmQg.js → header.D_TqvPdB.js} +1 -1
- package/library/chunks/{i18n.Dqb15q5k.js → i18n.BlLEIqQ0.js} +4 -3
- package/library/chunks/{icon-button.BqFraOfp.js → icon-button.D5sM02Cd.js} +1 -1
- package/library/chunks/{iframe.Cg0YBl8p.js → iframe.D3PpeqXx.js} +1 -1
- package/library/chunks/{image.VNvhPhZ1.js → image.qP6cTWCN.js} +1 -1
- package/library/chunks/{input.C_db7iND.js → input.B8CV80Da.js} +1 -1
- package/library/chunks/{option.D5NdA-Cm.js → option.D9SqVdjL.js} +1 -1
- package/library/chunks/{pagination.C_4fPcD4.js → pagination.DAI32_PA.js} +5 -5
- package/library/chunks/{tab-group.CRTjU6He.js → tab-group.e83Yy-jY.js} +3 -3
- package/library/chunks/{tree.BYcnDDKg.js → tree.D7eyb405.js} +1 -1
- package/library/components/alert.js +2 -2
- package/library/components/asset-link-format.js +3 -3
- package/library/components/atoms.js +13 -13
- 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 +10 -10
- package/library/components/folder-select.js +5 -5
- 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/masonry.js +2 -2
- package/library/components/menu-item.js +6 -1
- package/library/components/menu.js +1 -1
- package/library/components/molecules.js +3 -3
- package/library/components/option.js +2 -2
- package/library/components/organisms.js +3 -3
- 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 +4 -4
- 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 +12242 -12202
- package/library/components/video.js +2 -2
- package/library/package.json +1 -1
- package/library/packages/molecules/src/asset-format-picker/asset-format-picker.d.ts +11 -0
- package/library/packages/organisms/src/asset-transformation-dialog/asset-transformation-dialog.d.ts +7 -0
- package/library/packages/services/src/api/asset/asset.d.ts +2 -1
- package/library/packages/services/src/api/endpoints.d.ts +1 -0
- package/library/packages/utils/src/custom-element/i18n.d.ts +1 -0
- package/library/react-web-component.d.ts +4 -0
- package/library/utils.js +1 -1
- package/package.json +1 -1
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import "../components/cropper.js";
|
|
2
|
-
import { C as G } from "./button.
|
|
2
|
+
import { C as G } from "./button.C8bgBiYj.js";
|
|
3
3
|
import D from "../components/space.js";
|
|
4
4
|
import { C as T } from "./typography.DJC_UXgs.js";
|
|
5
5
|
import { n as h, C as N } from "./lib-cortex-element.CVMmyPMC.js";
|
|
6
|
-
import { h as P, a as Et, C as
|
|
7
|
-
import { M as
|
|
6
|
+
import { h as P, a as Et, C as It, S as Nt, b as Lt, c as Ot } from "./endpoints.BlywT4Gl.js";
|
|
7
|
+
import { M as At, U as o, T as c } from "./asset-link-format.QzzboHHE.js";
|
|
8
8
|
import "./browser.BHOCIF_A.js";
|
|
9
9
|
import { i as L, x, E as Ut } from "./lit-element.jLBm65_O.js";
|
|
10
10
|
import "./form.K1XOtu3S.js";
|
|
11
|
-
import { L as O } from "./i18n.
|
|
11
|
+
import { L as O } from "./i18n.BlLEIqQ0.js";
|
|
12
12
|
import { a as qt } from "./string.CjJ09HK3.js";
|
|
13
13
|
import "./date-picker.DTUICGb9.js";
|
|
14
14
|
import "./content-builder.BGzxZUgi.js";
|
|
@@ -17,22 +17,22 @@ import { b as Bt } from "./_baseUniq.HFKneygy.js";
|
|
|
17
17
|
import { c as U } from "./component.styles.CRO4Odto.js";
|
|
18
18
|
import { c as q } from "./custom-element.L4WJXn1j.js";
|
|
19
19
|
import { w as C } from "./watch.CThbualB.js";
|
|
20
|
-
import { s as
|
|
20
|
+
import { s as bt, c as zt } from "./number.B4PQLJIg.js";
|
|
21
21
|
import { b as et } from "./transformation.c-RS37zA.js";
|
|
22
22
|
import { r as v } from "./state.CSDxrqLd.js";
|
|
23
23
|
import { n as _ } from "./when.Dr1es41R.js";
|
|
24
24
|
import Z from "../components/details.js";
|
|
25
25
|
import jt from "../components/divider.js";
|
|
26
26
|
import { C as Y } from "./icon.DnBh6-56.js";
|
|
27
|
-
import { C as ut } from "./icon-button.
|
|
28
|
-
import { C as mt } from "./input.
|
|
29
|
-
import { C as rt } from "./option.
|
|
27
|
+
import { C as ut } from "./icon-button.D5sM02Cd.js";
|
|
28
|
+
import { C as mt } from "./input.B8CV80Da.js";
|
|
29
|
+
import { C as rt } from "./option.D9SqVdjL.js";
|
|
30
30
|
import nt from "../components/select.js";
|
|
31
31
|
import { c as Vt } from "./image.BzmclWBR.js";
|
|
32
32
|
import { e as J } from "./query.BBf1UFkC.js";
|
|
33
33
|
import { c as tt } from "./repeat.CFjcER6_.js";
|
|
34
34
|
import { o as I } from "./style-map.llVFPd__.js";
|
|
35
|
-
import
|
|
35
|
+
import Ht from "../components/tooltip.js";
|
|
36
36
|
import Gt from "../components/button-group.js";
|
|
37
37
|
import { C as Qt } from "./checkbox.Cjcht4xR.js";
|
|
38
38
|
function Kt(t) {
|
|
@@ -81,36 +81,36 @@ function te(t) {
|
|
|
81
81
|
if (a == null)
|
|
82
82
|
continue;
|
|
83
83
|
if (s === "custom") {
|
|
84
|
-
for (const [
|
|
84
|
+
for (const [n, l] of Object.entries(
|
|
85
85
|
a
|
|
86
86
|
))
|
|
87
|
-
e.push(wt(
|
|
87
|
+
e.push(wt(n, l));
|
|
88
88
|
continue;
|
|
89
89
|
}
|
|
90
|
-
const
|
|
91
|
-
if (
|
|
90
|
+
const r = Zt[s];
|
|
91
|
+
if (r) {
|
|
92
92
|
if (Yt.has(s)) {
|
|
93
93
|
e.push(
|
|
94
|
-
Jt(
|
|
94
|
+
Jt(r, a)
|
|
95
95
|
);
|
|
96
96
|
continue;
|
|
97
97
|
}
|
|
98
98
|
if (s === "color") {
|
|
99
|
-
e.push(`${
|
|
99
|
+
e.push(`${r}:${a}`);
|
|
100
100
|
continue;
|
|
101
101
|
}
|
|
102
102
|
if (s === "parentFolderIdentifier") {
|
|
103
|
-
const
|
|
104
|
-
if (
|
|
103
|
+
const n = Array.isArray(a) ? a : [a];
|
|
104
|
+
if (n.length === 0)
|
|
105
105
|
continue;
|
|
106
106
|
const l = [
|
|
107
|
-
...
|
|
108
|
-
...
|
|
107
|
+
...n.map((u) => `ParentFolderIdentifier:${pt(String(u))}`),
|
|
108
|
+
...n.map((u) => `ParentAlbumIdentifier:${pt(String(u))}`)
|
|
109
109
|
];
|
|
110
110
|
e.push(`(${l.join(" OR ")})`);
|
|
111
111
|
continue;
|
|
112
112
|
}
|
|
113
|
-
e.push(wt(
|
|
113
|
+
e.push(wt(r, a));
|
|
114
114
|
}
|
|
115
115
|
}
|
|
116
116
|
return e.join(" AND ");
|
|
@@ -128,22 +128,22 @@ function it(t) {
|
|
|
128
128
|
}
|
|
129
129
|
return te(t);
|
|
130
130
|
}
|
|
131
|
-
const dt = "CoreField.LargeSizePreview", vt = "CoreField.DocType", ee = "Document.Title", ie = "Document.CaptionLong", kt = "Document.FileExtension", Ct = "CoreField.FileSize", $t = "CoreField.Identifier", Rt = "CoreField.Keywords", _t = "CoreField.MaxHeight", Pt = "CoreField.MaxWidth", st = "Document.RecordID", Mt = "CoreField.DocSubType",
|
|
131
|
+
const dt = "CoreField.LargeSizePreview", vt = "CoreField.DocType", ee = "Document.Title", ie = "Document.CaptionLong", kt = "Document.FileExtension", Ct = "CoreField.FileSize", $t = "CoreField.Identifier", Rt = "CoreField.Keywords", _t = "CoreField.MaxHeight", Pt = "CoreField.MaxWidth", st = "Document.RecordID", Mt = "CoreField.DocSubType", Wt = "CoreField.TitleWithFallback", at = "CoreField.OriginalFileName", ot = "CoreField.UpdatedFileName", X = "CoreField.OriginalPreview", ct = {
|
|
132
132
|
DEFAULT_VIEW_SIZE: "Document.LargeSizePreview",
|
|
133
133
|
FIELD_TITLE_WITH_FALLBACK: "Document.TitleWithFallback",
|
|
134
134
|
ORIGINAL_VIEW_SIZE: "Document.OriginalPreview"
|
|
135
|
-
},
|
|
135
|
+
}, Dt = {
|
|
136
136
|
[dt]: ct.DEFAULT_VIEW_SIZE,
|
|
137
|
-
[
|
|
137
|
+
[Wt]: ct.FIELD_TITLE_WITH_FALLBACK,
|
|
138
138
|
[X]: ct.ORIGINAL_VIEW_SIZE
|
|
139
139
|
}, se = Object.fromEntries(
|
|
140
|
-
Object.entries(
|
|
140
|
+
Object.entries(Dt).map(([t, e]) => [
|
|
141
141
|
e,
|
|
142
142
|
t
|
|
143
143
|
])
|
|
144
144
|
);
|
|
145
145
|
function ae(t) {
|
|
146
|
-
return
|
|
146
|
+
return Dt[t] ?? t;
|
|
147
147
|
}
|
|
148
148
|
function Ft(t) {
|
|
149
149
|
const e = {};
|
|
@@ -153,20 +153,20 @@ function Ft(t) {
|
|
|
153
153
|
}
|
|
154
154
|
return e;
|
|
155
155
|
}
|
|
156
|
-
async function
|
|
156
|
+
async function Tt({
|
|
157
157
|
countPerPage: t,
|
|
158
158
|
fields: e,
|
|
159
159
|
getPermanentAssetsPaths: i,
|
|
160
160
|
isSiteBuilder: s,
|
|
161
161
|
pageNumber: a,
|
|
162
|
-
query:
|
|
163
|
-
securityByPassToken:
|
|
162
|
+
query: r,
|
|
163
|
+
securityByPassToken: n,
|
|
164
164
|
siteUrl: l,
|
|
165
165
|
sort: u,
|
|
166
166
|
token: S,
|
|
167
167
|
useSession: f
|
|
168
168
|
}) {
|
|
169
|
-
const
|
|
169
|
+
const z = e?.map(ae);
|
|
170
170
|
try {
|
|
171
171
|
return (await P.request({
|
|
172
172
|
baseURL: l,
|
|
@@ -174,12 +174,12 @@ async function Dt({
|
|
|
174
174
|
method: "GET",
|
|
175
175
|
params: {
|
|
176
176
|
CountPerPage: t,
|
|
177
|
-
Fields: Kt(
|
|
177
|
+
Fields: Kt(z),
|
|
178
178
|
Format: "json",
|
|
179
179
|
GetPermanentAssetsPaths: i || void 0,
|
|
180
180
|
PageNumber: a,
|
|
181
|
-
Query: it(
|
|
182
|
-
SecurityByPassToken:
|
|
181
|
+
Query: it(r),
|
|
182
|
+
SecurityByPassToken: n || void 0,
|
|
183
183
|
Sort: u || void 0,
|
|
184
184
|
UseSession: f || void 0
|
|
185
185
|
},
|
|
@@ -197,7 +197,7 @@ async function Dt({
|
|
|
197
197
|
totalCount: m.APIResponse?.GlobalInfo?.TotalCount ?? 0
|
|
198
198
|
})
|
|
199
199
|
],
|
|
200
|
-
url: s ?
|
|
200
|
+
url: s ? It.SEARCH_ASSETS : Nt["4.0"]
|
|
201
201
|
})).data;
|
|
202
202
|
} catch {
|
|
203
203
|
return { items: [], sort: "", totalCount: 0 };
|
|
@@ -209,8 +209,8 @@ async function oe({
|
|
|
209
209
|
format: i,
|
|
210
210
|
siteUrl: s,
|
|
211
211
|
token: a,
|
|
212
|
-
transformations:
|
|
213
|
-
useSession:
|
|
212
|
+
transformations: r,
|
|
213
|
+
useSession: n
|
|
214
214
|
}) {
|
|
215
215
|
try {
|
|
216
216
|
return (await P.request({
|
|
@@ -221,8 +221,8 @@ async function oe({
|
|
|
221
221
|
SourceAssetRecordID: t,
|
|
222
222
|
TargetExtension: qt(e),
|
|
223
223
|
Token: a || void 0,
|
|
224
|
-
Transformations:
|
|
225
|
-
UseSession:
|
|
224
|
+
Transformations: r,
|
|
225
|
+
UseSession: n || void 0
|
|
226
226
|
},
|
|
227
227
|
/**
|
|
228
228
|
* https://link.orangelogic.com/Tasks/41S1XH
|
|
@@ -248,12 +248,12 @@ async function gi({
|
|
|
248
248
|
isSiteBuilder: i,
|
|
249
249
|
recordIds: s,
|
|
250
250
|
securityByPassToken: a,
|
|
251
|
-
token:
|
|
251
|
+
token: r
|
|
252
252
|
}) {
|
|
253
253
|
if (!Array.isArray(s) || s.length === 0)
|
|
254
254
|
return { facets: [], items: [], totalCount: 0 };
|
|
255
|
-
const
|
|
256
|
-
...
|
|
255
|
+
const n = t?.filter((m) => m && typeof m == "string") ?? [], l = [
|
|
256
|
+
...n,
|
|
257
257
|
X,
|
|
258
258
|
ot,
|
|
259
259
|
at,
|
|
@@ -262,7 +262,7 @@ async function gi({
|
|
|
262
262
|
st
|
|
263
263
|
], u = ne(s, re), S = await Promise.all(
|
|
264
264
|
u.map(
|
|
265
|
-
(m) =>
|
|
265
|
+
(m) => Tt({
|
|
266
266
|
countPerPage: m.length,
|
|
267
267
|
fields: l,
|
|
268
268
|
getPermanentAssetsPaths: e,
|
|
@@ -270,17 +270,17 @@ async function gi({
|
|
|
270
270
|
pageNumber: 1,
|
|
271
271
|
query: { recordId: m },
|
|
272
272
|
securityByPassToken: a,
|
|
273
|
-
token:
|
|
273
|
+
token: r
|
|
274
274
|
})
|
|
275
275
|
)
|
|
276
|
-
), f = new Map(s.map((m, R) => [m, R])),
|
|
276
|
+
), f = new Map(s.map((m, R) => [m, R])), z = S.flatMap((m) => m.items).map((m) => {
|
|
277
277
|
let R = w(m, ot);
|
|
278
278
|
return R === "" && (R = w(m, at)), {
|
|
279
279
|
name: R,
|
|
280
280
|
originalUrl: w(m, X),
|
|
281
281
|
recordId: w(m, st),
|
|
282
|
-
...
|
|
283
|
-
(Q,
|
|
282
|
+
...n.reduce(
|
|
283
|
+
(Q, A) => (Q[A] = w(m, A), Q),
|
|
284
284
|
{}
|
|
285
285
|
)
|
|
286
286
|
};
|
|
@@ -290,7 +290,7 @@ async function gi({
|
|
|
290
290
|
(m, R) => m + R.totalCount,
|
|
291
291
|
0
|
|
292
292
|
);
|
|
293
|
-
return { facets: [], items:
|
|
293
|
+
return { facets: [], items: z, totalCount: $ };
|
|
294
294
|
}
|
|
295
295
|
function w(t, e) {
|
|
296
296
|
const i = t[e];
|
|
@@ -302,25 +302,25 @@ async function xi({
|
|
|
302
302
|
extraFields: i,
|
|
303
303
|
getPermanentAssetsPaths: s,
|
|
304
304
|
isSiteBuilder: a,
|
|
305
|
-
limitedDocTypes:
|
|
306
|
-
pageNumber:
|
|
305
|
+
limitedDocTypes: r,
|
|
306
|
+
pageNumber: n,
|
|
307
307
|
parentFolderIdentifier: l,
|
|
308
308
|
searchTerm: u,
|
|
309
309
|
securityByPassToken: S,
|
|
310
310
|
sortOrder: f,
|
|
311
|
-
token:
|
|
311
|
+
token: z
|
|
312
312
|
}) {
|
|
313
313
|
if (!e && !l)
|
|
314
314
|
return { facets: [], items: [], totalCount: 0 };
|
|
315
|
-
const $ = (i?.filter((
|
|
315
|
+
const $ = (i?.filter((A) => A && typeof A == "string") ?? []).map((A) => A.replace("%20", " ")), m = {
|
|
316
316
|
directParentFolderIdentifier: e,
|
|
317
317
|
parentFolderIdentifier: l,
|
|
318
|
-
...
|
|
319
|
-
}, R = await
|
|
318
|
+
...r.length > 0 ? { docType: [At.Image, At.Audio] } : {}
|
|
319
|
+
}, R = await Tt({
|
|
320
320
|
countPerPage: t,
|
|
321
321
|
fields: [
|
|
322
322
|
...$,
|
|
323
|
-
|
|
323
|
+
Wt,
|
|
324
324
|
dt,
|
|
325
325
|
X,
|
|
326
326
|
Rt,
|
|
@@ -337,31 +337,31 @@ async function xi({
|
|
|
337
337
|
],
|
|
338
338
|
getPermanentAssetsPaths: s,
|
|
339
339
|
isSiteBuilder: a,
|
|
340
|
-
pageNumber:
|
|
340
|
+
pageNumber: n,
|
|
341
341
|
query: m,
|
|
342
342
|
securityByPassToken: S,
|
|
343
343
|
sort: void 0,
|
|
344
|
-
token:
|
|
345
|
-
}), Q = R.items.map((
|
|
346
|
-
let K = w(
|
|
347
|
-
K && !K.startsWith(".") && (K = "." + K), lt === "" && (lt = w(
|
|
348
|
-
const xt = w(
|
|
344
|
+
token: z
|
|
345
|
+
}), Q = R.items.map((A) => {
|
|
346
|
+
let K = w(A, kt), lt = w(A, ot), gt = w(A, dt);
|
|
347
|
+
K && !K.startsWith(".") && (K = "." + K), lt === "" && (lt = w(A, at)), K.toLowerCase() === ".gif" && (gt = w(A, X));
|
|
348
|
+
const xt = w(A, st);
|
|
349
349
|
return {
|
|
350
|
-
docSubType: w(
|
|
351
|
-
docType: w(
|
|
350
|
+
docSubType: w(A, Mt),
|
|
351
|
+
docType: w(A, vt) || "",
|
|
352
352
|
extension: K,
|
|
353
|
-
height: w(
|
|
353
|
+
height: w(A, _t) || "0",
|
|
354
354
|
id: xt,
|
|
355
|
-
identifier: w(
|
|
355
|
+
identifier: w(A, $t),
|
|
356
356
|
imageUrl: gt,
|
|
357
357
|
name: lt,
|
|
358
|
-
originalUrl: w(
|
|
358
|
+
originalUrl: w(A, X),
|
|
359
359
|
recordId: xt,
|
|
360
|
-
size: w(
|
|
361
|
-
tags: w(
|
|
362
|
-
width: w(
|
|
360
|
+
size: w(A, Ct) || "0 MB",
|
|
361
|
+
tags: w(A, Rt),
|
|
362
|
+
width: w(A, Pt) || "0",
|
|
363
363
|
...$.reduce(
|
|
364
|
-
(yt, St) => (yt[St] = w(
|
|
364
|
+
(yt, St) => (yt[St] = w(A, St), yt),
|
|
365
365
|
{}
|
|
366
366
|
)
|
|
367
367
|
};
|
|
@@ -394,11 +394,11 @@ async function he({
|
|
|
394
394
|
// 5 minutes
|
|
395
395
|
transformResponse: [
|
|
396
396
|
...Array.isArray(P.defaults.transformResponse) ? P.defaults.transformResponse : [],
|
|
397
|
-
(
|
|
398
|
-
height:
|
|
399
|
-
width:
|
|
400
|
-
x:
|
|
401
|
-
y:
|
|
397
|
+
(n) => ({
|
|
398
|
+
height: n.cropHeight,
|
|
399
|
+
width: n.cropWidth,
|
|
400
|
+
x: n.cropX,
|
|
401
|
+
y: n.cropY
|
|
402
402
|
})
|
|
403
403
|
],
|
|
404
404
|
url: Et.GET_CROP_ZONE_SUGGESTION
|
|
@@ -409,35 +409,36 @@ async function he({
|
|
|
409
409
|
}
|
|
410
410
|
async function yi({
|
|
411
411
|
assetRecordId: t,
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
412
|
+
isSiteBuilder: e,
|
|
413
|
+
siteUrl: i,
|
|
414
|
+
token: s,
|
|
415
|
+
useSession: a
|
|
415
416
|
}) {
|
|
416
417
|
try {
|
|
417
418
|
return (await P.request({
|
|
418
|
-
baseURL:
|
|
419
|
+
baseURL: i,
|
|
419
420
|
method: "GET",
|
|
420
421
|
params: {
|
|
421
422
|
RecordId: t,
|
|
422
|
-
Token:
|
|
423
|
-
UseSession:
|
|
423
|
+
Token: s,
|
|
424
|
+
UseSession: a || void 0
|
|
424
425
|
},
|
|
425
426
|
responseType: "json",
|
|
426
427
|
transformResponse: [
|
|
427
428
|
...Array.isArray(P.defaults.transformResponse) ? P.defaults.transformResponse : [],
|
|
428
|
-
(n) => !n || typeof n != "object" ? [] : n.proxies?.map((
|
|
429
|
-
cdnName:
|
|
430
|
-
extension:
|
|
431
|
-
formatHeight:
|
|
432
|
-
formatWidth:
|
|
433
|
-
height:
|
|
434
|
-
permanentLink:
|
|
435
|
-
proxyLabel:
|
|
436
|
-
proxyName:
|
|
437
|
-
width:
|
|
429
|
+
(n) => !n || typeof n != "object" ? [] : n.proxies?.map((l) => ({
|
|
430
|
+
cdnName: l.cdnName,
|
|
431
|
+
extension: l.extension,
|
|
432
|
+
formatHeight: l.formatHeight,
|
|
433
|
+
formatWidth: l.formatWidth,
|
|
434
|
+
height: l.height,
|
|
435
|
+
permanentLink: l.permanentLink,
|
|
436
|
+
proxyLabel: l.proxyLabel,
|
|
437
|
+
proxyName: l.proxyName,
|
|
438
|
+
width: l.width
|
|
438
439
|
})) ?? []
|
|
439
440
|
],
|
|
440
|
-
url: Ot
|
|
441
|
+
url: e ? It.GET_AVAILABLE_PROXIES : Ot
|
|
441
442
|
})).data;
|
|
442
443
|
} catch {
|
|
443
444
|
return [];
|
|
@@ -472,8 +473,8 @@ async function Si({
|
|
|
472
473
|
}
|
|
473
474
|
const le = L`.asset-link-format__details{--header-padding:var(--cx-spacing-small) var(--cx-spacing-medium)}.asset-link-format__details::part(icon){width:var(--cx-font-size-3x-large);height:var(--cx-font-size-3x-large);background-color:var(--cx-color-neutral-100);border-radius:var(--cx-border-radius-large);color:var(--cx-color-neutral-600);font-size:var(--cx-font-size-large);justify-content:center;align-items:center;display:flex}.asset-link-format__details::part(input-label){color:var(--cx-color-neutral-400);margin-inline-start:var(--cx-spacing-small)}.asset-link-format__header{padding:var(--cx-spacing-medium)}.asset-link-format__section-header{padding:0 var(--cx-spacing-medium);border-top:var(--section-header-border-width,1px) solid var(--cx-color-neutral-200);background-color:var(--cx-color-neutral-50)}.asset-link-format__undo,.asset-link-format__reset{--color:var(--cx-color-primary);--background-color:transparent}`, ce = L`cx-details::part(base){border-bottom-width:0}cx-space{width:100%}cx-space cx-input{flex:1}.crop__unit-select{width:120px}.crop__input-group{flex:1;display:flex}`;
|
|
474
475
|
var pe = Object.defineProperty, de = Object.getOwnPropertyDescriptor, y = (t, e, i, s) => {
|
|
475
|
-
for (var a = s > 1 ? void 0 : s ? de(e, i) : e,
|
|
476
|
-
(
|
|
476
|
+
for (var a = s > 1 ? void 0 : s ? de(e, i) : e, r = t.length - 1, n; r >= 0; r--)
|
|
477
|
+
(n = t[r]) && (a = (s ? n(e, i, a) : n(a)) || a);
|
|
477
478
|
return s && a && pe(e, i, a), a;
|
|
478
479
|
};
|
|
479
480
|
let g = class extends N {
|
|
@@ -590,19 +591,19 @@ let g = class extends N {
|
|
|
590
591
|
else if (!i) {
|
|
591
592
|
const [s, a] = e.split(":").map(Number);
|
|
592
593
|
if (this.unit === o.Pixel) {
|
|
593
|
-
let
|
|
594
|
-
Number.isFinite(this.maxWidth) && Number.isFinite(this.maxHeight) && ({ height:
|
|
594
|
+
let r = s, n = a;
|
|
595
|
+
Number.isFinite(this.maxWidth) && Number.isFinite(this.maxHeight) && ({ height: n, width: r } = Vt(
|
|
595
596
|
this.maxWidth,
|
|
596
597
|
this.maxHeight,
|
|
597
598
|
s,
|
|
598
599
|
a
|
|
599
600
|
)), this.emit("cx-asset-link-format-crop-change", {
|
|
600
601
|
detail: {
|
|
601
|
-
height:
|
|
602
|
+
height: n,
|
|
602
603
|
keepAspectRatio: !0,
|
|
603
604
|
silent: !0,
|
|
604
605
|
unit: o.Pixel,
|
|
605
|
-
width:
|
|
606
|
+
width: r
|
|
606
607
|
}
|
|
607
608
|
});
|
|
608
609
|
} else
|
|
@@ -833,8 +834,8 @@ g = y([
|
|
|
833
834
|
], g);
|
|
834
835
|
const ue = L`.extension{padding:var(--cx-spacing-small) var(--cx-spacing-medium);border:solid 1px var(--cx-color-neutral-200);background-color:var(--cx-color-neutral-0);& cx-select{flex:1;width:100%}}`;
|
|
835
836
|
var me = Object.defineProperty, fe = Object.getOwnPropertyDescriptor, ft = (t, e, i, s) => {
|
|
836
|
-
for (var a = s > 1 ? void 0 : s ? fe(e, i) : e,
|
|
837
|
-
(
|
|
837
|
+
for (var a = s > 1 ? void 0 : s ? fe(e, i) : e, r = t.length - 1, n; r >= 0; r--)
|
|
838
|
+
(n = t[r]) && (a = (s ? n(e, i, a) : n(a)) || a);
|
|
838
839
|
return s && a && me(e, i, a), a;
|
|
839
840
|
};
|
|
840
841
|
let V = class extends N {
|
|
@@ -873,8 +874,8 @@ V = ft([
|
|
|
873
874
|
], V);
|
|
874
875
|
const ge = L`cx-details::part(base){border-bottom-width:0}`;
|
|
875
876
|
var xe = Object.defineProperty, ye = Object.getOwnPropertyDescriptor, H = (t, e, i, s) => {
|
|
876
|
-
for (var a = s > 1 ? void 0 : s ? ye(e, i) : e,
|
|
877
|
-
(
|
|
877
|
+
for (var a = s > 1 ? void 0 : s ? ye(e, i) : e, r = t.length - 1, n; r >= 0; r--)
|
|
878
|
+
(n = t[r]) && (a = (s ? n(e, i, a) : n(a)) || a);
|
|
878
879
|
return s && a && xe(e, i, a), a;
|
|
879
880
|
};
|
|
880
881
|
let M = class extends N {
|
|
@@ -970,10 +971,10 @@ M = H([
|
|
|
970
971
|
q("cx-asset-link-format-proxy")
|
|
971
972
|
], M);
|
|
972
973
|
const Se = L`cx-details::part(base){border-bottom-width:0}`;
|
|
973
|
-
var
|
|
974
|
-
for (var a = s > 1 ? void 0 : s ?
|
|
975
|
-
(
|
|
976
|
-
return s && a &&
|
|
974
|
+
var Ae = Object.defineProperty, be = Object.getOwnPropertyDescriptor, B = (t, e, i, s) => {
|
|
975
|
+
for (var a = s > 1 ? void 0 : s ? be(e, i) : e, r = t.length - 1, n; r >= 0; r--)
|
|
976
|
+
(n = t[r]) && (a = (s ? n(e, i, a) : n(a)) || a);
|
|
977
|
+
return s && a && Ae(e, i, a), a;
|
|
977
978
|
};
|
|
978
979
|
let F = class extends N {
|
|
979
980
|
constructor() {
|
|
@@ -1035,7 +1036,7 @@ F.dependencies = {
|
|
|
1035
1036
|
"cx-icon": Y,
|
|
1036
1037
|
"cx-input": mt,
|
|
1037
1038
|
"cx-space": D,
|
|
1038
|
-
"cx-tooltip":
|
|
1039
|
+
"cx-tooltip": Ht,
|
|
1039
1040
|
"cx-typography": T
|
|
1040
1041
|
};
|
|
1041
1042
|
B([
|
|
@@ -1062,13 +1063,13 @@ B([
|
|
|
1062
1063
|
F = B([
|
|
1063
1064
|
q("cx-asset-link-format-quality")
|
|
1064
1065
|
], F);
|
|
1065
|
-
const
|
|
1066
|
+
const ze = L`cx-details::part(base){border-bottom-width:0}cx-space{width:100%}cx-space cx-input{flex:1}.resize__unit-select{width:120px}.resize__input-group{flex:1;display:flex}`;
|
|
1066
1067
|
var we = Object.defineProperty, ve = Object.getOwnPropertyDescriptor, k = (t, e, i, s) => {
|
|
1067
|
-
for (var a = s > 1 ? void 0 : s ? ve(e, i) : e,
|
|
1068
|
-
(
|
|
1068
|
+
for (var a = s > 1 ? void 0 : s ? ve(e, i) : e, r = t.length - 1, n; r >= 0; r--)
|
|
1069
|
+
(n = t[r]) && (a = (s ? n(e, i, a) : n(a)) || a);
|
|
1069
1070
|
return s && a && we(e, i, a), a;
|
|
1070
1071
|
};
|
|
1071
|
-
let
|
|
1072
|
+
let b = class extends N {
|
|
1072
1073
|
constructor() {
|
|
1073
1074
|
super(...arguments), this.localize = new O(this), this.open = !1, this.width = 0, this.height = 0, this.maxWidth = 0, this.maxHeight = 0, this.ratioWidth = 1, this.ratioHeight = 1, this.unit = o.Pixel, this.lastAppliedSetting = {
|
|
1074
1075
|
[o.Pixel]: { height: 0, width: 0 },
|
|
@@ -1219,8 +1220,8 @@ let z = class extends N {
|
|
|
1219
1220
|
})} @click=${this.handleApply}>${this.localize.term("apply")}</cx-button>`)}</cx-space></cx-details>`;
|
|
1220
1221
|
}
|
|
1221
1222
|
};
|
|
1222
|
-
|
|
1223
|
-
|
|
1223
|
+
b.styles = [U, ze];
|
|
1224
|
+
b.dependencies = {
|
|
1224
1225
|
"cx-button": G,
|
|
1225
1226
|
"cx-details": Z,
|
|
1226
1227
|
"cx-icon": Y,
|
|
@@ -1233,68 +1234,68 @@ z.dependencies = {
|
|
|
1233
1234
|
};
|
|
1234
1235
|
k([
|
|
1235
1236
|
J(".details")
|
|
1236
|
-
],
|
|
1237
|
+
], b.prototype, "base", 2);
|
|
1237
1238
|
k([
|
|
1238
1239
|
h({ reflect: !0, type: Boolean })
|
|
1239
|
-
],
|
|
1240
|
+
], b.prototype, "open", 2);
|
|
1240
1241
|
k([
|
|
1241
1242
|
h({ reflect: !0, type: Number })
|
|
1242
|
-
],
|
|
1243
|
+
], b.prototype, "width", 2);
|
|
1243
1244
|
k([
|
|
1244
1245
|
h({ reflect: !0, type: Number })
|
|
1245
|
-
],
|
|
1246
|
+
], b.prototype, "height", 2);
|
|
1246
1247
|
k([
|
|
1247
1248
|
h({ attribute: "max-width", reflect: !0, type: Number })
|
|
1248
|
-
],
|
|
1249
|
+
], b.prototype, "maxWidth", 2);
|
|
1249
1250
|
k([
|
|
1250
1251
|
h({ attribute: "max-height", reflect: !0, type: Number })
|
|
1251
|
-
],
|
|
1252
|
+
], b.prototype, "maxHeight", 2);
|
|
1252
1253
|
k([
|
|
1253
1254
|
h({ attribute: "ratio-width", reflect: !0, type: Number })
|
|
1254
|
-
],
|
|
1255
|
+
], b.prototype, "ratioWidth", 2);
|
|
1255
1256
|
k([
|
|
1256
1257
|
h({ attribute: "ratio-height", reflect: !0, type: Number })
|
|
1257
|
-
],
|
|
1258
|
+
], b.prototype, "ratioHeight", 2);
|
|
1258
1259
|
k([
|
|
1259
1260
|
h({ reflect: !0, type: String })
|
|
1260
|
-
],
|
|
1261
|
+
], b.prototype, "unit", 2);
|
|
1261
1262
|
k([
|
|
1262
1263
|
h({ attribute: "last-applied-setting", reflect: !1, type: Object })
|
|
1263
|
-
],
|
|
1264
|
+
], b.prototype, "lastAppliedSetting", 2);
|
|
1264
1265
|
k([
|
|
1265
1266
|
h({ reflect: !0, type: Boolean })
|
|
1266
|
-
],
|
|
1267
|
+
], b.prototype, "loading", 2);
|
|
1267
1268
|
k([
|
|
1268
1269
|
h({ attribute: "can-apply", reflect: !0, type: Boolean })
|
|
1269
|
-
],
|
|
1270
|
+
], b.prototype, "canApply", 2);
|
|
1270
1271
|
k([
|
|
1271
1272
|
h({ attribute: "keep-aspect-ratio", reflect: !0, type: Boolean })
|
|
1272
|
-
],
|
|
1273
|
+
], b.prototype, "keepAspectRatio", 2);
|
|
1273
1274
|
k([
|
|
1274
1275
|
v()
|
|
1275
|
-
],
|
|
1276
|
+
], b.prototype, "invalidWidth", 2);
|
|
1276
1277
|
k([
|
|
1277
1278
|
v()
|
|
1278
|
-
],
|
|
1279
|
+
], b.prototype, "invalidHeight", 2);
|
|
1279
1280
|
k([
|
|
1280
1281
|
v()
|
|
1281
|
-
],
|
|
1282
|
+
], b.prototype, "aspectRatio", 2);
|
|
1282
1283
|
k([
|
|
1283
1284
|
C("cropMode", { waitUntilFirstUpdate: !0 }),
|
|
1284
1285
|
C("maxWidth", { waitUntilFirstUpdate: !0 }),
|
|
1285
1286
|
C("maxHeight", { waitUntilFirstUpdate: !0 }),
|
|
1286
1287
|
C("keepAspectRatio")
|
|
1287
|
-
],
|
|
1288
|
+
], b.prototype, "handleCropModeChange", 1);
|
|
1288
1289
|
k([
|
|
1289
1290
|
C("open")
|
|
1290
|
-
],
|
|
1291
|
-
|
|
1291
|
+
], b.prototype, "handleOpenChange", 1);
|
|
1292
|
+
b = k([
|
|
1292
1293
|
q("cx-asset-link-format-resize")
|
|
1293
|
-
],
|
|
1294
|
+
], b);
|
|
1294
1295
|
const ke = L`cx-details::part(base){border-bottom-width:0}`;
|
|
1295
1296
|
var Ce = Object.defineProperty, $e = Object.getOwnPropertyDescriptor, j = (t, e, i, s) => {
|
|
1296
|
-
for (var a = s > 1 ? void 0 : s ? $e(e, i) : e,
|
|
1297
|
-
(
|
|
1297
|
+
for (var a = s > 1 ? void 0 : s ? $e(e, i) : e, r = t.length - 1, n; r >= 0; r--)
|
|
1298
|
+
(n = t[r]) && (a = (s ? n(e, i, a) : n(a)) || a);
|
|
1298
1299
|
return s && a && Ce(e, i, a), a;
|
|
1299
1300
|
};
|
|
1300
1301
|
let E = class extends N {
|
|
@@ -1311,14 +1312,14 @@ let E = class extends N {
|
|
|
1311
1312
|
}
|
|
1312
1313
|
}
|
|
1313
1314
|
handleRotationChange(t) {
|
|
1314
|
-
const e = t.target.value, i =
|
|
1315
|
+
const e = t.target.value, i = bt(Number(e));
|
|
1315
1316
|
(Number(e) > 360 || Number(e) < -360) && (t.target.value = i.toString()), this.emit("cx-asset-link-format-rotation-change", {
|
|
1316
1317
|
detail: i
|
|
1317
1318
|
});
|
|
1318
1319
|
}
|
|
1319
1320
|
handleButtonClick(t) {
|
|
1320
1321
|
this.emit("cx-asset-link-format-rotation-change", {
|
|
1321
|
-
detail:
|
|
1322
|
+
detail: bt(t)
|
|
1322
1323
|
});
|
|
1323
1324
|
}
|
|
1324
1325
|
handleClockwiseClick() {
|
|
@@ -1380,8 +1381,8 @@ E = j([
|
|
|
1380
1381
|
], E);
|
|
1381
1382
|
const Re = L`cx-details::part(base){border-bottom-width:0}`;
|
|
1382
1383
|
var _e = Object.defineProperty, Pe = Object.getOwnPropertyDescriptor, ht = (t, e, i, s) => {
|
|
1383
|
-
for (var a = s > 1 ? void 0 : s ? Pe(e, i) : e,
|
|
1384
|
-
(
|
|
1384
|
+
for (var a = s > 1 ? void 0 : s ? Pe(e, i) : e, r = t.length - 1, n; r >= 0; r--)
|
|
1385
|
+
(n = t[r]) && (a = (s ? n(e, i, a) : n(a)) || a);
|
|
1385
1386
|
return s && a && _e(e, i, a), a;
|
|
1386
1387
|
};
|
|
1387
1388
|
let W = class extends N {
|
|
@@ -1420,7 +1421,7 @@ W.dependencies = {
|
|
|
1420
1421
|
"cx-details": Z,
|
|
1421
1422
|
"cx-icon": Y,
|
|
1422
1423
|
"cx-space": D,
|
|
1423
|
-
"cx-tooltip":
|
|
1424
|
+
"cx-tooltip": Ht,
|
|
1424
1425
|
"cx-typography": T
|
|
1425
1426
|
};
|
|
1426
1427
|
ht([
|
|
@@ -1436,8 +1437,8 @@ W = ht([
|
|
|
1436
1437
|
q("cx-asset-link-format-metadata")
|
|
1437
1438
|
], W);
|
|
1438
1439
|
var Me = Object.defineProperty, Fe = Object.getOwnPropertyDescriptor, d = (t, e, i, s) => {
|
|
1439
|
-
for (var a = s > 1 ? void 0 : s ? Fe(e, i) : e,
|
|
1440
|
-
(
|
|
1440
|
+
for (var a = s > 1 ? void 0 : s ? Fe(e, i) : e, r = t.length - 1, n; r >= 0; r--)
|
|
1441
|
+
(n = t[r]) && (a = (s ? n(e, i, a) : n(a)) || a);
|
|
1441
1442
|
return s && a && Me(e, i, a), a;
|
|
1442
1443
|
};
|
|
1443
1444
|
let p = class extends N {
|
|
@@ -1573,7 +1574,7 @@ let p = class extends N {
|
|
|
1573
1574
|
* It returns an object with the last crop size in both pixel and aspect ratio units.
|
|
1574
1575
|
*/
|
|
1575
1576
|
get lastCropSize() {
|
|
1576
|
-
const t =
|
|
1577
|
+
const t = zt(
|
|
1577
1578
|
this.lastImageSize.width,
|
|
1578
1579
|
this.lastImageSize.height
|
|
1579
1580
|
);
|
|
@@ -1604,7 +1605,7 @@ let p = class extends N {
|
|
|
1604
1605
|
* It returns an object with the last resize size in both pixel and aspect ratio units.
|
|
1605
1606
|
*/
|
|
1606
1607
|
get lastResizeSize() {
|
|
1607
|
-
const t =
|
|
1608
|
+
const t = zt(
|
|
1608
1609
|
this.lastImageSize.width,
|
|
1609
1610
|
this.lastImageSize.height
|
|
1610
1611
|
);
|
|
@@ -1724,16 +1725,16 @@ let p = class extends N {
|
|
|
1724
1725
|
useSession: this.useSession
|
|
1725
1726
|
}).replace(/\/t\//g, "")
|
|
1726
1727
|
});
|
|
1727
|
-
const
|
|
1728
|
+
const r = this.transformations.findLast(
|
|
1728
1729
|
(f) => f.key === c.Crop && f.value.width && f.value.height
|
|
1729
1730
|
);
|
|
1730
|
-
if (
|
|
1731
|
-
const { focusMode: f, height:
|
|
1731
|
+
if (r) {
|
|
1732
|
+
const { focusMode: f, height: z, unit: $, width: m, x: R = 0, y: Q = 0 } = r.value;
|
|
1732
1733
|
this.cropSize = {
|
|
1733
1734
|
...this.cropSize,
|
|
1734
1735
|
cropMode: "free",
|
|
1735
1736
|
focusMode: f ?? "manual",
|
|
1736
|
-
height:
|
|
1737
|
+
height: z,
|
|
1737
1738
|
percentageHeight: 100,
|
|
1738
1739
|
percentageWidth: 100,
|
|
1739
1740
|
unit: $ ?? o.Pixel,
|
|
@@ -1754,15 +1755,15 @@ let p = class extends N {
|
|
|
1754
1755
|
x: 0,
|
|
1755
1756
|
y: 0
|
|
1756
1757
|
};
|
|
1757
|
-
const
|
|
1758
|
+
const n = this.transformations.findLast(
|
|
1758
1759
|
(f) => f.key === c.Resize && (f.value.width || f.value.height)
|
|
1759
1760
|
);
|
|
1760
|
-
if (
|
|
1761
|
-
const { height: f = 0, unit:
|
|
1761
|
+
if (n) {
|
|
1762
|
+
const { height: f = 0, unit: z, width: $ = 0 } = n.value;
|
|
1762
1763
|
this.resizeSize = {
|
|
1763
1764
|
...this.resizeSize,
|
|
1764
1765
|
height: f,
|
|
1765
|
-
unit:
|
|
1766
|
+
unit: z ?? o.Pixel,
|
|
1766
1767
|
width: $
|
|
1767
1768
|
};
|
|
1768
1769
|
} else
|
|
@@ -1796,7 +1797,7 @@ let p = class extends N {
|
|
|
1796
1797
|
if (!this.selectedFormat)
|
|
1797
1798
|
return;
|
|
1798
1799
|
const t = this.proxies?.find(
|
|
1799
|
-
(
|
|
1800
|
+
(r) => r.id === this.selectedProxy
|
|
1800
1801
|
);
|
|
1801
1802
|
this.loading = !0;
|
|
1802
1803
|
const e = await this.apiGetTransformAssetLink({
|
|
@@ -1834,9 +1835,9 @@ let p = class extends N {
|
|
|
1834
1835
|
y: 0
|
|
1835
1836
|
}, this.lastAction === c.Rotate && (this.rotation = 0), this.lastAction = void 0;
|
|
1836
1837
|
const i = this.transformations.some(
|
|
1837
|
-
(
|
|
1838
|
+
(r) => r.key === c.Metadata
|
|
1838
1839
|
), s = this.transformations.findLast(
|
|
1839
|
-
(
|
|
1840
|
+
(r) => r.key === c.Quality
|
|
1840
1841
|
);
|
|
1841
1842
|
this.selectedFormat = {
|
|
1842
1843
|
...this.selectedFormat,
|
|
@@ -1929,25 +1930,25 @@ let p = class extends N {
|
|
|
1929
1930
|
const i = this.proxies?.find((s) => s.id === t);
|
|
1930
1931
|
i && (this.asset && i.proxyName === "TRX" && (i.formatHeight = Number(this.asset.height), i.formatWidth = Number(this.asset.width)), this.transformations = this.transformations.map((s) => {
|
|
1931
1932
|
if (s.key === c.Crop) {
|
|
1932
|
-
const a = s.value,
|
|
1933
|
+
const a = s.value, r = a.width / i.formatWidth * e.formatWidth, n = a.height / i.formatHeight * e.formatHeight, l = a.x / i.formatWidth * e.formatWidth, u = a.y / i.formatHeight * e.formatHeight;
|
|
1933
1934
|
return {
|
|
1934
1935
|
...s,
|
|
1935
1936
|
value: {
|
|
1936
1937
|
...s.value,
|
|
1937
|
-
height:
|
|
1938
|
-
width:
|
|
1938
|
+
height: n,
|
|
1939
|
+
width: r,
|
|
1939
1940
|
x: l,
|
|
1940
1941
|
y: u
|
|
1941
1942
|
}
|
|
1942
1943
|
};
|
|
1943
1944
|
}
|
|
1944
1945
|
if (s.key === c.Resize) {
|
|
1945
|
-
const a = s.value,
|
|
1946
|
+
const a = s.value, r = a.width / i.formatWidth * e.formatWidth, n = a.height / i.formatHeight * e.formatHeight;
|
|
1946
1947
|
return {
|
|
1947
1948
|
...s,
|
|
1948
1949
|
value: {
|
|
1949
|
-
height:
|
|
1950
|
-
width:
|
|
1950
|
+
height: n,
|
|
1951
|
+
width: r
|
|
1951
1952
|
}
|
|
1952
1953
|
};
|
|
1953
1954
|
}
|
|
@@ -2012,8 +2013,8 @@ let p = class extends N {
|
|
|
2012
2013
|
height: i,
|
|
2013
2014
|
keepAspectRatio: s,
|
|
2014
2015
|
percentageHeight: a,
|
|
2015
|
-
percentageWidth:
|
|
2016
|
-
ratioHeight:
|
|
2016
|
+
percentageWidth: r,
|
|
2017
|
+
ratioHeight: n,
|
|
2017
2018
|
ratioWidth: l,
|
|
2018
2019
|
unit: u,
|
|
2019
2020
|
useCropMode: S,
|
|
@@ -2022,22 +2023,22 @@ let p = class extends N {
|
|
|
2022
2023
|
if (!this.selectedFormat?.url || e === "manual")
|
|
2023
2024
|
return;
|
|
2024
2025
|
this.loading = !0, this.lastAction = c.Crop;
|
|
2025
|
-
const
|
|
2026
|
+
const z = await this.apiGetCropFocusMode({
|
|
2026
2027
|
autoCropMode: e,
|
|
2027
2028
|
cropHeight: i,
|
|
2028
2029
|
cropWidth: f,
|
|
2029
2030
|
imageUrl: this.selectedFormat.url
|
|
2030
2031
|
});
|
|
2031
|
-
if (
|
|
2032
|
-
let $ = a, m =
|
|
2033
|
-
i || ($ =
|
|
2032
|
+
if (z) {
|
|
2033
|
+
let $ = a, m = r;
|
|
2034
|
+
i || ($ = z.height * 100 / this.selectedFormat.height), f || (m = z.width * 100 / this.selectedFormat.width), this.cropSize = {
|
|
2034
2035
|
...this.cropSize,
|
|
2035
|
-
height:
|
|
2036
|
+
height: z.height,
|
|
2036
2037
|
percentageHeight: $ ?? this.cropSize.percentageHeight,
|
|
2037
2038
|
percentageWidth: m ?? this.cropSize.percentageWidth,
|
|
2038
|
-
width:
|
|
2039
|
-
x:
|
|
2040
|
-
y:
|
|
2039
|
+
width: z.width,
|
|
2040
|
+
x: z.x * 100 / this.selectedFormat.width,
|
|
2041
|
+
y: z.y * 100 / this.selectedFormat.height,
|
|
2041
2042
|
...S ? {
|
|
2042
2043
|
cropMode: e,
|
|
2043
2044
|
focusMode: "manual",
|
|
@@ -2047,7 +2048,7 @@ let p = class extends N {
|
|
|
2047
2048
|
focusMode: e
|
|
2048
2049
|
},
|
|
2049
2050
|
keepAspectRatio: s ?? this.cropSize.keepAspectRatio,
|
|
2050
|
-
ratioHeight:
|
|
2051
|
+
ratioHeight: n ?? this.cropSize.ratioHeight,
|
|
2051
2052
|
ratioWidth: l ?? this.cropSize.ratioWidth,
|
|
2052
2053
|
unit: u ?? this.cropSize.unit
|
|
2053
2054
|
};
|
|
@@ -2059,13 +2060,13 @@ let p = class extends N {
|
|
|
2059
2060
|
height: i,
|
|
2060
2061
|
width: s,
|
|
2061
2062
|
x: a,
|
|
2062
|
-
y:
|
|
2063
|
+
y: r
|
|
2063
2064
|
} = e;
|
|
2064
2065
|
if (s === 0 || i === 0)
|
|
2065
2066
|
return;
|
|
2066
|
-
const
|
|
2067
|
+
const n = this.cropSize.percentageWidth !== s, l = this.cropSize.percentageHeight !== i;
|
|
2067
2068
|
let u = this.cropSize.height, S = this.cropSize.width;
|
|
2068
|
-
|
|
2069
|
+
n && (S = Math.round(s * this.selectedFormat.width / 100)), l && (u = Math.round(
|
|
2069
2070
|
i * this.selectedFormat.height / 100
|
|
2070
2071
|
));
|
|
2071
2072
|
const f = this.cropSize.focusMode;
|
|
@@ -2084,7 +2085,7 @@ let p = class extends N {
|
|
|
2084
2085
|
percentageWidth: s,
|
|
2085
2086
|
width: S,
|
|
2086
2087
|
x: a,
|
|
2087
|
-
y:
|
|
2088
|
+
y: r
|
|
2088
2089
|
};
|
|
2089
2090
|
}
|
|
2090
2091
|
onCropDragStart() {
|
|
@@ -2120,19 +2121,19 @@ let p = class extends N {
|
|
|
2120
2121
|
const s = this.focusModes.find(
|
|
2121
2122
|
(u) => u.value === this.cropSize.focusMode
|
|
2122
2123
|
)?.auto;
|
|
2123
|
-
let a = this.cropSize.keepAspectRatio,
|
|
2124
|
-
e === "free" ? (a = !1,
|
|
2124
|
+
let a = this.cropSize.keepAspectRatio, r = this.cropSize.focusMode, n = this.cropSize.x, l = this.cropSize.y;
|
|
2125
|
+
e === "free" ? (a = !1, r = "manual") : this.cropSize.unit === o.Pixel && !s && (n = 0, l = 0), s ? await this.handleRequestAutoCropSuggestion({
|
|
2125
2126
|
cropMode: e,
|
|
2126
|
-
focusMode:
|
|
2127
|
+
focusMode: r,
|
|
2127
2128
|
height: this.cropSize.height,
|
|
2128
2129
|
keepAspectRatio: a,
|
|
2129
2130
|
width: this.cropSize.width
|
|
2130
2131
|
}) : this.cropSize = {
|
|
2131
2132
|
...this.cropSize,
|
|
2132
2133
|
cropMode: e,
|
|
2133
|
-
focusMode:
|
|
2134
|
+
focusMode: r,
|
|
2134
2135
|
keepAspectRatio: a,
|
|
2135
|
-
x:
|
|
2136
|
+
x: n,
|
|
2136
2137
|
y: l
|
|
2137
2138
|
}, this.asset || (e && e !== "free" ? this.upsertTransformation({
|
|
2138
2139
|
key: c.Crop,
|
|
@@ -2154,16 +2155,16 @@ let p = class extends N {
|
|
|
2154
2155
|
...this.cropSize,
|
|
2155
2156
|
focusMode: e
|
|
2156
2157
|
}, !this.asset) {
|
|
2157
|
-
const { height: s, unit: a, width:
|
|
2158
|
-
(s ||
|
|
2158
|
+
const { height: s, unit: a, width: r, x: n, y: l } = this.cropSize;
|
|
2159
|
+
(s || r) && this.upsertTransformation({
|
|
2159
2160
|
key: c.Crop,
|
|
2160
2161
|
value: {
|
|
2161
2162
|
focusMode: e,
|
|
2162
2163
|
height: s,
|
|
2163
2164
|
isFocusModeAuto: i ?? !1,
|
|
2164
2165
|
unit: a,
|
|
2165
|
-
width:
|
|
2166
|
-
x:
|
|
2166
|
+
width: r,
|
|
2167
|
+
x: n,
|
|
2167
2168
|
y: l
|
|
2168
2169
|
}
|
|
2169
2170
|
});
|
|
@@ -2178,19 +2179,19 @@ let p = class extends N {
|
|
|
2178
2179
|
), a = Math.min(
|
|
2179
2180
|
Math.max(Math.round(s / i), 0),
|
|
2180
2181
|
this.resizeSize.height
|
|
2181
|
-
),
|
|
2182
|
+
), r = a * 100 / this.selectedFormat.height, n = s * 100 / this.selectedFormat.width;
|
|
2182
2183
|
let l = this.cropSize.x, u = this.cropSize.y;
|
|
2183
|
-
l +
|
|
2184
|
+
l + n > 100 && (l = 100 - n), u + r > 100 && (u = 100 - r);
|
|
2184
2185
|
let S = this.cropSize.cropMode;
|
|
2185
2186
|
this.cropModes.find(
|
|
2186
|
-
(
|
|
2187
|
-
)?.auto && (S = "free"), t.detail.silent ? (this.cropSize.height = a, this.cropSize.keepAspectRatio = t.detail.keepAspectRatio, this.cropSize.percentageHeight =
|
|
2187
|
+
(z) => z.value === S
|
|
2188
|
+
)?.auto && (S = "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 = {
|
|
2188
2189
|
...this.cropSize,
|
|
2189
2190
|
cropMode: S,
|
|
2190
2191
|
height: a,
|
|
2191
2192
|
keepAspectRatio: t.detail.keepAspectRatio,
|
|
2192
|
-
percentageHeight:
|
|
2193
|
-
percentageWidth:
|
|
2193
|
+
percentageHeight: r,
|
|
2194
|
+
percentageWidth: n,
|
|
2194
2195
|
ratioHeight: t.detail.height,
|
|
2195
2196
|
ratioWidth: t.detail.width,
|
|
2196
2197
|
unit: o.AspectRatio,
|
|
@@ -2200,15 +2201,15 @@ let p = class extends N {
|
|
|
2200
2201
|
};
|
|
2201
2202
|
} else {
|
|
2202
2203
|
const i = this.selectedFormat ? t.detail.height * 100 / this.selectedFormat.height : 100, s = this.selectedFormat ? t.detail.width * 100 / this.selectedFormat.width : 100;
|
|
2203
|
-
let a = this.cropSize.x,
|
|
2204
|
-
a + s > 100 && (a = 100 - s),
|
|
2205
|
-
let
|
|
2204
|
+
let a = this.cropSize.x, r = this.cropSize.y;
|
|
2205
|
+
a + s > 100 && (a = 100 - s), r + i > 100 && (r = 100 - i);
|
|
2206
|
+
let n = this.cropSize.cropMode;
|
|
2206
2207
|
const l = this.cropModes.find(
|
|
2207
|
-
(u) => u.value ===
|
|
2208
|
+
(u) => u.value === n
|
|
2208
2209
|
)?.auto;
|
|
2209
|
-
(t.detail.breakAspectRatio || l) && (
|
|
2210
|
+
(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 = {
|
|
2210
2211
|
...this.cropSize,
|
|
2211
|
-
cropMode:
|
|
2212
|
+
cropMode: n,
|
|
2212
2213
|
height: t.detail.height,
|
|
2213
2214
|
keepAspectRatio: t.detail.keepAspectRatio,
|
|
2214
2215
|
percentageHeight: i,
|
|
@@ -2216,25 +2217,25 @@ let p = class extends N {
|
|
|
2216
2217
|
unit: o.Pixel,
|
|
2217
2218
|
width: t.detail.width,
|
|
2218
2219
|
x: a,
|
|
2219
|
-
y:
|
|
2220
|
+
y: r
|
|
2220
2221
|
};
|
|
2221
2222
|
}
|
|
2222
2223
|
if (e !== this.cropSize.unit && (this.cropSize = {
|
|
2223
2224
|
...this.cropSize,
|
|
2224
2225
|
cropMode: "free"
|
|
2225
2226
|
}, this.onCropChanged()), !this.asset && !t.detail.silent) {
|
|
2226
|
-
const { focusMode: i, height: s, unit: a, width:
|
|
2227
|
+
const { focusMode: i, height: s, unit: a, width: r, x: n, y: l } = this.cropSize, u = this.focusModes.find(
|
|
2227
2228
|
(S) => S.value === i
|
|
2228
2229
|
)?.auto ?? !1;
|
|
2229
|
-
(s ||
|
|
2230
|
+
(s || r) && this.upsertTransformation({
|
|
2230
2231
|
key: c.Crop,
|
|
2231
2232
|
value: {
|
|
2232
2233
|
focusMode: i,
|
|
2233
2234
|
height: s,
|
|
2234
2235
|
isFocusModeAuto: u,
|
|
2235
2236
|
unit: a,
|
|
2236
|
-
width:
|
|
2237
|
-
x:
|
|
2237
|
+
width: r,
|
|
2238
|
+
x: n,
|
|
2238
2239
|
y: l
|
|
2239
2240
|
}
|
|
2240
2241
|
});
|
|
@@ -2253,8 +2254,8 @@ let p = class extends N {
|
|
|
2253
2254
|
const { height: e, mode: i, unit: s, width: a } = t.detail;
|
|
2254
2255
|
if (this.preResetTransformations = void 0, this.lastAction = c.Crop, !this.cropperElement || !this.selectedFormat)
|
|
2255
2256
|
return;
|
|
2256
|
-
const
|
|
2257
|
-
(l) => l.value ===
|
|
2257
|
+
const r = this.cropSize.focusMode, n = this.focusModes.find(
|
|
2258
|
+
(l) => l.value === r
|
|
2258
2259
|
)?.auto ?? !1;
|
|
2259
2260
|
if (e && a && s) {
|
|
2260
2261
|
let l = a, u = e;
|
|
@@ -2264,9 +2265,9 @@ let p = class extends N {
|
|
|
2264
2265
|
{
|
|
2265
2266
|
key: c.Crop,
|
|
2266
2267
|
value: {
|
|
2267
|
-
focusMode:
|
|
2268
|
+
focusMode: r,
|
|
2268
2269
|
height: u,
|
|
2269
|
-
isFocusModeAuto:
|
|
2270
|
+
isFocusModeAuto: n,
|
|
2270
2271
|
mode: i,
|
|
2271
2272
|
width: l
|
|
2272
2273
|
}
|
|
@@ -2279,9 +2280,9 @@ let p = class extends N {
|
|
|
2279
2280
|
{
|
|
2280
2281
|
key: c.Crop,
|
|
2281
2282
|
value: {
|
|
2282
|
-
focusMode:
|
|
2283
|
+
focusMode: r,
|
|
2283
2284
|
height: u,
|
|
2284
|
-
isFocusModeAuto:
|
|
2285
|
+
isFocusModeAuto: n,
|
|
2285
2286
|
unit: s,
|
|
2286
2287
|
width: l,
|
|
2287
2288
|
x: S,
|
|
@@ -2295,8 +2296,8 @@ let p = class extends N {
|
|
|
2295
2296
|
{
|
|
2296
2297
|
key: c.Crop,
|
|
2297
2298
|
value: {
|
|
2298
|
-
focusMode:
|
|
2299
|
-
isFocusModeAuto:
|
|
2299
|
+
focusMode: r,
|
|
2300
|
+
isFocusModeAuto: n,
|
|
2300
2301
|
mode: i
|
|
2301
2302
|
}
|
|
2302
2303
|
}
|
|
@@ -2342,16 +2343,16 @@ let p = class extends N {
|
|
|
2342
2343
|
return;
|
|
2343
2344
|
const { height: e, unit: i, width: s } = t.detail;
|
|
2344
2345
|
this.preResetTransformations = void 0, this.lastAction = c.Resize;
|
|
2345
|
-
const a = this.selectedFormat.width || this.defaultSize.width,
|
|
2346
|
-
let
|
|
2347
|
-
this.resizeSize.unit !== i ? (
|
|
2346
|
+
const a = this.selectedFormat.width || this.defaultSize.width, r = this.selectedFormat.height || this.defaultSize.height;
|
|
2347
|
+
let n = s, l = e;
|
|
2348
|
+
this.resizeSize.unit !== i ? (n = a, l = r) : i === o.AspectRatio && (n = Math.round(s / e * r), l = r), this.transformations = [
|
|
2348
2349
|
...this.transformations,
|
|
2349
2350
|
{
|
|
2350
2351
|
key: c.Resize,
|
|
2351
2352
|
value: {
|
|
2352
2353
|
height: l,
|
|
2353
2354
|
unit: i,
|
|
2354
|
-
width:
|
|
2355
|
+
width: n
|
|
2355
2356
|
}
|
|
2356
2357
|
}
|
|
2357
2358
|
];
|
|
@@ -2483,7 +2484,7 @@ p.dependencies = {
|
|
|
2483
2484
|
"cx-asset-link-format-metadata": W,
|
|
2484
2485
|
"cx-asset-link-format-proxy": M,
|
|
2485
2486
|
"cx-asset-link-format-quality": F,
|
|
2486
|
-
"cx-asset-link-format-resize":
|
|
2487
|
+
"cx-asset-link-format-resize": b,
|
|
2487
2488
|
"cx-asset-link-format-rotation": E,
|
|
2488
2489
|
"cx-button": G,
|
|
2489
2490
|
"cx-space": D,
|
|
@@ -2614,14 +2615,14 @@ export {
|
|
|
2614
2615
|
gi as d,
|
|
2615
2616
|
kt as e,
|
|
2616
2617
|
ee as f,
|
|
2617
|
-
|
|
2618
|
+
Wt as g,
|
|
2618
2619
|
Si as h,
|
|
2619
2620
|
yi as i,
|
|
2620
|
-
|
|
2621
|
-
|
|
2622
|
-
|
|
2623
|
-
|
|
2624
|
-
|
|
2621
|
+
Tt as j,
|
|
2622
|
+
st as k,
|
|
2623
|
+
Ct as l,
|
|
2624
|
+
$t as m,
|
|
2625
|
+
Mt as n,
|
|
2625
2626
|
Xt as o,
|
|
2626
2627
|
Kt as u
|
|
2627
2628
|
};
|