@weasel-js/ui 1.5.2 → 1.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (466) hide show
  1. package/dist/chunks/ActionBar-CYvfmEz0.js +57 -0
  2. package/dist/chunks/ActionBar-CYvfmEz0.js.map +1 -0
  3. package/dist/chunks/{Badge-CW9pBPFl.js → Badge-DZ0lFs14.js} +755 -738
  4. package/dist/chunks/Badge-DZ0lFs14.js.map +1 -0
  5. package/dist/chunks/{BandEditor-jY-PFKY6.js → BandEditor-D-nVrVO4.js} +34 -34
  6. package/dist/chunks/{BandEditor-jY-PFKY6.js.map → BandEditor-D-nVrVO4.js.map} +1 -1
  7. package/dist/chunks/Button-Dyp31jMt.js +111 -0
  8. package/dist/chunks/Button-Dyp31jMt.js.map +1 -0
  9. package/dist/chunks/ButtonBar-smZzFuEo.js +46 -0
  10. package/dist/chunks/ButtonBar-smZzFuEo.js.map +1 -0
  11. package/dist/chunks/Callout-xLjnx7Mp.js +119 -0
  12. package/dist/chunks/Callout-xLjnx7Mp.js.map +1 -0
  13. package/dist/chunks/{Checkbox-BOsDAY2F.js → Checkbox-ChZz30Ds.js} +1 -1
  14. package/dist/chunks/{Checkbox-BOsDAY2F.js.map → Checkbox-ChZz30Ds.js.map} +1 -1
  15. package/dist/chunks/Code-v4tDWuuN.js +24 -0
  16. package/dist/chunks/Code-v4tDWuuN.js.map +1 -0
  17. package/dist/chunks/{ColorField-BYzgZM9o.js → ColorField-DJSCuSJv.js} +15 -15
  18. package/dist/chunks/ColorField-DJSCuSJv.js.map +1 -0
  19. package/dist/chunks/ColorModeControl-JOEiqtE0.js +47 -0
  20. package/dist/chunks/ColorModeControl-JOEiqtE0.js.map +1 -0
  21. package/dist/chunks/{ComboBox-Cz3f0Y_8.js → ComboBox-C1JgIpML.js} +2 -2
  22. package/dist/chunks/{ComboBox-Cz3f0Y_8.js.map → ComboBox-C1JgIpML.js.map} +1 -1
  23. package/dist/chunks/{CurveEditor-DXwSP-iA.js → CurveEditor-f1R4kSbD.js} +2 -2
  24. package/dist/chunks/{CurveEditor-DXwSP-iA.js.map → CurveEditor-f1R4kSbD.js.map} +1 -1
  25. package/dist/chunks/DataGrid-CZPrB_3a.js +152 -0
  26. package/dist/chunks/DataGrid-CZPrB_3a.js.map +1 -0
  27. package/dist/chunks/DetailList-DHaXX4TG.js +43 -0
  28. package/dist/chunks/DetailList-DHaXX4TG.js.map +1 -0
  29. package/dist/chunks/{DetentSlider-CAubVX0J.js → DetentSlider-BYyaZha6.js} +2 -2
  30. package/dist/chunks/{DetentSlider-CAubVX0J.js.map → DetentSlider-BYyaZha6.js.map} +1 -1
  31. package/dist/chunks/Dialog-GIvjoDQj.js +66 -0
  32. package/dist/chunks/Dialog-GIvjoDQj.js.map +1 -0
  33. package/dist/chunks/Disclosure-D79jhmh2.js +58 -0
  34. package/dist/chunks/Disclosure-D79jhmh2.js.map +1 -0
  35. package/dist/chunks/DragGhost-DcU7cOwy.js +30 -0
  36. package/dist/chunks/DragGhost-DcU7cOwy.js.map +1 -0
  37. package/dist/chunks/{DragHandleGlyph-CppAz4_8.js → DragHandleGlyph-BtBxHjZS.js} +1 -1
  38. package/dist/chunks/{DragHandleGlyph-CppAz4_8.js.map → DragHandleGlyph-BtBxHjZS.js.map} +1 -1
  39. package/dist/chunks/{Field-DWnV8WZY.js → Field-xbqRmjsI.js} +1 -1
  40. package/dist/chunks/{Field-DWnV8WZY.js.map → Field-xbqRmjsI.js.map} +1 -1
  41. package/dist/chunks/FillStrokeSwatch-BViKXIPx.js +111 -0
  42. package/dist/chunks/FillStrokeSwatch-BViKXIPx.js.map +1 -0
  43. package/dist/chunks/{FontFamilySelect-DxfgTC3G.js → FontFamilySelect-r9TV_xIH.js} +2 -2
  44. package/dist/chunks/{FontFamilySelect-DxfgTC3G.js.map → FontFamilySelect-r9TV_xIH.js.map} +1 -1
  45. package/dist/chunks/GradientEditor-BRTxHG-W.js +333 -0
  46. package/dist/chunks/{GradientEditor-rRBmf3G0.js.map → GradientEditor-BRTxHG-W.js.map} +1 -1
  47. package/dist/chunks/{Icon-DT0x6HaQ.js → Icon-BW0qv_U7.js} +28 -20
  48. package/dist/chunks/Icon-BW0qv_U7.js.map +1 -0
  49. package/dist/chunks/InlineRange-BwGFDhpT.js +29 -0
  50. package/dist/chunks/InlineRange-BwGFDhpT.js.map +1 -0
  51. package/dist/chunks/{Input-DbMKpkXy.js → Input-Bx2cuUbS.js} +24 -19
  52. package/dist/chunks/Input-Bx2cuUbS.js.map +1 -0
  53. package/dist/chunks/ItemList-DzJ2lK0R.js +175 -0
  54. package/dist/chunks/ItemList-DzJ2lK0R.js.map +1 -0
  55. package/dist/chunks/ItemList.module-DDUXfuZL.js +14 -0
  56. package/dist/chunks/ItemList.module-DDUXfuZL.js.map +1 -0
  57. package/dist/chunks/{Jog-DkkTlL3_.js → Jog-LPoac9s4.js} +6 -6
  58. package/dist/chunks/{Jog-DkkTlL3_.js.map → Jog-LPoac9s4.js.map} +1 -1
  59. package/dist/chunks/{Keycaps-DunVpejA.js → Keycaps-CKiKOJnJ.js} +71 -65
  60. package/dist/chunks/Keycaps-CKiKOJnJ.js.map +1 -0
  61. package/dist/chunks/LayerList-BeGrkLb9.js +427 -0
  62. package/dist/chunks/LayerList-BeGrkLb9.js.map +1 -0
  63. package/dist/chunks/ListEditor-C6zLzCsJ.js +74 -0
  64. package/dist/chunks/ListEditor-C6zLzCsJ.js.map +1 -0
  65. package/dist/chunks/MenuButton-BcdhrNGh.js +70 -0
  66. package/dist/chunks/MenuButton-BcdhrNGh.js.map +1 -0
  67. package/dist/chunks/MeshEditor-BOOIFWnz.js +87 -0
  68. package/dist/chunks/MeshEditor-BOOIFWnz.js.map +1 -0
  69. package/dist/chunks/{NumberField-CCjEDZCg.js → NumberField-C1Y7zP-a.js} +27 -22
  70. package/dist/chunks/NumberField-C1Y7zP-a.js.map +1 -0
  71. package/dist/chunks/{OptionsBar-DeQ-vUeZ.js → OptionsBar-DlcagPYK.js} +3 -3
  72. package/dist/chunks/{OptionsBar-DeQ-vUeZ.js.map → OptionsBar-DlcagPYK.js.map} +1 -1
  73. package/dist/chunks/{PaintField-jBOJ32rL.js → PaintField-B2mLRZa4.js} +20 -20
  74. package/dist/chunks/PaintField-B2mLRZa4.js.map +1 -0
  75. package/dist/chunks/{PaintInput-Qs7Rul5R.js → PaintInput-BFKhd83I.js} +24 -24
  76. package/dist/chunks/{PaintInput-Qs7Rul5R.js.map → PaintInput-BFKhd83I.js.map} +1 -1
  77. package/dist/chunks/{PatternPicker-BMpXWboq.js → PatternPicker-DdfpxoQy.js} +2 -2
  78. package/dist/chunks/{PatternPicker-BMpXWboq.js.map → PatternPicker-DdfpxoQy.js.map} +1 -1
  79. package/dist/chunks/{Plot2D-CXf_f7QD.js → Plot2D-lyO7waPQ.js} +1 -1
  80. package/dist/chunks/{Plot2D-CXf_f7QD.js.map → Plot2D-lyO7waPQ.js.map} +1 -1
  81. package/dist/chunks/{PointPlotter-S_gz7VYt.js → PointPlotter-DGs9i5P-.js} +2 -2
  82. package/dist/chunks/{PointPlotter-S_gz7VYt.js.map → PointPlotter-DGs9i5P-.js.map} +1 -1
  83. package/dist/chunks/{Powerline-Ak5AWUlK.js → Powerline-DBEPceLE.js} +4 -2
  84. package/dist/chunks/Powerline-DBEPceLE.js.map +1 -0
  85. package/dist/chunks/Prefs-Ctu0H4-b.js +475 -0
  86. package/dist/chunks/Prefs-Ctu0H4-b.js.map +1 -0
  87. package/dist/chunks/Properties-Bbneh1ws.js +281 -0
  88. package/dist/chunks/Properties-Bbneh1ws.js.map +1 -0
  89. package/dist/chunks/PropertyField-CDb19d3F.js +756 -0
  90. package/dist/chunks/PropertyField-CDb19d3F.js.map +1 -0
  91. package/dist/chunks/{RadioGroup-CsVp3SEu.js → RadioGroup-BK2mD6Q0.js} +2 -2
  92. package/dist/chunks/{RadioGroup-CsVp3SEu.js.map → RadioGroup-BK2mD6Q0.js.map} +1 -1
  93. package/dist/chunks/{RangeSlider-DNr-pJpZ.js → RangeSlider-BiRAOsTh.js} +1 -1
  94. package/dist/chunks/{RangeSlider-DNr-pJpZ.js.map → RangeSlider-BiRAOsTh.js.map} +1 -1
  95. package/dist/chunks/{ResizeHandle-RXFf5fXr.js → ResizeHandle-Cc6EOehs.js} +9 -9
  96. package/dist/chunks/{ResizeHandle-RXFf5fXr.js.map → ResizeHandle-Cc6EOehs.js.map} +1 -1
  97. package/dist/chunks/Select-DVValBe1.js +225 -0
  98. package/dist/chunks/Select-DVValBe1.js.map +1 -0
  99. package/dist/chunks/{SelectionPanel-CEbLS-0D.js → SelectionPanel-C5LmZA7b.js} +21 -20
  100. package/dist/chunks/{SelectionPanel-CEbLS-0D.js.map → SelectionPanel-C5LmZA7b.js.map} +1 -1
  101. package/dist/chunks/{Sidebar-qn_oSCNX.js → Sidebar-DKKd4R-x.js} +1 -1
  102. package/dist/chunks/{Sidebar-qn_oSCNX.js.map → Sidebar-DKKd4R-x.js.map} +1 -1
  103. package/dist/chunks/{SidebarPanel-Bs6V21hg.js → SidebarPanel-u5NsuAZY.js} +15 -19
  104. package/dist/chunks/SidebarPanel-u5NsuAZY.js.map +1 -0
  105. package/dist/chunks/{Slider-CIIrqiFS.js → Slider-BwRrWHFW.js} +42 -42
  106. package/dist/chunks/{Slider-CIIrqiFS.js.map → Slider-BwRrWHFW.js.map} +1 -1
  107. package/dist/chunks/{StatusBar-B4L15DSm.js → StatusBar-CdPdmmda.js} +1 -1
  108. package/dist/chunks/{StatusBar-B4L15DSm.js.map → StatusBar-CdPdmmda.js.map} +1 -1
  109. package/dist/chunks/SwatchGrid-C-Zx2Exd.js +73 -0
  110. package/dist/chunks/SwatchGrid-C-Zx2Exd.js.map +1 -0
  111. package/dist/chunks/{Switch-DH5POG0T.js → Switch-DxF7TsEu.js} +1 -1
  112. package/dist/chunks/{Switch-DH5POG0T.js.map → Switch-DxF7TsEu.js.map} +1 -1
  113. package/dist/chunks/{Tabs-BFHikpml.js → Tabs-GXEfoe3o.js} +1 -1
  114. package/dist/chunks/{Tabs-BFHikpml.js.map → Tabs-GXEfoe3o.js.map} +1 -1
  115. package/dist/chunks/{Timeline-DNKY_yiK.js → Timeline-SgmpQtUV.js} +128 -132
  116. package/dist/chunks/Timeline-SgmpQtUV.js.map +1 -0
  117. package/dist/chunks/{Toast-CI1UDuK6.js → Toast-BfcljZz6.js} +1 -1
  118. package/dist/chunks/{Toast-CI1UDuK6.js.map → Toast-BfcljZz6.js.map} +1 -1
  119. package/dist/chunks/ToggleBar-Btnl5r7F.js +80 -0
  120. package/dist/chunks/{ToggleBar-CClus5Cd.js.map → ToggleBar-Btnl5r7F.js.map} +1 -1
  121. package/dist/chunks/{TokenPanel-BPHq24dc.js → TokenPanel-5ajHEHha.js} +40 -40
  122. package/dist/chunks/{TokenPanel-BPHq24dc.js.map → TokenPanel-5ajHEHha.js.map} +1 -1
  123. package/dist/chunks/{ToolButton-9QzJCmuM.js → ToolButton-rzqlFlAc.js} +4 -4
  124. package/dist/chunks/{ToolButton-9QzJCmuM.js.map → ToolButton-rzqlFlAc.js.map} +1 -1
  125. package/dist/chunks/{ToolGroup-BJiDrH_i.js → ToolGroup-4bUBV5k6.js} +1 -1
  126. package/dist/chunks/{ToolGroup-BJiDrH_i.js.map → ToolGroup-4bUBV5k6.js.map} +1 -1
  127. package/dist/chunks/{ToolOptionsBar-CAM6RcUH.js → ToolOptionsBar-BF3TNXA3.js} +2 -2
  128. package/dist/chunks/{ToolOptionsBar-CAM6RcUH.js.map → ToolOptionsBar-BF3TNXA3.js.map} +1 -1
  129. package/dist/chunks/ToolPalette-Uw4PvWwa.js +83 -0
  130. package/dist/chunks/ToolPalette-Uw4PvWwa.js.map +1 -0
  131. package/dist/chunks/{Tooltip-C4YBczLq.js → Tooltip-9XiJF937.js} +13 -13
  132. package/dist/chunks/Tooltip-9XiJF937.js.map +1 -0
  133. package/dist/chunks/Tree-BGt6P8tI.js +203 -0
  134. package/dist/chunks/Tree-BGt6P8tI.js.map +1 -0
  135. package/dist/chunks/{createKeyframeLayer-DKtO0Sw_.js → createKeyframeLayer-BzDRCrrh.js} +71 -71
  136. package/dist/chunks/{createKeyframeLayer-DKtO0Sw_.js.map → createKeyframeLayer-BzDRCrrh.js.map} +1 -1
  137. package/dist/chunks/formatShortcut-BoGqUoWi.js +15 -0
  138. package/dist/chunks/formatShortcut-BoGqUoWi.js.map +1 -0
  139. package/dist/chunks/icons-DbScMMqX.js +179 -0
  140. package/dist/chunks/icons-DbScMMqX.js.map +1 -0
  141. package/dist/chunks/interactiveTarget-C7QUBaJN.js +24 -0
  142. package/dist/chunks/interactiveTarget-C7QUBaJN.js.map +1 -0
  143. package/dist/chunks/{keyGlyph-Bp0wnLHn.js → keyGlyph-CLvUHU8c.js} +1 -1
  144. package/dist/chunks/{keyGlyph-Bp0wnLHn.js.map → keyGlyph-CLvUHU8c.js.map} +1 -1
  145. package/dist/chunks/model-BQMvTLnW.js +360 -0
  146. package/dist/chunks/model-BQMvTLnW.js.map +1 -0
  147. package/dist/chunks/{number-BHz66zQO.js → number-6S8IzXVt.js} +3 -3
  148. package/dist/chunks/number-6S8IzXVt.js.map +1 -0
  149. package/dist/chunks/paintPreview-DPtZS4yU.js +42 -0
  150. package/dist/chunks/paintPreview-DPtZS4yU.js.map +1 -0
  151. package/dist/chunks/paintValue-Bz6AVuh3.js +18 -0
  152. package/dist/chunks/paintValue-Bz6AVuh3.js.map +1 -0
  153. package/dist/chunks/prefField-CLkhrvYl.js +197 -0
  154. package/dist/chunks/prefField-CLkhrvYl.js.map +1 -0
  155. package/dist/chunks/segmentTooltip-CAkZlW-t.js +29 -0
  156. package/dist/chunks/segmentTooltip-CAkZlW-t.js.map +1 -0
  157. package/dist/chunks/segmentedControl.module-D2nw68Yo.js +11 -0
  158. package/dist/chunks/segmentedControl.module-D2nw68Yo.js.map +1 -0
  159. package/dist/chunks/{snap-CEjuWOhN.js → snap-DC4Km8xG.js} +1 -1
  160. package/dist/chunks/{snap-CEjuWOhN.js.map → snap-DC4Km8xG.js.map} +1 -1
  161. package/dist/chunks/stance-CarrcbbP.js +17 -0
  162. package/dist/chunks/stance-CarrcbbP.js.map +1 -0
  163. package/dist/chunks/useReorderDragList-Dcezzgix.js +131 -0
  164. package/dist/chunks/useReorderDragList-Dcezzgix.js.map +1 -0
  165. package/dist/chunks/{useRovingTabIndex-Dkpf_KhN.js → useRovingTabIndex-B4uJqiKP.js} +1 -1
  166. package/dist/chunks/useRovingTabIndex-B4uJqiKP.js.map +1 -0
  167. package/dist/color/ramp.d.ts +38 -0
  168. package/dist/color/ramp.d.ts.map +1 -0
  169. package/dist/components/ActionBar/ActionBar.d.ts +6 -4
  170. package/dist/components/ActionBar/ActionBar.d.ts.map +1 -1
  171. package/dist/components/ActionBar/index.js +1 -1
  172. package/dist/components/Badge/Badge.d.ts +21 -7
  173. package/dist/components/Badge/Badge.d.ts.map +1 -1
  174. package/dist/components/Badge/effects/Aqua.d.ts +1 -1
  175. package/dist/components/Badge/effects/Aqua.d.ts.map +1 -1
  176. package/dist/components/Badge/index.d.ts +1 -1
  177. package/dist/components/Badge/index.d.ts.map +1 -1
  178. package/dist/components/Badge/index.js +1 -1
  179. package/dist/components/Badge/types.d.ts +6 -5
  180. package/dist/components/Badge/types.d.ts.map +1 -1
  181. package/dist/components/BandEditor/index.js +1 -1
  182. package/dist/components/Button/Button.d.ts +17 -3
  183. package/dist/components/Button/Button.d.ts.map +1 -1
  184. package/dist/components/Button/index.d.ts +1 -1
  185. package/dist/components/Button/index.d.ts.map +1 -1
  186. package/dist/components/Button/index.js +1 -1
  187. package/dist/components/ButtonBar/ButtonBar.d.ts +36 -0
  188. package/dist/components/ButtonBar/ButtonBar.d.ts.map +1 -0
  189. package/dist/components/ButtonBar/index.d.ts +3 -0
  190. package/dist/components/ButtonBar/index.d.ts.map +1 -0
  191. package/dist/components/ButtonBar/index.js +2 -0
  192. package/dist/components/Callout/Callout.d.ts +2 -5
  193. package/dist/components/Callout/Callout.d.ts.map +1 -1
  194. package/dist/components/Callout/index.d.ts +1 -1
  195. package/dist/components/Callout/index.d.ts.map +1 -1
  196. package/dist/components/Callout/index.js +1 -1
  197. package/dist/components/Checkbox/index.js +1 -1
  198. package/dist/components/Code/Code.d.ts +28 -0
  199. package/dist/components/Code/Code.d.ts.map +1 -0
  200. package/dist/components/Code/index.d.ts +3 -0
  201. package/dist/components/Code/index.d.ts.map +1 -0
  202. package/dist/components/Code/index.js +2 -0
  203. package/dist/components/ColorField/index.js +1 -1
  204. package/dist/components/ColorModeControl/ColorModeControl.d.ts +21 -0
  205. package/dist/components/ColorModeControl/ColorModeControl.d.ts.map +1 -0
  206. package/dist/components/ColorModeControl/index.d.ts +3 -0
  207. package/dist/components/ColorModeControl/index.d.ts.map +1 -0
  208. package/dist/components/ColorModeControl/index.js +2 -0
  209. package/dist/components/ComboBox/index.js +1 -1
  210. package/dist/components/CurveEditor/index.js +3 -3
  211. package/dist/components/DataGrid/DataGrid.d.ts +22 -0
  212. package/dist/components/DataGrid/DataGrid.d.ts.map +1 -1
  213. package/dist/components/DataGrid/index.js +1 -1
  214. package/dist/components/DetailList/DetailList.d.ts +36 -0
  215. package/dist/components/DetailList/DetailList.d.ts.map +1 -0
  216. package/dist/components/DetailList/index.d.ts +3 -0
  217. package/dist/components/DetailList/index.d.ts.map +1 -0
  218. package/dist/components/DetailList/index.js +2 -0
  219. package/dist/components/DetentSlider/index.js +1 -1
  220. package/dist/components/Dialog/Dialog.d.ts +8 -2
  221. package/dist/components/Dialog/Dialog.d.ts.map +1 -1
  222. package/dist/components/Dialog/index.js +1 -1
  223. package/dist/components/Disclosure/Disclosure.d.ts +25 -17
  224. package/dist/components/Disclosure/Disclosure.d.ts.map +1 -1
  225. package/dist/components/Disclosure/index.d.ts +2 -2
  226. package/dist/components/Disclosure/index.d.ts.map +1 -1
  227. package/dist/components/Disclosure/index.js +2 -2
  228. package/dist/components/DragGhost/DragGhost.d.ts +21 -0
  229. package/dist/components/DragGhost/DragGhost.d.ts.map +1 -0
  230. package/dist/components/DragGhost/index.d.ts +3 -0
  231. package/dist/components/DragGhost/index.d.ts.map +1 -0
  232. package/dist/components/DragGhost/index.js +2 -0
  233. package/dist/components/DragHandleGlyph/index.js +1 -1
  234. package/dist/components/Field/index.js +1 -1
  235. package/dist/components/FillStrokeSwatch/FillStrokeSwatch.d.ts +45 -0
  236. package/dist/components/FillStrokeSwatch/FillStrokeSwatch.d.ts.map +1 -0
  237. package/dist/components/FillStrokeSwatch/index.d.ts +3 -0
  238. package/dist/components/FillStrokeSwatch/index.d.ts.map +1 -0
  239. package/dist/components/FillStrokeSwatch/index.js +2 -0
  240. package/dist/components/FontFamilySelect/index.js +1 -1
  241. package/dist/components/GradientEditor/SceneGradientHandles.d.ts.map +1 -1
  242. package/dist/components/GradientEditor/index.js +1 -1
  243. package/dist/components/InlineRange/InlineRange.d.ts +6 -2
  244. package/dist/components/InlineRange/InlineRange.d.ts.map +1 -1
  245. package/dist/components/InlineRange/index.js +1 -1
  246. package/dist/components/Input/Input.d.ts +13 -0
  247. package/dist/components/Input/Input.d.ts.map +1 -1
  248. package/dist/components/Input/index.js +1 -1
  249. package/dist/components/ItemList/ItemList.d.ts +70 -10
  250. package/dist/components/ItemList/ItemList.d.ts.map +1 -1
  251. package/dist/components/ItemList/index.js +1 -1
  252. package/dist/components/Jog/index.js +1 -1
  253. package/dist/components/Keycaps/index.d.ts +1 -0
  254. package/dist/components/Keycaps/index.d.ts.map +1 -1
  255. package/dist/components/Keycaps/index.js +3 -3
  256. package/dist/components/Keycaps/keySpecsFromMods.d.ts +2 -0
  257. package/dist/components/Keycaps/keySpecsFromMods.d.ts.map +1 -1
  258. package/dist/components/Keycaps/keySpecsFromShortcut.d.ts +16 -0
  259. package/dist/components/Keycaps/keySpecsFromShortcut.d.ts.map +1 -0
  260. package/dist/components/LayerList/LayerList.d.ts +79 -0
  261. package/dist/components/LayerList/LayerList.d.ts.map +1 -0
  262. package/dist/components/LayerList/index.d.ts +3 -0
  263. package/dist/components/LayerList/index.d.ts.map +1 -0
  264. package/dist/components/LayerList/index.js +2 -0
  265. package/dist/components/LayerList/useSceneLayerList.d.ts +20 -0
  266. package/dist/components/LayerList/useSceneLayerList.d.ts.map +1 -0
  267. package/dist/components/ListEditor/ListEditor.d.ts +23 -0
  268. package/dist/components/ListEditor/ListEditor.d.ts.map +1 -0
  269. package/dist/components/ListEditor/index.d.ts +3 -0
  270. package/dist/components/ListEditor/index.d.ts.map +1 -0
  271. package/dist/components/ListEditor/index.js +2 -0
  272. package/dist/components/MenuButton/MenuButton.d.ts +6 -2
  273. package/dist/components/MenuButton/MenuButton.d.ts.map +1 -1
  274. package/dist/components/MenuButton/index.js +1 -1
  275. package/dist/components/MeshEditor/index.js +1 -1
  276. package/dist/components/NumberField/NumberField.d.ts +13 -0
  277. package/dist/components/NumberField/NumberField.d.ts.map +1 -1
  278. package/dist/components/NumberField/index.js +1 -1
  279. package/dist/components/OptionsBar/index.js +1 -1
  280. package/dist/components/PaintField/index.js +1 -1
  281. package/dist/components/PaintInput/index.js +1 -1
  282. package/dist/components/PatternPicker/index.js +1 -1
  283. package/dist/components/Plot2D/index.js +1 -1
  284. package/dist/components/PointPlotter/index.js +1 -1
  285. package/dist/components/Powerline/Powerline.d.ts +4 -3
  286. package/dist/components/Powerline/Powerline.d.ts.map +1 -1
  287. package/dist/components/Powerline/index.js +2 -2
  288. package/dist/components/Prefs/PrefsDialog.d.ts +10 -2
  289. package/dist/components/Prefs/PrefsDialog.d.ts.map +1 -1
  290. package/dist/components/Prefs/PrefsForm.d.ts +26 -25
  291. package/dist/components/Prefs/PrefsForm.d.ts.map +1 -1
  292. package/dist/components/Prefs/PrefsPane.d.ts +24 -0
  293. package/dist/components/Prefs/PrefsPane.d.ts.map +1 -0
  294. package/dist/components/Prefs/PrefsRail.d.ts +32 -0
  295. package/dist/components/Prefs/PrefsRail.d.ts.map +1 -0
  296. package/dist/components/Prefs/PrefsRow.d.ts +32 -0
  297. package/dist/components/Prefs/PrefsRow.d.ts.map +1 -0
  298. package/dist/components/Prefs/index.d.ts +5 -2
  299. package/dist/components/Prefs/index.d.ts.map +1 -1
  300. package/dist/components/Prefs/index.js +3 -3
  301. package/dist/components/Prefs/prefField.d.ts +36 -0
  302. package/dist/components/Prefs/prefField.d.ts.map +1 -0
  303. package/dist/components/Prefs/schema.d.ts +30 -0
  304. package/dist/components/Prefs/schema.d.ts.map +1 -1
  305. package/dist/components/Properties/DialogRow.d.ts +33 -0
  306. package/dist/components/Properties/DialogRow.d.ts.map +1 -0
  307. package/dist/components/Properties/PropertyField.d.ts +238 -0
  308. package/dist/components/Properties/PropertyField.d.ts.map +1 -0
  309. package/dist/components/Properties/PropertyGroup.d.ts +12 -3
  310. package/dist/components/Properties/PropertyGroup.d.ts.map +1 -1
  311. package/dist/components/Properties/PropertyPanel.d.ts +32 -236
  312. package/dist/components/Properties/PropertyPanel.d.ts.map +1 -1
  313. package/dist/components/Properties/Subpanel.d.ts +14 -0
  314. package/dist/components/Properties/Subpanel.d.ts.map +1 -0
  315. package/dist/components/Properties/index.d.ts +8 -4
  316. package/dist/components/Properties/index.d.ts.map +1 -1
  317. package/dist/components/Properties/index.js +3 -2
  318. package/dist/components/Properties/storyLayouts.d.ts.map +1 -1
  319. package/dist/components/RadioGroup/index.js +1 -1
  320. package/dist/components/RangeSlider/index.js +1 -1
  321. package/dist/components/ResizeHandle/index.js +1 -1
  322. package/dist/components/Select/Select.d.ts +38 -5
  323. package/dist/components/Select/Select.d.ts.map +1 -1
  324. package/dist/components/Select/index.d.ts +2 -2
  325. package/dist/components/Select/index.d.ts.map +1 -1
  326. package/dist/components/Select/index.js +2 -2
  327. package/dist/components/SelectionPanel/index.js +2 -2
  328. package/dist/components/SelectionPanel/renderLeaf.d.ts +14 -8
  329. package/dist/components/SelectionPanel/renderLeaf.d.ts.map +1 -1
  330. package/dist/components/Sidebar/index.js +1 -1
  331. package/dist/components/SidebarPanel/SidebarPanel.d.ts +2 -2
  332. package/dist/components/SidebarPanel/SidebarPanel.d.ts.map +1 -1
  333. package/dist/components/SidebarPanel/index.js +1 -1
  334. package/dist/components/Slider/index.js +1 -1
  335. package/dist/components/StatusBar/index.js +1 -1
  336. package/dist/components/SwatchGrid/SwatchGrid.d.ts +34 -0
  337. package/dist/components/SwatchGrid/SwatchGrid.d.ts.map +1 -0
  338. package/dist/components/SwatchGrid/index.d.ts +3 -0
  339. package/dist/components/SwatchGrid/index.d.ts.map +1 -0
  340. package/dist/components/SwatchGrid/index.js +2 -0
  341. package/dist/components/Switch/index.js +1 -1
  342. package/dist/components/Tabs/index.js +1 -1
  343. package/dist/components/Timeline/Lane.d.ts.map +1 -1
  344. package/dist/components/Timeline/index.js +1 -1
  345. package/dist/components/Toast/index.js +1 -1
  346. package/dist/components/ToggleBar/ToggleBar.d.ts +2 -1
  347. package/dist/components/ToggleBar/ToggleBar.d.ts.map +1 -1
  348. package/dist/components/ToggleBar/index.js +1 -1
  349. package/dist/components/TokenPanel/index.js +1 -1
  350. package/dist/components/ToolButton/index.js +1 -1
  351. package/dist/components/ToolGroup/index.js +1 -1
  352. package/dist/components/ToolOptionsBar/index.js +1 -1
  353. package/dist/components/ToolPalette/index.d.ts +1 -0
  354. package/dist/components/ToolPalette/index.d.ts.map +1 -1
  355. package/dist/components/ToolPalette/index.js +3 -2
  356. package/dist/components/Tooltip/Tooltip.d.ts +6 -2
  357. package/dist/components/Tooltip/Tooltip.d.ts.map +1 -1
  358. package/dist/components/Tooltip/index.d.ts +1 -1
  359. package/dist/components/Tooltip/index.d.ts.map +1 -1
  360. package/dist/components/Tooltip/index.js +2 -2
  361. package/dist/components/Tree/Tree.d.ts +84 -0
  362. package/dist/components/Tree/Tree.d.ts.map +1 -0
  363. package/dist/components/Tree/index.d.ts +3 -0
  364. package/dist/components/Tree/index.d.ts.map +1 -0
  365. package/dist/components/Tree/index.js +2 -0
  366. package/dist/components/segmentTooltip.d.ts +30 -0
  367. package/dist/components/segmentTooltip.d.ts.map +1 -0
  368. package/dist/components/stance.d.ts +30 -0
  369. package/dist/components/stance.d.ts.map +1 -0
  370. package/dist/components/stanceCss.d.ts +31 -0
  371. package/dist/components/stanceCss.d.ts.map +1 -0
  372. package/dist/components/stanceSurfaces.d.ts +4 -0
  373. package/dist/components/stanceSurfaces.d.ts.map +1 -0
  374. package/dist/format/number.d.ts +3 -2
  375. package/dist/format/number.d.ts.map +1 -1
  376. package/dist/icons/Icon.d.ts.map +1 -1
  377. package/dist/icons/ShapeKindIcon.d.ts +10 -0
  378. package/dist/icons/ShapeKindIcon.d.ts.map +1 -0
  379. package/dist/icons/index.d.ts +5 -3
  380. package/dist/icons/index.d.ts.map +1 -1
  381. package/dist/icons/paths.d.ts +2 -0
  382. package/dist/icons/paths.d.ts.map +1 -1
  383. package/dist/index.d.ts +16 -3
  384. package/dist/index.d.ts.map +1 -1
  385. package/dist/index.js +110 -78
  386. package/dist/index.js.map +1 -1
  387. package/dist/interactiveTarget.d.ts +9 -0
  388. package/dist/interactiveTarget.d.ts.map +1 -0
  389. package/dist/style.css +1 -1
  390. package/dist/useReorderDragList.d.ts +36 -7
  391. package/dist/useReorderDragList.d.ts.map +1 -1
  392. package/dist/useRovingTabIndex.d.ts +1 -1
  393. package/dist/useScrollSpy.d.ts +48 -0
  394. package/dist/useScrollSpy.d.ts.map +1 -0
  395. package/package.json +8 -8
  396. package/dist/chunks/ActionBar-CLwiY3Jg.js +0 -62
  397. package/dist/chunks/ActionBar-CLwiY3Jg.js.map +0 -1
  398. package/dist/chunks/ActionsBar-D84a4eGy.js +0 -41
  399. package/dist/chunks/ActionsBar-D84a4eGy.js.map +0 -1
  400. package/dist/chunks/Badge-CW9pBPFl.js.map +0 -1
  401. package/dist/chunks/Button-DRSApvnK.js +0 -90
  402. package/dist/chunks/Button-DRSApvnK.js.map +0 -1
  403. package/dist/chunks/Callout-DrNu-9Qr.js +0 -122
  404. package/dist/chunks/Callout-DrNu-9Qr.js.map +0 -1
  405. package/dist/chunks/ColorField-BYzgZM9o.js.map +0 -1
  406. package/dist/chunks/DataGrid-C8KrYtw7.js +0 -104
  407. package/dist/chunks/DataGrid-C8KrYtw7.js.map +0 -1
  408. package/dist/chunks/Dialog-fGqqQ6o_.js +0 -61
  409. package/dist/chunks/Dialog-fGqqQ6o_.js.map +0 -1
  410. package/dist/chunks/Disclosure-CILDfWsU.js +0 -47
  411. package/dist/chunks/Disclosure-CILDfWsU.js.map +0 -1
  412. package/dist/chunks/GradientEditor-rRBmf3G0.js +0 -333
  413. package/dist/chunks/Icon-DT0x6HaQ.js.map +0 -1
  414. package/dist/chunks/InlineRange-DdIlfGqG.js +0 -29
  415. package/dist/chunks/InlineRange-DdIlfGqG.js.map +0 -1
  416. package/dist/chunks/Input-DbMKpkXy.js.map +0 -1
  417. package/dist/chunks/ItemList-B9zYb0GE.js +0 -42
  418. package/dist/chunks/ItemList-B9zYb0GE.js.map +0 -1
  419. package/dist/chunks/Keycaps-DunVpejA.js.map +0 -1
  420. package/dist/chunks/LayerStack-CfQ6GsRz.js +0 -142
  421. package/dist/chunks/LayerStack-CfQ6GsRz.js.map +0 -1
  422. package/dist/chunks/MenuButton-C_4nox39.js +0 -60
  423. package/dist/chunks/MenuButton-C_4nox39.js.map +0 -1
  424. package/dist/chunks/MeshEditor-Bipz-Ocl.js +0 -123
  425. package/dist/chunks/MeshEditor-Bipz-Ocl.js.map +0 -1
  426. package/dist/chunks/NumberField-CCjEDZCg.js.map +0 -1
  427. package/dist/chunks/PaintField-jBOJ32rL.js.map +0 -1
  428. package/dist/chunks/Powerline-Ak5AWUlK.js.map +0 -1
  429. package/dist/chunks/Prefs-CNC8tzyN.js +0 -308
  430. package/dist/chunks/Prefs-CNC8tzyN.js.map +0 -1
  431. package/dist/chunks/Properties-Rnb6TAbN.js +0 -891
  432. package/dist/chunks/Properties-Rnb6TAbN.js.map +0 -1
  433. package/dist/chunks/Select-BEope086.js +0 -190
  434. package/dist/chunks/Select-BEope086.js.map +0 -1
  435. package/dist/chunks/SidebarPanel-Bs6V21hg.js.map +0 -1
  436. package/dist/chunks/Timeline-DNKY_yiK.js.map +0 -1
  437. package/dist/chunks/ToggleBar-CClus5Cd.js +0 -75
  438. package/dist/chunks/ToolPalette-DGkKwE7D.js +0 -97
  439. package/dist/chunks/ToolPalette-DGkKwE7D.js.map +0 -1
  440. package/dist/chunks/Tooltip-C4YBczLq.js.map +0 -1
  441. package/dist/chunks/icons-DFLytcui.js +0 -165
  442. package/dist/chunks/icons-DFLytcui.js.map +0 -1
  443. package/dist/chunks/model-13kZ_-mE.js +0 -483
  444. package/dist/chunks/model-13kZ_-mE.js.map +0 -1
  445. package/dist/chunks/number-BHz66zQO.js.map +0 -1
  446. package/dist/chunks/range.module-DSsOIq1R.js +0 -8
  447. package/dist/chunks/range.module-DSsOIq1R.js.map +0 -1
  448. package/dist/chunks/schema-Dft4Cu2p.js +0 -47
  449. package/dist/chunks/schema-Dft4Cu2p.js.map +0 -1
  450. package/dist/chunks/segmentedControl.module-DS72X1ns.js +0 -11
  451. package/dist/chunks/segmentedControl.module-DS72X1ns.js.map +0 -1
  452. package/dist/chunks/useReorderDragList-CSQGd7zQ.js +0 -102
  453. package/dist/chunks/useReorderDragList-CSQGd7zQ.js.map +0 -1
  454. package/dist/chunks/useRovingTabIndex-Dkpf_KhN.js.map +0 -1
  455. package/dist/components/ActionsBar/ActionsBar.d.ts +0 -35
  456. package/dist/components/ActionsBar/ActionsBar.d.ts.map +0 -1
  457. package/dist/components/ActionsBar/index.d.ts +0 -3
  458. package/dist/components/ActionsBar/index.d.ts.map +0 -1
  459. package/dist/components/ActionsBar/index.js +0 -2
  460. package/dist/components/LayerStack/LayerStack.d.ts +0 -62
  461. package/dist/components/LayerStack/LayerStack.d.ts.map +0 -1
  462. package/dist/components/LayerStack/index.d.ts +0 -2
  463. package/dist/components/LayerStack/index.d.ts.map +0 -1
  464. package/dist/components/LayerStack/index.js +0 -2
  465. package/dist/components/Properties/EffectCard.d.ts +0 -69
  466. package/dist/components/Properties/EffectCard.d.ts.map +0 -1
