@stack-spot/ai-chat-widget 1.22.0-beta.5 → 1.22.0-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.
@@ -29,10 +29,14 @@ export interface AIWidgetProps extends WithStyle, CustomMessage {
29
29
  * A boolean indicating whether or not the chat should have a visible header.
30
30
  */
31
31
  hasHeader?: boolean;
32
+ /**
33
+ * URL to redirect to the "Create Agent" page on the portal
34
+ */
35
+ urlCreateAgent?: string;
32
36
  }
33
37
  /**
34
38
  * Renders a Chat Widget according to the closest model found in the React tree (AIWidgetProvider). If no model is found, a global version
35
39
  * of the Chat Widget will be instantiated and used.
36
40
  */
37
- export declare const StackspotAIWidget: ({ username, initialAgents, minimizedActions, prefix, children, className, style, hasHeader, beforeMessage, afterMessage, }: AIWidgetProps) => import("react/jsx-runtime").JSX.Element;
41
+ export declare const StackspotAIWidget: ({ username, initialAgents, minimizedActions, prefix, children, className, style, hasHeader, beforeMessage, afterMessage, urlCreateAgent, }: AIWidgetProps) => import("react/jsx-runtime").JSX.Element;
38
42
  //# 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,YAAY,EAAE,MAAM,eAAe,CAAA;AAC5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAA;AAI1C,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAA;AAcxD,MAAM,WAAW,aAAc,SAAQ,SAAS,EAAE,aAAa;IAC7D;;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,+HAYzB,aAAa,4CAiDjB,CAAA"}
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;AAI1C,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAA;AAcxD,MAAM,WAAW,aAAc,SAAQ,SAAS,EAAE,aAAa;IAC7D;;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;IACpB;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED;;;GAGG;AACH,eAAO,MAAM,iBAAiB,+IAazB,aAAa,4CAiDjB,CAAA"}
@@ -26,7 +26,7 @@ import { Workspaces } from './views/Workspaces/index.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, initialAgents, minimizedActions = {}, prefix, children, className, style, hasHeader = true, beforeMessage, afterMessage, }) => {
29
+ export const StackspotAIWidget = ({ username, initialAgents, minimizedActions = {}, prefix, children, className, style, hasHeader = true, beforeMessage, afterMessage, urlCreateAgent, }) => {
30
30
  const rightPanelRef = useRef(null);
31
31
  const chatWindowRef = useRef(null);
32
32
  const currentChat = useCurrentChatMessages();
@@ -37,7 +37,7 @@ export const StackspotAIWidget = ({ username, initialAgents, minimizedActions =
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
39
  : _jsx(ChatTabSelection, {}) }), _jsxs("div", { className: "chat-container", children: [_jsxs("div", { className: "chat-content", children: [prefix, isCurrentChatEmpty
40
- ? (children ?? _jsx(Home, { username: username, initialAgents: initialAgents }))
40
+ ? (children ?? _jsx(Home, { username: username, initialAgents: initialAgents, urlCreateAgent: urlCreateAgent }))
41
41
  : _jsx(Chat, { username: username, beforeMessage: beforeMessage, afterMessage: afterMessage })] }), 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]);
42
42
  };
43
43
  //# sourceMappingURL=StackspotAIWidget.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"StackspotAIWidget.js","sourceRo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aAAa,YAAE,KAAC,UAAU,KAAG,GAAM,IACtE,GACa,GACL,GACD,CACpB,EAAE,CAAC,kBAAkB,EAAE,QAAQ,EAAE,WAAW,EAAE,QAAQ,EAAE,aAAa,CAAC,CAAC,CAAA;AAC1E,CAAC,CAAA"}
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stack-spot/ai-chat-widget",
3
- "version": "1.22.0-beta.5",
4
- "date": "Wed May 28 2025 09:44:26 GMT-0300 (Horário Padrão de Brasília)",
3
+ "version": "1.22.0-beta.6",
4
+ "date": "Wed May 28 2025 11:45:22 GMT-0300 (Horário Padrão de Brasília)",
5
5
  "dependencies": [
6
6
  {
7
7
  "name": "@stack-spot/app-metadata",
@@ -0,0 +1,4 @@
1
+ export declare const AgentCardCreate: ({ urlCreateAgent }: {
2
+ urlCreateAgent: string;
3
+ }) => import("react/jsx-runtime").JSX.Element;
4
+ //# sourceMappingURL=AgentCardCreate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AgentCardCreate.d.ts","sourceRoot":"","sources":["../../../src/components/AgentCard/AgentCardCreate.tsx"],"names":[],"mappings":"AA6BA,eAAO,MAAM,eAAe,uBAAwB;IAAE,cAAc,EAAE,MAAM,CAAA;CAAG,4CAc9E,CAAA"}
@@ -0,0 +1,33 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { IconBox, Text } from '@citric/core';
3
+ import { PlusMini } from '@citric/icons';
4
+ import { theme } from '@stack-spot/portal-theme';
5
+ import { useTranslate } from '@stack-spot/portal-translate';
6
+ import { styled } from 'styled-components';
7
+ import { dictionary } from './dictionary.js';
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
+
18
+ &:hover {
19
+ background-color: ${theme.color.light[500]};
20
+ }
21
+
22
+ .text-box {
23
+ display: flex;
24
+ flex-direction: column;
25
+ gap: 2px;
26
+ color: ${theme.color.light['contrastText']}
27
+ }
28
+ `;
29
+ export const AgentCardCreate = ({ urlCreateAgent }) => {
30
+ const t = useTranslate(dictionary);
31
+ return (_jsxs(StyledCard, { href: urlCreateAgent, role: "link", tabIndex: 0, className: 'agent-card', children: [_jsx(IconBox, { color: "light", appearance: "square", size: "md", children: _jsx(PlusMini, {}) }), _jsx("div", { className: "text-box", children: _jsx(Text, { appearance: "body2", children: t.create }) })] }));
32
+ };
33
+ //# sourceMappingURL=AgentCardCreate.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AgentCardCreate.js","sourceRoot":"","sources":["../../../src/components/AgentCard/AgentCardCreate.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACxC,OAAO,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAA;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAA;AAC3D,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAA;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAEzC,MAAM,UAAU,GAAG,MAAM,CAAC,CAAC,CAAA;;;;;;;sBAOL,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC;;;;wBAIpB,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC;;;;;;;aAOjC,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,cAAc,CAAC;;CAE7C,CAAA;AAED,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,EAAE,cAAc,EAA+B,EAAE,EAAE;IACjF,MAAM,CAAC,GAAG,YAAY,CAAC,UAAU,CAAC,CAAA;IAClC,OAAO,CACL,MAAC,UAAU,IAAC,IAAI,EAAE,cAAc,EAAE,IAAI,EAAC,MAAM,EAAC,QAAQ,EAAE,CAAC,EAAE,SAAS,EAAE,YAAY,aAChF,KAAC,OAAO,IAAC,KAAK,EAAC,OAAO,EAAC,UAAU,EAAC,QAAQ,EAAC,IAAI,EAAC,IAAI,YAClD,KAAC,QAAQ,KAAG,GACJ,EACV,cAAK,SAAS,EAAC,UAAU,YACvB,KAAC,IAAI,IAAC,UAAU,EAAC,OAAO,YACrB,CAAC,CAAC,MAAM,GACJ,GACH,IACK,CACd,CAAA;AACH,CAAC,CAAA"}
@@ -5,6 +5,7 @@ export declare const dictionary: {
5
5
  account: string;
6
6
  shared: string;
7
7
  agent: string;
8
+ create: string;
8
9
  };
9
10
  pt: {
10
11
  builtin: string;
@@ -12,6 +13,7 @@ export declare const dictionary: {
12
13
  account: string;
13
14
  shared: string;
14
15
  agent: string;
16
+ create: string;
15
17
  };
16
18
  };
17
19
  //# sourceMappingURL=dictionary.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"dictionary.d.ts","sourceRoot":"","sources":["../../../src/components/AgentCard/dictionary.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;CAeD,CAAA"}
1
+ {"version":3,"file":"dictionary.d.ts","sourceRoot":"","sources":["../../../src/components/AgentCard/dictionary.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;CAiBD,CAAA"}
@@ -5,6 +5,7 @@ export const dictionary = {
5
5
  account: 'Account',
6
6
  shared: 'Shared',
7
7
  agent: 'Agent',
8
+ create: 'Create',
8
9
  },
9
10
  pt: {
10
11
  builtin: 'Embutido',
@@ -12,6 +13,7 @@ export const dictionary = {
12
13
  account: 'Conta',
13
14
  shared: 'Compartilhado',
14
15
  agent: 'Agente',
16
+ create: 'Criar',
15
17
  },
16
18
  };
17
19
  //# sourceMappingURL=dictionary.js.map
@@ -1 +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"}
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;QACd,MAAM,EAAE,QAAQ;KACjB;IACD,EAAE,EAAE;QACF,OAAO,EAAE,UAAU;QACnB,QAAQ,EAAE,UAAU;QACpB,OAAO,EAAE,OAAO;QAChB,MAAM,EAAE,eAAe;QACvB,KAAK,EAAE,QAAQ;QACf,MAAM,EAAE,OAAO;KAChB;CACmB,CAAA"}
package/dist/layout.css CHANGED
@@ -104,10 +104,10 @@
104
104
  align-items: center;
105
105
  gap: 8px;
106
106
  border-radius: 4px;
107
- padding: 10px;
107
+ padding: 10px 8px;
108
108
  img {
109
- width: 36px;
110
- height: 36px;
109
+ width: 32px;
110
+ height: 32px;
111
111
  border-radius: 4px;
112
112
  }
113
113
  h6 {
@@ -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":"AAOA,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAA;AAqBnC;;;;GAIG;AACH,eAAO,MAAM,IAAI,gCAAiC,SAAS,4CAgB1D,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/views/Home/index.tsx"],"names":[],"mappings":"AAQA,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAA;AAqBnC;;;;GAIG;AACH,eAAO,MAAM,IAAI,gDAAiD,SAAS,4CAiB1E,CAAA"}
@@ -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';
@@ -29,9 +30,9 @@ const AgentList = styled.ul `
29
30
  *
30
31
  * The home page can be replaced by providing children to the component `StackspotAIWidget`.
31
32
  */
32
- export const Home = ({ initialAgents, ...props }) => {
33
+ export const Home = ({ initialAgents, urlCreateAgent, ...props }) => {
33
34
  const agent = useCurrentChatState('agent');
34
35
  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: _jsx(AgentList, { className: "agent-list", children: initialAgents.map((agent) => _jsx("li", { children: _jsx(AgentCard, { agent: agent }) }, agent.id)) }) }))] }));
