@orangelogic/design-system 3.4.0 → 3.5.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.O2It93rl.js → asset-link-format.SaFYESLe.js} +1140 -992
- package/library/chunks/{color-swatch-group.CTcv62MK.js → color-swatch-group.Bu1ev_Af.js} +2 -2
- package/library/chunks/{document-viewer.D6PxGcEL.js → document-viewer.hfxnrrUV.js} +3 -3
- package/library/chunks/{image.B-4cVbol.js → image.ysU1iW6e.js} +1 -1
- package/library/chunks/{menu-item.DgUMVYe5.js → menu-item.uFqeX_J6.js} +12 -12
- package/library/chunks/{tab-group.BSl6GdIO.js → tab-group.CdTSrsM1.js} +1 -1
- package/library/chunks/transformation.BfIEi4p4.js +300 -0
- package/library/components/asset-link-format.js +2 -2
- package/library/components/atoms.js +4 -4
- package/library/components/color-swatch-group.js +1 -1
- package/library/components/cropper.js +1 -1
- package/library/components/document-viewer.js +2 -2
- package/library/components/file-on-demand.js +1 -1
- package/library/components/image.js +1 -1
- package/library/components/masonry.js +65 -49
- package/library/components/menu-item.js +1 -1
- package/library/components/menu-section.js +16 -13
- package/library/components/menu.js +1 -1
- package/library/components/organisms.js +2 -2
- package/library/components/tab-group.js +2 -2
- package/library/components/types.js +12386 -12220
- package/library/components/video.js +1 -1
- package/library/package.json +1 -1
- package/library/packages/atoms/src/components/image/image.d.ts +6 -0
- package/library/packages/atoms/src/components/menu-section/menu-section.d.ts +1 -0
- package/library/packages/events/src/cx-asset-transformation-dialog-confirm.d.ts +2 -0
- package/library/packages/molecules/src/cropper/cropper.d.ts +0 -1
- package/library/packages/molecules/src/cropper/react/Cropper.d.ts +0 -1
- package/library/packages/molecules/src/masonry/masonry.d.ts +15 -0
- package/library/packages/molecules/src/view-and-sort/view-and-sort.d.ts +2 -0
- package/library/packages/organisms/src/asset-link-format/asset-link-format.d.ts +46 -2
- package/library/packages/organisms/src/asset-link-format/components/asset-link-format-proxy/asset-link-format-proxy.d.ts +36 -1
- package/library/packages/organisms/src/asset-transformation-dialog/asset-transformation-dialog.d.ts +20 -2
- package/library/packages/organisms/src/bento-grid/bento-grid.d.ts +13 -0
- package/library/packages/organisms/src/carousel/carousel.d.ts +13 -0
- package/library/packages/organisms/src/content-builder/blocks/image/image.d.ts +54 -0
- package/library/packages/organisms/src/content-builder/blocks/video/video.d.ts +5 -0
- package/library/packages/organisms/src/content-builder/components/config-form/config-form.d.ts +2 -1
- package/library/packages/organisms/src/content-builder/components/gallery-picker/gallery-picker.d.ts +6 -0
- package/library/packages/organisms/src/content-builder/configs/carousel.d.ts +1 -0
- package/library/packages/organisms/src/content-builder/configs/gallery.d.ts +1 -0
- package/library/packages/organisms/src/content-builder/configs/image.d.ts +2 -0
- package/library/packages/organisms/src/content-builder/configs/timeline.d.ts +1 -0
- package/library/packages/organisms/src/content-builder/configs/video.d.ts +1 -0
- package/library/packages/organisms/src/content-builder/configs-controller.d.ts +10 -0
- package/library/packages/organisms/src/content-builder/styleController.d.ts +2 -0
- package/library/packages/tools/src/fetch-image/fetch-image.d.ts +28 -5
- package/library/packages/types/src/asset-link-format.d.ts +0 -1
- package/library/packages/types/src/content-builder.d.ts +7 -0
- package/library/packages/types/src/gallery-item.d.ts +1 -0
- package/library/packages/types/src/masonry.d.ts +1 -0
- package/library/packages/utils/src/transformation/transformation.d.ts +42 -3
- package/library/react-web-component.d.ts +51 -7
- package/library/utils.js +113 -109
- package/package.json +1 -1
- package/library/chunks/transformation.CWKaoGaY.js +0 -254
|
@@ -1,254 +0,0 @@
|
|
|
1
|
-
import { C as y, T as _, U as T } from "./asset-link-format.ClaYu_v8.js";
|
|
2
|
-
import { P as m } from "./position-picker.DjnhxIKF.js";
|
|
3
|
-
const g = "/AssetLink/", S = {
|
|
4
|
-
[m.BottomCenter]: y.South,
|
|
5
|
-
[m.BottomLeft]: y.Southwest,
|
|
6
|
-
[m.BottomRight]: y.Southeast,
|
|
7
|
-
[m.CenterCenter]: y.Center,
|
|
8
|
-
[m.CenterLeft]: y.West,
|
|
9
|
-
[m.CenterRight]: y.East,
|
|
10
|
-
[m.TopCenter]: y.North,
|
|
11
|
-
[m.TopLeft]: y.Northwest,
|
|
12
|
-
[m.TopRight]: y.Northeast
|
|
13
|
-
}, x = "/t/", b = [400, 800, 1200, 1600, 2400];
|
|
14
|
-
function I({
|
|
15
|
-
asset: i,
|
|
16
|
-
baseUrl: s,
|
|
17
|
-
extension: a,
|
|
18
|
-
options: u,
|
|
19
|
-
parameters: d,
|
|
20
|
-
transformations: o,
|
|
21
|
-
useSession: r = ""
|
|
22
|
-
}) {
|
|
23
|
-
if (s == null)
|
|
24
|
-
return "";
|
|
25
|
-
let n = s;
|
|
26
|
-
const f = o?.findLast(
|
|
27
|
-
(h) => h.key === _.Quality
|
|
28
|
-
);
|
|
29
|
-
if (f && (o = [
|
|
30
|
-
...o?.filter(
|
|
31
|
-
(h) => h.key !== _.Quality
|
|
32
|
-
) || [],
|
|
33
|
-
f
|
|
34
|
-
]), o) {
|
|
35
|
-
const h = [];
|
|
36
|
-
for (let e = 0; e < o.length; e++) {
|
|
37
|
-
const c = o[e];
|
|
38
|
-
if (c.key === _.Rotate) {
|
|
39
|
-
let t = c.value.rotation ?? 0;
|
|
40
|
-
for (; o[e + 1]?.key === _.Rotate; )
|
|
41
|
-
e++, t += o[e].value.rotation ?? 0;
|
|
42
|
-
t !== 0 && h.push({ key: _.Rotate, value: { rotation: t } });
|
|
43
|
-
} else
|
|
44
|
-
h.push(c);
|
|
45
|
-
}
|
|
46
|
-
o = h;
|
|
47
|
-
}
|
|
48
|
-
o && o.length > 0 && (n += "/t/"), o?.forEach(({ key: h, value: e }) => {
|
|
49
|
-
if (h === _.Resize) {
|
|
50
|
-
if (e.unit === T.AspectRatio && e.ratioWidth && e.ratioHeight) {
|
|
51
|
-
n += `re_ar_${e.ratioWidth}:${e.ratioHeight}/`;
|
|
52
|
-
return;
|
|
53
|
-
}
|
|
54
|
-
const c = [
|
|
55
|
-
...[
|
|
56
|
-
{
|
|
57
|
-
key: "re_w_",
|
|
58
|
-
value: Math.round(e.width ?? 0)
|
|
59
|
-
},
|
|
60
|
-
{
|
|
61
|
-
key: "re_h_",
|
|
62
|
-
value: Math.round(e.height ?? 0)
|
|
63
|
-
}
|
|
64
|
-
].filter((t) => t.value !== void 0).map((t) => ({
|
|
65
|
-
key: t.key,
|
|
66
|
-
value: Math.round(Number(t.value))
|
|
67
|
-
})),
|
|
68
|
-
{
|
|
69
|
-
key: "re_rm_",
|
|
70
|
-
value: "stretch"
|
|
71
|
-
}
|
|
72
|
-
];
|
|
73
|
-
c.forEach(({ key: t, value: $ }, p) => {
|
|
74
|
-
n += `${t}${$}${p < c.length - 1 ? "," : ""}`;
|
|
75
|
-
}), n += "/";
|
|
76
|
-
}
|
|
77
|
-
if (h === _.Crop) {
|
|
78
|
-
const c = e.unit === T.AspectRatio && !!e.ratioWidth && !!e.ratioHeight, t = !e.disabledSize && !c, $ = t && (e.x !== void 0 || e.y !== void 0), p = [
|
|
79
|
-
...[
|
|
80
|
-
{
|
|
81
|
-
key: "c_",
|
|
82
|
-
value: e.mode
|
|
83
|
-
},
|
|
84
|
-
...c ? [
|
|
85
|
-
{
|
|
86
|
-
key: "ar_",
|
|
87
|
-
value: `${e.ratioWidth}:${e.ratioHeight}`
|
|
88
|
-
}
|
|
89
|
-
] : [],
|
|
90
|
-
...t ? [
|
|
91
|
-
{
|
|
92
|
-
key: "c_w_",
|
|
93
|
-
value: Math.round(e.width ?? 0)
|
|
94
|
-
},
|
|
95
|
-
{
|
|
96
|
-
key: "c_h_",
|
|
97
|
-
value: Math.round(e.height ?? 0)
|
|
98
|
-
},
|
|
99
|
-
{
|
|
100
|
-
key: "c_x_",
|
|
101
|
-
value: Math.round(e.x ?? 0) === 0 && u?.omitZeroXY ? void 0 : Math.round(e.x ?? 0)
|
|
102
|
-
},
|
|
103
|
-
{
|
|
104
|
-
key: "c_y_",
|
|
105
|
-
value: Math.round(e.y ?? 0) === 0 && u?.omitZeroXY ? void 0 : Math.round(e.y ?? 0)
|
|
106
|
-
}
|
|
107
|
-
] : [],
|
|
108
|
-
...!$ && e.focusMode && e.focusMode !== "manual" ? [
|
|
109
|
-
{
|
|
110
|
-
key: e.isFocusModeAuto ? "acm_" : "c_g_",
|
|
111
|
-
value: e.focusMode
|
|
112
|
-
}
|
|
113
|
-
] : [],
|
|
114
|
-
...!$ && e.focusMode === "manual" && e.position ? [
|
|
115
|
-
{
|
|
116
|
-
key: "c_g_",
|
|
117
|
-
value: S[e.position]
|
|
118
|
-
}
|
|
119
|
-
] : []
|
|
120
|
-
].filter((k) => k.value !== void 0 && k.value !== null).map((k) => ({
|
|
121
|
-
key: k.key,
|
|
122
|
-
value: k.value
|
|
123
|
-
})),
|
|
124
|
-
...c ? [] : [
|
|
125
|
-
{
|
|
126
|
-
key: "c_whu_",
|
|
127
|
-
value: "pixel"
|
|
128
|
-
}
|
|
129
|
-
]
|
|
130
|
-
];
|
|
131
|
-
p.forEach(({ key: k, value: M }, R) => {
|
|
132
|
-
const v = ["c_w_", "c_h_", "c_x_", "c_y_"].includes(k);
|
|
133
|
-
n += `${k}${v ? Math.round(Number(M)) : M}${R < p.length - 1 ? "," : ""}`;
|
|
134
|
-
}), n += "/";
|
|
135
|
-
}
|
|
136
|
-
if (h === _.Rotate && ([
|
|
137
|
-
{
|
|
138
|
-
key: "r_a_",
|
|
139
|
-
value: e.rotation
|
|
140
|
-
}
|
|
141
|
-
].filter((t) => t.value !== void 0).map((t) => ({
|
|
142
|
-
key: t.key,
|
|
143
|
-
value: Math.round(Number(t.value))
|
|
144
|
-
})).forEach(({ key: t, value: $ }) => {
|
|
145
|
-
n += `${t}${$}`;
|
|
146
|
-
}), n += "/"), h === _.Quality) {
|
|
147
|
-
const c = [
|
|
148
|
-
{
|
|
149
|
-
key: "q_level_",
|
|
150
|
-
value: e.quality
|
|
151
|
-
}
|
|
152
|
-
].filter((t) => t.value !== void 0).map((t) => ({
|
|
153
|
-
key: t.key,
|
|
154
|
-
value: Math.round(Number(t.value))
|
|
155
|
-
}));
|
|
156
|
-
c.forEach(({ key: t, value: $ }, p) => {
|
|
157
|
-
n += `${t}${$}${p < c.length - 1 ? "," : ""}`;
|
|
158
|
-
}), n += "/";
|
|
159
|
-
}
|
|
160
|
-
if (h === _.Metadata) {
|
|
161
|
-
const c = [
|
|
162
|
-
{
|
|
163
|
-
key: "fl_keep_metadata",
|
|
164
|
-
value: e.keepMetadata
|
|
165
|
-
}
|
|
166
|
-
].filter((t) => t.value !== void 0).map((t) => ({ key: t.key, value: t.value }));
|
|
167
|
-
c.forEach(({ key: t }, $) => {
|
|
168
|
-
n += `${t}${$ < c.length - 1 ? "," : ""}`;
|
|
169
|
-
}), n += "/";
|
|
170
|
-
}
|
|
171
|
-
}), a && (n += `${i?.identifier ?? crypto.randomUUID()}${a}`);
|
|
172
|
-
const l = [];
|
|
173
|
-
return d && d.length > 0 && d.forEach(({ key: h, value: e }) => {
|
|
174
|
-
l.push(
|
|
175
|
-
`${encodeURIComponent(h.trim())}=${encodeURIComponent(e.trim())}`
|
|
176
|
-
);
|
|
177
|
-
}), s && r && l.push(`UseSession=${encodeURIComponent(r)}`), l.length > 0 && (n += `?${l.join("&")}`), n.endsWith("/") && (n = n.slice(0, -1)), n;
|
|
178
|
-
}
|
|
179
|
-
function O(i, s) {
|
|
180
|
-
if (!i || !s?.length)
|
|
181
|
-
return i;
|
|
182
|
-
const a = I({ baseUrl: "", transformations: s }).replace(
|
|
183
|
-
/\/t\//g,
|
|
184
|
-
""
|
|
185
|
-
);
|
|
186
|
-
if (!a)
|
|
187
|
-
return i;
|
|
188
|
-
const u = i.indexOf(g);
|
|
189
|
-
if (u < 0)
|
|
190
|
-
return `${i}/t/${a}`;
|
|
191
|
-
const d = i.slice(0, u + g.length), o = i.slice(u + g.length), r = o.indexOf("/t/");
|
|
192
|
-
if (r >= 0) {
|
|
193
|
-
const f = o.slice(0, r);
|
|
194
|
-
return `${d}${f}/t/${a}`;
|
|
195
|
-
}
|
|
196
|
-
const n = o.indexOf("/");
|
|
197
|
-
if (n >= 0) {
|
|
198
|
-
const f = o.slice(0, n), l = o.slice(n);
|
|
199
|
-
return `${d}${f}/t/${a}${l}`;
|
|
200
|
-
}
|
|
201
|
-
return `${i}/t/${a}`;
|
|
202
|
-
}
|
|
203
|
-
function C(i) {
|
|
204
|
-
return `re_w_${Math.round(i)}`;
|
|
205
|
-
}
|
|
206
|
-
function N(i, s) {
|
|
207
|
-
if (!i || !Number.isFinite(s) || s <= 0)
|
|
208
|
-
return i;
|
|
209
|
-
const a = i.indexOf(g);
|
|
210
|
-
if (a < 0)
|
|
211
|
-
return i;
|
|
212
|
-
const u = C(s), d = i.slice(0, a + g.length), o = i.slice(a + g.length), r = o.indexOf(x);
|
|
213
|
-
if (r >= 0) {
|
|
214
|
-
const f = o.slice(0, r), l = o.slice(
|
|
215
|
-
r + x.length
|
|
216
|
-
);
|
|
217
|
-
return `${d}${f}${x}${u}/${l}`;
|
|
218
|
-
}
|
|
219
|
-
const n = o.indexOf("/");
|
|
220
|
-
if (n >= 0) {
|
|
221
|
-
const f = o.slice(0, n), l = o.slice(n);
|
|
222
|
-
return `${d}${f}${x}${u}${l}`;
|
|
223
|
-
}
|
|
224
|
-
return `${d}${o}${x}${u}`;
|
|
225
|
-
}
|
|
226
|
-
function A(i) {
|
|
227
|
-
const s = i.indexOf(g);
|
|
228
|
-
return s < 0 ? !1 : i.slice(s + g.length).includes(x);
|
|
229
|
-
}
|
|
230
|
-
function U(i, s = {}) {
|
|
231
|
-
if (!i.includes(g) || A(i))
|
|
232
|
-
return "";
|
|
233
|
-
const { maxWidth: a, widths: u = b } = s, d = [...u].filter((r) => Number.isFinite(r) && r > 0).sort((r, n) => r - n);
|
|
234
|
-
if (d.length === 0)
|
|
235
|
-
return "";
|
|
236
|
-
let o = d;
|
|
237
|
-
if (a !== void 0 && Number.isFinite(a) && a > 0) {
|
|
238
|
-
const r = d.filter((n) => n <= a);
|
|
239
|
-
o = r.length > 0 ? r : [d[0]];
|
|
240
|
-
}
|
|
241
|
-
return o.map((r) => `${N(i, r)} ${r}w`).join(", ");
|
|
242
|
-
}
|
|
243
|
-
function w(i, s = 100) {
|
|
244
|
-
return !Number.isFinite(i) || i <= 0 ? "" : `${Math.ceil(i / s) * s}px`;
|
|
245
|
-
}
|
|
246
|
-
export {
|
|
247
|
-
b as S,
|
|
248
|
-
O as a,
|
|
249
|
-
U as b,
|
|
250
|
-
I as c,
|
|
251
|
-
w as d,
|
|
252
|
-
N as e,
|
|
253
|
-
A as h
|
|
254
|
-
};
|