@orangelogic/design-system 2.192.0 → 2.193.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.
@@ -48,7 +48,7 @@ import "./form.DSsy3Fcy.js";
48
48
  import "./purify.es.BIuh5IAZ.js";
49
49
  import { D as Ur, a as sa, t as oa, b as Kr } from "./date-picker.BGHn6qg8.js";
50
50
  import { D as Ti } from "./content-builder.BX4pHujE.js";
51
- import "./transformation.BfIEi4p4.js";
51
+ import "./transformation.CkwgrwKQ.js";
52
52
  import { s as P, h as Bo, b as Ui, c as lo } from "./string.CfI2ejyR.js";
53
53
  import { a as ra } from "./_commonjsHelpers.DQNKXVTB.js";
54
54
  import { d as na } 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.BfIEi4p4.js";
28
+ import "./transformation.CkwgrwKQ.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";
@@ -35,7 +35,7 @@ import { a as ObjectFit } from "./index.Cpamj0jB.js";
35
35
  import { r as r$1 } from "./state.CSDxrqLd.js";
36
36
  import { e } from "./class-map.BiVq-cVR.js";
37
37
  import { n as n$1 } from "./when.Dr1es41R.js";
38
- import { C as CxImage } from "./image.CiQwSDfe.js";
38
+ import { C as CxImage } from "./image.BSvc6eti.js";
39
39
  var BookReaderMode$1 = /* @__PURE__ */ ((l) => (l.Image = "Image", l.Pdf = "Pdf", l))(BookReaderMode$1 || {}), BookReaderViewMode = /* @__PURE__ */ ((l) => (l.FourPage = "FourPage", l.OnePage = "OnePage", l.TwoPage = "TwoPage", l))(BookReaderViewMode || {});
