@stack-spot/ai-chat-widget 1.38.2-beta.1 → 2.0.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (378) hide show
  1. package/CHANGELOG.md +33 -32
  2. package/dist/StackspotAIWidget.d.ts +14 -2
  3. package/dist/StackspotAIWidget.d.ts.map +1 -1
  4. package/dist/StackspotAIWidget.js +7 -8
  5. package/dist/StackspotAIWidget.js.map +1 -1
  6. package/dist/app-metadata.json +13 -5
  7. package/dist/chat-interceptors/quick-commands.js +3 -3
  8. package/dist/chat-interceptors/quick-commands.js.map +1 -1
  9. package/dist/components/AdaptiveTextArea.d.ts +1 -1
  10. package/dist/components/AdaptiveTextArea.d.ts.map +1 -1
  11. package/dist/components/AdaptiveTextArea.js +1 -1
  12. package/dist/components/AdaptiveTextArea.js.map +1 -1
  13. package/dist/components/AgentCard/AgentCardCreate.d.ts.map +1 -1
  14. package/dist/components/AgentCard/AgentCardCreate.js +4 -5
  15. package/dist/components/AgentCard/AgentCardCreate.js.map +1 -1
  16. package/dist/components/AgentCard/index.d.ts.map +1 -1
  17. package/dist/components/AgentCard/index.js +5 -6
  18. package/dist/components/AgentCard/index.js.map +1 -1
  19. package/dist/components/ButtonFavorite.d.ts +8 -7
  20. package/dist/components/ButtonFavorite.d.ts.map +1 -1
  21. package/dist/components/ButtonFavorite.js +5 -14
  22. package/dist/components/ButtonFavorite.js.map +1 -1
  23. package/dist/components/Code.d.ts.map +1 -1
  24. package/dist/components/Code.js +11 -9
  25. package/dist/components/Code.js.map +1 -1
  26. package/dist/components/ComponentNavigator.d.ts.map +1 -1
  27. package/dist/components/ComponentNavigator.js +2 -4
  28. package/dist/components/ComponentNavigator.js.map +1 -1
  29. package/dist/components/FadingOverflow.d.ts.map +1 -1
  30. package/dist/components/FadingOverflow.js +3 -4
  31. package/dist/components/FadingOverflow.js.map +1 -1
  32. package/dist/components/FileDescription.d.ts.map +1 -1
  33. package/dist/components/FileDescription.js +3 -4
  34. package/dist/components/FileDescription.js.map +1 -1
  35. package/dist/components/HistoryList.d.ts.map +1 -1
  36. package/dist/components/HistoryList.js +3 -1
  37. package/dist/components/HistoryList.js.map +1 -1
  38. package/dist/components/ListResource.js +3 -3
  39. package/dist/components/ListResource.js.map +1 -1
  40. package/dist/components/Markdown.js +1 -1
  41. package/dist/components/Markdown.js.map +1 -1
  42. package/dist/components/Modal.d.ts.map +1 -1
  43. package/dist/components/Modal.js +2 -4
  44. package/dist/components/Modal.js.map +1 -1
  45. package/dist/components/QuickStartButton.d.ts +2 -3
  46. package/dist/components/QuickStartButton.d.ts.map +1 -1
  47. package/dist/components/QuickStartButton.js +4 -3
  48. package/dist/components/QuickStartButton.js.map +1 -1
  49. package/dist/components/RightPanelForm.d.ts.map +1 -1
  50. package/dist/components/RightPanelForm.js +20 -13
  51. package/dist/components/RightPanelForm.js.map +1 -1
  52. package/dist/components/RightPanelTabs.d.ts +1 -4
  53. package/dist/components/RightPanelTabs.d.ts.map +1 -1
  54. package/dist/components/RightPanelTabs.js +4 -16
  55. package/dist/components/RightPanelTabs.js.map +1 -1
  56. package/dist/components/Selector/index.d.ts.map +1 -1
  57. package/dist/components/Selector/index.js +5 -8
  58. package/dist/components/Selector/index.js.map +1 -1
  59. package/dist/components/Selector/styled.d.ts.map +1 -1
  60. package/dist/components/Selector/styled.js +8 -5
  61. package/dist/components/Selector/styled.js.map +1 -1
  62. package/dist/components/StackedBadge.js +5 -5
  63. package/dist/components/StackedBadge.js.map +1 -1
  64. package/dist/components/TabManager.d.ts.map +1 -1
  65. package/dist/components/TabManager.js +9 -32
  66. package/dist/components/TabManager.js.map +1 -1
  67. package/dist/components/ToolBadge.d.ts +3 -8
  68. package/dist/components/ToolBadge.d.ts.map +1 -1
  69. package/dist/components/ToolBadge.js +23 -99
  70. package/dist/components/ToolBadge.js.map +1 -1
  71. package/dist/components/WorkspaceTabNavigator.d.ts.map +1 -1
  72. package/dist/components/WorkspaceTabNavigator.js +7 -9
  73. package/dist/components/WorkspaceTabNavigator.js.map +1 -1
  74. package/dist/components/form/DescribedCheckboxGroup.d.ts +24 -2
  75. package/dist/components/form/DescribedCheckboxGroup.d.ts.map +1 -1
  76. package/dist/components/form/DescribedCheckboxGroup.js +46 -29
  77. package/dist/components/form/DescribedCheckboxGroup.js.map +1 -1
  78. package/dist/components/form/DescribedRadioGroup.d.ts +24 -4
  79. package/dist/components/form/DescribedRadioGroup.d.ts.map +1 -1
  80. package/dist/components/form/DescribedRadioGroup.js +39 -18
  81. package/dist/components/form/DescribedRadioGroup.js.map +1 -1
  82. package/dist/context/hooks.d.ts +6 -1
  83. package/dist/context/hooks.d.ts.map +1 -1
  84. package/dist/context/hooks.js +4 -1
  85. package/dist/context/hooks.js.map +1 -1
  86. package/dist/hooks/midnight-update-view.d.ts +5 -0
  87. package/dist/hooks/midnight-update-view.d.ts.map +1 -0
  88. package/dist/hooks/midnight-update-view.js +30 -0
  89. package/dist/hooks/midnight-update-view.js.map +1 -0
  90. package/dist/index.d.ts +4 -2
  91. package/dist/index.d.ts.map +1 -1
  92. package/dist/index.js +1 -1
  93. package/dist/index.js.map +1 -1
  94. package/dist/layout.css +0 -26
  95. package/dist/right-panel/DefaultPanel.d.ts.map +1 -1
  96. package/dist/right-panel/DefaultPanel.js +2 -4
  97. package/dist/right-panel/DefaultPanel.js.map +1 -1
  98. package/dist/state/ChatEntry.d.ts +3 -4
  99. package/dist/state/ChatEntry.d.ts.map +1 -1
  100. package/dist/state/ChatEntry.js.map +1 -1
  101. package/dist/state/constants.d.ts.map +1 -1
  102. package/dist/state/constants.js +1 -0
  103. package/dist/state/constants.js.map +1 -1
  104. package/dist/types.d.ts +8 -3
  105. package/dist/types.d.ts.map +1 -1
  106. package/dist/utils/tools.d.ts +9 -3
  107. package/dist/utils/tools.d.ts.map +1 -1
  108. package/dist/utils/tools.js +1 -6
  109. package/dist/utils/tools.js.map +1 -1
  110. package/dist/views/Agents/AgentDescription.d.ts.map +1 -1
  111. package/dist/views/Agents/AgentDescription.js +8 -13
  112. package/dist/views/Agents/AgentDescription.js.map +1 -1
  113. package/dist/views/Agents/AgentsPanel.d.ts.map +1 -1
  114. package/dist/views/Agents/AgentsPanel.js +7 -7
  115. package/dist/views/Agents/AgentsPanel.js.map +1 -1
  116. package/dist/views/Agents/AgentsTab.d.ts.map +1 -1
  117. package/dist/views/Agents/AgentsTab.js +30 -29
  118. package/dist/views/Agents/AgentsTab.js.map +1 -1
  119. package/dist/views/Agents/dictionary.d.ts +1 -1
  120. package/dist/views/Agents/useAgentFavorites.js +3 -3
  121. package/dist/views/Agents/useAgentFavorites.js.map +1 -1
  122. package/dist/views/Chat/AgentInfo.d.ts.map +1 -1
  123. package/dist/views/Chat/AgentInfo.js +3 -5
  124. package/dist/views/Chat/AgentInfo.js.map +1 -1
  125. package/dist/views/Chat/ChatMessage.d.ts +24 -2
  126. package/dist/views/Chat/ChatMessage.d.ts.map +1 -1
  127. package/dist/views/Chat/ChatMessage.js +36 -47
  128. package/dist/views/Chat/ChatMessage.js.map +1 -1
  129. package/dist/views/Chat/ChatMessages.d.ts +1 -1
  130. package/dist/views/Chat/ChatMessages.d.ts.map +1 -1
  131. package/dist/views/Chat/ChatMessages.js +2 -2
  132. package/dist/views/Chat/ChatMessages.js.map +1 -1
  133. package/dist/views/Chat/StepsList.d.ts.map +1 -1
  134. package/dist/views/Chat/StepsList.js +10 -10
  135. package/dist/views/Chat/StepsList.js.map +1 -1
  136. package/dist/views/Chat/index.d.ts +1 -1
  137. package/dist/views/Chat/index.d.ts.map +1 -1
  138. package/dist/views/Chat/index.js +2 -2
  139. package/dist/views/Chat/index.js.map +1 -1
  140. package/dist/views/Chat/styled.d.ts.map +1 -1
  141. package/dist/views/Chat/styled.js +11 -16
  142. package/dist/views/Chat/styled.js.map +1 -1
  143. package/dist/views/ChatHistory/HistoryItem.d.ts.map +1 -1
  144. package/dist/views/ChatHistory/HistoryItem.js +10 -48
  145. package/dist/views/ChatHistory/HistoryItem.js.map +1 -1
  146. package/dist/views/ChatHistory/index.js +1 -1
  147. package/dist/views/ChatHistory/index.js.map +1 -1
  148. package/dist/views/ChatHistory/styled.d.ts.map +1 -1
  149. package/dist/views/ChatHistory/styled.js +3 -5
  150. package/dist/views/ChatHistory/styled.js.map +1 -1
  151. package/dist/views/ChatHistory/utils.d.ts +7 -0
  152. package/dist/views/ChatHistory/utils.d.ts.map +1 -1
  153. package/dist/views/ChatHistory/utils.js +40 -1
  154. package/dist/views/ChatHistory/utils.js.map +1 -1
  155. package/dist/views/ChatTabSelection.d.ts +6 -1
  156. package/dist/views/ChatTabSelection.d.ts.map +1 -1
  157. package/dist/views/ChatTabSelection.js +13 -8
  158. package/dist/views/ChatTabSelection.js.map +1 -1
  159. package/dist/views/Editor.d.ts.map +1 -1
  160. package/dist/views/Editor.js +6 -12
  161. package/dist/views/Editor.js.map +1 -1
  162. package/dist/views/Home/BuiltInAgent.d.ts.map +1 -1
  163. package/dist/views/Home/BuiltInAgent.js +2 -3
  164. package/dist/views/Home/BuiltInAgent.js.map +1 -1
  165. package/dist/views/Home/CustomAgent.js +3 -3
  166. package/dist/views/Home/CustomAgent.js.map +1 -1
  167. package/dist/views/Home/index.js +2 -2
  168. package/dist/views/Home/index.js.map +1 -1
  169. package/dist/views/Home/styled.d.ts.map +1 -1
  170. package/dist/views/Home/styled.js +21 -22
  171. package/dist/views/Home/styled.js.map +1 -1
  172. package/dist/views/KSDocument.d.ts.map +1 -1
  173. package/dist/views/KSDocument.js +3 -4
  174. package/dist/views/KSDocument.js.map +1 -1
  175. package/dist/views/KnowledgeSources.d.ts.map +1 -1
  176. package/dist/views/KnowledgeSources.js +14 -36
  177. package/dist/views/KnowledgeSources.js.map +1 -1
  178. package/dist/views/MessageInput/AgentSelector.d.ts.map +1 -1
  179. package/dist/views/MessageInput/AgentSelector.js +7 -5
  180. package/dist/views/MessageInput/AgentSelector.js.map +1 -1
  181. package/dist/views/MessageInput/ButtonAgent.d.ts.map +1 -1
  182. package/dist/views/MessageInput/ButtonAgent.js +4 -5
  183. package/dist/views/MessageInput/ButtonAgent.js.map +1 -1
  184. package/dist/views/MessageInput/ButtonBar.d.ts.map +1 -1
  185. package/dist/views/MessageInput/ButtonBar.js +2 -4
  186. package/dist/views/MessageInput/ButtonBar.js.map +1 -1
  187. package/dist/views/MessageInput/ContextBar.d.ts.map +1 -1
  188. package/dist/views/MessageInput/ContextBar.js +3 -6
  189. package/dist/views/MessageInput/ContextBar.js.map +1 -1
  190. package/dist/views/MessageInput/QuickCommandSelector.js +2 -2
  191. package/dist/views/MessageInput/QuickCommandSelector.js.map +1 -1
  192. package/dist/views/MessageInput/SelectContent.d.ts.map +1 -1
  193. package/dist/views/MessageInput/SelectContent.js +30 -29
  194. package/dist/views/MessageInput/SelectContent.js.map +1 -1
  195. package/dist/views/MessageInput/UploadDragNDrop.d.ts.map +1 -1
  196. package/dist/views/MessageInput/UploadDragNDrop.js +2 -3
  197. package/dist/views/MessageInput/UploadDragNDrop.js.map +1 -1
  198. package/dist/views/MessageInput/dictionary.d.ts +1 -1
  199. package/dist/views/MessageInput/index.d.ts +2 -1
  200. package/dist/views/MessageInput/index.d.ts.map +1 -1
  201. package/dist/views/MessageInput/index.js +5 -6
  202. package/dist/views/MessageInput/index.js.map +1 -1
  203. package/dist/views/MessageInput/styled.d.ts +1 -3
  204. package/dist/views/MessageInput/styled.d.ts.map +1 -1
  205. package/dist/views/MessageInput/styled.js +11 -15
  206. package/dist/views/MessageInput/styled.js.map +1 -1
  207. package/dist/views/MinimizedHeader.d.ts.map +1 -1
  208. package/dist/views/MinimizedHeader.js +3 -4
  209. package/dist/views/MinimizedHeader.js.map +1 -1
  210. package/dist/views/Resources.d.ts.map +1 -1
  211. package/dist/views/Resources.js +11 -8
  212. package/dist/views/Resources.js.map +1 -1
  213. package/dist/views/Stacks.d.ts.map +1 -1
  214. package/dist/views/Stacks.js +23 -28
  215. package/dist/views/Stacks.js.map +1 -1
  216. package/dist/views/Steps/FlowChart/NodeStep.d.ts.map +1 -1
  217. package/dist/views/Steps/FlowChart/NodeStep.js +3 -3
  218. package/dist/views/Steps/FlowChart/NodeStep.js.map +1 -1
  219. package/dist/views/Steps/StepModal.d.ts.map +1 -1
  220. package/dist/views/Steps/StepModal.js +4 -6
  221. package/dist/views/Steps/StepModal.js.map +1 -1
  222. package/dist/views/Steps/dictionary.d.ts +1 -1
  223. package/dist/views/Steps/index.d.ts.map +1 -1
  224. package/dist/views/Steps/index.js +3 -4
  225. package/dist/views/Steps/index.js.map +1 -1
  226. package/dist/views/Steps/utils.d.ts +2 -1
  227. package/dist/views/Steps/utils.d.ts.map +1 -1
  228. package/dist/views/Steps/utils.js +8 -8
  229. package/dist/views/Steps/utils.js.map +1 -1
  230. package/dist/views/Tools.js +1 -1
  231. package/dist/views/Tools.js.map +1 -1
  232. package/dist/views/Workspaces/WorkspacesTab.d.ts.map +1 -1
  233. package/dist/views/Workspaces/WorkspacesTab.js +7 -10
  234. package/dist/views/Workspaces/WorkspacesTab.js.map +1 -1
  235. package/dist/views/Workspaces/index.js +4 -2
  236. package/dist/views/Workspaces/index.js.map +1 -1
  237. package/package.json +5 -3
  238. package/src/StackspotAIWidget.tsx +51 -37
  239. package/src/app-metadata.json +13 -5
  240. package/src/chat-interceptors/quick-commands.ts +3 -3
  241. package/src/components/AdaptiveTextArea.tsx +1 -1
  242. package/src/components/AgentCard/AgentCardCreate.tsx +4 -7
  243. package/src/components/AgentCard/index.tsx +7 -7
  244. package/src/components/ButtonFavorite.tsx +20 -47
  245. package/src/components/Code.tsx +31 -36
  246. package/src/components/ComponentNavigator.tsx +4 -8
  247. package/src/components/FadingOverflow.tsx +6 -7
  248. package/src/components/FileDescription.tsx +14 -10
  249. package/src/components/HistoryList.tsx +4 -1
  250. package/src/components/ListResource.tsx +5 -5
  251. package/src/components/Markdown.tsx +1 -1
  252. package/src/components/Modal.tsx +2 -4
  253. package/src/components/QuickStartButton.tsx +5 -4
  254. package/src/components/RightPanelForm.tsx +20 -13
  255. package/src/components/RightPanelTabs.tsx +4 -32
  256. package/src/components/Selector/index.tsx +17 -13
  257. package/src/components/Selector/styled.ts +8 -5
  258. package/src/components/StackedBadge.tsx +5 -5
  259. package/src/components/TabManager.tsx +31 -55
  260. package/src/components/ToolBadge.tsx +48 -129
  261. package/src/components/WorkspaceTabNavigator.tsx +22 -25
  262. package/src/components/form/DescribedCheckboxGroup.tsx +90 -65
  263. package/src/components/form/DescribedRadioGroup.tsx +78 -46
  264. package/src/context/hooks.ts +4 -1
  265. package/src/hooks/midnight-update-view.ts +36 -0
  266. package/src/index.ts +4 -2
  267. package/src/layout.css +0 -26
  268. package/src/right-panel/DefaultPanel.tsx +3 -7
  269. package/src/state/ChatEntry.ts +3 -4
  270. package/src/state/constants.ts +2 -1
  271. package/src/types.ts +9 -3
  272. package/src/utils/tools.ts +3 -12
  273. package/src/views/Agents/AgentDescription.tsx +20 -36
  274. package/src/views/Agents/AgentsPanel.tsx +11 -12
  275. package/src/views/Agents/AgentsTab.tsx +38 -57
  276. package/src/views/Agents/useAgentFavorites.ts +3 -3
  277. package/src/views/Chat/AgentInfo.tsx +7 -6
  278. package/src/views/Chat/ChatMessage.tsx +163 -145
  279. package/src/views/Chat/ChatMessages.tsx +2 -1
  280. package/src/views/Chat/StepsList.tsx +10 -11
  281. package/src/views/Chat/index.tsx +9 -2
  282. package/src/views/Chat/styled.ts +11 -16
  283. package/src/views/ChatHistory/HistoryItem.tsx +15 -54
  284. package/src/views/ChatHistory/index.tsx +1 -1
  285. package/src/views/ChatHistory/styled.ts +3 -5
  286. package/src/views/ChatHistory/utils.ts +43 -2
  287. package/src/views/ChatTabSelection.tsx +18 -10
  288. package/src/views/Editor.tsx +9 -14
  289. package/src/views/Home/BuiltInAgent.tsx +7 -8
  290. package/src/views/Home/CustomAgent.tsx +3 -3
  291. package/src/views/Home/index.tsx +2 -2
  292. package/src/views/Home/styled.ts +21 -22
  293. package/src/views/KSDocument.tsx +7 -8
  294. package/src/views/KnowledgeSources.tsx +24 -66
  295. package/src/views/MessageInput/AgentSelector.tsx +10 -8
  296. package/src/views/MessageInput/ButtonAgent.tsx +24 -12
  297. package/src/views/MessageInput/ButtonBar.tsx +25 -21
  298. package/src/views/MessageInput/ContextBar.tsx +16 -14
  299. package/src/views/MessageInput/QuickCommandSelector.tsx +2 -2
  300. package/src/views/MessageInput/SelectContent.tsx +39 -62
  301. package/src/views/MessageInput/UploadDragNDrop.tsx +2 -5
  302. package/src/views/MessageInput/index.tsx +8 -9
  303. package/src/views/MessageInput/styled.ts +12 -16
  304. package/src/views/MinimizedHeader.tsx +5 -7
  305. package/src/views/Resources.tsx +31 -30
  306. package/src/views/Stacks.tsx +31 -54
  307. package/src/views/Steps/FlowChart/NodeStep.tsx +6 -4
  308. package/src/views/Steps/StepModal.tsx +14 -18
  309. package/src/views/Steps/index.tsx +4 -5
  310. package/src/views/Steps/utils.tsx +9 -9
  311. package/src/views/Tools.tsx +0 -1
  312. package/src/views/Workspaces/WorkspacesTab.tsx +17 -21
  313. package/src/views/Workspaces/index.tsx +4 -2
  314. package/dist/components/Accordion.d.ts +0 -20
  315. package/dist/components/Accordion.d.ts.map +0 -1
  316. package/dist/components/Accordion.js +0 -51
  317. package/dist/components/Accordion.js.map +0 -1
  318. package/dist/components/FallbackBoundary/ErrorBoundary.d.ts +0 -33
  319. package/dist/components/FallbackBoundary/ErrorBoundary.d.ts.map +0 -1
  320. package/dist/components/FallbackBoundary/ErrorBoundary.js +0 -52
  321. package/dist/components/FallbackBoundary/ErrorBoundary.js.map +0 -1
  322. package/dist/components/FallbackBoundary/Loading.d.ts +0 -2
  323. package/dist/components/FallbackBoundary/Loading.d.ts.map +0 -1
  324. package/dist/components/FallbackBoundary/Loading.js +0 -12
  325. package/dist/components/FallbackBoundary/Loading.js.map +0 -1
  326. package/dist/components/FallbackBoundary/index.d.ts +0 -17
  327. package/dist/components/FallbackBoundary/index.d.ts.map +0 -1
  328. package/dist/components/FallbackBoundary/index.js +0 -9
  329. package/dist/components/FallbackBoundary/index.js.map +0 -1
  330. package/dist/components/IconInput.d.ts +0 -10
  331. package/dist/components/IconInput.d.ts.map +0 -1
  332. package/dist/components/IconInput.js +0 -61
  333. package/dist/components/IconInput.js.map +0 -1
  334. package/dist/components/OverlayMenu.d.ts +0 -21
  335. package/dist/components/OverlayMenu.d.ts.map +0 -1
  336. package/dist/components/OverlayMenu.js +0 -79
  337. package/dist/components/OverlayMenu.js.map +0 -1
  338. package/dist/components/ProgressBar.d.ts +0 -37
  339. package/dist/components/ProgressBar.d.ts.map +0 -1
  340. package/dist/components/ProgressBar.js +0 -131
  341. package/dist/components/ProgressBar.js.map +0 -1
  342. package/dist/components/Tooltip/Tooltip.d.ts +0 -37
  343. package/dist/components/Tooltip/Tooltip.d.ts.map +0 -1
  344. package/dist/components/Tooltip/Tooltip.js +0 -30
  345. package/dist/components/Tooltip/Tooltip.js.map +0 -1
  346. package/dist/components/Tooltip/TooltipAPI.d.ts +0 -29
  347. package/dist/components/Tooltip/TooltipAPI.d.ts.map +0 -1
  348. package/dist/components/Tooltip/TooltipAPI.js +0 -107
  349. package/dist/components/Tooltip/TooltipAPI.js.map +0 -1
  350. package/dist/components/Tooltip/context.d.ts +0 -5
  351. package/dist/components/Tooltip/context.d.ts.map +0 -1
  352. package/dist/components/Tooltip/context.js +0 -18
  353. package/dist/components/Tooltip/context.js.map +0 -1
  354. package/dist/components/Tooltip/index.d.ts +0 -3
  355. package/dist/components/Tooltip/index.d.ts.map +0 -1
  356. package/dist/components/Tooltip/index.js +0 -3
  357. package/dist/components/Tooltip/index.js.map +0 -1
  358. package/dist/components/Tooltip/style.d.ts +0 -4
  359. package/dist/components/Tooltip/style.d.ts.map +0 -1
  360. package/dist/components/Tooltip/style.js +0 -22
  361. package/dist/components/Tooltip/style.js.map +0 -1
  362. package/dist/components/Tooltip/types.d.ts +0 -27
  363. package/dist/components/Tooltip/types.d.ts.map +0 -1
  364. package/dist/components/Tooltip/types.js +0 -2
  365. package/dist/components/Tooltip/types.js.map +0 -1
  366. package/src/components/Accordion.tsx +0 -75
  367. package/src/components/FallbackBoundary/ErrorBoundary.tsx +0 -71
  368. package/src/components/FallbackBoundary/Loading.tsx +0 -14
  369. package/src/components/FallbackBoundary/index.tsx +0 -26
  370. package/src/components/IconInput.tsx +0 -73
  371. package/src/components/OverlayMenu.tsx +0 -133
  372. package/src/components/ProgressBar.tsx +0 -183
  373. package/src/components/Tooltip/Tooltip.tsx +0 -78
  374. package/src/components/Tooltip/TooltipAPI.ts +0 -101
  375. package/src/components/Tooltip/context.tsx +0 -24
  376. package/src/components/Tooltip/index.ts +0 -2
  377. package/src/components/Tooltip/style.tsx +0 -24
  378. package/src/components/Tooltip/types.ts +0 -28
