@orangelogic/design-system 2.106.0 → 2.108.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 (104) hide show
  1. package/library/chunks/asset.BOex8mNF.js +443 -0
  2. package/library/chunks/{button.CZ-e_TGN.js → button.BgLgpUch.js} +1 -1
  3. package/library/chunks/{color-swatch-group.BTwy546N.js → color-swatch-group.CJR5NTAx.js} +3 -3
  4. package/library/chunks/{color-swatch.DHxppzoQ.js → color-swatch.LWXX_hoG.js} +1 -1
  5. package/library/chunks/{confirm-popover.DknitT29.js → confirm-popover.BzpCIDBx.js} +3 -3
  6. package/library/chunks/{dialog.BOWFhWcd.js → dialog.BTYaKnFg.js} +2 -2
  7. package/library/chunks/{dot-pagination.CBRkADz0.js → dot-pagination.Do9tKlWY.js} +1 -1
  8. package/library/chunks/{file-on-demand.BVA_s4TR.js → file-on-demand.DICkRgvk.js} +8 -8
  9. package/library/chunks/{folder-select.EVuyDx55.js → folder-select.DLjFwi4I.js} +3 -3
  10. package/library/chunks/{header.inh-TC_q.js → header.CLZWpAF-.js} +1 -1
  11. package/library/chunks/{i18n.DmmFsjwP.js → i18n.ju3y72qp.js} +31 -14
  12. package/library/chunks/{icon-button.CHh2iNJJ.js → icon-button.CLlmo1AF.js} +1 -1
  13. package/library/chunks/{iframe.duVt7WWc.js → iframe.CqtDcvOS.js} +1 -1
  14. package/library/chunks/{image.DdtDzup6.js → image.CfNFiNFB.js} +57 -54
  15. package/library/chunks/{list-editor.DKEh6VBL.js → list-editor.zY8vlbde.js} +8 -8
  16. package/library/chunks/{option.B6cSZiX6.js → option.BOZYPQZH.js} +1 -1
  17. package/library/chunks/{pagination.RXrwBaR8.js → pagination.BGjp2gVJ.js} +4 -4
  18. package/library/chunks/{tab-group.BA4PlJhR.js → tab-group.hmlZakLy.js} +3 -3
  19. package/library/chunks/{table.Dh2C2f1c.js → table.XsBhq1U3.js} +4 -4
  20. package/library/chunks/{tree.BO4oLcdB.js → tree.DAhCAxwV.js} +1 -1
  21. package/library/components/alert.js +2 -2
  22. package/library/components/asset-link-format.js +5 -5
  23. package/library/components/atoms.js +12 -12
  24. package/library/components/audio.js +2 -2
  25. package/library/components/border-input-group.js +1 -1
  26. package/library/components/breadcrumb.js +1 -1
  27. package/library/components/button.js +2 -2
  28. package/library/components/color-picker.js +2 -2
  29. package/library/components/color-swatch-group.js +4 -4
  30. package/library/components/color-swatch.js +2 -2
  31. package/library/components/confirm-popover.js +4 -4
  32. package/library/components/copy-button.js +1 -1
  33. package/library/components/corner-position-input-group.js +2 -2
  34. package/library/components/details.js +1 -1
  35. package/library/components/dialog.js +3 -3
  36. package/library/components/dot-pagination.js +2 -2
  37. package/library/components/drawer.js +2 -2
  38. package/library/components/dropdown.js +1 -1
  39. package/library/components/dynamic-select.js +4 -4
  40. package/library/components/e-chart.js +1 -1
  41. package/library/components/element-clamp.js +2 -2
  42. package/library/components/file-on-demand.js +9 -9
  43. package/library/components/folder-select.js +3 -3
  44. package/library/components/format-bytes.js +1 -1
  45. package/library/components/format-date.js +1 -1
  46. package/library/components/format-number.js +1 -1
  47. package/library/components/format-time.js +1 -1
  48. package/library/components/header.js +2 -2
  49. package/library/components/icon-button.js +2 -2
  50. package/library/components/iframe.js +2 -2
  51. package/library/components/image-comparer.js +1 -1
  52. package/library/components/image.js +2 -2
  53. package/library/components/input.js +1 -1
  54. package/library/components/line-clamp.js +1 -1
  55. package/library/components/list-editor.js +6 -6
  56. package/library/components/masonry.js +2 -2
  57. package/library/components/menu-item.js +2 -2
  58. package/library/components/menu.js +1 -1
  59. package/library/components/molecules.js +4 -4
  60. package/library/components/option.js +2 -2
  61. package/library/components/organisms.js +2 -2
  62. package/library/components/pagination.js +5 -5
  63. package/library/components/popup.js +1 -1
  64. package/library/components/position-picker.js +1 -1
  65. package/library/components/progress-bar.js +1 -1
  66. package/library/components/progress-ring.js +1 -1
  67. package/library/components/range.js +1 -1
  68. package/library/components/rating.js +1 -1
  69. package/library/components/relative-time.js +1 -1
  70. package/library/components/select.js +2 -2
  71. package/library/components/share-option-list.js +1 -1
  72. package/library/components/sidebar.js +1 -1
  73. package/library/components/size-input-group.js +2 -2
  74. package/library/components/spinner.js +1 -1
  75. package/library/components/split-panel.js +1 -1
  76. package/library/components/tab-group.js +4 -4
  77. package/library/components/tab.js +2 -2
  78. package/library/components/table.js +5 -5
  79. package/library/components/tag.js +2 -2
  80. package/library/components/tooltip.js +1 -1
  81. package/library/components/tree-item.js +2 -2
  82. package/library/components/tree.js +2 -2
  83. package/library/components/typeface.js +2 -2
  84. package/library/components/types.js +3261 -3154
  85. package/library/components/video.js +2 -2
  86. package/library/package.json +1 -1
  87. package/library/packages/atoms/src/components/image/image.d.ts +1 -0
  88. package/library/packages/events/src/cx-gallery-lightbox-hide.d.ts +6 -0
  89. package/library/packages/events/src/cx-gallery-lightbox-show.d.ts +6 -0
  90. package/library/packages/events/src/events.d.ts +2 -0
  91. package/library/packages/molecules/src/asset-data-display/asset-data-display.d.ts +1 -0
  92. package/library/packages/organisms/src/content-builder/components/config-form/config-form.d.ts +1 -0
  93. package/library/packages/organisms/src/content-builder/content-builder.d.ts +2 -0
  94. package/library/packages/organisms/src/content-builder/plugins/plugin-factory.d.ts +1 -0
  95. package/library/packages/organisms/src/content-builder/styleController.d.ts +1 -0
  96. package/library/packages/services/src/api/asset/asset.d.ts +3 -3
  97. package/library/packages/tools/src/fetch-asset/fetch-asset.d.ts +2 -1
  98. package/library/packages/tools/src/fetch-image/fetch-image.d.ts +2 -0
  99. package/library/packages/types/src/content-builder.d.ts +3 -0
  100. package/library/packages/utils/src/custom-element/i18n.d.ts +17 -0
  101. package/library/react-web-component.d.ts +5 -1
  102. package/library/utils.js +1 -1
  103. package/package.json +1 -1
  104. package/library/chunks/asset.Tjoo0ngC.js +0 -437
