@weasel-js/ui 1.7.3 → 1.8.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 → ActionBar-CfXS7-9f.js} +2 -2
- package/dist/chunks/{ActionBar-xA73vzzF.js.map → ActionBar-CfXS7-9f.js.map} +1 -1
- package/dist/chunks/{Badge-jYQjrTKc.js → Badge-4ShpqA0h.js} +2 -2
- package/dist/chunks/{Badge-jYQjrTKc.js.map → Badge-4ShpqA0h.js.map} +1 -1
- package/dist/chunks/{Badge-CTc9Lkwn.js → Badge-qkV9EqKs.js} +6 -2
- package/dist/chunks/Badge-qkV9EqKs.js.map +1 -0
- package/dist/chunks/{Button-XB-T75YL.js → Button-CQA-K1g9.js} +17 -17
- package/dist/chunks/Button-CQA-K1g9.js.map +1 -0
- package/dist/chunks/Button-KF-qSGtA.js +11 -0
- package/dist/chunks/Button-KF-qSGtA.js.map +1 -0
- package/dist/chunks/{ButtonBar-CIMKPPRS.js → ButtonBar-B-cYuoem.js} +10 -4
- package/dist/chunks/ButtonBar-B-cYuoem.js.map +1 -0
- package/dist/chunks/{Callout-BUn0dP_S.js → Callout-VyYDIP7w.js} +26 -26
- package/dist/chunks/Callout-VyYDIP7w.js.map +1 -0
- package/dist/chunks/{Checkbox-DFn-x0JO.js → Checkbox-d4IfhiXh.js} +2 -2
- package/dist/chunks/{Checkbox-DFn-x0JO.js.map → Checkbox-d4IfhiXh.js.map} +1 -1
- package/dist/chunks/{CloseButton-BmNmRVtb.js → CloseButton-CKarkTT9.js} +3 -3
- package/dist/chunks/{CloseButton-BmNmRVtb.js.map → CloseButton-CKarkTT9.js.map} +1 -1
- package/dist/chunks/{Code-AsKpgnv6.js → Code-ChwKP1V0.js} +8 -2
- package/dist/chunks/Code-ChwKP1V0.js.map +1 -0
- package/dist/chunks/{ColorModeControl-DaVJ-SyX.js → ColorModeControl-CH9PmDlT.js} +6 -6
- package/dist/chunks/{ColorModeControl-DaVJ-SyX.js.map → ColorModeControl-CH9PmDlT.js.map} +1 -1
- package/dist/chunks/{ComboBox-DKln_mOd.js → ComboBox-BMj_IKBj.js} +4 -4
- package/dist/chunks/ComboBox-BMj_IKBj.js.map +1 -0
- package/dist/chunks/{DataGrid-CmHJe57v.js → DataGrid-CjiVKoaA.js} +3 -3
- package/dist/chunks/{DataGrid-CmHJe57v.js.map → DataGrid-CjiVKoaA.js.map} +1 -1
- package/dist/chunks/{DetentSlider-DNTAk8xP.js → DetentSlider-D40V8Oma.js} +2 -2
- package/dist/chunks/{DetentSlider-DNTAk8xP.js.map → DetentSlider-D40V8Oma.js.map} +1 -1
- package/dist/chunks/{Dialog-DKfsk5VN.js → Dialog-Du4POZ52.js} +12 -12
- package/dist/chunks/Dialog-Du4POZ52.js.map +1 -0
- package/dist/chunks/{Disclosure-Ch2KxYuB.js → Disclosure-CpWt87nO.js} +7 -7
- package/dist/chunks/{Disclosure-Ch2KxYuB.js.map → Disclosure-CpWt87nO.js.map} +1 -1
- package/dist/chunks/{DragGhost-BeYDJyLZ.js → DragGhost-_IpuN_xM.js} +2 -2
- package/dist/chunks/{DragGhost-BeYDJyLZ.js.map → DragGhost-_IpuN_xM.js.map} +1 -1
- package/dist/chunks/{FallthroughDiagram-CS1IhQaU.js → FallthroughDiagram-Cn6QLWKA.js} +9 -9
- package/dist/chunks/{FallthroughDiagram-CS1IhQaU.js.map → FallthroughDiagram-Cn6QLWKA.js.map} +1 -1
- package/dist/chunks/{FillStrokeSwatch-C4h3rUFM.js → FillStrokeSwatch-BkUhlpQL.js} +2 -2
- package/dist/chunks/{FillStrokeSwatch-C4h3rUFM.js.map → FillStrokeSwatch-BkUhlpQL.js.map} +1 -1
- package/dist/chunks/FitLabel-BzZGkWfL.js +76 -0
- package/dist/chunks/FitLabel-BzZGkWfL.js.map +1 -0
- package/dist/chunks/{FontFamilySelect-DEvMXyZd.js → FontFamilySelect-CXN7O2-p.js} +2 -2
- package/dist/chunks/{FontFamilySelect-DEvMXyZd.js.map → FontFamilySelect-CXN7O2-p.js.map} +1 -1
- package/dist/chunks/{FontWeightSelect-BLQ_LMJF.js → FontWeightSelect-BBuJGe_2.js} +2 -2
- package/dist/chunks/{FontWeightSelect-BLQ_LMJF.js.map → FontWeightSelect-BBuJGe_2.js.map} +1 -1
- package/dist/chunks/{GestureRoute-BXESrHI0.js → GestureRoute-BqHUrGeQ.js} +13 -13
- package/dist/chunks/{GestureRoute-BXESrHI0.js.map → GestureRoute-BqHUrGeQ.js.map} +1 -1
- package/dist/chunks/{GradientEditor-DD2OjQtn.js → GradientEditor-DX4sb1Hf.js} +4 -4
- package/dist/chunks/{GradientEditor-DD2OjQtn.js.map → GradientEditor-DX4sb1Hf.js.map} +1 -1
- package/dist/chunks/{Icon--B1ME-6c.js → Icon-BfqYtAX5.js} +33 -1
- package/dist/chunks/Icon-BfqYtAX5.js.map +1 -0
- package/dist/chunks/{ItemList-CRu9y7hL.js → ItemList-nbakLf3N.js} +32 -32
- package/dist/chunks/ItemList-nbakLf3N.js.map +1 -0
- package/dist/chunks/{Jog-BrkzdGV2.js → Jog-BU0xuM3G.js} +7 -7
- package/dist/chunks/{Jog-BrkzdGV2.js.map → Jog-BU0xuM3G.js.map} +1 -1
- package/dist/chunks/{Keycaps-C-FJyG8k.js → Keycaps-CM-gOj0e.js} +8 -2
- package/dist/chunks/Keycaps-CM-gOj0e.js.map +1 -0
- package/dist/chunks/LayerList-vfAoImxX.js +432 -0
- package/dist/chunks/LayerList-vfAoImxX.js.map +1 -0
- package/dist/chunks/{ListEditor-OQDzG4A5.js → ListEditor-BAKs47bN.js} +3 -3
- package/dist/chunks/{ListEditor-OQDzG4A5.js.map → ListEditor-BAKs47bN.js.map} +1 -1
- package/dist/chunks/{MenuButton-TAFg88Lp.js → MenuButton-CJGdhwGr.js} +5 -5
- package/dist/chunks/MenuButton-CJGdhwGr.js.map +1 -0
- package/dist/chunks/{MeshEditor-DWpvg8H6.js → MeshEditor-rhf7cXfG.js} +2 -2
- package/dist/chunks/{MeshEditor-DWpvg8H6.js.map → MeshEditor-rhf7cXfG.js.map} +1 -1
- package/dist/chunks/{NumberField-DS0WSiin.js → NumberField-BXFrOi5M.js} +8 -5
- package/dist/chunks/{NumberField-DS0WSiin.js.map → NumberField-BXFrOi5M.js.map} +1 -1
- package/dist/chunks/{OptionsBar-DeTAjVb7.js → OptionsBar-DyTXbev-.js} +9 -3
- package/dist/chunks/OptionsBar-DyTXbev-.js.map +1 -0
- package/dist/chunks/{PaintField-BdmQM53v.js → PaintField--GbF8sL7.js} +7 -7
- package/dist/chunks/PaintField--GbF8sL7.js.map +1 -0
- package/dist/chunks/{PaintInput-DaQMeBsI.js → PaintInput-DSS5IjXn.js} +5 -5
- package/dist/chunks/{PaintInput-DaQMeBsI.js.map → PaintInput-DSS5IjXn.js.map} +1 -1
- package/dist/chunks/{PatternPicker-B3HcMZWg.js → PatternPicker-82DCUvUk.js} +9 -9
- package/dist/chunks/PatternPicker-82DCUvUk.js.map +1 -0
- package/dist/chunks/{Powerline-6wIFmDik.js → Powerline-CogJv9VU.js} +2 -2
- package/dist/chunks/{Powerline-6wIFmDik.js.map → Powerline-CogJv9VU.js.map} +1 -1
- package/dist/chunks/{Prefs-BnVEyfWO.js → Prefs-BSSKOvPa.js} +41 -41
- package/dist/chunks/Prefs-BSSKOvPa.js.map +1 -0
- package/dist/chunks/{Properties-BoG2MMHR.js → Properties-DteSVEWs.js} +5 -5
- package/dist/chunks/{Properties-BoG2MMHR.js.map → Properties-DteSVEWs.js.map} +1 -1
- package/dist/chunks/PropertyField-CLbUOynA.js +751 -0
- package/dist/chunks/PropertyField-CLbUOynA.js.map +1 -0
- package/dist/chunks/{Select-ouV8O6cp.js → Select-BhHwjNsb.js} +13 -13
- package/dist/chunks/Select-BhHwjNsb.js.map +1 -0
- package/dist/chunks/{SelectionPanel-COZ6z9_P.js → SelectionPanel-B6HinSdB.js} +2 -2
- package/dist/chunks/{SelectionPanel-COZ6z9_P.js.map → SelectionPanel-B6HinSdB.js.map} +1 -1
- package/dist/chunks/{SidebarPanel-AXQ0jRDx.js → SidebarPanel-P3a8tIIj.js} +3 -3
- package/dist/chunks/{SidebarPanel-AXQ0jRDx.js.map → SidebarPanel-P3a8tIIj.js.map} +1 -1
- package/dist/chunks/Slider-CHBQ8uUC.js +439 -0
- package/dist/chunks/Slider-CHBQ8uUC.js.map +1 -0
- package/dist/chunks/{StatusBar-BEOfOX0D.js → StatusBar-DEh7J2Gj.js} +14 -9
- package/dist/chunks/StatusBar-DEh7J2Gj.js.map +1 -0
- package/dist/chunks/{SwatchGrid-9ZPiDmxd.js → SwatchGrid-DxK9e_IV.js} +3 -3
- package/dist/chunks/SwatchGrid-DxK9e_IV.js.map +1 -0
- package/dist/chunks/{SwatchStrip-Bi9iPLoh.js → SwatchStrip-D7YNn_p0.js} +3 -3
- package/dist/chunks/{SwatchStrip-Bi9iPLoh.js.map → SwatchStrip-D7YNn_p0.js.map} +1 -1
- package/dist/chunks/{ThemeSwitcher-DiBmMh_B.js → ThemeSwitcher-BJWP1l87.js} +6 -6
- package/dist/chunks/{ThemeSwitcher-DiBmMh_B.js.map → ThemeSwitcher-BJWP1l87.js.map} +1 -1
- package/dist/chunks/{Timeline-sMCH2fah.js → Timeline-CisRg82u.js} +4 -4
- package/dist/chunks/{Timeline-sMCH2fah.js.map → Timeline-CisRg82u.js.map} +1 -1
- package/dist/chunks/{Toast-C3ozq11V.js → Toast-DhkU9Z0b.js} +3 -3
- package/dist/chunks/{Toast-C3ozq11V.js.map → Toast-DhkU9Z0b.js.map} +1 -1
- package/dist/chunks/ToggleBar-CRc2k89_.js +10 -0
- package/dist/chunks/ToggleBar-CRc2k89_.js.map +1 -0
- package/dist/chunks/ToggleBar-CfYbMK3x.js +84 -0
- package/dist/chunks/ToggleBar-CfYbMK3x.js.map +1 -0
- package/dist/chunks/{TokenPanel-WtKGY2Db.js → TokenPanel-cL37E39j.js} +26 -26
- package/dist/chunks/{TokenPanel-WtKGY2Db.js.map → TokenPanel-cL37E39j.js.map} +1 -1
- package/dist/chunks/{ToolButton-BURp4YIO.js → ToolButton-Bo7WH1wt.js} +2 -2
- package/dist/chunks/{ToolButton-BURp4YIO.js.map → ToolButton-Bo7WH1wt.js.map} +1 -1
- package/dist/chunks/ToolOptionsBar-DmhzrOmd.js +94 -0
- package/dist/chunks/ToolOptionsBar-DmhzrOmd.js.map +1 -0
- package/dist/chunks/{ToolPalette-DKDFWOX-.js → ToolPalette-BTD84k9C.js} +2 -2
- package/dist/chunks/{ToolPalette-DKDFWOX-.js.map → ToolPalette-BTD84k9C.js.map} +1 -1
- package/dist/chunks/{Tooltip-C6eFCYxw.js → Tooltip-DljsPEQG.js} +4 -4
- package/dist/chunks/Tooltip-DljsPEQG.js.map +1 -0
- package/dist/chunks/Tree-B_PW6K-W.js +215 -0
- package/dist/chunks/Tree-B_PW6K-W.js.map +1 -0
- package/dist/chunks/checkbox.module-Dcx8ILgR.js +5 -0
- package/dist/chunks/checkbox.module-Dcx8ILgR.js.map +1 -0
- package/dist/chunks/{icons-Dr2-r30x.js → icons-B_fPKEis.js} +52 -43
- package/dist/chunks/icons-B_fPKEis.js.map +1 -0
- package/dist/chunks/{model-B6zuQg6b.js → model-Ca0f95r0.js} +134 -133
- package/dist/chunks/model-Ca0f95r0.js.map +1 -0
- package/dist/chunks/{portalHost-CE70wLzo.js → portalHost-RUQPxIoW.js} +3 -2
- package/dist/chunks/{portalHost-CE70wLzo.js.map → portalHost-RUQPxIoW.js.map} +1 -1
- package/dist/chunks/{prefField-BE_Ytr2H.js → prefField-DPPbAmRR.js} +81 -75
- package/dist/chunks/prefField-DPPbAmRR.js.map +1 -0
- package/dist/chunks/{segmentTooltip-CGxCOWNz.js → segmentTooltip-8VBPNgEc.js} +2 -2
- package/dist/chunks/{segmentTooltip-CGxCOWNz.js.map → segmentTooltip-8VBPNgEc.js.map} +1 -1
- package/dist/chunks/segmentedControl.module-62qjNWJk.js +11 -0
- package/dist/chunks/{segmentedControl.module-BzGXUL5G.js.map → segmentedControl.module-62qjNWJk.js.map} +1 -1
- package/dist/chunks/{useReorderDragList-CStYKjHl.js → useReorderDragList-DnqqvRGK.js} +38 -30
- package/dist/chunks/useReorderDragList-DnqqvRGK.js.map +1 -0
- package/dist/components/ActionBar/index.js +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 -3
- package/dist/components/Badge/variantIcons.d.ts +5 -0
- package/dist/components/Badge/variantIcons.d.ts.map +1 -0
- package/dist/components/Button/index.d.ts +1 -0
- package/dist/components/Button/index.d.ts.map +1 -1
- package/dist/components/Button/index.js +3 -2
- package/dist/components/Button/variantIcons.d.ts +5 -0
- package/dist/components/Button/variantIcons.d.ts.map +1 -0
- package/dist/components/ButtonBar/index.d.ts +1 -0
- package/dist/components/ButtonBar/index.d.ts.map +1 -1
- package/dist/components/ButtonBar/index.js +2 -2
- package/dist/components/ButtonBar/variantIcons.d.ts +5 -0
- package/dist/components/ButtonBar/variantIcons.d.ts.map +1 -0
- package/dist/components/Callout/Callout.d.ts.map +1 -1
- package/dist/components/Callout/index.js +1 -1
- package/dist/components/Checkbox/index.js +1 -1
- package/dist/components/CloseButton/index.js +1 -1
- package/dist/components/Code/index.d.ts +1 -0
- package/dist/components/Code/index.d.ts.map +1 -1
- package/dist/components/Code/index.js +2 -2
- package/dist/components/Code/variantIcons.d.ts +5 -0
- package/dist/components/Code/variantIcons.d.ts.map +1 -0
- package/dist/components/ColorModeControl/index.js +1 -1
- package/dist/components/ComboBox/ComboBox.d.ts.map +1 -1
- package/dist/components/ComboBox/index.js +1 -1
- package/dist/components/DataGrid/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/index.js +1 -1
- package/dist/components/DragGhost/index.js +1 -1
- package/dist/components/FallthroughDiagram/index.js +1 -1
- package/dist/components/FillStrokeSwatch/index.js +1 -1
- package/dist/components/FitLabel/FitLabel.d.ts +41 -0
- package/dist/components/FitLabel/FitLabel.d.ts.map +1 -0
- package/dist/components/FitLabel/index.d.ts +3 -0
- package/dist/components/FitLabel/index.d.ts.map +1 -0
- package/dist/components/FitLabel/index.js +2 -0
- package/dist/components/FontFamilySelect/index.js +1 -1
- package/dist/components/FontWeightSelect/index.js +1 -1
- package/dist/components/GestureRoute/index.js +1 -1
- package/dist/components/GradientEditor/index.js +1 -1
- package/dist/components/InlineRange/InlineRange.d.ts +1 -1
- package/dist/components/ItemList/index.js +1 -1
- package/dist/components/Jog/index.js +1 -1
- package/dist/components/Keycaps/index.d.ts +1 -0
- package/dist/components/Keycaps/index.d.ts.map +1 -1
- package/dist/components/Keycaps/index.js +2 -2
- package/dist/components/Keycaps/variantIcons.d.ts +5 -0
- package/dist/components/Keycaps/variantIcons.d.ts.map +1 -0
- package/dist/components/LayerList/LayerList.d.ts.map +1 -1
- package/dist/components/LayerList/index.js +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/index.js +1 -1
- package/dist/components/NumberField/UnitField.d.ts.map +1 -1
- package/dist/components/NumberField/index.js +1 -1
- package/dist/components/OptionsBar/index.d.ts +1 -0
- package/dist/components/OptionsBar/index.d.ts.map +1 -1
- package/dist/components/OptionsBar/index.js +2 -2
- package/dist/components/OptionsBar/variantIcons.d.ts +5 -0
- package/dist/components/OptionsBar/variantIcons.d.ts.map +1 -0
- package/dist/components/PaintField/PaintField.d.ts.map +1 -1
- package/dist/components/PaintField/index.js +1 -1
- package/dist/components/PaintInput/index.js +1 -1
- package/dist/components/PatternPicker/index.js +1 -1
- package/dist/components/Powerline/index.js +2 -2
- package/dist/components/Prefs/index.js +2 -2
- package/dist/components/Prefs/prefField.d.ts.map +1 -1
- package/dist/components/Properties/NumberControls.d.ts +16 -0
- package/dist/components/Properties/NumberControls.d.ts.map +1 -0
- package/dist/components/Properties/PropertyField.d.ts +18 -8
- package/dist/components/Properties/PropertyField.d.ts.map +1 -1
- package/dist/components/Properties/index.js +2 -2
- package/dist/components/Select/Select.d.ts.map +1 -1
- package/dist/components/Select/index.js +1 -1
- package/dist/components/SelectionPanel/index.js +2 -2
- package/dist/components/SelectionPanel/renderLeaf.d.ts.map +1 -1
- package/dist/components/SidebarPanel/index.js +1 -1
- package/dist/components/Slider/Slider.d.ts +6 -0
- package/dist/components/Slider/Slider.d.ts.map +1 -1
- package/dist/components/Slider/index.js +1 -1
- package/dist/components/StatusBar/StatusBar.d.ts +2 -0
- package/dist/components/StatusBar/StatusBar.d.ts.map +1 -1
- package/dist/components/StatusBar/index.js +1 -1
- package/dist/components/SwatchGrid/index.js +1 -1
- package/dist/components/SwatchStrip/index.js +1 -1
- package/dist/components/ThemeSwitcher/index.js +1 -1
- package/dist/components/Timeline/index.js +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.d.ts +1 -0
- package/dist/components/ToggleBar/index.d.ts.map +1 -1
- package/dist/components/ToggleBar/index.js +3 -2
- package/dist/components/ToggleBar/variantIcons.d.ts +5 -0
- package/dist/components/ToggleBar/variantIcons.d.ts.map +1 -0
- package/dist/components/TokenPanel/index.js +1 -1
- package/dist/components/ToolButton/index.js +1 -1
- package/dist/components/ToolOptionsBar/ToolOptionsBar.d.ts +1 -1
- package/dist/components/ToolOptionsBar/ToolOptionsBar.d.ts.map +1 -1
- package/dist/components/ToolOptionsBar/index.js +1 -1
- package/dist/components/ToolPalette/index.js +1 -1
- package/dist/components/Tooltip/Tooltip.d.ts.map +1 -1
- package/dist/components/Tooltip/index.js +1 -1
- package/dist/components/Tree/Tree.d.ts +1 -1
- package/dist/components/Tree/Tree.d.ts.map +1 -1
- package/dist/components/Tree/index.js +1 -1
- package/dist/components/stanceCss.d.ts +6 -0
- package/dist/components/stanceCss.d.ts.map +1 -1
- package/dist/components/stanceSurfaces.d.ts.map +1 -1
- package/dist/endless.d.ts +7 -0
- package/dist/endless.d.ts.map +1 -0
- package/dist/icons/index.d.ts +6 -0
- package/dist/icons/index.d.ts.map +1 -1
- package/dist/icons/paths.d.ts +14 -0
- package/dist/icons/paths.d.ts.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +101 -97
- package/dist/index.js.map +1 -1
- package/dist/overlays/portalHost.d.ts +10 -4
- package/dist/overlays/portalHost.d.ts.map +1 -1
- package/dist/style.css +1 -1
- package/dist/useReorderDragList.d.ts +3 -0
- package/dist/useReorderDragList.d.ts.map +1 -1
- package/package.json +10 -9
- package/dist/chunks/Badge-CTc9Lkwn.js.map +0 -1
- package/dist/chunks/Button-XB-T75YL.js.map +0 -1
- package/dist/chunks/ButtonBar-CIMKPPRS.js.map +0 -1
- package/dist/chunks/Callout-BUn0dP_S.js.map +0 -1
- package/dist/chunks/Code-AsKpgnv6.js.map +0 -1
- package/dist/chunks/ComboBox-DKln_mOd.js.map +0 -1
- package/dist/chunks/Dialog-DKfsk5VN.js.map +0 -1
- package/dist/chunks/Icon--B1ME-6c.js.map +0 -1
- package/dist/chunks/ItemList-CRu9y7hL.js.map +0 -1
- package/dist/chunks/Keycaps-C-FJyG8k.js.map +0 -1
- package/dist/chunks/LayerList-BqeWFuGc.js +0 -421
- package/dist/chunks/LayerList-BqeWFuGc.js.map +0 -1
- package/dist/chunks/MenuButton-TAFg88Lp.js.map +0 -1
- package/dist/chunks/OptionsBar-DeTAjVb7.js.map +0 -1
- package/dist/chunks/PaintField-BdmQM53v.js.map +0 -1
- package/dist/chunks/PatternPicker-B3HcMZWg.js.map +0 -1
- package/dist/chunks/Prefs-BnVEyfWO.js.map +0 -1
- package/dist/chunks/PropertyField-PMrqBA0n.js +0 -743
- package/dist/chunks/PropertyField-PMrqBA0n.js.map +0 -1
- package/dist/chunks/Select-ouV8O6cp.js.map +0 -1
- package/dist/chunks/Slider-DSrlMEq8.js +0 -389
- package/dist/chunks/Slider-DSrlMEq8.js.map +0 -1
- package/dist/chunks/StatusBar-BEOfOX0D.js.map +0 -1
- package/dist/chunks/SwatchGrid-9ZPiDmxd.js.map +0 -1
- package/dist/chunks/ToggleBar-Z2jZiguF.js +0 -80
- package/dist/chunks/ToggleBar-Z2jZiguF.js.map +0 -1
- package/dist/chunks/ToolOptionsBar-BJKwnemU.js +0 -88
- package/dist/chunks/ToolOptionsBar-BJKwnemU.js.map +0 -1
- package/dist/chunks/Tooltip-C6eFCYxw.js.map +0 -1
- package/dist/chunks/Tree-Cc8lIzgM.js +0 -203
- package/dist/chunks/Tree-Cc8lIzgM.js.map +0 -1
- package/dist/chunks/checkbox.module-DLQV9tMX.js +0 -5
- package/dist/chunks/checkbox.module-DLQV9tMX.js.map +0 -1
- package/dist/chunks/icons-Dr2-r30x.js.map +0 -1
- package/dist/chunks/interactiveTarget-BNZmTow2.js +0 -24
- package/dist/chunks/interactiveTarget-BNZmTow2.js.map +0 -1
- package/dist/chunks/model-B6zuQg6b.js.map +0 -1
- package/dist/chunks/prefField-BE_Ytr2H.js.map +0 -1
- package/dist/chunks/segmentedControl.module-BzGXUL5G.js +0 -11
- package/dist/chunks/useReorderDragList-CStYKjHl.js.map +0 -1
- package/dist/interactiveTarget.d.ts +0 -9
- package/dist/interactiveTarget.d.ts.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ToggleBar-Z2jZiguF.js","names":["s","segmentTooltipContent","useRovingTabIndex","ToggleBar_module_default","ToggleBar","props","mode","isSelected","value","isMixed","mixed","handleClick","item","items","index","current","next","v","selectedIndex","it","roving","style","height","rootCls","size","variant","className","ariaLabel","selected","cls","SegmentTooltip","i"],"sources":["../../src/components/ToggleBar/ToggleBar.module.css","../../src/components/ToggleBar/ToggleBar.tsx"],"sourcesContent":["/* Aqua-glass segmented control. The track is a pill-shaped well; the\n selected segment becomes a tinted glass cylinder that reads as the same\n \"lozenge\" family as the standalone Button. Visual params come from the\n `--btn-*` custom properties (see Button.module.css) so the Button Lab\n can tune both surfaces with one set of sliders. */\n.root {\n display: inline-flex;\n height: var(--tb-h, var(--wzl-control-h));\n padding: var(--wzl-space-1);\n background: linear-gradient(\n 180deg,\n rgba(0, 0, 0, 0.18) 0%,\n rgba(0, 0, 0, 0.05) 100%\n );\n border-radius: var(--wzl-radius-pill);\n /* Clip segments to the track outline so interior corners read crisp and\n the selected segment's glass treatment doesn't paint over the rounded\n outer pixels. */\n overflow: hidden;\n box-shadow:\n inset 0 1px 2px rgba(0, 0, 0, 0.4),\n 0 1px 0 rgba(255, 255, 255, 0.06);\n user-select: none;\n -webkit-user-select: none;\n touch-action: none;\n /* The track clips, so without this a squeezing row shrinks it to nothing. */\n min-width: max-content;\n}\n\n.segment {\n position: relative;\n flex: 1 1 0;\n /* Equal widths when there is room, never narrower than the label. The\n segment clips its gloss, which otherwise drops its flex minimum to 0. */\n min-width: max-content;\n padding: 0 var(--wzl-space-6);\n display: inline-flex;\n align-items: center;\n justify-content: center;\n background: transparent;\n border: none;\n margin: 0;\n font-family: var(--wzl-font-ui);\n font-weight: var(--wzl-font-weight-normal);\n font-size: var(--btn-fontsize, var(--wzl-font-size));\n line-height: 1;\n color: var(--wzl-fg-muted);\n cursor: pointer;\n /* Only round the outer corners of the bar — middle segments stay square\n so the seams between them don't render as facing parentheses. */\n border-radius: 0;\n isolation: isolate;\n overflow: hidden;\n transition: color var(--wzl-motion-fast);\n}\n\n/* 8px around a 14px glyph is most of a segment. */\n.segment:has(> svg) {\n padding: 0 5px;\n}\n\n.segment:first-of-type {\n border-radius: var(--wzl-radius-pill) 0 0 var(--wzl-radius-pill);\n}\n\n.segment:last-of-type {\n border-radius: 0 var(--wzl-radius-pill) var(--wzl-radius-pill) 0;\n}\n\n.segment:only-of-type {\n border-radius: var(--wzl-radius-pill);\n}\n\n.segment:focus-visible {\n outline: 2px solid var(--wzl-accent);\n outline-offset: -2px;\n}\n\n.segment:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n}\n\n.segment:hover:not(:disabled):not(.segmentSelected) {\n color: var(--wzl-fg);\n}\n\n/* Selected segment — full Aqua glass cylinder. Mirrors Button.variant_primary. */\n.segmentSelected {\n background: linear-gradient(\n 180deg,\n color-mix(in srgb, var(--wzl-accent) var(--btn-top-alpha, 45%), transparent) 0%,\n color-mix(in srgb, var(--wzl-accent) var(--btn-upper-alpha, 70%), transparent) calc(var(--btn-equator, 52%) - var(--btn-equator-spread, 12%)),\n color-mix(in srgb, var(--wzl-accent) var(--btn-equator-tint, 95%), white) var(--btn-equator, 52%),\n var(--wzl-accent) calc(var(--btn-equator, 52%) + var(--btn-equator-spread, 12%) * 1.6),\n color-mix(in srgb, var(--wzl-accent) var(--btn-base-tint, 70%), black) 100%\n );\n backdrop-filter: blur(var(--btn-blur, 6px)) saturate(var(--btn-saturate, 1.3));\n -webkit-backdrop-filter: blur(var(--btn-blur, 6px)) saturate(var(--btn-saturate, 1.3));\n color: var(--wzl-fg-on-accent);\n text-shadow:\n 0 1px 0 rgba(0, 0, 0, var(--btn-text-shadow, 0.35)),\n var(--btn-text-inset-x, 0px) var(--btn-text-inset-y, 1px) 0 rgba(0, 0, 0, var(--btn-text-inset, 0.55)),\n 0 0 6px rgba(0, 0, 0, calc(var(--btn-text-shadow, 0.35) * 0.5));\n box-shadow:\n inset 0 1px 0 rgba(255, 255, 255, var(--btn-inset-hi, 0.42)),\n inset 0 -1px 2px rgba(0, 0, 0, var(--btn-inset-lo, 0.3)),\n 0 0 0 1px rgba(0, 0, 0, var(--btn-rim, 0.22)),\n 0 1px 2px rgba(0, 0, 0, var(--btn-drop-near, 0.3)),\n 0 2px 4px rgba(0, 0, 0, calc(var(--btn-drop-far, 0.18) * 0.8));\n}\n\n/* Specular gloss on the selected segment. Top corners inherit the\n segment's radius so they hug the upper edge cleanly; bottom corners\n are flattened so the gloss ends in a straight line at the equator\n instead of two little curves that read as `)(` brackets. */\n.segmentSelected::before {\n content: '';\n position: absolute;\n inset: 1px 1px var(--btn-gloss-bottom, 50%) 1px;\n border-radius: inherit;\n border-bottom-left-radius: 0;\n border-bottom-right-radius: 0;\n background: linear-gradient(\n 180deg,\n rgba(255, 255, 255, var(--btn-gloss-top, 0.42)) 0%,\n rgba(255, 255, 255, var(--btn-gloss-mid, 0.12)) 60%,\n rgba(255, 255, 255, 0) 100%\n );\n pointer-events: none;\n z-index: 1;\n}\n\n.segmentSelected > * {\n position: relative;\n z-index: 2;\n}\n\n/* Mixed segment (`aria-pressed=\"mixed\"`) — the sources disagree. Reads as a\n deliberate third state rather than a dimmed \"on\": a flat accent wash with\n none of the selected segment's gloss/cylinder treatment, so it can't be\n mistaken for the glass lozenge at a glance. */\n.segmentMixed {\n background: color-mix(in srgb, var(--wzl-accent) 22%, transparent);\n color: var(--wzl-fg);\n box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--wzl-accent) 45%, transparent);\n}\n\n.segmentMixed:hover:not(:disabled) {\n background: color-mix(in srgb, var(--wzl-accent) 32%, transparent);\n}\n\n.variant_minimal .segmentMixed {\n background: color-mix(in srgb, var(--wzl-accent) 18%, transparent);\n box-shadow: none;\n color: var(--wzl-fg);\n}\n\n/* Small variant — ~60% of the default height, with proportionally reduced\n padding and font. Sized for dense surfaces (lab control panels, inline\n filters, etc.). */\n.size_sm {\n height: 17px;\n padding: 1px;\n}\n\n.size_sm .segment {\n padding: 0 var(--wzl-space-4);\n font-size: var(--wzl-font-size-sm);\n}\n\n/* `.size_sm .segment` outranks the glyph rule above on specificity, so a\n small bar's glyph segments need the tight padding restated to stay\n near-square rather than reading as wide plates. */\n.size_sm .segment:has(> svg) {\n padding: 0 3px;\n}\n\n/* Minimal variant — strips the pill track, glass selected state, inset\n shadows, and outer padding. Used in dense diagnostic surfaces (dispatch\n trace, lab inspectors) where the bar must read as plain text controls. */\n.variant_minimal {\n height: auto;\n padding: 0;\n background: none;\n border: 1px solid var(--wzl-border);\n border-radius: var(--wzl-radius-sm);\n box-shadow: none;\n gap: 0;\n}\n\n.variant_minimal .segment {\n padding: 0 var(--wzl-space-3);\n font-size: var(--wzl-font-size-sm);\n font-weight: var(--wzl-font-weight-medium);\n line-height: 1.4;\n border-radius: 0;\n color: var(--wzl-fg-muted);\n transition: none;\n}\n\n/* Dividers between segments make the mutual-exclusion grouping visible\n without a heavy track. Only the inner edges get a rule — the outer\n border on `.variant_minimal` handles the perimeter. */\n.variant_minimal .segment ~ .segment {\n border-left: 1px solid var(--wzl-border);\n}\n\n.variant_minimal .segment:first-of-type,\n.variant_minimal .segment:last-of-type,\n.variant_minimal .segment:only-of-type {\n border-radius: 0;\n}\n\n.variant_minimal .segment:hover:not(:disabled):not(.segmentSelected) {\n color: var(--wzl-fg);\n background: var(--wzl-surface-hover);\n}\n\n.variant_minimal .segmentSelected {\n background: none;\n backdrop-filter: none;\n -webkit-backdrop-filter: none;\n color: var(--wzl-accent-fg);\n text-shadow: none;\n box-shadow: none;\n font-weight: var(--wzl-font-weight-medium);\n}\n\n.variant_minimal .segmentSelected::before {\n content: none;\n}\n\n/* Flat variant — no track, no glass, no pill: each segment is its own\n outlined cell. For property panels, where a bar sits in a row beside\n inputs and the glass cylinder makes it the loudest thing on the surface. */\n.variant_flat {\n padding: 0;\n background: none;\n border-radius: var(--wzl-radius-sm);\n box-shadow: none;\n overflow: visible;\n}\n\n.variant_flat .segment {\n border: 1px solid var(--wzl-border-strong);\n border-radius: 0;\n /* Sunken, so an unselected cell sits below the panel and the selected one\n reads as raised without needing the glass treatment back. */\n background: var(--wzl-surface-sunken);\n color: var(--wzl-fg-muted);\n}\n\n/* Adjacent cells share one rule rather than stacking two. */\n.variant_flat .segment ~ .segment {\n margin-inline-start: -1px;\n}\n\n.variant_flat .segment:first-of-type {\n border-start-start-radius: var(--wzl-radius-sm);\n border-end-start-radius: var(--wzl-radius-sm);\n}\n\n.variant_flat .segment:last-of-type {\n border-start-end-radius: var(--wzl-radius-sm);\n border-end-end-radius: var(--wzl-radius-sm);\n}\n\n.variant_flat .segment:hover:not(:disabled):not(.segmentSelected) {\n background: var(--wzl-surface-hover);\n color: var(--wzl-fg);\n}\n\n.variant_flat .segmentSelected {\n /* Above its neighbors, or the next cell's left border covers its right one. */\n z-index: 1;\n background: var(--wzl-accent);\n color: var(--wzl-fg-on-accent);\n backdrop-filter: none;\n -webkit-backdrop-filter: none;\n text-shadow: none;\n box-shadow: none;\n}\n\n.variant_flat .segmentSelected::before {\n content: none;\n}\n","import { type CSSProperties, type ReactElement, type ReactNode } from 'react';\nimport s from './ToggleBar.module.css';\nimport { useRovingTabIndex } from '../../useRovingTabIndex';\nimport { SegmentTooltip, segmentTooltipContent, type SegmentTooltipFields } from '../segmentTooltip';\n\n/** One segment of a {@link ToggleBar}, identified by its `value`. */\nexport type ToggleBarItem<V extends string | number = string> = {\n value: V;\n label?: ReactNode;\n ariaLabel?: string;\n disabled?: boolean;\n} & SegmentTooltipFields;\n\n/** Segment height and type scale for a {@link ToggleBar}. */\nexport type ToggleBarSize = 'sm' | 'md';\n/** Visual treatment of a {@link ToggleBar}. */\nexport type ToggleBarVariant = 'default' | 'minimal' | 'flat';\n\ntype CommonProps = {\n ariaLabel?: string;\n className?: string;\n height?: number;\n /** Size variant. `sm` is ~60% of the default height with reduced padding\n * and font size — sized for dense surfaces like lab control panels. */\n size?: ToggleBarSize;\n /** Visual variant. `minimal` strips the pill track and glass treatment;\n * selection becomes a flat accent. For dense diagnostic surfaces. */\n variant?: ToggleBarVariant;\n};\n\n/**\n * Props for {@link ToggleBar}, discriminated on `mode`. Single mode is\n * controlled by one value or `null`; multiple mode by an array, and only it\n * accepts `mixedValues`.\n */\nexport type ToggleBarProps<V extends string | number = string> =\n | (CommonProps & {\n mode?: 'single';\n items: readonly ToggleBarItem<V>[];\n value: V | null;\n onChange: (next: V | null) => void;\n allowDeselect?: boolean;\n })\n | (CommonProps & {\n mode: 'multiple';\n items: readonly ToggleBarItem<V>[];\n value: readonly V[];\n /**\n * Values that are neither on nor off — the sources this bar\n * aggregates disagree (a text range that is bold in part of it, a\n * multi-selection whose nodes differ). Rendered `aria-pressed=\"mixed\"`,\n * the ARIA tri-state a toggle button actually has, rather than\n * `SelectionPanel`'s reduced-opacity-plus-`title` workaround for\n * `Switch`, which has no indeterminate state to render.\n *\n * `value` wins where the two lists overlap, so a caller that can't\n * cheaply keep them disjoint doesn't get an ambiguous segment.\n *\n * Clicking a mixed segment turns it fully **on**, matching the\n * everywhere-else convention (and `toggleFlagInRange`'s rule for a\n * partially-styled text range) that a mixed toggle resolves toward\n * the affirmative rather than clearing.\n */\n mixedValues?: readonly V[];\n onChange: (next: V[]) => void;\n });\n\n/**\n * Segmented control for choosing among a fixed set of values — one of them\n * (`mode: 'single'`, the default) or any number (`mode: 'multiple'`).\n *\n * Single mode ignores a click on the already-selected segment unless\n * `allowDeselect` is set. Arrow keys move focus without changing the value;\n * Space and Enter commit.\n */\nexport function ToggleBar<V extends string | number = string>(props: ToggleBarProps<V>): ReactElement {\n const { items, ariaLabel, className, height, size, variant } = props;\n const mode = props.mode ?? 'single';\n\n const isSelected = (value: V): boolean => {\n if (mode === 'multiple') return (props.value as readonly V[]).includes(value);\n return (props.value as V | null) === value;\n };\n\n /** Mixed only in multiple mode, and only where `value` doesn't already\n * claim the segment. Single mode has nothing to be mixed about — its\n * aggregate is one value or none. */\n const isMixed = (value: V): boolean => {\n if (mode !== 'multiple') return false;\n const mixed = (props as { mixedValues?: readonly V[] }).mixedValues;\n return mixed !== undefined && mixed.includes(value) && !isSelected(value);\n };\n\n const handleClick = (index: number) => () => {\n const item = items[index];\n if (item.disabled) return;\n if (mode === 'multiple') {\n const current = props.value as readonly V[];\n const next = current.includes(item.value)\n ? current.filter(v => v !== item.value)\n : [...current, item.value];\n (props.onChange as (n: V[]) => void)(next);\n } else {\n const current = props.value as V | null;\n if (current === item.value) {\n if ((props as { allowDeselect?: boolean }).allowDeselect) {\n (props.onChange as (n: V | null) => void)(null);\n }\n return;\n }\n (props.onChange as (n: V | null) => void)(item.value);\n }\n };\n\n const selectedIndex = mode === 'single'\n ? items.findIndex(it => it.value === (props.value as V | null))\n : -1;\n\n const roving = useRovingTabIndex({\n itemSelector: `.${s.segment}`,\n // Single mode is a radiogroup: the tab stop is the current value, and\n // arrow keys move the selection with the focus. Multiple mode is a set of\n // independent toggles — focus alone moves, and Space/Enter flips.\n tabStopIndex: selectedIndex >= 0 ? selectedIndex : undefined,\n onNavigate: mode === 'single'\n ? (index) => (props.onChange as (n: V | null) => void)(items[index].value)\n : undefined,\n onActivate: mode === 'multiple' ? (index) => handleClick(index)() : undefined,\n });\n\n const style: CSSProperties | undefined = height !== undefined\n ? ({ ['--tb-h' as string]: `${height}px` } as CSSProperties)\n : undefined;\n\n const rootCls = [\n s.root,\n size && s[`size_${size}`],\n variant && s[`variant_${variant}`],\n className,\n ].filter(Boolean).join(' ');\n\n return (\n <div\n ref={roving.rootRef}\n onKeyDown={roving.onKeyDown}\n className={rootCls}\n role={mode === 'multiple' ? 'group' : 'radiogroup'}\n aria-label={ariaLabel}\n style={style}\n >\n {items.map((item, i) => {\n const selected = isSelected(item.value);\n const mixed = isMixed(item.value);\n const cls = [s.segment, selected && s.segmentSelected, mixed && s.segmentMixed]\n .filter(Boolean)\n .join(' ');\n return (\n <SegmentTooltip key={item.value} content={segmentTooltipContent(item)} disabled={item.disabled}>\n <button\n type=\"button\"\n role={mode === 'multiple' ? undefined : 'radio'}\n aria-checked={mode === 'multiple' ? undefined : selected}\n aria-pressed={mode === 'multiple' ? (mixed ? 'mixed' : selected) : undefined}\n aria-label={item.ariaLabel}\n disabled={item.disabled}\n className={cls}\n onClick={handleClick(i)}\n >\n {item.label}\n </button>\n </SegmentTooltip>\n );\n })}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;AC2EA,SAAgBI,EAA8C,GAAwC;CACpG,IAAM,EAAE,UAAO,cAAW,cAAW,WAAQ,SAAM,eAA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AAO,OAAO,CAAC,CAAC,KAAK,GAAG;CAE1B,OACE,kBAAC,OAAD;EACE,KAAKN,EAAO;EACZ,WAAWA,EAAO;EAClB,WAAWG;EACX,MAAMjB,MAAS,aAAa,UAAU;EACtC,cAAYqB;EACL;EAEN,UAAAd,EAAM,KAAK,GAAM,MAAM;GACtB,IAAMe,IAAWrB,EAAWK,EAAK,KAAK,GAChCF,IAAQD,EAAQG,EAAK,KAAK,GAC1BiB,IAAM;IAAC7B,EAAE;IAAS4B,KAAY5B,EAAE;IAAiBU,KAASV,EAAE;GAAY,CAAC,CAC5E,OAAO,OAAO,CAAC,CACf,KAAK,GAAG;GACX,OACE,kBAAC8B,GAAD;IAAiC,SAAS7B,EAAsBW,CAAI;IAAG,UAAUA,EAAK;IACpF,UAAA,kBAAC,UAAD;KACE,MAAK;KACL,MAAMN,MAAS,aAAa,KAAA,IAAY;KACxC,gBAAcA,MAAS,aAAa,KAAA,IAAYsB;KAChD,gBAActB,MAAS,aAAcI,IAAQ,UAAUkB,IAAY,KAAA;KACnE,cAAYhB,EAAK;KACjB,UAAUA,EAAK;KACf,WAAWiB;KACX,SAASlB,EAAYoB,CAAC;KAErB,UAAAnB,EAAK;IACA,CAAA;GACM,GAbKA,EAAK,KAaV;EAEpB,CAAC;CACE,CAAA;AAET"}
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
import { a as e, c as t, d as n, u as r } from "./model-B6zuQg6b.js";
|
|
2
|
-
import { Fragment as i, jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
3
|
-
var s = {
|
|
4
|
-
root: "_root_1h7p0_13",
|
|
5
|
-
label: "_label_1h7p0_25",
|
|
6
|
-
controls: "_controls_1h7p0_6",
|
|
7
|
-
cell: "_cell_1h7p0_68",
|
|
8
|
-
cellLabel: "_cellLabel_1h7p0_74"
|
|
9
|
-
};
|
|
10
|
-
//#endregion
|
|
11
|
-
//#region src/components/ToolOptionsBar/ToolOptionsBar.tsx
|
|
12
|
-
function c(e) {
|
|
13
|
-
let { label: t, schema: n, values: r, onChange: i, mixed: c, renderers: d, children: f, className: p } = e, m = [s.root, p].filter(Boolean).join(" ");
|
|
14
|
-
return /* @__PURE__ */ o("div", {
|
|
15
|
-
className: m,
|
|
16
|
-
role: "toolbar",
|
|
17
|
-
"aria-label": t,
|
|
18
|
-
children: [t !== void 0 && /* @__PURE__ */ a("span", {
|
|
19
|
-
className: s.label,
|
|
20
|
-
children: t
|
|
21
|
-
}), /* @__PURE__ */ o("div", {
|
|
22
|
-
className: s.controls,
|
|
23
|
-
children: [n !== void 0 && l(n).map((e) => /* @__PURE__ */ a(u, {
|
|
24
|
-
row: e,
|
|
25
|
-
values: r,
|
|
26
|
-
mixed: c,
|
|
27
|
-
renderers: d,
|
|
28
|
-
onChange: i
|
|
29
|
-
}, e.leaves[0].path)), f]
|
|
30
|
-
})]
|
|
31
|
-
});
|
|
32
|
-
}
|
|
33
|
-
function l(n) {
|
|
34
|
-
let r = [], i = (t, n) => {
|
|
35
|
-
for (let [a, o] of Object.entries(t.children)) {
|
|
36
|
-
let t = n === "" ? a : `${n}.${a}`;
|
|
37
|
-
e(o) ? i(o, t) : o.hidden !== !0 && r.push({
|
|
38
|
-
path: t,
|
|
39
|
-
leaf: o
|
|
40
|
-
});
|
|
41
|
-
}
|
|
42
|
-
};
|
|
43
|
-
return i(n, ""), t(r);
|
|
44
|
-
}
|
|
45
|
-
function u({ row: e, values: t, mixed: r, renderers: c, onChange: l }) {
|
|
46
|
-
let u = e.leaves.map((e) => f(e, e.leaf.name, t, r, c, l));
|
|
47
|
-
return /* @__PURE__ */ a(i, { children: n(u, c).map((e) => /* @__PURE__ */ o("span", {
|
|
48
|
-
className: s.cell,
|
|
49
|
-
children: [d(e.leaf) && /* @__PURE__ */ a("span", {
|
|
50
|
-
className: s.cellLabel,
|
|
51
|
-
"aria-hidden": "true",
|
|
52
|
-
children: e.leaf.short ?? e.leaf.name
|
|
53
|
-
}), e.content]
|
|
54
|
-
}, e.key)) });
|
|
55
|
-
}
|
|
56
|
-
function d(e) {
|
|
57
|
-
return e.kind === "number" || e.kind === "string";
|
|
58
|
-
}
|
|
59
|
-
function f(e, t, n, i, a, o) {
|
|
60
|
-
let { path: s, leaf: c } = e, l = i?.has(s) === !0, u = {
|
|
61
|
-
path: s,
|
|
62
|
-
pref: c,
|
|
63
|
-
value: l ? void 0 : n?.[s],
|
|
64
|
-
mixed: l,
|
|
65
|
-
unset: !l && n?.[s] === void 0,
|
|
66
|
-
each: l ? [] : [n?.[s]],
|
|
67
|
-
setValue: (e) => o?.(s, e),
|
|
68
|
-
update: (e) => o?.(s, e(l ? void 0 : n?.[s])),
|
|
69
|
-
valueAt: (e) => ({
|
|
70
|
-
value: n?.[e],
|
|
71
|
-
mixed: i?.has(e) === !0
|
|
72
|
-
})
|
|
73
|
-
};
|
|
74
|
-
return {
|
|
75
|
-
key: s,
|
|
76
|
-
leaf: c,
|
|
77
|
-
ctx: u,
|
|
78
|
-
ariaLabel: t,
|
|
79
|
-
render: () => {
|
|
80
|
-
let e = a?.[s] ?? a?.[c.kind];
|
|
81
|
-
return e ? e(u) : r(u, t, a, s);
|
|
82
|
-
}
|
|
83
|
-
};
|
|
84
|
-
}
|
|
85
|
-
//#endregion
|
|
86
|
-
export { c as t };
|
|
87
|
-
|
|
88
|
-
//# sourceMappingURL=ToolOptionsBar-BJKwnemU.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ToolOptionsBar-BJKwnemU.js","names":["s","_Fragment","isGroup","pairRows","renderCells","renderBuiltin","ToolOptionsBar_module_default","ToolOptionsBar","props","cls","className","label","schema","barRows","BarRow","row","children","leaves","collect","key","child","group","path","prefix","cells","barCell","panelLeaf","values","mixed","renderers","onChange","Fragment","needsLabel","cell","leaf","isMixed","ctx","v","fn","p","custom","ariaLabel"],"sources":["../../src/components/ToolOptionsBar/ToolOptionsBar.module.css","../../src/components/ToolOptionsBar/ToolOptionsBar.tsx"],"sourcesContent":["/* Horizontal strip reserved above the workspace for contextual tool\n options. Fixed height so mounting/unmounting content never resizes\n the workspace beneath it — that's the whole reason this row exists\n as permanent chrome rather than an on-demand overlay.\n\n Overflow: when controls exceed the available width, `.controls`\n scrolls horizontally rather than wrapping (which would grow the row\n and defeat the fixed-height guarantee above) or clipping (which\n would hide controls with no way to reach them). A flyout/long-press\n affordance was considered and rejected — grouped, directly visible\n layouts are preferred in this repo. */\n\n.root {\n display: flex;\n align-items: center;\n gap: var(--wzl-space-4);\n height: var(--wzl-tb-height);\n padding: 0 var(--wzl-space-4);\n background: var(--wzl-surface);\n border-bottom: 1px solid var(--wzl-border);\n color: var(--wzl-fg);\n overflow: hidden;\n}\n\n.label {\n flex: 0 0 auto;\n font-size: var(--wzl-font-size-sm);\n font-weight: var(--wzl-font-weight-bold);\n text-transform: uppercase;\n letter-spacing: 0.05em;\n color: var(--wzl-fg-muted);\n white-space: nowrap;\n}\n\n.controls {\n display: flex;\n align-items: center;\n gap: var(--wzl-space-3);\n flex: 1 1 auto;\n min-width: 0;\n height: 100%;\n overflow-x: auto;\n overflow-y: hidden;\n scrollbar-width: thin;\n}\n\n/* Firefox gets a thin scrollbar for free via `scrollbar-width` above.\n * Chromium/WebKit need it spelled out — on a classic (non-overlay)\n * scrollbar theme (default on Windows Chrome/Edge), an unstyled\n * horizontal scrollbar is ~15-17px tall and renders *inside* this box,\n * clipping/off-centering the row's controls. That would reintroduce the\n * exact height instability the scroll-over-wrap overflow choice above\n * exists to avoid — just at the row's inner edge instead of its outer\n * one. Pin it thin and out of the way instead. */\n.controls::-webkit-scrollbar {\n height: 4px;\n}\n.controls::-webkit-scrollbar-track {\n background: transparent;\n}\n.controls::-webkit-scrollbar-thumb {\n background: var(--wzl-border);\n border-radius: var(--wzl-radius-sm);\n}\n\n/* A schema-drawn control sits on the line as-is; the cell exists only to keep\n it from being squeezed by the row's flex context. */\n.cell {\n display: flex;\n align-items: center;\n flex: none;\n}\n\n.cellLabel {\n flex: none;\n margin-right: var(--wzl-space-2);\n font-size: var(--wzl-font-size-sm);\n color: var(--wzl-fg-muted);\n white-space: nowrap;\n}\n\n/* Fields are read beside their label on one line, so they carry only the\n digits they need rather than the panel's column width. */\n.controls {\n --wzl-number-field-width: 5ch;\n}\n\n/* The strip decides how much room a control gets, because its budget is one\n line rather than a column: a field carries the digits it needs and an\n opacity track stops short of pushing its neighbours off the end. Both are\n the panel's widths otherwise, which are sized for a two-column grid. */\n.cell input[type='text'] {\n inline-size: var(--wzl-number-field-width, 5ch);\n}\n\n.cell input[type='range'] {\n inline-size: 64px;\n flex: none;\n}\n","import type { ReactNode } from 'react';\nimport type { ToolPrefGroup, ToolPrefLeaf } from '@weasel-js/core';\nimport {\n renderBuiltin,\n renderCells,\n type LeafCell,\n type PropertyRenderContext,\n type PropertyRenderer,\n} from '../SelectionPanel/renderLeaf';\nimport { isGroup, pairRows, type PanelLeaf, type PanelRow } from '../SelectionPanel/model';\nimport s from './ToolOptionsBar.module.css';\n\n/** Props for {@link ToolOptionsBar}. */\nexport interface ToolOptionsBarProps {\n /**\n * Context label for the row — e.g. the active tool's name. Rendered\n * before the children and doubles as the toolbar's `aria-label`. Omit\n * it and the row still renders (it's a permanently reserved slot), just\n * without an accessible name.\n *\n * Using `label` for both the visible text and `aria-label` means a\n * screen reader announces it twice when landing on the toolbar (\"Text,\n * toolbar\", then \"Text\" again when browsing into the visible span).\n * `aria-labelledby` would avoid the echo at the cost of id plumbing and\n * an awkward no-`id`-to-point-at case when `label` is omitted. The\n * double-announcement is common enough for labeled landmark regions\n * that it's left as-is — considered, not missed.\n */\n label?: string;\n /**\n * The active tool's options. Leaves draw through the same leaf → control\n * mapping `SelectionPanel` uses, so a kind gets its control decided in one\n * place; groups organize without drawing, since the bar is one line.\n */\n schema?: ToolPrefGroup;\n /** Each leaf's value, keyed by dotted path. A path with no entry is unset. */\n values?: Readonly<Record<string, unknown>>;\n /** A leaf edit, as the dotted path it was declared at and its new value. */\n onChange?: (path: string, value: unknown) => void;\n /** Paths whose sources disagree — drawn as the control's mixed state. */\n mixed?: ReadonlySet<string>;\n /** Control overrides, by dotted path or by leaf kind, as the panel takes. */\n renderers?: Record<string, PropertyRenderer>;\n children?: ReactNode;\n className?: string;\n}\n\n/**\n * Horizontal strip reserved above the workspace for contextual tool options.\n * Given a `schema` it draws the active tool's options itself; the children\n * slot stays open for a tenant that is not a tool's options at all, such as\n * loupe controls.\n *\n * The row always renders, even empty, because the app reserves its height\n * permanently rather than mounting it on demand — mounting mid-edit would\n * resize the workspace under a canvas that's sized to the page.\n *\n * `role=\"toolbar\"` without roving tabindex: the ARIA authoring practices\n * expect arrow-key roving focus across a toolbar's items, but a bar of\n * compound controls (`NumberField`, `Select`, `ColorField`) must leave the\n * arrow keys to them — they edit their own value with them. That is true of\n * schema-drawn controls as much as of arbitrary children, so the bar keeps\n * plain DOM tab order and `useRovingTabIndex` documents this as its opt-out.\n */\nexport function ToolOptionsBar(props: ToolOptionsBarProps) {\n const { label, schema, values, onChange, mixed, renderers, children, className } = props;\n const cls = [s.root, className].filter(Boolean).join(' ');\n return (\n <div className={cls} role=\"toolbar\" aria-label={label}>\n {label !== undefined && <span className={s.label}>{label}</span>}\n <div className={s.controls}>\n {schema !== undefined &&\n barRows(schema).map((row) => (\n <BarRow\n key={row.leaves[0]!.path}\n row={row}\n values={values}\n mixed={mixed}\n renderers={renderers}\n onChange={onChange}\n />\n ))}\n {children}\n </div>\n </div>\n );\n}\n\n/**\n * The schema's visible leaves as rows, addressed by dotted path. Groups are\n * organizational here — a bar is one line, so a nested group contributes its\n * leaves and no chrome — but its path segment still names them, so a leaf\n * reads back at the path the tool declared it at.\n */\nfunction barRows(schema: ToolPrefGroup): PanelRow[] {\n const leaves: PanelLeaf[] = [];\n const collect = (group: ToolPrefGroup, prefix: string): void => {\n for (const [key, child] of Object.entries(group.children)) {\n const path = prefix === '' ? key : `${prefix}.${key}`;\n if (isGroup(child)) collect(child, path);\n else if (child.hidden !== true) leaves.push({ path, leaf: child });\n }\n };\n collect(schema, '');\n return pairRows(leaves);\n}\n\n/** One row of the bar: a single control, or a run of flags as one bar. */\nfunction BarRow({\n row,\n values,\n mixed,\n renderers,\n onChange,\n}: {\n row: PanelRow;\n values: Readonly<Record<string, unknown>> | undefined;\n mixed: ReadonlySet<string> | undefined;\n renderers: Record<string, PropertyRenderer> | undefined;\n onChange: ((path: string, value: unknown) => void) | undefined;\n}) {\n // The bar draws no row label, so a control carries its own name rather than\n // the panel's qualified \"<pair> <leaf>\" — the run's bar carries the pair.\n const cells = row.leaves.map((panelLeaf) =>\n barCell(panelLeaf, panelLeaf.leaf.name, values, mixed, renderers, onChange),\n );\n return (\n <>\n {renderCells(cells, renderers).map((cell) => (\n <span key={cell.key} className={s.cell}>\n {needsLabel(cell.leaf) && (\n <span className={s.cellLabel} aria-hidden=\"true\">\n {cell.leaf.short ?? cell.leaf.name}\n </span>\n )}\n {cell.content}\n </span>\n ))}\n </>\n );\n}\n\n/**\n * Whether a control needs telling from its neighbours in words.\n *\n * Only a bare value box does: a number or a string is a box of characters,\n * and two of them side by side are indistinguishable. Everything else shows\n * what it is — a swatch is a color, a font picker names the family, a flag\n * run and a segmented control label their own segments — so a word in front\n * would repeat what the control already says. `name` stays the accessible\n * name either way, so this costs a screen reader nothing.\n */\nfunction needsLabel(leaf: ToolPrefLeaf): boolean {\n return leaf.kind === 'number' || leaf.kind === 'string';\n}\n\nfunction barCell(\n panelLeaf: PanelLeaf,\n ariaLabel: string,\n values: Readonly<Record<string, unknown>> | undefined,\n mixed: ReadonlySet<string> | undefined,\n renderers: Record<string, PropertyRenderer> | undefined,\n onChange: ((path: string, value: unknown) => void) | undefined,\n): LeafCell {\n const { path, leaf } = panelLeaf;\n const isMixed = mixed?.has(path) === true;\n const ctx: PropertyRenderContext = {\n path,\n pref: leaf,\n value: isMixed ? undefined : values?.[path],\n mixed: isMixed,\n unset: !isMixed && values?.[path] === undefined,\n each: isMixed ? [] : [values?.[path]],\n setValue: (v) => onChange?.(path, v),\n // One set of values, so there is one prior value to derive from.\n update: (fn) => onChange?.(path, fn(isMixed ? undefined : values?.[path])),\n valueAt: (p) => ({ value: values?.[p], mixed: mixed?.has(p) === true }),\n };\n return {\n key: path,\n leaf: leaf as ToolPrefLeaf,\n ctx,\n ariaLabel,\n render: () => {\n const custom = renderers?.[path] ?? renderers?.[leaf.kind];\n return custom ? custom(ctx) : renderBuiltin(ctx, ariaLabel, renderers, path);\n },\n };\n}\n"],"mappings":";;;;;;;;;;;ACgEA,SAAgBO,EAAe,GAA4B;CACzD,IAAM,EAAE,UAAO,WAAQ,WAAQ,aAAU,UAAO,cAAW,aAAU,iBAAcC,GAC7EC,IAAM,CAACT,EAAE,MAAMU,CAAS,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG;CACxD,OACE,kBAAC,OAAD;EAAK,WAAWD;EAAK,MAAK;EAAU,cAAYE;EAAhD,UAAA,CACGA,MAAU,KAAA,KAAa,kBAAC,QAAD;GAAM,WAAWX,EAAE;GAAQ,UAAAW;EAAY,CAAA,GAC/D,kBAAC,OAAD;GAAK,WAAWX,EAAE;GAAlB,UAAA,CACGY,MAAW,KAAA,KACVC,EAAQD,CAAM,CAAC,CAAC,KAAK,MACnB,kBAACE,GAAD;IAEO;IACG;IACD;IACI;IACD;GACX,GANMC,EAAI,OAAO,EAAE,CAAE,IAMrB,CACF,GACFC,CACE;EACF,CAAA,CAAA;;AAET;AAQA,SAASH,EAAQ,GAAmC;CAClD,IAAMI,IAAsB,CAAC,GACvBC,KAAW,GAAsB,MAAyB;EAC9D,KAAK,IAAM,CAACC,GAAKC,MAAU,OAAO,QAAQC,EAAM,QAAQ,GAAG;GACzD,IAAMC,IAAOC,MAAW,KAAKJ,IAAM,GAAGI,EAAO,GAAGJ;GAChD,AAAIjB,EAAQkB,CAAK,IAAGF,EAAQE,GAAOE,CAAI,IAC9BF,EAAM,WAAW,MAAMH,EAAO,KAAK;IAAE;IAAM,MAAMG;GAAM,CAAC;EACnE;CACF;CAEA,OADAF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ASA,EAAOJ,CAAG,IAAI/B,EAAc+B,GAAKK,GAAWZ,GAAWP,CAAI;EAC7E;CACF;AACF"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Tooltip-C6eFCYxw.js","names":["TooltipTrigger","RACTooltipTrigger","Tooltip","_Fragment","RACTooltip","s","useOverlayPortal","Focusable$1","Tooltip_module_default","TooltipTrigger$1","rest","props","TooltipTrigger","Tooltip$1","portalContainer","Fragment","anchor","Tooltip","className","portalProps","OverlayArrow","children"],"sources":["../../src/components/Tooltip/Tooltip.module.css","../../src/components/Tooltip/Tooltip.tsx"],"sourcesContent":[".tooltip {\n /* Above Dialog overlay (1000) and ToastRegion (1100) — RAC sets no z-index. */\n z-index: 1200;\n background: var(--wzl-surface);\n border: 1px solid var(--wzl-border);\n border-radius: var(--wzl-radius-sm);\n box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);\n color: var(--wzl-fg);\n font-family: var(--wzl-font-ui);\n font-size: var(--wzl-font-size-sm);\n line-height: 1.3;\n padding: var(--wzl-space-2) var(--wzl-space-4);\n max-width: 260px;\n transition: opacity var(--wzl-motion-fast);\n}\n\n.tooltip[data-entering],\n.tooltip[data-exiting] {\n opacity: 0;\n}\n\n.arrow svg {\n display: block;\n fill: var(--wzl-surface);\n stroke: var(--wzl-border);\n stroke-width: 1;\n}\n\n.arrow[data-placement='bottom'] svg {\n transform: rotate(180deg);\n}\n\n.arrow[data-placement='left'] svg {\n transform: rotate(-90deg);\n}\n\n.arrow[data-placement='right'] svg {\n transform: rotate(90deg);\n}\n","import type { ReactNode } from 'react';\nimport {\n TooltipTrigger as RACTooltipTrigger,\n Tooltip as RACTooltip,\n OverlayArrow,\n type TooltipProps as RACTooltipProps,\n type TooltipTriggerComponentProps,\n} from 'react-aria-components';\nimport { useOverlayPortal, type OverlayPortalProps, type WithoutPortalTarget } from '../../overlays/portalHost';\nimport s from './Tooltip.module.css';\n\n/** Makes a non-RAC element a {@link TooltipTrigger} trigger: supplies\n * `tabIndex`, the hover/focus handlers and `aria-describedby`. The child must\n * forward its ref and DOM props, and carry an interactive role (or `img`). */\nexport { Focusable } from 'react-aria-components';\n\n/**\n * Props for {@link TooltipTrigger} — React Aria's `TooltipTrigger` props\n * unchanged.\n */\nexport type TooltipTriggerProps = TooltipTriggerComponentProps;\n\n/**\n * TooltipTrigger with kit defaults: ~600 ms open delay, instant close.\n * Wrap a focusable trigger plus a `<Tooltip>`. Non-RAC triggers (plain\n * `<button>`, a `Badge` etc.) must be wrapped in {@link Focusable} so\n * hover/focus props reach the DOM node.\n *\n * Caveat: while a tooltip is open, react-aria captures the first Escape\n * keydown (document-level, capture phase) to dismiss it — app-level\n * Escape handlers (deselect, cancel gesture) see only the second press.\n */\nexport function TooltipTrigger(props: TooltipTriggerProps) {\n const { delay = 600, closeDelay = 0, ...rest } = props;\n return <RACTooltipTrigger delay={delay} closeDelay={closeDelay} {...rest} />;\n}\n\n/** Props for {@link Tooltip}, on top of React Aria's `Tooltip` props. */\nexport type TooltipProps = Omit<WithoutPortalTarget<RACTooltipProps>, 'children' | 'className'> &\n OverlayPortalProps & {\n children?: ReactNode;\n className?: string;\n };\n\n/**\n * Tooltip bubble with an arrow pointing at the trigger. Non-interactive\n * content only (ARIA tooltip semantics). Use inside `<TooltipTrigger>`.\n */\nexport function Tooltip(props: TooltipProps) {\n const { children, className, placement = 'top', offset = 8, portalContainer, ...rest } = props;\n const { anchor, portalProps } = useOverlayPortal(portalContainer);\n return (\n <>\n {anchor}\n <RACTooltip\n {...rest}\n placement={placement}\n offset={offset}\n className={[s.tooltip, className].filter(Boolean).join(' ')}\n data-weasel-overlay=\"\"\n {...portalProps}\n >\n <OverlayArrow className={s.arrow}>\n <svg width={8} height={8} viewBox=\"0 0 8 8\" aria-hidden=\"true\">\n <path d=\"M0 0 L4 4 L8 0\" />\n </svg>\n </OverlayArrow>\n {children}\n </RACTooltip>\n </>\n );\n}\n"],"mappings":";;;;;;;;;ACgCA,SAAgBA,EAAe,GAA4B;CACzD,IAAM,EAAE,WAAQ,KAAK,gBAAa,GAAG,GAAGU,MAASC;CACjD,OAAO,kBAACV,GAAD;EAA0B;EAAmB;EAAY,GAAIS;CAAO,CAAA;AAC7E;AAaA,SAAgBR,EAAQ,GAAqB;CAC3C,IAAM,EAAE,aAAU,cAAW,eAAY,OAAO,YAAS,GAAG,oBAAiB,GAAGQ,MAASC,GACnF,EAAE,WAAQ,mBAAgBL,EAAiBQ,CAAe;CAChE,OACE,kBAAAX,GAAA,EAAA,UAAA,CACGa,GACD,kBAACZ,GAAD;EACE,GAAIM;EACO;EACH;EACR,WAAW,CAACL,EAAE,SAASa,CAAS,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG;EAC1D,uBAAoB;EACpB,GAAIC;EANN,UAAA,CAQE,kBAACC,GAAD;GAAc,WAAWf,EAAE;GACzB,UAAA,kBAAC,OAAD;IAAK,OAAO;IAAG,QAAQ;IAAG,SAAQ;IAAU,eAAY;IACtD,UAAA,kBAAC,QAAD,EAAM,GAAE,iBAAkB,CAAA;GACvB,CAAA;EACO,CAAA,GACbgB,CACS;CACZ,CAAA,CAAA,EAAA,CAAA;AAEN"}
|
|
@@ -1,203 +0,0 @@
|
|
|
1
|
-
import { n as e } from "./Disclosure-Ch2KxYuB.js";
|
|
2
|
-
import { jsx as t, jsxs as n } from "react/jsx-runtime";
|
|
3
|
-
import { forwardRef as r, useId as i, useMemo as a, useRef as o, useState as s } from "react";
|
|
4
|
-
var c = {
|
|
5
|
-
tree: "_tree_10k4o_1",
|
|
6
|
-
group: "_group_10k4o_2",
|
|
7
|
-
item: "_item_10k4o_19",
|
|
8
|
-
row: "_row_10k4o_23",
|
|
9
|
-
twisty: "_twisty_10k4o_61",
|
|
10
|
-
leading: "_leading_10k4o_75",
|
|
11
|
-
label: "_label_10k4o_81",
|
|
12
|
-
trailing: "_trailing_10k4o_88",
|
|
13
|
-
empty: "_empty_10k4o_95"
|
|
14
|
-
}, l = 500, u = r(function({ nodes: r, empty: u, className: d, "aria-label": f, "aria-labelledby": g, expandedIds: _, defaultExpandedIds: v, onExpandedChange: y, selectionMode: b = "none", selectedIds: x, defaultSelectedIds: S, onSelectionChange: C, onAction: w }, T) {
|
|
15
|
-
let [E, D] = h(_, v, y), [O, k] = h(x, S, C), A = b !== "none", j = i(), M = a(() => {
|
|
16
|
-
let e = [], t = (n, r, i) => {
|
|
17
|
-
for (let a of n) e.push({
|
|
18
|
-
node: a,
|
|
19
|
-
parentId: r,
|
|
20
|
-
level: i
|
|
21
|
-
}), a.children && E.has(a.id) && t(a.children, a.id, i + 1);
|
|
22
|
-
};
|
|
23
|
-
return t(r, null, 1), e;
|
|
24
|
-
}, [r, E]), N = a(() => new Map(M.map((e, t) => [e.node.id, t])), [M]), P = o(/* @__PURE__ */ new Map()), [F, I] = s(null), L = o(null), R = o({
|
|
25
|
-
text: "",
|
|
26
|
-
at: 0
|
|
27
|
-
}), z = F != null && N.has(F) ? F : (M.find((e) => A && O.has(e.node.id)) ?? M[0])?.node.id;
|
|
28
|
-
if (r.length === 0) return /* @__PURE__ */ t("div", {
|
|
29
|
-
className: [c.empty, d].filter(Boolean).join(" "),
|
|
30
|
-
children: u ?? "—"
|
|
31
|
-
});
|
|
32
|
-
let B = (e) => {
|
|
33
|
-
e != null && P.current.get(e)?.focus();
|
|
34
|
-
}, V = (e) => {
|
|
35
|
-
if (!e.children || e.disabled) return;
|
|
36
|
-
let t = new Set(E);
|
|
37
|
-
t.has(e.id) ? t.delete(e.id) : t.add(e.id), D(t);
|
|
38
|
-
}, H = (e, t) => {
|
|
39
|
-
let n;
|
|
40
|
-
if (b === "multiple" && t.shiftKey && L.current != null && N.has(L.current)) {
|
|
41
|
-
let t = N.get(L.current), r = N.get(e);
|
|
42
|
-
n = new Set(M.slice(Math.min(t, r), Math.max(t, r) + 1).filter((e) => !e.node.disabled).map((e) => e.node.id));
|
|
43
|
-
} else b === "multiple" && (t.metaKey || t.ctrlKey) ? (n = new Set(O), n.has(e) ? n.delete(e) : n.add(e), L.current = e) : (n = /* @__PURE__ */ new Set([e]), L.current = e);
|
|
44
|
-
(n.size !== O.size || [...n].some((e) => !O.has(e))) && k(n);
|
|
45
|
-
}, U = (e, t) => {
|
|
46
|
-
e.disabled || (V(e), A && H(e.id, t), w?.(e.id, t));
|
|
47
|
-
}, W = (e) => (t) => {
|
|
48
|
-
if (t.target !== t.currentTarget) return;
|
|
49
|
-
let n = N.get(e.node.id), { node: r } = e, i = !!r.children && E.has(r.id);
|
|
50
|
-
switch (t.key) {
|
|
51
|
-
case "ArrowDown":
|
|
52
|
-
t.preventDefault(), B(M[Math.min(n + 1, M.length - 1)].node.id);
|
|
53
|
-
return;
|
|
54
|
-
case "ArrowUp":
|
|
55
|
-
t.preventDefault(), B(M[Math.max(n - 1, 0)].node.id);
|
|
56
|
-
return;
|
|
57
|
-
case "Home":
|
|
58
|
-
t.preventDefault(), B(M[0].node.id);
|
|
59
|
-
return;
|
|
60
|
-
case "End":
|
|
61
|
-
t.preventDefault(), B(M[M.length - 1].node.id);
|
|
62
|
-
return;
|
|
63
|
-
case "ArrowRight":
|
|
64
|
-
if (!r.children) return;
|
|
65
|
-
t.preventDefault(), i ? B(r.children[0]?.id) : V(r);
|
|
66
|
-
return;
|
|
67
|
-
case "ArrowLeft":
|
|
68
|
-
t.preventDefault(), i ? V(r) : B(e.parentId ?? void 0);
|
|
69
|
-
return;
|
|
70
|
-
case "Enter":
|
|
71
|
-
case " ":
|
|
72
|
-
t.preventDefault(), U(r, m(t));
|
|
73
|
-
return;
|
|
74
|
-
default:
|
|
75
|
-
if (t.key.length !== 1 || t.ctrlKey || t.metaKey || t.altKey) return;
|
|
76
|
-
G(t, n);
|
|
77
|
-
}
|
|
78
|
-
}, G = (e, t) => {
|
|
79
|
-
let n = Date.now(), r = R.current;
|
|
80
|
-
r.text = n - r.at > l ? e.key : r.text + e.key, r.at = n;
|
|
81
|
-
let i = r.text.toLowerCase(), a = r.text.length === 1 ? t + 1 : t;
|
|
82
|
-
for (let t = 0; t < M.length; t++) {
|
|
83
|
-
let n = M[(a + t) % M.length];
|
|
84
|
-
if (p(n.node).toLowerCase().startsWith(i)) {
|
|
85
|
-
e.preventDefault(), B(n.node.id);
|
|
86
|
-
return;
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
}, K = (e) => (t) => U(e, m(t)), q = (e) => (t) => {
|
|
90
|
-
t.stopPropagation(), V(e);
|
|
91
|
-
}, J = (e) => (t) => {
|
|
92
|
-
t ? P.current.set(e, t) : P.current.delete(e);
|
|
93
|
-
}, Y = 0, X = (r, i, a) => r.map((o, s) => {
|
|
94
|
-
let l = Y++, u = !!o.children, d = u && E.has(o.id), f = `${j}-${l}`, p = o.trailing == null ? void 0 : `${j}-${l}-t`;
|
|
95
|
-
return /* @__PURE__ */ n("li", {
|
|
96
|
-
ref: J(o.id),
|
|
97
|
-
role: "treeitem",
|
|
98
|
-
className: [c.item, o.className].filter(Boolean).join(" "),
|
|
99
|
-
"aria-level": a,
|
|
100
|
-
"aria-setsize": r.length,
|
|
101
|
-
"aria-posinset": s + 1,
|
|
102
|
-
"aria-expanded": u ? d : void 0,
|
|
103
|
-
"aria-selected": A ? O.has(o.id) : void 0,
|
|
104
|
-
"aria-disabled": o.disabled || void 0,
|
|
105
|
-
"aria-labelledby": p ? `${f} ${p}` : f,
|
|
106
|
-
"data-muted": o.muted ? "true" : void 0,
|
|
107
|
-
tabIndex: o.id === z ? 0 : -1,
|
|
108
|
-
onKeyDown: W({
|
|
109
|
-
node: o,
|
|
110
|
-
parentId: i,
|
|
111
|
-
level: a
|
|
112
|
-
}),
|
|
113
|
-
onFocus: (e) => {
|
|
114
|
-
e.target === e.currentTarget && I(o.id);
|
|
115
|
-
},
|
|
116
|
-
children: [/* @__PURE__ */ n("div", {
|
|
117
|
-
className: c.row,
|
|
118
|
-
onClick: K(o),
|
|
119
|
-
children: [
|
|
120
|
-
/* @__PURE__ */ t("span", {
|
|
121
|
-
className: c.twisty,
|
|
122
|
-
"aria-hidden": "true",
|
|
123
|
-
onClick: u ? q(o) : void 0,
|
|
124
|
-
children: u && /* @__PURE__ */ t(e, { open: d })
|
|
125
|
-
}),
|
|
126
|
-
o.leading != null && /* @__PURE__ */ t("span", {
|
|
127
|
-
className: c.leading,
|
|
128
|
-
children: o.leading
|
|
129
|
-
}),
|
|
130
|
-
/* @__PURE__ */ t("span", {
|
|
131
|
-
id: f,
|
|
132
|
-
className: c.label,
|
|
133
|
-
children: o.label
|
|
134
|
-
}),
|
|
135
|
-
p && /* @__PURE__ */ t("span", {
|
|
136
|
-
id: p,
|
|
137
|
-
className: c.trailing,
|
|
138
|
-
children: o.trailing
|
|
139
|
-
})
|
|
140
|
-
]
|
|
141
|
-
}), d && o.children.length > 0 && /* @__PURE__ */ t("ul", {
|
|
142
|
-
role: "group",
|
|
143
|
-
className: c.group,
|
|
144
|
-
children: X(o.children, o.id, a + 1)
|
|
145
|
-
})]
|
|
146
|
-
}, o.id);
|
|
147
|
-
});
|
|
148
|
-
return /* @__PURE__ */ t("ul", {
|
|
149
|
-
ref: T,
|
|
150
|
-
role: "tree",
|
|
151
|
-
className: [c.tree, d].filter(Boolean).join(" "),
|
|
152
|
-
"aria-label": f,
|
|
153
|
-
"aria-labelledby": g,
|
|
154
|
-
"aria-multiselectable": b === "multiple" || void 0,
|
|
155
|
-
children: X(r, null, 1)
|
|
156
|
-
});
|
|
157
|
-
});
|
|
158
|
-
function d(e, t) {
|
|
159
|
-
let n = !1, r = [];
|
|
160
|
-
for (let i of e) {
|
|
161
|
-
if (t(i)) {
|
|
162
|
-
r.push(i);
|
|
163
|
-
continue;
|
|
164
|
-
}
|
|
165
|
-
let e = i.children ? d(i.children, t) : [];
|
|
166
|
-
if (e.length === 0) {
|
|
167
|
-
n = !0;
|
|
168
|
-
continue;
|
|
169
|
-
}
|
|
170
|
-
e !== i.children && (n = !0), r.push(e === i.children ? i : {
|
|
171
|
-
...i,
|
|
172
|
-
children: e
|
|
173
|
-
});
|
|
174
|
-
}
|
|
175
|
-
return n ? r : e;
|
|
176
|
-
}
|
|
177
|
-
function f(e) {
|
|
178
|
-
let t = [], n = (e) => {
|
|
179
|
-
for (let r of e) r.children && (t.push(r.id), n(r.children));
|
|
180
|
-
};
|
|
181
|
-
return n(e), t;
|
|
182
|
-
}
|
|
183
|
-
function p(e) {
|
|
184
|
-
return e.textValue ?? (typeof e.label == "string" ? e.label : "");
|
|
185
|
-
}
|
|
186
|
-
function m(e) {
|
|
187
|
-
return {
|
|
188
|
-
shiftKey: e.shiftKey,
|
|
189
|
-
ctrlKey: e.ctrlKey,
|
|
190
|
-
metaKey: e.metaKey,
|
|
191
|
-
altKey: e.altKey
|
|
192
|
-
};
|
|
193
|
-
}
|
|
194
|
-
function h(e, t, n) {
|
|
195
|
-
let [r, i] = s(() => new Set(t));
|
|
196
|
-
return [a(() => e === void 0 ? void 0 : new Set(e), [e]) ?? r, (t) => {
|
|
197
|
-
e === void 0 && i(t), n?.(t);
|
|
198
|
-
}];
|
|
199
|
-
}
|
|
200
|
-
//#endregion
|
|
201
|
-
export { d as n, f as r, u as t };
|
|
202
|
-
|
|
203
|
-
//# sourceMappingURL=Tree-Cc8lIzgM.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Tree-Cc8lIzgM.js","names":["s","DisclosureMark","Tree_module_default","TYPEAHEAD_MS","Tree","forwardRef","ariaLabel","ariaLabelledBy","expanded","setExpanded","useControlledSet","expandedIds","defaultExpandedIds","onExpandedChange","selected","setSelected","selectedIds","defaultSelectedIds","onSelectionChange","selectable","selectionMode","baseId","useId","visible","useMemo","out","walk","node","list","level","nodes","indexOf","v","i","items","useRef","focusId","setFocusId","useState","anchor","typed","stopId","className","empty","focus","id","toggle","next","select","mods","a","b","x","activate","onAction","onKeyDown","e","open","modsOf","typeAhead","now","t","want","start","from","k","textOf","onRowClick","onTwistyClick","itemRef","el","seq","renderLevel","n","branch","labelId","trailingId","pos","filterTree","changed","match","kids","treeBranchIds","own","setOwn","initial","value","onChange"],"sources":["../../src/components/Tree/Tree.module.css","../../src/components/Tree/Tree.tsx"],"sourcesContent":[".tree,\n.group {\n list-style: none;\n margin: 0;\n padding: 0;\n}\n\n.tree {\n user-select: none;\n -webkit-user-select: none;\n width: 100%;\n}\n\n/* One twisty and one gap, so a child's twisty sits under its parent's label. */\n.group {\n padding-inline-start: var(--wzl-tree-indent, calc(var(--wzl-control-h-xs) + var(--wzl-space-2)));\n}\n\n.item {\n outline: none;\n}\n\n.row {\n display: flex;\n align-items: center;\n gap: var(--wzl-space-2);\n padding: 0 var(--wzl-space-2) 0 0;\n height: var(--wzl-control-h);\n font-size: var(--wzl-font-size-sm);\n color: var(--wzl-fg);\n border-radius: var(--wzl-radius-sm);\n cursor: default;\n white-space: nowrap;\n overflow: hidden;\n}\n\n.row:hover {\n background: var(--wzl-surface);\n}\n\n.item:focus-visible > .row {\n outline: 2px solid var(--wzl-focus-ring);\n outline-offset: -2px;\n}\n\n.item[aria-selected='true'] > .row {\n background: var(--wzl-border);\n}\n\n.item[data-muted] > .row {\n color: var(--wzl-fg-subtle);\n}\n\n.item[aria-disabled='true'] > .row {\n color: var(--wzl-fg-subtle);\n cursor: not-allowed;\n}\n\n/* A leaf keeps the empty box, so labels at one level line up whether or not\n their rows are branches. */\n.twisty {\n flex: none;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: var(--wzl-control-h-xs);\n align-self: stretch;\n color: var(--wzl-fg-muted);\n}\n\n.row:hover > .twisty {\n color: var(--wzl-fg);\n}\n\n.leading {\n flex: none;\n display: inline-flex;\n align-items: center;\n}\n\n.label {\n flex: 1 1 auto;\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.trailing {\n flex: none;\n display: inline-flex;\n align-items: center;\n gap: var(--wzl-space-2);\n}\n\n.empty {\n padding: var(--wzl-space-6) var(--wzl-space-4);\n font-size: var(--wzl-font-size-sm);\n color: var(--wzl-fg-subtle);\n font-style: italic;\n}\n","import {\n forwardRef,\n useId,\n useMemo,\n useRef,\n useState,\n type KeyboardEvent,\n type MouseEvent,\n type ReactNode,\n type Ref,\n} from 'react';\nimport type { PressModifiers } from '../../useReorderDragList';\nimport { DisclosureMark } from '../Disclosure';\nimport s from './Tree.module.css';\n\n/** One node. A node with `children` is a branch, even when the array is empty. */\nexport interface TreeNode {\n /** Unique across the whole tree. */\n id: string;\n label: ReactNode;\n /** What type-ahead matches against. Defaults to `label` when that is a string. */\n textValue?: string;\n /** Decoration before the label — an icon. Not a control. */\n leading?: ReactNode;\n /** Decoration after the label — a count badge. Not a control. Read as part\n * of the row's accessible name. */\n trailing?: ReactNode;\n children?: readonly TreeNode[];\n /** Present but not in effect. */\n muted?: boolean;\n /** Focusable and announced, but cannot be activated, expanded or selected. */\n disabled?: boolean;\n className?: string;\n}\n\n/** Whether and how rows are selectable. */\nexport type TreeSelectionMode = 'none' | 'single' | 'multiple';\n\n/** Props for {@link Tree}. */\nexport interface TreeProps {\n nodes: readonly TreeNode[];\n /** Shown in place of the tree when `nodes` is empty. */\n empty?: ReactNode;\n className?: string;\n 'aria-label'?: string;\n 'aria-labelledby'?: string;\n\n /** Open branches, controlled. */\n expandedIds?: Iterable<string>;\n /** Open branches on first render, when uncontrolled. */\n defaultExpandedIds?: Iterable<string>;\n /** The whole set a toggle would produce. Called whether or not controlled. */\n onExpandedChange?(ids: Set<string>): void;\n\n /** Default `'none'`. `'multiple'` adds to the selection with Cmd/Ctrl and\n * extends it over visible rows with Shift. */\n selectionMode?: TreeSelectionMode;\n /** Selected rows, controlled. */\n selectedIds?: Iterable<string>;\n /** Selected rows on first render, when uncontrolled. */\n defaultSelectedIds?: Iterable<string>;\n /** The whole set an activation would produce, when it differs. */\n onSelectionChange?(ids: Set<string>): void;\n\n /** A row was activated — click, Enter or Space — with the modifiers held. */\n onAction?(id: string, mods: PressModifiers): void;\n}\n\ninterface Visible {\n node: TreeNode;\n parentId: string | null;\n level: number;\n}\n\nconst TYPEAHEAD_MS = 500;\n\n/**\n * A hierarchy of rows that expand and collapse: a file tree, a registry\n * browser, an outline.\n *\n * **Semantics.** WAI-ARIA `tree`: each node is a `treeitem` carrying\n * `aria-level`, `aria-setsize` and `aria-posinset`; a branch carries\n * `aria-expanded` and nests its children in a `group`, which is rendered only\n * while the branch is open. `aria-selected` appears only when `selectionMode`\n * is set. A treeitem may not contain interactive content, so `leading` and\n * `trailing` are decoration — an icon, a count — and the twisty is a drawn\n * `DisclosureMark`, not a button.\n *\n * **Keyboard.** One treeitem is in the tab order: the one last focused, else\n * the first selected, else the first. Up/Down move between visible rows,\n * Home/End go to the first and last. Right opens a closed branch, then moves\n * into it; Left closes an open branch, else moves to the parent. Enter and\n * Space activate, as a click does. Typing moves to the next row whose text\n * starts with what was typed.\n *\n * **Activating** a row — click, Enter, Space — toggles it if it is a branch,\n * selects it under `selectionMode`, and calls `onAction`. Clicking the twisty\n * only toggles.\n *\n * **Filtering** is the consumer's: narrow `nodes` with `filterTree`, and pass\n * `treeBranchIds` of the result as `expandedIds` so every match shows.\n */\nexport const Tree = forwardRef(function Tree(\n {\n nodes, empty, className,\n 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledBy,\n expandedIds, defaultExpandedIds, onExpandedChange,\n selectionMode = 'none', selectedIds, defaultSelectedIds, onSelectionChange,\n onAction,\n }: TreeProps,\n ref: Ref<HTMLUListElement>,\n) {\n const [expanded, setExpanded] = useControlledSet(expandedIds, defaultExpandedIds, onExpandedChange);\n const [selected, setSelected] = useControlledSet(selectedIds, defaultSelectedIds, onSelectionChange);\n const selectable = selectionMode !== 'none';\n const baseId = useId();\n\n const visible = useMemo(() => {\n const out: Visible[] = [];\n const walk = (list: readonly TreeNode[], parentId: string | null, level: number) => {\n for (const node of list) {\n out.push({ node, parentId, level });\n if (node.children && expanded.has(node.id)) walk(node.children, node.id, level + 1);\n }\n };\n walk(nodes, null, 1);\n return out;\n }, [nodes, expanded]);\n const indexOf = useMemo(() => new Map(visible.map((v, i) => [v.node.id, i])), [visible]);\n\n const items = useRef(new Map<string, HTMLLIElement>());\n const [focusId, setFocusId] = useState<string | null>(null);\n const anchor = useRef<string | null>(null);\n const typed = useRef({ text: '', at: 0 });\n\n const stopId = focusId != null && indexOf.has(focusId)\n ? focusId\n : (visible.find((v) => selectable && selected.has(v.node.id)) ?? visible[0])?.node.id;\n\n if (nodes.length === 0) {\n return <div className={[s.empty, className].filter(Boolean).join(' ')}>{empty ?? '—'}</div>;\n }\n\n const focus = (id: string | undefined) => { if (id != null) items.current.get(id)?.focus(); };\n\n const toggle = (node: TreeNode) => {\n if (!node.children || node.disabled) return;\n const next = new Set(expanded);\n if (next.has(node.id)) next.delete(node.id);\n else next.add(node.id);\n setExpanded(next);\n };\n\n const select = (id: string, mods: PressModifiers) => {\n let next: Set<string>;\n if (selectionMode === 'multiple' && mods.shiftKey && anchor.current != null && indexOf.has(anchor.current)) {\n const a = indexOf.get(anchor.current)!;\n const b = indexOf.get(id)!;\n next = new Set(visible.slice(Math.min(a, b), Math.max(a, b) + 1)\n .filter((v) => !v.node.disabled).map((v) => v.node.id));\n } else if (selectionMode === 'multiple' && (mods.metaKey || mods.ctrlKey)) {\n next = new Set(selected);\n if (next.has(id)) next.delete(id);\n else next.add(id);\n anchor.current = id;\n } else {\n next = new Set([id]);\n anchor.current = id;\n }\n if (next.size !== selected.size || [...next].some((x) => !selected.has(x))) setSelected(next);\n };\n\n const activate = (node: TreeNode, mods: PressModifiers) => {\n if (node.disabled) return;\n toggle(node);\n if (selectable) select(node.id, mods);\n onAction?.(node.id, mods);\n };\n\n const onKeyDown = (v: Visible) => (e: KeyboardEvent<HTMLLIElement>) => {\n if (e.target !== e.currentTarget) return;\n const i = indexOf.get(v.node.id)!;\n const { node } = v;\n const open = !!node.children && expanded.has(node.id);\n switch (e.key) {\n case 'ArrowDown':\n e.preventDefault();\n focus(visible[Math.min(i + 1, visible.length - 1)].node.id);\n return;\n case 'ArrowUp':\n e.preventDefault();\n focus(visible[Math.max(i - 1, 0)].node.id);\n return;\n case 'Home':\n e.preventDefault();\n focus(visible[0].node.id);\n return;\n case 'End':\n e.preventDefault();\n focus(visible[visible.length - 1].node.id);\n return;\n case 'ArrowRight':\n if (!node.children) return;\n e.preventDefault();\n if (!open) toggle(node);\n else focus(node.children[0]?.id);\n return;\n case 'ArrowLeft':\n e.preventDefault();\n if (open) toggle(node);\n else focus(v.parentId ?? undefined);\n return;\n case 'Enter':\n case ' ':\n e.preventDefault();\n activate(node, modsOf(e));\n return;\n default:\n if (e.key.length !== 1 || e.ctrlKey || e.metaKey || e.altKey) return;\n typeAhead(e, i);\n }\n };\n\n const typeAhead = (e: KeyboardEvent, from: number) => {\n const now = Date.now();\n const t = typed.current;\n t.text = now - t.at > TYPEAHEAD_MS ? e.key : t.text + e.key;\n t.at = now;\n const want = t.text.toLowerCase();\n // A fresh first letter looks past the current row; a longer prefix may still match it.\n const start = t.text.length === 1 ? from + 1 : from;\n for (let k = 0; k < visible.length; k++) {\n const v = visible[(start + k) % visible.length];\n if (textOf(v.node).toLowerCase().startsWith(want)) {\n e.preventDefault();\n focus(v.node.id);\n return;\n }\n }\n };\n\n const onRowClick = (node: TreeNode) => (e: MouseEvent<HTMLDivElement>) => activate(node, modsOf(e));\n\n const onTwistyClick = (node: TreeNode) => (e: MouseEvent<HTMLSpanElement>) => {\n e.stopPropagation();\n toggle(node);\n };\n\n const itemRef = (id: string) => (el: HTMLLIElement | null) => {\n if (el) items.current.set(id, el);\n else items.current.delete(id);\n };\n\n let seq = 0;\n const renderLevel = (list: readonly TreeNode[], parentId: string | null, level: number): ReactNode =>\n list.map((node, pos) => {\n const n = seq++;\n const branch = !!node.children;\n const open = branch && expanded.has(node.id);\n const labelId = `${baseId}-${n}`;\n const trailingId = node.trailing != null ? `${baseId}-${n}-t` : undefined;\n return (\n <li\n key={node.id}\n ref={itemRef(node.id)}\n role=\"treeitem\"\n className={[s.item, node.className].filter(Boolean).join(' ')}\n aria-level={level}\n aria-setsize={list.length}\n aria-posinset={pos + 1}\n aria-expanded={branch ? open : undefined}\n aria-selected={selectable ? selected.has(node.id) : undefined}\n aria-disabled={node.disabled || undefined}\n aria-labelledby={trailingId ? `${labelId} ${trailingId}` : labelId}\n data-muted={node.muted ? 'true' : undefined}\n tabIndex={node.id === stopId ? 0 : -1}\n onKeyDown={onKeyDown({ node, parentId, level })}\n onFocus={(e) => { if (e.target === e.currentTarget) setFocusId(node.id); }}\n >\n <div className={s.row} onClick={onRowClick(node)}>\n <span className={s.twisty} aria-hidden=\"true\" onClick={branch ? onTwistyClick(node) : undefined}>\n {branch && <DisclosureMark open={open} />}\n </span>\n {node.leading != null && <span className={s.leading}>{node.leading}</span>}\n <span id={labelId} className={s.label}>{node.label}</span>\n {trailingId && <span id={trailingId} className={s.trailing}>{node.trailing}</span>}\n </div>\n {open && node.children!.length > 0 && (\n <ul role=\"group\" className={s.group}>\n {renderLevel(node.children!, node.id, level + 1)}\n </ul>\n )}\n </li>\n );\n });\n\n return (\n <ul\n ref={ref}\n role=\"tree\"\n className={[s.tree, className].filter(Boolean).join(' ')}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n aria-multiselectable={selectionMode === 'multiple' || undefined}\n >\n {renderLevel(nodes, null, 1)}\n </ul>\n );\n});\n\n/**\n * `nodes` narrowed to those `match` accepts, plus their ancestors. A matching\n * node keeps its whole subtree; a branch with no match inside it is dropped.\n * Returns `nodes` itself when nothing is dropped.\n */\nexport function filterTree(\n nodes: readonly TreeNode[],\n match: (node: TreeNode) => boolean,\n): readonly TreeNode[] {\n let changed = false;\n const out: TreeNode[] = [];\n for (const node of nodes) {\n if (match(node)) {\n out.push(node);\n continue;\n }\n const kids = node.children ? filterTree(node.children, match) : [];\n if (kids.length === 0) {\n changed = true;\n continue;\n }\n if (kids !== node.children) changed = true;\n out.push(kids === node.children ? node : { ...node, children: kids });\n }\n return changed ? out : nodes;\n}\n\n/** Every branch id in `nodes`, depth first — `expandedIds` for a tree with everything open. */\nexport function treeBranchIds(nodes: readonly TreeNode[]): string[] {\n const out: string[] = [];\n const walk = (list: readonly TreeNode[]) => {\n for (const node of list) {\n if (!node.children) continue;\n out.push(node.id);\n walk(node.children);\n }\n };\n walk(nodes);\n return out;\n}\n\nfunction textOf(node: TreeNode): string {\n return node.textValue ?? (typeof node.label === 'string' ? node.label : '');\n}\n\nfunction modsOf(e: { shiftKey: boolean; ctrlKey: boolean; metaKey: boolean; altKey: boolean }): PressModifiers {\n return { shiftKey: e.shiftKey, ctrlKey: e.ctrlKey, metaKey: e.metaKey, altKey: e.altKey };\n}\n\nfunction useControlledSet(\n value: Iterable<string> | undefined,\n initial: Iterable<string> | undefined,\n onChange: ((ids: Set<string>) => void) | undefined,\n): [ReadonlySet<string>, (next: Set<string>) => void] {\n const [own, setOwn] = useState<ReadonlySet<string>>(() => new Set(initial));\n const controlled = useMemo(() => (value === undefined ? undefined : new Set(value)), [value]);\n const set = (next: Set<string>) => {\n if (value === undefined) setOwn(next);\n onChange?.(next);\n };\n return [controlled ?? own, set];\n}\n"],"mappings":";;;;;;;;;;;;;GC0EMG,IAAe,KA4BRC,IAAOC,EAAW,SAC7B,EACE,UAAO,UAAO,cACd,cAAcC,GAAW,mBAAmBC,GAC5C,gBAAa,uBAAoB,qBACjC,mBAAgB,QAAQ,gBAAa,uBAAoB,sBACzD,eAEF,GACA;CACA,IAAM,CAACC,GAAUC,KAAeC,EAAiBC,GAAaC,GAAoBC,CAAgB,GAC5F,CAACC,GAAUC,KAAeL,EAAiBM,GAAaC,GAAoBC,CAAiB,GAC7FC,IAAaC,MAAkB,QAC/BC,IAASC,EAAM,GAEfC,IAAUC,QAAc;EAC5B,IAAMC,IAAiB,CAAC,GAClBC,KAAQ,GAA2B,GAAyB,MAAkB;GAClF,KAAK,IAAMC,KAAQC,GAEjB,AADAH,EAAI,KAAK;IAAE;IAAM;IAAU;GAAM,CAAC,GAC9BE,EAAK,YAAYnB,EAAS,IAAImB,EAAK,EAAE,KAAGD,EAAKC,EAAK,UAAU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CAAI;GACb;EACF;EACA,IAAMsD,IAAOtD,EAAK,WAAWmD,EAAWnD,EAAK,UAAUqD,CAAK,IAAI,CAAC;EACjE,IAAIC,EAAK,WAAW,GAAG;GACrB,IAAU;GACV;EACF;EAEA,AADIA,MAAStD,EAAK,aAAU,IAAU,KACtCF,EAAI,KAAKwD,MAAStD,EAAK,WAAWA,IAAO;GAAE,GAAGA;GAAM,UAAUsD;EAAK,CAAC;CACtE;CACA,OAAOF,IAAUtD,IAAMK;AACzB;AAGA,SAAgBoD,EAAc,GAAsC;CAClE,IAAMzD,IAAgB,CAAC,GACjBC,KAAQ,MAA8B;EAC1C,KAAK,IAAMC,KAAQC,GACjB,AAAKD,EAAK,aACVF,EAAI,KAAKE,EAAK,EAAE,GAChBD,EAAKC,EAAK,QAAQ;CAEtB;CAEA,OADAD,EAAKI,CAAK,GACHL;AACT;AAEA,SAASyC,EAAO,GAAwB;CACtC,OAAOvC,EAAK,cAAc,OAAOA,EAAK,SAAU,WAAWA,EAAK,QAAQ;AAC1E;AAEA,SAAS+B,EAAO,GAA+F;CAC7G,OAAO;EAAE,UAAU,EAAE;EAAU,SAAS,EAAE;EAAS,SAAS,EAAE;EAAS,QAAQ,EAAE;CAAO;AAC1F;AAEA,SAAShD,EACP,GACA,GACA,GACoD;CACpD,IAAM,CAACyE,GAAKC,KAAU9C,QAAoC,IAAI,IAAI+C,CAAO,CAAC;CAM1E,OAAO,CALY7D,QAAe8D,MAAU,KAAA,IAAY,KAAA,IAAY,IAAI,IAAIA,CAAK,GAAI,CAACA,CAAK,CAKnF,KAAcH,IAJT,MAAsB;EAEjC,AADIG,MAAU,KAAA,KAAWF,EAAOrC,CAAI,GACpCwC,IAAWxC,CAAI;CACjB,CAC8B;AAChC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"checkbox.module-DLQV9tMX.js","names":["checkbox_module_default"],"sources":["../../src/components/checkbox.module.css"],"sourcesContent":["/* The one skin for a native <input type=\"checkbox\">. Imported by Checkbox and by\n the property rows, which render the same DOM. The box keys off the input's own\n pseudo-classes; a label's hover reaches its control's :hover. */\n.checkbox {\n appearance: none;\n -webkit-appearance: none;\n position: relative;\n flex: 0 0 auto;\n box-sizing: border-box;\n width: 14px;\n height: 14px;\n margin: 0;\n background: var(--wzl-surface-sunken);\n border: 1px solid var(--wzl-border-strong);\n border-radius: var(--wzl-radius-sm);\n cursor: pointer;\n transition: background-color var(--wzl-motion-fast), border-color var(--wzl-motion-fast), box-shadow var(--wzl-motion-fast);\n}\n\n.checkbox:hover:not(:disabled) {\n border-color: var(--wzl-fg-muted);\n}\n\n.checkbox:focus-visible {\n outline: none;\n box-shadow: 0 0 0 2px var(--wzl-focus-ring);\n}\n\n.checkbox:checked,\n.checkbox:indeterminate {\n background: var(--wzl-accent-strong);\n border-color: var(--wzl-accent-strong);\n}\n\n.checkbox[aria-invalid='true'] {\n border-color: var(--wzl-danger);\n}\n\n/* The mark is a mask filled with the on-accent color, so it follows the theme. */\n.checkbox:checked::before,\n.checkbox:indeterminate::before {\n content: '';\n position: absolute;\n inset: 0;\n background: var(--wzl-fg-on-accent);\n -webkit-mask: var(--_check-mark) center / 100% 100% no-repeat;\n mask: var(--_check-mark) center / 100% 100% no-repeat;\n}\n\n.checkbox:checked {\n --_check-mark: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'%3E%3Cpolyline points='3,7.5 6,10.5 11,4.5' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E\");\n}\n\n.checkbox:indeterminate {\n --_check-mark: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'%3E%3Cline x1='3' y1='7' x2='11' y2='7' stroke='black' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E\");\n}\n\n.checkbox:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n}\n"],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"icons-Dr2-r30x.js","names":["Icon","UnknownIcon$1","CloneIcon","p","ResetIcon","CloseIcon","ExportIcon","ZoomInIcon","PanIcon","AddIcon","ModeLightIcon","ModeDarkIcon","ModeAutoIcon","RemoveIcon","SortIcon","ZoomOutIcon","FitIcon","SnapshotIcon","PlayIcon","PauseIcon","StopIcon","StepBackIcon","StepForwardIcon","StepIcon","CrosshairIcon","FullscreenIcon","CompareIcon","FilterIcon","SearchIcon","LoupeIcon","LayersIcon","PageIcon","LockIcon","UnlockIcon","VisibleIcon","HiddenIcon","PinIcon","LinkIcon","CollapseIcon","ExpandIcon","ChevronIcon","TuneIcon","GridIcon","SnapIcon","MeasureIcon","RandomizeIcon","RefreshIcon","InfoIcon","WarningIcon","ErrorIcon","BusyIcon","CheckIcon","LayoutRowsIcon","LayoutColumnsIcon","LayoutGridIcon","UngroupIcon","DistributeVerticalIcon","TextIcon","GroupIcon","LineIcon","HandIcon","FlipXIcon","FlipYIcon","DistributeHorizontalIcon","StarIcon","EllipseIcon","LassoIcon","SendBackwardIcon","AlignLeftIcon","PencilIcon","CutIcon","ArrowIcon","PolygonIcon","RedoIcon","SelectIcon","AlignCenterYIcon","PenIcon","EyedropperIcon","UndoIcon","BringForwardIcon","AlignBottomIcon","PasteIcon","AlignRightIcon","AlignCenterXIcon","AlignTopIcon","BringToFrontIcon","RectIcon","CopyIcon","SendToBackIcon","DuplicateIcon","DeleteIcon","ImageIcon"],"sources":["../../src/icons/index.tsx"],"sourcesContent":["import { Icon, type IconProps } from './Icon';\n\nexport { Icon, isFillable } from './Icon';\nexport type { IconProps } from './Icon';\nexport { ICON_FILLS, ICON_GROUPS, ICON_PATHS } from './paths';\nexport type { FillableIconName, IconName } from './paths';\n\n// Tool glyphs live in @weasel-js/core because core needs them for\n// `Tool.presentation.icon` defaults and cannot depend on this package.\n// Re-exported here so consumers have one import site for the whole set.\nexport {\n SelectIcon, LassoIcon, RectIcon, EllipseIcon, ImageIcon, EyedropperIcon,\n LineIcon, ArrowIcon, PolygonIcon, StarIcon, PencilIcon, TextIcon, PenIcon, HandIcon,\n UnknownIcon,\n} from '@weasel-js/core';\n// The standard edit actions' glyphs live beside those actions in core, for the\n// same reason.\nexport {\n CutIcon, CopyIcon, PasteIcon, DuplicateIcon, GroupIcon, UngroupIcon,\n BringForwardIcon, BringToFrontIcon, SendBackwardIcon, SendToBackIcon, FlipXIcon, FlipYIcon,\n UndoIcon, RedoIcon, DeleteIcon,\n AlignLeftIcon, AlignCenterXIcon, AlignRightIcon, AlignTopIcon, AlignCenterYIcon, AlignBottomIcon,\n DistributeHorizontalIcon, DistributeVerticalIcon,\n} from '@weasel-js/core';\n\n/** Clone: a ruled card with a second one tucked behind it. */\nexport const CloneIcon = (p: IconProps) => <Icon name=\"clone\" {...p} />;\n/** Reset: a near-full counterclockwise arc, arrowhead at the top. */\nexport const ResetIcon = (p: IconProps) => <Icon name=\"reset\" {...p} />;\n/** Close: an X. */\nexport const CloseIcon = (p: IconProps) => <Icon name=\"close\" {...p} />;\n/** Export: an arrow pointing down into an open tray. */\nexport const ExportIcon = (p: IconProps) => <Icon name=\"export\" {...p} />;\n/** Zoom in: a magnifier with a plus. */\nexport const ZoomInIcon = (p: IconProps) => <Icon name=\"zoomIn\" {...p} />;\n/** Pan: four arrows out from a hub. */\nexport const PanIcon = (p: IconProps) => <Icon name=\"pan\" {...p} />;\n/** Add: a plus. */\nexport const AddIcon = (p: IconProps) => <Icon name=\"add\" {...p} />;\n/** Light color mode: a sun. */\nexport const ModeLightIcon = (p: IconProps) => <Icon name=\"modeLight\" {...p} />;\n/** Dark color mode: a crescent moon. */\nexport const ModeDarkIcon = (p: IconProps) => <Icon name=\"modeDark\" {...p} />;\n/** Automatic color mode: a four-pointed sparkle. */\nexport const ModeAutoIcon = (p: IconProps) => <Icon name=\"modeAuto\" {...p} />;\n/** Remove: a minus. */\nexport const RemoveIcon = (p: IconProps) => <Icon name=\"remove\" {...p} />;\n/** Sort: three ruled lines beside a downward arrow. */\nexport const SortIcon = (p: IconProps) => <Icon name=\"sort\" {...p} />;\n/** Zoom out: a magnifier with a minus. */\nexport const ZoomOutIcon = (p: IconProps) => <Icon name=\"zoomOut\" {...p} />;\n/** Fit: four corner brackets around a small rect. */\nexport const FitIcon = (p: IconProps) => <Icon name=\"fit\" {...p} />;\n/** Snapshot: a camera. */\nexport const SnapshotIcon = (p: IconProps) => <Icon name=\"snapshot\" {...p} />;\n/** Play: a right-pointing triangle. */\nexport const PlayIcon = (p: IconProps) => <Icon name=\"play\" {...p} />;\n/** Pause: two vertical bars. */\nexport const PauseIcon = (p: IconProps) => <Icon name=\"pause\" {...p} />;\n/** Stop: a rounded square. */\nexport const StopIcon = (p: IconProps) => <Icon name=\"stop\" {...p} />;\n/** Step back: a left-pointing triangle against a bar. */\nexport const StepBackIcon = (p: IconProps) => <Icon name=\"stepBack\" {...p} />;\n/** Step forward: a right-pointing triangle against a bar. */\nexport const StepForwardIcon = (p: IconProps) => <Icon name=\"stepForward\" {...p} />;\n/** @deprecated Use {@link StepForwardIcon}; `step` alone stopped naming a direction. */\nexport const StepIcon = StepForwardIcon;\n/** Crosshair: a ring with four ticks on the axes. */\nexport const CrosshairIcon = (p: IconProps) => <Icon name=\"crosshair\" {...p} />;\n/** Fullscreen: two corner arrows pointing out diagonally. */\nexport const FullscreenIcon = (p: IconProps) => <Icon name=\"fullscreen\" {...p} />;\n/** Compare: a frame split into two columns of lines. */\nexport const CompareIcon = (p: IconProps) => <Icon name=\"compare\" {...p} />;\n/** Filter: a funnel. */\nexport const FilterIcon = (p: IconProps) => <Icon name=\"filter\" {...p} />;\n/** Search: an empty magnifier. */\nexport const SearchIcon = (p: IconProps) => <Icon name=\"search\" {...p} />;\n/** Loupe: a magnifier over a grid of pixels. */\nexport const LoupeIcon = (p: IconProps) => <Icon name=\"loupe\" {...p} />;\n/** Layers: a stack of three sheets. */\nexport const LayersIcon = (p: IconProps) => <Icon name=\"layers\" {...p} />;\n/** Page: a document with a folded corner. */\nexport const PageIcon = (p: IconProps) => <Icon name=\"page\" {...p} />;\n/** Lock: a closed padlock. */\nexport const LockIcon = (p: IconProps) => <Icon name=\"lock\" {...p} />;\n/** Unlock: an open padlock. */\nexport const UnlockIcon = (p: IconProps) => <Icon name=\"unlock\" {...p} />;\n/** Visible: an eye. */\nexport const VisibleIcon = (p: IconProps) => <Icon name=\"visible\" {...p} />;\n/** Hidden: an eye struck through. */\nexport const HiddenIcon = (p: IconProps) => <Icon name=\"hidden\" {...p} />;\n/** Pin: a push pin. */\nexport const PinIcon = (p: IconProps) => <Icon name=\"pin\" {...p} />;\n/** Link: two chain links. */\nexport const LinkIcon = (p: IconProps) => <Icon name=\"link\" {...p} />;\n/** Collapse: two chevrons pointing inward. */\nexport const CollapseIcon = (p: IconProps) => <Icon name=\"collapse\" {...p} />;\n/** Expand: two chevrons pointing outward. */\nexport const ExpandIcon = (p: IconProps) => <Icon name=\"expand\" {...p} />;\n/** Chevron: a downward disclosure mark, centered to spin in place under `rotate()`. */\nexport const ChevronIcon = (p: IconProps) => <Icon name=\"chevron\" {...p} />;\n/** Tune: three slider tracks with their knobs. */\nexport const TuneIcon = (p: IconProps) => <Icon name=\"tune\" {...p} />;\n/** Grid: an outlined 3x3 grid — the grid to snap to. */\nexport const GridIcon = (p: IconProps) => <Icon name=\"grid\" {...p} />;\n/** Snap: a horseshoe magnet. */\nexport const SnapIcon = (p: IconProps) => <Icon name=\"snap\" {...p} />;\n/** Measure: a ruler. */\nexport const MeasureIcon = (p: IconProps) => <Icon name=\"measure\" {...p} />;\n/** Randomize: a die showing three. */\nexport const RandomizeIcon = (p: IconProps) => <Icon name=\"randomize\" {...p} />;\n/** Refresh: two arcs chasing each other around a circle. */\nexport const RefreshIcon = (p: IconProps) => <Icon name=\"refresh\" {...p} />;\n/** Info: an i in a ring. */\nexport const InfoIcon = (p: IconProps) => <Icon name=\"info\" {...p} />;\n/** Warning: an exclamation mark in a triangle. */\nexport const WarningIcon = (p: IconProps) => <Icon name=\"warning\" {...p} />;\n/** Error: an X in a ring. */\nexport const ErrorIcon = (p: IconProps) => <Icon name=\"error\" {...p} />;\n/** Busy: a three-quarter arc, for a spinner. */\nexport const BusyIcon = (p: IconProps) => <Icon name=\"busy\" {...p} />;\n/** Check: a check mark. */\nexport const CheckIcon = (p: IconProps) => <Icon name=\"check\" {...p} />;\n/** Row layout: three filled horizontal bars. */\nexport const LayoutRowsIcon = (p: IconProps) => <Icon name=\"layoutRows\" {...p} />;\n/** Column layout: three filled vertical bars. */\nexport const LayoutColumnsIcon = (p: IconProps) => <Icon name=\"layoutColumns\" {...p} />;\n/** Grid layout: a filled 3x3 of cells. */\nexport const LayoutGridIcon = (p: IconProps) => <Icon name=\"layoutGrid\" {...p} />;\n"],"mappings":";;;;AA0BA,IAAaE,KAAa,MAAiB,kBAACF,GAAD;CAAM,MAAK;CAAQ,GAAIG;AAAI,CAAA,GAEzDC,KAAa,MAAiB,kBAACJ,GAAD;CAAM,MAAK;CAAQ,GAAIG;AAAI,CAAA,GAEzDE,KAAa,MAAiB,kBAACL,GAAD;CAAM,MAAK;CAAQ,GAAIG;AAAI,CAAA,GAEzDG,KAAc,MAAiB,kBAACN,GAAD;CAAM,MAAK;CAAS,GAAIG;AAAI,CAAA,GAE3DI,KAAc,MAAiB,kBAACP,GAAD;CAAM,MAAK;CAAS,GAAIG;AAAI,CAAA,GAE3DK,KAAW,MAAiB,kBAACR,GAAD;CAAM,MAAK;CAAM,GAAIG;AAAI,CAAA,GAErDM,KAAW,MAAiB,kBAACT,GAAD;CAAM,MAAK;CAAM,GAAIG;AAAI,CAAA,GAErDO,KAAiB,MAAiB,kBAACV,GAAD;CAAM,MAAK;CAAY,GAAIG;AAAI,CAAA,GAEjEQ,KAAgB,MAAiB,kBAACX,GAAD;CAAM,MAAK;CAAW,GAAIG;AAAI,CAAA,GAE/DS,MAAgB,MAAiB,kBAACZ,GAAD;CAAM,MAAK;CAAW,GAAIG;AAAI,CAAA,GAE/D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G;AAAI,CAAA,GAE7D4C,MAAY,MAAiB,kBAAC/C,GAAD;CAAM,MAAK;CAAO,GAAIG;AAAI,CAAA,GAEvD6C,MAAe,MAAiB,kBAAChD,GAAD;CAAM,MAAK;CAAU,GAAIG;AAAI,CAAA,GAE7D8C,MAAa,MAAiB,kBAACjD,GAAD;CAAM,MAAK;CAAQ,GAAIG;AAAI,CAAA,GAEzD+C,MAAY,MAAiB,kBAAClD,GAAD;CAAM,MAAK;CAAO,GAAIG;AAAI,CAAA,GAEvDgD,MAAa,MAAiB,kBAACnD,GAAD;CAAM,MAAK;CAAQ,GAAIG;AAAI,CAAA,GAEzDiD,MAAkB,MAAiB,kBAACpD,GAAD;CAAM,MAAK;CAAa,GAAIG;AAAI,CAAA,GAEnEkD,MAAqB,MAAiB,kBAACrD,GAAD;CAAM,MAAK;CAAgB,GAAIG;AAAI,CAAA,GAEzEmD,MAAkB,MAAiB,kBAACtD,GAAD;CAAM,MAAK;CAAa,GAAIG;AAAI,CAAA"}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
//#region src/interactiveTarget.ts
|
|
2
|
-
var e = [
|
|
3
|
-
"button",
|
|
4
|
-
"input",
|
|
5
|
-
"select",
|
|
6
|
-
"textarea",
|
|
7
|
-
"a[href]",
|
|
8
|
-
"[contenteditable=\"\"]",
|
|
9
|
-
"[contenteditable=\"true\"]",
|
|
10
|
-
"[role=\"button\"]",
|
|
11
|
-
"[role=\"checkbox\"]",
|
|
12
|
-
"[role=\"switch\"]",
|
|
13
|
-
"[role=\"menuitem\"]",
|
|
14
|
-
"[role=\"link\"]"
|
|
15
|
-
].join(",");
|
|
16
|
-
function t(t, n) {
|
|
17
|
-
if (!(t instanceof Element)) return !1;
|
|
18
|
-
let r = t.closest(e);
|
|
19
|
-
return r !== null && r !== n && n.contains(r);
|
|
20
|
-
}
|
|
21
|
-
//#endregion
|
|
22
|
-
export { t as n, e as t };
|
|
23
|
-
|
|
24
|
-
//# sourceMappingURL=interactiveTarget-BNZmTow2.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"interactiveTarget-BNZmTow2.js","names":["CONTROL_SELECTOR","isInControlWithin","target","control","host"],"sources":["../../src/interactiveTarget.ts"],"sourcesContent":["/** Elements that handle their own press and keys. */\nexport const CONTROL_SELECTOR = [\n 'button', 'input', 'select', 'textarea', 'a[href]', '[contenteditable=\"\"]', '[contenteditable=\"true\"]',\n '[role=\"button\"]', '[role=\"checkbox\"]', '[role=\"switch\"]', '[role=\"menuitem\"]', '[role=\"link\"]',\n].join(',');\n\n/**\n * Whether `target` sits in a control of its own somewhere inside `host` — a\n * toggle in a list row. The host's handlers leave such an event to the\n * control, so a row's press, click and keys never swallow its controls'.\n */\nexport function isInControlWithin(target: EventTarget | null, host: Element): boolean {\n if (!(target instanceof Element)) return false;\n const control = target.closest(CONTROL_SELECTOR);\n return control !== null && control !== host && host.contains(control);\n}\n"],"mappings":";AACA,IAAaA,IAAmB;CAC9B;CAAU;CAAS;CAAU;CAAY;CAAW;CAAwB;CAC5E;CAAmB;CAAqB;CAAmB;CAAqB;AAClF,CAAC,CAAC,KAAK,GAAG;AAOV,SAAgBC,EAAkB,GAA4B,GAAwB;CACpF,IAAI,EAAEC,aAAkB,UAAU,OAAO;CACzC,IAAMC,IAAUD,EAAO,QAAQF,CAAgB;CAC/C,OAAOG,MAAY,QAAQA,MAAYC,KAAQA,EAAK,SAASD,CAAO;AACtE"}
|