@stack-spot/ai-chat-widget 0.1.0
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/dist/StackspotAIWidget.d.ts +13 -0
- package/dist/StackspotAIWidget.d.ts.map +1 -0
- package/dist/StackspotAIWidget.js +32 -0
- package/dist/StackspotAIWidget.js.map +1 -0
- package/dist/chat-interceptors/quick-commands.d.ts +4 -0
- package/dist/chat-interceptors/quick-commands.d.ts.map +1 -0
- package/dist/chat-interceptors/quick-commands.js +11 -0
- package/dist/chat-interceptors/quick-commands.js.map +1 -0
- package/dist/chat-interceptors/send-message.d.ts +4 -0
- package/dist/chat-interceptors/send-message.d.ts.map +1 -0
- package/dist/chat-interceptors/send-message.js +36 -0
- package/dist/chat-interceptors/send-message.js.map +1 -0
- package/dist/components/Accordion.d.ts +10 -0
- package/dist/components/Accordion.d.ts.map +1 -0
- package/dist/components/Accordion.js +46 -0
- package/dist/components/Accordion.js.map +1 -0
- package/dist/components/AdaptiveTextArea.d.ts +10 -0
- package/dist/components/AdaptiveTextArea.d.ts.map +1 -0
- package/dist/components/AdaptiveTextArea.js +28 -0
- package/dist/components/AdaptiveTextArea.js.map +1 -0
- package/dist/components/Code.d.ts +19 -0
- package/dist/components/Code.d.ts.map +1 -0
- package/dist/components/Code.js +112 -0
- package/dist/components/Code.js.map +1 -0
- package/dist/components/Editor.d.ts +9 -0
- package/dist/components/Editor.d.ts.map +1 -0
- package/dist/components/Editor.js +2 -0
- package/dist/components/Editor.js.map +1 -0
- package/dist/components/FadingOverflow.d.ts +12 -0
- package/dist/components/FadingOverflow.d.ts.map +1 -0
- package/dist/components/FadingOverflow.js +216 -0
- package/dist/components/FadingOverflow.js.map +1 -0
- package/dist/components/FallbackBoundary/ErrorBoundary.d.ts +30 -0
- package/dist/components/FallbackBoundary/ErrorBoundary.d.ts.map +1 -0
- package/dist/components/FallbackBoundary/ErrorBoundary.js +38 -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 +6 -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/HistoryList.d.ts +13 -0
- package/dist/components/HistoryList.d.ts.map +1 -0
- package/dist/components/HistoryList.js +4 -0
- package/dist/components/HistoryList.js.map +1 -0
- package/dist/components/IconInput.d.ts +7 -0
- package/dist/components/IconInput.d.ts.map +1 -0
- package/dist/components/IconInput.js +58 -0
- package/dist/components/IconInput.js.map +1 -0
- package/dist/components/Markdown.d.ts +9 -0
- package/dist/components/Markdown.d.ts.map +1 -0
- package/dist/components/Markdown.js +17 -0
- package/dist/components/Markdown.js.map +1 -0
- package/dist/components/OverlayMenu.d.ts +9 -0
- package/dist/components/OverlayMenu.d.ts.map +1 -0
- package/dist/components/OverlayMenu.js +2 -0
- package/dist/components/OverlayMenu.js.map +1 -0
- package/dist/components/ProgressBar.d.ts +11 -0
- package/dist/components/ProgressBar.d.ts.map +1 -0
- package/dist/components/ProgressBar.js +126 -0
- package/dist/components/ProgressBar.js.map +1 -0
- package/dist/components/QuickStartButton.d.ts +8 -0
- package/dist/components/QuickStartButton.d.ts.map +1 -0
- package/dist/components/QuickStartButton.js +40 -0
- package/dist/components/QuickStartButton.js.map +1 -0
- package/dist/components/RightPanelForm.d.ts +5 -0
- package/dist/components/RightPanelForm.d.ts.map +1 -0
- package/dist/components/RightPanelForm.js +45 -0
- package/dist/components/RightPanelForm.js.map +1 -0
- package/dist/components/RightPanelTabs.d.ts +10 -0
- package/dist/components/RightPanelTabs.d.ts.map +1 -0
- package/dist/components/RightPanelTabs.js +20 -0
- package/dist/components/RightPanelTabs.js.map +1 -0
- package/dist/components/TabManager.d.ts +34 -0
- package/dist/components/TabManager.d.ts.map +1 -0
- package/dist/components/TabManager.js +158 -0
- package/dist/components/TabManager.js.map +1 -0
- package/dist/components/Tooltip/Tooltip.d.ts +11 -0
- package/dist/components/Tooltip/Tooltip.d.ts.map +1 -0
- package/dist/components/Tooltip/Tooltip.js +9 -0
- package/dist/components/Tooltip/Tooltip.js.map +1 -0
- package/dist/components/Tooltip/TooltipAPI.d.ts +10 -0
- package/dist/components/Tooltip/TooltipAPI.d.ts.map +1 -0
- package/dist/components/Tooltip/TooltipAPI.js +48 -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 +23 -0
- package/dist/components/Tooltip/style.js.map +1 -0
- package/dist/components/Tooltip/types.d.ts +8 -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/form/DescribedCheckboxGroup.d.ts +3 -0
- package/dist/components/form/DescribedCheckboxGroup.d.ts.map +1 -0
- package/dist/components/form/DescribedCheckboxGroup.js +23 -0
- package/dist/components/form/DescribedCheckboxGroup.js.map +1 -0
- package/dist/components/form/DescribedRadioGroup.d.ts +3 -0
- package/dist/components/form/DescribedRadioGroup.d.ts.map +1 -0
- package/dist/components/form/DescribedRadioGroup.js +18 -0
- package/dist/components/form/DescribedRadioGroup.js.map +1 -0
- package/dist/components/form/styled.d.ts +2 -0
- package/dist/components/form/styled.d.ts.map +1 -0
- package/dist/components/form/styled.js +41 -0
- package/dist/components/form/styled.js.map +1 -0
- package/dist/components/form/types.d.ts +19 -0
- package/dist/components/form/types.d.ts.map +1 -0
- package/dist/components/form/types.js +2 -0
- package/dist/components/form/types.js.map +1 -0
- package/dist/context/AIWidgetProvider.d.ts +4 -0
- package/dist/context/AIWidgetProvider.d.ts.map +1 -0
- package/dist/context/AIWidgetProvider.js +4 -0
- package/dist/context/AIWidgetProvider.js.map +1 -0
- package/dist/context/hooks.d.ts +18 -0
- package/dist/context/hooks.d.ts.map +1 -0
- package/dist/context/hooks.js +82 -0
- package/dist/context/hooks.js.map +1 -0
- package/dist/features.d.ts +13 -0
- package/dist/features.d.ts.map +1 -0
- package/dist/features.js +6 -0
- package/dist/features.js.map +1 -0
- package/dist/hooks/chat-scroll.d.ts +7 -0
- package/dist/hooks/chat-scroll.d.ts.map +1 -0
- package/dist/hooks/chat-scroll.js +15 -0
- package/dist/hooks/chat-scroll.js.map +1 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +9 -0
- package/dist/index.js.map +1 -0
- package/dist/layout.css +119 -0
- package/dist/right-panel/DefaultPanel.d.ts +9 -0
- package/dist/right-panel/DefaultPanel.d.ts.map +1 -0
- package/dist/right-panel/DefaultPanel.js +46 -0
- package/dist/right-panel/DefaultPanel.js.map +1 -0
- package/dist/right-panel/RightPanel.d.ts +2 -0
- package/dist/right-panel/RightPanel.d.ts.map +1 -0
- package/dist/right-panel/RightPanel.js +6 -0
- package/dist/right-panel/RightPanel.js.map +1 -0
- package/dist/right-panel/RightPanelProvider.d.ts +13 -0
- package/dist/right-panel/RightPanelProvider.d.ts.map +1 -0
- package/dist/right-panel/RightPanelProvider.js +10 -0
- package/dist/right-panel/RightPanelProvider.js.map +1 -0
- package/dist/right-panel/hooks.d.ts +13 -0
- package/dist/right-panel/hooks.d.ts.map +1 -0
- package/dist/right-panel/hooks.js +39 -0
- package/dist/right-panel/hooks.js.map +1 -0
- package/dist/state/ChatEntry.d.ts +48 -0
- package/dist/state/ChatEntry.d.ts.map +1 -0
- package/dist/state/ChatEntry.js +55 -0
- package/dist/state/ChatEntry.js.map +1 -0
- package/dist/state/ChatState.d.ts +46 -0
- package/dist/state/ChatState.d.ts.map +1 -0
- package/dist/state/ChatState.js +53 -0
- package/dist/state/ChatState.js.map +1 -0
- package/dist/state/ChatTabsController.d.ts +17 -0
- package/dist/state/ChatTabsController.d.ts.map +1 -0
- package/dist/state/ChatTabsController.js +47 -0
- package/dist/state/ChatTabsController.js.map +1 -0
- package/dist/state/ObservableState.d.ts +10 -0
- package/dist/state/ObservableState.d.ts.map +1 -0
- package/dist/state/ObservableState.js +25 -0
- package/dist/state/ObservableState.js.map +1 -0
- package/dist/state/WidgetState.d.ts +19 -0
- package/dist/state/WidgetState.d.ts.map +1 -0
- package/dist/state/WidgetState.js +29 -0
- package/dist/state/WidgetState.js.map +1 -0
- package/dist/types.d.ts +17 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/dist/utils/chat.d.ts +6 -0
- package/dist/utils/chat.d.ts.map +1 -0
- package/dist/utils/chat.js +26 -0
- package/dist/utils/chat.js.map +1 -0
- package/dist/utils/date.d.ts +6 -0
- package/dist/utils/date.d.ts.map +1 -0
- package/dist/utils/date.js +38 -0
- package/dist/utils/date.js.map +1 -0
- package/dist/views/Agents.d.ts +2 -0
- package/dist/views/Agents.d.ts.map +1 -0
- package/dist/views/Agents.js +2 -0
- package/dist/views/Agents.js.map +1 -0
- package/dist/views/Chat/AgentInfo.d.ts +6 -0
- package/dist/views/Chat/AgentInfo.d.ts.map +1 -0
- package/dist/views/Chat/AgentInfo.js +7 -0
- package/dist/views/Chat/AgentInfo.js.map +1 -0
- package/dist/views/Chat/ChatMessage.d.ts +6 -0
- package/dist/views/Chat/ChatMessage.d.ts.map +1 -0
- package/dist/views/Chat/ChatMessage.js +61 -0
- package/dist/views/Chat/ChatMessage.js.map +1 -0
- package/dist/views/Chat/ChatMessages.d.ts +7 -0
- package/dist/views/Chat/ChatMessages.d.ts.map +1 -0
- package/dist/views/Chat/ChatMessages.js +12 -0
- package/dist/views/Chat/ChatMessages.js.map +1 -0
- package/dist/views/Chat/index.d.ts +6 -0
- package/dist/views/Chat/index.d.ts.map +1 -0
- package/dist/views/Chat/index.js +8 -0
- package/dist/views/Chat/index.js.map +1 -0
- package/dist/views/Chat/styled.d.ts +2 -0
- package/dist/views/Chat/styled.d.ts.map +1 -0
- package/dist/views/Chat/styled.js +116 -0
- package/dist/views/Chat/styled.js.map +1 -0
- package/dist/views/ChatTabSelection.d.ts +8 -0
- package/dist/views/ChatTabSelection.d.ts.map +1 -0
- package/dist/views/ChatTabSelection.js +45 -0
- package/dist/views/ChatTabSelection.js.map +1 -0
- package/dist/views/Editor.d.ts +2 -0
- package/dist/views/Editor.d.ts.map +1 -0
- package/dist/views/Editor.js +2 -0
- package/dist/views/Editor.js.map +1 -0
- package/dist/views/Home.d.ts +6 -0
- package/dist/views/Home.d.ts.map +1 -0
- package/dist/views/Home.js +68 -0
- package/dist/views/Home.js.map +1 -0
- package/dist/views/KnowledgeSources.d.ts +2 -0
- package/dist/views/KnowledgeSources.d.ts.map +1 -0
- package/dist/views/KnowledgeSources.js +82 -0
- package/dist/views/KnowledgeSources.js.map +1 -0
- package/dist/views/MessageInput/ButtonGroup.d.ts +12 -0
- package/dist/views/MessageInput/ButtonGroup.d.ts.map +1 -0
- package/dist/views/MessageInput/ButtonGroup.js +22 -0
- package/dist/views/MessageInput/ButtonGroup.js.map +1 -0
- package/dist/views/MessageInput/InfoBar.d.ts +2 -0
- package/dist/views/MessageInput/InfoBar.d.ts.map +1 -0
- package/dist/views/MessageInput/InfoBar.js +28 -0
- package/dist/views/MessageInput/InfoBar.js.map +1 -0
- package/dist/views/MessageInput/dictionary.d.ts +2 -0
- package/dist/views/MessageInput/dictionary.d.ts.map +1 -0
- package/dist/views/MessageInput/dictionary.js +35 -0
- package/dist/views/MessageInput/dictionary.js.map +1 -0
- package/dist/views/MessageInput/index.d.ts +7 -0
- package/dist/views/MessageInput/index.d.ts.map +1 -0
- package/dist/views/MessageInput/index.js +43 -0
- package/dist/views/MessageInput/index.js.map +1 -0
- package/dist/views/MessageInput/styled.d.ts +2 -0
- package/dist/views/MessageInput/styled.d.ts.map +1 -0
- package/dist/views/MessageInput/styled.js +195 -0
- package/dist/views/MessageInput/styled.js.map +1 -0
- package/dist/views/MinimizedHeader.d.ts +3 -0
- package/dist/views/MinimizedHeader.d.ts.map +1 -0
- package/dist/views/MinimizedHeader.js +76 -0
- package/dist/views/MinimizedHeader.js.map +1 -0
- package/dist/views/Stacks.d.ts +2 -0
- package/dist/views/Stacks.d.ts.map +1 -0
- package/dist/views/Stacks.js +73 -0
- package/dist/views/Stacks.js.map +1 -0
- package/dist/views/Workspaces.d.ts +2 -0
- package/dist/views/Workspaces.d.ts.map +1 -0
- package/dist/views/Workspaces.js +59 -0
- package/dist/views/Workspaces.js.map +1 -0
- package/package.json +52 -0
- package/src/StackspotAIWidget.tsx +65 -0
- package/src/chat-interceptors/quick-commands.ts +12 -0
- package/src/chat-interceptors/send-message.ts +35 -0
- package/src/components/Accordion.tsx +64 -0
- package/src/components/AdaptiveTextArea.tsx +34 -0
- package/src/components/Code.tsx +201 -0
- package/src/components/Editor.tsx +12 -0
- package/src/components/FadingOverflow.tsx +234 -0
- package/src/components/FallbackBoundary/ErrorBoundary.tsx +48 -0
- package/src/components/FallbackBoundary/Loading.tsx +14 -0
- package/src/components/FallbackBoundary/index.tsx +15 -0
- package/src/components/HistoryList.tsx +16 -0
- package/src/components/IconInput.tsx +70 -0
- package/src/components/Markdown.tsx +53 -0
- package/src/components/OverlayMenu.tsx +10 -0
- package/src/components/ProgressBar.tsx +153 -0
- package/src/components/QuickStartButton.tsx +51 -0
- package/src/components/RightPanelForm.tsx +55 -0
- package/src/components/RightPanelTabs.tsx +39 -0
- package/src/components/TabManager.tsx +223 -0
- package/src/components/Tooltip/Tooltip.tsx +30 -0
- package/src/components/Tooltip/TooltipAPI.ts +46 -0
- package/src/components/Tooltip/context.tsx +24 -0
- package/src/components/Tooltip/index.ts +2 -0
- package/src/components/Tooltip/style.tsx +25 -0
- package/src/components/Tooltip/types.ts +8 -0
- package/src/components/form/DescribedCheckboxGroup.tsx +39 -0
- package/src/components/form/DescribedRadioGroup.tsx +33 -0
- package/src/components/form/styled.ts +41 -0
- package/src/components/form/types.ts +21 -0
- package/src/context/AIWidgetProvider.tsx +6 -0
- package/src/context/hooks.ts +93 -0
- package/src/features.ts +18 -0
- package/src/hooks/chat-scroll.ts +14 -0
- package/src/index.ts +8 -0
- package/src/layout.css +119 -0
- package/src/right-panel/DefaultPanel.tsx +67 -0
- package/src/right-panel/RightPanel.tsx +6 -0
- package/src/right-panel/RightPanelProvider.tsx +20 -0
- package/src/right-panel/hooks.tsx +47 -0
- package/src/state/ChatEntry.ts +95 -0
- package/src/state/ChatState.ts +85 -0
- package/src/state/ChatTabsController.ts +55 -0
- package/src/state/ObservableState.ts +35 -0
- package/src/state/WidgetState.ts +42 -0
- package/src/types.ts +20 -0
- package/src/utils/chat.ts +30 -0
- package/src/utils/date.ts +40 -0
- package/src/views/Agents.tsx +1 -0
- package/src/views/Chat/AgentInfo.tsx +17 -0
- package/src/views/Chat/ChatMessage.tsx +89 -0
- package/src/views/Chat/ChatMessages.tsx +16 -0
- package/src/views/Chat/index.tsx +11 -0
- package/src/views/Chat/styled.ts +116 -0
- package/src/views/ChatTabSelection.tsx +65 -0
- package/src/views/Editor.tsx +1 -0
- package/src/views/Home.tsx +109 -0
- package/src/views/KnowledgeSources.tsx +115 -0
- package/src/views/MessageInput/ButtonGroup.tsx +84 -0
- package/src/views/MessageInput/InfoBar.tsx +69 -0
- package/src/views/MessageInput/dictionary.ts +36 -0
- package/src/views/MessageInput/index.tsx +79 -0
- package/src/views/MessageInput/styled.ts +196 -0
- package/src/views/MinimizedHeader.tsx +94 -0
- package/src/views/Stacks.tsx +104 -0
- package/src/views/Workspaces.tsx +88 -0
- package/tsconfig.json +22 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Tooltip/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAA;AAC3C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare const animationTimeMS = 300;
|
|
2
|
+
export declare const TooltipBox: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
3
|
+
export declare const DefaultTooltip: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
4
|
+
//# sourceMappingURL=style.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"style.d.ts","sourceRoot":"","sources":["../../../src/components/Tooltip/style.tsx"],"names":[],"mappings":"AAGA,eAAO,MAAM,eAAe,MAAM,CAAA;AAElC,eAAO,MAAM,UAAU,wOAWtB,CAAA;AAED,eAAO,MAAM,cAAc,wOAM1B,CAAA"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { theme } from '@stack-spot/portal-theme';
|
|
2
|
+
import { styled } from 'styled-components';
|
|
3
|
+
export const animationTimeMS = 300;
|
|
4
|
+
export const TooltipBox = styled.div `
|
|
5
|
+
position: absolute;
|
|
6
|
+
pointer-events: none;
|
|
7
|
+
opacity: 0;
|
|
8
|
+
transition: opacity ${animationTimeMS / 1000}s;
|
|
9
|
+
top: 0;
|
|
10
|
+
left: 0;
|
|
11
|
+
|
|
12
|
+
&.visible {
|
|
13
|
+
opacity: 1;
|
|
14
|
+
}
|
|
15
|
+
`;
|
|
16
|
+
export const DefaultTooltip = styled.div `
|
|
17
|
+
padding: 4px 8px;
|
|
18
|
+
background-color: ${theme.color.inverse[500]};
|
|
19
|
+
color: ${theme.color.inverse.contrastText};
|
|
20
|
+
border-radius: 6px;
|
|
21
|
+
margin: 6px;
|
|
22
|
+
`;
|
|
23
|
+
//# sourceMappingURL=style.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"style.js","sourceRoot":"","sources":["../../../src/components/Tooltip/style.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAA;AAChD,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAA;AAE1C,MAAM,CAAC,MAAM,eAAe,GAAG,GAAG,CAAA;AAElC,MAAM,CAAC,MAAM,UAAU,GAAG,MAAM,CAAC,GAAG,CAAA;;;;wBAIZ,eAAe,GAAE,IAAI;;;;;;;CAO5C,CAAA;AAED,MAAM,CAAC,MAAM,cAAc,GAAG,MAAM,CAAC,GAAG,CAAA;;sBAElB,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC;WACnC,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,YAAY;;;CAG1C,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/Tooltip/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,eAAe,GAAG,MAAM,GAAG,OAAO,GAAG,KAAK,GAAG,QAAQ,CAAA;AAEjE,MAAM,WAAW,WAAW;IAC1B,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;CACZ"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/components/Tooltip/types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { CheckProps } from './types.js';
|
|
2
|
+
export declare function DescribedCheckboxGroup<T>({ keygen, onChange, options, renderDescription, renderLabel, optionClassName, optionStyle, value, className, style }: CheckProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
//# sourceMappingURL=DescribedCheckboxGroup.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DescribedCheckboxGroup.d.ts","sourceRoot":"","sources":["../../../src/components/form/DescribedCheckboxGroup.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AAEpC,wBAAgB,sBAAsB,CAAC,CAAC,EACtC,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,eAAe,EAAE,WAAW,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,EAAE,UAAU,CAAC,CAAC,CAAC,2CA8BpI"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Checkbox, Text } from '@citric/core';
|
|
3
|
+
import { listToClass } from '@stack-spot/portal-theme';
|
|
4
|
+
import { useMemo } from 'react';
|
|
5
|
+
import { Accordion } from '../Accordion.js';
|
|
6
|
+
import { RadioCheckBox } from './styled.js';
|
|
7
|
+
export function DescribedCheckboxGroup({ keygen, onChange, options, renderDescription, renderLabel, optionClassName, optionStyle, value, className, style }) {
|
|
8
|
+
const items = useMemo(() => options.map((option) => {
|
|
9
|
+
const label = renderLabel(option);
|
|
10
|
+
const description = renderDescription(option);
|
|
11
|
+
const header = (_jsxs("label", { children: [_jsx(Checkbox, { checked: value.includes(option), onChange: (e) => {
|
|
12
|
+
if (e.target.checked && !value.includes(option))
|
|
13
|
+
onChange([...value, option]);
|
|
14
|
+
else
|
|
15
|
+
onChange(value.filter(item => item !== option));
|
|
16
|
+
} }), typeof label === 'string' ? _jsx(Text, { children: label }) : label] }));
|
|
17
|
+
return (_jsx("li", { className: listToClass(['radio-group-item', optionClassName?.(option)]), style: optionStyle?.(option), children: _jsx(Accordion, { header: header, children: typeof description === 'string'
|
|
18
|
+
? _jsx(Text, { appearance: "microtext1", colorScheme: "light.700", children: description })
|
|
19
|
+
: description }) }, keygen(option)));
|
|
20
|
+
}), [options, value]);
|
|
21
|
+
return _jsx(RadioCheckBox, { style: style, className: className, children: items });
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=DescribedCheckboxGroup.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DescribedCheckboxGroup.js","sourceRoot":"","sources":["../../../src/components/form/DescribedCheckboxGroup.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AAC7C,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAA;AACtD,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAA;AAC/B,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AACxC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AAGxC,MAAM,UAAU,sBAAsB,CACpC,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,eAAe,EAAE,WAAW,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAiB;IAEnI,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE;QACjD,MAAM,KAAK,GAAG,WAAW,CAAC,MAAM,CAAC,CAAA;QACjC,MAAM,WAAW,GAAG,iBAAiB,CAAC,MAAM,CAAC,CAAA;QAC7C,MAAM,MAAM,GAAG,CACb,4BACE,KAAC,QAAQ,IACP,OAAO,EAAE,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,EAC/B,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE;wBACd,IAAI,CAAC,CAAC,MAAM,CAAC,OAAO,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC;4BAAE,QAAQ,CAAC,CAAC,GAAG,KAAK,EAAE,MAAM,CAAC,CAAC,CAAA;;4BACxE,QAAQ,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,KAAK,MAAM,CAAC,CAAC,CAAA;oBACtD,CAAC,GACD,EACD,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAC,IAAI,cAAE,KAAK,GAAQ,CAAC,CAAC,CAAC,KAAK,IACnD,CACT,CAAA;QACD,OAAO,CACL,aAAyB,SAAS,EAAE,WAAW,CAAC,CAAC,kBAAkB,EAAE,eAAe,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,WAAW,EAAE,CAAC,MAAM,CAAC,YAC5H,KAAC,SAAS,IAAC,MAAM,EAAE,MAAM,YACtB,OAAO,WAAW,KAAK,QAAQ;oBAC9B,CAAC,CAAC,KAAC,IAAI,IAAC,UAAU,EAAC,YAAY,EAAC,WAAW,EAAC,WAAW,YAAE,WAAW,GAAQ;oBAC5E,CAAC,CAAC,WAAkB,GAEZ,IANL,MAAM,CAAC,MAAM,CAAC,CAOlB,CACN,CAAA;IACH,CAAC,CAAC,EAAE,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC,CAAA;IAErB,OAAO,KAAC,aAAa,IAAC,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,SAAS,YAAG,KAAK,GAAiB,CAAA;AACnF,CAAC"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { RadioProps } from './types.js';
|
|
2
|
+
export declare function DescribedRadioGroup<T>({ keygen, onChange, options, renderDescription, renderLabel, optionClassName, optionStyle, value, className, style }: RadioProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
//# sourceMappingURL=DescribedRadioGroup.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DescribedRadioGroup.d.ts","sourceRoot":"","sources":["../../../src/components/form/DescribedRadioGroup.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AAEpC,wBAAgB,mBAAmB,CAAC,CAAC,EACnC,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,eAAe,EAAE,WAAW,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,EAAE,UAAU,CAAC,CAAC,CAAC,2CAwBpI"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Radio, Text } from '@citric/core';
|
|
3
|
+
import { listToClass } from '@stack-spot/portal-theme';
|
|
4
|
+
import { useMemo } from 'react';
|
|
5
|
+
import { Accordion } from '../Accordion.js';
|
|
6
|
+
import { RadioCheckBox } from './styled.js';
|
|
7
|
+
export function DescribedRadioGroup({ keygen, onChange, options, renderDescription, renderLabel, optionClassName, optionStyle, value, className, style }) {
|
|
8
|
+
const items = useMemo(() => options.map((option) => {
|
|
9
|
+
const label = renderLabel(option);
|
|
10
|
+
const description = renderDescription(option);
|
|
11
|
+
const header = (_jsxs("label", { children: [_jsx(Radio, { checked: option === value, onChange: () => onChange(option) }), typeof label === 'string' ? _jsx(Text, { children: label }) : label] }));
|
|
12
|
+
return (_jsx("li", { className: listToClass(['radio-group-item', optionClassName?.(option)]), style: optionStyle?.(option), children: _jsx(Accordion, { header: header, children: typeof description === 'string'
|
|
13
|
+
? _jsx(Text, { appearance: "microtext1", colorScheme: "light.700", children: description })
|
|
14
|
+
: description }) }, keygen(option)));
|
|
15
|
+
}), [options, value]);
|
|
16
|
+
return _jsx(RadioCheckBox, { style: style, className: className, children: items });
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=DescribedRadioGroup.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DescribedRadioGroup.js","sourceRoot":"","sources":["../../../src/components/form/DescribedRadioGroup.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAA;AACtD,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAA;AAC/B,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AACxC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AAGxC,MAAM,UAAU,mBAAmB,CACjC,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,eAAe,EAAE,WAAW,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAiB;IAEnI,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE;QACjD,MAAM,KAAK,GAAG,WAAW,CAAC,MAAM,CAAC,CAAA;QACjC,MAAM,WAAW,GAAG,iBAAiB,CAAC,MAAM,CAAC,CAAA;QAC7C,MAAM,MAAM,GAAG,CACb,4BACE,KAAC,KAAK,IAAC,OAAO,EAAE,MAAM,KAAK,KAAK,EAAE,QAAQ,EAAE,GAAG,EAAE,CAAC,QAAQ,CAAC,MAAM,CAAC,GAAI,EACrE,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAC,IAAI,cAAE,KAAK,GAAQ,CAAC,CAAC,CAAC,KAAK,IACnD,CACT,CAAA;QACD,OAAO,CACL,aAAyB,SAAS,EAAE,WAAW,CAAC,CAAC,kBAAkB,EAAE,eAAe,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,WAAW,EAAE,CAAC,MAAM,CAAC,YAC5H,KAAC,SAAS,IAAC,MAAM,EAAE,MAAM,YACtB,OAAO,WAAW,KAAK,QAAQ;oBAC9B,CAAC,CAAC,KAAC,IAAI,IAAC,UAAU,EAAC,YAAY,EAAC,WAAW,EAAC,WAAW,YAAE,WAAW,GAAQ;oBAC5E,CAAC,CAAC,WAAkB,GAEZ,IANL,MAAM,CAAC,MAAM,CAAC,CAOlB,CACN,CAAA;IACH,CAAC,CAAC,EAAE,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC,CAAA;IAErB,OAAO,KAAC,aAAa,IAAC,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,SAAS,YAAG,KAAK,GAAiB,CAAA;AACnF,CAAC"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export declare const RadioCheckBox: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLUListElement>, HTMLUListElement>, never>> & string;
|
|
2
|
+
//# sourceMappingURL=styled.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"styled.d.ts","sourceRoot":"","sources":["../../../src/components/form/styled.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,aAAa,4OAqCzB,CAAA"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { theme } from '@stack-spot/portal-theme';
|
|
2
|
+
import { styled } from 'styled-components';
|
|
3
|
+
export const RadioCheckBox = styled.ul `
|
|
4
|
+
margin: 0;
|
|
5
|
+
padding: 0;
|
|
6
|
+
list-style: none;
|
|
7
|
+
display: flex;
|
|
8
|
+
flex-direction: column;
|
|
9
|
+
gap: 6px;
|
|
10
|
+
|
|
11
|
+
li {
|
|
12
|
+
display: flex;
|
|
13
|
+
flex-direction: column;
|
|
14
|
+
gap: 8px;
|
|
15
|
+
border-radius: 6px;
|
|
16
|
+
background-color: ${theme.color.light[400]};
|
|
17
|
+
|
|
18
|
+
label {
|
|
19
|
+
display: flex;
|
|
20
|
+
flex-direction: row;
|
|
21
|
+
align-items: center;
|
|
22
|
+
gap: 8px;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
input[type="radio"], input[type="checkbox"] {
|
|
26
|
+
border-color: ${theme.color.light[700]};
|
|
27
|
+
background-color: transparent;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
input[type="checkbox"]:checked {
|
|
31
|
+
background-color: ${theme.color.inverse[500]};
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
input[type="radio"] {
|
|
35
|
+
&:after {
|
|
36
|
+
background-color: ${theme.color.light[700]};
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
`;
|
|
41
|
+
//# sourceMappingURL=styled.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"styled.js","sourceRoot":"","sources":["../../../src/components/form/styled.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAA;AAChD,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAA;AAE1C,MAAM,CAAC,MAAM,aAAa,GAAG,MAAM,CAAC,EAAE,CAAA;;;;;;;;;;;;;wBAad,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC;;;;;;;;;;sBAUxB,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC;;;;;0BAKlB,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC;;;;;4BAKtB,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC;;;;CAIjD,CAAA"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { WithStyle } from '@stack-spot/portal-theme';
|
|
2
|
+
interface RadioCheckProps<T> extends WithStyle {
|
|
3
|
+
options: T[];
|
|
4
|
+
renderLabel: (option: T) => React.ReactNode;
|
|
5
|
+
renderDescription: (option: T) => React.ReactNode;
|
|
6
|
+
optionClassName?: (option: T) => string | undefined;
|
|
7
|
+
optionStyle?: (option: T) => React.CSSProperties | undefined;
|
|
8
|
+
keygen: (option: T) => React.Key;
|
|
9
|
+
}
|
|
10
|
+
export interface RadioProps<T> extends RadioCheckProps<T> {
|
|
11
|
+
value: T | undefined;
|
|
12
|
+
onChange: (option: T) => void;
|
|
13
|
+
}
|
|
14
|
+
export interface CheckProps<T> extends RadioCheckProps<T> {
|
|
15
|
+
value: T[];
|
|
16
|
+
onChange: (option: T[]) => void;
|
|
17
|
+
}
|
|
18
|
+
export {};
|
|
19
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/form/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAA;AAEpD,UAAU,eAAe,CAAC,CAAC,CAAE,SAAQ,SAAS;IAC5C,OAAO,EAAE,CAAC,EAAE,CAAC;IACb,WAAW,EAAE,CAAC,MAAM,EAAE,CAAC,KAAK,KAAK,CAAC,SAAS,CAAC;IAC5C,iBAAiB,EAAE,CAAC,MAAM,EAAE,CAAC,KAAK,KAAK,CAAC,SAAS,CAAC;IAClD,eAAe,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,KAAK,MAAM,GAAG,SAAS,CAAC;IACpD,WAAW,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,KAAK,KAAK,CAAC,aAAa,GAAG,SAAS,CAAC;IAC7D,MAAM,EAAE,CAAC,MAAM,EAAE,CAAC,KAAK,KAAK,CAAC,GAAG,CAAC;CAElC;AAED,MAAM,WAAW,UAAU,CAAC,CAAC,CAAE,SAAQ,eAAe,CAAC,CAAC,CAAC;IACvD,KAAK,EAAE,CAAC,GAAG,SAAS,CAAC;IACrB,QAAQ,EAAE,CAAC,MAAM,EAAE,CAAC,KAAK,IAAI,CAAC;CAC/B;AAED,MAAM,WAAW,UAAU,CAAC,CAAC,CAAE,SAAQ,eAAe,CAAC,CAAC,CAAC;IACvD,KAAK,EAAE,CAAC,EAAE,CAAC;IACX,QAAQ,EAAE,CAAC,MAAM,EAAE,CAAC,EAAE,KAAK,IAAI,CAAC;CACjC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/components/form/types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { WidgetState } from '../state/WidgetState.js';
|
|
2
|
+
export declare const AIWidgetContext: import("react").Context<WidgetState | undefined>;
|
|
3
|
+
export declare const AIWidgetProvider: import("react").Provider<WidgetState | undefined>;
|
|
4
|
+
//# sourceMappingURL=AIWidgetProvider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AIWidgetProvider.d.ts","sourceRoot":"","sources":["../../src/context/AIWidgetProvider.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAA;AAElD,eAAO,MAAM,eAAe,kDAAoD,CAAA;AAEhF,eAAO,MAAM,gBAAgB,mDAA2B,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AIWidgetProvider.js","sourceRoot":"","sources":["../../src/context/AIWidgetProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAA;AAGrC,MAAM,CAAC,MAAM,eAAe,GAAG,aAAa,CAA0B,SAAS,CAAC,CAAA;AAEhF,MAAM,CAAC,MAAM,gBAAgB,GAAG,eAAe,CAAC,QAAQ,CAAA"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ChatEntry } from '../state/ChatEntry.js';
|
|
2
|
+
import { ChatProperties, ChatState, MessageInterceptor } from '../state/ChatState.js';
|
|
3
|
+
import { WidgetProperties, WidgetState } from '../state/WidgetState.js';
|
|
4
|
+
export declare function useWidget(): WidgetState;
|
|
5
|
+
export declare function useWidgetState<K extends keyof WidgetProperties>(key: K): WidgetProperties[K];
|
|
6
|
+
export declare function useChatTabs(): {
|
|
7
|
+
chats: ChatState[];
|
|
8
|
+
active: string;
|
|
9
|
+
};
|
|
10
|
+
export declare function useChat(chatId: string): ChatState;
|
|
11
|
+
export declare function useCurrentChat(): ChatState;
|
|
12
|
+
export declare function useChatState<K extends keyof ChatProperties>(chatId: string, key: K): ChatProperties[K];
|
|
13
|
+
export declare function useCurrentChatState<K extends keyof ChatProperties>(key: K): ChatProperties[K];
|
|
14
|
+
export declare function useChatMessages(chatId: string): ChatEntry[];
|
|
15
|
+
export declare function useCurrentChatMessages(): ChatEntry[];
|
|
16
|
+
export declare function useChatEntry(entry: ChatEntry): import("../state/ChatEntry.js").TextChatEntry;
|
|
17
|
+
export declare function useFirstChat(interceptors: MessageInterceptor[]): void;
|
|
18
|
+
//# sourceMappingURL=hooks.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../../src/context/hooks.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAA;AAC9C,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAA;AAElF,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAA;AAMpE,wBAAgB,SAAS,IAAI,WAAW,CAKvC;AAWD,wBAAgB,cAAc,CAAC,CAAC,SAAS,MAAM,gBAAgB,EAAE,GAAG,EAAE,CAAC,GAAG,gBAAgB,CAAC,CAAC,CAAC,CAG5F;AAED,wBAAgB,WAAW,IAAI;IAAE,KAAK,EAAE,SAAS,EAAE,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAQpE;AAED,wBAAgB,OAAO,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAKjD;AAED,wBAAgB,cAAc,IAAI,SAAS,CAG1C;AAED,wBAAgB,YAAY,CAAC,CAAC,SAAS,MAAM,cAAc,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,GAAG,cAAc,CAAC,CAAC,CAAC,CAGtG;AAED,wBAAgB,mBAAmB,CAAC,CAAC,SAAS,MAAM,cAAc,EAAE,GAAG,EAAE,CAAC,GAAG,cAAc,CAAC,CAAC,CAAC,CAG7F;AAED,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,EAAE,CAQ3D;AAED,wBAAgB,sBAAsB,IAAI,SAAS,EAAE,CAGpD;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,SAAS,8CAO5C;AAED,wBAAgB,YAAY,CAAC,YAAY,EAAE,kBAAkB,EAAE,QAI9D"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
/* eslint-disable react-hooks/rules-of-hooks */
|
|
2
|
+
import { useContext, useEffect, useMemo, useState } from 'react';
|
|
3
|
+
import { WidgetState } from '../state/WidgetState.js';
|
|
4
|
+
import { createNewChat } from '../utils/chat.js';
|
|
5
|
+
import { AIWidgetContext } from './AIWidgetProvider.js';
|
|
6
|
+
let globalWidgetState;
|
|
7
|
+
export function useWidget() {
|
|
8
|
+
const fromContext = useContext(AIWidgetContext);
|
|
9
|
+
if (fromContext)
|
|
10
|
+
return fromContext;
|
|
11
|
+
globalWidgetState ??= new WidgetState();
|
|
12
|
+
return globalWidgetState;
|
|
13
|
+
}
|
|
14
|
+
function useObservableState(state, key) {
|
|
15
|
+
const [value, setValue] = useState(state.get(key));
|
|
16
|
+
useEffect(() => {
|
|
17
|
+
setValue(state.get(key));
|
|
18
|
+
return state.onChange(key, setValue);
|
|
19
|
+
}, [state]);
|
|
20
|
+
return value;
|
|
21
|
+
}
|
|
22
|
+
export function useWidgetState(key) {
|
|
23
|
+
const widget = useWidget();
|
|
24
|
+
return useObservableState(widget, key);
|
|
25
|
+
}
|
|
26
|
+
export function useChatTabs() {
|
|
27
|
+
const widget = useWidget();
|
|
28
|
+
const [tabs, setTabs] = useState({
|
|
29
|
+
chats: widget.chatTabs.getAll(),
|
|
30
|
+
active: widget.chatTabs.getActiveChatId(),
|
|
31
|
+
});
|
|
32
|
+
useEffect(() => widget.chatTabs.onChange((chats, active) => setTabs({ chats, active })), []);
|
|
33
|
+
return tabs;
|
|
34
|
+
}
|
|
35
|
+
export function useChat(chatId) {
|
|
36
|
+
const widget = useWidget();
|
|
37
|
+
const chat = widget.chatTabs.get(chatId);
|
|
38
|
+
if (!chat)
|
|
39
|
+
throw new Error(`No chat with id ${chatId} was found. Maybe there are no chats opened, try to call useFirstChat first.`);
|
|
40
|
+
return chat;
|
|
41
|
+
}
|
|
42
|
+
export function useCurrentChat() {
|
|
43
|
+
const { active } = useChatTabs();
|
|
44
|
+
return useChat(active);
|
|
45
|
+
}
|
|
46
|
+
export function useChatState(chatId, key) {
|
|
47
|
+
const chat = useChat(chatId);
|
|
48
|
+
return useObservableState(chat, key);
|
|
49
|
+
}
|
|
50
|
+
export function useCurrentChatState(key) {
|
|
51
|
+
const chat = useCurrentChat();
|
|
52
|
+
return useObservableState(chat, key);
|
|
53
|
+
}
|
|
54
|
+
export function useChatMessages(chatId) {
|
|
55
|
+
const chat = useChat(chatId);
|
|
56
|
+
const [entries, setEntries] = useState(chat.getMessages());
|
|
57
|
+
useEffect(() => {
|
|
58
|
+
setEntries(chat.getMessages());
|
|
59
|
+
return chat.onChangeMessages(setEntries);
|
|
60
|
+
}, [chat]);
|
|
61
|
+
return entries;
|
|
62
|
+
}
|
|
63
|
+
export function useCurrentChatMessages() {
|
|
64
|
+
const { active } = useChatTabs();
|
|
65
|
+
return useChatMessages(active);
|
|
66
|
+
}
|
|
67
|
+
export function useChatEntry(entry) {
|
|
68
|
+
const immutable = useMemo(() => entry.hasFinished(), []);
|
|
69
|
+
// the following condition is not a problem for react hooks, it will always be true or always false.
|
|
70
|
+
if (immutable)
|
|
71
|
+
return entry.getValue();
|
|
72
|
+
const [content, setContent] = useState(entry.getValue());
|
|
73
|
+
useEffect(() => entry.onChange(setContent), []);
|
|
74
|
+
return content;
|
|
75
|
+
}
|
|
76
|
+
export function useFirstChat(interceptors) {
|
|
77
|
+
const widget = useWidget();
|
|
78
|
+
const tabs = widget.chatTabs;
|
|
79
|
+
if (!tabs.getAll().length)
|
|
80
|
+
createNewChat(widget, interceptors);
|
|
81
|
+
}
|
|
82
|
+
//# sourceMappingURL=hooks.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hooks.js","sourceRoot":"","sources":["../../src/context/hooks.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface MessageInputFeatures {
|
|
2
|
+
stack?: boolean;
|
|
3
|
+
workspace?: boolean;
|
|
4
|
+
knowledgeSource?: boolean;
|
|
5
|
+
agent?: boolean;
|
|
6
|
+
quickCommands?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export interface AIWidgetFeatures extends MessageInputFeatures {
|
|
9
|
+
editor?: boolean;
|
|
10
|
+
chatHistory?: boolean;
|
|
11
|
+
}
|
|
12
|
+
export declare const defaultFeatures: AIWidgetFeatures;
|
|
13
|
+
//# sourceMappingURL=features.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"features.d.ts","sourceRoot":"","sources":["../src/features.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,oBAAoB;IACnC,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAED,MAAM,WAAW,gBAAiB,SAAQ,oBAAoB;IAC5D,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,eAAO,MAAM,eAAe,EAAE,gBAI7B,CAAA"}
|
package/dist/features.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"features.js","sourceRoot":"","sources":["../src/features.ts"],"names":[],"mappings":"AAaA,MAAM,CAAC,MAAM,eAAe,GAAqB;IAC/C,KAAK,EAAE,IAAI;IACX,SAAS,EAAE,IAAI;IACf,eAAe,EAAE,IAAI;CACtB,CAAA"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Scrolls the closest chat (upwards in the tree) to its bottom.
|
|
3
|
+
* @param ref the reference element.
|
|
4
|
+
* @param deps when the deps changes, the chat is scrolled.
|
|
5
|
+
*/
|
|
6
|
+
export declare function useChatScrollToBottomEffect(ref: React.RefObject<HTMLElement>, deps: any[]): void;
|
|
7
|
+
//# sourceMappingURL=chat-scroll.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chat-scroll.d.ts","sourceRoot":"","sources":["../../src/hooks/chat-scroll.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,wBAAgB,2BAA2B,CAAC,GAAG,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,QAMzF"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { useEffect } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Scrolls the closest chat (upwards in the tree) to its bottom.
|
|
4
|
+
* @param ref the reference element.
|
|
5
|
+
* @param deps when the deps changes, the chat is scrolled.
|
|
6
|
+
*/
|
|
7
|
+
export function useChatScrollToBottomEffect(ref, deps) {
|
|
8
|
+
useEffect(() => {
|
|
9
|
+
const chat = ref.current?.closest('.chat-content');
|
|
10
|
+
if (!chat)
|
|
11
|
+
return;
|
|
12
|
+
chat.scrollTop = chat.scrollHeight;
|
|
13
|
+
}, deps);
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=chat-scroll.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chat-scroll.js","sourceRoot":"","sources":["../../src/hooks/chat-scroll.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAEjC;;;;GAIG;AACH,MAAM,UAAU,2BAA2B,CAAC,GAAiC,EAAE,IAAW;IACxF,SAAS,CAAC,GAAG,EAAE;QACb,MAAM,IAAI,GAAG,GAAG,CAAC,OAAO,EAAE,OAAO,CAAC,eAAe,CAAC,CAAA;QAClD,IAAI,CAAC,IAAI;YAAE,OAAM;QACjB,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,YAAY,CAAA;IACpC,CAAC,EAAE,IAAI,CAAC,CAAA;AACV,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export { AIWidgetProvider } from './context/AIWidgetProvider.js';
|
|
2
|
+
export * from './context/hooks.js';
|
|
3
|
+
export { StackspotAIWidget } from './StackspotAIWidget.js';
|
|
4
|
+
export { ChatEntry } from './state/ChatEntry.js';
|
|
5
|
+
export { ChatState } from './state/ChatState.js';
|
|
6
|
+
export { ChatTabsController } from './state/ChatTabsController.js';
|
|
7
|
+
export { ObservableState } from './state/ObservableState.js';
|
|
8
|
+
export { WidgetState } from './state/WidgetState.js';
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAA;AAC7D,cAAc,iBAAiB,CAAA;AAC/B,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AACvD,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAC7C,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAA;AAC/D,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAA;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export { AIWidgetProvider } from './context/AIWidgetProvider.js';
|
|
2
|
+
export * from './context/hooks.js';
|
|
3
|
+
export { StackspotAIWidget } from './StackspotAIWidget.js';
|
|
4
|
+
export { ChatEntry } from './state/ChatEntry.js';
|
|
5
|
+
export { ChatState } from './state/ChatState.js';
|
|
6
|
+
export { ChatTabsController } from './state/ChatTabsController.js';
|
|
7
|
+
export { ObservableState } from './state/ObservableState.js';
|
|
8
|
+
export { WidgetState } from './state/WidgetState.js';
|
|
9
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAA;AAC7D,cAAc,iBAAiB,CAAA;AAC/B,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AACvD,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAC7C,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAA;AAC/D,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAA;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA"}
|
package/dist/layout.css
ADDED
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
@font-face {
|
|
2
|
+
font-family: "San Francisco";
|
|
3
|
+
font-weight: 400;
|
|
4
|
+
src: url("https://applesocial.s3.amazonaws.com/assets/styles/fonts/sanfrancisco/sanfranciscodisplay-regular-webfont.woff");
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
/* Scroll bars */
|
|
8
|
+
|
|
9
|
+
::-webkit-scrollbar-track {
|
|
10
|
+
background-color: transparent;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
::-webkit-scrollbar {
|
|
14
|
+
width: 0.25rem;
|
|
15
|
+
height: 0.5rem;
|
|
16
|
+
background-color: transparent;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
::-webkit-scrollbar-thumb {
|
|
20
|
+
background-color: var(--light-600);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
::-webkit-scrollbar-corner {
|
|
24
|
+
background-color: transparent;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/* Classes */
|
|
28
|
+
|
|
29
|
+
.ai-chat-widget {
|
|
30
|
+
border: 1px solid var(--light-600);
|
|
31
|
+
background-color: var(--light-400);
|
|
32
|
+
border-radius: 4px;
|
|
33
|
+
position: relative;
|
|
34
|
+
overflow: hidden;
|
|
35
|
+
width: 100%;
|
|
36
|
+
height: 100%;
|
|
37
|
+
|
|
38
|
+
&.minimized {
|
|
39
|
+
.chat-container {
|
|
40
|
+
padding: 10px;
|
|
41
|
+
width: calc(100% - 20px);
|
|
42
|
+
}
|
|
43
|
+
.minimized-header {
|
|
44
|
+
padding: 0 10px;
|
|
45
|
+
width: calc(100% - 20px);
|
|
46
|
+
}
|
|
47
|
+
.home-page {
|
|
48
|
+
.title {
|
|
49
|
+
margin-top: 40px;
|
|
50
|
+
font-size: 18px;
|
|
51
|
+
}
|
|
52
|
+
.subtitle {
|
|
53
|
+
font-size: 14px;
|
|
54
|
+
}
|
|
55
|
+
.title, .subtitle {
|
|
56
|
+
display: block;
|
|
57
|
+
text-align: center;
|
|
58
|
+
margin-left: 20px;
|
|
59
|
+
margin-right: 20px;
|
|
60
|
+
}
|
|
61
|
+
.shortcuts {
|
|
62
|
+
display: none;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
.message-input .action-box{
|
|
66
|
+
.feature-buttons, .expand {
|
|
67
|
+
display: none;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.chat-window {
|
|
74
|
+
transition: width 0.3s;
|
|
75
|
+
width: 100%;
|
|
76
|
+
display: flex;
|
|
77
|
+
flex-direction: column;
|
|
78
|
+
align-items: center;
|
|
79
|
+
height: 100%;
|
|
80
|
+
|
|
81
|
+
&.narrow {
|
|
82
|
+
width: 50%;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.chat-container {
|
|
87
|
+
padding: 20px;
|
|
88
|
+
max-width: 1200px;
|
|
89
|
+
width: calc(100% - 40px);
|
|
90
|
+
display: flex;
|
|
91
|
+
flex-direction: column;
|
|
92
|
+
flex: 1;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.chat-content {
|
|
96
|
+
display: flex;
|
|
97
|
+
flex-direction: column;
|
|
98
|
+
flex: 1;
|
|
99
|
+
flex-basis: 0;
|
|
100
|
+
overflow: auto;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.chat-right-panel {
|
|
104
|
+
position: absolute;
|
|
105
|
+
width: 50%;
|
|
106
|
+
left: 100%;
|
|
107
|
+
top: 0;
|
|
108
|
+
bottom: 0;
|
|
109
|
+
transition: left 0.3s ease-in-out;
|
|
110
|
+
background-color: var(--light-300);
|
|
111
|
+
border-radius: 4px;
|
|
112
|
+
border-left: 2px solid var(--light-600);
|
|
113
|
+
display: flex;
|
|
114
|
+
flex-direction: column;
|
|
115
|
+
|
|
116
|
+
&.visible {
|
|
117
|
+
left: 50%;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { WithChildren } from '../types.js';
|
|
2
|
+
interface Props extends WithChildren {
|
|
3
|
+
title: string;
|
|
4
|
+
description: string;
|
|
5
|
+
onClose: () => void;
|
|
6
|
+
}
|
|
7
|
+
export declare const DefaultPanel: ({ description, onClose, title, children }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=DefaultPanel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DefaultPanel.d.ts","sourceRoot":"","sources":["../../src/right-panel/DefaultPanel.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AAEvC,UAAU,KAAM,SAAQ,YAAY;IAClC,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AA8BD,eAAO,MAAM,YAAY,8CAA+C,KAAK,4CAgB5E,CAAA"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Text } from '@citric/core';
|
|
3
|
+
import { Times } from '@citric/icons';
|
|
4
|
+
import { IconButton } from '@citric/ui';
|
|
5
|
+
import { useTranslate } from '@stack-spot/portal-translate';
|
|
6
|
+
import { styled } from 'styled-components';
|
|
7
|
+
const PanelBox = styled.div `
|
|
8
|
+
padding: 25px;
|
|
9
|
+
display: flex;
|
|
10
|
+
flex-direction: column;
|
|
11
|
+
gap: 25px;
|
|
12
|
+
flex: 1;
|
|
13
|
+
overflow: hidden;
|
|
14
|
+
|
|
15
|
+
header {
|
|
16
|
+
display: flex;
|
|
17
|
+
flex-direction: row;
|
|
18
|
+
|
|
19
|
+
.title {
|
|
20
|
+
display: flex;
|
|
21
|
+
flex-direction: column;
|
|
22
|
+
gap: 10px;
|
|
23
|
+
flex: 1;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
article {
|
|
28
|
+
flex: 1;
|
|
29
|
+
display: flex;
|
|
30
|
+
flex-direction: column;
|
|
31
|
+
overflow: auto;
|
|
32
|
+
}
|
|
33
|
+
`;
|
|
34
|
+
export const DefaultPanel = ({ description, onClose, title, children }) => {
|
|
35
|
+
const t = useTranslate(dictionary);
|
|
36
|
+
return (_jsxs(PanelBox, { children: [_jsxs("header", { children: [_jsxs("div", { className: "title", children: [_jsx(Text, { appearance: "h5", children: title }), _jsx(Text, { colorScheme: "light.700", children: description })] }), _jsx(IconButton, { title: t.close, "aria-label": t.close, onClick: onClose, children: _jsx(Times, {}) })] }), _jsx("article", { children: children })] }));
|
|
37
|
+
};
|
|
38
|
+
const dictionary = {
|
|
39
|
+
en: {
|
|
40
|
+
close: 'Close',
|
|
41
|
+
},
|
|
42
|
+
pt: {
|
|
43
|
+
close: 'Fechar',
|
|
44
|
+
},
|
|
45
|
+
};
|
|
46
|
+
//# sourceMappingURL=DefaultPanel.js.map
|