@weasel-js/ui 1.7.0 → 1.7.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 (416) hide show
  1. package/dist/chunks/ActionBar-xA73vzzF.js +64 -0
  2. package/dist/chunks/ActionBar-xA73vzzF.js.map +1 -0
  3. package/dist/chunks/{Badge-D2aD7xVL.js → Badge-jYQjrTKc.js} +235 -264
  4. package/dist/chunks/{Badge-D2aD7xVL.js.map → Badge-jYQjrTKc.js.map} +1 -1
  5. package/dist/chunks/{BandEditor-Dd0egAgE.js → BandEditor-B4jUAHQ8.js} +13 -13
  6. package/dist/chunks/BandEditor-B4jUAHQ8.js.map +1 -0
  7. package/dist/chunks/{Button-BIdXHQOx.js → Button-XB-T75YL.js} +2 -2
  8. package/dist/chunks/{Button-BIdXHQOx.js.map → Button-XB-T75YL.js.map} +1 -1
  9. package/dist/chunks/{ButtonBar-DIQTe5GQ.js → ButtonBar-CIMKPPRS.js} +7 -9
  10. package/dist/chunks/{ButtonBar-DIQTe5GQ.js.map → ButtonBar-CIMKPPRS.js.map} +1 -1
  11. package/dist/chunks/Callout-BUn0dP_S.js +115 -0
  12. package/dist/chunks/Callout-BUn0dP_S.js.map +1 -0
  13. package/dist/chunks/Checkbox-DFn-x0JO.js +37 -0
  14. package/dist/chunks/Checkbox-DFn-x0JO.js.map +1 -0
  15. package/dist/chunks/{CloseButton-C2J7wVfo.js → CloseButton-BmNmRVtb.js} +3 -3
  16. package/dist/chunks/{CloseButton-C2J7wVfo.js.map → CloseButton-BmNmRVtb.js.map} +1 -1
  17. package/dist/chunks/ColorField-BwlelY26.js +90 -0
  18. package/dist/chunks/ColorField-BwlelY26.js.map +1 -0
  19. package/dist/chunks/{ColorModeControl-BewxA0rX.js → ColorModeControl-DaVJ-SyX.js} +3 -3
  20. package/dist/chunks/{ColorModeControl-BewxA0rX.js.map → ColorModeControl-DaVJ-SyX.js.map} +1 -1
  21. package/dist/chunks/ComboBox-DKln_mOd.js +138 -0
  22. package/dist/chunks/ComboBox-DKln_mOd.js.map +1 -0
  23. package/dist/chunks/{CurveEditor-DUVjd25R.js → CurveEditor-0EE00D6s.js} +90 -87
  24. package/dist/chunks/CurveEditor-0EE00D6s.js.map +1 -0
  25. package/dist/chunks/{DataGrid-LZ2JgY2Y.js → DataGrid-CmHJe57v.js} +23 -18
  26. package/dist/chunks/DataGrid-CmHJe57v.js.map +1 -0
  27. package/dist/chunks/DetailList-BpU50XVe.js +54 -0
  28. package/dist/chunks/DetailList-BpU50XVe.js.map +1 -0
  29. package/dist/chunks/{DetentSlider-5uQPFucv.js → DetentSlider-DNTAk8xP.js} +2 -2
  30. package/dist/chunks/{DetentSlider-5uQPFucv.js.map → DetentSlider-DNTAk8xP.js.map} +1 -1
  31. package/dist/chunks/{Dialog-DGFutQ--.js → Dialog-DKfsk5VN.js} +3 -3
  32. package/dist/chunks/{Dialog-DGFutQ--.js.map → Dialog-DKfsk5VN.js.map} +1 -1
  33. package/dist/chunks/{DragGhost-B5_hb9W9.js → DragGhost-BeYDJyLZ.js} +2 -2
  34. package/dist/chunks/{DragGhost-B5_hb9W9.js.map → DragGhost-BeYDJyLZ.js.map} +1 -1
  35. package/dist/chunks/{FallthroughDiagram-BEHiM5IS.js → FallthroughDiagram-CS1IhQaU.js} +16 -16
  36. package/dist/chunks/FallthroughDiagram-CS1IhQaU.js.map +1 -0
  37. package/dist/chunks/Field-DiX_WByH.js +25 -0
  38. package/dist/chunks/Field-DiX_WByH.js.map +1 -0
  39. package/dist/chunks/FillStrokeSwatch-C4h3rUFM.js +112 -0
  40. package/dist/chunks/FillStrokeSwatch-C4h3rUFM.js.map +1 -0
  41. package/dist/chunks/{FontFamilySelect-DkRgNtag.js → FontFamilySelect-DEvMXyZd.js} +2 -2
  42. package/dist/chunks/FontFamilySelect-DEvMXyZd.js.map +1 -0
  43. package/dist/chunks/FontWeightSelect-BLQ_LMJF.js +49 -0
  44. package/dist/chunks/FontWeightSelect-BLQ_LMJF.js.map +1 -0
  45. package/dist/chunks/{GestureRoute-C_YGl7bJ.js → GestureRoute-BXESrHI0.js} +2 -2
  46. package/dist/chunks/{GestureRoute-C_YGl7bJ.js.map → GestureRoute-BXESrHI0.js.map} +1 -1
  47. package/dist/chunks/GradientEditor-DD2OjQtn.js +325 -0
  48. package/dist/chunks/GradientEditor-DD2OjQtn.js.map +1 -0
  49. package/dist/chunks/{Icon-CcVjdq2C.js → Icon--B1ME-6c.js} +3 -1
  50. package/dist/chunks/Icon--B1ME-6c.js.map +1 -0
  51. package/dist/chunks/{InlineRange-P01ABSzo.js → InlineRange-DPjIsJB3.js} +3 -3
  52. package/dist/chunks/InlineRange-DPjIsJB3.js.map +1 -0
  53. package/dist/chunks/{Input-CHmkfYaD.js → Input-D7SDKbST.js} +10 -15
  54. package/dist/chunks/Input-D7SDKbST.js.map +1 -0
  55. package/dist/chunks/{ItemList-Cm-HUWCi.js → ItemList-CRu9y7hL.js} +2 -2
  56. package/dist/chunks/ItemList-CRu9y7hL.js.map +1 -0
  57. package/dist/chunks/{Jog-DRmfrkCg.js → Jog-BrkzdGV2.js} +8 -8
  58. package/dist/chunks/Jog-BrkzdGV2.js.map +1 -0
  59. package/dist/chunks/{LayerList-wCI1EueM.js → LayerList-Bxj1N6bj.js} +151 -153
  60. package/dist/chunks/LayerList-Bxj1N6bj.js.map +1 -0
  61. package/dist/chunks/ListEditor-OQDzG4A5.js +72 -0
  62. package/dist/chunks/ListEditor-OQDzG4A5.js.map +1 -0
  63. package/dist/chunks/MenuButton-TAFg88Lp.js +75 -0
  64. package/dist/chunks/MenuButton-TAFg88Lp.js.map +1 -0
  65. package/dist/chunks/MeshEditor-DWpvg8H6.js +199 -0
  66. package/dist/chunks/MeshEditor-DWpvg8H6.js.map +1 -0
  67. package/dist/chunks/{NumberField-BnJxcazc.js → NumberField-DS0WSiin.js} +26 -23
  68. package/dist/chunks/NumberField-DS0WSiin.js.map +1 -0
  69. package/dist/chunks/{OptionsBar-ujxYidhj.js → OptionsBar-DeTAjVb7.js} +6 -8
  70. package/dist/chunks/{OptionsBar-ujxYidhj.js.map → OptionsBar-DeTAjVb7.js.map} +1 -1
  71. package/dist/chunks/PaintField-BdmQM53v.js +63 -0
  72. package/dist/chunks/PaintField-BdmQM53v.js.map +1 -0
  73. package/dist/chunks/PaintInput-DaQMeBsI.js +132 -0
  74. package/dist/chunks/PaintInput-DaQMeBsI.js.map +1 -0
  75. package/dist/chunks/PatternPicker-B3HcMZWg.js +135 -0
  76. package/dist/chunks/PatternPicker-B3HcMZWg.js.map +1 -0
  77. package/dist/chunks/{Plot2D-CTXHkL5p.js → Plot2D-BrvQS0dh.js} +7 -7
  78. package/dist/chunks/Plot2D-BrvQS0dh.js.map +1 -0
  79. package/dist/chunks/{PointPlotter-ldI4RrU1.js → PointPlotter-BBXpQ_QD.js} +2 -2
  80. package/dist/chunks/{PointPlotter-ldI4RrU1.js.map → PointPlotter-BBXpQ_QD.js.map} +1 -1
  81. package/dist/chunks/{Powerline-DNyH885r.js → Powerline-6wIFmDik.js} +2 -2
  82. package/dist/chunks/{Powerline-DNyH885r.js.map → Powerline-6wIFmDik.js.map} +1 -1
  83. package/dist/chunks/{Prefs-ByA-x51i.js → Prefs-C4MZ28SX.js} +118 -95
  84. package/dist/chunks/Prefs-C4MZ28SX.js.map +1 -0
  85. package/dist/chunks/{Properties-DmAeQ3mk.js → Properties-DseN56WI.js} +29 -29
  86. package/dist/chunks/{Properties-DmAeQ3mk.js.map → Properties-DseN56WI.js.map} +1 -1
  87. package/dist/chunks/PropertyField-BbNqK8xr.js +743 -0
  88. package/dist/chunks/PropertyField-BbNqK8xr.js.map +1 -0
  89. package/dist/chunks/{RadioGroup-Bh4-12e-.js → RadioGroup-B70_M-gT.js} +2 -2
  90. package/dist/chunks/{RadioGroup-Bh4-12e-.js.map → RadioGroup-B70_M-gT.js.map} +1 -1
  91. package/dist/chunks/{RangeSlider-SEGE-7VF.js → RangeSlider-DO5TZVk7.js} +8 -8
  92. package/dist/chunks/{RangeSlider-SEGE-7VF.js.map → RangeSlider-DO5TZVk7.js.map} +1 -1
  93. package/dist/chunks/RecentColorsProvider-DHcfk25u.js +84 -0
  94. package/dist/chunks/RecentColorsProvider-DHcfk25u.js.map +1 -0
  95. package/dist/chunks/ResizeHandle-CbAgCQOt.js +81 -0
  96. package/dist/chunks/ResizeHandle-CbAgCQOt.js.map +1 -0
  97. package/dist/chunks/Select-ouV8O6cp.js +236 -0
  98. package/dist/chunks/Select-ouV8O6cp.js.map +1 -0
  99. package/dist/chunks/{SelectionPanel-BaQnX4Bs.js → SelectionPanel-C3WzyaZV.js} +14 -13
  100. package/dist/chunks/{SelectionPanel-BaQnX4Bs.js.map → SelectionPanel-C3WzyaZV.js.map} +1 -1
  101. package/dist/chunks/{SidebarPanel-BblDEz4G.js → SidebarPanel-AXQ0jRDx.js} +2 -2
  102. package/dist/chunks/{SidebarPanel-BblDEz4G.js.map → SidebarPanel-AXQ0jRDx.js.map} +1 -1
  103. package/dist/chunks/{Slider-YofwGOI4.js → Slider-DSrlMEq8.js} +19 -19
  104. package/dist/chunks/Slider-DSrlMEq8.js.map +1 -0
  105. package/dist/chunks/{StatusBar-Ca9Dvhhq.js → StatusBar-BEOfOX0D.js} +6 -6
  106. package/dist/chunks/StatusBar-BEOfOX0D.js.map +1 -0
  107. package/dist/chunks/SwatchGrid-9ZPiDmxd.js +78 -0
  108. package/dist/chunks/SwatchGrid-9ZPiDmxd.js.map +1 -0
  109. package/dist/chunks/SwatchStrip-Bi9iPLoh.js +577 -0
  110. package/dist/chunks/SwatchStrip-Bi9iPLoh.js.map +1 -0
  111. package/dist/chunks/{ThemeSwitcher-BlsInAmR.js → ThemeSwitcher-DiBmMh_B.js} +3 -3
  112. package/dist/chunks/{ThemeSwitcher-BlsInAmR.js.map → ThemeSwitcher-DiBmMh_B.js.map} +1 -1
  113. package/dist/chunks/{Timeline-B39cwfMB.js → Timeline-sMCH2fah.js} +293 -280
  114. package/dist/chunks/Timeline-sMCH2fah.js.map +1 -0
  115. package/dist/chunks/Toast-C3ozq11V.js +170 -0
  116. package/dist/chunks/Toast-C3ozq11V.js.map +1 -0
  117. package/dist/chunks/{ToggleBar-BTYkBXU9.js → ToggleBar-Z2jZiguF.js} +6 -8
  118. package/dist/chunks/{ToggleBar-BTYkBXU9.js.map → ToggleBar-Z2jZiguF.js.map} +1 -1
  119. package/dist/chunks/{TokenPanel-CMDAOfYH.js → TokenPanel-WtKGY2Db.js} +32 -32
  120. package/dist/chunks/TokenPanel-WtKGY2Db.js.map +1 -0
  121. package/dist/chunks/{ToolButton-CAHBa08P.js → ToolButton-BURp4YIO.js} +7 -9
  122. package/dist/chunks/ToolButton-BURp4YIO.js.map +1 -0
  123. package/dist/chunks/{ToolOptionsBar-D_GCrBAN.js → ToolOptionsBar-CZTYPoC2.js} +3 -2
  124. package/dist/chunks/{ToolOptionsBar-D_GCrBAN.js.map → ToolOptionsBar-CZTYPoC2.js.map} +1 -1
  125. package/dist/chunks/{ToolPalette-OOWN51Xx.js → ToolPalette-DKDFWOX-.js} +7 -9
  126. package/dist/chunks/{ToolPalette-OOWN51Xx.js.map → ToolPalette-DKDFWOX-.js.map} +1 -1
  127. package/dist/chunks/{Tooltip-Clg2mhSt.js → Tooltip-C6eFCYxw.js} +2 -2
  128. package/dist/chunks/{Tooltip-Clg2mhSt.js.map → Tooltip-C6eFCYxw.js.map} +1 -1
  129. package/dist/chunks/Tree-Cc8lIzgM.js.map +1 -1
  130. package/dist/chunks/checkbox.module-DLQV9tMX.js +5 -0
  131. package/dist/chunks/checkbox.module-DLQV9tMX.js.map +1 -0
  132. package/dist/chunks/{createKeyframeLayer-DVl321_l.js → createKeyframeLayer-DSVf13Su.js} +194 -208
  133. package/dist/chunks/createKeyframeLayer-DSVf13Su.js.map +1 -0
  134. package/dist/chunks/field.module-B27pWv0i.js +15 -0
  135. package/dist/chunks/field.module-B27pWv0i.js.map +1 -0
  136. package/dist/chunks/formatShortcut-DRQrVThu.js.map +1 -1
  137. package/dist/chunks/handles-CqVANLtu.js +17 -0
  138. package/dist/chunks/handles-CqVANLtu.js.map +1 -0
  139. package/dist/chunks/{icons-BhcR1l64.js → icons-Dr2-r30x.js} +2 -2
  140. package/dist/chunks/icons-Dr2-r30x.js.map +1 -0
  141. package/dist/chunks/listbox.module-BcdVJMbm.js +8 -0
  142. package/dist/chunks/listbox.module-BcdVJMbm.js.map +1 -0
  143. package/dist/chunks/model-qsAFK7_0.js +386 -0
  144. package/dist/chunks/model-qsAFK7_0.js.map +1 -0
  145. package/dist/chunks/{portalHost-yTOVuCej.js → portalHost-CE70wLzo.js} +10 -6
  146. package/dist/chunks/portalHost-CE70wLzo.js.map +1 -0
  147. package/dist/chunks/prefField-BE_Ytr2H.js +229 -0
  148. package/dist/chunks/prefField-BE_Ytr2H.js.map +1 -0
  149. package/dist/chunks/{segmentTooltip-CStYHKzd.js → segmentTooltip-CGxCOWNz.js} +2 -2
  150. package/dist/chunks/{segmentTooltip-CStYHKzd.js.map → segmentTooltip-CGxCOWNz.js.map} +1 -1
  151. package/dist/chunks/segmentedControl.module-BzGXUL5G.js +11 -0
  152. package/dist/chunks/segmentedControl.module-BzGXUL5G.js.map +1 -0
  153. package/dist/chunks/useReorderDragList-CStYKjHl.js +133 -0
  154. package/dist/chunks/useReorderDragList-CStYKjHl.js.map +1 -0
  155. package/dist/chunks/useRovingTabIndex-D7u22Ia_.js +91 -0
  156. package/dist/chunks/useRovingTabIndex-D7u22Ia_.js.map +1 -0
  157. package/dist/components/ActionBar/ActionBar.d.ts.map +1 -1
  158. package/dist/components/ActionBar/index.js +1 -1
  159. package/dist/components/Badge/bases/ChamferedRect.d.ts.map +1 -1
  160. package/dist/components/Badge/index.js +1 -1
  161. package/dist/components/BandEditor/BandEditor.d.ts +1 -0
  162. package/dist/components/BandEditor/BandEditor.d.ts.map +1 -1
  163. package/dist/components/BandEditor/index.js +1 -1
  164. package/dist/components/Button/index.js +1 -1
  165. package/dist/components/ButtonBar/ButtonBar.d.ts.map +1 -1
  166. package/dist/components/ButtonBar/index.js +1 -1
  167. package/dist/components/Callout/Callout.d.ts.map +1 -1
  168. package/dist/components/Callout/index.js +1 -1
  169. package/dist/components/Checkbox/Checkbox.d.ts +28 -13
  170. package/dist/components/Checkbox/Checkbox.d.ts.map +1 -1
  171. package/dist/components/Checkbox/index.js +1 -1
  172. package/dist/components/CloseButton/index.js +1 -1
  173. package/dist/components/ColorField/ColorField.d.ts.map +1 -1
  174. package/dist/components/ColorField/OpacityRange.d.ts +18 -0
  175. package/dist/components/ColorField/OpacityRange.d.ts.map +1 -0
  176. package/dist/components/ColorField/index.js +1 -1
  177. package/dist/components/ColorModeControl/index.js +1 -1
  178. package/dist/components/ComboBox/ComboBox.d.ts +7 -0
  179. package/dist/components/ComboBox/ComboBox.d.ts.map +1 -1
  180. package/dist/components/ComboBox/index.js +1 -1
  181. package/dist/components/CurveEditor/CurveEditor.d.ts.map +1 -1
  182. package/dist/components/CurveEditor/LayeredCurveEditor.d.ts.map +1 -1
  183. package/dist/components/CurveEditor/index.js +2 -2
  184. package/dist/components/DataGrid/DataGrid.d.ts +3 -0
  185. package/dist/components/DataGrid/DataGrid.d.ts.map +1 -1
  186. package/dist/components/DataGrid/index.js +1 -1
  187. package/dist/components/DetailList/DetailList.d.ts +1 -1
  188. package/dist/components/DetailList/DetailList.d.ts.map +1 -1
  189. package/dist/components/DetailList/index.js +1 -1
  190. package/dist/components/DetentSlider/index.js +1 -1
  191. package/dist/components/Dialog/index.js +1 -1
  192. package/dist/components/DragGhost/index.js +1 -1
  193. package/dist/components/FallthroughDiagram/index.js +1 -1
  194. package/dist/components/Field/index.js +1 -1
  195. package/dist/components/FillStrokeSwatch/FillStrokeSwatch.d.ts +5 -2
  196. package/dist/components/FillStrokeSwatch/FillStrokeSwatch.d.ts.map +1 -1
  197. package/dist/components/FillStrokeSwatch/index.js +1 -1
  198. package/dist/components/FontFamilySelect/FontFamilySelect.d.ts +20 -0
  199. package/dist/components/FontFamilySelect/FontFamilySelect.d.ts.map +1 -1
  200. package/dist/components/FontFamilySelect/index.js +1 -1
  201. package/dist/components/FontWeightSelect/FontWeightSelect.d.ts +26 -0
  202. package/dist/components/FontWeightSelect/FontWeightSelect.d.ts.map +1 -0
  203. package/dist/components/FontWeightSelect/index.d.ts +3 -0
  204. package/dist/components/FontWeightSelect/index.d.ts.map +1 -0
  205. package/dist/components/FontWeightSelect/index.js +2 -0
  206. package/dist/components/GestureRoute/index.js +1 -1
  207. package/dist/components/GradientEditor/GradientHandles.d.ts +1 -8
  208. package/dist/components/GradientEditor/GradientHandles.d.ts.map +1 -1
  209. package/dist/components/GradientEditor/SceneGradientHandles.d.ts +7 -5
  210. package/dist/components/GradientEditor/SceneGradientHandles.d.ts.map +1 -1
  211. package/dist/components/GradientEditor/handleOverlay.d.ts +41 -0
  212. package/dist/components/GradientEditor/handleOverlay.d.ts.map +1 -0
  213. package/dist/components/GradientEditor/index.js +1 -1
  214. package/dist/components/InlineRange/index.js +1 -1
  215. package/dist/components/Input/Input.d.ts +1 -1
  216. package/dist/components/Input/Input.d.ts.map +1 -1
  217. package/dist/components/Input/index.js +1 -1
  218. package/dist/components/ItemList/ItemList.d.ts +32 -31
  219. package/dist/components/ItemList/ItemList.d.ts.map +1 -1
  220. package/dist/components/ItemList/index.js +1 -1
  221. package/dist/components/Jog/index.js +1 -1
  222. package/dist/components/LayerList/LayerList.d.ts.map +1 -1
  223. package/dist/components/LayerList/index.js +1 -1
  224. package/dist/components/ListEditor/ListEditor.d.ts.map +1 -1
  225. package/dist/components/ListEditor/index.js +1 -1
  226. package/dist/components/MenuButton/MenuButton.d.ts.map +1 -1
  227. package/dist/components/MenuButton/index.js +1 -1
  228. package/dist/components/MeshEditor/MeshEditor.d.ts +4 -3
  229. package/dist/components/MeshEditor/MeshEditor.d.ts.map +1 -1
  230. package/dist/components/MeshEditor/MeshHandles.d.ts +38 -0
  231. package/dist/components/MeshEditor/MeshHandles.d.ts.map +1 -0
  232. package/dist/components/MeshEditor/index.d.ts +2 -0
  233. package/dist/components/MeshEditor/index.d.ts.map +1 -1
  234. package/dist/components/MeshEditor/index.js +2 -2
  235. package/dist/components/NumberField/NumberField.d.ts +1 -1
  236. package/dist/components/NumberField/NumberField.d.ts.map +1 -1
  237. package/dist/components/NumberField/index.js +1 -1
  238. package/dist/components/OptionsBar/OptionsBar.d.ts.map +1 -1
  239. package/dist/components/OptionsBar/index.js +1 -1
  240. package/dist/components/PaintField/PaintField.d.ts.map +1 -1
  241. package/dist/components/PaintField/index.js +1 -1
  242. package/dist/components/PaintInput/PaintInput.d.ts.map +1 -1
  243. package/dist/components/PaintInput/index.js +1 -1
  244. package/dist/components/PatternPicker/PatternPicker.d.ts +6 -5
  245. package/dist/components/PatternPicker/PatternPicker.d.ts.map +1 -1
  246. package/dist/components/PatternPicker/index.js +1 -1
  247. package/dist/components/Plot2D/index.js +1 -1
  248. package/dist/components/PointPlotter/index.js +1 -1
  249. package/dist/components/Powerline/index.js +2 -2
  250. package/dist/components/Prefs/PrefsForm.d.ts +22 -0
  251. package/dist/components/Prefs/PrefsForm.d.ts.map +1 -1
  252. package/dist/components/Prefs/PrefsRail.d.ts +3 -2
  253. package/dist/components/Prefs/PrefsRail.d.ts.map +1 -1
  254. package/dist/components/Prefs/PrefsRow.d.ts +4 -0
  255. package/dist/components/Prefs/PrefsRow.d.ts.map +1 -1
  256. package/dist/components/Prefs/index.js +2 -2
  257. package/dist/components/Prefs/prefField.d.ts +13 -0
  258. package/dist/components/Prefs/prefField.d.ts.map +1 -1
  259. package/dist/components/Properties/PropertyField.d.ts +13 -2
  260. package/dist/components/Properties/PropertyField.d.ts.map +1 -1
  261. package/dist/components/Properties/PropertyPanel.d.ts +18 -1
  262. package/dist/components/Properties/PropertyPanel.d.ts.map +1 -1
  263. package/dist/components/Properties/index.d.ts +2 -2
  264. package/dist/components/Properties/index.d.ts.map +1 -1
  265. package/dist/components/Properties/index.js +3 -3
  266. package/dist/components/RadioGroup/index.js +1 -1
  267. package/dist/components/RangeSlider/index.js +1 -1
  268. package/dist/components/RecentColors/RecentColorsProvider.d.ts +24 -0
  269. package/dist/components/RecentColors/RecentColorsProvider.d.ts.map +1 -0
  270. package/dist/components/RecentColors/index.d.ts +5 -0
  271. package/dist/components/RecentColors/index.d.ts.map +1 -0
  272. package/dist/components/RecentColors/index.js +2 -0
  273. package/dist/components/RecentColors/recentColors.d.ts +39 -0
  274. package/dist/components/RecentColors/recentColors.d.ts.map +1 -0
  275. package/dist/components/ResizeHandle/ResizeHandle.d.ts.map +1 -1
  276. package/dist/components/ResizeHandle/index.js +1 -1
  277. package/dist/components/Select/Select.d.ts +6 -2
  278. package/dist/components/Select/Select.d.ts.map +1 -1
  279. package/dist/components/Select/index.js +1 -1
  280. package/dist/components/SelectionPanel/index.js +2 -2
  281. package/dist/components/SelectionPanel/renderLeaf.d.ts +12 -2
  282. package/dist/components/SelectionPanel/renderLeaf.d.ts.map +1 -1
  283. package/dist/components/SidebarPanel/index.js +1 -1
  284. package/dist/components/Slider/index.js +1 -1
  285. package/dist/components/StatusBar/StatusBar.d.ts +1 -1
  286. package/dist/components/StatusBar/index.js +1 -1
  287. package/dist/components/SwatchGrid/SwatchGrid.d.ts.map +1 -1
  288. package/dist/components/SwatchGrid/index.js +1 -1
  289. package/dist/components/SwatchStrip/SwatchStrip.d.ts +44 -0
  290. package/dist/components/SwatchStrip/SwatchStrip.d.ts.map +1 -0
  291. package/dist/components/SwatchStrip/index.d.ts +5 -0
  292. package/dist/components/SwatchStrip/index.d.ts.map +1 -0
  293. package/dist/components/SwatchStrip/index.js +2 -0
  294. package/dist/components/SwatchStrip/palettes.d.ts +21 -0
  295. package/dist/components/SwatchStrip/palettes.d.ts.map +1 -0
  296. package/dist/components/ThemeSwitcher/index.js +1 -1
  297. package/dist/components/Timeline/AnimatedTimeline.d.ts +1 -0
  298. package/dist/components/Timeline/AnimatedTimeline.d.ts.map +1 -1
  299. package/dist/components/Timeline/EasingPicker.d.ts +3 -0
  300. package/dist/components/Timeline/EasingPicker.d.ts.map +1 -1
  301. package/dist/components/Timeline/LaneGraph.d.ts +1 -1
  302. package/dist/components/Timeline/LaneGraph.d.ts.map +1 -1
  303. package/dist/components/Timeline/Timeline.d.ts +10 -1
  304. package/dist/components/Timeline/Timeline.d.ts.map +1 -1
  305. package/dist/components/Timeline/Transport.d.ts +6 -0
  306. package/dist/components/Timeline/Transport.d.ts.map +1 -1
  307. package/dist/components/Timeline/index.js +1 -1
  308. package/dist/components/Timeline/keys.d.ts +1 -0
  309. package/dist/components/Timeline/keys.d.ts.map +1 -1
  310. package/dist/components/Toast/Toast.d.ts +12 -3
  311. package/dist/components/Toast/Toast.d.ts.map +1 -1
  312. package/dist/components/Toast/index.js +1 -1
  313. package/dist/components/ToggleBar/ToggleBar.d.ts.map +1 -1
  314. package/dist/components/ToggleBar/index.js +1 -1
  315. package/dist/components/TokenPanel/index.js +1 -1
  316. package/dist/components/TokenPanel/tokenTypes.d.ts +1 -0
  317. package/dist/components/TokenPanel/tokenTypes.d.ts.map +1 -1
  318. package/dist/components/ToolButton/ToolButton.d.ts +1 -10
  319. package/dist/components/ToolButton/ToolButton.d.ts.map +1 -1
  320. package/dist/components/ToolButton/index.js +1 -1
  321. package/dist/components/ToolOptionsBar/index.js +1 -1
  322. package/dist/components/ToolPalette/ToolPalette.d.ts.map +1 -1
  323. package/dist/components/ToolPalette/formatShortcut.d.ts +2 -0
  324. package/dist/components/ToolPalette/formatShortcut.d.ts.map +1 -1
  325. package/dist/components/ToolPalette/index.js +1 -1
  326. package/dist/components/Tooltip/index.js +1 -1
  327. package/dist/components/Tree/Tree.d.ts +27 -26
  328. package/dist/components/Tree/Tree.d.ts.map +1 -1
  329. package/dist/icons/index.d.ts +51 -0
  330. package/dist/icons/index.d.ts.map +1 -1
  331. package/dist/icons/paths.d.ts +2 -0
  332. package/dist/icons/paths.d.ts.map +1 -1
  333. package/dist/index.d.ts +4 -1
  334. package/dist/index.d.ts.map +1 -1
  335. package/dist/index.js +98 -95
  336. package/dist/index.js.map +1 -1
  337. package/dist/overlays/portalHost.d.ts +6 -0
  338. package/dist/overlays/portalHost.d.ts.map +1 -1
  339. package/dist/style.css +1 -1
  340. package/dist/useAsyncOptions.d.ts.map +1 -1
  341. package/dist/useReorderDragList.d.ts.map +1 -1
  342. package/dist/useRovingTabIndex.d.ts +40 -39
  343. package/dist/useRovingTabIndex.d.ts.map +1 -1
  344. package/package.json +9 -9
  345. package/dist/chunks/ActionBar-DCq16yFA.js +0 -57
  346. package/dist/chunks/ActionBar-DCq16yFA.js.map +0 -1
  347. package/dist/chunks/BandEditor-Dd0egAgE.js.map +0 -1
  348. package/dist/chunks/Callout-ndW5_Bqx.js +0 -116
  349. package/dist/chunks/Callout-ndW5_Bqx.js.map +0 -1
  350. package/dist/chunks/Checkbox-DHXTUHO9.js +0 -47
  351. package/dist/chunks/Checkbox-DHXTUHO9.js.map +0 -1
  352. package/dist/chunks/ColorField-Yz_BkcCT.js +0 -69
  353. package/dist/chunks/ColorField-Yz_BkcCT.js.map +0 -1
  354. package/dist/chunks/ComboBox-B34H76CW.js +0 -138
  355. package/dist/chunks/ComboBox-B34H76CW.js.map +0 -1
  356. package/dist/chunks/CurveEditor-DUVjd25R.js.map +0 -1
  357. package/dist/chunks/DataGrid-LZ2JgY2Y.js.map +0 -1
  358. package/dist/chunks/DetailList-BKomDzg5.js +0 -52
  359. package/dist/chunks/DetailList-BKomDzg5.js.map +0 -1
  360. package/dist/chunks/FallthroughDiagram-BEHiM5IS.js.map +0 -1
  361. package/dist/chunks/Field--onYxXTF.js +0 -32
  362. package/dist/chunks/Field--onYxXTF.js.map +0 -1
  363. package/dist/chunks/FillStrokeSwatch-DNb0KXPk.js +0 -111
  364. package/dist/chunks/FillStrokeSwatch-DNb0KXPk.js.map +0 -1
  365. package/dist/chunks/FontFamilySelect-DkRgNtag.js.map +0 -1
  366. package/dist/chunks/GradientEditor-b7v4Ph3i.js +0 -363
  367. package/dist/chunks/GradientEditor-b7v4Ph3i.js.map +0 -1
  368. package/dist/chunks/Icon-CcVjdq2C.js.map +0 -1
  369. package/dist/chunks/InlineRange-P01ABSzo.js.map +0 -1
  370. package/dist/chunks/Input-CHmkfYaD.js.map +0 -1
  371. package/dist/chunks/ItemList-Cm-HUWCi.js.map +0 -1
  372. package/dist/chunks/Jog-DRmfrkCg.js.map +0 -1
  373. package/dist/chunks/LayerList-wCI1EueM.js.map +0 -1
  374. package/dist/chunks/ListEditor-BeA60TAA.js +0 -71
  375. package/dist/chunks/ListEditor-BeA60TAA.js.map +0 -1
  376. package/dist/chunks/MenuButton-BSqEChJE.js +0 -70
  377. package/dist/chunks/MenuButton-BSqEChJE.js.map +0 -1
  378. package/dist/chunks/MeshEditor-D1HLZcAh.js +0 -87
  379. package/dist/chunks/MeshEditor-D1HLZcAh.js.map +0 -1
  380. package/dist/chunks/NumberField-BnJxcazc.js.map +0 -1
  381. package/dist/chunks/PaintField-DadOELMg.js +0 -62
  382. package/dist/chunks/PaintField-DadOELMg.js.map +0 -1
  383. package/dist/chunks/PaintInput-v8Y7MDbH.js +0 -121
  384. package/dist/chunks/PaintInput-v8Y7MDbH.js.map +0 -1
  385. package/dist/chunks/PatternPicker-R_EQtw2Q.js +0 -93
  386. package/dist/chunks/PatternPicker-R_EQtw2Q.js.map +0 -1
  387. package/dist/chunks/Plot2D-CTXHkL5p.js.map +0 -1
  388. package/dist/chunks/Prefs-ByA-x51i.js.map +0 -1
  389. package/dist/chunks/PropertyField-DfIJJ5GS.js +0 -673
  390. package/dist/chunks/PropertyField-DfIJJ5GS.js.map +0 -1
  391. package/dist/chunks/ResizeHandle-rKVWyeTG.js +0 -79
  392. package/dist/chunks/ResizeHandle-rKVWyeTG.js.map +0 -1
  393. package/dist/chunks/Select-ClmKtyWg.js +0 -229
  394. package/dist/chunks/Select-ClmKtyWg.js.map +0 -1
  395. package/dist/chunks/Slider-YofwGOI4.js.map +0 -1
  396. package/dist/chunks/StatusBar-Ca9Dvhhq.js.map +0 -1
  397. package/dist/chunks/SwatchGrid-BYvA8Bmh.js +0 -73
  398. package/dist/chunks/SwatchGrid-BYvA8Bmh.js.map +0 -1
  399. package/dist/chunks/Timeline-B39cwfMB.js.map +0 -1
  400. package/dist/chunks/Toast-BF9GE0HC.js +0 -126
  401. package/dist/chunks/Toast-BF9GE0HC.js.map +0 -1
  402. package/dist/chunks/TokenPanel-CMDAOfYH.js.map +0 -1
  403. package/dist/chunks/ToolButton-CAHBa08P.js.map +0 -1
  404. package/dist/chunks/createKeyframeLayer-DVl321_l.js.map +0 -1
  405. package/dist/chunks/icons-BhcR1l64.js.map +0 -1
  406. package/dist/chunks/model-BaF65rnX.js +0 -365
  407. package/dist/chunks/model-BaF65rnX.js.map +0 -1
  408. package/dist/chunks/portalHost-yTOVuCej.js.map +0 -1
  409. package/dist/chunks/prefField-BopW9bjx.js +0 -201
  410. package/dist/chunks/prefField-BopW9bjx.js.map +0 -1
  411. package/dist/chunks/segmentedControl.module-D6SzYJD7.js +0 -11
  412. package/dist/chunks/segmentedControl.module-D6SzYJD7.js.map +0 -1
  413. package/dist/chunks/useReorderDragList-FCMoFIzH.js +0 -131
  414. package/dist/chunks/useReorderDragList-FCMoFIzH.js.map +0 -1
  415. package/dist/chunks/useRovingTabIndex-Bp_hYm_h.js +0 -65
  416. package/dist/chunks/useRovingTabIndex-Bp_hYm_h.js.map +0 -1
