@weasel-js/ui 1.3.0 → 1.4.0-pre.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (225) hide show
  1. package/dist/chunks/{ActionBar-BTev_ZZl.js → ActionBar-D4N1o4LB.js} +2 -2
  2. package/dist/chunks/{ActionBar-BTev_ZZl.js.map → ActionBar-D4N1o4LB.js.map} +1 -1
  3. package/dist/chunks/{ActionsBar-CBi_dV4B.js → ActionsBar-B-gWm0NE.js} +3 -3
  4. package/dist/chunks/{ActionsBar-CBi_dV4B.js.map → ActionsBar-B-gWm0NE.js.map} +1 -1
  5. package/dist/chunks/{Badge-9dPfvYOk.js → Badge-BXTDs-zi.js} +1 -1
  6. package/dist/chunks/{Badge-9dPfvYOk.js.map → Badge-BXTDs-zi.js.map} +1 -1
  7. package/dist/chunks/{BandEditor-DeE-Nhyh.js → BandEditor-D13ybQN_.js} +1 -1
  8. package/dist/chunks/{BandEditor-DeE-Nhyh.js.map → BandEditor-D13ybQN_.js.map} +1 -1
  9. package/dist/chunks/{Button-CIu40Epu.js → Button-0OdcoOMx.js} +1 -1
  10. package/dist/chunks/{Button-CIu40Epu.js.map → Button-0OdcoOMx.js.map} +1 -1
  11. package/dist/chunks/{Callout-CxDNb9iE.js → Callout-DAFusbzz.js} +1 -1
  12. package/dist/chunks/Callout-DAFusbzz.js.map +1 -0
  13. package/dist/chunks/{Checkbox-Chtrlh19.js → Checkbox-BePa_djO.js} +1 -1
  14. package/dist/chunks/{Checkbox-Chtrlh19.js.map → Checkbox-BePa_djO.js.map} +1 -1
  15. package/dist/chunks/{ColorField-CSSRv3jG.js → ColorField-CKbnsEUN.js} +2 -2
  16. package/dist/chunks/{ColorField-CSSRv3jG.js.map → ColorField-CKbnsEUN.js.map} +1 -1
  17. package/dist/chunks/{ComboBox-BIQ8KP4h.js → ComboBox-B6QS8y3j.js} +2 -2
  18. package/dist/chunks/{ComboBox-BIQ8KP4h.js.map → ComboBox-B6QS8y3j.js.map} +1 -1
  19. package/dist/chunks/{CurveEditor-DiJk0NhK.js → CurveEditor-COJ6WK9K.js} +2 -2
  20. package/dist/chunks/{CurveEditor-DiJk0NhK.js.map → CurveEditor-COJ6WK9K.js.map} +1 -1
  21. package/dist/chunks/{DataGrid-BgiEYBLo.js → DataGrid-BWZZUekH.js} +2 -2
  22. package/dist/chunks/{DataGrid-BgiEYBLo.js.map → DataGrid-BWZZUekH.js.map} +1 -1
  23. package/dist/chunks/DetentSlider-CXIeTHaM.js +83 -0
  24. package/dist/chunks/DetentSlider-CXIeTHaM.js.map +1 -0
  25. package/dist/chunks/{Dialog-RzrboT4Q.js → Dialog-CQAZ7hS7.js} +1 -1
  26. package/dist/chunks/{Dialog-RzrboT4Q.js.map → Dialog-CQAZ7hS7.js.map} +1 -1
  27. package/dist/chunks/{DragHandleGlyph-CJbzRigu.js → DragHandleGlyph--2zsZzA2.js} +1 -1
  28. package/dist/chunks/{DragHandleGlyph-CJbzRigu.js.map → DragHandleGlyph--2zsZzA2.js.map} +1 -1
  29. package/dist/chunks/{Field-DrRby9vo.js → Field-BCcTt6Fd.js} +1 -1
  30. package/dist/chunks/{Field-DrRby9vo.js.map → Field-BCcTt6Fd.js.map} +1 -1
  31. package/dist/chunks/FontFamilySelect-DwkwRYrr.js +29 -0
  32. package/dist/chunks/FontFamilySelect-DwkwRYrr.js.map +1 -0
  33. package/dist/chunks/{GradientEditor-BuVR6pt-.js → GradientEditor-FwNdxxf-.js} +4 -4
  34. package/dist/chunks/{GradientEditor-BuVR6pt-.js.map → GradientEditor-FwNdxxf-.js.map} +1 -1
  35. package/dist/chunks/{PaintInput-K5W4Uho3.js → Icon-CxoJb_bw.js} +17 -127
  36. package/dist/chunks/Icon-CxoJb_bw.js.map +1 -0
  37. package/dist/chunks/{InlineRange-B-Jkv8AA.js → InlineRange-mb19EGOI.js} +1 -1
  38. package/dist/chunks/{InlineRange-B-Jkv8AA.js.map → InlineRange-mb19EGOI.js.map} +1 -1
  39. package/dist/chunks/{Input-BnxOPY4N.js → Input-DRUeowbz.js} +2 -2
  40. package/dist/chunks/{Input-BnxOPY4N.js.map → Input-DRUeowbz.js.map} +1 -1
  41. package/dist/chunks/ItemList-BUTk9E8-.js +42 -0
  42. package/dist/chunks/ItemList-BUTk9E8-.js.map +1 -0
  43. package/dist/chunks/{Keycaps-Dk33JOiH.js → Keycaps-DszN5Dwl.js} +1 -1
  44. package/dist/chunks/{Keycaps-Dk33JOiH.js.map → Keycaps-DszN5Dwl.js.map} +1 -1
  45. package/dist/chunks/{LayerStack-DQYvGNPA.js → LayerStack-htMwIsJ6.js} +3 -3
  46. package/dist/chunks/{LayerStack-DQYvGNPA.js.map → LayerStack-htMwIsJ6.js.map} +1 -1
  47. package/dist/chunks/{NumberField-BQ-KaK7T.js → NumberField-CQ7OJORF.js} +2 -2
  48. package/dist/chunks/{NumberField-BQ-KaK7T.js.map → NumberField-CQ7OJORF.js.map} +1 -1
  49. package/dist/chunks/{OptionsBar-BecAPCID.js → OptionsBar-efIwfqYe.js} +3 -3
  50. package/dist/chunks/{OptionsBar-BecAPCID.js.map → OptionsBar-efIwfqYe.js.map} +1 -1
  51. package/dist/chunks/PaintInput-CgZR3B0r.js +118 -0
  52. package/dist/chunks/PaintInput-CgZR3B0r.js.map +1 -0
  53. package/dist/chunks/{PatternPicker-BdLSj_f_.js → PatternPicker-v9BFsaMM.js} +2 -2
  54. package/dist/chunks/{PatternPicker-BdLSj_f_.js.map → PatternPicker-v9BFsaMM.js.map} +1 -1
  55. package/dist/chunks/{Plot2D-BEjpJhk-.js → Plot2D-B08SYGQV.js} +1 -1
  56. package/dist/chunks/{Plot2D-BEjpJhk-.js.map → Plot2D-B08SYGQV.js.map} +1 -1
  57. package/dist/chunks/{PointPlotter-C_tZb122.js → PointPlotter-DEh7a3xB.js} +2 -2
  58. package/dist/chunks/{PointPlotter-C_tZb122.js.map → PointPlotter-DEh7a3xB.js.map} +1 -1
  59. package/dist/chunks/{Powerline-Cc-Av8Pc.js → Powerline-M1Q3Hx5E.js} +2 -2
  60. package/dist/chunks/{Powerline-Cc-Av8Pc.js.map → Powerline-M1Q3Hx5E.js.map} +1 -1
  61. package/dist/chunks/{Prefs-CRTRAud6.js → Prefs-C2qhxnmt.js} +11 -11
  62. package/dist/chunks/{Prefs-CRTRAud6.js.map → Prefs-C2qhxnmt.js.map} +1 -1
  63. package/dist/chunks/{Properties-BRrWSBHM.js → Properties-CFRJ8mYH.js} +65 -58
  64. package/dist/chunks/Properties-CFRJ8mYH.js.map +1 -0
  65. package/dist/chunks/{RadioGroup-BrtV1Clm.js → RadioGroup-B8eMJ6lu.js} +2 -2
  66. package/dist/chunks/{RadioGroup-BrtV1Clm.js.map → RadioGroup-B8eMJ6lu.js.map} +1 -1
  67. package/dist/chunks/{RangeSlider-CJfhxDn6.js → RangeSlider-JczhglgA.js} +1 -1
  68. package/dist/chunks/RangeSlider-JczhglgA.js.map +1 -0
  69. package/dist/chunks/{ResizeHandle-Csz3DPew.js → ResizeHandle-CXBXV6Px.js} +1 -1
  70. package/dist/chunks/{ResizeHandle-Csz3DPew.js.map → ResizeHandle-CXBXV6Px.js.map} +1 -1
  71. package/dist/chunks/{Select-BYhHGmMl.js → Select-g8PhE010.js} +2 -2
  72. package/dist/chunks/{Select-BYhHGmMl.js.map → Select-g8PhE010.js.map} +1 -1
  73. package/dist/chunks/SelectionPanel-Cl18SdD6.js +561 -0
  74. package/dist/chunks/SelectionPanel-Cl18SdD6.js.map +1 -0
  75. package/dist/chunks/{Sidebar-DrBQZ9nP.js → Sidebar-mWGsndWw.js} +1 -1
  76. package/dist/chunks/{Sidebar-DrBQZ9nP.js.map → Sidebar-mWGsndWw.js.map} +1 -1
  77. package/dist/chunks/SidebarPanel-B2d0erLv.js +59 -0
  78. package/dist/chunks/SidebarPanel-B2d0erLv.js.map +1 -0
  79. package/dist/chunks/{Slider-DbOt9Dji.js → Slider-BbbmHE0c.js} +97 -63
  80. package/dist/chunks/Slider-BbbmHE0c.js.map +1 -0
  81. package/dist/chunks/{StatusBar-B6lPbvrF.js → StatusBar-xxCcWsfq.js} +1 -1
  82. package/dist/chunks/{StatusBar-B6lPbvrF.js.map → StatusBar-xxCcWsfq.js.map} +1 -1
  83. package/dist/chunks/{Switch-BSr-vaAC.js → Switch-QviBb61l.js} +1 -1
  84. package/dist/chunks/{Switch-BSr-vaAC.js.map → Switch-QviBb61l.js.map} +1 -1
  85. package/dist/chunks/{Tabs-CIa-Idzu.js → Tabs-DT-dIt6d.js} +1 -1
  86. package/dist/chunks/{Tabs-CIa-Idzu.js.map → Tabs-DT-dIt6d.js.map} +1 -1
  87. package/dist/chunks/Timeline-DsLeV5I1.js +894 -0
  88. package/dist/chunks/Timeline-DsLeV5I1.js.map +1 -0
  89. package/dist/chunks/{Toast-C0UnBqQu.js → Toast-CfkiN0Nv.js} +1 -1
  90. package/dist/chunks/{Toast-C0UnBqQu.js.map → Toast-CfkiN0Nv.js.map} +1 -1
  91. package/dist/chunks/{ToggleBar-1wDRwSGN.js → ToggleBar-D0veW91s.js} +2 -2
  92. package/dist/chunks/{ToggleBar-1wDRwSGN.js.map → ToggleBar-D0veW91s.js.map} +1 -1
  93. package/dist/chunks/{ToolButton-Bd9l_I8f.js → ToolButton-CLoR9Z4o.js} +2 -2
  94. package/dist/chunks/{ToolButton-Bd9l_I8f.js.map → ToolButton-CLoR9Z4o.js.map} +1 -1
  95. package/dist/chunks/{ToolGroup-gizXwttA.js → ToolGroup-BnE23mcA.js} +1 -1
  96. package/dist/chunks/{ToolGroup-gizXwttA.js.map → ToolGroup-BnE23mcA.js.map} +1 -1
  97. package/dist/chunks/{ToolOptionsBar-CXjeTE1d.js → ToolOptionsBar-ByHX7y1M.js} +1 -1
  98. package/dist/chunks/{ToolOptionsBar-CXjeTE1d.js.map → ToolOptionsBar-ByHX7y1M.js.map} +1 -1
  99. package/dist/chunks/{ToolPalette-3YpkSNfj.js → ToolPalette-W-rAsomq.js} +5 -5
  100. package/dist/chunks/{ToolPalette-3YpkSNfj.js.map → ToolPalette-W-rAsomq.js.map} +1 -1
  101. package/dist/chunks/{Tooltip-Di7vxbFa.js → Tooltip-Bq8Hvj4r.js} +1 -1
  102. package/dist/chunks/{Tooltip-Di7vxbFa.js.map → Tooltip-Bq8Hvj4r.js.map} +1 -1
  103. package/dist/chunks/icons-CdLHgzV8.js +144 -0
  104. package/dist/chunks/icons-CdLHgzV8.js.map +1 -0
  105. package/dist/chunks/{keyGlyph-D3X08tSp.js → keyGlyph-BLFMKZgF.js} +1 -1
  106. package/dist/chunks/{keyGlyph-D3X08tSp.js.map → keyGlyph-BLFMKZgF.js.map} +1 -1
  107. package/dist/chunks/{number-llMRJPJW.js → number-D3TDawLC.js} +1 -1
  108. package/dist/chunks/{number-llMRJPJW.js.map → number-D3TDawLC.js.map} +1 -1
  109. package/dist/chunks/{segmentedControl.module-YXqIjnmu.js → segmentedControl.module-XADeq9e5.js} +1 -1
  110. package/dist/chunks/{segmentedControl.module-YXqIjnmu.js.map → segmentedControl.module-XADeq9e5.js.map} +1 -1
  111. package/dist/chunks/{useReorderDragList-RSJqj18B.js → useReorderDragList-nQMVwNBd.js} +1 -1
  112. package/dist/chunks/{useReorderDragList-RSJqj18B.js.map → useReorderDragList-nQMVwNBd.js.map} +1 -1
  113. package/dist/chunks/{useRovingTabIndex-CuUl6DLF.js → useRovingTabIndex-ByjY4lnw.js} +1 -1
  114. package/dist/chunks/{useRovingTabIndex-CuUl6DLF.js.map → useRovingTabIndex-ByjY4lnw.js.map} +1 -1
  115. package/dist/components/ActionBar/index.js +1 -1
  116. package/dist/components/ActionsBar/index.js +1 -1
  117. package/dist/components/Badge/index.js +1 -1
  118. package/dist/components/BandEditor/index.js +1 -1
  119. package/dist/components/Button/index.js +1 -1
  120. package/dist/components/Callout/Callout.d.ts +3 -3
  121. package/dist/components/Callout/index.js +1 -1
  122. package/dist/components/Checkbox/index.js +1 -1
  123. package/dist/components/ColorField/index.js +1 -1
  124. package/dist/components/ComboBox/index.js +1 -1
  125. package/dist/components/CurveEditor/index.js +1 -1
  126. package/dist/components/DataGrid/index.js +1 -1
  127. package/dist/components/DetentSlider/DetentSlider.d.ts +52 -0
  128. package/dist/components/DetentSlider/DetentSlider.d.ts.map +1 -0
  129. package/dist/components/DetentSlider/index.d.ts +3 -0
  130. package/dist/components/DetentSlider/index.d.ts.map +1 -0
  131. package/dist/components/DetentSlider/index.js +2 -0
  132. package/dist/components/Dialog/index.js +1 -1
  133. package/dist/components/DragHandleGlyph/index.js +1 -1
  134. package/dist/components/Field/index.js +1 -1
  135. package/dist/components/FontFamilySelect/FontFamilySelect.d.ts +15 -0
  136. package/dist/components/FontFamilySelect/FontFamilySelect.d.ts.map +1 -0
  137. package/dist/components/FontFamilySelect/index.d.ts +3 -0
  138. package/dist/components/FontFamilySelect/index.d.ts.map +1 -0
  139. package/dist/components/FontFamilySelect/index.js +2 -0
  140. package/dist/components/GradientEditor/index.js +1 -1
  141. package/dist/components/InlineRange/index.js +1 -1
  142. package/dist/components/Input/index.js +1 -1
  143. package/dist/components/ItemList/ItemList.d.ts +45 -0
  144. package/dist/components/ItemList/ItemList.d.ts.map +1 -0
  145. package/dist/components/ItemList/index.d.ts +3 -0
  146. package/dist/components/ItemList/index.d.ts.map +1 -0
  147. package/dist/components/ItemList/index.js +2 -0
  148. package/dist/components/Keycaps/index.js +2 -2
  149. package/dist/components/LayerStack/index.js +1 -1
  150. package/dist/components/NumberField/index.js +1 -1
  151. package/dist/components/OptionsBar/index.js +1 -1
  152. package/dist/components/PaintInput/index.js +1 -1
  153. package/dist/components/PatternPicker/index.js +1 -1
  154. package/dist/components/Plot2D/index.js +1 -1
  155. package/dist/components/PointPlotter/index.js +1 -1
  156. package/dist/components/Powerline/index.js +2 -2
  157. package/dist/components/Prefs/index.js +1 -1
  158. package/dist/components/Properties/PropertyPanel.d.ts +21 -7
  159. package/dist/components/Properties/PropertyPanel.d.ts.map +1 -1
  160. package/dist/components/Properties/index.js +1 -1
  161. package/dist/components/RadioGroup/index.js +1 -1
  162. package/dist/components/RangeSlider/RangeSlider.d.ts +2 -2
  163. package/dist/components/RangeSlider/index.js +1 -1
  164. package/dist/components/ResizeHandle/index.js +1 -1
  165. package/dist/components/Select/index.js +1 -1
  166. package/dist/components/SelectionPanel/SelectionPanel.d.ts.map +1 -1
  167. package/dist/components/SelectionPanel/index.js +1 -1
  168. package/dist/components/Sidebar/index.js +1 -1
  169. package/dist/components/SidebarPanel/SidebarPanel.d.ts.map +1 -1
  170. package/dist/components/SidebarPanel/index.js +1 -1
  171. package/dist/components/Slider/Slider.d.ts +16 -1
  172. package/dist/components/Slider/Slider.d.ts.map +1 -1
  173. package/dist/components/Slider/index.js +1 -1
  174. package/dist/components/StatusBar/index.js +1 -1
  175. package/dist/components/Switch/index.js +1 -1
  176. package/dist/components/Tabs/index.js +1 -1
  177. package/dist/components/Timeline/AnimatedTimeline.d.ts +15 -0
  178. package/dist/components/Timeline/AnimatedTimeline.d.ts.map +1 -0
  179. package/dist/components/Timeline/EasingPicker.d.ts +8 -0
  180. package/dist/components/Timeline/EasingPicker.d.ts.map +1 -0
  181. package/dist/components/Timeline/Lane.d.ts +28 -0
  182. package/dist/components/Timeline/Lane.d.ts.map +1 -0
  183. package/dist/components/Timeline/Ruler.d.ts +12 -0
  184. package/dist/components/Timeline/Ruler.d.ts.map +1 -0
  185. package/dist/components/Timeline/Timeline.d.ts +39 -0
  186. package/dist/components/Timeline/Timeline.d.ts.map +1 -0
  187. package/dist/components/Timeline/Transport.d.ts +14 -0
  188. package/dist/components/Timeline/Transport.d.ts.map +1 -0
  189. package/dist/components/Timeline/easingSpec.d.ts +16 -0
  190. package/dist/components/Timeline/easingSpec.d.ts.map +1 -0
  191. package/dist/components/Timeline/index.d.ts +11 -0
  192. package/dist/components/Timeline/index.d.ts.map +1 -0
  193. package/dist/components/Timeline/index.js +2 -0
  194. package/dist/components/Timeline/keys.d.ts +34 -0
  195. package/dist/components/Timeline/keys.d.ts.map +1 -0
  196. package/dist/components/Timeline/lanes.d.ts +24 -0
  197. package/dist/components/Timeline/lanes.d.ts.map +1 -0
  198. package/dist/components/Timeline/timeScale.d.ts +31 -0
  199. package/dist/components/Timeline/timeScale.d.ts.map +1 -0
  200. package/dist/components/Toast/index.js +1 -1
  201. package/dist/components/ToggleBar/index.js +1 -1
  202. package/dist/components/ToolButton/index.js +1 -1
  203. package/dist/components/ToolGroup/index.js +1 -1
  204. package/dist/components/ToolOptionsBar/index.js +1 -1
  205. package/dist/components/ToolPalette/index.js +1 -1
  206. package/dist/components/Tooltip/index.js +1 -1
  207. package/dist/icons/index.d.ts +3 -1
  208. package/dist/icons/index.d.ts.map +1 -1
  209. package/dist/icons/paths.d.ts +2 -0
  210. package/dist/icons/paths.d.ts.map +1 -1
  211. package/dist/index.d.ts +4 -0
  212. package/dist/index.d.ts.map +1 -1
  213. package/dist/index.js +62 -189
  214. package/dist/index.js.map +1 -1
  215. package/dist/style.css +1 -1
  216. package/package.json +5 -4
  217. package/dist/chunks/Callout-CxDNb9iE.js.map +0 -1
  218. package/dist/chunks/PaintInput-K5W4Uho3.js.map +0 -1
  219. package/dist/chunks/Properties-BRrWSBHM.js.map +0 -1
  220. package/dist/chunks/RangeSlider-CJfhxDn6.js.map +0 -1
  221. package/dist/chunks/SelectionPanel-D2IYlj_K.js +0 -446
  222. package/dist/chunks/SelectionPanel-D2IYlj_K.js.map +0 -1
  223. package/dist/chunks/SidebarPanel-Dbqb79Kx.js +0 -59
  224. package/dist/chunks/SidebarPanel-Dbqb79Kx.js.map +0 -1
  225. package/dist/chunks/Slider-DbOt9Dji.js.map +0 -1
