@orangelogic/design-system 3.6.0 → 3.7.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.
Files changed (24) hide show
  1. package/library/chunks/{asset-link-format.Bj6HJXSZ.js → asset-link-format.a59f8lRl.js} +854 -850
  2. package/library/chunks/{color-swatch-group.Bz2acokX.js → color-swatch-group.DJqdDogB.js} +1 -1
  3. package/library/chunks/{document-viewer.BZw451dy.js → document-viewer.CXynVA4R.js} +1 -1
  4. package/library/chunks/{index.Bf5ia_yC.js → index.Cszcira8.js} +3 -3
  5. package/library/chunks/{transformation.CkwgrwKQ.js → transformation.JkkMVin_.js} +130 -108
  6. package/library/chunks/{types.BjHMUzQj.js → types.D9i8EgKJ.js} +11250 -11232
  7. package/library/components/asset-link-format.js +2 -2
  8. package/library/components/atoms.js +1 -1
  9. package/library/components/color-swatch-group.js +1 -1
  10. package/library/components/document-viewer.js +1 -1
  11. package/library/components/masonry.js +97 -91
  12. package/library/components/organisms.js +2 -2
  13. package/library/components/types.js +95 -93
  14. package/library/package.json +1 -1
  15. package/library/packages/molecules/src/icon-picker/icon-picker.d.ts +2 -0
  16. package/library/packages/molecules/src/masonry/masonry.d.ts +1 -1
  17. package/library/packages/organisms/src/content-builder/blocks/image/image.d.ts +6 -0
  18. package/library/packages/organisms/src/content-builder-viewer/content-builder-viewer.d.ts +5 -5
  19. package/library/packages/services/src/api/asset/asset.d.ts +1 -2
  20. package/library/packages/types/src/masonry.d.ts +1 -0
  21. package/library/packages/utils/src/transformation/transformation.d.ts +42 -7
  22. package/library/react-web-component.d.ts +2 -2
  23. package/library/utils.js +83 -81
  24. package/package.json +1 -1
@@ -48,7 +48,7 @@ import "./form.C8LMdQB4.js";
48
48
  import "./purify.es.BIuh5IAZ.js";
49
49
  import { D as Yr, a as la, t as ha, b as Zr } from "./date-picker.BGHn6qg8.js";
50
50
  import { D as Ti } from "./content-builder.BX4pHujE.js";
51
- import "./transformation.CkwgrwKQ.js";
51
+ import "./transformation.JkkMVin_.js";
52
52
  import { s as P, h as $o, b as Ui, c as lo } from "./string.Demn8Xmk.js";
53
53
  import { a as ca } from "./_commonjsHelpers.DQNKXVTB.js";
54
54
  import { d as da } from "./debounce.Bv1rtE8D.js";
@@ -25,7 +25,7 @@ import { w as watch } from "./watch.DJF5K-8U.js";
25
25
  import "./date-picker.BGHn6qg8.js";
26
26
  import { f as fetchCortexApi } from "./content-builder.BX4pHujE.js";
27
27
  import "./unsafe-html.Dff7-rCx.js";
28
- import "./transformation.CkwgrwKQ.js";
28
+ import "./transformation.JkkMVin_.js";
29
29
  import { r as reactExports, a as React, j as jsxRuntimeExports, w, R as ReactDOM } from "./jsx-runtime.CTpPVMxj.js";
30
30
  import { a as getDefaultExportFromCjs, c as commonjsGlobal } from "./_commonjsHelpers.DQNKXVTB.js";
31
31
  import { r as require$$0 } from "./___vite-browser-external_commonjs-proxy.C2tf3HsQ.js";
@@ -13,7 +13,7 @@ import { b as Ke } from "./_baseIteratee.sC2wLi2m.js";
13
13
  import { a as c1 } from "./toString.B1zKIiZc.js";
14
14
  import { b as d1 } from "./cloneDeep.tKGbEwzn.js";
15
15
  import { c as s1 } from "./_baseClone.ipmFlCAx.js";
