@orangelogic/design-system 2.88.0 → 2.90.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.
@@ -10,7 +10,7 @@ import { c as N } from "../chunks/custom-element.L4WJXn1j.js";
10
10
  import { L as O } from "../chunks/i18n.CgwQHLcP.js";
11
11
  import { w as k } from "../chunks/watch.BCJD77bD.js";
12
12
  import { s as it, c as st } from "../chunks/number.CjNxU7Xs.js";
13
- import { i as D, x as b, E as lt } from "../chunks/lit-element.jLBm65_O.js";
13
+ import { i as U, x as b, E as lt } from "../chunks/lit-element.jLBm65_O.js";
14
14
  import { r as z } from "../chunks/state.CSDxrqLd.js";
15
15
  import { n as G } from "../chunks/when.Dr1es41R.js";
16
16
  import L from "./details.js";
@@ -27,7 +27,7 @@ import { o as M } from "../chunks/style-map.llVFPd__.js";
27
27
  import at from "./tooltip.js";
28
28
  import pt from "./button-group.js";
29
29
  import dt from "./checkbox.js";
30
- const ut = D`.asset-link-format__details{--header-padding:var(--cx-spacing-small) var(--cx-spacing-medium)}.asset-link-format__details::part(icon){width:var(--cx-font-size-3x-large);height:var(--cx-font-size-3x-large);background-color:var(--cx-color-neutral-100);border-radius:var(--cx-border-radius-large);color:var(--cx-color-neutral-600);font-size:var(--cx-font-size-large);justify-content:center;align-items:center;display:flex}.asset-link-format__details::part(input-label){color:var(--cx-color-neutral-400);margin-inline-start:var(--cx-spacing-small)}.asset-link-format__header{padding:var(--cx-spacing-medium)}.asset-link-format__section-header{padding:0 var(--cx-spacing-medium);border-top:solid 1px var(--cx-color-neutral-200);background-color:var(--cx-color-neutral-50)}.asset-link-format__undo{--color:var(--cx-color-primary);--background-color:transparent}`;
30
+ const ut = U`.asset-link-format__details{--header-padding:var(--cx-spacing-small) var(--cx-spacing-medium)}.asset-link-format__details::part(icon){width:var(--cx-font-size-3x-large);height:var(--cx-font-size-3x-large);background-color:var(--cx-color-neutral-100);border-radius:var(--cx-border-radius-large);color:var(--cx-color-neutral-600);font-size:var(--cx-font-size-large);justify-content:center;align-items:center;display:flex}.asset-link-format__details::part(input-label){color:var(--cx-color-neutral-400);margin-inline-start:var(--cx-spacing-small)}.asset-link-format__header{padding:var(--cx-spacing-medium)}.asset-link-format__section-header{padding:0 var(--cx-spacing-medium);border-top:solid 1px var(--cx-color-neutral-200);background-color:var(--cx-color-neutral-50)}.asset-link-format__undo{--color:var(--cx-color-primary);--background-color:transparent}`;
31
31
  function J({
32
32
  asset: t,
33
33
  baseUrl: e,
@@ -37,26 +37,39 @@ function J({
37
37
  useSession: h = ""
38
38
  }) {
39
39
  let r = e;
40
- a && a.length > 0 && (r += "/t/");
41
- const m = a?.findLast(
42
- (v) => v.key === c.Quality
40
+ const y = a?.findLast(
41
+ (x) => x.key === c.Quality
43
42
  );
44
- m && (a = [
43
+ if (y && (a = [
45
44
  ...a?.filter(
46
- (v) => v.key !== c.Quality
45
+ (x) => x.key !== c.Quality
47
46
  ) || [],
48
- m
49
- ]), a?.forEach(({ key: v, value: w }) => {
50
- if (v === c.Resize) {
51
- const x = [
47
+ y
48
+ ]), a) {
49
+ const x = [];
50
+ for (let g = 0; g < a.length; g++) {
51
+ const m = a[g];
52
+ if (m.key === c.Rotate) {
53
+ let n = m.value.rotation ?? 0;
54
+ for (; a[g + 1]?.key === c.Rotate; )
55
+ g++, n += a[g].value.rotation ?? 0;
56
+ n !== 0 && x.push({ key: c.Rotate, value: { rotation: n } });
57
+ } else
58
+ x.push(m);
59
+ }
60
+ a = x;
61
+ }
62
+ a && a.length > 0 && (r += "/t/"), a?.forEach(({ key: x, value: g }) => {
63
+ if (x === c.Resize) {
64
+ const m = [
52
65
  ...[
53
66
  {
54
67
  key: "re_w_",
55
- value: Math.round(w.width ?? 0)
68
+ value: Math.round(g.width ?? 0)
56
69
  },
57
70
  {
58
71
  key: "re_h_",
59
- value: Math.round(w.height ?? 0)
72
+ value: Math.round(g.height ?? 0)
60
73
  }
61
74
  ].filter((n) => n.value !== void 0).map((n) => ({
62
75
  key: n.key,
@@ -67,33 +80,33 @@ function J({
67
80
  value: "stretch"
68
81
  }
69
82
  ];
70
- x.forEach(({ key: n, value: $ }, B) => {
71
- r += `${n}${$}${B < x.length - 1 ? "," : ""}`;
83
+ m.forEach(({ key: n, value: $ }, B) => {
84
+ r += `${n}${$}${B < m.length - 1 ? "," : ""}`;
72
85
  }), r += "/";
73
86
  }
74
- if (v === c.Crop) {
75
- const x = [
87
+ if (x === c.Crop) {
88
+ const m = [
76
89
  ...[
77
90
  {
78
91
  key: "c_",
79
- value: w.mode
92
+ value: g.mode
80
93
  },
81
- ...w.disabledSize ? [] : [
94
+ ...g.disabledSize ? [] : [
82
95
  {
83
96
  key: "c_w_",
84
- value: Math.round(w.width ?? 0)
97
+ value: Math.round(g.width ?? 0)
85
98
  },
86
99
  {
87
100
  key: "c_h_",
88
- value: Math.round(w.height ?? 0)
101
+ value: Math.round(g.height ?? 0)
89
102
  },
90
103
  {
91
104
  key: "c_x_",
92
- value: Math.round(w.x ?? 0)
105
+ value: Math.round(g.x ?? 0)
93
106
  },
94
107
  {
95
108
  key: "c_y_",
96
- value: Math.round(w.y ?? 0)
109
+ value: Math.round(g.y ?? 0)
97
110
  }
98
111
  ]
99
112
  ].filter((n) => n.value !== void 0 && n.value !== null).map((n) => ({
@@ -105,56 +118,56 @@ function J({
105
118
  value: "pixel"
106
119
  }
107
120
  ];
108
- x.forEach(({ key: n, value: $ }, B) => {
121
+ m.forEach(({ key: n, value: $ }, B) => {
109
122
  const ot = ["c_w_", "c_h_", "c_x_", "c_y_"].includes(n);
110
- r += `${n}${ot ? Math.round(Number($)) : $}${B < x.length - 1 ? "," : ""}`;
123
+ r += `${n}${ot ? Math.round(Number($)) : $}${B < m.length - 1 ? "," : ""}`;
111
124
  }), r += "/";
112
125
  }
113
- if (v === c.Rotate && ([
126
+ if (x === c.Rotate && ([
114
127
  {
115
128
  key: "r_a_",
116
- value: w.rotation
129
+ value: g.rotation
117
130
  }
118
131
  ].filter((n) => n.value !== void 0).map((n) => ({
119
132
  key: n.key,
120
133
  value: Math.round(Number(n.value))
121
134
  })).forEach(({ key: n, value: $ }) => {
122
135
  r += `${n}${$}`;
123
- }), r += "/"), v === c.Quality) {
124
- const x = [
136
+ }), r += "/"), x === c.Quality) {
137
+ const m = [
125
138
  {
126
139
  key: "q_level_",
127
- value: w.quality
140
+ value: g.quality
128
141
  }
129
142
  ].filter((n) => n.value !== void 0).map((n) => ({
130
143
  key: n.key,
131
144
  value: Math.round(Number(n.value))
132
145
  }));
133
- x.forEach(({ key: n, value: $ }, B) => {
134
- r += `${n}${$}${B < x.length - 1 ? "," : ""}`;
146
+ m.forEach(({ key: n, value: $ }, B) => {
147
+ r += `${n}${$}${B < m.length - 1 ? "," : ""}`;
135
148
  }), r += "/";
136
149
  }
137
- if (v === c.Metadata) {
138
- const x = [
150
+ if (x === c.Metadata) {
151
+ const m = [
139
152
  {
140
153
  key: "fl_keep_metadata",
141
- value: w.keepMetadata
154
+ value: g.keepMetadata
142
155
  }
143
156
  ].filter((n) => n.value !== void 0).map((n) => ({ key: n.key, value: n.value }));
144
- x.forEach(({ key: n }, $) => {
145
- r += `${n}${$ < x.length - 1 ? "," : ""}`;
157
+ m.forEach(({ key: n }, $) => {
158
+ r += `${n}${$ < m.length - 1 ? "," : ""}`;
146
159
  }), r += "/";
147
160
  }
148
161
  }), i && (r += `${t?.identifier}${i}`);
149
- const y = [];
150
- return s && s.length > 0 && s.forEach(({ key: v, value: w }) => {
151
- y.push(
152
- `${encodeURIComponent(v.trim())}=${encodeURIComponent(w.trim())}`
162
+ const w = [];
163
+ return s && s.length > 0 && s.forEach(({ key: x, value: g }) => {
164
+ w.push(
165
+ `${encodeURIComponent(x.trim())}=${encodeURIComponent(g.trim())}`
153
166
  );
154
- }), y.length > 0 && (r += `?${y.join("&")}`), r.endsWith("/") && (r = r.slice(0, -1)), r;
167
+ }), w.length > 0 && (r += `?${w.join("&")}`), r.endsWith("/") && (r = r.slice(0, -1)), r;
155
168
  }
156
- const gt = D`cx-details::part(base){border-bottom-width:0}cx-space{width:100%}cx-space cx-input{flex:1}.crop__unit-select{width:120px}.crop__input-group{flex:1;display:flex}`;
157
- var mt = Object.defineProperty, xt = Object.getOwnPropertyDescriptor, g = (t, e, i, s) => {
169
+ const gt = U`cx-details::part(base){border-bottom-width:0}cx-space{width:100%}cx-space cx-input{flex:1}.crop__unit-select{width:120px}.crop__input-group{flex:1;display:flex}`;
170
+ var mt = Object.defineProperty, xt = Object.getOwnPropertyDescriptor, f = (t, e, i, s) => {
158
171
  for (var a = s > 1 ? void 0 : s ? xt(e, i) : e, h = t.length - 1, r; h >= 0; h--)
159
172
  (r = t[h]) && (a = (s ? r(e, i, a) : r(a)) || a);
160
173
  return s && a && mt(e, i, a), a;
@@ -428,91 +441,91 @@ u.dependencies = {
428
441
  "cx-space": H,
429
442
  "cx-typography": W
430
443
  };
431
- g([
444
+ f([
432
445
  T(".details")
433
446
  ], u.prototype, "base", 2);
434
- g([
447
+ f([
435
448
  l({ reflect: !0, type: Boolean })
436
449
  ], u.prototype, "open", 2);
437
- g([
450
+ f([
438
451
  l({ reflect: !0, type: Number })
439
452
  ], u.prototype, "width", 2);
440
- g([
453
+ f([
441
454
  l({ reflect: !0, type: Number })
442
455
  ], u.prototype, "height", 2);
443
- g([
456
+ f([
444
457
  l({ attribute: "max-width", reflect: !0, type: Number })
445
458
  ], u.prototype, "maxWidth", 2);
446
- g([
459
+ f([
447
460
  l({ attribute: "max-height", reflect: !0, type: Number })
448
461
  ], u.prototype, "maxHeight", 2);
449
- g([
462
+ f([
450
463
  l({ attribute: "ratio-width", reflect: !0, type: Number })
451
464
  ], u.prototype, "ratioWidth", 2);
452
- g([
465
+ f([
453
466
  l({ attribute: "ratio-height", reflect: !0, type: Number })
454
467
  ], u.prototype, "ratioHeight", 2);
455
- g([
468
+ f([
456
469
  l({ attribute: "percentage-width", reflect: !0, type: Number })
457
470
  ], u.prototype, "percentageWidth", 2);
458
- g([
471
+ f([
459
472
  l({ attribute: "percentage-height", reflect: !0, type: Number })
460
473
  ], u.prototype, "percentageHeight", 2);
461
- g([
474
+ f([
462
475
  l({ reflect: !0, type: String })
463
476
  ], u.prototype, "unit", 2);
464
- g([
477
+ f([
465
478
  l({ attribute: "disabled-apply", reflect: !0, type: Boolean })
466
479
  ], u.prototype, "disabledApply", 2);
467
- g([
480
+ f([
468
481
  l({ attribute: "last-applied-setting", reflect: !1, type: Object })
469
482
  ], u.prototype, "lastAppliedSetting", 2);
470
- g([
483
+ f([
471
484
  l({ reflect: !0, type: Boolean })
472
485
  ], u.prototype, "loading", 2);
473
- g([
486
+ f([
474
487
  l({ attribute: "crop-modes", reflect: !1, type: Array })
475
488
  ], u.prototype, "cropModes", 2);
476
- g([
489
+ f([
477
490
  l({ attribute: "focus-modes", reflect: !1, type: Object })
478
491
  ], u.prototype, "focusModes", 2);
479
- g([
492
+ f([
480
493
  l({ attribute: "focus-mode", reflect: !0, type: String })
481
494
  ], u.prototype, "focusMode", 2);
482
- g([
495
+ f([
483
496
  l({ attribute: "crop-mode", reflect: !0, type: String })
484
497
  ], u.prototype, "cropMode", 2);
485
- g([
498
+ f([
486
499
  l({ attribute: "keep-aspect-ratio", reflect: !0, type: Boolean })
487
500
  ], u.prototype, "keepAspectRatio", 2);
488
- g([
501
+ f([
489
502
  z()
490
503
  ], u.prototype, "invalidWidth", 2);
491
- g([
504
+ f([
492
505
  z()
493
506
  ], u.prototype, "invalidHeight", 2);
494
- g([
507
+ f([
495
508
  z()
496
509
  ], u.prototype, "aspectRatio", 2);
497
- g([
510
+ f([
498
511
  k("cropMode", { waitUntilFirstUpdate: !0 }),
499
512
  k("maxWidth", { waitUntilFirstUpdate: !0 }),
500
513
  k("maxHeight", { waitUntilFirstUpdate: !0 }),
501
514
  k("keepAspectRatio")
502
515
  ], u.prototype, "handleCropModeChange", 1);
503
- g([
516
+ f([
504
517
  k("open")
505
518
  ], u.prototype, "handleOpenChange", 1);
506
- u = g([
519
+ u = f([
507
520
  N("cx-asset-link-format-crop")
508
521
  ], u);
509
- const ft = D`.extension{padding:var(--cx-spacing-small) var(--cx-spacing-medium);border:solid 1px var(--cx-color-neutral-200);background-color:var(--cx-color-neutral-0);& cx-select{flex:1;width:100%}}`;
522
+ const ft = U`.extension{padding:var(--cx-spacing-small) var(--cx-spacing-medium);border:solid 1px var(--cx-color-neutral-200);background-color:var(--cx-color-neutral-0);& cx-select{flex:1;width:100%}}`;
510
523
  var yt = Object.defineProperty, vt = Object.getOwnPropertyDescriptor, et = (t, e, i, s) => {
511
524
  for (var a = s > 1 ? void 0 : s ? vt(e, i) : e, h = t.length - 1, r; h >= 0; h--)
512
525
  (r = t[h]) && (a = (s ? r(e, i, a) : r(a)) || a);
513
526
  return s && a && yt(e, i, a), a;
514
527
  };
515
- let U = class extends F {
528
+ let D = class extends F {
516
529
  constructor() {
517
530
  super(...arguments), this.localize = new O(this), this.value = "", this.items = [];
518
531
  }
@@ -530,8 +543,8 @@ let U = class extends F {
530
543
  )}</cx-select></cx-space>`;
531
544
  }
532
545
  };
533
- U.styles = [E, ft];
534
- U.dependencies = {
546
+ D.styles = [E, ft];
547
+ D.dependencies = {
535
548
  "cx-option": X,
536
549
  "cx-select": Y,
537
550
  "cx-space": H,
@@ -539,14 +552,14 @@ U.dependencies = {
539
552
  };
540
553
  et([
541
554
  l({ reflect: !0, type: String })
542
- ], U.prototype, "value", 2);
555
+ ], D.prototype, "value", 2);
543
556
  et([
544
557
  l({ reflect: !1, type: Array })
545
- ], U.prototype, "items", 2);
546
- U = et([
558
+ ], D.prototype, "items", 2);
559
+ D = et([
547
560
  N("cx-asset-link-format-extension")
548
- ], U);
549
- const wt = D`cx-details::part(base){border-bottom-width:0}`;
561
+ ], D);
562
+ const wt = U`cx-details::part(base){border-bottom-width:0}`;
550
563
  var zt = Object.defineProperty, St = Object.getOwnPropertyDescriptor, _ = (t, e, i, s) => {
551
564
  for (var a = s > 1 ? void 0 : s ? St(e, i) : e, h = t.length - 1, r; h >= 0; h--)
552
565
  (r = t[h]) && (a = (s ? r(e, i, a) : r(a)) || a);
@@ -644,7 +657,7 @@ _([
644
657
  C = _([
645
658
  N("cx-asset-link-format-proxy")
646
659
  ], C);
647
- const bt = D`cx-details::part(base){border-bottom-width:0}`;
660
+ const bt = U`cx-details::part(base){border-bottom-width:0}`;
648
661
  var kt = Object.defineProperty, $t = Object.getOwnPropertyDescriptor, I = (t, e, i, s) => {
649
662
  for (var a = s > 1 ? void 0 : s ? $t(e, i) : e, h = t.length - 1, r; h >= 0; h--)
650
663
  (r = t[h]) && (a = (s ? r(e, i, a) : r(a)) || a);
@@ -732,13 +745,13 @@ I([
732
745
  A = I([
733
746
  N("cx-asset-link-format-quality")
734
747
  ], A);
735
- const Ct = D`cx-details::part(base){border-bottom-width:0}cx-space{width:100%}cx-space cx-input{flex:1}.resize__unit-select{width:120px}.resize__input-group{flex:1;display:flex}`;
748
+ const Ct = U`cx-details::part(base){border-bottom-width:0}cx-space{width:100%}cx-space cx-input{flex:1}.resize__unit-select{width:120px}.resize__input-group{flex:1;display:flex}`;
736
749
  var At = Object.defineProperty, Rt = Object.getOwnPropertyDescriptor, S = (t, e, i, s) => {
737
750
  for (var a = s > 1 ? void 0 : s ? Rt(e, i) : e, h = t.length - 1, r; h >= 0; h--)
738
751
  (r = t[h]) && (a = (s ? r(e, i, a) : r(a)) || a);
739
752
  return s && a && At(e, i, a), a;
740
753
  };
741
- let f = class extends F {
754
+ let v = class extends F {
742
755
  constructor() {
743
756
  super(...arguments), this.localize = new O(this), this.open = !1, this.width = 0, this.height = 0, this.maxWidth = 0, this.maxHeight = 0, this.ratioWidth = 1, this.ratioHeight = 1, this.unit = o.Pixel, this.lastAppliedSetting = {
744
757
  [o.Pixel]: { height: 0, width: 0 },
@@ -885,8 +898,8 @@ let f = class extends F {
885
898
  })} @click=${this.handleApply}>${this.localize.term("apply")}</cx-button></cx-space></cx-details>`;
886
899
  }
887
900
  };
888
- f.styles = [E, Ct];
889
- f.dependencies = {
901
+ v.styles = [E, Ct];
902
+ v.dependencies = {
890
903
  "cx-button": q,
891
904
  "cx-details": L,
892
905
  "cx-icon": j,
@@ -899,62 +912,62 @@ f.dependencies = {
899
912
  };
900
913
  S([
901
914
  T(".details")
902
- ], f.prototype, "base", 2);
915
+ ], v.prototype, "base", 2);
903
916
  S([
904
917
  l({ reflect: !0, type: Boolean })
905
- ], f.prototype, "open", 2);
918
+ ], v.prototype, "open", 2);
906
919
  S([
907
920
  l({ reflect: !0, type: Number })
908
- ], f.prototype, "width", 2);
921
+ ], v.prototype, "width", 2);
909
922
  S([
910
923
  l({ reflect: !0, type: Number })
911
- ], f.prototype, "height", 2);
924
+ ], v.prototype, "height", 2);
912
925
  S([
913
926
  l({ attribute: "max-width", reflect: !0, type: Number })
914
- ], f.prototype, "maxWidth", 2);
927
+ ], v.prototype, "maxWidth", 2);
915
928
  S([
916
929
  l({ attribute: "max-height", reflect: !0, type: Number })
917
- ], f.prototype, "maxHeight", 2);
930
+ ], v.prototype, "maxHeight", 2);
918
931
  S([
919
932
  l({ attribute: "ratio-width", reflect: !0, type: Number })
920
- ], f.prototype, "ratioWidth", 2);
933
+ ], v.prototype, "ratioWidth", 2);
921
934
  S([
922
935
  l({ attribute: "ratio-height", reflect: !0, type: Number })
923
- ], f.prototype, "ratioHeight", 2);
936
+ ], v.prototype, "ratioHeight", 2);
924
937
  S([
925
938
  l({ reflect: !0, type: String })
926
- ], f.prototype, "unit", 2);
939
+ ], v.prototype, "unit", 2);
927
940
  S([
928
941
  l({ attribute: "last-applied-setting", reflect: !1, type: Object })
929
- ], f.prototype, "lastAppliedSetting", 2);
942
+ ], v.prototype, "lastAppliedSetting", 2);
930
943
  S([
931
944
  l({ reflect: !0, type: Boolean })
932
- ], f.prototype, "loading", 2);
945
+ ], v.prototype, "loading", 2);
933
946
  S([
934
947
  l({ attribute: "keep-aspect-ratio", reflect: !0, type: Boolean })
935
- ], f.prototype, "keepAspectRatio", 2);
948
+ ], v.prototype, "keepAspectRatio", 2);
936
949
  S([
937
950
  z()
938
- ], f.prototype, "invalidWidth", 2);
951
+ ], v.prototype, "invalidWidth", 2);
939
952
  S([
940
953
  z()
941
- ], f.prototype, "invalidHeight", 2);
954
+ ], v.prototype, "invalidHeight", 2);
942
955
  S([
943
956
  z()
944
- ], f.prototype, "aspectRatio", 2);
957
+ ], v.prototype, "aspectRatio", 2);
945
958
  S([
946
959
  k("cropMode", { waitUntilFirstUpdate: !0 }),
947
960
  k("maxWidth", { waitUntilFirstUpdate: !0 }),
948
961
  k("maxHeight", { waitUntilFirstUpdate: !0 }),
949
962
  k("keepAspectRatio")
950
- ], f.prototype, "handleCropModeChange", 1);
963
+ ], v.prototype, "handleCropModeChange", 1);
951
964
  S([
952
965
  k("open")
953
- ], f.prototype, "handleOpenChange", 1);
954
- f = S([
966
+ ], v.prototype, "handleOpenChange", 1);
967
+ v = S([
955
968
  N("cx-asset-link-format-resize")
956
- ], f);
957
- const Mt = D`cx-details::part(base){border-bottom-width:0}`;
969
+ ], v);
970
+ const Mt = U`cx-details::part(base){border-bottom-width:0}`;
958
971
  var _t = Object.defineProperty, Pt = Object.getOwnPropertyDescriptor, V = (t, e, i, s) => {
959
972
  for (var a = s > 1 ? void 0 : s ? Pt(e, i) : e, h = t.length - 1, r; h >= 0; h--)
960
973
  (r = t[h]) && (a = (s ? r(e, i, a) : r(a)) || a);
@@ -1036,7 +1049,7 @@ V([
1036
1049
  R = V([
1037
1050
  N("cx-asset-link-format-rotation")
1038
1051
  ], R);
1039
- const Ht = D`cx-details::part(base){border-bottom-width:0}`;
1052
+ const Ht = U`cx-details::part(base){border-bottom-width:0}`;
1040
1053
  var Wt = Object.defineProperty, Ft = Object.getOwnPropertyDescriptor, Z = (t, e, i, s) => {
1041
1054
  for (var a = s > 1 ? void 0 : s ? Ft(e, i) : e, h = t.length - 1, r; h >= 0; h--)
1042
1055
  (r = t[h]) && (a = (s ? r(e, i, a) : r(a)) || a);
@@ -1316,6 +1329,7 @@ let p = class extends F {
1316
1329
  assetId: this.asset.id,
1317
1330
  extension: this.asset.extension,
1318
1331
  format: e?.proxyName ?? "",
1332
+ siteUrl: this.baseUrl,
1319
1333
  token: this.token,
1320
1334
  transformations: this.transformationString
1321
1335
  }).then((s) => {
@@ -1366,6 +1380,7 @@ let p = class extends F {
1366
1380
  assetId: this.asset.id,
1367
1381
  extension: this.selectedFormat.extension,
1368
1382
  format: t?.proxyName ?? "",
1383
+ siteUrl: this.baseUrl,
1369
1384
  token: this.token,
1370
1385
  transformations: this.transformationString
1371
1386
  });
@@ -1488,14 +1503,14 @@ let p = class extends F {
1488
1503
  const i = this.proxies?.find((s) => s.id === t);
1489
1504
  i && (this.asset && i.proxyName === "TRX" && (i.formatHeight = Number(this.asset.height), i.formatWidth = Number(this.asset.width)), this.transformations = this.transformations.map((s) => {
1490
1505
  if (s.key === c.Crop) {
1491
- const a = s.value, h = a.width / i.formatWidth * e.formatWidth, r = a.height / i.formatHeight * e.formatHeight, m = a.x / i.formatWidth * e.formatWidth, y = a.y / i.formatHeight * e.formatHeight;
1506
+ const a = s.value, h = a.width / i.formatWidth * e.formatWidth, r = a.height / i.formatHeight * e.formatHeight, y = a.x / i.formatWidth * e.formatWidth, w = a.y / i.formatHeight * e.formatHeight;
1492
1507
  return {
1493
1508
  ...s,
1494
1509
  value: {
1495
1510
  height: r,
1496
1511
  width: h,
1497
- x: m,
1498
- y
1512
+ x: y,
1513
+ y: w
1499
1514
  }
1500
1515
  };
1501
1516
  }
@@ -1572,31 +1587,31 @@ let p = class extends F {
1572
1587
  percentageHeight: a,
1573
1588
  percentageWidth: h,
1574
1589
  ratioHeight: r,
1575
- ratioWidth: m,
1576
- unit: y,
1577
- useCropMode: v,
1578
- width: w
1590
+ ratioWidth: y,
1591
+ unit: w,
1592
+ useCropMode: x,
1593
+ width: g
1579
1594
  }) {
1580
1595
  if (!this.selectedFormat?.url || e === "manual")
1581
1596
  return;
1582
1597
  this.loading = !0, this.lastAction = c.Crop;
1583
- const x = await this.apiGetCropFocusMode({
1598
+ const m = await this.apiGetCropFocusMode({
1584
1599
  autoCropMode: e,
1585
1600
  cropHeight: i,
1586
- cropWidth: w,
1601
+ cropWidth: g,
1587
1602
  imageUrl: this.selectedFormat.url
1588
1603
  });
1589
- if (x) {
1604
+ if (m) {
1590
1605
  let n = a, $ = h;
1591
- i || (n = x.height * 100 / this.selectedFormat.height), w || ($ = x.width * 100 / this.selectedFormat.width), this.cropSize = {
1606
+ i || (n = m.height * 100 / this.selectedFormat.height), g || ($ = m.width * 100 / this.selectedFormat.width), this.cropSize = {
1592
1607
  ...this.cropSize,
1593
- height: x.height,
1608
+ height: m.height,
1594
1609
  percentageHeight: n ?? this.cropSize.percentageHeight,
1595
1610
  percentageWidth: $ ?? this.cropSize.percentageWidth,
1596
- width: x.width,
1597
- x: x.x * 100 / this.selectedFormat.width,
1598
- y: x.y * 100 / this.selectedFormat.height,
1599
- ...v ? {
1611
+ width: m.width,
1612
+ x: m.x * 100 / this.selectedFormat.width,
1613
+ y: m.y * 100 / this.selectedFormat.height,
1614
+ ...x ? {
1600
1615
  cropMode: e,
1601
1616
  focusMode: "manual",
1602
1617
  keepAspectRatio: !1
@@ -1606,8 +1621,8 @@ let p = class extends F {
1606
1621
  },
1607
1622
  keepAspectRatio: s ?? this.cropSize.keepAspectRatio,
1608
1623
  ratioHeight: r ?? this.cropSize.ratioHeight,
1609
- ratioWidth: m ?? this.cropSize.ratioWidth,
1610
- unit: y ?? this.cropSize.unit
1624
+ ratioWidth: y ?? this.cropSize.ratioWidth,
1625
+ unit: w ?? this.cropSize.unit
1611
1626
  };
1612
1627
  }
1613
1628
  this.loading = !1, this.lastAction = void 0;
@@ -1618,26 +1633,29 @@ let p = class extends F {
1618
1633
  width: s,
1619
1634
  x: a,
1620
1635
  y: h
1621
- } = e, r = this.cropSize.percentageWidth !== s, m = this.cropSize.percentageHeight !== i;
1622
- let y = this.cropSize.height, v = this.cropSize.width;
1623
- r && (v = Math.round(s * this.selectedFormat.width / 100)), m && (y = Math.round(
1636
+ } = e;
1637
+ if (s === 0 || i === 0)
1638
+ return;
1639
+ const r = this.cropSize.percentageWidth !== s, y = this.cropSize.percentageHeight !== i;
1640
+ let w = this.cropSize.height, x = this.cropSize.width;
1641
+ r && (x = Math.round(s * this.selectedFormat.width / 100)), y && (w = Math.round(
1624
1642
  i * this.selectedFormat.height / 100
1625
1643
  ));
1626
- const w = this.cropSize.focusMode;
1644
+ const g = this.cropSize.focusMode;
1627
1645
  this.focusModes.find(
1628
- (n) => n.value === w
1646
+ (n) => n.value === g
1629
1647
  )?.auto && this.selectedFormat?.url && this.cropperElement ? await this.handleRequestAutoCropSuggestion({
1630
- focusMode: w,
1631
- height: y,
1648
+ focusMode: g,
1649
+ height: w,
1632
1650
  percentageHeight: i,
1633
1651
  percentageWidth: s,
1634
- width: v
1652
+ width: x
1635
1653
  }) : this.cropSize = {
1636
1654
  ...this.cropSize,
1637
- height: y,
1655
+ height: w,
1638
1656
  percentageHeight: i,
1639
1657
  percentageWidth: s,
1640
- width: v,
1658
+ width: x,
1641
1659
  x: a,
1642
1660
  y: h
1643
1661
  };
@@ -1673,10 +1691,10 @@ let p = class extends F {
1673
1691
  });
1674
1692
  else {
1675
1693
  const s = this.focusModes.find(
1676
- (y) => y.value === this.cropSize.focusMode
1694
+ (w) => w.value === this.cropSize.focusMode
1677
1695
  )?.auto;
1678
- let a = this.cropSize.keepAspectRatio, h = this.cropSize.focusMode, r = this.cropSize.x, m = this.cropSize.y;
1679
- e === "free" ? (a = !1, h = "manual") : this.cropSize.unit === o.Pixel && !s && (r = 0, m = 0), s ? await this.handleRequestAutoCropSuggestion({
1696
+ let a = this.cropSize.keepAspectRatio, h = this.cropSize.focusMode, r = this.cropSize.x, y = this.cropSize.y;
1697
+ e === "free" ? (a = !1, h = "manual") : this.cropSize.unit === o.Pixel && !s && (r = 0, y = 0), s ? await this.handleRequestAutoCropSuggestion({
1680
1698
  cropMode: e,
1681
1699
  focusMode: h,
1682
1700
  height: this.cropSize.height,
@@ -1688,7 +1706,7 @@ let p = class extends F {
1688
1706
  focusMode: h,
1689
1707
  keepAspectRatio: a,
1690
1708
  x: r,
1691
- y: m
1709
+ y
1692
1710
  };
1693
1711
  }
1694
1712
  }
@@ -1713,14 +1731,14 @@ let p = class extends F {
1713
1731
  Math.max(Math.round(s / i), 0),
1714
1732
  this.resizeSize.height
1715
1733
  ), h = a * 100 / this.selectedFormat.height, r = s * 100 / this.selectedFormat.width;
1716
- let m = this.cropSize.x, y = this.cropSize.y;
1717
- m + r > 100 && (m = 100 - r), y + h > 100 && (y = 100 - h);
1718
- let v = this.cropSize.cropMode;
1734
+ let y = this.cropSize.x, w = this.cropSize.y;
1735
+ y + r > 100 && (y = 100 - r), w + h > 100 && (w = 100 - h);
1736
+ let x = this.cropSize.cropMode;
1719
1737
  this.cropModes.find(
1720
- (x) => x.value === v
1721
- )?.auto && (v = "free"), t.detail.silent ? (this.cropSize.height = a, this.cropSize.keepAspectRatio = t.detail.keepAspectRatio, this.cropSize.percentageHeight = h, this.cropSize.percentageWidth = r, this.cropSize.ratioHeight = t.detail.height, this.cropSize.ratioWidth = t.detail.width, this.cropSize.unit = o.AspectRatio, this.cropSize.width = s) : this.cropSize = {
1738
+ (m) => m.value === x
1739
+ )?.auto && (x = "free"), t.detail.silent ? (this.cropSize.height = a, this.cropSize.keepAspectRatio = t.detail.keepAspectRatio, this.cropSize.percentageHeight = h, this.cropSize.percentageWidth = r, this.cropSize.ratioHeight = t.detail.height, this.cropSize.ratioWidth = t.detail.width, this.cropSize.unit = o.AspectRatio, this.cropSize.width = s) : this.cropSize = {
1722
1740
  ...this.cropSize,
1723
- cropMode: v,
1741
+ cropMode: x,
1724
1742
  height: a,
1725
1743
  keepAspectRatio: t.detail.keepAspectRatio,
1726
1744
  percentageHeight: h,
@@ -1729,18 +1747,18 @@ let p = class extends F {
1729
1747
  ratioWidth: t.detail.width,
1730
1748
  unit: o.AspectRatio,
1731
1749
  width: s,
1732
- x: m,
1733
- y
1750
+ x: y,
1751
+ y: w
1734
1752
  };
1735
1753
  } else {
1736
1754
  const i = this.selectedFormat ? t.detail.height * 100 / this.selectedFormat.height : 100, s = this.selectedFormat ? t.detail.width * 100 / this.selectedFormat.width : 100;
1737
1755
  let a = this.cropSize.x, h = this.cropSize.y;
1738
1756
  a + s > 100 && (a = 100 - s), h + i > 100 && (h = 100 - i);
1739
1757
  let r = this.cropSize.cropMode;
1740
- const m = this.cropModes.find(
1741
- (y) => y.value === r
1758
+ const y = this.cropModes.find(
1759
+ (w) => w.value === r
1742
1760
  )?.auto;
1743
- (t.detail.breakAspectRatio || m) && (r = "free"), t.detail.silent ? (this.cropSize.cropMode = r, this.cropSize.height = t.detail.height, this.cropSize.keepAspectRatio = t.detail.keepAspectRatio, this.cropSize.percentageHeight = i, this.cropSize.percentageWidth = s, this.cropSize.unit = o.Pixel, this.cropSize.width = t.detail.width, this.cropSize.x = a, this.cropSize.y = h) : this.cropSize = {
1761
+ (t.detail.breakAspectRatio || y) && (r = "free"), t.detail.silent ? (this.cropSize.cropMode = r, this.cropSize.height = t.detail.height, this.cropSize.keepAspectRatio = t.detail.keepAspectRatio, this.cropSize.percentageHeight = i, this.cropSize.percentageWidth = s, this.cropSize.unit = o.Pixel, this.cropSize.width = t.detail.width, this.cropSize.x = a, this.cropSize.y = h) : this.cropSize = {
1744
1762
  ...this.cropSize,
1745
1763
  cropMode: r,
1746
1764
  height: t.detail.height,
@@ -1785,7 +1803,7 @@ let p = class extends F {
1785
1803
  }
1786
1804
  ];
1787
1805
  else {
1788
- const m = this.cropSize.x / 100 * this.selectedFormat.width, y = this.cropSize.y / 100 * this.selectedFormat.height;
1806
+ const y = this.cropSize.x / 100 * this.selectedFormat.width, w = this.cropSize.y / 100 * this.selectedFormat.height;
1789
1807
  this.transformations = [
1790
1808
  ...this.transformations,
1791
1809
  {
@@ -1794,8 +1812,8 @@ let p = class extends F {
1794
1812
  height: r,
1795
1813
  unit: s,
1796
1814
  width: h,
1797
- x: m,
1798
- y
1815
+ x: y,
1816
+ y: w
1799
1817
  }
1800
1818
  }
1801
1819
  ];
@@ -1840,13 +1858,13 @@ let p = class extends F {
1840
1858
  const { height: e, unit: i, width: s } = t.detail;
1841
1859
  this.lastAction = c.Resize;
1842
1860
  const a = this.selectedFormat.width || this.defaultSize.width, h = this.selectedFormat.height || this.defaultSize.height;
1843
- let r = s, m = e;
1844
- this.resizeSize.unit !== i ? (r = a, m = h) : i === o.AspectRatio && (r = Math.round(s / e * h), m = h), this.transformations = [
1861
+ let r = s, y = e;
1862
+ this.resizeSize.unit !== i ? (r = a, y = h) : i === o.AspectRatio && (r = Math.round(s / e * h), y = h), this.transformations = [
1845
1863
  ...this.transformations,
1846
1864
  {
1847
1865
  key: c.Resize,
1848
1866
  value: {
1849
- height: m,
1867
+ height: y,
1850
1868
  unit: i,
1851
1869
  width: r
1852
1870
  }
@@ -1938,11 +1956,11 @@ let p = class extends F {
1938
1956
  p.styles = [E, ut];
1939
1957
  p.dependencies = {
1940
1958
  "cx-asset-link-format-crop": u,
1941
- "cx-asset-link-format-extension": U,
1959
+ "cx-asset-link-format-extension": D,
1942
1960
  "cx-asset-link-format-metadata": P,
1943
1961
  "cx-asset-link-format-proxy": C,
1944
1962
  "cx-asset-link-format-quality": A,
1945
- "cx-asset-link-format-resize": f,
1963
+ "cx-asset-link-format-resize": v,
1946
1964
  "cx-asset-link-format-rotation": R,
1947
1965
  "cx-button": q,
1948
1966
  "cx-space": H,
@@ -5,23 +5,23 @@ import { c as z } from "../chunks/custom-element.L4WJXn1j.js";
5
5
  import { w as v } from "../chunks/event.mFzZi4sr.js";
6
6
  import { L as O } from "../chunks/i18n.CgwQHLcP.js";
7
7
  import { M as $ } from "../chunks/modal.U1QltQKe.js";
8
- import { l as m, u as w } from "../chunks/scroll.xtO5yojm.js";
8
+ import { l as m, u } from "../chunks/scroll.xtO5yojm.js";
9
9
  import { H as B } from "../chunks/slot.j5oheLJC.js";
10
10
  import { w as _ } from "../chunks/watch.BCJD77bD.js";
11
11
  import { i as P, x as y } from "../chunks/lit-element.jLBm65_O.js";
12
12
  import { r as S } from "../chunks/state.CSDxrqLd.js";
13
- import { e as u } from "../chunks/query.BBf1UFkC.js";
13
+ import { e as w } from "../chunks/query.BBf1UFkC.js";
14
14
  import { e as g } from "../chunks/class-map.BiVq-cVR.js";
15
15
  import { o as b } from "../chunks/if-defined.BRoBj_Rp.js";
16
16
  import { n as A } from "../chunks/when.Dr1es41R.js";
17
17
  import { c as x } from "../chunks/capitalize.CNStXZBq.js";
18
- import { s as i, g as c } from "../chunks/animation-registry.HmpwNuGH.js";
18
+ import { s as r, g as c } from "../chunks/animation-registry.HmpwNuGH.js";
19
19
  import { C as q } from "../chunks/icon-button.BpwPU4Vg.js";
20
20
  const D = P`:host{--size:25rem;--header-spacing:var(--cx-spacing-large);--body-spacing:var(--cx-spacing-large);--footer-spacing:var(--cx-spacing-large);--font-family:var(--cx-font-sans);display:contents}.drawer{top:0;pointer-events:none;width:0;height:0;inset-inline-start:0;overflow:hidden}.drawer--open{width:100%;height:100%}.drawer--persistent.drawer--open{width:var(--size);min-width:var(--size)}.drawer--contained{z-index:initial;position:absolute}.drawer--persistent{position:relative}.drawer--fixed{z-index:var(--cx-z-index-drawer);position:fixed}.drawer__panel{z-index:2;background-color:var(--cx-panel-background-color);max-width:100%;max-height:100%;box-shadow:var(--cx-shadow-large);pointer-events:all;flex-direction:column;display:flex;position:absolute;overflow:auto}.drawer__panel:focus{outline:none}.drawer--top .drawer__panel{top:0;inset-inline-end:auto;bottom:auto;width:100%;height:var(--size);inset-inline-start:0}.drawer--end .drawer__panel{top:0;inset-inline-end:0;bottom:auto;width:var(--size);height:100%;inset-inline-start:auto}.drawer--bottom .drawer__panel{top:auto;inset-inline-end:auto;bottom:0;width:100%;height:var(--size);inset-inline-start:0}.drawer--start .drawer__panel{top:0;inset-inline-end:auto;bottom:auto;width:var(--size);height:100%;inset-inline-start:0}.drawer__header{gap:var(--cx-spacing-small);padding:var(--header-spacing);border-bottom:solid 1px var(--cx-input-border-color);font-family:var(--font-family);display:flex}.drawer__title{font:inherit;font-size:var(--cx-font-size-large);font-weight:var(--cx-font-weight-semibold);line-height:var(--cx-line-height-medium);flex:auto;align-items:center;margin:0;display:flex}.drawer__header-actions{justify-content:end;gap:var(--cx-spacing-2x-small);flex-wrap:wrap;flex-shrink:0;display:flex}.drawer__header-actions cx-icon-button,.drawer__header-actions ::slotted(cx-icon-button){font-size:var(--cx-font-size-medium);flex:none;align-items:center;display:flex}.drawer__body{padding:var(--body-spacing);-webkit-overflow-scrolling:touch;font-family:var(--font-family);flex:auto;display:block;overflow:auto}.drawer__footer{text-align:right;padding:var(--footer-spacing);font-family:var(--font-family)}.drawer__footer ::slotted(cx-button:not(:last-of-type)){margin-inline-end:var(--cx-spacing-x-small)}.drawer:not(.drawer--has-footer) .drawer__footer{display:none}.drawer__overlay{background-color:var(--cx-overlay-background-color);pointer-events:all;display:block;position:fixed;inset:0}.drawer--contained .drawer__overlay{opacity:0;position:absolute}.drawer__overlay--disabled{display:none}@media (forced-colors:active){.drawer__panel{border:solid 1px var(--cx-color-neutral-0)}}`;
21
- var L = Object.defineProperty, E = Object.getOwnPropertyDescriptor, a = (e, o, r, l) => {
22
- for (var s = l > 1 ? void 0 : l ? E(o, r) : o, h = e.length - 1, f; h >= 0; h--)
23
- (f = e[h]) && (s = (l ? f(o, r, s) : f(s)) || s);
24
- return l && s && L(o, r, s), s;
21
+ var E = Object.defineProperty, L = Object.getOwnPropertyDescriptor, i = (e, a, o, l) => {
22
+ for (var s = l > 1 ? void 0 : l ? L(a, o) : a, h = e.length - 1, f; h >= 0; h--)
23
+ (f = e[h]) && (s = (l ? f(a, o, s) : f(s)) || s);
24
+ return l && s && E(a, o, s), s;
25
25
  };
26
26
  let t = class extends C {
27
27
  constructor() {
@@ -33,7 +33,7 @@ let t = class extends C {
33
33
  this.drawer.hidden = !this.open, this.open && (this.addOpenListeners(), this.contained || (this.modal.activate(), m(this)));
34
34
  }
35
35
  disconnectedCallback() {
36
- super.disconnectedCallback(), w(this), this.removeOpenListeners();
36
+ super.disconnectedCallback(), u(this), this.removeOpenListeners();
37
37
  }
38
38
  willUpdate(e) {
39
39
  if (super.willUpdate(e), !e.has("open"))
@@ -45,10 +45,10 @@ let t = class extends C {
45
45
  cancelable: !0,
46
46
  detail: { source: e }
47
47
  }).defaultPrevented) {
48
- const r = c(this, "drawer.denyClose", {
48
+ const o = c(this, "drawer.denyClose", {
49
49
  dir: this.localize.dir()
50
50
  });
51
- d(this.panel, r.keyframes, r.options);
51
+ d(this.panel, o.keyframes, o.options);
52
52
  return;
53
53
  }
54
54
  this.hide();
@@ -59,6 +59,11 @@ let t = class extends C {
59
59
  removeOpenListeners() {
60
60
  document.removeEventListener("keydown", this.handleDocumentKeyDown), this.closeWatcher?.destroy();
61
61
  }
62
+ resetMultipleMenus() {
63
+ [...this.querySelectorAll("cx-menu")].forEach((a) => {
64
+ a.variant === "multiple" && a.resetActiveMenu();
65
+ });
66
+ }
62
67
  async handleOpenChange() {
63
68
  if (this.open) {
64
69
  this.emit("cx-show"), this.addOpenListeners(), this.originalTrigger = document.activeElement, this.contained || (this.modal.activate(), m(this));
@@ -73,25 +78,25 @@ let t = class extends C {
73
78
  preventScroll: !0
74
79
  }) : this.panel.focus({ preventScroll: !0 })), e && e.setAttribute("autofocus", "");
75
80
  });
76
- const o = c(
81
+ const a = c(
77
82
  this,
78
83
  `drawer.show${x(this.placement)}`,
79
84
  {
80
85
  dir: this.localize.dir()
81
86
  }
82
- ), r = c(this, "drawer.overlay.show", {
87
+ ), o = c(this, "drawer.overlay.show", {
83
88
  dir: this.localize.dir()
84
89
  });
85
90
  await Promise.all([
86
- d(this.panel, o.keyframes, o.options),
91
+ d(this.panel, a.keyframes, a.options),
87
92
  this.contained ? Promise.resolve() : d(
88
93
  this.overlay,
89
- r.keyframes,
90
- r.options
94
+ o.keyframes,
95
+ o.options
91
96
  )
92
97
  ]), this.emit("cx-after-show");
93
98
  } else {
94
- this.emit("cx-hide"), this.removeOpenListeners(), this.contained || (this.modal.deactivate(), w(this)), await Promise.all([
99
+ this.emit("cx-hide"), this.removeOpenListeners(), this.contained || (this.modal.deactivate(), u(this)), await Promise.all([
95
100
  p(this.drawer),
96
101
  p(this.overlay)
97
102
  ]);
@@ -101,14 +106,14 @@ let t = class extends C {
101
106
  {
102
107
  dir: this.localize.dir()
103
108
  }
104
- ), o = c(this, "drawer.overlay.hide", {
109
+ ), a = c(this, "drawer.overlay.hide", {
105
110
  dir: this.localize.dir()
106
111
  });
107
112
  await Promise.all([
108
113
  (this.contained ? Promise.resolve() : d(
109
114
  this.overlay,
110
- o.keyframes,
111
- o.options
115
+ a.keyframes,
116
+ a.options
112
117
  )).then(() => {
113
118
  this.overlay.hidden = !0;
114
119
  }),
@@ -120,12 +125,12 @@ let t = class extends C {
120
125
  this.panel.hidden = !0;
121
126
  })
122
127
  ]), this.drawer.hidden = !0, this.isClosing = !1, this.overlay.hidden = !1, this.panel.hidden = !1;
123
- const r = this.originalTrigger;
124
- typeof r?.focus == "function" && setTimeout(() => r.focus()), this.emit("cx-after-hide");
128
+ const o = this.originalTrigger;
129
+ typeof o?.focus == "function" && setTimeout(() => o.focus()), this.resetMultipleMenus(), this.emit("cx-after-hide");
125
130
  }
126
131
  }
127
132
  handleNoModalChange() {
128
- this.open && !this.contained && (this.modal.activate(), m(this)), this.open && this.contained && (this.modal.deactivate(), w(this));
133
+ this.open && !this.contained && (this.modal.activate(), m(this)), this.open && this.contained && (this.modal.deactivate(), u(this));
129
134
  }
130
135
  /** Shows the drawer. */
131
136
  async show() {
@@ -168,63 +173,63 @@ let t = class extends C {
168
173
  };
169
174
  t.styles = [k, D];
170
175
  t.dependencies = { "cx-icon-button": q };
171
- a([
172
- u(".drawer")
176
+ i([
177
+ w(".drawer")
173
178
  ], t.prototype, "drawer", 2);
174
- a([
175
- u(".drawer__panel")
179
+ i([
180
+ w(".drawer__panel")
176
181
  ], t.prototype, "panel", 2);
177
- a([
178
- u(".drawer__overlay")
182
+ i([
183
+ w(".drawer__overlay")
179
184
  ], t.prototype, "overlay", 2);
180
- a([
185
+ i([
181
186
  S()
182
187
  ], t.prototype, "isClosing", 2);
183
- a([
188
+ i([
184
189
  n({ reflect: !0, type: Boolean })
185
190
  ], t.prototype, "open", 2);
186
- a([
191
+ i([
187
192
  n({ reflect: !0 })
188
193
  ], t.prototype, "label", 2);
189
- a([
194
+ i([
190
195
  n({ reflect: !0 })
191
196
  ], t.prototype, "placement", 2);
192
- a([
197
+ i([
193
198
  n({ reflect: !0, type: Boolean })
194
199
  ], t.prototype, "contained", 2);
195
- a([
200
+ i([
196
201
  n({ attribute: "no-header", reflect: !0, type: Boolean })
197
202
  ], t.prototype, "noHeader", 2);
198
- a([
203
+ i([
199
204
  n({ reflect: !0, type: String })
200
205
  ], t.prototype, "variant", 2);
201
- a([
206
+ i([
202
207
  n({ attribute: "no-close-button", reflect: !0, type: Boolean })
203
208
  ], t.prototype, "noCloseButton", 2);
204
- a([
209
+ i([
205
210
  _("open", { waitUntilFirstUpdate: !0 })
206
211
  ], t.prototype, "handleOpenChange", 1);
207
- a([
212
+ i([
208
213
  _("contained", { waitUntilFirstUpdate: !0 })
209
214
  ], t.prototype, "handleNoModalChange", 1);
210
- t = a([
215
+ t = i([
211
216
  z("cx-drawer")
212
217
  ], t);
213
- i("drawer.showTop", {
218
+ r("drawer.showTop", {
214
219
  keyframes: [
215
220
  { opacity: 0, translate: "0 -100%" },
216
221
  { opacity: 1, translate: "0 0" }
217
222
  ],
218
223
  options: { duration: 250, easing: "ease" }
219
224
  });
220
- i("drawer.hideTop", {
225
+ r("drawer.hideTop", {
221
226
  keyframes: [
222
227
  { opacity: 1, translate: "0 0" },
223
228
  { opacity: 0, translate: "0 -100%" }
224
229
  ],
225
230
  options: { duration: 250, easing: "ease" }
226
231
  });
227
- i("drawer.showEnd", {
232
+ r("drawer.showEnd", {
228
233
  keyframes: [
229
234
  { opacity: 0, translate: "100%" },
230
235
  { opacity: 1, translate: "0" }
@@ -235,7 +240,7 @@ i("drawer.showEnd", {
235
240
  { opacity: 1, translate: "0" }
236
241
  ]
237
242
  });
238
- i("drawer.hideEnd", {
243
+ r("drawer.hideEnd", {
239
244
  keyframes: [
240
245
  { opacity: 1, translate: "0" },
241
246
  { opacity: 0, translate: "100%" }
@@ -246,21 +251,21 @@ i("drawer.hideEnd", {
246
251
  { opacity: 0, translate: "-100%" }
247
252
  ]
248
253
  });
249
- i("drawer.showBottom", {
254
+ r("drawer.showBottom", {
250
255
  keyframes: [
251
256
  { opacity: 0, translate: "0 100%" },
252
257
  { opacity: 1, translate: "0 0" }
253
258
  ],
254
259
  options: { duration: 250, easing: "ease" }
255
260
  });
256
- i("drawer.hideBottom", {
261
+ r("drawer.hideBottom", {
257
262
  keyframes: [
258
263
  { opacity: 1, translate: "0 0" },
259
264
  { opacity: 0, translate: "0 100%" }
260
265
  ],
261
266
  options: { duration: 250, easing: "ease" }
262
267
  });
263
- i("drawer.showStart", {
268
+ r("drawer.showStart", {
264
269
  keyframes: [
265
270
  { opacity: 0, translate: "-100%" },
266
271
  { opacity: 1, translate: "0" }
@@ -271,7 +276,7 @@ i("drawer.showStart", {
271
276
  { opacity: 1, translate: "0" }
272
277
  ]
273
278
  });
274
- i("drawer.hideStart", {
279
+ r("drawer.hideStart", {
275
280
  keyframes: [
276
281
  { opacity: 1, translate: "0" },
277
282
  { opacity: 0, translate: "-100%" }
@@ -282,15 +287,15 @@ i("drawer.hideStart", {
282
287
  { opacity: 0, translate: "100%" }
283
288
  ]
284
289
  });
285
- i("drawer.denyClose", {
290
+ r("drawer.denyClose", {
286
291
  keyframes: [{ scale: 1 }, { scale: 1.01 }, { scale: 1 }],
287
292
  options: { duration: 250 }
288
293
  });
289
- i("drawer.overlay.show", {
294
+ r("drawer.overlay.show", {
290
295
  keyframes: [{ opacity: 0 }, { opacity: 1 }],
291
296
  options: { duration: 250 }
292
297
  });
293
- i("drawer.overlay.hide", {
298
+ r("drawer.overlay.hide", {
294
299
  keyframes: [{ opacity: 1 }, { opacity: 0 }],
295
300
  options: { duration: 250 }
296
301
  });
@@ -1,24 +1,25 @@
1
- import { n as c, C as f } from "../chunks/lib-cortex-element.CVMmyPMC.js";
2
- import { c as p } from "../chunks/component.styles.CRO4Odto.js";
3
- import { c as b } from "../chunks/custom-element.L4WJXn1j.js";
4
- import { L as g } from "../chunks/i18n.CgwQHLcP.js";
5
- import { i as v, x as d } from "../chunks/lit-element.jLBm65_O.js";
6
- import { r as y } from "../chunks/state.CSDxrqLd.js";
7
- import { e as w } from "../chunks/query.BBf1UFkC.js";
8
- import { n as x } from "../chunks/when.Dr1es41R.js";
9
- import M from "./menu-item.js";
10
- const k = v`:host{background:var(--cx-panel-background-color);border:solid var(--cx-panel-border-width) var(--cx-panel-border-color);border-radius:var(--cx-border-radius-large);padding:var(--cx-spacing-x-small) 0;--divider-color:var(--cx-panel-border-color);--divider-width:var(--cx-panel-border-width);--divider-spacing:var(--cx-spacing-x-small);display:block;position:relative;overflow:auto}:host([horizontal]){padding:0 var(--cx-spacing-x-small);flex-wrap:wrap;justify-content:space-between;display:flex}::slotted(cx-divider){--color:var(--divider-color);--width:var(--divider-width);--spacing:var(--divider-spacing)}::slotted([data-alternating-grouping]):before{content:" ";background-color:var(--divider-color);margin:var(--divider-spacing) 0;height:var(--divider-width);display:block}::slotted([data-alternating-grouping=horizontal]):before{height:100%;margin:0 var(--divider-spacing);width:var(--divider-width);display:inline-block}:host([horizontal]) ::slotted(cx-menu-section){flex-wrap:wrap;justify-content:space-between;display:flex}:host([horizontal]) ::slotted(cx-menu-item){display:flex}:host([variant=multiple]){position:relative;overflow:hidden}:host([variant=multiple]) ::slotted(cx-menu[name]){opacity:0;pointer-events:none;transition:opacity var(--cx-transition-fast) ease-in-out, transform var(--cx-transition-medium) ease-in-out;border:none;position:absolute;top:0;left:0;transform:translate(-50%)}:host([variant=multiple]) ::slotted(cx-menu[active]){opacity:1;pointer-events:auto;transform:translate(0)}.back__button::part(checked-icon),.back__button::part(submenu-icon){display:none}.back__divider{--spacing:var(--cx-spacing-x-small)}`;
11
- var A = Object.defineProperty, I = Object.getOwnPropertyDescriptor, u = (e, t, r, i) => {
12
- for (var o = i > 1 ? void 0 : i ? I(t, r) : t, h = e.length - 1, n; h >= 0; h--)
1
+ import { n as c, C as p } from "../chunks/lib-cortex-element.CVMmyPMC.js";
2
+ import { c as b } from "../chunks/component.styles.CRO4Odto.js";
3
+ import { c as g } from "../chunks/custom-element.L4WJXn1j.js";
4
+ import { L as v } from "../chunks/i18n.CgwQHLcP.js";
5
+ import { i as y, x as f } from "../chunks/lit-element.jLBm65_O.js";
6
+ import { r as w } from "../chunks/state.CSDxrqLd.js";
7
+ import { e as x } from "../chunks/query.BBf1UFkC.js";
8
+ import { n as M } from "../chunks/when.Dr1es41R.js";
9
+ import k from "./menu-item.js";
10
+ var d = /* @__PURE__ */ ((e) => (e.Default = "default", e.Multiple = "multiple", e))(d || {});
11
+ const A = y`:host{background:var(--cx-panel-background-color);border:solid var(--cx-panel-border-width) var(--cx-panel-border-color);border-radius:var(--cx-border-radius-large);padding:var(--cx-spacing-x-small) 0;--divider-color:var(--cx-panel-border-color);--divider-width:var(--cx-panel-border-width);--divider-spacing:var(--cx-spacing-x-small);display:block;position:relative;overflow:auto}:host([horizontal]){padding:0 var(--cx-spacing-x-small);flex-wrap:wrap;justify-content:space-between;display:flex}::slotted(cx-divider){--color:var(--divider-color);--width:var(--divider-width);--spacing:var(--divider-spacing)}::slotted([data-alternating-grouping]):before{content:" ";background-color:var(--divider-color);margin:var(--divider-spacing) 0;height:var(--divider-width);display:block}::slotted([data-alternating-grouping=horizontal]):before{height:100%;margin:0 var(--divider-spacing);width:var(--divider-width);display:inline-block}:host([horizontal]) ::slotted(cx-menu-section){flex-wrap:wrap;justify-content:space-between;display:flex}:host([horizontal]) ::slotted(cx-menu-item){display:flex}:host([variant=multiple]){position:relative;overflow:hidden}:host([variant=multiple]) ::slotted(cx-menu[name]){opacity:0;pointer-events:none;transition:opacity var(--cx-transition-fast) ease-in-out, transform var(--cx-transition-medium) ease-in-out;border:none;top:0;left:0;transform:translate(-50%);position:absolute!important}:host([variant=multiple]) ::slotted(cx-menu[active]){opacity:1;pointer-events:auto;transform:translate(0)}.back__button::part(checked-icon),.back__button::part(submenu-icon){display:none}.back__divider{--spacing:var(--cx-spacing-x-small)}`;
12
+ var I = Object.defineProperty, C = Object.getOwnPropertyDescriptor, u = (e, t, r, i) => {
13
+ for (var o = i > 1 ? void 0 : i ? C(t, r) : t, h = e.length - 1, n; h >= 0; h--)
13
14
  (n = e[h]) && (o = (i ? n(t, r, o) : n(o)) || o);
14
- return i && o && A(t, r, o), o;
15
+ return i && o && I(t, r, o), o;
15
16
  };
16
17
  function m(e) {
17
18
  return e.tagName.toLowerCase() === "cx-menu" && e instanceof l && e.getAttribute("role") === "menu";
18
19
  }
19
- let l = class extends f {
20
+ let l = class extends p {
20
21
  constructor() {
21
- super(...arguments), this.localize = new g(this), this.horizontal = !1, this.variant = "default", this.active = !1, this.name = "", this.back = "", this.default = !1, this.bubbleKeyDown = !1, this.ignoredKeys = [], this.disabledTabLoop = !1, this.resizeObserver = null, this.slotMutationObserver = null;
22
+ super(...arguments), this.localize = new v(this), this.horizontal = !1, this.variant = d.Default, this.active = !1, this.name = "", this.back = "", this.default = !1, this.bubbleKeyDown = !1, this.ignoredKeys = [], this.disabledTabLoop = !1, this.resizeObserver = null, this.slotMutationObserver = null;
22
23
  }
23
24
  connectedCallback() {
24
25
  super.connectedCallback(), this.setAttribute("role", "menu"), this.slotMutationObserver = new MutationObserver(() => this.handleSlotChange()), this.slotMutationObserver.observe(this, {
@@ -31,7 +32,7 @@ let l = class extends f {
31
32
  super.disconnectedCallback(), this.resizeObserver && (this.resizeObserver.disconnect(), this.resizeObserver = null), this.slotMutationObserver && (this.slotMutationObserver.disconnect(), this.slotMutationObserver = null);
32
33
  }
33
34
  runFirstUpdated() {
34
- if (this.variant === "multiple") {
35
+ if (this.variant === d.Multiple) {
35
36
  const e = this.getAllSubMenus();
36
37
  this.setActiveMenu(e[0]?.name ?? ""), this.updateComplete.then(() => {
37
38
  this.adjustMenuSize();
@@ -72,7 +73,7 @@ let l = class extends f {
72
73
  ].includes(e.key)) {
73
74
  const t = this.getAllItems(), r = this.getCurrentItem();
74
75
  let i = r ? t.indexOf(r) : 0;
75
- if (["ArrowLeft", "ArrowRight"].includes(e.key) && !this.bubbleKeyDown && !(this.parentElement instanceof l) && !(this.parentElement instanceof M) && e.stopPropagation(), t.length > 0) {
76
+ if (["ArrowLeft", "ArrowRight"].includes(e.key) && !this.bubbleKeyDown && !(this.parentElement instanceof l) && !(this.parentElement instanceof k) && e.stopPropagation(), t.length > 0) {
76
77
  const o = this.horizontal ? e.key === "ArrowRight" || i === t.length - 1 && e.key === "ArrowDown" : e.key === "ArrowDown", h = this.horizontal ? e.key === "ArrowLeft" || i === 0 && e.key === "ArrowUp" : e.key === "ArrowUp";
77
78
  if (["ArrowRight", "ArrowDown", "ArrowLeft", "ArrowUp"].includes(
78
79
  e.key
@@ -265,16 +266,16 @@ let l = class extends f {
265
266
  });
266
267
  }
267
268
  render() {
268
- const e = x(
269
+ const e = M(
269
270
  this.back,
270
- () => d`<slot name="back-button" role="menuitem" menu=${this.back}><cx-menu-item part="back-button" class="back__button" menu=${this.back}><cx-icon slot="prefix" name="chevron_left"></cx-icon>${this.localize.term("back")}</cx-menu-item><cx-divider class="back__divider"></cx-divider></slot>`
271
+ () => f`<slot name="back-button" role="menuitem" menu=${this.back}><cx-menu-item part="back-button" class="back__button" menu=${this.back}><cx-icon slot="prefix" name="chevron_left"></cx-icon>${this.localize.term("back")}</cx-menu-item><cx-divider class="back__divider"></cx-divider></slot>`
271
272
  );
272
- return this.variant === "multiple" ? d`${e}<slot @slotchange=${this.handleSlotChange} @click=${this.handleClick} @keydown=${this.handleKeyDown} @mousedown=${this.handleMouseDown}></slot>` : d`${e}<slot @slotchange=${this.handleSlotChange} @click=${this.handleClick} @keydown=${this.handleKeyDown} @mousedown=${this.handleMouseDown}></slot>`;
273
+ return this.variant === d.Multiple ? f`${e}<slot @slotchange=${this.handleSlotChange} @click=${this.handleClick} @keydown=${this.handleKeyDown} @mousedown=${this.handleMouseDown}></slot>` : f`${e}<slot @slotchange=${this.handleSlotChange} @click=${this.handleClick} @keydown=${this.handleKeyDown} @mousedown=${this.handleMouseDown}></slot>`;
273
274
  }
274
275
  };
275
- l.styles = [p, k];
276
+ l.styles = [b, A];
276
277
  u([
277
- w("slot")
278
+ x("slot")
278
279
  ], l.prototype, "defaultSlot", 2);
279
280
  u([
280
281
  c({ type: Boolean })
@@ -311,10 +312,10 @@ u([
311
312
  c({ attribute: "disabled-tab-loop", reflect: !0, type: Boolean })
312
313
  ], l.prototype, "disabledTabLoop", 2);
313
314
  u([
314
- y()
315
+ w()
315
316
  ], l.prototype, "resizeObserver", 2);
316
317
  l = u([
317
- b("cx-menu")
318
+ g("cx-menu")
318
319
  ], l);
319
320
  export {
320
321
  l as default
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@orangelogic/design-system",
3
3
  "type": "module",
4
- "version": "2.88.0",
4
+ "version": "2.90.0",
5
5
  "license": "UNLICENSED",
6
6
  "types": "library/types.d.ts",
7
7
  "scripts": {
@@ -10,6 +10,7 @@
10
10
  "build-worker": "vite build --config ./vite.worker.config.js",
11
11
  "build": "vite build --config vite.config.ts && bun run build-worker && node ./scripts/remove-index-html-file.js && node ./scripts/copy-entry-file.js",
12
12
  "start": "vite",
13
+ "dev-build": "vite build --config vite.dev-build.config.ts",
13
14
  "open": "npx playwright test --project=chromium --ui",
14
15
  "playwright": "npx playwright test --project=chromium",
15
16
  "build-library": "bun run build && vite build --config ./vite.library.config.ts",
@@ -27,8 +28,12 @@
27
28
  "types": "./library/types.d.ts"
28
29
  },
29
30
  "./components/*": {
30
- "import": "./library/components/*",
31
- "types": "./library/components/*.d.ts"
31
+ "types": "./library/components/*.d.ts",
32
+ "import": "./library/components/*.js"
33
+ },
34
+ "./components/*.js": {
35
+ "types": "./library/components/*.d.ts",
36
+ "import": "./library/components/*.js"
32
37
  },
33
38
  "./utils": {
34
39
  "types": "./library/utils.d.ts",
@@ -109,6 +109,7 @@ export default class CxDrawer extends CortexElement {
109
109
  private requestClose;
110
110
  private addOpenListeners;
111
111
  private removeOpenListeners;
112
+ private resetMultipleMenus;
112
113
  private handleDocumentKeyDown;
113
114
  handleOpenChange(): Promise<void>;
114
115
  handleNoModalChange(): void;
@@ -1,4 +1,5 @@
1
1
  import { default as CortexElement } from '../../../../base/src/cortex-element.ts';
2
+ import { MenuMode } from '../../../../types/src/menu';
2
3
  import { CSSResultGroup } from 'lit';
3
4
  import { default as CxMenuItem } from '../menu-item/menu-item';
4
5
 
@@ -23,7 +24,7 @@ export default class CxMenu extends CortexElement {
23
24
  defaultSlot: HTMLSlotElement;
24
25
  horizontal: boolean;
25
26
  /** The menu's variant */
26
- variant: 'default' | 'multiple';
27
+ variant: MenuMode.Default | MenuMode.Multiple;
27
28
  /** Whether the menu is currently active, used for 'multiple' variant */
28
29
  active: boolean;
29
30
  /** The name of the menu, used for 'multiple' variant */
@@ -0,0 +1,4 @@
1
+ export declare enum MenuMode {
2
+ Default = "default",
3
+ Multiple = "multiple"
4
+ }
@@ -5004,7 +5004,7 @@
5004
5004
  /**
5005
5005
  * The selection behavior of the tree. Single selection allows only one node to be selected at a time. Multiple displays checkboxes and allows more than one node to be selected. Leaf allows only leaf nodes to be selected.
5006
5006
  */
5007
- selection?: 'multiple' | 'single' | 'leaf';
5007
+ selection?: 'single' | 'multiple' | 'leaf';
5008
5008
  /**
5009
5009
  * Whether to automatically expand after loading finishes.
5010
5010
  */
@@ -6016,7 +6016,7 @@
6016
6016
  /**
6017
6017
  *
6018
6018
  */
6019
- selection?: 'multiple' | 'single';
6019
+ selection?: 'single' | 'multiple';
6020
6020
  /**
6021
6021
  *
6022
6022
  */
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@orangelogic/design-system",
3
3
  "type": "module",
4
- "version": "2.88.0",
4
+ "version": "2.90.0",
5
5
  "license": "UNLICENSED",
6
6
  "types": "library/types.d.ts",
7
7
  "scripts": {
@@ -10,6 +10,7 @@
10
10
  "build-worker": "vite build --config ./vite.worker.config.js",
11
11
  "build": "vite build --config vite.config.ts && bun run build-worker && node ./scripts/remove-index-html-file.js && node ./scripts/copy-entry-file.js",
12
12
  "start": "vite",
13
+ "dev-build": "vite build --config vite.dev-build.config.ts",
13
14
  "open": "npx playwright test --project=chromium --ui",
14
15
  "playwright": "npx playwright test --project=chromium",
15
16
  "build-library": "bun run build && vite build --config ./vite.library.config.ts",
@@ -27,8 +28,12 @@
27
28
  "types": "./library/types.d.ts"
28
29
  },
29
30
  "./components/*": {
30
- "import": "./library/components/*",
31
- "types": "./library/components/*.d.ts"
31
+ "types": "./library/components/*.d.ts",
32
+ "import": "./library/components/*.js"
33
+ },
34
+ "./components/*.js": {
35
+ "types": "./library/components/*.d.ts",
36
+ "import": "./library/components/*.js"
32
37
  },
33
38
  "./utils": {
34
39
  "types": "./library/utils.d.ts",