@weasel-js/ui 1.7.1 → 1.7.2
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/{BandEditor-Dd0egAgE.js → BandEditor-B4jUAHQ8.js} +13 -13
- package/dist/chunks/BandEditor-B4jUAHQ8.js.map +1 -0
- package/dist/chunks/{ColorField-BLs9fbeq.js → ColorField-BwlelY26.js} +4 -4
- package/dist/chunks/ColorField-BwlelY26.js.map +1 -0
- package/dist/chunks/{ComboBox-CuTLRmUg.js → ComboBox-DKln_mOd.js} +11 -11
- package/dist/chunks/ComboBox-DKln_mOd.js.map +1 -0
- package/dist/chunks/{CurveEditor-jVBEqqdv.js → CurveEditor-0EE00D6s.js} +2 -2
- package/dist/chunks/{CurveEditor-jVBEqqdv.js.map → CurveEditor-0EE00D6s.js.map} +1 -1
- package/dist/chunks/{DataGrid-BklgBqS0.js → DataGrid-CmHJe57v.js} +22 -17
- package/dist/chunks/DataGrid-CmHJe57v.js.map +1 -0
- package/dist/chunks/DetailList-BpU50XVe.js +54 -0
- package/dist/chunks/DetailList-BpU50XVe.js.map +1 -0
- package/dist/chunks/{DetentSlider-Bh7EpMqT.js → DetentSlider-DNTAk8xP.js} +2 -2
- package/dist/chunks/{DetentSlider-Bh7EpMqT.js.map → DetentSlider-DNTAk8xP.js.map} +1 -1
- package/dist/chunks/{FallthroughDiagram-C7BUe8eU.js → FallthroughDiagram-CS1IhQaU.js} +14 -14
- package/dist/chunks/FallthroughDiagram-CS1IhQaU.js.map +1 -0
- package/dist/chunks/{Field-DsBlnFKf.js → Field-DiX_WByH.js} +2 -2
- package/dist/chunks/{Field-DsBlnFKf.js.map → Field-DiX_WByH.js.map} +1 -1
- package/dist/chunks/{FillStrokeSwatch-CgsYQgew.js → FillStrokeSwatch-C4h3rUFM.js} +2 -2
- package/dist/chunks/FillStrokeSwatch-C4h3rUFM.js.map +1 -0
- package/dist/chunks/{FontFamilySelect-CGJ5OIOy.js → FontFamilySelect-DEvMXyZd.js} +2 -2
- package/dist/chunks/{FontFamilySelect-CGJ5OIOy.js.map → FontFamilySelect-DEvMXyZd.js.map} +1 -1
- package/dist/chunks/{FontWeightSelect-RbcXYJPS.js → FontWeightSelect-BLQ_LMJF.js} +2 -2
- package/dist/chunks/{FontWeightSelect-RbcXYJPS.js.map → FontWeightSelect-BLQ_LMJF.js.map} +1 -1
- package/dist/chunks/{GradientEditor-DypXzMc-.js → GradientEditor-DD2OjQtn.js} +4 -4
- package/dist/chunks/{GradientEditor-DypXzMc-.js.map → GradientEditor-DD2OjQtn.js.map} +1 -1
- package/dist/chunks/{InlineRange-P01ABSzo.js → InlineRange-DPjIsJB3.js} +3 -3
- package/dist/chunks/InlineRange-DPjIsJB3.js.map +1 -0
- package/dist/chunks/{Input-CzwvCZs_.js → Input-D7SDKbST.js} +2 -2
- package/dist/chunks/{Input-CzwvCZs_.js.map → Input-D7SDKbST.js.map} +1 -1
- package/dist/chunks/{Jog-DfNUYejm.js → Jog-BrkzdGV2.js} +6 -6
- package/dist/chunks/Jog-BrkzdGV2.js.map +1 -0
- package/dist/chunks/{LayerList-CsDqwYh-.js → LayerList-Bxj1N6bj.js} +3 -3
- package/dist/chunks/{LayerList-CsDqwYh-.js.map → LayerList-Bxj1N6bj.js.map} +1 -1
- package/dist/chunks/{ListEditor-BnGzqERm.js → ListEditor-OQDzG4A5.js} +2 -2
- package/dist/chunks/{ListEditor-BnGzqERm.js.map → ListEditor-OQDzG4A5.js.map} +1 -1
- package/dist/chunks/{MenuButton-L9f5vido.js → MenuButton-TAFg88Lp.js} +2 -2
- package/dist/chunks/{MenuButton-L9f5vido.js.map → MenuButton-TAFg88Lp.js.map} +1 -1
- package/dist/chunks/{MeshEditor-GbqqiPk8.js → MeshEditor-DWpvg8H6.js} +2 -2
- package/dist/chunks/{MeshEditor-GbqqiPk8.js.map → MeshEditor-DWpvg8H6.js.map} +1 -1
- package/dist/chunks/{NumberField-DLXXgh48.js → NumberField-DS0WSiin.js} +7 -7
- package/dist/chunks/NumberField-DS0WSiin.js.map +1 -0
- package/dist/chunks/{PaintField-C0hoXc0Y.js → PaintField-BdmQM53v.js} +2 -2
- package/dist/chunks/{PaintField-C0hoXc0Y.js.map → PaintField-BdmQM53v.js.map} +1 -1
- package/dist/chunks/{PaintInput-jQRxM95Y.js → PaintInput-DaQMeBsI.js} +4 -4
- package/dist/chunks/{PaintInput-jQRxM95Y.js.map → PaintInput-DaQMeBsI.js.map} +1 -1
- package/dist/chunks/{PatternPicker-CaMYXzhF.js → PatternPicker-B3HcMZWg.js} +2 -2
- package/dist/chunks/{PatternPicker-CaMYXzhF.js.map → PatternPicker-B3HcMZWg.js.map} +1 -1
- package/dist/chunks/{Plot2D-BHNbgCAl.js → Plot2D-BrvQS0dh.js} +7 -7
- package/dist/chunks/Plot2D-BrvQS0dh.js.map +1 -0
- package/dist/chunks/{PointPlotter-BZ_vk6gV.js → PointPlotter-BBXpQ_QD.js} +2 -2
- package/dist/chunks/{PointPlotter-BZ_vk6gV.js.map → PointPlotter-BBXpQ_QD.js.map} +1 -1
- package/dist/chunks/{Prefs-CkyldX-e.js → Prefs-C4MZ28SX.js} +76 -66
- package/dist/chunks/Prefs-C4MZ28SX.js.map +1 -0
- package/dist/chunks/{Properties-D15c8NP-.js → Properties-DseN56WI.js} +24 -24
- package/dist/chunks/{Properties-D15c8NP-.js.map → Properties-DseN56WI.js.map} +1 -1
- package/dist/chunks/{PropertyField-CV_Gw57S.js → PropertyField-BbNqK8xr.js} +243 -186
- package/dist/chunks/PropertyField-BbNqK8xr.js.map +1 -0
- package/dist/chunks/{RadioGroup-4dbzqvGy.js → RadioGroup-B70_M-gT.js} +2 -2
- package/dist/chunks/{RadioGroup-4dbzqvGy.js.map → RadioGroup-B70_M-gT.js.map} +1 -1
- package/dist/chunks/{RangeSlider-BxokZViJ.js → RangeSlider-DO5TZVk7.js} +8 -8
- package/dist/chunks/RangeSlider-DO5TZVk7.js.map +1 -0
- package/dist/chunks/{Select-BppLsJTz.js → Select-ouV8O6cp.js} +19 -19
- package/dist/chunks/Select-ouV8O6cp.js.map +1 -0
- package/dist/chunks/{SelectionPanel-Cm1qu-ZX.js → SelectionPanel-C3WzyaZV.js} +2 -2
- package/dist/chunks/{SelectionPanel-Cm1qu-ZX.js.map → SelectionPanel-C3WzyaZV.js.map} +1 -1
- package/dist/chunks/{Slider-Cl5RCeZ7.js → Slider-DSrlMEq8.js} +19 -19
- package/dist/chunks/Slider-DSrlMEq8.js.map +1 -0
- package/dist/chunks/{StatusBar-Ca9Dvhhq.js → StatusBar-BEOfOX0D.js} +6 -6
- package/dist/chunks/StatusBar-BEOfOX0D.js.map +1 -0
- package/dist/chunks/{SwatchStrip-Cw0l8Om7.js → SwatchStrip-Bi9iPLoh.js} +2 -2
- package/dist/chunks/{SwatchStrip-Cw0l8Om7.js.map → SwatchStrip-Bi9iPLoh.js.map} +1 -1
- package/dist/chunks/{Timeline-pqnYk5cV.js → Timeline-sMCH2fah.js} +99 -84
- package/dist/chunks/Timeline-sMCH2fah.js.map +1 -0
- package/dist/chunks/{TokenPanel-DAkL6vwQ.js → TokenPanel-WtKGY2Db.js} +29 -29
- package/dist/chunks/TokenPanel-WtKGY2Db.js.map +1 -0
- package/dist/chunks/{ToolOptionsBar-COsTJ1cu.js → ToolOptionsBar-CZTYPoC2.js} +2 -2
- package/dist/chunks/{ToolOptionsBar-COsTJ1cu.js.map → ToolOptionsBar-CZTYPoC2.js.map} +1 -1
- package/dist/chunks/{createKeyframeLayer-BTa4LyJE.js → createKeyframeLayer-DSVf13Su.js} +2 -2
- package/dist/chunks/{createKeyframeLayer-BTa4LyJE.js.map → createKeyframeLayer-DSVf13Su.js.map} +1 -1
- package/dist/chunks/field.module-B27pWv0i.js +15 -0
- package/dist/chunks/{field.module-Bh7BTKMh.js.map → field.module-B27pWv0i.js.map} +1 -1
- package/dist/chunks/{model-B1-gMBIW.js → model-qsAFK7_0.js} +2 -2
- package/dist/chunks/{model-B1-gMBIW.js.map → model-qsAFK7_0.js.map} +1 -1
- package/dist/components/BandEditor/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 +2 -2
- package/dist/components/DataGrid/DataGrid.d.ts +3 -0
- package/dist/components/DataGrid/DataGrid.d.ts.map +1 -1
- package/dist/components/DataGrid/index.js +1 -1
- package/dist/components/DetailList/DetailList.d.ts +1 -1
- package/dist/components/DetailList/DetailList.d.ts.map +1 -1
- package/dist/components/DetailList/index.js +1 -1
- package/dist/components/DetentSlider/index.js +1 -1
- package/dist/components/FallthroughDiagram/index.js +1 -1
- package/dist/components/Field/index.js +1 -1
- package/dist/components/FillStrokeSwatch/FillStrokeSwatch.d.ts +5 -2
- package/dist/components/FillStrokeSwatch/FillStrokeSwatch.d.ts.map +1 -1
- package/dist/components/FillStrokeSwatch/index.js +1 -1
- package/dist/components/FontFamilySelect/index.js +1 -1
- package/dist/components/FontWeightSelect/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/Jog/index.js +1 -1
- package/dist/components/LayerList/index.js +1 -1
- package/dist/components/ListEditor/index.js +1 -1
- package/dist/components/MenuButton/index.js +1 -1
- package/dist/components/MeshEditor/index.js +1 -1
- package/dist/components/NumberField/index.js +1 -1
- package/dist/components/PaintField/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/Prefs/PrefsForm.d.ts +14 -0
- package/dist/components/Prefs/PrefsForm.d.ts.map +1 -1
- package/dist/components/Prefs/PrefsRow.d.ts +4 -0
- package/dist/components/Prefs/PrefsRow.d.ts.map +1 -1
- package/dist/components/Prefs/index.js +1 -1
- package/dist/components/Properties/PropertyField.d.ts.map +1 -1
- package/dist/components/Properties/PropertyPanel.d.ts +18 -1
- package/dist/components/Properties/PropertyPanel.d.ts.map +1 -1
- package/dist/components/Properties/index.d.ts +2 -2
- package/dist/components/Properties/index.d.ts.map +1 -1
- package/dist/components/Properties/index.js +3 -3
- package/dist/components/RadioGroup/index.js +1 -1
- package/dist/components/RangeSlider/index.js +1 -1
- package/dist/components/Select/index.js +1 -1
- package/dist/components/SelectionPanel/index.js +2 -2
- package/dist/components/Slider/index.js +1 -1
- package/dist/components/StatusBar/StatusBar.d.ts +1 -1
- package/dist/components/StatusBar/index.js +1 -1
- package/dist/components/SwatchStrip/index.js +1 -1
- package/dist/components/Timeline/Transport.d.ts.map +1 -1
- package/dist/components/Timeline/index.js +1 -1
- package/dist/components/TokenPanel/index.js +1 -1
- package/dist/components/ToolOptionsBar/index.js +1 -1
- package/dist/index.js +75 -75
- package/dist/index.js.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +9 -9
- package/dist/chunks/BandEditor-Dd0egAgE.js.map +0 -1
- package/dist/chunks/ColorField-BLs9fbeq.js.map +0 -1
- package/dist/chunks/ComboBox-CuTLRmUg.js.map +0 -1
- package/dist/chunks/DataGrid-BklgBqS0.js.map +0 -1
- package/dist/chunks/DetailList-DFtqdOJj.js +0 -52
- package/dist/chunks/DetailList-DFtqdOJj.js.map +0 -1
- package/dist/chunks/FallthroughDiagram-C7BUe8eU.js.map +0 -1
- package/dist/chunks/FillStrokeSwatch-CgsYQgew.js.map +0 -1
- package/dist/chunks/InlineRange-P01ABSzo.js.map +0 -1
- package/dist/chunks/Jog-DfNUYejm.js.map +0 -1
- package/dist/chunks/NumberField-DLXXgh48.js.map +0 -1
- package/dist/chunks/Plot2D-BHNbgCAl.js.map +0 -1
- package/dist/chunks/Prefs-CkyldX-e.js.map +0 -1
- package/dist/chunks/PropertyField-CV_Gw57S.js.map +0 -1
- package/dist/chunks/RangeSlider-BxokZViJ.js.map +0 -1
- package/dist/chunks/Select-BppLsJTz.js.map +0 -1
- package/dist/chunks/Slider-Cl5RCeZ7.js.map +0 -1
- package/dist/chunks/StatusBar-Ca9Dvhhq.js.map +0 -1
- package/dist/chunks/Timeline-pqnYk5cV.js.map +0 -1
- package/dist/chunks/TokenPanel-DAkL6vwQ.js.map +0 -1
- package/dist/chunks/field.module-Bh7BTKMh.js +0 -15
|
@@ -1,46 +1,47 @@
|
|
|
1
1
|
import { rt as e, st as t } from "./icons-Dr2-r30x.js";
|
|
2
2
|
import { n } from "./Disclosure-Ch2KxYuB.js";
|
|
3
|
-
import { r } from "./Plot2D-
|
|
4
|
-
import { i, n as a, t as o } from "./createKeyframeLayer-
|
|
3
|
+
import { r } from "./Plot2D-BrvQS0dh.js";
|
|
4
|
+
import { i, n as a, t as o } from "./createKeyframeLayer-DSVf13Su.js";
|
|
5
5
|
import { t as s } from "./snap-DRjbOiG9.js";
|
|
6
|
-
import { t as c } from "./DetentSlider-
|
|
6
|
+
import { t as c } from "./DetentSlider-DNTAk8xP.js";
|
|
7
7
|
import { EASINGS as l, openPointerSession as u, resolveEasing as d, sampleTrack as f, useLatest as p, useVisibleRaf as m } from "@weasel-js/core";
|
|
8
8
|
import { Fragment as h, jsx as g, jsxs as _ } from "react/jsx-runtime";
|
|
9
9
|
import { useCallback as v, useEffect as y, useLayoutEffect as b, useMemo as x, useReducer as S, useRef as C, useState as w } from "react";
|
|
10
10
|
import { multiplier as T, qty as E } from "@weasel-js/quantity";
|
|
11
11
|
var D = {
|
|
12
|
-
ruler: "
|
|
13
|
-
tick: "
|
|
14
|
-
playhead: "
|
|
15
|
-
lane: "
|
|
16
|
-
laneLabel: "
|
|
17
|
-
disclosure: "
|
|
18
|
-
laneTrack: "
|
|
19
|
-
key: "
|
|
20
|
-
eventMark: "
|
|
21
|
-
keyGhost: "
|
|
22
|
-
eventGhost: "
|
|
23
|
-
graphHost: "
|
|
24
|
-
graph: "
|
|
25
|
-
nestedBar: "
|
|
26
|
-
transport: "
|
|
27
|
-
transportButton: "
|
|
28
|
-
transportRow: "
|
|
29
|
-
time: "
|
|
30
|
-
rate: "
|
|
31
|
-
rateSlider: "
|
|
32
|
-
rateReadout: "
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
12
|
+
ruler: "_ruler_c5e84_1",
|
|
13
|
+
tick: "_tick_c5e84_11 _numeric_zns9n_4",
|
|
14
|
+
playhead: "_playhead_c5e84_30",
|
|
15
|
+
lane: "_lane_c5e84_39",
|
|
16
|
+
laneLabel: "_laneLabel_c5e84_46",
|
|
17
|
+
disclosure: "_disclosure_c5e84_66",
|
|
18
|
+
laneTrack: "_laneTrack_c5e84_68",
|
|
19
|
+
key: "_key_c5e84_75",
|
|
20
|
+
eventMark: "_eventMark_c5e84_75",
|
|
21
|
+
keyGhost: "_keyGhost_c5e84_95",
|
|
22
|
+
eventGhost: "_eventGhost_c5e84_95",
|
|
23
|
+
graphHost: "_graphHost_c5e84_112",
|
|
24
|
+
graph: "_graph_c5e84_112",
|
|
25
|
+
nestedBar: "_nestedBar_c5e84_131",
|
|
26
|
+
transport: "_transport_c5e84_140",
|
|
27
|
+
transportButton: "_transportButton_c5e84_149",
|
|
28
|
+
transportRow: "_transportRow_c5e84_176",
|
|
29
|
+
time: "_time_c5e84_194 _numeric_zns9n_4",
|
|
30
|
+
rate: "_rate_c5e84_201",
|
|
31
|
+
rateSlider: "_rateSlider_c5e84_202",
|
|
32
|
+
rateReadout: "_rateReadout_c5e84_206 _numeric_zns9n_4",
|
|
33
|
+
sizer: "_sizer_c5e84_218 _sizer_18u60_4",
|
|
34
|
+
root: "_root_c5e84_222",
|
|
35
|
+
label: "_label_c5e84_237",
|
|
36
|
+
body: "_body_c5e84_239",
|
|
37
|
+
gutter: "_gutter_c5e84_47",
|
|
38
|
+
rulerWrap: "_rulerWrap_c5e84_241",
|
|
39
|
+
lanes: "_lanes_c5e84_243",
|
|
40
|
+
inspector: "_inspector_c5e84_250",
|
|
41
|
+
segment: "_segment_c5e84_259",
|
|
42
|
+
easingPicker: "_easingPicker_c5e84_269",
|
|
43
|
+
easingLabel: "_easingLabel_c5e84_270 _numeric_zns9n_4",
|
|
44
|
+
easingPreview: "_easingPreview_c5e84_272"
|
|
44
45
|
};
|
|
45
46
|
//#endregion
|
|
46
47
|
//#region src/components/Timeline/easingSpec.ts
|
|
@@ -524,8 +525,8 @@ var U = T({ symbol: "x" }), W = [
|
|
|
524
525
|
1,
|
|
525
526
|
2,
|
|
526
527
|
4
|
|
527
|
-
], G = (e) => `${(e / 1e3).toFixed(2)}s
|
|
528
|
-
function
|
|
528
|
+
], G = (e) => `${(e / 1e3).toFixed(2)}s`, K = (e) => E(e, U).text;
|
|
529
|
+
function q(n) {
|
|
529
530
|
let { paused: r, loop: i, rate: a, playhead: o, duration: s, onPlay: l, onPause: u, onLoopChange: d, onRateChange: f } = n, p = i !== !1 && i !== 0, m = W.includes(a) ? W : [...W, a].sort((e, t) => e - t);
|
|
530
531
|
return /* @__PURE__ */ _("div", {
|
|
531
532
|
className: D.transport,
|
|
@@ -558,24 +559,38 @@ function K(n) {
|
|
|
558
559
|
})),
|
|
559
560
|
value: a,
|
|
560
561
|
onChange: f,
|
|
561
|
-
formatLabel:
|
|
562
|
+
formatLabel: K,
|
|
562
563
|
labels: "none",
|
|
563
564
|
className: D.rateSlider
|
|
564
565
|
}),
|
|
565
|
-
/* @__PURE__ */
|
|
566
|
+
/* @__PURE__ */ _("span", {
|
|
566
567
|
className: D.rateReadout,
|
|
567
|
-
children:
|
|
568
|
+
children: [/* @__PURE__ */ g("span", { children: K(a) }), /* @__PURE__ */ g("span", {
|
|
569
|
+
className: D.sizer,
|
|
570
|
+
"aria-hidden": "true",
|
|
571
|
+
children: m.map((e) => /* @__PURE__ */ g("span", { children: K(e) }, e))
|
|
572
|
+
})]
|
|
568
573
|
})
|
|
569
574
|
]
|
|
570
575
|
}),
|
|
571
576
|
/* @__PURE__ */ _("span", {
|
|
572
577
|
className: D.time,
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
578
|
+
children: [/* @__PURE__ */ _("span", {
|
|
579
|
+
"data-testid": "timeline-time",
|
|
580
|
+
children: [
|
|
581
|
+
G(Math.min(Math.max(o, 0), s)),
|
|
582
|
+
" / ",
|
|
583
|
+
G(s)
|
|
584
|
+
]
|
|
585
|
+
}), /* @__PURE__ */ g("span", {
|
|
586
|
+
className: D.sizer,
|
|
587
|
+
"aria-hidden": "true",
|
|
588
|
+
children: /* @__PURE__ */ _("span", { children: [
|
|
589
|
+
G(s),
|
|
590
|
+
" / ",
|
|
591
|
+
G(s)
|
|
592
|
+
] })
|
|
593
|
+
})]
|
|
579
594
|
})
|
|
580
595
|
]
|
|
581
596
|
});
|
|
@@ -605,7 +620,7 @@ function he(e, t) {
|
|
|
605
620
|
};
|
|
606
621
|
return r(e, [], 0, 0), n;
|
|
607
622
|
}
|
|
608
|
-
function
|
|
623
|
+
function J(e, t) {
|
|
609
624
|
let n = e, r;
|
|
610
625
|
for (let e of t) {
|
|
611
626
|
if (r = n[e], !r) return;
|
|
@@ -615,10 +630,10 @@ function q(e, t) {
|
|
|
615
630
|
}
|
|
616
631
|
//#endregion
|
|
617
632
|
//#region src/components/Timeline/keys.ts
|
|
618
|
-
function
|
|
633
|
+
function Y(e, t) {
|
|
619
634
|
return e.length === t.length && e.every((e, n) => e === t[n]);
|
|
620
635
|
}
|
|
621
|
-
function
|
|
636
|
+
function X(e, t) {
|
|
622
637
|
return {
|
|
623
638
|
...e,
|
|
624
639
|
keys: t
|
|
@@ -630,7 +645,7 @@ function ge(e, t) {
|
|
|
630
645
|
events: t
|
|
631
646
|
};
|
|
632
647
|
}
|
|
633
|
-
function
|
|
648
|
+
function Z(e, t, n) {
|
|
634
649
|
let r = e.slice(), [i, ...a] = t;
|
|
635
650
|
if (a.length === 0) return r[i] = n, r;
|
|
636
651
|
let o = r[i];
|
|
@@ -640,19 +655,19 @@ function X(e, t, n) {
|
|
|
640
655
|
...s,
|
|
641
656
|
timeline: {
|
|
642
657
|
...s.timeline,
|
|
643
|
-
tracks:
|
|
658
|
+
tracks: Z(s.timeline.tracks, a, n)
|
|
644
659
|
}
|
|
645
660
|
}, r;
|
|
646
661
|
}
|
|
647
|
-
function
|
|
648
|
-
let r =
|
|
662
|
+
function Q(e, t, n) {
|
|
663
|
+
let r = J(e, t.trackPath), i = Math.max(0, n);
|
|
649
664
|
if (r?.kind === "sampled") {
|
|
650
665
|
let n = r, a = {
|
|
651
666
|
...n.keys[t.keyIndex],
|
|
652
667
|
t: i
|
|
653
668
|
}, o = n.keys.filter((e, n) => n !== t.keyIndex), s = o.findIndex((e) => e.t > i), c = s === -1 ? o.length : s;
|
|
654
669
|
return o.splice(c, 0, a), {
|
|
655
|
-
tracks:
|
|
670
|
+
tracks: Z(e, t.trackPath, X(r, o)),
|
|
656
671
|
selection: {
|
|
657
672
|
trackPath: t.trackPath,
|
|
658
673
|
keyIndex: c
|
|
@@ -665,7 +680,7 @@ function Z(e, t, n) {
|
|
|
665
680
|
t: i
|
|
666
681
|
}, o = n.events.filter((e, n) => n !== t.keyIndex), s = o.findIndex((e) => e.t > i), c = s === -1 ? o.length : s;
|
|
667
682
|
return o.splice(c, 0, a), {
|
|
668
|
-
tracks:
|
|
683
|
+
tracks: Z(e, t.trackPath, ge(r, o)),
|
|
669
684
|
selection: {
|
|
670
685
|
trackPath: t.trackPath,
|
|
671
686
|
keyIndex: c
|
|
@@ -678,7 +693,7 @@ function Z(e, t, n) {
|
|
|
678
693
|
};
|
|
679
694
|
}
|
|
680
695
|
function _e(e, t, n) {
|
|
681
|
-
let r =
|
|
696
|
+
let r = J(e, t);
|
|
682
697
|
if (r?.kind !== "sampled") return {
|
|
683
698
|
tracks: e.slice(),
|
|
684
699
|
selection: null
|
|
@@ -688,7 +703,7 @@ function _e(e, t, n) {
|
|
|
688
703
|
t: a,
|
|
689
704
|
value: o
|
|
690
705
|
}), {
|
|
691
|
-
tracks:
|
|
706
|
+
tracks: Z(e, t, X(r, s)),
|
|
692
707
|
selection: {
|
|
693
708
|
trackPath: t,
|
|
694
709
|
keyIndex: l
|
|
@@ -696,45 +711,45 @@ function _e(e, t, n) {
|
|
|
696
711
|
};
|
|
697
712
|
}
|
|
698
713
|
function ve(e, t) {
|
|
699
|
-
let n =
|
|
714
|
+
let n = J(e, t.trackPath);
|
|
700
715
|
if (n?.kind !== "sampled") return {
|
|
701
716
|
tracks: e.slice(),
|
|
702
717
|
selection: t
|
|
703
718
|
};
|
|
704
719
|
let r = n.keys.filter((e, n) => n !== t.keyIndex);
|
|
705
720
|
return {
|
|
706
|
-
tracks:
|
|
721
|
+
tracks: Z(e, t.trackPath, X(n, r)),
|
|
707
722
|
selection: r.length === 0 ? null : {
|
|
708
723
|
trackPath: t.trackPath,
|
|
709
724
|
keyIndex: Math.max(0, t.keyIndex - 1)
|
|
710
725
|
}
|
|
711
726
|
};
|
|
712
727
|
}
|
|
713
|
-
function
|
|
714
|
-
let r =
|
|
728
|
+
function $(e, t, n) {
|
|
729
|
+
let r = J(e, t.trackPath);
|
|
715
730
|
if (r?.kind !== "sampled") return e.slice();
|
|
716
731
|
let i = r.keys.slice(), { easing: a, ...o } = i[t.keyIndex];
|
|
717
732
|
return i[t.keyIndex] = n === void 0 ? o : {
|
|
718
733
|
...o,
|
|
719
734
|
easing: n
|
|
720
|
-
},
|
|
721
|
-
}
|
|
722
|
-
function $(e, t, n) {
|
|
723
|
-
let r = q(e, t);
|
|
724
|
-
return r?.kind === "sampled" ? X(e, t, Y(r, n.slice())) : e.slice();
|
|
735
|
+
}, Z(e, t.trackPath, X(r, i));
|
|
725
736
|
}
|
|
726
737
|
function ye(e, t, n) {
|
|
727
|
-
let r =
|
|
738
|
+
let r = J(e, t);
|
|
739
|
+
return r?.kind === "sampled" ? Z(e, t, X(r, n.slice())) : e.slice();
|
|
740
|
+
}
|
|
741
|
+
function be(e, t, n) {
|
|
742
|
+
let r = J(e, t.trackPath);
|
|
728
743
|
if (r?.kind !== "sampled") return e.slice();
|
|
729
744
|
let i = r.keys.slice();
|
|
730
745
|
return i[t.keyIndex] = {
|
|
731
746
|
...i[t.keyIndex],
|
|
732
747
|
value: n
|
|
733
|
-
},
|
|
748
|
+
}, Z(e, t.trackPath, X(r, i));
|
|
734
749
|
}
|
|
735
750
|
//#endregion
|
|
736
751
|
//#region src/components/Timeline/Timeline.tsx
|
|
737
|
-
function
|
|
752
|
+
function xe(e) {
|
|
738
753
|
let { tracks: t, duration: n, playhead: r, onInput: i, onChange: a, onScrub: o, renderKeyEditor: s, label: c, className: l } = e, [u, d] = w(() => /* @__PURE__ */ new Set()), [f, p] = w({
|
|
739
754
|
from: 0,
|
|
740
755
|
to: n
|
|
@@ -756,7 +771,7 @@ function be(e) {
|
|
|
756
771
|
let n = ve(t, C);
|
|
757
772
|
a(n.tracks), T(n.selection);
|
|
758
773
|
}
|
|
759
|
-
}, M = C ?
|
|
774
|
+
}, M = C ? J(t, C.trackPath) : void 0, N = M?.kind === "sampled" ? M.keys[C.keyIndex] : void 0, P = v ? J(t, v.trackPath) : void 0, F = P?.kind === "sampled" ? P.keys[v.keyIndex] : void 0;
|
|
760
775
|
return /* @__PURE__ */ _("div", {
|
|
761
776
|
className: [D.root, l].filter(Boolean).join(" "),
|
|
762
777
|
"data-testid": "timeline-root",
|
|
@@ -769,7 +784,7 @@ function be(e) {
|
|
|
769
784
|
}) : null,
|
|
770
785
|
e.transport === !1 ? null : /* @__PURE__ */ _("div", {
|
|
771
786
|
className: D.transportRow,
|
|
772
|
-
children: [/* @__PURE__ */ g(
|
|
787
|
+
children: [/* @__PURE__ */ g(q, {
|
|
773
788
|
...e.transport ?? {
|
|
774
789
|
paused: !0,
|
|
775
790
|
loop: !1,
|
|
@@ -812,7 +827,7 @@ function be(e) {
|
|
|
812
827
|
row: n,
|
|
813
828
|
window: b,
|
|
814
829
|
mode: e.mode ?? "dope",
|
|
815
|
-
selection: C &&
|
|
830
|
+
selection: C && Y(C.trackPath, r) ? C.keyIndex : null,
|
|
816
831
|
expanded: u.has(n.key),
|
|
817
832
|
snapTimes: k,
|
|
818
833
|
onToggleExpand: () => A(n.key),
|
|
@@ -821,25 +836,25 @@ function be(e) {
|
|
|
821
836
|
keyIndex: e
|
|
822
837
|
}),
|
|
823
838
|
onKeyInput: (e, n) => {
|
|
824
|
-
i?.(
|
|
839
|
+
i?.(Q(t, {
|
|
825
840
|
trackPath: r,
|
|
826
841
|
keyIndex: e
|
|
827
842
|
}, n).tracks);
|
|
828
843
|
},
|
|
829
844
|
onKeyCommit: (e, n) => {
|
|
830
|
-
let i =
|
|
845
|
+
let i = Q(t, {
|
|
831
846
|
trackPath: r,
|
|
832
847
|
keyIndex: e
|
|
833
848
|
}, n);
|
|
834
849
|
a(i.tracks), T(i.selection);
|
|
835
850
|
},
|
|
836
|
-
onKeysInput: (e) => i?.(
|
|
837
|
-
onKeysCommit: (e) => a(
|
|
851
|
+
onKeysInput: (e) => i?.(ye(t, r, e)),
|
|
852
|
+
onKeysCommit: (e) => a(ye(t, r, e)),
|
|
838
853
|
onInsert: (e) => {
|
|
839
854
|
let n = _e(t, r, e);
|
|
840
855
|
a(n.tracks), T(n.selection);
|
|
841
856
|
},
|
|
842
|
-
selectedSegment: v &&
|
|
857
|
+
selectedSegment: v && Y(v.trackPath, r) ? v.keyIndex : null,
|
|
843
858
|
onSelectSegment: (e) => y({
|
|
844
859
|
trackPath: r,
|
|
845
860
|
keyIndex: e
|
|
@@ -853,15 +868,15 @@ function be(e) {
|
|
|
853
868
|
key: N,
|
|
854
869
|
track: M,
|
|
855
870
|
selection: C,
|
|
856
|
-
commit: (e) => a(
|
|
857
|
-
setEasing: (e) => a(
|
|
871
|
+
commit: (e) => a(be(t, C, e.value)),
|
|
872
|
+
setEasing: (e) => a($(t, C, e))
|
|
858
873
|
})
|
|
859
874
|
}) : null,
|
|
860
875
|
v && F ? /* @__PURE__ */ g("div", {
|
|
861
876
|
className: D.inspector,
|
|
862
877
|
children: /* @__PURE__ */ g(I, {
|
|
863
878
|
value: F.easing,
|
|
864
|
-
onChange: (e) => a(
|
|
879
|
+
onChange: (e) => a($(t, v, e))
|
|
865
880
|
})
|
|
866
881
|
}) : null
|
|
867
882
|
]
|
|
@@ -869,7 +884,7 @@ function be(e) {
|
|
|
869
884
|
}
|
|
870
885
|
//#endregion
|
|
871
886
|
//#region src/components/Timeline/AnimatedTimeline.tsx
|
|
872
|
-
function
|
|
887
|
+
function Se(e) {
|
|
873
888
|
let { handle: t, ...n } = e, [, r] = S((e) => e + 1, 0);
|
|
874
889
|
y(() => t.subscribe(r), [t]);
|
|
875
890
|
let i = m(() => {
|
|
@@ -882,7 +897,7 @@ function xe(e) {
|
|
|
882
897
|
n.splice(0, n.length, ...e);
|
|
883
898
|
});
|
|
884
899
|
}, [t]), s = t.time(), c = t.duration();
|
|
885
|
-
return /* @__PURE__ */ g(
|
|
900
|
+
return /* @__PURE__ */ g(xe, {
|
|
886
901
|
...n,
|
|
887
902
|
tracks: t.tracks(),
|
|
888
903
|
duration: c,
|
|
@@ -909,6 +924,6 @@ function xe(e) {
|
|
|
909
924
|
});
|
|
910
925
|
}
|
|
911
926
|
//#endregion
|
|
912
|
-
export { I as a, A as c,
|
|
927
|
+
export { I as a, A as c, q as i, j as l, xe as n, M as o, Y as r, k as s, Se as t };
|
|
913
928
|
|
|
914
|
-
//# sourceMappingURL=Timeline-
|
|
929
|
+
//# sourceMappingURL=Timeline-sMCH2fah.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Timeline-sMCH2fah.js","names":["easingLabel","s","KEY_STEP_MS","s","s","_Fragment","s","s","st","s","PauseIcon","PlayIcon","createKeyframeLayer","applyKeyframeDrag","snapToNearest","DetentSlider","Timeline_module_default","bezierOf","spec","easingBezier","easingLabel","b","name","fn","EASINGS","sampleEasing","resolveEasing","out","count","last","i","EASING_NAMES","PREVIEW_SAMPLES","BEZIER_OF","DEFAULT_BEZIER","EasingPicker","props","bezier","value","label","named","selectValue","points","v","onChange","n","MIN_SPAN_MS","createTimeScale","span","window","perMs","widthPx","perPx","ms","px","toFraction","toPercent","spanFraction","spanPercent","clampWindow","w","bounds","from","zoomWindow","maxSpan","nextSpan","factor","frac","atMs","panWindow","byMs","tickTimes","step","niceStep","minSpacingPx","V_INSET_PCT","KEY_STEP_MS$1","valueRange","values","keys","k","lo","pad","LaneGraph","win","hostRef","useRef","size","setSize","useState","el","update","r","prev","ro","layer","useMemo","t","snapTimes","offset","committed","selection","selectedSegment","live","setLive","state","stateRef","useLatest","layers","onLayerChange","next","raw","onSelect","onSelectSegment","applied","onKeysInput","onLayerCommit","rawPrev","onKeysCommit","yLo","yHi","ticks","LayeredCurveEditor","KEY_STEP_MS","entryTimes","row","Lane","trackRef","sessionRef","drag","setDrag","pct","msAt","rect","clientX","snapPxToMs","width","scale","graph","mode","sampledKeys","onKeyPointerDown","e","at","ev","times","end","openPointerSession","onKeyInput","onKeyCommit","onKeyDown","expanded","onToggleExpand","DisclosureMark","onInsert","Fragment","idx","ZOOM_STEP","formatMs","Ruler","setWidth","widthOf","onPointerDown","onScrub","onWheel","playhead","RATE","multiplier","RATES","seconds","rateText","qty","Transport","looping","loop","rates","rate","a","paused","onPlay","onPause","jsx","onLoopChange","onRateChange","duration","isNumeric","track","buildLanes","walk","nextPath","path","key","depth","tracks","trackAtPath","list","found","samePath","withKeys","withEvents","replaceAtPath","rest","parent","tt","moveKey","sel","toMs","st","moved","keyIndex","et","events","insertKey","trackPath","sampleTrack","deleteKey","setKeyEasing","_drop","easing","setKeys","setKeyValue","Timeline","setExpanded","ownWindow","setOwnWindow","ownSelection","setOwnSelection","segmentSelection","setSegmentSelection","setWindow","setSelection","rows","toggle","onRootKeyDown","selectedTrack","selectedKey","segmentTrack","segmentKey","className","onInput","renderKeyEditor","AnimatedTimeline","bump","useReducer","handle","raf","useVisibleRaf","rafRef","useCallback"],"sources":["../../src/components/Timeline/Timeline.module.css","../../src/components/Timeline/easingSpec.ts","../../src/components/Timeline/EasingPicker.tsx","../../src/components/Timeline/timeScale.ts","../../src/components/Timeline/LaneGraph.tsx","../../src/components/Timeline/Lane.tsx","../../src/components/Timeline/Ruler.tsx","../../src/components/Timeline/Transport.tsx","../../src/components/Timeline/lanes.ts","../../src/components/Timeline/keys.ts","../../src/components/Timeline/Timeline.tsx","../../src/components/Timeline/AnimatedTimeline.tsx"],"sourcesContent":[".ruler {\n position: relative;\n height: var(--wzl-control-h);\n border-bottom: 1px solid var(--wzl-border);\n background: var(--wzl-surface-raised);\n cursor: ew-resize;\n user-select: none;\n overflow: hidden;\n}\n\n.tick {\n composes: numeric from '@weasel-js/theme/numeric.module.css';\n position: absolute;\n top: 0;\n transform: translateX(2px);\n color: var(--wzl-fg-muted);\n pointer-events: none;\n white-space: nowrap;\n}\n\n.tick::before {\n content: '';\n position: absolute;\n left: -2px;\n top: 0;\n bottom: 0;\n border-left: 1px solid var(--wzl-border);\n}\n\n.playhead {\n position: absolute;\n top: 0;\n bottom: 0;\n width: 1px;\n background: var(--wzl-accent-strong);\n pointer-events: none;\n}\n\n.lane {\n display: flex;\n align-items: stretch;\n min-height: var(--wzl-control-h-sm);\n border-bottom: 1px solid var(--wzl-line-subtle);\n}\n\n.laneLabel {\n /* Must match `.gutter`'s width exactly, or every key sits off the ruler. */\n box-sizing: border-box;\n flex: 0 0 var(--wzl-timeline-label-w, 120px);\n display: flex;\n align-items: center;\n gap: var(--wzl-space-2);\n padding-inline: var(--wzl-space-3);\n padding-inline-start: calc(var(--wzl-space-3) + var(--depth, 0) * var(--wzl-space-6));\n font-size: var(--wzl-font-size);\n color: var(--wzl-fg);\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.lane[data-depth='1'] .laneLabel { --depth: 1; }\n.lane[data-depth='2'] .laneLabel { --depth: 2; }\n.lane[data-depth='3'] .laneLabel { --depth: 3; }\n\n.disclosure { display: inline-flex; flex: none; cursor: pointer; }\n\n.laneTrack {\n position: relative;\n flex: 1 1 auto;\n min-width: 0;\n background: var(--wzl-surface);\n}\n\n.key, .eventMark {\n position: absolute;\n top: 50%;\n width: var(--wzl-handle-size);\n height: var(--wzl-handle-size);\n margin-left: calc(var(--wzl-handle-size) / -2);\n background: var(--wzl-fg-muted);\n cursor: ew-resize;\n}\n\n.key { transform: translateY(-50%) rotate(45deg); }\n.eventMark { transform: translateY(-50%); border-radius: 50%; }\n\n.key[aria-current='true'], .eventMark[aria-current='true'] { background: var(--wzl-accent-strong); }\n.key:focus-visible, .eventMark:focus-visible { outline: 2px solid var(--wzl-focus-ring); outline-offset: 1px; }\n\n/* The key stays drawn where it was committed while its ghost tracks the\n pointer, so the drag reads as a move from somewhere to somewhere. */\n.key[data-dragging='true'], .eventMark[data-dragging='true'] { opacity: 0.4; }\n\n.keyGhost, .eventGhost {\n position: absolute;\n top: 50%;\n width: var(--wzl-handle-size);\n height: var(--wzl-handle-size);\n margin-left: calc(var(--wzl-handle-size) / -2);\n background: var(--wzl-accent-soft);\n border: 1px dashed var(--wzl-accent-strong);\n pointer-events: none;\n}\n\n.keyGhost { transform: translateY(-50%) rotate(45deg); }\n.eventGhost { transform: translateY(-50%); border-radius: 50%; }\n\n.lane[data-mode='graph'] { min-height: 72px; }\n\n/* A numeric lane in graph mode is a curve editor filling the track. */\n.graphHost {\n position: absolute;\n inset: 0;\n}\n\n/* Out-specifies the editor's own defaults: the lane keeps the track's ground\n and the timeline's accent line rather than a plot's. */\n.graphHost .graph {\n --plot-bg: transparent;\n --curve-line: var(--wzl-accent-strong);\n --curve-line-width: 1px;\n}\n\n/* A graph lane's value labels hang off the track's start edge into the label\n column, so the lane's own label ellipsizes before it reaches them. */\n.lane[data-graph='true'] .laneLabel {\n padding-inline-end: calc(var(--wzl-space-3) + var(--wzl-timeline-value-axis-w, 32px));\n}\n\n.nestedBar {\n position: absolute;\n top: 4px;\n bottom: 4px;\n background: var(--wzl-surface-sunken);\n border: 1px solid var(--wzl-border);\n border-radius: var(--wzl-radius-sm);\n}\n\n.transport {\n display: flex;\n align-items: center;\n gap: var(--wzl-space-4);\n padding: var(--wzl-space-2) var(--wzl-space-3);\n border-bottom: 1px solid var(--wzl-border);\n background: var(--wzl-surface-raised);\n}\n\n.transportButton {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n min-width: var(--wzl-icon-button-size);\n padding: var(--wzl-space-1) var(--wzl-space-3);\n /* Sits on `--wzl-surface-raised`, so a transparent fill and a border that\n close in value leave it reading as text rather than as a control. */\n background: var(--wzl-surface);\n border: 1px solid var(--wzl-border);\n border-radius: var(--wzl-radius-sm);\n color: var(--wzl-fg);\n font: inherit;\n cursor: pointer;\n}\n\n.transportButton:hover { border-color: var(--wzl-fg-muted); }\n\n.transportButton[aria-checked='true'] {\n background: var(--wzl-accent-soft);\n border-color: var(--wzl-accent-strong);\n color: var(--wzl-accent-fg);\n}\n\n/* The bar's chrome lives on the row, so controls beside `<Transport>` sit\n inside it rather than hanging off the panel's corner. `.transport` keeps its\n own chrome for standalone use. */\n.transportRow {\n display: flex;\n align-items: center;\n gap: var(--wzl-space-4);\n padding-inline-end: var(--wzl-space-3);\n border-bottom: 1px solid var(--wzl-border);\n background: var(--wzl-surface-raised);\n}\n\n.transportRow > .transport {\n flex: 1 1 auto;\n border-bottom: 0;\n background: transparent;\n}\n\n/* The playhead rewrites this every frame and gains a digit at 10s. Its sizer\n holds the cell at the duration's width, so a transport sized to its content\n does not widen; last in the row, it also takes whatever slack the row has. */\n.time {\n composes: numeric from '@weasel-js/theme/numeric.module.css';\n display: inline-grid;\n margin-inline-start: auto;\n text-align: end;\n color: var(--wzl-fg-muted);\n}\n.rate { display: inline-flex; align-items: center; gap: var(--wzl-space-3); color: var(--wzl-fg-muted); }\n.rateSlider { width: 88px; }\n\n/* The detents carry no labels in a bar this dense, so the chosen rate is said\n once, here, in a cell as wide as the widest rate on offer. */\n.rateReadout {\n composes: numeric from '@weasel-js/theme/numeric.module.css';\n display: inline-grid;\n text-align: end;\n color: var(--wzl-fg);\n}\n\n.time > *,\n.rateReadout > * {\n grid-area: 1 / 1;\n}\n\n.sizer {\n composes: sizer from '../sizer.module.css';\n}\n\n.root {\n display: flex;\n flex-direction: column;\n min-height: 0;\n background: var(--wzl-surface);\n border: 1px solid var(--wzl-border);\n border-radius: var(--wzl-radius-sm);\n color: var(--wzl-fg);\n /* `--wzl-font-ui` is condensed, so it reads a size smaller than it measures.\n Everything below inherits this; override per rule only to go up. */\n font-family: var(--wzl-font-ui);\n font-size: var(--wzl-font-size-sm);\n line-height: var(--wzl-leading-snug);\n}\n\n.label { padding: var(--wzl-space-2) var(--wzl-space-3); color: var(--wzl-fg-muted); }\n\n.body { display: flex; align-items: stretch; }\n.gutter { box-sizing: border-box; flex: 0 0 var(--wzl-timeline-label-w, 120px); border-right: 1px solid var(--wzl-border); }\n.rulerWrap { flex: 1 1 auto; min-width: 0; }\n\n.lanes {\n flex: 1 1 auto;\n min-height: 0;\n overflow-y: auto;\n overflow-x: hidden;\n}\n\n.inspector {\n display: flex;\n align-items: center;\n gap: var(--wzl-space-4);\n padding: var(--wzl-space-2) var(--wzl-space-3);\n border-top: 1px solid var(--wzl-border);\n background: var(--wzl-surface-raised);\n}\n\n.segment {\n position: absolute;\n top: 0;\n bottom: 0;\n cursor: pointer;\n}\n\n.segment[aria-current='true'] { background: var(--wzl-accent-soft); }\n.segment:focus-visible { outline: 2px solid var(--wzl-focus-ring); outline-offset: -2px; }\n\n.easingPicker { display: inline-flex; align-items: center; gap: var(--wzl-space-3); }\n.easingLabel { composes: numeric from '@weasel-js/theme/numeric.module.css'; color: var(--wzl-fg-muted); }\n\n.easingPreview {\n width: 32px;\n height: 32px; /* not-a-control */\n fill: none;\n stroke: var(--wzl-accent-strong);\n stroke-width: 1;\n border: 1px solid var(--wzl-border);\n}\n\n","import { EASINGS, resolveEasing, type EasingName, type EasingSpec } from '@weasel-js/core';\n\nfunction bezierOf(spec: EasingSpec): readonly [number, number, number, number] | null {\n if (typeof spec === 'object' && spec !== null && 'bezier' in spec) return spec.bezier;\n return null;\n}\n\n/** Control points, for the graph view's draggable handles. `null` means this\n * spec has no handles to drag — the view offers to convert it to a bezier. */\nexport function easingBezier(spec?: EasingSpec): readonly [number, number, number, number] | null {\n if (spec === undefined) return null;\n return bezierOf(spec);\n}\n\n/** What the picker shows for a spec.\n *\n * A function is matched against the built-ins by reference so a consumer that\n * passed `easeOutBack` directly still reads back as `'easeOutBack'`. A wrapped\n * or hand-written function cannot be named and reads as `'custom'` — which is\n * why an editor writes names and control points rather than functions. */\nexport function easingLabel(spec?: EasingSpec): string {\n if (spec === undefined) return 'linear';\n if (typeof spec === 'string') return spec;\n const b = bezierOf(spec);\n if (b) return `cubic-bezier(${b.join(', ')})`;\n for (const [name, fn] of Object.entries(EASINGS)) {\n if (fn === spec) return name;\n }\n return 'custom';\n}\n\n/** `count` evenly spaced samples of the curve over 0..1, for drawing it. */\nexport function sampleEasing(spec: EasingSpec | undefined, count: number): number[] {\n const fn = resolveEasing(spec);\n const out = new Array<number>(count);\n const last = count - 1;\n for (let i = 0; i < count; i++) out[i] = fn(last === 0 ? 0 : i / last);\n return out;\n}\n\n/** Every built-in name, for the picker's list. */\nexport const EASING_NAMES = Object.keys(EASINGS) as EasingName[];\n","import type { ReactElement } from 'react';\nimport type { EasingSpec } from '@weasel-js/core';\nimport s from './Timeline.module.css';\nimport { EASING_NAMES, easingBezier, easingLabel, sampleEasing } from './easingSpec';\n\n/** Samples drawn in the inline curve preview. */\nconst PREVIEW_SAMPLES = 24;\n\n/** Control points for the named curves the picker can convert. A name the table\n * does not cover converts to the CSS default rather than refusing. */\nconst BEZIER_OF: Partial<Record<string, readonly [number, number, number, number]>> = {\n linear: [0, 0, 1, 1],\n easeInQuad: [0.11, 0, 0.5, 0],\n easeOutQuad: [0.5, 1, 0.89, 1],\n easeInOutQuad: [0.45, 0, 0.55, 1],\n easeInCubic: [0.32, 0, 0.67, 0],\n easeOutCubic: [0.33, 1, 0.68, 1],\n easeInOutCubic: [0.65, 0, 0.35, 1],\n easeInSine: [0.12, 0, 0.39, 0],\n easeOutSine: [0.61, 1, 0.88, 1],\n easeInOutSine: [0.37, 0, 0.63, 1],\n};\n\nconst DEFAULT_BEZIER: readonly [number, number, number, number] = [0.25, 0.1, 0.25, 1];\n\n/** Props for {@link EasingPicker}. `undefined` is linear. */\nexport interface EasingPickerProps {\n value: EasingSpec | undefined;\n onChange: (next: EasingSpec | undefined) => void;\n}\n\n/** A key's easing: a menu of the named curves, a button converting a named\n * curve to its cubic-bezier control points, and a plot of the curve. */\nexport function EasingPicker(props: EasingPickerProps): ReactElement {\n const { value, onChange } = props;\n const bezier = easingBezier(value);\n const label = easingLabel(value);\n const named = bezier === null && (EASING_NAMES as string[]).includes(label);\n const selectValue = bezier !== null ? 'custom' : named ? label : 'linear';\n\n const points = sampleEasing(value, PREVIEW_SAMPLES)\n .map((v, i) => `${(i / (PREVIEW_SAMPLES - 1)) * 100},${100 - v * 100}`)\n .join(' ');\n\n return (\n <div className={s.easingPicker}>\n <label>\n Easing\n <select\n value={selectValue}\n onChange={(e) => onChange(e.target.value === 'linear' ? undefined : e.target.value as EasingSpec)}\n >\n <option value=\"linear\">linear</option>\n {EASING_NAMES.filter((n) => n !== 'linear').map((n) => <option key={n} value={n}>{n}</option>)}\n {bezier !== null ? <option value=\"custom\">custom</option> : null}\n </select>\n </label>\n\n {bezier !== null ? <span className={s.easingLabel}>{label}</span> : (\n <button\n type=\"button\"\n className={s.transportButton}\n onClick={() => onChange({ bezier: BEZIER_OF[selectValue] ?? DEFAULT_BEZIER })}\n >\n Convert to bezier\n </button>\n )}\n\n <svg className={s.easingPreview} data-testid=\"easing-preview\" viewBox=\"0 0 100 100\" preserveAspectRatio=\"none\">\n <polyline points={points} vectorEffect=\"non-scaling-stroke\" />\n </svg>\n </div>\n );\n}\n","import { niceStep } from '../Plot2D/ticks';\n\n/** A visible span of timeline time, in ms. */\nexport interface TimeWindow {\n from: number;\n to: number;\n}\n\nexport interface TimeScale {\n window: TimeWindow;\n widthPx: number;\n toPx(ms: number): number;\n toMs(px: number): number;\n}\n\n/** Narrowest window the user can zoom to, in ms. Below this the playhead and\n * the keys it sits between stop being separable at any sane track width. */\nconst MIN_SPAN_MS = 1;\n\nexport function createTimeScale(window: TimeWindow, widthPx: number): TimeScale {\n const span = window.to - window.from;\n const perMs = span === 0 ? 0 : widthPx / span;\n const perPx = widthPx === 0 ? 0 : span / widthPx;\n return {\n window,\n widthPx,\n toPx: (ms) => (ms - window.from) * perMs,\n toMs: (px) => window.from + px * perPx,\n };\n}\n\n/** Where `ms` sits in the window, as a fraction. The width-free half of\n * `createTimeScale` — a CSS `left: %` needs no pixel width, and asking for one\n * is what drove three copies of this arithmetic into the lane and the ruler. */\nexport function toFraction(window: TimeWindow, ms: number): number {\n const span = window.to - window.from;\n return span === 0 ? 0 : (ms - window.from) / span;\n}\n\n/** `toFraction` as a CSS percentage. */\nexport function toPercent(window: TimeWindow, ms: number): string {\n return `${toFraction(window, ms) * 100}%`;\n}\n\n/** A duration as a fraction of the window. Distinct from `toFraction`, which\n * measures a position and so subtracts `window.from`. */\nexport function spanFraction(window: TimeWindow, ms: number): number {\n const span = window.to - window.from;\n return span === 0 ? 0 : ms / span;\n}\n\n/** A duration as a CSS percentage, for a width. */\nexport function spanPercent(window: TimeWindow, ms: number): string {\n return `${spanFraction(window, ms) * 100}%`;\n}\n\nfunction clampWindow(w: TimeWindow, bounds: TimeWindow): TimeWindow {\n const span = Math.min(w.to - w.from, bounds.to - bounds.from);\n let from = w.from;\n if (from < bounds.from) from = bounds.from;\n if (from + span > bounds.to) from = bounds.to - span;\n return { from, to: from + span };\n}\n\n/** Scale the window by `factor` about `atMs`, which stays at the same fraction\n * of the track. `factor < 1` zooms in. */\nexport function zoomWindow(\n w: TimeWindow, atMs: number, factor: number, bounds: TimeWindow,\n): TimeWindow {\n const span = w.to - w.from;\n const maxSpan = bounds.to - bounds.from;\n const nextSpan = Math.min(maxSpan, Math.max(MIN_SPAN_MS, span * factor));\n const frac = span === 0 ? 0.5 : (atMs - w.from) / span;\n return clampWindow({ from: atMs - frac * nextSpan, to: atMs + (1 - frac) * nextSpan }, bounds);\n}\n\n/** Shift the window by `byMs`, preserving its span. */\nexport function panWindow(w: TimeWindow, byMs: number, bounds: TimeWindow): TimeWindow {\n return clampWindow({ from: w.from + byMs, to: w.to + byMs }, bounds);\n}\n\n/** Minimum gap between time ticks, in px — the ruler's and the graph grid's. */\nexport const TICK_SPACING_PX = 64;\n\n/** Ruler tick times inside `w`, spaced at least `minSpacingPx` apart. */\nexport function tickTimes(w: TimeWindow, widthPx: number, minSpacingPx: number): number[] {\n const span = w.to - w.from;\n if (widthPx <= 0 || span <= 0) return [];\n const step = niceStep((minSpacingPx / widthPx) * span);\n const out: number[] = [];\n for (let t = Math.ceil(w.from / step) * step; t <= w.to + 1e-9; t += step) {\n out.push(Math.round(t / step) * step);\n }\n return out;\n}\n","import { useLayoutEffect, useMemo, useRef, useState, type ReactElement } from 'react';\nimport { useLatest, type Keyframe } from '@weasel-js/core';\nimport { LayeredCurveEditor } from '../CurveEditor/LayeredCurveEditor';\nimport {\n applyKeyframeDrag, createKeyframeLayer, type KeyframeLayerState,\n} from '../CurveEditor/createKeyframeLayer';\nimport s from './Timeline.module.css';\nimport { TICK_SPACING_PX, tickTimes, type TimeWindow } from './timeScale';\n\n/** Keeps the extreme keys inside the lane: at the very edge a key centers on\n * the lane's border and hangs half into its neighbor. As a percentage of\n * the lane's height, applied top and bottom. */\nconst V_INSET_PCT = 8;\n\n/** One arrow-key step, in ms; shift multiplies by ten. */\nconst KEY_STEP_MS = 10;\n\nexport interface LaneGraphProps {\n keys: readonly Keyframe<number>[];\n label: string;\n window: TimeWindow;\n /** Ruler time of this track's zero. */\n offset: number;\n /** Ruler times a dragged key snaps to. */\n snapTimes: readonly number[];\n selection: number | null;\n selectedSegment: number | null;\n onSelect: (keyIndex: number) => void;\n onSelectSegment?: (keyIndex: number) => void;\n /** Live during a key drag. */\n onKeysInput?: (keys: readonly Keyframe<number>[]) => void;\n /** Once per edit: a drag's end, a handle's release, a key press. */\n onKeysCommit: (keys: readonly Keyframe<number>[]) => void;\n}\n\n/** The value range a lane plots: its keys' extent, padded so no key sits on\n * the border. A flat track gets a unit span so it still has a middle. */\nfunction valueRange(keys: readonly Keyframe<number>[]): [number, number] {\n const values = keys.map((k) => k.value);\n const lo = Math.min(...values);\n const hi = Math.max(...values);\n const span = hi - lo || 1;\n const pad = (span * V_INSET_PCT) / (100 - 2 * V_INSET_PCT);\n return [lo - pad, lo + span + pad];\n}\n\n/** A numeric lane's graph: one keyframe layer on a curve editor, sized to the\n * lane and windowed to the ruler. */\nexport function LaneGraph(props: LaneGraphProps): ReactElement {\n const {\n keys, label, window: win, offset, snapTimes, selection, selectedSegment,\n onSelect, onSelectSegment, onKeysInput, onKeysCommit,\n } = props;\n\n const hostRef = useRef<HTMLDivElement | null>(null);\n const [size, setSize] = useState({ width: 0, height: 0 });\n useLayoutEffect(() => {\n const el = hostRef.current;\n if (!el) return;\n const update = (): void => {\n const r = el.getBoundingClientRect();\n setSize((prev) => (prev.width === r.width && prev.height === r.height ? prev : { width: r.width, height: r.height }));\n };\n update();\n if (typeof ResizeObserver === 'undefined') return;\n const ro = new ResizeObserver(update);\n ro.observe(el);\n return () => ro.disconnect();\n }, []);\n\n const layer = useMemo(() => createKeyframeLayer({\n id: 'keys',\n label,\n formatX: (t) => `${Math.round(t)} ms`,\n // The layer works in track time; the snap candidates are ruler times.\n snapX: snapTimes.map((t) => t - offset),\n xClamp: [0, Infinity],\n step: { x: KEY_STEP_MS },\n }), [label, snapTimes, offset]);\n\n const committed = useMemo<KeyframeLayerState>(\n () => ({ keys, selectedKey: selection, selectedSegment, drag: null }),\n [keys, selection, selectedSegment],\n );\n // Held only while a gesture is in flight, so a consumer echoing live input\n // back through `keys` cannot move the keys out from under the drag.\n const [live, setLive] = useState<KeyframeLayerState | null>(null);\n const state = live ?? committed;\n const stateRef = useLatest(state);\n\n const layers = useMemo(() => [{ layer, state: state as unknown }], [layer, state]);\n\n const onLayerChange = (_id: string, raw: unknown): void => {\n const next = raw as KeyframeLayerState;\n const prev = stateRef.current;\n if (next.selectedKey !== null && next.selectedKey !== prev.selectedKey) onSelect(next.selectedKey);\n if (next.selectedSegment !== null && next.selectedSegment !== prev.selectedSegment) onSelectSegment?.(next.selectedSegment);\n if (!next.drag) { setLive(null); return; }\n setLive(next);\n // A handle drag writes a fresh easing spec per move; publishing those\n // would grow the consumer's easing cache by one entry per pixel.\n if (next.drag.kind !== 'key') return;\n const applied = applyKeyframeDrag(next).keys;\n if (applied !== next.keys) onKeysInput?.(applied);\n };\n\n const onLayerCommit = (_id: string, raw: unknown, rawPrev: unknown): void => {\n setLive(null);\n const next = raw as KeyframeLayerState;\n if (next.keys !== (rawPrev as KeyframeLayerState).keys) onKeysCommit(next.keys);\n };\n\n const [yLo, yHi] = valueRange(state.keys);\n const ticks = size.width > 0 ? tickTimes(win, size.width, TICK_SPACING_PX) : [];\n\n return (\n <div ref={hostRef} className={s.graphHost}>\n {size.width > 0 && size.height > 0 ? (\n <LayeredCurveEditor\n className={s.graph}\n aria-label={`${label} graph`}\n layers={layers}\n onLayerChange={onLayerChange}\n onLayerCommit={onLayerCommit}\n width={size.width}\n height={size.height}\n xRange={[win.from - offset, win.to - offset]}\n yRange={[yLo, yHi]}\n grid={false}\n axes={false}\n // The ruler's ticks, carried into track time.\n xTicks={{ values: ticks.map((t) => t - offset), labels: false }}\n // Clears a key at the track's start edge, which hangs into the gutter.\n yTicks={{ labels: 'outside', gap: 10 }}\n history={false}\n />\n ) : null}\n </div>\n );\n}\n","import { useEffect, useRef, useState, type KeyboardEvent as ReactKeyboardEvent, type PointerEvent as ReactPointerEvent, type ReactElement } from 'react';\nimport { openPointerSession, type EventTrack, type Keyframe, type PointerSession, type SampledTrack, type TimelineTrack } from '@weasel-js/core';\nimport { DisclosureMark } from '../Disclosure';\nimport s from './Timeline.module.css';\nimport { createTimeScale, spanPercent, toPercent, type TimeWindow } from './timeScale';\nimport { SNAP_RADIUS_PX, snapToNearest } from '../../snap';\nimport { LaneGraph } from './LaneGraph';\nimport type { LaneRow } from './lanes';\n\n/** One arrow-key step, in ms; shift multiplies by ten. */\nconst KEY_STEP_MS = 10;\n\nexport interface LaneProps {\n row: LaneRow;\n window: TimeWindow;\n mode: 'dope' | 'graph';\n /** Index of the selected key on THIS row, or null. */\n selection: number | null;\n onSelect: (keyIndex: number) => void;\n /** Live during a dope-sheet drag. */\n onKeyInput: (keyIndex: number, toMs: number) => void;\n /** Once, at the end of a dope-sheet gesture. */\n onKeyCommit: (keyIndex: number, toMs: number) => void;\n /** Live during a graph-mode key drag: the row's whole key list. */\n onKeysInput?: (keys: readonly Keyframe<number>[]) => void;\n /** Once per graph-mode edit: the row's whole key list. */\n onKeysCommit?: (keys: readonly Keyframe<number>[]) => void;\n onInsert: (atMs: number) => void;\n onToggleExpand: () => void;\n expanded: boolean;\n /** Times a dragged key snaps to. */\n snapTimes: readonly number[];\n /** Index of the key a selected segment runs INTO, or null. */\n selectedSegment?: number | null;\n onSelectSegment?: (keyIndex: number) => void;\n}\n\nfunction entryTimes(row: LaneRow): number[] {\n if (row.kind === 'sampled') return (row.track as SampledTrack<unknown>).keys.map((k) => k.t);\n if (row.kind === 'event') return (row.track as EventTrack).events.map((e) => e.t);\n return [];\n}\n\nexport function Lane(props: LaneProps): ReactElement {\n const {\n row, window: win, mode, selection, onSelect, onKeyInput, onKeyCommit, onInsert, onToggleExpand, expanded, snapTimes,\n selectedSegment = null, onSelectSegment, onKeysInput, onKeysCommit,\n } = props;\n const trackRef = useRef<HTMLDivElement | null>(null);\n const sessionRef = useRef<PointerSession | null>(null);\n useEffect(() => () => { sessionRef.current?.cancel(); }, []);\n\n // Where the dragged key would land. Owned here rather than derived from the\n // tracks prop, so a drag previews whether or not the consumer wires\n // `onKeyInput` — the committed key stays put underneath as the origin.\n const [drag, setDrag] = useState<{ keyIndex: number; t: number } | null>(null);\n\n const pct = (ms: number): string => toPercent(win, ms + row.offset);\n\n const msAt = (clientX: number): number => {\n const rect = trackRef.current?.getBoundingClientRect();\n if (!rect) return win.from;\n return createTimeScale(win, rect.width).toMs(clientX - rect.left) - row.offset;\n };\n\n const snapPxToMs = (): number => {\n const width = trackRef.current?.getBoundingClientRect().width ?? 0;\n const scale = createTimeScale(win, width);\n return scale.toMs(SNAP_RADIUS_PX) - scale.toMs(0);\n };\n\n // Only a numeric sampled row has an honest value axis to graph.\n const graph = mode === 'graph' && row.numeric;\n const sampledKeys = row.kind === 'sampled' ? (row.track as SampledTrack<number>).keys : [];\n\n const onKeyPointerDown = (i: number) => (e: ReactPointerEvent<HTMLDivElement>): void => {\n if (e.button !== 0) return;\n e.stopPropagation();\n onSelect(i);\n\n // `snapTimes` are ruler times and `msAt` is track-local, so a nested row\n // has to cross into ruler space to snap and back out to commit.\n const at = (ev: { clientX: number; altKey: boolean }): number => {\n const raw = Math.max(0, msAt(ev.clientX));\n return ev.altKey ? raw : snapToNearest(raw + row.offset, snapTimes, snapPxToMs()) - row.offset;\n };\n\n setDrag({ keyIndex: i, t: times[i] });\n\n const end = (): void => {\n setDrag(null);\n sessionRef.current = null;\n };\n // No pointer capture — see `Ruler`, same idiom across the timeline.\n sessionRef.current?.cancel();\n sessionRef.current = openPointerSession(e.currentTarget, e, {\n onMove: (ev) => {\n setDrag({ keyIndex: i, t: at(ev) });\n onKeyInput(i, at(ev));\n },\n onEnd: (ev) => {\n onKeyCommit(i, at(ev));\n end();\n },\n onCancel: end,\n }, { capture: false });\n };\n\n const onKeyDown = (i: number, t: number) => (e: ReactKeyboardEvent<HTMLDivElement>): void => {\n const step = KEY_STEP_MS * (e.shiftKey ? 10 : 1);\n if (e.key === 'ArrowRight') { e.preventDefault(); onKeyCommit(i, t + step); }\n if (e.key === 'ArrowLeft') { e.preventDefault(); onKeyCommit(i, Math.max(0, t - step)); }\n };\n\n const times = entryTimes(row);\n\n return (\n <div className={s.lane} data-depth={row.depth} data-mode={mode} data-graph={graph ? 'true' : undefined}>\n <div className={s.laneLabel}>\n {row.kind === 'timeline' ? (\n <span\n role=\"button\"\n tabIndex={0}\n aria-expanded={expanded}\n data-testid=\"timeline-disclosure\"\n className={s.disclosure}\n onClick={onToggleExpand}\n onKeyDown={(e) => { if (e.key === 'Enter' || e.key === ' ') { e.preventDefault(); onToggleExpand(); } }}\n >\n <DisclosureMark open={expanded} />\n </span>\n ) : null}\n {row.label}\n </div>\n <div\n className={s.laneTrack}\n ref={trackRef}\n data-testid=\"timeline-lane-track\"\n onDoubleClick={(e) => { if (row.kind === 'sampled') onInsert(Math.max(0, msAt(e.clientX))); }}\n >\n {graph ? (\n <LaneGraph\n keys={sampledKeys}\n label={row.label}\n window={win}\n offset={row.offset}\n snapTimes={snapTimes}\n selection={selection}\n selectedSegment={selectedSegment}\n onSelect={onSelect}\n onSelectSegment={onSelectSegment}\n onKeysInput={onKeysInput}\n onKeysCommit={(keys) => onKeysCommit?.(keys)}\n />\n ) : (\n <>\n {row.kind === 'timeline' ? (\n <div\n className={s.nestedBar}\n data-testid=\"timeline-nested\"\n style={{ left: pct(0), width: spanPercent(win, (row.track as TimelineTrack).timeline.duration ?? 0) }}\n />\n ) : null}\n {row.kind === 'sampled' ? sampledKeys.slice(1).map((k, idx) => {\n const i = idx + 1;\n return (\n <div\n key={`seg-${i}`}\n role=\"button\"\n tabIndex={0}\n aria-label={`${row.label} segment into ${Math.round(k.t)} ms`}\n aria-current={selectedSegment === i ? 'true' : undefined}\n data-testid=\"timeline-segment\"\n className={s.segment}\n style={{ left: pct(sampledKeys[i - 1].t), width: spanPercent(win, k.t - sampledKeys[i - 1].t) }}\n onClick={() => onSelectSegment?.(i)}\n onKeyDown={(e) => { if (e.key === 'Enter' || e.key === ' ') { e.preventDefault(); onSelectSegment?.(i); } }}\n />\n );\n }) : null}\n {times.map((t, i) => (\n <div\n key={i}\n role=\"button\"\n tabIndex={0}\n aria-label={`${row.label} key at ${Math.round(t)} ms`}\n aria-current={selection === i ? 'true' : undefined}\n data-testid={row.kind === 'event' ? 'timeline-event' : 'timeline-key'}\n data-dragging={drag?.keyIndex === i ? 'true' : undefined}\n className={row.kind === 'event' ? s.eventMark : s.key}\n style={{ left: pct(t) }}\n onPointerDown={onKeyPointerDown(i)}\n onKeyDown={onKeyDown(i, t)}\n />\n ))}\n {drag ? (\n <div\n aria-hidden=\"true\"\n data-testid=\"timeline-key-ghost\"\n className={row.kind === 'event' ? s.eventGhost : s.keyGhost}\n style={{ left: pct(drag.t) }}\n />\n ) : null}\n </>\n )}\n </div>\n </div>\n );\n}\n","import { useEffect, useLayoutEffect, useRef, useState, type PointerEvent as ReactPointerEvent, type ReactElement, type WheelEvent as ReactWheelEvent } from 'react';\nimport { openPointerSession, type PointerSession } from '@weasel-js/core';\nimport s from './Timeline.module.css';\nimport { createTimeScale, panWindow, TICK_SPACING_PX, tickTimes, toPercent, zoomWindow, type TimeWindow } from './timeScale';\n\n/** One wheel notch's zoom factor. */\nconst ZOOM_STEP = 0.0015;\n\nexport interface RulerProps {\n window: TimeWindow;\n /** The full extent the window may cover — normally `{ from: 0, to: duration }`. */\n bounds: TimeWindow;\n playhead: number;\n onScrub: (t: number) => void;\n onWindowChange: (w: TimeWindow) => void;\n}\n\nfunction formatMs(ms: number): string {\n if (ms >= 1000) return `${(ms / 1000).toFixed(ms % 1000 === 0 ? 0 : 2)}s`;\n return `${Math.round(ms)}ms`;\n}\n\nexport function Ruler(props: RulerProps): ReactElement {\n const { window: win, bounds, playhead, onScrub, onWindowChange } = props;\n const trackRef = useRef<HTMLDivElement | null>(null);\n const sessionRef = useRef<PointerSession | null>(null);\n useEffect(() => () => { sessionRef.current?.cancel(); }, []);\n\n // Re-render once the track is mounted so ticks lay out against its real\n // width — `trackRef.current` is null on the render that first attaches it.\n const [width, setWidth] = useState(0);\n useLayoutEffect(() => {\n const el = trackRef.current;\n if (!el) return;\n const update = (): void => setWidth(el.getBoundingClientRect().width);\n update();\n if (typeof ResizeObserver === 'undefined') return;\n const ro = new ResizeObserver(update);\n ro.observe(el);\n return () => ro.disconnect();\n }, []);\n\n const widthOf = (): number => trackRef.current?.getBoundingClientRect().width ?? 0;\n const msAt = (clientX: number): number => {\n const rect = trackRef.current?.getBoundingClientRect();\n if (!rect) return win.from;\n const scale = createTimeScale(win, rect.width);\n const raw = scale.toMs(clientX - rect.left);\n return Math.min(win.to, Math.max(win.from, raw));\n };\n\n // `capture: false`: the session tracks the pointer off the ruler on its own,\n // and capture would retarget pointerup and kill the click on non-native\n // children of the scrubbed track.\n const onPointerDown = (e: ReactPointerEvent<HTMLDivElement>): void => {\n if (e.button !== 0) return;\n onScrub(msAt(e.clientX));\n\n sessionRef.current?.cancel();\n const end = (): void => { sessionRef.current = null; };\n sessionRef.current = openPointerSession(e.currentTarget, e, {\n onMove: (ev) => { onScrub(msAt(ev.clientX)); },\n onEnd: end,\n onCancel: end,\n }, { capture: false });\n };\n\n const onWheel = (e: ReactWheelEvent<HTMLDivElement>): void => {\n if (e.ctrlKey) {\n onWindowChange(zoomWindow(win, msAt(e.clientX), Math.exp(e.deltaY * ZOOM_STEP), bounds));\n } else {\n const width = widthOf();\n const perPx = width === 0 ? 0 : (win.to - win.from) / width;\n onWindowChange(panWindow(win, e.deltaY * perPx, bounds));\n }\n };\n\n const ticks = tickTimes(win, width, TICK_SPACING_PX);\n const pct = (ms: number): string => toPercent(win, ms);\n\n return (\n <div\n className={s.ruler}\n ref={trackRef}\n data-testid=\"timeline-ruler\"\n onPointerDown={onPointerDown}\n onWheel={onWheel}\n >\n {ticks.map((t) => (\n <span\n key={t}\n className={s.tick}\n data-testid=\"timeline-tick\"\n style={{ left: pct(t) }}\n >\n {formatMs(t)}\n </span>\n ))}\n <div\n className={s.playhead}\n data-testid=\"timeline-playhead\"\n style={{ left: pct(playhead) }}\n />\n </div>\n );\n}\n","import type { ReactElement } from 'react';\nimport { multiplier, qty } from '@weasel-js/quantity';\nimport { DetentSlider } from '../DetentSlider';\nimport { PauseIcon, PlayIcon } from '../../icons';\nimport s from './Timeline.module.css';\n\nconst RATE = multiplier({ symbol: 'x' });\n\n/** Playback rates the transport offers. */\nconst RATES = [0.25, 0.5, 1, 2, 4] as const;\n\n/** Props for {@link Transport}. Times are in ms. */\nexport interface TransportProps {\n paused: boolean;\n /** A `TimelineHandle`'s loop policy. The switch shows any value but\n * `false` or `0` as on, and toggles between `true` and `false`. */\n loop: boolean | number;\n /** Playback speed multiplier. A rate off the offered detents gets one of its own. */\n rate: number;\n playhead: number;\n duration: number;\n onPlay: () => void;\n onPause: () => void;\n onLoopChange: (loop: boolean | number) => void;\n onRateChange: (rate: number) => void;\n}\n\nconst seconds = (ms: number): string => `${(ms / 1000).toFixed(2)}s`;\nconst rateText = (r: number): string => qty(r, RATE).text;\n\n/** Play/pause, a loop switch, a rate slider, and the playhead over the\n * duration in seconds. Holds no state: every control reports through a callback. */\nexport function Transport(props: TransportProps): ReactElement {\n const { paused, loop, rate, playhead, duration, onPlay, onPause, onLoopChange, onRateChange } = props;\n const looping = loop !== false && loop !== 0;\n // The handle's scale is whatever anything holding it set, so an off-list rate\n // gets its own detent — `DetentSlider` would otherwise round it to the\n // nearest and label the thumb with a rate the timeline is not running at.\n const rates = RATES.includes(rate as typeof RATES[number])\n ? (RATES as readonly number[])\n : [...RATES, rate].sort((a, b) => a - b);\n\n return (\n <div className={s.transport}>\n <button\n type=\"button\"\n className={s.transportButton}\n aria-label={paused ? 'Play' : 'Pause'}\n onClick={paused ? onPlay : onPause}\n >\n {paused ? <PlayIcon size={14} /> : <PauseIcon size={14} />}\n </button>\n\n <button\n type=\"button\"\n role=\"switch\"\n aria-checked={looping}\n aria-label=\"Loop\"\n className={s.transportButton}\n onClick={() => onLoopChange(!looping)}\n >\n ⟲\n </button>\n\n <div className={s.rate}>\n Rate\n <DetentSlider\n ariaLabel=\"Rate\"\n items={rates.map((r) => ({ value: r, ariaLabel: qty(r, RATE).spoken }))}\n value={rate}\n onChange={onRateChange}\n formatLabel={rateText}\n labels=\"none\"\n className={s.rateSlider}\n />\n <span className={s.rateReadout}>\n <span>{rateText(rate)}</span>\n <span className={s.sizer} aria-hidden=\"true\">\n {rates.map((r) => <span key={r}>{rateText(r)}</span>)}\n </span>\n </span>\n </div>\n\n <span className={s.time}>\n <span data-testid=\"timeline-time\">\n {seconds(Math.min(Math.max(playhead, 0), duration))} / {seconds(duration)}\n </span>\n <span className={s.sizer} aria-hidden=\"true\">\n <span>{seconds(duration)} / {seconds(duration)}</span>\n </span>\n </span>\n </div>\n );\n}\n","import type { SampledTrack, Track } from '@weasel-js/core';\n\nexport interface LaneRow {\n /** Stable across re-renders and edits: the dotted index path. */\n key: string;\n /** Index path into the track tree, outermost first. */\n path: number[];\n track: Track;\n label: string;\n /** Nesting depth; 0 for a top-level track. */\n depth: number;\n /** Accumulated `at` from every nested parent, in ms. A key drawn on this row\n * sits at `offset + key.t` on the ruler. */\n offset: number;\n kind: Track['kind'];\n /** True only for a sampled track whose every key value is a number — the\n * sole case where a value axis has an honest meaning. */\n numeric: boolean;\n}\n\nfunction isNumeric(track: Track): boolean {\n if (track.kind !== 'sampled') return false;\n const keys = (track as SampledTrack<unknown>).keys;\n return keys.length > 0 && keys.every((k) => typeof k.value === 'number');\n}\n\n/** Flatten the track tree to rows, descending only into expanded nested\n * timelines. `expanded` holds the `key` of each open nested row. */\nexport function buildLanes(\n tracks: readonly Track[],\n expanded: ReadonlySet<string>,\n): LaneRow[] {\n const out: LaneRow[] = [];\n const walk = (list: readonly Track[], path: number[], depth: number, offset: number): void => {\n list.forEach((track, i) => {\n const nextPath = [...path, i];\n const key = nextPath.join('.');\n out.push({\n key,\n path: nextPath,\n track,\n label: track.label ?? `${track.kind} ${i}`,\n depth,\n offset,\n kind: track.kind,\n numeric: isNumeric(track),\n });\n if (track.kind === 'timeline' && expanded.has(key)) {\n walk(track.timeline.tracks, nextPath, depth + 1, offset + track.at);\n }\n });\n };\n walk(tracks, [], 0, 0);\n return out;\n}\n\n/** The track at an index path, or `undefined` when the path leaves the tree. */\nexport function trackAtPath(tracks: readonly Track[], path: readonly number[]): Track | undefined {\n let list: readonly Track[] = tracks;\n let found: Track | undefined;\n for (const i of path) {\n found = list[i];\n if (!found) return undefined;\n list = found.kind === 'timeline' ? found.timeline.tracks : [];\n }\n return found;\n}\n","import { sampleTrack, type EasingSpec, type EventTrack, type Keyframe, type SampledTrack, type TimelineTrack, type Track } from '@weasel-js/core';\nimport { trackAtPath } from './lanes';\n\n/** One keyframe, addressed by its track's place in the tree and its index in that track's `keys`. */\nexport interface KeySelection {\n /** Index path into the track tree, outermost first — a `LaneRow.path`. A\n * top-level track is `[i]`; a track inside the nested timeline at `i` is\n * `[i, j]`. */\n trackPath: readonly number[];\n keyIndex: number;\n}\n\nexport interface KeyEdit {\n tracks: Track[];\n selection: KeySelection | null;\n}\n\n/** True when two index paths address the same track. */\nexport function samePath(a: readonly number[], b: readonly number[]): boolean {\n return a.length === b.length && a.every((n, i) => n === b[i]);\n}\n\n/** Shallow-clone one track, replacing only its key list. `onTick`, `fire`,\n * `interpolate` and `interpolator` survive as references, which is what lets a\n * running timeline take an edited track without rewiring. */\nfunction withKeys(track: Track, keys: Keyframe<unknown>[]): Track {\n return { ...(track as SampledTrack<unknown>), keys } as Track;\n}\n\nfunction withEvents(track: Track, events: EventTrack['events']): Track {\n return { ...(track as EventTrack), events } as Track;\n}\n\n/** Replace the track at `path`, cloning the timeline tracks along the way so\n * the caller's tree is untouched at every level, not just the top. */\nfunction replaceAtPath(tracks: readonly Track[], path: readonly number[], next: Track): Track[] {\n const out = tracks.slice();\n const [i, ...rest] = path;\n if (rest.length === 0) {\n out[i] = next;\n return out;\n }\n const parent = out[i];\n if (parent?.kind !== 'timeline') return out;\n const tt = parent as TimelineTrack;\n out[i] = {\n ...tt,\n timeline: { ...tt.timeline, tracks: replaceAtPath(tt.timeline.tracks, rest, next) },\n };\n return out;\n}\n\n/** Move a key or an event crossing to `toMs`, clamped at zero. `toMs` is in the\n * addressed track's own time, not the ruler's — a nested track's keys are\n * measured from its parent's `at`.\n *\n * Re-sorts, and reports the moved entry's new index. `sampleTrack` binary-\n * searches without sorting first, so a drag past a neighbour that left the list\n * unsorted would sample the wrong segment and raise nothing. */\nexport function moveKey(\n tracks: readonly Track[], sel: KeySelection, toMs: number,\n): KeyEdit {\n const track = trackAtPath(tracks, sel.trackPath);\n const t = Math.max(0, toMs);\n\n if (track?.kind === 'sampled') {\n const st = track as SampledTrack<unknown>;\n const moved = { ...st.keys[sel.keyIndex], t };\n const keys = st.keys.filter((_, i) => i !== sel.keyIndex);\n const at = keys.findIndex((k) => k.t > t);\n const keyIndex = at === -1 ? keys.length : at;\n keys.splice(keyIndex, 0, moved);\n return {\n tracks: replaceAtPath(tracks, sel.trackPath, withKeys(track, keys)),\n selection: { trackPath: sel.trackPath, keyIndex },\n };\n }\n\n if (track?.kind === 'event') {\n const et = track as EventTrack;\n const moved = { ...et.events[sel.keyIndex], t };\n const events = et.events.filter((_, i) => i !== sel.keyIndex);\n const at = events.findIndex((e) => e.t > t);\n const keyIndex = at === -1 ? events.length : at;\n events.splice(keyIndex, 0, moved);\n return {\n tracks: replaceAtPath(tracks, sel.trackPath, withEvents(track, events)),\n selection: { trackPath: sel.trackPath, keyIndex },\n };\n }\n\n return { tracks: tracks.slice(), selection: sel };\n}\n\n/** Insert a key at `atMs`, seeded with whatever the track already reads there\n * so inserting alone never changes the motion. */\nexport function insertKey(\n tracks: readonly Track[], trackPath: readonly number[], atMs: number,\n): KeyEdit {\n const track = trackAtPath(tracks, trackPath);\n if (track?.kind !== 'sampled') return { tracks: tracks.slice(), selection: null };\n\n const st = track as SampledTrack<unknown>;\n const t = Math.max(0, atMs);\n const value = st.keys.length === 0 ? 0 : sampleTrack(st, t);\n const keys = st.keys.slice();\n const at = keys.findIndex((k) => k.t > t);\n const keyIndex = at === -1 ? keys.length : at;\n keys.splice(keyIndex, 0, { t, value });\n return {\n tracks: replaceAtPath(tracks, trackPath, withKeys(track, keys)),\n selection: { trackPath, keyIndex },\n };\n}\n\n/** Remove a key, selecting the one before it. */\nexport function deleteKey(tracks: readonly Track[], sel: KeySelection): KeyEdit {\n const track = trackAtPath(tracks, sel.trackPath);\n if (track?.kind !== 'sampled') return { tracks: tracks.slice(), selection: sel };\n\n const st = track as SampledTrack<unknown>;\n const keys = st.keys.filter((_, i) => i !== sel.keyIndex);\n return {\n tracks: replaceAtPath(tracks, sel.trackPath, withKeys(track, keys)),\n selection: keys.length === 0\n ? null\n : { trackPath: sel.trackPath, keyIndex: Math.max(0, sel.keyIndex - 1) },\n };\n}\n\n/** Set the easing shaping the approach INTO the selected key. */\nexport function setKeyEasing(\n tracks: readonly Track[], sel: KeySelection, easing: EasingSpec | undefined,\n): Track[] {\n const track = trackAtPath(tracks, sel.trackPath);\n if (track?.kind !== 'sampled') return tracks.slice();\n\n const st = track as SampledTrack<unknown>;\n const keys = st.keys.slice();\n const { easing: _drop, ...rest } = keys[sel.keyIndex];\n keys[sel.keyIndex] = easing === undefined ? rest : { ...rest, easing };\n return replaceAtPath(tracks, sel.trackPath, withKeys(track, keys));\n}\n\n/** Replace a sampled track's whole key list, keeping its callbacks. */\nexport function setKeys(\n tracks: readonly Track[], trackPath: readonly number[], keys: readonly Keyframe<unknown>[],\n): Track[] {\n const track = trackAtPath(tracks, trackPath);\n if (track?.kind !== 'sampled') return tracks.slice();\n return replaceAtPath(tracks, trackPath, withKeys(track, keys.slice()));\n}\n\n/** Set the selected key's value, leaving its time alone. */\nexport function setKeyValue(\n tracks: readonly Track[], sel: KeySelection, value: unknown,\n): Track[] {\n const track = trackAtPath(tracks, sel.trackPath);\n if (track?.kind !== 'sampled') return tracks.slice();\n\n const st = track as SampledTrack<unknown>;\n const keys = st.keys.slice();\n keys[sel.keyIndex] = { ...keys[sel.keyIndex], value };\n return replaceAtPath(tracks, sel.trackPath, withKeys(track, keys));\n}\n\nexport { snapToNearest as snapTime } from '../../snap';\n","import { useMemo, useState, type KeyboardEvent as ReactKeyboardEvent, type ReactElement, type ReactNode } from 'react';\nimport type { EasingSpec, Keyframe, SampledTrack, Track } from '@weasel-js/core';\nimport s from './Timeline.module.css';\nimport { EasingPicker } from './EasingPicker';\nimport { Lane } from './Lane';\nimport { Ruler } from './Ruler';\nimport { Transport, type TransportProps } from './Transport';\nimport { buildLanes, trackAtPath } from './lanes';\nimport { deleteKey, insertKey, moveKey, samePath, setKeyEasing, setKeys, setKeyValue, type KeySelection } from './keys';\nimport type { TimeWindow } from './timeScale';\n\nexport type { KeySelection } from './keys';\nexport type { TimeWindow } from './timeScale';\n\n/** What `renderKeyEditor` is handed for the selected keyframe. */\nexport interface KeyEditorCtx<T = unknown> {\n key: Keyframe<T>;\n track: SampledTrack<T>;\n selection: KeySelection;\n /** Replace the selected key's value — `next`'s time and easing are ignored.\n * Routed through this component's `onChange`. */\n commit: (next: Keyframe<T>) => void;\n /** Set the easing shaping the approach into this key. */\n setEasing: (easing: EasingSpec | undefined) => void;\n}\n\n/** Props for {@link Timeline}. Times are in ms. `selection` and `window` are\n * controlled when given and held internally otherwise. */\nexport interface TimelineProps {\n tracks: readonly Track[];\n duration: number;\n playhead: number;\n\n /** Keys as marks on a row (`'dope'`, the default), or plotted as a value\n * curve (`'graph'`) on rows whose values are numbers. */\n mode?: 'dope' | 'graph';\n onModeChange?: (mode: 'dope' | 'graph') => void;\n\n /** Live during a drag — wire for preview, do not write to history. */\n onInput?: (next: Track[]) => void;\n /** Committed at gesture end: one call per gesture. */\n onChange: (next: Track[]) => void;\n onScrub: (t: number) => void;\n\n /** `false` hides the transport. */\n transport?: Omit<TransportProps, 'playhead' | 'duration'> | false;\n selection?: KeySelection | null;\n onSelect?: (sel: KeySelection | null) => void;\n renderKeyEditor?: (ctx: KeyEditorCtx) => ReactNode;\n\n window?: TimeWindow;\n onWindowChange?: (w: TimeWindow) => void;\n\n label?: ReactNode;\n className?: string;\n}\n\n/** A keyframe editor for a set of tracks: a ruler to scrub and zoom on, a\n * lane per track, and a transport. Every edit comes back through `onChange`\n * as a new track array; Delete or Backspace removes the selected key. */\nexport function Timeline(props: TimelineProps): ReactElement {\n const {\n tracks, duration, playhead,\n onInput, onChange, onScrub,\n renderKeyEditor, label, className,\n } = props;\n\n const [expanded, setExpanded] = useState<ReadonlySet<string>>(() => new Set());\n const [ownWindow, setOwnWindow] = useState<TimeWindow>({ from: 0, to: duration });\n const [ownSelection, setOwnSelection] = useState<KeySelection | null>(null);\n const [segmentSelection, setSegmentSelection] = useState<KeySelection | null>(null);\n\n const win = props.window ?? ownWindow;\n const setWindow = props.onWindowChange ?? setOwnWindow;\n const selection = props.selection !== undefined ? props.selection : ownSelection;\n const setSelection = props.onSelect ?? setOwnSelection;\n\n const bounds: TimeWindow = { from: 0, to: duration };\n const rows = useMemo(() => buildLanes(tracks, expanded), [tracks, expanded]);\n\n /** Every key time on every row — what a dragged key snaps to. */\n const snapTimes = useMemo(() => {\n const out = new Set<number>([0, duration]);\n for (const row of rows) {\n if (row.kind === 'sampled') for (const k of (row.track as SampledTrack<unknown>).keys) out.add(k.t + row.offset);\n }\n return [...out];\n }, [rows, duration]);\n\n const toggle = (key: string): void => {\n setExpanded((prev) => {\n const next = new Set(prev);\n if (next.has(key)) next.delete(key); else next.add(key);\n return next;\n });\n };\n\n const onRootKeyDown = (e: ReactKeyboardEvent<HTMLDivElement>): void => {\n if ((e.key === 'Delete' || e.key === 'Backspace') && selection) {\n e.preventDefault();\n const r = deleteKey(tracks, selection);\n onChange(r.tracks);\n setSelection(r.selection);\n }\n };\n\n const selectedTrack = selection ? trackAtPath(tracks, selection.trackPath) : undefined;\n const selectedKey = selectedTrack?.kind === 'sampled'\n ? (selectedTrack as SampledTrack<unknown>).keys[selection!.keyIndex]\n : undefined;\n\n const segmentTrack = segmentSelection ? trackAtPath(tracks, segmentSelection.trackPath) : undefined;\n const segmentKey = segmentTrack?.kind === 'sampled'\n ? (segmentTrack as SampledTrack<unknown>).keys[segmentSelection!.keyIndex]\n : undefined;\n\n return (\n <div\n className={[s.root, className].filter(Boolean).join(' ')}\n data-testid=\"timeline-root\"\n tabIndex={-1}\n onKeyDown={onRootKeyDown}\n >\n {label ? <div className={s.label}>{label}</div> : null}\n\n {props.transport === false ? null : (\n <div className={s.transportRow}>\n <Transport\n {...(props.transport ?? {\n paused: true, loop: false, rate: 1,\n onPlay: () => {}, onPause: () => {},\n onLoopChange: () => {}, onRateChange: () => {},\n })}\n playhead={playhead}\n duration={duration}\n />\n <button\n type=\"button\"\n role=\"switch\"\n aria-checked={(props.mode ?? 'dope') === 'graph'}\n aria-label=\"Graph mode\"\n className={s.transportButton}\n onClick={() => props.onModeChange?.((props.mode ?? 'dope') === 'graph' ? 'dope' : 'graph')}\n >\n Graph\n </button>\n </div>\n )}\n\n <div className={s.body}>\n <div className={s.gutter} />\n <div className={s.rulerWrap}>\n <Ruler\n window={win}\n bounds={bounds}\n playhead={playhead}\n onScrub={onScrub}\n onWindowChange={setWindow}\n />\n </div>\n </div>\n\n <div className={s.lanes}>\n {rows.map((row) => {\n const trackPath = row.path;\n return (\n <Lane\n key={row.key}\n row={row}\n window={win}\n mode={props.mode ?? 'dope'}\n selection={selection && samePath(selection.trackPath, trackPath) ? selection.keyIndex : null}\n expanded={expanded.has(row.key)}\n snapTimes={snapTimes}\n onToggleExpand={() => toggle(row.key)}\n onSelect={(keyIndex) => setSelection({ trackPath, keyIndex })}\n onKeyInput={(keyIndex, toMs) => {\n onInput?.(moveKey(tracks, { trackPath, keyIndex }, toMs).tracks);\n }}\n onKeyCommit={(keyIndex, toMs) => {\n const r = moveKey(tracks, { trackPath, keyIndex }, toMs);\n onChange(r.tracks);\n setSelection(r.selection);\n }}\n onKeysInput={(keys) => onInput?.(setKeys(tracks, trackPath, keys))}\n onKeysCommit={(keys) => onChange(setKeys(tracks, trackPath, keys))}\n onInsert={(atMs) => {\n const r = insertKey(tracks, trackPath, atMs);\n onChange(r.tracks);\n setSelection(r.selection);\n }}\n selectedSegment={segmentSelection && samePath(segmentSelection.trackPath, trackPath) ? segmentSelection.keyIndex : null}\n onSelectSegment={(keyIndex) => setSegmentSelection({ trackPath, keyIndex })}\n />\n );\n })}\n </div>\n\n {renderKeyEditor && selection && selectedKey && selectedTrack?.kind === 'sampled' ? (\n <div className={s.inspector}>\n {renderKeyEditor({\n key: selectedKey,\n track: selectedTrack as SampledTrack<unknown>,\n selection,\n commit: (next) => onChange(setKeyValue(tracks, selection, next.value)),\n setEasing: (easing) => onChange(setKeyEasing(tracks, selection, easing)),\n })}\n </div>\n ) : null}\n\n {segmentSelection && segmentKey ? (\n <div className={s.inspector}>\n <EasingPicker\n value={segmentKey.easing}\n onChange={(next) => onChange(setKeyEasing(tracks, segmentSelection, next))}\n />\n </div>\n ) : null}\n </div>\n );\n}\n","import { useCallback, useEffect, useReducer, type ReactElement } from 'react';\nimport { useLatest, useVisibleRaf, type TimelineHandle, type Track } from '@weasel-js/core';\nimport { Timeline, type TimelineProps } from './Timeline';\n\n/** Props for {@link AnimatedTimeline}: `<Timeline>`'s, less what it reads off `handle`. */\nexport interface AnimatedTimelineProps\n extends Omit<TimelineProps, 'tracks' | 'duration' | 'playhead' | 'onChange' | 'onScrub' | 'transport'> {\n handle: TimelineHandle;\n /** `false` hides the transport, as on `<Timeline>`. */\n transport?: false;\n}\n\n/** Binds `<Timeline>` to a live handle.\n *\n * `handle.tracks()` returns the timeline's own array, not a copy, so an edit\n * splices it in place inside `edit()`. Assigning a replacement array would\n * update nothing and raise nothing. */\nexport function AnimatedTimeline(props: AnimatedTimelineProps): ReactElement {\n const { handle, ...rest } = props;\n const [, bump] = useReducer((n: number) => n + 1, 0);\n\n // `subscribe` fires on `edit` only, so the playhead comes from the frame loop.\n useEffect(() => handle.subscribe(bump), [handle]);\n\n // `useVisibleRaf` returns a controller; a continuous loop re-requests from\n // inside its own frame, and nothing runs until something calls `request`.\n // No `onResume` here: this loop measures no elapsed time of its own, it only\n // reads the playhead the animator already advanced.\n const raf = useVisibleRaf(() => {\n bump();\n if (!handle.isPaused()) rafRef.current.request();\n });\n const rafRef = useLatest(raf);\n useEffect(() => {\n if (!handle.isPaused()) raf.request();\n return () => raf.cancel();\n }, [handle, raf]);\n\n const onChange = useCallback((next: Track[]) => {\n handle.edit(() => {\n const live = handle.tracks() as Track[];\n live.splice(0, live.length, ...next);\n });\n }, [handle]);\n\n const playhead = handle.time();\n const duration = handle.duration();\n\n return (\n <Timeline\n {...rest}\n tracks={handle.tracks()}\n duration={duration}\n playhead={playhead}\n onChange={onChange}\n onScrub={handle.seek}\n transport={props.transport === false ? false : {\n paused: handle.isPaused(),\n loop: handle.loop(),\n rate: handle.timeScale(),\n onPlay: () => {\n // `rearm` declines to revive a timeline at its duration, so resume\n // alone would do nothing. Play-at-end rewinds first.\n if (handle.time() >= duration) handle.seek(0);\n handle.resume();\n raf.request();\n bump();\n },\n onPause: () => { handle.pause(); bump(); },\n onLoopChange: (next) => { handle.setLoop(next); bump(); },\n onRateChange: (next) => { handle.setTimeScale(next); bump(); },\n }}\n />\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACEA,SAASiB,EAAS,GAAoE;CAEpF,OADI,OAAOC,KAAS,YAAYA,KAAiB,YAAYA,IAAaA,EAAK,SACxE;AACT;AAIA,SAAgBC,EAAa,GAAqE;CAEhG,OADID,MAAS,KAAA,IAAkB,OACxBD,EAASC,CAAI;AACtB;AAQA,SAAgBE,EAAY,GAA2B;CACrD,IAAIF,MAAS,KAAA,GAAW,OAAO;CAC/B,IAAI,OAAOA,KAAS,UAAU,OAAOA;CACrC,IAAMG,IAAIJ,EAASC,CAAI;CACvB,IAAIG,GAAG,OAAO,gBAAgBA,EAAE,KAAK,IAAI,EAAE;CAC3C,KAAK,IAAM,CAACC,GAAMC,MAAO,OAAO,QAAQC,CAAO,GAC7C,IAAID,MAAOL,GAAM,OAAOI;CAE1B,OAAO;AACT;AAGA,SAAgBG,EAAa,GAA8B,GAAyB;CAClF,IAAM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