@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,6 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { ChevronLeft, ChevronRight } from '@citric/icons'
|
|
3
|
-
import { Badge, IconButton } from '@citric/ui'
|
|
1
|
+
import { Badge, IconButton, Row, Text } from '@stack-spot/citric-react'
|
|
4
2
|
import { theme } from '@stack-spot/portal-theme'
|
|
5
3
|
import { useMemo, useState } from 'react'
|
|
6
4
|
import { styled } from 'styled-components'
|
|
@@ -131,18 +129,18 @@ export const StepModal = ({ message, stepId, onClose }: Props) => {
|
|
|
131
129
|
<div className="tool" key={tool.id}>
|
|
132
130
|
<ToolBadge name={tool.name} duration={tool.duration} image={tool.image} description={tool.description} />
|
|
133
131
|
{tool.input && <>
|
|
134
|
-
<Text appearance="microtext1"
|
|
132
|
+
<Text appearance="microtext1" color="light.700">{t.input}:</Text>
|
|
135
133
|
<Code language="json" className="tool-input" showLineNumbers={false} showActionBar>{tool.input}</Code>
|
|
136
134
|
</>}
|
|
137
135
|
{tool.output && <>
|
|
138
|
-
<Text appearance="microtext1"
|
|
136
|
+
<Text appearance="microtext1" color="light.700">{t.response}:</Text>
|
|
139
137
|
<Code language="json" className="tool-input" showLineNumbers={false} showActionBar>{tool.output}</Code>
|
|
140
138
|
</>}
|
|
141
139
|
</div>
|
|
142
140
|
)) : undefined
|
|
143
141
|
|
|
144
142
|
const title = (
|
|
145
|
-
<
|
|
143
|
+
<Row flex={1} justifyContent="space-between">
|
|
146
144
|
<Text appearance="h6">{getTitle(t, step, stepIndex)}</Text>
|
|
147
145
|
<ExecutionBox>
|
|
148
146
|
<Text className="time" appearance="microtext1">
|
|
@@ -153,28 +151,26 @@ export const StepModal = ({ message, stepId, onClose }: Props) => {
|
|
|
153
151
|
{step?.type === 'step' && step.attempts.length > 1 && <div className="navigator">
|
|
154
152
|
{attempt > 0 && (
|
|
155
153
|
<IconButton
|
|
154
|
+
icon="ChevronLeft"
|
|
156
155
|
size="xs"
|
|
157
156
|
title={t.previousAttempt}
|
|
158
157
|
aria-label={t.previousAttempt}
|
|
159
158
|
onClick={() => setAttempt(attempt - 1)}
|
|
160
|
-
|
|
161
|
-
<ChevronLeft />
|
|
162
|
-
</IconButton>
|
|
159
|
+
/>
|
|
163
160
|
)}
|
|
164
161
|
<Text appearance="microtext1">{attempt + 1}/{step.attempts.length}</Text>
|
|
165
162
|
{attempt < step.attempts.length - 1 && (
|
|
166
163
|
<IconButton
|
|
164
|
+
icon="ChevronRight"
|
|
167
165
|
size="xs"
|
|
168
166
|
title={t.nextAttempt}
|
|
169
167
|
aria-label={t.nextAttempt}
|
|
170
168
|
onClick={() => setAttempt(attempt + 1)}
|
|
171
|
-
|
|
172
|
-
<ChevronRight />
|
|
173
|
-
</IconButton>
|
|
169
|
+
/>
|
|
174
170
|
)}
|
|
175
171
|
</div>}
|
|
176
172
|
</ExecutionBox>
|
|
177
|
-
</
|
|
173
|
+
</Row>
|
|
178
174
|
)
|
|
179
175
|
|
|
180
176
|
return (
|
|
@@ -184,18 +180,18 @@ export const StepModal = ({ message, stepId, onClose }: Props) => {
|
|
|
184
180
|
</StyledSection>}
|
|
185
181
|
|
|
186
182
|
{step?.type === 'planning' && <StyledSection style={{ alignItems: 'stretch' }}>
|
|
187
|
-
<Badge appearance="square"
|
|
183
|
+
<Badge appearance="square" colorPalette="blue" style={{ alignSelf: 'start' }}>Prompt</Badge>
|
|
188
184
|
<Text>{step.goal}</Text>
|
|
189
185
|
<ul className="steps">
|
|
190
186
|
{entry.steps?.filter(s => s.type === 'step').map((s, index) => (
|
|
191
187
|
<li key={index}>
|
|
192
|
-
<
|
|
188
|
+
<Row mb={2}>
|
|
193
189
|
<Text>{t.step} {index + 1}: <span className="step-description">{s.input}</span></Text>
|
|
194
|
-
</
|
|
190
|
+
</Row>
|
|
195
191
|
{!!s.attempts[0].tools?.length && <ul className="side-by-side-tools">
|
|
196
192
|
{s.attempts[0].tools.map((tool) => (
|
|
197
193
|
<li key={tool.id}>
|
|
198
|
-
<ToolBadge name={tool.name} image={tool.image}
|
|
194
|
+
<ToolBadge name={tool.name} image={tool.image} />
|
|
199
195
|
</li>
|
|
200
196
|
))}
|
|
201
197
|
</ul>}
|
|
@@ -205,7 +201,7 @@ export const StepModal = ({ message, stepId, onClose }: Props) => {
|
|
|
205
201
|
</StyledSection>}
|
|
206
202
|
|
|
207
203
|
{step?.type === 'step' && step?.input && <StyledSection>
|
|
208
|
-
<Badge appearance="square"
|
|
204
|
+
<Badge appearance="square" colorPalette="blue">Prompt</Badge>
|
|
209
205
|
<Text>{step.input}</Text>
|
|
210
206
|
</StyledSection>}
|
|
211
207
|
{!!tools?.length && <StyledSection>{tools}</StyledSection>}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { lazy, Suspense, useEffect } from 'react'
|
|
1
|
+
import { FallbackBoundary } from '@stack-spot/citric-react'
|
|
2
|
+
import { lazy, useEffect } from 'react'
|
|
4
3
|
import { useWidget, useWidgetState } from '../../context/hooks'
|
|
5
4
|
import { useRightPanel } from '../../right-panel/hooks'
|
|
6
5
|
import { useStepsDictionary } from './dictionary'
|
|
@@ -19,9 +18,9 @@ export const Steps = () => {
|
|
|
19
18
|
|
|
20
19
|
useEffect(() => {
|
|
21
20
|
if (panel === 'steps' && message) open(
|
|
22
|
-
<
|
|
21
|
+
<FallbackBoundary>
|
|
23
22
|
<LazyStepsPanel key={message.messageId} chatId={message.chatId} messageId={message.messageId} />
|
|
24
|
-
</
|
|
23
|
+
</FallbackBoundary>,
|
|
25
24
|
{
|
|
26
25
|
title: t.steps,
|
|
27
26
|
description: t.stepsPanelDescription,
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { LoadingCircular } from '@citric/ui'
|
|
1
|
+
import { Icon, WithIcon } from '@stack-spot/citric-icons'
|
|
2
|
+
import { ProgressCircular } from '@stack-spot/citric-react'
|
|
4
3
|
import { ChatStep } from '@stack-spot/portal-network'
|
|
4
|
+
import { theme } from '@stack-spot/portal-theme'
|
|
5
5
|
|
|
6
6
|
export function getStatusIcon(status: ChatStep['status']) {
|
|
7
7
|
switch (status) {
|
|
8
|
-
case 'success': return <
|
|
9
|
-
case 'error': return <
|
|
10
|
-
case 'running': return <
|
|
8
|
+
case 'success': return <Icon group="fill" icon="CheckCircle" style={{ color: theme.color.success[500] }} />
|
|
9
|
+
case 'error': return <Icon group="fill" icon="TimesCircle" style={{ color: theme.color.danger[500] }} />
|
|
10
|
+
case 'running': return <ProgressCircular colorScheme="inverse" size="xs" />
|
|
11
11
|
default: return null
|
|
12
12
|
}
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
export function getTypeIcon(type: ChatStep['type']) {
|
|
15
|
+
export function getTypeIcon(type: ChatStep['type']): WithIcon {
|
|
16
16
|
switch (type) {
|
|
17
|
-
case 'planning': return
|
|
18
|
-
default: return
|
|
17
|
+
case 'planning': return { group: 'outline', icon: 'ListUnordered' }
|
|
18
|
+
default: return { group: 'fill', icon: 'Play' }
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
21
|
|
package/src/views/Tools.tsx
CHANGED
|
@@ -1,12 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { Avatar } from '@citric/ui'
|
|
1
|
+
import { Icon } from '@stack-spot/citric-icons'
|
|
2
|
+
import { AsyncContent, Button, Center, Column, ImageBox, ImageWithFallback, Text } from '@stack-spot/citric-react'
|
|
4
3
|
import { workspaceAiClient } from '@stack-spot/portal-network'
|
|
5
4
|
import { WorkspaceResponse, WorkspaceVisibilityLevelEnum } from '@stack-spot/portal-network/api/workspace-ai'
|
|
6
5
|
import { Dictionary, useTranslate } from '@stack-spot/portal-translate'
|
|
7
6
|
import { useTransition } from 'react'
|
|
8
7
|
import { useComponentNavigation } from '../../components/ComponentNavigator'
|
|
9
|
-
import { Loading } from '../../components/FallbackBoundary/Loading'
|
|
10
8
|
import { ListResource } from '../../components/ListResource'
|
|
11
9
|
import { CardSpace, WorkspaceTabNavigator } from '../../components/WorkspaceTabNavigator'
|
|
12
10
|
import { ChatProperties } from '../../state/ChatState'
|
|
@@ -16,17 +14,15 @@ import { StacksTab } from '../Stacks'
|
|
|
16
14
|
|
|
17
15
|
const SpaceCard = ({ workspaceId }: { workspaceId: string }) => {
|
|
18
16
|
const workspace = workspaceAiClient.workspaceAi.useQuery({ id: workspaceId })
|
|
19
|
-
return <
|
|
20
|
-
<
|
|
21
|
-
<
|
|
22
|
-
<
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
</Flex>
|
|
29
|
-
</Flex>
|
|
17
|
+
return <Column gap="4px">
|
|
18
|
+
<Center gap="8px">
|
|
19
|
+
<ImageBox size="sm" appearance="square">
|
|
20
|
+
<ImageWithFallback src={workspace.logo ?? ''} fallback={<Icon icon="Spaces" />} />
|
|
21
|
+
</ImageBox>
|
|
22
|
+
<Text appearance="body2" weight="medium">{workspace.name}</Text>
|
|
23
|
+
</Center>
|
|
24
|
+
<Text color="light.700">{workspace.description}</Text>
|
|
25
|
+
</Column>
|
|
30
26
|
}
|
|
31
27
|
|
|
32
28
|
export interface TabProps {
|
|
@@ -52,9 +48,9 @@ export const WorkspaceResources = ({ workspaceId, allKS, agent, stack }: Omit<Ta
|
|
|
52
48
|
const { navigate } = useComponentNavigation<typeof workspaceTabComponents>()
|
|
53
49
|
const [isPending, startTransition] = useTransition()
|
|
54
50
|
const resourceTypes: WorkspaceResource[] = [
|
|
55
|
-
{ id: 'agents', resourceType: 'agent', displayName: 'Agents', workspaceId, icon: <Agent /> },
|
|
56
|
-
{ id: 'ks', resourceType: 'ks', displayName: 'Knowledge Sources', workspaceId, icon: <KnowledgeSource /> },
|
|
57
|
-
{ id: 'stack', resourceType: 'stack', displayName: 'Stacks', workspaceId, icon: <Stack /> },
|
|
51
|
+
{ id: 'agents', resourceType: 'agent', displayName: 'Agents', workspaceId, icon: <Icon icon="Agent" /> },
|
|
52
|
+
{ id: 'ks', resourceType: 'ks', displayName: 'Knowledge Sources', workspaceId, icon: <Icon icon="KnowledgeSource" /> },
|
|
53
|
+
{ id: 'stack', resourceType: 'stack', displayName: 'Stacks', workspaceId, icon: <Icon icon="Stack" /> },
|
|
58
54
|
]
|
|
59
55
|
|
|
60
56
|
const handleNavigate = (resource: WorkspaceResource) => {
|
|
@@ -72,14 +68,14 @@ export const WorkspaceResources = ({ workspaceId, allKS, agent, stack }: Omit<Ta
|
|
|
72
68
|
|
|
73
69
|
return (<>
|
|
74
70
|
{workspaceId && <SpaceCard workspaceId={workspaceId} />}
|
|
75
|
-
{
|
|
71
|
+
{<AsyncContent loading={isPending}>
|
|
76
72
|
<ListResource
|
|
77
73
|
list={resourceTypes}
|
|
78
74
|
keygen={w => w.id}
|
|
79
75
|
renderLabel={r => <CardSpace name={r.displayName} icon={r.icon} onClick={() => handleNavigate(r)} />}
|
|
80
76
|
style={{ gap: '6px', display: 'flex', flexDirection: 'column' }}
|
|
81
77
|
/>
|
|
82
|
-
}
|
|
78
|
+
</AsyncContent>}
|
|
83
79
|
</>
|
|
84
80
|
)
|
|
85
81
|
}
|
|
@@ -105,7 +101,7 @@ export function WorkspacesTab({ visibility, allKS, agent, stack, onSubmit }: Tab
|
|
|
105
101
|
getNavigateParam={buildNavigateParams}
|
|
106
102
|
visibility={visibility}
|
|
107
103
|
/>
|
|
108
|
-
<Button className="workspace-submit" onClick={onSubmit}
|
|
104
|
+
<Button className="workspace-submit" onClick={onSubmit}>{t.apply}</Button>
|
|
109
105
|
</>
|
|
110
106
|
)
|
|
111
107
|
}
|
|
@@ -48,11 +48,13 @@ const WorkspacesPanel = () => {
|
|
|
48
48
|
|
|
49
49
|
return <RightPanelTabs key={chat.id} tabs={[
|
|
50
50
|
{
|
|
51
|
-
|
|
51
|
+
key: 'favorites',
|
|
52
|
+
label: t.favorites,
|
|
52
53
|
content: <WorkspacesTab key="favorite" visibility="favorite" allKS={allKS} agent={agent} stack={stack} onSubmit={onSubmit} />,
|
|
53
54
|
},
|
|
54
55
|
{
|
|
55
|
-
|
|
56
|
+
key: 'all',
|
|
57
|
+
label: t.all,
|
|
56
58
|
content: <WorkspacesTab key="all" visibility="all" allKS={allKS} agent={agent} stack={stack} onSubmit={onSubmit} />,
|
|
57
59
|
},
|
|
58
60
|
]}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { WithStyle } from '@stack-spot/portal-theme';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { WithChildren } from '../types.js';
|
|
4
|
-
interface Props extends WithStyle, Required<WithChildren> {
|
|
5
|
-
/**
|
|
6
|
-
* The header of the accordion (always rendered). The body (hidden part) must be passed as the children.
|
|
7
|
-
*/
|
|
8
|
-
header: React.ReactNode;
|
|
9
|
-
/**
|
|
10
|
-
* Whether or not to start expanded.
|
|
11
|
-
* @default false
|
|
12
|
-
*/
|
|
13
|
-
startExpanded?: boolean;
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* A component that can have it's content shown or hidden (animated).
|
|
17
|
-
*/
|
|
18
|
-
export declare const Accordion: ({ children, header, className, startExpanded, style }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
19
|
-
export {};
|
|
20
|
-
//# sourceMappingURL=Accordion.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Accordion.d.ts","sourceRoot":"","sources":["../../src/components/Accordion.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAS,SAAS,EAAE,MAAM,0BAA0B,CAAA;AAC3D,OAAO,KAAmB,MAAM,OAAO,CAAA;AAEvC,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AAEvC,UAAU,KAAM,SAAQ,SAAS,EAAE,QAAQ,CAAC,YAAY,CAAC;IACvD;;OAEG;IACH,MAAM,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAsCD;;GAEG;AACH,eAAO,MAAM,SAAS,0DAA2D,KAAK,4CAarF,CAAA"}
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
/* Copiar do EDP ou usar o AnimatedHeight da lib de components */
|
|
3
|
-
import { ChevronDown } from '@citric/icons';
|
|
4
|
-
import { IconButton } from '@citric/ui';
|
|
5
|
-
import { AnimatedHeight } from '@stack-spot/portal-components/AnimatedHeight';
|
|
6
|
-
import { theme } from '@stack-spot/portal-theme';
|
|
7
|
-
import { useState } from 'react';
|
|
8
|
-
import { styled } from 'styled-components';
|
|
9
|
-
const StyledAccordion = styled.div `
|
|
10
|
-
> header {
|
|
11
|
-
display: flex;
|
|
12
|
-
flex-direction: row;
|
|
13
|
-
justify-content: space-between;
|
|
14
|
-
align-items: center;
|
|
15
|
-
padding: 10px;
|
|
16
|
-
background-color: ${theme.color.light[400]};
|
|
17
|
-
|
|
18
|
-
> button {
|
|
19
|
-
transition: transform 0.3s ease-out;
|
|
20
|
-
background: transparent;
|
|
21
|
-
border: none;
|
|
22
|
-
padding: 0;
|
|
23
|
-
|
|
24
|
-
&:hover {
|
|
25
|
-
background: transparent;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
svg {
|
|
29
|
-
width: 16px;
|
|
30
|
-
height: 16px;
|
|
31
|
-
margin: 4px;
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
&.expanded > button {
|
|
36
|
-
transform: rotate(180deg);
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
> .accordion-content {
|
|
41
|
-
padding: 10px;
|
|
42
|
-
}
|
|
43
|
-
`;
|
|
44
|
-
/**
|
|
45
|
-
* A component that can have it's content shown or hidden (animated).
|
|
46
|
-
*/
|
|
47
|
-
export const Accordion = ({ children, header, className, startExpanded, style }) => {
|
|
48
|
-
const [expanded, setExpanded] = useState(startExpanded);
|
|
49
|
-
return (_jsx(AnimatedHeight, { style: style, className: className, outerStyle: { width: '100%' }, children: _jsxs(StyledAccordion, { children: [_jsxs("header", { className: expanded ? 'expanded' : '', children: [header, _jsx(IconButton, { onClick: () => setExpanded(v => !v), children: _jsx(ChevronDown, {}) })] }), expanded ? _jsx("div", { className: "accordion-content", children: children }) : null] }) }));
|
|
50
|
-
};
|
|
51
|
-
//# sourceMappingURL=Accordion.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Accordion.js","sourceRoot":"","sources":["../../src/components/Accordion.tsx"],"names":[],"mappings":";AAAA,iEAAiE;AAEjE,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAC3C,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AACvC,OAAO,EAAE,cAAc,EAAE,MAAM,8CAA8C,CAAA;AAC7E,OAAO,EAAE,KAAK,EAAa,MAAM,0BAA0B,CAAA;AAC3D,OAAc,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AACvC,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAA;AAe1C,MAAM,eAAe,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;;;wBAOV,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2B7C,CAAA;AAED;;GAEG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,aAAa,EAAE,KAAK,EAAS,EAAE,EAAE;IACxF,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,GAAG,QAAQ,CAAC,aAAa,CAAC,CAAA;IACvD,OAAO,CACL,KAAC,cAAc,IAAC,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,UAAU,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,YAC/E,MAAC,eAAe,eACd,kBAAQ,SAAS,EAAE,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,aAC1C,MAAM,EACP,KAAC,UAAU,IAAC,OAAO,EAAE,GAAG,EAAE,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,YAAE,KAAC,WAAW,KAAG,GAAa,IACtE,EACR,QAAQ,CAAC,CAAC,CAAC,cAAK,SAAS,EAAC,mBAAmB,YAAE,QAAQ,GAAO,CAAC,CAAC,CAAC,IAAI,IACtD,GACH,CAClB,CAAA;AACH,CAAC,CAAA"}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { ErrorDescription } from '@stack-spot/portal-components/error';
|
|
2
|
-
import { Component } from 'react';
|
|
3
|
-
interface State extends ErrorDescription {
|
|
4
|
-
hasError: boolean;
|
|
5
|
-
}
|
|
6
|
-
interface Props {
|
|
7
|
-
mini?: boolean;
|
|
8
|
-
message?: string;
|
|
9
|
-
children: React.ReactNode;
|
|
10
|
-
}
|
|
11
|
-
/**
|
|
12
|
-
* An Error Boundary that renders an ErrorFeedback instead of its content if any of its children throws.
|
|
13
|
-
*
|
|
14
|
-
* To customize what properties are passed to the ErrorFeedback component, setup an error descriptor for the ErrorManager class. If you're
|
|
15
|
-
* using the component `Layout` or `RawLayout`, you can use the property `errorDescriptor`.
|
|
16
|
-
*
|
|
17
|
-
* To run an error handler every time an error is catch by this boundary, setup an error handler for the ErrorManager class. If you're
|
|
18
|
-
* using the component `Layout` or `RawLayout`, you can use the property `onError`.
|
|
19
|
-
*/
|
|
20
|
-
export declare class ErrorBoundary extends Component<Props, State> {
|
|
21
|
-
constructor(props: Props);
|
|
22
|
-
static getDerivedStateFromError(error: any): {
|
|
23
|
-
hasError: boolean;
|
|
24
|
-
message: any;
|
|
25
|
-
code: number | undefined;
|
|
26
|
-
};
|
|
27
|
-
componentDidCatch(error: any, errorInfo: any): void;
|
|
28
|
-
componentDidUpdate(prevProps: Readonly<Props>): void;
|
|
29
|
-
private renderError;
|
|
30
|
-
render(): string | number | boolean | Iterable<import("react").ReactNode> | import("react/jsx-runtime").JSX.Element | null | undefined;
|
|
31
|
-
}
|
|
32
|
-
export {};
|
|
33
|
-
//# sourceMappingURL=ErrorBoundary.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ErrorBoundary.d.ts","sourceRoot":"","sources":["../../../src/components/FallbackBoundary/ErrorBoundary.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAiB,MAAM,qCAAqC,CAAA;AAErF,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAGjC,UAAU,KAAM,SAAQ,gBAAgB;IACtC,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED,UAAU,KAAK;IACb,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAWD;;;;;;;;GAQG;AACH,qBAAa,aAAc,SAAQ,SAAS,CAAC,KAAK,EAAE,KAAK,CAAC;gBAC5C,KAAK,EAAE,KAAK;IAKxB,MAAM,CAAC,wBAAwB,CAAC,KAAK,EAAE,GAAG;;;;;IAM1C,iBAAiB,CAAC,KAAK,EAAE,GAAG,EAAE,SAAS,EAAE,GAAG;IAK5C,kBAAkB,CAAC,SAAS,EAAE,QAAQ,CAAC,KAAK,CAAC;IAI7C,OAAO,CAAC,WAAW;IAWnB,MAAM;CAGP"}
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { IconBox, Text } from '@citric/core';
|
|
3
|
-
import { TimesCircle } from '@citric/icons';
|
|
4
|
-
import { ErrorFeedback } from '@stack-spot/portal-components/error';
|
|
5
|
-
import { StackspotAPIError } from '@stack-spot/portal-network';
|
|
6
|
-
import { Component } from 'react';
|
|
7
|
-
import { styled } from 'styled-components';
|
|
8
|
-
const ErrorBox = styled.div `
|
|
9
|
-
width: 100%;
|
|
10
|
-
height: 100%;
|
|
11
|
-
display: flex;
|
|
12
|
-
flex-direction: column;
|
|
13
|
-
align-items: center;
|
|
14
|
-
justify-content: center;
|
|
15
|
-
`;
|
|
16
|
-
/**
|
|
17
|
-
* An Error Boundary that renders an ErrorFeedback instead of its content if any of its children throws.
|
|
18
|
-
*
|
|
19
|
-
* To customize what properties are passed to the ErrorFeedback component, setup an error descriptor for the ErrorManager class. If you're
|
|
20
|
-
* using the component `Layout` or `RawLayout`, you can use the property `errorDescriptor`.
|
|
21
|
-
*
|
|
22
|
-
* To run an error handler every time an error is catch by this boundary, setup an error handler for the ErrorManager class. If you're
|
|
23
|
-
* using the component `Layout` or `RawLayout`, you can use the property `onError`.
|
|
24
|
-
*/
|
|
25
|
-
export class ErrorBoundary extends Component {
|
|
26
|
-
constructor(props) {
|
|
27
|
-
super(props);
|
|
28
|
-
this.state = { hasError: false };
|
|
29
|
-
}
|
|
30
|
-
static getDerivedStateFromError(error) {
|
|
31
|
-
const message = error instanceof StackspotAPIError ? error.translate() : (error.message ?? `${error}`);
|
|
32
|
-
const code = error instanceof StackspotAPIError ? error.status : undefined;
|
|
33
|
-
return { hasError: true, message, code };
|
|
34
|
-
}
|
|
35
|
-
componentDidCatch(error, errorInfo) {
|
|
36
|
-
// eslint-disable-next-line no-console
|
|
37
|
-
console.error(error, errorInfo);
|
|
38
|
-
}
|
|
39
|
-
componentDidUpdate(prevProps) {
|
|
40
|
-
if (this.props.children !== prevProps.children)
|
|
41
|
-
this.setState({ hasError: false });
|
|
42
|
-
}
|
|
43
|
-
renderError() {
|
|
44
|
-
return this.props.mini
|
|
45
|
-
? (_jsxs(ErrorBox, { className: "error", children: [_jsx(IconBox, { size: "lg", colorIcon: "danger.500", children: _jsx(TimesCircle, {}) }), _jsx(Text, { colorScheme: "light.700", children: this.props.message || this.state.message })] }))
|
|
46
|
-
: _jsx(ErrorFeedback, { className: "error", code: this.state.code, message: this.props.message || this.state.message });
|
|
47
|
-
}
|
|
48
|
-
render() {
|
|
49
|
-
return this.state.hasError ? this.renderError() : this.props.children;
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
//# sourceMappingURL=ErrorBoundary.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ErrorBoundary.js","sourceRoot":"","sources":["../../../src/components/FallbackBoundary/ErrorBoundary.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAC3C,OAAO,EAAoB,aAAa,EAAE,MAAM,qCAAqC,CAAA;AACrF,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAA;AAC9D,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACjC,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAA;AAY1C,MAAM,QAAQ,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;;;CAO1B,CAAA;AAED;;;;;;;;GAQG;AACH,MAAM,OAAO,aAAc,SAAQ,SAAuB;IACxD,YAAY,KAAY;QACtB,KAAK,CAAC,KAAK,CAAC,CAAA;QACZ,IAAI,CAAC,KAAK,GAAG,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAA;IAClC,CAAC;IAED,MAAM,CAAC,wBAAwB,CAAC,KAAU;QACxC,MAAM,OAAO,GAAG,KAAK,YAAY,iBAAiB,CAAC,CAAC,CAAC,KAAK,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,IAAI,GAAG,KAAK,EAAE,CAAC,CAAA;QACtG,MAAM,IAAI,GAAG,KAAK,YAAY,iBAAiB,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAA;QAC1E,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,CAAA;IAC1C,CAAC;IAED,iBAAiB,CAAC,KAAU,EAAE,SAAc;QAC1C,sCAAsC;QACtC,OAAO,CAAC,KAAK,CAAC,KAAK,EAAE,SAAS,CAAC,CAAA;IACjC,CAAC;IAED,kBAAkB,CAAC,SAA0B;QAC3C,IAAI,IAAI,CAAC,KAAK,CAAC,QAAQ,KAAK,SAAS,CAAC,QAAQ;YAAE,IAAI,CAAC,QAAQ,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC,CAAA;IACpF,CAAC;IAEO,WAAW;QACjB,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI;YACpB,CAAC,CAAC,CACA,MAAC,QAAQ,IAAC,SAAS,EAAC,OAAO,aACzB,KAAC,OAAO,IAAC,IAAI,EAAC,IAAI,EAAC,SAAS,EAAC,YAAY,YAAC,KAAC,WAAW,KAAG,GAAU,EACnE,KAAC,IAAI,IAAC,WAAW,EAAC,WAAW,YAAE,IAAI,CAAC,KAAK,CAAC,OAAO,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,GAAQ,IACtE,CACZ;YACD,CAAC,CAAC,KAAC,aAAa,IAAC,SAAS,EAAC,OAAO,EAAC,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,OAAO,EAAE,IAAI,CAAC,KAAK,CAAC,OAAO,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,GAAI,CAAA;IACnH,CAAC;IAED,MAAM;QACJ,OAAO,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAA;IACvE,CAAC;CACF"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Loading.d.ts","sourceRoot":"","sources":["../../../src/components/FallbackBoundary/Loading.tsx"],"names":[],"mappings":"AAWA,eAAO,MAAM,OAAO,+CAEnB,CAAA"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { LoadingCircular } from '@citric/ui';
|
|
3
|
-
import styled from 'styled-components';
|
|
4
|
-
const LoadingBox = styled.div `
|
|
5
|
-
width: 100%;
|
|
6
|
-
height: 100%;
|
|
7
|
-
display: flex;
|
|
8
|
-
align-items: center;
|
|
9
|
-
justify-content: center;
|
|
10
|
-
`;
|
|
11
|
-
export const Loading = () => (_jsx(LoadingBox, { className: "loading", children: _jsx(LoadingCircular, {}) }));
|
|
12
|
-
//# sourceMappingURL=Loading.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Loading.js","sourceRoot":"","sources":["../../../src/components/FallbackBoundary/Loading.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAC5C,OAAO,MAAM,MAAM,mBAAmB,CAAA;AAEtC,MAAM,UAAU,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;;CAM5B,CAAA;AAED,MAAM,CAAC,MAAM,OAAO,GAAG,GAAG,EAAE,CAAC,CAC3B,KAAC,UAAU,IAAC,SAAS,EAAC,SAAS,YAAC,KAAC,eAAe,KAAG,GAAa,CACjE,CAAA"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { WithChildren } from '../../types.js';
|
|
2
|
-
interface Props extends WithChildren {
|
|
3
|
-
/**
|
|
4
|
-
* Use this to show errors in small spaces.
|
|
5
|
-
*/
|
|
6
|
-
mini?: boolean;
|
|
7
|
-
/**
|
|
8
|
-
* Replaces the error message with this text.
|
|
9
|
-
*/
|
|
10
|
-
message?: string;
|
|
11
|
-
}
|
|
12
|
-
/**
|
|
13
|
-
* Fallbacks for errors and loadings (suspense).
|
|
14
|
-
*/
|
|
15
|
-
export declare const FallbackBoundary: ({ children, mini, message }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
16
|
-
export {};
|
|
17
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/FallbackBoundary/index.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAI1C,UAAU,KAAM,SAAQ,YAAY;IAClC;;OAEG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;IACf;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;GAEG;AACH,eAAO,MAAM,gBAAgB,gCAAiC,KAAK,4CAMlE,CAAA"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { Suspense } from 'react';
|
|
3
|
-
import { ErrorBoundary } from './ErrorBoundary.js';
|
|
4
|
-
import { Loading } from './Loading.js';
|
|
5
|
-
/**
|
|
6
|
-
* Fallbacks for errors and loadings (suspense).
|
|
7
|
-
*/
|
|
8
|
-
export const FallbackBoundary = ({ children, mini, message }) => (_jsx(ErrorBoundary, { mini: mini, message: message, children: _jsx(Suspense, { fallback: _jsx(Loading, {}), children: children }) }));
|
|
9
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/FallbackBoundary/index.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAEhC,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAC/C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAanC;;GAEG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAS,EAAE,EAAE,CAAC,CACtE,KAAC,aAAa,IAAC,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,YACzC,KAAC,QAAQ,IAAC,QAAQ,EAAE,KAAC,OAAO,KAAG,YAC5B,QAAQ,GACA,GACG,CACjB,CAAA"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
interface Props extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'onChange'> {
|
|
2
|
-
icon: React.ReactElement;
|
|
3
|
-
onChange?: (value: string) => void;
|
|
4
|
-
}
|
|
5
|
-
/**
|
|
6
|
-
* A text input with an icon at the left side.
|
|
7
|
-
*/
|
|
8
|
-
export declare const IconInput: ({ icon, onChange, style, className, disabled, onFocus, onBlur, ...props }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
-
export {};
|
|
10
|
-
//# sourceMappingURL=IconInput.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"IconInput.d.ts","sourceRoot":"","sources":["../../src/components/IconInput.tsx"],"names":[],"mappings":"AAKA,UAAU,KAAM,SAAQ,IAAI,CAAC,KAAK,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,EAAE,UAAU,CAAC;IACnF,IAAI,EAAE,KAAK,CAAC,YAAY,CAAC;IACzB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CACpC;AAyCD;;GAEG;AACH,eAAO,MAAM,SAAS,8EAA+E,KAAK,4CAoBzG,CAAA"}
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { IconBox } from '@citric/core';
|
|
3
|
-
import { listToClass, theme } from '@stack-spot/portal-theme';
|
|
4
|
-
import { useMemo, useState } from 'react';
|
|
5
|
-
import { styled } from 'styled-components';
|
|
6
|
-
const InputBox = styled.div `
|
|
7
|
-
display: flex;
|
|
8
|
-
flex-direction: row;
|
|
9
|
-
transition: border-color 0.3s, box-shadow 0.3s;
|
|
10
|
-
border: 1px solid ${theme.color.light[600]};
|
|
11
|
-
border-radius: 0.25rem;
|
|
12
|
-
background-color: ${theme.color.light[300]};
|
|
13
|
-
overflow: hidden;
|
|
14
|
-
flex-shrink: 0;
|
|
15
|
-
|
|
16
|
-
&.focused {
|
|
17
|
-
border-color: ${theme.color.primary[500]};
|
|
18
|
-
box-shadow: 0 0 0 1px ${theme.color.primary[500]};
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
&.disabled {
|
|
22
|
-
background-color: ${theme.color.light[500]};
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
${IconBox} {
|
|
26
|
-
width: 40px;
|
|
27
|
-
height: 40px;
|
|
28
|
-
border-radius: 0;
|
|
29
|
-
background-color: ${theme.color.light[600]};
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
input {
|
|
33
|
-
padding: 8px;
|
|
34
|
-
border: none;
|
|
35
|
-
background-color: transparent;
|
|
36
|
-
flex: 1;
|
|
37
|
-
color: ${theme.color.light.contrastText};
|
|
38
|
-
|
|
39
|
-
&:focus {
|
|
40
|
-
outline: none;
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
`;
|
|
44
|
-
/**
|
|
45
|
-
* A text input with an icon at the left side.
|
|
46
|
-
*/
|
|
47
|
-
export const IconInput = ({ icon, onChange, style, className, disabled, onFocus, onBlur, ...props }) => {
|
|
48
|
-
const [focused, setFocused] = useState(false);
|
|
49
|
-
const { focus, blur } = useMemo(() => ({
|
|
50
|
-
focus: (e) => {
|
|
51
|
-
setFocused(true);
|
|
52
|
-
onFocus?.(e);
|
|
53
|
-
},
|
|
54
|
-
blur: (e) => {
|
|
55
|
-
setFocused(false);
|
|
56
|
-
onBlur?.(e);
|
|
57
|
-
},
|
|
58
|
-
}), []);
|
|
59
|
-
return (_jsxs(InputBox, { style: style, className: listToClass([className, focused && !disabled && 'focused', disabled && 'disabled']), children: [_jsx(IconBox, { children: icon }), _jsx("input", { ...props, disabled: disabled, onFocus: focus, onBlur: blur, onChange: e => onChange?.(e.target.value) })] }));
|
|
60
|
-
};
|
|
61
|
-
//# sourceMappingURL=IconInput.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"IconInput.js","sourceRoot":"","sources":["../../src/components/IconInput.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AACtC,OAAO,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAA;AAC7D,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AACzC,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAA;AAO1C,MAAM,QAAQ,GAAG,MAAM,CAAC,GAAG,CAAA;;;;sBAIL,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC;;sBAEtB,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC;;;;;oBAKxB,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC;4BAChB,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC;;;;0BAI1B,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC;;;IAG5C,OAAO;;;;wBAIa,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC;;;;;;;;aAQjC,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,YAAY;;;;;;CAM1C,CAAA;AAED;;GAEG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,KAAK,EAAS,EAAE,EAAE;IAC5G,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAA;IAE7C,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC;QACrC,KAAK,EAAE,CAAC,CAA8C,EAAE,EAAE;YACxD,UAAU,CAAC,IAAI,CAAC,CAAA;YAChB,OAAO,EAAE,CAAC,CAAC,CAAC,CAAA;QACd,CAAC;QACD,IAAI,EAAE,CAAC,CAA8C,EAAE,EAAE;YACvD,UAAU,CAAC,KAAK,CAAC,CAAA;YACjB,MAAM,EAAE,CAAC,CAAC,CAAC,CAAA;QACb,CAAC;KACF,CAAC,EAAE,EAAE,CAAC,CAAA;IAEP,OAAO,CACL,MAAC,QAAQ,IAAC,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,WAAW,CAAC,CAAC,SAAS,EAAE,OAAO,IAAI,CAAC,QAAQ,IAAI,SAAS,EAAE,QAAQ,IAAI,UAAU,CAAC,CAAC,aACpH,KAAC,OAAO,cAAE,IAAI,GAAW,EACzB,mBAAW,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC,EAAE,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,GAAI,IACxG,CACZ,CAAA;AACH,CAAC,CAAA"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { WithStyle } from '@stack-spot/portal-theme';
|
|
2
|
-
import { ButtonAction, WithChildren } from '../types.js';
|
|
3
|
-
import { TooltipPosition } from './Tooltip/types.js';
|
|
4
|
-
interface Props extends WithStyle, WithChildren {
|
|
5
|
-
/**
|
|
6
|
-
* The position of the menu relative to its children.
|
|
7
|
-
*/
|
|
8
|
-
position?: TooltipPosition;
|
|
9
|
-
/**
|
|
10
|
-
* The actions of the menu.
|
|
11
|
-
*/
|
|
12
|
-
actions: ButtonAction[];
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* A floating menu that shows up when the user clicks the children.
|
|
16
|
-
*
|
|
17
|
-
* This uses the tooltip component to build the menu.
|
|
18
|
-
*/
|
|
19
|
-
export declare const OverlayMenu: import("react").ForwardRefExoticComponent<Props & import("react").RefAttributes<HTMLDivElement>>;
|
|
20
|
-
export {};
|
|
21
|
-
//# sourceMappingURL=OverlayMenu.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"OverlayMenu.d.ts","sourceRoot":"","sources":["../../src/components/OverlayMenu.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAS,SAAS,EAAE,MAAM,0BAA0B,CAAA;AAG3D,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AAGrD,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAEjD,UAAU,KAAM,SAAQ,SAAS,EAAE,YAAY;IAC7C;;OAEG;IACH,QAAQ,CAAC,EAAE,eAAe,CAAC;IAC3B;;OAEG;IACH,OAAO,EAAE,YAAY,EAAE,CAAC;CACzB;AAoFD;;;;GAIG;AACH,eAAO,MAAM,WAAW,kGAuBtB,CAAA"}
|