16
- import { I as je, C as Ve, a as o1, b as He, S as z, D as h1, c as l1, A as _e, g as g1, i as C1, F as y1, d as x1, t as b1, e as k1, f as p1, h as u1, j as f1, k as A1, l as B1, m as D1, n as F1, o as E1, p as v1, q as $1, r as w1, O as S1 } from "./types.BjHMUzQj.js";
16
+ import { I as je, C as Ve, a as o1, b as He, S as z, D as h1, c as l1, A as _e, g as g1, i as C1, F as y1, d as x1, t as b1, e as k1, f as p1, h as u1, j as f1, k as A1, l as B1, m as D1, n as F1, o as E1, p as v1, q as $1, r as w1, O as S1 } from "./types.D9i8EgKJ.js";
17
17
  import { C as ce } from "./button.w0zH5Ivx.js";
18
18
  import I1 from "../components/button-group.js";
19
19
  import _1 from "../components/card.js";
@@ -59,11 +59,11 @@ import { n as $ } from "./when.Dr1es41R.js";
59
59
  import { a as l0 } from "./_baseXor.DixEm6JQ.js";
60
60
  import { a as g0, i as qe, b as C0 } from "./isArrayLikeObject.D7afXo-f.js";
61
61
  import { i as y0 } from "./isEmpty.DtTJTUcf.js";
62
- import { a as Ae, F as x0, b as b0, c as Le, d as Oe, i as k0, e as Ge, u as Be } from "./asset-link-format.Bj6HJXSZ.js";
62
+ import { a as Ae, F as x0, b as b0, c as Le, d as Oe, i as k0, e as Ge, u as Be } from "./asset-link-format.a59f8lRl.js";
63
63
  import p0 from "../components/color-picker.js";
64
64
  import { C as Ie } from "./icon-button.BWJ1Vqn5.js";
65
65
  import u0 from "../components/spinner.js";
66
- import { a as f0, d as A0 } from "./color-swatch-group.Bz2acokX.js";
66
+ import { a as f0, d as A0 } from "./color-swatch-group.DJqdDogB.js";
67
67
  import { c as ne, C as me, p as B0, a as D0, b as F0, g as ye } from "./color.LzSGBy7o.js";
68
68
  import { o as e1 } from "./map.D8heArFD.js";
69
69
  import { v as a1 } from "./v4.CKZ6klMF.js";