36
+ 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
37
  };
37
38
  //# 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;;;;;;;;;;;;;;;;;CAiB1B,CAAA;AAED;;;;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,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K,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,CACpC,KAAC,cAAc,IAAC,uCAAuC,QAAC,KAAK,EAAE,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,EAAC,QAAQ,YAC/F,MAAC,SAAS,IAAC,SAAS,EAAC,YAAY,aAC9B,cAAc,IAAI,uBAAI,KAAC,eAAe,IAAC,cAAc,EAAE,cAAc,GAAI,GAAK,EAC9E,aAAa,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,uBAAmB,KAAC,SAAS,IAAC,KAAK,EAAE,KAAK,GAAI,IAArC,KAAK,CAAC,EAAE,CAAkC,CAAC,IACxE,GACG,CAClB,IACgB,CACpB,CAAA;AACH,CAAC,CAAA"}
@@ -8,5 +8,9 @@ export interface HomeProps {
8
8
  * Initial agents to show in home.
9
9
  */
10
10
  initialAgents?: LabeledAgent[];
11
+ /**
12
+ * URL to redirect to the "Create Agent" page on the portal
13
+ */
14
+ urlCreateAgent?: string;
11
15
  }
12
16
  //# sourceMappingURL=types.d.ts.map
@@ -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;CAChC"}
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"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stack-spot/ai-chat-widget",
3
- "version": "1.22.0-beta.5",
3
+ "version": "1.22.0-beta.6",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -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>
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stack-spot/ai-chat-widget",
3
- "version": "1.22.0-beta.5",
4
- "date": "Wed May 28 2025 09:44:26 GMT-0300 (Horário Padrão de Brasília)",
3
+ "version": "1.22.0-beta.6",
4
+ "date": "Wed May 28 2025 11:45:22 GMT-0300 (Horário Padrão de Brasília)",
5
5
  "dependencies": [
6
6
  {
7
7
  "name": "@stack-spot/app-metadata",
@@ -0,0 +1,44 @@
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
+
18
+ &:hover {
19
+ background-color: ${theme.color.light[500]};
20
+ }
21
+
22
+ .text-box {
23
+ display: flex;
24
+ flex-direction: column;
25
+ gap: 2px;
26
+ color: ${theme.color.light['contrastText']}
27
+ }
28
+ `
29
+
30
+ export const AgentCardCreate = ({ urlCreateAgent }: { urlCreateAgent: string }) => {
31
+ const t = useTranslate(dictionary)
32
+ return (
33
+ <StyledCard href={urlCreateAgent} role="link" tabIndex={0} className={'agent-card'}>
34
+ <IconBox color="light" appearance="square" size="md">
35
+ <PlusMini />
36
+ </IconBox>
37
+ <div className="text-box">
38
+ <Text appearance="body2">
39
+ {t.create}
40
+ </Text>
41
+ </div>
42
+ </StyledCard>
43
+ )
44
+ }
@@ -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
 
package/src/layout.css CHANGED
@@ -104,10 +104,10 @@
104
104
  align-items: center;
105
105
  gap: 8px;
106
106
  border-radius: 4px;
107
- padding: 10px;
107
+ padding: 10px 8px;
108
108
  img {
109
- width: 36px;
110
- height: 36px;
109
+ width: 32px;
110
+ height: 32px;
111
111
  border-radius: 4px;
112
112
  }
113
113
  h6 {
@@ -1,6 +1,7 @@
1
1
  import { FadingOverflow } from '@stack-spot/portal-components/FadingOverflow'
2
2
  import { styled } from 'styled-components'
3
3
  import { AgentCard } from '../../components/AgentCard'
4
+ import { AgentCardCreate } from '../../components/AgentCard/AgentCardCreate'
4
5
  import { FallbackBoundary } from '../../components/FallbackBoundary'
5
6
  import { useCurrentChatState } from '../../context/hooks'
6
7
  import { BuiltInAgent } from './BuiltInAgent'
@@ -31,7 +32,7 @@ const AgentList = styled.ul`
31
32
  *
32
33
  * The home page can be replaced by providing children to the component `StackspotAIWidget`.
33
34
  */
34
- export const Home = ({ initialAgents, ...props }: HomeProps) => {
35
+ export const Home = ({ initialAgents, urlCreateAgent, ...props }: HomeProps) => {
35
36
  const agent = useCurrentChatState('agent')
36
37
  const isAgentEnabled = useCurrentChatState('features').agent
37
38
 
@@ -41,6 +42,7 @@ export const Home = ({ initialAgents, ...props }: HomeProps) => {
41
42
  {!!initialAgents && isAgentEnabled && (
42
43
  <FadingOverflow enableHorizontalScrollWithVerticalWheel sides={['left', 'right']} scroll="arrows">
43
44
  <AgentList className="agent-list">
45
+ {urlCreateAgent && <li><AgentCardCreate urlCreateAgent={urlCreateAgent} /></li>}
44
46
  {initialAgents.map((agent) => <li key={agent.id}><AgentCard agent={agent} /></li>)}
45
47
  </AgentList>
46
48
  </FadingOverflow>
@@ -9,4 +9,8 @@ export interface HomeProps {
9
9
  * Initial agents to show in home.
10
10
  */
11
11
  initialAgents?: LabeledAgent[],
12
+ /**
13
+ * URL to redirect to the "Create Agent" page on the portal
14
+ */
15
+ urlCreateAgent?: string,
12
16
  }