40
40
  function commonjsRequire(l) {
41
41
  throw new Error('Could not dynamically require "' + l + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');
@@ -575,13 +575,17 @@ let n = class extends Re {
575
575
  [`image--height-${this.heightMode}`]: !0,
576
576
  "image--can-zoom": this.canZoom,
577
577
  "image--has-action": this.hasZoomAction,
578
- "image--hidden": !this.currentSrc && !this.placeholder || this.isError || this.isRetrying
578
+ "image--hidden": this.isEmpty || this.isError || this.isRetrying
579
579
  };
580
580
  }
581
581
  /** The crossorigin value for the `<img>`; `undefined` (attribute omitted) when `noCrossorigin` is set. */
582
582
  get crossorigin() {
583
583
  return this.noCrossorigin ? void 0 : "anonymous";
584
584
  }
585
+ /** Whether there is nothing to display: no source and no placeholder to stand in for one. */
586
+ get isEmpty() {
587
+ return !this.currentSrc && !this.placeholder;
588
+ }
585
589
  /**
586
590
  * Whether to hold the box with a skeleton rather than the loaded image.
587
591
  *
@@ -591,7 +595,7 @@ let n = class extends Re {
591
595
  * which reads as a layout change on an image-heavy page.
592
596
  */
593
597
  get showPlaceholderSkeleton() {
594
- return this.isError ? !1 : this.skeleton && !this.isLoaded || this.loading || this.isRetrying;
598
+ return this.isError ? !1 : this.isEmpty ? this.loading : this.skeleton && !this.isLoaded || this.loading || this.isRetrying;
595
599
  }
596
600
  /**
597
601
  * Whether the image have zoom action.
@@ -713,16 +717,16 @@ let n = class extends Re {
713
717
  )}</div>`;
714
718
  }
715
719
  render() {
716
- const i = this.hasZoomAction, t = this.currentAltValue, o = !this.currentSrc && !this.placeholder;
720
+ const i = this.hasZoomAction, t = this.currentAltValue;
717
721
  return L`<div part="base" class=${S({
718
722
  container: !0,
719
- "container--empty": o,
723
+ "container--empty": this.isEmpty,
720
724
  "container--loading": this.loading,
721
725
  "container--resizing": this.resizable && this.isResizeActive
722
726
  })} style=${Me({
723
727
  "--easing": this.easeCSSVariable
724
- })} data-empty-label=${this.localize.term("emptyImage")} @click=${this.startResizing} @keydown=${this.handleKeyDown}><cx-resize-observer @cx-resize=${this.handleResize}><div part="highlighter" tabindex=${R(this.highlighterTabindex)} role=${this.highlighterRole} aria-label=${t} aria-roledescription=${this.localize.term("image")} class=${S(o ? {} : this.getHighlighterClass(this.isError))} @click=${this.handleClickAction} @mouseenter=${this.handleMouseEnter} @mouseleave=${this.handleMouseLeave} @blur=${this.handleBlur}>${A(
725
- o,
728
+ })} data-empty-label=${this.localize.term("emptyImage")} @click=${this.startResizing} @keydown=${this.handleKeyDown}><cx-resize-observer @cx-resize=${this.handleResize}><div part="highlighter" tabindex=${R(this.highlighterTabindex)} role=${this.highlighterRole} aria-label=${t} aria-roledescription=${this.localize.term("image")} class=${S(this.isEmpty ? {} : this.getHighlighterClass(this.isError))} @click=${this.handleClickAction} @mouseenter=${this.handleMouseEnter} @mouseleave=${this.handleMouseLeave} @blur=${this.handleBlur}>${A(
729
+ this.isEmpty,
726
730
  () => X,
727
731
  () => A(
728
732
  this.effect === K.Jump || this.effect === K.Zoom,
@@ -0,0 +1,312 @@
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({
15
+ asset: t,
16
+ baseUrl: n,
17
+ extension: i,
18
+ options: d,
19
+ parameters: u,
20
+ transformations: r,
21
+ useSession: l = ""
22
+ }) {
23
+ if (n == null)
24
+ return "";
25
+ let s = n;
26
+ const h = r?.findLast(
27
+ (c) => c.key === m.Quality
28
+ );
29
+ if (h && (r = [
30
+ ...r?.filter(
31
+ (c) => c.key !== m.Quality
32
+ ) || [],
33
+ h
34
+ ]), r) {
35
+ const c = [];
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; )
41
+ e++, o += r[e].value.rotation ?? 0;
42
+ o !== 0 && c.push({ key: m.Rotate, value: { rotation: o } });
43
+ } else
44
+ c.push(f);
45
+ }
46
+ r = c;
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) {
51
+ s += `re_ar_${e.ratioWidth}:${e.ratioHeight}/`;
52
+ return;
53
+ }
54
+ const f = [
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((o) => o.value !== void 0).map((o) => ({
65
+ key: o.key,
66
+ value: Math.round(Number(o.value))
67
+ })),
68
+ {
69
+ key: "re_rm_",
70
+ value: "stretch"
71
+ }
72
+ ];
73
+ f.forEach(({ key: o, value: _ }, k) => {
74
+ s += `${o}${_}${k < f.length - 1 ? "," : ""}`;
75
+ }), s += "/";
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 = [
79
+ ...[
80
+ {
81
+ key: "c_",
82
+ value: e.mode
83
+ },
84
+ ...f ? [
85
+ {
86
+ key: "ar_",
87
+ value: `${e.ratioWidth}:${e.ratioHeight}`
88
+ }
89
+ ] : [],
90
+ ...o ? [
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 && d?.omitZeroXY ? void 0 : Math.round(e.x ?? 0)
102
+ },
103
+ {
104
+ key: "c_y_",
105
+ value: Math.round(e.y ?? 0) === 0 && d?.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: N[e.position]
118
+ }
119
+ ] : []
120
+ ].filter((T) => T.value !== void 0 && T.value !== null).map((T) => ({
121
+ key: T.key,
122
+ value: T.value
123
+ })),
124
+ ...f ? [] : [
125
+ {
126
+ key: "c_whu_",
127
+ value: "pixel"
128
+ }
129
+ ]
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 ? "," : ""}`;
134
+ }), s += "/";
135
+ }
136
+ if (c === m.Rotate && ([
137
+ {
138
+ key: "r_a_",
139
+ value: e.rotation
140
+ }
141
+ ].filter((o) => o.value !== void 0).map((o) => ({
142
+ key: o.key,
143
+ value: Math.round(Number(o.value))
144
+ })).forEach(({ key: o, value: _ }) => {
145
+ s += `${o}${_}`;
146
+ }), s += "/"), c === m.Quality) {
147
+ const f = [
148
+ {
149
+ key: "q_level_",
150
+ value: e.quality
151
+ }
152
+ ].filter((o) => o.value !== void 0).map((o) => ({
153
+ key: o.key,
154
+ value: Math.round(Number(o.value))
155
+ }));
156
+ f.forEach(({ key: o, value: _ }, k) => {
157
+ s += `${o}${_}${k < f.length - 1 ? "," : ""}`;
158
+ }), s += "/";
159
+ }
160
+ if (c === m.Metadata) {
161
+ const f = [
162
+ {
163
+ key: "fl_keep_metadata",
164
+ value: e.keepMetadata
165
+ }
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 ? "," : ""}`;
169
+ }), s += "/";
170
+ }
171
+ }), i && (s += `${t?.identifier ?? crypto.randomUUID()}${i}`);
172
+ const a = [];
173
+ return u && u.length > 0 && u.forEach(({ key: c, value: e }) => {
174
+ a.push(
175
+ `${encodeURIComponent(c.trim())}=${encodeURIComponent(e.trim())}`
176
+ );
177
+ }), n && l && a.push(`UseSession=${encodeURIComponent(l)}`), a.length > 0 && (s += `?${a.join("&")}`), s.endsWith("/") && (s = s.slice(0, -1)), s;
178
+ }
179
+ function z(t, n) {
180
+ if (!t || !n?.length)
181
+ return t;
182
+ const i = O({ baseUrl: "", transformations: n }).replace(
183
+ /\/t\//g,
184
+ ""
185
+ );
186
+ if (!i)
187
+ return t;
188
+ const d = t.indexOf(g);
189
+ if (d < 0)
190
+ return `${t}/t/${i}`;
191
+ const u = t.slice(0, d + g.length), r = t.slice(d + g.length), l = r.indexOf("/t/");
192
+ if (l >= 0) {
193
+ const h = r.slice(0, l);
194
+ return `${u}${h}/t/${i}`;
195
+ }
196
+ const s = r.indexOf("/");
197
+ if (s >= 0) {
198
+ const h = r.slice(0, s), a = r.slice(s);
199
+ return `${u}${h}/t/${i}${a}`;
200
+ }
201
+ return `${t}/t/${i}`;
202
+ }
203
+ function F(t) {
204
+ return `re_w_${Math.round(t)}`;
205
+ }
206
+ function C(t, n) {
207
+ if (!t || !Number.isFinite(n) || n <= 0)
208
+ return t;
209
+ const i = t.indexOf(g);
210
+ if (i < 0)
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);
213
+ if (l >= 0) {
214
+ const h = r.slice(0, l), a = r.slice(
215
+ l + R.length
216
+ );
217
+ return `${u}${h}${R}${d}/${a}`;
218
+ }
219
+ const s = r.indexOf("/");
220
+ if (s >= 0) {
221
+ const h = r.slice(0, s), a = r.slice(s);
222
+ return `${u}${h}${R}${d}${a}`;
223
+ }
224
+ return `${u}${r}${R}${d}`;
225
+ }
226
+ function W(t) {
227
+ const n = t.indexOf(g);
228
+ return n < 0 ? !1 : t.slice(n + g.length).includes(R);
229
+ }
230
+ const A = "TRX", M = "TR1", w = /* @__PURE__ */ new Set(["gif", "png", "tif", "tiff"]);
231
+ function b(t) {
232
+ if (!t)
233
+ return "";
234
+ const n = t.trim().toLowerCase();
235
+ return n.startsWith(".") ? n.slice(1) : n;
236
+ }
237
+ function L(t) {
238
+ return b(t) === "gif";
239
+ }
240
+ const U = 10 * 1024 * 1024, B = {
241
+ b: 1,
242
+ byte: 1,
243
+ bytes: 1,
244
+ gb: 1024 ** 3,
245
+ kb: 1024,
246
+ mb: 1024 ** 2,
247
+ tb: 1024 ** 4
248
+ };
249
+ function G(t) {
250
+ if (typeof t == "number")
251
+ return Number.isFinite(t) && t >= 0 ? t : void 0;
252
+ if (!t)
253
+ return;
254
+ const n = /^\s*([\d.,]+)\s*([a-z]*)\s*$/i.exec(t);
255
+ if (!n)
256
+ return;
257
+ const i = Number(n[1].replace(/,/g, ""));
258
+ if (!Number.isFinite(i) || i < 0)
259
+ return;
260
+ const d = n[2].toLowerCase();
261
+ if (!d)
262
+ return i;
263
+ const u = B[d];
264
+ return u === void 0 ? void 0 : i * u;
265
+ }
266
+ function D(t, n) {
267
+ if (t)
268
+ return;
269
+ const i = typeof n == "number" ? n : Number(n ?? "");
270
+ return Number.isFinite(i) && i > 0 ? i : void 0;
271
+ }
272
+ function X(t, n) {
273
+ if (!w.has(b(t)))
274
+ return M;
275
+ const i = G(n);
276
+ return i !== void 0 && i > U ? M : A;
277
+ }
278
+ function Y(t, n = {}) {
279
+ if (!t.includes(g) || W(t) || n.format === A && L(n.extension))
280
+ 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)
283
+ return "";
284
+ let r = u;
285
+ 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]];
288
+ }
289
+ const l = i !== void 0 && Number.isFinite(i) && i > 0, h = (l ? r.filter(
290
+ (a) => i > a * (1 + E)
291
+ ) : r).map(
292
+ (a) => `${C(t, a)} ${a}w`
293
+ );
294
+ return l && h.push(`${t} ${i}w`), h.join(", ");
295
+ }
296
+ function H(t, n = 100) {
297
+ return !Number.isFinite(t) || t <= 0 ? "" : `${Math.ceil(t / n) * n}px`;
298
+ }
299
+ export {
300
+ M as A,
301
+ 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
312
+ };
@@ -3,7 +3,7 @@ import "../chunks/button.BnkkUqiI.js";
3
3
  import "./space.js";