@@ -15,22 +15,15 @@ export const ChatList: IStyledComponentBase<
15
15
  padding: 0;
16
16
  flex: 1;
17
17
 
18
- .error {
19
- display: flex;
20
- flex-direction: row;
18
+ [data-citric="alert"].error {
21
19
  gap: 8px;
22
20
  padding: 8px 10px;
23
- background-color: ${theme.color.danger[500]};
24
- color: ${theme.color.danger.contrastText};
25
21
  border-radius: 8px;
26
22
  align-self: start;
27
-
28
- svg {
29
- fill: ${theme.color.danger.contrastText};
30
- }
31
-
32
- small {
33
- margin-top: 1px;
23
+ font: ${theme.font.microtext1};
24
+ line-height: 1;
25
+ &:before {
26
+ font-size: 14px;
34
27
  }
35
28
  }
36
29
 
@@ -78,6 +71,12 @@ export const ChatList: IStyledComponentBase<
78
71
  opacity: 0.6;
79
72
  margin-left: auto;
80
73
  }
74
+
75
+ // prevents the feedback from being cut by the overflow rules of the parent elements.
76
+ .copy-btn:after {
77
+ left: 0;
78
+ margin-top: -20px;
79
+ }
81
80
  }
82
81
 
83
82
  > li {
@@ -240,13 +239,9 @@ export const ChatList: IStyledComponentBase<
240
239
  margin-left: 0px;
241
240
  }
