@stack-spot/ai-chat-widget 1.20.2-beta.4 → 1.20.2-beta.6

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.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stack-spot/ai-chat-widget",
3
- "version": "1.20.2-beta.4",
4
- "date": "Fri May 16 2025 14:19:06 GMT-0300 (Horário Padrão de Brasília)",
3
+ "version": "1.20.2-beta.6",
4
+ "date": "Fri May 16 2025 16:55:06 GMT-0300 (Horário Padrão de Brasília)",
5
5
  "dependencies": [
6
6
  {
7
7
  "name": "@stack-spot/app-metadata",
@@ -11,6 +11,6 @@ export const ButtonBar = ({ onSend, isLoading, focused }) => {
11
11
  const chat = useCurrentChat();
12
12
  const widget = useWidget();
13
13
  const features = useCurrentChatState('features');
14
- return (_jsxs(SelectionBarWrapper, { "$inputFocused": focused, children: [_jsxs(Flex, { children: [_jsx(SelectContent, {}), features.editor && (_jsx(IconButton, { color: "light", appearance: "square", "aria-label": t.code, title: t.code, onClick: () => widget.set('panel', 'editor'), children: _jsx(Code, {}) }))] }), _jsx(Flex, { children: isLoading ? (_jsx(IconButton, { appearance: "square", color: "inverse", "aria-label": t.cancel, onClick: () => chat.abort(), className: "send", title: t.cancel, children: _jsx(Stop, {}) })) : (_jsx(IconButton, { appearance: "square", color: "inverse", "aria-label": t.send, onClick: onSend, className: "send", title: t.send, children: _jsx(ArrowUp, {}) })) })] }));
14
+ return (_jsxs(SelectionBarWrapper, { className: "button-group", "$inputFocused": focused, 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,IAAI,EAAE,MAAM,cAAc,CAAA;AACnC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,eAAe,CAAA;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AACvC,OAAO,EAAE,cAAc,EAAE,mBAAmB,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AACpF,OAAO,EAAE,yBAAyB,EAAE,MAAM,cAAc,CAAA;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAC/C,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAA;AAiB9C,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,EAAqB,EAAE,EAAE;IAC7E,MAAM,CAAC,GAAG,yBAAyB,EAAE,CAAA;IACrC,MAAM,IAAI,GAAG,cAAc,EAAE,CAAA;IAC7B,MAAM,MAAM,GAAG,SAAS,EAAE,CAAA;IAC1B,MAAM,QAAQ,GAAG,mBAAmB,CAAC,UAAU,CAAC,CAAA;IAEhD,OAAO,CACL,MAAC,mBAAmB,qBAAgB,OAAO,aACzC,MAAC,IAAI,eACH,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,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X.Element;
1
+ export declare const SelectContent: () => import("react/jsx-runtime").JSX.Element | null;
2
2
  //# sourceMappingURL=SelectContent.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"SelectContent.d.ts","sourceRoot":"","sources":["../../../src/views/MessageInput/SelectContent.tsx"],"names":[],"mappings":"AAMA,eAAO,MAAM,aAAa,+CAkCzB,CAAA"}
1
+ {"version":3,"file":"SelectContent.d.ts","sourceRoot":"","sources":["../../../src/views/MessageInput/SelectContent.tsx"],"names":[],"mappings":"AASA,eAAO,MAAM,aAAa,sDAgEzB,CAAA"}
@@ -2,18 +2,47 @@ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-run
2
2
  import { Clip, KnowledgeSource, Spaces, Stack } from '@citric/icons';
3
3
  import { IconButton } from '@citric/ui';
4
4
  import { SelectionList } from '@stack-spot/portal-components/SelectionList';
5
- import { useState } from 'react';
6
- import { useWidget } from '../../context/hooks.js';
5
+ import { useMemo, useState } from 'react';
6
+ import { useCurrentChatState, useWidget } from '../../context/hooks.js';
7
7
  export const SelectContent = () => {
8
8
  const widget = useWidget();
9
9
  const [visibleMenu, setVisibleMenu] = useState(false);
10
+ const features = useCurrentChatState('features');
11
+ const hasFeatureButtons = features.workspace || features.knowledgeSource || features.stack;
12
+ const itemConfigs = [
13
+ {
14
+ key: 'knowledgeSource',
15
+ label: 'Knowledge Sources',
16
+ icon: _jsx(KnowledgeSource, {}),
17
+ panel: 'ks',
18
+ },
19
+ {
20
+ key: 'stack',
21
+ label: 'Stacks AI',
22
+ icon: _jsx(Stack, {}),
23
+ panel: 'stack',
24
+ },
25
+ {
26
+ key: 'workspace',
27
+ label: 'Spots',
28
+ icon: _jsx(Spaces, {}),
29
+ panel: 'workspace',
30
+ },
31
+ ];
32
+ const listItems = useMemo(() => itemConfigs.filter(chatFeatures => features[chatFeatures.key])
33
+ .map(chatFeatures => ({
34
+ label: chatFeatures.label,
35
+ icon: chatFeatures.icon,
36
+ onClick: () => {
37
+ widget.set('panel', chatFeatures.panel);
38
+ setVisibleMenu(false);
39
+ },
40
+ })), [features, widget]);
41
+ if (!hasFeatureButtons)
42
+ return null;
10
43
  return (_jsxs(_Fragment, { children: [_jsx(IconButton, { color: "light", appearance: "square", role: "button", title: "title", "data-test-hint": "button-hint", "aria-label": "aria-label", onClick: () => setVisibleMenu(state => !state), children: _jsx(Clip, {}) }), _jsx(SelectionList, { style: {
11
44
  position: 'absolute',
12
45
  top: '-150px',
13
- }, id: "teste", visible: visibleMenu, onHide: () => setVisibleMenu(false), items: [
14
- { label: 'Knowledge Sources', icon: _jsx(KnowledgeSource, {}), onClick: () => widget.set('panel', 'ks') },
15
- { label: 'Stacks AI', icon: _jsx(Stack, {}), onClick: () => widget.set('panel', 'stack') },
16
- { label: 'Spots', icon: _jsx(Spaces, {}), onClick: () => widget.set('panel', 'workspace') },
17
- ] })] }));
46
+ }, id: "teste", visible: visibleMenu, onHide: () => setVisibleMenu(false), items: listItems })] }));
18
47
  };
