@adea-ai/ui 0.154.0 → 0.154.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (554) hide show
  1. package/README.md +10 -10
  2. package/dist/components/composites/about-dialog/about-dialog.d.ts.map +1 -1
  3. package/dist/components/composites/about-dialog/about-dialog.js +3 -1
  4. package/dist/components/composites/about-dialog/about-dialog.js.map +1 -1
  5. package/dist/components/composites/accent-picker/accent-picker.js +20 -9
  6. package/dist/components/composites/accent-picker/accent-picker.js.map +1 -1
  7. package/dist/components/composites/account-menu/account-menu.d.ts.map +1 -1
  8. package/dist/components/composites/account-menu/account-menu.js +20 -10
  9. package/dist/components/composites/account-menu/account-menu.js.map +1 -1
  10. package/dist/components/composites/action-button/action-button.d.ts.map +1 -1
  11. package/dist/components/composites/action-button/action-button.js +37 -24
  12. package/dist/components/composites/action-button/action-button.js.map +1 -1
  13. package/dist/components/composites/appearance-editor/appearance-choices.d.ts.map +1 -1
  14. package/dist/components/composites/appearance-editor/appearance-choices.js +7 -3
  15. package/dist/components/composites/appearance-editor/appearance-choices.js.map +1 -1
  16. package/dist/components/composites/appearance-editor/appearance-editor.d.ts.map +1 -1
  17. package/dist/components/composites/appearance-editor/appearance-editor.js +11 -6
  18. package/dist/components/composites/appearance-editor/appearance-editor.js.map +1 -1
  19. package/dist/components/composites/appearance-editor/appearance-rows.d.ts.map +1 -1
  20. package/dist/components/composites/appearance-editor/appearance-rows.js +8 -3
  21. package/dist/components/composites/appearance-editor/appearance-rows.js.map +1 -1
  22. package/dist/components/composites/appearance-editor/font-settings-group.d.ts.map +1 -1
  23. package/dist/components/composites/appearance-editor/font-settings-group.js +8 -4
  24. package/dist/components/composites/appearance-editor/font-settings-group.js.map +1 -1
  25. package/dist/components/composites/catalog-browser/catalog-browser-group.d.ts.map +1 -1
  26. package/dist/components/composites/catalog-browser/catalog-browser-group.js +7 -3
  27. package/dist/components/composites/catalog-browser/catalog-browser-group.js.map +1 -1
  28. package/dist/components/composites/catalog-browser/catalog-browser.d.ts.map +1 -1
  29. package/dist/components/composites/catalog-browser/catalog-browser.js +8 -4
  30. package/dist/components/composites/catalog-browser/catalog-browser.js.map +1 -1
  31. package/dist/components/composites/chain-of-thought/chain-of-thought.d.ts.map +1 -1
  32. package/dist/components/composites/chain-of-thought/chain-of-thought.js +3 -1
  33. package/dist/components/composites/chain-of-thought/chain-of-thought.js.map +1 -1
  34. package/dist/components/composites/chat/chat.d.ts.map +1 -1
  35. package/dist/components/composites/chat/chat.js +5 -1
  36. package/dist/components/composites/chat/chat.js.map +1 -1
  37. package/dist/components/composites/checkpoint/checkpoint.d.ts.map +1 -1
  38. package/dist/components/composites/checkpoint/checkpoint.js +3 -1
  39. package/dist/components/composites/checkpoint/checkpoint.js.map +1 -1
  40. package/dist/components/composites/confirmation/confirmation.d.ts.map +1 -1
  41. package/dist/components/composites/confirmation/confirmation.js +11 -5
  42. package/dist/components/composites/confirmation/confirmation.js.map +1 -1
  43. package/dist/components/composites/context/context.d.ts.map +1 -1
  44. package/dist/components/composites/context/context.js +7 -4
  45. package/dist/components/composites/context/context.js.map +1 -1
  46. package/dist/components/composites/file-tree/file-tree.d.ts.map +1 -1
  47. package/dist/components/composites/file-tree/file-tree.js +7 -3
  48. package/dist/components/composites/file-tree/file-tree.js.map +1 -1
  49. package/dist/components/composites/help-center/help-center.d.ts.map +1 -1
  50. package/dist/components/composites/help-center/help-center.js +3 -1
  51. package/dist/components/composites/help-center/help-center.js.map +1 -1
  52. package/dist/components/composites/icon-picker/icon-picker.d.ts +2 -2
  53. package/dist/components/composites/icon-picker/icon-picker.d.ts.map +1 -1
  54. package/dist/components/composites/icon-picker/icon-picker.js +77 -71
  55. package/dist/components/composites/icon-picker/icon-picker.js.map +1 -1
  56. package/dist/components/composites/icon-picker/shell-icons.d.ts.map +1 -1
  57. package/dist/components/composites/icon-picker/shell-icons.js +119 -59
  58. package/dist/components/composites/icon-picker/shell-icons.js.map +1 -1
  59. package/dist/components/composites/inline-citation/inline-citation.d.ts.map +1 -1
  60. package/dist/components/composites/inline-citation/inline-citation.js +5 -2
  61. package/dist/components/composites/inline-citation/inline-citation.js.map +1 -1
  62. package/dist/components/composites/list-row/list-row-control.d.ts.map +1 -1
  63. package/dist/components/composites/list-row/list-row-control.js +3 -4
  64. package/dist/components/composites/list-row/list-row-control.js.map +1 -1
  65. package/dist/components/composites/message-scroller/message-scroller.d.ts.map +1 -1
  66. package/dist/components/composites/message-scroller/message-scroller.js +5 -2
  67. package/dist/components/composites/message-scroller/message-scroller.js.map +1 -1
  68. package/dist/components/composites/model-selector/model-selector.d.ts.map +1 -1
  69. package/dist/components/composites/model-selector/model-selector.js +9 -5
  70. package/dist/components/composites/model-selector/model-selector.js.map +1 -1
  71. package/dist/components/composites/plan/plan.d.ts.map +1 -1
  72. package/dist/components/composites/plan/plan.js +3 -1
  73. package/dist/components/composites/plan/plan.js.map +1 -1
  74. package/dist/components/composites/queue/queue.d.ts.map +1 -1
  75. package/dist/components/composites/queue/queue.js +11 -5
  76. package/dist/components/composites/queue/queue.js.map +1 -1
  77. package/dist/components/composites/reasoning/reasoning.d.ts.map +1 -1
  78. package/dist/components/composites/reasoning/reasoning.js +3 -1
  79. package/dist/components/composites/reasoning/reasoning.js.map +1 -1
  80. package/dist/components/composites/scene-controls/scene-controls.d.ts.map +1 -1
  81. package/dist/components/composites/scene-controls/scene-controls.js +14 -7
  82. package/dist/components/composites/scene-controls/scene-controls.js.map +1 -1
  83. package/dist/components/composites/settings/settings.d.ts.map +1 -1
  84. package/dist/components/composites/settings/settings.js +77 -67
  85. package/dist/components/composites/settings/settings.js.map +1 -1
  86. package/dist/components/composites/sources/sources.d.ts.map +1 -1
  87. package/dist/components/composites/sources/sources.js +39 -39
  88. package/dist/components/composites/sources/sources.js.map +1 -1
  89. package/dist/components/composites/stack-trace/stack-trace.d.ts.map +1 -1
  90. package/dist/components/composites/stack-trace/stack-trace.js +9 -4
  91. package/dist/components/composites/stack-trace/stack-trace.js.map +1 -1
  92. package/dist/components/composites/stat/stat.d.ts.map +1 -1
  93. package/dist/components/composites/stat/stat.js +4 -1
  94. package/dist/components/composites/stat/stat.js.map +1 -1
  95. package/dist/components/composites/subagent/subagent.d.ts.map +1 -1
  96. package/dist/components/composites/subagent/subagent.js +3 -1
  97. package/dist/components/composites/subagent/subagent.js.map +1 -1
  98. package/dist/components/composites/task/task.d.ts.map +1 -1
  99. package/dist/components/composites/task/task.js +3 -1
  100. package/dist/components/composites/task/task.js.map +1 -1
  101. package/dist/components/composites/terminal/ansi.d.ts.map +1 -1
  102. package/dist/components/composites/terminal/ansi.js +16 -0
  103. package/dist/components/composites/terminal/ansi.js.map +1 -1
  104. package/dist/components/composites/terminal/terminal.d.ts.map +1 -1
  105. package/dist/components/composites/terminal/terminal.js +15 -7
  106. package/dist/components/composites/terminal/terminal.js.map +1 -1
  107. package/dist/components/composites/test-results/test-results.d.ts.map +1 -1
  108. package/dist/components/composites/test-results/test-results.js +15 -7
  109. package/dist/components/composites/test-results/test-results.js.map +1 -1
  110. package/dist/components/composites/tool/tool.d.ts.map +1 -1
  111. package/dist/components/composites/tool/tool.js +3 -1
  112. package/dist/components/composites/tool/tool.js.map +1 -1
  113. package/dist/components/composites/tree/tree.d.ts.map +1 -1
  114. package/dist/components/composites/tree/tree.js +3 -1
  115. package/dist/components/composites/tree/tree.js.map +1 -1
  116. package/dist/components/composites/update-dialog/update-dialog.d.ts.map +1 -1
  117. package/dist/components/composites/update-dialog/update-dialog.js +34 -24
  118. package/dist/components/composites/update-dialog/update-dialog.js.map +1 -1
  119. package/dist/components/composites/workspace-mark/workspace-mark.d.ts.map +1 -1
  120. package/dist/components/composites/workspace-mark/workspace-mark.js +17 -12
  121. package/dist/components/composites/workspace-mark/workspace-mark.js.map +1 -1
  122. package/dist/components/composites/workspace-switcher/workspace-reorder-dialog.d.ts.map +1 -1
  123. package/dist/components/composites/workspace-switcher/workspace-reorder-dialog.js +5 -2
  124. package/dist/components/composites/workspace-switcher/workspace-reorder-dialog.js.map +1 -1
  125. package/dist/components/composites/workspace-switcher/workspace-switcher.d.ts.map +1 -1
  126. package/dist/components/composites/workspace-switcher/workspace-switcher.js +9 -4
  127. package/dist/components/composites/workspace-switcher/workspace-switcher.js.map +1 -1
  128. package/dist/components/conversation/busy-send-button.d.ts.map +1 -1
  129. package/dist/components/conversation/busy-send-button.js +9 -5
  130. package/dist/components/conversation/busy-send-button.js.map +1 -1
  131. package/dist/components/conversation/conversation-avatar.d.ts.map +1 -1
  132. package/dist/components/conversation/conversation-avatar.js +6 -3
  133. package/dist/components/conversation/conversation-avatar.js.map +1 -1
  134. package/dist/components/conversation/conversation-surface.d.ts.map +1 -1
  135. package/dist/components/conversation/conversation-surface.js +3 -1
  136. package/dist/components/conversation/conversation-surface.js.map +1 -1
  137. package/dist/components/conversation/internal/chat-composer-shell.d.ts.map +1 -1
  138. package/dist/components/conversation/internal/chat-composer-shell.js +9 -4
  139. package/dist/components/conversation/internal/chat-composer-shell.js.map +1 -1
  140. package/dist/components/conversation/message-composer.d.ts.map +1 -1
  141. package/dist/components/conversation/message-composer.js +9 -4
  142. package/dist/components/conversation/message-composer.js.map +1 -1
  143. package/dist/components/conversation/message-row.d.ts.map +1 -1
  144. package/dist/components/conversation/message-row.js +11 -5
  145. package/dist/components/conversation/message-row.js.map +1 -1
  146. package/dist/components/conversation/thread-panel.d.ts.map +1 -1
  147. package/dist/components/conversation/thread-panel.js +3 -1
  148. package/dist/components/conversation/thread-panel.js.map +1 -1
  149. package/dist/components/conversation/transcript-composition.d.ts.map +1 -1
  150. package/dist/components/conversation/transcript-composition.js +3 -1
  151. package/dist/components/conversation/transcript-composition.js.map +1 -1
  152. package/dist/components/layout/floating-preview/floating-preview.d.ts.map +1 -1
  153. package/dist/components/layout/floating-preview/floating-preview.js +5 -2
  154. package/dist/components/layout/floating-preview/floating-preview.js.map +1 -1
  155. package/dist/components/layout/pixel-resize-handle/pixel-resize-handle.d.ts.map +1 -1
  156. package/dist/components/layout/pixel-resize-handle/pixel-resize-handle.js +3 -1
  157. package/dist/components/layout/pixel-resize-handle/pixel-resize-handle.js.map +1 -1
  158. package/dist/components/layout/shell-rail/shell-rail.d.ts.map +1 -1
  159. package/dist/components/layout/shell-rail/shell-rail.js +3 -1
  160. package/dist/components/layout/shell-rail/shell-rail.js.map +1 -1
  161. package/dist/components/layout/sidebar-nav/sidebar-nav.d.ts.map +1 -1
  162. package/dist/components/layout/sidebar-nav/sidebar-nav.js +3 -1
  163. package/dist/components/layout/sidebar-nav/sidebar-nav.js.map +1 -1
  164. package/dist/components/layout/split-layout/split-layout.d.ts.map +1 -1
  165. package/dist/components/layout/split-layout/split-layout.js +5 -2
  166. package/dist/components/layout/split-layout/split-layout.js.map +1 -1
  167. package/dist/components/layout/top-bar/top-bar.d.ts.map +1 -1
  168. package/dist/components/layout/top-bar/top-bar.js +3 -1
  169. package/dist/components/layout/top-bar/top-bar.js.map +1 -1
  170. package/dist/components/theme/appearance-panel.d.ts.map +1 -1
  171. package/dist/components/theme/appearance-panel.js +3 -1
  172. package/dist/components/theme/appearance-panel.js.map +1 -1
  173. package/dist/components/theme/theme-mode-toggle.d.ts.map +1 -1
  174. package/dist/components/theme/theme-mode-toggle.js +6 -3
  175. package/dist/components/theme/theme-mode-toggle.js.map +1 -1
  176. package/dist/components/theme/theme-toggle.d.ts.map +1 -1
  177. package/dist/components/theme/theme-toggle.js +6 -3
  178. package/dist/components/theme/theme-toggle.js.map +1 -1
  179. package/dist/components/ui/accordion/accordion.d.ts.map +1 -1
  180. package/dist/components/ui/accordion/accordion.js +3 -1
  181. package/dist/components/ui/accordion/accordion.js.map +1 -1
  182. package/dist/components/ui/alert/alert.d.ts.map +1 -1
  183. package/dist/components/ui/alert/alert.js +15 -9
  184. package/dist/components/ui/alert/alert.js.map +1 -1
  185. package/dist/components/ui/annotation-surface/annotation-surface.d.ts.map +1 -1
  186. package/dist/components/ui/annotation-surface/annotation-surface.js +5 -4
  187. package/dist/components/ui/annotation-surface/annotation-surface.js.map +1 -1
  188. package/dist/components/ui/attachment/attachment.d.ts.map +1 -1
  189. package/dist/components/ui/attachment/attachment.js +18 -9
  190. package/dist/components/ui/attachment/attachment.js.map +1 -1
  191. package/dist/components/ui/badge/badge.d.ts.map +1 -1
  192. package/dist/components/ui/badge/badge.js +30 -11
  193. package/dist/components/ui/badge/badge.js.map +1 -1
  194. package/dist/components/ui/breadcrumb/breadcrumb.d.ts.map +1 -1
  195. package/dist/components/ui/breadcrumb/breadcrumb.js +5 -2
  196. package/dist/components/ui/breadcrumb/breadcrumb.js.map +1 -1
  197. package/dist/components/ui/button/button.d.ts.map +1 -1
  198. package/dist/components/ui/button/button.js +37 -13
  199. package/dist/components/ui/button/button.js.map +1 -1
  200. package/dist/components/ui/calendar/calendar.d.ts.map +1 -1
  201. package/dist/components/ui/calendar/calendar.js +5 -2
  202. package/dist/components/ui/calendar/calendar.js.map +1 -1
  203. package/dist/components/ui/carousel/carousel.d.ts.map +1 -1
  204. package/dist/components/ui/carousel/carousel.js +12 -6
  205. package/dist/components/ui/carousel/carousel.js.map +1 -1
  206. package/dist/components/ui/checkbox/checkbox.d.ts +13 -0
  207. package/dist/components/ui/checkbox/checkbox.d.ts.map +1 -1
  208. package/dist/components/ui/checkbox/checkbox.js +296 -21
  209. package/dist/components/ui/checkbox/checkbox.js.map +1 -1
  210. package/dist/components/ui/code-block/code-block.d.ts.map +1 -1
  211. package/dist/components/ui/code-block/code-block.js +9 -6
  212. package/dist/components/ui/code-block/code-block.js.map +1 -1
  213. package/dist/components/ui/combobox/combobox.d.ts.map +1 -1
  214. package/dist/components/ui/combobox/combobox.js +8 -11
  215. package/dist/components/ui/combobox/combobox.js.map +1 -1
  216. package/dist/components/ui/command/command.d.ts.map +1 -1
  217. package/dist/components/ui/command/command.js +4 -2
  218. package/dist/components/ui/command/command.js.map +1 -1
  219. package/dist/components/ui/detail-panel/detail-panel.d.ts.map +1 -1
  220. package/dist/components/ui/detail-panel/detail-panel.js +3 -1
  221. package/dist/components/ui/detail-panel/detail-panel.js.map +1 -1
  222. package/dist/components/ui/dialog/dialog.d.ts.map +1 -1
  223. package/dist/components/ui/dialog/dialog.js +3 -1
  224. package/dist/components/ui/dialog/dialog.js.map +1 -1
  225. package/dist/components/ui/dropdown-menu/menu-parts.d.ts.map +1 -1
  226. package/dist/components/ui/dropdown-menu/menu-parts.js +7 -3
  227. package/dist/components/ui/dropdown-menu/menu-parts.js.map +1 -1
  228. package/dist/components/ui/empty/empty-state.d.ts.map +1 -1
  229. package/dist/components/ui/empty/empty-state.js +3 -1
  230. package/dist/components/ui/empty/empty-state.js.map +1 -1
  231. package/dist/components/ui/field/field.d.ts.map +1 -1
  232. package/dist/components/ui/field/field.js +12 -6
  233. package/dist/components/ui/field/field.js.map +1 -1
  234. package/dist/components/ui/input/input-control.d.ts +2 -0
  235. package/dist/components/ui/input/input-control.d.ts.map +1 -1
  236. package/dist/components/ui/input/input-control.js +24 -6
  237. package/dist/components/ui/input/input-control.js.map +1 -1
  238. package/dist/components/ui/input/input.d.ts.map +1 -1
  239. package/dist/components/ui/input/input.js +47 -48
  240. package/dist/components/ui/input/input.js.map +1 -1
  241. package/dist/components/ui/input-group/input-group.d.ts.map +1 -1
  242. package/dist/components/ui/input-group/input-group.js +1 -8
  243. package/dist/components/ui/input-group/input-group.js.map +1 -1
  244. package/dist/components/ui/message/index.d.ts +1 -1
  245. package/dist/components/ui/message/index.d.ts.map +1 -1
  246. package/dist/components/ui/message/index.js +2 -2
  247. package/dist/components/ui/message/message.d.ts.map +1 -1
  248. package/dist/components/ui/message/message.js +5 -3
  249. package/dist/components/ui/message/message.js.map +1 -1
  250. package/dist/components/ui/message/parse-message-text.d.ts +32 -0
  251. package/dist/components/ui/message/parse-message-text.d.ts.map +1 -1
  252. package/dist/components/ui/message/parse-message-text.js +63 -3
  253. package/dist/components/ui/message/parse-message-text.js.map +1 -1
  254. package/dist/components/ui/native-select/native-select.d.ts.map +1 -1
  255. package/dist/components/ui/native-select/native-select.js +4 -9
  256. package/dist/components/ui/native-select/native-select.js.map +1 -1
  257. package/dist/components/ui/navigation-menu/navigation-menu.d.ts.map +1 -1
  258. package/dist/components/ui/navigation-menu/navigation-menu.js +3 -1
  259. package/dist/components/ui/navigation-menu/navigation-menu.js.map +1 -1
  260. package/dist/components/ui/pagination/pagination.d.ts.map +1 -1
  261. package/dist/components/ui/pagination/pagination.js +7 -3
  262. package/dist/components/ui/pagination/pagination.js.map +1 -1
  263. package/dist/components/ui/questionnaire/questionnaire.d.ts.map +1 -1
  264. package/dist/components/ui/questionnaire/questionnaire.js +9 -4
  265. package/dist/components/ui/questionnaire/questionnaire.js.map +1 -1
  266. package/dist/components/ui/radio-group/radio-group.d.ts.map +1 -1
  267. package/dist/components/ui/radio-group/radio-group.js +4 -9
  268. package/dist/components/ui/radio-group/radio-group.js.map +1 -1
  269. package/dist/components/ui/resizable/resizable.d.ts.map +1 -1
  270. package/dist/components/ui/resizable/resizable.js +3 -1
  271. package/dist/components/ui/resizable/resizable.js.map +1 -1
  272. package/dist/components/ui/select/select.d.ts.map +1 -1
  273. package/dist/components/ui/select/select.js +7 -3
  274. package/dist/components/ui/select/select.js.map +1 -1
  275. package/dist/components/ui/sheet/sheet.d.ts.map +1 -1
  276. package/dist/components/ui/sheet/sheet.js +3 -1
  277. package/dist/components/ui/sheet/sheet.js.map +1 -1
  278. package/dist/components/ui/spinner/spinner.d.ts.map +1 -1
  279. package/dist/components/ui/spinner/spinner.js +3 -1
  280. package/dist/components/ui/spinner/spinner.js.map +1 -1
  281. package/dist/components/ui/status-chip/status-chip.d.ts.map +1 -1
  282. package/dist/components/ui/status-chip/status-chip.js +35 -30
  283. package/dist/components/ui/status-chip/status-chip.js.map +1 -1
  284. package/dist/components/ui/switch/switch.d.ts +7 -0
  285. package/dist/components/ui/switch/switch.d.ts.map +1 -1
  286. package/dist/components/ui/switch/switch.js +255 -17
  287. package/dist/components/ui/switch/switch.js.map +1 -1
  288. package/dist/components/ui/textarea/textarea.d.ts.map +1 -1
  289. package/dist/components/ui/textarea/textarea.js +1 -8
  290. package/dist/components/ui/textarea/textarea.js.map +1 -1
  291. package/dist/components/ui/toast/toast.d.ts.map +1 -1
  292. package/dist/components/ui/toast/toast.js +3 -1
  293. package/dist/components/ui/toast/toast.js.map +1 -1
  294. package/dist/components/ui/tooltip/deferred-tooltip.d.ts.map +1 -1
  295. package/dist/components/ui/tooltip/deferred-tooltip.js +10 -4
  296. package/dist/components/ui/tooltip/deferred-tooltip.js.map +1 -1
  297. package/dist/components/ui/tooltip/index.d.ts +1 -0
  298. package/dist/components/ui/tooltip/index.d.ts.map +1 -1
  299. package/dist/components/ui/tooltip/index.js +2 -1
  300. package/dist/components/ui/tooltip/lazy-tooltip.d.ts +40 -0
  301. package/dist/components/ui/tooltip/lazy-tooltip.d.ts.map +1 -0
  302. package/dist/components/ui/tooltip/lazy-tooltip.js +61 -0
  303. package/dist/components/ui/tooltip/lazy-tooltip.js.map +1 -0
  304. package/dist/components/ui/trace/trace.d.ts.map +1 -1
  305. package/dist/components/ui/trace/trace.js +82 -68
  306. package/dist/components/ui/trace/trace.js.map +1 -1
  307. package/dist/components/ui/typography/typography.d.ts +1 -1
  308. package/dist/components/ui/typography/typography.d.ts.map +1 -1
  309. package/dist/components/ui/typography/typography.js +5 -6
  310. package/dist/components/ui/typography/typography.js.map +1 -1
  311. package/dist/index.js +3 -2
  312. package/dist/lib/clipboard.d.ts.map +1 -1
  313. package/dist/lib/clipboard.js +3 -0
  314. package/dist/lib/clipboard.js.map +1 -1
  315. package/dist/lib/fast-icon.d.ts +18 -0
  316. package/dist/lib/fast-icon.d.ts.map +1 -0
  317. package/dist/lib/fast-icon.js +75 -0
  318. package/dist/lib/fast-icon.js.map +1 -0
  319. package/dist/lib/form-field.d.ts +1 -1
  320. package/dist/lib/form-field.js +3 -1
  321. package/dist/lib/form-field.js.map +1 -1
  322. package/dist/lib/observe-resize.d.ts +14 -0
  323. package/dist/lib/observe-resize.d.ts.map +1 -0
  324. package/dist/lib/observe-resize.js +19 -0
  325. package/dist/lib/observe-resize.js.map +1 -0
  326. package/dist/lint/index.d.ts +1 -0
  327. package/dist/lint/index.d.ts.map +1 -1
  328. package/dist/lint.js +251 -118
  329. package/dist/lint.js.map +1 -1
  330. package/dist/r/action-button.json +3 -1
  331. package/dist/r/floating-preview.json +2 -1
  332. package/dist/r/icon-picker.json +0 -1
  333. package/dist/r/lib.json +10 -0
  334. package/dist/r/plan.json +2 -1
  335. package/dist/r/queue.json +2 -1
  336. package/dist/r/registry.json +30 -9
  337. package/dist/r/scene-controls.json +2 -1
  338. package/dist/r/src/components/composites/about-dialog/about-dialog.tsx +5 -1
  339. package/dist/r/src/components/composites/accent-picker/accent-picker.tsx +22 -17
  340. package/dist/r/src/components/composites/account-menu/account-menu.tsx +21 -9
  341. package/dist/r/src/components/composites/action-button/action-button.tsx +38 -21
  342. package/dist/r/src/components/composites/appearance-editor/appearance-choices.tsx +7 -1
  343. package/dist/r/src/components/composites/appearance-editor/appearance-editor.tsx +13 -1
  344. package/dist/r/src/components/composites/appearance-editor/appearance-rows.tsx +13 -1
  345. package/dist/r/src/components/composites/appearance-editor/font-settings-group.tsx +13 -1
  346. package/dist/r/src/components/composites/catalog-browser/catalog-browser-group.tsx +11 -1
  347. package/dist/r/src/components/composites/catalog-browser/catalog-browser.tsx +11 -1
  348. package/dist/r/src/components/composites/chain-of-thought/chain-of-thought.tsx +5 -1
  349. package/dist/r/src/components/composites/chat/chat.tsx +11 -1
  350. package/dist/r/src/components/composites/checkpoint/checkpoint.tsx +5 -1
  351. package/dist/r/src/components/composites/confirmation/confirmation.tsx +15 -1
  352. package/dist/r/src/components/composites/context/context.tsx +9 -1
  353. package/dist/r/src/components/composites/file-tree/file-tree.tsx +11 -1
  354. package/dist/r/src/components/composites/help-center/help-center.tsx +5 -1
  355. package/dist/r/src/components/composites/icon-picker/icon-picker.tsx +59 -31
  356. package/dist/r/src/components/composites/icon-picker/shell-icons.ts +121 -59
  357. package/dist/r/src/components/composites/inline-citation/inline-citation.tsx +6 -1
  358. package/dist/r/src/components/composites/list-row/list-row-control.tsx +7 -5
  359. package/dist/r/src/components/composites/message-scroller/message-scroller.tsx +6 -1
  360. package/dist/r/src/components/composites/model-selector/model-selector.tsx +11 -1
  361. package/dist/r/src/components/composites/plan/plan.tsx +5 -1
  362. package/dist/r/src/components/composites/queue/queue.tsx +15 -1
  363. package/dist/r/src/components/composites/reasoning/reasoning.tsx +5 -1
  364. package/dist/r/src/components/composites/scene-controls/scene-controls.tsx +17 -1
  365. package/dist/r/src/components/composites/settings/settings.tsx +23 -14
  366. package/dist/r/src/components/composites/sources/sources.tsx +27 -20
  367. package/dist/r/src/components/composites/stack-trace/stack-trace.tsx +13 -1
  368. package/dist/r/src/components/composites/stat/stat.tsx +9 -1
  369. package/dist/r/src/components/composites/subagent/subagent.tsx +5 -1
  370. package/dist/r/src/components/composites/task/task.tsx +5 -1
  371. package/dist/r/src/components/composites/terminal/ansi.ts +18 -0
  372. package/dist/r/src/components/composites/terminal/terminal.tsx +17 -7
  373. package/dist/r/src/components/composites/test-results/test-results.tsx +17 -7
  374. package/dist/r/src/components/composites/tool/tool.tsx +5 -1
  375. package/dist/r/src/components/composites/tree/tree.tsx +5 -1
  376. package/dist/r/src/components/composites/update-dialog/update-dialog.tsx +35 -15
  377. package/dist/r/src/components/composites/workspace-mark/workspace-mark.tsx +14 -7
  378. package/dist/r/src/components/composites/workspace-switcher/workspace-reorder-dialog.tsx +6 -1
  379. package/dist/r/src/components/composites/workspace-switcher/workspace-switcher.tsx +13 -1
  380. package/dist/r/src/components/conversation/busy-send-button.tsx +11 -1
  381. package/dist/r/src/components/conversation/conversation-avatar.tsx +7 -1
  382. package/dist/r/src/components/conversation/conversation-surface.tsx +5 -1
  383. package/dist/r/src/components/conversation/internal/chat-composer-shell.tsx +13 -1
  384. package/dist/r/src/components/conversation/message-composer.tsx +13 -1
  385. package/dist/r/src/components/conversation/message-row.tsx +15 -1
  386. package/dist/r/src/components/conversation/thread-panel.tsx +5 -1
  387. package/dist/r/src/components/conversation/transcript-composition.tsx +5 -1
  388. package/dist/r/src/components/layout/floating-preview/floating-preview.tsx +6 -1
  389. package/dist/r/src/components/layout/pixel-resize-handle/pixel-resize-handle.tsx +5 -1
  390. package/dist/r/src/components/layout/shell-rail/shell-rail.tsx +5 -1
  391. package/dist/r/src/components/layout/sidebar-nav/sidebar-nav.tsx +5 -1
  392. package/dist/r/src/components/layout/split-layout/split-layout.tsx +6 -1
  393. package/dist/r/src/components/layout/top-bar/top-bar.tsx +5 -1
  394. package/dist/r/src/components/theme/appearance-panel.tsx +6 -1
  395. package/dist/r/src/components/theme/theme-mode-toggle.tsx +7 -1
  396. package/dist/r/src/components/theme/theme-toggle.tsx +7 -1
  397. package/dist/r/src/components/ui/accordion/accordion.tsx +5 -1
  398. package/dist/r/src/components/ui/alert/alert.tsx +20 -3
  399. package/dist/r/src/components/ui/annotation-surface/annotation-surface.tsx +6 -3
  400. package/dist/r/src/components/ui/attachment/attachment.tsx +19 -8
  401. package/dist/r/src/components/ui/badge/badge.tsx +24 -8
  402. package/dist/r/src/components/ui/breadcrumb/breadcrumb.tsx +9 -1
  403. package/dist/r/src/components/ui/button/button.tsx +47 -16
  404. package/dist/r/src/components/ui/calendar/calendar.tsx +6 -1
  405. package/dist/r/src/components/ui/carousel/carousel.tsx +15 -5
  406. package/dist/r/src/components/ui/checkbox/checkbox.tsx +260 -22
  407. package/dist/r/src/components/ui/code-block/code-block.tsx +11 -5
  408. package/dist/r/src/components/ui/combobox/combobox.tsx +8 -9
  409. package/dist/r/src/components/ui/command/command.tsx +8 -4
  410. package/dist/r/src/components/ui/detail-panel/detail-panel.tsx +5 -1
  411. package/dist/r/src/components/ui/dialog/dialog.tsx +5 -1
  412. package/dist/r/src/components/ui/dropdown-menu/menu-parts.tsx +11 -1
  413. package/dist/r/src/components/ui/empty/empty-state.tsx +5 -1
  414. package/dist/r/src/components/ui/field/field.tsx +14 -5
  415. package/dist/r/src/components/ui/input/input-control.tsx +28 -19
  416. package/dist/r/src/components/ui/input/input.tsx +9 -12
  417. package/dist/r/src/components/ui/input-group/input-group.tsx +1 -8
  418. package/dist/r/src/components/ui/message/index.ts +3 -0
  419. package/dist/r/src/components/ui/message/message.tsx +11 -2
  420. package/dist/r/src/components/ui/message/parse-message-text.ts +94 -2
  421. package/dist/r/src/components/ui/native-select/native-select.tsx +6 -9
  422. package/dist/r/src/components/ui/navigation-menu/navigation-menu.tsx +5 -1
  423. package/dist/r/src/components/ui/pagination/pagination.tsx +11 -1
  424. package/dist/r/src/components/ui/questionnaire/questionnaire.tsx +13 -1
  425. package/dist/r/src/components/ui/radio-group/radio-group.tsx +6 -9
  426. package/dist/r/src/components/ui/resizable/resizable.tsx +5 -1
  427. package/dist/r/src/components/ui/select/select.tsx +11 -1
  428. package/dist/r/src/components/ui/sheet/sheet.tsx +5 -1
  429. package/dist/r/src/components/ui/spinner/spinner.tsx +5 -1
  430. package/dist/r/src/components/ui/status-chip/status-chip.tsx +14 -7
  431. package/dist/r/src/components/ui/switch/switch.tsx +235 -28
  432. package/dist/r/src/components/ui/textarea/textarea.tsx +1 -8
  433. package/dist/r/src/components/ui/toast/toast.tsx +5 -1
  434. package/dist/r/src/components/ui/tooltip/deferred-tooltip.tsx +14 -8
  435. package/dist/r/src/components/ui/tooltip/index.ts +1 -0
  436. package/dist/r/src/components/ui/tooltip/lazy-tooltip.tsx +73 -0
  437. package/dist/r/src/components/ui/trace/trace.tsx +61 -28
  438. package/dist/r/src/components/ui/typography/typography.tsx +6 -5
  439. package/dist/r/src/lib/clipboard.ts +4 -0
  440. package/dist/r/src/lib/fast-icon.ts +88 -0
  441. package/dist/r/src/lib/form-field.ts +7 -7
  442. package/dist/r/src/lib/observe-resize.ts +28 -0
  443. package/dist/r/subagent.json +2 -1
  444. package/dist/r/tool.json +2 -1
  445. package/dist/r/tooltip.json +5 -0
  446. package/dist/r/trace.json +0 -1
  447. package/package.json +1 -1
  448. package/registry.json +30 -9
  449. package/src/components/composites/about-dialog/about-dialog.tsx +5 -1
  450. package/src/components/composites/accent-picker/accent-picker.tsx +22 -17
  451. package/src/components/composites/account-menu/account-menu.tsx +21 -9
  452. package/src/components/composites/action-button/action-button.tsx +38 -21
  453. package/src/components/composites/appearance-editor/appearance-choices.tsx +7 -1
  454. package/src/components/composites/appearance-editor/appearance-editor.tsx +13 -1
  455. package/src/components/composites/appearance-editor/appearance-rows.tsx +13 -1
  456. package/src/components/composites/appearance-editor/font-settings-group.tsx +13 -1
  457. package/src/components/composites/catalog-browser/catalog-browser-group.tsx +11 -1
  458. package/src/components/composites/catalog-browser/catalog-browser.tsx +11 -1
  459. package/src/components/composites/chain-of-thought/chain-of-thought.tsx +5 -1
  460. package/src/components/composites/chat/chat.tsx +11 -1
  461. package/src/components/composites/checkpoint/checkpoint.tsx +5 -1
  462. package/src/components/composites/confirmation/confirmation.tsx +15 -1
  463. package/src/components/composites/context/context.tsx +9 -1
  464. package/src/components/composites/file-tree/file-tree.tsx +11 -1
  465. package/src/components/composites/help-center/help-center.tsx +5 -1
  466. package/src/components/composites/icon-picker/icon-picker.tsx +59 -31
  467. package/src/components/composites/icon-picker/shell-icons.ts +121 -59
  468. package/src/components/composites/inline-citation/inline-citation.tsx +6 -1
  469. package/src/components/composites/list-row/list-row-control.tsx +7 -5
  470. package/src/components/composites/message-scroller/message-scroller.tsx +6 -1
  471. package/src/components/composites/model-selector/model-selector.tsx +11 -1
  472. package/src/components/composites/plan/plan.tsx +5 -1
  473. package/src/components/composites/queue/queue.tsx +15 -1
  474. package/src/components/composites/reasoning/reasoning.tsx +5 -1
  475. package/src/components/composites/scene-controls/scene-controls.tsx +17 -1
  476. package/src/components/composites/settings/settings.tsx +23 -14
  477. package/src/components/composites/sources/sources.tsx +27 -20
  478. package/src/components/composites/stack-trace/stack-trace.tsx +13 -1
  479. package/src/components/composites/stat/stat.tsx +9 -1
  480. package/src/components/composites/subagent/subagent.tsx +5 -1
  481. package/src/components/composites/task/task.tsx +5 -1
  482. package/src/components/composites/terminal/ansi.ts +18 -0
  483. package/src/components/composites/terminal/terminal.tsx +17 -7
  484. package/src/components/composites/test-results/test-results.tsx +17 -7
  485. package/src/components/composites/tool/tool.tsx +5 -1
  486. package/src/components/composites/tree/tree.tsx +5 -1
  487. package/src/components/composites/update-dialog/update-dialog.tsx +35 -15
  488. package/src/components/composites/workspace-mark/workspace-mark.tsx +14 -7
  489. package/src/components/composites/workspace-switcher/workspace-reorder-dialog.tsx +6 -1
  490. package/src/components/composites/workspace-switcher/workspace-switcher.tsx +13 -1
  491. package/src/components/conversation/busy-send-button.tsx +11 -1
  492. package/src/components/conversation/conversation-avatar.tsx +7 -1
  493. package/src/components/conversation/conversation-surface.tsx +5 -1
  494. package/src/components/conversation/internal/chat-composer-shell.tsx +13 -1
  495. package/src/components/conversation/message-composer.tsx +13 -1
  496. package/src/components/conversation/message-row.tsx +15 -1
  497. package/src/components/conversation/thread-panel.tsx +5 -1
  498. package/src/components/conversation/transcript-composition.tsx +5 -1
  499. package/src/components/layout/floating-preview/floating-preview.tsx +6 -1
  500. package/src/components/layout/pixel-resize-handle/pixel-resize-handle.tsx +5 -1
  501. package/src/components/layout/shell-rail/shell-rail.tsx +5 -1
  502. package/src/components/layout/sidebar-nav/sidebar-nav.tsx +5 -1
  503. package/src/components/layout/split-layout/split-layout.tsx +6 -1
  504. package/src/components/layout/top-bar/top-bar.tsx +5 -1
  505. package/src/components/theme/appearance-panel.tsx +6 -1
  506. package/src/components/theme/theme-mode-toggle.tsx +7 -1
  507. package/src/components/theme/theme-toggle.tsx +7 -1
  508. package/src/components/ui/accordion/accordion.tsx +5 -1
  509. package/src/components/ui/alert/alert.tsx +20 -3
  510. package/src/components/ui/annotation-surface/annotation-surface.tsx +6 -3
  511. package/src/components/ui/attachment/attachment.tsx +19 -8
  512. package/src/components/ui/badge/badge.tsx +24 -8
  513. package/src/components/ui/breadcrumb/breadcrumb.tsx +9 -1
  514. package/src/components/ui/button/button.tsx +47 -16
  515. package/src/components/ui/calendar/calendar.tsx +6 -1
  516. package/src/components/ui/carousel/carousel.tsx +15 -5
  517. package/src/components/ui/checkbox/checkbox.tsx +260 -22
  518. package/src/components/ui/code-block/code-block.tsx +11 -5
  519. package/src/components/ui/combobox/combobox.tsx +8 -9
  520. package/src/components/ui/command/command.tsx +8 -4
  521. package/src/components/ui/detail-panel/detail-panel.tsx +5 -1
  522. package/src/components/ui/dialog/dialog.tsx +5 -1
  523. package/src/components/ui/dropdown-menu/menu-parts.tsx +11 -1
  524. package/src/components/ui/empty/empty-state.tsx +5 -1
  525. package/src/components/ui/field/field.tsx +14 -5
  526. package/src/components/ui/input/input-control.tsx +28 -19
  527. package/src/components/ui/input/input.tsx +9 -12
  528. package/src/components/ui/input-group/input-group.tsx +1 -8
  529. package/src/components/ui/message/index.ts +3 -0
  530. package/src/components/ui/message/message.tsx +11 -2
  531. package/src/components/ui/message/parse-message-text.ts +94 -2
  532. package/src/components/ui/native-select/native-select.tsx +6 -9
  533. package/src/components/ui/navigation-menu/navigation-menu.tsx +5 -1
  534. package/src/components/ui/pagination/pagination.tsx +11 -1
  535. package/src/components/ui/questionnaire/questionnaire.tsx +13 -1
  536. package/src/components/ui/radio-group/radio-group.tsx +6 -9
  537. package/src/components/ui/resizable/resizable.tsx +5 -1
  538. package/src/components/ui/select/select.tsx +11 -1
  539. package/src/components/ui/sheet/sheet.tsx +5 -1
  540. package/src/components/ui/spinner/spinner.tsx +5 -1
  541. package/src/components/ui/status-chip/status-chip.tsx +14 -7
  542. package/src/components/ui/switch/switch.tsx +235 -28
  543. package/src/components/ui/textarea/textarea.tsx +1 -8
  544. package/src/components/ui/toast/toast.tsx +5 -1
  545. package/src/components/ui/tooltip/deferred-tooltip.tsx +14 -8
  546. package/src/components/ui/tooltip/index.ts +1 -0
  547. package/src/components/ui/tooltip/lazy-tooltip.tsx +73 -0
  548. package/src/components/ui/trace/trace.tsx +61 -28
  549. package/src/components/ui/typography/typography.tsx +6 -5
  550. package/src/lib/clipboard.ts +4 -0
  551. package/src/lib/fast-icon.ts +88 -0
  552. package/src/lib/form-field.ts +7 -7
  553. package/src/lib/observe-resize.ts +28 -0
  554. package/src/lint/index.ts +199 -0