@@ -1,437 +0,0 @@
1
- import { h as l, S as B, A as w, a as K, b as $ } from "./endpoints.DBlquU2-.js";
2
- import { M as R } from "./asset-link-format.B0c92pSs.js";
3
- import "./debounce.CIEhztrj.js";
4
- import "./lit-element.jLBm65_O.js";
5
- import "./form.Ch1cwYzO.js";
6
- import "./i18n.DmmFsjwP.js";
7
- import { a as q } from "./string.DUgD4c9f.js";
8
- import "./content-builder.B-bd8FaV.js";
9
- import "./unsafe-html.Dff7-rCx.js";
10
- import { b as V } from "./_baseUniq.HFKneygy.js";
11
- function Z(e) {
12
- return e && e.length ? V(e) : [];
13
- }
14
- function X(e) {
15
- return typeof e == "object" && e !== null && "URI" in e;
16
- }
17
- const z = {
18
- artist: "Artist",
19
- color: "Color",
20
- createDate: "CreateDate",
21
- docSubType: "DocSubType",
22
- docType: "DocType",
23
- editDate: "EditDate",
24
- fileExtension: "Fileextension",
25
- keyword: "Keyword",
26
- mediaDate: "MediaDate",
27
- mediaNumber: "MediaNumber",
28
- nativeKeyword: "NativeKeyword",
29
- orientation: "Orientation",
30
- parentFolderIdentifier: "ParentFolderIdentifier",
31
- path: "Path",
32
- photographer: "Photographer",
33
- purpose: "Purpose",
34
- recordId: "RecordID",
35
- systemIdentifier: "SystemIdentifier",
36
- text: "Text",
37
- title: "Title"
38
- }, Y = /* @__PURE__ */ new Set(["mediaDate", "createDate", "editDate"]);
39
- function Q(e) {
40
- return !/[\s&+/*"\\:(),'<>~|[\]{}]/.test(e) && !/^(?:OR|AND|NOT)$/.test(e) ? e : `"${e.replace(/\\/g, "\\\\").replace(/"/g, '\\"')}"`;
41
- }
42
- function O(e, t) {
43
- const o = (Array.isArray(t) ? t : [t]).map((s) => `${e}:${Q(s)}`);
44
- return o.length > 1 ? `(${o.join(" OR ")})` : o[0] ?? "";
45
- }
46
- function J(e, t) {
47
- return (Array.isArray(t) ? t : [t]).map((o) => `${e}${o.operator}${o.value}`).join(" AND ");
48
- }
49
- function ee(e) {
50
- const t = [];
51
- for (const r of Object.keys(e)) {
52
- const o = r, s = e[o];
53
- if (s == null)
54
- continue;
55
- if (o === "custom") {
56
- for (const [a, p] of Object.entries(
57
- s
58
- ))
59
- t.push(O(a, p));
60
- continue;
61
- }
62
- const u = z[o];
63
- if (u) {
64
- if (Y.has(o)) {
65
- t.push(
66
- J(u, s)
67
- );
68
- continue;
69
- }
70
- if (o === "color") {
71
- t.push(`${u}:${s}`);
72
- continue;
73
- }
74
- t.push(O(u, s));
75
- }
76
- }
77
- return t.join(" AND ");
78
- }
79
- function _(e) {
80
- if ("and" in e)
81
- return e.and.map(_).filter(Boolean).join(" AND ");
82
- if ("or" in e) {
83
- const t = e.or.map(_).filter(Boolean);
84
- return t.length > 1 ? `(${t.join(" OR ")})` : t[0] ?? "";
85
- }
86
- if ("not" in e) {
87
- const t = _(e.not);
88
- return t ? `NOT (${t})` : "";
89
- }
90
- return ee(e);
91
- }
92
- const L = "CoreField.LargeSizePreview", P = "CoreField.DocType", te = "Document.Title", re = "Document.CaptionLong", b = "Document.FileExtension", G = "CoreField.FileSize", M = "CoreField.Identifier", U = "CoreField.Keywords", j = "CoreField.MaxHeight", v = "CoreField.MaxWidth", D = "Document.RecordID", W = "CoreField.DocSubType", H = "CoreField.TitleWithFallback", T = "CoreField.OriginalFileName", y = "CoreField.UpdatedFileName", E = "CoreField.OriginalPreview", F = {
93
- DEFAULT_VIEW_SIZE: "Document.LargeSizePreview",
94
- FIELD_TITLE_WITH_FALLBACK: "Document.TitleWithFallback",
95
- ORIGINAL_VIEW_SIZE: "Document.OriginalPreview"
96
- }, k = {
97
- [L]: F.DEFAULT_VIEW_SIZE,
98
- [H]: F.FIELD_TITLE_WITH_FALLBACK,
99
- [E]: F.ORIGINAL_VIEW_SIZE
100
- }, oe = Object.fromEntries(
101
- Object.entries(k).map(([e, t]) => [
102
- t,
103
- e
104
- ])
105
- );
106
- function ne(e) {
107
- return k[e] ?? e;
108
- }
109
- function se(e) {
110
- const t = {};
111
- for (const [r, o] of Object.entries(e)) {
112
- const s = oe[r] ?? r;
113
- t[s] = o;
114
- }
115
- return t;
116
- }
117
- async function x({
118
- countPerPage: e,
119
- fields: t,
120
- getPermanentAssetsPaths: r,
121
- pageNumber: o,
122
- query: s,
123
- siteUrl: u,
124
- sort: a,
125
- token: p,
126
- useSession: m
127
- }) {
128
- const I = t?.map(ne);
129
- try {
130
- return (await l.request({
131
- baseURL: u,
132
- method: "GET",
133
- params: {
134
- CountPerPage: e,
135
- Fields: Z(I),
136
- Format: "json",
137
- GetPermanentAssetsPaths: r || void 0,
138
- PageNumber: o,
139
- Query: _(s),
140
- Sort: a || void 0,
141
- Token: p || void 0,
142
- UseSession: m || void 0
143
- },
144
- paramsSerializer: { indexes: null },
145
- responseType: "json",
146
- transformResponse: [
147
- ...Array.isArray(l.defaults.transformResponse) ? l.defaults.transformResponse : [],
148
- (n) => ({
149
- items: (n.APIResponse?.Items ?? []).map(se),
150
- sort: n.APIResponse?.GlobalInfo?.Sort ?? "",
151
- totalCount: n.APIResponse?.GlobalInfo?.TotalCount ?? 0
152
- })
153
- ],
154
- url: B["4.0"]
155
- })).data;
156
- } catch {
157
- return { items: [], sort: "", totalCount: 0 };
158
- }
159
- }
160
- async function _e({
161
- assetId: e,
162
- extension: t,
163
- format: r,
164
- siteUrl: o,
165
- token: s,
166
- transformations: u,
167
- useSession: a
168
- }) {
169
- try {
170
- return (await l.request({
171
- baseURL: o,
172
- method: "GET",
173
- params: {
174
- SourceAssetFormat: r,
175
- SourceAssetRecordID: e,
176
- TargetExtension: q(t),
177
- Token: s || void 0,
178
- Transformations: u,
179
- UseSession: a || void 0
180
- },
181
- /**
182
- * https://link.orangelogic.com/Tasks/41S1XH
183
- */
184
- timeout: 3e5,
185
- // 5 minutes
186
- url: w.GET_TRANSFORM_ASSET_LINK
187
- })).data;
188
- } catch {
189
- return null;
190
- }
191
- }
192
- const ae = 50;
193
- function ie(e, t) {
194
- const r = [];
195
- for (let o = 0; o < e.length; o += t)
196
- r.push(e.slice(o, o + t));
197
- return r;
198
- }
199
- async function De({
200
- extraFields: e,
201
- getPermanentAssetsPaths: t,
202
- recordIds: r,
203
- token: o
204
- }) {
205
- if (!Array.isArray(r) || r.length === 0)
206
- return { facets: [], items: [], totalCount: 0 };
207
- const s = e?.filter((n) => n && typeof n == "string") ?? [], u = [
208
- ...s,
209
- E,
210
- y,
211
- T,
212
- te,
213
- re,
214
- D
215
- ], a = ie(r, ae), p = await Promise.all(
216
- a.map(
217
- (n) => x({
218
- countPerPage: n.length,
219
- fields: u,
220
- getPermanentAssetsPaths: t,
221
- pageNumber: 1,
222
- query: { recordId: n },
223
- token: o
224
- })
225
- )
226
- ), m = new Map(r.map((n, d) => [n, d])), I = p.flatMap((n) => n.items).map((n) => {
227
- let d = c(n, y);
228
- return d === "" && (d = c(n, T)), {
229
- name: d,
230
- originalUrl: c(n, E),
231
- recordId: c(n, D),
232
- ...s.reduce(
233
- (i, f) => (i[f] = c(n, f), i),
234
- {}
235
- )
236
- };
237
- }).sort(
238
- (n, d) => (m.get(n.recordId) ?? 1 / 0) - (m.get(d.recordId) ?? 1 / 0)
239
- ), A = p.reduce(
240
- (n, d) => n + d.totalCount,
241
- 0
242
- );
243
- return { facets: [], items: I, totalCount: A };
244
- }
245
- function c(e, t) {
246
- const r = e[t];
247
- return r == null ? "" : typeof r == "string" ? r : typeof r == "number" || typeof r == "boolean" ? String(r) : X(r) ? r.URI : "";
248
- }
249
- async function Te({
250
- countPerPage: e,
251
- extraFields: t,
252
- getPermanentAssetsPaths: r,
253
- limitedDocTypes: o,
254
- pageNumber: s,
255
- parentFolderIdentifier: u,
256
- searchTerm: a,
257
- sortOrder: p,
258
- token: m
259
- }) {
260
- if (!u)
261
- return { facets: [], items: [], totalCount: 0 };
262
- const I = (t?.filter((i) => i && typeof i == "string") ?? []).map((i) => i.replace("%20", " ")), A = {
263
- parentFolderIdentifier: u,
264
- ...o.length > 0 ? { docType: [R.Image, R.Audio] } : {}
265
- }, n = await x({
266
- countPerPage: e,
267
- fields: [
268
- ...I,
269
- H,
270
- L,
271
- E,
272
- U,
273
- v,
274
- j,
275
- G,
276
- P,
277
- W,
278
- M,
279
- b,
280
- D,
281
- T,
282
- y
283
- ],
284
- getPermanentAssetsPaths: r,
285
- pageNumber: s,
286
- query: A,
287
- sort: void 0,
288
- token: m
289
- }), d = n.items.map((i) => {
290
- let f = c(i, b), h = c(i, y), S = c(i, L);
291
- f && !f.startsWith(".") && (f = "." + f), h === "" && (h = c(i, T)), f.toLowerCase() === ".gif" && (S = c(i, E));
292
- const C = c(i, D);
293
- return {
294
- docSubType: c(i, W),
295
- docType: c(i, P) || "",
296
- extension: f,
297
- height: c(i, j) || "0",
298
- id: C,
299
- identifier: c(i, M),
300
- imageUrl: S,
301
- name: h,
302
- originalUrl: c(i, E),
303
- recordId: C,
304
- size: c(i, G) || "0 MB",
305
- tags: c(i, U),
306
- width: c(i, v) || "0",
307
- ...I.reduce(
308
- (g, N) => (g[N] = c(i, N), g),
309
- {}
310
- )
311
- };
312
- });
313
- return {
314
- facets: [],
315
- items: d,
316
- totalCount: n.totalCount
317
- };
318
- }
319
- async function ye({
320
- autoCropMode: e,
321
- cropHeight: t,
322
- cropWidth: r,
323
- imageUrl: o,
324
- useSession: s
325
- }) {
326
- try {
327
- return (await l.request({
328
- method: "GET",
329
- params: {
330
- AutoCropMode: e,
331
- CropHeight: t,
332
- CropWidth: r,
333
- ImageUrl: o && new URL(o, window.location.origin).href,
334
- UseSession: s || void 0
335
- },
336
- responseType: "json",
337
- timeout: 3e5,
338
- // 5 minutes
339
- transformResponse: [
340
- ...Array.isArray(l.defaults.transformResponse) ? l.defaults.transformResponse : [],
341
- (a) => ({
342
- height: a.cropHeight,
343
- width: a.cropWidth,
344
- x: a.cropX,
345
- y: a.cropY
346
- })
347
- ],
348
- url: w.GET_CROP_ZONE_SUGGESTION
349
- })).data;
350
- } catch {
351
- return null;
352
- }
353
- }
354
- async function he({
355
- assetRecordId: e,
356
- siteUrl: t,
357
- token: r,
358
- useSession: o
359
- }) {
360
- try {
361
- return (await l.request({
362
- baseURL: t,
363
- method: "GET",
364
- params: {
365
- RecordId: e,
366
- Token: r,
367
- UseSession: o || void 0
368
- },
369
- responseType: "json",
370
- transformResponse: [
371
- ...Array.isArray(l.defaults.transformResponse) ? l.defaults.transformResponse : [],
372
- (u) => !u || typeof u != "object" ? [] : u.proxies?.map((a) => ({
373
- cdnName: a.cdnName,
374
- extension: a.extension,
375
- formatHeight: a.formatHeight,
376
- formatWidth: a.formatWidth,
377
- height: a.height,
378
- permanentLink: a.permanentLink,
379
- proxyLabel: a.proxyLabel,
380
- proxyName: a.proxyName,
381
- width: a.width
382
- })) ?? []
383
- ],
384
- url: $
385
- })).data;
386
- } catch {
387
- return [];
388
- }
389
- }
390
- async function Fe({
391
- siteUrl: e
392
- } = {}) {
393
- try {
394
- return (await l.request({
395
- baseURL: e,
396
- method: "GET",
397
- responseType: "json",
398
- transformResponse: [
399
- ...Array.isArray(l.defaults.transformResponse) ? l.defaults.transformResponse : [],
400
- (r) => !r || typeof r != "object" ? {
401
- formatsByDocType: {
402
- Audio: {},
403
- Image: {},
404
- Multimedia: {},
405
- Video: {}
406
- }
407
- } : {
408
- formatsByDocType: r.formatsByDocType ?? {}
409
- }
410
- ],
411
- url: K
412
- })).data;
413
- } catch {
414
- return { formatsByDocType: {} };
415
- }
416
- }
417
- export {
418
- L as D,
419
- D as F,
420
- E as O,
421
- De as a,
422
- _e as b,
423
- ye as c,
424
- Fe as d,
425
- x as e,
426
- Te as f,
427
- j as g,
428
- v as h,
429
- X as i,
430
- P as j,
431
- b as k,
432
- M as l,
433
- he as m,
434
- G as n,
435
- W as o,
436
- Z as u
437
- };