@@ -0,0 +1,561 @@
1
+ import { n as e, t } from "./Icon-CxoJb_bw.js";
2
+ import { t as n } from "./ToggleBar-D0veW91s.js";
3
+ import { t as r } from "./InlineRange-mb19EGOI.js";
4
+ import { t as i } from "./ColorField-CKbnsEUN.js";
5
+ import { t as a } from "./PaintInput-CgZR3B0r.js";
6
+ import { t as o } from "./Input-DRUeowbz.js";
7
+ import { t as s } from "./NumberField-CQ7OJORF.js";
8
+ import { t as c } from "./Select-g8PhE010.js";
9
+ import { t as l } from "./Switch-QviBb61l.js";
10
+ import { t as u } from "./FontFamilySelect-DwkwRYrr.js";
11
+ import { Fragment as d, jsx as f, jsxs as p } from "react/jsx-runtime";
12
+ import { MIXED as m, asNodeId as h, isBuiltinToolPref as g } from "@weasel-js/core";
13
+ import { Fragment as _, useState as v, useSyncExternalStore as y } from "react";
14
+ //#region src/components/SelectionPanel/model.ts
15
+ function b(e, t) {
16
+ if (e.kind === "container") return "group";
17
+ for (let n of t) if (n.matches(e.data)) return n.name;
18
+ return "unknown";
19
+ }
20
+ function x(e) {
21
+ return !("kind" in e);
22
+ }
23
+ function S(e) {
24
+ let t = [], n = [], r = (e, t) => {
25
+ for (let [n, i] of Object.entries(e.children)) x(i) ? r(i, t) : t.push({
26
+ path: n,
27
+ leaf: i
28
+ });
29
+ };
30
+ for (let [i, a] of Object.entries(e.children)) if (x(a)) {
31
+ let e = [];
32
+ r(a, e), t.push({
33
+ key: i,
34
+ name: a.name,
35
+ rows: C(e)
36
+ });
37
+ } else n.push({
38
+ path: i,
39
+ leaf: a
40
+ });
41
+ return n.length > 0 && t.unshift({
42
+ key: "",
43
+ name: "",
44
+ rows: C(n)
45
+ }), t;
46
+ }
47
+ function C(e) {
48
+ let t = [];
49
+ for (let n of e) {
50
+ let e = n.leaf.pair, r = t[t.length - 1];
51
+ e !== void 0 && r !== void 0 && r.label === e ? r.leaves.push(n) : t.push({
52
+ label: e ?? n.leaf.name,
53
+ leaves: [n]
54
+ });
55
+ }
56
+ return t;
57
+ }
58
+ function w(e, t) {
59
+ let n = [...new Set(e)];
60
+ if (n.length === 0) return [];
61
+ let r = new Map(t.map((e) => [e.name, e])), i = n.map((e) => r.get(e)?.schema);
62
+ if (i.some((e) => e === void 0)) return [];
63
+ let [a, ...o] = i, s = S(a);
64
+ if (o.length === 0) return s;
65
+ 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)));
66
+ return s.map((e) => ({
67
+ ...e,
68
+ rows: e.rows.map((e) => ({
69
+ ...e,
70
+ leaves: e.leaves.filter(u)
71
+ })).filter((e) => e.leaves.length > 0)
72
+ })).filter((e) => e.rows.length > 0);
73
+ }
74
+ function T(e, t) {
75
+ let n = t.split(".");
76
+ if (n.length < 2) return;
77
+ let r = n[0], i = r === "pose" ? e.pose : r === "data" ? e.data : void 0;
78
+ for (let e = 1; e < n.length; e++) {
79
+ if (typeof i != "object" || !i) return;
80
+ i = i[n[e]];
81
+ }
82
+ return i;
83
+ }
84
+ function E(e, t, n) {
85
+ let [r, ...i] = t;
86
+ if (i.length === 0) return Array.isArray(e) ? Object.assign([...e], { [r]: n }) : {
87
+ ...e,
88
+ [r]: n
89
+ };
90
+ let a = e[r], o = E(Array.isArray(a) ? [...a] : typeof a == "object" && a ? { ...a } : {}, i, n);
91
+ return Array.isArray(e) ? Object.assign([...e], { [r]: o }) : {
92
+ ...e,
93
+ [r]: o
94
+ };
95
+ }
96
+ function D(e, t) {
97
+ let n, r = !0;
98
+ for (let i of e) {
99
+ let e = T(i, t);
100
+ if (r) n = e, r = !1;
101
+ else if (!Object.is(e, n)) return m;
102
+ }
103
+ return n;
104
+ }
105
+ function O(e) {
106
+ let t = /* @__PURE__ */ new Map();
107
+ for (let n of e) t.set(n, (t.get(n) ?? 0) + 1);
108
+ return [...t.entries()].map(([e, t]) => t > 1 ? `${e} ×${t}` : e).join(" · ");
109
+ }
110
+ var k = {
111
+ root: "_root_q9h3j_1",
112
+ header: "_header_q9h3j_8",
113
+ kind: "_kind_q9h3j_16",
114
+ breakdown: "_breakdown_q9h3j_21",
115
+ section: "_section_q9h3j_26",
116
+ sectionTitle: "_sectionTitle_q9h3j_35",
117
+ row: "_row_q9h3j_44",
118
+ rowLabel: "_rowLabel_q9h3j_52",
119
+ rowControls: "_rowControls_q9h3j_56",
120
+ namedField: "_namedField_q9h3j_66",
121
+ blockRow: "_blockRow_q9h3j_78",
122
+ toggle: "_toggle_q9h3j_89",
123
+ flagToggle: "_flagToggle_q9h3j_111",
124
+ number: "_number_q9h3j_115",
125
+ select: "_select_q9h3j_116",
126
+ unitSuffix: "_unitSuffix_q9h3j_120",
127
+ mixedSwitch: "_mixedSwitch_q9h3j_126",
128
+ unrenderable: "_unrenderable_q9h3j_130",
129
+ objectLeaf: "_objectLeaf_q9h3j_137",
130
+ objectGroup: "_objectGroup_q9h3j_146",
131
+ slider: "_slider_q9h3j_153",
132
+ sliderReadout: "_sliderReadout_q9h3j_157"
133
+ }, A = (e) => e.length === 0 ? e : e[0].toUpperCase() + e.slice(1);
134
+ function j(e) {
135
+ let { scene: t, selection: n, properties: r, routing: i, renderers: a, kindLabel: o = A, emptyState: s = null, className: c } = e;
136
+ y(t.subscribe, t.getVersion, t.getVersion);
137
+ let l = n.current.map((e) => t.get(h(e))).filter((e) => e != null), u = l.map((e) => b(e, i)), m = l.map((e) => e.id).join(","), g = w(u, r);
138
+ if (l.length === 0) return /* @__PURE__ */ f("div", {
139
+ className: [k.root, c].filter(Boolean).join(" "),
140
+ children: s
141
+ });
142
+ let v = (e, r) => {
143
+ let [i, ...a] = e.path.split(".");
144
+ if (a.length === 0) return;
145
+ let o = n.current.map(h);
146
+ t.batch(`Edit ${e.leaf.name}`, () => {
147
+ for (let e of o) {
148
+ let n = t.get(e);
149
+ n && (i === "pose" ? t.setPose(e, E(n.pose, a, r)) : i === "data" && t.update(e, { data: E(n.data, a, r) }));
150
+ }
151
+ });
152
+ };
153
+ return /* @__PURE__ */ p("div", {
154
+ className: [k.root, c].filter(Boolean).join(" "),
155
+ children: [/* @__PURE__ */ f("header", {
156
+ className: k.header,
157
+ children: l.length === 1 ? /* @__PURE__ */ f("span", {
158
+ className: k.kind,
159
+ children: o(u[0])
160
+ }) : /* @__PURE__ */ p(d, { children: [/* @__PURE__ */ p("span", {
161
+ className: k.kind,
162
+ children: [l.length, " selected"]
163
+ }), /* @__PURE__ */ f("span", {
164
+ className: k.breakdown,
165
+ children: O(u)
166
+ })] })
167
+ }), g.map((e) => {
168
+ let t = e.rows.map((e) => ({
169
+ row: e,
170
+ controls: P(e.leaves.map((t) => M(t, e.leaves.length > 1 ? `${e.label} ${t.leaf.name}` : t.leaf.name, l, a, v, m)), a)
171
+ })).filter(({ controls: e }) => e.length > 0);
172
+ return t.length === 0 ? null : /* @__PURE__ */ p("section", {
173
+ className: k.section,
174
+ children: [e.name !== "" && /* @__PURE__ */ f("h3", {
175
+ className: k.sectionTitle,
176
+ children: e.name
177
+ }), t.map(({ row: t, controls: n }) => t.leaves.length === 1 && t.leaves[0].leaf.block ? /* @__PURE__ */ p("div", { children: [e.name === "" && t.leaves[0].leaf.kind !== "object" && /* @__PURE__ */ f("h4", {
178
+ className: k.sectionTitle,
179
+ title: t.leaves[0].leaf.description,
180
+ children: t.leaves[0].leaf.name
181
+ }), n[0].content] }, t.leaves[0].path) : /* @__PURE__ */ p("div", {
182
+ className: k.row,
183
+ children: [/* @__PURE__ */ f("span", {
184
+ className: k.rowLabel,
185
+ title: t.leaves[0].leaf.description,
186
+ children: t.label
187
+ }), /* @__PURE__ */ f("span", {
188
+ className: k.rowControls,
189
+ children: n.map(({ key: e, content: t }) => /* @__PURE__ */ f(_, { children: t }, e))
190
+ })]
191
+ }, t.leaves[0].path))]
192
+ }, e.key);
193
+ })]
194
+ });
195
+ }
196
+ function M(e, t, n, r, i, a) {
197
+ let { path: o, leaf: s } = e, c = D(n, o), l = c === m, u = {
198
+ path: o,
199
+ pref: s,
200
+ value: l ? void 0 : c,
201
+ mixed: l,
202
+ unset: !l && c === void 0,
203
+ setValue: (t) => i(e, t),
204
+ valueAt: (e) => {
205
+ let t = D(n, e);
206
+ return t === m ? {
207
+ value: void 0,
208
+ mixed: !0
209
+ } : {
210
+ value: t,
211
+ mixed: !1
212
+ };
213
+ }
214
+ };
215
+ return {
216
+ key: o,
217
+ leaf: s,
218
+ ctx: u,
219
+ ariaLabel: t,
220
+ render: () => {
221
+ let e = r?.[o] ?? r?.[s.kind];
222
+ return e ? e(u) : I(u, t, r, a);
223
+ }
224
+ };
225
+ }
226
+ function N(e, t) {
227
+ let { leaf: n } = e;
228
+ return n.kind === "boolean" && n.control === "toggle" && n.pair !== void 0 && t?.[e.ctx.path] === void 0 && t?.[n.kind] === void 0;
229
+ }
230
+ function P(e, t) {
231
+ let n = [];
232
+ for (let r = 0; r < e.length;) {
233
+ let i = e[r];
234
+ if (!N(i, t)) {
235
+ let e = i.render();
236
+ e != null && n.push({
237
+ key: i.key,
238
+ leaf: i.leaf,
239
+ block: i.leaf.block === !0,
240
+ content: e
241
+ }), r += 1;
242
+ continue;
243
+ }
244
+ let a = r + 1;
245
+ for (; a < e.length && N(e[a], t) && e[a].leaf.pair === i.leaf.pair;) a += 1;
246
+ let o = e.slice(r, a);
247
+ n.push({
248
+ key: i.key,
249
+ leaf: i.leaf,
250
+ block: o.every((e) => e.leaf.block === !0),
251
+ content: /* @__PURE__ */ f(F, {
252
+ run: o,
253
+ ariaLabel: i.leaf.pair
254
+ })
255
+ }), r = a;
256
+ }
257
+ return n;
258
+ }
259
+ function F({ run: r, ariaLabel: i }) {
260
+ let a = r.filter((e) => e.ctx.value === !0).map((e) => e.key);
261
+ return /* @__PURE__ */ f(n, {
262
+ mode: "multiple",
263
+ size: "sm",
264
+ variant: "flat",
265
+ className: k.flagToggle,
266
+ ariaLabel: i,
267
+ items: r.map((n) => {
268
+ let r = n.leaf;
269
+ return {
270
+ value: n.key,
271
+ label: r.icon && r.icon in e ? /* @__PURE__ */ f(t, {
272
+ name: r.icon,
273
+ size: 14
274
+ }) : r.short ?? r.name.slice(0, 1),
275
+ ariaLabel: n.ariaLabel
276
+ };
277
+ }),
278
+ value: a,
279
+ mixedValues: r.filter((e) => e.ctx.mixed).map((e) => e.key),
280
+ onChange: (e) => {
281
+ for (let t of r) {
282
+ let n = e.includes(t.key);
283
+ n !== a.includes(t.key) && t.ctx.setValue(n);
284
+ }
285
+ }
286
+ });
287
+ }
288
+ function I(o, m, h, _ = "", v = !1) {
289
+ let { pref: y, value: b, mixed: x, unset: S, setValue: C } = o;
290
+ if (y.kind === "font-family") {
291
+ let e = o.valueAt("data.style.fontWeight"), t = o.valueAt("data.style.fontStyle");
292
+ return /* @__PURE__ */ f(u, {
293
+ className: k.select,
294
+ value: x || typeof b != "string" ? void 0 : b,
295
+ mixed: x,
296
+ onChange: C,
297
+ weight: typeof e.value == "number" ? e.value : void 0,
298
+ fontStyle: t.value === "italic" ? "italic" : void 0,
299
+ "aria-label": m
300
+ });
301
+ }
302
+ if (!g(y)) return /* @__PURE__ */ p("span", {
303
+ className: k.unrenderable,
304
+ children: [
305
+ "(",
306
+ y.kind,
307
+ ": no renderer)"
308
+ ]
309
+ });
310
+ switch (y.kind) {
311
+ case "number": {
312
+ let e = y, t = typeof b == "number" && Number.isFinite(b) ? b : void 0, n = t === void 0 ? NaN : e.unit ? e.unit.toDisplay(t) : t;
313
+ if (e.control === "slider") {
314
+ let i = e.min ?? 0, a = e.max ?? 100, o = !x && t !== void 0;
315
+ return /* @__PURE__ */ p(d, { children: [/* @__PURE__ */ f(r, {
316
+ min: i,
317
+ max: a,
318
+ step: e.step ?? 1,
319
+ value: o ? Math.min(Math.max(n, i), a) : i,
320
+ disabled: x,
321
+ className: k.slider,
322
+ "aria-label": m,
323
+ onChange: (t) => {
324
+ let n = Number(t.target.value);
325
+ C(e.unit ? e.unit.fromDisplay(n) : n);
326
+ }
327
+ }), /* @__PURE__ */ f("span", {
328
+ className: k.sliderReadout,
329
+ "aria-hidden": "true",
330
+ children: o ? `${n}${e.unit?.suffix ?? ""}` : "—"
331
+ })] });
332
+ }
333
+ let i = /* @__PURE__ */ f(s, {
334
+ className: k.number,
335
+ value: x || t === void 0 ? NaN : n,
336
+ placeholder: x ? "Mixed" : void 0,
337
+ minValue: e.min,
338
+ maxValue: e.max,
339
+ step: e.step ?? 1,
340
+ hideSteppers: !0,
341
+ "aria-label": m,
342
+ onChange: (t) => {
343
+ Number.isNaN(t) || C(e.unit ? e.unit.fromDisplay(t) : t);
344
+ }
345
+ });
346
+ return e.unit?.suffix === void 0 ? i : /* @__PURE__ */ p(d, { children: [i, /* @__PURE__ */ f("span", {
347
+ className: k.unitSuffix,
348
+ "aria-hidden": "true",
349
+ children: e.unit.suffix
350
+ })] });
351
+ }
352
+ case "string": return /* @__PURE__ */ f(R, {
353
+ text: x ? void 0 : typeof b == "string" ? b : "",
354
+ placeholder: x ? "Mixed" : void 0,
355
+ ariaLabel: m,
356
+ onCommit: C
357
+ });
358
+ case "boolean": {
359
+ let r = y;
360
+ if (r.control === "toggle") return /* @__PURE__ */ f(n, {
361
+ mode: "multiple",
362
+ size: "sm",
363
+ variant: "flat",
364
+ className: k.flagToggle,
365
+ ariaLabel: m,
366
+ items: [{
367
+ value: o.path,
368
+ label: r.icon && r.icon in e ? /* @__PURE__ */ f(t, {
369
+ name: r.icon,
370
+ size: 14
371
+ }) : r.short ?? r.name.slice(0, 1),
372
+ ariaLabel: m
373
+ }],
374
+ value: b === !0 ? [o.path] : [],
375
+ mixedValues: x ? [o.path] : [],
376
+ onChange: (e) => C(e.includes(o.path))
377
+ });
378
+ let i = /* @__PURE__ */ f(l, {
379
+ isSelected: !!b,
380
+ onChange: C,
381
+ "aria-label": m
382
+ });
383
+ return !x && !S ? i : /* @__PURE__ */ f("span", {
384
+ className: k.mixedSwitch,
385
+ title: x ? "Mixed" : "Not set",
386
+ children: i
387
+ });
388
+ }
389
+ case "enum": {
390
+ let r = y, i = r.encoding ? x ? void 0 : r.encoding.read(b, o.siblings) : x || S ? void 0 : typeof b == "string" ? b : r.default, a = (e) => C(r.encoding ? r.encoding.write(e, o.siblings) : e);
391
+ return r.control === "toggle" ? /* @__PURE__ */ f(n, {
392
+ size: "sm",
393
+ variant: "flat",
394
+ className: k.toggle,
395
+ ariaLabel: m,
396
+ items: r.options.map((n) => ({
397
+ value: n.value,
398
+ label: n.icon && n.icon in e ? /* @__PURE__ */ f(t, {
399
+ name: n.icon,
400
+ size: 14
401
+ }) : n.short ?? n.label,
402
+ ariaLabel: n.label,
403
+ disabled: n.disabled
404
+ })),
405
+ value: i ?? null,
406
+ onChange: (e) => {
407
+ e !== null && a(e);
408
+ }
409
+ }) : /* @__PURE__ */ f(c, {
410
+ className: k.select,
411
+ options: r.options.map((e) => ({
412
+ value: e.value,
413
+ label: e.label,
414
+ isDisabled: e.disabled
415
+ })),
416
+ selectedKey: i ?? null,
417
+ placeholder: x ? "Mixed" : S ? "—" : void 0,
418
+ onSelectionChange: a,
419
+ "aria-label": m
420
+ });
421
+ }
422
+ case "color": {
423
+ let e = y;
424
+ return /* @__PURE__ */ f(i, {
425
+ value: x ? void 0 : typeof b == "string" ? b : e.default,
426
+ mixed: x,
427
+ alpha: e.alpha,
428
+ onChange: C,
429
+ "aria-label": m
430
+ });
431
+ }
432
+ case "paint": return /* @__PURE__ */ f(a, {
433
+ value: b === null ? null : b ?? (x ? void 0 : y.default),
434
+ mixed: x,
435
+ unset: S,
436
+ allowNone: !v,
437
+ onChange: C,
438
+ "aria-label": m
439
+ }, _);
440
+ case "object": return /* @__PURE__ */ f(L, {
441
+ ctx: o,
442
+ renderers: h,
443
+ selectionKey: _
444
+ });
445
+ default: throw Error(`SelectionPanel: no control for built-in pref kind "${y.kind}"`);
446
+ }
447
+ }
448
+ function L({ ctx: n, renderers: r, selectionKey: i = "" }) {
449
+ let a = n.pref, o = typeof n.value == "object" && n.value !== null ? n.value : void 0, s = Object.values(a.children).every((e) => !("kind" in e)), c = (s, l) => {
450
+ let u = [], d = (e) => typeof e == "object" && !!e && "controls" in e, m = [], h = () => {
451
+ for (let { key: e, leaf: t, block: n, content: i } of P(m, r)) {
452
+ let r = u[u.length - 1];
453
+ if (t.pair !== void 0 && d(r) && r.pair === t.pair) {
454
+ r.controls.push(/* @__PURE__ */ f(_, { children: i }, e)), r.block &&= n;
455
+ continue;
456
+ }
457
+ u.push({
458
+ key: e,
459
+ pair: t.pair,
460
+ label: t.pair ?? t.name,
461
+ title: t.description,
462
+ block: n,
463
+ controls: [/* @__PURE__ */ f(_, { children: i }, e)]
464
+ });
465
+ }
466
+ m = [];
467
+ };
468
+ for (let [d, g] of Object.entries(s)) {
469
+ if (!("kind" in g)) {
470
+ let e = g.name !== "", t = c(g.children, e);
471
+ if (t.length === 0) continue;
472
+ h(), u.push(/* @__PURE__ */ p("div", {
473
+ className: e && l ? k.objectGroup : void 0,
474
+ children: [e && /* @__PURE__ */ f("h5", {
475
+ className: k.sectionTitle,
476
+ children: g.name
477
+ }), t]
478
+ }, `group:${d}`));
479
+ continue;
480
+ }
481
+ let s = `${n.path}.${d}`, _ = {
482
+ path: s,
483
+ pref: g,
484
+ value: o?.[d],
485
+ mixed: n.mixed,
486
+ unset: !n.mixed && o?.[d] === void 0,
487
+ siblings: o,
488
+ valueAt: n.valueAt,
489
+ setValue: (e) => {
490
+ let t = o ?? a.fromScalar?.(n.value) ?? (typeof a.default == "object" && a.default !== null ? { ...a.default } : {});
491
+ if (e === void 0) {
492
+ let { [d]: e, ...r } = t;
493
+ n.setValue(r);
494
+ return;
495
+ }
496
+ n.setValue({
497
+ ...t,
498
+ [d]: e
499
+ });
500
+ }
501
+ };
502
+ m.push({
503
+ key: s,
504
+ leaf: g,
505
+ ctx: _,
506
+ ariaLabel: g.name,
507
+ render: () => {
508
+ let n = r?.[s] ?? r?.[g.kind], a = n ? n(_) : I(_, g.name, r, i, !0);
509
+ return a == null ? null : (g.pair !== void 0 || g.block === !0) && g.icon && g.icon in e ? /* @__PURE__ */ p("span", {
510
+ className: k.namedField,
511
+ children: [/* @__PURE__ */ f(t, {
512
+ name: g.icon,
513
+ size: 14
514
+ }), a]
515
+ }) : a;
516
+ }
517
+ });
518
+ }
519
+ return h(), u.map((e) => typeof e == "object" && e && "controls" in e ? e.block ? /* @__PURE__ */ f("div", {
520
+ className: `${k.rowControls} ${k.blockRow}`,
521
+ title: e.title,
522
+ children: e.controls
523
+ }, e.key) : /* @__PURE__ */ p("div", {
524
+ className: k.row,
525
+ children: [/* @__PURE__ */ f("span", {
526
+ className: k.rowLabel,
527
+ title: e.title,
528
+ children: e.label
529
+ }), /* @__PURE__ */ f("span", {
530
+ className: k.rowControls,
531
+ children: e.controls
532
+ })]
533
+ }, e.key) : e);
534
+ }, l = c(a.children, !s);
535
+ return l.length === 0 ? null : /* @__PURE__ */ p("div", {
536
+ className: k.objectLeaf,
537
+ children: [!s && /* @__PURE__ */ f("h4", {
538
+ className: k.sectionTitle,
539
+ children: a.name
540
+ }), l]
541
+ });
542
+ }
543
+ function R({ text: e, placeholder: t, ariaLabel: n, onCommit: r }) {
544
+ let [i, a] = v(null);
545
+ return /* @__PURE__ */ f(o, {
546
+ value: i ?? e ?? "",
547
+ placeholder: t,
548
+ "aria-label": n,
549
+ onChange: a,
550
+ onBlur: () => {
551
+ i !== null && i !== e && r(i), a(null);
552
+ },
553
+ onKeyDown: (e) => {
554
+ e.key === "Enter" && e.target.blur();
555
+ }
556
+ });
557
+ }
558
+ //#endregion
559
+ export { w as a, E as c, b as i, m as n, O as o, D as r, T as s, j as t };
560
+
561
+ //# sourceMappingURL=SelectionPanel-Cl18SdD6.js.map