@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":"ItemList-CRu9y7hL.js","names":["s","_Fragment","isInControlWithin","DragGhost","ItemList_module_default","ROLES","ItemList","forwardRef","mode","rows","r","onActivate","selection","interactive","container","setContainer","useState","setRefs","useCallback","el","ref","targets","useRef","focusId","setFocusId","pendingFocus","anchor","extending","stopId","useLayoutEffect","id","target","CONTROL_SELECTOR","c","cls","className","containerProps","empty","focusRow","row","index","ranges","onSelectRange","moveTo","to","extend","at","from","onKeyDown","e","onTarget","controlCell","delta","onNudge","i","modsOf","controls","onClick","onFocus","targetRef","roles","overlay","ghost","tabIndex","content","Fragment","dropSide","dropIndex","count"],"sources":["../../src/components/ItemList/ItemList.tsx"],"sourcesContent":["import {\n forwardRef,\n useCallback,\n useLayoutEffect,\n useRef,\n useState,\n type FocusEvent,\n type HTMLAttributes,\n type KeyboardEvent,\n type MouseEvent,\n type ReactNode,\n type Ref,\n} from 'react';\nimport { CONTROL_SELECTOR, isInControlWithin } from '../../interactiveTarget';\nimport type { PressModifiers, ReorderGhost } from '../../useReorderDragList';\nimport { DragGhost } from '../DragGhost';\nimport s from './ItemList.module.css';\n\n/** One row. `id` is the React key. */\nexport interface ItemListRow {\n id: string;\n label: ReactNode;\n /** Fixed-size decoration before the label — a color swatch. Not a control:\n * those go in `trailing`. */\n leading?: ReactNode;\n /** Buttons and toggles after the label — visibility, lock. They keep their\n * own clicks and keys, and turn the list into a grid. A control that edits\n * with the arrow keys does not belong here. */\n trailing?: ReactNode;\n /** The row the list considers current. With `selection` set this is also\n * `aria-selected`. */\n selected?: boolean;\n /** Present but not in effect — history's redo entries. */\n muted?: boolean;\n /** Part of a drag in progress — `useReorderDragList`'s `state.draggedIds`. */\n dragging?: boolean;\n /** Consumer classes for states this component has no opinion about. */\n className?: string;\n /** Handlers and data attributes for this row's element. `data-*` is\n * spelled out because `HTMLAttributes` does not admit it, and every\n * consumer here marks its rows up with one. A handler here runs before the\n * list's own, and `preventDefault()` in it keeps the list out. */\n rowProps?: HTMLAttributes<HTMLDivElement> & Record<`data-${string}`, unknown>;\n}\n\n/** Props for {@link ItemList}. */\nexport interface ItemListProps {\n rows: readonly ItemListRow[];\n /** Shown in place of the rows when there are none. */\n empty?: ReactNode;\n className?: string;\n /**\n * Whether rows are selectable, and how many at once. The list reports\n * `selected` to assistive tech; choosing what is selected stays with\n * `onActivate`.\n */\n selection?: 'single' | 'multi';\n /**\n * A row was clicked, or Enter/Space was pressed on it, with the modifiers\n * held. Clicks and keys on a row's `trailing` controls do not reach this.\n */\n onActivate?(id: string, index: number, mods: PressModifiers): void;\n /**\n * Alt+Up (`-1`) or Alt+Down (`1`) on a row: move it. Focus stays on the\n * row wherever it lands. `useReorderDragList`'s `nudge` fits as-is.\n */\n onNudge?(id: string, index: number, delta: -1 | 1): void;\n /**\n * With `selection=\"multi\"`: Shift+Up/Down or Shift+Home/End moved focus,\n * and `ids` is every row from the anchor to the newly focused one, in list\n * order. The anchor is the row last focused or activated other than by a\n * range move, so a click or a plain arrow move re-anchors. What the range does to\n * the selection stays with the consumer, as with `onActivate`. Without it,\n * Shift+Arrow only moves focus.\n */\n onSelectRange?(ids: string[]): void;\n /**\n * Where a drop would land, as an insertion index: `0` is above the first\n * row, `rows.length` below the last. The list draws the seam itself, from\n * the rows' own boxes, so it follows whatever height the density gives\n * them. `useReorderDragList`'s `state.targetIndex` goes here as-is.\n */\n dropIndex?: number | null;\n /** Rendered inside the container ahead of the rows. */\n overlay?: ReactNode;\n /** Spread onto the container: pointer handlers for a drag, `aria-label`. */\n containerProps?: HTMLAttributes<HTMLDivElement>;\n /** Rows to draw again under the pointer during a drag — `useReorderDragList`'s `state.ghost`. */\n ghost?: ReorderGhost | null;\n}\n\ntype Mode = 'list' | 'listbox' | 'grid';\n\nconst ROLES: Record<Mode, { container: string; row: string }> = {\n list: { container: 'list', row: 'listitem' },\n listbox: { container: 'listbox', row: 'option' },\n grid: { container: 'grid', row: 'row' },\n};\n\n/**\n * The row chrome behind a sidebar list — layers, history, anything that is a\n * flat column of selectable rows in a panel.\n *\n * It owns the container, the row box, the empty state, the list's semantics\n * and its keyboard; what a row *means* stays with the consumer. History dims\n * its redo entries and rules a line under the current one; a layer list drags\n * to reorder and leads each row with a swatch. Both reach that through\n * `className` and `rowProps` rather than through options here, so this does\n * not grow a flag per consumer.\n *\n * Rows are one height and one inset for every list, which is the point: two\n * panels stacked in the same sidebar have to agree, and they did not while\n * each owned a private copy of the same CSS.\n *\n * **Semantics.** The role follows what the list can do:\n * - nothing to select or activate → `list` / `listitem`, and no row is focusable;\n * - `selection` with no row controls → `listbox` / `option`, `aria-selected`;\n * - any row with `trailing` controls, or `onActivate` without `selection` →\n * `grid` / `row`, with the leading content and label in one `gridcell` and\n * the controls in a second. An option may not contain interactive content,\n * so a list whose rows host toggles cannot be a listbox.\n *\n * **Keyboard.** One row is in the tab order: the one last focused, else the\n * first selected, else the first. Up/Down and Home/End move between rows,\n * Enter/Space activate, carrying modifiers so Shift+Space is Shift+click, and\n * Alt+Up/Down call `onNudge`. In a multi-select list with `onSelectRange`,\n * Shift+Up/Down and Shift+Home/End move focus and report the rows from the\n * anchor — the row last focused or activated other than by a range — to it. In a grid, Right steps from the row into its\n * controls, Left and Escape step back; the controls leave the tab order.\n */\nexport const ItemList = forwardRef(function ItemList(\n {\n rows, empty, className, selection, onActivate, onNudge, onSelectRange, dropIndex, overlay,\n containerProps, ghost,\n }: ItemListProps,\n ref: Ref<HTMLDivElement>,\n) {\n const hasTrailing = rows.some((r) => r.trailing != null);\n const mode: Mode = hasTrailing || (onActivate && !selection)\n ? 'grid'\n : selection ? 'listbox' : 'list';\n const interactive = mode !== 'list';\n\n const [container, setContainer] = useState<HTMLDivElement | null>(null);\n const setRefs = useCallback(\n (el: HTMLDivElement | null) => {\n setContainer(el);\n if (typeof ref === 'function') ref(el);\n else if (ref) ref.current = el;\n },\n [ref],\n );\n\n /** The element of each row that takes focus: the row itself, or in a grid its label cell. */\n const targets = useRef(new Map<string, HTMLElement>());\n const [focusId, setFocusId] = useState<string | null>(null);\n const pendingFocus = useRef<string | null>(null);\n const anchor = useRef<string | null>(null);\n /** The row a range move is focusing, whose focus must not re-anchor. */\n const extending = useRef<string | null>(null);\n\n const stopId = rows.some((r) => r.id === focusId)\n ? focusId\n : (rows.find((r) => r.selected) ?? rows[0])?.id;\n\n useLayoutEffect(() => {\n const id = pendingFocus.current;\n if (id == null) return;\n pendingFocus.current = null;\n const el = targets.current.get(id);\n if (el && document.activeElement !== el) el.focus();\n });\n\n useLayoutEffect(() => {\n if (mode !== 'grid') return;\n for (const target of targets.current.values()) {\n const cell = target.parentElement?.querySelector(`.${s.trailing}`);\n cell?.querySelectorAll(CONTROL_SELECTOR).forEach((c) => c.setAttribute('tabindex', '-1'));\n }\n });\n\n const cls = [s.list, className].filter(Boolean).join(' ');\n if (rows.length === 0) {\n return (\n <div className={cls} ref={setRefs} {...containerProps}>\n <div className={s.empty}>{empty ?? '—'}</div>\n </div>\n );\n }\n\n const focusRow = (index: number) => {\n const row = rows[Math.max(0, Math.min(rows.length - 1, index))];\n if (row) targets.current.get(row.id)?.focus();\n };\n\n const ranges = selection === 'multi' && onSelectRange !== undefined;\n\n /** Moves focus to `index`: a range from the anchor when `extend`, else a plain move. */\n const moveTo = (from: ItemListRow, index: number, extend: boolean) => {\n const to = Math.max(0, Math.min(rows.length - 1, index));\n if (!extend || !ranges) {\n focusRow(to);\n return;\n }\n let at = rows.findIndex((r) => r.id === anchor.current);\n if (at < 0) {\n anchor.current = from.id;\n at = rows.indexOf(from);\n }\n extending.current = rows[to]!.id;\n focusRow(to);\n extending.current = null;\n onSelectRange(rows.slice(Math.min(at, to), Math.max(at, to) + 1).map((r) => r.id));\n };\n\n const onKeyDown = (row: ItemListRow, i: number) => (e: KeyboardEvent<HTMLDivElement>) => {\n row.rowProps?.onKeyDown?.(e);\n if (e.defaultPrevented) return;\n const target = targets.current.get(row.id);\n if (!target) return;\n const onTarget = e.target === target;\n const controlCell = mode === 'grid'\n ? e.currentTarget.querySelector<HTMLElement>(`.${s.trailing}`)\n : null;\n if (!onTarget && !controlCell?.contains(e.target as Node)) return;\n\n switch (e.key) {\n case 'ArrowDown':\n case 'ArrowUp': {\n e.preventDefault();\n const delta = e.key === 'ArrowDown' ? 1 : -1;\n if (e.altKey && onNudge && onTarget) {\n pendingFocus.current = row.id;\n onNudge(row.id, i, delta);\n } else {\n moveTo(row, i + delta, e.shiftKey);\n }\n return;\n }\n case 'Home':\n case 'End':\n if (!onTarget) return;\n e.preventDefault();\n moveTo(row, e.key === 'Home' ? 0 : rows.length - 1, e.shiftKey);\n return;\n case 'Enter':\n case ' ':\n if (!onTarget) return;\n e.preventDefault();\n anchor.current = row.id;\n onActivate?.(row.id, i, modsOf(e));\n return;\n case 'ArrowRight':\n case 'ArrowLeft':\n case 'Escape': {\n if (!controlCell) return;\n const controls = Array.from(controlCell.querySelectorAll<HTMLElement>(CONTROL_SELECTOR))\n .filter((c) => !c.matches(':disabled'));\n if (onTarget) {\n if (e.key !== 'ArrowRight' || !controls[0]) return;\n e.preventDefault();\n controls[0].focus();\n return;\n }\n e.preventDefault();\n const at = controls.findIndex((c) => c.contains(e.target as Node));\n if (e.key === 'ArrowRight') controls[at + 1]?.focus();\n else if (e.key === 'ArrowLeft' && at > 0) controls[at - 1]?.focus();\n else target.focus();\n return;\n }\n default:\n }\n };\n\n const onClick = (row: ItemListRow, i: number) => (e: MouseEvent<HTMLDivElement>) => {\n row.rowProps?.onClick?.(e);\n if (e.defaultPrevented || isInControlWithin(e.target, e.currentTarget)) return;\n anchor.current = row.id;\n onActivate?.(row.id, i, modsOf(e));\n };\n\n const onFocus = (row: ItemListRow) => (e: FocusEvent<HTMLDivElement>) => {\n row.rowProps?.onFocus?.(e);\n if (e.target !== targets.current.get(row.id)) return;\n setFocusId(row.id);\n if (extending.current !== row.id) anchor.current = row.id;\n };\n\n const targetRef = (id: string) => (el: HTMLElement | null) => {\n if (el) targets.current.set(id, el);\n else targets.current.delete(id);\n };\n\n const roles = ROLES[mode];\n return (\n <div\n className={cls}\n ref={setRefs}\n {...containerProps}\n role={roles.container}\n aria-multiselectable={selection === 'multi' && mode !== 'list' ? true : undefined}\n >\n {overlay}\n {ghost && container ? (\n <DragGhost at={ghost} from={container}>\n {rows\n .filter((row) => ghost.ids.includes(row.id))\n .map((row) => (\n <div key={row.id} className={[s.row, row.selected && s.selected].filter(Boolean).join(' ')}>\n {row.leading}\n <span className={s.label}>{row.label}</span>\n </div>\n ))}\n </DragGhost>\n ) : null}\n {rows.map((row, i) => {\n const tabIndex = interactive ? (row.id === stopId ? 0 : -1) : undefined;\n const content = (\n <>\n {row.leading}\n <span className={s.label}>{row.label}</span>\n </>\n );\n return (\n <div\n key={row.id}\n className={[\n s.row,\n row.selected && s.selected,\n row.muted && s.muted,\n row.className,\n ].filter(Boolean).join(' ')}\n {...row.rowProps}\n role={roles.row}\n aria-selected={selection && mode !== 'list' ? !!row.selected : undefined}\n ref={mode === 'listbox' ? targetRef(row.id) : undefined}\n tabIndex={mode === 'listbox' ? tabIndex : row.rowProps?.tabIndex}\n onKeyDown={interactive ? onKeyDown(row, i) : row.rowProps?.onKeyDown}\n onClick={interactive ? onClick(row, i) : row.rowProps?.onClick}\n onFocus={interactive ? onFocus(row) : row.rowProps?.onFocus}\n data-drop={dropSide(dropIndex, i, rows.length)}\n data-dragging={row.dragging ? 'true' : undefined}\n >\n {mode === 'grid' ? (\n <>\n <div role=\"gridcell\" className={s.cell} ref={targetRef(row.id)} tabIndex={tabIndex}>\n {content}\n </div>\n {row.trailing != null && (\n <div role=\"gridcell\" className={s.trailing}>{row.trailing}</div>\n )}\n </>\n ) : content}\n </div>\n );\n })}\n </div>\n );\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\n/** Which edge of row `i` carries the seam for `dropIndex`, if any. */\nfunction dropSide(\n dropIndex: number | null | undefined,\n i: number,\n count: number,\n): 'before' | 'after' | undefined {\n if (dropIndex == null) return undefined;\n if (dropIndex === i) return 'before';\n if (dropIndex >= count && i === count - 1) return 'after';\n return undefined;\n}\n"],"mappings":";;;;;;AA6FA,IAAMK,IAA0D;CAC9D,MAAM;EAAE,WAAW;EAAQ,KAAK;CAAW;CAC3C,SAAS;EAAE,WAAW;EAAW,KAAK;CAAS;CAC/C,MAAM;EAAE,WAAW;EAAQ,KAAK;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BN;GAET,CAAC;EACE;;AAET,CAAC;AAED,SAASgB,EAAO,GAA+F;CAC7G,OAAO;EAAE,UAAU,EAAE;EAAU,SAAS,EAAE;EAAS,SAAS,EAAE;EAAS,QAAQ,EAAE;CAAO;AAC1F;AAGA,SAASW,EACP,GACA,GACA,GACgC;CAChC,IAAIC,KAAa,MACjB;MAAIA,MAAcb,GAAG,OAAO;EAC5B,IAAIa,KAAaC,KAASd,MAAMc,IAAQ,GAAG,OAAO;CADtB;AAG9B"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Keycaps-C-FJyG8k.js","names":["s","s","Fragment","Fragment$1","Keycaps_module_default","MOD_BY_PLATFORM","MODIFIER_LABELS","byPlatform","byLegend","detectPlatform","raw","keySpecsFromMods","platform","opts","legend","mods","label","m","NAMED_KEY","keySpecFromKey","entry","WIDE_GLYPHS","inferKeycapKind","KeyCap","resolvedStyle","font","style","className","variant","inverted","KeySequence","keys","ordered","a","b","k","sepBefore","i","joins","separator","keySpecsFromShortcut","shortcut","key"],"sources":["../../src/components/Keycaps/Keycaps.module.css","../../src/components/Keycaps/keySpecsFromMods.ts","../../src/components/Keycaps/Keycap.tsx","../../src/components/Keycaps/Keycaps.tsx","../../src/components/Keycaps/keySpecsFromShortcut.ts"],"sourcesContent":["/* Keystroke \"key cap\" styling — each modifier and key in its own bordered chip. */\n.keys,\n.key {\n --key-h: var(--wzl-control-h-xs);\n}\n\n.keys {\n display: inline-flex;\n gap: 3px;\n /* Bottom-align so chips with text labels and chips with icon glyphs\n (arrows, modifier symbols) line up at the same bottom edge. Baseline\n drifts because text baselines sit above icon centers. */\n align-items: flex-end;\n /* When this whole sequence sits inline in surrounding text (e.g.\n \"Press <KeySequence> to confirm.\"), the row anchors to the\n surrounding line's bottom edge, not its baseline. */\n vertical-align: bottom;\n flex-wrap: wrap;\n}\n\n.keysEmpty {\n color: var(--wzl-fg-muted);\n}\n\n.sep {\n /* A key's height, so the glyph centers on the keys rather than riding the\n row's bottom edge. */\n display: inline-flex;\n align-items: center;\n height: var(--key-h);\n color: var(--wzl-fg-muted);\n font-size: var(--wzl-font-size-sm);\n line-height: 1;\n}\n\n.key {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n box-sizing: border-box;\n height: var(--key-h);\n padding: 0 var(--wzl-space-2);\n /* Light face, slightly-darker-than-face border, dark glyph — reads as\n a real keycap rather than a recessed slot in the panel. */\n background: var(--wzl-fg);\n border: 1px solid #25272c;\n border-bottom-width: 2px;\n border-radius: var(--wzl-radius-sm);\n color: var(--wzl-surface);\n /* Keycaps are a deliberate exception to the site theme — the design-\n system UI font (often a display face like Oswald) is wrong for\n keyboard chips. Use a neutral sans stack so labels read like real\n key legends. Consumers wanting a specific face per chip pass the\n `font` prop on KeyCap. */\n font-family: ui-sans-serif, system-ui, sans-serif;\n font-size: var(--wzl-font-size-sm);\n font-weight: var(--wzl-font-weight-bold);\n line-height: 1;\n}\n\n/* Default chip is square — letters, digits, and single glyphs (⎋ ⌫ ↑ etc.)\n sit in a uniform key-cap box. */\n.key[data-kind='square'] {\n width: var(--key-h);\n padding: 0;\n}\n\n/* Modifiers (⌘ ⇪ ⌥ ⌃) are wider to match the visual weight of how they\n appear on a real keyboard — and to differentiate them from the keys\n they modify in a stack. */\n.key[data-kind='modifier'] {\n min-width: 26px;\n padding: 0 var(--wzl-space-3);\n}\n\n/* Tab / Enter / Space — actual wide keys on a real keyboard. */\n.key[data-kind='wide'] {\n min-width: 32px;\n padding: 0 var(--wzl-space-4);\n}\n\n/* Optional/inverted (default variant): face flips to dark; legend drops\n to 60% opacity; dotted border drops to 40% opacity. Three soft cues\n stacked for \"may be held but isn't required.\" */\n.key[data-inverted] {\n background: var(--wzl-surface);\n color: color-mix(in srgb, var(--wzl-fg) 60%, transparent);\n border-style: dotted;\n border-color: color-mix(in srgb, var(--wzl-fg) 40%, transparent);\n border-width: 1.5px;\n border-bottom-width: 1.5px;\n}\n\n/* Minimal variant — no fill, borders and legend follow currentColor.\n Useful inline in colored prose / next to colored badges where the\n chip should take the surrounding text color. */\n.key[data-variant='minimal'] {\n background: transparent;\n border-color: currentColor;\n color: currentColor;\n}\n\n/* Optional + minimal: dotted border at full currentColor, legend at full\n currentColor. The dotted pattern alone carries the \"optional\" cue here\n — minimal's whole point is to defer color to the surrounding context,\n so dimming would fight that. (Default variant uses graded opacity as a\n stacked cue; minimal keeps it crisp.) */\n.key[data-variant='minimal'][data-inverted] {\n border-style: dotted;\n border-color: currentColor;\n color: currentColor;\n border-width: 1.5px;\n border-bottom-width: 1.5px;\n}\n","import type { KeySpec } from './Keycaps';\n\n/** Logical modifier name. Matches the kit's `ModifierKey` in shape — kept as a\n * local type so `weasel-ui` stays independent of `@weasel-js/core`. */\nexport type LogicalMod = 'mod' | 'shift' | 'alt' | 'ctrl' | 'meta';\n\n/** Detected (or overridden) platform. `'mod'` resolves to ⌘ on macOS,\n * Ctrl on Windows / Linux. */\nexport type Platform = 'macos' | 'windows' | 'linux';\n\n/** Visual form of a modifier or named-key label.\n *\n * - `'auto'` (default): the per-entry, per-platform default — whatever\n * label is actually printed on the physical key. macOS keys show the\n * Apple glyphs (⌘ ⌥ ⌃ ⇧ ⎋ ↵ ⇥). Windows keys mostly show text\n * (Ctrl, Alt, Shift) BUT the Win key shows its logo (⊞) and the\n * context-menu key shows ▤. Linux mirrors Windows with Super (⊞).\n * - `'symbol'` forces the Apple-style glyph everywhere a symbolic form\n * exists. Entries without a widely-recognized symbol still fall\n * back to text.\n * - `'text'` always spells the label out (Cmd / Option / Esc / Enter). */\nexport type LegendStyle = 'auto' | 'symbol' | 'text';\n\n/** A modifier to render, named platform-independently. */\nexport interface LogicalModSpec {\n name: LogicalMod;\n /** Marks this modifier as optional (may be held but isn't required).\n * Forwarded as the resulting `KeySpec.optional`. */\n optional?: boolean;\n}\n\n/** Options for {@link keySpecsFromMods}. */\nexport interface KeySpecsFromModsOptions {\n /** Override OS detection. Defaults to the detected platform, or\n * `'macos'` when detection is unavailable (e.g. in tests, or when\n * `navigator` is missing). */\n platform?: Platform;\n /** Defaults to `'auto'` (symbol on macOS, text everywhere else). Pass\n * `'symbol'` or `'text'` to force a specific style regardless of\n * platform. */\n legend?: LegendStyle;\n}\n\nconst MOD_BY_PLATFORM: Record<LogicalMod, Record<Platform, Record<LegendStyle, string>>> = {\n mod: {\n macos: { auto: '⌘', symbol: '⌘', text: 'Cmd' },\n windows: { auto: 'Ctrl', symbol: 'Ctrl', text: 'Ctrl' },\n linux: { auto: 'Ctrl', symbol: 'Ctrl', text: 'Ctrl' },\n },\n shift: {\n macos: { auto: '⇧', symbol: '⇧', text: 'Shift' },\n windows: { auto: '⇧', symbol: '⇧', text: 'Shift' },\n linux: { auto: '⇧', symbol: '⇧', text: 'Shift' },\n },\n alt: {\n macos: { auto: '⌥', symbol: '⌥', text: 'Option' },\n windows: { auto: 'Alt', symbol: 'Alt', text: 'Alt' },\n linux: { auto: 'Alt', symbol: 'Alt', text: 'Alt' },\n },\n ctrl: {\n macos: { auto: '⌃', symbol: '⌃', text: 'Control' },\n windows: { auto: 'Ctrl', symbol: 'Ctrl', text: 'Ctrl' },\n linux: { auto: 'Ctrl', symbol: 'Ctrl', text: 'Ctrl' },\n },\n // Windows/Linux Meta has a recognized symbol on the physical key (⊞ Win\n // logo / Super logo), so `auto` shows it. Use `text` for Win / Super.\n meta: {\n macos: { auto: '⌘', symbol: '⌘', text: 'Cmd' },\n windows: { auto: '⊞', symbol: '⊞', text: 'Win' },\n linux: { auto: '⊞', symbol: '⊞', text: 'Super' },\n },\n};\n\n/** Every label {@link keySpecsFromMods} can produce, on any platform and legend. */\nexport const MODIFIER_LABELS: ReadonlySet<string> = new Set(\n Object.values(MOD_BY_PLATFORM).flatMap((byPlatform) =>\n Object.values(byPlatform).flatMap((byLegend) => Object.values(byLegend)),\n ),\n);\n\n/** Detect the user's OS from the browser environment. UA sniffing — not\n * 100% reliable, but adequate for picking a modifier-glyph convention.\n * Falls back to `'macos'` (matches the kit's docs convention) when\n * `navigator` is unavailable. */\nexport function detectPlatform(): Platform {\n if (typeof navigator === 'undefined') return 'macos';\n // Prefer the modern userAgentData when available (Chromium-only today).\n const uaData = (navigator as Navigator & { userAgentData?: { platform?: string } }).userAgentData;\n const raw = (uaData?.platform ?? navigator.userAgent ?? '').toLowerCase();\n if (raw.includes('mac') || raw.includes('darwin') || raw.includes('iphone') || raw.includes('ipad')) return 'macos';\n if (raw.includes('win')) return 'windows';\n if (raw.includes('linux') || raw.includes('x11')) return 'linux';\n return 'macos';\n}\n\n/**\n * Map a list of **logical** modifiers (`'mod'`, `'shift'`, …) to **visual**\n * `KeySpec`s appropriate for the current platform.\n *\n * The kit-side gesture grammar uses logical names so the same route reads\n * correctly on every OS — `'mod'` means \"Cmd on Mac, Ctrl on Win/Linux\".\n * `KeySequence` is purely visual and renders the labels you give it; this\n * helper is the bridge.\n *\n * ```ts\n * <KeySequence\n * keys={keySpecsFromMods([{ name: 'mod' }, { name: 'shift', optional: true }])}\n * />\n * ```\n *\n * On a Mac: renders `⌘ ⇧`. On Windows: renders `Ctrl Shift`. Pass an\n * explicit `platform` to override detection (e.g. for docs that always\n * show the macOS form). Pass `legend: 'text'` to force \"Cmd\" over \"⌘\"\n * even on macOS.\n */\nexport function keySpecsFromMods(\n mods: readonly LogicalModSpec[],\n opts: KeySpecsFromModsOptions = {},\n): readonly KeySpec[] {\n const platform = opts.platform ?? detectPlatform();\n const legend = opts.legend ?? 'auto';\n return mods.map((m) => {\n const label = MOD_BY_PLATFORM[m.name][platform][legend];\n return m.optional ? { label, optional: true } : { label };\n });\n}\n\n/** Per-platform × per-legend table for named, non-modifier keys. `auto`\n * is whatever's printed on the physical key for that platform. Arrows\n * are universal symbols on every platform. */\nconst NAMED_KEY: Record<string, Record<Platform, Record<LegendStyle, string>>> = {\n Escape: { macos: { auto: '⎋', symbol: '⎋', text: 'Esc' }, windows: { auto: 'Esc', symbol: 'Esc', text: 'Esc' }, linux: { auto: 'Esc', symbol: 'Esc', text: 'Esc' } },\n Enter: { macos: { auto: '↵', symbol: '↵', text: 'Return' }, windows: { auto: 'Enter', symbol: 'Enter', text: 'Enter' }, linux: { auto: 'Enter', symbol: 'Enter', text: 'Enter' } },\n Return: { macos: { auto: '↵', symbol: '↵', text: 'Return' }, windows: { auto: 'Enter', symbol: 'Enter', text: 'Enter' }, linux: { auto: 'Enter', symbol: 'Enter', text: 'Enter' } },\n Tab: { macos: { auto: '⇥', symbol: '⇥', text: 'Tab' }, windows: { auto: 'Tab', symbol: 'Tab', text: 'Tab' }, linux: { auto: 'Tab', symbol: 'Tab', text: 'Tab' } },\n Space: { macos: { auto: '␣', symbol: '␣', text: 'Space' }, windows: { auto: 'Space', symbol: 'Space', text: 'Space' }, linux: { auto: 'Space', symbol: 'Space', text: 'Space' } },\n ' ': { macos: { auto: '␣', symbol: '␣', text: 'Space' }, windows: { auto: 'Space', symbol: 'Space', text: 'Space' }, linux: { auto: 'Space', symbol: 'Space', text: 'Space' } },\n Backspace: { macos: { auto: '⌫', symbol: '⌫', text: 'Backspace' }, windows: { auto: 'Backspace', symbol: 'Backspace', text: 'Backspace' }, linux: { auto: 'Backspace', symbol: 'Backspace', text: 'Backspace' } },\n Delete: { macos: { auto: '⌦', symbol: '⌦', text: 'Delete' }, windows: { auto: 'Delete', symbol: 'Delete', text: 'Delete' }, linux: { auto: 'Delete', symbol: 'Delete', text: 'Delete' } },\n // Context-menu key (the right-Ctrl-area key on Windows / Linux keyboards\n // with a ▤ icon). Mac has no equivalent; falls back to text 'Menu'.\n ContextMenu: { macos: { auto: 'Menu', symbol: 'Menu', text: 'Menu' }, windows: { auto: '▤', symbol: '▤', text: 'Menu' }, linux: { auto: '▤', symbol: '▤', text: 'Menu' } },\n ArrowUp: { macos: { auto: '↑', symbol: '↑', text: '↑' }, windows: { auto: '↑', symbol: '↑', text: '↑' }, linux: { auto: '↑', symbol: '↑', text: '↑' } },\n ArrowDown: { macos: { auto: '↓', symbol: '↓', text: '↓' }, windows: { auto: '↓', symbol: '↓', text: '↓' }, linux: { auto: '↓', symbol: '↓', text: '↓' } },\n ArrowLeft: { macos: { auto: '←', symbol: '←', text: '←' }, windows: { auto: '←', symbol: '←', text: '←' }, linux: { auto: '←', symbol: '←', text: '←' } },\n ArrowRight: { macos: { auto: '→', symbol: '→', text: '→' }, windows: { auto: '→', symbol: '→', text: '→' }, linux: { auto: '→', symbol: '→', text: '→' } },\n};\n\n/**\n * Render a raw `KeyboardEvent.key` value as a platform-appropriate\n * `KeySpec`. Named non-modifier keys (Esc, Enter, Tab, Space, Backspace,\n * Delete, arrows) get the platform's conventional form. Letter / digit /\n * other keys pass through upper-cased.\n *\n * ```ts\n * keySpecFromKey('Escape', { platform: 'macos' }) // { label: '⎋' }\n * keySpecFromKey('Escape', { platform: 'windows' }) // { label: 'Esc' }\n * keySpecFromKey('p') // { label: 'P' }\n * ```\n *\n * Symbol mode is only meaningful on macOS — Windows / Linux keyboards\n * print the text form on the physical key, so symbol mode there falls\n * back to text.\n */\nexport function keySpecFromKey(\n raw: string,\n opts: KeySpecsFromModsOptions & { optional?: boolean } = {},\n): KeySpec {\n const platform = opts.platform ?? detectPlatform();\n const legend = opts.legend ?? 'auto';\n const entry = NAMED_KEY[raw];\n const label = entry ? entry[platform][legend] : raw.length === 1 ? raw.toUpperCase() : raw;\n return opts.optional ? { label, optional: true } : { label };\n}\n","import type { CSSProperties } from 'react';\nimport s from './Keycaps.module.css';\nimport { MODIFIER_LABELS } from './keySpecsFromMods';\n\nconst WIDE_GLYPHS = new Set(['⇥', '↵', '␣']);\n\n/**\n * Width class of a keycap: a modifier glyph, a multi-character legend that\n * needs a wider chip, or a single character in a square one.\n */\nexport type KeycapKind = 'modifier' | 'wide' | 'square';\n\n/**\n * Picks the chip width for a legend — modifier glyphs and anything longer\n * than one character get the wider forms.\n */\nexport function inferKeycapKind(label: string): KeycapKind {\n if (label === '⇪' || MODIFIER_LABELS.has(label)) return 'modifier';\n if (WIDE_GLYPHS.has(label)) return 'wide';\n if (label.length > 1) return 'wide';\n return 'square';\n}\n\n/** Visual style of a keycap chip. */\nexport type KeyCapVariant = 'default' | 'minimal';\n\n/** Props for {@link KeyCap}. */\nexport interface KeyCapProps {\n /** Glyph rendered in the chip (modifier or key). */\n label: string;\n /** Marks the chip as not required to trigger the action. In the default\n * variant the chip face inverts (dark face / light glyph) for\n * emphasis. In the `'minimal'` variant the chip's border becomes\n * dotted to read as \"may be held, but isn't required.\" */\n inverted?: boolean;\n /** Visual style. `'default'` (default) renders a filled chip; `'minimal'`\n * renders an unfilled chip whose border and legend are `currentColor`\n * — useful inline in colored prose / next to colored badges where the\n * chip should take the surrounding text color. */\n variant?: KeyCapVariant;\n className?: string;\n /** Optional inline style. Useful for one-off width overrides (e.g.\n * building a keyboard-layout where the space bar spans several\n * standard-key widths). The component sets no inline styles of its\n * own — everything else comes from the CSS module. */\n style?: CSSProperties;\n /** Override the chip's font-family. Accepts any CSS font-family\n * string. When omitted, the chip inherits from the design-system\n * UI font token (`--wzl-font-ui`). Useful for one-off cases where\n * a different face is desired — though the canonical move is to\n * override the CSS variable at the consumer's scope, not the prop. */\n font?: string;\n}\n\n/** Single bordered keycap chip for one glyph (modifier or key). Use\n * `KeySequence` to render a full shortcut. */\nexport function KeyCap({ label, inverted = false, variant = 'default', className, style, font }: KeyCapProps) {\n const resolvedStyle = font ? { ...style, fontFamily: font } : style;\n return (\n <kbd\n className={[s.key, className].filter(Boolean).join(' ')}\n data-kind={inferKeycapKind(label)}\n data-variant={variant === 'default' ? undefined : variant}\n data-inverted={inverted || undefined}\n style={resolvedStyle}\n >\n {label}\n </kbd>\n );\n}\n","import { Fragment } from 'react';\nimport s from './Keycaps.module.css';\nimport { KeyCap, inferKeycapKind, type KeyCapVariant } from './Keycap';\n\n/** One key in a shortcut. */\nexport interface KeySpec {\n /** Glyph rendered in the chip (modifier or key). */\n label: string;\n /** When true, the chip renders inverted to mark it as not required to\n * trigger the action (e.g. an optional modifier). Defaults to false. */\n optional?: boolean;\n}\n\n/** Where {@link KeySequence} draws its separator. */\nexport type KeySequenceJoins = 'all' | 'key' | 'none';\n\n/** Props for {@link KeySequence}. */\nexport interface KeySequenceProps {\n /** Keys to render. `undefined` or empty renders a muted em-dash.\n * Modifiers are always rendered first regardless of input order; relative\n * order within each group is preserved. */\n keys: readonly KeySpec[] | undefined;\n /** Glyph drawn wherever {@link joins} places a separator. Defaults to `'+'`. */\n separator?: string;\n /** Where the separator goes. Defaults to `'key'`.\n * - `'all'`: between every pair of chips — `⌘ + ⇧ + K`, `⌘ + ⇧`, `A + B`.\n * - `'key'`: before every non-modifier — `⌘ ⇧ + K`, `⌘ + K + L`, `A + B`.\n * Modifiers stay unjoined, so `⌘ ⇧` gets none.\n * - `'none'`: never. */\n joins?: KeySequenceJoins;\n /** Forwarded to every `KeyCap` in the sequence. `'minimal'` renders\n * unfilled chips whose border + legend are `currentColor`. */\n variant?: KeyCapVariant;\n /** Forwarded to every `KeyCap` in the sequence. Overrides the design-\n * system UI font for that chip only. */\n font?: string;\n className?: string;\n}\n\n/** Renders a shortcut as a row of `KeyCap` chips, one per key. Optional\n * keys render inverted to distinguish them from required ones. */\nexport function KeySequence({ keys, separator = '+', joins = 'key', variant = 'default', font, className }: KeySequenceProps) {\n if (!keys || keys.length === 0) {\n return <span className={[s.keysEmpty, className].filter(Boolean).join(' ')}>—</span>;\n }\n const ordered = keys\n .map((k, i) => ({ k, i }))\n .sort((a, b) => {\n const am = inferKeycapKind(a.k.label) === 'modifier' ? 0 : 1;\n const bm = inferKeycapKind(b.k.label) === 'modifier' ? 0 : 1;\n return am - bm || a.i - b.i;\n })\n .map(({ k }) => k);\n const sepBefore = (i: number): boolean =>\n i > 0 &&\n (joins === 'all' || (joins === 'key' && inferKeycapKind(ordered[i]!.label) !== 'modifier'));\n return (\n <span className={[s.keys, className].filter(Boolean).join(' ')}>\n {ordered.map((k, i) => (\n <Fragment key={i}>\n {sepBefore(i) ? <span className={s.sep}>{separator}</span> : null}\n <KeyCap label={k.label} inverted={k.optional ?? false} variant={variant} font={font} />\n </Fragment>\n ))}\n </span>\n );\n}\n","import type { ShortcutInput } from '../ToolPalette/formatShortcut';\nimport type { KeySpec } from './Keycaps';\nimport { keySpecFromKey, keySpecsFromMods, type KeySpecsFromModsOptions, type LogicalModSpec } from './keySpecsFromMods';\n\n/**\n * A shortcut as `KeySequence` keys, one per key: mod, shift, alt, then the\n * key, each in the platform's own legend (`⌘` on macOS, `Ctrl` elsewhere).\n * The `KeySpec` counterpart of `formatShortcutParts`, which always prints\n * macOS glyphs. `shift: 'optional'` becomes an optional key; a key list\n * renders its first key. Returns `undefined` for no shortcut.\n *\n * ```tsx\n * <KeySequence keys={keySpecsFromShortcut({ key: 'z', mod: true, shift: true })} />\n * ```\n */\nexport function keySpecsFromShortcut(\n shortcut: ShortcutInput | undefined,\n opts: KeySpecsFromModsOptions = {},\n): readonly KeySpec[] | undefined {\n if (!shortcut) return undefined;\n const mods: LogicalModSpec[] = [];\n if (shortcut.mod) mods.push({ name: 'mod' });\n if (shortcut.shift) mods.push(shortcut.shift === 'optional' ? { name: 'shift', optional: true } : { name: 'shift' });\n if (shortcut.alt) mods.push({ name: 'alt' });\n const key = typeof shortcut.key === 'string' ? shortcut.key : shortcut.key[0];\n const keys = keySpecsFromMods(mods, opts);\n return key === undefined ? keys : [...keys, keySpecFromKey(key, opts)];\n}\n"],"mappings":";;;;;;;GC2CMK,IAAqF;CACzF,KAAK;EACH,OAAS;GAAE,MAAM;GAAQ,QAAQ;GAAQ,MAAM;EAAM;EACrD,SAAS;GAAE,MAAM;GAAQ,QAAQ;GAAQ,MAAM;EAAO;EACtD,OAAS;GAAE,MAAM;GAAQ,QAAQ;GAAQ,MAAM;EAAO;CACxD;CACA,OAAO;EACL,OAAS;GAAE,MAAM;GAAK,QAAQ;GAAK,MAAM;EAAQ;EACjD,SAAS;GAAE,MAAM;GAAK,QAAQ;GAAK,MAAM;EAAQ;EACjD,OAAS;GAAE,MAAM;GAAK,QAAQ;GAAK,MAAM;EAAQ;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I,IACrEV,IAAOpB,EAAiBI,GAAMF,CAAI;CACxC,OAAO6B,MAAQ,KAAA,IAAYX,IAAO,CAAC,GAAGA,GAAMZ,EAAeuB,GAAK7B,CAAI,CAAC;AACvE"}
|
|
@@ -1,421 +0,0 @@
|
|
|
1
|
-
import { t as e } from "./dlog-F0I8KsIW.js";
|
|
2
|
-
import { J as t } from "./icons-Dr2-r30x.js";
|
|
3
|
-
import { t as n } from "./CloseButton-BmNmRVtb.js";
|
|
4
|
-
import { t as r } from "./useReorderDragList-CStYKjHl.js";
|
|
5
|
-
import { t as i } from "./Disclosure-Ch2KxYuB.js";
|
|
6
|
-
import { t as a } from "./DragGhost-BeYDJyLZ.js";
|
|
7
|
-
import { t as o } from "./DragGrip-AoIZXfZb.js";
|
|
8
|
-
import { t as s } from "./ItemList.module-BSpCSxan.js";
|
|
9
|
-
import { n as c } from "./Properties-BoG2MMHR.js";
|
|
10
|
-
import { a as l } from "./PropertyField-PMrqBA0n.js";
|
|
11
|
-
import { asNodeId as u, createMoveToIndexOp as d, dispatchApplyBatch as f, useLatest as p } from "@weasel-js/core";
|
|
12
|
-
import { Fragment as m, jsx as h, jsxs as g } from "react/jsx-runtime";
|
|
13
|
-
import { useId as _, useLayoutEffect as v, useRef as y, useState as b } from "react";
|
|
14
|
-
var x = {
|
|
15
|
-
root: "_root_19r15_3",
|
|
16
|
-
head: "_head_19r15_13",
|
|
17
|
-
title: "_title_19r15_20",
|
|
18
|
-
palette: "_palette_19r15_28",
|
|
19
|
-
add: "_add_19r15_33",
|
|
20
|
-
level: "_level_19r15_50",
|
|
21
|
-
cards: "_cards_19r15_60",
|
|
22
|
-
entry: "_entry_19r15_65",
|
|
23
|
-
row: "_row_19r15_69",
|
|
24
|
-
children: "_children_19r15_79",
|
|
25
|
-
dragging: "_dragging_19r15_84",
|
|
26
|
-
dropBefore: "_dropBefore_19r15_89",
|
|
27
|
-
dropAfter: "_dropAfter_19r15_93",
|
|
28
|
-
grip: "_grip_19r15_98",
|
|
29
|
-
lock: "_lock_19r15_99",
|
|
30
|
-
stop: "_stop_19r15_116",
|
|
31
|
-
twistyGap: "_twistyGap_19r15_123",
|
|
32
|
-
check: "_check_19r15_129",
|
|
33
|
-
handle: "_handle_19r15_137",
|
|
34
|
-
card: "_card_19r15_60"
|
|
35
|
-
};
|
|
36
|
-
//#endregion
|
|
37
|
-
//#region src/components/LayerList/LayerList.tsx
|
|
38
|
-
function S(e, t) {
|
|
39
|
-
return t.parentId === null ? C(e, t) : e.map((e) => e.id === t.parentId ? {
|
|
40
|
-
...e,
|
|
41
|
-
children: C(e.children ?? [], t)
|
|
42
|
-
} : e.children ? {
|
|
43
|
-
...e,
|
|
44
|
-
children: S(e.children, t)
|
|
45
|
-
} : e);
|
|
46
|
-
}
|
|
47
|
-
function C(e, { ids: t, index: n }) {
|
|
48
|
-
let r = new Set(t), i = e.filter((e) => !r.has(e.id)), a = e.filter((e) => r.has(e.id)), o = Math.max(0, Math.min(i.length, n));
|
|
49
|
-
return [
|
|
50
|
-
...i.slice(0, o),
|
|
51
|
-
...a,
|
|
52
|
-
...i.slice(o)
|
|
53
|
-
];
|
|
54
|
-
}
|
|
55
|
-
function w(e, t, n = /* @__PURE__ */ new Set()) {
|
|
56
|
-
for (let r of e) t(r) && n.add(r.id), r.children && w(r.children, t, n);
|
|
57
|
-
return n;
|
|
58
|
-
}
|
|
59
|
-
function T(e) {
|
|
60
|
-
return e.some((e) => (e.children?.length ?? 0) > 0);
|
|
61
|
-
}
|
|
62
|
-
function E(e) {
|
|
63
|
-
return e != null && e !== !1;
|
|
64
|
-
}
|
|
65
|
-
function D(t) {
|
|
66
|
-
let { items: n, collapsedIds: r, onCollapsedChange: i, title: a, addKinds: o, onAdd: c, empty: l, className: u } = t, [d, f] = b(/* @__PURE__ */ new Map()), m = r ? new Set(r) : w(n, (e) => d.get(e.id) ?? e.defaultCollapsed === !0), S = (e) => {
|
|
67
|
-
let t = new Set(m);
|
|
68
|
-
t.has(e) ? t.delete(e) : t.add(e), r || f((n) => new Map(n).set(e, t.has(e))), i?.([...t]);
|
|
69
|
-
}, C = p(t), D = (e, t) => {
|
|
70
|
-
let { selectedIds: n = [], onSelect: r } = C.current;
|
|
71
|
-
if (!r) return;
|
|
72
|
-
if (R.current = e.id, e.locked || !t.shiftKey) {
|
|
73
|
-
r([e.id]);
|
|
74
|
-
return;
|
|
75
|
-
}
|
|
76
|
-
let i = new Set(O(C.current.items)), a = n.filter((e) => !i.has(e));
|
|
77
|
-
r(a.includes(e.id) ? a.filter((t) => t !== e.id) : [...a, e.id]);
|
|
78
|
-
}, A = /* @__PURE__ */ new Map(), j = (e) => {
|
|
79
|
-
for (let n of e) A.set(n.id, t.renderBody ? t.renderBody(n) : null), n.children && j(n.children);
|
|
80
|
-
};
|
|
81
|
-
j(n);
|
|
82
|
-
let M = [], N = (e, t, n) => {
|
|
83
|
-
for (let r of e) E(A.get(r.id)) || M.push({
|
|
84
|
-
item: r,
|
|
85
|
-
parentId: t,
|
|
86
|
-
level: n
|
|
87
|
-
}), r.children?.length && !m.has(r.id) && N(r.children, r.id, n + 1);
|
|
88
|
-
};
|
|
89
|
-
N(n, null, 1);
|
|
90
|
-
let P = y(/* @__PURE__ */ new Map()), [F, I] = b(null), L = y(null), R = y(null), z = y(/* @__PURE__ */ new Map()).current;
|
|
91
|
-
v(() => {
|
|
92
|
-
let e = L.current;
|
|
93
|
-
if (e === null) return;
|
|
94
|
-
L.current = null;
|
|
95
|
-
let t = P.current.get(e);
|
|
96
|
-
t && document.activeElement !== t && t.focus();
|
|
97
|
-
});
|
|
98
|
-
let B = t.selectedIds ?? [], V = M.some((e) => e.item.id === F) ? F ?? void 0 : (M.find((e) => B.includes(e.item.id)) ?? M[0])?.item.id, H = (e) => {
|
|
99
|
-
L.current = e, I(e);
|
|
100
|
-
}, U = (e) => {
|
|
101
|
-
let t = R.current ?? e, n = M.findIndex((e) => e.item.id === t), r = M.findIndex((t) => t.item.id === e);
|
|
102
|
-
if (n < 0 || r < 0) return;
|
|
103
|
-
let i = M.slice(Math.min(n, r), Math.max(n, r) + 1).filter((e) => !e.item.locked).map((e) => e.item.id);
|
|
104
|
-
i.length > 0 && C.current.onSelect?.(i);
|
|
105
|
-
}, W = {
|
|
106
|
-
tabStop: V,
|
|
107
|
-
register: (e) => (t) => {
|
|
108
|
-
t ? P.current.set(e, t) : P.current.delete(e);
|
|
109
|
-
},
|
|
110
|
-
onFocus: (e) => {
|
|
111
|
-
I(e), R.current ??= e;
|
|
112
|
-
},
|
|
113
|
-
onKeyDown: (e, n) => (r) => {
|
|
114
|
-
if (r.target !== r.currentTarget) return;
|
|
115
|
-
let i = M.findIndex((t) => t.item.id === e.id), a = (e) => {
|
|
116
|
-
let n = M[Math.max(0, Math.min(M.length - 1, e))];
|
|
117
|
-
n && (H(n.item.id), r.shiftKey && t.onSelect ? U(n.item.id) : R.current = n.item.id);
|
|
118
|
-
}, o = (e.children?.length ?? 0) > 0, s = o && !m.has(e.id);
|
|
119
|
-
switch (r.key) {
|
|
120
|
-
case "ArrowDown":
|
|
121
|
-
case "ArrowUp": {
|
|
122
|
-
let t = r.key === "ArrowDown" ? 1 : -1;
|
|
123
|
-
r.altKey ? z.get(n)?.(e.id, t) && (L.current = e.id) : a(i + t);
|
|
124
|
-
break;
|
|
125
|
-
}
|
|
126
|
-
case "Home":
|
|
127
|
-
a(0);
|
|
128
|
-
break;
|
|
129
|
-
case "End":
|
|
130
|
-
a(M.length - 1);
|
|
131
|
-
break;
|
|
132
|
-
case "ArrowRight":
|
|
133
|
-
if (o && !s) S(e.id);
|
|
134
|
-
else if (s) a(i + 1);
|
|
135
|
-
else return;
|
|
136
|
-
break;
|
|
137
|
-
case "ArrowLeft":
|
|
138
|
-
if (s) S(e.id);
|
|
139
|
-
else if (n !== null) a(M.findIndex((e) => e.item.id === n));
|
|
140
|
-
else return;
|
|
141
|
-
break;
|
|
142
|
-
case "Enter":
|
|
143
|
-
case " ":
|
|
144
|
-
D(e, {
|
|
145
|
-
shiftKey: r.shiftKey,
|
|
146
|
-
ctrlKey: r.ctrlKey,
|
|
147
|
-
metaKey: r.metaKey,
|
|
148
|
-
altKey: r.altKey
|
|
149
|
-
});
|
|
150
|
-
break;
|
|
151
|
-
default: return;
|
|
152
|
-
}
|
|
153
|
-
r.preventDefault();
|
|
154
|
-
}
|
|
155
|
-
}, G = {
|
|
156
|
-
props: t,
|
|
157
|
-
collapsed: m,
|
|
158
|
-
toggle: S,
|
|
159
|
-
press: D,
|
|
160
|
-
uid: _(),
|
|
161
|
-
nested: T(n),
|
|
162
|
-
bodies: A,
|
|
163
|
-
nudgers: z,
|
|
164
|
-
keys: W
|
|
165
|
-
}, K = c ? o ?? [] : [], q = u ? `${x.root} ${u}` : x.root;
|
|
166
|
-
return /* @__PURE__ */ g("div", {
|
|
167
|
-
className: q,
|
|
168
|
-
children: [(a !== void 0 || K.length > 0) && /* @__PURE__ */ g("div", {
|
|
169
|
-
className: x.head,
|
|
170
|
-
children: [a !== void 0 && /* @__PURE__ */ h("h2", {
|
|
171
|
-
className: x.title,
|
|
172
|
-
children: a
|
|
173
|
-
}), /* @__PURE__ */ h("div", {
|
|
174
|
-
className: x.palette,
|
|
175
|
-
children: K.map((t) => /* @__PURE__ */ h("button", {
|
|
176
|
-
type: "button",
|
|
177
|
-
className: x.add,
|
|
178
|
-
"aria-label": `Add ${t}`,
|
|
179
|
-
onClick: () => {
|
|
180
|
-
e("layer-list", "onAdd", { kind: t }), c?.(t);
|
|
181
|
-
},
|
|
182
|
-
children: t
|
|
183
|
-
}, t))
|
|
184
|
-
})]
|
|
185
|
-
}), n.length === 0 ? /* @__PURE__ */ h("div", {
|
|
186
|
-
className: s.empty,
|
|
187
|
-
children: l ?? (K.length > 0 ? "No layers — add one above." : "No layers.")
|
|
188
|
-
}) : /* @__PURE__ */ h(k, {
|
|
189
|
-
items: n,
|
|
190
|
-
parentId: null,
|
|
191
|
-
shared: G,
|
|
192
|
-
path: "",
|
|
193
|
-
level: 1
|
|
194
|
-
})]
|
|
195
|
-
});
|
|
196
|
-
}
|
|
197
|
-
function O(e) {
|
|
198
|
-
let t = [];
|
|
199
|
-
for (let n of e) n.locked && t.push(n.id), n.children && t.push(...O(n.children));
|
|
200
|
-
return t;
|
|
201
|
-
}
|
|
202
|
-
function k({ items: t, parentId: n, shared: o, path: u, level: d }) {
|
|
203
|
-
let { props: f } = o, p = f.selectedIds ?? [], _ = r({
|
|
204
|
-
items: t.map((e) => ({
|
|
205
|
-
id: e.id,
|
|
206
|
-
label: e.label,
|
|
207
|
-
locked: e.locked || !f.onReorder
|
|
208
|
-
})),
|
|
209
|
-
selectedIds: t.filter((e) => p.includes(e.id)).map((e) => e.id),
|
|
210
|
-
onReorder: (r, i) => {
|
|
211
|
-
let a = new Set(r), o = {
|
|
212
|
-
ids: t.filter((e) => a.has(e.id)).map((e) => e.id),
|
|
213
|
-
parentId: n,
|
|
214
|
-
index: i - t.slice(0, i).filter((e) => a.has(e.id)).length
|
|
215
|
-
};
|
|
216
|
-
e("layer-list", "onReorder", o), f.onReorder?.(o);
|
|
217
|
-
},
|
|
218
|
-
onPress: (e, n) => {
|
|
219
|
-
let r = t.find((t) => t.id === e);
|
|
220
|
-
r && o.press(r, n);
|
|
221
|
-
}
|
|
222
|
-
});
|
|
223
|
-
o.nudgers.set(n, (e, n) => _.nudge(e, t.findIndex((t) => t.id === e), n));
|
|
224
|
-
let [v, y] = b(null), S = (e) => {
|
|
225
|
-
y(e), _.containerProps.ref(e);
|
|
226
|
-
}, C = t.map((e) => o.bodies.get(e.id)), w = C.some(E), { draggedIds: T, targetIndex: D, ghost: O } = _.state, F = (e, r, a) => {
|
|
227
|
-
let l = C[r], m = e.children ?? [], v = !o.collapsed.has(e.id), y = `${o.uid}${u}-${r}`, b = a ? void 0 : _.rowProps(e.id, r).onPointerDown, S = p.includes(e.id), w = [x.entry];
|
|
228
|
-
a || (T?.includes(e.id) && w.push(x.dragging), D === r && !T?.includes(e.id) && w.push(x.dropBefore), D === t.length && r === t.length - 1 && w.push(x.dropAfter));
|
|
229
|
-
let O = /* @__PURE__ */ h(N, {
|
|
230
|
-
item: e,
|
|
231
|
-
shared: o
|
|
232
|
-
}), F = E(l) ? /* @__PURE__ */ h(c, {
|
|
233
|
-
className: x.card,
|
|
234
|
-
title: e.title ?? e.label,
|
|
235
|
-
...e.tone === void 0 ? {} : { tone: e.tone },
|
|
236
|
-
collapsed: a || !v,
|
|
237
|
-
onCollapsedChange: () => o.toggle(e.id),
|
|
238
|
-
leading: /* @__PURE__ */ h(M, {
|
|
239
|
-
item: e,
|
|
240
|
-
reorder: f.onReorder !== void 0,
|
|
241
|
-
onPointerDown: b,
|
|
242
|
-
onNudge: (t) => o.nudgers.get(n)?.(e.id, t)
|
|
243
|
-
}),
|
|
244
|
-
actions: a ? void 0 : O,
|
|
245
|
-
children: a ? null : l
|
|
246
|
-
}) : /* @__PURE__ */ g("div", {
|
|
247
|
-
className: [
|
|
248
|
-
s.row,
|
|
249
|
-
x.row,
|
|
250
|
-
S ? s.selected : ""
|
|
251
|
-
].filter(Boolean).join(" "),
|
|
252
|
-
"data-selected": S ? "true" : void 0,
|
|
253
|
-
"data-locked": e.locked ? "true" : void 0,
|
|
254
|
-
onPointerDown: b,
|
|
255
|
-
...a ? {} : {
|
|
256
|
-
role: "row",
|
|
257
|
-
"aria-level": d,
|
|
258
|
-
...m.length > 0 ? { "aria-expanded": v } : {},
|
|
259
|
-
...f.onSelect ? { "aria-selected": S } : {},
|
|
260
|
-
tabIndex: o.keys.tabStop === e.id ? 0 : -1,
|
|
261
|
-
ref: o.keys.register(e.id),
|
|
262
|
-
onKeyDown: o.keys.onKeyDown(e, n),
|
|
263
|
-
onFocus: () => o.keys.onFocus(e.id)
|
|
264
|
-
},
|
|
265
|
-
children: [
|
|
266
|
-
o.nested && (m.length > 0 ? /* @__PURE__ */ h("span", {
|
|
267
|
-
className: x.stop,
|
|
268
|
-
onPointerDown: A,
|
|
269
|
-
children: /* @__PURE__ */ h(i, {
|
|
270
|
-
open: v,
|
|
271
|
-
onToggle: () => o.toggle(e.id),
|
|
272
|
-
label: `${e.label} sublayers`,
|
|
273
|
-
controls: y
|
|
274
|
-
})
|
|
275
|
-
}) : /* @__PURE__ */ h("span", { className: x.twistyGap })),
|
|
276
|
-
/* @__PURE__ */ h(j, {
|
|
277
|
-
item: e,
|
|
278
|
-
reorder: f.onReorder !== void 0
|
|
279
|
-
}),
|
|
280
|
-
f.onVisibilityChange && (e.locked ? /* @__PURE__ */ h("span", { className: x.check }) : /* @__PURE__ */ h("input", {
|
|
281
|
-
className: x.check,
|
|
282
|
-
type: "checkbox",
|
|
283
|
-
checked: e.visible !== !1,
|
|
284
|
-
onPointerDown: A,
|
|
285
|
-
onChange: (t) => f.onVisibilityChange?.(e.id, t.target.checked),
|
|
286
|
-
"aria-label": `Show ${e.label}`
|
|
287
|
-
})),
|
|
288
|
-
e.leading,
|
|
289
|
-
/* @__PURE__ */ h("span", {
|
|
290
|
-
className: s.label,
|
|
291
|
-
children: e.title ?? e.label
|
|
292
|
-
}),
|
|
293
|
-
a ? null : /* @__PURE__ */ h(P, {
|
|
294
|
-
item: e,
|
|
295
|
-
shared: o
|
|
296
|
-
})
|
|
297
|
-
]
|
|
298
|
-
});
|
|
299
|
-
return /* @__PURE__ */ g("div", {
|
|
300
|
-
role: "none",
|
|
301
|
-
className: w.join(" "),
|
|
302
|
-
"data-selected": S ? "true" : void 0,
|
|
303
|
-
children: [F, !a && m.length > 0 && v && /* @__PURE__ */ h("div", {
|
|
304
|
-
id: y,
|
|
305
|
-
role: "rowgroup",
|
|
306
|
-
className: x.children,
|
|
307
|
-
children: /* @__PURE__ */ h(k, {
|
|
308
|
-
items: m,
|
|
309
|
-
parentId: e.id,
|
|
310
|
-
shared: o,
|
|
311
|
-
path: `${u}-${r}`,
|
|
312
|
-
level: d + 1
|
|
313
|
-
})
|
|
314
|
-
})]
|
|
315
|
-
}, e.id);
|
|
316
|
-
};
|
|
317
|
-
return /* @__PURE__ */ g(m, { children: [w ? /* @__PURE__ */ h(l, {
|
|
318
|
-
ref: S,
|
|
319
|
-
className: `${x.level} ${x.cards}`,
|
|
320
|
-
children: t.map((e, t) => F(e, t, !1))
|
|
321
|
-
}) : /* @__PURE__ */ h("div", {
|
|
322
|
-
ref: S,
|
|
323
|
-
className: x.level,
|
|
324
|
-
...n === null ? {
|
|
325
|
-
role: "treegrid",
|
|
326
|
-
"aria-label": f.label ?? f.title ?? "Layers",
|
|
327
|
-
...f.onSelect ? { "aria-multiselectable": !0 } : {}
|
|
328
|
-
} : { role: "none" },
|
|
329
|
-
children: t.map((e, t) => F(e, t, !1))
|
|
330
|
-
}), O && v ? /* @__PURE__ */ h(a, {
|
|
331
|
-
at: O,
|
|
332
|
-
from: v,
|
|
333
|
-
children: t.map((e, t) => O.ids.includes(e.id) ? F(e, t, !0) : null)
|
|
334
|
-
}) : null] });
|
|
335
|
-
}
|
|
336
|
-
var A = (e) => e.stopPropagation();
|
|
337
|
-
function j({ item: e, reorder: n }) {
|
|
338
|
-
return e.locked ? /* @__PURE__ */ h("span", {
|
|
339
|
-
className: x.lock,
|
|
340
|
-
role: "img",
|
|
341
|
-
"aria-label": "Locked",
|
|
342
|
-
children: /* @__PURE__ */ h(t, { size: 12 })
|
|
343
|
-
}) : !n && e.badge === void 0 ? null : /* @__PURE__ */ h("span", {
|
|
344
|
-
className: x.grip,
|
|
345
|
-
"aria-hidden": "true",
|
|
346
|
-
children: e.badge ?? /* @__PURE__ */ h(o, { size: 13 })
|
|
347
|
-
});
|
|
348
|
-
}
|
|
349
|
-
function M({ item: e, reorder: t, onPointerDown: n, onNudge: r }) {
|
|
350
|
-
if (e.locked) return /* @__PURE__ */ h(j, {
|
|
351
|
-
item: e,
|
|
352
|
-
reorder: t
|
|
353
|
-
});
|
|
354
|
-
if (t || e.badge !== void 0) return /* @__PURE__ */ h("button", {
|
|
355
|
-
type: "button",
|
|
356
|
-
className: x.handle,
|
|
357
|
-
"aria-label": `Drag to reorder ${e.label}`,
|
|
358
|
-
"aria-keyshortcuts": "Alt+ArrowUp Alt+ArrowDown",
|
|
359
|
-
onPointerDown: n,
|
|
360
|
-
onKeyDown: (e) => {
|
|
361
|
-
!e.altKey || e.key !== "ArrowUp" && e.key !== "ArrowDown" || (e.preventDefault(), r(e.key === "ArrowUp" ? -1 : 1));
|
|
362
|
-
},
|
|
363
|
-
children: e.badge ?? /* @__PURE__ */ h(o, {})
|
|
364
|
-
});
|
|
365
|
-
}
|
|
366
|
-
function N({ item: e, shared: t }) {
|
|
367
|
-
let { onVisibilityChange: n } = t.props;
|
|
368
|
-
return /* @__PURE__ */ g(m, { children: [n && !e.locked && /* @__PURE__ */ h("input", {
|
|
369
|
-
className: x.check,
|
|
370
|
-
type: "checkbox",
|
|
371
|
-
checked: e.visible !== !1,
|
|
372
|
-
onClick: A,
|
|
373
|
-
onChange: (t) => n(e.id, t.target.checked),
|
|
374
|
-
"aria-label": `Show ${e.label}`
|
|
375
|
-
}), /* @__PURE__ */ h(P, {
|
|
376
|
-
item: e,
|
|
377
|
-
shared: t
|
|
378
|
-
})] });
|
|
379
|
-
}
|
|
380
|
-
function P({ item: e, shared: t }) {
|
|
381
|
-
let { onRemove: r } = t.props;
|
|
382
|
-
return !r || e.locked ? null : /* @__PURE__ */ h("span", {
|
|
383
|
-
className: x.stop,
|
|
384
|
-
onPointerDown: A,
|
|
385
|
-
children: /* @__PURE__ */ h(n, {
|
|
386
|
-
ariaLabel: `Remove ${e.label}`,
|
|
387
|
-
onClick: () => r(e.id)
|
|
388
|
-
})
|
|
389
|
-
});
|
|
390
|
-
}
|
|
391
|
-
//#endregion
|
|
392
|
-
//#region src/components/LayerList/useSceneLayerList.ts
|
|
393
|
-
function F(e) {
|
|
394
|
-
let { scene: t, selection: n, adapter: r, itemFor: i, label: a = "Reorder" } = e, o = (e) => [...e].reverse().flatMap((e) => {
|
|
395
|
-
let n = t.get(e);
|
|
396
|
-
if (!n) return [];
|
|
397
|
-
let r = t.childrenOf(e);
|
|
398
|
-
return [{
|
|
399
|
-
...i(n),
|
|
400
|
-
id: e,
|
|
401
|
-
...r.length > 0 ? { children: o(r) } : {}
|
|
402
|
-
}];
|
|
403
|
-
});
|
|
404
|
-
return {
|
|
405
|
-
items: o(t.roots),
|
|
406
|
-
selectedIds: n.current.map(String),
|
|
407
|
-
onSelect: (e) => n.set(e.map(u)),
|
|
408
|
-
onReorder: ({ ids: e, parentId: n, index: i }) => {
|
|
409
|
-
let o = (n === null ? t.roots : t.childrenOf(u(n))).length - e.length - i;
|
|
410
|
-
f(r, [d({
|
|
411
|
-
ids: e,
|
|
412
|
-
parentId: n,
|
|
413
|
-
index: Math.max(0, o)
|
|
414
|
-
})], a);
|
|
415
|
-
}
|
|
416
|
-
};
|
|
417
|
-
}
|
|
418
|
-
//#endregion
|
|
419
|
-
export { D as n, S as r, F as t };
|
|
420
|
-
|
|
421
|
-
//# sourceMappingURL=LayerList-BqeWFuGc.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"LayerList-BqeWFuGc.js","names":["stop","s","rows","_Fragment","dlog","LockIcon","CloseButton","useReorderDragList","Disclosure","DragGhost","DragGrip","ItemList_module_default","PropertyGroup","PropertyList","LayerList_module_default","moveLayers","move","reorder","items","item","moving","ids","kept","siblings","it","moved","at","index","collectCollapsed","isCollapsed","into","anyNested","hasBody","body","LayerList","props","toggled","setToggled","useState","collapsed","collapsedIds","toggle","next","id","prev","onCollapsedChange","live","useLatest","press","onSelect","mods","locked","lockedIds","selectedIds","bodies","collectBodies","list","visible","walk","level","rowEls","useRef","focusId","setFocusId","pendingFocus","anchor","nudgers","el","tabStop","v","focusRow","selectRange","from","to","a","b","range","keys","e","go","branch","open","delta","parentId","shared","useId","palette","onAdd","addKinds","cls","className","title","kind","empty","Level","out","selected","drag","target","setEl","bind","node","cards","entry","i","kids","childId","path","onPointerDown","ghosted","isSelected","draggedIds","targetIndex","controls","Controls","head","Handle","stop","Grip","Remove","Fragment","ghost","onNudge","onVisibilityChange","onRemove","useSceneLayerList","args","build","scene","itemFor","selection","asNodeId","back","adapter","createMoveToIndexOp","label"],"sources":["../../src/components/LayerList/LayerList.module.css","../../src/components/LayerList/LayerList.tsx","../../src/components/LayerList/useSceneLayerList.ts"],"sourcesContent":["/* Row box, hover and selection are `ItemList`'s, so a layer list and the\n history list stacked under it agree. What is here is only what a layer has. */\n.root,\n.root * {\n box-sizing: border-box;\n}\n\n.root {\n display: grid;\n gap: var(--wzl-space-4);\n}\n\n.head {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: var(--wzl-space-4);\n}\n\n.title {\n margin: 0;\n font-family: var(--wzl-font-display);\n font-weight: var(--wzl-font-weight-light);\n font-size: var(--wzl-font-size-lg);\n color: var(--wzl-fg);\n}\n\n.palette {\n display: flex;\n gap: var(--wzl-space-2);\n}\n\n.add {\n font: inherit;\n height: var(--wzl-control-h);\n background: transparent;\n border: 1px dashed var(--wzl-border);\n border-radius: var(--wzl-radius-sm);\n padding: var(--wzl-space-1) var(--wzl-space-4);\n font-size: var(--wzl-font-size-sm);\n color: var(--wzl-fg-subtle);\n cursor: pointer;\n}\n\n.add:hover {\n background: var(--wzl-surface-raised);\n color: var(--wzl-fg);\n}\n\n.level {\n display: flex;\n flex-direction: column;\n gap: 1px;\n position: relative;\n width: 100%;\n}\n\n/* A level of cards is a `PropertyList`, so the controls in each body take the\n panel's density; its rows are spaced like cards rather than lines. */\n.level.cards {\n display: grid;\n row-gap: var(--wzl-space-3);\n}\n\n.entry {\n min-width: 0;\n}\n\n.row {\n user-select: none;\n}\n\n.row:focus-visible {\n outline: 2px solid var(--wzl-focus-ring);\n outline-offset: -2px;\n}\n\n/* A child's twisty sits under its parent's grip. */\n.children {\n padding-left: calc(var(--wzl-disclosure-target, var(--wzl-control-h-sm)) + var(--wzl-space-4));\n}\n\n/* The layer the drag picked up holds its place, faded, while its ghost follows the pointer. */\n.dragging {\n opacity: 0.5;\n}\n\n/* Where the drop would land: a line on the edge of the layer it would land against. */\n.dropBefore {\n box-shadow: 0 -2px 0 var(--wzl-accent);\n}\n\n.dropAfter {\n box-shadow: 0 2px 0 var(--wzl-accent);\n}\n\n/* One width for the grip and the lock, so a locked row's label lines up. */\n.grip,\n.lock {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n flex: 0 0 auto;\n min-width: 13px;\n color: var(--wzl-fg-muted);\n}\n\n.row:not([data-locked]) {\n cursor: grab;\n}\n\n.row:not([data-locked]):active {\n cursor: grabbing;\n}\n\n.stop {\n display: inline-flex;\n align-items: center;\n flex: 0 0 auto;\n}\n\n/* Holds the twisty column open on rows with nothing to expand, so labels line up down a level. */\n.twistyGap {\n flex: 0 0 auto;\n width: var(--wzl-disclosure-target, var(--wzl-control-h-sm));\n}\n\n/* Sized, so the empty column a locked row keeps is the checkbox's width. */\n.check {\n flex: 0 0 auto;\n width: 13px;\n height: 13px;\n margin: 0;\n accent-color: var(--wzl-accent);\n}\n\n.handle {\n font: inherit;\n background: transparent;\n border: 0;\n color: var(--wzl-fg-subtle);\n padding: var(--wzl-space-1) var(--wzl-space-2);\n cursor: grab;\n touch-action: none;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n min-width: var(--wzl-icon-button-size);\n height: var(--wzl-icon-button-size);\n border-radius: var(--wzl-radius-sm);\n font-weight: var(--wzl-font-weight-bold);\n font-size: var(--wzl-font-size);\n}\n\n.card[data-tone] .handle {\n background: var(--wzl-tone);\n color: var(--wzl-fg-on-accent);\n}\n\n.handle:active {\n cursor: grabbing;\n}\n\n.entry[data-selected] > .card {\n outline: 2px solid var(--wzl-accent);\n outline-offset: -1px;\n}\n","import {\n type KeyboardEvent,\n type ReactNode,\n type RefCallback,\n useId,\n useLayoutEffect,\n useRef,\n useState,\n} from 'react';\nimport { useLatest } from '@weasel-js/core';\nimport { dlog } from '../../dlog';\nimport { LockIcon } from '../../icons';\nimport { type PressModifiers, useReorderDragList } from '../../useReorderDragList';\nimport { CloseButton } from '../CloseButton';\nimport { Disclosure } from '../Disclosure';\nimport { DragGhost } from '../DragGhost';\nimport { DragGrip } from '../DragGrip';\nimport rows from '../ItemList/ItemList.module.css';\nimport { PropertyGroup, PropertyList } from '../Properties';\nimport type { StanceProps } from '../stance';\nimport s from './LayerList.module.css';\n\n/** One layer. With a body (see `renderBody`) it draws as a card that folds its\n * body away; without one, as a one-line row. Either can hold child layers. */\nexport interface LayerListItem {\n id: string;\n /** The layer's name. Also what its controls are labeled by. */\n label: string;\n /** Shown in the header in place of `label` — a select that switches the\n * layer's kind, say. */\n title?: ReactNode;\n /** Fixed-size content before the label: a color swatch, a kind icon. */\n leading?: ReactNode;\n /** Drawn in the drag handle in place of the grip — an ordinal. */\n badge?: ReactNode;\n /** Which of its list this layer is: an index into the theme's tone list, or\n * a color. A card draws its edge and handle in it and recolors its controls. */\n tone?: StanceProps['tone'];\n /** Cannot be dragged, hidden or removed, walls off drops on either side, and\n * selects alone rather than joining a multi-selection. */\n locked?: boolean;\n /** Shown or not, when the list has `onVisibilityChange`. Default true. */\n visible?: boolean;\n children?: LayerListItem[];\n /** Folds the body and children away until the user opens them.\n * `collapsedIds` overrides it. */\n defaultCollapsed?: boolean;\n}\n\n/**\n * A reorder: `ids`, siblings under `parentId` (`null` at the top level), now\n * sit as one block in list order starting at `index` of the parent's children.\n * A drag never moves a layer to another parent.\n */\nexport interface LayerMove {\n ids: string[];\n parentId: string | null;\n index: number;\n}\n\n/** Props for `<LayerList>`. */\nexport interface LayerListProps {\n items: LayerListItem[];\n /** Omit for a list the user cannot reorder. */\n onReorder?: (move: LayerMove) => void;\n /** Giving both makes rows selectable: a click selects one, shift-click adds\n * or removes one, and dragging a selected row drags its selected siblings. */\n selectedIds?: readonly string[];\n onSelect?: (ids: string[]) => void;\n /** Adds a visibility checkbox to every unlocked layer. */\n onVisibilityChange?: (id: string, visible: boolean) => void;\n /** Adds a remove button to every unlocked layer. */\n onRemove?: (id: string) => void;\n /** A layer's controls. Returning `null` leaves that layer a one-line row. */\n renderBody?: (item: LayerListItem) => ReactNode;\n /** Ids whose body and children are folded away. Giving it makes folding\n * controlled; `onCollapsedChange` fires either way. */\n collapsedIds?: readonly string[];\n onCollapsedChange?: (ids: string[]) => void;\n /** Heading above the list. */\n title?: string;\n /** Names the list for assistive tech when it has no `title`. */\n label?: string;\n /** Kinds the user can add, as buttons beside the title. Shown only with `onAdd`. */\n addKinds?: string[];\n onAdd?: (kind: string) => void;\n /** Shown in place of the list when `items` is empty. */\n empty?: ReactNode;\n /** Appended to the root's class list — the module's own names are hashed. */\n className?: string;\n}\n\n/** Returns `items` with `move` applied, for a consumer that holds the tree as state. */\nexport function moveLayers(items: LayerListItem[], move: LayerMove): LayerListItem[] {\n if (move.parentId === null) return reorder(items, move);\n return items.map((item) => {\n if (item.id === move.parentId) return { ...item, children: reorder(item.children ?? [], move) };\n return item.children ? { ...item, children: moveLayers(item.children, move) } : item;\n });\n}\n\nfunction reorder(siblings: LayerListItem[], { ids, index }: LayerMove): LayerListItem[] {\n const moving = new Set(ids);\n const kept = siblings.filter((it) => !moving.has(it.id));\n const moved = siblings.filter((it) => moving.has(it.id));\n const at = Math.max(0, Math.min(kept.length, index));\n return [...kept.slice(0, at), ...moved, ...kept.slice(at)];\n}\n\nfunction collectCollapsed(\n items: LayerListItem[],\n isCollapsed: (item: LayerListItem) => boolean,\n into = new Set<string>(),\n): Set<string> {\n for (const item of items) {\n if (isCollapsed(item)) into.add(item.id);\n if (item.children) collectCollapsed(item.children, isCollapsed, into);\n }\n return into;\n}\n\nfunction anyNested(items: LayerListItem[]): boolean {\n return items.some((it) => (it.children?.length ?? 0) > 0);\n}\n\n/** What every level of the tree reads from the list. */\ninterface Shared {\n props: LayerListProps;\n collapsed: ReadonlySet<string>;\n toggle: (id: string) => void;\n press: (item: LayerListItem, mods: PressModifiers) => void;\n uid: string;\n /** Some layer has children, so every row keeps a twisty column. */\n nested: boolean;\n /** Each layer's body, rendered once; a row where it is empty. */\n bodies: ReadonlyMap<string, ReactNode>;\n /** Per sibling group, keyed by parent: move a row one place, as its drag would. */\n nudgers: Map<string | null, (id: string, delta: -1 | 1) => boolean>;\n keys: RowKeys;\n}\n\n/** The roving focus over the rows: one row is in the tab order at a time. */\ninterface RowKeys {\n tabStop: string | undefined;\n register: (id: string) => (el: HTMLElement | null) => void;\n onKeyDown: (item: LayerListItem, parentId: string | null) => (e: KeyboardEvent<HTMLElement>) => void;\n onFocus: (id: string) => void;\n}\n\ninterface VisibleRow {\n item: LayerListItem;\n parentId: string | null;\n level: number;\n}\n\nfunction hasBody(body: ReactNode): boolean {\n return body !== null && body !== undefined && body !== false;\n}\n\n/**\n * An ordered, drag-reorderable list of layers — a document's objects, a lab's\n * canvases, a fill's effects. Each layer is a one-line row or, with a body, a\n * card whose controls fold away; either can nest child layers. Selection,\n * visibility, removal and an add palette are each on when their handler is given.\n */\nexport function LayerList(props: LayerListProps) {\n const { items, collapsedIds, onCollapsedChange, title, addKinds, onAdd, empty, className } = props;\n // Only the user's own toggles are state; everything else reads the layer's\n // `defaultCollapsed`, so a layer added later starts the way it asks to.\n const [toggled, setToggled] = useState<ReadonlyMap<string, boolean>>(new Map());\n const collapsed = collapsedIds\n ? new Set(collapsedIds)\n : collectCollapsed(items, (item) => toggled.get(item.id) ?? item.defaultCollapsed === true);\n const toggle = (id: string) => {\n const next = new Set(collapsed);\n if (next.has(id)) next.delete(id);\n else next.add(id);\n if (!collapsedIds) setToggled((prev) => new Map(prev).set(id, next.has(id)));\n onCollapsedChange?.([...next]);\n };\n\n // The press arrives after the drag session ends, which can be after a render\n // the closure did not see, so it reads the selection from here.\n const live = useLatest(props);\n const press = (item: LayerListItem, mods: PressModifiers) => {\n const { selectedIds = [], onSelect } = live.current;\n if (!onSelect) return;\n anchor.current = item.id;\n if (item.locked || !mods.shiftKey) {\n onSelect([item.id]);\n return;\n }\n // A leftover locked selection does not carry into a multi-selection.\n const locked = new Set(lockedIds(live.current.items));\n const kept = selectedIds.filter((id) => !locked.has(id));\n onSelect(kept.includes(item.id) ? kept.filter((id) => id !== item.id) : [...kept, item.id]);\n };\n\n const bodies = new Map<string, ReactNode>();\n const collectBodies = (list: LayerListItem[]) => {\n for (const it of list) {\n bodies.set(it.id, props.renderBody ? props.renderBody(it) : null);\n if (it.children) collectBodies(it.children);\n }\n };\n collectBodies(items);\n\n // The rows the arrow keys walk: open branches only, and not cards, whose\n // heads are their own controls.\n const visible: VisibleRow[] = [];\n const walk = (list: LayerListItem[], parentId: string | null, level: number) => {\n for (const item of list) {\n if (!hasBody(bodies.get(item.id))) visible.push({ item, parentId, level });\n if (item.children?.length && !collapsed.has(item.id)) walk(item.children, item.id, level + 1);\n }\n };\n walk(items, null, 1);\n\n const rowEls = useRef(new Map<string, HTMLElement>());\n const [focusId, setFocusId] = useState<string | null>(null);\n const pendingFocus = useRef<string | null>(null);\n const anchor = useRef<string | null>(null);\n const nudgers = useRef(new Map<string | null, (id: string, delta: -1 | 1) => boolean>()).current;\n useLayoutEffect(() => {\n const id = pendingFocus.current;\n if (id === null) return;\n pendingFocus.current = null;\n const el = rowEls.current.get(id);\n if (el && document.activeElement !== el) el.focus();\n });\n\n const selectedIds = props.selectedIds ?? [];\n const tabStop = visible.some((v) => v.item.id === focusId)\n ? (focusId ?? undefined)\n : (visible.find((v) => selectedIds.includes(v.item.id)) ?? visible[0])?.item.id;\n\n const focusRow = (id: string) => {\n pendingFocus.current = id;\n setFocusId(id);\n };\n // Locked rows never join a multi-selection, so a range passes over them.\n const selectRange = (to: string) => {\n const from = anchor.current ?? to;\n const a = visible.findIndex((v) => v.item.id === from);\n const b = visible.findIndex((v) => v.item.id === to);\n if (a < 0 || b < 0) return;\n const range = visible\n .slice(Math.min(a, b), Math.max(a, b) + 1)\n .filter((v) => !v.item.locked)\n .map((v) => v.item.id);\n if (range.length > 0) live.current.onSelect?.(range);\n };\n\n const keys: RowKeys = {\n tabStop,\n register: (id) => (el) => {\n if (el) rowEls.current.set(id, el);\n else rowEls.current.delete(id);\n },\n onFocus: (id) => {\n setFocusId(id);\n anchor.current ??= id;\n },\n onKeyDown: (item, parentId) => (e) => {\n // Keys on a control inside the row are the control's.\n if (e.target !== e.currentTarget) return;\n const at = visible.findIndex((v) => v.item.id === item.id);\n const go = (index: number) => {\n const next = visible[Math.max(0, Math.min(visible.length - 1, index))];\n if (!next) return;\n focusRow(next.item.id);\n if (e.shiftKey && props.onSelect) selectRange(next.item.id);\n else anchor.current = next.item.id;\n };\n const branch = (item.children?.length ?? 0) > 0;\n const open = branch && !collapsed.has(item.id);\n switch (e.key) {\n case 'ArrowDown':\n case 'ArrowUp': {\n const delta = e.key === 'ArrowDown' ? 1 : -1;\n if (e.altKey) {\n if (nudgers.get(parentId)?.(item.id, delta)) pendingFocus.current = item.id;\n } else {\n go(at + delta);\n }\n break;\n }\n case 'Home':\n go(0);\n break;\n case 'End':\n go(visible.length - 1);\n break;\n case 'ArrowRight':\n if (branch && !open) toggle(item.id);\n else if (open) go(at + 1);\n else return;\n break;\n case 'ArrowLeft':\n if (open) toggle(item.id);\n else if (parentId !== null) go(visible.findIndex((v) => v.item.id === parentId));\n else return;\n break;\n case 'Enter':\n case ' ':\n press(item, { shiftKey: e.shiftKey, ctrlKey: e.ctrlKey, metaKey: e.metaKey, altKey: e.altKey });\n break;\n default:\n return;\n }\n e.preventDefault();\n },\n };\n\n const uid = useId();\n const shared: Shared = { props, collapsed, toggle, press, uid, nested: anyNested(items), bodies, nudgers, keys };\n const palette = onAdd ? (addKinds ?? []) : [];\n const cls = className ? `${s.root} ${className}` : s.root;\n\n return (\n <div className={cls}>\n {(title !== undefined || palette.length > 0) && (\n <div className={s.head}>\n {title !== undefined && <h2 className={s.title}>{title}</h2>}\n <div className={s.palette}>\n {palette.map((kind) => (\n <button\n key={kind}\n type=\"button\"\n className={s.add}\n aria-label={`Add ${kind}`}\n onClick={() => {\n dlog('layer-list', 'onAdd', { kind });\n onAdd?.(kind);\n }}\n >\n {kind}\n </button>\n ))}\n </div>\n </div>\n )}\n {items.length === 0 ? (\n <div className={rows.empty}>\n {empty ?? (palette.length > 0 ? 'No layers — add one above.' : 'No layers.')}\n </div>\n ) : (\n <Level items={items} parentId={null} shared={shared} path=\"\" level={1} />\n )}\n </div>\n );\n}\n\nfunction lockedIds(items: LayerListItem[]): string[] {\n const out: string[] = [];\n for (const it of items) {\n if (it.locked) out.push(it.id);\n if (it.children) out.push(...lockedIds(it.children));\n }\n return out;\n}\n\ninterface LevelProps {\n items: LayerListItem[];\n parentId: string | null;\n shared: Shared;\n path: string;\n level: number;\n}\n\n/** One sibling group. Each has its own drag, so a drag stays under one parent. */\nfunction Level({ items, parentId, shared, path, level }: LevelProps) {\n const { props } = shared;\n const selected = props.selectedIds ?? [];\n const drag = useReorderDragList({\n // With no `onReorder` every row is a locked one to the drag, so a press\n // still reaches `onPress` and nothing ever engages.\n items: items.map((it) => ({ id: it.id, label: it.label, locked: it.locked || !props.onReorder })),\n selectedIds: items.filter((it) => selected.includes(it.id)).map((it) => it.id),\n onReorder: (ids, target) => {\n const moving = new Set(ids);\n const inOrder = items.filter((it) => moving.has(it.id)).map((it) => it.id);\n // The hook's index counts the dragged rows; a move's index does not.\n const before = items.slice(0, target).filter((it) => moving.has(it.id)).length;\n const move = { ids: inOrder, parentId, index: target - before };\n dlog('layer-list', 'onReorder', move);\n props.onReorder?.(move);\n },\n onPress: (id, mods) => {\n const item = items.find((it) => it.id === id);\n if (item) shared.press(item, mods);\n },\n });\n shared.nudgers.set(parentId, (id, delta) =>\n drag.nudge(id, items.findIndex((it) => it.id === id), delta),\n );\n const [el, setEl] = useState<HTMLDivElement | null>(null);\n const bind = (node: HTMLDivElement | null) => {\n setEl(node);\n (drag.containerProps.ref as RefCallback<HTMLDivElement>)(node);\n };\n\n const bodies = items.map((it) => shared.bodies.get(it.id));\n const cards = bodies.some(hasBody);\n const { draggedIds, targetIndex, ghost } = drag.state;\n\n const entry = (item: LayerListItem, i: number, ghosted: boolean) => {\n const body = bodies[i];\n const kids = item.children ?? [];\n const open = !shared.collapsed.has(item.id);\n const childId = `${shared.uid}${path}-${i}`;\n const onPointerDown = ghosted ? undefined : drag.rowProps(item.id, i).onPointerDown;\n const isSelected = selected.includes(item.id);\n const cls = [s.entry];\n if (!ghosted) {\n if (draggedIds?.includes(item.id)) cls.push(s.dragging);\n if (targetIndex === i && !draggedIds?.includes(item.id)) cls.push(s.dropBefore);\n if (targetIndex === items.length && i === items.length - 1) cls.push(s.dropAfter);\n }\n const controls = <Controls item={item} shared={shared} />;\n const head =\n hasBody(body) ? (\n <PropertyGroup\n className={s.card}\n title={item.title ?? item.label}\n {...(item.tone === undefined ? {} : { tone: item.tone })}\n collapsed={ghosted || !open}\n onCollapsedChange={() => shared.toggle(item.id)}\n leading={\n <Handle\n item={item}\n reorder={props.onReorder !== undefined}\n onPointerDown={onPointerDown}\n onNudge={(delta) => shared.nudgers.get(parentId)?.(item.id, delta)}\n />\n }\n actions={ghosted ? undefined : controls}\n >\n {ghosted ? null : body}\n </PropertyGroup>\n ) : (\n <div\n className={[rows.row, s.row, isSelected ? rows.selected : ''].filter(Boolean).join(' ')}\n data-selected={isSelected ? 'true' : undefined}\n data-locked={item.locked ? 'true' : undefined}\n onPointerDown={onPointerDown}\n {...(ghosted\n ? {}\n : {\n role: 'row',\n 'aria-level': level,\n ...(kids.length > 0 ? { 'aria-expanded': open } : {}),\n ...(props.onSelect ? { 'aria-selected': isSelected } : {}),\n tabIndex: shared.keys.tabStop === item.id ? 0 : -1,\n ref: shared.keys.register(item.id),\n onKeyDown: shared.keys.onKeyDown(item, parentId),\n onFocus: () => shared.keys.onFocus(item.id),\n })}\n >\n {shared.nested &&\n (kids.length > 0 ? (\n <span className={s.stop} onPointerDown={stop}>\n <Disclosure\n open={open}\n onToggle={() => shared.toggle(item.id)}\n label={`${item.label} sublayers`}\n controls={childId}\n />\n </span>\n ) : (\n <span className={s.twistyGap} />\n ))}\n <Grip item={item} reorder={props.onReorder !== undefined} />\n {props.onVisibilityChange &&\n (item.locked ? (\n <span className={s.check} />\n ) : (\n <input\n className={s.check}\n type=\"checkbox\"\n checked={item.visible !== false}\n onPointerDown={stop}\n onChange={(e) => props.onVisibilityChange?.(item.id, e.target.checked)}\n aria-label={`Show ${item.label}`}\n />\n ))}\n {item.leading}\n <span className={rows.label}>{item.title ?? item.label}</span>\n {ghosted ? null : <Remove item={item} shared={shared} />}\n </div>\n );\n return (\n <div key={item.id} role=\"none\" className={cls.join(' ')} data-selected={isSelected ? 'true' : undefined}>\n {head}\n {!ghosted && kids.length > 0 && open && (\n <div id={childId} role=\"rowgroup\" className={s.children}>\n <Level items={kids} parentId={item.id} shared={shared} path={`${path}-${i}`} level={level + 1} />\n </div>\n )}\n </div>\n );\n };\n\n return (\n <>\n {cards ? (\n <PropertyList ref={bind} className={`${s.level} ${s.cards}`}>\n {items.map((it, i) => entry(it, i, false))}\n </PropertyList>\n ) : (\n <div\n ref={bind}\n className={s.level}\n {...(parentId === null\n ? {\n role: 'treegrid',\n 'aria-label': props.label ?? props.title ?? 'Layers',\n ...(props.onSelect ? { 'aria-multiselectable': true } : {}),\n }\n : { role: 'none' })}\n >\n {items.map((it, i) => entry(it, i, false))}\n </div>\n )}\n {ghost && el ? (\n <DragGhost at={ghost} from={el}>\n {items.map((it, i) => (ghost.ids.includes(it.id) ? entry(it, i, true) : null))}\n </DragGhost>\n ) : null}\n </>\n );\n}\n\n// Keeps a press on a control inside a row from also starting the row's press.\nconst stop = (e: { stopPropagation(): void }) => e.stopPropagation();\n\n/** A row's grip: decoration, since the whole row takes the drag. */\nfunction Grip({ item, reorder }: { item: LayerListItem; reorder: boolean }) {\n if (item.locked) {\n return (\n <span className={s.lock} role=\"img\" aria-label=\"Locked\">\n <LockIcon size={12} />\n </span>\n );\n }\n if (!reorder && item.badge === undefined) return null;\n return (\n <span className={s.grip} aria-hidden=\"true\">\n {item.badge ?? <DragGrip size={13} />}\n </span>\n );\n}\n\n/** A card's handle: the drag target, since the rest of its head folds it, and\n * Alt+Up/Down on it moves the card. */\nfunction Handle({\n item,\n reorder,\n onPointerDown,\n onNudge,\n}: {\n item: LayerListItem;\n reorder: boolean;\n onPointerDown: ((e: React.PointerEvent) => void) | undefined;\n onNudge: (delta: -1 | 1) => void;\n}) {\n if (item.locked) return <Grip item={item} reorder={reorder} />;\n if (!reorder && item.badge === undefined) return undefined;\n return (\n <button\n type=\"button\"\n className={s.handle}\n aria-label={`Drag to reorder ${item.label}`}\n aria-keyshortcuts=\"Alt+ArrowUp Alt+ArrowDown\"\n onPointerDown={onPointerDown}\n onKeyDown={(e) => {\n if (!e.altKey || (e.key !== 'ArrowUp' && e.key !== 'ArrowDown')) return;\n e.preventDefault();\n onNudge(e.key === 'ArrowUp' ? -1 : 1);\n }}\n >\n {item.badge ?? <DragGrip />}\n </button>\n );\n}\n\nfunction Controls({ item, shared }: { item: LayerListItem; shared: Shared }) {\n const { onVisibilityChange } = shared.props;\n return (\n <>\n {onVisibilityChange && !item.locked && (\n <input\n className={s.check}\n type=\"checkbox\"\n checked={item.visible !== false}\n onClick={stop}\n onChange={(e) => onVisibilityChange(item.id, e.target.checked)}\n aria-label={`Show ${item.label}`}\n />\n )}\n <Remove item={item} shared={shared} />\n </>\n );\n}\n\nfunction Remove({ item, shared }: { item: LayerListItem; shared: Shared }) {\n const { onRemove } = shared.props;\n if (!onRemove || item.locked) return null;\n return (\n <span className={s.stop} onPointerDown={stop}>\n <CloseButton ariaLabel={`Remove ${item.label}`} onClick={() => onRemove(item.id)} />\n </span>\n );\n}\n","import { asNodeId, createMoveToIndexOp, dispatchApplyBatch } from '@weasel-js/core';\nimport type { NodeId, Scene, SceneNode, SelectionApi } from '@weasel-js/core';\nimport type { LayerListItem, LayerListProps } from './LayerList';\n\n/** Arguments for {@link useSceneLayerList}. */\nexport interface UseSceneLayerListArgs<TData, TLayer extends string, TPose> {\n scene: Scene<TData, TLayer, TPose>;\n selection: SelectionApi;\n /** What the reorder op is dispatched against — the adapter `<SceneCanvas>` uses. */\n adapter: object;\n /** A row's content for a node: its label, a leading swatch or icon, whether it is locked. */\n itemFor: (node: SceneNode<TData, TLayer, TPose>) => Omit<LayerListItem, 'id' | 'children'>;\n /** Label of the reorder's history entry. Default `'Reorder'`. */\n label?: string;\n}\n\n/**\n * The props that put a scene in a `<LayerList>`: a row per node, a container's\n * children nested under it, the front-most at the top, selection read from and\n * written to `selection`, and a drag dispatched as a `MoveToIndexOp`.\n */\nexport function useSceneLayerList<TData, TLayer extends string, TPose>(\n args: UseSceneLayerListArgs<TData, TLayer, TPose>,\n): Required<Pick<LayerListProps, 'items' | 'selectedIds' | 'onSelect' | 'onReorder'>> {\n const { scene, selection, adapter, itemFor, label = 'Reorder' } = args;\n\n // A scene orders children back to front and the list front to back. Rebuilt\n // every render: the scene keeps its identity across a reorder, so a memo keyed\n // on it would serve the order from before.\n const build = (ids: readonly NodeId[]): LayerListItem[] =>\n [...ids].reverse().flatMap((id) => {\n const node = scene.get(id);\n if (!node) return [];\n const kids = scene.childrenOf(id);\n return [{ ...itemFor(node), id, ...(kids.length > 0 ? { children: build(kids) } : {}) }];\n });\n\n return {\n items: build(scene.roots),\n selectedIds: selection.current.map(String),\n onSelect: (ids) => selection.set(ids.map(asNodeId)),\n onReorder: ({ ids, parentId, index }) => {\n const siblings = parentId === null ? scene.roots : scene.childrenOf(asNodeId(parentId));\n // `index` counts from the front among the siblings the drag left behind.\n const back = siblings.length - ids.length - index;\n dispatchApplyBatch(adapter, [createMoveToIndexOp({ ids, parentId, index: Math.max(0, back) })], label);\n },\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AC6FA,SAAgBe,EAAW,GAAwB,GAAkC;CAEnF,OADIC,EAAK,aAAa,OAAaC,EAAQC,GAAOF,CAAI,IAC/CE,EAAM,KAAK,MACZC,EAAK,OAAOH,EAAK,WAAiB;EAAE,GAAGG;EAAM,UAAUF,EAAQE,EAAK,YAAY,CAAC,GAAGH,CAAI;CAAE,IACvFG,EAAK,WAAW;EAAE,GAAGA;EAAM,UAAUJ,EAAWI,EAAK,UAA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