@mt-gloss/ui 0.1.78 → 0.1.80
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/index.js +105 -87
- package/package.json +1 -1
- package/ui.css +1 -1
package/index.js
CHANGED
|
@@ -41,7 +41,7 @@ function nn(e) {
|
|
|
41
41
|
n === void 0 && f(p), a?.(p);
|
|
42
42
|
},
|
|
43
43
|
[n, a]
|
|
44
|
-
), w = _(() => t.map((p, b) => ({ item: p, index: b })).filter(({ item: p, index: b }) => !l?.(p, b)).map(({ index: p }) => p), [t, l]),
|
|
44
|
+
), w = _(() => t.map((p, b) => ({ item: p, index: b })).filter(({ item: p, index: b }) => !l?.(p, b)).map(({ index: p }) => p), [t, l]), N = _(
|
|
45
45
|
(p, b) => {
|
|
46
46
|
const y = w();
|
|
47
47
|
if (y.length === 0) return -1;
|
|
@@ -55,23 +55,23 @@ function nn(e) {
|
|
|
55
55
|
), h = _(() => {
|
|
56
56
|
const p = w();
|
|
57
57
|
p.length > 0 && g(p[0]);
|
|
58
|
-
}, [w, g]),
|
|
58
|
+
}, [w, g]), S = _(() => {
|
|
59
59
|
const p = w();
|
|
60
60
|
p.length > 0 && g(p[p.length - 1]);
|
|
61
61
|
}, [w, g]), M = _(() => {
|
|
62
|
-
const p =
|
|
62
|
+
const p = N(d, 1);
|
|
63
63
|
p !== -1 && g(p);
|
|
64
|
-
}, [d,
|
|
65
|
-
const p =
|
|
64
|
+
}, [d, N, g]), C = _(() => {
|
|
65
|
+
const p = N(d, -1);
|
|
66
66
|
p !== -1 && g(p);
|
|
67
|
-
}, [d,
|
|
67
|
+
}, [d, N, g]), k = _(() => {
|
|
68
68
|
g(-1);
|
|
69
69
|
}, [g]), R = _(
|
|
70
70
|
(p) => {
|
|
71
71
|
if (!o) return;
|
|
72
72
|
const { key: b } = p, y = b === "ArrowUp" && (s === "vertical" || s === "both"), D = b === "ArrowDown" && (s === "vertical" || s === "both"), T = b === "ArrowLeft" && (s === "horizontal" || s === "both"), x = b === "ArrowRight" && (s === "horizontal" || s === "both");
|
|
73
73
|
if (y || T) {
|
|
74
|
-
p.preventDefault(), d === -1 ?
|
|
74
|
+
p.preventDefault(), d === -1 ? S() : C();
|
|
75
75
|
return;
|
|
76
76
|
}
|
|
77
77
|
if (D || x) {
|
|
@@ -83,7 +83,7 @@ function nn(e) {
|
|
|
83
83
|
return;
|
|
84
84
|
}
|
|
85
85
|
if (b === "End") {
|
|
86
|
-
p.preventDefault(),
|
|
86
|
+
p.preventDefault(), S();
|
|
87
87
|
return;
|
|
88
88
|
}
|
|
89
89
|
if ((b === "Enter" || b === " ") && d >= 0 && d < t.length) {
|
|
@@ -103,7 +103,7 @@ function nn(e) {
|
|
|
103
103
|
d,
|
|
104
104
|
t,
|
|
105
105
|
h,
|
|
106
|
-
|
|
106
|
+
S,
|
|
107
107
|
M,
|
|
108
108
|
C,
|
|
109
109
|
l,
|
|
@@ -116,7 +116,7 @@ function nn(e) {
|
|
|
116
116
|
setFocusedIndex: g,
|
|
117
117
|
handleKeyDown: R,
|
|
118
118
|
focusFirst: h,
|
|
119
|
-
focusLast:
|
|
119
|
+
focusLast: S,
|
|
120
120
|
focusNext: M,
|
|
121
121
|
focusPrevious: C,
|
|
122
122
|
resetFocus: k
|
|
@@ -521,6 +521,16 @@ function Ee(e) {
|
|
|
521
521
|
// D-09 — uniform blue. NO conditional based on grow vs shrink.
|
|
522
522
|
// STOP CONDITION: do not branch this on direction.
|
|
523
523
|
width: o,
|
|
524
|
+
// Geometry — ghost is anchored at the host's TOP-LEFT and spans the
|
|
525
|
+
// host's full height (per resize-pill-prototype.jsx line 382:
|
|
526
|
+
// left: 0, top: 0, width: spanToWidth(previewASpan), height: '100%').
|
|
527
|
+
// Required because the SCSS rule only sets `position: absolute` + z;
|
|
528
|
+
// without explicit top/left/height, motion/react falls back to natural
|
|
529
|
+
// flow (which placed the ghost below the card with 0 height —
|
|
530
|
+
// observed 2026-05-10 PM as "single dashed line below card").
|
|
531
|
+
top: 0,
|
|
532
|
+
left: 0,
|
|
533
|
+
height: "100%",
|
|
524
534
|
borderStyle: "dashed",
|
|
525
535
|
borderWidth: 2,
|
|
526
536
|
borderColor: "rgba(53, 122, 232, 0.5)",
|
|
@@ -547,7 +557,7 @@ function Ae(e) {
|
|
|
547
557
|
staggerMs: u
|
|
548
558
|
} = e;
|
|
549
559
|
if (!t) return null;
|
|
550
|
-
const c = s + a,
|
|
560
|
+
const c = n === "grow", m = c ? s + a : s + i, f = c ? o - i : o - a, d = Math.max(0, f - m);
|
|
551
561
|
return /* @__PURE__ */ r(
|
|
552
562
|
"div",
|
|
553
563
|
{
|
|
@@ -556,10 +566,18 @@ function Ae(e) {
|
|
|
556
566
|
"data-resize-pill-chain-direction": n,
|
|
557
567
|
className: "gloss-resize-pill-chain",
|
|
558
568
|
style: {
|
|
559
|
-
|
|
560
|
-
|
|
569
|
+
// Match prototype line 384: top:0, height:'100%', display:flex,
|
|
570
|
+
// alignItems:'center'. Without explicit top/height the chain falls
|
|
571
|
+
// to natural flow (below the card). SCSS already provides
|
|
572
|
+
// display:flex + justify-content:space-between; alignItems:center is
|
|
573
|
+
// set here so chevrons land at the host's vertical midline.
|
|
574
|
+
top: 0,
|
|
575
|
+
height: "100%",
|
|
576
|
+
alignItems: "center",
|
|
577
|
+
left: m,
|
|
578
|
+
width: d
|
|
561
579
|
},
|
|
562
|
-
children: (n === "grow" ? [0, 1, 2, 3, 4] : [4, 3, 2, 1, 0]).map((
|
|
580
|
+
children: (n === "grow" ? [0, 1, 2, 3, 4] : [4, 3, 2, 1, 0]).map((w, N) => /* @__PURE__ */ r(
|
|
563
581
|
G.span,
|
|
564
582
|
{
|
|
565
583
|
className: [
|
|
@@ -574,11 +592,11 @@ function Ae(e) {
|
|
|
574
592
|
duration: l / 1e3,
|
|
575
593
|
repeat: 1 / 0,
|
|
576
594
|
ease: "easeInOut",
|
|
577
|
-
delay:
|
|
595
|
+
delay: w * u / 1e3
|
|
578
596
|
},
|
|
579
597
|
children: "›"
|
|
580
598
|
},
|
|
581
|
-
|
|
599
|
+
N
|
|
582
600
|
))
|
|
583
601
|
}
|
|
584
602
|
);
|
|
@@ -853,11 +871,11 @@ function fn(e) {
|
|
|
853
871
|
}, [e.forceIdle]), A(() => () => {
|
|
854
872
|
c.current && clearTimeout(c.current), m.current && clearTimeout(m.current);
|
|
855
873
|
}, []);
|
|
856
|
-
const
|
|
874
|
+
const N = _(() => {
|
|
857
875
|
u.current || g.current || (s(f.current), a("pill-visible"));
|
|
858
876
|
}, []), h = _(() => {
|
|
859
877
|
a("idle"), l(null);
|
|
860
|
-
}, []),
|
|
878
|
+
}, []), S = _(
|
|
861
879
|
(x) => {
|
|
862
880
|
u.current = !0, c.current && clearTimeout(c.current), c.current = setTimeout(() => {
|
|
863
881
|
u.current = !1, c.current = null;
|
|
@@ -865,8 +883,8 @@ function fn(e) {
|
|
|
865
883
|
},
|
|
866
884
|
[t.fadeGraceMs]
|
|
867
885
|
), M = _(() => {
|
|
868
|
-
m.current && (clearTimeout(m.current), m.current = null),
|
|
869
|
-
}, [
|
|
886
|
+
m.current && (clearTimeout(m.current), m.current = null), N();
|
|
887
|
+
}, [N]), C = _(() => {
|
|
870
888
|
m.current && clearTimeout(m.current), m.current = setTimeout(() => {
|
|
871
889
|
h(), m.current = null;
|
|
872
890
|
}, t.hoverHideGraceMs);
|
|
@@ -884,9 +902,9 @@ function fn(e) {
|
|
|
884
902
|
l(null), a((x) => x === "pre-commit" ? "pill-visible" : x);
|
|
885
903
|
}, []), y = _(
|
|
886
904
|
(x) => {
|
|
887
|
-
|
|
905
|
+
S(x);
|
|
888
906
|
},
|
|
889
|
-
[
|
|
907
|
+
[S]
|
|
890
908
|
);
|
|
891
909
|
let D = null;
|
|
892
910
|
return o !== null && (o === "compact" || o === "medium" || o === "full" ? (D = o, D === e.currentTarget && (D = null)) : o === "grow" && typeof e.currentTarget == "number" ? D = e.currentTarget + 1 : o === "shrink" && typeof e.currentTarget == "number" && (D = e.currentTarget - 1)), {
|
|
@@ -904,7 +922,7 @@ function fn(e) {
|
|
|
904
922
|
onButtonLeave: b,
|
|
905
923
|
onButtonClick: y
|
|
906
924
|
},
|
|
907
|
-
commit:
|
|
925
|
+
commit: S
|
|
908
926
|
};
|
|
909
927
|
}
|
|
910
928
|
function bn(e) {
|
|
@@ -1290,10 +1308,10 @@ const Et = function({
|
|
|
1290
1308
|
activePage: c
|
|
1291
1309
|
}) {
|
|
1292
1310
|
const m = P(null), [f, d] = E(!1), g = _(() => {
|
|
1293
|
-
d((
|
|
1311
|
+
d((S) => !S);
|
|
1294
1312
|
}, []), w = _(() => {
|
|
1295
1313
|
d(!1);
|
|
1296
|
-
}, []),
|
|
1314
|
+
}, []), N = a[t]?.id ?? "";
|
|
1297
1315
|
return /* @__PURE__ */ v(
|
|
1298
1316
|
"div",
|
|
1299
1317
|
{
|
|
@@ -1334,7 +1352,7 @@ const Et = function({
|
|
|
1334
1352
|
onDismiss: w,
|
|
1335
1353
|
anchorRef: m,
|
|
1336
1354
|
pages: a,
|
|
1337
|
-
activePageId:
|
|
1355
|
+
activePageId: N,
|
|
1338
1356
|
onPageChange: i,
|
|
1339
1357
|
onCreatePage: s,
|
|
1340
1358
|
onManagePages: o
|
|
@@ -2026,27 +2044,27 @@ const Ht = ({
|
|
|
2026
2044
|
const s = P(null), o = P([]), l = Gt(), u = re(() => Array.from(e), [e]);
|
|
2027
2045
|
if (u.length === 0) return null;
|
|
2028
2046
|
const c = a ? `Configure ${a}: choose a dimension` : void 0, m = l ? "10ms" : "200ms", f = (d, g) => {
|
|
2029
|
-
const w = u.length - 1,
|
|
2030
|
-
const
|
|
2031
|
-
|
|
2047
|
+
const w = u.length - 1, N = (h) => {
|
|
2048
|
+
const S = o.current[h];
|
|
2049
|
+
S && S.focus();
|
|
2032
2050
|
};
|
|
2033
2051
|
switch (d.key) {
|
|
2034
2052
|
case "ArrowRight":
|
|
2035
2053
|
case "ArrowDown": {
|
|
2036
|
-
d.preventDefault(),
|
|
2054
|
+
d.preventDefault(), N(g === w ? 0 : g + 1);
|
|
2037
2055
|
break;
|
|
2038
2056
|
}
|
|
2039
2057
|
case "ArrowLeft":
|
|
2040
2058
|
case "ArrowUp": {
|
|
2041
|
-
d.preventDefault(),
|
|
2059
|
+
d.preventDefault(), N(g === 0 ? w : g - 1);
|
|
2042
2060
|
break;
|
|
2043
2061
|
}
|
|
2044
2062
|
case "Home": {
|
|
2045
|
-
d.preventDefault(),
|
|
2063
|
+
d.preventDefault(), N(0);
|
|
2046
2064
|
break;
|
|
2047
2065
|
}
|
|
2048
2066
|
case "End": {
|
|
2049
|
-
d.preventDefault(),
|
|
2067
|
+
d.preventDefault(), N(w);
|
|
2050
2068
|
break;
|
|
2051
2069
|
}
|
|
2052
2070
|
case "Enter":
|
|
@@ -2070,7 +2088,7 @@ const Ht = ({
|
|
|
2070
2088
|
"--gloss-reconfig-backside-buttons-transition-duration": m
|
|
2071
2089
|
},
|
|
2072
2090
|
children: u.map((d, g) => {
|
|
2073
|
-
const w = Kt[d],
|
|
2091
|
+
const w = Kt[d], N = n === d;
|
|
2074
2092
|
return /* @__PURE__ */ v(
|
|
2075
2093
|
"button",
|
|
2076
2094
|
{
|
|
@@ -2081,9 +2099,9 @@ const Ht = ({
|
|
|
2081
2099
|
"data-dimension": d,
|
|
2082
2100
|
className: Se(
|
|
2083
2101
|
"gloss-reconfig-backside-buttons__button",
|
|
2084
|
-
|
|
2102
|
+
N && "gloss-reconfig-backside-buttons__button--active"
|
|
2085
2103
|
),
|
|
2086
|
-
"aria-current":
|
|
2104
|
+
"aria-current": N ? "true" : void 0,
|
|
2087
2105
|
onClick: () => t(d),
|
|
2088
2106
|
onKeyDown: (h) => f(h, g),
|
|
2089
2107
|
children: [
|
|
@@ -2554,7 +2572,7 @@ function Yn({
|
|
|
2554
2572
|
style: d
|
|
2555
2573
|
}) {
|
|
2556
2574
|
if (e === "hidden") return null;
|
|
2557
|
-
const g = Math.max(0, i - a), w = Math.max(0, u - l),
|
|
2575
|
+
const g = Math.max(0, i - a), w = Math.max(0, u - l), N = {
|
|
2558
2576
|
"--gloss-resize-envelope-enter-ms": `${c}ms`,
|
|
2559
2577
|
"--gloss-resize-envelope-exit-ms": `${m}ms`,
|
|
2560
2578
|
"--gloss-resize-envelope-origin-x": `${t - a}px`,
|
|
@@ -2571,7 +2589,7 @@ function Yn({
|
|
|
2571
2589
|
className: ["gloss-resize-envelope", `gloss-resize-envelope--state-${e}`, f].filter(Boolean).join(" "),
|
|
2572
2590
|
"data-state": e,
|
|
2573
2591
|
"data-testid": "gloss-resize-envelope",
|
|
2574
|
-
style:
|
|
2592
|
+
style: N,
|
|
2575
2593
|
"aria-hidden": "true",
|
|
2576
2594
|
children: [
|
|
2577
2595
|
/* @__PURE__ */ r(
|
|
@@ -2872,14 +2890,14 @@ function rr({
|
|
|
2872
2890
|
if (process.env.NODE_ENV === "production")
|
|
2873
2891
|
return { values: {}, spec: null, state: "idle", t: performance.now() };
|
|
2874
2892
|
const f = m.current;
|
|
2875
|
-
let d = 0, g = "", w = "",
|
|
2893
|
+
let d = 0, g = "", w = "", N = "";
|
|
2876
2894
|
if (f)
|
|
2877
2895
|
try {
|
|
2878
2896
|
const M = window.getComputedStyle(f), C = M.outline || "", k = M.border || "", R = M.boxShadow || "", p = !!C && C !== "none" && !/^0px(\s+none)?(\s+rgba?\(0,\s*0,\s*0,\s*0\))?$/i.test(C), b = !!k && k !== "none" && !/^0px(\s+none)?(\s+rgba?\(0,\s*0,\s*0,\s*0\))?$/i.test(k), y = !!R && R !== "none";
|
|
2879
|
-
d = p || b || y ? 1 : 0, g = p ? C : "", w = b ? k : "",
|
|
2897
|
+
d = p || b || y ? 1 : 0, g = p ? C : "", w = b ? k : "", N = y ? R : "";
|
|
2880
2898
|
} catch {
|
|
2881
2899
|
}
|
|
2882
|
-
const h = f?.getBoundingClientRect() ?? null,
|
|
2900
|
+
const h = f?.getBoundingClientRect() ?? null, S = f ? "drag-clone" : "subsumed-by-tracking-outline";
|
|
2883
2901
|
return {
|
|
2884
2902
|
values: {
|
|
2885
2903
|
x: s.get(),
|
|
@@ -2892,11 +2910,11 @@ function rr({
|
|
|
2892
2910
|
outlineOnClone: d
|
|
2893
2911
|
},
|
|
2894
2912
|
spec: {
|
|
2895
|
-
mode:
|
|
2913
|
+
mode: S,
|
|
2896
2914
|
tint: e,
|
|
2897
2915
|
outlineSrc: g,
|
|
2898
2916
|
borderSrc: w,
|
|
2899
|
-
boxShadowSrc:
|
|
2917
|
+
boxShadowSrc: N
|
|
2900
2918
|
// D-01 contract: Frame 1 (current/buggy) shows outline-on-clone=true;
|
|
2901
2919
|
// Frame 2 (decided): outline-on-clone=false (subsumed by tracking
|
|
2902
2920
|
// outline). Wave 2 audit-D-01 reads this field across drag mid-flight
|
|
@@ -2935,7 +2953,7 @@ function Ge({
|
|
|
2935
2953
|
className: u,
|
|
2936
2954
|
motionWidth: c
|
|
2937
2955
|
}) {
|
|
2938
|
-
const m = n * a + (n - 1) * i, d = (t.section * na + t.col) * (a + i), g = t.row * (s + i), w = e === "resize" ? 2.5 : 2,
|
|
2956
|
+
const m = n * a + (n - 1) * i, d = (t.section * na + t.col) * (a + i), g = t.row * (s + i), w = e === "resize" ? 2.5 : 2, N = o === "dashed-retreated" ? "dashed" : "solid", h = e === "drag" ? "gloss-snap-outline" : "gloss-tracking-outline", S = {
|
|
2939
2957
|
className: [
|
|
2940
2958
|
"gloss-tracking-outline",
|
|
2941
2959
|
`gloss-tracking-outline--${e}`,
|
|
@@ -2954,25 +2972,25 @@ function Ge({
|
|
|
2954
2972
|
return c ? /* @__PURE__ */ r(
|
|
2955
2973
|
G.div,
|
|
2956
2974
|
{
|
|
2957
|
-
...
|
|
2975
|
+
...S,
|
|
2958
2976
|
style: {
|
|
2959
2977
|
transform: `translate(${d}px, ${g}px)`,
|
|
2960
2978
|
width: c,
|
|
2961
2979
|
height: s,
|
|
2962
2980
|
borderWidth: w,
|
|
2963
|
-
borderStyle:
|
|
2981
|
+
borderStyle: N
|
|
2964
2982
|
}
|
|
2965
2983
|
}
|
|
2966
2984
|
) : /* @__PURE__ */ r(
|
|
2967
2985
|
"div",
|
|
2968
2986
|
{
|
|
2969
|
-
...
|
|
2987
|
+
...S,
|
|
2970
2988
|
style: {
|
|
2971
2989
|
transform: `translate(${d}px, ${g}px)`,
|
|
2972
2990
|
width: m,
|
|
2973
2991
|
height: s,
|
|
2974
2992
|
borderWidth: w,
|
|
2975
|
-
borderStyle:
|
|
2993
|
+
borderStyle: N,
|
|
2976
2994
|
transition: `transform ${l}ms cubic-bezier(0.4, 0, 0.2, 1)`
|
|
2977
2995
|
}
|
|
2978
2996
|
}
|
|
@@ -3819,15 +3837,15 @@ function yr(e) {
|
|
|
3819
3837
|
};
|
|
3820
3838
|
const d = t.hysteresisTargetColSpan, g = t.previewColSpan, w = a?.result === "rejected";
|
|
3821
3839
|
w || (o.current = d), w && l.current.armed && l.current.lastResult !== "rejected" && (l.current.fireKey += 1, l.current.armed = !1), l.current.lastResult = w ? "rejected" : "ok";
|
|
3822
|
-
const
|
|
3840
|
+
const N = w ? o.current : d, h = {
|
|
3823
3841
|
cell: { section: 0, col: 0, row: 0 },
|
|
3824
|
-
colSpan:
|
|
3842
|
+
colSpan: N,
|
|
3825
3843
|
pattern: w ? "dashed-retreated" : "solid"
|
|
3826
|
-
},
|
|
3844
|
+
}, S = [];
|
|
3827
3845
|
if (w) {
|
|
3828
3846
|
const k = n.col + o.current, R = n.col + d - 1;
|
|
3829
3847
|
for (let p = k; p <= R && p <= 2; p++)
|
|
3830
|
-
|
|
3848
|
+
S.push({
|
|
3831
3849
|
cell: {
|
|
3832
3850
|
section: 0,
|
|
3833
3851
|
col: p - n.col,
|
|
@@ -3844,11 +3862,11 @@ function yr(e) {
|
|
|
3844
3862
|
col: p - n.col,
|
|
3845
3863
|
row: 0
|
|
3846
3864
|
};
|
|
3847
|
-
b && t.direction.startsWith("grow") && d > 1 && !s && k > 0 && k < 1 ?
|
|
3865
|
+
b && t.direction.startsWith("grow") && d > 1 && !s && k > 0 && k < 1 ? S.push({
|
|
3848
3866
|
cell: y,
|
|
3849
3867
|
variant: "ramp",
|
|
3850
3868
|
rampColor: Ca(Me.eligibilityFill, Me.commitFill, R)
|
|
3851
|
-
}) : b ?
|
|
3869
|
+
}) : b ? S.push({ cell: y, variant: "commit" }) : S.push({ cell: y, variant: "eligibility" });
|
|
3852
3870
|
}
|
|
3853
3871
|
}
|
|
3854
3872
|
const M = [];
|
|
@@ -3871,7 +3889,7 @@ function yr(e) {
|
|
|
3871
3889
|
} : null;
|
|
3872
3890
|
return {
|
|
3873
3891
|
trackingOutline: h,
|
|
3874
|
-
cellTints:
|
|
3892
|
+
cellTints: S,
|
|
3875
3893
|
refusePulse: C,
|
|
3876
3894
|
shrinkFreedCells: M,
|
|
3877
3895
|
phase: c.current,
|
|
@@ -3982,7 +4000,7 @@ function Ta({
|
|
|
3982
4000
|
A(() => {
|
|
3983
4001
|
w.current !== g && (w.current = g, !c && d(e));
|
|
3984
4002
|
}, [g, e, c]);
|
|
3985
|
-
const
|
|
4003
|
+
const N = re(() => Da(f, n, a), [f, n, a]), h = _(
|
|
3986
4004
|
(p) => {
|
|
3987
4005
|
if (!u.current) return n;
|
|
3988
4006
|
const b = u.current.getBoundingClientRect(), y = b.width || 1, D = Math.max(0, Math.min(1, (p - b.left) / y)), T = n + D * (a - n);
|
|
@@ -3995,7 +4013,7 @@ function Ta({
|
|
|
3995
4013
|
`ThresholdRamp: max (${a}) must be greater than min (${n}); rendering degenerate strip.`
|
|
3996
4014
|
);
|
|
3997
4015
|
}, [n, a]);
|
|
3998
|
-
const
|
|
4016
|
+
const S = _(
|
|
3999
4017
|
(p, b) => {
|
|
4000
4018
|
const y = f.find((D) => D.id === b);
|
|
4001
4019
|
s || y?.disabled || (p.preventDefault(), m(b));
|
|
@@ -4061,7 +4079,7 @@ function Ta({
|
|
|
4061
4079
|
{
|
|
4062
4080
|
ref: u,
|
|
4063
4081
|
className: "gloss-threshold-ramp__track",
|
|
4064
|
-
style: { background:
|
|
4082
|
+
style: { background: N },
|
|
4065
4083
|
children: f.map((p) => {
|
|
4066
4084
|
const b = (p.value - n) / k * 100;
|
|
4067
4085
|
return /* @__PURE__ */ r(
|
|
@@ -4074,7 +4092,7 @@ function Ta({
|
|
|
4074
4092
|
},
|
|
4075
4093
|
"data-disabled": p.disabled || void 0,
|
|
4076
4094
|
"data-dragging": c === p.id || void 0,
|
|
4077
|
-
onPointerDown: (y) =>
|
|
4095
|
+
onPointerDown: (y) => S(y, p.id),
|
|
4078
4096
|
onKeyDown: (y) => R(y, p),
|
|
4079
4097
|
"aria-label": p.label ?? `Stop at ${p.value}`,
|
|
4080
4098
|
role: "slider",
|
|
@@ -4143,10 +4161,10 @@ function Pa({
|
|
|
4143
4161
|
[c]
|
|
4144
4162
|
), d = P(/* @__PURE__ */ new Map()), g = _((C, k) => {
|
|
4145
4163
|
k ? d.current.set(C, k) : d.current.delete(C);
|
|
4146
|
-
}, []), w = e.filter((C) => !C.disabled && !i),
|
|
4164
|
+
}, []), w = e.filter((C) => !C.disabled && !i), N = w.find((C) => C.value === c)?.value ?? w[0]?.value, h = _((C) => {
|
|
4147
4165
|
const k = d.current.get(C);
|
|
4148
4166
|
k && k.focus();
|
|
4149
|
-
}, []),
|
|
4167
|
+
}, []), S = _(
|
|
4150
4168
|
(C, k) => {
|
|
4151
4169
|
if (i) return;
|
|
4152
4170
|
const R = e.filter((D) => !D.disabled);
|
|
@@ -4188,8 +4206,8 @@ function Pa({
|
|
|
4188
4206
|
groupDisabled: i,
|
|
4189
4207
|
name: s,
|
|
4190
4208
|
registerRef: g,
|
|
4191
|
-
firstFocusableValue:
|
|
4192
|
-
onKeyNav:
|
|
4209
|
+
firstFocusableValue: N,
|
|
4210
|
+
onKeyNav: S
|
|
4193
4211
|
};
|
|
4194
4212
|
return /* @__PURE__ */ r(We.Provider, { value: M, children: /* @__PURE__ */ r(
|
|
4195
4213
|
"div",
|
|
@@ -4241,10 +4259,10 @@ function Aa(e) {
|
|
|
4241
4259
|
}, [c, e.zones, a]);
|
|
4242
4260
|
const f = _(
|
|
4243
4261
|
(h) => {
|
|
4244
|
-
const
|
|
4262
|
+
const S = h.active.id;
|
|
4245
4263
|
let M = null, C = null;
|
|
4246
4264
|
for (const k of t) {
|
|
4247
|
-
const R = k.items.find((p) => p.id ===
|
|
4265
|
+
const R = k.items.find((p) => p.id === S);
|
|
4248
4266
|
if (R) {
|
|
4249
4267
|
M = R, C = k.zoneKey;
|
|
4250
4268
|
break;
|
|
@@ -4259,38 +4277,38 @@ function Aa(e) {
|
|
|
4259
4277
|
o(l.current);
|
|
4260
4278
|
return;
|
|
4261
4279
|
}
|
|
4262
|
-
const
|
|
4263
|
-
o(
|
|
4280
|
+
const S = Pe(t, h.over.id);
|
|
4281
|
+
o(S);
|
|
4264
4282
|
},
|
|
4265
4283
|
[t]
|
|
4266
4284
|
), g = _(
|
|
4267
4285
|
(h) => {
|
|
4268
|
-
const { active:
|
|
4286
|
+
const { active: S, over: M } = h, C = () => {
|
|
4269
4287
|
l.current = null, i(null), o(null);
|
|
4270
4288
|
};
|
|
4271
4289
|
if (!M) {
|
|
4272
4290
|
C();
|
|
4273
4291
|
return;
|
|
4274
4292
|
}
|
|
4275
|
-
const k = he(t,
|
|
4293
|
+
const k = he(t, S.id), R = Pe(t, M.id);
|
|
4276
4294
|
if (!k || !R) {
|
|
4277
4295
|
C();
|
|
4278
4296
|
return;
|
|
4279
4297
|
}
|
|
4280
4298
|
let p = t.map((b) => ({ ...b, items: [...b.items] }));
|
|
4281
4299
|
if (k === R) {
|
|
4282
|
-
const b = p.findIndex((I) => I.zoneKey === k), y = p[b], D = y.items.findIndex((I) => I.id ===
|
|
4300
|
+
const b = p.findIndex((I) => I.zoneKey === k), y = p[b], D = y.items.findIndex((I) => I.id === S.id), T = y.items.findIndex((I) => I.id === M.id), x = T >= 0 ? T : Math.max(0, y.items.length - 1);
|
|
4283
4301
|
p[b] = {
|
|
4284
4302
|
...y,
|
|
4285
4303
|
items: Ia(y.items, D, x)
|
|
4286
4304
|
};
|
|
4287
4305
|
} else {
|
|
4288
|
-
const b = p.findIndex((O) => O.zoneKey === k), y = p.findIndex((O) => O.zoneKey === R), D = p[b], T = p[y], x = D.items.find((O) => O.id ===
|
|
4306
|
+
const b = p.findIndex((O) => O.zoneKey === k), y = p.findIndex((O) => O.zoneKey === R), D = p[b], T = p[y], x = D.items.find((O) => O.id === S.id);
|
|
4289
4307
|
if (!x) {
|
|
4290
4308
|
C();
|
|
4291
4309
|
return;
|
|
4292
4310
|
}
|
|
4293
|
-
const I = D.items.filter((O) => O.id !==
|
|
4311
|
+
const I = D.items.filter((O) => O.id !== S.id), L = T.items.findIndex((O) => O.id === M.id), Z = L >= 0 ? L : T.items.length;
|
|
4294
4312
|
let be = I, H = [...T.items];
|
|
4295
4313
|
if (T.maxItems !== void 0 && H.length >= T.maxItems) {
|
|
4296
4314
|
const O = H[H.length - 1];
|
|
@@ -4312,13 +4330,13 @@ function Aa(e) {
|
|
|
4312
4330
|
"data-zone-key": h
|
|
4313
4331
|
}),
|
|
4314
4332
|
[]
|
|
4315
|
-
),
|
|
4333
|
+
), N = _(
|
|
4316
4334
|
(h) => {
|
|
4317
|
-
const
|
|
4335
|
+
const S = he(t, h.id) ?? "";
|
|
4318
4336
|
return {
|
|
4319
4337
|
id: h.id,
|
|
4320
4338
|
"data-item-id": h.id,
|
|
4321
|
-
"data-zone-key":
|
|
4339
|
+
"data-zone-key": S
|
|
4322
4340
|
};
|
|
4323
4341
|
},
|
|
4324
4342
|
[t]
|
|
@@ -4328,7 +4346,7 @@ function Aa(e) {
|
|
|
4328
4346
|
activeZone: s,
|
|
4329
4347
|
activeItem: a,
|
|
4330
4348
|
getZoneProps: w,
|
|
4331
|
-
getItemProps:
|
|
4349
|
+
getItemProps: N,
|
|
4332
4350
|
handleDragStart: f,
|
|
4333
4351
|
handleDragOver: d,
|
|
4334
4352
|
handleDragEnd: g
|
|
@@ -4412,7 +4430,7 @@ function Ve({
|
|
|
4412
4430
|
renderItem: a,
|
|
4413
4431
|
renderDragOverlay: i
|
|
4414
4432
|
}) {
|
|
4415
|
-
const { core: s, sortable: o, utilities: l } = t, { DndContext: u, DragOverlay: c, useSensors: m, useSensor: f, useDroppable: d, PointerSensor: g, KeyboardSensor: w, closestCenter:
|
|
4433
|
+
const { core: s, sortable: o, utilities: l } = t, { DndContext: u, DragOverlay: c, useSensors: m, useSensor: f, useDroppable: d, PointerSensor: g, KeyboardSensor: w, closestCenter: N } = s, { SortableContext: h, verticalListSortingStrategy: S } = o, M = m(
|
|
4416
4434
|
f(g, { activationConstraint: { distance: 5 } }),
|
|
4417
4435
|
f(w)
|
|
4418
4436
|
), C = u, k = c, R = h;
|
|
@@ -4420,7 +4438,7 @@ function Ve({
|
|
|
4420
4438
|
C,
|
|
4421
4439
|
{
|
|
4422
4440
|
sensors: M,
|
|
4423
|
-
collisionDetection:
|
|
4441
|
+
collisionDetection: N,
|
|
4424
4442
|
onDragStart: e.handleDragStart,
|
|
4425
4443
|
onDragOver: e.handleDragOver,
|
|
4426
4444
|
onDragEnd: e.handleDragEnd,
|
|
@@ -4442,7 +4460,7 @@ function Ve({
|
|
|
4442
4460
|
zoneKey: p.zoneKey,
|
|
4443
4461
|
zoneProps: e.getZoneProps(p.zoneKey),
|
|
4444
4462
|
useDroppable: d,
|
|
4445
|
-
children: /* @__PURE__ */ r(R, { items: b, strategy:
|
|
4463
|
+
children: /* @__PURE__ */ r(R, { items: b, strategy: S, children: n(p.zoneKey, p.items, y) })
|
|
4446
4464
|
},
|
|
4447
4465
|
p.zoneKey
|
|
4448
4466
|
);
|
|
@@ -4542,14 +4560,14 @@ function _r({
|
|
|
4542
4560
|
"aria-label": a,
|
|
4543
4561
|
"data-testid": "gloss-section-dots",
|
|
4544
4562
|
className: "gloss-section-dots",
|
|
4545
|
-
onKeyDown: (
|
|
4563
|
+
onKeyDown: (N) => {
|
|
4546
4564
|
if (e !== 0) {
|
|
4547
|
-
if (
|
|
4548
|
-
|
|
4565
|
+
if (N.key === "ArrowRight") {
|
|
4566
|
+
N.preventDefault();
|
|
4549
4567
|
const h = (c + 1) % e;
|
|
4550
4568
|
n(h), requestAnimationFrame(() => g.current[h]?.focus());
|
|
4551
|
-
} else if (
|
|
4552
|
-
|
|
4569
|
+
} else if (N.key === "ArrowLeft") {
|
|
4570
|
+
N.preventDefault();
|
|
4553
4571
|
const h = (c - 1 + e) % e;
|
|
4554
4572
|
n(h), requestAnimationFrame(() => g.current[h]?.focus());
|
|
4555
4573
|
}
|
|
@@ -4567,11 +4585,11 @@ function _r({
|
|
|
4567
4585
|
}
|
|
4568
4586
|
}
|
|
4569
4587
|
),
|
|
4570
|
-
Array.from({ length: e }, (
|
|
4588
|
+
Array.from({ length: e }, (N, h) => /* @__PURE__ */ r(
|
|
4571
4589
|
"button",
|
|
4572
4590
|
{
|
|
4573
|
-
ref: (
|
|
4574
|
-
g.current[h] =
|
|
4591
|
+
ref: (S) => {
|
|
4592
|
+
g.current[h] = S;
|
|
4575
4593
|
},
|
|
4576
4594
|
type: "button",
|
|
4577
4595
|
role: "tab",
|