@esportsplus/ui 0.62.0 → 0.64.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 (543) hide show
  1. package/.audit/audit.json +4 -92
  2. package/.audit/rules-audit.md +4 -18
  3. package/README.md +15 -18
  4. package/RULES.md +80 -9
  5. package/bin/agent-cli +300 -0
  6. package/build/components/accordion/index.d.ts +4 -0
  7. package/build/components/accordion/index.js +13 -10
  8. package/build/components/breadcrumb/index.d.ts +1 -0
  9. package/build/components/breadcrumb/index.js +43 -37
  10. package/build/components/breadcrumb/scss/index.scss +1 -1
  11. package/build/components/button/kbd.d.ts +1 -1
  12. package/build/components/button/kbd.js +17 -15
  13. package/build/components/button/scss/index.scss +1 -1
  14. package/build/components/button/split.js +14 -16
  15. package/build/components/capslock/scss/index.scss +1 -1
  16. package/build/components/card/scss/index.scss +1 -1
  17. package/build/components/chat/minimap/index.js +4 -5
  18. package/build/components/checkbox/group.d.ts +1 -0
  19. package/build/components/checkbox/group.js +21 -20
  20. package/build/components/checkbox/scss/index.scss +1 -1
  21. package/build/components/color-picker/index.js +6 -6
  22. package/build/components/color-picker/scss/index.scss +1 -1
  23. package/build/components/command/index.d.ts +1 -1
  24. package/build/components/command/palette.d.ts +13 -9
  25. package/build/components/command/palette.js +143 -152
  26. package/build/components/command/scss/index.scss +1 -1
  27. package/build/components/command/search.d.ts +5 -7
  28. package/build/components/command/search.js +6 -26
  29. package/build/components/counter/scss/index.scss +1 -1
  30. package/build/components/editor/code/commands.js +1 -1
  31. package/build/components/editor/code/document.d.ts +1 -3
  32. package/build/components/editor/code/document.js +1 -1
  33. package/build/components/editor/code/editor.d.ts +18 -6
  34. package/build/components/editor/code/editor.js +9 -7
  35. package/build/components/editor/code/features.js +27 -18
  36. package/build/components/editor/code/find.d.ts +1 -1
  37. package/build/components/editor/code/find.js +5 -6
  38. package/build/components/editor/code/folding.d.ts +3 -5
  39. package/build/components/editor/code/folding.js +2 -15
  40. package/build/components/editor/code/gutter.js +2 -2
  41. package/build/components/editor/code/index.d.ts +1 -0
  42. package/build/components/editor/code/index.js +1 -0
  43. package/build/components/editor/code/minimap.d.ts +3 -1
  44. package/build/components/editor/code/minimap.js +31 -5
  45. package/build/components/editor/code/services/model.js +2 -1
  46. package/build/components/editor/code/syntax.js +2 -1
  47. package/build/components/editor/code/view.d.ts +8 -2
  48. package/build/components/editor/code/view.js +37 -56
  49. package/build/components/editor/diffs/index.d.ts +1 -0
  50. package/build/components/editor/diffs/index.js +1 -0
  51. package/build/components/editor/diffs/merge.js +16 -17
  52. package/build/components/editor/diffs/view.js +10 -11
  53. package/build/components/editor/markdown/editing.d.ts +2 -1
  54. package/build/components/editor/markdown/editing.js +14 -5
  55. package/build/components/editor/markdown/format.d.ts +1 -1
  56. package/build/components/editor/markdown/format.js +116 -26
  57. package/build/components/editor/markdown/layout.js +2 -1
  58. package/build/components/editor/markdown/model.d.ts +1 -2
  59. package/build/components/editor/markdown/model.js +1 -29
  60. package/build/components/editor/markdown/render.js +1 -1
  61. package/build/components/editor/markdown/template.d.ts +3 -10
  62. package/build/components/editor/markdown/template.js +2 -29
  63. package/build/components/editor/markdown/toolbar.d.ts +2 -2
  64. package/build/components/editor/markdown/toolbar.js +90 -126
  65. package/build/components/editor/markdown/view.d.ts +1 -1
  66. package/build/components/editor/markdown/view.js +54 -87
  67. package/build/components/editor/tree/drag.js +1 -1
  68. package/build/components/editor/tree/find.js +70 -64
  69. package/build/components/editor/tree/template.js +8 -7
  70. package/build/components/editor/viewer/model.d.ts +1 -1
  71. package/build/components/editor/viewer/template.js +4 -26
  72. package/build/components/editor/workspace/keybindings.d.ts +1 -1
  73. package/build/components/editor/workspace/model.d.ts +12 -2
  74. package/build/components/editor/workspace/model.js +87 -31
  75. package/build/components/editor/workspace/session.d.ts +2 -6
  76. package/build/components/editor/workspace/session.js +99 -16
  77. package/build/components/editor/workspace/status.d.ts +1 -1
  78. package/build/components/editor/workspace/strip.d.ts +10 -9
  79. package/build/components/editor/workspace/strip.js +99 -141
  80. package/build/components/editor/workspace/tabs.d.ts +2 -4
  81. package/build/components/editor/workspace/tabs.js +1 -14
  82. package/build/components/editor/workspace/template.d.ts +1 -1
  83. package/build/components/editor/workspace/template.js +305 -435
  84. package/build/components/error/index.d.ts +4 -13
  85. package/build/components/error/index.js +53 -172
  86. package/build/components/error/scss/index.scss +1 -1
  87. package/build/components/form/action.d.ts +2 -2
  88. package/build/components/form/action.js +2 -2
  89. package/build/components/form/input.d.ts +3 -3
  90. package/build/components/form/input.js +32 -10
  91. package/build/components/frame/scss/index.scss +1 -1
  92. package/build/components/group/index.js +96 -9
  93. package/build/components/group/scss/index.scss +1 -1
  94. package/build/components/heatmap/scss/index.scss +1 -1
  95. package/build/components/highlight/index.js +55 -48
  96. package/build/components/highlight/scss/index.scss +1 -1
  97. package/build/components/icon/scss/index.scss +1 -1
  98. package/build/components/image/scss/index.scss +1 -1
  99. package/build/components/index.d.ts +3 -7
  100. package/build/components/index.js +3 -7
  101. package/build/components/inline-edit/index.d.ts +2 -2
  102. package/build/components/inline-edit/index.js +5 -5
  103. package/build/components/inline-edit/rich.js +4 -4
  104. package/build/components/inline-edit/scss/index.scss +1 -1
  105. package/build/components/inline-edit/status.js +1 -0
  106. package/build/components/input/index.d.ts +4 -0
  107. package/build/components/input/index.js +3 -1
  108. package/build/components/input/otp.d.ts +18 -0
  109. package/build/components/input/otp.js +112 -0
  110. package/build/components/input/password.d.ts +15 -0
  111. package/build/components/input/password.js +163 -0
  112. package/build/components/input/scrub.d.ts +1 -0
  113. package/build/components/input/scrub.js +103 -89
  114. package/build/components/input/scss/index.scss +1 -1
  115. package/build/components/input/tag.d.ts +5 -0
  116. package/build/components/input/tag.js +116 -69
  117. package/build/components/json/download.js +1 -1
  118. package/build/components/link/scss/index.scss +1 -1
  119. package/build/components/marquee/index.js +1 -1
  120. package/build/components/marquee/scss/index.scss +1 -1
  121. package/build/components/nav/scss/index.scss +1 -1
  122. package/build/components/nav/tree.d.ts +2 -1
  123. package/build/components/nav/tree.js +6 -5
  124. package/build/components/notification/index.js +3 -3
  125. package/build/components/notification/scss/index.scss +1 -1
  126. package/build/components/overlay/popup.d.ts +2 -2
  127. package/build/components/overlay/popup.js +1 -1
  128. package/build/components/overlay/scss/index.scss +1 -1
  129. package/build/components/pagination/arrows.js +2 -3
  130. package/build/components/pagination/cards.js +2 -3
  131. package/build/components/pagination/index.d.ts +2 -3
  132. package/build/components/pagination/index.js +18 -13
  133. package/build/components/pagination/scss/index.scss +1 -1
  134. package/build/components/progress/index.js +1 -1
  135. package/build/components/progress/scss/index.scss +1 -1
  136. package/build/components/progress/text.js +3 -3
  137. package/build/components/range/filter.d.ts +7 -1
  138. package/build/components/range/filter.js +188 -171
  139. package/build/components/range/index.d.ts +14 -9
  140. package/build/components/range/index.js +11 -8
  141. package/build/components/range/scss/index.scss +1 -1
  142. package/build/components/range/surface.d.ts +21 -0
  143. package/build/components/range/surface.js +144 -0
  144. package/build/components/relative-time/index.js +2 -2
  145. package/build/components/relative-time/scss/index.scss +1 -1
  146. package/build/components/root/scss/index.scss +1 -1
  147. package/build/components/{preview/header.d.ts → search/button.d.ts} +3 -3
  148. package/build/components/search/button.js +18 -0
  149. package/build/components/search/index.d.ts +8 -0
  150. package/build/components/search/index.js +5 -0
  151. package/build/components/search/input.d.ts +9 -0
  152. package/build/components/search/input.js +23 -0
  153. package/build/components/search/parts.d.ts +5 -0
  154. package/build/components/search/parts.js +17 -0
  155. package/build/components/search/scss/index.scss +2 -0
  156. package/build/components/select/expand.js +4 -5
  157. package/build/components/select/index.d.ts +7 -7
  158. package/build/components/select/index.js +127 -117
  159. package/build/components/select/placement.js +8 -1
  160. package/build/components/select/scss/index.scss +1 -1
  161. package/build/components/{panels → shell}/group.d.ts +21 -5
  162. package/build/components/shell/group.js +336 -0
  163. package/build/components/shell/index.d.ts +15 -17
  164. package/build/components/shell/index.js +583 -238
  165. package/build/components/shell/model.d.ts +94 -0
  166. package/build/components/{panels → shell}/model.js +199 -73
  167. package/build/components/shell/resize.d.ts +5 -0
  168. package/build/components/{panels → shell}/resize.js +54 -30
  169. package/build/components/shell/scss/index.scss +1 -1
  170. package/build/components/shell/sidebar.d.ts +34 -0
  171. package/build/components/shell/sidebar.js +362 -0
  172. package/build/components/{panels → shell}/subtree.js +7 -8
  173. package/build/components/shortcut-recorder/index.d.ts +5 -4
  174. package/build/components/shortcut-recorder/index.js +69 -44
  175. package/build/components/shortcut-recorder/scss/index.scss +1 -1
  176. package/build/components/sortable/index.d.ts +16 -2
  177. package/build/components/sortable/index.js +237 -134
  178. package/build/components/sortable/scss/index.scss +1 -1
  179. package/build/components/story/index.js +46 -34
  180. package/build/components/story/scss/index.scss +1 -1
  181. package/build/components/surface-field/engine.d.ts +2 -0
  182. package/build/components/surface-field/engine.js +86 -33
  183. package/build/components/surface-field/index.d.ts +26 -4
  184. package/build/components/surface-field/index.js +35 -4
  185. package/build/components/surface-field/scss/index.scss +1 -1
  186. package/build/components/surface-field/surface.d.ts +13 -1
  187. package/build/components/surface-field/surface.js +149 -58
  188. package/build/components/tasklist/index.d.ts +1 -4
  189. package/build/components/tasklist/index.js +36 -43
  190. package/build/components/tasklist/scss/index.scss +1 -1
  191. package/build/components/textarea/index.d.ts +1 -1
  192. package/build/components/textarea/index.js +14 -14
  193. package/build/components/theme/scss/index.scss +1 -1
  194. package/build/components/theme/shared.d.ts +1 -2
  195. package/build/components/theme/shared.js +2 -5
  196. package/build/components/toast/index.d.ts +3 -3
  197. package/build/components/toast/index.js +3 -3
  198. package/build/components/toast/scss/index.scss +1 -1
  199. package/build/components/toolbar/index.d.ts +91 -0
  200. package/build/components/toolbar/index.js +1281 -0
  201. package/build/components/toolbar/scss/index.scss +2 -0
  202. package/build/components/tooltip/menu.d.ts +9 -8
  203. package/build/components/tooltip/menu.js +397 -279
  204. package/build/components/tooltip/onclick.d.ts +2 -0
  205. package/build/components/tooltip/onclick.js +13 -4
  206. package/build/components/tooltip/onhover.d.ts +3 -1
  207. package/build/components/tooltip/onhover.js +10 -9
  208. package/build/components/tooltip/scss/index.scss +1 -1
  209. package/build/components/tooltip/shared.d.ts +4 -4
  210. package/build/components/tooltip/shared.js +27 -46
  211. package/build/components/tooltip/utilities.d.ts +5 -2
  212. package/build/components/tooltip/utilities.js +169 -9
  213. package/build/components/typewriter/rotate.js +6 -6
  214. package/build/components/typewriter/scss/index.scss +1 -1
  215. package/build/components/uptime/scss/index.scss +1 -1
  216. package/build/components/usage-meter/index.js +1 -1
  217. package/build/components/usage-meter/scss/index.scss +1 -1
  218. package/build/css-utilities/font/montserrat/OFL.txt +93 -0
  219. package/build/shared/drag.d.ts +15 -9
  220. package/build/shared/drag.js +41 -28
  221. package/build/shared/placement.d.ts +39 -0
  222. package/build/shared/placement.js +55 -0
  223. package/build/shared/transition.js +1 -1
  224. package/build/shared/viewport.d.ts +1 -2
  225. package/build/shared/viewport.js +1 -4
  226. package/package.json +9 -12
  227. package/src/components/accordion/index.ts +12 -5
  228. package/src/components/announcement/index.ts +1 -1
  229. package/src/components/breadcrumb/index.ts +13 -3
  230. package/src/components/breadcrumb/scss/index.scss +6 -6
  231. package/src/components/breadcrumb/scss/variables.scss +7 -0
  232. package/src/components/button/kbd.ts +22 -17
  233. package/src/components/button/scss/index.scss +69 -76
  234. package/src/components/button/scss/variables.scss +51 -18
  235. package/src/components/button/split.ts +12 -8
  236. package/src/components/capslock/index.ts +2 -0
  237. package/src/components/capslock/scss/index.scss +21 -21
  238. package/src/components/card/scss/index.scss +16 -0
  239. package/src/components/card/scss/variables.scss +25 -2
  240. package/src/components/chat/minimap/index.ts +5 -6
  241. package/src/components/chat/minimap/scss/index.scss +12 -11
  242. package/src/components/chat/minimap/scss/variables.scss +23 -17
  243. package/src/components/checkbox/group.ts +8 -7
  244. package/src/components/checkbox/scss/index.scss +59 -35
  245. package/src/components/checkbox/scss/variables.scss +24 -17
  246. package/src/components/color-picker/index.ts +6 -6
  247. package/src/components/color-picker/scss/index.scss +35 -22
  248. package/src/components/color-picker/scss/variables.scss +11 -3
  249. package/src/components/command/index.ts +1 -1
  250. package/src/components/command/palette.ts +174 -166
  251. package/src/components/command/scss/index.scss +18 -51
  252. package/src/components/command/scss/variables.scss +37 -71
  253. package/src/components/command/search.ts +9 -31
  254. package/src/components/counter/index.ts +22 -22
  255. package/src/components/counter/scss/variables.scss +10 -7
  256. package/src/components/editor/code/commands.ts +1 -1
  257. package/src/components/editor/code/document.ts +0 -2
  258. package/src/components/editor/code/editor.ts +31 -13
  259. package/src/components/editor/code/features.ts +39 -24
  260. package/src/components/editor/code/find.ts +5 -6
  261. package/src/components/editor/code/folding.ts +3 -21
  262. package/src/components/editor/code/gutter.ts +2 -2
  263. package/src/components/editor/code/index.ts +1 -0
  264. package/src/components/editor/code/minimap.ts +39 -5
  265. package/src/components/editor/code/scss/_editor.scss +28 -21
  266. package/src/components/editor/code/scss/_features.scss +19 -21
  267. package/src/components/editor/code/scss/_services.scss +14 -11
  268. package/src/components/editor/code/scss/variables.scss +31 -12
  269. package/src/components/editor/code/services/model.ts +2 -1
  270. package/src/components/editor/code/syntax.ts +2 -1
  271. package/src/components/editor/code/view.ts +22 -45
  272. package/src/components/editor/diffs/index.ts +1 -0
  273. package/src/components/editor/diffs/merge.ts +9 -10
  274. package/src/components/editor/diffs/scss/_diffs.scss +39 -63
  275. package/src/components/editor/diffs/scss/_merge.scss +10 -2
  276. package/src/components/editor/diffs/scss/index.scss +0 -1
  277. package/src/components/editor/diffs/scss/variables.scss +36 -17
  278. package/src/components/editor/diffs/view.ts +8 -9
  279. package/src/components/editor/markdown/editing.ts +18 -6
  280. package/src/components/editor/markdown/format.ts +180 -32
  281. package/src/components/editor/markdown/layout.ts +2 -1
  282. package/src/components/editor/markdown/model.ts +0 -38
  283. package/src/components/editor/markdown/render.ts +1 -1
  284. package/src/components/editor/markdown/scss/index.scss +38 -52
  285. package/src/components/editor/markdown/scss/variables.scss +24 -50
  286. package/src/components/editor/markdown/template.ts +3 -63
  287. package/src/components/editor/markdown/toolbar.ts +76 -127
  288. package/src/components/editor/markdown/view.ts +9 -32
  289. package/src/components/editor/tree/drag.ts +1 -1
  290. package/src/components/editor/tree/find.ts +61 -64
  291. package/src/components/editor/tree/scss/index.scss +29 -30
  292. package/src/components/editor/tree/scss/variables.scss +34 -15
  293. package/src/components/editor/tree/template.ts +9 -9
  294. package/src/components/editor/viewer/model.ts +1 -1
  295. package/src/components/editor/viewer/scss/_viewer.scss +4 -5
  296. package/src/components/editor/viewer/scss/variables.scss +3 -3
  297. package/src/components/editor/viewer/template.ts +4 -31
  298. package/src/components/editor/workspace/keybindings.ts +1 -1
  299. package/src/components/editor/workspace/model.ts +136 -37
  300. package/src/components/editor/workspace/scss/_keybindings.scss +3 -20
  301. package/src/components/editor/workspace/scss/_status.scss +0 -1
  302. package/src/components/editor/workspace/scss/_tabs.scss +2 -41
  303. package/src/components/editor/workspace/scss/index.scss +49 -71
  304. package/src/components/editor/workspace/scss/variables.scss +1 -135
  305. package/src/components/editor/workspace/session.ts +138 -18
  306. package/src/components/editor/workspace/status.ts +1 -1
  307. package/src/components/editor/workspace/strip.ts +96 -115
  308. package/src/components/editor/workspace/tabs.ts +2 -23
  309. package/src/components/editor/workspace/template.ts +323 -458
  310. package/src/components/error/index.ts +47 -183
  311. package/src/components/error/scss/index.scss +34 -35
  312. package/src/components/error/scss/variables.scss +14 -26
  313. package/src/components/filter/scss/index.scss +6 -5
  314. package/src/components/form/action.ts +7 -7
  315. package/src/components/form/input.ts +25 -12
  316. package/src/components/frame/scss/index.scss +5 -5
  317. package/src/components/group/index.ts +77 -2
  318. package/src/components/group/scss/index.scss +164 -0
  319. package/src/components/group/scss/variables.scss +110 -2
  320. package/src/components/heatmap/scss/variables.scss +13 -10
  321. package/src/components/highlight/index.ts +87 -79
  322. package/src/components/highlight/scss/index.scss +6 -16
  323. package/src/components/highlight/scss/variables.scss +33 -5
  324. package/src/components/icon/scss/index.scss +2 -2
  325. package/src/components/icon/scss/variables.scss +14 -1
  326. package/src/components/image/scss/index.scss +9 -9
  327. package/src/components/image/scss/variables.scss +1 -1
  328. package/src/components/index.ts +3 -7
  329. package/src/components/inline-edit/index.ts +8 -6
  330. package/src/components/inline-edit/rich.ts +8 -8
  331. package/src/components/inline-edit/scss/index.scss +50 -36
  332. package/src/components/inline-edit/scss/variables.scss +28 -18
  333. package/src/components/inline-edit/status.ts +2 -0
  334. package/src/components/input/index.ts +3 -1
  335. package/src/components/input/otp.ts +175 -0
  336. package/src/components/input/password.ts +178 -0
  337. package/src/components/input/scrub.ts +197 -178
  338. package/src/components/input/scss/index.scss +344 -4
  339. package/src/components/input/scss/variables.scss +234 -65
  340. package/src/components/input/tag.ts +98 -53
  341. package/src/components/json/download.ts +2 -5
  342. package/src/components/link/scss/index.scss +3 -5
  343. package/src/components/loading/scss/index.scss +1 -0
  344. package/src/components/loading/scss/variables.scss +1 -0
  345. package/src/components/marquee/index.ts +1 -1
  346. package/src/components/marquee/scss/index.scss +11 -4
  347. package/src/components/nav/scss/index.scss +10 -26
  348. package/src/components/nav/scss/variables.scss +13 -23
  349. package/src/components/nav/tree.ts +10 -8
  350. package/src/components/notification/index.ts +3 -3
  351. package/src/components/notification/scss/index.scss +7 -14
  352. package/src/components/notification/scss/variables.scss +10 -2
  353. package/src/components/number/index.ts +1 -1
  354. package/src/components/overlay/popup.ts +2 -2
  355. package/src/components/overlay/scss/index.scss +60 -51
  356. package/src/components/page/scss/variables.scss +1 -0
  357. package/src/components/pagination/arrows.ts +2 -3
  358. package/src/components/pagination/cards.ts +2 -3
  359. package/src/components/pagination/index.ts +11 -9
  360. package/src/components/pagination/scss/index.scss +38 -101
  361. package/src/components/pagination/scss/variables.scss +24 -69
  362. package/src/components/progress/index.ts +1 -1
  363. package/src/components/progress/scss/index.scss +22 -11
  364. package/src/components/progress/scss/variables.scss +13 -5
  365. package/src/components/progress/text.ts +3 -3
  366. package/src/components/range/filter.ts +249 -246
  367. package/src/components/range/index.ts +22 -7
  368. package/src/components/range/scss/index.scss +470 -15
  369. package/src/components/range/scss/variables.scss +402 -198
  370. package/src/components/range/surface.ts +135 -0
  371. package/src/components/relative-time/index.ts +2 -2
  372. package/src/components/relative-time/scss/index.scss +4 -2
  373. package/src/components/relative-time/scss/variables.scss +4 -5
  374. package/src/components/root/scss/index.scss +11 -11
  375. package/src/components/root/scss/variables.scss +4 -4
  376. package/src/components/search/button.ts +24 -0
  377. package/src/components/search/index.ts +12 -0
  378. package/src/components/search/input.ts +35 -0
  379. package/src/components/search/parts.ts +24 -0
  380. package/src/components/search/scss/index.scss +36 -0
  381. package/src/components/search/scss/variables.scss +67 -0
  382. package/src/components/section/scss/variables.scss +1 -0
  383. package/src/components/select/expand.ts +3 -4
  384. package/src/components/select/index.ts +55 -41
  385. package/src/components/select/placement.ts +17 -1
  386. package/src/components/select/scss/index.scss +57 -29
  387. package/src/components/select/scss/variables.scss +91 -53
  388. package/src/components/{panels → shell}/group.ts +151 -98
  389. package/src/components/shell/index.ts +805 -284
  390. package/src/components/{panels → shell}/model.ts +329 -102
  391. package/src/components/shell/resize.ts +176 -0
  392. package/src/components/shell/scss/index.scss +502 -89
  393. package/src/components/shell/scss/variables.scss +264 -39
  394. package/src/components/shell/sidebar.ts +325 -0
  395. package/src/components/{panels → shell}/subtree.ts +1 -2
  396. package/src/components/shortcut-recorder/index.ts +99 -61
  397. package/src/components/shortcut-recorder/scss/index.scss +76 -52
  398. package/src/components/shortcut-recorder/scss/variables.scss +25 -30
  399. package/src/components/sortable/index.ts +364 -63
  400. package/src/components/sortable/scss/index.scss +22 -2
  401. package/src/components/sortable/scss/variables.scss +16 -4
  402. package/src/components/story/index.ts +56 -33
  403. package/src/components/story/scss/index.scss +67 -16
  404. package/src/components/story/scss/variables.scss +59 -18
  405. package/src/components/surface-field/engine.ts +157 -61
  406. package/src/components/surface-field/index.ts +64 -9
  407. package/src/components/surface-field/scss/index.scss +88 -77
  408. package/src/components/surface-field/scss/variables.scss +84 -36
  409. package/src/components/surface-field/surface.ts +225 -76
  410. package/src/components/tasklist/index.ts +10 -14
  411. package/src/components/tasklist/scss/index.scss +25 -45
  412. package/src/components/tasklist/scss/variables.scss +12 -29
  413. package/src/components/textarea/index.ts +39 -42
  414. package/src/components/theme/reveal.ts +1 -0
  415. package/src/components/theme/scss/index.scss +20 -16
  416. package/src/components/theme/scss/variables.scss +11 -5
  417. package/src/components/theme/shared.ts +3 -7
  418. package/src/components/toast/index.ts +7 -8
  419. package/src/components/toast/scss/index.scss +44 -36
  420. package/src/components/toast/scss/variables.scss +36 -33
  421. package/src/components/toolbar/index.ts +1675 -0
  422. package/src/components/toolbar/scss/index.scss +759 -0
  423. package/src/components/toolbar/scss/variables.scss +555 -0
  424. package/src/components/tooltip/menu.ts +301 -220
  425. package/src/components/tooltip/onclick.ts +18 -3
  426. package/src/components/tooltip/onhover.ts +13 -9
  427. package/src/components/tooltip/scss/index.scss +155 -188
  428. package/src/components/tooltip/scss/variables.scss +151 -135
  429. package/src/components/tooltip/shared.ts +47 -74
  430. package/src/components/tooltip/utilities.ts +151 -10
  431. package/src/components/truncate/index.ts +1 -1
  432. package/src/components/typewriter/rotate.ts +6 -6
  433. package/src/components/typewriter/scss/index.scss +14 -5
  434. package/src/components/uptime/scss/index.scss +8 -15
  435. package/src/components/uptime/scss/variables.scss +12 -1
  436. package/src/components/usage-meter/index.ts +1 -1
  437. package/src/components/usage-meter/scss/index.scss +6 -4
  438. package/src/components/usage-meter/scss/variables.scss +11 -11
  439. package/src/css-utilities/box-shadow.scss +0 -1
  440. package/src/css-utilities/icon.scss +9 -9
  441. package/src/css-utilities/surface.scss +27 -17
  442. package/src/modifiers/glass/index.ts +2 -2
  443. package/src/modifiers/glass/scss/index.scss +2 -2
  444. package/src/normalize/scss/index.scss +1 -1
  445. package/src/shared/drag.ts +92 -53
  446. package/src/shared/placement.ts +145 -0
  447. package/src/shared/transition.ts +1 -1
  448. package/src/shared/viewport.ts +1 -7
  449. package/src/tokens/scss/color.scss +2 -2
  450. package/src/tokens/scss/scale.scss +5 -1
  451. package/src/tokens/scss/size.scss +0 -7
  452. package/storage/svg/angle.svg +1 -0
  453. package/storage/svg/{chevron-left.svg → arrow.svg} +1 -1
  454. package/storage/svg/calendar.svg +1 -0
  455. package/storage/svg/circle-filled.svg +1 -0
  456. package/storage/svg/cursor-arrow-left.svg +1 -0
  457. package/storage/svg/cursor-arrow-right.svg +1 -0
  458. package/storage/svg/fit.svg +1 -0
  459. package/storage/svg/grip.svg +1 -0
  460. package/storage/svg/mail.svg +1 -0
  461. package/storage/svg/{chevron-down.svg → minus.svg} +1 -1
  462. package/storage/svg/music.svg +1 -0
  463. package/storage/svg/{chevron-up.svg → rotate-ccw.svg} +1 -1
  464. package/vite.config.ts +9 -13
  465. package/build/components/cc/index.d.ts +0 -33
  466. package/build/components/cc/index.js +0 -603
  467. package/build/components/cc/scss/index.scss +0 -2
  468. package/build/components/dock/index.d.ts +0 -47
  469. package/build/components/dock/index.js +0 -469
  470. package/build/components/dock/scss/index.scss +0 -2
  471. package/build/components/metric/flash.d.ts +0 -12
  472. package/build/components/metric/flash.js +0 -117
  473. package/build/components/metric/index.d.ts +0 -44
  474. package/build/components/metric/index.js +0 -275
  475. package/build/components/metric/scss/index.scss +0 -2
  476. package/build/components/pagination/dots.d.ts +0 -23
  477. package/build/components/pagination/dots.js +0 -115
  478. package/build/components/panels/dnd.d.ts +0 -47
  479. package/build/components/panels/dnd.js +0 -114
  480. package/build/components/panels/group.js +0 -322
  481. package/build/components/panels/index.d.ts +0 -17
  482. package/build/components/panels/index.js +0 -524
  483. package/build/components/panels/model.d.ts +0 -64
  484. package/build/components/panels/resize.d.ts +0 -9
  485. package/build/components/panels/scss/index.scss +0 -2
  486. package/build/components/preview/buttons.d.ts +0 -12
  487. package/build/components/preview/buttons.js +0 -26
  488. package/build/components/preview/code.d.ts +0 -8
  489. package/build/components/preview/code.js +0 -18
  490. package/build/components/preview/header.js +0 -21
  491. package/build/components/preview/index.d.ts +0 -37
  492. package/build/components/preview/index.js +0 -123
  493. package/build/components/preview/scss/index.scss +0 -2
  494. package/build/components/preview/source.d.ts +0 -12
  495. package/build/components/preview/source.js +0 -79
  496. package/build/components/preview/stage.d.ts +0 -8
  497. package/build/components/preview/stage.js +0 -28
  498. package/build/components/textarea/scss/index.scss +0 -2
  499. package/src/components/cc/index.ts +0 -562
  500. package/src/components/cc/scss/index.scss +0 -416
  501. package/src/components/cc/scss/variables.scss +0 -257
  502. package/src/components/dock/index.ts +0 -567
  503. package/src/components/dock/scss/index.scss +0 -346
  504. package/src/components/dock/scss/variables.scss +0 -357
  505. package/src/components/input/scss/_field.scss +0 -39
  506. package/src/components/input/scss/_scrub.scss +0 -89
  507. package/src/components/input/scss/_tag.scss +0 -142
  508. package/src/components/metric/flash.ts +0 -129
  509. package/src/components/metric/index.ts +0 -307
  510. package/src/components/metric/scss/_flash.scss +0 -150
  511. package/src/components/metric/scss/index.scss +0 -155
  512. package/src/components/metric/scss/variables.scss +0 -233
  513. package/src/components/pagination/dots.ts +0 -132
  514. package/src/components/panels/dnd.ts +0 -190
  515. package/src/components/panels/index.ts +0 -676
  516. package/src/components/panels/resize.ts +0 -157
  517. package/src/components/panels/scss/index.scss +0 -379
  518. package/src/components/panels/scss/variables.scss +0 -197
  519. package/src/components/preview/buttons.ts +0 -48
  520. package/src/components/preview/code.ts +0 -28
  521. package/src/components/preview/header.ts +0 -23
  522. package/src/components/preview/index.ts +0 -149
  523. package/src/components/preview/scss/index.scss +0 -158
  524. package/src/components/preview/scss/variables.scss +0 -149
  525. package/src/components/preview/source.ts +0 -73
  526. package/src/components/preview/stage.ts +0 -33
  527. package/src/components/range/scss/_filter.scss +0 -360
  528. package/src/components/range/scss/_slider.scss +0 -65
  529. package/src/components/range/scss/_vertical.scss +0 -10
  530. package/src/components/textarea/scss/index.scss +0 -72
  531. package/src/components/textarea/scss/variables.scss +0 -22
  532. package/storage/svg/amex.svg +0 -1
  533. package/storage/svg/arrow-down.svg +0 -1
  534. package/storage/svg/arrow-left.svg +0 -1
  535. package/storage/svg/arrow-right.svg +0 -1
  536. package/storage/svg/arrow-up.svg +0 -1
  537. package/storage/svg/card.svg +0 -1
  538. package/storage/svg/chip.svg +0 -1
  539. package/storage/svg/discover.svg +0 -1
  540. package/storage/svg/mastercard.svg +0 -1
  541. package/storage/svg/visa.svg +0 -1
  542. /package/build/components/{panels → shell}/subtree.d.ts +0 -0
  543. /package/storage/svg/{chevron-right.svg → chevron.svg} +0 -0