19
48
  //# sourceMappingURL=SelectContent.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SelectContent.js","sourceRoot":"","sources":["../../../src/views/MessageInput/SelectContent.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,eAAe,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,eAAe,CAAA;AACpE,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AACvC,OAAO,EAAE,aAAa,EAAE,MAAM,6CAA6C,CAAA;AAC3E,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAChC,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AAE/C,MAAM,CAAC,MAAM,aAAa,GAAG,GAAG,EAAE;IAChC,MAAM,MAAM,GAAG,SAAS,EAAE,CAAA;IAC1B,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAA;IAErD,OAAO,CACL,8BACE,KAAC,UAAU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C,CAAA;YACpD,cAAc,CAAC,KAAK,CAAC,CAAA;QACvB,CAAC;KACF,CAAC,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC,CAAA;IAE5B,IAAI,CAAC,iBAAiB;QAAE,OAAO,IAAI,CAAA;IAEnC,OAAO,CACL,8BACE,KAAC,UAAU,IACT,KAAK,EAAC,OAAO,EACb,UAAU,EAAC,QAAQ,EACnB,IAAI,EAAC,QAAQ,EACb,KAAK,EAAC,OAAO,oBACE,aAAa,gBACjB,YAAY,EACvB,OAAO,EAAE,GAAG,EAAE,CAAC,cAAc,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,YAC9C,KAAC,IAAI,KAAG,GACG,EACb,KAAC,aAAa,IACZ,KAAK,EAAE;oBACL,QAAQ,EAAE,UAAU;oBACpB,GAAG,EAAE,QAAQ;iBACd,EACD,EAAE,EAAC,OAAO,EACV,OAAO,EAAE,WAAW,EACpB,MAAM,EAAE,GAAG,EAAE,CAAC,cAAc,CAAC,KAAK,CAAC,EACnC,KAAK,EAAE,SAAS,GAChB,IACD,CACJ,CAAA;AACH,CAAC,CAAA"}
