@orangelogic/design-system 2.109.0 → 2.111.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.
@@ -1,20 +1,20 @@
1
- import { h as l, S as $, A as H, a as K, b as q } from "./endpoints.DBlquU2-.js";
2
- import { M as O } from "./asset-link-format.B0c92pSs.js";
1
+ import { h as l, S as K, A as $, a as q, b as V } from "./endpoints.DBlquU2-.js";
2
+ import { M as P } from "./asset-link-format.B0c92pSs.js";
3
3
  import "./debounce.CIEhztrj.js";
4
4
  import "./lit-element.jLBm65_O.js";
5
5
  import "./form.Ch1cwYzO.js";
6
6
  import "./i18n.D6AYDPK-.js";
7
- import { a as V } from "./string.DUgD4c9f.js";
7
+ import { a as Z } from "./string.DUgD4c9f.js";
8
8
  import "./content-builder.OsUmm8Wu.js";
9
9
  import "./unsafe-html.Dff7-rCx.js";
10
- import { b as Z } from "./_baseUniq.HFKneygy.js";
11
- function z(e) {
12
- return e && e.length ? Z(e) : [];
13
- }
10
+ import { b as z } from "./_baseUniq.HFKneygy.js";
14
11
  function X(e) {
12
+ return e && e.length ? z(e) : [];
13
+ }
14
+ function Y(e) {
15
15
  return typeof e == "object" && e !== null && "URI" in e;
16
16
  }
