@stack-spot/ai-chat-widget 1.21.2 → 1.22.0-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/CHANGELOG.md +7 -0
- package/dist/app-metadata.json +2 -2
- 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/Chat/ChatMessage.d.ts.map +1 -1
- package/dist/views/Chat/ChatMessage.js +13 -4
- package/dist/views/Chat/ChatMessage.js.map +1 -1
- package/dist/views/Chat/styled.d.ts.map +1 -1
- package/dist/views/Chat/styled.js +3 -0
- package/dist/views/Chat/styled.js.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.js +2 -2
- package/dist/views/Home/styled.d.ts.map +1 -1
- package/dist/views/Home/styled.js +20 -9
- package/dist/views/Home/styled.js.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.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/app-metadata.json +2 -2
- 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/Chat/ChatMessage.tsx +89 -14
- package/src/views/Chat/styled.ts +3 -0
- 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 +2 -2
- package/src/views/Home/styled.ts +20 -9
- package/src/views/MessageInput/ButtonBar.tsx +2 -6
- package/src/views/MessageInput/SelectContent.tsx +2 -2
- package/src/views/MessageInput/index.tsx +2 -2
- package/src/views/MessageInput/styled.ts +5 -6
|
@@ -41,13 +41,14 @@ export const ChatTabSelection = () => {
|
|
|
41
41
|
() => {
|
|
42
42
|
const actions: ButtonAction[] = [{
|
|
43
43
|
icon: <Plus />,
|
|
44
|
-
|
|
44
|
+
ariaLabel: t.newChat,
|
|
45
45
|
onClick: create,
|
|
46
46
|
}]
|
|
47
47
|
if (chatHistory) {
|
|
48
48
|
actions.push({
|
|
49
49
|
icon: <Clock />,
|
|
50
|
-
label: t.
|
|
50
|
+
label: t.history,
|
|
51
|
+
ariaLabel: t.openHistory,
|
|
51
52
|
className: 'test',
|
|
52
53
|
style: { marginLeft: 'auto' },
|
|
53
54
|
onClick: () => widget.set('panel', 'history'),
|
|
@@ -71,10 +72,12 @@ export const ChatTabSelection = () => {
|
|
|
71
72
|
|
|
72
73
|
const dictionary = {
|
|
73
74
|
en: {
|
|
75
|
+
history: 'History',
|
|
74
76
|
openHistory: 'Open chat history',
|
|
75
77
|
newChat: 'New chat',
|
|
76
78
|
},
|
|
77
79
|
pt: {
|
|
80
|
+
history: 'Histórico',
|
|
78
81
|
openHistory: 'Abrir histórico da conversa',
|
|
79
82
|
newChat: 'Novo chat',
|
|
80
83
|
},
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { theme } from '@stack-spot/portal-theme'
|
|
1
|
+
import { Text } from '@citric/core'
|
|
2
|
+
import { FaceSmile, KnowledgeSource, QuickCommand, StackSpot } from '@citric/icons'
|
|
4
3
|
import { Dictionary, useTranslate } from '@stack-spot/portal-translate'
|
|
5
4
|
import { QuickStartButton } from '../../components/QuickStartButton'
|
|
6
5
|
import { useCurrentChat } from '../../context/hooks'
|
|
@@ -21,35 +20,28 @@ export const BuiltInAgent = ({ username }: HomeProps) => {
|
|
|
21
20
|
|
|
22
21
|
return (
|
|
23
22
|
<HomeBox className="home-page">
|
|
24
|
-
<h2 className="title">{t.hello}, {username}</
|
|
25
|
-
<h3 className="subtitle">{t.subtitle}</
|
|
23
|
+
<Text appearance="h2" className="title">{t.hello}, {username}</Text>
|
|
24
|
+
<Text appearance="h3" className="subtitle">{t.subtitle}</Text>
|
|
26
25
|
<div className="shortcuts">
|
|
27
26
|
<QuickStartButton
|
|
28
27
|
label={t['question.meta']}
|
|
29
28
|
onClick={() => send(t['question.meta'])}
|
|
30
|
-
icon={<
|
|
31
|
-
background={theme.color.orange[50]}
|
|
29
|
+
icon={<StackSpot />}
|
|
32
30
|
/>
|
|
33
31
|
<QuickStartButton
|
|
34
32
|
label={t['question.ks']}
|
|
35
33
|
onClick={() => send(t['question.ks'])}
|
|
36
34
|
icon={<KnowledgeSource />}
|
|
37
|
-
background={theme.color.cyan[50]}
|
|
38
|
-
color={theme.color.cyan[600]}
|
|
39
35
|
/>
|
|
40
36
|
<QuickStartButton
|
|
41
37
|
label={t['question.agents']}
|
|
42
38
|
onClick={() => send(t['question.agents'])}
|
|
43
39
|
icon={<FaceSmile />}
|
|
44
|
-
background={theme.color.pink[50]}
|
|
45
|
-
color={theme.color.pink[600]}
|
|
46
40
|
/>
|
|
47
41
|
<QuickStartButton
|
|
48
42
|
label={t['question.qc']}
|
|
49
43
|
onClick={() => send(t['question.qc'])}
|
|
50
44
|
icon={<QuickCommand />}
|
|
51
|
-
background={theme.color.purple[50]}
|
|
52
|
-
color={theme.color.purple[600]}
|
|
53
45
|
/>
|
|
54
46
|
</div>
|
|
55
47
|
</HomeBox>
|
|
@@ -59,7 +51,7 @@ export const BuiltInAgent = ({ username }: HomeProps) => {
|
|
|
59
51
|
const dictionary = {
|
|
60
52
|
en: {
|
|
61
53
|
hello: 'Hello',
|
|
62
|
-
subtitle:
|
|
54
|
+
subtitle: 'What really matters takes time, let us help you with the rest.',
|
|
63
55
|
'question.meta': 'What is StackSpot AI?',
|
|
64
56
|
'question.ks': 'What are Knowledge Sources?',
|
|
65
57
|
'question.agents': 'How do Agents work?',
|
|
@@ -67,7 +59,7 @@ const dictionary = {
|
|
|
67
59
|
},
|
|
68
60
|
pt: {
|
|
69
61
|
hello: 'Olá',
|
|
70
|
-
subtitle: '
|
|
62
|
+
subtitle: 'O que realmente importa leva tempo, deixe que a gente cuide do resto.',
|
|
71
63
|
'question.meta': 'O que é a StackSpot AI?',
|
|
72
64
|
'question.ks': 'O que são Knowledge Sources?',
|
|
73
65
|
'question.agents': 'Como funcionam os agentes?',
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { IconBox, Text } from '@citric/core'
|
|
2
2
|
import { Agent } from '@citric/icons'
|
|
3
3
|
import { agentClient } from '@stack-spot/portal-network'
|
|
4
|
-
import { theme } from '@stack-spot/portal-theme'
|
|
5
4
|
import { useMemo } from 'react'
|
|
6
5
|
import { QuickStartButton } from '../../components/QuickStartButton'
|
|
7
6
|
import { useCurrentChat, useCurrentChatState } from '../../context/hooks'
|
|
@@ -20,8 +19,6 @@ export const CustomAgent = () => {
|
|
|
20
19
|
key={index}
|
|
21
20
|
label={prompt}
|
|
22
21
|
onClick={() => send(prompt)}
|
|
23
|
-
background={theme.color.light[500]}
|
|
24
|
-
manageOverflow
|
|
25
22
|
/>
|
|
26
23
|
)), [agent?.suggested_prompts])
|
|
27
24
|
|
package/src/views/Home/index.tsx
CHANGED
package/src/views/Home/styled.ts
CHANGED
|
@@ -1,12 +1,10 @@
|
|
|
1
|
+
import { theme } from '@stack-spot/portal-theme'
|
|
1
2
|
import { styled } from 'styled-components'
|
|
2
3
|
|
|
3
4
|
export const HomeBox = styled.div`
|
|
4
5
|
margin: auto 0;
|
|
5
6
|
|
|
6
7
|
.title, .subtitle {
|
|
7
|
-
font-family: 'San Francisco';
|
|
8
|
-
font-size: 26px;
|
|
9
|
-
font-weight: 600;
|
|
10
8
|
margin: 0;
|
|
11
9
|
}
|
|
12
10
|
|
|
@@ -14,22 +12,35 @@ export const HomeBox = styled.div`
|
|
|
14
12
|
display: inline-block;
|
|
15
13
|
background: linear-gradient(72.81deg, #FF9900 0.96%, #FF6633 100%);
|
|
16
14
|
background-clip: text;
|
|
17
|
-
margin-bottom: 10px;
|
|
18
15
|
color: transparent;
|
|
19
16
|
}
|
|
20
17
|
|
|
21
18
|
.subtitle {
|
|
22
19
|
color: #A0A0A0;
|
|
23
|
-
margin-bottom:
|
|
20
|
+
margin-bottom: 24px;
|
|
24
21
|
}
|
|
25
22
|
|
|
26
23
|
.shortcuts {
|
|
27
|
-
display: flex;
|
|
28
|
-
flex-direction: row;
|
|
29
|
-
gap: 15px;
|
|
30
24
|
li {
|
|
31
25
|
flex: 1;
|
|
32
26
|
}
|
|
27
|
+
button {
|
|
28
|
+
padding-left: 0;
|
|
29
|
+
border-radius: 50px;
|
|
30
|
+
padding-inline: 16px;
|
|
31
|
+
padding-block: 8px;
|
|
32
|
+
font-weight: 400;
|
|
33
|
+
line-height: normal;
|
|
34
|
+
border: none;
|
|
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
|
+
}
|
|
33
44
|
}
|
|
34
45
|
|
|
35
46
|
.avatar, .avatar svg {
|
|
@@ -48,11 +59,11 @@ export const HomeBox = styled.div`
|
|
|
48
59
|
margin-top: 10px;
|
|
49
60
|
button {
|
|
50
61
|
padding: 16px;
|
|
51
|
-
height: 100px;
|
|
52
62
|
line-height: 24px;
|
|
53
63
|
p {
|
|
54
64
|
overflow: hidden;
|
|
55
65
|
}
|
|
66
|
+
|
|
56
67
|
}
|
|
57
68
|
}
|
|
58
69
|
}
|
|
@@ -15,20 +15,16 @@ interface SelectionBarProps {
|
|
|
15
15
|
* Whether or not the message is currently being sent. This is used to decide which button to show: send or cancel.
|
|
16
16
|
*/
|
|
17
17
|
isLoading?: boolean,
|
|
18
|
-
/**
|
|
19
|
-
* State to determine whether the input is focused
|
|
20
|
-
*/
|
|
21
|
-
focused?: boolean,
|
|
22
18
|
}
|
|
23
19
|
|
|
24
|
-
export const ButtonBar = ({ onSend, isLoading
|
|
20
|
+
export const ButtonBar = ({ onSend, isLoading }: SelectionBarProps) => {
|
|
25
21
|
const t = useMessageInputDictionary()
|
|
26
22
|
const chat = useCurrentChat()
|
|
27
23
|
const widget = useWidget()
|
|
28
24
|
const features = useCurrentChatState('features')
|
|
29
25
|
|
|
30
26
|
return (
|
|
31
|
-
<SelectionBarWrapper className="button-group"
|
|
27
|
+
<SelectionBarWrapper className="button-group">
|
|
32
28
|
<Flex sx={{ gap: '4px' }}>
|
|
33
29
|
<SelectContent />
|
|
34
30
|
{features.editor && (
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { KnowledgeSource, Plus, Spaces, Stack } from '@citric/icons'
|
|
2
2
|
import { IconButton } from '@citric/ui'
|
|
3
3
|
import { SelectionList } from '@stack-spot/portal-components/SelectionList'
|
|
4
4
|
import { Dictionary, useTranslate } from '@stack-spot/portal-translate'
|
|
@@ -59,7 +59,7 @@ export const SelectContent = () => {
|
|
|
59
59
|
data-test-hint="button-options"
|
|
60
60
|
aria-label={visibleMenu ? t.collapse : t.expand}
|
|
61
61
|
onClick={() => setVisibleMenu(state => !state)}>
|
|
62
|
-
<
|
|
62
|
+
<Plus />
|
|
63
63
|
</IconButton>
|
|
64
64
|
<SelectionList
|
|
65
65
|
style={{
|
|
@@ -81,9 +81,9 @@ export const MessageInput = () => {
|
|
|
81
81
|
</div>
|
|
82
82
|
</div>
|
|
83
83
|
<ProgressBar visible={true} animate={isLoading}
|
|
84
|
-
backgroundColor={isLoading || !focused ? theme.color.light[
|
|
84
|
+
backgroundColor={isLoading || !focused ? theme.color.light[500] : theme.color.primary[500]} />
|
|
85
85
|
<InfoBar />
|
|
86
|
-
<ButtonBar
|
|
86
|
+
<ButtonBar onSend={onSend} isLoading={isLoading} />
|
|
87
87
|
</MessageInputBox>
|
|
88
88
|
)
|
|
89
89
|
}
|
|
@@ -7,7 +7,7 @@ const INFO_BAR_DISPLACEMENT = 4
|
|
|
7
7
|
export const MAX_INPUT_HEIGHT = 300
|
|
8
8
|
export const MIN_INPUT_HEIGHT = 24
|
|
9
9
|
|
|
10
|
-
export const SelectionBarWrapper = styled.div
|
|
10
|
+
export const SelectionBarWrapper = styled.div`
|
|
11
11
|
display: inline-flex;
|
|
12
12
|
justify-content: space-between;
|
|
13
13
|
position: relative;
|
|
@@ -15,7 +15,6 @@ export const SelectionBarWrapper = styled.div<{$inputFocused?: boolean}>`
|
|
|
15
15
|
background-color: ${theme.color.light[500]};
|
|
16
16
|
border-bottom-left-radius: 4px;
|
|
17
17
|
border-bottom-right-radius: 4px;
|
|
18
|
-
border: 2px solid ${({ $inputFocused }) => theme.color.light[$inputFocused ? 600 : 500]};
|
|
19
18
|
border-top: none;
|
|
20
19
|
|
|
21
20
|
.selection-list {
|
|
@@ -137,19 +136,19 @@ export const MessageInputBox = styled.div<{$inputFocused?: boolean}>`
|
|
|
137
136
|
align-items: end;
|
|
138
137
|
border-top-left-radius: 4px;
|
|
139
138
|
border-top-right-radius: 4px;
|
|
140
|
-
border: 2px solid ${theme.color.light[
|
|
139
|
+
border: 2px solid ${theme.color.light[300]};
|
|
141
140
|
|
|
142
|
-
background-color: ${theme.color.light[
|
|
141
|
+
background-color: ${theme.color.light[300]};
|
|
143
142
|
padding: 10px 8px;
|
|
144
143
|
transition: border-color 0.3s, background-color 0.3s;
|
|
145
144
|
|
|
146
145
|
&.focused {
|
|
147
|
-
border: 2px solid ${theme.color.light[
|
|
146
|
+
border: 2px solid ${theme.color.light[300]};
|
|
148
147
|
}
|
|
149
148
|
|
|
150
149
|
|
|
151
150
|
&.disabled {
|
|
152
|
-
background-color: ${theme.color.light[
|
|
151
|
+
background-color: ${theme.color.light[300]};
|
|
153
152
|
}
|
|
154
153
|
}
|
|
155
154
|
}
|