@weasel-js/ui 1.6.1 → 1.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (517) hide show
  1. package/dist/chunks/ActionBar-xA73vzzF.js +64 -0
  2. package/dist/chunks/ActionBar-xA73vzzF.js.map +1 -0
  3. package/dist/chunks/Badge-CTc9Lkwn.js +14 -0
  4. package/dist/chunks/Badge-CTc9Lkwn.js.map +1 -0
  5. package/dist/chunks/{Badge-CyAIZSDo.js → Badge-jYQjrTKc.js} +506 -486
  6. package/dist/chunks/Badge-jYQjrTKc.js.map +1 -0
  7. package/dist/chunks/BandEditor-Dd0egAgE.js +292 -0
  8. package/dist/chunks/BandEditor-Dd0egAgE.js.map +1 -0
  9. package/dist/chunks/{Button-BIdXHQOx.js → Button-XB-T75YL.js} +2 -2
  10. package/dist/chunks/{Button-BIdXHQOx.js.map → Button-XB-T75YL.js.map} +1 -1
  11. package/dist/chunks/{ButtonBar-D5Vi0aj_.js → ButtonBar-CIMKPPRS.js} +7 -9
  12. package/dist/chunks/{ButtonBar-D5Vi0aj_.js.map → ButtonBar-CIMKPPRS.js.map} +1 -1
  13. package/dist/chunks/Callout-BUn0dP_S.js +115 -0
  14. package/dist/chunks/Callout-BUn0dP_S.js.map +1 -0
  15. package/dist/chunks/Checkbox-DFn-x0JO.js +37 -0
  16. package/dist/chunks/Checkbox-DFn-x0JO.js.map +1 -0
  17. package/dist/chunks/CloseButton-BmNmRVtb.js +26 -0
  18. package/dist/chunks/CloseButton-BmNmRVtb.js.map +1 -0
  19. package/dist/chunks/ColorField-BLs9fbeq.js +90 -0
  20. package/dist/chunks/ColorField-BLs9fbeq.js.map +1 -0
  21. package/dist/chunks/{ColorModeControl-ke5PXbBa.js → ColorModeControl-DaVJ-SyX.js} +3 -3
  22. package/dist/chunks/{ColorModeControl-ke5PXbBa.js.map → ColorModeControl-DaVJ-SyX.js.map} +1 -1
  23. package/dist/chunks/ComboBox-CuTLRmUg.js +138 -0
  24. package/dist/chunks/ComboBox-CuTLRmUg.js.map +1 -0
  25. package/dist/chunks/{CurveEditor-BDJXjEvK.js → CurveEditor-jVBEqqdv.js} +90 -87
  26. package/dist/chunks/CurveEditor-jVBEqqdv.js.map +1 -0
  27. package/dist/chunks/{DataGrid-D-dZj1BD.js → DataGrid-BklgBqS0.js} +17 -17
  28. package/dist/chunks/DataGrid-BklgBqS0.js.map +1 -0
  29. package/dist/chunks/DetailList-DFtqdOJj.js +52 -0
  30. package/dist/chunks/DetailList-DFtqdOJj.js.map +1 -0
  31. package/dist/chunks/{DetentSlider-CL8TlX3S.js → DetentSlider-Bh7EpMqT.js} +2 -2
  32. package/dist/chunks/{DetentSlider-CL8TlX3S.js.map → DetentSlider-Bh7EpMqT.js.map} +1 -1
  33. package/dist/chunks/Dialog-DKfsk5VN.js +63 -0
  34. package/dist/chunks/Dialog-DKfsk5VN.js.map +1 -0
  35. package/dist/chunks/{Disclosure-0G0uh2fa.js → Disclosure-Ch2KxYuB.js} +7 -7
  36. package/dist/chunks/Disclosure-Ch2KxYuB.js.map +1 -0
  37. package/dist/chunks/{DragGhost-B5_hb9W9.js → DragGhost-BeYDJyLZ.js} +2 -2
  38. package/dist/chunks/{DragGhost-B5_hb9W9.js.map → DragGhost-BeYDJyLZ.js.map} +1 -1
  39. package/dist/chunks/{DragHandleGlyph-Dr7Fgo0I.js → DragGrip-AoIZXfZb.js} +2 -2
  40. package/dist/chunks/DragGrip-AoIZXfZb.js.map +1 -0
  41. package/dist/chunks/FallthroughDiagram-C7BUe8eU.js +284 -0
  42. package/dist/chunks/FallthroughDiagram-C7BUe8eU.js.map +1 -0
  43. package/dist/chunks/Field-DsBlnFKf.js +25 -0
  44. package/dist/chunks/Field-DsBlnFKf.js.map +1 -0
  45. package/dist/chunks/FillStrokeSwatch-CgsYQgew.js +112 -0
  46. package/dist/chunks/FillStrokeSwatch-CgsYQgew.js.map +1 -0
  47. package/dist/chunks/{FontFamilySelect-DXlMKWfK.js → FontFamilySelect-CGJ5OIOy.js} +2 -2
  48. package/dist/chunks/FontFamilySelect-CGJ5OIOy.js.map +1 -0
  49. package/dist/chunks/FontWeightSelect-RbcXYJPS.js +49 -0
  50. package/dist/chunks/FontWeightSelect-RbcXYJPS.js.map +1 -0
  51. package/dist/chunks/GestureRoute-BXESrHI0.js +82 -0
  52. package/dist/chunks/GestureRoute-BXESrHI0.js.map +1 -0
  53. package/dist/chunks/GradientEditor-DypXzMc-.js +325 -0
  54. package/dist/chunks/GradientEditor-DypXzMc-.js.map +1 -0
  55. package/dist/chunks/{Icon-Cgzy8VgC.js → Icon--B1ME-6c.js} +33 -1
  56. package/dist/chunks/Icon--B1ME-6c.js.map +1 -0
  57. package/dist/chunks/{InlineRange-eOj6JpJl.js → InlineRange-P01ABSzo.js} +3 -3
  58. package/dist/chunks/InlineRange-P01ABSzo.js.map +1 -0
  59. package/dist/chunks/{Input-CHmkfYaD.js → Input-CzwvCZs_.js} +10 -15
  60. package/dist/chunks/Input-CzwvCZs_.js.map +1 -0
  61. package/dist/chunks/{ItemList-Cm-HUWCi.js → ItemList-CRu9y7hL.js} +2 -2
  62. package/dist/chunks/ItemList-CRu9y7hL.js.map +1 -0
  63. package/dist/chunks/{Jog-DESxZ44P.js → Jog-DfNUYejm.js} +8 -8
  64. package/dist/chunks/Jog-DfNUYejm.js.map +1 -0
  65. package/dist/chunks/{Keycaps-C0H_v2gO.js → Keycaps-C-FJyG8k.js} +14 -14
  66. package/dist/chunks/Keycaps-C-FJyG8k.js.map +1 -0
  67. package/dist/chunks/{LayerList-nz-QYvTF.js → LayerList-CsDqwYh-.js} +105 -111
  68. package/dist/chunks/LayerList-CsDqwYh-.js.map +1 -0
  69. package/dist/chunks/ListEditor-BnGzqERm.js +72 -0
  70. package/dist/chunks/ListEditor-BnGzqERm.js.map +1 -0
  71. package/dist/chunks/MenuButton-L9f5vido.js +75 -0
  72. package/dist/chunks/MenuButton-L9f5vido.js.map +1 -0
  73. package/dist/chunks/MeshEditor-GbqqiPk8.js +199 -0
  74. package/dist/chunks/MeshEditor-GbqqiPk8.js.map +1 -0
  75. package/dist/chunks/NumberField-DLXXgh48.js +209 -0
  76. package/dist/chunks/NumberField-DLXXgh48.js.map +1 -0
  77. package/dist/chunks/{OptionsBar-DbzAgIln.js → OptionsBar-DeTAjVb7.js} +6 -8
  78. package/dist/chunks/{OptionsBar-DbzAgIln.js.map → OptionsBar-DeTAjVb7.js.map} +1 -1
  79. package/dist/chunks/PaintField-C0hoXc0Y.js +63 -0
  80. package/dist/chunks/PaintField-C0hoXc0Y.js.map +1 -0
  81. package/dist/chunks/PaintInput-jQRxM95Y.js +132 -0
  82. package/dist/chunks/PaintInput-jQRxM95Y.js.map +1 -0
  83. package/dist/chunks/PatternPicker-CaMYXzhF.js +135 -0
  84. package/dist/chunks/PatternPicker-CaMYXzhF.js.map +1 -0
  85. package/dist/chunks/{Plot2D-CTXHkL5p.js → Plot2D-BHNbgCAl.js} +7 -7
  86. package/dist/chunks/Plot2D-BHNbgCAl.js.map +1 -0
  87. package/dist/chunks/{PointPlotter-Bxo6haKe.js → PointPlotter-BZ_vk6gV.js} +2 -2
  88. package/dist/chunks/{PointPlotter-Bxo6haKe.js.map → PointPlotter-BZ_vk6gV.js.map} +1 -1
  89. package/dist/chunks/{Powerline-ExO5GwEr.js → Powerline-6wIFmDik.js} +2 -2
  90. package/dist/chunks/{Powerline-ExO5GwEr.js.map → Powerline-6wIFmDik.js.map} +1 -1
  91. package/dist/chunks/{Prefs-DpqFKiwY.js → Prefs-CkyldX-e.js} +116 -91
  92. package/dist/chunks/Prefs-CkyldX-e.js.map +1 -0
  93. package/dist/chunks/{Properties-D_KzDN9K.js → Properties-D15c8NP-.js} +53 -47
  94. package/dist/chunks/Properties-D15c8NP-.js.map +1 -0
  95. package/dist/chunks/PropertyField-CV_Gw57S.js +686 -0
  96. package/dist/chunks/PropertyField-CV_Gw57S.js.map +1 -0
  97. package/dist/chunks/{RadioGroup-Bh4-12e-.js → RadioGroup-4dbzqvGy.js} +2 -2
  98. package/dist/chunks/{RadioGroup-Bh4-12e-.js.map → RadioGroup-4dbzqvGy.js.map} +1 -1
  99. package/dist/chunks/{RangeSlider-BKRRTPTZ.js → RangeSlider-BxokZViJ.js} +8 -8
  100. package/dist/chunks/RangeSlider-BxokZViJ.js.map +1 -0
  101. package/dist/chunks/RecentColorsProvider-DHcfk25u.js +84 -0
  102. package/dist/chunks/RecentColorsProvider-DHcfk25u.js.map +1 -0
  103. package/dist/chunks/ResizeHandle-CbAgCQOt.js +81 -0
  104. package/dist/chunks/ResizeHandle-CbAgCQOt.js.map +1 -0
  105. package/dist/chunks/Select-BppLsJTz.js +236 -0
  106. package/dist/chunks/Select-BppLsJTz.js.map +1 -0
  107. package/dist/chunks/SelectionPanel-Cm1qu-ZX.js +107 -0
  108. package/dist/chunks/SelectionPanel-Cm1qu-ZX.js.map +1 -0
  109. package/dist/chunks/SidebarPanel-AXQ0jRDx.js +53 -0
  110. package/dist/chunks/SidebarPanel-AXQ0jRDx.js.map +1 -0
  111. package/dist/chunks/Slider-Cl5RCeZ7.js +389 -0
  112. package/dist/chunks/Slider-Cl5RCeZ7.js.map +1 -0
  113. package/dist/chunks/{StatusBar-DzoPDY4k.js → StatusBar-Ca9Dvhhq.js} +6 -6
  114. package/dist/chunks/StatusBar-Ca9Dvhhq.js.map +1 -0
  115. package/dist/chunks/SwatchGrid-9ZPiDmxd.js +78 -0
  116. package/dist/chunks/SwatchGrid-9ZPiDmxd.js.map +1 -0
  117. package/dist/chunks/SwatchStrip-Cw0l8Om7.js +577 -0
  118. package/dist/chunks/SwatchStrip-Cw0l8Om7.js.map +1 -0
  119. package/dist/chunks/ThemeSwitcher-DiBmMh_B.js +38 -0
  120. package/dist/chunks/ThemeSwitcher-DiBmMh_B.js.map +1 -0
  121. package/dist/chunks/{Timeline--58F7MED.js → Timeline-pqnYk5cV.js} +296 -294
  122. package/dist/chunks/Timeline-pqnYk5cV.js.map +1 -0
  123. package/dist/chunks/Toast-C3ozq11V.js +170 -0
  124. package/dist/chunks/Toast-C3ozq11V.js.map +1 -0
  125. package/dist/chunks/{ToggleBar-DTjGeS0Q.js → ToggleBar-Z2jZiguF.js} +13 -15
  126. package/dist/chunks/ToggleBar-Z2jZiguF.js.map +1 -0
  127. package/dist/chunks/{TokenPanel-CMq7uydV.js → TokenPanel-DAkL6vwQ.js} +33 -33
  128. package/dist/chunks/TokenPanel-DAkL6vwQ.js.map +1 -0
  129. package/dist/chunks/{ToolButton-CR4sQlxF.js → ToolButton-BURp4YIO.js} +12 -14
  130. package/dist/chunks/ToolButton-BURp4YIO.js.map +1 -0
  131. package/dist/chunks/{ToolOptionsBar-CtzTlaN2.js → ToolOptionsBar-COsTJ1cu.js} +9 -7
  132. package/dist/chunks/ToolOptionsBar-COsTJ1cu.js.map +1 -0
  133. package/dist/chunks/{ToolPalette-CKG9qY6P.js → ToolPalette-DKDFWOX-.js} +8 -10
  134. package/dist/chunks/ToolPalette-DKDFWOX-.js.map +1 -0
  135. package/dist/chunks/{Tooltip-Clg2mhSt.js → Tooltip-C6eFCYxw.js} +2 -2
  136. package/dist/chunks/{Tooltip-Clg2mhSt.js.map → Tooltip-C6eFCYxw.js.map} +1 -1
  137. package/dist/chunks/{Tree-DVOtc9R5.js → Tree-Cc8lIzgM.js} +2 -2
  138. package/dist/chunks/Tree-Cc8lIzgM.js.map +1 -0
  139. package/dist/chunks/checkbox.module-DLQV9tMX.js +5 -0
  140. package/dist/chunks/checkbox.module-DLQV9tMX.js.map +1 -0
  141. package/dist/chunks/{createKeyframeLayer-Czj6Y235.js → createKeyframeLayer-BTa4LyJE.js} +208 -223
  142. package/dist/chunks/createKeyframeLayer-BTa4LyJE.js.map +1 -0
  143. package/dist/chunks/field.module-Bh7BTKMh.js +15 -0
  144. package/dist/chunks/field.module-Bh7BTKMh.js.map +1 -0
  145. package/dist/chunks/formatShortcut-DRQrVThu.js.map +1 -1
  146. package/dist/chunks/handles-CqVANLtu.js +17 -0
  147. package/dist/chunks/handles-CqVANLtu.js.map +1 -0
  148. package/dist/chunks/{icons-Dk8SRS8g.js → icons-Dr2-r30x.js} +2 -2
  149. package/dist/chunks/icons-Dr2-r30x.js.map +1 -0
  150. package/dist/chunks/listbox.module-BcdVJMbm.js +8 -0
  151. package/dist/chunks/listbox.module-BcdVJMbm.js.map +1 -0
  152. package/dist/chunks/model-B1-gMBIW.js +386 -0
  153. package/dist/chunks/model-B1-gMBIW.js.map +1 -0
  154. package/dist/chunks/{portalHost-yTOVuCej.js → portalHost-CE70wLzo.js} +10 -6
  155. package/dist/chunks/portalHost-CE70wLzo.js.map +1 -0
  156. package/dist/chunks/prefField-BE_Ytr2H.js +229 -0
  157. package/dist/chunks/prefField-BE_Ytr2H.js.map +1 -0
  158. package/dist/chunks/{segmentTooltip-CStYHKzd.js → segmentTooltip-CGxCOWNz.js} +2 -2
  159. package/dist/chunks/{segmentTooltip-CStYHKzd.js.map → segmentTooltip-CGxCOWNz.js.map} +1 -1
  160. package/dist/chunks/segmentedControl.module-BzGXUL5G.js +11 -0
  161. package/dist/chunks/segmentedControl.module-BzGXUL5G.js.map +1 -0
  162. package/dist/chunks/useReorderDragList-CStYKjHl.js +133 -0
  163. package/dist/chunks/useReorderDragList-CStYKjHl.js.map +1 -0
  164. package/dist/chunks/useRovingTabIndex-D7u22Ia_.js +91 -0
  165. package/dist/chunks/useRovingTabIndex-D7u22Ia_.js.map +1 -0
  166. package/dist/components/ActionBar/ActionBar.d.ts.map +1 -1
  167. package/dist/components/ActionBar/index.js +1 -1
  168. package/dist/components/Badge/bases/ChamferedRect.d.ts.map +1 -1
  169. package/dist/components/Badge/bases/Powerline.d.ts.map +1 -1
  170. package/dist/components/Badge/bases/edgeProfiles.d.ts +31 -4
  171. package/dist/components/Badge/bases/edgeProfiles.d.ts.map +1 -1
  172. package/dist/components/Badge/index.d.ts +1 -0
  173. package/dist/components/Badge/index.d.ts.map +1 -1
  174. package/dist/components/Badge/index.js +3 -2
  175. package/dist/components/Badge/statusIcons.d.ts +5 -0
  176. package/dist/components/Badge/statusIcons.d.ts.map +1 -0
  177. package/dist/components/BandEditor/BandEditor.d.ts +17 -7
  178. package/dist/components/BandEditor/BandEditor.d.ts.map +1 -1
  179. package/dist/components/BandEditor/bands.d.ts +5 -2
  180. package/dist/components/BandEditor/bands.d.ts.map +1 -1
  181. package/dist/components/BandEditor/index.js +1 -1
  182. package/dist/components/Button/index.js +1 -1
  183. package/dist/components/ButtonBar/ButtonBar.d.ts.map +1 -1
  184. package/dist/components/ButtonBar/index.js +1 -1
  185. package/dist/components/Callout/Callout.d.ts +2 -2
  186. package/dist/components/Callout/Callout.d.ts.map +1 -1
  187. package/dist/components/Callout/index.js +1 -1
  188. package/dist/components/Checkbox/Checkbox.d.ts +28 -13
  189. package/dist/components/Checkbox/Checkbox.d.ts.map +1 -1
  190. package/dist/components/Checkbox/index.js +1 -1
  191. package/dist/components/CloseButton/CloseButton.d.ts +21 -0
  192. package/dist/components/CloseButton/CloseButton.d.ts.map +1 -0
  193. package/dist/components/CloseButton/index.d.ts +3 -0
  194. package/dist/components/CloseButton/index.d.ts.map +1 -0
  195. package/dist/components/CloseButton/index.js +2 -0
  196. package/dist/components/ColorField/ColorField.d.ts +5 -1
  197. package/dist/components/ColorField/ColorField.d.ts.map +1 -1
  198. package/dist/components/ColorField/OpacityRange.d.ts +18 -0
  199. package/dist/components/ColorField/OpacityRange.d.ts.map +1 -0
  200. package/dist/components/ColorField/index.js +1 -1
  201. package/dist/components/ColorModeControl/index.js +1 -1
  202. package/dist/components/ComboBox/ComboBox.d.ts +7 -0
  203. package/dist/components/ComboBox/ComboBox.d.ts.map +1 -1
  204. package/dist/components/ComboBox/index.js +1 -1
  205. package/dist/components/CurveEditor/CurveEditor.d.ts.map +1 -1
  206. package/dist/components/CurveEditor/LayeredCurveEditor.d.ts.map +1 -1
  207. package/dist/components/CurveEditor/index.js +2 -2
  208. package/dist/components/DataGrid/index.js +1 -1
  209. package/dist/components/DetailList/DetailList.d.ts +31 -5
  210. package/dist/components/DetailList/DetailList.d.ts.map +1 -1
  211. package/dist/components/DetailList/index.d.ts +1 -1
  212. package/dist/components/DetailList/index.d.ts.map +1 -1
  213. package/dist/components/DetailList/index.js +1 -1
  214. package/dist/components/DetentSlider/index.js +1 -1
  215. package/dist/components/Dialog/Dialog.d.ts.map +1 -1
  216. package/dist/components/Dialog/index.js +1 -1
  217. package/dist/components/Disclosure/Disclosure.d.ts +1 -1
  218. package/dist/components/Disclosure/index.js +1 -1
  219. package/dist/components/DragGhost/index.js +1 -1
  220. package/dist/components/{DragHandleGlyph/DragHandleGlyph.d.ts → DragGrip/DragGrip.d.ts} +4 -4
  221. package/dist/components/DragGrip/DragGrip.d.ts.map +1 -0
  222. package/dist/components/DragGrip/index.d.ts +3 -0
  223. package/dist/components/DragGrip/index.d.ts.map +1 -0
  224. package/dist/components/DragGrip/index.js +2 -0
  225. package/dist/components/FallthroughDiagram/FallthroughDiagram.d.ts +14 -0
  226. package/dist/components/FallthroughDiagram/FallthroughDiagram.d.ts.map +1 -0
  227. package/dist/components/FallthroughDiagram/fixtures.d.ts +17 -0
  228. package/dist/components/FallthroughDiagram/fixtures.d.ts.map +1 -0
  229. package/dist/components/FallthroughDiagram/index.d.ts +3 -0
  230. package/dist/components/FallthroughDiagram/index.d.ts.map +1 -0
  231. package/dist/components/FallthroughDiagram/index.js +2 -0
  232. package/dist/components/Field/index.js +1 -1
  233. package/dist/components/FillStrokeSwatch/FillStrokeSwatch.d.ts.map +1 -1
  234. package/dist/components/FillStrokeSwatch/index.js +1 -1
  235. package/dist/components/FontFamilySelect/FontFamilySelect.d.ts +20 -0
  236. package/dist/components/FontFamilySelect/FontFamilySelect.d.ts.map +1 -1
  237. package/dist/components/FontFamilySelect/index.js +1 -1
  238. package/dist/components/FontWeightSelect/FontWeightSelect.d.ts +26 -0
  239. package/dist/components/FontWeightSelect/FontWeightSelect.d.ts.map +1 -0
  240. package/dist/components/FontWeightSelect/index.d.ts +3 -0
  241. package/dist/components/FontWeightSelect/index.d.ts.map +1 -0
  242. package/dist/components/FontWeightSelect/index.js +2 -0
  243. package/dist/components/GestureRoute/GestureRoute.d.ts +19 -0
  244. package/dist/components/GestureRoute/GestureRoute.d.ts.map +1 -0
  245. package/dist/components/GestureRoute/index.d.ts +3 -0
  246. package/dist/components/GestureRoute/index.d.ts.map +1 -0
  247. package/dist/components/GestureRoute/index.js +2 -0
  248. package/dist/components/GradientEditor/GradientEditor.d.ts +22 -8
  249. package/dist/components/GradientEditor/GradientEditor.d.ts.map +1 -1
  250. package/dist/components/GradientEditor/GradientHandles.d.ts +1 -8
  251. package/dist/components/GradientEditor/GradientHandles.d.ts.map +1 -1
  252. package/dist/components/GradientEditor/SceneGradientHandles.d.ts +7 -5
  253. package/dist/components/GradientEditor/SceneGradientHandles.d.ts.map +1 -1
  254. package/dist/components/GradientEditor/handleOverlay.d.ts +41 -0
  255. package/dist/components/GradientEditor/handleOverlay.d.ts.map +1 -0
  256. package/dist/components/GradientEditor/index.js +1 -1
  257. package/dist/components/InlineRange/index.js +1 -1
  258. package/dist/components/Input/Input.d.ts +1 -1
  259. package/dist/components/Input/Input.d.ts.map +1 -1
  260. package/dist/components/Input/index.js +1 -1
  261. package/dist/components/ItemList/ItemList.d.ts +32 -31
  262. package/dist/components/ItemList/ItemList.d.ts.map +1 -1
  263. package/dist/components/ItemList/index.js +1 -1
  264. package/dist/components/Jog/index.js +1 -1
  265. package/dist/components/Keycaps/Keycaps.d.ts +11 -5
  266. package/dist/components/Keycaps/Keycaps.d.ts.map +1 -1
  267. package/dist/components/Keycaps/index.d.ts +1 -1
  268. package/dist/components/Keycaps/index.d.ts.map +1 -1
  269. package/dist/components/Keycaps/index.js +1 -1
  270. package/dist/components/LayerList/LayerList.d.ts +1 -1
  271. package/dist/components/LayerList/LayerList.d.ts.map +1 -1
  272. package/dist/components/LayerList/index.js +1 -1
  273. package/dist/components/ListEditor/ListEditor.d.ts.map +1 -1
  274. package/dist/components/ListEditor/index.js +1 -1
  275. package/dist/components/MenuButton/MenuButton.d.ts.map +1 -1
  276. package/dist/components/MenuButton/index.js +1 -1
  277. package/dist/components/MeshEditor/MeshEditor.d.ts +4 -3
  278. package/dist/components/MeshEditor/MeshEditor.d.ts.map +1 -1
  279. package/dist/components/MeshEditor/MeshHandles.d.ts +38 -0
  280. package/dist/components/MeshEditor/MeshHandles.d.ts.map +1 -0
  281. package/dist/components/MeshEditor/index.d.ts +2 -0
  282. package/dist/components/MeshEditor/index.d.ts.map +1 -1
  283. package/dist/components/MeshEditor/index.js +2 -2
  284. package/dist/components/NumberField/NumberField.d.ts +1 -1
  285. package/dist/components/NumberField/NumberField.d.ts.map +1 -1
  286. package/dist/components/NumberField/UnitField.d.ts +20 -7
  287. package/dist/components/NumberField/UnitField.d.ts.map +1 -1
  288. package/dist/components/NumberField/index.js +1 -1
  289. package/dist/components/OptionsBar/OptionsBar.d.ts.map +1 -1
  290. package/dist/components/OptionsBar/index.js +1 -1
  291. package/dist/components/PaintField/PaintField.d.ts.map +1 -1
  292. package/dist/components/PaintField/index.js +1 -1
  293. package/dist/components/PaintInput/PaintInput.d.ts.map +1 -1
  294. package/dist/components/PaintInput/index.js +1 -1
  295. package/dist/components/PatternPicker/PatternPicker.d.ts +6 -5
  296. package/dist/components/PatternPicker/PatternPicker.d.ts.map +1 -1
  297. package/dist/components/PatternPicker/index.js +1 -1
  298. package/dist/components/Plot2D/index.js +1 -1
  299. package/dist/components/PointPlotter/index.js +1 -1
  300. package/dist/components/Powerline/index.d.ts +1 -1
  301. package/dist/components/Powerline/index.d.ts.map +1 -1
  302. package/dist/components/Powerline/index.js +2 -2
  303. package/dist/components/Prefs/PrefsForm.d.ts +8 -0
  304. package/dist/components/Prefs/PrefsForm.d.ts.map +1 -1
  305. package/dist/components/Prefs/PrefsRail.d.ts +3 -2
  306. package/dist/components/Prefs/PrefsRail.d.ts.map +1 -1
  307. package/dist/components/Prefs/PrefsRow.d.ts.map +1 -1
  308. package/dist/components/Prefs/index.d.ts +1 -1
  309. package/dist/components/Prefs/index.d.ts.map +1 -1
  310. package/dist/components/Prefs/index.js +2 -2
  311. package/dist/components/Prefs/prefField.d.ts +13 -0
  312. package/dist/components/Prefs/prefField.d.ts.map +1 -1
  313. package/dist/components/Prefs/schema.d.ts +2 -2
  314. package/dist/components/Prefs/schema.d.ts.map +1 -1
  315. package/dist/components/Properties/PropertyField.d.ts +35 -32
  316. package/dist/components/Properties/PropertyField.d.ts.map +1 -1
  317. package/dist/components/Properties/PropertyGroup.d.ts.map +1 -1
  318. package/dist/components/Properties/PropertyPanel.d.ts +1 -8
  319. package/dist/components/Properties/PropertyPanel.d.ts.map +1 -1
  320. package/dist/components/Properties/index.d.ts +1 -1
  321. package/dist/components/Properties/index.d.ts.map +1 -1
  322. package/dist/components/Properties/index.js +3 -3
  323. package/dist/components/RadioGroup/index.js +1 -1
  324. package/dist/components/RangeSlider/index.js +1 -1
  325. package/dist/components/RecentColors/RecentColorsProvider.d.ts +24 -0
  326. package/dist/components/RecentColors/RecentColorsProvider.d.ts.map +1 -0
  327. package/dist/components/RecentColors/index.d.ts +5 -0
  328. package/dist/components/RecentColors/index.d.ts.map +1 -0
  329. package/dist/components/RecentColors/index.js +2 -0
  330. package/dist/components/RecentColors/recentColors.d.ts +39 -0
  331. package/dist/components/RecentColors/recentColors.d.ts.map +1 -0
  332. package/dist/components/ResizeHandle/ResizeHandle.d.ts.map +1 -1
  333. package/dist/components/ResizeHandle/index.js +1 -1
  334. package/dist/components/Select/Select.d.ts +6 -2
  335. package/dist/components/Select/Select.d.ts.map +1 -1
  336. package/dist/components/Select/index.js +1 -1
  337. package/dist/components/SelectionPanel/SelectionPanel.d.ts.map +1 -1
  338. package/dist/components/SelectionPanel/index.js +2 -2
  339. package/dist/components/SelectionPanel/renderLeaf.d.ts +17 -0
  340. package/dist/components/SelectionPanel/renderLeaf.d.ts.map +1 -1
  341. package/dist/components/SidebarPanel/SidebarPanel.d.ts +1 -1
  342. package/dist/components/SidebarPanel/SidebarPanel.d.ts.map +1 -1
  343. package/dist/components/SidebarPanel/index.js +1 -1
  344. package/dist/components/Slider/Slider.d.ts +19 -2
  345. package/dist/components/Slider/Slider.d.ts.map +1 -1
  346. package/dist/components/Slider/index.js +1 -1
  347. package/dist/components/StatusBar/index.js +1 -1
  348. package/dist/components/SwatchGrid/SwatchGrid.d.ts.map +1 -1
  349. package/dist/components/SwatchGrid/index.js +1 -1
  350. package/dist/components/SwatchStrip/SwatchStrip.d.ts +44 -0
  351. package/dist/components/SwatchStrip/SwatchStrip.d.ts.map +1 -0
  352. package/dist/components/SwatchStrip/index.d.ts +5 -0
  353. package/dist/components/SwatchStrip/index.d.ts.map +1 -0
  354. package/dist/components/SwatchStrip/index.js +2 -0
  355. package/dist/components/SwatchStrip/palettes.d.ts +21 -0
  356. package/dist/components/SwatchStrip/palettes.d.ts.map +1 -0
  357. package/dist/components/ThemeSwitcher/ThemeSwitcher.d.ts +38 -0
  358. package/dist/components/ThemeSwitcher/ThemeSwitcher.d.ts.map +1 -0
  359. package/dist/components/ThemeSwitcher/index.d.ts +3 -0
  360. package/dist/components/ThemeSwitcher/index.d.ts.map +1 -0
  361. package/dist/components/ThemeSwitcher/index.js +2 -0
  362. package/dist/components/Timeline/AnimatedTimeline.d.ts +1 -0
  363. package/dist/components/Timeline/AnimatedTimeline.d.ts.map +1 -1
  364. package/dist/components/Timeline/EasingPicker.d.ts +3 -0
  365. package/dist/components/Timeline/EasingPicker.d.ts.map +1 -1
  366. package/dist/components/Timeline/LaneGraph.d.ts +1 -1
  367. package/dist/components/Timeline/LaneGraph.d.ts.map +1 -1
  368. package/dist/components/Timeline/Timeline.d.ts +10 -1
  369. package/dist/components/Timeline/Timeline.d.ts.map +1 -1
  370. package/dist/components/Timeline/Transport.d.ts +6 -0
  371. package/dist/components/Timeline/Transport.d.ts.map +1 -1
  372. package/dist/components/Timeline/index.js +1 -1
  373. package/dist/components/Timeline/keys.d.ts +1 -0
  374. package/dist/components/Timeline/keys.d.ts.map +1 -1
  375. package/dist/components/Toast/Toast.d.ts +12 -3
  376. package/dist/components/Toast/Toast.d.ts.map +1 -1
  377. package/dist/components/Toast/index.js +1 -1
  378. package/dist/components/ToggleBar/ToggleBar.d.ts.map +1 -1
  379. package/dist/components/ToggleBar/index.js +1 -1
  380. package/dist/components/TokenPanel/index.js +1 -1
  381. package/dist/components/TokenPanel/tokenTypes.d.ts +1 -0
  382. package/dist/components/TokenPanel/tokenTypes.d.ts.map +1 -1
  383. package/dist/components/ToolButton/ToolButton.d.ts +1 -10
  384. package/dist/components/ToolButton/ToolButton.d.ts.map +1 -1
  385. package/dist/components/ToolButton/index.js +1 -1
  386. package/dist/components/ToolOptionsBar/index.js +1 -1
  387. package/dist/components/ToolPalette/ToolPalette.d.ts +2 -1
  388. package/dist/components/ToolPalette/ToolPalette.d.ts.map +1 -1
  389. package/dist/components/ToolPalette/formatShortcut.d.ts +2 -0
  390. package/dist/components/ToolPalette/formatShortcut.d.ts.map +1 -1
  391. package/dist/components/ToolPalette/index.js +1 -1
  392. package/dist/components/Tooltip/index.js +1 -1
  393. package/dist/components/Tree/Tree.d.ts +27 -26
  394. package/dist/components/Tree/Tree.d.ts.map +1 -1
  395. package/dist/components/Tree/index.js +1 -1
  396. package/dist/components/spin.d.ts +16 -0
  397. package/dist/components/spin.d.ts.map +1 -0
  398. package/dist/components/stanceSurfaces.d.ts.map +1 -1
  399. package/dist/icons/index.d.ts +51 -2
  400. package/dist/icons/index.d.ts.map +1 -1
  401. package/dist/icons/paths.d.ts +12 -0
  402. package/dist/icons/paths.d.ts.map +1 -1
  403. package/dist/index.d.ts +9 -3
  404. package/dist/index.d.ts.map +1 -1
  405. package/dist/index.js +98 -111
  406. package/dist/index.js.map +1 -1
  407. package/dist/overlays/portalHost.d.ts +6 -0
  408. package/dist/overlays/portalHost.d.ts.map +1 -1
  409. package/dist/paintGradientTrack.d.ts +5 -2
  410. package/dist/paintGradientTrack.d.ts.map +1 -1
  411. package/dist/style.css +1 -1
  412. package/dist/useAsyncOptions.d.ts.map +1 -1
  413. package/dist/useReorderDragList.d.ts +1 -1
  414. package/dist/useReorderDragList.d.ts.map +1 -1
  415. package/dist/useRovingTabIndex.d.ts +40 -39
  416. package/dist/useRovingTabIndex.d.ts.map +1 -1
  417. package/package.json +9 -8
  418. package/dist/chunks/ActionBar-DCq16yFA.js +0 -57
  419. package/dist/chunks/ActionBar-DCq16yFA.js.map +0 -1
  420. package/dist/chunks/Badge-CyAIZSDo.js.map +0 -1
  421. package/dist/chunks/BandEditor-Dhm_Xrlr.js +0 -248
  422. package/dist/chunks/BandEditor-Dhm_Xrlr.js.map +0 -1
  423. package/dist/chunks/Callout-yEn9iPlh.js +0 -119
  424. package/dist/chunks/Callout-yEn9iPlh.js.map +0 -1
  425. package/dist/chunks/Checkbox-DHXTUHO9.js +0 -47
  426. package/dist/chunks/Checkbox-DHXTUHO9.js.map +0 -1
  427. package/dist/chunks/ColorField-BcMcW8Sa.js +0 -60
  428. package/dist/chunks/ColorField-BcMcW8Sa.js.map +0 -1
  429. package/dist/chunks/ComboBox-DpT8lc3p.js +0 -138
  430. package/dist/chunks/ComboBox-DpT8lc3p.js.map +0 -1
  431. package/dist/chunks/CurveEditor-BDJXjEvK.js.map +0 -1
  432. package/dist/chunks/DataGrid-D-dZj1BD.js.map +0 -1
  433. package/dist/chunks/DetailList-BMER1LUZ.js +0 -43
  434. package/dist/chunks/DetailList-BMER1LUZ.js.map +0 -1
  435. package/dist/chunks/Dialog-BWyNMgpf.js +0 -66
  436. package/dist/chunks/Dialog-BWyNMgpf.js.map +0 -1
  437. package/dist/chunks/Disclosure-0G0uh2fa.js.map +0 -1
  438. package/dist/chunks/DragHandleGlyph-Dr7Fgo0I.js.map +0 -1
  439. package/dist/chunks/Field--onYxXTF.js +0 -32
  440. package/dist/chunks/Field--onYxXTF.js.map +0 -1
  441. package/dist/chunks/FillStrokeSwatch-DNb0KXPk.js +0 -111
  442. package/dist/chunks/FillStrokeSwatch-DNb0KXPk.js.map +0 -1
  443. package/dist/chunks/FontFamilySelect-DXlMKWfK.js.map +0 -1
  444. package/dist/chunks/GradientEditor-B3a-MsVJ.js +0 -335
  445. package/dist/chunks/GradientEditor-B3a-MsVJ.js.map +0 -1
  446. package/dist/chunks/Icon-Cgzy8VgC.js.map +0 -1
  447. package/dist/chunks/InlineRange-eOj6JpJl.js.map +0 -1
  448. package/dist/chunks/Input-CHmkfYaD.js.map +0 -1
  449. package/dist/chunks/ItemList-Cm-HUWCi.js.map +0 -1
  450. package/dist/chunks/Jog-DESxZ44P.js.map +0 -1
  451. package/dist/chunks/Keycaps-C0H_v2gO.js.map +0 -1
  452. package/dist/chunks/LayerList-nz-QYvTF.js.map +0 -1
  453. package/dist/chunks/ListEditor-BQ6AV3Ac.js +0 -74
  454. package/dist/chunks/ListEditor-BQ6AV3Ac.js.map +0 -1
  455. package/dist/chunks/MenuButton-DtaGenKf.js +0 -70
  456. package/dist/chunks/MenuButton-DtaGenKf.js.map +0 -1
  457. package/dist/chunks/MeshEditor-qqGc6hlD.js +0 -87
  458. package/dist/chunks/MeshEditor-qqGc6hlD.js.map +0 -1
  459. package/dist/chunks/NumberField-CwJOMmQR.js +0 -117
  460. package/dist/chunks/NumberField-CwJOMmQR.js.map +0 -1
  461. package/dist/chunks/PaintField-DaJukRc6.js +0 -62
  462. package/dist/chunks/PaintField-DaJukRc6.js.map +0 -1
  463. package/dist/chunks/PaintInput-Byhna3H-.js +0 -131
  464. package/dist/chunks/PaintInput-Byhna3H-.js.map +0 -1
  465. package/dist/chunks/PatternPicker-B-cUt-JT.js +0 -93
  466. package/dist/chunks/PatternPicker-B-cUt-JT.js.map +0 -1
  467. package/dist/chunks/Plot2D-CTXHkL5p.js.map +0 -1
  468. package/dist/chunks/Prefs-DpqFKiwY.js.map +0 -1
  469. package/dist/chunks/Properties-D_KzDN9K.js.map +0 -1
  470. package/dist/chunks/PropertyField-DGCecAnV.js +0 -758
  471. package/dist/chunks/PropertyField-DGCecAnV.js.map +0 -1
  472. package/dist/chunks/RangeSlider-BKRRTPTZ.js.map +0 -1
  473. package/dist/chunks/ResizeHandle-BKT0XYpx.js +0 -79
  474. package/dist/chunks/ResizeHandle-BKT0XYpx.js.map +0 -1
  475. package/dist/chunks/Select-CzyfaXzp.js +0 -225
  476. package/dist/chunks/Select-CzyfaXzp.js.map +0 -1
  477. package/dist/chunks/SelectionPanel-BgUM1h03.js +0 -103
  478. package/dist/chunks/SelectionPanel-BgUM1h03.js.map +0 -1
  479. package/dist/chunks/SidebarPanel-aoIqxbtq.js +0 -55
  480. package/dist/chunks/SidebarPanel-aoIqxbtq.js.map +0 -1
  481. package/dist/chunks/Slider-CFwQYQ10.js +0 -383
  482. package/dist/chunks/Slider-CFwQYQ10.js.map +0 -1
  483. package/dist/chunks/StatusBar-DzoPDY4k.js.map +0 -1
  484. package/dist/chunks/SwatchGrid-BARC3rnF.js +0 -73
  485. package/dist/chunks/SwatchGrid-BARC3rnF.js.map +0 -1
  486. package/dist/chunks/Timeline--58F7MED.js.map +0 -1
  487. package/dist/chunks/Toast-DNBb-24H.js +0 -128
  488. package/dist/chunks/Toast-DNBb-24H.js.map +0 -1
  489. package/dist/chunks/ToggleBar-DTjGeS0Q.js.map +0 -1
  490. package/dist/chunks/TokenPanel-CMq7uydV.js.map +0 -1
  491. package/dist/chunks/ToolButton-CR4sQlxF.js.map +0 -1
  492. package/dist/chunks/ToolOptionsBar-CtzTlaN2.js.map +0 -1
  493. package/dist/chunks/ToolPalette-CKG9qY6P.js.map +0 -1
  494. package/dist/chunks/Tree-DVOtc9R5.js.map +0 -1
  495. package/dist/chunks/createKeyframeLayer-Czj6Y235.js.map +0 -1
  496. package/dist/chunks/icons-Dk8SRS8g.js.map +0 -1
  497. package/dist/chunks/model-Du7Lta4C.js +0 -360
  498. package/dist/chunks/model-Du7Lta4C.js.map +0 -1
  499. package/dist/chunks/number-D3NEx_8r.js +0 -89
  500. package/dist/chunks/number-D3NEx_8r.js.map +0 -1
  501. package/dist/chunks/portalHost-yTOVuCej.js.map +0 -1
  502. package/dist/chunks/prefField-Dnl7nmjQ.js +0 -197
  503. package/dist/chunks/prefField-Dnl7nmjQ.js.map +0 -1
  504. package/dist/chunks/segmentedControl.module-Bv7DEg8f.js +0 -11
  505. package/dist/chunks/segmentedControl.module-Bv7DEg8f.js.map +0 -1
  506. package/dist/chunks/useReorderDragList-B_-5L5Gu.js +0 -131
  507. package/dist/chunks/useReorderDragList-B_-5L5Gu.js.map +0 -1
  508. package/dist/chunks/useRovingTabIndex-Bp_hYm_h.js +0 -65
  509. package/dist/chunks/useRovingTabIndex-Bp_hYm_h.js.map +0 -1
  510. package/dist/components/DragHandleGlyph/DragHandleGlyph.d.ts.map +0 -1
  511. package/dist/components/DragHandleGlyph/index.d.ts +0 -3
  512. package/dist/components/DragHandleGlyph/index.d.ts.map +0 -1
  513. package/dist/components/DragHandleGlyph/index.js +0 -2
  514. package/dist/format/number.d.ts +0 -56
  515. package/dist/format/number.d.ts.map +0 -1
  516. package/dist/icons/ShapeKindIcon.d.ts +0 -10
  517. package/dist/icons/ShapeKindIcon.d.ts.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"model-Du7Lta4C.js","names":["s","Fragment","ICON_PATHS","PropertyControl","ToggleBar","prefFieldProps","Fragment$1","SelectionPanel_module_default","isFlagCell","cell","leaf","renderers","renderCells","out","i","cells","content","j","run","c","FlagBar","on","p","Icon","now","next","renderBuiltin","ctx","pref","ObjectLeaf","field","framed","ariaLabel","settledOnly","selectionKey","nested","held","allGrouped","child","rowsOf","isRow","v","pending","flush","prev","key","block","children","labeled","inner","indent","childPath","childCtx","base","_dropped","rest","custom","rendered","entry","rows","classifyKind","node","routing","isGroup","n","flatten","sections","untitled","collect","group","into","schema","leaves","pairRows","item","pair","effectiveSections","uniq","kinds","byName","entries","schemas","k","s","first","flatFirst","leafKey","l","restKeys","r","keep","set","section","row","nodeValueAt","segments","path","head","cursor","setAtPath","root","value","aggregateValue","nodes","MIXED","kindBreakdown","counts"],"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.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/* The slider's track; the row only says how it shares the space. */\n.slider {\n flex: 1;\n}\n","/**\n * A selection's leaves as cells: one `ToolPrefLeaf` and its aggregated value\n * in, one rendered cell out, plus the run logic that turns a row of paired\n * toggles into a single segmented bar and the rows of an object leaf.\n *\n * The control itself is `PropertyControl`'s, through `prefFieldProps`; what\n * is decided here is how a selection surface sizes and composes it.\n * `ToolOptionsBar` renders a tool's options through the same functions.\n */\nimport { Fragment, type ReactNode } from 'react';\nimport type {\n ToolPrefBoolean,\n ToolPrefGroup,\n ToolPrefLeaf,\n ToolPrefObject,\n} from '@weasel-js/core';\nimport { prefFieldProps } from '../Prefs/prefField';\nimport { PropertyControl } from '../Properties/PropertyField';\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 * The ids of the nodes the values were read from, joined. It changes exactly\n * when the selection does, so a control holding scratch that belongs to one\n * selection can key on it and be remounted rather than carry it to the next.\n * Absent where the values come from no selection, as in a tool options bar.\n */\n selectionKey?: string;\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 === '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 const field = prefFieldProps(pref, {\n value,\n mixed,\n unset,\n siblings: ctx.siblings,\n setValue,\n // The substitution probe runs at the node's own weight and style, so the\n // picker names the variant that will actually paint. A mixed selection\n // has no single one; the probe falls back to 400/normal there.\n fontVariant: {\n weight: ctx.valueAt('data.style.fontWeight').value,\n style: ctx.valueAt('data.style.fontStyle').value,\n },\n });\n if (field === null) {\n return <span className={s.unrenderable}>({pref.kind}: no renderer)</span>;\n }\n switch (field.kind) {\n case 'boolean':\n // A panel's flag is a switch unless it asks otherwise.\n return (\n <PropertyControl\n {...field}\n {...framed(ariaLabel)}\n control={field.control ?? 'switch'}\n className={field.control === 'toggle' ? s.flagToggle : undefined}\n />\n );\n case 'number':\n return (\n <PropertyControl\n {...field}\n {...framed(ariaLabel)}\n className={field.control === 'slider' ? s.slider : s.number}\n steppers={false}\n />\n );\n case 'string':\n // Settled values only: a live write per keystroke would be one undo\n // step per character.\n return <PropertyControl {...field} {...framed(ariaLabel)} onInput={settledOnly} />;\n case 'enum':\n return (\n <PropertyControl\n {...field}\n {...framed(ariaLabel)}\n className={field.control === 'toggle' ? s.toggle : field.control === 'radio' ? undefined : s.select}\n />\n );\n case 'font-family':\n return <PropertyControl {...field} {...framed(ariaLabel)} className={s.select} />;\n case 'paint':\n return (\n <PropertyControl\n {...field}\n {...framed(ariaLabel)}\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 control=\"inline\"\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.\n allowNone={!nested}\n />\n );\n default:\n return <PropertyControl {...field} {...framed(ariaLabel)} />;\n }\n}\n\nconst framed = (name: string) => ({ chrome: 'framed' as const, name });\n\nconst settledOnly = (): void => {};\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 selectionKey: ctx.selectionKey,\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","// 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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AC+GA,SAAgBQ,EAAW,GAAgB,GAAuD;CAChG,IAAM,EAAE,YAASC;CACjB,OACEC,EAAK,SAAS,aACbA,EAAyB,YAAY,YACtCA,EAAK,SAAS,KAAA,KACdC,IAAYF,EAAK,IAAI,UAAU,KAAA,KAC/BE,IAAYD,EAAK,UAAU,KAAA;AAE/B;AAOA,SAAgBE,EACd,GACA,GACgB;CAChB,IAAMC,IAAsB,CAAC;CAC7B,KAAK,IAAIC,IAAI,GAAGA,IAAIC,EAAM,SAAU;EAClC,IAAMN,IAAOM,EAAMD;EACnB,IAAI,CAACN,EAAWC,GAAME,CAAS,GAAG;GAChC,IAAMK,IAAUP,EAAK,OAAO;GAI5B,AAHIO,KAAW,QACbH,EAAI,KAAK;IAAE,KAAKJ,EAAK;IAAK,MAAMA,EAAK;IAAM,OAAOA,EAAK,KAAK,UAAU;IAAM;GAAQ,CAAC,GAEvF,KAAK;GACL;EACF;EACA,IAAIQ,IAAIH,IAAI;EACZ,OACEG,IAAIF,EAAM,UACVP,EAAWO,EAAME,IAAIN,CAAS,KAC9BI,EAAME,EAAE,CAAC,KAAK,SAASR,EAAK,KAAK,OAEjC,KA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QwC;CACxB,IAAIxC,EAAK,WAAW,GAClB,OAAO,MAAM,QAAQ6C,CAAI,IACrB,OAAO,OAAO,CAAC,GAAGA,CAAI,GAAG,GAAGH,IAAOI,EAAM,CAAC,IAC1C;EAAE,GAAGD;GAAOH,IAAOI;CAAM;CAE/B,IAAM/D,IAAS8D,EAAiCH,IAM1C9D,IAASgE,EALE,MAAM,QAAQ7D,CAAK,IAChC,CAAC,GAAGA,CAAK,IACQ,OAAOA,KAAU,YAAlCA,IACE,EAAE,GAAGA,EAAM,IACX,CAAC,GAC4BiB,GAAM8C,CAAK;CAC9C,OAAO,MAAM,QAAQD,CAAI,IACrB,OAAO,OAAO,CAAC,GAAGA,CAAI,GAAG,GAAGH,IAAO9D,EAAO,CAAC,IAC3C;EAAE,GAAGiE;GAAOH,IAAO9D;CAAO;AAChC;AAGA,SAAgBmE,EACd,GACA,GACiB;CACjB,IAAID,GACAjB,IAAQ;CACZ,KAAK,IAAMvB,KAAQ0C,GAAO;EACxB,IAAM9D,IAAIqD,EAAYjC,GAAMmC,CAAI;EAChC,IAAIZ,GAEF,AADA,IAAQ3C,GACR,IAAQ;OACH,IAAI,CAAC,OAAO,GAAGA,GAAG4D,CAAK,GAC5B,OAAOG;CAEX;CACA,OAAOH;AACT;AAGA,SAAgBI,EAAc,GAAkC;CAC9D,IAAMC,oBAAS,IAAI,IAAoB;CACvC,KAAK,IAAMxB,KAAKJ,GAAO,EAAO,IAAII,IAAIwB,EAAO,IAAIxB,CAAC,KAAK,KAAK,CAAC;CAC7D,OAAO,CAAC,GAAGwB,EAAO,QAAQ,CAAC,CAAC,CACzB,KAAK,CAACxB,GAAGlB,OAAQA,IAAI,IAAI,GAAGkB,EAAE,IAAIlB,MAAMkB,CAAE,CAAC,CAC3C,KAAK,KAAK;AACf"}
