@weasel-js/ui 1.5.1 → 1.5.2

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 (279) hide show
  1. package/dist/chunks/{ActionBar-GZdcfdQL.js → ActionBar-CLwiY3Jg.js} +5 -5
  2. package/dist/chunks/ActionBar-CLwiY3Jg.js.map +1 -0
  3. package/dist/chunks/{ActionsBar-Fhx_40iP.js → ActionsBar-D84a4eGy.js} +2 -2
  4. package/dist/chunks/{ActionsBar-Fhx_40iP.js.map → ActionsBar-D84a4eGy.js.map} +1 -1
  5. package/dist/chunks/{Badge-Bf8Rd1R6.js → Badge-CW9pBPFl.js} +5 -5
  6. package/dist/chunks/Badge-CW9pBPFl.js.map +1 -0
  7. package/dist/chunks/{BandEditor-D8I5Uun-.js → BandEditor-jY-PFKY6.js} +12 -12
  8. package/dist/chunks/BandEditor-jY-PFKY6.js.map +1 -0
  9. package/dist/chunks/{Button-CExdkQcU.js → Button-DRSApvnK.js} +15 -15
  10. package/dist/chunks/Button-DRSApvnK.js.map +1 -0
  11. package/dist/chunks/{Callout-cx5_CWcW.js → Callout-DrNu-9Qr.js} +12 -12
  12. package/dist/chunks/Callout-DrNu-9Qr.js.map +1 -0
  13. package/dist/chunks/{Checkbox-BZZsPaVF.js → Checkbox-BOsDAY2F.js} +5 -5
  14. package/dist/chunks/Checkbox-BOsDAY2F.js.map +1 -0
  15. package/dist/chunks/{ColorField-YVf8irfr.js → ColorField-BYzgZM9o.js} +6 -6
  16. package/dist/chunks/ColorField-BYzgZM9o.js.map +1 -0
  17. package/dist/chunks/{ComboBox-D57tNYDD.js → ComboBox-Cz3f0Y_8.js} +13 -13
  18. package/dist/chunks/ComboBox-Cz3f0Y_8.js.map +1 -0
  19. package/dist/chunks/{CurveEditor-BXiMoN9d.js → CurveEditor-DXwSP-iA.js} +2 -2
  20. package/dist/chunks/{CurveEditor-BXiMoN9d.js.map → CurveEditor-DXwSP-iA.js.map} +1 -1
  21. package/dist/chunks/{DataGrid-BVdDMZkQ.js → DataGrid-C8KrYtw7.js} +11 -11
  22. package/dist/chunks/DataGrid-C8KrYtw7.js.map +1 -0
  23. package/dist/chunks/{DetentSlider-BWNSv07Z.js → DetentSlider-CAubVX0J.js} +2 -2
  24. package/dist/chunks/{DetentSlider-BWNSv07Z.js.map → DetentSlider-CAubVX0J.js.map} +1 -1
  25. package/dist/chunks/{Dialog-DuOzsR2g.js → Dialog-fGqqQ6o_.js} +9 -9
  26. package/dist/chunks/Dialog-fGqqQ6o_.js.map +1 -0
  27. package/dist/chunks/{Disclosure-9UgDzc7Z.js → Disclosure-CILDfWsU.js} +6 -6
  28. package/dist/chunks/Disclosure-CILDfWsU.js.map +1 -0
  29. package/dist/chunks/{Field-BNqvUJfg.js → Field-DWnV8WZY.js} +6 -6
  30. package/dist/chunks/Field-DWnV8WZY.js.map +1 -0
  31. package/dist/chunks/{FontFamilySelect-CO19kyOO.js → FontFamilySelect-DxfgTC3G.js} +2 -2
  32. package/dist/chunks/{FontFamilySelect-CO19kyOO.js.map → FontFamilySelect-DxfgTC3G.js.map} +1 -1
  33. package/dist/chunks/{GradientEditor-B_ymIr4Q.js → GradientEditor-rRBmf3G0.js} +7 -7
  34. package/dist/chunks/GradientEditor-rRBmf3G0.js.map +1 -0
  35. package/dist/chunks/{Icon-QhLhaGFe.js → Icon-DT0x6HaQ.js} +23 -2
  36. package/dist/chunks/Icon-DT0x6HaQ.js.map +1 -0
  37. package/dist/chunks/{Input-B9Vh7ASP.js → Input-DbMKpkXy.js} +5 -5
  38. package/dist/chunks/Input-DbMKpkXy.js.map +1 -0
  39. package/dist/chunks/{ItemList-BZJQReXD.js → ItemList-B9zYb0GE.js} +7 -7
  40. package/dist/chunks/ItemList-B9zYb0GE.js.map +1 -0
  41. package/dist/chunks/{Jog-BYrxbAQU.js → Jog-DkkTlL3_.js} +8 -8
  42. package/dist/chunks/Jog-DkkTlL3_.js.map +1 -0
  43. package/dist/chunks/{Keycaps-CGNQV2Pz.js → Keycaps-DunVpejA.js} +5 -5
  44. package/dist/chunks/{Keycaps-CGNQV2Pz.js.map → Keycaps-DunVpejA.js.map} +1 -1
  45. package/dist/chunks/{LayerStack-DOylrQcm.js → LayerStack-CfQ6GsRz.js} +18 -18
  46. package/dist/chunks/LayerStack-CfQ6GsRz.js.map +1 -0
  47. package/dist/chunks/{MenuButton-DGE-0DP0.js → MenuButton-C_4nox39.js} +7 -7
  48. package/dist/chunks/MenuButton-C_4nox39.js.map +1 -0
  49. package/dist/chunks/{MeshEditor-CHoGQ9K8.js → MeshEditor-Bipz-Ocl.js} +8 -8
  50. package/dist/chunks/MeshEditor-Bipz-Ocl.js.map +1 -0
  51. package/dist/chunks/{NumberField-CQzS6TjF.js → NumberField-CCjEDZCg.js} +9 -9
  52. package/dist/chunks/NumberField-CCjEDZCg.js.map +1 -0
  53. package/dist/chunks/{OptionsBar-BWaYG_OH.js → OptionsBar-DeQ-vUeZ.js} +2 -2
  54. package/dist/chunks/{OptionsBar-BWaYG_OH.js.map → OptionsBar-DeQ-vUeZ.js.map} +1 -1
  55. package/dist/chunks/{PaintField-BVYMu3OI.js → PaintField-jBOJ32rL.js} +8 -8
  56. package/dist/chunks/PaintField-jBOJ32rL.js.map +1 -0
  57. package/dist/chunks/{PaintInput-BzAHCKro.js → PaintInput-Qs7Rul5R.js} +10 -10
  58. package/dist/chunks/PaintInput-Qs7Rul5R.js.map +1 -0
  59. package/dist/chunks/{PatternPicker-C4OryrYi.js → PatternPicker-BMpXWboq.js} +6 -6
  60. package/dist/chunks/PatternPicker-BMpXWboq.js.map +1 -0
  61. package/dist/chunks/{Plot2D-Czvyt_vG.js → Plot2D-CXf_f7QD.js} +1 -1
  62. package/dist/chunks/{Plot2D-Czvyt_vG.js.map → Plot2D-CXf_f7QD.js.map} +1 -1
  63. package/dist/chunks/{PointPlotter-Xvb98GwB.js → PointPlotter-S_gz7VYt.js} +2 -2
  64. package/dist/chunks/{PointPlotter-Xvb98GwB.js.map → PointPlotter-S_gz7VYt.js.map} +1 -1
  65. package/dist/chunks/{Powerline-B_EH-7Z-.js → Powerline-Ak5AWUlK.js} +5 -5
  66. package/dist/chunks/Powerline-Ak5AWUlK.js.map +1 -0
  67. package/dist/chunks/Prefs-CNC8tzyN.js +308 -0
  68. package/dist/chunks/Prefs-CNC8tzyN.js.map +1 -0
  69. package/dist/chunks/{Properties-B3KU69NI.js → Properties-Rnb6TAbN.js} +230 -213
  70. package/dist/chunks/Properties-Rnb6TAbN.js.map +1 -0
  71. package/dist/chunks/{RadioGroup-C6xpdQNg.js → RadioGroup-CsVp3SEu.js} +6 -6
  72. package/dist/chunks/RadioGroup-CsVp3SEu.js.map +1 -0
  73. package/dist/chunks/{RangeSlider-CzgeGLVS.js → RangeSlider-DNr-pJpZ.js} +8 -8
  74. package/dist/chunks/RangeSlider-DNr-pJpZ.js.map +1 -0
  75. package/dist/chunks/{ResizeHandle-1Ey8AOij.js → ResizeHandle-RXFf5fXr.js} +1 -1
  76. package/dist/chunks/{ResizeHandle-1Ey8AOij.js.map → ResizeHandle-RXFf5fXr.js.map} +1 -1
  77. package/dist/chunks/Select-BEope086.js +190 -0
  78. package/dist/chunks/Select-BEope086.js.map +1 -0
  79. package/dist/chunks/SelectionPanel-CEbLS-0D.js +102 -0
  80. package/dist/chunks/SelectionPanel-CEbLS-0D.js.map +1 -0
  81. package/dist/chunks/{Sidebar-BlUjn8lD.js → Sidebar-qn_oSCNX.js} +4 -4
  82. package/dist/chunks/Sidebar-qn_oSCNX.js.map +1 -0
  83. package/dist/chunks/{SidebarPanel-BqHfz6VK.js → SidebarPanel-Bs6V21hg.js} +12 -12
  84. package/dist/chunks/SidebarPanel-Bs6V21hg.js.map +1 -0
  85. package/dist/chunks/{Slider-B2ywUZH6.js → Slider-CIIrqiFS.js} +18 -18
  86. package/dist/chunks/Slider-CIIrqiFS.js.map +1 -0
  87. package/dist/chunks/{StatusBar-BFt7Yw5O.js → StatusBar-B4L15DSm.js} +6 -6
  88. package/dist/chunks/StatusBar-B4L15DSm.js.map +1 -0
  89. package/dist/chunks/{Switch-Om3t3ASc.js → Switch-DH5POG0T.js} +5 -5
  90. package/dist/chunks/Switch-DH5POG0T.js.map +1 -0
  91. package/dist/chunks/{Tabs-EAvYywil.js → Tabs-BFHikpml.js} +5 -5
  92. package/dist/chunks/Tabs-BFHikpml.js.map +1 -0
  93. package/dist/chunks/{Timeline-BEyKaBXl.js → Timeline-DNKY_yiK.js} +40 -40
  94. package/dist/chunks/Timeline-DNKY_yiK.js.map +1 -0
  95. package/dist/chunks/{Toast-iqLDD_XZ.js → Toast-CI1UDuK6.js} +15 -15
  96. package/dist/chunks/Toast-CI1UDuK6.js.map +1 -0
  97. package/dist/chunks/{ToggleBar--9As2PWG.js → ToggleBar-CClus5Cd.js} +8 -8
  98. package/dist/chunks/ToggleBar-CClus5Cd.js.map +1 -0
  99. package/dist/chunks/TokenPanel-BPHq24dc.js +634 -0
  100. package/dist/chunks/TokenPanel-BPHq24dc.js.map +1 -0
  101. package/dist/chunks/{ToolButton-Dd-1T5aX.js → ToolButton-9QzJCmuM.js} +7 -7
  102. package/dist/chunks/ToolButton-9QzJCmuM.js.map +1 -0
  103. package/dist/chunks/{ToolGroup-BBI-W-Gm.js → ToolGroup-BJiDrH_i.js} +3 -3
  104. package/dist/chunks/ToolGroup-BJiDrH_i.js.map +1 -0
  105. package/dist/chunks/ToolOptionsBar-CAM6RcUH.js +85 -0
  106. package/dist/chunks/ToolOptionsBar-CAM6RcUH.js.map +1 -0
  107. package/dist/chunks/{ToolPalette-BmTDDpmz.js → ToolPalette-DGkKwE7D.js} +8 -8
  108. package/dist/chunks/ToolPalette-DGkKwE7D.js.map +1 -0
  109. package/dist/chunks/{Tooltip-BHre_vbI.js → Tooltip-C4YBczLq.js} +3 -3
  110. package/dist/chunks/Tooltip-C4YBczLq.js.map +1 -0
  111. package/dist/chunks/{createKeyframeLayer-7j7ukrSx.js → createKeyframeLayer-DKtO0Sw_.js} +3 -3
  112. package/dist/chunks/{createKeyframeLayer-7j7ukrSx.js.map → createKeyframeLayer-DKtO0Sw_.js.map} +1 -1
  113. package/dist/chunks/{icons-Btrs-JD7.js → icons-DFLytcui.js} +2 -2
  114. package/dist/chunks/{icons-Btrs-JD7.js.map → icons-DFLytcui.js.map} +1 -1
  115. package/dist/chunks/model-13kZ_-mE.js +483 -0
  116. package/dist/chunks/model-13kZ_-mE.js.map +1 -0
  117. package/dist/chunks/number-BHz66zQO.js +89 -0
  118. package/dist/chunks/number-BHz66zQO.js.map +1 -0
  119. package/dist/chunks/{schema-MCVT1MLv.js → schema-Dft4Cu2p.js} +1 -1
  120. package/dist/chunks/schema-Dft4Cu2p.js.map +1 -0
  121. package/dist/chunks/segmentedControl.module-DS72X1ns.js +11 -0
  122. package/dist/chunks/segmentedControl.module-DS72X1ns.js.map +1 -0
  123. package/dist/chunks/{snap-B0WQwetQ.js → snap-CEjuWOhN.js} +1 -1
  124. package/dist/chunks/{snap-B0WQwetQ.js.map → snap-CEjuWOhN.js.map} +1 -1
  125. package/dist/chunks/useRovingTabIndex-Dkpf_KhN.js.map +1 -1
  126. package/dist/color/oklch.d.ts +2 -1
  127. package/dist/color/oklch.d.ts.map +1 -1
  128. package/dist/components/ActionBar/index.js +1 -1
  129. package/dist/components/ActionsBar/index.js +1 -1
  130. package/dist/components/Badge/index.js +1 -1
  131. package/dist/components/BandEditor/index.js +1 -1
  132. package/dist/components/Button/index.js +1 -1
  133. package/dist/components/Callout/index.js +1 -1
  134. package/dist/components/Checkbox/index.js +1 -1
  135. package/dist/components/ColorField/index.js +1 -1
  136. package/dist/components/ComboBox/index.js +1 -1
  137. package/dist/components/CurveEditor/index.js +3 -3
  138. package/dist/components/DataGrid/index.js +1 -1
  139. package/dist/components/DetentSlider/index.js +1 -1
  140. package/dist/components/Dialog/index.js +1 -1
  141. package/dist/components/Disclosure/index.js +1 -1
  142. package/dist/components/Field/index.js +1 -1
  143. package/dist/components/FontFamilySelect/index.js +1 -1
  144. package/dist/components/GradientEditor/index.js +1 -1
  145. package/dist/components/Input/index.js +1 -1
  146. package/dist/components/ItemList/index.js +1 -1
  147. package/dist/components/Jog/index.js +1 -1
  148. package/dist/components/Keycaps/index.js +1 -1
  149. package/dist/components/LayerStack/index.js +1 -1
  150. package/dist/components/MenuButton/index.js +1 -1
  151. package/dist/components/MeshEditor/index.js +1 -1
  152. package/dist/components/NumberField/UnitField.d.ts +2 -1
  153. package/dist/components/NumberField/UnitField.d.ts.map +1 -1
  154. package/dist/components/NumberField/index.js +1 -1
  155. package/dist/components/OptionsBar/index.js +1 -1
  156. package/dist/components/PaintField/index.js +1 -1
  157. package/dist/components/PaintInput/index.js +1 -1
  158. package/dist/components/PatternPicker/index.js +1 -1
  159. package/dist/components/Plot2D/index.js +1 -1
  160. package/dist/components/PointPlotter/index.js +1 -1
  161. package/dist/components/Powerline/index.js +2 -2
  162. package/dist/components/Prefs/index.js +2 -2
  163. package/dist/components/Prefs/schema.d.ts +2 -1
  164. package/dist/components/Prefs/schema.d.ts.map +1 -1
  165. package/dist/components/Properties/PropertyGroup.d.ts +7 -1
  166. package/dist/components/Properties/PropertyGroup.d.ts.map +1 -1
  167. package/dist/components/Properties/PropertyPanel.d.ts +36 -38
  168. package/dist/components/Properties/PropertyPanel.d.ts.map +1 -1
  169. package/dist/components/Properties/index.d.ts +2 -4
  170. package/dist/components/Properties/index.d.ts.map +1 -1
  171. package/dist/components/Properties/index.js +2 -2
  172. package/dist/components/RadioGroup/index.js +1 -1
  173. package/dist/components/RangeSlider/index.js +1 -1
  174. package/dist/components/ResizeHandle/index.js +1 -1
  175. package/dist/components/Select/Select.d.ts +18 -0
  176. package/dist/components/Select/Select.d.ts.map +1 -1
  177. package/dist/components/Select/index.d.ts +1 -1
  178. package/dist/components/Select/index.d.ts.map +1 -1
  179. package/dist/components/Select/index.js +1 -1
  180. package/dist/components/SelectionPanel/SelectionPanel.d.ts +3 -50
  181. package/dist/components/SelectionPanel/SelectionPanel.d.ts.map +1 -1
  182. package/dist/components/SelectionPanel/index.js +3 -2
  183. package/dist/components/SelectionPanel/model.d.ts +4 -1
  184. package/dist/components/SelectionPanel/model.d.ts.map +1 -1
  185. package/dist/components/SelectionPanel/renderLeaf.d.ts +106 -0
  186. package/dist/components/SelectionPanel/renderLeaf.d.ts.map +1 -0
  187. package/dist/components/Sidebar/index.js +1 -1
  188. package/dist/components/SidebarPanel/index.js +1 -1
  189. package/dist/components/Slider/index.js +1 -1
  190. package/dist/components/StatusBar/index.js +1 -1
  191. package/dist/components/Switch/index.js +1 -1
  192. package/dist/components/Tabs/index.js +1 -1
  193. package/dist/components/Timeline/index.js +1 -1
  194. package/dist/components/Toast/index.js +1 -1
  195. package/dist/components/ToggleBar/index.js +1 -1
  196. package/dist/components/TokenPanel/TokenPanel.d.ts +10 -4
  197. package/dist/components/TokenPanel/TokenPanel.d.ts.map +1 -1
  198. package/dist/components/TokenPanel/index.d.ts +2 -2
  199. package/dist/components/TokenPanel/index.d.ts.map +1 -1
  200. package/dist/components/TokenPanel/index.js +2 -2
  201. package/dist/components/TokenPanel/tokenTypes.d.ts +24 -0
  202. package/dist/components/TokenPanel/tokenTypes.d.ts.map +1 -1
  203. package/dist/components/ToolButton/index.js +1 -1
  204. package/dist/components/ToolGroup/index.js +1 -1
  205. package/dist/components/ToolOptionsBar/ToolOptionsBar.d.ts +29 -18
  206. package/dist/components/ToolOptionsBar/ToolOptionsBar.d.ts.map +1 -1
  207. package/dist/components/ToolOptionsBar/index.js +1 -1
  208. package/dist/components/ToolPalette/ToolPalette.d.ts +5 -4
  209. package/dist/components/ToolPalette/ToolPalette.d.ts.map +1 -1
  210. package/dist/components/ToolPalette/index.js +1 -1
  211. package/dist/components/Tooltip/index.js +1 -1
  212. package/dist/format/number.d.ts +10 -1
  213. package/dist/format/number.d.ts.map +1 -1
  214. package/dist/icons/paths.d.ts +9 -1
  215. package/dist/icons/paths.d.ts.map +1 -1
  216. package/dist/index.js +69 -75
  217. package/dist/index.js.map +1 -1
  218. package/dist/style.css +1 -1
  219. package/dist/useRovingTabIndex.d.ts +7 -5
  220. package/dist/useRovingTabIndex.d.ts.map +1 -1
  221. package/package.json +8 -8
  222. package/dist/chunks/ActionBar-GZdcfdQL.js.map +0 -1
  223. package/dist/chunks/Badge-Bf8Rd1R6.js.map +0 -1
  224. package/dist/chunks/BandEditor-D8I5Uun-.js.map +0 -1
  225. package/dist/chunks/Button-CExdkQcU.js.map +0 -1
  226. package/dist/chunks/Callout-cx5_CWcW.js.map +0 -1
  227. package/dist/chunks/Checkbox-BZZsPaVF.js.map +0 -1
  228. package/dist/chunks/ColorField-YVf8irfr.js.map +0 -1
  229. package/dist/chunks/ComboBox-D57tNYDD.js.map +0 -1
  230. package/dist/chunks/DataGrid-BVdDMZkQ.js.map +0 -1
  231. package/dist/chunks/Dialog-DuOzsR2g.js.map +0 -1
  232. package/dist/chunks/Disclosure-9UgDzc7Z.js.map +0 -1
  233. package/dist/chunks/Field-BNqvUJfg.js.map +0 -1
  234. package/dist/chunks/GradientEditor-B_ymIr4Q.js.map +0 -1
  235. package/dist/chunks/Icon-QhLhaGFe.js.map +0 -1
  236. package/dist/chunks/Input-B9Vh7ASP.js.map +0 -1
  237. package/dist/chunks/ItemList-BZJQReXD.js.map +0 -1
  238. package/dist/chunks/Jog-BYrxbAQU.js.map +0 -1
  239. package/dist/chunks/LayerStack-DOylrQcm.js.map +0 -1
  240. package/dist/chunks/MenuButton-DGE-0DP0.js.map +0 -1
  241. package/dist/chunks/MeshEditor-CHoGQ9K8.js.map +0 -1
  242. package/dist/chunks/NumberField-CQzS6TjF.js.map +0 -1
  243. package/dist/chunks/PaintField-BVYMu3OI.js.map +0 -1
  244. package/dist/chunks/PaintInput-BzAHCKro.js.map +0 -1
  245. package/dist/chunks/PatternPicker-C4OryrYi.js.map +0 -1
  246. package/dist/chunks/Powerline-B_EH-7Z-.js.map +0 -1
  247. package/dist/chunks/Prefs-FuaJBs3t.js +0 -308
  248. package/dist/chunks/Prefs-FuaJBs3t.js.map +0 -1
  249. package/dist/chunks/Properties-B3KU69NI.js.map +0 -1
  250. package/dist/chunks/RadioGroup-C6xpdQNg.js.map +0 -1
  251. package/dist/chunks/RangeSlider-CzgeGLVS.js.map +0 -1
  252. package/dist/chunks/Select-BMYVh10x.js +0 -127
  253. package/dist/chunks/Select-BMYVh10x.js.map +0 -1
  254. package/dist/chunks/SelectionPanel-DTpcQidl.js +0 -572
  255. package/dist/chunks/SelectionPanel-DTpcQidl.js.map +0 -1
  256. package/dist/chunks/Sidebar-BlUjn8lD.js.map +0 -1
  257. package/dist/chunks/SidebarPanel-BqHfz6VK.js.map +0 -1
  258. package/dist/chunks/Slider-B2ywUZH6.js.map +0 -1
  259. package/dist/chunks/StatusBar-BFt7Yw5O.js.map +0 -1
  260. package/dist/chunks/Switch-Om3t3ASc.js.map +0 -1
  261. package/dist/chunks/Tabs-EAvYywil.js.map +0 -1
  262. package/dist/chunks/Timeline-BEyKaBXl.js.map +0 -1
  263. package/dist/chunks/Toast-iqLDD_XZ.js.map +0 -1
  264. package/dist/chunks/ToggleBar--9As2PWG.js.map +0 -1
  265. package/dist/chunks/TokenPanel-BL9hlq7x.js +0 -374
  266. package/dist/chunks/TokenPanel-BL9hlq7x.js.map +0 -1
  267. package/dist/chunks/ToolButton-Dd-1T5aX.js.map +0 -1
  268. package/dist/chunks/ToolGroup-BBI-W-Gm.js.map +0 -1
  269. package/dist/chunks/ToolOptionsBar-B2xPWzJf.js +0 -27
  270. package/dist/chunks/ToolOptionsBar-B2xPWzJf.js.map +0 -1
  271. package/dist/chunks/ToolPalette-BmTDDpmz.js.map +0 -1
  272. package/dist/chunks/Tooltip-BHre_vbI.js.map +0 -1
  273. package/dist/chunks/number-f6PydOZK.js +0 -52
  274. package/dist/chunks/number-f6PydOZK.js.map +0 -1
  275. package/dist/chunks/schema-MCVT1MLv.js.map +0 -1
  276. package/dist/chunks/segmentedControl.module-DmeUMYe3.js +0 -11
  277. package/dist/chunks/segmentedControl.module-DmeUMYe3.js.map +0 -1
  278. package/dist/components/Properties/PinDot.d.ts +0 -18
  279. package/dist/components/Properties/PinDot.d.ts.map +0 -1
