@weasel-js/ui 1.7.3 → 1.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (306) hide show
  1. package/dist/chunks/{ActionBar-xA73vzzF.js → ActionBar-CfXS7-9f.js} +2 -2
  2. package/dist/chunks/{ActionBar-xA73vzzF.js.map → ActionBar-CfXS7-9f.js.map} +1 -1
  3. package/dist/chunks/{Badge-jYQjrTKc.js → Badge-4ShpqA0h.js} +2 -2
  4. package/dist/chunks/{Badge-jYQjrTKc.js.map → Badge-4ShpqA0h.js.map} +1 -1
  5. package/dist/chunks/{Badge-CTc9Lkwn.js → Badge-qkV9EqKs.js} +6 -2
  6. package/dist/chunks/Badge-qkV9EqKs.js.map +1 -0
  7. package/dist/chunks/{Button-XB-T75YL.js → Button-CQA-K1g9.js} +17 -17
  8. package/dist/chunks/Button-CQA-K1g9.js.map +1 -0
  9. package/dist/chunks/Button-KF-qSGtA.js +11 -0
  10. package/dist/chunks/Button-KF-qSGtA.js.map +1 -0
  11. package/dist/chunks/{ButtonBar-CIMKPPRS.js → ButtonBar-B-cYuoem.js} +10 -4
  12. package/dist/chunks/ButtonBar-B-cYuoem.js.map +1 -0
  13. package/dist/chunks/{Callout-BUn0dP_S.js → Callout-VyYDIP7w.js} +26 -26
  14. package/dist/chunks/Callout-VyYDIP7w.js.map +1 -0
  15. package/dist/chunks/{Checkbox-DFn-x0JO.js → Checkbox-d4IfhiXh.js} +2 -2
  16. package/dist/chunks/{Checkbox-DFn-x0JO.js.map → Checkbox-d4IfhiXh.js.map} +1 -1
  17. package/dist/chunks/{CloseButton-BmNmRVtb.js → CloseButton-CKarkTT9.js} +3 -3
  18. package/dist/chunks/{CloseButton-BmNmRVtb.js.map → CloseButton-CKarkTT9.js.map} +1 -1
  19. package/dist/chunks/{Code-AsKpgnv6.js → Code-ChwKP1V0.js} +8 -2
  20. package/dist/chunks/Code-ChwKP1V0.js.map +1 -0
  21. package/dist/chunks/{ColorModeControl-DaVJ-SyX.js → ColorModeControl-CH9PmDlT.js} +6 -6
  22. package/dist/chunks/{ColorModeControl-DaVJ-SyX.js.map → ColorModeControl-CH9PmDlT.js.map} +1 -1
  23. package/dist/chunks/{ComboBox-DKln_mOd.js → ComboBox-BMj_IKBj.js} +4 -4
  24. package/dist/chunks/ComboBox-BMj_IKBj.js.map +1 -0
  25. package/dist/chunks/{DataGrid-CmHJe57v.js → DataGrid-CjiVKoaA.js} +3 -3
  26. package/dist/chunks/{DataGrid-CmHJe57v.js.map → DataGrid-CjiVKoaA.js.map} +1 -1
  27. package/dist/chunks/{DetentSlider-DNTAk8xP.js → DetentSlider-D40V8Oma.js} +2 -2
  28. package/dist/chunks/{DetentSlider-DNTAk8xP.js.map → DetentSlider-D40V8Oma.js.map} +1 -1
  29. package/dist/chunks/{Dialog-DKfsk5VN.js → Dialog-Du4POZ52.js} +12 -12
  30. package/dist/chunks/Dialog-Du4POZ52.js.map +1 -0
  31. package/dist/chunks/{Disclosure-Ch2KxYuB.js → Disclosure-CpWt87nO.js} +7 -7
  32. package/dist/chunks/{Disclosure-Ch2KxYuB.js.map → Disclosure-CpWt87nO.js.map} +1 -1
  33. package/dist/chunks/{DragGhost-BeYDJyLZ.js → DragGhost-_IpuN_xM.js} +2 -2
  34. package/dist/chunks/{DragGhost-BeYDJyLZ.js.map → DragGhost-_IpuN_xM.js.map} +1 -1
  35. package/dist/chunks/{FallthroughDiagram-CS1IhQaU.js → FallthroughDiagram-Cn6QLWKA.js} +9 -9
  36. package/dist/chunks/{FallthroughDiagram-CS1IhQaU.js.map → FallthroughDiagram-Cn6QLWKA.js.map} +1 -1
  37. package/dist/chunks/{FillStrokeSwatch-C4h3rUFM.js → FillStrokeSwatch-BkUhlpQL.js} +2 -2
  38. package/dist/chunks/{FillStrokeSwatch-C4h3rUFM.js.map → FillStrokeSwatch-BkUhlpQL.js.map} +1 -1
  39. package/dist/chunks/FitLabel-BzZGkWfL.js +76 -0
  40. package/dist/chunks/FitLabel-BzZGkWfL.js.map +1 -0
  41. package/dist/chunks/{FontFamilySelect-DEvMXyZd.js → FontFamilySelect-CXN7O2-p.js} +2 -2
  42. package/dist/chunks/{FontFamilySelect-DEvMXyZd.js.map → FontFamilySelect-CXN7O2-p.js.map} +1 -1
  43. package/dist/chunks/{FontWeightSelect-BLQ_LMJF.js → FontWeightSelect-BBuJGe_2.js} +2 -2
  44. package/dist/chunks/{FontWeightSelect-BLQ_LMJF.js.map → FontWeightSelect-BBuJGe_2.js.map} +1 -1
  45. package/dist/chunks/{GestureRoute-BXESrHI0.js → GestureRoute-BqHUrGeQ.js} +13 -13
  46. package/dist/chunks/{GestureRoute-BXESrHI0.js.map → GestureRoute-BqHUrGeQ.js.map} +1 -1
  47. package/dist/chunks/{GradientEditor-DD2OjQtn.js → GradientEditor-DX4sb1Hf.js} +4 -4
  48. package/dist/chunks/{GradientEditor-DD2OjQtn.js.map → GradientEditor-DX4sb1Hf.js.map} +1 -1
  49. package/dist/chunks/{Icon--B1ME-6c.js → Icon-BfqYtAX5.js} +33 -1
  50. package/dist/chunks/Icon-BfqYtAX5.js.map +1 -0
  51. package/dist/chunks/{ItemList-CRu9y7hL.js → ItemList-nbakLf3N.js} +32 -32
  52. package/dist/chunks/ItemList-nbakLf3N.js.map +1 -0
  53. package/dist/chunks/{Jog-BrkzdGV2.js → Jog-BU0xuM3G.js} +7 -7
  54. package/dist/chunks/{Jog-BrkzdGV2.js.map → Jog-BU0xuM3G.js.map} +1 -1
  55. package/dist/chunks/{Keycaps-C-FJyG8k.js → Keycaps-CM-gOj0e.js} +8 -2
  56. package/dist/chunks/Keycaps-CM-gOj0e.js.map +1 -0
  57. package/dist/chunks/LayerList-vfAoImxX.js +432 -0
  58. package/dist/chunks/LayerList-vfAoImxX.js.map +1 -0
  59. package/dist/chunks/{ListEditor-OQDzG4A5.js → ListEditor-BAKs47bN.js} +3 -3
  60. package/dist/chunks/{ListEditor-OQDzG4A5.js.map → ListEditor-BAKs47bN.js.map} +1 -1
  61. package/dist/chunks/{MenuButton-TAFg88Lp.js → MenuButton-CJGdhwGr.js} +5 -5
  62. package/dist/chunks/MenuButton-CJGdhwGr.js.map +1 -0
  63. package/dist/chunks/{MeshEditor-DWpvg8H6.js → MeshEditor-rhf7cXfG.js} +2 -2
  64. package/dist/chunks/{MeshEditor-DWpvg8H6.js.map → MeshEditor-rhf7cXfG.js.map} +1 -1
  65. package/dist/chunks/{NumberField-DS0WSiin.js → NumberField-BXFrOi5M.js} +8 -5
  66. package/dist/chunks/{NumberField-DS0WSiin.js.map → NumberField-BXFrOi5M.js.map} +1 -1
  67. package/dist/chunks/{OptionsBar-DeTAjVb7.js → OptionsBar-DyTXbev-.js} +9 -3
  68. package/dist/chunks/OptionsBar-DyTXbev-.js.map +1 -0
  69. package/dist/chunks/{PaintField-BdmQM53v.js → PaintField--GbF8sL7.js} +7 -7
  70. package/dist/chunks/PaintField--GbF8sL7.js.map +1 -0
  71. package/dist/chunks/{PaintInput-DaQMeBsI.js → PaintInput-DSS5IjXn.js} +5 -5
  72. package/dist/chunks/{PaintInput-DaQMeBsI.js.map → PaintInput-DSS5IjXn.js.map} +1 -1
  73. package/dist/chunks/{PatternPicker-B3HcMZWg.js → PatternPicker-82DCUvUk.js} +9 -9
  74. package/dist/chunks/PatternPicker-82DCUvUk.js.map +1 -0
  75. package/dist/chunks/{Powerline-6wIFmDik.js → Powerline-CogJv9VU.js} +2 -2
  76. package/dist/chunks/{Powerline-6wIFmDik.js.map → Powerline-CogJv9VU.js.map} +1 -1
  77. package/dist/chunks/{Prefs-BnVEyfWO.js → Prefs-BSSKOvPa.js} +41 -41
  78. package/dist/chunks/Prefs-BSSKOvPa.js.map +1 -0
  79. package/dist/chunks/{Properties-BoG2MMHR.js → Properties-DteSVEWs.js} +5 -5
  80. package/dist/chunks/{Properties-BoG2MMHR.js.map → Properties-DteSVEWs.js.map} +1 -1
  81. package/dist/chunks/PropertyField-CLbUOynA.js +751 -0
  82. package/dist/chunks/PropertyField-CLbUOynA.js.map +1 -0
  83. package/dist/chunks/{Select-ouV8O6cp.js → Select-BhHwjNsb.js} +13 -13
  84. package/dist/chunks/Select-BhHwjNsb.js.map +1 -0
  85. package/dist/chunks/{SelectionPanel-COZ6z9_P.js → SelectionPanel-B6HinSdB.js} +2 -2
  86. package/dist/chunks/{SelectionPanel-COZ6z9_P.js.map → SelectionPanel-B6HinSdB.js.map} +1 -1
  87. package/dist/chunks/{SidebarPanel-AXQ0jRDx.js → SidebarPanel-P3a8tIIj.js} +3 -3
  88. package/dist/chunks/{SidebarPanel-AXQ0jRDx.js.map → SidebarPanel-P3a8tIIj.js.map} +1 -1
  89. package/dist/chunks/Slider-CHBQ8uUC.js +439 -0
  90. package/dist/chunks/Slider-CHBQ8uUC.js.map +1 -0
  91. package/dist/chunks/{StatusBar-BEOfOX0D.js → StatusBar-DEh7J2Gj.js} +14 -9
  92. package/dist/chunks/StatusBar-DEh7J2Gj.js.map +1 -0
  93. package/dist/chunks/{SwatchGrid-9ZPiDmxd.js → SwatchGrid-DxK9e_IV.js} +3 -3
  94. package/dist/chunks/SwatchGrid-DxK9e_IV.js.map +1 -0
  95. package/dist/chunks/{SwatchStrip-Bi9iPLoh.js → SwatchStrip-D7YNn_p0.js} +3 -3
  96. package/dist/chunks/{SwatchStrip-Bi9iPLoh.js.map → SwatchStrip-D7YNn_p0.js.map} +1 -1
  97. package/dist/chunks/{ThemeSwitcher-DiBmMh_B.js → ThemeSwitcher-BJWP1l87.js} +6 -6
  98. package/dist/chunks/{ThemeSwitcher-DiBmMh_B.js.map → ThemeSwitcher-BJWP1l87.js.map} +1 -1
  99. package/dist/chunks/{Timeline-sMCH2fah.js → Timeline-CisRg82u.js} +4 -4
  100. package/dist/chunks/{Timeline-sMCH2fah.js.map → Timeline-CisRg82u.js.map} +1 -1
  101. package/dist/chunks/{Toast-C3ozq11V.js → Toast-DhkU9Z0b.js} +3 -3
  102. package/dist/chunks/{Toast-C3ozq11V.js.map → Toast-DhkU9Z0b.js.map} +1 -1
  103. package/dist/chunks/ToggleBar-CRc2k89_.js +10 -0
  104. package/dist/chunks/ToggleBar-CRc2k89_.js.map +1 -0
  105. package/dist/chunks/ToggleBar-CfYbMK3x.js +84 -0
  106. package/dist/chunks/ToggleBar-CfYbMK3x.js.map +1 -0
  107. package/dist/chunks/{TokenPanel-WtKGY2Db.js → TokenPanel-cL37E39j.js} +26 -26
  108. package/dist/chunks/{TokenPanel-WtKGY2Db.js.map → TokenPanel-cL37E39j.js.map} +1 -1
  109. package/dist/chunks/{ToolButton-BURp4YIO.js → ToolButton-Bo7WH1wt.js} +2 -2
  110. package/dist/chunks/{ToolButton-BURp4YIO.js.map → ToolButton-Bo7WH1wt.js.map} +1 -1
  111. package/dist/chunks/ToolOptionsBar-DmhzrOmd.js +94 -0
  112. package/dist/chunks/ToolOptionsBar-DmhzrOmd.js.map +1 -0
  113. package/dist/chunks/{ToolPalette-DKDFWOX-.js → ToolPalette-BTD84k9C.js} +2 -2
  114. package/dist/chunks/{ToolPalette-DKDFWOX-.js.map → ToolPalette-BTD84k9C.js.map} +1 -1
  115. package/dist/chunks/{Tooltip-C6eFCYxw.js → Tooltip-DljsPEQG.js} +4 -4
  116. package/dist/chunks/Tooltip-DljsPEQG.js.map +1 -0
  117. package/dist/chunks/Tree-B_PW6K-W.js +215 -0
  118. package/dist/chunks/Tree-B_PW6K-W.js.map +1 -0
  119. package/dist/chunks/checkbox.module-Dcx8ILgR.js +5 -0
  120. package/dist/chunks/checkbox.module-Dcx8ILgR.js.map +1 -0
  121. package/dist/chunks/{icons-Dr2-r30x.js → icons-B_fPKEis.js} +52 -43
  122. package/dist/chunks/icons-B_fPKEis.js.map +1 -0
  123. package/dist/chunks/{model-B6zuQg6b.js → model-Ca0f95r0.js} +134 -133
  124. package/dist/chunks/model-Ca0f95r0.js.map +1 -0
  125. package/dist/chunks/{portalHost-CE70wLzo.js → portalHost-RUQPxIoW.js} +3 -2
  126. package/dist/chunks/{portalHost-CE70wLzo.js.map → portalHost-RUQPxIoW.js.map} +1 -1
  127. package/dist/chunks/{prefField-BE_Ytr2H.js → prefField-DPPbAmRR.js} +81 -75
  128. package/dist/chunks/prefField-DPPbAmRR.js.map +1 -0
  129. package/dist/chunks/{segmentTooltip-CGxCOWNz.js → segmentTooltip-8VBPNgEc.js} +2 -2
  130. package/dist/chunks/{segmentTooltip-CGxCOWNz.js.map → segmentTooltip-8VBPNgEc.js.map} +1 -1
  131. package/dist/chunks/segmentedControl.module-62qjNWJk.js +11 -0
  132. package/dist/chunks/{segmentedControl.module-BzGXUL5G.js.map → segmentedControl.module-62qjNWJk.js.map} +1 -1
  133. package/dist/chunks/{useReorderDragList-CStYKjHl.js → useReorderDragList-DnqqvRGK.js} +38 -30
  134. package/dist/chunks/useReorderDragList-DnqqvRGK.js.map +1 -0
  135. package/dist/components/ActionBar/index.js +1 -1
  136. package/dist/components/Badge/index.d.ts +1 -0
  137. package/dist/components/Badge/index.d.ts.map +1 -1
  138. package/dist/components/Badge/index.js +3 -3
  139. package/dist/components/Badge/variantIcons.d.ts +5 -0
  140. package/dist/components/Badge/variantIcons.d.ts.map +1 -0
  141. package/dist/components/Button/index.d.ts +1 -0
  142. package/dist/components/Button/index.d.ts.map +1 -1
  143. package/dist/components/Button/index.js +3 -2
  144. package/dist/components/Button/variantIcons.d.ts +5 -0
  145. package/dist/components/Button/variantIcons.d.ts.map +1 -0
  146. package/dist/components/ButtonBar/index.d.ts +1 -0
  147. package/dist/components/ButtonBar/index.d.ts.map +1 -1
  148. package/dist/components/ButtonBar/index.js +2 -2
  149. package/dist/components/ButtonBar/variantIcons.d.ts +5 -0
  150. package/dist/components/ButtonBar/variantIcons.d.ts.map +1 -0
  151. package/dist/components/Callout/Callout.d.ts.map +1 -1
  152. package/dist/components/Callout/index.js +1 -1
  153. package/dist/components/Checkbox/index.js +1 -1
  154. package/dist/components/CloseButton/index.js +1 -1
  155. package/dist/components/Code/index.d.ts +1 -0
  156. package/dist/components/Code/index.d.ts.map +1 -1
  157. package/dist/components/Code/index.js +2 -2
  158. package/dist/components/Code/variantIcons.d.ts +5 -0
  159. package/dist/components/Code/variantIcons.d.ts.map +1 -0
  160. package/dist/components/ColorModeControl/index.js +1 -1
  161. package/dist/components/ComboBox/ComboBox.d.ts.map +1 -1
  162. package/dist/components/ComboBox/index.js +1 -1
  163. package/dist/components/DataGrid/index.js +1 -1
  164. package/dist/components/DetentSlider/index.js +1 -1
  165. package/dist/components/Dialog/Dialog.d.ts.map +1 -1
  166. package/dist/components/Dialog/index.js +1 -1
  167. package/dist/components/Disclosure/index.js +1 -1
  168. package/dist/components/DragGhost/index.js +1 -1
  169. package/dist/components/FallthroughDiagram/index.js +1 -1
  170. package/dist/components/FillStrokeSwatch/index.js +1 -1
  171. package/dist/components/FitLabel/FitLabel.d.ts +41 -0
  172. package/dist/components/FitLabel/FitLabel.d.ts.map +1 -0
  173. package/dist/components/FitLabel/index.d.ts +3 -0
  174. package/dist/components/FitLabel/index.d.ts.map +1 -0
  175. package/dist/components/FitLabel/index.js +2 -0
  176. package/dist/components/FontFamilySelect/index.js +1 -1
  177. package/dist/components/FontWeightSelect/index.js +1 -1
  178. package/dist/components/GestureRoute/index.js +1 -1
  179. package/dist/components/GradientEditor/index.js +1 -1
  180. package/dist/components/InlineRange/InlineRange.d.ts +1 -1
  181. package/dist/components/ItemList/index.js +1 -1
  182. package/dist/components/Jog/index.js +1 -1
  183. package/dist/components/Keycaps/index.d.ts +1 -0
  184. package/dist/components/Keycaps/index.d.ts.map +1 -1
  185. package/dist/components/Keycaps/index.js +2 -2
  186. package/dist/components/Keycaps/variantIcons.d.ts +5 -0
  187. package/dist/components/Keycaps/variantIcons.d.ts.map +1 -0
  188. package/dist/components/LayerList/LayerList.d.ts.map +1 -1
  189. package/dist/components/LayerList/index.js +1 -1
  190. package/dist/components/ListEditor/index.js +1 -1
  191. package/dist/components/MenuButton/MenuButton.d.ts.map +1 -1
  192. package/dist/components/MenuButton/index.js +1 -1
  193. package/dist/components/MeshEditor/index.js +1 -1
  194. package/dist/components/NumberField/UnitField.d.ts.map +1 -1
  195. package/dist/components/NumberField/index.js +1 -1
  196. package/dist/components/OptionsBar/index.d.ts +1 -0
  197. package/dist/components/OptionsBar/index.d.ts.map +1 -1
  198. package/dist/components/OptionsBar/index.js +2 -2
  199. package/dist/components/OptionsBar/variantIcons.d.ts +5 -0
  200. package/dist/components/OptionsBar/variantIcons.d.ts.map +1 -0
  201. package/dist/components/PaintField/PaintField.d.ts.map +1 -1
  202. package/dist/components/PaintField/index.js +1 -1
  203. package/dist/components/PaintInput/index.js +1 -1
  204. package/dist/components/PatternPicker/index.js +1 -1
  205. package/dist/components/Powerline/index.js +2 -2
  206. package/dist/components/Prefs/index.js +2 -2
  207. package/dist/components/Prefs/prefField.d.ts.map +1 -1
  208. package/dist/components/Properties/NumberControls.d.ts +16 -0
  209. package/dist/components/Properties/NumberControls.d.ts.map +1 -0
  210. package/dist/components/Properties/PropertyField.d.ts +18 -8
  211. package/dist/components/Properties/PropertyField.d.ts.map +1 -1
  212. package/dist/components/Properties/index.js +2 -2
  213. package/dist/components/Select/Select.d.ts.map +1 -1
  214. package/dist/components/Select/index.js +1 -1
  215. package/dist/components/SelectionPanel/index.js +2 -2
  216. package/dist/components/SelectionPanel/renderLeaf.d.ts.map +1 -1
  217. package/dist/components/SidebarPanel/index.js +1 -1
  218. package/dist/components/Slider/Slider.d.ts +6 -0
  219. package/dist/components/Slider/Slider.d.ts.map +1 -1
  220. package/dist/components/Slider/index.js +1 -1
  221. package/dist/components/StatusBar/StatusBar.d.ts +2 -0
  222. package/dist/components/StatusBar/StatusBar.d.ts.map +1 -1
  223. package/dist/components/StatusBar/index.js +1 -1
  224. package/dist/components/SwatchGrid/index.js +1 -1
  225. package/dist/components/SwatchStrip/index.js +1 -1
  226. package/dist/components/ThemeSwitcher/index.js +1 -1
  227. package/dist/components/Timeline/index.js +1 -1
  228. package/dist/components/Toast/index.js +1 -1
  229. package/dist/components/ToggleBar/ToggleBar.d.ts.map +1 -1
  230. package/dist/components/ToggleBar/index.d.ts +1 -0
  231. package/dist/components/ToggleBar/index.d.ts.map +1 -1
  232. package/dist/components/ToggleBar/index.js +3 -2
  233. package/dist/components/ToggleBar/variantIcons.d.ts +5 -0
  234. package/dist/components/ToggleBar/variantIcons.d.ts.map +1 -0
  235. package/dist/components/TokenPanel/index.js +1 -1
  236. package/dist/components/ToolButton/index.js +1 -1
  237. package/dist/components/ToolOptionsBar/ToolOptionsBar.d.ts +1 -1
  238. package/dist/components/ToolOptionsBar/ToolOptionsBar.d.ts.map +1 -1
  239. package/dist/components/ToolOptionsBar/index.js +1 -1
  240. package/dist/components/ToolPalette/index.js +1 -1
  241. package/dist/components/Tooltip/Tooltip.d.ts.map +1 -1
  242. package/dist/components/Tooltip/index.js +1 -1
  243. package/dist/components/Tree/Tree.d.ts +1 -1
  244. package/dist/components/Tree/Tree.d.ts.map +1 -1
  245. package/dist/components/Tree/index.js +1 -1
  246. package/dist/components/stanceCss.d.ts +6 -0
  247. package/dist/components/stanceCss.d.ts.map +1 -1
  248. package/dist/components/stanceSurfaces.d.ts.map +1 -1
  249. package/dist/endless.d.ts +7 -0
  250. package/dist/endless.d.ts.map +1 -0
  251. package/dist/icons/index.d.ts +6 -0
  252. package/dist/icons/index.d.ts.map +1 -1
  253. package/dist/icons/paths.d.ts +14 -0
  254. package/dist/icons/paths.d.ts.map +1 -1
  255. package/dist/index.d.ts +1 -0
  256. package/dist/index.d.ts.map +1 -1
  257. package/dist/index.js +101 -97
  258. package/dist/index.js.map +1 -1
  259. package/dist/overlays/portalHost.d.ts +10 -4
  260. package/dist/overlays/portalHost.d.ts.map +1 -1
  261. package/dist/style.css +1 -1
  262. package/dist/useReorderDragList.d.ts +3 -0
  263. package/dist/useReorderDragList.d.ts.map +1 -1
  264. package/package.json +10 -9
  265. package/dist/chunks/Badge-CTc9Lkwn.js.map +0 -1
  266. package/dist/chunks/Button-XB-T75YL.js.map +0 -1
  267. package/dist/chunks/ButtonBar-CIMKPPRS.js.map +0 -1
  268. package/dist/chunks/Callout-BUn0dP_S.js.map +0 -1
  269. package/dist/chunks/Code-AsKpgnv6.js.map +0 -1
  270. package/dist/chunks/ComboBox-DKln_mOd.js.map +0 -1
  271. package/dist/chunks/Dialog-DKfsk5VN.js.map +0 -1
  272. package/dist/chunks/Icon--B1ME-6c.js.map +0 -1
  273. package/dist/chunks/ItemList-CRu9y7hL.js.map +0 -1
  274. package/dist/chunks/Keycaps-C-FJyG8k.js.map +0 -1
  275. package/dist/chunks/LayerList-BqeWFuGc.js +0 -421
  276. package/dist/chunks/LayerList-BqeWFuGc.js.map +0 -1
  277. package/dist/chunks/MenuButton-TAFg88Lp.js.map +0 -1
  278. package/dist/chunks/OptionsBar-DeTAjVb7.js.map +0 -1
  279. package/dist/chunks/PaintField-BdmQM53v.js.map +0 -1
  280. package/dist/chunks/PatternPicker-B3HcMZWg.js.map +0 -1
  281. package/dist/chunks/Prefs-BnVEyfWO.js.map +0 -1
  282. package/dist/chunks/PropertyField-PMrqBA0n.js +0 -743
  283. package/dist/chunks/PropertyField-PMrqBA0n.js.map +0 -1
  284. package/dist/chunks/Select-ouV8O6cp.js.map +0 -1
  285. package/dist/chunks/Slider-DSrlMEq8.js +0 -389
  286. package/dist/chunks/Slider-DSrlMEq8.js.map +0 -1
  287. package/dist/chunks/StatusBar-BEOfOX0D.js.map +0 -1
  288. package/dist/chunks/SwatchGrid-9ZPiDmxd.js.map +0 -1
  289. package/dist/chunks/ToggleBar-Z2jZiguF.js +0 -80
  290. package/dist/chunks/ToggleBar-Z2jZiguF.js.map +0 -1
  291. package/dist/chunks/ToolOptionsBar-BJKwnemU.js +0 -88
  292. package/dist/chunks/ToolOptionsBar-BJKwnemU.js.map +0 -1
  293. package/dist/chunks/Tooltip-C6eFCYxw.js.map +0 -1
  294. package/dist/chunks/Tree-Cc8lIzgM.js +0 -203
  295. package/dist/chunks/Tree-Cc8lIzgM.js.map +0 -1
  296. package/dist/chunks/checkbox.module-DLQV9tMX.js +0 -5
  297. package/dist/chunks/checkbox.module-DLQV9tMX.js.map +0 -1
  298. package/dist/chunks/icons-Dr2-r30x.js.map +0 -1
  299. package/dist/chunks/interactiveTarget-BNZmTow2.js +0 -24
  300. package/dist/chunks/interactiveTarget-BNZmTow2.js.map +0 -1
  301. package/dist/chunks/model-B6zuQg6b.js.map +0 -1
  302. package/dist/chunks/prefField-BE_Ytr2H.js.map +0 -1
  303. package/dist/chunks/segmentedControl.module-BzGXUL5G.js +0 -11
  304. package/dist/chunks/useReorderDragList-CStYKjHl.js.map +0 -1
  305. package/dist/interactiveTarget.d.ts +0 -9
  306. package/dist/interactiveTarget.d.ts.map +0 -1