@@ -1 +1 @@
1
- {"version":3,"file":"test-results.js","names":["Check","CircleCheck","CircleMinus","CircleX","Copy","FlaskConical","LoaderCircle","createComputed","createMemo","createEffect","createSignal","For","Show","splitProps","createCopyFeedback","cn","Button","DiffBlock","Trace","TraceDetail","TraceLine","StackTrace","boundedEntries","describeCount","firstFailureRenderPath","formatDuration","listedCounts","reconcileCounts","sameFailure","siblingKey","suiteState","suites","summary","running","listLimit","onOpenFrame","label","TEST_RESULTS_LIST_LIMIT","OUTCOME_ICON","failed","_$createComponent","passed","skipped","CountReadout","props","line","_el$","_tmpl$","_$insert","outcome","_$effect","_$setAttribute","SEGMENT_CLASS","SummaryBar","lines","visible","filter","count","when","length","children","_el$2","_tmpl$2","each","_el$3","_tmpl$3","_p$","_v$","_v$2","e","_$className","t","_$setStyleProperty","undefined","TRACE_STATUS","status","pending","keepFocusThroughReorder","keys","noted","HTMLElement","active","document","activeElement","closest","element","isConnected","body","focus","preventScroll","Bounded","items","itemKey","item","index","limit","noun","key","shown","setShown","page","entries","visibleKeys","map","entry","hidden","byKey","get","_el$4","_tmpl$4","variant","size","onClick","_$memo","Math","min","toLocaleString","TEST_RESULTS_MESSAGE_LIMIT","FailureMessage","text","onCopy","ok","all","setAll","copied","copyFailed","copy","copyText","clipped","cut","last","charCodeAt","slice","_el$5","_tmpl$5","_el$6","_tmpl$6","_el$7","firstChild","fallback","title","TestLine","test","keyed","failure","state","hasDetail","Boolean","message","diff","stack","failureKey","equals","open","setOpen","previousFailure","collapsedFailure","currentFailure","handleOpenChange","next","name","statusLabel","meta","durationMs","onOpenChange","patch","complete","SuiteLine","suite","depth","counts","tests","holdsFailure","description","parts","file","join","icon","_el$8","_tmpl$7","_index","nested","TestResults","local","rest","listed","max","floor","duration","nothing","reportedTotal","_el$9","_tmpl$11","_$spread","_$mergeProps","class","_tmpl$12","_el$0","_tmpl$10","_el$1","_el$10","_tmpl$8","_el$11","totalNote","_el$12","_tmpl$9","_el$13","note","_el$18","_tmpl$13","_el$19","_el$21","nextSibling","reported","_el$14","_tmpl$0","basis","_tmpl$1"],"sources":["../../../../src/components/composites/test-results/test-results.tsx"],"sourcesContent":["import {\n Check,\n CircleCheck,\n CircleMinus,\n CircleX,\n Copy,\n FlaskConical,\n LoaderCircle,\n} from 'lucide-solid'\nimport {\n createComputed,\n createMemo,\n createEffect,\n createSignal,\n For,\n Show,\n splitProps,\n type Accessor,\n type ComponentProps,\n type JSX,\n} from 'solid-js'\nimport { createCopyFeedback } from '#lib/clipboard'\nimport { cn } from '#lib/utils'\nimport { Button } from '../../ui/button'\nimport { DiffBlock } from '../../ui/diff-block'\nimport { Trace, TraceDetail, TraceLine, type TraceStatus } from '../../ui/trace'\nimport { StackTrace, type StackTraceProps } from '../stack-trace'\nimport {\n boundedEntries,\n describeCount,\n firstFailureRenderPath,\n formatDuration,\n listedCounts,\n reconcileCounts,\n sameFailure,\n siblingKey,\n suiteState,\n type CountLine,\n type TestCase,\n type TestCaseStatus,\n type TestOutcome,\n type TestSuite,\n type TestSummary,\n type FirstFailureRenderPath,\n} from './test-results-model'\n\n/**\n * TestResults.\n *\n * A test run: how it went in words and in a segmented bar, then the suites it\n * ran as `Trace` lines, each opening onto its tests, and a failing test opening\n * onto its message, diff and stack. It is for a run the host can structure; reach\n * for `Terminal` when all there is to show is the command's output, and for\n * `StackTrace` alone when one call failed outside a test.\n *\n * ## Counts are claims\n *\n * Nothing is computed that the host did not supply data for, and nothing the host\n * supplied is quietly recomputed. `summary` is the host's own tally and is shown\n * as given. If tests are listed and their number for an outcome does not match, the\n * listed number is shown beside it, \"40 passed (2 listed)\", which is also how a\n * host that lists only its failures reads. Without a `summary` the counts shown are\n * those of the tests listed, and the component says so; it does not present them as\n * the run's totals. A suite is marked failed or passed only from the tests listed in\n * it, and its spoken label says \"listed\" so it claims no more than that.\n *\n * ## Not colour-only\n *\n * The bar is decoration: every segment has a counterpart in the words beside it,\n * each with its own shape (a cross, a tick, a dash). Segments are separated by a\n * gap and never narrower than a visible sliver, so one failure in five thousand\n * tests is still on the bar.\n *\n * ## Bounded\n *\n * Suites and tests are listed `listLimit` at a time with \"show more\", and a suite's\n * tests are not rendered until it is open. The first failure in reading order opens\n * when its row is visible; a failure beyond a \"show more\" boundary stays unmounted\n * until its page is revealed. When a running result first reports a failure, its\n * suite and test open once. Later updates preserve the user's disclosure choices.\n *\n * Failure details are text: the message is a `pre`, the diff goes to `DiffBlock`\n * and the stack to `StackTrace`. If a stack already begins with the message, pass\n * only the stack; nothing here de-duplicates what the host sends.\n */\nexport type TestResultsProps = Omit<ComponentProps<'section'>, 'children'> & {\n suites: readonly TestSuite[]\n /** The host's own counts. Shown as given; see the component comment. */\n summary?: TestSummary\n /** The run is still going. */\n running?: boolean\n /** Suites, or tests within a suite, listed before \"show more\". Default 50. */\n listLimit?: number\n /** Passed to each failure's `StackTrace`. */\n onOpenFrame?: StackTraceProps['onOpenFrame']\n /** The section's accessible name. Default \"Test results\". */\n label?: string\n}\n\nexport const TEST_RESULTS_LIST_LIMIT = 50\n\nconst OUTCOME_ICON: Readonly<Record<TestOutcome, () => JSX.Element>> = {\n failed: () => <CircleX aria-hidden=\"true\" class=\"size-3.5 text-destructive\" />,\n passed: () => <CircleCheck aria-hidden=\"true\" class=\"size-3.5 text-success\" />,\n skipped: () => <CircleMinus aria-hidden=\"true\" class=\"size-3.5 text-muted-foreground\" />,\n}\n\nfunction CountReadout(props: { line: CountLine }) {\n return (\n <span class=\"flex items-center gap-1 whitespace-nowrap\" data-outcome={props.line.outcome}>\n {OUTCOME_ICON[props.line.outcome]()}\n {describeCount(props.line)}\n </span>\n )\n}\n\n// Segments are drawn in this order so the bar reads the same in every run.\nconst SEGMENT_CLASS: Readonly<Record<TestOutcome, string>> = {\n failed: 'bg-destructive',\n passed: 'bg-success',\n skipped: 'bg-muted-foreground/40',\n}\n\nfunction SummaryBar(props: { lines: readonly CountLine[] }) {\n const visible = () => props.lines.filter((line) => line.count > 0)\n return (\n <Show when={visible().length > 0}>\n <div\n aria-hidden=\"true\"\n data-slot=\"test-results-bar\"\n class=\"flex h-1.5 w-full gap-px overflow-hidden rounded-full bg-muted\"\n >\n <For each={visible()}>\n {(line) => (\n <span\n class={cn('min-w-1', SEGMENT_CLASS[line.outcome])}\n style={{ flex: `${line.count} 1 0` }}\n />\n )}\n </For>\n </div>\n </Show>\n )\n}\n\nconst TRACE_STATUS: Readonly<Record<TestCaseStatus, { status: TraceStatus; label: string }>> = {\n passed: { status: 'success', label: 'Passed' },\n failed: { status: 'error', label: 'Failed' },\n skipped: { status: 'cancelled', label: 'Skipped' },\n running: { status: 'running', label: 'Running' },\n pending: { status: 'pending', label: 'Not run yet' },\n}\n\n/**\n * Keep keyboard focus through a reorder. Solid moves a keyed row's node instead\n * of replacing it, and a browser blurs a focused element that is moved, so an\n * immutable reorder would drop the reader's place onto the body even though the\n * node and its open state survive. The focused element is noted just before the\n * rows move and given focus back just after, but only when nothing else has taken\n * focus meanwhile, and only inside a test run, so a reader who has moved on is\n * never pulled back and an unrelated element is never refocused.\n */\nfunction keepFocusThroughReorder(keys: Accessor<readonly string[]>) {\n let noted: HTMLElement | undefined\n createComputed(() => {\n keys()\n const active = typeof document === 'undefined' ? null : document.activeElement\n noted =\n active instanceof HTMLElement && active.closest('[data-slot=\"test-results\"]')\n ? active\n : undefined\n })\n createEffect(() => {\n keys()\n const element = noted\n noted = undefined\n if (!element || !element.isConnected) return\n const active = document.activeElement\n if (active === null || active === document.body) element.focus({ preventScroll: true })\n })\n}\n\n/** A list that shows its first `limit` items and offers the rest. */\nfunction Bounded<T>(props: {\n items: readonly T[]\n itemKey: (item: T, index: number) => string\n limit: number\n noun: string\n children: (item: Accessor<T>, index: Accessor<number>, key: string) => JSX.Element\n}) {\n const [shown, setShown] = createSignal(props.limit)\n const page = createMemo(() => boundedEntries(props.items, shown(), props.itemKey))\n const visible = () => page().entries\n const visibleKeys = createMemo(() => visible().map((entry) => entry.key))\n keepFocusThroughReorder(visibleKeys)\n const hidden = () => props.items.length - visible().length\n return (\n <>\n <For each={visibleKeys()}>\n {(key) => {\n const entry = createMemo(() => page().byKey.get(key)!)\n return props.children(\n () => entry().item,\n () => entry().index,\n key\n )\n }}\n </For>\n <Show when={hidden() > 0}>\n <li class=\"px-1.5 py-0.5\">\n <Button variant=\"ghost\" size=\"2xs\" onClick={() => setShown(shown() + props.limit)}>\n Show {Math.min(hidden(), props.limit).toLocaleString()} more {props.noun} (\n {hidden().toLocaleString()} hidden)\n </Button>\n </li>\n </Show>\n </>\n )\n}\n\n/** Characters of a failure message drawn before the rest is offered. */\nexport const TEST_RESULTS_MESSAGE_LIMIT = 4_000\n\n/**\n * A failed test's message, which a runner may print at any length: a captured\n * log, a serialized object, a long assertion. It opens on its own for the first\n * failure, so it is bounded where the diff and stack are already bounded: the\n * body scrolls past a fixed height, only the first characters are drawn until the\n * reader asks for the rest, and Copy writes all of it.\n */\nfunction FailureMessage(props: { text: string; onCopy?: (ok: boolean) => void }) {\n const [all, setAll] = createSignal(false)\n const { copied, failed: copyFailed, copy: copyText } = createCopyFeedback()\n const clipped = () => props.text.length > TEST_RESULTS_MESSAGE_LIMIT\n const cut = () => {\n // Never inside a surrogate pair, which would draw a replacement character.\n const last = props.text.charCodeAt(TEST_RESULTS_MESSAGE_LIMIT - 1)\n return last >= 0xd800 && last <= 0xdbff\n ? TEST_RESULTS_MESSAGE_LIMIT - 1\n : TEST_RESULTS_MESSAGE_LIMIT\n }\n const shown = () => (clipped() && !all() ? props.text.slice(0, cut()) : props.text)\n const copy = async () => {\n const ok = await copyText(props.text)\n props.onCopy?.(ok)\n }\n return (\n <>\n {/* A region that scrolls is a tab stop and needs a name. */}\n <pre\n data-slot=\"test-results-message\"\n tabindex=\"0\"\n role=\"group\"\n aria-label=\"Failure message\"\n class=\"m-0 max-h-64 overflow-auto font-code text-code whitespace-pre-wrap text-foreground [overflow-wrap:anywhere]\"\n >\n {shown()}\n </pre>\n <Show when={clipped()}>\n <div class=\"flex flex-wrap items-center gap-x-2 gap-y-1 text-xs text-muted-foreground\">\n <span class=\"italic\">\n <Show\n when={!all()}\n fallback={`All ${props.text.length.toLocaleString()} characters shown.`}\n >\n Showing the first {cut().toLocaleString()} of {props.text.length.toLocaleString()}{' '}\n characters (copy has all of it).\n </Show>\n </span>\n <Show when={!all()}>\n <Button variant=\"ghost\" size=\"2xs\" onClick={() => setAll(true)}>\n Show all {props.text.length.toLocaleString()} characters\n </Button>\n </Show>\n <Button\n variant=\"ghost\"\n size=\"2xs\"\n title={copyFailed() ? 'Copying is unavailable in this context' : undefined}\n onClick={() => void copy()}\n >\n <Show when={copied()} fallback={<Copy aria-hidden=\"true\" />}>\n <Check aria-hidden=\"true\" />\n </Show>\n {copied() ? 'Copied' : 'Copy message'}\n </Button>\n </div>\n </Show>\n </>\n )\n}\n\nfunction TestLine(props: {\n test: Accessor<TestCase>\n keyed: string\n failure?: FirstFailureRenderPath\n onOpenFrame?: TestResultsProps['onOpenFrame']\n}) {\n const test = () => props.test()\n const state = () => (test().status ? TRACE_STATUS[test().status as TestCaseStatus] : undefined)\n // Whether there is anything to disclose. Read once per change, so the disclosure\n // exists while closed without anything below it being built.\n const hasDetail = createMemo(() => Boolean(test().message || test().diff || test().stack))\n // Only the last suite on the failure's path is given it, so a key among\n // this suite's tests is enough to know the failure is this test.\n const failureKey = createMemo(\n () => (props.failure?.test === props.keyed ? props.failure : undefined),\n undefined,\n { equals: sameFailure }\n )\n const [open, setOpen] = createSignal(failureKey() !== undefined)\n let previousFailure = failureKey()\n let collapsedFailure: FirstFailureRenderPath | undefined\n\n createEffect(() => {\n const currentFailure = failureKey()\n if (\n currentFailure &&\n !sameFailure(currentFailure, previousFailure) &&\n !sameFailure(currentFailure, collapsedFailure)\n ) {\n setOpen(true)\n }\n previousFailure = currentFailure\n })\n\n const handleOpenChange = (next: boolean) => {\n if (!next && failureKey()) collapsedFailure = failureKey()\n else if (next) collapsedFailure = undefined\n setOpen(next)\n }\n\n return (\n <TraceLine\n title={test().name}\n status={state()?.status}\n statusLabel={state()?.label}\n meta={formatDuration(test().durationMs)}\n open={open()}\n onOpenChange={handleOpenChange}\n >\n {hasDetail() ? (\n // A closed test builds nothing: the body is made when it is opened, so a diff or\n // stack is not parsed for every test of an open suite.\n <Show when={open()}>\n <TraceDetail class=\"flex flex-col gap-2\">\n <Show when={test().message}>\n <FailureMessage text={test().message!} />\n </Show>\n <Show when={test().diff}>\n <DiffBlock patch={test().diff!} complete title=\"Expected and received\" />\n </Show>\n <Show when={test().stack}>\n <StackTrace text={test().stack!} onOpenFrame={props.onOpenFrame} />\n </Show>\n </TraceDetail>\n </Show>\n ) : undefined}\n </TraceLine>\n )\n}\n\nfunction SuiteLine(props: {\n suite: Accessor<TestSuite>\n /** This suite's key among its siblings. */\n keyed: string\n /** How many suites enclose this one. */\n depth: number\n limit: number\n /** The first failure, given only to suites on the way to it. */\n failure?: FirstFailureRenderPath\n onOpenFrame?: TestResultsProps['onOpenFrame']\n}) {\n const suite = () => props.suite()\n const counts = createMemo(() => listedCounts([suite()]))\n const state = createMemo(() => suiteState(counts()))\n const children = () => (suite().tests?.length ?? 0) + (suite().suites?.length ?? 0) > 0\n const [open, setOpen] = createSignal(state() === 'failed')\n // The parent passes the failure down only while it is on the way to it, so\n // one comparison at this suite's own depth settles whether it is on the path.\n // Memoised: each level reads its parent's, so a bare function would re-run the\n // whole chain above it on every read and cost exponential time in the depth.\n const failure = createMemo(\n () => (props.failure?.suites[props.depth] === props.keyed ? props.failure : undefined),\n undefined,\n { equals: sameFailure }\n )\n const holdsFailure = createMemo(() => failure()?.suites.length === props.depth + 1)\n let previousFailure = failure()\n let collapsedFailure: FirstFailureRenderPath | undefined\n\n createEffect(() => {\n const currentFailure = failure()\n if (\n currentFailure &&\n !sameFailure(currentFailure, previousFailure) &&\n !sameFailure(currentFailure, collapsedFailure)\n ) {\n setOpen(true)\n }\n previousFailure = currentFailure\n })\n\n const handleOpenChange = (next: boolean) => {\n if (!next && failure()) collapsedFailure = failure()\n else if (next) collapsedFailure = undefined\n setOpen(next)\n }\n\n const description = () => {\n const parts = [\n suite().file,\n counts().failed > 0 ? `${counts().failed.toLocaleString()} failed` : undefined,\n ]\n return parts.filter(Boolean).join(' · ') || undefined\n }\n return (\n <TraceLine\n icon={<FlaskConical />}\n title={suite().name}\n description={description()}\n status={\n state() === 'failed'\n ? 'error'\n : state() === 'running'\n ? 'running'\n : state() === 'passed'\n ? 'success'\n : undefined\n }\n statusLabel={\n state() === 'failed'\n ? 'Has failing tests'\n : state() === 'passed'\n ? 'All listed tests passed'\n : undefined\n }\n meta={formatDuration(suite().durationMs)}\n open={open()}\n onOpenChange={handleOpenChange}\n >\n {children() ? (\n <div>\n <Show when={open()}>\n <Trace size=\"sm\" aria-label={`${suite().name} tests`}>\n <Bounded\n items={suite().tests ?? []}\n itemKey={siblingKey}\n limit={props.limit}\n noun=\"tests\"\n >\n {(test, _index, key) => (\n <TestLine\n test={test}\n keyed={key}\n failure={holdsFailure() ? failure() : undefined}\n onOpenFrame={props.onOpenFrame}\n />\n )}\n </Bounded>\n <Bounded\n items={suite().suites ?? []}\n itemKey={siblingKey}\n limit={props.limit}\n noun=\"suites\"\n >\n {(nested, _index, key) => (\n <SuiteLine\n suite={nested}\n keyed={key}\n depth={props.depth + 1}\n limit={props.limit}\n failure={failure()}\n onOpenFrame={props.onOpenFrame}\n />\n )}\n </Bounded>\n </Trace>\n </Show>\n </div>\n ) : undefined}\n </TraceLine>\n )\n}\n\nexport function TestResults(props: TestResultsProps) {\n const [local, rest] = splitProps(props, [\n 'suites',\n 'summary',\n 'running',\n 'listLimit',\n 'onOpenFrame',\n 'label',\n 'class',\n ])\n\n const listed = createMemo(() => listedCounts(local.suites))\n const counts = createMemo(() => reconcileCounts(local.summary, listed()))\n const limit = () => Math.max(1, Math.floor(local.listLimit ?? TEST_RESULTS_LIST_LIMIT))\n const failure = createMemo(() => firstFailureRenderPath(local.suites), undefined, {\n equals: sameFailure,\n })\n const duration = () => formatDuration(local.summary?.durationMs, 'long')\n const nothing = () =>\n counts().lines.length === 0 &&\n counts().reportedTotal === undefined &&\n local.suites.length === 0 &&\n !local.running\n\n return (\n <section\n data-slot=\"test-results\"\n aria-label={local.label ?? 'Test results'}\n aria-busy={local.running || undefined}\n class={cn('flex min-w-0 flex-col gap-2', local.class)}\n {...rest}\n >\n <Show\n when={!nothing()}\n fallback={<p class=\"m-0 text-sm text-muted-foreground\">No test results</p>}\n >\n <div class=\"flex flex-col gap-1.5\">\n <div class=\"flex flex-wrap items-center gap-x-3 gap-y-1 text-sm\">\n <Show when={local.running}>\n <span class=\"flex items-center gap-1 text-info\">\n <LoaderCircle aria-hidden=\"true\" class=\"size-3.5 motion-safe:animate-spin\" />\n Running\n </span>\n </Show>\n <For each={counts().lines}>{(line) => <CountReadout line={line} />}</For>\n <Show\n when={\n counts().lines.length === 0 &&\n !counts().totalNote &&\n counts().reportedTotal !== undefined\n }\n >\n <span class=\"text-muted-foreground\">\n {counts().reportedTotal?.toLocaleString()} tests reported\n </span>\n </Show>\n <Show when={counts().totalNote}>\n {(note) => (\n <span class=\"text-muted-foreground\">\n {note().reported.toLocaleString()} tests reported (\n {note().listed.toLocaleString()} listed)\n </span>\n )}\n </Show>\n <Show when={duration()}>\n <span class=\"text-muted-foreground\">in {duration()}</span>\n </Show>\n </div>\n <SummaryBar lines={counts().lines} />\n <Show when={counts().basis === 'listed' && counts().lines.length > 0}>\n <p class=\"m-0 text-xs text-muted-foreground\">Counts are from the tests listed below.</p>\n </Show>\n </div>\n <Show when={local.suites.length > 0}>\n <Trace aria-label=\"Test suites\">\n <Bounded items={local.suites} itemKey={siblingKey} limit={limit()} noun=\"suites\">\n {(suite, _index, key) => (\n <SuiteLine\n suite={suite}\n keyed={key}\n depth={0}\n limit={limit()}\n failure={failure()}\n onOpenFr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AAO;WAAA,OAAEA,QAAQ;UAAC;UAAA,IAClB7G,cAAW;WAAA,OAAEoJ,MAAMpJ;UAAW;SAAA,CAAA;QAEjC,CAAA;OAAA;MAAA,CAAA;KAAA;IAAA,CAAA,CAAA;GAAA;EAAA,CAAA,CAAA;EAAA,OAAA4J;CAAA,EAAA,CAAA;AAOf"}
1
+ {"version":3,"file":"test-results.js","names":["Check","LucideCheck","CircleCheck","LucideCircleCheck","CircleMinus","LucideCircleMinus","CircleX","LucideCircleX","Copy","LucideCopy","FlaskConical","LucideFlaskConical","LoaderCircle","LucideLoaderCircle","createComputed","createMemo","createEffect","createSignal","For","Show","splitProps","createCopyFeedback","cn","Button","DiffBlock","Trace","TraceDetail","TraceLine","StackTrace","boundedEntries","describeCount","firstFailureRenderPath","formatDuration","listedCounts","reconcileCounts","sameFailure","siblingKey","suiteState","fastIcon","suites","summary","running","listLimit","onOpenFrame","label","TEST_RESULTS_LIST_LIMIT","OUTCOME_ICON","failed","_$createComponent","passed","skipped","CountReadout","props","line","_el$","_tmpl$","_$insert","outcome","_$effect","_$setAttribute","SEGMENT_CLASS","SummaryBar","lines","visible","filter","count","when","length","children","_el$2","_tmpl$2","each","_el$3","_tmpl$3","_p$","_v$","_v$2","e","_$className","t","_$setStyleProperty","undefined","TRACE_STATUS","status","pending","keepFocusThroughReorder","keys","noted","HTMLElement","active","document","activeElement","closest","element","isConnected","body","focus","preventScroll","Bounded","items","itemKey","item","index","limit","noun","key","shown","setShown","page","entries","visibleKeys","map","entry","hidden","byKey","get","_el$4","_tmpl$4","variant","size","onClick","_$memo","Math","min","toLocaleString","TEST_RESULTS_MESSAGE_LIMIT","FailureMessage","text","onCopy","ok","all","setAll","copied","copyFailed","copy","copyText","clipped","cut","last","charCodeAt","slice","_el$5","_tmpl$5","_el$6","_tmpl$6","_el$7","firstChild","fallback","title","TestLine","test","keyed","failure","state","hasDetail","Boolean","message","diff","stack","failureKey","equals","open","setOpen","previousFailure","collapsedFailure","currentFailure","handleOpenChange","next","name","statusLabel","meta","durationMs","onOpenChange","patch","complete","SuiteLine","suite","depth","counts","tests","holdsFailure","description","parts","file","join","icon","_el$8","_tmpl$7","_index","nested","TestResults","local","rest","listed","max","floor","duration","nothing","reportedTotal","_el$9","_tmpl$11","_$spread","_$mergeProps","class","_tmpl$12","_el$0","_tmpl$10","_el$1","_el$10","_tmpl$8","_el$11","totalNote","_el$12","_tmpl$9","_el$13","note","_el$18","_tmpl$13","_el$19","_el$21","nextSibling","reported","_el$14","_tmpl$0","basis","_tmpl$1"],"sources":["../../../../src/components/composites/test-results/test-results.tsx"],"sourcesContent":["import {\n Check as LucideCheck,\n CircleCheck as LucideCircleCheck,\n CircleMinus as LucideCircleMinus,\n CircleX as LucideCircleX,\n Copy as LucideCopy,\n FlaskConical as LucideFlaskConical,\n LoaderCircle as LucideLoaderCircle,\n} from 'lucide-solid'\nimport {\n createComputed,\n createMemo,\n createEffect,\n createSignal,\n For,\n Show,\n splitProps,\n type Accessor,\n type ComponentProps,\n type JSX,\n} from 'solid-js'\nimport { createCopyFeedback } from '#lib/clipboard'\nimport { cn } from '#lib/utils'\nimport { Button } from '../../ui/button'\nimport { DiffBlock } from '../../ui/diff-block'\nimport { Trace, TraceDetail, TraceLine, type TraceStatus } from '../../ui/trace'\nimport { StackTrace, type StackTraceProps } from '../stack-trace'\nimport {\n boundedEntries,\n describeCount,\n firstFailureRenderPath,\n formatDuration,\n listedCounts,\n reconcileCounts,\n sameFailure,\n siblingKey,\n suiteState,\n type CountLine,\n type TestCase,\n type TestCaseStatus,\n type TestOutcome,\n type TestSuite,\n type TestSummary,\n type FirstFailureRenderPath,\n} from './test-results-model'\nimport { fastIcon } from '#lib/fast-icon'\n\n// lucide icons drawn from a cloned template (see fastIcon).\nconst Check = fastIcon(LucideCheck)\nconst CircleCheck = fastIcon(LucideCircleCheck)\nconst CircleMinus = fastIcon(LucideCircleMinus)\nconst CircleX = fastIcon(LucideCircleX)\nconst Copy = fastIcon(LucideCopy)\nconst FlaskConical = fastIcon(LucideFlaskConical)\nconst LoaderCircle = fastIcon(LucideLoaderCircle)\n\n/**\n * TestResults.\n *\n * A test run: how it went in words and in a segmented bar, then the suites it\n * ran as `Trace` lines, each opening onto its tests, and a failing test opening\n * onto its message, diff and stack. It is for a run the host can structure; reach\n * for `Terminal` when all there is to show is the command's output, and for\n * `StackTrace` alone when one call failed outside a test.\n *\n * ## Counts are claims\n *\n * Nothing is computed that the host did not supply data for, and nothing the host\n * supplied is quietly recomputed. `summary` is the host's own tally and is shown\n * as given. If tests are listed and their number for an outcome does not match, the\n * listed number is shown beside it, \"40 passed (2 listed)\", which is also how a\n * host that lists only its failures reads. Without a `summary` the counts shown are\n * those of the tests listed, and the component says so; it does not present them as\n * the run's totals. A suite is marked failed or passed only from the tests listed in\n * it, and its spoken label says \"listed\" so it claims no more than that.\n *\n * ## Not colour-only\n *\n * The bar is decoration: every segment has a counterpart in the words beside it,\n * each with its own shape (a cross, a tick, a dash). Segments are separated by a\n * gap and never narrower than a visible sliver, so one failure in five thousand\n * tests is still on the bar.\n *\n * ## Bounded\n *\n * Suites and tests are listed `listLimit` at a time with \"show more\", and a suite's\n * tests are not rendered until it is open. The first failure in reading order opens\n * when its row is visible; a failure beyond a \"show more\" boundary stays unmounted\n * until its page is revealed. When a running result first reports a failure, its\n * suite and test open once. Later updates preserve the user's disclosure choices.\n *\n * Failure details are text: the message is a `pre`, the diff goes to `DiffBlock`\n * and the stack to `StackTrace`. If a stack already begins with the message, pass\n * only the stack; nothing here de-duplicates what the host sends.\n */\nexport type TestResultsProps = Omit<ComponentProps<'section'>, 'children'> & {\n suites: readonly TestSuite[]\n /** The host's own counts. Shown as given; see the component comment. */\n summary?: TestSummary\n /** The run is still going. */\n running?: boolean\n /** Suites, or tests within a suite, listed before \"show more\". Default 50. */\n listLimit?: number\n /** Passed to each failure's `StackTrace`. */\n onOpenFrame?: StackTraceProps['onOpenFrame']\n /** The section's accessible name. Default \"Test results\". */\n label?: string\n}\n\nexport const TEST_RESULTS_LIST_LIMIT = 50\n\nconst OUTCOME_ICON: Readonly<Record<TestOutcome, () => JSX.Element>> = {\n failed: () => <CircleX aria-hidden=\"true\" class=\"size-3.5 text-destructive\" />,\n passed: () => <CircleCheck aria-hidden=\"true\" class=\"size-3.5 text-success\" />,\n skipped: () => <CircleMinus aria-hidden=\"true\" class=\"size-3.5 text-muted-foreground\" />,\n}\n\nfunction CountReadout(props: { line: CountLine }) {\n return (\n <span class=\"flex items-center gap-1 whitespace-nowrap\" data-outcome={props.line.outcome}>\n {OUTCOME_ICON[props.line.outcome]()}\n {describeCount(props.line)}\n </span>\n )\n}\n\n// Segments are drawn in this order so the bar reads the same in every run.\nconst SEGMENT_CLASS: Readonly<Record<TestOutcome, string>> = {\n failed: 'bg-destructive',\n passed: 'bg-success',\n skipped: 'bg-muted-foreground/40',\n}\n\nfunction SummaryBar(props: { lines: readonly CountLine[] }) {\n const visible = () => props.lines.filter((line) => line.count > 0)\n return (\n <Show when={visible().length > 0}>\n <div\n aria-hidden=\"true\"\n data-slot=\"test-results-bar\"\n class=\"flex h-1.5 w-full gap-px overflow-hidden rounded-full bg-muted\"\n >\n <For each={visible()}>\n {(line) => (\n <span\n class={cn('min-w-1', SEGMENT_CLASS[line.outcome])}\n style={{ flex: `${line.count} 1 0` }}\n />\n )}\n </For>\n </div>\n </Show>\n )\n}\n\nconst TRACE_STATUS: Readonly<Record<TestCaseStatus, { status: TraceStatus; label: string }>> = {\n passed: { status: 'success', label: 'Passed' },\n failed: { status: 'error', label: 'Failed' },\n skipped: { status: 'cancelled', label: 'Skipped' },\n running: { status: 'running', label: 'Running' },\n pending: { status: 'pending', label: 'Not run yet' },\n}\n\n/**\n * Keep keyboard focus through a reorder. Solid moves a keyed row's node instead\n * of replacing it, and a browser blurs a focused element that is moved, so an\n * immutable reorder would drop the reader's place onto the body even though the\n * node and its open state survive. The focused element is noted just before the\n * rows move and given focus back just after, but only when nothing else has taken\n * focus meanwhile, and only inside a test run, so a reader who has moved on is\n * never pulled back and an unrelated element is never refocused.\n */\nfunction keepFocusThroughReorder(keys: Accessor<readonly string[]>) {\n let noted: HTMLElement | undefined\n createComputed(() => {\n keys()\n const active = typeof document === 'undefined' ? null : document.activeElement\n noted =\n active instanceof HTMLElement && active.closest('[data-slot=\"test-results\"]')\n ? active\n : undefined\n })\n createEffect(() => {\n keys()\n const element = noted\n noted = undefined\n if (!element || !element.isConnected) return\n const active = document.activeElement\n if (active === null || active === document.body) element.focus({ preventScroll: true })\n })\n}\n\n/** A list that shows its first `limit` items and offers the rest. */\nfunction Bounded<T>(props: {\n items: readonly T[]\n itemKey: (item: T, index: number) => string\n limit: number\n noun: string\n children: (item: Accessor<T>, index: Accessor<number>, key: string) => JSX.Element\n}) {\n const [shown, setShown] = createSignal(props.limit)\n const page = createMemo(() => boundedEntries(props.items, shown(), props.itemKey))\n const visible = () => page().entries\n const visibleKeys = createMemo(() => visible().map((entry) => entry.key))\n keepFocusThroughReorder(visibleKeys)\n const hidden = () => props.items.length - visible().length\n return (\n <>\n <For each={visibleKeys()}>\n {(key) => {\n const entry = createMemo(() => page().byKey.get(key)!)\n return props.children(\n () => entry().item,\n () => entry().index,\n key\n )\n }}\n </For>\n <Show when={hidden() > 0}>\n <li class=\"px-1.5 py-0.5\">\n <Button variant=\"ghost\" size=\"2xs\" onClick={() => setShown(shown() + props.limit)}>\n Show {Math.min(hidden(), props.limit).toLocaleString()} more {props.noun} (\n {hidden().toLocaleString()} hidden)\n </Button>\n </li>\n </Show>\n </>\n )\n}\n\n/** Characters of a failure message drawn before the rest is offered. */\nexport const TEST_RESULTS_MESSAGE_LIMIT = 4_000\n\n/**\n * A failed test's message, which a runner may print at any length: a captured\n * log, a serialized object, a long assertion. It opens on its own for the first\n * failure, so it is bounded where the diff and stack are already bounded: the\n * body scrolls past a fixed height, only the first characters are drawn until the\n * reader asks for the rest, and Copy writes all of it.\n */\nfunction FailureMessage(props: { text: string; onCopy?: (ok: boolean) => void }) {\n const [all, setAll] = createSignal(false)\n const { copied, failed: copyFailed, copy: copyText } = createCopyFeedback()\n const clipped = () => props.text.length > TEST_RESULTS_MESSAGE_LIMIT\n const cut = () => {\n // Never inside a surrogate pair, which would draw a replacement character.\n const last = props.text.charCodeAt(TEST_RESULTS_MESSAGE_LIMIT - 1)\n return last >= 0xd800 && last <= 0xdbff\n ? TEST_RESULTS_MESSAGE_LIMIT - 1\n : TEST_RESULTS_MESSAGE_LIMIT\n }\n const shown = () => (clipped() && !all() ? props.text.slice(0, cut()) : props.text)\n const copy = async () => {\n const ok = await copyText(props.text)\n props.onCopy?.(ok)\n }\n return (\n <>\n {/* A region that scrolls is a tab stop and needs a name. */}\n <pre\n data-slot=\"test-results-message\"\n tabindex=\"0\"\n role=\"group\"\n aria-label=\"Failure message\"\n class=\"m-0 max-h-64 overflow-auto font-code text-code whitespace-pre-wrap text-foreground [overflow-wrap:anywhere]\"\n >\n {shown()}\n </pre>\n <Show when={clipped()}>\n <div class=\"flex flex-wrap items-center gap-x-2 gap-y-1 text-xs text-muted-foreground\">\n <span class=\"italic\">\n <Show\n when={!all()}\n fallback={`All ${props.text.length.toLocaleString()} characters shown.`}\n >\n Showing the first {cut().toLocaleString()} of {props.text.length.toLocaleString()}{' '}\n characters (copy has all of it).\n </Show>\n </span>\n <Show when={!all()}>\n <Button variant=\"ghost\" size=\"2xs\" onClick={() => setAll(true)}>\n Show all {props.text.length.toLocaleString()} characters\n </Button>\n </Show>\n <Button\n variant=\"ghost\"\n size=\"2xs\"\n title={copyFailed() ? 'Copying is unavailable in this context' : undefined}\n onClick={() => void copy()}\n >\n <Show when={copied()} fallback={<Copy aria-hidden=\"true\" />}>\n <Check aria-hidden=\"true\" />\n </Show>\n {copied() ? 'Copied' : 'Copy message'}\n </Button>\n </div>\n </Show>\n </>\n )\n}\n\nfunction TestLine(props: {\n test: Accessor<TestCase>\n keyed: string\n failure?: FirstFailureRenderPath\n onOpenFrame?: TestResultsProps['onOpenFrame']\n}) {\n const test = () => props.test()\n const state = () => (test().status ? TRACE_STATUS[test().status as TestCaseStatus] : undefined)\n // Whether there is anything to disclose. Read once per change, so the disclosure\n // exists while closed without anything below it being built.\n const hasDetail = createMemo(() => Boolean(test().message || test().diff || test().stack))\n // Only the last suite on the failure's path is given it, so a key among\n // this suite's tests is enough to know the failure is this test.\n const failureKey = createMemo(\n () => (props.failure?.test === props.keyed ? props.failure : undefined),\n undefined,\n { equals: sameFailure }\n )\n const [open, setOpen] = createSignal(failureKey() !== undefined)\n let previousFailure = failureKey()\n let collapsedFailure: FirstFailureRenderPath | undefined\n\n createEffect(() => {\n const currentFailure = failureKey()\n if (\n currentFailure &&\n !sameFailure(currentFailure, previousFailure) &&\n !sameFailure(currentFailure, collapsedFailure)\n ) {\n setOpen(true)\n }\n previousFailure = currentFailure\n })\n\n const handleOpenChange = (next: boolean) => {\n if (!next && failureKey()) collapsedFailure = failureKey()\n else if (next) collapsedFailure = undefined\n setOpen(next)\n }\n\n return (\n <TraceLine\n title={test().name}\n status={state()?.status}\n statusLabel={state()?.label}\n meta={formatDuration(test().durationMs)}\n open={open()}\n onOpenChange={handleOpenChange}\n >\n {hasDetail() ? (\n // A closed test builds nothing: the body is made when it is opened, so a diff or\n // stack is not parsed for every test of an open suite.\n <Show when={open()}>\n <TraceDetail class=\"flex flex-col gap-2\">\n <Show when={test().message}>\n <FailureMessage text={test().message!} />\n </Show>\n <Show when={test().diff}>\n <DiffBlock patch={test().diff!} complete title=\"Expected and received\" />\n </Show>\n <Show when={test().stack}>\n <StackTrace text={test().stack!} onOpenFrame={props.onOpenFrame} />\n </Show>\n </TraceDetail>\n </Show>\n ) : undefined}\n </TraceLine>\n )\n}\n\nfunction SuiteLine(props: {\n suite: Accessor<TestSuite>\n /** This suite's key among its siblings. */\n keyed: string\n /** How many suites enclose this one. */\n depth: number\n limit: number\n /** The first failure, given only to suites on the way to it. */\n failure?: FirstFailureRenderPath\n onOpenFrame?: TestResultsProps['onOpenFrame']\n}) {\n const suite = () => props.suite()\n const counts = createMemo(() => listedCounts([suite()]))\n const state = createMemo(() => suiteState(counts()))\n const children = () => (suite().tests?.length ?? 0) + (suite().suites?.length ?? 0) > 0\n const [open, setOpen] = createSignal(state() === 'failed')\n // The parent passes the failure down only while it is on the way to it, so\n // one comparison at this suite's own depth settles whether it is on the path.\n // Memoised: each level reads its parent's, so a bare function would re-run the\n // whole chain above it on every read and cost exponential time in the depth.\n const failure = createMemo(\n () => (props.failure?.suites[props.depth] === props.keyed ? props.failure : undefined),\n undefined,\n { equals: sameFailure }\n )\n const holdsFailure = createMemo(() => failure()?.suites.length === props.depth + 1)\n let previousFailure = failure()\n let collapsedFailure: FirstFailureRenderPath | undefined\n\n createEffect(() => {\n const currentFailure = failure()\n if (\n currentFailure &&\n !sameFailure(currentFailure, previousFailure) &&\n !sameFailure(currentFailure, collapsedFailure)\n ) {\n setOpen(true)\n }\n previousFailure = currentFailure\n })\n\n const handleOpenChange = (next: boolean) => {\n if (!next && failure()) collapsedFailure = failure()\n else if (next) collapsedFailure = undefined\n setOpen(next)\n }\n\n const description = () => {\n const parts = [\n suite().file,\n counts().failed > 0 ? `${counts().failed.toLocaleString()} failed` : undefined,\n ]\n return parts.filter(Boolean).join(' · ') || undefined\n }\n return (\n <TraceLine\n icon={<FlaskConical />}\n title={suite().name}\n description={description()}\n status={\n state() === 'failed'\n ? 'error'\n : state() === 'running'\n ? 'running'\n : state() === 'passed'\n ? 'success'\n : undefined\n }\n statusLabel={\n state() === 'failed'\n ? 'Has failing tests'\n : state() === 'passed'\n ? 'All listed tests passed'\n : undefined\n }\n meta={formatDuration(suite().durationMs)}\n open={open()}\n onOpenChange={handleOpenChange}\n >\n {children() ? (\n <div>\n <Show when={open()}>\n <Trace size=\"sm\" aria-label={`${suite().name} tests`}>\n <Bounded\n items={suite().tests ?? []}\n itemKey={siblingKey}\n limit={props.limit}\n noun=\"tests\"\n >\n {(test, _index, key) => (\n <TestLine\n test={test}\n keyed={key}\n failure={holdsFailure() ? failure() : undefined}\n onOpenFrame={props.onOpenFrame}\n />\n )}\n </Bounded>\n <Bounded\n items={suite().suites ?? []}\n itemKey={siblingKey}\n limit={props.limit}\n noun=\"suites\"\n >\n {(nested, _index, key) => (\n <SuiteLine\n suite={nested}\n keyed={key}\n depth={props.depth + 1}\n limit={props.limit}\n failure={failure()}\n onOpenFrame={props.onOpenFrame}\n />\n )}\n </Bounded>\n </Trace>\n </Show>\n </div>\n ) : undefined}\n </TraceLine>\n )\n}\n\nexport function TestResults(props: TestResultsProps) {\n const [local, rest] = splitProps(props, [\n 'suites',\n 'summary',\n 'running',\n 'listLimit',\n 'onOpenFrame',\n 'label',\n 'class',\n ])\n\n const listed = createMemo(() => listedCounts(local.suites))\n const counts = createMemo(() => reconcileCounts(local.summary, listed()))\n const limit = () => Math.max(1, Math.floor(local.listLimit ?? TEST_RESULTS_LIST_LIMIT))\n const failure = createMemo(() => firstFailureRenderPath(local.suites), undefined, {\n equals: sameFailure,\n })\n const duration = () => formatDuration(local.summary?.durationMs, 'long')\n const nothing = () =>\n counts().lines.length === 0 &&\n counts().reportedTotal === undefined &&\n local.suites.length === 0 &&\n !local.running\n\n return (\n <section\n data-slot=\"test-results\"\n aria-label={local.label ?? 'Test results'}\n aria-busy={local.running || undefined}\n class={cn('flex min-w-0 flex-col gap-2', local.class)}\n {...rest}\n >\n <Show\n when={!nothing()}\n fallback={<p class=\"m-0 text-sm text-muted-foreground\">No test results</p>}\n >\n <div class=\"flex flex-col gap-1.5\">\n <div class=\"flex flex-wrap items-center gap-x-3 gap-y-1 text-sm\">\n <Show when={local.running}>\n <span class=\"flex items-center gap-1 text-info\">\n <LoaderCircle aria-hidden=\"true\" class=\"size-3.5 motion-safe:animate-spin\" />\n Running\n </span>\n </Show>\n <For each={counts().lines}>{(line) => <CountReadout line={line} />}</For>\n <Show\n when={\n counts().lines.length === 0 &&\n !counts().totalNote &&\n counts().reportedTotal !== undefined\n }\n >\n <span class=\"text-muted-foreground\">\n {counts().reportedTotal?.toLocaleString()} tests reported\n </span>\n </Show>\n <Show when={counts().totalNote}>\n {(note) => (\n <span class=\"text-muted-foreground\">\n {note().reported.toLocaleString()} tests reported (\n {note().listed.toLocaleString()} listed)\n </span>\n )}\n </Show>\n <Show when={duration()}>\n <span class=\"text-muted-foreground\">in {duration()}</span>\n </Show>\n </div>\n <SummaryBar lines={counts().lines} />\n <Show when={counts().basis === 'listed' && counts().lines.length > 0}>\n <p class=\"m-0 text-xs text-muted-foreground\">Counts are from the tests listed below.</p>\n </Show>\n </div>\n <Show when={local.suites.length > 0}>\n <Trace aria-label=\"Test suites\">\n <Bounded items={local.suites} itemKey={siblingKey} limit={limit()} noun=\"suites\">\n {(suite, _index, key) => (\n <SuiteLine\n suite={suite}\n keyed={key}\n depth={0}\n limit={limit()}\n failure={failure()}\n onOpenFrame={local.onOpenFrame}\n />\n )}\n </Bounded>\n </Trace>\n </Show>\n </Show>\n </section>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAgDA,IAAMA,UAAQsC,SAASrC,KAAW;AAClC,IAAMC,gBAAcoC,SAASnC,WAAiB;AAC9C,IAAMC,gBAAckC,SAASjC,WAAiB;AAC9C,IAAMC,YAAUgC,SAAS/B,OAAa;AACtC,IAAMC,SAAO8B,SAAS7B,IAAU;AAChC,IAAMC,iBAAe4B,SAAS3B,YAAkB;AAChD,IAAMC,iBAAe0B,SAASzB,YAAkB;AAuDhD,IAAagC,0BAA0B;AAEvC,IAAMC,eAAiE;CACrEC,cAAQC,gBAAO1C,WAAO;EAAA,eAAA;EAAA,SAAA;CAAA,CAAA;CACtB2C,cAAQD,gBAAO9C,eAAW;EAAA,eAAA;EAAA,SAAA;CAAA,CAAA;CAC1BgD,eAASF,gBAAO5C,eAAW;EAAA,eAAA;EAAA,SAAA;CAAA,CAAA;AAC7B;AAEA,SAAS+C,aAAaC,OAA4B;CAChD,cAAA;EAAA,IAAAE,OAAAC,OAAA;EAAAC,OAAAF,YAEKR,aAAaM,MAAMC,KAAKI,Q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B,EAAE,QAAQ,CAAC,MAAM,CAAC,UAAU,EAAE,MAAM,CAAC,CAInE,CAAA;AAYD,MAAM,MAAM,SAAS,GAAG,IAAI,CAC1B,cAAc,EACd,OAAO,GAAG,QAAQ,GAAG,aAAa,GAAG,MAAM,GAAG,UAAU,GAAG,gBAAgB,CAC5E,GAAG;IACF,+DAA+D;IAC/D,IAAI,EAAE,MAAM,CAAA;IACZ,yDAAyD;IACzD,WAAW,CAAC,EAAE,GAAG,CAAC,OAAO,CAAA;IACzB,MAAM,CAAC,EAAE,UAAU,CAAA;IACnB,kFAAkF;IAClF,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,qEAAqE;IACrE,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,6EAA6E;IAC7E,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,+EAA+E;IAC/E,QAAQ,CAAC,EAAE,GAAG,CAAC,OAAO,CAAA;CACvB,CAAA;AAyCD,wBAAgB,IAAI,CAAC,KAAK,EAAE,SAAS,eA6EpC"}
@@ -2,6 +2,7 @@ import { Badge } from "../../ui/badge/badge.js";
2
2
  import { CodeBlock } from "../../ui/code-block/code-block.js";
3
3
  import { TRACE_STATUS_LABELS, TraceDetail, TraceError, TraceLine } from "../../ui/trace/trace.js";
4
4
  import { formatToolValue } from "./format-tool-value.js";
5
+ import { fastIcon } from "../../../lib/fast-icon.js";
5
6
  import { createComponent, insert, memo, mergeProps, template } from "solid-js/web";
6
7
  import { Wrench } from "lucide-solid";
7
8
  import { Show, children, createMemo, splitProps } from "solid-js";
@@ -9,6 +10,7 @@ import { Show, children, createMemo, splitProps } from "solid-js";
9
10
  var _tmpl$ = /*#__PURE__*/ template(`<p class="m-0 px-1 text-xs text-muted-foreground">Showing the first <!> characters.`);
10
11
  var _tmpl$2 = /*#__PURE__*/ template(`<div class="flex min-w-0 flex-col gap-1">`);
11
12
  var _tmpl$3 = /*#__PURE__*/ template(`<span class="flex items-center gap-2">`);
13
+ var Wrench$1 = fastIcon(Wrench);
12
14
  /**
13
15
  * The words spoken (and, for the last three, shown) for each status. `denied` is
14
16
  * a decision about the call; `cancelled` is the run being stopped while the call
@@ -190,7 +192,7 @@ function Tool(props) {
190
192
  })() : local.meta;
191
193
  return createComponent(TraceLine, mergeProps({
192
194
  get icon() {
193
- return local.icon ?? createComponent(Wrench, {});
195
+ return local.icon ?? createComponent(Wrench$1, {});
194
196
  },
195
197
  get title() {
196
198
  return local.name;
@@ -1 +1 @@
1
- {"version":3,"file":"tool.js","names":["Wrench","children","resolveChildren","createMemo","Show","splitProps","Badge","CodeBlock","TRACE_STATUS_LABELS","TraceDetail","TraceError","TraceLine","formatToolValue","TOOL_STATUS_LABELS","denied","TRACE_STATUS","pending","running","success","error","cancelled","name","description","status","input","output","errorText","maxChars","SECTION_MAX_HEIGHT","TruncatedNote","props","truncated","_$createComponent","when","_el$","_tmpl$","firstChild","_el$4","nextSibling","_$insert","toLocaleString","Section","title","value","complete","formatted","_el$5","_tmpl$2","size","language","code","text","maxHeight","wrap","ErrorSection","Tool","local","rest","hasInput","undefined","hasOutput","hasError","extra","hasDetail","toArray","length","detail","_$memo","wordBadge","_el$6","_tmpl$3","variant","meta","_$mergeProps","icon","statusLabel","defaultOpen"],"sources":["../../../../src/components/composites/tool/tool.tsx"],"sourcesContent":["import { Wrench } from 'lucide-solid'\nimport { children as resolveChildren, createMemo, Show, splitProps, type JSX } from 'solid-js'\nimport { Badge } from '../../ui/badge'\nimport { CodeBlock } from '../../ui/code-block'\nimport {\n TRACE_STATUS_LABELS,\n TraceDetail,\n TraceError,\n TraceLine,\n type TraceLineProps,\n type TraceStatus,\n} from '../../ui/trace'\nimport { formatToolValue, TOOL_VALUE_MAX_CHARS } from './format-tool-value'\n\n/**\n * Tool.\n *\n * One tool call, from what was asked to what came back, as a `TraceLine`: the\n * tool's name and a short description on the line, and, when there is anything\n * to show, an input section, an output section and an error underneath. Reach\n * for `Subagent` when the \"tool\" is another agent with steps of its own, for a\n * bare `CodeBlock` when the point is the output itself and not the call that made\n * it, and for a confirmation (passed as `children`) when the reader has to decide\n * something about the call.\n *\n * ## Everything is optional, and absence is not a claim\n *\n * A call with no `status` shows no mark at all, an event that merely arrived is\n * not \"done\". `input`, `output` and `errorText` each render a section only when\n * the host passed them: no empty \"Output\" box under a call that is still running,\n * and no invented \"No output\" under one that failed. An error with no output is\n * just the error. A call with nothing to expand is a plain line, not a\n * disclosure that opens onto nothing.\n *\n * Two statuses are words, not only marks, because the glyphs for them are easy to\n * misread: `awaiting-approval` and `denied` also show a badge. Both are spoken\n * once (the badge is hidden from assistive technology and the status word is\n * read in its place). A call awaiting approval opens by default, since it is the\n * one state in which the reader has something to do. The component never decides\n * whether an approval is allowed: the controls live in `children`, supplied by\n * the host, or are absent.\n *\n * ## Payloads are untrusted and unbounded\n *\n * `input` and `output` are `unknown`, whatever the model sent and the tool\n * returned. They go through `formatToolValue`, which cannot throw (circular\n * references, `BigInt`, throwing getters) and stops after `maxChars`; a cut view\n * says so rather than presenting half a document as the whole. Sections render in\n * a small `CodeBlock` with a capped height. A string is shown as given; anything\n * structured is pretty-printed JSON. The sections mount only when the line is\n * opened, so a transcript of hundreds of calls formats none of them until asked.\n *\n * A `Tool` is a line: place it inside a `Trace`.\n */\nexport type ToolStatus =\n | 'pending'\n | 'running'\n | 'success'\n | 'error'\n | 'awaiting-approval'\n | 'denied'\n | 'cancelled'\n\n/**\n * The words spoken (and, for the last three, shown) for each status. `denied` is\n * a decision about the call; `cancelled` is the run being stopped while the call\n * was in flight. Give a call `cancelled` only when the host knows that call was\n * stopped: a run ending does not by itself say what became of each call.\n */\nexport const TOOL_STATUS_LABELS: Readonly<Record<ToolStatus, string>> = {\n ...TRACE_STATUS_LABELS,\n 'awaiting-approval': 'Awaiting approval',\n denied: 'Denied',\n}\n\nconst TRACE_STATUS: Readonly<Record<ToolStatus, TraceStatus>> = {\n pending: 'pending',\n running: 'running',\n success: 'success',\n error: 'error',\n 'awaiting-approval': 'pending',\n denied: 'cancelled',\n cancelled: 'cancelled',\n}\n\nexport type ToolProps = Omit<\n TraceLineProps,\n 'title' | 'status' | 'statusLabel' | 'href' | 'onSelect' | 'selectHaspopup'\n> & {\n /** The tool's name, as the host knows it. Rendered as text. */\n name: string\n /** What this call is for: a path, a query, a command. */\n description?: JSX.Element\n status?: ToolStatus\n /** What the model asked the tool to do. Any value; omit it to show no section. */\n input?: unknown\n /** What the tool returned. Any value; omit it to show no section. */\n output?: unknown\n errorText?: string\n /** Characters of each section shown before it is cut. Defaults to 20,000. */\n maxChars?: number\n /** Extra detail below the sections: an approval, a link to the full output. */\n children?: JSX.Element\n}\n\nconst SECTION_MAX_HEIGHT = '16rem'\n\nfunction TruncatedNote(props: { truncated: boolean; maxChars: number }) {\n return (\n <Show when={props.truncated}>\n <p class=\"m-0 px-1 text-xs text-muted-foreground\">\n Showing the first {props.maxChars.toLocaleString('en')} characters.\n </p>\n </Show>\n )\n}\n\nfunction Section(props: { title: string; value: unknown; maxChars: number; complete?: boolean }) {\n const formatted = createMemo(() => formatToolValue(props.value, { maxChars: props.maxChars }))\n return (\n <div class=\"flex min-w-0 flex-col gap-1\">\n <CodeBlock\n size=\"sm\"\n title={props.title}\n language={formatted().language}\n code={formatted().text}\n complete={props.complete ?? true}\n maxHeight={SECTION_MAX_HEIGHT}\n wrap={formatted().language === 'text'}\n />\n <TruncatedNote truncated={formatted().truncated} maxChars={props.maxChars} />\n </div>\n )\n}\n\nfunction ErrorSection(props: { text: string; maxChars: number }) {\n const formatted = createMemo(() => formatToolValue(props.text, { maxChars: props.maxChars }))\n return (\n <TraceError text={formatted().text}>\n <TruncatedNote truncated={formatted().truncated} maxChars={props.maxChars} />\n </TraceError>\n )\n}\n\nexport function Tool(props: ToolProps) {\n const [local, rest] = splitProps(props, [\n 'name',\n 'description',\n 'status',\n 'input',\n 'output',\n 'errorText',\n 'maxChars',\n 'icon',\n 'meta',\n 'defaultOpen',\n 'children',\n ])\n const maxChars = () => local.maxChars ?? TOOL_VALUE_MAX_CHARS\n const hasInput = () => local.input !== undefined\n const hasOutput = () => local.output !== undefined\n const hasError = () => local.errorText !== undefined && local.errorText !== ''\n // Resolved once: a host's approval controls are created once and keep their\n // state and focus however often the line is folded.\n const extra = resolveChildren(() => local.children)\n const hasDetail = () => hasInput() || hasOutput() || hasError() || extra.toArray().length > 0\n\n const detail = () => (\n <TraceDetail class=\"flex flex-col gap-2\">\n <Show when={hasInput()}>\n <Section title=\"Input\" value={local.input} maxChars={maxChars()} />\n </Show>\n <Show when={hasOutput()}>\n <Section\n title=\"Output\"\n value={local.output}\n maxChars={maxChars()}\n complete={local.status !== 'running'}\n />\n </Show>\n <Show when={hasError()}>\n <ErrorSection text={local.errorText ?? ''} maxChars={maxChars()} />\n </Show>\n {extra()}\n </TraceDetail>\n )\n\n // Words as well as marks for the states whose glyph is easy to misread. The\n // badge is hidden from assistive technology: the status word is already spoken.\n const wordBadge = () =>\n local.status === 'awaiting-approval' ||\n local.status === 'denied' ||\n local.status === 'cancelled' ? (\n <span class=\"flex items-center gap-2\">\n <Badge\n aria-hidden=\"true\"\n size=\"sm\"\n variant={local.status === 'awaiting-approval' ? 'warning' : 'outline'}\n >\n {TOOL_STATUS_LABELS[local.status]}\n </Badge>\n {local.meta}\n </span>\n ) : (\n local.meta\n )\n\n return (\n <TraceLine\n icon={local.icon ?? <Wrench />}\n title={local.name}\n description={local.description}\n status={local.status ? TRACE_STATUS[local.status] : undefined}\n statusLabel={local.status ? TOOL_STATUS_LABELS[local.status] : undefined}\n meta={wordBadge()}\n defaultOpen={local.defaultOpen ?? local.status === 'awaiting-approval'}\n {...rest}\n >\n {hasDetail() ? detail : undefined}\n </TraceLine>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAqEA,IAAaa,qBAA2D;CACtE,GAAGL;CACH,qBAAqB;CACrBM,QAAQ;AACV;AAEA,IAAMC,eAA0D;CAC9DC,SAAS;CACTC,SAAS;CACTC,SAAS;C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ayC,MAAMjC,UAAUoC,KAAAA;EAAS;EAAA,IAC7DgB,cAAW;GAAA,OAAER,WAAA,CAAA,CAAAX,MAAMjC,MAAM,CAAA,CAAA,IAAGV,mBAAmB2C,MAAMjC,UAAUoC,KAAAA;EAAS;EAAA,IACxEa,OAAI;GAAA,OAAEJ,UAAU;EAAC;EAAA,IACjBQ,cAAW;GAAA,OAAEpB,MAAMoB,eAAepB,MAAMjC,WAAW;EAAmB;CAAA,GAClEkC,MAAI,EAAA,IAAAxD,WAAA;EAAA,OAEP8D,UAAU,IAAIG,SAASP,KAAAA;CAAS,EAAA,CAAA,CAAA;AAGvC"}
1
+ {"version":3,"file":"tool.js","names":["Wrench","LucideWrench","children","resolveChildren","createMemo","Show","splitProps","Badge","CodeBlock","TRACE_STATUS_LABELS","TraceDetail","TraceError","TraceLine","formatToolValue","fastIcon","TOOL_STATUS_LABELS","denied","TRACE_STATUS","pending","running","success","error","cancelled","name","description","status","input","output","errorText","maxChars","SECTION_MAX_HEIGHT","TruncatedNote","props","truncated","_$createComponent","when","_el$","_tmpl$","firstChild","_el$4","nextSibling","_$insert","toLocaleString","Section","title","value","complete","formatted","_el$5","_tmpl$2","size","language","code","text","maxHeight","wrap","ErrorSection","Tool","local","rest","hasInput","undefined","hasOutput","hasError","extra","hasDetail","toArray","length","detail","_$memo","wordBadge","_el$6","_tmpl$3","variant","meta","_$mergeProps","icon","statusLabel","defaultOpen"],"sources":["../../../../src/components/composites/tool/tool.tsx"],"sourcesContent":["import { Wrench as LucideWrench } from 'lucide-solid'\nimport { children as resolveChildren, createMemo, Show, splitProps, type JSX } from 'solid-js'\nimport { Badge } from '../../ui/badge'\nimport { CodeBlock } from '../../ui/code-block'\nimport {\n TRACE_STATUS_LABELS,\n TraceDetail,\n TraceError,\n TraceLine,\n type TraceLineProps,\n type TraceStatus,\n} from '../../ui/trace'\nimport { formatToolValue, TOOL_VALUE_MAX_CHARS } from './format-tool-value'\nimport { fastIcon } from '#lib/fast-icon'\n\n// lucide icons drawn from a cloned template (see fastIcon).\nconst Wrench = fastIcon(LucideWrench)\n\n/**\n * Tool.\n *\n * One tool call, from what was asked to what came back, as a `TraceLine`: the\n * tool's name and a short description on the line, and, when there is anything\n * to show, an input section, an output section and an error underneath. Reach\n * for `Subagent` when the \"tool\" is another agent with steps of its own, for a\n * bare `CodeBlock` when the point is the output itself and not the call that made\n * it, and for a confirmation (passed as `children`) when the reader has to decide\n * something about the call.\n *\n * ## Everything is optional, and absence is not a claim\n *\n * A call with no `status` shows no mark at all, an event that merely arrived is\n * not \"done\". `input`, `output` and `errorText` each render a section only when\n * the host passed them: no empty \"Output\" box under a call that is still running,\n * and no invented \"No output\" under one that failed. An error with no output is\n * just the error. A call with nothing to expand is a plain line, not a\n * disclosure that opens onto nothing.\n *\n * Two statuses are words, not only marks, because the glyphs for them are easy to\n * misread: `awaiting-approval` and `denied` also show a badge. Both are spoken\n * once (the badge is hidden from assistive technology and the status word is\n * read in its place). A call awaiting approval opens by default, since it is the\n * one state in which the reader has something to do. The component never decides\n * whether an approval is allowed: the controls live in `children`, supplied by\n * the host, or are absent.\n *\n * ## Payloads are untrusted and unbounded\n *\n * `input` and `output` are `unknown`, whatever the model sent and the tool\n * returned. They go through `formatToolValue`, which cannot throw (circular\n * references, `BigInt`, throwing getters) and stops after `maxChars`; a cut view\n * says so rather than presenting half a document as the whole. Sections render in\n * a small `CodeBlock` with a capped height. A string is shown as given; anything\n * structured is pretty-printed JSON. The sections mount only when the line is\n * opened, so a transcript of hundreds of calls formats none of them until asked.\n *\n * A `Tool` is a line: place it inside a `Trace`.\n */\nexport type ToolStatus =\n | 'pending'\n | 'running'\n | 'success'\n | 'error'\n | 'awaiting-approval'\n | 'denied'\n | 'cancelled'\n\n/**\n * The words spoken (and, for the last three, shown) for each status. `denied` is\n * a decision about the call; `cancelled` is the run being stopped while the call\n * was in flight. Give a call `cancelled` only when the host knows that call was\n * stopped: a run ending does not by itself say what became of each call.\n */\nexport const TOOL_STATUS_LABELS: Readonly<Record<ToolStatus, string>> = {\n ...TRACE_STATUS_LABELS,\n 'awaiting-approval': 'Awaiting approval',\n denied: 'Denied',\n}\n\nconst TRACE_STATUS: Readonly<Record<ToolStatus, TraceStatus>> = {\n pending: 'pending',\n running: 'running',\n success: 'success',\n error: 'error',\n 'awaiting-approval': 'pending',\n denied: 'cancelled',\n cancelled: 'cancelled',\n}\n\nexport type ToolProps = Omit<\n TraceLineProps,\n 'title' | 'status' | 'statusLabel' | 'href' | 'onSelect' | 'selectHaspopup'\n> & {\n /** The tool's name, as the host knows it. Rendered as text. */\n name: string\n /** What this call is for: a path, a query, a command. */\n description?: JSX.Element\n status?: ToolStatus\n /** What the model asked the tool to do. Any value; omit it to show no section. */\n input?: unknown\n /** What the tool returned. Any value; omit it to show no section. */\n output?: unknown\n errorText?: string\n /** Characters of each section shown before it is cut. Defaults to 20,000. */\n maxChars?: number\n /** Extra detail below the sections: an approval, a link to the full output. */\n children?: JSX.Element\n}\n\nconst SECTION_MAX_HEIGHT = '16rem'\n\nfunction TruncatedNote(props: { truncated: boolean; maxChars: number }) {\n return (\n <Show when={props.truncated}>\n <p class=\"m-0 px-1 text-xs text-muted-foreground\">\n Showing the first {props.maxChars.toLocaleString('en')} characters.\n </p>\n </Show>\n )\n}\n\nfunction Section(props: { title: string; value: unknown; maxChars: number; complete?: boolean }) {\n const formatted = createMemo(() => formatToolValue(props.value, { maxChars: props.maxChars }))\n return (\n <div class=\"flex min-w-0 flex-col gap-1\">\n <CodeBlock\n size=\"sm\"\n title={props.title}\n language={formatted().language}\n code={formatted().text}\n complete={props.complete ?? true}\n maxHeight={SECTION_MAX_HEIGHT}\n wrap={formatted().language === 'text'}\n />\n <TruncatedNote truncated={formatted().truncated} maxChars={props.maxChars} />\n </div>\n )\n}\n\nfunction ErrorSection(props: { text: string; maxChars: number }) {\n const formatted = createMemo(() => formatToolValue(props.text, { maxChars: props.maxChars }))\n return (\n <TraceError text={formatted().text}>\n <TruncatedNote truncated={formatted().truncated} maxChars={props.maxChars} />\n </TraceError>\n )\n}\n\nexport function Tool(props: ToolProps) {\n const [local, rest] = splitProps(props, [\n 'name',\n 'description',\n 'status',\n 'input',\n 'output',\n 'errorText',\n 'maxChars',\n 'icon',\n 'meta',\n 'defaultOpen',\n 'children',\n ])\n const maxChars = () => local.maxChars ?? TOOL_VALUE_MAX_CHARS\n const hasInput = () => local.input !== undefined\n const hasOutput = () => local.output !== undefined\n const hasError = () => local.errorText !== undefined && local.errorText !== ''\n // Resolved once: a host's approval controls are created once and keep their\n // state and focus however often the line is folded.\n const extra = resolveChildren(() => local.children)\n const hasDetail = () => hasInput() || hasOutput() || hasError() || extra.toArray().length > 0\n\n const detail = () => (\n <TraceDetail class=\"flex flex-col gap-2\">\n <Show when={hasInput()}>\n <Section title=\"Input\" value={local.input} maxChars={maxChars()} />\n </Show>\n <Show when={hasOutput()}>\n <Section\n title=\"Output\"\n value={local.output}\n maxChars={maxChars()}\n complete={local.status !== 'running'}\n />\n </Show>\n <Show when={hasError()}>\n <ErrorSection text={local.errorText ?? ''} maxChars={maxChars()} />\n </Show>\n {extra()}\n </TraceDetail>\n )\n\n // Words as well as marks for the states whose glyph is easy to misread. The\n // badge is hidden from assistive technology: the status word is already spoken.\n const wordBadge = () =>\n local.status === 'awaiting-approval' ||\n local.status === 'denied' ||\n local.status === 'cancelled' ? (\n <span class=\"flex items-center gap-2\">\n <Badge\n aria-hidden=\"true\"\n size=\"sm\"\n variant={local.status === 'awaiting-approval' ? 'warning' : 'outline'}\n >\n {TOOL_STATUS_LABELS[local.status]}\n </Badge>\n {local.meta}\n </span>\n ) : (\n local.meta\n )\n\n return (\n <TraceLine\n icon={local.icon ?? <Wrench />}\n title={local.name}\n description={local.description}\n status={local.status ? TRACE_STATUS[local.status] : undefined}\n statusLabel={local.status ? TOOL_STATUS_LABELS[local.status] : undefined}\n meta={wordBadge()}\n defaultOpen={local.defaultOpen ?? local.status === 'awaiting-approval'}\n {...rest}\n >\n {hasDetail() ? detail : undefined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BG;AACH,wBAAgB,IAAI,CAAC,KAAK,EAAE,SAAS,eAsRpC;AAED,MAAM,MAAM,YAAY,GAAG,IAAI,CAC7B,cAAc,CAAC,KAAK,CAAC,EACnB,UAAU,GACV,MAAM,GACN,UAAU,GACV,SAAS,GACT,SAAS,GACT,eAAe,GACf,OAAO,GACP,YAAY,GACZ,eAAe,GACf,eAAe,GACf,eAAe,GACf,cAAc,CACjB,GAAG;IACF,IAAI,EAAE,kBAAkB,CAAA;IACxB,oEAAoE;IACpE,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,OAAO,CAAC,EAAE,GAAG,CAAC,OAAO,CAAA;IACrB,QAAQ,CAAC,EAAE,GAAG,CAAC,OAAO,CAAA;IACtB,QAAQ,EAAE,GAAG,CAAC,OAAO,CAAA;IACrB,aAAa,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,GAAG;QAAE,aAAa,EAAE,cAAc,CAAA;KAAE,KAAK,IAAI,CAAA;CAC5F,CAAA;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,OAAO,CAAC,KAAK,EAAE,YAAY,eA6J1C;AAED;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,cAAc,CAAC,MAAM,CAAC,GAAG;IAAE,MAAM,CAAC,EAAE,OAAO,CAAA;CAAE,eAclF;AA0CD,YAAY,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAA"}
@@ -1,5 +1,6 @@
1
1
  import { cn } from "../../../lib/utils.js";
2
2
  import { indexTreeItems, treeNavigationAction, typeaheadIndex } from "./tree-navigation.js";
3
+ import { fastIcon } from "../../../lib/fast-icon.js";
3
4
  import { addEventListener, className, createComponent, delegateEvents, effect, insert, memo, mergeProps, setAttribute, setStyleProperty, spread, template, use } from "solid-js/web";
4
5
  import { ChevronRight } from "lucide-solid";
5
6
  import { For, Show, createContext, createEffect, createMemo, createSelector, createUniqueId, onCleanup, splitProps, useContext } from "solid-js";
@@ -10,6 +11,7 @@ var _tmpl$3 = /*#__PURE__*/ template(`<span aria-hidden=true data-slot=tree-row-
10
11
  var _tmpl$4 = /*#__PURE__*/ template(`<span class="flex size-4 shrink-0 items-center justify-center [&amp;_svg]:size-4">`);
11
12
  var _tmpl$5 = /*#__PURE__*/ template(`<span class="ms-auto flex shrink-0 items-center gap-1 text-muted-foreground">`);
12
13
  var _tmpl$6 = /*#__PURE__*/ template(`<span data-slot=tree-row-actions>`);
14
+ var ChevronRight$1 = fastIcon(ChevronRight);
13
15
  var TreeContext = createContext();
14
16
  function useTreeContext() {
15
17
  const tree = useContext(TreeContext);
@@ -401,7 +403,7 @@ function TreeRow(props) {
401
403
  addEventListener(_el$3, "mousedown", markerTarget() ? handleMarkerMouseDown : void 0, true);
402
404
  insert(_el$3, (() => {
403
405
  var _c$ = memo(() => !!local.item.expandable);
404
- return () => _c$() ? createComponent(ChevronRight, {
406
+ return () => _c$() ? createComponent(ChevronRight$1, {
405
407
  "aria-hidden": "true",
406
408
  get ["class"]() {
407
409
  return cn("size-3.5 transition-transform", local.item.expanded && "rotate-90");
@@ -1 +1 @@
1
- {"version":3,"file":"tree.js","names":["ChevronRight","createContext","createEffect","createMemo","createSelector","createUniqueId","For","onCleanup","Show","splitProps","useContext","cn","indexTreeItems","treeNavigationAction","typeaheadIndex","idPrefix","activeId","isActive","id","index","register","element","HTMLDivElement","unregister","focusItem","noteFocus","noteBlur","next","activate","event","expand","expanded","disclosure","guides","onActiveIdChange","TreeContext","useTreeContext","tree","Error","visibleItems","onExpand","onActivate","onSelectItem","onRequestReveal","onRowSizeChange","blockSize","selectionMode","typeaheadLabel","children","Element","Tree","props","local","rest","effectiveActiveId","candidate","visible","byId","has","ids","rows","Map","rowIdsByElement","WeakMap","pendingFocusId","pendingFocusGuard","requestedRevealId","focusedId","disposed","isInsideTreeRow","row","closest","focusIsOutsideTree","document","active","activeElement","body","documentElement","rowSizeObserver","ResizeObserver","undefined","entries","entry","get","target","borderBoxSize","offsetHeight","Number","isFinite","setPendingFocus","removeEventListener","cancelPendingFocus","addEventListener","typed","typedTimer","setTimeout","disconnect","clearTimeout","requestReveal","focusWhenMounted","queueMicrotask","focus","context","set","observe","focusWasInside","Boolean","contains","delete","unobserve","fallbackId","typeahead","label","ctrlKey","metaKey","altKey","key","length","indexById","map","preventDefault","handleKeyDown","defaultPrevented","isActionTarget","currentTarget","action","type","_$createComponent","Provider","value","_el$","_tmpl$","_$spread","_$mergeProps","class","_$insert","item","selected","leading","trailing","onDoubleClick","TreeRow","registeredId","handleFocusOut","relatedTarget","setRef","nextId","handleFocus","handleClick","handleDoubleClick","position","positionById","markerTarget","expandable","handleMarkerClick","stopPropagation","_el$2","_tmpl$2","_el$3","firstChild","_el$4","nextSibling","_ref$","composeRefs","ref","_$use","encodeURIComponent","level","_$memo","setSize","tabIndex","String","relative","style","rowInset","when","each","Array","from","_","_el$5","_tmpl$3","_$effect","_$p","_$setStyleProperty","GUIDE_CENTER","_$addEventListener","handleMarkerDoubleClick","handleMarkerMouseDown","_c$","slot","_el$6","_tmpl$4","_el$7","_tmpl$5","_p$","_v$","_v$2","e","_$setAttribute","t","_$className","TreeRowActions","pinned","_el$8","_tmpl$6","Math","max","internal","external","_$delegateEvents"],"sources":["../../../../src/components/composites/tree/tree.tsx"],"sourcesContent":["import type { ComponentProps, JSX } from 'solid-js'\nimport { ChevronRight } from 'lucide-solid'\nimport {\n createContext,\n createEffect,\n createMemo,\n createSelector,\n createUniqueId,\n For,\n onCleanup,\n Show,\n splitProps,\n useContext,\n} from 'solid-js'\nimport { cn } from '#lib/utils'\nimport {\n indexTreeItems,\n treeNavigationAction,\n typeaheadIndex,\n type TreeItemDescriptor,\n type TreeNavigationIndex,\n} from './tree-navigation'\n\ntype TreeContextValue = {\n idPrefix: string\n activeId: () => string | null\n /** O(1) per change: only the rows whose answer flips re-run, not every row. */\n isActive: (id: string) => boolean\n index: () => TreeNavigationIndex\n register: (id: string, element: HTMLDivElement) => void\n unregister: (id: string, element: HTMLDivElement | undefined) => void\n focusItem: (id: string) => void\n noteFocus: (id: string) => void\n noteBlur: (next: EventTarget | null) => void\n activate: (id: string, event: Event) => void\n expand: (id: string, expanded: boolean) => void\n disclosure: () => TreeDisclosure\n guides: () => boolean\n onActiveIdChange: (id: string) => void\n}\n\nconst TreeContext = createContext<TreeContextValue>()\n\nfunction useTreeContext() {\n const tree = useContext(TreeContext)\n if (!tree) throw new Error('[adea-ui]: TreeRow must be used inside Tree.')\n return tree\n}\n\n/**\n * Who owns the pointer on a row's disclosure chevron.\n *\n * - `row` (default): the chevron is decoration; a click anywhere on the row,\n * chevron included, is a row activation. This is the file-explorer\n * convention, where the host's `onActivate` toggles a folder.\n * - `marker`: the chevron of an expandable row is its own pointer target. It\n * calls `onExpand(id, !expanded)` and nothing else; the rest of the row still\n * activates. For trees where expanding and selecting are independent (a\n * source list that selects a source and separately reveals its details).\n */\nexport type TreeDisclosure = 'row' | 'marker'\n\ntype TreeAccessibleName =\n | { 'aria-label': string; 'aria-labelledby'?: string }\n | { 'aria-label'?: string; 'aria-labelledby': string }\n\nexport type TreeProps = Omit<\n ComponentProps<'div'>,\n 'children' | 'role' | 'tabIndex' | 'onKeyDown' | 'aria-label' | 'aria-labelledby'\n> &\n TreeAccessibleName & {\n /** Complete, ordered projection of currently visible (expanded) items. */\n visibleItems: readonly TreeItemDescriptor[]\n /** The host-owned identity of the row that currently owns roving focus. */\n activeId: string | null\n /**\n * Called when keyboard or pointer navigation changes the active row, and when\n * the active row leaves `visibleItems` (collapsed away, filtered out) and the\n * first visible row takes over as the roving stop.\n */\n onActiveIdChange: (id: string) => void\n /** Called for Left/Right expand and collapse requests. */\n onExpand?: (id: string, expanded: boolean) => void\n /**\n * Opt-in pointer behaviour of the disclosure chevron; see {@link TreeDisclosure}.\n * Keyboard behaviour is identical in both modes: Left/Right expand and collapse.\n */\n disclosure?: TreeDisclosure\n /**\n * Draw a vertical guide line down each ancestor level of a nested row, so a\n * group of children reads as belonging to its parent. Off by default: a flat\n * list or a dense file explorer carries its own rhythm.\n */\n guides?: boolean\n /** Called for Enter or pointer activation. Domain action stays host-owned. */\n onActivate?: (id: string, event: Event) => void\n /** Called for Space selection. Selection state stays host-owned. */\n onSelectItem?: (id: string, event: Event) => void\n /** Ask the host window to mount/reveal an item before focus moves to it. */\n onRequestReveal?: (id: string) => void\n /** Report a mounted row's border-box block size in CSS pixels for host range math. */\n onRowSizeChange?: (id: string, blockSize: number) => void\n /** Declares a multi-select tree to assistive technology. */\n selectionMode?: 'single' | 'multiple'\n /**\n * The text a row is found by when the reader types its first letters. Supply\n * it to turn on typeahead: a typed prefix moves focus to the next visible row\n * whose label starts with it, revealing an unmounted row first.\n */\n typeaheadLabel?: (id: string) => string\n children?: JSX.Element\n }\n\n/**\n * Tree.\n *\n * Supplies semantic and keyboard behavior for a tree whose host owns the\n * visible projection, filesystem state, row window and domain actions. The\n * mounted children can be a small virtualized window; `visibleItems` remains\n * the complete ordered projection so keyboard movement and sibling positions\n * do not depend on which rows currently exist in the DOM.\n *\n * Kobalte 0.13.14 has no Tree primitive, so this component implements the\n * WAI-ARIA tree row navigation contract and leaves product state to callbacks.\n *\n * By default the disclosure chevron is decoration and a click anywhere on a\n * row activates it, so a file explorer can toggle a folder from `onActivate`.\n * Reach for `disclosure=\"marker\"` when expanding and selecting are separate\n * decisions: the chevron then calls only `onExpand`, and the rest of the row\n * calls only `onActivate`. The chevron stays `aria-hidden` and out of the tab\n * order in both modes; keyboard expansion is Left/Right either way.\n *\n * Collapsing is the one thing that can move focus without a key or a click on\n * the target row: when the active row leaves `visibleItems`, the first visible\n * row becomes the roving stop and `onActiveIdChange` is called with it. If the\n * removed row held focus, or was the last row the tree saw focused, focus moves\n * to that same row; if it had no focus, only the roving stop moves. Focus that\n * has already gone to a control outside the tree is never pulled back: the tree\n * forgets its last focused row when focus moves to an element outside it, and\n * the roving stop alone moves if that control still has focus when the row is\n * hidden. Focus the tree has asked for but not yet moved (a queued recovery, or a\n * keyboard move to a row the host has not mounted) is withdrawn when focus lands\n * outside the tree, and is checked again when a row mounts. This is the same in\n * both `disclosure` modes and for every way a host collapses a row.\n */\nexport function Tree(props: TreeProps) {\n const [local, rest] = splitProps(props, [\n 'class',\n 'visibleItems',\n 'activeId',\n 'onActiveIdChange',\n 'onExpand',\n 'disclosure',\n 'guides',\n 'onActivate',\n 'onSelectItem',\n 'onRequestReveal',\n 'onRowSizeChange',\n 'selectionMode',\n 'typeaheadLabel',\n 'children',\n ])\n\n const index = createMemo(() => indexTreeItems(local.visibleItems))\n const effectiveActiveId = createMemo(() => {\n const candidate = local.activeId\n const visible = index()\n return candidate !== null && visible.byId.has(candidate) ? candidate : (visible.ids[0] ?? null)\n })\n const idPrefix = `tree-${createUniqueId()}`\n const rows = new Map<string, HTMLDivElement>()\n const rowIdsByElement = new WeakMap<HTMLDivElement, string>()\n let pendingFocusId: string | null = null\n let pendingFocusGuard: ((event: FocusEvent) => void) | undefined\n let requestedRevealId: string | null = null\n let focusedId: string | null = null\n let disposed = false\n const isInsideTreeRow = (element: Element) => {\n const row = element.closest('[role=\"treeitem\"]')\n return row instanceof HTMLDivElement && rowIdsByElement.has(row)\n }\n // True when a focusable control outside this tree owns focus. Nothing focused\n // (`body`) is not outside: that is where focus falls when a focused row is removed.\n const focusIsOutsideTree = () => {\n if (typeof document === 'undefined') return false\n const active = document.activeElement\n return (\n active instanceof Element &&\n active !== document.body &&\n active !== document.documentElement &&\n !isInsideTreeRow(active)\n )\n }\n // Rows are only observed for a host that reads their sizes (a virtualiser); an\n // observer per tree otherwise measures every row on every mount for nothing.\n const rowSizeObserver =\n typeof ResizeObserver === 'undefined' || !local.onRowSizeChange\n ? undefined\n : new ResizeObserver((entries) => {\n if (disposed) return\n for (const entry of entries) {\n const id = rowIdsByElement.get(entry.target as HTMLDivElement)\n const blockSize =\n entry.borderBoxSize[0]?.blockSize ?? (entry.target as HTMLElement).offsetHeight\n if (id !== undefined && Number.isFinite(blockSize) && blockSize > 0)\n local.onRowSizeChange?.(id, blockSize)\n }\n })\n\n // Focus the tree has asked for but not yet moved (a microtask away, or waiting for a\n // virtualised row to mount) is only a request. While one is pending, focus arriving\n // on a control outside the tree withdraws it, so a row mounting later cannot take\n // focus back from a control the user, or the host, has since chosen.\n const setPendingFocus = (id: string | null) => {\n pendingFocusId = id\n if (typeof document === 'undefined') return\n if (id === null) {\n if (pendingFocusGuard) document.removeEventListener('focusin', pendingFocusGuard, true)\n pendingFocusGuard = undefined\n } else if (!pendingFocusGuard) {\n pendingFocusGuard = (event) => {\n if (event.target instanceof Element && !isInsideTreeRow(event.target)) cancelPendingFocus()\n }\n document.addEventListener('focusin', pendingFocusGuard, true)\n }\n }\n // Withdrawing a request also drops the memory of the row it was recovering for:\n // nothing is left to recover.\n const cancelPendingFocus = () => {\n setPendingFocus(null)\n focusedId = null\n }\n\n let typed = ''\n let typedTimer: ReturnType<typeof setTimeout> | undefined\n\n onCleanup(() => {\n disposed = true\n setPendingFocus(null)\n rowSizeObserver?.disconnect()\n clearTimeout(typedTimer)\n })\n\n const requestReveal = (id: string) => {\n if (requestedRevealId === id) return\n requestedRevealId = id\n local.onRequestReveal?.(id)\n }\n\n const focusWhenMounted = (id: string) => {\n queueMicrotask(() => {\n if (pendingFocusId !== id || effectiveActiveId() !== id) return\n const row = rows.get(id)\n if (!row || typeof document === 'undefined') return\n // Ownership is checked when focus would move, not when it was requested: a\n // control outside the tree may have taken focus since, and keeps it.\n if (focusIsOutsideTree()) {\n cancelPendingFocus()\n return\n }\n row.focus()\n if (document.activeElement === row) setPendingFocus(null)\n })\n }\n\n const focusItem = (id: string) => {\n setPendingFocus(id)\n local.onActiveIdChange(id)\n if (rows.has(id)) requestedRevealId = null\n else requestReveal(id)\n focusWhenMounted(id)\n }\n\n const context: TreeContextValue = {\n idPrefix,\n activeId: effectiveActiveId,\n isActive: createSelector(effectiveActiveId),\n index,\n register: (id, element) => {\n rows.set(id, element)\n rowIdsByElement.set(element, id)\n rowSizeObserver?.observe(element)\n if (requestedRevealId === id) requestedRevealId = null\n if (pendingFocusId === id) focusWhenMounted(id)\n },\n unregister: (id, element) => {\n if (rows.get(id) !== element) return\n const focusWasInside =\n !disposed &&\n Boolean(\n element && typeof document !== 'undefined' && element.contains(document.activeElement)\n )\n rows.delete(id)\n if (element) {\n rowIdsByElement.delete(element)\n rowSizeObserver?.unobserve(element)\n }\n if (requestedRevealId === id) requestedRevealId = null\n if (focusWasInside) {\n queueMicrotask(() => {\n const fallbackId = effectiveActiveId()\n if (disposed || fallbackId === null || pendingFocusId === fallbackId) return\n // Focus fell out of the removed row, but it may have been given to a control\n // outside the tree before this ran. Only nothing-focused (body) recovers.\n if (focusIsOutsideTree()) {\n focusedId = null\n return\n }\n focusItem(fallbackId)\n })\n }\n },\n focusItem,\n noteFocus: (id) => {\n focusedId = id\n },\n noteBlur: (next) => {\n // Focus moving to an element outside this tree ends the memory of the last\n // focused row and withdraws any focus the tree was still waiting to give a\n // row. A null target (focus to nothing, or the window losing focus) is\n // ambiguous, so both stay for the recovery below.\n if (next instanceof Element && !isInsideTreeRow(next)) cancelPendingFocus()\n },\n activate: (id, event) => local.onActivate?.(id, event),\n expand: (id, expanded) => local.onExpand?.(id, expanded),\n disclosure: () => local.disclosure ?? 'row',\n guides: () => local.guides ?? false,\n onActiveIdChange: (id) => local.onActiveIdChange(id),\n }\n\n // A filtered, collapsed-away or removed active ID falls back to the first\n // visible item. This keeps one treeitem in the sequential tab order while\n // notifying the host.\n createEffect(() => {\n const activeId = effectiveActiveId()\n if (activeId === null) return\n // If the projection removes the last row that took focus (a host filter, or\n // an ancestor collapsing), move focus to the same fallback that now owns the\n // roving tab stop, unless a control outside the tree has focus: that control\n // keeps it, and only the roving stop moves.\n if (focusedId !== null && !index().byId.has(focusedId) && pendingFocusId !== activeId) {\n if (focusIsOutsideTree()) {\n focusedId = null\n if (local.activeId !== activeId) local.onActiveIdChange(activeId)\n } else {\n focusItem(activeId)\n }\n } else if (local.activeId !== activeId) {\n local.onActiveIdChange(activeId)\n }\n // Preserve the active row in a caller-owned virtual window, including when\n // the pane mounts with its saved active row outside the initial render range.\n if (!rows.has(activeId)) requestReveal(activeId)\n if (pendingFocusId === activeId) focusWhenMounted(activeId)\n })\n\n const typeahead = (event: KeyboardEvent) => {\n const label = local.typeaheadLabel\n if (\n !label ||\n event.ctrlKey ||\n event.metaKey ||\n event.altKey ||\n event.key.length !== 1 ||\n event.key === ' '\n )\n return\n typed += event.key\n clearTimeout(typedTimer)\n typedTimer = setTimeout(() => (typed = ''), 700)\n const { ids, indexById } = index()\n const active = local.activeId === null ? -1 : (indexById.get(local.activeId) ?? -1)\n const target = ids[typeaheadIndex(ids.map(label), active, typed)]\n if (target === undefined) return\n event.preventDefault()\n focusItem(target)\n }\n\n const handleKeyDown: JSX.EventHandler<HTMLDivElement, KeyboardEvent> = (event) => {\n if (event.defaultPrevented || isActionTarget(event.target, event.currentTarget)) return\n\n const action = treeNavigationAction(index(), effectiveActiveId(), event.key)\n if (!action) {\n typeahead(event)\n return\n }\n event.preventDefault()\n\n switch (action.type) {\n case 'focus':\n focusItem(action.id)\n break\n case 'expand':\n local.onExpand?.(action.id, action.expanded)\n break\n case 'activate':\n local.onActivate?.(action.id, event)\n break\n case 'select':\n local.onSelectItem?.(action.id, event)\n break\n }\n }\n\n return (\n <TreeContext.Provider value={context}>\n <div\n {...rest}\n role=\"tree\"\n aria-multiselectable={local.selectionMode === 'multiple' ? 'true' : undefined}\n data-slot=\"tree\"\n class={cn(\n /* A virtualized host remounts rows as it scrolls; scroll anchoring\n would latch onto the focused row and fight the scrollbar. */\n 'flex min-w-0 flex-col [overflow-anchor:none]',\n local.class\n )}\n onKeyDown={handleKeyDown}\n >\n {local.children}\n </div>\n </TreeContext.Provider>\n )\n}\n\nexport type TreeRowProps = Omit<\n ComponentProps<'div'>,\n | 'children'\n | 'role'\n | 'tabIndex'\n | 'onClick'\n | 'onFocus'\n | 'onDoubleClick'\n | 'style'\n | 'aria-level'\n | 'aria-expanded'\n | 'aria-selected'\n | 'aria-posinset'\n | 'aria-setsize'\n> & {\n item: TreeItemDescriptor\n /** Host-owned selection state; omitted for non-selectable trees. */\n selected?: boolean\n leading?: JSX.Element\n trailing?: JSX.Element\n children: JSX.Element\n onDoubleClick?: (id: string, event: MouseEvent & { currentTarget: HTMLDivElement }) => void\n}\n\n/**\n * TreeRow.\n *\n * Keeps the donor's disclosure marker, leading file/folder affordance, primary\n * label and trailing-action hierarchy while replacing the donor's button and\n * runtime callbacks with a shared treeitem and host-owned slots/actions.\n *\n * With `Tree`'s `disclosure=\"marker\"` the chevron of an expandable row is a\n * separate pointer target (`data-slot=\"tree-row-disclosure\"`) that only calls\n * `onExpand`. It is not focusable and has no role: the row remains the single\n * focus stop, Enter and Space still activate and select, and Left/Right still\n * expand and collapse, so the marker adds a pointer path and nothing else.\n * Pressing it does not move focus or the roving stop to its row; if the toggle\n * hides the focused row, `Tree` recovers focus as it does for any collapse (see\n * the `Tree` comment).\n */\nexport function TreeRow(props: TreeRowProps) {\n const tree = useTreeContext()\n const [local, rest] = splitProps(props, [\n 'class',\n 'item',\n 'selected',\n 'leading',\n 'trailing',\n 'children',\n 'onDoubleClick',\n 'ref',\n ])\n\n let row: HTMLDivElement | undefined\n let registeredId: string | undefined\n const id = () => local.item.id\n // Each slot is a JSX getter that builds its subtree per read, so it is read once\n // into a memo. The memo holds the slot as given (not resolved), so the wrapper\n // span renders exactly when it did before: whenever a slot is passed, even one\n // whose content is currently empty, which keeps the row's spacing stable.\n const leading = createMemo(() => local.leading)\n const trailing = createMemo(() => local.trailing)\n\n const handleFocusOut = (event: FocusEvent) => tree.noteBlur(event.relatedTarget)\n\n onCleanup(() => {\n row?.removeEventListener('focusout', handleFocusOut)\n tree.unregister(registeredId ?? id(), row)\n })\n\n const setRef = (element: HTMLDivElement) => {\n row = element\n registeredId = id()\n tree.register(registeredId, element)\n // A listener, not an `onFocusOut` prop, so a host's own handler is untouched.\n element.addEventListener('focusout', handleFocusOut)\n }\n\n createEffect(() => {\n const nextId = id()\n if (!row || registeredId === nextId) return\n if (registeredId !== undefined) tree.unregister(registeredId, row)\n registeredId = nextId\n tree.register(nextId, row)\n })\n\n const handleFocus = () => {\n tree.noteFocus(id())\n if (tree.activeId() !== id()) tree.onActiveIdChange(id())\n }\n\n const handleClick: JSX.EventHandler<HTMLDivElement, MouseEvent> = (event) => {\n if (isActionTarget(event.target, event.currentTarget)) return\n tree.focusItem(id())\n tree.activate(id(), event)\n }\n\n const handleDoubleClick: JSX.EventHandler<HTMLDivElement, MouseEvent> = (event) => {\n if (isActionTarget(event.target, event.currentTarget)) return\n local.onDoubleClick?.(id(), event)\n }\n\n const position = () => tree.index().positionById.get(id())\n // Only an expandable row has a chevron to press; a leaf's marker slot stays\n // part of the row so a click there is an ordinary row click.\n const markerTarget = () => tree.disclosure() === 'marker' && local.item.expandable\n\n const handleMarkerClick: JSX.EventHandler<HTMLSpanElement, MouseEvent> = (event) => {\n // The row's own handler would focus and activate the row.\n event.stopPropagation()\n tree.expand(id(), !local.item.expanded)\n }\n return (\n <div\n {...rest}\n ref={composeRefs(setRef, () => local.ref)}\n id={rest.id ?? `${tree.idPrefix}-item-${encodeURIComponent(id())}`}\n role=\"treeitem\"\n aria-level={local.item.level}\n aria-expanded={local.item.expandable ? (local.item.expanded ? 'true' : 'false') : undefined}\n aria-selected={local.selected === undefined ? undefined : local.selected ? 'true' : 'false'}\n aria-posinset={position()?.position}\n aria-setsize={position()?.setSize}\n tabIndex={tree.isActive(id()) ? 0 : -1}\n data-tree-id={id()}\n data-active={tree.isActive(id()) ? '' : undefined}\n data-selected={local.selected ? '' : undefined}\n data-expanded={local.item.expandable ? String(local.item.expanded) : undefined}\n class={cn(\n 'group/tree-row flex min-h-row-sm w-full min-w-0 items-center gap-1.5 rounded-md pe-1.5 text-left text-sm outline-none transition-colors',\n 'focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-primary-subtle',\n {\n // Guide lines are positioned against the row; without them it keeps its original classes.\n relative: tree.guides(),\n 'bg-primary-subtle text-foreground': local.selected,\n 'hover:bg-surface-hover': !local.selected,\n },\n local.class\n )}\n style={{ 'padding-inline-start': `${rowInset(local.item.level)}px` }}\n onFocus={handleFocus}\n onClick={handleClick}\n onDblClick={handleDoubleClick}\n >\n <Show when={tree.guides() && local.item.level > 1}>\n <For each={Array.from({ length: local.item.level - 1 }, (_, index) => index)}>\n {(index) => (\n <span\n aria-hidden=\"true\"\n data-slot=\"tree-row-guide\"\n class=\"pointer-events-none absolute inset-y-0 w-px bg-border\"\n style={{ 'inset-inline-start': `${rowInset(index + 1) + GUIDE_CENTER}px` }}\n />\n )}\n </For>\n </Show>\n <span\n data-slot={markerTarget() ? 'tree-row-disclosure' : undefined}\n class={cn(\n 'flex',\n !markerTarget() && 'size-3.5',\n 'shrink-0 items-center justify-center text-muted-foreground',\n /* The glyph stays 14px wide but the target is not: it takes the row's full\n height (a flex child's `self-stretch`, so it follows row density and a\n tall trailing control) and the pseudo-element widens it to 26px, which\n stops at the row's own padding and gap, never over the icon or label. */\n markerTarget() &&\n 'relative w-3.5 cursor-pointer self-stretch hover:text-foreground after:absolute after:inset-y-0 after:-inset-x-1.5'\n )}\n onMouseDown={markerTarget() ? handleMarkerMouseDown : undefined}\n onClick={markerTarget() ? handleMarkerClick : undefined}\n onDblClick={markerTarget() ? handleMarkerDoubleClick : undefined}\n >\n {local.item.expandable ? (\n <ChevronRight\n aria-hidden=\"true\"\n class={cn('size-3.5 transition-transform', local.item.expanded && 'rotate-90')}\n />\n ) : null}\n </span>\n <Show when={leading()}>\n {(slot) => (\n <span class=\"flex size-4 shrink-0 items-center justify-center [&_svg]:size-4\">\n {slot()}\n </span>\n )}\n </Show>\n <span class=\"min-w-0 flex-1 truncate\">{local.children}</span>\n <Show when={trailing()}>\n {(slot) => (\n <span class=\"ms-auto flex shrink-0 items-center gap-1 text-muted-foreground\">\n {slot()}\n </span>\n )}\n </Show>\n </div>\n )\n}\n\n/**\n * TreeRowActions.\n *\n * Row-level commands (rename, copy, delete) that stay out of the way until the\n * row is hovered or holds focus, so a long tree reads as names rather than a\n * wall of buttons. Put it in `TreeRow`'s `trailing` slot beside any status that\n * must stay visible. `pinned` keeps the actions shown, e.g. while a destructive\n * action waits for its confirming second press.\n */\nexport function TreeRowActions(props: ComponentProps<'span'> & { pinned?: boolean }) {\n const [local, rest] = splitProps(props, ['class', 'pinned'])\n return (\n <span\n data-slot=\"tree-row-actions\"\n data-pinned={local.pinned ? '' : undefined}\n class={cn(\n 'flex shrink-0 items-center gap-1 opacity-0 transition-opacity ease-out',\n 'group-hover/tree-row:opacity-100 group-focus-within/tree-row:opacity-100 data-pinned:opacity-100',\n local.class\n )}\n {...rest}\n />\n )\n}\n\n// Pressing the chevron must not move focus to its row: a mousedown on a\n// non-focusable child would otherwise focus the row, making it the roving stop\n// (and notifying `onActiveIdChange`) for what is a disclosure toggle, not a\n// selection. The press itself leaves focus where it was, so Left/Right keep\n// acting on the row the keyboard user left off at. It cannot stop the toggle\n// from hiding that row; `Tree` then recovers focus onto the first visible row.\nconst handleMarkerMouseDown: JSX.EventHandler<HTMLSpanElement, MouseEvent> = (event) =>\n event.preventDefault()\n// A double-click is two toggles; it must not also reach `onDoubleClick`\n// (rename, open) as though the row itself had been double-clicked.\nconst handleMarkerDoubleClick: JSX.EventHandler<HTMLSpanElement, MouseEvent> = (event) =>\n event.stopPropagation()\n\n/** The inline-start padding of a row at a one-based `level`, in px. */\nfunction rowInset(level: number): number {\n return 6 + Math.max(0, level - 1) * 12\n}\n/** Half the 14px chevron: a level's guide line runs down the middle of its parent's chevron. */\nconst GUIDE_CENTER = 7\n\nfunction isActionTarget(target: EventTarget | null, currentTarget: HTMLElement): boolean {\n if (!(target instanceof Element) || target === currentTarget) return false\n return Boolean(\n target.closest(\n 'a, button, input, textarea, select, [contenteditable=\"true\"], [role=\"button\"], [data-tree-keyboard-stop]'\n )\n )\n}\n\nfunction composeRefs(\n internal: (element: HTMLDivElement) => void,\n external: () => ComponentProps<'div'>['ref']\n): (element: HTMLDivElement) => void {\n return (element) => {\n internal(element)\n const ref = external()\n if (typeof ref === 'function') ref(element)\n }\n}\n\nexport type { TreeItemDescriptor } from './tree-navigation'\n"],"mappings":";;;;;;;;;;;;AAyCA,IAAMmC,cAAclC,cAAgC;AAEpD,SAASmC,iBAAiB;CACxB,MAAMC,OAAO3B,WAAWyB,WAAW;CACnC,IAAI,CAACE,MAAM,MAAM,IAAIC,MAAM,8CAA8C;CACzE,OAAOD;AACT;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkGA,SAAgBa,KAAKC,OAAkB;CACrC,MAAM,CAACC,OAAOC,QAAQ5C,WAAW0C,OAAO;EACtC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CAAU,CACX;CAED,MAAMhC,QAAQhB,iBAAiBS,eAAewC,MAAMb,YAAY,CAAC;CACjE,MAAMe,oBAAoBnD,iBAAiB;EACzC,MAAMoD,YAAYH,MAAMpC;EACxB,MAAMwC,UAAUrC,MAAM;EACtB,OAAOoC,cAAc,QAAQC,QAAQC,KAAKC,IAAIH,SAAS,IAAIA,YAAaC,QAAQG,IAAI,MAAM;CAC5F,CAAC;CACD,MAAM5C,WAAW,QAAQV,eAAe;CACxC,MAAMuD,uBAAO,IAAIC,IAA4B;CAC7C,MAAMC,kCAAkB,IAAIC,QAAgC;CAC5D,IAAIC,iBAAgC;CACpC,IAAIC;CACJ,IAAIC,oBAAmC;CACvC,IAAIC,YAA2B;CAC/B,IAAIC,WAAW;CACf,MAAMC,mBAAmBhD,YAAqB;EAC5C,MAAMiD,MAAMjD,QAAQkD,QAAQ,qBAAmB;EAC/C,OAAOD,eAAehD,kBAAkBwC,gBAAgBJ,IAAIY,GAAG;CACjE;CAGA,MAAME,2BAA2B;EAC/B,IAAI,OAAOC,aAAa,aAAa,OAAO;EAC5C,MAAMC,SAASD,SAASE;EACxB,OACED,kBAAkBzB,WAClByB,WAAWD,SAASG,QACpBF,WA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I,MAAM6C,SAAS;EACrB,IAAI,OAAO7C,QAAQ,YAAYA,IAAI/I,OAAO;CAC5C;AACF;AAE2D6L,eAAA;CAAA;CAAA;CAAA;AAAA,CAAA"}
1
+ {"version":3,"file":"tree.js","names":["ChevronRight","LucideChevronRight","createContext","createEffect","createMemo","createSelector","createUniqueId","For","onCleanup","Show","splitProps","useContext","cn","indexTreeItems","treeNavigationAction","typeaheadIndex","fastIcon","idPrefix","activeId","isActive","id","index","register","element","HTMLDivElement","unregister","focusItem","noteFocus","noteBlur","next","activate","event","expand","expanded","disclosure","guides","onActiveIdChange","TreeContext","useTreeContext","tree","Error","visibleItems","onExpand","onActivate","onSelectItem","onRequestReveal","onRowSizeChange","blockSize","selectionMode","typeaheadLabel","children","Element","Tree","props","local","rest","effectiveActiveId","candidate","visible","byId","has","ids","rows","Map","rowIdsByElement","WeakMap","pendingFocusId","pendingFocusGuard","requestedRevealId","focusedId","disposed","isInsideTreeRow","row","closest","focusIsOutsideTree","document","active","activeElement","body","documentElement","rowSizeObserver","ResizeObserver","undefined","entries","entry","get","target","borderBoxSize","offsetHeight","Number","isFinite","setPendingFocus","removeEventListener","cancelPendingFocus","addEventListener","typed","typedTimer","setTimeout","disconnect","clearTimeout","requestReveal","focusWhenMounted","queueMicrotask","focus","context","set","observe","focusWasInside","Boolean","contains","delete","unobserve","fallbackId","typeahead","label","ctrlKey","metaKey","altKey","key","length","indexById","map","preventDefault","handleKeyDown","defaultPrevented","isActionTarget","currentTarget","action","type","_$createComponent","Provider","value","_el$","_tmpl$","_$spread","_$mergeProps","class","_$insert","item","selected","leading","trailing","onDoubleClick","TreeRow","registeredId","handleFocusOut","relatedTarget","setRef","nextId","handleFocus","handleClick","handleDoubleClick","position","positionById","markerTarget","expandable","handleMarkerClick","stopPropagation","_el$2","_tmpl$2","_el$3","firstChild","_el$4","nextSibling","_ref$","composeRefs","ref","_$use","encodeURIComponent","level","_$memo","setSize","tabIndex","String","relative","style","rowInset","when","each","Array","from","_","_el$5","_tmpl$3","_$effect","_$p","_$setStyleProperty","GUIDE_CENTER","_$addEventListener","handleMarkerDoubleClick","handleMarkerMouseDown","_c$","slot","_el$6","_tmpl$4","_el$7","_tmpl$5","_p$","_v$","_v$2","e","_$setAttribute","t","_$className","TreeRowActions","pinned","_el$8","_tmpl$6","Math","max","internal","external","_$delegateEvents"],"sources":["../../../../src/components/composites/tree/tree.tsx"],"sourcesContent":["import type { ComponentProps, JSX } from 'solid-js'\nimport { ChevronRight as LucideChevronRight } from 'lucide-solid'\nimport {\n createContext,\n createEffect,\n createMemo,\n createSelector,\n createUniqueId,\n For,\n onCleanup,\n Show,\n splitProps,\n useContext,\n} from 'solid-js'\nimport { cn } from '#lib/utils'\nimport {\n indexTreeItems,\n treeNavigationAction,\n typeaheadIndex,\n type TreeItemDescriptor,\n type TreeNavigationIndex,\n} from './tree-navigation'\nimport { fastIcon } from '#lib/fast-icon'\n\n// lucide icons drawn from a cloned template (see fastIcon).\nconst ChevronRight = fastIcon(LucideChevronRight)\n\ntype TreeContextValue = {\n idPrefix: string\n activeId: () => string | null\n /** O(1) per change: only the rows whose answer flips re-run, not every row. */\n isActive: (id: string) => boolean\n index: () => TreeNavigationIndex\n register: (id: string, element: HTMLDivElement) => void\n unregister: (id: string, element: HTMLDivElement | undefined) => void\n focusItem: (id: string) => void\n noteFocus: (id: string) => void\n noteBlur: (next: EventTarget | null) => void\n activate: (id: string, event: Event) => void\n expand: (id: string, expanded: boolean) => void\n disclosure: () => TreeDisclosure\n guides: () => boolean\n onActiveIdChange: (id: string) => void\n}\n\nconst TreeContext = createContext<TreeContextValue>()\n\nfunction useTreeContext() {\n const tree = useContext(TreeContext)\n if (!tree) throw new Error('[adea-ui]: TreeRow must be used inside Tree.')\n return tree\n}\n\n/**\n * Who owns the pointer on a row's disclosure chevron.\n *\n * - `row` (default): the chevron is decoration; a click anywhere on the row,\n * chevron included, is a row activation. This is the file-explorer\n * convention, where the host's `onActivate` toggles a folder.\n * - `marker`: the chevron of an expandable row is its own pointer target. It\n * calls `onExpand(id, !expanded)` and nothing else; the rest of the row still\n * activates. For trees where expanding and selecting are independent (a\n * source list that selects a source and separately reveals its details).\n */\nexport type TreeDisclosure = 'row' | 'marker'\n\ntype TreeAccessibleName =\n | { 'aria-label': string; 'aria-labelledby'?: string }\n | { 'aria-label'?: string; 'aria-labelledby': string }\n\nexport type TreeProps = Omit<\n ComponentProps<'div'>,\n 'children' | 'role' | 'tabIndex' | 'onKeyDown' | 'aria-label' | 'aria-labelledby'\n> &\n TreeAccessibleName & {\n /** Complete, ordered projection of currently visible (expanded) items. */\n visibleItems: readonly TreeItemDescriptor[]\n /** The host-owned identity of the row that currently owns roving focus. */\n activeId: string | null\n /**\n * Called when keyboard or pointer navigation changes the active row, and when\n * the active row leaves `visibleItems` (collapsed away, filtered out) and the\n * first visible row takes over as the roving stop.\n */\n onActiveIdChange: (id: string) => void\n /** Called for Left/Right expand and collapse requests. */\n onExpand?: (id: string, expanded: boolean) => void\n /**\n * Opt-in pointer behaviour of the disclosure chevron; see {@link TreeDisclosure}.\n * Keyboard behaviour is identical in both modes: Left/Right expand and collapse.\n */\n disclosure?: TreeDisclosure\n /**\n * Draw a vertical guide line down each ancestor level of a nested row, so a\n * group of children reads as belonging to its parent. Off by default: a flat\n * list or a dense file explorer carries its own rhythm.\n */\n guides?: boolean\n /** Called for Enter or pointer activation. Domain action stays host-owned. */\n onActivate?: (id: string, event: Event) => void\n /** Called for Space selection. Selection state stays host-owned. */\n onSelectItem?: (id: string, event: Event) => void\n /** Ask the host window to mount/reveal an item before focus moves to it. */\n onRequestReveal?: (id: string) => void\n /** Report a mounted row's border-box block size in CSS pixels for host range math. */\n onRowSizeChange?: (id: string, blockSize: number) => void\n /** Declares a multi-select tree to assistive technology. */\n selectionMode?: 'single' | 'multiple'\n /**\n * The text a row is found by when the reader types its first letters. Supply\n * it to turn on typeahead: a typed prefix moves focus to the next visible row\n * whose label starts with it, revealing an unmounted row first.\n */\n typeaheadLabel?: (id: string) => string\n children?: JSX.Element\n }\n\n/**\n * Tree.\n *\n * Supplies semantic and keyboard behavior for a tree whose host owns the\n * visible projection, filesystem state, row window and domain actions. The\n * mounted children can be a small virtualized window; `visibleItems` remains\n * the complete ordered projection so keyboard movement and sibling positions\n * do not depend on which rows currently exist in the DOM.\n *\n * Kobalte 0.13.14 has no Tree primitive, so this component implements the\n * WAI-ARIA tree row navigation contract and leaves product state to callbacks.\n *\n * By default the disclosure chevron is decoration and a click anywhere on a\n * row activates it, so a file explorer can toggle a folder from `onActivate`.\n * Reach for `disclosure=\"marker\"` when expanding and selecting are separate\n * decisions: the chevron then calls only `onExpand`, and the rest of the row\n * calls only `onActivate`. The chevron stays `aria-hidden` and out of the tab\n * order in both modes; keyboard expansion is Left/Right either way.\n *\n * Collapsing is the one thing that can move focus without a key or a click on\n * the target row: when the active row leaves `visibleItems`, the first visible\n * row becomes the roving stop and `onActiveIdChange` is called with it. If the\n * removed row held focus, or was the last row the tree saw focused, focus moves\n * to that same row; if it had no focus, only the roving stop moves. Focus that\n * has already gone to a control outside the tree is never pulled back: the tree\n * forgets its last focused row when focus moves to an element outside it, and\n * the roving stop alone moves if that control still has focus when the row is\n * hidden. Focus the tree has asked for but not yet moved (a queued recovery, or a\n * keyboard move to a row the host has not mounted) is withdrawn when focus lands\n * outside the tree, and is checked again when a row mounts. This is the same in\n * both `disclosure` modes and for every way a host collapses a row.\n */\nexport function Tree(props: TreeProps) {\n const [local, rest] = splitProps(props, [\n 'class',\n 'visibleItems',\n 'activeId',\n 'onActiveIdChange',\n 'onExpand',\n 'disclosure',\n 'guides',\n 'onActivate',\n 'onSelectItem',\n 'onRequestReveal',\n 'onRowSizeChange',\n 'selectionMode',\n 'typeaheadLabel',\n 'children',\n ])\n\n const index = createMemo(() => indexTreeItems(local.visibleItems))\n const effectiveActiveId = createMemo(() => {\n const candidate = local.activeId\n const visible = index()\n return candidate !== null && visible.byId.has(candidate) ? candidate : (visible.ids[0] ?? null)\n })\n const idPrefix = `tree-${createUniqueId()}`\n const rows = new Map<string, HTMLDivElement>()\n const rowIdsByElement = new WeakMap<HTMLDivElement, string>()\n let pendingFocusId: string | null = null\n let pendingFocusGuard: ((event: FocusEvent) => void) | undefined\n let requestedRevealId: string | null = null\n let focusedId: string | null = null\n let disposed = false\n const isInsideTreeRow = (element: Element) => {\n const row = element.closest('[role=\"treeitem\"]')\n return row instanceof HTMLDivElement && rowIdsByElement.has(row)\n }\n // True when a focusable control outside this tree owns focus. Nothing focused\n // (`body`) is not outside: that is where focus falls when a focused row is removed.\n const focusIsOutsideTree = () => {\n if (typeof document === 'undefined') return false\n const active = document.activeElement\n return (\n active instanceof Element &&\n active !== document.body &&\n active !== document.documentElement &&\n !isInsideTreeRow(active)\n )\n }\n // Rows are only observed for a host that reads their sizes (a virtualiser); an\n // observer per tree otherwise measures every row on every mount for nothing.\n const rowSizeObserver =\n typeof ResizeObserver === 'undefined' || !local.onRowSizeChange\n ? undefined\n : new ResizeObserver((entries) => {\n if (disposed) return\n for (const entry of entries) {\n const id = rowIdsByElement.get(entry.target as HTMLDivElement)\n const blockSize =\n entry.borderBoxSize[0]?.blockSize ?? (entry.target as HTMLElement).offsetHeight\n if (id !== undefined && Number.isFinite(blockSize) && blockSize > 0)\n local.onRowSizeChange?.(id, blockSize)\n }\n })\n\n // Focus the tree has asked for but not yet moved (a microtask away, or waiting for a\n // virtualised row to mount) is only a request. While one is pending, focus arriving\n // on a control outside the tree withdraws it, so a row mounting later cannot take\n // focus back from a control the user, or the host, has since chosen.\n const setPendingFocus = (id: string | null) => {\n pendingFocusId = id\n if (typeof document === 'undefined') return\n if (id === null) {\n if (pendingFocusGuard) document.removeEventListener('focusin', pendingFocusGuard, true)\n pendingFocusGuard = undefined\n } else if (!pendingFocusGuard) {\n pendingFocusGuard = (event) => {\n if (event.target instanceof Element && !isInsideTreeRow(event.target)) cancelPendingFocus()\n }\n document.addEventListener('focusin', pendingFocusGuard, true)\n }\n }\n // Withdrawing a request also drops the memory of the row it was recovering for:\n // nothing is left to recover.\n const cancelPendingFocus = () => {\n setPendingFocus(null)\n focusedId = null\n }\n\n let typed = ''\n let typedTimer: ReturnType<typeof setTimeout> | undefined\n\n onCleanup(() => {\n disposed = true\n setPendingFocus(null)\n rowSizeObserver?.disconnect()\n clearTimeout(typedTimer)\n })\n\n const requestReveal = (id: string) => {\n if (requestedRevealId === id) return\n requestedRevealId = id\n local.onRequestReveal?.(id)\n }\n\n const focusWhenMounted = (id: string) => {\n queueMicrotask(() => {\n if (pendingFocusId !== id || effectiveActiveId() !== id) return\n const row = rows.get(id)\n if (!row || typeof document === 'undefined') return\n // Ownership is checked when focus would move, not when it was requested: a\n // control outside the tree may have taken focus since, and keeps it.\n if (focusIsOutsideTree()) {\n cancelPendingFocus()\n return\n }\n row.focus()\n if (document.activeElement === row) setPendingFocus(null)\n })\n }\n\n const focusItem = (id: string) => {\n setPendingFocus(id)\n local.onActiveIdChange(id)\n if (rows.has(id)) requestedRevealId = null\n else requestReveal(id)\n focusWhenMounted(id)\n }\n\n const context: TreeContextValue = {\n idPrefix,\n activeId: effectiveActiveId,\n isActive: createSelector(effectiveActiveId),\n index,\n register: (id, element) => {\n rows.set(id, element)\n rowIdsByElement.set(element, id)\n rowSizeObserver?.observe(element)\n if (requestedRevealId === id) requestedRevealId = null\n if (pendingFocusId === id) focusWhenMounted(id)\n },\n unregister: (id, element) => {\n if (rows.get(id) !== element) return\n const focusWasInside =\n !disposed &&\n Boolean(\n element && typeof document !== 'undefined' && element.contains(document.activeElement)\n )\n rows.delete(id)\n if (element) {\n rowIdsByElement.delete(element)\n rowSizeObserver?.unobserve(element)\n }\n if (requestedRevealId === id) requestedRevealId = null\n if (focusWasInside) {\n queueMicrotask(() => {\n const fallbackId = effectiveActiveId()\n if (disposed || fallbackId === null || pendingFocusId === fallbackId) return\n // Focus fell out of the removed row, but it may have been given to a control\n // outside the tree before this ran. Only nothing-focused (body) recovers.\n if (focusIsOutsideTree()) {\n focusedId = null\n return\n }\n focusItem(fallbackId)\n })\n }\n },\n focusItem,\n noteFocus: (id) => {\n focusedId = id\n },\n noteBlur: (next) => {\n // Focus moving to an element outside this tree ends the memory of the last\n // focused row and withdraws any focus the tree was still waiting to give a\n // row. A null target (focus to nothing, or the window losing focus) is\n // ambiguous, so both stay for the recovery below.\n if (next instanceof Element && !isInsideTreeRow(next)) cancelPendingFocus()\n },\n activate: (id, event) => local.onActivate?.(id, event),\n expand: (id, expanded) => local.onExpand?.(id, expanded),\n disclosure: () => local.disclosure ?? 'row',\n guides: () => local.guides ?? false,\n onActiveIdChange: (id) => local.onActiveIdChange(id),\n }\n\n // A filtered, collapsed-away or removed active ID falls back to the first\n // visible item. This keeps one treeitem in the sequential tab order while\n // notifying the host.\n createEffect(() => {\n const activeId = effectiveActiveId()\n if (activeId === null) return\n // If the projection removes the last row that took focus (a host filter, or\n // an ancestor collapsing), move focus to the same fallback that now owns the\n // roving tab stop, unless a control outside the tree has focus: that control\n // keeps it, and only the roving stop moves.\n if (focusedId !== null && !index().byId.has(focusedId) && pendingFocusId !== activeId) {\n if (focusIsOutsideTree()) {\n focusedId = null\n if (local.activeId !== activeId) local.onActiveIdChange(activeId)\n } else {\n focusItem(activeId)\n }\n } else if (local.activeId !== activeId) {\n local.onActiveIdChange(activeId)\n }\n // Preserve the active row in a caller-owned virtual window, including when\n // the pane mounts with its saved active row outside the initial render range.\n if (!rows.has(activeId)) requestReveal(activeId)\n if (pendingFocusId === activeId) focusWhenMounted(activeId)\n })\n\n const typeahead = (event: KeyboardEvent) => {\n const label = local.typeaheadLabel\n if (\n !label ||\n event.ctrlKey ||\n event.metaKey ||\n event.altKey ||\n event.key.length !== 1 ||\n event.key === ' '\n )\n return\n typed += event.key\n clearTimeout(typedTimer)\n typedTimer = setTimeout(() => (typed = ''), 700)\n const { ids, indexById } = index()\n const active = local.activeId === null ? -1 : (indexById.get(local.activeId) ?? -1)\n const target = ids[typeaheadIndex(ids.map(label), active, typed)]\n if (target === undefined) return\n event.preventDefault()\n focusItem(target)\n }\n\n const handleKeyDown: JSX.EventHandler<HTMLDivElement, KeyboardEvent> = (event) => {\n if (event.defaultPrevented || isActionTarget(event.target, event.currentTarget)) return\n\n const action = treeNavigationAction(index(), effectiveActiveId(), event.key)\n if (!action) {\n typeahead(event)\n return\n }\n event.preventDefault()\n\n switch (action.type) {\n case 'focus':\n focusItem(action.id)\n break\n case 'expand':\n local.onExpand?.(action.id, action.expanded)\n break\n case 'activate':\n local.onActivate?.(action.id, event)\n break\n case 'select':\n local.onSelectItem?.(action.id, event)\n break\n }\n }\n\n return (\n <TreeContext.Provider value={context}>\n <div\n {...rest}\n role=\"tree\"\n aria-multiselectable={local.selectionMode === 'multiple' ? 'true' : undefined}\n data-slot=\"tree\"\n class={cn(\n /* A virtualized host remounts rows as it scrolls; scroll anchoring\n would latch onto the focused row and fight the scrollbar. */\n 'flex min-w-0 flex-col [overflow-anchor:none]',\n local.class\n )}\n onKeyDown={handleKeyDown}\n >\n {local.children}\n </div>\n </TreeContext.Provider>\n )\n}\n\nexport type TreeRowProps = Omit<\n ComponentProps<'div'>,\n | 'children'\n | 'role'\n | 'tabIndex'\n | 'onClick'\n | 'onFocus'\n | 'onDoubleClick'\n | 'style'\n | 'aria-level'\n | 'aria-expanded'\n | 'aria-selected'\n | 'aria-posinset'\n | 'aria-setsize'\n> & {\n item: TreeItemDescriptor\n /** Host-owned selection state; omitted for non-selectable trees. */\n selected?: boolean\n leading?: JSX.Element\n trailing?: JSX.Element\n children: JSX.Element\n onDoubleClick?: (id: string, event: MouseEvent & { currentTarget: HTMLDivElement }) => void\n}\n\n/**\n * TreeRow.\n *\n * Keeps the donor's disclosure marker, leading file/folder affordance, primary\n * label and trailing-action hierarchy while replacing the donor's button and\n * runtime callbacks with a shared treeitem and host-owned slots/actions.\n *\n * With `Tree`'s `disclosure=\"marker\"` the chevron of an expandable row is a\n * separate pointer target (`data-slot=\"tree-row-disclosure\"`) that only calls\n * `onExpand`. It is not focusable and has no role: the row remains the single\n * focus stop, Enter and Space still activate and select, and Left/Right still\n * expand and collapse, so the marker adds a pointer path and nothing else.\n * Pressing it does not move focus or the roving stop to its row; if the toggle\n * hides the focused row, `Tree` recovers focus as it does for any collapse (see\n * the `Tree` comment).\n */\nexport function TreeRow(props: TreeRowProps) {\n const tree = useTreeContext()\n const [local, rest] = splitProps(props, [\n 'class',\n 'item',\n 'selected',\n 'leading',\n 'trailing',\n 'children',\n 'onDoubleClick',\n 'ref',\n ])\n\n let row: HTMLDivElement | undefined\n let registeredId: string | undefined\n const id = () => local.item.id\n // Each slot is a JSX getter that builds its subtree per read, so it is read once\n // into a memo. The memo holds the slot as given (not resolved), so the wrapper\n // span renders exactly when it did before: whenever a slot is passed, even one\n // whose content is currently empty, which keeps the row's spacing stable.\n const leading = createMemo(() => local.leading)\n const trailing = createMemo(() => local.trailing)\n\n const handleFocusOut = (event: FocusEvent) => tree.noteBlur(event.relatedTarget)\n\n onCleanup(() => {\n row?.removeEventListener('focusout', handleFocusOut)\n tree.unregister(registeredId ?? id(), row)\n })\n\n const setRef = (element: HTMLDivElement) => {\n row = element\n registeredId = id()\n tree.register(registeredId, element)\n // A listener, not an `onFocusOut` prop, so a host's own handler is untouched.\n element.addEventListener('focusout', handleFocusOut)\n }\n\n createEffect(() => {\n const nextId = id()\n if (!row || registeredId === nextId) return\n if (registeredId !== undefined) tree.unregister(registeredId, row)\n registeredId = nextId\n tree.register(nextId, row)\n })\n\n const handleFocus = () => {\n tree.noteFocus(id())\n if (tree.activeId() !== id()) tree.onActiveIdChange(id())\n }\n\n const handleClick: JSX.EventHandler<HTMLDivElement, MouseEvent> = (event) => {\n if (isActionTarget(event.target, event.currentTarget)) return\n tree.focusItem(id())\n tree.activate(id(), event)\n }\n\n const handleDoubleClick: JSX.EventHandler<HTMLDivElement, MouseEvent> = (event) => {\n if (isActionTarget(event.target, event.currentTarget)) return\n local.onDoubleClick?.(id(), event)\n }\n\n const position = () => tree.index().positionById.get(id())\n // Only an expandable row has a chevron to press; a leaf's marker slot stays\n // part of the row so a click there is an ordinary row click.\n const markerTarget = () => tree.disclosure() === 'marker' && local.item.expandable\n\n const handleMarkerClick: JSX.EventHandler<HTMLSpanElement, MouseEvent> = (event) => {\n // The row's own handler would focus and activate the row.\n event.stopPropagation()\n tree.expand(id(), !local.item.expanded)\n }\n return (\n <div\n {...rest}\n ref={composeRefs(setRef, () => local.ref)}\n id={rest.id ?? `${tree.idPrefix}-item-${encodeURIComponent(id())}`}\n role=\"treeitem\"\n aria-level={local.item.level}\n aria-expanded={local.item.expandable ? (local.item.expanded ? 'true' : 'false') : undefined}\n aria-selected={local.selected === undefined ? undefined : local.selected ? 'true' : 'false'}\n aria-posinset={position()?.position}\n aria-setsize={position()?.setSize}\n tabIndex={tree.isActive(id()) ? 0 : -1}\n data-tree-id={id()}\n data-active={tree.isActive(id()) ? '' : undefined}\n data-selected={local.selected ? '' : undefined}\n data-expanded={local.item.expandable ? String(local.item.expanded) : undefined}\n class={cn(\n 'group/tree-row flex min-h-row-sm w-full min-w-0 items-center gap-1.5 rounded-md pe-1.5 text-left text-sm outline-none transition-colors',\n 'focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-primary-subtle',\n {\n // Guide lines are positioned against the row; without them it keeps its original classes.\n relative: tree.guides(),\n 'bg-primary-subtle text-foreground': local.selected,\n 'hover:bg-surface-hover': !local.selected,\n },\n local.class\n )}\n style={{ 'padding-inline-start': `${rowInset(local.item.level)}px` }}\n onFocus={handleFocus}\n onClick={handleClick}\n onDblClick={handleDoubleClick}\n >\n <Show when={tree.guides() && local.item.level > 1}>\n <For each={Array.from({ length: local.item.level - 1 }, (_, index) => index)}>\n {(index) => (\n <span\n aria-hidden=\"true\"\n data-slot=\"tree-row-guide\"\n class=\"pointer-events-none absolute inset-y-0 w-px bg-border\"\n style={{ 'inset-inline-start': `${rowInset(index + 1) + GUIDE_CENTER}px` }}\n />\n )}\n </For>\n </Show>\n <span\n data-slot={markerTarget() ? 'tree-row-disclosure' : undefined}\n class={cn(\n 'flex',\n !markerTarget() && 'size-3.5',\n 'shrink-0 items-center justify-center text-muted-foreground',\n /* The glyph stays 14px wide but the target is not: it takes the row's full\n height (a flex child's `self-stretch`, so it follows row density and a\n tall trailing control) and the pseudo-element widens it to 26px, which\n stops at the row's own padding and gap, never over the icon or label. */\n markerTarget() &&\n 'relative w-3.5 cursor-pointer self-stretch hover:text-foreground after:absolute after:inset-y-0 after:-inset-x-1.5'\n )}\n onMouseDown={markerTarget() ? handleMarkerMouseDown : undefined}\n onClick={markerTarget() ? handleMarkerClick : undefined}\n onDblClick={markerTarget() ? handleMarkerDoubleClick : undefined}\n >\n {local.item.expandable ? (\n <ChevronRight\n aria-hidden=\"true\"\n class={cn('size-3.5 transition-transform', local.item.expanded && 'rotate-90')}\n />\n ) : null}\n </span>\n <Show when={leading()}>\n {(slot) => (\n <span class=\"flex size-4 shrink-0 items-center justify-center [&_svg]:size-4\">\n {slot()}\n </span>\n )}\n </Show>\n <span class=\"min-w-0 flex-1 truncate\">{local.children}</span>\n <Show when={trailing()}>\n {(slot) => (\n <span class=\"ms-auto flex shrink-0 items-center gap-1 text-muted-foreground\">\n {slot()}\n </span>\n )}\n </Show>\n </div>\n )\n}\n\n/**\n * TreeRowActions.\n *\n * Row-level commands (rename, copy, delete) that stay out of the way until the\n * row is hovered or holds focus, so a long tree reads as names rather than a\n * wall of buttons. Put it in `TreeRow`'s `trailing` slot beside any status that\n * must stay visible. `pinned` keeps the actions shown, e.g. while a destructive\n * action waits for its confirming second press.\n */\nexport function TreeRowActions(props: ComponentProps<'span'> & { pinned?: boolean }) {\n const [local, rest] = splitProps(props, ['class', 'pinned'])\n return (\n <span\n data-slot=\"tree-row-actions\"\n data-pinned={local.pinned ? '' : undefined}\n class={cn(\n 'flex shrink-0 items-center gap-1 opacity-0 transition-opacity ease-out',\n 'group-hover/tree-row:opacity-100 group-focus-within/tree-row:opacity-100 data-pinned:opacity-100',\n local.class\n )}\n {...rest}\n />\n )\n}\n\n// Pressing the chevron must not move focus to its row: a mousedown on a\n// non-focusable child would otherwise focus the row, making it the roving stop\n// (and notifying `onActiveIdChange`) for what is a disclosure toggle, not a\n// selection. The press itself leaves focus where it was, so Left/Right keep\n// acting on the row the keyboard user left off at. It cannot stop the toggle\n// from hiding that row; `Tree` then recovers focus onto the first visible row.\nconst handleMarkerMouseDown: JSX.EventHandler<HTMLSpanElement, MouseEvent> = (event) =>\n event.preventDefault()\n// A double-click is two toggles; it must not also reach `onDoubleClick`\n// (rename, open) as though the row itself had been double-clicked.\nconst handleMarkerDoubleClick: JSX.EventHandler<HTMLSpanElement, MouseEvent> = (event) =>\n event.stopPropagation()\n\n/** The inline-start padding of a row at a one-based `level`, in px. */\nfunction rowInset(level: number): number {\n return 6 + Math.max(0, level - 1) * 12\n}\n/** Half the 14px chevron: a level's guide line runs down the middle of its parent's chevron. */\nconst GUIDE_CENTER = 7\n\nfunction isActionTarget(target: EventTarget | null, currentTarget: HTMLElement): boolean {\n if (!(target instanceof Element) || target === currentTarget) return false\n return Boolean(\n target.closest(\n 'a, button, input, textarea, select, [contenteditable=\"true\"], [role=\"button\"], [data-tree-keyboard-stop]'\n )\n )\n}\n\nfunction composeRefs(\n internal: (element: HTMLDivElement) => void,\n external: () => ComponentProps<'div'>['ref']\n): (element: HTMLDivElement) => void {\n return (element) => {\n internal(element)\n const ref = external()\n if (typeof ref === 'function') ref(element)\n }\n}\n\nexport type { TreeItemDescriptor } from './tree-navigation'\n"],"mappings":";;;;;;;;;;;;;AAyBA,IAAMA,iBAAegB,SAASf,YAAkB;AAoBhD,IAAMoC,cAAcnC,cAAgC;AAEpD,SAASoC,iBAAiB;CACxB,MAAMC,OAAO5B,WAAW0B,WAAW;CACnC,IAAI,CAACE,MAAM,MAAM,IAAIC,MAAM,8CAA8C;CACzE,OAAOD;AACT;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkGA,SAAgBa,KAAKC,OAAkB;CACrC,MAAM,CAACC,OAAOC,QAAQ7C,WAAW2C,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CACnF,MAAM,CAACC,OAAOC,QAAQ7C,WAAW2C,OAAO,CAAC,SAAS,QAAQ,CAAC;CAC3D,cAAA;EAAA,IAAAyJ,QAAAC,QAAA;EAAAzE,OAAAwE,OAAAvE,WAAA;GAAA,KAAA,iBAAA;IAAA,OAGiBjF,MAAMuJ,SAAS,KAAK3H,KAAAA;GAAS;GAAA,KAAA,WAAA;IAAA,OACnCtE,GACL,0EACA,oGACA0C,MAAMkF,KACR;GAAC;EAAA,GACGjF,IAAI,GAAA,OAAA,KAAA;EAAA,OAAAuJ;CAAA,EAAA,CAAA;AAGd;AAQA,IAAMhB,yBAAwE/J,UAC5EA,MAAM2F,eAAe;AAGvB,IAAMmE,2BAA0E9J,UAC9EA,MAAM8H,gBAAgB;;AAGxB,SAASmB,SAASP,OAAuB;CACvC,OAAO,IAAIuC,KAAKC,IAAI,GAAGxC,QAAQ,CAAC,IAAI;AACtC;;AAEA,IAAMkB,eAAe;AAErB,SAAS9D,eAAevC,QAA4BwC,eAAqC;CACvF,IAAI,EAAExC,kBAAkBnC,YAAYmC,WAAWwC,eAAe,OAAO;CACrE,OAAOlB,QACLtB,OAAOb,QACL,8GACF,CACF;AACF;AAEA,SAAS4F,YACP6C,UACAC,UACmC;CACnC,QAAQ5L,YAAY;EAClB2L,SAAS3L,OAAO;EAChB,MAAM+I,MAAM6C,SAAS;EACrB,IAAI,OAAO7C,QAAQ,YAAYA,IAAI/I,OAAO;CAC5C;AACF;AAE2D6L,eAAA;CAAA;CAAA;CAAA;AAAA,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"update-dialog.d.ts","sourceRoot":"","sources":["../../../../src/components/composites/update-dialog/update-dialog.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AA4B7C,OAAO,EASL,KAAK,WAAW,EACjB,MAAM,gBAAgB,CAAA;AAEvB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AC,EAAE,CAAC,OAAO,EAAE,qBAAqB,KAAK,GAAG,CAAC,OAAO,CAAA;IAChE,uEAAuE;IACvE,IAAI,CAAC,EAAE,OAAO,CAAA;IACd;;;;OAIG;IACH,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAA;IACtC;;;;OAIG;IACH,eAAe,CAAC,EAAE,QAAQ,CAAC,WAAW,GAAG,SAAS,CAAC,CAAA;IACnD,wEAAwE;IACxE,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,CAAA;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,eA+mBpD"}
1
+ {"version":3,"file":"update-dialog.d.ts","sourceRoot":"","sources":["../../../../src/components/composites/update-dialog/update-dialog.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AA4B7C,OAAO,EASL,KAAK,WAAW,EACjB,MAAM,gBAAgB,CAAA;AAavB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AAEH,YAAY,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAE9D;;;;GAIG;AACH,MAAM,MAAM,aAAa,GAAG,QAAQ,CAAC;IACnC,iEAAiE;IACjE,SAAS,IAAI,OAAO,CAAC,WAAW,CAAC,CAAA;IACjC,8DAA8D;IAC9D,KAAK,IAAI,OAAO,CAAC,WAAW,CAAC,CAAA;IAC7B;;;;;;OAMG;IACH,OAAO,CAAC,eAAe,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,CAAA;IACtD,4EAA4E;IAC5E,MAAM,CAAC,IAAI,OAAO,CAAC,WAAW,CAAC,CAAA;IAC/B,+EAA+E;IAC/E,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,iEAAiE;IACjE,YAAY,CAAC,CAAC,GAAG,EAAE,MAAM,G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