@stack-spot/ai-chat-widget 1.38.2-beta.1 → 2.0.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +33 -32
- package/dist/StackspotAIWidget.d.ts +14 -2
- package/dist/StackspotAIWidget.d.ts.map +1 -1
- package/dist/StackspotAIWidget.js +7 -8
- package/dist/StackspotAIWidget.js.map +1 -1
- package/dist/app-metadata.json +13 -5
- package/dist/chat-interceptors/quick-commands.js +3 -3
- package/dist/chat-interceptors/quick-commands.js.map +1 -1
- package/dist/components/AdaptiveTextArea.d.ts +1 -1
- package/dist/components/AdaptiveTextArea.d.ts.map +1 -1
- package/dist/components/AdaptiveTextArea.js +1 -1
- package/dist/components/AdaptiveTextArea.js.map +1 -1
- package/dist/components/AgentCard/AgentCardCreate.d.ts.map +1 -1
- package/dist/components/AgentCard/AgentCardCreate.js +4 -5
- package/dist/components/AgentCard/AgentCardCreate.js.map +1 -1
- package/dist/components/AgentCard/index.d.ts.map +1 -1
- package/dist/components/AgentCard/index.js +5 -6
- package/dist/components/AgentCard/index.js.map +1 -1
- package/dist/components/ButtonFavorite.d.ts +8 -7
- package/dist/components/ButtonFavorite.d.ts.map +1 -1
- package/dist/components/ButtonFavorite.js +5 -14
- package/dist/components/ButtonFavorite.js.map +1 -1
- package/dist/components/Code.d.ts.map +1 -1
- package/dist/components/Code.js +11 -9
- package/dist/components/Code.js.map +1 -1
- package/dist/components/ComponentNavigator.d.ts.map +1 -1
- package/dist/components/ComponentNavigator.js +2 -4
- package/dist/components/ComponentNavigator.js.map +1 -1
- package/dist/components/FadingOverflow.d.ts.map +1 -1
- package/dist/components/FadingOverflow.js +3 -4
- package/dist/components/FadingOverflow.js.map +1 -1
- package/dist/components/FileDescription.d.ts.map +1 -1
- package/dist/components/FileDescription.js +3 -4
- package/dist/components/FileDescription.js.map +1 -1
- package/dist/components/HistoryList.d.ts.map +1 -1
- package/dist/components/HistoryList.js +3 -1
- package/dist/components/HistoryList.js.map +1 -1
- package/dist/components/ListResource.js +3 -3
- package/dist/components/ListResource.js.map +1 -1
- package/dist/components/Markdown.js +1 -1
- package/dist/components/Markdown.js.map +1 -1
- package/dist/components/Modal.d.ts.map +1 -1
- package/dist/components/Modal.js +2 -4
- package/dist/components/Modal.js.map +1 -1
- package/dist/components/QuickStartButton.d.ts +2 -3
- package/dist/components/QuickStartButton.d.ts.map +1 -1
- package/dist/components/QuickStartButton.js +4 -3
- package/dist/components/QuickStartButton.js.map +1 -1
- package/dist/components/RightPanelForm.d.ts.map +1 -1
- package/dist/components/RightPanelForm.js +20 -13
- package/dist/components/RightPanelForm.js.map +1 -1
- package/dist/components/RightPanelTabs.d.ts +1 -4
- package/dist/components/RightPanelTabs.d.ts.map +1 -1
- package/dist/components/RightPanelTabs.js +4 -16
- package/dist/components/RightPanelTabs.js.map +1 -1
- package/dist/components/Selector/index.d.ts.map +1 -1
- package/dist/components/Selector/index.js +5 -8
- package/dist/components/Selector/index.js.map +1 -1
- package/dist/components/Selector/styled.d.ts.map +1 -1
- package/dist/components/Selector/styled.js +8 -5
- package/dist/components/Selector/styled.js.map +1 -1
- package/dist/components/StackedBadge.js +5 -5
- package/dist/components/StackedBadge.js.map +1 -1
- package/dist/components/TabManager.d.ts.map +1 -1
- package/dist/components/TabManager.js +9 -32
- package/dist/components/TabManager.js.map +1 -1
- package/dist/components/ToolBadge.d.ts +3 -8
- package/dist/components/ToolBadge.d.ts.map +1 -1
- package/dist/components/ToolBadge.js +23 -99
- package/dist/components/ToolBadge.js.map +1 -1
- package/dist/components/WorkspaceTabNavigator.d.ts.map +1 -1
- package/dist/components/WorkspaceTabNavigator.js +7 -9
- package/dist/components/WorkspaceTabNavigator.js.map +1 -1
- package/dist/components/form/DescribedCheckboxGroup.d.ts +24 -2
- package/dist/components/form/DescribedCheckboxGroup.d.ts.map +1 -1
- package/dist/components/form/DescribedCheckboxGroup.js +46 -29
- package/dist/components/form/DescribedCheckboxGroup.js.map +1 -1
- package/dist/components/form/DescribedRadioGroup.d.ts +24 -4
- package/dist/components/form/DescribedRadioGroup.d.ts.map +1 -1
- package/dist/components/form/DescribedRadioGroup.js +39 -18
- package/dist/components/form/DescribedRadioGroup.js.map +1 -1
- package/dist/context/hooks.d.ts +6 -1
- package/dist/context/hooks.d.ts.map +1 -1
- package/dist/context/hooks.js +4 -1
- package/dist/context/hooks.js.map +1 -1
- package/dist/hooks/midnight-update-view.d.ts +5 -0
- package/dist/hooks/midnight-update-view.d.ts.map +1 -0
- package/dist/hooks/midnight-update-view.js +30 -0
- package/dist/hooks/midnight-update-view.js.map +1 -0
- package/dist/index.d.ts +4 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/layout.css +0 -26
- package/dist/right-panel/DefaultPanel.d.ts.map +1 -1
- package/dist/right-panel/DefaultPanel.js +2 -4
- package/dist/right-panel/DefaultPanel.js.map +1 -1
- package/dist/state/ChatEntry.d.ts +3 -4
- package/dist/state/ChatEntry.d.ts.map +1 -1
- package/dist/state/ChatEntry.js.map +1 -1
- package/dist/state/constants.d.ts.map +1 -1
- package/dist/state/constants.js +1 -0
- package/dist/state/constants.js.map +1 -1
- package/dist/types.d.ts +8 -3
- package/dist/types.d.ts.map +1 -1
- package/dist/utils/tools.d.ts +9 -3
- package/dist/utils/tools.d.ts.map +1 -1
- package/dist/utils/tools.js +1 -6
- package/dist/utils/tools.js.map +1 -1
- package/dist/views/Agents/AgentDescription.d.ts.map +1 -1
- package/dist/views/Agents/AgentDescription.js +8 -13
- package/dist/views/Agents/AgentDescription.js.map +1 -1
- package/dist/views/Agents/AgentsPanel.d.ts.map +1 -1
- package/dist/views/Agents/AgentsPanel.js +7 -7
- package/dist/views/Agents/AgentsPanel.js.map +1 -1
- package/dist/views/Agents/AgentsTab.d.ts.map +1 -1
- package/dist/views/Agents/AgentsTab.js +30 -29
- package/dist/views/Agents/AgentsTab.js.map +1 -1
- package/dist/views/Agents/dictionary.d.ts +1 -1
- package/dist/views/Agents/useAgentFavorites.js +3 -3
- package/dist/views/Agents/useAgentFavorites.js.map +1 -1
- package/dist/views/Chat/AgentInfo.d.ts.map +1 -1
- package/dist/views/Chat/AgentInfo.js +3 -5
- package/dist/views/Chat/AgentInfo.js.map +1 -1
- package/dist/views/Chat/ChatMessage.d.ts +24 -2
- package/dist/views/Chat/ChatMessage.d.ts.map +1 -1
- package/dist/views/Chat/ChatMessage.js +36 -47
- package/dist/views/Chat/ChatMessage.js.map +1 -1
- package/dist/views/Chat/ChatMessages.d.ts +1 -1
- package/dist/views/Chat/ChatMessages.d.ts.map +1 -1
- package/dist/views/Chat/ChatMessages.js +2 -2
- package/dist/views/Chat/ChatMessages.js.map +1 -1
- package/dist/views/Chat/StepsList.d.ts.map +1 -1
- package/dist/views/Chat/StepsList.js +10 -10
- package/dist/views/Chat/StepsList.js.map +1 -1
- package/dist/views/Chat/index.d.ts +1 -1
- package/dist/views/Chat/index.d.ts.map +1 -1
- package/dist/views/Chat/index.js +2 -2
- package/dist/views/Chat/index.js.map +1 -1
- package/dist/views/Chat/styled.d.ts.map +1 -1
- package/dist/views/Chat/styled.js +11 -16
- package/dist/views/Chat/styled.js.map +1 -1
- package/dist/views/ChatHistory/HistoryItem.d.ts.map +1 -1
- package/dist/views/ChatHistory/HistoryItem.js +10 -48
- package/dist/views/ChatHistory/HistoryItem.js.map +1 -1
- package/dist/views/ChatHistory/index.js +1 -1
- package/dist/views/ChatHistory/index.js.map +1 -1
- package/dist/views/ChatHistory/styled.d.ts.map +1 -1
- package/dist/views/ChatHistory/styled.js +3 -5
- package/dist/views/ChatHistory/styled.js.map +1 -1
- package/dist/views/ChatHistory/utils.d.ts +7 -0
- package/dist/views/ChatHistory/utils.d.ts.map +1 -1
- package/dist/views/ChatHistory/utils.js +40 -1
- package/dist/views/ChatHistory/utils.js.map +1 -1
- package/dist/views/ChatTabSelection.d.ts +6 -1
- package/dist/views/ChatTabSelection.d.ts.map +1 -1
- package/dist/views/ChatTabSelection.js +13 -8
- package/dist/views/ChatTabSelection.js.map +1 -1
- package/dist/views/Editor.d.ts.map +1 -1
- package/dist/views/Editor.js +6 -12
- package/dist/views/Editor.js.map +1 -1
- package/dist/views/Home/BuiltInAgent.d.ts.map +1 -1
- package/dist/views/Home/BuiltInAgent.js +2 -3
- package/dist/views/Home/BuiltInAgent.js.map +1 -1
- package/dist/views/Home/CustomAgent.js +3 -3
- package/dist/views/Home/CustomAgent.js.map +1 -1
- package/dist/views/Home/index.js +2 -2
- package/dist/views/Home/index.js.map +1 -1
- package/dist/views/Home/styled.d.ts.map +1 -1
- package/dist/views/Home/styled.js +21 -22
- package/dist/views/Home/styled.js.map +1 -1
- package/dist/views/KSDocument.d.ts.map +1 -1
- package/dist/views/KSDocument.js +3 -4
- package/dist/views/KSDocument.js.map +1 -1
- package/dist/views/KnowledgeSources.d.ts.map +1 -1
- package/dist/views/KnowledgeSources.js +14 -36
- package/dist/views/KnowledgeSources.js.map +1 -1
- package/dist/views/MessageInput/AgentSelector.d.ts.map +1 -1
- package/dist/views/MessageInput/AgentSelector.js +7 -5
- package/dist/views/MessageInput/AgentSelector.js.map +1 -1
- package/dist/views/MessageInput/ButtonAgent.d.ts.map +1 -1
- package/dist/views/MessageInput/ButtonAgent.js +4 -5
- package/dist/views/MessageInput/ButtonAgent.js.map +1 -1
- package/dist/views/MessageInput/ButtonBar.d.ts.map +1 -1
- package/dist/views/MessageInput/ButtonBar.js +2 -4
- package/dist/views/MessageInput/ButtonBar.js.map +1 -1
- package/dist/views/MessageInput/ContextBar.d.ts.map +1 -1
- package/dist/views/MessageInput/ContextBar.js +3 -6
- package/dist/views/MessageInput/ContextBar.js.map +1 -1
- package/dist/views/MessageInput/QuickCommandSelector.js +2 -2
- package/dist/views/MessageInput/QuickCommandSelector.js.map +1 -1
- package/dist/views/MessageInput/SelectContent.d.ts.map +1 -1
- package/dist/views/MessageInput/SelectContent.js +30 -29
- package/dist/views/MessageInput/SelectContent.js.map +1 -1
- package/dist/views/MessageInput/UploadDragNDrop.d.ts.map +1 -1
- package/dist/views/MessageInput/UploadDragNDrop.js +2 -3
- package/dist/views/MessageInput/UploadDragNDrop.js.map +1 -1
- package/dist/views/MessageInput/dictionary.d.ts +1 -1
- package/dist/views/MessageInput/index.d.ts +2 -1
- package/dist/views/MessageInput/index.d.ts.map +1 -1
- package/dist/views/MessageInput/index.js +5 -6
- package/dist/views/MessageInput/index.js.map +1 -1
- package/dist/views/MessageInput/styled.d.ts +1 -3
- package/dist/views/MessageInput/styled.d.ts.map +1 -1
- package/dist/views/MessageInput/styled.js +11 -15
- package/dist/views/MessageInput/styled.js.map +1 -1
- package/dist/views/MinimizedHeader.d.ts.map +1 -1
- package/dist/views/MinimizedHeader.js +3 -4
- package/dist/views/MinimizedHeader.js.map +1 -1
- package/dist/views/Resources.d.ts.map +1 -1
- package/dist/views/Resources.js +11 -8
- package/dist/views/Resources.js.map +1 -1
- package/dist/views/Stacks.d.ts.map +1 -1
- package/dist/views/Stacks.js +23 -28
- package/dist/views/Stacks.js.map +1 -1
- package/dist/views/Steps/FlowChart/NodeStep.d.ts.map +1 -1
- package/dist/views/Steps/FlowChart/NodeStep.js +3 -3
- package/dist/views/Steps/FlowChart/NodeStep.js.map +1 -1
- package/dist/views/Steps/StepModal.d.ts.map +1 -1
- package/dist/views/Steps/StepModal.js +4 -6
- package/dist/views/Steps/StepModal.js.map +1 -1
- package/dist/views/Steps/dictionary.d.ts +1 -1
- package/dist/views/Steps/index.d.ts.map +1 -1
- package/dist/views/Steps/index.js +3 -4
- package/dist/views/Steps/index.js.map +1 -1
- package/dist/views/Steps/utils.d.ts +2 -1
- package/dist/views/Steps/utils.d.ts.map +1 -1
- package/dist/views/Steps/utils.js +8 -8
- package/dist/views/Steps/utils.js.map +1 -1
- package/dist/views/Tools.js +1 -1
- package/dist/views/Tools.js.map +1 -1
- package/dist/views/Workspaces/WorkspacesTab.d.ts.map +1 -1
- package/dist/views/Workspaces/WorkspacesTab.js +7 -10
- package/dist/views/Workspaces/WorkspacesTab.js.map +1 -1
- package/dist/views/Workspaces/index.js +4 -2
- package/dist/views/Workspaces/index.js.map +1 -1
- package/package.json +5 -3
- package/src/StackspotAIWidget.tsx +51 -37
- package/src/app-metadata.json +13 -5
- package/src/chat-interceptors/quick-commands.ts +3 -3
- package/src/components/AdaptiveTextArea.tsx +1 -1
- package/src/components/AgentCard/AgentCardCreate.tsx +4 -7
- package/src/components/AgentCard/index.tsx +7 -7
- package/src/components/ButtonFavorite.tsx +20 -47
- package/src/components/Code.tsx +31 -36
- package/src/components/ComponentNavigator.tsx +4 -8
- package/src/components/FadingOverflow.tsx +6 -7
- package/src/components/FileDescription.tsx +14 -10
- package/src/components/HistoryList.tsx +4 -1
- package/src/components/ListResource.tsx +5 -5
- package/src/components/Markdown.tsx +1 -1
- package/src/components/Modal.tsx +2 -4
- package/src/components/QuickStartButton.tsx +5 -4
- package/src/components/RightPanelForm.tsx +20 -13
- package/src/components/RightPanelTabs.tsx +4 -32
- package/src/components/Selector/index.tsx +17 -13
- package/src/components/Selector/styled.ts +8 -5
- package/src/components/StackedBadge.tsx +5 -5
- package/src/components/TabManager.tsx +31 -55
- package/src/components/ToolBadge.tsx +48 -129
- package/src/components/WorkspaceTabNavigator.tsx +22 -25
- package/src/components/form/DescribedCheckboxGroup.tsx +90 -65
- package/src/components/form/DescribedRadioGroup.tsx +78 -46
- package/src/context/hooks.ts +4 -1
- package/src/hooks/midnight-update-view.ts +36 -0
- package/src/index.ts +4 -2
- package/src/layout.css +0 -26
- package/src/right-panel/DefaultPanel.tsx +3 -7
- package/src/state/ChatEntry.ts +3 -4
- package/src/state/constants.ts +2 -1
- package/src/types.ts +9 -3
- package/src/utils/tools.ts +3 -12
- package/src/views/Agents/AgentDescription.tsx +20 -36
- package/src/views/Agents/AgentsPanel.tsx +11 -12
- package/src/views/Agents/AgentsTab.tsx +38 -57
- package/src/views/Agents/useAgentFavorites.ts +3 -3
- package/src/views/Chat/AgentInfo.tsx +7 -6
- package/src/views/Chat/ChatMessage.tsx +163 -145
- package/src/views/Chat/ChatMessages.tsx +2 -1
- package/src/views/Chat/StepsList.tsx +10 -11
- package/src/views/Chat/index.tsx +9 -2
- package/src/views/Chat/styled.ts +11 -16
- package/src/views/ChatHistory/HistoryItem.tsx +15 -54
- package/src/views/ChatHistory/index.tsx +1 -1
- package/src/views/ChatHistory/styled.ts +3 -5
- package/src/views/ChatHistory/utils.ts +43 -2
- package/src/views/ChatTabSelection.tsx +18 -10
- package/src/views/Editor.tsx +9 -14
- package/src/views/Home/BuiltInAgent.tsx +7 -8
- package/src/views/Home/CustomAgent.tsx +3 -3
- package/src/views/Home/index.tsx +2 -2
- package/src/views/Home/styled.ts +21 -22
- package/src/views/KSDocument.tsx +7 -8
- package/src/views/KnowledgeSources.tsx +24 -66
- package/src/views/MessageInput/AgentSelector.tsx +10 -8
- package/src/views/MessageInput/ButtonAgent.tsx +24 -12
- package/src/views/MessageInput/ButtonBar.tsx +25 -21
- package/src/views/MessageInput/ContextBar.tsx +16 -14
- package/src/views/MessageInput/QuickCommandSelector.tsx +2 -2
- package/src/views/MessageInput/SelectContent.tsx +39 -62
- package/src/views/MessageInput/UploadDragNDrop.tsx +2 -5
- package/src/views/MessageInput/index.tsx +8 -9
- package/src/views/MessageInput/styled.ts +12 -16
- package/src/views/MinimizedHeader.tsx +5 -7
- package/src/views/Resources.tsx +31 -30
- package/src/views/Stacks.tsx +31 -54
- package/src/views/Steps/FlowChart/NodeStep.tsx +6 -4
- package/src/views/Steps/StepModal.tsx +14 -18
- package/src/views/Steps/index.tsx +4 -5
- package/src/views/Steps/utils.tsx +9 -9
- package/src/views/Tools.tsx +0 -1
- package/src/views/Workspaces/WorkspacesTab.tsx +17 -21
- package/src/views/Workspaces/index.tsx +4 -2
- package/dist/components/Accordion.d.ts +0 -20
- package/dist/components/Accordion.d.ts.map +0 -1
- package/dist/components/Accordion.js +0 -51
- package/dist/components/Accordion.js.map +0 -1
- package/dist/components/FallbackBoundary/ErrorBoundary.d.ts +0 -33
- package/dist/components/FallbackBoundary/ErrorBoundary.d.ts.map +0 -1
- package/dist/components/FallbackBoundary/ErrorBoundary.js +0 -52
- package/dist/components/FallbackBoundary/ErrorBoundary.js.map +0 -1
- package/dist/components/FallbackBoundary/Loading.d.ts +0 -2
- package/dist/components/FallbackBoundary/Loading.d.ts.map +0 -1
- package/dist/components/FallbackBoundary/Loading.js +0 -12
- package/dist/components/FallbackBoundary/Loading.js.map +0 -1
- package/dist/components/FallbackBoundary/index.d.ts +0 -17
- package/dist/components/FallbackBoundary/index.d.ts.map +0 -1
- package/dist/components/FallbackBoundary/index.js +0 -9
- package/dist/components/FallbackBoundary/index.js.map +0 -1
- package/dist/components/IconInput.d.ts +0 -10
- package/dist/components/IconInput.d.ts.map +0 -1
- package/dist/components/IconInput.js +0 -61
- package/dist/components/IconInput.js.map +0 -1
- package/dist/components/OverlayMenu.d.ts +0 -21
- package/dist/components/OverlayMenu.d.ts.map +0 -1
- package/dist/components/OverlayMenu.js +0 -79
- package/dist/components/OverlayMenu.js.map +0 -1
- package/dist/components/ProgressBar.d.ts +0 -37
- package/dist/components/ProgressBar.d.ts.map +0 -1
- package/dist/components/ProgressBar.js +0 -131
- package/dist/components/ProgressBar.js.map +0 -1
- package/dist/components/Tooltip/Tooltip.d.ts +0 -37
- package/dist/components/Tooltip/Tooltip.d.ts.map +0 -1
- package/dist/components/Tooltip/Tooltip.js +0 -30
- package/dist/components/Tooltip/Tooltip.js.map +0 -1
- package/dist/components/Tooltip/TooltipAPI.d.ts +0 -29
- package/dist/components/Tooltip/TooltipAPI.d.ts.map +0 -1
- package/dist/components/Tooltip/TooltipAPI.js +0 -107
- package/dist/components/Tooltip/TooltipAPI.js.map +0 -1
- package/dist/components/Tooltip/context.d.ts +0 -5
- package/dist/components/Tooltip/context.d.ts.map +0 -1
- package/dist/components/Tooltip/context.js +0 -18
- package/dist/components/Tooltip/context.js.map +0 -1
- package/dist/components/Tooltip/index.d.ts +0 -3
- package/dist/components/Tooltip/index.d.ts.map +0 -1
- package/dist/components/Tooltip/index.js +0 -3
- package/dist/components/Tooltip/index.js.map +0 -1
- package/dist/components/Tooltip/style.d.ts +0 -4
- package/dist/components/Tooltip/style.d.ts.map +0 -1
- package/dist/components/Tooltip/style.js +0 -22
- package/dist/components/Tooltip/style.js.map +0 -1
- package/dist/components/Tooltip/types.d.ts +0 -27
- package/dist/components/Tooltip/types.d.ts.map +0 -1
- package/dist/components/Tooltip/types.js +0 -2
- package/dist/components/Tooltip/types.js.map +0 -1
- package/src/components/Accordion.tsx +0 -75
- package/src/components/FallbackBoundary/ErrorBoundary.tsx +0 -71
- package/src/components/FallbackBoundary/Loading.tsx +0 -14
- package/src/components/FallbackBoundary/index.tsx +0 -26
- package/src/components/IconInput.tsx +0 -73
- package/src/components/OverlayMenu.tsx +0 -133
- package/src/components/ProgressBar.tsx +0 -183
- package/src/components/Tooltip/Tooltip.tsx +0 -78
- package/src/components/Tooltip/TooltipAPI.ts +0 -101
- package/src/components/Tooltip/context.tsx +0 -24
- package/src/components/Tooltip/index.ts +0 -2
- package/src/components/Tooltip/style.tsx +0 -24
- package/src/components/Tooltip/types.ts +0 -28
|
@@ -1,16 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Star, StarFill } from '@citric/icons'
|
|
3
|
-
import { IconButton, LoadingCircular } from '@citric/ui'
|
|
1
|
+
import { BaseFavoriteProps, Favorite } from '@stack-spot/citric-react'
|
|
4
2
|
import { useTranslate } from '@stack-spot/portal-translate'
|
|
5
|
-
import {
|
|
3
|
+
import { useEffect, useState } from 'react'
|
|
6
4
|
import { dictionaryFavorites } from './form/dictionary'
|
|
7
5
|
|
|
8
|
-
interface ItemFavorite {
|
|
6
|
+
export interface ItemFavorite {
|
|
9
7
|
id?: string,
|
|
10
8
|
slug?: string,
|
|
11
9
|
}
|
|
12
10
|
|
|
13
|
-
interface Favorite<T extends ItemFavorite> {
|
|
11
|
+
export interface Favorite<T extends ItemFavorite> {
|
|
14
12
|
/**
|
|
15
13
|
* id or slug to be used on functions
|
|
16
14
|
*/
|
|
@@ -34,17 +32,17 @@ interface Favorite<T extends ItemFavorite> {
|
|
|
34
32
|
}
|
|
35
33
|
|
|
36
34
|
interface Props<T extends ItemFavorite> {
|
|
37
|
-
/**
|
|
38
|
-
* Determine whether the component should be a Button or an IconButton.
|
|
39
|
-
*/
|
|
40
|
-
isIconButton?: boolean,
|
|
41
35
|
/**
|
|
42
36
|
* An object containing favorite items and related operations.
|
|
43
37
|
*/
|
|
44
38
|
favorite: Favorite<T>,
|
|
39
|
+
/**
|
|
40
|
+
* @default 'square'
|
|
41
|
+
*/
|
|
42
|
+
appearance?: BaseFavoriteProps['appearance'],
|
|
45
43
|
}
|
|
46
44
|
|
|
47
|
-
export const ButtonFavorite = <T extends ItemFavorite>({ favorite,
|
|
45
|
+
export const ButtonFavorite = <T extends ItemFavorite>({ favorite, appearance = 'square' }: Props<T>) => {
|
|
48
46
|
const [isFavorite, setIsFavorite] = useState(false)
|
|
49
47
|
const { idOrSlug, listFavorites } = favorite || {}
|
|
50
48
|
|
|
@@ -53,12 +51,12 @@ export const ButtonFavorite = <T extends ItemFavorite>({ favorite, isIconButton
|
|
|
53
51
|
}, [listFavorites])
|
|
54
52
|
|
|
55
53
|
return (
|
|
56
|
-
<ButtonWrapper isFavorite={isFavorite}
|
|
54
|
+
<ButtonWrapper isFavorite={isFavorite} favorite={favorite} appearance={appearance} />
|
|
57
55
|
)
|
|
58
56
|
}
|
|
59
57
|
|
|
60
|
-
const ButtonWrapper = <T extends ItemFavorite>({
|
|
61
|
-
{
|
|
58
|
+
const ButtonWrapper = <T extends ItemFavorite>({ isFavorite, favorite, appearance }:
|
|
59
|
+
{ isFavorite: boolean, favorite: Favorite<T>, appearance: BaseFavoriteProps['appearance'] }) => {
|
|
62
60
|
const t = useTranslate(dictionaryFavorites)
|
|
63
61
|
const { idOrSlug, onAddFavorite, onRemoveFavorite } = favorite
|
|
64
62
|
const [loading, setLoading] = useState(false)
|
|
@@ -69,37 +67,12 @@ const ButtonWrapper = <T extends ItemFavorite>({ isIconButton, isFavorite, favor
|
|
|
69
67
|
setLoading(false)
|
|
70
68
|
}
|
|
71
69
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
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
|
-
)
|
|
70
|
+
return <Favorite
|
|
71
|
+
loading={loading}
|
|
72
|
+
appearance={appearance}
|
|
73
|
+
aria-label={`${t[isFavorite ? 'remove' : 'become']} ${t.favorite}`}
|
|
74
|
+
title={`${t[isFavorite ? 'remove' : 'become']} ${t.favorite}`}
|
|
75
|
+
value={isFavorite}
|
|
76
|
+
onChange={checked => handleAction(idOrSlug, checked ? onAddFavorite : onRemoveFavorite)}
|
|
77
|
+
/>
|
|
105
78
|
}
|
package/src/components/Code.tsx
CHANGED
|
@@ -2,9 +2,7 @@
|
|
|
2
2
|
* Copied from the extension's webview.
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
-
import { Text } from '@citric
|
|
6
|
-
import { AddCode, ChevronDoubleDown, Collapse, Copy, Download } from '@citric/icons'
|
|
7
|
-
import { IconButton } from '@citric/ui'
|
|
5
|
+
import { IconButton, Text } from '@stack-spot/citric-react'
|
|
8
6
|
import { theme, useThemeKind } from '@stack-spot/portal-theme'
|
|
9
7
|
import { Dictionary, useTranslate } from '@stack-spot/portal-translate'
|
|
10
8
|
import { CSSProperties, useState } from 'react'
|
|
@@ -79,6 +77,12 @@ const CodeBox = styled.code`
|
|
|
79
77
|
opacity: 1;
|
|
80
78
|
}
|
|
81
79
|
}
|
|
80
|
+
|
|
81
|
+
.copy-btn {
|
|
82
|
+
&:after {
|
|
83
|
+
left: -30px; // prevents scrolling in the horizontal axis.
|
|
84
|
+
}
|
|
85
|
+
}
|
|
82
86
|
}
|
|
83
87
|
}
|
|
84
88
|
|
|
@@ -149,14 +153,14 @@ export const Code = ({
|
|
|
149
153
|
</div>
|
|
150
154
|
<div className="action-bar" role="toolbar">
|
|
151
155
|
<IconButton
|
|
156
|
+
icon="Collapse"
|
|
152
157
|
aria-label={showLines ? t.hideLines : t.showLines}
|
|
153
158
|
title={showLines ? t.hideLines : t.showLines}
|
|
154
159
|
onClick={() => setShowLines(v => !v)}
|
|
155
160
|
style={{ position: 'relative', transform: showLines ? undefined : 'rotate(180deg)', transition: 'transform 0.2s' }}
|
|
156
|
-
|
|
157
|
-
<Collapse />
|
|
158
|
-
</IconButton>
|
|
161
|
+
/>
|
|
159
162
|
<IconButton
|
|
163
|
+
icon="Download"
|
|
160
164
|
aria-label={t.downloadCode}
|
|
161
165
|
title={t.downloadCode}
|
|
162
166
|
onClick={() => {
|
|
@@ -176,41 +180,30 @@ export const Code = ({
|
|
|
176
180
|
console.error(t.downloadError, e)
|
|
177
181
|
}
|
|
178
182
|
}}
|
|
179
|
-
|
|
180
|
-
<Download />
|
|
181
|
-
</IconButton>
|
|
183
|
+
/>
|
|
182
184
|
<IconButton
|
|
185
|
+
icon="Copy"
|
|
183
186
|
aria-label={t.copy}
|
|
184
187
|
title={t.copy}
|
|
185
188
|
onClick={onClickCopy}
|
|
186
189
|
style={{ position: 'relative' }}
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
{onInsertCode
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
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}
|
|
190
|
+
feedback={t.copied}
|
|
191
|
+
className="copy-btn"
|
|
192
|
+
/>
|
|
193
|
+
{onInsertCode ? <IconButton
|
|
194
|
+
icon="ChevronDoubleDown"
|
|
195
|
+
aria-label={t.insert}
|
|
196
|
+
title={t.insert}
|
|
197
|
+
onClick={onClickInsert}
|
|
198
|
+
style={{ position: 'relative', transform: 'rotate(90deg)' }}
|
|
199
|
+
/> : null}
|
|
200
|
+
{onNewFile ? <IconButton
|
|
201
|
+
icon="AddCode"
|
|
202
|
+
aria-label={t.newFile}
|
|
203
|
+
title={t.newFile}
|
|
204
|
+
onClick={onClickNewFile}
|
|
205
|
+
style={{ position: 'relative' }}
|
|
206
|
+
/> : null}
|
|
214
207
|
</div>
|
|
215
208
|
</div>
|
|
216
209
|
)}
|
|
@@ -235,6 +228,7 @@ export const Code = ({
|
|
|
235
228
|
const dictionary = {
|
|
236
229
|
en: {
|
|
237
230
|
copy: 'Copy code to the clipboard',
|
|
231
|
+
copied: 'Copied',
|
|
238
232
|
insert: 'Inject code into editor',
|
|
239
233
|
newFile: 'Creates a new file with this code as its content',
|
|
240
234
|
hideLines: 'Hide line numbers',
|
|
@@ -244,6 +238,7 @@ const dictionary = {
|
|
|
244
238
|
},
|
|
245
239
|
pt: {
|
|
246
240
|
copy: 'Copiar código para a área de transferência',
|
|
241
|
+
copied: 'Copiado',
|
|
247
242
|
insert: 'Inserir código no editor',
|
|
248
243
|
newFile: 'Criar um novo arquivo com este código como conteúdo',
|
|
249
244
|
hideLines: 'Esconder números das linhas',
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { ArrowLeft } from '@citric/icons'
|
|
3
|
-
import { IconButton } from '@citric/ui'
|
|
1
|
+
import { IconButton, Row } from '@stack-spot/citric-react'
|
|
4
2
|
import { createContext, useCallback, useContext, useMemo, useState } from 'react'
|
|
5
3
|
|
|
6
4
|
/**
|
|
@@ -81,12 +79,10 @@ export function ComponentNavigator<T extends NavigationMap, K extends keyof T>({
|
|
|
81
79
|
return (<NavigationContext.Provider value={navigationContext as NavigationContextType<NavigationMap>}>
|
|
82
80
|
<div className={`content-navigator ${className || isFullScreen ? 'full' : ''}`} role="navigation">
|
|
83
81
|
{canGoBack && (
|
|
84
|
-
<
|
|
85
|
-
<IconButton onClick={goBack}
|
|
86
|
-
<ArrowLeft />
|
|
87
|
-
</IconButton>
|
|
82
|
+
<Row gap="12px" style={{ alignSelf: 'stretch' }}>
|
|
83
|
+
<IconButton icon="ArrowLeft" onClick={goBack} className="back-button" aria-label="Back" />
|
|
88
84
|
{renderTitle?.(currentItem)}
|
|
89
|
-
</
|
|
85
|
+
</Row>
|
|
90
86
|
)}
|
|
91
87
|
<Component {...(currentItem.props as any)} />
|
|
92
88
|
</div>
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { ChevronDown, ChevronLeft, ChevronRight, ChevronUp } from '@citric/icons'
|
|
1
|
+
import { Icon } from '@stack-spot/citric-icons'
|
|
3
2
|
import { listToClass, theme, WithStyle } from '@stack-spot/portal-theme'
|
|
4
3
|
import { debounce } from 'lodash'
|
|
5
4
|
import { useEffect, useRef } from 'react'
|
|
@@ -80,7 +79,7 @@ const OverflowBox = styled.div`
|
|
|
80
79
|
pointer-events: none;
|
|
81
80
|
transition: opacity 0.3s;
|
|
82
81
|
|
|
83
|
-
|
|
82
|
+
.citric-icon {
|
|
84
83
|
background-color: ${theme.color.light[300]};
|
|
85
84
|
border-radius: 50%;
|
|
86
85
|
width: 16px;
|
|
@@ -253,10 +252,10 @@ export const FadingOverflow = (
|
|
|
253
252
|
return scroll === 'arrows' ? (
|
|
254
253
|
<OverflowBox {...props} className={listToClass(['scroll-arrows', className])}>
|
|
255
254
|
<div className="content" ref={ref}>{children}</div>
|
|
256
|
-
<div className="scroll-to-left" aria-hidden><
|
|
257
|
-
<div className="scroll-to-right" aria-hidden><
|
|
258
|
-
<div className="scroll-to-top" aria-hidden><
|
|
259
|
-
<div className="scroll-to-bottom" aria-hidden><
|
|
255
|
+
<div className="scroll-to-left" aria-hidden><Icon icon="ChevronLeft" size="xs" /></div>
|
|
256
|
+
<div className="scroll-to-right" aria-hidden><Icon icon="ChevronRight" size="xs" /></div>
|
|
257
|
+
<div className="scroll-to-top" aria-hidden><Icon icon="ChevronUp" size="xs" /></div>
|
|
258
|
+
<div className="scroll-to-bottom" aria-hidden><Icon icon="ChevronDown" size="xs" /></div>
|
|
260
259
|
</OverflowBox>
|
|
261
260
|
) : <OverflowBox {...props} className={className} ref={ref}>{children}</OverflowBox>
|
|
262
261
|
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { IconButton, LoadingCircular } from '@citric/ui'
|
|
1
|
+
import { Icon } from '@stack-spot/citric-icons'
|
|
2
|
+
import { IconButton, ProgressCircular, Text } from '@stack-spot/citric-react'
|
|
4
3
|
import { theme } from '@stack-spot/portal-theme'
|
|
5
4
|
import { Dictionary, useTranslate } from '@stack-spot/portal-translate'
|
|
6
5
|
import { styled } from 'styled-components'
|
|
@@ -79,21 +78,26 @@ export const FileDescription = ({ fileName, icon, status, onRemove, onRetry }: F
|
|
|
79
78
|
return (
|
|
80
79
|
<Styled className={status} aria-busy={status === 'pending'}>
|
|
81
80
|
<div className="image">
|
|
82
|
-
{icon ?? <
|
|
81
|
+
{icon ?? <Icon icon="Document" />}
|
|
83
82
|
{status === 'pending' && <div className="status" aria-label={t.loading}>
|
|
84
|
-
<
|
|
83
|
+
<ProgressCircular size="xs" />
|
|
85
84
|
</div>}
|
|
86
85
|
{status === 'error' && <div className="status" aria-label={t.error}>
|
|
87
|
-
<IconButton appearance="circle" color="danger" title={t.retry} aria-label={t.retry} onClick={onRetry}
|
|
86
|
+
<IconButton icon="Sync" appearance="circle" color="danger" title={t.retry} aria-label={t.retry} onClick={onRetry} />
|
|
88
87
|
</div>}
|
|
89
88
|
</div>
|
|
90
89
|
<div className="details">
|
|
91
90
|
<Text appearance="microtext1" className="name" title={name}>{name}</Text>
|
|
92
|
-
<Text appearance="microtext1"
|
|
91
|
+
<Text appearance="microtext1" color="light.700">{extension.toUpperCase()}</Text>
|
|
93
92
|
</div>
|
|
94
|
-
{onRemove && <IconButton
|
|
95
|
-
|
|
96
|
-
|
|
93
|
+
{onRemove && <IconButton
|
|
94
|
+
icon="TimesMini"
|
|
95
|
+
onClick={onRemove}
|
|
96
|
+
title={t.remove}
|
|
97
|
+
arial-label={`${t.remove} ${name}`}
|
|
98
|
+
style={{ alignSelf: 'start' }}
|
|
99
|
+
size="xs"
|
|
100
|
+
/>}
|
|
97
101
|
</Styled>
|
|
98
102
|
)
|
|
99
103
|
}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { Text } from '@citric
|
|
1
|
+
import { Text } from '@stack-spot/citric-react'
|
|
2
2
|
import { theme, WithStyle } from '@stack-spot/portal-theme'
|
|
3
3
|
import { Dictionary, useTranslate } from '@stack-spot/portal-translate'
|
|
4
4
|
import { groupBy, map } from 'lodash'
|
|
5
5
|
import { useMemo } from 'react'
|
|
6
6
|
import { styled } from 'styled-components'
|
|
7
|
+
import { useMidnightUpdateView } from '../hooks/midnight-update-view'
|
|
7
8
|
import { subtractDays } from '../utils/date'
|
|
8
9
|
|
|
9
10
|
type HistorySectionName = 'today' | 'yesterday' | 'last7' | 'last30' | 'older'
|
|
@@ -69,6 +70,8 @@ function dateToSectionName(date: Date): HistorySectionName {
|
|
|
69
70
|
*/
|
|
70
71
|
export function HistoryList<T>({ getDate, items, keygen, className, style, renderItem }: Props<T>) {
|
|
71
72
|
const t = useTranslate(dictionary)
|
|
73
|
+
useMidnightUpdateView()
|
|
74
|
+
|
|
72
75
|
const sections = useMemo(() => {
|
|
73
76
|
const byDate = groupBy(items, item => dateToSectionName(getDate(item)))
|
|
74
77
|
return map(byDate, (value: T[], key: HistorySectionName) => (
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Row, Text } from '@stack-spot/citric-react'
|
|
2
2
|
import { WithStyle } from '@stack-spot/portal-theme'
|
|
3
3
|
import { useMemo } from 'react'
|
|
4
4
|
|
|
@@ -43,18 +43,18 @@ export function ListResource<T>({ list, renderLabel, renderBeforeElement, render
|
|
|
43
43
|
const content = typeof label === 'string' ? <Text>{label}</Text> : label
|
|
44
44
|
return (
|
|
45
45
|
<li key={keygen(listItem)}>
|
|
46
|
-
<
|
|
46
|
+
<Row>
|
|
47
47
|
{renderBeforeElement?.(listItem)}
|
|
48
48
|
{content}
|
|
49
49
|
{renderAfterElement?.(listItem)}
|
|
50
|
-
</
|
|
50
|
+
</Row>
|
|
51
51
|
</li>
|
|
52
52
|
)
|
|
53
53
|
}), [list])
|
|
54
54
|
|
|
55
55
|
return (
|
|
56
|
-
<
|
|
56
|
+
<ul style={{ margin: 0, padding: 0, width: '100%', ...style }} className={className}>
|
|
57
57
|
{items}
|
|
58
|
-
</
|
|
58
|
+
</ul>
|
|
59
59
|
)
|
|
60
60
|
}
|
|
@@ -32,7 +32,7 @@ export const Markdown = (
|
|
|
32
32
|
) => (
|
|
33
33
|
<>
|
|
34
34
|
<ReactMarkdown
|
|
35
|
-
className="markdown"
|
|
35
|
+
className="markdown apply-citric"
|
|
36
36
|
remarkPlugins={[[remarkGfm]]}
|
|
37
37
|
components={{
|
|
38
38
|
a: props => <a target="_blank" rel="noopener noreferrer" style={{ textDecoration: 'underline' }} {...props} />,
|
package/src/components/Modal.tsx
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import { Text } from '@citric
|
|
2
|
-
import { Times } from '@citric/icons'
|
|
3
|
-
import { IconButton } from '@citric/ui'
|
|
1
|
+
import { IconButton, Text } from '@stack-spot/citric-react'
|
|
4
2
|
import { Dictionary, useTranslate } from '@stack-spot/portal-translate'
|
|
5
3
|
import { useEffect, useRef, useState } from 'react'
|
|
6
4
|
import { createPortal } from 'react-dom'
|
|
@@ -19,7 +17,7 @@ const ModalContent = ({ title, children, onClose }: Omit<Props, 'open'>) => {
|
|
|
19
17
|
<div className="chat-modal">
|
|
20
18
|
<header>
|
|
21
19
|
{typeof title === 'string' ? <Text appearance="h6">{title}</Text> : title}
|
|
22
|
-
<IconButton aria-label={t.close} title={t.close}
|
|
20
|
+
<IconButton icon="Times" aria-label={t.close} title={t.close} onClick={onClose} />
|
|
23
21
|
</header>
|
|
24
22
|
<article>{children}</article>
|
|
25
23
|
</div>
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Icon } from '@stack-spot/citric-icons'
|
|
2
|
+
import { Button, Text } from '@stack-spot/citric-react'
|
|
2
3
|
import { WithStyle } from '@stack-spot/portal-theme'
|
|
3
4
|
import { ButtonAction } from '../types'
|
|
4
5
|
|
|
5
|
-
|
|
6
|
+
type Props = ButtonAction & WithStyle
|
|
6
7
|
|
|
7
|
-
export const QuickStartButton = ({ label, onClick, className, icon, style }: Props) => {
|
|
8
|
+
export const QuickStartButton = ({ label, onClick, className, group, icon, style }: Props) => {
|
|
8
9
|
const content = <>
|
|
9
|
-
{icon && <
|
|
10
|
+
{icon && <Icon group={group} icon={icon} aria-hidden />}
|
|
10
11
|
<Text nowrapEllipsis>{label}</Text>
|
|
11
12
|
</>
|
|
12
13
|
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { FallbackBoundary } from '@stack-spot/citric-react'
|
|
2
2
|
import { theme } from '@stack-spot/portal-theme'
|
|
3
3
|
import { styled } from 'styled-components'
|
|
4
4
|
import { panelAnimationTime } from '../right-panel/constants'
|
|
5
5
|
import { PropsOf } from '../types'
|
|
6
6
|
import { AutoFocus } from './AutoFocus'
|
|
7
|
-
import { FallbackBoundary } from './FallbackBoundary'
|
|
8
7
|
|
|
9
8
|
const Form = styled.form`
|
|
10
9
|
display: flex;
|
|
@@ -14,7 +13,7 @@ const Form = styled.form`
|
|
|
14
13
|
flex: 1;
|
|
15
14
|
gap: 20px;
|
|
16
15
|
|
|
17
|
-
> .content, .content-navigator .content, .content-navigator:not(.full) {
|
|
16
|
+
> .content, .content-navigator > .content, .content-navigator:not(.full) {
|
|
18
17
|
display: flex;
|
|
19
18
|
flex-direction: column;
|
|
20
19
|
gap: 8px;
|
|
@@ -52,22 +51,30 @@ const Form = styled.form`
|
|
|
52
51
|
> button {
|
|
53
52
|
margin-right: auto;
|
|
54
53
|
}
|
|
55
|
-
|
|
56
|
-
.search {
|
|
57
|
-
margin-bottom: 8px;
|
|
58
|
-
}
|
|
59
|
-
|
|
54
|
+
|
|
60
55
|
.option-list {
|
|
61
56
|
overflow: auto;
|
|
57
|
+
> .row {
|
|
58
|
+
gap: 6px;
|
|
59
|
+
align-items: start;
|
|
60
|
+
}
|
|
61
|
+
[data-citric="accordion"] {
|
|
62
|
+
background-color: ${theme.color.light[400]};
|
|
63
|
+
flex: 1;
|
|
64
|
+
> header {
|
|
65
|
+
min-height: 24px;
|
|
66
|
+
padding: 8px 10px;
|
|
67
|
+
align-items: center;
|
|
68
|
+
p {
|
|
69
|
+
flex: 1;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
62
73
|
}
|
|
63
74
|
|
|
64
|
-
|
|
75
|
+
.filtered-out {
|
|
65
76
|
opacity: 0.5;
|
|
66
77
|
}
|
|
67
|
-
|
|
68
|
-
${Card} svg {
|
|
69
|
-
fill: transparent;
|
|
70
|
-
}
|
|
71
78
|
`
|
|
72
79
|
|
|
73
80
|
/**
|
|
@@ -1,43 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { useMemo
|
|
3
|
-
import styled from 'styled-components'
|
|
1
|
+
import { Tab, Tabs } from '@stack-spot/citric-react'
|
|
2
|
+
import { useMemo } from 'react'
|
|
4
3
|
import { RightPanelForm } from './RightPanelForm'
|
|
5
4
|
|
|
6
|
-
interface Tab {
|
|
7
|
-
title: string,
|
|
8
|
-
content: React.ReactNode,
|
|
9
|
-
}
|
|
10
|
-
|
|
11
5
|
interface Props {
|
|
12
6
|
tabs: Tab[],
|
|
13
7
|
}
|
|
14
8
|
|
|
15
|
-
const StyledTabs = styled(Tabs)`
|
|
16
|
-
> button {
|
|
17
|
-
flex: 1;
|
|
18
|
-
padding: 8px 0;
|
|
19
|
-
}
|
|
20
|
-
`
|
|
21
|
-
|
|
22
|
-
const StyledTabsItem = styled(TabsItem)`
|
|
23
|
-
flex: 1;
|
|
24
|
-
overflow: hidden;
|
|
25
|
-
`
|
|
26
|
-
|
|
27
9
|
/**
|
|
28
10
|
* Tabs for the right panel content.
|
|
29
11
|
*/
|
|
30
12
|
export const RightPanelTabs = ({ tabs }: Props) => {
|
|
31
|
-
const
|
|
32
|
-
|
|
33
|
-
<StyledTabsItem key={title} title={title}>
|
|
34
|
-
<RightPanelForm>{content}</RightPanelForm>
|
|
35
|
-
</StyledTabsItem>
|
|
36
|
-
)), [tabs])
|
|
37
|
-
|
|
38
|
-
return (
|
|
39
|
-
<StyledTabs activeIndex={currentTab} onChange={setCurrentTab}>
|
|
40
|
-
{tabItems}
|
|
41
|
-
</StyledTabs>
|
|
42
|
-
)
|
|
13
|
+
const tabItems = useMemo(() => tabs.map(t => ({ ...t, content: <RightPanelForm>{t.content}</RightPanelForm> })), [tabs])
|
|
14
|
+
return <Tabs tabs={tabItems} equallySized />
|
|
43
15
|
}
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { ExternalLink } from '@citric/icons'
|
|
3
|
-
import { IconButton } from '@citric/ui'
|
|
1
|
+
import { FallbackBoundary, IconLink, Text } from '@stack-spot/citric-react'
|
|
4
2
|
import { useKeyboardControls } from '@stack-spot/portal-components'
|
|
5
3
|
import { AgentVisibilityLevel } from '@stack-spot/portal-network'
|
|
6
4
|
import { Dictionary, interpolate, useTranslate } from '@stack-spot/portal-translate'
|
|
@@ -9,7 +7,6 @@ import { useCurrentChatState, useWidgetState } from '../../context/hooks'
|
|
|
9
7
|
import { getUrlToStackSpotAI } from '../../utils/url'
|
|
10
8
|
import { ButtonFavorite } from '../ButtonFavorite'
|
|
11
9
|
import { Fading } from '../Fading'
|
|
12
|
-
import { FallbackBoundary } from '../FallbackBoundary'
|
|
13
10
|
import { SelectorBox } from './styled'
|
|
14
11
|
|
|
15
12
|
type SectionVisibility = AgentVisibilityLevel
|
|
@@ -100,10 +97,17 @@ const ListItem = <T extends Item>({ item, selectorConfig, onSelect, favorite }:
|
|
|
100
97
|
>
|
|
101
98
|
{renderComponentItem(item)}
|
|
102
99
|
</button>
|
|
103
|
-
<
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
100
|
+
<IconLink
|
|
101
|
+
icon="ExternalLink"
|
|
102
|
+
title={linkTitle}
|
|
103
|
+
aria-label={linkTitle}
|
|
104
|
+
href={`${getUrlToStackSpotAI()}${urlBuilder(item)}`}
|
|
105
|
+
target="_blank"
|
|
106
|
+
/>
|
|
107
|
+
<ButtonFavorite
|
|
108
|
+
appearance="text"
|
|
109
|
+
favorite={{ ...favorite, idOrSlug: favorite?.favoriteIsSlug ? item.slug : item?.id, listFavorites }}
|
|
110
|
+
/>
|
|
107
111
|
</li>
|
|
108
112
|
)
|
|
109
113
|
}
|
|
@@ -128,9 +132,9 @@ const List = <T extends Item>({ selectorConfig, filter, visibility, onSelect, fa
|
|
|
128
132
|
}, [filter, items, visibility, favorites])
|
|
129
133
|
|
|
130
134
|
|
|
131
|
-
if (!items.length) return <Text className="empty"
|
|
135
|
+
if (!items.length) return <Text className="empty" color="light.700">{interpolate(t.noData, selectorConfig.resourceName)}</Text>
|
|
132
136
|
if (!filtered?.length)
|
|
133
|
-
<Text className="empty"
|
|
137
|
+
<Text className="empty" color="light.700">{interpolate(t.noResults, selectorConfig.resourceName)}</Text>
|
|
134
138
|
|
|
135
139
|
return (
|
|
136
140
|
<ul className="selector-list">
|
|
@@ -180,8 +184,8 @@ const SelectorContent = ({ filter, onClose, selectorConfig, favorite }: ContentP
|
|
|
180
184
|
return (
|
|
181
185
|
<div ref={ref}>
|
|
182
186
|
<header>
|
|
183
|
-
|
|
184
|
-
<Text
|
|
187
|
+
{icon}
|
|
188
|
+
<Text tag="h3">{resourceName}</Text>
|
|
185
189
|
</header>
|
|
186
190
|
<div className="body">
|
|
187
191
|
{isGroupResourcesByScope && (
|
|
@@ -190,7 +194,7 @@ const SelectorContent = ({ filter, onClose, selectorConfig, favorite }: ContentP
|
|
|
190
194
|
{sections.map(createSectionItem)}
|
|
191
195
|
</ul>
|
|
192
196
|
)}
|
|
193
|
-
<FallbackBoundary message={interpolate(t.error, selectorConfig.resourceName)}
|
|
197
|
+
<FallbackBoundary message={interpolate(t.error, selectorConfig.resourceName)}>
|
|
194
198
|
<List filter={filter} visibility={visibility} selectorConfig={selectorConfig} onSelect={onSelectItem} favorite={favorite} />
|
|
195
199
|
</FallbackBoundary>
|
|
196
200
|
</div>
|
|
@@ -40,13 +40,16 @@ export const SelectorBox = styled.div<{ $tabsCount: number }>`
|
|
|
40
40
|
flex-direction: row;
|
|
41
41
|
gap: 8px;
|
|
42
42
|
align-items: center;
|
|
43
|
-
padding: 8px;
|
|
43
|
+
padding: 0 8px;
|
|
44
44
|
margin-bottom: 4px;
|
|
45
|
-
font-family: 'San Francisco';
|
|
46
|
-
text-transform: uppercase;
|
|
47
|
-
font-weight: 500;
|
|
48
|
-
font-size: 11px;
|
|
49
45
|
background-color: ${theme.color.light[500]};
|
|
46
|
+
height: 40px;
|
|
47
|
+
h3 {
|
|
48
|
+
text-transform: uppercase;
|
|
49
|
+
font-weight: 500;
|
|
50
|
+
font-size: 12px;
|
|
51
|
+
margin: 0;
|
|
52
|
+
}
|
|
50
53
|
}
|
|
51
54
|
|
|
52
55
|
.body {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Text } from '@stack-spot/citric-react'
|
|
2
2
|
import { theme } from '@stack-spot/portal-theme'
|
|
3
3
|
import { DetailedHTMLProps, HTMLAttributes } from 'react'
|
|
4
4
|
import { styled } from 'styled-components'
|
|
@@ -46,9 +46,9 @@ const Styled = styled.div`
|
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
48
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
49
|
+
.citric-icon {
|
|
50
|
+
margin: 1px;
|
|
51
|
+
font-size: 10px;
|
|
52
52
|
}
|
|
53
53
|
|
|
54
54
|
img, svg {
|
|
@@ -67,7 +67,7 @@ export const StackedBadge = ({ label, images, ...props }: Props) => (
|
|
|
67
67
|
<li key={key || i}>
|
|
68
68
|
{url
|
|
69
69
|
? <img alt={name} aria-label={name} title={name} src={url} />
|
|
70
|
-
: <
|
|
70
|
+
: <span aria-label={name} title={name}>{icon}</span>
|
|
71
71
|
}
|
|
72
72
|
</li>
|
|
73
73
|
),
|