@stack-spot/ai-chat-widget 1.14.8 → 1.16.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/CHANGELOG.md +14 -0
- package/dist/StackspotAIWidget.d.ts +7 -1
- package/dist/StackspotAIWidget.d.ts.map +1 -1
- package/dist/StackspotAIWidget.js +3 -2
- package/dist/StackspotAIWidget.js.map +1 -1
- package/dist/app-metadata.json +2 -2
- package/dist/assets/placeholder.png +0 -0
- package/dist/components/AgentCard/dictionary.d.ts +17 -0
- package/dist/components/AgentCard/dictionary.d.ts.map +1 -0
- package/dist/components/AgentCard/dictionary.js +17 -0
- package/dist/components/AgentCard/dictionary.js.map +1 -0
- package/dist/components/AgentCard/index.d.ts +5 -0
- package/dist/components/AgentCard/index.d.ts.map +1 -0
- package/dist/components/AgentCard/index.js +16 -0
- package/dist/components/AgentCard/index.js.map +1 -0
- package/dist/state/types.d.ts +1 -0
- package/dist/state/types.d.ts.map +1 -1
- package/dist/views/Home/index.d.ts +1 -1
- package/dist/views/Home/index.d.ts.map +1 -1
- package/dist/views/Home/index.js +6 -3
- package/dist/views/Home/index.js.map +1 -1
- package/dist/views/Home/types.d.ts +5 -0
- package/dist/views/Home/types.d.ts.map +1 -1
- package/dist/views/MessageInput/AgentSelector.d.ts.map +1 -1
- package/dist/views/MessageInput/AgentSelector.js +2 -1
- 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 +1 -0
- package/dist/views/MessageInput/ButtonAgent.js.map +1 -1
- package/dist/views/MessageInput/ButtonGroup.js +2 -2
- package/dist/views/MessageInput/ButtonGroup.js.map +1 -1
- package/dist/views/MessageInput/dictionary.d.ts +1 -1
- package/dist/views/MessageInput/dictionary.d.ts.map +1 -1
- package/dist/views/MessageInput/dictionary.js +2 -0
- package/dist/views/MessageInput/dictionary.js.map +1 -1
- package/dist/views/Workspaces.d.ts.map +1 -1
- package/dist/views/Workspaces.js +49 -38
- package/dist/views/Workspaces.js.map +1 -1
- package/package.json +2 -2
- package/src/StackspotAIWidget.tsx +10 -3
- package/src/app-metadata.json +2 -2
- package/src/assets/placeholder.png +0 -0
- package/src/components/AgentCard/dictionary.ts +19 -0
- package/src/components/AgentCard/index.tsx +37 -0
- package/src/images.d.ts +5 -0
- package/src/state/types.ts +1 -0
- package/src/views/Home/index.tsx +9 -2
- package/src/views/Home/types.ts +6 -0
- package/src/views/MessageInput/AgentSelector.tsx +2 -1
- package/src/views/MessageInput/ButtonAgent.tsx +1 -0
- package/src/views/MessageInput/ButtonGroup.tsx +3 -3
- package/src/views/MessageInput/dictionary.ts +2 -0
- package/src/views/Workspaces.tsx +51 -40
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [1.16.0](https://github.com/stack-spot/portal-ai-chat-widget/compare/ai-chat-widget@v1.15.0...ai-chat-widget@v1.16.0) (2025-04-24)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* Init default agents ([#116](https://github.com/stack-spot/portal-ai-chat-widget/issues/116)) ([95bffb9](https://github.com/stack-spot/portal-ai-chat-widget/commit/95bffb9b38ee1377e31c2b7b1d15243eb851bf2c))
|
|
9
|
+
|
|
10
|
+
## [1.15.0](https://github.com/stack-spot/portal-ai-chat-widget/compare/ai-chat-widget@v1.14.8...ai-chat-widget@v1.15.0) (2025-04-24)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Features
|
|
14
|
+
|
|
15
|
+
* Change to space ([#117](https://github.com/stack-spot/portal-ai-chat-widget/issues/117)) ([57d0681](https://github.com/stack-spot/portal-ai-chat-widget/commit/57d06816838b8bb24fdfddc1867e5d64d7e929fc))
|
|
16
|
+
|
|
3
17
|
## [1.14.8](https://github.com/stack-spot/portal-ai-chat-widget/compare/ai-chat-widget@v1.14.7...ai-chat-widget@v1.14.8) (2025-04-23)
|
|
4
18
|
|
|
5
19
|
|
|
@@ -1,11 +1,17 @@
|
|
|
1
1
|
import { WithStyle } from '@stack-spot/portal-theme';
|
|
2
2
|
import './layout.css';
|
|
3
|
+
import { LabeledAgent } from './state/types.js';
|
|
3
4
|
import { MinimizedActions } from './types.js';
|
|
4
5
|
export interface AIWidgetProps extends WithStyle {
|
|
5
6
|
/**
|
|
6
7
|
* The name of the user currently logged in.
|
|
7
8
|
*/
|
|
8
9
|
username: string;
|
|
10
|
+
/**
|
|
11
|
+
* Initial agents to show in the chat panel when there are still no messages (home).
|
|
12
|
+
* It doesn't make a difference if this component has children.
|
|
13
|
+
*/
|
|
14
|
+
initialAgents?: LabeledAgent[];
|
|
9
15
|
/**
|
|
10
16
|
* A custom view to show when the chat has no messages to display.
|
|
11
17
|
*/
|
|
@@ -27,5 +33,5 @@ export interface AIWidgetProps extends WithStyle {
|
|
|
27
33
|
* Renders a Chat Widget according to the closest model found in the React tree (AIWidgetProvider). If no model is found, a global version
|
|
28
34
|
* of the Chat Widget will be instantiated and used.
|
|
29
35
|
*/
|
|
30
|
-
export declare const StackspotAIWidget: ({ username, minimizedActions, prefix, children, className, style, hasHeader }: AIWidgetProps) => import("react/jsx-runtime").JSX.Element;
|
|
36
|
+
export declare const StackspotAIWidget: ({ username, initialAgents, minimizedActions, prefix, children, className, style, hasHeader }: AIWidgetProps) => import("react/jsx-runtime").JSX.Element;
|
|
31
37
|
//# sourceMappingURL=StackspotAIWidget.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StackspotAIWidget.d.ts","sourceRoot":"","sources":["../src/StackspotAIWidget.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAe,SAAS,EAAE,MAAM,0BAA0B,CAAA;AAKjE,OAAO,cAAc,CAAA;AAGrB,OAAO,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAA;AAiB1C,MAAM,WAAW,aAAc,SAAQ,SAAS;IAC9C;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B;;OAEG;IACH,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACzB;;OAEG;IACH,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;IACpC;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED;;;GAGG;AACH,eAAO,MAAM,iBAAiB,
|
|
1
|
+
{"version":3,"file":"StackspotAIWidget.d.ts","sourceRoot":"","sources":["../src/StackspotAIWidget.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAe,SAAS,EAAE,MAAM,0BAA0B,CAAA;AAKjE,OAAO,cAAc,CAAA;AAGrB,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AAC5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAA;AAiB1C,MAAM,WAAW,aAAc,SAAQ,SAAS;IAC9C;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;;OAGG;IACH,aAAa,CAAC,EAAE,YAAY,EAAE,CAAC;IAC/B;;OAEG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B;;OAEG;IACH,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACzB;;OAEG;IACH,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;IACpC;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED;;;GAGG;AACH,eAAO,MAAM,iBAAiB,iGAE5B,aAAa,4CA8Cd,CAAA"}
|
|
@@ -26,7 +26,7 @@ import { Workspaces } from './views/Workspaces.js';
|
|
|
26
26
|
* Renders a Chat Widget according to the closest model found in the React tree (AIWidgetProvider). If no model is found, a global version
|
|
27
27
|
* of the Chat Widget will be instantiated and used.
|
|
28
28
|
*/
|
|
29
|
-
export const StackspotAIWidget = ({ username, minimizedActions = {}, prefix, children, className, style, hasHeader = true }) => {
|
|
29
|
+
export const StackspotAIWidget = ({ username, initialAgents, minimizedActions = {}, prefix, children, className, style, hasHeader = true }) => {
|
|
30
30
|
const rightPanelRef = useRef(null);
|
|
31
31
|
const chatWindowRef = useRef(null);
|
|
32
32
|
const currentChat = useCurrentChatMessages();
|
|
@@ -36,6 +36,7 @@ export const StackspotAIWidget = ({ username, minimizedActions = {}, prefix, chi
|
|
|
36
36
|
const features = useCurrentChatState('features');
|
|
37
37
|
return useMemo(() => (_jsx(FallbackBoundary, { children: _jsx(TooltipProvider, { children: _jsx(RightPanelProvider, { chatWindow: chatWindowRef, panel: rightPanelRef, children: _jsxs("div", { className: listToClass(['ai-chat-widget', isMinimized && 'minimized', className]), translate: "no", style: style, children: [_jsxs("div", { className: "chat-window", ref: chatWindowRef, children: [hasHeader && _jsx(_Fragment, { children: isMinimized
|
|
38
38
|
? _jsx(MinimizedHeader, { ...minimizedActions })
|
|
39
|
-
: _jsx(ChatTabSelection, {}) }), _jsxs("div", { className: "chat-container", children: [_jsxs("div", { className: "chat-content", children: [prefix, isCurrentChatEmpty ? (children ?? _jsx(Home, { username: username
|
|
39
|
+
: _jsx(ChatTabSelection, {}) }), _jsxs("div", { className: "chat-container", children: [_jsxs("div", { className: "chat-content", children: [prefix, isCurrentChatEmpty ? (children ?? _jsx(Home, { username: username, initialAgents: initialAgents })) :
|
|
40
|
+
_jsx(Chat, { username: username })] }), features.messageInput && _jsx(MessageInput, {})] })] }), _jsx(Stacks, {}), !isTrial && _jsx(Workspaces, {}), _jsx(KnowledgeSources, {}), _jsx(KSDocument, {}), _jsx(Agents, {}), _jsx(Editor, {}), _jsx(ChatHistory, {}), _jsx(Steps, {}), _jsx(Tools, {}), _jsx("div", { className: "chat-right-panel", ref: rightPanelRef, children: _jsx(RightPanel, {}) })] }) }) }) })), [isCurrentChatEmpty, username, isMinimized, children, initialAgents]);
|
|
40
41
|
};
|
|
41
42
|
//# sourceMappingURL=StackspotAIWidget.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StackspotAIWidget.js","sourceRoot":"","sources":["../src/StackspotAIWidget.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,WAAW,EAAa,MAAM,0BAA0B,CAAA;AACjE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAA;AACvC,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAA;AAChE,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AACtD,OAAO,EAAE,sBAAsB,EAAE,mBAAmB,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAC7F,OAAO,cAAc,CAAA;AACrB,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAA;AACrD,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAA;
|
|
1
|
+
{"version":3,"file":"StackspotAIWidget.js","sourceRoot":"","sources":["../src/StackspotAIWidget.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,WAAW,EAAa,MAAM,0BAA0B,CAAA;AACjE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAA;AACvC,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAA;AAChE,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AACtD,OAAO,EAAE,sBAAsB,EAAE,mBAAmB,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAC7F,OAAO,cAAc,CAAA;AACrB,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAA;AACrD,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAA;AAGrE,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAA;AACrD,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAA;AACvC,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AACnC,OAAO,EAAE,WAAW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 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stack-spot/ai-chat-widget",
|
|
3
|
-
"version": "1.
|
|
4
|
-
"date": "
|
|
3
|
+
"version": "1.16.0",
|
|
4
|
+
"date": "Thu Apr 24 2025 18:23:19 GMT+0000 (Coordinated Universal Time)",
|
|
5
5
|
"dependencies": [
|
|
6
6
|
{
|
|
7
7
|
"name": "@stack-spot/app-metadata",
|
|
Binary file
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export declare const dictionary: {
|
|
2
|
+
en: {
|
|
3
|
+
builtin: string;
|
|
4
|
+
personal: string;
|
|
5
|
+
account: string;
|
|
6
|
+
shared: string;
|
|
7
|
+
agent: string;
|
|
8
|
+
};
|
|
9
|
+
pt: {
|
|
10
|
+
builtin: string;
|
|
11
|
+
personal: string;
|
|
12
|
+
account: string;
|
|
13
|
+
shared: string;
|
|
14
|
+
agent: string;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=dictionary.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dictionary.d.ts","sourceRoot":"","sources":["../../../src/components/AgentCard/dictionary.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;CAeD,CAAA"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export const dictionary = {
|
|
2
|
+
en: {
|
|
3
|
+
builtin: 'Built-in',
|
|
4
|
+
personal: 'Personal',
|
|
5
|
+
account: 'Account',
|
|
6
|
+
shared: 'Shared',
|
|
7
|
+
agent: 'Agent',
|
|
8
|
+
},
|
|
9
|
+
pt: {
|
|
10
|
+
builtin: 'Embutido',
|
|
11
|
+
personal: 'Personal',
|
|
12
|
+
account: 'Conta',
|
|
13
|
+
shared: 'Compartilhado',
|
|
14
|
+
agent: 'Agente',
|
|
15
|
+
},
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=dictionary.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dictionary.js","sourceRoot":"","sources":["../../../src/components/AgentCard/dictionary.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB,EAAE,EAAE;QACF,OAAO,EAAE,UAAU;QACnB,QAAQ,EAAE,UAAU;QACpB,OAAO,EAAE,SAAS;QAClB,MAAM,EAAE,QAAQ;QAChB,KAAK,EAAE,OAAO;KACf;IACD,EAAE,EAAE;QACF,OAAO,EAAE,UAAU;QACnB,QAAQ,EAAE,UAAU;QACpB,OAAO,EAAE,OAAO;QAChB,MAAM,EAAE,eAAe;QACvB,KAAK,EAAE,QAAQ;KAChB;CACmB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/AgentCard/index.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAGhD,eAAO,MAAM,SAAS,cAAe;IAAE,KAAK,EAAE,YAAY,CAAA;CAAE,4CA4B3D,CAAA"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Box, Image, Text } from '@citric/core';
|
|
3
|
+
import { Card } from '@citric/ui';
|
|
4
|
+
import { useTranslate } from '@stack-spot/portal-translate';
|
|
5
|
+
import placeholder from '../../assets/placeholder.png';
|
|
6
|
+
import { useCurrentChat } from '../../context/hooks.js';
|
|
7
|
+
import { dictionary } from './dictionary.js';
|
|
8
|
+
export const AgentCard = ({ agent }) => {
|
|
9
|
+
const t = useTranslate(dictionary);
|
|
10
|
+
const chat = useCurrentChat();
|
|
11
|
+
const onSelectAgent = () => {
|
|
12
|
+
chat.set('agent', agent);
|
|
13
|
+
};
|
|
14
|
+
return _jsxs(Card, { onClick: onSelectAgent, sx: { cursor: 'pointer' }, children: [_jsx(Box, { mb: 4, children: _jsx(Image, { width: 125, height: 130, sx: { borderRadius: '8px' }, src: agent.image ? agent.image : placeholder }) }), agent.visibility_level && _jsxs(Box, { children: [_jsx(Text, { appearance: "microtext1", colorScheme: "light.700", children: t[agent.visibility_level.toLowerCase()] }), "\u00A0", _jsx(Text, { appearance: "microtext1", children: t.agent })] }), _jsx(Text, { appearance: "h6", children: agent.label })] });
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/AgentCard/index.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AAC/C,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAA;AACjC,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAA;AAC3D,OAAO,WAAW,MAAM,8BAA8B,CAAA;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA;AAEpD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAEzC,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,EAAE,KAAK,EAA2B,EAAE,EAAE;IAC9D,MAAM,CAAC,GAAG,YAAY,CAAC,UAAU,CAAC,CAAA;IAClC,MAAM,IAAI,GAAG,cAAc,EAAE,CAAA;IAE7B,MAAM,aAAa,GAAG,GAAG,EAAE;QACzB,IAAI,CAAC,GAAG,CACN,OAAO,EACP,KAAK,CACN,CAAA;IACH,CAAC,CAAA;IAED,OAAO,MAAC,IAAI,IAAC,OAAO,EAAE,aAAa,EAAE,EAAE,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE,aAC5D,KAAC,GAAG,IAAC,EAAE,EAAE,CAAC,YACR,KAAC,KAAK,IAAC,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,EAAE,EAAE,EAAE,YAAY,EAAE,KAAK,EAAE,EAAE,GAAG,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,WAAW,GAAI,GACzG,EACL,KAAK,CAAC,gBAAgB,IAAI,MAAC,GAAG,eAC7B,KAAC,IAAI,IAAC,UAAU,EAAC,YAAY,EAAC,WAAW,EAAC,WAAW,YAClD,CAAC,CAAC,KAAK,CAAC,gBAAgB,CAAC,WAAW,EAAoB,CAAC,GACrD,YAEP,KAAC,IAAI,IAAC,UAAU,EAAC,YAAY,YAC1B,CAAC,CAAC,KAAK,GACH,IACH,EACN,KAAC,IAAI,IAAC,UAAU,EAAC,IAAI,YAClB,KAAK,CAAC,KAAK,GACP,IACF,CAAA;AACT,CAAC,CAAA"}
|
package/dist/state/types.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/state/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,OAAO;IACtB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,gBAAiB,SAAQ,OAAO;IAC/C,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,YAAa,SAAQ,gBAAgB;IACpD,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/state/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,OAAO;IACtB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,gBAAiB,SAAQ,OAAO;IAC/C,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,YAAa,SAAQ,gBAAgB;IACpD,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B"}
|
|
@@ -4,5 +4,5 @@ import { HomeProps } from './types.js';
|
|
|
4
4
|
*
|
|
5
5
|
* The home page can be replaced by providing children to the component `StackspotAIWidget`.
|
|
6
6
|
*/
|
|
7
|
-
export declare const Home: (props: HomeProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export declare const Home: ({ initialAgents, ...props }: HomeProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
8
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/views/Home/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/views/Home/index.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAA;AAEnC;;;;GAIG;AACH,eAAO,MAAM,IAAI,gCAAiC,SAAS,4CAa1D,CAAA"}
|
package/dist/views/Home/index.js
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Flex } from '@citric/core';
|
|
3
|
+
import { AgentCard } from '../../components/AgentCard/index.js';
|
|
2
4
|
import { FallbackBoundary } from '../../components/FallbackBoundary/index.js';
|
|
3
5
|
import { useCurrentChatState } from '../../context/hooks.js';
|
|
4
6
|
import { BuiltInAgent } from './BuiltInAgent.js';
|
|
@@ -8,8 +10,9 @@ import { CustomAgent } from './CustomAgent.js';
|
|
|
8
10
|
*
|
|
9
11
|
* The home page can be replaced by providing children to the component `StackspotAIWidget`.
|
|
10
12
|
*/
|
|
11
|
-
export const Home = (props) => {
|
|
13
|
+
export const Home = ({ initialAgents, ...props }) => {
|
|
12
14
|
const agent = useCurrentChatState('agent');
|
|
13
|
-
|
|
15
|
+
const isAgentEnabled = useCurrentChatState('features').agent;
|
|
16
|
+
return (_jsxs(FallbackBoundary, { children: [agent && !agent.builtIn ? _jsx(CustomAgent, {}) : _jsx(BuiltInAgent, { ...props }), !!initialAgents && isAgentEnabled && _jsx(Flex, { sx: { gap: '8px' }, alignItems: "center", justifyContent: "center", children: initialAgents.map((agent) => _jsx(AgentCard, { agent: agent }, agent.id)) })] }));
|
|
14
17
|
};
|
|
15
18
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/views/Home/index.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAA;AACpE,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAA;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAC7C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAG3C;;;;GAIG;AACH,MAAM,CAAC,MAAM,IAAI,GAAG,CAAC,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/views/Home/index.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AACnC,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAA;AACtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAA;AACpE,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAA;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAC7C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAG3C;;;;GAIG;AACH,MAAM,CAAC,MAAM,IAAI,GAAG,CAAC,EAAE,aAAa,EAAE,GAAG,KAAK,EAAa,EAAE,EAAE;IAC7D,MAAM,KAAK,GAAG,mBAAmB,CAAC,OAAO,CAAC,CAAA;IAC1C,MAAM,cAAc,GAAG,mBAAmB,CAAC,UAAU,CAAC,CAAC,KAAK,CAAA;IAE5D,OAAO,CACL,MAAC,gBAAgB,eACd,KAAK,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,KAAC,WAAW,KAAG,CAAC,CAAC,CAAC,KAAC,YAAY,OAAK,KAAK,GAAI,EACvE,CAAC,CAAC,aAAa,IAAI,cAAc,IAAI,KAAC,IAAI,IAAC,EAAE,EAAE,EAAE,GAAG,EAAE,KAAK,EAAE,EAAE,UAAU,EAAC,QAAQ,EAAC,cAAc,EAAC,QAAQ,YACxG,aAAa,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAC,SAAS,IAAgB,KAAK,EAAE,KAAK,IAAtB,KAAK,CAAC,EAAE,CAAkB,CAAC,GACpE,IAEU,CACpB,CAAA;AACH,CAAC,CAAA"}
|
|
@@ -1,7 +1,12 @@
|
|
|
1
|
+
import { LabeledAgent } from '../../state/types.js';
|
|
1
2
|
export interface HomeProps {
|
|
2
3
|
/**
|
|
3
4
|
* The name of the user currently logged in.
|
|
4
5
|
*/
|
|
5
6
|
username: string;
|
|
7
|
+
/**
|
|
8
|
+
* Initial agents to show in home.
|
|
9
|
+
*/
|
|
10
|
+
initialAgents?: LabeledAgent[];
|
|
6
11
|
}
|
|
7
12
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/views/Home/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,SAAS;IACxB;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/views/Home/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAEhD,MAAM,WAAW,SAAS;IACxB;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,aAAa,CAAC,EAAE,YAAY,EAAE,CAAC;CAChC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AgentSelector.d.ts","sourceRoot":"","sources":["../../../src/views/MessageInput/AgentSelector.tsx"],"names":[],"mappings":"AAoBA,eAAO,MAAM,aAAa,0BAA2B;IAAE,OAAO,EAAE,OAAO,CAAC;IACtE,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC,mBAAmB,GAAG,gBAAgB,CAAC,CAAC;CAAE,
|
|
1
|
+
{"version":3,"file":"AgentSelector.d.ts","sourceRoot":"","sources":["../../../src/views/MessageInput/AgentSelector.tsx"],"names":[],"mappings":"AAoBA,eAAO,MAAM,aAAa,0BAA2B;IAAE,OAAO,EAAE,OAAO,CAAC;IACtE,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC,mBAAmB,GAAG,gBAAgB,CAAC,CAAC;CAAE,4CAsDrE,CAAA"}
|
|
@@ -22,7 +22,8 @@ export const AgentSelector = ({ inputRef, isTrial }) => {
|
|
|
22
22
|
const newValue = `@${agent.slug}`;
|
|
23
23
|
chat.set('nextMessage', undefined);
|
|
24
24
|
const isBuiltIn = agent.visibility_level === 'builtIn' || builtInsAgents.some((builtInAgent) => builtInAgent.id === agent.id);
|
|
25
|
-
chat.set('agent', { id: agent.id, label: agent.name, image: agent.avatar, slug: agent.slug,
|
|
25
|
+
chat.set('agent', { id: agent.id, label: agent.name, image: agent.avatar, slug: agent.slug,
|
|
26
|
+
builtIn: isBuiltIn, visibility_level: agent.visibility_level });
|
|
26
27
|
if (!inputRef.current)
|
|
27
28
|
return;
|
|
28
29
|
inputRef.current.value = newValue;
|
|
@@ -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,C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"AAUA,eAAO,MAAM,WAAW,+
|
|
1
|
+
{"version":3,"file":"ButtonAgent.d.ts","sourceRoot":"","sources":["../../../src/views/MessageInput/ButtonAgent.tsx"],"names":[],"mappings":"AAUA,eAAO,MAAM,WAAW,+CAkDvB,CAAA"}
|
|
@@ -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,MAAM,4BAA4B,CAAA;AACxD,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACjC,OAAO,EAAE,cAAc,EAAE,mBAAmB,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AACpF,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAClD,OAAO,EAAE,yBAAyB,EAAE,MAAM,cAAc,CAAA;AAExD,MAAM,CAAC,MAAM,WAAW,GAAG,GAAG,EAAE;IAC9B,MAAM,CAAC,GAAG,yBAAyB,EAAE,CAAA;IACrC,MAAM,CAAC,aAAa,CAAC,GAAG,WAAW,CAAC,YAAY,CAAC,gBAAgB,CAAC,EAAE,CAAC,CAAA;IACrE,MAAM,YAAY,GAAG,aAAa,EAAE,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,cAAc,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAA;IAC/E,MAAM,MAAM,GAAG,SAAS,EAAE,CAAA;IAC1B,MAAM,IAAI,GAAG,cAAc,EAAE,CAAA;IAC7B,MAAM,KAAK,GAAG,mBAAmB,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AAC,CAAC,MAAM,EAAE,SAAS,EAAC,sBAAsB,EAAC,OAAO,EAAE,eAAe,aACxF,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,cAAK,GAAG,EAAE,KAAK,CAAC,KAAK,EAAE,SAAS,EAAC,OAAO,GAAG,CAAC,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"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { ChevronRight, Code, KnowledgeSource, Send, Stack, Times
|
|
2
|
+
import { ChevronRight, Circle, Code, KnowledgeSource, Send, Stack, Times } from '@citric/icons';
|
|
3
3
|
import { IconButton } from '@citric/ui';
|
|
4
4
|
import { listToClass } from '@stack-spot/portal-theme';
|
|
5
5
|
import { useEffect, useRef } from 'react';
|
|
@@ -29,6 +29,6 @@ export const ButtonGroup = ({ onSend, onCancel, expanded, setExpanded, isLoading
|
|
|
29
29
|
},
|
|
30
30
|
// don't use the whole features object here, it would make every chat tab change rerun this effect.
|
|
31
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.
|
|
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.space, title: t.space, onClick: () => widget.set('panel', 'workspace'), children: _jsx(Circle, {}) })), 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
33
|
};
|
|
34
34
|
//# sourceMappingURL=ButtonGroup.js.map
|
|
@@ -1 +1 @@
|
|
|
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,KAAK,EAAE,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"ButtonGroup.js","sourceRoot":"","sources":["../../../src/views/MessageInput/ButtonGroup.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,EAAE,IAAI,EAAE,eAAe,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAA;AAC/F,OAAO,EAAE,UAAU,EAA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AC,IAAI,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,OAAO,EAAE,QAAQ,CAAC,YACzF,KAAC,IAAI,KAAG,GACG,CACd,IACG,EACN,KAAC,UAAU,IACT,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,EACvC,SAAS,EAAE,WAAW,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,IAAI,WAAW,CAAC,CAAC,gBAChD,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,EAC5C,OAAO,EAAE,GAAG,EAAE,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,YAEnC,KAAC,YAAY,KAAG,GACL,IACZ,EACF,SAAS,CAAC,CAAC,CAAC,CACX,KAAC,UAAU,kBAAa,CAAC,CAAC,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAC,MAAM,EAAC,KAAK,EAAE,CAAC,CAAC,MAAM,YACnF,KAAC,KAAK,KAAG,GACE,CACd,CAAC,CAAC,CAAC,CACF,KAAC,UAAU,kBAAa,CAAC,CAAC,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,SAAS,EAAC,MAAM,EAAC,KAAK,EAAE,CAAC,CAAC,IAAI,YAC7E,KAAC,IAAI,KAAG,GACG,CACd,IACG,CACP,CAAA;AACH,CAAC,CAAA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const useMessageInputDictionary: () => Record<"code" | "placeholder" | "selected" | "send" | "cancel" | "stack" | "workspace" | "knowledgeSource" | "agent" | "remove" | "collapse" | "expand" | "removeConfig" | "removeStack" | "removeWorkspace" | "removeKS" | "removeSelection", string>;
|
|
1
|
+
export declare const useMessageInputDictionary: () => Record<"code" | "placeholder" | "selected" | "send" | "cancel" | "stack" | "workspace" | "knowledgeSource" | "agent" | "remove" | "space" | "collapse" | "expand" | "removeConfig" | "removeStack" | "removeWorkspace" | "removeKS" | "removeSelection", string>;
|
|
2
2
|
//# sourceMappingURL=dictionary.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dictionary.d.ts","sourceRoot":"","sources":["../../../src/views/MessageInput/dictionary.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"dictionary.d.ts","sourceRoot":"","sources":["../../../src/views/MessageInput/dictionary.ts"],"names":[],"mappings":"AA6CA,eAAO,MAAM,yBAAyB,wQAAiC,CAAA"}
|
|
@@ -4,6 +4,7 @@ const dictionary = {
|
|
|
4
4
|
stack: 'Select stack',
|
|
5
5
|
code: 'Open code editor',
|
|
6
6
|
workspace: 'Select workspace',
|
|
7
|
+
space: 'Select space',
|
|
7
8
|
knowledgeSource: 'Select knowledge sources',
|
|
8
9
|
agent: 'Select agent',
|
|
9
10
|
collapse: 'Hide buttons',
|
|
@@ -23,6 +24,7 @@ const dictionary = {
|
|
|
23
24
|
stack: 'Selecionar stack',
|
|
24
25
|
code: 'Abrir editor de código',
|
|
25
26
|
workspace: 'Selecionar workspace',
|
|
27
|
+
space: 'Select Space',
|
|
26
28
|
knowledgeSource: 'Selecionar knowledge sources',
|
|
27
29
|
agent: 'Selecionar agente',
|
|
28
30
|
collapse: 'Esconder botões',
|
|
@@ -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,GAAG;IACjB,EAAE,EAAE;QACF,KAAK,EAAE,cAAc;QACrB,IAAI,EAAE,kBAAkB;QACxB,SAAS,EAAE,kBAAkB;QAC7B,eAAe,EAAE,0BAA0B;QAC3C,KAAK,EAAE,cAAc;QACrB,QAAQ,EAAE,cAAc;QACxB,MAAM,EAAE,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,cAAc;QACtB,IAAI,EAAE,cAAc;QACpB,WAAW,EAAE,eAAe;QAC5B,MAAM,EAAE,QAAQ;QAChB,YAAY,EAAE,8BAA8B;QAC5C,WAAW,EAAE,8BAA8B;QAC3C,eAAe,EAAE,kCAAkC;QACnD,QAAQ,EAAE,kCAAkC;QAC5C,QAAQ,EAAE,UAAU;QACpB,eAAe,EAAE,+BAA+B;QAChD,MAAM,EAAE,QAAQ;KACjB;IACD,EAAE,EAAE;QACF,KAAK,EAAE,kBAAkB;QACzB,IAAI,EAAE,wBAAwB;QAC9B,SAAS,EAAE,sBAAsB;QACjC,KAAK,EAAE,cAAc;QACrB,eAAe,EAAE,8BAA8B;QAC/C,KAAK,EAAE,mBAAmB;QAC1B,QAAQ,EAAE,iBAAiB;QAC3B,MAAM,EAAE,gBAAgB;QACxB,IAAI,EAAE,iBAAiB;QACvB,WAAW,EAAE,kBAAkB;QAC/B,MAAM,EAAE,UAAU;QAClB,YAAY,EAAE,gCAAgC;QAC9C,WAAW,EAAE,6BAA6B;QAC1C,eAAe,EAAE,iCAAiC;QAClD,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":"Workspaces.d.ts","sourceRoot":"","sources":["../../src/views/Workspaces.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Workspaces.d.ts","sourceRoot":"","sources":["../../src/views/Workspaces.tsx"],"names":[],"mappings":"AAcA;;GAEG;AACH,eAAO,MAAM,UAAU,YActB,CAAA"}
|
package/dist/views/Workspaces.js
CHANGED
|
@@ -2,9 +2,10 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
2
2
|
import { Button } from '@citric/core';
|
|
3
3
|
import { Search } from '@citric/icons';
|
|
4
4
|
import { Placeholder } from '@stack-spot/portal-components/Placeholder';
|
|
5
|
-
import {
|
|
5
|
+
import { workspaceAiClient } from '@stack-spot/portal-network';
|
|
6
6
|
import { useTranslate } from '@stack-spot/portal-translate';
|
|
7
7
|
import { useEffect, useMemo, useState } from 'react';
|
|
8
|
+
import { ButtonFavorite } from '../components/ButtonFavorite.js';
|
|
8
9
|
import { DescribedRadioGroup } from '../components/form/DescribedRadioGroup.js';
|
|
9
10
|
import { IconInput } from '../components/IconInput.js';
|
|
10
11
|
import { RightPanelTabs } from '../components/RightPanelTabs.js';
|
|
@@ -29,73 +30,83 @@ const WorkspacesPanel = () => {
|
|
|
29
30
|
const t = useTranslate(dictionary);
|
|
30
31
|
const chat = useCurrentChat();
|
|
31
32
|
return _jsx(RightPanelTabs, { tabs: [
|
|
32
|
-
|
|
33
|
-
{ title: t.all, content: _jsx(WorkspaceSourcesTab, {}, "all") },
|
|
33
|
+
{ title: t.favorites, content: _jsx(WorkspaceSourcesTab, { visibility: "favorite" }, "favorite") },
|
|
34
|
+
{ title: t.all, content: _jsx(WorkspaceSourcesTab, { visibility: "all" }, "all") },
|
|
34
35
|
] }, chat.id);
|
|
35
36
|
};
|
|
36
|
-
const WorkspaceSourcesTab = () => {
|
|
37
|
+
const WorkspaceSourcesTab = ({ visibility }) => {
|
|
37
38
|
const t = useTranslate(dictionary);
|
|
38
39
|
const { close } = useRightPanel();
|
|
39
40
|
const chat = useCurrentChat();
|
|
40
41
|
const [filter, setFilter] = useState('');
|
|
41
|
-
|
|
42
|
-
// const [value, setValue] = useState<WorkspaceResponse | undefined>(workspaces.find(w => w.id === chat.get('workspace')?.id))
|
|
43
|
-
const workspaces = workspaceClient.workspaces.useQuery({ aclOnly: false });
|
|
42
|
+
const workspaces = workspaceAiClient.workspacesAi.useQuery({ visibility });
|
|
44
43
|
const [value, setValue] = useState(workspaces.find(w => w.id === chat.get('workspace')?.id));
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
//
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
//
|
|
64
|
-
|
|
65
|
-
|
|
44
|
+
const listFavorites = workspaceAiClient.workspacesAi.useQuery({ visibility: 'favorite' });
|
|
45
|
+
const [addFavorite, pendingAddFav] = workspaceAiClient.addFavoriteWorkspaceAi.useMutation();
|
|
46
|
+
const [removeFavorite, pendingRemoveFav] = workspaceAiClient.removeFavoriteWorkspaceAi.useMutation();
|
|
47
|
+
// eslint-disable-next-line no-async-promise-executor
|
|
48
|
+
const onAddFavorite = async (idOrSlug) => new Promise(async (resolve, reject) => {
|
|
49
|
+
try {
|
|
50
|
+
await addFavorite({ workspaceId: idOrSlug });
|
|
51
|
+
await workspaceAiClient.workspacesAi.invalidate();
|
|
52
|
+
if (!pendingAddFav) {
|
|
53
|
+
resolve(true);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
catch (error) {
|
|
57
|
+
// eslint-disable-next-line no-console
|
|
58
|
+
console.error(error);
|
|
59
|
+
reject(error);
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
// eslint-disable-next-line no-async-promise-executor
|
|
63
|
+
const onRemoveFavorite = (idOrSlug) => new Promise(async (resolve, reject) => {
|
|
64
|
+
try {
|
|
65
|
+
await removeFavorite({ workspaceId: idOrSlug });
|
|
66
|
+
await workspaceAiClient.workspacesAi.invalidate();
|
|
67
|
+
if (!pendingRemoveFav) {
|
|
68
|
+
resolve(true);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
catch (error) {
|
|
72
|
+
// eslint-disable-next-line no-console
|
|
73
|
+
console.error(error);
|
|
74
|
+
reject(error);
|
|
75
|
+
}
|
|
76
|
+
});
|
|
66
77
|
const filtered = useMemo(
|
|
67
78
|
// Recreate the list so that the favorites list is taken into account
|
|
68
|
-
() => filter ? workspaces.filter(w => w === value || w.name.toLocaleLowerCase().includes(filter.toLocaleLowerCase())) : workspaces, [workspaces, filter, value]);
|
|
79
|
+
() => filter ? workspaces.filter(w => w === value || w.name.toLocaleLowerCase().includes(filter.toLocaleLowerCase())) : [...workspaces], [workspaces, filter, value, listFavorites]);
|
|
69
80
|
function submit() {
|
|
70
81
|
if (value)
|
|
71
82
|
chat.set('workspace', { id: value.id, label: value.name });
|
|
72
83
|
close();
|
|
73
84
|
}
|
|
74
|
-
return (_jsxs(_Fragment, { children: [_jsxs("div", { className: "content", children: [_jsx(IconInput, { icon: _jsx(Search, {}), value: filter, onChange: setFilter, className: "search" }), !!filtered.length && _jsx(DescribedRadioGroup, { options: filtered, keygen: w => w.id, value: value, onChange: setValue, renderLabel: w => w.name, renderDescription: w => w.description, optionClassName: w => (w === value && filter && !w.name.toLocaleLowerCase().includes(filter.toLocaleLowerCase()))
|
|
85
|
+
return (_jsxs(_Fragment, { children: [_jsxs("div", { className: "content", children: [_jsx(IconInput, { icon: _jsx(Search, {}), value: filter, onChange: setFilter, className: "search" }), !!filtered.length && _jsx(DescribedRadioGroup, { options: filtered, keygen: w => w.id, value: value, onChange: setValue, renderLabel: w => w.name, renderDescription: w => w.description, renderAfterElement: ({ id }) => _jsx(ButtonFavorite, { favorite: { idOrSlug: id, listFavorites, onAddFavorite, onRemoveFavorite } }), optionClassName: w => (w === value && filter && !w.name.toLocaleLowerCase().includes(filter.toLocaleLowerCase()))
|
|
75
86
|
? 'filtered-out'
|
|
76
87
|
: '', className: "option-list" }), !!workspaces.length && !filtered.length &&
|
|
77
88
|
_jsx(Placeholder, { title: t.noSearchResults, description: t.noSearchResultsDescription, className: "no-data-placeholder" }), !workspaces.length && _jsx(Placeholder, { title: t.noData, description: t.noDataDescription })] }), !!filtered.length && _jsx(Button, { onClick: submit, disabled: !value, children: t.apply })] }));
|
|
78
89
|
};
|
|
79
90
|
const dictionary = {
|
|
80
91
|
en: {
|
|
81
|
-
title: '
|
|
82
|
-
description: 'By selecting a
|
|
92
|
+
title: 'Spaces',
|
|
93
|
+
description: 'By selecting a space, its Knowledge Sources (KSs), Agents, Quick Commands and Stacks Ai will be consulted to generate the answers.',
|
|
83
94
|
apply: 'Apply',
|
|
84
95
|
noSearchResults: "Your search didn't yield results.",
|
|
85
96
|
noSearchResultsDescription: 'Please, try another search term.',
|
|
86
|
-
noData: 'There are no
|
|
87
|
-
noDataDescription: 'Use the AI portal to create new
|
|
97
|
+
noData: 'There are no spaces yet.',
|
|
98
|
+
noDataDescription: 'Use the AI portal to create new spaces.',
|
|
88
99
|
all: 'All',
|
|
89
100
|
favorites: 'Favorites',
|
|
90
101
|
},
|
|
91
102
|
pt: {
|
|
92
|
-
title: '
|
|
93
|
-
description: 'Ao selecionar um
|
|
103
|
+
title: 'Spaces',
|
|
104
|
+
description: 'Ao selecionar um space, seus Knowledge Sources (KSs), Agentes, Quick Commands e Stacks Ai serão consultados para gerar as respostas.',
|
|
94
105
|
apply: 'Aplicar',
|
|
95
106
|
noSearchResults: 'Sua busca não produziu resultados',
|
|
96
107
|
noSearchResultsDescription: 'Por favor, tente outra busca.',
|
|
97
|
-
noData: 'Ainda não há
|
|
98
|
-
noDataDescription: 'Use o Portal AI para criar novos
|
|
108
|
+
noData: 'Ainda não há spaces.',
|
|
109
|
+
noDataDescription: 'Use o Portal AI para criar novos spaces.',
|
|
99
110
|
all: 'Todos',
|
|
100
111
|
favorites: 'Favoritos',
|
|
101
112
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Workspaces.js","sourceRoot":"","sources":["../../src/views/Workspaces.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AACrC,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AACtC,OAAO,EAAE,WAAW,EAAE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C;QAC9D,MAAM,EAAE,0BAA0B;QAClC,iBAAiB,EAAE,yCAAyC;QAC5D,GAAG,EAAE,KAAK;QACV,SAAS,EAAE,WAAW;KACvB;IACD,EAAE,EAAE;QACF,KAAK,EAAE,QAAQ;QACf,WAAW,EAAE,sIAAsI;QACnJ,KAAK,EAAE,SAAS;QAChB,eAAe,EAAE,mCAAmC;QACpD,0BAA0B,EAAE,+BAA+B;QAC3D,MAAM,EAAE,sBAAsB;QAC9B,iBAAiB,EAAE,0CAA0C;QAC7D,GAAG,EAAE,OAAO;QACZ,SAAS,EAAE,WAAW;KACvB;CACmB,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stack-spot/ai-chat-widget",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.16.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
7
|
"scripts": {
|
|
8
|
-
"build": "rimraf dist && pnpm generate:metadata && tsc && tsc-esm-fix --target='dist' && cpy src/layout.css dist --flat",
|
|
8
|
+
"build": "rimraf dist && pnpm generate:metadata && tsc && tsc-esm-fix --target='dist' && cpy src/layout.css dist --flat && cpy src/assets/**/*.png dist/assets",
|
|
9
9
|
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
|
|
10
10
|
"generate:metadata": "pnpm app-metadata --lockfile ../../pnpm-lock.yaml --path packages/widget"
|
|
11
11
|
},
|
|
@@ -6,6 +6,7 @@ import { useCurrentChatMessages, useCurrentChatState, useWidgetState } from './c
|
|
|
6
6
|
import './layout.css'
|
|
7
7
|
import { RightPanel } from './right-panel/RightPanel'
|
|
8
8
|
import { RightPanelProvider } from './right-panel/RightPanelProvider'
|
|
9
|
+
import { LabeledAgent } from './state/types'
|
|
9
10
|
import { MinimizedActions } from './types'
|
|
10
11
|
import { checkIsTrial } from './utils/check-is-trial'
|
|
11
12
|
import { Agents } from './views/Agents'
|
|
@@ -28,6 +29,11 @@ export interface AIWidgetProps extends WithStyle {
|
|
|
28
29
|
* The name of the user currently logged in.
|
|
29
30
|
*/
|
|
30
31
|
username: string,
|
|
32
|
+
/**
|
|
33
|
+
* Initial agents to show in the chat panel when there are still no messages (home).
|
|
34
|
+
* It doesn't make a difference if this component has children.
|
|
35
|
+
*/
|
|
36
|
+
initialAgents?: LabeledAgent[],
|
|
31
37
|
/**
|
|
32
38
|
* A custom view to show when the chat has no messages to display.
|
|
33
39
|
*/
|
|
@@ -50,7 +56,7 @@ export interface AIWidgetProps extends WithStyle {
|
|
|
50
56
|
* Renders a Chat Widget according to the closest model found in the React tree (AIWidgetProvider). If no model is found, a global version
|
|
51
57
|
* of the Chat Widget will be instantiated and used.
|
|
52
58
|
*/
|
|
53
|
-
export const StackspotAIWidget = ({ username, minimizedActions = {}, prefix,
|
|
59
|
+
export const StackspotAIWidget = ({ username, initialAgents, minimizedActions = {}, prefix,
|
|
54
60
|
children, className, style, hasHeader = true }:
|
|
55
61
|
AIWidgetProps) => {
|
|
56
62
|
const rightPanelRef = useRef<HTMLDivElement>(null)
|
|
@@ -77,7 +83,8 @@ export const StackspotAIWidget = ({ username, minimizedActions = {}, prefix,
|
|
|
77
83
|
<div className="chat-container">
|
|
78
84
|
<div className="chat-content">
|
|
79
85
|
{prefix}
|
|
80
|
-
{isCurrentChatEmpty ? (children ?? <Home username={username} />) :
|
|
86
|
+
{isCurrentChatEmpty ? (children ?? <Home username={username} initialAgents={initialAgents}/>) :
|
|
87
|
+
<Chat username={username} />}
|
|
81
88
|
</div>
|
|
82
89
|
{features.messageInput && <MessageInput />}
|
|
83
90
|
</div>
|
|
@@ -96,5 +103,5 @@ export const StackspotAIWidget = ({ username, minimizedActions = {}, prefix,
|
|
|
96
103
|
</RightPanelProvider>
|
|
97
104
|
</TooltipProvider>
|
|
98
105
|
</FallbackBoundary>
|
|
99
|
-
), [isCurrentChatEmpty, username, isMinimized, children])
|
|
106
|
+
), [isCurrentChatEmpty, username, isMinimized, children, initialAgents])
|
|
100
107
|
}
|
package/src/app-metadata.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stack-spot/ai-chat-widget",
|
|
3
|
-
"version": "1.
|
|
4
|
-
"date": "
|
|
3
|
+
"version": "1.16.0",
|
|
4
|
+
"date": "Thu Apr 24 2025 18:23:19 GMT+0000 (Coordinated Universal Time)",
|
|
5
5
|
"dependencies": [
|
|
6
6
|
{
|
|
7
7
|
"name": "@stack-spot/app-metadata",
|
|
Binary file
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Dictionary } from '@stack-spot/portal-translate'
|
|
2
|
+
|
|
3
|
+
export const dictionary = {
|
|
4
|
+
en: {
|
|
5
|
+
builtin: 'Built-in',
|
|
6
|
+
personal: 'Personal',
|
|
7
|
+
account: 'Account',
|
|
8
|
+
shared: 'Shared',
|
|
9
|
+
agent: 'Agent',
|
|
10
|
+
},
|
|
11
|
+
pt: {
|
|
12
|
+
builtin: 'Embutido',
|
|
13
|
+
personal: 'Personal',
|
|
14
|
+
account: 'Conta',
|
|
15
|
+
shared: 'Compartilhado',
|
|
16
|
+
agent: 'Agente',
|
|
17
|
+
},
|
|
18
|
+
} satisfies Dictionary
|
|
19
|
+
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { Box, Image, Text } from '@citric/core'
|
|
2
|
+
import { Card } from '@citric/ui'
|
|
3
|
+
import { useTranslate } from '@stack-spot/portal-translate'
|
|
4
|
+
import placeholder from '../../assets/placeholder.png'
|
|
5
|
+
import { useCurrentChat } from '../../context/hooks'
|
|
6
|
+
import { LabeledAgent } from '../../state/types'
|
|
7
|
+
import { dictionary } from './dictionary'
|
|
8
|
+
|
|
9
|
+
export const AgentCard = ({ agent }: { agent: LabeledAgent }) => {
|
|
10
|
+
const t = useTranslate(dictionary)
|
|
11
|
+
const chat = useCurrentChat()
|
|
12
|
+
|
|
13
|
+
const onSelectAgent = () => {
|
|
14
|
+
chat.set(
|
|
15
|
+
'agent',
|
|
16
|
+
agent,
|
|
17
|
+
)
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
return <Card onClick={onSelectAgent} sx={{ cursor: 'pointer' }}>
|
|
21
|
+
<Box mb={4}>
|
|
22
|
+
<Image width={125} height={130} sx={{ borderRadius: '8px' }} src={agent.image ? agent.image : placeholder} />
|
|
23
|
+
</Box>
|
|
24
|
+
{agent.visibility_level && <Box>
|
|
25
|
+
<Text appearance="microtext1" colorScheme="light.700">
|
|
26
|
+
{t[agent.visibility_level.toLowerCase() as keyof typeof t]}
|
|
27
|
+
</Text>
|
|
28
|
+
|
|
29
|
+
<Text appearance="microtext1">
|
|
30
|
+
{t.agent}
|
|
31
|
+
</Text>
|
|
32
|
+
</Box>}
|
|
33
|
+
<Text appearance="h6">
|
|
34
|
+
{agent.label}
|
|
35
|
+
</Text>
|
|
36
|
+
</Card>
|
|
37
|
+
}
|
package/src/images.d.ts
ADDED
package/src/state/types.ts
CHANGED
package/src/views/Home/index.tsx
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { Flex } from '@citric/core'
|
|
2
|
+
import { AgentCard } from '../../components/AgentCard'
|
|
1
3
|
import { FallbackBoundary } from '../../components/FallbackBoundary'
|
|
2
4
|
import { useCurrentChatState } from '../../context/hooks'
|
|
3
5
|
import { BuiltInAgent } from './BuiltInAgent'
|
|
@@ -9,12 +11,17 @@ import { HomeProps } from './types'
|
|
|
9
11
|
*
|
|
10
12
|
* The home page can be replaced by providing children to the component `StackspotAIWidget`.
|
|
11
13
|
*/
|
|
12
|
-
export const Home = (props: HomeProps) => {
|
|
14
|
+
export const Home = ({ initialAgents, ...props }: HomeProps) => {
|
|
13
15
|
const agent = useCurrentChatState('agent')
|
|
14
|
-
|
|
16
|
+
const isAgentEnabled = useCurrentChatState('features').agent
|
|
17
|
+
|
|
15
18
|
return (
|
|
16
19
|
<FallbackBoundary>
|
|
17
20
|
{agent && !agent.builtIn ? <CustomAgent /> : <BuiltInAgent {...props} />}
|
|
21
|
+
{!!initialAgents && isAgentEnabled && <Flex sx={{ gap: '8px' }} alignItems="center" justifyContent="center">
|
|
22
|
+
{initialAgents.map((agent) => <AgentCard key={agent.id} agent={agent} />)}
|
|
23
|
+
</Flex>
|
|
24
|
+
}
|
|
18
25
|
</FallbackBoundary>
|
|
19
26
|
)
|
|
20
27
|
}
|
package/src/views/Home/types.ts
CHANGED
|
@@ -33,7 +33,8 @@ export const AgentSelector = ({ inputRef, isTrial }: { isTrial: boolean,
|
|
|
33
33
|
const isBuiltIn = agent.visibility_level === 'builtIn' || builtInsAgents.some((builtInAgent) => builtInAgent.id === agent.id)
|
|
34
34
|
chat.set(
|
|
35
35
|
'agent',
|
|
36
|
-
{ id: agent.id, label: agent.name, image: agent.avatar, slug: agent.slug,
|
|
36
|
+
{ id: agent.id, label: agent.name, image: agent.avatar, slug: agent.slug,
|
|
37
|
+
builtIn: isBuiltIn, visibility_level: agent.visibility_level },
|
|
37
38
|
)
|
|
38
39
|
|
|
39
40
|
if (!inputRef.current) return
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ChevronRight, Code, KnowledgeSource, Send, Stack, Times
|
|
1
|
+
import { ChevronRight, Circle, Code, KnowledgeSource, Send, Stack, Times } from '@citric/icons'
|
|
2
2
|
import { IconButton } from '@citric/ui'
|
|
3
3
|
import { listToClass } from '@stack-spot/portal-theme'
|
|
4
4
|
import { useEffect, useRef } from 'react'
|
|
@@ -62,8 +62,8 @@ export const ButtonGroup = ({ onSend, onCancel, expanded, setExpanded, isLoading
|
|
|
62
62
|
style={{ width: expanded ? featureButtonsWidth.current : 0 }}
|
|
63
63
|
>
|
|
64
64
|
{features.workspace && (
|
|
65
|
-
<IconButton aria-label={t.
|
|
66
|
-
<
|
|
65
|
+
<IconButton aria-label={t.space} title={t.space} onClick={() => widget.set('panel', 'workspace')}>
|
|
66
|
+
<Circle />
|
|
67
67
|
</IconButton>
|
|
68
68
|
)}
|
|
69
69
|
{features.knowledgeSource && (
|
|
@@ -5,6 +5,7 @@ const dictionary = {
|
|
|
5
5
|
stack: 'Select stack',
|
|
6
6
|
code: 'Open code editor',
|
|
7
7
|
workspace: 'Select workspace',
|
|
8
|
+
space: 'Select space',
|
|
8
9
|
knowledgeSource: 'Select knowledge sources',
|
|
9
10
|
agent: 'Select agent',
|
|
10
11
|
collapse: 'Hide buttons',
|
|
@@ -24,6 +25,7 @@ const dictionary = {
|
|
|
24
25
|
stack: 'Selecionar stack',
|
|
25
26
|
code: 'Abrir editor de código',
|
|
26
27
|
workspace: 'Selecionar workspace',
|
|
28
|
+
space: 'Select Space',
|
|
27
29
|
knowledgeSource: 'Selecionar knowledge sources',
|
|
28
30
|
agent: 'Selecionar agente',
|
|
29
31
|
collapse: 'Esconder botões',
|
package/src/views/Workspaces.tsx
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { Button } from '@citric/core'
|
|
2
2
|
import { Search } from '@citric/icons'
|
|
3
3
|
import { Placeholder } from '@stack-spot/portal-components/Placeholder'
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
4
|
+
import { workspaceAiClient } from '@stack-spot/portal-network'
|
|
5
|
+
import { WorkspaceResponse, WorkspaceVisibilityLevelEnum } from '@stack-spot/portal-network/api/workspace-ai'
|
|
6
6
|
import { Dictionary, useTranslate } from '@stack-spot/portal-translate'
|
|
7
7
|
import { useEffect, useMemo, useState } from 'react'
|
|
8
|
+
import { ButtonFavorite } from '../components/ButtonFavorite'
|
|
8
9
|
import { DescribedRadioGroup } from '../components/form/DescribedRadioGroup'
|
|
9
10
|
import { IconInput } from '../components/IconInput'
|
|
10
11
|
import { RightPanelTabs } from '../components/RightPanelTabs'
|
|
@@ -35,50 +36,58 @@ const WorkspacesPanel = () => {
|
|
|
35
36
|
const chat = useCurrentChat()
|
|
36
37
|
|
|
37
38
|
return <RightPanelTabs key={chat.id} tabs={[
|
|
38
|
-
|
|
39
|
-
{ title: t.all, content: <WorkspaceSourcesTab key="all" /> },
|
|
39
|
+
{ title: t.favorites, content: <WorkspaceSourcesTab key="favorite" visibility="favorite" /> },
|
|
40
|
+
{ title: t.all, content: <WorkspaceSourcesTab key="all" visibility="all" /> },
|
|
40
41
|
]}
|
|
41
42
|
/>
|
|
42
43
|
}
|
|
43
44
|
|
|
44
|
-
const WorkspaceSourcesTab = () => {
|
|
45
|
+
const WorkspaceSourcesTab = ({ visibility }: {visibility: WorkspaceVisibilityLevelEnum}) => {
|
|
45
46
|
const t = useTranslate(dictionary)
|
|
46
47
|
const { close } = useRightPanel()
|
|
47
48
|
const chat = useCurrentChat()
|
|
48
49
|
const [filter, setFilter] = useState('')
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
const
|
|
50
|
+
const workspaces = workspaceAiClient.workspacesAi.useQuery({ visibility })
|
|
51
|
+
const [value, setValue] = useState<WorkspaceResponse | undefined>(workspaces.find(w => w.id === chat.get('workspace')?.id))
|
|
52
|
+
const listFavorites = workspaceAiClient.workspacesAi.useQuery({ visibility: 'favorite' })
|
|
52
53
|
|
|
53
|
-
const [
|
|
54
|
-
|
|
54
|
+
const [addFavorite, pendingAddFav] = workspaceAiClient.addFavoriteWorkspaceAi.useMutation()
|
|
55
|
+
const [removeFavorite, pendingRemoveFav] = workspaceAiClient.removeFavoriteWorkspaceAi.useMutation()
|
|
55
56
|
|
|
56
|
-
//
|
|
57
|
-
|
|
57
|
+
// eslint-disable-next-line no-async-promise-executor
|
|
58
|
+
const onAddFavorite = async(idOrSlug: string) => new Promise<boolean>(async (resolve, reject) => {
|
|
59
|
+
try {
|
|
60
|
+
await addFavorite({ workspaceId: idOrSlug })
|
|
61
|
+
await workspaceAiClient.workspacesAi.invalidate()
|
|
62
|
+
if (!pendingAddFav) {
|
|
63
|
+
resolve(true)
|
|
64
|
+
}
|
|
65
|
+
} catch (error) {
|
|
66
|
+
// eslint-disable-next-line no-console
|
|
67
|
+
console.error(error)
|
|
68
|
+
reject(error)
|
|
69
|
+
}
|
|
70
|
+
})
|
|
58
71
|
|
|
59
|
-
//
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
// // eslint-disable-next-line no-console
|
|
74
|
-
// console.error(error)
|
|
75
|
-
// }
|
|
76
|
-
// }
|
|
72
|
+
// eslint-disable-next-line no-async-promise-executor
|
|
73
|
+
const onRemoveFavorite = (idOrSlug: string) => new Promise<boolean>(async (resolve, reject) => {
|
|
74
|
+
try {
|
|
75
|
+
await removeFavorite({ workspaceId: idOrSlug })
|
|
76
|
+
await workspaceAiClient.workspacesAi.invalidate()
|
|
77
|
+
if (!pendingRemoveFav) {
|
|
78
|
+
resolve(true)
|
|
79
|
+
}
|
|
80
|
+
} catch (error) {
|
|
81
|
+
// eslint-disable-next-line no-console
|
|
82
|
+
console.error(error)
|
|
83
|
+
reject(error)
|
|
84
|
+
}
|
|
85
|
+
})
|
|
77
86
|
|
|
78
87
|
const filtered = useMemo(
|
|
79
88
|
// Recreate the list so that the favorites list is taken into account
|
|
80
|
-
() => filter ? workspaces.filter(w => w === value || w.name.toLocaleLowerCase().includes(filter.toLocaleLowerCase())) : workspaces,
|
|
81
|
-
[workspaces, filter, value],
|
|
89
|
+
() => filter ? workspaces.filter(w => w === value || w.name.toLocaleLowerCase().includes(filter.toLocaleLowerCase())) : [...workspaces],
|
|
90
|
+
[workspaces, filter, value, listFavorites],
|
|
82
91
|
)
|
|
83
92
|
|
|
84
93
|
function submit() {
|
|
@@ -96,6 +105,8 @@ const WorkspaceSourcesTab = () => {
|
|
|
96
105
|
onChange={setValue}
|
|
97
106
|
renderLabel={w => w.name}
|
|
98
107
|
renderDescription={w => w.description}
|
|
108
|
+
renderAfterElement={({ id }) =>
|
|
109
|
+
<ButtonFavorite favorite={{ idOrSlug: id, listFavorites, onAddFavorite, onRemoveFavorite }} />}
|
|
99
110
|
optionClassName={w => (w === value && filter && !w.name.toLocaleLowerCase().includes(filter.toLocaleLowerCase()))
|
|
100
111
|
? 'filtered-out'
|
|
101
112
|
: ''
|
|
@@ -113,24 +124,24 @@ const WorkspaceSourcesTab = () => {
|
|
|
113
124
|
|
|
114
125
|
const dictionary = {
|
|
115
126
|
en: {
|
|
116
|
-
title: '
|
|
117
|
-
description: 'By selecting a
|
|
127
|
+
title: 'Spaces',
|
|
128
|
+
description: 'By selecting a space, its Knowledge Sources (KSs), Agents, Quick Commands and Stacks Ai will be consulted to generate the answers.',
|
|
118
129
|
apply: 'Apply',
|
|
119
130
|
noSearchResults: "Your search didn't yield results.",
|
|
120
131
|
noSearchResultsDescription: 'Please, try another search term.',
|
|
121
|
-
noData: 'There are no
|
|
122
|
-
noDataDescription: 'Use the AI portal to create new
|
|
132
|
+
noData: 'There are no spaces yet.',
|
|
133
|
+
noDataDescription: 'Use the AI portal to create new spaces.',
|
|
123
134
|
all: 'All',
|
|
124
135
|
favorites: 'Favorites',
|
|
125
136
|
},
|
|
126
137
|
pt: {
|
|
127
|
-
title: '
|
|
128
|
-
description: 'Ao selecionar um
|
|
138
|
+
title: 'Spaces',
|
|
139
|
+
description: 'Ao selecionar um space, seus Knowledge Sources (KSs), Agentes, Quick Commands e Stacks Ai serão consultados para gerar as respostas.',
|
|
129
140
|
apply: 'Aplicar',
|
|
130
141
|
noSearchResults: 'Sua busca não produziu resultados',
|
|
131
142
|
noSearchResultsDescription: 'Por favor, tente outra busca.',
|
|
132
|
-
noData: 'Ainda não há
|
|
133
|
-
noDataDescription: 'Use o Portal AI para criar novos
|
|
143
|
+
noData: 'Ainda não há spaces.',
|
|
144
|
+
noDataDescription: 'Use o Portal AI para criar novos spaces.',
|
|
134
145
|
all: 'Todos',
|
|
135
146
|
favorites: 'Favoritos',
|
|
136
147
|
},
|