@coolms/ui-react 0.1.0-alpha.12 → 0.1.0-alpha.13
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.
- package/CHANGELOG.md +6 -0
- package/dist/components/FileViewer.d.ts +4 -1
- package/dist/index.js +138 -138
- package/package.json +1 -1
- package/src/kit.css +2 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to `@coolms/ui-react` are listed here. Versions follow [semantic versioning](https://semver.org/).
|
|
4
4
|
|
|
5
|
+
## 0.1.0-alpha.13 (2026-11-17)
|
|
6
|
+
|
|
7
|
+
The viewer's side arrows say where they go, and the next one stands clear of the scrollbar.
|
|
8
|
+
|
|
9
|
+
- `FileViewer`: each side arrow's label (`siblings.previousLabel` / `nextLabel`) is also its tooltip, so the caller's words ("Next attachment: Receipt.pdf") show on hover. The next arrow stands 20px further in from the content's right edge, clear of the content's own vertical scrollbar.
|
|
10
|
+
|
|
5
11
|
## 0.1.0-alpha.12 (2026-11-16)
|
|
6
12
|
|
|
7
13
|
A disabled action's reason is read out with it, and a press shows it.
|
|
@@ -5,7 +5,10 @@ export interface FileViewerAction {
|
|
|
5
5
|
readonly icon: ReactNode;
|
|
6
6
|
readonly onSelect: () => void;
|
|
7
7
|
}
|
|
8
|
-
/**
|
|
8
|
+
/**
|
|
9
|
+
* The other files of a set, for previous and next. A side with no handler is that end of the list, and draws no arrow.
|
|
10
|
+
* Each label names where its arrow goes ("Next attachment: Receipt.pdf"), as its accessible name and its tooltip.
|
|
11
|
+
*/
|
|
9
12
|
export interface FileViewerSiblings {
|
|
10
13
|
readonly position: string;
|
|
11
14
|
readonly index: number;
|
package/dist/index.js
CHANGED
|
@@ -38,19 +38,19 @@ function ee({
|
|
|
38
38
|
locked: t = !1,
|
|
39
39
|
lockedReason: r,
|
|
40
40
|
icon: m,
|
|
41
|
-
disabled:
|
|
41
|
+
disabled: d,
|
|
42
42
|
className: i,
|
|
43
43
|
children: u,
|
|
44
|
-
type:
|
|
44
|
+
type: o = "button",
|
|
45
45
|
title: _,
|
|
46
46
|
...h
|
|
47
47
|
}) {
|
|
48
|
-
const c = !!
|
|
48
|
+
const c = !!d || l;
|
|
49
49
|
return /* @__PURE__ */ s(
|
|
50
50
|
"button",
|
|
51
51
|
{
|
|
52
52
|
...h,
|
|
53
|
-
type:
|
|
53
|
+
type: o,
|
|
54
54
|
className: C("cms-button", `cms-button--${n}`, l && "is-busy", t && "is-locked", i),
|
|
55
55
|
disabled: c,
|
|
56
56
|
"aria-busy": l || void 0,
|
|
@@ -83,16 +83,16 @@ function Ee(n, l) {
|
|
|
83
83
|
const a = [l.error != null && `${n}-error`, l.pinned != null && `${n}-pinned`, l.help != null && `${n}-help`].filter(Boolean).join(" ");
|
|
84
84
|
return a === "" ? void 0 : a;
|
|
85
85
|
}
|
|
86
|
-
function hn({ label: n, help: l, error: a, disabled: t, readOnly: r, pinned: m, value:
|
|
86
|
+
function hn({ label: n, help: l, error: a, disabled: t, readOnly: r, pinned: m, value: d, onChange: i, placeholder: u, type: o = "text", name: _ }) {
|
|
87
87
|
const h = J();
|
|
88
88
|
return /* @__PURE__ */ e(De, { id: h, label: n, help: l, error: a, pinned: m, children: /* @__PURE__ */ e(
|
|
89
89
|
"input",
|
|
90
90
|
{
|
|
91
91
|
id: h,
|
|
92
92
|
name: _,
|
|
93
|
-
type:
|
|
93
|
+
type: o,
|
|
94
94
|
className: "cms-input",
|
|
95
|
-
value:
|
|
95
|
+
value: d,
|
|
96
96
|
placeholder: u,
|
|
97
97
|
disabled: t,
|
|
98
98
|
readOnly: r || m != null,
|
|
@@ -102,13 +102,13 @@ function hn({ label: n, help: l, error: a, disabled: t, readOnly: r, pinned: m,
|
|
|
102
102
|
}
|
|
103
103
|
) });
|
|
104
104
|
}
|
|
105
|
-
function pn({ label: n, help: l, error: a, disabled: t, readOnly: r, value: m, options:
|
|
106
|
-
const _ = J(), h =
|
|
105
|
+
function pn({ label: n, help: l, error: a, disabled: t, readOnly: r, value: m, options: d, onChange: i, emptyText: u = "Nothing to choose from yet.", name: o }) {
|
|
106
|
+
const _ = J(), h = d.length === 0;
|
|
107
107
|
return /* @__PURE__ */ e(De, { id: _, label: n, help: h ? u : l, error: a, children: /* @__PURE__ */ e(
|
|
108
108
|
"select",
|
|
109
109
|
{
|
|
110
110
|
id: _,
|
|
111
|
-
name:
|
|
111
|
+
name: o,
|
|
112
112
|
className: "cms-input cms-select",
|
|
113
113
|
value: m,
|
|
114
114
|
disabled: t || h,
|
|
@@ -118,23 +118,23 @@ function pn({ label: n, help: l, error: a, disabled: t, readOnly: r, value: m, o
|
|
|
118
118
|
onChange: (c) => {
|
|
119
119
|
r || i == null || i(c.target.value);
|
|
120
120
|
},
|
|
121
|
-
children:
|
|
121
|
+
children: d.map((c) => /* @__PURE__ */ e("option", { value: c.value, disabled: r && c.value !== m, children: c.label }, c.value))
|
|
122
122
|
}
|
|
123
123
|
) });
|
|
124
124
|
}
|
|
125
125
|
function fn({ label: n, checked: l, onChange: a, disabled: t, readOnly: r, help: m }) {
|
|
126
|
-
const
|
|
126
|
+
const d = J();
|
|
127
127
|
return /* @__PURE__ */ s("div", { className: "cms-toggle-row", children: [
|
|
128
128
|
/* @__PURE__ */ e(
|
|
129
129
|
"button",
|
|
130
130
|
{
|
|
131
|
-
id:
|
|
131
|
+
id: d,
|
|
132
132
|
type: "button",
|
|
133
133
|
role: "switch",
|
|
134
134
|
className: C("cms-toggle", l && "is-on"),
|
|
135
135
|
"aria-checked": l,
|
|
136
136
|
"aria-readonly": r || void 0,
|
|
137
|
-
"aria-describedby": m != null ? `${
|
|
137
|
+
"aria-describedby": m != null ? `${d}-help` : void 0,
|
|
138
138
|
disabled: t,
|
|
139
139
|
onClick: () => {
|
|
140
140
|
r || a == null || a(!l);
|
|
@@ -142,12 +142,12 @@ function fn({ label: n, checked: l, onChange: a, disabled: t, readOnly: r, help:
|
|
|
142
142
|
children: /* @__PURE__ */ e("span", { className: "cms-toggle__thumb" })
|
|
143
143
|
}
|
|
144
144
|
),
|
|
145
|
-
/* @__PURE__ */ e("label", { className: "cms-toggle__label", htmlFor:
|
|
146
|
-
m != null ? /* @__PURE__ */ e("p", { className: "cms-field__help", id: `${
|
|
145
|
+
/* @__PURE__ */ e("label", { className: "cms-toggle__label", htmlFor: d, children: n }),
|
|
146
|
+
m != null ? /* @__PURE__ */ e("p", { className: "cms-field__help", id: `${d}-help`, children: m }) : null
|
|
147
147
|
] });
|
|
148
148
|
}
|
|
149
149
|
const Pe = 150;
|
|
150
|
-
function Le({ open: n, title: l, onClose: a, dirty: t = !1, onDirtyClose: r, children: m, footer:
|
|
150
|
+
function Le({ open: n, title: l, onClose: a, dirty: t = !1, onDirtyClose: r, children: m, footer: d, closeLabel: i = "Close", initialFocus: u, className: o }) {
|
|
151
151
|
const [_, h] = D(n), [c, g] = D(!1), N = Z(null), b = Z(null), w = J();
|
|
152
152
|
if (G(() => {
|
|
153
153
|
if (n) {
|
|
@@ -178,7 +178,7 @@ function Le({ open: n, title: l, onClose: a, dirty: t = !1, onDirtyClose: r, chi
|
|
|
178
178
|
"div",
|
|
179
179
|
{
|
|
180
180
|
ref: N,
|
|
181
|
-
className: C("cms-modal",
|
|
181
|
+
className: C("cms-modal", o, c && "is-closing", t && "is-dirty"),
|
|
182
182
|
role: "dialog",
|
|
183
183
|
"aria-modal": "true",
|
|
184
184
|
"aria-labelledby": w,
|
|
@@ -200,25 +200,25 @@ function Le({ open: n, title: l, onClose: a, dirty: t = !1, onDirtyClose: r, chi
|
|
|
200
200
|
/* @__PURE__ */ e("button", { type: "button", className: "cms-icon-button", "aria-label": i, onClick: H, children: /* @__PURE__ */ e(F, { name: "close" }) })
|
|
201
201
|
] }),
|
|
202
202
|
/* @__PURE__ */ e("div", { className: "cms-modal__body", children: m }),
|
|
203
|
-
|
|
203
|
+
d != null ? /* @__PURE__ */ e("footer", { className: "cms-modal__foot", children: d }) : null
|
|
204
204
|
]
|
|
205
205
|
}
|
|
206
206
|
) }),
|
|
207
207
|
document.body
|
|
208
208
|
);
|
|
209
209
|
}
|
|
210
|
-
function _n({ open: n, title: l, message: a, kind: t = "default", confirmLabel: r, cancelLabel: m, closeLabel:
|
|
211
|
-
const
|
|
210
|
+
function _n({ open: n, title: l, message: a, kind: t = "default", confirmLabel: r, cancelLabel: m, closeLabel: d, onConfirm: i, onCancel: u }) {
|
|
211
|
+
const o = t === "discard-changes";
|
|
212
212
|
return /* @__PURE__ */ e(
|
|
213
213
|
Le,
|
|
214
214
|
{
|
|
215
215
|
open: n,
|
|
216
216
|
title: l,
|
|
217
217
|
onClose: u,
|
|
218
|
-
...
|
|
218
|
+
...d === void 0 ? {} : { closeLabel: d },
|
|
219
219
|
footer: /* @__PURE__ */ s(x, { children: [
|
|
220
|
-
/* @__PURE__ */ e(ee, { onClick: u, children: m ?? (
|
|
221
|
-
/* @__PURE__ */ e(ee, { variant: t === "default" ? "primary" : "danger", onClick: i, children: r ?? (
|
|
220
|
+
/* @__PURE__ */ e(ee, { onClick: u, children: m ?? (o ? "Keep editing" : "Cancel") }),
|
|
221
|
+
/* @__PURE__ */ e(ee, { variant: t === "default" ? "primary" : "danger", onClick: i, children: r ?? (o ? "Discard changes" : "Confirm") })
|
|
222
222
|
] }),
|
|
223
223
|
children: t !== "default" ? /* @__PURE__ */ s("p", { className: "cms-confirm__warning", children: [
|
|
224
224
|
/* @__PURE__ */ e(F, { name: "warning" }),
|
|
@@ -272,14 +272,14 @@ function He() {
|
|
|
272
272
|
] });
|
|
273
273
|
}
|
|
274
274
|
function te({ kind: n, title: l, description: a, action: t, placement: r = "block" }) {
|
|
275
|
-
const [m,
|
|
275
|
+
const [m, d] = D(n !== "loading");
|
|
276
276
|
return G(() => {
|
|
277
277
|
if (n !== "loading") {
|
|
278
|
-
|
|
278
|
+
d(!0);
|
|
279
279
|
return;
|
|
280
280
|
}
|
|
281
|
-
|
|
282
|
-
const i = window.setTimeout(() =>
|
|
281
|
+
d(!1);
|
|
282
|
+
const i = window.setTimeout(() => d(!0), Ke());
|
|
283
283
|
return () => window.clearTimeout(i);
|
|
284
284
|
}, [n]), /* @__PURE__ */ s(
|
|
285
285
|
"div",
|
|
@@ -460,7 +460,7 @@ function Ue(n) {
|
|
|
460
460
|
return n.getClientRects().length > 0;
|
|
461
461
|
}
|
|
462
462
|
function Nn(n) {
|
|
463
|
-
const { name: l, badge: a, closeLabel: t, onClose: r, actions: m = [], moreLabel:
|
|
463
|
+
const { name: l, badge: a, closeLabel: t, onClose: r, actions: m = [], moreLabel: d = "More", edit: i, editing: u, siblings: o, bar: _, thumbnails: h, strip: c, onZoom: g, children: N } = n, b = Z(null), w = Z(null), H = J(), [k, S] = D(!1), A = Z(null);
|
|
464
464
|
G(() => {
|
|
465
465
|
var W;
|
|
466
466
|
const v = document.activeElement, E = document.body.style.overflow;
|
|
@@ -479,7 +479,7 @@ function Nn(n) {
|
|
|
479
479
|
const E = A.current, W = v.changedTouches[0];
|
|
480
480
|
if (A.current = null, E === null || W === void 0) return;
|
|
481
481
|
const V = W.clientX - E.x;
|
|
482
|
-
Math.abs(V) < Oe || Math.abs(V) < Math.abs(W.clientY - E.y) || (V > 0 ? (L =
|
|
482
|
+
Math.abs(V) < Oe || Math.abs(V) < Math.abs(W.clientY - E.y) || (V > 0 ? (L = o == null ? void 0 : o.onPrevious) == null || L.call(o) : (X = o == null ? void 0 : o.onNext) == null || X.call(o));
|
|
483
483
|
};
|
|
484
484
|
return ke(
|
|
485
485
|
/* @__PURE__ */ s(
|
|
@@ -501,15 +501,15 @@ function Nn(n) {
|
|
|
501
501
|
if (L.length === 0) return;
|
|
502
502
|
const X = L[0], z = L[L.length - 1];
|
|
503
503
|
v.shiftKey && document.activeElement === X ? (v.preventDefault(), z.focus()) : !v.shiftKey && document.activeElement === z && (v.preventDefault(), X.focus());
|
|
504
|
-
} else u === void 0 && !Ze(v.target) && !v.ctrlKey && !v.metaKey && !v.altKey && (v.key === "ArrowLeft" ? (W =
|
|
504
|
+
} else u === void 0 && !Ze(v.target) && !v.ctrlKey && !v.metaKey && !v.altKey && (v.key === "ArrowLeft" ? (W = o == null ? void 0 : o.onPrevious) == null || W.call(o) : v.key === "ArrowRight" ? (V = o == null ? void 0 : o.onNext) == null || V.call(o) : v.key === "+" || v.key === "=" ? g == null || g("in") : v.key === "-" ? g == null || g("out") : v.key === "0" && (g == null || g("reset")));
|
|
505
505
|
},
|
|
506
506
|
children: [
|
|
507
|
-
|
|
507
|
+
o !== void 0 ? /* @__PURE__ */ e("span", { className: "cms-visually-hidden", role: "status", children: `${l}, ${o.position}` }) : null,
|
|
508
508
|
/* @__PURE__ */ s("header", { className: "cms-viewer__top", children: [
|
|
509
509
|
/* @__PURE__ */ e("button", { ref: w, type: "button", className: "cms-viewer__icon", "aria-label": t, onClick: U, children: /* @__PURE__ */ e(F, { name: "close" }) }),
|
|
510
510
|
/* @__PURE__ */ e("span", { className: "cms-viewer__badge", children: a }),
|
|
511
511
|
/* @__PURE__ */ e("h2", { className: "cms-viewer__name", id: H, title: l, children: l }),
|
|
512
|
-
|
|
512
|
+
o !== void 0 ? /* @__PURE__ */ e("span", { className: "cms-viewer__position", children: o.position }) : null,
|
|
513
513
|
/* @__PURE__ */ e("span", { className: "cms-viewer__space" }),
|
|
514
514
|
u !== void 0 ? /* @__PURE__ */ s(x, { children: [
|
|
515
515
|
/* @__PURE__ */ e("span", { className: "cms-viewer__status", role: "status", children: u.status }),
|
|
@@ -524,7 +524,7 @@ function Nn(n) {
|
|
|
524
524
|
/* @__PURE__ */ e("span", { className: "cms-viewer__wide", children: i.label })
|
|
525
525
|
] }) : null,
|
|
526
526
|
m.length > 0 ? /* @__PURE__ */ s("span", { className: "cms-viewer__more", children: [
|
|
527
|
-
/* @__PURE__ */ e("button", { type: "button", className: "cms-viewer__icon", "aria-label":
|
|
527
|
+
/* @__PURE__ */ e("button", { type: "button", className: "cms-viewer__icon", "aria-label": d, "aria-expanded": k, onClick: () => S((v) => !v), children: /* @__PURE__ */ e(P, { name: "more" }) }),
|
|
528
528
|
k ? /* @__PURE__ */ e("span", { className: "cms-viewer__menu", children: m.map((v) => /* @__PURE__ */ s(
|
|
529
529
|
"button",
|
|
530
530
|
{
|
|
@@ -547,9 +547,9 @@ function Nn(n) {
|
|
|
547
547
|
h != null && u === void 0 ? /* @__PURE__ */ e("nav", { className: "cms-viewer__thumbnails", children: h }) : null,
|
|
548
548
|
/* @__PURE__ */ s("div", { className: "cms-viewer__content", onTouchStart: R, onTouchEnd: ne, children: [
|
|
549
549
|
N,
|
|
550
|
-
u === void 0 && (
|
|
551
|
-
u === void 0 && (
|
|
552
|
-
u === void 0 &&
|
|
550
|
+
u === void 0 && (o != null && o.onPrevious) ? /* @__PURE__ */ e("button", { type: "button", className: "cms-viewer__side cms-viewer__side--previous", "aria-label": o.previousLabel, title: o.previousLabel, onClick: o.onPrevious, children: /* @__PURE__ */ e(F, { name: "back" }) }) : null,
|
|
551
|
+
u === void 0 && (o != null && o.onNext) ? /* @__PURE__ */ e("button", { type: "button", className: "cms-viewer__side cms-viewer__side--next", "aria-label": o.nextLabel, title: o.nextLabel, onClick: o.onNext, children: /* @__PURE__ */ e(F, { name: "back" }) }) : null,
|
|
552
|
+
u === void 0 && o !== void 0 ? /* @__PURE__ */ e("div", { className: "cms-viewer__dots", "aria-hidden": "true", children: Array.from({ length: Math.min(o.total, 7) }, (v, E) => /* @__PURE__ */ e("i", { className: E === Math.min(o.index, 6) ? "is-current" : void 0 }, E)) }) : null
|
|
553
553
|
] })
|
|
554
554
|
] }),
|
|
555
555
|
u === void 0 && c != null ? /* @__PURE__ */ e("div", { className: "cms-viewer__strip", children: c }) : null,
|
|
@@ -569,7 +569,7 @@ const Ne = (n, l) => `${n}
|
|
|
569
569
|
${l}`, je = (n, l) => n === "" ? l : `${n}/${l}`, qe = 48;
|
|
570
570
|
function yn(n) {
|
|
571
571
|
var me, ue;
|
|
572
|
-
const { open: l, spaces: a, list: t, disabledReason: r, budget: m, formatSize:
|
|
572
|
+
const { open: l, spaces: a, list: t, disabledReason: r, budget: m, formatSize: d, labels: i, onConfirm: u, onCancel: o } = n, [_, h] = D(((me = a[0]) == null ? void 0 : me.id) ?? ""), [c, g] = D(""), [N, b] = D({ status: "loading" }), [w, H] = D(0), [k, S] = D(/* @__PURE__ */ new Map()), [A, U] = D(0), [R, ne] = D(!1), v = Z(null), E = J();
|
|
573
573
|
G(() => {
|
|
574
574
|
var p;
|
|
575
575
|
l && (h(((p = a[0]) == null ? void 0 : p.id) ?? ""), g(""), S(/* @__PURE__ */ new Map()), ne(!1));
|
|
@@ -619,17 +619,17 @@ function yn(n) {
|
|
|
619
619
|
{
|
|
620
620
|
open: l,
|
|
621
621
|
title: i.title,
|
|
622
|
-
onClose:
|
|
622
|
+
onClose: o,
|
|
623
623
|
closeLabel: i.close,
|
|
624
624
|
initialFocus: v,
|
|
625
625
|
className: "cms-file-picker",
|
|
626
626
|
footer: /* @__PURE__ */ s("div", { className: "cms-file-picker__foot", children: [
|
|
627
627
|
/* @__PURE__ */ s("div", { className: "cms-file-picker__summary", "aria-live": "polite", children: [
|
|
628
|
-
L.length > 0 ? /* @__PURE__ */ e("span", { children: i.total(L.length,
|
|
629
|
-
m !== void 0 && z !== null ? /* @__PURE__ */ e("span", { className: C(Q && "is-over"), children: Q ? i.overBudget : i.left(
|
|
628
|
+
L.length > 0 ? /* @__PURE__ */ e("span", { children: i.total(L.length, d(X)) }) : null,
|
|
629
|
+
m !== void 0 && z !== null ? /* @__PURE__ */ e("span", { className: C(Q && "is-over"), children: Q ? i.overBudget : i.left(d(Math.max(0, z)), d(m.limitBytes)) }) : null
|
|
630
630
|
] }),
|
|
631
631
|
/* @__PURE__ */ s("div", { className: "cms-file-picker__actions", children: [
|
|
632
|
-
/* @__PURE__ */ e(ee, { variant: "secondary", onClick:
|
|
632
|
+
/* @__PURE__ */ e(ee, { variant: "secondary", onClick: o, children: i.cancel }),
|
|
633
633
|
/* @__PURE__ */ e(ee, { variant: "primary", disabled: L.length === 0 || Q, onClick: () => u(L), children: i.confirm(L.length) })
|
|
634
634
|
] })
|
|
635
635
|
] }),
|
|
@@ -703,7 +703,7 @@ function yn(n) {
|
|
|
703
703
|
/* @__PURE__ */ e("span", { className: "cms-file-picker__name", children: p.name }),
|
|
704
704
|
B !== null ? /* @__PURE__ */ e("span", { className: "cms-file-picker__reason", children: B }) : null
|
|
705
705
|
] }),
|
|
706
|
-
p.kind === "file" && p.size != null ? /* @__PURE__ */ e("span", { className: "cms-file-picker__size", children:
|
|
706
|
+
p.kind === "file" && p.size != null ? /* @__PURE__ */ e("span", { className: "cms-file-picker__size", children: d(p.size) }) : null
|
|
707
707
|
]
|
|
708
708
|
},
|
|
709
709
|
p.id
|
|
@@ -745,35 +745,35 @@ function wn({ title: n, scope: l, actions: a, backLink: t }) {
|
|
|
745
745
|
] });
|
|
746
746
|
}
|
|
747
747
|
function kn({ tabs: n, active: l, onSelect: a, label: t }) {
|
|
748
|
-
const r = Z([]), m = (
|
|
748
|
+
const r = Z([]), m = (d, i) => {
|
|
749
749
|
var h;
|
|
750
|
-
const u = n.length - 1,
|
|
751
|
-
if (
|
|
752
|
-
|
|
753
|
-
const _ = n[
|
|
754
|
-
_ && (a(_.id), (h = r.current[
|
|
750
|
+
const u = n.length - 1, o = d.key === "ArrowRight" ? i === u ? 0 : i + 1 : d.key === "ArrowLeft" ? i === 0 ? u : i - 1 : d.key === "Home" ? 0 : d.key === "End" ? u : null;
|
|
751
|
+
if (o === null) return;
|
|
752
|
+
d.preventDefault();
|
|
753
|
+
const _ = n[o];
|
|
754
|
+
_ && (a(_.id), (h = r.current[o]) == null || h.focus());
|
|
755
755
|
};
|
|
756
|
-
return /* @__PURE__ */ e("div", { className: "cms-tabs", role: "tablist", "aria-label": t, children: n.map((
|
|
757
|
-
const u =
|
|
756
|
+
return /* @__PURE__ */ e("div", { className: "cms-tabs", role: "tablist", "aria-label": t, children: n.map((d, i) => {
|
|
757
|
+
const u = d.id === l;
|
|
758
758
|
return /* @__PURE__ */ s(
|
|
759
759
|
"button",
|
|
760
760
|
{
|
|
761
|
-
ref: (
|
|
762
|
-
r.current[i] =
|
|
761
|
+
ref: (o) => {
|
|
762
|
+
r.current[i] = o;
|
|
763
763
|
},
|
|
764
764
|
type: "button",
|
|
765
765
|
role: "tab",
|
|
766
766
|
className: C("cms-tab", u && "is-active"),
|
|
767
767
|
"aria-selected": u,
|
|
768
768
|
tabIndex: u ? 0 : -1,
|
|
769
|
-
onClick: () => a(
|
|
770
|
-
onKeyDown: (
|
|
769
|
+
onClick: () => a(d.id),
|
|
770
|
+
onKeyDown: (o) => m(o, i),
|
|
771
771
|
children: [
|
|
772
|
-
|
|
773
|
-
|
|
772
|
+
d.label,
|
|
773
|
+
d.count !== void 0 ? /* @__PURE__ */ e("span", { className: "cms-tab__count", children: d.count }) : null
|
|
774
774
|
]
|
|
775
775
|
},
|
|
776
|
-
|
|
776
|
+
d.id
|
|
777
777
|
);
|
|
778
778
|
}) });
|
|
779
779
|
}
|
|
@@ -809,9 +809,9 @@ function Ye({ count: n, label: l, max: a = 99 }) {
|
|
|
809
809
|
/* @__PURE__ */ e("span", { className: "cms-visually-hidden", children: l })
|
|
810
810
|
] });
|
|
811
811
|
}
|
|
812
|
-
function xn({ product: n, mark: l, rail: a, active: t, onNavigate: r, server: m, search:
|
|
812
|
+
function xn({ product: n, mark: l, rail: a, active: t, onNavigate: r, server: m, search: d, account: i, children: u, railLabel: o = "Sections" }) {
|
|
813
813
|
return /* @__PURE__ */ s("div", { className: "cms-shell", children: [
|
|
814
|
-
/* @__PURE__ */ s("nav", { className: "cms-shell__rail", "aria-label":
|
|
814
|
+
/* @__PURE__ */ s("nav", { className: "cms-shell__rail", "aria-label": o, children: [
|
|
815
815
|
/* @__PURE__ */ e("span", { className: "cms-shell__mark", "aria-hidden": "true", children: l }),
|
|
816
816
|
/* @__PURE__ */ e("ul", { className: "cms-shell__items", children: a.map((_) => {
|
|
817
817
|
const h = _.id === t;
|
|
@@ -839,7 +839,7 @@ function xn({ product: n, mark: l, rail: a, active: t, onNavigate: r, server: m,
|
|
|
839
839
|
/* @__PURE__ */ s("header", { className: "cms-shell__top", children: [
|
|
840
840
|
/* @__PURE__ */ e("span", { className: "cms-shell__product", children: n }),
|
|
841
841
|
m != null ? /* @__PURE__ */ e("div", { className: "cms-shell__server", children: m }) : null,
|
|
842
|
-
|
|
842
|
+
d != null ? /* @__PURE__ */ e("div", { className: "cms-shell__search", children: d }) : null,
|
|
843
843
|
i != null ? /* @__PURE__ */ e("div", { className: "cms-shell__account", children: i }) : null
|
|
844
844
|
] }),
|
|
845
845
|
/* @__PURE__ */ e("main", { className: "cms-shell__main", children: u })
|
|
@@ -872,35 +872,35 @@ function Mn({ label: n, placeholder: l, value: a, onChange: t, onSearch: r }) {
|
|
|
872
872
|
);
|
|
873
873
|
}
|
|
874
874
|
function Cn({ options: n, value: l, onChange: a, label: t }) {
|
|
875
|
-
const r = Z([]), m = (
|
|
875
|
+
const r = Z([]), m = (d, i) => {
|
|
876
876
|
var h;
|
|
877
|
-
const u = n.length - 1,
|
|
878
|
-
if (
|
|
879
|
-
|
|
880
|
-
const _ = n[
|
|
881
|
-
_ && (a(_.id), (h = r.current[
|
|
877
|
+
const u = n.length - 1, o = d.key === "ArrowRight" || d.key === "ArrowDown" ? i === u ? 0 : i + 1 : d.key === "ArrowLeft" || d.key === "ArrowUp" ? i === 0 ? u : i - 1 : null;
|
|
878
|
+
if (o === null) return;
|
|
879
|
+
d.preventDefault();
|
|
880
|
+
const _ = n[o];
|
|
881
|
+
_ && (a(_.id), (h = r.current[o]) == null || h.focus());
|
|
882
882
|
};
|
|
883
|
-
return /* @__PURE__ */ e("div", { className: "cms-chips", role: "radiogroup", "aria-label": t, children: n.map((
|
|
884
|
-
const u =
|
|
883
|
+
return /* @__PURE__ */ e("div", { className: "cms-chips", role: "radiogroup", "aria-label": t, children: n.map((d, i) => {
|
|
884
|
+
const u = d.id === l;
|
|
885
885
|
return /* @__PURE__ */ s(
|
|
886
886
|
"button",
|
|
887
887
|
{
|
|
888
|
-
ref: (
|
|
889
|
-
r.current[i] =
|
|
888
|
+
ref: (o) => {
|
|
889
|
+
r.current[i] = o;
|
|
890
890
|
},
|
|
891
891
|
type: "button",
|
|
892
892
|
role: "radio",
|
|
893
893
|
"aria-checked": u,
|
|
894
894
|
tabIndex: u ? 0 : -1,
|
|
895
895
|
className: C("cms-chip", u && "is-on"),
|
|
896
|
-
onClick: () => a(
|
|
897
|
-
onKeyDown: (
|
|
896
|
+
onClick: () => a(d.id),
|
|
897
|
+
onKeyDown: (o) => m(o, i),
|
|
898
898
|
children: [
|
|
899
899
|
u ? /* @__PURE__ */ e(P, { name: "check", size: 16 }) : null,
|
|
900
|
-
|
|
900
|
+
d.label
|
|
901
901
|
]
|
|
902
902
|
},
|
|
903
|
-
|
|
903
|
+
d.id
|
|
904
904
|
);
|
|
905
905
|
}) });
|
|
906
906
|
}
|
|
@@ -915,26 +915,26 @@ function Sn({ panes: n, active: l, back: a }) {
|
|
|
915
915
|
] }, r.label)) });
|
|
916
916
|
}
|
|
917
917
|
const Je = { attachment: "Has an attachment", unread: "Unread" };
|
|
918
|
-
function An({ from: n, subject: l, preview: a, time: t, unread: r, hasAttachment: m, selected:
|
|
919
|
-
const
|
|
918
|
+
function An({ from: n, subject: l, preview: a, time: t, unread: r, hasAttachment: m, selected: d, onOpen: i, labels: u }) {
|
|
919
|
+
const o = re(Je, u);
|
|
920
920
|
return /* @__PURE__ */ s(
|
|
921
921
|
"button",
|
|
922
922
|
{
|
|
923
923
|
type: "button",
|
|
924
|
-
className: C("cms-mail-row", r && "is-unread",
|
|
925
|
-
"aria-current":
|
|
924
|
+
className: C("cms-mail-row", r && "is-unread", d && "is-selected"),
|
|
925
|
+
"aria-current": d ? "true" : void 0,
|
|
926
926
|
onClick: i,
|
|
927
927
|
children: [
|
|
928
928
|
/* @__PURE__ */ e(ve, { name: n, size: 40 }),
|
|
929
929
|
/* @__PURE__ */ s("span", { className: "cms-mail-row__body", children: [
|
|
930
930
|
/* @__PURE__ */ s("span", { className: "cms-mail-row__line", children: [
|
|
931
931
|
/* @__PURE__ */ e("span", { className: "cms-mail-row__from", children: n }),
|
|
932
|
-
m ? /* @__PURE__ */ e(P, { name: "paperclip", size: 16, label:
|
|
932
|
+
m ? /* @__PURE__ */ e(P, { name: "paperclip", size: 16, label: o.attachment }) : null,
|
|
933
933
|
/* @__PURE__ */ e("span", { className: "cms-mail-row__time", children: t })
|
|
934
934
|
] }),
|
|
935
935
|
/* @__PURE__ */ s("span", { className: "cms-mail-row__line", children: [
|
|
936
936
|
/* @__PURE__ */ e("span", { className: "cms-mail-row__subject", children: l }),
|
|
937
|
-
r ? /* @__PURE__ */ e("span", { className: "cms-mail-row__dot", role: "img", "aria-label":
|
|
937
|
+
r ? /* @__PURE__ */ e("span", { className: "cms-mail-row__dot", role: "img", "aria-label": o.unread }) : null
|
|
938
938
|
] }),
|
|
939
939
|
/* @__PURE__ */ e("span", { className: "cms-mail-row__preview", children: a })
|
|
940
940
|
] })
|
|
@@ -954,30 +954,30 @@ function Dn({ direction: n, children: l, time: a, read: t, readLabel: r = "Read"
|
|
|
954
954
|
] })
|
|
955
955
|
] });
|
|
956
956
|
}
|
|
957
|
-
function En({ label: n, value: l, onChange: a, onSend: t, onAttach: r, placeholder: m, variant:
|
|
957
|
+
function En({ label: n, value: l, onChange: a, onSend: t, onAttach: r, placeholder: m, variant: d = "chat", sendLabel: i = "Send", attachLabel: u = "Attach a file", leading: o, canSend: _ }) {
|
|
958
958
|
const h = J(), c = _ ?? l.trim() !== "", g = (b) => {
|
|
959
959
|
b.preventDefault(), c && t();
|
|
960
960
|
}, N = r ? /* @__PURE__ */ e("button", { type: "button", className: "cms-icon-button cms-composer__attach", "aria-label": u, onClick: r, children: /* @__PURE__ */ e(P, { name: "paperclip" }) }) : null;
|
|
961
|
-
return /* @__PURE__ */ s("form", { className: C("cms-composer", `cms-composer--${
|
|
962
|
-
/* @__PURE__ */ e("label", { htmlFor: h, className:
|
|
963
|
-
|
|
961
|
+
return /* @__PURE__ */ s("form", { className: C("cms-composer", `cms-composer--${d}`), onSubmit: g, children: [
|
|
962
|
+
/* @__PURE__ */ e("label", { htmlFor: h, className: d === "reply" ? "cms-composer__title" : "cms-visually-hidden", children: n }),
|
|
963
|
+
d === "chat" ? N : null,
|
|
964
964
|
/* @__PURE__ */ e(
|
|
965
965
|
"textarea",
|
|
966
966
|
{
|
|
967
967
|
id: h,
|
|
968
968
|
className: "cms-composer__input",
|
|
969
|
-
rows:
|
|
969
|
+
rows: d === "reply" ? 3 : 1,
|
|
970
970
|
placeholder: m,
|
|
971
971
|
value: l,
|
|
972
972
|
onChange: (b) => a(b.target.value),
|
|
973
973
|
onKeyDown: (b) => {
|
|
974
|
-
b.nativeEvent.isComposing || b.keyCode === 229 ||
|
|
974
|
+
b.nativeEvent.isComposing || b.keyCode === 229 || d === "chat" && b.key === "Enter" && !b.shiftKey && (b.preventDefault(), c && t());
|
|
975
975
|
}
|
|
976
976
|
}
|
|
977
977
|
),
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
978
|
+
d === "reply" && o !== void 0 ? /* @__PURE__ */ e("div", { className: "cms-composer__leading", children: o }) : null,
|
|
979
|
+
d === "reply" ? N : null,
|
|
980
|
+
d === "chat" ? /* @__PURE__ */ e("button", { type: "submit", className: "cms-composer__send-round", "aria-label": i, disabled: !c, children: /* @__PURE__ */ e(P, { name: "send" }) }) : /* @__PURE__ */ s("button", { type: "submit", className: "cms-button cms-button--chrome cms-composer__send", disabled: !c, children: [
|
|
981
981
|
i,
|
|
982
982
|
" ",
|
|
983
983
|
/* @__PURE__ */ e(P, { name: "send", size: 18 })
|
|
@@ -1006,11 +1006,11 @@ const xe = {
|
|
|
1006
1006
|
returnToCall: "Return to call"
|
|
1007
1007
|
};
|
|
1008
1008
|
function Ln({ name: n, media: l, onAccept: a, onDecline: t, labels: r }) {
|
|
1009
|
-
const m = re(xe, r),
|
|
1010
|
-
return /* @__PURE__ */ s("div", { className: "cms-call-incoming", role: "alertdialog", "aria-label": m.incomingFrom(
|
|
1009
|
+
const m = re(xe, r), d = l === "video" ? m.incomingVideo : m.incomingAudio;
|
|
1010
|
+
return /* @__PURE__ */ s("div", { className: "cms-call-incoming", role: "alertdialog", "aria-label": m.incomingFrom(d, n), children: [
|
|
1011
1011
|
/* @__PURE__ */ e("span", { className: "cms-call-incoming__ring", "aria-hidden": "true", children: /* @__PURE__ */ e(ve, { name: n, size: 112 }) }),
|
|
1012
1012
|
/* @__PURE__ */ e("p", { className: "cms-call-incoming__name", children: n }),
|
|
1013
|
-
/* @__PURE__ */ e("p", { className: "cms-call-incoming__what", children:
|
|
1013
|
+
/* @__PURE__ */ e("p", { className: "cms-call-incoming__what", children: d }),
|
|
1014
1014
|
/* @__PURE__ */ s("div", { className: "cms-call-incoming__actions", children: [
|
|
1015
1015
|
/* @__PURE__ */ e(ae, { icon: "phone-off", label: m.decline, tone: "hang-up", onClick: t }),
|
|
1016
1016
|
/* @__PURE__ */ e(ae, { icon: "phone", label: m.accept, tone: "accept", onClick: a })
|
|
@@ -1032,7 +1032,7 @@ function ae({ icon: n, label: l, onClick: a, tone: t = "plain", pressed: r }) {
|
|
|
1032
1032
|
}
|
|
1033
1033
|
);
|
|
1034
1034
|
}
|
|
1035
|
-
function $n({ name: n, duration: l, connection: a, you: t, muted: r, speaker: m, onToggleMute:
|
|
1035
|
+
function $n({ name: n, duration: l, connection: a, you: t, muted: r, speaker: m, onToggleMute: d, onToggleSpeaker: i, onAddPerson: u, onChat: o, onHangUp: _, labels: h }) {
|
|
1036
1036
|
const c = re(xe, h);
|
|
1037
1037
|
return /* @__PURE__ */ s("section", { className: "cms-call-panel", "aria-label": c.callWith(n), children: [
|
|
1038
1038
|
/* @__PURE__ */ s("div", { className: "cms-call-panel__head", children: [
|
|
@@ -1049,16 +1049,16 @@ function $n({ name: n, duration: l, connection: a, you: t, muted: r, speaker: m,
|
|
|
1049
1049
|
t.speaking ? /* @__PURE__ */ e("span", { className: "cms-call-panel__level", role: "img", "aria-label": c.speaking }) : null
|
|
1050
1050
|
] }),
|
|
1051
1051
|
/* @__PURE__ */ s("div", { className: "cms-call-panel__controls", children: [
|
|
1052
|
-
/* @__PURE__ */ e(ae, { icon: "mic", label: r ? c.unmute : c.mute, pressed: r, onClick:
|
|
1052
|
+
/* @__PURE__ */ e(ae, { icon: "mic", label: r ? c.unmute : c.mute, pressed: r, onClick: d }),
|
|
1053
1053
|
/* @__PURE__ */ e(ae, { icon: "speaker", label: c.speaker, pressed: m, onClick: i }),
|
|
1054
1054
|
u ? /* @__PURE__ */ e(ae, { icon: "user-plus", label: c.addPerson, onClick: u }) : null,
|
|
1055
|
-
|
|
1055
|
+
o ? /* @__PURE__ */ e(ae, { icon: "chat", label: c.chat, onClick: o }) : null,
|
|
1056
1056
|
/* @__PURE__ */ e(ae, { icon: "phone-off", label: c.hangUp, tone: "hang-up", onClick: _ })
|
|
1057
1057
|
] })
|
|
1058
1058
|
] });
|
|
1059
1059
|
}
|
|
1060
|
-
function Tn({ name: n, duration: l, muted: a, onToggleMute: t, onReturn: r, onHangUp: m, labels:
|
|
1061
|
-
const i = re(xe,
|
|
1060
|
+
function Tn({ name: n, duration: l, muted: a, onToggleMute: t, onReturn: r, onHangUp: m, labels: d }) {
|
|
1061
|
+
const i = re(xe, d);
|
|
1062
1062
|
return /* @__PURE__ */ s("section", { className: "cms-call-bar", "aria-label": i.callWith(n), children: [
|
|
1063
1063
|
/* @__PURE__ */ e("span", { className: "cms-call-bar__live", "aria-hidden": "true" }),
|
|
1064
1064
|
/* @__PURE__ */ e("span", { className: "cms-call-bar__name", children: i.onCallWith(n) }),
|
|
@@ -1080,10 +1080,10 @@ function In({ mark: n, product: l, headline: a, lead: t, features: r = [], child
|
|
|
1080
1080
|
/* @__PURE__ */ s("div", { className: "cms-signin__pitch", children: [
|
|
1081
1081
|
/* @__PURE__ */ e("p", { className: "cms-signin__headline", children: a }),
|
|
1082
1082
|
/* @__PURE__ */ e("p", { className: "cms-signin__lead", children: t }),
|
|
1083
|
-
r.length ? /* @__PURE__ */ e("ul", { className: "cms-signin__features", children: r.map((
|
|
1084
|
-
/* @__PURE__ */ e(P, { name:
|
|
1085
|
-
|
|
1086
|
-
] },
|
|
1083
|
+
r.length ? /* @__PURE__ */ e("ul", { className: "cms-signin__features", children: r.map((d) => /* @__PURE__ */ s("li", { children: [
|
|
1084
|
+
/* @__PURE__ */ e(P, { name: d.icon, size: 18 }),
|
|
1085
|
+
d.label
|
|
1086
|
+
] }, d.label)) }) : null
|
|
1087
1087
|
] })
|
|
1088
1088
|
] }),
|
|
1089
1089
|
/* @__PURE__ */ e("main", { className: "cms-signin__form", children: m })
|
|
@@ -1101,10 +1101,10 @@ const Qe = {
|
|
|
1101
1101
|
newHere: "New here?",
|
|
1102
1102
|
create: "Create an account"
|
|
1103
1103
|
};
|
|
1104
|
-
function Pn({ server: n, onSubmit: l, forgotHref: a, createHref: t, error: r, busy: m, labels:
|
|
1105
|
-
const i = re(Qe,
|
|
1104
|
+
function Pn({ server: n, onSubmit: l, forgotHref: a, createHref: t, error: r, busy: m, labels: d }) {
|
|
1105
|
+
const i = re(Qe, d), u = J(), [o, _] = D(""), [h, c] = D(""), [g, N] = D(!1);
|
|
1106
1106
|
return /* @__PURE__ */ s("form", { className: "cms-signin-form", onSubmit: (w) => {
|
|
1107
|
-
w.preventDefault(), l(
|
|
1107
|
+
w.preventDefault(), l(o, h);
|
|
1108
1108
|
}, "aria-describedby": r ? `${u}-error` : void 0, children: [
|
|
1109
1109
|
/* @__PURE__ */ e("h1", { className: "cms-signin-form__title", children: i.title }),
|
|
1110
1110
|
/* @__PURE__ */ s("p", { className: "cms-signin-form__server", children: [
|
|
@@ -1120,7 +1120,7 @@ function Pn({ server: n, onSubmit: l, forgotHref: a, createHref: t, error: r, bu
|
|
|
1120
1120
|
type: "text",
|
|
1121
1121
|
autoComplete: "username",
|
|
1122
1122
|
placeholder: i.identifierPlaceholder,
|
|
1123
|
-
value:
|
|
1123
|
+
value: o,
|
|
1124
1124
|
onChange: (w) => _(w.target.value),
|
|
1125
1125
|
required: !0
|
|
1126
1126
|
}
|
|
@@ -1150,21 +1150,21 @@ function Pn({ server: n, onSubmit: l, forgotHref: a, createHref: t, error: r, bu
|
|
|
1150
1150
|
] }) : null
|
|
1151
1151
|
] });
|
|
1152
1152
|
}
|
|
1153
|
-
function Bn({ label: n, rows: l, error: a, onRetry: t, loadingText: r = "Loading", emptyTitle: m = "Nothing here yet", emptyHint:
|
|
1153
|
+
function Bn({ label: n, rows: l, error: a, onRetry: t, loadingText: r = "Loading", emptyTitle: m = "Nothing here yet", emptyHint: d, selected: i, onOpen: u, onRowMenu: o }) {
|
|
1154
1154
|
const _ = Z([]);
|
|
1155
1155
|
if (a != null) return /* @__PURE__ */ e(ze, { message: a, onRetry: t });
|
|
1156
1156
|
if (l === null) return /* @__PURE__ */ e(Be, { what: r, layout: "block" });
|
|
1157
|
-
if (l.length === 0) return /* @__PURE__ */ e(Fe, { title: m, hint:
|
|
1157
|
+
if (l.length === 0) return /* @__PURE__ */ e(Fe, { title: m, hint: d });
|
|
1158
1158
|
const h = (c, g, N) => {
|
|
1159
1159
|
var b;
|
|
1160
1160
|
if (c.key === "ArrowDown" || c.key === "ArrowUp")
|
|
1161
1161
|
c.preventDefault(), (b = _.current[Math.min(l.length - 1, Math.max(0, g + (c.key === "ArrowDown" ? 1 : -1)))]) == null || b.focus();
|
|
1162
1162
|
else if (c.key === "Enter")
|
|
1163
1163
|
u == null || u(N);
|
|
1164
|
-
else if ((c.key === "ContextMenu" || c.shiftKey && c.key === "F10") &&
|
|
1164
|
+
else if ((c.key === "ContextMenu" || c.shiftKey && c.key === "F10") && o) {
|
|
1165
1165
|
c.preventDefault();
|
|
1166
1166
|
const w = c.currentTarget.getBoundingClientRect();
|
|
1167
|
-
|
|
1167
|
+
o(N, { x: w.left + 16, y: w.bottom });
|
|
1168
1168
|
}
|
|
1169
1169
|
};
|
|
1170
1170
|
return /* @__PURE__ */ e("ul", { className: "cms-list", role: "listbox", "aria-label": n, children: l.map((c, g) => {
|
|
@@ -1181,8 +1181,8 @@ function Bn({ label: n, rows: l, error: a, onRetry: t, loadingText: r = "Loading
|
|
|
1181
1181
|
className: C("cms-list__row", N && "is-selected"),
|
|
1182
1182
|
onClick: () => u == null ? void 0 : u(c.id),
|
|
1183
1183
|
onKeyDown: (b) => h(b, g, c.id),
|
|
1184
|
-
onContextMenu:
|
|
1185
|
-
b.preventDefault(),
|
|
1184
|
+
onContextMenu: o ? (b) => {
|
|
1185
|
+
b.preventDefault(), o(c.id, { x: b.clientX, y: b.clientY });
|
|
1186
1186
|
} : void 0,
|
|
1187
1187
|
children: [
|
|
1188
1188
|
c.lead != null ? /* @__PURE__ */ e("span", { className: "cms-list__lead", children: c.lead }) : null,
|
|
@@ -1198,7 +1198,7 @@ function Bn({ label: n, rows: l, error: a, onRetry: t, loadingText: r = "Loading
|
|
|
1198
1198
|
}) });
|
|
1199
1199
|
}
|
|
1200
1200
|
function en({ at: n, items: l, onClose: a, label: t = "Actions", focus: r = "first" }) {
|
|
1201
|
-
const m = Z(null),
|
|
1201
|
+
const m = Z(null), d = Z(null), [i, u] = D(n), o = l.filter((h) => h.offer.offered);
|
|
1202
1202
|
if (Ae(() => {
|
|
1203
1203
|
if (!n) return;
|
|
1204
1204
|
const h = m.current, c = (h == null ? void 0 : h.offsetWidth) ?? 0, g = (h == null ? void 0 : h.offsetHeight) ?? 0;
|
|
@@ -1206,7 +1206,7 @@ function en({ at: n, items: l, onClose: a, label: t = "Actions", focus: r = "fir
|
|
|
1206
1206
|
}, [n]), G(() => {
|
|
1207
1207
|
var g, N;
|
|
1208
1208
|
if (!n) return;
|
|
1209
|
-
|
|
1209
|
+
d.current = document.activeElement;
|
|
1210
1210
|
const h = Array.from(((g = m.current) == null ? void 0 : g.querySelectorAll('[role="menuitem"]:not([aria-disabled="true"])')) ?? []);
|
|
1211
1211
|
(N = r === "last" ? h[h.length - 1] : h[0]) == null || N.focus();
|
|
1212
1212
|
const c = (b) => {
|
|
@@ -1215,9 +1215,9 @@ function en({ at: n, items: l, onClose: a, label: t = "Actions", focus: r = "fir
|
|
|
1215
1215
|
};
|
|
1216
1216
|
return document.addEventListener("mousedown", c), () => {
|
|
1217
1217
|
var b, w;
|
|
1218
|
-
document.removeEventListener("mousedown", c), (w = (b =
|
|
1218
|
+
document.removeEventListener("mousedown", c), (w = (b = d.current) == null ? void 0 : b.focus) == null || w.call(b);
|
|
1219
1219
|
};
|
|
1220
|
-
}, [n, a, r]), !n ||
|
|
1220
|
+
}, [n, a, r]), !n || o.length === 0) return null;
|
|
1221
1221
|
const _ = (h) => {
|
|
1222
1222
|
var N, b;
|
|
1223
1223
|
const c = Array.from(((N = m.current) == null ? void 0 : N.querySelectorAll('[role="menuitem"]')) ?? []), g = c.indexOf(document.activeElement);
|
|
@@ -1240,7 +1240,7 @@ function en({ at: n, items: l, onClose: a, label: t = "Actions", focus: r = "fir
|
|
|
1240
1240
|
style: { left: (i ?? n).x, top: (i ?? n).y },
|
|
1241
1241
|
onKeyDown: _,
|
|
1242
1242
|
onContextMenu: (h) => h.preventDefault(),
|
|
1243
|
-
children:
|
|
1243
|
+
children: o.map((h) => {
|
|
1244
1244
|
const c = h.offer.refusal !== void 0;
|
|
1245
1245
|
return /* @__PURE__ */ s(
|
|
1246
1246
|
"div",
|
|
@@ -1282,8 +1282,8 @@ function ln(n) {
|
|
|
1282
1282
|
return [...l.entries()].sort(([a], [t]) => a - t).map(([, a]) => a);
|
|
1283
1283
|
}
|
|
1284
1284
|
function Fn({ label: n, actions: l, onAction: a, status: t, moreLabel: r, leading: m }) {
|
|
1285
|
-
const
|
|
1286
|
-
const f =
|
|
1285
|
+
const d = Z(null), i = Z(null), [u, o] = D(Ce), [_, h] = D(null), [c, g] = D("first"), [N, b] = D(null), [w, H] = D(null), k = nn(l), S = ln(l), A = k.flat(), U = A.filter((f) => f.overflow === 0), R = A.filter((f) => f.overflow !== 0), ne = JSON.stringify([l.map((f) => [f.id, f.label, f.icon, f.group, f.overflow ?? null]), t ?? "", m !== void 0]), v = _e(() => {
|
|
1286
|
+
const f = d.current, M = i.current;
|
|
1287
1287
|
if (f === null || M === null) return;
|
|
1288
1288
|
const O = getComputedStyle(f), j = parseFloat(O.columnGap || "0") || 0, $ = f.clientWidth - (parseFloat(O.paddingLeft) || 0) - (parseFloat(O.paddingRight) || 0), q = (T) => {
|
|
1289
1289
|
var K;
|
|
@@ -1313,10 +1313,10 @@ function Fn({ label: n, actions: l, onAction: a, status: t, moreLabel: r, leadin
|
|
|
1313
1313
|
B = { bare: T, hidden: K.size >= 2 ? K : /* @__PURE__ */ new Set() };
|
|
1314
1314
|
}
|
|
1315
1315
|
const ge = B;
|
|
1316
|
-
|
|
1316
|
+
o((T) => Se(T.bare, ge.bare) && Se(T.hidden, ge.hidden) ? T : ge);
|
|
1317
1317
|
}, [ne]);
|
|
1318
1318
|
Ae(v, [v]), G(() => {
|
|
1319
|
-
const f =
|
|
1319
|
+
const f = d.current;
|
|
1320
1320
|
if (f === null || typeof ResizeObserver > "u") return;
|
|
1321
1321
|
const M = new ResizeObserver(() => v());
|
|
1322
1322
|
return M.observe(f), () => M.disconnect();
|
|
@@ -1331,7 +1331,7 @@ function Fn({ label: n, actions: l, onAction: a, status: t, moreLabel: r, leadin
|
|
|
1331
1331
|
if (f.key === "ArrowRight" ? O = Math.min(z.length - 1, M + 1) : f.key === "ArrowLeft" ? O = Math.max(0, M - 1) : f.key === "Home" ? O = 0 : f.key === "End" ? O = z.length - 1 : f.key === "Escape" && H(Q), O === null) return;
|
|
1332
1332
|
f.preventDefault();
|
|
1333
1333
|
const j = z[O] ?? null;
|
|
1334
|
-
b(j), (q = ($ =
|
|
1334
|
+
b(j), (q = ($ = d.current) == null ? void 0 : $.querySelector(`[data-stop="${CSS.escape(j ?? "")}"]`)) == null || q.focus();
|
|
1335
1335
|
}, ie = L.map((f) => ({
|
|
1336
1336
|
id: f.id,
|
|
1337
1337
|
label: /* @__PURE__ */ s(x, { children: [
|
|
@@ -1347,7 +1347,7 @@ function Fn({ label: n, actions: l, onAction: a, status: t, moreLabel: r, leadin
|
|
|
1347
1347
|
return /* @__PURE__ */ s(
|
|
1348
1348
|
"div",
|
|
1349
1349
|
{
|
|
1350
|
-
ref:
|
|
1350
|
+
ref: d,
|
|
1351
1351
|
role: "toolbar",
|
|
1352
1352
|
"aria-label": n,
|
|
1353
1353
|
className: C(
|
|
@@ -1424,14 +1424,14 @@ function Fn({ label: n, actions: l, onAction: a, status: t, moreLabel: r, leadin
|
|
|
1424
1424
|
}
|
|
1425
1425
|
);
|
|
1426
1426
|
}
|
|
1427
|
-
function an({ action: n, labels: l, overflowed: a, pinned: t, tabbable: r, tipOff: m, onChoose:
|
|
1428
|
-
const [u,
|
|
1427
|
+
function an({ action: n, labels: l, overflowed: a, pinned: t, tabbable: r, tipOff: m, onChoose: d, onFocus: i }) {
|
|
1428
|
+
const [u, o] = D(!1);
|
|
1429
1429
|
G(() => {
|
|
1430
1430
|
if (!n.busy) {
|
|
1431
|
-
|
|
1431
|
+
o(!1);
|
|
1432
1432
|
return;
|
|
1433
1433
|
}
|
|
1434
|
-
const H = setTimeout(() =>
|
|
1434
|
+
const H = setTimeout(() => o(!0), ye);
|
|
1435
1435
|
return () => clearTimeout(H);
|
|
1436
1436
|
}, [n.busy]);
|
|
1437
1437
|
const _ = be(n.icon) === null, h = l || _, c = n.disabled && n.reason ? n.reason : null, g = c ?? (h ? null : n.label), N = J(), [b, w] = D(!1);
|
|
@@ -1457,7 +1457,7 @@ function an({ action: n, labels: l, overflowed: a, pinned: t, tabbable: r, tipOf
|
|
|
1457
1457
|
H.key === "Escape" && w(!1);
|
|
1458
1458
|
},
|
|
1459
1459
|
onClick: () => {
|
|
1460
|
-
c !== null ? w(!0) : !n.disabled && !n.busy &&
|
|
1460
|
+
c !== null ? w(!0) : !n.disabled && !n.busy && d();
|
|
1461
1461
|
},
|
|
1462
1462
|
children: [
|
|
1463
1463
|
u ? /* @__PURE__ */ e(F, { name: "spinner" }) : /* @__PURE__ */ e(fe, { name: n.icon }),
|
|
@@ -1509,26 +1509,26 @@ function Hn() {
|
|
|
1509
1509
|
window.dispatchEvent(new Event(we));
|
|
1510
1510
|
}
|
|
1511
1511
|
function Rn(n) {
|
|
1512
|
-
const [l, a] = D(void 0), [t, r] = D(void 0), [m,
|
|
1512
|
+
const [l, a] = D(void 0), [t, r] = D(void 0), [m, d] = D(!0), i = Z(n);
|
|
1513
1513
|
i.current = n;
|
|
1514
|
-
const u = Z(0),
|
|
1514
|
+
const u = Z(0), o = _e(() => {
|
|
1515
1515
|
const _ = ++u.current;
|
|
1516
|
-
|
|
1516
|
+
d(!0), i.current().then(
|
|
1517
1517
|
(h) => {
|
|
1518
|
-
_ === u.current && (a(h), r(void 0),
|
|
1518
|
+
_ === u.current && (a(h), r(void 0), d(!1));
|
|
1519
1519
|
},
|
|
1520
1520
|
(h) => {
|
|
1521
|
-
_ === u.current && (r(h),
|
|
1521
|
+
_ === u.current && (r(h), d(!1));
|
|
1522
1522
|
}
|
|
1523
1523
|
);
|
|
1524
1524
|
}, []);
|
|
1525
1525
|
return G(() => {
|
|
1526
|
-
|
|
1527
|
-
const _ = () =>
|
|
1526
|
+
o();
|
|
1527
|
+
const _ = () => o();
|
|
1528
1528
|
return window.addEventListener("focus", _), window.addEventListener(we, _), () => {
|
|
1529
1529
|
window.removeEventListener("focus", _), window.removeEventListener(we, _);
|
|
1530
1530
|
};
|
|
1531
|
-
}, [
|
|
1531
|
+
}, [o]), { value: l, error: t, loading: m, reread: o };
|
|
1532
1532
|
}
|
|
1533
1533
|
function On(n) {
|
|
1534
1534
|
return n === 412 ? { conflict: !0, message: "Someone changed this since you opened it. Nothing was saved; read it again to see the change." } : { conflict: !1 };
|
|
@@ -1537,8 +1537,8 @@ const cn = "/errors/client-update-required";
|
|
|
1537
1537
|
function on(n, l) {
|
|
1538
1538
|
const a = n.split(".").map((r) => Number.parseInt(r, 10) || 0), t = l.split(".").map((r) => Number.parseInt(r, 10) || 0);
|
|
1539
1539
|
for (let r = 0; r < Math.max(a.length, t.length); r++) {
|
|
1540
|
-
const m = a[r] ?? 0,
|
|
1541
|
-
if (m !==
|
|
1540
|
+
const m = a[r] ?? 0, d = t[r] ?? 0;
|
|
1541
|
+
if (m !== d) return m < d;
|
|
1542
1542
|
}
|
|
1543
1543
|
return !1;
|
|
1544
1544
|
}
|
package/package.json
CHANGED
package/src/kit.css
CHANGED
|
@@ -522,9 +522,10 @@
|
|
|
522
522
|
.cms-viewer__body { display: flex; min-height: 0; }
|
|
523
523
|
.cms-viewer__thumbnails { flex: none; width: 124px; padding: var(--cms-space-3); overflow: auto; border-right: 1px solid #2a2f38; }
|
|
524
524
|
.cms-viewer__content { position: relative; flex: 1 1 0; min-width: 0; min-height: 0; overflow: hidden; }
|
|
525
|
+
/* The next arrow stands clear of the content's own vertical scrollbar (at most 20px), down the content's right edge. */
|
|
525
526
|
.cms-viewer__side { position: absolute; top: 50%; z-index: 2; display: grid; place-items: center; width: 44px; height: 44px; margin-top: -22px; border: 0; border-radius: 50%; background: #262b34; color: inherit; cursor: pointer; }
|
|
526
527
|
.cms-viewer__side--previous { left: var(--cms-space-3); }
|
|
527
|
-
.cms-viewer__side--next { right: var(--cms-space-3); }
|
|
528
|
+
.cms-viewer__side--next { right: calc(var(--cms-space-3) + 20px); }
|
|
528
529
|
.cms-viewer__side--next svg { transform: scaleX(-1); }
|
|
529
530
|
.cms-viewer__strip { display: flex; justify-content: center; gap: var(--cms-space-2); min-width: 0; padding: var(--cms-space-2) var(--cms-space-3); overflow-x: auto; border-top: 1px solid #2a2f38; }
|
|
530
531
|
.cms-viewer__dots { display: none; position: absolute; left: 0; right: 0; bottom: var(--cms-space-2); z-index: 2; justify-content: center; gap: 6px; }
|