@stack-spot/ai-chat-widget 1.22.0 → 1.23.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +15 -0
- package/dist/StackspotAIWidget.d.ts +5 -1
- package/dist/StackspotAIWidget.d.ts.map +1 -1
- package/dist/StackspotAIWidget.js +2 -2
- package/dist/StackspotAIWidget.js.map +1 -1
- package/dist/app-metadata.json +2 -2
- package/dist/components/AgentCard/AgentCardCreate.d.ts +4 -0
- package/dist/components/AgentCard/AgentCardCreate.d.ts.map +1 -0
- package/dist/components/AgentCard/AgentCardCreate.js +34 -0
- package/dist/components/AgentCard/AgentCardCreate.js.map +1 -0
- package/dist/components/AgentCard/dictionary.d.ts +2 -0
- package/dist/components/AgentCard/dictionary.d.ts.map +1 -1
- package/dist/components/AgentCard/dictionary.js +2 -0
- package/dist/components/AgentCard/dictionary.js.map +1 -1
- package/dist/components/Code.d.ts.map +1 -1
- package/dist/components/Code.js +44 -15
- package/dist/components/Code.js.map +1 -1
- package/dist/components/QuickStartButton.d.ts +1 -7
- package/dist/components/QuickStartButton.d.ts.map +1 -1
- package/dist/components/QuickStartButton.js +4 -44
- package/dist/components/QuickStartButton.js.map +1 -1
- package/dist/components/TabManager.d.ts.map +1 -1
- package/dist/components/TabManager.js +5 -2
- package/dist/components/TabManager.js.map +1 -1
- package/dist/layout.css +17 -1
- package/dist/types.d.ts +2 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/views/ChatTabSelection.d.ts.map +1 -1
- package/dist/views/ChatTabSelection.js +5 -2
- package/dist/views/ChatTabSelection.js.map +1 -1
- package/dist/views/Home/BuiltInAgent.d.ts.map +1 -1
- package/dist/views/Home/BuiltInAgent.js +5 -6
- package/dist/views/Home/BuiltInAgent.js.map +1 -1
- package/dist/views/Home/CustomAgent.d.ts.map +1 -1
- package/dist/views/Home/CustomAgent.js +1 -2
- package/dist/views/Home/CustomAgent.js.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 +3 -8
- package/dist/views/Home/index.js.map +1 -1
- package/dist/views/Home/styled.d.ts.map +1 -1
- package/dist/views/Home/styled.js +26 -12
- package/dist/views/Home/styled.js.map +1 -1
- package/dist/views/Home/types.d.ts +4 -0
- package/dist/views/Home/types.d.ts.map +1 -1
- package/dist/views/MessageInput/ButtonBar.d.ts +1 -5
- package/dist/views/MessageInput/ButtonBar.d.ts.map +1 -1
- package/dist/views/MessageInput/ButtonBar.js +2 -2
- package/dist/views/MessageInput/ButtonBar.js.map +1 -1
- package/dist/views/MessageInput/SelectContent.d.ts.map +1 -1
- package/dist/views/MessageInput/SelectContent.js +2 -2
- package/dist/views/MessageInput/SelectContent.js.map +1 -1
- package/dist/views/MessageInput/index.js +1 -1
- package/dist/views/MessageInput/index.js.map +1 -1
- package/dist/views/MessageInput/styled.d.ts +1 -3
- package/dist/views/MessageInput/styled.d.ts.map +1 -1
- package/dist/views/MessageInput/styled.js +4 -5
- package/dist/views/MessageInput/styled.js.map +1 -1
- package/package.json +1 -1
- package/src/StackspotAIWidget.tsx +6 -1
- package/src/app-metadata.json +2 -2
- package/src/components/AgentCard/AgentCardCreate.tsx +45 -0
- package/src/components/AgentCard/dictionary.ts +2 -0
- package/src/components/Code.tsx +91 -51
- package/src/components/QuickStartButton.tsx +9 -57
- package/src/components/TabManager.tsx +28 -12
- package/src/layout.css +17 -1
- package/src/types.ts +2 -1
- package/src/views/ChatTabSelection.tsx +5 -2
- package/src/views/Home/BuiltInAgent.tsx +7 -15
- package/src/views/Home/CustomAgent.tsx +0 -3
- package/src/views/Home/index.tsx +3 -7
- package/src/views/Home/styled.ts +26 -12
- package/src/views/Home/types.ts +4 -0
- package/src/views/MessageInput/ButtonBar.tsx +2 -6
- package/src/views/MessageInput/SelectContent.tsx +3 -2
- package/src/views/MessageInput/index.tsx +2 -2
- package/src/views/MessageInput/styled.ts +5 -6
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { theme } from '@stack-spot/portal-theme';
|
|
2
|
+
import { Text } from '@citric/core';
|
|
3
|
+
import { FaceSmile, KnowledgeSource, QuickCommand, StackSpot } from '@citric/icons';
|
|
5
4
|
import { useTranslate } from '@stack-spot/portal-translate';
|
|
6
5
|
import { QuickStartButton } from '../../components/QuickStartButton.js';
|
|
7
6
|
import { useCurrentChat } from '../../context/hooks.js';
|
|
@@ -16,12 +15,12 @@ export const BuiltInAgent = ({ username }) => {
|
|
|
16
15
|
function send(message) {
|
|
17
16
|
chat.pushMessage(ChatEntry.createUserEntry(message));
|
|
18
17
|
}
|
|
19
|
-
return (_jsxs(HomeBox, { className: "home-page", children: [_jsxs("h2",
|
|
18
|
+
return (_jsxs(HomeBox, { className: "home-page", children: [_jsxs(Text, { appearance: "h2", className: "title", children: [t.hello, ", ", username] }), _jsx(Text, { appearance: "h3", className: "subtitle", children: t.subtitle }), _jsxs("div", { className: "shortcuts", children: [_jsx(QuickStartButton, { label: t['question.meta'], onClick: () => send(t['question.meta']), icon: _jsx(StackSpot, {}) }), _jsx(QuickStartButton, { label: t['question.ks'], onClick: () => send(t['question.ks']), icon: _jsx(KnowledgeSource, {}) }), _jsx(QuickStartButton, { label: t['question.agents'], onClick: () => send(t['question.agents']), icon: _jsx(FaceSmile, {}) }), _jsx(QuickStartButton, { label: t['question.qc'], onClick: () => send(t['question.qc']), icon: _jsx(QuickCommand, {}) })] })] }));
|
|
20
19
|
};
|
|
21
20
|
const dictionary = {
|
|
22
21
|
en: {
|
|
23
22
|
hello: 'Hello',
|
|
24
|
-
subtitle:
|
|
23
|
+
subtitle: 'What really matters takes time, let us help you with the rest.',
|
|
25
24
|
'question.meta': 'What is StackSpot AI?',
|
|
26
25
|
'question.ks': 'What are Knowledge Sources?',
|
|
27
26
|
'question.agents': 'How do Agents work?',
|
|
@@ -29,7 +28,7 @@ const dictionary = {
|
|
|
29
28
|
},
|
|
30
29
|
pt: {
|
|
31
30
|
hello: 'Olá',
|
|
32
|
-
subtitle: '
|
|
31
|
+
subtitle: 'O que realmente importa leva tempo, deixe que a gente cuide do resto.',
|
|
33
32
|
'question.meta': 'O que é a StackSpot AI?',
|
|
34
33
|
'question.ks': 'O que são Knowledge Sources?',
|
|
35
34
|
'question.agents': 'Como funcionam os agentes?',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BuiltInAgent.js","sourceRoot":"","sources":["../../../src/views/Home/BuiltInAgent.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"BuiltInAgent.js","sourceRoot":"","sources":["../../../src/views/Home/BuiltInAgent.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AACnC,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AACnF,OAAO,EAAc,YAAY,EAAE,MAAM,8BAA8B,CAAA;AACvE,OAAO,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAA;AACpE,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA;AACpD,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAA;AACjD,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAA;AAGlC;;GAEG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,EAAE,QAAQ,EAAa,EAAE,EAAE;IACtD,MAAM,CAAC,GAAG,YAAY,CAAC,UAAU,CAAC,CAAA;IAClC,MAAM,IAAI,GAAG,cAAc,EAAE,CAAA;IAE7B,SAAS,IAAI,CAAC,OAAe;QAC3B,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC,CAAA;IACtD,CAAC;IAED,OAAO,CACL,MAAC,OAAO,I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KAC1C;IACD,EAAE,EAAE;QACF,KAAK,EAAE,KAAK;QACZ,QAAQ,EAAE,uEAAuE;QACjF,eAAe,EAAE,yBAAyB;QAC1C,aAAa,EAAE,8BAA8B;QAC7C,iBAAiB,EAAE,4BAA4B;QAC/C,aAAa,EAAE,2BAA2B;KAC3C;CACmB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CustomAgent.d.ts","sourceRoot":"","sources":["../../../src/views/Home/CustomAgent.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CustomAgent.d.ts","sourceRoot":"","sources":["../../../src/views/Home/CustomAgent.tsx"],"names":[],"mappings":"AASA;;GAEG;AACH,eAAO,MAAM,WAAW,+CAuBvB,CAAA"}
|
|
@@ -2,7 +2,6 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { IconBox, Text } from '@citric/core';
|
|
3
3
|
import { Agent } from '@citric/icons';
|
|
4
4
|
import { agentClient } from '@stack-spot/portal-network';
|
|
5
|
-
import { theme } from '@stack-spot/portal-theme';
|
|
6
5
|
import { useMemo } from 'react';
|
|
7
6
|
import { QuickStartButton } from '../../components/QuickStartButton.js';
|
|
8
7
|
import { useCurrentChat, useCurrentChatState } from '../../context/hooks.js';
|
|
@@ -15,7 +14,7 @@ export const CustomAgent = () => {
|
|
|
15
14
|
const { id, label, image } = useCurrentChatState('agent') ?? {};
|
|
16
15
|
const [agent] = agentClient.agent.useStatefulQuery({ agentId: id });
|
|
17
16
|
const chat = useCurrentChat();
|
|
18
|
-
const suggestions = useMemo(() => agent?.suggested_prompts?.map((prompt, index) => (_jsx(QuickStartButton, { label: prompt, onClick: () => send(prompt)
|
|
17
|
+
const suggestions = useMemo(() => agent?.suggested_prompts?.map((prompt, index) => (_jsx(QuickStartButton, { label: prompt, onClick: () => send(prompt) }, index))), [agent?.suggested_prompts]);
|
|
19
18
|
function send(message) {
|
|
20
19
|
chat.pushMessage(ChatEntry.createUserEntry(message));
|
|
21
20
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CustomAgent.js","sourceRoot":"","sources":["../../../src/views/Home/CustomAgent.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AAC5C,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAA;AACrC,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAA;AACxD,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"CustomAgent.js","sourceRoot":"","sources":["../../../src/views/Home/CustomAgent.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AAC5C,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAA;AACrC,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAA;AACxD,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAA;AAC/B,OAAO,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAA;AACpE,OAAO,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAA;AACzE,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAA;AACjD,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAA;AAElC;;GAEG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,GAAG,EAAE;IAC9B,MAAM,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,GAAG,mBAAmB,CAAC,OAAO,CAAC,IAAI,EAAE,CAAA;IAC/D,MAAM,CAAC,KAAK,CAAC,GAAG,WAAW,CAAC,KAAK,CAAC,gBAAgB,CAAC,EAAE,OAAO,EAAE,EAAG,EAAE,CAAC,CAAA;IACpE,MAAM,IAAI,GAAG,cAAc,EAAE,CAAA;IAC7B,MAAM,WAAW,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC,KAAK,EAAE,iBAAiB,EAAE,GAAG,CAAC,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE,CAAC,CACjF,KAAC,gBAAgB,IAEf,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,IAFtB,KAAK,CAGV,CACH,CAAC,EAAE,CAAC,KAAK,EAAE,iBAAiB,CAAC,CAAC,CAAA;IAE/B,SAAS,IAAI,CAAC,OAAe;QAC3B,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC,CAAA;IACtD,CAAC;IAED,OAAO,CACL,MAAC,OAAO,IAAC,SAAS,EAAC,wBAAwB,aACxC,KAAK,CAAC,CAAC,CAAC,cAAK,GAAG,EAAE,KAAK,EAAE,SAAS,EAAC,QAAQ,GAAG,CAAC,CAAC,CAAC,KAAC,OAAO,IAAC,SAAS,EAAC,QAAQ,YAAC,KAAC,KAAK,KAAG,GAAU,EACjG,KAAC,IAAI,IAAC,UAAU,EAAC,IAAI,YAAE,KAAK,GAAQ,EACpC,cAAK,SAAS,EAAC,WAAW,YAAE,WAAW,EAAE,MAAM,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI,GAAO,IACnE,CACX,CAAA;AACH,CAAC,CAAA"}
|
|
@@ -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: ({ initialAgents, ...props }: HomeProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export declare const Home: ({ initialAgents, urlCreateAgent, ...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":"AAQA,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAA;AAenC;;;;GAIG;AACH,eAAO,MAAM,IAAI,gDAAiD,SAAS,4CAiB1E,CAAA"}
|
package/dist/views/Home/index.js
CHANGED
|
@@ -2,6 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { FadingOverflow } from '@stack-spot/portal-components/FadingOverflow';
|
|
3
3
|
import { styled } from 'styled-components';
|
|
4
4
|
import { AgentCard } from '../../components/AgentCard/index.js';
|
|
5
|
+
import { AgentCardCreate } from '../../components/AgentCard/AgentCardCreate.js';
|
|
5
6
|
import { FallbackBoundary } from '../../components/FallbackBoundary/index.js';
|
|
6
7
|
import { useCurrentChatState } from '../../context/hooks.js';
|
|
7
8
|
import { BuiltInAgent } from './BuiltInAgent.js';
|
|
@@ -16,12 +17,6 @@ const AgentList = styled.ul `
|
|
|
16
17
|
|
|
17
18
|
li {
|
|
18
19
|
flex-shrink: 0;
|
|
19
|
-
&:first-child {
|
|
20
|
-
margin-left: auto;
|
|
21
|
-
}
|
|
22
|
-
&:last-child {
|
|
23
|
-
margin-right: auto;
|
|
24
|
-
}
|
|
25
20
|
}
|
|
26
21
|
`;
|
|
27
22
|
/**
|
|
@@ -29,9 +24,9 @@ const AgentList = styled.ul `
|
|
|
29
24
|
*
|
|
30
25
|
* The home page can be replaced by providing children to the component `StackspotAIWidget`.
|
|
31
26
|
*/
|
|
32
|
-
export const Home = ({ initialAgents, ...props }) => {
|
|
27
|
+
export const Home = ({ initialAgents, urlCreateAgent, ...props }) => {
|
|
33
28
|
const agent = useCurrentChatState('agent');
|
|
34
29
|
const isAgentEnabled = useCurrentChatState('features').agent;
|
|
35
|
-
return (_jsxs(FallbackBoundary, { children: [agent && !agent.builtIn ? _jsx(CustomAgent, {}) : _jsx(BuiltInAgent, { ...props }), !!initialAgents && isAgentEnabled && (_jsx(FadingOverflow, { enableHorizontalScrollWithVerticalWheel: true, sides: ['left', 'right'], scroll: "arrows", children:
|
|
30
|
+
return (_jsxs(FallbackBoundary, { children: [agent && !agent.builtIn ? _jsx(CustomAgent, {}) : _jsx(BuiltInAgent, { ...props }), !!initialAgents && isAgentEnabled && (_jsx(FadingOverflow, { enableHorizontalScrollWithVerticalWheel: true, sides: ['left', 'right'], scroll: "arrows", children: _jsxs(AgentList, { className: "agent-list", children: [urlCreateAgent && _jsx("li", { children: _jsx(AgentCardCreate, { urlCreateAgent: urlCreateAgent }) }), initialAgents.map((agent) => _jsx("li", { children: _jsx(AgentCard, { agent: agent }) }, agent.id))] }) }))] }));
|
|
36
31
|
};
|
|
37
32
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/views/Home/index.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,8CAA8C,CAAA;AAC7E,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAA;AAC1C,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,MAAM,SAAS,GAAG,MAAM,CAAC,EAAE,CAAA
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/views/Home/index.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,8CAA8C,CAAA;AAC7E,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAA;AAC1C,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAA;AACtD,OAAO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"file":"styled.d.ts","sourceRoot":"","sources":["../../../src/views/Home/styled.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"styled.d.ts","sourceRoot":"","sources":["../../../src/views/Home/styled.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,OAAO,wOAqEnB,CAAA"}
|
|
@@ -1,11 +1,9 @@
|
|
|
1
|
+
import { theme } from '@stack-spot/portal-theme';
|
|
1
2
|
import { styled } from 'styled-components';
|
|
2
3
|
export const HomeBox = styled.div `
|
|
3
4
|
margin: auto 0;
|
|
4
5
|
|
|
5
6
|
.title, .subtitle {
|
|
6
|
-
font-family: 'San Francisco';
|
|
7
|
-
font-size: 26px;
|
|
8
|
-
font-weight: 600;
|
|
9
7
|
margin: 0;
|
|
10
8
|
}
|
|
11
9
|
|
|
@@ -13,22 +11,36 @@ export const HomeBox = styled.div `
|
|
|
13
11
|
display: inline-block;
|
|
14
12
|
background: linear-gradient(72.81deg, #FF9900 0.96%, #FF6633 100%);
|
|
15
13
|
background-clip: text;
|
|
16
|
-
margin-bottom: 10px;
|
|
17
14
|
color: transparent;
|
|
18
15
|
}
|
|
19
16
|
|
|
20
17
|
.subtitle {
|
|
21
18
|
color: #A0A0A0;
|
|
22
|
-
margin-bottom:
|
|
19
|
+
margin-bottom: 24px;
|
|
23
20
|
}
|
|
24
21
|
|
|
25
22
|
.shortcuts {
|
|
26
|
-
display: flex;
|
|
27
|
-
flex-direction: row;
|
|
28
|
-
gap: 15px;
|
|
29
23
|
li {
|
|
30
24
|
flex: 1;
|
|
31
25
|
}
|
|
26
|
+
button {
|
|
27
|
+
padding-left: 0;
|
|
28
|
+
border-radius: 50px;
|
|
29
|
+
padding-inline: 16px;
|
|
30
|
+
padding-block: 8px;
|
|
31
|
+
font-weight: 400;
|
|
32
|
+
line-height: normal;
|
|
33
|
+
border: none;
|
|
34
|
+
max-width: 30vw;
|
|
35
|
+
i {
|
|
36
|
+
width: 16px;
|
|
37
|
+
height: 16px;
|
|
38
|
+
margin-right: 8px;
|
|
39
|
+
}
|
|
40
|
+
&:hover, &:visited, &:active, &:focus {
|
|
41
|
+
background-color: ${theme.color.light[600]}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
32
44
|
}
|
|
33
45
|
|
|
34
46
|
.avatar, .avatar svg {
|
|
@@ -44,14 +56,16 @@ export const HomeBox = styled.div `
|
|
|
44
56
|
gap: 20px;
|
|
45
57
|
|
|
46
58
|
.shortcuts {
|
|
47
|
-
|
|
59
|
+
display: inline-block;
|
|
60
|
+
text-align: center;
|
|
48
61
|
button {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
62
|
+
margin-bottom: 10px;
|
|
63
|
+
margin-left: 4px;
|
|
64
|
+
margin-right: 4px;
|
|
52
65
|
p {
|
|
53
66
|
overflow: hidden;
|
|
54
67
|
}
|
|
68
|
+
|
|
55
69
|
}
|
|
56
70
|
}
|
|
57
71
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styled.js","sourceRoot":"","sources":["../../../src/views/Home/styled.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAA;AAE1C,MAAM,CAAC,MAAM,OAAO,GAAG,MAAM,CAAC,GAAG,CAAA
|
|
1
|
+
{"version":3,"file":"styled.js","sourceRoot":"","sources":["../../../src/views/Home/styled.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAA;AAChD,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAA;AAE1C,MAAM,CAAC,MAAM,OAAO,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8BAsCH,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+BnD,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
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;
|
|
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;IAC/B;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB"}
|
|
@@ -7,11 +7,7 @@ interface SelectionBarProps {
|
|
|
7
7
|
* Whether or not the message is currently being sent. This is used to decide which button to show: send or cancel.
|
|
8
8
|
*/
|
|
9
9
|
isLoading?: boolean;
|
|
10
|
-
/**
|
|
11
|
-
* State to determine whether the input is focused
|
|
12
|
-
*/
|
|
13
|
-
focused?: boolean;
|
|
14
10
|
}
|
|
15
|
-
export declare const ButtonBar: ({ onSend, isLoading
|
|
11
|
+
export declare const ButtonBar: ({ onSend, isLoading }: SelectionBarProps) => import("react/jsx-runtime").JSX.Element;
|
|
16
12
|
export {};
|
|
17
13
|
//# sourceMappingURL=ButtonBar.d.ts.map
|
|
@@ -1 +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;
|
|
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;CACrB;AAED,eAAO,MAAM,SAAS,0BAA2B,iBAAiB,4CA+BjE,CAAA"}
|
|
@@ -6,11 +6,11 @@ import { useCurrentChat, useCurrentChatState, useWidget } from '../../context/ho
|
|
|
6
6
|
import { useMessageInputDictionary } from './dictionary.js';
|
|
7
7
|
import { SelectContent } from './SelectContent.js';
|
|
8
8
|
import { SelectionBarWrapper } from './styled.js';
|
|
9
|
-
export const ButtonBar = ({ onSend, isLoading
|
|
9
|
+
export const ButtonBar = ({ onSend, isLoading }) => {
|
|
10
10
|
const t = useMessageInputDictionary();
|
|
11
11
|
const chat = useCurrentChat();
|
|
12
12
|
const widget = useWidget();
|
|
13
13
|
const features = useCurrentChatState('features');
|
|
14
|
-
return (_jsxs(SelectionBarWrapper, { className: "button-group",
|
|
14
|
+
return (_jsxs(SelectionBarWrapper, { className: "button-group", children: [_jsxs(Flex, { sx: { gap: '4px' }, 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
15
|
};
|
|
16
16
|
//# sourceMappingURL=ButtonBar.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ButtonBar.js","sourceRoot":"","sources":["../../../src/views/MessageInput/ButtonBar.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IA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E,EAAE,EAAE,GAAG,EAAE,KAAK,EAAE,aACtB,KAAC,aAAa,KAAG,EAChB,QAAQ,CAAC,MAAM,IAAI,CAClB,KAAC,UAAU,IAAC,KAAK,EAAC,OAAO,EAAC,UAAU,EAAC,QAAQ,gBAAa,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC,IAAI,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,OAAO,EAAE,QAAQ,CAAC,YAC3H,KAAC,IAAI,KAAG,GACG,CACd,IACI,EACP,KAAC,IAAI,cACF,SAAS,CAAC,CAAC,CAAC,CACX,KAAC,UAAU,IAAC,UAAU,EAAC,QAAQ,EAAC,KAAK,EAAC,SAAS,gBAAa,CAAC,CAAC,MAAM,EAClE,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,KAAK,EAAE,EAAE,SAAS,EAAC,MAAM,EAAC,KAAK,EAAE,CAAC,CAAC,MAAM,YAC7D,KAAC,IAAI,KAAG,GACG,CACd,CAAC,CAAC,CAAC,CACF,KAAC,UAAU,IAAC,UAAU,EAAC,QAAQ,EAAC,KAAK,EAAC,SAAS,gBAAa,CAAC,CAAC,IAAI,EAChE,OAAO,EAAE,MAAM,EAAE,SAAS,EAAC,MAAM,EAAC,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":"SelectContent.d.ts","sourceRoot":"","sources":["../../../src/views/MessageInput/SelectContent.tsx"],"names":[],"mappings":"AAUA,eAAO,MAAM,aAAa,
|
|
1
|
+
{"version":3,"file":"SelectContent.d.ts","sourceRoot":"","sources":["../../../src/views/MessageInput/SelectContent.tsx"],"names":[],"mappings":"AAUA,eAAO,MAAM,aAAa,sDAkEzB,CAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { KnowledgeSource, Plus, Spaces, Stack } from '@citric/icons';
|
|
3
3
|
import { IconButton } from '@citric/ui';
|
|
4
4
|
import { SelectionList } from '@stack-spot/portal-components/SelectionList';
|
|
5
5
|
import { useTranslate } from '@stack-spot/portal-translate';
|
|
@@ -42,7 +42,7 @@ export const SelectContent = () => {
|
|
|
42
42
|
})), [features, widget]);
|
|
43
43
|
if (!hasFeatureButtons)
|
|
44
44
|
return null;
|
|
45
|
-
return (_jsxs(_Fragment, { children: [_jsx(IconButton, { color: "light", appearance: "square", role: "button", title: visibleMenu ? t.collapse : t.expand, "data-test-hint": "button-options", "aria-label": visibleMenu ? t.collapse : t.expand, onClick: () => setVisibleMenu(state => !state), children: _jsx(
|
|
45
|
+
return (_jsxs(_Fragment, { children: [_jsx(IconButton, { id: "button-content-select", color: "light", appearance: "square", role: "button", title: visibleMenu ? t.collapse : t.expand, "data-test-hint": "button-options", "aria-label": visibleMenu ? t.collapse : t.expand, onClick: () => setVisibleMenu(state => !state), children: _jsx(Plus, {}) }), _jsx(SelectionList, { style: {
|
|
46
46
|
position: 'absolute',
|
|
47
47
|
top: '-140px',
|
|
48
48
|
}, id: "menuConfig", visible: visibleMenu, onHide: () => setVisibleMenu(false), items: listItems })] }));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectContent.js","sourceRoot":"","sources":["../../../src/views/MessageInput/SelectContent.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"SelectContent.js","sourceRoot":"","sources":["../../../src/views/MessageInput/SelectContent.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,eAAe,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,eAAe,CAAA;AACpE,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AACvC,OAAO,EAAE,aAAa,EAA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() => {
|
|
|
55
55
|
if (!isLoading)
|
|
56
56
|
textAreaRef.current?.focus();
|
|
57
57
|
}, [isLoading]);
|
|
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[
|
|
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[500] : theme.color.primary[500] }), _jsx(InfoBar, {}), _jsx(ButtonBar, { onSend: onSend, isLoading: isLoading })] }));
|
|
59
59
|
};
|
|
60
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,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,aAAa,CAAA;AACvC,OAAO,EAAE,2BAA2B,EAAE,MAAM,sBAAsB,CAAA;AAClE,OAAO,EAAE,yBAAyB,EAAE,MAAM,cAAc,CAAA;AACxD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAA;AAC7D,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,gBAAgB,E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AAO,EAAE,SAAS,EAC5C,eAAe,EAAE,SAAS,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,GAAI,EAChG,KAAC,OAAO,KAAG,EACX,KAAC,SAAS,IAAC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,SAAS,GAAI,IACnC,CACnB,CAAA;AACH,CAAC,CAAA"}
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
export declare const MAX_INPUT_HEIGHT = 300;
|
|
2
2
|
export declare const MIN_INPUT_HEIGHT = 24;
|
|
3
|
-
export declare const SelectionBarWrapper: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").
|
|
4
|
-
$inputFocused?: boolean;
|
|
5
|
-
}>> & string;
|
|
3
|
+
export declare const SelectionBarWrapper: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
6
4
|
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
5
|
$inputFocused?: boolean;
|
|
8
6
|
}>> & string;
|
|
@@ -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,mBAAmB
|
|
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,wOAyC/B,CAAA;AAED,eAAO,MAAM,eAAe;oBAA+B,OAAO;YAuNjE,CAAA"}
|
|
@@ -13,7 +13,6 @@ export const SelectionBarWrapper = styled.div `
|
|
|
13
13
|
background-color: ${theme.color.light[500]};
|
|
14
14
|
border-bottom-left-radius: 4px;
|
|
15
15
|
border-bottom-right-radius: 4px;
|
|
16
|
-
border: 2px solid ${({ $inputFocused }) => theme.color.light[$inputFocused ? 600 : 500]};
|
|
17
16
|
border-top: none;
|
|
18
17
|
|
|
19
18
|
.selection-list {
|
|
@@ -134,19 +133,19 @@ export const MessageInputBox = styled.div `
|
|
|
134
133
|
align-items: end;
|
|
135
134
|
border-top-left-radius: 4px;
|
|
136
135
|
border-top-right-radius: 4px;
|
|
137
|
-
border: 2px solid ${theme.color.light[
|
|
136
|
+
border: 2px solid ${theme.color.light[300]};
|
|
138
137
|
|
|
139
|
-
background-color: ${theme.color.light[
|
|
138
|
+
background-color: ${theme.color.light[300]};
|
|
140
139
|
padding: 10px 8px;
|
|
141
140
|
transition: border-color 0.3s, background-color 0.3s;
|
|
142
141
|
|
|
143
142
|
&.focused {
|
|
144
|
-
border: 2px solid ${theme.color.light[
|
|
143
|
+
border: 2px solid ${theme.color.light[300]};
|
|
145
144
|
}
|
|
146
145
|
|
|
147
146
|
|
|
148
147
|
&.disabled {
|
|
149
|
-
background-color: ${theme.color.light[
|
|
148
|
+
background-color: ${theme.color.light[300]};
|
|
150
149
|
}
|
|
151
150
|
}
|
|
152
151
|
}
|
|
@@ -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,m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AE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC;+BACpE,CAAC,EAAE,aAAa,EAAE,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;UA4BxF,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;0BA2BM,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC;;0BAEtB,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC;;;;;4BAKpB,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC;;;;;4BAKtB,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MA2D5C,UAAU;;;;;;;;;;;;;;8BAcc,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC;8BACtB,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC;;;;;;;;gCAQpB,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC;;;;;;;oBAOlC,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,YAAY;;;;;;;;;;;;;;;;;;;;cAoBpC,gBAAgB;;;;;;;;CAQ7B,CAAA"}
|
package/package.json
CHANGED
|
@@ -51,6 +51,10 @@ export interface AIWidgetProps extends WithStyle, CustomMessage {
|
|
|
51
51
|
* A boolean indicating whether or not the chat should have a visible header.
|
|
52
52
|
*/
|
|
53
53
|
hasHeader?: boolean,
|
|
54
|
+
/**
|
|
55
|
+
* URL to redirect to the "Create Agent" page on the portal
|
|
56
|
+
*/
|
|
57
|
+
urlCreateAgent?: string,
|
|
54
58
|
}
|
|
55
59
|
|
|
56
60
|
/**
|
|
@@ -69,6 +73,7 @@ export const StackspotAIWidget = (
|
|
|
69
73
|
hasHeader = true,
|
|
70
74
|
beforeMessage,
|
|
71
75
|
afterMessage,
|
|
76
|
+
urlCreateAgent,
|
|
72
77
|
}: AIWidgetProps,
|
|
73
78
|
) => {
|
|
74
79
|
const rightPanelRef = useRef<HTMLDivElement>(null)
|
|
@@ -96,7 +101,7 @@ export const StackspotAIWidget = (
|
|
|
96
101
|
<div className="chat-content">
|
|
97
102
|
{prefix}
|
|
98
103
|
{isCurrentChatEmpty
|
|
99
|
-
? (children ?? <Home username={username} initialAgents={initialAgents}/>)
|
|
104
|
+
? (children ?? <Home username={username} initialAgents={initialAgents} urlCreateAgent={urlCreateAgent} />)
|
|
100
105
|
: <Chat username={username} beforeMessage={beforeMessage} afterMessage={afterMessage} />
|
|
101
106
|
}
|
|
102
107
|
</div>
|
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.23.1",
|
|
4
|
+
"date": "Wed May 28 2025 20:03:56 GMT+0000 (Coordinated Universal Time)",
|
|
5
5
|
"dependencies": [
|
|
6
6
|
{
|
|
7
7
|
"name": "@stack-spot/app-metadata",
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { IconBox, Text } from '@citric/core'
|
|
2
|
+
import { PlusMini } from '@citric/icons'
|
|
3
|
+
import { theme } from '@stack-spot/portal-theme'
|
|
4
|
+
import { useTranslate } from '@stack-spot/portal-translate'
|
|
5
|
+
import { styled } from 'styled-components'
|
|
6
|
+
import { dictionary } from './dictionary'
|
|
7
|
+
|
|
8
|
+
const StyledCard = styled.a`
|
|
9
|
+
cursor: pointer;
|
|
10
|
+
border-radius: 8px;
|
|
11
|
+
transition: background-color 0.3s;
|
|
12
|
+
display: flex;
|
|
13
|
+
flex-direction: column;
|
|
14
|
+
gap: 12px;
|
|
15
|
+
border: 1px solid ${theme.color.light[600]};
|
|
16
|
+
text-decoration:none;
|
|
17
|
+
padding-right: 16px !important;
|
|
18
|
+
|
|
19
|
+
&:hover {
|
|
20
|
+
background-color: ${theme.color.light[500]};
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.text-box {
|
|
24
|
+
display: flex;
|
|
25
|
+
flex-direction: column;
|
|
26
|
+
gap: 2px;
|
|
27
|
+
color: ${theme.color.light['contrastText']}
|
|
28
|
+
}
|
|
29
|
+
`
|
|
30
|
+
|
|
31
|
+
export const AgentCardCreate = ({ urlCreateAgent }: { urlCreateAgent: string }) => {
|
|
32
|
+
const t = useTranslate(dictionary)
|
|
33
|
+
return (
|
|
34
|
+
<StyledCard href={urlCreateAgent} role="link" tabIndex={0} className={'agent-card'}>
|
|
35
|
+
<IconBox color="light" appearance="square" size="md">
|
|
36
|
+
<PlusMini />
|
|
37
|
+
</IconBox>
|
|
38
|
+
<div className="text-box">
|
|
39
|
+
<Text appearance="body2">
|
|
40
|
+
{`${t.create} ${t.agent}`}
|
|
41
|
+
</Text>
|
|
42
|
+
</div>
|
|
43
|
+
</StyledCard>
|
|
44
|
+
)
|
|
45
|
+
}
|
|
@@ -7,6 +7,7 @@ export const dictionary = {
|
|
|
7
7
|
account: 'Account',
|
|
8
8
|
shared: 'Shared',
|
|
9
9
|
agent: 'Agent',
|
|
10
|
+
create: 'Create',
|
|
10
11
|
},
|
|
11
12
|
pt: {
|
|
12
13
|
builtin: 'Embutido',
|
|
@@ -14,6 +15,7 @@ export const dictionary = {
|
|
|
14
15
|
account: 'Conta',
|
|
15
16
|
shared: 'Compartilhado',
|
|
16
17
|
agent: 'Agente',
|
|
18
|
+
create: 'Criar',
|
|
17
19
|
},
|
|
18
20
|
} satisfies Dictionary
|
|
19
21
|
|