@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.
- package/CHANGELOG.md +33 -32
- package/dist/StackspotAIWidget.d.ts +14 -2
- package/dist/StackspotAIWidget.d.ts.map +1 -1
- package/dist/StackspotAIWidget.js +7 -8
- package/dist/StackspotAIWidget.js.map +1 -1
- package/dist/app-metadata.json +13 -5
- package/dist/chat-interceptors/quick-commands.js +3 -3
- package/dist/chat-interceptors/quick-commands.js.map +1 -1
- package/dist/components/AdaptiveTextArea.d.ts +1 -1
- package/dist/components/AdaptiveTextArea.d.ts.map +1 -1
- package/dist/components/AdaptiveTextArea.js +1 -1
- package/dist/components/AdaptiveTextArea.js.map +1 -1
- package/dist/components/AgentCard/AgentCardCreate.d.ts.map +1 -1
- package/dist/components/AgentCard/AgentCardCreate.js +4 -5
- package/dist/components/AgentCard/AgentCardCreate.js.map +1 -1
- package/dist/components/AgentCard/index.d.ts.map +1 -1
- package/dist/components/AgentCard/index.js +5 -6
- package/dist/components/AgentCard/index.js.map +1 -1
- package/dist/components/ButtonFavorite.d.ts +8 -7
- package/dist/components/ButtonFavorite.d.ts.map +1 -1
- package/dist/components/ButtonFavorite.js +5 -14
- package/dist/components/ButtonFavorite.js.map +1 -1
- package/dist/components/Code.d.ts.map +1 -1
- package/dist/components/Code.js +11 -9
- package/dist/components/Code.js.map +1 -1
- package/dist/components/ComponentNavigator.d.ts.map +1 -1
- package/dist/components/ComponentNavigator.js +2 -4
- package/dist/components/ComponentNavigator.js.map +1 -1
- package/dist/components/FadingOverflow.d.ts.map +1 -1
- package/dist/components/FadingOverflow.js +3 -4
- package/dist/components/FadingOverflow.js.map +1 -1
- package/dist/components/FileDescription.d.ts.map +1 -1
- package/dist/components/FileDescription.js +3 -4
- package/dist/components/FileDescription.js.map +1 -1
- package/dist/components/HistoryList.d.ts.map +1 -1
- package/dist/components/HistoryList.js +3 -1
- package/dist/components/HistoryList.js.map +1 -1
- package/dist/components/ListResource.js +3 -3
- package/dist/components/ListResource.js.map +1 -1
- package/dist/components/Markdown.js +1 -1
- package/dist/components/Markdown.js.map +1 -1
- package/dist/components/Modal.d.ts.map +1 -1
- package/dist/components/Modal.js +2 -4
- package/dist/components/Modal.js.map +1 -1
- package/dist/components/QuickStartButton.d.ts +2 -3
- package/dist/components/QuickStartButton.d.ts.map +1 -1
- package/dist/components/QuickStartButton.js +4 -3
- package/dist/components/QuickStartButton.js.map +1 -1
- package/dist/components/RightPanelForm.d.ts.map +1 -1
- package/dist/components/RightPanelForm.js +20 -13
- package/dist/components/RightPanelForm.js.map +1 -1
- package/dist/components/RightPanelTabs.d.ts +1 -4
- package/dist/components/RightPanelTabs.d.ts.map +1 -1
- package/dist/components/RightPanelTabs.js +4 -16
- package/dist/components/RightPanelTabs.js.map +1 -1
- package/dist/components/Selector/index.d.ts.map +1 -1
- package/dist/components/Selector/index.js +5 -8
- package/dist/components/Selector/index.js.map +1 -1
- package/dist/components/Selector/styled.d.ts.map +1 -1
- package/dist/components/Selector/styled.js +8 -5
- package/dist/components/Selector/styled.js.map +1 -1
- package/dist/components/StackedBadge.js +5 -5
- package/dist/components/StackedBadge.js.map +1 -1
- package/dist/components/TabManager.d.ts.map +1 -1
- package/dist/components/TabManager.js +9 -32
- package/dist/components/TabManager.js.map +1 -1
- package/dist/components/ToolBadge.d.ts +3 -8
- package/dist/components/ToolBadge.d.ts.map +1 -1
- package/dist/components/ToolBadge.js +23 -99
- package/dist/components/ToolBadge.js.map +1 -1
- package/dist/components/WorkspaceTabNavigator.d.ts.map +1 -1
- package/dist/components/WorkspaceTabNavigator.js +7 -9
- package/dist/components/WorkspaceTabNavigator.js.map +1 -1
- package/dist/components/form/DescribedCheckboxGroup.d.ts +24 -2
- package/dist/components/form/DescribedCheckboxGroup.d.ts.map +1 -1
- package/dist/components/form/DescribedCheckboxGroup.js +46 -29
- package/dist/components/form/DescribedCheckboxGroup.js.map +1 -1
- package/dist/components/form/DescribedRadioGroup.d.ts +24 -4
- package/dist/components/form/DescribedRadioGroup.d.ts.map +1 -1
- package/dist/components/form/DescribedRadioGroup.js +39 -18
- package/dist/components/form/DescribedRadioGroup.js.map +1 -1
- package/dist/context/hooks.d.ts +6 -1
- package/dist/context/hooks.d.ts.map +1 -1
- package/dist/context/hooks.js +4 -1
- package/dist/context/hooks.js.map +1 -1
- package/dist/hooks/midnight-update-view.d.ts +5 -0
- package/dist/hooks/midnight-update-view.d.ts.map +1 -0
- package/dist/hooks/midnight-update-view.js +30 -0
- package/dist/hooks/midnight-update-view.js.map +1 -0
- package/dist/index.d.ts +4 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/layout.css +0 -26
- package/dist/right-panel/DefaultPanel.d.ts.map +1 -1
- package/dist/right-panel/DefaultPanel.js +2 -4
- package/dist/right-panel/DefaultPanel.js.map +1 -1
- package/dist/state/ChatEntry.d.ts +3 -4
- package/dist/state/ChatEntry.d.ts.map +1 -1
- package/dist/state/ChatEntry.js.map +1 -1
- package/dist/state/constants.d.ts.map +1 -1
- package/dist/state/constants.js +1 -0
- package/dist/state/constants.js.map +1 -1
- package/dist/types.d.ts +8 -3
- package/dist/types.d.ts.map +1 -1
- package/dist/utils/tools.d.ts +9 -3
- package/dist/utils/tools.d.ts.map +1 -1
- package/dist/utils/tools.js +1 -6
- package/dist/utils/tools.js.map +1 -1
- package/dist/views/Agents/AgentDescription.d.ts.map +1 -1
- package/dist/views/Agents/AgentDescription.js +8 -13
- package/dist/views/Agents/AgentDescription.js.map +1 -1
- package/dist/views/Agents/AgentsPanel.d.ts.map +1 -1
- package/dist/views/Agents/AgentsPanel.js +7 -7
- package/dist/views/Agents/AgentsPanel.js.map +1 -1
- package/dist/views/Agents/AgentsTab.d.ts.map +1 -1
- package/dist/views/Agents/AgentsTab.js +30 -29
- package/dist/views/Agents/AgentsTab.js.map +1 -1
- package/dist/views/Agents/dictionary.d.ts +1 -1
- package/dist/views/Agents/useAgentFavorites.js +3 -3
- package/dist/views/Agents/useAgentFavorites.js.map +1 -1
- package/dist/views/Chat/AgentInfo.d.ts.map +1 -1
- package/dist/views/Chat/AgentInfo.js +3 -5
- package/dist/views/Chat/AgentInfo.js.map +1 -1
- package/dist/views/Chat/ChatMessage.d.ts +24 -2
- package/dist/views/Chat/ChatMessage.d.ts.map +1 -1
- package/dist/views/Chat/ChatMessage.js +36 -47
- package/dist/views/Chat/ChatMessage.js.map +1 -1
- package/dist/views/Chat/ChatMessages.d.ts +1 -1
- package/dist/views/Chat/ChatMessages.d.ts.map +1 -1
- package/dist/views/Chat/ChatMessages.js +2 -2
- package/dist/views/Chat/ChatMessages.js.map +1 -1
- package/dist/views/Chat/StepsList.d.ts.map +1 -1
- package/dist/views/Chat/StepsList.js +10 -10
- package/dist/views/Chat/StepsList.js.map +1 -1
- package/dist/views/Chat/index.d.ts +1 -1
- package/dist/views/Chat/index.d.ts.map +1 -1
- package/dist/views/Chat/index.js +2 -2
- package/dist/views/Chat/index.js.map +1 -1
- package/dist/views/Chat/styled.d.ts.map +1 -1
- package/dist/views/Chat/styled.js +11 -16
- package/dist/views/Chat/styled.js.map +1 -1
- package/dist/views/ChatHistory/HistoryItem.d.ts.map +1 -1
- package/dist/views/ChatHistory/HistoryItem.js +10 -48
- package/dist/views/ChatHistory/HistoryItem.js.map +1 -1
- package/dist/views/ChatHistory/index.js +1 -1
- package/dist/views/ChatHistory/index.js.map +1 -1
- package/dist/views/ChatHistory/styled.d.ts.map +1 -1
- package/dist/views/ChatHistory/styled.js +3 -5
- package/dist/views/ChatHistory/styled.js.map +1 -1
- package/dist/views/ChatHistory/utils.d.ts +7 -0
- package/dist/views/ChatHistory/utils.d.ts.map +1 -1
- package/dist/views/ChatHistory/utils.js +40 -1
- package/dist/views/ChatHistory/utils.js.map +1 -1
- package/dist/views/ChatTabSelection.d.ts +6 -1
- package/dist/views/ChatTabSelection.d.ts.map +1 -1
- package/dist/views/ChatTabSelection.js +13 -8
- package/dist/views/ChatTabSelection.js.map +1 -1
- package/dist/views/Editor.d.ts.map +1 -1
- package/dist/views/Editor.js +6 -12
- package/dist/views/Editor.js.map +1 -1
- package/dist/views/Home/BuiltInAgent.d.ts.map +1 -1
- package/dist/views/Home/BuiltInAgent.js +2 -3
- package/dist/views/Home/BuiltInAgent.js.map +1 -1
- package/dist/views/Home/CustomAgent.js +3 -3
- package/dist/views/Home/CustomAgent.js.map +1 -1
- package/dist/views/Home/index.js +2 -2
- package/dist/views/Home/index.js.map +1 -1
- package/dist/views/Home/styled.d.ts.map +1 -1
- package/dist/views/Home/styled.js +21 -22
- package/dist/views/Home/styled.js.map +1 -1
- package/dist/views/KSDocument.d.ts.map +1 -1
- package/dist/views/KSDocument.js +3 -4
- package/dist/views/KSDocument.js.map +1 -1
- package/dist/views/KnowledgeSources.d.ts.map +1 -1
- package/dist/views/KnowledgeSources.js +14 -36
- package/dist/views/KnowledgeSources.js.map +1 -1
- package/dist/views/MessageInput/AgentSelector.d.ts.map +1 -1
- package/dist/views/MessageInput/AgentSelector.js +7 -5
- package/dist/views/MessageInput/AgentSelector.js.map +1 -1
- package/dist/views/MessageInput/ButtonAgent.d.ts.map +1 -1
- package/dist/views/MessageInput/ButtonAgent.js +4 -5
- package/dist/views/MessageInput/ButtonAgent.js.map +1 -1
- package/dist/views/MessageInput/ButtonBar.d.ts.map +1 -1
- package/dist/views/MessageInput/ButtonBar.js +2 -4
- package/dist/views/MessageInput/ButtonBar.js.map +1 -1
- package/dist/views/MessageInput/ContextBar.d.ts.map +1 -1
- package/dist/views/MessageInput/ContextBar.js +3 -6
- package/dist/views/MessageInput/ContextBar.js.map +1 -1
- package/dist/views/MessageInput/QuickCommandSelector.js +2 -2
- package/dist/views/MessageInput/QuickCommandSelector.js.map +1 -1
- package/dist/views/MessageInput/SelectContent.d.ts.map +1 -1
- package/dist/views/MessageInput/SelectContent.js +30 -29
- package/dist/views/MessageInput/SelectContent.js.map +1 -1
- package/dist/views/MessageInput/UploadDragNDrop.d.ts.map +1 -1
- package/dist/views/MessageInput/UploadDragNDrop.js +2 -3
- package/dist/views/MessageInput/UploadDragNDrop.js.map +1 -1
- package/dist/views/MessageInput/dictionary.d.ts +1 -1
- package/dist/views/MessageInput/index.d.ts +2 -1
- package/dist/views/MessageInput/index.d.ts.map +1 -1
- package/dist/views/MessageInput/index.js +5 -6
- package/dist/views/MessageInput/index.js.map +1 -1
- package/dist/views/MessageInput/styled.d.ts +1 -3
- package/dist/views/MessageInput/styled.d.ts.map +1 -1
- package/dist/views/MessageInput/styled.js +11 -15
- package/dist/views/MessageInput/styled.js.map +1 -1
- package/dist/views/MinimizedHeader.d.ts.map +1 -1
- package/dist/views/MinimizedHeader.js +3 -4
- package/dist/views/MinimizedHeader.js.map +1 -1
- package/dist/views/Resources.d.ts.map +1 -1
- package/dist/views/Resources.js +11 -8
- package/dist/views/Resources.js.map +1 -1
- package/dist/views/Stacks.d.ts.map +1 -1
- package/dist/views/Stacks.js +23 -28
- package/dist/views/Stacks.js.map +1 -1
- package/dist/views/Steps/FlowChart/NodeStep.d.ts.map +1 -1
- package/dist/views/Steps/FlowChart/NodeStep.js +3 -3
- package/dist/views/Steps/FlowChart/NodeStep.js.map +1 -1
- package/dist/views/Steps/StepModal.d.ts.map +1 -1
- package/dist/views/Steps/StepModal.js +4 -6
- package/dist/views/Steps/StepModal.js.map +1 -1
- package/dist/views/Steps/dictionary.d.ts +1 -1
- package/dist/views/Steps/index.d.ts.map +1 -1
- package/dist/views/Steps/index.js +3 -4
- package/dist/views/Steps/index.js.map +1 -1
- package/dist/views/Steps/utils.d.ts +2 -1
- package/dist/views/Steps/utils.d.ts.map +1 -1
- package/dist/views/Steps/utils.js +8 -8
- package/dist/views/Steps/utils.js.map +1 -1
- package/dist/views/Tools.js +1 -1
- package/dist/views/Tools.js.map +1 -1
- package/dist/views/Workspaces/WorkspacesTab.d.ts.map +1 -1
- package/dist/views/Workspaces/WorkspacesTab.js +7 -10
- package/dist/views/Workspaces/WorkspacesTab.js.map +1 -1
- package/dist/views/Workspaces/index.js +4 -2
- package/dist/views/Workspaces/index.js.map +1 -1
- package/package.json +5 -3
- package/src/StackspotAIWidget.tsx +51 -37
- package/src/app-metadata.json +13 -5
- package/src/chat-interceptors/quick-commands.ts +3 -3
- package/src/components/AdaptiveTextArea.tsx +1 -1
- package/src/components/AgentCard/AgentCardCreate.tsx +4 -7
- package/src/components/AgentCard/index.tsx +7 -7
- package/src/components/ButtonFavorite.tsx +20 -47
- package/src/components/Code.tsx +31 -36
- package/src/components/ComponentNavigator.tsx +4 -8
- package/src/components/FadingOverflow.tsx +6 -7
- package/src/components/FileDescription.tsx +14 -10
- package/src/components/HistoryList.tsx +4 -1
- package/src/components/ListResource.tsx +5 -5
- package/src/components/Markdown.tsx +1 -1
- package/src/components/Modal.tsx +2 -4
- package/src/components/QuickStartButton.tsx +5 -4
- package/src/components/RightPanelForm.tsx +20 -13
- package/src/components/RightPanelTabs.tsx +4 -32
- package/src/components/Selector/index.tsx +17 -13
- package/src/components/Selector/styled.ts +8 -5
- package/src/components/StackedBadge.tsx +5 -5
- package/src/components/TabManager.tsx +31 -55
- package/src/components/ToolBadge.tsx +48 -129
- package/src/components/WorkspaceTabNavigator.tsx +22 -25
- package/src/components/form/DescribedCheckboxGroup.tsx +90 -65
- package/src/components/form/DescribedRadioGroup.tsx +78 -46
- package/src/context/hooks.ts +4 -1
- package/src/hooks/midnight-update-view.ts +36 -0
- package/src/index.ts +4 -2
- package/src/layout.css +0 -26
- package/src/right-panel/DefaultPanel.tsx +3 -7
- package/src/state/ChatEntry.ts +3 -4
- package/src/state/constants.ts +2 -1
- package/src/types.ts +9 -3
- package/src/utils/tools.ts +3 -12
- package/src/views/Agents/AgentDescription.tsx +20 -36
- package/src/views/Agents/AgentsPanel.tsx +11 -12
- package/src/views/Agents/AgentsTab.tsx +38 -57
- package/src/views/Agents/useAgentFavorites.ts +3 -3
- package/src/views/Chat/AgentInfo.tsx +7 -6
- package/src/views/Chat/ChatMessage.tsx +163 -145
- package/src/views/Chat/ChatMessages.tsx +2 -1
- package/src/views/Chat/StepsList.tsx +10 -11
- package/src/views/Chat/index.tsx +9 -2
- package/src/views/Chat/styled.ts +11 -16
- package/src/views/ChatHistory/HistoryItem.tsx +15 -54
- package/src/views/ChatHistory/index.tsx +1 -1
- package/src/views/ChatHistory/styled.ts +3 -5
- package/src/views/ChatHistory/utils.ts +43 -2
- package/src/views/ChatTabSelection.tsx +18 -10
- package/src/views/Editor.tsx +9 -14
- package/src/views/Home/BuiltInAgent.tsx +7 -8
- package/src/views/Home/CustomAgent.tsx +3 -3
- package/src/views/Home/index.tsx +2 -2
- package/src/views/Home/styled.ts +21 -22
- package/src/views/KSDocument.tsx +7 -8
- package/src/views/KnowledgeSources.tsx +24 -66
- package/src/views/MessageInput/AgentSelector.tsx +10 -8
- package/src/views/MessageInput/ButtonAgent.tsx +24 -12
- package/src/views/MessageInput/ButtonBar.tsx +25 -21
- package/src/views/MessageInput/ContextBar.tsx +16 -14
- package/src/views/MessageInput/QuickCommandSelector.tsx +2 -2
- package/src/views/MessageInput/SelectContent.tsx +39 -62
- package/src/views/MessageInput/UploadDragNDrop.tsx +2 -5
- package/src/views/MessageInput/index.tsx +8 -9
- package/src/views/MessageInput/styled.ts +12 -16
- package/src/views/MinimizedHeader.tsx +5 -7
- package/src/views/Resources.tsx +31 -30
- package/src/views/Stacks.tsx +31 -54
- package/src/views/Steps/FlowChart/NodeStep.tsx +6 -4
- package/src/views/Steps/StepModal.tsx +14 -18
- package/src/views/Steps/index.tsx +4 -5
- package/src/views/Steps/utils.tsx +9 -9
- package/src/views/Tools.tsx +0 -1
- package/src/views/Workspaces/WorkspacesTab.tsx +17 -21
- package/src/views/Workspaces/index.tsx +4 -2
- package/dist/components/Accordion.d.ts +0 -20
- package/dist/components/Accordion.d.ts.map +0 -1
- package/dist/components/Accordion.js +0 -51
- package/dist/components/Accordion.js.map +0 -1
- package/dist/components/FallbackBoundary/ErrorBoundary.d.ts +0 -33
- package/dist/components/FallbackBoundary/ErrorBoundary.d.ts.map +0 -1
- package/dist/components/FallbackBoundary/ErrorBoundary.js +0 -52
- package/dist/components/FallbackBoundary/ErrorBoundary.js.map +0 -1
- package/dist/components/FallbackBoundary/Loading.d.ts +0 -2
- package/dist/components/FallbackBoundary/Loading.d.ts.map +0 -1
- package/dist/components/FallbackBoundary/Loading.js +0 -12
- package/dist/components/FallbackBoundary/Loading.js.map +0 -1
- package/dist/components/FallbackBoundary/index.d.ts +0 -17
- package/dist/components/FallbackBoundary/index.d.ts.map +0 -1
- package/dist/components/FallbackBoundary/index.js +0 -9
- package/dist/components/FallbackBoundary/index.js.map +0 -1
- package/dist/components/IconInput.d.ts +0 -10
- package/dist/components/IconInput.d.ts.map +0 -1
- package/dist/components/IconInput.js +0 -61
- package/dist/components/IconInput.js.map +0 -1
- package/dist/components/OverlayMenu.d.ts +0 -21
- package/dist/components/OverlayMenu.d.ts.map +0 -1
- package/dist/components/OverlayMenu.js +0 -79
- package/dist/components/OverlayMenu.js.map +0 -1
- package/dist/components/ProgressBar.d.ts +0 -37
- package/dist/components/ProgressBar.d.ts.map +0 -1
- package/dist/components/ProgressBar.js +0 -131
- package/dist/components/ProgressBar.js.map +0 -1
- package/dist/components/Tooltip/Tooltip.d.ts +0 -37
- package/dist/components/Tooltip/Tooltip.d.ts.map +0 -1
- package/dist/components/Tooltip/Tooltip.js +0 -30
- package/dist/components/Tooltip/Tooltip.js.map +0 -1
- package/dist/components/Tooltip/TooltipAPI.d.ts +0 -29
- package/dist/components/Tooltip/TooltipAPI.d.ts.map +0 -1
- package/dist/components/Tooltip/TooltipAPI.js +0 -107
- package/dist/components/Tooltip/TooltipAPI.js.map +0 -1
- package/dist/components/Tooltip/context.d.ts +0 -5
- package/dist/components/Tooltip/context.d.ts.map +0 -1
- package/dist/components/Tooltip/context.js +0 -18
- package/dist/components/Tooltip/context.js.map +0 -1
- package/dist/components/Tooltip/index.d.ts +0 -3
- package/dist/components/Tooltip/index.d.ts.map +0 -1
- package/dist/components/Tooltip/index.js +0 -3
- package/dist/components/Tooltip/index.js.map +0 -1
- package/dist/components/Tooltip/style.d.ts +0 -4
- package/dist/components/Tooltip/style.d.ts.map +0 -1
- package/dist/components/Tooltip/style.js +0 -22
- package/dist/components/Tooltip/style.js.map +0 -1
- package/dist/components/Tooltip/types.d.ts +0 -27
- package/dist/components/Tooltip/types.d.ts.map +0 -1
- package/dist/components/Tooltip/types.js +0 -2
- package/dist/components/Tooltip/types.js.map +0 -1
- package/src/components/Accordion.tsx +0 -75
- package/src/components/FallbackBoundary/ErrorBoundary.tsx +0 -71
- package/src/components/FallbackBoundary/Loading.tsx +0 -14
- package/src/components/FallbackBoundary/index.tsx +0 -26
- package/src/components/IconInput.tsx +0 -73
- package/src/components/OverlayMenu.tsx +0 -133
- package/src/components/ProgressBar.tsx +0 -183
- package/src/components/Tooltip/Tooltip.tsx +0 -78
- package/src/components/Tooltip/TooltipAPI.ts +0 -101
- package/src/components/Tooltip/context.tsx +0 -24
- package/src/components/Tooltip/index.ts +0 -2
- package/src/components/Tooltip/style.tsx +0 -24
- package/src/components/Tooltip/types.ts +0 -28
package/src/views/Chat/styled.ts
CHANGED
|
@@ -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
|
-
|
|
29
|
-
|
|
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 {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
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 {
|
|
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
|
-
|
|
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:
|
|
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={
|
|
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}
|
|
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 ? <
|
|
153
|
-
<
|
|
154
|
-
</
|
|
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 {
|
|
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
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
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:
|
|
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
|
package/src/views/Editor.tsx
CHANGED
|
@@ -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
|
-
|
|
30
|
+
height: 28px;
|
|
33
31
|
position: absolute;
|
|
34
32
|
top: -4px;
|
|
35
33
|
right: 0;
|
|
36
34
|
|
|
37
|
-
.
|
|
38
|
-
|
|
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
|
|
82
|
-
|
|
75
|
+
renderLabel={l => l?.label ?? defaultLanguage}
|
|
76
|
+
renderKey={l => l?.value}
|
|
83
77
|
value={language}
|
|
84
|
-
onChange={l => chat.set('codeLanguage', l
|
|
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={<
|
|
123
|
+
loading={<ProgressCircular />}
|
|
129
124
|
onMount={setup}
|
|
130
125
|
/>
|
|
131
126
|
</EditorBox>
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { Text } from '@citric
|
|
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
|
-
<
|
|
24
|
+
<Row className="shortcuts">
|
|
26
25
|
<QuickStartButton
|
|
27
26
|
label={t['question.meta']}
|
|
28
27
|
onClick={() => send(t['question.meta'])}
|
|
29
|
-
icon=
|
|
28
|
+
icon="StackSpot"
|
|
30
29
|
/>
|
|
31
30
|
<QuickStartButton
|
|
32
31
|
label={t['question.ks']}
|
|
33
32
|
onClick={() => send(t['question.ks'])}
|
|
34
|
-
icon=
|
|
33
|
+
icon="KnowledgeSource"
|
|
35
34
|
/>
|
|
36
35
|
<QuickStartButton
|
|
37
36
|
label={t['question.agents']}
|
|
38
37
|
onClick={() => send(t['question.agents'])}
|
|
39
|
-
icon=
|
|
38
|
+
icon="FaceSmile"
|
|
40
39
|
/>
|
|
41
40
|
<QuickStartButton
|
|
42
41
|
label={t['question.qc']}
|
|
43
42
|
onClick={() => send(t['question.qc'])}
|
|
44
|
-
icon=
|
|
43
|
+
icon="QuickCommand"
|
|
45
44
|
/>
|
|
46
|
-
</
|
|
45
|
+
</Row>
|
|
47
46
|
</HomeBox>
|
|
48
47
|
)
|
|
49
48
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
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" /> : <
|
|
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>
|
package/src/views/Home/index.tsx
CHANGED
|
@@ -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
|
|
package/src/views/Home/styled.ts
CHANGED
|
@@ -21,35 +21,34 @@ export const HomeBox = styled.div`
|
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
.shortcuts {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
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
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
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
|
|
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 {
|
package/src/views/KSDocument.tsx
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
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
|
-
<
|
|
26
|
+
<Row flex={1}>
|
|
28
27
|
<Text appearance="h5" style={{ flex: 1 }}>{ks.name}</Text>
|
|
29
|
-
<
|
|
30
|
-
<
|
|
28
|
+
<Row gap="5px" title="Score" aria-label="Score">
|
|
29
|
+
<Icon icon="Score" />
|
|
31
30
|
<Text>{ks.score.toFixed(2)}</Text>
|
|
32
|
-
</
|
|
33
|
-
</
|
|
31
|
+
</Row>
|
|
32
|
+
</Row>
|
|
34
33
|
),
|
|
35
34
|
description: t.description,
|
|
36
35
|
onClose: () => widget.set('panel', undefined),
|