242
241
  }
243
-
244
-
245
242
  }
246
243
  }
247
244
 
248
-
249
-
250
245
  .steps {
251
246
  ul {
252
247
  list-style: none;
@@ -1,23 +1,14 @@
1
- import { IconBox, Input } from '@citric/core'
2
- import { Check, Download, EllipsisHorizontal, Pencil, Trash } from '@citric/icons'
3
- import { IconButton, LoadingCircular } from '@citric/ui'
4
- import { focusNextIgnoringChildren } from '@stack-spot/portal-components'
5
- import { agentToolsClient, aiClient } from '@stack-spot/portal-network'
1
+ import { Icon } from '@stack-spot/citric-icons'
2
+ import { IconButton, Input, MenuItem, MenuOverlay, ProgressCircular } from '@stack-spot/citric-react'
3
+ import { aiClient } from '@stack-spot/portal-network'
6
4
  import { ConversationResponse } from '@stack-spot/portal-network/api/ai'
7
5
  import { theme } from '@stack-spot/portal-theme'
8
- import { last } from 'lodash'
9
6
  import { useCallback, useEffect, useRef, useState } from 'react'
10
- import { OverlayMenu } from '../../components/OverlayMenu'
11
7
  import { useWidget } from '../../context/hooks'
12
- import { ChatEntry } from '../../state/ChatEntry'
13
- import { ChatState } from '../../state/ChatState'
14
- import { LabeledAgent } from '../../state/types'
15
- import { ButtonAction } from '../../types'
16
8
  import { download } from '../../utils/download'
17
- import { genericSourcesToKnowledgeSources } from '../../utils/knowledge-source'
18
9
  import { useHistoryDictionary } from './dictionary'
19
10
  import { HistoryItemBox } from './styled'
20
- import { findStack, findWorkspace } from './utils'
11
+ import { loadChat } from './utils'
21
12
 
22
13
  /**
23
14
  * Renders an item of the list of conversations (history).
@@ -31,7 +22,6 @@ export const HistoryItem = ({ item }: { item: ConversationResponse }) => {
31
22
  const [isDeleted, setDeleted] = useState(false)
32
23
  const renameInput = useRef<HTMLInputElement>(null)
33
24
  const widget = useWidget()
34
- const overlayRef = useRef<HTMLDivElement>(null)
35
25
 
36
26
  useEffect(() => {
37
27
  if (isRenaming) renameInput.current?.focus()
@@ -58,7 +48,6 @@ export const HistoryItem = ({ item }: { item: ConversationResponse }) => {
58
48
  }
59
49
 
60
50
  const onDownload = useCallback(async () => {
61
- setTimeout(() => focusNextIgnoringChildren(overlayRef.current), 10)
62
51
  setLoading(true)
63
52
  try {
64
53
  const content = await aiClient.downloadChat.mutate({ conversationId: item.id })
@@ -72,7 +61,6 @@ export const HistoryItem = ({ item }: { item: ConversationResponse }) => {
72
61
 
73
62
  const onDelete = useCallback(async () => {
74
63
  setDeleted(true)
75
- setTimeout(() => overlayRef.current?.focus(), 10)
76
64
  try {
77
65
  await aiClient.deleteChat.mutate({ conversationId: item.id })
78
66
  aiClient.chats.invalidate()
@@ -88,34 +76,7 @@ export const HistoryItem = ({ item }: { item: ConversationResponse }) => {
88
76
  if (tab) return widget.chatTabs.select(item.id)
89
77
  setLoading(true)
90
78
  try {
91
- const chat = await aiClient.chat.query({ conversationId: item.id })
92
- const historyAgentIds = chat.history?.map(item => item.custom_agent?.id).filter(Boolean) as string[] ?? []
93
- const [stack, workspace, agents] = await Promise.all([
94
- findStack(chat.ai_stack_id),
95
- findWorkspace(chat.workspace_id),
96
- agentToolsClient.agentsByIds.query({ searchAgentsRequest: { ids: historyAgentIds } }),
97
- ])
98
- const agentsAsLabeledAgents: LabeledAgent[] = agents
99
- .map((a) => ({ ...a, label: a.name, image: a.avatar ?? '', builtIn: a.visibility_level === 'built_in' }))
100
-
101
- const agent = agentsAsLabeledAgents.find(a => a.id === last(chat.history)?.custom_agent?.id)
102
- const builtIn = !!last(chat.history ?? [])?.custom_agent?.built_in
103
- widget.chatTabs.add(new ChatState({
104
- id: chat.id,
105
- initial: { features: widget.chatFeatures, label: chat.title, stack, workspace, agent: agent ? {
106
- ...agent, builtIn } : undefined },
107
- interceptors: widget.interceptors,
108
- entries: chat.history?.map(item => new ChatEntry({
109
- agentType: item.agent === 'USER' ? 'user' : 'bot',
110
- content: item.content,
111
- type: 'md',
112
- agent: agentsAsLabeledAgents.find(a => a.id === item.custom_agent?.id),
113
- messageId: item.message_id,
114
- knowledgeSources: item.agent === 'USER' ? undefined : genericSourcesToKnowledgeSources(item.sources),
115
- updated: item.updated,
116
- })),
117
- }))
118
- widget.chatTabs.select(chat.id)
79
+ await loadChat(widget, item.id)
119
80
  } catch (error) {
120
81
  // eslint-disable-next-line no-console
121
82
  console.error(error)
@@ -123,10 +84,10 @@ export const HistoryItem = ({ item }: { item: ConversationResponse }) => {
123
84
  setLoading(false)
124
85
  }, [])
125
86
 
126
- const actions: ButtonAction[] = [
127
- { label: t.rename, onClick: onRename, icon: <Pencil /> },
128
- { label: t.download, onClick: onDownload, icon: <Download /> },
129
- { label: t.delete, onClick: onDelete, icon: <Trash />, color: theme.color.danger[500] },
87
+ const actions: MenuItem[] = [
88
+ { label: t.rename, onClick: onRename, icon: <Icon icon="Pencil" /> },
89
+ { label: t.download, onClick: onDownload, icon: <Icon icon="Download" /> },
90
+ { label: t.delete, onClick: onDelete, icon: <Icon icon="Trash" />, style: { color: theme.color.danger[500] } },
130
91
  ]
131
92
 
132
93
  return isDeleted ? null : (
@@ -136,22 +97,22 @@ export const HistoryItem = ({ item }: { item: ConversationResponse }) => {
136
97
  <Input
137
98
  ref={renameInput}
138
99
  value={renamed}
139
- onChange={e => setRenamed(e.target.value)}
100
+ onChange={setRenamed}
101
+ style={{ flex: 1 }}
140
102
  onKeyDown={(e) => {
141
103
  if (['Enter', 'Escape'].includes(e.key)) {
142
104
  e.key === 'Enter' ? onSubmitRename() : setRenaming(false)
143
- setTimeout(() => overlayRef.current?.focus(), 10)
144
105
  }
145
106
  }}
146
107
  />
147
- <IconButton onClick={onSubmitRename}><Check /></IconButton>
108
+ <IconButton icon="Check" onClick={onSubmitRename} />
148
109
  </>
149
110
  ) : (
150
111
  <>
151
112
  <button className="label" onClick={onSelect} disabled={isLoading}>{title}</button>
152
- {isLoading ? <LoadingCircular size="xs" /> : <OverlayMenu actions={actions} position="left" ref={overlayRef}>
153
- <IconBox><EllipsisHorizontal /></IconBox>
154
- </OverlayMenu>}
113
+ {isLoading ? <ProgressCircular size="xs" /> : <MenuOverlay items={actions} position="left">
114
+ <Icon icon="EllipsisHorizontal" size="xs" />
115
+ </MenuOverlay>}
155
116
  </>
156
117
  )}
157
118
  </HistoryItemBox>
@@ -1,5 +1,5 @@
1
+ import { FallbackBoundary } from '@stack-spot/citric-react'
1
2
  import { useEffect } from 'react'
2
- import { FallbackBoundary } from '../../components/FallbackBoundary'
3
3
  import { useWidget, useWidgetState } from '../../context/hooks'
4
4
  import { useRightPanel } from '../../right-panel/hooks'
5
5
  import { ChatHistoryPanel } from './ChatHistoryPanel'
@@ -1,5 +1,3 @@
1
- import { IconBox } from '@citric/core'
2
- import { IconButton } from '@citric/ui'
3
1
  import { theme } from '@stack-spot/portal-theme'
4
2
  import { styled } from 'styled-components'
5
3
 
@@ -42,7 +40,7 @@ export const HistoryItemBox = styled.div`
42
40
  }
43
41
  }
44
42
 
45
- ${IconBox}, ${IconButton} {
43
+ /* $ {IconBox}, $ {IconButton} {
46
44
  padding: 0;
47
45
  border: none;
48
46
  background-color: transparent;
@@ -54,7 +52,7 @@ export const HistoryItemBox = styled.div`
54
52
  }
55
53
  }
56
54
 
57
- ${IconButton} svg {
55
+ $ {IconButton} svg {
58
56
  width: 16px;
59
- }
57
+ } */
60
58
  `
@@ -1,5 +1,10 @@
1
- import { aiClient, workspaceClient } from '@stack-spot/portal-network'
2
- import { ChatProperties } from '../../state/ChatState'
1
+ import { agentToolsClient, aiClient, workspaceClient } from '@stack-spot/portal-network'
2
+ import { last } from 'lodash'
3
+ import { ChatEntry } from '../../state/ChatEntry'
4
+ import { ChatProperties, ChatState } from '../../state/ChatState'
5
+ import { WidgetState } from '../../state/WidgetState'
6
+ import { LabeledAgent } from '../../state/types'
7
+ import { genericSourcesToKnowledgeSources } from '../../utils/knowledge-source'
3
8
 
4
9
  /**
5
10
  * Finds a stack by its id.
@@ -35,3 +40,39 @@ export async function findWorkspace(id: string | null): Promise<ChatProperties['
35
40
  return { id, label: id }
36
41
  }
37
42
  }
43
+
44
+ /**
45
+ * Loads the chat identified by `conversationId` into the widget passed as parameter.
46
+ * @param widget
47
+ * @param conversationId
48
+ */
49
+ export async function loadChat(widget: WidgetState, conversationId: string) {
50
+ const chat = await aiClient.chat.query({ conversationId })
51
+ const historyAgentIds = chat.history?.map(item => item.custom_agent?.id).filter(Boolean) as string[] ?? []
52
+ const [stack, workspace, agents] = await Promise.all([
53
+ findStack(chat.ai_stack_id),
54
+ findWorkspace(chat.workspace_id),
55
+ agentToolsClient.agentsByIds.query({ searchAgentsRequest: { ids: historyAgentIds } }),
56
+ ])
57
+ const agentsAsLabeledAgents: LabeledAgent[] = agents
58
+ .map((a) => ({ ...a, label: a.name, image: a.avatar ?? '', builtIn: a.visibility_level === 'built_in' }))
59
+
60
+ const agent = agentsAsLabeledAgents.find(a => a.id === last(chat.history)?.custom_agent?.id)
61
+ const builtIn = !!last(chat.history ?? [])?.custom_agent?.built_in
62
+ widget.chatTabs.add(new ChatState({
63
+ id: chat.id,
64
+ initial: { features: widget.chatFeatures, label: chat.title, stack, workspace, agent: agent ? {
65
+ ...agent, builtIn } : undefined },
66
+ interceptors: widget.interceptors,
67
+ entries: chat.history?.map(item => new ChatEntry({
68
+ agentType: item.agent === 'USER' ? 'user' : 'bot',
69
+ content: item.content,
70
+ type: 'md',
71
+ agent: agentsAsLabeledAgents.find(a => a.id === item.custom_agent?.id),
72
+ messageId: item.message_id,
73
+ knowledgeSources: item.agent === 'USER' ? undefined : genericSourcesToKnowledgeSources(item.sources),
74
+ updated: item.updated,
75
+ })),
76
+ }))
77
+ widget.chatTabs.select(chat.id)
78
+ }
@@ -1,4 +1,3 @@
1
- import { Clock, Plus } from '@citric/icons'
2
1
  import { Dictionary, useTranslate } from '@stack-spot/portal-translate'
3
2
  import { useMemo } from 'react'
4
3
  import { TabManager } from '../components/TabManager'
@@ -7,6 +6,10 @@ import { useRightPanel } from '../right-panel/hooks'
7
6
  import { ChatState } from '../state/ChatState'
8
7
  import { ButtonAction } from '../types'
9
8
 
9
+ interface Props {
10
+ buttons?: ButtonAction[],
11
+ }
12
+
10
13
  const TabLabel = ({ id }: { id: string }) => {
11
14
  const label = useChatState(id, 'label')
12
15
  return <div title={label}>{label}</div>
@@ -15,7 +18,7 @@ const TabLabel = ({ id }: { id: string }) => {
15
18
  /**
16
19
  * This renders the top-most part of the layout, which includes the chat selection through tabs.
17
20
  */
18
- export const ChatTabSelection = () => {
21
+ export const ChatTabSelection = ({ buttons: extraButtons = [] }: Props) => {
19
22
  const t = useTranslate(dictionary)
20
23
  const widget = useWidget()
21
24
  const { chatHistory } = useWidgetState('features') ?? {}
@@ -39,24 +42,29 @@ export const ChatTabSelection = () => {
39
42
 
40
43
  const buttons = useMemo<ButtonAction[]>(
41
44
  () => {
42
- const actions: ButtonAction[] = [{
43
- icon: <Plus />,
44
- ariaLabel: t.newChat,
45
- onClick: create,
46
- }]
45
+ if (extraButtons.length) extraButtons[0].style = { ...extraButtons[0].style, marginLeft: 'auto' }
46
+ const actions: ButtonAction[] = [
47
+ {
48
+ icon: 'Plus',
49
+ ariaLabel: t.newChat,
50
+ onClick: create,
51
+ appearance: 'text',
52
+ },
53
+ ...extraButtons,
54
+ ]
47
55
  if (chatHistory) {
48
56
  actions.push({
49
- icon: <Clock />,
57
+ icon: 'Clock',
50
58
  label: t.history,
51
59
  ariaLabel: t.openHistory,
52
60
  className: 'test',
53
- style: { marginLeft: 'auto' },
61
+ style: extraButtons.length ? undefined : { marginLeft: 'auto' },
54
62
  onClick: () => widget.set('panel', 'history'),
55
63
  })
56
64
  }
57
65
  return actions
58
66
  },
59
- [chatHistory],
67
+ [chatHistory, extraButtons],
60
68
  )
61
69
 
62
70
  return <TabManager
@@ -1,8 +1,6 @@
1
- import { Text } from '@citric/core'
2
- import { LoadingCircular } from '@citric/ui'
3
1
  import MonacoEditor, { OnMount } from '@monaco-editor/react'
2
+ import { ProgressCircular, Select, Text } from '@stack-spot/citric-react'
4
3
  import { delay } from '@stack-spot/portal-components'
5
- import { Select } from '@stack-spot/portal-components/Select'
6
4
  import { useThemeKind } from '@stack-spot/portal-theme'
7
5
  import { Dictionary, useTranslate } from '@stack-spot/portal-translate'
8
6
  import { debounce } from 'lodash'
@@ -29,17 +27,13 @@ const TitleBox = styled.div`
29
27
  position: relative;
30
28
 
31
29
  .language-selector {
32
- width: 150px;
30
+ height: 28px;
33
31
  position: absolute;
34
32
  top: -4px;
35
33
  right: 0;
36
34
 
37
- .options {
38
- max-height: 250px;
39
- }
40
-
41
- .current-value {
42
- padding: 2px 8px;
35
+ .search-bar {
36
+ display: none;
43
37
  }
44
38
  }
45
39
  `
@@ -78,11 +72,12 @@ const Title = () => {
78
72
  <Text appearance="h5">Editor</Text>
79
73
  <Select
80
74
  options={languages}
81
- renderLabel={l => l.label}
82
- renderValue={l => l.value}
75
+ renderLabel={l => l?.label ?? defaultLanguage}
76
+ renderKey={l => l?.value}
83
77
  value={language}
84
- onChange={l => chat.set('codeLanguage', l.value)}
78
+ onChange={l => chat.set('codeLanguage', l?.value ?? defaultLanguage)}
85
79
  className="language-selector"
80
+ searchable
86
81
  />
87
82
  </TitleBox>
88
83
  )
@@ -125,7 +120,7 @@ const EditorPanel = () => {
125
120
  options={{ minimap: { enabled: false } }}
126
121
  value={value}
127
122
  onChange={v => chat.set('code', v)}
128
- loading={<LoadingCircular />}
123
+ loading={<ProgressCircular />}
129
124
  onMount={setup}
130
125
  />
131
126
  </EditorBox>
@@ -1,5 +1,4 @@
1
- import { Text } from '@citric/core'
2
- import { FaceSmile, KnowledgeSource, QuickCommand, StackSpot } from '@citric/icons'
1
+ import { Row, Text } from '@stack-spot/citric-react'
3
2
  import { Dictionary, useTranslate } from '@stack-spot/portal-translate'
4
3
  import { QuickStartButton } from '../../components/QuickStartButton'
5
4
  import { useCurrentChat } from '../../context/hooks'
@@ -22,28 +21,28 @@ export const BuiltInAgent = ({ username }: HomeProps) => {
22
21
  <HomeBox className="home-page">
23
22
  <Text appearance="h2" className="title">{t.hello}, {username}</Text>
24
23
  <Text appearance="h3" className="subtitle">{t.subtitle}</Text>
25
- <div className="shortcuts">
24
+ <Row className="shortcuts">
26
25
  <QuickStartButton
27
26
  label={t['question.meta']}
28
27
  onClick={() => send(t['question.meta'])}
29
- icon={<StackSpot />}
28
+ icon="StackSpot"
30
29
  />
31
30
  <QuickStartButton
32
31
  label={t['question.ks']}
33
32
  onClick={() => send(t['question.ks'])}
34
- icon={<KnowledgeSource />}
33
+ icon="KnowledgeSource"
35
34
  />
36
35
  <QuickStartButton
37
36
  label={t['question.agents']}
38
37
  onClick={() => send(t['question.agents'])}
39
- icon={<FaceSmile />}
38
+ icon="FaceSmile"
40
39
  />
41
40
  <QuickStartButton
42
41
  label={t['question.qc']}
43
42
  onClick={() => send(t['question.qc'])}
44
- icon={<QuickCommand />}
43
+ icon="QuickCommand"
45
44
  />
46
- </div>
45
+ </Row>
47
46
  </HomeBox>
48
47
  )
49
48
  }
@@ -1,5 +1,5 @@
1
- import { IconBox, Text } from '@citric/core'
2
- import { Agent } from '@citric/icons'
1
+ import { Icon } from '@stack-spot/citric-icons'
2
+ import { Text } from '@stack-spot/citric-react'
3
3
  import { agentToolsClient } from '@stack-spot/portal-network'
4
4
  import { useMemo } from 'react'
5
5
  import { QuickStartButton } from '../../components/QuickStartButton'
@@ -28,7 +28,7 @@ export const CustomAgent = () => {
28
28
 
29
29
  return (
30
30
  <HomeBox className="home-page custom-agent">
31
- {image ? <img src={image} className="avatar" /> : <IconBox className="avatar"><Agent /></IconBox>}
31
+ {image ? <img src={image} className="avatar" /> : <Icon icon="Agent" className="avatar" />}
32
32
  <Text appearance="h3">{label}</Text>
33
33
  <div className="shortcuts">{suggestions?.length ? suggestions : null}</div>
34
34
  </HomeBox>
@@ -1,9 +1,9 @@
1
+ import { FallbackBoundary } from '@stack-spot/citric-react'
1
2
  import { FadingOverflow } from '@stack-spot/portal-components/FadingOverflow'
2
3
  import { agentToolsClient } from '@stack-spot/portal-network'
3
4
  import { styled } from 'styled-components'
4
5
  import { AgentCard } from '../../components/AgentCard'
5
6
  import { AgentCardCreate } from '../../components/AgentCard/AgentCardCreate'
6
- import { FallbackBoundary } from '../../components/FallbackBoundary'
7
7
  import { useCurrentChatState } from '../../context/hooks'
8
8
  import { BuiltInAgent } from './BuiltInAgent'
9
9
  import { CustomAgent } from './CustomAgent'
@@ -14,11 +14,11 @@ const AgentList = styled.ul`
14
14
  margin: 0;
15
15
  padding: 0;
16
16
  display: flex;
17
- align-items: center;
18
17
  gap: 14px;
19
18
 
20
19
  li {
21
20
  flex-shrink: 0;
21
+ display: flex;
22
22
  }
23
23
  `
24
24
 
@@ -21,35 +21,34 @@ export const HomeBox = styled.div`
21
21
  }
22
22
 
23
23
  .shortcuts {
24
- li {
25
- flex: 1;
26
- }
27
- button {
28
- margin-left: 0;
24
+ flex-wrap: wrap;
25
+ button {
26
+ margin-left: 0;
27
+ margin-right: 8px;
28
+ border-radius: 50px;
29
+ padding-inline: 16px;
30
+ padding-block: 8px;
31
+ font-weight: 400;
32
+ line-height: normal;
33
+ border: none;
34
+ max-width: 30vw;
35
+ margin-bottom: 8px;
36
+ i {
37
+ width: 16px;
38
+ height: 16px;
29
39
  margin-right: 8px;
30
- border-radius: 50px;
31
- padding-inline: 16px;
32
- padding-block: 8px;
33
- font-weight: 400;
34
- line-height: normal;
35
- border: none;
36
- max-width: 30vw;
37
- margin-bottom: 8px;
38
- i {
39
- width: 16px;
40
- height: 16px;
41
- margin-right: 8px;
42
- }
43
- &:hover, &:visited, &:active, &:focus {
44
- background-color: ${theme.color.light[600]}
45
- }
40
+ }
41
+ &:hover, &:visited, &:active, &:focus {
42
+ background-color: ${theme.color.light[600]} !important;
43
+ }
46
44
  }
47
45
  }
48
46
 
49
- .avatar, .avatar svg {
47
+ .avatar {
50
48
  width: 74px;
51
49
  height: 74px;
52
50
  border-radius: 50%;
51
+ font-size: 74px;
53
52
  }
54
53
 
55
54
  &.custom-agent {
@@ -1,10 +1,9 @@
1
- import { Flex, IconBox, Text } from '@citric/core'
2
- import { Score } from '@citric/icons'
1
+ import { Icon } from '@stack-spot/citric-icons'
2
+ import { FallbackBoundary, Row, Text } from '@stack-spot/citric-react'
3
3
  import { aiClient } from '@stack-spot/portal-network'
4
4
  import { Dictionary, useTranslate } from '@stack-spot/portal-translate'
5
5
  import { useEffect } from 'react'
6
6
  import { Code } from '../components/Code'
7
- import { FallbackBoundary } from '../components/FallbackBoundary'
8
7
  import { useWidget, useWidgetState } from '../context/hooks'
9
8
  import { useRightPanel } from '../right-panel/hooks'
10
9
  import { extractCodeFromKSDocument } from '../utils/knowledge-source'
@@ -24,13 +23,13 @@ export const KSDocument = () => {
24
23
  <FallbackBoundary><KSDocumentPanel documentId={ks.documentId} slug={ks.slug} /></FallbackBoundary>,
25
24
  {
26
25
  title: (
27
- <Flex flexDirection="row" alignItems="center" flex="1">
26
+ <Row flex={1}>
28
27
  <Text appearance="h5" style={{ flex: 1 }}>{ks.name}</Text>
29
- <Flex flexDirection="row" alignItems="center" style={{ gap: '5px' }} title="Score" aria-label="Score">
30
- <IconBox><Score /></IconBox>
28
+ <Row gap="5px" title="Score" aria-label="Score">
29
+ <Icon icon="Score" />
31
30
  <Text>{ks.score.toFixed(2)}</Text>
32
- </Flex>
33
- </Flex>
31
+ </Row>
32
+ </Row>
34
33
  ),
35
34
  description: t.description,
36
35
  onClose: () => widget.set('panel', undefined),