@@ -0,0 +1,386 @@
1
+ import { a as e, t } from "./Icon--B1ME-6c.js";
2
+ import { r as n, t as r } from "./PropertyField-BbNqK8xr.js";
3
+ import { t as i } from "./ToggleBar-Z2jZiguF.js";
4
+ import { t as a } from "./prefField-BE_Ytr2H.js";
5
+ import { MIXED as o } from "@weasel-js/core";
6
+ import { jsx as s, jsxs as c } from "react/jsx-runtime";
7
+ import { Fragment as l, createElement as u } from "react";
8
+ var d = {
9
+ root: "_root_11o7u_1",
10
+ header: "_header_11o7u_8",
11
+ kind: "_kind_11o7u_16",
12
+ breakdown: "_breakdown_11o7u_21",
13
+ section: "_section_11o7u_26",
14
+ sectionTitle: "_sectionTitle_11o7u_35",
15
+ row: "_row_11o7u_44",
16
+ rowLabel: "_rowLabel_11o7u_52",
17
+ rowControls: "_rowControls_11o7u_56",
18
+ namedField: "_namedField_11o7u_66",
19
+ blockRow: "_blockRow_11o7u_78",
20
+ toggle: "_toggle_11o7u_89",
21
+ flagToggle: "_flagToggle_11o7u_111",
22
+ number: "_number_11o7u_115",
23
+ select: "_select_11o7u_116",
24
+ unrenderable: "_unrenderable_11o7u_120",
25
+ objectLeaf: "_objectLeaf_11o7u_127",
26
+ objectGroup: "_objectGroup_11o7u_136",
27
+ slider: "_slider_11o7u_143"
28
+ };
29
+ //#endregion
30
+ //#region src/components/SelectionPanel/renderLeaf.tsx
31
+ function f(e, t) {
32
+ let { leaf: n } = e;
33
+ return n.kind === "boolean" && n.control === "toggle" && n.pair !== void 0 && t?.[e.ctx.path] === void 0 && t?.[n.kind] === void 0;
34
+ }
35
+ function p(e, t) {
36
+ let n = [];
37
+ for (let r = 0; r < e.length;) {
38
+ let i = e[r];
39
+ if (!f(i, t)) {
40
+ let e = i.render();
41
+ e != null && n.push({
42
+ key: i.key,
43
+ leaf: i.leaf,
44
+ block: i.leaf.block === !0,
45
+ content: e
46
+ }), r += 1;
47
+ continue;
48
+ }
49
+ let a = r + 1;
50
+ for (; a < e.length && f(e[a], t) && e[a].leaf.pair === i.leaf.pair;) a += 1;
51
+ let o = e.slice(r, a);
52
+ n.push({
53
+ key: i.key,
54
+ leaf: i.leaf,
55
+ block: o.every((e) => e.leaf.block === !0),
56
+ content: /* @__PURE__ */ s(m, {
57
+ run: o,
58
+ ariaLabel: i.leaf.pair
59
+ })
60
+ }), r = a;
61
+ }
62
+ return n;
63
+ }
64
+ function m({ run: e, ariaLabel: t }) {
65
+ let r = e.map((e) => ({
66
+ cell: e,
67
+ field: a(e.leaf, {
68
+ value: e.ctx.value,
69
+ mixed: e.ctx.mixed,
70
+ unset: e.ctx.unset,
71
+ siblings: e.ctx.siblings,
72
+ setValue: e.ctx.setValue,
73
+ ...v(e.ctx)
74
+ })
75
+ })), o = r.filter((e) => !e.field.mixed && e.field.value === !0).map((e) => e.cell.key);
76
+ return /* @__PURE__ */ s(i, {
77
+ mode: "multiple",
78
+ size: "sm",
79
+ variant: "flat",
80
+ className: d.flagToggle,
81
+ ariaLabel: t,
82
+ items: r.map(({ cell: e, field: t }) => ({
83
+ value: e.key,
84
+ label: t.glyph ?? e.leaf.name.slice(0, 1),
85
+ ariaLabel: e.ariaLabel,
86
+ tooltip: n(t.glyph) === void 0 ? void 0 : e.leaf.name
87
+ })),
88
+ value: o,
89
+ mixedValues: r.filter((e) => e.field.mixed).map((e) => e.cell.key),
90
+ onChange: (e) => {
91
+ for (let { cell: t, field: n } of r) {
92
+ let r = e.includes(t.key);
93
+ r !== o.includes(t.key) && n.onChange(r);
94
+ }
95
+ }
96
+ });
97
+ }
98
+ function h(e, t, n, i = "", o = !1) {
99
+ let { pref: l, value: f, mixed: p, unset: m, setValue: h } = e;
100
+ if (l.kind === "object") return /* @__PURE__ */ s(y, {
101
+ ctx: e,
102
+ renderers: n,
103
+ selectionKey: i
104
+ });
105
+ let b = a(l, {
106
+ value: f,
107
+ mixed: p,
108
+ unset: m,
109
+ siblings: e.siblings,
110
+ setValue: h,
111
+ ...v(e),
112
+ fontVariant: {
113
+ weight: e.valueAt(_(e.path, "fontWeight")).value,
114
+ style: e.valueAt(_(e.path, "fontStyle")).value
115
+ },
116
+ fontFamily: e.valueAt(_(e.path, "fontFamily")).value
117
+ });
118
+ if (b === null) return /* @__PURE__ */ c("span", {
119
+ className: d.unrenderable,
120
+ children: [
121
+ "(",
122
+ l.kind,
123
+ ": no renderer)"
124
+ ]
125
+ });
126
+ switch (b.kind) {
127
+ case "boolean": return /* @__PURE__ */ s(r, {
128
+ ...b,
129
+ name: t,
130
+ control: b.control ?? "switch",
131
+ className: b.control === "toggle" ? d.flagToggle : void 0
132
+ });
133
+ case "number": return /* @__PURE__ */ s(r, {
134
+ ...b,
135
+ name: t,
136
+ className: b.control === "slider" ? d.slider : d.number,
137
+ onInput: b.control === "slider" ? b.onInput : g
138
+ });
139
+ case "string": return /* @__PURE__ */ s(r, {
140
+ ...b,
141
+ name: t,
142
+ onInput: g
143
+ });
144
+ case "enum": return /* @__PURE__ */ s(r, {
145
+ ...b,
146
+ name: t,
147
+ className: b.control === "toggle" ? b.onClear ? d.flagToggle : d.toggle : b.control === "radio" ? void 0 : d.select
148
+ });
149
+ case "font-family":
150
+ case "font-weight": return /* @__PURE__ */ s(r, {
151
+ ...b,
152
+ name: t,
153
+ className: d.select
154
+ });
155
+ case "paint": return /* @__PURE__ */ u(r, {
156
+ ...b,
157
+ name: t,
158
+ key: i,
159
+ control: "inline",
160
+ allowNone: !o
161
+ });
162
+ case "color": return /* @__PURE__ */ s(r, {
163
+ ...b,
164
+ name: t,
165
+ onInput: g
166
+ });
167
+ }
168
+ }
169
+ var g = () => {};
170
+ function _(e, t) {
171
+ let n = e.lastIndexOf(".");
172
+ return n < 0 ? t : `${e.slice(0, n + 1)}${t}`;
173
+ }
174
+ function v(e) {
175
+ if (e.eachSiblings === void 0) return {};
176
+ let t = e.eachSiblings;
177
+ return {
178
+ perNode: e.each.map((e, n) => ({
179
+ value: e,
180
+ siblings: t[n]
181
+ })),
182
+ update: e.update
183
+ };
184
+ }
185
+ function y({ ctx: n, renderers: r, selectionKey: i = "" }) {
186
+ let a = n.pref, o = typeof n.value == "object" && n.value !== null ? n.value : void 0, u = n.each.map((e) => typeof e == "object" && e ? e : void 0), f = Object.values(a.children).every((e) => !("kind" in e)), m = (f, g) => {
187
+ let _ = [], v = (e) => typeof e == "object" && !!e && "controls" in e, y = [], b = () => {
188
+ for (let { key: e, leaf: t, block: n, content: i } of p(y, r)) {
189
+ let r = _[_.length - 1];
190
+ if (t.pair !== void 0 && v(r) && r.pair === t.pair) {
191
+ r.controls.push(/* @__PURE__ */ s(l, { children: i }, e)), r.block &&= n;
192
+ continue;
193
+ }
194
+ _.push({
195
+ key: e,
196
+ pair: t.pair,
197
+ label: t.pair ?? t.name,
198
+ title: t.description,
199
+ block: n,
200
+ controls: [/* @__PURE__ */ s(l, { children: i }, e)]
201
+ });
202
+ }
203
+ y = [];
204
+ };
205
+ for (let [l, p] of Object.entries(f)) {
206
+ if (!("kind" in p)) {
207
+ let e = p.name !== "", t = m(p.children, e);
208
+ if (t.length === 0) continue;
209
+ b(), _.push(/* @__PURE__ */ c("div", {
210
+ className: e && g ? d.objectGroup : void 0,
211
+ children: [e && /* @__PURE__ */ s("h5", {
212
+ className: d.sectionTitle,
213
+ children: p.name
214
+ }), t]
215
+ }, `group:${l}`));
216
+ continue;
217
+ }
218
+ let f = `${n.path}.${l}`, v = n.mixed ? n.valueAt(f) : {
219
+ value: o?.[l],
220
+ mixed: !1
221
+ }, x = (e) => n.update((t) => {
222
+ let n = typeof t == "object" && t ? t : a.fromScalar?.(t) ?? (typeof a.default == "object" && a.default !== null ? { ...a.default } : {}), r = e(n[l], n);
223
+ if (r === void 0) {
224
+ let { [l]: e, ...t } = n;
225
+ return t;
226
+ }
227
+ return {
228
+ ...n,
229
+ [l]: r
230
+ };
231
+ }), S = {
232
+ path: f,
233
+ pref: p,
234
+ value: v.mixed ? void 0 : v.value,
235
+ mixed: v.mixed,
236
+ unset: !v.mixed && v.value === void 0,
237
+ siblings: o,
238
+ each: u.map((e) => e?.[l]),
239
+ eachSiblings: u,
240
+ valueAt: n.valueAt,
241
+ selectionKey: n.selectionKey,
242
+ update: x,
243
+ setValue: (e) => x(() => e)
244
+ };
245
+ y.push({
246
+ key: f,
247
+ leaf: p,
248
+ ctx: S,
249
+ ariaLabel: p.name,
250
+ render: () => {
251
+ let n = r?.[f] ?? r?.[p.kind], a = n ? n(S) : h(S, p.name, r, i, !0);
252
+ return a == null ? null : (p.pair !== void 0 || p.block === !0) && p.icon && p.icon in e ? /* @__PURE__ */ c("span", {
253
+ className: d.namedField,
254
+ children: [/* @__PURE__ */ s(t, {
255
+ name: p.icon,
256
+ size: 14
257
+ }), a]
258
+ }) : a;
259
+ }
260
+ });
261
+ }
262
+ return b(), _.map((e) => typeof e == "object" && e && "controls" in e ? e.block ? /* @__PURE__ */ s("div", {
263
+ className: `${d.rowControls} ${d.blockRow}`,
264
+ title: e.title,
265
+ children: e.controls
266
+ }, e.key) : /* @__PURE__ */ c("div", {
267
+ className: d.row,
268
+ children: [/* @__PURE__ */ s("span", {
269
+ className: d.rowLabel,
270
+ title: e.title,
271
+ children: e.label
272
+ }), /* @__PURE__ */ s("span", {
273
+ className: d.rowControls,
274
+ children: e.controls
275
+ })]
276
+ }, e.key) : e);
277
+ }, g = m(a.children, !f);
278
+ return g.length === 0 ? null : /* @__PURE__ */ c("div", {
279
+ className: d.objectLeaf,
280
+ children: [!f && /* @__PURE__ */ s("h4", {
281
+ className: d.sectionTitle,
282
+ children: a.name
283
+ }), g]
284
+ });
285
+ }
286
+ //#endregion
287
+ //#region src/components/SelectionPanel/model.ts
288
+ function b(e, t) {
289
+ if (e.kind === "container") return "group";
290
+ for (let n of t) if (n.matches(e.data)) return n.name;
291
+ return "unknown";
292
+ }
293
+ function x(e) {
294
+ return !("kind" in e);
295
+ }
296
+ function S(e) {
297
+ let t = [], n = [], r = (e, t) => {
298
+ for (let [n, i] of Object.entries(e.children)) x(i) ? r(i, t) : t.push({
299
+ path: n,
300
+ leaf: i
301
+ });
302
+ };
303
+ for (let [i, a] of Object.entries(e.children)) if (x(a)) {
304
+ let e = [];
305
+ r(a, e), t.push({
306
+ key: i,
307
+ name: a.name,
308
+ rows: C(e)
309
+ });
310
+ } else n.push({
311
+ path: i,
312
+ leaf: a
313
+ });
314
+ return n.length > 0 && t.unshift({
315
+ key: "",
316
+ name: "",
317
+ rows: C(n)
318
+ }), t;
319
+ }
320
+ function C(e) {
321
+ let t = [];
322
+ for (let n of e) {
323
+ let e = n.leaf.pair, r = t[t.length - 1];
324
+ e !== void 0 && r !== void 0 && r.label === e ? r.leaves.push(n) : t.push({
325
+ label: e ?? n.leaf.name,
326
+ leaves: [n]
327
+ });
328
+ }
329
+ return t;
330
+ }
331
+ function w(e, t) {
332
+ let n = [...new Set(e)];
333
+ if (n.length === 0) return [];
334
+ let r = new Map(t.map((e) => [e.name, e])), i = n.map((e) => r.get(e)?.schema);
335
+ if (i.some((e) => e === void 0)) return [];
336
+ let [a, ...o] = i, s = S(a);
337
+ if (o.length === 0) return s;
338
+ let c = (e) => `${e.path}\0${e.leaf.kind}`, l = o.map((e) => new Set(S(e).flatMap((e) => e.rows).flatMap((e) => e.leaves).map(c))), u = (e) => l.every((t) => t.has(c(e)));
339
+ return s.map((e) => ({
340
+ ...e,
341
+ rows: e.rows.map((e) => ({
342
+ ...e,
343
+ leaves: e.leaves.filter(u)
344
+ })).filter((e) => e.leaves.length > 0)
345
+ })).filter((e) => e.rows.length > 0);
346
+ }
347
+ function T(e, t) {
348
+ let n = t.split(".");
349
+ if (n.length < 2) return;
350
+ let r = n[0], i = r === "pose" ? e.pose : r === "data" ? e.data : void 0;
351
+ for (let e = 1; e < n.length; e++) {
352
+ if (typeof i != "object" || !i) return;
353
+ i = i[n[e]];
354
+ }
355
+ return i;
356
+ }
357
+ function E(e, t, n) {
358
+ let [r, ...i] = t;
359
+ if (i.length === 0) return Array.isArray(e) ? Object.assign([...e], { [r]: n }) : {
360
+ ...e,
361
+ [r]: n
362
+ };
363
+ let a = e[r], o = E(Array.isArray(a) ? [...a] : typeof a == "object" && a ? { ...a } : {}, i, n);
364
+ return Array.isArray(e) ? Object.assign([...e], { [r]: o }) : {
365
+ ...e,
366
+ [r]: o
367
+ };
368
+ }
369
+ function D(e, t) {
370
+ let n, r = !0;
371
+ for (let i of e) {
372
+ let e = T(i, t);
373
+ if (r) n = e, r = !1;
374
+ else if (!Object.is(e, n)) return o;
375
+ }
376
+ return n;
377
+ }
378
+ function O(e) {
379
+ let t = /* @__PURE__ */ new Map();
380
+ for (let n of e) t.set(n, (t.get(n) ?? 0) + 1);
381
+ return [...t.entries()].map(([e, t]) => t > 1 ? `${e} ×${t}` : e).join(" · ");
382
+ }
383
+ //#endregion
384
+ export { x as a, C as c, p as d, d as f, w as i, E as l, D as n, O as o, b as r, T as s, o as t, h as u };
385
+
386
+ //# sourceMappingURL=model-qsAFK7_0.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"model-qsAFK7_0.js","names":["s","Fragment","ICON_PATHS","drawnGlyph","PropertyControl","ToggleBar","prefFieldProps","Fragment$1","SelectionPanel_module_default","isFlagCell","cell","leaf","renderers","renderCells","out","i","cells","content","j","run","c","FlagBar","flags","perNodeState","on","f","field","now","next","renderBuiltin","ctx","pref","ObjectLeaf","siblingPath","ariaLabel","settledOnly","selectionKey","nested","dot","path","key","siblings","held","eachObject","v","allGrouped","child","rowsOf","isRow","pending","flush","prev","block","children","labeled","inner","indent","childPath","update","base","fn","_dropped","rest","childCtx","o","custom","rendered","Icon","entry","rows","classifyKind","node","routing","isGroup","n","flatten","sections","untitled","collect","group","into","schema","leaves","pairRows","item","pair","effectiveSections","uniq","kinds","byName","entries","schemas","k","s","first","flatFirst","leafKey","l","restKeys","r","keep","set","section","row","nodeValueAt","segments","head","cursor","setAtPath","root","value","aggregateValue","nodes","MIXED","kindBreakdown","counts"],"sources":["../../src/components/SelectionPanel/SelectionPanel.module.css","../../src/components/SelectionPanel/renderLeaf.tsx","../../src/components/SelectionPanel/model.ts"],"sourcesContent":[".root {\n display: flex;\n flex-direction: column;\n font-size: var(--wzl-font-size-sm);\n color: var(--wzl-fg);\n}\n\n.header {\n display: flex;\n align-items: baseline;\n gap: var(--wzl-space-4);\n padding: var(--wzl-space-4) 0;\n border-block-end: 1px solid var(--wzl-border);\n}\n\n.kind {\n font-weight: var(--wzl-font-weight-bold);\n font-size: var(--wzl-font-size);\n}\n\n.breakdown {\n font-size: var(--wzl-font-size-sm);\n opacity: 0.6;\n}\n\n.section {\n padding: var(--wzl-space-3) 0 var(--wzl-space-4);\n border-block-end: 1px solid var(--wzl-border);\n}\n\n.section:last-child {\n border-block-end: none;\n}\n\n.sectionTitle {\n margin: 0 0 var(--wzl-space-3);\n font-size: var(--wzl-font-size-xs);\n font-weight: var(--wzl-font-weight-bold);\n text-transform: uppercase;\n letter-spacing: 0.06em;\n opacity: 0.55;\n}\n\n.row {\n display: grid;\n grid-template-columns: 64px 1fr;\n gap: var(--wzl-space-3);\n align-items: center;\n margin-block-end: 5px;\n}\n\n.rowLabel {\n opacity: 0.75;\n}\n\n.rowControls {\n display: flex;\n flex-wrap: wrap;\n gap: var(--wzl-space-3);\n align-items: center;\n min-inline-size: 0;\n}\n\n/* Glyph plus its control, held together so the pair row wraps between\n fields rather than between a field and the icon naming it. */\n.namedField {\n display: flex;\n align-items: center;\n gap: var(--wzl-space-2);\n min-inline-size: 0;\n}\n\n.namedField > svg {\n flex: none;\n opacity: 0.75;\n}\n\n.blockRow {\n margin-block-end: 5px;\n}\n\n/* Fields paired into one row split it evenly, the way Position's x/y do. */\n.rowControls > .namedField {\n flex: 1 1 0;\n}\n\n/* Except around a segmented bar, which is sized by its segments: an equal\n share of the row is wider than the buttons want to be. */\n.rowControls > .namedField:has(> .toggle) {\n flex: 0 1 auto;\n}\n\n.rowControls > * {\n flex: 1;\n min-inline-size: 0;\n}\n\n/* Bars sharing a row split the leftover between them, so the gap stays fixed\n and the width lands on the segments. A bar with the row to itself is sized\n by its segments instead — a third of 240px is a plate, not a button. */\n.rowControls > .toggle {\n flex: 1 1 auto;\n}\n\n.rowControls > .toggle:only-child {\n flex: 0 1 auto;\n}\n\n/* A flag bar is sized by its glyphs rather than by a share of the row: an\n even split would fling one-letter segments to the margins. */\n.rowControls > .flagToggle {\n flex: 0 0 auto;\n}\n\n.number :global(input),\n.select {\n font-size: var(--wzl-font-size-sm);\n}\n\n.unrenderable {\n font-size: var(--wzl-font-size-sm);\n opacity: 0.5;\n font-style: italic;\n}\n\n/* A `block` leaf that renders its own rows — an object leaf's fields. */\n.objectLeaf {\n margin-block: var(--wzl-space-4) var(--wzl-space-2);\n}\n\n.objectLeaf .sectionTitle {\n margin-block: 7px 5px;\n}\n\n/* Fields under a heading inside an object read as belonging to it. */\n.objectGroup {\n padding-inline-start: var(--wzl-space-4);\n border-inline-start: 1px solid var(--wzl-border);\n margin-block-end: var(--wzl-space-2);\n}\n\n/* The slider's track; the row only says how it shares the space. */\n.slider {\n flex: 1;\n}\n","/**\n * A selection's leaves as cells: one `ToolPrefLeaf` and its aggregated value\n * in, one rendered cell out, plus the run logic that turns a row of paired\n * toggles into a single segmented bar and the rows of an object leaf.\n *\n * The control itself is `PropertyControl`'s, through `prefFieldProps`; what\n * is decided here is how a selection surface sizes and composes it.\n * `ToolOptionsBar` renders a tool's options through the same functions.\n */\nimport { Fragment, type ReactNode } from 'react';\nimport type {\n ToolPrefBoolean,\n ToolPrefGroup,\n ToolPrefLeaf,\n ToolPrefObject,\n} from '@weasel-js/core';\nimport { prefFieldProps, type PrefFieldState } from '../Prefs/prefField';\nimport { drawnGlyph, PropertyControl, type PropertyBooleanFieldProps } from '../Properties/PropertyField';\nimport { ToggleBar } from '../ToggleBar';\nimport { Icon } from '../../icons/Icon';\nimport { ICON_PATHS, type IconName } from '../../icons/paths';\nimport s from './SelectionPanel.module.css';\n\n\n/** What a {@link PropertyRenderer} is given for the property it is rendering. */\nexport interface PropertyRenderContext {\n /** Dotted node path of the leaf (`pose.x`, `data.fill`). */\n path: string;\n /** The schema leaf. App renderers narrow it to their own kind shape. */\n pref: ToolPrefLeaf;\n /** Aggregated value across the selection; `undefined` when mixed or unset. */\n value: unknown;\n /** True when selected nodes disagree at this path. */\n mixed: boolean;\n /**\n * True when the nodes agree and what they agree on is nothing — the field\n * is absent, and whatever paints comes from a fallback further down.\n *\n * Distinct from `mixed`, and both leave `value` undefined. A control must\n * not substitute its schema default here: doing so shows a value the node\n * does not hold, and the next edit writes that invention back.\n */\n unset: boolean;\n /**\n * The fields of the object this leaf is a field of — `undefined` for a\n * top-level leaf, and for a field of an object the node does not hold.\n *\n * What a control needs when its own field doesn't carry the whole answer:\n * a stroke's dash lengths are multiples of the stroke's width, so reading\n * the array as a style takes both.\n */\n siblings?: Record<string, unknown>;\n /** The value each selected node holds at this path, in selection order —\n * what `value` aggregates, and what a mixed selection still has. */\n each: readonly unknown[];\n /**\n * For a field of an object leaf, each node's own object (parallel to\n * `each`), which is still there when the nodes' objects differ and\n * `siblings` is not.\n */\n eachSiblings?: readonly (Record<string, unknown> | undefined)[];\n /** Commit a value — fans out to every selected node in one undo step. */\n setValue: (value: unknown) => void;\n /**\n * Commit a value derived from what each node holds at this path, in one undo\n * step. What `setValue` cannot do across a selection whose nodes differ: a\n * field of an object leaf has to land in each node's own object, not in one\n * object written over all of them. `siblings` is that node's object, for a\n * field of an object leaf.\n */\n update: (fn: (prev: unknown, siblings?: Record<string, unknown>) => unknown) => void;\n /**\n * The aggregated value at another node path — what `value` and `mixed` are\n * for this leaf's own path, for any path.\n *\n * A control whose subject spans more than one field needs it: a font picker\n * reporting which variant will actually paint has to read the node's weight\n * and style. Reading it off `value` is impossible — a leaf is handed one\n * field.\n */\n valueAt: (path: string) => { value: unknown; mixed: boolean };\n /**\n * The ids of the nodes the values were read from, joined. It changes exactly\n * when the selection does, so a control holding scratch that belongs to one\n * selection can key on it and be remounted rather than carry it to the next.\n * Absent where the values come from no selection, as in a tool options bar.\n */\n selectionKey?: string;\n}\n\n/**\n * Renders the control for one property across the whole selection.\n * Returning `null` collapses the leaf.\n */\nexport type PropertyRenderer = (ctx: PropertyRenderContext) => ReactNode;\n\n\n/**\n * One leaf with its context built but nothing rendered yet.\n *\n * Deferring the render is what lets a run of sibling flags become one bar:\n * whether a leaf joins its neighbors is a fact about the run, which no leaf\n * rendering itself can see.\n */\nexport interface LeafCell {\n key: string;\n leaf: ToolPrefLeaf;\n ctx: PropertyRenderContext;\n /** The accessible name this leaf's control carries — qualified by the row's\n * pair where the row holds more than one leaf. */\n ariaLabel: string;\n /** Renders the leaf on its own, chrome and all. */\n render: () => ReactNode;\n}\n\n/** A cell's content, once the run it belongs to has been decided. */\nexport interface RenderedCell {\n key: string;\n /** The leaf that names the cell — the run's first, for a flag bar. */\n leaf: ToolPrefLeaf;\n block: boolean;\n content: ReactNode;\n}\n\n/**\n * True for a leaf that can join a flag bar: a paired toggle boolean the\n * consumer has not claimed with a renderer of its own.\n */\nexport function isFlagCell(cell: LeafCell, renderers?: Record<string, PropertyRenderer>): boolean {\n const { leaf } = cell;\n return (\n leaf.kind === 'boolean' &&\n (leaf as ToolPrefBoolean).control === 'toggle' &&\n leaf.pair !== undefined &&\n renderers?.[cell.ctx.path] === undefined &&\n renderers?.[leaf.kind] === undefined\n );\n}\n\n/**\n * Renders a row's cells, collapsing each run of adjacent same-`pair` toggle\n * booleans into one segmented bar — the idiom the enum toggle a row away\n * already uses, rather than one detached pill per flag.\n */\nexport function renderCells(\n cells: readonly LeafCell[],\n renderers?: Record<string, PropertyRenderer>,\n): RenderedCell[] {\n const out: RenderedCell[] = [];\n for (let i = 0; i < cells.length; ) {\n const cell = cells[i];\n if (!isFlagCell(cell, renderers)) {\n const content = cell.render();\n if (content != null) {\n out.push({ key: cell.key, leaf: cell.leaf, block: cell.leaf.block === true, content });\n }\n i += 1;\n continue;\n }\n let j = i + 1;\n while (\n j < cells.length &&\n isFlagCell(cells[j], renderers) &&\n cells[j].leaf.pair === cell.leaf.pair\n ) {\n j += 1;\n }\n const run = cells.slice(i, j);\n out.push({\n key: cell.key,\n leaf: cell.leaf,\n block: run.every((c) => c.leaf.block === true),\n content: <FlagBar run={run} ariaLabel={cell.leaf.pair as string} />,\n });\n i = j;\n }\n return out;\n}\n\n/**\n * A run of paired boolean flags as one multi-select bar — U / S / O, the way\n * every text editor draws them.\n */\nfunction FlagBar({ run, ariaLabel }: { run: readonly LeafCell[]; ariaLabel: string }): ReactNode {\n // Each flag through the same field props a lone one gets, so an `encoding`\n // (Italic stored as `fontStyle`) reads and writes the same way in a bar.\n const flags = run.map((c) => {\n const field = prefFieldProps(c.leaf, {\n value: c.ctx.value,\n mixed: c.ctx.mixed,\n unset: c.ctx.unset,\n siblings: c.ctx.siblings,\n setValue: c.ctx.setValue,\n ...perNodeState(c.ctx),\n }) as PropertyBooleanFieldProps;\n return { cell: c, field };\n });\n const on = flags.filter((f) => !f.field.mixed && f.field.value === true).map((f) => f.cell.key);\n return (\n <ToggleBar<string>\n mode=\"multiple\"\n size=\"sm\"\n variant=\"flat\"\n className={s.flagToggle}\n ariaLabel={ariaLabel}\n items={flags.map(({ cell, field }) => ({\n value: cell.key,\n label: field.glyph ?? cell.leaf.name.slice(0, 1),\n ariaLabel: cell.ariaLabel,\n tooltip: drawnGlyph(field.glyph) === undefined ? undefined : cell.leaf.name,\n }))}\n value={on}\n // Each flag owns its own path, so only the segment that moved is\n // written — committing the run would write two fields nobody touched,\n // and inside an object leaf would fabricate values for the other two.\n mixedValues={flags.filter((f) => f.field.mixed).map((f) => f.cell.key)}\n onChange={(next) => {\n for (const { cell, field } of flags) {\n const now = next.includes(cell.key);\n if (now !== on.includes(cell.key)) field.onChange(now);\n }\n }}\n />\n );\n}\n\nexport function renderBuiltin(\n ctx: PropertyRenderContext,\n ariaLabel: string,\n renderers?: Record<string, PropertyRenderer>,\n /** Identifies the current selection, so a control holding per-selection\n * scratch (the paint kind memory) is remounted rather than carried over. */\n selectionKey = '',\n /** True for a field of an object leaf. Such a field writes itself into its\n * parent, so it can only hold values its parent's type permits — which is\n * what rules \"none\" out for a nested paint. */\n nested = false,\n): ReactNode {\n const { pref, value, mixed, unset, setValue } = ctx;\n if (pref.kind === 'object') {\n // One value with fields hanging off it. Each child writes the parent\n // whole, so a field is never set on a half-built object.\n return <ObjectLeaf ctx={ctx} renderers={renderers} selectionKey={selectionKey} />;\n }\n const field = prefFieldProps(pref, {\n value,\n mixed,\n unset,\n siblings: ctx.siblings,\n setValue,\n ...perNodeState(ctx),\n // The font pickers read the rest of the font from the leaves beside\n // them: the family's substitution probe runs at the weight and style\n // that will paint, and a weight lists what its family has. A mixed\n // selection has no single one; the probe falls back to 400/normal there.\n fontVariant: {\n weight: ctx.valueAt(siblingPath(ctx.path, 'fontWeight')).value,\n style: ctx.valueAt(siblingPath(ctx.path, 'fontStyle')).value,\n },\n fontFamily: ctx.valueAt(siblingPath(ctx.path, 'fontFamily')).value,\n });\n if (field === null) {\n return <span className={s.unrenderable}>({pref.kind}: no renderer)</span>;\n }\n switch (field.kind) {\n case 'boolean':\n // A panel's flag is a switch unless it asks otherwise.\n return (\n <PropertyControl\n {...field}\n name={ariaLabel}\n control={field.control ?? 'switch'}\n className={field.control === 'toggle' ? s.flagToggle : undefined}\n />\n );\n case 'number':\n return (\n <PropertyControl\n {...field}\n name={ariaLabel}\n className={field.control === 'slider' ? s.slider : s.number}\n // A typed number writes once it is entered, as text does; a slider\n // writes as it moves.\n onInput={field.control === 'slider' ? field.onInput : settledOnly}\n />\n );\n case 'string':\n // Settled values only: a live write per keystroke would be one undo\n // step per character.\n return <PropertyControl {...field} name={ariaLabel} onInput={settledOnly} />;\n case 'enum':\n return (\n <PropertyControl\n {...field}\n name={ariaLabel}\n // A clearable toggle is a set of exclusive flags, and sits beside\n // other flags sized the way they are.\n className={\n field.control === 'toggle'\n ? field.onClear ? s.flagToggle : s.toggle\n : field.control === 'radio' ? undefined : s.select\n }\n />\n );\n case 'font-family':\n case 'font-weight':\n return <PropertyControl {...field} name={ariaLabel} className={s.select} />;\n case 'paint':\n return (\n <PropertyControl\n {...field}\n name={ariaLabel}\n // Per-kind switch memory is scratch for one selection; carrying it\n // across would recall the previous node's gradient.\n key={selectionKey}\n control=\"inline\"\n // A nested paint writes one field of its parent, and no kit paint\n // field is optional — `Stroke.paint` is required. Removing the\n // whole parent is a different edit than repainting it, so the\n // control must not offer one as the other.\n allowNone={!nested}\n />\n );\n case 'color':\n // One write per gesture, not one per step of the picker.\n return <PropertyControl {...field} name={ariaLabel} onInput={settledOnly} />;\n }\n}\n\nconst settledOnly = (): void => {};\n\n/** The dotted path of the leaf `key` beside the one at `path`. */\nfunction siblingPath(path: string, key: string): string {\n const dot = path.lastIndexOf('.');\n return dot < 0 ? key : `${path.slice(0, dot + 1)}${key}`;\n}\n\n/** What an `encoding` needs to read and write each node against its own\n * object — nothing for a leaf that is not a field of one. */\nfunction perNodeState(ctx: PropertyRenderContext): Pick<PrefFieldState, 'perNode' | 'update'> {\n if (ctx.eachSiblings === undefined) return {};\n const siblings = ctx.eachSiblings;\n return {\n perNode: ctx.each.map((value, i) => ({ value, siblings: siblings[i] })),\n update: ctx.update,\n };\n}\n\n/**\n * Renders an object leaf: a titled block whose rows are the object's own\n * fields. A child's edit commits the parent object, never the child's path —\n * writing into a path whose value is not an object yet would corrupt it.\n */\n/** One labeled row inside an object leaf; `pair` merges adjacent fields into\n * it, exactly as the section rows merge theirs. */\ninterface ObjectRow {\n key: string;\n pair?: string;\n label: string;\n title?: string;\n /** Every field in the row brought its own chrome, so the row drops the\n * label column and spans the block. One unlabeled field in an otherwise\n * labeled pair would leave the row named after half of itself. */\n block: boolean;\n controls: ReactNode[];\n}\n\n/**\n * Renders an object leaf: the object's own fields, as rows. A child's edit\n * commits the parent object, never the child's path — writing into a path\n * whose value is not an object yet would corrupt it.\n */\nfunction ObjectLeaf({\n ctx,\n renderers,\n selectionKey = '',\n}: {\n ctx: PropertyRenderContext;\n renderers?: Record<string, PropertyRenderer>;\n selectionKey?: string;\n}): ReactNode {\n const pref = ctx.pref as ToolPrefObject;\n const held = typeof ctx.value === 'object' && ctx.value !== null\n ? (ctx.value as Record<string, unknown>)\n : undefined;\n const eachObject = ctx.each.map((v) =>\n typeof v === 'object' && v !== null ? (v as Record<string, unknown>) : undefined,\n );\n\n // A value whose fields are entirely grouped is titled by those groups — its\n // own heading would stack onto the first one and name nothing new.\n const allGrouped = Object.values(pref.children).every((child) => !('kind' in child));\n\n // `indent` is false when nothing visible sits above these rows: depth is\n // drawn only where a label marks it.\n const rowsOf = (\n children: Record<string, ToolPrefLeaf | ToolPrefGroup>,\n indent: boolean,\n ): ReactNode[] => {\n const out: (ReactNode | ObjectRow)[] = [];\n const isRow = (v: ReactNode | ObjectRow): v is ObjectRow =>\n typeof v === 'object' && v !== null && 'controls' in v;\n\n // Cells accumulate unrendered so a run of adjacent same-`pair` flags can\n // be seen as a run before any of them draws; a group heading between two\n // fields ends the run, exactly as it ends a paired row.\n let pending: LeafCell[] = [];\n const flush = (): void => {\n for (const { key, leaf, block, content } of renderCells(pending, renderers)) {\n const prev = out[out.length - 1];\n if (leaf.pair !== undefined && isRow(prev) && prev.pair === leaf.pair) {\n prev.controls.push(<Fragment key={key}>{content}</Fragment>);\n prev.block &&= block;\n continue;\n }\n out.push({\n key,\n pair: leaf.pair,\n label: leaf.pair ?? leaf.name,\n title: leaf.description,\n block,\n controls: [<Fragment key={key}>{content}</Fragment>],\n });\n }\n pending = [];\n };\n\n for (const [key, child] of Object.entries(children)) {\n // A group among the children organises the fields under a heading\n // without contributing to the path — the rule group keys follow at the\n // top level.\n if (!('kind' in child)) {\n const labeled = child.name !== '';\n const inner = rowsOf(child.children, labeled);\n if (inner.length === 0) continue;\n flush();\n out.push(\n <div key={`group:${key}`} className={labeled && indent ? s.objectGroup : undefined}>\n {labeled && <h5 className={s.sectionTitle}>{child.name}</h5>}\n {inner}\n </div>,\n );\n continue;\n }\n const childPath = `${ctx.path}.${key}`;\n // Nodes whose objects differ still agree or disagree field by field: two\n // styles at different sizes are both upright, and saying \"mixed\" for\n // every field of them hides that.\n const field = ctx.mixed ? ctx.valueAt(childPath) : { value: held?.[key], mixed: false };\n // Each node's own object, with this one field changed. Deriving it per\n // node is what keeps a multi-selection edit from writing one node's\n // object over all the others.\n const update = (fn: (prev: unknown, siblings?: Record<string, unknown>) => unknown): void =>\n ctx.update((prev) => {\n // The node holds no object yet, so writing one field has to\n // materialize the rest: the leaf's `default` is what a complete\n // value looks like. Starting from `{}` instead committed the one\n // field on its own — a `data.stroke` of `{ width: 2 }` with no\n // `paint`, which the type forbids and the painter threw on, taking\n // the whole frame and the visible document with it.\n const base: Record<string, unknown> =\n typeof prev === 'object' && prev !== null\n ? (prev as Record<string, unknown>)\n : (pref.fromScalar?.(prev)\n ?? (typeof pref.default === 'object' && pref.default !== null\n ? { ...(pref.default as Record<string, unknown>) }\n : {}));\n const v = fn(base[key], base);\n if (v === undefined) {\n // A field written as absent is absent — leaving the key holding\n // `undefined` says the object has a dash of nothing.\n const { [key]: _dropped, ...rest } = base;\n return rest;\n }\n return { ...base, [key]: v };\n });\n const childCtx: PropertyRenderContext = {\n path: childPath,\n pref: child,\n value: field.mixed ? undefined : field.value,\n mixed: field.mixed,\n // A field of an object the node does not hold is unset, and so is one\n // the object omits — `data.stroke` absent leaves every stroke field\n // with nothing behind it, not with the schema's defaults.\n unset: !field.mixed && field.value === undefined,\n siblings: held,\n each: eachObject.map((o) => o?.[key]),\n eachSiblings: eachObject,\n valueAt: ctx.valueAt,\n selectionKey: ctx.selectionKey,\n update,\n setValue: (v) => update(() => v),\n };\n pending.push({\n key: childPath,\n leaf: child,\n ctx: childCtx,\n ariaLabel: child.name,\n render: () => {\n const custom = renderers?.[childPath] ?? renderers?.[child.kind];\n const rendered = custom\n ? custom(childCtx)\n : renderBuiltin(childCtx, child.name, renderers, selectionKey, true);\n if (rendered == null) return null;\n // Neither a paired row nor a block one gives a field its own label\n // column, so the glyph is all that names it on screen. The control\n // already carries `name` as its accessible name, which leaves the\n // glyph decorative.\n const unlabeled = child.pair !== undefined || child.block === true;\n const glyph = unlabeled && child.icon && child.icon in ICON_PATHS;\n if (!glyph) return rendered;\n return (\n <span className={s.namedField}>\n <Icon name={child.icon as IconName} size={14} />\n {rendered}\n </span>\n );\n },\n });\n }\n flush();\n return out.map((entry) =>\n typeof entry === 'object' && entry !== null && 'controls' in entry ? (\n entry.block ? (\n <div key={entry.key} className={`${s.rowControls} ${s.blockRow}`} title={entry.title}>\n {entry.controls}\n </div>\n ) : (\n <div key={entry.key} className={s.row}>\n <span className={s.rowLabel} title={entry.title}>{entry.label}</span>\n <span className={s.rowControls}>{entry.controls}</span>\n </div>\n )\n ) : (\n entry\n ),\n );\n };\n\n const rows = rowsOf(pref.children, !allGrouped);\n if (rows.length === 0) return null;\n return (\n <div className={s.objectLeaf}>\n {!allGrouped && <h4 className={s.sectionTitle}>{pref.name}</h4>}\n {rows}\n </div>\n );\n}\n","// Pure selection→panel derivations for SelectionPanel. Kept free of\n// React so intersection/aggregation semantics are unit-testable.\n//\n// Path convention (see core `NodePropertiesEntry`): a leaf's OWN KEY in\n// the schema is its node path — a dotted path of any depth rooted at\n// `pose` or `data` (`pose.x`, `data.fill`, `data.style.fontSize`). Group\n// keys are organizational only.\n\nimport {\n MIXED,\n type Mixed,\n type NodePropertiesEntry,\n type NodeRoutingEntry,\n type SceneNode,\n type ToolPrefGroup,\n type ToolPrefLeaf,\n} from '@weasel-js/core';\n\n// Re-exported under its existing public name here: the kit-wide \"these\n// values disagree\" sentinel (`@weasel-js/core`'s `MIXED`) also covers\n// multi-node aggregation, so this panel doesn't get its own symbol.\nexport { MIXED };\nexport type { Mixed };\n\nexport type AnyNode = SceneNode<unknown, string, unknown>;\n\n/**\n * One editable property in a {@link SelectionPanel}, paired with the dotted\n * node path it reads and writes.\n */\nexport interface PanelLeaf {\n /** Dotted node path — the leaf's key in the schema. */\n path: string;\n leaf: ToolPrefLeaf;\n}\n\n/**\n * One labeled row of a panel section. Holds several leaves when the schema\n * paired them.\n */\nexport interface PanelRow {\n label: string;\n leaves: PanelLeaf[];\n}\n\n/**\n * A titled block of rows, derived from one top-level group of a properties\n * schema. `key` is that group's schema key.\n */\nexport interface PanelSection {\n key: string;\n name: string;\n rows: PanelRow[];\n}\n\n/** Derive a node's kind: containers are `'group'`; leaves classify their\n * `data` through the routing entries (first match wins, `'unknown'`\n * otherwise) — same semantics as core's `NodeRouting.classify`. */\nexport function classifyKind(\n node: AnyNode,\n routing: readonly NodeRoutingEntry[],\n): string {\n if (node.kind === 'container') return 'group';\n for (const entry of routing) {\n if (entry.matches(node.data)) return entry.name;\n }\n return 'unknown';\n}\n\nexport function isGroup(n: ToolPrefLeaf | ToolPrefGroup): n is ToolPrefGroup {\n return !('kind' in n);\n}\n\n/** Flatten a schema to sections of leaves. Nested groups fold into their\n * top-level section; top-level leaves get an untitled leading section. */\nfunction flatten(schema: ToolPrefGroup): PanelSection[] {\n const sections: PanelSection[] = [];\n const untitled: PanelLeaf[] = [];\n\n const collect = (group: ToolPrefGroup, into: PanelLeaf[]): void => {\n for (const [key, child] of Object.entries(group.children)) {\n if (isGroup(child)) collect(child, into);\n else into.push({ path: key, leaf: child });\n }\n };\n\n for (const [key, child] of Object.entries(schema.children)) {\n if (isGroup(child)) {\n const leaves: PanelLeaf[] = [];\n collect(child, leaves);\n sections.push({ key, name: child.name, rows: pairRows(leaves) });\n } else {\n untitled.push({ path: key, leaf: child });\n }\n }\n if (untitled.length > 0) {\n sections.unshift({ key: '', name: '', rows: pairRows(untitled) });\n }\n return sections;\n}\n\n/** Merge consecutive leaves sharing a `pair` id into one labeled row. */\nexport function pairRows(leaves: readonly PanelLeaf[]): PanelRow[] {\n const rows: PanelRow[] = [];\n for (const item of leaves) {\n const pair = item.leaf.pair;\n const prev = rows[rows.length - 1];\n if (pair !== undefined && prev !== undefined && prev.label === pair) {\n prev.leaves.push(item);\n } else {\n rows.push({ label: pair ?? item.leaf.name, leaves: [item] });\n }\n }\n return rows;\n}\n\n/**\n * The schema the panel shows for a set of kinds: one kind → its full\n * schema; several → the intersection by (path, leaf kind), shaped by the\n * first kind's section/row layout. Kinds without a registered schema\n * contribute nothing, so their presence collapses the intersection.\n */\nexport function effectiveSections(\n kinds: readonly string[],\n entries: readonly NodePropertiesEntry[],\n): PanelSection[] {\n const uniq = [...new Set(kinds)];\n if (uniq.length === 0) return [];\n const byName = new Map(entries.map((e) => [e.name, e]));\n const schemas = uniq.map((k) => byName.get(k)?.schema);\n if (schemas.some((s) => s === undefined)) return [];\n const [first, ...rest] = schemas as ToolPrefGroup[];\n\n const flatFirst = flatten(first);\n if (rest.length === 0) return flatFirst;\n\n // '\\0' delimiter: path and kind strings are unconstrained, so a\n // printable separator could collide with real content.\n const leafKey = (l: PanelLeaf): string => `${l.path}\\0${l.leaf.kind}`;\n const restKeys = rest.map(\n (schema) =>\n new Set(\n flatten(schema)\n .flatMap((s) => s.rows)\n .flatMap((r) => r.leaves)\n .map(leafKey),\n ),\n );\n const keep = (l: PanelLeaf): boolean =>\n restKeys.every((set) => set.has(leafKey(l)));\n\n return flatFirst\n .map((section) => ({\n ...section,\n rows: section.rows\n .map((row) => ({ ...row, leaves: row.leaves.filter(keep) }))\n .filter((row) => row.leaves.length > 0),\n }))\n .filter((section) => section.rows.length > 0);\n}\n\n/** Read a node value at a dotted path of any depth (`pose.x`,\n * `data.style.fontSize`, `data.style.fill.color`). Returns `undefined` if\n * the path is dotless (mirrors `commit`'s no-op on a malformed schema\n * key) or if any intermediate segment is missing or not an object. */\nexport function nodeValueAt(node: AnyNode, path: string): unknown {\n const segments = path.split('.');\n if (segments.length < 2) return undefined;\n const head = segments[0];\n let cursor: unknown = head === 'pose' ? node.pose : head === 'data' ? node.data : undefined;\n for (let i = 1; i < segments.length; i++) {\n if (cursor == null || typeof cursor !== 'object') return undefined;\n cursor = (cursor as Record<string, unknown>)[segments[i]];\n }\n return cursor;\n}\n\n/** Immutably set `value` at a dotted path within `root`, cloning each level\n * on the way down so React sees new object identities. Arrays stay arrays\n * (an array intermediate is shallow-copied, not flattened into `{0: ...}`)\n * — this is the write-side twin of `nodeValueAt`, so a schema author who\n * gets a working read gets a working write. */\nexport function setAtPath(root: object, segments: readonly string[], value: unknown): object {\n const [head, ...rest] = segments;\n if (rest.length === 0) {\n return Array.isArray(root)\n ? Object.assign([...root], { [head]: value })\n : { ...root, [head]: value };\n }\n const child = (root as Record<string, unknown>)[head];\n const childObj = Array.isArray(child)\n ? [...child]\n : child != null && typeof child === 'object'\n ? { ...child }\n : {};\n const nested = setAtPath(childObj, rest, value);\n return Array.isArray(root)\n ? Object.assign([...root], { [head]: nested })\n : { ...root, [head]: nested };\n}\n\n/** Aggregate a path across nodes: the shared value, or `MIXED`. */\nexport function aggregateValue(\n nodes: readonly AnyNode[],\n path: string,\n): unknown | Mixed {\n let value: unknown;\n let first = true;\n for (const node of nodes) {\n const v = nodeValueAt(node, path);\n if (first) {\n value = v;\n first = false;\n } else if (!Object.is(v, value)) {\n return MIXED;\n }\n }\n return value;\n}\n\n/** `'rect ×2 · text'` — kinds in first-seen order with counts. */\nexport function kindBreakdown(kinds: readonly string[]): string {\n const counts = new Map<string, number>();\n for (const k of kinds) counts.set(k, (counts.get(k) ?? 0) + 1);\n return [...counts.entries()]\n .map(([k, n]) => (n > 1 ? `${k} ×${n}` : k))\n .join(' · ');\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACgIA,SAAgBS,EAAW,GAAgB,GAAuD;CAChG,IAAM,EAAE,YAASC;CACjB,OACEC,EAAK,SAAS,aACbA,EAAyB,YAAY,YACtCA,EAAK,SAAS,KAAA,KACdC,IAAYF,EAAK,IAAI,UAAU,KAAA,KAC/BE,IAAYD,EAAK,UAAU,KAAA;AAE/B;AAOA,SAAgBE,EACd,GACA,GACgB;CAChB,IAAMC,IAAsB,CAAC;CAC7B,KAAK,IAAIC,IAAI,GAAGA,IAAIC,EAAM,SAAU;EAClC,IAAMN,IAAOM,EAAMD;EACnB,IAAI,CAACN,EAAWC,GAAME,CAAS,GAAG;GAChC,IAAMK,IAAUP,EAAK,OAAO;GAI5B,AAHIO,KAAW,QACbH,EAAI,KAAK;IAAE,KAAKJ,EAAK;IAAK,MAAMA,EAAK;IAAM,OAAOA,EAAK,KAAK,UAAU;IAAM;GAAQ,CAAC,GAEvF,KAAK;GACL;EACF;EACA,IAAIQ,IAAIH,IAAI;EACZ,OACEG,IAAIF,EAAM,UACVP,EAAWO,EAAME,IAAIN,CAAS,KAC9BI,EAAME,EAAE,CAAC,KAAK,SAASR,EAAK,KAAK,OAEjC,KAAK;EAEP,IAAMS,IAAMH,EAAM,MAAMD,GAAGG,CAAC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D;GAAOH,IAAOI;CAAM;CAE/B,IAAMhE,IAAS+D,EAAiCH,IAM1CrE,IAASuE,EALE,MAAM,QAAQ9D,CAAK,IAChC,CAAC,GAAGA,CAAK,IACQ,OAAOA,KAAU,YAAlCA,IACE,EAAE,GAAGA,EAAM,IACX,CAAC,GAC4BgB,GAAMgD,CAAK;CAC9C,OAAO,MAAM,QAAQD,CAAI,IACrB,OAAO,OAAO,CAAC,GAAGA,CAAI,GAAG,GAAGH,IAAOrE,EAAO,CAAC,IAC3C;EAAE,GAAGwE;GAAOH,IAAOrE;CAAO;AAChC;AAGA,SAAgB0E,EACd,GACA,GACiB;CACjB,IAAID,GACAhB,IAAQ;CACZ,KAAK,IAAMvB,KAAQyC,GAAO;EACxB,IAAMpE,IAAI4D,EAAYjC,GAAMhC,CAAI;EAChC,IAAIuD,GAEF,AADA,IAAQlD,GACR,IAAQ;OACH,IAAI,CAAC,OAAO,GAAGA,GAAGkE,CAAK,GAC5B,OAAOG;CAEX;CACA,OAAOH;AACT;AAGA,SAAgBI,EAAc,GAAkC;CAC9D,IAAMC,oBAAS,IAAI,IAAoB;CACvC,KAAK,IAAMvB,KAAKJ,GAAO,EAAO,IAAII,IAAIuB,EAAO,IAAIvB,CAAC,KAAK,KAAK,CAAC;CAC7D,OAAO,CAAC,GAAGuB,EAAO,QAAQ,CAAC,CAAC,CACzB,KAAK,CAACvB,GAAGlB,OAAQA,IAAI,IAAI,GAAGkB,EAAE,IAAIlB,MAAMkB,CAAE,CAAC,CAC3C,KAAK,KAAK;AACf"}
@@ -12,17 +12,21 @@ function s({ container: t, children: n }) {
12
12
  children: n
13
13
  });
