@stack-spot/ai-chat-widget 1.36.1-betacitric.1 → 1.36.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 +36 -0
- package/dist/StackspotAIWidget.d.ts.map +1 -1
- package/dist/StackspotAIWidget.js +7 -6
- package/dist/StackspotAIWidget.js.map +1 -1
- package/dist/app-metadata.json +17 -13
- package/dist/chat-interceptors/quick-commands.d.ts.map +1 -1
- package/dist/chat-interceptors/quick-commands.js +9 -3
- package/dist/chat-interceptors/quick-commands.js.map +1 -1
- package/dist/components/Accordion.d.ts +20 -0
- package/dist/components/Accordion.d.ts.map +1 -0
- package/dist/components/Accordion.js +51 -0
- package/dist/components/Accordion.js.map +1 -0
- 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 +3 -3
- 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 +6 -5
- package/dist/components/AgentCard/index.js.map +1 -1
- package/dist/components/ButtonFavorite.d.ts +7 -8
- package/dist/components/ButtonFavorite.d.ts.map +1 -1
- package/dist/components/ButtonFavorite.js +14 -5
- package/dist/components/ButtonFavorite.js.map +1 -1
- package/dist/components/Code.d.ts.map +1 -1
- package/dist/components/Code.js +9 -11
- package/dist/components/Code.js.map +1 -1
- package/dist/components/ComponentNavigator.d.ts.map +1 -1
- package/dist/components/ComponentNavigator.js +4 -2
- package/dist/components/ComponentNavigator.js.map +1 -1
- package/dist/components/FadingOverflow.d.ts.map +1 -1
- package/dist/components/FadingOverflow.js +4 -3
- package/dist/components/FadingOverflow.js.map +1 -1
- package/dist/components/FallbackBoundary/ErrorBoundary.d.ts +33 -0
- package/dist/components/FallbackBoundary/ErrorBoundary.d.ts.map +1 -0
- package/dist/components/FallbackBoundary/ErrorBoundary.js +52 -0
- package/dist/components/FallbackBoundary/ErrorBoundary.js.map +1 -0
- package/dist/components/FallbackBoundary/Loading.d.ts +2 -0
- package/dist/components/FallbackBoundary/Loading.d.ts.map +1 -0
- package/dist/components/FallbackBoundary/Loading.js +12 -0
- package/dist/components/FallbackBoundary/Loading.js.map +1 -0
- package/dist/components/FallbackBoundary/index.d.ts +17 -0
- package/dist/components/FallbackBoundary/index.d.ts.map +1 -0
- package/dist/components/FallbackBoundary/index.js +9 -0
- package/dist/components/FallbackBoundary/index.js.map +1 -0
- package/dist/components/FileDescription.d.ts.map +1 -1
- package/dist/components/FileDescription.js +4 -3
- 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/IconInput.d.ts +10 -0
- package/dist/components/IconInput.d.ts.map +1 -0
- package/dist/components/IconInput.js +61 -0
- package/dist/components/IconInput.js.map +1 -0
- 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 +4 -2
- package/dist/components/Modal.js.map +1 -1
- package/dist/components/OverlayMenu.d.ts +21 -0
- package/dist/components/OverlayMenu.d.ts.map +1 -0
- package/dist/components/OverlayMenu.js +79 -0
- package/dist/components/OverlayMenu.js.map +1 -0
- package/dist/components/ProgressBar.d.ts +37 -0
- package/dist/components/ProgressBar.d.ts.map +1 -0
- package/dist/components/ProgressBar.js +131 -0
- package/dist/components/ProgressBar.js.map +1 -0
- package/dist/components/QuickStartButton.d.ts +3 -2
- package/dist/components/QuickStartButton.d.ts.map +1 -1
- package/dist/components/QuickStartButton.js +3 -4
- package/dist/components/QuickStartButton.js.map +1 -1
- package/dist/components/RightPanelForm.d.ts.map +1 -1
- package/dist/components/RightPanelForm.js +13 -20
- package/dist/components/RightPanelForm.js.map +1 -1
- package/dist/components/RightPanelTabs.d.ts +4 -1
- package/dist/components/RightPanelTabs.d.ts.map +1 -1
- package/dist/components/RightPanelTabs.js +16 -4
- package/dist/components/RightPanelTabs.js.map +1 -1
- package/dist/components/Selector/index.d.ts.map +1 -1
- package/dist/components/Selector/index.js +8 -5
- 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 +5 -8
- 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 +30 -5
- package/dist/components/TabManager.js.map +1 -1
- package/dist/components/ToolBadge.d.ts +8 -3
- package/dist/components/ToolBadge.d.ts.map +1 -1
- package/dist/components/ToolBadge.js +99 -21
- package/dist/components/ToolBadge.js.map +1 -1
- package/dist/components/Tooltip/Tooltip.d.ts +37 -0
- package/dist/components/Tooltip/Tooltip.d.ts.map +1 -0
- package/dist/components/Tooltip/Tooltip.js +30 -0
- package/dist/components/Tooltip/Tooltip.js.map +1 -0
- package/dist/components/Tooltip/TooltipAPI.d.ts +29 -0
- package/dist/components/Tooltip/TooltipAPI.d.ts.map +1 -0
- package/dist/components/Tooltip/TooltipAPI.js +107 -0
- package/dist/components/Tooltip/TooltipAPI.js.map +1 -0
- package/dist/components/Tooltip/context.d.ts +5 -0
- package/dist/components/Tooltip/context.d.ts.map +1 -0
- package/dist/components/Tooltip/context.js +18 -0
- package/dist/components/Tooltip/context.js.map +1 -0
- package/dist/components/Tooltip/index.d.ts +3 -0
- package/dist/components/Tooltip/index.d.ts.map +1 -0
- package/dist/components/Tooltip/index.js +3 -0
- package/dist/components/Tooltip/index.js.map +1 -0
- package/dist/components/Tooltip/style.d.ts +4 -0
- package/dist/components/Tooltip/style.d.ts.map +1 -0
- package/dist/components/Tooltip/style.js +22 -0
- package/dist/components/Tooltip/style.js.map +1 -0
- package/dist/components/Tooltip/types.d.ts +27 -0
- package/dist/components/Tooltip/types.d.ts.map +1 -0
- package/dist/components/Tooltip/types.js +2 -0
- package/dist/components/Tooltip/types.js.map +1 -0
- package/dist/components/WorkspaceTabNavigator.d.ts.map +1 -1
- package/dist/components/WorkspaceTabNavigator.js +9 -7
- package/dist/components/WorkspaceTabNavigator.js.map +1 -1
- package/dist/components/form/DescribedCheckboxGroup.d.ts +2 -24
- package/dist/components/form/DescribedCheckboxGroup.d.ts.map +1 -1
- package/dist/components/form/DescribedCheckboxGroup.js +29 -46
- package/dist/components/form/DescribedCheckboxGroup.js.map +1 -1
- package/dist/components/form/DescribedRadioGroup.d.ts +4 -24
- package/dist/components/form/DescribedRadioGroup.d.ts.map +1 -1
- package/dist/components/form/DescribedRadioGroup.js +18 -39
- package/dist/components/form/DescribedRadioGroup.js.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/layout.css +26 -0
- package/dist/right-panel/DefaultPanel.d.ts.map +1 -1
- package/dist/right-panel/DefaultPanel.js +4 -2
- package/dist/right-panel/DefaultPanel.js.map +1 -1
- package/dist/state/ChatEntry.d.ts +4 -3
- 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 +3 -3
- package/dist/types.d.ts.map +1 -1
- package/dist/utils/tools.d.ts +2 -1
- package/dist/utils/tools.d.ts.map +1 -1
- package/dist/utils/tools.js +12 -1
- package/dist/utils/tools.js.map +1 -1
- package/dist/utils/upload/FileUpload.d.ts.map +1 -1
- package/dist/utils/upload/FileUpload.js +1 -2
- 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 +6 -5
- 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 +28 -29
- 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 +5 -3
- 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 +36 -28
- 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 +2 -8
- 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 +14 -7
- 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 +5 -3
- package/dist/views/ChatHistory/styled.js.map +1 -1
- package/dist/views/ChatTabSelection.d.ts.map +1 -1
- package/dist/views/ChatTabSelection.js +3 -2
- package/dist/views/ChatTabSelection.js.map +1 -1
- package/dist/views/Editor.d.ts.map +1 -1
- package/dist/views/Editor.js +12 -6
- package/dist/views/Editor.js.map +1 -1
- package/dist/views/Home/BuiltInAgent.d.ts.map +1 -1
- package/dist/views/Home/BuiltInAgent.js +3 -2
- 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 +1 -1
- 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 +22 -21
- package/dist/views/Home/styled.js.map +1 -1
- package/dist/views/KSDocument.d.ts.map +1 -1
- package/dist/views/KSDocument.js +4 -3
- package/dist/views/KSDocument.js.map +1 -1
- package/dist/views/KnowledgeSources.d.ts.map +1 -1
- package/dist/views/KnowledgeSources.js +36 -14
- package/dist/views/KnowledgeSources.js.map +1 -1
- package/dist/views/MessageInput/AgentSelector.d.ts.map +1 -1
- package/dist/views/MessageInput/AgentSelector.js +5 -7
- 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 +5 -4
- 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 +4 -2
- 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 +6 -4
- 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 +35 -30
- 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 +24 -2
- 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 +3 -2
- 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 +4 -0
- 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 +4 -3
- package/dist/views/MessageInput/index.js.map +1 -1
- package/dist/views/MessageInput/styled.d.ts +3 -1
- package/dist/views/MessageInput/styled.d.ts.map +1 -1
- package/dist/views/MessageInput/styled.js +27 -11
- package/dist/views/MessageInput/styled.js.map +1 -1
- package/dist/views/MinimizedHeader.d.ts.map +1 -1
- package/dist/views/MinimizedHeader.js +4 -2
- package/dist/views/MinimizedHeader.js.map +1 -1
- package/dist/views/Stacks.d.ts.map +1 -1
- package/dist/views/Stacks.js +28 -23
- 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 +6 -4
- 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 +4 -3
- package/dist/views/Steps/index.js.map +1 -1
- package/dist/views/Steps/utils.d.ts +1 -2
- 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 +4 -2
- package/dist/views/Tools.js.map +1 -1
- package/dist/views/Workspaces/WorkspacesTab.d.ts.map +1 -1
- package/dist/views/Workspaces/WorkspacesTab.js +10 -7
- package/dist/views/Workspaces/WorkspacesTab.js.map +1 -1
- package/dist/views/Workspaces/index.js +2 -4
- package/dist/views/Workspaces/index.js.map +1 -1
- package/package.json +13 -12
- package/src/StackspotAIWidget.tsx +33 -30
- package/src/app-metadata.json +17 -13
- package/src/chat-interceptors/quick-commands.ts +11 -5
- package/src/components/Accordion.tsx +75 -0
- package/src/components/AdaptiveTextArea.tsx +1 -1
- package/src/components/AgentCard/AgentCardCreate.tsx +5 -3
- package/src/components/AgentCard/index.tsx +7 -7
- package/src/components/ButtonFavorite.tsx +47 -20
- package/src/components/Code.tsx +36 -31
- package/src/components/ComponentNavigator.tsx +8 -4
- package/src/components/FadingOverflow.tsx +7 -6
- package/src/components/FallbackBoundary/ErrorBoundary.tsx +71 -0
- package/src/components/FallbackBoundary/Loading.tsx +14 -0
- package/src/components/FallbackBoundary/index.tsx +26 -0
- package/src/components/FileDescription.tsx +10 -14
- package/src/components/HistoryList.tsx +1 -1
- package/src/components/IconInput.tsx +73 -0
- package/src/components/ListResource.tsx +5 -5
- package/src/components/Markdown.tsx +1 -1
- package/src/components/Modal.tsx +4 -2
- package/src/components/OverlayMenu.tsx +133 -0
- package/src/components/ProgressBar.tsx +183 -0
- package/src/components/QuickStartButton.tsx +4 -5
- package/src/components/RightPanelForm.tsx +13 -20
- package/src/components/RightPanelTabs.tsx +32 -4
- package/src/components/Selector/index.tsx +13 -17
- package/src/components/Selector/styled.ts +5 -8
- package/src/components/StackedBadge.tsx +5 -5
- package/src/components/TabManager.tsx +36 -8
- package/src/components/ToolBadge.tsx +129 -39
- package/src/components/Tooltip/Tooltip.tsx +78 -0
- package/src/components/Tooltip/TooltipAPI.ts +101 -0
- package/src/components/Tooltip/context.tsx +24 -0
- package/src/components/Tooltip/index.ts +2 -0
- package/src/components/Tooltip/style.tsx +24 -0
- package/src/components/Tooltip/types.ts +28 -0
- package/src/components/WorkspaceTabNavigator.tsx +25 -22
- package/src/components/form/DescribedCheckboxGroup.tsx +65 -90
- package/src/components/form/DescribedRadioGroup.tsx +46 -79
- package/src/index.ts +2 -1
- package/src/layout.css +26 -0
- package/src/right-panel/DefaultPanel.tsx +7 -3
- package/src/state/ChatEntry.ts +4 -3
- package/src/state/constants.ts +2 -2
- package/src/types.ts +3 -4
- package/src/utils/tools.ts +23 -2
- package/src/utils/upload/FileUpload.ts +1 -2
- package/src/views/Agents/AgentDescription.tsx +7 -6
- package/src/views/Agents/AgentsPanel.tsx +12 -11
- package/src/views/Agents/AgentsTab.tsx +56 -37
- package/src/views/Chat/AgentInfo.tsx +6 -7
- package/src/views/Chat/ChatMessage.tsx +118 -109
- package/src/views/Chat/StepsList.tsx +11 -10
- package/src/views/Chat/styled.ts +2 -8
- package/src/views/ChatHistory/HistoryItem.tsx +19 -12
- package/src/views/ChatHistory/index.tsx +1 -1
- package/src/views/ChatHistory/styled.ts +5 -3
- package/src/views/ChatTabSelection.tsx +3 -2
- package/src/views/Editor.tsx +14 -9
- package/src/views/Home/BuiltInAgent.tsx +8 -7
- package/src/views/Home/CustomAgent.tsx +3 -3
- package/src/views/Home/index.tsx +1 -1
- package/src/views/Home/styled.ts +22 -21
- package/src/views/KSDocument.tsx +8 -7
- package/src/views/KnowledgeSources.tsx +66 -24
- package/src/views/MessageInput/AgentSelector.tsx +8 -10
- package/src/views/MessageInput/ButtonAgent.tsx +12 -24
- package/src/views/MessageInput/ButtonBar.tsx +21 -25
- package/src/views/MessageInput/ContextBar.tsx +14 -12
- package/src/views/MessageInput/QuickCommandSelector.tsx +2 -2
- package/src/views/MessageInput/SelectContent.tsx +68 -39
- package/src/views/MessageInput/UploadBar.tsx +34 -2
- package/src/views/MessageInput/UploadDragNDrop.tsx +5 -2
- package/src/views/MessageInput/dictionary.ts +4 -0
- package/src/views/MessageInput/index.tsx +7 -5
- package/src/views/MessageInput/styled.ts +28 -12
- package/src/views/MinimizedHeader.tsx +7 -4
- package/src/views/Stacks.tsx +54 -31
- package/src/views/Steps/FlowChart/NodeStep.tsx +4 -6
- package/src/views/Steps/StepModal.tsx +18 -14
- package/src/views/Steps/index.tsx +5 -4
- package/src/views/Steps/utils.tsx +9 -9
- package/src/views/Tools.tsx +19 -12
- package/src/views/Workspaces/WorkspacesTab.tsx +21 -17
- package/src/views/Workspaces/index.tsx +2 -4
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { FallbackBoundary } from '@stack-spot/citric-react'
|
|
2
1
|
import { listToClass, WithStyle } from '@stack-spot/portal-theme'
|
|
3
2
|
import { useMemo, useRef } from 'react'
|
|
3
|
+
import { FallbackBoundary } from './components/FallbackBoundary'
|
|
4
|
+
import { TooltipProvider } from './components/Tooltip'
|
|
4
5
|
import { useCurrentChatMessages, useCurrentChatState, useWidgetState } from './context/hooks'
|
|
5
6
|
import './layout.css'
|
|
6
7
|
import { RightPanel } from './right-panel/RightPanel'
|
|
@@ -85,39 +86,41 @@ export const StackspotAIWidget = (
|
|
|
85
86
|
|
|
86
87
|
return useMemo(() => (
|
|
87
88
|
<FallbackBoundary>
|
|
88
|
-
<
|
|
89
|
-
<
|
|
90
|
-
<div className=
|
|
91
|
-
{
|
|
92
|
-
{
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
</>
|
|
97
|
-
}
|
|
98
|
-
<div className="chat-container" ref={chatWindowRef}>
|
|
99
|
-
<div className="chat-content">
|
|
100
|
-
{prefix}
|
|
101
|
-
{isCurrentChatEmpty
|
|
102
|
-
? (children ?? <Home username={username} initialAgents={initialAgents} urlCreateAgent={urlCreateAgent} />)
|
|
103
|
-
: <Chat username={username} beforeMessage={beforeMessage} afterMessage={afterMessage} />
|
|
89
|
+
<TooltipProvider>
|
|
90
|
+
<RightPanelProvider chatWindow={chatWindowRef} panel={rightPanelRef}>
|
|
91
|
+
<div className={listToClass(['ai-chat-widget', isMinimized && 'minimized', className])} translate="no" style={style}>
|
|
92
|
+
<div className="chat-window" ref={chatWindowRef}>
|
|
93
|
+
{hasHeader &&<>
|
|
94
|
+
{isMinimized
|
|
95
|
+
? <MinimizedHeader {...minimizedActions} />
|
|
96
|
+
: <ChatTabSelection />
|
|
104
97
|
}
|
|
98
|
+
</>
|
|
99
|
+
}
|
|
100
|
+
<div className="chat-container" ref={chatWindowRef}>
|
|
101
|
+
<div className="chat-content">
|
|
102
|
+
{prefix}
|
|
103
|
+
{isCurrentChatEmpty
|
|
104
|
+
? (children ?? <Home username={username} initialAgents={initialAgents} urlCreateAgent={urlCreateAgent} />)
|
|
105
|
+
: <Chat username={username} beforeMessage={beforeMessage} afterMessage={afterMessage} />
|
|
106
|
+
}
|
|
107
|
+
</div>
|
|
108
|
+
{features.messageInput && <MessageInput chatWindowRef={chatWindowRef} />}
|
|
105
109
|
</div>
|
|
106
|
-
{features.messageInput && <MessageInput chatWindowRef={chatWindowRef} />}
|
|
107
110
|
</div>
|
|
111
|
+
<Stacks />
|
|
112
|
+
{!isTrial && <Workspaces />}
|
|
113
|
+
<KnowledgeSources />
|
|
114
|
+
<KSDocument />
|
|
115
|
+
<Agents />
|
|
116
|
+
<Editor />
|
|
117
|
+
<ChatHistory />
|
|
118
|
+
<Steps />
|
|
119
|
+
<Tools />
|
|
120
|
+
<div className="chat-right-panel" ref={rightPanelRef}><RightPanel /></div>
|
|
108
121
|
</div>
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
<KnowledgeSources />
|
|
112
|
-
<KSDocument />
|
|
113
|
-
<Agents />
|
|
114
|
-
<Editor />
|
|
115
|
-
<ChatHistory />
|
|
116
|
-
<Steps />
|
|
117
|
-
<Tools />
|
|
118
|
-
<div className="chat-right-panel" ref={rightPanelRef}><RightPanel /></div>
|
|
119
|
-
</div>
|
|
120
|
-
</RightPanelProvider>
|
|
122
|
+
</RightPanelProvider>
|
|
123
|
+
</TooltipProvider>
|
|
121
124
|
</FallbackBoundary>
|
|
122
125
|
), [isCurrentChatEmpty, username, isMinimized, children, initialAgents])
|
|
123
126
|
}
|
package/src/app-metadata.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stack-spot/ai-chat-widget",
|
|
3
|
-
"version": "1.36.1
|
|
4
|
-
"date": "
|
|
3
|
+
"version": "1.36.1",
|
|
4
|
+
"date": "Mon Aug 18 2025 15:03:09 GMT+0000 (Coordinated Universal Time)",
|
|
5
5
|
"dependencies": [
|
|
6
6
|
{
|
|
7
7
|
"name": "@stack-spot/app-metadata",
|
|
@@ -88,32 +88,36 @@
|
|
|
88
88
|
"version": "5.6.2"
|
|
89
89
|
},
|
|
90
90
|
{
|
|
91
|
-
"name": "@
|
|
92
|
-
"version": "
|
|
91
|
+
"name": "@citric/core",
|
|
92
|
+
"version": "6.4.0(lodash@4.17.21)(react@18.2.0)(styled-components@6.1.10(react-dom@18.2.0(react@18.2.0))(react@18.2.0))"
|
|
93
93
|
},
|
|
94
94
|
{
|
|
95
|
-
"name": "@
|
|
96
|
-
"version": "
|
|
95
|
+
"name": "@citric/icons",
|
|
96
|
+
"version": "5.13.0(react@18.2.0)"
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
"name": "@citric/ui",
|
|
100
|
+
"version": "6.10.2(@citric/core@6.4.0(lodash@4.17.21)(react@18.2.0)(styled-components@6.1.10(react-dom@18.2.0(react@18.2.0))(react@18.2.0)))(@citric/icons@5.13.0(react@18.2.0))(lodash@4.17.21)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(styled-components@6.1.10(react-dom@18.2.0(react@18.2.0))(react@18.2.0))"
|
|
97
101
|
},
|
|
98
102
|
{
|
|
99
|
-
"name": "@
|
|
100
|
-
"version": "
|
|
103
|
+
"name": "@dagrejs/dagre",
|
|
104
|
+
"version": "1.1.4"
|
|
101
105
|
},
|
|
102
106
|
{
|
|
103
|
-
"name": "@
|
|
104
|
-
"version": "
|
|
107
|
+
"name": "@monaco-editor/react",
|
|
108
|
+
"version": "4.6.0(monaco-editor@0.52.0)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)"
|
|
105
109
|
},
|
|
106
110
|
{
|
|
107
111
|
"name": "@stack-spot/portal-components",
|
|
108
|
-
"version": "2.
|
|
112
|
+
"version": "2.25.5(@citric/core@6.4.0(lodash@4.17.21)(react@18.2.0)(styled-components@6.1.10(react-dom@18.2.0(react@18.2.0))(react@18.2.0)))(@citric/icons@5.13.0(react@18.2.0))(@citric/ui@6.10.2(@citric/core@6.4.0(lodash@4.17.21)(react@18.2.0)(styled-components@6.1.10(react-dom@18.2.0(react@18.2.0))(react@18.2.0)))(@citric/icons@5.13.0(react@18.2.0))(lodash@4.17.21)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(styled-components@6.1.10(react-dom@18.2.0(react@18.2.0))(react@18.2.0)))(@stack-spot/portal-theme@1.1.0(@citric/core@6.4.0(lodash@4.17.21)(react@18.2.0)(styled-components@6.1.10(react-dom@18.2.0(react@18.2.0))(react@18.2.0)))(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(styled-components@6.1.10(react-dom@18.2.0(react@18.2.0))(react@18.2.0)))(@stack-spot/portal-translate@1.1.0(react-dom@18.2.0(react@18.2.0))(react@18.2.0))(@types/react@18.3.11)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)"
|
|
109
113
|
},
|
|
110
114
|
{
|
|
111
115
|
"name": "@stack-spot/portal-network",
|
|
112
|
-
"version": "0.
|
|
116
|
+
"version": "0.169.0(@stack-spot/auth@5.3.2)(@stack-spot/opa@2.5.0(@stack-spot/auth@5.3.2)(react-dom@18.2.0(react@18.2.0))(react@18.2.0))(@stack-spot/portal-translate@1.1.0(react-dom@18.2.0(react@18.2.0))(react@18.2.0))(@tanstack/react-query@5.59.16(react@18.2.0))(react-dom@18.2.0(react@18.2.0))(react@18.2.0)"
|
|
113
117
|
},
|
|
114
118
|
{
|
|
115
119
|
"name": "@stack-spot/portal-theme",
|
|
116
|
-
"version": "1.
|
|
120
|
+
"version": "1.1.0(@citric/core@6.4.0(lodash@4.17.21)(react@18.2.0)(styled-components@6.1.10(react-dom@18.2.0(react@18.2.0))(react@18.2.0)))(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(styled-components@6.1.10(react-dom@18.2.0(react@18.2.0))(react@18.2.0))"
|
|
117
121
|
},
|
|
118
122
|
{
|
|
119
123
|
"name": "@stack-spot/portal-translate",
|
|
@@ -74,25 +74,31 @@ export function createQuickCommandInterceptor(widget: WidgetState, getEditor: ()
|
|
|
74
74
|
*/
|
|
75
75
|
async function runRouterStep(
|
|
76
76
|
ctx: QCContext,
|
|
77
|
-
stepIndex: number, iteration: number
|
|
77
|
+
stepIndex: number, iteration: Record<string, number>,
|
|
78
78
|
progress: { update: (index: number) => void, remove: () => void },
|
|
79
79
|
) {
|
|
80
80
|
const { qc: { slug, steps }, code, resultMap, customInputs } = ctx
|
|
81
81
|
const step = steps![stepIndex]
|
|
82
82
|
const inputData = Object.keys(customInputs).length > 0 && code ? { ...customInputs, [code]: code } : code ?? customInputs
|
|
83
83
|
try {
|
|
84
|
+
if (step.slug in iteration) {
|
|
85
|
+
iteration[step.slug] = iteration[step.slug] + 1
|
|
86
|
+
} else {
|
|
87
|
+
iteration[step.slug] = 1
|
|
88
|
+
}
|
|
89
|
+
|
|
84
90
|
const { next_step_slug } = await aiClient.calculateNextStep.mutate({
|
|
85
91
|
stepSlug: step.slug,
|
|
86
92
|
slug: slug,
|
|
87
93
|
quickCommandEvaluateStepRouterRequest: {
|
|
88
|
-
executions_count: iteration
|
|
94
|
+
executions_count: iteration[step.slug],
|
|
89
95
|
input_data: inputData,
|
|
90
96
|
slugs_executions: resultMap,
|
|
91
97
|
},
|
|
92
98
|
})
|
|
93
99
|
|
|
94
100
|
if (next_step_slug === step.slug) {
|
|
95
|
-
return runStepsRecursively(stepIndex, progress, ctx, iteration
|
|
101
|
+
return runStepsRecursively(stepIndex, progress, ctx, iteration)
|
|
96
102
|
}
|
|
97
103
|
const nextStepIndex = steps?.findIndex((step) => step.slug === next_step_slug)
|
|
98
104
|
|
|
@@ -222,7 +228,7 @@ export function createQuickCommandInterceptor(widget: WidgetState, getEditor: ()
|
|
|
222
228
|
}
|
|
223
229
|
|
|
224
230
|
async function runStepsRecursively(currentIndex: number, progress: { update: (index: number) => void, remove: () => void },
|
|
225
|
-
ctx: QCContext, iteration: number) {
|
|
231
|
+
ctx: QCContext, iteration: Record<string, number>) {
|
|
226
232
|
const { qc } = ctx
|
|
227
233
|
if (!qc.steps || currentIndex >= qc.steps?.length) return
|
|
228
234
|
progress.update(currentIndex)
|
|
@@ -245,7 +251,7 @@ export function createQuickCommandInterceptor(widget: WidgetState, getEditor: ()
|
|
|
245
251
|
async function runSteps(ctx: QCContext) {
|
|
246
252
|
const progress = showProgressMessage(ctx)
|
|
247
253
|
try {
|
|
248
|
-
await runStepsRecursively(0, progress, ctx,
|
|
254
|
+
await runStepsRecursively(0, progress, ctx, {})
|
|
249
255
|
} finally {
|
|
250
256
|
progress.remove()
|
|
251
257
|
}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/* Copiar do EDP ou usar o AnimatedHeight da lib de components */
|
|
2
|
+
|
|
3
|
+
import { ChevronDown } from '@citric/icons'
|
|
4
|
+
import { IconButton } from '@citric/ui'
|
|
5
|
+
import { AnimatedHeight } from '@stack-spot/portal-components/AnimatedHeight'
|
|
6
|
+
import { theme, WithStyle } from '@stack-spot/portal-theme'
|
|
7
|
+
import React, { useState } from 'react'
|
|
8
|
+
import { styled } from 'styled-components'
|
|
9
|
+
import { WithChildren } from '../types'
|
|
10
|
+
|
|
11
|
+
interface Props extends WithStyle, Required<WithChildren> {
|
|
12
|
+
/**
|
|
13
|
+
* The header of the accordion (always rendered). The body (hidden part) must be passed as the children.
|
|
14
|
+
*/
|
|
15
|
+
header: React.ReactNode,
|
|
16
|
+
/**
|
|
17
|
+
* Whether or not to start expanded.
|
|
18
|
+
* @default false
|
|
19
|
+
*/
|
|
20
|
+
startExpanded?: boolean,
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const StyledAccordion = styled.div`
|
|
24
|
+
> header {
|
|
25
|
+
display: flex;
|
|
26
|
+
flex-direction: row;
|
|
27
|
+
justify-content: space-between;
|
|
28
|
+
align-items: center;
|
|
29
|
+
padding: 10px;
|
|
30
|
+
background-color: ${theme.color.light[400]};
|
|
31
|
+
|
|
32
|
+
> button {
|
|
33
|
+
transition: transform 0.3s ease-out;
|
|
34
|
+
background: transparent;
|
|
35
|
+
border: none;
|
|
36
|
+
padding: 0;
|
|
37
|
+
|
|
38
|
+
&:hover {
|
|
39
|
+
background: transparent;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
svg {
|
|
43
|
+
width: 16px;
|
|
44
|
+
height: 16px;
|
|
45
|
+
margin: 4px;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
&.expanded > button {
|
|
50
|
+
transform: rotate(180deg);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
> .accordion-content {
|
|
55
|
+
padding: 10px;
|
|
56
|
+
}
|
|
57
|
+
`
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* A component that can have it's content shown or hidden (animated).
|
|
61
|
+
*/
|
|
62
|
+
export const Accordion = ({ children, header, className, startExpanded, style }: Props) => {
|
|
63
|
+
const [expanded, setExpanded] = useState(startExpanded)
|
|
64
|
+
return (
|
|
65
|
+
<AnimatedHeight style={style} className={className} outerStyle={{ width: '100%' }}>
|
|
66
|
+
<StyledAccordion>
|
|
67
|
+
<header className={expanded ? 'expanded' : ''}>
|
|
68
|
+
{header}
|
|
69
|
+
<IconButton onClick={() => setExpanded(v => !v)}><ChevronDown /></IconButton>
|
|
70
|
+
</header>
|
|
71
|
+
{expanded ? <div className="accordion-content">{children}</div> : null}
|
|
72
|
+
</StyledAccordion>
|
|
73
|
+
</AnimatedHeight>
|
|
74
|
+
)
|
|
75
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { IconBox, Text } from '@citric/core'
|
|
2
|
+
import { PlusMini } from '@citric/icons'
|
|
3
3
|
import { theme } from '@stack-spot/portal-theme'
|
|
4
4
|
import { useTranslate } from '@stack-spot/portal-translate'
|
|
5
5
|
import { styled } from 'styled-components'
|
|
@@ -32,7 +32,9 @@ export const AgentCardCreate = ({ urlCreateAgent }: { urlCreateAgent: string })
|
|
|
32
32
|
const t = useTranslate(dictionary)
|
|
33
33
|
return (
|
|
34
34
|
<StyledCard href={urlCreateAgent} role="link" tabIndex={0} className={'agent-card'}>
|
|
35
|
-
<
|
|
35
|
+
<IconBox color="light" appearance="square" size="md">
|
|
36
|
+
<PlusMini />
|
|
37
|
+
</IconBox>
|
|
36
38
|
<div className="text-box">
|
|
37
39
|
<Text appearance="body2">
|
|
38
40
|
{`${t.create} ${t.agent}`}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Image, Text } from '@citric/core'
|
|
2
|
+
import { Card } from '@citric/ui'
|
|
2
3
|
import { listToClass, theme } from '@stack-spot/portal-theme'
|
|
3
4
|
import { useTranslate } from '@stack-spot/portal-translate'
|
|
4
5
|
import { styled } from 'styled-components'
|
|
@@ -15,12 +16,12 @@ const StyledCard = styled(Card)`
|
|
|
15
16
|
flex-direction: column;
|
|
16
17
|
gap: 12px;
|
|
17
18
|
|
|
18
|
-
&:hover
|
|
19
|
-
background-color: ${theme.color.light[500]}
|
|
19
|
+
&:hover {
|
|
20
|
+
background-color: ${theme.color.light[500]};
|
|
20
21
|
}
|
|
21
22
|
|
|
22
23
|
&.active {
|
|
23
|
-
background-color: ${theme.color.light[600]}
|
|
24
|
+
background-color: ${theme.color.light[600]};
|
|
24
25
|
}
|
|
25
26
|
|
|
26
27
|
img {
|
|
@@ -58,14 +59,13 @@ export const AgentCard = ({ agent }: { agent: LabeledAgent }) => {
|
|
|
58
59
|
onClick={() => chat.set('agent', agent)}
|
|
59
60
|
role="button"
|
|
60
61
|
tabIndex={0}
|
|
61
|
-
bgLevel={400}
|
|
62
62
|
className={listToClass(['agent-card', currentAgent?.id === agent.id && 'active'])}
|
|
63
63
|
>
|
|
64
|
-
<
|
|
64
|
+
<Image src={agent.image ? agent.image : placeholder} />
|
|
65
65
|
<div className="text-box">
|
|
66
66
|
{agent.visibility_level && (
|
|
67
67
|
<div className="agent-type">
|
|
68
|
-
<Text appearance="microtext1"
|
|
68
|
+
<Text appearance="microtext1" colorScheme="light.700">
|
|
69
69
|
{t[agent.visibility_level.toLowerCase() as keyof typeof t]}
|
|
70
70
|
</Text>
|
|
71
71
|
<Text appearance="microtext1">
|
|
@@ -1,14 +1,16 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Button, IconBox } from '@citric/core'
|
|
2
|
+
import { Star, StarFill } from '@citric/icons'
|
|
3
|
+
import { IconButton, LoadingCircular } from '@citric/ui'
|
|
2
4
|
import { useTranslate } from '@stack-spot/portal-translate'
|
|
3
|
-
import { useEffect, useState } from 'react'
|
|
5
|
+
import { MouseEvent, useEffect, useState } from 'react'
|
|
4
6
|
import { dictionaryFavorites } from './form/dictionary'
|
|
5
7
|
|
|
6
|
-
|
|
8
|
+
interface ItemFavorite {
|
|
7
9
|
id?: string,
|
|
8
10
|
slug?: string,
|
|
9
11
|
}
|
|
10
12
|
|
|
11
|
-
|
|
13
|
+
interface Favorite<T extends ItemFavorite> {
|
|
12
14
|
/**
|
|
13
15
|
* id or slug to be used on functions
|
|
14
16
|
*/
|
|
@@ -32,17 +34,17 @@ export interface Favorite<T extends ItemFavorite> {
|
|
|
32
34
|
}
|
|
33
35
|
|
|
34
36
|
interface Props<T extends ItemFavorite> {
|
|
37
|
+
/**
|
|
38
|
+
* Determine whether the component should be a Button or an IconButton.
|
|
39
|
+
*/
|
|
40
|
+
isIconButton?: boolean,
|
|
35
41
|
/**
|
|
36
42
|
* An object containing favorite items and related operations.
|
|
37
43
|
*/
|
|
38
44
|
favorite: Favorite<T>,
|
|
39
|
-
/**
|
|
40
|
-
* @default 'square'
|
|
41
|
-
*/
|
|
42
|
-
appearance?: BaseFavoriteProps['appearance'],
|
|
43
45
|
}
|
|
44
46
|
|
|
45
|
-
export const ButtonFavorite = <T extends ItemFavorite>({ favorite,
|
|
47
|
+
export const ButtonFavorite = <T extends ItemFavorite>({ favorite, isIconButton = false }: Props<T>) => {
|
|
46
48
|
const [isFavorite, setIsFavorite] = useState(false)
|
|
47
49
|
const { idOrSlug, listFavorites } = favorite || {}
|
|
48
50
|
|
|
@@ -51,12 +53,12 @@ export const ButtonFavorite = <T extends ItemFavorite>({ favorite, appearance =
|
|
|
51
53
|
}, [listFavorites])
|
|
52
54
|
|
|
53
55
|
return (
|
|
54
|
-
<ButtonWrapper isFavorite={isFavorite}
|
|
56
|
+
<ButtonWrapper isFavorite={isFavorite} isIconButton={isIconButton} favorite={favorite} />
|
|
55
57
|
)
|
|
56
58
|
}
|
|
57
59
|
|
|
58
|
-
const ButtonWrapper = <T extends ItemFavorite>({ isFavorite, favorite
|
|
59
|
-
{ isFavorite: boolean, favorite: Favorite<T
|
|
60
|
+
const ButtonWrapper = <T extends ItemFavorite>({ isIconButton, isFavorite, favorite }:
|
|
61
|
+
{ isIconButton?: boolean, isFavorite: boolean, favorite: Favorite<T>}) => {
|
|
60
62
|
const t = useTranslate(dictionaryFavorites)
|
|
61
63
|
const { idOrSlug, onAddFavorite, onRemoveFavorite } = favorite
|
|
62
64
|
const [loading, setLoading] = useState(false)
|
|
@@ -67,12 +69,37 @@ const ButtonWrapper = <T extends ItemFavorite>({ isFavorite, favorite, appearanc
|
|
|
67
69
|
setLoading(false)
|
|
68
70
|
}
|
|
69
71
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
72
|
+
const handleClick = (e: MouseEvent<HTMLButtonElement>) => {
|
|
73
|
+
e.stopPropagation()
|
|
74
|
+
isFavorite ? handleAction(idOrSlug, onRemoveFavorite) : handleAction(idOrSlug, onAddFavorite)
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
if (isIconButton){
|
|
79
|
+
return (
|
|
80
|
+
<IconButton
|
|
81
|
+
type="button"
|
|
82
|
+
disabled={ loading }
|
|
83
|
+
aria-label={`${t[isFavorite ? 'remove' : 'become']} ${t.favorite}`}
|
|
84
|
+
title={`${t[isFavorite ? 'remove' : 'become']} ${t.favorite}`}
|
|
85
|
+
onClick={(e: MouseEvent) => handleClick(e as MouseEvent<HTMLButtonElement>)}>
|
|
86
|
+
<IconBox colorIcon={isFavorite ? 'yellow.500' : 'light'}>
|
|
87
|
+
{loading ? <LoadingCircular colorScheme="warning"/> : isFavorite ? <StarFill/> : <Star/> }
|
|
88
|
+
</IconBox>
|
|
89
|
+
</IconButton>
|
|
90
|
+
)
|
|
91
|
+
}
|
|
92
|
+
return (
|
|
93
|
+
<Button
|
|
94
|
+
type="button"
|
|
95
|
+
colorScheme="light"
|
|
96
|
+
disabled={ loading }
|
|
97
|
+
aria-label={`${t[isFavorite ? 'remove' : 'become']} ${t.favorite}`}
|
|
98
|
+
title={`${t[isFavorite ? 'remove' : 'become']} ${t.favorite}`}
|
|
99
|
+
onClick={(e: MouseEvent) => handleClick(e as MouseEvent<HTMLButtonElement>)}>
|
|
100
|
+
<IconBox colorIcon={isFavorite ? 'yellow.500' : 'light'}>
|
|
101
|
+
{loading ? <LoadingCircular colorScheme="warning"/> : isFavorite ? <StarFill/> : <Star/> }
|
|
102
|
+
</IconBox>
|
|
103
|
+
</Button>
|
|
104
|
+
)
|
|
78
105
|
}
|
package/src/components/Code.tsx
CHANGED
|
@@ -2,7 +2,9 @@
|
|
|
2
2
|
* Copied from the extension's webview.
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { Text } from '@citric/core'
|
|
6
|
+
import { AddCode, ChevronDoubleDown, Collapse, Copy, Download } from '@citric/icons'
|
|
7
|
+
import { IconButton } from '@citric/ui'
|
|
6
8
|
import { theme, useThemeKind } from '@stack-spot/portal-theme'
|
|
7
9
|
import { Dictionary, useTranslate } from '@stack-spot/portal-translate'
|
|
8
10
|
import { CSSProperties, useState } from 'react'
|
|
@@ -77,12 +79,6 @@ const CodeBox = styled.code`
|
|
|
77
79
|
opacity: 1;
|
|
78
80
|
}
|
|
79
81
|
}
|
|
80
|
-
|
|
81
|
-
.copy-btn {
|
|
82
|
-
&:after {
|
|
83
|
-
left: -30px; // prevents scrolling in the horizontal axis.
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
82
|
}
|
|
87
83
|
}
|
|
88
84
|
|
|
@@ -153,14 +149,14 @@ export const Code = ({
|
|
|
153
149
|
</div>
|
|
154
150
|
<div className="action-bar" role="toolbar">
|
|
155
151
|
<IconButton
|
|
156
|
-
icon="Collapse"
|
|
157
152
|
aria-label={showLines ? t.hideLines : t.showLines}
|
|
158
153
|
title={showLines ? t.hideLines : t.showLines}
|
|
159
154
|
onClick={() => setShowLines(v => !v)}
|
|
160
155
|
style={{ position: 'relative', transform: showLines ? undefined : 'rotate(180deg)', transition: 'transform 0.2s' }}
|
|
161
|
-
|
|
156
|
+
>
|
|
157
|
+
<Collapse />
|
|
158
|
+
</IconButton>
|
|
162
159
|
<IconButton
|
|
163
|
-
icon="Download"
|
|
164
160
|
aria-label={t.downloadCode}
|
|
165
161
|
title={t.downloadCode}
|
|
166
162
|
onClick={() => {
|
|
@@ -180,30 +176,41 @@ export const Code = ({
|
|
|
180
176
|
console.error(t.downloadError, e)
|
|
181
177
|
}
|
|
182
178
|
}}
|
|
183
|
-
|
|
179
|
+
>
|
|
180
|
+
<Download />
|
|
181
|
+
</IconButton>
|
|
184
182
|
<IconButton
|
|
185
|
-
icon="Copy"
|
|
186
183
|
aria-label={t.copy}
|
|
187
184
|
title={t.copy}
|
|
188
185
|
onClick={onClickCopy}
|
|
189
186
|
style={{ position: 'relative' }}
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
{onInsertCode
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
187
|
+
>
|
|
188
|
+
<Copy />
|
|
189
|
+
</IconButton>
|
|
190
|
+
{onInsertCode
|
|
191
|
+
? (
|
|
192
|
+
<IconButton
|
|
193
|
+
aria-label={t.insert}
|
|
194
|
+
title={t.insert}
|
|
195
|
+
onClick={onClickInsert}
|
|
196
|
+
style={{ position: 'relative' }}
|
|
197
|
+
>
|
|
198
|
+
<ChevronDoubleDown style={{ transform: 'rotate(90deg)' }} />
|
|
199
|
+
</IconButton>
|
|
200
|
+
)
|
|
201
|
+
: null}
|
|
202
|
+
{onNewFile
|
|
203
|
+
? (
|
|
204
|
+
<IconButton
|
|
205
|
+
aria-label={t.newFile}
|
|
206
|
+
title={t.newFile}
|
|
207
|
+
onClick={onClickNewFile}
|
|
208
|
+
style={{ position: 'relative' }}
|
|
209
|
+
>
|
|
210
|
+
<AddCode />
|
|
211
|
+
</IconButton>
|
|
212
|
+
)
|
|
213
|
+
: null}
|
|
207
214
|
</div>
|
|
208
215
|
</div>
|
|
209
216
|
)}
|
|
@@ -228,7 +235,6 @@ export const Code = ({
|
|
|
228
235
|
const dictionary = {
|
|
229
236
|
en: {
|
|
230
237
|
copy: 'Copy code to the clipboard',
|
|
231
|
-
copied: 'Copied',
|
|
232
238
|
insert: 'Inject code into editor',
|
|
233
239
|
newFile: 'Creates a new file with this code as its content',
|
|
234
240
|
hideLines: 'Hide line numbers',
|
|
@@ -238,7 +244,6 @@ const dictionary = {
|
|
|
238
244
|
},
|
|
239
245
|
pt: {
|
|
240
246
|
copy: 'Copiar código para a área de transferência',
|
|
241
|
-
copied: 'Copiado',
|
|
242
247
|
insert: 'Inserir código no editor',
|
|
243
248
|
newFile: 'Criar um novo arquivo com este código como conteúdo',
|
|
244
249
|
hideLines: 'Esconder números das linhas',
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Flex } from '@citric/core'
|
|
2
|
+
import { ArrowLeft } from '@citric/icons'
|
|
3
|
+
import { IconButton } from '@citric/ui'
|
|
2
4
|
import { createContext, useCallback, useContext, useMemo, useState } from 'react'
|
|
3
5
|
|
|
4
6
|
/**
|
|
@@ -79,10 +81,12 @@ export function ComponentNavigator<T extends NavigationMap, K extends keyof T>({
|
|
|
79
81
|
return (<NavigationContext.Provider value={navigationContext as NavigationContextType<NavigationMap>}>
|
|
80
82
|
<div className={`content-navigator ${className || isFullScreen ? 'full' : ''}`} role="navigation">
|
|
81
83
|
{canGoBack && (
|
|
82
|
-
<
|
|
83
|
-
<IconButton
|
|
84
|
+
<Flex alignItems="center" w={12} sx={{ gap: '4px' }}>
|
|
85
|
+
<IconButton onClick={goBack} appearance="square" className="back-button" aria-label="Back">
|
|
86
|
+
<ArrowLeft />
|
|
87
|
+
</IconButton>
|
|
84
88
|
{renderTitle?.(currentItem)}
|
|
85
|
-
</
|
|
89
|
+
</Flex>
|
|
86
90
|
)}
|
|
87
91
|
<Component {...(currentItem.props as any)} />
|
|
88
92
|
</div>
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { IconBox } from '@citric/core'
|
|
2
|
+
import { ChevronDown, ChevronLeft, ChevronRight, ChevronUp } from '@citric/icons'
|
|
2
3
|
import { listToClass, theme, WithStyle } from '@stack-spot/portal-theme'
|
|
3
4
|
import { debounce } from 'lodash'
|
|
4
5
|
import { useEffect, useRef } from 'react'
|
|
@@ -79,7 +80,7 @@ const OverflowBox = styled.div`
|
|
|
79
80
|
pointer-events: none;
|
|
80
81
|
transition: opacity 0.3s;
|
|
81
82
|
|
|
82
|
-
|
|
83
|
+
${IconBox} {
|
|
83
84
|
background-color: ${theme.color.light[300]};
|
|
84
85
|
border-radius: 50%;
|
|
85
86
|
width: 16px;
|
|
@@ -252,10 +253,10 @@ export const FadingOverflow = (
|
|
|
252
253
|
return scroll === 'arrows' ? (
|
|
253
254
|
<OverflowBox {...props} className={listToClass(['scroll-arrows', className])}>
|
|
254
255
|
<div className="content" ref={ref}>{children}</div>
|
|
255
|
-
<div className="scroll-to-left" aria-hidden><
|
|
256
|
-
<div className="scroll-to-right" aria-hidden><
|
|
257
|
-
<div className="scroll-to-top" aria-hidden><
|
|
258
|
-
<div className="scroll-to-bottom" aria-hidden><
|
|
256
|
+
<div className="scroll-to-left" aria-hidden><IconBox size="xs"><ChevronLeft /></IconBox></div>
|
|
257
|
+
<div className="scroll-to-right" aria-hidden><IconBox size="xs"><ChevronRight /></IconBox></div>
|
|
258
|
+
<div className="scroll-to-top" aria-hidden><IconBox size="xs"><ChevronUp /></IconBox></div>
|
|
259
|
+
<div className="scroll-to-bottom" aria-hidden><IconBox size="xs"><ChevronDown /></IconBox></div>
|
|
259
260
|
</OverflowBox>
|
|
260
261
|
) : <OverflowBox {...props} className={className} ref={ref}>{children}</OverflowBox>
|
|
261
262
|
}
|