@mt-gloss/ui 0.0.14 → 0.0.15
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/BaseAsyncButton-nFOdhiBv.js +179 -0
- package/{Expandable-aJSmv_1C.js → Expandable-BXdTP6Nb.js} +2354 -2249
- package/{UIContext-Cx54OlNB.js → UIContext-C3E-k7HI.js} +185 -141
- package/catalog.js +356 -412
- package/index.js +299 -292
- package/internals.js +26 -26
- package/lib/composites/overlay/MergePrompt/MergePrompt.d.ts +12 -0
- package/package.json +1 -1
- package/ui.css +1 -1
- package/BaseAsyncButton-x5Us8SVv.js +0 -223
package/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { N as aa, T as ra, O as na, Q as oa, b2 as sa, av as ia, ad as la, Z as da, aj as ca, K as ua, a4 as ma, bl as ga, P as pa, B as ba, a as ha, y as fa, H as va, be as Ca, F as ya, J as Da, A as wa, z as Na, bd as Sa, E as xa, D as Ta, bt as ka, b as Ia, C as _a, L as Ra, o as Ma, a9 as Pa, aJ as Fa, y as Oa, H as Aa, F as Ea, J as La, A as Ba, z as Ga, E as za, D as Ha, aX as $a, a_ as Ka, aZ as Wa, aY as Za, a$ as Ya, ay as qa, am as Va, k as Ua, m as ja, aB as Qa, a7 as Xa, b4 as Ja, a5 as er, bm as tr, Y as ar, bD as rr, bC as nr, bE as or, al as sr, aM as ir, b6 as lr, bI as dr, n as cr, ai as ur, bx as mr, bp as gr, a0 as pr, an as br, a2 as hr, bw as fr, G as vr, d as Cr, bg as yr, a6 as Dr, bF as wr, aP as Nr, r as Sr, v as xr, I as Tr, g as kr, as as Ir, bJ as _r, M as Rr, w as Mr, U as Pr, X as Fr, V as Or, W as Ar, ao as Er, bc as Lr, bL as Br, bH as Gr, ak as zr, t as Hr, bn as $r, aO as Kr, af as Wr, aG as Zr, ac as Yr, ah as qr, aq as Vr, aN as Ur, a8 as jr, ap as Qr, c as Xr, R as Jr, j as en, p as tn, aD as an, bu as rn, bv as nn, ae as on, aa as sn, h as ln, x as dn, b3 as cn, ab as un, bK as mn, b8 as gn, bb as pn, b9 as bn, ba as hn, i as fn, b5 as vn, bk as Cn, S as yn, bh as Dn, bi as wn, ar as Nn, b7 as Sn, bM as xn, ag as Tn, s as kn, bG as In, l as _n, f as Rn, q as Mn, _ as Pn, $ as Fn, a3 as On, bf as An, bs as En, bz as Ln, aw as Bn, ax as Gn, aK as zn, aL as Hn, az as $n, aA as Kn, aC as Wn, aR as Zn, aS as Yn, bB as qn, bA as Vn, aU as Un, aV as jn, at as Qn, au as Xn, b1 as Jn, b0 as eo, aW as to, aH as ao, aI as ro, aT as no, aE as oo, aF as so, u as io, by as lo, bo as co, bq as uo, br as mo, aQ as go, a1 as po, e as bo, bj as ho } from "./Expandable-
|
|
2
|
-
import { jsxs as _, jsx as
|
|
3
|
-
import R, { useRef as F, useEffect as G, useState as M, useCallback as
|
|
4
|
-
import { B as we, U } from "./UIContext-
|
|
5
|
-
import { a as vo, u as Co } from "./UIContext-
|
|
1
|
+
import { N as aa, T as ra, O as na, Q as oa, b2 as sa, av as ia, ad as la, Z as da, aj as ca, K as ua, a4 as ma, bl as ga, P as pa, B as ba, a as ha, y as fa, H as va, be as Ca, F as ya, J as Da, A as wa, z as Na, bd as Sa, E as xa, D as Ta, bt as ka, b as Ia, C as _a, L as Ra, o as Ma, a9 as Pa, aJ as Fa, y as Oa, H as Aa, F as Ea, J as La, A as Ba, z as Ga, E as za, D as Ha, aX as $a, a_ as Ka, aZ as Wa, aY as Za, a$ as Ya, ay as qa, am as Va, k as Ua, m as ja, aB as Qa, a7 as Xa, b4 as Ja, a5 as er, bm as tr, Y as ar, bD as rr, bC as nr, bE as or, al as sr, aM as ir, b6 as lr, bI as dr, n as cr, ai as ur, bx as mr, bp as gr, a0 as pr, an as br, a2 as hr, bw as fr, G as vr, d as Cr, bg as yr, a6 as Dr, bF as wr, aP as Nr, r as Sr, v as xr, I as Tr, g as kr, as as Ir, bJ as _r, M as Rr, w as Mr, U as Pr, X as Fr, V as Or, W as Ar, ao as Er, bc as Lr, bL as Br, bH as Gr, ak as zr, t as Hr, bn as $r, aO as Kr, af as Wr, aG as Zr, ac as Yr, ah as qr, aq as Vr, aN as Ur, a8 as jr, ap as Qr, c as Xr, R as Jr, j as en, p as tn, aD as an, bu as rn, bv as nn, ae as on, aa as sn, h as ln, x as dn, b3 as cn, ab as un, bK as mn, b8 as gn, bb as pn, b9 as bn, ba as hn, i as fn, b5 as vn, bk as Cn, S as yn, bh as Dn, bi as wn, ar as Nn, b7 as Sn, bM as xn, ag as Tn, s as kn, bG as In, l as _n, f as Rn, q as Mn, _ as Pn, $ as Fn, a3 as On, bf as An, bs as En, bz as Ln, aw as Bn, ax as Gn, aK as zn, aL as Hn, az as $n, aA as Kn, aC as Wn, aR as Zn, aS as Yn, bB as qn, bA as Vn, aU as Un, aV as jn, at as Qn, au as Xn, b1 as Jn, b0 as eo, aW as to, aH as ao, aI as ro, aT as no, aE as oo, aF as so, u as io, by as lo, bo as co, bq as uo, br as mo, aQ as go, a1 as po, e as bo, bj as ho } from "./Expandable-BXdTP6Nb.js";
|
|
2
|
+
import { jsxs as _, jsx as d } from "react/jsx-runtime";
|
|
3
|
+
import R, { useRef as F, useEffect as G, useState as M, useCallback as p, forwardRef as ve, useMemo as Ce, createContext as ye, useContext as De } from "react";
|
|
4
|
+
import { B as we, U } from "./UIContext-C3E-k7HI.js";
|
|
5
|
+
import { a as vo, u as Co } from "./UIContext-C3E-k7HI.js";
|
|
6
6
|
import { createPortal as Ne } from "react-dom";
|
|
7
7
|
import { DEFAULT_MARKET_PRESETS as Do, DEFAULT_PINNED as wo, PERIOD_OPTIONS as No, ROLLING_OPTIONS as So, TODAY_PRESET as xo, findPreset as To, formatDateRange as ko, formatMarketDates as Io, formatTrend as _o, formatValue as Ro, generateMarketId as Mo, getAllPresets as Po, getDateRangeForPreset as Fo, getPresetLabel as Oo, isInRange as Ao, isMarketActive as Eo, isSameDay as Lo, normalizePresetId as Bo, toUppercasePresetId as Go } from "@mt-gloss/utils";
|
|
8
8
|
function ct(e = {}) {
|
|
@@ -23,93 +23,93 @@ function ut(e) {
|
|
|
23
23
|
loop: n = !0,
|
|
24
24
|
orientation: o = "vertical",
|
|
25
25
|
enabled: s = !0,
|
|
26
|
-
isItemDisabled:
|
|
27
|
-
onSelect:
|
|
28
|
-
onEscape:
|
|
29
|
-
} = e, [
|
|
30
|
-
(
|
|
31
|
-
r === void 0 &&
|
|
26
|
+
isItemDisabled: u,
|
|
27
|
+
onSelect: m,
|
|
28
|
+
onEscape: b
|
|
29
|
+
} = e, [D, N] = M(-1), g = r !== void 0 ? r : D, l = p(
|
|
30
|
+
(c) => {
|
|
31
|
+
r === void 0 && N(c), a?.(c);
|
|
32
32
|
},
|
|
33
33
|
[r, a]
|
|
34
|
-
),
|
|
35
|
-
(
|
|
36
|
-
const
|
|
37
|
-
if (
|
|
38
|
-
const O =
|
|
34
|
+
), h = p(() => t.map((c, y) => ({ item: c, index: y })).filter(({ item: c, index: y }) => !u?.(c, y)).map(({ index: c }) => c), [t, u]), S = p(
|
|
35
|
+
(c, y) => {
|
|
36
|
+
const C = h();
|
|
37
|
+
if (C.length === 0) return -1;
|
|
38
|
+
const O = C.indexOf(c);
|
|
39
39
|
if (O === -1)
|
|
40
|
-
return
|
|
41
|
-
let T = O +
|
|
42
|
-
return n ? T = (T +
|
|
40
|
+
return y === 1 ? C.find((E) => E > c) ?? (n ? C[0] : -1) : [...C].reverse().find((B) => B < c) ?? (n ? C[C.length - 1] : -1);
|
|
41
|
+
let T = O + y;
|
|
42
|
+
return n ? T = (T + C.length) % C.length : T = Math.max(0, Math.min(C.length - 1, T)), C[T];
|
|
43
43
|
},
|
|
44
|
-
[
|
|
45
|
-
), x =
|
|
46
|
-
const
|
|
47
|
-
|
|
48
|
-
}, [
|
|
49
|
-
const
|
|
50
|
-
|
|
51
|
-
}, [
|
|
52
|
-
const
|
|
53
|
-
|
|
54
|
-
}, [
|
|
55
|
-
const
|
|
56
|
-
|
|
57
|
-
}, [
|
|
58
|
-
|
|
59
|
-
}, [
|
|
60
|
-
(
|
|
44
|
+
[h, n]
|
|
45
|
+
), x = p(() => {
|
|
46
|
+
const c = h();
|
|
47
|
+
c.length > 0 && l(c[0]);
|
|
48
|
+
}, [h, l]), i = p(() => {
|
|
49
|
+
const c = h();
|
|
50
|
+
c.length > 0 && l(c[c.length - 1]);
|
|
51
|
+
}, [h, l]), f = p(() => {
|
|
52
|
+
const c = S(g, 1);
|
|
53
|
+
c !== -1 && l(c);
|
|
54
|
+
}, [g, S, l]), w = p(() => {
|
|
55
|
+
const c = S(g, -1);
|
|
56
|
+
c !== -1 && l(c);
|
|
57
|
+
}, [g, S, l]), v = p(() => {
|
|
58
|
+
l(-1);
|
|
59
|
+
}, [l]), k = p(
|
|
60
|
+
(c) => {
|
|
61
61
|
if (!s) return;
|
|
62
|
-
const { key:
|
|
63
|
-
if (
|
|
64
|
-
|
|
62
|
+
const { key: y } = c, C = y === "ArrowUp" && (o === "vertical" || o === "both"), O = y === "ArrowDown" && (o === "vertical" || o === "both"), T = y === "ArrowLeft" && (o === "horizontal" || o === "both"), E = y === "ArrowRight" && (o === "horizontal" || o === "both");
|
|
63
|
+
if (C || T) {
|
|
64
|
+
c.preventDefault(), g === -1 ? i() : w();
|
|
65
65
|
return;
|
|
66
66
|
}
|
|
67
67
|
if (O || E) {
|
|
68
|
-
|
|
68
|
+
c.preventDefault(), g === -1 ? x() : f();
|
|
69
69
|
return;
|
|
70
70
|
}
|
|
71
|
-
if (
|
|
72
|
-
|
|
71
|
+
if (y === "Home") {
|
|
72
|
+
c.preventDefault(), x();
|
|
73
73
|
return;
|
|
74
74
|
}
|
|
75
|
-
if (
|
|
76
|
-
|
|
75
|
+
if (y === "End") {
|
|
76
|
+
c.preventDefault(), i();
|
|
77
77
|
return;
|
|
78
78
|
}
|
|
79
|
-
if ((
|
|
80
|
-
|
|
81
|
-
const B = t[
|
|
82
|
-
|
|
79
|
+
if ((y === "Enter" || y === " ") && g >= 0 && g < t.length) {
|
|
80
|
+
c.preventDefault();
|
|
81
|
+
const B = t[g];
|
|
82
|
+
u?.(B, g) || m?.(B, g);
|
|
83
83
|
return;
|
|
84
84
|
}
|
|
85
|
-
if (
|
|
86
|
-
|
|
85
|
+
if (y === "Escape") {
|
|
86
|
+
b?.();
|
|
87
87
|
return;
|
|
88
88
|
}
|
|
89
89
|
},
|
|
90
90
|
[
|
|
91
91
|
s,
|
|
92
92
|
o,
|
|
93
|
-
|
|
93
|
+
g,
|
|
94
94
|
t,
|
|
95
95
|
x,
|
|
96
96
|
i,
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
c,
|
|
97
|
+
f,
|
|
98
|
+
w,
|
|
100
99
|
u,
|
|
101
|
-
|
|
100
|
+
m,
|
|
101
|
+
b
|
|
102
102
|
]
|
|
103
103
|
);
|
|
104
104
|
return {
|
|
105
|
-
focusedIndex:
|
|
106
|
-
setFocusedIndex:
|
|
105
|
+
focusedIndex: g,
|
|
106
|
+
setFocusedIndex: l,
|
|
107
107
|
handleKeyDown: k,
|
|
108
108
|
focusFirst: x,
|
|
109
109
|
focusLast: i,
|
|
110
|
-
focusNext:
|
|
111
|
-
focusPrevious:
|
|
112
|
-
resetFocus:
|
|
110
|
+
focusNext: f,
|
|
111
|
+
focusPrevious: w,
|
|
112
|
+
resetFocus: v
|
|
113
113
|
};
|
|
114
114
|
}
|
|
115
115
|
const H = (e) => {
|
|
@@ -231,88 +231,88 @@ function Re({
|
|
|
231
231
|
overflowActions: o,
|
|
232
232
|
onClose: s
|
|
233
233
|
}) {
|
|
234
|
-
const [
|
|
234
|
+
const [u, m] = M(null), b = F(null), D = p(() => {
|
|
235
235
|
if (!t) return { ...ee, top: 0, left: 0 };
|
|
236
|
-
const
|
|
236
|
+
const l = t.getBoundingClientRect();
|
|
237
237
|
return {
|
|
238
238
|
...ee,
|
|
239
|
-
top:
|
|
240
|
-
left:
|
|
239
|
+
top: l.bottom + 4,
|
|
240
|
+
left: l.left
|
|
241
241
|
};
|
|
242
242
|
}, [t]);
|
|
243
243
|
if (G(() => {
|
|
244
244
|
if (!e) return;
|
|
245
|
-
const
|
|
246
|
-
|
|
245
|
+
const l = (h) => {
|
|
246
|
+
h.key === "Escape" && s();
|
|
247
247
|
};
|
|
248
|
-
return document.addEventListener("keydown",
|
|
248
|
+
return document.addEventListener("keydown", l), () => document.removeEventListener("keydown", l);
|
|
249
249
|
}, [e, s]), G(() => {
|
|
250
250
|
if (!e) return;
|
|
251
|
-
const
|
|
252
|
-
|
|
251
|
+
const l = (h) => {
|
|
252
|
+
b.current && !b.current.contains(h.target) && s();
|
|
253
253
|
};
|
|
254
|
-
return document.addEventListener("pointerdown",
|
|
254
|
+
return document.addEventListener("pointerdown", l, !0), () => document.removeEventListener("pointerdown", l, !0);
|
|
255
255
|
}, [e, s]), !e) return null;
|
|
256
|
-
const
|
|
256
|
+
const N = o && o.length > 0, g = /* @__PURE__ */ _(
|
|
257
257
|
"div",
|
|
258
258
|
{
|
|
259
|
-
ref:
|
|
259
|
+
ref: b,
|
|
260
260
|
"data-status-chip-menu": r,
|
|
261
261
|
role: "menu",
|
|
262
262
|
"aria-label": "Status actions",
|
|
263
|
-
style:
|
|
263
|
+
style: D(),
|
|
264
264
|
children: [
|
|
265
|
-
/* @__PURE__ */
|
|
265
|
+
/* @__PURE__ */ d(
|
|
266
266
|
"button",
|
|
267
267
|
{
|
|
268
268
|
role: "menuitem",
|
|
269
|
-
style: Ie(
|
|
270
|
-
onMouseEnter: () =>
|
|
271
|
-
onMouseLeave: () =>
|
|
269
|
+
style: Ie(u === "__primary"),
|
|
270
|
+
onMouseEnter: () => m("__primary"),
|
|
271
|
+
onMouseLeave: () => m(null),
|
|
272
272
|
onClick: () => {
|
|
273
273
|
a(r), s();
|
|
274
274
|
},
|
|
275
275
|
children: "Open in table"
|
|
276
276
|
}
|
|
277
277
|
),
|
|
278
|
-
/* @__PURE__ */
|
|
278
|
+
/* @__PURE__ */ d(
|
|
279
279
|
"button",
|
|
280
280
|
{
|
|
281
281
|
role: "menuitem",
|
|
282
|
-
style: W(
|
|
283
|
-
onMouseEnter: () =>
|
|
284
|
-
onMouseLeave: () =>
|
|
282
|
+
style: W(u === "__graph"),
|
|
283
|
+
onMouseEnter: () => m("__graph"),
|
|
284
|
+
onMouseLeave: () => m(null),
|
|
285
285
|
onClick: () => {
|
|
286
286
|
n(r), s();
|
|
287
287
|
},
|
|
288
288
|
children: "Show on graph"
|
|
289
289
|
}
|
|
290
290
|
),
|
|
291
|
-
|
|
292
|
-
|
|
291
|
+
N && /* @__PURE__ */ d("div", { style: _e }),
|
|
292
|
+
N && o?.map((l) => /* @__PURE__ */ d(
|
|
293
293
|
"button",
|
|
294
294
|
{
|
|
295
295
|
role: "menuitem",
|
|
296
|
-
style: W(
|
|
297
|
-
onMouseEnter: () =>
|
|
298
|
-
onMouseLeave: () =>
|
|
296
|
+
style: W(u === l.id),
|
|
297
|
+
onMouseEnter: () => m(l.id),
|
|
298
|
+
onMouseLeave: () => m(null),
|
|
299
299
|
onClick: () => {
|
|
300
|
-
|
|
300
|
+
l.onSelect(r), s();
|
|
301
301
|
},
|
|
302
|
-
children:
|
|
302
|
+
children: l.label
|
|
303
303
|
},
|
|
304
|
-
|
|
304
|
+
l.id
|
|
305
305
|
))
|
|
306
306
|
]
|
|
307
307
|
}
|
|
308
308
|
);
|
|
309
|
-
return Ne(
|
|
309
|
+
return Ne(g, document.body);
|
|
310
310
|
}
|
|
311
311
|
Re.displayName = "StatusSlotChipMenu";
|
|
312
312
|
const Me = ve(
|
|
313
313
|
function({ state: t, onPointerDown: r, onPointerUp: a, edge: n = "right", ariaLabel: o = "Resize card" }, s) {
|
|
314
|
-
const
|
|
315
|
-
return /* @__PURE__ */
|
|
314
|
+
const u = t === "handle-visible" || t === "dragging";
|
|
315
|
+
return /* @__PURE__ */ d(
|
|
316
316
|
"button",
|
|
317
317
|
{
|
|
318
318
|
ref: s,
|
|
@@ -323,11 +323,11 @@ const Me = ve(
|
|
|
323
323
|
className: [
|
|
324
324
|
"gloss-edge-handle",
|
|
325
325
|
`gloss-edge-handle--${n}`,
|
|
326
|
-
|
|
326
|
+
u ? "gloss-edge-handle--visible" : ""
|
|
327
327
|
].filter(Boolean).join(" "),
|
|
328
328
|
onPointerDown: r,
|
|
329
329
|
onPointerUp: a,
|
|
330
|
-
tabIndex:
|
|
330
|
+
tabIndex: u ? 0 : -1
|
|
331
331
|
}
|
|
332
332
|
);
|
|
333
333
|
}
|
|
@@ -339,7 +339,7 @@ function Pe({
|
|
|
339
339
|
enterMs: r = 180,
|
|
340
340
|
exitMs: a = 120
|
|
341
341
|
}) {
|
|
342
|
-
return /* @__PURE__ */
|
|
342
|
+
return /* @__PURE__ */ d(
|
|
343
343
|
"div",
|
|
344
344
|
{
|
|
345
345
|
"aria-hidden": "true",
|
|
@@ -363,44 +363,44 @@ function wt({
|
|
|
363
363
|
enterMs: o = 180,
|
|
364
364
|
exitMs: s = 120
|
|
365
365
|
}) {
|
|
366
|
-
const [
|
|
367
|
-
|
|
368
|
-
}, []),
|
|
369
|
-
|
|
370
|
-
}, [n]),
|
|
371
|
-
|
|
372
|
-
}, [
|
|
366
|
+
const [u, m] = M("idle"), b = F(null), D = F(null), N = p(() => {
|
|
367
|
+
b.current && (clearTimeout(b.current), b.current = null);
|
|
368
|
+
}, []), g = p(() => {
|
|
369
|
+
m((i) => i !== "idle" ? i : (b.current = setTimeout(() => m("handle-visible"), n), "dwelling"));
|
|
370
|
+
}, [n]), l = p(() => {
|
|
371
|
+
N(), m((i) => i === "dwelling" || i === "handle-visible" ? "idle" : i);
|
|
372
|
+
}, [N]), h = p(
|
|
373
373
|
(i) => {
|
|
374
|
-
|
|
374
|
+
m((f) => f !== "handle-visible" ? f : (D.current = i.clientX, "dragging"));
|
|
375
375
|
},
|
|
376
376
|
[]
|
|
377
|
-
), S =
|
|
377
|
+
), S = p(
|
|
378
378
|
(i) => {
|
|
379
|
-
|
|
380
|
-
if (
|
|
381
|
-
const
|
|
382
|
-
if (
|
|
379
|
+
m((f) => {
|
|
380
|
+
if (f !== "dragging") return f;
|
|
381
|
+
const w = i.clientX - (D.current ?? i.clientX), k = Math.round(w / 180), c = Math.min(3, Math.max(1, e + k));
|
|
382
|
+
if (c === e)
|
|
383
383
|
return a?.(), "cancelled";
|
|
384
|
-
const
|
|
385
|
-
return r({ direction:
|
|
384
|
+
const y = c > e ? "grow" : "shrink";
|
|
385
|
+
return r({ direction: y, targetColSpan: c, mode: t ? "slot-fill" : "sparkline-fidelity" }), "committed";
|
|
386
386
|
});
|
|
387
387
|
},
|
|
388
388
|
[e, t, r, a]
|
|
389
|
-
), x =
|
|
390
|
-
|
|
391
|
-
}, [
|
|
389
|
+
), x = p(() => {
|
|
390
|
+
N(), m((i) => i === "dragging" || i === "handle-visible" ? (a?.(), "cancelled") : i);
|
|
391
|
+
}, [N, a]);
|
|
392
392
|
return G(() => {
|
|
393
|
-
if (
|
|
394
|
-
const i = (
|
|
395
|
-
|
|
393
|
+
if (u !== "dragging" && u !== "handle-visible") return;
|
|
394
|
+
const i = (f) => {
|
|
395
|
+
f.key === "Escape" && x();
|
|
396
396
|
};
|
|
397
397
|
return window.addEventListener("keydown", i), () => window.removeEventListener("keydown", i);
|
|
398
|
-
}, [
|
|
399
|
-
state:
|
|
400
|
-
enterEdgeZone:
|
|
401
|
-
leaveEdgeZone:
|
|
402
|
-
handleProps: { onPointerDown:
|
|
403
|
-
ghostProps: { visible:
|
|
398
|
+
}, [u, x]), G(() => () => N(), [N]), {
|
|
399
|
+
state: u,
|
|
400
|
+
enterEdgeZone: g,
|
|
401
|
+
leaveEdgeZone: l,
|
|
402
|
+
handleProps: { onPointerDown: h, onPointerUp: S },
|
|
403
|
+
ghostProps: { visible: u === "dragging", enterMs: o, exitMs: s }
|
|
404
404
|
};
|
|
405
405
|
}
|
|
406
406
|
const Nt = {
|
|
@@ -660,18 +660,23 @@ function ne({
|
|
|
660
660
|
activePageId: n,
|
|
661
661
|
onPageChange: o,
|
|
662
662
|
onCreatePage: s,
|
|
663
|
-
onManagePages:
|
|
663
|
+
onManagePages: u
|
|
664
664
|
}) {
|
|
665
|
-
const
|
|
666
|
-
(
|
|
667
|
-
o(
|
|
665
|
+
const m = p(
|
|
666
|
+
(g) => {
|
|
667
|
+
o(g), t();
|
|
668
668
|
},
|
|
669
669
|
[o, t]
|
|
670
|
-
),
|
|
670
|
+
), b = p(
|
|
671
|
+
(g, l) => {
|
|
672
|
+
(l.key === "Enter" || l.key === " ") && (l.preventDefault(), m(g));
|
|
673
|
+
},
|
|
674
|
+
[m]
|
|
675
|
+
), D = p(() => {
|
|
671
676
|
s(), t();
|
|
672
|
-
}, [s, t]),
|
|
673
|
-
|
|
674
|
-
}, [
|
|
677
|
+
}, [s, t]), N = p(() => {
|
|
678
|
+
u(), t();
|
|
679
|
+
}, [u, t]);
|
|
675
680
|
return /* @__PURE__ */ _(
|
|
676
681
|
we,
|
|
677
682
|
{
|
|
@@ -686,53 +691,55 @@ function ne({
|
|
|
686
691
|
anchorRef: r,
|
|
687
692
|
className: "gloss-page-dropdown",
|
|
688
693
|
children: [
|
|
689
|
-
/* @__PURE__ */
|
|
690
|
-
const
|
|
694
|
+
/* @__PURE__ */ d("ul", { role: "menu", className: "gloss-page-dropdown__list", children: a.map((g) => {
|
|
695
|
+
const l = g.id === n;
|
|
691
696
|
return /* @__PURE__ */ _(
|
|
692
697
|
"li",
|
|
693
698
|
{
|
|
694
699
|
role: "menuitemradio",
|
|
695
|
-
"aria-checked":
|
|
696
|
-
"aria-current":
|
|
697
|
-
|
|
700
|
+
"aria-checked": l,
|
|
701
|
+
"aria-current": l ? "page" : void 0,
|
|
702
|
+
tabIndex: 0,
|
|
703
|
+
className: `gloss-page-dropdown__item${l ? " gloss-page-dropdown__item--active" : ""}`,
|
|
704
|
+
onClick: () => m(g.id),
|
|
705
|
+
onKeyDown: (h) => b(g.id, h),
|
|
698
706
|
children: [
|
|
699
|
-
/* @__PURE__ */
|
|
707
|
+
/* @__PURE__ */ d(
|
|
700
708
|
"span",
|
|
701
709
|
{
|
|
702
|
-
className: `gloss-page-dropdown__dot${
|
|
710
|
+
className: `gloss-page-dropdown__dot${l ? " gloss-page-dropdown__dot--active" : ""}`
|
|
703
711
|
}
|
|
704
712
|
),
|
|
705
|
-
/* @__PURE__ */
|
|
706
|
-
"
|
|
713
|
+
/* @__PURE__ */ d(
|
|
714
|
+
"span",
|
|
707
715
|
{
|
|
708
|
-
className: `gloss-page-dropdown__name${
|
|
709
|
-
|
|
710
|
-
children: v.name
|
|
716
|
+
className: `gloss-page-dropdown__name${g.named ? "" : " gloss-page-dropdown__name--unnamed"}`,
|
|
717
|
+
children: g.name
|
|
711
718
|
}
|
|
712
719
|
),
|
|
713
|
-
/* @__PURE__ */
|
|
720
|
+
/* @__PURE__ */ d("span", { className: "gloss-page-dropdown__count", children: g.cardCount })
|
|
714
721
|
]
|
|
715
722
|
},
|
|
716
|
-
|
|
723
|
+
g.id
|
|
717
724
|
);
|
|
718
725
|
}) }),
|
|
719
|
-
/* @__PURE__ */
|
|
720
|
-
/* @__PURE__ */
|
|
726
|
+
/* @__PURE__ */ d("hr", { className: "gloss-page-dropdown__separator" }),
|
|
727
|
+
/* @__PURE__ */ d(
|
|
721
728
|
"button",
|
|
722
729
|
{
|
|
723
730
|
role: "menuitem",
|
|
724
731
|
className: "gloss-page-dropdown__action",
|
|
725
|
-
onClick:
|
|
732
|
+
onClick: D,
|
|
726
733
|
children: "+ New page"
|
|
727
734
|
}
|
|
728
735
|
),
|
|
729
|
-
/* @__PURE__ */
|
|
730
|
-
/* @__PURE__ */
|
|
736
|
+
/* @__PURE__ */ d("hr", { className: "gloss-page-dropdown__separator" }),
|
|
737
|
+
/* @__PURE__ */ d(
|
|
731
738
|
"button",
|
|
732
739
|
{
|
|
733
740
|
role: "menuitem",
|
|
734
741
|
className: "gloss-page-dropdown__action gloss-page-dropdown__action--muted",
|
|
735
|
-
onClick:
|
|
742
|
+
onClick: N,
|
|
736
743
|
children: "Manage pages"
|
|
737
744
|
}
|
|
738
745
|
)
|
|
@@ -748,26 +755,26 @@ const Ge = function({
|
|
|
748
755
|
onPageChange: n,
|
|
749
756
|
onCreatePage: o,
|
|
750
757
|
onManagePages: s,
|
|
751
|
-
maskRadius:
|
|
758
|
+
maskRadius: u = "var(--gloss-radius-md)"
|
|
752
759
|
}) {
|
|
753
|
-
const
|
|
754
|
-
|
|
755
|
-
}, []),
|
|
756
|
-
|
|
757
|
-
}, []),
|
|
760
|
+
const m = F(null), [b, D] = M(!1), N = p(() => {
|
|
761
|
+
D((h) => !h);
|
|
762
|
+
}, []), g = p(() => {
|
|
763
|
+
D(!1);
|
|
764
|
+
}, []), l = a[t]?.id ?? "";
|
|
758
765
|
return /* @__PURE__ */ _(
|
|
759
766
|
"div",
|
|
760
767
|
{
|
|
761
768
|
className: "gloss-page-chip",
|
|
762
|
-
ref:
|
|
769
|
+
ref: m,
|
|
763
770
|
style: { position: "absolute", top: 0, right: 0 },
|
|
764
771
|
"data-page-chip": !0,
|
|
765
772
|
children: [
|
|
766
|
-
/* @__PURE__ */
|
|
773
|
+
/* @__PURE__ */ d(
|
|
767
774
|
"div",
|
|
768
775
|
{
|
|
769
776
|
className: "gloss-page-chip__nuzzle",
|
|
770
|
-
style: { "--_nuzzle-r":
|
|
777
|
+
style: { "--_nuzzle-r": u }
|
|
771
778
|
}
|
|
772
779
|
),
|
|
773
780
|
/* @__PURE__ */ _(
|
|
@@ -775,9 +782,9 @@ const Ge = function({
|
|
|
775
782
|
{
|
|
776
783
|
className: "gloss-page-chip__trigger",
|
|
777
784
|
"aria-haspopup": "menu",
|
|
778
|
-
"aria-expanded":
|
|
785
|
+
"aria-expanded": b,
|
|
779
786
|
"aria-label": `Page ${t + 1} of ${r}. Click to switch pages.`,
|
|
780
|
-
onClick:
|
|
787
|
+
onClick: N,
|
|
781
788
|
children: [
|
|
782
789
|
t + 1,
|
|
783
790
|
" / ",
|
|
@@ -785,14 +792,14 @@ const Ge = function({
|
|
|
785
792
|
]
|
|
786
793
|
}
|
|
787
794
|
),
|
|
788
|
-
/* @__PURE__ */
|
|
795
|
+
/* @__PURE__ */ d(
|
|
789
796
|
ne,
|
|
790
797
|
{
|
|
791
|
-
open:
|
|
792
|
-
onDismiss:
|
|
793
|
-
anchorRef:
|
|
798
|
+
open: b,
|
|
799
|
+
onDismiss: g,
|
|
800
|
+
anchorRef: m,
|
|
794
801
|
pages: a,
|
|
795
|
-
activePageId:
|
|
802
|
+
activePageId: l,
|
|
796
803
|
onPageChange: n,
|
|
797
804
|
onCreatePage: o,
|
|
798
805
|
onManagePages: s
|
|
@@ -1599,14 +1606,14 @@ function Ye(e) {
|
|
|
1599
1606
|
}
|
|
1600
1607
|
const qe = function(t) {
|
|
1601
1608
|
if (t.renderMode === "discrete")
|
|
1602
|
-
return /* @__PURE__ */
|
|
1609
|
+
return /* @__PURE__ */ d(
|
|
1603
1610
|
"div",
|
|
1604
1611
|
{
|
|
1605
1612
|
className: "gloss-metric-group gloss-metric-group--discrete",
|
|
1606
1613
|
style: { display: "contents" },
|
|
1607
1614
|
children: t.cards.map((n) => {
|
|
1608
1615
|
const o = Y(n.size);
|
|
1609
|
-
return /* @__PURE__ */
|
|
1616
|
+
return /* @__PURE__ */ d(
|
|
1610
1617
|
"div",
|
|
1611
1618
|
{
|
|
1612
1619
|
className: "gloss-metric-group__slot",
|
|
@@ -1641,7 +1648,7 @@ const qe = function(t) {
|
|
|
1641
1648
|
"aria-label": a?.label,
|
|
1642
1649
|
tabIndex: void 0,
|
|
1643
1650
|
children: [
|
|
1644
|
-
a?.accentColor && /* @__PURE__ */
|
|
1651
|
+
a?.accentColor && /* @__PURE__ */ d(
|
|
1645
1652
|
"div",
|
|
1646
1653
|
{
|
|
1647
1654
|
className: "gloss-metric-group__accent",
|
|
@@ -1649,8 +1656,8 @@ const qe = function(t) {
|
|
|
1649
1656
|
}
|
|
1650
1657
|
),
|
|
1651
1658
|
a?.label && /* @__PURE__ */ _("div", { className: "gloss-metric-group__label", children: [
|
|
1652
|
-
/* @__PURE__ */
|
|
1653
|
-
a?.trend && /* @__PURE__ */
|
|
1659
|
+
/* @__PURE__ */ d("span", { children: a.label }),
|
|
1660
|
+
a?.trend && /* @__PURE__ */ d(
|
|
1654
1661
|
"span",
|
|
1655
1662
|
{
|
|
1656
1663
|
className: "gloss-metric-group__trend",
|
|
@@ -1659,7 +1666,7 @@ const qe = function(t) {
|
|
|
1659
1666
|
}
|
|
1660
1667
|
)
|
|
1661
1668
|
] }),
|
|
1662
|
-
/* @__PURE__ */
|
|
1669
|
+
/* @__PURE__ */ d(
|
|
1663
1670
|
"div",
|
|
1664
1671
|
{
|
|
1665
1672
|
className: "gloss-metric-group__slots",
|
|
@@ -1670,7 +1677,7 @@ const qe = function(t) {
|
|
|
1670
1677
|
},
|
|
1671
1678
|
children: r.map((n) => {
|
|
1672
1679
|
const o = Y(n.size);
|
|
1673
|
-
return /* @__PURE__ */
|
|
1680
|
+
return /* @__PURE__ */ d(
|
|
1674
1681
|
"div",
|
|
1675
1682
|
{
|
|
1676
1683
|
className: "gloss-metric-group__slot--composite",
|
|
@@ -1705,7 +1712,7 @@ function Ve({
|
|
|
1705
1712
|
anchorEl: a,
|
|
1706
1713
|
anchorSelector: n
|
|
1707
1714
|
}) {
|
|
1708
|
-
const [o, s] = R.useState(null),
|
|
1715
|
+
const [o, s] = R.useState(null), u = R.useMemo(
|
|
1709
1716
|
() => typeof window < "u" && window.matchMedia ? window.matchMedia("(prefers-reduced-motion: reduce)").matches : !1,
|
|
1710
1717
|
[]
|
|
1711
1718
|
);
|
|
@@ -1714,28 +1721,28 @@ function Ve({
|
|
|
1714
1721
|
"[InlineNudge] requires anchorEl or anchorSelector. AP-07: Do not mount InlineNudge in Layout/** or _app.tsx."
|
|
1715
1722
|
);
|
|
1716
1723
|
}, [a, n]), R.useLayoutEffect(() => {
|
|
1717
|
-
let
|
|
1718
|
-
if (a ?
|
|
1719
|
-
const
|
|
1724
|
+
let b = null;
|
|
1725
|
+
if (a ? b = a : n && (b = document.querySelector(n)), b) {
|
|
1726
|
+
const D = b.getBoundingClientRect();
|
|
1720
1727
|
s({
|
|
1721
|
-
top:
|
|
1722
|
-
left:
|
|
1728
|
+
top: D.bottom + window.scrollY + 6,
|
|
1729
|
+
left: D.left + window.scrollX
|
|
1723
1730
|
});
|
|
1724
1731
|
}
|
|
1725
1732
|
}, [a, n]);
|
|
1726
|
-
const
|
|
1733
|
+
const m = o ? { top: o.top, left: o.left } : {};
|
|
1727
1734
|
return /* @__PURE__ */ _(
|
|
1728
1735
|
"div",
|
|
1729
1736
|
{
|
|
1730
1737
|
className: L["gloss-inline-nudge"],
|
|
1731
|
-
style:
|
|
1738
|
+
style: m,
|
|
1732
1739
|
role: "status",
|
|
1733
1740
|
"aria-live": "polite",
|
|
1734
|
-
"data-reduced-motion":
|
|
1741
|
+
"data-reduced-motion": u ? "true" : void 0,
|
|
1735
1742
|
children: [
|
|
1736
|
-
/* @__PURE__ */
|
|
1743
|
+
/* @__PURE__ */ d("span", { className: L["gloss-inline-nudge__message"], children: e }),
|
|
1737
1744
|
/* @__PURE__ */ _("div", { className: L["gloss-inline-nudge__actions"], children: [
|
|
1738
|
-
/* @__PURE__ */
|
|
1745
|
+
/* @__PURE__ */ d(
|
|
1739
1746
|
"button",
|
|
1740
1747
|
{
|
|
1741
1748
|
type: "button",
|
|
@@ -1744,7 +1751,7 @@ function Ve({
|
|
|
1744
1751
|
children: t.label
|
|
1745
1752
|
}
|
|
1746
1753
|
),
|
|
1747
|
-
/* @__PURE__ */
|
|
1754
|
+
/* @__PURE__ */ d(
|
|
1748
1755
|
"button",
|
|
1749
1756
|
{
|
|
1750
1757
|
type: "button",
|
|
@@ -1764,9 +1771,9 @@ function le(e) {
|
|
|
1764
1771
|
return e.colorToken ? `var(--gloss-color-${e.colorToken}, ${e.color ?? "#888"})` : e.color ?? "#888";
|
|
1765
1772
|
}
|
|
1766
1773
|
function Ue(e, t, r) {
|
|
1767
|
-
const a = r - t || 1, o = [...e].sort((s,
|
|
1768
|
-
const
|
|
1769
|
-
return `${le(s)} ${
|
|
1774
|
+
const a = r - t || 1, o = [...e].sort((s, u) => s.value - u.value).map((s) => {
|
|
1775
|
+
const u = (s.value - t) / a * 100;
|
|
1776
|
+
return `${le(s)} ${u.toFixed(2)}%`;
|
|
1770
1777
|
});
|
|
1771
1778
|
return o.length === 0 ? "linear-gradient(to right, #888 0%, #888 100%)" : o.length === 1 ? `linear-gradient(to right, ${o[0]}, ${o[0]})` : `linear-gradient(to right, ${o.join(", ")})`;
|
|
1772
1779
|
}
|
|
@@ -1777,62 +1784,62 @@ function je({
|
|
|
1777
1784
|
max: a = 100,
|
|
1778
1785
|
disabled: n = !1
|
|
1779
1786
|
}) {
|
|
1780
|
-
const o = F(null), [s,
|
|
1781
|
-
|
|
1782
|
-
const
|
|
1787
|
+
const o = F(null), [s, u] = M(null), [m, b] = M(e), D = F(e);
|
|
1788
|
+
D.current !== e && (D.current = e, b(e));
|
|
1789
|
+
const N = Ce(() => Ue(m, r, a), [m, r, a]), g = p(
|
|
1783
1790
|
(i) => {
|
|
1784
1791
|
if (!o.current) return r;
|
|
1785
|
-
const
|
|
1786
|
-
return Math.round(
|
|
1792
|
+
const f = o.current.getBoundingClientRect(), w = Math.max(0, Math.min(1, (i - f.left) / f.width)), v = r + w * (a - r);
|
|
1793
|
+
return Math.round(v * 100) / 100;
|
|
1787
1794
|
},
|
|
1788
1795
|
[r, a]
|
|
1789
|
-
),
|
|
1790
|
-
(i,
|
|
1791
|
-
const
|
|
1792
|
-
n ||
|
|
1796
|
+
), l = p(
|
|
1797
|
+
(i, f) => {
|
|
1798
|
+
const w = m.find((v) => v.id === f);
|
|
1799
|
+
n || w?.disabled || (typeof i.currentTarget.setPointerCapture == "function" && i.currentTarget.setPointerCapture(i.pointerId), u(f));
|
|
1793
1800
|
},
|
|
1794
|
-
[n,
|
|
1795
|
-
),
|
|
1801
|
+
[n, m]
|
|
1802
|
+
), h = p(
|
|
1796
1803
|
(i) => {
|
|
1797
1804
|
if (!s) return;
|
|
1798
|
-
const
|
|
1799
|
-
|
|
1800
|
-
(
|
|
1805
|
+
const f = g(i.clientX);
|
|
1806
|
+
b(
|
|
1807
|
+
(w) => w.map((v) => v.id === s ? { ...v, value: f } : v)
|
|
1801
1808
|
);
|
|
1802
1809
|
},
|
|
1803
|
-
[s,
|
|
1804
|
-
), S =
|
|
1810
|
+
[s, g]
|
|
1811
|
+
), S = p(
|
|
1805
1812
|
(i) => {
|
|
1806
1813
|
if (!s) return;
|
|
1807
|
-
const
|
|
1808
|
-
(
|
|
1814
|
+
const f = g(i.clientX), w = m.map(
|
|
1815
|
+
(v) => v.id === s ? { ...v, value: f } : v
|
|
1809
1816
|
);
|
|
1810
|
-
|
|
1817
|
+
b(w), u(null), t(w);
|
|
1811
1818
|
},
|
|
1812
|
-
[s,
|
|
1819
|
+
[s, g, m, t]
|
|
1813
1820
|
), x = a - r || 1;
|
|
1814
|
-
return /* @__PURE__ */
|
|
1821
|
+
return /* @__PURE__ */ d("div", { className: "gloss-threshold-ramp", "data-disabled": n || void 0, children: /* @__PURE__ */ d(
|
|
1815
1822
|
"div",
|
|
1816
1823
|
{
|
|
1817
1824
|
ref: o,
|
|
1818
1825
|
className: "gloss-threshold-ramp__track",
|
|
1819
|
-
style: { background:
|
|
1820
|
-
onPointerMove:
|
|
1826
|
+
style: { background: N },
|
|
1827
|
+
onPointerMove: h,
|
|
1821
1828
|
onPointerUp: S,
|
|
1822
1829
|
onPointerLeave: S,
|
|
1823
|
-
children:
|
|
1824
|
-
const
|
|
1825
|
-
return /* @__PURE__ */
|
|
1830
|
+
children: m.map((i) => {
|
|
1831
|
+
const f = (i.value - r) / x * 100;
|
|
1832
|
+
return /* @__PURE__ */ d(
|
|
1826
1833
|
"span",
|
|
1827
1834
|
{
|
|
1828
1835
|
className: "gloss-threshold-ramp__stop",
|
|
1829
1836
|
style: {
|
|
1830
|
-
left: `${
|
|
1837
|
+
left: `${f}%`,
|
|
1831
1838
|
color: le(i)
|
|
1832
1839
|
},
|
|
1833
1840
|
"data-disabled": i.disabled || void 0,
|
|
1834
1841
|
"data-dragging": s === i.id || void 0,
|
|
1835
|
-
onPointerDown: (
|
|
1842
|
+
onPointerDown: (w) => l(w, i.id),
|
|
1836
1843
|
"aria-label": i.label ?? `Stop at ${i.value}`,
|
|
1837
1844
|
role: "slider",
|
|
1838
1845
|
"aria-valuenow": i.value,
|
|
@@ -1852,10 +1859,10 @@ function Qe() {
|
|
|
1852
1859
|
return De(de);
|
|
1853
1860
|
}
|
|
1854
1861
|
function Xe({ option: e }) {
|
|
1855
|
-
const t = Qe(), r = t?.isSelected(e.value) ?? !1, a = e.disabled || t?.groupDisabled, n =
|
|
1862
|
+
const t = Qe(), r = t?.isSelected(e.value) ?? !1, a = e.disabled || t?.groupDisabled, n = p(() => {
|
|
1856
1863
|
a || t?.select(e.value);
|
|
1857
1864
|
}, [a, t, e.value]), o = e.colorToken ? `var(--gloss-color-${e.colorToken}, ${e.color ?? "#888"})` : e.color ?? "#888";
|
|
1858
|
-
return /* @__PURE__ */
|
|
1865
|
+
return /* @__PURE__ */ d(
|
|
1859
1866
|
"button",
|
|
1860
1867
|
{
|
|
1861
1868
|
type: "button",
|
|
@@ -1880,22 +1887,22 @@ function Je({
|
|
|
1880
1887
|
disabled: n = !1,
|
|
1881
1888
|
name: o
|
|
1882
1889
|
}) {
|
|
1883
|
-
const s = t !== void 0, [
|
|
1884
|
-
(
|
|
1885
|
-
s ||
|
|
1890
|
+
const s = t !== void 0, [u, m] = M(r), b = s ? t : u, D = p(
|
|
1891
|
+
(l) => {
|
|
1892
|
+
s || m(l), a?.(l);
|
|
1886
1893
|
},
|
|
1887
1894
|
[s, a]
|
|
1888
|
-
),
|
|
1889
|
-
(
|
|
1890
|
-
[
|
|
1891
|
-
),
|
|
1892
|
-
selectedValue:
|
|
1893
|
-
select:
|
|
1894
|
-
isSelected:
|
|
1895
|
+
), N = p(
|
|
1896
|
+
(l) => b === l,
|
|
1897
|
+
[b]
|
|
1898
|
+
), g = {
|
|
1899
|
+
selectedValue: b,
|
|
1900
|
+
select: D,
|
|
1901
|
+
isSelected: N,
|
|
1895
1902
|
groupDisabled: n,
|
|
1896
1903
|
name: o
|
|
1897
1904
|
};
|
|
1898
|
-
return /* @__PURE__ */
|
|
1905
|
+
return /* @__PURE__ */ d(de.Provider, { value: g, children: /* @__PURE__ */ d(
|
|
1899
1906
|
"div",
|
|
1900
1907
|
{
|
|
1901
1908
|
className: "gloss-preset-swatch-row",
|
|
@@ -1903,7 +1910,7 @@ function Je({
|
|
|
1903
1910
|
"aria-label": o,
|
|
1904
1911
|
"aria-disabled": n,
|
|
1905
1912
|
"data-disabled": n || void 0,
|
|
1906
|
-
children: e.map((
|
|
1913
|
+
children: e.map((l) => /* @__PURE__ */ d(Xe, { option: l }, l.value))
|
|
1907
1914
|
}
|
|
1908
1915
|
) });
|
|
1909
1916
|
}
|
|
@@ -1923,82 +1930,82 @@ function et(e, t, r) {
|
|
|
1923
1930
|
return a.splice(r, 0, n), a;
|
|
1924
1931
|
}
|
|
1925
1932
|
function tt(e) {
|
|
1926
|
-
const [t, r] = M(() => e.zones), [a, n] = M(null), [o, s] = M(null),
|
|
1927
|
-
|
|
1928
|
-
const
|
|
1929
|
-
(
|
|
1930
|
-
const S =
|
|
1933
|
+
const [t, r] = M(() => e.zones), [a, n] = M(null), [o, s] = M(null), u = F(null), m = F(e.onZoneChange);
|
|
1934
|
+
m.current = e.onZoneChange;
|
|
1935
|
+
const b = p(
|
|
1936
|
+
(h) => {
|
|
1937
|
+
const S = h.active.id;
|
|
1931
1938
|
let x = null, i = null;
|
|
1932
|
-
for (const
|
|
1933
|
-
const
|
|
1934
|
-
if (
|
|
1935
|
-
x =
|
|
1939
|
+
for (const f of t) {
|
|
1940
|
+
const w = f.items.find((v) => v.id === S);
|
|
1941
|
+
if (w) {
|
|
1942
|
+
x = w, i = f.zoneKey;
|
|
1936
1943
|
break;
|
|
1937
1944
|
}
|
|
1938
1945
|
}
|
|
1939
|
-
|
|
1946
|
+
u.current = i, n(x), s(i);
|
|
1940
1947
|
},
|
|
1941
1948
|
[t]
|
|
1942
|
-
),
|
|
1943
|
-
(
|
|
1944
|
-
if (!
|
|
1945
|
-
s(
|
|
1949
|
+
), D = p(
|
|
1950
|
+
(h) => {
|
|
1951
|
+
if (!h.over) {
|
|
1952
|
+
s(u.current);
|
|
1946
1953
|
return;
|
|
1947
1954
|
}
|
|
1948
|
-
const S = re(t,
|
|
1955
|
+
const S = re(t, h.over.id);
|
|
1949
1956
|
s(S);
|
|
1950
1957
|
},
|
|
1951
1958
|
[t]
|
|
1952
|
-
),
|
|
1953
|
-
(
|
|
1954
|
-
const { active: S, over: x } =
|
|
1955
|
-
|
|
1959
|
+
), N = p(
|
|
1960
|
+
(h) => {
|
|
1961
|
+
const { active: S, over: x } = h, i = () => {
|
|
1962
|
+
u.current = null, n(null), s(null);
|
|
1956
1963
|
};
|
|
1957
1964
|
if (!x) {
|
|
1958
1965
|
i();
|
|
1959
1966
|
return;
|
|
1960
1967
|
}
|
|
1961
|
-
const
|
|
1962
|
-
if (!
|
|
1968
|
+
const f = q(t, S.id), w = re(t, x.id);
|
|
1969
|
+
if (!f || !w) {
|
|
1963
1970
|
i();
|
|
1964
1971
|
return;
|
|
1965
1972
|
}
|
|
1966
|
-
let
|
|
1967
|
-
if (
|
|
1968
|
-
const k =
|
|
1969
|
-
|
|
1970
|
-
...
|
|
1971
|
-
items: et(
|
|
1973
|
+
let v = t.map((k) => ({ ...k, items: [...k.items] }));
|
|
1974
|
+
if (f === w) {
|
|
1975
|
+
const k = v.findIndex((T) => T.zoneKey === f), c = v[k], y = c.items.findIndex((T) => T.id === S.id), C = c.items.findIndex((T) => T.id === x.id), O = C >= 0 ? C : c.items.length - 1;
|
|
1976
|
+
v[k] = {
|
|
1977
|
+
...c,
|
|
1978
|
+
items: et(c.items, y, O)
|
|
1972
1979
|
};
|
|
1973
1980
|
} else {
|
|
1974
|
-
const k =
|
|
1975
|
-
let X = T, A = [...
|
|
1976
|
-
if (
|
|
1981
|
+
const k = v.findIndex((I) => I.zoneKey === f), c = v.findIndex((I) => I.zoneKey === w), y = v[k], C = v[c], O = y.items.find((I) => I.id === S.id), T = y.items.filter((I) => I.id !== S.id), E = C.items.findIndex((I) => I.id === x.id), B = E >= 0 ? E : C.items.length;
|
|
1982
|
+
let X = T, A = [...C.items];
|
|
1983
|
+
if (C.maxItems !== void 0 && A.length >= C.maxItems) {
|
|
1977
1984
|
const I = A[A.length - 1];
|
|
1978
|
-
A = A.slice(0,
|
|
1985
|
+
A = A.slice(0, C.maxItems - 1), X = [...T, I];
|
|
1979
1986
|
}
|
|
1980
1987
|
const J = Math.min(B, A.length), fe = [
|
|
1981
1988
|
...A.slice(0, J),
|
|
1982
1989
|
O,
|
|
1983
1990
|
...A.slice(J)
|
|
1984
1991
|
];
|
|
1985
|
-
|
|
1992
|
+
v[k] = { ...y, items: X }, v[c] = { ...C, items: fe };
|
|
1986
1993
|
}
|
|
1987
|
-
r(
|
|
1994
|
+
r(v), m.current?.(v), i();
|
|
1988
1995
|
},
|
|
1989
1996
|
[t]
|
|
1990
|
-
),
|
|
1991
|
-
(
|
|
1992
|
-
id:
|
|
1993
|
-
"data-zone-key":
|
|
1997
|
+
), g = p(
|
|
1998
|
+
(h) => ({
|
|
1999
|
+
id: h,
|
|
2000
|
+
"data-zone-key": h
|
|
1994
2001
|
}),
|
|
1995
2002
|
[]
|
|
1996
|
-
),
|
|
1997
|
-
(
|
|
1998
|
-
const S = q(t,
|
|
2003
|
+
), l = p(
|
|
2004
|
+
(h) => {
|
|
2005
|
+
const S = q(t, h.id) ?? "";
|
|
1999
2006
|
return {
|
|
2000
|
-
id:
|
|
2001
|
-
"data-item-id":
|
|
2007
|
+
id: h.id,
|
|
2008
|
+
"data-item-id": h.id,
|
|
2002
2009
|
"data-zone-key": S
|
|
2003
2010
|
};
|
|
2004
2011
|
},
|
|
@@ -2008,11 +2015,11 @@ function tt(e) {
|
|
|
2008
2015
|
zones: t,
|
|
2009
2016
|
activeZone: o,
|
|
2010
2017
|
activeItem: a,
|
|
2011
|
-
getZoneProps:
|
|
2012
|
-
getItemProps:
|
|
2013
|
-
handleDragStart:
|
|
2014
|
-
handleDragOver:
|
|
2015
|
-
handleDragEnd:
|
|
2018
|
+
getZoneProps: g,
|
|
2019
|
+
getItemProps: l,
|
|
2020
|
+
handleDragStart: b,
|
|
2021
|
+
handleDragOver: D,
|
|
2022
|
+
handleDragEnd: N
|
|
2016
2023
|
};
|
|
2017
2024
|
}
|
|
2018
2025
|
let j = null, ce = null, ue = null, V = null, me = null, ge = null, pe = null, Q = null, be = null;
|
|
@@ -2028,7 +2035,7 @@ try {
|
|
|
2028
2035
|
}
|
|
2029
2036
|
function at(e) {
|
|
2030
2037
|
const { zones: t, onZoneChange: r, renderZone: a, renderItem: n, renderDragOverlay: o } = e, s = tt({ zones: t, onZoneChange: r });
|
|
2031
|
-
return !j || !Q ? /* @__PURE__ */
|
|
2038
|
+
return !j || !Q ? /* @__PURE__ */ d("div", { "data-sortable-zones-passive": "true", children: s.zones.map((u) => /* @__PURE__ */ d("div", { ...s.getZoneProps(u.zoneKey), children: a(u.zoneKey, u.items) }, u.zoneKey)) }) : /* @__PURE__ */ d(
|
|
2032
2039
|
he,
|
|
2033
2040
|
{
|
|
2034
2041
|
state: s,
|
|
@@ -2048,7 +2055,7 @@ function he({
|
|
|
2048
2055
|
const n = ue(
|
|
2049
2056
|
V(me, { activationConstraint: { distance: 5 } }),
|
|
2050
2057
|
V(ge)
|
|
2051
|
-
), o = j, s = ce,
|
|
2058
|
+
), o = j, s = ce, u = Q;
|
|
2052
2059
|
return /* @__PURE__ */ _(
|
|
2053
2060
|
o,
|
|
2054
2061
|
{
|
|
@@ -2058,18 +2065,18 @@ function he({
|
|
|
2058
2065
|
onDragOver: e.handleDragOver,
|
|
2059
2066
|
onDragEnd: e.handleDragEnd,
|
|
2060
2067
|
children: [
|
|
2061
|
-
e.zones.map((
|
|
2062
|
-
const
|
|
2063
|
-
return /* @__PURE__ */
|
|
2064
|
-
|
|
2068
|
+
e.zones.map((m) => {
|
|
2069
|
+
const b = m.items.map((D) => D.id);
|
|
2070
|
+
return /* @__PURE__ */ d("div", { ...e.getZoneProps(m.zoneKey), children: /* @__PURE__ */ d(
|
|
2071
|
+
u,
|
|
2065
2072
|
{
|
|
2066
|
-
items:
|
|
2073
|
+
items: b,
|
|
2067
2074
|
strategy: be,
|
|
2068
|
-
children: t(
|
|
2075
|
+
children: t(m.zoneKey, m.items)
|
|
2069
2076
|
}
|
|
2070
|
-
) },
|
|
2077
|
+
) }, m.zoneKey);
|
|
2071
2078
|
}),
|
|
2072
|
-
/* @__PURE__ */
|
|
2079
|
+
/* @__PURE__ */ d(s, { children: e.activeItem ? a?.(e.activeItem) ?? r(e.activeItem) : null })
|
|
2073
2080
|
]
|
|
2074
2081
|
}
|
|
2075
2082
|
);
|
|
@@ -2077,21 +2084,21 @@ function he({
|
|
|
2077
2084
|
he.displayName = "SortableZonesInner";
|
|
2078
2085
|
const rt = R.forwardRef(({ density: e = "compact", children: t, ...r }, a) => {
|
|
2079
2086
|
const n = { ...r };
|
|
2080
|
-
return delete n.className, delete n.style, /* @__PURE__ */
|
|
2087
|
+
return delete n.className, delete n.style, /* @__PURE__ */ d("div", { ref: a, className: "gloss-container-toolbar", role: "toolbar", ...n, children: /* @__PURE__ */ d(U, { region: "toolbar", density: e, children: t }) });
|
|
2081
2088
|
});
|
|
2082
2089
|
rt.displayName = "ContainerToolbar";
|
|
2083
2090
|
const nt = R.forwardRef(({ legend: e, description: t, density: r = "default", children: a, ...n }, o) => {
|
|
2084
2091
|
const s = { ...n };
|
|
2085
2092
|
return delete s.className, delete s.style, /* @__PURE__ */ _("fieldset", { ref: o, className: "gloss-container-form-section", ...s, children: [
|
|
2086
|
-
e && /* @__PURE__ */
|
|
2087
|
-
t && /* @__PURE__ */
|
|
2088
|
-
/* @__PURE__ */
|
|
2093
|
+
e && /* @__PURE__ */ d("legend", { className: "gloss-container-form-section__legend", children: e }),
|
|
2094
|
+
t && /* @__PURE__ */ d("p", { className: "gloss-container-form-section__description", children: t }),
|
|
2095
|
+
/* @__PURE__ */ d(U, { region: "form-section", density: r, children: a })
|
|
2089
2096
|
] });
|
|
2090
2097
|
});
|
|
2091
2098
|
nt.displayName = "ContainerFormSection";
|
|
2092
2099
|
const ot = R.forwardRef(({ density: e = "compact", children: t, ...r }, a) => {
|
|
2093
2100
|
const n = { ...r };
|
|
2094
|
-
return delete n.className, delete n.style, /* @__PURE__ */
|
|
2101
|
+
return delete n.className, delete n.style, /* @__PURE__ */ d("div", { ref: a, className: "gloss-container-table", ...n, children: /* @__PURE__ */ d(U, { region: "table", density: e, children: t }) });
|
|
2095
2102
|
});
|
|
2096
2103
|
ot.displayName = "ContainerTable";
|
|
2097
2104
|
export {
|