@stack-spot/ai-chat-widget 1.20.2-beta.0 → 1.20.2-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/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 +6 -6
- 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/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.map +1 -1
- package/dist/views/Chat/ChatMessage.js +1 -3
- package/dist/views/Chat/ChatMessage.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 +19 -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 +49 -9
- package/dist/views/MessageInput/styled.js.map +1 -1
- package/package.json +1 -1
- package/src/app-metadata.json +2 -2
- 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,8 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Flex, IconBox, Image } from '@citric/core';
|
|
3
3
|
import { Agent } from '@citric/icons';
|
|
4
|
-
import { agentClient
|
|
5
|
-
import { uniqBy } from 'lodash';
|
|
4
|
+
import { agentClient } from '@stack-spot/portal-network';
|
|
6
5
|
import { useCallback } from 'react';
|
|
7
6
|
import { Selector } from '../../components/Selector/index.js';
|
|
8
7
|
import { useCurrentChat, useCurrentChatState } from '../../context/hooks.js';
|
|
@@ -17,14 +16,15 @@ export const AgentSelector = ({ inputRef, isTrial }) => {
|
|
|
17
16
|
const isAgentEnabled = useCurrentChatState('features').agent;
|
|
18
17
|
const { useFavorites, onAddFavorite, onRemoveFavorite } = useAgentFavorites();
|
|
19
18
|
const onSelectItem = useCallback(async (agent) => {
|
|
20
|
-
const publicAgents = await agentClient.publicAgents.query({});
|
|
21
|
-
const builtInsAgents = [...publicAgents.map((agent) => ({ ...agent, visibility_level: 'builtIn' }))];
|
|
22
19
|
const newValue = `@${agent.slug}`;
|
|
23
20
|
chat.set('nextMessage', undefined);
|
|
24
|
-
const isBuiltIn = agent.visibility_level === 'builtIn' || builtInsAgents.some((builtInAgent) => builtInAgent.id === agent.id);
|
|
25
21
|
chat.set('agent', {
|
|
26
|
-
id: agent.id,
|
|
27
|
-
|
|
22
|
+
id: agent.id,
|
|
23
|
+
label: agent.name,
|
|
24
|
+
image: agent.avatar,
|
|
25
|
+
slug: agent.slug,
|
|
26
|
+
builtIn: agent.builtIn,
|
|
27
|
+
visibility_level: agent.visibility_level,
|
|
28
28
|
});
|
|
29
29
|
if (!inputRef.current)
|
|
30
30
|
return;
|
|
@@ -32,18 +32,10 @@ export const AgentSelector = ({ inputRef, isTrial }) => {
|
|
|
32
32
|
inputRef.current.focus();
|
|
33
33
|
}, [chat, inputRef]);
|
|
34
34
|
const getAgents = () => {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
const builtInsAgents = [...publicAgents.map((agent) => ({ ...agent, visibility_level: 'builtIn' }))];
|
|
38
|
-
const workspaceAgents = workspaceAiClient.workspacesContentsByType.useQuery({ contentType: 'agent' });
|
|
39
|
-
const workspaceAgentsWithWorkspaceName = workspaceAgents.flatMap(({ agents, space_name }) => agents?.map((agent) => ({ ...agent, spaceName: space_name })));
|
|
40
|
-
let accountAgents = [];
|
|
41
|
-
let sharedAgents = [];
|
|
42
|
-
if (!isTrial) {
|
|
43
|
-
accountAgents = agentClient.agents.useQuery({ visibility: 'ACCOUNT' }) || [];
|
|
44
|
-
sharedAgents = agentClient.agents.useQuery({ visibility: 'SHARED' }) || [];
|
|
35
|
+
if (isTrial) {
|
|
36
|
+
return agentClient.allAgents.useQuery({ visibilities: ['PERSONAL', 'BUILT-IN'] });
|
|
45
37
|
}
|
|
46
|
-
return
|
|
38
|
+
return agentClient.allAgents.useQuery({ visibilities: ['ACCOUNT', 'SHARED', 'PERSONAL', 'BUILT-IN', 'WORKSPACE'] });
|
|
47
39
|
};
|
|
48
40
|
return _jsx(Selector, { inputRef: inputRef, favorite: { useFavorites, onAddFavorite, onRemoveFavorite }, selectorConfig: {
|
|
49
41
|
resourceName: 'Agent',
|
|
@@ -52,7 +44,7 @@ export const AgentSelector = ({ inputRef, isTrial }) => {
|
|
|
52
44
|
regex: agentRegex,
|
|
53
45
|
urlBuilder: (agent) => `/agents/${agent?.id}`,
|
|
54
46
|
searchProp: 'name',
|
|
55
|
-
sections: isTrial ? ['favorite', 'personal', '
|
|
47
|
+
sections: isTrial ? ['favorite', 'personal', 'built-in'] : ['favorite', 'personal', 'workspace', 'account', 'shared', 'built-in'],
|
|
56
48
|
renderComponentItem: AgentItem,
|
|
57
49
|
isEnabled: isAgentEnabled,
|
|
58
50
|
onSelect: onSelectItem,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AgentSelector.js","sourceRoot":"","sources":["../../../src/views/MessageInput/AgentSelector.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAA;AACnD,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAA;AACrC,OAAO,EAAE,WAAW,
|
|
1
|
+
{"version":3,"file":"AgentSelector.js","sourceRoot":"","sources":["../../../src/views/MessageInput/AgentSelector.tsx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AE,EAAE,YAAY,EAAE,aAAa,EAAE,gBAAgB,EAAE,EAC3D,cAAc,EAAE;YACd,YAAY,EAAE,OAAO;YACrB,QAAQ,EAAE,GAAG;YACb,IAAI,EAAE,KAAC,KAAK,KAAG;YACf,KAAK,EAAE,UAAU;YACjB,UAAU,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,WAAW,KAAK,EAAE,EAAE,EAAE;YAC7C,UAAU,EAAE,MAAM;YAClB,QAAQ,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,UAAU,EAAE,UAAU,EAAE,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,UAAU,EAAE,UAAU,EAAE,WAAW,EAAE,SAAS,EAAE,QAAQ,EAAE,UAAU,CAAC;YACjI,mBAAmB,EAAE,SAAS;YAC9B,SAAS,EAAE,cAAc;YACzB,QAAQ,EAAE,YAAY;YACtB,OAAO,EAAE,SAAS;SACnB,GACD,CAAA;AACJ,CAAC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ButtonAgent.d.ts","sourceRoot":"","sources":["../../../src/views/MessageInput/ButtonAgent.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ButtonAgent.d.ts","sourceRoot":"","sources":["../../../src/views/MessageInput/ButtonAgent.tsx"],"names":[],"mappings":"AASA,eAAO,MAAM,WAAW,+CAmDvB,CAAA"}
|
|
@@ -6,12 +6,10 @@ import { MiniLogo } from '@stack-spot/portal-components/svg';
|
|
|
6
6
|
import { agentClient } from '@stack-spot/portal-network';
|
|
7
7
|
import { useEffect } from 'react';
|
|
8
8
|
import { useCurrentChat, useCurrentChatState, useWidget } from '../../context/hooks.js';
|
|
9
|
-
import { isAgentDefault } from '../../utils/agent.js';
|
|
10
9
|
import { useMessageInputDictionary } from './dictionary.js';
|
|
11
10
|
export const ButtonAgent = () => {
|
|
12
11
|
const t = useMessageInputDictionary();
|
|
13
|
-
const
|
|
14
|
-
const agentDefault = agentsBuiltIn?.find((agent) => isAgentDefault(agent.slug));
|
|
12
|
+
const agentDefault = agentClient.agentDefault.useQuery({});
|
|
15
13
|
const widget = useWidget();
|
|
16
14
|
const chat = useCurrentChat();
|
|
17
15
|
const agent = useCurrentChatState('agent');
|
|
@@ -31,7 +29,8 @@ export const ButtonAgent = () => {
|
|
|
31
29
|
setAgentDefault();
|
|
32
30
|
}
|
|
33
31
|
}, [agentDefault, agent]);
|
|
34
|
-
|
|
32
|
+
const isAgentDefault = () => agent?.id === agentDefault?.id;
|
|
33
|
+
return (_jsx("div", { className: "button-group", children: features.agent && (_jsxs("div", { className: "group-agent", children: [_jsx(IconButton, { "aria-label": t.agent, title: t.agent, className: "agent", onClick: () => widget.set('panel', 'agent'), children: agentDefault?.avatar ? _jsx("img", { src: agentDefault.avatar, className: "image" }) : _jsx(MiniLogo, {}) }), agent?.id && !isAgentDefault() &&
|
|
35
34
|
_jsx(Tooltip, { text: t.remove, children: _jsxs(IconButton, { "aria-label": t.remove, className: "agent agent-selected", onClick: setAgentDefault, children: [agent?.image ? _jsx("img", { src: agent.image, className: "image" }) : _jsx(IconBox, { className: "image", size: "xs", children: _jsx(Agent, {}) }), _jsx(Flex, { className: "icon-remove", alignContent: "center", justifyContent: "center", children: _jsx(TimesMini, {}) })] }) })] })) }));
|
|
36
35
|
};
|
|
37
36
|
//# sourceMappingURL=ButtonAgent.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ButtonAgent.js","sourceRoot":"","sources":["../../../src/views/MessageInput/ButtonAgent.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAC5C,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAChD,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AAChD,OAAO,EAAE,QAAQ,EAAE,MAAM,mCAAmC,CAAA;AAC5D,OAAO,EAAE,WAAW,EAAE,M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C,CAAC,CAAC,KAAC,OAAO,IAAC,SAAS,EAAC,OAAO,EAAC,IAAI,EAAC,IAAI,YAAC,KAAC,KAAK,KAAG,GAAU,EACtH,KAAC,IAAI,IAAC,SAAS,EAAC,aAAa,EAAC,YAAY,EAAC,QAAQ,EAAC,cAAc,EAAC,QAAQ,YACzE,KAAC,SAAS,KAAG,GACR,IACI,GACL,IAER,CACP,GACG,CACP,CAAA;AACH,CAAC,CAAA"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
interface SelectionBarProps {
|
|
2
|
+
/**
|
|
3
|
+
* A function to run when the send button is clicked.
|
|
4
|
+
*/
|
|
5
|
+
onSend: () => void;
|
|
6
|
+
/**
|
|
7
|
+
* Whether or not the message is currently being sent. This is used to decide which button to show: send or cancel.
|
|
8
|
+
*/
|
|
9
|
+
isLoading?: boolean;
|
|
10
|
+
/**
|
|
11
|
+
*
|
|
12
|
+
*/
|
|
13
|
+
focused?: boolean;
|
|
14
|
+
}
|
|
15
|
+
export declare const ButtonBar: ({ onSend, isLoading, focused }: SelectionBarProps) => import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
export {};
|
|
17
|
+
//# sourceMappingURL=ButtonBar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ButtonBar.d.ts","sourceRoot":"","sources":["../../../src/views/MessageInput/ButtonBar.tsx"],"names":[],"mappings":"AAQA,UAAU,iBAAiB;IACzB;;OAEG;IACH,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,eAAO,MAAM,SAAS,mCAAoC,iBAAiB,4CA+B1E,CAAA"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Flex } from '@citric/core';
|
|
3
|
+
import { ArrowUp, Code, Stop } from '@citric/icons';
|
|
4
|
+
import { IconButton } from '@citric/ui';
|
|
5
|
+
import { useCurrentChat, useCurrentChatState, useWidget } from '../../context/hooks.js';
|
|
6
|
+
import { useMessageInputDictionary } from './dictionary.js';
|
|
7
|
+
import { SelectContent } from './SelectContent.js';
|
|
8
|
+
import { SelectionBarWrapper } from './styled.js';
|
|
9
|
+
export const ButtonBar = ({ onSend, isLoading, focused }) => {
|
|
10
|
+
const t = useMessageInputDictionary();
|
|
11
|
+
const chat = useCurrentChat();
|
|
12
|
+
const widget = useWidget();
|
|
13
|
+
const features = useCurrentChatState('features');
|
|
14
|
+
return (_jsxs(SelectionBarWrapper, { "$inputFocused": focused, children: [_jsxs(Flex, { children: [_jsx(SelectContent, {}), features.editor && (_jsx(IconButton, { color: "light", appearance: "square", "aria-label": t.code, title: t.code, onClick: () => widget.set('panel', 'editor'), children: _jsx(Code, {}) }))] }), _jsx(Flex, { children: isLoading ? (_jsx(IconButton, { appearance: "square", color: "inverse", "aria-label": t.cancel, onClick: () => chat.abort(), className: "send", title: t.cancel, children: _jsx(Stop, {}) })) : (_jsx(IconButton, { appearance: "square", color: "inverse", "aria-label": t.send, onClick: onSend, className: "send", title: t.send, children: _jsx(ArrowUp, {}) })) })] }));
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=ButtonBar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ButtonBar.js","sourceRoot":"","sources":["../../../src/views/MessageInput/ButtonBar.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AACnC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,eAAe,CAAA;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AACvC,OAAO,EAAE,cAAc,EAAE,mBAAmB,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AACpF,OAAO,EAAE,yBAAyB,EAAE,MAA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AC,KAAK,EAAE,CAAC,CAAC,IAAI,YAC/C,KAAC,OAAO,KAAG,GACA,CACd,GACI,IACa,CACvB,CAAA;AACH,CAAC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InfoBar.d.ts","sourceRoot":"","sources":["../../../src/views/MessageInput/InfoBar.tsx"],"names":[],"mappings":"AA6BA;;;;;;GAMG;AACH,eAAO,MAAM,OAAO,+
|
|
1
|
+
{"version":3,"file":"InfoBar.d.ts","sourceRoot":"","sources":["../../../src/views/MessageInput/InfoBar.tsx"],"names":[],"mappings":"AA6BA;;;;;;GAMG;AACH,eAAO,MAAM,OAAO,+CA8EnB,CAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Text } from '@citric/core';
|
|
3
|
-
import {
|
|
3
|
+
import { TimesMini } from '@citric/icons';
|
|
4
4
|
import { Badge, IconButton } from '@citric/ui';
|
|
5
5
|
import { loader } from '@monaco-editor/react';
|
|
6
6
|
import { listToClass } from '@stack-spot/portal-theme';
|
|
@@ -49,6 +49,6 @@ export const InfoBar = () => {
|
|
|
49
49
|
const editor = loader.__getMonacoInstance()?.editor;
|
|
50
50
|
editor?.getEditors()[0].setSelection({ startLineNumber: 0, endLineNumber: 0, endColumn: 0, startColumn: 0 });
|
|
51
51
|
}, []);
|
|
52
|
-
return (_jsxs("div", { className: listToClass(['info-bar', visible && 'visible']), children: [_jsx("div", { className: "space" }), _jsxs("div", { className: "content", children: [shouldRenderRemoveAllButton && (_jsx(IconButton, { "aria-label": t.removeConfig, title: t.removeConfig, onClick: removeAll, children: _jsx(
|
|
52
|
+
return (_jsxs("div", { className: listToClass(['info-bar', visible && 'visible']), children: [_jsx("div", { className: "space" }), _jsxs("div", { className: "content", children: [shouldRenderRemoveAllButton && (_jsx(IconButton, { appearance: "square", color: "light", "aria-label": t.removeConfig, title: t.removeConfig, onClick: removeAll, children: _jsx(TimesMini, {}) })), _jsx(FadingOverflow, { className: "list-overflow", scroll: "arrows", enableHorizontalScrollWithVerticalWheel: true, children: _jsxs("ul", { children: [currentSelection && (_jsx("li", { children: _jsx(InfoBadge, { label: t.selected, dismiss: t.removeSelection, color: "blue", onDismiss: removeCodeSelection }) })), currentStack && (_jsx("li", { children: _jsx(InfoBadge, { label: currentStack.label, dismiss: t.removeStack, color: "cyan", onDismiss: features.stack ? (() => chat.set('stack', undefined)) : undefined }) })), currentWorkspace && (_jsx("li", { children: _jsx(InfoBadge, { label: currentWorkspace.label, dismiss: t.removeWorkspace, color: "pink", onDismiss: features.workspace ? (() => chat.set('workspace', undefined)) : undefined }) })), ksToRender] }) })] })] }));
|
|
53
53
|
};
|
|
54
54
|
//# sourceMappingURL=InfoBar.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InfoBar.js","sourceRoot":"","sources":["../../../src/views/MessageInput/InfoBar.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AACnC,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"InfoBar.js","sourceRoot":"","sources":["../../../src/views/MessageInput/InfoBar.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AACnC,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AACzC,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAC9C,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAA;AAC7C,OAAO,EAAoB,WAAW,EAAE,MAAM,0BAA0B,CAAA;AACxE,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,OAAO,CAAA;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAA;AAChE,OAAO,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAA;AACzE,OAAO,EAAE,yBAAyB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AC1B,KAAK,EAAC,MAAM,EACZ,SAAS,EAAE,QAAQ,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,WAAW,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,GACpF,GACC,CACN,EACA,UAAU,IACR,GACU,IACb,IACF,CACP,CAAA;AACH,CAAC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SelectContent.d.ts","sourceRoot":"","sources":["../../../src/views/MessageInput/SelectContent.tsx"],"names":[],"mappings":"AAMA,eAAO,MAAM,aAAa,+CAkCzB,CAAA"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Clip, KnowledgeSource, Spaces, Stack } from '@citric/icons';
|
|
3
|
+
import { IconButton } from '@citric/ui';
|
|
4
|
+
import { SelectionList } from '@stack-spot/portal-components/SelectionList';
|
|
5
|
+
import { useState } from 'react';
|
|
6
|
+
import { useWidget } from '../../context/hooks.js';
|
|
7
|
+
export const SelectContent = () => {
|
|
8
|
+
const widget = useWidget();
|
|
9
|
+
const [visibleMenu, setVisibleMenu] = useState(false);
|
|
10
|
+
return (_jsxs(_Fragment, { children: [_jsx(IconButton, { color: "light", appearance: "square", role: "button", title: "title", "data-test-hint": "button-hint", "aria-label": "aria-label", onClick: () => setVisibleMenu(state => !state), children: _jsx(Clip, {}) }), _jsx(SelectionList, { style: {
|
|
11
|
+
position: 'absolute',
|
|
12
|
+
top: '-150px',
|
|
13
|
+
}, id: "teste", visible: visibleMenu, onHide: () => setVisibleMenu(false), items: [
|
|
14
|
+
{ label: 'Knowledge Sources', icon: _jsx(KnowledgeSource, {}), onClick: () => widget.set('panel', 'ks') },
|
|
15
|
+
{ label: 'Stacks AI', icon: _jsx(Stack, {}), onClick: () => widget.set('panel', 'stack') },
|
|
16
|
+
{ label: 'Spots', icon: _jsx(Spaces, {}), onClick: () => widget.set('panel', 'workspace') },
|
|
17
|
+
] })] }));
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=SelectContent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SelectContent.js","sourceRoot":"","sources":["../../../src/views/MessageInput/SelectContent.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,eAAe,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,eAAe,CAAA;AACpE,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AACvC,OAAO,EAAE,aAAa,EAAE,MAAM,6CAA6C,CAAA;AAC3E,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAChC,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AAE/C,MAAM,CAAC,MAAM,aAAa,GAAG,GAAG,EAAE;IAChC,MAAM,MAAM,GAAG,SAAS,EAAE,CAAA;IAC1B,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAA;IAErD,OAAO,CACL,8BACE,KAAC,UAAU,IACT,KAAK,EAAC,OAAO,EACb,UAAU,EAAC,QAAQ,EACnB,IAAI,EAAC,QAAQ,EACb,KAAK,EAAC,OAAO,oBACE,aAAa,gBACjB,YAAY,EACvB,OAAO,EAAE,GAAG,EAAE,CAAC,cAAc,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,YAC9C,KAAC,IAAI,KAAG,GACG,EACb,KAAC,aAAa,IACZ,KAAK,EAAE;oBACL,QAAQ,EAAE,UAAU;oBACpB,GAAG,EAAE,QAAQ;iBACd,EACD,EAAE,EAAC,OAAO,EACV,OAAO,EAAE,WAAW,EACpB,MAAM,EAAE,GAAG,EAAE,CAAC,cAAc,CAAC,KAAK,CAAC,EACnC,KAAK,EACH;oBACE,EAAE,KAAK,EAAE,mBAAmB,EAAE,IAAI,EAAE,KAAC,eAAe,KAAG,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,OAAO,EAAE,IAAI,CAAC,EAAE;oBACnG,EAAE,KAAK,EAAE,WAAW,EAAE,IAAI,EAAE,KAAC,KAAK,KAAG,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,OAAO,EAAE,OAAO,CAAC,EAAE;oBACpF,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,KAAC,MAAM,KAAG,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,OAAO,EAAE,WAAW,CAAC,EAAE;iBACtF,GAEH,IACD,CACJ,CAAA;AACH,CAAC,CAAA"}
|
|
@@ -9,7 +9,7 @@ const dictionary = {
|
|
|
9
9
|
collapse: 'Hide buttons',
|
|
10
10
|
expand: 'Show buttons',
|
|
11
11
|
send: 'Send message',
|
|
12
|
-
placeholder: 'Message to $0',
|
|
12
|
+
placeholder: 'Message to $0 or use / or @.',
|
|
13
13
|
cancel: 'Cancel',
|
|
14
14
|
removeConfig: 'Remove all the configuration',
|
|
15
15
|
removeStack: 'Stop using the current stack',
|
|
@@ -28,7 +28,7 @@ const dictionary = {
|
|
|
28
28
|
collapse: 'Esconder botões',
|
|
29
29
|
expand: 'Mostrar botões',
|
|
30
30
|
send: 'Enviar mensagem',
|
|
31
|
-
placeholder: 'Mensagem para $0',
|
|
31
|
+
placeholder: 'Mensagem para $0 ou use / ou @.',
|
|
32
32
|
cancel: 'Cancelar',
|
|
33
33
|
removeConfig: 'Remover todas as configurações',
|
|
34
34
|
removeStack: 'Parar de usar a stack atual',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dictionary.js","sourceRoot":"","sources":["../../../src/views/MessageInput/dictionary.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,YAAY,EAAE,MAAM,8BAA8B,CAAA;AAEvE,MAAM,UAAU,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A4B;QAC7C,QAAQ,EAAE,qCAAqC;QAC/C,QAAQ,EAAE,aAAa;QACvB,eAAe,EAAE,4BAA4B;QAC7C,MAAM,EAAE,SAAS;KAClB;CACmB,CAAA;AAEtB,MAAM,CAAC,MAAM,yBAAyB,GAAG,GAAG,EAAE,CAAC,YAAY,CAAC,UAAU,CAAC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/views/MessageInput/index.tsx"],"names":[],"mappings":"AAkBA;;;;GAIG;AACH,eAAO,MAAM,YAAY,+
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/views/MessageInput/index.tsx"],"names":[],"mappings":"AAkBA;;;;GAIG;AACH,eAAO,MAAM,YAAY,+CAiExB,CAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { listToClass } from '@stack-spot/portal-theme';
|
|
2
|
+
import { listToClass, theme } from '@stack-spot/portal-theme';
|
|
3
3
|
import { interpolate } from '@stack-spot/portal-translate';
|
|
4
4
|
import { useCallback, useEffect, useRef, useState } from 'react';
|
|
5
5
|
import { AdaptiveTextArea } from '../../components/AdaptiveTextArea.js';
|
|
@@ -10,7 +10,7 @@ import { ChatEntry } from '../../state/ChatEntry.js';
|
|
|
10
10
|
import { checkIsTrial } from '../../utils/check-is-trial.js';
|
|
11
11
|
import { AgentSelector } from './AgentSelector.js';
|
|
12
12
|
import { ButtonAgent } from './ButtonAgent.js';
|
|
13
|
-
import {
|
|
13
|
+
import { ButtonBar } from './ButtonBar.js';
|
|
14
14
|
import { useUserEntryHistoryShortcut } from './chat-entry-history.js';
|
|
15
15
|
import { useMessageInputDictionary } from './dictionary.js';
|
|
16
16
|
import { InfoBar } from './InfoBar.js';
|
|
@@ -24,7 +24,7 @@ import { MAX_INPUT_HEIGHT, MessageInputBox, MIN_INPUT_HEIGHT } from './styled.js
|
|
|
24
24
|
export const MessageInput = () => {
|
|
25
25
|
const t = useMessageInputDictionary();
|
|
26
26
|
const [focused, setFocused] = useState(false);
|
|
27
|
-
const [
|
|
27
|
+
const [, setExpanded] = useState(true);
|
|
28
28
|
const expansionLocked = useRef(false);
|
|
29
29
|
const chat = useCurrentChat();
|
|
30
30
|
const isLoading = useCurrentChatState('isLoading') ?? false;
|
|
@@ -43,7 +43,6 @@ export const MessageInput = () => {
|
|
|
43
43
|
const prompt = code && !quickCommandRegex.test(message) ? `${message}\n\`\`\`${language}\n${code}\n\`\`\`` : message;
|
|
44
44
|
chat.pushMessage(ChatEntry.createUserEntry(prompt, true));
|
|
45
45
|
chat.set('nextMessage', '');
|
|
46
|
-
setFocused(false);
|
|
47
46
|
}, [chat]);
|
|
48
47
|
const onKeyDown = useCallback((event) => {
|
|
49
48
|
if (!event.shiftKey && event.key === 'Enter') {
|
|
@@ -56,9 +55,6 @@ export const MessageInput = () => {
|
|
|
56
55
|
if (!isLoading)
|
|
57
56
|
textAreaRef.current?.focus();
|
|
58
57
|
}, [isLoading]);
|
|
59
|
-
return (_jsxs(MessageInputBox, { "aria-busy": isLoading, className: "message-input",
|
|
60
|
-
setExpanded(value);
|
|
61
|
-
expansionLocked.current = expanded;
|
|
62
|
-
} })] })] })] }));
|
|
58
|
+
return (_jsxs(MessageInputBox, { "aria-busy": isLoading, className: "message-input", "$inputFocused": focused, children: [_jsxs("div", { className: "wrapper-action", children: [_jsx(QuickCommandSelector, { inputRef: textAreaRef, isTrial: isTrial }), _jsx(AgentSelector, { inputRef: textAreaRef, isTrial: isTrial }), _jsxs("div", { className: listToClass(['action-box', focused && 'focused', isLoading && 'disabled']), children: [_jsx(ButtonAgent, {}), _jsx(AdaptiveTextArea, { ref: textAreaRef, placeholder: agentLabel && interpolate(t.placeholder, agentLabel), onChange: e => chat.set('nextMessage', e.target.value), value: value, onFocus: () => setFocused(true), onBlur: () => setFocused(false), onKeyDown: onKeyDown, onKeyUp: handleKeyUp, onIncreaseSize: () => setExpanded(false), onResetSize: () => !expansionLocked.current && setExpanded(true), maxHeight: isMinimized ? MIN_INPUT_HEIGHT : MAX_INPUT_HEIGHT })] })] }), _jsx(ProgressBar, { visible: true, animate: isLoading, backgroundColor: isLoading || !focused ? theme.color.light[600] : theme.color.primary[500] }), _jsx(InfoBar, {}), _jsx(ButtonBar, { focused: focused, onSend: onSend, isLoading: isLoading })] }));
|
|
63
59
|
};
|
|
64
60
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/views/MessageInput/index.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAA;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/views/MessageInput/index.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAA;AAC7D,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAA;AAC1D,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAChE,OAAO,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAA;AACpE,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAA;AAC1D,OAAO,EAAE,cAAc,EAAE,mBAAmB,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA;AACzF,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAA;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAA;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAA;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAC3C,OAAO,EAAE,SAAS,EAAE,MAAM,aAA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 +1,9 @@
|
|
|
1
1
|
export declare const MAX_INPUT_HEIGHT = 300;
|
|
2
2
|
export declare const MIN_INPUT_HEIGHT = 24;
|
|
3
|
-
export declare const
|
|
3
|
+
export declare const SelectionBarWrapper: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
|
|
4
|
+
$inputFocused?: boolean;
|
|
5
|
+
}>> & string;
|
|
6
|
+
export declare const MessageInputBox: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
|
|
7
|
+
$inputFocused?: boolean;
|
|
8
|
+
}>> & string;
|
|
4
9
|
//# sourceMappingURL=styled.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styled.d.ts","sourceRoot":"","sources":["../../../src/views/MessageInput/styled.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,gBAAgB,MAAM,CAAA;AACnC,eAAO,MAAM,gBAAgB,KAAK,CAAA;AAElC,eAAO,MAAM,eAAe,
|
|
1
|
+
{"version":3,"file":"styled.d.ts","sourceRoot":"","sources":["../../../src/views/MessageInput/styled.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,gBAAgB,MAAM,CAAA;AACnC,eAAO,MAAM,gBAAgB,KAAK,CAAA;AAElC,eAAO,MAAM,mBAAmB;oBAA+B,OAAO;YAiCrE,CAAA;AAED,eAAO,MAAM,eAAe;oBAA+B,OAAO;YA8PjE,CAAA"}
|
|
@@ -5,13 +5,48 @@ const INFO_BAR_HEIGHT = 42;
|
|
|
5
5
|
const INFO_BAR_DISPLACEMENT = 4;
|
|
6
6
|
export const MAX_INPUT_HEIGHT = 300;
|
|
7
7
|
export const MIN_INPUT_HEIGHT = 24;
|
|
8
|
+
export const SelectionBarWrapper = styled.div `
|
|
9
|
+
display: inline-flex;
|
|
10
|
+
justify-content: space-between;
|
|
11
|
+
position: relative;
|
|
12
|
+
padding: 8px;
|
|
13
|
+
padding-top: 6px;
|
|
14
|
+
background-color: ${theme.color.light[500]};
|
|
15
|
+
border-bottom-left-radius: 4px;
|
|
16
|
+
border-bottom-right-radius: 4px;
|
|
17
|
+
border: 2px solid ${({ $inputFocused }) => theme.color.light[$inputFocused ? 600 : 500]};
|
|
18
|
+
border-top: none;
|
|
19
|
+
.selection-list-content {
|
|
20
|
+
background-color: ${theme.color.light[500]}
|
|
21
|
+
}
|
|
22
|
+
ul {
|
|
23
|
+
list-style: none;
|
|
24
|
+
padding: 0;
|
|
25
|
+
margin: 12px;
|
|
26
|
+
min-width: 225px;
|
|
27
|
+
}
|
|
28
|
+
li {
|
|
29
|
+
cursor: pointer;
|
|
30
|
+
svg {
|
|
31
|
+
width: 16px;
|
|
32
|
+
height: 16px;
|
|
33
|
+
}
|
|
34
|
+
&:hover {
|
|
35
|
+
background-color: ${theme.color.light[600]}
|
|
36
|
+
}
|
|
37
|
+
a:hover {
|
|
38
|
+
background-color: ${theme.color.light[600]}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
`;
|
|
8
42
|
export const MessageInputBox = styled.div `
|
|
9
43
|
display: flex;
|
|
10
44
|
flex-direction: column;
|
|
45
|
+
margin-top: 8px;
|
|
11
46
|
|
|
12
47
|
> .info-bar {
|
|
13
|
-
|
|
14
|
-
|
|
48
|
+
padding-top: 8px;
|
|
49
|
+
/* padding-bottom: -3px; */
|
|
15
50
|
position: relative;
|
|
16
51
|
overflow: hidden;
|
|
17
52
|
|
|
@@ -31,14 +66,16 @@ export const MessageInputBox = styled.div `
|
|
|
31
66
|
top: 0;
|
|
32
67
|
left: 0;
|
|
33
68
|
right: 0;
|
|
34
|
-
border-top-left-radius: 10px;
|
|
35
|
-
border-top-right-radius: 10px;
|
|
69
|
+
/* border-top-left-radius: 10px;
|
|
70
|
+
border-top-right-radius: 10px; */
|
|
36
71
|
height: ${INFO_BAR_HEIGHT}px;
|
|
37
|
-
padding: 6px
|
|
72
|
+
padding: 6px 8px 0;
|
|
38
73
|
background-color: ${theme.color.light[500]};
|
|
39
74
|
display: flex;
|
|
40
75
|
flex-direction: row;
|
|
41
76
|
gap: 6px;
|
|
77
|
+
border-right: 2px solid ${({ $inputFocused }) => theme.color.light[$inputFocused ? 600 : 500]};
|
|
78
|
+
border-left: 2px solid ${({ $inputFocused }) => theme.color.light[$inputFocused ? 600 : 500]};
|
|
42
79
|
|
|
43
80
|
.list-overflow {
|
|
44
81
|
max-width: calc(100% - 30px); // close button + gap
|
|
@@ -91,16 +128,19 @@ export const MessageInputBox = styled.div `
|
|
|
91
128
|
flex-direction: row;
|
|
92
129
|
gap: 8px;
|
|
93
130
|
align-items: end;
|
|
94
|
-
border-radius: 4px;
|
|
95
|
-
border:
|
|
96
|
-
|
|
131
|
+
border-top-left-radius: 4px;
|
|
132
|
+
border-top-right-radius: 4px;
|
|
133
|
+
border: 2px solid ${theme.color.light[500]};
|
|
134
|
+
|
|
135
|
+
background-color: ${theme.color.light[500]};
|
|
97
136
|
padding: 10px 8px;
|
|
98
137
|
transition: border-color 0.3s, background-color 0.3s;
|
|
99
138
|
|
|
100
139
|
&.focused {
|
|
101
|
-
border
|
|
140
|
+
border: 2px solid ${theme.color.light[600]};
|
|
102
141
|
}
|
|
103
142
|
|
|
143
|
+
|
|
104
144
|
&.disabled {
|
|
105
145
|
background-color: ${theme.color.light[500]};
|
|
106
146
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styled.js","sourceRoot":"","sources":["../../../src/views/MessageInput/styled.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AACvC,OAAO,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAA;AAChD,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAA;AAE1C,MAAM,eAAe,GAAG,EAAE,CAAA;AAC1B,MAAM,qB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pC,gBAAgB;;;;;;;;CAQ7B,CAAA"}
|
package/package.json
CHANGED
package/src/app-metadata.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stack-spot/ai-chat-widget",
|
|
3
|
-
"version": "1.20.2",
|
|
4
|
-
"date": "Wed May 14 2025
|
|
3
|
+
"version": "1.20.2-beta.1",
|
|
4
|
+
"date": "Wed May 14 2025 17:13:09 GMT-0300 (Horário Padrão de Brasília)",
|
|
5
5
|
"dependencies": [
|
|
6
6
|
{
|
|
7
7
|
"name": "@stack-spot/app-metadata",
|
package/dist/utils/agent.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"agent.d.ts","sourceRoot":"","sources":["../../src/utils/agent.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,cAAc,eAAgB,MAAM,kCAAmC,CAAA"}
|
package/dist/utils/agent.js
DELETED
package/dist/utils/agent.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"agent.js","sourceRoot":"","sources":["../../src/utils/agent.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,SAAkB,EAAE,EAAE,CAAC,SAAS,KAAK,gBAAgB,CAAA"}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
interface ButtonGroupProps {
|
|
2
|
-
/**
|
|
3
|
-
* Whether or not the button group is expanded.
|
|
4
|
-
*/
|
|
5
|
-
expanded: boolean;
|
|
6
|
-
/**
|
|
7
|
-
* A function to set the button group as expanded or collapsed.
|
|
8
|
-
*/
|
|
9
|
-
setExpanded: React.Dispatch<React.SetStateAction<boolean>>;
|
|
10
|
-
/**
|
|
11
|
-
* Whether or not the message is currently being sent. This is used to decide which button to show: send or cancel.
|
|
12
|
-
*/
|
|
13
|
-
isLoading: boolean;
|
|
14
|
-
/**
|
|
15
|
-
* A function to run when the send button is clicked.
|
|
16
|
-
*/
|
|
17
|
-
onSend: () => void;
|
|
18
|
-
/**
|
|
19
|
-
* A function to run when the cancel button is clicked.
|
|
20
|
-
*/
|
|
21
|
-
onCancel: () => void;
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* 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
|
|
25
|
-
* editor, change the stack, etc.
|
|
26
|
-
*/
|
|
27
|
-
export declare const ButtonGroup: ({ onSend, onCancel, expanded, setExpanded, isLoading }: ButtonGroupProps) => import("react/jsx-runtime").JSX.Element;
|
|
28
|
-
export {};
|
|
29
|
-
//# sourceMappingURL=ButtonGroup.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ButtonGroup.d.ts","sourceRoot":"","sources":["../../../src/views/MessageInput/ButtonGroup.tsx"],"names":[],"mappings":"AAOA,UAAU,gBAAgB;IACxB;;OAEG;IACH,QAAQ,EAAE,OAAO,CAAC;IAClB;;OAEG;IACH,WAAW,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,CAAC;IAC3D;;OAEG;IACH,SAAS,EAAE,OAAO,CAAC;IACnB;;OAEG;IACH,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB;;OAEG;IACH,QAAQ,EAAE,MAAM,IAAI,CAAC;CACtB;AAED;;;GAGG;AACH,eAAO,MAAM,WAAW,2DAA4D,gBAAgB,4CA0EnG,CAAA"}
|
|
@@ -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,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAA;AACzC,OAAO,EAAE,mBAAmB,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AACpE,OAAO,EAAE,yBAAyB,EAAE,MAAM,cAAc,CAAA;AAyBxD;;;GAGG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,WAAW,EAAE,SAAS,EAAoB,EAAE,EAAE;IACtG,MAAM,CAAC,GAAG,yBAAyB,EAAE,CAAA;IACrC,MAAM,MAAM,GAAG,SAAS,EAAE,CAAA;IAC1B,MAAM,mBAAmB,GAAG,MAAM,EAAsB,CAAA;IACxD,MAAM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