@@ -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;oBAA+B,OAAO;YA2CrE,CAAA;AAED,eAAO,MAAM,eAAe;oBAA+B,OAAO;YA0PjE,CAAA"}
1
+ {"version":3,"file":"styled.d.ts","sourceRoot":"","sources":["../../../src/views/MessageInput/styled.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,gBAAgB,MAAM,CAAA;AACnC,eAAO,MAAM,gBAAgB,KAAK,CAAA;AAElC,eAAO,MAAM,mBAAmB;oBAA+B,OAAO;YA0CrE,CAAA;AAED,eAAO,MAAM,eAAe;oBAA+B,OAAO;YAoPjE,CAAA"}
@@ -10,7 +10,6 @@ export const SelectionBarWrapper = styled.div `
10
10
  justify-content: space-between;
11
11
  position: relative;
12
12
  padding: 8px;
13
- padding-top: 6px;
14
13
  background-color: ${theme.color.light[500]};
15
14
  border-bottom-left-radius: 4px;
16
15
  border-bottom-right-radius: 4px;
@@ -165,18 +164,12 @@ export const MessageInputBox = styled.div `
165
164
  button {
166
165
  border: none;
167
166
  border-radius: 2px;
168
- opacity: 0.6;
167
+ /* opacity: 0.6; */
169
168
  transition: background-color 0.2s, opacity 0.2s;
170
- background-color: transparent;
169
+ /* background-color: transparent; */
171
170
  padding: 0;
172
171
 
173
- svg {
174
- fill: ${theme.color.light[700]};
175
- width: 16px;
176
- height: 16px;
177
- }
178
-
179
- &:hover {
172
+ /* &:hover {
180
173
  background-color: ${theme.color.light[500]};
181
174
  }
182
175
 
@@ -187,7 +180,7 @@ export const MessageInputBox = styled.div `
187
180
  }
188
181
  svg {
189
182
  fill: ${theme.color.inverse.contrastText};
190
- }
183
+ }
191
184
  }
192
185
 
193
186
  &.expand {
@@ -200,7 +193,7 @@ export const MessageInputBox = styled.div `
200
193
  svg {
201
194
  transform: rotate(180deg);
202
195
  }
203
- }
196
+ } */
204
197
 
205
198
  &.agent {
206
199
  border-radius: 50%;
@@ -1 +1 @@
1
- {"version":3,"file":"styled.js","sourceRoot":"","sources":["../../../src/views/MessageInput/styled.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AACvC,OAAO,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAA;AAChD,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAA;AAE1C,MAAM,eAAe,GAAG,EAAE,CAAA;AAC1B,MAAM,qBAAqB,GAAG,CAAC,CAAA;AAC/B,MAAM,CAAC,MAAM,gBAAgB,GAAG,GAAG,CAAA;AACnC,MAAM,CAAC,MAAM,gBAAgB,GAAG,EAAE,CAAA;AAElC,M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KAAK,CAAC,GAAG,CAAC;;;;4BAItB,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC;;;;;kBAKlC,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAuD5C,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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stack-spot/ai-chat-widget",
3
- "version": "1.20.2-beta.4",
3
+ "version": "1.20.2-beta.6",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stack-spot/ai-chat-widget",
3
- "version": "1.20.2-beta.4",
4
- "date": "Fri May 16 2025 14:19:06 GMT-0300 (Horário Padrão de Brasília)",
3
+ "version": "1.20.2-beta.6",
4
+ "date": "Fri May 16 2025 16:55:06 GMT-0300 (Horário Padrão de Brasília)",
5
5
  "dependencies": [
6
6
  {
7
7
  "name": "@stack-spot/app-metadata",
@@ -28,8 +28,8 @@ export const ButtonBar = ({ onSend, isLoading, focused }: SelectionBarProps) =>
28
28
  const features = useCurrentChatState('features')
29
29
 
30
30
  return (
31
- <SelectionBarWrapper $inputFocused={focused}>
32
- <Flex>
31
+ <SelectionBarWrapper className="button-group" $inputFocused={focused}>
32
+ <Flex sx={{ gap: '4px' }}>
33
33
  <SelectContent />
34
34
  {features.editor && (
35
35
  <IconButton color="light" appearance="square" aria-label={t.code} title={t.code} onClick={() => widget.set('panel', 'editor')}>
@@ -1,13 +1,52 @@
1
1
  import { Clip, KnowledgeSource, Spaces, Stack } from '@citric/icons'
2
2
  import { IconButton } from '@citric/ui'
3
3
  import { SelectionList } from '@stack-spot/portal-components/SelectionList'
4
- import { useState } from 'react'
5
- import { useWidget } from '../../context/hooks'
4
+ import { useMemo, useState } from 'react'
5
+ import { useCurrentChatState, useWidget } from '../../context/hooks'
6
+
7
+ type chatFeatures = 'workspace' | 'knowledgeSource' | 'stack'
8
+ type chatPanel = 'ks' | 'workspace' | 'stack'
6
9
 
7
10
  export const SelectContent = () => {
8
11
  const widget = useWidget()
9
12
  const [visibleMenu, setVisibleMenu] = useState(false)
10
-
13
+ const features = useCurrentChatState('features')
14
+ const hasFeatureButtons = features.workspace || features.knowledgeSource || features.stack
15
+
16
+ const itemConfigs = [
17
+ {
18
+ key: 'knowledgeSource',
19
+ label: 'Knowledge Sources',
20
+ icon: <KnowledgeSource />,
21
+ panel: 'ks',
22
+ },
23
+ {
24
+ key: 'stack',
25
+ label: 'Stacks AI',
26
+ icon: <Stack />,
27
+ panel: 'stack',
28
+ },
29
+ {
30
+ key: 'workspace',
31
+ label: 'Spots',
32
+ icon: <Spaces />,
33
+ panel: 'workspace',
34
+ },
35
+ ]
36
+
37
+ const listItems = useMemo(() =>
38
+ itemConfigs.filter(chatFeatures => features[chatFeatures.key as chatFeatures])
39
+ .map(chatFeatures => ({
40
+ label: chatFeatures.label,
41
+ icon: chatFeatures.icon,
42
+ onClick: () => {
43
+ widget.set('panel', chatFeatures.panel as chatPanel)
44
+ setVisibleMenu(false)
45
+ },
46
+ })), [features, widget])
47
+
48
+ if (!hasFeatureButtons) return null
49
+
11
50
  return (
12
51
  <>
13
52
  <IconButton
@@ -17,7 +56,7 @@ export const SelectContent = () => {
17
56
  title="title"
18
57
  data-test-hint="button-hint"
19
58
  aria-label="aria-label"
20
- onClick={() => setVisibleMenu(state => !state)} >
59
+ onClick={() => setVisibleMenu(state => !state)}>
21
60
  <Clip />
22
61
  </IconButton>
23
62
  <SelectionList
@@ -28,13 +67,7 @@ export const SelectContent = () => {
28
67
  id="teste"
29
68
  visible={visibleMenu}
30
69
  onHide={() => setVisibleMenu(false)}
31
- items={
32
- [
33
- { label: 'Knowledge Sources', icon: <KnowledgeSource />, onClick: () => widget.set('panel', 'ks') },
34
- { label: 'Stacks AI', icon: <Stack />, onClick: () => widget.set('panel', 'stack') },
35
- { label: 'Spots', icon: <Spaces />, onClick: () => widget.set('panel', 'workspace') },
36
- ]
37
- }
70
+ items={listItems}
38
71
  />
39
72
  </>
40
73
  )
@@ -12,7 +12,6 @@ export const SelectionBarWrapper = styled.div<{$inputFocused?: boolean}>`
12
12
  justify-content: space-between;
13
13
  position: relative;
14
14
  padding: 8px;
15
- padding-top: 6px;
16
15
  background-color: ${theme.color.light[500]};
17
16
  border-bottom-left-radius: 4px;
18
17
  border-bottom-right-radius: 4px;
@@ -168,18 +167,12 @@ export const MessageInputBox = styled.div<{$inputFocused?: boolean}>`
168
167
  button {
169
168
  border: none;
170
169
  border-radius: 2px;
171
- opacity: 0.6;
170
+ /* opacity: 0.6; */
172
171
  transition: background-color 0.2s, opacity 0.2s;
173
- background-color: transparent;
172
+ /* background-color: transparent; */
174
173
  padding: 0;
175
174
 
176
- svg {
177
- fill: ${theme.color.light[700]};
178
- width: 16px;
179
- height: 16px;
180
- }
181
-
182
- &:hover {
175
+ /* &:hover {
183
176
  background-color: ${theme.color.light[500]};
184
177
  }
185
178
 
@@ -190,7 +183,7 @@ export const MessageInputBox = styled.div<{$inputFocused?: boolean}>`
190
183
  }
191
184
  svg {
192
185
  fill: ${theme.color.inverse.contrastText};
193
- }
186
+ }
194
187
  }
195
188
 
196
189
  &.expand {
@@ -203,7 +196,7 @@ export const MessageInputBox = styled.div<{$inputFocused?: boolean}>`
203
196
  svg {
204
197
  transform: rotate(180deg);
205
198
  }
206
- }
199
+ } */
207
200
 
208
201
  &.agent {
209
202
  border-radius: 50%;