@coolms/ui-react 0.1.0-alpha.11 → 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 +12 -0
- package/dist/components/FileViewer.d.ts +4 -1
- package/dist/index.js +403 -397
- package/package.json +1 -1
- package/src/kit.css +4 -3
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as e, jsxs as s, Fragment as x } from "react/jsx-runtime";
|
|
2
|
-
import { useId as
|
|
2
|
+
import { useId as J, useState as D, useRef as Z, useEffect as G, useCallback as _e, useMemo as Ie, useLayoutEffect as Ae } from "react";
|
|
3
3
|
import { createPortal as ke } from "react-dom";
|
|
4
4
|
function re(n, l) {
|
|
5
5
|
const a = { ...n };
|
|
@@ -31,28 +31,28 @@ function F({ name: n }) {
|
|
|
31
31
|
return /* @__PURE__ */ e("svg", { ...l, className: "cms-glyph", children: /* @__PURE__ */ e("path", { fill: "currentColor", d: "M8 1a7 7 0 1 1 0 14A7 7 0 0 1 8 1Zm0 5.5a1 1 0 0 0-1 1V11a1 1 0 1 0 2 0V7.5a1 1 0 0 0-1-1ZM8 4a1 1 0 1 0 0 2 1 1 0 0 0 0-2Z" }) });
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
|
-
function
|
|
34
|
+
function ee({
|
|
35
35
|
variant: n = "secondary",
|
|
36
36
|
busy: l = !1,
|
|
37
37
|
busyLabel: a,
|
|
38
38
|
locked: t = !1,
|
|
39
39
|
lockedReason: r,
|
|
40
40
|
icon: m,
|
|
41
|
-
disabled:
|
|
42
|
-
className:
|
|
41
|
+
disabled: d,
|
|
42
|
+
className: i,
|
|
43
43
|
children: u,
|
|
44
|
-
type:
|
|
44
|
+
type: o = "button",
|
|
45
45
|
title: _,
|
|
46
46
|
...h
|
|
47
47
|
}) {
|
|
48
|
-
const
|
|
48
|
+
const c = !!d || l;
|
|
49
49
|
return /* @__PURE__ */ s(
|
|
50
50
|
"button",
|
|
51
51
|
{
|
|
52
52
|
...h,
|
|
53
|
-
type:
|
|
54
|
-
className: C("cms-button", `cms-button--${n}`, l && "is-busy", t && "is-locked",
|
|
55
|
-
disabled:
|
|
53
|
+
type: o,
|
|
54
|
+
className: C("cms-button", `cms-button--${n}`, l && "is-busy", t && "is-locked", i),
|
|
55
|
+
disabled: c,
|
|
56
56
|
"aria-busy": l || void 0,
|
|
57
57
|
title: t ? r ?? _ : _,
|
|
58
58
|
children: [
|
|
@@ -83,58 +83,58 @@ 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:
|
|
87
|
-
const h =
|
|
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
|
+
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,
|
|
99
99
|
"aria-invalid": a != null || void 0,
|
|
100
100
|
"aria-describedby": Ee(h, { help: l, error: a, pinned: m }),
|
|
101
|
-
onChange: (
|
|
101
|
+
onChange: (c) => i == null ? void 0 : i(c.target.value)
|
|
102
102
|
}
|
|
103
103
|
) });
|
|
104
104
|
}
|
|
105
|
-
function pn({ label: n, help: l, error: a, disabled: t, readOnly: r, value: m, options:
|
|
106
|
-
const _ =
|
|
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,
|
|
115
115
|
"aria-readonly": r || void 0,
|
|
116
116
|
"aria-invalid": a != null || void 0,
|
|
117
117
|
"aria-describedby": Ee(_, { help: h ? u : l, error: a }),
|
|
118
|
-
onChange: (
|
|
119
|
-
r ||
|
|
118
|
+
onChange: (c) => {
|
|
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,83 +142,83 @@ 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:
|
|
151
|
-
const [_, h] = D(n), [
|
|
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
|
+
const [_, h] = D(n), [c, g] = D(!1), N = Z(null), b = Z(null), w = J();
|
|
152
152
|
if (G(() => {
|
|
153
153
|
if (n) {
|
|
154
|
-
|
|
154
|
+
b.current = document.activeElement, h(!0), g(!1);
|
|
155
155
|
return;
|
|
156
156
|
}
|
|
157
157
|
if (!_) return;
|
|
158
|
-
|
|
159
|
-
const
|
|
158
|
+
g(!0);
|
|
159
|
+
const k = window.setTimeout(() => {
|
|
160
160
|
var S, A;
|
|
161
|
-
h(!1),
|
|
161
|
+
h(!1), g(!1), (A = (S = b.current) == null ? void 0 : S.focus) == null || A.call(S);
|
|
162
162
|
}, Pe);
|
|
163
|
-
return () => window.clearTimeout(
|
|
163
|
+
return () => window.clearTimeout(k);
|
|
164
164
|
}, [n, _]), G(() => {
|
|
165
|
-
var
|
|
165
|
+
var k, S;
|
|
166
166
|
if (n && _) {
|
|
167
167
|
const A = 'input, select, textarea, button, [href], [tabindex]:not([tabindex="-1"])';
|
|
168
|
-
(S = (u == null ? void 0 : u.current) ?? ((
|
|
168
|
+
(S = (u == null ? void 0 : u.current) ?? ((k = N.current) == null ? void 0 : k.querySelector(`.cms-modal__body :is(${A}), .cms-modal__foot :is(${A})`)) ?? N.current) == null || S.focus();
|
|
169
169
|
}
|
|
170
170
|
}, [n, _, u]), !_) return null;
|
|
171
|
-
const
|
|
171
|
+
const H = () => {
|
|
172
172
|
t ? r == null || r() : a();
|
|
173
173
|
};
|
|
174
174
|
return ke(
|
|
175
|
-
/* @__PURE__ */ e("div", { className: C("cms-modal-scrim",
|
|
176
|
-
|
|
175
|
+
/* @__PURE__ */ e("div", { className: C("cms-modal-scrim", c && "is-closing"), onMouseDown: (k) => {
|
|
176
|
+
k.target === k.currentTarget && H();
|
|
177
177
|
}, children: /* @__PURE__ */ s(
|
|
178
178
|
"div",
|
|
179
179
|
{
|
|
180
|
-
ref:
|
|
181
|
-
className: C("cms-modal",
|
|
180
|
+
ref: N,
|
|
181
|
+
className: C("cms-modal", o, c && "is-closing", t && "is-dirty"),
|
|
182
182
|
role: "dialog",
|
|
183
183
|
"aria-modal": "true",
|
|
184
|
-
"aria-labelledby":
|
|
184
|
+
"aria-labelledby": w,
|
|
185
185
|
tabIndex: -1,
|
|
186
|
-
onKeyDown: (
|
|
186
|
+
onKeyDown: (k) => {
|
|
187
187
|
var S;
|
|
188
|
-
if (
|
|
189
|
-
|
|
190
|
-
else if (
|
|
191
|
-
const A = (S =
|
|
188
|
+
if (k.key === "Escape")
|
|
189
|
+
k.stopPropagation(), H();
|
|
190
|
+
else if (k.key === "Tab") {
|
|
191
|
+
const A = (S = N.current) == null ? void 0 : S.querySelectorAll('input, select, textarea, button:not([disabled]), [href], [tabindex]:not([tabindex="-1"])');
|
|
192
192
|
if (!A || A.length === 0) return;
|
|
193
|
-
const
|
|
194
|
-
|
|
193
|
+
const U = A[0], R = A[A.length - 1];
|
|
194
|
+
k.shiftKey && document.activeElement === U ? (k.preventDefault(), R.focus()) : !k.shiftKey && document.activeElement === R && (k.preventDefault(), U.focus());
|
|
195
195
|
}
|
|
196
196
|
},
|
|
197
197
|
children: [
|
|
198
198
|
/* @__PURE__ */ s("header", { className: "cms-modal__head", children: [
|
|
199
|
-
/* @__PURE__ */ e("h2", { className: "cms-modal__title", id:
|
|
200
|
-
/* @__PURE__ */ e("button", { type: "button", className: "cms-icon-button", "aria-label":
|
|
199
|
+
/* @__PURE__ */ e("h2", { className: "cms-modal__title", id: w, children: l }),
|
|
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(
|
|
221
|
-
/* @__PURE__ */ e(
|
|
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" }),
|
|
@@ -232,7 +232,7 @@ function bn({ kind: n, message: l, action: a, onDismiss: t, dismissLabel: r = "D
|
|
|
232
232
|
return /* @__PURE__ */ s("div", { className: C("cms-toast", `cms-toast--${n}`), role: n === "error" ? "alert" : "status", children: [
|
|
233
233
|
/* @__PURE__ */ e(F, { name: n === "success" ? "check" : n === "error" ? "warning" : "info" }),
|
|
234
234
|
/* @__PURE__ */ e("span", { className: "cms-toast__message", children: l }),
|
|
235
|
-
a ? /* @__PURE__ */ e(
|
|
235
|
+
a ? /* @__PURE__ */ e(ee, { className: "cms-toast__action", onClick: a.onAction, children: a.label }) : null,
|
|
236
236
|
t ? /* @__PURE__ */ e("button", { type: "button", className: "cms-icon-button", "aria-label": r, onClick: t, children: /* @__PURE__ */ e(F, { name: "close" }) }) : null
|
|
237
237
|
] });
|
|
238
238
|
}
|
|
@@ -256,7 +256,7 @@ function ze({ message: n, onRetry: l, retryLabel: a = "Try again" }) {
|
|
|
256
256
|
return /* @__PURE__ */ s("div", { className: "cms-error-banner", role: "alert", children: [
|
|
257
257
|
/* @__PURE__ */ e(F, { name: "warning" }),
|
|
258
258
|
/* @__PURE__ */ e("span", { className: "cms-error-banner__message", children: n }),
|
|
259
|
-
l ? /* @__PURE__ */ e(
|
|
259
|
+
l ? /* @__PURE__ */ e(ee, { onClick: l, children: a }) : null
|
|
260
260
|
] });
|
|
261
261
|
}
|
|
262
262
|
const ye = 300;
|
|
@@ -272,15 +272,15 @@ 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
|
|
283
|
-
return () => window.clearTimeout(
|
|
281
|
+
d(!1);
|
|
282
|
+
const i = window.setTimeout(() => d(!0), Ke());
|
|
283
|
+
return () => window.clearTimeout(i);
|
|
284
284
|
}, [n]), /* @__PURE__ */ s(
|
|
285
285
|
"div",
|
|
286
286
|
{
|
|
@@ -295,7 +295,7 @@ function te({ kind: n, title: l, description: a, action: t, placement: r = "bloc
|
|
|
295
295
|
/* @__PURE__ */ e("span", { className: "cms-state__title", children: l }),
|
|
296
296
|
a !== void 0 ? /* @__PURE__ */ e("span", { className: "cms-state__description", children: a }) : null
|
|
297
297
|
] }),
|
|
298
|
-
t !== void 0 && n !== "denied" ? /* @__PURE__ */ e(
|
|
298
|
+
t !== void 0 && n !== "denied" ? /* @__PURE__ */ e(ee, { className: "cms-state__action", onClick: t.onAction, children: t.label }) : null
|
|
299
299
|
]
|
|
300
300
|
}
|
|
301
301
|
);
|
|
@@ -460,99 +460,99 @@ 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
|
-
var
|
|
466
|
-
const
|
|
467
|
-
return document.body.style.overflow = "hidden", (
|
|
468
|
-
var
|
|
469
|
-
document.body.style.overflow = E, (
|
|
465
|
+
var W;
|
|
466
|
+
const v = document.activeElement, E = document.body.style.overflow;
|
|
467
|
+
return document.body.style.overflow = "hidden", (W = w.current) == null || W.focus(), () => {
|
|
468
|
+
var V;
|
|
469
|
+
document.body.style.overflow = E, (V = v == null ? void 0 : v.focus) == null || V.call(v);
|
|
470
470
|
};
|
|
471
471
|
}, []);
|
|
472
|
-
const
|
|
472
|
+
const U = () => {
|
|
473
473
|
u != null && u.dirty ? u.onDirtyClose() : r();
|
|
474
|
-
},
|
|
475
|
-
const E =
|
|
476
|
-
A.current = E === void 0 || u !== void 0 || Ve(
|
|
477
|
-
}, ne = (
|
|
474
|
+
}, R = (v) => {
|
|
475
|
+
const E = v.touches.length === 1 ? v.touches[0] : void 0;
|
|
476
|
+
A.current = E === void 0 || u !== void 0 || Ve(v.target) ? null : { x: E.clientX, y: E.clientY };
|
|
477
|
+
}, ne = (v) => {
|
|
478
478
|
var L, X;
|
|
479
|
-
const E = A.current,
|
|
480
|
-
if (A.current = null, E === null ||
|
|
481
|
-
const
|
|
482
|
-
Math.abs(
|
|
479
|
+
const E = A.current, W = v.changedTouches[0];
|
|
480
|
+
if (A.current = null, E === null || W === void 0) return;
|
|
481
|
+
const V = W.clientX - E.x;
|
|
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(
|
|
486
486
|
"div",
|
|
487
487
|
{
|
|
488
|
-
ref:
|
|
488
|
+
ref: b,
|
|
489
489
|
className: C("cms-viewer", u !== void 0 && "is-editing"),
|
|
490
490
|
role: "dialog",
|
|
491
491
|
"aria-modal": "true",
|
|
492
|
-
"aria-labelledby":
|
|
492
|
+
"aria-labelledby": H,
|
|
493
493
|
tabIndex: -1,
|
|
494
|
-
onKeyDown: (
|
|
495
|
-
var E,
|
|
496
|
-
if (
|
|
494
|
+
onKeyDown: (v) => {
|
|
495
|
+
var E, W, V;
|
|
496
|
+
if (v.key === "Escape") {
|
|
497
497
|
if (u !== void 0) return;
|
|
498
|
-
|
|
499
|
-
} else if (
|
|
500
|
-
const L = Array.from(((E =
|
|
498
|
+
v.stopPropagation(), k ? S(!1) : r();
|
|
499
|
+
} else if (v.key === "Tab") {
|
|
500
|
+
const L = Array.from(((E = b.current) == null ? void 0 : E.querySelectorAll(Re)) ?? []).filter(Ue);
|
|
501
501
|
if (L.length === 0) return;
|
|
502
502
|
const X = L[0], z = L[L.length - 1];
|
|
503
|
-
|
|
504
|
-
} else u === void 0 && !Ze(
|
|
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 = 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
|
-
/* @__PURE__ */ e("button", { ref:
|
|
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
|
-
/* @__PURE__ */ e("h2", { className: "cms-viewer__name", id:
|
|
512
|
-
|
|
511
|
+
/* @__PURE__ */ e("h2", { className: "cms-viewer__name", id: H, title: l, children: l }),
|
|
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 }),
|
|
516
516
|
/* @__PURE__ */ e("button", { type: "button", className: "cms-viewer__button cms-viewer__button--edit", onClick: u.onDone, children: u.doneLabel })
|
|
517
517
|
] }) : /* @__PURE__ */ s(x, { children: [
|
|
518
|
-
/* @__PURE__ */ e("span", { className: "cms-viewer__actions", children: m.map((
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
] },
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
/* @__PURE__ */ e("span", { className: "cms-viewer__wide", children:
|
|
518
|
+
/* @__PURE__ */ e("span", { className: "cms-viewer__actions", children: m.map((v) => /* @__PURE__ */ s("button", { type: "button", className: "cms-viewer__button", onClick: v.onSelect, children: [
|
|
519
|
+
v.icon,
|
|
520
|
+
v.label
|
|
521
|
+
] }, v.label)) }),
|
|
522
|
+
i !== void 0 ? /* @__PURE__ */ s("button", { type: "button", className: "cms-viewer__button cms-viewer__button--edit", "aria-label": i.label, onClick: i.onEdit, children: [
|
|
523
|
+
i.icon,
|
|
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":
|
|
528
|
-
|
|
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
|
+
k ? /* @__PURE__ */ e("span", { className: "cms-viewer__menu", children: m.map((v) => /* @__PURE__ */ s(
|
|
529
529
|
"button",
|
|
530
530
|
{
|
|
531
531
|
type: "button",
|
|
532
532
|
className: "cms-viewer__button",
|
|
533
533
|
onClick: () => {
|
|
534
|
-
S(!1),
|
|
534
|
+
S(!1), v.onSelect();
|
|
535
535
|
},
|
|
536
536
|
children: [
|
|
537
|
-
|
|
538
|
-
|
|
537
|
+
v.icon,
|
|
538
|
+
v.label
|
|
539
539
|
]
|
|
540
540
|
},
|
|
541
|
-
|
|
541
|
+
v.label
|
|
542
542
|
)) }) : null
|
|
543
543
|
] }) : null
|
|
544
544
|
] })
|
|
545
545
|
] }),
|
|
546
546
|
/* @__PURE__ */ s("div", { className: "cms-viewer__body", children: [
|
|
547
547
|
h != null && u === void 0 ? /* @__PURE__ */ e("nav", { className: "cms-viewer__thumbnails", children: h }) : null,
|
|
548
|
-
/* @__PURE__ */ s("div", { className: "cms-viewer__content", onTouchStart:
|
|
549
|
-
|
|
550
|
-
u === void 0 && (
|
|
551
|
-
u === void 0 && (
|
|
552
|
-
u === void 0 &&
|
|
548
|
+
/* @__PURE__ */ s("div", { className: "cms-viewer__content", onTouchStart: R, onTouchEnd: ne, children: [
|
|
549
|
+
N,
|
|
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
|
-
u === void 0 &&
|
|
555
|
+
u === void 0 && c != null ? /* @__PURE__ */ e("div", { className: "cms-viewer__strip", children: c }) : null,
|
|
556
556
|
_ != null ? /* @__PURE__ */ e("footer", { className: "cms-viewer__bar", children: _ }) : null
|
|
557
557
|
]
|
|
558
558
|
}
|
|
@@ -569,132 +569,132 @@ 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
|
-
l && (h(((p = a[0]) == null ? void 0 : p.id) ?? ""),
|
|
575
|
+
l && (h(((p = a[0]) == null ? void 0 : p.id) ?? ""), g(""), S(/* @__PURE__ */ new Map()), ne(!1));
|
|
576
576
|
}, [l]), G(() => {
|
|
577
577
|
if (!l || _ === "") return;
|
|
578
578
|
let p = !0;
|
|
579
|
-
return
|
|
580
|
-
(
|
|
581
|
-
(
|
|
579
|
+
return b({ status: "loading" }), U(0), t(_, c).then(
|
|
580
|
+
(y) => p && b({ status: "ready", entries: y.entries, next: y.next ?? null, paging: !1 }),
|
|
581
|
+
(y) => p && b({ status: y instanceof We ? "denied" : "error" })
|
|
582
582
|
), () => {
|
|
583
583
|
p = !1;
|
|
584
584
|
};
|
|
585
|
-
}, [l, _,
|
|
586
|
-
const
|
|
587
|
-
if (
|
|
588
|
-
const p =
|
|
589
|
-
|
|
590
|
-
(I) =>
|
|
591
|
-
() =>
|
|
585
|
+
}, [l, _, c, t, w]);
|
|
586
|
+
const W = _e(() => {
|
|
587
|
+
if (N.status !== "ready" || N.next === null || N.paging) return;
|
|
588
|
+
const p = N.next, y = N.entries;
|
|
589
|
+
b({ ...N, paging: !0 }), t(_, c, p).then(
|
|
590
|
+
(I) => b({ status: "ready", entries: [...y, ...I.entries], next: I.next ?? null, paging: !1 }),
|
|
591
|
+
() => b({ status: "ready", entries: y, next: p, paging: !1 })
|
|
592
592
|
);
|
|
593
|
-
}, [
|
|
594
|
-
var
|
|
595
|
-
return ((
|
|
596
|
-
}, [m]), L = Ie(() => [...
|
|
593
|
+
}, [N, t, _, c]), V = _e((p) => {
|
|
594
|
+
var y;
|
|
595
|
+
return ((y = m == null ? void 0 : m.cost) == null ? void 0 : y.call(m, p)) ?? p.size ?? 0;
|
|
596
|
+
}, [m]), L = Ie(() => [...k.values()], [k]), X = L.reduce((p, y) => p + (y.size ?? 0), 0), z = m === void 0 ? null : m.limitBytes - m.usedBytes - L.reduce((p, y) => p + V(y), 0), Q = z !== null && z < 0, ce = (p) => {
|
|
597
597
|
if (p.kind !== "file") return null;
|
|
598
|
-
const
|
|
599
|
-
return
|
|
598
|
+
const y = r == null ? void 0 : r(p);
|
|
599
|
+
return y || (z !== null && !k.has(Ne(_, p.id)) && V(p) > z ? i.overBudget : null);
|
|
600
600
|
}, ie = (p) => {
|
|
601
|
-
const
|
|
602
|
-
!
|
|
601
|
+
const y = Ne(_, p.id);
|
|
602
|
+
!k.has(y) && ce(p) !== null || S((I) => {
|
|
603
603
|
const B = new Map(I);
|
|
604
|
-
return B.has(
|
|
604
|
+
return B.has(y) ? B.delete(y) : B.set(y, { ...p, space: _, path: c }), B;
|
|
605
605
|
});
|
|
606
|
-
}, f = (p) =>
|
|
607
|
-
const I = new Map(
|
|
606
|
+
}, f = (p) => g(je(c, p.name)), M = () => g(c.includes("/") ? c.slice(0, c.lastIndexOf("/")) : ""), O = (p) => S((y) => {
|
|
607
|
+
const I = new Map(y);
|
|
608
608
|
return I.delete(p), I;
|
|
609
|
-
}),
|
|
610
|
-
const
|
|
609
|
+
}), j = N.status === "ready" ? N.entries : [], $ = (p) => {
|
|
610
|
+
const y = j[A];
|
|
611
611
|
if (p.key === "ArrowDown" || p.key === "ArrowUp" || p.key === "Home" || p.key === "End") {
|
|
612
612
|
p.preventDefault();
|
|
613
|
-
const I =
|
|
614
|
-
|
|
615
|
-
} else p.key === "Enter" && (
|
|
616
|
-
},
|
|
613
|
+
const I = j.length - 1, B = p.key === "Home" ? 0 : p.key === "End" ? I : Math.min(I, Math.max(0, A + (p.key === "ArrowDown" ? 1 : -1)));
|
|
614
|
+
U(B), B >= I - 1 && W();
|
|
615
|
+
} else p.key === "Enter" && (y == null ? void 0 : y.kind) === "folder" ? (p.preventDefault(), f(y)) : p.key === " " && (y == null ? void 0 : y.kind) === "file" ? (p.preventDefault(), ie(y)) : p.key === "Backspace" && c !== "" && (p.preventDefault(), M());
|
|
616
|
+
}, q = c === "" ? [] : c.split("/"), oe = ((ue = a.find((p) => p.id === _)) == null ? void 0 : ue.name) ?? "", de = (p) => `${E}-entry-${String(p)}`;
|
|
617
617
|
return /* @__PURE__ */ s(
|
|
618
618
|
Le,
|
|
619
619
|
{
|
|
620
620
|
open: l,
|
|
621
|
-
title:
|
|
622
|
-
onClose:
|
|
623
|
-
closeLabel:
|
|
624
|
-
initialFocus:
|
|
621
|
+
title: i.title,
|
|
622
|
+
onClose: o,
|
|
623
|
+
closeLabel: i.close,
|
|
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:
|
|
629
|
-
m !== void 0 && z !== null ? /* @__PURE__ */ e("span", { className: C(
|
|
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(
|
|
633
|
-
/* @__PURE__ */ e(
|
|
632
|
+
/* @__PURE__ */ e(ee, { variant: "secondary", onClick: o, children: i.cancel }),
|
|
633
|
+
/* @__PURE__ */ e(ee, { variant: "primary", disabled: L.length === 0 || Q, onClick: () => u(L), children: i.confirm(L.length) })
|
|
634
634
|
] })
|
|
635
635
|
] }),
|
|
636
636
|
children: [
|
|
637
637
|
/* @__PURE__ */ s("div", { className: "cms-file-picker__top", children: [
|
|
638
638
|
a.length > 1 ? /* @__PURE__ */ s("label", { className: "cms-file-picker__space", children: [
|
|
639
|
-
/* @__PURE__ */ e("span", { className: "cms-visually-hidden", children:
|
|
639
|
+
/* @__PURE__ */ e("span", { className: "cms-visually-hidden", children: i.space }),
|
|
640
640
|
/* @__PURE__ */ e("select", { className: "cms-input cms-select", value: _, onChange: (p) => {
|
|
641
|
-
h(p.target.value),
|
|
641
|
+
h(p.target.value), g("");
|
|
642
642
|
}, children: a.map((p) => /* @__PURE__ */ e("option", { value: p.id, children: p.name }, p.id)) })
|
|
643
643
|
] }) : null,
|
|
644
|
-
/* @__PURE__ */ s("nav", { className: "cms-file-picker__path", "aria-label":
|
|
645
|
-
/* @__PURE__ */ e("button", { type: "button", className: "cms-icon-button", "aria-label":
|
|
644
|
+
/* @__PURE__ */ s("nav", { className: "cms-file-picker__path", "aria-label": i.path, children: [
|
|
645
|
+
/* @__PURE__ */ e("button", { type: "button", className: "cms-icon-button", "aria-label": i.up, disabled: c === "", onClick: M, children: /* @__PURE__ */ e(P, { name: "chevron-left" }) }),
|
|
646
646
|
/* @__PURE__ */ s("ol", { children: [
|
|
647
|
-
/* @__PURE__ */ e("li", { children: /* @__PURE__ */ e("button", { type: "button", className: "cms-file-picker__crumb", "aria-current":
|
|
648
|
-
|
|
649
|
-
const I =
|
|
650
|
-
return /* @__PURE__ */ e("li", { children: /* @__PURE__ */ e("button", { type: "button", className: "cms-file-picker__crumb", "aria-current": I ===
|
|
647
|
+
/* @__PURE__ */ e("li", { children: /* @__PURE__ */ e("button", { type: "button", className: "cms-file-picker__crumb", "aria-current": c === "" ? "location" : void 0, onClick: () => g(""), children: oe }) }),
|
|
648
|
+
q.map((p, y) => {
|
|
649
|
+
const I = q.slice(0, y + 1).join("/");
|
|
650
|
+
return /* @__PURE__ */ e("li", { children: /* @__PURE__ */ e("button", { type: "button", className: "cms-file-picker__crumb", "aria-current": I === c ? "location" : void 0, onClick: () => g(I), children: p }) }, I);
|
|
651
651
|
})
|
|
652
652
|
] })
|
|
653
653
|
] }),
|
|
654
|
-
L.length > 0 ? /* @__PURE__ */ e("button", { type: "button", className: "cms-file-picker__chip", "aria-expanded":
|
|
654
|
+
L.length > 0 ? /* @__PURE__ */ e("button", { type: "button", className: "cms-file-picker__chip", "aria-expanded": R, onClick: () => ne((p) => !p), children: i.selected(L.length) }) : null
|
|
655
655
|
] }),
|
|
656
|
-
|
|
657
|
-
/* @__PURE__ */ e("ul", { children: [...
|
|
658
|
-
/* @__PURE__ */ e("span", { className: "cms-file-picker__name", children:
|
|
659
|
-
/* @__PURE__ */ e("button", { type: "button", className: "cms-icon-button", "aria-label":
|
|
656
|
+
R && L.length > 0 ? /* @__PURE__ */ s("div", { className: "cms-file-picker__chosen", children: [
|
|
657
|
+
/* @__PURE__ */ e("ul", { children: [...k.entries()].map(([p, y]) => /* @__PURE__ */ s("li", { children: [
|
|
658
|
+
/* @__PURE__ */ e("span", { className: "cms-file-picker__name", children: y.name }),
|
|
659
|
+
/* @__PURE__ */ e("button", { type: "button", className: "cms-icon-button", "aria-label": i.remove(y.name), onClick: () => O(p), children: /* @__PURE__ */ e(F, { name: "close" }) })
|
|
660
660
|
] }, p)) }),
|
|
661
|
-
/* @__PURE__ */ e(
|
|
661
|
+
/* @__PURE__ */ e(ee, { variant: "secondary", onClick: () => {
|
|
662
662
|
S(/* @__PURE__ */ new Map()), ne(!1);
|
|
663
|
-
}, children:
|
|
663
|
+
}, children: i.clear })
|
|
664
664
|
] }) : null,
|
|
665
665
|
/* @__PURE__ */ s("div", { className: "cms-file-picker__list", onScroll: (p) => {
|
|
666
|
-
const
|
|
667
|
-
|
|
666
|
+
const y = p.currentTarget;
|
|
667
|
+
y.scrollTop + y.clientHeight >= y.scrollHeight - qe && W();
|
|
668
668
|
}, children: [
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
669
|
+
N.status === "loading" ? /* @__PURE__ */ e(te, { kind: "loading", title: i.loading, placement: "block" }) : null,
|
|
670
|
+
N.status === "error" ? /* @__PURE__ */ e(te, { kind: "error", title: i.error, placement: "block", action: { label: i.retry, onAction: () => H((p) => p + 1) } }) : null,
|
|
671
|
+
N.status === "denied" ? /* @__PURE__ */ e(te, { kind: "denied", title: i.denied, placement: "block" }) : null,
|
|
672
|
+
N.status === "ready" && j.length === 0 ? /* @__PURE__ */ e(te, { kind: "empty", title: i.empty, placement: "block" }) : null,
|
|
673
673
|
/* @__PURE__ */ s(
|
|
674
674
|
"div",
|
|
675
675
|
{
|
|
676
|
-
ref:
|
|
676
|
+
ref: v,
|
|
677
677
|
role: "listbox",
|
|
678
678
|
"aria-multiselectable": "true",
|
|
679
|
-
"aria-label":
|
|
680
|
-
"aria-activedescendant":
|
|
679
|
+
"aria-label": i.files,
|
|
680
|
+
"aria-activedescendant": j.length > 0 ? de(A) : void 0,
|
|
681
681
|
tabIndex: 0,
|
|
682
682
|
className: "cms-file-picker__entries",
|
|
683
|
-
hidden:
|
|
683
|
+
hidden: N.status !== "ready" || j.length === 0,
|
|
684
684
|
onKeyDown: $,
|
|
685
685
|
children: [
|
|
686
|
-
|
|
687
|
-
const I = p.kind === "file" &&
|
|
686
|
+
j.map((p, y) => {
|
|
687
|
+
const I = p.kind === "file" && k.has(Ne(_, p.id)), B = ce(p);
|
|
688
688
|
return /* @__PURE__ */ s(
|
|
689
689
|
"div",
|
|
690
690
|
{
|
|
691
|
-
id: de(
|
|
691
|
+
id: de(y),
|
|
692
692
|
role: "option",
|
|
693
693
|
"aria-selected": p.kind === "file" ? I : void 0,
|
|
694
694
|
"aria-disabled": B !== null || void 0,
|
|
695
|
-
className: C("cms-file-picker__entry",
|
|
695
|
+
className: C("cms-file-picker__entry", y === A && "is-active", I && "is-ticked", B !== null && "is-disabled"),
|
|
696
696
|
onClick: () => {
|
|
697
|
-
|
|
697
|
+
U(y), p.kind === "folder" ? f(p) : ie(p);
|
|
698
698
|
},
|
|
699
699
|
children: [
|
|
700
700
|
/* @__PURE__ */ e("span", { className: "cms-file-picker__tick", "aria-hidden": "true", children: I ? /* @__PURE__ */ e(P, { name: "check" }) : null }),
|
|
@@ -703,13 +703,13 @@ 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
|
|
710
710
|
);
|
|
711
711
|
}),
|
|
712
|
-
|
|
712
|
+
N.status === "ready" && N.paging ? /* @__PURE__ */ e("div", { className: "cms-file-picker__paging", children: /* @__PURE__ */ e(te, { kind: "loading", title: i.loading, placement: "inline" }) }) : null
|
|
713
713
|
]
|
|
714
714
|
}
|
|
715
715
|
)
|
|
@@ -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 =
|
|
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[
|
|
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;
|
|
@@ -822,8 +822,8 @@ function xn({ product: n, mark: l, rail: a, active: t, onNavigate: r, server: m,
|
|
|
822
822
|
className: C("cms-shell__item", h && "is-active"),
|
|
823
823
|
"aria-current": h ? "page" : void 0,
|
|
824
824
|
title: _.label,
|
|
825
|
-
onClick: (
|
|
826
|
-
r && (
|
|
825
|
+
onClick: (c) => {
|
|
826
|
+
r && (c.preventDefault(), r(_.id));
|
|
827
827
|
},
|
|
828
828
|
children: [
|
|
829
829
|
/* @__PURE__ */ s("span", { className: "cms-shell__icon", children: [
|
|
@@ -839,8 +839,8 @@ 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
|
-
|
|
843
|
-
|
|
842
|
+
d != null ? /* @__PURE__ */ e("div", { className: "cms-shell__search", children: d }) : null,
|
|
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 })
|
|
846
846
|
] });
|
|
@@ -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 =
|
|
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[
|
|
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":
|
|
926
|
-
onClick:
|
|
924
|
+
className: C("cms-mail-row", r && "is-unread", d && "is-selected"),
|
|
925
|
+
"aria-current": d ? "true" : void 0,
|
|
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,31 +954,31 @@ 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:
|
|
958
|
-
const h =
|
|
959
|
-
|
|
960
|
-
},
|
|
961
|
-
return /* @__PURE__ */ s("form", { className: C("cms-composer", `cms-composer--${
|
|
962
|
-
/* @__PURE__ */ e("label", { htmlFor: h, className:
|
|
963
|
-
|
|
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
|
+
const h = J(), c = _ ?? l.trim() !== "", g = (b) => {
|
|
959
|
+
b.preventDefault(), c && t();
|
|
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--${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
|
-
onChange: (
|
|
973
|
-
onKeyDown: (
|
|
974
|
-
|
|
972
|
+
onChange: (b) => a(b.target.value),
|
|
973
|
+
onKeyDown: (b) => {
|
|
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
|
-
|
|
981
|
-
|
|
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
|
+
i,
|
|
982
982
|
" ",
|
|
983
983
|
/* @__PURE__ */ e(P, { name: "send", size: 18 })
|
|
984
984
|
] })
|
|
@@ -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,41 +1032,41 @@ 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:
|
|
1036
|
-
const
|
|
1037
|
-
return /* @__PURE__ */ s("section", { className: "cms-call-panel", "aria-label":
|
|
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
|
+
const c = re(xe, h);
|
|
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: [
|
|
1039
1039
|
/* @__PURE__ */ e(ve, { name: n, size: 64 }),
|
|
1040
1040
|
/* @__PURE__ */ s("div", { className: "cms-call-panel__who", children: [
|
|
1041
1041
|
/* @__PURE__ */ e("p", { className: "cms-call-panel__name", children: n }),
|
|
1042
|
-
/* @__PURE__ */ e("p", { className: "cms-call-panel__time", "aria-label":
|
|
1042
|
+
/* @__PURE__ */ e("p", { className: "cms-call-panel__time", "aria-label": c.callTime(l), children: l })
|
|
1043
1043
|
] }),
|
|
1044
|
-
/* @__PURE__ */ e("span", { className: C("cms-pill", a === "good" ? "cms-pill--success" : "cms-pill--warning"), children: a === "good" ?
|
|
1044
|
+
/* @__PURE__ */ e("span", { className: C("cms-pill", a === "good" ? "cms-pill--success" : "cms-pill--warning"), children: a === "good" ? c.goodConnection : c.poorConnection })
|
|
1045
1045
|
] }),
|
|
1046
1046
|
/* @__PURE__ */ s("div", { className: "cms-call-panel__you", children: [
|
|
1047
1047
|
/* @__PURE__ */ e(ve, { name: t.name, size: 36 }),
|
|
1048
|
-
/* @__PURE__ */ e("span", { children:
|
|
1049
|
-
t.speaking ? /* @__PURE__ */ e("span", { className: "cms-call-panel__level", role: "img", "aria-label":
|
|
1048
|
+
/* @__PURE__ */ e("span", { children: c.you }),
|
|
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 ?
|
|
1053
|
-
/* @__PURE__ */ e(ae, { icon: "speaker", label:
|
|
1054
|
-
u ? /* @__PURE__ */ e(ae, { icon: "user-plus", label:
|
|
1055
|
-
|
|
1056
|
-
/* @__PURE__ */ e(ae, { icon: "phone-off", label:
|
|
1052
|
+
/* @__PURE__ */ e(ae, { icon: "mic", label: r ? c.unmute : c.mute, pressed: r, onClick: d }),
|
|
1053
|
+
/* @__PURE__ */ e(ae, { icon: "speaker", label: c.speaker, pressed: m, onClick: i }),
|
|
1054
|
+
u ? /* @__PURE__ */ e(ae, { icon: "user-plus", label: c.addPerson, onClick: u }) : null,
|
|
1055
|
+
o ? /* @__PURE__ */ e(ae, { icon: "chat", label: c.chat, onClick: o }) : null,
|
|
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
|
|
1062
|
-
return /* @__PURE__ */ s("section", { className: "cms-call-bar", "aria-label":
|
|
1060
|
+
function Tn({ name: n, duration: l, muted: a, onToggleMute: t, onReturn: r, onHangUp: m, labels: d }) {
|
|
1061
|
+
const i = re(xe, d);
|
|
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
|
-
/* @__PURE__ */ e("span", { className: "cms-call-bar__name", children:
|
|
1064
|
+
/* @__PURE__ */ e("span", { className: "cms-call-bar__name", children: i.onCallWith(n) }),
|
|
1065
1065
|
/* @__PURE__ */ e("span", { className: "cms-call-bar__time", children: l }),
|
|
1066
1066
|
/* @__PURE__ */ s("span", { className: "cms-call-bar__actions", children: [
|
|
1067
|
-
/* @__PURE__ */ e("button", { type: "button", className: "cms-call-bar__icon", "aria-label": a ?
|
|
1068
|
-
/* @__PURE__ */ e("button", { type: "button", className: "cms-button cms-button--primary", onClick: r, children:
|
|
1069
|
-
/* @__PURE__ */ e("button", { type: "button", className: "cms-call-bar__icon cms-call-bar__icon--hang-up", "aria-label":
|
|
1067
|
+
/* @__PURE__ */ e("button", { type: "button", className: "cms-call-bar__icon", "aria-label": a ? i.unmute : i.mute, "aria-pressed": a, onClick: t, children: /* @__PURE__ */ e(P, { name: "mic" }) }),
|
|
1068
|
+
/* @__PURE__ */ e("button", { type: "button", className: "cms-button cms-button--primary", onClick: r, children: i.returnToCall }),
|
|
1069
|
+
/* @__PURE__ */ e("button", { type: "button", className: "cms-call-bar__icon cms-call-bar__icon--hang-up", "aria-label": i.hangUp, onClick: m, children: /* @__PURE__ */ e(P, { name: "phone-off" }) })
|
|
1070
1070
|
] })
|
|
1071
1071
|
] });
|
|
1072
1072
|
}
|
|
@@ -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,17 +1101,17 @@ 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
|
|
1106
|
-
return /* @__PURE__ */ s("form", { className: "cms-signin-form", onSubmit: (
|
|
1107
|
-
|
|
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
|
+
return /* @__PURE__ */ s("form", { className: "cms-signin-form", onSubmit: (w) => {
|
|
1107
|
+
w.preventDefault(), l(o, h);
|
|
1108
1108
|
}, "aria-describedby": r ? `${u}-error` : void 0, children: [
|
|
1109
|
-
/* @__PURE__ */ e("h1", { className: "cms-signin-form__title", children:
|
|
1109
|
+
/* @__PURE__ */ e("h1", { className: "cms-signin-form__title", children: i.title }),
|
|
1110
1110
|
/* @__PURE__ */ s("p", { className: "cms-signin-form__server", children: [
|
|
1111
1111
|
/* @__PURE__ */ e(P, { name: "server", size: 18 }),
|
|
1112
1112
|
n
|
|
1113
1113
|
] }),
|
|
1114
|
-
/* @__PURE__ */ e("label", { className: "cms-signin-form__label", htmlFor: `${u}-identifier`, children:
|
|
1114
|
+
/* @__PURE__ */ e("label", { className: "cms-signin-form__label", htmlFor: `${u}-identifier`, children: i.identifier }),
|
|
1115
1115
|
/* @__PURE__ */ e(
|
|
1116
1116
|
"input",
|
|
1117
1117
|
{
|
|
@@ -1119,114 +1119,114 @@ function Pn({ server: n, onSubmit: l, forgotHref: a, createHref: t, error: r, bu
|
|
|
1119
1119
|
className: "cms-signin-form__input",
|
|
1120
1120
|
type: "text",
|
|
1121
1121
|
autoComplete: "username",
|
|
1122
|
-
placeholder:
|
|
1123
|
-
value:
|
|
1124
|
-
onChange: (
|
|
1122
|
+
placeholder: i.identifierPlaceholder,
|
|
1123
|
+
value: o,
|
|
1124
|
+
onChange: (w) => _(w.target.value),
|
|
1125
1125
|
required: !0
|
|
1126
1126
|
}
|
|
1127
1127
|
),
|
|
1128
|
-
/* @__PURE__ */ e("label", { className: "cms-signin-form__label", htmlFor: `${u}-password`, children:
|
|
1128
|
+
/* @__PURE__ */ e("label", { className: "cms-signin-form__label", htmlFor: `${u}-password`, children: i.password }),
|
|
1129
1129
|
/* @__PURE__ */ s("span", { className: "cms-signin-form__password", children: [
|
|
1130
1130
|
/* @__PURE__ */ e(
|
|
1131
1131
|
"input",
|
|
1132
1132
|
{
|
|
1133
1133
|
id: `${u}-password`,
|
|
1134
1134
|
className: "cms-signin-form__input",
|
|
1135
|
-
type:
|
|
1135
|
+
type: g ? "text" : "password",
|
|
1136
1136
|
autoComplete: "current-password",
|
|
1137
1137
|
value: h,
|
|
1138
|
-
onChange: (
|
|
1138
|
+
onChange: (w) => c(w.target.value),
|
|
1139
1139
|
required: !0
|
|
1140
1140
|
}
|
|
1141
1141
|
),
|
|
1142
|
-
/* @__PURE__ */ e("button", { type: "button", className: "cms-signin-form__show", "aria-pressed":
|
|
1142
|
+
/* @__PURE__ */ e("button", { type: "button", className: "cms-signin-form__show", "aria-pressed": g, onClick: () => N((w) => !w), children: g ? i.hide : i.show })
|
|
1143
1143
|
] }),
|
|
1144
|
-
a ? /* @__PURE__ */ e("a", { className: "cms-signin-form__forgot", href: a, children:
|
|
1144
|
+
a ? /* @__PURE__ */ e("a", { className: "cms-signin-form__forgot", href: a, children: i.forgot }) : null,
|
|
1145
1145
|
r ? /* @__PURE__ */ e("p", { id: `${u}-error`, className: "cms-signin-form__error", role: "alert", children: r }) : null,
|
|
1146
|
-
/* @__PURE__ */ e("button", { type: "submit", className: "cms-button cms-button--chrome cms-signin-form__submit", disabled: m, "aria-busy": m || void 0, children:
|
|
1146
|
+
/* @__PURE__ */ e("button", { type: "submit", className: "cms-button cms-button--chrome cms-signin-form__submit", disabled: m, "aria-busy": m || void 0, children: i.submit }),
|
|
1147
1147
|
t ? /* @__PURE__ */ s(x, { children: [
|
|
1148
|
-
/* @__PURE__ */ e("p", { className: "cms-signin-form__or", children: /* @__PURE__ */ e("span", { children:
|
|
1149
|
-
/* @__PURE__ */ e("a", { className: "cms-button cms-signin-form__create", href: t, children:
|
|
1148
|
+
/* @__PURE__ */ e("p", { className: "cms-signin-form__or", children: /* @__PURE__ */ e("span", { children: i.newHere }) }),
|
|
1149
|
+
/* @__PURE__ */ e("a", { className: "cms-button cms-signin-form__create", href: t, children: i.create })
|
|
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:
|
|
1154
|
-
const _ =
|
|
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
|
+
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:
|
|
1158
|
-
const h = (
|
|
1159
|
-
var
|
|
1160
|
-
if (
|
|
1161
|
-
|
|
1162
|
-
else if (
|
|
1163
|
-
u == null || u(
|
|
1164
|
-
else if ((
|
|
1165
|
-
|
|
1166
|
-
const
|
|
1167
|
-
|
|
1157
|
+
if (l.length === 0) return /* @__PURE__ */ e(Fe, { title: m, hint: d });
|
|
1158
|
+
const h = (c, g, N) => {
|
|
1159
|
+
var b;
|
|
1160
|
+
if (c.key === "ArrowDown" || c.key === "ArrowUp")
|
|
1161
|
+
c.preventDefault(), (b = _.current[Math.min(l.length - 1, Math.max(0, g + (c.key === "ArrowDown" ? 1 : -1)))]) == null || b.focus();
|
|
1162
|
+
else if (c.key === "Enter")
|
|
1163
|
+
u == null || u(N);
|
|
1164
|
+
else if ((c.key === "ContextMenu" || c.shiftKey && c.key === "F10") && o) {
|
|
1165
|
+
c.preventDefault();
|
|
1166
|
+
const w = c.currentTarget.getBoundingClientRect();
|
|
1167
|
+
o(N, { x: w.left + 16, y: w.bottom });
|
|
1168
1168
|
}
|
|
1169
1169
|
};
|
|
1170
|
-
return /* @__PURE__ */ e("ul", { className: "cms-list", role: "listbox", "aria-label": n, children: l.map((
|
|
1171
|
-
const
|
|
1170
|
+
return /* @__PURE__ */ e("ul", { className: "cms-list", role: "listbox", "aria-label": n, children: l.map((c, g) => {
|
|
1171
|
+
const N = c.id === i;
|
|
1172
1172
|
return /* @__PURE__ */ s(
|
|
1173
1173
|
"li",
|
|
1174
1174
|
{
|
|
1175
|
-
ref: (
|
|
1176
|
-
_.current[
|
|
1175
|
+
ref: (b) => {
|
|
1176
|
+
_.current[g] = b;
|
|
1177
1177
|
},
|
|
1178
1178
|
role: "option",
|
|
1179
|
-
"aria-selected":
|
|
1180
|
-
tabIndex:
|
|
1181
|
-
className: C("cms-list__row",
|
|
1182
|
-
onClick: () => u == null ? void 0 : u(
|
|
1183
|
-
onKeyDown: (
|
|
1184
|
-
onContextMenu:
|
|
1185
|
-
|
|
1179
|
+
"aria-selected": N,
|
|
1180
|
+
tabIndex: N || i == null && g === 0 ? 0 : -1,
|
|
1181
|
+
className: C("cms-list__row", N && "is-selected"),
|
|
1182
|
+
onClick: () => u == null ? void 0 : u(c.id),
|
|
1183
|
+
onKeyDown: (b) => h(b, g, c.id),
|
|
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,
|
|
1189
1189
|
/* @__PURE__ */ s("span", { className: "cms-list__text", children: [
|
|
1190
|
-
/* @__PURE__ */ e("span", { className: "cms-list__primary", children:
|
|
1191
|
-
|
|
1190
|
+
/* @__PURE__ */ e("span", { className: "cms-list__primary", children: c.primary }),
|
|
1191
|
+
c.secondary != null ? /* @__PURE__ */ e("span", { className: "cms-list__secondary", children: c.secondary }) : null
|
|
1192
1192
|
] }),
|
|
1193
|
-
|
|
1193
|
+
c.meta != null ? /* @__PURE__ */ e("span", { className: "cms-list__meta", children: c.meta }) : null
|
|
1194
1194
|
]
|
|
1195
1195
|
},
|
|
1196
|
-
|
|
1196
|
+
c.id
|
|
1197
1197
|
);
|
|
1198
1198
|
}) });
|
|
1199
1199
|
}
|
|
1200
1200
|
function en({ at: n, items: l, onClose: a, label: t = "Actions", focus: r = "first" }) {
|
|
1201
|
-
const m =
|
|
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
|
-
const h = m.current,
|
|
1205
|
-
u({ x: Math.max(0, Math.min(n.x, window.innerWidth -
|
|
1204
|
+
const h = m.current, c = (h == null ? void 0 : h.offsetWidth) ?? 0, g = (h == null ? void 0 : h.offsetHeight) ?? 0;
|
|
1205
|
+
u({ x: Math.max(0, Math.min(n.x, window.innerWidth - c)), y: Math.max(0, Math.min(n.y, window.innerHeight - g)) });
|
|
1206
1206
|
}, [n]), G(() => {
|
|
1207
|
-
var
|
|
1207
|
+
var g, N;
|
|
1208
1208
|
if (!n) return;
|
|
1209
|
-
|
|
1210
|
-
const h = Array.from(((
|
|
1211
|
-
(
|
|
1212
|
-
const
|
|
1213
|
-
var
|
|
1214
|
-
(
|
|
1209
|
+
d.current = document.activeElement;
|
|
1210
|
+
const h = Array.from(((g = m.current) == null ? void 0 : g.querySelectorAll('[role="menuitem"]:not([aria-disabled="true"])')) ?? []);
|
|
1211
|
+
(N = r === "last" ? h[h.length - 1] : h[0]) == null || N.focus();
|
|
1212
|
+
const c = (b) => {
|
|
1213
|
+
var w;
|
|
1214
|
+
(w = m.current) != null && w.contains(b.target) || a();
|
|
1215
1215
|
};
|
|
1216
|
-
return document.addEventListener("mousedown",
|
|
1217
|
-
var
|
|
1218
|
-
document.removeEventListener("mousedown",
|
|
1216
|
+
return document.addEventListener("mousedown", c), () => {
|
|
1217
|
+
var b, w;
|
|
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
|
-
var
|
|
1223
|
-
const
|
|
1222
|
+
var N, b;
|
|
1223
|
+
const c = Array.from(((N = m.current) == null ? void 0 : N.querySelectorAll('[role="menuitem"]')) ?? []), g = c.indexOf(document.activeElement);
|
|
1224
1224
|
if (h.key === "Escape" || h.key === "Tab")
|
|
1225
1225
|
h.preventDefault(), a();
|
|
1226
1226
|
else if (h.key === "ArrowDown" || h.key === "ArrowUp") {
|
|
1227
1227
|
h.preventDefault();
|
|
1228
|
-
const
|
|
1229
|
-
(
|
|
1228
|
+
const w = h.key === "ArrowDown" ? 1 : -1;
|
|
1229
|
+
(b = c[(g + w + c.length) % c.length]) == null || b.focus();
|
|
1230
1230
|
}
|
|
1231
1231
|
};
|
|
1232
1232
|
return ke(
|
|
@@ -1237,29 +1237,29 @@ function en({ at: n, items: l, onClose: a, label: t = "Actions", focus: r = "fir
|
|
|
1237
1237
|
className: "cms-menu",
|
|
1238
1238
|
role: "menu",
|
|
1239
1239
|
"aria-label": t,
|
|
1240
|
-
style: { left: (
|
|
1240
|
+
style: { left: (i ?? n).x, top: (i ?? n).y },
|
|
1241
1241
|
onKeyDown: _,
|
|
1242
1242
|
onContextMenu: (h) => h.preventDefault(),
|
|
1243
|
-
children:
|
|
1244
|
-
const
|
|
1243
|
+
children: o.map((h) => {
|
|
1244
|
+
const c = h.offer.refusal !== void 0;
|
|
1245
1245
|
return /* @__PURE__ */ s(
|
|
1246
1246
|
"div",
|
|
1247
1247
|
{
|
|
1248
1248
|
role: "menuitem",
|
|
1249
1249
|
tabIndex: -1,
|
|
1250
|
-
"aria-disabled":
|
|
1251
|
-
title:
|
|
1252
|
-
className: C("cms-menu__item", h.danger && "is-danger", h.offer.locked && "is-locked",
|
|
1250
|
+
"aria-disabled": c || void 0,
|
|
1251
|
+
title: c ? h.offer.refusal : void 0,
|
|
1252
|
+
className: C("cms-menu__item", h.danger && "is-danger", h.offer.locked && "is-locked", c && "is-refused"),
|
|
1253
1253
|
onClick: () => {
|
|
1254
|
-
|
|
1254
|
+
c || (a(), h.onSelect());
|
|
1255
1255
|
},
|
|
1256
|
-
onKeyDown: (
|
|
1257
|
-
(
|
|
1256
|
+
onKeyDown: (g) => {
|
|
1257
|
+
(g.key === "Enter" || g.key === " ") && !c && (g.preventDefault(), a(), h.onSelect());
|
|
1258
1258
|
},
|
|
1259
1259
|
children: [
|
|
1260
1260
|
h.offer.locked ? /* @__PURE__ */ e(F, { name: "lock" }) : null,
|
|
1261
1261
|
/* @__PURE__ */ e("span", { className: "cms-menu__label", children: h.label }),
|
|
1262
|
-
|
|
1262
|
+
c ? /* @__PURE__ */ e("span", { className: "cms-menu__refusal", children: h.offer.refusal }) : null
|
|
1263
1263
|
]
|
|
1264
1264
|
},
|
|
1265
1265
|
h.id
|
|
@@ -1282,16 +1282,16 @@ 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
|
-
const
|
|
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;
|
|
1290
1290
|
return ((K = M.querySelector(T)) == null ? void 0 : K.getBoundingClientRect().width) ?? 0;
|
|
1291
|
-
}, oe =
|
|
1292
|
-
const Y = /* @__PURE__ */ new Set([...
|
|
1293
|
-
return oe + he.reduce((le, pe) => le + ue(pe.id, !T.has(pe.id)), 0) + de * Math.max(0, se.length - 1) + (Y.size > 0 ? me : 0) +
|
|
1294
|
-
},
|
|
1291
|
+
}, oe = q('[data-measure="leading"]'), de = q('[data-measure="separator"]'), me = q('[data-measure="more"]'), ue = (T, K) => q(`[data-measure="${K ? "full" : "icon"}"][data-measure-action="${CSS.escape(T)}"]`), p = (T, K) => {
|
|
1292
|
+
const Y = /* @__PURE__ */ new Set([...U.map((le) => le.id), ...K]), se = k.map((le) => le.filter((pe) => !Y.has(pe.id))).filter((le) => le.length > 0), he = se.flat(), Te = he.length + (se.length - 1) + (Y.size > 0 ? 1 : 0) + (oe > 0 ? 1 : 0);
|
|
1293
|
+
return oe + he.reduce((le, pe) => le + ue(pe.id, !T.has(pe.id)), 0) + de * Math.max(0, se.length - 1) + (Y.size > 0 ? me : 0) + j * Math.max(0, Te - 1);
|
|
1294
|
+
}, y = R.filter((T) => !S.some((K) => K.includes(T.id))).map((T) => T.id), I = [...S, ...[...y].reverse().map((T) => [T])];
|
|
1295
1295
|
let B = null;
|
|
1296
1296
|
if (p(/* @__PURE__ */ new Set(), /* @__PURE__ */ new Set()) <= $) B = Ce;
|
|
1297
1297
|
else {
|
|
@@ -1305,33 +1305,33 @@ function Fn({ label: n, actions: l, onAction: a, status: t, moreLabel: r, leadin
|
|
|
1305
1305
|
}
|
|
1306
1306
|
}
|
|
1307
1307
|
if (B === null) {
|
|
1308
|
-
const T = new Set(
|
|
1308
|
+
const T = new Set(R.map((Y) => Y.id)), K = /* @__PURE__ */ new Set();
|
|
1309
1309
|
for (const Y of S) {
|
|
1310
|
-
for (const se of Y)
|
|
1310
|
+
for (const se of Y) R.some((he) => he.id === se) && K.add(se);
|
|
1311
1311
|
if (K.size >= 2 && p(T, K) <= $) break;
|
|
1312
1312
|
}
|
|
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
|
-
Ae(
|
|
1319
|
-
const f =
|
|
1318
|
+
Ae(v, [v]), G(() => {
|
|
1319
|
+
const f = d.current;
|
|
1320
1320
|
if (f === null || typeof ResizeObserver > "u") return;
|
|
1321
|
-
const M = new ResizeObserver(() =>
|
|
1321
|
+
const M = new ResizeObserver(() => v());
|
|
1322
1322
|
return M.observe(f), () => M.disconnect();
|
|
1323
|
-
}, [
|
|
1324
|
-
const E = /* @__PURE__ */ new Set([...
|
|
1325
|
-
...
|
|
1323
|
+
}, [v]);
|
|
1324
|
+
const E = /* @__PURE__ */ new Set([...U.map((f) => f.id), ...u.hidden]), V = k.map((f) => f.filter((M) => !E.has(M.id))).filter((f) => f.length > 0).flat(), L = [
|
|
1325
|
+
...U,
|
|
1326
1326
|
...S.flat().map((f) => A.find((M) => M.id === f)).filter((f) => f !== void 0 && u.hidden.has(f.id))
|
|
1327
|
-
], X = new Set(
|
|
1328
|
-
var $,
|
|
1329
|
-
const M = z.indexOf(
|
|
1330
|
-
let
|
|
1331
|
-
if (f.key === "ArrowRight" ?
|
|
1327
|
+
], X = new Set(R.filter((f) => !S.some((M) => M.includes(f.id))).map((f) => f.id)), z = [...V.map((f) => f.id), ...L.length > 0 ? ["more"] : []], Q = N !== null && z.includes(N) ? N : z[0] ?? null, ce = (f) => {
|
|
1328
|
+
var $, q;
|
|
1329
|
+
const M = z.indexOf(Q ?? "");
|
|
1330
|
+
let O = null;
|
|
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
|
-
const
|
|
1334
|
-
|
|
1333
|
+
const j = z[O] ?? null;
|
|
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,33 +1347,33 @@ 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(
|
|
1354
1354
|
"cms-pane-toolbar",
|
|
1355
|
-
|
|
1356
|
-
u.bare.size > 0 && u.bare.size <
|
|
1355
|
+
R.length > 0 && u.bare.size >= R.length && "cms-pane-toolbar--labels-hidden",
|
|
1356
|
+
u.bare.size > 0 && u.bare.size < R.length && "cms-pane-toolbar--labels-partly-hidden"
|
|
1357
1357
|
),
|
|
1358
1358
|
onKeyDown: ce,
|
|
1359
1359
|
children: [
|
|
1360
1360
|
m !== void 0 ? /* @__PURE__ */ e("div", { className: "cms-pane-toolbar__leading", children: m }) : null,
|
|
1361
|
-
|
|
1362
|
-
const
|
|
1361
|
+
k.map((f, M) => {
|
|
1362
|
+
const O = f.filter(($) => !E.has($.id)), j = k.slice(0, M).some(($) => $.some((q) => !E.has(q.id)));
|
|
1363
1363
|
return /* @__PURE__ */ s("div", { className: "cms-pane-toolbar__group-wrap", children: [
|
|
1364
|
-
|
|
1365
|
-
/* @__PURE__ */ e("div", { className: "cms-pane-toolbar__group", hidden:
|
|
1364
|
+
O.length > 0 && j ? /* @__PURE__ */ e("span", { className: "cms-pane-toolbar__separator", role: "separator", "aria-orientation": "vertical" }) : null,
|
|
1365
|
+
/* @__PURE__ */ e("div", { className: "cms-pane-toolbar__group", hidden: O.length === 0, children: f.map(($) => /* @__PURE__ */ e(
|
|
1366
1366
|
an,
|
|
1367
1367
|
{
|
|
1368
1368
|
action: $,
|
|
1369
1369
|
labels: !u.bare.has($.id),
|
|
1370
1370
|
overflowed: E.has($.id),
|
|
1371
1371
|
pinned: X.has($.id),
|
|
1372
|
-
tabbable:
|
|
1373
|
-
tipOff:
|
|
1372
|
+
tabbable: Q === $.id,
|
|
1373
|
+
tipOff: w === $.id,
|
|
1374
1374
|
onChoose: () => a($.id),
|
|
1375
1375
|
onFocus: () => {
|
|
1376
|
-
|
|
1376
|
+
b($.id), H(null);
|
|
1377
1377
|
}
|
|
1378
1378
|
},
|
|
1379
1379
|
$.id
|
|
@@ -1390,25 +1390,25 @@ function Fn({ label: n, actions: l, onAction: a, status: t, moreLabel: r, leadin
|
|
|
1390
1390
|
title: r,
|
|
1391
1391
|
"aria-haspopup": "menu",
|
|
1392
1392
|
"aria-expanded": _ !== null,
|
|
1393
|
-
tabIndex:
|
|
1394
|
-
onFocus: () =>
|
|
1393
|
+
tabIndex: Q === "more" ? 0 : -1,
|
|
1394
|
+
onFocus: () => b("more"),
|
|
1395
1395
|
onClick: (f) => {
|
|
1396
1396
|
const M = f.currentTarget.getBoundingClientRect();
|
|
1397
|
-
|
|
1397
|
+
g("first"), h(_ === null ? { x: M.left, y: M.bottom } : null);
|
|
1398
1398
|
},
|
|
1399
1399
|
onKeyDown: (f) => {
|
|
1400
1400
|
if (f.key === "ArrowDown" || f.key === "ArrowUp") {
|
|
1401
1401
|
f.preventDefault(), f.stopPropagation();
|
|
1402
1402
|
const M = f.currentTarget.getBoundingClientRect();
|
|
1403
|
-
|
|
1403
|
+
g(f.key === "ArrowUp" ? "last" : "first"), h({ x: M.left, y: M.bottom });
|
|
1404
1404
|
}
|
|
1405
1405
|
},
|
|
1406
1406
|
children: /* @__PURE__ */ e(P, { name: "more" })
|
|
1407
1407
|
}
|
|
1408
1408
|
) : null,
|
|
1409
1409
|
t !== void 0 ? /* @__PURE__ */ e("span", { className: "cms-pane-toolbar__status", title: t, children: t }) : null,
|
|
1410
|
-
/* @__PURE__ */ e(en, { at: _, items: ie, onClose: () => h(null), label: r, focus:
|
|
1411
|
-
/* @__PURE__ */ s("div", { ref:
|
|
1410
|
+
/* @__PURE__ */ e(en, { at: _, items: ie, onClose: () => h(null), label: r, focus: c }),
|
|
1411
|
+
/* @__PURE__ */ s("div", { ref: i, className: "cms-pane-toolbar__measure", "aria-hidden": "true", children: [
|
|
1412
1412
|
m !== void 0 ? /* @__PURE__ */ e("div", { "data-measure": "leading", children: m }) : null,
|
|
1413
1413
|
/* @__PURE__ */ e("span", { "data-measure": "separator", className: "cms-pane-toolbar__separator" }),
|
|
1414
1414
|
/* @__PURE__ */ e("span", { "data-measure": "more", className: "cms-icon-button cms-pane-toolbar__more", children: /* @__PURE__ */ e(P, { name: "more" }) }),
|
|
@@ -1424,17 +1424,17 @@ 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
|
|
1435
|
-
return () => clearTimeout(
|
|
1434
|
+
const H = setTimeout(() => o(!0), ye);
|
|
1435
|
+
return () => clearTimeout(H);
|
|
1436
1436
|
}, [n.busy]);
|
|
1437
|
-
const _ = be(n.icon) === null, h = l || _,
|
|
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);
|
|
1438
1438
|
return /* @__PURE__ */ s(
|
|
1439
1439
|
"button",
|
|
1440
1440
|
{
|
|
@@ -1448,15 +1448,21 @@ function an({ action: n, labels: l, overflowed: a, pinned: t, tabbable: r, tipOf
|
|
|
1448
1448
|
"aria-label": n.label,
|
|
1449
1449
|
"aria-disabled": n.disabled || void 0,
|
|
1450
1450
|
"aria-busy": n.busy || void 0,
|
|
1451
|
+
...c === null ? {} : { "aria-describedby": N },
|
|
1452
|
+
...b && c !== null ? { "data-reason-shown": "" } : {},
|
|
1451
1453
|
tabIndex: r ? 0 : -1,
|
|
1452
|
-
onFocus:
|
|
1454
|
+
onFocus: i,
|
|
1455
|
+
onBlur: () => w(!1),
|
|
1456
|
+
onKeyDown: (H) => {
|
|
1457
|
+
H.key === "Escape" && w(!1);
|
|
1458
|
+
},
|
|
1453
1459
|
onClick: () => {
|
|
1454
|
-
!n.disabled && !n.busy &&
|
|
1460
|
+
c !== null ? w(!0) : !n.disabled && !n.busy && d();
|
|
1455
1461
|
},
|
|
1456
1462
|
children: [
|
|
1457
1463
|
u ? /* @__PURE__ */ e(F, { name: "spinner" }) : /* @__PURE__ */ e(fe, { name: n.icon }),
|
|
1458
1464
|
h ? /* @__PURE__ */ e("span", { className: "cms-pane-toolbar__label", "aria-hidden": "true", children: n.label }) : null,
|
|
1459
|
-
|
|
1465
|
+
c !== null || g !== null && !m ? /* @__PURE__ */ e("span", { className: "cms-pane-toolbar__tip", role: "tooltip", id: N, children: g }) : null
|
|
1460
1466
|
]
|
|
1461
1467
|
}
|
|
1462
1468
|
);
|
|
@@ -1503,26 +1509,26 @@ function Hn() {
|
|
|
1503
1509
|
window.dispatchEvent(new Event(we));
|
|
1504
1510
|
}
|
|
1505
1511
|
function Rn(n) {
|
|
1506
|
-
const [l, a] = D(void 0), [t, r] = D(void 0), [m,
|
|
1507
|
-
|
|
1508
|
-
const u =
|
|
1512
|
+
const [l, a] = D(void 0), [t, r] = D(void 0), [m, d] = D(!0), i = Z(n);
|
|
1513
|
+
i.current = n;
|
|
1514
|
+
const u = Z(0), o = _e(() => {
|
|
1509
1515
|
const _ = ++u.current;
|
|
1510
|
-
|
|
1516
|
+
d(!0), i.current().then(
|
|
1511
1517
|
(h) => {
|
|
1512
|
-
_ === u.current && (a(h), r(void 0),
|
|
1518
|
+
_ === u.current && (a(h), r(void 0), d(!1));
|
|
1513
1519
|
},
|
|
1514
1520
|
(h) => {
|
|
1515
|
-
_ === u.current && (r(h),
|
|
1521
|
+
_ === u.current && (r(h), d(!1));
|
|
1516
1522
|
}
|
|
1517
1523
|
);
|
|
1518
1524
|
}, []);
|
|
1519
1525
|
return G(() => {
|
|
1520
|
-
|
|
1521
|
-
const _ = () =>
|
|
1526
|
+
o();
|
|
1527
|
+
const _ = () => o();
|
|
1522
1528
|
return window.addEventListener("focus", _), window.addEventListener(we, _), () => {
|
|
1523
1529
|
window.removeEventListener("focus", _), window.removeEventListener(we, _);
|
|
1524
1530
|
};
|
|
1525
|
-
}, [
|
|
1531
|
+
}, [o]), { value: l, error: t, loading: m, reread: o };
|
|
1526
1532
|
}
|
|
1527
1533
|
function On(n) {
|
|
1528
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 };
|
|
@@ -1531,8 +1537,8 @@ const cn = "/errors/client-update-required";
|
|
|
1531
1537
|
function on(n, l) {
|
|
1532
1538
|
const a = n.split(".").map((r) => Number.parseInt(r, 10) || 0), t = l.split(".").map((r) => Number.parseInt(r, 10) || 0);
|
|
1533
1539
|
for (let r = 0; r < Math.max(a.length, t.length); r++) {
|
|
1534
|
-
const m = a[r] ?? 0,
|
|
1535
|
-
if (m !==
|
|
1540
|
+
const m = a[r] ?? 0, d = t[r] ?? 0;
|
|
1541
|
+
if (m !== d) return m < d;
|
|
1536
1542
|
}
|
|
1537
1543
|
return !1;
|
|
1538
1544
|
}
|
|
@@ -1544,7 +1550,7 @@ export {
|
|
|
1544
1550
|
ve as Avatar,
|
|
1545
1551
|
Me as BOOTSTRAP_ICONS,
|
|
1546
1552
|
Ye as Badge,
|
|
1547
|
-
|
|
1553
|
+
ee as Button,
|
|
1548
1554
|
xe as CALL_LABELS,
|
|
1549
1555
|
cn as CLIENT_UPDATE_REQUIRED,
|
|
1550
1556
|
Tn as CallBar,
|