@weasel-js/ui 1.4.0 → 1.4.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/{ActionsBar-B-gWm0NE.js → ActionsBar-C2oXIJk-.js} +3 -3
- package/dist/chunks/{ActionsBar-B-gWm0NE.js.map → ActionsBar-C2oXIJk-.js.map} +1 -1
- package/dist/chunks/{Badge-BXTDs-zi.js → Badge-7yQseqZb.js} +233 -263
- package/dist/chunks/Badge-7yQseqZb.js.map +1 -0
- package/dist/chunks/BandEditor-CqiMlSF9.js +252 -0
- package/dist/chunks/BandEditor-CqiMlSF9.js.map +1 -0
- package/dist/chunks/{Callout-wRyevt8I.js → Callout-63z0T-w3.js} +1 -1
- package/dist/chunks/{Callout-wRyevt8I.js.map → Callout-63z0T-w3.js.map} +1 -1
- package/dist/chunks/{Checkbox-D_GCnoJ0.js → Checkbox-CkcngYWa.js} +1 -1
- package/dist/chunks/{Checkbox-D_GCnoJ0.js.map → Checkbox-CkcngYWa.js.map} +1 -1
- package/dist/chunks/{ColorField-pEkaSppg.js → ColorField-CCBSv8dp.js} +2 -2
- package/dist/chunks/{ColorField-pEkaSppg.js.map → ColorField-CCBSv8dp.js.map} +1 -1
- package/dist/chunks/{ComboBox-inno5gt1.js → ComboBox-TnIrRldB.js} +2 -2
- package/dist/chunks/{ComboBox-inno5gt1.js.map → ComboBox-TnIrRldB.js.map} +1 -1
- package/dist/chunks/{CurveEditor-Cpuvl_iN.js → CurveEditor-BNbP2wgq.js} +193 -196
- package/dist/chunks/CurveEditor-BNbP2wgq.js.map +1 -0
- package/dist/chunks/{DataGrid-BWZZUekH.js → DataGrid-CiJGbgok.js} +2 -5
- package/dist/chunks/DataGrid-CiJGbgok.js.map +1 -0
- package/dist/chunks/{DetentSlider--tQdVQj_.js → DetentSlider-C6RTsiPi.js} +2 -2
- package/dist/chunks/{DetentSlider--tQdVQj_.js.map → DetentSlider-C6RTsiPi.js.map} +1 -1
- package/dist/chunks/{Dialog-CX2B8PIp.js → Dialog-D8pVzsw8.js} +1 -1
- package/dist/chunks/{Dialog-CX2B8PIp.js.map → Dialog-D8pVzsw8.js.map} +1 -1
- package/dist/chunks/Disclosure-aSX2CZlw.js +47 -0
- package/dist/chunks/Disclosure-aSX2CZlw.js.map +1 -0
- package/dist/chunks/{DragHandleGlyph--2zsZzA2.js → DragHandleGlyph-C6GJyfnm.js} +1 -1
- package/dist/chunks/{DragHandleGlyph--2zsZzA2.js.map → DragHandleGlyph-C6GJyfnm.js.map} +1 -1
- package/dist/chunks/{Field-Bc6Nuc3p.js → Field-BUroh92b.js} +1 -1
- package/dist/chunks/{Field-Bc6Nuc3p.js.map → Field-BUroh92b.js.map} +1 -1
- package/dist/chunks/{FontFamilySelect-CvrXKVwv.js → FontFamilySelect-xjOHQMsK.js} +2 -2
- package/dist/chunks/{FontFamilySelect-CvrXKVwv.js.map → FontFamilySelect-xjOHQMsK.js.map} +1 -1
- package/dist/chunks/{GradientEditor-C5pPbMa_.js → GradientEditor-D1IVEkHO.js} +13 -11
- package/dist/chunks/{GradientEditor-C5pPbMa_.js.map → GradientEditor-D1IVEkHO.js.map} +1 -1
- package/dist/chunks/{InlineRange-CBt_SBsC.js → InlineRange-DG2dvtb4.js} +2 -2
- package/dist/chunks/{InlineRange-CBt_SBsC.js.map → InlineRange-DG2dvtb4.js.map} +1 -1
- package/dist/chunks/{Input-CSAECs_T.js → Input-CxMANia3.js} +2 -2
- package/dist/chunks/{Input-CSAECs_T.js.map → Input-CxMANia3.js.map} +1 -1
- package/dist/chunks/{ItemList-POiCvUDx.js → ItemList-BcdHAah3.js} +1 -1
- package/dist/chunks/{ItemList-POiCvUDx.js.map → ItemList-BcdHAah3.js.map} +1 -1
- package/dist/chunks/{Keycaps-DszN5Dwl.js → Keycaps-D-UGWDrt.js} +1 -1
- package/dist/chunks/{Keycaps-DszN5Dwl.js.map → Keycaps-D-UGWDrt.js.map} +1 -1
- package/dist/chunks/{LayerStack-htMwIsJ6.js → LayerStack-DQnWSOVC.js} +23 -26
- package/dist/chunks/LayerStack-DQnWSOVC.js.map +1 -0
- package/dist/chunks/{NumberField-Byw1iaIJ.js → NumberField-DLw4UmF3.js} +12 -10
- package/dist/chunks/NumberField-DLw4UmF3.js.map +1 -0
- package/dist/chunks/{OptionsBar-efIwfqYe.js → OptionsBar-BXyk_5gT.js} +3 -3
- package/dist/chunks/{OptionsBar-efIwfqYe.js.map → OptionsBar-BXyk_5gT.js.map} +1 -1
- package/dist/chunks/{PaintInput-DtCSGda0.js → PaintInput-DCgWtKxw.js} +5 -5
- package/dist/chunks/{PaintInput-DtCSGda0.js.map → PaintInput-DCgWtKxw.js.map} +1 -1
- package/dist/chunks/{PatternPicker-G9e0CU5H.js → PatternPicker-CPFEhpXD.js} +2 -2
- package/dist/chunks/{PatternPicker-G9e0CU5H.js.map → PatternPicker-CPFEhpXD.js.map} +1 -1
- package/dist/chunks/{Plot2D-D63D5w6c.js → Plot2D-BtI_c25q.js} +1 -1
- package/dist/chunks/{Plot2D-D63D5w6c.js.map → Plot2D-BtI_c25q.js.map} +1 -1
- package/dist/chunks/{PointPlotter-CR-QGCIf.js → PointPlotter-B-DvXjkL.js} +2 -2
- package/dist/chunks/{PointPlotter-CR-QGCIf.js.map → PointPlotter-B-DvXjkL.js.map} +1 -1
- package/dist/chunks/{Powerline--gx4j0Zr.js → Powerline-CJYCbqSc.js} +2 -2
- package/dist/chunks/{Powerline--gx4j0Zr.js.map → Powerline-CJYCbqSc.js.map} +1 -1
- package/dist/chunks/{Prefs-ByKG3ylD.js → Prefs-BqnwyjmH.js} +10 -10
- package/dist/chunks/{Prefs-ByKG3ylD.js.map → Prefs-BqnwyjmH.js.map} +1 -1
- package/dist/chunks/Properties-fLSEE65J.js +746 -0
- package/dist/chunks/Properties-fLSEE65J.js.map +1 -0
- package/dist/chunks/{RadioGroup-XjbfUb7S.js → RadioGroup-VGAaLYaR.js} +2 -2
- package/dist/chunks/{RadioGroup-XjbfUb7S.js.map → RadioGroup-VGAaLYaR.js.map} +1 -1
- package/dist/chunks/{RangeSlider-D0hFbx_Z.js → RangeSlider-DefoAOsh.js} +1 -1
- package/dist/chunks/{RangeSlider-D0hFbx_Z.js.map → RangeSlider-DefoAOsh.js.map} +1 -1
- package/dist/chunks/ResizeHandle-DMJdqRud.js +79 -0
- package/dist/chunks/ResizeHandle-DMJdqRud.js.map +1 -0
- package/dist/chunks/Select-DGafwTF0.js +121 -0
- package/dist/chunks/Select-DGafwTF0.js.map +1 -0
- package/dist/chunks/{SelectionPanel-OfbtyDJH.js → SelectionPanel-BwBevj5F.js} +10 -10
- package/dist/chunks/{SelectionPanel-OfbtyDJH.js.map → SelectionPanel-BwBevj5F.js.map} +1 -1
- package/dist/chunks/{Sidebar-Du0yp1S0.js → Sidebar-CeSRkWKK.js} +1 -1
- package/dist/chunks/{Sidebar-Du0yp1S0.js.map → Sidebar-CeSRkWKK.js.map} +1 -1
- package/dist/chunks/{SidebarPanel-Cuq__FIC.js → SidebarPanel-BWIiJv7M.js} +1 -1
- package/dist/chunks/{SidebarPanel-Cuq__FIC.js.map → SidebarPanel-BWIiJv7M.js.map} +1 -1
- package/dist/chunks/Slider-X6WcO-6s.js +303 -0
- package/dist/chunks/Slider-X6WcO-6s.js.map +1 -0
- package/dist/chunks/{StatusBar-DLYwh5sb.js → StatusBar-COyPUoEs.js} +1 -1
- package/dist/chunks/{StatusBar-DLYwh5sb.js.map → StatusBar-COyPUoEs.js.map} +1 -1
- package/dist/chunks/{Switch-B521iN3m.js → Switch-Y097LD1L.js} +1 -1
- package/dist/chunks/{Switch-B521iN3m.js.map → Switch-Y097LD1L.js.map} +1 -1
- package/dist/chunks/{Tabs-BuifAv0p.js → Tabs-BDzkqWDE.js} +1 -1
- package/dist/chunks/{Tabs-BuifAv0p.js.map → Tabs-BDzkqWDE.js.map} +1 -1
- package/dist/chunks/{Timeline-BE7UWajy.js → Timeline-D9xQBdKN.js} +219 -205
- package/dist/chunks/Timeline-D9xQBdKN.js.map +1 -0
- package/dist/chunks/{Toast-B75V2gqL.js → Toast-DX0iLdC3.js} +1 -1
- package/dist/chunks/{Toast-B75V2gqL.js.map → Toast-DX0iLdC3.js.map} +1 -1
- package/dist/chunks/{ToggleBar-D0veW91s.js → ToggleBar-fQGk_Wf_.js} +2 -2
- package/dist/chunks/{ToggleBar-D0veW91s.js.map → ToggleBar-fQGk_Wf_.js.map} +1 -1
- package/dist/chunks/{ToolButton-D5VwD47i.js → ToolButton-DpqTcgLa.js} +1 -1
- package/dist/chunks/{ToolButton-D5VwD47i.js.map → ToolButton-DpqTcgLa.js.map} +1 -1
- package/dist/chunks/{ToolGroup-B2PlMKQ-.js → ToolGroup-DOrObiiA.js} +1 -1
- package/dist/chunks/{ToolGroup-B2PlMKQ-.js.map → ToolGroup-DOrObiiA.js.map} +1 -1
- package/dist/chunks/{ToolOptionsBar-ByHX7y1M.js → ToolOptionsBar-f6b5u99i.js} +1 -1
- package/dist/chunks/{ToolOptionsBar-ByHX7y1M.js.map → ToolOptionsBar-f6b5u99i.js.map} +1 -1
- package/dist/chunks/{ToolPalette-Bi5ezkO6.js → ToolPalette-B_Zjw6dC.js} +5 -5
- package/dist/chunks/{ToolPalette-Bi5ezkO6.js.map → ToolPalette-B_Zjw6dC.js.map} +1 -1
- package/dist/chunks/{keyGlyph-BLFMKZgF.js → keyGlyph-L5bsDQe5.js} +1 -1
- package/dist/chunks/{keyGlyph-BLFMKZgF.js.map → keyGlyph-L5bsDQe5.js.map} +1 -1
- package/dist/chunks/{number-D3TDawLC.js → number-Dy633mrx.js} +1 -1
- package/dist/chunks/{number-D3TDawLC.js.map → number-Dy633mrx.js.map} +1 -1
- package/dist/chunks/{range.module-CttzfN6a.js → range.module-CO59aXEH.js} +1 -1
- package/dist/chunks/{range.module-CttzfN6a.js.map → range.module-CO59aXEH.js.map} +1 -1
- package/dist/chunks/{segmentedControl.module-XADeq9e5.js → segmentedControl.module-pcPOsNey.js} +1 -1
- package/dist/chunks/{segmentedControl.module-XADeq9e5.js.map → segmentedControl.module-pcPOsNey.js.map} +1 -1
- package/dist/chunks/useReorderDragList-C2fhvbU1.js +102 -0
- package/dist/chunks/useReorderDragList-C2fhvbU1.js.map +1 -0
- package/dist/chunks/{useRovingTabIndex-ByjY4lnw.js → useRovingTabIndex-DqXFNDaD.js} +1 -1
- package/dist/chunks/{useRovingTabIndex-ByjY4lnw.js.map → useRovingTabIndex-DqXFNDaD.js.map} +1 -1
- package/dist/components/ActionsBar/index.js +1 -1
- package/dist/components/Badge/Badge.d.ts.map +1 -1
- package/dist/components/Badge/index.js +1 -1
- package/dist/components/Badge/shapes/Perforated.d.ts.map +1 -1
- package/dist/components/Badge/shapes/Shield.d.ts.map +1 -1
- package/dist/components/Badge/useSvgBox.d.ts +10 -0
- package/dist/components/Badge/useSvgBox.d.ts.map +1 -0
- package/dist/components/BandEditor/BandEditor.d.ts.map +1 -1
- package/dist/components/BandEditor/index.js +1 -1
- package/dist/components/Callout/index.js +1 -1
- package/dist/components/Checkbox/index.js +1 -1
- package/dist/components/ColorField/index.js +1 -1
- package/dist/components/ComboBox/index.js +1 -1
- package/dist/components/CurveEditor/LayeredCurveEditor.d.ts.map +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/DetentSlider/index.js +1 -1
- package/dist/components/Dialog/index.js +1 -1
- package/dist/components/Disclosure/Disclosure.d.ts +64 -0
- package/dist/components/Disclosure/Disclosure.d.ts.map +1 -0
- package/dist/components/Disclosure/index.d.ts +3 -0
- package/dist/components/Disclosure/index.d.ts.map +1 -0
- package/dist/components/Disclosure/index.js +2 -0
- package/dist/components/DragHandleGlyph/index.js +1 -1
- package/dist/components/Field/index.js +1 -1
- package/dist/components/FontFamilySelect/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/ItemList/index.js +1 -1
- package/dist/components/Keycaps/index.js +2 -2
- package/dist/components/LayerStack/LayerStack.d.ts +22 -9
- package/dist/components/LayerStack/LayerStack.d.ts.map +1 -1
- package/dist/components/LayerStack/index.js +1 -1
- package/dist/components/NumberField/NumberField.d.ts +12 -0
- package/dist/components/NumberField/NumberField.d.ts.map +1 -1
- package/dist/components/NumberField/index.js +1 -1
- package/dist/components/OptionsBar/index.js +1 -1
- package/dist/components/PaintInput/index.js +1 -1
- package/dist/components/PatternPicker/index.js +1 -1
- package/dist/components/Plot2D/index.js +1 -1
- package/dist/components/PointPlotter/index.js +1 -1
- package/dist/components/Powerline/index.js +2 -2
- package/dist/components/Prefs/index.js +1 -1
- package/dist/components/Properties/EffectCard.d.ts +3 -2
- package/dist/components/Properties/EffectCard.d.ts.map +1 -1
- package/dist/components/Properties/PropertyGroup.d.ts +24 -10
- package/dist/components/Properties/PropertyGroup.d.ts.map +1 -1
- package/dist/components/Properties/PropertyPanel.d.ts +68 -24
- package/dist/components/Properties/PropertyPanel.d.ts.map +1 -1
- package/dist/components/Properties/index.d.ts +1 -1
- package/dist/components/Properties/index.d.ts.map +1 -1
- package/dist/components/Properties/index.js +2 -2
- package/dist/components/RadioGroup/index.js +1 -1
- package/dist/components/RangeSlider/index.js +1 -1
- package/dist/components/ResizeHandle/ResizeHandle.d.ts.map +1 -1
- package/dist/components/ResizeHandle/index.js +1 -1
- package/dist/components/Select/Select.d.ts +7 -1
- package/dist/components/Select/Select.d.ts.map +1 -1
- package/dist/components/Select/index.js +1 -1
- package/dist/components/SelectionPanel/index.js +1 -1
- package/dist/components/Sidebar/index.js +1 -1
- package/dist/components/SidebarPanel/index.js +1 -1
- package/dist/components/Slider/Slider.d.ts.map +1 -1
- package/dist/components/Slider/index.js +1 -1
- package/dist/components/StatusBar/index.js +1 -1
- package/dist/components/Switch/index.js +1 -1
- package/dist/components/Tabs/index.js +1 -1
- package/dist/components/Timeline/Lane.d.ts.map +1 -1
- package/dist/components/Timeline/Ruler.d.ts.map +1 -1
- package/dist/components/Timeline/index.js +1 -1
- package/dist/components/Toast/index.js +1 -1
- package/dist/components/ToggleBar/index.js +1 -1
- package/dist/components/ToolButton/index.js +1 -1
- package/dist/components/ToolGroup/index.js +1 -1
- package/dist/components/ToolOptionsBar/index.js +1 -1
- package/dist/components/ToolPalette/index.js +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +58 -57
- package/dist/index.js.map +1 -1
- package/dist/style.css +1 -1
- package/dist/useReorderDragList.d.ts +20 -7
- package/dist/useReorderDragList.d.ts.map +1 -1
- package/package.json +6 -6
- package/dist/chunks/Badge-BXTDs-zi.js.map +0 -1
- package/dist/chunks/BandEditor-CfLW44uR.js +0 -248
- package/dist/chunks/BandEditor-CfLW44uR.js.map +0 -1
- package/dist/chunks/CurveEditor-Cpuvl_iN.js.map +0 -1
- package/dist/chunks/DataGrid-BWZZUekH.js.map +0 -1
- package/dist/chunks/LayerStack-htMwIsJ6.js.map +0 -1
- package/dist/chunks/NumberField-Byw1iaIJ.js.map +0 -1
- package/dist/chunks/Properties-BEGlt0Z2.js +0 -662
- package/dist/chunks/Properties-BEGlt0Z2.js.map +0 -1
- package/dist/chunks/ResizeHandle-DjGZkPpx.js +0 -81
- package/dist/chunks/ResizeHandle-DjGZkPpx.js.map +0 -1
- package/dist/chunks/Select-D1uP21db.js +0 -103
- package/dist/chunks/Select-D1uP21db.js.map +0 -1
- package/dist/chunks/Slider-CSwL-Nj9.js +0 -296
- package/dist/chunks/Slider-CSwL-Nj9.js.map +0 -1
- package/dist/chunks/Timeline-BE7UWajy.js.map +0 -1
- package/dist/chunks/useReorderDragList-nQMVwNBd.js +0 -109
- package/dist/chunks/useReorderDragList-nQMVwNBd.js.map +0 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { H as e, R as t, i as n } from "./icons-BV27dhKB.js";
|
|
2
|
-
import { t as r } from "./DetentSlider
|
|
2
|
+
import { t as r } from "./DetentSlider-C6RTsiPi.js";
|
|
3
3
|
import { Fragment as i, jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
4
|
-
import { EASINGS as s, cubicBezierEasing as c,
|
|
5
|
-
import { useCallback as
|
|
6
|
-
var
|
|
4
|
+
import { EASINGS as s, cubicBezierEasing as c, openPointerSession as l, resolveEasing as u, sampleTrack as d, useVisibleRaf as f } from "@weasel-js/core";
|
|
5
|
+
import { useCallback as p, useEffect as m, useLayoutEffect as h, useMemo as g, useReducer as _, useRef as v, useState as y } from "react";
|
|
6
|
+
var b = {
|
|
7
7
|
ruler: "_ruler_gapxk_1",
|
|
8
8
|
tick: "_tick_gapxk_11",
|
|
9
9
|
playhead: "_playhead_gapxk_29",
|
|
@@ -41,26 +41,26 @@ var y = {
|
|
|
41
41
|
};
|
|
42
42
|
//#endregion
|
|
43
43
|
//#region src/components/Timeline/easingSpec.ts
|
|
44
|
-
function b(e) {
|
|
45
|
-
return typeof e == "object" && e && "bezier" in e ? e.bezier : null;
|
|
46
|
-
}
|
|
47
44
|
function x(e) {
|
|
48
|
-
return e
|
|
45
|
+
return typeof e == "object" && e && "bezier" in e ? e.bezier : null;
|
|
49
46
|
}
|
|
50
47
|
function S(e) {
|
|
48
|
+
return e === void 0 ? null : x(e);
|
|
49
|
+
}
|
|
50
|
+
function C(e) {
|
|
51
51
|
if (e === void 0) return "linear";
|
|
52
52
|
if (typeof e == "string") return e;
|
|
53
|
-
let t =
|
|
53
|
+
let t = x(e);
|
|
54
54
|
if (t) return `cubic-bezier(${t.join(", ")})`;
|
|
55
55
|
for (let [t, n] of Object.entries(s)) if (n === e) return t;
|
|
56
56
|
return "custom";
|
|
57
57
|
}
|
|
58
|
-
function
|
|
59
|
-
let n =
|
|
58
|
+
function w(e, t) {
|
|
59
|
+
let n = u(e), r = Array(t), i = t - 1;
|
|
60
60
|
for (let e = 0; e < t; e++) r[e] = n(i === 0 ? 0 : e / i);
|
|
61
61
|
return r;
|
|
62
62
|
}
|
|
63
|
-
var
|
|
63
|
+
var T = Object.keys(s), E = 24, D = {
|
|
64
64
|
linear: [
|
|
65
65
|
0,
|
|
66
66
|
0,
|
|
@@ -121,16 +121,16 @@ var w = Object.keys(s), T = 24, E = {
|
|
|
121
121
|
.63,
|
|
122
122
|
1
|
|
123
123
|
]
|
|
124
|
-
},
|
|
124
|
+
}, O = [
|
|
125
125
|
.25,
|
|
126
126
|
.1,
|
|
127
127
|
.25,
|
|
128
128
|
1
|
|
129
129
|
];
|
|
130
|
-
function
|
|
131
|
-
let { value: t, onChange: n } = e, r =
|
|
130
|
+
function k(e) {
|
|
131
|
+
let { value: t, onChange: n } = e, r = S(t), i = C(t), s = r === null && T.includes(i), c = r === null ? s ? i : "linear" : "custom", l = w(t, E).map((e, t) => `${t / (E - 1) * 100},${100 - e * 100}`).join(" ");
|
|
132
132
|
return /* @__PURE__ */ o("div", {
|
|
133
|
-
className:
|
|
133
|
+
className: b.easingPicker,
|
|
134
134
|
children: [
|
|
135
135
|
/* @__PURE__ */ o("label", { children: ["Easing", /* @__PURE__ */ o("select", {
|
|
136
136
|
value: c,
|
|
@@ -140,7 +140,7 @@ function O(e) {
|
|
|
140
140
|
value: "linear",
|
|
141
141
|
children: "linear"
|
|
142
142
|
}),
|
|
143
|
-
|
|
143
|
+
T.filter((e) => e !== "linear").map((e) => /* @__PURE__ */ a("option", {
|
|
144
144
|
value: e,
|
|
145
145
|
children: e
|
|
146
146
|
}, e)),
|
|
@@ -152,15 +152,15 @@ function O(e) {
|
|
|
152
152
|
})] }),
|
|
153
153
|
r === null ? /* @__PURE__ */ a("button", {
|
|
154
154
|
type: "button",
|
|
155
|
-
className:
|
|
156
|
-
onClick: () => n({ bezier:
|
|
155
|
+
className: b.transportButton,
|
|
156
|
+
onClick: () => n({ bezier: D[c] ?? O }),
|
|
157
157
|
children: "Convert to bezier"
|
|
158
158
|
}) : /* @__PURE__ */ a("span", {
|
|
159
|
-
className:
|
|
159
|
+
className: b.easingLabel,
|
|
160
160
|
children: i
|
|
161
161
|
}),
|
|
162
162
|
/* @__PURE__ */ a("svg", {
|
|
163
|
-
className:
|
|
163
|
+
className: b.easingPreview,
|
|
164
164
|
"data-testid": "easing-preview",
|
|
165
165
|
viewBox: "0 0 100 100",
|
|
166
166
|
preserveAspectRatio: "none",
|
|
@@ -174,8 +174,8 @@ function O(e) {
|
|
|
174
174
|
}
|
|
175
175
|
//#endregion
|
|
176
176
|
//#region src/components/Timeline/timeScale.ts
|
|
177
|
-
var
|
|
178
|
-
function
|
|
177
|
+
var A = 1;
|
|
178
|
+
function j(e, t) {
|
|
179
179
|
let n = e.to - e.from, r = n === 0 ? 0 : t / n, i = t === 0 ? 0 : n / t;
|
|
180
180
|
return {
|
|
181
181
|
window: e,
|
|
@@ -184,36 +184,36 @@ function A(e, t) {
|
|
|
184
184
|
toMs: (t) => e.from + t * i
|
|
185
185
|
};
|
|
186
186
|
}
|
|
187
|
-
function
|
|
187
|
+
function M(e, t) {
|
|
188
188
|
let n = e.to - e.from;
|
|
189
189
|
return n === 0 ? 0 : (t - e.from) / n;
|
|
190
190
|
}
|
|
191
|
-
function M(e, t) {
|
|
192
|
-
return `${j(e, t) * 100}%`;
|
|
193
|
-
}
|
|
194
191
|
function N(e, t) {
|
|
195
|
-
|
|
196
|
-
return n === 0 ? 0 : t / n;
|
|
192
|
+
return `${M(e, t) * 100}%`;
|
|
197
193
|
}
|
|
198
194
|
function P(e, t) {
|
|
199
|
-
|
|
195
|
+
let n = e.to - e.from;
|
|
196
|
+
return n === 0 ? 0 : t / n;
|
|
200
197
|
}
|
|
201
198
|
function F(e, t) {
|
|
199
|
+
return `${P(e, t) * 100}%`;
|
|
200
|
+
}
|
|
201
|
+
function I(e, t) {
|
|
202
202
|
let n = Math.min(e.to - e.from, t.to - t.from), r = e.from;
|
|
203
203
|
return r < t.from && (r = t.from), r + n > t.to && (r = t.to - n), {
|
|
204
204
|
from: r,
|
|
205
205
|
to: r + n
|
|
206
206
|
};
|
|
207
207
|
}
|
|
208
|
-
function
|
|
209
|
-
let i = e.to - e.from, a = r.to - r.from, o = Math.min(a, Math.max(
|
|
210
|
-
return
|
|
208
|
+
function L(e, t, n, r) {
|
|
209
|
+
let i = e.to - e.from, a = r.to - r.from, o = Math.min(a, Math.max(A, i * n)), s = i === 0 ? .5 : (t - e.from) / i;
|
|
210
|
+
return I({
|
|
211
211
|
from: t - s * o,
|
|
212
212
|
to: t + (1 - s) * o
|
|
213
213
|
}, r);
|
|
214
214
|
}
|
|
215
|
-
function
|
|
216
|
-
return
|
|
215
|
+
function ee(e, t, n) {
|
|
216
|
+
return I({
|
|
217
217
|
from: e.from + t,
|
|
218
218
|
to: e.to + t
|
|
219
219
|
}, n);
|
|
@@ -273,7 +273,7 @@ function W(e, t) {
|
|
|
273
273
|
keys: t
|
|
274
274
|
};
|
|
275
275
|
}
|
|
276
|
-
function
|
|
276
|
+
function te(e, t) {
|
|
277
277
|
return {
|
|
278
278
|
...e,
|
|
279
279
|
events: t
|
|
@@ -314,7 +314,7 @@ function K(e, t, n) {
|
|
|
314
314
|
t: i
|
|
315
315
|
}, o = n.events.filter((e, n) => n !== t.keyIndex), s = o.findIndex((e) => e.t > i), c = s === -1 ? o.length : s;
|
|
316
316
|
return o.splice(c, 0, a), {
|
|
317
|
-
tracks: G(e, t.trackPath,
|
|
317
|
+
tracks: G(e, t.trackPath, te(r, o)),
|
|
318
318
|
selection: {
|
|
319
319
|
trackPath: t.trackPath,
|
|
320
320
|
keyIndex: c
|
|
@@ -332,7 +332,7 @@ function q(e, t, n) {
|
|
|
332
332
|
tracks: e.slice(),
|
|
333
333
|
selection: null
|
|
334
334
|
};
|
|
335
|
-
let i = r, a = Math.max(0, n), o = i.keys.length === 0 ? 0 :
|
|
335
|
+
let i = r, a = Math.max(0, n), o = i.keys.length === 0 ? 0 : d(i, a), s = i.keys.slice(), c = s.findIndex((e) => e.t > a), l = c === -1 ? s.length : c;
|
|
336
336
|
return s.splice(l, 0, {
|
|
337
337
|
t: a,
|
|
338
338
|
value: o
|
|
@@ -377,7 +377,7 @@ function X(e, t, n) {
|
|
|
377
377
|
value: n
|
|
378
378
|
}, G(e, t.trackPath, W(r, i));
|
|
379
379
|
}
|
|
380
|
-
function
|
|
380
|
+
function ne(e, t, n) {
|
|
381
381
|
let r = e, i = n;
|
|
382
382
|
for (let n of t) {
|
|
383
383
|
let t = Math.abs(n - e);
|
|
@@ -387,129 +387,139 @@ function te(e, t, n) {
|
|
|
387
387
|
}
|
|
388
388
|
//#endregion
|
|
389
389
|
//#region src/components/Timeline/Lane.tsx
|
|
390
|
-
var Z = 8,
|
|
391
|
-
function
|
|
390
|
+
var Z = 8, re = 6, ie = 10, ae = 16;
|
|
391
|
+
function oe(e, t) {
|
|
392
392
|
let n = c(...e), r = Array(t), i = t - 1;
|
|
393
393
|
for (let e = 0; e < t; e++) r[e] = n(i === 0 ? 0 : e / i);
|
|
394
394
|
return r;
|
|
395
395
|
}
|
|
396
|
-
function
|
|
396
|
+
function se(e) {
|
|
397
397
|
return e.kind === "sampled" ? e.track.keys.map((e) => e.t) : e.kind === "event" ? e.track.events.map((e) => e.t) : [];
|
|
398
398
|
}
|
|
399
|
-
function
|
|
400
|
-
let { row: t, window: r, mode: s, selection: c, onSelect:
|
|
401
|
-
|
|
402
|
-
|
|
399
|
+
function ce(e) {
|
|
400
|
+
let { row: t, window: r, mode: s, selection: c, onSelect: u, onKeyInput: d, onKeyCommit: f, onInsert: p, onToggleExpand: h, expanded: g, snapTimes: _, selectedSegment: x = null, onSelectSegment: C, onEasingCommit: T } = e, E = v(null), D = v(null);
|
|
401
|
+
m(() => () => {
|
|
402
|
+
D.current?.cancel();
|
|
403
403
|
}, []);
|
|
404
|
-
let [
|
|
405
|
-
let n =
|
|
406
|
-
return n ?
|
|
407
|
-
},
|
|
408
|
-
let e =
|
|
409
|
-
return e.toMs(
|
|
404
|
+
let [O, k] = y(null), [A, P] = y(null), I = (e) => N(r, e + t.offset), L = (e) => {
|
|
405
|
+
let n = E.current?.getBoundingClientRect();
|
|
406
|
+
return n ? j(r, n.width).toMs(e - n.left) - t.offset : r.from;
|
|
407
|
+
}, ee = () => {
|
|
408
|
+
let e = j(r, E.current?.getBoundingClientRect().width ?? 0);
|
|
409
|
+
return e.toMs(re) - e.toMs(0);
|
|
410
410
|
}, R = s === "graph" && t.numeric, z = t.kind === "sampled" ? t.track.keys : [], B = z.map((e) => e.value), V = R ? Math.min(...B) : 0, H = (R ? Math.max(...B) : 1) - V || 1, U = (e) => Z + (e - V) / H * (100 - 2 * Z), W = (e) => {
|
|
411
|
-
let t =
|
|
411
|
+
let t = E.current?.getBoundingClientRect();
|
|
412
412
|
if (!t || t.height === 0) return V;
|
|
413
413
|
let n = ((1 - (e - t.top) / t.height) * 100 - Z) / (100 - 2 * Z);
|
|
414
414
|
return V + Math.min(1, Math.max(0, n)) * H;
|
|
415
|
-
},
|
|
415
|
+
}, te = () => {
|
|
416
416
|
let e = [];
|
|
417
417
|
for (let n = 1; n < z.length; n++) {
|
|
418
|
-
let i = z[n - 1], a = z[n], o =
|
|
418
|
+
let i = z[n - 1], a = z[n], o = O && O.keyIndex === n ? oe(O.points, ae) : w(a.easing, ae);
|
|
419
419
|
for (let n = 0; n < o.length; n++) {
|
|
420
420
|
let s = i.t + (a.t - i.t) * n / (o.length - 1), c = i.value + (a.value - i.value) * o[n];
|
|
421
|
-
e.push(`${
|
|
421
|
+
e.push(`${M(r, s + t.offset) * 100},${100 - U(c)}`);
|
|
422
422
|
}
|
|
423
423
|
}
|
|
424
424
|
return e.join(" ");
|
|
425
|
-
}, G =
|
|
425
|
+
}, G = x != null && t.kind === "sampled" ? S(z[x]?.easing) : null, K = O && O.keyIndex === x ? O.points : G, q = (e, t, n) => {
|
|
426
426
|
let r = z[e - 1], i = z[e], a = r.t + t * (i.t - r.t), o = r.value + n * (i.value - r.value);
|
|
427
427
|
return {
|
|
428
|
-
left:
|
|
428
|
+
left: I(a),
|
|
429
429
|
bottom: `${U(o)}%`
|
|
430
430
|
};
|
|
431
|
-
}, J = (e, t) =>
|
|
431
|
+
}, J = (e, t) => {
|
|
432
|
+
D.current?.cancel(), D.current = l(e.currentTarget, e, t, { capture: !1 });
|
|
433
|
+
}, Y = (e, t) => (n) => {
|
|
432
434
|
if (n.button !== 0 || !G) return;
|
|
433
435
|
n.stopPropagation();
|
|
434
436
|
let r = z[e - 1], i = z[e], a = [...G], o = (e) => {
|
|
435
|
-
let n =
|
|
437
|
+
let n = L(e.clientX), o = i.t === r.t ? 0 : Math.min(1, Math.max(0, (n - r.t) / (i.t - r.t))), s = W(e.clientY), c = i.value === r.value ? 0 : (s - r.value) / (i.value - r.value), l = [...a];
|
|
436
438
|
return l[t * 2] = o, l[t * 2 + 1] = c, l;
|
|
437
|
-
}, s = (
|
|
438
|
-
|
|
439
|
-
keyIndex: e,
|
|
440
|
-
points: a
|
|
441
|
-
});
|
|
442
|
-
}, c = (t) => {
|
|
443
|
-
a = o(t), w?.(e, { bezier: a }), l();
|
|
444
|
-
}, l = () => {
|
|
445
|
-
O(null), document.removeEventListener("pointermove", s), document.removeEventListener("pointerup", c), document.removeEventListener("pointercancel", l), E.current = null;
|
|
439
|
+
}, s = () => {
|
|
440
|
+
k(null), D.current = null;
|
|
446
441
|
};
|
|
447
|
-
|
|
448
|
-
|
|
442
|
+
J(n, {
|
|
443
|
+
onMove: (t) => {
|
|
444
|
+
a = o(t), k({
|
|
445
|
+
keyIndex: e,
|
|
446
|
+
points: a
|
|
447
|
+
});
|
|
448
|
+
},
|
|
449
|
+
onEnd: (t) => {
|
|
450
|
+
a = o(t), T?.(e, { bezier: a }), s();
|
|
451
|
+
},
|
|
452
|
+
onCancel: s
|
|
453
|
+
});
|
|
454
|
+
}, X = (e) => (n) => {
|
|
449
455
|
if (n.button !== 0) return;
|
|
450
|
-
n.stopPropagation(),
|
|
456
|
+
n.stopPropagation(), u(e);
|
|
451
457
|
let r = (e) => {
|
|
452
|
-
let n = Math.max(0,
|
|
453
|
-
return e.altKey ? n :
|
|
458
|
+
let n = Math.max(0, L(e.clientX));
|
|
459
|
+
return e.altKey ? n : ne(n + t.offset, _, ee()) - t.offset;
|
|
454
460
|
}, i = (e) => R ? W(e.clientY) : void 0;
|
|
455
|
-
|
|
461
|
+
P({
|
|
456
462
|
keyIndex: e,
|
|
457
463
|
t: Q[e],
|
|
458
464
|
value: B[e]
|
|
459
465
|
});
|
|
460
|
-
let a = (
|
|
461
|
-
|
|
462
|
-
N({
|
|
463
|
-
keyIndex: e,
|
|
464
|
-
t: r(t),
|
|
465
|
-
value: n ?? B[e]
|
|
466
|
-
}), n === void 0 ? u(e, r(t)) : u(e, r(t), n);
|
|
467
|
-
}, o = (t) => {
|
|
468
|
-
let n = i(t);
|
|
469
|
-
n === void 0 ? d(e, r(t)) : d(e, r(t), n), s();
|
|
470
|
-
}, s = () => {
|
|
471
|
-
N(null), document.removeEventListener("pointermove", a), document.removeEventListener("pointerup", o), document.removeEventListener("pointercancel", s), E.current = null;
|
|
466
|
+
let a = () => {
|
|
467
|
+
P(null), D.current = null;
|
|
472
468
|
};
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
469
|
+
J(n, {
|
|
470
|
+
onMove: (t) => {
|
|
471
|
+
let n = i(t);
|
|
472
|
+
P({
|
|
473
|
+
keyIndex: e,
|
|
474
|
+
t: r(t),
|
|
475
|
+
value: n ?? B[e]
|
|
476
|
+
}), n === void 0 ? d(e, r(t)) : d(e, r(t), n);
|
|
477
|
+
},
|
|
478
|
+
onEnd: (t) => {
|
|
479
|
+
let n = i(t);
|
|
480
|
+
n === void 0 ? f(e, r(t)) : f(e, r(t), n), a();
|
|
481
|
+
},
|
|
482
|
+
onCancel: a
|
|
483
|
+
});
|
|
484
|
+
}, ce = (e, t) => (n) => {
|
|
485
|
+
let r = ie * (n.shiftKey ? 10 : 1);
|
|
486
|
+
n.key === "ArrowRight" && (n.preventDefault(), f(e, t + r)), n.key === "ArrowLeft" && (n.preventDefault(), f(e, Math.max(0, t - r)));
|
|
487
|
+
}, Q = se(t);
|
|
478
488
|
return /* @__PURE__ */ o("div", {
|
|
479
|
-
className:
|
|
489
|
+
className: b.lane,
|
|
480
490
|
"data-depth": t.depth,
|
|
481
491
|
"data-mode": s,
|
|
482
492
|
children: [/* @__PURE__ */ o("div", {
|
|
483
|
-
className:
|
|
493
|
+
className: b.laneLabel,
|
|
484
494
|
children: [t.kind === "timeline" ? /* @__PURE__ */ a("span", {
|
|
485
495
|
role: "button",
|
|
486
496
|
tabIndex: 0,
|
|
487
|
-
"aria-expanded":
|
|
497
|
+
"aria-expanded": g,
|
|
488
498
|
"data-testid": "timeline-disclosure",
|
|
489
|
-
className:
|
|
490
|
-
onClick:
|
|
499
|
+
className: b.disclosure,
|
|
500
|
+
onClick: h,
|
|
491
501
|
onKeyDown: (e) => {
|
|
492
|
-
(e.key === "Enter" || e.key === " ") && (e.preventDefault(),
|
|
502
|
+
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), h());
|
|
493
503
|
},
|
|
494
504
|
children: /* @__PURE__ */ a(n, {
|
|
495
505
|
size: 14,
|
|
496
|
-
className: [
|
|
506
|
+
className: [b.disclosureIcon, !g && b.disclosureCollapsed].filter(Boolean).join(" ")
|
|
497
507
|
})
|
|
498
508
|
}) : null, t.label]
|
|
499
509
|
}), /* @__PURE__ */ o("div", {
|
|
500
|
-
className:
|
|
501
|
-
ref:
|
|
510
|
+
className: b.laneTrack,
|
|
511
|
+
ref: E,
|
|
502
512
|
"data-testid": "timeline-lane-track",
|
|
503
513
|
onDoubleClick: (e) => {
|
|
504
|
-
t.kind === "sampled" &&
|
|
514
|
+
t.kind === "sampled" && p(Math.max(0, L(e.clientX)));
|
|
505
515
|
},
|
|
506
516
|
children: [
|
|
507
517
|
t.kind === "timeline" ? /* @__PURE__ */ a("div", {
|
|
508
|
-
className:
|
|
518
|
+
className: b.nestedBar,
|
|
509
519
|
"data-testid": "timeline-nested",
|
|
510
520
|
style: {
|
|
511
|
-
left:
|
|
512
|
-
width:
|
|
521
|
+
left: I(0),
|
|
522
|
+
width: F(r, t.track.timeline.duration ?? 0)
|
|
513
523
|
}
|
|
514
524
|
}) : null,
|
|
515
525
|
t.kind === "sampled" ? z.slice(1).map((e, n) => {
|
|
@@ -518,26 +528,26 @@ function Q(e) {
|
|
|
518
528
|
role: "button",
|
|
519
529
|
tabIndex: 0,
|
|
520
530
|
"aria-label": `${t.label} segment into ${Math.round(e.t)} ms`,
|
|
521
|
-
"aria-current":
|
|
531
|
+
"aria-current": x === i ? "true" : void 0,
|
|
522
532
|
"data-testid": "timeline-segment",
|
|
523
|
-
className:
|
|
533
|
+
className: b.segment,
|
|
524
534
|
style: {
|
|
525
|
-
left:
|
|
526
|
-
width:
|
|
535
|
+
left: I(z[i - 1].t),
|
|
536
|
+
width: F(r, e.t - z[i - 1].t)
|
|
527
537
|
},
|
|
528
|
-
onClick: () =>
|
|
538
|
+
onClick: () => C?.(i),
|
|
529
539
|
onKeyDown: (e) => {
|
|
530
|
-
(e.key === "Enter" || e.key === " ") && (e.preventDefault(),
|
|
540
|
+
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), C?.(i));
|
|
531
541
|
}
|
|
532
542
|
}, `seg-${i}`);
|
|
533
543
|
}) : null,
|
|
534
544
|
R && z.length > 1 ? /* @__PURE__ */ a("svg", {
|
|
535
|
-
className:
|
|
545
|
+
className: b.curve,
|
|
536
546
|
"data-testid": "timeline-curve",
|
|
537
547
|
viewBox: "0 0 100 100",
|
|
538
548
|
preserveAspectRatio: "none",
|
|
539
549
|
children: /* @__PURE__ */ a("polyline", {
|
|
540
|
-
points:
|
|
550
|
+
points: te(),
|
|
541
551
|
vectorEffect: "non-scaling-stroke"
|
|
542
552
|
})
|
|
543
553
|
}) : null,
|
|
@@ -547,40 +557,40 @@ function Q(e) {
|
|
|
547
557
|
"aria-label": `${t.label} key at ${Math.round(e)} ms`,
|
|
548
558
|
"aria-current": c === n ? "true" : void 0,
|
|
549
559
|
"data-testid": t.kind === "event" ? "timeline-event" : "timeline-key",
|
|
550
|
-
"data-dragging":
|
|
551
|
-
className: t.kind === "event" ?
|
|
560
|
+
"data-dragging": A?.keyIndex === n ? "true" : void 0,
|
|
561
|
+
className: t.kind === "event" ? b.eventMark : b.key,
|
|
552
562
|
style: R ? {
|
|
553
|
-
left:
|
|
563
|
+
left: I(e),
|
|
554
564
|
bottom: `${U(B[n])}%`
|
|
555
|
-
} : { left:
|
|
556
|
-
onPointerDown:
|
|
557
|
-
onKeyDown:
|
|
565
|
+
} : { left: I(e) },
|
|
566
|
+
onPointerDown: X(n),
|
|
567
|
+
onKeyDown: ce(n, e)
|
|
558
568
|
}, n)),
|
|
559
|
-
|
|
569
|
+
A ? /* @__PURE__ */ a("div", {
|
|
560
570
|
"aria-hidden": "true",
|
|
561
571
|
"data-testid": "timeline-key-ghost",
|
|
562
|
-
className: t.kind === "event" ?
|
|
563
|
-
style: R &&
|
|
564
|
-
left:
|
|
565
|
-
bottom: `${U(
|
|
566
|
-
} : { left:
|
|
572
|
+
className: t.kind === "event" ? b.eventGhost : b.keyGhost,
|
|
573
|
+
style: R && A.value !== void 0 ? {
|
|
574
|
+
left: I(A.t),
|
|
575
|
+
bottom: `${U(A.value)}%`
|
|
576
|
+
} : { left: I(A.t) }
|
|
567
577
|
}) : null,
|
|
568
|
-
R && K &&
|
|
578
|
+
R && K && x != null ? /* @__PURE__ */ o(i, { children: [/* @__PURE__ */ a("div", {
|
|
569
579
|
role: "button",
|
|
570
580
|
tabIndex: 0,
|
|
571
581
|
"aria-label": `${t.label} bezier handle 1`,
|
|
572
582
|
"data-testid": "timeline-bezier-handle",
|
|
573
|
-
className:
|
|
574
|
-
style: q(
|
|
575
|
-
onPointerDown:
|
|
583
|
+
className: b.bezierHandle,
|
|
584
|
+
style: q(x, K[0], K[1]),
|
|
585
|
+
onPointerDown: Y(x, 0)
|
|
576
586
|
}), /* @__PURE__ */ a("div", {
|
|
577
587
|
role: "button",
|
|
578
588
|
tabIndex: 0,
|
|
579
589
|
"aria-label": `${t.label} bezier handle 2`,
|
|
580
590
|
"data-testid": "timeline-bezier-handle",
|
|
581
|
-
className:
|
|
582
|
-
style: q(
|
|
583
|
-
onPointerDown:
|
|
591
|
+
className: b.bezierHandle,
|
|
592
|
+
style: q(x, K[2], K[3]),
|
|
593
|
+
onPointerDown: Y(x, 1)
|
|
584
594
|
})] }) : null
|
|
585
595
|
]
|
|
586
596
|
})]
|
|
@@ -588,60 +598,64 @@ function Q(e) {
|
|
|
588
598
|
}
|
|
589
599
|
//#endregion
|
|
590
600
|
//#region src/components/Timeline/Ruler.tsx
|
|
591
|
-
var
|
|
592
|
-
function
|
|
601
|
+
var Q = 64, le = .0015;
|
|
602
|
+
function ue(e) {
|
|
593
603
|
return e >= 1e3 ? `${(e / 1e3).toFixed(e % 1e3 == 0 ? 0 : 2)}s` : `${Math.round(e)}ms`;
|
|
594
604
|
}
|
|
595
|
-
function
|
|
596
|
-
let { window: t, bounds: n, playhead: r, onScrub: i, onWindowChange: s } = e, c =
|
|
597
|
-
|
|
598
|
-
|
|
605
|
+
function de(e) {
|
|
606
|
+
let { window: t, bounds: n, playhead: r, onScrub: i, onWindowChange: s } = e, c = v(null), u = v(null);
|
|
607
|
+
m(() => () => {
|
|
608
|
+
u.current?.cancel();
|
|
599
609
|
}, []);
|
|
600
|
-
let [
|
|
601
|
-
|
|
610
|
+
let [d, f] = y(0);
|
|
611
|
+
h(() => {
|
|
602
612
|
let e = c.current;
|
|
603
613
|
if (!e) return;
|
|
604
|
-
let t = () =>
|
|
614
|
+
let t = () => f(e.getBoundingClientRect().width);
|
|
605
615
|
if (t(), typeof ResizeObserver > "u") return;
|
|
606
616
|
let n = new ResizeObserver(t);
|
|
607
617
|
return n.observe(e), () => n.disconnect();
|
|
608
618
|
}, []);
|
|
609
|
-
let
|
|
619
|
+
let p = () => c.current?.getBoundingClientRect().width ?? 0, g = (e) => {
|
|
610
620
|
let n = c.current?.getBoundingClientRect();
|
|
611
621
|
if (!n) return t.from;
|
|
612
|
-
let r =
|
|
622
|
+
let r = j(t, n.width).toMs(e - n.left);
|
|
613
623
|
return Math.min(t.to, Math.max(t.from, r));
|
|
614
|
-
},
|
|
624
|
+
}, _ = (e) => {
|
|
615
625
|
if (e.button !== 0) return;
|
|
616
|
-
i(
|
|
617
|
-
let t = (
|
|
618
|
-
|
|
619
|
-
}, n = () => {
|
|
620
|
-
document.removeEventListener("pointermove", t), document.removeEventListener("pointerup", n), document.removeEventListener("pointercancel", n), l.current = null;
|
|
626
|
+
i(g(e.clientX)), u.current?.cancel();
|
|
627
|
+
let t = () => {
|
|
628
|
+
u.current = null;
|
|
621
629
|
};
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
630
|
+
u.current = l(e.currentTarget, e, {
|
|
631
|
+
onMove: (e) => {
|
|
632
|
+
i(g(e.clientX));
|
|
633
|
+
},
|
|
634
|
+
onEnd: t,
|
|
635
|
+
onCancel: t
|
|
636
|
+
}, { capture: !1 });
|
|
637
|
+
}, x = (e) => {
|
|
638
|
+
if (e.ctrlKey) s(L(t, g(e.clientX), Math.exp(e.deltaY * le), n));
|
|
625
639
|
else {
|
|
626
|
-
let r =
|
|
627
|
-
s(
|
|
640
|
+
let r = p(), i = r === 0 ? 0 : (t.to - t.from) / r;
|
|
641
|
+
s(ee(t, e.deltaY * i, n));
|
|
628
642
|
}
|
|
629
|
-
},
|
|
643
|
+
}, S = z(t, d, Q), C = (e) => N(t, e);
|
|
630
644
|
return /* @__PURE__ */ o("div", {
|
|
631
|
-
className:
|
|
645
|
+
className: b.ruler,
|
|
632
646
|
ref: c,
|
|
633
647
|
"data-testid": "timeline-ruler",
|
|
634
|
-
onPointerDown:
|
|
635
|
-
onWheel:
|
|
636
|
-
children: [
|
|
637
|
-
className:
|
|
648
|
+
onPointerDown: _,
|
|
649
|
+
onWheel: x,
|
|
650
|
+
children: [S.map((e) => /* @__PURE__ */ a("span", {
|
|
651
|
+
className: b.tick,
|
|
638
652
|
"data-testid": "timeline-tick",
|
|
639
|
-
style: { left:
|
|
640
|
-
children:
|
|
653
|
+
style: { left: C(e) },
|
|
654
|
+
children: ue(e)
|
|
641
655
|
}, e)), /* @__PURE__ */ a("div", {
|
|
642
|
-
className:
|
|
656
|
+
className: b.playhead,
|
|
643
657
|
"data-testid": "timeline-playhead",
|
|
644
|
-
style: { left:
|
|
658
|
+
style: { left: C(r) }
|
|
645
659
|
})]
|
|
646
660
|
});
|
|
647
661
|
}
|
|
@@ -653,26 +667,26 @@ var $ = [
|
|
|
653
667
|
1,
|
|
654
668
|
2,
|
|
655
669
|
4
|
|
656
|
-
],
|
|
657
|
-
function
|
|
670
|
+
], fe = (e) => `${(e / 1e3).toFixed(2)}s`;
|
|
671
|
+
function pe(n) {
|
|
658
672
|
let { paused: i, loop: s, rate: c, playhead: l, duration: u, onPlay: d, onPause: f, onLoopChange: p, onRateChange: m } = n, h = s !== !1 && s !== 0, g = $.includes(c) ? $ : [...$, c].sort((e, t) => e - t);
|
|
659
673
|
return /* @__PURE__ */ o("div", {
|
|
660
|
-
className:
|
|
674
|
+
className: b.transport,
|
|
661
675
|
children: [
|
|
662
676
|
/* @__PURE__ */ a("button", {
|
|
663
677
|
type: "button",
|
|
664
|
-
className:
|
|
678
|
+
className: b.transportButton,
|
|
665
679
|
"aria-label": i ? "Play" : "Pause",
|
|
666
680
|
onClick: i ? d : f,
|
|
667
681
|
children: a(i ? e : t, { size: 14 })
|
|
668
682
|
}),
|
|
669
683
|
/* @__PURE__ */ o("span", {
|
|
670
|
-
className:
|
|
684
|
+
className: b.time,
|
|
671
685
|
"data-testid": "timeline-time",
|
|
672
686
|
children: [
|
|
673
|
-
|
|
687
|
+
fe(l),
|
|
674
688
|
" / ",
|
|
675
|
-
|
|
689
|
+
fe(u)
|
|
676
690
|
]
|
|
677
691
|
}),
|
|
678
692
|
/* @__PURE__ */ a("button", {
|
|
@@ -680,12 +694,12 @@ function fe(n) {
|
|
|
680
694
|
role: "switch",
|
|
681
695
|
"aria-checked": h,
|
|
682
696
|
"aria-label": "Loop",
|
|
683
|
-
className:
|
|
697
|
+
className: b.transportButton,
|
|
684
698
|
onClick: () => p(!h),
|
|
685
699
|
children: "⟲"
|
|
686
700
|
}),
|
|
687
701
|
/* @__PURE__ */ o("div", {
|
|
688
|
-
className:
|
|
702
|
+
className: b.rate,
|
|
689
703
|
children: [
|
|
690
704
|
"Rate",
|
|
691
705
|
/* @__PURE__ */ a(r, {
|
|
@@ -695,10 +709,10 @@ function fe(n) {
|
|
|
695
709
|
onChange: m,
|
|
696
710
|
formatLabel: (e) => `${e}x`,
|
|
697
711
|
labels: "none",
|
|
698
|
-
className:
|
|
712
|
+
className: b.rateSlider
|
|
699
713
|
}),
|
|
700
714
|
/* @__PURE__ */ o("span", {
|
|
701
|
-
className:
|
|
715
|
+
className: b.rateReadout,
|
|
702
716
|
children: [c, "x"]
|
|
703
717
|
})
|
|
704
718
|
]
|
|
@@ -708,18 +722,18 @@ function fe(n) {
|
|
|
708
722
|
}
|
|
709
723
|
//#endregion
|
|
710
724
|
//#region src/components/Timeline/Timeline.tsx
|
|
711
|
-
function
|
|
712
|
-
let { tracks: t, duration: n, playhead: r, onInput: i, onChange: s, onScrub: c, renderKeyEditor: l, label: u, className: d } = e, [f, p] =
|
|
725
|
+
function me(e) {
|
|
726
|
+
let { tracks: t, duration: n, playhead: r, onInput: i, onChange: s, onScrub: c, renderKeyEditor: l, label: u, className: d } = e, [f, p] = y(() => /* @__PURE__ */ new Set()), [m, h] = y({
|
|
713
727
|
from: 0,
|
|
714
728
|
to: n
|
|
715
|
-
}), [_,
|
|
729
|
+
}), [_, v] = y(null), [x, S] = y(null), C = e.window ?? m, w = e.onWindowChange ?? h, T = e.selection === void 0 ? _ : e.selection, E = e.onSelect ?? v, D = {
|
|
716
730
|
from: 0,
|
|
717
731
|
to: n
|
|
718
|
-
},
|
|
732
|
+
}, O = g(() => V(t, f), [t, f]), A = g(() => {
|
|
719
733
|
let e = new Set([0, n]);
|
|
720
|
-
for (let t of
|
|
734
|
+
for (let t of O) if (t.kind === "sampled") for (let n of t.track.keys) e.add(n.t + t.offset);
|
|
721
735
|
return [...e];
|
|
722
|
-
}, [
|
|
736
|
+
}, [O, n]), j = (e) => {
|
|
723
737
|
p((t) => {
|
|
724
738
|
let n = new Set(t);
|
|
725
739
|
return n.has(e) ? n.delete(e) : n.add(e), n;
|
|
@@ -732,18 +746,18 @@ function pe(e) {
|
|
|
732
746
|
}
|
|
733
747
|
}, N = T ? H(t, T.trackPath) : void 0, P = N?.kind === "sampled" ? N.keys[T.keyIndex] : void 0, F = x ? H(t, x.trackPath) : void 0, I = F?.kind === "sampled" ? F.keys[x.keyIndex] : void 0;
|
|
734
748
|
return /* @__PURE__ */ o("div", {
|
|
735
|
-
className: [
|
|
749
|
+
className: [b.root, d].filter(Boolean).join(" "),
|
|
736
750
|
"data-testid": "timeline-root",
|
|
737
751
|
tabIndex: -1,
|
|
738
752
|
onKeyDown: M,
|
|
739
753
|
children: [
|
|
740
754
|
u ? /* @__PURE__ */ a("div", {
|
|
741
|
-
className:
|
|
755
|
+
className: b.label,
|
|
742
756
|
children: u
|
|
743
757
|
}) : null,
|
|
744
758
|
e.transport === !1 ? null : /* @__PURE__ */ o("div", {
|
|
745
|
-
className:
|
|
746
|
-
children: [/* @__PURE__ */ a(
|
|
759
|
+
className: b.transportRow,
|
|
760
|
+
children: [/* @__PURE__ */ a(pe, {
|
|
747
761
|
...e.transport ?? {
|
|
748
762
|
paused: !0,
|
|
749
763
|
loop: !1,
|
|
@@ -760,16 +774,16 @@ function pe(e) {
|
|
|
760
774
|
role: "switch",
|
|
761
775
|
"aria-checked": (e.mode ?? "dope") === "graph",
|
|
762
776
|
"aria-label": "Graph mode",
|
|
763
|
-
className:
|
|
777
|
+
className: b.transportButton,
|
|
764
778
|
onClick: () => e.onModeChange?.((e.mode ?? "dope") === "graph" ? "dope" : "graph"),
|
|
765
779
|
children: "Graph"
|
|
766
780
|
})]
|
|
767
781
|
}),
|
|
768
782
|
/* @__PURE__ */ o("div", {
|
|
769
|
-
className:
|
|
770
|
-
children: [/* @__PURE__ */ a("div", { className:
|
|
771
|
-
className:
|
|
772
|
-
children: /* @__PURE__ */ a(
|
|
783
|
+
className: b.body,
|
|
784
|
+
children: [/* @__PURE__ */ a("div", { className: b.gutter }), /* @__PURE__ */ a("div", {
|
|
785
|
+
className: b.rulerWrap,
|
|
786
|
+
children: /* @__PURE__ */ a(de, {
|
|
773
787
|
window: C,
|
|
774
788
|
bounds: D,
|
|
775
789
|
playhead: r,
|
|
@@ -779,10 +793,10 @@ function pe(e) {
|
|
|
779
793
|
})]
|
|
780
794
|
}),
|
|
781
795
|
/* @__PURE__ */ a("div", {
|
|
782
|
-
className:
|
|
783
|
-
children:
|
|
796
|
+
className: b.lanes,
|
|
797
|
+
children: O.map((n) => {
|
|
784
798
|
let r = n.path;
|
|
785
|
-
return /* @__PURE__ */ a(
|
|
799
|
+
return /* @__PURE__ */ a(ce, {
|
|
786
800
|
row: n,
|
|
787
801
|
window: C,
|
|
788
802
|
mode: e.mode ?? "dope",
|
|
@@ -828,7 +842,7 @@ function pe(e) {
|
|
|
828
842
|
})
|
|
829
843
|
}),
|
|
830
844
|
l && T && P && N?.kind === "sampled" ? /* @__PURE__ */ a("div", {
|
|
831
|
-
className:
|
|
845
|
+
className: b.inspector,
|
|
832
846
|
children: l({
|
|
833
847
|
key: P,
|
|
834
848
|
track: N,
|
|
@@ -838,8 +852,8 @@ function pe(e) {
|
|
|
838
852
|
})
|
|
839
853
|
}) : null,
|
|
840
854
|
x && I ? /* @__PURE__ */ a("div", {
|
|
841
|
-
className:
|
|
842
|
-
children: /* @__PURE__ */ a(
|
|
855
|
+
className: b.inspector,
|
|
856
|
+
children: /* @__PURE__ */ a(k, {
|
|
843
857
|
value: I.easing,
|
|
844
858
|
onChange: (e) => s(Y(t, x, e))
|
|
845
859
|
})
|
|
@@ -849,20 +863,20 @@ function pe(e) {
|
|
|
849
863
|
}
|
|
850
864
|
//#endregion
|
|
851
865
|
//#region src/components/Timeline/AnimatedTimeline.tsx
|
|
852
|
-
function
|
|
853
|
-
let { handle: t, ...n } = e, [, r] =
|
|
854
|
-
|
|
855
|
-
let i =
|
|
866
|
+
function he(e) {
|
|
867
|
+
let { handle: t, ...n } = e, [, r] = _((e) => e + 1, 0);
|
|
868
|
+
m(() => t.subscribe(r), [t]);
|
|
869
|
+
let i = v(null), o = f(() => {
|
|
856
870
|
r(), t.isPaused() || i.current?.request();
|
|
857
871
|
});
|
|
858
|
-
i.current = o,
|
|
859
|
-
let s =
|
|
872
|
+
i.current = o, m(() => (t.isPaused() || o.request(), () => o.cancel()), [t, o]);
|
|
873
|
+
let s = p((e) => {
|
|
860
874
|
t.edit(() => {
|
|
861
875
|
let n = t.tracks();
|
|
862
876
|
n.splice(0, n.length, ...e);
|
|
863
877
|
});
|
|
864
878
|
}, [t]), c = t.time(), l = t.duration();
|
|
865
|
-
return /* @__PURE__ */ a(
|
|
879
|
+
return /* @__PURE__ */ a(me, {
|
|
866
880
|
...n,
|
|
867
881
|
tracks: t.tracks(),
|
|
868
882
|
duration: l,
|
|
@@ -889,6 +903,6 @@ function me(e) {
|
|
|
889
903
|
});
|
|
890
904
|
}
|
|
891
905
|
//#endregion
|
|
892
|
-
export {
|
|
906
|
+
export { k as a, C as c, U as i, w as l, me as n, T as o, pe as r, S as s, he as t };
|
|
893
907
|
|
|
894
|
-
//# sourceMappingURL=Timeline-
|
|
908
|
+
//# sourceMappingURL=Timeline-D9xQBdKN.js.map
|