@@ -1,22 +1,22 @@
1
- import { C as $, T as m, U as p } from "./asset-link-format.ClaYu_v8.js";
2
- import { P as y } from "./position-picker.DjnhxIKF.js";
3
- const g = "/AssetLink/", N = {
4
- [y.BottomCenter]: $.South,
5
- [y.BottomLeft]: $.Southwest,
6
- [y.BottomRight]: $.Southeast,
7
- [y.CenterCenter]: $.Center,
8
- [y.CenterLeft]: $.West,
9
- [y.CenterRight]: $.East,
10
- [y.TopCenter]: $.North,
11
- [y.TopLeft]: $.Northwest,
12
- [y.TopRight]: $.Northeast
13
- }, R = "/t/", S = [400, 800, 1200, 1600, 2400], E = 0.15;
14
- function O({
1
+ import { C as y, T as $, U as A } from "./asset-link-format.ClaYu_v8.js";
2
+ import { P as g } from "./position-picker.DjnhxIKF.js";
3
+ const _ = "/AssetLink/", E = {
4
+ [g.BottomCenter]: y.South,
5
+ [g.BottomLeft]: y.Southwest,
6
+ [g.BottomRight]: y.Southeast,
7
+ [g.CenterCenter]: y.Center,
8
+ [g.CenterLeft]: y.West,
9
+ [g.CenterRight]: y.East,
10
+ [g.TopCenter]: y.North,
11
+ [g.TopLeft]: y.Northwest,
12
+ [g.TopRight]: y.Northeast
13
+ }, p = "/t/", S = [400, 800, 1200, 1600, 2400], F = 0.15;
14
+ function C({
15
15
  asset: t,
16
16
  baseUrl: n,
17
17
  extension: i,
18
- options: d,
19
- parameters: u,
18
+ options: f,
19
+ parameters: c,
20
20
  transformations: r,
21
21
  useSession: l = ""
22
22
  }) {
@@ -24,34 +24,34 @@ function O({
24
24
  return "";
25
25
  let s = n;
26
26
  const h = r?.findLast(
27
- (c) => c.key === m.Quality
27
+ (u) => u.key === $.Quality
28
28
  );
29
29
  if (h && (r = [
30
30
  ...r?.filter(
31
- (c) => c.key !== m.Quality
31
+ (u) => u.key !== $.Quality
32
32
  ) || [],
33
33
  h
34
34
  ]), r) {
35
- const c = [];
35
+ const u = [];
36
36
  for (let e = 0; e < r.length; e++) {
37
- const f = r[e];
38
- if (f.key === m.Rotate) {
39
- let o = f.value.rotation ?? 0;
40
- for (; r[e + 1]?.key === m.Rotate; )
37
+ const d = r[e];
38
+ if (d.key === $.Rotate) {
39
+ let o = d.value.rotation ?? 0;
40
+ for (; r[e + 1]?.key === $.Rotate; )
41
41
  e++, o += r[e].value.rotation ?? 0;
42
- o !== 0 && c.push({ key: m.Rotate, value: { rotation: o } });
42
+ o !== 0 && u.push({ key: $.Rotate, value: { rotation: o } });
43
43
  } else
44
- c.push(f);
44
+ u.push(d);
45
45
  }
46
- r = c;
46
+ r = u;
47
47
  }
48
- r && r.length > 0 && (s += "/t/"), r?.forEach(({ key: c, value: e }) => {
49
- if (c === m.Resize) {
50
- if (e.unit === p.AspectRatio && e.ratioWidth && e.ratioHeight) {
48
+ r && r.length > 0 && (s += "/t/"), r?.forEach(({ key: u, value: e }) => {
49
+ if (u === $.Resize) {
50
+ if (e.unit === A.AspectRatio && e.ratioWidth && e.ratioHeight) {
51
51
  s += `re_ar_${e.ratioWidth}:${e.ratioHeight}/`;
52
52
  return;
53
53
  }
54
- const f = [
54
+ const d = [
55
55
  ...[
56
56
  {
57
57
  key: "re_w_",
@@ -70,18 +70,18 @@ function O({
70
70
  value: "stretch"
71
71
  }
72
72
  ];
73
- f.forEach(({ key: o, value: _ }, k) => {
74
- s += `${o}${_}${k < f.length - 1 ? "," : ""}`;
73
+ d.forEach(({ key: o, value: m }, k) => {
74
+ s += `${o}${m}${k < d.length - 1 ? "," : ""}`;
75
75
  }), s += "/";
76
76
  }
77
- if (c === m.Crop) {
78
- const f = e.unit === p.AspectRatio && !!e.ratioWidth && !!e.ratioHeight, o = !e.disabledSize && !f, _ = o && (e.x !== void 0 || e.y !== void 0), k = [
77
+ if (u === $.Crop) {
78
+ const d = e.unit === A.AspectRatio && !!e.ratioWidth && !!e.ratioHeight, o = !e.disabledSize && !d, m = o && (e.x !== void 0 || e.y !== void 0), k = [
79
79
  ...[
80
80
  {
81
81
  key: "c_",
82
82
  value: e.mode
83
83
  },
84
- ...f ? [
84
+ ...d ? [
85
85
  {
86
86
  key: "ar_",
87
87
  value: `${e.ratioWidth}:${e.ratioHeight}`
@@ -98,42 +98,42 @@ function O({
98
98
  },
99
99
  {
100
100
  key: "c_x_",
101
- value: Math.round(e.x ?? 0) === 0 && d?.omitZeroXY ? void 0 : Math.round(e.x ?? 0)
101
+ value: Math.round(e.x ?? 0) === 0 && f?.omitZeroXY ? void 0 : Math.round(e.x ?? 0)
102
102
  },
103
103
  {
104
104
  key: "c_y_",
105
- value: Math.round(e.y ?? 0) === 0 && d?.omitZeroXY ? void 0 : Math.round(e.y ?? 0)
105
+ value: Math.round(e.y ?? 0) === 0 && f?.omitZeroXY ? void 0 : Math.round(e.y ?? 0)
106
106
  }
107
107
  ] : [],
108
- ...!_ && e.focusMode && e.focusMode !== "manual" ? [
108
+ ...!m && e.focusMode && e.focusMode !== "manual" ? [
109
109
  {
110
110
  key: e.isFocusModeAuto ? "acm_" : "c_g_",
111
111
  value: e.focusMode
112
112
  }
113
113
  ] : [],
114
- ...!_ && e.focusMode === "manual" && e.position ? [
114
+ ...!m && e.focusMode === "manual" && e.position ? [
115
115
  {
116
116
  key: "c_g_",
117
- value: N[e.position]
117
+ value: E[e.position]
118
118
  }
119
119
  ] : []
120
120
  ].filter((T) => T.value !== void 0 && T.value !== null).map((T) => ({
121
121
  key: T.key,
122
122
  value: T.value
123
123
  })),
124
- ...f ? [] : [
124
+ ...d ? [] : [
125
125
  {
126
126
  key: "c_whu_",
127
127
  value: "pixel"
128
128
  }
129
129
  ]
130
130
  ];
131
- k.forEach(({ key: T, value: v }, x) => {
132
- const I = ["c_w_", "c_h_", "c_x_", "c_y_"].includes(T);
133
- s += `${T}${I ? Math.round(Number(v)) : v}${x < k.length - 1 ? "," : ""}`;
131
+ k.forEach(({ key: T, value: R }, N) => {
132
+ const O = ["c_w_", "c_h_", "c_x_", "c_y_"].includes(T);
133
+ s += `${T}${O ? Math.round(Number(R)) : R}${N < k.length - 1 ? "," : ""}`;
134
134
  }), s += "/";
135
135
  }
136
- if (c === m.Rotate && ([
136
+ if (u === $.Rotate && ([
137
137
  {
138
138
  key: "r_a_",
139
139
  value: e.rotation
@@ -141,10 +141,10 @@ function O({
141
141
  ].filter((o) => o.value !== void 0).map((o) => ({
142
142
  key: o.key,
143
143
  value: Math.round(Number(o.value))
144
- })).forEach(({ key: o, value: _ }) => {
145
- s += `${o}${_}`;
146
- }), s += "/"), c === m.Quality) {
147
- const f = [
144
+ })).forEach(({ key: o, value: m }) => {
145
+ s += `${o}${m}`;
146
+ }), s += "/"), u === $.Quality) {
147
+ const d = [
148
148
  {
149
149
  key: "q_level_",
150
150
  value: e.quality
@@ -153,91 +153,103 @@ function O({
153
153
  key: o.key,
154
154
  value: Math.round(Number(o.value))
155
155
  }));
156
- f.forEach(({ key: o, value: _ }, k) => {
157
- s += `${o}${_}${k < f.length - 1 ? "," : ""}`;
156
+ d.forEach(({ key: o, value: m }, k) => {
157
+ s += `${o}${m}${k < d.length - 1 ? "," : ""}`;
158
158
  }), s += "/";
159
159
  }
160
- if (c === m.Metadata) {
161
- const f = [
160
+ if (u === $.Metadata) {
161
+ const d = [
162
162
  {
163
163
  key: "fl_keep_metadata",
164
164
  value: e.keepMetadata
165
165
  }
166
166
  ].filter((o) => o.value !== void 0).map((o) => ({ key: o.key, value: o.value }));
167
- f.forEach(({ key: o }, _) => {
168
- s += `${o}${_ < f.length - 1 ? "," : ""}`;
167
+ d.forEach(({ key: o }, m) => {
168
+ s += `${o}${m < d.length - 1 ? "," : ""}`;
169
169
  }), s += "/";
170
170
  }
171
171
  }), i && (s += `${t?.identifier ?? crypto.randomUUID()}${i}`);
172
172
  const a = [];
173
- return u && u.length > 0 && u.forEach(({ key: c, value: e }) => {
173
+ return c && c.length > 0 && c.forEach(({ key: u, value: e }) => {
174
174
  a.push(
175
- `${encodeURIComponent(c.trim())}=${encodeURIComponent(e.trim())}`
175
+ `${encodeURIComponent(u.trim())}=${encodeURIComponent(e.trim())}`
176
176
  );
177
177
  }), n && l && a.push(`UseSession=${encodeURIComponent(l)}`), a.length > 0 && (s += `?${a.join("&")}`), s.endsWith("/") && (s = s.slice(0, -1)), s;
178
178
  }
179
179
  function z(t, n) {
180
180
  if (!t || !n?.length)
181
181
  return t;
182
- const i = O({ baseUrl: "", transformations: n }).replace(
182
+ const i = C({ baseUrl: "", transformations: n }).replace(
183
183
  /\/t\//g,
184
184
  ""
185
185
  );
186
186
  if (!i)
187
187
  return t;
188
- const d = t.indexOf(g);
189
- if (d < 0)
188
+ const f = t.indexOf(_);
189
+ if (f < 0)
190
190
  return `${t}/t/${i}`;
191
- const u = t.slice(0, d + g.length), r = t.slice(d + g.length), l = r.indexOf("/t/");
191
+ const c = t.slice(0, f + _.length), r = t.slice(f + _.length), l = r.indexOf("/t/");
192
192
  if (l >= 0) {
193
193
  const h = r.slice(0, l);
194
- return `${u}${h}/t/${i}`;
194
+ return `${c}${h}/t/${i}`;
195
195
  }
196
196
  const s = r.indexOf("/");
197
197
  if (s >= 0) {
198
198
  const h = r.slice(0, s), a = r.slice(s);
199
- return `${u}${h}/t/${i}${a}`;
199
+ return `${c}${h}/t/${i}${a}`;
200
200
  }
201
201
  return `${t}/t/${i}`;
202
202
  }
203
- function F(t) {
203
+ function W(t) {
204
204
  return `re_w_${Math.round(t)}`;
205
205
  }
206
- function C(t, n) {
206
+ function w(t, n) {
207
207
  if (!t || !Number.isFinite(n) || n <= 0)
208
208
  return t;
209
- const i = t.indexOf(g);
209
+ const i = t.indexOf(_);
210
210
  if (i < 0)
211
211
  return t;
212
- const d = F(n), u = t.slice(0, i + g.length), r = t.slice(i + g.length), l = r.indexOf(R);
212
+ const f = W(n), c = t.slice(0, i + _.length), r = t.slice(i + _.length), l = r.indexOf(p);
213
213
  if (l >= 0) {
214
214
  const h = r.slice(0, l), a = r.slice(
215
- l + R.length
215
+ l + p.length
216
216
  );
217
- return `${u}${h}${R}${d}/${a}`;
217
+ return `${c}${h}${p}${f}/${a}`;
218
218
  }
219
219
  const s = r.indexOf("/");
220
220
  if (s >= 0) {
221
221
  const h = r.slice(0, s), a = r.slice(s);
222
- return `${u}${h}${R}${d}${a}`;
222
+ return `${c}${h}${p}${f}${a}`;
223
223
  }
224
- return `${u}${r}${R}${d}`;
224
+ return `${c}${r}${p}${f}`;
225
225
  }
226
- function W(t) {
227
- const n = t.indexOf(g);
228
- return n < 0 ? !1 : t.slice(n + g.length).includes(R);
226
+ function L(t) {
227
+ const n = t.indexOf(_);
228
+ return n < 0 ? !1 : t.slice(n + _.length).includes(p);
229
229
  }
230
- const A = "TRX", M = "TR1", w = /* @__PURE__ */ new Set(["gif", "png", "tif", "tiff"]);
231
- function b(t) {
230
+ const v = "TRX", M = "TR1", U = /* @__PURE__ */ new Set([
231
+ "avif",
232
+ "bmp",
233
+ "gif",
234
+ "ico",
235
+ "jpeg",
236
+ "jpg",
237
+ "png",
238
+ "svg",
239
+ "tif",
240
+ "tiff",
241
+ "webp"
242
+ ]);
243
+ function I(t) {
232
244
  if (!t)
233
245
  return "";
234
246
  const n = t.trim().toLowerCase();
235
247
  return n.startsWith(".") ? n.slice(1) : n;
236
248
  }
237
- function L(t) {
238
- return b(t) === "gif";
249
+ function b(t) {
250
+ return I(t) === "gif";
239
251
  }
240
- const U = 10 * 1024 * 1024, B = {
252
+ const G = 1e3 * 1024 * 1024, B = {
241
253
  b: 1,
242
254
  byte: 1,
243
255
  bytes: 1,
@@ -246,7 +258,7 @@ const U = 10 * 1024 * 1024, B = {
246
258
  mb: 1024 ** 2,
247
259
  tb: 1024 ** 4
248
260
  };
249
- function G(t) {
261
+ function K(t) {
250
262
  if (typeof t == "number")
251
263
  return Number.isFinite(t) && t >= 0 ? t : void 0;
252
264
  if (!t)
@@ -257,11 +269,11 @@ function G(t) {
257
269
  const i = Number(n[1].replace(/,/g, ""));
258
270
  if (!Number.isFinite(i) || i < 0)
259
271
  return;
260
- const d = n[2].toLowerCase();
261
- if (!d)
272
+ const f = n[2].toLowerCase();
273
+ if (!f)
262
274
  return i;
263
- const u = B[d];
264
- return u === void 0 ? void 0 : i * u;
275
+ const c = B[f];
276
+ return c === void 0 ? void 0 : i * c;
265
277
  }
266
278
  function D(t, n) {
267
279
  if (t)
@@ -269,44 +281,54 @@ function D(t, n) {
269
281
  const i = typeof n == "number" ? n : Number(n ?? "");
270
282
  return Number.isFinite(i) && i > 0 ? i : void 0;
271
283
  }
272
- function X(t, n) {
273
- if (!w.has(b(t)))
284
+ function Y(t, n) {
285
+ if (!U.has(I(t)))
274
286
  return M;
275
- const i = G(n);
276
- return i !== void 0 && i > U ? M : A;
287
+ const i = K(n);
288
+ return i !== void 0 && i > G ? M : v;
289
+ }
290
+ const x = ".auto";
291
+ function j(t, n = {}) {
292
+ const i = t ? t.indexOf(_) : -1;
293
+ if (i < 0 || n.format === v && b(n.extension))
294
+ return t;
295
+ const f = t.slice(i + _.length), c = f.slice(f.lastIndexOf("/") + 1);
296
+ return c === "" || c.endsWith(x) ? t : `${t}${x}`;
277
297
  }
278
- function Y(t, n = {}) {
279
- if (!t.includes(g) || W(t) || n.format === A && L(n.extension))
298
+ function H(t, n = {}) {
299
+ if (!t.includes(_) || L(t) || n.format === v && b(n.extension))
280
300
  return "";
281
- const { maxWidth: i, widths: d = S } = n, u = [...d].filter((a) => Number.isFinite(a) && a > 0).sort((a, c) => a - c);
282
- if (u.length === 0)
301
+ const { maxWidth: i, widths: f = S } = n, c = [...f].filter((a) => Number.isFinite(a) && a > 0).sort((a, u) => a - u);
302
+ if (c.length === 0)
283
303
  return "";
284
- let r = u;
304
+ let r = c;
285
305
  if (i !== void 0 && Number.isFinite(i) && i > 0) {
286
- const a = u.filter((c) => c <= i);
287
- r = a.length > 0 ? a : [u[0]];
306
+ const a = c.filter((u) => u <= i);
307
+ r = a.length > 0 ? a : [c[0]];
288
308
  }
289
309
  const l = i !== void 0 && Number.isFinite(i) && i > 0, h = (l ? r.filter(
290
- (a) => i > a * (1 + E)
310
+ (a) => i > a * (1 + F)
291
311
  ) : r).map(
292
- (a) => `${C(t, a)} ${a}w`
312
+ (a) => `${w(t, a)} ${a}w`
293
313
  );
294
314
  return l && h.push(`${t} ${i}w`), h.join(", ");
295
315
  }
296
- function H(t, n = 100) {
316
+ function Q(t, n = 100) {
297
317
  return !Number.isFinite(t) || t <= 0 ? "" : `${Math.ceil(t / n) * n}px`;
298
318
  }
299
319
  export {
300
320
  M as A,
301
321
  S,
302
- D as a,
303
- Y as b,
304
- z as c,
305
- O as d,
306
- H as e,
307
- C as f,
308
- U as g,
309
- W as h,
310
- G as p,
311
- X as r
322
+ j as a,
323
+ H as b,
324
+ D as c,
325
+ z as d,
326
+ C as e,
327
+ Q as f,
328
+ w as g,
329
+ L as h,
330
+ G as i,
331
+ x as j,
332
+ K as p,
333
+ Y as r
312
334
  };