@@ -0,0 +1,1281 @@
1
+ import * as reactivity_u0 from '@esportsplus/reactivity';
2
+ import { ReactiveArray, computed, effect, flush, onCleanup, read, signal, write } from '@esportsplus/reactivity';
3
+ import * as template_u1 from '@esportsplus/template';
4
+ import { component } from '@esportsplus/template';
5
+ import icon from '../icon/index.js';
6
+ import inlineEdit from '../inline-edit/index.js';
7
+ import overlay from '../overlay/index.js';
8
+ import searchbox from '../search/index.js';
9
+ import sortable from '../sortable/index.js';
10
+ import tooltip from '../tooltip/index.js';
11
+ import { content as surface } from '../tooltip/utilities.js';
12
+ import scrollbar from '../../modifiers/scrollbar/index.js';
13
+ import { observer } from '../../shared/resize.js';
14
+ import arrowSvg from '@esportsplus/ui/svg/arrow.svg';
15
+ import chevron from '@esportsplus/ui/svg/chevron.svg';
16
+ import enter from '@esportsplus/ui/svg/enter.svg';
17
+ import grid from '@esportsplus/ui/svg/grid.svg';
18
+ import '../button/scss/index.scss';
19
+ import './scss/index.scss';
20
+ const template_09fuufob = template_u1.template(`<div><!--$--><span class='toolbar-app-label'>`, true);
21
+ const template_09fuufok = template_u1.template(`<button type='button'>`, true);
22
+ const template_09fuufom = template_u1.template(`<button aria-haspopup='dialog' type='button'>`, true);
23
+ const template_09fuufoo = template_u1.template(`<div class='toolbar-group-header'></div><div>`);
24
+ const template_09fuufov = template_u1.template(`<div>`, true);
25
+ const template_09fuufox = template_u1.template(`<span aria-hidden='true'>`, true);
26
+ const template_09fuufoz = template_u1.template(`<div><button aria-haspopup='dialog' type='button'>`, true);
27
+ const template_09fuufo12 = template_u1.template(`<div role='dialog'><div class='toolbar-drawer-body'><!--$--><div class='toolbar-drawer-main'><div><div><!--$--></div></div></div></div><div aria-hidden='true' class='toolbar-drawer-footer'><!--$--><!--$-->`, true);
28
+ const template_09fuufo1d = template_u1.template(`<div class='toolbar-drawer-search'>`, true);
29
+ const template_09fuufo1f = template_u1.template(`<div aria-hidden='true'>`, true);
30
+ const template_09fuufo1h = template_u1.template(`<p class='toolbar-drawer-empty' role='status'>`, true);
31
+ const template_09fuufo1l = template_u1.template(`<div role='dialog'><!--$--><div>`, true);
32
+ const template_09fuufo1p = template_u1.template(`<div class='toolbar-group-trail'>`, true);
33
+ const template_09fuufo1r = template_u1.template(`<button type='button'><span class='toolbar-group-trail-name'>`, true);
34
+ const template_09fuufo1v = template_u1.template(`<span>`, true);
35
+ const template_09fuufo1x = template_u1.template(`<div><!--$--><!--$-->`, true);
36
+ const template_09fuufo21 = template_u1.template(`<span class='toolbar-item-label'>`, true);
37
+ const template_09fuufo25 = template_u1.template(`<div class='toolbar-item'>`, true);
38
+ const template_09fuufo27 = template_u1.template(`<span class='toolbar-drawer-footer-hint'><span aria-hidden='true' class='toolbar-drawer-keys'>`, true);
39
+ const template_09fuufo2a = template_u1.template(`<kbd class='button button--kbd'>`, true);
40
+ const template_09fuufo2c = template_u1.template(`<span class='toolbar-group-face toolbar-group-face--group'>`, true);
41
+ const template_09fuufo2e = template_u1.template(`<span class='toolbar-group-face'>`, true);
42
+ const template_09fuufo2g = template_u1.template(`<span aria-hidden='true' class='toolbar-group-preview'>`, true);
43
+ const template_09fuufo2i = template_u1.template(`<span class='button button--feedback toolbar-button toolbar-button--group'>`, true);
44
+ const template_09fuufo2m = template_u1.template(`<div class='toolbar-app'><!--$--><span class='toolbar-app-label'>`, true);
45
+ const template_09fuufo2q = template_u1.template(`<div><!--$--><div><div></div></div><!--$--><!--$--><!--$-->`, true);
46
+ class ReactiveObject_09fuufo0 extends reactivity_u0.ReactiveObject {
47
+ #active = this[reactivity_u0.SIGNAL](false);
48
+ constructor() {
49
+ super(null);
50
+ }
51
+ get active() {
52
+ return reactivity_u0.read(this.#active);
53
+ }
54
+ set active(_v0) {
55
+ reactivity_u0.write(this.#active, _v0);
56
+ }
57
+ }
58
+ class ReactiveObject_09fuufo1 extends reactivity_u0.ReactiveObject {
59
+ #active = this[reactivity_u0.SIGNAL](false);
60
+ constructor() {
61
+ super(null);
62
+ }
63
+ get active() {
64
+ return reactivity_u0.read(this.#active);
65
+ }
66
+ set active(_v0) {
67
+ reactivity_u0.write(this.#active, _v0);
68
+ }
69
+ }
70
+ class ReactiveObject_09fuufo2 extends reactivity_u0.ReactiveObject {
71
+ #height = this[reactivity_u0.SIGNAL](0);
72
+ #morphing = this[reactivity_u0.SIGNAL](false);
73
+ #radius = this[reactivity_u0.SIGNAL](0);
74
+ #sized = this[reactivity_u0.SIGNAL](false);
75
+ #width = this[reactivity_u0.SIGNAL](0);
76
+ constructor() {
77
+ super(null);
78
+ }
79
+ get height() {
80
+ return reactivity_u0.read(this.#height);
81
+ }
82
+ set height(_v0) {
83
+ reactivity_u0.write(this.#height, _v0);
84
+ }
85
+ get morphing() {
86
+ return reactivity_u0.read(this.#morphing);
87
+ }
88
+ set morphing(_v1) {
89
+ reactivity_u0.write(this.#morphing, _v1);
90
+ }
91
+ get radius() {
92
+ return reactivity_u0.read(this.#radius);
93
+ }
94
+ set radius(_v2) {
95
+ reactivity_u0.write(this.#radius, _v2);
96
+ }
97
+ get sized() {
98
+ return reactivity_u0.read(this.#sized);
99
+ }
100
+ set sized(_v3) {
101
+ reactivity_u0.write(this.#sized, _v3);
102
+ }
103
+ get width() {
104
+ return reactivity_u0.read(this.#width);
105
+ }
106
+ set width(_v4) {
107
+ reactivity_u0.write(this.#width, _v4);
108
+ }
109
+ }
110
+ class ReactiveObject_09fuufo3 extends reactivity_u0.ReactiveObject {
111
+ #active = this[reactivity_u0.SIGNAL](false);
112
+ #x = this[reactivity_u0.SIGNAL](0);
113
+ #y = this[reactivity_u0.SIGNAL](0);
114
+ constructor() {
115
+ super(null);
116
+ }
117
+ get active() {
118
+ return reactivity_u0.read(this.#active);
119
+ }
120
+ set active(_v0) {
121
+ reactivity_u0.write(this.#active, _v0);
122
+ }
123
+ get x() {
124
+ return reactivity_u0.read(this.#x);
125
+ }
126
+ set x(_v1) {
127
+ reactivity_u0.write(this.#x, _v1);
128
+ }
129
+ get y() {
130
+ return reactivity_u0.read(this.#y);
131
+ }
132
+ set y(_v2) {
133
+ reactivity_u0.write(this.#y, _v2);
134
+ }
135
+ }
136
+ class ReactiveObject_09fuufo4 extends reactivity_u0.ReactiveObject {
137
+ #index = this[reactivity_u0.SIGNAL](-1);
138
+ #query = this[reactivity_u0.SIGNAL]('');
139
+ constructor() {
140
+ super(null);
141
+ }
142
+ get index() {
143
+ return reactivity_u0.read(this.#index);
144
+ }
145
+ set index(_v0) {
146
+ reactivity_u0.write(this.#index, _v0);
147
+ }
148
+ get query() {
149
+ return reactivity_u0.read(this.#query);
150
+ }
151
+ set query(_v1) {
152
+ reactivity_u0.write(this.#query, _v1);
153
+ }
154
+ }
155
+ class ReactiveObject_09fuufo5 extends reactivity_u0.ReactiveObject {
156
+ #active = this[reactivity_u0.SIGNAL](false);
157
+ constructor() {
158
+ super(null);
159
+ }
160
+ get active() {
161
+ return reactivity_u0.read(this.#active);
162
+ }
163
+ set active(_v0) {
164
+ reactivity_u0.write(this.#active, _v0);
165
+ }
166
+ }
167
+ class ReactiveObject_09fuufo6 extends reactivity_u0.ReactiveObject {
168
+ #count = this[reactivity_u0.SIGNAL](0);
169
+ #first = this[reactivity_u0.SIGNAL](0);
170
+ #order = this[reactivity_u0.SIGNAL](0);
171
+ constructor() {
172
+ super(null);
173
+ }
174
+ get count() {
175
+ return reactivity_u0.read(this.#count);
176
+ }
177
+ set count(_v0) {
178
+ reactivity_u0.write(this.#count, _v0);
179
+ }
180
+ get first() {
181
+ return reactivity_u0.read(this.#first);
182
+ }
183
+ set first(_v1) {
184
+ reactivity_u0.write(this.#first, _v1);
185
+ }
186
+ get order() {
187
+ return reactivity_u0.read(this.#order);
188
+ }
189
+ set order(_v2) {
190
+ reactivity_u0.write(this.#order, _v2);
191
+ }
192
+ }
193
+ class ReactiveObject_09fuufo7 extends reactivity_u0.ReactiveObject {
194
+ #launching = this[reactivity_u0.SIGNAL](false);
195
+ constructor() {
196
+ super(null);
197
+ }
198
+ get launching() {
199
+ return reactivity_u0.read(this.#launching);
200
+ }
201
+ set launching(_v0) {
202
+ reactivity_u0.write(this.#launching, _v0);
203
+ }
204
+ }
205
+ class ReactiveObject_09fuufo8 extends reactivity_u0.ReactiveObject {
206
+ #editing = this[reactivity_u0.SIGNAL](false);
207
+ #saved = this[reactivity_u0.SIGNAL](false);
208
+ #value;
209
+ constructor(_p0) {
210
+ super(null);
211
+ this.#value = this[reactivity_u0.SIGNAL](_p0);
212
+ }
213
+ get editing() {
214
+ return reactivity_u0.read(this.#editing);
215
+ }
216
+ set editing(_v0) {
217
+ reactivity_u0.write(this.#editing, _v0);
218
+ }
219
+ get saved() {
220
+ return reactivity_u0.read(this.#saved);
221
+ }
222
+ set saved(_v1) {
223
+ reactivity_u0.write(this.#saved, _v1);
224
+ }
225
+ get value() {
226
+ return reactivity_u0.read(this.#value);
227
+ }
228
+ set value(_v2) {
229
+ reactivity_u0.write(this.#value, _v2);
230
+ }
231
+ }
232
+ class ReactiveObject_09fuufo9 extends reactivity_u0.ReactiveObject {
233
+ #running;
234
+ constructor(_p0) {
235
+ super(null);
236
+ this.#running = this[reactivity_u0.SIGNAL](_p0);
237
+ }
238
+ get running() {
239
+ return reactivity_u0.read(this.#running);
240
+ }
241
+ set running(_v0) {
242
+ reactivity_u0.write(this.#running, _v0);
243
+ }
244
+ }
245
+ const ARROWS = {
246
+ horizontal: ['icon--left', ''],
247
+ vertical: ['icon--up', 'icon--down']
248
+ };
249
+ const CUSTOM = Symbol();
250
+ const DIVIDER = Symbol();
251
+ const FOCUSABLE = 'button, input, select, textarea, [contenteditable], [tabindex]';
252
+ const GLIDE = 150;
253
+ const GROUP = Symbol();
254
+ const LABEL = Symbol();
255
+ const LETTERS = ['#', ...'ABCDEFGHIJKLMNOPQRSTUVWXYZ'];
256
+ const MEMBER = Symbol();
257
+ const ROVE = {
258
+ horizontal: { ArrowLeft: -1, ArrowRight: 1 },
259
+ vertical: { ArrowDown: 1, ArrowUp: -1 }
260
+ };
261
+ const SLACK = 8;
262
+ const TOOLBAR_DRAWER = Symbol.for('@esportsplus/ui/toolbar.drawer');
263
+ const TOOLTIP_DELAY = 240;
264
+ let uid = 0;
265
+ function alphabetize(items) {
266
+ let places = new Map(), sorted = [];
267
+ items.$length;
268
+ for (let i = 0, n = items.$length; i < n; i++) {
269
+ let label = grouped(items[i]) ? '' : text(items[i].label);
270
+ sorted.push({ item: items[i], label, letter: initial(label) });
271
+ }
272
+ sorted.sort((a, b) => a.letter - b.letter || a.label.localeCompare(b.label));
273
+ for (let i = 0, n = sorted.length; i < n; i++) {
274
+ places.set(sorted[i].item, { letter: sorted[i].letter, rank: i });
275
+ }
276
+ return places;
277
+ }
278
+ function buttons(member) {
279
+ if (!grouped(member)) {
280
+ return [member];
281
+ }
282
+ let list = [];
283
+ for (let i = 0, n = member.items.$length; i < n; i++) {
284
+ list.push(...buttons(member.items[i]));
285
+ }
286
+ return list;
287
+ }
288
+ function contains(group, member) {
289
+ for (let i = 0, n = group.items.$length; i < n; i++) {
290
+ let item = group.items[i];
291
+ if (item === member || (grouped(item) && contains(item, member))) {
292
+ return true;
293
+ }
294
+ }
295
+ return false;
296
+ }
297
+ function copy(item) {
298
+ {
299
+ let root_09fuufo24 = template_09fuufo25();
300
+ template_u1.slot(root_09fuufo24, stand(item), 1);
301
+ return root_09fuufo24;
302
+ }
303
+ }
304
+ function face(item) {
305
+ return {
306
+ class: item.thumbnail !== undefined && 'toolbar-button--thumbnail',
307
+ style: item.thumbnail !== undefined ? `--thumbnail: url(${JSON.stringify(thumbnail(item.thumbnail))})` : ''
308
+ };
309
+ }
310
+ function glyph(item) {
311
+ if (item.icon === undefined) {
312
+ return '';
313
+ }
314
+ return typeof item.icon === 'string' ? sprite(item.icon) : item.icon();
315
+ }
316
+ function grouped(value) {
317
+ return typeof value === 'object' && value !== null && GROUP in value;
318
+ }
319
+ function hint(keys, label) {
320
+ {
321
+ let root_09fuufo26 = template_09fuufo27(), element_09fuufo28 = root_09fuufo26.firstElementChild;
322
+ template_u1.slot(element_09fuufo28, keys.map((key) => {
323
+ let root_09fuufo29 = template_09fuufo2a();
324
+ template_u1.slot(root_09fuufo29, key, 1);
325
+ return root_09fuufo29;
326
+ }), 1);
327
+ template_u1.slot(root_09fuufo26, label, 1);
328
+ return root_09fuufo26;
329
+ }
330
+ }
331
+ function initial(label) {
332
+ let letter = LETTERS.indexOf(label.normalize('NFD').charAt(0).toUpperCase());
333
+ return letter === -1 ? 0 : letter;
334
+ }
335
+ function keep(e) {
336
+ if (!(e.target instanceof HTMLInputElement)) {
337
+ e.preventDefault();
338
+ }
339
+ }
340
+ function mini(member) {
341
+ if (grouped(member)) {
342
+ {
343
+ let root_09fuufo2b = template_09fuufo2c();
344
+ template_u1.slot(root_09fuufo2b, preview(member), 1);
345
+ return root_09fuufo2b;
346
+ }
347
+ }
348
+ {
349
+ let root_09fuufo2d = template_09fuufo2e();
350
+ template_u1.slot(root_09fuufo2d, glyph(member), 1);
351
+ template_u1.setStyle(root_09fuufo2d, ["", member.thumbnail !== undefined ? `--thumbnail: url(${JSON.stringify(thumbnail(member.thumbnail))})` : '--thumbnail: none']);
352
+ return root_09fuufo2d;
353
+ }
354
+ }
355
+ function movable(entry) {
356
+ return typeof entry === 'object' && !(CUSTOM in entry) && !(DIVIDER in entry);
357
+ }
358
+ function name(trigger) {
359
+ return trigger[LABEL];
360
+ }
361
+ function preview(group) {
362
+ {
363
+ let root_09fuufo2f = template_09fuufo2g();
364
+ root_09fuufo2f.appendChild(new template_u1.ArraySlot(group.items, mini, true).fragment);
365
+ return root_09fuufo2f;
366
+ }
367
+ }
368
+ function relay(e) {
369
+ let target = e.target;
370
+ if (target.closest('button, input, [contenteditable]')) {
371
+ return;
372
+ }
373
+ let button = e.currentTarget.querySelector(':scope > button');
374
+ if (!button) {
375
+ return;
376
+ }
377
+ button.dispatchEvent(new MouseEvent('click', { bubbles: true, cancelable: true, detail: e.detail, view: window }));
378
+ }
379
+ function sprite(href, name = '') {
380
+ return icon({ 'aria-hidden': 'true', class: name }, href);
381
+ }
382
+ function stand(item) {
383
+ if (grouped(item)) {
384
+ {
385
+ let root_09fuufo2h = template_09fuufo2i();
386
+ template_u1.slot(root_09fuufo2h, preview(item), 1);
387
+ return root_09fuufo2h;
388
+ }
389
+ }
390
+ {
391
+ let root_09fuufo2j = template_09fuufo1v();
392
+ template_u1.slot(root_09fuufo2j, glyph(item), 1);
393
+ let attributes_09fuufo2k = face(item);
394
+ template_u1.setProperties(root_09fuufo2j, attributes_09fuufo2k, true);
395
+ template_u1.setClass(root_09fuufo2j, ["button button--feedback toolbar-button", attributes_09fuufo2k?.class]);
396
+ template_u1.setStyle(root_09fuufo2j, ["", attributes_09fuufo2k?.style]);
397
+ return root_09fuufo2j;
398
+ }
399
+ }
400
+ function text(label) {
401
+ return typeof label === 'function' ? label() : label;
402
+ }
403
+ function thumbnail(src) {
404
+ return new URL(src, document.baseURI).href;
405
+ }
406
+ function tile(item) {
407
+ {
408
+ let root_09fuufo2l = template_09fuufo2m(), element_09fuufo2n = root_09fuufo2l.firstChild, element_09fuufo2o = root_09fuufo2l.firstElementChild;
409
+ template_u1.slot(element_09fuufo2n, stand(item));
410
+ template_u1.slot(element_09fuufo2o, item.label, 1);
411
+ return root_09fuufo2l;
412
+ }
413
+ }
414
+ const button = ({ hint, icon, label, onclick, running, state, thumbnail, ...attributes }) => ({ attributes, hint, icon, label, onclick, running, state, thumbnail });
415
+ const divider = () => ({ [DIVIDER]: true });
416
+ const drawer = () => TOOLBAR_DRAWER;
417
+ const group = ({ items, label }) => ({ [GROUP]: true, items: items instanceof ReactiveArray ? items : new ReactiveArray(items), label });
418
+ const item = (render, { hint, label } = {}) => ({ [CUSTOM]: true, hint, label, render });
419
+ const toolbar = ({ alphabetical = false, apps, arrows = false, delay = TOOLTIP_DELAY, direction = 'n', drawer: drawn = false, groups: gathering = false, items, labels = false, mode = 'toolbar', label = mode === 'dock' ? 'Dock' : 'Toolbar', onlaunch, onrename, onsort, search = true, sortable: sorting = mode === 'dock' || gathering, state = new ReactiveObject_09fuufo0(), ...attributes }) => {
420
+ let cells, dock = mode === 'dock', entries = items instanceof ReactiveArray ? items : new ReactiveArray(items), expanded = new ReactiveObject_09fuufo1(), field, fit = new ReactiveObject_09fuufo2(), folder = new ReactiveObject_09fuufo3(), frame = 0, headings = [], id = `toolbar-${++uid}`, launch = new ReactiveObject_09fuufo4(), launching = new WeakMap(), marker = entries.indexOf(TOOLBAR_DRAWER), measuring = new ReactiveObject_09fuufo5(), more = mode === 'dock' ? 'All apps' : 'More', names = new WeakMap(), opener, panel, pointed = signal(-1), popup = drawn && overlay.popup({ state, target: surface }), resting = { height: 0, radius: 0, width: 0 }, running = new WeakMap(), scroll = new ReactiveObject_09fuufo6(), scrolling = 0, sheet, shelf, stash = drawn ? (apps instanceof ReactiveArray ? apps : new ReactiveArray(apps ?? [])) : undefined, tiles = new WeakMap(), track, trail = signal([]), vertical = direction === 'e' || direction === 'w', viewport, alphabet = alphabetical && stash ? computed(() => alphabetize(stash)) : undefined, filled = alphabet && computed(() => {
421
+ let letters = new Set(), list = shown(), places = read(alphabet);
422
+ for (let i = 0, n = list.length; i < n; i++) {
423
+ letters.add(places.get(list[i]).letter);
424
+ }
425
+ return letters;
426
+ });
427
+ function across(list, from, row) {
428
+ let origin = tiles.get(list[from])?.getBoundingClientRect();
429
+ if (!origin) {
430
+ return from;
431
+ }
432
+ let best = from, distance = Infinity, middle = origin.left + origin.width / 2, nearest = Infinity, rects = [];
433
+ for (let i = 0, n = list.length; i < n; i++) {
434
+ let rect = rects[i] = tiles.get(list[i])?.getBoundingClientRect(), offset = rect ? (rect.top - origin.top) * row : 0;
435
+ if (offset > 1) {
436
+ nearest = Math.min(nearest, offset);
437
+ }
438
+ }
439
+ for (let i = 0, n = list.length; i < n; i++) {
440
+ let rect = rects[i];
441
+ if (!rect || Math.abs((rect.top - origin.top) * row - nearest) > 1) {
442
+ continue;
443
+ }
444
+ let gap = Math.abs(rect.left + rect.width / 2 - middle);
445
+ if (gap < distance) {
446
+ best = i;
447
+ distance = gap;
448
+ }
449
+ }
450
+ return best;
451
+ }
452
+ function admits(entry, element) {
453
+ let target = element[MEMBER];
454
+ return movable(entry) && !!target && target !== entry && !(grouped(entry) && contains(entry, target));
455
+ }
456
+ function align() {
457
+ let glass = field?.parentElement?.querySelector('.group-item--overlay.icon');
458
+ if (!alphabet || !cells?.offsetWidth || !glass || !panel) {
459
+ return;
460
+ }
461
+ panel.style.setProperty('--toolbar-drawer-inset', `${glass.getBoundingClientRect().left - cells.getBoundingClientRect().left}px`);
462
+ }
463
+ function arrow(step) {
464
+ {
465
+ let root_09fuufoj = template_09fuufok();
466
+ template_u1.slot(root_09fuufoj, sprite(chevron, ARROWS[vertical ? 'vertical' : 'horizontal'][step < 0 ? 0 : 1]), 1);
467
+ template_u1.setProperty(root_09fuufoj, 'aria-label', step < 0 ? 'Previous' : 'Next');
468
+ template_u1.setProperty(root_09fuufoj, 'disabled', () => step < 0 ? scroll.first <= 0 : scroll.first + scroll.count >= entries.$length);
469
+ template_u1.delegate(root_09fuufoj, 'click', () => page(step));
470
+ template_u1.setClass(root_09fuufoj, ["toolbar-arrow"]);
471
+ return root_09fuufoj;
472
+ }
473
+ }
474
+ function bunch(member, nested) {
475
+ {
476
+ let root_09fuufol = template_09fuufom();
477
+ template_u1.slot(root_09fuufol, preview(member), 1);
478
+ template_u1.setProperty(root_09fuufol, 'aria-controls', "" + (id) + "-group");
479
+ template_u1.setProperty(root_09fuufol, 'aria-expanded', () => !nested && folder.active && read(trail)[0] === member ? 'true' : 'false');
480
+ template_u1.setProperty(root_09fuufol, 'aria-label', () => `${naming(member).value || 'Group'}, ${member.items.$length} items`);
481
+ template_u1.delegate(root_09fuufol, 'click', (e) => {
482
+ reveal(member, e.currentTarget, nested, e.detail === 0);
483
+ });
484
+ template_u1.setClass(root_09fuufol, ["button button--feedback toolbar-button toolbar-button--group"]);
485
+ return root_09fuufol;
486
+ }
487
+ }
488
+ function collapse() {
489
+ cancelAnimationFrame(frame);
490
+ expanded.active = false;
491
+ land();
492
+ }
493
+ function combine(entry, element, items, from, source) {
494
+ let target = element[MEMBER];
495
+ if (!target || !movable(entry)) {
496
+ return;
497
+ }
498
+ if (grouped(target)) {
499
+ target.items.push(entry);
500
+ sorted(entry, from, target.items.$length - 1, source, target.items);
501
+ }
502
+ else {
503
+ let made = group({ items: [target, entry] });
504
+ items.splice(items.indexOf(target), 1, made);
505
+ sorted(entry, from, 1, source, made.items);
506
+ }
507
+ tidy();
508
+ }
509
+ function contents(current) {
510
+ let list = sortable(current.items, (member, attributes) => {
511
+ let root_09fuufoa = template_09fuufob(), element_09fuufoc = root_09fuufoa.firstChild, element_09fuufod = root_09fuufoa.firstElementChild;
512
+ template_u1.slot(element_09fuufoc, grouped(member) ? bunch(member, true) : control(member));
513
+ new template_u1.EffectSlot(element_09fuufod, () => grouped(member) ? naming(member).value : text(member.label), 1);
514
+ let attributes_09fuufoe = attributes;
515
+ template_u1.setProperties(root_09fuufoa, attributes_09fuufoe, true);
516
+ template_u1.delegate(root_09fuufoa, 'click', relay);
517
+ template_u1.onconnect(root_09fuufoa, (element) => {
518
+ element[MEMBER] = member;
519
+ });
520
+ template_u1.setClass(root_09fuufoa, ["toolbar-app", attributes_09fuufoe?.class]);
521
+ template_u1.setStyle(root_09fuufoa, ["", attributes_09fuufoe?.style]);
522
+ return root_09fuufoa;
523
+ }, { combine: combining, drag: tile, group: id, onland: landed, onlift: lifted, onsort: sorted, onthrow: stash ? thrown : undefined });
524
+ {
525
+ let root_09fuufon = template_09fuufoo(), element_09fuufop = root_09fuufon.firstChild, element_09fuufoq = element_09fuufop.nextSibling;
526
+ template_u1.slot(element_09fuufop, inlineEdit({
527
+ class: 'toolbar-group-name',
528
+ label: 'Group name',
529
+ onsave: (value) => {
530
+ current.label = value;
531
+ onrename?.(current, value);
532
+ },
533
+ placeholder: 'Name',
534
+ state: naming(current)
535
+ }), 1);
536
+ template_u1.slot(element_09fuufoq, list.render(), 1);
537
+ template_u1.setProperties(element_09fuufoq, list.attributes);
538
+ template_u1.setClass(element_09fuufoq, ["toolbar-group-apps"]);
539
+ template_u1.setStyle(element_09fuufoq, ["", () => `--columns: ${Math.min(Math.max(current.items.$length, 2), 4)};`]);
540
+ return root_09fuufon;
541
+ }
542
+ }
543
+ function control(item) {
544
+ let app = status(item), local = motion(item);
545
+ {
546
+ let root_09fuufor = template_09fuufok();
547
+ template_u1.slot(root_09fuufor, glyph(item), 1);
548
+ let attributes_09fuufos = face(item);
549
+ template_u1.setProperties(root_09fuufor, attributes_09fuufos, true);
550
+ let attributes_09fuufot = item.attributes;
551
+ template_u1.setProperties(root_09fuufor, attributes_09fuufot, true);
552
+ template_u1.setProperty(root_09fuufor, 'aria-label', () => dock && app.running ? `${text(item.label)}, running` : text(item.label));
553
+ template_u1.delegate(root_09fuufor, 'animationend', () => {
554
+ local.launching = false;
555
+ });
556
+ template_u1.delegate(root_09fuufor, 'click', (e) => {
557
+ item.onclick?.(e);
558
+ open(item);
559
+ });
560
+ template_u1.setClass(root_09fuufor, ["button button--feedback toolbar-button", attributes_09fuufos?.class, attributes_09fuufot?.class, () => local.launching && 'toolbar-button--launching']);
561
+ template_u1.setStyle(root_09fuufor, ["", attributes_09fuufos?.style, attributes_09fuufot?.style]);
562
+ return root_09fuufor;
563
+ }
564
+ }
565
+ function custom(entry) {
566
+ let hint = entry.hint ?? entry.label;
567
+ {
568
+ let root_09fuufou = template_09fuufov();
569
+ template_u1.slot(root_09fuufou, entry.render(), 1);
570
+ template_u1.onconnect(root_09fuufou, (element) => {
571
+ if (hint !== undefined) {
572
+ element[LABEL] = hint;
573
+ }
574
+ });
575
+ template_u1.setClass(root_09fuufou, ["toolbar-custom", hint !== undefined && 'toolbar-custom--hinted', () => hidden(entry) && 'toolbar-custom--hidden']);
576
+ return root_09fuufou;
577
+ }
578
+ }
579
+ function divide(entry) {
580
+ {
581
+ let root_09fuufow = template_09fuufox();
582
+ template_u1.setClass(root_09fuufow, ["toolbar-divider", () => hidden(entry) && 'toolbar-divider--hidden']);
583
+ return root_09fuufow;
584
+ }
585
+ }
586
+ function door() {
587
+ {
588
+ let root_09fuufoy = template_09fuufoz(), element_09fuufo10 = root_09fuufoy.firstElementChild;
589
+ template_u1.slot(element_09fuufo10, sprite(grid), 1);
590
+ template_u1.setProperty(element_09fuufo10, 'aria-controls', "" + (id) + "-drawer");
591
+ template_u1.setProperty(element_09fuufo10, 'aria-label', more);
592
+ template_u1.setProperty(element_09fuufo10, 'aria-expanded', () => state.active ? 'true' : 'false');
593
+ template_u1.delegate(element_09fuufo10, 'click', () => {
594
+ state.active = !state.active;
595
+ });
596
+ template_u1.setClass(element_09fuufo10, ["button button--feedback toolbar-button"]);
597
+ template_u1.onconnect(root_09fuufoy, (element) => {
598
+ element[LABEL] = more;
599
+ });
600
+ template_u1.setClass(root_09fuufoy, ["toolbar-item", () => hidden(TOOLBAR_DRAWER) && 'toolbar-item--hidden']);
601
+ return root_09fuufoy;
602
+ }
603
+ }
604
+ function drawer(apps) {
605
+ let current = signal(undefined), keys = search ? {} : { onkeydown: navigate, tabindex: '-1' }, library = sortable(apps, (item, attributes) => {
606
+ let root_09fuufof = template_09fuufob(), element_09fuufog = root_09fuufof.firstChild, element_09fuufoh = root_09fuufof.firstElementChild;
607
+ template_u1.slot(element_09fuufog, control(item));
608
+ template_u1.slot(element_09fuufoh, item.label, 1);
609
+ let attributes_09fuufoi = sorting ? attributes : {};
610
+ template_u1.setProperties(root_09fuufof, attributes_09fuufoi, true);
611
+ template_u1.delegate(root_09fuufof, 'click', relay);
612
+ template_u1.onconnect(root_09fuufof, (element) => {
613
+ tiles.set(item, element);
614
+ });
615
+ template_u1.setClass(root_09fuufof, ["toolbar-app", attributes_09fuufoi?.class, [() => !matches(item) && 'toolbar-app--hidden', () => signal.selector(current, item) && '--active']]);
616
+ template_u1.setStyle(root_09fuufof, ["", attributes_09fuufoi?.style, () => {
617
+ let at = alphabet && read(alphabet).get(item);
618
+ return at && `--toolbar-order: ${place(at.letter, at.rank)};`;
619
+ }]);
620
+ return root_09fuufof;
621
+ }, {
622
+ drag: tile,
623
+ group: id,
624
+ onland: () => {
625
+ lift(false);
626
+ tidy();
627
+ },
628
+ onlift: () => lift(true),
629
+ onsort: sorted
630
+ });
631
+ effect(() => {
632
+ write(current, shown()[selected()]);
633
+ });
634
+ effect(() => state.active, (open) => {
635
+ if (!open) {
636
+ write(pointed, -1);
637
+ collapse();
638
+ return;
639
+ }
640
+ launch.index = -1;
641
+ launch.query = '';
642
+ shut();
643
+ expand();
644
+ });
645
+ {
646
+ let root_09fuufo11 = template_09fuufo12(), element_09fuufo13 = root_09fuufo11.firstElementChild, element_09fuufo14 = element_09fuufo13.firstChild, element_09fuufo15 = element_09fuufo13.firstElementChild.firstElementChild, element_09fuufo16 = element_09fuufo15.firstElementChild, element_09fuufo17 = element_09fuufo16.firstChild, element_09fuufo18 = element_09fuufo13.firstElementChild, element_09fuufo19 = element_09fuufo13.nextElementSibling.firstChild, element_09fuufo1a = element_09fuufo19.nextSibling, element_09fuufo1b = element_09fuufo13.nextElementSibling;
647
+ template_u1.slot(element_09fuufo14, search && (() => {
648
+ let root_09fuufo1c = template_09fuufo1d();
649
+ template_u1.slot(root_09fuufo1c, searchbox.input({
650
+ class: 'input--border toolbar-drawer-input',
651
+ oninput: (e) => {
652
+ launch.index = -1;
653
+ launch.query = e.target.value;
654
+ },
655
+ onconnect: (element) => {
656
+ field = element;
657
+ },
658
+ onkeydown: navigate,
659
+ spellcheck: false,
660
+ value: () => launch.query
661
+ }), 1);
662
+ return root_09fuufo1c;
663
+ })());
664
+ template_u1.slot(element_09fuufo17, library.render());
665
+ template_u1.slot(element_09fuufo16, filled && LETTERS.map((letter, index) => {
666
+ let root_09fuufo1e = template_09fuufo1f();
667
+ template_u1.slot(root_09fuufo1e, letter, 1);
668
+ template_u1.onconnect(root_09fuufo1e, (element) => {
669
+ headings[index] = element;
670
+ });
671
+ template_u1.setClass(root_09fuufo1e, ["toolbar-drawer-heading", () => !read(filled).has(index) && 'toolbar-drawer-heading--hidden']);
672
+ template_u1.setStyle(root_09fuufo1e, ["", () => `--toolbar-order: ${place(index)};`]);
673
+ return root_09fuufo1e;
674
+ }), 1);
675
+ new template_u1.EffectSlot(element_09fuufo15, () => !shown().length && (() => {
676
+ let root_09fuufo1g = template_09fuufo1h();
677
+ root_09fuufo1g.appendChild(template_u1.text(launch.query.trim() ? 'No results' : 'Nothing here'));
678
+ return root_09fuufo1g;
679
+ })(), 1);
680
+ template_u1.slot(element_09fuufo18, filled && rail(filled), 1);
681
+ template_u1.slot(element_09fuufo19, hint(['esc'], 'Close'));
682
+ template_u1.slot(element_09fuufo1a, hint(['icon--left', '', 'icon--up', 'icon--down'].map((direction) => sprite(arrowSvg, `toolbar-drawer-kbd-icon ${direction}`)), 'Navigate'));
683
+ template_u1.slot(element_09fuufo1b, hint([sprite(enter, 'toolbar-drawer-kbd-icon')], 'Open'), 1);
684
+ template_u1.setProperties(element_09fuufo16, sorting && library.attributes);
685
+ template_u1.onconnect(element_09fuufo16, (element) => {
686
+ cells = element;
687
+ });
688
+ template_u1.delegate(element_09fuufo16, 'wheel', () => {
689
+ cancelAnimationFrame(scrolling);
690
+ });
691
+ template_u1.setClass(element_09fuufo16, ["toolbar-drawer-apps"]);
692
+ let attributes_09fuufo1i = scrollbar({ fade: true });
693
+ template_u1.setProperties(element_09fuufo15, attributes_09fuufo1i, true);
694
+ template_u1.setClass(element_09fuufo15, ["toolbar-drawer-view", attributes_09fuufo1i?.class]);
695
+ template_u1.setStyle(element_09fuufo15, ["", attributes_09fuufo1i?.style]);
696
+ template_u1.setProperty(root_09fuufo11, 'aria-label', more);
697
+ template_u1.setProperty(root_09fuufo11, 'id', "" + (id) + "-drawer");
698
+ let attributes_09fuufo1j = keys;
699
+ template_u1.setProperties(root_09fuufo11, attributes_09fuufo1j, true);
700
+ template_u1.onconnect(root_09fuufo11, (element) => {
701
+ let resize = observer(() => {
702
+ align();
703
+ if (expanded.active) {
704
+ grow();
705
+ }
706
+ });
707
+ panel = element;
708
+ resize.observe(element);
709
+ onCleanup(resize.disconnect);
710
+ });
711
+ template_u1.delegate(root_09fuufo11, 'mousedown', keep);
712
+ template_u1.setClass(root_09fuufo11, ["tooltip-content toolbar-drawer", alphabet && 'toolbar-drawer--alphabetical', attributes_09fuufo1j?.class]);
713
+ template_u1.setStyle(root_09fuufo11, ["", attributes_09fuufo1j?.style]);
714
+ return root_09fuufo11;
715
+ }
716
+ }
717
+ function expand() {
718
+ cancelAnimationFrame(frame);
719
+ if (!fit.sized) {
720
+ hold();
721
+ Object.assign(fit, resting, { sized: true });
722
+ }
723
+ queueMicrotask(() => {
724
+ shelf?.getBoundingClientRect();
725
+ frame = requestAnimationFrame(() => {
726
+ expanded.active = true;
727
+ fit.morphing = true;
728
+ align();
729
+ grow();
730
+ (field ?? panel)?.focus({ preventScroll: true });
731
+ });
732
+ });
733
+ }
734
+ function glide(letter, letters) {
735
+ let target = -1;
736
+ for (let i = letter, n = LETTERS.length; i < n && target === -1; i++) {
737
+ if (letters.has(i)) {
738
+ target = i;
739
+ }
740
+ }
741
+ for (let i = letter - 1; i >= 0 && target === -1; i--) {
742
+ if (letters.has(i)) {
743
+ target = i;
744
+ }
745
+ }
746
+ let heading = headings[target], view = cells?.parentElement;
747
+ if (!cells || !heading || !view) {
748
+ return;
749
+ }
750
+ let duration = matchMedia('(prefers-reduced-motion: reduce)').matches ? 0 : GLIDE, from = view.scrollTop, start = performance.now(), to = Math.max(0, Math.min(heading.getBoundingClientRect().top - view.getBoundingClientRect().top + from - (parseFloat(getComputedStyle(cells).paddingTop) || 0), view.scrollHeight - view.clientHeight));
751
+ let tick = (now) => {
752
+ let progress = duration ? Math.min((now - start) / duration, 1) : 1;
753
+ view.scrollTop = from + (to - from) * (1 - (1 - progress) ** 3);
754
+ if (progress < 1) {
755
+ scrolling = requestAnimationFrame(tick);
756
+ }
757
+ };
758
+ cancelAnimationFrame(scrolling);
759
+ tick(start);
760
+ }
761
+ function grow() {
762
+ if (!panel) {
763
+ return;
764
+ }
765
+ fit.height = panel.offsetHeight;
766
+ fit.radius = parseFloat(getComputedStyle(panel).borderTopLeftRadius) || 0;
767
+ fit.width = panel.offsetWidth;
768
+ }
769
+ function hidden(entry) {
770
+ if (!scroll.count) {
771
+ return false;
772
+ }
773
+ entries.$length;
774
+ scroll.order;
775
+ let index = entries.indexOf(entry);
776
+ return index < scroll.first || index >= scroll.first + scroll.count;
777
+ }
778
+ function hold() {
779
+ if (!shelf) {
780
+ return;
781
+ }
782
+ resting = {
783
+ height: shelf.offsetHeight,
784
+ radius: Math.min(parseFloat(getComputedStyle(shelf).borderTopLeftRadius) || 0, shelf.offsetHeight / 2, shelf.offsetWidth / 2),
785
+ width: shelf.offsetWidth
786
+ };
787
+ }
788
+ function land() {
789
+ if (!fit.sized) {
790
+ return;
791
+ }
792
+ if ((fit.height === resting.height && fit.width === resting.width) ||
793
+ !shelf ||
794
+ !parseFloat(getComputedStyle(shelf).getPropertyValue('--morph-duration'))) {
795
+ release();
796
+ return;
797
+ }
798
+ Object.assign(fit, resting);
799
+ }
800
+ function landed(member) {
801
+ let path = read(trail);
802
+ removeEventListener('pointermove', stray);
803
+ tidy();
804
+ if (!folder.active && path.length && path[path.length - 1].items.includes(member)) {
805
+ folder.active = true;
806
+ }
807
+ }
808
+ function lift(active) {
809
+ if (active) {
810
+ collapse();
811
+ }
812
+ else if (state.active) {
813
+ expand();
814
+ }
815
+ }
816
+ function lifted() {
817
+ addEventListener('pointermove', stray);
818
+ }
819
+ function matches(item) {
820
+ if (grouped(item)) {
821
+ return true;
822
+ }
823
+ let query = launch.query.trim().toLowerCase();
824
+ return !query || text(item.label).toLowerCase().includes(query);
825
+ }
826
+ function measure() {
827
+ if (!arrows || !track || !viewport) {
828
+ return;
829
+ }
830
+ measuring.active = true;
831
+ flush();
832
+ let gap = parseFloat(getComputedStyle(track)[vertical ? 'rowGap' : 'columnGap']) || 0, length = vertical ? 'offsetHeight' : 'offsetWidth', pitch = rest(length) + gap, room = vertical ? viewport.clientHeight : viewport.clientWidth, span = track[length];
833
+ measuring.active = false;
834
+ flush();
835
+ if (span <= room) {
836
+ scroll.count = 0;
837
+ scroll.first = 0;
838
+ return;
839
+ }
840
+ scroll.count = Math.max(1, Math.floor((room + gap) / pitch));
841
+ scroll.first = Math.max(0, Math.min(scroll.first, entries.$length - scroll.count));
842
+ }
843
+ function motion(item) {
844
+ let current = launching.get(item);
845
+ if (!current) {
846
+ current = new ReactiveObject_09fuufo7();
847
+ launching.set(item, current);
848
+ }
849
+ return current;
850
+ }
851
+ function naming(member) {
852
+ let current = names.get(member);
853
+ if (!current) {
854
+ current = new ReactiveObject_09fuufo8(member.label ? text(member.label) : '');
855
+ names.set(member, current);
856
+ }
857
+ return current;
858
+ }
859
+ function navigate(e) {
860
+ if (e.isComposing) {
861
+ return;
862
+ }
863
+ let list = shown(), row = { ArrowDown: 1, ArrowUp: -1 }[e.key], step = { ArrowLeft: -1, ArrowRight: 1 }[e.key];
864
+ if (row || step) {
865
+ e.preventDefault();
866
+ if (list.length) {
867
+ launch.index = launch.index < 0
868
+ ? 0
869
+ : row ? across(list, selected(), row) : Math.min(Math.max(selected() + step, 0), list.length - 1);
870
+ requestAnimationFrame(() => {
871
+ cells?.querySelector('.toolbar-app.--active')?.scrollIntoView({ block: 'nearest' });
872
+ });
873
+ }
874
+ }
875
+ else if (e.key === 'Enter') {
876
+ e.preventDefault();
877
+ (cells?.querySelector('.toolbar-app.--active > .toolbar-button') ?? cells?.querySelector('.toolbar-app:not(.toolbar-app--hidden) > .toolbar-button'))
878
+ ?.dispatchEvent(new MouseEvent('click', { bubbles: true }));
879
+ }
880
+ }
881
+ function open(item) {
882
+ state.active = false;
883
+ shut();
884
+ if (!dock) {
885
+ return;
886
+ }
887
+ let app = status(item);
888
+ if (app.running) {
889
+ return;
890
+ }
891
+ app.running = true;
892
+ motion(item).launching = true;
893
+ onlaunch?.(text(item.label));
894
+ }
895
+ function page(step) {
896
+ scroll.first = Math.max(0, Math.min(scroll.first + step * scroll.count, entries.$length - scroll.count));
897
+ }
898
+ function pane() {
899
+ {
900
+ let root_09fuufo1k = template_09fuufo1l(), element_09fuufo1m = root_09fuufo1k.firstChild, element_09fuufo1n = root_09fuufo1k.firstElementChild;
901
+ new template_u1.EffectSlot(element_09fuufo1m, () => {
902
+ let path = read(trail);
903
+ if (path.length < 2) {
904
+ return '';
905
+ }
906
+ {
907
+ let root_09fuufo1o = template_09fuufo1p();
908
+ template_u1.slot(root_09fuufo1o, path.slice(0, -1).map((member, index) => {
909
+ let root_09fuufo1q = template_09fuufo1r(), element_09fuufo1s = root_09fuufo1q.firstElementChild;
910
+ new template_u1.EffectSlot(element_09fuufo1s, () => naming(member).value || 'Group', 1);
911
+ template_u1.setProperty(root_09fuufo1q, 'aria-label', () => `Back to ${naming(member).value || 'Group'}`);
912
+ template_u1.delegate(root_09fuufo1q, 'click', () => {
913
+ write(trail, path.slice(0, index + 1));
914
+ });
915
+ template_u1.setClass(root_09fuufo1q, ["toolbar-group-trail-item"]);
916
+ return root_09fuufo1q;
917
+ }), 1);
918
+ return root_09fuufo1o;
919
+ }
920
+ });
921
+ new template_u1.EffectSlot(element_09fuufo1n, () => {
922
+ let path = read(trail), current = path[path.length - 1];
923
+ return current && contents(current);
924
+ }, 1);
925
+ template_u1.setClass(element_09fuufo1n, ["toolbar-group-card", () => read(trail).length > 1 && 'toolbar-group-card--nested']);
926
+ template_u1.setProperty(root_09fuufo1k, 'id', "" + (id) + "-group");
927
+ template_u1.setProperty(root_09fuufo1k, 'aria-label', () => {
928
+ let path = read(trail), current = path[path.length - 1];
929
+ return (current && naming(current).value) || 'Group';
930
+ });
931
+ template_u1.setProperty(root_09fuufo1k, 'inert', () => !folder.active);
932
+ template_u1.onconnect(root_09fuufo1k, (element) => {
933
+ sheet = element;
934
+ });
935
+ template_u1.ondocument(root_09fuufo1k, 'keydown', (e) => {
936
+ if (e.key === 'Escape' && folder.active && !e.defaultPrevented) {
937
+ e.preventDefault();
938
+ shut(true);
939
+ }
940
+ });
941
+ template_u1.ondocument(root_09fuufo1k, 'pointerdown', (e) => {
942
+ if (folder.active && !shelf?.contains(e.target)) {
943
+ shut();
944
+ }
945
+ });
946
+ template_u1.setClass(root_09fuufo1k, ["toolbar-group", () => folder.active && '--active']);
947
+ template_u1.setStyle(root_09fuufo1k, ["", () => `--group-x: ${folder.x}px; --group-y: ${folder.y}px;`]);
948
+ return root_09fuufo1k;
949
+ }
950
+ }
951
+ function place(letter, rank = -1) {
952
+ return letter * ((stash?.$length ?? 0) + 1) + rank + 1;
953
+ }
954
+ function prune(items) {
955
+ for (let i = items.$length - 1; i >= 0; i--) {
956
+ let entry = items[i];
957
+ if (!grouped(entry)) {
958
+ continue;
959
+ }
960
+ prune(entry.items);
961
+ if (entry.items.$length > 1) {
962
+ continue;
963
+ }
964
+ items.splice(i, 1);
965
+ if (entry.items.$length) {
966
+ let only = entry.items[0];
967
+ entry.items.splice(0, 1);
968
+ items.splice(i, 0, only);
969
+ sorted(only, 0, i, entry.items, items);
970
+ }
971
+ }
972
+ }
973
+ function rail(letters) {
974
+ let element;
975
+ function leave() {
976
+ write(pointed, -1);
977
+ }
978
+ function point(e) {
979
+ let first = element?.firstElementChild, last = element?.lastElementChild;
980
+ if (!first || !last) {
981
+ return;
982
+ }
983
+ let top = first.getBoundingClientRect().top, height = last.getBoundingClientRect().bottom - top, letter = Math.max(0, Math.min(Math.floor((e.clientY - top) / height * LETTERS.length), LETTERS.length - 1));
984
+ if (letter === read(pointed)) {
985
+ return;
986
+ }
987
+ write(pointed, letter);
988
+ glide(letter, read(letters));
989
+ }
990
+ {
991
+ let root_09fuufo1t = template_09fuufo1f();
992
+ template_u1.slot(root_09fuufo1t, LETTERS.map((letter, index) => {
993
+ let root_09fuufo1u = template_09fuufo1v();
994
+ template_u1.slot(root_09fuufo1u, letter, 1);
995
+ template_u1.setClass(root_09fuufo1u, ["toolbar-rail-letter", [() => !read(letters).has(index) && 'toolbar-rail-letter--empty', () => signal.selector(pointed, index) && '--active']]);
996
+ return root_09fuufo1u;
997
+ }), 1);
998
+ template_u1.onconnect(root_09fuufo1t, (connected) => {
999
+ element = connected;
1000
+ });
1001
+ template_u1.delegate(root_09fuufo1t, 'pointercancel', leave);
1002
+ template_u1.delegate(root_09fuufo1t, 'pointerdown', (e) => {
1003
+ if (e.pointerType !== 'mouse') {
1004
+ element?.setPointerCapture(e.pointerId);
1005
+ }
1006
+ point(e);
1007
+ });
1008
+ template_u1.direct(root_09fuufo1t, 'pointerleave', leave);
1009
+ template_u1.delegate(root_09fuufo1t, 'pointermove', point);
1010
+ template_u1.delegate(root_09fuufo1t, 'pointerup', (e) => {
1011
+ if (e.pointerType !== 'mouse') {
1012
+ leave();
1013
+ }
1014
+ });
1015
+ template_u1.setClass(root_09fuufo1t, ["toolbar-rail"]);
1016
+ return root_09fuufo1t;
1017
+ }
1018
+ }
1019
+ function release() {
1020
+ fit.morphing = false;
1021
+ fit.sized = false;
1022
+ }
1023
+ function rest(length) {
1024
+ let children = track?.children ?? [], min = Infinity;
1025
+ for (let i = 0, n = children.length; i < n; i++) {
1026
+ if (children[i].classList.contains('toolbar-item')) {
1027
+ min = Math.min(min, children[i][length] || Infinity);
1028
+ }
1029
+ }
1030
+ return min === Infinity ? 1 : min;
1031
+ }
1032
+ function reveal(member, button, nested, keyed) {
1033
+ if (nested) {
1034
+ write(trail, [...read(trail), member]);
1035
+ }
1036
+ else if (folder.active && read(trail)[0] === member) {
1037
+ shut();
1038
+ return;
1039
+ }
1040
+ else if (shelf) {
1041
+ let bar = shelf.getBoundingClientRect(), slot = (button.closest('.toolbar-item') ?? button).getBoundingClientRect();
1042
+ state.active = false;
1043
+ opener = button;
1044
+ folder.x = slot.left + slot.width / 2 - bar.left;
1045
+ folder.y = slot.top + slot.height / 2 - bar.top;
1046
+ write(trail, [member]);
1047
+ folder.active = true;
1048
+ }
1049
+ if (keyed) {
1050
+ requestAnimationFrame(() => {
1051
+ sheet?.querySelector('.toolbar-app > .toolbar-button')?.focus();
1052
+ });
1053
+ }
1054
+ }
1055
+ function rove(current) {
1056
+ let list = roving();
1057
+ for (let i = 0, n = list.length; i < n; i++) {
1058
+ list[i].tabIndex = list[i] === (current && list.includes(current) ? current : list[0]) ? 0 : -1;
1059
+ }
1060
+ }
1061
+ function roving() {
1062
+ let children = track?.children ?? [], list = [];
1063
+ for (let i = 0, n = children.length; i < n; i++) {
1064
+ let child = children[i], control = child.classList.contains('toolbar-item')
1065
+ ? child.querySelector(':scope > .toolbar-button')
1066
+ : child.classList.contains('toolbar-custom') ? child.querySelector(FOCUSABLE) : null;
1067
+ if (control && !control.closest('[hidden], .toolbar-custom--hidden, .toolbar-item--hidden') && !control.matches(':disabled')) {
1068
+ list.push(control);
1069
+ }
1070
+ }
1071
+ return list;
1072
+ }
1073
+ function selected() {
1074
+ return launch.index < 0 ? -1 : Math.min(launch.index, shown().length - 1);
1075
+ }
1076
+ function shown() {
1077
+ if (!stash) {
1078
+ return [];
1079
+ }
1080
+ stash.$length;
1081
+ let list = stash.filter(matches);
1082
+ if (alphabet) {
1083
+ let places = read(alphabet);
1084
+ list.sort((a, b) => places.get(a).rank - places.get(b).rank);
1085
+ }
1086
+ return list;
1087
+ }
1088
+ function shut(restore = false) {
1089
+ if (!folder.active) {
1090
+ return;
1091
+ }
1092
+ folder.active = false;
1093
+ if (restore && sheet?.contains(document.activeElement)) {
1094
+ opener?.focus();
1095
+ }
1096
+ }
1097
+ function slot(entry, attributes) {
1098
+ if (entry === TOOLBAR_DRAWER) {
1099
+ return door();
1100
+ }
1101
+ if (DIVIDER in entry) {
1102
+ return divide(entry);
1103
+ }
1104
+ if (CUSTOM in entry) {
1105
+ return custom(entry);
1106
+ }
1107
+ let named = grouped(entry) ? () => naming(entry).value : undefined;
1108
+ {
1109
+ let root_09fuufo1w = template_09fuufo1x(), element_09fuufo1y = root_09fuufo1w.firstChild, element_09fuufo1z = element_09fuufo1y.nextSibling;
1110
+ template_u1.slot(element_09fuufo1y, grouped(entry) ? bunch(entry, false) : control(entry));
1111
+ template_u1.slot(element_09fuufo1z, labels && (() => {
1112
+ let root_09fuufo20 = template_09fuufo21();
1113
+ template_u1.slot(root_09fuufo20, named ?? entry.label, 1);
1114
+ return root_09fuufo20;
1115
+ })());
1116
+ template_u1.slot(root_09fuufo1w, dock && !grouped(entry) && (() => {
1117
+ let root_09fuufo22 = template_09fuufox();
1118
+ template_u1.setClass(root_09fuufo22, ["toolbar-light", () => status(entry).running && '--active']);
1119
+ return root_09fuufo22;
1120
+ })(), 1);
1121
+ let attributes_09fuufo23 = sorting ? attributes : {};
1122
+ template_u1.setProperties(root_09fuufo1w, attributes_09fuufo23, true);
1123
+ template_u1.delegate(root_09fuufo1w, 'click', relay);
1124
+ template_u1.onconnect(root_09fuufo1w, (element) => {
1125
+ element[LABEL] = named ?? (grouped(entry) ? '' : entry.hint ?? entry.label);
1126
+ element[MEMBER] = entry;
1127
+ });
1128
+ template_u1.setClass(root_09fuufo1w, ["toolbar-item", attributes_09fuufo23?.class, [() => hidden(entry) && 'toolbar-item--hidden', () => named && !named() && 'toolbar-item--quiet']]);
1129
+ template_u1.setStyle(root_09fuufo1w, ["", attributes_09fuufo23?.style]);
1130
+ return root_09fuufo1w;
1131
+ }
1132
+ }
1133
+ function sorted(item, from, to, source, target) {
1134
+ scroll.order++;
1135
+ onsort?.(item, from, to, source, target);
1136
+ }
1137
+ function status(item) {
1138
+ let current = running.get(item);
1139
+ if (!current) {
1140
+ current = item.state ?? new ReactiveObject_09fuufo9(item.running ?? false);
1141
+ running.set(item, current);
1142
+ }
1143
+ return current;
1144
+ }
1145
+ function step(e) {
1146
+ let target = e.target;
1147
+ if (e.defaultPrevented || target.matches('input, textarea, [contenteditable]')) {
1148
+ return;
1149
+ }
1150
+ let list = roving(), at = list.indexOf(target), move = ROVE[vertical ? 'vertical' : 'horizontal'][e.key], next = e.key === 'Home' ? list[0] : e.key === 'End' ? list[list.length - 1] : move && at !== -1 ? list[(at + move + list.length) % list.length] : null;
1151
+ if (!next) {
1152
+ return;
1153
+ }
1154
+ e.preventDefault();
1155
+ rove(next);
1156
+ next.focus();
1157
+ }
1158
+ function stray(e) {
1159
+ let box = sheet?.getBoundingClientRect();
1160
+ if (box && (e.clientX < box.left - SLACK || e.clientX > box.right + SLACK || e.clientY < box.top - SLACK || e.clientY > box.bottom + SLACK)) {
1161
+ removeEventListener('pointermove', stray);
1162
+ shut();
1163
+ }
1164
+ }
1165
+ function thrown(item, from, list) {
1166
+ if (!stash || !movable(item)) {
1167
+ return;
1168
+ }
1169
+ let spread = buttons(item);
1170
+ for (let i = 0, n = spread.length; i < n; i++) {
1171
+ stash.push(spread[i]);
1172
+ }
1173
+ sorted(item, from, stash.$length - 1, list, stash);
1174
+ tidy();
1175
+ }
1176
+ function tidy() {
1177
+ prune(entries);
1178
+ if (stash) {
1179
+ for (let i = stash.$length - 1; i >= 0; i--) {
1180
+ let item = stash[i];
1181
+ if (grouped(item)) {
1182
+ stash.splice(i, 1, ...buttons(item));
1183
+ }
1184
+ }
1185
+ }
1186
+ let kept = 0, path = read(trail);
1187
+ while (kept < path.length && (kept === 0 ? entries : path[kept - 1].items).includes(path[kept])) {
1188
+ kept++;
1189
+ }
1190
+ if (kept === path.length) {
1191
+ return;
1192
+ }
1193
+ write(trail, path.slice(0, kept));
1194
+ if (!kept) {
1195
+ shut();
1196
+ }
1197
+ }
1198
+ if (!stash && marker !== -1) {
1199
+ entries.splice(marker, 1);
1200
+ }
1201
+ else if (stash && marker === -1) {
1202
+ entries.push(TOOLBAR_DRAWER);
1203
+ }
1204
+ let combining = gathering ? { accepts: admits, oncombine: combine } : undefined, list = sortable(entries, slot, {
1205
+ combine: combining,
1206
+ drag: copy,
1207
+ group: id,
1208
+ onland: tidy,
1209
+ onlift: (entry) => {
1210
+ if (grouped(entry) && read(trail).includes(entry)) {
1211
+ shut();
1212
+ }
1213
+ },
1214
+ onsort: sorted,
1215
+ onthrow: sorting && stash ? thrown : undefined
1216
+ }), tip = tooltip.shared({ 'aria-hidden': 'true', axis: vertical ? 'x' : 'y', class: 'toolbar-label', delay: { open: delay }, swap: false });
1217
+ if (!dock) {
1218
+ effect(() => {
1219
+ entries.$length;
1220
+ scroll.order;
1221
+ requestAnimationFrame(() => rove(roving().find((control) => control.tabIndex === 0)));
1222
+ });
1223
+ }
1224
+ {
1225
+ let root_09fuufo2p = template_09fuufo2q(), element_09fuufo2r = root_09fuufo2p.firstChild, element_09fuufo2s = root_09fuufo2p.firstElementChild, element_09fuufo2t = element_09fuufo2s.firstElementChild, element_09fuufo2u = element_09fuufo2r.nextSibling.nextSibling, element_09fuufo2v = element_09fuufo2u.nextSibling, element_09fuufo2w = element_09fuufo2v.nextSibling;
1226
+ template_u1.slot(element_09fuufo2r, arrows && arrow(-1));
1227
+ template_u1.slot(element_09fuufo2t, list.render(), 1);
1228
+ template_u1.slot(element_09fuufo2u, arrows && arrow(1));
1229
+ template_u1.slot(element_09fuufo2v, tip.render());
1230
+ template_u1.slot(element_09fuufo2w, stash && drawer(stash));
1231
+ template_u1.slot(root_09fuufo2p, pane(), 1);
1232
+ template_u1.setProperties(element_09fuufo2t, sorting && list.attributes);
1233
+ template_u1.setClass(element_09fuufo2t, ["toolbar-items"]);
1234
+ template_u1.onconnect(element_09fuufo2s, (element) => {
1235
+ track = element.firstElementChild;
1236
+ viewport = element;
1237
+ });
1238
+ template_u1.setClass(element_09fuufo2s, ["toolbar-viewport"]);
1239
+ let attributes_09fuufo2x = attributes;
1240
+ template_u1.setProperties(root_09fuufo2p, attributes_09fuufo2x, true);
1241
+ template_u1.setProperties(root_09fuufo2p, !labels && tip.delegate({ content: name, edge: true, selector: '.toolbar-item:not(.toolbar-item--quiet), .toolbar-custom--hinted' }));
1242
+ template_u1.setProperties(root_09fuufo2p, popup);
1243
+ template_u1.setProperty(root_09fuufo2p, 'aria-label', label);
1244
+ template_u1.setProperty(root_09fuufo2p, 'aria-orientation', vertical ? 'vertical' : 'horizontal');
1245
+ template_u1.onconnect(root_09fuufo2p, (element, on) => {
1246
+ shelf = element;
1247
+ if (!dock) {
1248
+ on(element, 'focusin', (e) => rove(e.target), { direct: true });
1249
+ on(element, 'keydown', step, { direct: true });
1250
+ rove();
1251
+ }
1252
+ if (!arrows) {
1253
+ return;
1254
+ }
1255
+ let resize = observer(measure);
1256
+ for (let node of [element, element.parentElement, track, viewport]) {
1257
+ if (node) {
1258
+ resize.observe(node);
1259
+ }
1260
+ }
1261
+ onCleanup(resize.disconnect);
1262
+ });
1263
+ template_u1.delegate(root_09fuufo2p, 'transitionend', (e) => {
1264
+ if (e.target === e.currentTarget && e.propertyName === 'height' && !expanded.active) {
1265
+ release();
1266
+ }
1267
+ });
1268
+ template_u1.setProperty(root_09fuufo2p, 'role', dock ? 'navigation' : 'toolbar');
1269
+ template_u1.setClass(root_09fuufo2p, ["toolbar", "toolbar--" + (direction), labels && 'toolbar--labels', stash && 'tooltip', attributes_09fuufo2x?.class, [
1270
+ () => expanded.active && 'toolbar--expanded',
1271
+ () => fit.morphing && 'toolbar--morphing',
1272
+ () => fit.sized && 'toolbar--sized',
1273
+ () => measuring.active && 'toolbar--measuring',
1274
+ () => state.active && 'toolbar--open',
1275
+ () => scroll.count > 0 && 'toolbar--overflowing'
1276
+ ]]);
1277
+ template_u1.setStyle(root_09fuufo2p, ["", attributes_09fuufo2x?.style, () => fit.sized && `--fit-depth: ${vertical ? resting.width : resting.height}px; --fit-height: ${fit.height}px; --fit-radius: ${fit.radius}px; --fit-width: ${fit.width}px;`]);
1278
+ return root_09fuufo2p;
1279
+ }
1280
+ };
1281
+ export default component(toolbar, { button, divider, drawer, group, item });