17
- const Y = {
17
+ const Q = {
18
18
  artist: "Artist",
19
19
  color: "Color",
20
20
  createDate: "CreateDate",
@@ -35,12 +35,12 @@ const Y = {
35
35
  systemIdentifier: "SystemIdentifier",
36
36
  text: "Text",
37
37
  title: "Title"
38
- }, Q = /* @__PURE__ */ new Set(["mediaDate", "createDate", "editDate"]);
39
- function J(e) {
38
+ }, J = /* @__PURE__ */ new Set(["mediaDate", "createDate", "editDate"]);
39
+ function S(e) {
40
40
  return !/[\s&+/*"\\:(),'<>~|[\]{}]/.test(e) && !/^(?:OR|AND|NOT)$/.test(e) ? e : `"${e.replace(/\\/g, "\\\\").replace(/"/g, '\\"')}"`;
41
41
  }
42
- function P(e, t) {
43
- const r = (Array.isArray(t) ? t : [t]).map((i) => `${e}:${J(i)}`);
42
+ function b(e, t) {
43
+ const r = (Array.isArray(t) ? t : [t]).map((a) => `${e}:${S(a)}`);
44
44
  return r.length > 1 ? `(${r.join(" OR ")})` : r[0] ?? "";
45
45
  }
46
46
  function ee(e, t) {
@@ -49,29 +49,40 @@ function ee(e, t) {
49
49
  function te(e) {
50
50
  const t = [];
51
51
  for (const o of Object.keys(e)) {
52
- const r = o, i = e[r];
53
- if (i == null)
52
+ const r = o, a = e[r];
53
+ if (a == null)
54
54
  continue;
55
55
  if (r === "custom") {
56
- for (const [s, f] of Object.entries(
57
- i
56
+ for (const [n, p] of Object.entries(
57
+ a
58
58
  ))
59
- t.push(P(s, f));
59
+ t.push(b(n, p));
60
60
  continue;
61
61
  }
62
- const u = Y[r];
62
+ const u = Q[r];
63
63
  if (u) {
64
- if (Q.has(r)) {
64
+ if (J.has(r)) {
65
65
  t.push(
66
- ee(u, i)
66
+ ee(u, a)
67
67
  );
68
68
  continue;
69
69
  }
70
70
  if (r === "color") {
71
- t.push(`${u}:${i}`);
71
+ t.push(`${u}:${a}`);
72
+ continue;
73
+ }
74
+ if (r === "parentFolderIdentifier") {
75
+ const n = Array.isArray(a) ? a : [a];
76
+ if (n.length === 0)
77
+ continue;
78
+ const p = [
79
+ ...n.map((f) => `ParentFolderIdentifier:${S(String(f))}`),
80
+ ...n.map((f) => `ParentAlbumIdentifier:${S(String(f))}`)
81
+ ];
82
+ t.push(`(${p.join(" OR ")})`);
72
83
  continue;
73
84
  }
74
- t.push(P(u, i));
85
+ t.push(b(u, a));
75
86
  }
76
87
  }
77
88
  return t.join(" AND ");
@@ -89,12 +100,12 @@ function D(e) {
89
100
  }
90
101
  return te(e);
91
102
  }
92
- const S = "CoreField.LargeSizePreview", b = "CoreField.DocType", re = "Document.Title", oe = "Document.CaptionLong", M = "Document.FileExtension", G = "CoreField.FileSize", U = "CoreField.Identifier", v = "CoreField.Keywords", j = "CoreField.MaxHeight", W = "CoreField.MaxWidth", T = "Document.RecordID", w = "CoreField.DocSubType", x = "CoreField.TitleWithFallback", h = "CoreField.OriginalFileName", y = "CoreField.UpdatedFileName", A = "CoreField.OriginalPreview", L = {
103
+ const g = "CoreField.LargeSizePreview", M = "CoreField.DocType", re = "Document.Title", oe = "Document.CaptionLong", G = "Document.FileExtension", U = "CoreField.FileSize", v = "CoreField.Identifier", j = "CoreField.Keywords", W = "CoreField.MaxHeight", w = "CoreField.MaxWidth", T = "Document.RecordID", H = "CoreField.DocSubType", x = "CoreField.TitleWithFallback", h = "CoreField.OriginalFileName", y = "CoreField.UpdatedFileName", A = "CoreField.OriginalPreview", L = {
93
104
  DEFAULT_VIEW_SIZE: "Document.LargeSizePreview",
94
105
  FIELD_TITLE_WITH_FALLBACK: "Document.TitleWithFallback",
95
106
  ORIGINAL_VIEW_SIZE: "Document.OriginalPreview"
96
107
  }, k = {
97
- [S]: L.DEFAULT_VIEW_SIZE,
108
+ [g]: L.DEFAULT_VIEW_SIZE,
98
109
  [x]: L.FIELD_TITLE_WITH_FALLBACK,
99
110
  [A]: L.ORIGINAL_VIEW_SIZE
100
111
  }, ne = Object.fromEntries(
@@ -109,8 +120,8 @@ function se(e) {
109
120
  function ae(e) {
110
121
  const t = {};
111
122
  for (const [o, r] of Object.entries(e)) {
112
- const i = ne[o] ?? o;
113
- t[i] = r;
123
+ const a = ne[o] ?? o;
124
+ t[a] = r;
114
125
  }
115
126
  return t;
116
127
  }
@@ -119,41 +130,41 @@ async function B({
119
130
  countPerPage: t,
120
131
  fields: o,
121
132
  getPermanentAssetsPaths: r,
122
- pageNumber: i,
133
+ pageNumber: a,
123
134
  query: u,
124
- siteUrl: s,
125
- sort: f,
126
- token: m,
135
+ siteUrl: n,
136
+ sort: p,
137
+ token: f,
127
138
  useSession: I
128
139
  }) {
129
140
  const E = o?.map(se);
130
141
  try {
131
142
  return (await l.request({
132
- baseURL: s,
133
- headers: m ? { Authorization: `Bearer ${m}` } : void 0,
143
+ baseURL: n,
144
+ headers: f ? { Authorization: `Bearer ${f}` } : void 0,
134
145
  method: "GET",
135
146
  params: {
136
147
  CMS5Token: e || void 0,
137
148
  CountPerPage: t,
138
- Fields: z(E),
149
+ Fields: X(E),
139
150
  Format: "json",
140
151
  GetPermanentAssetsPaths: r || void 0,
141
- PageNumber: i,
152
+ PageNumber: a,
142
153
  Query: D(u),
143
- Sort: f || void 0,
154
+ Sort: p || void 0,
144
155
  UseSession: I || void 0
145
156
  },
146
157
  paramsSerializer: { indexes: null },
147
158
  responseType: "json",
148
159
  transformResponse: [
149
160
  ...Array.isArray(l.defaults.transformResponse) ? l.defaults.transformResponse : [],
150
- (n) => ({
151
- items: (n.APIResponse?.Items ?? []).map(ae),
152
- sort: n.APIResponse?.GlobalInfo?.Sort ?? "",
153
- totalCount: n.APIResponse?.GlobalInfo?.TotalCount ?? 0
161
+ (s) => ({
162
+ items: (s.APIResponse?.Items ?? []).map(ae),
163
+ sort: s.APIResponse?.GlobalInfo?.Sort ?? "",
164
+ totalCount: s.APIResponse?.GlobalInfo?.TotalCount ?? 0
154
165
  })
155
166
  ],
156
- url: $["4.0"]
167
+ url: K["4.0"]
157
168
  })).data;
158
169
  } catch {
159
170
  return { items: [], sort: "", totalCount: 0 };
@@ -164,9 +175,9 @@ async function De({
164
175
  extension: t,
165
176
  format: o,
166
177
  siteUrl: r,
167
- token: i,
178
+ token: a,
168
179
  transformations: u,
169
- useSession: s
180
+ useSession: n
170
181
  }) {
171
182
  try {
172
183
  return (await l.request({
@@ -175,17 +186,17 @@ async function De({
175
186
  params: {
176
187
  SourceAssetFormat: o,
177
188
  SourceAssetRecordID: e,
178
- TargetExtension: V(t),
179
- Token: i || void 0,
189
+ TargetExtension: Z(t),
190
+ Token: a || void 0,
180
191
  Transformations: u,
181
- UseSession: s || void 0
192
+ UseSession: n || void 0
182
193
  },
183
194
  /**
184
195
  * https://link.orangelogic.com/Tasks/41S1XH
185
196
  */
186
197
  timeout: 3e5,
187
198
  // 5 minutes
188
- url: H.GET_TRANSFORM_ASSET_LINK
199
+ url: $.GET_TRANSFORM_ASSET_LINK
189
200
  })).data;
190
201
  } catch {
191
202
  return null;
@@ -203,11 +214,11 @@ async function Te({
203
214
  extraFields: t,
204
215
  getPermanentAssetsPaths: o,
205
216
  recordIds: r,
206
- token: i
217
+ token: a
207
218
  }) {
208
219
  if (!Array.isArray(r) || r.length === 0)
209
220
  return { facets: [], items: [], totalCount: 0 };
210
- const u = t?.filter((n) => n && typeof n == "string") ?? [], s = [
221
+ const u = t?.filter((s) => s && typeof s == "string") ?? [], n = [
211
222
  ...u,
212
223
  A,
213
224
  y,
@@ -215,74 +226,74 @@ async function Te({
215
226
  re,
216
227
  oe,
217
228
  T
218
- ], f = ce(r, ie), m = await Promise.all(
219
- f.map(
220
- (n) => B({
229
+ ], p = ce(r, ie), f = await Promise.all(
230
+ p.map(
231
+ (s) => B({
221
232
  cms5Token: e,
222
- countPerPage: n.length,
223
- fields: s,
233
+ countPerPage: s.length,
234
+ fields: n,
224
235
  getPermanentAssetsPaths: o,
225
236
  pageNumber: 1,
226
- query: { recordId: n },
227
- token: i
237
+ query: { recordId: s },
238
+ token: a
228
239
  })
229
240
  )
230
- ), I = new Map(r.map((n, d) => [n, d])), E = m.flatMap((n) => n.items).map((n) => {
231
- let d = c(n, y);
232
- return d === "" && (d = c(n, h)), {
241
+ ), I = new Map(r.map((s, d) => [s, d])), E = f.flatMap((s) => s.items).map((s) => {
242
+ let d = c(s, y);
243
+ return d === "" && (d = c(s, h)), {
233
244
  name: d,
234
- originalUrl: c(n, A),
235
- recordId: c(n, T),
245
+ originalUrl: c(s, A),
246
+ recordId: c(s, T),
236
247
  ...u.reduce(
237
- (a, p) => (a[p] = c(n, p), a),
248
+ (i, m) => (i[m] = c(s, m), i),
238
249
  {}
239
250
  )
240
251
  };
241
252
  }).sort(
242
- (n, d) => (I.get(n.recordId) ?? 1 / 0) - (I.get(d.recordId) ?? 1 / 0)
243
- ), _ = m.reduce(
244
- (n, d) => n + d.totalCount,
253
+ (s, d) => (I.get(s.recordId) ?? 1 / 0) - (I.get(d.recordId) ?? 1 / 0)
254
+ ), _ = f.reduce(
255
+ (s, d) => s + d.totalCount,
245
256
  0
246
257
  );
247
258
  return { facets: [], items: E, totalCount: _ };
248
259
  }
249
260
  function c(e, t) {
250
261
  const o = e[t];
251
- return o == null ? "" : typeof o == "string" ? o : typeof o == "number" || typeof o == "boolean" ? String(o) : X(o) ? o.URI : "";
262
+ return o == null ? "" : typeof o == "string" ? o : typeof o == "number" || typeof o == "boolean" ? String(o) : Y(o) ? o.URI : "";
252
263
  }
253
264
  async function he({
254
265
  cms5Token: e,
255
266
  countPerPage: t,
256
267
  extraFields: o,
257
268
  getPermanentAssetsPaths: r,
258
- limitedDocTypes: i,
269
+ limitedDocTypes: a,
259
270
  pageNumber: u,
260
- parentFolderIdentifier: s,
261
- searchTerm: f,
262
- sortOrder: m,
271
+ parentFolderIdentifier: n,
272
+ searchTerm: p,
273
+ sortOrder: f,
263
274
  token: I
264
275
  }) {
265
- if (!s)
276
+ if (!n)
266
277
  return { facets: [], items: [], totalCount: 0 };
267
- const E = (o?.filter((a) => a && typeof a == "string") ?? []).map((a) => a.replace("%20", " ")), _ = {
268
- parentFolderIdentifier: s,
269
- ...i.length > 0 ? { docType: [O.Image, O.Audio] } : {}
270
- }, n = await B({
278
+ const E = (o?.filter((i) => i && typeof i == "string") ?? []).map((i) => i.replace("%20", " ")), _ = {
279
+ parentFolderIdentifier: n,
280
+ ...a.length > 0 ? { docType: [P.Image, P.Audio] } : {}
281
+ }, s = await B({
271
282
  cms5Token: e,
272
283
  countPerPage: t,
273
284
  fields: [
274
285
  ...E,
275
286
  x,
276
- S,
287
+ g,
277
288
  A,
278
- v,
279
- W,
280
289
  j,
281
- G,
282
- b,
283
290
  w,
291
+ W,
284
292
  U,
285
293
  M,
294
+ H,
295
+ v,
296
+ G,
286
297
  T,
287
298
  h,
288
299
  y
@@ -292,26 +303,26 @@ async function he({
292
303
  query: _,
293
304
  sort: void 0,
294
305
  token: I
295
- }), d = n.items.map((a) => {
296
- let p = c(a, M), F = c(a, y), C = c(a, S);
297
- p && !p.startsWith(".") && (p = "." + p), F === "" && (F = c(a, h)), p.toLowerCase() === ".gif" && (C = c(a, A));
298
- const g = c(a, T);
306
+ }), d = s.items.map((i) => {
307
+ let m = c(i, G), F = c(i, y), C = c(i, g);
308
+ m && !m.startsWith(".") && (m = "." + m), F === "" && (F = c(i, h)), m.toLowerCase() === ".gif" && (C = c(i, A));
309
+ const R = c(i, T);
299
310
  return {
300
- docSubType: c(a, w),
301
- docType: c(a, b) || "",
302
- extension: p,
303
- height: c(a, j) || "0",
304
- id: g,
305
- identifier: c(a, U),
311
+ docSubType: c(i, H),
312
+ docType: c(i, M) || "",
313
+ extension: m,
314
+ height: c(i, W) || "0",
315
+ id: R,
316
+ identifier: c(i, v),
306
317
  imageUrl: C,
307
318
  name: F,
308
- originalUrl: c(a, A),
309
- recordId: g,
310
- size: c(a, G) || "0 MB",
311
- tags: c(a, v),
312
- width: c(a, W) || "0",
319
+ originalUrl: c(i, A),
320
+ recordId: R,
321
+ size: c(i, U) || "0 MB",
322
+ tags: c(i, j),
323
+ width: c(i, w) || "0",
313
324
  ...E.reduce(
314
- (N, R) => (N[R] = c(a, R), N),
325
+ (N, O) => (N[O] = c(i, O), N),
315
326
  {}
316
327
  )
317
328
  };
@@ -319,7 +330,7 @@ async function he({
319
330
  return {
320
331
  facets: [],
321
332
  items: d,
322
- totalCount: n.totalCount
333
+ totalCount: s.totalCount
323
334
  };
324
335
  }
325
336
  async function ye({
@@ -327,7 +338,7 @@ async function ye({
327
338
  cropHeight: t,
328
339
  cropWidth: o,
329
340
  imageUrl: r,
330
- useSession: i
341
+ useSession: a
331
342
  }) {
332
343
  try {
333
344
  return (await l.request({
@@ -337,21 +348,21 @@ async function ye({
337
348
  CropHeight: t,
338
349
  CropWidth: o,
339
350
  ImageUrl: r && new URL(r, window.location.origin).href,
340
- UseSession: i || void 0
351
+ UseSession: a || void 0
341
352
  },
342
353
  responseType: "json",
343
354
  timeout: 3e5,
344
355
  // 5 minutes
345
356
  transformResponse: [
346
357
  ...Array.isArray(l.defaults.transformResponse) ? l.defaults.transformResponse : [],
347
- (s) => ({
348
- height: s.cropHeight,
349
- width: s.cropWidth,
350
- x: s.cropX,
351
- y: s.cropY
358
+ (n) => ({
359
+ height: n.cropHeight,
360
+ width: n.cropWidth,
361
+ x: n.cropX,
362
+ y: n.cropY
352
363
  })
353
364
  ],
354
- url: H.GET_CROP_ZONE_SUGGESTION
365
+ url: $.GET_CROP_ZONE_SUGGESTION
355
366
  })).data;
356
367
  } catch {
357
368
  return null;
@@ -375,19 +386,19 @@ async function Fe({
375
386
  responseType: "json",
376
387
  transformResponse: [
377
388
  ...Array.isArray(l.defaults.transformResponse) ? l.defaults.transformResponse : [],
378
- (u) => !u || typeof u != "object" ? [] : u.proxies?.map((s) => ({
379
- cdnName: s.cdnName,
380
- extension: s.extension,
381
- formatHeight: s.formatHeight,
382
- formatWidth: s.formatWidth,
383
- height: s.height,
384
- permanentLink: s.permanentLink,
385
- proxyLabel: s.proxyLabel,
386
- proxyName: s.proxyName,
387
- width: s.width
389
+ (u) => !u || typeof u != "object" ? [] : u.proxies?.map((n) => ({
390
+ cdnName: n.cdnName,
391
+ extension: n.extension,
392
+ formatHeight: n.formatHeight,
393
+ formatWidth: n.formatWidth,
394
+ height: n.height,
395
+ permanentLink: n.permanentLink,
396
+ proxyLabel: n.proxyLabel,
397
+ proxyName: n.proxyName,
398
+ width: n.width
388
399
  })) ?? []
389
400
  ],
390
- url: q
401
+ url: V
391
402
  })).data;
392
403
  } catch {
393
404
  return [];
@@ -414,14 +425,14 @@ async function Le({
414
425
  formatsByDocType: o.formatsByDocType ?? {}
415
426
  }
416
427
  ],
417
- url: K
428
+ url: q
418
429
  })).data;
419
430
  } catch {
420
431
  return { formatsByDocType: {} };
421
432
  }
422
433
  }
423
434
  export {
424
- S as D,
435
+ g as D,
425
436
  T as F,
426
437
  A as O,
427
438
  Te as a,
@@ -430,14 +441,14 @@ export {
430
441
  Le as d,
431
442
  B as e,
432
443
  he as f,
433
- j as g,
434
- W as h,
435
- X as i,
436
- b as j,
437
- M as k,
438
- U as l,
444
+ W as g,
445
+ w as h,
446
+ Y as i,
447
+ M as j,
448
+ G as k,
449
+ v as l,
439
450
  Fe as m,
440
- G as n,
441
- w as o,
442
- z as u
451
+ U as n,
452
+ H as o,
453
+ X as u
443
454
  };
@@ -30,7 +30,7 @@ import { n as N } from "./when.Dr1es41R.js";
30
30
  import { t as Q } from "./toString.CAY8lys2.js";
31
31
  import { C as ee } from "./icon-button.ztYU-DHy.js";
32
32
  import { C as te } from "./image.DKB6yEQO.js";
33
- import { a as ae } from "./asset.CQrdW8Hz.js";
33
+ import { a as ae } from "./asset.NgymQ3Zx.js";
34
34
  import { a as ie } from "./index.Cpamj0jB.js";
35
35
  import { A as g } from "./content-builder.OsUmm8Wu.js";
36
36
  import { b as ne, t as I } from "./string.DUgD4c9f.js";
@@ -3,7 +3,7 @@ import { C as B } from "../chunks/button.i88sSbTZ.js";
3
3
  import _ from "./space.js";
4
4
  import { C as F } from "../chunks/typography.DJC_UXgs.js";
5
5
  import { n, C as W } from "../chunks/lib-cortex-element.CVMmyPMC.js";
6
- import { b as rt, c as ht } from "../chunks/asset.CQrdW8Hz.js";
6
+ import { b as rt, c as ht } from "../chunks/asset.NgymQ3Zx.js";
7
7
  import { c as E } from "../chunks/component.styles.CRO4Odto.js";
8
8
  import { U as a, T as l } from "../chunks/asset-link-format.B0c92pSs.js";
9
9
  import { c as N } from "../chunks/custom-element.L4WJXn1j.js";
@@ -18,7 +18,7 @@ import "../chunks/custom-element.L4WJXn1j.js";
18
18
  import "../chunks/debounce.CIEhztrj.js";
19
19
  import "../chunks/i18n.D6AYDPK-.js";
20
20
  import "../chunks/watch.CThbualB.js";
21
- import { c as E, C as F } from "../chunks/list-editor.CFPfAJpF.js";
21
+ import { c as E, C as F } from "../chunks/list-editor.GT2kQsmR.js";
22
22
  import "../chunks/lit-element.jLBm65_O.js";
23
23
  import "../chunks/state.CSDxrqLd.js";
24
24
  import "../chunks/query.BBf1UFkC.js";
@@ -6,7 +6,7 @@ import { default as s } from "./corner-position-input-group.js";
6
6
  import { default as m } from "./cropper.js";
7
7
  import { default as i } from "./dynamic-select.js";
8
8
  import { C as c } from "../chunks/folder-select.ByNUfTia.js";
9
- import { C as P } from "../chunks/list-editor.CFPfAJpF.js";
9
+ import { C as P } from "../chunks/list-editor.GT2kQsmR.js";
10
10
  import { default as I } from "./masonry.js";
11
11
  import { default as y } from "./padding-input-group.js";
12
12
  import { default as w } from "./position-picker.js";