@stack-spot/ai-chat-widget 1.36.3-beta.1 → 2.0.0-betacitric.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 +1 -54
- package/dist/StackspotAIWidget.d.ts +6 -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 -17
- package/dist/chat-interceptors/quick-commands.d.ts.map +1 -1
- package/dist/chat-interceptors/quick-commands.js +3 -9
- 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 +0 -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.js +1 -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 +8 -31
- 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 +21 -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/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -1
- package/dist/index.js.map +1 -1
- package/dist/layout.css +1 -27
- 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.js +2 -2
- package/dist/state/constants.js.map +1 -1
- package/dist/types.d.ts +7 -3
- package/dist/types.d.ts.map +1 -1
- package/dist/utils/upload/FileUpload.d.ts.map +1 -1
- package/dist/utils/upload/FileUpload.js +2 -1
- package/dist/utils/upload/FileUpload.js.map +1 -1
- package/dist/views/Agents/AgentDescription.d.ts.map +1 -1
- package/dist/views/Agents/AgentDescription.js +5 -6
- 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 +29 -28
- package/dist/views/Agents/AgentsTab.js.map +1 -1
- package/dist/views/Agents/dictionary.d.ts +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.map +1 -1
- package/dist/views/Chat/ChatMessage.js +28 -36
- package/dist/views/Chat/ChatMessage.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/styled.d.ts.map +1 -1
- package/dist/views/Chat/styled.js +8 -2
- 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 +7 -14
- 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/ChatTabSelection.d.ts +6 -1
- package/dist/views/ChatTabSelection.d.ts.map +1 -1
- package/dist/views/ChatTabSelection.js +12 -7
- 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 -35
- package/dist/views/MessageInput/SelectContent.js.map +1 -1
- package/dist/views/MessageInput/UploadBar.d.ts.map +1 -1
- package/dist/views/MessageInput/UploadBar.js +3 -31
- package/dist/views/MessageInput/UploadBar.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/dictionary.d.ts.map +1 -1
- package/dist/views/MessageInput/dictionary.js +0 -6
- package/dist/views/MessageInput/dictionary.js.map +1 -1
- package/dist/views/MessageInput/index.d.ts.map +1 -1
- package/dist/views/MessageInput/index.js +3 -4
- 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 -27
- package/dist/views/MessageInput/styled.js.map +1 -1
- package/dist/views/MinimizedHeader.d.ts.map +1 -1
- package/dist/views/MinimizedHeader.js +2 -4
- package/dist/views/MinimizedHeader.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 +12 -13
- package/src/StackspotAIWidget.tsx +36 -34
- package/src/app-metadata.json +13 -17
- package/src/chat-interceptors/quick-commands.ts +5 -11
- 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 -11
- package/src/components/HistoryList.tsx +1 -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 +28 -54
- package/src/components/ToolBadge.tsx +39 -129
- package/src/components/WorkspaceTabNavigator.tsx +22 -25
- package/src/components/form/DescribedCheckboxGroup.tsx +90 -65
- package/src/components/form/DescribedRadioGroup.tsx +79 -46
- package/src/index.ts +1 -2
- package/src/layout.css +1 -27
- package/src/right-panel/DefaultPanel.tsx +3 -7
- package/src/state/ChatEntry.ts +3 -4
- package/src/state/constants.ts +2 -2
- package/src/types.ts +8 -3
- package/src/utils/upload/FileUpload.ts +2 -1
- package/src/views/Agents/AgentDescription.tsx +6 -7
- package/src/views/Agents/AgentsPanel.tsx +11 -12
- package/src/views/Agents/AgentsTab.tsx +37 -56
- package/src/views/Chat/AgentInfo.tsx +7 -6
- package/src/views/Chat/ChatMessage.tsx +109 -118
- package/src/views/Chat/StepsList.tsx +10 -11
- package/src/views/Chat/styled.ts +8 -2
- package/src/views/ChatHistory/HistoryItem.tsx +12 -19
- package/src/views/ChatHistory/index.tsx +1 -1
- package/src/views/ChatHistory/styled.ts +3 -5
- package/src/views/ChatTabSelection.tsx +17 -9
- 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 +17 -14
- package/src/views/MessageInput/QuickCommandSelector.tsx +2 -2
- package/src/views/MessageInput/SelectContent.tsx +39 -69
- package/src/views/MessageInput/UploadBar.tsx +1 -42
- package/src/views/MessageInput/UploadDragNDrop.tsx +2 -5
- package/src/views/MessageInput/dictionary.ts +0 -6
- package/src/views/MessageInput/index.tsx +5 -7
- package/src/views/MessageInput/styled.ts +12 -28
- package/src/views/MinimizedHeader.tsx +4 -7
- 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
|
@@ -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),
|
|
@@ -1,16 +1,12 @@
|
|
|
1
|
-
import { Button } from '@citric
|
|
2
|
-
import { Search } from '@citric/icons'
|
|
1
|
+
import { Button, Tab } from '@stack-spot/citric-react'
|
|
3
2
|
import { Placeholder } from '@stack-spot/portal-components/Placeholder'
|
|
4
3
|
import { aiClient, dataIntegrationClient, workspaceAiClient } from '@stack-spot/portal-network'
|
|
5
|
-
import {
|
|
4
|
+
import { VisibilityLevelEnum } from '@stack-spot/portal-network/api/ai'
|
|
6
5
|
import { WorkspaceResponse } from '@stack-spot/portal-network/api/workspace-ai'
|
|
7
6
|
import { Dictionary, useTranslate } from '@stack-spot/portal-translate'
|
|
8
|
-
import {
|
|
9
|
-
import React, { ReactElement, useCallback, useEffect, useMemo, useRef, useState } from 'react'
|
|
10
|
-
import { ButtonFavorite } from '../components/ButtonFavorite'
|
|
7
|
+
import React, { useCallback, useEffect, useMemo, useRef } from 'react'
|
|
11
8
|
import { NavigationComponent } from '../components/ComponentNavigator'
|
|
12
9
|
import { DescribedCheckboxGroup } from '../components/form/DescribedCheckboxGroup'
|
|
13
|
-
import { IconInput } from '../components/IconInput'
|
|
14
10
|
import { RightPanelContentList } from '../components/RightPanelContentList'
|
|
15
11
|
import { RightPanelTabs } from '../components/RightPanelTabs'
|
|
16
12
|
import { WorkspaceTabNavigator } from '../components/WorkspaceTabNavigator'
|
|
@@ -28,8 +24,6 @@ export interface TabProps {
|
|
|
28
24
|
onSubmit?: () => void,
|
|
29
25
|
}
|
|
30
26
|
|
|
31
|
-
type TabElement = { title: string, content: ReactElement }
|
|
32
|
-
|
|
33
27
|
export const KnowledgeSources = () => {
|
|
34
28
|
const t = useTranslate(dictionary)
|
|
35
29
|
const panel = useWidgetState('panel')
|
|
@@ -69,15 +63,15 @@ const KnowledgeSourcesPanel = () => {
|
|
|
69
63
|
allKS.current = chat.get('knowledgeSources') ?? []
|
|
70
64
|
}, [chat])
|
|
71
65
|
|
|
72
|
-
const allTabsMap: Partial<Record<Scope,
|
|
73
|
-
favorite: {
|
|
66
|
+
const allTabsMap: Partial<Record<Scope, Omit<Tab, 'key'>>> = {
|
|
67
|
+
favorite: { label: t.favorites,
|
|
74
68
|
content: <KnowledgeSourcesTab key="favorite" visibility="favorite" allKS={allKS} onSubmit={onSubmit} /> },
|
|
75
|
-
personal: {
|
|
69
|
+
personal: { label: t.personal,
|
|
76
70
|
content: <KnowledgeSourcesTab key="personal" visibility="personal" allKS={allKS} onSubmit={onSubmit} /> },
|
|
77
|
-
shared: {
|
|
78
|
-
workspace: {
|
|
71
|
+
shared: { label: t.shared, content: <KnowledgeSourcesTab key="shared" visibility="shared" allKS={allKS} onSubmit={onSubmit} /> },
|
|
72
|
+
workspace: { label: t.spots,
|
|
79
73
|
content: <KnowledgeSourcesTabWorkspace key="workspace" visibility="workspace" allKS={allKS} onSubmit={onSubmit} /> },
|
|
80
|
-
account: {
|
|
74
|
+
account: { label: t.account, content: <KnowledgeSourcesTab key="account" visibility="account" allKS={allKS} onSubmit={onSubmit} /> },
|
|
81
75
|
}
|
|
82
76
|
|
|
83
77
|
const defaultScopes: Scope[] = ['favorite', 'personal', 'shared', 'workspace', 'account']
|
|
@@ -89,8 +83,8 @@ const KnowledgeSourcesPanel = () => {
|
|
|
89
83
|
: rawScopes
|
|
90
84
|
|
|
91
85
|
const tabs = scopesToRender
|
|
92
|
-
.map(scope => allTabsMap[scope])
|
|
93
|
-
.filter(Boolean) as
|
|
86
|
+
.map(scope => scope in allTabsMap ? { key: scope, ...allTabsMap[scope] } : undefined)
|
|
87
|
+
.filter(Boolean) as Tab[]
|
|
94
88
|
|
|
95
89
|
return (isGroupResourcesByScope ? (
|
|
96
90
|
<RightPanelTabs key={chat.id} tabs={tabs} />
|
|
@@ -101,14 +95,15 @@ const KnowledgeSourcesPanel = () => {
|
|
|
101
95
|
|
|
102
96
|
export const KnowledgeSourcesTab = ({ visibility, allKS, onSubmit, workspaceId, showSubmitButton = true }: TabProps) => {
|
|
103
97
|
const t = useTranslate(dictionary)
|
|
104
|
-
const [filter, setFilter] = useState('')
|
|
105
|
-
|
|
106
98
|
const knowledgeSources = workspaceId
|
|
107
99
|
? workspaceAiClient.getKSFromWorkspaceAi.useQuery({ workspaceId })
|
|
108
100
|
: aiClient.knowledgeSources.useQuery({
|
|
109
101
|
visibility, order: 'a-to-z', types: ['snippet', 'api', 'event', 'custom'],
|
|
110
102
|
})
|
|
111
|
-
|
|
103
|
+
const initialValue = useMemo(() => {
|
|
104
|
+
const currentlySelected = allKS.current?.map(ks => ks.id)
|
|
105
|
+
return knowledgeSources.filter(ks => currentlySelected?.includes(ks.slug))
|
|
106
|
+
}, [])
|
|
112
107
|
const listFavorites = dataIntegrationClient.knowledgeSources.useQuery({ visibility: 'favorite' })
|
|
113
108
|
const [addFavorite, pendingAddFav] = dataIntegrationClient.addFavoriteKnowledgeSource.useMutation()
|
|
114
109
|
const [removeFavorite, pendingRemoveFav] = dataIntegrationClient.removeFavoriteKnowledgeSource.useMutation()
|
|
@@ -165,56 +160,19 @@ export const KnowledgeSourcesTab = ({ visibility, allKS, onSubmit, workspaceId,
|
|
|
165
160
|
}
|
|
166
161
|
})
|
|
167
162
|
|
|
168
|
-
const [value, setValue] = useState<KnowledgeSourceItemResponse[]>((() => {
|
|
169
|
-
const currentlySelected = allKS.current?.map(ks => ks.id)
|
|
170
|
-
return knowledgeSources.filter(ks => currentlySelected?.includes(ks.slug))
|
|
171
|
-
})())
|
|
172
|
-
const filtered = useMemo(
|
|
173
|
-
() => filter
|
|
174
|
-
// Recreate the list so that the favorites list is taken into account
|
|
175
|
-
? knowledgeSources.filter(ks => value.includes(ks) || ks.name.toLocaleLowerCase().includes(filter.toLocaleLowerCase()))
|
|
176
|
-
: [...knowledgeSources]
|
|
177
|
-
, [knowledgeSources, filter, value, listFavorites],
|
|
178
|
-
)
|
|
179
|
-
|
|
180
|
-
const onChange = useCallback((newValue: KnowledgeSourceItemResponse[]) => {
|
|
181
|
-
setValue((current) => {
|
|
182
|
-
const added = difference(newValue, current)
|
|
183
|
-
const removed = difference(current, newValue)
|
|
184
|
-
allKS.current = allKS.current?.filter(ks => !removed.some(r => r.slug === ks.id)) ?? []
|
|
185
|
-
allKS.current = uniqBy([...allKS.current, ...added.map(ks => ({ id: ks.slug, label: ks.name }))], 'id')
|
|
186
|
-
return newValue
|
|
187
|
-
})
|
|
188
|
-
}, [])
|
|
189
|
-
|
|
190
163
|
return (
|
|
191
164
|
<>
|
|
192
165
|
<div className="content">
|
|
193
|
-
<
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
keygen={ks => ks.id}
|
|
202
|
-
value={value}
|
|
203
|
-
onChange={onChange}
|
|
204
|
-
renderLabel={ks => ks.name}
|
|
205
|
-
renderDescription={ks => ks.description}
|
|
206
|
-
optionClassName={ks => (filter && !ks.name.toLocaleLowerCase().includes(filter.toLocaleLowerCase()) && value.includes(ks))
|
|
207
|
-
? 'filtered-out'
|
|
208
|
-
: ''
|
|
209
|
-
}
|
|
210
|
-
className="option-list"
|
|
211
|
-
/>}
|
|
212
|
-
{!!filtered.length && !filtered.length && (
|
|
213
|
-
<Placeholder title={t.noSearchResults} description={t.noSearchResultsDescription} />
|
|
214
|
-
)}
|
|
215
|
-
{!filtered.length && <Placeholder title={t.noData} description={t.noDataDescription} className="no-data-placeholder" />}
|
|
166
|
+
<DescribedCheckboxGroup
|
|
167
|
+
options={knowledgeSources}
|
|
168
|
+
initialValue={initialValue}
|
|
169
|
+
globalSelection={allKS}
|
|
170
|
+
data={ks => ({ idOrSlug: ks.slug, description: ks.description, name: ks.name, listFavorites, onAddFavorite, onRemoveFavorite })}
|
|
171
|
+
emptyResults={<Placeholder title={t.noSearchResults} description={t.noSearchResultsDescription} />}
|
|
172
|
+
emptyDataset={<Placeholder title={t.noData} description={t.noDataDescription} className="no-data-placeholder" />}
|
|
173
|
+
/>
|
|
216
174
|
</div>
|
|
217
|
-
{!!
|
|
175
|
+
{!!knowledgeSources.length && showSubmitButton && <Button onClick={onSubmit}>{t.apply}</Button>}
|
|
218
176
|
</>
|
|
219
177
|
)
|
|
220
178
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { Icon } from '@stack-spot/citric-icons'
|
|
2
|
+
import { IconBox, Row, Text } from '@stack-spot/citric-react'
|
|
3
3
|
import { AgentResponseWithBuiltIn, agentToolsClient, workspaceAiClient } from '@stack-spot/portal-network'
|
|
4
4
|
import { useCallback } from 'react'
|
|
5
5
|
import { Selector } from '../../components/Selector'
|
|
@@ -10,15 +10,17 @@ import { useAgentFavorites } from '../Agents/useAgentFavorites'
|
|
|
10
10
|
type AgentWithSpaceName = AgentResponseWithBuiltIn
|
|
11
11
|
|
|
12
12
|
const AgentItem = ({ avatar, name, spaceName }: AgentWithSpaceName) => {
|
|
13
|
-
const avatarComponent = avatar
|
|
13
|
+
const avatarComponent = avatar
|
|
14
|
+
? <img style={{ width: '32px', height: '32px', borderRadius: '50%' }} src={avatar} />
|
|
15
|
+
: <IconBox size="md" icon="Agent" style={{ backgroundColor: 'transparent' }} />
|
|
14
16
|
|
|
15
|
-
return <
|
|
17
|
+
return <Row gap="8px" style={{ flexWrap: 'nowrap' }}>
|
|
16
18
|
{avatarComponent}
|
|
17
19
|
<div>
|
|
18
|
-
<
|
|
19
|
-
<
|
|
20
|
+
<Text className="selector-description">{spaceName}</Text>
|
|
21
|
+
<Text className="selector-title">{name}</Text>
|
|
20
22
|
</div>
|
|
21
|
-
</
|
|
23
|
+
</Row>
|
|
22
24
|
}
|
|
23
25
|
|
|
24
26
|
export const AgentSelector = ({ inputRef, isTrial }: {
|
|
@@ -72,7 +74,7 @@ export const AgentSelector = ({ inputRef, isTrial }: {
|
|
|
72
74
|
selectorConfig={{
|
|
73
75
|
resourceName: 'Agent',
|
|
74
76
|
shortcut: '@',
|
|
75
|
-
icon: <Agent />,
|
|
77
|
+
icon: <Icon icon="Agent" />,
|
|
76
78
|
regex: agentRegex,
|
|
77
79
|
urlBuilder: (agent) => `/agents/${agent?.id}`,
|
|
78
80
|
searchProp: 'name',
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { IconButton, Tooltip } from '@citric/ui'
|
|
1
|
+
import { Icon } from '@stack-spot/citric-icons'
|
|
2
|
+
import { Center, ImageButton, ImageWithFallback, Tooltip } from '@stack-spot/citric-react'
|
|
4
3
|
import { MiniLogo } from '@stack-spot/portal-components/svg'
|
|
5
4
|
import { agentToolsClient } from '@stack-spot/portal-network'
|
|
6
5
|
import { useEffect } from 'react'
|
|
@@ -41,17 +40,30 @@ export const ButtonAgent = () => {
|
|
|
41
40
|
<div className="button-group">
|
|
42
41
|
{features.agent && (
|
|
43
42
|
<div className="group-agent">
|
|
44
|
-
<
|
|
43
|
+
<ImageButton
|
|
44
|
+
aria-label={t.agent}
|
|
45
|
+
title={t.agent}
|
|
46
|
+
className="agent"
|
|
47
|
+
onClick={() => widget.set('panel', 'agent')}
|
|
48
|
+
>
|
|
45
49
|
{agentDefault?.avatar ? <img src={agentDefault.avatar} className="image" /> : <MiniLogo />}
|
|
46
|
-
</
|
|
50
|
+
</ImageButton>
|
|
47
51
|
{agent?.id && !isAgentDefault() &&
|
|
48
|
-
<Tooltip
|
|
49
|
-
<
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
52
|
+
<Tooltip content={t.remove} >
|
|
53
|
+
<ImageButton
|
|
54
|
+
aria-label={t.remove}
|
|
55
|
+
className="agent agent-selected"
|
|
56
|
+
onClick={setAgentDefault}
|
|
57
|
+
>
|
|
58
|
+
<ImageWithFallback
|
|
59
|
+
src={agent.image ?? ''}
|
|
60
|
+
className="image"
|
|
61
|
+
fallback={<Icon className="image" size="xs" icon="Agent" />}
|
|
62
|
+
/>
|
|
63
|
+
<Center className="icon-remove">
|
|
64
|
+
<Icon icon="TimesMini" />
|
|
65
|
+
</Center>
|
|
66
|
+
</ImageButton>
|
|
55
67
|
</Tooltip>
|
|
56
68
|
}
|
|
57
69
|
</div>
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { ArrowUp, Code, Stop } from '@citric/icons'
|
|
3
|
-
import { IconButton } from '@citric/ui'
|
|
1
|
+
import { IconButton, Row } from '@stack-spot/citric-react'
|
|
4
2
|
import { useCurrentChat, useCurrentChatState, useWidget } from '../../context/hooks'
|
|
5
3
|
import { useMessageInputDictionary } from './dictionary'
|
|
6
4
|
import { SelectContent } from './SelectContent'
|
|
@@ -25,27 +23,33 @@ export const ButtonBar = ({ onSend, isLoading }: SelectionBarProps) => {
|
|
|
25
23
|
|
|
26
24
|
return (
|
|
27
25
|
<SelectionBarWrapper className="button-group">
|
|
28
|
-
<
|
|
26
|
+
<Row center={false} gap="4px">
|
|
29
27
|
<SelectContent />
|
|
30
28
|
{features.editor && (
|
|
31
|
-
<IconButton
|
|
32
|
-
<Code />
|
|
33
|
-
</IconButton>
|
|
29
|
+
<IconButton icon="Code" appearance="square" aria-label={t.code} title={t.code} onClick={() => widget.set('panel', 'editor')} />
|
|
34
30
|
)}
|
|
35
|
-
</
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
31
|
+
</Row>
|
|
32
|
+
{isLoading ? (
|
|
33
|
+
<IconButton
|
|
34
|
+
icon="Stop"
|
|
35
|
+
appearance="square"
|
|
36
|
+
colorScheme="inverse"
|
|
37
|
+
aria-label={t.cancel}
|
|
38
|
+
onClick={() => chat.abort()}
|
|
39
|
+
className="send"
|
|
40
|
+
title={t.cancel}
|
|
41
|
+
/>
|
|
42
|
+
) : (
|
|
43
|
+
<IconButton
|
|
44
|
+
icon="ArrowUp"
|
|
45
|
+
appearance="square"
|
|
46
|
+
colorScheme="inverse"
|
|
47
|
+
aria-label={t.send}
|
|
48
|
+
onClick={onSend}
|
|
49
|
+
className="send"
|
|
50
|
+
title={t.send}
|
|
51
|
+
/>
|
|
52
|
+
)}
|
|
49
53
|
</SelectionBarWrapper>
|
|
50
54
|
)
|
|
51
55
|
}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import { Text } from '@citric/core'
|
|
2
|
-
import { TimesMini } from '@citric/icons'
|
|
3
|
-
import { Badge, IconButton } from '@citric/ui'
|
|
4
1
|
import { loader } from '@monaco-editor/react'
|
|
2
|
+
import { Badge, IconButton, Text } from '@stack-spot/citric-react'
|
|
5
3
|
import { ColorPaletteName, listToClass } from '@stack-spot/portal-theme'
|
|
6
4
|
import { useCallback, useMemo } from 'react'
|
|
7
5
|
import { FadingOverflow } from '../../components/FadingOverflow'
|
|
@@ -16,14 +14,17 @@ interface ContextBadgeProps {
|
|
|
16
14
|
}
|
|
17
15
|
|
|
18
16
|
const ContextBadge = ({ label, color, dismiss, onDismiss }: ContextBadgeProps) => (
|
|
19
|
-
<Badge appearance="square"
|
|
20
|
-
afterElement={
|
|
21
|
-
onDismiss &&
|
|
22
|
-
<IconButton appearance="square" colorIcon={`${color}.800`} onClick={onDismiss} title={dismiss} aria-label={dismiss}>
|
|
23
|
-
<TimesMini />
|
|
24
|
-
</IconButton>
|
|
25
|
-
}>
|
|
17
|
+
<Badge appearance="square" colorPalette={color} className="context-badge">
|
|
26
18
|
<Text nowrapEllipsis>{label}</Text>
|
|
19
|
+
{onDismiss && <IconButton
|
|
20
|
+
icon="TimesMini"
|
|
21
|
+
appearance="none"
|
|
22
|
+
onClick={onDismiss}
|
|
23
|
+
title={dismiss}
|
|
24
|
+
arial-label={dismiss}
|
|
25
|
+
style={{ padding: '2px 0 2px 2px' }}
|
|
26
|
+
colorPalette={color}
|
|
27
|
+
/>}
|
|
27
28
|
</Badge>
|
|
28
29
|
)
|
|
29
30
|
|
|
@@ -74,10 +75,12 @@ export const ContextBar = () => {
|
|
|
74
75
|
<div className="content">
|
|
75
76
|
{shouldRenderRemoveAllButton && (
|
|
76
77
|
<IconButton
|
|
77
|
-
|
|
78
|
-
aria-label={t.removeConfig}
|
|
79
|
-
|
|
80
|
-
|
|
78
|
+
icon="TimesMini"
|
|
79
|
+
aria-label={t.removeConfig}
|
|
80
|
+
title={t.removeConfig}
|
|
81
|
+
onClick={removeAll}
|
|
82
|
+
style={{ marginLeft: '8px' }}
|
|
83
|
+
/>
|
|
81
84
|
)}
|
|
82
85
|
<FadingOverflow className="list-overflow" scroll="arrows" enableHorizontalScrollWithVerticalWheel>
|
|
83
86
|
<ul>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Icon } from '@stack-spot/citric-icons'
|
|
2
2
|
import { aiClient, workspaceAiClient } from '@stack-spot/portal-network'
|
|
3
3
|
import { QuickCommandResponse } from '@stack-spot/portal-network/api/ai'
|
|
4
4
|
import { useCallback } from 'react'
|
|
@@ -113,7 +113,7 @@ export const QuickCommandSelector = ({ inputRef, isTrial }:
|
|
|
113
113
|
selectorConfig={{
|
|
114
114
|
resourceName: 'Quick Command',
|
|
115
115
|
shortcut: '/',
|
|
116
|
-
icon: <QuickCommand />,
|
|
116
|
+
icon: <Icon icon="QuickCommand" />,
|
|
117
117
|
searchProp: 'slug',
|
|
118
118
|
urlBuilder: (qc) => `/quick-command/${qc?.slug}`,
|
|
119
119
|
regex: quickCommandRegex,
|