@@ -1,4 +1,4 @@
1
- import { type TokenCategory, type TokenEntry } from './tokenTypes';
1
+ import { type TokenCategory, type TokenEntry, type TokenScale } from './tokenTypes';
2
2
  type OnChange = (name: string, value: string | null) => void;
3
3
  /** Props for `<TokenPanel>`. */
4
4
  export interface TokenPanelProps {
@@ -8,9 +8,13 @@ export interface TokenPanelProps {
8
8
  /** Sections held closed, by category. Omit to let the panel keep that state itself. */
9
9
  collapsed?: Readonly<Partial<Record<TokenCategory, boolean>>>;
10
10
  onCollapsedChange?: (category: TokenCategory, collapsed: boolean) => void;
11
+ /** Groups generated from a base, by group name. Such a group edits its base and rule above its steps. */
12
+ scales?: Readonly<Record<string, TokenScale>>;
13
+ /** A scale's new base or rule. The panel does not regenerate the steps; the consumer does, through `onChange`. */
14
+ onScaleChange?: (group: string, scale: TokenScale) => void;
11
15
  /** Files a token under a section. Defaults to `tokenCategory`. */
12
16
  categorize?: (token: TokenEntry) => TokenCategory;
13
- /** The fewest colors sharing a group that draw as one row of swatches. Default 3. */
17
+ /** The fewest colors, or sizes, sharing a group that draw as one row of swatches or one grid of steps. Default 3. */
14
18
  familySize?: number;
15
19
  /**
16
20
  * Row layout. `tight` puts a token on one line — name, control, Reset — with the
@@ -23,11 +27,13 @@ export interface TokenPanelProps {
23
27
  }
24
28
  /**
25
29
  * Edits a set of design tokens by type: collapsible sections by category, a
26
- * color group drawn as one row of swatches sized to fit, and a control for each
30
+ * color group drawn as one row of swatches sized to fit, a group of sizes drawn
31
+ * as one grid of numbers labeled by step — with its base and rule above it when
32
+ * `scales` says how it is generated — and a control for each
27
33
  * type — a number with its unit for dimensions and durations, the nine weights
28
34
  * for a font weight, a curve beside a `cubic-bezier()`, a swatch beside a color,
29
35
  * and text for everything else.
30
36
  */
31
- export declare function TokenPanel({ tokens, onChange, collapsed, onCollapsedChange, categorize, familySize, density, className, }: TokenPanelProps): import("react/jsx-runtime").JSX.Element;
37
+ export declare function TokenPanel({ tokens, onChange, collapsed, onCollapsedChange, scales, onScaleChange, categorize, familySize, density, className, }: TokenPanelProps): import("react/jsx-runtime").JSX.Element;
32
38
  export {};
33
39
  //# sourceMappingURL=TokenPanel.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"TokenPanel.d.ts","sourceRoot":"","sources":["../../../src/components/TokenPanel/TokenPanel.tsx"],"names":[],"mappings":"AAQA,OAAO,EAIL,KAAK,aAAa,EAClB,KAAK,UAAU,EAEhB,MAAM,cAAc,CAAC;AAEtB,KAAK,QAAQ,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;AAE7D,gCAAgC;AAChC,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,SAAS,UAAU,EAAE,CAAC;IAC9B,6HAA6H;IAC7H,QAAQ,EAAE,QAAQ,CAAC;IACnB,uFAAuF;IACvF,SAAS,CAAC,EAAE,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,aAAa,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC;IAC9D,iBAAiB,CAAC,EAAE,CAAC,QAAQ,EAAE,aAAa,EAAE,SAAS,EAAE,OAAO,KAAK,IAAI,CAAC;IAC1E,kEAAkE;IAClE,UAAU,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,aAAa,CAAC;IAClD,qFAAqF;IACrF,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;;;OAKG;IACH,OAAO,CAAC,EAAE,OAAO,GAAG,QAAQ,CAAC;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAgMD;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,EACzB,MAAM,EACN,QAAQ,EACR,SAAS,EACT,iBAAiB,EACjB,UAA0B,EAC1B,UAAc,EACd,OAAkB,EAClB,SAAS,GACV,EAAE,eAAe,2CAmCjB"}
1
+ {"version":3,"file":"TokenPanel.d.ts","sourceRoot":"","sources":["../../../src/components/TokenPanel/TokenPanel.tsx"],"names":[],"mappings":"AAWA,OAAO,EAKL,KAAK,aAAa,EAClB,KAAK,UAAU,EACf,KAAK,UAAU,EAGhB,MAAM,cAAc,CAAC;AAEtB,KAAK,QAAQ,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;AAE7D,gCAAgC;AAChC,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,SAAS,UAAU,EAAE,CAAC;IAC9B,6HAA6H;IAC7H,QAAQ,EAAE,QAAQ,CAAC;IACnB,uFAAuF;IACvF,SAAS,CAAC,EAAE,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,aAAa,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC;IAC9D,iBAAiB,CAAC,EAAE,CAAC,QAAQ,EAAE,aAAa,EAAE,SAAS,EAAE,OAAO,KAAK,IAAI,CAAC;IAC1E,yGAAyG;IACzG,MAAM,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC,CAAC;IAC9C,kHAAkH;IAClH,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,KAAK,IAAI,CAAC;IAC3D,kEAAkE;IAClE,UAAU,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,aAAa,CAAC;IAClD,qHAAqH;IACrH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;;;OAKG;IACH,OAAO,CAAC,EAAE,OAAO,GAAG,QAAQ,CAAC;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AA2aD;;;;;;;;GAQG;AACH,wBAAgB,UAAU,CAAC,EACzB,MAAM,EACN,QAAQ,EACR,SAAS,EACT,iBAAiB,EACjB,MAAM,EACN,aAAa,EACb,UAA0B,EAC1B,UAAc,EACd,OAAkB,EAClB,SAAS,GACV,EAAE,eAAe,2CAqCjB"}
@@ -1,5 +1,5 @@
1
1
  export { TokenPanel } from './TokenPanel';
2
2
  export type { TokenPanelProps } from './TokenPanel';
3
- export { inferTokenType, TOKEN_CATEGORIES, tokenCategory } from './tokenTypes';
4
- export type { TokenCategory, TokenEntry } from './tokenTypes';
3
+ export { inferTokenType, refitScale, TOKEN_CATEGORIES, tokenCategory } from './tokenTypes';
4
+ export type { TokenCategory, TokenEntry, TokenScale, TokenScaleRule } from './tokenTypes';
5
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/TokenPanel/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,YAAY,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC/E,YAAY,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/TokenPanel/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,YAAY,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC3F,YAAY,EAAE,aAAa,EAAE,UAAU,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC"}
@@ -1,2 +1,2 @@
1
- import { i as e, n as t, r as n, t as r } from "../../chunks/TokenPanel-BL9hlq7x.js";
2
- export { t as TOKEN_CATEGORIES, r as TokenPanel, n as inferTokenType, e as tokenCategory };
1
+ import { a as e, i as t, n, r, t as i } from "../../chunks/TokenPanel-BPHq24dc.js";
2
+ export { n as TOKEN_CATEGORIES, i as TokenPanel, r as inferTokenType, t as refitScale, e as tokenCategory };
@@ -11,6 +11,30 @@ export interface TokenEntry {
11
11
  overridden?: boolean;
12
12
  description?: string;
13
13
  }
14
+ /** How a scale's steps follow from its base: one multiplier per step, a constant ratio, or a constant step. */
15
+ export type TokenScaleRule = {
16
+ kind: 'factors';
17
+ factors: readonly number[];
18
+ } | {
19
+ kind: 'ratio';
20
+ ratio: number;
21
+ } | {
22
+ kind: 'step';
23
+ step: number;
24
+ };
25
+ /** A group whose steps are generated from a base, so the panel edits the base and the rule rather than each step. */
26
+ export interface TokenScale {
27
+ /** The generated tokens, smallest first. Anything else in the group draws as an ordinary step. */
28
+ tokens: readonly string[];
29
+ base: number;
30
+ rule: TokenScaleRule;
31
+ }
32
+ /**
33
+ * The same scale under another rule, fitted to the amounts its steps have now.
34
+ * A ratio or step counts from the first step, so switching to one moves the
35
+ * base there.
36
+ */
37
+ export declare function refitScale(scale: TokenScale, kind: TokenScaleRule['kind'], amounts: readonly number[]): TokenScale;
14
38
  export type TokenCategory = 'color' | 'type' | 'size' | 'motion' | 'depth' | 'other';
15
39
  /** The panel's sections, in the order it draws them. */
16
40
  export declare const TOKEN_CATEGORIES: readonly {
@@ -1 +1 @@
1
- {"version":3,"file":"tokenTypes.d.ts","sourceRoot":"","sources":["../../../src/components/TokenPanel/tokenTypes.ts"],"names":[],"mappings":"AAEA,+CAA+C;AAC/C,MAAM,WAAW,UAAU;IACzB,iDAAiD;IACjD,IAAI,EAAE,MAAM,CAAC;IACb,2EAA2E;IAC3E,IAAI,EAAE,MAAM,CAAC;IACb,oGAAoG;IACpG,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,qEAAqE;IACrE,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,MAAM,aAAa,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,QAAQ,GAAG,OAAO,GAAG,OAAO,CAAC;AAErF,wDAAwD;AACxD,eAAO,MAAM,gBAAgB,EAAE,SAAS;IAAE,EAAE,EAAE,aAAa,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,EAO3E,CAAC;AAIF,wGAAwG;AACxG,wBAAgB,aAAa,CAAC,KAAK,EAAE,UAAU,GAAG,aAAa,CAqB9D;AAyBD,qHAAqH;AACrH,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAWpD;AAED,kEAAkE;AAClE,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAGhF;AAED,mFAAmF;AACnF,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI,CAK5F"}
1
+ {"version":3,"file":"tokenTypes.d.ts","sourceRoot":"","sources":["../../../src/components/TokenPanel/tokenTypes.ts"],"names":[],"mappings":"AAEA,+CAA+C;AAC/C,MAAM,WAAW,UAAU;IACzB,iDAAiD;IACjD,IAAI,EAAE,MAAM,CAAC;IACb,2EAA2E;IAC3E,IAAI,EAAE,MAAM,CAAC;IACb,oGAAoG;IACpG,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,qEAAqE;IACrE,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,+GAA+G;AAC/G,MAAM,MAAM,cAAc,GACtB;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAA;CAAE,GAC/C;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GAChC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AAEnC,qHAAqH;AACrH,MAAM,WAAW,UAAU;IACzB,kGAAkG;IAClG,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,cAAc,CAAC;CACtB;AAID;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,cAAc,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,SAAS,MAAM,EAAE,GAAG,UAAU,CAYlH;AAED,MAAM,MAAM,aAAa,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,QAAQ,GAAG,OAAO,GAAG,OAAO,CAAC;AAErF,wDAAwD;AACxD,eAAO,MAAM,gBAAgB,EAAE,SAAS;IAAE,EAAE,EAAE,aAAa,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,EAO3E,CAAC;AAIF,wGAAwG;AACxG,wBAAgB,aAAa,CAAC,KAAK,EAAE,UAAU,GAAG,aAAa,CAqB9D;AAyBD,qHAAqH;AACrH,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAWpD;AAED,kEAAkE;AAClE,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAGhF;AAED,mFAAmF;AACnF,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI,CAK5F"}
@@ -1,2 +1,2 @@
1
- import { t as e } from "../../chunks/ToolButton-Dd-1T5aX.js";
1
+ import { t as e } from "../../chunks/ToolButton-9QzJCmuM.js";
2
2
  export { e as ToolButton };
@@ -1,2 +1,2 @@
1
- import { t as e } from "../../chunks/ToolGroup-BBI-W-Gm.js";
1
+ import { t as e } from "../../chunks/ToolGroup-BJiDrH_i.js";
2
2
  export { e as ToolGroup };
@@ -1,4 +1,6 @@
1
1
  import type { ReactNode } from 'react';
2
+ import type { ToolPrefGroup } from '@weasel-js/core';
3
+ import { type PropertyRenderer } from '../SelectionPanel/renderLeaf';
2
4
  /** Props for {@link ToolOptionsBar}. */
3
5
  export interface ToolOptionsBarProps {
4
6
  /**
@@ -12,34 +14,43 @@ export interface ToolOptionsBarProps {
12
14
  * toolbar", then "Text" again when browsing into the visible span).
13
15
  * `aria-labelledby` would avoid the echo at the cost of id plumbing and
14
16
  * an awkward no-`id`-to-point-at case when `label` is omitted. The
15
- * double-announcement is common enough for labelled landmark regions
17
+ * double-announcement is common enough for labeled landmark regions
16
18
  * that it's left as-is — considered, not missed.
17
19
  */
18
20
  label?: string;
21
+ /**
22
+ * The active tool's options. Leaves draw through the same leaf → control
23
+ * mapping `SelectionPanel` uses, so a kind gets its control decided in one
24
+ * place; groups organize without drawing, since the bar is one line.
25
+ */
26
+ schema?: ToolPrefGroup;
27
+ /** Each leaf's value, keyed by dotted path. A path with no entry is unset. */
28
+ values?: Readonly<Record<string, unknown>>;
29
+ /** A leaf edit, as the dotted path it was declared at and its new value. */
30
+ onChange?: (path: string, value: unknown) => void;
31
+ /** Paths whose sources disagree — drawn as the control's mixed state. */
32
+ mixed?: ReadonlySet<string>;
33
+ /** Control overrides, by dotted path or by leaf kind, as the panel takes. */
34
+ renderers?: Record<string, PropertyRenderer>;
19
35
  children?: ReactNode;
20
36
  className?: string;
21
37
  }
22
38
  /**
23
- * Horizontal strip reserved above the workspace for contextual tool
24
- * options — its first tenant is the character controls a text tool
25
- * exposes while a caret range is active. Pure chrome: it renders an
26
- * optional label and a children slot, nothing else. It knows nothing
27
- * about text, or about any specific tool — any tool can fill it.
39
+ * Horizontal strip reserved above the workspace for contextual tool options.
40
+ * Given a `schema` it draws the active tool's options itself; the children
41
+ * slot stays open for a tenant that is not a tool's options at all, such as
42
+ * loupe controls.
28
43
  *
29
- * The row always renders, even with no `label` and no `children`,
30
- * because the app reserves its height permanently rather than mounting
31
- * it on demand — mounting mid-edit would resize the workspace under a
32
- * canvas that's sized to the page.
44
+ * The row always renders, even empty, because the app reserves its height
45
+ * permanently rather than mounting it on demand — mounting mid-edit would
46
+ * resize the workspace under a canvas that's sized to the page.
33
47
  *
34
48
  * `role="toolbar"` without roving tabindex: the ARIA authoring practices
35
- * expect arrow-key roving focus across a toolbar's items, but this
36
- * component doesn't own or know the shape of its children — they're
37
- * arbitrary, possibly compound controls (`NumberField`, `Select`,
38
- * `ColorField`) that already use arrow keys for their own value editing.
39
- * Imposing roving focus here would fight those controls' own key
40
- * handling. Tab order falls back to normal DOM order for now; revisit
41
- * once the first tenant's control set is concrete and a roving-focus
42
- * contract can be designed in coordination with those controls.
49
+ * expect arrow-key roving focus across a toolbar's items, but a bar of
50
+ * compound controls (`NumberField`, `Select`, `ColorField`) must leave the
51
+ * arrow keys to them — they edit their own value with them. That is true of
52
+ * schema-drawn controls as much as of arbitrary children, so the bar keeps
53
+ * plain DOM tab order and `useRovingTabIndex` documents this as its opt-out.
43
54
  */
44
55
  export declare function ToolOptionsBar(props: ToolOptionsBarProps): import("react/jsx-runtime").JSX.Element;
45
56
  //# sourceMappingURL=ToolOptionsBar.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ToolOptionsBar.d.ts","sourceRoot":"","sources":["../../../src/components/ToolOptionsBar/ToolOptionsBar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvC,wCAAwC;AACxC,MAAM,WAAW,mBAAmB;IAClC;;;;;;;;;;;;;OAaG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,mBAAmB,2CASxD"}
1
+ {"version":3,"file":"ToolOptionsBar.d.ts","sourceRoot":"","sources":["../../../src/components/ToolOptionsBar/ToolOptionsBar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,aAAa,EAAgB,MAAM,iBAAiB,CAAC;AACnE,OAAO,EAKL,KAAK,gBAAgB,EACtB,MAAM,8BAA8B,CAAC;AAItC,wCAAwC;AACxC,MAAM,WAAW,mBAAmB;IAClC;;;;;;;;;;;;;OAaG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;;OAIG;IACH,MAAM,CAAC,EAAE,aAAa,CAAC;IACvB,8EAA8E;IAC9E,MAAM,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IAC3C,4EAA4E;IAC5E,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IAClD,yEAAyE;IACzE,KAAK,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAC5B,6EAA6E;IAC7E,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;IAC7C,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,mBAAmB,2CAsBxD"}
@@ -1,2 +1,2 @@
1
- import { t as e } from "../../chunks/ToolOptionsBar-B2xPWzJf.js";
1
+ import { t as e } from "../../chunks/ToolOptionsBar-CAM6RcUH.js";
2
2
  export { e as ToolOptionsBar };
@@ -11,10 +11,11 @@ export interface ToolPaletteProps {
11
11
  * omitted, falls back to `tool.keybinding` (legacy path). */
12
12
  lookupShortcut?: (toolId: string) => ShortcutInput | undefined;
13
13
  /**
14
- * Optional mode registry. When provided, tools whose `capabilities` do not
15
- * match the current mode are rendered greyed-out, aria-disabled, and their
16
- * onClick is suppressed. When omitted, all tools are treated as eligible
17
- * (preserves existing behaviour in consumers that haven't wired a registry).
14
+ * Optional mode registry. When provided, tools whose
15
+ * `eligibility.capabilities` do not match the current mode are rendered
16
+ * greyed-out, aria-disabled, and their onClick is suppressed. When omitted,
17
+ * all tools are treated as eligible (preserves existing behavior in
18
+ * consumers that haven't wired a registry).
18
19
  */
19
20
  modeRegistry?: ModeRegistry;
20
21
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"ToolPalette.d.ts","sourceRoot":"","sources":["../../../src/components/ToolPalette/ToolPalette.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAW,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,EAAwB,KAAK,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAK3E,OAAO,EAAkB,KAAK,aAAa,EAAE,MAAM,kBAAkB,CAAC;AA8CtE,qCAAqC;AACrC,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,QAAQ,CAAC;IAChB,WAAW,CAAC,EAAE,UAAU,GAAG,YAAY,CAAC;IACxC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;kEAE8D;IAC9D,cAAc,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,aAAa,GAAG,SAAS,CAAC;IAC/D;;;;;OAKG;IACH,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B;;;;OAIG;IACH,UAAU,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CAChC;AAED;;;;;;;GAOG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,gBAAgB,2CA0ElD"}
1
+ {"version":3,"file":"ToolPalette.d.ts","sourceRoot":"","sources":["../../../src/components/ToolPalette/ToolPalette.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAW,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,EAAwB,KAAK,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAK3E,OAAO,EAAkB,KAAK,aAAa,EAAE,MAAM,kBAAkB,CAAC;AA8CtE,qCAAqC;AACrC,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,QAAQ,CAAC;IAChB,WAAW,CAAC,EAAE,UAAU,GAAG,YAAY,CAAC;IACxC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;kEAE8D;IAC9D,cAAc,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,aAAa,GAAG,SAAS,CAAC;IAC/D;;;;;;OAMG;IACH,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B;;;;OAIG;IACH,UAAU,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CAChC;AAED;;;;;;;GAOG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,gBAAgB,2CA0ElD"}
@@ -1,2 +1,2 @@
1
- import { n as e, r as t, t as n } from "../../chunks/ToolPalette-BmTDDpmz.js";
1
+ import { n as e, r as t, t as n } from "../../chunks/ToolPalette-DGkKwE7D.js";
2
2
  export { n as ToolPalette, e as formatShortcut, t as formatShortcutParts };
@@ -1,2 +1,2 @@
1
- import { n as e, t } from "../../chunks/Tooltip-BHre_vbI.js";
1
+ import { n as e, t } from "../../chunks/Tooltip-C4YBczLq.js";
2
2
  export { t as Tooltip, e as TooltipTrigger };
@@ -35,7 +35,16 @@ export declare function formatCompact(value: number, decimals?: number): string;
35
35
  * name is read first: the longest match wins, exact case before any case, and
36
36
  * a unit beats a magnitude suffix, so with `m` accepted `2m` is `2 * units.m`.
37
37
  */
38
- export declare function parseNumber(text: string, units?: Readonly<Record<string, number>>): number;
38
+ export declare function parseNumber(text: string, units?: Readonly<UnitTable>): number;
39
+ /** One unit's conversion into the shown unit: a bare factor, or a scale that
40
+ * also moves zero. Structurally the kit's `UnitEntry`, kept local so this
41
+ * formatting helper stays free of the scene vocabulary. */
42
+ export type UnitTableEntry = number | {
43
+ factor: number;
44
+ offset?: number;
45
+ };
46
+ /** Suffixes a person may type, each mapped to its conversion. */
47
+ export type UnitTable = Record<string, UnitTableEntry>;
39
48
  /**
40
49
  * Formats a zoom factor for display. Below 2x a percentage reads naturally;
41
50
  * past it the numbers get long and a multiplier is what people say out loud,
@@ -1 +1 @@
1
- {"version":3,"file":"number.d.ts","sourceRoot":"","sources":["../../src/format/number.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,eAAO,MAAM,UAAU,WAAM,CAAC;AAE9B;;;GAGG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,IAAI,CAAC,mBAAmB,GAAG,MAAM,CAKtF;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEtD;AAKD;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,SAAI,GAAG,MAAM,CAOjE;AAED;;;;;;;;GAQG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,GAAG,MAAM,CAkB1F;AAeD;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAK/C"}
1
+ {"version":3,"file":"number.d.ts","sourceRoot":"","sources":["../../src/format/number.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,eAAO,MAAM,UAAU,WAAM,CAAC;AAE9B;;;GAGG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,IAAI,CAAC,mBAAmB,GAAG,MAAM,CAKtF;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEtD;AAKD;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,SAAI,GAAG,MAAM,CAOjE;AAED;;;;;;;;GAQG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,QAAQ,CAAC,SAAS,CAAC,GAAG,MAAM,CAkB7E;AAED;;4DAE4D;AAC5D,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAC1E,iEAAiE;AACjE,MAAM,MAAM,SAAS,GAAG,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC;AAoEvD;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAK/C"}
@@ -1,7 +1,7 @@
1
1
  export declare const ICON_PATHS: {
2
2
  readonly clone: "<path d=\"M7 7.4V4.6A1.6 1.6 0 0 1 8.6 3h6.8A1.6 1.6 0 0 1 17 4.6v6.8a1.6 1.6 0 0 1-1.6 1.6H12.6\" stroke-linecap=\"butt\"/><rect x=\"3\" y=\"7\" width=\"10\" height=\"10\" rx=\"1.6\"/><path d=\"M5.7 10.8h4.6M5.7 13.4h3\" stroke-width=\"1\"/>";
3
3
  readonly reset: "<path d=\"M7.28 4.88A5.8 5.8 0 1 0 12.72 4.88\"/><path d=\"M13.81 7.57 12.72 4.88 15.56 4.28\"/>";
4
- readonly close: "<path d=\"M5 5 15 15M15 5 5 15\" stroke-width=\"1.75\"/>";
4
+ readonly close: "<path d=\"M4.5 4.5 15.5 15.5M15.5 4.5 4.5 15.5\" stroke-width=\"1.75\"/>";
5
5
  readonly export: "<path d=\"M4 12.6v2.9A1.5 1.5 0 0 0 5.5 17h9a1.5 1.5 0 0 0 1.5-1.5v-2.9\"/><path d=\"M10 3.2v8.5\"/><path d=\"M11.7 9.35 10 11.7 8.3 9.35\"/><path d=\"M6.8 14.7h6.4\" stroke-width=\"1\"/>";
6
6
  readonly zoomIn: "<circle cx=\"9\" cy=\"9\" r=\"5.4\"/><path d=\"M12.82 12.82 16.9 16.9\"/><path d=\"M9 6.7v4.6M6.7 9h4.6\"/>";
7
7
  readonly zoomOut: "<circle cx=\"9\" cy=\"9\" r=\"5.4\"/><path d=\"M12.82 12.82 16.9 16.9\"/><path d=\"M6.7 9h4.6\"/>";
@@ -15,6 +15,14 @@ export declare const ICON_PATHS: {
15
15
  readonly undo: "<path d=\"M4.4 8.4h6.8a3.6 3.6 0 0 1 0 7.2H8.6\"/><path d=\"M6.47 10.14 4.4 8.4 6.47 6.66\"/>";
16
16
  readonly redo: "<path d=\"M15.6 8.4H8.8a3.6 3.6 0 0 0 0 7.2H11.4\"/><path d=\"M13.53 6.66 15.6 8.4 13.53 10.14\"/>";
17
17
  readonly snapshot: "<path d=\"M3.8 8.3A1.4 1.4 0 0 1 5.2 6.9h1.9L8 5.1h4l.9 1.8h1.9A1.4 1.4 0 0 1 16.2 8.3v6A1.4 1.4 0 0 1 14.8 15.7H5.2A1.4 1.4 0 0 1 3.8 14.3z\"/><circle cx=\"10\" cy=\"11\" r=\"2.75\"/>";
18
+ readonly bold: "<path d=\"M6 3.5h4.6a3.1 3.1 0 0 1 0 6.2H6zM6 9.7h5.4a3.4 3.4 0 0 1 0 6.8H6z\" stroke-width=\"2.1\"/>";
19
+ readonly italic: "<path d=\"M9 3.5h6M5 16.5h6M12.5 3.5 7.5 16.5\"/>";
20
+ readonly underline: "<path d=\"M6 3.4v5.6a4 4 0 0 0 8 0V3.4\"/><path d=\"M4.6 17h10.8\"/>";
21
+ readonly strikethrough: "<path d=\"M14.4 5.8c-.9-1.6-2.4-2.4-4.4-2.4-2.5 0-4.2 1.3-4.2 3.1 0 .9.4 1.6 1.2 2.2\"/><path d=\"M5.6 14.2c.9 1.6 2.4 2.4 4.4 2.4 2.5 0 4.2-1.3 4.2-3.1 0-.9-.4-1.6-1.2-2.2\"/><path d=\"M3.4 10h13.2\"/>";
22
+ readonly overline: "<path d=\"M4.6 3h10.8\"/><ellipse cx=\"10\" cy=\"11.4\" rx=\"4.4\" ry=\"4.8\"/>";
23
+ readonly superscript: "<path d=\"M3.6 8.6 10.4 16.4M10.4 8.6 3.6 16.4\"/><path d=\"M11.9 5.3a2.2 2.2 0 1 1 4.3.8c0 1.4-4.3 2.2-4.3 3.5h4.5\"/>";
24
+ readonly subscript: "<path d=\"M3.6 3.6 10.4 11.4M10.4 3.6 3.6 11.4\"/><path d=\"M11.9 11.5a2.2 2.2 0 1 1 4.3.8c0 1.4-4.3 2.2-4.3 3.5h4.5\"/>";
25
+ readonly code: "<path d=\"M7 6.2 3.2 10 7 13.8M13 6.2 16.8 10 13 13.8\"/><path d=\"M11.2 4.8 8.8 15.2\"/>";
18
26
  readonly play: "<path d=\"M7.6 5.2 15.6 10 7.6 14.8Z\"/>";
19
27
  readonly pause: "<path d=\"M7.8 5.2v9.6M12.2 5.2v9.6\"/>";
20
28
  readonly stop: "<rect x=\"5.6\" y=\"5.6\" width=\"8.8\" height=\"8.8\" rx=\"1.4\"/>";
@@ -1 +1 @@
1
- {"version":3,"file":"paths.d.ts","sourceRoot":"","sources":["../../src/icons/paths.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+Nb,CAAC;AAEX,mCAAmC;AACnC,MAAM,MAAM,QAAQ,GAAG,MAAM,OAAO,UAAU,CAAC;AAE/C;;;qEAGqE;AACrE,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoHb,CAAC;AAEX,4CAA4C;AAC5C,MAAM,MAAM,gBAAgB,GAAG,MAAM,OAAO,UAAU,CAAC;AAEvD,mFAAmF;AACnF,eAAO,MAAM,WAAW,EAAE,SAAS;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,SAAS,QAAQ,EAAE,CAAA;CAAE,EAgQ/E,CAAC"}
1
+ {"version":3,"file":"paths.d.ts","sourceRoot":"","sources":["../../src/icons/paths.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyOb,CAAC;AAEX,mCAAmC;AACnC,MAAM,MAAM,QAAQ,GAAG,MAAM,OAAO,UAAU,CAAC;AAE/C;;;qEAGqE;AACrE,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoHb,CAAC;AAEX,4CAA4C;AAC5C,MAAM,MAAM,gBAAgB,GAAG,MAAM,OAAO,UAAU,CAAC;AAEvD,mFAAmF;AACnF,eAAO,MAAM,WAAW,EAAE,SAAS;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,SAAS,QAAQ,EAAE,CAAA;CAAE,EA6Q/E,CAAC"}
package/dist/index.js CHANGED
@@ -1,90 +1,84 @@
1
1
  import { n as e, t } from "./chunks/dlog-CMYiRF3Q.js";
2
- import { a as n, i as r, n as i, r as a, t as o } from "./chunks/Icon-QhLhaGFe.js";
3
- import { $ as s, A as c, B as l, C as u, D as d, E as f, F as p, G as m, H as ee, I as te, J as ne, K as re, L as ie, M as h, N as g, O as _, P as v, Q as y, R as b, S as x, T as S, U as C, V as w, W as T, X as E, Y as D, Z as O, _ as k, a as A, at as j, b as M, c as N, ct as P, d as F, dt as I, et as L, f as R, ft as z, g as B, h as V, i as H, it as U, j as W, k as G, l as K, lt as q, m as J, mt as Y, n as ae, nt as oe, o as se, ot as ce, p as le, pt as ue, q as de, r as fe, rt as pe, s as me, st as he, t as ge, tt as _e, u as ve, ut as ye, v as be, w as xe, x as Se, y as Ce, z as we } from "./chunks/icons-Btrs-JD7.js";
4
- import { i as Te, n as Ee, r as De, t as Oe } from "./chunks/Prefs-FuaJBs3t.js";
2
+ import { a as n, i as r, n as i, r as a, t as o } from "./chunks/Icon-DT0x6HaQ.js";
3
+ import { $ as s, A as c, B as l, C as u, D as d, E as f, F as p, G as m, H as ee, I as te, J as ne, K as re, L as ie, M as h, N as g, O as _, P as v, Q as y, R as b, S as x, T as S, U as C, V as w, W as T, X as E, Y as D, Z as O, _ as k, a as A, at as j, b as M, c as N, ct as P, d as F, dt as I, et as L, f as R, ft as z, g as B, h as V, i as H, it as U, j as W, k as G, l as K, lt as q, m as J, mt as Y, n as ae, nt as oe, o as se, ot as ce, p as le, pt as ue, q as de, r as fe, rt as pe, s as me, st as he, t as ge, tt as _e, u as ve, ut as ye, v as be, w as xe, x as Se, y as Ce, z as we } from "./chunks/icons-DFLytcui.js";
4
+ import { i as Te, n as Ee, r as De, t as Oe } from "./chunks/Prefs-CNC8tzyN.js";
5
5
  import { n as ke, r as Ae, t as je } from "./chunks/portalHost-CjpCnuGU.js";
6
- import { n as Me, t as Ne } from "./chunks/Tooltip-BHre_vbI.js";
7
- import { t as Pe } from "./chunks/ActionBar-GZdcfdQL.js";
8
- import { n as Fe, t as Ie } from "./chunks/Badge-Bf8Rd1R6.js";
6
+ import { n as Me, t as Ne } from "./chunks/Tooltip-C4YBczLq.js";
7
+ import { t as Pe } from "./chunks/ActionBar-CLwiY3Jg.js";
8
+ import { n as Fe, t as Ie } from "./chunks/Badge-CW9pBPFl.js";
9
9
  import "./components/Badge/index.js";
10
- import { t as Le } from "./chunks/Button-CExdkQcU.js";
10
+ import { t as Le } from "./chunks/Button-DRSApvnK.js";
11
11
  import { t as Re } from "./chunks/useReorderDragList-CSQGd7zQ.js";
12
- import { t as ze } from "./chunks/DataGrid-BVdDMZkQ.js";
13
- import { n as Be, t as Ve } from "./chunks/Disclosure-9UgDzc7Z.js";
12
+ import { t as ze } from "./chunks/DataGrid-C8KrYtw7.js";
13
+ import { n as Be, t as Ve } from "./chunks/Disclosure-CILDfWsU.js";
14
14
  import { t as He } from "./chunks/DragHandleGlyph-CppAz4_8.js";
15
- import { a as Ue, i as We, n as Ge, o as Ke, r as qe, t as Je } from "./chunks/Keycaps-CGNQV2Pz.js";
15
+ import { a as Ue, i as We, n as Ge, o as Ke, r as qe, t as Je } from "./chunks/Keycaps-DunVpejA.js";
16
16
  import { t as Ye } from "./chunks/keyGlyph-Bp0wnLHn.js";
17
- import { t as Xe } from "./chunks/LayerStack-DOylrQcm.js";
18
- import { t as Ze } from "./chunks/Slider-B2ywUZH6.js";
19
- import { a as Qe, i as $e, n as et, o as tt, r as nt, t as rt } from "./chunks/number-f6PydOZK.js";
20
- import { t as it } from "./chunks/ItemList-BZJQReXD.js";
21
- import { t as at } from "./chunks/ToggleBar--9As2PWG.js";
17
+ import { t as Xe } from "./chunks/LayerStack-CfQ6GsRz.js";
18
+ import { t as Ze } from "./chunks/Slider-CIIrqiFS.js";
19
+ import { a as Qe, i as $e, n as et, o as tt, r as nt, t as rt } from "./chunks/number-BHz66zQO.js";
20
+ import { t as it } from "./chunks/ItemList-B9zYb0GE.js";
21
+ import { t as at } from "./chunks/ToggleBar-CClus5Cd.js";
22
22
  import { t as ot } from "./chunks/useRovingTabIndex-Dkpf_KhN.js";
23
- import { t as st } from "./chunks/OptionsBar-BWaYG_OH.js";
24
- import { t as ct } from "./chunks/ActionsBar-Fhx_40iP.js";
25
- import { t as lt } from "./chunks/ToolOptionsBar-B2xPWzJf.js";
26
- import { t as ut } from "./chunks/InlineRange-DdIlfGqG.js";
27
- import { t as dt } from "./chunks/ColorField-YVf8irfr.js";
28
- import { i as ft, n as pt, r as mt, t as ht } from "./chunks/GradientEditor-B_ymIr4Q.js";
29
- import { n as gt, r as _t, t as vt } from "./chunks/MeshEditor-CHoGQ9K8.js";
30
- import { n as yt, t as bt } from "./chunks/PatternPicker-C4OryrYi.js";
31
- import { t as xt } from "./chunks/PaintInput-BzAHCKro.js";
32
- import { t as St } from "./chunks/PaintField-BVYMu3OI.js";
33
- import { t as Ct } from "./chunks/Powerline-B_EH-7Z-.js";
34
- import { t as wt } from "./chunks/Checkbox-BZZsPaVF.js";
35
- import { n as Tt, t as Et } from "./chunks/Field-BNqvUJfg.js";
36
- import { n as Dt, t as Ot } from "./chunks/Select-BMYVh10x.js";
37
- import { t as kt } from "./chunks/FontFamilySelect-CO19kyOO.js";
38
- import { t as At } from "./chunks/Input-B9Vh7ASP.js";
39
- import { n as jt, t as Mt } from "./chunks/NumberField-CQzS6TjF.js";
40
- import { n as Nt, t as Pt } from "./chunks/RadioGroup-C6xpdQNg.js";
41
- import { t as Ft } from "./chunks/RangeSlider-CzgeGLVS.js";
42
- import { t as It } from "./chunks/Switch-Om3t3ASc.js";
43
- import { a as Lt, i as Rt, n as zt, t as Bt } from "./chunks/schema-MCVT1MLv.js";
44
- import { t as Vt } from "./chunks/Dialog-DuOzsR2g.js";
45
- import { a as Ht, c as Ut, i as Wt, n as Gt, o as Kt, r as qt, s as Jt, t as Yt } from "./chunks/Plot2D-Czvyt_vG.js";
46
- import { a as Xt, i as Zt, n as Qt, r as $t, t as en } from "./chunks/CurveEditor-BXiMoN9d.js";
47
- import { c as tn, i as nn, n as rn, o as an, r as on, s as sn, t as cn } from "./chunks/createKeyframeLayer-7j7ukrSx.js";
48
- import { t as ln } from "./chunks/snap-B0WQwetQ.js";
49
- import { _ as un, a as dn, c as fn, d as pn, f as mn, g as hn, h as gn, i as _n, l as vn, m as yn, n as bn, o as xn, p as Sn, r as Cn, s as wn, t as Tn, u as En, v as Dn } from "./chunks/Properties-B3KU69NI.js";
50
- import { a as On, c as kn, i as An, n as jn, o as Mn, r as Nn, s as Pn, t as Fn } from "./chunks/SelectionPanel-DTpcQidl.js";
51
- import { t as In } from "./chunks/ResizeHandle-1Ey8AOij.js";
52
- import { t as Ln } from "./chunks/Sidebar-BlUjn8lD.js";
53
- import { t as Rn } from "./chunks/SidebarPanel-BqHfz6VK.js";
54
- import { n as zn, r as Bn, t as Vn } from "./chunks/StatusBar-BFt7Yw5O.js";
55
- import { t as Hn } from "./chunks/ToolButton-Dd-1T5aX.js";
56
- import { t as Un } from "./chunks/ToolGroup-BBI-W-Gm.js";
57
- import { n as Wn, r as Gn, t as Kn } from "./chunks/ToolPalette-BmTDDpmz.js";
23
+ import { t as st } from "./chunks/OptionsBar-DeQ-vUeZ.js";
24
+ import { t as ct } from "./chunks/ActionsBar-D84a4eGy.js";
25
+ import { a as lt, i as ut, n as dt, t as ft } from "./chunks/schema-Dft4Cu2p.js";
26
+ import { t as pt } from "./chunks/InlineRange-DdIlfGqG.js";
27
+ import { t as mt } from "./chunks/ColorField-BYzgZM9o.js";
28
+ import { n as ht, t as gt } from "./chunks/Field-DWnV8WZY.js";
29
+ import { n as _t, t as vt } from "./chunks/Select-BEope086.js";
30
+ import { t as yt } from "./chunks/FontFamilySelect-DxfgTC3G.js";
31
+ import { i as bt, n as xt, r as St, t as Ct } from "./chunks/GradientEditor-rRBmf3G0.js";
32
+ import { n as wt, r as Tt, t as Et } from "./chunks/MeshEditor-Bipz-Ocl.js";
33
+ import { n as Dt, t as Ot } from "./chunks/PatternPicker-BMpXWboq.js";
34
+ import { t as kt } from "./chunks/PaintInput-Qs7Rul5R.js";
35
+ import { t as At } from "./chunks/Input-DbMKpkXy.js";
36
+ import { n as jt, t as Mt } from "./chunks/NumberField-CCjEDZCg.js";
37
+ import { t as Nt } from "./chunks/Switch-DH5POG0T.js";
38
+ import { i as Pt, l as Ft, n as It, o as Lt, r as Rt, s as zt, t as Bt } from "./chunks/model-13kZ_-mE.js";
39
+ import { t as Vt } from "./chunks/ToolOptionsBar-CAM6RcUH.js";
40
+ import { t as Ht } from "./chunks/PaintField-jBOJ32rL.js";
41
+ import { t as Ut } from "./chunks/Powerline-Ak5AWUlK.js";
42
+ import { t as Wt } from "./chunks/Checkbox-BOsDAY2F.js";
43
+ import { n as Gt, t as Kt } from "./chunks/RadioGroup-CsVp3SEu.js";
44
+ import { t as qt } from "./chunks/RangeSlider-DNr-pJpZ.js";
45
+ import { t as Jt } from "./chunks/Dialog-fGqqQ6o_.js";
46
+ import { a as Yt, c as Xt, i as Zt, n as Qt, o as $t, r as en, s as tn, t as nn } from "./chunks/Plot2D-CXf_f7QD.js";
47
+ import { a as rn, i as an, n as on, r as sn, t as cn } from "./chunks/CurveEditor-DXwSP-iA.js";
48
+ import { c as ln, i as un, n as dn, o as fn, r as pn, s as mn, t as hn } from "./chunks/createKeyframeLayer-DKtO0Sw_.js";
49
+ import { t as gn } from "./chunks/snap-CEjuWOhN.js";
50
+ import { _ as _n, a as vn, c as yn, d as bn, f as xn, g as Sn, h as Cn, i as wn, l as Tn, m as En, n as Dn, o as On, p as kn, r as An, s as jn, t as Mn, u as Nn, v as Pn } from "./chunks/Properties-Rnb6TAbN.js";
51
+ import { t as Fn } from "./chunks/SelectionPanel-CEbLS-0D.js";
52
+ import { t as In } from "./chunks/ResizeHandle-RXFf5fXr.js";
53
+ import { t as Ln } from "./chunks/Sidebar-qn_oSCNX.js";
54
+ import { t as Rn } from "./chunks/SidebarPanel-Bs6V21hg.js";
55
+ import { n as zn, r as Bn, t as Vn } from "./chunks/StatusBar-B4L15DSm.js";
56
+ import { t as Hn } from "./chunks/ToolButton-9QzJCmuM.js";
57
+ import { t as Un } from "./chunks/ToolGroup-BJiDrH_i.js";
58
+ import { n as Wn, r as Gn, t as Kn } from "./chunks/ToolPalette-DGkKwE7D.js";
58
59
  import "./components/Field/index.js";
59
- import { i as qn, n as Jn, r as Yn, t as Xn } from "./chunks/Tabs-EAvYywil.js";
60
- import { t as Zn } from "./chunks/MenuButton-DGE-0DP0.js";
61
- import { n as Qn, t as $n } from "./chunks/ComboBox-D57tNYDD.js";
62
- import { t as er } from "./chunks/DetentSlider-BWNSv07Z.js";
63
- import { n as tr, t as nr } from "./chunks/Callout-cx5_CWcW.js";
64
- import { a as rr, i as ir, n as ar, r as or, t as sr } from "./chunks/Toast-iqLDD_XZ.js";
65
- import { t as cr } from "./chunks/PointPlotter-Xvb98GwB.js";
66
- import { i as lr, n as ur, r as X, t as dr } from "./chunks/TokenPanel-BL9hlq7x.js";
67
- import { n as fr, r as pr, t as mr } from "./chunks/BandEditor-D8I5Uun-.js";
68
- import { t as hr } from "./chunks/Jog-BYrxbAQU.js";
69
- import { a as gr, c as _r, i as vr, l as yr, n as br, o as xr, r as Sr, s as Cr, t as wr } from "./chunks/Timeline-BEyKaBXl.js";
70
- import { oklabToSrgbU8 as Tr, oklchToOklab as Er, rgbaToHex as Dr } from "@weasel-js/core";
71
- import { useCallback as Or, useEffect as Z, useRef as Q, useState as $ } from "react";
60
+ import { i as qn, n as Jn, r as Yn, t as Xn } from "./chunks/Tabs-BFHikpml.js";
61
+ import { t as Zn } from "./chunks/MenuButton-C_4nox39.js";
62
+ import { n as Qn, t as $n } from "./chunks/ComboBox-Cz3f0Y_8.js";
63
+ import { t as er } from "./chunks/DetentSlider-CAubVX0J.js";
64
+ import { n as tr, t as nr } from "./chunks/Callout-DrNu-9Qr.js";
65
+ import { a as rr, i as ir, n as ar, r as or, t as sr } from "./chunks/Toast-CI1UDuK6.js";
66
+ import { t as cr } from "./chunks/PointPlotter-S_gz7VYt.js";
67
+ import { a as lr, i as ur, n as X, r as dr, t as fr } from "./chunks/TokenPanel-BPHq24dc.js";
68
+ import { n as pr, r as mr, t as hr } from "./chunks/BandEditor-jY-PFKY6.js";
69
+ import { t as gr } from "./chunks/Jog-DkkTlL3_.js";
70
+ import { a as _r, c as vr, i as yr, l as br, n as xr, o as Sr, r as Cr, s as wr, t as Tr } from "./chunks/Timeline-DNKY_yiK.js";
71
+ import { oklchDegToHex as Er } from "@weasel-js/core";
72
+ import { useCallback as Dr, useEffect as Z, useRef as Q, useState as $ } from "react";
72
73
  //#region src/color/oklch.ts
73
- function kr(e, t, n) {
74
- let [r, i, a] = Er(e, t, n * Math.PI / 180), [o, s, c] = Tr(r, i, a);
75
- return Dr([
76
- o / 255,
77
- s / 255,
78
- c / 255
79
- ]);
80
- }
81
- function Ar(e, t) {
74
+ var Or = Er;
75
+ function kr(e, t) {
82
76
  let [n, r] = t.lRange;
83
77
  return e <= n ? t.cBot : e >= r ? t.cTop : e <= t.midL ? t.cBot + (t.cPeak - t.cBot) * ((e - n) / (t.midL - n)) : t.cPeak + (t.cTop - t.cPeak) * ((e - t.midL) / (r - t.midL));
84
78
  }
85
79
  //#endregion
86
80
  //#region src/useAsyncOptions.ts
87
- function jr({ load: e, debounceMs: t = 150, minLength: n = 0 }) {
81
+ function Ar({ load: e, debounceMs: t = 150, minLength: n = 0 }) {
88
82
  let [r, i] = $(""), [a, o] = $([]), [s, c] = $(!1), [l, u] = $(null), d = Q(e);
89
83
  d.current = e;
90
84
  let f = Q(0), p = Q(0), m = Q(null);
@@ -111,10 +105,10 @@ function jr({ load: e, debounceMs: t = 150, minLength: n = 0 }) {
111
105
  isLoading: s,
112
106
  loadError: l,
113
107
  inputValue: r,
114
- onInputChange: Or((e) => i(e), [])
108
+ onInputChange: Dr((e) => i(e), [])
115
109
  };
116
110
  }
117
111
  //#endregion
118
- export { Pe as ActionBar, ct as ActionsBar, ge as AddIcon, wr as AnimatedTimeline, ae as ArrowIcon, Ie as Badge, mr as BandEditor, fe as BusyIcon, Le as Button, nr as Callout, tr as CalloutTrigger, wt as Checkbox, dn as CheckboxRow, H as ChevronIcon, A as CloneIcon, se as CloseIcon, me as CollapseIcon, dt as ColorField, xn as ColorRow, $n as ComboBox, Qn as ComboBoxItem, N as CompareIcon, K as CrosshairIcon, Qt as CurveEditor, Dn as CurveField, ze as DataGrid, ve as DeleteIcon, er as DetentSlider, Vt as Dialog, Ve as Disclosure, Be as DisclosureRow, He as DragHandleGlyph, xr as EASING_NAMES, Fe as EDGE_PROFILES, gr as EasingPicker, bn as EffectCard, Cn as EffectCardList, F as EllipseIcon, R as ErrorIcon, le as ExpandIcon, J as ExportIcon, V as EyedropperIcon, Et as Field, B as FilterIcon, k as FitIcon, kt as FontFamilySelect, be as FullscreenIcon, mt as GradientEditor, pt as GradientHandles, Ce as GridIcon, an as HANDLE_SIZE_TOKENS, M as HandIcon, Se as HiddenIcon, a as ICON_FILLS, r as ICON_GROUPS, n as ICON_PATHS, o as Icon, x as ImageIcon, u as InfoIcon, ut as InlineRange, At as Input, it as ItemList, hr as Jog, Ue as KeyCap, We as KeySequence, xe as LassoIcon, Xe as LayerStack, nn as LayeredCurveEditor, S as LayersIcon, f as LayoutColumnsIcon, d as LayoutGridIcon, _ as LayoutRowsIcon, G as LineIcon, c as LinkIcon, W as LockIcon, h as LoupeIcon, rt as MINUS_SIGN, jn as MIXED, g as MeasureIcon, Zn as MenuButton, vt as MeshEditor, v as ModeAutoIcon, p as ModeDarkIcon, te as ModeLightIcon, jt as NumberField, wn as NumberRow, st as OptionsBar, je as OverlayPortalProvider, St as PaintField, xt as PaintInput, ie as PanIcon, bt as PatternPicker, b as PauseIcon, we as PenIcon, l as PencilIcon, un as PinDot, w as PinIcon, ee as PlayIcon, Yt as Plot2D, cr as PointPlotter, C as PolygonIcon, Ct as Powerline, Oe as PrefsDialog, Ee as PrefsForm, Tn as PropertyGroup, fn as PropertyList, vn as PropertyPanel, En as PropertyRow, pn as PropertySpan, Pt as Radio, Nt as RadioGroup, T as RandomizeIcon, Ft as RangeSlider, m as RectIcon, re as RedoIcon, de as RefreshIcon, ne as RemoveIcon, D as ResetIcon, In as ResizeHandle, ht as SceneGradientHandles, E as SearchIcon, Ot as Select, O as SelectIcon, Dt as SelectItem, mn as SelectRow, Fn as SelectionPanel, Ln as Sidebar, Rn as SidebarPanel, Ze as Slider, Sn as SliderRow, y as SnapIcon, s as SnapshotIcon, L as SortIcon, _e as StarIcon, Vn as StatusBar, zn as StatusBarItem, Bn as StatusBarSpacer, oe as StepBackIcon, pe as StepForwardIcon, U as StepIcon, j as StopIcon, _n as Subpanel, It as Switch, yn as SwitchRow, ur as TOKEN_CATEGORIES, Xn as Tab, Jn as TabList, Yn as TabPanel, qn as Tabs, ce as TextIcon, gn as TextRow, br as Timeline, ar as ToastQueue, sr as ToastRegion, at as ToggleBar, hn as ToggleRow, dr as TokenPanel, Hn as ToolButton, Un as ToolGroup, lt as ToolOptionsBar, Kn as ToolPalette, Ne as Tooltip, Me as TooltipTrigger, vr as Transport, he as TuneIcon, P as UndoIcon, Mt as UnitField, q as UnknownIcon, ye as UnlockIcon, I as VisibleIcon, z as WarningIcon, ue as ZoomInIcon, Y as ZoomOutIcon, Nn as aggregateValue, cn as applyKeyframeDrag, Ar as chromaAt, An as classifyKind, $t as createFunctionLayer, rn as createKeyframeLayer, en as createSetCurveOp, or as createToastQueue, ir as defaultToastQueue, Je as detectPlatform, t as dlog, Cr as easingBezier, _r as easingLabel, On as effectiveSections, Tt as fieldClasses, et as formatCompact, nt as formatNumber, Wn as formatShortcut, Gn as formatShortcutParts, Gt as formatTick, $e as formatZoom, Zt as functionLayerState, sn as handleHalf, tn as handleSize, Ke as inferKeycapKind, X as inferTokenType, e as isDebugEnabled, i as isFillable, gt as isMeshPaint, Bt as isPrefLeaf, Ye as keyGlyph, Ge as keySpecFromKey, qe as keySpecsFromMods, on as keyframeLayerState, Mn as kindBreakdown, fr as linearScale, pr as logScale, Jt as modelToPlot, ke as nearestPortalHost, qt as niceStep, Wt as niceTicks, Pn as nodeValueAt, kr as oklchToHex, ft as paintGradientTrack, _t as paintPreviewCss, Qe as parseNumber, tt as parseSignedNumber, Ut as plotToModel, zt as prefDisplayBounds, Rt as prefValueAtPath, Sr as samePath, Xt as sampleByInterpolation, yr as sampleEasing, yt as seedPattern, kn as setAtPath, ln as snapToNearest, De as solidColorOf, Ht as stepDecimals, Te as strokeColorOf, Kt as tickDecimals, rr as toast, lr as tokenCategory, jr as useAsyncOptions, Ae as useOverlayPortal, Re as useReorderDragList, ot as useRovingTabIndex, Lt as visiblePrefSubtree };
112
+ export { Pe as ActionBar, ct as ActionsBar, ge as AddIcon, Tr as AnimatedTimeline, ae as ArrowIcon, Ie as Badge, hr as BandEditor, fe as BusyIcon, Le as Button, nr as Callout, tr as CalloutTrigger, Wt as Checkbox, vn as CheckboxRow, H as ChevronIcon, A as CloneIcon, se as CloseIcon, me as CollapseIcon, mt as ColorField, On as ColorRow, $n as ComboBox, Qn as ComboBoxItem, N as CompareIcon, K as CrosshairIcon, on as CurveEditor, Pn as CurveField, ze as DataGrid, ve as DeleteIcon, er as DetentSlider, Jt as Dialog, Ve as Disclosure, Be as DisclosureRow, He as DragHandleGlyph, Sr as EASING_NAMES, Fe as EDGE_PROFILES, _r as EasingPicker, Dn as EffectCard, An as EffectCardList, F as EllipseIcon, R as ErrorIcon, le as ExpandIcon, J as ExportIcon, V as EyedropperIcon, gt as Field, B as FilterIcon, k as FitIcon, yt as FontFamilySelect, be as FullscreenIcon, St as GradientEditor, xt as GradientHandles, Ce as GridIcon, fn as HANDLE_SIZE_TOKENS, M as HandIcon, Se as HiddenIcon, a as ICON_FILLS, r as ICON_GROUPS, n as ICON_PATHS, o as Icon, x as ImageIcon, u as InfoIcon, pt as InlineRange, At as Input, it as ItemList, gr as Jog, Ue as KeyCap, We as KeySequence, xe as LassoIcon, Xe as LayerStack, un as LayeredCurveEditor, S as LayersIcon, f as LayoutColumnsIcon, d as LayoutGridIcon, _ as LayoutRowsIcon, G as LineIcon, c as LinkIcon, W as LockIcon, h as LoupeIcon, rt as MINUS_SIGN, Bt as MIXED, g as MeasureIcon, Zn as MenuButton, Et as MeshEditor, v as ModeAutoIcon, p as ModeDarkIcon, te as ModeLightIcon, jt as NumberField, jn as NumberRow, st as OptionsBar, je as OverlayPortalProvider, Ht as PaintField, kt as PaintInput, ie as PanIcon, Ot as PatternPicker, b as PauseIcon, we as PenIcon, l as PencilIcon, w as PinIcon, ee as PlayIcon, nn as Plot2D, cr as PointPlotter, C as PolygonIcon, Ut as Powerline, Oe as PrefsDialog, Ee as PrefsForm, Mn as PropertyGroup, yn as PropertyList, Tn as PropertyNote, Nn as PropertyPanel, bn as PropertyRow, xn as PropertySpan, Kt as Radio, Gt as RadioGroup, T as RandomizeIcon, qt as RangeSlider, m as RectIcon, re as RedoIcon, de as RefreshIcon, ne as RemoveIcon, D as ResetIcon, In as ResizeHandle, Ct as SceneGradientHandles, E as SearchIcon, vt as Select, O as SelectIcon, _t as SelectItem, kn as SelectRow, Fn as SelectionPanel, Ln as Sidebar, Rn as SidebarPanel, Ze as Slider, En as SliderRow, y as SnapIcon, s as SnapshotIcon, L as SortIcon, _e as StarIcon, Vn as StatusBar, zn as StatusBarItem, Bn as StatusBarSpacer, oe as StepBackIcon, pe as StepForwardIcon, U as StepIcon, j as StopIcon, wn as Subpanel, Nt as Switch, Cn as SwitchRow, X as TOKEN_CATEGORIES, Xn as Tab, Jn as TabList, Yn as TabPanel, qn as Tabs, ce as TextIcon, Sn as TextRow, xr as Timeline, ar as ToastQueue, sr as ToastRegion, at as ToggleBar, _n as ToggleRow, fr as TokenPanel, Hn as ToolButton, Un as ToolGroup, Vt as ToolOptionsBar, Kn as ToolPalette, Ne as Tooltip, Me as TooltipTrigger, yr as Transport, he as TuneIcon, P as UndoIcon, Mt as UnitField, q as UnknownIcon, ye as UnlockIcon, I as VisibleIcon, z as WarningIcon, ue as ZoomInIcon, Y as ZoomOutIcon, It as aggregateValue, hn as applyKeyframeDrag, kr as chromaAt, Rt as classifyKind, sn as createFunctionLayer, dn as createKeyframeLayer, cn as createSetCurveOp, or as createToastQueue, ir as defaultToastQueue, Je as detectPlatform, t as dlog, wr as easingBezier, vr as easingLabel, Pt as effectiveSections, ht as fieldClasses, et as formatCompact, nt as formatNumber, Wn as formatShortcut, Gn as formatShortcutParts, Qt as formatTick, $e as formatZoom, an as functionLayerState, mn as handleHalf, ln as handleSize, Ke as inferKeycapKind, dr as inferTokenType, e as isDebugEnabled, i as isFillable, wt as isMeshPaint, ft as isPrefLeaf, Ye as keyGlyph, Ge as keySpecFromKey, qe as keySpecsFromMods, pn as keyframeLayerState, Lt as kindBreakdown, pr as linearScale, mr as logScale, tn as modelToPlot, ke as nearestPortalHost, en as niceStep, Zt as niceTicks, zt as nodeValueAt, Or as oklchToHex, bt as paintGradientTrack, Tt as paintPreviewCss, Qe as parseNumber, tt as parseSignedNumber, Xt as plotToModel, dt as prefDisplayBounds, ut as prefValueAtPath, ur as refitScale, Cr as samePath, rn as sampleByInterpolation, br as sampleEasing, Dt as seedPattern, Ft as setAtPath, gn as snapToNearest, De as solidColorOf, Yt as stepDecimals, Te as strokeColorOf, $t as tickDecimals, rr as toast, lr as tokenCategory, Ar as useAsyncOptions, Ae as useOverlayPortal, Re as useReorderDragList, ot as useRovingTabIndex, lt as visiblePrefSubtree };
119
113
 
120
114
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../src/color/oklch.ts","../src/useAsyncOptions.ts"],"sourcesContent":["// OKLCH math from Björn Ottosson: https://bottosson.github.io/posts/oklab/\nimport { oklchToOklab, oklabToSrgbU8, rgbaToHex } from '@weasel-js/core';\n\n/**\n * A chroma envelope over lightness, as three linear segments: flat at `cBot`\n * below `lRange[0]`, rising to `cPeak` at `midL`, falling to `cTop` at\n * `lRange[1]`, flat beyond. Keeps a color ramp inside gamut at the light and\n * dark ends while staying saturated through the middle.\n */\nexport type ChromaCurve = {\n lRange: [number, number];\n midL: number;\n cBot: number;\n cPeak: number;\n cTop: number;\n};\n\n/** A single lightness/chroma sample. */\nexport type ChromaCurvePoint = { L: number; C: number };\n\n/**\n * Converts an OKLCH color to a gamut-clipped `#rrggbb` string. Hue is in\n * degrees, unlike the kit's OKLab helpers which take radians.\n */\nexport function oklchToHex(L: number, C: number, Hdeg: number): string {\n // Delegate to the kit's OKLab pipeline (kit angle unit is radians) →\n // gamut-clipped u8 sRGB → `#rrggbb`.\n const [l, a, b] = oklchToOklab(L, C, (Hdeg * Math.PI) / 180);\n const [r, g, bl] = oklabToSrgbU8(l, a, b);\n return rgbaToHex([r / 255, g / 255, bl / 255]);\n}\n\n/** Evaluates a {@link ChromaCurve} at a lightness, clamping outside its range. */\nexport function chromaAt(L: number, curve: ChromaCurve): number {\n const [lo, hi] = curve.lRange;\n if (L <= lo) return curve.cBot;\n if (L >= hi) return curve.cTop;\n if (L <= curve.midL) return curve.cBot + (curve.cPeak - curve.cBot) * ((L - lo) / (curve.midL - lo));\n return curve.cPeak + (curve.cTop - curve.cPeak) * ((L - curve.midL) / (hi - curve.midL));\n}\n","import { useCallback, useEffect, useRef, useState } from 'react';\nimport type { ComboBoxOption } from './components/ComboBox/ComboBox';\n\ntype Key = string | number;\n\n/** An option list keyed to the value type its combo box commits. */\nexport type AsyncOption<T extends Key> = ComboBoxOption & { value: T };\n\n/** Options for {@link useAsyncOptions}. */\nexport type UseAsyncOptionsProps<T extends Key> = {\n /**\n * Fetches the options for a query. The signal aborts when a later keystroke\n * supersedes this call, so a `fetch` should forward it.\n */\n load: (query: string, signal: AbortSignal) => Promise<ReadonlyArray<AsyncOption<T>>>;\n /** Quiet period before a query is sent. */\n debounceMs?: number;\n /** Shorter queries are not sent, and empty the options. */\n minLength?: number;\n};\n\n/** What {@link useAsyncOptions} returns, shaped to spread into a `ComboBox`. */\nexport type AsyncOptionsResult<T extends Key> = {\n options: ReadonlyArray<AsyncOption<T>>;\n isLoading: boolean;\n loadError: unknown | null;\n inputValue: string;\n onInputChange: (next: string) => void;\n};\n\n/**\n * Drives a combo box whose options come from a server: debounces the query,\n * discards responses overtaken by a later one, and reports a failed load\n * separately from an empty result.\n *\n * `options` holds the last *resolved* list and is never emptied to mean\n * \"working\", so the previous results stay on screen — and stay arrowable —\n * while the next request is in flight.\n */\nexport function useAsyncOptions<T extends Key = string>({\n load,\n debounceMs = 150,\n minLength = 0,\n}: UseAsyncOptionsProps<T>): AsyncOptionsResult<T> {\n const [inputValue, setInputValue] = useState('');\n const [options, setOptions] = useState<ReadonlyArray<AsyncOption<T>>>([]);\n const [isLoading, setIsLoading] = useState(false);\n const [loadError, setLoadError] = useState<unknown | null>(null);\n\n // Read through a ref: a consumer passing an inline arrow re-creates `load`\n // every render, and depending on it directly would refire the request.\n const loadRef = useRef(load);\n loadRef.current = load;\n\n // A monotonic id per request, and the highest one whose result has been\n // applied. A liveness flag cannot do this job: two requests from adjacent\n // keystrokes are both live, so the slower one overwrites the newer result\n // if it lands second.\n const issued = useRef(0);\n const applied = useRef(0);\n const inFlight = useRef<AbortController | null>(null);\n\n useEffect(() => {\n if (inputValue.length < minLength) {\n inFlight.current?.abort();\n inFlight.current = null;\n applied.current = issued.current;\n setOptions([]);\n setIsLoading(false);\n setLoadError(null);\n return;\n }\n\n const timer = setTimeout(() => {\n const mine = ++issued.current;\n const controller = new AbortController();\n inFlight.current?.abort();\n inFlight.current = controller;\n setIsLoading(true);\n\n loadRef.current(inputValue, controller.signal).then(\n (next) => {\n if (mine <= applied.current) return;\n applied.current = mine;\n setOptions(next);\n setLoadError(null);\n setIsLoading(false);\n },\n (error: unknown) => {\n if (controller.signal.aborted || mine <= applied.current) return;\n applied.current = mine;\n setLoadError(error);\n setIsLoading(false);\n },\n );\n }, debounceMs);\n\n return () => clearTimeout(timer);\n }, [inputValue, debounceMs, minLength]);\n\n useEffect(() => () => inFlight.current?.abort(), []);\n\n const onInputChange = useCallback((next: string) => setInputValue(next), []);\n\n return { options, isLoading, loadError, inputValue, onInputChange };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwBA,SAAgB,GAAW,GAAW,GAAW,GAAsB;CAGrE,IAAM,CAAC,GAAG,GAAG,KAAK,GAAa,GAAG,GAAI,IAAO,KAAK,KAAM,IAAI,EACtD,CAAC,GAAG,GAAG,KAAM,GAAc,GAAG,GAAG,EAAE;AACzC,QAAO,GAAU;EAAC,IAAI;EAAK,IAAI;EAAK,IAAK;EAAI,CAAC;;AAIhD,SAAgB,GAAS,GAAW,GAA4B;CAC9D,IAAM,CAAC,GAAI,KAAM,EAAM;AAIvB,QAHI,KAAK,IAAW,EAAM,OACtB,KAAK,IAAW,EAAM,OACtB,KAAK,EAAM,OAAa,EAAM,QAAQ,EAAM,QAAQ,EAAM,UAAU,IAAI,MAAO,EAAM,OAAO,MACzF,EAAM,SAAS,EAAM,OAAO,EAAM,WAAW,IAAI,EAAM,SAAS,IAAK,EAAM;;;;ACCpF,SAAgB,GAAwC,EACtD,SACA,gBAAa,KACb,eAAY,KACqC;CACjD,IAAM,CAAC,GAAY,KAAiB,EAAS,GAAG,EAC1C,CAAC,GAAS,KAAc,EAAwC,EAAE,CAAC,EACnE,CAAC,GAAW,KAAgB,EAAS,GAAM,EAC3C,CAAC,GAAW,KAAgB,EAAyB,KAAK,EAI1D,IAAU,EAAO,EAAK;AAC5B,GAAQ,UAAU;CAMlB,IAAM,IAAS,EAAO,EAAE,EAClB,IAAU,EAAO,EAAE,EACnB,IAAW,EAA+B,KAAK;AA4CrD,QA1CA,QAAgB;AACd,MAAI,EAAW,SAAS,GAAW;AAMjC,GALA,EAAS,SAAS,OAAO,EACzB,EAAS,UAAU,MACnB,EAAQ,UAAU,EAAO,SACzB,EAAW,EAAE,CAAC,EACd,EAAa,GAAM,EACnB,EAAa,KAAK;AAClB;;EAGF,IAAM,IAAQ,iBAAiB;GAC7B,IAAM,IAAO,EAAE,EAAO,SAChB,IAAa,IAAI,iBAAiB;AAKxC,GAJA,EAAS,SAAS,OAAO,EACzB,EAAS,UAAU,GACnB,EAAa,GAAK,EAElB,EAAQ,QAAQ,GAAY,EAAW,OAAO,CAAC,MAC5C,MAAS;AACJ,SAAQ,EAAQ,YACpB,EAAQ,UAAU,GAClB,EAAW,EAAK,EAChB,EAAa,KAAK,EAClB,EAAa,GAAM;OAEpB,MAAmB;AACd,MAAW,OAAO,WAAW,KAAQ,EAAQ,YACjD,EAAQ,UAAU,GAClB,EAAa,EAAM,EACnB,EAAa,GAAM;KAEtB;KACA,EAAW;AAEd,eAAa,aAAa,EAAM;IAC/B;EAAC;EAAY;EAAY;EAAU,CAAC,EAEvC,cAAsB,EAAS,SAAS,OAAO,EAAE,EAAE,CAAC,EAI7C;EAAE;EAAS;EAAW;EAAW;EAAY,eAF9B,IAAa,MAAiB,EAAc,EAAK,EAAE,EAAE,CAEvB;EAAe"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../src/color/oklch.ts","../src/useAsyncOptions.ts"],"sourcesContent":["// OKLCH math from Björn Ottosson: https://bottosson.github.io/posts/oklab/\nimport { oklchDegToHex } from '@weasel-js/core';\n\n/**\n * A chroma envelope over lightness, as three linear segments: flat at `cBot`\n * below `lRange[0]`, rising to `cPeak` at `midL`, falling to `cTop` at\n * `lRange[1]`, flat beyond. Keeps a color ramp inside gamut at the light and\n * dark ends while staying saturated through the middle.\n */\nexport type ChromaCurve = {\n lRange: [number, number];\n midL: number;\n cBot: number;\n cPeak: number;\n cTop: number;\n};\n\n/** A single lightness/chroma sample. */\nexport type ChromaCurvePoint = { L: number; C: number };\n\n/**\n * Converts an OKLCH color to a gamut-clipped `#rrggbb` string. Hue is in\n * degrees, unlike the kit's OKLab helpers which take radians.\n */\nexport const oklchToHex = oklchDegToHex;\n\n/** Evaluates a {@link ChromaCurve} at a lightness, clamping outside its range. */\nexport function chromaAt(L: number, curve: ChromaCurve): number {\n const [lo, hi] = curve.lRange;\n if (L <= lo) return curve.cBot;\n if (L >= hi) return curve.cTop;\n if (L <= curve.midL) return curve.cBot + (curve.cPeak - curve.cBot) * ((L - lo) / (curve.midL - lo));\n return curve.cPeak + (curve.cTop - curve.cPeak) * ((L - curve.midL) / (hi - curve.midL));\n}\n","import { useCallback, useEffect, useRef, useState } from 'react';\nimport type { ComboBoxOption } from './components/ComboBox/ComboBox';\n\ntype Key = string | number;\n\n/** An option list keyed to the value type its combo box commits. */\nexport type AsyncOption<T extends Key> = ComboBoxOption & { value: T };\n\n/** Options for {@link useAsyncOptions}. */\nexport type UseAsyncOptionsProps<T extends Key> = {\n /**\n * Fetches the options for a query. The signal aborts when a later keystroke\n * supersedes this call, so a `fetch` should forward it.\n */\n load: (query: string, signal: AbortSignal) => Promise<ReadonlyArray<AsyncOption<T>>>;\n /** Quiet period before a query is sent. */\n debounceMs?: number;\n /** Shorter queries are not sent, and empty the options. */\n minLength?: number;\n};\n\n/** What {@link useAsyncOptions} returns, shaped to spread into a `ComboBox`. */\nexport type AsyncOptionsResult<T extends Key> = {\n options: ReadonlyArray<AsyncOption<T>>;\n isLoading: boolean;\n loadError: unknown | null;\n inputValue: string;\n onInputChange: (next: string) => void;\n};\n\n/**\n * Drives a combo box whose options come from a server: debounces the query,\n * discards responses overtaken by a later one, and reports a failed load\n * separately from an empty result.\n *\n * `options` holds the last *resolved* list and is never emptied to mean\n * \"working\", so the previous results stay on screen — and stay arrowable —\n * while the next request is in flight.\n */\nexport function useAsyncOptions<T extends Key = string>({\n load,\n debounceMs = 150,\n minLength = 0,\n}: UseAsyncOptionsProps<T>): AsyncOptionsResult<T> {\n const [inputValue, setInputValue] = useState('');\n const [options, setOptions] = useState<ReadonlyArray<AsyncOption<T>>>([]);\n const [isLoading, setIsLoading] = useState(false);\n const [loadError, setLoadError] = useState<unknown | null>(null);\n\n // Read through a ref: a consumer passing an inline arrow re-creates `load`\n // every render, and depending on it directly would refire the request.\n const loadRef = useRef(load);\n loadRef.current = load;\n\n // A monotonic id per request, and the highest one whose result has been\n // applied. A liveness flag cannot do this job: two requests from adjacent\n // keystrokes are both live, so the slower one overwrites the newer result\n // if it lands second.\n const issued = useRef(0);\n const applied = useRef(0);\n const inFlight = useRef<AbortController | null>(null);\n\n useEffect(() => {\n if (inputValue.length < minLength) {\n inFlight.current?.abort();\n inFlight.current = null;\n applied.current = issued.current;\n setOptions([]);\n setIsLoading(false);\n setLoadError(null);\n return;\n }\n\n const timer = setTimeout(() => {\n const mine = ++issued.current;\n const controller = new AbortController();\n inFlight.current?.abort();\n inFlight.current = controller;\n setIsLoading(true);\n\n loadRef.current(inputValue, controller.signal).then(\n (next) => {\n if (mine <= applied.current) return;\n applied.current = mine;\n setOptions(next);\n setLoadError(null);\n setIsLoading(false);\n },\n (error: unknown) => {\n if (controller.signal.aborted || mine <= applied.current) return;\n applied.current = mine;\n setLoadError(error);\n setIsLoading(false);\n },\n );\n }, debounceMs);\n\n return () => clearTimeout(timer);\n }, [inputValue, debounceMs, minLength]);\n\n useEffect(() => () => inFlight.current?.abort(), []);\n\n const onInputChange = useCallback((next: string) => setInputValue(next), []);\n\n return { options, isLoading, loadError, inputValue, onInputChange };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwBA,IAAa,KAAa;AAG1B,SAAgB,GAAS,GAAW,GAA4B;CAC9D,IAAM,CAAC,GAAI,KAAM,EAAM;AAIvB,QAHI,KAAK,IAAW,EAAM,OACtB,KAAK,IAAW,EAAM,OACtB,KAAK,EAAM,OAAa,EAAM,QAAQ,EAAM,QAAQ,EAAM,UAAU,IAAI,MAAO,EAAM,OAAO,MACzF,EAAM,SAAS,EAAM,OAAO,EAAM,WAAW,IAAI,EAAM,SAAS,IAAK,EAAM;;;;ACOpF,SAAgB,GAAwC,EACtD,SACA,gBAAa,KACb,eAAY,KACqC;CACjD,IAAM,CAAC,GAAY,KAAiB,EAAS,GAAG,EAC1C,CAAC,GAAS,KAAc,EAAwC,EAAE,CAAC,EACnE,CAAC,GAAW,KAAgB,EAAS,GAAM,EAC3C,CAAC,GAAW,KAAgB,EAAyB,KAAK,EAI1D,IAAU,EAAO,EAAK;AAC5B,GAAQ,UAAU;CAMlB,IAAM,IAAS,EAAO,EAAE,EAClB,IAAU,EAAO,EAAE,EACnB,IAAW,EAA+B,KAAK;AA4CrD,QA1CA,QAAgB;AACd,MAAI,EAAW,SAAS,GAAW;AAMjC,GALA,EAAS,SAAS,OAAO,EACzB,EAAS,UAAU,MACnB,EAAQ,UAAU,EAAO,SACzB,EAAW,EAAE,CAAC,EACd,EAAa,GAAM,EACnB,EAAa,KAAK;AAClB;;EAGF,IAAM,IAAQ,iBAAiB;GAC7B,IAAM,IAAO,EAAE,EAAO,SAChB,IAAa,IAAI,iBAAiB;AAKxC,GAJA,EAAS,SAAS,OAAO,EACzB,EAAS,UAAU,GACnB,EAAa,GAAK,EAElB,EAAQ,QAAQ,GAAY,EAAW,OAAO,CAAC,MAC5C,MAAS;AACJ,SAAQ,EAAQ,YACpB,EAAQ,UAAU,GAClB,EAAW,EAAK,EAChB,EAAa,KAAK,EAClB,EAAa,GAAM;OAEpB,MAAmB;AACd,MAAW,OAAO,WAAW,KAAQ,EAAQ,YACjD,EAAQ,UAAU,GAClB,EAAa,EAAM,EACnB,EAAa,GAAM;KAEtB;KACA,EAAW;AAEd,eAAa,aAAa,EAAM;IAC/B;EAAC;EAAY;EAAY;EAAU,CAAC,EAEvC,cAAsB,EAAS,SAAS,OAAO,EAAE,EAAE,CAAC,EAI7C;EAAE;EAAS;EAAW;EAAW;EAAY,eAF9B,IAAa,MAAiB,EAAc,EAAK,EAAE,EAAE,CAEvB;EAAe"}