@copilotkit/react-ui 1.50.0-beta.1 → 1.50.0-beta.11
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 +110 -0
- package/dist/{chunk-SOB5EIL7.mjs → chunk-4APTIMH3.mjs} +2 -2
- package/dist/{chunk-ODEHR7KI.mjs → chunk-7OURDQZJ.mjs} +2 -2
- package/dist/{chunk-GDSZGYCE.mjs → chunk-B4EBCYMS.mjs} +4 -4
- package/dist/{chunk-3JYVJHL5.mjs → chunk-ETQOY3FA.mjs} +8 -8
- package/dist/{chunk-FFJHOZX6.mjs → chunk-FKJWIQGB.mjs} +9 -9
- package/dist/{chunk-E6WVAOQA.mjs → chunk-HIW7RXCD.mjs} +2 -2
- package/dist/{chunk-CQ2WALZ7.mjs → chunk-I2YM5J5H.mjs} +2 -2
- package/dist/{chunk-G35HUUDA.mjs → chunk-LG6H5CG5.mjs} +5 -5
- package/dist/{chunk-MPF6BJUF.mjs → chunk-NCIAFFQ2.mjs} +4 -2
- package/dist/{chunk-MPF6BJUF.mjs.map → chunk-NCIAFFQ2.mjs.map} +1 -1
- package/dist/{chunk-3YWFGNSM.mjs → chunk-RYUCX3ZK.mjs} +1 -1
- package/dist/chunk-RYUCX3ZK.mjs.map +1 -0
- package/dist/{chunk-HBZW7E5Z.mjs → chunk-SABFRQEH.mjs} +6 -6
- package/dist/chunk-SABFRQEH.mjs.map +1 -0
- package/dist/{chunk-OYRZ4VLU.mjs → chunk-Y4FKRAKJ.mjs} +3 -3
- package/dist/{chunk-OYRZ4VLU.mjs.map → chunk-Y4FKRAKJ.mjs.map} +1 -1
- package/dist/components/chat/Chat.js +4 -2
- package/dist/components/chat/Chat.js.map +1 -1
- package/dist/components/chat/Chat.mjs +8 -8
- package/dist/components/chat/Header.mjs +5 -5
- package/dist/components/chat/Input.js +2 -2
- package/dist/components/chat/Input.js.map +1 -1
- package/dist/components/chat/Input.mjs +2 -2
- package/dist/components/chat/Messages.js +2 -0
- package/dist/components/chat/Messages.js.map +1 -1
- package/dist/components/chat/Messages.mjs +5 -5
- package/dist/components/chat/Modal.js +4 -2
- package/dist/components/chat/Modal.js.map +1 -1
- package/dist/components/chat/Modal.mjs +17 -17
- package/dist/components/chat/Popup.js +4 -2
- package/dist/components/chat/Popup.js.map +1 -1
- package/dist/components/chat/Popup.mjs +18 -18
- package/dist/components/chat/Sidebar.js +4 -2
- package/dist/components/chat/Sidebar.js.map +1 -1
- package/dist/components/chat/Sidebar.mjs +18 -18
- package/dist/components/chat/index.js +4 -2
- package/dist/components/chat/index.js.map +1 -1
- package/dist/components/chat/index.mjs +21 -21
- package/dist/components/chat/messages/AssistantMessage.mjs +1 -1
- package/dist/components/chat/messages/ErrorMessage.mjs +1 -1
- package/dist/components/chat/messages/LegacyRenderMessage.js +2 -0
- package/dist/components/chat/messages/LegacyRenderMessage.js.map +1 -1
- package/dist/components/chat/messages/LegacyRenderMessage.mjs +4 -4
- package/dist/components/chat/messages/RenderMessage.d.ts +1 -1
- package/dist/components/chat/messages/RenderMessage.js +2 -0
- package/dist/components/chat/messages/RenderMessage.js.map +1 -1
- package/dist/components/chat/messages/RenderMessage.mjs +3 -3
- package/dist/components/chat/messages/UserMessage.js.map +1 -1
- package/dist/components/chat/messages/UserMessage.mjs +1 -1
- package/dist/components/dev-console/console.mjs +3 -3
- package/dist/components/dev-console/index.mjs +5 -5
- package/dist/components/index.js +4 -2
- package/dist/components/index.js.map +1 -1
- package/dist/components/index.mjs +25 -25
- package/dist/hooks/index.js +1 -1
- package/dist/hooks/index.js.map +1 -1
- package/dist/hooks/index.mjs +1 -1
- package/dist/hooks/use-copilot-chat-suggestions.js +1 -1
- package/dist/hooks/use-copilot-chat-suggestions.js.map +1 -1
- package/dist/hooks/use-copilot-chat-suggestions.mjs +1 -1
- package/dist/index.css +1 -0
- package/dist/index.css.map +1 -1
- package/dist/index.js +5 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +26 -26
- package/dist/v2/index.css +4 -0
- package/dist/v2/index.css.map +1 -0
- package/dist/v2/index.d.ts +2 -0
- package/dist/v2/index.js +2 -0
- package/dist/v2/index.js.map +1 -0
- package/dist/v2/index.mjs +2 -0
- package/dist/v2/index.mjs.map +1 -0
- package/package.json +7 -7
- package/src/components/chat/Input.tsx +2 -2
- package/src/components/chat/messages/RenderMessage.tsx +2 -0
- package/src/components/chat/messages/UserMessage.tsx +12 -10
- package/src/css/messages.css +1 -0
- package/src/hooks/use-copilot-chat-suggestions.tsx +2 -2
- package/src/v2/index.ts +1 -0
- package/src/v2/styles.css +1 -0
- package/tsup.config.ts +1 -1
- package/dist/chunk-3YWFGNSM.mjs.map +0 -1
- package/dist/chunk-HBZW7E5Z.mjs.map +0 -1
- /package/dist/{chunk-SOB5EIL7.mjs.map → chunk-4APTIMH3.mjs.map} +0 -0
- /package/dist/{chunk-ODEHR7KI.mjs.map → chunk-7OURDQZJ.mjs.map} +0 -0
- /package/dist/{chunk-GDSZGYCE.mjs.map → chunk-B4EBCYMS.mjs.map} +0 -0
- /package/dist/{chunk-3JYVJHL5.mjs.map → chunk-ETQOY3FA.mjs.map} +0 -0
- /package/dist/{chunk-FFJHOZX6.mjs.map → chunk-FKJWIQGB.mjs.map} +0 -0
- /package/dist/{chunk-E6WVAOQA.mjs.map → chunk-HIW7RXCD.mjs.map} +0 -0
- /package/dist/{chunk-CQ2WALZ7.mjs.map → chunk-I2YM5J5H.mjs.map} +0 -0
- /package/dist/{chunk-G35HUUDA.mjs.map → chunk-LG6H5CG5.mjs.map} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,115 @@
|
|
|
1
1
|
# ui
|
|
2
2
|
|
|
3
|
+
## 1.50.0-beta.11
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- fix telemetry in v1.50 runtime
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Updated dependencies
|
|
12
|
+
- @copilotkit/runtime-client-gql@1.50.0-beta.11
|
|
13
|
+
- @copilotkit/react-core@1.50.0-beta.11
|
|
14
|
+
- @copilotkit/shared@1.50.0-beta.11
|
|
15
|
+
|
|
16
|
+
## 1.50.0-beta.10
|
|
17
|
+
|
|
18
|
+
### Minor Changes
|
|
19
|
+
|
|
20
|
+
- add new runner with telemetry baked in
|
|
21
|
+
|
|
22
|
+
### Patch Changes
|
|
23
|
+
|
|
24
|
+
- Updated dependencies
|
|
25
|
+
- @copilotkit/runtime-client-gql@1.50.0-beta.10
|
|
26
|
+
- @copilotkit/react-core@1.50.0-beta.10
|
|
27
|
+
- @copilotkit/shared@1.50.0-beta.10
|
|
28
|
+
|
|
29
|
+
## 1.50.0-beta.9
|
|
30
|
+
|
|
31
|
+
### Minor Changes
|
|
32
|
+
|
|
33
|
+
- Refactor suggestions to not always run
|
|
34
|
+
|
|
35
|
+
### Patch Changes
|
|
36
|
+
|
|
37
|
+
- Updated dependencies
|
|
38
|
+
- @copilotkit/runtime-client-gql@1.50.0-beta.9
|
|
39
|
+
- @copilotkit/react-core@1.50.0-beta.9
|
|
40
|
+
- @copilotkit/shared@1.50.0-beta.9
|
|
41
|
+
|
|
42
|
+
## 1.50.0-beta.8
|
|
43
|
+
|
|
44
|
+
### Patch Changes
|
|
45
|
+
|
|
46
|
+
- @copilotkit/react-core@1.50.0-beta.8
|
|
47
|
+
- @copilotkit/runtime-client-gql@1.50.0-beta.8
|
|
48
|
+
- @copilotkit/shared@1.50.0-beta.8
|
|
49
|
+
|
|
50
|
+
## 1.50.0-beta.7
|
|
51
|
+
|
|
52
|
+
### Patch Changes
|
|
53
|
+
|
|
54
|
+
- Updated dependencies [6ce0edc]
|
|
55
|
+
- @copilotkit/react-core@1.50.0-beta.7
|
|
56
|
+
- @copilotkit/runtime-client-gql@1.50.0-beta.7
|
|
57
|
+
- @copilotkit/shared@1.50.0-beta.7
|
|
58
|
+
|
|
59
|
+
## 1.50.0-beta.6
|
|
60
|
+
|
|
61
|
+
### Minor Changes
|
|
62
|
+
|
|
63
|
+
- Updating dependency versions across all packages
|
|
64
|
+
|
|
65
|
+
### Patch Changes
|
|
66
|
+
|
|
67
|
+
- Updated dependencies
|
|
68
|
+
- @copilotkit/runtime-client-gql@1.50.0-beta.6
|
|
69
|
+
- @copilotkit/react-core@1.50.0-beta.6
|
|
70
|
+
- @copilotkit/shared@1.50.0-beta.6
|
|
71
|
+
|
|
72
|
+
## 1.50.0-beta.4
|
|
73
|
+
|
|
74
|
+
### Patch Changes
|
|
75
|
+
|
|
76
|
+
- 2c93ff1: - fix: re-enable repeatable interrupt renders
|
|
77
|
+
- b0e3652: - chore: Update to latest of vnext
|
|
78
|
+
- c38da1c: - feat: add suggestions support to 1.5
|
|
79
|
+
- 5840bab: - fix: adjust dependencies
|
|
80
|
+
- 7808fac: - feat: add spinner indicator to show chat readiness for conversation
|
|
81
|
+
- Updated dependencies [bad5f06]
|
|
82
|
+
- Updated dependencies [8ce60af]
|
|
83
|
+
- Updated dependencies [33f47e3]
|
|
84
|
+
- Updated dependencies [04057d5]
|
|
85
|
+
- Updated dependencies [2c93ff1]
|
|
86
|
+
- Updated dependencies [b0e3652]
|
|
87
|
+
- Updated dependencies [7643e71]
|
|
88
|
+
- Updated dependencies [d55a8bd]
|
|
89
|
+
- Updated dependencies [c38da1c]
|
|
90
|
+
- Updated dependencies [3c60073]
|
|
91
|
+
- Updated dependencies [962546c]
|
|
92
|
+
- Updated dependencies [4942f62]
|
|
93
|
+
- Updated dependencies [ca8eb39]
|
|
94
|
+
- Updated dependencies [907ae5d]
|
|
95
|
+
- Updated dependencies [c3d55e5]
|
|
96
|
+
- Updated dependencies [5840bab]
|
|
97
|
+
- Updated dependencies [7808fac]
|
|
98
|
+
- Updated dependencies [c70210e]
|
|
99
|
+
- Updated dependencies [d2c57a1]
|
|
100
|
+
- @copilotkit/react-core@1.50.0-beta.4
|
|
101
|
+
- @copilotkit/runtime-client-gql@1.50.0-beta.4
|
|
102
|
+
- @copilotkit/shared@1.50.0-beta.4
|
|
103
|
+
|
|
104
|
+
## 1.10.7-next.0
|
|
105
|
+
|
|
106
|
+
### Patch Changes
|
|
107
|
+
|
|
108
|
+
- fcc52cb: - fix: use `--copilot-kit-primary-color` as default `Messages` font color
|
|
109
|
+
- @copilotkit/react-core@1.10.7-next.0
|
|
110
|
+
- @copilotkit/runtime-client-gql@1.10.7-next.0
|
|
111
|
+
- @copilotkit/shared@1.10.7-next.0
|
|
112
|
+
|
|
3
113
|
## 1.10.6
|
|
4
114
|
|
|
5
115
|
### Patch Changes
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
CopilotModal
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-ETQOY3FA.mjs";
|
|
4
4
|
import {
|
|
5
5
|
__spreadProps,
|
|
6
6
|
__spreadValues
|
|
@@ -27,4 +27,4 @@ function CopilotSidebar(props) {
|
|
|
27
27
|
export {
|
|
28
28
|
CopilotSidebar
|
|
29
29
|
};
|
|
30
|
-
//# sourceMappingURL=chunk-
|
|
30
|
+
//# sourceMappingURL=chunk-4APTIMH3.mjs.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
RenderMessage
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-NCIAFFQ2.mjs";
|
|
4
4
|
|
|
5
5
|
// src/components/chat/messages/LegacyRenderMessage.tsx
|
|
6
6
|
import { aguiToGQL } from "@copilotkit/runtime-client-gql";
|
|
@@ -130,4 +130,4 @@ var LegacyRenderMessage = ({
|
|
|
130
130
|
export {
|
|
131
131
|
LegacyRenderMessage
|
|
132
132
|
};
|
|
133
|
-
//# sourceMappingURL=chunk-
|
|
133
|
+
//# sourceMappingURL=chunk-7OURDQZJ.mjs.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
CopilotDevConsole
|
|
3
|
-
} from "./chunk-FFJHOZX6.mjs";
|
|
4
1
|
import {
|
|
5
2
|
useChatContext
|
|
6
3
|
} from "./chunk-IEMQ2SQW.mjs";
|
|
4
|
+
import {
|
|
5
|
+
CopilotDevConsole
|
|
6
|
+
} from "./chunk-FKJWIQGB.mjs";
|
|
7
7
|
|
|
8
8
|
// src/components/chat/Header.tsx
|
|
9
9
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -29,4 +29,4 @@ var Header = ({}) => {
|
|
|
29
29
|
export {
|
|
30
30
|
Header
|
|
31
31
|
};
|
|
32
|
-
//# sourceMappingURL=chunk-
|
|
32
|
+
//# sourceMappingURL=chunk-B4EBCYMS.mjs.map
|
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Window
|
|
3
3
|
} from "./chunk-C3GSYRC3.mjs";
|
|
4
|
-
import {
|
|
5
|
-
Header
|
|
6
|
-
} from "./chunk-GDSZGYCE.mjs";
|
|
7
4
|
import {
|
|
8
5
|
Button
|
|
9
6
|
} from "./chunk-UFN2VWSR.mjs";
|
|
10
7
|
import {
|
|
11
8
|
CopilotChat
|
|
12
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-LG6H5CG5.mjs";
|
|
13
10
|
import {
|
|
14
11
|
Input
|
|
15
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-SABFRQEH.mjs";
|
|
16
13
|
import {
|
|
17
14
|
Messages
|
|
18
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-HIW7RXCD.mjs";
|
|
19
16
|
import {
|
|
20
17
|
AssistantMessage
|
|
21
18
|
} from "./chunk-IHFR6PYG.mjs";
|
|
22
19
|
import {
|
|
23
20
|
UserMessage
|
|
24
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-RYUCX3ZK.mjs";
|
|
22
|
+
import {
|
|
23
|
+
Header
|
|
24
|
+
} from "./chunk-B4EBCYMS.mjs";
|
|
25
25
|
import {
|
|
26
26
|
ChatContextProvider,
|
|
27
27
|
useChatContext
|
|
@@ -219,4 +219,4 @@ var CopilotModal = (_a) => {
|
|
|
219
219
|
export {
|
|
220
220
|
CopilotModal
|
|
221
221
|
};
|
|
222
|
-
//# sourceMappingURL=chunk-
|
|
222
|
+
//# sourceMappingURL=chunk-ETQOY3FA.mjs.map
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
ExclamationMarkIcon,
|
|
5
|
-
ExclamationMarkTriangleIcon
|
|
6
|
-
} from "./chunk-Q5V6S67N.mjs";
|
|
2
|
+
CopilotKitHelpModal
|
|
3
|
+
} from "./chunk-NRA3CFEE.mjs";
|
|
7
4
|
import {
|
|
8
5
|
getPublishedCopilotKitVersion,
|
|
9
6
|
logActions,
|
|
@@ -11,12 +8,15 @@ import {
|
|
|
11
8
|
logReadables,
|
|
12
9
|
shouldShowDevConsole
|
|
13
10
|
} from "./chunk-JY2CSDKN.mjs";
|
|
14
|
-
import {
|
|
15
|
-
CopilotKitHelpModal
|
|
16
|
-
} from "./chunk-NRA3CFEE.mjs";
|
|
17
11
|
import {
|
|
18
12
|
SmallSpinnerIcon
|
|
19
13
|
} from "./chunk-XWG3L6QC.mjs";
|
|
14
|
+
import {
|
|
15
|
+
CheckIcon,
|
|
16
|
+
ChevronDownIcon,
|
|
17
|
+
ExclamationMarkIcon,
|
|
18
|
+
ExclamationMarkTriangleIcon
|
|
19
|
+
} from "./chunk-Q5V6S67N.mjs";
|
|
20
20
|
|
|
21
21
|
// src/components/dev-console/console.tsx
|
|
22
22
|
import { useCopilotContext, useCopilotMessagesContext } from "@copilotkit/react-core";
|
|
@@ -199,4 +199,4 @@ export {
|
|
|
199
199
|
CopilotDevConsole,
|
|
200
200
|
DebugMenuButton
|
|
201
201
|
};
|
|
202
|
-
//# sourceMappingURL=chunk-
|
|
202
|
+
//# sourceMappingURL=chunk-FKJWIQGB.mjs.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
LegacyRenderMessage
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-7OURDQZJ.mjs";
|
|
4
4
|
import {
|
|
5
5
|
useChatContext
|
|
6
6
|
} from "./chunk-IEMQ2SQW.mjs";
|
|
@@ -181,4 +181,4 @@ export {
|
|
|
181
181
|
Messages,
|
|
182
182
|
useScrollToBottom
|
|
183
183
|
};
|
|
184
|
-
//# sourceMappingURL=chunk-
|
|
184
|
+
//# sourceMappingURL=chunk-HIW7RXCD.mjs.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
CopilotModal
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-ETQOY3FA.mjs";
|
|
4
4
|
import {
|
|
5
5
|
__spreadProps,
|
|
6
6
|
__spreadValues
|
|
@@ -18,4 +18,4 @@ function CopilotPopup(props) {
|
|
|
18
18
|
export {
|
|
19
19
|
CopilotPopup
|
|
20
20
|
};
|
|
21
|
-
//# sourceMappingURL=chunk-
|
|
21
|
+
//# sourceMappingURL=chunk-I2YM5J5H.mjs.map
|
|
@@ -6,13 +6,13 @@ import {
|
|
|
6
6
|
} from "./chunk-PLHTVHUW.mjs";
|
|
7
7
|
import {
|
|
8
8
|
Input
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-SABFRQEH.mjs";
|
|
10
10
|
import {
|
|
11
11
|
Messages
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-HIW7RXCD.mjs";
|
|
13
13
|
import {
|
|
14
14
|
RenderMessage
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-NCIAFFQ2.mjs";
|
|
16
16
|
import {
|
|
17
17
|
AssistantMessage
|
|
18
18
|
} from "./chunk-IHFR6PYG.mjs";
|
|
@@ -21,7 +21,7 @@ import {
|
|
|
21
21
|
} from "./chunk-DBKRAOH7.mjs";
|
|
22
22
|
import {
|
|
23
23
|
UserMessage
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-RYUCX3ZK.mjs";
|
|
25
25
|
import {
|
|
26
26
|
ChatContext,
|
|
27
27
|
ChatContextProvider
|
|
@@ -428,4 +428,4 @@ export {
|
|
|
428
428
|
CopilotChat,
|
|
429
429
|
WrappedCopilotChat
|
|
430
430
|
};
|
|
431
|
-
//# sourceMappingURL=chunk-
|
|
431
|
+
//# sourceMappingURL=chunk-LG6H5CG5.mjs.map
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
} from "./chunk-DBKRAOH7.mjs";
|
|
7
7
|
import {
|
|
8
8
|
UserMessage
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-RYUCX3ZK.mjs";
|
|
10
10
|
import {
|
|
11
11
|
__objRest
|
|
12
12
|
} from "./chunk-MRXNTQOX.mjs";
|
|
@@ -71,10 +71,12 @@ function RenderMessage(_a) {
|
|
|
71
71
|
},
|
|
72
72
|
index
|
|
73
73
|
);
|
|
74
|
+
default:
|
|
75
|
+
return null;
|
|
74
76
|
}
|
|
75
77
|
}
|
|
76
78
|
|
|
77
79
|
export {
|
|
78
80
|
RenderMessage
|
|
79
81
|
};
|
|
80
|
-
//# sourceMappingURL=chunk-
|
|
82
|
+
//# sourceMappingURL=chunk-NCIAFFQ2.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/chat/messages/RenderMessage.tsx"],"sourcesContent":["import { RenderMessageProps } from \"../props\";\nimport { UserMessage as DefaultUserMessage } from \"./UserMessage\";\nimport { AssistantMessage as DefaultAssistantMessage } from \"./AssistantMessage\";\nimport { ImageRenderer as DefaultImageRenderer } from \"./ImageRenderer\";\n\nexport function RenderMessage({\n UserMessage = DefaultUserMessage,\n AssistantMessage = DefaultAssistantMessage,\n ImageRenderer = DefaultImageRenderer,\n ...props\n}: RenderMessageProps) {\n const {\n message,\n messages,\n inProgress,\n index,\n isCurrentMessage,\n onRegenerate,\n onCopy,\n onThumbsUp,\n onThumbsDown,\n messageFeedback,\n markdownTagRenderers,\n } = props;\n\n switch (message.role) {\n case \"user\":\n return (\n <UserMessage\n key={index}\n rawData={message}\n data-message-role=\"user\"\n message={message}\n ImageRenderer={ImageRenderer}\n />\n );\n case \"assistant\":\n return (\n <AssistantMessage\n key={index}\n data-message-role=\"assistant\"\n subComponent={message.generativeUI?.()}\n rawData={message}\n message={message}\n messages={messages}\n isLoading={inProgress && isCurrentMessage && !message.content}\n isGenerating={inProgress && isCurrentMessage && !!message.content}\n isCurrentMessage={isCurrentMessage}\n onRegenerate={() => onRegenerate?.(message.id)}\n onCopy={onCopy}\n onThumbsUp={onThumbsUp}\n onThumbsDown={onThumbsDown}\n feedback={messageFeedback?.[message.id] || null}\n markdownTagRenderers={markdownTagRenderers}\n ImageRenderer={ImageRenderer}\n />\n );\n }\n}\n"],"mappings":";;;;;;;;;;;;;;AA4BQ;AAvBD,SAAS,cAAc,IAKP;AALO,eAC5B;AAAA,iBAAAA,eAAc;AAAA,IACd,kBAAAC,oBAAmB;AAAA,IACnB,eAAAC,iBAAgB;AAAA,EARlB,IAK8B,IAIzB,kBAJyB,IAIzB;AAAA,IAHH;AAAA,IACA;AAAA,IACA;AAAA;AARF,MAAAC;AAWE,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI;AAEJ,UAAQ,QAAQ,MAAM;AAAA,IACpB,KAAK;AACH,aACE;AAAA,QAACH;AAAA,QAAA;AAAA,UAEC,SAAS;AAAA,UACT,qBAAkB;AAAA,UAClB;AAAA,UACA,eAAeE;AAAA;AAAA,QAJV;AAAA,MAKP;AAAA,IAEJ,KAAK;AACH,aACE;AAAA,QAACD;AAAA,QAAA;AAAA,UAEC,qBAAkB;AAAA,UAClB,eAAcE,MAAA,QAAQ,iBAAR,gBAAAA,IAAA;AAAA,UACd,SAAS;AAAA,UACT;AAAA,UACA;AAAA,UACA,WAAW,cAAc,oBAAoB,CAAC,QAAQ;AAAA,UACtD,cAAc,cAAc,oBAAoB,CAAC,CAAC,QAAQ;AAAA,UAC1D;AAAA,UACA,cAAc,MAAM,6CAAe,QAAQ;AAAA,UAC3C;AAAA,UACA;AAAA,UACA;AAAA,UACA,WAAU,mDAAkB,QAAQ,QAAO;AAAA,UAC3C;AAAA,UACA,eAAeD;AAAA;AAAA,QAfV;AAAA,MAgBP;AAAA,
|
|
1
|
+
{"version":3,"sources":["../src/components/chat/messages/RenderMessage.tsx"],"sourcesContent":["import { RenderMessageProps } from \"../props\";\nimport { UserMessage as DefaultUserMessage } from \"./UserMessage\";\nimport { AssistantMessage as DefaultAssistantMessage } from \"./AssistantMessage\";\nimport { ImageRenderer as DefaultImageRenderer } from \"./ImageRenderer\";\n\nexport function RenderMessage({\n UserMessage = DefaultUserMessage,\n AssistantMessage = DefaultAssistantMessage,\n ImageRenderer = DefaultImageRenderer,\n ...props\n}: RenderMessageProps) {\n const {\n message,\n messages,\n inProgress,\n index,\n isCurrentMessage,\n onRegenerate,\n onCopy,\n onThumbsUp,\n onThumbsDown,\n messageFeedback,\n markdownTagRenderers,\n } = props;\n\n switch (message.role) {\n case \"user\":\n return (\n <UserMessage\n key={index}\n rawData={message}\n data-message-role=\"user\"\n message={message}\n ImageRenderer={ImageRenderer}\n />\n );\n case \"assistant\":\n return (\n <AssistantMessage\n key={index}\n data-message-role=\"assistant\"\n subComponent={message.generativeUI?.()}\n rawData={message}\n message={message}\n messages={messages}\n isLoading={inProgress && isCurrentMessage && !message.content}\n isGenerating={inProgress && isCurrentMessage && !!message.content}\n isCurrentMessage={isCurrentMessage}\n onRegenerate={() => onRegenerate?.(message.id)}\n onCopy={onCopy}\n onThumbsUp={onThumbsUp}\n onThumbsDown={onThumbsDown}\n feedback={messageFeedback?.[message.id] || null}\n markdownTagRenderers={markdownTagRenderers}\n ImageRenderer={ImageRenderer}\n />\n );\n default:\n return null;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;AA4BQ;AAvBD,SAAS,cAAc,IAKP;AALO,eAC5B;AAAA,iBAAAA,eAAc;AAAA,IACd,kBAAAC,oBAAmB;AAAA,IACnB,eAAAC,iBAAgB;AAAA,EARlB,IAK8B,IAIzB,kBAJyB,IAIzB;AAAA,IAHH;AAAA,IACA;AAAA,IACA;AAAA;AARF,MAAAC;AAWE,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI;AAEJ,UAAQ,QAAQ,MAAM;AAAA,IACpB,KAAK;AACH,aACE;AAAA,QAACH;AAAA,QAAA;AAAA,UAEC,SAAS;AAAA,UACT,qBAAkB;AAAA,UAClB;AAAA,UACA,eAAeE;AAAA;AAAA,QAJV;AAAA,MAKP;AAAA,IAEJ,KAAK;AACH,aACE;AAAA,QAACD;AAAA,QAAA;AAAA,UAEC,qBAAkB;AAAA,UAClB,eAAcE,MAAA,QAAQ,iBAAR,gBAAAA,IAAA;AAAA,UACd,SAAS;AAAA,UACT;AAAA,UACA;AAAA,UACA,WAAW,cAAc,oBAAoB,CAAC,QAAQ;AAAA,UACtD,cAAc,cAAc,oBAAoB,CAAC,CAAC,QAAQ;AAAA,UAC1D;AAAA,UACA,cAAc,MAAM,6CAAe,QAAQ;AAAA,UAC3C;AAAA,UACA;AAAA,UACA;AAAA,UACA,WAAU,mDAAkB,QAAQ,QAAO;AAAA,UAC3C;AAAA,UACA,eAAeD;AAAA;AAAA,QAfV;AAAA,MAgBP;AAAA,IAEJ;AACE,aAAO;AAAA,EACX;AACF;","names":["UserMessage","AssistantMessage","ImageRenderer","_a"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/chat/messages/UserMessage.tsx"],"sourcesContent":["import { UserMessageProps } from \"../props\";\n\ntype UserMessageContent = NonNullable<UserMessageProps[\"message\"]>[\"content\"];\n\nconst getTextContent = (content: UserMessageContent | undefined): string | undefined => {\n if (typeof content === \"undefined\") {\n return undefined;\n }\n\n if (typeof content === \"string\") {\n return content;\n }\n\n return (\n content\n .map((part) => {\n if (part.type === \"text\") {\n return part.text;\n }\n return undefined;\n })\n .filter((value): value is string => typeof value === \"string\" && value.length > 0)\n .join(\" \")\n .trim() || undefined\n );\n};\n\nexport const UserMessage = (props: UserMessageProps) => {\n const { message, ImageRenderer } = props;\n const isImageMessage = message && \"image\" in message && Boolean(message.image);\n\n if (isImageMessage) {\n const imageMessage = message!;\n const content = getTextContent(imageMessage?.content);\n\n return (\n <div className=\"copilotKitMessage copilotKitUserMessage\">\n <ImageRenderer image={imageMessage.image!} content={content} />\n </div>\n );\n }\n\n const content = getTextContent(message?.content);\n\n return <div className=\"copilotKitMessage copilotKitUserMessage\">{content}</div>;\n};\n"],"mappings":";AAqCQ;AAjCR,IAAM,iBAAiB,CAAC,YAAgE;AACtF,MAAI,OAAO,YAAY,aAAa;AAClC,WAAO;AAAA,EACT;AAEA,MAAI,OAAO,YAAY,UAAU;AAC/B,WAAO;AAAA,EACT;AAEA,SACE,QACG,IAAI,CAAC,SAAS;AACb,QAAI,KAAK,SAAS,QAAQ;AACxB,aAAO,KAAK;AAAA,IACd;AACA,WAAO;AAAA,EACT,CAAC,EACA,OAAO,CAAC,UAA2B,OAAO,UAAU,YAAY,MAAM,SAAS,CAAC,EAChF,KAAK,GAAG,EACR,KAAK,KAAK;AAEjB;AAEO,IAAM,cAAc,CAAC,UAA4B;AACtD,QAAM,EAAE,SAAS,cAAc,IAAI;AACnC,QAAM,iBAAiB,WAAW,WAAW,WAAW,QAAQ,QAAQ,KAAK;AAE7E,MAAI,gBAAgB;AAClB,UAAM,eAAe;AACrB,UAAMA,WAAU,eAAe,6CAAc,OAAO;AAEpD,WACE,oBAAC,SAAI,WAAU,2CACb,8BAAC,iBAAc,OAAO,aAAa,OAAQ,SAASA,UAAS,GAC/D;AAAA,EAEJ;AAEA,QAAM,UAAU,eAAe,mCAAS,OAAO;AAE/C,SAAO,oBAAC,SAAI,WAAU,2CAA2C,mBAAQ;AAC3E;","names":["content"]}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
PoweredByTag
|
|
3
|
-
} from "./chunk-ELGRNEAO.mjs";
|
|
4
1
|
import {
|
|
5
2
|
Textarea_default
|
|
6
3
|
} from "./chunk-QIOJXTIQ.mjs";
|
|
4
|
+
import {
|
|
5
|
+
PoweredByTag
|
|
6
|
+
} from "./chunk-ELGRNEAO.mjs";
|
|
7
7
|
import {
|
|
8
8
|
useChatContext
|
|
9
9
|
} from "./chunk-IEMQ2SQW.mjs";
|
|
@@ -19,7 +19,7 @@ var MAX_NEWLINES = 6;
|
|
|
19
19
|
var Input = ({
|
|
20
20
|
inProgress,
|
|
21
21
|
onSend,
|
|
22
|
-
chatReady =
|
|
22
|
+
chatReady = false,
|
|
23
23
|
onStop,
|
|
24
24
|
onUpload,
|
|
25
25
|
hideStopButton = false
|
|
@@ -57,7 +57,7 @@ var Input = ({
|
|
|
57
57
|
const { buttonIcon, buttonAlt } = useMemo(() => {
|
|
58
58
|
if (!chatReady)
|
|
59
59
|
return { buttonIcon: context.icons.spinnerIcon, buttonAlt: "Loading" };
|
|
60
|
-
return isInProgress && !hideStopButton ? { buttonIcon: context.icons.stopIcon, buttonAlt: "Stop" } : { buttonIcon: context.icons.sendIcon, buttonAlt: "Send" };
|
|
60
|
+
return isInProgress && !hideStopButton && chatReady ? { buttonIcon: context.icons.stopIcon, buttonAlt: "Stop" } : { buttonIcon: context.icons.sendIcon, buttonAlt: "Send" };
|
|
61
61
|
}, [isInProgress, chatReady, hideStopButton, context.icons.stopIcon, context.icons.sendIcon]);
|
|
62
62
|
const showPushToTalk = pushToTalkConfigured && (pushToTalkState === "idle" || pushToTalkState === "recording") && !inProgress;
|
|
63
63
|
const { interrupt } = useCopilotChatInternal();
|
|
@@ -123,4 +123,4 @@ var Input = ({
|
|
|
123
123
|
export {
|
|
124
124
|
Input
|
|
125
125
|
};
|
|
126
|
-
//# sourceMappingURL=chunk-
|
|
126
|
+
//# sourceMappingURL=chunk-SABFRQEH.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/chat/Input.tsx"],"sourcesContent":["import React, { useMemo, useRef, useState } from \"react\";\nimport { InputProps } from \"./props\";\nimport { useChatContext } from \"./ChatContext\";\nimport AutoResizingTextarea from \"./Textarea\";\nimport { usePushToTalk } from \"../../hooks/use-push-to-talk\";\nimport { useCopilotContext, useCopilotChatInternal } from \"@copilotkit/react-core\";\nimport { PoweredByTag } from \"./PoweredByTag\";\n\nconst MAX_NEWLINES = 6;\n\nexport const Input = ({\n inProgress,\n onSend,\n chatReady = false,\n onStop,\n onUpload,\n hideStopButton = false,\n}: InputProps) => {\n const context = useChatContext();\n const copilotContext = useCopilotContext();\n\n const showPoweredBy = !copilotContext.copilotApiConfig?.publicApiKey;\n\n const pushToTalkConfigured =\n copilotContext.copilotApiConfig.textToSpeechUrl !== undefined &&\n copilotContext.copilotApiConfig.transcribeAudioUrl !== undefined;\n\n const textareaRef = useRef<HTMLTextAreaElement>(null);\n const [isComposing, setIsComposing] = useState(false);\n\n const handleDivClick = (event: React.MouseEvent<HTMLDivElement>) => {\n const target = event.target as HTMLElement;\n\n // If the user clicked a button or inside a button, don't focus the textarea\n if (target.closest(\"button\")) return;\n\n // If the user clicked the textarea, do nothing (it's already focused)\n if (target.tagName === \"TEXTAREA\") return;\n\n // Otherwise, focus the textarea\n textareaRef.current?.focus();\n };\n\n const [text, setText] = useState(\"\");\n const send = () => {\n if (inProgress) return;\n onSend(text);\n setText(\"\");\n\n textareaRef.current?.focus();\n };\n\n // tylerslaton:\n //\n // This scrolls CopilotKit into view always. Reading the commit history, it was likely\n // added to fix a bug but it is causing issues now.\n //\n // For the future, if we want this behavior again, we will need to find a way to do it without\n // forcing CopilotKit to always be in view. This code causes this because focusing an element\n // in most browsers will scroll that element into view.\n //\n // useEffect(() => {\n // if (isVisible) {\n // textareaRef.current?.focus();\n // }\n // }, [isVisible]);\n\n const { pushToTalkState, setPushToTalkState } = usePushToTalk({\n sendFunction: onSend,\n inProgress,\n });\n\n const isInProgress = inProgress || pushToTalkState === \"transcribing\";\n const { buttonIcon, buttonAlt } = useMemo(() => {\n if (!chatReady) return { buttonIcon: context.icons.spinnerIcon, buttonAlt: \"Loading\" };\n return isInProgress && !hideStopButton && chatReady\n ? { buttonIcon: context.icons.stopIcon, buttonAlt: \"Stop\" }\n : { buttonIcon: context.icons.sendIcon, buttonAlt: \"Send\" };\n }, [isInProgress, chatReady, hideStopButton, context.icons.stopIcon, context.icons.sendIcon]);\n const showPushToTalk =\n pushToTalkConfigured &&\n (pushToTalkState === \"idle\" || pushToTalkState === \"recording\") &&\n !inProgress;\n\n const { interrupt } = useCopilotChatInternal();\n\n const canSend = useMemo(() => {\n return !isInProgress && text.trim().length > 0 && pushToTalkState === \"idle\" && !interrupt;\n }, [interrupt, isInProgress, text, pushToTalkState]);\n\n const canStop = useMemo(() => {\n return isInProgress && !hideStopButton;\n }, [isInProgress, hideStopButton]);\n\n const sendDisabled = !canSend && !canStop;\n\n return (\n <div className={`copilotKitInputContainer ${showPoweredBy ? \"poweredByContainer\" : \"\"}`}>\n <div className=\"copilotKitInput\" onClick={handleDivClick}>\n <AutoResizingTextarea\n ref={textareaRef}\n placeholder={context.labels.placeholder}\n autoFocus={false}\n maxRows={MAX_NEWLINES}\n value={text}\n onChange={(event) => setText(event.target.value)}\n onCompositionStart={() => setIsComposing(true)}\n onCompositionEnd={() => setIsComposing(false)}\n onKeyDown={(event) => {\n if (event.key === \"Enter\" && !event.shiftKey && !isComposing) {\n event.preventDefault();\n if (canSend) {\n send();\n }\n }\n }}\n />\n <div className=\"copilotKitInputControls\">\n {onUpload && (\n <button onClick={onUpload} className=\"copilotKitInputControlButton\">\n {context.icons.uploadIcon}\n </button>\n )}\n\n <div style={{ flexGrow: 1 }} />\n\n {showPushToTalk && (\n <button\n onClick={() =>\n setPushToTalkState(pushToTalkState === \"idle\" ? \"recording\" : \"transcribing\")\n }\n className={\n pushToTalkState === \"recording\"\n ? \"copilotKitInputControlButton copilotKitPushToTalkRecording\"\n : \"copilotKitInputControlButton\"\n }\n >\n {context.icons.pushToTalkIcon}\n </button>\n )}\n <button\n disabled={sendDisabled}\n onClick={isInProgress && !hideStopButton ? onStop : send}\n data-copilotkit-in-progress={inProgress}\n data-test-id={inProgress ? \"copilot-chat-request-in-progress\" : \"copilot-chat-ready\"}\n className=\"copilotKitInputControlButton\"\n aria-label={buttonAlt}\n >\n {buttonIcon}\n </button>\n </div>\n </div>\n <PoweredByTag showPoweredBy={showPoweredBy} />\n </div>\n );\n};\n"],"mappings":"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","names":["_a"]}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
// src/hooks/use-copilot-chat-suggestions.tsx
|
|
2
2
|
import {
|
|
3
|
-
|
|
3
|
+
useCopilotChatSuggestions as useCoreCopilotChatSuggestions
|
|
4
4
|
} from "@copilotkit/react-core";
|
|
5
5
|
function useCopilotChatSuggestions(config, dependencies = []) {
|
|
6
|
-
|
|
6
|
+
useCoreCopilotChatSuggestions(config, dependencies);
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
export {
|
|
10
10
|
useCopilotChatSuggestions
|
|
11
11
|
};
|
|
12
|
-
//# sourceMappingURL=chunk-
|
|
12
|
+
//# sourceMappingURL=chunk-Y4FKRAKJ.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/hooks/use-copilot-chat-suggestions.tsx"],"sourcesContent":["/**\n * <Callout type=\"warning\">\n * useCopilotChatSuggestions is experimental. The interface is not final and\n * can change without notice.\n * </Callout>\n *\n * `useCopilotReadable` is a React hook that provides app-state and other information\n * to the Copilot. Optionally, the hook can also handle hierarchical state within your\n * application, passing these parent-child relationships to the Copilot.\n *\n * <br/>\n * <img src=\"https://cdn.copilotkit.ai/docs/copilotkit/images/use-copilot-chat-suggestions/use-copilot-chat-suggestions.gif\" width=\"500\" />\n *\n * ## Usage\n *\n * ### Install Dependencies\n *\n * This component is part of the [@copilotkit/react-ui](https://npmjs.com/package/@copilotkit/react-ui) package.\n *\n * ```shell npm2yarn \\\"@copilotkit/react-ui\"\\\n * npm install @copilotkit/react-core @copilotkit/react-ui\n * ```\n *\n * ### Simple Usage\n *\n * ```tsx\n * import { useCopilotChatSuggestions } from \"@copilotkit/react-ui\";\n *\n * export function MyComponent() {\n * const [employees, setEmployees] = useState([]);\n *\n * useCopilotChatSuggestions({\n * instructions: `The following employees are on duty: ${JSON.stringify(employees)}`,\n * });\n * }\n * ```\n *\n * ### Dependency Management\n *\n * ```tsx\n * import { useCopilotChatSuggestions } from \"@copilotkit/react-ui\";\n *\n * export function MyComponent() {\n * useCopilotChatSuggestions(\n * {\n * instructions: \"Suggest the most relevant next actions.\",\n * },\n * [appState],\n * );\n * }\n * ```\n *\n * In the example above, the suggestions are generated based on the given instructions.\n * The hook monitors `appState`, and updates suggestions accordingly whenever it changes.\n *\n * ### Behavior and Lifecycle\n *\n * The hook registers the configuration with the chat context upon component mount and\n * removes it on unmount, ensuring a clean and efficient lifecycle management.\n */\nimport {\n
|
|
1
|
+
{"version":3,"sources":["../src/hooks/use-copilot-chat-suggestions.tsx"],"sourcesContent":["/**\n * <Callout type=\"warning\">\n * useCopilotChatSuggestions is experimental. The interface is not final and\n * can change without notice.\n * </Callout>\n *\n * `useCopilotReadable` is a React hook that provides app-state and other information\n * to the Copilot. Optionally, the hook can also handle hierarchical state within your\n * application, passing these parent-child relationships to the Copilot.\n *\n * <br/>\n * <img src=\"https://cdn.copilotkit.ai/docs/copilotkit/images/use-copilot-chat-suggestions/use-copilot-chat-suggestions.gif\" width=\"500\" />\n *\n * ## Usage\n *\n * ### Install Dependencies\n *\n * This component is part of the [@copilotkit/react-ui](https://npmjs.com/package/@copilotkit/react-ui) package.\n *\n * ```shell npm2yarn \\\"@copilotkit/react-ui\"\\\n * npm install @copilotkit/react-core @copilotkit/react-ui\n * ```\n *\n * ### Simple Usage\n *\n * ```tsx\n * import { useCopilotChatSuggestions } from \"@copilotkit/react-ui\";\n *\n * export function MyComponent() {\n * const [employees, setEmployees] = useState([]);\n *\n * useCopilotChatSuggestions({\n * instructions: `The following employees are on duty: ${JSON.stringify(employees)}`,\n * });\n * }\n * ```\n *\n * ### Dependency Management\n *\n * ```tsx\n * import { useCopilotChatSuggestions } from \"@copilotkit/react-ui\";\n *\n * export function MyComponent() {\n * useCopilotChatSuggestions(\n * {\n * instructions: \"Suggest the most relevant next actions.\",\n * },\n * [appState],\n * );\n * }\n * ```\n *\n * In the example above, the suggestions are generated based on the given instructions.\n * The hook monitors `appState`, and updates suggestions accordingly whenever it changes.\n *\n * ### Behavior and Lifecycle\n *\n * The hook registers the configuration with the chat context upon component mount and\n * removes it on unmount, ensuring a clean and efficient lifecycle management.\n */\nimport {\n useCopilotChatSuggestions as useCoreCopilotChatSuggestions,\n type UseCopilotChatSuggestionsConfiguration,\n} from \"@copilotkit/react-core\";\n\nexport function useCopilotChatSuggestions(\n config: UseCopilotChatSuggestionsConfiguration,\n dependencies: any[] = [],\n) {\n useCoreCopilotChatSuggestions(config, dependencies);\n}\n"],"mappings":";AA4DA;AAAA,EACE,6BAA6B;AAAA,OAExB;AAEA,SAAS,0BACd,QACA,eAAsB,CAAC,GACvB;AACA,gCAA8B,QAAQ,YAAY;AACpD;","names":[]}
|
|
@@ -1146,6 +1146,8 @@ function RenderMessage(_a) {
|
|
|
1146
1146
|
},
|
|
1147
1147
|
index
|
|
1148
1148
|
);
|
|
1149
|
+
default:
|
|
1150
|
+
return null;
|
|
1149
1151
|
}
|
|
1150
1152
|
}
|
|
1151
1153
|
|
|
@@ -1649,7 +1651,7 @@ var MAX_NEWLINES = 6;
|
|
|
1649
1651
|
var Input = ({
|
|
1650
1652
|
inProgress,
|
|
1651
1653
|
onSend,
|
|
1652
|
-
chatReady =
|
|
1654
|
+
chatReady = false,
|
|
1653
1655
|
onStop,
|
|
1654
1656
|
onUpload,
|
|
1655
1657
|
hideStopButton = false
|
|
@@ -1687,7 +1689,7 @@ var Input = ({
|
|
|
1687
1689
|
const { buttonIcon, buttonAlt } = (0, import_react10.useMemo)(() => {
|
|
1688
1690
|
if (!chatReady)
|
|
1689
1691
|
return { buttonIcon: context.icons.spinnerIcon, buttonAlt: "Loading" };
|
|
1690
|
-
return isInProgress && !hideStopButton ? { buttonIcon: context.icons.stopIcon, buttonAlt: "Stop" } : { buttonIcon: context.icons.sendIcon, buttonAlt: "Send" };
|
|
1692
|
+
return isInProgress && !hideStopButton && chatReady ? { buttonIcon: context.icons.stopIcon, buttonAlt: "Stop" } : { buttonIcon: context.icons.sendIcon, buttonAlt: "Send" };
|
|
1691
1693
|
}, [isInProgress, chatReady, hideStopButton, context.icons.stopIcon, context.icons.sendIcon]);
|
|
1692
1694
|
const showPushToTalk = pushToTalkConfigured && (pushToTalkState === "idle" || pushToTalkState === "recording") && !inProgress;
|
|
1693
1695
|
const { interrupt } = (0, import_react_core3.useCopilotChatInternal)();
|