14
14
  }
15
- function c(t) {
16
- let [i, s] = r(null), c = n(o), l = t === void 0 ? c === void 0 ? a(i) : c : t;
15
+ function c(e) {
16
+ let t = n(o);
17
+ return e === void 0 ? t : e;
18
+ }
19
+ function l(t) {
20
+ let [n, i] = r(null), o = c(t), s = o === void 0 ? a(n) : o;
17
21
  return {
18
22
  anchor: /* @__PURE__ */ e("span", {
19
23
  hidden: !0,
20
- ref: s
24
+ ref: i
21
25
  }),
22
- portalProps: { UNSTABLE_portalContainer: l ?? void 0 }
26
+ portalProps: { UNSTABLE_portalContainer: s ?? void 0 }
23
27
  };
24
28
  }
25
29
  //#endregion
26
- export { a as n, c as r, s as t };
30
+ export { l as i, a as n, c as r, s as t };
27
31
 
28
- //# sourceMappingURL=portalHost-yTOVuCej.js.map
32
+ //# sourceMappingURL=portalHost-CE70wLzo.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"portalHost-CE70wLzo.js","names":["HOST_SELECTOR","nearestPortalHost","from","OverlayPortalContext","createContext","OverlayPortalProvider","container","useAssignedPortalContainer","fromProvider","useContext","explicit","useOverlayPortal","anchorEl","setAnchorEl","useState","assigned","resolved"],"sources":["../../src/overlays/portalHost.tsx"],"sourcesContent":["import { createContext, useContext, useState, type ReactElement, type ReactNode } from 'react';\n\n/**\n * Elements an overlay may portal into: anything a theme has been stamped on\n * (`applyTheme` / `<ThemeProvider>` write both attributes), plus anything\n * opting in with `data-wzl-portal-host`. The opt-in exists for a styling root\n * that sits *below* the themed element — labkit's `.lk-root` carries element\n * defaults the themed wrapper does not.\n */\nconst HOST_SELECTOR = '[data-wzl-portal-host],[data-wzl-theme],[data-wzl-mode]';\n\n/**\n * The nearest element `from` sits inside that can host a portalled overlay,\n * or `null` when there is none and the body is the only answer.\n */\nexport function nearestPortalHost(from: Element | null | undefined): HTMLElement | null {\n return (from?.closest(HOST_SELECTOR) as HTMLElement | null) ?? null;\n}\n\n/** `undefined` distinguishes \"no provider\" from a provider saying `null`. */\nconst OverlayPortalContext = createContext<Element | null | undefined>(undefined);\n\n/** Props for {@link OverlayPortalProvider}. */\nexport interface OverlayPortalProviderProps {\n /** Where overlays in this subtree portal. `null` means `document.body`. */\n container: Element | null;\n children: ReactNode;\n}\n\n/**\n * Sets the portal container for every weasel overlay rendered below it,\n * overriding the nearest-themed-ancestor default. An individual overlay's\n * own `portalContainer` prop still wins.\n */\nexport function OverlayPortalProvider({ container, children }: OverlayPortalProviderProps) {\n return (\n <OverlayPortalContext.Provider value={container}>{children}</OverlayPortalContext.Provider>\n );\n}\n\n/**\n * The container an overlay has been *told* to use: its own `portalContainer`\n * prop, else the nearest {@link OverlayPortalProvider}. `undefined` when\n * neither said, which leaves the choice to the overlay.\n */\nexport function useAssignedPortalContainer(explicit?: Element | null): Element | null | undefined {\n const fromProvider = useContext(OverlayPortalContext);\n return explicit !== undefined ? explicit : fromProvider;\n}\n\n/** The `portalContainer` prop every weasel overlay accepts. */\nexport interface OverlayPortalProps {\n /**\n * Where the overlay's portal mounts. Defaults to the nearest ancestor of\n * the overlay's own position that carries a weasel theme, so the overlay\n * resolves the same `--wzl-*` tokens as the control it belongs to. Pass\n * `null` for `document.body`.\n */\n portalContainer?: Element | null;\n}\n\n/** React Aria props minus the portal key a weasel overlay owns. */\nexport type WithoutPortalTarget<T> = Omit<T, 'UNSTABLE_portalContainer'>;\n\n/** Spread onto the React Aria overlay. The unstable key is spelled here and\n * nowhere else in the package, so an upstream rename lands in one file. */\nexport interface OverlayPortalTarget {\n UNSTABLE_portalContainer: Element | undefined;\n}\n\n/**\n * Resolves where an overlay should portal, and the anchor that answers it.\n *\n * The result goes to React Aria as `UNSTABLE_portalContainer`. Its documented\n * replacement, `UNSAFE_PortalProvider`, is not re-exported by\n * react-aria-components 1.18, and reaching past it to `react-aria` for the\n * provider risks a second copy of that package whose context the overlays\n * never read — a failure that shows up as an unthemed overlay, not an error.\n *\n * Render `anchor` at the component's own position in the tree — outside the\n * portal — and spread `portalProps` onto the React Aria overlay. The anchor\n * is what \"nearest themed ancestor\" is measured from; the first render has\n * none yet, so an overlay that mounts already open lands in its host on the\n * following render, before paint.\n */\nexport function useOverlayPortal(explicit?: Element | null): {\n anchor: ReactElement;\n portalProps: OverlayPortalTarget;\n} {\n const [anchorEl, setAnchorEl] = useState<HTMLElement | null>(null);\n const assigned = useAssignedPortalContainer(explicit);\n const resolved = assigned !== undefined ? assigned : nearestPortalHost(anchorEl);\n\n return {\n anchor: <span hidden ref={setAnchorEl} />,\n portalProps: { UNSTABLE_portalContainer: resolved ?? undefined },\n };\n}\n"],"mappings":";;;AASA,IAAMA,IAAgB;AAMtB,SAAgBC,EAAkB,GAAsD;CACtF,OAAQC,GAAM,QAAQF,CAAa,KAA4B;AACjE;AAGA,IAAMG,IAAuBC,EAA0C,KAAA,CAAS;AAchF,SAAgBC,EAAsB,EAAE,cAAW,eAAwC;CACzF,OACE,kBAACF,EAAqB,UAAtB;EAA+B,OAAOG;EAAY;CAAwC,CAAA;AAE9F;AAOA,SAAgBC,EAA2B,GAAuD;CAChG,IAAMC,IAAeC,EAAWN,CAAoB;CACpD,OAAOO,MAAa,KAAA,IAAuBF,IAAXE;AAClC;AAqCA,SAAgBC,EAAiB,GAG/B;CACA,IAAM,CAACC,GAAUC,KAAeC,EAA6B,IAAI,GAC3DC,IAAWR,EAA2BG,CAAQ,GAC9CM,IAAWD,MAAa,KAAA,IAAuBd,EAAkBW,CAAQ,IAArCG;CAE1C,OAAO;EACL,QAAQ,kBAAC,QAAD;GAAM,QAAA;GAAO,KAAKF;EAAc,CAAA;EACxC,aAAa,EAAE,0BAA0BG,KAAY,KAAA,EAAU;CACjE;AACF"}