4
4
  import "../chunks/typography.IqHbnd3C.js";
5
5
  import "../chunks/lib-cortex-element.CVMmyPMC.js";
6
- import { C as h } from "../chunks/asset-link-format.CDd4iPA2.js";
6
+ import { C as h } from "../chunks/asset-link-format.BX1hdLgZ.js";
7
7
  import "../chunks/component.styles.CRO4Odto.js";
8
8
  import "../chunks/asset-link-format.ClaYu_v8.js";
9
9
  import "../chunks/position-picker.DjnhxIKF.js";
@@ -11,7 +11,7 @@ import "../chunks/custom-element.L4WJXn1j.js";
11
11
  import "../chunks/i18n.DbXTTLXx.js";
12
12
  import "../chunks/watch.DJF5K-8U.js";
13
13
  import "../chunks/number.Cx2ncfJJ.js";
14
- import "../chunks/transformation.BfIEi4p4.js";
14
+ import "../chunks/transformation.CkwgrwKQ.js";
15
15
  import "../chunks/lit-element.jLBm65_O.js";
16
16
  import "../chunks/state.CSDxrqLd.js";
17
17
  import "../chunks/when.Dr1es41R.js";
@@ -20,7 +20,7 @@ import { default as W } from "./details.js";
20
20
  import { default as Y } from "./diff.js";
