@lincyaw/aegis-ui 0.10.0 → 0.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (396) hide show
  1. package/dist/agent/ask/AskPanel.cjs +1 -1
  2. package/dist/agent/ask/AskPanel.cjs.map +1 -1
  3. package/dist/agent/ask/AskPanel.d.ts +5 -0
  4. package/dist/agent/ask/AskPanel.js +105 -98
  5. package/dist/agent/ask/AskPanel.js.map +1 -1
  6. package/dist/commands/commandContext.cjs.map +1 -1
  7. package/dist/commands/commandContext.d.ts +4 -1
  8. package/dist/commands/commandContext.js.map +1 -1
  9. package/dist/components/ui/AgentPanel.cjs +1 -1
  10. package/dist/components/ui/AgentPanel.cjs.map +1 -1
  11. package/dist/components/ui/AgentPanel.js +15 -14
  12. package/dist/components/ui/AgentPanel.js.map +1 -1
  13. package/dist/components/ui/Avatar.cjs +1 -1
  14. package/dist/components/ui/Avatar.cjs.map +1 -1
  15. package/dist/components/ui/Avatar.js +21 -19
  16. package/dist/components/ui/Avatar.js.map +1 -1
  17. package/dist/components/ui/BlastRadiusBar.cjs +1 -1
  18. package/dist/components/ui/BlastRadiusBar.cjs.map +1 -1
  19. package/dist/components/ui/BlastRadiusBar.d.ts +16 -4
  20. package/dist/components/ui/BlastRadiusBar.js +27 -23
  21. package/dist/components/ui/BlastRadiusBar.js.map +1 -1
  22. package/dist/components/ui/Button.cjs.map +1 -1
  23. package/dist/components/ui/Button.d.ts +4 -2
  24. package/dist/components/ui/Button.js.map +1 -1
  25. package/dist/components/ui/ChatComposer.cjs +1 -1
  26. package/dist/components/ui/ChatComposer.cjs.map +1 -1
  27. package/dist/components/ui/ChatComposer.js +32 -31
  28. package/dist/components/ui/ChatComposer.js.map +1 -1
  29. package/dist/components/ui/ChatSessionList.cjs +1 -1
  30. package/dist/components/ui/ChatSessionList.cjs.map +1 -1
  31. package/dist/components/ui/ChatSessionList.js +68 -66
  32. package/dist/components/ui/ChatSessionList.js.map +1 -1
  33. package/dist/components/ui/CheckGrid.cjs +1 -1
  34. package/dist/components/ui/CheckGrid.cjs.map +1 -1
  35. package/dist/components/ui/CheckGrid.js +18 -17
  36. package/dist/components/ui/CheckGrid.js.map +1 -1
  37. package/dist/components/ui/Checkbox.cjs +1 -1
  38. package/dist/components/ui/Checkbox.cjs.map +1 -1
  39. package/dist/components/ui/Checkbox.d.ts +6 -2
  40. package/dist/components/ui/Checkbox.js +21 -17
  41. package/dist/components/ui/Checkbox.js.map +1 -1
  42. package/dist/components/ui/ChoiceCardGroup.cjs +1 -1
  43. package/dist/components/ui/ChoiceCardGroup.cjs.map +1 -1
  44. package/dist/components/ui/ChoiceCardGroup.d.ts +13 -4
  45. package/dist/components/ui/ChoiceCardGroup.js +47 -35
  46. package/dist/components/ui/ChoiceCardGroup.js.map +1 -1
  47. package/dist/components/ui/CodeEditor.cjs +1 -1
  48. package/dist/components/ui/CodeEditor.cjs.map +1 -1
  49. package/dist/components/ui/CodeEditor.d.ts +11 -1
  50. package/dist/components/ui/CodeEditor.js +108 -74
  51. package/dist/components/ui/CodeEditor.js.map +1 -1
  52. package/dist/components/ui/CommandInvocationCard.cjs +1 -1
  53. package/dist/components/ui/CommandInvocationCard.cjs.map +1 -1
  54. package/dist/components/ui/CommandInvocationCard.js +23 -26
  55. package/dist/components/ui/CommandInvocationCard.js.map +1 -1
  56. package/dist/components/ui/CommandPalette.cjs +1 -1
  57. package/dist/components/ui/CommandPalette.cjs.map +1 -1
  58. package/dist/components/ui/CommandPalette.d.ts +3 -3
  59. package/dist/components/ui/CommandPalette.js +75 -75
  60. package/dist/components/ui/CommandPalette.js.map +1 -1
  61. package/dist/components/ui/CommitGraph.cjs +1 -1
  62. package/dist/components/ui/CommitGraph.cjs.map +1 -1
  63. package/dist/components/ui/CommitGraph.d.ts +3 -1
  64. package/dist/components/ui/CommitGraph.js +77 -74
  65. package/dist/components/ui/CommitGraph.js.map +1 -1
  66. package/dist/components/ui/ContentInspectorDialog.cjs +1 -1
  67. package/dist/components/ui/ContentInspectorDialog.cjs.map +1 -1
  68. package/dist/components/ui/ContentInspectorDialog.js +25 -31
  69. package/dist/components/ui/ContentInspectorDialog.js.map +1 -1
  70. package/dist/components/ui/ContentPreview.cjs +2 -2
  71. package/dist/components/ui/ContentPreview.cjs.map +1 -1
  72. package/dist/components/ui/ContentPreview.js +55 -56
  73. package/dist/components/ui/ContentPreview.js.map +1 -1
  74. package/dist/components/ui/DangerZone.cjs +1 -1
  75. package/dist/components/ui/DangerZone.cjs.map +1 -1
  76. package/dist/components/ui/DangerZone.js +9 -8
  77. package/dist/components/ui/DangerZone.js.map +1 -1
  78. package/dist/components/ui/DataList.cjs +1 -1
  79. package/dist/components/ui/DataList.cjs.map +1 -1
  80. package/dist/components/ui/DataList.js +27 -25
  81. package/dist/components/ui/DataList.js.map +1 -1
  82. package/dist/components/ui/DataTable.cjs +1 -1
  83. package/dist/components/ui/DataTable.cjs.map +1 -1
  84. package/dist/components/ui/DataTable.d.ts +2 -1
  85. package/dist/components/ui/DataTable.js +141 -124
  86. package/dist/components/ui/DataTable.js.map +1 -1
  87. package/dist/components/ui/DiffViewer.cjs +1 -1
  88. package/dist/components/ui/DiffViewer.cjs.map +1 -1
  89. package/dist/components/ui/DiffViewer.js +29 -25
  90. package/dist/components/ui/DiffViewer.js.map +1 -1
  91. package/dist/components/ui/DropdownMenu.cjs +1 -1
  92. package/dist/components/ui/DropdownMenu.cjs.map +1 -1
  93. package/dist/components/ui/DropdownMenu.d.ts +1 -0
  94. package/dist/components/ui/DropdownMenu.js +41 -40
  95. package/dist/components/ui/DropdownMenu.js.map +1 -1
  96. package/dist/components/ui/EnvironmentSwitcher.cjs +1 -1
  97. package/dist/components/ui/EnvironmentSwitcher.cjs.map +1 -1
  98. package/dist/components/ui/EnvironmentSwitcher.js +26 -24
  99. package/dist/components/ui/EnvironmentSwitcher.js.map +1 -1
  100. package/dist/components/ui/EventTable.cjs +1 -1
  101. package/dist/components/ui/EventTable.cjs.map +1 -1
  102. package/dist/components/ui/EventTable.js +60 -53
  103. package/dist/components/ui/EventTable.js.map +1 -1
  104. package/dist/components/ui/FileDropzone.cjs +1 -1
  105. package/dist/components/ui/FileDropzone.cjs.map +1 -1
  106. package/dist/components/ui/FileDropzone.js +40 -42
  107. package/dist/components/ui/FileDropzone.js.map +1 -1
  108. package/dist/components/ui/FilePreview.cjs +1 -1
  109. package/dist/components/ui/FilePreview.cjs.map +1 -1
  110. package/dist/components/ui/FilePreview.js +63 -61
  111. package/dist/components/ui/FilePreview.js.map +1 -1
  112. package/dist/components/ui/FolderDropzone.cjs +1 -1
  113. package/dist/components/ui/FolderDropzone.cjs.map +1 -1
  114. package/dist/components/ui/FolderDropzone.js +114 -84
  115. package/dist/components/ui/FolderDropzone.js.map +1 -1
  116. package/dist/components/ui/ForgotPasswordForm.cjs +1 -1
  117. package/dist/components/ui/ForgotPasswordForm.cjs.map +1 -1
  118. package/dist/components/ui/ForgotPasswordForm.js +22 -21
  119. package/dist/components/ui/ForgotPasswordForm.js.map +1 -1
  120. package/dist/components/ui/FormRow.cjs +1 -1
  121. package/dist/components/ui/FormRow.cjs.map +1 -1
  122. package/dist/components/ui/FormRow.d.ts +32 -11
  123. package/dist/components/ui/FormRow.js +24 -15
  124. package/dist/components/ui/FormRow.js.map +1 -1
  125. package/dist/components/ui/InboxPage.cjs +1 -1
  126. package/dist/components/ui/InboxPage.cjs.map +1 -1
  127. package/dist/components/ui/InboxPage.d.ts +12 -3
  128. package/dist/components/ui/InboxPage.js +91 -77
  129. package/dist/components/ui/InboxPage.js.map +1 -1
  130. package/dist/components/ui/LoginForm.cjs +1 -1
  131. package/dist/components/ui/LoginForm.cjs.map +1 -1
  132. package/dist/components/ui/LoginForm.js +43 -43
  133. package/dist/components/ui/LoginForm.js.map +1 -1
  134. package/dist/components/ui/MonoValue.cjs +1 -1
  135. package/dist/components/ui/MonoValue.cjs.map +1 -1
  136. package/dist/components/ui/MonoValue.d.ts +5 -1
  137. package/dist/components/ui/MonoValue.js +17 -17
  138. package/dist/components/ui/MonoValue.js.map +1 -1
  139. package/dist/components/ui/NotificationBell.cjs +1 -1
  140. package/dist/components/ui/NotificationBell.cjs.map +1 -1
  141. package/dist/components/ui/NotificationBell.d.ts +17 -1
  142. package/dist/components/ui/NotificationBell.js +129 -75
  143. package/dist/components/ui/NotificationBell.js.map +1 -1
  144. package/dist/components/ui/NumberField.cjs +1 -1
  145. package/dist/components/ui/NumberField.cjs.map +1 -1
  146. package/dist/components/ui/NumberField.d.ts +3 -1
  147. package/dist/components/ui/NumberField.js +52 -49
  148. package/dist/components/ui/NumberField.js.map +1 -1
  149. package/dist/components/ui/ObjectBrowser.cjs +1 -1
  150. package/dist/components/ui/ObjectBrowser.cjs.map +1 -1
  151. package/dist/components/ui/ObjectBrowser.js +83 -78
  152. package/dist/components/ui/ObjectBrowser.js.map +1 -1
  153. package/dist/components/ui/PageSizeSelect.cjs +1 -1
  154. package/dist/components/ui/PageSizeSelect.cjs.map +1 -1
  155. package/dist/components/ui/PageSizeSelect.js +30 -29
  156. package/dist/components/ui/PageSizeSelect.js.map +1 -1
  157. package/dist/components/ui/Panel.cjs.map +1 -1
  158. package/dist/components/ui/Panel.d.ts +5 -2
  159. package/dist/components/ui/Panel.js.map +1 -1
  160. package/dist/components/ui/ParetoChart.cjs +1 -1
  161. package/dist/components/ui/ParetoChart.cjs.map +1 -1
  162. package/dist/components/ui/ParetoChart.js +247 -212
  163. package/dist/components/ui/ParetoChart.js.map +1 -1
  164. package/dist/components/ui/ParquetViewer.cjs +1 -1
  165. package/dist/components/ui/ParquetViewer.cjs.map +1 -1
  166. package/dist/components/ui/ParquetViewer.js +69 -74
  167. package/dist/components/ui/ParquetViewer.js.map +1 -1
  168. package/dist/components/ui/PasswordField.cjs +1 -1
  169. package/dist/components/ui/PasswordField.cjs.map +1 -1
  170. package/dist/components/ui/PasswordField.js +28 -27
  171. package/dist/components/ui/PasswordField.js.map +1 -1
  172. package/dist/components/ui/PickerField.cjs +1 -1
  173. package/dist/components/ui/PickerField.cjs.map +1 -1
  174. package/dist/components/ui/PickerField.d.ts +25 -6
  175. package/dist/components/ui/PickerField.js +20 -17
  176. package/dist/components/ui/PickerField.js.map +1 -1
  177. package/dist/components/ui/ProjectSelector.cjs +1 -1
  178. package/dist/components/ui/ProjectSelector.cjs.map +1 -1
  179. package/dist/components/ui/ProjectSelector.js +40 -37
  180. package/dist/components/ui/ProjectSelector.js.map +1 -1
  181. package/dist/components/ui/QueryAutocomplete.cjs +1 -1
  182. package/dist/components/ui/QueryAutocomplete.cjs.map +1 -1
  183. package/dist/components/ui/QueryAutocomplete.d.ts +11 -2
  184. package/dist/components/ui/QueryAutocomplete.js +146 -126
  185. package/dist/components/ui/QueryAutocomplete.js.map +1 -1
  186. package/dist/components/ui/RankBar.cjs +1 -1
  187. package/dist/components/ui/RankBar.cjs.map +1 -1
  188. package/dist/components/ui/RankBar.js +9 -9
  189. package/dist/components/ui/RankBar.js.map +1 -1
  190. package/dist/components/ui/RegisterForm.cjs +1 -1
  191. package/dist/components/ui/RegisterForm.cjs.map +1 -1
  192. package/dist/components/ui/RegisterForm.js +41 -40
  193. package/dist/components/ui/RegisterForm.js.map +1 -1
  194. package/dist/components/ui/ReplayStepStrip.cjs +1 -1
  195. package/dist/components/ui/ReplayStepStrip.cjs.map +1 -1
  196. package/dist/components/ui/ReplayStepStrip.d.ts +6 -3
  197. package/dist/components/ui/ReplayStepStrip.js +71 -61
  198. package/dist/components/ui/ReplayStepStrip.js.map +1 -1
  199. package/dist/components/ui/ResizableSidePanel.cjs +1 -1
  200. package/dist/components/ui/ResizableSidePanel.cjs.map +1 -1
  201. package/dist/components/ui/ResizableSidePanel.js +41 -40
  202. package/dist/components/ui/ResizableSidePanel.js.map +1 -1
  203. package/dist/components/ui/SavedQueryBar.cjs +1 -1
  204. package/dist/components/ui/SavedQueryBar.cjs.map +1 -1
  205. package/dist/components/ui/SavedQueryBar.d.ts +1 -1
  206. package/dist/components/ui/SavedQueryBar.js +375 -277
  207. package/dist/components/ui/SavedQueryBar.js.map +1 -1
  208. package/dist/components/ui/SearchInput.cjs +1 -1
  209. package/dist/components/ui/SearchInput.cjs.map +1 -1
  210. package/dist/components/ui/SearchInput.d.ts +5 -1
  211. package/dist/components/ui/SearchInput.js +28 -24
  212. package/dist/components/ui/SearchInput.js.map +1 -1
  213. package/dist/components/ui/Select.cjs +1 -1
  214. package/dist/components/ui/Select.cjs.map +1 -1
  215. package/dist/components/ui/Select.d.ts +3 -1
  216. package/dist/components/ui/Select.js +21 -19
  217. package/dist/components/ui/Select.js.map +1 -1
  218. package/dist/components/ui/ServiceMap.cjs +1 -1
  219. package/dist/components/ui/ServiceMap.cjs.map +1 -1
  220. package/dist/components/ui/ServiceMap.d.ts +18 -4
  221. package/dist/components/ui/ServiceMap.js +353 -228
  222. package/dist/components/ui/ServiceMap.js.map +1 -1
  223. package/dist/components/ui/Slider.cjs +1 -1
  224. package/dist/components/ui/Slider.cjs.map +1 -1
  225. package/dist/components/ui/Slider.d.ts +3 -1
  226. package/dist/components/ui/Slider.js +11 -9
  227. package/dist/components/ui/Slider.js.map +1 -1
  228. package/dist/components/ui/SparkLine.cjs +1 -1
  229. package/dist/components/ui/SparkLine.cjs.map +1 -1
  230. package/dist/components/ui/SparkLine.d.ts +5 -2
  231. package/dist/components/ui/SparkLine.js +36 -31
  232. package/dist/components/ui/SparkLine.js.map +1 -1
  233. package/dist/components/ui/Steps.cjs +1 -1
  234. package/dist/components/ui/Steps.cjs.map +1 -1
  235. package/dist/components/ui/Steps.js +25 -29
  236. package/dist/components/ui/Steps.js.map +1 -1
  237. package/dist/components/ui/TableOfContents.cjs +1 -1
  238. package/dist/components/ui/TableOfContents.cjs.map +1 -1
  239. package/dist/components/ui/TableOfContents.js +16 -19
  240. package/dist/components/ui/TableOfContents.js.map +1 -1
  241. package/dist/components/ui/Tabs.cjs +2 -2
  242. package/dist/components/ui/Tabs.cjs.map +1 -1
  243. package/dist/components/ui/Tabs.js +107 -87
  244. package/dist/components/ui/Tabs.js.map +1 -1
  245. package/dist/components/ui/Terminal.cjs +1 -1
  246. package/dist/components/ui/Terminal.cjs.map +1 -1
  247. package/dist/components/ui/Terminal.js +18 -17
  248. package/dist/components/ui/Terminal.js.map +1 -1
  249. package/dist/components/ui/TextField.cjs +1 -1
  250. package/dist/components/ui/TextField.cjs.map +1 -1
  251. package/dist/components/ui/TextField.js +6 -6
  252. package/dist/components/ui/TextField.js.map +1 -1
  253. package/dist/components/ui/ThemeToggle.cjs +1 -1
  254. package/dist/components/ui/ThemeToggle.cjs.map +1 -1
  255. package/dist/components/ui/ThemeToggle.js +15 -18
  256. package/dist/components/ui/ThemeToggle.js.map +1 -1
  257. package/dist/components/ui/TimeDisplay.cjs +1 -1
  258. package/dist/components/ui/TimeDisplay.cjs.map +1 -1
  259. package/dist/components/ui/TimeDisplay.js +12 -12
  260. package/dist/components/ui/TimeDisplay.js.map +1 -1
  261. package/dist/components/ui/TimeRangePicker.cjs +1 -1
  262. package/dist/components/ui/TimeRangePicker.cjs.map +1 -1
  263. package/dist/components/ui/TimeRangePicker.d.ts +12 -1
  264. package/dist/components/ui/TimeRangePicker.js +136 -113
  265. package/dist/components/ui/TimeRangePicker.js.map +1 -1
  266. package/dist/components/ui/Timeline.cjs.map +1 -1
  267. package/dist/components/ui/Timeline.d.ts +4 -4
  268. package/dist/components/ui/Timeline.js.map +1 -1
  269. package/dist/components/ui/TimelineChart.cjs +2 -2
  270. package/dist/components/ui/TimelineChart.cjs.map +1 -1
  271. package/dist/components/ui/TimelineChart.d.ts +1 -0
  272. package/dist/components/ui/TimelineChart.js +131 -137
  273. package/dist/components/ui/TimelineChart.js.map +1 -1
  274. package/dist/components/ui/TraceSpanInspector.cjs +1 -1
  275. package/dist/components/ui/TraceSpanInspector.cjs.map +1 -1
  276. package/dist/components/ui/TraceSpanInspector.js +43 -46
  277. package/dist/components/ui/TraceSpanInspector.js.map +1 -1
  278. package/dist/components/ui/TraceTree.cjs +1 -1
  279. package/dist/components/ui/TraceTree.cjs.map +1 -1
  280. package/dist/components/ui/TraceTree.d.ts +5 -1
  281. package/dist/components/ui/TraceTree.js +98 -97
  282. package/dist/components/ui/TraceTree.js.map +1 -1
  283. package/dist/components/ui/TrajectoryStep.cjs +2 -1
  284. package/dist/components/ui/TrajectoryStep.cjs.map +1 -1
  285. package/dist/components/ui/TrajectoryStep.js +64 -43
  286. package/dist/components/ui/TrajectoryStep.js.map +1 -1
  287. package/dist/components/ui/UploadQueue.cjs +1 -1
  288. package/dist/components/ui/UploadQueue.cjs.map +1 -1
  289. package/dist/components/ui/UploadQueue.js +59 -70
  290. package/dist/components/ui/UploadQueue.js.map +1 -1
  291. package/dist/components/ui/authValidation.cjs +1 -1
  292. package/dist/components/ui/authValidation.cjs.map +1 -1
  293. package/dist/components/ui/authValidation.d.ts +2 -2
  294. package/dist/components/ui/authValidation.js +4 -5
  295. package/dist/components/ui/authValidation.js.map +1 -1
  296. package/dist/components/ui/classifyContent.cjs +3 -3
  297. package/dist/components/ui/classifyContent.cjs.map +1 -1
  298. package/dist/components/ui/classifyContent.d.ts +2 -1
  299. package/dist/components/ui/classifyContent.js +52 -54
  300. package/dist/components/ui/classifyContent.js.map +1 -1
  301. package/dist/components/ui/relativeTime.cjs +1 -1
  302. package/dist/components/ui/relativeTime.cjs.map +1 -1
  303. package/dist/components/ui/relativeTime.d.ts +5 -3
  304. package/dist/components/ui/relativeTime.js +15 -6
  305. package/dist/components/ui/relativeTime.js.map +1 -1
  306. package/dist/components/ui/useColumnWidths.cjs +1 -1
  307. package/dist/components/ui/useColumnWidths.cjs.map +1 -1
  308. package/dist/components/ui/useColumnWidths.d.ts +6 -1
  309. package/dist/components/ui/useColumnWidths.js +139 -123
  310. package/dist/components/ui/useColumnWidths.js.map +1 -1
  311. package/dist/hooks/popoverOverflow.cjs +2 -0
  312. package/dist/hooks/popoverOverflow.cjs.map +1 -0
  313. package/dist/hooks/popoverOverflow.d.ts +8 -0
  314. package/dist/hooks/popoverOverflow.js +9 -0
  315. package/dist/hooks/popoverOverflow.js.map +1 -0
  316. package/dist/hooks/useDialogPopover.cjs +2 -0
  317. package/dist/hooks/useDialogPopover.cjs.map +1 -0
  318. package/dist/hooks/useDialogPopover.d.ts +23 -0
  319. package/dist/hooks/useDialogPopover.js +48 -0
  320. package/dist/hooks/useDialogPopover.js.map +1 -0
  321. package/dist/hooks/useMenuPopover.cjs +1 -1
  322. package/dist/hooks/useMenuPopover.cjs.map +1 -1
  323. package/dist/hooks/useMenuPopover.d.ts +0 -8
  324. package/dist/hooks/useMenuPopover.js +17 -22
  325. package/dist/hooks/useMenuPopover.js.map +1 -1
  326. package/dist/hooks/useSavedQueries.cjs +1 -1
  327. package/dist/hooks/useSavedQueries.cjs.map +1 -1
  328. package/dist/hooks/useSavedQueries.js +29 -28
  329. package/dist/hooks/useSavedQueries.js.map +1 -1
  330. package/dist/index.d.ts +1 -1
  331. package/dist/layouts/shell/AegisShell.cjs +1 -1
  332. package/dist/layouts/shell/AegisShell.cjs.map +1 -1
  333. package/dist/layouts/shell/AegisShell.js +58 -59
  334. package/dist/layouts/shell/AegisShell.js.map +1 -1
  335. package/dist/layouts/shell/AppSwitcher.cjs +1 -1
  336. package/dist/layouts/shell/AppSwitcher.cjs.map +1 -1
  337. package/dist/layouts/shell/AppSwitcher.js +53 -36
  338. package/dist/layouts/shell/AppSwitcher.js.map +1 -1
  339. package/dist/layouts/shell/AuthRequiredCard.cjs +1 -1
  340. package/dist/layouts/shell/AuthRequiredCard.cjs.map +1 -1
  341. package/dist/layouts/shell/AuthRequiredCard.js +24 -22
  342. package/dist/layouts/shell/AuthRequiredCard.js.map +1 -1
  343. package/dist/layouts/shell/RouteErrorBoundary.cjs +1 -1
  344. package/dist/layouts/shell/RouteErrorBoundary.cjs.map +1 -1
  345. package/dist/layouts/shell/RouteErrorBoundary.d.ts +4 -1
  346. package/dist/layouts/shell/RouteErrorBoundary.js +15 -10
  347. package/dist/layouts/shell/RouteErrorBoundary.js.map +1 -1
  348. package/dist/layouts/shell/ShellInboxPage.cjs +1 -1
  349. package/dist/layouts/shell/ShellInboxPage.cjs.map +1 -1
  350. package/dist/layouts/shell/ShellInboxPage.js +17 -16
  351. package/dist/layouts/shell/ShellInboxPage.js.map +1 -1
  352. package/dist/layouts/shell/ShellNotificationBell.cjs +1 -1
  353. package/dist/layouts/shell/ShellNotificationBell.cjs.map +1 -1
  354. package/dist/layouts/shell/ShellNotificationBell.js +20 -14
  355. package/dist/layouts/shell/ShellNotificationBell.js.map +1 -1
  356. package/dist/layouts/shell/TopHeader.cjs +1 -1
  357. package/dist/layouts/shell/TopHeader.cjs.map +1 -1
  358. package/dist/layouts/shell/TopHeader.js +74 -74
  359. package/dist/layouts/shell/TopHeader.js.map +1 -1
  360. package/dist/layouts/shell/useShellUser.cjs +1 -1
  361. package/dist/layouts/shell/useShellUser.cjs.map +1 -1
  362. package/dist/layouts/shell/useShellUser.js +15 -13
  363. package/dist/layouts/shell/useShellUser.js.map +1 -1
  364. package/dist/lib/breakAtSeparators.cjs +2 -0
  365. package/dist/lib/breakAtSeparators.cjs.map +1 -0
  366. package/dist/lib/breakAtSeparators.d.ts +6 -0
  367. package/dist/lib/breakAtSeparators.js +10 -0
  368. package/dist/lib/breakAtSeparators.js.map +1 -0
  369. package/dist/lib/chart.cjs +1 -1
  370. package/dist/lib/chart.cjs.map +1 -1
  371. package/dist/lib/chart.d.ts +5 -7
  372. package/dist/lib/chart.js +49 -34
  373. package/dist/lib/chart.js.map +1 -1
  374. package/dist/lib/timeRange.cjs +1 -1
  375. package/dist/lib/timeRange.cjs.map +1 -1
  376. package/dist/lib/timeRange.d.ts +14 -4
  377. package/dist/lib/timeRange.js +41 -40
  378. package/dist/lib/timeRange.js.map +1 -1
  379. package/dist/locale/strings.cjs +1 -1
  380. package/dist/locale/strings.cjs.map +1 -1
  381. package/dist/locale/strings.d.ts +247 -2
  382. package/dist/locale/strings.js +562 -37
  383. package/dist/locale/strings.js.map +1 -1
  384. package/dist/notifications/notificationContext.cjs.map +1 -1
  385. package/dist/notifications/notificationContext.d.ts +12 -2
  386. package/dist/notifications/notificationContext.js.map +1 -1
  387. package/dist/style.css +1 -1
  388. package/dist/theme/antdTheme.cjs +1 -1
  389. package/dist/theme/antdTheme.cjs.map +1 -1
  390. package/dist/theme/antdTheme.js +52 -29
  391. package/dist/theme/antdTheme.js.map +1 -1
  392. package/dist/transports/agentm/AgentmChannelProvider.cjs +1 -1
  393. package/dist/transports/agentm/AgentmChannelProvider.cjs.map +1 -1
  394. package/dist/transports/agentm/AgentmChannelProvider.js +66 -61
  395. package/dist/transports/agentm/AgentmChannelProvider.js.map +1 -1
  396. package/package.json +1 -1
