@weasel-js/ui 1.5.0 → 1.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/{ActionBar-DxGp3WuZ.js → ActionBar-GZdcfdQL.js} +1 -2
- package/dist/chunks/{ActionBar-DxGp3WuZ.js.map → ActionBar-GZdcfdQL.js.map} +1 -1
- package/dist/chunks/{ActionsBar-D1VFreoj.js → ActionsBar-Fhx_40iP.js} +2 -2
- package/dist/chunks/{ActionsBar-D1VFreoj.js.map → ActionsBar-Fhx_40iP.js.map} +1 -1
- package/dist/chunks/{BandEditor-BeWO56_w.js → BandEditor-D8I5Uun-.js} +93 -98
- package/dist/chunks/BandEditor-D8I5Uun-.js.map +1 -0
- package/dist/chunks/{Callout-BPIA2is-.js → Callout-cx5_CWcW.js} +1 -1
- package/dist/chunks/{Callout-BPIA2is-.js.map → Callout-cx5_CWcW.js.map} +1 -1
- package/dist/chunks/{Checkbox-D-pVpobU.js → Checkbox-BZZsPaVF.js} +1 -1
- package/dist/chunks/{Checkbox-D-pVpobU.js.map → Checkbox-BZZsPaVF.js.map} +1 -1
- package/dist/chunks/{ColorField-C20aRvCg.js → ColorField-YVf8irfr.js} +2 -2
- package/dist/chunks/{ColorField-C20aRvCg.js.map → ColorField-YVf8irfr.js.map} +1 -1
- package/dist/chunks/{ComboBox-CPES6Y1i.js → ComboBox-D57tNYDD.js} +2 -2
- package/dist/chunks/{ComboBox-CPES6Y1i.js.map → ComboBox-D57tNYDD.js.map} +1 -1
- package/dist/chunks/{CurveEditor-Cj0lLiyR.js → CurveEditor-BXiMoN9d.js} +175 -175
- package/dist/chunks/CurveEditor-BXiMoN9d.js.map +1 -0
- package/dist/chunks/DetentSlider-BWNSv07Z.js +72 -0
- package/dist/chunks/DetentSlider-BWNSv07Z.js.map +1 -0
- package/dist/chunks/{Dialog-CYBLjwbd.js → Dialog-DuOzsR2g.js} +1 -1
- package/dist/chunks/{Dialog-CYBLjwbd.js.map → Dialog-DuOzsR2g.js.map} +1 -1
- package/dist/chunks/{Disclosure-DiA6UKdM.js → Disclosure-9UgDzc7Z.js} +6 -6
- package/dist/chunks/{Disclosure-DiA6UKdM.js.map → Disclosure-9UgDzc7Z.js.map} +1 -1
- package/dist/chunks/{Field-dzlxOGxT.js → Field-BNqvUJfg.js} +1 -1
- package/dist/chunks/{Field-dzlxOGxT.js.map → Field-BNqvUJfg.js.map} +1 -1
- package/dist/chunks/{FontFamilySelect-DIJ4phXz.js → FontFamilySelect-CO19kyOO.js} +2 -2
- package/dist/chunks/{FontFamilySelect-DIJ4phXz.js.map → FontFamilySelect-CO19kyOO.js.map} +1 -1
- package/dist/chunks/{GradientEditor-dBprHbS0.js → GradientEditor-B_ymIr4Q.js} +74 -51
- package/dist/chunks/GradientEditor-B_ymIr4Q.js.map +1 -0
- package/dist/chunks/Icon-QhLhaGFe.js +498 -0
- package/dist/chunks/Icon-QhLhaGFe.js.map +1 -0
- package/dist/chunks/{InlineRange-CcfzY80y.js → InlineRange-DdIlfGqG.js} +2 -2
- package/dist/chunks/{InlineRange-CcfzY80y.js.map → InlineRange-DdIlfGqG.js.map} +1 -1
- package/dist/chunks/{Input-CoKOtyD0.js → Input-B9Vh7ASP.js} +2 -2
- package/dist/chunks/{Input-CoKOtyD0.js.map → Input-B9Vh7ASP.js.map} +1 -1
- package/dist/chunks/Jog-BYrxbAQU.js +81 -0
- package/dist/chunks/Jog-BYrxbAQU.js.map +1 -0
- package/dist/chunks/{Keycaps-DSeq6QWH.js → Keycaps-CGNQV2Pz.js} +5 -5
- package/dist/chunks/Keycaps-CGNQV2Pz.js.map +1 -0
- package/dist/chunks/{MenuButton-Do8fFUx1.js → MenuButton-DGE-0DP0.js} +1 -1
- package/dist/chunks/{MenuButton-Do8fFUx1.js.map → MenuButton-DGE-0DP0.js.map} +1 -1
- package/dist/chunks/MeshEditor-CHoGQ9K8.js +123 -0
- package/dist/chunks/MeshEditor-CHoGQ9K8.js.map +1 -0
- package/dist/chunks/{NumberField-BWzhqS19.js → NumberField-CQzS6TjF.js} +2 -2
- package/dist/chunks/{NumberField-BWzhqS19.js.map → NumberField-CQzS6TjF.js.map} +1 -1
- package/dist/chunks/{OptionsBar-D_Cd3ZYs.js → OptionsBar-BWaYG_OH.js} +2 -2
- package/dist/chunks/{OptionsBar-D_Cd3ZYs.js.map → OptionsBar-BWaYG_OH.js.map} +1 -1
- package/dist/chunks/PaintField-BVYMu3OI.js +62 -0
- package/dist/chunks/PaintField-BVYMu3OI.js.map +1 -0
- package/dist/chunks/PaintInput-BzAHCKro.js +131 -0
- package/dist/chunks/PaintInput-BzAHCKro.js.map +1 -0
- package/dist/chunks/{PatternPicker-Ba22Bf4L.js → PatternPicker-C4OryrYi.js} +2 -2
- package/dist/chunks/{PatternPicker-Ba22Bf4L.js.map → PatternPicker-C4OryrYi.js.map} +1 -1
- package/dist/chunks/{Plot2D-CVZwQpWJ.js → Plot2D-Czvyt_vG.js} +1 -1
- package/dist/chunks/{Plot2D-CVZwQpWJ.js.map → Plot2D-Czvyt_vG.js.map} +1 -1
- package/dist/chunks/{PointPlotter-anTHwz8f.js → PointPlotter-Xvb98GwB.js} +2 -2
- package/dist/chunks/{PointPlotter-anTHwz8f.js.map → PointPlotter-Xvb98GwB.js.map} +1 -1
- package/dist/chunks/{Powerline-BaHDJlcO.js → Powerline-B_EH-7Z-.js} +1 -1
- package/dist/chunks/{Powerline-BaHDJlcO.js.map → Powerline-B_EH-7Z-.js.map} +1 -1
- package/dist/chunks/Prefs-FuaJBs3t.js +308 -0
- package/dist/chunks/Prefs-FuaJBs3t.js.map +1 -0
- package/dist/chunks/Properties-B3KU69NI.js +874 -0
- package/dist/chunks/Properties-B3KU69NI.js.map +1 -0
- package/dist/chunks/{RadioGroup-B2_LUgDp.js → RadioGroup-C6xpdQNg.js} +2 -2
- package/dist/chunks/{RadioGroup-B2_LUgDp.js.map → RadioGroup-C6xpdQNg.js.map} +1 -1
- package/dist/chunks/{RangeSlider-S2R3zA8N.js → RangeSlider-CzgeGLVS.js} +1 -1
- package/dist/chunks/{RangeSlider-S2R3zA8N.js.map → RangeSlider-CzgeGLVS.js.map} +1 -1
- package/dist/chunks/{ResizeHandle-CiExUWP-.js → ResizeHandle-1Ey8AOij.js} +1 -1
- package/dist/chunks/{ResizeHandle-CiExUWP-.js.map → ResizeHandle-1Ey8AOij.js.map} +1 -1
- package/dist/chunks/{Select-CacMfs4v.js → Select-BMYVh10x.js} +20 -17
- package/dist/chunks/Select-BMYVh10x.js.map +1 -0
- package/dist/chunks/{SelectionPanel-CbyUT3Dh.js → SelectionPanel-DTpcQidl.js} +12 -12
- package/dist/chunks/{SelectionPanel-CbyUT3Dh.js.map → SelectionPanel-DTpcQidl.js.map} +1 -1
- package/dist/chunks/{Sidebar-Cqcfx3_s.js → Sidebar-BlUjn8lD.js} +1 -1
- package/dist/chunks/{Sidebar-Cqcfx3_s.js.map → Sidebar-BlUjn8lD.js.map} +1 -1
- package/dist/chunks/{SidebarPanel-BLzBo0S2.js → SidebarPanel-BqHfz6VK.js} +2 -2
- package/dist/chunks/{SidebarPanel-BLzBo0S2.js.map → SidebarPanel-BqHfz6VK.js.map} +1 -1
- package/dist/chunks/Slider-B2ywUZH6.js +381 -0
- package/dist/chunks/Slider-B2ywUZH6.js.map +1 -0
- package/dist/chunks/{StatusBar-B9NQ8atD.js → StatusBar-BFt7Yw5O.js} +1 -1
- package/dist/chunks/{StatusBar-B9NQ8atD.js.map → StatusBar-BFt7Yw5O.js.map} +1 -1
- package/dist/chunks/{Switch-C4NU-me1.js → Switch-Om3t3ASc.js} +1 -1
- package/dist/chunks/{Switch-C4NU-me1.js.map → Switch-Om3t3ASc.js.map} +1 -1
- package/dist/chunks/{Tabs-9sODd2Ut.js → Tabs-EAvYywil.js} +1 -1
- package/dist/chunks/{Tabs-9sODd2Ut.js.map → Tabs-EAvYywil.js.map} +1 -1
- package/dist/chunks/{Timeline-DOZgb1CG.js → Timeline-BEyKaBXl.js} +254 -253
- package/dist/chunks/Timeline-BEyKaBXl.js.map +1 -0
- package/dist/chunks/{Toast-LpN1WK8E.js → Toast-iqLDD_XZ.js} +1 -1
- package/dist/chunks/{Toast-LpN1WK8E.js.map → Toast-iqLDD_XZ.js.map} +1 -1
- package/dist/chunks/{ToggleBar-Bxwv6xvj.js → ToggleBar--9As2PWG.js} +8 -8
- package/dist/chunks/ToggleBar--9As2PWG.js.map +1 -0
- package/dist/chunks/TokenPanel-BL9hlq7x.js +374 -0
- package/dist/chunks/TokenPanel-BL9hlq7x.js.map +1 -0
- package/dist/chunks/{ToolButton-B81YjdwO.js → ToolButton-Dd-1T5aX.js} +1 -1
- package/dist/chunks/{ToolButton-B81YjdwO.js.map → ToolButton-Dd-1T5aX.js.map} +1 -1
- package/dist/chunks/{ToolGroup-D7juDOC_.js → ToolGroup-BBI-W-Gm.js} +1 -1
- package/dist/chunks/{ToolGroup-D7juDOC_.js.map → ToolGroup-BBI-W-Gm.js.map} +1 -1
- package/dist/chunks/{ToolPalette-BSzmRJS7.js → ToolPalette-BmTDDpmz.js} +3 -3
- package/dist/chunks/{ToolPalette-BSzmRJS7.js.map → ToolPalette-BmTDDpmz.js.map} +1 -1
- package/dist/chunks/{createKeyframeLayer-AL4jP0EX.js → createKeyframeLayer-7j7ukrSx.js} +198 -193
- package/dist/chunks/createKeyframeLayer-7j7ukrSx.js.map +1 -0
- package/dist/chunks/{icons-BV27dhKB.js → icons-Btrs-JD7.js} +35 -32
- package/dist/chunks/icons-Btrs-JD7.js.map +1 -0
- package/dist/chunks/range.module-DSsOIq1R.js +8 -0
- package/dist/chunks/range.module-DSsOIq1R.js.map +1 -0
- package/dist/chunks/{schema-CPdFNeP6.js → schema-MCVT1MLv.js} +1 -1
- package/dist/chunks/{schema-CPdFNeP6.js.map → schema-MCVT1MLv.js.map} +1 -1
- package/dist/chunks/segmentedControl.module-DmeUMYe3.js +11 -0
- package/dist/chunks/segmentedControl.module-DmeUMYe3.js.map +1 -0
- package/dist/chunks/snap-B0WQwetQ.js +13 -0
- package/dist/chunks/snap-B0WQwetQ.js.map +1 -0
- package/dist/components/ActionBar/ActionBar.d.ts.map +1 -1
- package/dist/components/ActionBar/index.js +1 -1
- package/dist/components/ActionsBar/index.js +1 -1
- package/dist/components/BandEditor/BandEditor.d.ts.map +1 -1
- package/dist/components/BandEditor/index.js +1 -1
- package/dist/components/BandEditor/scale.d.ts +1 -8
- package/dist/components/BandEditor/scale.d.ts.map +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/createFunctionLayer.d.ts.map +1 -1
- package/dist/components/CurveEditor/createKeyframeLayer.d.ts.map +1 -1
- package/dist/components/CurveEditor/index.d.ts +1 -1
- package/dist/components/CurveEditor/index.d.ts.map +1 -1
- package/dist/components/CurveEditor/index.js +4 -3
- package/dist/components/DetentSlider/DetentSlider.d.ts +9 -10
- package/dist/components/DetentSlider/DetentSlider.d.ts.map +1 -1
- package/dist/components/DetentSlider/index.js +1 -1
- package/dist/components/Dialog/index.js +1 -1
- package/dist/components/Disclosure/index.js +1 -1
- package/dist/components/Field/index.js +1 -1
- package/dist/components/FontFamilySelect/index.js +1 -1
- package/dist/components/GradientEditor/GradientEditor.d.ts +3 -0
- package/dist/components/GradientEditor/GradientEditor.d.ts.map +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/Jog.d.ts +28 -0
- package/dist/components/Jog/Jog.d.ts.map +1 -0
- package/dist/components/Jog/index.d.ts +3 -0
- package/dist/components/Jog/index.d.ts.map +1 -0
- package/dist/components/Jog/index.js +2 -0
- package/dist/components/Keycaps/index.js +1 -1
- package/dist/components/MenuButton/index.js +1 -1
- package/dist/components/MeshEditor/MeshEditor.d.ts +30 -0
- package/dist/components/MeshEditor/MeshEditor.d.ts.map +1 -0
- package/dist/components/MeshEditor/index.d.ts +3 -0
- package/dist/components/MeshEditor/index.d.ts.map +1 -0
- package/dist/components/MeshEditor/index.js +2 -0
- package/dist/components/NumberField/index.js +1 -1
- package/dist/components/OptionsBar/index.js +1 -1
- package/dist/components/PaintField/PaintField.d.ts +36 -0
- package/dist/components/PaintField/PaintField.d.ts.map +1 -0
- package/dist/components/PaintField/index.d.ts +3 -0
- package/dist/components/PaintField/index.d.ts.map +1 -0
- package/dist/components/PaintField/index.js +2 -0
- package/dist/components/PaintInput/PaintInput.d.ts.map +1 -1
- package/dist/components/PaintInput/index.js +1 -1
- package/dist/components/PatternPicker/index.js +1 -1
- package/dist/components/Plot2D/index.js +1 -1
- package/dist/components/PointPlotter/index.js +1 -1
- package/dist/components/Powerline/index.js +1 -1
- package/dist/components/Prefs/PrefsForm.d.ts +4 -0
- package/dist/components/Prefs/PrefsForm.d.ts.map +1 -1
- package/dist/components/Prefs/index.js +2 -2
- package/dist/components/Properties/PinDot.d.ts +18 -0
- package/dist/components/Properties/PinDot.d.ts.map +1 -0
- package/dist/components/Properties/PropertyPanel.d.ts +93 -8
- package/dist/components/Properties/PropertyPanel.d.ts.map +1 -1
- package/dist/components/Properties/index.d.ts +4 -2
- package/dist/components/Properties/index.d.ts.map +1 -1
- package/dist/components/Properties/index.js +2 -2
- package/dist/components/Properties/storyLayouts.d.ts +1 -1
- package/dist/components/RadioGroup/index.js +1 -1
- package/dist/components/RangeSlider/index.js +1 -1
- package/dist/components/ResizeHandle/index.js +1 -1
- package/dist/components/Select/Select.d.ts +8 -0
- 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 +19 -1
- package/dist/components/Slider/Slider.d.ts.map +1 -1
- package/dist/components/Slider/index.d.ts +1 -1
- package/dist/components/Slider/index.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/index.js +2 -2
- package/dist/components/Timeline/keys.d.ts +1 -1
- package/dist/components/Timeline/keys.d.ts.map +1 -1
- package/dist/components/Toast/index.js +1 -1
- package/dist/components/ToggleBar/index.js +1 -1
- package/dist/components/TokenPanel/TokenPanel.d.ts +33 -0
- package/dist/components/TokenPanel/TokenPanel.d.ts.map +1 -0
- package/dist/components/TokenPanel/color.d.ts +7 -0
- package/dist/components/TokenPanel/color.d.ts.map +1 -0
- package/dist/components/TokenPanel/index.d.ts +5 -0
- package/dist/components/TokenPanel/index.d.ts.map +1 -0
- package/dist/components/TokenPanel/index.js +2 -0
- package/dist/components/TokenPanel/tokenTypes.d.ts +31 -0
- package/dist/components/TokenPanel/tokenTypes.d.ts.map +1 -0
- package/dist/components/ToolButton/index.js +1 -1
- package/dist/components/ToolGroup/index.js +1 -1
- package/dist/components/ToolPalette/index.js +1 -1
- package/dist/components/paintValue.d.ts +8 -0
- package/dist/components/paintValue.d.ts.map +1 -1
- package/dist/handles.d.ts +20 -0
- package/dist/handles.d.ts.map +1 -0
- package/dist/icons/Icon.d.ts +10 -2
- package/dist/icons/Icon.d.ts.map +1 -1
- package/dist/icons/index.d.ts +6 -3
- package/dist/icons/index.d.ts.map +1 -1
- package/dist/icons/paths.d.ts +270 -16
- package/dist/icons/paths.d.ts.map +1 -1
- package/dist/index.d.ts +7 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +75 -70
- package/dist/index.js.map +1 -1
- package/dist/paintPreview.d.ts +13 -0
- package/dist/paintPreview.d.ts.map +1 -0
- package/dist/{components/CurveEditor/snap.d.ts → snap.d.ts} +2 -0
- package/dist/snap.d.ts.map +1 -0
- package/dist/style.css +1 -1
- package/package.json +8 -7
- package/dist/chunks/BandEditor-BeWO56_w.js.map +0 -1
- package/dist/chunks/CurveEditor-Cj0lLiyR.js.map +0 -1
- package/dist/chunks/DetentSlider-CYicfnKr.js +0 -83
- package/dist/chunks/DetentSlider-CYicfnKr.js.map +0 -1
- package/dist/chunks/GradientEditor-dBprHbS0.js.map +0 -1
- package/dist/chunks/Icon-DBXtBB1f.js +0 -101
- package/dist/chunks/Icon-DBXtBB1f.js.map +0 -1
- package/dist/chunks/Keycaps-DSeq6QWH.js.map +0 -1
- package/dist/chunks/PaintInput-DAevU7fd.js +0 -118
- package/dist/chunks/PaintInput-DAevU7fd.js.map +0 -1
- package/dist/chunks/Prefs-CzIn-hlq.js +0 -302
- package/dist/chunks/Prefs-CzIn-hlq.js.map +0 -1
- package/dist/chunks/Properties-DJaDEJkT.js +0 -765
- package/dist/chunks/Properties-DJaDEJkT.js.map +0 -1
- package/dist/chunks/Select-CacMfs4v.js.map +0 -1
- package/dist/chunks/Slider--DFRC_hc.js +0 -303
- package/dist/chunks/Slider--DFRC_hc.js.map +0 -1
- package/dist/chunks/Timeline-DOZgb1CG.js.map +0 -1
- package/dist/chunks/ToggleBar-Bxwv6xvj.js.map +0 -1
- package/dist/chunks/createKeyframeLayer-AL4jP0EX.js.map +0 -1
- package/dist/chunks/icons-BV27dhKB.js.map +0 -1
- package/dist/chunks/range.module-CvSfABmu.js +0 -8
- package/dist/chunks/range.module-CvSfABmu.js.map +0 -1
- package/dist/chunks/segmentedControl.module-BgvAPkSZ.js +0 -11
- package/dist/chunks/segmentedControl.module-BgvAPkSZ.js.map +0 -1
- package/dist/components/CurveEditor/snap.d.ts.map +0 -1
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { t as e } from "./dlog-CMYiRF3Q.js";
|
|
2
|
-
import { c as t, s as n, t as r } from "./Plot2D-
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
2
|
+
import { c as t, s as n, t as r } from "./Plot2D-Czvyt_vG.js";
|
|
3
|
+
import { t as i } from "./snap-B0WQwetQ.js";
|
|
4
|
+
import { Fragment as a, jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
5
|
+
import { cubicBezierEasing as c, openPointerSession as l, resolveEasing as u } from "@weasel-js/core";
|
|
6
|
+
import { useCallback as d, useEffect as f, useMemo as p, useRef as m, useState as h } from "react";
|
|
7
|
+
import { tokenPx as g } from "@weasel-js/theme";
|
|
6
8
|
//#region src/components/CurveEditor/hitTest.ts
|
|
7
|
-
function
|
|
9
|
+
function _(e, t, n) {
|
|
8
10
|
let r = n * n, i = null;
|
|
9
11
|
for (let n = 0; n < e.length; n++) {
|
|
10
12
|
let a = e[n], o = a.x - t.x, s = a.y - t.y, c = o * o + s * s;
|
|
@@ -15,7 +17,7 @@ function h(e, t, n) {
|
|
|
15
17
|
}
|
|
16
18
|
return i ? { index: i.index } : null;
|
|
17
19
|
}
|
|
18
|
-
function
|
|
20
|
+
function v(e, t, n) {
|
|
19
21
|
let r = n * n, i = null;
|
|
20
22
|
for (let n = 0; n < e.length; n++) {
|
|
21
23
|
let a = e[n];
|
|
@@ -39,29 +41,42 @@ function g(e, t, n) {
|
|
|
39
41
|
t: i.t
|
|
40
42
|
} : null;
|
|
41
43
|
}
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
44
|
+
//#endregion
|
|
45
|
+
//#region src/handles.ts
|
|
46
|
+
var y = [
|
|
47
|
+
"--wzl-handle-size",
|
|
48
|
+
"--wzl-handle-size-sm",
|
|
49
|
+
"--wzl-handle-size-lg"
|
|
50
|
+
];
|
|
51
|
+
function b(e, t) {
|
|
52
|
+
return g(e, t);
|
|
53
|
+
}
|
|
54
|
+
function x(e, t) {
|
|
55
|
+
return b(e, t) / 2;
|
|
56
|
+
}
|
|
57
|
+
var S = {
|
|
58
|
+
root: "_root_61ttk_1",
|
|
59
|
+
fill: "_fill_61ttk_18",
|
|
60
|
+
curve: "_curve_61ttk_24",
|
|
61
|
+
anchor: "_anchor_61ttk_31",
|
|
62
|
+
active: "_active_61ttk_42",
|
|
63
|
+
pinned: "_pinned_61ttk_47",
|
|
64
|
+
locked: "_locked_61ttk_54",
|
|
65
|
+
endpoint: "_endpoint_61ttk_62",
|
|
66
|
+
hidden: "_hidden_61ttk_70",
|
|
67
|
+
keyframe: "_keyframe_61ttk_84",
|
|
68
|
+
handle: "_handle_61ttk_91",
|
|
69
|
+
segmentTarget: "_segmentTarget_61ttk_97",
|
|
70
|
+
keyframeGhost: "_keyframeGhost_61ttk_107",
|
|
71
|
+
segmentBand: "_segmentBand_61ttk_115",
|
|
72
|
+
handleStem: "_handleStem_61ttk_135"
|
|
73
|
+
}, C = {
|
|
59
74
|
shift: !1,
|
|
60
75
|
alt: !1,
|
|
61
76
|
meta: !1,
|
|
62
77
|
ctrl: !1
|
|
63
78
|
};
|
|
64
|
-
function
|
|
79
|
+
function w(e) {
|
|
65
80
|
return {
|
|
66
81
|
shift: e.shiftKey,
|
|
67
82
|
alt: e.altKey,
|
|
@@ -69,22 +84,22 @@ function y(e) {
|
|
|
69
84
|
ctrl: e.ctrlKey
|
|
70
85
|
};
|
|
71
86
|
}
|
|
72
|
-
function
|
|
73
|
-
let { layers:
|
|
74
|
-
xMin:
|
|
75
|
-
xMax:
|
|
76
|
-
yMin:
|
|
77
|
-
yMax:
|
|
78
|
-
}), [
|
|
87
|
+
function T(i) {
|
|
88
|
+
let { layers: a, onLayerChange: c, onLayerCommit: u, width: g, height: _, xRange: v = [0, 1], yRange: y = [0, 1], grid: b, axes: x, xTicks: T, yTicks: E, className: D, style: O, children: k } = i, A = i.history !== !1, j = p(() => ({
|
|
89
|
+
xMin: v[0],
|
|
90
|
+
xMax: v[1],
|
|
91
|
+
yMin: y[0],
|
|
92
|
+
yMax: y[1]
|
|
93
|
+
}), [v, y]), M = p(() => ({
|
|
79
94
|
width: g,
|
|
80
|
-
height:
|
|
81
|
-
}), [g,
|
|
82
|
-
N.current =
|
|
83
|
-
let P =
|
|
95
|
+
height: _
|
|
96
|
+
}), [g, _]), N = m(a);
|
|
97
|
+
N.current = a;
|
|
98
|
+
let P = m(j);
|
|
84
99
|
P.current = j;
|
|
85
|
-
let F =
|
|
100
|
+
let F = m(M);
|
|
86
101
|
F.current = M;
|
|
87
|
-
let I =
|
|
102
|
+
let I = m(null), L = d((e) => {
|
|
88
103
|
let r = P.current, i = F.current;
|
|
89
104
|
return {
|
|
90
105
|
modelRange: r,
|
|
@@ -93,17 +108,17 @@ function b(i) {
|
|
|
93
108
|
toModel: (e) => t(e, r, i),
|
|
94
109
|
modifiers: e
|
|
95
110
|
};
|
|
96
|
-
}, []), R =
|
|
111
|
+
}, []), R = m(null), [z, B] = h(null), V = m([]), H = m([]), U = d(() => {
|
|
97
112
|
let e = /* @__PURE__ */ new Map();
|
|
98
113
|
for (let t of N.current) e.set(t.layer.id, t.state);
|
|
99
114
|
return e;
|
|
100
|
-
}, []), W =
|
|
115
|
+
}, []), W = d((e) => {
|
|
101
116
|
let t = N.current;
|
|
102
117
|
for (let n of t) {
|
|
103
118
|
let t = e.get(n.layer.id);
|
|
104
|
-
t !== void 0 && t !== n.state &&
|
|
119
|
+
t !== void 0 && t !== n.state && c(n.layer.id, t);
|
|
105
120
|
}
|
|
106
|
-
}, [
|
|
121
|
+
}, [c]), G = d(() => {
|
|
107
122
|
if (!A) return;
|
|
108
123
|
let e = V.current;
|
|
109
124
|
if (e.length === 0) return;
|
|
@@ -113,7 +128,7 @@ function b(i) {
|
|
|
113
128
|
A,
|
|
114
129
|
U,
|
|
115
130
|
W
|
|
116
|
-
]), K =
|
|
131
|
+
]), K = d(() => {
|
|
117
132
|
if (!A) return;
|
|
118
133
|
let e = H.current;
|
|
119
134
|
if (e.length === 0) return;
|
|
@@ -123,9 +138,9 @@ function b(i) {
|
|
|
123
138
|
A,
|
|
124
139
|
U,
|
|
125
140
|
W
|
|
126
|
-
]), q =
|
|
141
|
+
]), q = m(() => {}), J = m(() => {}), Y = m(() => {}), X = m(null), Z = d(() => {
|
|
127
142
|
X.current = null, R.current = null, B(null);
|
|
128
|
-
}, []), Q =
|
|
143
|
+
}, []), Q = d((e) => {
|
|
129
144
|
for (let t of N.current) if (t.layer.id === e) return t.state;
|
|
130
145
|
}, []);
|
|
131
146
|
q.current = (e) => {
|
|
@@ -135,8 +150,8 @@ function b(i) {
|
|
|
135
150
|
if (!n) return;
|
|
136
151
|
let r = n.clientToModel(e), i = Q(t.layerId);
|
|
137
152
|
if (i === void 0) return;
|
|
138
|
-
let a = L(
|
|
139
|
-
o !== i &&
|
|
153
|
+
let a = L(w(e)), o = t.gesture.onMove(i, r, e, a);
|
|
154
|
+
o !== i && c(t.layerId, o);
|
|
140
155
|
}, J.current = (e) => {
|
|
141
156
|
let t = R.current;
|
|
142
157
|
if (!t) return;
|
|
@@ -145,8 +160,8 @@ function b(i) {
|
|
|
145
160
|
Z();
|
|
146
161
|
return;
|
|
147
162
|
}
|
|
148
|
-
let r = L(
|
|
149
|
-
i !== n &&
|
|
163
|
+
let r = L(w(e)), i = t.gesture.onCommit ? t.gesture.onCommit(n, r) : n;
|
|
164
|
+
i !== n && c(t.layerId, i), A && (V.current.push(t.startStates), H.current = []), u && u(t.layerId, i, t.startSelfState), Z();
|
|
150
165
|
}, Y.current = () => {
|
|
151
166
|
let e = R.current;
|
|
152
167
|
if (!e) return;
|
|
@@ -155,24 +170,24 @@ function b(i) {
|
|
|
155
170
|
Z();
|
|
156
171
|
return;
|
|
157
172
|
}
|
|
158
|
-
let n = L(
|
|
159
|
-
r !== t &&
|
|
173
|
+
let n = L(C), r = e.gesture.onCancel ? e.gesture.onCancel(t, n) : e.startSelfState;
|
|
174
|
+
r !== t && c(e.layerId, r), Z();
|
|
160
175
|
};
|
|
161
|
-
let $ =
|
|
176
|
+
let $ = d((e, t, n) => {
|
|
162
177
|
let r = U();
|
|
163
178
|
R.current = {
|
|
164
179
|
layerId: e,
|
|
165
180
|
gesture: n,
|
|
166
181
|
startStates: r,
|
|
167
182
|
startSelfState: r.get(e)
|
|
168
|
-
}, B(e), X.current =
|
|
183
|
+
}, B(e), X.current = l(t.currentTarget, t, {
|
|
169
184
|
onMove: (e) => q.current(e),
|
|
170
185
|
onEnd: (e) => J.current(e),
|
|
171
186
|
onCancel: () => Y.current()
|
|
172
187
|
}, { capture: !1 });
|
|
173
|
-
}, [U]), ee =
|
|
188
|
+
}, [U]), ee = d((t, n) => {
|
|
174
189
|
if (R.current) return;
|
|
175
|
-
let r = L(
|
|
190
|
+
let r = L(w(t)), i = N.current, a = t.nativeEvent;
|
|
176
191
|
e("layered-curve-editor", "pointerdown", {
|
|
177
192
|
plot: n.plot,
|
|
178
193
|
model: n.model,
|
|
@@ -180,56 +195,56 @@ function b(i) {
|
|
|
180
195
|
});
|
|
181
196
|
let o = U();
|
|
182
197
|
for (let e = i.length - 1; e >= 0; e--) {
|
|
183
|
-
let s = i[e],
|
|
184
|
-
if (!
|
|
185
|
-
let
|
|
198
|
+
let s = i[e], l = s.layer.hitTest?.(s.state, n.plot, r);
|
|
199
|
+
if (!l) continue;
|
|
200
|
+
let d = s.state, f, p = s.layer.onPointerDown?.(d, l, a, r, {
|
|
186
201
|
plot: n.plot,
|
|
187
202
|
model: n.model,
|
|
188
203
|
commit(e) {
|
|
189
|
-
|
|
204
|
+
f = e, c(s.layer.id, e);
|
|
190
205
|
}
|
|
191
206
|
});
|
|
192
|
-
if (t.stopPropagation(),
|
|
193
|
-
$(s.layer.id, t,
|
|
207
|
+
if (t.stopPropagation(), p) {
|
|
208
|
+
$(s.layer.id, t, p);
|
|
194
209
|
return;
|
|
195
210
|
}
|
|
196
|
-
|
|
211
|
+
f !== void 0 && (A && (V.current.push(o), H.current = []), u?.(s.layer.id, f, d));
|
|
197
212
|
return;
|
|
198
213
|
}
|
|
199
214
|
let s = null;
|
|
200
215
|
for (let e = i.length - 1; e >= 0; e--) {
|
|
201
|
-
let
|
|
202
|
-
if (!
|
|
203
|
-
let u =
|
|
216
|
+
let l = i[e];
|
|
217
|
+
if (!l.layer.onEmptyPointerDown) continue;
|
|
218
|
+
let u = l.state, d, f = l.layer.onEmptyPointerDown(u, n.model, a, r, {
|
|
204
219
|
plot: n.plot,
|
|
205
220
|
model: n.model,
|
|
206
221
|
commit(e) {
|
|
207
|
-
d = e, l
|
|
222
|
+
d = e, c(l.layer.id, e);
|
|
208
223
|
}
|
|
209
224
|
});
|
|
210
225
|
if (f) {
|
|
211
|
-
$(
|
|
226
|
+
$(l.layer.id, t, f), d !== void 0 && R.current !== null && (R.current.startStates = o, R.current.startSelfState = o.get(l.layer.id));
|
|
212
227
|
return;
|
|
213
228
|
}
|
|
214
229
|
if (d !== void 0) {
|
|
215
230
|
s = {
|
|
216
|
-
id:
|
|
231
|
+
id: l.layer.id,
|
|
217
232
|
next: d,
|
|
218
233
|
prev: u
|
|
219
234
|
};
|
|
220
235
|
break;
|
|
221
236
|
}
|
|
222
237
|
}
|
|
223
|
-
s && (A && (V.current.push(o), H.current = []),
|
|
238
|
+
s && (A && (V.current.push(o), H.current = []), u?.(s.id, s.next, s.prev));
|
|
224
239
|
}, [
|
|
225
240
|
L,
|
|
226
241
|
$,
|
|
227
|
-
|
|
228
|
-
|
|
242
|
+
c,
|
|
243
|
+
u,
|
|
229
244
|
A,
|
|
230
245
|
U
|
|
231
|
-
]), te =
|
|
232
|
-
let t = L(
|
|
246
|
+
]), te = d((e) => {
|
|
247
|
+
let t = L(w(e)), n = N.current;
|
|
233
248
|
if (A && (e.metaKey || e.ctrlKey)) {
|
|
234
249
|
let t = e.key.toLowerCase();
|
|
235
250
|
if (t === "z") {
|
|
@@ -246,8 +261,8 @@ function b(i) {
|
|
|
246
261
|
if (!i.layer.onKeyDown) continue;
|
|
247
262
|
let a = U(), o;
|
|
248
263
|
if (i.layer.onKeyDown(i.state, e.nativeEvent, t, { commit(e) {
|
|
249
|
-
o = e,
|
|
250
|
-
} }), o !== void 0 && (A && (V.current.push(a), H.current = []),
|
|
264
|
+
o = e, c(i.layer.id, e);
|
|
265
|
+
} }), o !== void 0 && (A && (V.current.push(a), H.current = []), u?.(i.layer.id, o, i.state)), e.nativeEvent.defaultPrevented) return;
|
|
251
266
|
}
|
|
252
267
|
}, [
|
|
253
268
|
A,
|
|
@@ -255,28 +270,28 @@ function b(i) {
|
|
|
255
270
|
K,
|
|
256
271
|
L,
|
|
257
272
|
U,
|
|
258
|
-
|
|
259
|
-
|
|
273
|
+
c,
|
|
274
|
+
u
|
|
260
275
|
]);
|
|
261
|
-
|
|
276
|
+
f(() => () => {
|
|
262
277
|
X.current?.cancel();
|
|
263
278
|
}, []);
|
|
264
|
-
let ne =
|
|
279
|
+
let ne = p(() => ({
|
|
265
280
|
modelRange: j,
|
|
266
281
|
plotSize: M,
|
|
267
282
|
toPlot: (e) => n(e, j, M),
|
|
268
283
|
toModel: (e) => t(e, j, M)
|
|
269
284
|
}), [j, M]);
|
|
270
|
-
return /* @__PURE__ */
|
|
285
|
+
return /* @__PURE__ */ s(r, {
|
|
271
286
|
ref: I,
|
|
272
|
-
className: [
|
|
287
|
+
className: [S.root, D].filter(Boolean).join(" "),
|
|
273
288
|
style: O,
|
|
274
289
|
width: g,
|
|
275
|
-
height:
|
|
276
|
-
xRange:
|
|
277
|
-
yRange:
|
|
278
|
-
grid:
|
|
279
|
-
axes:
|
|
290
|
+
height: _,
|
|
291
|
+
xRange: v,
|
|
292
|
+
yRange: y,
|
|
293
|
+
grid: b,
|
|
294
|
+
axes: x,
|
|
280
295
|
xTicks: T,
|
|
281
296
|
yTicks: E,
|
|
282
297
|
tabIndex: A ? 0 : void 0,
|
|
@@ -284,7 +299,7 @@ function b(i) {
|
|
|
284
299
|
"aria-label": i["aria-label"],
|
|
285
300
|
onPointerDown: ee,
|
|
286
301
|
onKeyDown: te,
|
|
287
|
-
children: [k,
|
|
302
|
+
children: [k, a.map((e) => {
|
|
288
303
|
let t = {
|
|
289
304
|
...ne,
|
|
290
305
|
modifiers: {
|
|
@@ -295,7 +310,7 @@ function b(i) {
|
|
|
295
310
|
},
|
|
296
311
|
isActive: z === e.layer.id
|
|
297
312
|
};
|
|
298
|
-
return /* @__PURE__ */
|
|
313
|
+
return /* @__PURE__ */ o("g", {
|
|
299
314
|
"data-layer-id": e.layer.id,
|
|
300
315
|
children: e.layer.render(e.state, t)
|
|
301
316
|
}, e.layer.id);
|
|
@@ -303,19 +318,9 @@ function b(i) {
|
|
|
303
318
|
});
|
|
304
319
|
}
|
|
305
320
|
//#endregion
|
|
306
|
-
//#region src/components/CurveEditor/snap.ts
|
|
307
|
-
function x(e, t, n) {
|
|
308
|
-
let r = e, i = n;
|
|
309
|
-
for (let n of t) {
|
|
310
|
-
let t = Math.abs(n - e);
|
|
311
|
-
t <= i && (r = n, i = t);
|
|
312
|
-
}
|
|
313
|
-
return r;
|
|
314
|
-
}
|
|
315
|
-
//#endregion
|
|
316
321
|
//#region src/components/CurveEditor/createKeyframeLayer.tsx
|
|
317
|
-
var
|
|
318
|
-
function
|
|
322
|
+
var E = 16, D = 8, O = 8, k = 6, A = x("--wzl-handle-size"), j = 3.5, M = 10, N = .01;
|
|
323
|
+
function P(e) {
|
|
319
324
|
return {
|
|
320
325
|
keys: e,
|
|
321
326
|
selectedKey: null,
|
|
@@ -323,14 +328,14 @@ function j(e) {
|
|
|
323
328
|
drag: null
|
|
324
329
|
};
|
|
325
330
|
}
|
|
326
|
-
function
|
|
331
|
+
function F(e, t) {
|
|
327
332
|
return t ? Math.min(t[1], Math.max(t[0], e)) : e;
|
|
328
333
|
}
|
|
329
|
-
function
|
|
334
|
+
function I(e) {
|
|
330
335
|
let t = e?.easing;
|
|
331
336
|
return typeof t == "object" && t && "bezier" in t ? t.bezier : null;
|
|
332
337
|
}
|
|
333
|
-
function
|
|
338
|
+
function L(e, t, n, r) {
|
|
334
339
|
let i = {
|
|
335
340
|
...e[t],
|
|
336
341
|
t: n,
|
|
@@ -341,7 +346,7 @@ function P(e, t, n, r) {
|
|
|
341
346
|
selectedKey: s
|
|
342
347
|
};
|
|
343
348
|
}
|
|
344
|
-
function
|
|
349
|
+
function R(e) {
|
|
345
350
|
let { drag: t, keys: n } = e;
|
|
346
351
|
if (!t) return {
|
|
347
352
|
keys: n,
|
|
@@ -352,7 +357,7 @@ function F(e) {
|
|
|
352
357
|
return e && e.t === t.t && e.value === t.value ? {
|
|
353
358
|
keys: n,
|
|
354
359
|
selectedKey: t.index
|
|
355
|
-
} :
|
|
360
|
+
} : L(n, t.index, t.t, t.value);
|
|
356
361
|
}
|
|
357
362
|
let r = n.slice();
|
|
358
363
|
return r[t.segment] = {
|
|
@@ -363,18 +368,18 @@ function F(e) {
|
|
|
363
368
|
selectedKey: e.selectedKey
|
|
364
369
|
};
|
|
365
370
|
}
|
|
366
|
-
function
|
|
367
|
-
let t = e.id ?? "keyframes", n = e.label ?? "Curve", r = e.formatX ?? ((e) => String(Math.round(e))),
|
|
368
|
-
function
|
|
371
|
+
function z(e = {}) {
|
|
372
|
+
let t = e.id ?? "keyframes", n = e.label ?? "Curve", r = e.formatX ?? ((e) => String(Math.round(e))), l = e.snapRadiusPx ?? 6;
|
|
373
|
+
function d(e, t, n) {
|
|
369
374
|
let r = e.drag;
|
|
370
|
-
return r?.kind === "handle" && r.segment === n ?
|
|
375
|
+
return r?.kind === "handle" && r.segment === n ? c(...r.bezier) : u(t[n].easing);
|
|
371
376
|
}
|
|
372
|
-
function
|
|
377
|
+
function f(e, t, n) {
|
|
373
378
|
let r = [];
|
|
374
379
|
for (let i = 1; i < t.length; i++) {
|
|
375
|
-
let a = t[i - 1], o = t[i], s =
|
|
376
|
-
for (let e = 0; e <=
|
|
377
|
-
let t = e /
|
|
380
|
+
let a = t[i - 1], o = t[i], s = d(e, t, i), c = [];
|
|
381
|
+
for (let e = 0; e <= E; e++) {
|
|
382
|
+
let t = e / E;
|
|
378
383
|
c.push(n.toPlot({
|
|
379
384
|
x: a.t + (o.t - a.t) * t,
|
|
380
385
|
y: a.value + (o.value - a.value) * s(t)
|
|
@@ -384,81 +389,81 @@ function I(e = {}) {
|
|
|
384
389
|
}
|
|
385
390
|
return r;
|
|
386
391
|
}
|
|
387
|
-
function
|
|
392
|
+
function p(e) {
|
|
388
393
|
let t = e.selectedSegment;
|
|
389
394
|
if (t === null || t < 1 || t >= e.keys.length) return null;
|
|
390
395
|
let n = e.drag;
|
|
391
|
-
return n?.kind === "handle" && n.segment === t ? n.bezier :
|
|
396
|
+
return n?.kind === "handle" && n.segment === t ? n.bezier : I(e.keys[t]);
|
|
392
397
|
}
|
|
393
|
-
function
|
|
398
|
+
function m(e, t, n) {
|
|
394
399
|
let r = e.keys[e.selectedSegment - 1], i = e.keys[e.selectedSegment], a = (e, t) => n.toPlot({
|
|
395
400
|
x: r.t + e * (i.t - r.t),
|
|
396
401
|
y: r.value + t * (i.value - r.value)
|
|
397
402
|
});
|
|
398
403
|
return [a(t[0], t[1]), a(t[2], t[3])];
|
|
399
404
|
}
|
|
400
|
-
let
|
|
401
|
-
function
|
|
402
|
-
let
|
|
403
|
-
return /* @__PURE__ */
|
|
404
|
-
u !== null && u >= 1 && u <
|
|
405
|
+
let h = (e) => e.map((e, t) => `${t === 0 ? "M" : "L"}${e.x.toFixed(2)},${e.y.toFixed(2)}`).join("");
|
|
406
|
+
function g(e, t) {
|
|
407
|
+
let i = e.drag?.kind === "key" ? R(e).keys : e.keys, c = f(e, i, t), l = c.flatMap((e, t) => t === 0 ? e : e.slice(1)), u = e.selectedSegment, d = p(e), g = e.drag?.kind === "key" ? e.drag.index : null;
|
|
408
|
+
return /* @__PURE__ */ s(a, { children: [
|
|
409
|
+
u !== null && u >= 1 && u < i.length ? (() => {
|
|
405
410
|
let e = t.toPlot({
|
|
406
|
-
x:
|
|
411
|
+
x: i[u - 1].t,
|
|
407
412
|
y: 0
|
|
408
413
|
}).x, n = t.toPlot({
|
|
409
|
-
x:
|
|
414
|
+
x: i[u].t,
|
|
410
415
|
y: 0
|
|
411
416
|
}).x;
|
|
412
|
-
return /* @__PURE__ */
|
|
413
|
-
className:
|
|
417
|
+
return /* @__PURE__ */ o("rect", {
|
|
418
|
+
className: S.segmentBand,
|
|
414
419
|
x: Math.min(e, n),
|
|
415
420
|
y: 0,
|
|
416
421
|
width: Math.abs(n - e),
|
|
417
422
|
height: t.plotSize.height
|
|
418
423
|
});
|
|
419
424
|
})() : null,
|
|
420
|
-
l.length > 1 ? /* @__PURE__ */
|
|
425
|
+
l.length > 1 ? /* @__PURE__ */ o("path", {
|
|
421
426
|
"data-curve-element": "curve",
|
|
422
|
-
className:
|
|
423
|
-
d:
|
|
427
|
+
className: S.curve,
|
|
428
|
+
d: h(l)
|
|
424
429
|
}) : null,
|
|
425
|
-
c.map((e, t) => /* @__PURE__ */
|
|
426
|
-
className:
|
|
427
|
-
d:
|
|
430
|
+
c.map((e, t) => /* @__PURE__ */ o("path", {
|
|
431
|
+
className: S.segmentTarget,
|
|
432
|
+
d: h(e),
|
|
428
433
|
role: "button",
|
|
429
434
|
tabIndex: 0,
|
|
430
|
-
"aria-label": `${n} segment into ${r(
|
|
435
|
+
"aria-label": `${n} segment into ${r(i[t + 1].t)}`,
|
|
431
436
|
"aria-current": u === t + 1 ? "true" : void 0,
|
|
432
437
|
"data-segment-index": t + 1
|
|
433
438
|
}, `seg-${t + 1}`)),
|
|
434
|
-
|
|
435
|
-
let [r,
|
|
439
|
+
d ? (() => {
|
|
440
|
+
let [r, i] = m(e, d, t), c = t.toPlot({
|
|
436
441
|
x: e.keys[u - 1].t,
|
|
437
442
|
y: e.keys[u - 1].value
|
|
438
443
|
}), l = t.toPlot({
|
|
439
444
|
x: e.keys[u].t,
|
|
440
445
|
y: e.keys[u].value
|
|
441
446
|
});
|
|
442
|
-
return /* @__PURE__ */
|
|
443
|
-
/* @__PURE__ */
|
|
444
|
-
className:
|
|
447
|
+
return /* @__PURE__ */ s(a, { children: [
|
|
448
|
+
/* @__PURE__ */ o("line", {
|
|
449
|
+
className: S.handleStem,
|
|
445
450
|
x1: c.x,
|
|
446
451
|
y1: c.y,
|
|
447
452
|
x2: r.x,
|
|
448
453
|
y2: r.y
|
|
449
454
|
}),
|
|
450
|
-
/* @__PURE__ */
|
|
451
|
-
className:
|
|
455
|
+
/* @__PURE__ */ o("line", {
|
|
456
|
+
className: S.handleStem,
|
|
452
457
|
x1: l.x,
|
|
453
458
|
y1: l.y,
|
|
454
|
-
x2:
|
|
455
|
-
y2:
|
|
459
|
+
x2: i.x,
|
|
460
|
+
y2: i.y
|
|
456
461
|
}),
|
|
457
|
-
[r,
|
|
458
|
-
className:
|
|
462
|
+
[r, i].map((e, t) => /* @__PURE__ */ o("circle", {
|
|
463
|
+
className: S.handle,
|
|
459
464
|
cx: e.x,
|
|
460
465
|
cy: e.y,
|
|
461
|
-
r:
|
|
466
|
+
r: j,
|
|
462
467
|
role: "button",
|
|
463
468
|
tabIndex: 0,
|
|
464
469
|
"aria-label": `${n} bezier handle ${t + 1}`,
|
|
@@ -466,38 +471,38 @@ function I(e = {}) {
|
|
|
466
471
|
}, `handle-${t}`))
|
|
467
472
|
] });
|
|
468
473
|
})() : null,
|
|
469
|
-
e.keys.map((i,
|
|
474
|
+
e.keys.map((i, a) => {
|
|
470
475
|
let s = t.toPlot({
|
|
471
476
|
x: i.t,
|
|
472
477
|
y: i.value
|
|
473
478
|
});
|
|
474
|
-
return /* @__PURE__ */
|
|
475
|
-
className:
|
|
476
|
-
x: s.x -
|
|
477
|
-
y: s.y -
|
|
478
|
-
width:
|
|
479
|
-
height:
|
|
479
|
+
return /* @__PURE__ */ o("rect", {
|
|
480
|
+
className: S.keyframe,
|
|
481
|
+
x: s.x - A,
|
|
482
|
+
y: s.y - A,
|
|
483
|
+
width: A * 2,
|
|
484
|
+
height: A * 2,
|
|
480
485
|
transform: `rotate(45 ${s.x} ${s.y})`,
|
|
481
486
|
role: "button",
|
|
482
487
|
tabIndex: 0,
|
|
483
488
|
"aria-label": `${n} key at ${r(i.t)}`,
|
|
484
|
-
"aria-current": e.selectedKey ===
|
|
485
|
-
"data-keyframe-index":
|
|
486
|
-
"data-dragging": g ===
|
|
487
|
-
}, `key-${
|
|
489
|
+
"aria-current": e.selectedKey === a ? "true" : void 0,
|
|
490
|
+
"data-keyframe-index": a,
|
|
491
|
+
"data-dragging": g === a ? "true" : void 0
|
|
492
|
+
}, `key-${a}`);
|
|
488
493
|
}),
|
|
489
494
|
e.drag?.kind === "key" ? (() => {
|
|
490
495
|
let n = t.toPlot({
|
|
491
496
|
x: e.drag.t,
|
|
492
497
|
y: e.drag.value
|
|
493
498
|
});
|
|
494
|
-
return /* @__PURE__ */
|
|
499
|
+
return /* @__PURE__ */ o("rect", {
|
|
495
500
|
"aria-hidden": "true",
|
|
496
|
-
className:
|
|
497
|
-
x: n.x -
|
|
498
|
-
y: n.y -
|
|
499
|
-
width:
|
|
500
|
-
height:
|
|
501
|
+
className: S.keyframeGhost,
|
|
502
|
+
x: n.x - A,
|
|
503
|
+
y: n.y - A,
|
|
504
|
+
width: A * 2,
|
|
505
|
+
height: A * 2,
|
|
501
506
|
transform: `rotate(45 ${n.x} ${n.y})`,
|
|
502
507
|
"data-keyframe-ghost": ""
|
|
503
508
|
});
|
|
@@ -505,23 +510,23 @@ function I(e = {}) {
|
|
|
505
510
|
] });
|
|
506
511
|
}
|
|
507
512
|
function y(e, t, n) {
|
|
508
|
-
let r =
|
|
513
|
+
let r = p(e);
|
|
509
514
|
if (r) {
|
|
510
|
-
let i =
|
|
515
|
+
let i = _(m(e, r, n), t, O);
|
|
511
516
|
if (i) return {
|
|
512
517
|
kind: "handle",
|
|
513
518
|
payload: { handle: i.index }
|
|
514
519
|
};
|
|
515
520
|
}
|
|
516
|
-
let i =
|
|
521
|
+
let i = _(e.keys.map((e) => n.toPlot({
|
|
517
522
|
x: e.t,
|
|
518
523
|
y: e.value
|
|
519
|
-
})), t,
|
|
524
|
+
})), t, D);
|
|
520
525
|
if (i) return {
|
|
521
526
|
kind: "key",
|
|
522
527
|
payload: { index: i.index }
|
|
523
528
|
};
|
|
524
|
-
let a =
|
|
529
|
+
let a = v(f(e, e.keys, n), t, k);
|
|
525
530
|
return a ? {
|
|
526
531
|
kind: "segment",
|
|
527
532
|
payload: { segment: a.segIdx + 1 }
|
|
@@ -529,26 +534,26 @@ function I(e = {}) {
|
|
|
529
534
|
}
|
|
530
535
|
function b(t) {
|
|
531
536
|
return {
|
|
532
|
-
onMove(n, r,
|
|
533
|
-
let
|
|
534
|
-
if (e.snapX && !
|
|
535
|
-
let t = (
|
|
536
|
-
|
|
537
|
+
onMove(n, r, a, o) {
|
|
538
|
+
let s = F(r.x, e.xClamp);
|
|
539
|
+
if (e.snapX && !a.altKey) {
|
|
540
|
+
let t = (o.modelRange.xMax - o.modelRange.xMin) / o.plotSize.width;
|
|
541
|
+
s = F(i(s, e.snapX, Math.abs(t) * l), e.xClamp);
|
|
537
542
|
}
|
|
538
543
|
return {
|
|
539
544
|
...n,
|
|
540
545
|
drag: {
|
|
541
546
|
kind: "key",
|
|
542
547
|
index: t,
|
|
543
|
-
t:
|
|
544
|
-
value:
|
|
548
|
+
t: s,
|
|
549
|
+
value: F(r.y, e.yClamp)
|
|
545
550
|
}
|
|
546
551
|
};
|
|
547
552
|
},
|
|
548
553
|
onCommit(e) {
|
|
549
554
|
return {
|
|
550
555
|
...e,
|
|
551
|
-
...
|
|
556
|
+
...R(e),
|
|
552
557
|
drag: null
|
|
553
558
|
};
|
|
554
559
|
},
|
|
@@ -560,7 +565,7 @@ function I(e = {}) {
|
|
|
560
565
|
}
|
|
561
566
|
};
|
|
562
567
|
}
|
|
563
|
-
function
|
|
568
|
+
function x(e, t) {
|
|
564
569
|
return {
|
|
565
570
|
onMove(n, r) {
|
|
566
571
|
let i = n.keys[e - 1], a = n.keys[e], o = n.drag;
|
|
@@ -578,7 +583,7 @@ function I(e = {}) {
|
|
|
578
583
|
onCommit(e) {
|
|
579
584
|
return {
|
|
580
585
|
...e,
|
|
581
|
-
...
|
|
586
|
+
...R(e),
|
|
582
587
|
drag: null
|
|
583
588
|
};
|
|
584
589
|
},
|
|
@@ -590,10 +595,10 @@ function I(e = {}) {
|
|
|
590
595
|
}
|
|
591
596
|
};
|
|
592
597
|
}
|
|
593
|
-
function
|
|
598
|
+
function C(e, t, n, r, i) {
|
|
594
599
|
if (n.button === 0) {
|
|
595
600
|
if (t.kind === "handle") {
|
|
596
|
-
let n =
|
|
601
|
+
let n = p(e), r = e.selectedSegment;
|
|
597
602
|
if (!n || r === null) return;
|
|
598
603
|
let { handle: a } = t.payload;
|
|
599
604
|
return i.commit({
|
|
@@ -603,7 +608,7 @@ function I(e = {}) {
|
|
|
603
608
|
segment: r,
|
|
604
609
|
bezier: n
|
|
605
610
|
}
|
|
606
|
-
}),
|
|
611
|
+
}), x(r, a);
|
|
607
612
|
}
|
|
608
613
|
if (t.kind === "key") {
|
|
609
614
|
let { index: n } = t.payload, r = e.keys[n];
|
|
@@ -627,10 +632,10 @@ function I(e = {}) {
|
|
|
627
632
|
}
|
|
628
633
|
}
|
|
629
634
|
}
|
|
630
|
-
function
|
|
635
|
+
function w(n, r, i, a) {
|
|
631
636
|
let o = r.target;
|
|
632
637
|
if (o?.closest?.("[data-layer-id]")?.getAttribute("data-layer-id") !== t) return;
|
|
633
|
-
let s = r.key === "Enter" || r.key === " ", c = r.key === "ArrowRight" ? 1 : r.key === "ArrowLeft" ? -1 : 0, l = r.key === "ArrowUp" ? 1 : r.key === "ArrowDown" ? -1 : 0, u = r.shiftKey ?
|
|
638
|
+
let s = r.key === "Enter" || r.key === " ", c = r.key === "ArrowRight" ? 1 : r.key === "ArrowLeft" ? -1 : 0, l = r.key === "ArrowUp" ? 1 : r.key === "ArrowDown" ? -1 : 0, u = r.shiftKey ? M : 1, d = o.closest("[data-keyframe-index]");
|
|
634
639
|
if (d) {
|
|
635
640
|
let t = Number(d.getAttribute("data-keyframe-index")), o = n.keys[t];
|
|
636
641
|
if (!o) return;
|
|
@@ -643,28 +648,28 @@ function I(e = {}) {
|
|
|
643
648
|
}
|
|
644
649
|
if (c === 0 && l === 0) return;
|
|
645
650
|
r.preventDefault();
|
|
646
|
-
let f = i.modelRange, p = (e.step?.x ?? Math.abs(f.xMax - f.xMin) / 100) * u, m = (e.step?.y ?? Math.abs(f.yMax - f.yMin) / 100) * u, h =
|
|
651
|
+
let f = i.modelRange, p = (e.step?.x ?? Math.abs(f.xMax - f.xMin) / 100) * u, m = (e.step?.y ?? Math.abs(f.yMax - f.yMin) / 100) * u, h = F(o.t + c * p, e.xClamp), g = F(o.value + l * m, e.yClamp);
|
|
647
652
|
if (h === o.t && g === o.value) return;
|
|
648
653
|
a.commit({
|
|
649
654
|
...n,
|
|
650
|
-
...
|
|
655
|
+
...L(n.keys, t, h, g),
|
|
651
656
|
drag: null
|
|
652
657
|
});
|
|
653
658
|
return;
|
|
654
659
|
}
|
|
655
|
-
let
|
|
656
|
-
if (
|
|
660
|
+
let f = o.closest("[data-segment-index]");
|
|
661
|
+
if (f && s) {
|
|
657
662
|
r.preventDefault(), a.commit({
|
|
658
663
|
...n,
|
|
659
|
-
selectedSegment: Number(
|
|
664
|
+
selectedSegment: Number(f.getAttribute("data-segment-index"))
|
|
660
665
|
});
|
|
661
666
|
return;
|
|
662
667
|
}
|
|
663
|
-
let m = o.closest("[data-handle-index]"), h =
|
|
668
|
+
let m = o.closest("[data-handle-index]"), h = p(n);
|
|
664
669
|
if (m && h && n.selectedSegment !== null && (c !== 0 || l !== 0)) {
|
|
665
670
|
r.preventDefault();
|
|
666
671
|
let e = Number(m.getAttribute("data-handle-index")), t = [...h];
|
|
667
|
-
t[e * 2] = Math.min(1, Math.max(0, t[e * 2] + c *
|
|
672
|
+
t[e * 2] = Math.min(1, Math.max(0, t[e * 2] + c * N * u)), t[e * 2 + 1] += l * N * u;
|
|
668
673
|
let i = {
|
|
669
674
|
kind: "handle",
|
|
670
675
|
segment: n.selectedSegment,
|
|
@@ -672,7 +677,7 @@ function I(e = {}) {
|
|
|
672
677
|
};
|
|
673
678
|
a.commit({
|
|
674
679
|
...n,
|
|
675
|
-
...
|
|
680
|
+
...R({
|
|
676
681
|
...n,
|
|
677
682
|
drag: i
|
|
678
683
|
}),
|
|
@@ -682,13 +687,13 @@ function I(e = {}) {
|
|
|
682
687
|
}
|
|
683
688
|
return {
|
|
684
689
|
id: t,
|
|
685
|
-
render:
|
|
690
|
+
render: g,
|
|
686
691
|
hitTest: y,
|
|
687
|
-
onPointerDown:
|
|
688
|
-
onKeyDown:
|
|
692
|
+
onPointerDown: C,
|
|
693
|
+
onKeyDown: w
|
|
689
694
|
};
|
|
690
695
|
}
|
|
691
696
|
//#endregion
|
|
692
|
-
export {
|
|
697
|
+
export { S as a, b as c, T as i, _ as l, z as n, y as o, P as r, x as s, R as t, v as u };
|
|
693
698
|
|
|
694
|
-
//# sourceMappingURL=createKeyframeLayer-
|
|
699
|
+
//# sourceMappingURL=createKeyframeLayer-7j7ukrSx.js.map
|