@@ -1,11 +1,12 @@
1
- import { a as e, t } from "./Icon--B1ME-6c.js";
2
- import { r as n, t as r } from "./PropertyField-PMrqBA0n.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 = {
1
+ import { a as e, t } from "./Icon-BfqYtAX5.js";
2
+ import { t as n } from "./PropertyField-CLbUOynA.js";
3
+ import { t as r } from "./ToggleBar-CfYbMK3x.js";
4
+ import { r as i, t as a } from "./FitLabel-BzZGkWfL.js";
5
+ import { t as o } from "./prefField-DPPbAmRR.js";
6
+ import { MIXED as s } from "@weasel-js/core";
7
+ import { jsx as c, jsxs as l } from "react/jsx-runtime";
8
+ import { Fragment as u, createElement as d } from "react";
9
+ var f = {
9
10
  root: "_root_11o7u_1",
10
11
  header: "_header_11o7u_8",
11
12
  kind: "_kind_11o7u_16",
@@ -28,15 +29,15 @@ var d = {
28
29
  };
29
30
  //#endregion
30
31
  //#region src/components/SelectionPanel/renderLeaf.tsx
31
- function f(e, t) {
32
+ function p(e, t) {
32
33
  let { leaf: n } = e;
33
34
  return n.kind === "boolean" && n.control === "toggle" && n.pair !== void 0 && t?.[e.ctx.path] === void 0 && t?.[n.kind] === void 0;
34
35
  }
35
- function p(e, t) {
36
+ function m(e, t) {
36
37
  let n = [];
37
38
  for (let r = 0; r < e.length;) {
38
39
  let i = e[r];
39
- if (!f(i, t)) {
40
+ if (!p(i, t)) {
40
41
  let e = i.render();
41
42
  e != null && n.push({
42
43
  key: i.key,
@@ -47,13 +48,13 @@ function p(e, t) {
47
48
  continue;
48
49
  }
49
50
  let a = r + 1;
50
- for (; a < e.length && f(e[a], t) && e[a].leaf.pair === i.leaf.pair;) a += 1;
51
+ for (; a < e.length && p(e[a], t) && e[a].leaf.pair === i.leaf.pair;) a += 1;
51
52
  let o = e.slice(r, a);
52
53
  n.push({
53
54
  key: i.key,
54
55
  leaf: i.leaf,
55
56
  block: o.every((e) => e.leaf.block === !0),
56
- content: /* @__PURE__ */ s(m, {
57
+ content: /* @__PURE__ */ c(h, {
57
58
  run: o,
58
59
  ariaLabel: i.leaf.pair
59
60
  })
@@ -61,117 +62,117 @@ function p(e, t) {
61
62
  }
62
63
  return n;
63
64
  }
64
- function m({ run: e, ariaLabel: t }) {
65
- let r = e.map((e) => ({
65
+ function h({ run: e, ariaLabel: t }) {
66
+ let n = e.map((e) => ({
66
67
  cell: e,
67
- field: a(e.leaf, {
68
+ field: o(e.leaf, {
68
69
  value: e.ctx.value,
69
70
  mixed: e.ctx.mixed,
70
71
  unset: e.ctx.unset,
71
72
  siblings: e.ctx.siblings,
72
73
  setValue: e.ctx.setValue,
73
- ...v(e.ctx)
74
+ ...y(e.ctx)
74
75
  })
75
- })), o = r.filter((e) => !e.field.mixed && e.field.value === !0).map((e) => e.cell.key);
76
- return /* @__PURE__ */ s(i, {
76
+ })), s = n.filter((e) => !e.field.mixed && e.field.value === !0).map((e) => e.cell.key);
77
+ return /* @__PURE__ */ c(r, {
77
78
  mode: "multiple",
78
79
  size: "sm",
79
80
  variant: "flat",
80
- className: d.flagToggle,
81
+ className: f.flagToggle,
81
82
  ariaLabel: t,
82
- items: r.map(({ cell: e, field: t }) => ({
83
+ items: n.map(({ cell: e, field: t }) => ({
83
84
  value: e.key,
84
- label: t.glyph ?? e.leaf.name.slice(0, 1),
85
+ label: t.glyph ?? /* @__PURE__ */ c(a, { forms: i(e.leaf.name, t.short) }),
85
86
  ariaLabel: e.ariaLabel,
86
- tooltip: n(t.glyph) === void 0 ? void 0 : e.leaf.name
87
+ tooltip: t.glyph === void 0 ? void 0 : e.leaf.name
87
88
  })),
88
- value: o,
89
- mixedValues: r.filter((e) => e.field.mixed).map((e) => e.cell.key),
89
+ value: s,
90
+ mixedValues: n.filter((e) => e.field.mixed).map((e) => e.cell.key),
90
91
  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);
92
+ for (let { cell: t, field: r } of n) {
93
+ let n = e.includes(t.key);
94
+ n !== s.includes(t.key) && r.onChange(n);
94
95
  }
95
96
  }
96
97
  });
97
98
  }
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, {
99
+ function g(e, t, r, i = "", a = !1) {
100
+ let { pref: s, value: u, mixed: p, unset: m, setValue: h } = e;
101
+ if (s.kind === "object") return /* @__PURE__ */ c(b, {
101
102
  ctx: e,
102
- renderers: n,
103
+ renderers: r,
103
104
  selectionKey: i
104
105
  });
105
- let b = a(l, {
106
- value: f,
106
+ let g = o(s, {
107
+ value: u,
107
108
  mixed: p,
108
109
  unset: m,
109
110
  siblings: e.siblings,
110
111
  setValue: h,
111
- ...v(e),
112
+ ...y(e),
112
113
  fontVariant: {
113
- weight: e.valueAt(_(e.path, "fontWeight")).value,
114
- style: e.valueAt(_(e.path, "fontStyle")).value
114
+ weight: e.valueAt(v(e.path, "fontWeight")).value,
115
+ style: e.valueAt(v(e.path, "fontStyle")).value
115
116
  },
116
- fontFamily: e.valueAt(_(e.path, "fontFamily")).value
117
+ fontFamily: e.valueAt(v(e.path, "fontFamily")).value
117
118
  });
118
- if (b === null) return /* @__PURE__ */ c("span", {
119
- className: d.unrenderable,
119
+ if (g === null) return /* @__PURE__ */ l("span", {
120
+ className: f.unrenderable,
120
121
  children: [
121
122
  "(",
122
- l.kind,
123
+ s.kind,
123
124
  ": no renderer)"
124
125
  ]
125
126
  });
126
- switch (b.kind) {
127
- case "boolean": return /* @__PURE__ */ s(r, {
128
- ...b,
127
+ switch (g.kind) {
128
+ case "boolean": return /* @__PURE__ */ c(n, {
129
+ ...g,
129
130
  name: t,
130
- control: b.control ?? "switch",
131
- className: b.control === "toggle" ? d.flagToggle : void 0
131
+ control: g.control ?? "switch",
132
+ className: g.control === "toggle" ? f.flagToggle : void 0
132
133
  });
133
- case "number": return /* @__PURE__ */ s(r, {
134
- ...b,
134
+ case "number": return /* @__PURE__ */ c(n, {
135
+ ...g,
135
136
  name: t,
136
- className: b.control === "slider" ? d.slider : d.number,
137
- onInput: b.control === "slider" ? b.onInput : g
137
+ className: g.control === "slider" ? f.slider : f.number,
138
+ onInput: g.control === "slider" ? g.onInput : _
138
139
  });
139
- case "string": return /* @__PURE__ */ s(r, {
140
- ...b,
140
+ case "string": return /* @__PURE__ */ c(n, {
141
+ ...g,
141
142
  name: t,
142
- onInput: g
143
+ onInput: _
143
144
  });
144
- case "enum": return /* @__PURE__ */ s(r, {
145
- ...b,
145
+ case "enum": return /* @__PURE__ */ c(n, {
146
+ ...g,
146
147
  name: t,
147
- className: b.control === "toggle" ? b.onClear ? d.flagToggle : d.toggle : b.control === "radio" ? void 0 : d.select
148
+ className: g.control === "toggle" ? g.onClear ? f.flagToggle : f.toggle : g.control === "radio" ? void 0 : f.select
148
149
  });
149
150
  case "font-family":
150
- case "font-weight": return /* @__PURE__ */ s(r, {
151
- ...b,
151
+ case "font-weight": return /* @__PURE__ */ c(n, {
152
+ ...g,
152
153
  name: t,
153
- className: d.select
154
+ className: f.select
154
155
  });
155
- case "paint": return /* @__PURE__ */ u(r, {
156
- ...b,
156
+ case "paint": return /* @__PURE__ */ d(n, {
157
+ ...g,
157
158
  name: t,
158
159
  key: i,
159
160
  control: "inline",
160
- allowNone: !o
161
+ allowNone: !a
161
162
  });
162
- case "color": return /* @__PURE__ */ s(r, {
163
- ...b,
163
+ case "color": return /* @__PURE__ */ c(n, {
164
+ ...g,
164
165
  name: t,
165
- onInput: g
166
+ onInput: _
166
167
  });
167
168
  }
168
169
  }
169
- var g = () => {};
170
- function _(e, t) {
170
+ var _ = () => {};
171
+ function v(e, t) {
171
172
  let n = e.lastIndexOf(".");
172
173
  return n < 0 ? t : `${e.slice(0, n + 1)}${t}`;
173
174
  }
174
- function v(e) {
175
+ function y(e) {
175
176
  if (e.eachSiblings === void 0) return {};
176
177
  let t = e.eachSiblings;
177
178
  return {
@@ -182,13 +183,13 @@ function v(e) {
182
183
  update: e.update
183
184
  };
184
185
  }
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) => {
186
+ function b({ ctx: n, renderers: r, selectionKey: i = "" }) {
187
+ let a = n.pref, o = typeof n.value == "object" && n.value !== null ? n.value : void 0, s = n.each.map((e) => typeof e == "object" && e ? e : void 0), d = Object.values(a.children).every((e) => !("kind" in e)), p = (d, h) => {
187
188
  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
+ for (let { key: e, leaf: t, block: n, content: i } of m(y, r)) {
189
190
  let r = _[_.length - 1];
190
191
  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
+ r.controls.push(/* @__PURE__ */ c(u, { children: i }, e)), r.block &&= n;
192
193
  continue;
193
194
  }
194
195
  _.push({
@@ -197,115 +198,115 @@ function y({ ctx: n, renderers: r, selectionKey: i = "" }) {
197
198
  label: t.pair ?? t.name,
198
199
  title: t.description,
199
200
  block: n,
200
- controls: [/* @__PURE__ */ s(l, { children: i }, e)]
201
+ controls: [/* @__PURE__ */ c(u, { children: i }, e)]
201
202
  });
202
203
  }
203
204
  y = [];
204
205
  };
205
- for (let [l, p] of Object.entries(f)) {
206
- if (!("kind" in p)) {
207
- let e = p.name !== "", t = m(p.children, e);
206
+ for (let [u, m] of Object.entries(d)) {
207
+ if (!("kind" in m)) {
208
+ let e = m.name !== "", t = p(m.children, e);
208
209
  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
210
+ b(), _.push(/* @__PURE__ */ l("div", {
211
+ className: e && h ? f.objectGroup : void 0,
212
+ children: [e && /* @__PURE__ */ c("h5", {
213
+ className: f.sectionTitle,
214
+ children: m.name
214
215
  }), t]
215
- }, `group:${l}`));
216
+ }, `group:${u}`));
216
217
  continue;
217
218
  }
218
- let f = `${n.path}.${l}`, v = n.mixed ? n.valueAt(f) : {
219
- value: o?.[l],
219
+ let d = `${n.path}.${u}`, v = n.mixed ? n.valueAt(d) : {
220
+ value: o?.[u],
220
221
  mixed: !1
221
222
  }, 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
+ let n = typeof t == "object" && t ? t : a.fromScalar?.(t) ?? (typeof a.default == "object" && a.default !== null ? { ...a.default } : {}), r = e(n[u], n);
223
224
  if (r === void 0) {
224
- let { [l]: e, ...t } = n;
225
+ let { [u]: e, ...t } = n;
225
226
  return t;
226
227
  }
227
228
  return {
228
229
  ...n,
229
- [l]: r
230
+ [u]: r
230
231
  };
231
232
  }), S = {
232
- path: f,
233
- pref: p,
233
+ path: d,
234
+ pref: m,
234
235
  value: v.mixed ? void 0 : v.value,
235
236
  mixed: v.mixed,
236
237
  unset: !v.mixed && v.value === void 0,
237
238
  siblings: o,
238
- each: u.map((e) => e?.[l]),
239
- eachSiblings: u,
239
+ each: s.map((e) => e?.[u]),
240
+ eachSiblings: s,
240
241
  valueAt: n.valueAt,
241
242
  selectionKey: n.selectionKey,
242
243
  update: x,
243
244
  setValue: (e) => x(() => e)
244
245
  };
245
246
  y.push({
246
- key: f,
247
- leaf: p,
247
+ key: d,
248
+ leaf: m,
248
249
  ctx: S,
249
- ariaLabel: p.name,
250
+ ariaLabel: m.name,
250
251
  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,
252
+ let n = r?.[d] ?? r?.[m.kind], a = n ? n(S) : g(S, m.name, r, i, !0);
253
+ return a == null ? null : (m.pair !== void 0 || m.block === !0) && m.icon && m.icon in e ? /* @__PURE__ */ l("span", {
254
+ className: f.namedField,
255
+ children: [/* @__PURE__ */ c(t, {
256
+ name: m.icon,
256
257
  size: 14
257
258
  }), a]
258
259
  }) : a;
259
260
  }
260
261
  });
261
262
  }
262
- return b(), _.map((e) => typeof e == "object" && e && "controls" in e ? e.block ? /* @__PURE__ */ s("div", {
263
- className: `${d.rowControls} ${d.blockRow}`,
263
+ return b(), _.map((e) => typeof e == "object" && e && "controls" in e ? e.block ? /* @__PURE__ */ c("div", {
264
+ className: `${f.rowControls} ${f.blockRow}`,
264
265
  title: e.title,
265
266
  children: e.controls
266
- }, e.key) : /* @__PURE__ */ c("div", {
267
- className: d.row,
268
- children: [/* @__PURE__ */ s("span", {
269
- className: d.rowLabel,
267
+ }, e.key) : /* @__PURE__ */ l("div", {
268
+ className: f.row,
269
+ children: [/* @__PURE__ */ c("span", {
270
+ className: f.rowLabel,
270
271
  title: e.title,
271
272
  children: e.label
272
- }), /* @__PURE__ */ s("span", {
273
- className: d.rowControls,
273
+ }), /* @__PURE__ */ c("span", {
274
+ className: f.rowControls,
274
275
  children: e.controls
275
276
  })]
276
277
  }, 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,
278
+ }, h = p(a.children, !d);
279
+ return h.length === 0 ? null : /* @__PURE__ */ l("div", {
280
+ className: f.objectLeaf,
281
+ children: [!d && /* @__PURE__ */ c("h4", {
282
+ className: f.sectionTitle,
282
283
  children: a.name
283
- }), g]
284
+ }), h]
284
285
  });
285
286
  }
286
287
  //#endregion
287
288
  //#region src/components/SelectionPanel/model.ts
288
- function b(e, t) {
289
+ function x(e, t) {
289
290
  if (e.kind === "container") return "group";
290
291
  for (let n of t) if (n.matches(e.data)) return n.name;
291
292
  return "unknown";
292
293
  }
293
- function x(e) {
294
+ function S(e) {
294
295
  return !("kind" in e);
295
296
  }
296
- function S(e) {
297
+ function C(e) {
297
298
  let t = [], n = [], r = (e, t) => {
298
- for (let [n, i] of Object.entries(e.children)) x(i) ? r(i, t) : t.push({
299
+ for (let [n, i] of Object.entries(e.children)) S(i) ? r(i, t) : t.push({
299
300
  path: n,
300
301
  leaf: i
301
302
  });
302
303
  };
303
- for (let [i, a] of Object.entries(e.children)) if (x(a)) {
304
+ for (let [i, a] of Object.entries(e.children)) if (S(a)) {
304
305
  let e = [];
305
306
  r(a, e), t.push({
306
307
  key: i,
307
308
  name: a.name,
308
- rows: C(e)
309
+ rows: w(e)
309
310
  });
310
311
  } else n.push({
311
312
  path: i,
@@ -314,10 +315,10 @@ function S(e) {
314
315
  return n.length > 0 && t.unshift({
315
316
  key: "",
316
317
  name: "",
317
- rows: C(n)
318
+ rows: w(n)
318
319
  }), t;
319
320
  }
320
- function C(e) {
321
+ function w(e) {
321
322
  let t = [];
322
323
  for (let n of e) {
323
324
  let e = n.leaf.pair, r = t[t.length - 1];
@@ -328,14 +329,14 @@ function C(e) {
328
329
  }
329
330
  return t;
330
331
  }
331
- function w(e, t) {
332
+ function T(e, t) {
332
333
  let n = [...new Set(e)];
333
334
  if (n.length === 0) return [];
334
335
  let r = new Map(t.map((e) => [e.name, e])), i = n.map((e) => r.get(e)?.schema);
335
336
  if (i.some((e) => e === void 0)) return [];
336
- let [a, ...o] = i, s = S(a);
337
+ let [a, ...o] = i, s = C(a);
337
338
  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
+ let c = (e) => `${e.path}\0${e.leaf.kind}`, l = o.map((e) => new Set(C(e).flatMap((e) => e.rows).flatMap((e) => e.leaves).map(c))), u = (e) => l.every((t) => t.has(c(e)));
339
340
  return s.map((e) => ({
340
341
  ...e,
341
342
  rows: e.rows.map((e) => ({
@@ -344,7 +345,7 @@ function w(e, t) {
344
345
  })).filter((e) => e.leaves.length > 0)
345
346
  })).filter((e) => e.rows.length > 0);
346
347
  }
347
- function T(e, t) {
348
+ function E(e, t) {
348
349
  let n = t.split(".");
349
350
  if (n.length < 2) return;
350
351
  let r = n[0], i = r === "pose" ? e.pose : r === "data" ? e.data : void 0;
@@ -354,33 +355,33 @@ function T(e, t) {
354
355
  }
355
356
  return i;
356
357
  }
357
- function E(e, t, n) {
358
+ function D(e, t, n) {
358
359
  let [r, ...i] = t;
359
360
  if (i.length === 0) return Array.isArray(e) ? Object.assign([...e], { [r]: n }) : {
360
361
  ...e,
361
362
  [r]: n
362
363
  };
363
- let a = e[r], o = E(Array.isArray(a) ? [...a] : typeof a == "object" && a ? { ...a } : {}, i, n);
364
+ let a = e[r], o = D(Array.isArray(a) ? [...a] : typeof a == "object" && a ? { ...a } : {}, i, n);
364
365
  return Array.isArray(e) ? Object.assign([...e], { [r]: o }) : {
365
366
  ...e,
366
367
  [r]: o
367
368
  };
368
369
  }
369
- function D(e, t) {
370
+ function O(e, t) {
370
371
  let n, r = !0;
371
372
  for (let i of e) {
372
- let e = T(i, t);
373
+ let e = E(i, t);
373
374
  if (r) n = e, r = !1;
374
- else if (!Object.is(e, n)) return o;
375
+ else if (!Object.is(e, n)) return s;
375
376
  }
376
377
  return n;
377
378
  }
378
- function O(e) {
379
+ function k(e) {
379
380
  let t = /* @__PURE__ */ new Map();
380
381
  for (let n of e) t.set(n, (t.get(n) ?? 0) + 1);
381
382
  return [...t.entries()].map(([e, t]) => t > 1 ? `${e} ×${t}` : e).join(" · ");
382
383
  }
383
384
  //#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
+ export { S as a, w as c, m as d, f, T as i, D as l, O as n, k as o, x as r, E as s, s as t, g as u };
385
386
 
386
- //# sourceMappingURL=model-B6zuQg6b.js.map
387
+ //# sourceMappingURL=model-Ca0f95r0.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"model-Ca0f95r0.js","names":["s","Fragment","ICON_PATHS","PropertyControl","ToggleBar","labelForms","FitLabel","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 { FitLabel, labelForms } from '../FitLabel/FitLabel';\nimport { 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 ?? <FitLabel forms={labelForms(cell.leaf.name, field.short)} />,\n ariaLabel: cell.ariaLabel,\n tooltip: 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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACiIA,SAAgBU,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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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"}
@@ -23,10 +23,11 @@ function l(t) {
23
23
  hidden: !0,
24
24
  ref: i
25
25
  }),
26
- portalProps: { UNSTABLE_portalContainer: s ?? void 0 }
26
+ portalProps: { UNSTABLE_portalContainer: s ?? void 0 },
27
+ ready: o !== void 0 || n !== null
27
28
  };
28
29
  }
29
30
  //#endregion
30
31
  export { l as i, a as n, c as r, s as t };
31
32
 
32
- //# sourceMappingURL=portalHost-CE70wLzo.js.map
33
+ //# sourceMappingURL=portalHost-RUQPxIoW.js.map
@@ -1 +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"}
1
+ {"version":3,"file":"portalHost-RUQPxIoW.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. Render the\n * overlay only once `ready` is true.\n *\n * The anchor is what \"nearest themed ancestor\" is measured from, and the\n * first render has none yet. An overlay rendered then would portal into the\n * body and move on the next render, but React Aria hides everything outside\n * it on the first mount — so a modal that mounted open left the app root\n * `inert` with itself now inside it. `ready` turns true on that next render,\n * still before paint.\n */\nexport function useOverlayPortal(explicit?: Element | null): {\n anchor: ReactElement;\n portalProps: OverlayPortalTarget;\n ready: boolean;\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 ready: assigned !== undefined || anchorEl !== null,\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;AA0CA,SAAgBC,EAAiB,GAI/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;EAC/D,OAAOD,MAAa,KAAA,KAAaH,MAAa;CAChD;AACF"}