21
21
  import { C as _ } from "../chunks/dialog.B6hZ7fvn.js";
22
22
  import { default as oe } from "./divider.js";
23
- import { C as ae } from "../chunks/document-viewer.CRluR-_W.js";
23
+ import { C as ae } from "../chunks/document-viewer.DZsbpf0x.js";
24
24
  import { C as xe } from "../chunks/dot-pagination.BqGFeFXK.js";
25
25
  import { default as me } from "./dot-status.js";
26
26
  import { default as pe } from "./drawer.js";
@@ -39,7 +39,7 @@ import { f } from "../chunks/icon.CpHbi8tH.js";
39
39
  import { C as Fe } from "../chunks/icon.CpHbi8tH.js";
40
40
  import { C as Oe } from "../chunks/icon-button.CVrxJcZq.js";
41
41
  import { C as Ee } from "../chunks/iframe.-GCTFas1.js";
42
- import { C as Le } from "../chunks/image.CiQwSDfe.js";
42
+ import { C as Le } from "../chunks/image.BSvc6eti.js";
43
43
  import { default as je } from "./image-comparer.js";
44
44
  import { default as Qe } from "./include.js";
45
45
  import { C as qe } from "../chunks/input.33UmFGqR.js";
@@ -3,7 +3,7 @@ import "../chunks/typography.IqHbnd3C.js";
3
3
  import "../chunks/lib-cortex-element.CVMmyPMC.js";