@@ -0,0 +1,333 @@
1
+ import { t as e } from "./ColorField-DJSCuSJv.js";
2
+ import { t } from "./Slider-BwRrWHFW.js";
3
+ import { t as n } from "./ToggleBar-Btnl5r7F.js";
4
+ import { fillInPoseFrame as r, fillToBoundsFrame as i, gradientGeometry as a, isGradientFill as o, sampleGradientStops as s, useHandleDrag as c, useNodeOverlayFrame as l, useOngoingAction as u, withGradientKind as d } from "@weasel-js/core";
5
+ import { Fragment as f, jsx as p, jsxs as m } from "react/jsx-runtime";
6
+ import { useCallback as h, useRef as g } from "react";
7
+ //#region src/paintGradientTrack.tsx
8
+ var _ = {
9
+ angleDeg: 135,
10
+ stripe: 2,
11
+ gap: 4,
12
+ dim: 75
13
+ };
14
+ function v(e) {
15
+ let { gradient: t, samples: n = 16, activeRange: r, hatch: i } = e;
16
+ return (e) => {
17
+ let a = [];
18
+ for (let e = 0; e <= n; e++) {
19
+ let r = e / n;
20
+ a.push(`${t(r)} ${(r * 100).toFixed(1)}%`);
21
+ }
22
+ let o = `linear-gradient(to right, ${a.join(", ")})`, s = [];
23
+ if (r) {
24
+ let t = e.valueToFraction(r[0]) * 100, n = e.valueToFraction(r[1]) * 100, a = {
25
+ ..._,
26
+ ...i
27
+ }, o = `repeating-linear-gradient(${a.angleDeg}deg, transparent 0 ${a.stripe}px, var(--wzl-surface) ${a.stripe}px ${a.stripe + a.gap}px)`, c = `color-mix(in srgb, var(--wzl-surface) ${a.dim}%, transparent)`, l = `linear-gradient(${c}, ${c})`;
28
+ if (t > 0 && (s.push(`${l} left 0 / ${t.toFixed(2)}% 100% no-repeat`), s.push(`${o} left 0 / ${t.toFixed(2)}% 100% no-repeat`)), n < 100) {
29
+ let e = (100 - n).toFixed(2);
30
+ s.push(`${l} right 0 / ${e}% 100% no-repeat`), s.push(`${o} right 0 / ${e}% 100% no-repeat`);
31
+ }
32
+ }
33
+ return s.push(o), /* @__PURE__ */ p("div", { style: {
34
+ position: "absolute",
35
+ inset: 0,
36
+ background: s.join(", ")
37
+ } });
38
+ };
39
+ }
40
+ var y = {
41
+ root: "_root_c0ev4_1",
42
+ swatches: "_swatches_c0ev4_8",
43
+ swatch: "_swatch_c0ev4_8"
44
+ }, b = [
45
+ {
46
+ value: "linear-gradient",
47
+ label: "Linear"
48
+ },
49
+ {
50
+ value: "radial-gradient",
51
+ label: "Radial"
52
+ },
53
+ {
54
+ value: "conic-gradient",
55
+ label: "Conic"
56
+ }
57
+ ], x = [
58
+ {
59
+ value: "rgb",
60
+ label: "sRGB"
61
+ },
62
+ {
63
+ value: "oklab",
64
+ label: "OKLab"
65
+ },
66
+ {
67
+ value: "oklch",
68
+ label: "OKLCh"
69
+ }
70
+ ], S = 2;
71
+ function C(r) {
72
+ let { value: i, onInput: a, onChange: o, kindSwitch: c = !0, spaceSwitch: l = !0, className: u } = r, f = i.stops, g = i.interpolate ?? "rgb", _ = h((e) => ({
73
+ ...i,
74
+ stops: e
75
+ }), [i]), C = f.map((e) => ({
76
+ value: e.offset,
77
+ color: e.color
78
+ })), w = (e) => e.map((e) => ({
79
+ offset: e.value,
80
+ color: e.color
81
+ })), T = (e, t) => f.map((n, r) => r === e ? {
82
+ ...n,
83
+ color: t
84
+ } : n), E = f.map((e, t) => ({
85
+ stop: e,
86
+ index: t
87
+ })).sort((e, t) => e.stop.offset - t.stop.offset);
88
+ return /* @__PURE__ */ m("div", {
89
+ className: [y.root, u].filter(Boolean).join(" "),
90
+ children: [
91
+ c && /* @__PURE__ */ p(n, {
92
+ items: b,
93
+ value: i.fill,
94
+ size: "sm",
95
+ ariaLabel: "Gradient kind",
96
+ onChange: (e) => e && o(d(i, e))
97
+ }),
98
+ /* @__PURE__ */ p(t, {
99
+ min: 0,
100
+ max: 1,
101
+ step: .005,
102
+ constraint: "free",
103
+ thumbs: C,
104
+ ariaLabel: "Gradient stops",
105
+ readoutPlacement: "none",
106
+ onInput: (e) => a?.(_(w(e))),
107
+ onChange: (e) => o(_(w(e))),
108
+ onAddThumb: (e) => ({
109
+ value: e,
110
+ color: s(f, e, g)
111
+ }),
112
+ onRemoveThumb: () => f.length > S,
113
+ renderTrack: v({
114
+ gradient: (e) => s(f, e, g),
115
+ samples: g === "rgb" ? 32 : 64
116
+ })
117
+ }),
118
+ l && /* @__PURE__ */ p(n, {
119
+ items: x,
120
+ value: g,
121
+ size: "sm",
122
+ ariaLabel: "Blend space",
123
+ onChange: (e) => e && o({
124
+ ...i,
125
+ interpolate: e
126
+ })
127
+ }),
128
+ /* @__PURE__ */ p("div", {
129
+ className: y.swatches,
130
+ children: E.map(({ stop: t, index: n }) => /* @__PURE__ */ p(e, {
131
+ value: t.color,
132
+ alpha: !0,
133
+ "aria-label": `Stop ${n + 1} at ${Math.round(t.offset * 100)}%`,
134
+ className: y.swatch,
135
+ onInput: (e) => a?.(_(T(n, e))),
136
+ onChange: (e) => o(_(T(n, e)))
137
+ }, n))
138
+ })
139
+ ]
140
+ });
141
+ }
142
+ var w = {
143
+ overlay: "_overlay_6yu3h_3",
144
+ guide: "_guide_6yu3h_13",
145
+ handle: "_handle_6yu3h_21"
146
+ };
147
+ //#endregion
148
+ //#region src/components/GradientEditor/GradientHandles.tsx
149
+ function T(e) {
150
+ let { value: t, toScreen: n, toLocal: r, onInput: i, onChange: a, width: o, height: s, className: c } = e;
151
+ return /* @__PURE__ */ p("svg", {
152
+ className: [w.overlay, c].filter(Boolean).join(" "),
153
+ width: o,
154
+ height: s,
155
+ children: E(t, n, r, i, a)
156
+ });
157
+ }
158
+ function E(e, t, n, r, i) {
159
+ let o = (e, t) => {
160
+ t === "input" ? r?.(e) : i(e);
161
+ };
162
+ if (e.fill === "linear-gradient") {
163
+ let r = t(e.from), i = t(e.to);
164
+ return /* @__PURE__ */ m(f, { children: [
165
+ /* @__PURE__ */ p(O, {
166
+ x1: r.x,
167
+ y1: r.y,
168
+ x2: i.x,
169
+ y2: i.y
170
+ }),
171
+ /* @__PURE__ */ p(k, {
172
+ at: r,
173
+ label: "Gradient start",
174
+ onDrag: (t, r) => o({
175
+ ...e,
176
+ from: n(t)
177
+ }, r)
178
+ }),
179
+ /* @__PURE__ */ p(k, {
180
+ at: i,
181
+ label: "Gradient end",
182
+ onDrag: (t, r) => o({
183
+ ...e,
184
+ to: n(t)
185
+ }, r)
186
+ })
187
+ ] });
188
+ }
189
+ if (e.fill === "radial-gradient") {
190
+ let r = t(e.center), i = t({
191
+ x: e.center.x + e.radius,
192
+ y: e.center.y
193
+ }), a = Math.hypot(i.x - r.x, i.y - r.y);
194
+ return /* @__PURE__ */ m(f, { children: [
195
+ /* @__PURE__ */ p("circle", {
196
+ className: w.guide,
197
+ cx: r.x,
198
+ cy: r.y,
199
+ r: a
200
+ }),
201
+ /* @__PURE__ */ p(k, {
202
+ at: r,
203
+ label: "Gradient center",
204
+ onDrag: (t, r) => o({
205
+ ...e,
206
+ center: n(t)
207
+ }, r)
208
+ }),
209
+ /* @__PURE__ */ p(k, {
210
+ at: i,
211
+ label: "Gradient radius",
212
+ onDrag: (t, r) => {
213
+ let i = n(t), a = Math.hypot(i.x - e.center.x, i.y - e.center.y);
214
+ o({
215
+ ...e,
216
+ radius: Math.max(D, a)
217
+ }, r);
218
+ }
219
+ })
220
+ ] });
221
+ }
222
+ let s = t(e.center), { radius: c } = a(e), l = t({
223
+ x: e.center.x + Math.cos(e.angle) * c,
224
+ y: e.center.y + Math.sin(e.angle) * c
225
+ });
226
+ return /* @__PURE__ */ m(f, { children: [
227
+ /* @__PURE__ */ p(O, {
228
+ x1: s.x,
229
+ y1: s.y,
230
+ x2: l.x,
231
+ y2: l.y
232
+ }),
233
+ /* @__PURE__ */ p(k, {
234
+ at: s,
235
+ label: "Gradient center",
236
+ onDrag: (t, r) => o({
237
+ ...e,
238
+ center: n(t)
239
+ }, r)
240
+ }),
241
+ /* @__PURE__ */ p(k, {
242
+ at: l,
243
+ label: "Gradient angle",
244
+ onDrag: (t, r) => {
245
+ let i = n(t), a = Math.atan2(i.y - e.center.y, i.x - e.center.x);
246
+ o({
247
+ ...e,
248
+ angle: a
249
+ }, r);
250
+ }
251
+ })
252
+ ] });
253
+ }
254
+ var D = 1;
255
+ function O(e) {
256
+ return /* @__PURE__ */ p("line", {
257
+ className: w.guide,
258
+ ...e
259
+ });
260
+ }
261
+ function k({ at: e, label: t, onDrag: n }) {
262
+ let r = g(e), i = c({
263
+ onStart: () => {
264
+ r.current = e;
265
+ },
266
+ onMove: (e) => {
267
+ n(e, "input");
268
+ },
269
+ onEnd: ({ point: e, moved: t }) => {
270
+ t && n(e, "commit");
271
+ },
272
+ onCancel: () => {
273
+ n(r.current, "input");
274
+ }
275
+ });
276
+ return /* @__PURE__ */ p("circle", {
277
+ className: w.handle,
278
+ cx: e.x,
279
+ cy: e.y,
280
+ r: A,
281
+ role: "button",
282
+ "aria-label": t,
283
+ tabIndex: 0,
284
+ onKeyDown: (t) => {
285
+ let r = t.shiftKey ? j * 10 : j, i = 0, a = 0;
286
+ if (t.key === "ArrowLeft") i = -r;
287
+ else if (t.key === "ArrowRight") i = r;
288
+ else if (t.key === "ArrowUp") a = -r;
289
+ else if (t.key === "ArrowDown") a = r;
290
+ else return;
291
+ t.preventDefault();
292
+ let o = {
293
+ x: e.x + i,
294
+ y: e.y + a
295
+ };
296
+ n(o, "input"), n(o, "commit");
297
+ },
298
+ ...i
299
+ });
300
+ }
301
+ var A = 7, j = 1;
302
+ //#endregion
303
+ //#region src/components/GradientEditor/SceneGradientHandles.tsx
304
+ function M(e) {
305
+ let { scene: t, containerRef: n, nodeId: a, slot: o, view: s, className: c } = e, d = l(t, n, a, { view: s }), f = u(o === "fill" ? "setFill" : "setStroke"), m = d ? P(N(t, a, o)) : null;
306
+ if (!d || !m) return null;
307
+ let h = (e, t) => {
308
+ let n = i(e, d.box);
309
+ t === "commit" ? f.commit({ paint: n }) : f.input({ paint: n });
310
+ };
311
+ return /* @__PURE__ */ p(T, {
312
+ value: r(m, d.box),
313
+ toScreen: d.toScreen,
314
+ toLocal: d.toLocal,
315
+ width: d.width,
316
+ height: d.height,
317
+ className: c,
318
+ onInput: (e) => h(e, "input"),
319
+ onChange: (e) => h(e, "commit")
320
+ });
321
+ }
322
+ function N(e, t, n) {
323
+ if (t == null) return;
324
+ let r = e.nodes.get(t)?.data;
325
+ if (r) return n === "fill" ? r.fill : r.stroke?.paint;
326
+ }
327
+ function P(e) {
328
+ return o(e) ? e : null;
329
+ }
330
+ //#endregion
331
+ export { v as i, T as n, C as r, M as t };
332
+
333
+ //# sourceMappingURL=GradientEditor-BRTxHG-W.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"GradientEditor-rRBmf3G0.js","names":[],"sources":["../../src/paintGradientTrack.tsx","../../src/components/GradientEditor/GradientEditor.module.css","../../src/components/GradientEditor/GradientEditor.tsx","../../src/components/GradientEditor/GradientHandles.module.css","../../src/components/GradientEditor/GradientHandles.tsx","../../src/components/GradientEditor/SceneGradientHandles.tsx"],"sourcesContent":["import type { ReactNode, CSSProperties } from 'react';\nimport type { TrackCtx } from './components/Slider';\n\n/**\n * Options for {@link paintGradientTrack}.\n *\n * `gradient` maps a normalized position along the track (0 to 1) to a CSS\n * color; `samples` is how many stops the resulting linear-gradient uses.\n * `activeRange`, given in the slider's own value units, keeps that span at\n * full strength and dims + hatches the rest.\n */\nexport type GradientTrackOpts = {\n gradient: (t: number) => string;\n samples?: number;\n activeRange?: [number, number];\n hatch?: {\n angleDeg?: number;\n stripe?: number;\n gap?: number;\n dim?: number;\n };\n};\n\nconst DEFAULT_HATCH = { angleDeg: 135, stripe: 2, gap: 4, dim: 75 };\n\n/**\n * Builds a `Slider` `renderTrack` function that paints the track as a\n * sampled color gradient, optionally dimming and hatching the portions\n * outside an active range.\n */\nexport function paintGradientTrack(opts: GradientTrackOpts): (ctx: TrackCtx) => ReactNode {\n const { gradient, samples = 16, activeRange, hatch } = opts;\n\n return (ctx: TrackCtx) => {\n const stops: string[] = [];\n for (let i = 0; i <= samples; i++) {\n const t = i / samples;\n stops.push(`${gradient(t)} ${(t * 100).toFixed(1)}%`);\n }\n const baseGradient = `linear-gradient(to right, ${stops.join(', ')})`;\n\n const layers: string[] = [];\n if (activeRange) {\n const lowPct = ctx.valueToFraction(activeRange[0]) * 100;\n const highPct = ctx.valueToFraction(activeRange[1]) * 100;\n const h = { ...DEFAULT_HATCH, ...hatch };\n const stripe = `repeating-linear-gradient(${h.angleDeg}deg, transparent 0 ${h.stripe}px, var(--wzl-surface) ${h.stripe}px ${h.stripe + h.gap}px)`;\n const dimColor = `color-mix(in srgb, var(--wzl-surface) ${h.dim}%, transparent)`;\n const dimOverlay = `linear-gradient(${dimColor}, ${dimColor})`;\n\n if (lowPct > 0) {\n layers.push(`${dimOverlay} left 0 / ${lowPct.toFixed(2)}% 100% no-repeat`);\n layers.push(`${stripe} left 0 / ${lowPct.toFixed(2)}% 100% no-repeat`);\n }\n if (highPct < 100) {\n const wR = (100 - highPct).toFixed(2);\n layers.push(`${dimOverlay} right 0 / ${wR}% 100% no-repeat`);\n layers.push(`${stripe} right 0 / ${wR}% 100% no-repeat`);\n }\n }\n layers.push(baseGradient);\n\n const style: CSSProperties = {\n position: 'absolute',\n inset: 0,\n background: layers.join(', '),\n };\n return <div style={style} />;\n };\n}\n",".root {\n display: flex;\n flex-direction: column;\n gap: var(--wzl-space-4);\n min-inline-size: 0;\n}\n\n.swatches {\n display: flex;\n flex-wrap: wrap;\n gap: var(--wzl-space-3);\n}\n\n/* Each stop's opacity slider would otherwise stretch the row to a width no\n * properties panel has; the chip stays legible, the slider yields. */\n.swatch {\n flex: 0 1 auto;\n min-inline-size: 0;\n}\n","import { useCallback, type ReactElement } from 'react';\nimport {\n sampleGradientStops,\n withGradientKind,\n type ColorSpace,\n type GradStop,\n type GradientFill,\n type GradientKind,\n} from '@weasel-js/core';\nimport { Slider, type Thumb } from '../Slider';\nimport { ColorField } from '../ColorField';\nimport { ToggleBar, type ToggleBarItem } from '../ToggleBar';\nimport { paintGradientTrack } from '../../paintGradientTrack';\nimport s from './GradientEditor.module.css';\n\nconst KINDS: readonly ToggleBarItem<GradientKind>[] = [\n { value: 'linear-gradient', label: 'Linear' },\n { value: 'radial-gradient', label: 'Radial' },\n { value: 'conic-gradient', label: 'Conic' },\n];\n\nconst SPACES: readonly ToggleBarItem<ColorSpace>[] = [\n { value: 'rgb', label: 'sRGB' },\n { value: 'oklab', label: 'OKLab' },\n { value: 'oklch', label: 'OKLCh' },\n];\n\n/** Fewer than two stops is not a gradient any renderer can ramp between. */\nconst MIN_STOPS = 2;\n\n/**\n * Props for {@link GradientEditor}. `onInput` fires throughout a gesture and\n * `onChange` once at its end.\n */\nexport interface GradientEditorProps {\n /** The gradient being edited. */\n value: GradientFill;\n /**\n * Live value during a gesture — a stop drag, a color-picker scrub. Wire\n * it for preview; it fires many times per gesture and must not be\n * written to history.\n */\n onInput?: (next: GradientFill) => void;\n /** Committed value: one call per completed gesture. Pair with an\n * undoable write. */\n onChange: (next: GradientFill) => void;\n /** Show the linear / radial / conic switch. Default true; turn it off\n * when the surrounding UI already owns the kind. */\n kindSwitch?: boolean;\n /** Show the sRGB / OKLab / OKLCh switch, which writes `interpolate`.\n * Default true. */\n spaceSwitch?: boolean;\n className?: string;\n}\n\ntype StopThumb = Thumb & { color: string };\n\n/**\n * Editor for a gradient's kind and stop list.\n *\n * Geometry (`from`/`to`, `center`, `radius`, `angle`) is deliberately not\n * edited here — on a canvas that belongs on the artwork, via\n * `<GradientHandles>`. This component owns the parts with no spatial\n * meaning, so it composes into a properties panel at any width.\n *\n * Stops are addressed by their position in `value.stops`, which is never\n * reordered — dragging one stop past another leaves both indices alone, so\n * a drag can cross a neighbour without the two swapping under the pointer.\n * Rendering sorts a copy.\n */\nexport function GradientEditor(props: GradientEditorProps): ReactElement {\n const { value, onInput, onChange, kindSwitch = true, spaceSwitch = true, className } = props;\n const stops = value.stops;\n const space = value.interpolate ?? 'rgb';\n\n const withStops = useCallback(\n (next: GradStop[]): GradientFill => ({ ...value, stops: next }),\n [value],\n );\n\n const thumbs: StopThumb[] = stops.map((stop) => ({ value: stop.offset, color: stop.color }));\n\n const applyThumbs = (next: StopThumb[]): GradStop[] =>\n next.map((t) => ({ offset: t.value, color: t.color }));\n\n const setStopColor = (index: number, color: string): GradStop[] =>\n stops.map((stop, i) => (i === index ? { ...stop, color } : stop));\n\n // Sorted view for the swatch row, carrying each stop's real index so a\n // recolor writes back to the right entry.\n const ordered = stops\n .map((stop, index) => ({ stop, index }))\n .sort((a, b) => a.stop.offset - b.stop.offset);\n\n return (\n <div className={[s.root, className].filter(Boolean).join(' ')}>\n {kindSwitch && (\n <ToggleBar<GradientKind>\n items={KINDS}\n value={value.fill}\n size=\"sm\"\n ariaLabel=\"Gradient kind\"\n onChange={(kind) => kind && onChange(withGradientKind(value, kind))}\n />\n )}\n\n <Slider<StopThumb>\n min={0}\n max={1}\n step={0.005}\n constraint=\"free\"\n thumbs={thumbs}\n ariaLabel=\"Gradient stops\"\n readoutPlacement=\"none\"\n onInput={(next) => onInput?.(withStops(applyThumbs(next)))}\n onChange={(next) => onChange(withStops(applyThumbs(next)))}\n onAddThumb={(at) => ({ value: at, color: sampleGradientStops(stops, at, space) })}\n onRemoveThumb={() => stops.length > MIN_STOPS}\n renderTrack={paintGradientTrack({\n gradient: (t) => sampleGradientStops(stops, t, space),\n // The track lerps between samples in sRGB whatever the gradient does,\n // so a hue arc needs more of them to not read as a straight line.\n samples: space === 'rgb' ? 32 : 64,\n })}\n />\n\n {spaceSwitch && (\n <ToggleBar<ColorSpace>\n items={SPACES}\n value={space}\n size=\"sm\"\n ariaLabel=\"Blend space\"\n onChange={(next) => next && onChange({ ...value, interpolate: next })}\n />\n )}\n\n <div className={s.swatches}>\n {ordered.map(({ stop, index }) => (\n <ColorField\n key={index}\n value={stop.color}\n alpha\n aria-label={`Stop ${index + 1} at ${Math.round(stop.offset * 100)}%`}\n className={s.swatch}\n onInput={(hex) => onInput?.(withStops(setStopColor(index, hex)))}\n onChange={(hex) => onChange(withStops(setStopColor(index, hex)))}\n />\n ))}\n </div>\n </div>\n );\n}\n","/* The overlay covers the canvas but must not intercept tool input; only the\n * handles opt back into hit-testing. */\n.overlay {\n position: absolute;\n inset: 0;\n pointer-events: none;\n}\n\n/* These sit over artwork of unknown color, not over the app's own surface,\n * so they are deliberately not themed: a themed handle disappears against\n * whatever the user painted underneath. White-on-dark reads on anything,\n * which is why every editor draws handles this way. */\n.guide {\n fill: none;\n stroke: #ffffff;\n stroke-opacity: 0.7;\n stroke-dasharray: 4 4;\n paint-order: stroke;\n}\n\n.handle {\n fill: #ffffff;\n stroke: #222222;\n stroke-width: 2;\n cursor: grab;\n pointer-events: auto;\n}\n\n.handle:active {\n cursor: grabbing;\n}\n\n.handle:focus-visible {\n outline: 2px solid var(--wzl-accent, #4a9eff);\n outline-offset: 2px;\n}\n","import { useRef, type KeyboardEvent as ReactKeyboardEvent, type ReactElement, type ReactNode } from 'react';\nimport { useHandleDrag, gradientGeometry, type GradientFill } from '@weasel-js/core';\nimport s from './GradientHandles.module.css';\n\n/** Structural, and deliberately not exported — `Plot2D` and `CurveEditor`\n * each publish their own `Point`, and a third would only be ambiguous at\n * the package barrel. Consumers pass any `{ x, y }`. */\ninterface Point {\n x: number;\n y: number;\n}\n\n/**\n * Props for {@link GradientHandles}. `onInput` fires throughout a drag and\n * `onChange` once at its end.\n */\nexport interface GradientHandlesProps {\n /**\n * The gradient whose geometry these handles move, in a **resolved,\n * isotropic** frame — one where `radius` is a length in the same units as\n * `center.x` and a right angle is a right angle.\n *\n * A `units: 'bounds'` gradient is not such a frame: `x` and `y` are\n * fractions of two different lengths, so a circle there is an ellipse on\n * screen and polar math silently mixes scales. Resolve it first with\n * `fillInPoseFrame(fill, box)` and convert edits back with\n * `fillToBoundsFrame(next, box)`.\n */\n value: GradientFill;\n /**\n * Gradient space → overlay pixels. For a `units: 'local'` gradient this\n * is the node's local-to-screen transform; for `'world'`, the view.\n */\n toScreen: (p: Point) => Point;\n /** Overlay pixels → gradient space. Must invert `toScreen`. */\n toLocal: (p: Point) => Point;\n /** Live during a drag — wire for preview, do not write to history. */\n onInput?: (next: GradientFill) => void;\n /** Committed at drag end: one call per gesture. */\n onChange: (next: GradientFill) => void;\n /** Overlay size in CSS pixels. */\n width: number;\n height: number;\n className?: string;\n}\n\n/**\n * Direct-manipulation handles for a gradient's geometry, drawn as an SVG\n * overlay above a canvas: endpoints for linear, center and radius for\n * radial, center and angle arm for conic.\n *\n * Positioning is entirely the consumer's `toScreen` / `toLocal` — this\n * component never sees a view or a scene node, so the same handles serve a\n * node-local gradient, a world-space one, and a plain unzoomed preview.\n *\n * The overlay ignores pointer events except on the handles themselves, so\n * it can sit over live canvas content without swallowing tool input.\n */\nexport function GradientHandles(props: GradientHandlesProps): ReactElement {\n const { value, toScreen, toLocal, onInput, onChange, width, height, className } = props;\n\n return (\n <svg\n className={[s.overlay, className].filter(Boolean).join(' ')}\n width={width}\n height={height}\n >\n {renderForKind(value, toScreen, toLocal, onInput, onChange)}\n </svg>\n );\n}\n\nfunction renderForKind(\n value: GradientFill,\n toScreen: (p: Point) => Point,\n toLocal: (p: Point) => Point,\n onInput: ((next: GradientFill) => void) | undefined,\n onChange: (next: GradientFill) => void,\n): ReactNode {\n const emit = (next: GradientFill, phase: 'input' | 'commit'): void => {\n if (phase === 'input') onInput?.(next);\n else onChange(next);\n };\n\n if (value.fill === 'linear-gradient') {\n const from = toScreen(value.from);\n const to = toScreen(value.to);\n return (\n <>\n <Guide x1={from.x} y1={from.y} x2={to.x} y2={to.y} />\n <DragPoint\n at={from}\n label=\"Gradient start\"\n onDrag={(p, phase) => emit({ ...value, from: toLocal(p) }, phase)}\n />\n <DragPoint\n at={to}\n label=\"Gradient end\"\n onDrag={(p, phase) => emit({ ...value, to: toLocal(p) }, phase)}\n />\n </>\n );\n }\n\n if (value.fill === 'radial-gradient') {\n const center = toScreen(value.center);\n // The radius handle rides the +x axis of gradient space, so it stays on\n // the drawn circle under a rotated or anisotropic transform.\n const edge = toScreen({ x: value.center.x + value.radius, y: value.center.y });\n const screenRadius = Math.hypot(edge.x - center.x, edge.y - center.y);\n return (\n <>\n <circle className={s.guide} cx={center.x} cy={center.y} r={screenRadius} />\n <DragPoint\n at={center}\n label=\"Gradient center\"\n onDrag={(p, phase) => emit({ ...value, center: toLocal(p) }, phase)}\n />\n <DragPoint\n at={edge}\n label=\"Gradient radius\"\n onDrag={(p, phase) => {\n const local = toLocal(p);\n const radius = Math.hypot(local.x - value.center.x, local.y - value.center.y);\n emit({ ...value, radius: Math.max(MIN_RADIUS, radius) }, phase);\n }}\n />\n </>\n );\n }\n\n const center = toScreen(value.center);\n const { radius } = gradientGeometry(value);\n const tip = toScreen({\n x: value.center.x + Math.cos(value.angle) * radius,\n y: value.center.y + Math.sin(value.angle) * radius,\n });\n return (\n <>\n <Guide x1={center.x} y1={center.y} x2={tip.x} y2={tip.y} />\n <DragPoint\n at={center}\n label=\"Gradient center\"\n onDrag={(p, phase) => emit({ ...value, center: toLocal(p) }, phase)}\n />\n <DragPoint\n at={tip}\n label=\"Gradient angle\"\n onDrag={(p, phase) => {\n const local = toLocal(p);\n const angle = Math.atan2(local.y - value.center.y, local.x - value.center.x);\n emit({ ...value, angle }, phase);\n }}\n />\n </>\n );\n}\n\n/** A radius of zero divides by zero in the shader's `t`; keep it off the floor. */\nconst MIN_RADIUS = 1;\n\nfunction Guide(props: { x1: number; y1: number; x2: number; y2: number }): ReactElement {\n return <line className={s.guide} {...props} />;\n}\n\nfunction DragPoint({\n at,\n label,\n onDrag,\n}: {\n at: Point;\n label: string;\n onDrag: (p: Point, phase: 'input' | 'commit') => void;\n}): ReactElement {\n const start = useRef<Point>(at);\n const drag = useHandleDrag<SVGCircleElement>({\n onStart: () => { start.current = at; },\n onMove: (p) => { onDrag(p, 'input'); },\n onEnd: ({ point, moved }) => {\n // A press that never moved is not an edit and must not write anything.\n if (moved) onDrag(point, 'commit');\n },\n // An abandoned gesture is not an edit either — put the live preview back\n // where it started rather than committing where it was left.\n onCancel: () => { onDrag(start.current, 'input'); },\n });\n const onKeyDown = (e: ReactKeyboardEvent<SVGCircleElement>): void => {\n const amount = e.shiftKey ? KEY_STEP * 10 : KEY_STEP;\n let dx = 0;\n let dy = 0;\n if (e.key === 'ArrowLeft') dx = -amount;\n else if (e.key === 'ArrowRight') dx = amount;\n else if (e.key === 'ArrowUp') dy = -amount;\n else if (e.key === 'ArrowDown') dy = amount;\n else return;\n e.preventDefault();\n const next = { x: at.x + dx, y: at.y + dy };\n onDrag(next, 'input');\n onDrag(next, 'commit');\n };\n return (\n <circle\n className={s.handle}\n cx={at.x}\n cy={at.y}\n r={HANDLE_RADIUS}\n // Not `slider`: the handle carries a 2-D position, not one value, so\n // it has no `aria-valuenow` to honor the role's contract with.\n role=\"button\"\n aria-label={label}\n tabIndex={0}\n onKeyDown={onKeyDown}\n {...drag}\n />\n );\n}\n\nconst HANDLE_RADIUS = 7;\n\n/** One arrow-key step, in overlay pixels. */\nconst KEY_STEP = 1;\n","import { useRef, type ReactElement, type RefObject } from 'react';\nimport {\n fillInPoseFrame,\n fillToBoundsFrame,\n isGradientFill,\n useActionsRegistry,\n useNodeOverlayFrame,\n type FillStyle,\n type GradientFill,\n type RectPose,\n type Scene,\n type Stroke,\n type UiOngoingControl,\n type View,\n} from '@weasel-js/core';\nimport { GradientHandles } from './GradientHandles';\n\n/** The paint slots a node carries. Either may hold a gradient, and each has\n * its own action, so the overlay is told which one it is editing. */\nexport type PaintSlot = 'fill' | 'stroke';\n\n/** What `SceneGradientHandles` reads off a node. Every field is optional, so\n * any richer app data shape satisfies it. */\nexport interface PaintedNodeData {\n fill?: FillStyle | null;\n stroke?: Stroke | null;\n}\n\nexport interface SceneGradientHandlesProps<\n TData extends PaintedNodeData,\n TLayer extends string,\n TPose extends RectPose,\n> {\n scene: Scene<TData, TLayer, TPose>;\n /** The element the overlay is positioned in. Must be the canvas's own box,\n * or the handles land somewhere other than the paint. */\n containerRef: RefObject<HTMLElement | null>;\n /** The node whose paint is being edited — usually the lone selected id. */\n nodeId: string | null | undefined;\n /** Which of the node's two paints these handles move. */\n slot: PaintSlot;\n /** Current viewport; a thunk is re-read per projection. See\n * `useNodeOverlayFrame`. */\n view?: View | (() => View);\n className?: string;\n}\n\n/**\n * Scene-aware `GradientHandles`: on-canvas geometry handles for the gradient\n * in one node's `fill` or `stroke`, committed through the `setFill` /\n * `setStroke` actions as a single undo entry per drag.\n *\n * Renders nothing unless the targeted slot holds a gradient. The node stores\n * its gradient in `units: 'bounds'` — fractions of its own box, so the paint\n * survives pan, zoom and resize — which is not a frame polar math can work\n * in; the handles get it resolved onto the box and every edit is normalized\n * back on the way out.\n *\n * `slot` is a prop rather than state the kit keeps: an app that edits fill\n * and stroke separately already knows which one has focus.\n */\nexport function SceneGradientHandles<\n TData extends PaintedNodeData,\n TLayer extends string,\n TPose extends RectPose,\n>(props: SceneGradientHandlesProps<TData, TLayer, TPose>): ReactElement | null {\n const { scene, containerRef, nodeId, slot, view, className } = props;\n const actions = useActionsRegistry();\n const frame = useNodeOverlayFrame(scene, containerRef, nodeId, { view });\n const ctrlRef = useRef<UiOngoingControl | null>(null);\n\n const gradient = frame ? gradientInSlot(paintOf(scene, nodeId, slot)) : null;\n if (!frame || !gradient) return null;\n\n const dispatch = (next: GradientFill, phase: 'input' | 'commit'): void => {\n const paint = fillToBoundsFrame(next, frame.box);\n const id = slot === 'fill' ? 'setFill' : 'setStroke';\n if (!ctrlRef.current) ctrlRef.current = actions?.begin(id, { paint }) ?? null;\n else ctrlRef.current.update({ paint });\n if (phase === 'commit' && ctrlRef.current) {\n ctrlRef.current.end('commit');\n ctrlRef.current = null;\n }\n };\n\n return (\n <GradientHandles\n value={fillInPoseFrame(gradient, frame.box) as GradientFill}\n toScreen={frame.toScreen}\n toLocal={frame.toLocal}\n width={frame.width}\n height={frame.height}\n className={className}\n onInput={(next) => dispatch(next, 'input')}\n onChange={(next) => dispatch(next, 'commit')}\n />\n );\n}\n\nfunction paintOf<TData extends PaintedNodeData, TLayer extends string, TPose extends RectPose>(\n scene: Scene<TData, TLayer, TPose>,\n nodeId: string | null | undefined,\n slot: PaintSlot,\n): FillStyle | null | undefined {\n if (nodeId == null) return undefined;\n const data = (scene.nodes as ReadonlyMap<string, { data: TData }>).get(nodeId)?.data;\n if (!data) return undefined;\n return slot === 'fill' ? data.fill : data.stroke?.paint;\n}\n\nfunction gradientInSlot(paint: FillStyle | null | undefined): GradientFill | null {\n return isGradientFill(paint) ? paint : null;\n}\n"],"mappings":";;;;;;;AAuBA,IAAM,IAAgB;CAAE,UAAU;CAAK,QAAQ;CAAG,KAAK;CAAG,KAAK;CAAI;AAOnE,SAAgB,EAAmB,GAAuD;CACxF,IAAM,EAAE,aAAU,aAAU,IAAI,gBAAa,aAAU;AAEvD,SAAQ,MAAkB;EACxB,IAAM,IAAkB,EAAE;AAC1B,OAAK,IAAI,IAAI,GAAG,KAAK,GAAS,KAAK;GACjC,IAAM,IAAI,IAAI;AACd,KAAM,KAAK,GAAG,EAAS,EAAE,CAAC,IAAI,IAAI,KAAK,QAAQ,EAAE,CAAC,GAAG;;EAEvD,IAAM,IAAe,6BAA6B,EAAM,KAAK,KAAK,CAAC,IAE7D,IAAmB,EAAE;AAC3B,MAAI,GAAa;GACf,IAAM,IAAS,EAAI,gBAAgB,EAAY,GAAG,GAAG,KAC/C,IAAU,EAAI,gBAAgB,EAAY,GAAG,GAAG,KAChD,IAAI;IAAE,GAAG;IAAe,GAAG;IAAO,EAClC,IAAS,6BAA6B,EAAE,SAAS,qBAAqB,EAAE,OAAO,yBAAyB,EAAE,OAAO,KAAK,EAAE,SAAS,EAAE,IAAI,MACvI,IAAW,yCAAyC,EAAE,IAAI,kBAC1D,IAAa,mBAAmB,EAAS,IAAI,EAAS;AAM5D,OAJI,IAAS,MACX,EAAO,KAAK,GAAG,EAAW,YAAY,EAAO,QAAQ,EAAE,CAAC,kBAAkB,EAC1E,EAAO,KAAK,GAAG,EAAO,YAAY,EAAO,QAAQ,EAAE,CAAC,kBAAkB,GAEpE,IAAU,KAAK;IACjB,IAAM,KAAM,MAAM,GA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,EAAkB,GAAM,EAAM,IAAI,EAC1C,IAAK,MAAS,SAAS,YAAY;AAGzC,EAFK,EAAQ,UACR,EAAQ,QAAQ,OAAO,EAAE,UAAO,CAAC,GADhB,EAAQ,UAAU,GAAS,MAAM,GAAI,EAAE,UAAO,CAAC,IAAI,MAErE,MAAU,YAAY,EAAQ,YAChC,EAAQ,QAAQ,IAAI,SAAS,EAC7B,EAAQ,UAAU;;AAItB,QACE,kBAAC,GAAD;EACE,OAAO,EAAgB,GAAU,EAAM,IAAI;EAC3C,UAAU,EAAM;EAChB,SAAS,EAAM;EACf,OAAO,EAAM;EACb,QAAQ,EAAM;EACH;EACX,UAAU,MAAS,EAAS,GAAM,QAAQ;EAC1C,WAAW,MAAS,EAAS,GAAM,SAAS;EAC5C,CAAA;;AAIN,SAAS,EACP,GACA,GACA,GAC8B;AAC9B,KAAI,KAAU,KAAM;CACpB,IAAM,IAAQ,EAAM,MAA+C,IAAI,EAAO,EAAE;AAC3E,OACL,QAAO,MAAS,SAAS,EAAK,OAAO,EAAK,QAAQ;;AAGpD,SAAS,EAAe,GAA0D;AAChF,QAAO,EAAe,EAAM,GAAG,IAAQ"}
1
+ {"version":3,"file":"GradientEditor-BRTxHG-W.js","names":[],"sources":["../../src/paintGradientTrack.tsx","../../src/components/GradientEditor/GradientEditor.module.css","../../src/components/GradientEditor/GradientEditor.tsx","../../src/components/GradientEditor/GradientHandles.module.css","../../src/components/GradientEditor/GradientHandles.tsx","../../src/components/GradientEditor/SceneGradientHandles.tsx"],"sourcesContent":["import type { ReactNode, CSSProperties } from 'react';\nimport type { TrackCtx } from './components/Slider';\n\n/**\n * Options for {@link paintGradientTrack}.\n *\n * `gradient` maps a normalized position along the track (0 to 1) to a CSS\n * color; `samples` is how many stops the resulting linear-gradient uses.\n * `activeRange`, given in the slider's own value units, keeps that span at\n * full strength and dims + hatches the rest.\n */\nexport type GradientTrackOpts = {\n gradient: (t: number) => string;\n samples?: number;\n activeRange?: [number, number];\n hatch?: {\n angleDeg?: number;\n stripe?: number;\n gap?: number;\n dim?: number;\n };\n};\n\nconst DEFAULT_HATCH = { angleDeg: 135, stripe: 2, gap: 4, dim: 75 };\n\n/**\n * Builds a `Slider` `renderTrack` function that paints the track as a\n * sampled color gradient, optionally dimming and hatching the portions\n * outside an active range.\n */\nexport function paintGradientTrack(opts: GradientTrackOpts): (ctx: TrackCtx) => ReactNode {\n const { gradient, samples = 16, activeRange, hatch } = opts;\n\n return (ctx: TrackCtx) => {\n const stops: string[] = [];\n for (let i = 0; i <= samples; i++) {\n const t = i / samples;\n stops.push(`${gradient(t)} ${(t * 100).toFixed(1)}%`);\n }\n const baseGradient = `linear-gradient(to right, ${stops.join(', ')})`;\n\n const layers: string[] = [];\n if (activeRange) {\n const lowPct = ctx.valueToFraction(activeRange[0]) * 100;\n const highPct = ctx.valueToFraction(activeRange[1]) * 100;\n const h = { ...DEFAULT_HATCH, ...hatch };\n const stripe = `repeating-linear-gradient(${h.angleDeg}deg, transparent 0 ${h.stripe}px, var(--wzl-surface) ${h.stripe}px ${h.stripe + h.gap}px)`;\n const dimColor = `color-mix(in srgb, var(--wzl-surface) ${h.dim}%, transparent)`;\n const dimOverlay = `linear-gradient(${dimColor}, ${dimColor})`;\n\n if (lowPct > 0) {\n layers.push(`${dimOverlay} left 0 / ${lowPct.toFixed(2)}% 100% no-repeat`);\n layers.push(`${stripe} left 0 / ${lowPct.toFixed(2)}% 100% no-repeat`);\n }\n if (highPct < 100) {\n const wR = (100 - highPct).toFixed(2);\n layers.push(`${dimOverlay} right 0 / ${wR}% 100% no-repeat`);\n layers.push(`${stripe} right 0 / ${wR}% 100% no-repeat`);\n }\n }\n layers.push(baseGradient);\n\n const style: CSSProperties = {\n position: 'absolute',\n inset: 0,\n background: layers.join(', '),\n };\n return <div style={style} />;\n };\n}\n",".root {\n display: flex;\n flex-direction: column;\n gap: var(--wzl-space-4);\n min-inline-size: 0;\n}\n\n.swatches {\n display: flex;\n flex-wrap: wrap;\n gap: var(--wzl-space-3);\n}\n\n/* Each stop's opacity slider would otherwise stretch the row to a width no\n * properties panel has; the chip stays legible, the slider yields. */\n.swatch {\n flex: 0 1 auto;\n min-inline-size: 0;\n}\n","import { useCallback, type ReactElement } from 'react';\nimport {\n sampleGradientStops,\n withGradientKind,\n type ColorSpace,\n type GradStop,\n type GradientFill,\n type GradientKind,\n} from '@weasel-js/core';\nimport { Slider, type Thumb } from '../Slider';\nimport { ColorField } from '../ColorField';\nimport { ToggleBar, type ToggleBarItem } from '../ToggleBar';\nimport { paintGradientTrack } from '../../paintGradientTrack';\nimport s from './GradientEditor.module.css';\n\nconst KINDS: readonly ToggleBarItem<GradientKind>[] = [\n { value: 'linear-gradient', label: 'Linear' },\n { value: 'radial-gradient', label: 'Radial' },\n { value: 'conic-gradient', label: 'Conic' },\n];\n\nconst SPACES: readonly ToggleBarItem<ColorSpace>[] = [\n { value: 'rgb', label: 'sRGB' },\n { value: 'oklab', label: 'OKLab' },\n { value: 'oklch', label: 'OKLCh' },\n];\n\n/** Fewer than two stops is not a gradient any renderer can ramp between. */\nconst MIN_STOPS = 2;\n\n/**\n * Props for {@link GradientEditor}. `onInput` fires throughout a gesture and\n * `onChange` once at its end.\n */\nexport interface GradientEditorProps {\n /** The gradient being edited. */\n value: GradientFill;\n /**\n * Live value during a gesture — a stop drag, a color-picker scrub. Wire\n * it for preview; it fires many times per gesture and must not be\n * written to history.\n */\n onInput?: (next: GradientFill) => void;\n /** Committed value: one call per completed gesture. Pair with an\n * undoable write. */\n onChange: (next: GradientFill) => void;\n /** Show the linear / radial / conic switch. Default true; turn it off\n * when the surrounding UI already owns the kind. */\n kindSwitch?: boolean;\n /** Show the sRGB / OKLab / OKLCh switch, which writes `interpolate`.\n * Default true. */\n spaceSwitch?: boolean;\n className?: string;\n}\n\ntype StopThumb = Thumb & { color: string };\n\n/**\n * Editor for a gradient's kind and stop list.\n *\n * Geometry (`from`/`to`, `center`, `radius`, `angle`) is deliberately not\n * edited here — on a canvas that belongs on the artwork, via\n * `<GradientHandles>`. This component owns the parts with no spatial\n * meaning, so it composes into a properties panel at any width.\n *\n * Stops are addressed by their position in `value.stops`, which is never\n * reordered — dragging one stop past another leaves both indices alone, so\n * a drag can cross a neighbour without the two swapping under the pointer.\n * Rendering sorts a copy.\n */\nexport function GradientEditor(props: GradientEditorProps): ReactElement {\n const { value, onInput, onChange, kindSwitch = true, spaceSwitch = true, className } = props;\n const stops = value.stops;\n const space = value.interpolate ?? 'rgb';\n\n const withStops = useCallback(\n (next: GradStop[]): GradientFill => ({ ...value, stops: next }),\n [value],\n );\n\n const thumbs: StopThumb[] = stops.map((stop) => ({ value: stop.offset, color: stop.color }));\n\n const applyThumbs = (next: StopThumb[]): GradStop[] =>\n next.map((t) => ({ offset: t.value, color: t.color }));\n\n const setStopColor = (index: number, color: string): GradStop[] =>\n stops.map((stop, i) => (i === index ? { ...stop, color } : stop));\n\n // Sorted view for the swatch row, carrying each stop's real index so a\n // recolor writes back to the right entry.\n const ordered = stops\n .map((stop, index) => ({ stop, index }))\n .sort((a, b) => a.stop.offset - b.stop.offset);\n\n return (\n <div className={[s.root, className].filter(Boolean).join(' ')}>\n {kindSwitch && (\n <ToggleBar<GradientKind>\n items={KINDS}\n value={value.fill}\n size=\"sm\"\n ariaLabel=\"Gradient kind\"\n onChange={(kind) => kind && onChange(withGradientKind(value, kind))}\n />\n )}\n\n <Slider<StopThumb>\n min={0}\n max={1}\n step={0.005}\n constraint=\"free\"\n thumbs={thumbs}\n ariaLabel=\"Gradient stops\"\n readoutPlacement=\"none\"\n onInput={(next) => onInput?.(withStops(applyThumbs(next)))}\n onChange={(next) => onChange(withStops(applyThumbs(next)))}\n onAddThumb={(at) => ({ value: at, color: sampleGradientStops(stops, at, space) })}\n onRemoveThumb={() => stops.length > MIN_STOPS}\n renderTrack={paintGradientTrack({\n gradient: (t) => sampleGradientStops(stops, t, space),\n // The track lerps between samples in sRGB whatever the gradient does,\n // so a hue arc needs more of them to not read as a straight line.\n samples: space === 'rgb' ? 32 : 64,\n })}\n />\n\n {spaceSwitch && (\n <ToggleBar<ColorSpace>\n items={SPACES}\n value={space}\n size=\"sm\"\n ariaLabel=\"Blend space\"\n onChange={(next) => next && onChange({ ...value, interpolate: next })}\n />\n )}\n\n <div className={s.swatches}>\n {ordered.map(({ stop, index }) => (\n <ColorField\n key={index}\n value={stop.color}\n alpha\n aria-label={`Stop ${index + 1} at ${Math.round(stop.offset * 100)}%`}\n className={s.swatch}\n onInput={(hex) => onInput?.(withStops(setStopColor(index, hex)))}\n onChange={(hex) => onChange(withStops(setStopColor(index, hex)))}\n />\n ))}\n </div>\n </div>\n );\n}\n","/* The overlay covers the canvas but must not intercept tool input; only the\n * handles opt back into hit-testing. */\n.overlay {\n position: absolute;\n inset: 0;\n pointer-events: none;\n}\n\n/* These sit over artwork of unknown color, not over the app's own surface,\n * so they are deliberately not themed: a themed handle disappears against\n * whatever the user painted underneath. White-on-dark reads on anything,\n * which is why every editor draws handles this way. */\n.guide {\n fill: none;\n stroke: #ffffff;\n stroke-opacity: 0.7;\n stroke-dasharray: 4 4;\n paint-order: stroke;\n}\n\n.handle {\n fill: #ffffff;\n stroke: #222222;\n stroke-width: 2;\n cursor: grab;\n pointer-events: auto;\n}\n\n.handle:active {\n cursor: grabbing;\n}\n\n.handle:focus-visible {\n outline: 2px solid var(--wzl-accent, #4a9eff);\n outline-offset: 2px;\n}\n","import { useRef, type KeyboardEvent as ReactKeyboardEvent, type ReactElement, type ReactNode } from 'react';\nimport { useHandleDrag, gradientGeometry, type GradientFill } from '@weasel-js/core';\nimport s from './GradientHandles.module.css';\n\n/** Structural, and deliberately not exported — `Plot2D` and `CurveEditor`\n * each publish their own `Point`, and a third would only be ambiguous at\n * the package barrel. Consumers pass any `{ x, y }`. */\ninterface Point {\n x: number;\n y: number;\n}\n\n/**\n * Props for {@link GradientHandles}. `onInput` fires throughout a drag and\n * `onChange` once at its end.\n */\nexport interface GradientHandlesProps {\n /**\n * The gradient whose geometry these handles move, in a **resolved,\n * isotropic** frame — one where `radius` is a length in the same units as\n * `center.x` and a right angle is a right angle.\n *\n * A `units: 'bounds'` gradient is not such a frame: `x` and `y` are\n * fractions of two different lengths, so a circle there is an ellipse on\n * screen and polar math silently mixes scales. Resolve it first with\n * `fillInPoseFrame(fill, box)` and convert edits back with\n * `fillToBoundsFrame(next, box)`.\n */\n value: GradientFill;\n /**\n * Gradient space → overlay pixels. For a `units: 'local'` gradient this\n * is the node's local-to-screen transform; for `'world'`, the view.\n */\n toScreen: (p: Point) => Point;\n /** Overlay pixels → gradient space. Must invert `toScreen`. */\n toLocal: (p: Point) => Point;\n /** Live during a drag — wire for preview, do not write to history. */\n onInput?: (next: GradientFill) => void;\n /** Committed at drag end: one call per gesture. */\n onChange: (next: GradientFill) => void;\n /** Overlay size in CSS pixels. */\n width: number;\n height: number;\n className?: string;\n}\n\n/**\n * Direct-manipulation handles for a gradient's geometry, drawn as an SVG\n * overlay above a canvas: endpoints for linear, center and radius for\n * radial, center and angle arm for conic.\n *\n * Positioning is entirely the consumer's `toScreen` / `toLocal` — this\n * component never sees a view or a scene node, so the same handles serve a\n * node-local gradient, a world-space one, and a plain unzoomed preview.\n *\n * The overlay ignores pointer events except on the handles themselves, so\n * it can sit over live canvas content without swallowing tool input.\n */\nexport function GradientHandles(props: GradientHandlesProps): ReactElement {\n const { value, toScreen, toLocal, onInput, onChange, width, height, className } = props;\n\n return (\n <svg\n className={[s.overlay, className].filter(Boolean).join(' ')}\n width={width}\n height={height}\n >\n {renderForKind(value, toScreen, toLocal, onInput, onChange)}\n </svg>\n );\n}\n\nfunction renderForKind(\n value: GradientFill,\n toScreen: (p: Point) => Point,\n toLocal: (p: Point) => Point,\n onInput: ((next: GradientFill) => void) | undefined,\n onChange: (next: GradientFill) => void,\n): ReactNode {\n const emit = (next: GradientFill, phase: 'input' | 'commit'): void => {\n if (phase === 'input') onInput?.(next);\n else onChange(next);\n };\n\n if (value.fill === 'linear-gradient') {\n const from = toScreen(value.from);\n const to = toScreen(value.to);\n return (\n <>\n <Guide x1={from.x} y1={from.y} x2={to.x} y2={to.y} />\n <DragPoint\n at={from}\n label=\"Gradient start\"\n onDrag={(p, phase) => emit({ ...value, from: toLocal(p) }, phase)}\n />\n <DragPoint\n at={to}\n label=\"Gradient end\"\n onDrag={(p, phase) => emit({ ...value, to: toLocal(p) }, phase)}\n />\n </>\n );\n }\n\n if (value.fill === 'radial-gradient') {\n const center = toScreen(value.center);\n // The radius handle rides the +x axis of gradient space, so it stays on\n // the drawn circle under a rotated or anisotropic transform.\n const edge = toScreen({ x: value.center.x + value.radius, y: value.center.y });\n const screenRadius = Math.hypot(edge.x - center.x, edge.y - center.y);\n return (\n <>\n <circle className={s.guide} cx={center.x} cy={center.y} r={screenRadius} />\n <DragPoint\n at={center}\n label=\"Gradient center\"\n onDrag={(p, phase) => emit({ ...value, center: toLocal(p) }, phase)}\n />\n <DragPoint\n at={edge}\n label=\"Gradient radius\"\n onDrag={(p, phase) => {\n const local = toLocal(p);\n const radius = Math.hypot(local.x - value.center.x, local.y - value.center.y);\n emit({ ...value, radius: Math.max(MIN_RADIUS, radius) }, phase);\n }}\n />\n </>\n );\n }\n\n const center = toScreen(value.center);\n const { radius } = gradientGeometry(value);\n const tip = toScreen({\n x: value.center.x + Math.cos(value.angle) * radius,\n y: value.center.y + Math.sin(value.angle) * radius,\n });\n return (\n <>\n <Guide x1={center.x} y1={center.y} x2={tip.x} y2={tip.y} />\n <DragPoint\n at={center}\n label=\"Gradient center\"\n onDrag={(p, phase) => emit({ ...value, center: toLocal(p) }, phase)}\n />\n <DragPoint\n at={tip}\n label=\"Gradient angle\"\n onDrag={(p, phase) => {\n const local = toLocal(p);\n const angle = Math.atan2(local.y - value.center.y, local.x - value.center.x);\n emit({ ...value, angle }, phase);\n }}\n />\n </>\n );\n}\n\n/** A radius of zero divides by zero in the shader's `t`; keep it off the floor. */\nconst MIN_RADIUS = 1;\n\nfunction Guide(props: { x1: number; y1: number; x2: number; y2: number }): ReactElement {\n return <line className={s.guide} {...props} />;\n}\n\nfunction DragPoint({\n at,\n label,\n onDrag,\n}: {\n at: Point;\n label: string;\n onDrag: (p: Point, phase: 'input' | 'commit') => void;\n}): ReactElement {\n const start = useRef<Point>(at);\n const drag = useHandleDrag<SVGCircleElement>({\n onStart: () => { start.current = at; },\n onMove: (p) => { onDrag(p, 'input'); },\n onEnd: ({ point, moved }) => {\n // A press that never moved is not an edit and must not write anything.\n if (moved) onDrag(point, 'commit');\n },\n // An abandoned gesture is not an edit either — put the live preview back\n // where it started rather than committing where it was left.\n onCancel: () => { onDrag(start.current, 'input'); },\n });\n const onKeyDown = (e: ReactKeyboardEvent<SVGCircleElement>): void => {\n const amount = e.shiftKey ? KEY_STEP * 10 : KEY_STEP;\n let dx = 0;\n let dy = 0;\n if (e.key === 'ArrowLeft') dx = -amount;\n else if (e.key === 'ArrowRight') dx = amount;\n else if (e.key === 'ArrowUp') dy = -amount;\n else if (e.key === 'ArrowDown') dy = amount;\n else return;\n e.preventDefault();\n const next = { x: at.x + dx, y: at.y + dy };\n onDrag(next, 'input');\n onDrag(next, 'commit');\n };\n return (\n <circle\n className={s.handle}\n cx={at.x}\n cy={at.y}\n r={HANDLE_RADIUS}\n // Not `slider`: the handle carries a 2-D position, not one value, so\n // it has no `aria-valuenow` to honor the role's contract with.\n role=\"button\"\n aria-label={label}\n tabIndex={0}\n onKeyDown={onKeyDown}\n {...drag}\n />\n );\n}\n\nconst HANDLE_RADIUS = 7;\n\n/** One arrow-key step, in overlay pixels. */\nconst KEY_STEP = 1;\n","import { type ReactElement, type RefObject } from 'react';\nimport {\n fillInPoseFrame,\n fillToBoundsFrame,\n isGradientFill,\n useNodeOverlayFrame,\n useOngoingAction,\n type FillStyle,\n type GradientFill,\n type RectPose,\n type Scene,\n type Stroke,\n type View,\n} from '@weasel-js/core';\nimport { GradientHandles } from './GradientHandles';\n\n/** The paint slots a node carries. Either may hold a gradient, and each has\n * its own action, so the overlay is told which one it is editing. */\nexport type PaintSlot = 'fill' | 'stroke';\n\n/** What `SceneGradientHandles` reads off a node. Every field is optional, so\n * any richer app data shape satisfies it. */\nexport interface PaintedNodeData {\n fill?: FillStyle | null;\n stroke?: Stroke | null;\n}\n\nexport interface SceneGradientHandlesProps<\n TData extends PaintedNodeData,\n TLayer extends string,\n TPose extends RectPose,\n> {\n scene: Scene<TData, TLayer, TPose>;\n /** The element the overlay is positioned in. Must be the canvas's own box,\n * or the handles land somewhere other than the paint. */\n containerRef: RefObject<HTMLElement | null>;\n /** The node whose paint is being edited — usually the lone selected id. */\n nodeId: string | null | undefined;\n /** Which of the node's two paints these handles move. */\n slot: PaintSlot;\n /** Current viewport; a thunk is re-read per projection. See\n * `useNodeOverlayFrame`. */\n view?: View | (() => View);\n className?: string;\n}\n\n/**\n * Scene-aware `GradientHandles`: on-canvas geometry handles for the gradient\n * in one node's `fill` or `stroke`, committed through the `setFill` /\n * `setStroke` actions as a single undo entry per drag.\n *\n * Renders nothing unless the targeted slot holds a gradient. The node stores\n * its gradient in `units: 'bounds'` — fractions of its own box, so the paint\n * survives pan, zoom and resize — which is not a frame polar math can work\n * in; the handles get it resolved onto the box and every edit is normalized\n * back on the way out.\n *\n * `slot` is a prop rather than state the kit keeps: an app that edits fill\n * and stroke separately already knows which one has focus.\n */\nexport function SceneGradientHandles<\n TData extends PaintedNodeData,\n TLayer extends string,\n TPose extends RectPose,\n>(props: SceneGradientHandlesProps<TData, TLayer, TPose>): ReactElement | null {\n const { scene, containerRef, nodeId, slot, view, className } = props;\n const frame = useNodeOverlayFrame(scene, containerRef, nodeId, { view });\n const edit = useOngoingAction(slot === 'fill' ? 'setFill' : 'setStroke');\n\n const gradient = frame ? gradientInSlot(paintOf(scene, nodeId, slot)) : null;\n if (!frame || !gradient) return null;\n\n const dispatch = (next: GradientFill, phase: 'input' | 'commit'): void => {\n const paint = fillToBoundsFrame(next, frame.box);\n if (phase === 'commit') edit.commit({ paint });\n else edit.input({ paint });\n };\n\n return (\n <GradientHandles\n value={fillInPoseFrame(gradient, frame.box) as GradientFill}\n toScreen={frame.toScreen}\n toLocal={frame.toLocal}\n width={frame.width}\n height={frame.height}\n className={className}\n onInput={(next) => dispatch(next, 'input')}\n onChange={(next) => dispatch(next, 'commit')}\n />\n );\n}\n\nfunction paintOf<TData extends PaintedNodeData, TLayer extends string, TPose extends RectPose>(\n scene: Scene<TData, TLayer, TPose>,\n nodeId: string | null | undefined,\n slot: PaintSlot,\n): FillStyle | null | undefined {\n if (nodeId == null) return undefined;\n const data = (scene.nodes as ReadonlyMap<string, { data: TData }>).get(nodeId)?.data;\n if (!data) return undefined;\n return slot === 'fill' ? data.fill : data.stroke?.paint;\n}\n\nfunction gradientInSlot(paint: FillStyle | null | undefined): GradientFill | null {\n return isGradientFill(paint) ? paint : null;\n}\n"],"mappings":";;;;;;;AAuBA,IAAM,IAAgB;CAAE,UAAU;CAAK,QAAQ;CAAG,KAAK;CAAG,KAAK;CAAI;AAOnE,SAAgB,EAAmB,GAAuD;CACxF,IAAM,EAAE,aAAU,aAAU,IAAI,gBAAa,aAAU;AAEvD,SAAQ,MAAkB;EACxB,IAAM,IAAkB,EAAE;AAC1B,OAAK,IAAI,IAAI,GAAG,KAAK,GAAS,KAAK;GACjC,IAAM,IAAI,IAAI;AACd,KAAM,KAAK,GAAG,EAAS,EAAE,CAAC,IAAI,IAAI,KAAK,QAAQ,EAAE,CAAC,GAAG;;EAEvD,IAAM,IAAe,6BAA6B,EAAM,KAAK,KAAK,CAAC,IAE7D,IAAmB,EAAE;AAC3B,MAAI,GAAa;GACf,IAAM,IAAS,EAAI,gBAAgB,EAAY,GAAG,GAAG,KAC/C,IAAU,EAAI,gBAAgB,EAAY,GAAG,GAAG,KAChD,IAAI;IAAE,GAAG;IAAe,GAAG;IAAO,EAClC,IAAS,6BAA6B,EAAE,SAAS,qBAAqB,EAAE,OAAO,yBAAyB,EAAE,OAAO,KAAK,EAAE,SAAS,EAAE,IAAI,MACvI,IAAW,yCAAyC,EAAE,IAAI,kBAC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AAO,GAAc,GAAQ,EAAE,SAAM,CAAC,EAClE,IAAO,EAAiB,MAAS,SAAS,YAAY,YAAY,EAElE,IAAW,IAAQ,EAAe,EAAQ,GAAO,GAAQ,EAAK,CAAC,GAAG;AACxE,KAAI,CAAC,KAAS,CAAC,EAAU,QAAO;CAEhC,IAAM,KAAY,GAAoB,MAAoC;EACxE,IAAM,IAAQ,EAAkB,GAAM,EAAM,IAAI;AAChD,EAAI,MAAU,WAAU,EAAK,OAAO,EAAE,UAAO,CAAC,GACzC,EAAK,MAAM,EAAE,UAAO,CAAC;;AAG5B,QACE,kBAAC,GAAD;EACE,OAAO,EAAgB,GAAU,EAAM,IAAI;EAC3C,UAAU,EAAM;EAChB,SAAS,EAAM;EACf,OAAO,EAAM;EACb,QAAQ,EAAM;EACH;EACX,UAAU,MAAS,EAAS,GAAM,QAAQ;EAC1C,WAAW,MAAS,EAAS,GAAM,SAAS;EAC5C,CAAA;;AAIN,SAAS,EACP,GACA,GACA,GAC8B;AAC9B,KAAI,KAAU,KAAM;CACpB,IAAM,IAAQ,EAAM,MAA+C,IAAI,EAAO,EAAE;AAC3E,OACL,QAAO,MAAS,SAAS,EAAK,OAAO,EAAK,QAAQ;;AAGpD,SAAS,EAAe,GAA0D;AAChF,QAAO,EAAe,EAAM,GAAG,IAAQ"}
@@ -1,6 +1,7 @@
1
- import { jsx as e } from "react/jsx-runtime";
1
+ import { ACTION_GLYPHS as e } from "@weasel-js/core";
2
+ import { jsx as t } from "react/jsx-runtime";
2
3
  //#region src/icons/paths.ts