@@ -1,89 +0,0 @@
1
- //#region src/format/number.ts
2
- var e = "−";
3
- function t(e, t) {
4
- return (Number.isFinite(e) ? e.toLocaleString(void 0, t) : String(e)).replace(/^-/, "−");
5
- }
6
- function n(e) {
7
- return Number(e.replace("−", "-"));
8
- }
9
- var r = {
10
- k: 3,
11
- m: 6,
12
- b: 9,
13
- t: 12
14
- };
15
- function i(e, n = 0) {
16
- if (!Number.isFinite(e)) return t(e);
17
- let r = Math.abs(e) < 1e3 ? {
18
- useGrouping: !1,
19
- minimumFractionDigits: n,
20
- maximumFractionDigits: n
21
- } : {
22
- notation: "compact",
23
- minimumSignificantDigits: 3,
24
- maximumSignificantDigits: 3
25
- };
26
- return e.toLocaleString("en-US", r).replace(/^-/, "−");
27
- }
28
- function a(e, t) {
29
- if (t) {
30
- let n = e.trim(), r = u(n, t);
31
- if (r !== void 0) {
32
- let e = c(n, t);
33
- if (e !== void 0 && e.length > 1) return l(e, n, t);
34
- let { factor: i, offset: u } = s(t[r]);
35
- return o(a(n.slice(0, -r.length)), i) + u;
36
- }
37
- }
38
- let n = e.trim().replace("−", "-"), i = r[n.slice(-1).toLowerCase()];
39
- return i !== void 0 && (n = n.slice(0, -1).trimEnd()), /^[-+]?\d{1,3}(,\d{3})+(\.\d*)?$/.test(n) && (n = n.replace(/,/g, "")), /\d/.test(n) ? Number(i === void 0 ? n : `${n}e${i}`) : NaN;
40
- }
41
- function o(e, t) {
42
- return t < 1 ? e / (1 / t) : e * t;
43
- }
44
- function s(e) {
45
- return typeof e == "number" ? {
46
- factor: e,
47
- offset: 0
48
- } : {
49
- factor: e.factor,
50
- offset: e.offset ?? 0
51
- };
52
- }
53
- function c(e, t) {
54
- let n = [], r = e.trimEnd();
55
- for (; r !== "";) {
56
- let e = u(r, t);
57
- if (e === void 0) return;
58
- n.push(e);
59
- let i = r.slice(0, -e.length), a = /(\d+(?:\.\d+)?|\.\d+)\s*$/.exec(i);
60
- if (!a) return;
61
- r = i.slice(0, a.index).trimEnd(), (r === "-" || r === "+" || r === "−") && (r = "");
62
- }
63
- return n.length === 0 ? void 0 : n.reverse();
64
- }
65
- function l(e, t, n) {
66
- let r = t.match(/\d+(?:\.\d+)?|\.\d+/g);
67
- if (!r || r.length !== e.length) return NaN;
68
- let i = /^\s*[-\u2212]/.test(t) ? -1 : 1, a = 0;
69
- for (let [t, i] of e.entries()) {
70
- let { factor: e, offset: c } = s(n[i]);
71
- if (c !== 0) return NaN;
72
- a += o(Number(r[t]), e);
73
- }
74
- return i * a;
75
- }
76
- function u(e, t) {
77
- let n = Object.keys(t).filter((e) => e !== "").sort((e, t) => t.length - e.length), r = e.toLowerCase();
78
- return n.find((t) => e.endsWith(t)) ?? n.find((e) => r.endsWith(e.toLowerCase()));
79
- }
80
- function d(e) {
81
- return String(e).replace(/^-/, "−");
82
- }
83
- function f(e) {
84
- return Number.isFinite(e) ? e <= 2 ? `${d(Math.round(e * 100))}%` : e >= 100 ? `${Math.round(e).toLocaleString("en-US")}x` : `${d(Math.round(e * 10) / 10)}x` : String(e);
85
- }
86
- //#endregion
87
- export { a, f as i, i as n, n as o, t as r, e as t };
88
-
89
- //# sourceMappingURL=number-D3NEx_8r.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"number-D3NEx_8r.js","names":["MINUS_SIGN","formatNumber","value","options","parseSignedNumber","text","EXPONENTS","formatCompact","decimals","parseNumber","units","trimmed","name","unitSuffixOf","terms","compoundTermsOf","compoundValue","scaleOf","scaled","factor","offset","t","exponent","n","entry","names","rest","before","m","digits","sign","total","i","b","a","lower","signedString","formatZoom","zoom"],"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 three significant figures with a magnitude\n * suffix (`40.0K`, `294K`, `2.00M`), so the readout holds one width whatever the\n * value. 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', minimumSignificantDigits: 3, maximumSignificantDigits: 3 };\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,IAAaA,IAAa;AAM1B,SAAgBC,EAAa,GAAe,GAA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;EACvC,IAAM,EAAE,WAAQ,cAAWR,EAAQP,EAAME,EAAM;EAC/C,IAAIQ,MAAW,GAAG,OAAO;EACzB,KAASF,EAAO,OAAOW,EAAOG,EAAE,GAAGb,CAAM;CAC3C;CACA,OAAOW,IAAOC;AAChB;AAGA,SAASlB,EAAa,GAAc,GAAgD;CAClF,IAAMY,IAAQ,OAAO,KAAKf,CAAK,CAAC,CAAC,QAAQ,MAAMa,MAAM,EAAE,CAAC,CAAC,MAAM,GAAG,MAAMU,EAAE,SAASC,EAAE,MAAM,GACrFC,IAAQ9B,EAAK,YAAY;CAC/B,OAAOoB,EAAM,MAAM,MAAMpB,EAAK,SAASkB,CAAC,CAAC,KAAKE,EAAM,MAAM,MAAMU,EAAM,SAASZ,EAAE,YAAY,CAAC,CAAC;AACjG;AAIA,SAASa,EAAa,GAAuB;CAC3C,OAAO,OAAOlC,CAAK,CAAC,CAAC,QAAQ,MAAA,GAAgB;AAC/C;AAQA,SAAgBmC,EAAW,GAAsB;CAI/C,OAHK,OAAO,SAASC,CAAI,IACrBA,KAAQ,IAAU,GAAGF,EAAa,KAAK,MAAME,IAAO,GAAG,CAAC,EAAE,KAC1DA,KAAQ,MAAY,GAAG,KAAK,MAAMA,CAAI,CAAC,CAAC,eAAe,OAAO,EAAE,KAC7D,GAAGF,EAAa,KAAK,MAAME,IAAO,EAAE,IAAI,EAAE,EAAE,KAHhB,OAAOA,CAAI;AAIhD"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"portalHost-yTOVuCej.js","names":["HOST_SELECTOR","nearestPortalHost","from","OverlayPortalContext","createContext","OverlayPortalProvider","container","useOverlayPortal","anchorEl","setAnchorEl","useState","fromProvider","useContext","resolved","explicit"],"sources":["../../src/overlays/portalHost.tsx"],"sourcesContent":["import { createContext, useContext, useState, type ReactElement, type ReactNode } from 'react';\n\n/**\n * Elements an overlay may portal into: anything a theme has been stamped on\n * (`applyTheme` / `<ThemeProvider>` write both attributes), plus anything\n * opting in with `data-wzl-portal-host`. The opt-in exists for a styling root\n * that sits *below* the themed element — labkit's `.lk-root` carries element\n * defaults the themed wrapper does not.\n */\nconst HOST_SELECTOR = '[data-wzl-portal-host],[data-wzl-theme],[data-wzl-mode]';\n\n/**\n * The nearest element `from` sits inside that can host a portalled overlay,\n * or `null` when there is none and the body is the only answer.\n */\nexport function nearestPortalHost(from: Element | null | undefined): HTMLElement | null {\n return (from?.closest(HOST_SELECTOR) as HTMLElement | null) ?? null;\n}\n\n/** `undefined` distinguishes \"no provider\" from a provider saying `null`. */\nconst OverlayPortalContext = createContext<Element | null | undefined>(undefined);\n\n/** Props for {@link OverlayPortalProvider}. */\nexport interface OverlayPortalProviderProps {\n /** Where overlays in this subtree portal. `null` means `document.body`. */\n container: Element | null;\n children: ReactNode;\n}\n\n/**\n * Sets the portal container for every weasel overlay rendered below it,\n * overriding the nearest-themed-ancestor default. An individual overlay's\n * own `portalContainer` prop still wins.\n */\nexport function OverlayPortalProvider({ container, children }: OverlayPortalProviderProps) {\n return (\n <OverlayPortalContext.Provider value={container}>{children}</OverlayPortalContext.Provider>\n );\n}\n\n/** The `portalContainer` prop every weasel overlay accepts. */\nexport interface OverlayPortalProps {\n /**\n * Where the overlay's portal mounts. Defaults to the nearest ancestor of\n * the overlay's own position that carries a weasel theme, so the overlay\n * resolves the same `--wzl-*` tokens as the control it belongs to. Pass\n * `null` for `document.body`.\n */\n portalContainer?: Element | null;\n}\n\n/** React Aria props minus the portal key a weasel overlay owns. */\nexport type WithoutPortalTarget<T> = Omit<T, 'UNSTABLE_portalContainer'>;\n\n/** Spread onto the React Aria overlay. The unstable key is spelled here and\n * nowhere else in the package, so an upstream rename lands in one file. */\nexport interface OverlayPortalTarget {\n UNSTABLE_portalContainer: Element | undefined;\n}\n\n/**\n * Resolves where an overlay should portal, and the anchor that answers it.\n *\n * The result goes to React Aria as `UNSTABLE_portalContainer`. Its documented\n * replacement, `UNSAFE_PortalProvider`, is not re-exported by\n * react-aria-components 1.18, and reaching past it to `react-aria` for the\n * provider risks a second copy of that package whose context the overlays\n * never read — a failure that shows up as an unthemed overlay, not an error.\n *\n * Render `anchor` at the component's own position in the tree — outside the\n * portal — and spread `portalProps` onto the React Aria overlay. The anchor\n * is what \"nearest themed ancestor\" is measured from; the first render has\n * none yet, so an overlay that mounts already open lands in its host on the\n * following render, before paint.\n */\nexport function useOverlayPortal(explicit?: Element | null): {\n anchor: ReactElement;\n portalProps: OverlayPortalTarget;\n} {\n const [anchorEl, setAnchorEl] = useState<HTMLElement | null>(null);\n const fromProvider = useContext(OverlayPortalContext);\n\n const resolved =\n explicit !== undefined\n ? explicit\n : fromProvider !== undefined\n ? fromProvider\n : nearestPortalHost(anchorEl);\n\n return {\n anchor: <span hidden ref={setAnchorEl} />,\n portalProps: { UNSTABLE_portalContainer: resolved ?? undefined },\n };\n}\n"],"mappings":";;;AASA,IAAMA,IAAgB;AAMtB,SAAgBC,EAAkB,GAAsD;CACtF,OAAQC,GAAM,QAAQF,CAAa,KAA4B;AACjE;AAGA,IAAMG,IAAuBC,EAA0C,KAAA,CAAS;AAchF,SAAgBC,EAAsB,EAAE,cAAW,eAAwC;CACzF,OACE,kBAACF,EAAqB,UAAtB;EAA+B,OAAOG;EAAY;CAAwC,CAAA;AAE9F;AAqCA,SAAgBC,EAAiB,GAG/B;CACA,IAAM,CAACC,GAAUC,KAAeC,EAA6B,IAAI,GAC3DC,IAAeC,EAAWT,CAAoB,GAE9CU,IACJC,MAAa,KAAA,IAETH,MAAiB,KAAA,IAEfV,EAAkBO,CAAQ,IAD1BG,IAFFG;CAKN,OAAO;EACL,QAAQ,kBAAC,QAAD;GAAM,QAAA;GAAO,KAAKL;EAAc,CAAA;EACxC,aAAa,EAAE,0BAA0BI,KAAY,KAAA,EAAU;CACjE;AACF"}
@@ -1,197 +0,0 @@
1
- import { a as e, t } from "./Icon-Cgzy8VgC.js";
2
- import { t as n } from "./paintValue-BpaGPjV3.js";
3
- import { isBuiltinToolPref as r } from "@weasel-js/core";
4
- import { jsx as i } from "react/jsx-runtime";
5
- //#region src/components/Prefs/schema.ts
6
- function a(e) {
7
- if (!e.unit) return {
8
- min: e.min,
9
- max: e.max,
10
- step: e.step ?? 1
11
- };
12
- let { toDisplay: t } = e.unit, n = e.min === void 0 ? void 0 : t(e.min), r = e.max === void 0 ? void 0 : t(e.max), i = n !== void 0 && r !== void 0 && n > r, a = e.step === void 0 ? 1 : Math.abs(t(e.step) - t(0)) || e.step;
13
- return {
14
- min: i ? r : n,
15
- max: i ? n : r,
16
- step: a
17
- };
18
- }
19
- function o(e) {
20
- return e.suffix === void 0 ? { ...e.accepts } : {
21
- [e.suffix]: 1,
22
- ...e.accepts
23
- };
24
- }
25
- function s(e) {
26
- return "kind" in e;
27
- }
28
- function c(e, t) {
29
- let n = e;
30
- for (let e of t.split(".")) {
31
- if (typeof n != "object" || !n) return;
32
- n = n[e];
33
- }
34
- return n;
35
- }
36
- function l(e, t) {
37
- if (s(e)) return e.hidden && !t ? null : e;
38
- let n = e, r = {};
39
- for (let [e, i] of Object.entries(n.children)) {
40
- let n = l(i, t);
41
- n && (r[e] = n);
42
- }
43
- return Object.keys(r).length === 0 ? null : {
44
- ...e,
45
- children: r
46
- };
47
- }
48
- function u(e) {
49
- if (s(e)) return 1;
50
- let t = 0;
51
- for (let n of Object.values(e.children)) t += u(n);
52
- return t;
53
- }
54
- function d(e) {
55
- let t = [], n = Object.values(e.children).filter(s).length;
56
- n > 0 && t.push({
57
- path: "",
58
- name: e.name,
59
- depth: 0,
60
- section: "",
61
- matches: n
62
- });
63
- for (let [n, r] of Object.entries(e.children)) if (!s(r)) {
64
- t.push({
65
- path: n,
66
- name: r.name,
67
- depth: 0,
68
- section: n,
69
- matches: u(r)
70
- });
71
- for (let [e, i] of Object.entries(r.children)) s(i) || t.push({
72
- path: `${n}.${e}`,
73
- name: i.name,
74
- depth: 1,
75
- section: n,
76
- matches: u(i)
77
- });
78
- }
79
- return t;
80
- }
81
- function f(e, t, n) {
82
- return e.name.toLowerCase().includes(n) || e.description?.toLowerCase().includes(n) ? !0 : t.toLowerCase().includes(n);
83
- }
84
- function p(e, t, n = "") {
85
- let r = t.trim().toLowerCase();
86
- if (r === "") return e;
87
- if (s(e)) return f(e, n, r) ? e : null;
88
- let i = e;
89
- if (i.name.toLowerCase().includes(r)) return e;
90
- let a = {};
91
- for (let [e, t] of Object.entries(i.children)) {
92
- let i = p(t, r, n === "" ? e : `${n}.${e}`);
93
- i && (a[e] = i);
94
- }
95
- return Object.keys(a).length === 0 ? null : {
96
- ...e,
97
- children: a
98
- };
99
- }
100
- //#endregion
101
- //#region src/components/Prefs/prefField.tsx
102
- function m(e, t) {
103
- let { value: i, mixed: s = !1, unset: c = !1, siblings: l, setValue: u } = t;
104
- if (e.kind === "font-family") {
105
- let e = t.fontVariant ? t.fontVariant.weight : l?.fontWeight, n = t.fontVariant ? t.fontVariant.style : l?.fontStyle;
106
- return {
107
- kind: "font-family",
108
- value: typeof i == "string" ? i : void 0,
109
- mixed: s,
110
- unset: c,
111
- onChange: u,
112
- weight: typeof e == "number" ? e : void 0,
113
- fontStyle: n === "italic" ? "italic" : void 0
114
- };
115
- }
116
- if (!r(e)) return null;
117
- switch (e.kind) {
118
- case "boolean": return {
119
- kind: "boolean",
120
- control: e.control,
121
- value: typeof i == "boolean" ? i : void 0,
122
- mixed: s,
123
- unset: c,
124
- glyph: h(e.icon) ?? e.short,
125
- onChange: u
126
- };
127
- case "number": {
128
- let t = e.unit, n = typeof i == "number" && Number.isFinite(i) ? i : void 0, r = a(e), l = (e) => Math.min(r.max ?? Infinity, Math.max(r.min ?? -Infinity, e));
129
- return {
130
- kind: "number",
131
- control: e.control,
132
- value: n === void 0 ? void 0 : t ? t.toDisplay(n) : n,
133
- mixed: s,
134
- unset: c,
135
- min: r.min,
136
- max: r.max,
137
- step: r.step,
138
- unit: t?.suffix,
139
- accepts: t ? o(t) : void 0,
140
- notation: e.format,
141
- onChange: (e) => u(t ? t.fromDisplay(l(e)) : l(e))
142
- };
143
- }
144
- case "string": return {
145
- kind: "string",
146
- control: e.control,
147
- value: typeof i == "string" ? i : "",
148
- mixed: s,
149
- unset: c,
150
- onChange: u
151
- };
152
- case "enum": {
153
- let t = e.encoding, n = t ? s ? void 0 : t.read(i, l) : s || c ? void 0 : typeof i == "string" ? i : e.default;
154
- return {
155
- kind: "enum",
156
- control: e.control,
157
- value: n,
158
- mixed: s,
159
- unset: c,
160
- options: e.options.map((e) => ({
161
- value: e.value,
162
- label: e.label,
163
- glyph: h(e.icon) ?? e.short,
164
- disabled: e.disabled
165
- })),
166
- onChange: (e) => u(t ? t.write(e, l) : e)
167
- };
168
- }
169
- case "color": return {
170
- kind: "color",
171
- value: typeof i == "string" ? i : e.default,
172
- mixed: s,
173
- unset: c,
174
- alpha: e.alpha ? !0 : void 0,
175
- onChange: u
176
- };
177
- case "paint": return {
178
- kind: "paint",
179
- value: i === null ? null : n(i) ? i : s ? void 0 : n(e.default) ? e.default : null,
180
- mixed: s,
181
- unset: c,
182
- onChange: u
183
- };
184
- case "object": return null;
185
- default: throw Error(`prefFieldProps: no control for built-in pref kind "${e.kind}"`);
186
- }
187
- }
188
- function h(n) {
189
- return n && n in e ? /* @__PURE__ */ i(t, {
190
- name: n,
191
- size: 14
192
- }) : void 0;
193
- }
194
- //#endregion
195
- export { d as a, a as i, p as n, c as o, s as r, l as s, m as t };
196
-
197
- //# sourceMappingURL=prefField-Dnl7nmjQ.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"prefField-Dnl7nmjQ.js","names":["_exhaustive","ICON_PATHS","isPaint","prefDisplayBounds","p","lo","toDisplay","hi","flipped","step","prefUnitAccepts","unit","isPrefLeaf","node","prefValueAtPath","cur","values","seg","path","visiblePrefSubtree","showHidden","group","children","key","child","kept","countPrefLeaves","n","prefRailItems","items","loose","root","subKey","sub","prefLeafMatches","pref","query","filterPrefSubtree","q","prefFieldProps","state","leaf","weight","siblings","style","value","setValue","isBuiltinToolPref","glyphOf","stored","bounds","clamp","shown","encoding","option","mixed","unset","o","next","icon","Icon"],"sources":["../../src/components/Prefs/schema.ts","../../src/components/Prefs/prefField.tsx"],"sourcesContent":["// Preference-schema vocabulary for PrefsForm / PrefsDialog / SelectionPanel:\n// core's `ToolPref*` family under this package's names. Never re-declare them\n// here — this was a hand-kept structural copy until it drifted, and the\n// independence from `@weasel-js/core` it bought is long gone anyway.\n\nexport type {\n ToolPref as BuiltinPref,\n ToolPrefBoolean as PrefBoolean,\n ToolPrefBooleanControl as PrefBooleanControl,\n ToolPrefColor as PrefColor,\n ToolPrefCustom as PrefCustom,\n ToolPrefEnum as PrefEnum,\n ToolPrefEnumControl as PrefEnumControl,\n ToolPrefEnumEncoding as PrefEnumEncoding,\n ToolPrefGroup as PrefGroup,\n ToolPrefKind as PrefKind,\n ToolPrefLeaf as PrefLeaf,\n ToolPrefNumber as PrefNumber,\n ToolPrefNumberControl as PrefNumberControl,\n ToolPrefNumberFormat as PrefNumberFormat,\n ToolPrefNumberUnit as PrefNumberUnit,\n ToolPrefObject as PrefObject,\n ToolPrefPaint as PrefPaint,\n ToolPrefString as PrefString,\n ToolPrefStringControl as PrefStringControl,\n} from '@weasel-js/core';\n\nimport type { UnitTable } from '../../format/number';\nimport type { ToolPrefGroup, ToolPrefLeaf, ToolPrefNumber, ToolPrefNumberUnit as PrefNumberUnitType } from '@weasel-js/core';\n\n/**\n * A number leaf's bounds in the unit it is displayed in.\n *\n * Only what the leaf declares converts: an omitted bound has no stored\n * counterpart to put through the conversion, and its fallback — 0..100 for a\n * slider's track, a step of 1 — is a display-space number already. `min` and\n * `max` are points, so they convert the way the value does; `step` is a\n * distance, and a unit with an offset maps zero somewhere else, so converting\n * it as a point would scale it wrong. A decreasing conversion swaps which end\n * is the lower one.\n */\nexport function prefDisplayBounds(\n p: ToolPrefNumber,\n): { min?: number; max?: number; step: number } {\n if (!p.unit) return { min: p.min, max: p.max, step: p.step ?? 1 };\n const { toDisplay } = p.unit;\n const lo = p.min === undefined ? undefined : toDisplay(p.min);\n const hi = p.max === undefined ? undefined : toDisplay(p.max);\n const flipped = lo !== undefined && hi !== undefined && lo > hi;\n const step = p.step === undefined\n ? 1\n : Math.abs(toDisplay(p.step) - toDisplay(0)) || p.step;\n return { min: flipped ? hi : lo, max: flipped ? lo : hi, step };\n}\n\n/** What a unit leaf's field reads as typed text: its `accepts` table, and its\n * `suffix` as the display unit itself. */\nexport function prefUnitAccepts(unit: PrefNumberUnitType): Readonly<UnitTable> {\n return unit.suffix === undefined ? { ...unit.accepts } : { [unit.suffix]: 1, ...unit.accepts };\n}\n\n/** Distinguishes a leaf from a group while walking a schema tree. */\nexport function isPrefLeaf(node: ToolPrefLeaf | ToolPrefGroup): node is ToolPrefLeaf {\n return 'kind' in node;\n}\n\n/** Get the value at a dotted path inside a nested value tree. Returns\n * `undefined` when a segment is missing or hits a non-object. */\nexport function prefValueAtPath(values: unknown, path: string): unknown {\n let cur: unknown = values;\n for (const seg of path.split('.')) {\n if (cur == null || typeof cur !== 'object') return undefined;\n cur = (cur as Record<string, unknown>)[seg];\n }\n return cur;\n}\n\n/**\n * Recursively drop `hidden` leaves (unless `showHidden`), pruning groups\n * that end up empty. Returns null when the entire subtree is hidden.\n */\nexport function visiblePrefSubtree<T extends ToolPrefLeaf | ToolPrefGroup>(\n node: T,\n showHidden: boolean,\n): T | null {\n if (isPrefLeaf(node)) return node.hidden && !showHidden ? null : node;\n const group = node as ToolPrefGroup;\n const children: Record<string, ToolPrefLeaf | ToolPrefGroup> = {};\n for (const [key, child] of Object.entries(group.children)) {\n const kept = visiblePrefSubtree(child, showHidden);\n if (kept) children[key] = kept;\n }\n if (Object.keys(children).length === 0) return null;\n return { ...node, children };\n}\n\n/** One entry in a {@link PrefsForm} rail: a group the reader can navigate to. */\nexport interface PrefRailItem {\n /** Dotted path of the group. Empty for the entry holding loose root leaves. */\n path: string;\n name: string;\n /** 0 opens a pane; 1 scrolls within the open one. The rail goes no deeper. */\n depth: 0 | 1;\n /** Path of the depth-0 ancestor — its own path when `depth` is 0. */\n section: string;\n /** Leaves surviving the active filter, counted over the whole subtree. */\n matches: number;\n}\n\n/** Leaves anywhere under `node`, counted. */\nfunction countPrefLeaves(node: ToolPrefLeaf | ToolPrefGroup): number {\n if (isPrefLeaf(node)) return 1;\n let n = 0;\n for (const child of Object.values(node.children)) n += countPrefLeaves(child);\n return n;\n}\n\n/**\n * The rail's model for a schema: depth-0 groups, each followed by its depth-1\n * children. Deeper groups render inside a pane and get no entry — a schema\n * that nests ten deep still navigates two levels.\n *\n * Loose leaves directly under the root lead the list under an entry named for\n * the root itself, since they belong to no group that could name them.\n */\nexport function prefRailItems(root: ToolPrefGroup): PrefRailItem[] {\n const items: PrefRailItem[] = [];\n const loose = Object.values(root.children).filter(isPrefLeaf).length;\n if (loose > 0) {\n items.push({ path: '', name: root.name, depth: 0, section: '', matches: loose });\n }\n for (const [key, child] of Object.entries(root.children)) {\n if (isPrefLeaf(child)) continue;\n items.push({\n path: key,\n name: child.name,\n depth: 0,\n section: key,\n matches: countPrefLeaves(child),\n });\n for (const [subKey, sub] of Object.entries(child.children)) {\n if (isPrefLeaf(sub)) continue;\n items.push({\n path: `${key}.${subKey}`,\n name: sub.name,\n depth: 1,\n section: key,\n matches: countPrefLeaves(sub),\n });\n }\n }\n return items;\n}\n\n/** Whether one leaf answers to a filter query, by name, description or path. */\nfunction prefLeafMatches(pref: ToolPrefLeaf, path: string, query: string): boolean {\n if (pref.name.toLowerCase().includes(query)) return true;\n if (pref.description?.toLowerCase().includes(query)) return true;\n return path.toLowerCase().includes(query);\n}\n\n/**\n * Drop every leaf that does not answer to `query`, pruning groups left empty.\n * A group whose own name matches keeps all of its leaves — a reader who typed\n * the group's name is asking for the group, not for leaves repeating it.\n *\n * An empty or whitespace query matches everything, so a cleared field restores\n * the tree rather than emptying it.\n */\nexport function filterPrefSubtree<T extends ToolPrefLeaf | ToolPrefGroup>(\n node: T,\n query: string,\n path = '',\n): T | null {\n const q = query.trim().toLowerCase();\n if (q === '') return node;\n if (isPrefLeaf(node)) return prefLeafMatches(node, path, q) ? node : null;\n const group = node as ToolPrefGroup;\n if (group.name.toLowerCase().includes(q)) return node;\n const children: Record<string, ToolPrefLeaf | ToolPrefGroup> = {};\n for (const [key, child] of Object.entries(group.children)) {\n const kept = filterPrefSubtree(child, q, path === '' ? key : `${path}.${key}`);\n if (kept) children[key] = kept;\n }\n if (Object.keys(children).length === 0) return null;\n return { ...node, children };\n}\n","import type { ReactNode } from 'react';\nimport { isBuiltinToolPref, type FillStyle } from '@weasel-js/core';\nimport { Icon } from '../../icons/Icon';\nimport { ICON_PATHS, type IconName } from '../../icons/paths';\nimport { isPaint } from '../paintValue';\nimport type { PropertyControlProps } from '../Properties/PropertyField';\nimport { prefDisplayBounds, prefUnitAccepts, type PrefLeaf } from './schema';\n\n/** What {@link prefFieldProps} is told about one leaf's value. */\nexport interface PrefFieldState {\n /** The value held at the leaf. `undefined` when `mixed` or `unset`. */\n value: unknown;\n mixed?: boolean;\n unset?: boolean;\n /** The object the leaf is a field of, for an enum `encoding` and a font's\n * weight and slant. `undefined` for a top-level leaf. */\n siblings?: Record<string, unknown>;\n /** Writes a value in the leaf's stored form. */\n setValue: (value: unknown) => void;\n /** A font family's weight and slant, where they are not `siblings`' own\n * `fontWeight` / `fontStyle`. */\n fontVariant?: { weight?: unknown; style?: unknown };\n}\n\n/**\n * A schema leaf as {@link PropertyControl} props: its value, bounds and\n * options in the form it is shown in, and a writer that stores what the\n * control reports in the form the leaf holds.\n *\n * The conversions every schema-driven surface needs live here once — a\n * number's display unit and its bounds, an enum's `encoding`, a color's\n * alpha, an icon resolved to a glyph. A leaf that is not a single control —\n * an `object`, whose fields each are, or an app-defined kind — returns\n * `null`, and the surface draws it.\n *\n * Spread the result and add what the surface decides: `chrome`, `name`, a\n * class, a different default `control`.\n */\nexport function prefFieldProps(leaf: PrefLeaf, state: PrefFieldState): PropertyControlProps | null {\n const { value, mixed = false, unset = false, siblings, setValue } = state;\n if (leaf.kind === 'font-family') {\n const weight = state.fontVariant ? state.fontVariant.weight : siblings?.fontWeight;\n const style = state.fontVariant ? state.fontVariant.style : siblings?.fontStyle;\n return {\n kind: 'font-family',\n value: typeof value === 'string' ? value : undefined,\n mixed,\n unset,\n onChange: setValue,\n weight: typeof weight === 'number' ? weight : undefined,\n fontStyle: style === 'italic' ? 'italic' : undefined,\n };\n }\n if (!isBuiltinToolPref(leaf)) return null;\n switch (leaf.kind) {\n case 'boolean':\n return {\n kind: 'boolean',\n control: leaf.control,\n value: typeof value === 'boolean' ? value : undefined,\n mixed,\n unset,\n glyph: glyphOf(leaf.icon) ?? leaf.short,\n onChange: setValue,\n };\n case 'number': {\n const unit = leaf.unit;\n const stored = typeof value === 'number' && Number.isFinite(value) ? value : undefined;\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.\n const bounds = prefDisplayBounds(leaf);\n const clamp = (n: number) =>\n Math.min(bounds.max ?? Infinity, Math.max(bounds.min ?? -Infinity, n));\n const store = (shown: number) => setValue(unit ? unit.fromDisplay(clamp(shown)) : clamp(shown));\n return {\n kind: 'number',\n control: leaf.control,\n value: stored === undefined ? undefined : unit ? unit.toDisplay(stored) : stored,\n mixed,\n unset,\n min: bounds.min,\n max: bounds.max,\n step: bounds.step,\n unit: unit?.suffix,\n accepts: unit ? prefUnitAccepts(unit) : undefined,\n notation: leaf.format,\n onChange: store,\n };\n }\n case 'string':\n return {\n kind: 'string',\n control: leaf.control,\n value: typeof value === 'string' ? value : '',\n mixed,\n unset,\n onChange: setValue,\n };\n case 'enum': {\n const encoding = leaf.encoding;\n // An encoded leaf stores something other than the option string (a dash\n // array), so the option comes from the encoding — and an absent field is\n // one of the things it reads (no dash is `solid`), which is why `unset`\n // does not blank it.\n const option = encoding\n ? mixed\n ? undefined\n : encoding.read(value, siblings)\n : mixed || unset\n ? undefined\n : typeof value === 'string'\n ? value\n : leaf.default;\n return {\n kind: 'enum',\n control: leaf.control,\n value: option,\n mixed,\n unset,\n options: leaf.options.map((o) => ({\n value: o.value,\n label: o.label,\n glyph: glyphOf(o.icon) ?? o.short,\n disabled: o.disabled,\n })),\n onChange: (next: string) => setValue(encoding ? encoding.write(next, siblings) : next),\n };\n }\n case 'color':\n return {\n kind: 'color',\n value: typeof value === 'string' ? value : leaf.default,\n mixed,\n unset,\n alpha: leaf.alpha ? true : undefined,\n onChange: setValue,\n };\n case 'paint': {\n // `??` would read an explicit `null` — \"no paint\" — as absent and show\n // the default over it. Unset shows the fallback actually in effect,\n // dimmed by the control: true, but not chosen.\n const paint =\n value === null\n ? null\n : isPaint(value)\n ? value\n : mixed\n ? undefined\n : isPaint(leaf.default)\n ? leaf.default\n : null;\n return {\n kind: 'paint',\n value: paint as FillStyle | null | undefined,\n mixed,\n unset,\n onChange: setValue,\n };\n }\n case 'object':\n return null;\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 row.\n const _exhaustive: never = leaf;\n throw new Error(\n `prefFieldProps: no control for built-in pref kind \"${(_exhaustive as { kind: string }).kind}\"`,\n );\n }\n }\n}\n\n/** A leaf's `icon` as a glyph, where the kit's icon set has it. */\nfunction glyphOf(icon: string | undefined): ReactNode {\n return icon && icon in ICON_PATHS ? <Icon name={icon as IconName} size={14} /> : undefined;\n}\n"],"mappings":";;;;;AAyCA,SAAgBG,EACd,GAC8C;CAC9C,IAAI,CAACC,EAAE,MAAM,OAAO;EAAE,KAAKA,EAAE;EAAK,KAAKA,EAAE;EAAK,MAAMA,EAAE,QAAQ;CAAE;CAChE,IAAM,EAAE,iBAAcA,EAAE,MAClBC,IAAKD,EAAE,QAAQ,KAAA,IAAY,KAAA,IAAYE,EAAUF,EAAE,GAAG,GACtDG,IAAKH,EAAE,QAAQ,KAAA,IAAY,KAAA,IAAYE,EAAUF,EAAE,GAAG,GACtDI,IAAUH,MAAO,KAAA,KAAaE,MAAO,KAAA,KAAaF,IAAKE,GACvDE,IAAOL,EAAE,SAAS,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,EAAiC,KAAK,EAC/F;CAEJ;AACF;AAGA,SAASgD,EAAQ,GAAqC;CACpD,OAAOW,KAAQA,KAAQ1D,IAAa,kBAAC2D,GAAD;EAAM,MAAMD;EAAkB,MAAM;CAAK,CAAA,IAAI,KAAA;AACnF"}
@@ -1,11 +0,0 @@
1
- var e = {
2
- root: "_root_4jvk7_10",
3
- segment: "_segment_4jvk7_32",
4
- segmentSelected: "_segmentSelected_4jvk7_81",
5
- size_sm: "_size_sm_4jvk7_139",
6
- variant_minimal: "_variant_minimal_4jvk7_152"
7
- };
8
- //#endregion
9
- export { e as t };
10
-
11
- //# sourceMappingURL=segmentedControl.module-Bv7DEg8f.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"segmentedControl.module-Bv7DEg8f.js","names":["segmentedControl_module_default"],"sources":["../../src/components/segmentedControl.module.css"],"sourcesContent":["/* Shared by ButtonBar and OptionsBar, which look identical and differ only\n in what a segment does. Lives here rather than in either component so\n neither owns the other's styling.\n\n Aqua-glass segmented control. The track is a pill-shaped well; the\n selected segment becomes a tinted glass cylinder that reads as the same\n \"lozenge\" family as the standalone Button. Visual params come from the\n `--btn-*` custom properties (see Button.module.css) so the Button Lab\n can tune both surfaces with one set of sliders. */\n.root {\n display: inline-flex;\n height: var(--tb-h, var(--wzl-control-h, 24px));\n padding: var(--wzl-space-1);\n background: linear-gradient(\n 180deg,\n rgba(0, 0, 0, 0.18) 0%,\n rgba(0, 0, 0, 0.05) 100%\n );\n border-radius: var(--wzl-radius-pill);\n /* Clip segments to the track outline so interior corners read crisp and\n the selected segment's glass treatment doesn't paint over the rounded\n outer pixels. */\n overflow: hidden;\n box-shadow:\n inset 0 1px 2px rgba(0, 0, 0, 0.4),\n 0 1px 0 rgba(255, 255, 255, 0.06);\n user-select: none;\n -webkit-user-select: none;\n touch-action: none;\n}\n\n.segment {\n position: relative;\n flex: 1 1 0;\n min-width: 0;\n /* The track's stretch sizes a segment; without this, labkit's :where(button) height wins and overflows a small bar. */\n height: auto;\n padding: 0 var(--wzl-space-6);\n display: inline-flex;\n align-items: center;\n justify-content: center;\n background: transparent;\n border: none;\n margin: 0;\n font-family: var(--wzl-font-ui);\n font-weight: var(--wzl-font-weight-normal);\n font-size: var(--btn-fontsize, var(--wzl-font-size));\n line-height: 1;\n color: var(--wzl-fg-muted);\n cursor: pointer;\n /* Only round the outer corners of the bar — middle segments stay square\n so the seams between them don't render as facing parentheses. */\n border-radius: 0;\n isolation: isolate;\n overflow: hidden;\n transition: color var(--wzl-motion-fast);\n}\n\n.segment:first-child {\n border-radius: var(--wzl-radius-pill) 0 0 var(--wzl-radius-pill);\n}\n\n.segment:last-child {\n border-radius: 0 var(--wzl-radius-pill) var(--wzl-radius-pill) 0;\n}\n\n.segment:only-child {\n border-radius: var(--wzl-radius-pill);\n}\n\n.segment:focus-visible {\n outline: 2px solid var(--wzl-accent);\n outline-offset: -2px;\n}\n\n.segment:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n}\n\n.segment:hover:not(:disabled):not(.segmentSelected) {\n color: var(--wzl-fg);\n}\n\n/* Selected segment — full Aqua glass cylinder. Mirrors Button.variant_primary. */\n.segmentSelected {\n background: linear-gradient(\n 180deg,\n color-mix(in srgb, var(--wzl-accent) var(--btn-top-alpha, 45%), transparent) 0%,\n color-mix(in srgb, var(--wzl-accent) var(--btn-upper-alpha, 70%), transparent) calc(var(--btn-equator, 52%) - var(--btn-equator-spread, 12%)),\n color-mix(in srgb, var(--wzl-accent) var(--btn-equator-tint, 95%), white) var(--btn-equator, 52%),\n var(--wzl-accent) calc(var(--btn-equator, 52%) + var(--btn-equator-spread, 12%) * 1.6),\n color-mix(in srgb, var(--wzl-accent) var(--btn-base-tint, 70%), black) 100%\n );\n backdrop-filter: blur(var(--btn-blur, 6px)) saturate(var(--btn-saturate, 1.3));\n -webkit-backdrop-filter: blur(var(--btn-blur, 6px)) saturate(var(--btn-saturate, 1.3));\n color: var(--wzl-fg-on-accent);\n text-shadow:\n 0 1px 0 rgba(0, 0, 0, var(--btn-text-shadow, 0.35)),\n var(--btn-text-inset-x, 0px) var(--btn-text-inset-y, 1px) 0 rgba(0, 0, 0, var(--btn-text-inset, 0.55)),\n 0 0 6px rgba(0, 0, 0, calc(var(--btn-text-shadow, 0.35) * 0.5));\n box-shadow:\n inset 0 1px 0 rgba(255, 255, 255, var(--btn-inset-hi, 0.42)),\n inset 0 -1px 2px rgba(0, 0, 0, var(--btn-inset-lo, 0.3)),\n 0 0 0 1px rgba(0, 0, 0, var(--btn-rim, 0.22)),\n 0 1px 2px rgba(0, 0, 0, var(--btn-drop-near, 0.3)),\n 0 2px 4px rgba(0, 0, 0, calc(var(--btn-drop-far, 0.18) * 0.8));\n}\n\n/* Specular gloss on the selected segment. Top corners inherit the\n segment's radius so they hug the upper edge cleanly; bottom corners\n are flattened so the gloss ends in a straight line at the equator\n instead of two little curves that read as `)(` brackets. */\n.segmentSelected::before {\n content: '';\n position: absolute;\n inset: 1px 1px var(--btn-gloss-bottom, 50%) 1px;\n border-radius: inherit;\n border-bottom-left-radius: 0;\n border-bottom-right-radius: 0;\n background: linear-gradient(\n 180deg,\n rgba(255, 255, 255, var(--btn-gloss-top, 0.42)) 0%,\n rgba(255, 255, 255, var(--btn-gloss-mid, 0.12)) 60%,\n rgba(255, 255, 255, 0) 100%\n );\n pointer-events: none;\n z-index: 1;\n}\n\n.segmentSelected > * {\n position: relative;\n z-index: 2;\n}\n\n/* Small variant — ~60% of the default height, with proportionally reduced\n padding and font. Sized for dense surfaces (lab control panels, inline\n filters, etc.). */\n.size_sm {\n height: 17px;\n padding: 1px;\n}\n\n.size_sm .segment {\n padding: 0 var(--wzl-space-4);\n font-size: var(--wzl-font-size-sm);\n}\n\n/* Minimal variant — strips the pill track, glass selected state, inset\n shadows, and outer padding. Used in dense diagnostic surfaces (dispatch\n trace, lab inspectors) where the bar must read as plain text controls. */\n.variant_minimal {\n height: auto;\n padding: 0;\n background: none;\n border-radius: 0;\n box-shadow: none;\n gap: var(--wzl-space-1);\n}\n\n.variant_minimal .segment {\n padding: 0 var(--wzl-space-2);\n font-size: var(--wzl-font-size-sm);\n font-weight: var(--wzl-font-weight-medium);\n line-height: 1.4;\n border-radius: var(--wzl-radius-sm);\n color: var(--wzl-fg-muted);\n transition: none;\n}\n\n.variant_minimal .segment:first-child,\n.variant_minimal .segment:last-child,\n.variant_minimal .segment:only-child {\n border-radius: var(--wzl-radius-sm);\n}\n\n.variant_minimal .segment:hover:not(:disabled):not(.segmentSelected) {\n color: var(--wzl-fg);\n background: var(--wzl-surface-hover);\n}\n\n.variant_minimal .segmentSelected {\n background: none;\n backdrop-filter: none;\n -webkit-backdrop-filter: none;\n color: var(--wzl-accent-fg, var(--wzl-accent));\n text-shadow: none;\n box-shadow: none;\n font-weight: var(--wzl-font-weight-medium);\n}\n\n.variant_minimal .segmentSelected::before {\n content: none;\n}\n"],"mappings":""}
@@ -1,131 +0,0 @@
1
- import { n as e } from "./interactiveTarget-BNZmTow2.js";
2
- import { startThresholdDrag as t } from "@weasel-js/core";
3
- import { useCallback as n, useEffect as r, useRef as i, useState as a } from "react";
4
- //#region src/useReorderDragList.ts
5
- var o = {
6
- draggedIds: null,
7
- targetIndex: null,
8
- ghost: null
9
- };
10
- function s(e, t) {
11
- let n = 0;
12
- for (let r = t - 1; r >= 0; r--) if (e[r]?.locked) {
13
- n = r + 1;
14
- break;
15
- }
16
- let r = e.length;
17
- for (let n = t + 1; n < e.length; n++) if (e[n]?.locked) {
18
- r = n;
19
- break;
20
- }
21
- return [n, r];
22
- }
23
- function c(e, t, n, r) {
24
- let [i, a] = s(e, r);
25
- return (t.includes(n) ? [...t] : [n]).filter((t) => {
26
- let n = e.findIndex((e) => e.id === t);
27
- return n >= i && n < a;
28
- });
29
- }
30
- function l(e, t, n) {
31
- let r = t.map((t) => e.findIndex((e) => e.id === t)).filter((e) => e >= 0).sort((e, t) => e - t), i = r.length > 0 && r.every((e, t) => {
32
- if (t === 0) return !0;
33
- let n = r[t - 1];
34
- return n !== void 0 && e === n + 1;
35
- }), a = r[0], o = r[r.length - 1];
36
- return i && a !== void 0 && o !== void 0 && n >= a && n <= o + 1;
37
- }
38
- function u(u) {
39
- let f = i(u);
40
- f.current = u;
41
- let p = i(null), m = i(null), [h, g] = a(o);
42
- r(() => () => {
43
- m.current?.cancel();
44
- }, []);
45
- let _ = n((e, t) => {
46
- let [n, r] = s(f.current.items, t), i = p.current;
47
- if (!i) return n;
48
- let a = f.current.rowSelector, o = a ? Array.from(i.children).filter((e) => e.matches(a)) : Array.from(i.children), c = o.length;
49
- for (let t = 0; t < o.length; t++) {
50
- let n = o[t];
51
- if (n && e < n.getBoundingClientRect().bottom) {
52
- c = t;
53
- break;
54
- }
55
- }
56
- return Math.max(n, Math.min(c, r));
57
- }, []), v = n((e) => {
58
- p.current = e;
59
- }, []), y = n(() => {
60
- m.current = null, g(o);
61
- }, []), b = n((n, r, i) => {
62
- let a = p.current;
63
- if (!a || m.current || e(i.target, i.currentTarget)) return;
64
- let o = {
65
- shiftKey: i.shiftKey,
66
- ctrlKey: i.ctrlKey,
67
- metaKey: i.metaKey,
68
- altKey: i.altKey
69
- }, s = [], u = 0, h = i.currentTarget, v = (Array.from(a.children).find((e) => e.contains(h)) ?? h).getBoundingClientRect(), b = {
70
- x: i.clientX - v.left,
71
- y: i.clientY - v.top
72
- }, x = (e) => ({
73
- ids: s,
74
- left: e.clientX - b.x,
75
- top: e.clientY - b.y,
76
- width: v.width
77
- });
78
- m.current = t(i, {
79
- origin: a,
80
- threshold: f.current.items[r]?.locked ? Infinity : f.current.threshold ?? 4,
81
- onActivate: (e) => {
82
- s = c(f.current.items, f.current.selectedIds, n, r), u = _(e.clientY, r), g({
83
- draggedIds: s,
84
- targetIndex: u,
85
- ghost: x(e)
86
- });
87
- },
88
- onMove: (e) => {
89
- u = _(e.clientY, r), g({
90
- draggedIds: s,
91
- targetIndex: u,
92
- ghost: x(e)
93
- });
94
- },
95
- onCommit: (e) => {
96
- let t = _(e.clientY, r);
97
- l(f.current.items, s, t) || f.current.onReorder(s, t), y();
98
- },
99
- onClick: () => {
100
- let { onPress: e } = f.current;
101
- e && (e(n, o), d(a)), y();
102
- },
103
- onCancel: y
104
- });
105
- }, [_, y]);
106
- return {
107
- nudge: n((e, t, n) => {
108
- let { items: r, selectedIds: i, onReorder: a } = f.current;
109
- if (r[t]?.locked) return !1;
110
- let o = c(r, i, e, t), u = o.map((e) => r.findIndex((t) => t.id === e)).sort((e, t) => e - t), d = u[0], p = u[u.length - 1];
111
- if (d === void 0 || p === void 0) return !1;
112
- let [m, h] = s(r, t), g = n < 0 ? d - 1 : p + 2;
113
- return g < m || g > h || l(r, o, g) ? !1 : (a(o, g), !0);
114
- }, []),
115
- rowProps: (e, t) => ({ onPointerDown: (n) => b(e, t, n) }),
116
- containerProps: { ref: v },
117
- state: h
118
- };
119
- }
120
- function d(e) {
121
- let t = (e) => {
122
- e.stopPropagation();
123
- };
124
- e.addEventListener("click", t, !0), setTimeout(() => {
125
- e.removeEventListener("click", t, !0);
126
- }, 0);
127
- }
128
- //#endregion
129
- export { u as t };
130
-
131
- //# sourceMappingURL=useReorderDragList-B_-5L5Gu.js.map