@weasel-js/ui 1.3.0-pre.0 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/{ActionsBar-gTuCtkv8.js → ActionsBar-CBi_dV4B.js} +3 -3
- package/dist/chunks/{ActionsBar-gTuCtkv8.js.map → ActionsBar-CBi_dV4B.js.map} +1 -1
- package/dist/chunks/{BandEditor-DKbcHG2_.js → BandEditor-DeE-Nhyh.js} +1 -1
- package/dist/chunks/{BandEditor-DKbcHG2_.js.map → BandEditor-DeE-Nhyh.js.map} +1 -1
- package/dist/chunks/{Callout-CHs98djt.js → Callout-CxDNb9iE.js} +1 -1
- package/dist/chunks/{Callout-CHs98djt.js.map → Callout-CxDNb9iE.js.map} +1 -1
- package/dist/chunks/{Checkbox-BLEw-wEb.js → Checkbox-Chtrlh19.js} +1 -1
- package/dist/chunks/{Checkbox-BLEw-wEb.js.map → Checkbox-Chtrlh19.js.map} +1 -1
- package/dist/chunks/{ColorField-D1t-BdSa.js → ColorField-CSSRv3jG.js} +2 -2
- package/dist/chunks/{ColorField-D1t-BdSa.js.map → ColorField-CSSRv3jG.js.map} +1 -1
- package/dist/chunks/{ComboBox-cvdKolWv.js → ComboBox-BIQ8KP4h.js} +2 -2
- package/dist/chunks/{ComboBox-cvdKolWv.js.map → ComboBox-BIQ8KP4h.js.map} +1 -1
- package/dist/chunks/{CurveEditor-BaA-PabB.js → CurveEditor-DiJk0NhK.js} +3 -2
- package/dist/chunks/{CurveEditor-BaA-PabB.js.map → CurveEditor-DiJk0NhK.js.map} +1 -1
- package/dist/chunks/DataGrid-BgiEYBLo.js +107 -0
- package/dist/chunks/DataGrid-BgiEYBLo.js.map +1 -0
- package/dist/chunks/{Dialog-DC1x46Sq.js → Dialog-RzrboT4Q.js} +1 -1
- package/dist/chunks/{Dialog-DC1x46Sq.js.map → Dialog-RzrboT4Q.js.map} +1 -1
- package/dist/chunks/DragHandleGlyph-CJbzRigu.js +47 -0
- package/dist/chunks/DragHandleGlyph-CJbzRigu.js.map +1 -0
- package/dist/chunks/{Field-BjFl_yng.js → Field-DrRby9vo.js} +1 -1
- package/dist/chunks/{Field-BjFl_yng.js.map → Field-DrRby9vo.js.map} +1 -1
- package/dist/chunks/{GradientEditor-BJRD0n1g.js → GradientEditor-BuVR6pt-.js} +4 -4
- package/dist/chunks/{GradientEditor-BJRD0n1g.js.map → GradientEditor-BuVR6pt-.js.map} +1 -1
- package/dist/chunks/{InlineRange-C6UYKxLD.js → InlineRange-B-Jkv8AA.js} +1 -1
- package/dist/chunks/{InlineRange-C6UYKxLD.js.map → InlineRange-B-Jkv8AA.js.map} +1 -1
- package/dist/chunks/{Input-DhWBgpRx.js → Input-BnxOPY4N.js} +2 -2
- package/dist/chunks/{Input-DhWBgpRx.js.map → Input-BnxOPY4N.js.map} +1 -1
- package/dist/chunks/{Keycaps-BhCKdyws.js → Keycaps-Dk33JOiH.js} +1 -1
- package/dist/chunks/{Keycaps-BhCKdyws.js.map → Keycaps-Dk33JOiH.js.map} +1 -1
- package/dist/chunks/LayerStack-DQYvGNPA.js +145 -0
- package/dist/chunks/LayerStack-DQYvGNPA.js.map +1 -0
- package/dist/chunks/{NumberField-ZdVa4bpJ.js → NumberField-BQ-KaK7T.js} +2 -2
- package/dist/chunks/{NumberField-ZdVa4bpJ.js.map → NumberField-BQ-KaK7T.js.map} +1 -1
- package/dist/chunks/{OptionsBar-DahCI4Aq.js → OptionsBar-BecAPCID.js} +3 -3
- package/dist/chunks/{OptionsBar-DahCI4Aq.js.map → OptionsBar-BecAPCID.js.map} +1 -1
- package/dist/chunks/{PaintInput-Cggm9OIl.js → PaintInput-K5W4Uho3.js} +5 -5
- package/dist/chunks/{PaintInput-Cggm9OIl.js.map → PaintInput-K5W4Uho3.js.map} +1 -1
- package/dist/chunks/{PatternPicker-B63SlDoF.js → PatternPicker-BdLSj_f_.js} +2 -2
- package/dist/chunks/{PatternPicker-B63SlDoF.js.map → PatternPicker-BdLSj_f_.js.map} +1 -1
- package/dist/chunks/Plot2D-BEjpJhk-.js +134 -0
- package/dist/chunks/Plot2D-BEjpJhk-.js.map +1 -0
- package/dist/chunks/{PointPlotter-CLd9u5Bq.js → PointPlotter-C_tZb122.js} +2 -2
- package/dist/chunks/{PointPlotter-CLd9u5Bq.js.map → PointPlotter-C_tZb122.js.map} +1 -1
- package/dist/chunks/{Powerline-DhQJYaUg.js → Powerline-Cc-Av8Pc.js} +1 -1
- package/dist/chunks/{Powerline-DhQJYaUg.js.map → Powerline-Cc-Av8Pc.js.map} +1 -1
- package/dist/chunks/{Prefs-BSJ0lMmJ.js → Prefs-CRTRAud6.js} +10 -10
- package/dist/chunks/{Prefs-BSJ0lMmJ.js.map → Prefs-CRTRAud6.js.map} +1 -1
- package/dist/chunks/Properties-BRrWSBHM.js +648 -0
- package/dist/chunks/Properties-BRrWSBHM.js.map +1 -0
- package/dist/chunks/{RadioGroup-vtwjRiUm.js → RadioGroup-BrtV1Clm.js} +2 -2
- package/dist/chunks/{RadioGroup-vtwjRiUm.js.map → RadioGroup-BrtV1Clm.js.map} +1 -1
- package/dist/chunks/{RangeSlider-B-n_7AgJ.js → RangeSlider-CJfhxDn6.js} +1 -1
- package/dist/chunks/{RangeSlider-B-n_7AgJ.js.map → RangeSlider-CJfhxDn6.js.map} +1 -1
- package/dist/chunks/{ResizeHandle--ZExnMfa.js → ResizeHandle-Csz3DPew.js} +1 -1
- package/dist/chunks/{ResizeHandle--ZExnMfa.js.map → ResizeHandle-Csz3DPew.js.map} +1 -1
- package/dist/chunks/{Select--BVTi-j0.js → Select-BYhHGmMl.js} +2 -2
- package/dist/chunks/{Select--BVTi-j0.js.map → Select-BYhHGmMl.js.map} +1 -1
- package/dist/chunks/{SelectionPanel-C7kygTFE.js → SelectionPanel-D2IYlj_K.js} +9 -9
- package/dist/chunks/{SelectionPanel-C7kygTFE.js.map → SelectionPanel-D2IYlj_K.js.map} +1 -1
- package/dist/chunks/{Sidebar-CtwBdr4n.js → Sidebar-DrBQZ9nP.js} +1 -1
- package/dist/chunks/{Sidebar-CtwBdr4n.js.map → Sidebar-DrBQZ9nP.js.map} +1 -1
- package/dist/chunks/{SidebarPanel-AeSc7wNR.js → SidebarPanel-Dbqb79Kx.js} +1 -1
- package/dist/chunks/{SidebarPanel-AeSc7wNR.js.map → SidebarPanel-Dbqb79Kx.js.map} +1 -1
- package/dist/chunks/Slider-DbOt9Dji.js +257 -0
- package/dist/chunks/Slider-DbOt9Dji.js.map +1 -0
- package/dist/chunks/{StatusBar-D_wu-SZh.js → StatusBar-B6lPbvrF.js} +1 -1
- package/dist/chunks/{StatusBar-D_wu-SZh.js.map → StatusBar-B6lPbvrF.js.map} +1 -1
- package/dist/chunks/{Switch-CtZwp5zm.js → Switch-BSr-vaAC.js} +1 -1
- package/dist/chunks/{Switch-CtZwp5zm.js.map → Switch-BSr-vaAC.js.map} +1 -1
- package/dist/chunks/{Tabs-lB0IB4TX.js → Tabs-CIa-Idzu.js} +1 -1
- package/dist/chunks/{Tabs-lB0IB4TX.js.map → Tabs-CIa-Idzu.js.map} +1 -1
- package/dist/chunks/{Toast-hr9BYsho.js → Toast-C0UnBqQu.js} +1 -1
- package/dist/chunks/{Toast-hr9BYsho.js.map → Toast-C0UnBqQu.js.map} +1 -1
- package/dist/chunks/{ToggleBar-BxgWq-wO.js → ToggleBar-1wDRwSGN.js} +2 -2
- package/dist/chunks/{ToggleBar-BxgWq-wO.js.map → ToggleBar-1wDRwSGN.js.map} +1 -1
- package/dist/chunks/{ToolButton-CJrPjbsj.js → ToolButton-Bd9l_I8f.js} +1 -1
- package/dist/chunks/{ToolButton-CJrPjbsj.js.map → ToolButton-Bd9l_I8f.js.map} +1 -1
- package/dist/chunks/{ToolGroup-D_lDzkvU.js → ToolGroup-gizXwttA.js} +1 -1
- package/dist/chunks/{ToolGroup-D_lDzkvU.js.map → ToolGroup-gizXwttA.js.map} +1 -1
- package/dist/chunks/{ToolOptionsBar-BA6Sb3U2.js → ToolOptionsBar-CXjeTE1d.js} +1 -1
- package/dist/chunks/{ToolOptionsBar-BA6Sb3U2.js.map → ToolOptionsBar-CXjeTE1d.js.map} +1 -1
- package/dist/chunks/{ToolPalette-TMvkaJwr.js → ToolPalette-3YpkSNfj.js} +5 -5
- package/dist/chunks/{ToolPalette-TMvkaJwr.js.map → ToolPalette-3YpkSNfj.js.map} +1 -1
- package/dist/chunks/dlog-CMYiRF3Q.js +38 -0
- package/dist/chunks/dlog-CMYiRF3Q.js.map +1 -0
- package/dist/chunks/{keyGlyph-DNpLxF8u.js → keyGlyph-D3X08tSp.js} +1 -1
- package/dist/chunks/{keyGlyph-DNpLxF8u.js.map → keyGlyph-D3X08tSp.js.map} +1 -1
- package/dist/chunks/number-llMRJPJW.js +18 -0
- package/dist/chunks/number-llMRJPJW.js.map +1 -0
- package/dist/chunks/{segmentedControl.module-D4b7x19O.js → segmentedControl.module-YXqIjnmu.js} +1 -1
- package/dist/chunks/{segmentedControl.module-D4b7x19O.js.map → segmentedControl.module-YXqIjnmu.js.map} +1 -1
- package/dist/chunks/useReorderDragList-RSJqj18B.js +109 -0
- package/dist/chunks/useReorderDragList-RSJqj18B.js.map +1 -0
- package/dist/chunks/{useRovingTabIndex-CQz8EiKh.js → useRovingTabIndex-CuUl6DLF.js} +1 -1
- package/dist/chunks/{useRovingTabIndex-CQz8EiKh.js.map → useRovingTabIndex-CuUl6DLF.js.map} +1 -1
- package/dist/components/ActionsBar/index.js +1 -1
- package/dist/components/BandEditor/index.js +1 -1
- package/dist/components/Callout/index.js +1 -1
- package/dist/components/Checkbox/index.js +1 -1
- package/dist/components/ColorField/index.js +1 -1
- package/dist/components/ComboBox/index.js +1 -1
- package/dist/components/CurveEditor/index.js +1 -1
- package/dist/components/DataGrid/index.js +1 -1
- package/dist/components/Dialog/index.js +1 -1
- package/dist/components/DragHandleGlyph/DragHandleGlyph.d.ts +12 -0
- package/dist/components/DragHandleGlyph/DragHandleGlyph.d.ts.map +1 -0
- package/dist/components/DragHandleGlyph/index.d.ts +3 -0
- package/dist/components/DragHandleGlyph/index.d.ts.map +1 -0
- package/dist/components/DragHandleGlyph/index.js +2 -0
- package/dist/components/Field/index.js +1 -1
- package/dist/components/GradientEditor/index.js +1 -1
- package/dist/components/InlineRange/index.js +1 -1
- package/dist/components/Input/index.js +1 -1
- package/dist/components/Keycaps/index.js +2 -2
- package/dist/components/LayerStack/LayerStack.d.ts +49 -0
- package/dist/components/LayerStack/LayerStack.d.ts.map +1 -0
- package/dist/components/LayerStack/index.d.ts +2 -0
- package/dist/components/LayerStack/index.d.ts.map +1 -0
- package/dist/components/LayerStack/index.js +2 -0
- package/dist/components/NumberField/index.js +1 -1
- package/dist/components/OptionsBar/index.js +1 -1
- package/dist/components/PaintInput/index.js +1 -1
- package/dist/components/PatternPicker/index.js +1 -1
- package/dist/components/Plot2D/index.js +1 -1
- package/dist/components/PointPlotter/index.js +1 -1
- package/dist/components/Powerline/index.js +1 -1
- package/dist/components/Prefs/index.js +1 -1
- package/dist/components/Properties/CurveField.d.ts +37 -0
- package/dist/components/Properties/CurveField.d.ts.map +1 -0
- package/dist/components/Properties/EffectCard.d.ts +68 -0
- package/dist/components/Properties/EffectCard.d.ts.map +1 -0
- package/dist/components/Properties/PropertyGroup.d.ts +24 -0
- package/dist/components/Properties/PropertyGroup.d.ts.map +1 -0
- package/dist/components/Properties/PropertyPanel.d.ts +181 -0
- package/dist/components/Properties/PropertyPanel.d.ts.map +1 -0
- package/dist/components/Properties/index.d.ts +9 -0
- package/dist/components/Properties/index.d.ts.map +1 -0
- package/dist/components/Properties/index.js +2 -0
- package/dist/components/Properties/storyLayouts.d.ts +11 -0
- package/dist/components/Properties/storyLayouts.d.ts.map +1 -0
- package/dist/components/RadioGroup/index.js +1 -1
- package/dist/components/RangeSlider/index.js +1 -1
- package/dist/components/ResizeHandle/index.js +1 -1
- package/dist/components/Select/index.js +1 -1
- package/dist/components/SelectionPanel/index.js +1 -1
- package/dist/components/Sidebar/index.js +1 -1
- package/dist/components/SidebarPanel/index.js +1 -1
- package/dist/components/Slider/index.js +1 -1
- package/dist/components/StatusBar/index.js +1 -1
- package/dist/components/Switch/index.js +1 -1
- package/dist/components/Tabs/index.js +1 -1
- package/dist/components/Toast/index.js +1 -1
- package/dist/components/ToggleBar/index.js +1 -1
- package/dist/components/ToolButton/index.js +1 -1
- package/dist/components/ToolGroup/index.js +1 -1
- package/dist/components/ToolOptionsBar/index.js +1 -1
- package/dist/components/ToolPalette/index.js +1 -1
- package/dist/format/number.d.ts +13 -0
- package/dist/format/number.d.ts.map +1 -1
- package/dist/index.d.ts +4 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +100 -94
- package/dist/index.js.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +4 -4
- package/dist/chunks/DataGrid-D15I779H.js +0 -210
- package/dist/chunks/DataGrid-D15I779H.js.map +0 -1
- package/dist/chunks/Plot2D-sPXTw_-l.js +0 -168
- package/dist/chunks/Plot2D-sPXTw_-l.js.map +0 -1
- package/dist/chunks/Slider-cxWR47gi.js +0 -259
- package/dist/chunks/Slider-cxWR47gi.js.map +0 -1
|
@@ -1,168 +0,0 @@
|
|
|
1
|
-
import { jsx as e, jsxs as t } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef as n, useCallback as r, useEffect as i, useImperativeHandle as a, useMemo as o, useRef as s } from "react";
|
|
3
|
-
//#region src/dlog.ts
|
|
4
|
-
var c = ["weasel.debug", "weaseldraw.debug"], l = null;
|
|
5
|
-
function u() {
|
|
6
|
-
let e = {
|
|
7
|
-
all: !1,
|
|
8
|
-
set: /* @__PURE__ */ new Set()
|
|
9
|
-
};
|
|
10
|
-
if (typeof localStorage > "u") return e;
|
|
11
|
-
try {
|
|
12
|
-
for (let e of c) {
|
|
13
|
-
let t = localStorage.getItem(e);
|
|
14
|
-
if (!(t == null || t === "")) return t === "1" || t === "true" || t === "*" ? {
|
|
15
|
-
all: !0,
|
|
16
|
-
set: /* @__PURE__ */ new Set()
|
|
17
|
-
} : {
|
|
18
|
-
all: !1,
|
|
19
|
-
set: new Set(t.split(/[\s,]+/).filter(Boolean))
|
|
20
|
-
};
|
|
21
|
-
}
|
|
22
|
-
return e;
|
|
23
|
-
} catch {
|
|
24
|
-
return e;
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
function d() {
|
|
28
|
-
return l === null && (l = u()), l;
|
|
29
|
-
}
|
|
30
|
-
function f(e) {
|
|
31
|
-
let t = d();
|
|
32
|
-
return t.all || t.set.has(e);
|
|
33
|
-
}
|
|
34
|
-
function p(e, ...t) {
|
|
35
|
-
f(e) && console.debug(`[${e}]`, ...t);
|
|
36
|
-
}
|
|
37
|
-
//#endregion
|
|
38
|
-
//#region src/components/Plot2D/geometry.ts
|
|
39
|
-
function m(e, t, n) {
|
|
40
|
-
let r = (e.x - t.xMin) / (t.xMax - t.xMin), i = (e.y - t.yMin) / (t.yMax - t.yMin);
|
|
41
|
-
return {
|
|
42
|
-
x: r * n.width,
|
|
43
|
-
y: (1 - i) * n.height
|
|
44
|
-
};
|
|
45
|
-
}
|
|
46
|
-
function h(e, t, n) {
|
|
47
|
-
let r = e.x / n.width, i = 1 - e.y / n.height;
|
|
48
|
-
return {
|
|
49
|
-
x: t.xMin + r * (t.xMax - t.xMin),
|
|
50
|
-
y: t.yMin + i * (t.yMax - t.yMin)
|
|
51
|
-
};
|
|
52
|
-
}
|
|
53
|
-
var g = {
|
|
54
|
-
root: "_root_1djm7_1",
|
|
55
|
-
grid: "_grid_1djm7_28",
|
|
56
|
-
axis: "_axis_1djm7_34"
|
|
57
|
-
}, _ = n(function(n, c) {
|
|
58
|
-
let { width: l, height: u, xRange: d = [0, 1], yRange: f = [0, 1], grid: _, axes: v, tabIndex: y, className: b, style: x, onPointerDown: S, onKeyDown: C, children: w } = n, T = s(null), E = o(() => ({
|
|
59
|
-
xMin: d[0],
|
|
60
|
-
xMax: d[1],
|
|
61
|
-
yMin: f[0],
|
|
62
|
-
yMax: f[1]
|
|
63
|
-
}), [d, f]), D = o(() => ({
|
|
64
|
-
width: l,
|
|
65
|
-
height: u
|
|
66
|
-
}), [l, u]), O = r((e) => {
|
|
67
|
-
let t = T.current?.getBoundingClientRect(), n = t?.left ?? 0, r = t?.top ?? 0;
|
|
68
|
-
return {
|
|
69
|
-
x: e.clientX - n,
|
|
70
|
-
y: e.clientY - r
|
|
71
|
-
};
|
|
72
|
-
}, []);
|
|
73
|
-
i(() => (p("plot2d", "mount", {
|
|
74
|
-
width: l,
|
|
75
|
-
height: u
|
|
76
|
-
}), () => p("plot2d", "unmount")), []), a(c, () => ({
|
|
77
|
-
get svg() {
|
|
78
|
-
return T.current;
|
|
79
|
-
},
|
|
80
|
-
plotToModel: (e) => h(e, E, D),
|
|
81
|
-
modelToPlot: (e) => m(e, E, D),
|
|
82
|
-
clientToPlot: O,
|
|
83
|
-
clientToModel: (e) => h(O(e), E, D),
|
|
84
|
-
get width() {
|
|
85
|
-
return D.width;
|
|
86
|
-
},
|
|
87
|
-
get height() {
|
|
88
|
-
return D.height;
|
|
89
|
-
}
|
|
90
|
-
}), [
|
|
91
|
-
E,
|
|
92
|
-
D,
|
|
93
|
-
O
|
|
94
|
-
]);
|
|
95
|
-
let k = r((e) => {
|
|
96
|
-
if (!S) return;
|
|
97
|
-
let t = O(e);
|
|
98
|
-
S(e, {
|
|
99
|
-
plot: t,
|
|
100
|
-
model: h(t, E, D)
|
|
101
|
-
});
|
|
102
|
-
}, [
|
|
103
|
-
S,
|
|
104
|
-
O,
|
|
105
|
-
E,
|
|
106
|
-
D
|
|
107
|
-
]);
|
|
108
|
-
return /* @__PURE__ */ t("svg", {
|
|
109
|
-
ref: T,
|
|
110
|
-
className: [g.root, b].filter(Boolean).join(" "),
|
|
111
|
-
style: x,
|
|
112
|
-
width: l,
|
|
113
|
-
height: u,
|
|
114
|
-
viewBox: `0 0 ${l} ${u}`,
|
|
115
|
-
role: "img",
|
|
116
|
-
tabIndex: y,
|
|
117
|
-
onPointerDown: S ? k : void 0,
|
|
118
|
-
onKeyDown: C,
|
|
119
|
-
children: [
|
|
120
|
-
_ && (() => {
|
|
121
|
-
let n = _.divisions ?? 3, r = _.color, i = [];
|
|
122
|
-
for (let e = 1; e <= n; e++) i.push(e / (n + 1));
|
|
123
|
-
return /* @__PURE__ */ t("g", { children: [i.map((t) => /* @__PURE__ */ e("line", {
|
|
124
|
-
"data-plot-element": "grid",
|
|
125
|
-
className: g.grid,
|
|
126
|
-
stroke: r,
|
|
127
|
-
x1: t * l,
|
|
128
|
-
x2: t * l,
|
|
129
|
-
y1: 0,
|
|
130
|
-
y2: u
|
|
131
|
-
}, `gx-${t}`)), i.map((t) => /* @__PURE__ */ e("line", {
|
|
132
|
-
"data-plot-element": "grid",
|
|
133
|
-
className: g.grid,
|
|
134
|
-
stroke: r,
|
|
135
|
-
x1: 0,
|
|
136
|
-
x2: l,
|
|
137
|
-
y1: t * u,
|
|
138
|
-
y2: t * u
|
|
139
|
-
}, `gy-${t}`))] });
|
|
140
|
-
})(),
|
|
141
|
-
v !== !1 && v !== null && (() => {
|
|
142
|
-
let n = v?.color;
|
|
143
|
-
return /* @__PURE__ */ t("g", { children: [/* @__PURE__ */ e("line", {
|
|
144
|
-
"data-plot-element": "axis",
|
|
145
|
-
className: g.axis,
|
|
146
|
-
stroke: n,
|
|
147
|
-
x1: 0,
|
|
148
|
-
x2: l,
|
|
149
|
-
y1: u,
|
|
150
|
-
y2: u
|
|
151
|
-
}), /* @__PURE__ */ e("line", {
|
|
152
|
-
"data-plot-element": "axis",
|
|
153
|
-
className: g.axis,
|
|
154
|
-
stroke: n,
|
|
155
|
-
x1: 0,
|
|
156
|
-
x2: 0,
|
|
157
|
-
y1: 0,
|
|
158
|
-
y2: u
|
|
159
|
-
})] });
|
|
160
|
-
})(),
|
|
161
|
-
w
|
|
162
|
-
]
|
|
163
|
-
});
|
|
164
|
-
});
|
|
165
|
-
//#endregion
|
|
166
|
-
export { f as a, p as i, m as n, h as r, _ as t };
|
|
167
|
-
|
|
168
|
-
//# sourceMappingURL=Plot2D-sPXTw_-l.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Plot2D-sPXTw_-l.js","names":[],"sources":["../../src/dlog.ts","../../src/components/Plot2D/geometry.ts","../../src/components/Plot2D/Plot2D.module.css","../../src/components/Plot2D/Plot2D.tsx"],"sourcesContent":["/**\n * Namespaced, opt-in console tracing. Off by default; production builds\n * may strip the calls entirely depending on the bundler.\n *\n * Enable in the browser:\n *\n * localStorage.setItem('weasel.debug', '*') // all namespaces\n * localStorage.setItem('weasel.debug', 'curve-editor') // just curve editor\n * localStorage.setItem('weasel.debug', 'curve-editor,layer-stack')\n *\n * Each component picks a stable namespace and calls `dlog(namespace, ...)`.\n * Useful for tracing pointer/event flows that are hard to capture\n * post-hoc (drag handlers, gesture sequences, selection mutations).\n *\n * The flag is read once and cached for the page session — reload to\n * pick up changes. Cheap hot-path checks (one nullish-coalesce + Set\n * lookup) so leaving calls in place is fine.\n *\n * Mirrors `src/debug/flag.ts` in the kit. Two impls live here because\n * weasel-ui doesn't depend on the kit, but both read the same\n * localStorage keys so behavior is uniform. See the kit copy for the\n * canonical list of kit-level namespaces.\n *\n * Known weasel-ui namespaces:\n * - plot2d — Plot2D mount / unmount\n * - curve-editor — CurveEditor pointer flow\n */\n\nconst KEYS = ['weasel.debug', 'weaseldraw.debug'] as const;\n\ninterface Cached {\n all: boolean;\n set: Set<string>;\n}\n\nlet cached: Cached | null = null;\n\nfunction read(): Cached {\n const empty: Cached = { all: false, set: new Set() };\n if (typeof localStorage === 'undefined') return empty;\n try {\n for (const k of KEYS) {\n const v = localStorage.getItem(k);\n if (v == null || v === '') continue;\n if (v === '1' || v === 'true' || v === '*') return { all: true, set: new Set() };\n return { all: false, set: new Set(v.split(/[\\s,]+/).filter(Boolean)) };\n }\n return empty;\n } catch {\n return empty;\n }\n}\n\nfunction get(): Cached {\n if (cached === null) cached = read();\n return cached;\n}\n\n/** True when `namespace` (or `*`) is enabled. */\nexport function isDebugEnabled(namespace: string): boolean {\n const c = get();\n return c.all || c.set.has(namespace);\n}\n\n/** Conditional `console.debug` — no-op unless `namespace` (or `*`) is enabled.\n * Each call is prefixed with `[namespace]` so the source is searchable. */\nexport function dlog(namespace: string, ...args: unknown[]): void {\n if (!isDebugEnabled(namespace)) return;\n // eslint-disable-next-line no-console\n console.debug(`[${namespace}]`, ...args);\n}\n","/**\n * Coordinate transforms (model ↔ plot) for Plot2D. Pure / deterministic —\n * no DOM, no React, no state.\n *\n * Model space: caller-defined xRange × yRange. Y axis goes UP.\n * Plot space: 0..width × 0..height in CSS pixels. Y axis goes DOWN (SVG).\n */\n\nexport interface Point {\n x: number;\n y: number;\n}\n\n/**\n * The caller-defined extent of model space, the coordinate system a plot's\n * data lives in.\n */\nexport interface ModelRange {\n xMin: number;\n xMax: number;\n yMin: number;\n yMax: number;\n}\n\n/** The plot's drawing area in CSS pixels. */\nexport interface PlotSize {\n width: number;\n height: number;\n}\n\n/**\n * Maps a model-space point into plot space, flipping the y axis so model y\n * grows upward while SVG y grows downward.\n */\nexport function modelToPlot(p: Point, m: ModelRange, plot: PlotSize): Point {\n const xFrac = (p.x - m.xMin) / (m.xMax - m.xMin);\n const yFrac = (p.y - m.yMin) / (m.yMax - m.yMin);\n return {\n x: xFrac * plot.width,\n // Invert y so model y=0 sits at plot bottom (SVG y grows downward).\n y: (1 - yFrac) * plot.height,\n };\n}\n\n/** The inverse of {@link modelToPlot}. */\nexport function plotToModel(p: Point, m: ModelRange, plot: PlotSize): Point {\n const xFrac = p.x / plot.width;\n const yFrac = 1 - p.y / plot.height;\n return {\n x: m.xMin + xFrac * (m.xMax - m.xMin),\n y: m.yMin + yFrac * (m.yMax - m.yMin),\n };\n}\n",".root {\n /* Component-local vars layered over theme tokens. Consumers override\n * either the plot-* var (component scope) or the wzl-* token (app\n * scope). */\n --plot-bg: var(--wzl-surface-sunken);\n --plot-grid: var(--wzl-line);\n /* Axes get full foreground contrast — they're the plot frame, the\n * most prominent structural element after caller-rendered content. */\n --plot-axis: var(--wzl-fg);\n\n display: block;\n /* Caller-rendered marks at the very edge (e.g. CurveEditor anchors)\n * extend past the SVG box by their radius — let them paint over the\n * host page instead of being half-clipped. */\n overflow: visible;\n background: var(--plot-bg);\n user-select: none;\n touch-action: none;\n outline: none;\n}\n\n/* Keyboard-only focus ring. Caller opts in via `tabIndex`. */\n.root:focus-visible {\n outline: 2px solid var(--wzl-focus-ring);\n outline-offset: 2px;\n}\n\n.grid {\n stroke: var(--plot-grid);\n stroke-width: 1;\n fill: none;\n}\n\n.axis {\n stroke: var(--plot-axis);\n stroke-width: var(--wzl-line-width);\n fill: none;\n}\n","import {\n forwardRef, useCallback, useEffect, useImperativeHandle, useMemo, useRef,\n type CSSProperties,\n type KeyboardEvent as ReactKeyboardEvent,\n type PointerEvent as ReactPointerEvent,\n type ReactNode,\n} from 'react';\nimport {\n modelToPlot, plotToModel,\n type ModelRange, type Point,\n} from './geometry';\nimport s from './Plot2D.module.css';\nimport { dlog } from '../../dlog';\n\n/** Background grid configuration for a {@link Plot2D}. */\nexport interface GridSettings {\n /** Number of evenly-spaced internal grid lines per axis (excluding\n * the edges). Applied to both x and y. Default 3. */\n divisions?: number;\n /** Stroke color override. When omitted, uses `var(--plot-grid)`. */\n color?: string;\n}\n\n/** Axis-line configuration for a {@link Plot2D}. */\nexport interface AxesSettings {\n /** Stroke color override. When omitted, uses `var(--plot-axis)`. */\n color?: string;\n}\n\n/** A pointer position given in both of the plot's coordinate systems. */\nexport interface Plot2DCoords {\n plot: Point;\n model: Point;\n}\n\n/** Props for {@link Plot2D}. */\nexport interface Plot2DProps {\n width: number;\n height: number;\n /** Model-space x range. Default [0, 1]. */\n xRange?: readonly [number, number];\n /** Model-space y range. Default [0, 1]. */\n yRange?: readonly [number, number];\n /** Background grid. `false` / `null` / omitted = no grid. Pass `{}`\n * for default (3 divisions per axis) or populated GridSettings. */\n grid?: GridSettings | false | null;\n /** Axis lines. `false` / `null` = no axes. Omitted = default-styled\n * axes (on). Pass AxesSettings to customize. */\n axes?: AxesSettings | false | null;\n /** Forwarded to the underlying svg. Consumer opts into focus this way. */\n tabIndex?: number;\n className?: string;\n style?: CSSProperties;\n /** Pointer down on the SVG. Receives both plot- and model-space coords\n * pre-computed so consumers don't repeat the rect/transform dance. */\n onPointerDown?: (e: ReactPointerEvent<SVGSVGElement>, coords: Plot2DCoords) => void;\n onKeyDown?: (e: ReactKeyboardEvent<SVGSVGElement>) => void;\n children?: ReactNode;\n}\n\n/**\n * Imperative handle on a {@link Plot2D}: the SVG element, its size, and the\n * coordinate conversions, including ones that start from a raw DOM event so a\n * drag tracked on `window` can still map back into the plot.\n */\nexport interface Plot2DHandle {\n readonly svg: SVGSVGElement | null;\n plotToModel(pt: Point): Point;\n modelToPlot(pt: Point): Point;\n /** Convert a DOM event's clientX/clientY (e.g. from a window-attached\n * pointermove during drag) to plot-space. */\n clientToPlot(e: { clientX: number; clientY: number }): Point;\n /** Convenience: clientToPlot → plotToModel. */\n clientToModel(e: { clientX: number; clientY: number }): Point;\n readonly width: number;\n readonly height: number;\n}\n\n/**\n * An SVG plotting surface with an optional grid and axes. It draws the frame\n * and owns the model-space to plot-space mapping; the plotted content is\n * whatever children are passed, positioned in plot space.\n */\nexport const Plot2D = forwardRef<Plot2DHandle, Plot2DProps>(function Plot2D(props, ref) {\n const {\n width, height,\n xRange = [0, 1],\n yRange = [0, 1],\n grid,\n axes,\n tabIndex,\n className,\n style,\n onPointerDown,\n onKeyDown,\n children,\n } = props;\n\n const svgRef = useRef<SVGSVGElement | null>(null);\n\n const modelRange: ModelRange = useMemo(\n () => ({ xMin: xRange[0], xMax: xRange[1], yMin: yRange[0], yMax: yRange[1] }),\n [xRange, yRange],\n );\n\n const plotSize = useMemo(() => ({ width, height }), [width, height]);\n\n const clientToPlot = useCallback((e: { clientX: number; clientY: number }): Point => {\n const rect = svgRef.current?.getBoundingClientRect();\n const left = rect?.left ?? 0;\n const top = rect?.top ?? 0;\n return { x: e.clientX - left, y: e.clientY - top };\n }, []);\n\n useEffect(() => {\n dlog('plot2d', 'mount', { width, height });\n return () => dlog('plot2d', 'unmount');\n // Mount/unmount trace: re-running on a resize would log a spurious mount.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n useImperativeHandle(ref, () => ({\n get svg() { return svgRef.current; },\n plotToModel: (pt: Point) => plotToModel(pt, modelRange, plotSize),\n modelToPlot: (pt: Point) => modelToPlot(pt, modelRange, plotSize),\n clientToPlot,\n clientToModel: (e) => plotToModel(clientToPlot(e), modelRange, plotSize),\n get width() { return plotSize.width; },\n get height() { return plotSize.height; },\n }), [modelRange, plotSize, clientToPlot]);\n\n const handlePointerDown = useCallback((e: ReactPointerEvent<SVGSVGElement>) => {\n if (!onPointerDown) return;\n const plot = clientToPlot(e);\n const model = plotToModel(plot, modelRange, plotSize);\n onPointerDown(e, { plot, model });\n }, [onPointerDown, clientToPlot, modelRange, plotSize]);\n\n const cls = [s.root, className].filter(Boolean).join(' ');\n\n return (\n <svg\n ref={svgRef}\n className={cls}\n style={style}\n width={width}\n height={height}\n viewBox={`0 0 ${width} ${height}`}\n role=\"img\"\n tabIndex={tabIndex}\n onPointerDown={onPointerDown ? handlePointerDown : undefined}\n onKeyDown={onKeyDown}\n >\n {grid && (() => {\n const divisions = grid.divisions ?? 3;\n const stroke = grid.color;\n // Evenly-spaced internal divisions, excluding the edges (which\n // belong to the axes). For divisions=3, fractions are 1/4, 2/4, 3/4.\n const fractions: number[] = [];\n for (let i = 1; i <= divisions; i++) fractions.push(i / (divisions + 1));\n return (\n <g>\n {fractions.map((f) => (\n <line\n key={`gx-${f}`}\n data-plot-element=\"grid\"\n className={s.grid}\n stroke={stroke}\n x1={f * width} x2={f * width}\n y1={0} y2={height}\n />\n ))}\n {fractions.map((f) => (\n <line\n key={`gy-${f}`}\n data-plot-element=\"grid\"\n className={s.grid}\n stroke={stroke}\n x1={0} x2={width}\n y1={f * height} y2={f * height}\n />\n ))}\n </g>\n );\n })()}\n {axes !== false && axes !== null && (() => {\n const stroke = axes?.color;\n return (\n <g>\n <line\n data-plot-element=\"axis\"\n className={s.axis}\n stroke={stroke}\n x1={0} x2={width}\n y1={height} y2={height}\n />\n <line\n data-plot-element=\"axis\"\n className={s.axis}\n stroke={stroke}\n x1={0} x2={0}\n y1={0} y2={height}\n />\n </g>\n );\n })()}\n {children}\n </svg>\n );\n});\n"],"mappings":";;;AA4BA,IAAM,IAAO,CAAC,gBAAgB,mBAAmB,EAO7C,IAAwB;AAE5B,SAAS,IAAe;CACtB,IAAM,IAAgB;EAAE,KAAK;EAAO,qBAAK,IAAI,KAAK;EAAE;AACpD,KAAI,OAAO,eAAiB,IAAa,QAAO;AAChD,KAAI;AACF,OAAK,IAAM,KAAK,GAAM;GACpB,IAAM,IAAI,aAAa,QAAQ,EAAE;AAC7B,cAAK,QAAQ,MAAM,IAEvB,QADI,MAAM,OAAO,MAAM,UAAU,MAAM,MAAY;IAAE,KAAK;IAAM,qBAAK,IAAI,KAAK;IAAE,GACzE;IAAE,KAAK;IAAO,KAAK,IAAI,IAAI,EAAE,MAAM,SAAS,CAAC,OAAO,QAAQ,CAAC;IAAE;;AAExE,SAAO;SACD;AACN,SAAO;;;AAIX,SAAS,IAAc;AAErB,QADI,MAAW,SAAM,IAAS,GAAM,GAC7B;;AAIT,SAAgB,EAAe,GAA4B;CACzD,IAAM,IAAI,GAAK;AACf,QAAO,EAAE,OAAO,EAAE,IAAI,IAAI,EAAU;;AAKtC,SAAgB,EAAK,GAAmB,GAAG,GAAuB;AAC3D,GAAe,EAAU,IAE9B,QAAQ,MAAM,IAAI,EAAU,IAAI,GAAG,EAAK;;;;ACnC1C,SAAgB,EAAY,GAAU,GAAe,GAAuB;CAC1E,IAAM,KAAS,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,OACrC,KAAS,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE;AAC3C,QAAO;EACL,GAAG,IAAQ,EAAK;EAE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qBAAkB;KAClB,WAAW,EAAE;KACL;KACR,IAAI;KAAG,IAAI;KACX,IAAI;KAAG,IAAI;KACX,CAAA,CACA,EAAA,CAAA;OAEJ;GACH;GACG;;EAER"}
|
|
@@ -1,259 +0,0 @@
|
|
|
1
|
-
import { jsx as e, jsxs as t } from "react/jsx-runtime";
|
|
2
|
-
import { useCallback as n, useEffect as r, useRef as i } from "react";
|
|
3
|
-
var a = {
|
|
4
|
-
root: "_root_1qeyx_1",
|
|
5
|
-
row: "_row_1qeyx_8",
|
|
6
|
-
track: "_track_1qeyx_14",
|
|
7
|
-
trackInner: "_trackInner_1qeyx_25",
|
|
8
|
-
thumb: "_thumb_1qeyx_35",
|
|
9
|
-
thumbActive: "_thumbActive_1qeyx_74",
|
|
10
|
-
readoutsBelow: "_readoutsBelow_1qeyx_79",
|
|
11
|
-
readoutBelow: "_readoutBelow_1qeyx_85",
|
|
12
|
-
readoutInline: "_readoutInline_1qeyx_93",
|
|
13
|
-
notched: "_notched_1qeyx_101"
|
|
14
|
-
}, o = "−";
|
|
15
|
-
function s(e, t) {
|
|
16
|
-
return (Number.isFinite(e) ? e.toLocaleString(void 0, t) : String(e)).replace(/^-/, "−");
|
|
17
|
-
}
|
|
18
|
-
//#endregion
|
|
19
|
-
//#region src/components/Slider/Slider.tsx
|
|
20
|
-
function c(e, t, n) {
|
|
21
|
-
return t === void 0 || t <= 0 ? e : Math.round((e - n) / t) * t + n;
|
|
22
|
-
}
|
|
23
|
-
function l(e, t, n) {
|
|
24
|
-
return Math.max(t, Math.min(n, e));
|
|
25
|
-
}
|
|
26
|
-
var u = 8;
|
|
27
|
-
function d(e, t, n) {
|
|
28
|
-
return !e || e.length === 0 ? [] : [...new Set(e.filter((e) => e >= t && e <= n))].sort((e, t) => e - t);
|
|
29
|
-
}
|
|
30
|
-
function f(e, t, n) {
|
|
31
|
-
let r = e, i = n;
|
|
32
|
-
for (let n of t) {
|
|
33
|
-
let t = Math.abs(n - e);
|
|
34
|
-
t <= i && (r = n, i = t);
|
|
35
|
-
}
|
|
36
|
-
return r;
|
|
37
|
-
}
|
|
38
|
-
function p(e, t, n, r) {
|
|
39
|
-
if (n > 0) {
|
|
40
|
-
let n = e.findIndex((e) => e > t);
|
|
41
|
-
return n === -1 ? e[e.length - 1] : e[Math.min(e.length - 1, n + r - 1)];
|
|
42
|
-
}
|
|
43
|
-
let i = -1;
|
|
44
|
-
for (let n = e.length - 1; n >= 0; n--) if (e[n] < t) {
|
|
45
|
-
i = n;
|
|
46
|
-
break;
|
|
47
|
-
}
|
|
48
|
-
return i === -1 ? e[0] : e[Math.max(0, i - (r - 1))];
|
|
49
|
-
}
|
|
50
|
-
function m(e, t, n) {
|
|
51
|
-
return e !== void 0 && e > 0 ? e : (n - t) / 100;
|
|
52
|
-
}
|
|
53
|
-
function h(e, t, n, r, i, a) {
|
|
54
|
-
let o = a !== void 0 && a > 0 ? a : (i - r) / 1e3;
|
|
55
|
-
return l(e, n > 0 ? t[n - 1].value + o : r, n < t.length - 1 ? t[n + 1].value - o : i);
|
|
56
|
-
}
|
|
57
|
-
function g(e, t, n, r) {
|
|
58
|
-
if (!e.bounds) return [n, r];
|
|
59
|
-
let i = typeof e.bounds == "function" ? e.bounds(t) : e.bounds;
|
|
60
|
-
return [i[0], i[1]];
|
|
61
|
-
}
|
|
62
|
-
function _(e) {
|
|
63
|
-
return s(e.value, {
|
|
64
|
-
minimumFractionDigits: 3,
|
|
65
|
-
maximumFractionDigits: 3
|
|
66
|
-
});
|
|
67
|
-
}
|
|
68
|
-
function v(o) {
|
|
69
|
-
let { thumbs: s, onInput: v, onChange: y, min: b, max: x, step: S, constraint: C, trackHeight: w, ariaLabel: T, className: E } = o, D = d(o.stops, b, x), O = i(null), k = i(null), A = i(null);
|
|
70
|
-
r(() => () => {
|
|
71
|
-
A.current?.();
|
|
72
|
-
}, []);
|
|
73
|
-
let j = n((e) => x === b ? 0 : l((e - b) / (x - b), 0, 1), [b, x]), M = n((e) => b + l(e, 0, 1) * (x - b), [b, x]), N = n((e) => {
|
|
74
|
-
k.current = s.map((e) => ({ ...e }));
|
|
75
|
-
let t = !1, n = (n) => {
|
|
76
|
-
let r = O.current, i = k.current;
|
|
77
|
-
if (!r || !i) return;
|
|
78
|
-
let a = r.getBoundingClientRect(), s = M(l((n.clientX - a.left) / a.width, 0, 1));
|
|
79
|
-
s = c(s, S, b), s = l(s, b, x), D.length > 0 && (s = f(s, D, u / a.width * (x - b)));
|
|
80
|
-
let [d, p] = g(i[e], {
|
|
81
|
-
thumbs: i,
|
|
82
|
-
index: e
|
|
83
|
-
}, b, x);
|
|
84
|
-
s = l(s, d, p), C === "ordered" && (s = h(s, i, e, b, x, S));
|
|
85
|
-
let m = a.height;
|
|
86
|
-
o.onRemoveThumb && (t = n.clientY < a.top - m || n.clientY > a.bottom + m), i[e] = {
|
|
87
|
-
...i[e],
|
|
88
|
-
value: s
|
|
89
|
-
}, v(i.map((e) => ({ ...e })));
|
|
90
|
-
}, r = () => {
|
|
91
|
-
document.removeEventListener("pointermove", n), document.removeEventListener("pointerup", a), document.removeEventListener("pointercancel", i), A.current = null;
|
|
92
|
-
}, i = () => {
|
|
93
|
-
r(), k.current = null;
|
|
94
|
-
}, a = () => {
|
|
95
|
-
r();
|
|
96
|
-
let n = k.current;
|
|
97
|
-
if (k.current = null, n) {
|
|
98
|
-
if (t && o.onRemoveThumb && o.onRemoveThumb(e)) {
|
|
99
|
-
let t = n.filter((t, n) => n !== e).map((e) => ({ ...e }));
|
|
100
|
-
v(t), y?.(t);
|
|
101
|
-
return;
|
|
102
|
-
}
|
|
103
|
-
y?.(n.map((e) => ({ ...e })));
|
|
104
|
-
}
|
|
105
|
-
};
|
|
106
|
-
document.addEventListener("pointermove", n), document.addEventListener("pointerup", a), document.addEventListener("pointercancel", i), A.current = i;
|
|
107
|
-
}, [
|
|
108
|
-
s,
|
|
109
|
-
v,
|
|
110
|
-
y,
|
|
111
|
-
M,
|
|
112
|
-
b,
|
|
113
|
-
x,
|
|
114
|
-
S,
|
|
115
|
-
D,
|
|
116
|
-
C,
|
|
117
|
-
o
|
|
118
|
-
]), P = n((e) => {
|
|
119
|
-
let t = s.map((e) => ({ ...e })), n = t.map((e) => e.value);
|
|
120
|
-
k.current = t;
|
|
121
|
-
let r = (t) => {
|
|
122
|
-
let r = O.current, i = k.current;
|
|
123
|
-
if (!r || !i) return;
|
|
124
|
-
let a = r.getBoundingClientRect(), o = (t.clientX - e) / a.width * (x - b);
|
|
125
|
-
o = c(o, S, 0);
|
|
126
|
-
let s = -Infinity, u = Infinity;
|
|
127
|
-
for (let e = 0; e < n.length; e++) s = Math.max(s, b - n[e]), u = Math.min(u, x - n[e]);
|
|
128
|
-
o = l(o, s, u);
|
|
129
|
-
for (let e = 0; e < i.length; e++) i[e] = {
|
|
130
|
-
...i[e],
|
|
131
|
-
value: l(n[e] + o, b, x)
|
|
132
|
-
};
|
|
133
|
-
v(i.map((e) => ({ ...e })));
|
|
134
|
-
}, i = () => {
|
|
135
|
-
document.removeEventListener("pointermove", r), document.removeEventListener("pointerup", o), document.removeEventListener("pointercancel", a), A.current = null;
|
|
136
|
-
}, a = () => {
|
|
137
|
-
i(), k.current = null;
|
|
138
|
-
}, o = () => {
|
|
139
|
-
i();
|
|
140
|
-
let e = k.current;
|
|
141
|
-
k.current = null, e && y?.(e.map((e) => ({ ...e })));
|
|
142
|
-
};
|
|
143
|
-
document.addEventListener("pointermove", r), document.addEventListener("pointerup", o), document.addEventListener("pointercancel", a), A.current = a;
|
|
144
|
-
}, [
|
|
145
|
-
s,
|
|
146
|
-
v,
|
|
147
|
-
y,
|
|
148
|
-
b,
|
|
149
|
-
x,
|
|
150
|
-
S
|
|
151
|
-
]), F = (e) => (t) => {
|
|
152
|
-
typeof t.button == "number" && t.button > 0 || (t.currentTarget.focus?.(), t.preventDefault(), t.stopPropagation(), t.shiftKey && o.allowShiftAll ? P(t.clientX) : N(e));
|
|
153
|
-
}, I = (e) => (t) => {
|
|
154
|
-
if (!o.onRemoveThumb || (t.preventDefault(), !o.onRemoveThumb(e))) return;
|
|
155
|
-
let n = s.filter((t, n) => n !== e).map((e) => ({ ...e }));
|
|
156
|
-
v(n), y?.(n);
|
|
157
|
-
}, L = (e) => {
|
|
158
|
-
if (typeof e.button == "number" && e.button > 0 || !o.onAddThumb || e.target.closest(`.${a.thumb}`)) return;
|
|
159
|
-
e.preventDefault();
|
|
160
|
-
let t = O.current;
|
|
161
|
-
if (!t) return;
|
|
162
|
-
let n = t.getBoundingClientRect(), r = M(l((e.clientX - n.left) / n.width, 0, 1));
|
|
163
|
-
r = c(r, S, b), r = l(r, b, x), D.length > 0 && (r = f(r, D, u / n.width * (x - b)));
|
|
164
|
-
let i = o.onAddThumb(r);
|
|
165
|
-
if (!i) return;
|
|
166
|
-
let d = [...s.map((e) => ({ ...e })), i];
|
|
167
|
-
v(d), y?.(d);
|
|
168
|
-
}, R = (e) => (t) => {
|
|
169
|
-
let n = m(S, b, x), r = 0, i = 0, a = null;
|
|
170
|
-
switch (t.key) {
|
|
171
|
-
case "ArrowRight":
|
|
172
|
-
case "ArrowUp":
|
|
173
|
-
r = t.shiftKey ? n * 10 : n, i = t.shiftKey ? 10 : 1;
|
|
174
|
-
break;
|
|
175
|
-
case "ArrowLeft":
|
|
176
|
-
case "ArrowDown":
|
|
177
|
-
r = t.shiftKey ? -n * 10 : -n, i = t.shiftKey ? -10 : -1;
|
|
178
|
-
break;
|
|
179
|
-
case "PageUp":
|
|
180
|
-
r = n * 10, i = 10;
|
|
181
|
-
break;
|
|
182
|
-
case "PageDown":
|
|
183
|
-
r = -n * 10, i = -10;
|
|
184
|
-
break;
|
|
185
|
-
case "Home":
|
|
186
|
-
a = "home";
|
|
187
|
-
break;
|
|
188
|
-
case "End":
|
|
189
|
-
a = "end";
|
|
190
|
-
break;
|
|
191
|
-
default: return;
|
|
192
|
-
}
|
|
193
|
-
t.preventDefault();
|
|
194
|
-
let o = s.map((e) => ({ ...e })), [u, d] = g(o[e], {
|
|
195
|
-
thumbs: o,
|
|
196
|
-
index: e
|
|
197
|
-
}, b, x), f = Math.max(b, u), _ = Math.min(x, d), w;
|
|
198
|
-
w = a === "home" ? f : a === "end" ? _ : D.length > 0 ? p(D, o[e].value, i > 0 ? 1 : -1, Math.abs(i)) : c(o[e].value + r, S, b), w = l(w, f, _), C === "ordered" && (w = h(w, o, e, f, _, S)), o[e] = {
|
|
199
|
-
...o[e],
|
|
200
|
-
value: w
|
|
201
|
-
}, v(o), y?.(o);
|
|
202
|
-
}, z = o.readoutPlacement ?? "none", B = o.renderReadout;
|
|
203
|
-
return /* @__PURE__ */ t("div", {
|
|
204
|
-
className: E ? `${a.root} ${E}` : a.root,
|
|
205
|
-
style: w === void 0 ? void 0 : { "--rp-track-height": `${w}px` },
|
|
206
|
-
children: [/* @__PURE__ */ t("div", {
|
|
207
|
-
className: a.row,
|
|
208
|
-
children: [/* @__PURE__ */ t("div", {
|
|
209
|
-
className: a.track,
|
|
210
|
-
ref: O,
|
|
211
|
-
onPointerDown: L,
|
|
212
|
-
children: [o.renderTrack && /* @__PURE__ */ e("div", {
|
|
213
|
-
className: a.trackInner,
|
|
214
|
-
children: o.renderTrack({
|
|
215
|
-
trackWidth: O.current?.getBoundingClientRect().width ?? 0,
|
|
216
|
-
valueToFraction: j
|
|
217
|
-
})
|
|
218
|
-
}), s.map((t, n) => {
|
|
219
|
-
let r = t.shape === "notched", i = typeof t.shape == "object" && t.shape !== null ? t.shape.render : null, o = `${a.thumb}${r ? ` ${a.notched}` : ""}`;
|
|
220
|
-
return /* @__PURE__ */ e("div", {
|
|
221
|
-
role: "slider",
|
|
222
|
-
tabIndex: 0,
|
|
223
|
-
"aria-orientation": "horizontal",
|
|
224
|
-
"aria-valuemin": b,
|
|
225
|
-
"aria-valuemax": x,
|
|
226
|
-
"aria-valuenow": t.value,
|
|
227
|
-
"aria-label": [T, t.label].filter(Boolean).join(" ") || void 0,
|
|
228
|
-
className: o,
|
|
229
|
-
style: { left: `${j(t.value) * 100}%` },
|
|
230
|
-
onPointerDown: F(n),
|
|
231
|
-
onKeyDown: R(n),
|
|
232
|
-
onContextMenu: I(n),
|
|
233
|
-
children: i ? i({
|
|
234
|
-
width: 14,
|
|
235
|
-
height: 24,
|
|
236
|
-
isActive: !1
|
|
237
|
-
}) : t.label ?? ""
|
|
238
|
-
}, n);
|
|
239
|
-
})]
|
|
240
|
-
}), z === "inline-after" && /* @__PURE__ */ e("span", {
|
|
241
|
-
"data-readout": "inline",
|
|
242
|
-
className: a.readoutInline,
|
|
243
|
-
children: s.map((e, n) => /* @__PURE__ */ t("span", { children: [n > 0 ? " / " : "", B ? B(e, n) : _(e)] }, n))
|
|
244
|
-
})]
|
|
245
|
-
}), z === "below-thumb" && /* @__PURE__ */ e("div", {
|
|
246
|
-
className: a.readoutsBelow,
|
|
247
|
-
children: s.map((t, n) => /* @__PURE__ */ e("span", {
|
|
248
|
-
"data-readout": "below",
|
|
249
|
-
className: a.readoutBelow,
|
|
250
|
-
style: { left: `${j(t.value) * 100}%` },
|
|
251
|
-
children: B ? B(t, n) : _(t)
|
|
252
|
-
}, n))
|
|
253
|
-
})]
|
|
254
|
-
});
|
|
255
|
-
}
|
|
256
|
-
//#endregion
|
|
257
|
-
export { o as n, s as r, v as t };
|
|
258
|
-
|
|
259
|
-
//# sourceMappingURL=Slider-cxWR47gi.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Slider-cxWR47gi.js","names":[],"sources":["../../src/components/Slider/Slider.module.css","../../src/format/number.ts","../../src/components/Slider/Slider.tsx"],"sourcesContent":[".root {\n position: relative;\n user-select: none;\n -webkit-user-select: none;\n touch-action: none;\n}\n\n.row {\n display: flex;\n align-items: center;\n gap: 8px;\n}\n\n.track {\n position: relative;\n flex: 1;\n min-width: 0;\n height: var(--rp-track-height, 24px);\n background: var(--wzl-surface-sunken);\n border: 1px solid var(--wzl-border);\n border-radius: var(--wzl-radius-sm);\n cursor: crosshair;\n /* No `overflow: hidden` here — thumbs at extreme values would get\n * clipped at the track edges. The gradient/track-paint clip is\n * applied to `.trackInner` instead, which lets thumbs spill freely. */\n}\n\n.trackInner {\n position: absolute;\n inset: 0;\n border-radius: var(--wzl-radius-sm);\n overflow: hidden;\n}\n\n.thumb {\n position: absolute;\n /* Thumb extends 2px above + below the track for grabbability + visual\n * weight. Track itself stays its natural height; the thumb just spills. */\n top: -2px;\n bottom: -2px;\n width: 14px;\n margin-left: -7px;\n display: flex;\n align-items: center;\n justify-content: center;\n background: color-mix(in srgb, var(--wzl-fg-muted) 70%, transparent);\n border: 1px solid var(--wzl-border-strong);\n border-radius: var(--wzl-radius-sm);\n cursor: ew-resize;\n /* Frosted-glass over the (often colorful) track. Cheap on modern GPUs;\n * gracefully degrades to just the partial-alpha background on engines\n * without backdrop-filter support. */\n backdrop-filter: blur(3px);\n -webkit-backdrop-filter: blur(3px);\n /* Subtle raise — sells the \"thumb is on top of the track\" hierarchy. */\n box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);\n font: var(--wzl-font-weight-medium) var(--wzl-font-size-xs)/var(--wzl-leading-tight) ui-sans-serif, system-ui, sans-serif;\n font-variant-numeric: tabular-nums;\n /* Thumb text reads against `--wzl-thumb-fill`, which can differ from the\n * surrounding panel text color. Default = dark; consumers re-skin via\n * `--wzl-thumb-text` if they pick a dark thumb fill. */\n color: var(--wzl-fg-inverse);\n /* White halo so labels stay legible over wildly varying gradient\n * backgrounds (e.g. labels 'T' / 'P' / 'B' over teal, hue 200° over\n * yellow-green, etc.). */\n text-shadow: 0 0 2px rgba(255, 255, 255, 0.7);\n}\n\n.thumb:focus-visible {\n outline: 2px solid var(--wzl-accent);\n outline-offset: 1px;\n}\n\n.thumbActive {\n /* Visual marker for the dragging/focused thumb; subclass-overridable. */\n z-index: 1;\n}\n\n.readoutsBelow {\n position: relative;\n height: 14px;\n margin-top: 4px;\n}\n\n.readoutBelow {\n position: absolute;\n transform: translateX(-50%);\n font: var(--wzl-font-weight-medium) var(--wzl-font-size-xs)/var(--wzl-leading-tight) ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;\n color: var(--wzl-fg-muted);\n white-space: nowrap;\n}\n\n.readoutInline {\n display: inline-block;\n margin-left: 8px;\n font: var(--wzl-font-weight-medium) var(--wzl-font-size-sm)/var(--wzl-leading-tight) ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;\n color: var(--wzl-fg-muted);\n vertical-align: middle;\n}\n\n.notched {\n background: var(--thumb-svg, none);\n background-size: 100% 100%;\n background-repeat: no-repeat;\n background-color: transparent;\n border: none;\n /* Notched thumbs need to disable the .thumb defaults that paint to\n * the bounding box: backdrop-filter and box-shadow both ignore the\n * SVG's polygon/notch and would render through the notch cutout.\n * Use filter: drop-shadow instead — it traces the actual rendered\n * alpha (i.e. the polygon shape including the cut). */\n backdrop-filter: none;\n -webkit-backdrop-filter: none;\n box-shadow: none;\n filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.25));\n /* Default notched SVG (down-pointing pentagon, matches the perceptual-color experiment). */\n --thumb-svg: url(\"data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 30' preserveAspectRatio='none'%3E%3Cpolygon points='0,0 2.52,0 7,10.3 11.48,0 14,0 14,30 0,30' fill='rgba(255,255,255,0.62)' stroke='rgba(0,0,0,0.55)' stroke-width='0.75' stroke-linejoin='miter'/%3E%3C/svg%3E\");\n}\n","/**\n * Display-formatter for numbers. Use this anywhere a number is shown to\n * a user. The whole point: negative values get prefixed with the real\n * MINUS SIGN (U+2212) instead of the ASCII HYPHEN-MINUS (U+002D) that\n * `toLocaleString` and template literals produce by default.\n *\n * U+2212 is the same visual width as `+` and reads as a sign rather\n * than a hyphen — columns of signed numbers align cleanly and the\n * glyph doesn't get confused with a bullet or list dash.\n */\nexport const MINUS_SIGN = '−';\n\n/**\n * Formats a number for display, substituting {@link MINUS_SIGN} for the ASCII\n * hyphen `toLocaleString` emits. Non-finite values stringify as-is.\n */\nexport function formatNumber(value: number, options?: Intl.NumberFormatOptions): string {\n const formatted = Number.isFinite(value)\n ? value.toLocaleString(undefined, options)\n : String(value);\n return formatted.replace(/^-/, MINUS_SIGN);\n}\n","import { useCallback, useEffect, useRef, type CSSProperties, type KeyboardEvent as ReactKeyboardEvent, type MouseEvent as ReactMouseEvent, type PointerEvent as ReactPointerEvent, type ReactElement, type ReactNode } from 'react';\nimport s from './Slider.module.css';\nimport { formatNumber } from '../../format/number';\n\n/**\n * Passed to a custom thumb renderer: the thumb box in CSS px, and whether\n * this thumb is the one being dragged.\n */\nexport type ThumbRenderCtx = {\n width: number;\n height: number;\n isActive: boolean;\n};\n\n/**\n * A thumb's appearance — one of the two built-in shapes, or a custom\n * renderer.\n */\nexport type ThumbShape =\n | 'round'\n | 'notched'\n | { render: (ctx: ThumbRenderCtx) => ReactNode };\n\n/**\n * One handle on a {@link Slider}. `bounds` narrows the range this particular\n * thumb may move within, either fixed or computed from the current thumb\n * list.\n */\nexport type Thumb = {\n value: number;\n label?: string;\n shape?: ThumbShape;\n bounds?: [number, number] | ((ctx: BoundsCtx) => [number, number]);\n};\n\n/**\n * Passed to a thumb's `bounds` function: the full thumb list and this thumb's\n * index in it, so a bound can be expressed relative to its neighbors.\n */\nexport type BoundsCtx = {\n thumbs: readonly Thumb[];\n index: number;\n};\n\n/**\n * Passed to `renderTrack`: the track's width in CSS px and a mapping from a\n * slider value to its 0..1 position along the track.\n */\nexport type TrackCtx = {\n trackWidth: number;\n valueToFraction: (v: number) => number;\n};\n\n/**\n * Props for {@link Slider}.\n *\n * `onInput` fires continuously through a drag; `onChange` fires once when it\n * ends and is the one to write to history.\n *\n * `stops` are attractors: a drag that passes within a few pixels of one lands\n * on it, and the arrow keys move stop to stop. `step` still quantizes the\n * values between them.\n *\n * `constraint: 'ordered'` keeps thumbs from crossing each other. Supplying\n * `onAddThumb` makes a click on empty track create a thumb, and supplying\n * `onRemoveThumb` lets a right-click or a drag off the track remove one —\n * both callbacks can decline by returning `null`/`false`. `allowShiftAll`\n * makes shift-drag translate every thumb together.\n */\nexport type SliderProps<T extends Thumb = Thumb> = {\n thumbs: readonly T[];\n onInput: (next: T[]) => void;\n onChange?: (next: T[]) => void;\n min: number;\n max: number;\n step?: number;\n stops?: number[];\n constraint?: 'free' | 'ordered';\n onAddThumb?: (atValue: number) => T | null;\n onRemoveThumb?: (index: number) => boolean;\n allowShiftAll?: boolean;\n renderTrack?: (ctx: TrackCtx) => ReactNode;\n trackHeight?: number;\n renderReadout?: (thumb: T, index: number) => ReactNode;\n readoutPlacement?: 'none' | 'inline-after' | 'below-thumb';\n ariaLabel?: string;\n className?: string;\n};\n\nfunction snap(v: number, step: number | undefined, min: number): number {\n if (step === undefined || step <= 0) return v;\n return Math.round((v - min) / step) * step + min;\n}\n\nfunction clamp(v: number, lo: number, hi: number): number {\n return Math.max(lo, Math.min(hi, v));\n}\n\n/** How close a drag has to come to a stop, in track pixels, to land on it. */\nconst STOP_SNAP_PX = 8;\n\n/** The stops that are actually reachable: inside the range, deduped, ascending. */\nfunction usableStops(stops: number[] | undefined, min: number, max: number): number[] {\n if (!stops || stops.length === 0) return [];\n return [...new Set(stops.filter(v => v >= min && v <= max))].sort((a, b) => a - b);\n}\n\n/** Pull `v` onto the nearest stop within `tolerance`, or leave it where it is. */\nfunction attract(v: number, stops: number[], tolerance: number): number {\n let best = v;\n let bestGap = tolerance;\n for (const stop of stops) {\n const gap = Math.abs(stop - v);\n if (gap <= bestGap) {\n best = stop;\n bestGap = gap;\n }\n }\n return best;\n}\n\n/** The stop `count` places past `v` in `direction`, saturating at either end. */\nfunction stepStops(stops: number[], v: number, direction: 1 | -1, count: number): number {\n if (direction > 0) {\n const first = stops.findIndex(stop => stop > v);\n if (first === -1) return stops[stops.length - 1];\n return stops[Math.min(stops.length - 1, first + count - 1)];\n }\n let first = -1;\n for (let i = stops.length - 1; i >= 0; i--) {\n if (stops[i] < v) {\n first = i;\n break;\n }\n }\n if (first === -1) return stops[0];\n return stops[Math.max(0, first - (count - 1))];\n}\n\nfunction defaultStep(step: number | undefined, min: number, max: number): number {\n if (step !== undefined && step > 0) return step;\n return (max - min) / 100;\n}\n\n/** Keep a thumb inside its neighbors when `constraint` is `'ordered'`. */\nfunction clampOrdered(\n v: number,\n thumbs: readonly Thumb[],\n index: number,\n min: number,\n max: number,\n step: number | undefined,\n): number {\n const gap = step !== undefined && step > 0 ? step : (max - min) / 1000;\n const lower = index > 0 ? thumbs[index - 1].value + gap : min;\n const upper = index < thumbs.length - 1 ? thumbs[index + 1].value - gap : max;\n return clamp(v, lower, upper);\n}\n\nfunction resolveBounds(thumb: Thumb, ctx: BoundsCtx, fallbackMin: number, fallbackMax: number): [number, number] {\n if (!thumb.bounds) return [fallbackMin, fallbackMax];\n const tuple = typeof thumb.bounds === 'function' ? thumb.bounds(ctx) : thumb.bounds;\n return [tuple[0], tuple[1]];\n}\n\nfunction defaultReadout(thumb: Thumb): string {\n return formatNumber(thumb.value, { minimumFractionDigits: 3, maximumFractionDigits: 3 });\n}\n\n/**\n * Multi-thumb slider over a shared track. The thumb list is fully controlled:\n * every change, live or committed, arrives as a whole new array.\n *\n * Thumbs are draggable, and arrow/Home/End move the focused thumb — those\n * keystrokes fire `onInput` and `onChange` together, since there is no\n * in-flight state to buffer.\n */\nexport function Slider<T extends Thumb = Thumb>(props: SliderProps<T>): ReactElement {\n const { thumbs, onInput, onChange, min, max, step, constraint, trackHeight, ariaLabel, className } = props;\n\n const stops = usableStops(props.stops, min, max);\n\n const trackRef = useRef<HTMLDivElement | null>(null);\n // In-flight thumb buffer during a drag; null when not dragging.\n const dragBufferRef = useRef<T[] | null>(null);\n // Teardown for the in-flight drag's document listeners, so unmounting\n // mid-drag doesn't leave them running against a gone track.\n const endDragRef = useRef<(() => void) | null>(null);\n\n useEffect(() => () => { endDragRef.current?.(); }, []);\n\n const valueToFraction = useCallback(\n (v: number): number => (max === min ? 0 : clamp((v - min) / (max - min), 0, 1)),\n [min, max],\n );\n\n const fractionToValue = useCallback(\n (f: number): number => min + clamp(f, 0, 1) * (max - min),\n [min, max],\n );\n\n const beginThumbDrag = useCallback(\n (index: number) => {\n const buf: T[] = thumbs.map(t => ({ ...t }));\n dragBufferRef.current = buf;\n let droppedOff = false;\n\n const onMove = (ev: PointerEvent) => {\n const track = trackRef.current;\n const buffer = dragBufferRef.current;\n if (!track || !buffer) return;\n const rect = track.getBoundingClientRect();\n const f = clamp((ev.clientX - rect.left) / rect.width, 0, 1);\n let v = fractionToValue(f);\n v = snap(v, step, min);\n v = clamp(v, min, max);\n if (stops.length > 0) v = attract(v, stops, (STOP_SNAP_PX / rect.width) * (max - min));\n\n const [bLo, bHi] = resolveBounds(buffer[index], { thumbs: buffer, index }, min, max);\n v = clamp(v, bLo, bHi);\n\n if (constraint === 'ordered') v = clampOrdered(v, buffer, index, min, max, step);\n\n // Drop-off detection: pointer exits the track vertically by more than trackHeight.\n const bandHeight = rect.height;\n if (props.onRemoveThumb) {\n if (ev.clientY < rect.top - bandHeight || ev.clientY > rect.bottom + bandHeight) {\n droppedOff = true;\n } else {\n droppedOff = false;\n }\n }\n\n buffer[index] = { ...buffer[index], value: v };\n onInput(buffer.map(t => ({ ...t })));\n };\n\n const unlisten = () => {\n document.removeEventListener('pointermove', onMove);\n document.removeEventListener('pointerup', onUp);\n document.removeEventListener('pointercancel', onCancel);\n endDragRef.current = null;\n };\n\n // A canceled pointer never fires `pointerup`; without this the drag\n // stays live and the thumb tracks a released pointer.\n const onCancel = () => {\n unlisten();\n dragBufferRef.current = null;\n };\n\n const onUp = () => {\n unlisten();\n const buffer = dragBufferRef.current;\n dragBufferRef.current = null;\n if (!buffer) return;\n\n if (droppedOff && props.onRemoveThumb) {\n const accepted = props.onRemoveThumb(index);\n if (accepted) {\n const next = buffer.filter((_, i) => i !== index).map(t => ({ ...t })) as T[];\n onInput(next);\n onChange?.(next);\n return;\n }\n }\n\n onChange?.(buffer.map(t => ({ ...t })));\n };\n\n document.addEventListener('pointermove', onMove);\n document.addEventListener('pointerup', onUp);\n document.addEventListener('pointercancel', onCancel);\n endDragRef.current = onCancel;\n },\n [thumbs, onInput, onChange, fractionToValue, min, max, step, stops, constraint, props],\n );\n\n const beginShiftAllDrag = useCallback(\n (anchorX: number) => {\n const buf: T[] = thumbs.map(t => ({ ...t }));\n const startValues = buf.map(t => t.value);\n dragBufferRef.current = buf;\n\n const onMove = (ev: PointerEvent) => {\n const track = trackRef.current;\n const buffer = dragBufferRef.current;\n if (!track || !buffer) return;\n const rect = track.getBoundingClientRect();\n const dxFraction = (ev.clientX - anchorX) / rect.width;\n let dValue = dxFraction * (max - min);\n dValue = snap(dValue, step, 0);\n\n // Clamp delta so no thumb leaves [min, max] (per-thumb bounds intentionally\n // not enforced — matches the experiment's hue-band shift-translate semantics).\n let allowedNeg = -Infinity;\n let allowedPos = Infinity;\n for (let i = 0; i < startValues.length; i++) {\n allowedNeg = Math.max(allowedNeg, min - startValues[i]);\n allowedPos = Math.min(allowedPos, max - startValues[i]);\n }\n dValue = clamp(dValue, allowedNeg, allowedPos);\n\n for (let i = 0; i < buffer.length; i++) {\n buffer[i] = { ...buffer[i], value: clamp(startValues[i] + dValue, min, max) };\n }\n onInput(buffer.map(t => ({ ...t })));\n };\n\n const unlisten = () => {\n document.removeEventListener('pointermove', onMove);\n document.removeEventListener('pointerup', onUp);\n document.removeEventListener('pointercancel', onCancel);\n endDragRef.current = null;\n };\n\n const onCancel = () => {\n unlisten();\n dragBufferRef.current = null;\n };\n\n const onUp = () => {\n unlisten();\n const buffer = dragBufferRef.current;\n dragBufferRef.current = null;\n if (buffer) onChange?.(buffer.map(t => ({ ...t })));\n };\n\n document.addEventListener('pointermove', onMove);\n document.addEventListener('pointerup', onUp);\n document.addEventListener('pointercancel', onCancel);\n endDragRef.current = onCancel;\n },\n [thumbs, onInput, onChange, min, max, step],\n );\n\n const onThumbPointerDown = (index: number) => (e: ReactPointerEvent) => {\n // Only bail on explicit non-primary buttons (button > 0). jsdom's PointerEvent\n // leaves `button` undefined; treat that as primary so tests can drive drags.\n if (typeof e.button === 'number' && e.button > 0) return;\n // preventDefault below suppresses the focus the press would otherwise\n // give the thumb, and the arrow keys are on the thumb.\n (e.currentTarget as HTMLElement).focus?.();\n e.preventDefault();\n e.stopPropagation();\n if (e.shiftKey && props.allowShiftAll) {\n beginShiftAllDrag(e.clientX);\n } else {\n beginThumbDrag(index);\n }\n };\n\n const onThumbContextMenu = (index: number) => (e: ReactMouseEvent) => {\n if (!props.onRemoveThumb) return;\n e.preventDefault();\n const accepted = props.onRemoveThumb(index);\n if (!accepted) return;\n const next = thumbs.filter((_, i) => i !== index).map(t => ({ ...t })) as T[];\n onInput(next);\n onChange?.(next);\n };\n\n const onTrackPointerDown = (e: ReactPointerEvent<HTMLDivElement>) => {\n if (typeof e.button === 'number' && e.button > 0) return;\n if (!props.onAddThumb) return;\n // If the event originated on a thumb, the thumb's own handler ran first; this is a track click.\n if ((e.target as HTMLElement).closest(`.${s.thumb}`)) return;\n e.preventDefault();\n const track = trackRef.current;\n if (!track) return;\n const rect = track.getBoundingClientRect();\n const f = clamp((e.clientX - rect.left) / rect.width, 0, 1);\n let v = fractionToValue(f);\n v = snap(v, step, min);\n v = clamp(v, min, max);\n if (stops.length > 0) v = attract(v, stops, (STOP_SNAP_PX / rect.width) * (max - min));\n const created = props.onAddThumb(v);\n if (!created) return;\n const next = [...thumbs.map(t => ({ ...t })), created] as T[];\n onInput(next);\n onChange?.(next);\n };\n\n const onThumbKeyDown = (index: number) => (e: ReactKeyboardEvent) => {\n const stepSize = defaultStep(step, min, max);\n let delta = 0;\n // With stops, a keystroke moves by whole stops rather than by value.\n let stopDelta = 0;\n let snapTo: 'home' | 'end' | null = null;\n\n switch (e.key) {\n case 'ArrowRight':\n case 'ArrowUp':\n delta = e.shiftKey ? stepSize * 10 : stepSize;\n stopDelta = e.shiftKey ? 10 : 1;\n break;\n case 'ArrowLeft':\n case 'ArrowDown':\n delta = e.shiftKey ? -stepSize * 10 : -stepSize;\n stopDelta = e.shiftKey ? -10 : -1;\n break;\n case 'PageUp':\n delta = stepSize * 10;\n stopDelta = 10;\n break;\n case 'PageDown':\n delta = -stepSize * 10;\n stopDelta = -10;\n break;\n case 'Home':\n snapTo = 'home';\n break;\n case 'End':\n snapTo = 'end';\n break;\n default:\n return;\n }\n\n e.preventDefault();\n const next = thumbs.map(t => ({ ...t }));\n const [bLo, bHi] = resolveBounds(next[index], { thumbs: next, index }, min, max);\n const lo = Math.max(min, bLo);\n const hi = Math.min(max, bHi);\n let v: number;\n if (snapTo === 'home') v = lo;\n else if (snapTo === 'end') v = hi;\n else if (stops.length > 0) {\n v = stepStops(stops, next[index].value, stopDelta > 0 ? 1 : -1, Math.abs(stopDelta));\n } else {\n v = snap(next[index].value + delta, step, min);\n }\n v = clamp(v, lo, hi);\n if (constraint === 'ordered') v = clampOrdered(v, next, index, lo, hi, step);\n next[index] = { ...next[index], value: v };\n onInput(next);\n onChange?.(next);\n };\n\n const placement = props.readoutPlacement ?? 'none';\n const renderReadout = props.renderReadout;\n\n return (\n <div\n className={className ? `${s.root} ${className}` : s.root}\n style={trackHeight !== undefined ? ({ ['--rp-track-height' as string]: `${trackHeight}px` } as CSSProperties) : undefined}\n >\n <div className={s.row}>\n <div className={s.track} ref={trackRef} onPointerDown={onTrackPointerDown}>\n {props.renderTrack && (\n <div className={s.trackInner}>\n {props.renderTrack({\n trackWidth: trackRef.current?.getBoundingClientRect().width ?? 0,\n valueToFraction,\n })}\n </div>\n )}\n {thumbs.map((thumb, i) => {\n const isNotched = thumb.shape === 'notched';\n const customRender = typeof thumb.shape === 'object' && thumb.shape !== null ? thumb.shape.render : null;\n const cls = `${s.thumb}${isNotched ? ` ${s.notched}` : ''}`;\n return (\n <div\n key={i}\n role=\"slider\"\n tabIndex={0}\n aria-orientation=\"horizontal\"\n aria-valuemin={min}\n aria-valuemax={max}\n aria-valuenow={thumb.value}\n aria-label={[ariaLabel, thumb.label].filter(Boolean).join(' ') || undefined}\n className={cls}\n style={{ left: `${valueToFraction(thumb.value) * 100}%` }}\n onPointerDown={onThumbPointerDown(i)}\n onKeyDown={onThumbKeyDown(i)}\n onContextMenu={onThumbContextMenu(i)}\n >\n {customRender ? customRender({ width: 14, height: 24, isActive: false }) : (thumb.label ?? '')}\n </div>\n );\n })}\n </div>\n {placement === 'inline-after' && (\n <span data-readout=\"inline\" className={s.readoutInline}>\n {thumbs.map((t, i) => (\n <span key={i}>{i > 0 ? ' / ' : ''}{renderReadout ? renderReadout(t, i) : defaultReadout(t)}</span>\n ))}\n </span>\n )}\n </div>\n {placement === 'below-thumb' && (\n <div className={s.readoutsBelow}>\n {thumbs.map((t, i) => (\n <span\n key={i}\n data-readout=\"below\"\n className={s.readoutBelow}\n style={{ left: `${valueToFraction(t.value) * 100}%` }}\n >\n {renderReadout ? renderReadout(t, i) : defaultReadout(t)}\n </span>\n ))}\n </div>\n )}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;GCUa,IAAa;AAM1B,SAAgB,EAAa,GAAe,GAA4C;AAItF,SAHkB,OAAO,SAAS,EAAM,GACpC,EAAM,eAAe,KAAA,GAAW,EAAQ,GACxC,OAAO,EAAM,EACA,QAAQ,MAAA,IAAiB;;;;ACqE5C,SAAS,EAAK,GAAW,GAA0B,GAAqB;AAEtE,QADI,MAAS,KAAA,KAAa,KAAQ,IAAU,IACrC,KAAK,OAAO,IAAI,KAAO,EAAK,GAAG,IAAO;;AAG/C,SAAS,EAAM,GAAW,GAAY,GAAoB;AACxD,QAAO,KAAK,IAAI,GAAI,KAAK,IAAI,GAAI,EAAE,CAAC;;AAItC,IAAM,IAAe;AAGrB,SAAS,EAAY,GAA6B,GAAa,GAAuB;AAEpF,QADI,CAAC,KAAS,EAAM,WAAW,IAAU,EAAE,GACpC,CAAC,GAAG,IAAI,IAAI,EAAM,QAAO,MAAK,KAAK,KAAO,KAAK,EAAI,CAAC,CAAC,CAAC,MAAM,GAAG,MAAM,IAAI,EAAE;;AAIpF,SAAS,EAAQ,GAAW,GAAiB,GAA2B;CAC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