@stack-spot/ai-chat-widget 1.30.0-beta.1 → 1.30.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 +26 -71
- package/dist/StackspotAIWidget.d.ts.map +1 -1
- package/dist/StackspotAIWidget.js +2 -3
- package/dist/StackspotAIWidget.js.map +1 -1
- package/dist/app-metadata.json +3 -3
- package/dist/components/AdaptiveTextArea.d.ts +2 -2
- package/dist/components/AdaptiveTextArea.d.ts.map +1 -1
- package/dist/components/AdaptiveTextArea.js +8 -13
- package/dist/components/AdaptiveTextArea.js.map +1 -1
- package/dist/components/ToolBadge.d.ts.map +1 -1
- package/dist/components/ToolBadge.js +2 -0
- package/dist/components/ToolBadge.js.map +1 -1
- package/dist/views/Agents/AgentDescription.d.ts.map +1 -1
- package/dist/views/Agents/AgentDescription.js +8 -2
- package/dist/views/Agents/AgentDescription.js.map +1 -1
- package/dist/views/MessageInput/dictionary.js +1 -1
- package/dist/views/MessageInput/index.d.ts +2 -2
- package/dist/views/MessageInput/index.d.ts.map +1 -1
- package/dist/views/MessageInput/index.js +7 -4
- package/dist/views/MessageInput/index.js.map +1 -1
- package/dist/views/MessageInput/styled.d.ts +0 -1
- package/dist/views/MessageInput/styled.d.ts.map +1 -1
- package/dist/views/MessageInput/styled.js +0 -1
- package/dist/views/MessageInput/styled.js.map +1 -1
- package/package.json +2 -2
- package/src/StackspotAIWidget.tsx +2 -3
- package/src/app-metadata.json +3 -3
- package/src/components/AdaptiveTextArea.tsx +10 -18
- package/src/components/ToolBadge.tsx +2 -0
- package/src/views/Agents/AgentDescription.tsx +20 -4
- package/src/views/MessageInput/dictionary.ts +1 -1
- package/src/views/MessageInput/index.tsx +8 -4
- package/src/views/MessageInput/styled.ts +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,84 +1,39 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
-
## [1.30.0
|
|
3
|
+
## [1.30.0](https://github.com/stack-spot/portal-ai-chat-widget/compare/ai-chat-widget@v1.29.4...ai-chat-widget@v1.30.0) (2025-07-21)
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
### Features
|
|
7
7
|
|
|
8
|
-
*
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
* Add spots ([#130](https://github.com/stack-spot/portal-ai-chat-widget/issues/130)) ([9c641f9](https://github.com/stack-spot/portal-ai-chat-widget/commit/9c641f92019334974ec63366acae39402556ef09))
|
|
12
|
-
* add visibility prop when set agent ([#126](https://github.com/stack-spot/portal-ai-chat-widget/issues/126)) ([ff578ae](https://github.com/stack-spot/portal-ai-chat-widget/commit/ff578aef1ca81ebdff8039225014775ca85301f2))
|
|
13
|
-
* Adds drag-and-drop and paste upload functionality ([#192](https://github.com/stack-spot/portal-ai-chat-widget/issues/192)) ([a052b9e](https://github.com/stack-spot/portal-ai-chat-widget/commit/a052b9e8108b6a0971d96596f25c6be873664980))
|
|
14
|
-
* adds some new feature configs + small css fixes for file uploads ([#176](https://github.com/stack-spot/portal-ai-chat-widget/issues/176)) ([d033d65](https://github.com/stack-spot/portal-ai-chat-widget/commit/d033d65ff37003b5f7fb2e76377ea5f712af44e1))
|
|
15
|
-
* AI trial layout improves ([ba60310](https://github.com/stack-spot/portal-ai-chat-widget/commit/ba60310589fd97d5efeeef928b19a17b95a1bff7))
|
|
16
|
-
* 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))
|
|
17
|
-
* changes the feature "tools" ([#86](https://github.com/stack-spot/portal-ai-chat-widget/issues/86)) ([6c9b616](https://github.com/stack-spot/portal-ai-chat-widget/commit/6c9b616d8d51fd5eb6b2935a126b4f82ba2e656a))
|
|
18
|
-
* Feat 1388 fav workspace ai ([#96](https://github.com/stack-spot/portal-ai-chat-widget/issues/96)) ([ef7cc88](https://github.com/stack-spot/portal-ai-chat-widget/commit/ef7cc883a7dfe5b64d49639fcadde19f3c66ff7b))
|
|
19
|
-
* Feat 1388 favorites ([#70](https://github.com/stack-spot/portal-ai-chat-widget/issues/70)) ([c301c7b](https://github.com/stack-spot/portal-ai-chat-widget/commit/c301c7b01bffe6258a4931ffc5e054371eb6d838))
|
|
20
|
-
* Feat 2463 Update input chat ([#142](https://github.com/stack-spot/portal-ai-chat-widget/issues/142)) ([64436ec](https://github.com/stack-spot/portal-ai-chat-widget/commit/64436ec1f1d1ed43af415e5e46a92167ade8a852))
|
|
21
|
-
* file upload ([#174](https://github.com/stack-spot/portal-ai-chat-widget/issues/174)) ([48e665a](https://github.com/stack-spot/portal-ai-chat-widget/commit/48e665a5cb503d6f90e6cbee3ac64bc78357dca3))
|
|
22
|
-
* freemium improves ([#187](https://github.com/stack-spot/portal-ai-chat-widget/issues/187)) ([060a1c5](https://github.com/stack-spot/portal-ai-chat-widget/commit/060a1c52272c86323458aa4c79ba3e53f09fb7f0))
|
|
23
|
-
* Get QC from v2 ([#182](https://github.com/stack-spot/portal-ai-chat-widget/issues/182)) ([0c2ce48](https://github.com/stack-spot/portal-ai-chat-widget/commit/0c2ce48b7faa480dfe431acbfe083d3b1eda5a3d))
|
|
24
|
-
* improve agent built in ([#113](https://github.com/stack-spot/portal-ai-chat-widget/issues/113)) ([9a4f0b7](https://github.com/stack-spot/portal-ai-chat-widget/commit/9a4f0b7f82fe823891ea5bee5fa1249a63a5f7fd))
|
|
25
|
-
* 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))
|
|
26
|
-
* layout css on content of chat ([#161](https://github.com/stack-spot/portal-ai-chat-widget/issues/161)) ([b9c90c8](https://github.com/stack-spot/portal-ai-chat-widget/commit/b9c90c87fa750d93893ca511df66f562909de2ac))
|
|
27
|
-
* pm portal features ([#136](https://github.com/stack-spot/portal-ai-chat-widget/issues/136)) ([8c43666](https://github.com/stack-spot/portal-ai-chat-widget/commit/8c4366609eabd05641881e94b42a20323efe38cf))
|
|
28
|
-
* remove hardcoded agent ([#88](https://github.com/stack-spot/portal-ai-chat-widget/issues/88)) ([95bfd43](https://github.com/stack-spot/portal-ai-chat-widget/commit/95bfd43307a13144c7b4b32dade05fb7ab8cb127))
|
|
29
|
-
* some export + initial value + keys on chat messages ([#131](https://github.com/stack-spot/portal-ai-chat-widget/issues/131)) ([aede390](https://github.com/stack-spot/portal-ai-chat-widget/commit/aede390517cae16e7bccf81070a847bcb4ce1604))
|
|
30
|
-
* support input with other option ([#73](https://github.com/stack-spot/portal-ai-chat-widget/issues/73)) ([69babf0](https://github.com/stack-spot/portal-ai-chat-widget/commit/69babf0156b42deff65d555c358bb3956760f745))
|
|
31
|
-
* tools ([#66](https://github.com/stack-spot/portal-ai-chat-widget/issues/66)) ([c1f9b93](https://github.com/stack-spot/portal-ai-chat-widget/commit/c1f9b932b7425b6d859b4c82dff517cad4a72c2d))
|
|
32
|
-
* upd layout input ([#152](https://github.com/stack-spot/portal-ai-chat-widget/issues/152)) ([c1e9574](https://github.com/stack-spot/portal-ai-chat-widget/commit/c1e95743c6d8f6f2f6b62da09c81de3c71c7ec55))
|
|
8
|
+
* tools and new api agent ([f1384f2](https://github.com/stack-spot/portal-ai-chat-widget/commit/f1384f255ab091733f3a93815735641c9e8e7f18))
|
|
9
|
+
|
|
10
|
+
## [1.29.4](https://github.com/stack-spot/portal-ai-chat-widget/compare/ai-chat-widget@v1.29.3...ai-chat-widget@v1.29.4) (2025-07-15)
|
|
33
11
|
|
|
34
12
|
|
|
35
13
|
### Bug Fixes
|
|
36
14
|
|
|
37
|
-
*
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
*
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
*
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
*
|
|
59
|
-
* Fix input checkbox height([#84](https://github.com/stack-spot/portal-ai-chat-widget/issues/84)) ([3565817](https://github.com/stack-spot/portal-ai-chat-widget/commit/3565817ee3b15b2f9f04cb6e3448fb7df08f6d6e))
|
|
60
|
-
* Fix loading buttons ([#104](https://github.com/stack-spot/portal-ai-chat-widget/issues/104)) ([1b0ebaf](https://github.com/stack-spot/portal-ai-chat-widget/commit/1b0ebafdc1b854c4dad447d0c02bf0e87e30fbc5))
|
|
61
|
-
* Fix text ([#189](https://github.com/stack-spot/portal-ai-chat-widget/issues/189)) ([f201b57](https://github.com/stack-spot/portal-ai-chat-widget/commit/f201b57f0a38f854af3b6afd3373a53a94bf987b))
|
|
62
|
-
* forbidden suspense call ([#111](https://github.com/stack-spot/portal-ai-chat-widget/issues/111)) ([83a4460](https://github.com/stack-spot/portal-ai-chat-widget/commit/83a4460ae87440d7eb41e5751f28d39a9d3d2ef2))
|
|
63
|
-
* Improve input size ([#82](https://github.com/stack-spot/portal-ai-chat-widget/issues/82)) ([bb8ac64](https://github.com/stack-spot/portal-ai-chat-widget/commit/bb8ac64b34b7dd68f41ee29d91892b9a5489dd89))
|
|
64
|
-
* layout for messages without space ([#157](https://github.com/stack-spot/portal-ai-chat-widget/issues/157)) ([071bf1b](https://github.com/stack-spot/portal-ai-chat-widget/commit/071bf1baf4e1a43b27c520537c0d629d24bfbed8))
|
|
65
|
-
* lets pdf files be upload ([#183](https://github.com/stack-spot/portal-ai-chat-widget/issues/183)) ([d422d88](https://github.com/stack-spot/portal-ai-chat-widget/commit/d422d887d6745f2b9c1564c00b70dc6e83010209))
|
|
66
|
-
* on change handling ([#80](https://github.com/stack-spot/portal-ai-chat-widget/issues/80)) ([9e7ed5a](https://github.com/stack-spot/portal-ai-chat-widget/commit/9e7ed5a9dc0a081499d931168f7c333528ab2430))
|
|
67
|
-
* onboarding trial ([#100](https://github.com/stack-spot/portal-ai-chat-widget/issues/100)) ([202375b](https://github.com/stack-spot/portal-ai-chat-widget/commit/202375b689ac9f9067f9cc1f9b827df79cc262ca))
|
|
68
|
-
* placeholder mobile ([#128](https://github.com/stack-spot/portal-ai-chat-widget/issues/128)) ([1bdb76d](https://github.com/stack-spot/portal-ai-chat-widget/commit/1bdb76db84aadb4189fc442f867554b1b764746a))
|
|
69
|
-
* prevent useless double click in message menu ([#178](https://github.com/stack-spot/portal-ai-chat-widget/issues/178)) ([9ba7099](https://github.com/stack-spot/portal-ai-chat-widget/commit/9ba7099c8463ed07bbcaed975b499226503263d4))
|
|
70
|
-
* removes some upload types ([#180](https://github.com/stack-spot/portal-ai-chat-widget/issues/180)) ([7d31860](https://github.com/stack-spot/portal-ai-chat-widget/commit/7d318601ca7e40d855e2bd406dd7071886506cd9))
|
|
71
|
-
* rename space to spot ([#138](https://github.com/stack-spot/portal-ai-chat-widget/issues/138)) ([8205cbc](https://github.com/stack-spot/portal-ai-chat-widget/commit/8205cbc6c1358fd3427a00ebbab61f37dc537ea2))
|
|
72
|
-
* Revert "Change to space" ([#120](https://github.com/stack-spot/portal-ai-chat-widget/issues/120)) ([7229a0e](https://github.com/stack-spot/portal-ai-chat-widget/commit/7229a0eea605c62f09cd97706809b549b4066dc5))
|
|
73
|
-
* send button adjusts ([#195](https://github.com/stack-spot/portal-ai-chat-widget/issues/195)) ([a31fc1f](https://github.com/stack-spot/portal-ai-chat-widget/commit/a31fc1ff33c5ed511aa890fda856adc84e2e840b))
|
|
74
|
-
* set language to undefined if panel is closed ([#162](https://github.com/stack-spot/portal-ai-chat-widget/issues/162)) ([5ae54d5](https://github.com/stack-spot/portal-ai-chat-widget/commit/5ae54d54937b4562a03201c5943721e37ffaa21d))
|
|
75
|
-
* small styling issues ([#168](https://github.com/stack-spot/portal-ai-chat-widget/issues/168)) ([2a2ee42](https://github.com/stack-spot/portal-ai-chat-widget/commit/2a2ee428bf5d6b4fb1964ae35852dfc4d2e18f69))
|
|
76
|
-
* spacing chat messages ([#164](https://github.com/stack-spot/portal-ai-chat-widget/issues/164)) ([18c82fd](https://github.com/stack-spot/portal-ai-chat-widget/commit/18c82fd724bf16a9caaaa2c8636f6c524e324caa))
|
|
77
|
-
* Support trial on chat options ([#91](https://github.com/stack-spot/portal-ai-chat-widget/issues/91)) ([5333329](https://github.com/stack-spot/portal-ai-chat-widget/commit/5333329a57b0bd008a7d13c98e23ece1c5e39115))
|
|
78
|
-
* Undo change to workspace ai ([#97](https://github.com/stack-spot/portal-ai-chat-widget/issues/97)) ([e65fe12](https://github.com/stack-spot/portal-ai-chat-widget/commit/e65fe1214c5e6cbbd8a288dd03d03111f340eac8))
|
|
79
|
-
* Update release ([#203](https://github.com/stack-spot/portal-ai-chat-widget/issues/203)) ([5cb758e](https://github.com/stack-spot/portal-ai-chat-widget/commit/5cb758e1832ff41485300d08f6e306917d80e142))
|
|
80
|
-
* update text ([#185](https://github.com/stack-spot/portal-ai-chat-widget/issues/185)) ([58c03d3](https://github.com/stack-spot/portal-ai-chat-widget/commit/58c03d36e4bec75cbdb721202e8fed694499a7be))
|
|
81
|
-
* use visibility parameter to retrieve shared and personal agents ([#63](https://github.com/stack-spot/portal-ai-chat-widget/issues/63)) ([0ab4444](https://github.com/stack-spot/portal-ai-chat-widget/commit/0ab4444a805918ee7517f9f966f416fd528669fd))
|
|
15
|
+
* adjusts file size error ([#231](https://github.com/stack-spot/portal-ai-chat-widget/issues/231)) ([f977294](https://github.com/stack-spot/portal-ai-chat-widget/commit/f97729409d0330c128da5763959377f63fa6c7f6))
|
|
16
|
+
|
|
17
|
+
## [1.29.3](https://github.com/stack-spot/portal-ai-chat-widget/compare/ai-chat-widget@v1.29.2...ai-chat-widget@v1.29.3) (2025-07-11)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Bug Fixes
|
|
21
|
+
|
|
22
|
+
* maximum height of the text-area ([#217](https://github.com/stack-spot/portal-ai-chat-widget/issues/217)) ([0f8ba52](https://github.com/stack-spot/portal-ai-chat-widget/commit/0f8ba52716488bb1b19f0bc035ecd0aa1da61e50))
|
|
23
|
+
|
|
24
|
+
## [1.29.2](https://github.com/stack-spot/portal-ai-chat-widget/compare/ai-chat-widget@v1.29.1...ai-chat-widget@v1.29.2) (2025-07-07)
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
### Bug Fixes
|
|
28
|
+
|
|
29
|
+
* message buttons low res ([#211](https://github.com/stack-spot/portal-ai-chat-widget/issues/211)) ([345134f](https://github.com/stack-spot/portal-ai-chat-widget/commit/345134f37e64f8cdd780d7290b38c6754c99e9bc))
|
|
30
|
+
|
|
31
|
+
## [1.29.1](https://github.com/stack-spot/portal-ai-chat-widget/compare/ai-chat-widget@v1.29.0...ai-chat-widget@v1.29.1) (2025-07-04)
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
### Bug Fixes
|
|
35
|
+
|
|
36
|
+
* calc max height ([#200](https://github.com/stack-spot/portal-ai-chat-widget/issues/200)) ([01d69c0](https://github.com/stack-spot/portal-ai-chat-widget/commit/01d69c04848db47e55b368b1e27a27b4ad24e8a3))
|
|
82
37
|
|
|
83
38
|
## [1.29.0](https://github.com/stack-spot/portal-ai-chat-widget/compare/ai-chat-widget@v1.28.1...ai-chat-widget@v1.29.0) (2025-07-03)
|
|
84
39
|
|
|
@@ -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;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a,4CAiDjB,CAAA"}
|
|
@@ -34,11 +34,10 @@ export const StackspotAIWidget = ({ username, initialAgents, minimizedActions =
|
|
|
34
34
|
const isCurrentChatEmpty = currentChat.length === 0;
|
|
35
35
|
const isTrial = checkIsTrial();
|
|
36
36
|
const features = useCurrentChatState('features');
|
|
37
|
-
const containerRef = useRef(null);
|
|
38
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
|
|
39
38
|
? _jsx(MinimizedHeader, { ...minimizedActions })
|
|
40
|
-
: _jsx(ChatTabSelection, {}) }), _jsxs("div", {
|
|
39
|
+
: _jsx(ChatTabSelection, {}) }), _jsxs("div", { className: "chat-container", ref: chatWindowRef, children: [_jsxs("div", { className: "chat-content", children: [prefix, isCurrentChatEmpty
|
|
41
40
|
? (children ?? _jsx(Home, { username: username, initialAgents: initialAgents, urlCreateAgent: urlCreateAgent }))
|
|
42
|
-
: _jsx(Chat, { username: username, beforeMessage: beforeMessage, afterMessage: afterMessage })] }), features.messageInput && _jsx(MessageInput, {
|
|
41
|
+
: _jsx(Chat, { username: username, beforeMessage: beforeMessage, afterMessage: afterMessage })] }), features.messageInput && _jsx(MessageInput, { chatWindowRef: chatWindowRef })] })] }), _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]);
|
|
43
42
|
};
|
|
44
43
|
//# sour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KAAG,EACT,KAAC,KAAK,KAAG,EACT,cAAK,SAAS,EAAC,kBAAkB,EAAC,GAAG,EAAE,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"}
|
package/dist/app-metadata.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stack-spot/ai-chat-widget",
|
|
3
|
-
"version": "1.30.0
|
|
4
|
-
"date": "
|
|
3
|
+
"version": "1.30.0",
|
|
4
|
+
"date": "Mon Jul 21 2025 20:33:05 GMT+0000 (Coordinated Universal Time)",
|
|
5
5
|
"dependencies": [
|
|
6
6
|
{
|
|
7
7
|
"name": "@stack-spot/app-metadata",
|
|
@@ -113,7 +113,7 @@
|
|
|
113
113
|
},
|
|
114
114
|
{
|
|
115
115
|
"name": "@stack-spot/portal-network",
|
|
116
|
-
"version": "0.
|
|
116
|
+
"version": "0.160.1(@stack-spot/auth@5.3.2)(@stack-spot/opa@2.5.0(@stack-spot/auth@5.3.2)(react-dom@18.2.0(react@18.2.0))(react@18.2.0))(@stack-spot/portal-translate@1.1.0(react-dom@18.2.0(react@18.2.0))(react@18.2.0))(@tanstack/react-query@5.59.16(react@18.2.0))(react-dom@18.2.0(react@18.2.0))(react@18.2.0)"
|
|
117
117
|
},
|
|
118
118
|
{
|
|
119
119
|
"name": "@stack-spot/portal-theme",
|
|
@@ -10,9 +10,9 @@ interface Props extends PropsOf<typeof Textarea> {
|
|
|
10
10
|
*/
|
|
11
11
|
onResetSize?: () => void;
|
|
12
12
|
/**
|
|
13
|
-
*
|
|
13
|
+
* The maximum height this textarea can get to.
|
|
14
14
|
*/
|
|
15
|
-
|
|
15
|
+
maxHeight?: () => number;
|
|
16
16
|
}
|
|
17
17
|
/**
|
|
18
18
|
* The adaptive textarea grows in height whenever needed until the maximum height is reached.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AdaptiveTextArea.d.ts","sourceRoot":"","sources":["../../src/components/AdaptiveTextArea.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAA;AAEvC,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAA;
|
|
1
|
+
{"version":3,"file":"AdaptiveTextArea.d.ts","sourceRoot":"","sources":["../../src/components/AdaptiveTextArea.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAA;AAEvC,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAA;AAElC,UAAU,KAAM,SAAQ,OAAO,CAAC,OAAO,QAAQ,CAAC;IAC9C;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,IAAI,CAAC;IAC5B;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,IAAI,CAAC;IACzB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,MAAM,CAAC;CAC1B;AAED;;GAEG;AACH,eAAO,MAAM,gBAAgB,oHAmC3B,CAAA"}
|
|
@@ -1,22 +1,16 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
/* eslint-disable react/display-name */
|
|
3
3
|
import { Textarea } from '@citric/core';
|
|
4
|
-
import { forwardRef, useEffect,
|
|
5
|
-
import { MIN_INPUT_HEIGHT } from '../views/MessageInput/styled.js';
|
|
4
|
+
import { forwardRef, useEffect, useRef } from 'react';
|
|
6
5
|
/**
|
|
7
6
|
* The adaptive textarea grows in height whenever needed until the maximum height is reached.
|
|
8
7
|
*/
|
|
9
|
-
export const AdaptiveTextArea = forwardRef(({ value, onIncreaseSize, onResetSize, style,
|
|
8
|
+
export const AdaptiveTextArea = forwardRef(({ value, onIncreaseSize, onResetSize, style, maxHeight, ...props }, externalRef) => {
|
|
10
9
|
const localRef = useRef(null);
|
|
11
10
|
const ref = externalRef ?? localRef;
|
|
12
|
-
/**
|
|
13
|
-
* Calculates the maximum height for the textarea.
|
|
14
|
-
* Uses 40% of container height if available, otherwise falls back to MIN_INPUT_HEIGHT.
|
|
15
|
-
*/
|
|
16
|
-
const maxHeight = useMemo(() => containerRef?.current?.offsetHeight ? containerRef?.current?.offsetHeight * 0.4 : MIN_INPUT_HEIGHT, [containerRef?.current?.offsetHeight]);
|
|
17
11
|
const handleIncreaseSize = (newHeight) => {
|
|
18
12
|
onIncreaseSize?.();
|
|
19
|
-
if (maxHeight && newHeight > maxHeight && ref.current) {
|
|
13
|
+
if (maxHeight && newHeight > maxHeight?.() && ref.current) {
|
|
20
14
|
ref.current.style.overflowY = 'auto';
|
|
21
15
|
}
|
|
22
16
|
};
|
|
@@ -25,21 +19,22 @@ export const AdaptiveTextArea = forwardRef(({ value, onIncreaseSize, onResetSize
|
|
|
25
19
|
return;
|
|
26
20
|
const height = ref.current.clientHeight;
|
|
27
21
|
const scroll = ref.current.scrollHeight;
|
|
28
|
-
|
|
22
|
+
const computedMaxHeight = maxHeight?.() ?? 0;
|
|
23
|
+
if (!maxHeight || height < computedMaxHeight) {
|
|
29
24
|
ref.current.style.overflowY = 'hidden';
|
|
30
25
|
if (height < scroll) {
|
|
31
26
|
ref.current.style.height = `${scroll}px`;
|
|
32
27
|
handleIncreaseSize(scroll);
|
|
33
28
|
}
|
|
34
29
|
}
|
|
35
|
-
else if (
|
|
30
|
+
else if (computedMaxHeight) {
|
|
36
31
|
ref.current.style.overflowY = 'auto';
|
|
37
32
|
}
|
|
38
33
|
if (!value) {
|
|
39
34
|
ref.current.style.height = '';
|
|
40
35
|
onResetSize?.();
|
|
41
36
|
}
|
|
42
|
-
}, [value
|
|
43
|
-
return _jsx(Textarea, {
|
|
37
|
+
}, [value]);
|
|
38
|
+
return _jsx(Textarea, { ...props, ref: ref, value: value, style: { ...style, maxHeight: maxHeight?.() } });
|
|
44
39
|
});
|
|
45
40
|
//# sourceMappingURL=AdaptiveTextArea.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AdaptiveTextArea.js","sourceRoot":"","sources":["../../src/components/AdaptiveTextArea.tsx"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAA;AACvC,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,
|
|
1
|
+
{"version":3,"file":"AdaptiveTextArea.js","sourceRoot":"","sources":["../../src/components/AdaptiveTextArea.tsx"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAA;AACvC,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAA;AAkBrD;;GAEG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,UAAU,CAA6B,CACrE,EAAE,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,KAAK,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAClE,WAAW,EACX,EAAE;IACF,MAAM,QAAQ,GAAG,MAAM,CAAsB,IAAI,CAAC,CAAA;IAClD,MAAM,GAAG,GAAG,WAAmD,IAAI,QAAQ,CAAA;IAE3E,MAAM,kBAAkB,GAAG,CAAC,SAAiB,EAAE,EAAE;QAC/C,cAAc,EAAE,EAAE,CAAA;QAClB,IAAI,SAAS,IAAI,SAAS,GAAG,SAAS,EAAE,EAAE,IAAI,GAAG,CAAC,OAAO,EAAE,CAAC;YAC1D,GAAG,CAAC,OAAO,CAAC,KAAK,CAAC,SAAS,GAAG,MAAM,CAAA;QACtC,CAAC;IACH,CAAC,CAAA;IAED,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,CAAC,GAAG,CAAC,OAAO;YAAE,OAAM;QACxB,MAAM,MAAM,GAAG,GAAG,CAAC,OAAO,CAAC,YAAY,CAAA;QACvC,MAAM,MAAM,GAAG,GAAG,CAAC,OAAO,CAAC,YAAY,CAAA;QACvC,MAAM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AAE,cAAc,CAAC,EAAE,KAAK,CAAC;IACxG,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,OAAO,GAAG,QAAQ,CAAC;IAChC,eAAe,CAAC,EAAE,cAAc,CAAC;CAClC;
|
|
1
|
+
{"version":3,"file":"ToolBadge.d.ts","sourceRoot":"","sources":["../../src/components/ToolBadge.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,cAAc,EAAsB,MAAM,0BAA0B,CAAA;AAG7E,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAY,MAAM,OAAO,CAAA;AAEnE,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAA;AAGvD,UAAU,KAAM,SAAQ,QAAQ,CAAC,iBAAiB,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,cAAc,CAAC,EAAE,KAAK,CAAC;IACxG,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,OAAO,GAAG,QAAQ,CAAC;IAChC,eAAe,CAAC,EAAE,cAAc,CAAC;CAClC;AAmFD,eAAO,MAAM,SAAS,6FAC+F,KAAK,4CAiCzH,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ToolBadge.js","sourceRoot":"","sources":["../../src/components/ToolBadge.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AAC5C,OAAO,EAAE,WAAW,EAAE,GAAG,EAAE,MAAM,eAAe,CAAA;AAChD,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AACvC,OAAO,EAAE,cAAc,EAAE,MA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e,IAAI,MAAM,CAAC,CAAC,EACjE,OAAO,EAAE,GAAG,EAAE,CAAC,kBAAkB,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,gBAC9B,eAAe,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,YAE9C,KAAC,WAAW,KAAG,GACJ,IACT,EACL,eAAe,IAAI,KAAC,IAAI,IAAC,SAAS,EAAC,aAAa,EAAC,WAAW,EAAC,WAAW,YAAE,WAAW,GAAQ,IAC1F,CACP,CAAA;IAED,OAAO,CACL,KAAC,MAAM,OAAK,KAAK,sBAAoB,eAAe,EAAE,SAAS,EAAE,SAAS,YACvE,WAAW,CAAC,CAAC,CAAC,KAAC,cAAc,IAAC,SAAS,EAAE,YAAY,YAAG,OAAO,GAAkB,CAAC,CAAC,CAAC,cAAK,SAAS,EAAE,YAAY,YAAG,OAAO,GAAO,GAC3H,CACV,CAAA;AACH,CAAC,CAAA;AAED,MAAM,UAAU,GAAG;IACjB,EAAE,EAAE;QACF,IAAI,EAAE,MAAM;QACZ,KAAK,EAAE,OAAO;KACf;IACD,EAAE,EAAE;QACF,IAAI,EAAE,OAAO;QACb,KAAK,EAAE,QAAQ;KAChB;CACmB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AgentDescription.d.ts","sourceRoot":"","sources":["../../../src/views/Agents/AgentDescription.tsx"],"names":[],"mappings":"AASA,eAAO,MAAM,gBAAgB,gBAAiB;IAAE,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE,
|
|
1
|
+
{"version":3,"file":"AgentDescription.d.ts","sourceRoot":"","sources":["../../../src/views/Agents/AgentDescription.tsx"],"names":[],"mappings":"AASA,eAAO,MAAM,gBAAgB,gBAAiB;IAAE,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE,4CAmEjE,CAAA"}
|
|
@@ -22,10 +22,16 @@ export const AgentDescription = ({ agentId }) => {
|
|
|
22
22
|
}, [numberOfKnowledgeSources]);
|
|
23
23
|
const tools = useMemo(() => {
|
|
24
24
|
const result = [];
|
|
25
|
-
const builtInTools = agent?.toolkits?.builtin_toolkits?.[0]
|
|
25
|
+
const builtInTools = agent?.toolkits?.builtin_toolkits?.[0]?.tools;
|
|
26
|
+
const customToolkits = agent?.toolkits?.custom_toolkits ?? [];
|
|
26
27
|
for (const tool of builtInTools ?? []) {
|
|
27
28
|
const toolWithImage = toolById(tool.id, toolKits);
|
|
28
|
-
result.push(_jsx("li", { children: _jsx(ToolBadge, { name: toolWithImage?.name || toolWithImage?.id || 'unknown', image: toolWithImage?.image }) }, tool.id));
|
|
29
|
+
result.push(_jsx("li", { children: _jsx(ToolBadge, { name: toolWithImage?.name || toolWithImage?.id || 'unknown', image: toolWithImage?.image, style: { maxWidth: '150px' } }) }, tool.id));
|
|
30
|
+
}
|
|
31
|
+
for (const toolkit of customToolkits) {
|
|
32
|
+
for (const tool of toolkit.tools) {
|
|
33
|
+
result.push(_jsx("li", { children: _jsx(ToolBadge, { name: tool.name, image: toolkit.avatar ?? undefined, style: { maxWidth: '150px' } }) }, tool.id));
|
|
34
|
+
}
|
|
29
35
|
}
|
|
30
36
|
return result;
|
|
31
37
|
}, [agent]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AgentDescription.js","sourceRoot":"","sources":["../../../src/views/Agents/AgentDescription.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AACnC,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAC5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAA;AAC7D,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAA;AAC/B,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAA;AACtD,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAC5C,OAAO,EAAE,mBAAmB,EAA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,SAAS,EAAC,OAAO,kCAAyB,EACxE,uBAAK,SAAS,IAAI,gBAAgB,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,gBAAgB,GAAM,IAC9D,EACT,CAAC,CAAC,KAAK,CAAC,MAAM,IAAI,8BACjB,KAAC,IAAI,IAAC,UAAU,EAAC,YAAY,EAAC,SAAS,EAAC,OAAO,YAAE,CAAC,CAAC,KAAK,GAAQ,EAChE,uBAAK,KAAK,GAAM,IACR,EACT,KAAK,EAAE,UAAU,IAAI,8BACpB,KAAC,IAAI,IAAC,UAAU,EAAC,YAAY,EAAC,SAAS,EAAC,OAAO,oBAAW,EAC1D,KAAC,KAAK,IAAC,OAAO,EAAC,QAAQ,EAAC,UAAU,EAAC,QAAQ,YAAE,KAAK,EAAE,UAAU,GAAS,IAC/D,IACU,CACvB,CAAA;AACH,CAAC,CAAA"}
|
|
@@ -20,7 +20,7 @@ const dictionary = {
|
|
|
20
20
|
upload: 'Upload file',
|
|
21
21
|
expand: 'Expand options',
|
|
22
22
|
collapse: 'Collapse options',
|
|
23
|
-
uploadSizeError: 'The following files were not added to the upload list because they\'re larger than $
|
|
23
|
+
uploadSizeError: 'The following files were not added to the upload list because they\'re larger than $0:',
|
|
24
24
|
uploadItemLimitError: 'The following files were not added because no more than $1 items may be uploaded at a time:',
|
|
25
25
|
uploadError: 'An error occurred while uploading the file "$0".',
|
|
26
26
|
uploadDragging: 'Drop the file here to upload',
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* going to be used for the question and the buttons to send, cancel, set the workspace, among others. This also includes the Quick
|
|
4
4
|
* Commands panel for auto completing.
|
|
5
5
|
*/
|
|
6
|
-
export declare const MessageInput: ({
|
|
7
|
-
|
|
6
|
+
export declare const MessageInput: ({ chatWindowRef }: {
|
|
7
|
+
chatWindowRef?: React.RefObject<HTMLElement>;
|
|
8
8
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
9
9
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/views/MessageInput/index.tsx"],"names":[],"mappings":"AAsBA;;;;GAIG;AACH,eAAO,MAAM,YAAY,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/views/MessageInput/index.tsx"],"names":[],"mappings":"AAsBA;;;;GAIG;AACH,eAAO,MAAM,YAAY,sBAAuB;IAAE,aAAa,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,CAAC,CAAA;CAAE,4CA6H/F,CAAA"}
|
|
@@ -4,7 +4,7 @@ import { interpolate } from '@stack-spot/portal-translate';
|
|
|
4
4
|
import { useCallback, useEffect, useRef, useState } from 'react';
|
|
5
5
|
import { AdaptiveTextArea } from '../../components/AdaptiveTextArea.js';
|
|
6
6
|
import { ProgressBar } from '../../components/ProgressBar.js';
|
|
7
|
-
import { useCurrentChat, useCurrentChatState } from '../../context/hooks.js';
|
|
7
|
+
import { useCurrentChat, useCurrentChatState, useWidgetState } from '../../context/hooks.js';
|
|
8
8
|
import { quickCommandRegex } from '../../regex.js';
|
|
9
9
|
import { ChatEntry } from '../../state/ChatEntry.js';
|
|
10
10
|
import { checkIsTrial } from '../../utils/check-is-trial.js';
|
|
@@ -17,7 +17,7 @@ import { useUserEntryHistoryShortcut } from './chat-entry-history.js';
|
|
|
17
17
|
import { ContextBar } from './ContextBar.js';
|
|
18
18
|
import { useMessageInputDictionary } from './dictionary.js';
|
|
19
19
|
import { QuickCommandSelector } from './QuickCommandSelector.js';
|
|
20
|
-
import { MessageInputBox } from './styled.js';
|
|
20
|
+
import { MessageInputBox, MIN_INPUT_HEIGHT } from './styled.js';
|
|
21
21
|
import { UploadBar } from './UploadBar.js';
|
|
22
22
|
import { UploadDragNDrop, useUploadDragDrop } from './UploadDragNDrop.js';
|
|
23
23
|
/**
|
|
@@ -25,7 +25,7 @@ import { UploadDragNDrop, useUploadDragDrop } from './UploadDragNDrop.js';
|
|
|
25
25
|
* going to be used for the question and the buttons to send, cancel, set the workspace, among others. This also includes the Quick
|
|
26
26
|
* Commands panel for auto completing.
|
|
27
27
|
*/
|
|
28
|
-
export const MessageInput = ({
|
|
28
|
+
export const MessageInput = ({ chatWindowRef }) => {
|
|
29
29
|
const t = useMessageInputDictionary();
|
|
30
30
|
const [focused, setFocused] = useState(false);
|
|
31
31
|
const [, setExpanded] = useState(true);
|
|
@@ -33,6 +33,7 @@ export const MessageInput = ({ containerRef }) => {
|
|
|
33
33
|
const chat = useCurrentChat();
|
|
34
34
|
const isLoading = useCurrentChatState('isLoading') ?? false;
|
|
35
35
|
const value = useCurrentChatState('nextMessage') ?? '';
|
|
36
|
+
const isMinimized = useWidgetState('isMinimized');
|
|
36
37
|
const textAreaRef = useRef(null);
|
|
37
38
|
const agentLabel = useCurrentChatState('agent')?.label;
|
|
38
39
|
const { handleKeyDown, handleKeyUp } = useUserEntryHistoryShortcut();
|
|
@@ -103,7 +104,9 @@ export const MessageInput = ({ containerRef }) => {
|
|
|
103
104
|
if (!isLoading)
|
|
104
105
|
textAreaRef.current?.focus();
|
|
105
106
|
}, [isLoading]);
|
|
106
|
-
return (_jsxs(UploadProvider, { value: chat.uploadManager, children: [_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, {
|
|
107
|
+
return (_jsxs(UploadProvider, { value: chat.uploadManager, children: [_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, { maxHeight: () => isMinimized
|
|
108
|
+
? MIN_INPUT_HEIGHT
|
|
109
|
+
: (chatWindowRef?.current?.querySelector('.chat-container')?.clientHeight ?? 0) / 2, ref: textAreaRef, placeholder: agentLabel
|
|
107
110
|
? interpolate(t.placeholder, agentLabel)
|
|
108
111
|
: t.typing, 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) })] })] }), _jsx(ProgressBar, { visible: true, animate: isLoading, backgroundColor: isLoading || !focused ? theme.color.light[500] : theme.color.primary[500] }), _jsx(ContextBar, {}), chat.get('features').upload && _jsx(UploadBar, {}), _jsx(ButtonBar, { onSend: onSend, isLoading: isLoading })] }), _jsx(UploadDragNDrop, { isDragging: isDragging, onDrop: handleDrop, onDragLeave: handleDragLeave })] }));
|
|
109
112
|
};
|
|
@@ -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,MAAM,qBAAqB,CAAA;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../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AW,CAAC,KAAK,CAAC,EACxC,WAAW,EAAE,GAAG,EAAE,CAAC,CAAC,eAAe,CAAC,OAAO,IAAI,WAAW,CAAC,IAAI,CAAC,GAChE,IACE,IACF,EACN,KAAC,WAAW,IAAC,OAAO,EAAE,IAAI,EAAE,OAAO,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,UAAU,KAAG,EACb,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,MAAM,IAAI,KAAC,SAAS,KAAG,EAC7C,KAAC,SAAS,IAAC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,SAAS,GAAI,IACnC,EAClB,KAAC,eAAe,IAAC,UAAU,EAAE,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,WAAW,EAAE,eAAe,GAAI,IAC9E,CAClB,CAAA;AACH,CAAC,CAAA"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
export declare const MAX_INPUT_HEIGHT = 200;
|
|
2
1
|
export declare const MIN_INPUT_HEIGHT = 24;
|
|
3
2
|
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;
|
|
4
3
|
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>, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styled.d.ts","sourceRoot":"","sources":["../../../src/views/MessageInput/styled.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,gBAAgB,
|
|
1
|
+
{"version":3,"file":"styled.d.ts","sourceRoot":"","sources":["../../../src/views/MessageInput/styled.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,gBAAgB,KAAK,CAAA;AAElC,eAAO,MAAM,mBAAmB,wOAyC/B,CAAA;AAED,eAAO,MAAM,eAAe;oBAA+B,OAAO;YAkPjE,CAAA"}
|
|
@@ -5,7 +5,6 @@ const CONTEXT_BAR_HEIGHT = 38;
|
|
|
5
5
|
const CONTEXT_BAR_DISPLACEMENT = 4;
|
|
6
6
|
const UPLOAD_BAR_HEIGHT = 60;
|
|
7
7
|
const UPLOAD_BAR_DISPLACEMENT = 4;
|
|
8
|
-
export const MAX_INPUT_HEIGHT = 200;
|
|
9
8
|
export const MIN_INPUT_HEIGHT = 24;
|
|
10
9
|
export const SelectionBarWrapper = styled.div `
|
|
11
10
|
display: inline-flex;
|
|
@@ -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,kBAAkB,GAAG,EAAE,CAAA;AAC7B,MAAM,wBAAwB,GAAG,CAAC,CAAA;AAClC,MAAM,iBAAiB,GAAG,EAAE,CAAA;AAC5B,MAAM,uBAAuB,GAAG,CAAC,CAAA;AACjC,MAAM,CAAC,MAAM,gBAAgB,GAAG,
|
|
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,kBAAkB,GAA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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;;;;;;;;;;;;;;;;;;;8BAmBpB,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC;;;;;;;;;cAStC,gBAAgB;;;;;;;;CAQ7B,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stack-spot/ai-chat-widget",
|
|
3
|
-
"version": "1.30.0
|
|
3
|
+
"version": "1.30.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"@citric/core": "^6.4.0",
|
|
14
14
|
"@stack-spot/portal-components": "^2.22.1",
|
|
15
15
|
"@citric/icons": "^5.13.0",
|
|
16
|
-
"@stack-spot/portal-network": "0.
|
|
16
|
+
"@stack-spot/portal-network": "^0.160.1",
|
|
17
17
|
"@citric/ui": "^6.10.2",
|
|
18
18
|
"@stack-spot/portal-theme": "^1.0.0",
|
|
19
19
|
"@stack-spot/portal-translate": "^1.1.0",
|
|
@@ -83,7 +83,6 @@ export const StackspotAIWidget = (
|
|
|
83
83
|
const isCurrentChatEmpty = currentChat.length === 0
|
|
84
84
|
const isTrial = checkIsTrial()
|
|
85
85
|
const features = useCurrentChatState('features')
|
|
86
|
-
const containerRef = useRef<HTMLDivElement>(null)
|
|
87
86
|
|
|
88
87
|
return useMemo(() => (
|
|
89
88
|
<FallbackBoundary>
|
|
@@ -98,7 +97,7 @@ export const StackspotAIWidget = (
|
|
|
98
97
|
}
|
|
99
98
|
</>
|
|
100
99
|
}
|
|
101
|
-
<div
|
|
100
|
+
<div className="chat-container" ref={chatWindowRef}>
|
|
102
101
|
<div className="chat-content">
|
|
103
102
|
{prefix}
|
|
104
103
|
{isCurrentChatEmpty
|
|
@@ -106,7 +105,7 @@ export const StackspotAIWidget = (
|
|
|
106
105
|
: <Chat username={username} beforeMessage={beforeMessage} afterMessage={afterMessage} />
|
|
107
106
|
}
|
|
108
107
|
</div>
|
|
109
|
-
{features.messageInput && <MessageInput
|
|
108
|
+
{features.messageInput && <MessageInput chatWindowRef={chatWindowRef} />}
|
|
110
109
|
</div>
|
|
111
110
|
</div>
|
|
112
111
|
<Stacks />
|
package/src/app-metadata.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stack-spot/ai-chat-widget",
|
|
3
|
-
"version": "1.30.0
|
|
4
|
-
"date": "
|
|
3
|
+
"version": "1.30.0",
|
|
4
|
+
"date": "Mon Jul 21 2025 20:33:05 GMT+0000 (Coordinated Universal Time)",
|
|
5
5
|
"dependencies": [
|
|
6
6
|
{
|
|
7
7
|
"name": "@stack-spot/app-metadata",
|
|
@@ -113,7 +113,7 @@
|
|
|
113
113
|
},
|
|
114
114
|
{
|
|
115
115
|
"name": "@stack-spot/portal-network",
|
|
116
|
-
"version": "0.
|
|
116
|
+
"version": "0.160.1(@stack-spot/auth@5.3.2)(@stack-spot/opa@2.5.0(@stack-spot/auth@5.3.2)(react-dom@18.2.0(react@18.2.0))(react@18.2.0))(@stack-spot/portal-translate@1.1.0(react-dom@18.2.0(react@18.2.0))(react@18.2.0))(@tanstack/react-query@5.59.16(react@18.2.0))(react-dom@18.2.0(react@18.2.0))(react@18.2.0)"
|
|
117
117
|
},
|
|
118
118
|
{
|
|
119
119
|
"name": "@stack-spot/portal-theme",
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
/* eslint-disable react/display-name */
|
|
2
2
|
import { Textarea } from '@citric/core'
|
|
3
|
-
import { forwardRef, useEffect,
|
|
3
|
+
import { forwardRef, useEffect, useRef } from 'react'
|
|
4
4
|
import { PropsOf } from '../types'
|
|
5
|
-
import { MIN_INPUT_HEIGHT } from '../views/MessageInput/styled'
|
|
6
5
|
|
|
7
6
|
interface Props extends PropsOf<typeof Textarea> {
|
|
8
7
|
/**
|
|
@@ -14,32 +13,24 @@ interface Props extends PropsOf<typeof Textarea> {
|
|
|
14
13
|
*/
|
|
15
14
|
onResetSize?: () => void,
|
|
16
15
|
/**
|
|
17
|
-
*
|
|
16
|
+
* The maximum height this textarea can get to.
|
|
18
17
|
*/
|
|
19
|
-
|
|
18
|
+
maxHeight?: () => number,
|
|
20
19
|
}
|
|
21
20
|
|
|
22
21
|
/**
|
|
23
22
|
* The adaptive textarea grows in height whenever needed until the maximum height is reached.
|
|
24
23
|
*/
|
|
25
24
|
export const AdaptiveTextArea = forwardRef<HTMLTextAreaElement, Props>((
|
|
26
|
-
{ value, onIncreaseSize, onResetSize, style,
|
|
25
|
+
{ value, onIncreaseSize, onResetSize, style, maxHeight, ...props },
|
|
27
26
|
externalRef,
|
|
28
27
|
) => {
|
|
29
28
|
const localRef = useRef<HTMLTextAreaElement>(null)
|
|
30
29
|
const ref = externalRef as React.RefObject<HTMLTextAreaElement> ?? localRef
|
|
31
|
-
/**
|
|
32
|
-
* Calculates the maximum height for the textarea.
|
|
33
|
-
* Uses 40% of container height if available, otherwise falls back to MIN_INPUT_HEIGHT.
|
|
34
|
-
*/
|
|
35
|
-
const maxHeight = useMemo(
|
|
36
|
-
() => containerRef?.current?.offsetHeight ? containerRef?.current?.offsetHeight * 0.4 : MIN_INPUT_HEIGHT,
|
|
37
|
-
[containerRef?.current?.offsetHeight],
|
|
38
|
-
)
|
|
39
30
|
|
|
40
31
|
const handleIncreaseSize = (newHeight: number) => {
|
|
41
32
|
onIncreaseSize?.()
|
|
42
|
-
if (maxHeight && newHeight > maxHeight && ref.current) {
|
|
33
|
+
if (maxHeight && newHeight > maxHeight?.() && ref.current) {
|
|
43
34
|
ref.current.style.overflowY = 'auto'
|
|
44
35
|
}
|
|
45
36
|
}
|
|
@@ -48,20 +39,21 @@ export const AdaptiveTextArea = forwardRef<HTMLTextAreaElement, Props>((
|
|
|
48
39
|
if (!ref.current) return
|
|
49
40
|
const height = ref.current.clientHeight
|
|
50
41
|
const scroll = ref.current.scrollHeight
|
|
51
|
-
|
|
42
|
+
const computedMaxHeight = maxHeight?.() ?? 0
|
|
43
|
+
if (!maxHeight || height < computedMaxHeight) {
|
|
52
44
|
ref.current.style.overflowY = 'hidden'
|
|
53
45
|
if (height < scroll) {
|
|
54
46
|
ref.current.style.height = `${scroll}px`
|
|
55
47
|
handleIncreaseSize(scroll)
|
|
56
48
|
}
|
|
57
|
-
} else if (
|
|
49
|
+
} else if (computedMaxHeight) {
|
|
58
50
|
ref.current.style.overflowY = 'auto'
|
|
59
51
|
}
|
|
60
52
|
if (!value) {
|
|
61
53
|
ref.current.style.height = ''
|
|
62
54
|
onResetSize?.()
|
|
63
55
|
}
|
|
64
|
-
}, [value
|
|
56
|
+
}, [value])
|
|
65
57
|
|
|
66
|
-
return <Textarea
|
|
58
|
+
return <Textarea {...props} ref={ref} value={value} style={{ ...style, maxHeight: maxHeight?.() }} />
|
|
67
59
|
})
|
|
@@ -28,12 +28,28 @@ export const AgentDescription = ({ agentId }: { agentId?: string }) => {
|
|
|
28
28
|
}, [numberOfKnowledgeSources])
|
|
29
29
|
const tools = useMemo(() => {
|
|
30
30
|
const result: React.ReactElement[] = []
|
|
31
|
-
const builtInTools = agent?.toolkits?.builtin_toolkits?.[0]
|
|
31
|
+
const builtInTools = agent?.toolkits?.builtin_toolkits?.[0]?.tools
|
|
32
|
+
const customToolkits = agent?.toolkits?.custom_toolkits ?? []
|
|
32
33
|
for (const tool of builtInTools ?? []) {
|
|
33
34
|
const toolWithImage = toolById(tool.id, toolKits)
|
|
34
|
-
result.push(
|
|
35
|
-
<
|
|
36
|
-
|
|
35
|
+
result.push(
|
|
36
|
+
<li key={tool.id}>
|
|
37
|
+
<ToolBadge
|
|
38
|
+
name={toolWithImage?.name || toolWithImage?.id || 'unknown'}
|
|
39
|
+
image={toolWithImage?.image}
|
|
40
|
+
style={{ maxWidth: '150px' }}
|
|
41
|
+
/>
|
|
42
|
+
</li>,
|
|
43
|
+
)
|
|
44
|
+
}
|
|
45
|
+
for (const toolkit of customToolkits) {
|
|
46
|
+
for (const tool of toolkit.tools) {
|
|
47
|
+
result.push(
|
|
48
|
+
<li key={tool.id}>
|
|
49
|
+
<ToolBadge name={tool.name} image={toolkit.avatar ?? undefined} style={{ maxWidth: '150px' }} />
|
|
50
|
+
</li>,
|
|
51
|
+
)
|
|
52
|
+
}
|
|
37
53
|
}
|
|
38
54
|
return result
|
|
39
55
|
}, [agent])
|
|
@@ -21,7 +21,7 @@ const dictionary = {
|
|
|
21
21
|
upload: 'Upload file',
|
|
22
22
|
expand: 'Expand options',
|
|
23
23
|
collapse: 'Collapse options',
|
|
24
|
-
uploadSizeError: 'The following files were not added to the upload list because they\'re larger than $
|
|
24
|
+
uploadSizeError: 'The following files were not added to the upload list because they\'re larger than $0:',
|
|
25
25
|
uploadItemLimitError: 'The following files were not added because no more than $1 items may be uploaded at a time:',
|
|
26
26
|
uploadError: 'An error occurred while uploading the file "$0".',
|
|
27
27
|
uploadDragging: 'Drop the file here to upload',
|
|
@@ -3,7 +3,7 @@ import { interpolate } from '@stack-spot/portal-translate'
|
|
|
3
3
|
import { useCallback, useEffect, useRef, useState } from 'react'
|
|
4
4
|
import { AdaptiveTextArea } from '../../components/AdaptiveTextArea'
|
|
5
5
|
import { ProgressBar } from '../../components/ProgressBar'
|
|
6
|
-
import { useCurrentChat, useCurrentChatState } from '../../context/hooks'
|
|
6
|
+
import { useCurrentChat, useCurrentChatState, useWidgetState } from '../../context/hooks'
|
|
7
7
|
import { quickCommandRegex } from '../../regex'
|
|
8
8
|
import { ChatEntry } from '../../state/ChatEntry'
|
|
9
9
|
import { checkIsTrial } from '../../utils/check-is-trial'
|
|
@@ -16,7 +16,7 @@ import { useUserEntryHistoryShortcut } from './chat-entry-history'
|
|
|
16
16
|
import { ContextBar } from './ContextBar'
|
|
17
17
|
import { useMessageInputDictionary } from './dictionary'
|
|
18
18
|
import { QuickCommandSelector } from './QuickCommandSelector'
|
|
19
|
-
import { MessageInputBox } from './styled'
|
|
19
|
+
import { MessageInputBox, MIN_INPUT_HEIGHT } from './styled'
|
|
20
20
|
import { UploadBar } from './UploadBar'
|
|
21
21
|
import { UploadDragNDrop, useUploadDragDrop } from './UploadDragNDrop'
|
|
22
22
|
|
|
@@ -25,7 +25,7 @@ import { UploadDragNDrop, useUploadDragDrop } from './UploadDragNDrop'
|
|
|
25
25
|
* going to be used for the question and the buttons to send, cancel, set the workspace, among others. This also includes the Quick
|
|
26
26
|
* Commands panel for auto completing.
|
|
27
27
|
*/
|
|
28
|
-
export const MessageInput = ({
|
|
28
|
+
export const MessageInput = ({ chatWindowRef }: { chatWindowRef?: React.RefObject<HTMLElement> }) => {
|
|
29
29
|
const t = useMessageInputDictionary()
|
|
30
30
|
const [focused, setFocused] = useState(false)
|
|
31
31
|
const [, setExpanded] = useState(true)
|
|
@@ -33,6 +33,7 @@ export const MessageInput = ({ containerRef }: { containerRef?: React.RefObject<
|
|
|
33
33
|
const chat = useCurrentChat()
|
|
34
34
|
const isLoading = useCurrentChatState('isLoading') ?? false
|
|
35
35
|
const value = useCurrentChatState('nextMessage') ?? ''
|
|
36
|
+
const isMinimized = useWidgetState('isMinimized')
|
|
36
37
|
const textAreaRef = useRef<HTMLTextAreaElement>(null)
|
|
37
38
|
const agentLabel = useCurrentChatState('agent')?.label
|
|
38
39
|
const { handleKeyDown, handleKeyUp } = useUserEntryHistoryShortcut()
|
|
@@ -119,7 +120,10 @@ export const MessageInput = ({ containerRef }: { containerRef?: React.RefObject<
|
|
|
119
120
|
<div className={listToClass(['action-box', focused && 'focused', isLoading && 'disabled'])}>
|
|
120
121
|
<ButtonAgent />
|
|
121
122
|
<AdaptiveTextArea
|
|
122
|
-
|
|
123
|
+
maxHeight={() => isMinimized
|
|
124
|
+
? MIN_INPUT_HEIGHT
|
|
125
|
+
: (chatWindowRef?.current?.querySelector('.chat-container')?.clientHeight ?? 0) / 2
|
|
126
|
+
}
|
|
123
127
|
ref={textAreaRef}
|
|
124
128
|
placeholder={
|
|
125
129
|
agentLabel
|