@weasel-js/ui 1.5.2 → 1.6.0
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-CYvfmEz0.js +57 -0
- package/dist/chunks/ActionBar-CYvfmEz0.js.map +1 -0
- package/dist/chunks/{Badge-CW9pBPFl.js → Badge-DZ0lFs14.js} +755 -738
- package/dist/chunks/Badge-DZ0lFs14.js.map +1 -0
- package/dist/chunks/{BandEditor-jY-PFKY6.js → BandEditor-D-nVrVO4.js} +34 -34
- package/dist/chunks/{BandEditor-jY-PFKY6.js.map → BandEditor-D-nVrVO4.js.map} +1 -1
- package/dist/chunks/Button-Dyp31jMt.js +111 -0
- package/dist/chunks/Button-Dyp31jMt.js.map +1 -0
- package/dist/chunks/ButtonBar-smZzFuEo.js +46 -0
- package/dist/chunks/ButtonBar-smZzFuEo.js.map +1 -0
- package/dist/chunks/Callout-xLjnx7Mp.js +119 -0
- package/dist/chunks/Callout-xLjnx7Mp.js.map +1 -0
- package/dist/chunks/{Checkbox-BOsDAY2F.js → Checkbox-ChZz30Ds.js} +1 -1
- package/dist/chunks/{Checkbox-BOsDAY2F.js.map → Checkbox-ChZz30Ds.js.map} +1 -1
- package/dist/chunks/Code-v4tDWuuN.js +24 -0
- package/dist/chunks/Code-v4tDWuuN.js.map +1 -0
- package/dist/chunks/{ColorField-BYzgZM9o.js → ColorField-DJSCuSJv.js} +15 -15
- package/dist/chunks/ColorField-DJSCuSJv.js.map +1 -0
- package/dist/chunks/ColorModeControl-JOEiqtE0.js +47 -0
- package/dist/chunks/ColorModeControl-JOEiqtE0.js.map +1 -0
- package/dist/chunks/{ComboBox-Cz3f0Y_8.js → ComboBox-C1JgIpML.js} +2 -2
- package/dist/chunks/{ComboBox-Cz3f0Y_8.js.map → ComboBox-C1JgIpML.js.map} +1 -1
- package/dist/chunks/{CurveEditor-DXwSP-iA.js → CurveEditor-f1R4kSbD.js} +2 -2
- package/dist/chunks/{CurveEditor-DXwSP-iA.js.map → CurveEditor-f1R4kSbD.js.map} +1 -1
- package/dist/chunks/DataGrid-CZPrB_3a.js +152 -0
- package/dist/chunks/DataGrid-CZPrB_3a.js.map +1 -0
- package/dist/chunks/DetailList-DHaXX4TG.js +43 -0
- package/dist/chunks/DetailList-DHaXX4TG.js.map +1 -0
- package/dist/chunks/{DetentSlider-CAubVX0J.js → DetentSlider-BYyaZha6.js} +2 -2
- package/dist/chunks/{DetentSlider-CAubVX0J.js.map → DetentSlider-BYyaZha6.js.map} +1 -1
- package/dist/chunks/Dialog-GIvjoDQj.js +66 -0
- package/dist/chunks/Dialog-GIvjoDQj.js.map +1 -0
- package/dist/chunks/Disclosure-D79jhmh2.js +58 -0
- package/dist/chunks/Disclosure-D79jhmh2.js.map +1 -0
- package/dist/chunks/DragGhost-DcU7cOwy.js +30 -0
- package/dist/chunks/DragGhost-DcU7cOwy.js.map +1 -0
- package/dist/chunks/{DragHandleGlyph-CppAz4_8.js → DragHandleGlyph-BtBxHjZS.js} +1 -1
- package/dist/chunks/{DragHandleGlyph-CppAz4_8.js.map → DragHandleGlyph-BtBxHjZS.js.map} +1 -1
- package/dist/chunks/{Field-DWnV8WZY.js → Field-xbqRmjsI.js} +1 -1
- package/dist/chunks/{Field-DWnV8WZY.js.map → Field-xbqRmjsI.js.map} +1 -1
- package/dist/chunks/FillStrokeSwatch-BViKXIPx.js +111 -0
- package/dist/chunks/FillStrokeSwatch-BViKXIPx.js.map +1 -0
- package/dist/chunks/{FontFamilySelect-DxfgTC3G.js → FontFamilySelect-r9TV_xIH.js} +2 -2
- package/dist/chunks/{FontFamilySelect-DxfgTC3G.js.map → FontFamilySelect-r9TV_xIH.js.map} +1 -1
- package/dist/chunks/GradientEditor-BRTxHG-W.js +333 -0
- package/dist/chunks/{GradientEditor-rRBmf3G0.js.map → GradientEditor-BRTxHG-W.js.map} +1 -1
- package/dist/chunks/{Icon-DT0x6HaQ.js → Icon-BW0qv_U7.js} +28 -20
- package/dist/chunks/Icon-BW0qv_U7.js.map +1 -0
- package/dist/chunks/InlineRange-BwGFDhpT.js +29 -0
- package/dist/chunks/InlineRange-BwGFDhpT.js.map +1 -0
- package/dist/chunks/{Input-DbMKpkXy.js → Input-Bx2cuUbS.js} +24 -19
- package/dist/chunks/Input-Bx2cuUbS.js.map +1 -0
- package/dist/chunks/ItemList-DzJ2lK0R.js +175 -0
- package/dist/chunks/ItemList-DzJ2lK0R.js.map +1 -0
- package/dist/chunks/ItemList.module-DDUXfuZL.js +14 -0
- package/dist/chunks/ItemList.module-DDUXfuZL.js.map +1 -0
- package/dist/chunks/{Jog-DkkTlL3_.js → Jog-LPoac9s4.js} +6 -6
- package/dist/chunks/{Jog-DkkTlL3_.js.map → Jog-LPoac9s4.js.map} +1 -1
- package/dist/chunks/{Keycaps-DunVpejA.js → Keycaps-CKiKOJnJ.js} +71 -65
- package/dist/chunks/Keycaps-CKiKOJnJ.js.map +1 -0
- package/dist/chunks/LayerList-BeGrkLb9.js +427 -0
- package/dist/chunks/LayerList-BeGrkLb9.js.map +1 -0
- package/dist/chunks/ListEditor-C6zLzCsJ.js +74 -0
- package/dist/chunks/ListEditor-C6zLzCsJ.js.map +1 -0
- package/dist/chunks/MenuButton-BcdhrNGh.js +70 -0
- package/dist/chunks/MenuButton-BcdhrNGh.js.map +1 -0
- package/dist/chunks/MeshEditor-BOOIFWnz.js +87 -0
- package/dist/chunks/MeshEditor-BOOIFWnz.js.map +1 -0
- package/dist/chunks/{NumberField-CCjEDZCg.js → NumberField-C1Y7zP-a.js} +27 -22
- package/dist/chunks/NumberField-C1Y7zP-a.js.map +1 -0
- package/dist/chunks/{OptionsBar-DeQ-vUeZ.js → OptionsBar-DlcagPYK.js} +3 -3
- package/dist/chunks/{OptionsBar-DeQ-vUeZ.js.map → OptionsBar-DlcagPYK.js.map} +1 -1
- package/dist/chunks/{PaintField-jBOJ32rL.js → PaintField-B2mLRZa4.js} +20 -20
- package/dist/chunks/PaintField-B2mLRZa4.js.map +1 -0
- package/dist/chunks/{PaintInput-Qs7Rul5R.js → PaintInput-BFKhd83I.js} +24 -24
- package/dist/chunks/{PaintInput-Qs7Rul5R.js.map → PaintInput-BFKhd83I.js.map} +1 -1
- package/dist/chunks/{PatternPicker-BMpXWboq.js → PatternPicker-DdfpxoQy.js} +2 -2
- package/dist/chunks/{PatternPicker-BMpXWboq.js.map → PatternPicker-DdfpxoQy.js.map} +1 -1
- package/dist/chunks/{Plot2D-CXf_f7QD.js → Plot2D-lyO7waPQ.js} +1 -1
- package/dist/chunks/{Plot2D-CXf_f7QD.js.map → Plot2D-lyO7waPQ.js.map} +1 -1
- package/dist/chunks/{PointPlotter-S_gz7VYt.js → PointPlotter-DGs9i5P-.js} +2 -2
- package/dist/chunks/{PointPlotter-S_gz7VYt.js.map → PointPlotter-DGs9i5P-.js.map} +1 -1
- package/dist/chunks/{Powerline-Ak5AWUlK.js → Powerline-DBEPceLE.js} +4 -2
- package/dist/chunks/Powerline-DBEPceLE.js.map +1 -0
- package/dist/chunks/Prefs-Ctu0H4-b.js +475 -0
- package/dist/chunks/Prefs-Ctu0H4-b.js.map +1 -0
- package/dist/chunks/Properties-Bbneh1ws.js +281 -0
- package/dist/chunks/Properties-Bbneh1ws.js.map +1 -0
- package/dist/chunks/PropertyField-CDb19d3F.js +756 -0
- package/dist/chunks/PropertyField-CDb19d3F.js.map +1 -0
- package/dist/chunks/{RadioGroup-CsVp3SEu.js → RadioGroup-BK2mD6Q0.js} +2 -2
- package/dist/chunks/{RadioGroup-CsVp3SEu.js.map → RadioGroup-BK2mD6Q0.js.map} +1 -1
- package/dist/chunks/{RangeSlider-DNr-pJpZ.js → RangeSlider-BiRAOsTh.js} +1 -1
- package/dist/chunks/{RangeSlider-DNr-pJpZ.js.map → RangeSlider-BiRAOsTh.js.map} +1 -1
- package/dist/chunks/{ResizeHandle-RXFf5fXr.js → ResizeHandle-Cc6EOehs.js} +9 -9
- package/dist/chunks/{ResizeHandle-RXFf5fXr.js.map → ResizeHandle-Cc6EOehs.js.map} +1 -1
- package/dist/chunks/Select-DVValBe1.js +225 -0
- package/dist/chunks/Select-DVValBe1.js.map +1 -0
- package/dist/chunks/{SelectionPanel-CEbLS-0D.js → SelectionPanel-C5LmZA7b.js} +21 -20
- package/dist/chunks/{SelectionPanel-CEbLS-0D.js.map → SelectionPanel-C5LmZA7b.js.map} +1 -1
- package/dist/chunks/{Sidebar-qn_oSCNX.js → Sidebar-DKKd4R-x.js} +1 -1
- package/dist/chunks/{Sidebar-qn_oSCNX.js.map → Sidebar-DKKd4R-x.js.map} +1 -1
- package/dist/chunks/{SidebarPanel-Bs6V21hg.js → SidebarPanel-u5NsuAZY.js} +15 -19
- package/dist/chunks/SidebarPanel-u5NsuAZY.js.map +1 -0
- package/dist/chunks/{Slider-CIIrqiFS.js → Slider-BwRrWHFW.js} +42 -42
- package/dist/chunks/{Slider-CIIrqiFS.js.map → Slider-BwRrWHFW.js.map} +1 -1
- package/dist/chunks/{StatusBar-B4L15DSm.js → StatusBar-CdPdmmda.js} +1 -1
- package/dist/chunks/{StatusBar-B4L15DSm.js.map → StatusBar-CdPdmmda.js.map} +1 -1
- package/dist/chunks/SwatchGrid-C-Zx2Exd.js +73 -0
- package/dist/chunks/SwatchGrid-C-Zx2Exd.js.map +1 -0
- package/dist/chunks/{Switch-DH5POG0T.js → Switch-DxF7TsEu.js} +1 -1
- package/dist/chunks/{Switch-DH5POG0T.js.map → Switch-DxF7TsEu.js.map} +1 -1
- package/dist/chunks/{Tabs-BFHikpml.js → Tabs-GXEfoe3o.js} +1 -1
- package/dist/chunks/{Tabs-BFHikpml.js.map → Tabs-GXEfoe3o.js.map} +1 -1
- package/dist/chunks/{Timeline-DNKY_yiK.js → Timeline-SgmpQtUV.js} +128 -132
- package/dist/chunks/Timeline-SgmpQtUV.js.map +1 -0
- package/dist/chunks/{Toast-CI1UDuK6.js → Toast-BfcljZz6.js} +1 -1
- package/dist/chunks/{Toast-CI1UDuK6.js.map → Toast-BfcljZz6.js.map} +1 -1
- package/dist/chunks/ToggleBar-Btnl5r7F.js +80 -0
- package/dist/chunks/{ToggleBar-CClus5Cd.js.map → ToggleBar-Btnl5r7F.js.map} +1 -1
- package/dist/chunks/{TokenPanel-BPHq24dc.js → TokenPanel-5ajHEHha.js} +40 -40
- package/dist/chunks/{TokenPanel-BPHq24dc.js.map → TokenPanel-5ajHEHha.js.map} +1 -1
- package/dist/chunks/{ToolButton-9QzJCmuM.js → ToolButton-rzqlFlAc.js} +4 -4
- package/dist/chunks/{ToolButton-9QzJCmuM.js.map → ToolButton-rzqlFlAc.js.map} +1 -1
- package/dist/chunks/{ToolGroup-BJiDrH_i.js → ToolGroup-4bUBV5k6.js} +1 -1
- package/dist/chunks/{ToolGroup-BJiDrH_i.js.map → ToolGroup-4bUBV5k6.js.map} +1 -1
- package/dist/chunks/{ToolOptionsBar-CAM6RcUH.js → ToolOptionsBar-BF3TNXA3.js} +2 -2
- package/dist/chunks/{ToolOptionsBar-CAM6RcUH.js.map → ToolOptionsBar-BF3TNXA3.js.map} +1 -1
- package/dist/chunks/ToolPalette-Uw4PvWwa.js +83 -0
- package/dist/chunks/ToolPalette-Uw4PvWwa.js.map +1 -0
- package/dist/chunks/{Tooltip-C4YBczLq.js → Tooltip-9XiJF937.js} +13 -13
- package/dist/chunks/Tooltip-9XiJF937.js.map +1 -0
- package/dist/chunks/Tree-BGt6P8tI.js +203 -0
- package/dist/chunks/Tree-BGt6P8tI.js.map +1 -0
- package/dist/chunks/{createKeyframeLayer-DKtO0Sw_.js → createKeyframeLayer-BzDRCrrh.js} +71 -71
- package/dist/chunks/{createKeyframeLayer-DKtO0Sw_.js.map → createKeyframeLayer-BzDRCrrh.js.map} +1 -1
- package/dist/chunks/formatShortcut-BoGqUoWi.js +15 -0
- package/dist/chunks/formatShortcut-BoGqUoWi.js.map +1 -0
- package/dist/chunks/icons-DbScMMqX.js +179 -0
- package/dist/chunks/icons-DbScMMqX.js.map +1 -0
- package/dist/chunks/interactiveTarget-C7QUBaJN.js +24 -0
- package/dist/chunks/interactiveTarget-C7QUBaJN.js.map +1 -0
- package/dist/chunks/{keyGlyph-Bp0wnLHn.js → keyGlyph-CLvUHU8c.js} +1 -1
- package/dist/chunks/{keyGlyph-Bp0wnLHn.js.map → keyGlyph-CLvUHU8c.js.map} +1 -1
- package/dist/chunks/model-BQMvTLnW.js +360 -0
- package/dist/chunks/model-BQMvTLnW.js.map +1 -0
- package/dist/chunks/{number-BHz66zQO.js → number-6S8IzXVt.js} +3 -3
- package/dist/chunks/number-6S8IzXVt.js.map +1 -0
- package/dist/chunks/paintPreview-DPtZS4yU.js +42 -0
- package/dist/chunks/paintPreview-DPtZS4yU.js.map +1 -0
- package/dist/chunks/paintValue-Bz6AVuh3.js +18 -0
- package/dist/chunks/paintValue-Bz6AVuh3.js.map +1 -0
- package/dist/chunks/prefField-CLkhrvYl.js +197 -0
- package/dist/chunks/prefField-CLkhrvYl.js.map +1 -0
- package/dist/chunks/segmentTooltip-CAkZlW-t.js +29 -0
- package/dist/chunks/segmentTooltip-CAkZlW-t.js.map +1 -0
- package/dist/chunks/segmentedControl.module-D2nw68Yo.js +11 -0
- package/dist/chunks/segmentedControl.module-D2nw68Yo.js.map +1 -0
- package/dist/chunks/{snap-CEjuWOhN.js → snap-DC4Km8xG.js} +1 -1
- package/dist/chunks/{snap-CEjuWOhN.js.map → snap-DC4Km8xG.js.map} +1 -1
- package/dist/chunks/stance-CarrcbbP.js +17 -0
- package/dist/chunks/stance-CarrcbbP.js.map +1 -0
- package/dist/chunks/useReorderDragList-Dcezzgix.js +131 -0
- package/dist/chunks/useReorderDragList-Dcezzgix.js.map +1 -0
- package/dist/chunks/{useRovingTabIndex-Dkpf_KhN.js → useRovingTabIndex-B4uJqiKP.js} +1 -1
- package/dist/chunks/useRovingTabIndex-B4uJqiKP.js.map +1 -0
- package/dist/color/ramp.d.ts +38 -0
- package/dist/color/ramp.d.ts.map +1 -0
- package/dist/components/ActionBar/ActionBar.d.ts +6 -4
- package/dist/components/ActionBar/ActionBar.d.ts.map +1 -1
- package/dist/components/ActionBar/index.js +1 -1
- package/dist/components/Badge/Badge.d.ts +21 -7
- package/dist/components/Badge/Badge.d.ts.map +1 -1
- package/dist/components/Badge/effects/Aqua.d.ts +1 -1
- package/dist/components/Badge/effects/Aqua.d.ts.map +1 -1
- package/dist/components/Badge/index.d.ts +1 -1
- package/dist/components/Badge/index.d.ts.map +1 -1
- package/dist/components/Badge/index.js +1 -1
- package/dist/components/Badge/types.d.ts +6 -5
- package/dist/components/Badge/types.d.ts.map +1 -1
- package/dist/components/BandEditor/index.js +1 -1
- package/dist/components/Button/Button.d.ts +17 -3
- package/dist/components/Button/Button.d.ts.map +1 -1
- package/dist/components/Button/index.d.ts +1 -1
- package/dist/components/Button/index.d.ts.map +1 -1
- package/dist/components/Button/index.js +1 -1
- package/dist/components/ButtonBar/ButtonBar.d.ts +36 -0
- package/dist/components/ButtonBar/ButtonBar.d.ts.map +1 -0
- package/dist/components/ButtonBar/index.d.ts +3 -0
- package/dist/components/ButtonBar/index.d.ts.map +1 -0
- package/dist/components/ButtonBar/index.js +2 -0
- package/dist/components/Callout/Callout.d.ts +2 -5
- package/dist/components/Callout/Callout.d.ts.map +1 -1
- package/dist/components/Callout/index.d.ts +1 -1
- package/dist/components/Callout/index.d.ts.map +1 -1
- package/dist/components/Callout/index.js +1 -1
- package/dist/components/Checkbox/index.js +1 -1
- package/dist/components/Code/Code.d.ts +28 -0
- package/dist/components/Code/Code.d.ts.map +1 -0
- package/dist/components/Code/index.d.ts +3 -0
- package/dist/components/Code/index.d.ts.map +1 -0
- package/dist/components/Code/index.js +2 -0
- package/dist/components/ColorField/index.js +1 -1
- package/dist/components/ColorModeControl/ColorModeControl.d.ts +21 -0
- package/dist/components/ColorModeControl/ColorModeControl.d.ts.map +1 -0
- package/dist/components/ColorModeControl/index.d.ts +3 -0
- package/dist/components/ColorModeControl/index.d.ts.map +1 -0
- package/dist/components/ColorModeControl/index.js +2 -0
- package/dist/components/ComboBox/index.js +1 -1
- package/dist/components/CurveEditor/index.js +3 -3
- package/dist/components/DataGrid/DataGrid.d.ts +22 -0
- package/dist/components/DataGrid/DataGrid.d.ts.map +1 -1
- package/dist/components/DataGrid/index.js +1 -1
- package/dist/components/DetailList/DetailList.d.ts +36 -0
- package/dist/components/DetailList/DetailList.d.ts.map +1 -0
- package/dist/components/DetailList/index.d.ts +3 -0
- package/dist/components/DetailList/index.d.ts.map +1 -0
- package/dist/components/DetailList/index.js +2 -0
- package/dist/components/DetentSlider/index.js +1 -1
- package/dist/components/Dialog/Dialog.d.ts +8 -2
- package/dist/components/Dialog/Dialog.d.ts.map +1 -1
- package/dist/components/Dialog/index.js +1 -1
- package/dist/components/Disclosure/Disclosure.d.ts +25 -17
- package/dist/components/Disclosure/Disclosure.d.ts.map +1 -1
- package/dist/components/Disclosure/index.d.ts +2 -2
- package/dist/components/Disclosure/index.d.ts.map +1 -1
- package/dist/components/Disclosure/index.js +2 -2
- package/dist/components/DragGhost/DragGhost.d.ts +21 -0
- package/dist/components/DragGhost/DragGhost.d.ts.map +1 -0
- package/dist/components/DragGhost/index.d.ts +3 -0
- package/dist/components/DragGhost/index.d.ts.map +1 -0
- package/dist/components/DragGhost/index.js +2 -0
- package/dist/components/DragHandleGlyph/index.js +1 -1
- package/dist/components/Field/index.js +1 -1
- package/dist/components/FillStrokeSwatch/FillStrokeSwatch.d.ts +45 -0
- package/dist/components/FillStrokeSwatch/FillStrokeSwatch.d.ts.map +1 -0
- package/dist/components/FillStrokeSwatch/index.d.ts +3 -0
- package/dist/components/FillStrokeSwatch/index.d.ts.map +1 -0
- package/dist/components/FillStrokeSwatch/index.js +2 -0
- package/dist/components/FontFamilySelect/index.js +1 -1
- package/dist/components/GradientEditor/SceneGradientHandles.d.ts.map +1 -1
- package/dist/components/GradientEditor/index.js +1 -1
- package/dist/components/InlineRange/InlineRange.d.ts +6 -2
- package/dist/components/InlineRange/InlineRange.d.ts.map +1 -1
- package/dist/components/InlineRange/index.js +1 -1
- package/dist/components/Input/Input.d.ts +13 -0
- package/dist/components/Input/Input.d.ts.map +1 -1
- package/dist/components/Input/index.js +1 -1
- package/dist/components/ItemList/ItemList.d.ts +70 -10
- package/dist/components/ItemList/ItemList.d.ts.map +1 -1
- package/dist/components/ItemList/index.js +1 -1
- package/dist/components/Jog/index.js +1 -1
- package/dist/components/Keycaps/index.d.ts +1 -0
- package/dist/components/Keycaps/index.d.ts.map +1 -1
- package/dist/components/Keycaps/index.js +3 -3
- package/dist/components/Keycaps/keySpecsFromMods.d.ts +2 -0
- package/dist/components/Keycaps/keySpecsFromMods.d.ts.map +1 -1
- package/dist/components/Keycaps/keySpecsFromShortcut.d.ts +16 -0
- package/dist/components/Keycaps/keySpecsFromShortcut.d.ts.map +1 -0
- package/dist/components/LayerList/LayerList.d.ts +79 -0
- package/dist/components/LayerList/LayerList.d.ts.map +1 -0
- package/dist/components/LayerList/index.d.ts +3 -0
- package/dist/components/LayerList/index.d.ts.map +1 -0
- package/dist/components/LayerList/index.js +2 -0
- package/dist/components/LayerList/useSceneLayerList.d.ts +20 -0
- package/dist/components/LayerList/useSceneLayerList.d.ts.map +1 -0
- package/dist/components/ListEditor/ListEditor.d.ts +23 -0
- package/dist/components/ListEditor/ListEditor.d.ts.map +1 -0
- package/dist/components/ListEditor/index.d.ts +3 -0
- package/dist/components/ListEditor/index.d.ts.map +1 -0
- package/dist/components/ListEditor/index.js +2 -0
- package/dist/components/MenuButton/MenuButton.d.ts +6 -2
- 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/NumberField.d.ts +13 -0
- package/dist/components/NumberField/NumberField.d.ts.map +1 -1
- package/dist/components/NumberField/index.js +1 -1
- package/dist/components/OptionsBar/index.js +1 -1
- package/dist/components/PaintField/index.js +1 -1
- package/dist/components/PaintInput/index.js +1 -1
- package/dist/components/PatternPicker/index.js +1 -1
- package/dist/components/Plot2D/index.js +1 -1
- package/dist/components/PointPlotter/index.js +1 -1
- package/dist/components/Powerline/Powerline.d.ts +4 -3
- package/dist/components/Powerline/Powerline.d.ts.map +1 -1
- package/dist/components/Powerline/index.js +2 -2
- package/dist/components/Prefs/PrefsDialog.d.ts +10 -2
- package/dist/components/Prefs/PrefsDialog.d.ts.map +1 -1
- package/dist/components/Prefs/PrefsForm.d.ts +26 -25
- package/dist/components/Prefs/PrefsForm.d.ts.map +1 -1
- package/dist/components/Prefs/PrefsPane.d.ts +24 -0
- package/dist/components/Prefs/PrefsPane.d.ts.map +1 -0
- package/dist/components/Prefs/PrefsRail.d.ts +32 -0
- package/dist/components/Prefs/PrefsRail.d.ts.map +1 -0
- package/dist/components/Prefs/PrefsRow.d.ts +32 -0
- package/dist/components/Prefs/PrefsRow.d.ts.map +1 -0
- package/dist/components/Prefs/index.d.ts +5 -2
- package/dist/components/Prefs/index.d.ts.map +1 -1
- package/dist/components/Prefs/index.js +3 -3
- package/dist/components/Prefs/prefField.d.ts +36 -0
- package/dist/components/Prefs/prefField.d.ts.map +1 -0
- package/dist/components/Prefs/schema.d.ts +30 -0
- package/dist/components/Prefs/schema.d.ts.map +1 -1
- package/dist/components/Properties/DialogRow.d.ts +33 -0
- package/dist/components/Properties/DialogRow.d.ts.map +1 -0
- package/dist/components/Properties/PropertyField.d.ts +238 -0
- package/dist/components/Properties/PropertyField.d.ts.map +1 -0
- package/dist/components/Properties/PropertyGroup.d.ts +12 -3
- package/dist/components/Properties/PropertyGroup.d.ts.map +1 -1
- package/dist/components/Properties/PropertyPanel.d.ts +32 -236
- package/dist/components/Properties/PropertyPanel.d.ts.map +1 -1
- package/dist/components/Properties/Subpanel.d.ts +14 -0
- package/dist/components/Properties/Subpanel.d.ts.map +1 -0
- package/dist/components/Properties/index.d.ts +8 -4
- package/dist/components/Properties/index.d.ts.map +1 -1
- package/dist/components/Properties/index.js +3 -2
- package/dist/components/Properties/storyLayouts.d.ts.map +1 -1
- package/dist/components/RadioGroup/index.js +1 -1
- package/dist/components/RangeSlider/index.js +1 -1
- package/dist/components/ResizeHandle/index.js +1 -1
- package/dist/components/Select/Select.d.ts +38 -5
- package/dist/components/Select/Select.d.ts.map +1 -1
- package/dist/components/Select/index.d.ts +2 -2
- package/dist/components/Select/index.d.ts.map +1 -1
- package/dist/components/Select/index.js +2 -2
- package/dist/components/SelectionPanel/index.js +2 -2
- package/dist/components/SelectionPanel/renderLeaf.d.ts +14 -8
- package/dist/components/SelectionPanel/renderLeaf.d.ts.map +1 -1
- package/dist/components/Sidebar/index.js +1 -1
- package/dist/components/SidebarPanel/SidebarPanel.d.ts +2 -2
- package/dist/components/SidebarPanel/SidebarPanel.d.ts.map +1 -1
- package/dist/components/SidebarPanel/index.js +1 -1
- package/dist/components/Slider/index.js +1 -1
- package/dist/components/StatusBar/index.js +1 -1
- package/dist/components/SwatchGrid/SwatchGrid.d.ts +34 -0
- package/dist/components/SwatchGrid/SwatchGrid.d.ts.map +1 -0
- package/dist/components/SwatchGrid/index.d.ts +3 -0
- package/dist/components/SwatchGrid/index.d.ts.map +1 -0
- package/dist/components/SwatchGrid/index.js +2 -0
- package/dist/components/Switch/index.js +1 -1
- package/dist/components/Tabs/index.js +1 -1
- package/dist/components/Timeline/Lane.d.ts.map +1 -1
- package/dist/components/Timeline/index.js +1 -1
- package/dist/components/Toast/index.js +1 -1
- package/dist/components/ToggleBar/ToggleBar.d.ts +2 -1
- package/dist/components/ToggleBar/ToggleBar.d.ts.map +1 -1
- package/dist/components/ToggleBar/index.js +1 -1
- package/dist/components/TokenPanel/index.js +1 -1
- package/dist/components/ToolButton/index.js +1 -1
- package/dist/components/ToolGroup/index.js +1 -1
- package/dist/components/ToolOptionsBar/index.js +1 -1
- package/dist/components/ToolPalette/index.d.ts +1 -0
- package/dist/components/ToolPalette/index.d.ts.map +1 -1
- package/dist/components/ToolPalette/index.js +3 -2
- package/dist/components/Tooltip/Tooltip.d.ts +6 -2
- package/dist/components/Tooltip/Tooltip.d.ts.map +1 -1
- package/dist/components/Tooltip/index.d.ts +1 -1
- package/dist/components/Tooltip/index.d.ts.map +1 -1
- package/dist/components/Tooltip/index.js +2 -2
- package/dist/components/Tree/Tree.d.ts +84 -0
- package/dist/components/Tree/Tree.d.ts.map +1 -0
- package/dist/components/Tree/index.d.ts +3 -0
- package/dist/components/Tree/index.d.ts.map +1 -0
- package/dist/components/Tree/index.js +2 -0
- package/dist/components/segmentTooltip.d.ts +30 -0
- package/dist/components/segmentTooltip.d.ts.map +1 -0
- package/dist/components/stance.d.ts +30 -0
- package/dist/components/stance.d.ts.map +1 -0
- package/dist/components/stanceCss.d.ts +31 -0
- package/dist/components/stanceCss.d.ts.map +1 -0
- package/dist/components/stanceSurfaces.d.ts +4 -0
- package/dist/components/stanceSurfaces.d.ts.map +1 -0
- package/dist/format/number.d.ts +3 -2
- package/dist/format/number.d.ts.map +1 -1
- package/dist/icons/Icon.d.ts.map +1 -1
- package/dist/icons/ShapeKindIcon.d.ts +10 -0
- package/dist/icons/ShapeKindIcon.d.ts.map +1 -0
- package/dist/icons/index.d.ts +5 -3
- package/dist/icons/index.d.ts.map +1 -1
- package/dist/icons/paths.d.ts +2 -0
- package/dist/icons/paths.d.ts.map +1 -1
- package/dist/index.d.ts +16 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +110 -78
- package/dist/index.js.map +1 -1
- package/dist/interactiveTarget.d.ts +9 -0
- package/dist/interactiveTarget.d.ts.map +1 -0
- package/dist/style.css +1 -1
- package/dist/useReorderDragList.d.ts +36 -7
- package/dist/useReorderDragList.d.ts.map +1 -1
- package/dist/useRovingTabIndex.d.ts +1 -1
- package/dist/useScrollSpy.d.ts +48 -0
- package/dist/useScrollSpy.d.ts.map +1 -0
- package/package.json +8 -8
- package/dist/chunks/ActionBar-CLwiY3Jg.js +0 -62
- package/dist/chunks/ActionBar-CLwiY3Jg.js.map +0 -1
- package/dist/chunks/ActionsBar-D84a4eGy.js +0 -41
- package/dist/chunks/ActionsBar-D84a4eGy.js.map +0 -1
- package/dist/chunks/Badge-CW9pBPFl.js.map +0 -1
- package/dist/chunks/Button-DRSApvnK.js +0 -90
- package/dist/chunks/Button-DRSApvnK.js.map +0 -1
- package/dist/chunks/Callout-DrNu-9Qr.js +0 -122
- package/dist/chunks/Callout-DrNu-9Qr.js.map +0 -1
- package/dist/chunks/ColorField-BYzgZM9o.js.map +0 -1
- package/dist/chunks/DataGrid-C8KrYtw7.js +0 -104
- package/dist/chunks/DataGrid-C8KrYtw7.js.map +0 -1
- package/dist/chunks/Dialog-fGqqQ6o_.js +0 -61
- package/dist/chunks/Dialog-fGqqQ6o_.js.map +0 -1
- package/dist/chunks/Disclosure-CILDfWsU.js +0 -47
- package/dist/chunks/Disclosure-CILDfWsU.js.map +0 -1
- package/dist/chunks/GradientEditor-rRBmf3G0.js +0 -333
- package/dist/chunks/Icon-DT0x6HaQ.js.map +0 -1
- package/dist/chunks/InlineRange-DdIlfGqG.js +0 -29
- package/dist/chunks/InlineRange-DdIlfGqG.js.map +0 -1
- package/dist/chunks/Input-DbMKpkXy.js.map +0 -1
- package/dist/chunks/ItemList-B9zYb0GE.js +0 -42
- package/dist/chunks/ItemList-B9zYb0GE.js.map +0 -1
- package/dist/chunks/Keycaps-DunVpejA.js.map +0 -1
- package/dist/chunks/LayerStack-CfQ6GsRz.js +0 -142
- package/dist/chunks/LayerStack-CfQ6GsRz.js.map +0 -1
- package/dist/chunks/MenuButton-C_4nox39.js +0 -60
- package/dist/chunks/MenuButton-C_4nox39.js.map +0 -1
- package/dist/chunks/MeshEditor-Bipz-Ocl.js +0 -123
- package/dist/chunks/MeshEditor-Bipz-Ocl.js.map +0 -1
- package/dist/chunks/NumberField-CCjEDZCg.js.map +0 -1
- package/dist/chunks/PaintField-jBOJ32rL.js.map +0 -1
- package/dist/chunks/Powerline-Ak5AWUlK.js.map +0 -1
- package/dist/chunks/Prefs-CNC8tzyN.js +0 -308
- package/dist/chunks/Prefs-CNC8tzyN.js.map +0 -1
- package/dist/chunks/Properties-Rnb6TAbN.js +0 -891
- package/dist/chunks/Properties-Rnb6TAbN.js.map +0 -1
- package/dist/chunks/Select-BEope086.js +0 -190
- package/dist/chunks/Select-BEope086.js.map +0 -1
- package/dist/chunks/SidebarPanel-Bs6V21hg.js.map +0 -1
- package/dist/chunks/Timeline-DNKY_yiK.js.map +0 -1
- package/dist/chunks/ToggleBar-CClus5Cd.js +0 -75
- package/dist/chunks/ToolPalette-DGkKwE7D.js +0 -97
- package/dist/chunks/ToolPalette-DGkKwE7D.js.map +0 -1
- package/dist/chunks/Tooltip-C4YBczLq.js.map +0 -1
- package/dist/chunks/icons-DFLytcui.js +0 -165
- package/dist/chunks/icons-DFLytcui.js.map +0 -1
- package/dist/chunks/model-13kZ_-mE.js +0 -483
- package/dist/chunks/model-13kZ_-mE.js.map +0 -1
- package/dist/chunks/number-BHz66zQO.js.map +0 -1
- package/dist/chunks/range.module-DSsOIq1R.js +0 -8
- package/dist/chunks/range.module-DSsOIq1R.js.map +0 -1
- package/dist/chunks/schema-Dft4Cu2p.js +0 -47
- package/dist/chunks/schema-Dft4Cu2p.js.map +0 -1
- package/dist/chunks/segmentedControl.module-DS72X1ns.js +0 -11
- package/dist/chunks/segmentedControl.module-DS72X1ns.js.map +0 -1
- package/dist/chunks/useReorderDragList-CSQGd7zQ.js +0 -102
- package/dist/chunks/useReorderDragList-CSQGd7zQ.js.map +0 -1
- package/dist/chunks/useRovingTabIndex-Dkpf_KhN.js.map +0 -1
- package/dist/components/ActionsBar/ActionsBar.d.ts +0 -35
- package/dist/components/ActionsBar/ActionsBar.d.ts.map +0 -1
- package/dist/components/ActionsBar/index.d.ts +0 -3
- package/dist/components/ActionsBar/index.d.ts.map +0 -1
- package/dist/components/ActionsBar/index.js +0 -2
- package/dist/components/LayerStack/LayerStack.d.ts +0 -62
- package/dist/components/LayerStack/LayerStack.d.ts.map +0 -1
- package/dist/components/LayerStack/index.d.ts +0 -2
- package/dist/components/LayerStack/index.d.ts.map +0 -1
- package/dist/components/LayerStack/index.js +0 -2
- package/dist/components/Properties/EffectCard.d.ts +0 -69
- package/dist/components/Properties/EffectCard.d.ts.map +0 -1
|
@@ -1,483 +0,0 @@
|
|
|
1
|
-
import { a as e, t } from "./Icon-DT0x6HaQ.js";
|
|
2
|
-
import { t as n } from "./ToggleBar-CClus5Cd.js";
|
|
3
|
-
import { n as r, r as i } from "./schema-Dft4Cu2p.js";
|
|
4
|
-
import { t as a } from "./InlineRange-DdIlfGqG.js";
|
|
5
|
-
import { t as o } from "./ColorField-BYzgZM9o.js";
|
|
6
|
-
import { t as s } from "./Select-BEope086.js";
|
|
7
|
-
import { t as c } from "./FontFamilySelect-DxfgTC3G.js";
|
|
8
|
-
import { t as l } from "./PaintInput-Qs7Rul5R.js";
|
|
9
|
-
import { t as u } from "./Input-DbMKpkXy.js";
|
|
10
|
-
import { n as d, t as f } from "./NumberField-CCjEDZCg.js";
|
|
11
|
-
import { t as p } from "./Switch-DH5POG0T.js";
|
|
12
|
-
import { Fragment as m, jsx as h, jsxs as g } from "react/jsx-runtime";
|
|
13
|
-
import { MIXED as _, isBuiltinToolPref as v } from "@weasel-js/core";
|
|
14
|
-
import { Fragment as y, useState as b } from "react";
|
|
15
|
-
var x = {
|
|
16
|
-
root: "_root_elklk_1",
|
|
17
|
-
header: "_header_elklk_8",
|
|
18
|
-
kind: "_kind_elklk_16",
|
|
19
|
-
breakdown: "_breakdown_elklk_21",
|
|
20
|
-
section: "_section_elklk_26",
|
|
21
|
-
sectionTitle: "_sectionTitle_elklk_35",
|
|
22
|
-
row: "_row_elklk_44",
|
|
23
|
-
rowLabel: "_rowLabel_elklk_52",
|
|
24
|
-
rowControls: "_rowControls_elklk_56",
|
|
25
|
-
namedField: "_namedField_elklk_66",
|
|
26
|
-
blockRow: "_blockRow_elklk_78",
|
|
27
|
-
toggle: "_toggle_elklk_89",
|
|
28
|
-
flagToggle: "_flagToggle_elklk_111",
|
|
29
|
-
number: "_number_elklk_115",
|
|
30
|
-
select: "_select_elklk_116",
|
|
31
|
-
unitSuffix: "_unitSuffix_elklk_120",
|
|
32
|
-
mixedSwitch: "_mixedSwitch_elklk_126",
|
|
33
|
-
unrenderable: "_unrenderable_elklk_130",
|
|
34
|
-
objectLeaf: "_objectLeaf_elklk_137",
|
|
35
|
-
objectGroup: "_objectGroup_elklk_146",
|
|
36
|
-
slider: "_slider_elklk_153",
|
|
37
|
-
sliderReadout: "_sliderReadout_elklk_157"
|
|
38
|
-
};
|
|
39
|
-
//#endregion
|
|
40
|
-
//#region src/components/SelectionPanel/renderLeaf.tsx
|
|
41
|
-
function S(e, t) {
|
|
42
|
-
let { leaf: n } = e;
|
|
43
|
-
return n.kind === "boolean" && n.control === "toggle" && n.pair !== void 0 && t?.[e.ctx.path] === void 0 && t?.[n.kind] === void 0;
|
|
44
|
-
}
|
|
45
|
-
function C(e, t) {
|
|
46
|
-
let n = [];
|
|
47
|
-
for (let r = 0; r < e.length;) {
|
|
48
|
-
let i = e[r];
|
|
49
|
-
if (!S(i, t)) {
|
|
50
|
-
let e = i.render();
|
|
51
|
-
e != null && n.push({
|
|
52
|
-
key: i.key,
|
|
53
|
-
leaf: i.leaf,
|
|
54
|
-
block: i.leaf.block === !0,
|
|
55
|
-
content: e
|
|
56
|
-
}), r += 1;
|
|
57
|
-
continue;
|
|
58
|
-
}
|
|
59
|
-
let a = r + 1;
|
|
60
|
-
for (; a < e.length && S(e[a], t) && e[a].leaf.pair === i.leaf.pair;) a += 1;
|
|
61
|
-
let o = e.slice(r, a);
|
|
62
|
-
n.push({
|
|
63
|
-
key: i.key,
|
|
64
|
-
leaf: i.leaf,
|
|
65
|
-
block: o.every((e) => e.leaf.block === !0),
|
|
66
|
-
content: /* @__PURE__ */ h(w, {
|
|
67
|
-
run: o,
|
|
68
|
-
ariaLabel: i.leaf.pair
|
|
69
|
-
})
|
|
70
|
-
}), r = a;
|
|
71
|
-
}
|
|
72
|
-
return n;
|
|
73
|
-
}
|
|
74
|
-
function w({ run: r, ariaLabel: i }) {
|
|
75
|
-
let a = r.filter((e) => e.ctx.value === !0).map((e) => e.key);
|
|
76
|
-
return /* @__PURE__ */ h(n, {
|
|
77
|
-
mode: "multiple",
|
|
78
|
-
size: "sm",
|
|
79
|
-
variant: "flat",
|
|
80
|
-
className: x.flagToggle,
|
|
81
|
-
ariaLabel: i,
|
|
82
|
-
items: r.map((n) => {
|
|
83
|
-
let r = n.leaf;
|
|
84
|
-
return {
|
|
85
|
-
value: n.key,
|
|
86
|
-
label: r.icon && r.icon in e ? /* @__PURE__ */ h(t, {
|
|
87
|
-
name: r.icon,
|
|
88
|
-
size: 14
|
|
89
|
-
}) : r.short ?? r.name.slice(0, 1),
|
|
90
|
-
ariaLabel: n.ariaLabel
|
|
91
|
-
};
|
|
92
|
-
}),
|
|
93
|
-
value: a,
|
|
94
|
-
mixedValues: r.filter((e) => e.ctx.mixed).map((e) => e.key),
|
|
95
|
-
onChange: (e) => {
|
|
96
|
-
for (let t of r) {
|
|
97
|
-
let n = e.includes(t.key);
|
|
98
|
-
n !== a.includes(t.key) && t.ctx.setValue(n);
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
});
|
|
102
|
-
}
|
|
103
|
-
function T(u, _, y, b = "", S = !1) {
|
|
104
|
-
let { pref: C, value: w, mixed: T, unset: O, setValue: k } = u;
|
|
105
|
-
if (C.kind === "font-family") {
|
|
106
|
-
let e = u.valueAt("data.style.fontWeight"), t = u.valueAt("data.style.fontStyle");
|
|
107
|
-
return /* @__PURE__ */ h(c, {
|
|
108
|
-
className: x.select,
|
|
109
|
-
value: T || typeof w != "string" ? void 0 : w,
|
|
110
|
-
mixed: T,
|
|
111
|
-
onChange: k,
|
|
112
|
-
weight: typeof e.value == "number" ? e.value : void 0,
|
|
113
|
-
fontStyle: t.value === "italic" ? "italic" : void 0,
|
|
114
|
-
"aria-label": _
|
|
115
|
-
});
|
|
116
|
-
}
|
|
117
|
-
if (!v(C)) return /* @__PURE__ */ g("span", {
|
|
118
|
-
className: x.unrenderable,
|
|
119
|
-
children: [
|
|
120
|
-
"(",
|
|
121
|
-
C.kind,
|
|
122
|
-
": no renderer)"
|
|
123
|
-
]
|
|
124
|
-
});
|
|
125
|
-
switch (C.kind) {
|
|
126
|
-
case "number": {
|
|
127
|
-
let e = C, t = typeof w == "number" && Number.isFinite(w) ? w : void 0, n = t === void 0 ? NaN : e.unit ? e.unit.toDisplay(t) : t, o = r(e);
|
|
128
|
-
if (e.control === "slider") {
|
|
129
|
-
let r = o.min ?? 0, i = o.max ?? 100, s = !T && t !== void 0;
|
|
130
|
-
return /* @__PURE__ */ g(m, { children: [/* @__PURE__ */ h(a, {
|
|
131
|
-
min: r,
|
|
132
|
-
max: i,
|
|
133
|
-
step: o.step,
|
|
134
|
-
value: s ? Math.min(Math.max(n, r), i) : r,
|
|
135
|
-
disabled: T,
|
|
136
|
-
className: x.slider,
|
|
137
|
-
"aria-label": _,
|
|
138
|
-
onChange: (t) => {
|
|
139
|
-
let n = Number(t.target.value);
|
|
140
|
-
k(e.unit ? e.unit.fromDisplay(n) : n);
|
|
141
|
-
}
|
|
142
|
-
}), /* @__PURE__ */ h("span", {
|
|
143
|
-
className: x.sliderReadout,
|
|
144
|
-
"aria-hidden": "true",
|
|
145
|
-
children: s ? e.unit?.format?.(t) ?? `${n}${e.unit?.suffix ?? ""}` : "—"
|
|
146
|
-
})] });
|
|
147
|
-
}
|
|
148
|
-
let s = e.unit, c = s ? /* @__PURE__ */ h(f, {
|
|
149
|
-
className: x.number,
|
|
150
|
-
value: T || t === void 0 ? NaN : n,
|
|
151
|
-
placeholder: T ? "Mixed" : void 0,
|
|
152
|
-
minValue: o.min,
|
|
153
|
-
maxValue: o.max,
|
|
154
|
-
step: o.step,
|
|
155
|
-
accepts: i(s),
|
|
156
|
-
"aria-label": _,
|
|
157
|
-
onChange: (e) => k(s.fromDisplay(e))
|
|
158
|
-
}) : /* @__PURE__ */ h(d, {
|
|
159
|
-
className: x.number,
|
|
160
|
-
value: T || t === void 0 ? NaN : n,
|
|
161
|
-
placeholder: T ? "Mixed" : void 0,
|
|
162
|
-
minValue: o.min,
|
|
163
|
-
maxValue: o.max,
|
|
164
|
-
step: o.step,
|
|
165
|
-
hideSteppers: !0,
|
|
166
|
-
"aria-label": _,
|
|
167
|
-
onChange: (e) => {
|
|
168
|
-
Number.isNaN(e) || k(e);
|
|
169
|
-
}
|
|
170
|
-
});
|
|
171
|
-
return s?.suffix === void 0 ? c : /* @__PURE__ */ g(m, { children: [c, /* @__PURE__ */ h("span", {
|
|
172
|
-
className: x.unitSuffix,
|
|
173
|
-
"aria-hidden": "true",
|
|
174
|
-
children: s.suffix
|
|
175
|
-
})] });
|
|
176
|
-
}
|
|
177
|
-
case "string": return /* @__PURE__ */ h(D, {
|
|
178
|
-
text: T ? void 0 : typeof w == "string" ? w : "",
|
|
179
|
-
placeholder: T ? "Mixed" : void 0,
|
|
180
|
-
ariaLabel: _,
|
|
181
|
-
onCommit: k
|
|
182
|
-
});
|
|
183
|
-
case "boolean": {
|
|
184
|
-
let r = C;
|
|
185
|
-
if (r.control === "toggle") return /* @__PURE__ */ h(n, {
|
|
186
|
-
mode: "multiple",
|
|
187
|
-
size: "sm",
|
|
188
|
-
variant: "flat",
|
|
189
|
-
className: x.flagToggle,
|
|
190
|
-
ariaLabel: _,
|
|
191
|
-
items: [{
|
|
192
|
-
value: u.path,
|
|
193
|
-
label: r.icon && r.icon in e ? /* @__PURE__ */ h(t, {
|
|
194
|
-
name: r.icon,
|
|
195
|
-
size: 14
|
|
196
|
-
}) : r.short ?? r.name.slice(0, 1),
|
|
197
|
-
ariaLabel: _
|
|
198
|
-
}],
|
|
199
|
-
value: w === !0 ? [u.path] : [],
|
|
200
|
-
mixedValues: T ? [u.path] : [],
|
|
201
|
-
onChange: (e) => k(e.includes(u.path))
|
|
202
|
-
});
|
|
203
|
-
let i = /* @__PURE__ */ h(p, {
|
|
204
|
-
isSelected: !!w,
|
|
205
|
-
onChange: k,
|
|
206
|
-
"aria-label": _
|
|
207
|
-
});
|
|
208
|
-
return !T && !O ? i : /* @__PURE__ */ h("span", {
|
|
209
|
-
className: x.mixedSwitch,
|
|
210
|
-
title: T ? "Mixed" : "Not set",
|
|
211
|
-
children: i
|
|
212
|
-
});
|
|
213
|
-
}
|
|
214
|
-
case "enum": {
|
|
215
|
-
let r = C, i = r.encoding ? T ? void 0 : r.encoding.read(w, u.siblings) : T || O ? void 0 : typeof w == "string" ? w : r.default, a = (e) => k(r.encoding ? r.encoding.write(e, u.siblings) : e);
|
|
216
|
-
return r.control === "toggle" ? /* @__PURE__ */ h(n, {
|
|
217
|
-
size: "sm",
|
|
218
|
-
variant: "flat",
|
|
219
|
-
className: x.toggle,
|
|
220
|
-
ariaLabel: _,
|
|
221
|
-
items: r.options.map((n) => ({
|
|
222
|
-
value: n.value,
|
|
223
|
-
label: n.icon && n.icon in e ? /* @__PURE__ */ h(t, {
|
|
224
|
-
name: n.icon,
|
|
225
|
-
size: 14
|
|
226
|
-
}) : n.short ?? n.label,
|
|
227
|
-
ariaLabel: n.label,
|
|
228
|
-
disabled: n.disabled
|
|
229
|
-
})),
|
|
230
|
-
value: i ?? null,
|
|
231
|
-
onChange: (e) => {
|
|
232
|
-
e !== null && a(e);
|
|
233
|
-
}
|
|
234
|
-
}) : /* @__PURE__ */ h(s, {
|
|
235
|
-
className: x.select,
|
|
236
|
-
options: r.options.map((e) => ({
|
|
237
|
-
value: e.value,
|
|
238
|
-
label: e.label,
|
|
239
|
-
isDisabled: e.disabled
|
|
240
|
-
})),
|
|
241
|
-
selectedKey: i ?? null,
|
|
242
|
-
placeholder: T ? "Mixed" : O ? "—" : void 0,
|
|
243
|
-
onSelectionChange: a,
|
|
244
|
-
"aria-label": _
|
|
245
|
-
});
|
|
246
|
-
}
|
|
247
|
-
case "color": {
|
|
248
|
-
let e = C;
|
|
249
|
-
return /* @__PURE__ */ h(o, {
|
|
250
|
-
value: T ? void 0 : typeof w == "string" ? w : e.default,
|
|
251
|
-
mixed: T,
|
|
252
|
-
alpha: e.alpha,
|
|
253
|
-
onChange: k,
|
|
254
|
-
"aria-label": _
|
|
255
|
-
});
|
|
256
|
-
}
|
|
257
|
-
case "paint": return /* @__PURE__ */ h(l, {
|
|
258
|
-
value: w === null ? null : w ?? (T ? void 0 : C.default),
|
|
259
|
-
mixed: T,
|
|
260
|
-
unset: O,
|
|
261
|
-
allowNone: !S,
|
|
262
|
-
onChange: k,
|
|
263
|
-
"aria-label": _
|
|
264
|
-
}, b);
|
|
265
|
-
case "object": return /* @__PURE__ */ h(E, {
|
|
266
|
-
ctx: u,
|
|
267
|
-
renderers: y,
|
|
268
|
-
selectionKey: b
|
|
269
|
-
});
|
|
270
|
-
default: throw Error(`SelectionPanel: no control for built-in pref kind "${C.kind}"`);
|
|
271
|
-
}
|
|
272
|
-
}
|
|
273
|
-
function E({ ctx: n, renderers: r, selectionKey: i = "" }) {
|
|
274
|
-
let a = n.pref, o = typeof n.value == "object" && n.value !== null ? n.value : void 0, s = Object.values(a.children).every((e) => !("kind" in e)), c = (s, l) => {
|
|
275
|
-
let u = [], d = (e) => typeof e == "object" && !!e && "controls" in e, f = [], p = () => {
|
|
276
|
-
for (let { key: e, leaf: t, block: n, content: i } of C(f, r)) {
|
|
277
|
-
let r = u[u.length - 1];
|
|
278
|
-
if (t.pair !== void 0 && d(r) && r.pair === t.pair) {
|
|
279
|
-
r.controls.push(/* @__PURE__ */ h(y, { children: i }, e)), r.block &&= n;
|
|
280
|
-
continue;
|
|
281
|
-
}
|
|
282
|
-
u.push({
|
|
283
|
-
key: e,
|
|
284
|
-
pair: t.pair,
|
|
285
|
-
label: t.pair ?? t.name,
|
|
286
|
-
title: t.description,
|
|
287
|
-
block: n,
|
|
288
|
-
controls: [/* @__PURE__ */ h(y, { children: i }, e)]
|
|
289
|
-
});
|
|
290
|
-
}
|
|
291
|
-
f = [];
|
|
292
|
-
};
|
|
293
|
-
for (let [d, m] of Object.entries(s)) {
|
|
294
|
-
if (!("kind" in m)) {
|
|
295
|
-
let e = m.name !== "", t = c(m.children, e);
|
|
296
|
-
if (t.length === 0) continue;
|
|
297
|
-
p(), u.push(/* @__PURE__ */ g("div", {
|
|
298
|
-
className: e && l ? x.objectGroup : void 0,
|
|
299
|
-
children: [e && /* @__PURE__ */ h("h5", {
|
|
300
|
-
className: x.sectionTitle,
|
|
301
|
-
children: m.name
|
|
302
|
-
}), t]
|
|
303
|
-
}, `group:${d}`));
|
|
304
|
-
continue;
|
|
305
|
-
}
|
|
306
|
-
let s = `${n.path}.${d}`, _ = {
|
|
307
|
-
path: s,
|
|
308
|
-
pref: m,
|
|
309
|
-
value: o?.[d],
|
|
310
|
-
mixed: n.mixed,
|
|
311
|
-
unset: !n.mixed && o?.[d] === void 0,
|
|
312
|
-
siblings: o,
|
|
313
|
-
valueAt: n.valueAt,
|
|
314
|
-
setValue: (e) => {
|
|
315
|
-
let t = o ?? a.fromScalar?.(n.value) ?? (typeof a.default == "object" && a.default !== null ? { ...a.default } : {});
|
|
316
|
-
if (e === void 0) {
|
|
317
|
-
let { [d]: e, ...r } = t;
|
|
318
|
-
n.setValue(r);
|
|
319
|
-
return;
|
|
320
|
-
}
|
|
321
|
-
n.setValue({
|
|
322
|
-
...t,
|
|
323
|
-
[d]: e
|
|
324
|
-
});
|
|
325
|
-
}
|
|
326
|
-
};
|
|
327
|
-
f.push({
|
|
328
|
-
key: s,
|
|
329
|
-
leaf: m,
|
|
330
|
-
ctx: _,
|
|
331
|
-
ariaLabel: m.name,
|
|
332
|
-
render: () => {
|
|
333
|
-
let n = r?.[s] ?? r?.[m.kind], a = n ? n(_) : T(_, m.name, r, i, !0);
|
|
334
|
-
return a == null ? null : (m.pair !== void 0 || m.block === !0) && m.icon && m.icon in e ? /* @__PURE__ */ g("span", {
|
|
335
|
-
className: x.namedField,
|
|
336
|
-
children: [/* @__PURE__ */ h(t, {
|
|
337
|
-
name: m.icon,
|
|
338
|
-
size: 14
|
|
339
|
-
}), a]
|
|
340
|
-
}) : a;
|
|
341
|
-
}
|
|
342
|
-
});
|
|
343
|
-
}
|
|
344
|
-
return p(), u.map((e) => typeof e == "object" && e && "controls" in e ? e.block ? /* @__PURE__ */ h("div", {
|
|
345
|
-
className: `${x.rowControls} ${x.blockRow}`,
|
|
346
|
-
title: e.title,
|
|
347
|
-
children: e.controls
|
|
348
|
-
}, e.key) : /* @__PURE__ */ g("div", {
|
|
349
|
-
className: x.row,
|
|
350
|
-
children: [/* @__PURE__ */ h("span", {
|
|
351
|
-
className: x.rowLabel,
|
|
352
|
-
title: e.title,
|
|
353
|
-
children: e.label
|
|
354
|
-
}), /* @__PURE__ */ h("span", {
|
|
355
|
-
className: x.rowControls,
|
|
356
|
-
children: e.controls
|
|
357
|
-
})]
|
|
358
|
-
}, e.key) : e);
|
|
359
|
-
}, l = c(a.children, !s);
|
|
360
|
-
return l.length === 0 ? null : /* @__PURE__ */ g("div", {
|
|
361
|
-
className: x.objectLeaf,
|
|
362
|
-
children: [!s && /* @__PURE__ */ h("h4", {
|
|
363
|
-
className: x.sectionTitle,
|
|
364
|
-
children: a.name
|
|
365
|
-
}), l]
|
|
366
|
-
});
|
|
367
|
-
}
|
|
368
|
-
function D({ text: e, placeholder: t, ariaLabel: n, onCommit: r }) {
|
|
369
|
-
let [i, a] = b(null);
|
|
370
|
-
return /* @__PURE__ */ h(u, {
|
|
371
|
-
value: i ?? e ?? "",
|
|
372
|
-
placeholder: t,
|
|
373
|
-
"aria-label": n,
|
|
374
|
-
onChange: a,
|
|
375
|
-
onBlur: () => {
|
|
376
|
-
i !== null && i !== e && r(i), a(null);
|
|
377
|
-
},
|
|
378
|
-
onKeyDown: (e) => {
|
|
379
|
-
e.key === "Enter" && e.target.blur();
|
|
380
|
-
}
|
|
381
|
-
});
|
|
382
|
-
}
|
|
383
|
-
//#endregion
|
|
384
|
-
//#region src/components/SelectionPanel/model.ts
|
|
385
|
-
function O(e, t) {
|
|
386
|
-
if (e.kind === "container") return "group";
|
|
387
|
-
for (let n of t) if (n.matches(e.data)) return n.name;
|
|
388
|
-
return "unknown";
|
|
389
|
-
}
|
|
390
|
-
function k(e) {
|
|
391
|
-
return !("kind" in e);
|
|
392
|
-
}
|
|
393
|
-
function A(e) {
|
|
394
|
-
let t = [], n = [], r = (e, t) => {
|
|
395
|
-
for (let [n, i] of Object.entries(e.children)) k(i) ? r(i, t) : t.push({
|
|
396
|
-
path: n,
|
|
397
|
-
leaf: i
|
|
398
|
-
});
|
|
399
|
-
};
|
|
400
|
-
for (let [i, a] of Object.entries(e.children)) if (k(a)) {
|
|
401
|
-
let e = [];
|
|
402
|
-
r(a, e), t.push({
|
|
403
|
-
key: i,
|
|
404
|
-
name: a.name,
|
|
405
|
-
rows: j(e)
|
|
406
|
-
});
|
|
407
|
-
} else n.push({
|
|
408
|
-
path: i,
|
|
409
|
-
leaf: a
|
|
410
|
-
});
|
|
411
|
-
return n.length > 0 && t.unshift({
|
|
412
|
-
key: "",
|
|
413
|
-
name: "",
|
|
414
|
-
rows: j(n)
|
|
415
|
-
}), t;
|
|
416
|
-
}
|
|
417
|
-
function j(e) {
|
|
418
|
-
let t = [];
|
|
419
|
-
for (let n of e) {
|
|
420
|
-
let e = n.leaf.pair, r = t[t.length - 1];
|
|
421
|
-
e !== void 0 && r !== void 0 && r.label === e ? r.leaves.push(n) : t.push({
|
|
422
|
-
label: e ?? n.leaf.name,
|
|
423
|
-
leaves: [n]
|
|
424
|
-
});
|
|
425
|
-
}
|
|
426
|
-
return t;
|
|
427
|
-
}
|
|
428
|
-
function M(e, t) {
|
|
429
|
-
let n = [...new Set(e)];
|
|
430
|
-
if (n.length === 0) return [];
|
|
431
|
-
let r = new Map(t.map((e) => [e.name, e])), i = n.map((e) => r.get(e)?.schema);
|
|
432
|
-
if (i.some((e) => e === void 0)) return [];
|
|
433
|
-
let [a, ...o] = i, s = A(a);
|
|
434
|
-
if (o.length === 0) return s;
|
|
435
|
-
let c = (e) => `${e.path}\0${e.leaf.kind}`, l = o.map((e) => new Set(A(e).flatMap((e) => e.rows).flatMap((e) => e.leaves).map(c))), u = (e) => l.every((t) => t.has(c(e)));
|
|
436
|
-
return s.map((e) => ({
|
|
437
|
-
...e,
|
|
438
|
-
rows: e.rows.map((e) => ({
|
|
439
|
-
...e,
|
|
440
|
-
leaves: e.leaves.filter(u)
|
|
441
|
-
})).filter((e) => e.leaves.length > 0)
|
|
442
|
-
})).filter((e) => e.rows.length > 0);
|
|
443
|
-
}
|
|
444
|
-
function N(e, t) {
|
|
445
|
-
let n = t.split(".");
|
|
446
|
-
if (n.length < 2) return;
|
|
447
|
-
let r = n[0], i = r === "pose" ? e.pose : r === "data" ? e.data : void 0;
|
|
448
|
-
for (let e = 1; e < n.length; e++) {
|
|
449
|
-
if (typeof i != "object" || !i) return;
|
|
450
|
-
i = i[n[e]];
|
|
451
|
-
}
|
|
452
|
-
return i;
|
|
453
|
-
}
|
|
454
|
-
function P(e, t, n) {
|
|
455
|
-
let [r, ...i] = t;
|
|
456
|
-
if (i.length === 0) return Array.isArray(e) ? Object.assign([...e], { [r]: n }) : {
|
|
457
|
-
...e,
|
|
458
|
-
[r]: n
|
|
459
|
-
};
|
|
460
|
-
let a = e[r], o = P(Array.isArray(a) ? [...a] : typeof a == "object" && a ? { ...a } : {}, i, n);
|
|
461
|
-
return Array.isArray(e) ? Object.assign([...e], { [r]: o }) : {
|
|
462
|
-
...e,
|
|
463
|
-
[r]: o
|
|
464
|
-
};
|
|
465
|
-
}
|
|
466
|
-
function F(e, t) {
|
|
467
|
-
let n, r = !0;
|
|
468
|
-
for (let i of e) {
|
|
469
|
-
let e = N(i, t);
|
|
470
|
-
if (r) n = e, r = !1;
|
|
471
|
-
else if (!Object.is(e, n)) return _;
|
|
472
|
-
}
|
|
473
|
-
return n;
|
|
474
|
-
}
|
|
475
|
-
function I(e) {
|
|
476
|
-
let t = /* @__PURE__ */ new Map();
|
|
477
|
-
for (let n of e) t.set(n, (t.get(n) ?? 0) + 1);
|
|
478
|
-
return [...t.entries()].map(([e, t]) => t > 1 ? `${e} ×${t}` : e).join(" · ");
|
|
479
|
-
}
|
|
480
|
-
//#endregion
|
|
481
|
-
export { k as a, j as c, C as d, x as f, M as i, P as l, F as n, I as o, O as r, N as s, _ as t, T as u };
|
|
482
|
-
|
|
483
|
-
//# sourceMappingURL=model-13kZ_-mE.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"model-13kZ_-mE.js","names":[],"sources":["../../src/components/SelectionPanel/SelectionPanel.module.css","../../src/components/SelectionPanel/renderLeaf.tsx","../../src/components/SelectionPanel/model.ts"],"sourcesContent":[".root {\n display: flex;\n flex-direction: column;\n font-size: var(--wzl-font-size-sm);\n color: var(--wzl-fg);\n}\n\n.header {\n display: flex;\n align-items: baseline;\n gap: var(--wzl-space-4);\n padding: var(--wzl-space-4) 0;\n border-block-end: 1px solid var(--wzl-border);\n}\n\n.kind {\n font-weight: var(--wzl-font-weight-bold);\n font-size: var(--wzl-font-size);\n}\n\n.breakdown {\n font-size: var(--wzl-font-size-sm);\n opacity: 0.6;\n}\n\n.section {\n padding: var(--wzl-space-3) 0 var(--wzl-space-4);\n border-block-end: 1px solid var(--wzl-border);\n}\n\n.section:last-child {\n border-block-end: none;\n}\n\n.sectionTitle {\n margin: 0 0 var(--wzl-space-3);\n font-size: var(--wzl-font-size-xs);\n font-weight: var(--wzl-font-weight-bold);\n text-transform: uppercase;\n letter-spacing: 0.06em;\n opacity: 0.55;\n}\n\n.row {\n display: grid;\n grid-template-columns: 64px 1fr;\n gap: var(--wzl-space-3);\n align-items: center;\n margin-block-end: 5px;\n}\n\n.rowLabel {\n opacity: 0.75;\n}\n\n.rowControls {\n display: flex;\n flex-wrap: wrap;\n gap: var(--wzl-space-3);\n align-items: center;\n min-inline-size: 0;\n}\n\n/* Glyph plus its control, held together so the pair row wraps between\n fields rather than between a field and the icon naming it. */\n.namedField {\n display: flex;\n align-items: center;\n gap: var(--wzl-space-2);\n min-inline-size: 0;\n}\n\n.namedField > svg {\n flex: none;\n opacity: 0.75;\n}\n\n.blockRow {\n margin-block-end: 5px;\n}\n\n/* Fields paired into one row split it evenly, the way Position's x/y do. */\n.rowControls > .namedField {\n flex: 1 1 0;\n}\n\n/* Except around a segmented bar, which is sized by its segments: an equal\n share of the row is wider than the buttons want to be. */\n.rowControls > .namedField:has(> .toggle) {\n flex: 0 1 auto;\n}\n\n.rowControls > * {\n flex: 1;\n min-inline-size: 0;\n}\n\n/* Bars sharing a row split the leftover between them, so the gap stays fixed\n and the width lands on the segments. A bar with the row to itself is sized\n by its segments instead — a third of 240px is a plate, not a button. */\n.rowControls > .toggle {\n flex: 1 1 auto;\n}\n\n.rowControls > .toggle:only-child {\n flex: 0 1 auto;\n}\n\n/* A flag bar is sized by its glyphs rather than by a share of the row: an\n even split would fling one-letter segments to the margins. */\n.rowControls > .flagToggle {\n flex: 0 0 auto;\n}\n\n.number :global(input),\n.select {\n font-size: var(--wzl-font-size-sm);\n}\n\n.unitSuffix {\n flex: none;\n font-size: var(--wzl-font-size-sm);\n opacity: 0.6;\n}\n\n.mixedSwitch {\n opacity: 0.55;\n}\n\n.unrenderable {\n font-size: var(--wzl-font-size-sm);\n opacity: 0.5;\n font-style: italic;\n}\n\n/* A `block` leaf that renders its own rows — an object leaf's fields. */\n.objectLeaf {\n margin-block: var(--wzl-space-4) var(--wzl-space-2);\n}\n\n.objectLeaf .sectionTitle {\n margin-block: 7px 5px;\n}\n\n/* Fields under a heading inside an object read as belonging to it. */\n.objectGroup {\n padding-inline-start: var(--wzl-space-4);\n border-inline-start: 1px solid var(--wzl-border);\n margin-block-end: var(--wzl-space-2);\n}\n\n/* `InlineRange` owns the track; the row only says how it shares the space. */\n.slider {\n flex: 1;\n}\n\n.sliderReadout {\n flex: none;\n min-inline-size: 3ch;\n text-align: end;\n font-size: var(--wzl-font-size-sm);\n opacity: 0.7;\n}\n","/**\n * The leaf → control mapping: one `ToolPrefLeaf` and its value in, one\n * rendered control out, plus the run logic that turns a row of paired\n * toggles into a single segmented bar.\n *\n * It lives beside `SelectionPanel` because it grew there and still draws on\n * that stylesheet, but it is not the panel's: `ToolOptionsBar` renders a\n * tool's options through the same function, so a leaf kind gets its control\n * decided once rather than once per surface.\n */\nimport { Fragment, useState, type ReactNode } from 'react';\nimport {\n isBuiltinToolPref,\n type FillStyle,\n type ToolPrefBoolean,\n type ToolPrefColor,\n type ToolPrefEnum,\n type ToolPrefLeaf,\n type ToolPrefNumber,\n type ToolPrefPaint,\n type ToolPrefGroup,\n type ToolPrefObject,\n} from '@weasel-js/core';\nimport { prefDisplayBounds, prefUnitAccepts } from '../Prefs/schema';\nimport { ColorField } from '../ColorField';\nimport { FontFamilySelect } from '../FontFamilySelect';\nimport { PaintInput } from '../PaintInput';\nimport { InlineRange } from '../InlineRange';\nimport { Input } from '../Input';\nimport { NumberField, UnitField } from '../NumberField';\nimport { Select } from '../Select';\nimport { Switch } from '../Switch';\nimport { ToggleBar } from '../ToggleBar';\nimport { Icon } from '../../icons/Icon';\nimport { ICON_PATHS, type IconName } from '../../icons/paths';\nimport s from './SelectionPanel.module.css';\n\n\n/** What a {@link PropertyRenderer} is given for the property it is rendering. */\nexport interface PropertyRenderContext {\n /** Dotted node path of the leaf (`pose.x`, `data.fill`). */\n path: string;\n /** The schema leaf. App renderers narrow it to their own kind shape. */\n pref: ToolPrefLeaf;\n /** Aggregated value across the selection; `undefined` when mixed or unset. */\n value: unknown;\n /** True when selected nodes disagree at this path. */\n mixed: boolean;\n /**\n * True when the nodes agree and what they agree on is nothing — the field\n * is absent, and whatever paints comes from a fallback further down.\n *\n * Distinct from `mixed`, and both leave `value` undefined. A control must\n * not substitute its schema default here: doing so shows a value the node\n * does not hold, and the next edit writes that invention back.\n */\n unset: boolean;\n /**\n * The fields of the object this leaf is a field of — `undefined` for a\n * top-level leaf, and for a field of an object the node does not hold.\n *\n * What a control needs when its own field doesn't carry the whole answer:\n * a stroke's dash lengths are multiples of the stroke's width, so reading\n * the array as a style takes both.\n */\n siblings?: Record<string, unknown>;\n /** Commit a value — fans out to every selected node in one undo step. */\n setValue: (value: unknown) => void;\n /**\n * The aggregated value at another node path — what `value` and `mixed` are\n * for this leaf's own path, for any path.\n *\n * A control whose subject spans more than one field needs it: a font picker\n * reporting which variant will actually paint has to read the node's weight\n * and style. Reading it off `value` is impossible — a leaf is handed one\n * field.\n */\n valueAt: (path: string) => { value: unknown; mixed: boolean };\n}\n\n/**\n * Renders the control for one property across the whole selection.\n * Returning `null` collapses the leaf.\n */\nexport type PropertyRenderer = (ctx: PropertyRenderContext) => ReactNode;\n\n\n/**\n * One leaf with its context built but nothing rendered yet.\n *\n * Deferring the render is what lets a run of sibling flags become one bar:\n * whether a leaf joins its neighbors is a fact about the run, which no leaf\n * rendering itself can see.\n */\nexport interface LeafCell {\n key: string;\n leaf: ToolPrefLeaf;\n ctx: PropertyRenderContext;\n /** The accessible name this leaf's control carries — qualified by the row's\n * pair where the row holds more than one leaf. */\n ariaLabel: string;\n /** Renders the leaf on its own, chrome and all. */\n render: () => ReactNode;\n}\n\n/** A cell's content, once the run it belongs to has been decided. */\nexport interface RenderedCell {\n key: string;\n /** The leaf that names the cell — the run's first, for a flag bar. */\n leaf: ToolPrefLeaf;\n block: boolean;\n content: ReactNode;\n}\n\n/**\n * True for a leaf that can join a flag bar: a paired toggle boolean the\n * consumer has not claimed with a renderer of its own.\n */\nexport function isFlagCell(cell: LeafCell, renderers?: Record<string, PropertyRenderer>): boolean {\n const { leaf } = cell;\n return (\n leaf.kind === 'boolean' &&\n (leaf as ToolPrefBoolean).control === 'toggle' &&\n leaf.pair !== undefined &&\n renderers?.[cell.ctx.path] === undefined &&\n renderers?.[leaf.kind] === undefined\n );\n}\n\n/**\n * Renders a row's cells, collapsing each run of adjacent same-`pair` toggle\n * booleans into one segmented bar — the idiom the enum toggle a row away\n * already uses, rather than one detached pill per flag.\n */\nexport function renderCells(\n cells: readonly LeafCell[],\n renderers?: Record<string, PropertyRenderer>,\n): RenderedCell[] {\n const out: RenderedCell[] = [];\n for (let i = 0; i < cells.length; ) {\n const cell = cells[i];\n if (!isFlagCell(cell, renderers)) {\n const content = cell.render();\n if (content != null) {\n out.push({ key: cell.key, leaf: cell.leaf, block: cell.leaf.block === true, content });\n }\n i += 1;\n continue;\n }\n let j = i + 1;\n while (\n j < cells.length &&\n isFlagCell(cells[j], renderers) &&\n cells[j].leaf.pair === cell.leaf.pair\n ) {\n j += 1;\n }\n const run = cells.slice(i, j);\n out.push({\n key: cell.key,\n leaf: cell.leaf,\n block: run.every((c) => c.leaf.block === true),\n content: <FlagBar run={run} ariaLabel={cell.leaf.pair as string} />,\n });\n i = j;\n }\n return out;\n}\n\n/**\n * A run of paired boolean flags as one multi-select bar — U / S / O, the way\n * every text editor draws them.\n */\nfunction FlagBar({ run, ariaLabel }: { run: readonly LeafCell[]; ariaLabel: string }): ReactNode {\n const on = run.filter((c) => c.ctx.value === true).map((c) => c.key);\n return (\n <ToggleBar<string>\n mode=\"multiple\"\n size=\"sm\"\n variant=\"flat\"\n className={s.flagToggle}\n ariaLabel={ariaLabel}\n items={run.map((c) => {\n const p = c.leaf as ToolPrefBoolean;\n return {\n value: c.key,\n label:\n p.icon && p.icon in ICON_PATHS ? (\n <Icon name={p.icon as IconName} size={14} />\n ) : (\n (p.short ?? p.name.slice(0, 1))\n ),\n ariaLabel: c.ariaLabel,\n };\n })}\n value={on}\n // Each flag owns its own path, so only the segment that moved is\n // written — committing the run would write two fields nobody touched,\n // and inside an object leaf would fabricate values for the other two.\n mixedValues={run.filter((c) => c.ctx.mixed).map((c) => c.key)}\n onChange={(next) => {\n for (const c of run) {\n const now = next.includes(c.key);\n if (now !== on.includes(c.key)) c.ctx.setValue(now);\n }\n }}\n />\n );\n}\n\nexport function renderBuiltin(\n ctx: PropertyRenderContext,\n ariaLabel: string,\n renderers?: Record<string, PropertyRenderer>,\n /** Identifies the current selection, so a control holding per-selection\n * scratch (the paint kind memory) is remounted rather than carried over. */\n selectionKey = '',\n /** True for a field of an object leaf. Such a field writes itself into its\n * parent, so it can only hold values its parent's type permits — which is\n * what rules \"none\" out for a nested paint. */\n nested = false,\n): ReactNode {\n const { pref, value, mixed, unset, setValue } = ctx;\n if (pref.kind === 'font-family') {\n // Not a `ToolPref` kind: its options are the live font registry, which no\n // static schema can carry. Core's own text schema still declares it, so\n // the panel ships the control rather than leaving every consumer to.\n //\n // The substitution probe runs at the node's own weight and style, so the\n // label names the variant that will actually paint. A mixed selection has\n // no single one; the probe falls back to 400/normal there.\n const weight = ctx.valueAt('data.style.fontWeight');\n const style = ctx.valueAt('data.style.fontStyle');\n return (\n <FontFamilySelect\n className={s.select}\n value={mixed || typeof value !== 'string' ? undefined : value}\n mixed={mixed}\n onChange={setValue}\n weight={typeof weight.value === 'number' ? weight.value : undefined}\n fontStyle={style.value === 'italic' ? 'italic' : undefined}\n aria-label={ariaLabel}\n />\n );\n }\n if (!isBuiltinToolPref(pref)) {\n return <span className={s.unrenderable}>({pref.kind}: no renderer)</span>;\n }\n switch (pref.kind) {\n case 'number': {\n const p = pref as ToolPrefNumber;\n const stored = typeof value === 'number' && Number.isFinite(value) ? value : undefined;\n const display = stored !== undefined ? (p.unit ? p.unit.toDisplay(stored) : stored) : NaN;\n // `min`/`max`/`step` are declared in the stored unit, like the value, so\n // they convert with it — a leaf storing radians and showing degrees was\n // clamping typed degrees against 0..6.28. Only declared bounds convert:\n // the slider's 0..100 fallback is a display-space number with no stored\n // counterpart to put through the conversion.\n const bounds = prefDisplayBounds(p);\n if (p.control === 'slider') {\n const min = bounds.min ?? 0;\n const max = bounds.max ?? 100;\n const known = !mixed && stored !== undefined;\n return (\n <>\n <InlineRange\n min={min}\n max={max}\n step={bounds.step}\n // The thumb clamps to the track; the readout beside it does not,\n // so a value past `max` is still reported as what it is.\n value={known ? Math.min(Math.max(display, min), max) : min}\n disabled={mixed}\n className={s.slider}\n aria-label={ariaLabel}\n onChange={(e) => {\n const next = Number(e.target.value);\n setValue(p.unit ? p.unit.fromDisplay(next) : next);\n }}\n />\n <span className={s.sliderReadout} aria-hidden=\"true\">\n {known\n ? (p.unit?.format?.(stored as number) ?? `${display}${p.unit?.suffix ?? ''}`)\n : '—'}\n </span>\n </>\n );\n }\n const unit = p.unit;\n const field = unit ? (\n <UnitField\n className={s.number}\n value={mixed || stored === undefined ? NaN : display}\n placeholder={mixed ? 'Mixed' : undefined}\n minValue={bounds.min}\n maxValue={bounds.max}\n step={bounds.step}\n accepts={prefUnitAccepts(unit)}\n aria-label={ariaLabel}\n onChange={(n) => setValue(unit.fromDisplay(n))}\n />\n ) : (\n <NumberField\n className={s.number}\n value={mixed || stored === undefined ? NaN : display}\n placeholder={mixed ? 'Mixed' : undefined}\n minValue={bounds.min}\n maxValue={bounds.max}\n step={bounds.step}\n hideSteppers\n aria-label={ariaLabel}\n onChange={(n) => {\n if (Number.isNaN(n)) return;\n setValue(n);\n }}\n />\n );\n if (unit?.suffix === undefined) return field;\n return (\n <>\n {field}\n <span className={s.unitSuffix} aria-hidden=\"true\">\n {unit.suffix}\n </span>\n </>\n );\n }\n case 'string': {\n return (\n <DraftInput\n text={mixed ? undefined : typeof value === 'string' ? value : ''}\n placeholder={mixed ? 'Mixed' : undefined}\n ariaLabel={ariaLabel}\n onCommit={setValue}\n />\n );\n }\n case 'boolean': {\n const p = pref as ToolPrefBoolean;\n if (p.control === 'toggle') {\n // One segment, so the bar is the flag: `short` (else the initial of\n // `name`) is all a paired row has room for, and `name` stays the\n // accessible name.\n //\n // No dimming wrapper here. Unselected already *is* how a toggle button\n // says \"not set\", and dimming it reads as disabled; mixed has an ARIA\n // form on a toggle — `mixedValues` — which the `Switch` below has to\n // fake for want of one.\n return (\n <ToggleBar<string>\n mode=\"multiple\"\n size=\"sm\"\n variant=\"flat\"\n className={s.flagToggle}\n ariaLabel={ariaLabel}\n items={[{\n value: ctx.path,\n label:\n p.icon && p.icon in ICON_PATHS ? (\n <Icon name={p.icon as IconName} size={14} />\n ) : (\n (p.short ?? p.name.slice(0, 1))\n ),\n ariaLabel,\n }]}\n value={value === true ? [ctx.path] : []}\n mixedValues={mixed ? [ctx.path] : []}\n onChange={(next) => setValue(next.includes(ctx.path))}\n />\n );\n }\n const control = <Switch isSelected={Boolean(value)} onChange={setValue} aria-label={ariaLabel} />;\n // Neither `Switch`'s indeterminate gap nor \"unset\" has an ARIA form, so\n // a reduced-opacity wrapper with a title is the cue for both — a mixed\n // selection, and a field the node leaves to its fallback.\n if (!mixed && !unset) return control;\n return (\n <span className={s.mixedSwitch} title={mixed ? 'Mixed' : 'Not set'}>\n {control}\n </span>\n );\n }\n case 'enum': {\n const p = pref as ToolPrefEnum;\n // An encoded leaf stores something other than the option string, so the\n // option comes from the encoding rather than from the value — and an\n // absent field is one of the things it reads (no dash is `solid`), which\n // is why `unset` doesn't blank the control here.\n const option = p.encoding\n ? (mixed ? undefined : p.encoding.read(value, ctx.siblings))\n : mixed || unset\n ? undefined\n : typeof value === 'string'\n ? value\n : p.default;\n const choose = (next: string): void =>\n setValue(p.encoding ? p.encoding.write(next, ctx.siblings) : next);\n if (p.control === 'toggle') {\n // Every option visible at once, which is the point of a segmented\n // control: a glyph, else `short`, keeps it to the width a property row\n // has, and the full label stays the accessible name. A mixed selection\n // selects nothing rather than picking a winner.\n return (\n <ToggleBar<string>\n size=\"sm\"\n variant=\"flat\"\n className={s.toggle}\n ariaLabel={ariaLabel}\n items={p.options.map((o) => ({\n value: o.value,\n label:\n o.icon && o.icon in ICON_PATHS ? (\n <Icon name={o.icon as IconName} size={14} />\n ) : (\n (o.short ?? o.label)\n ),\n ariaLabel: o.label,\n disabled: o.disabled,\n }))}\n value={option ?? null}\n onChange={(next) => { if (next !== null) choose(next); }}\n />\n );\n }\n return (\n <Select<string>\n className={s.select}\n options={p.options.map((o) => ({ value: o.value, label: o.label, isDisabled: o.disabled }))}\n selectedKey={option ?? null}\n placeholder={mixed ? 'Mixed' : unset ? '—' : undefined}\n onSelectionChange={choose}\n aria-label={ariaLabel}\n />\n );\n }\n case 'color': {\n const p = pref as ToolPrefColor;\n return (\n <ColorField\n value={mixed ? undefined : typeof value === 'string' ? value : p.default}\n mixed={mixed}\n alpha={p.alpha}\n onChange={setValue}\n aria-label={ariaLabel}\n />\n );\n }\n case 'paint': {\n // The value is a whole `FillStyle`, and `PaintInput` edits it as one —\n // previewing a gradient as a gradient rather than degrading it to the\n // indeterminate chip. That leaves the checkerboard meaning `mixed` and\n // nothing else.\n const p = pref as ToolPrefPaint;\n // `??` would read an explicit `null` — \"no paint\" — as absent and show\n // the schema default over it, so the None segment could never stay lit.\n // Unset shows the fallback that is actually on the canvas, dimmed: true,\n // but not chosen, which is what the dimming says.\n const paint = (value === null\n ? null\n : (value ?? (mixed ? undefined : p.default))) as FillStyle | null | undefined;\n return (\n <PaintInput\n // Per-kind switch memory is scratch for one selection; carrying it\n // across would recall the previous node's gradient.\n key={selectionKey}\n value={paint}\n mixed={mixed}\n unset={unset}\n // A nested paint writes one field of its parent, and no kit paint\n // field is optional — `Stroke.paint` is required. Removing the\n // whole parent is a different edit than repainting it, so the\n // control must not offer one as the other. A consumer whose\n // renderer owns the parent key (WeaselDraw's `setStroke`) can.\n allowNone={!nested}\n onChange={setValue}\n aria-label={ariaLabel}\n />\n );\n }\n case 'object': {\n // One value with fields hanging off it. Each child writes the parent\n // whole, so a field is never set on a half-built object.\n return <ObjectLeaf ctx={ctx} renderers={renderers} selectionKey={selectionKey} />;\n }\n default: {\n // Not reachable while every built-in kind has an arm — and a new kind\n // that lacks one is a compile error here, never a blank cell.\n const _exhaustive: never = pref;\n throw new Error(\n `SelectionPanel: no control for built-in pref kind \"${(_exhaustive as { kind: string }).kind}\"`,\n );\n }\n }\n}\n\n/**\n * Renders an object leaf: a titled block whose rows are the object's own\n * fields. A child's edit commits the parent object, never the child's path —\n * writing into a path whose value is not an object yet would corrupt it.\n */\n/** One labeled row inside an object leaf; `pair` merges adjacent fields into\n * it, exactly as the section rows merge theirs. */\ninterface ObjectRow {\n key: string;\n pair?: string;\n label: string;\n title?: string;\n /** Every field in the row brought its own chrome, so the row drops the\n * label column and spans the block. One unlabeled field in an otherwise\n * labeled pair would leave the row named after half of itself. */\n block: boolean;\n controls: ReactNode[];\n}\n\n/**\n * Renders an object leaf: the object's own fields, as rows. A child's edit\n * commits the parent object, never the child's path — writing into a path\n * whose value is not an object yet would corrupt it.\n */\nfunction ObjectLeaf({\n ctx,\n renderers,\n selectionKey = '',\n}: {\n ctx: PropertyRenderContext;\n renderers?: Record<string, PropertyRenderer>;\n selectionKey?: string;\n}): ReactNode {\n const pref = ctx.pref as ToolPrefObject;\n const held = typeof ctx.value === 'object' && ctx.value !== null\n ? (ctx.value as Record<string, unknown>)\n : undefined;\n\n // A value whose fields are entirely grouped is titled by those groups — its\n // own heading would stack onto the first one and name nothing new.\n const allGrouped = Object.values(pref.children).every((child) => !('kind' in child));\n\n // `indent` is false when nothing visible sits above these rows: depth is\n // drawn only where a label marks it.\n const rowsOf = (\n children: Record<string, ToolPrefLeaf | ToolPrefGroup>,\n indent: boolean,\n ): ReactNode[] => {\n const out: (ReactNode | ObjectRow)[] = [];\n const isRow = (v: ReactNode | ObjectRow): v is ObjectRow =>\n typeof v === 'object' && v !== null && 'controls' in v;\n\n // Cells accumulate unrendered so a run of adjacent same-`pair` flags can\n // be seen as a run before any of them draws; a group heading between two\n // fields ends the run, exactly as it ends a paired row.\n let pending: LeafCell[] = [];\n const flush = (): void => {\n for (const { key, leaf, block, content } of renderCells(pending, renderers)) {\n const prev = out[out.length - 1];\n if (leaf.pair !== undefined && isRow(prev) && prev.pair === leaf.pair) {\n prev.controls.push(<Fragment key={key}>{content}</Fragment>);\n prev.block &&= block;\n continue;\n }\n out.push({\n key,\n pair: leaf.pair,\n label: leaf.pair ?? leaf.name,\n title: leaf.description,\n block,\n controls: [<Fragment key={key}>{content}</Fragment>],\n });\n }\n pending = [];\n };\n\n for (const [key, child] of Object.entries(children)) {\n // A group among the children organises the fields under a heading\n // without contributing to the path — the rule group keys follow at the\n // top level.\n if (!('kind' in child)) {\n const labeled = child.name !== '';\n const inner = rowsOf(child.children, labeled);\n if (inner.length === 0) continue;\n flush();\n out.push(\n <div key={`group:${key}`} className={labeled && indent ? s.objectGroup : undefined}>\n {labeled && <h5 className={s.sectionTitle}>{child.name}</h5>}\n {inner}\n </div>,\n );\n continue;\n }\n const childPath = `${ctx.path}.${key}`;\n const childCtx: PropertyRenderContext = {\n path: childPath,\n pref: child,\n value: held?.[key],\n mixed: ctx.mixed,\n // A field of an object the node does not hold is unset, and so is one\n // the object omits — `data.stroke` absent leaves every stroke field\n // with nothing behind it, not with the schema's defaults.\n unset: !ctx.mixed && held?.[key] === undefined,\n siblings: held,\n valueAt: ctx.valueAt,\n setValue: (v) => {\n // The node holds no object yet, so writing one field has to\n // materialize the rest: the leaf's `default` is what a complete\n // value looks like. Starting from `{}` instead committed the one\n // field on its own — a `data.stroke` of `{ width: 2 }` with no\n // `paint`, which the type forbids and the painter threw on, taking\n // the whole frame and the visible document with it.\n const base = held\n ?? pref.fromScalar?.(ctx.value)\n ?? (typeof pref.default === 'object' && pref.default !== null\n ? { ...(pref.default as Record<string, unknown>) }\n : {});\n if (v === undefined) {\n // A field written as absent is absent — leaving the key holding\n // `undefined` says the object has a dash of nothing.\n const { [key]: _dropped, ...rest } = base;\n ctx.setValue(rest);\n return;\n }\n ctx.setValue({ ...base, [key]: v });\n },\n };\n pending.push({\n key: childPath,\n leaf: child,\n ctx: childCtx,\n ariaLabel: child.name,\n render: () => {\n const custom = renderers?.[childPath] ?? renderers?.[child.kind];\n const rendered = custom\n ? custom(childCtx)\n : renderBuiltin(childCtx, child.name, renderers, selectionKey, true);\n if (rendered == null) return null;\n // Neither a paired row nor a block one gives a field its own label\n // column, so the glyph is all that names it on screen. The control\n // already carries `name` as its accessible name, which leaves the\n // glyph decorative.\n const unlabeled = child.pair !== undefined || child.block === true;\n const glyph = unlabeled && child.icon && child.icon in ICON_PATHS;\n if (!glyph) return rendered;\n return (\n <span className={s.namedField}>\n <Icon name={child.icon as IconName} size={14} />\n {rendered}\n </span>\n );\n },\n });\n }\n flush();\n return out.map((entry) =>\n typeof entry === 'object' && entry !== null && 'controls' in entry ? (\n entry.block ? (\n <div key={entry.key} className={`${s.rowControls} ${s.blockRow}`} title={entry.title}>\n {entry.controls}\n </div>\n ) : (\n <div key={entry.key} className={s.row}>\n <span className={s.rowLabel} title={entry.title}>{entry.label}</span>\n <span className={s.rowControls}>{entry.controls}</span>\n </div>\n )\n ) : (\n entry\n ),\n );\n };\n\n const rows = rowsOf(pref.children, !allGrouped);\n if (rows.length === 0) return null;\n return (\n <div className={s.objectLeaf}>\n {!allGrouped && <h4 className={s.sectionTitle}>{pref.name}</h4>}\n {rows}\n </div>\n );\n}\n\n/** Text input with commit-on-blur/Enter semantics — live-per-keystroke\n * writes would emit one undo step per character. */\nfunction DraftInput({\n text,\n placeholder,\n ariaLabel,\n onCommit,\n}: {\n text: string | undefined;\n placeholder?: string;\n ariaLabel: string;\n onCommit: (v: string) => void;\n}) {\n const [draft, setDraft] = useState<string | null>(null);\n return (\n <Input\n value={draft ?? text ?? ''}\n placeholder={placeholder}\n aria-label={ariaLabel}\n onChange={setDraft}\n onBlur={() => {\n if (draft !== null && draft !== text) onCommit(draft);\n setDraft(null);\n }}\n onKeyDown={(e) => {\n if (e.key === 'Enter') (e.target as HTMLInputElement).blur();\n }}\n />\n );\n}\n","// Pure selection→panel derivations for SelectionPanel. Kept free of\n// React so intersection/aggregation semantics are unit-testable.\n//\n// Path convention (see core `NodePropertiesEntry`): a leaf's OWN KEY in\n// the schema is its node path — a dotted path of any depth rooted at\n// `pose` or `data` (`pose.x`, `data.fill`, `data.style.fontSize`). Group\n// keys are organizational only.\n\nimport {\n MIXED,\n type Mixed,\n type NodePropertiesEntry,\n type NodeRoutingEntry,\n type SceneNode,\n type ToolPrefGroup,\n type ToolPrefLeaf,\n} from '@weasel-js/core';\n\n// Re-exported under its existing public name here: the kit-wide \"these\n// values disagree\" sentinel (`@weasel-js/core`'s `MIXED`) also covers\n// multi-node aggregation, so this panel doesn't get its own symbol.\nexport { MIXED };\nexport type { Mixed };\n\nexport type AnyNode = SceneNode<unknown, string, unknown>;\n\n/**\n * One editable property in a {@link SelectionPanel}, paired with the dotted\n * node path it reads and writes.\n */\nexport interface PanelLeaf {\n /** Dotted node path — the leaf's key in the schema. */\n path: string;\n leaf: ToolPrefLeaf;\n}\n\n/**\n * One labeled row of a panel section. Holds several leaves when the schema\n * paired them.\n */\nexport interface PanelRow {\n label: string;\n leaves: PanelLeaf[];\n}\n\n/**\n * A titled block of rows, derived from one top-level group of a properties\n * schema. `key` is that group's schema key.\n */\nexport interface PanelSection {\n key: string;\n name: string;\n rows: PanelRow[];\n}\n\n/** Derive a node's kind: containers are `'group'`; leaves classify their\n * `data` through the routing entries (first match wins, `'unknown'`\n * otherwise) — same semantics as core's `NodeRouting.classify`. */\nexport function classifyKind(\n node: AnyNode,\n routing: readonly NodeRoutingEntry[],\n): string {\n if (node.kind === 'container') return 'group';\n for (const entry of routing) {\n if (entry.matches(node.data)) return entry.name;\n }\n return 'unknown';\n}\n\nexport function isGroup(n: ToolPrefLeaf | ToolPrefGroup): n is ToolPrefGroup {\n return !('kind' in n);\n}\n\n/** Flatten a schema to sections of leaves. Nested groups fold into their\n * top-level section; top-level leaves get an untitled leading section. */\nfunction flatten(schema: ToolPrefGroup): PanelSection[] {\n const sections: PanelSection[] = [];\n const untitled: PanelLeaf[] = [];\n\n const collect = (group: ToolPrefGroup, into: PanelLeaf[]): void => {\n for (const [key, child] of Object.entries(group.children)) {\n if (isGroup(child)) collect(child, into);\n else into.push({ path: key, leaf: child });\n }\n };\n\n for (const [key, child] of Object.entries(schema.children)) {\n if (isGroup(child)) {\n const leaves: PanelLeaf[] = [];\n collect(child, leaves);\n sections.push({ key, name: child.name, rows: pairRows(leaves) });\n } else {\n untitled.push({ path: key, leaf: child });\n }\n }\n if (untitled.length > 0) {\n sections.unshift({ key: '', name: '', rows: pairRows(untitled) });\n }\n return sections;\n}\n\n/** Merge consecutive leaves sharing a `pair` id into one labeled row. */\nexport function pairRows(leaves: readonly PanelLeaf[]): PanelRow[] {\n const rows: PanelRow[] = [];\n for (const item of leaves) {\n const pair = item.leaf.pair;\n const prev = rows[rows.length - 1];\n if (pair !== undefined && prev !== undefined && prev.label === pair) {\n prev.leaves.push(item);\n } else {\n rows.push({ label: pair ?? item.leaf.name, leaves: [item] });\n }\n }\n return rows;\n}\n\n/**\n * The schema the panel shows for a set of kinds: one kind → its full\n * schema; several → the intersection by (path, leaf kind), shaped by the\n * first kind's section/row layout. Kinds without a registered schema\n * contribute nothing, so their presence collapses the intersection.\n */\nexport function effectiveSections(\n kinds: readonly string[],\n entries: readonly NodePropertiesEntry[],\n): PanelSection[] {\n const uniq = [...new Set(kinds)];\n if (uniq.length === 0) return [];\n const byName = new Map(entries.map((e) => [e.name, e]));\n const schemas = uniq.map((k) => byName.get(k)?.schema);\n if (schemas.some((s) => s === undefined)) return [];\n const [first, ...rest] = schemas as ToolPrefGroup[];\n\n const flatFirst = flatten(first);\n if (rest.length === 0) return flatFirst;\n\n // '\\0' delimiter: path and kind strings are unconstrained, so a\n // printable separator could collide with real content.\n const leafKey = (l: PanelLeaf): string => `${l.path}\\0${l.leaf.kind}`;\n const restKeys = rest.map(\n (schema) =>\n new Set(\n flatten(schema)\n .flatMap((s) => s.rows)\n .flatMap((r) => r.leaves)\n .map(leafKey),\n ),\n );\n const keep = (l: PanelLeaf): boolean =>\n restKeys.every((set) => set.has(leafKey(l)));\n\n return flatFirst\n .map((section) => ({\n ...section,\n rows: section.rows\n .map((row) => ({ ...row, leaves: row.leaves.filter(keep) }))\n .filter((row) => row.leaves.length > 0),\n }))\n .filter((section) => section.rows.length > 0);\n}\n\n/** Read a node value at a dotted path of any depth (`pose.x`,\n * `data.style.fontSize`, `data.style.fill.color`). Returns `undefined` if\n * the path is dotless (mirrors `commit`'s no-op on a malformed schema\n * key) or if any intermediate segment is missing or not an object. */\nexport function nodeValueAt(node: AnyNode, path: string): unknown {\n const segments = path.split('.');\n if (segments.length < 2) return undefined;\n const head = segments[0];\n let cursor: unknown = head === 'pose' ? node.pose : head === 'data' ? node.data : undefined;\n for (let i = 1; i < segments.length; i++) {\n if (cursor == null || typeof cursor !== 'object') return undefined;\n cursor = (cursor as Record<string, unknown>)[segments[i]];\n }\n return cursor;\n}\n\n/** Immutably set `value` at a dotted path within `root`, cloning each level\n * on the way down so React sees new object identities. Arrays stay arrays\n * (an array intermediate is shallow-copied, not flattened into `{0: ...}`)\n * — this is the write-side twin of `nodeValueAt`, so a schema author who\n * gets a working read gets a working write. */\nexport function setAtPath(root: object, segments: readonly string[], value: unknown): object {\n const [head, ...rest] = segments;\n if (rest.length === 0) {\n return Array.isArray(root)\n ? Object.assign([...root], { [head]: value })\n : { ...root, [head]: value };\n }\n const child = (root as Record<string, unknown>)[head];\n const childObj = Array.isArray(child)\n ? [...child]\n : child != null && typeof child === 'object'\n ? { ...child }\n : {};\n const nested = setAtPath(childObj, rest, value);\n return Array.isArray(root)\n ? Object.assign([...root], { [head]: nested })\n : { ...root, [head]: nested };\n}\n\n/** Aggregate a path across nodes: the shared value, or `MIXED`. */\nexport function aggregateValue(\n nodes: readonly AnyNode[],\n path: string,\n): unknown | Mixed {\n let value: unknown;\n let first = true;\n for (const node of nodes) {\n const v = nodeValueAt(node, path);\n if (first) {\n value = v;\n first = false;\n } else if (!Object.is(v, value)) {\n return MIXED;\n }\n }\n return value;\n}\n\n/** `'rect ×2 · text'` — kinds in first-seen order with counts. */\nexport function kindBreakdown(kinds: readonly string[]): string {\n const counts = new Map<string, number>();\n for (const k of kinds) counts.set(k, (counts.get(k) ?? 0) + 1);\n return [...counts.entries()]\n .map(([k, n]) => (n > 1 ? `${k} ×${n}` : k))\n .join(' · ');\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACsHA,SAAgB,EAAW,GAAgB,GAAuD;CAChG,IAAM,EAAE,YAAS;AACjB,QACE,EAAK,SAAS,aACb,EAA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C7B,QAAO;;AAGX,QAAO;;AAIT,SAAgB,EAAc,GAAkC;CAC9D,IAAM,oBAAS,IAAI,KAAqB;AACxC,MAAK,IAAM,KAAK,EAAO,GAAO,IAAI,IAAI,EAAO,IAAI,EAAE,IAAI,KAAK,EAAE;AAC9D,QAAO,CAAC,GAAG,EAAO,SAAS,CAAC,CACzB,KAAK,CAAC,GAAG,OAAQ,IAAI,IAAI,GAAG,EAAE,IAAI,MAAM,EAAG,CAC3C,KAAK,MAAM"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"number-BHz66zQO.js","names":[],"sources":["../../src/format/number.ts"],"sourcesContent":["/**\n * Display-formatter for numbers. Use this anywhere a number is shown to\n * a user. The whole point: negative values get prefixed with the real\n * MINUS SIGN (U+2212) instead of the ASCII HYPHEN-MINUS (U+002D) that\n * `toLocaleString` and template literals produce by default.\n *\n * U+2212 is the same visual width as `+` and reads as a sign rather\n * than a hyphen — columns of signed numbers align cleanly and the\n * glyph doesn't get confused with a bullet or list dash.\n */\nexport const MINUS_SIGN = '−';\n\n/**\n * Formats a number for display, substituting {@link MINUS_SIGN} for the ASCII\n * hyphen `toLocaleString` emits. Non-finite values stringify as-is.\n */\nexport function formatNumber(value: number, options?: Intl.NumberFormatOptions): string {\n const formatted = Number.isFinite(value)\n ? value.toLocaleString(undefined, options)\n : String(value);\n return formatted.replace(/^-/, MINUS_SIGN);\n}\n\n/**\n * Parses a string that may carry {@link MINUS_SIGN} in place of the ASCII\n * hyphen. The inverse of {@link formatNumber} for any editing surface that\n * renders its value through it and reads the edited text back.\n */\nexport function parseSignedNumber(text: string): number {\n return Number(text.replace(MINUS_SIGN, '-'));\n}\n\n/** Powers of ten a typed magnitude suffix stands for. */\nconst EXPONENTS: Record<string, number> = { k: 3, m: 6, b: 9, t: 12 };\n\n/**\n * Formats a number the way a `compact` readout shows it: below 1,000 at\n * `decimals` places, from 1,000 up at one decimal with a magnitude suffix\n * (`40.0K`, `2.0M`). Always `en-US`, so {@link parseNumber} reads it back.\n */\nexport function formatCompact(value: number, decimals = 0): string {\n if (!Number.isFinite(value)) return formatNumber(value);\n const options: Intl.NumberFormatOptions =\n Math.abs(value) < 1000\n ? { useGrouping: false, minimumFractionDigits: decimals, maximumFractionDigits: decimals }\n : { notation: 'compact', minimumFractionDigits: 1, maximumFractionDigits: 1 };\n return value.toLocaleString('en-US', options).replace(/^-/, MINUS_SIGN);\n}\n\n/**\n * Reads a typed number: anything {@link parseSignedNumber} reads, plus\n * thousands commas in the `40,000` shape and a `k`/`m`/`b`/`t` suffix in either\n * case (`2.5m` is 2,500,000). Empty text is NaN rather than zero.\n *\n * Given `units` — a suffix mapped to the factor it scales by — a trailing unit\n * name is read first: the longest match wins, exact case before any case, and\n * a unit beats a magnitude suffix, so with `m` accepted `2m` is `2 * units.m`.\n */\nexport function parseNumber(text: string, units?: Readonly<UnitTable>): number {\n if (units) {\n const trimmed = text.trim();\n const name = unitSuffixOf(trimmed, units);\n if (name !== undefined) {\n const terms = compoundTermsOf(trimmed, units);\n if (terms !== undefined && terms.length > 1) return compoundValue(terms, trimmed, units);\n const { factor, offset } = scaleOf(units[name]!);\n return scaled(parseNumber(trimmed.slice(0, -name.length)), factor) + offset;\n }\n }\n let t = text.trim().replace(MINUS_SIGN, '-');\n const exponent = EXPONENTS[t.slice(-1).toLowerCase()];\n if (exponent !== undefined) t = t.slice(0, -1).trimEnd();\n if (/^[-+]?\\d{1,3}(,\\d{3})+(\\.\\d*)?$/.test(t)) t = t.replace(/,/g, '');\n if (!/\\d/.test(t)) return Number.NaN;\n // Scaled through the exponent rather than by multiplying: 1.1 * 1000 is 1100.0000000000002.\n return Number(exponent === undefined ? t : `${t}e${exponent}`);\n}\n\n/** One unit's conversion into the shown unit: a bare factor, or a scale that\n * also moves zero. Structurally the kit's `UnitEntry`, kept local so this\n * formatting helper stays free of the scene vocabulary. */\nexport type UnitTableEntry = number | { factor: number; offset?: number };\n/** Suffixes a person may type, each mapped to its conversion. */\nexport type UnitTable = Record<string, UnitTableEntry>;\n\n/** Divided by the reciprocal below 1: 12 * 0.1 is 1.2000000000000002, 12 / 10 is 1.2. */\nfunction scaled(n: number, factor: number): number {\n return factor < 1 ? n / (1 / factor) : n * factor;\n}\n\n/** A unit table entry's scale, with the bare-factor shorthand widened. */\nfunction scaleOf(entry: UnitTableEntry): { factor: number; offset: number } {\n return typeof entry === 'number'\n ? { factor: entry, offset: 0 }\n : { factor: entry.factor, offset: entry.offset ?? 0 };\n}\n\n/**\n * The unit names in `text`, in reading order, when every one of them closes a\n * `<number><unit>` term — which is what tells `5ft 3in` from a malformed\n * `5ft 3`. Undefined when the text is not a run of whole terms.\n */\nfunction compoundTermsOf(text: string, units: Readonly<UnitTable>): string[] | undefined {\n const names: string[] = [];\n let rest = text.trimEnd();\n while (rest !== '') {\n const name = unitSuffixOf(rest, units);\n if (name === undefined) return undefined;\n names.push(name);\n const before = rest.slice(0, -name.length);\n const m = /(\\d+(?:\\.\\d+)?|\\.\\d+)\\s*$/.exec(before);\n if (!m) return undefined;\n rest = before.slice(0, m.index).trimEnd();\n // A sign leads the whole value, so it ends the walk rather than a term.\n if (rest === '-' || rest === '+' || rest === MINUS_SIGN) rest = '';\n }\n return names.length === 0 ? undefined : names.reverse();\n}\n\n/**\n * `5ft 3in` as one number in the shown unit. Every term scales and they sum;\n * a leading sign carries across all of them, so `-5ft 3in` is −63in and not\n * −57. Offsets have no meaning in a sum — 1K + 2degC is not a temperature —\n * so a term carrying one makes the whole value unreadable.\n */\nfunction compoundValue(names: string[], text: string, units: Readonly<UnitTable>): number {\n const digits = text.match(/\\d+(?:\\.\\d+)?|\\.\\d+/g);\n if (!digits || digits.length !== names.length) return Number.NaN;\n const sign = /^\\s*[-\\u2212]/.test(text) ? -1 : 1;\n let total = 0;\n for (const [i, name] of names.entries()) {\n const { factor, offset } = scaleOf(units[name]!);\n if (offset !== 0) return Number.NaN;\n total += scaled(Number(digits[i]), factor);\n }\n return sign * total;\n}\n\n/** The longest unit name `text` ends with — exact case first, then any case. */\nfunction unitSuffixOf(text: string, units: Readonly<UnitTable>): string | undefined {\n const names = Object.keys(units).filter((n) => n !== '').sort((a, b) => b.length - a.length);\n const lower = text.toLowerCase();\n return names.find((n) => text.endsWith(n)) ?? names.find((n) => lower.endsWith(n.toLowerCase()));\n}\n\n/** {@link String} with the leading ASCII hyphen swapped for {@link MINUS_SIGN}.\n * Locale-independent, unlike `toLocaleString`. */\nfunction signedString(value: number): string {\n return String(value).replace(/^-/, MINUS_SIGN);\n}\n\n/**\n * Formats a zoom factor for display. Below 2x a percentage reads naturally;\n * past it the numbers get long and a multiplier is what people say out loud,\n * so 250% shows as `2.5x`. Past 100x a tenth is noise, so the decimal is\n * dropped and thousands are grouped: `1009.74` reads as `1,010x`.\n */\nexport function formatZoom(zoom: number): string {\n if (!Number.isFinite(zoom)) return String(zoom);\n if (zoom <= 2) return `${signedString(Math.round(zoom * 100))}%`;\n if (zoom >= 100) return `${Math.round(zoom).toLocaleString('en-US')}x`;\n return `${signedString(Math.round(zoom * 10) / 10)}x`;\n}\n"],"mappings":";AAUA,IAAa,IAAa;AAM1B,SAAgB,EAAa,GAAe,GAA4C;AAItF,SAHkB,OAAO,SAAS,EAAM,GACpC,EAAM,eAAe,KAAA,GAAW,EAAQ,GACxC,OAAO,EAAM,EACA,QAAQ,MAAA,IAAiB;;AAQ5C,SAAgB,EAAkB,GAAsB;AACtD,QAAO,OAAO,EAAK,QAAA,KAAoB,IAAI,CAAC;;AAI9C,IAAM,IAAoC;CAAE,GAAG;CAAG,GAAG;CAAG,GAAG;CAAG,GAAG;CAAI;AAOrE,SAAgB,EAAc,GAAe,IAAW,GAAW;AACjE,KAAI,CAAC,OAAO,SAAS,EAAM,CAAE,QAAO,EAAa,EAAM;CACvD,IAAM,IACJ,KAAK,IAAI,EAAM,GAAG,MACd;EAAE,aAAa;EAAO,uBAAuB;EAAU,uBAAuB;EAAU,GACxF;EAAE,UAAU;EAAW,uBAAuB;EAAG,uBAAu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e,QAAQ,CAAC,KAC7D,GAAG,EAAa,KAAK,MAAM,IAAO,GAAG,GAAG,GAAG,CAAC,KAHhB,OAAO,EAAK"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"range.module-DSsOIq1R.js","names":[],"sources":["../../src/components/range.module.css"],"sourcesContent":["/* The one skin for a native <input type=\"range\">. Imported by InlineRange and\n by the property rows, which render the same DOM and used to carry three\n independently authored copies of these rules.\n\n The track is painted here rather than left to `accent-color`: a UA fills the\n left of the track with the accent but draws the remainder near-white on a\n dark surface whatever `color-scheme` says, and overriding the track's\n background removes the accent fill instead of recolouring the remainder. */\n.range {\n appearance: none;\n -webkit-appearance: none;\n width: 100%;\n min-inline-size: 48px;\n /* The box is taller than the track so the thumb has room to spill; a surface\n where the element itself IS the track overrides this. */\n height: var(--wzl-range-box-h, 12px);\n margin: 0;\n padding: 0;\n /* Transparent so the track pseudo-element shows; a surface that paints the element itself overrides it. */\n background: var(--wzl-range-bg, transparent);\n cursor: pointer;\n}\n\n.range::-webkit-slider-runnable-track {\n height: var(--wzl-slider-track-h, 4px);\n border-radius: var(--wzl-radius-sm);\n background: var(\n --wzl-range-track-bg,\n color-mix(in srgb, var(--wzl-accent) var(--wzl-slider-track-mix, 18%), transparent)\n );\n}\n\n.range::-moz-range-track {\n height: var(--wzl-slider-track-h, 4px);\n border-radius: var(--wzl-radius-sm);\n background: var(\n --wzl-range-track-bg,\n color-mix(in srgb, var(--wzl-accent) var(--wzl-slider-track-mix, 18%), transparent)\n );\n}\n\n.range::-webkit-slider-thumb {\n appearance: none;\n -webkit-appearance: none;\n width: var(--wzl-slider-thumb-size, 8px);\n height: var(--wzl-slider-thumb-size, 8px);\n border: none;\n border-radius: 50%;\n background: color-mix(in srgb, var(--wzl-accent) var(--wzl-slider-thumb-mix, 70%), transparent);\n /* Centres an 8px thumb on a 4px track. Webkit does not centre it for you. */\n margin-top: calc((var(--wzl-slider-track-h, 4px) - var(--wzl-slider-thumb-size, 8px)) / 2);\n}\n\n.range::-moz-range-thumb {\n width: var(--wzl-slider-thumb-size, 8px);\n height: var(--wzl-slider-thumb-size, 8px);\n border: none;\n border-radius: 50%;\n background: color-mix(in srgb, var(--wzl-accent) var(--wzl-slider-thumb-mix, 70%), transparent);\n}\n\n.range:focus-visible {\n outline: 2px solid var(--wzl-focus-ring);\n outline-offset: 2px;\n}\n\n.range:disabled {\n cursor: not-allowed;\n opacity: 0.55;\n}\n\n/* Alpha variant: a fainter track, used where the row already carries a colour\n swatch and the slider must not compete with it. */\n.alpha::-webkit-slider-runnable-track {\n background: var(--wzl-range-track-bg, color-mix(in srgb, var(--wzl-accent) 10%, transparent));\n}\n\n.alpha::-moz-range-track {\n background: var(--wzl-range-track-bg, color-mix(in srgb, var(--wzl-accent) 10%, transparent));\n}\n\n/* A dead alpha track keeps its groove but loses its thumb, so the affordance\n reads inert rather than merely dimmed. Keyed off `:disabled`, which ColorRow\n already sets on the input — not off a class on the row. */\n.alpha:disabled::-webkit-slider-runnable-track,\n.alpha:disabled::-moz-range-track {\n background: color-mix(in srgb, var(--wzl-fg) 5%, transparent);\n}\n\n.alpha:disabled::-webkit-slider-thumb,\n.alpha:disabled::-moz-range-thumb {\n background: transparent;\n}\n"],"mappings":""}
|