@weasel-js/ui 1.6.1 → 1.7.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-xA73vzzF.js +64 -0
- package/dist/chunks/ActionBar-xA73vzzF.js.map +1 -0
- package/dist/chunks/Badge-CTc9Lkwn.js +14 -0
- package/dist/chunks/Badge-CTc9Lkwn.js.map +1 -0
- package/dist/chunks/{Badge-CyAIZSDo.js → Badge-jYQjrTKc.js} +506 -486
- package/dist/chunks/Badge-jYQjrTKc.js.map +1 -0
- package/dist/chunks/BandEditor-Dd0egAgE.js +292 -0
- package/dist/chunks/BandEditor-Dd0egAgE.js.map +1 -0
- package/dist/chunks/{Button-BIdXHQOx.js → Button-XB-T75YL.js} +2 -2
- package/dist/chunks/{Button-BIdXHQOx.js.map → Button-XB-T75YL.js.map} +1 -1
- package/dist/chunks/{ButtonBar-D5Vi0aj_.js → ButtonBar-CIMKPPRS.js} +7 -9
- package/dist/chunks/{ButtonBar-D5Vi0aj_.js.map → ButtonBar-CIMKPPRS.js.map} +1 -1
- package/dist/chunks/Callout-BUn0dP_S.js +115 -0
- package/dist/chunks/Callout-BUn0dP_S.js.map +1 -0
- package/dist/chunks/Checkbox-DFn-x0JO.js +37 -0
- package/dist/chunks/Checkbox-DFn-x0JO.js.map +1 -0
- package/dist/chunks/CloseButton-BmNmRVtb.js +26 -0
- package/dist/chunks/CloseButton-BmNmRVtb.js.map +1 -0
- package/dist/chunks/ColorField-BLs9fbeq.js +90 -0
- package/dist/chunks/ColorField-BLs9fbeq.js.map +1 -0
- package/dist/chunks/{ColorModeControl-ke5PXbBa.js → ColorModeControl-DaVJ-SyX.js} +3 -3
- package/dist/chunks/{ColorModeControl-ke5PXbBa.js.map → ColorModeControl-DaVJ-SyX.js.map} +1 -1
- package/dist/chunks/ComboBox-CuTLRmUg.js +138 -0
- package/dist/chunks/ComboBox-CuTLRmUg.js.map +1 -0
- package/dist/chunks/{CurveEditor-BDJXjEvK.js → CurveEditor-jVBEqqdv.js} +90 -87
- package/dist/chunks/CurveEditor-jVBEqqdv.js.map +1 -0
- package/dist/chunks/{DataGrid-D-dZj1BD.js → DataGrid-BklgBqS0.js} +17 -17
- package/dist/chunks/DataGrid-BklgBqS0.js.map +1 -0
- package/dist/chunks/DetailList-DFtqdOJj.js +52 -0
- package/dist/chunks/DetailList-DFtqdOJj.js.map +1 -0
- package/dist/chunks/{DetentSlider-CL8TlX3S.js → DetentSlider-Bh7EpMqT.js} +2 -2
- package/dist/chunks/{DetentSlider-CL8TlX3S.js.map → DetentSlider-Bh7EpMqT.js.map} +1 -1
- package/dist/chunks/Dialog-DKfsk5VN.js +63 -0
- package/dist/chunks/Dialog-DKfsk5VN.js.map +1 -0
- package/dist/chunks/{Disclosure-0G0uh2fa.js → Disclosure-Ch2KxYuB.js} +7 -7
- package/dist/chunks/Disclosure-Ch2KxYuB.js.map +1 -0
- package/dist/chunks/{DragGhost-B5_hb9W9.js → DragGhost-BeYDJyLZ.js} +2 -2
- package/dist/chunks/{DragGhost-B5_hb9W9.js.map → DragGhost-BeYDJyLZ.js.map} +1 -1
- package/dist/chunks/{DragHandleGlyph-Dr7Fgo0I.js → DragGrip-AoIZXfZb.js} +2 -2
- package/dist/chunks/DragGrip-AoIZXfZb.js.map +1 -0
- package/dist/chunks/FallthroughDiagram-C7BUe8eU.js +284 -0
- package/dist/chunks/FallthroughDiagram-C7BUe8eU.js.map +1 -0
- package/dist/chunks/Field-DsBlnFKf.js +25 -0
- package/dist/chunks/Field-DsBlnFKf.js.map +1 -0
- package/dist/chunks/FillStrokeSwatch-CgsYQgew.js +112 -0
- package/dist/chunks/FillStrokeSwatch-CgsYQgew.js.map +1 -0
- package/dist/chunks/{FontFamilySelect-DXlMKWfK.js → FontFamilySelect-CGJ5OIOy.js} +2 -2
- package/dist/chunks/FontFamilySelect-CGJ5OIOy.js.map +1 -0
- package/dist/chunks/FontWeightSelect-RbcXYJPS.js +49 -0
- package/dist/chunks/FontWeightSelect-RbcXYJPS.js.map +1 -0
- package/dist/chunks/GestureRoute-BXESrHI0.js +82 -0
- package/dist/chunks/GestureRoute-BXESrHI0.js.map +1 -0
- package/dist/chunks/GradientEditor-DypXzMc-.js +325 -0
- package/dist/chunks/GradientEditor-DypXzMc-.js.map +1 -0
- package/dist/chunks/{Icon-Cgzy8VgC.js → Icon--B1ME-6c.js} +33 -1
- package/dist/chunks/Icon--B1ME-6c.js.map +1 -0
- package/dist/chunks/{InlineRange-eOj6JpJl.js → InlineRange-P01ABSzo.js} +3 -3
- package/dist/chunks/InlineRange-P01ABSzo.js.map +1 -0
- package/dist/chunks/{Input-CHmkfYaD.js → Input-CzwvCZs_.js} +10 -15
- package/dist/chunks/Input-CzwvCZs_.js.map +1 -0
- package/dist/chunks/{ItemList-Cm-HUWCi.js → ItemList-CRu9y7hL.js} +2 -2
- package/dist/chunks/ItemList-CRu9y7hL.js.map +1 -0
- package/dist/chunks/{Jog-DESxZ44P.js → Jog-DfNUYejm.js} +8 -8
- package/dist/chunks/Jog-DfNUYejm.js.map +1 -0
- package/dist/chunks/{Keycaps-C0H_v2gO.js → Keycaps-C-FJyG8k.js} +14 -14
- package/dist/chunks/Keycaps-C-FJyG8k.js.map +1 -0
- package/dist/chunks/{LayerList-nz-QYvTF.js → LayerList-CsDqwYh-.js} +105 -111
- package/dist/chunks/LayerList-CsDqwYh-.js.map +1 -0
- package/dist/chunks/ListEditor-BnGzqERm.js +72 -0
- package/dist/chunks/ListEditor-BnGzqERm.js.map +1 -0
- package/dist/chunks/MenuButton-L9f5vido.js +75 -0
- package/dist/chunks/MenuButton-L9f5vido.js.map +1 -0
- package/dist/chunks/MeshEditor-GbqqiPk8.js +199 -0
- package/dist/chunks/MeshEditor-GbqqiPk8.js.map +1 -0
- package/dist/chunks/NumberField-DLXXgh48.js +209 -0
- package/dist/chunks/NumberField-DLXXgh48.js.map +1 -0
- package/dist/chunks/{OptionsBar-DbzAgIln.js → OptionsBar-DeTAjVb7.js} +6 -8
- package/dist/chunks/{OptionsBar-DbzAgIln.js.map → OptionsBar-DeTAjVb7.js.map} +1 -1
- package/dist/chunks/PaintField-C0hoXc0Y.js +63 -0
- package/dist/chunks/PaintField-C0hoXc0Y.js.map +1 -0
- package/dist/chunks/PaintInput-jQRxM95Y.js +132 -0
- package/dist/chunks/PaintInput-jQRxM95Y.js.map +1 -0
- package/dist/chunks/PatternPicker-CaMYXzhF.js +135 -0
- package/dist/chunks/PatternPicker-CaMYXzhF.js.map +1 -0
- package/dist/chunks/{Plot2D-CTXHkL5p.js → Plot2D-BHNbgCAl.js} +7 -7
- package/dist/chunks/Plot2D-BHNbgCAl.js.map +1 -0
- package/dist/chunks/{PointPlotter-Bxo6haKe.js → PointPlotter-BZ_vk6gV.js} +2 -2
- package/dist/chunks/{PointPlotter-Bxo6haKe.js.map → PointPlotter-BZ_vk6gV.js.map} +1 -1
- package/dist/chunks/{Powerline-ExO5GwEr.js → Powerline-6wIFmDik.js} +2 -2
- package/dist/chunks/{Powerline-ExO5GwEr.js.map → Powerline-6wIFmDik.js.map} +1 -1
- package/dist/chunks/{Prefs-DpqFKiwY.js → Prefs-CkyldX-e.js} +116 -91
- package/dist/chunks/Prefs-CkyldX-e.js.map +1 -0
- package/dist/chunks/{Properties-D_KzDN9K.js → Properties-D15c8NP-.js} +53 -47
- package/dist/chunks/Properties-D15c8NP-.js.map +1 -0
- package/dist/chunks/PropertyField-CV_Gw57S.js +686 -0
- package/dist/chunks/PropertyField-CV_Gw57S.js.map +1 -0
- package/dist/chunks/{RadioGroup-Bh4-12e-.js → RadioGroup-4dbzqvGy.js} +2 -2
- package/dist/chunks/{RadioGroup-Bh4-12e-.js.map → RadioGroup-4dbzqvGy.js.map} +1 -1
- package/dist/chunks/{RangeSlider-BKRRTPTZ.js → RangeSlider-BxokZViJ.js} +8 -8
- package/dist/chunks/RangeSlider-BxokZViJ.js.map +1 -0
- package/dist/chunks/RecentColorsProvider-DHcfk25u.js +84 -0
- package/dist/chunks/RecentColorsProvider-DHcfk25u.js.map +1 -0
- package/dist/chunks/ResizeHandle-CbAgCQOt.js +81 -0
- package/dist/chunks/ResizeHandle-CbAgCQOt.js.map +1 -0
- package/dist/chunks/Select-BppLsJTz.js +236 -0
- package/dist/chunks/Select-BppLsJTz.js.map +1 -0
- package/dist/chunks/SelectionPanel-Cm1qu-ZX.js +107 -0
- package/dist/chunks/SelectionPanel-Cm1qu-ZX.js.map +1 -0
- package/dist/chunks/SidebarPanel-AXQ0jRDx.js +53 -0
- package/dist/chunks/SidebarPanel-AXQ0jRDx.js.map +1 -0
- package/dist/chunks/Slider-Cl5RCeZ7.js +389 -0
- package/dist/chunks/Slider-Cl5RCeZ7.js.map +1 -0
- package/dist/chunks/{StatusBar-DzoPDY4k.js → StatusBar-Ca9Dvhhq.js} +6 -6
- package/dist/chunks/StatusBar-Ca9Dvhhq.js.map +1 -0
- package/dist/chunks/SwatchGrid-9ZPiDmxd.js +78 -0
- package/dist/chunks/SwatchGrid-9ZPiDmxd.js.map +1 -0
- package/dist/chunks/SwatchStrip-Cw0l8Om7.js +577 -0
- package/dist/chunks/SwatchStrip-Cw0l8Om7.js.map +1 -0
- package/dist/chunks/ThemeSwitcher-DiBmMh_B.js +38 -0
- package/dist/chunks/ThemeSwitcher-DiBmMh_B.js.map +1 -0
- package/dist/chunks/{Timeline--58F7MED.js → Timeline-pqnYk5cV.js} +296 -294
- package/dist/chunks/Timeline-pqnYk5cV.js.map +1 -0
- package/dist/chunks/Toast-C3ozq11V.js +170 -0
- package/dist/chunks/Toast-C3ozq11V.js.map +1 -0
- package/dist/chunks/{ToggleBar-DTjGeS0Q.js → ToggleBar-Z2jZiguF.js} +13 -15
- package/dist/chunks/ToggleBar-Z2jZiguF.js.map +1 -0
- package/dist/chunks/{TokenPanel-CMq7uydV.js → TokenPanel-DAkL6vwQ.js} +33 -33
- package/dist/chunks/TokenPanel-DAkL6vwQ.js.map +1 -0
- package/dist/chunks/{ToolButton-CR4sQlxF.js → ToolButton-BURp4YIO.js} +12 -14
- package/dist/chunks/ToolButton-BURp4YIO.js.map +1 -0
- package/dist/chunks/{ToolOptionsBar-CtzTlaN2.js → ToolOptionsBar-COsTJ1cu.js} +9 -7
- package/dist/chunks/ToolOptionsBar-COsTJ1cu.js.map +1 -0
- package/dist/chunks/{ToolPalette-CKG9qY6P.js → ToolPalette-DKDFWOX-.js} +8 -10
- package/dist/chunks/ToolPalette-DKDFWOX-.js.map +1 -0
- package/dist/chunks/{Tooltip-Clg2mhSt.js → Tooltip-C6eFCYxw.js} +2 -2
- package/dist/chunks/{Tooltip-Clg2mhSt.js.map → Tooltip-C6eFCYxw.js.map} +1 -1
- package/dist/chunks/{Tree-DVOtc9R5.js → Tree-Cc8lIzgM.js} +2 -2
- package/dist/chunks/Tree-Cc8lIzgM.js.map +1 -0
- package/dist/chunks/checkbox.module-DLQV9tMX.js +5 -0
- package/dist/chunks/checkbox.module-DLQV9tMX.js.map +1 -0
- package/dist/chunks/{createKeyframeLayer-Czj6Y235.js → createKeyframeLayer-BTa4LyJE.js} +208 -223
- package/dist/chunks/createKeyframeLayer-BTa4LyJE.js.map +1 -0
- package/dist/chunks/field.module-Bh7BTKMh.js +15 -0
- package/dist/chunks/field.module-Bh7BTKMh.js.map +1 -0
- package/dist/chunks/formatShortcut-DRQrVThu.js.map +1 -1
- package/dist/chunks/handles-CqVANLtu.js +17 -0
- package/dist/chunks/handles-CqVANLtu.js.map +1 -0
- package/dist/chunks/{icons-Dk8SRS8g.js → icons-Dr2-r30x.js} +2 -2
- package/dist/chunks/icons-Dr2-r30x.js.map +1 -0
- package/dist/chunks/listbox.module-BcdVJMbm.js +8 -0
- package/dist/chunks/listbox.module-BcdVJMbm.js.map +1 -0
- package/dist/chunks/model-B1-gMBIW.js +386 -0
- package/dist/chunks/model-B1-gMBIW.js.map +1 -0
- package/dist/chunks/{portalHost-yTOVuCej.js → portalHost-CE70wLzo.js} +10 -6
- package/dist/chunks/portalHost-CE70wLzo.js.map +1 -0
- package/dist/chunks/prefField-BE_Ytr2H.js +229 -0
- package/dist/chunks/prefField-BE_Ytr2H.js.map +1 -0
- package/dist/chunks/{segmentTooltip-CStYHKzd.js → segmentTooltip-CGxCOWNz.js} +2 -2
- package/dist/chunks/{segmentTooltip-CStYHKzd.js.map → segmentTooltip-CGxCOWNz.js.map} +1 -1
- package/dist/chunks/segmentedControl.module-BzGXUL5G.js +11 -0
- package/dist/chunks/segmentedControl.module-BzGXUL5G.js.map +1 -0
- package/dist/chunks/useReorderDragList-CStYKjHl.js +133 -0
- package/dist/chunks/useReorderDragList-CStYKjHl.js.map +1 -0
- package/dist/chunks/useRovingTabIndex-D7u22Ia_.js +91 -0
- package/dist/chunks/useRovingTabIndex-D7u22Ia_.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/Badge/bases/ChamferedRect.d.ts.map +1 -1
- package/dist/components/Badge/bases/Powerline.d.ts.map +1 -1
- package/dist/components/Badge/bases/edgeProfiles.d.ts +31 -4
- package/dist/components/Badge/bases/edgeProfiles.d.ts.map +1 -1
- package/dist/components/Badge/index.d.ts +1 -0
- package/dist/components/Badge/index.d.ts.map +1 -1
- package/dist/components/Badge/index.js +3 -2
- package/dist/components/Badge/statusIcons.d.ts +5 -0
- package/dist/components/Badge/statusIcons.d.ts.map +1 -0
- package/dist/components/BandEditor/BandEditor.d.ts +17 -7
- package/dist/components/BandEditor/BandEditor.d.ts.map +1 -1
- package/dist/components/BandEditor/bands.d.ts +5 -2
- package/dist/components/BandEditor/bands.d.ts.map +1 -1
- package/dist/components/BandEditor/index.js +1 -1
- package/dist/components/Button/index.js +1 -1
- package/dist/components/ButtonBar/ButtonBar.d.ts.map +1 -1
- package/dist/components/ButtonBar/index.js +1 -1
- package/dist/components/Callout/Callout.d.ts +2 -2
- package/dist/components/Callout/Callout.d.ts.map +1 -1
- package/dist/components/Callout/index.js +1 -1
- package/dist/components/Checkbox/Checkbox.d.ts +28 -13
- package/dist/components/Checkbox/Checkbox.d.ts.map +1 -1
- package/dist/components/Checkbox/index.js +1 -1
- package/dist/components/CloseButton/CloseButton.d.ts +21 -0
- package/dist/components/CloseButton/CloseButton.d.ts.map +1 -0
- package/dist/components/CloseButton/index.d.ts +3 -0
- package/dist/components/CloseButton/index.d.ts.map +1 -0
- package/dist/components/CloseButton/index.js +2 -0
- package/dist/components/ColorField/ColorField.d.ts +5 -1
- package/dist/components/ColorField/ColorField.d.ts.map +1 -1
- package/dist/components/ColorField/OpacityRange.d.ts +18 -0
- package/dist/components/ColorField/OpacityRange.d.ts.map +1 -0
- package/dist/components/ColorField/index.js +1 -1
- package/dist/components/ColorModeControl/index.js +1 -1
- package/dist/components/ComboBox/ComboBox.d.ts +7 -0
- package/dist/components/ComboBox/ComboBox.d.ts.map +1 -1
- package/dist/components/ComboBox/index.js +1 -1
- package/dist/components/CurveEditor/CurveEditor.d.ts.map +1 -1
- package/dist/components/CurveEditor/LayeredCurveEditor.d.ts.map +1 -1
- package/dist/components/CurveEditor/index.js +2 -2
- package/dist/components/DataGrid/index.js +1 -1
- package/dist/components/DetailList/DetailList.d.ts +31 -5
- package/dist/components/DetailList/DetailList.d.ts.map +1 -1
- package/dist/components/DetailList/index.d.ts +1 -1
- package/dist/components/DetailList/index.d.ts.map +1 -1
- package/dist/components/DetailList/index.js +1 -1
- package/dist/components/DetentSlider/index.js +1 -1
- package/dist/components/Dialog/Dialog.d.ts.map +1 -1
- package/dist/components/Dialog/index.js +1 -1
- package/dist/components/Disclosure/Disclosure.d.ts +1 -1
- package/dist/components/Disclosure/index.js +1 -1
- package/dist/components/DragGhost/index.js +1 -1
- package/dist/components/{DragHandleGlyph/DragHandleGlyph.d.ts → DragGrip/DragGrip.d.ts} +4 -4
- package/dist/components/DragGrip/DragGrip.d.ts.map +1 -0
- package/dist/components/DragGrip/index.d.ts +3 -0
- package/dist/components/DragGrip/index.d.ts.map +1 -0
- package/dist/components/DragGrip/index.js +2 -0
- package/dist/components/FallthroughDiagram/FallthroughDiagram.d.ts +14 -0
- package/dist/components/FallthroughDiagram/FallthroughDiagram.d.ts.map +1 -0
- package/dist/components/FallthroughDiagram/fixtures.d.ts +17 -0
- package/dist/components/FallthroughDiagram/fixtures.d.ts.map +1 -0
- package/dist/components/FallthroughDiagram/index.d.ts +3 -0
- package/dist/components/FallthroughDiagram/index.d.ts.map +1 -0
- package/dist/components/FallthroughDiagram/index.js +2 -0
- package/dist/components/Field/index.js +1 -1
- package/dist/components/FillStrokeSwatch/FillStrokeSwatch.d.ts.map +1 -1
- package/dist/components/FillStrokeSwatch/index.js +1 -1
- package/dist/components/FontFamilySelect/FontFamilySelect.d.ts +20 -0
- package/dist/components/FontFamilySelect/FontFamilySelect.d.ts.map +1 -1
- package/dist/components/FontFamilySelect/index.js +1 -1
- package/dist/components/FontWeightSelect/FontWeightSelect.d.ts +26 -0
- package/dist/components/FontWeightSelect/FontWeightSelect.d.ts.map +1 -0
- package/dist/components/FontWeightSelect/index.d.ts +3 -0
- package/dist/components/FontWeightSelect/index.d.ts.map +1 -0
- package/dist/components/FontWeightSelect/index.js +2 -0
- package/dist/components/GestureRoute/GestureRoute.d.ts +19 -0
- package/dist/components/GestureRoute/GestureRoute.d.ts.map +1 -0
- package/dist/components/GestureRoute/index.d.ts +3 -0
- package/dist/components/GestureRoute/index.d.ts.map +1 -0
- package/dist/components/GestureRoute/index.js +2 -0
- package/dist/components/GradientEditor/GradientEditor.d.ts +22 -8
- package/dist/components/GradientEditor/GradientEditor.d.ts.map +1 -1
- package/dist/components/GradientEditor/GradientHandles.d.ts +1 -8
- package/dist/components/GradientEditor/GradientHandles.d.ts.map +1 -1
- package/dist/components/GradientEditor/SceneGradientHandles.d.ts +7 -5
- package/dist/components/GradientEditor/SceneGradientHandles.d.ts.map +1 -1
- package/dist/components/GradientEditor/handleOverlay.d.ts +41 -0
- package/dist/components/GradientEditor/handleOverlay.d.ts.map +1 -0
- package/dist/components/GradientEditor/index.js +1 -1
- package/dist/components/InlineRange/index.js +1 -1
- package/dist/components/Input/Input.d.ts +1 -1
- package/dist/components/Input/Input.d.ts.map +1 -1
- package/dist/components/Input/index.js +1 -1
- package/dist/components/ItemList/ItemList.d.ts +32 -31
- package/dist/components/ItemList/ItemList.d.ts.map +1 -1
- package/dist/components/ItemList/index.js +1 -1
- package/dist/components/Jog/index.js +1 -1
- package/dist/components/Keycaps/Keycaps.d.ts +11 -5
- package/dist/components/Keycaps/Keycaps.d.ts.map +1 -1
- package/dist/components/Keycaps/index.d.ts +1 -1
- package/dist/components/Keycaps/index.d.ts.map +1 -1
- package/dist/components/Keycaps/index.js +1 -1
- package/dist/components/LayerList/LayerList.d.ts +1 -1
- package/dist/components/LayerList/LayerList.d.ts.map +1 -1
- package/dist/components/LayerList/index.js +1 -1
- package/dist/components/ListEditor/ListEditor.d.ts.map +1 -1
- package/dist/components/ListEditor/index.js +1 -1
- package/dist/components/MenuButton/MenuButton.d.ts.map +1 -1
- package/dist/components/MenuButton/index.js +1 -1
- package/dist/components/MeshEditor/MeshEditor.d.ts +4 -3
- package/dist/components/MeshEditor/MeshEditor.d.ts.map +1 -1
- package/dist/components/MeshEditor/MeshHandles.d.ts +38 -0
- package/dist/components/MeshEditor/MeshHandles.d.ts.map +1 -0
- package/dist/components/MeshEditor/index.d.ts +2 -0
- package/dist/components/MeshEditor/index.d.ts.map +1 -1
- package/dist/components/MeshEditor/index.js +2 -2
- package/dist/components/NumberField/NumberField.d.ts +1 -1
- package/dist/components/NumberField/NumberField.d.ts.map +1 -1
- package/dist/components/NumberField/UnitField.d.ts +20 -7
- package/dist/components/NumberField/UnitField.d.ts.map +1 -1
- package/dist/components/NumberField/index.js +1 -1
- package/dist/components/OptionsBar/OptionsBar.d.ts.map +1 -1
- package/dist/components/OptionsBar/index.js +1 -1
- package/dist/components/PaintField/PaintField.d.ts.map +1 -1
- package/dist/components/PaintField/index.js +1 -1
- package/dist/components/PaintInput/PaintInput.d.ts.map +1 -1
- package/dist/components/PaintInput/index.js +1 -1
- package/dist/components/PatternPicker/PatternPicker.d.ts +6 -5
- package/dist/components/PatternPicker/PatternPicker.d.ts.map +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.d.ts +1 -1
- package/dist/components/Powerline/index.d.ts.map +1 -1
- package/dist/components/Powerline/index.js +2 -2
- package/dist/components/Prefs/PrefsForm.d.ts +8 -0
- package/dist/components/Prefs/PrefsForm.d.ts.map +1 -1
- package/dist/components/Prefs/PrefsRail.d.ts +3 -2
- package/dist/components/Prefs/PrefsRail.d.ts.map +1 -1
- package/dist/components/Prefs/PrefsRow.d.ts.map +1 -1
- package/dist/components/Prefs/index.d.ts +1 -1
- package/dist/components/Prefs/index.d.ts.map +1 -1
- package/dist/components/Prefs/index.js +2 -2
- package/dist/components/Prefs/prefField.d.ts +13 -0
- package/dist/components/Prefs/prefField.d.ts.map +1 -1
- package/dist/components/Prefs/schema.d.ts +2 -2
- package/dist/components/Prefs/schema.d.ts.map +1 -1
- package/dist/components/Properties/PropertyField.d.ts +35 -32
- package/dist/components/Properties/PropertyField.d.ts.map +1 -1
- package/dist/components/Properties/PropertyGroup.d.ts.map +1 -1
- package/dist/components/Properties/PropertyPanel.d.ts +1 -8
- 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 +3 -3
- package/dist/components/RadioGroup/index.js +1 -1
- package/dist/components/RangeSlider/index.js +1 -1
- package/dist/components/RecentColors/RecentColorsProvider.d.ts +24 -0
- package/dist/components/RecentColors/RecentColorsProvider.d.ts.map +1 -0
- package/dist/components/RecentColors/index.d.ts +5 -0
- package/dist/components/RecentColors/index.d.ts.map +1 -0
- package/dist/components/RecentColors/index.js +2 -0
- package/dist/components/RecentColors/recentColors.d.ts +39 -0
- package/dist/components/RecentColors/recentColors.d.ts.map +1 -0
- 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 +6 -2
- package/dist/components/Select/Select.d.ts.map +1 -1
- package/dist/components/Select/index.js +1 -1
- package/dist/components/SelectionPanel/SelectionPanel.d.ts.map +1 -1
- package/dist/components/SelectionPanel/index.js +2 -2
- package/dist/components/SelectionPanel/renderLeaf.d.ts +17 -0
- package/dist/components/SelectionPanel/renderLeaf.d.ts.map +1 -1
- package/dist/components/SidebarPanel/SidebarPanel.d.ts +1 -1
- package/dist/components/SidebarPanel/SidebarPanel.d.ts.map +1 -1
- package/dist/components/SidebarPanel/index.js +1 -1
- package/dist/components/Slider/Slider.d.ts +19 -2
- 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/SwatchGrid/SwatchGrid.d.ts.map +1 -1
- package/dist/components/SwatchGrid/index.js +1 -1
- package/dist/components/SwatchStrip/SwatchStrip.d.ts +44 -0
- package/dist/components/SwatchStrip/SwatchStrip.d.ts.map +1 -0
- package/dist/components/SwatchStrip/index.d.ts +5 -0
- package/dist/components/SwatchStrip/index.d.ts.map +1 -0
- package/dist/components/SwatchStrip/index.js +2 -0
- package/dist/components/SwatchStrip/palettes.d.ts +21 -0
- package/dist/components/SwatchStrip/palettes.d.ts.map +1 -0
- package/dist/components/ThemeSwitcher/ThemeSwitcher.d.ts +38 -0
- package/dist/components/ThemeSwitcher/ThemeSwitcher.d.ts.map +1 -0
- package/dist/components/ThemeSwitcher/index.d.ts +3 -0
- package/dist/components/ThemeSwitcher/index.d.ts.map +1 -0
- package/dist/components/ThemeSwitcher/index.js +2 -0
- package/dist/components/Timeline/AnimatedTimeline.d.ts +1 -0
- package/dist/components/Timeline/AnimatedTimeline.d.ts.map +1 -1
- package/dist/components/Timeline/EasingPicker.d.ts +3 -0
- package/dist/components/Timeline/EasingPicker.d.ts.map +1 -1
- package/dist/components/Timeline/LaneGraph.d.ts +1 -1
- package/dist/components/Timeline/LaneGraph.d.ts.map +1 -1
- package/dist/components/Timeline/Timeline.d.ts +10 -1
- package/dist/components/Timeline/Timeline.d.ts.map +1 -1
- package/dist/components/Timeline/Transport.d.ts +6 -0
- package/dist/components/Timeline/Transport.d.ts.map +1 -1
- package/dist/components/Timeline/index.js +1 -1
- package/dist/components/Timeline/keys.d.ts +1 -0
- package/dist/components/Timeline/keys.d.ts.map +1 -1
- package/dist/components/Toast/Toast.d.ts +12 -3
- package/dist/components/Toast/Toast.d.ts.map +1 -1
- package/dist/components/Toast/index.js +1 -1
- package/dist/components/ToggleBar/ToggleBar.d.ts.map +1 -1
- package/dist/components/ToggleBar/index.js +1 -1
- package/dist/components/TokenPanel/index.js +1 -1
- package/dist/components/TokenPanel/tokenTypes.d.ts +1 -0
- package/dist/components/TokenPanel/tokenTypes.d.ts.map +1 -1
- package/dist/components/ToolButton/ToolButton.d.ts +1 -10
- package/dist/components/ToolButton/ToolButton.d.ts.map +1 -1
- package/dist/components/ToolButton/index.js +1 -1
- package/dist/components/ToolOptionsBar/index.js +1 -1
- package/dist/components/ToolPalette/ToolPalette.d.ts +2 -1
- package/dist/components/ToolPalette/ToolPalette.d.ts.map +1 -1
- package/dist/components/ToolPalette/formatShortcut.d.ts +2 -0
- package/dist/components/ToolPalette/formatShortcut.d.ts.map +1 -1
- package/dist/components/ToolPalette/index.js +1 -1
- package/dist/components/Tooltip/index.js +1 -1
- package/dist/components/Tree/Tree.d.ts +27 -26
- package/dist/components/Tree/Tree.d.ts.map +1 -1
- package/dist/components/Tree/index.js +1 -1
- package/dist/components/spin.d.ts +16 -0
- package/dist/components/spin.d.ts.map +1 -0
- package/dist/components/stanceSurfaces.d.ts.map +1 -1
- package/dist/icons/index.d.ts +51 -2
- package/dist/icons/index.d.ts.map +1 -1
- package/dist/icons/paths.d.ts +12 -0
- package/dist/icons/paths.d.ts.map +1 -1
- package/dist/index.d.ts +9 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +98 -111
- package/dist/index.js.map +1 -1
- package/dist/overlays/portalHost.d.ts +6 -0
- package/dist/overlays/portalHost.d.ts.map +1 -1
- package/dist/paintGradientTrack.d.ts +5 -2
- package/dist/paintGradientTrack.d.ts.map +1 -1
- package/dist/style.css +1 -1
- package/dist/useAsyncOptions.d.ts.map +1 -1
- package/dist/useReorderDragList.d.ts +1 -1
- package/dist/useReorderDragList.d.ts.map +1 -1
- package/dist/useRovingTabIndex.d.ts +40 -39
- package/dist/useRovingTabIndex.d.ts.map +1 -1
- package/package.json +9 -8
- package/dist/chunks/ActionBar-DCq16yFA.js +0 -57
- package/dist/chunks/ActionBar-DCq16yFA.js.map +0 -1
- package/dist/chunks/Badge-CyAIZSDo.js.map +0 -1
- package/dist/chunks/BandEditor-Dhm_Xrlr.js +0 -248
- package/dist/chunks/BandEditor-Dhm_Xrlr.js.map +0 -1
- package/dist/chunks/Callout-yEn9iPlh.js +0 -119
- package/dist/chunks/Callout-yEn9iPlh.js.map +0 -1
- package/dist/chunks/Checkbox-DHXTUHO9.js +0 -47
- package/dist/chunks/Checkbox-DHXTUHO9.js.map +0 -1
- package/dist/chunks/ColorField-BcMcW8Sa.js +0 -60
- package/dist/chunks/ColorField-BcMcW8Sa.js.map +0 -1
- package/dist/chunks/ComboBox-DpT8lc3p.js +0 -138
- package/dist/chunks/ComboBox-DpT8lc3p.js.map +0 -1
- package/dist/chunks/CurveEditor-BDJXjEvK.js.map +0 -1
- package/dist/chunks/DataGrid-D-dZj1BD.js.map +0 -1
- package/dist/chunks/DetailList-BMER1LUZ.js +0 -43
- package/dist/chunks/DetailList-BMER1LUZ.js.map +0 -1
- package/dist/chunks/Dialog-BWyNMgpf.js +0 -66
- package/dist/chunks/Dialog-BWyNMgpf.js.map +0 -1
- package/dist/chunks/Disclosure-0G0uh2fa.js.map +0 -1
- package/dist/chunks/DragHandleGlyph-Dr7Fgo0I.js.map +0 -1
- package/dist/chunks/Field--onYxXTF.js +0 -32
- package/dist/chunks/Field--onYxXTF.js.map +0 -1
- package/dist/chunks/FillStrokeSwatch-DNb0KXPk.js +0 -111
- package/dist/chunks/FillStrokeSwatch-DNb0KXPk.js.map +0 -1
- package/dist/chunks/FontFamilySelect-DXlMKWfK.js.map +0 -1
- package/dist/chunks/GradientEditor-B3a-MsVJ.js +0 -335
- package/dist/chunks/GradientEditor-B3a-MsVJ.js.map +0 -1
- package/dist/chunks/Icon-Cgzy8VgC.js.map +0 -1
- package/dist/chunks/InlineRange-eOj6JpJl.js.map +0 -1
- package/dist/chunks/Input-CHmkfYaD.js.map +0 -1
- package/dist/chunks/ItemList-Cm-HUWCi.js.map +0 -1
- package/dist/chunks/Jog-DESxZ44P.js.map +0 -1
- package/dist/chunks/Keycaps-C0H_v2gO.js.map +0 -1
- package/dist/chunks/LayerList-nz-QYvTF.js.map +0 -1
- package/dist/chunks/ListEditor-BQ6AV3Ac.js +0 -74
- package/dist/chunks/ListEditor-BQ6AV3Ac.js.map +0 -1
- package/dist/chunks/MenuButton-DtaGenKf.js +0 -70
- package/dist/chunks/MenuButton-DtaGenKf.js.map +0 -1
- package/dist/chunks/MeshEditor-qqGc6hlD.js +0 -87
- package/dist/chunks/MeshEditor-qqGc6hlD.js.map +0 -1
- package/dist/chunks/NumberField-CwJOMmQR.js +0 -117
- package/dist/chunks/NumberField-CwJOMmQR.js.map +0 -1
- package/dist/chunks/PaintField-DaJukRc6.js +0 -62
- package/dist/chunks/PaintField-DaJukRc6.js.map +0 -1
- package/dist/chunks/PaintInput-Byhna3H-.js +0 -131
- package/dist/chunks/PaintInput-Byhna3H-.js.map +0 -1
- package/dist/chunks/PatternPicker-B-cUt-JT.js +0 -93
- package/dist/chunks/PatternPicker-B-cUt-JT.js.map +0 -1
- package/dist/chunks/Plot2D-CTXHkL5p.js.map +0 -1
- package/dist/chunks/Prefs-DpqFKiwY.js.map +0 -1
- package/dist/chunks/Properties-D_KzDN9K.js.map +0 -1
- package/dist/chunks/PropertyField-DGCecAnV.js +0 -758
- package/dist/chunks/PropertyField-DGCecAnV.js.map +0 -1
- package/dist/chunks/RangeSlider-BKRRTPTZ.js.map +0 -1
- package/dist/chunks/ResizeHandle-BKT0XYpx.js +0 -79
- package/dist/chunks/ResizeHandle-BKT0XYpx.js.map +0 -1
- package/dist/chunks/Select-CzyfaXzp.js +0 -225
- package/dist/chunks/Select-CzyfaXzp.js.map +0 -1
- package/dist/chunks/SelectionPanel-BgUM1h03.js +0 -103
- package/dist/chunks/SelectionPanel-BgUM1h03.js.map +0 -1
- package/dist/chunks/SidebarPanel-aoIqxbtq.js +0 -55
- package/dist/chunks/SidebarPanel-aoIqxbtq.js.map +0 -1
- package/dist/chunks/Slider-CFwQYQ10.js +0 -383
- package/dist/chunks/Slider-CFwQYQ10.js.map +0 -1
- package/dist/chunks/StatusBar-DzoPDY4k.js.map +0 -1
- package/dist/chunks/SwatchGrid-BARC3rnF.js +0 -73
- package/dist/chunks/SwatchGrid-BARC3rnF.js.map +0 -1
- package/dist/chunks/Timeline--58F7MED.js.map +0 -1
- package/dist/chunks/Toast-DNBb-24H.js +0 -128
- package/dist/chunks/Toast-DNBb-24H.js.map +0 -1
- package/dist/chunks/ToggleBar-DTjGeS0Q.js.map +0 -1
- package/dist/chunks/TokenPanel-CMq7uydV.js.map +0 -1
- package/dist/chunks/ToolButton-CR4sQlxF.js.map +0 -1
- package/dist/chunks/ToolOptionsBar-CtzTlaN2.js.map +0 -1
- package/dist/chunks/ToolPalette-CKG9qY6P.js.map +0 -1
- package/dist/chunks/Tree-DVOtc9R5.js.map +0 -1
- package/dist/chunks/createKeyframeLayer-Czj6Y235.js.map +0 -1
- package/dist/chunks/icons-Dk8SRS8g.js.map +0 -1
- package/dist/chunks/model-Du7Lta4C.js +0 -360
- package/dist/chunks/model-Du7Lta4C.js.map +0 -1
- package/dist/chunks/number-D3NEx_8r.js +0 -89
- package/dist/chunks/number-D3NEx_8r.js.map +0 -1
- package/dist/chunks/portalHost-yTOVuCej.js.map +0 -1
- package/dist/chunks/prefField-Dnl7nmjQ.js +0 -197
- package/dist/chunks/prefField-Dnl7nmjQ.js.map +0 -1
- package/dist/chunks/segmentedControl.module-Bv7DEg8f.js +0 -11
- package/dist/chunks/segmentedControl.module-Bv7DEg8f.js.map +0 -1
- package/dist/chunks/useReorderDragList-B_-5L5Gu.js +0 -131
- package/dist/chunks/useReorderDragList-B_-5L5Gu.js.map +0 -1
- package/dist/chunks/useRovingTabIndex-Bp_hYm_h.js +0 -65
- package/dist/chunks/useRovingTabIndex-Bp_hYm_h.js.map +0 -1
- package/dist/components/DragHandleGlyph/DragHandleGlyph.d.ts.map +0 -1
- package/dist/components/DragHandleGlyph/index.d.ts +0 -3
- package/dist/components/DragHandleGlyph/index.d.ts.map +0 -1
- package/dist/components/DragHandleGlyph/index.js +0 -2
- package/dist/format/number.d.ts +0 -56
- package/dist/format/number.d.ts.map +0 -1
- package/dist/icons/ShapeKindIcon.d.ts +0 -10
- package/dist/icons/ShapeKindIcon.d.ts.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useReorderDragList-B_-5L5Gu.js","names":["isInControlWithin","IDLE","unlockedSegment","lo","i","sourceIndex","items","hi","draggedIdsFor","index","selectedIds","id","it","x","isNoopDrop","indices","draggedIds","a","b","contiguous","prev","v","first","last","targetIndex","useReorderDragList","optsRef","useRef","opts","containerRef","dragRef","state","setState","useState","computeTargetIndex","useCallback","c","sel","rows","el","raw","row","clientY","refCb","reset","onPointerDownRow","container","e","mods","pressed","child","grab","ghostAt","ev","startThresholdDrag","drop","onPress","swallowNextClick","ids","at","target","delta","onReorder","swallow"],"sources":["../../src/useReorderDragList.ts"],"sourcesContent":["import { useCallback, useEffect, useRef, useState } from 'react';\nimport type { ReactNode, PointerEvent as ReactPointerEvent, RefCallback } from 'react';\nimport { startThresholdDrag, type ThresholdDragHandle } from '@weasel-js/core';\nimport { isInControlWithin } from './interactiveTarget';\n\n/** One row in a reorderable list. */\nexport interface ReorderItem {\n id: string;\n label: ReactNode;\n /** Locked rows cannot be dragged, cannot be crossed by drops, and\n * never combine with other rows in a multi-selection. */\n locked?: boolean;\n}\n\n/**\n * Options for {@link useReorderDragList}. `onReorder` receives the dragged ids\n * and the index they were dropped at, measured against the pre-drag `items`.\n */\nexport interface UseReorderDragListOptions {\n items: ReorderItem[];\n selectedIds: string[];\n onReorder(ids: string[], targetIndex: number): void;\n /** A press that was released without ever engaging a drag — the click a\n * list row means by it. Fires for locked rows too, which can be selected\n * but not dragged. Modifiers are read at press, not at release. When this\n * is given, the DOM click that follows the press is dropped, so a row that\n * also handles `click` sees one press, not two. A press that starts on a\n * control inside the row (a toggle) is left to the control. */\n onPress?(id: string, mods: PressModifiers): void;\n /** Pointer-move distance (px) before pending drag engages. Default 4. */\n threshold?: number;\n /** Selector matching the container's children that are rows, for a list\n * that interleaves other elements (a table's detail rows). Default: every\n * child is a row. */\n rowSelector?: string;\n}\n\n/** Modifier keys held when a press began. */\nexport interface PressModifiers {\n shiftKey: boolean;\n ctrlKey: boolean;\n metaKey: boolean;\n altKey: boolean;\n}\n\n/**\n * Where a drag's ghost goes: the dragged rows, drawn again with their top-left\n * at a client-space point, so the row that was grabbed stays under the pointer\n * where it was picked up. `width` is the grabbed row's.\n */\nexport interface ReorderGhost {\n ids: readonly string[];\n left: number;\n top: number;\n width: number;\n}\n\n/**\n * Live drag state for rendering feedback: which ids are being dragged, the\n * insertion index the drop would use, and where their ghost goes. All `null`\n * when no drag is engaged.\n */\nexport interface ReorderDragState {\n draggedIds: string[] | null;\n targetIndex: number | null;\n ghost: ReorderGhost | null;\n}\n\nconst IDLE: ReorderDragState = { draggedIds: null, targetIndex: null, ghost: null };\n\n/**\n * A `ref` for the list container, an `onPointerDown` for each row, and the\n * live {@link ReorderDragState}. The container ref is required, not optional\n * decoration: it is what the drop index is measured against and what the\n * pointer session is opened on.\n */\nexport interface ReorderDragHandlers {\n rowProps(id: string, index: number): { onPointerDown(e: ReactPointerEvent): void };\n containerProps: {\n ref: RefCallback<HTMLElement>;\n };\n state: ReorderDragState;\n /**\n * Move the row at `index` one place up (`-1`) or down (`1`) — the keyboard\n * reorder. It moves what a drag of that row would: the whole selection if\n * the row is in it, else the row alone, never across a locked row. Calls\n * `onReorder` and returns `true`, or returns `false` when nothing can move.\n */\n nudge(id: string, index: number, delta: -1 | 1): boolean;\n}\n\n/**\n * The half-open run of indices a row at `sourceIndex` may be dropped into:\n * bounded by the nearest locked row above and below it, so a locked row is a\n * wall in both directions rather than a global ceiling.\n */\nfunction unlockedSegment(items: readonly ReorderItem[], sourceIndex: number): [number, number] {\n let lo = 0;\n for (let i = sourceIndex - 1; i >= 0; i--) {\n if (items[i]?.locked) { lo = i + 1; break; }\n }\n let hi = items.length;\n for (let i = sourceIndex + 1; i < items.length; i++) {\n if (items[i]?.locked) { hi = i; break; }\n }\n return [lo, hi];\n}\n\n/** What a drag of the row at `index` carries: the selection within its segment if the row is selected, else the row. */\nfunction draggedIdsFor(\n items: readonly ReorderItem[],\n selectedIds: readonly string[],\n id: string,\n index: number,\n): string[] {\n const [lo, hi] = unlockedSegment(items, index);\n return (selectedIds.includes(id) ? [...selectedIds] : [id]).filter((x) => {\n const i = items.findIndex((it) => it.id === x);\n return i >= lo && i < hi;\n });\n}\n\n/** Would dropping `draggedIds` at `targetIndex` leave a contiguous block where it already is? */\nfunction isNoopDrop(items: readonly ReorderItem[], draggedIds: readonly string[], targetIndex: number): boolean {\n const indices = draggedIds\n .map((id) => items.findIndex((it) => it.id === id))\n .filter((i) => i >= 0)\n .sort((a, b) => a - b);\n const contiguous =\n indices.length > 0 &&\n indices.every((v, i) => {\n if (i === 0) return true;\n const prev = indices[i - 1];\n return prev !== undefined && v === prev + 1;\n });\n const first = indices[0];\n const last = indices[indices.length - 1];\n return contiguous\n && first !== undefined\n && last !== undefined\n && targetIndex >= first\n && targetIndex <= last + 1;\n}\n\n/**\n * Drag-to-reorder for a vertical list of rows. Dragging a row that is part of\n * the current selection drags the whole selection; dragging any other row\n * drags just that row. Locked rows can neither be dragged nor crossed by a\n * drop. A drop that would leave a contiguous block where it already is does\n * not call `onReorder`.\n *\n * The rows are the container's children, whatever they are: `ItemList` rows,\n * or the `PropertyGroup`s of a `PropertyList`. A row's `onPointerDown` can go\n * on the whole row or on a handle inside it.\n *\n * A press opens a `startThresholdDrag` on the *container*, which owns the\n * rest of the gesture: a drag that leaves the list still tracks, a release\n * anywhere still drops, and a release the window never delivered still ends\n * the drag. The container is the origin rather than the row because rows come\n * and go as the list re-renders, and a drag must outlive the row it grabbed.\n */\nexport function useReorderDragList(opts: UseReorderDragListOptions): ReorderDragHandlers {\n const optsRef = useRef(opts);\n optsRef.current = opts;\n const containerRef = useRef<HTMLElement | null>(null);\n const dragRef = useRef<ThresholdDragHandle | null>(null);\n const [state, setState] = useState<ReorderDragState>(IDLE);\n\n useEffect(() => () => { dragRef.current?.cancel(); }, []);\n\n const computeTargetIndex = useCallback((clientY: number, sourceIndex: number): number => {\n const [lo, hi] = unlockedSegment(optsRef.current.items, sourceIndex);\n const c = containerRef.current;\n if (!c) return lo;\n const sel = optsRef.current.rowSelector;\n const rows = (sel ? Array.from(c.children).filter((el) => el.matches(sel)) : Array.from(c.children)) as HTMLElement[];\n let raw = rows.length;\n for (let i = 0; i < rows.length; i++) {\n const row = rows[i];\n if (!row) continue;\n const r = row.getBoundingClientRect();\n if (clientY < r.bottom) { raw = i; break; }\n }\n return Math.max(lo, Math.min(raw, hi));\n }, []);\n\n const refCb = useCallback<RefCallback<HTMLElement>>((el) => {\n containerRef.current = el;\n }, []);\n\n const reset = useCallback(() => {\n dragRef.current = null;\n setState(IDLE);\n }, []);\n\n const onPointerDownRow = useCallback((id: string, index: number, e: ReactPointerEvent) => {\n const container = containerRef.current;\n if (!container || dragRef.current) return;\n if (isInControlWithin(e.target, e.currentTarget as Element)) return;\n\n const mods: PressModifiers = {\n shiftKey: e.shiftKey, ctrlKey: e.ctrlKey, metaKey: e.metaKey, altKey: e.altKey,\n };\n let draggedIds: string[] = [];\n let targetIndex = 0;\n // Where in the grabbed row the pointer went down, so the ghost keeps that point under it. The handler may sit on\n // a handle inside the row rather than the row itself, so the row is the container's child holding it.\n const pressed = e.currentTarget as Element;\n const rowEl = Array.from(container.children).find((child) => child.contains(pressed)) ?? pressed;\n const row = rowEl.getBoundingClientRect();\n const grab = { x: e.clientX - row.left, y: e.clientY - row.top };\n const ghostAt = (ev: { clientX: number; clientY: number }): ReorderGhost => ({\n ids: draggedIds,\n left: ev.clientX - grab.x,\n top: ev.clientY - grab.y,\n width: row.width,\n });\n\n dragRef.current = startThresholdDrag(e, {\n origin: container,\n // A locked row still opens a drag so its release reaches `onPress`, and\n // a threshold nothing can cross is what keeps it from ever engaging.\n threshold: optsRef.current.items[index]?.locked\n ? Number.POSITIVE_INFINITY\n : (optsRef.current.threshold ?? 4),\n onActivate: (ev) => {\n draggedIds = draggedIdsFor(optsRef.current.items, optsRef.current.selectedIds, id, index);\n targetIndex = computeTargetIndex(ev.clientY, index);\n setState({ draggedIds, targetIndex, ghost: ghostAt(ev) });\n },\n onMove: (ev) => {\n targetIndex = computeTargetIndex(ev.clientY, index);\n setState({ draggedIds, targetIndex, ghost: ghostAt(ev) });\n },\n onCommit: (ev) => {\n const drop = computeTargetIndex(ev.clientY, index);\n if (!isNoopDrop(optsRef.current.items, draggedIds, drop)) {\n optsRef.current.onReorder(draggedIds, drop);\n }\n reset();\n },\n onClick: () => {\n const { onPress } = optsRef.current;\n if (onPress) {\n onPress(id, mods);\n swallowNextClick(container);\n }\n reset();\n },\n // Every cancel reason — the browser's, a lost capture, an unmount —\n // says the gesture was interrupted rather than aimed, so the rows stay\n // where they were.\n onCancel: reset,\n });\n }, [computeTargetIndex, reset]);\n\n const nudge = useCallback((id: string, index: number, delta: -1 | 1): boolean => {\n const { items, selectedIds, onReorder } = optsRef.current;\n if (items[index]?.locked) return false;\n const ids = draggedIdsFor(items, selectedIds, id, index);\n const at = ids.map((x) => items.findIndex((it) => it.id === x)).sort((a, b) => a - b);\n const first = at[0];\n const last = at[at.length - 1];\n if (first === undefined || last === undefined) return false;\n const [lo, hi] = unlockedSegment(items, index);\n const target = delta < 0 ? first - 1 : last + 2;\n if (target < lo || target > hi || isNoopDrop(items, ids, target)) return false;\n onReorder(ids, target);\n return true;\n }, []);\n\n return {\n nudge,\n rowProps: (id, index) => ({\n onPointerDown: (e) => onPointerDownRow(id, index, e),\n }),\n containerProps: {\n ref: refCb,\n },\n state,\n };\n}\n\n/**\n * The session captured the pointer on the container, so browsers disagree on\n * where the release's click lands; it may still reach the row. `onPress` has\n * already reported this press, so that click is dropped rather than read as a\n * second one. It is dispatched in the same task as the release.\n */\nfunction swallowNextClick(container: HTMLElement): void {\n const swallow = (e: Event) => { e.stopPropagation(); };\n container.addEventListener('click', swallow, true);\n setTimeout(() => { container.removeEventListener('click', swallow, true); }, 0);\n}\n"],"mappings":";;;;AAoEA,IAAMC,IAAyB;CAAE,YAAY;CAAM,aAAa;CAAM,OAAO;AAAK;AA4BlF,SAASC,EAAgB,GAA+B,GAAuC;CAC7F,IAAIC,IAAK;CACT,KAAK,IAAIC,IAAIC,IAAc,GAAGD,KAAK,GAAG,KACpC,IAAIE,EAAMF,EAAE,EAAE,QAAQ;EAAE,IAAKA,IAAI;EAAG;CAAO;CAE7C,IAAIG,IAAKD,EAAM;CACf,KAAK,IAAIF,IAAIC,IAAc,GAAGD,IAAIE,EAAM,QAAQ,KAC9C,IAAIA,EAAMF,EAAE,EAAE,QAAQ;EAAE,IAAKA;EAAG;CAAO;CAEzC,OAAO,CAACD,GAAII,CAAE;AAChB;AAGA,SAASC,EACP,GACA,GACA,GACA,GACU;CACV,IAAM,CAACL,GAAII,KAAML,EAAgBI,GAAOG,CAAK;CAC7C,QAAQC,EAAY,SAASC,CAAE,IAAI,CAAC,GAAGD,CAAW,IAAI,CAACC,CAAE,EAAA,CAAG,QAAQ,MAAM;EACxE,IAAMP,IA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CmD,IAASC,IAAQ,IAAIvC,IAAQ,IAAIC,IAAO;GAG9C,OAFIqC,IAASzD,KAAMyD,IAASrD,KAAMO,EAAWR,GAAOoD,GAAKE,CAAM,IAAU,MACzEE,EAAUJ,GAAKE,CAAM,GACd;EACT,GAAG,CAAC,CAGF;EACA,WAAW,GAAI,OAAW,EACxB,gBAAgB,MAAMf,EAAiBlC,GAAIF,GAAOsC,CAAC,EACrD;EACA,gBAAgB,EACd,KAAKJ,EACP;EACA;CACF;AACF;AAQA,SAASc,EAAiB,GAA8B;CACtD,IAAMM,KAAW,MAAa;EAAE,EAAE,gBAAgB;CAAG;CAErD,AADAjB,EAAU,iBAAiB,SAASiB,GAAS,EAAI,GACjD,iBAAiB;EAAE,EAAU,oBAAoB,SAASA,GAAS,EAAI;CAAG,GAAG,CAAC;AAChF"}
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import { useRef as e } from "react";
|
|
2
|
-
//#region src/useRovingTabIndex.ts
|
|
3
|
-
function t(e) {
|
|
4
|
-
for (let t = 0; t < e.length; t++) if (!e[t].disabled) return t;
|
|
5
|
-
return -1;
|
|
6
|
-
}
|
|
7
|
-
function n(e) {
|
|
8
|
-
for (let t = e.length - 1; t >= 0; t--) if (!e[t].disabled) return t;
|
|
9
|
-
return -1;
|
|
10
|
-
}
|
|
11
|
-
function r(e, t) {
|
|
12
|
-
let n = e.length;
|
|
13
|
-
for (let r = 1; r <= n; r++) {
|
|
14
|
-
let i = (t + r + n) % n;
|
|
15
|
-
if (!e[i].disabled) return i;
|
|
16
|
-
}
|
|
17
|
-
return t;
|
|
18
|
-
}
|
|
19
|
-
function i(e, t) {
|
|
20
|
-
let n = e.length;
|
|
21
|
-
for (let r = 1; r <= n; r++) {
|
|
22
|
-
let i = (t - r + n) % n;
|
|
23
|
-
if (!e[i].disabled) return i;
|
|
24
|
-
}
|
|
25
|
-
return t;
|
|
26
|
-
}
|
|
27
|
-
function a(a) {
|
|
28
|
-
let { items: o, itemClassName: s, onNavigate: c, onActivate: l } = a, u = e(null), d = a.tabStopIndex ?? t(o), f = (e) => {
|
|
29
|
-
let t = u.current;
|
|
30
|
-
t && t.querySelectorAll(`.${s}`)[e]?.focus();
|
|
31
|
-
};
|
|
32
|
-
return {
|
|
33
|
-
rootRef: u,
|
|
34
|
-
tabIndexFor: (e) => e === d ? 0 : -1,
|
|
35
|
-
onKeyDown: (e) => (a) => {
|
|
36
|
-
let s = -1;
|
|
37
|
-
switch (a.key) {
|
|
38
|
-
case "ArrowLeft":
|
|
39
|
-
case "ArrowUp":
|
|
40
|
-
s = i(o, e);
|
|
41
|
-
break;
|
|
42
|
-
case "ArrowRight":
|
|
43
|
-
case "ArrowDown":
|
|
44
|
-
s = r(o, e);
|
|
45
|
-
break;
|
|
46
|
-
case "Home":
|
|
47
|
-
s = t(o);
|
|
48
|
-
break;
|
|
49
|
-
case "End":
|
|
50
|
-
s = n(o);
|
|
51
|
-
break;
|
|
52
|
-
case " ":
|
|
53
|
-
case "Enter":
|
|
54
|
-
l && (a.preventDefault(), l(e));
|
|
55
|
-
return;
|
|
56
|
-
default: return;
|
|
57
|
-
}
|
|
58
|
-
s < 0 || s === e || (a.preventDefault(), c?.(s), f(s));
|
|
59
|
-
}
|
|
60
|
-
};
|
|
61
|
-
}
|
|
62
|
-
//#endregion
|
|
63
|
-
export { a as t };
|
|
64
|
-
|
|
65
|
-
//# sourceMappingURL=useRovingTabIndex-Bp_hYm_h.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useRovingTabIndex-Bp_hYm_h.js","names":["firstEnabledIndex","i","items","lastEnabledIndex","nextEnabledIndex","k","from","prevEnabledIndex","useRovingTabIndex","options","rootRef","useRef","tabStopIndex","focusItem","root","itemClassName","index","nextIndex","e","onActivate","onNavigate"],"sources":["../../src/useRovingTabIndex.ts"],"sourcesContent":["import { useRef, type KeyboardEvent as ReactKeyboardEvent, type RefObject } from 'react';\n\n/** The only thing the hook needs to know about a bar's items: which are\n * skipped by arrow navigation. */\nexport type RovingItem = { disabled?: boolean };\n\n/** Options for {@link useRovingTabIndex}. */\nexport type UseRovingTabIndexOptions = {\n /** In the same order as the elements carrying `itemClassName`. */\n items: readonly RovingItem[];\n /** Class on the focusable element of each item, inside the container the\n * returned `rootRef` is attached to. Their DOM order must match `items`. */\n itemClassName: string;\n /** Index that carries `tabIndex=0`. Defaults to the first enabled item; a\n * radiogroup-style bar passes its selected index so Tab lands on the\n * current value. */\n tabStopIndex?: number;\n /** Called with the new index as arrow/Home/End focus moves, before focus\n * moves. This is where a selection-follows-focus bar commits the value. */\n onNavigate?: (index: number) => void;\n /** Space/Enter on the item at `index`. When omitted the keypress is left\n * alone, which on a native `<button>` produces an ordinary click. */\n onActivate?: (index: number) => void;\n};\n\n/**\n * What {@link useRovingTabIndex} returns: a container ref plus the per-item\n * `tabIndex` and `onKeyDown` values to spread onto each item.\n */\nexport type RovingTabIndex<T extends HTMLElement = HTMLDivElement> = {\n /** Attach to the container element that holds the items. */\n rootRef: RefObject<T | null>;\n /** `tabIndex` value for the item at `index`. */\n tabIndexFor: (index: number) => 0 | -1;\n /** `onKeyDown` for the item at `index`. */\n onKeyDown: (index: number) => (e: ReactKeyboardEvent<HTMLElement>) => void;\n};\n\nfunction firstEnabledIndex(items: readonly RovingItem[]): number {\n for (let i = 0; i < items.length; i++) if (!items[i].disabled) return i;\n return -1;\n}\n\nfunction lastEnabledIndex(items: readonly RovingItem[]): number {\n for (let i = items.length - 1; i >= 0; i--) if (!items[i].disabled) return i;\n return -1;\n}\n\nfunction nextEnabledIndex(items: readonly RovingItem[], from: number): number {\n const n = items.length;\n for (let k = 1; k <= n; k++) {\n const i = (from + k + n) % n;\n if (!items[i].disabled) return i;\n }\n return from;\n}\n\nfunction prevEnabledIndex(items: readonly RovingItem[], from: number): number {\n const n = items.length;\n for (let k = 1; k <= n; k++) {\n const i = (from - k + n) % n;\n if (!items[i].disabled) return i;\n }\n return from;\n}\n\n/**\n * Roving tabindex for a bar of items: one item is in the tab order, and the\n * arrow keys move focus among the rest, skipping disabled ones and wrapping\n * at both ends. Home and End go to the first and last enabled item. Both axes\n * navigate, so the same bar works laid out either way.\n *\n * Backs `ButtonBar`, `OptionsBar`, and `ToggleBar`.\n *\n * **When a bar should not use this.** What decides it is the items, not who\n * owns them. A container of compound controls — a number field, a select, a\n * color field — must leave the arrow keys alone, because those controls edit\n * their own value with them; taking the arrows over would break the control\n * to navigate between controls. `ToolOptionsBar` is that case: it draws its\n * own controls from a tool's schema now rather than taking arbitrary\n * children, and a schema-drawn number field eats arrows exactly as a\n * hand-placed one did, so it keeps plain DOM tab order. A bar whose items are\n * all simple buttons is the case this hook is for.\n *\n * With every item disabled there is no tab stop and the bar drops out of the\n * tab order entirely.\n */\nexport function useRovingTabIndex<T extends HTMLElement = HTMLDivElement>(\n options: UseRovingTabIndexOptions,\n): RovingTabIndex<T> {\n const { items, itemClassName, onNavigate, onActivate } = options;\n const rootRef = useRef<T | null>(null);\n\n const tabStopIndex = options.tabStopIndex ?? firstEnabledIndex(items);\n\n const focusItem = (index: number): void => {\n const root = rootRef.current;\n if (!root) return;\n const elements = root.querySelectorAll<HTMLElement>(`.${itemClassName}`);\n elements[index]?.focus();\n };\n\n const onKeyDown = (index: number) => (e: ReactKeyboardEvent<HTMLElement>): void => {\n let nextIndex = -1;\n switch (e.key) {\n case 'ArrowLeft':\n case 'ArrowUp':\n nextIndex = prevEnabledIndex(items, index);\n break;\n case 'ArrowRight':\n case 'ArrowDown':\n nextIndex = nextEnabledIndex(items, index);\n break;\n case 'Home':\n nextIndex = firstEnabledIndex(items);\n break;\n case 'End':\n nextIndex = lastEnabledIndex(items);\n break;\n case ' ':\n case 'Enter':\n if (onActivate) {\n e.preventDefault();\n onActivate(index);\n }\n return;\n default:\n return;\n }\n if (nextIndex < 0 || nextIndex === index) return;\n e.preventDefault();\n onNavigate?.(nextIndex);\n focusItem(nextIndex);\n };\n\n return {\n rootRef,\n tabIndexFor: (index: number) => (index === tabStopInd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AYX,EAAiBL,GAAOc,CAAK;KACzC;IACF,KAAK;IACL,KAAK;KACH,IAAYZ,EAAiBF,GAAOc,CAAK;KACzC;IACF,KAAK;KACH,IAAYhB,EAAkBE,CAAK;KACnC;IACF,KAAK;KACH,IAAYC,EAAiBD,CAAK;KAClC;IACF,KAAK;IACL,KAAK;KACH,AAAIiB,MACFD,EAAE,eAAe,GACjBC,EAAWH,CAAK;KAElB;IACF,SACE;GACJ;GACA,AAAIC,IAAY,KAAKA,MAAcD,MACnCE,EAAE,eAAe,GACjBE,IAAaH,CAAS,GACtBJ,EAAUI,CAAS;EACrB;CAMA;AACF"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DragHandleGlyph.d.ts","sourceRoot":"","sources":["../../../src/components/DragHandleGlyph/DragHandleGlyph.tsx"],"names":[],"mappings":"AAAA,qCAAqC;AACrC,MAAM,WAAW,oBAAoB;IACnC,sDAAsD;IACtD,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED;;;;0DAI0D;AAC1D,wBAAgB,eAAe,CAAC,EAAE,IAAS,EAAE,EAAE,oBAAoB,+BAiBlE"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/DragHandleGlyph/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAC9D,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC"}
|
package/dist/format/number.d.ts
DELETED
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Display-formatter for numbers. Use this anywhere a number is shown to
|
|
3
|
-
* a user. The whole point: negative values get prefixed with the real
|
|
4
|
-
* MINUS SIGN (U+2212) instead of the ASCII HYPHEN-MINUS (U+002D) that
|
|
5
|
-
* `toLocaleString` and template literals produce by default.
|
|
6
|
-
*
|
|
7
|
-
* U+2212 is the same visual width as `+` and reads as a sign rather
|
|
8
|
-
* than a hyphen — columns of signed numbers align cleanly and the
|
|
9
|
-
* glyph doesn't get confused with a bullet or list dash.
|
|
10
|
-
*/
|
|
11
|
-
export declare const MINUS_SIGN = "\u2212";
|
|
12
|
-
/**
|
|
13
|
-
* Formats a number for display, substituting {@link MINUS_SIGN} for the ASCII
|
|
14
|
-
* hyphen `toLocaleString` emits. Non-finite values stringify as-is.
|
|
15
|
-
*/
|
|
16
|
-
export declare function formatNumber(value: number, options?: Intl.NumberFormatOptions): string;
|
|
17
|
-
/**
|
|
18
|
-
* Parses a string that may carry {@link MINUS_SIGN} in place of the ASCII
|
|
19
|
-
* hyphen. The inverse of {@link formatNumber} for any editing surface that
|
|
20
|
-
* renders its value through it and reads the edited text back.
|
|
21
|
-
*/
|
|
22
|
-
export declare function parseSignedNumber(text: string): number;
|
|
23
|
-
/**
|
|
24
|
-
* Formats a number the way a `compact` readout shows it: below 1,000 at
|
|
25
|
-
* `decimals` places, from 1,000 up at three significant figures with a magnitude
|
|
26
|
-
* suffix (`40.0K`, `294K`, `2.00M`), so the readout holds one width whatever the
|
|
27
|
-
* value. Always `en-US`, so {@link parseNumber} reads it back.
|
|
28
|
-
*/
|
|
29
|
-
export declare function formatCompact(value: number, decimals?: number): string;
|
|
30
|
-
/**
|
|
31
|
-
* Reads a typed number: anything {@link parseSignedNumber} reads, plus
|
|
32
|
-
* thousands commas in the `40,000` shape and a `k`/`m`/`b`/`t` suffix in either
|
|
33
|
-
* case (`2.5m` is 2,500,000). Empty text is NaN rather than zero.
|
|
34
|
-
*
|
|
35
|
-
* Given `units` — a suffix mapped to the factor it scales by — a trailing unit
|
|
36
|
-
* name is read first: the longest match wins, exact case before any case, and
|
|
37
|
-
* a unit beats a magnitude suffix, so with `m` accepted `2m` is `2 * units.m`.
|
|
38
|
-
*/
|
|
39
|
-
export declare function parseNumber(text: string, units?: Readonly<UnitTable>): number;
|
|
40
|
-
/** One unit's conversion into the shown unit: a bare factor, or a scale that
|
|
41
|
-
* also moves zero. Structurally the kit's `UnitEntry`, kept local so this
|
|
42
|
-
* formatting helper stays free of the scene vocabulary. */
|
|
43
|
-
export type UnitTableEntry = number | {
|
|
44
|
-
factor: number;
|
|
45
|
-
offset?: number;
|
|
46
|
-
};
|
|
47
|
-
/** Suffixes a person may type, each mapped to its conversion. */
|
|
48
|
-
export type UnitTable = Record<string, UnitTableEntry>;
|
|
49
|
-
/**
|
|
50
|
-
* Formats a zoom factor for display. Below 2x a percentage reads naturally;
|
|
51
|
-
* past it the numbers get long and a multiplier is what people say out loud,
|
|
52
|
-
* so 250% shows as `2.5x`. Past 100x a tenth is noise, so the decimal is
|
|
53
|
-
* dropped and thousands are grouped: `1009.74` reads as `1,010x`.
|
|
54
|
-
*/
|
|
55
|
-
export declare function formatZoom(zoom: number): string;
|
|
56
|
-
//# sourceMappingURL=number.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"number.d.ts","sourceRoot":"","sources":["../../src/format/number.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,eAAO,MAAM,UAAU,WAAM,CAAC;AAE9B;;;GAGG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,IAAI,CAAC,mBAAmB,GAAG,MAAM,CAKtF;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEtD;AAKD;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,SAAI,GAAG,MAAM,CAOjE;AAED;;;;;;;;GAQG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,QAAQ,CAAC,SAAS,CAAC,GAAG,MAAM,CAkB7E;AAED;;4DAE4D;AAC5D,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAC1E,iEAAiE;AACjE,MAAM,MAAM,SAAS,GAAG,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC;AAoEvD;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAK/C"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { type IconProps, type ShapeKind } from '@weasel-js/core';
|
|
2
|
-
export interface ShapeKindIconProps extends IconProps {
|
|
3
|
-
/** A built-in shape kind. Any other string draws `UnknownIcon`, so a
|
|
4
|
-
* consumer-defined kind still gets a glyph. */
|
|
5
|
-
kind: ShapeKind | (string & {});
|
|
6
|
-
}
|
|
7
|
-
/** The glyph for a shape kind — the same one its insertion tool shows, so a
|
|
8
|
-
* row in a layer list or inspector matches the palette that made it. */
|
|
9
|
-
export declare function ShapeKindIcon({ kind, ...props }: ShapeKindIconProps): import("react").JSX.Element;
|
|
10
|
-
//# sourceMappingURL=ShapeKindIcon.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ShapeKindIcon.d.ts","sourceRoot":"","sources":["../../src/icons/ShapeKindIcon.tsx"],"names":[],"mappings":"AACA,OAAO,EAGL,KAAK,SAAS,EAAE,KAAK,SAAS,EAC/B,MAAM,iBAAiB,CAAC;AAezB,MAAM,WAAW,kBAAmB,SAAQ,SAAS;IACnD;oDACgD;IAChD,IAAI,EAAE,SAAS,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC;CACjC;AAED;yEACyE;AACzE,wBAAgB,aAAa,CAAC,EAAE,IAAI,EAAE,GAAG,KAAK,EAAE,EAAE,kBAAkB,+BAGnE"}
|