4
4
  import "../chunks/color-swatch.D6Gg5bpz.js";
5
5
  import "../chunks/component.styles.CRO4Odto.js";
6
- import { C as v } from "../chunks/color-swatch-group.NOcRP-23.js";
6
+ import { C as v } from "../chunks/color-swatch-group.BpEQJM1b.js";
7
7
  import "../chunks/content-builder.BX4pHujE.js";
8
8
  import "../chunks/custom-element.L4WJXn1j.js";
9
9
  import "../chunks/debounce.DaHuiSGU.js";
@@ -1,5 +1,5 @@
1
1
  import "../chunks/resizable-component.styles.CAfXABBc.js";
2
- import { C as b } from "../chunks/document-viewer.CRluR-_W.js";
2
+ import { C as b } from "../chunks/document-viewer.DZsbpf0x.js";
3
3
  import "../chunks/component.styles.CRO4Odto.js";
4
4
  import "../chunks/index.Cpamj0jB.js";
5
5
  import "../chunks/custom-element.L4WJXn1j.js";
@@ -10,7 +10,7 @@ import "../chunks/state.CSDxrqLd.js";
10
10
  import "../chunks/class-map.BiVq-cVR.js";
11
11
  import "../chunks/when.Dr1es41R.js";
12
12
  import "../chunks/icon.CpHbi8tH.js";
13
- import "../chunks/image.CiQwSDfe.js";
13
+ import "../chunks/image.BSvc6eti.js";
14
14
  import "../chunks/typography.IqHbnd3C.js";
