@weasel-js/ui 1.0.3 → 1.1.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/{ActionBar-GThu74LC.js → ActionBar-BvPEd_GW.js} +2 -2
- package/dist/chunks/{ActionBar-GThu74LC.js.map → ActionBar-BvPEd_GW.js.map} +1 -1
- package/dist/chunks/BandEditor-D3i6l299.js +248 -0
- package/dist/chunks/BandEditor-D3i6l299.js.map +1 -0
- package/dist/chunks/{Callout-CFqG5xho.js → Callout-NSOjza6G.js} +2 -1
- package/dist/chunks/{Callout-CFqG5xho.js.map → Callout-NSOjza6G.js.map} +1 -1
- package/dist/chunks/{ComboBox-DpxsFVBy.js → ComboBox-ONQISwtI.js} +3 -2
- package/dist/chunks/{ComboBox-DpxsFVBy.js.map → ComboBox-ONQISwtI.js.map} +1 -1
- package/dist/chunks/{CurveEditor-CqIt_Xph.js → CurveEditor-SmwwvrsA.js} +2 -2
- package/dist/chunks/CurveEditor-SmwwvrsA.js.map +1 -0
- package/dist/chunks/DataGrid-DZQ4Chbd.js +210 -0
- package/dist/chunks/DataGrid-DZQ4Chbd.js.map +1 -0
- package/dist/chunks/{Dialog-3FCd_gYi.js → Dialog-CqwdJv_t.js} +2 -1
- package/dist/chunks/{Dialog-3FCd_gYi.js.map → Dialog-CqwdJv_t.js.map} +1 -1
- package/dist/chunks/{GradientEditor-DeptQpWX.js → GradientEditor-Bg6SX64V.js} +27 -7
- package/dist/chunks/GradientEditor-Bg6SX64V.js.map +1 -0
- package/dist/chunks/{PointPlotter-DD-bWmRc.js → PointPlotter-BUIse9c4.js} +2 -2
- package/dist/chunks/{PointPlotter-DD-bWmRc.js.map → PointPlotter-BUIse9c4.js.map} +1 -1
- package/dist/chunks/{Prefs-lgI4x4jF.js → Prefs-BMR9wMiZ.js} +4 -4
- package/dist/chunks/{Prefs-lgI4x4jF.js.map → Prefs-BMR9wMiZ.js.map} +1 -1
- package/dist/chunks/{Select-BE3Y1NrH.js → Select-CHsuQCp0.js} +2 -2
- package/dist/chunks/Select-CHsuQCp0.js.map +1 -0
- package/dist/chunks/{SelectionPanel-Zaw8tYQH.js → SelectionPanel-D_wk_8ZN.js} +2 -2
- package/dist/chunks/{SelectionPanel-Zaw8tYQH.js.map → SelectionPanel-D_wk_8ZN.js.map} +1 -1
- package/dist/chunks/{SidebarPanel-BpD0ptyg.js → SidebarPanel-BVTQ1ZyM.js} +2 -2
- package/dist/chunks/{SidebarPanel-BpD0ptyg.js.map → SidebarPanel-BVTQ1ZyM.js.map} +1 -1
- package/dist/chunks/Slider-tGbqoAZH.js +259 -0
- package/dist/chunks/Slider-tGbqoAZH.js.map +1 -0
- package/dist/chunks/{ToolButton-DpT-mukU.js → ToolButton-ClPz5L6j.js} +2 -2
- package/dist/chunks/{ToolButton-DpT-mukU.js.map → ToolButton-ClPz5L6j.js.map} +1 -1
- package/dist/chunks/{ToolPalette-DPn0owno.js → ToolPalette-DAiVhdtV.js} +2 -2
- package/dist/chunks/{ToolPalette-DPn0owno.js.map → ToolPalette-DAiVhdtV.js.map} +1 -1
- package/dist/chunks/{Tooltip-Clgn4trm.js → Tooltip-DXJbdR5B.js} +2 -1
- package/dist/chunks/{Tooltip-Clgn4trm.js.map → Tooltip-DXJbdR5B.js.map} +1 -1
- package/dist/components/ActionBar/index.js +1 -1
- package/dist/components/BandEditor/BandEditor.d.ts.map +1 -1
- package/dist/components/BandEditor/index.js +1 -1
- package/dist/components/Callout/Callout.d.ts.map +1 -1
- package/dist/components/Callout/index.js +1 -1
- package/dist/components/ComboBox/index.js +1 -1
- package/dist/components/CurveEditor/index.js +1 -1
- package/dist/components/DataGrid/DataGrid.d.ts.map +1 -1
- package/dist/components/DataGrid/index.js +1 -1
- package/dist/components/Dialog/index.js +1 -1
- package/dist/components/GradientEditor/GradientHandles.d.ts.map +1 -1
- package/dist/components/GradientEditor/index.js +1 -1
- package/dist/components/PointPlotter/index.js +1 -1
- package/dist/components/Prefs/index.js +1 -1
- package/dist/components/Select/index.js +1 -1
- package/dist/components/SelectionPanel/index.js +1 -1
- package/dist/components/SidebarPanel/index.js +1 -1
- package/dist/components/Slider/Slider.d.ts +5 -0
- package/dist/components/Slider/Slider.d.ts.map +1 -1
- package/dist/components/Slider/index.js +1 -1
- package/dist/components/ToolButton/index.js +1 -1
- package/dist/components/ToolPalette/index.js +1 -1
- package/dist/components/Tooltip/Tooltip.d.ts.map +1 -1
- package/dist/components/Tooltip/index.js +1 -1
- package/dist/index.js +17 -17
- package/dist/style.css +1 -1
- package/dist/useReorderDragList.d.ts.map +1 -1
- package/package.json +2 -2
- package/dist/chunks/BandEditor-13K91O9M.js +0 -228
- package/dist/chunks/BandEditor-13K91O9M.js.map +0 -1
- package/dist/chunks/CurveEditor-CqIt_Xph.js.map +0 -1
- package/dist/chunks/DataGrid-BQklXGRl.js +0 -186
- package/dist/chunks/DataGrid-BQklXGRl.js.map +0 -1
- package/dist/chunks/GradientEditor-DeptQpWX.js.map +0 -1
- package/dist/chunks/Select-BE3Y1NrH.js.map +0 -1
- package/dist/chunks/Slider-CmPeFJ3x.js +0 -221
- package/dist/chunks/Slider-CmPeFJ3x.js.map +0 -1
|
@@ -0,0 +1,259 @@
|
|
|
1
|
+
import { useCallback as e, useEffect as t, useRef as n } from "react";
|
|
2
|
+
import { jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
3
|
+
var a = {
|
|
4
|
+
root: "_root_q2asl_1",
|
|
5
|
+
row: "_row_q2asl_8",
|
|
6
|
+
track: "_track_q2asl_14",
|
|
7
|
+
trackInner: "_trackInner_q2asl_25",
|
|
8
|
+
thumb: "_thumb_q2asl_35",
|
|
9
|
+
thumbActive: "_thumbActive_q2asl_74",
|
|
10
|
+
readoutsBelow: "_readoutsBelow_q2asl_79",
|
|
11
|
+
readoutBelow: "_readoutBelow_q2asl_85",
|
|
12
|
+
readoutInline: "_readoutInline_q2asl_93",
|
|
13
|
+
notched: "_notched_q2asl_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 = n(null), k = n(null), A = n(null);
|
|
70
|
+
t(() => () => {
|
|
71
|
+
A.current?.();
|
|
72
|
+
}, []);
|
|
73
|
+
let j = e((e) => x === b ? 0 : l((e - b) / (x - b), 0, 1), [b, x]), M = e((e) => b + l(e, 0, 1) * (x - b), [b, x]), N = e((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 = e((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__ */ i("div", {
|
|
204
|
+
className: E ? `${a.root} ${E}` : a.root,
|
|
205
|
+
style: w === void 0 ? void 0 : { "--rp-track-height": `${w}px` },
|
|
206
|
+
children: [/* @__PURE__ */ i("div", {
|
|
207
|
+
className: a.row,
|
|
208
|
+
children: [/* @__PURE__ */ i("div", {
|
|
209
|
+
className: a.track,
|
|
210
|
+
ref: O,
|
|
211
|
+
onPointerDown: L,
|
|
212
|
+
children: [o.renderTrack && /* @__PURE__ */ r("div", {
|
|
213
|
+
className: a.trackInner,
|
|
214
|
+
children: o.renderTrack({
|
|
215
|
+
trackWidth: O.current?.getBoundingClientRect().width ?? 0,
|
|
216
|
+
valueToFraction: j
|
|
217
|
+
})
|
|
218
|
+
}), s.map((e, t) => {
|
|
219
|
+
let n = e.shape === "notched", i = typeof e.shape == "object" && e.shape !== null ? e.shape.render : null, o = `${a.thumb}${n ? ` ${a.notched}` : ""}`;
|
|
220
|
+
return /* @__PURE__ */ r("div", {
|
|
221
|
+
role: "slider",
|
|
222
|
+
tabIndex: 0,
|
|
223
|
+
"aria-orientation": "horizontal",
|
|
224
|
+
"aria-valuemin": b,
|
|
225
|
+
"aria-valuemax": x,
|
|
226
|
+
"aria-valuenow": e.value,
|
|
227
|
+
"aria-label": [T, e.label].filter(Boolean).join(" ") || void 0,
|
|
228
|
+
className: o,
|
|
229
|
+
style: { left: `${j(e.value) * 100}%` },
|
|
230
|
+
onPointerDown: F(t),
|
|
231
|
+
onKeyDown: R(t),
|
|
232
|
+
onContextMenu: I(t),
|
|
233
|
+
children: i ? i({
|
|
234
|
+
width: 14,
|
|
235
|
+
height: 24,
|
|
236
|
+
isActive: !1
|
|
237
|
+
}) : e.label ?? ""
|
|
238
|
+
}, t);
|
|
239
|
+
})]
|
|
240
|
+
}), z === "inline-after" && /* @__PURE__ */ r("span", {
|
|
241
|
+
"data-readout": "inline",
|
|
242
|
+
className: a.readoutInline,
|
|
243
|
+
children: s.map((e, t) => /* @__PURE__ */ i("span", { children: [t > 0 ? " / " : "", B ? B(e, t) : _(e)] }, t))
|
|
244
|
+
})]
|
|
245
|
+
}), z === "below-thumb" && /* @__PURE__ */ r("div", {
|
|
246
|
+
className: a.readoutsBelow,
|
|
247
|
+
children: s.map((e, t) => /* @__PURE__ */ r("span", {
|
|
248
|
+
"data-readout": "below",
|
|
249
|
+
className: a.readoutBelow,
|
|
250
|
+
style: { left: `${j(e.value) * 100}%` },
|
|
251
|
+
children: B ? B(e, t) : _(e)
|
|
252
|
+
}, t))
|
|
253
|
+
})]
|
|
254
|
+
});
|
|
255
|
+
}
|
|
256
|
+
//#endregion
|
|
257
|
+
export { o as n, s as r, v as t };
|
|
258
|
+
|
|
259
|
+
//# sourceMappingURL=Slider-tGbqoAZH.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Slider-tGbqoAZH.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: 3px;\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: 3px;\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: 3px;\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: 500 0.65rem/1 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: 500 0.65rem/1 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: 500 0.7rem/1 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,MA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AAD;IAAM,gBAAa;IAAS,WAAW,EAAE;cACtC,EAAO,KAAK,GAAG,MACd,kBAAC,QAAD,EAAA,UAAA,CAAe,IAAI,IAAI,QAAQ,IAAI,IAAgB,EAAc,GAAG,EAAE,GAAG,EAAe,EAAE,CAAQ,EAAA,EAAvF,EAAuF,CAClG;IACG,CAAA,CAEH;MACL,MAAc,iBACb,kBAAC,OAAD;GAAK,WAAW,EAAE;aACf,EAAO,KAAK,GAAG,MACd,kBAAC,QAAD;IAEE,gBAAa;IACb,WAAW,EAAE;IACb,OAAO,EAAE,MAAM,GAAG,EAAgB,EAAE,MAAM,GAAG,IAAI,IAAI;cAEpD,IAAgB,EAAc,GAAG,EAAE,GAAG,EAAe,EAAE;IACnD,EANA,EAMA,CACP;GACE,CAAA,CAEJ"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as e, t } from "./Tooltip-
|
|
1
|
+
import { n as e, t } from "./Tooltip-DXJbdR5B.js";
|
|
2
2
|
import { Focusable as n } from "react-aria-components";
|
|
3
3
|
import { jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
4
4
|
var a = {
|
|
@@ -51,4 +51,4 @@ function o(o) {
|
|
|
51
51
|
//#endregion
|
|
52
52
|
export { o as t };
|
|
53
53
|
|
|
54
|
-
//# sourceMappingURL=ToolButton-
|
|
54
|
+
//# sourceMappingURL=ToolButton-ClPz5L6j.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ToolButton-
|
|
1
|
+
{"version":3,"file":"ToolButton-ClPz5L6j.js","names":[],"sources":["../../src/components/ToolButton/ToolButton.module.css","../../src/components/ToolButton/ToolButton.tsx"],"sourcesContent":[".button {\n display: inline-flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n gap: 2px;\n min-width: 44px;\n padding: 6px 4px;\n background: transparent;\n border: 1px solid transparent;\n border-radius: 3px;\n color: var(--wzl-fg);\n cursor: default;\n font-family: inherit;\n font-size: 10px;\n line-height: 1.1;\n}\n.button:hover:not([disabled]) {\n background: var(--wzl-surface-hover);\n color: var(--wzl-fg);\n}\n.button:focus-visible {\n outline: 2px solid var(--wzl-accent);\n outline-offset: -2px;\n}\n.button.active {\n background: var(--wzl-surface-pressed);\n border-color: var(--wzl-accent);\n color: var(--wzl-fg);\n}\n.button[disabled] {\n opacity: 0.4;\n}\n\n.icon { display: block; }\n.icon > svg { display: block; }\n.label { font-size: 10px; }\n.shortcut {\n color: var(--wzl-fg-muted);\n font-family: ui-monospace, SFMono-Regular, Menlo, monospace;\n font-size: 9px;\n}\n","import type { KeyboardEvent, ReactNode } from 'react';\nimport { Focusable } from 'react-aria-components';\nimport { Tooltip, TooltipTrigger } from '../Tooltip';\nimport s from './ToolButton.module.css';\n\n/** Props for {@link ToolButton}. */\nexport interface ToolButtonProps {\n /** Icon node (typically an SVG component). */\n icon: ReactNode;\n /** Human-readable label shown under the icon. */\n label: string;\n /** Optional shortcut hint (e.g. \"V\" or \"⌘Z\"). */\n shortcut?: string;\n /** Selected/active state — toggles the active visual treatment. */\n active?: boolean;\n /** Disabled state — passes through to the underlying button. */\n disabled?: boolean;\n /**\n * When true, sets `aria-disabled=\"true\"` on the button without using the\n * native `disabled` attribute. This keeps the button focusable and reachable\n * by keyboard (roving-tabindex still applies) while marking it as ineligible\n * to screen readers. The caller is responsible for making `onClick` a no-op.\n */\n ariaDisabled?: boolean;\n /**\n * Whether this button is the currently tabbable member of its toolbar.\n * Toolbars use roving tabindex: exactly one button has `tabIndex=0` at\n * a time; the rest are `-1`. Caller manages which.\n */\n tabbable?: boolean;\n /** Click handler. */\n onClick(): void;\n /** Key handler for the underlying button — a toolbar's roving-tabindex\n * navigation attaches here. */\n onKeyDown?(e: KeyboardEvent<HTMLElement>): void;\n /**\n * Tooltip content. Defaults to `label` (plus `shortcut` if provided).\n */\n title?: string;\n /** Additional class for the root button. */\n className?: string;\n}\n\n/**\n * Generic icon-+-label toolbar button — building block for `ToolPalette`\n * and similar surfaces. Headless about layout direction (parent group\n * supplies flex direction via `ToolGroup`). Theme via `--wzl-*` tokens.\n */\nexport function ToolButton(props: ToolButtonProps) {\n const {\n icon, label, shortcut, active, disabled, ariaDisabled, tabbable,\n onClick, onKeyDown, title, className,\n } = props;\n const resolvedTitle = title ?? (shortcut ? `${label} (${shortcut})` : label);\n const cls = [s.button, active && s.active, className].filter(Boolean).join(' ');\n return (\n <TooltipTrigger isDisabled={disabled}>\n <Focusable isDisabled={disabled}>\n <button\n type=\"button\"\n tabIndex={tabbable ? 0 : -1}\n className={cls}\n aria-current={active ? 'true' : undefined}\n aria-disabled={ariaDisabled ? 'true' : undefined}\n disabled={disabled}\n onClick={onClick}\n onKeyDown={onKeyDown}\n >\n <span className={s.icon} aria-hidden=\"true\">{icon}</span>\n <span className={s.label}>{label}</span>\n {shortcut && <span className={s.shortcut}>{shortcut}</span>}\n </button>\n </Focusable>\n <Tooltip>{resolvedTitle}</Tooltip>\n </TooltipTrigger>\n );\n}\n"],"mappings":";;;;;;;;;;;;ACgDA,SAAgB,EAAW,GAAwB;CACjD,IAAM,EACJ,SAAM,UAAO,aAAU,WAAQ,aAAU,iBAAc,aACvD,YAAS,cAAW,UAAO,iBACzB,GACE,IAAgB,MAAU,IAAW,GAAG,EAAM,IAAI,EAAS,KAAK,IAChE,IAAM;EAAC,EAAE;EAAQ,KAAU,EAAE;EAAQ;EAAU,CAAC,OAAO,QAAQ,CAAC,KAAK,IAAI;AAC/E,QACE,kBAAC,GAAD;EAAgB,YAAY;YAA5B,CACE,kBAAC,GAAD;GAAW,YAAY;aACrB,kBAAC,UAAD;IACE,MAAK;IACL,UAAU,IAAW,IAAI;IACzB,WAAW;IACX,gBAAc,IAAS,SAAS,KAAA;IAChC,iBAAe,IAAe,SAAS,KAAA;IAC7B;IACD;IACE;cARb;KAUE,kBAAC,QAAD;MAAM,WAAW,EAAE;MAAM,eAAY;gBAAQ;MAAY,CAAA;KACzD,kBAAC,QAAD;MAAM,WAAW,EAAE;gBAAQ;MAAa,CAAA;KACvC,KAAY,kBAAC,QAAD;MAAM,WAAW,EAAE;gBAAW;MAAgB,CAAA;KACpD;;GACC,CAAA,EACZ,kBAAC,GAAD,EAAA,UAAU,GAAwB,CAAA,CACnB"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as e } from "./keyGlyph-BDH5fqkO.js";
|
|
2
2
|
import { t } from "./useRovingTabIndex-DBZtq4IH.js";
|
|
3
|
-
import { t as n } from "./ToolButton-
|
|
3
|
+
import { t as n } from "./ToolButton-ClPz5L6j.js";
|
|
4
4
|
import { t as r } from "./ToolGroup-BTIwd4U4.js";
|
|
5
5
|
import { Fragment as i } from "react";
|
|
6
6
|
import { UnknownIcon as a } from "@weasel-js/core";
|
|
@@ -94,4 +94,4 @@ function _(e) {
|
|
|
94
94
|
//#endregion
|
|
95
95
|
export { d as n, u as r, _ as t };
|
|
96
96
|
|
|
97
|
-
//# sourceMappingURL=ToolPalette-
|
|
97
|
+
//# sourceMappingURL=ToolPalette-DAiVhdtV.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ToolPalette-DPn0owno.js","names":[],"sources":["../../src/components/ToolPalette/ToolPalette.module.css","../../src/components/ToolPalette/formatShortcut.ts","../../src/components/ToolPalette/ToolPalette.tsx"],"sourcesContent":[".palette {\n display: flex;\n flex-direction: column;\n gap: 4px;\n background: var(--wzl-surface);\n border: 1px solid var(--wzl-border);\n border-radius: 4px;\n padding: 4px;\n user-select: none;\n}\n.palette.horizontal {\n flex-direction: row;\n}\n\n/* Marker only — `useRovingTabIndex` finds the palette's buttons by this class.\n Carries no styles; deleting it breaks keyboard navigation. */\n.paletteBtn {}\n\n/* Applied to ineligible tool buttons in the active mode. */\n.ineligibleBtn {\n opacity: 0.35;\n cursor: not-allowed;\n}\n\n.separator {\n background: var(--wzl-border);\n}\n.palette:not(.horizontal) .separator {\n height: 1px;\n margin: 2px 0;\n}\n.palette.horizontal .separator {\n width: 1px;\n margin: 0 2px;\n}\n","import { keyGlyph } from '../Keycaps/keyGlyph';\n\nexport interface ShortcutInput {\n key: string | readonly string[];\n mod?: boolean;\n alt?: boolean;\n shift?: boolean | 'optional';\n}\n\n/** Format a shortcut as an array of display chips, one per key — modifier\n * icons (⌘, ↑, ⌥) followed by the key glyph. UIs that want a boxed\n * per-key look render each chip in its own element. `shift: 'optional'` is\n * treated as falsy. */\nexport function formatShortcutParts(b: ShortcutInput | undefined): readonly string[] | undefined {\n if (!b) return undefined;\n const rawKey = Array.isArray(b.key) ? b.key[0] : (b.key as string);\n const parts: string[] = [];\n if (b.mod) parts.push('⌘');\n if (b.shift === true) parts.push('⇧');\n if (b.alt) parts.push('⌥');\n parts.push(keyGlyph(rawKey));\n return parts;\n}\n\n/** Format a shortcut as a single display string. Order: mod, shift, alt,\n * key. Returns `undefined` for `undefined` input so callers can `??` a\n * fallback. When `key` is an array, the first element is used. `shift: 'optional'`\n * is treated as falsy. */\nexport function formatShortcut(b: ShortcutInput | undefined): string | undefined {\n const parts = formatShortcutParts(b);\n return parts ? parts.join('') : undefined;\n}\n","import { Fragment, type ReactNode } from 'react';\nimport { UnknownIcon } from '@weasel-js/core';\nimport type { AnyTool, ToolsApi } from '@weasel-js/core';\nimport { eligibleContribution, type ModeRegistry } from '@weasel-js/modes';\nimport { ToolButton } from '../ToolButton';\nimport { ToolGroup } from '../ToolGroup';\nimport { useRovingTabIndex } from '../../useRovingTabIndex';\nimport s from './ToolPalette.module.css';\nimport { formatShortcut, type ShortcutInput } from './formatShortcut';\n\nconst DEFAULT_GROUP_ORDER = ['select', 'shape', 'draw', 'type', 'view'] as const;\nconst MISC = 'misc';\n\nfunction partitionByGroup(list: AnyTool[]): Map<string, AnyTool[]> {\n const groups = new Map<string, AnyTool[]>();\n for (const tool of list) {\n const g = tool.presentation?.group ?? MISC;\n const bucket = groups.get(g) ?? [];\n bucket.push(tool);\n groups.set(g, bucket);\n }\n return groups;\n}\n\nfunction orderedGroupKeys(\n groups: Map<string, AnyTool[]>,\n groupOrder: readonly string[],\n): string[] {\n const seen = new Set(groups.keys());\n const ordered: string[] = [];\n for (const known of groupOrder) {\n if (seen.has(known)) {\n ordered.push(known);\n seen.delete(known);\n }\n }\n // Unknown groups in insertion order (Map preserves it), misc last.\n for (const key of groups.keys()) {\n if (seen.has(key) && key !== MISC) {\n ordered.push(key);\n seen.delete(key);\n }\n }\n if (seen.has(MISC)) ordered.push(MISC);\n return ordered;\n}\n\nfunction resolveIcon(tool: AnyTool): ReactNode {\n const rawIcon = tool.presentation?.icon;\n if (rawIcon == null) return <UnknownIcon />;\n if (typeof rawIcon === 'function') return rawIcon(undefined);\n return rawIcon;\n}\n\n/** Props for {@link ToolPalette}. */\nexport interface ToolPaletteProps {\n tools: ToolsApi;\n orientation?: 'vertical' | 'horizontal';\n className?: string;\n /** Derive the keyboard shortcut for a tool button from the action registry.\n * Called with the tool's id; return `undefined` to suppress a chip. When\n * omitted, falls back to `tool.keybinding` (legacy path). */\n lookupShortcut?: (toolId: string) => ShortcutInput | undefined;\n /**\n * Optional mode registry. When provided, tools whose `capabilities` do not\n * match the current mode are rendered greyed-out, aria-disabled, and their\n * onClick is suppressed. When omitted, all tools are treated as eligible\n * (preserves existing behaviour in consumers that haven't wired a registry).\n */\n modeRegistry?: ModeRegistry;\n /**\n * Presentation-group display order. Groups not listed keep their registry\n * insertion order after the listed ones; `misc` always renders last.\n * Defaults to `['select', 'shape', 'draw', 'type', 'view']`.\n */\n groupOrder?: readonly string[];\n}\n\n/**\n * Toolbar of the registered tools, split into separator-divided groups by\n * each tool's presentation group and navigable by arrow keys. Clicking a\n * button makes that tool active.\n *\n * Given a `modeRegistry`, tools whose capabilities the current mode does not\n * allow render greyed out and inert rather than disappearing.\n */\nexport function ToolPalette(props: ToolPaletteProps) {\n const {\n tools, orientation = 'vertical', className, lookupShortcut, modeRegistry,\n groupOrder = DEFAULT_GROUP_ORDER,\n } = props;\n const list = Object.values(tools.registry);\n const groups = partitionByGroup(list);\n const groupKeys = orderedGroupKeys(groups, groupOrder);\n const cls = [s.palette, orientation === 'horizontal' && s.horizontal, className]\n .filter(Boolean).join(' ');\n\n // Flat, in DOM order — the roving-tabindex hook indexes by this order.\n const ordered = groupKeys.flatMap((k) => groups.get(k)!);\n const eligibility = ordered.map(\n (tool) => (modeRegistry ? eligibleContribution(modeRegistry, tool) : true),\n );\n const activeIndex = ordered.findIndex((t) => t.id === tools.active);\n const roving = useRovingTabIndex({\n items: eligibility.map((enabled) => ({ disabled: !enabled })),\n itemClassName: s.paletteBtn,\n // An ineligible active tool can't hold the tab stop; fall back to the\n // hook's first-enabled default.\n ...(activeIndex >= 0 && eligibility[activeIndex] ? { tabStopIndex: activeIndex } : {}),\n });\n let index = -1;\n\n return (\n <div\n ref={roving.rootRef}\n className={cls}\n role=\"toolbar\"\n aria-label=\"Tools\"\n >\n {groupKeys.map((key, i) => (\n <Fragment key={key}>\n {i > 0 && (\n <div\n className={s.separator}\n role=\"separator\"\n aria-orientation={orientation === 'horizontal' ? 'vertical' : 'horizontal'}\n />\n )}\n <ToolGroup orientation={orientation} groupKey={key}>\n {groups.get(key)!.map((tool) => {\n const i = ++index;\n const label = tool.presentation?.label ?? tool.id;\n const shortcut = tool.presentation?.shortcut\n ?? formatShortcut(lookupShortcut ? lookupShortcut(tool.id) : tool.keybinding);\n const enabled = eligibility[i];\n const modeName = modeRegistry ? modeRegistry.current().id : undefined;\n const resolvedTitle = !enabled && modeName\n ? `${label}${shortcut ? ` (${shortcut})` : ''} — disabled in ${modeName} mode`\n : undefined;\n return (\n <ToolButton\n key={tool.id}\n icon={resolveIcon(tool)}\n label={label}\n shortcut={shortcut}\n active={tools.active === tool.id}\n tabbable={roving.tabIndexFor(i) === 0}\n ariaDisabled={!enabled}\n className={[s.paletteBtn, !enabled && s.ineligibleBtn].filter(Boolean).join(' ')}\n title={resolvedTitle}\n onClick={enabled ? () => tools.setActive(tool.id) : () => {}}\n onKeyDown={roving.onKeyDown(i)}\n />\n );\n })}\n </ToolGroup>\n </Fragment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AU,EAAY,IACtB,IAAW,IAAe,EAAa,SAAS,CAAC,KAAK,KAAA,GACtD,IAAgB,CAAC,KAAW,IAC9B,GAAG,IAAQ,IAAW,KAAK,EAAS,KAAK,GAAG,iBAAiB,EAAS,SACtE,KAAA;AACJ,WACE,kBAAC,GAAD;KAEE,MAAM,EAAY,EAAK;KAChB;KACG;KACV,QAAQ,EAAM,WAAW,EAAK;KAC9B,UAAU,EAAO,YAAY,EAAE,KAAK;KACpC,cAAc,CAAC;KACf,WAAW,CAAC,EAAE,YAAY,CAAC,KAAW,EAAE,cAAc,CAAC,OAAO,QAAQ,CAAC,KAAK,IAAI;KAChF,OAAO;KACP,SAAS,UAAgB,EAAM,UAAU,EAAK,GAAG,SAAS;KAC1D,WAAW,EAAO,UAAU,EAAE;KAC9B,EAXK,EAAK,GAWV;KAEJ;GACQ,CAAA,CACH,EAAA,EApCI,EAoCJ,CACX;EACE,CAAA"}
|
|
1
|
+
{"version":3,"file":"ToolPalette-DAiVhdtV.js","names":[],"sources":["../../src/components/ToolPalette/ToolPalette.module.css","../../src/components/ToolPalette/formatShortcut.ts","../../src/components/ToolPalette/ToolPalette.tsx"],"sourcesContent":[".palette {\n display: flex;\n flex-direction: column;\n gap: 4px;\n background: var(--wzl-surface);\n border: 1px solid var(--wzl-border);\n border-radius: 4px;\n padding: 4px;\n user-select: none;\n}\n.palette.horizontal {\n flex-direction: row;\n}\n\n/* Marker only — `useRovingTabIndex` finds the palette's buttons by this class.\n Carries no styles; deleting it breaks keyboard navigation. */\n.paletteBtn {}\n\n/* Applied to ineligible tool buttons in the active mode. */\n.ineligibleBtn {\n opacity: 0.35;\n cursor: not-allowed;\n}\n\n.separator {\n background: var(--wzl-border);\n}\n.palette:not(.horizontal) .separator {\n height: 1px;\n margin: 2px 0;\n}\n.palette.horizontal .separator {\n width: 1px;\n margin: 0 2px;\n}\n","import { keyGlyph } from '../Keycaps/keyGlyph';\n\nexport interface ShortcutInput {\n key: string | readonly string[];\n mod?: boolean;\n alt?: boolean;\n shift?: boolean | 'optional';\n}\n\n/** Format a shortcut as an array of display chips, one per key — modifier\n * icons (⌘, ↑, ⌥) followed by the key glyph. UIs that want a boxed\n * per-key look render each chip in its own element. `shift: 'optional'` is\n * treated as falsy. */\nexport function formatShortcutParts(b: ShortcutInput | undefined): readonly string[] | undefined {\n if (!b) return undefined;\n const rawKey = Array.isArray(b.key) ? b.key[0] : (b.key as string);\n const parts: string[] = [];\n if (b.mod) parts.push('⌘');\n if (b.shift === true) parts.push('⇧');\n if (b.alt) parts.push('⌥');\n parts.push(keyGlyph(rawKey));\n return parts;\n}\n\n/** Format a shortcut as a single display string. Order: mod, shift, alt,\n * key. Returns `undefined` for `undefined` input so callers can `??` a\n * fallback. When `key` is an array, the first element is used. `shift: 'optional'`\n * is treated as falsy. */\nexport function formatShortcut(b: ShortcutInput | undefined): string | undefined {\n const parts = formatShortcutParts(b);\n return parts ? parts.join('') : undefined;\n}\n","import { Fragment, type ReactNode } from 'react';\nimport { UnknownIcon } from '@weasel-js/core';\nimport type { AnyTool, ToolsApi } from '@weasel-js/core';\nimport { eligibleContribution, type ModeRegistry } from '@weasel-js/modes';\nimport { ToolButton } from '../ToolButton';\nimport { ToolGroup } from '../ToolGroup';\nimport { useRovingTabIndex } from '../../useRovingTabIndex';\nimport s from './ToolPalette.module.css';\nimport { formatShortcut, type ShortcutInput } from './formatShortcut';\n\nconst DEFAULT_GROUP_ORDER = ['select', 'shape', 'draw', 'type', 'view'] as const;\nconst MISC = 'misc';\n\nfunction partitionByGroup(list: AnyTool[]): Map<string, AnyTool[]> {\n const groups = new Map<string, AnyTool[]>();\n for (const tool of list) {\n const g = tool.presentation?.group ?? MISC;\n const bucket = groups.get(g) ?? [];\n bucket.push(tool);\n groups.set(g, bucket);\n }\n return groups;\n}\n\nfunction orderedGroupKeys(\n groups: Map<string, AnyTool[]>,\n groupOrder: readonly string[],\n): string[] {\n const seen = new Set(groups.keys());\n const ordered: string[] = [];\n for (const known of groupOrder) {\n if (seen.has(known)) {\n ordered.push(known);\n seen.delete(known);\n }\n }\n // Unknown groups in insertion order (Map preserves it), misc last.\n for (const key of groups.keys()) {\n if (seen.has(key) && key !== MISC) {\n ordered.push(key);\n seen.delete(key);\n }\n }\n if (seen.has(MISC)) ordered.push(MISC);\n return ordered;\n}\n\nfunction resolveIcon(tool: AnyTool): ReactNode {\n const rawIcon = tool.presentation?.icon;\n if (rawIcon == null) return <UnknownIcon />;\n if (typeof rawIcon === 'function') return rawIcon(undefined);\n return rawIcon;\n}\n\n/** Props for {@link ToolPalette}. */\nexport interface ToolPaletteProps {\n tools: ToolsApi;\n orientation?: 'vertical' | 'horizontal';\n className?: string;\n /** Derive the keyboard shortcut for a tool button from the action registry.\n * Called with the tool's id; return `undefined` to suppress a chip. When\n * omitted, falls back to `tool.keybinding` (legacy path). */\n lookupShortcut?: (toolId: string) => ShortcutInput | undefined;\n /**\n * Optional mode registry. When provided, tools whose `capabilities` do not\n * match the current mode are rendered greyed-out, aria-disabled, and their\n * onClick is suppressed. When omitted, all tools are treated as eligible\n * (preserves existing behaviour in consumers that haven't wired a registry).\n */\n modeRegistry?: ModeRegistry;\n /**\n * Presentation-group display order. Groups not listed keep their registry\n * insertion order after the listed ones; `misc` always renders last.\n * Defaults to `['select', 'shape', 'draw', 'type', 'view']`.\n */\n groupOrder?: readonly string[];\n}\n\n/**\n * Toolbar of the registered tools, split into separator-divided groups by\n * each tool's presentation group and navigable by arrow keys. Clicking a\n * button makes that tool active.\n *\n * Given a `modeRegistry`, tools whose capabilities the current mode does not\n * allow render greyed out and inert rather than disappearing.\n */\nexport function ToolPalette(props: ToolPaletteProps) {\n const {\n tools, orientation = 'vertical', className, lookupShortcut, modeRegistry,\n groupOrder = DEFAULT_GROUP_ORDER,\n } = props;\n const list = Object.values(tools.registry);\n const groups = partitionByGroup(list);\n const groupKeys = orderedGroupKeys(groups, groupOrder);\n const cls = [s.palette, orientation === 'horizontal' && s.horizontal, className]\n .filter(Boolean).join(' ');\n\n // Flat, in DOM order — the roving-tabindex hook indexes by this order.\n const ordered = groupKeys.flatMap((k) => groups.get(k)!);\n const eligibility = ordered.map(\n (tool) => (modeRegistry ? eligibleContribution(modeRegistry, tool) : true),\n );\n const activeIndex = ordered.findIndex((t) => t.id === tools.active);\n const roving = useRovingTabIndex({\n items: eligibility.map((enabled) => ({ disabled: !enabled })),\n itemClassName: s.paletteBtn,\n // An ineligible active tool can't hold the tab stop; fall back to the\n // hook's first-enabled default.\n ...(activeIndex >= 0 && eligibility[activeIndex] ? { tabStopIndex: activeIndex } : {}),\n });\n let index = -1;\n\n return (\n <div\n ref={roving.rootRef}\n className={cls}\n role=\"toolbar\"\n aria-label=\"Tools\"\n >\n {groupKeys.map((key, i) => (\n <Fragment key={key}>\n {i > 0 && (\n <div\n className={s.separator}\n role=\"separator\"\n aria-orientation={orientation === 'horizontal' ? 'vertical' : 'horizontal'}\n />\n )}\n <ToolGroup orientation={orientation} groupKey={key}>\n {groups.get(key)!.map((tool) => {\n const i = ++index;\n const label = tool.presentation?.label ?? tool.id;\n const shortcut = tool.presentation?.shortcut\n ?? formatShortcut(lookupShortcut ? lookupShortcut(tool.id) : tool.keybinding);\n const enabled = eligibility[i];\n const modeName = modeRegistry ? modeRegistry.current().id : undefined;\n const resolvedTitle = !enabled && modeName\n ? `${label}${shortcut ? ` (${shortcut})` : ''} — disabled in ${modeName} mode`\n : undefined;\n return (\n <ToolButton\n key={tool.id}\n icon={resolveIcon(tool)}\n label={label}\n shortcut={shortcut}\n active={tools.active === tool.id}\n tabbable={roving.tabIndexFor(i) === 0}\n ariaDisabled={!enabled}\n className={[s.paletteBtn, !enabled && s.ineligibleBtn].filter(Boolean).join(' ')}\n title={resolvedTitle}\n onClick={enabled ? () => tools.setActive(tool.id) : () => {}}\n onKeyDown={roving.onKeyDown(i)}\n />\n );\n })}\n </ToolGroup>\n </Fragment>\n ))}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;ACaA,SAAgB,EAAoB,G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AC,KAAW,IAC9B,GAAG,IAAQ,IAAW,KAAK,EAAS,KAAK,GAAG,iBAAiB,EAAS,SACtE,KAAA;AACJ,WACE,kBAAC,GAAD;KAEE,MAAM,EAAY,EAAK;KAChB;KACG;KACV,QAAQ,EAAM,WAAW,EAAK;KAC9B,UAAU,EAAO,YAAY,EAAE,KAAK;KACpC,cAAc,CAAC;KACf,WAAW,CAAC,EAAE,YAAY,CAAC,KAAW,EAAE,cAAc,CAAC,OAAO,QAAQ,CAAC,KAAK,IAAI;KAChF,OAAO;KACP,SAAS,UAAgB,EAAM,UAAU,EAAK,GAAG,SAAS;KAC1D,WAAW,EAAO,UAAU,EAAE;KAC9B,EAXK,EAAK,GAWV;KAEJ;GACQ,CAAA,CACH,EAAA,EApCI,EAoCJ,CACX;EACE,CAAA"}
|
|
@@ -21,6 +21,7 @@ function s(n) {
|
|
|
21
21
|
placement: c,
|
|
22
22
|
offset: l,
|
|
23
23
|
className: [a.tooltip, s].filter(Boolean).join(" "),
|
|
24
|
+
"data-weasel-overlay": "",
|
|
24
25
|
children: [/* @__PURE__ */ r(e, {
|
|
25
26
|
className: a.arrow,
|
|
26
27
|
children: /* @__PURE__ */ r("svg", {
|
|
@@ -36,4 +37,4 @@ function s(n) {
|
|
|
36
37
|
//#endregion
|
|
37
38
|
export { o as n, s as t };
|
|
38
39
|
|
|
39
|
-
//# sourceMappingURL=Tooltip-
|
|
40
|
+
//# sourceMappingURL=Tooltip-DXJbdR5B.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tooltip-
|
|
1
|
+
{"version":3,"file":"Tooltip-DXJbdR5B.js","names":[],"sources":["../../src/components/Tooltip/Tooltip.module.css","../../src/components/Tooltip/Tooltip.tsx"],"sourcesContent":[".tooltip {\n /* Above Dialog overlay (1000) and ToastRegion (1100) — RAC sets no z-index. */\n z-index: 1200;\n background: var(--wzl-surface);\n border: 1px solid var(--wzl-border);\n border-radius: var(--wzl-radius-sm);\n box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);\n color: var(--wzl-fg);\n font-family: var(--wzl-font-ui);\n font-size: 12px;\n line-height: 1.3;\n padding: 4px 8px;\n max-width: 260px;\n transition: opacity var(--wzl-motion-fast);\n}\n\n.tooltip[data-entering],\n.tooltip[data-exiting] {\n opacity: 0;\n}\n\n.arrow svg {\n display: block;\n fill: var(--wzl-surface);\n stroke: var(--wzl-border);\n stroke-width: 1;\n}\n\n.arrow[data-placement='bottom'] svg {\n transform: rotate(180deg);\n}\n\n.arrow[data-placement='left'] svg {\n transform: rotate(-90deg);\n}\n\n.arrow[data-placement='right'] svg {\n transform: rotate(90deg);\n}\n","import type { ReactNode } from 'react';\nimport {\n TooltipTrigger as RACTooltipTrigger,\n Tooltip as RACTooltip,\n OverlayArrow,\n type TooltipProps as RACTooltipProps,\n type TooltipTriggerComponentProps,\n} from 'react-aria-components';\nimport s from './Tooltip.module.css';\n\n/**\n * Props for {@link TooltipTrigger} — React Aria's `TooltipTrigger` props\n * unchanged.\n */\nexport type TooltipTriggerProps = TooltipTriggerComponentProps;\n\n/**\n * TooltipTrigger with kit defaults: ~600 ms open delay, instant close.\n * Wrap a focusable trigger plus a `<Tooltip>`. Non-RAC triggers (plain\n * `<button>` etc.) must be wrapped in `<Focusable>` from\n * react-aria-components so hover/focus props reach the DOM node.\n *\n * Caveat: while a tooltip is open, react-aria captures the first Escape\n * keydown (document-level, capture phase) to dismiss it — app-level\n * Escape handlers (deselect, cancel gesture) see only the second press.\n */\nexport function TooltipTrigger(props: TooltipTriggerProps) {\n const { delay = 600, closeDelay = 0, ...rest } = props;\n return <RACTooltipTrigger delay={delay} closeDelay={closeDelay} {...rest} />;\n}\n\n/** Props for {@link Tooltip}, on top of React Aria's `Tooltip` props. */\nexport type TooltipProps = Omit<RACTooltipProps, 'children' | 'className'> & {\n children?: ReactNode;\n className?: string;\n};\n\n/**\n * Tooltip bubble with an arrow pointing at the trigger. Non-interactive\n * content only (ARIA tooltip semantics). Use inside `<TooltipTrigger>`.\n */\nexport function Tooltip(props: TooltipProps) {\n const { children, className, placement = 'top', offset = 8, ...rest } = props;\n return (\n <RACTooltip\n {...rest}\n placement={placement}\n offset={offset}\n className={[s.tooltip, className].filter(Boolean).join(' ')}\n data-weasel-overlay=\"\"\n >\n <OverlayArrow className={s.arrow}>\n <svg width={8} height={8} viewBox=\"0 0 8 8\" aria-hidden=\"true\">\n <path d=\"M0 0 L4 4 L8 0\" />\n </svg>\n </OverlayArrow>\n {children}\n </RACTooltip>\n );\n}\n"],"mappings":";;;;;;;;AC0BA,SAAgB,EAAe,GAA4B;CACzD,IAAM,EAAE,WAAQ,KAAK,gBAAa,GAAG,GAAG,MAAS;AACjD,QAAO,kBAAC,GAAD;EAA0B;EAAmB;EAAY,GAAI;EAAQ,CAAA;;AAa9E,SAAgB,EAAQ,GAAqB;CAC3C,IAAM,EAAE,aAAU,cAAW,eAAY,OAAO,YAAS,GAAG,GAAG,MAAS;AACxE,QACE,kBAAC,GAAD;EACE,GAAI;EACO;EACH;EACR,WAAW,CAAC,EAAE,SAAS,EAAU,CAAC,OAAO,QAAQ,CAAC,KAAK,IAAI;EAC3D,uBAAoB;YALtB,CAOE,kBAAC,GAAD;GAAc,WAAW,EAAE;aACzB,kBAAC,OAAD;IAAK,OAAO;IAAG,QAAQ;IAAG,SAAQ;IAAU,eAAY;cACtD,kBAAC,QAAD,EAAM,GAAE,kBAAmB,CAAA;IACvB,CAAA;GACO,CAAA,EACd,EACU"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as e } from "../../chunks/ActionBar-
|
|
1
|
+
import { t as e } from "../../chunks/ActionBar-BvPEd_GW.js";
|
|
2
2
|
export { e as ActionBar };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BandEditor.d.ts","sourceRoot":"","sources":["../../../src/components/BandEditor/BandEditor.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"BandEditor.d.ts","sourceRoot":"","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EAAE,SAAS,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAuBD;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,UAAU,CAAC,CAAC,EAAE,KAAK,EAAE,eAAe,CAAC,CAAC,CAAC,GAAG,YAAY,CA6NrE"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as e, r as t, t as n } from "../../chunks/BandEditor-
|
|
1
|
+
import { n as e, r as t, t as n } from "../../chunks/BandEditor-D3i6l299.js";
|
|
2
2
|
export { n as BandEditor, e as linearScale, t as logScale };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Callout.d.ts","sourceRoot":"","sources":["../../../src/components/Callout/Callout.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAyC,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAE9F,OAAO,EACL,aAAa,EAKb,KAAK,YAAY,IAAI,eAAe,EACrC,MAAM,uBAAuB,CAAC;AAG/B,4DAA4D;AAC5D,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,SAAS,GAAG,QAAQ,CAAC;AAExD;;;;;;;GAOG;AACH,OAAO,EAAE,aAAa,IAAI,cAAc,EAAE,CAAC;AAE3C,yEAAyE;AACzE,MAAM,MAAM,YAAY,GAAG,IAAI,CAC7B,eAAe,EACf,UAAU,GAAG,WAAW,GAAG,YAAY,GAAG,YAAY,CACvD,GAAG;IACF,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,gDAAgD;IAChD,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,8CAA8C;IAC9C,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,sDAAsD;IACtD,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB;;;;OAIG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB;;;;;OAKG;IACH,eAAe,CAAC,EAAE,OAAO,CA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AC;IAC1B;;;;;;;;OAQG;IACH,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB,wEAAwE;IACxE,UAAU,CAAC,EAAE,SAAS,CAAC,OAAO,GAAG,IAAI,CAAC,CAAC;IACvC;;;;;OAKG;IACH,UAAU,CAAC,EAAE;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;CACtE,CAAC;AAQF;;;;;GAKG;AACH,wBAAgB,OAAO,CAAC,KAAK,EAAE,YAAY,2CA4I1C"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as e, t } from "../../chunks/Callout-
|
|
1
|
+
import { n as e, t } from "../../chunks/Callout-NSOjza6G.js";
|
|
2
2
|
export { t as Callout, e as CalloutTrigger };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as e, t } from "../../chunks/ComboBox-
|
|
1
|
+
import { n as e, t } from "../../chunks/ComboBox-ONQISwtI.js";
|
|
2
2
|
export { t as ComboBox, e as ComboBoxItem };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as e, i as t, n, o as r, r as i, t as a } from "../../chunks/CurveEditor-
|
|
1
|
+
import { a as e, i as t, n, o as r, r as i, t as a } from "../../chunks/CurveEditor-SmwwvrsA.js";
|
|
2
2
|
export { n as CurveEditor, i as LayeredCurveEditor, t as createFunctionLayer, a as createSetCurveOp, e as functionLayerState, r as sampleByInterpolation };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DataGrid.d.ts","sourceRoot":"","sources":["../../../src/components/DataGrid/DataGrid.tsx"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAIvC;;;GAGG;AACH,MAAM,WAAW,cAAc,CAAC,GAAG;IACjC,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,S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AC;IAClB,iFAAiF;IACjF,QAAQ,CAAC,EAAE,CAAC,GAAG,EAAE,GAAG,KAAK,MAAM,GAAG,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IAC5D,kEAAkE;IAClE,MAAM,CAAC,EAAE,CAAC,GAAG,EAAE,GAAG,KAAK,SAAS,CAAC;IACjC,8EAA8E;IAC9E,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,uDAAuD;IACvD,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,kCAAkC;AAClC,MAAM,WAAW,aAAa,CAAC,GAAG,SAAS;IAAE,EAAE,EAAE,MAAM,CAAA;CAAE;IACvD,IAAI,EAAE,SAAS,GAAG,EAAE,CAAC;IACrB,OAAO,EAAE,SAAS,cAAc,CAAC,GAAG,CAAC,EAAE,CAAC;IACxC,oEAAoE;IACpE,WAAW,CAAC,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,KAAK,GAAG,MAAM,CAAA;KAAE,CAAC;IAC9D;yEACqE;IACrE,SAAS,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,EAAE,WAAW,EAAE,MAAM,KAAK,IAAI,CAAC;IACzD,2CAA2C;IAC3C,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAID;;;;;;GAMG;AACH,wBAAgB,QAAQ,CAAC,GAAG,SAAS;IAAE,EAAE,EAAE,MAAM,CAAA;CAAE,EAAE,KAAK,EAAE,aAAa,CAAC,GAAG,CAAC,2CAqH7E"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as e } from "../../chunks/DataGrid-
|
|
1
|
+
import { t as e } from "../../chunks/DataGrid-DZQ4Chbd.js";
|
|
2
2
|
export { e as DataGrid };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as e } from "../../chunks/Dialog-
|
|
1
|
+
import { t as e } from "../../chunks/Dialog-CqwdJv_t.js";
|
|
2
2
|
export { e as Dialog };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GradientHandles.d.ts","sourceRoot":"","sources":["../../../src/components/GradientEditor/GradientHandles.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"GradientHandles.d.ts","sourceRoot":"","sources":["../../../src/components/GradientEditor/GradientHandles.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAoD,KAAK,YAAY,EAAkB,MAAM,OAAO,CAAC;AAC5G,OAAO,EAAmC,KAAK,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAGrF;;yDAEyD;AACzD,UAAU,KAAK;IACb,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX;AAED;;;GAGG;AACH,MAAM,WAAW,oBAAoB;IACnC;;;;;;;;;;OAUG;IACH,KAAK,EAAE,YAAY,CAAC;IACpB;;;OAGG;IACH,QAAQ,EAAE,CAAC,CAAC,EAAE,KAAK,KAAK,KAAK,CAAC;IAC9B,+DAA+D;IAC/D,OAAO,EAAE,CAAC,CAAC,EAAE,KAAK,KAAK,KAAK,CAAC;IAC7B,sEAAsE;IACtE,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE,YAAY,KAAK,IAAI,CAAC;IACvC,mDAAmD;IACnD,QAAQ,EAAE,CAAC,IAAI,EAAE,YAAY,KAAK,IAAI,CAAC;IACvC,kCAAkC;IAClC,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,oBAAoB,GAAG,YAAY,CAYzE"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as e, t } from "../../chunks/GradientEditor-
|
|
1
|
+
import { n as e, t } from "../../chunks/GradientEditor-Bg6SX64V.js";
|
|
2
2
|
export { e as GradientEditor, t as GradientHandles };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as e } from "../../chunks/PointPlotter-
|
|
1
|
+
import { t as e } from "../../chunks/PointPlotter-BUIse9c4.js";
|
|
2
2
|
export { e as PointPlotter };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as e, i as t, n, r, t as i } from "../../chunks/Prefs-
|
|
1
|
+
import { a as e, i as t, n, r, t as i } from "../../chunks/Prefs-BMR9wMiZ.js";
|
|
2
2
|
export { i as PrefsDialog, n as PrefsForm, r as isPrefLeaf, t as prefValueAtPath, e as visiblePrefSubtree };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as e, t } from "../../chunks/Select-
|
|
1
|
+
import { n as e, t } from "../../chunks/Select-CHsuQCp0.js";
|
|
2
2
|
export { t as Select, e as SelectItem };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as e, c as t, i as n, n as r, o as i, r as a, s as o, t as s } from "../../chunks/SelectionPanel-
|
|
1
|
+
import { a as e, c as t, i as n, n as r, o as i, r as a, s as o, t as s } from "../../chunks/SelectionPanel-D_wk_8ZN.js";
|
|
2
2
|
export { r as MIXED, s as SelectionPanel, a as aggregateValue, n as classifyKind, e as effectiveSections, i as kindBreakdown, o as nodeValueAt, t as setAtPath };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as e } from "../../chunks/SidebarPanel-
|
|
1
|
+
import { t as e } from "../../chunks/SidebarPanel-BVTQ1ZyM.js";
|
|
2
2
|
export { e as SidebarPanel };
|
|
@@ -48,6 +48,10 @@ export type TrackCtx = {
|
|
|
48
48
|
* `onInput` fires continuously through a drag; `onChange` fires once when it
|
|
49
49
|
* ends and is the one to write to history.
|
|
50
50
|
*
|
|
51
|
+
* `stops` are attractors: a drag that passes within a few pixels of one lands
|
|
52
|
+
* on it, and the arrow keys move stop to stop. `step` still quantizes the
|
|
53
|
+
* values between them.
|
|
54
|
+
*
|
|
51
55
|
* `constraint: 'ordered'` keeps thumbs from crossing each other. Supplying
|
|
52
56
|
* `onAddThumb` makes a click on empty track create a thumb, and supplying
|
|
53
57
|
* `onRemoveThumb` lets a right-click or a drag off the track remove one —
|
|
@@ -61,6 +65,7 @@ export type SliderProps<T extends Thumb = Thumb> = {
|
|
|
61
65
|
min: number;
|
|
62
66
|
max: number;
|
|
63
67
|
step?: number;
|
|
68
|
+
stops?: number[];
|
|
64
69
|
constraint?: 'free' | 'ordered';
|
|
65
70
|
onAddThumb?: (atValue: number) => T | null;
|
|
66
71
|
onRemoveThumb?: (index: number) => boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Slider.d.ts","sourceRoot":"","sources":["../../../src/components/Slider/Slider.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"Slider.d.ts","sourceRoot":"","sources":["../../../src/components/Slider/Slider.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA4K,KAAK,YAAY,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAIpO;;;GAGG;AACH,MAAM,MAAM,cAAc,GAAG;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,UAAU,GAClB,OAAO,GACP,SAAS,GACT;IAAE,MAAM,EAAE,CAAC,GAAG,EAAE,cAAc,KAAK,SAAS,CAAA;CAAE,CAAC;AAEnD;;;;GAIG;AACH,MAAM,MAAM,KAAK,GAAG;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,UAAU,CAAC;IACnB,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,SAAS,KAAK,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;CACpE,CAAC;AAEF;;;GAGG;AACH,M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