@@ -18,7 +18,10 @@ export interface ReplayStepStripProps {
18
18
  steps: ReplayStepStripItem[];
19
19
  /** The step shown elsewhere on the page; outlined. */
20
20
  currentIndex?: number;
21
- /** Makes each step a button that selects it. */
21
+ /**
22
+ * Makes each step a button that selects it. Each step then stays wide
23
+ * enough to tap, and a run too long for the width scrolls sideways.
24
+ */
22
25
  onSelect?: (index: number) => void;
23
26
  /** Step indices of the key moments, numbered above the strip in order. */
24
27
  keyMoments?: number[];
@@ -39,7 +42,7 @@ export interface ReplayStepStripProps {
39
42
  * Every step of a run as a bar coloured by its kind, with the key
40
43
  * moments numbered above it and step ticks below. With `onSelect`, a bar
41
44
  * selects its step; arrow keys move between steps with one tab stop.
42
- * The gap between bars narrows as steps are added, so a long run still
43
- * draws every step.
45
+ * Without `onSelect`, the gap between bars narrows as steps are added, so a
46
+ * long run still draws every step in the width.
44
47
  */
45
48
  export declare function ReplayStepStrip({ steps, currentIndex, onSelect, keyMoments, formatStep, tickEvery, size, playhead, className, }: ReplayStepStripProps): ReactElement;
@@ -1,86 +1,96 @@
1
- import { jsxs as b, jsx as p } from "react/jsx-runtime";
2
- import { useRef as R, useState as A } from "react";
3
- import { chartColorValue as B } from "../../lib/chart.js";
1
+ import { jsxs as w, jsx as p } from "react/jsx-runtime";
2
+ import { useRef as N, useState as A, useEffect as D } from "react";
3
+ import { chartColorValue as E } from "../../lib/chart.js";
4
4
  /* empty css */
5
- import { useStrings as C } from "../../locale/useStrings.js";
6
- function D(l, a) {
7
- const r = l - 1, n = new Set(l > 0 ? [0, r] : []);
8
- for (let o = a - 1; o < r; o += a)
9
- r - o >= a / 2 && n.add(o);
10
- return n;
5
+ import { useStrings as F } from "../../locale/useStrings.js";
6
+ function K(o, a) {
7
+ const r = o - 1, c = new Set(o > 0 ? [0, r] : []);
8
+ for (let n = a - 1; n < r; n += a)
9
+ r - n >= a / 2 && c.add(n);
10
+ return c;
11
11
  }
12
- function L({
13
- steps: l,
12
+ function G({
13
+ steps: o,
14
14
  currentIndex: a,
15
15
  onSelect: r,
16
- keyMoments: n = [],
17
- formatStep: o = (m) => `#${String(m + 1)}`,
18
- tickEvery: N,
19
- size: h = "md",
20
- playhead: c,
21
- className: v
16
+ keyMoments: c = [],
17
+ formatStep: n = (g) => `#${String(g + 1)}`,
18
+ tickEvery: M,
19
+ size: f = "md",
20
+ playhead: m,
21
+ className: R
22
22
  }) {
23
- const m = C(), u = R(null), s = l.length, w = N ?? Math.max(1, Math.ceil(s / 20) * 5), M = D(s, w), _ = new Map(n.map((t, e) => [t, e + 1])), [S, d] = A(0), y = Math.min(a ?? S, Math.max(s - 1, 0)), j = (t) => {
24
- if (!r || s === 0)
23
+ const g = F(), _ = N(null), y = N(null), i = o.length, S = M ?? Math.max(1, Math.ceil(i / 20) * 5), j = K(i, S), d = new Map(c.map((t, e) => [t, e + 1])), [B, b] = A(0), h = Math.min(a ?? B, Math.max(i - 1, 0)), u = r !== void 0;
24
+ D(() => {
25
+ const t = _.current, e = a === void 0 ? null : y.current?.children.item(a);
26
+ if (!u || !t || !e)
27
+ return;
28
+ const s = t.getBoundingClientRect(), l = e.getBoundingClientRect();
29
+ (l.left < s.left || l.right > s.right) && (t.scrollLeft += l.left + l.width / 2 - (s.left + s.width / 2));
30
+ }, [u, a, i]);
31
+ const $ = (t) => {
32
+ if (!r || i === 0)
25
33
  return;
26
34
  const e = {
27
- ArrowLeft: y - 1,
28
- ArrowRight: y + 1,
35
+ ArrowLeft: h - 1,
36
+ ArrowRight: h + 1,
29
37
  Home: 0,
30
- End: s - 1
38
+ End: i - 1
31
39
  };
32
40
  if (!(t.key in e))
33
41
  return;
34
42
  t.preventDefault();
35
- const i = Math.min(Math.max(e[t.key], 0), s - 1);
36
- d(i), r(i), u.current?.querySelectorAll(".aegis-replay-step-strip__step").item(i).focus();
37
- }, $ = {
38
- "--aegis-replay-step-strip-count": Math.max(s, 1),
39
- ...c === void 0 ? {} : {
40
- "--aegis-replay-step-strip-head": c,
41
- "--aegis-replay-step-strip-head-step": c * s
43
+ const s = Math.min(Math.max(e[t.key], 0), i - 1);
44
+ b(s), r(s), y.current?.querySelectorAll(".aegis-replay-step-strip__step").item(s).focus();
45
+ }, C = {
46
+ "--aegis-replay-step-strip-count": Math.max(i, 1),
47
+ ...m === void 0 ? {} : {
48
+ "--aegis-replay-step-strip-head": m,
49
+ "--aegis-replay-step-strip-head-step": m * i
42
50
  }
43
51
  };
44
- return /* @__PURE__ */ b(
52
+ return /* @__PURE__ */ w(
45
53
  "div",
46
54
  {
55
+ ref: _,
47
56
  className: [
48
57
  "aegis-replay-step-strip",
49
- `aegis-replay-step-strip--${h}`,
50
- c === void 0 ? "" : "aegis-replay-step-strip--playhead",
51
- v ?? ""
58
+ `aegis-replay-step-strip--${f}`,
59
+ u ? "aegis-replay-step-strip--selectable" : "",
60
+ m === void 0 ? "" : "aegis-replay-step-strip--playhead",
61
+ R ?? ""
52
62
  ].filter(Boolean).join(" "),
53
- style: $,
63
+ style: C,
54
64
  children: [
55
- n.length > 0 && /* @__PURE__ */ p("div", { className: "aegis-replay-step-strip__moments", "aria-hidden": "true", children: l.map((t, e) => {
56
- const i = _.get(e);
57
- return i === void 0 ? /* @__PURE__ */ p("span", {}, t.key) : /* @__PURE__ */ p(
65
+ c.length > 0 && /* @__PURE__ */ p("div", { className: "aegis-replay-step-strip__moments", "aria-hidden": "true", children: o.map((t, e) => {
66
+ const s = d.get(e);
67
+ return s === void 0 ? /* @__PURE__ */ p("span", {}, t.key) : /* @__PURE__ */ p(
58
68
  "span",
59
69
  {
60
70
  className: [
61
71
  "aegis-replay-step-strip__moment",
62
72
  e === a ? "aegis-replay-step-strip__moment--current" : ""
63
73
  ].filter(Boolean).join(" "),
64
- children: i
74
+ children: s
65
75
  },
66
76
  t.key
67
77
  );
68
78
  }) }),
69
- /* @__PURE__ */ b(
79
+ /* @__PURE__ */ w(
70
80
  "div",
71
81
  {
72
- ref: u,
82
+ ref: y,
73
83
  className: "aegis-replay-step-strip__bars",
74
84
  role: r ? "toolbar" : "list",
75
- "aria-label": m.replaySteps,
76
- onKeyDown: j,
85
+ "aria-label": g.replaySteps,
86
+ onKeyDown: $,
77
87
  children: [
78
- l.map((t, e) => {
79
- const i = _.get(e), g = i === void 0 ? t.label : `${t.label} · ${m.replayKeyMoment(i)}`, f = {
80
- "--aegis-replay-step-strip-color": B(t.color),
88
+ o.map((t, e) => {
89
+ const s = d.get(e), l = s === void 0 ? t.label : `${t.label} · ${g.replayKeyMoment(s)}`, k = {
90
+ "--aegis-replay-step-strip-color": E(t.color),
81
91
  "--aegis-replay-step-strip-index": e,
82
92
  ...t.weight === void 0 ? {} : { height: `${(t.weight * 100).toString()}%` }
83
- }, k = [
93
+ }, v = [
84
94
  "aegis-replay-step-strip__step",
85
95
  t.emphasis ? "aegis-replay-step-strip__step--emphasis" : "",
86
96
  e === a ? "aegis-replay-step-strip__step--current" : ""
@@ -89,14 +99,14 @@ function L({
89
99
  "button",
90
100
  {
91
101
  type: "button",
92
- className: k,
93
- style: f,
94
- title: g,
95
- "aria-label": g,
102
+ className: v,
103
+ style: k,
104
+ title: l,
105
+ "aria-label": l,
96
106
  "aria-current": e === a ? "step" : void 0,
97
- tabIndex: e === y ? 0 : -1,
107
+ tabIndex: e === h ? 0 : -1,
98
108
  onClick: () => {
99
- d(e), r(e);
109
+ b(e), r(e);
100
110
  }
101
111
  },
102
112
  t.key
@@ -104,16 +114,16 @@ function L({
104
114
  "span",
105
115
  {
106
116
  role: "listitem",
107
- className: k,
108
- style: f,
109
- title: g,
110
- "aria-label": g,
117
+ className: v,
118
+ style: k,
119
+ title: l,
120
+ "aria-label": l,
111
121
  "aria-current": e === a ? "step" : void 0
112
122
  },
113
123
  t.key
114
124
  );
115
125
  }),
116
- c !== void 0 && /* @__PURE__ */ p(
126
+ m !== void 0 && /* @__PURE__ */ p(
117
127
  "span",
118
128
  {
119
129
  className: "aegis-replay-step-strip__head-track",
@@ -124,11 +134,11 @@ function L({
124
134
  ]
125
135
  }
126
136
  ),
127
- h === "md" && /* @__PURE__ */ p("div", { className: "aegis-replay-step-strip__ticks", "aria-hidden": "true", children: l.map((t, e) => /* @__PURE__ */ p(
137
+ f === "md" && /* @__PURE__ */ p("div", { className: "aegis-replay-step-strip__ticks", "aria-hidden": "true", children: o.map((t, e) => /* @__PURE__ */ p(
128
138
  "span",
129
139
  {
130
- className: e === s - 1 && s > 1 ? "aegis-replay-step-strip__tick aegis-replay-step-strip__tick--last" : "aegis-replay-step-strip__tick",
131
- children: M.has(e) ? o(e) : null
140
+ className: e === i - 1 && i > 1 ? "aegis-replay-step-strip__tick aegis-replay-step-strip__tick--last" : "aegis-replay-step-strip__tick",
141
+ children: j.has(e) ? n(e) : null
132
142
  },
133
143
  t.key
134
144
  )) })
@@ -137,6 +147,6 @@ function L({
137
147
  );
138
148
  }
139
149
  export {
140
- L as ReplayStepStrip
150
+ G as ReplayStepStrip
141
151
  };
142
152
  //# sourceMappingURL=ReplayStepStrip.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ReplayStepStrip.js","sources":["../../../src/components/ui/ReplayStepStrip.tsx"],"sourcesContent":["import {\n type CSSProperties,\n type KeyboardEvent,\n type ReactElement,\n type ReactNode,\n useRef,\n useState,\n} from 'react';\n\nimport { type ChartColor, chartColorValue } from '../../lib/chart';\nimport { useStrings } from '../../locale';\nimport './ReplayStepStrip.css';\n\nexport interface ReplayStepStripItem {\n key: string;\n /** The step kind's colour, e.g. thinking, tool call, failure. */\n color: ChartColor;\n /** Names the step for screen readers and its tooltip, e.g. \"#12 · 验证\". */\n label: string;\n /** A step that changes the course (a check, a failure, the goal): taller. */\n emphasis?: boolean;\n /**\n * The bar's height as a share of the strip, 0 to 1, for a host that\n * grades its kinds more finely than `emphasis`; it wins over `emphasis`.\n */\n weight?: number;\n}\n\nexport interface ReplayStepStripProps {\n steps: ReplayStepStripItem[];\n /** The step shown elsewhere on the page; outlined. */\n currentIndex?: number;\n /** Makes each step a button that selects it. */\n onSelect?: (index: number) => void;\n /** Step indices of the key moments, numbered above the strip in order. */\n keyMoments?: number[];\n /** The tick label of a step under the strip. Defaults to `#n`. */\n formatStep?: (index: number) => ReactNode;\n /** A tick every this many steps; defaults to about five ticks. */\n tickEvery?: number;\n /** `sm` is a shorter strip without ticks, for a card or a list row. Defaults to `md`. */\n size?: 'md' | 'sm';\n /**\n * Draws a playhead this share of the way along the strip, 0 to 1, and\n * dims the steps past it, e.g. for a strip that plays as the page scrolls.\n */\n playhead?: number;\n className?: string;\n}\n\n/**\n * The steps that get a tick: the first, the last, and every `every`\n * steps between, leaving out one that would crowd the last.\n */\nfunction tickedSteps(count: number, every: number): Set<number> {\n const last = count - 1;\n const ticks = new Set<number>(count > 0 ? [0, last] : []);\n for (let index = every - 1; index < last; index += every) {\n if (last - index >= every / 2) {\n ticks.add(index);\n }\n }\n return ticks;\n}\n\n/**\n * Every step of a run as a bar coloured by its kind, with the key\n * moments numbered above it and step ticks below. With `onSelect`, a bar\n * selects its step; arrow keys move between steps with one tab stop.\n * The gap between bars narrows as steps are added, so a long run still\n * draws every step.\n */\nexport function ReplayStepStrip({\n steps,\n currentIndex,\n onSelect,\n keyMoments = [],\n formatStep = (index) => `#${String(index + 1)}`,\n tickEvery,\n size = 'md',\n playhead,\n className,\n}: ReplayStepStripProps): ReactElement {\n const strings = useStrings();\n const barsRef = useRef<HTMLDivElement>(null);\n const count = steps.length;\n const every = tickEvery ?? Math.max(1, Math.ceil(count / 20) * 5);\n const ticks = tickedSteps(count, every);\n const momentNumber = new Map(keyMoments.map((step, n) => [step, n + 1]));\n\n // The roving tab stop follows the current step, or the last step the\n // keyboard reached when the host does not mark one.\n const [ownFocus, setOwnFocus] = useState(0);\n const focusIndex = Math.min(currentIndex ?? ownFocus, Math.max(count - 1, 0));\n\n const onKeyDown = (event: KeyboardEvent<HTMLDivElement>): void => {\n if (!onSelect || count === 0) {\n return;\n }\n const target: Record<string, number> = {\n ArrowLeft: focusIndex - 1,\n ArrowRight: focusIndex + 1,\n Home: 0,\n End: count - 1,\n };\n if (!(event.key in target)) {\n return;\n }\n event.preventDefault();\n const next = Math.min(Math.max(target[event.key], 0), count - 1);\n setOwnFocus(next);\n onSelect(next);\n barsRef.current\n ?.querySelectorAll<HTMLButtonElement>('.aegis-replay-step-strip__step')\n .item(next)\n .focus();\n };\n\n const style = {\n '--aegis-replay-step-strip-count': Math.max(count, 1),\n ...(playhead === undefined\n ? {}\n : {\n '--aegis-replay-step-strip-head': playhead,\n '--aegis-replay-step-strip-head-step': playhead * count,\n }),\n } as CSSProperties;\n return (\n <div\n className={[\n 'aegis-replay-step-strip',\n `aegis-replay-step-strip--${size}`,\n playhead === undefined ? '' : 'aegis-replay-step-strip--playhead',\n className ?? '',\n ]\n .filter(Boolean)\n .join(' ')}\n style={style}\n >\n {keyMoments.length > 0 && (\n <div className=\"aegis-replay-step-strip__moments\" aria-hidden=\"true\">\n {steps.map((step, index) => {\n const n = momentNumber.get(index);\n return n === undefined ? (\n <span key={step.key} />\n ) : (\n <span\n key={step.key}\n className={[\n 'aegis-replay-step-strip__moment',\n index === currentIndex\n ? 'aegis-replay-step-strip__moment--current'\n : '',\n ]\n .filter(Boolean)\n .join(' ')}\n >\n {n}\n </span>\n );\n })}\n </div>\n )}\n <div\n ref={barsRef}\n className=\"aegis-replay-step-strip__bars\"\n role={onSelect ? 'toolbar' : 'list'}\n aria-label={strings.replaySteps}\n onKeyDown={onKeyDown}\n >\n {steps.map((step, index) => {\n const n = momentNumber.get(index);\n const label =\n n === undefined\n ? step.label\n : `${step.label} · ${strings.replayKeyMoment(n)}`;\n const barStyle = {\n '--aegis-replay-step-strip-color': chartColorValue(step.color),\n '--aegis-replay-step-strip-index': index,\n ...(step.weight === undefined\n ? {}\n : { height: `${(step.weight * 100).toString()}%` }),\n } as CSSProperties;\n const cls = [\n 'aegis-replay-step-strip__step',\n step.emphasis ? 'aegis-replay-step-strip__step--emphasis' : '',\n index === currentIndex\n ? 'aegis-replay-step-strip__step--current'\n : '',\n ]\n .filter(Boolean)\n .join(' ');\n return onSelect ? (\n <button\n key={step.key}\n type=\"button\"\n className={cls}\n style={barStyle}\n title={label}\n aria-label={label}\n aria-current={index === currentIndex ? 'step' : undefined}\n tabIndex={index === focusIndex ? 0 : -1}\n onClick={() => {\n setOwnFocus(index);\n onSelect(index);\n }}\n />\n ) : (\n <span\n key={step.key}\n role=\"listitem\"\n className={cls}\n style={barStyle}\n title={label}\n aria-label={label}\n aria-current={index === currentIndex ? 'step' : undefined}\n />\n );\n })}\n {playhead !== undefined && (\n <span\n className=\"aegis-replay-step-strip__head-track\"\n aria-hidden=\"true\"\n >\n <span className=\"aegis-replay-step-strip__head\" />\n </span>\n )}\n </div>\n {size === 'md' && (\n <div className=\"aegis-replay-step-strip__ticks\" aria-hidden=\"true\">\n {steps.map((step, index) => (\n <span\n key={step.key}\n className={\n index === count - 1 && count > 1\n ? 'aegis-replay-step-strip__tick aegis-replay-step-strip__tick--last'\n : 'aegis-replay-step-strip__tick'\n }\n >\n {ticks.has(index) ? formatStep(index) : null}\n </span>\n ))}\n </div>\n )}\n </div>\n );\n}\n"],"names":["tickedSteps","count","every","last","ticks","index","ReplayStepStrip","steps","currentIndex","onSelect","keyMoments","formatStep","tickEvery","size","playhead","className","strings","useStrings","barsRef","useRef","momentNumber","step","n","ownFocus","setOwnFocus","useState","focusIndex","onKeyDown","event","target","next","style","jsxs","jsx","label","barStyle","chartColorValue","cls"],"mappings":";;;;;AAsDA,SAASA,EAAYC,GAAeC,GAA4B;AAC9D,QAAMC,IAAOF,IAAQ,GACfG,IAAQ,IAAI,IAAYH,IAAQ,IAAI,CAAC,GAAGE,CAAI,IAAI,EAAE;AACxD,WAASE,IAAQH,IAAQ,GAAGG,IAAQF,GAAME,KAASH;AACjD,IAAIC,IAAOE,KAASH,IAAQ,KAC1BE,EAAM,IAAIC,CAAK;AAGnB,SAAOD;AACT;AASO,SAASE,EAAgB;AAAA,EAC9B,OAAAC;AAAA,EACA,cAAAC;AAAA,EACA,UAAAC;AAAA,EACA,YAAAC,IAAa,CAAA;AAAA,EACb,YAAAC,IAAa,CAACN,MAAU,IAAI,OAAOA,IAAQ,CAAC,CAAC;AAAA,EAC7C,WAAAO;AAAA,EACA,MAAAC,IAAO;AAAA,EACP,UAAAC;AAAA,EACA,WAAAC;AACF,GAAuC;AACrC,QAAMC,IAAUC,EAAA,GACVC,IAAUC,EAAuB,IAAI,GACrClB,IAAQM,EAAM,QACdL,IAAQU,KAAa,KAAK,IAAI,GAAG,KAAK,KAAKX,IAAQ,EAAE,IAAI,CAAC,GAC1DG,IAAQJ,EAAYC,GAAOC,CAAK,GAChCkB,IAAe,IAAI,IAAIV,EAAW,IAAI,CAACW,GAAMC,MAAM,CAACD,GAAMC,IAAI,CAAC,CAAC,CAAC,GAIjE,CAACC,GAAUC,CAAW,IAAIC,EAAS,CAAC,GACpCC,IAAa,KAAK,IAAIlB,KAAgBe,GAAU,KAAK,IAAItB,IAAQ,GAAG,CAAC,CAAC,GAEtE0B,IAAY,CAACC,MAA+C;AAChE,QAAI,CAACnB,KAAYR,MAAU;AACzB;AAEF,UAAM4B,IAAiC;AAAA,MACrC,WAAWH,IAAa;AAAA,MACxB,YAAYA,IAAa;AAAA,MACzB,MAAM;AAAA,MACN,KAAKzB,IAAQ;AAAA,IAAA;AAEf,QAAI,EAAE2B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A,cAShB,CAAC;AAAA,cACAP,MAAa,UACZ,gBAAAmB;AAAA,gBAAC;AAAA,gBAAA;AAAA,kBACC,WAAU;AAAA,kBACV,eAAY;AAAA,kBAEZ,UAAA,gBAAAA,EAAC,QAAA,EAAK,WAAU,gCAAA,CAAgC;AAAA,gBAAA;AAAA,cAAA;AAAA,YAClD;AAAA,UAAA;AAAA,QAAA;AAAA,QAGHpB,MAAS,QACR,gBAAAoB,EAAC,OAAA,EAAI,WAAU,kCAAiC,eAAY,QACzD,UAAA1B,EAAM,IAAI,CAACc,GAAMhB,MAChB,gBAAA4B;AAAA,UAAC;AAAA,UAAA;AAAA,YAEC,WACE5B,MAAUJ,IAAQ,KAAKA,IAAQ,IAC3B,sEACA;AAAA,YAGL,YAAM,IAAII,CAAK,IAAIM,EAAWN,CAAK,IAAI;AAAA,UAAA;AAAA,UAPnCgB,EAAK;AAAA,QAAA,CASb,EAAA,CACH;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAIR;"}
1
+ {"version":3,"file":"ReplayStepStrip.js","sources":["../../../src/components/ui/ReplayStepStrip.tsx"],"sourcesContent":["import {\n type CSSProperties,\n type KeyboardEvent,\n type ReactElement,\n type ReactNode,\n useEffect,\n useRef,\n useState,\n} from 'react';\n\nimport { type ChartColor, chartColorValue } from '../../lib/chart';\nimport { useStrings } from '../../locale';\nimport './ReplayStepStrip.css';\n\nexport interface ReplayStepStripItem {\n key: string;\n /** The step kind's colour, e.g. thinking, tool call, failure. */\n color: ChartColor;\n /** Names the step for screen readers and its tooltip, e.g. \"#12 · 验证\". */\n label: string;\n /** A step that changes the course (a check, a failure, the goal): taller. */\n emphasis?: boolean;\n /**\n * The bar's height as a share of the strip, 0 to 1, for a host that\n * grades its kinds more finely than `emphasis`; it wins over `emphasis`.\n */\n weight?: number;\n}\n\nexport interface ReplayStepStripProps {\n steps: ReplayStepStripItem[];\n /** The step shown elsewhere on the page; outlined. */\n currentIndex?: number;\n /**\n * Makes each step a button that selects it. Each step then stays wide\n * enough to tap, and a run too long for the width scrolls sideways.\n */\n onSelect?: (index: number) => void;\n /** Step indices of the key moments, numbered above the strip in order. */\n keyMoments?: number[];\n /** The tick label of a step under the strip. Defaults to `#n`. */\n formatStep?: (index: number) => ReactNode;\n /** A tick every this many steps; defaults to about five ticks. */\n tickEvery?: number;\n /** `sm` is a shorter strip without ticks, for a card or a list row. Defaults to `md`. */\n size?: 'md' | 'sm';\n /**\n * Draws a playhead this share of the way along the strip, 0 to 1, and\n * dims the steps past it, e.g. for a strip that plays as the page scrolls.\n */\n playhead?: number;\n className?: string;\n}\n\n/**\n * The steps that get a tick: the first, the last, and every `every`\n * steps between, leaving out one that would crowd the last.\n */\nfunction tickedSteps(count: number, every: number): Set<number> {\n const last = count - 1;\n const ticks = new Set<number>(count > 0 ? [0, last] : []);\n for (let index = every - 1; index < last; index += every) {\n if (last - index >= every / 2) {\n ticks.add(index);\n }\n }\n return ticks;\n}\n\n/**\n * Every step of a run as a bar coloured by its kind, with the key\n * moments numbered above it and step ticks below. With `onSelect`, a bar\n * selects its step; arrow keys move between steps with one tab stop.\n * Without `onSelect`, the gap between bars narrows as steps are added, so a\n * long run still draws every step in the width.\n */\nexport function ReplayStepStrip({\n steps,\n currentIndex,\n onSelect,\n keyMoments = [],\n formatStep = (index) => `#${String(index + 1)}`,\n tickEvery,\n size = 'md',\n playhead,\n className,\n}: ReplayStepStripProps): ReactElement {\n const strings = useStrings();\n const rootRef = useRef<HTMLDivElement>(null);\n const barsRef = useRef<HTMLDivElement>(null);\n const count = steps.length;\n const every = tickEvery ?? Math.max(1, Math.ceil(count / 20) * 5);\n const ticks = tickedSteps(count, every);\n const momentNumber = new Map(keyMoments.map((step, n) => [step, n + 1]));\n\n // The roving tab stop follows the current step, or the last step the\n // keyboard reached when the host does not mark one.\n const [ownFocus, setOwnFocus] = useState(0);\n const focusIndex = Math.min(currentIndex ?? ownFocus, Math.max(count - 1, 0));\n\n // A selectable strip may scroll; bring a current step the host moved out\n // of view back to the middle, without scrolling the page.\n const selectable = onSelect !== undefined;\n useEffect(() => {\n const root = rootRef.current;\n const bar =\n currentIndex === undefined\n ? null\n : barsRef.current?.children.item(currentIndex);\n if (!selectable || !root || !bar) {\n return;\n }\n const view = root.getBoundingClientRect();\n const step = bar.getBoundingClientRect();\n if (step.left < view.left || step.right > view.right) {\n root.scrollLeft +=\n step.left + step.width / 2 - (view.left + view.width / 2);\n }\n }, [selectable, currentIndex, count]);\n\n const onKeyDown = (event: KeyboardEvent<HTMLDivElement>): void => {\n if (!onSelect || count === 0) {\n return;\n }\n const target: Record<string, number> = {\n ArrowLeft: focusIndex - 1,\n ArrowRight: focusIndex + 1,\n Home: 0,\n End: count - 1,\n };\n if (!(event.key in target)) {\n return;\n }\n event.preventDefault();\n const next = Math.min(Math.max(target[event.key], 0), count - 1);\n setOwnFocus(next);\n onSelect(next);\n barsRef.current\n ?.querySelectorAll<HTMLButtonElement>('.aegis-replay-step-strip__step')\n .item(next)\n .focus();\n };\n\n const style = {\n '--aegis-replay-step-strip-count': Math.max(count, 1),\n ...(playhead === undefined\n ? {}\n : {\n '--aegis-replay-step-strip-head': playhead,\n '--aegis-replay-step-strip-head-step': playhead * count,\n }),\n } as CSSProperties;\n return (\n <div\n ref={rootRef}\n className={[\n 'aegis-replay-step-strip',\n `aegis-replay-step-strip--${size}`,\n selectable ? 'aegis-replay-step-strip--selectable' : '',\n playhead === undefined ? '' : 'aegis-replay-step-strip--playhead',\n className ?? '',\n ]\n .filter(Boolean)\n .join(' ')}\n style={style}\n >\n {keyMoments.length > 0 && (\n <div className=\"aegis-replay-step-strip__moments\" aria-hidden=\"true\">\n {steps.map((step, index) => {\n const n = momentNumber.get(index);\n return n === undefined ? (\n <span key={step.key} />\n ) : (\n <span\n key={step.key}\n className={[\n 'aegis-replay-step-strip__moment',\n index === currentIndex\n ? 'aegis-replay-step-strip__moment--current'\n : '',\n ]\n .filter(Boolean)\n .join(' ')}\n >\n {n}\n </span>\n );\n })}\n </div>\n )}\n <div\n ref={barsRef}\n className=\"aegis-replay-step-strip__bars\"\n role={onSelect ? 'toolbar' : 'list'}\n aria-label={strings.replaySteps}\n onKeyDown={onKeyDown}\n >\n {steps.map((step, index) => {\n const n = momentNumber.get(index);\n const label =\n n === undefined\n ? step.label\n : `${step.label} · ${strings.replayKeyMoment(n)}`;\n const barStyle = {\n '--aegis-replay-step-strip-color': chartColorValue(step.color),\n '--aegis-replay-step-strip-index': index,\n ...(step.weight === undefined\n ? {}\n : { height: `${(step.weight * 100).toString()}%` }),\n } as CSSProperties;\n const cls = [\n 'aegis-replay-step-strip__step',\n step.emphasis ? 'aegis-replay-step-strip__step--emphasis' : '',\n index === currentIndex\n ? 'aegis-replay-step-strip__step--current'\n : '',\n ]\n .filter(Boolean)\n .join(' ');\n return onSelect ? (\n <button\n key={step.key}\n type=\"button\"\n className={cls}\n style={barStyle}\n title={label}\n aria-label={label}\n aria-current={index === currentIndex ? 'step' : undefined}\n tabIndex={index === focusIndex ? 0 : -1}\n onClick={() => {\n setOwnFocus(index);\n onSelect(index);\n }}\n />\n ) : (\n <span\n key={step.key}\n role=\"listitem\"\n className={cls}\n style={barStyle}\n title={label}\n aria-label={label}\n aria-current={index === currentIndex ? 'step' : undefined}\n />\n );\n })}\n {playhead !== undefined && (\n <span\n className=\"aegis-replay-step-strip__head-track\"\n aria-hidden=\"true\"\n >\n <span className=\"aegis-replay-step-strip__head\" />\n </span>\n )}\n </div>\n {size === 'md' && (\n <div className=\"aegis-replay-step-strip__ticks\" aria-hidden=\"true\">\n {steps.map((step, index) => (\n <span\n key={step.key}\n className={\n index === count - 1 && count > 1\n ? 'aegis-replay-step-strip__tick aegis-replay-step-strip__tick--last'\n : 'aegis-replay-step-strip__tick'\n }\n >\n {ticks.has(index) ? formatStep(index) : null}\n </span>\n ))}\n </div>\n )}\n </div>\n );\n}\n"],"names":["tickedSteps","count","every","last","ticks","index","ReplayStepStrip","steps","currentIndex","onSelect","keyMoments","formatStep","tickEvery","size","playhead","className","strings","useStrings","rootRef","useRef","barsRef","momentNumber","step","n","ownFocus","setOwnFocus","useState","focusIndex","selectable","useEffect","root","bar","view","onKeyDown","event","target","next","style","jsxs","jsx","label","barStyle","chartColorValue","cls"],"mappings":";;;;;AA0DA,SAASA,EAAYC,GAAeC,GAA4B;AAC9D,QAAMC,IAAOF,IAAQ,GACfG,IAAQ,IAAI,IAAYH,IAAQ,IAAI,CAAC,GAAGE,CAAI,IAAI,EAAE;AACxD,WAASE,IAAQH,IAAQ,GAAGG,IAAQF,GAAME,KAASH;AACjD,IAAIC,IAAOE,KAASH,IAAQ,KAC1BE,EAAM,IAAIC,CAAK;AAGnB,SAAOD;AACT;AASO,SAASE,EAAgB;AAAA,EAC9B,OAAAC;AAAA,EACA,cAAAC;AAAA,EACA,UAAAC;AAAA,EACA,YAAAC,IAAa,CAAA;AAAA,EACb,YAAAC,IAAa,CAACN,MAAU,IAAI,OAAOA,IAAQ,CAAC,CAAC;AAAA,EAC7C,WAAAO;AAAA,EACA,MAAAC,IAAO;AAAA,EACP,UAAAC;AAAA,EACA,WAAAC;AACF,GAAuC;AACrC,QAAMC,IAAUC,EAAA,GACVC,IAAUC,EAAuB,IAAI,GACrCC,IAAUD,EAAuB,IAAI,GACrClB,IAAQM,EAAM,QACdL,IAAQU,KAAa,KAAK,IAAI,GAAG,KAAK,KAAKX,IAAQ,EAAE,IAAI,CAAC,GAC1DG,IAAQJ,EAAYC,GAAOC,CAAK,GAChCmB,IAAe,IAAI,IAAIX,EAAW,IAAI,CAACY,GAAMC,MAAM,CAACD,GAAMC,IAAI,CAAC,CAAC,CAAC,GAIjE,CAACC,GAAUC,CAAW,IAAIC,EAAS,CAAC,GACpCC,IAAa,KAAK,IAAInB,KAAgBgB,GAAU,KAAK,IAAIvB,IAAQ,GAAG,CAAC,CAAC,GAItE2B,IAAanB,MAAa;AAChC,EAAAoB,EAAU,MAAM;AACd,UAAMC,IAAOZ,EAAQ,SACfa,IACJvB,MAAiB,SACb,OACAY,EAAQ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;"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),n=require("react"),b=require("@ant-design/icons"),_=require("../../hooks/useResizable.cjs");;/* empty css */function O({children:d,side:l,defaultWidth:p=320,minWidth:g=200,maxWidth:f=800,persistKey:z,keyboardStep:h,constrainWidth:j,resetOnDoubleClick:x=!1,collapsible:t=!1,collapsed:s,onCollapsedChange:o,stackOnMobile:m=!1,className:C}){const[R,S]=n.useState(!1),r=s??R,i=n.useCallback(a=>{s===void 0&&S(a),o?.(a)},[s,o]),k=n.useCallback(()=>{t&&i(!0)},[t,i]),{width:q,handleProps:v,isDragging:y,reset:N}=_.useResizable({initialWidth:p,minWidth:g,maxWidth:f,side:l,persistKey:z,onCollapse:k,keyboardStep:h,constrainWidth:j}),c=["aegis-resizable-panel",`aegis-resizable-panel--${l}`,y?"aegis-resizable-panel--dragging":"",r?"aegis-resizable-panel--collapsed":"",m?"aegis-resizable-panel--stack-on-mobile":"",C??""].filter(Boolean).join(" ");if(r){const a=()=>{i(!1)};return e.jsx("button",{type:"button",className:c,onClick:a,"aria-label":"Expand panel",children:e.jsx("span",{className:"aegis-resizable-panel__collapse-icon",children:l==="left"?e.jsx(b.DoubleRightOutlined,{}):e.jsx(b.DoubleLeftOutlined,{})})})}const u=e.jsx("div",{...v,className:"aegis-resizable-handle","aria-label":"Resize panel",onDoubleClick:x?N:void 0}),D={"--aegis-resizable-panel-width":`${String(q)}px`};return e.jsxs("aside",{className:c,style:D,children:[l==="left"?null:u,e.jsx("div",{className:"aegis-resizable-panel__body",children:d}),l==="left"?u:null]})}exports.ResizableSidePanel=O;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),n=require("react"),d=require("@ant-design/icons"),_=require("../../hooks/useResizable.cjs");;/* empty css */const O=require("../../locale/useStrings.cjs");function w({children:g,side:s,defaultWidth:p=320,minWidth:f=200,maxWidth:z=800,persistKey:h,keyboardStep:j,constrainWidth:x,resetOnDoubleClick:m=!1,collapsible:t=!1,collapsed:a,onCollapsedChange:r,stackOnMobile:C=!1,className:S}){const o=O.useStrings(),[q,R]=n.useState(!1),c=a??q,i=n.useCallback(l=>{a===void 0&&R(l),r?.(l)},[a,r]),k=n.useCallback(()=>{t&&i(!0)},[t,i]),{width:v,handleProps:y,isDragging:N,reset:D}=_.useResizable({initialWidth:p,minWidth:f,maxWidth:z,side:s,persistKey:h,onCollapse:k,keyboardStep:j,constrainWidth:x}),u=["aegis-resizable-panel",`aegis-resizable-panel--${s}`,N?"aegis-resizable-panel--dragging":"",c?"aegis-resizable-panel--collapsed":"",C?"aegis-resizable-panel--stack-on-mobile":"",S??""].filter(Boolean).join(" ");if(c){const l=()=>{i(!1)};return e.jsx("button",{type:"button",className:u,onClick:l,"aria-label":o.expandPanel,children:e.jsx("span",{className:"aegis-resizable-panel__collapse-icon",children:s==="left"?e.jsx(d.DoubleRightOutlined,{}):e.jsx(d.DoubleLeftOutlined,{})})})}const b=e.jsx("div",{...y,className:"aegis-resizable-handle","aria-label":o.resizePanel,onDoubleClick:m?D:void 0}),P={"--aegis-resizable-panel-width":`${String(v)}px`};return e.jsxs("aside",{className:u,style:P,children:[s==="left"?null:b,e.jsx("div",{className:"aegis-resizable-panel__body",children:g}),s==="left"?b:null]})}exports.ResizableSidePanel=w;
2
2
  //# sourceMappingURL=ResizableSidePanel.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"ResizableSidePanel.cjs","sources":["../../../src/components/ui/ResizableSidePanel.tsx"],"sourcesContent":["import {\n type CSSProperties,\n type ReactNode,\n useCallback,\n useState,\n} from 'react';\n\nimport { DoubleLeftOutlined, DoubleRightOutlined } from '@ant-design/icons';\n\nimport { useResizable } from '../../hooks/useResizable';\nimport './ResizableSidePanel.css';\n\nexport interface ResizableSidePanelProps {\n children: ReactNode;\n /** Which edge of the parent the panel attaches to. */\n side: 'left' | 'right';\n /** Initial width in px. */\n defaultWidth?: number;\n minWidth?: number;\n maxWidth?: number;\n /** localStorage key to persist width across reloads. */\n persistKey?: string;\n /** Width change per arrow-key press on the handle, in px. */\n keyboardStep?: number;\n /**\n * Narrows a proposed width after the min/max clamp, e.g. to keep the\n * neighbouring content above its own minimum width.\n */\n constrainWidth?: (width: number) => number;\n /** Double-clicking the handle restores `defaultWidth`. */\n resetOnDoubleClick?: boolean;\n /** Whether the panel can be fully collapsed (rendered as a thin handle bar). */\n collapsible?: boolean;\n /** Controlled collapsed state. If omitted, internal state is used. */\n collapsed?: boolean;\n onCollapsedChange?: (collapsed: boolean) => void;\n /**\n * At ≤768 px, fill the parent's width with a bounded height and hide the\n * resize handle — for layouts that stack the panel above or below its\n * neighbour on narrow screens. The parent still owns the stacking\n * (e.g. `flex-direction: column`).\n */\n stackOnMobile?: boolean;\n /** Optional className appended to the root. */\n className?: string;\n}\n\nexport function ResizableSidePanel({\n children,\n side,\n defaultWidth = 320,\n minWidth = 200,\n maxWidth = 800,\n persistKey,\n keyboardStep,\n constrainWidth,\n resetOnDoubleClick = false,\n collapsible = false,\n collapsed: collapsedProp,\n onCollapsedChange,\n stackOnMobile = false,\n className,\n}: ResizableSidePanelProps) {\n const [internalCollapsed, setInternalCollapsed] = useState(false);\n const collapsed = collapsedProp ?? internalCollapsed;\n\n const setCollapsed = useCallback(\n (next: boolean) => {\n if (collapsedProp === undefined) {\n setInternalCollapsed(next);\n }\n onCollapsedChange?.(next);\n },\n [collapsedProp, onCollapsedChange],\n );\n\n const handleCollapse = useCallback(() => {\n if (collapsible) {\n setCollapsed(true);\n }\n }, [collapsible, setCollapsed]);\n\n const { width, handleProps, isDragging, reset } = useResizable({\n initialWidth: defaultWidth,\n minWidth,\n maxWidth,\n side,\n persistKey,\n onCollapse: handleCollapse,\n keyboardStep,\n constrainWidth,\n });\n\n const rootClass = [\n 'aegis-resizable-panel',\n `aegis-resizable-panel--${side}`,\n isDragging ? 'aegis-resizable-panel--dragging' : '',\n collapsed ? 'aegis-resizable-panel--collapsed' : '',\n stackOnMobile ? 'aegis-resizable-panel--stack-on-mobile' : '',\n className ?? '',\n ]\n .filter(Boolean)\n .join(' ');\n\n if (collapsed) {\n const expand = () => {\n setCollapsed(false);\n };\n return (\n <button\n type=\"button\"\n className={rootClass}\n onClick={expand}\n aria-label=\"Expand panel\"\n >\n <span className=\"aegis-resizable-panel__collapse-icon\">\n {side === 'left' ? <DoubleRightOutlined /> : <DoubleLeftOutlined />}\n </span>\n </button>\n );\n }\n\n const handle = (\n <div\n {...handleProps}\n className=\"aegis-resizable-handle\"\n aria-label=\"Resize panel\"\n onDoubleClick={resetOnDoubleClick ? reset : undefined}\n />\n );\n\n // A custom property rather than an inline width, so the stacked mobile\n // layout can override it from the stylesheet.\n const style = {\n '--aegis-resizable-panel-width': `${String(width)}px`,\n } as CSSProperties;\n\n return (\n <aside className={rootClass} style={style}>\n {side === 'left' ? null : handle}\n <div className=\"aegis-resizable-panel__body\">{children}</div>\n {side === 'left' ? handle : null}\n </aside>\n );\n}\n"],"names":["ResizableSidePanel","children","side","defaultWidth","minWidth","maxWidth","persistKey","keyboardStep","constrainWidth","resetOnDoubleClick","collapsible","collapsedProp","onCollapsedChange","stackOnMobile","className","internalCollapsed","setInternalCollapsed","useState","collapsed","setCollapsed","useCallback","next","handleCollapse","width","handleProps","isDragging","reset","useResizable","rootClass","expand","jsx","DoubleRightOutlined","DoubleLeftOutlined","handle","style","jsxs"],"mappings":"yPA+CO,SAASA,EAAmB,CACjC,SAAAC,EACA,KAAAC,EACA,aAAAC,EAAe,IACf,SAAAC,EAAW,IACX,SAAAC,EAAW,IACX,WAAAC,EACA,aAAAC,EACA,eAAAC,EACA,mBAAAC,EAAqB,GACrB,YAAAC,EAAc,GACd,UAAWC,EACX,kBAAAC,EACA,cAAAC,EAAgB,GAChB,UAAAC,CACF,EAA4B,CAC1B,KAAM,CAACC,EAAmBC,CAAoB,EAAIC,EAAAA,SAAS,EAAK,EAC1DC,EAAYP,GAAiBI,EAE7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A,CAAI,UAAU,8BAA+B,SAAA7B,CAAA,CAAS,EACtDC,IAAS,OAAS+B,EAAS,IAAA,EAC9B,CAEJ"}
1
+ {"version":3,"file":"ResizableSidePanel.cjs","sources":["../../../src/components/ui/ResizableSidePanel.tsx"],"sourcesContent":["import {\n type CSSProperties,\n type ReactNode,\n useCallback,\n useState,\n} from 'react';\n\nimport { DoubleLeftOutlined, DoubleRightOutlined } from '@ant-design/icons';\n\nimport { useResizable } from '../../hooks/useResizable';\nimport { useStrings } from '../../locale';\nimport './ResizableSidePanel.css';\n\nexport interface ResizableSidePanelProps {\n children: ReactNode;\n /** Which edge of the parent the panel attaches to. */\n side: 'left' | 'right';\n /** Initial width in px. */\n defaultWidth?: number;\n minWidth?: number;\n maxWidth?: number;\n /** localStorage key to persist width across reloads. */\n persistKey?: string;\n /** Width change per arrow-key press on the handle, in px. */\n keyboardStep?: number;\n /**\n * Narrows a proposed width after the min/max clamp, e.g. to keep the\n * neighbouring content above its own minimum width.\n */\n constrainWidth?: (width: number) => number;\n /** Double-clicking the handle restores `defaultWidth`. */\n resetOnDoubleClick?: boolean;\n /** Whether the panel can be fully collapsed (rendered as a thin handle bar). */\n collapsible?: boolean;\n /** Controlled collapsed state. If omitted, internal state is used. */\n collapsed?: boolean;\n onCollapsedChange?: (collapsed: boolean) => void;\n /**\n * At ≤768 px, fill the parent's width with a bounded height and hide the\n * resize handle — for layouts that stack the panel above or below its\n * neighbour on narrow screens. The parent still owns the stacking\n * (e.g. `flex-direction: column`).\n */\n stackOnMobile?: boolean;\n /** Optional className appended to the root. */\n className?: string;\n}\n\nexport function ResizableSidePanel({\n children,\n side,\n defaultWidth = 320,\n minWidth = 200,\n maxWidth = 800,\n persistKey,\n keyboardStep,\n constrainWidth,\n resetOnDoubleClick = false,\n collapsible = false,\n collapsed: collapsedProp,\n onCollapsedChange,\n stackOnMobile = false,\n className,\n}: ResizableSidePanelProps) {\n const strings = useStrings();\n const [internalCollapsed, setInternalCollapsed] = useState(false);\n const collapsed = collapsedProp ?? internalCollapsed;\n\n const setCollapsed = useCallback(\n (next: boolean) => {\n if (collapsedProp === undefined) {\n setInternalCollapsed(next);\n }\n onCollapsedChange?.(next);\n },\n [collapsedProp, onCollapsedChange],\n );\n\n const handleCollapse = useCallback(() => {\n if (collapsible) {\n setCollapsed(true);\n }\n }, [collapsible, setCollapsed]);\n\n const { width, handleProps, isDragging, reset } = useResizable({\n initialWidth: defaultWidth,\n minWidth,\n maxWidth,\n side,\n persistKey,\n onCollapse: handleCollapse,\n keyboardStep,\n constrainWidth,\n });\n\n const rootClass = [\n 'aegis-resizable-panel',\n `aegis-resizable-panel--${side}`,\n isDragging ? 'aegis-resizable-panel--dragging' : '',\n collapsed ? 'aegis-resizable-panel--collapsed' : '',\n stackOnMobile ? 'aegis-resizable-panel--stack-on-mobile' : '',\n className ?? '',\n ]\n .filter(Boolean)\n .join(' ');\n\n if (collapsed) {\n const expand = () => {\n setCollapsed(false);\n };\n return (\n <button\n type=\"button\"\n className={rootClass}\n onClick={expand}\n aria-label={strings.expandPanel}\n >\n <span className=\"aegis-resizable-panel__collapse-icon\">\n {side === 'left' ? <DoubleRightOutlined /> : <DoubleLeftOutlined />}\n </span>\n </button>\n );\n }\n\n const handle = (\n <div\n {...handleProps}\n className=\"aegis-resizable-handle\"\n aria-label={strings.resizePanel}\n onDoubleClick={resetOnDoubleClick ? reset : undefined}\n />\n );\n\n // A custom property rather than an inline width, so the stacked mobile\n // layout can override it from the stylesheet.\n const style = {\n '--aegis-resizable-panel-width': `${String(width)}px`,\n } as CSSProperties;\n\n return (\n <aside className={rootClass} style={style}>\n {side === 'left' ? null : handle}\n <div className=\"aegis-resizable-panel__body\">{children}</div>\n {side === 'left' ? handle : null}\n </aside>\n );\n}\n"],"names":["ResizableSidePanel","children","side","defaultWidth","minWidth","maxWidth","persistKey","keyboardStep","constrainWidth","resetOnDoubleClick","collapsible","collapsedProp","onCollapsedChange","stackOnMobile","className","strings","useStrings","internalCollapsed","setInternalCollapsed","useState","collapsed","setCollapsed","useCallback","next","handleCollapse","width","handleProps","isDragging","reset","useResizable","rootClass","expand","jsx","DoubleRightOutlined","DoubleLeftOutlined","handle","style","jsxs"],"mappings":"wSAgDO,SAASA,EAAmB,CACjC,SAAAC,EACA,KAAAC,EACA,aAAAC,EAAe,IACf,SAAAC,EAAW,IACX,SAAAC,EAAW,IACX,WAAAC,EACA,aAAAC,EACA,eAAAC,EACA,mBAAAC,EAAqB,GACrB,YAAAC,EAAc,GACd,UAAWC,EACX,kBAAAC,EACA,cAAAC,EAAgB,GAChB,UAAAC,CACF,EAA4B,CAC1B,MAAMC,EAAUC,EAAAA,WAAA,EACV,CAACC,EAAmBC,CAAoB,EAAIC,EAAAA,SAAS,EAAK,EAC1DC,EAAYT,GAAiBM,EAE7BI,EAAeC,EAAAA,YAClBC,GAAkB,CACbZ,IAAkB,QACpBO,EAAqBK,CAAI,EAE3BX,IAAoBW,CAAI,CAC1B,EACA,CAACZ,EAAeC,CAAiB,CAAA,EAG7BY,EAAiBF,EAAAA,YAAY,IAAM,CACnCZ,GACFW,EAAa,EAAI,CAErB,EAAG,CAACX,EAAaW,CAAY,CAAC,EAExB,CAAE,MAAAI,EAAO,YAAAC,EAAa,WAAAC,EAAY,MAAAC,CAAA,EAAUC,EAAAA,aAAa,CAC7D,aAAc1B,EACd,SAAAC,EACA,SAAAC,EACA,KAAAH,EACA,WAAAI,EACA,WAAYkB,EACZ,aAAAjB,EACA,eAAAC,CAAA,CACD,EAEKsB,EAAY,CAChB,wBACA,0BAA0B5B,CAAI,GAC9ByB,EAAa,kCAAoC,GACjDP,EAAY,mCAAqC,GACjDP,EAAgB,yCAA2C,GAC3DC,GAAa,EAAA,EAEZ,OAAO,OAAO,EACd,KAAK,GAAG,EAEX,GAAIM,EAAW,CACb,MAAMW,EAAS,IAAM,CACnBV,EAAa,EAAK,CACpB,EACA,OACEW,EAAAA,IAAC,SAAA,CACC,KAAK,SACL,UAAWF,EACX,QAASC,EACT,aAAYhB,EAAQ,YAEpB,SAAAiB,EAAAA,IAAC,OAAA,CAAK,UAAU,uCACb,SAAA9B,IAAS,OAAS8B,EAAAA,IAACC,EAAAA,oBAAA,CAAA,CAAoB,EAAKD,EAAAA,IAACE,EAAAA,mBAAA,CAAA,CAAmB,CAAA,CACnE,CAAA,CAAA,CAGN,CAEA,MAAMC,EACJH,EAAAA,IAAC,MAAA,CACE,GAAGN,EACJ,UAAU,yBACV,aAAYX,EAAQ,YACpB,cAAeN,EAAqBmB,EAAQ,MAAA,CAAA,EAM1CQ,EAAQ,CACZ,gCAAiC,GAAG,OAAOX,CAAK,CAAC,IAAA,EAGnD,OACEY,EAAAA,KAAC,QAAA,CAAM,UAAWP,EAAW,MAAAM,EAC1B,SAAA,CAAAlC,IAAS,OAAS,KAAOiC,EAC1BH,EAAAA,IAAC,MAAA,CAAI,UAAU,8BAA+B,SAAA/B,CAAA,CAAS,EACtDC,IAAS,OAASiC,EAAS,IAAA,EAC9B,CAEJ"}
@@ -1,79 +1,80 @@
1
- import { jsx as e, jsxs as S } from "react/jsx-runtime";
2
- import { useState as w, useCallback as c } from "react";
3
- import { DoubleRightOutlined as O, DoubleLeftOutlined as $ } from "@ant-design/icons";
1
+ import { jsx as e, jsxs as w } from "react/jsx-runtime";
2
+ import { useState as O, useCallback as d } from "react";
3
+ import { DoubleRightOutlined as P, DoubleLeftOutlined as $ } from "@ant-design/icons";
4
4
  import { useResizable as B } from "../../hooks/useResizable.js";
5
5
  /* empty css */
6
- function A({
7
- children: d,
6
+ import { useStrings as I } from "../../locale/useStrings.js";
7
+ function G({
8
+ children: b,
8
9
  side: a,
9
- defaultWidth: b = 320,
10
- minWidth: f = 200,
11
- maxWidth: g = 800,
10
+ defaultWidth: f = 320,
11
+ minWidth: g = 200,
12
+ maxWidth: m = 800,
12
13
  persistKey: u,
13
- keyboardStep: m,
14
- constrainWidth: z,
15
- resetOnDoubleClick: h = !1,
14
+ keyboardStep: z,
15
+ constrainWidth: h,
16
+ resetOnDoubleClick: C = !1,
16
17
  collapsible: n = !1,
17
18
  collapsed: l,
18
19
  onCollapsedChange: t,
19
- stackOnMobile: C = !1,
20
- className: x
20
+ stackOnMobile: x = !1,
21
+ className: N
21
22
  }) {
22
- const [N, k] = w(!1), o = l ?? N, s = c(
23
+ const o = I(), [k, v] = O(!1), r = l ?? k, s = d(
23
24
  (i) => {
24
- l === void 0 && k(i), t?.(i);
25
+ l === void 0 && v(i), t?.(i);
25
26
  },
26
27
  [l, t]
27
- ), v = c(() => {
28
+ ), D = d(() => {
28
29
  n && s(!0);
29
- }, [n, s]), { width: D, handleProps: R, isDragging: _, reset: j } = B({
30
- initialWidth: b,
31
- minWidth: f,
32
- maxWidth: g,
30
+ }, [n, s]), { width: S, handleProps: _, isDragging: j, reset: y } = B({
31
+ initialWidth: f,
32
+ minWidth: g,
33
+ maxWidth: m,
33
34
  side: a,
34
35
  persistKey: u,
35
- onCollapse: v,
36
- keyboardStep: m,
37
- constrainWidth: z
38
- }), r = [
36
+ onCollapse: D,
37
+ keyboardStep: z,
38
+ constrainWidth: h
39
+ }), c = [
39
40
  "aegis-resizable-panel",
40
41
  `aegis-resizable-panel--${a}`,
41
- _ ? "aegis-resizable-panel--dragging" : "",
42
- o ? "aegis-resizable-panel--collapsed" : "",
43
- C ? "aegis-resizable-panel--stack-on-mobile" : "",
44
- x ?? ""
42
+ j ? "aegis-resizable-panel--dragging" : "",
43
+ r ? "aegis-resizable-panel--collapsed" : "",
44
+ x ? "aegis-resizable-panel--stack-on-mobile" : "",
45
+ N ?? ""
45
46
  ].filter(Boolean).join(" ");
46
- if (o)
47
+ if (r)
47
48
  return /* @__PURE__ */ e(
48
49
  "button",
49
50
  {
50
51
  type: "button",
51
- className: r,
52
+ className: c,
52
53
  onClick: () => {
53
54
  s(!1);
54
55
  },
55
- "aria-label": "Expand panel",
56
- children: /* @__PURE__ */ e("span", { className: "aegis-resizable-panel__collapse-icon", children: a === "left" ? /* @__PURE__ */ e(O, {}) : /* @__PURE__ */ e($, {}) })
56
+ "aria-label": o.expandPanel,
57
+ children: /* @__PURE__ */ e("span", { className: "aegis-resizable-panel__collapse-icon", children: a === "left" ? /* @__PURE__ */ e(P, {}) : /* @__PURE__ */ e($, {}) })
57
58
  }
58
59
  );
59
60
  const p = /* @__PURE__ */ e(
60
61
  "div",
61
62
  {
62
- ...R,
63
+ ..._,
63
64
  className: "aegis-resizable-handle",
64
- "aria-label": "Resize panel",
65
- onDoubleClick: h ? j : void 0
65
+ "aria-label": o.resizePanel,
66
+ onDoubleClick: C ? y : void 0
66
67
  }
67
- ), y = {
68
- "--aegis-resizable-panel-width": `${String(D)}px`
68
+ ), R = {
69
+ "--aegis-resizable-panel-width": `${String(S)}px`
69
70
  };
70
- return /* @__PURE__ */ S("aside", { className: r, style: y, children: [
71
+ return /* @__PURE__ */ w("aside", { className: c, style: R, children: [
71
72
  a === "left" ? null : p,
72
- /* @__PURE__ */ e("div", { className: "aegis-resizable-panel__body", children: d }),
73
+ /* @__PURE__ */ e("div", { className: "aegis-resizable-panel__body", children: b }),
73
74
  a === "left" ? p : null
74
75
  ] });
75
76
  }
76
77
  export {
77
- A as ResizableSidePanel
78
+ G as ResizableSidePanel
78
79
  };
79
80
  //# sourceMappingURL=ResizableSidePanel.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ResizableSidePanel.js","sources":["../../../src/components/ui/ResizableSidePanel.tsx"],"sourcesContent":["import {\n type CSSProperties,\n type ReactNode,\n useCallback,\n useState,\n} from 'react';\n\nimport { DoubleLeftOutlined, DoubleRightOutlined } from '@ant-design/icons';\n\nimport { useResizable } from '../../hooks/useResizable';\nimport './ResizableSidePanel.css';\n\nexport interface ResizableSidePanelProps {\n children: ReactNode;\n /** Which edge of the parent the panel attaches to. */\n side: 'left' | 'right';\n /** Initial width in px. */\n defaultWidth?: number;\n minWidth?: number;\n maxWidth?: number;\n /** localStorage key to persist width across reloads. */\n persistKey?: string;\n /** Width change per arrow-key press on the handle, in px. */\n keyboardStep?: number;\n /**\n * Narrows a proposed width after the min/max clamp, e.g. to keep the\n * neighbouring content above its own minimum width.\n */\n constrainWidth?: (width: number) => number;\n /** Double-clicking the handle restores `defaultWidth`. */\n resetOnDoubleClick?: boolean;\n /** Whether the panel can be fully collapsed (rendered as a thin handle bar). */\n collapsible?: boolean;\n /** Controlled collapsed state. If omitted, internal state is used. */\n collapsed?: boolean;\n onCollapsedChange?: (collapsed: boolean) => void;\n /**\n * At ≤768 px, fill the parent's width with a bounded height and hide the\n * resize handle — for layouts that stack the panel above or below its\n * neighbour on narrow screens. The parent still owns the stacking\n * (e.g. `flex-direction: column`).\n */\n stackOnMobile?: boolean;\n /** Optional className appended to the root. */\n className?: string;\n}\n\nexport function ResizableSidePanel({\n children,\n side,\n defaultWidth = 320,\n minWidth = 200,\n maxWidth = 800,\n persistKey,\n keyboardStep,\n constrainWidth,\n resetOnDoubleClick = false,\n collapsible = false,\n collapsed: collapsedProp,\n onCollapsedChange,\n stackOnMobile = false,\n className,\n}: ResizableSidePanelProps) {\n const [internalCollapsed, setInternalCollapsed] = useState(false);\n const collapsed = collapsedProp ?? internalCollapsed;\n\n const setCollapsed = useCallback(\n (next: boolean) => {\n if (collapsedProp === undefined) {\n setInternalCollapsed(next);\n }\n onCollapsedChange?.(next);\n },\n [collapsedProp, onCollapsedChange],\n );\n\n const handleCollapse = useCallback(() => {\n if (collapsible) {\n setCollapsed(true);\n }\n }, [collapsible, setCollapsed]);\n\n const { width, handleProps, isDragging, reset } = useResizable({\n initialWidth: defaultWidth,\n minWidth,\n maxWidth,\n side,\n persistKey,\n onCollapse: handleCollapse,\n keyboardStep,\n constrainWidth,\n });\n\n const rootClass = [\n 'aegis-resizable-panel',\n `aegis-resizable-panel--${side}`,\n isDragging ? 'aegis-resizable-panel--dragging' : '',\n collapsed ? 'aegis-resizable-panel--collapsed' : '',\n stackOnMobile ? 'aegis-resizable-panel--stack-on-mobile' : '',\n className ?? '',\n ]\n .filter(Boolean)\n .join(' ');\n\n if (collapsed) {\n const expand = () => {\n setCollapsed(false);\n };\n return (\n <button\n type=\"button\"\n className={rootClass}\n onClick={expand}\n aria-label=\"Expand panel\"\n >\n <span className=\"aegis-resizable-panel__collapse-icon\">\n {side === 'left' ? <DoubleRightOutlined /> : <DoubleLeftOutlined />}\n </span>\n </button>\n );\n }\n\n const handle = (\n <div\n {...handleProps}\n className=\"aegis-resizable-handle\"\n aria-label=\"Resize panel\"\n onDoubleClick={resetOnDoubleClick ? reset : undefined}\n />\n );\n\n // A custom property rather than an inline width, so the stacked mobile\n // layout can override it from the stylesheet.\n const style = {\n '--aegis-resizable-panel-width': `${String(width)}px`,\n } as CSSProperties;\n\n return (\n <aside className={rootClass} style={style}>\n {side === 'left' ? null : handle}\n <div className=\"aegis-resizable-panel__body\">{children}</div>\n {side === 'left' ? handle : null}\n </aside>\n );\n}\n"],"names":["ResizableSidePanel","children","side","defaultWidth","minWidth","maxWidth","persistKey","keyboardStep","constrainWidth","resetOnDoubleClick","collapsible","collapsedProp","onCollapsedChange","stackOnMobile","className","internalCollapsed","setInternalCollapsed","useState","collapsed","setCollapsed","useCallback","next","handleCollapse","width","handleProps","isDragging","reset","useResizable","rootClass","jsx","DoubleRightOutlined","DoubleLeftOutlined","handle","style","jsxs"],"mappings":";;;;;AA+CO,SAASA,EAAmB;AAAA,EACjC,UAAAC;AAAA,EACA,MAAAC;AAAA,EACA,cAAAC,IAAe;AAAA,EACf,UAAAC,IAAW;AAAA,EACX,UAAAC,IAAW;AAAA,EACX,YAAAC;AAAA,EACA,cAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,oBAAAC,IAAqB;AAAA,EACrB,aAAAC,IAAc;AAAA,EACd,WAAWC;AAAA,EACX,mBAAAC;AAAA,EACA,eAAAC,IAAgB;AAAA,EAChB,WAAAC;AACF,GAA4B;AAC1B,QAAM,CAACC,GAAmBC,CAAoB,IAAIC,EAAS,EAAK,GAC1DC,IAAYP,KAAiBI,GAE7BI,IAAeC;AAAA,IACnB,CAACC,MAAk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AAiC,GAAG,OAAOV,CAAK,CAAC;AAAA,EAAA;AAGnD,SACE,gBAAAW,EAAC,SAAA,EAAM,WAAWN,GAAW,OAAAK,GAC1B,UAAA;AAAA,IAAA/B,MAAS,SAAS,OAAO8B;AAAA,IAC1B,gBAAAH,EAAC,OAAA,EAAI,WAAU,+BAA+B,UAAA5B,EAAA,CAAS;AAAA,IACtDC,MAAS,SAAS8B,IAAS;AAAA,EAAA,GAC9B;AAEJ;"}
1
+ {"version":3,"file":"ResizableSidePanel.js","sources":["../../../src/components/ui/ResizableSidePanel.tsx"],"sourcesContent":["import {\n type CSSProperties,\n type ReactNode,\n useCallback,\n useState,\n} from 'react';\n\nimport { DoubleLeftOutlined, DoubleRightOutlined } from '@ant-design/icons';\n\nimport { useResizable } from '../../hooks/useResizable';\nimport { useStrings } from '../../locale';\nimport './ResizableSidePanel.css';\n\nexport interface ResizableSidePanelProps {\n children: ReactNode;\n /** Which edge of the parent the panel attaches to. */\n side: 'left' | 'right';\n /** Initial width in px. */\n defaultWidth?: number;\n minWidth?: number;\n maxWidth?: number;\n /** localStorage key to persist width across reloads. */\n persistKey?: string;\n /** Width change per arrow-key press on the handle, in px. */\n keyboardStep?: number;\n /**\n * Narrows a proposed width after the min/max clamp, e.g. to keep the\n * neighbouring content above its own minimum width.\n */\n constrainWidth?: (width: number) => number;\n /** Double-clicking the handle restores `defaultWidth`. */\n resetOnDoubleClick?: boolean;\n /** Whether the panel can be fully collapsed (rendered as a thin handle bar). */\n collapsible?: boolean;\n /** Controlled collapsed state. If omitted, internal state is used. */\n collapsed?: boolean;\n onCollapsedChange?: (collapsed: boolean) => void;\n /**\n * At ≤768 px, fill the parent's width with a bounded height and hide the\n * resize handle — for layouts that stack the panel above or below its\n * neighbour on narrow screens. The parent still owns the stacking\n * (e.g. `flex-direction: column`).\n */\n stackOnMobile?: boolean;\n /** Optional className appended to the root. */\n className?: string;\n}\n\nexport function ResizableSidePanel({\n children,\n side,\n defaultWidth = 320,\n minWidth = 200,\n maxWidth = 800,\n persistKey,\n keyboardStep,\n constrainWidth,\n resetOnDoubleClick = false,\n collapsible = false,\n collapsed: collapsedProp,\n onCollapsedChange,\n stackOnMobile = false,\n className,\n}: ResizableSidePanelProps) {\n const strings = useStrings();\n const [internalCollapsed, setInternalCollapsed] = useState(false);\n const collapsed = collapsedProp ?? internalCollapsed;\n\n const setCollapsed = useCallback(\n (next: boolean) => {\n if (collapsedProp === undefined) {\n setInternalCollapsed(next);\n }\n onCollapsedChange?.(next);\n },\n [collapsedProp, onCollapsedChange],\n );\n\n const handleCollapse = useCallback(() => {\n if (collapsible) {\n setCollapsed(true);\n }\n }, [collapsible, setCollapsed]);\n\n const { width, handleProps, isDragging, reset } = useResizable({\n initialWidth: defaultWidth,\n minWidth,\n maxWidth,\n side,\n persistKey,\n onCollapse: handleCollapse,\n keyboardStep,\n constrainWidth,\n });\n\n const rootClass = [\n 'aegis-resizable-panel',\n `aegis-resizable-panel--${side}`,\n isDragging ? 'aegis-resizable-panel--dragging' : '',\n collapsed ? 'aegis-resizable-panel--collapsed' : '',\n stackOnMobile ? 'aegis-resizable-panel--stack-on-mobile' : '',\n className ?? '',\n ]\n .filter(Boolean)\n .join(' ');\n\n if (collapsed) {\n const expand = () => {\n setCollapsed(false);\n };\n return (\n <button\n type=\"button\"\n className={rootClass}\n onClick={expand}\n aria-label={strings.expandPanel}\n >\n <span className=\"aegis-resizable-panel__collapse-icon\">\n {side === 'left' ? <DoubleRightOutlined /> : <DoubleLeftOutlined />}\n </span>\n </button>\n );\n }\n\n const handle = (\n <div\n {...handleProps}\n className=\"aegis-resizable-handle\"\n aria-label={strings.resizePanel}\n onDoubleClick={resetOnDoubleClick ? reset : undefined}\n />\n );\n\n // A custom property rather than an inline width, so the stacked mobile\n // layout can override it from the stylesheet.\n const style = {\n '--aegis-resizable-panel-width': `${String(width)}px`,\n } as CSSProperties;\n\n return (\n <aside className={rootClass} style={style}>\n {side === 'left' ? null : handle}\n <div className=\"aegis-resizable-panel__body\">{children}</div>\n {side === 'left' ? handle : null}\n </aside>\n );\n}\n"],"names":["ResizableSidePanel","children","side","defaultWidth","minWidth","maxWidth","persistKey","keyboardStep","constrainWidth","resetOnDoubleClick","collapsible","collapsedProp","onCollapsedChange","stackOnMobile","className","strings","useStrings","internalCollapsed","setInternalCollapsed","useState","collapsed","setCollapsed","useCallback","next","handleCollapse","width","handleProps","isDragging","reset","useResizable","rootClass","jsx","DoubleRightOutlined","DoubleLeftOutlined","handle","style","jsxs"],"mappings":";;;;;;AAgDO,SAASA,EAAmB;AAAA,EACjC,UAAAC;AAAA,EACA,MAAAC;AAAA,EACA,cAAAC,IAAe;AAAA,EACf,UAAAC,IAAW;AAAA,EACX,UAAAC,IAAW;AAAA,EACX,YAAAC;AAAA,EACA,cAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,oBAAAC,IAAqB;AAAA,EACrB,aAAAC,IAAc;AAAA,EACd,WAAWC;AAAA,EACX,mBAAAC;AAAA,EACA,eAAAC,IAAgB;AAAA,EAChB,WAAAC;AACF,GAA4B;AAC1B,QAAMC,IAAUC,EAAA,GACV,CAACC,GAAmBC,CAAoB,IAAIC,EAAS,EAAK,GAC1DC,IAAYT,KAAiBM,GAE7BI,IAAeC;AAAA,IACnB,CAACC,MAAkB;AACjB,MAAIZ,MAAkB,UACpBO,EAAqBK,CAAI,GAE3BX,IAAoBW,CAAI;AAAA,IAC1B;AAAA,IACA,CAACZ,GAAeC,CAAiB;AAAA,EAAA,GAG7BY,IAAiBF,EAAY,MAAM;AACvC,IAAIZ,KACFW,EAAa,EAAI;AAAA,EAErB,GAAG,CAACX,GAAaW,CAAY,CAAC,GAExB,EAAE,OAAAI,GAAO,aAAAC,GAAa,YAAAC,GAAY,OAAAC,EAAA,IAAUC,EAAa;AAAA,IAC7D,cAAc1B;AAAA,IACd,UAAAC;AAAA,IACA,UAAAC;AAAA,IACA,MAAAH;AAAA,IACA,YAAAI;AAAA,IACA,YAAYkB;AAAA,IACZ,cAAAjB;AAAA,IACA,gBAAAC;AAAA,EAAA,CACD,GAEKsB,IAAY;AAAA,IAChB;AAAA,IACA,0BAA0B5B,CAAI;AAAA,IAC9ByB,IAAa,oCAAoC;AAAA,IACjDP,IAAY,qCAAqC;AAAA,IACjDP,IAAgB,2CAA2C;AAAA,IAC3DC,KAAa;AAAA,EAAA,EAEZ,OAAO,OAAO,EACd,KAAK,GAAG;AAEX,MAAIM;AAIF,WACE,gBAAAW;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,MAAK;AAAA,QACL,WAAWD;AAAA,QACX,SAPW,MAAM;AACnB,UAAAT,EAAa,EAAK;AAAA,QACpB;AAAA,QAMI,cAAYN,EAAQ;AAAA,QAEpB,UAAA,gBAAAgB,EAAC,QAAA,EAAK,WAAU,wCACb,UAAA7B,MAAS,SAAS,gBAAA6B,EAACC,GAAA,CAAA,CAAoB,IAAK,gBAAAD,EAACE,GAAA,CAAA,CAAmB,EAAA,CACnE;AAAA,MAAA;AAAA,IAAA;AAKN,QAAMC,IACJ,gBAAAH;AAAA,IAAC;AAAA,IAAA;AAAA,MACE,GAAGL;AAAA,MACJ,WAAU;AAAA,MACV,cAAYX,EAAQ;AAAA,MACpB,eAAeN,IAAqBmB,IAAQ;AAAA,IAAA;AAAA,EAAA,GAM1CO,IAAQ;AAAA,IACZ,iCAAiC,GAAG,OAAOV,CAAK,CAAC;AAAA,EAAA;AAGnD,SACE,gBAAAW,EAAC,SAAA,EAAM,WAAWN,GAAW,OAAAK,GAC1B,UAAA;AAAA,IAAAjC,MAAS,SAAS,OAAOgC;AAAA,IAC1B,gBAAAH,EAAC,OAAA,EAAI,WAAU,+BAA+B,UAAA9B,EAAA,CAAS;AAAA,IACtDC,MAAS,SAASgC,IAAS;AAAA,EAAA,GAC9B;AAEJ;"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),c=require("react"),g=require("@ant-design/icons"),h=require("antd");;/* empty css */function q({queries:s,currentValue:i,onApply:l,onSave:n,onRename:o,onRemove:t,onTogglePinned:r,allowEmptySave:a=!1,className:u,maxInlineUnpinned:b=6}){const{pinned:_,inlineUnpinned:d,overflow:p}=c.useMemo(()=>{const m=s.filter(f=>f.pinned),v=s.filter(f=>!f.pinned);return{pinned:m,inlineUnpinned:v.slice(0,b),overflow:v.slice(b)}},[s,b]),x=!a&&i.trim()==="",N=["aegis-sqb",u??""].filter(Boolean).join(" ");return e.jsxs("div",{className:N,role:"toolbar","aria-label":"Saved queries",children:[s.length===0?e.jsx("span",{className:"aegis-sqb__hint",children:"No saved queries yet — save the current view to pin it."}):e.jsxs("ul",{className:"aegis-sqb__list",children:[_.map(m=>e.jsx(j,{query:m,onApply:l,onRename:o,onRemove:t,onTogglePinned:r},m.id)),d.map(m=>e.jsx(j,{query:m,onApply:l,onRename:o,onRemove:t,onTogglePinned:r},m.id)),p.length>0?e.jsx(C,{items:p,onApply:l,onRemove:t,onTogglePinned:r}):null]}),e.jsx(O,{disabled:x,currentValue:i,onSave:m=>{n(m,i)}})]})}function j({query:s,onApply:i,onRename:l,onRemove:n,onTogglePinned:o}){const[t,r]=c.useState(!1),[a,u]=c.useState(!1),b=()=>{t||i(s)},_=p=>{p.preventDefault(),u(!0)},d=e.jsx(w,{query:s,onRename:()=>{u(!1),r(!0)},onTogglePinned:()=>{u(!1),o(s.id)},onRemove:()=>{u(!1),n(s.id)}});return e.jsx("li",{className:"aegis-sqb__item",onContextMenu:_,children:t?e.jsx(S,{initialName:s.name,onSubmit:p=>{l(s.id,p),r(!1)},onCancel:()=>{r(!1)}}):e.jsxs(e.Fragment,{children:[e.jsxs("button",{type:"button",className:"aegis-sqb__chip",onClick:b,title:s.value,children:[s.pinned?e.jsx(g.StarFilled,{className:"aegis-sqb__chip-star aegis-sqb__chip-star--on","aria-hidden":!0}):null,e.jsx("span",{className:"aegis-sqb__chip-label",children:s.name})]}),e.jsx(h.Popover,{content:d,trigger:"click",open:a,onOpenChange:u,placement:"bottomRight",arrow:!1,classNames:{root:"aegis-sqb__popover"},destroyOnHidden:!0,children:e.jsx("button",{type:"button",className:"aegis-sqb__menu-trigger","aria-label":`Options for ${s.name}`,children:e.jsx(g.EllipsisOutlined,{"aria-hidden":!0})})})]})})}function w({query:s,onRename:i,onTogglePinned:l,onRemove:n}){return e.jsxs("div",{className:"aegis-sqb__menu",role:"menu",children:[e.jsx("button",{type:"button",role:"menuitem",className:"aegis-sqb__menu-item",onClick:i,children:"Rename"}),e.jsx("button",{type:"button",role:"menuitem",className:"aegis-sqb__menu-item",onClick:l,children:s.pinned?"Unpin":"Pin"}),e.jsx("button",{type:"button",role:"menuitem",className:"aegis-sqb__menu-item aegis-sqb__menu-item--danger",onClick:n,children:"Delete"})]})}function S({initialName:s,onSubmit:i,onCancel:l}){const[n,o]=c.useState(s),t=c.useRef(null);c.useEffect(()=>{t.current?.focus(),t.current?.select()},[]);const r=a=>{a.key==="Enter"?(a.preventDefault(),n.trim()!==""?i(n):l()):a.key==="Escape"&&(a.preventDefault(),l())};return e.jsx("input",{ref:t,type:"text",className:"aegis-sqb__rename-input",value:n,onChange:a=>{o(a.target.value)},onKeyDown:r,onBlur:()=>{n.trim()!==""&&n!==s?i(n):l()},"aria-label":"Rename saved query"})}function C({items:s,onApply:i,onRemove:l,onTogglePinned:n}){const[o,t]=c.useState(!1),r=e.jsx("div",{className:"aegis-sqb__menu aegis-sqb__menu--overflow",role:"menu",children:s.map(a=>e.jsx(y,{query:a,onApply:()=>{t(!1),i(a)},onRemove:l,onTogglePinned:n},a.id))});return e.jsx("li",{className:"aegis-sqb__item",children:e.jsx(h.Popover,{content:r,trigger:"click",open:o,onOpenChange:t,placement:"bottomRight",arrow:!1,classNames:{root:"aegis-sqb__popover"},destroyOnHidden:!0,children:e.jsxs("button",{type:"button",className:"aegis-sqb__chip aegis-sqb__chip--ghost",children:["+",s.length.toString()," more"]})})})}function y({query:s,onApply:i,onRemove:l,onTogglePinned:n}){return e.jsxs("div",{className:"aegis-sqb__overflow-row",children:[e.jsx("button",{type:"button",role:"menuitem",className:"aegis-sqb__menu-item aegis-sqb__overflow-apply",onClick:i,title:s.value,children:s.name}),e.jsx("button",{type:"button",className:"aegis-sqb__overflow-icon",onClick:()=>{n(s.id)},"aria-label":s.pinned?"Unpin":"Pin",children:s.pinned?e.jsx(g.StarFilled,{"aria-hidden":!0}):e.jsx(g.StarOutlined,{"aria-hidden":!0})}),e.jsx("button",{type:"button",className:"aegis-sqb__overflow-icon aegis-sqb__overflow-icon--danger",onClick:()=>{l(s.id)},"aria-label":`Delete ${s.name}`,children:"×"})]})}function O({disabled:s,currentValue:i,onSave:l}){const[n,o]=c.useState(!1),[t,r]=c.useState(""),a=c.useRef(null),u=c.useId();c.useEffect(()=>{if(n){r(i.slice(0,32));const d=window.setTimeout(()=>{a.current?.focus(),a.current?.select()},0);return()=>{window.clearTimeout(d)}}},[n,i]);const b=d=>{d.preventDefault(),t.trim()!==""&&(l(t),o(!1),r(""))},_=e.jsxs("form",{className:"aegis-sqb__save-form",onSubmit:b,children:[e.jsx("label",{className:"aegis-sqb__save-label",htmlFor:u,children:"Name this query"}),e.jsx("input",{id:u,ref:a,type:"text",className:"aegis-sqb__save-input",value:t,onChange:d=>{r(d.target.value)},placeholder:"e.g. failed runs last 24h"}),e.jsxs("div",{className:"aegis-sqb__save-actions",children:[e.jsx("button",{type:"button",className:"aegis-sqb__save-cancel",onClick:()=>{o(!1)},children:"Cancel"}),e.jsx("button",{type:"submit",className:"aegis-sqb__save-submit",disabled:t.trim()==="",children:"Save"})]})]});return e.jsx(h.Popover,{content:_,trigger:"click",open:s?!1:n,onOpenChange:o,placement:"bottomRight",arrow:!1,classNames:{root:"aegis-sqb__popover"},destroyOnHidden:!0,children:e.jsxs("button",{type:"button",className:"aegis-sqb__save-trigger",disabled:s,children:[e.jsx(g.PlusOutlined,{"aria-hidden":!0}),e.jsx("span",{children:"Save current"})]})})}exports.SavedQueryBar=q;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),p=require("react"),y=require("@ant-design/icons"),S=require("antd"),P=require("../../hooks/popoverOverflow.cjs"),k=require("../../hooks/useDialogPopover.cjs"),T=require("../../hooks/useMenuPopover.cjs");;/* empty css */const j=require("../../locale/useStrings.cjs");function C(s,l,c){return Array.from(s?.querySelectorAll("[data-query-id]")??[]).find(n=>n.dataset.queryId===l)?.querySelector(c)??null}function F({queries:s,currentValue:l,onApply:c,onSave:o,onRename:n,onRemove:d,onTogglePinned:a,allowEmptySave:u=!1,className:i,maxInlineUnpinned:r=6}){const v=j.useStrings(),{inline:x,overflow:_}=p.useMemo(()=>{const t=s.filter(b=>b.pinned),m=s.filter(b=>!b.pinned);return{inline:[...t,...m.slice(0,r)],overflow:m.slice(r)}},[s,r]),g=p.useRef(null),f=p.useId(),[h,N]=p.useState(null);p.useEffect(()=>{if(h===null)return;N(null);const t=g.current;if(!t)return;const m=t.querySelectorAll(".aegis-sqb__chip");(h.kind==="query"?[h.inOverflow?C(document.getElementById(f),h.id,".aegis-sqb__overflow-apply"):null,C(t,h.id,".aegis-sqb__chip"),t.querySelector(".aegis-sqb__chip--ghost"),t.querySelector(".aegis-sqb__save-trigger"),t]:[t.querySelector(".aegis-sqb__save-trigger"),m.length>0?m[m.length-1]:null,t]).find(q=>q!==null&&!(q instanceof HTMLButtonElement&&q.disabled))?.focus()},[h,f]);const w=t=>{N({kind:"query",id:t,inOverflow:!1}),a(t)},R=t=>{const m=[...x,..._],b=m.findIndex(E=>E.id===t),q=b>=x.length;let O;b+1<m.length?O=m[b+1]:q&&_.length>1&&(O=m[b-1]),N(O?{kind:"query",id:O.id,inOverflow:q}:{kind:"save"}),d(t)},Q=t=>{N({kind:"query",id:t,inOverflow:!1})},D=!u&&l.trim()==="",I=["aegis-sqb",i??""].filter(Boolean).join(" ");return e.jsxs("div",{ref:g,className:I,role:"toolbar","aria-label":v.savedQueries,tabIndex:-1,children:[s.length===0?e.jsx("span",{className:"aegis-sqb__hint",children:v.savedQueriesEmpty}):e.jsxs("ul",{className:"aegis-sqb__list",children:[x.map(t=>e.jsx(M,{query:t,onApply:c,onRename:n,onRenameDone:Q,onRemove:R,onTogglePinned:w},t.id)),_.length>0?e.jsx(K,{panelId:f,items:_,onApply:c,onRemove:R,onTogglePinned:w}):null]}),e.jsx(L,{disabled:D,currentValue:l,onSave:t=>{o(t,l)}})]})}function M({query:s,onApply:l,onRename:c,onRenameDone:o,onRemove:n,onTogglePinned:d}){const a=j.useStrings(),[u,i]=p.useState(!1),r=T.useMenuPopover(),v=p.useId(),x=()=>{u||l(s)},_=f=>{f.preventDefault(),r.setOpen(!0)},g=e.jsx(A,{panelRef:r.panelRef,id:v,onKeyDown:r.onPanelKeyDown,query:s,onRename:()=>{r.setOpen(!1),i(!0)},onTogglePinned:()=>{r.setOpen(!1),d(s.id)},onRemove:()=>{r.setOpen(!1),n(s.id)}});return e.jsx("li",{className:"aegis-sqb__item","data-query-id":s.id,onContextMenu:_,children:u?e.jsx(B,{initialName:s.name,onSubmit:(f,h)=>{c(s.id,f),i(!1),h&&o(s.id)},onCancel:f=>{i(!1),f&&o(s.id)}}):e.jsxs(e.Fragment,{children:[e.jsxs("button",{type:"button",className:"aegis-sqb__chip",onClick:x,title:s.value,children:[s.pinned?e.jsx(y.StarFilled,{className:"aegis-sqb__chip-star aegis-sqb__chip-star--on","aria-hidden":!0}):null,e.jsx("span",{className:"aegis-sqb__chip-label",children:s.name})]}),e.jsx(S.Popover,{content:g,trigger:"click",open:r.open,onOpenChange:r.setOpen,placement:"bottomRight",autoAdjustOverflow:P.POPOVER_OVERFLOW,arrow:!1,classNames:{root:"aegis-sqb__popover"},destroyOnHidden:!0,children:e.jsx("button",{ref:r.triggerRef,type:"button",className:"aegis-sqb__menu-trigger","aria-label":a.moreActionsFor(s.name),"aria-haspopup":"menu","aria-expanded":r.open,"aria-controls":r.open?v:void 0,onKeyDown:r.onTriggerKeyDown,children:e.jsx(y.EllipsisOutlined,{"aria-hidden":!0})})})]})})}function A({panelRef:s,id:l,onKeyDown:c,query:o,onRename:n,onTogglePinned:d,onRemove:a}){const u=j.useStrings();return e.jsxs("div",{ref:s,id:l,className:"aegis-sqb__menu",role:"menu",tabIndex:-1,onKeyDown:c,children:[e.jsx("button",{type:"button",role:"menuitem",className:"aegis-sqb__menu-item",onClick:n,children:u.rename}),e.jsx("button",{type:"button",role:"menuitem",className:"aegis-sqb__menu-item",onClick:d,children:o.pinned?u.unpin:u.pin}),e.jsx("button",{type:"button",role:"menuitem",className:"aegis-sqb__menu-item aegis-sqb__menu-item--danger",onClick:a,children:u.delete})]})}function B({initialName:s,onSubmit:l,onCancel:c}){const o=j.useStrings(),[n,d]=p.useState(s),a=p.useRef(null);p.useEffect(()=>{a.current?.focus(),a.current?.select()},[]);const u=i=>{i.key==="Enter"?(i.preventDefault(),n.trim()!==""?l(n,!0):c(!0)):i.key==="Escape"&&(i.preventDefault(),c(!0))};return e.jsx("input",{ref:a,type:"text",className:"aegis-sqb__rename-input",value:n,onChange:i=>{d(i.target.value)},onKeyDown:u,onBlur:()=>{n.trim()!==""&&n!==s?l(n,!1):c(!1)},"aria-label":o.renameSavedQuery})}function K({panelId:s,items:l,onApply:c,onRemove:o,onTogglePinned:n}){const d=j.useStrings(),a=k.useDialogPopover(),u=e.jsx("div",{ref:a.panelRef,id:s,className:"aegis-sqb__menu aegis-sqb__menu--overflow",role:"dialog","aria-label":d.moreSavedQueries,tabIndex:-1,children:e.jsx("ul",{className:"aegis-sqb__overflow-list",children:l.map(i=>e.jsx(H,{query:i,onApply:()=>{a.close(),c(i)},onTogglePinned:()=>{a.setOpen(!1),n(i.id)},onRemove:()=>{o(i.id)}},i.id))})});return e.jsx("li",{className:"aegis-sqb__item",children:e.jsx(S.Popover,{content:u,trigger:"click",open:a.open,onOpenChange:a.setOpen,placement:"bottomRight",autoAdjustOverflow:P.POPOVER_OVERFLOW,arrow:!1,classNames:{root:"aegis-sqb__popover"},destroyOnHidden:!0,children:e.jsx("button",{ref:a.triggerRef,type:"button",className:"aegis-sqb__chip aegis-sqb__chip--ghost","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.open?s:void 0,children:d.moreCount(l.length)})})})}function H({query:s,onApply:l,onTogglePinned:c,onRemove:o}){const n=j.useStrings();return e.jsxs("li",{className:"aegis-sqb__overflow-row","data-query-id":s.id,children:[e.jsx("button",{type:"button",className:"aegis-sqb__menu-item aegis-sqb__overflow-apply",onClick:l,title:s.value,children:s.name}),e.jsx("button",{type:"button",className:"aegis-sqb__overflow-icon",onClick:c,"aria-label":s.pinned?n.unpinNamed(s.name):n.pinNamed(s.name),children:s.pinned?e.jsx(y.StarFilled,{"aria-hidden":!0}):e.jsx(y.StarOutlined,{"aria-hidden":!0})}),e.jsx("button",{type:"button",className:"aegis-sqb__overflow-icon aegis-sqb__overflow-icon--danger",onClick:o,"aria-label":n.deleteNamed(s.name),children:"×"})]})}function L({disabled:s,currentValue:l,onSave:c}){const o=j.useStrings(),n=k.useDialogPopover(),[d,a]=p.useState(""),u=p.useId(),i=p.useId(),{open:r}=n,v=g=>{g&&a(l.slice(0,32)),n.setOpen(g)},x=g=>{g.preventDefault(),d.trim()!==""&&(c(d),n.close(),a(""))},_=e.jsxs("form",{ref:n.panelRef,id:i,className:"aegis-sqb__save-form",role:"dialog","aria-label":o.saveCurrentQuery,tabIndex:-1,onSubmit:x,children:[e.jsx("label",{className:"aegis-sqb__save-label",htmlFor:u,children:o.savedQueryName}),e.jsx("input",{id:u,type:"text",className:"aegis-sqb__save-input",value:d,onChange:g=>{a(g.target.value)},onFocus:g=>{g.currentTarget.select()},placeholder:o.savedQueryNamePlaceholder}),e.jsxs("div",{className:"aegis-sqb__save-actions",children:[e.jsx("button",{type:"button",className:"aegis-sqb__save-cancel",onClick:n.close,children:o.cancel}),e.jsx("button",{type:"submit",className:"aegis-sqb__save-submit",disabled:d.trim()==="",children:o.save})]})]});return e.jsx(S.Popover,{content:_,trigger:"click",open:s?!1:r,onOpenChange:v,placement:"bottomRight",arrow:!1,classNames:{root:"aegis-sqb__popover"},destroyOnHidden:!0,children:e.jsxs("button",{ref:n.triggerRef,type:"button",className:"aegis-sqb__save-trigger",disabled:s,"aria-haspopup":"dialog","aria-expanded":r,"aria-controls":r?i:void 0,children:[e.jsx(y.PlusOutlined,{"aria-hidden":!0}),e.jsx("span",{children:o.saveCurrent})]})})}exports.SavedQueryBar=F;
2
2
  //# sourceMappingURL=SavedQueryBar.cjs.map