15
15
  export {
16
16
  b as default
@@ -1,7 +1,7 @@
1
1
  import "../chunks/resizable-component.styles.CAfXABBc.js";
2
2
  import "../chunks/component.styles.CRO4Odto.js";
3
3
  import "../chunks/index.Cpamj0jB.js";
4
- import { C as w } from "../chunks/image.CiQwSDfe.js";
4
+ import { C as w } from "../chunks/image.BSvc6eti.js";
5
5
  import "../chunks/custom-element.L4WJXn1j.js";
6
6
  import "../chunks/debounce.DaHuiSGU.js";
7
7
  import "../chunks/i18n.DbXTTLXx.js";
@@ -1,32 +1,32 @@
1
- import _ from "./grid.js";
2
- import v from "./grid-item.js";
3
- import { C as $ } from "../chunks/icon-button.CVrxJcZq.js";
4
- import { C as S } from "../chunks/image.CiQwSDfe.js";
5
- import C from "./space.js";
6
- import I from "./tooltip.js";
7
- import { n as o, C as w } from "../chunks/lib-cortex-element.CVMmyPMC.js";
8
- import { c as k } from "../chunks/component.styles.CRO4Odto.js";
1
+ import v from "./grid.js";
2
+ import $ from "./grid-item.js";
3
+ import { C as S } from "../chunks/icon-button.CVrxJcZq.js";
4
+ import { C } from "../chunks/image.BSvc6eti.js";
5
+ import I from "./space.js";
6
+ import w from "./tooltip.js";
7
+ import { n as o, C as k } from "../chunks/lib-cortex-element.CVMmyPMC.js";
8
+ import { c as F } from "../chunks/component.styles.CRO4Odto.js";
9
9
  import { a as b } from "../chunks/index.Cpamj0jB.js";
10
10
  import { c as A } from "../chunks/custom-element.L4WJXn1j.js";
11
- import { w as F } from "../chunks/watch.DJF5K-8U.js";
12
- import { r as U, b as f } from "../chunks/transformation.BfIEi4p4.js";
13
- import { i as z, x as n } from "../chunks/lit-element.jLBm65_O.js";
11
+ import { w as U } from "../chunks/watch.DJF5K-8U.js";
12
+ import { r as z, b as f, a as _ } from "../chunks/transformation.CkwgrwKQ.js";
13
+ import { i as E, x as n } from "../chunks/lit-element.jLBm65_O.js";
14
14
  import { r as x } from "../chunks/state.CSDxrqLd.js";
15
- import { e as E } from "../chunks/query.BBf1UFkC.js";
15
+ import { e as j } from "../chunks/query.BBf1UFkC.js";
16
16
  import { e as h } from "../chunks/class-map.BiVq-cVR.js";
17
17
  import { o as c } from "../chunks/if-defined.BRoBj_Rp.js";
18
18
  import { c as g } from "../chunks/repeat.CFjcER6_.js";
19
19
  import { o as u } from "../chunks/style-map.llVFPd__.js";
20
20
  import { n as y } from "../chunks/when.Dr1es41R.js";
21
- import { S as j } from "../chunks/sortable.esm.oSzf6C5Q.js";
21
+ import { S as D } from "../chunks/sortable.esm.oSzf6C5Q.js";
22
22
  var d = /* @__PURE__ */ ((t) => (t.Masonry = "masonry", t.Standard = "standard", t))(d || {});
23
- const D = z`:host{--actions-background-color:var(--cx-color-neutral-100);--border-radius:0px;--item-border-radius:var(--cx-border-radius-medium);--padding:0px;--width:100%;--height:auto;width:var(--width,100%);height:var(--height,100%);display:block;overflow:auto}:host([spacing="3x-small"]){--spacing-container-gap:var(--cx-spacing-3x-small)}:host([spacing="2x-small"]){--spacing-container-gap:var(--cx-spacing-2x-small)}:host([spacing=x-small]){--spacing-container-gap:var(--cx-spacing-x-small)}:host([spacing=small]){--spacing-container-gap:var(--cx-spacing-small)}:host([spacing=medium]){--spacing-container-gap:var(--cx-spacing-medium)}:host([spacing=large]){--spacing-container-gap:var(--cx-spacing-large)}:host([spacing=x-large]){--spacing-container-gap:var(--cx-spacing-x-large)}:host([spacing="2x-large"]){--spacing-container-gap:var(--cx-spacing-2x-large)}:host([spacing="3x-large"]){--spacing-container-gap:var(--cx-spacing-3x-large)}:host([spacing="4x-large"]){--spacing-container-gap:var(--cx-spacing-4x-large)}.masonry-list{column-gap:var(--spacing-container-gap)}.masonry-list__item{border-radius:var(--item-border-radius);display:block;position:relative;overflow:hidden}.masonry-list__item--error:before{content:"";border:2px solid var(--cx-color-danger);border-radius:var(--item-border-radius);z-index:1;width:100%;height:100%;position:absolute;top:0;left:0}.container--masonry .masonry-list__item{margin-bottom:var(--spacing-container-gap)}.container--standard cx-grid-item::part(base){height:100%}.masonry-list__item__image{width:100%;height:100%}.masonry-list__item__actions{opacity:0;width:100%;transition:opacity var(--cx-transition-fast) ease-in-out;z-index:10;position:absolute;bottom:0;left:0}.masonry-list__item__actions:before{content:"";background-color:var(--actions-background-color);opacity:.5;pointer-events:none;width:100%;height:100%;position:absolute;top:0;left:0}.masonry-list__item:hover .masonry-list__item__actions{opacity:1}.masonry-list__item__action{z-index:5;flex:auto;position:relative}.masonry-list__item__action::part(base){border-radius:0;width:100%}.container--sortable .masonry-list__item{cursor:move}`;
24
- var K = Object.defineProperty, M = Object.getOwnPropertyDescriptor, a = (t, i, r, s) => {
25
- for (var l = s > 1 ? void 0 : s ? M(i, r) : i, p = t.length - 1, m; p >= 0; p--)
23
+ const M = E`:host{--actions-background-color:var(--cx-color-neutral-100);--border-radius:0px;--item-border-radius:var(--cx-border-radius-medium);--padding:0px;--width:100%;--height:auto;width:var(--width,100%);height:var(--height,100%);display:block;overflow:auto}:host([spacing="3x-small"]){--spacing-container-gap:var(--cx-spacing-3x-small)}:host([spacing="2x-small"]){--spacing-container-gap:var(--cx-spacing-2x-small)}:host([spacing=x-small]){--spacing-container-gap:var(--cx-spacing-x-small)}:host([spacing=small]){--spacing-container-gap:var(--cx-spacing-small)}:host([spacing=medium]){--spacing-container-gap:var(--cx-spacing-medium)}:host([spacing=large]){--spacing-container-gap:var(--cx-spacing-large)}:host([spacing=x-large]){--spacing-container-gap:var(--cx-spacing-x-large)}:host([spacing="2x-large"]){--spacing-container-gap:var(--cx-spacing-2x-large)}:host([spacing="3x-large"]){--spacing-container-gap:var(--cx-spacing-3x-large)}:host([spacing="4x-large"]){--spacing-container-gap:var(--cx-spacing-4x-large)}.masonry-list{column-gap:var(--spacing-container-gap)}.masonry-list__item{border-radius:var(--item-border-radius);display:block;position:relative;overflow:hidden}.masonry-list__item--error:before{content:"";border:2px solid var(--cx-color-danger);border-radius:var(--item-border-radius);z-index:1;width:100%;height:100%;position:absolute;top:0;left:0}.container--masonry .masonry-list__item{margin-bottom:var(--spacing-container-gap)}.container--standard cx-grid-item::part(base){height:100%}.masonry-list__item__image{width:100%;height:100%}.masonry-list__item__actions{opacity:0;width:100%;transition:opacity var(--cx-transition-fast) ease-in-out;z-index:10;position:absolute;bottom:0;left:0}.masonry-list__item__actions:before{content:"";background-color:var(--actions-background-color);opacity:.5;pointer-events:none;width:100%;height:100%;position:absolute;top:0;left:0}.masonry-list__item:hover .masonry-list__item__actions{opacity:1}.masonry-list__item__action{z-index:5;flex:auto;position:relative}.masonry-list__item__action::part(base){border-radius:0;width:100%}.container--sortable .masonry-list__item{cursor:move}`;
24
+ var K = Object.defineProperty, B = Object.getOwnPropertyDescriptor, e = (t, i, r, s) => {
25
+ for (var l = s > 1 ? void 0 : s ? B(i, r) : i, p = t.length - 1, m; p >= 0; p--)
26
26
  (m = t[p]) && (l = (s ? m(i, r, l) : m(l)) || l);
27
27
  return s && l && K(i, r, l), l;
28
28
  };
29
- let e = class extends w {
29
+ let a = class extends k {
30
30
  constructor() {
31
31
  super(), this.data = [], this.variant = d.Standard, this.cols = 3, this.rowHeight = "auto", this.actions = [], this.sortable = !1, this.spacing = "medium", this.idKey = "id", this.format = "", this.manualFormat = !1, this.noCrossorigin = !1, this.sortableInstance = null, this.previous = [], this.abortDrag = !1, this.handleEnd = this.handleEnd.bind(this), this.handleStart = this.handleStart.bind(this), this.handleSortableUpdate = this.handleSortableUpdate.bind(this), this.handleItemClick = this.handleItemClick.bind(this);
32
32
  }
@@ -45,7 +45,7 @@ let e = class extends w {
45
45
  this.sortableInstance && (this.sortableInstance.destroy(), this.sortableInstance = null);
46
46
  }
47
47
  initSortable() {
48
- this.sortableInstance = j.create(this.list, {
48
+ this.sortableInstance = D.create(this.list, {
49
49
  animation: 100,
50
50
  onAdd: this.handleSortableUpdate,
51
51
  onEnd: this.handleEnd,
@@ -77,7 +77,7 @@ let e = class extends w {
77
77
  }
78
78
  /** The format one item is served under: the configured one, or derived from its extension. */
79
79
  resolveItemFormat(t) {
80
- return this.manualFormat ? this.format : U(t);
80
+ return this.manualFormat ? this.format : z(t);
81
81
  }
82
82
  handleItemClick(t, i) {
83
83
  this.emit("cx-masonry-select", {
@@ -129,7 +129,8 @@ let e = class extends w {
129
129
  this.handleItemClick(s, t);
130
130
  }, r = f(t.src, {
131
131
  extension: t.extension,
132
- format: this.resolveItemFormat(t.extension)
132
+ format: this.resolveItemFormat(t.extension),
133
+ maxWidth: _(this.manualFormat, t.maxWidth)
133
134
  });
134
135
  return n`<div data-id=${t[this.idKey]} class=${h({
135
136
  "masonry-list__item": !0,
@@ -147,7 +148,8 @@ let e = class extends w {
147
148
  this.handleItemClick(s, t);
148
149
  }, r = f(t.src, {
149
150
  extension: t.extension,
150
- format: this.resolveItemFormat(t.extension)
151
+ format: this.resolveItemFormat(t.extension),
152
+ maxWidth: _(this.manualFormat, t.maxWidth)
151
153
  });
152
154
  return n`<cx-grid-item xs="1"><div class=${h({
153
155
  "masonry-list__item": !0,
@@ -171,66 +173,66 @@ let e = class extends w {
171
173
  )}</div>`;
172
174
  }
173
175
  };
174
- e.styles = [k, D];
175
- e.dependencies = {
176
- "cx-grid": _,
177
- "cx-grid-item": v,
178
- "cx-icon-button": $,
179
- "cx-image": S,
180
- "cx-space": C,
181
- "cx-tooltip": I
176
+ a.styles = [F, M];
177
+ a.dependencies = {
178
+ "cx-grid": v,
179
+ "cx-grid-item": $,
180
+ "cx-icon-button": S,
181
+ "cx-image": C,
182
+ "cx-space": I,
183
+ "cx-tooltip": w
182
184
  };
183
- a([
184
- E(".masonry-list")
185
- ], e.prototype, "list", 2);
186
- a([
185
+ e([
186
+ j(".masonry-list")
187
+ ], a.prototype, "list", 2);
188
+ e([
187
189
  o({ type: Array })
188
- ], e.prototype, "data", 2);
189
- a([
190
+ ], a.prototype, "data", 2);
191
+ e([
190
192
  o({ reflect: !0, type: String })
191
- ], e.prototype, "variant", 2);
192
- a([
193
+ ], a.prototype, "variant", 2);
194
+ e([
193
195
  o({ reflect: !0, type: Number })
194
- ], e.prototype, "cols", 2);
195
- a([
196
+ ], a.prototype, "cols", 2);
197
+ e([
196
198
  o({ attribute: "row-height", type: String })
197
- ], e.prototype, "rowHeight", 2);
198
- a([
199
+ ], a.prototype, "rowHeight", 2);
200
+ e([
199
201
  o({ type: Array })
200
- ], e.prototype, "actions", 2);
201
- a([
202
+ ], a.prototype, "actions", 2);
203
+ e([
202
204
  o({ reflect: !0, type: Boolean })
203
- ], e.prototype, "sortable", 2);
204
- a([
205
+ ], a.prototype, "sortable", 2);
206
+ e([
205
207
  o({ reflect: !0, type: String })
206
- ], e.prototype, "spacing", 2);
207
- a([
208
+ ], a.prototype, "spacing", 2);
209
+ e([
208
210
  o({ attribute: "id-key", reflect: !0, type: String })
209
- ], e.prototype, "idKey", 2);
210
- a([
211
+ ], a.prototype, "idKey", 2);
212
+ e([
211
213
  o({ attribute: "format", reflect: !0, type: String })
212
- ], e.prototype, "format", 2);
213
- a([
214
+ ], a.prototype, "format", 2);
215
+ e([
214
216
  o({ attribute: "manual-format", reflect: !0, type: Boolean })
215
- ], e.prototype, "manualFormat", 2);
216
- a([
217
+ ], a.prototype, "manualFormat", 2);
218
+ e([
217
219
  o({ attribute: "no-crossorigin", reflect: !0, type: Boolean })
218
- ], e.prototype, "noCrossorigin", 2);
219
- a([
220
+ ], a.prototype, "noCrossorigin", 2);
221
+ e([
220
222
  x()
221
- ], e.prototype, "sortableInstance", 2);
222
- a([
223
+ ], a.prototype, "sortableInstance", 2);
224
+ e([
223
225
  x()
224
- ], e.prototype, "previous", 2);
225
- a([
226
+ ], a.prototype, "previous", 2);
227
+ e([
226
228
  x()
227
- ], e.prototype, "abortDrag", 2);
228
- a([
229
- F("sortable", { waitUntilFirstUpdate: !0 })
230
- ], e.prototype, "handleSortableChange", 1);
231
- e = a([
229
+ ], a.prototype, "abortDrag", 2);
230
+ e([
231
+ U("sortable", { waitUntilFirstUpdate: !0 })
232
+ ], a.prototype, "handleSortableChange", 1);
233
+ a = e([
232
234
  A("cx-masonry")
233
- ], e);
235
+ ], a);
234
236
  export {
235
- e as default
237
+ a as default
236
238
  };