3
- var t = {
4
+ var n = {
4
5
  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\"/>",
5
6
  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\"/>",
6
7
  close: "<path d=\"M4.5 4.5 15.5 15.5M15.5 4.5 4.5 15.5\" stroke-width=\"1.75\"/>",
@@ -12,10 +13,10 @@ var t = {
12
13
  filter: "<path d=\"M3.4 4.6h13.2L11.8 11v5.4L8.2 14.8V11z\"/>",
13
14
  add: "<path d=\"M10 4.9v10.2M4.9 10h10.2\"/>",
14
15
  remove: "<path d=\"M4.9 10h10.2\"/>",
15
- delete: "<path d=\"M3.6 5.8h12.8M8 5.8V4.5A1.1 1.1 0 0 1 9.1 3.4h1.8A1.1 1.1 0 0 1 12 4.5v1.3\"/><path d=\"M5.2 5.8v9.6A1.6 1.6 0 0 0 6.8 17h6.4a1.6 1.6 0 0 0 1.6-1.6V5.8\"/><path d=\"M8.4 8.8v5.2M11.6 8.8v5.2\" stroke-width=\"1\"/>",
16
+ delete: e.delete,
16
17
  sort: "<path d=\"M3.6 5.6h7.2M3.6 10h8.8M3.6 14.4h5\"/><path d=\"M15.3 5.4v9.4\"/><path d=\"M16.97 12.81 15.3 14.8 13.63 12.81\"/>",
17
- 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\"/>",
18
- 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\"/>",
18
+ undo: e.undo,
19
+ redo: e.redo,
19
20
  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\"/>",
20
21
  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\"/>",
21
22
  italic: "<path d=\"M9 3.5h6M5 16.5h6M12.5 3.5 7.5 16.5\"/>",
@@ -39,6 +40,7 @@ var t = {
39
40
  warning: "<path d=\"M10 3.4 17.4 16.2H2.6z\"/><path d=\"M10 8.4v3.4\"/><path d=\"M10 14h0\"/>",
40
41
  error: "<circle cx=\"10\" cy=\"10\" r=\"7\"/><path d=\"M7.6 7.6 12.4 12.4M12.4 7.6 7.6 12.4\"/>",
41
42
  busy: "<path d=\"M10 3.2A6.8 6.8 0 1 1 3.2 10\"/>",
43
+ check: "<path d=\"M4.35 10.56 8.03 14.24 15.66 5.77\"/>",
42
44
  modeLight: "<circle cx=\"10\" cy=\"10\" r=\"3.5\"/><path d=\"M15.3 10L17.7 10M13.75 6.25L15.44 4.56M10 4.7L10 2.3M6.25 6.25L4.56 4.56M4.7 10L2.3 10M6.25 13.75L4.56 15.44M10 15.3L10 17.7M13.75 13.75L15.44 15.44\"/>",
43
45
  modeDark: "<path d=\"M8.19 3.55A6.7 6.7 0 1 0 16.45 11.81A5.9 5.9 0 0 1 8.19 3.55Z\"/>",
44
46
  modeAuto: "<path d=\"M10 2.6Q10 10 17.4 10Q10 10 10 17.4Q10 10 2.6 10Q10 10 10 2.6Z\"/>",
@@ -48,6 +50,7 @@ var t = {
48
50
  search: "<circle cx=\"9\" cy=\"9\" r=\"5.4\"/><path d=\"M12.82 12.82 16.9 16.9\"/>",
49
51
  loupe: "<circle cx=\"9\" cy=\"9\" r=\"5.6\"/><path d=\"M12.96 12.96 17 17\"/><rect x=\"6\" y=\"6\" width=\"6\" height=\"6\" stroke-width=\"1\"/><path d=\"M9 6v6M6 9h6\" stroke-width=\"1\"/>",
50
52
  layers: "<path d=\"M10 2.8 17.2 6.6 10 10.4 2.8 6.6z\"/><path d=\"M2.8 10 10 13.8 17.2 10\" stroke-width=\"1\"/><path d=\"M2.8 13.4 10 17.2 17.2 13.4\" stroke-width=\"1\"/>",
53
+ page: "<path d=\"M4.6 2.8H11.6L15.4 6.6V17.2H4.6z\"/><path d=\"M11.6 2.8V6.6H15.4\"/>",
51
54
  link: "<path d=\"M8.6 11.4a3.4 3.4 0 0 1 0-4.8l2.2-2.2a3.4 3.4 0 0 1 4.8 4.8l-1.1 1.1\"/><path d=\"M11.4 8.6a3.4 3.4 0 0 1 0 4.8l-2.2 2.2a3.4 3.4 0 0 1-4.8-4.8l1.1-1.1\"/>",
52
55
  collapse: "<path d=\"M14.16 4.05 10 7.8 5.84 4.05M5.84 15.95 10 12.2 14.16 15.95\"/>",
53
56
  expand: "<path d=\"M5.84 8.15 10 4.4 14.16 8.15M14.16 11.85 10 15.6 5.84 11.85\"/>",
@@ -209,7 +212,7 @@ var t = {
209
212
  d8: "<path d=\"M2.85 9.6L10 2.6L17.15 10.4L10 17.4Z\" stroke-linejoin=\"miter\" stroke-width=\"1\"/><path d=\"M7.68 11.24L2.85 9.6M10 2.6L7.68 11.24M7.68 11.24L10 17.4M17.15 10.4L7.68 11.24\" stroke-width=\"0.6\"/>",
210
213
  d12: "<path d=\"M2.96 7.71L5.65 4.01L10 2.6L14.35 4.01L17.04 7.71L17.04 12.29L14.35 15.99L10 17.4L5.65 15.99L2.96 12.29Z\" stroke-linejoin=\"miter\" stroke-width=\"1\"/><path d=\"M10 5.43L10 2.6M14.35 8.59L10 5.43M17.04 7.71L14.35 8.59M14.35 8.59L12.69 13.7M5.65 8.59L10 5.43M7.31 13.7L5.65 8.59M12.69 13.7L7.31 13.7M5.65 8.59L2.96 7.71M14.35 15.99L12.69 13.7M5.65 15.99L7.31 13.7\" stroke-width=\"0.6\"/>",
211
214
  d20: "<path d=\"M3.59 13.7L3.59 6.3L10 2.6L16.41 6.3L16.41 13.7L10 17.4Z\" stroke-linejoin=\"miter\" stroke-width=\"1\"/><path d=\"M10 5.43L13.96 12.29M6.04 12.29L10 5.43M13.96 12.29L6.04 12.29M3.59 6.3L10 5.43M6.04 12.29L3.59 6.3M10 5.43L10 2.6M16.41 6.3L10 5.43M16.41 6.3L13.96 12.29M6.04 12.29L10 17.4M3.59 13.7L6.04 12.29M13.96 12.29L10 17.4M16.41 13.7L13.96 12.29\" stroke-width=\"0.6\"/>"
212
- }, n = {
215
+ }, r = {
213
216
  arcStraight: "<path d=\"M1.85 15L2.6 15H17.4L18.15 15L18.15 15.75L1.85 15.75Z\" fill=\"currentColor\" stroke=\"none\"/>",
214
217
  arcParabola: "<path d=\"M2.31 15.69L2.6 15Q10 -5 17.4 15L17.69 15.69L17.69 15.75L2.31 15.75Z\" fill=\"currentColor\" stroke=\"none\"/>",
215
218
  arcCircle: "<path d=\"M2.52 15.75L2.6 15A7.4 7.4 0 0 1 17.4 15L17.48 15.75L17.48 15.75L2.52 15.75Z\" fill=\"currentColor\" stroke=\"none\"/>",
@@ -325,7 +328,7 @@ var t = {
325
328
  d8: "<path d=\"M2.85 9.6L10 2.6L17.15 10.4L10 17.4Z\" fill=\"currentColor\" stroke=\"none\"/>",
326
329
  d12: "<path d=\"M2.96 7.71L5.65 4.01L10 2.6L14.35 4.01L17.04 7.71L17.04 12.29L14.35 15.99L10 17.4L5.65 15.99L2.96 12.29Z\" fill=\"currentColor\" stroke=\"none\"/>",
327
330
  d20: "<path d=\"M3.59 13.7L3.59 6.3L10 2.6L16.41 6.3L16.41 13.7L10 17.4Z\" fill=\"currentColor\" stroke=\"none\"/>"
328
- }, r = [
331
+ }, i = [
329
332
  {
330
333
  label: "View and lifecycle",
331
334
  names: [
@@ -387,6 +390,7 @@ var t = {
387
390
  "warning",
388
391
  "error",
389
392
  "busy",
393
+ "check",
390
394
  "modeLight",
391
395
  "modeDark",
392
396
  "modeAuto"
@@ -401,6 +405,7 @@ var t = {
401
405
  "search",
402
406
  "loupe",
403
407
  "layers",
408
+ "page",
404
409
  "link",
405
410
  "collapse",
406
411
  "expand",
@@ -491,29 +496,32 @@ var t = {
491
496
  "d20"
492
497
  ]
493
498
  }
494
- ], i = (e) => e in n, a = {
499
+ ], a = (e) => e in r, o = {
495
500
  viewBox: "0 0 20 20",
496
501
  fill: "none",
497
502
  stroke: "currentColor",
498
503
  strokeWidth: 1.5,
499
504
  strokeLinecap: "round",
500
505
  strokeLinejoin: "round"
506
+ }, s = /* @__PURE__ */ new Map(), c = (e) => {
507
+ let t = s.get(e);
508
+ return t || s.set(e, t = { __html: e }), t;
501
509
  };
502
- function o({ name: r, className: o, size: s = 20, label: c, filled: l = !1, fillOpacity: u = .16 }) {
503
- let d = l && i(r) ? n[r] : "";
504
- return /* @__PURE__ */ e("svg", {
505
- ...a,
506
- className: o,
510
+ function l({ name: e, className: i, size: s = 20, label: l, filled: u = !1, fillOpacity: d = .16 }) {
511
+ let f = u && a(e) ? r[e] : "";
512
+ return /* @__PURE__ */ t("svg", {
513
+ ...o,
514
+ className: i,
507
515
  width: s,
508
516
  height: s,
509
- fillOpacity: d ? u : void 0,
510
- role: c ? "img" : void 0,
511
- "aria-label": c,
512
- "aria-hidden": c ? void 0 : !0,
513
- dangerouslySetInnerHTML: { __html: d + t[r] }
517
+ fillOpacity: f ? d : void 0,
518
+ role: l ? "img" : void 0,
519
+ "aria-label": l,
520
+ "aria-hidden": l ? void 0 : !0,
521
+ dangerouslySetInnerHTML: c(f + n[e])
514
522
  });
515
523
  }
516
524
  //#endregion
517
- export { t as a, r as i, i as n, n as r, o as t };
525
+ export { n as a, i, a as n, r, l as t };
518
526
 
519
- //# sourceMappingURL=Icon-DT0x6HaQ.js.map
527
+ //# sourceMappingURL=Icon-BW0qv_U7.js.map