@stack-spot/ai-chat-widget 1.20.2-beta.0 → 1.20.2-beta.10
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/app-metadata.json +6 -6
- package/dist/components/ProgressBar.d.ts +5 -1
- package/dist/components/ProgressBar.d.ts.map +1 -1
- package/dist/components/ProgressBar.js +8 -8
- package/dist/components/ProgressBar.js.map +1 -1
- package/dist/components/Selector/index.d.ts +1 -1
- package/dist/components/Selector/index.d.ts.map +1 -1
- package/dist/components/Selector/index.js +4 -4
- package/dist/components/Selector/index.js.map +1 -1
- package/dist/layout.css +2 -1
- package/dist/views/Agents/AgentDescription.d.ts +2 -2
- package/dist/views/Agents/AgentDescription.d.ts.map +1 -1
- package/dist/views/Agents/AgentDescription.js +1 -3
- 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 +2 -2
- 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 +5 -16
- package/dist/views/Agents/AgentsTab.js.map +1 -1
- package/dist/views/Agents/useAgentFavorites.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/ChatMessage.d.ts +2 -2
- package/dist/views/Chat/ChatMessage.d.ts.map +1 -1
- package/dist/views/Chat/ChatMessage.js +14 -10
- package/dist/views/Chat/ChatMessage.js.map +1 -1
- package/dist/views/Chat/styled.d.ts.map +1 -1
- package/dist/views/Chat/styled.js +10 -4
- package/dist/views/Chat/styled.js.map +1 -1
- package/dist/views/ChatHistory/utils.d.ts.map +1 -1
- package/dist/views/ChatHistory/utils.js +3 -13
- package/dist/views/ChatHistory/utils.js.map +1 -1
- package/dist/views/MessageInput/AgentSelector.d.ts.map +1 -1
- package/dist/views/MessageInput/AgentSelector.js +11 -19
- 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 +3 -4
- package/dist/views/MessageInput/ButtonAgent.js.map +1 -1
- package/dist/views/MessageInput/ButtonBar.d.ts +17 -0
- package/dist/views/MessageInput/ButtonBar.d.ts.map +1 -0
- package/dist/views/MessageInput/ButtonBar.js +16 -0
- package/dist/views/MessageInput/ButtonBar.js.map +1 -0
- package/dist/views/MessageInput/InfoBar.d.ts.map +1 -1
- package/dist/views/MessageInput/InfoBar.js +2 -2
- package/dist/views/MessageInput/InfoBar.js.map +1 -1
- package/dist/views/MessageInput/SelectContent.d.ts +2 -0
- package/dist/views/MessageInput/SelectContent.d.ts.map +1 -0
- package/dist/views/MessageInput/SelectContent.js +48 -0
- package/dist/views/MessageInput/SelectContent.js.map +1 -0
- package/dist/views/MessageInput/dictionary.js +2 -2
- package/dist/views/MessageInput/dictionary.js.map +1 -1
- package/dist/views/MessageInput/index.d.ts.map +1 -1
- package/dist/views/MessageInput/index.js +4 -8
- package/dist/views/MessageInput/index.js.map +1 -1
- package/dist/views/MessageInput/styled.d.ts +6 -1
- package/dist/views/MessageInput/styled.d.ts.map +1 -1
- package/dist/views/MessageInput/styled.js +60 -22
- package/dist/views/MessageInput/styled.js.map +1 -1
- package/package.json +1 -1
- package/src/app-metadata.json +2 -2
- package/src/components/ProgressBar.tsx +3 -3
- package/src/layout.css +2 -1
- package/src/views/Chat/ChatMessage.tsx +45 -16
- package/src/views/Chat/styled.ts +10 -4
- package/src/views/MessageInput/ButtonBar.tsx +2 -2
- package/src/views/MessageInput/SelectContent.tsx +45 -12
- package/src/views/MessageInput/styled.ts +19 -21
- package/dist/utils/agent.d.ts +0 -2
- package/dist/utils/agent.d.ts.map +0 -1
- package/dist/utils/agent.js +0 -2
- package/dist/utils/agent.js.map +0 -1
- package/dist/views/MessageInput/ButtonGroup.d.ts +0 -29
- package/dist/views/MessageInput/ButtonGroup.d.ts.map +0 -1
- package/dist/views/MessageInput/ButtonGroup.js +0 -34
- package/dist/views/MessageInput/ButtonGroup.js.map +0 -1
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { ChevronRight, Code, KnowledgeSource, Send, Spaces, Stack, Times } from '@citric/icons';
|
|
3
|
-
import { IconButton } from '@citric/ui';
|
|
4
|
-
import { listToClass } from '@stack-spot/portal-theme';
|
|
5
|
-
import { useEffect, useRef } from 'react';
|
|
6
|
-
import { useCurrentChatState, useWidget } from '../../context/hooks.js';
|
|
7
|
-
import { useMessageInputDictionary } from './dictionary.js';
|
|
8
|
-
/**
|
|
9
|
-
* Renders the button group at right bottom side of the message input. This includes the send button as well as the buttons to open the
|
|
10
|
-
* editor, change the stack, etc.
|
|
11
|
-
*/
|
|
12
|
-
export const ButtonGroup = ({ onSend, onCancel, expanded, setExpanded, isLoading }) => {
|
|
13
|
-
const t = useMessageInputDictionary();
|
|
14
|
-
const widget = useWidget();
|
|
15
|
-
const featureButtonsWidth = useRef();
|
|
16
|
-
const featureButtons = useRef(null);
|
|
17
|
-
const features = useCurrentChatState('features');
|
|
18
|
-
const hasFeatureButtons = features.workspace || features.knowledgeSource || features.stack || features.editor;
|
|
19
|
-
useEffect(() => {
|
|
20
|
-
if (!featureButtons.current)
|
|
21
|
-
return;
|
|
22
|
-
const isHidden = featureButtons.current.style.width === '0px';
|
|
23
|
-
featureButtons.current.style.width = 'auto';
|
|
24
|
-
featureButtonsWidth.current = featureButtons.current.clientWidth;
|
|
25
|
-
if (isHidden)
|
|
26
|
-
featureButtons.current.style.width = '0px';
|
|
27
|
-
else
|
|
28
|
-
featureButtons.current.style.width = `${featureButtonsWidth.current}px`;
|
|
29
|
-
},
|
|
30
|
-
// don't use the whole features object here, it would make every chat tab change rerun this effect.
|
|
31
|
-
[features.workspace, features.knowledgeSource, features.stack, features.editor]);
|
|
32
|
-
return (_jsxs("div", { className: "button-group", children: [hasFeatureButtons && _jsxs(_Fragment, { children: [_jsxs("div", { ref: featureButtons, className: listToClass(['feature-buttons', expanded && 'expanded']), style: { width: expanded ? featureButtonsWidth.current : 0 }, children: [features.workspace && (_jsx(IconButton, { "aria-label": t.spot, title: t.spot, onClick: () => widget.set('panel', 'workspace'), children: _jsx(Spaces, {}) })), features.knowledgeSource && (_jsx(IconButton, { "aria-label": t.knowledgeSource, title: t.knowledgeSource, onClick: () => widget.set('panel', 'ks'), children: _jsx(KnowledgeSource, {}) })), features.stack && (_jsx(IconButton, { "aria-label": t.stack, title: t.stack, onClick: () => widget.set('panel', 'stack'), children: _jsx(Stack, {}) })), features.editor && (_jsx(IconButton, { "aria-label": t.code, title: t.code, onClick: () => widget.set('panel', 'editor'), children: _jsx(Code, {}) }))] }), _jsx(IconButton, { title: expanded ? t.collapse : t.expand, className: listToClass(['expand', !expanded && 'collapsed']), "aria-label": expanded ? t.collapse : t.expand, onClick: () => setExpanded(v => !v), children: _jsx(ChevronRight, {}) })] }), isLoading ? (_jsx(IconButton, { "aria-label": t.cancel, onClick: onCancel, className: "send", title: t.cancel, children: _jsx(Times, {}) })) : (_jsx(IconButton, { "aria-label": t.send, onClick: onSend, className: "send", title: t.send, children: _jsx(Send, {}) }))] }));
|
|
33
|
-
};
|
|
34
|
-
//# sourceMappingURL=ButtonGroup.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ButtonGroup.js","sourceRoot":"","sources":["../../../src/views/MessageInput/ButtonGroup.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,EAAE,IAAI,EAAE,eAAe,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAA;AAC/F,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AACvC,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAA;AACtD,OA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