@copilotkit/react-ui 1.8.4-next.1 → 1.8.4-next.2
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 +9 -0
- package/dist/{chunk-OG2LUNMO.mjs → chunk-2IJIJYVG.mjs} +8 -8
- package/dist/{chunk-X7HMY3S6.mjs → chunk-3HSGJHBC.mjs} +2 -2
- package/dist/{chunk-2D24Q2YO.mjs → chunk-N5TIP3NE.mjs} +2 -2
- package/dist/{chunk-SNLHKLW3.mjs → chunk-QJKMOGWN.mjs} +5 -2
- package/dist/chunk-QJKMOGWN.mjs.map +1 -0
- package/dist/{chunk-D5XIJNXQ.mjs → chunk-QN2SMWML.mjs} +6 -6
- package/dist/{chunk-2OTVZXDX.mjs → chunk-W5HLRVAS.mjs} +4 -4
- package/dist/{chunk-HGA4N4ME.mjs → chunk-XG356GYI.mjs} +5 -5
- package/dist/components/chat/Chat.js +4 -1
- package/dist/components/chat/Chat.js.map +1 -1
- package/dist/components/chat/Chat.mjs +5 -5
- package/dist/components/chat/Header.mjs +5 -5
- package/dist/components/chat/Input.js +4 -1
- package/dist/components/chat/Input.js.map +1 -1
- package/dist/components/chat/Input.mjs +1 -1
- package/dist/components/chat/Modal.js +4 -1
- package/dist/components/chat/Modal.js.map +1 -1
- package/dist/components/chat/Modal.mjs +14 -14
- package/dist/components/chat/Popup.js +4 -1
- package/dist/components/chat/Popup.js.map +1 -1
- package/dist/components/chat/Popup.mjs +15 -15
- package/dist/components/chat/Sidebar.js +4 -1
- package/dist/components/chat/Sidebar.js.map +1 -1
- package/dist/components/chat/Sidebar.mjs +15 -15
- package/dist/components/chat/index.js +4 -1
- package/dist/components/chat/index.js.map +1 -1
- package/dist/components/chat/index.mjs +16 -16
- package/dist/components/chat/messages/AssistantMessage.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 -1
- package/dist/components/index.js.map +1 -1
- package/dist/components/index.mjs +20 -20
- package/dist/index.js +4 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +20 -20
- package/package.json +4 -4
- package/src/components/chat/Input.tsx +8 -2
- package/dist/chunk-SNLHKLW3.mjs.map +0 -1
- /package/dist/{chunk-OG2LUNMO.mjs.map → chunk-2IJIJYVG.mjs.map} +0 -0
- /package/dist/{chunk-X7HMY3S6.mjs.map → chunk-3HSGJHBC.mjs.map} +0 -0
- /package/dist/{chunk-2D24Q2YO.mjs.map → chunk-N5TIP3NE.mjs.map} +0 -0
- /package/dist/{chunk-D5XIJNXQ.mjs.map → chunk-QN2SMWML.mjs.map} +0 -0
- /package/dist/{chunk-2OTVZXDX.mjs.map → chunk-W5HLRVAS.mjs.map} +0 -0
- /package/dist/{chunk-HGA4N4ME.mjs.map → chunk-XG356GYI.mjs.map} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# ui
|
|
2
2
|
|
|
3
|
+
## 1.8.4-next.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- fc11455: - fix: focus on text area when clicking in input box
|
|
8
|
+
- @copilotkit/react-core@1.8.4-next.2
|
|
9
|
+
- @copilotkit/runtime-client-gql@1.8.4-next.2
|
|
10
|
+
- @copilotkit/shared@1.8.4-next.2
|
|
11
|
+
|
|
3
12
|
## 1.8.4-next.1
|
|
4
13
|
|
|
5
14
|
### Patch Changes
|
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Window
|
|
3
3
|
} from "./chunk-P7S3E5UW.mjs";
|
|
4
|
-
import {
|
|
5
|
-
Header
|
|
6
|
-
} from "./chunk-2OTVZXDX.mjs";
|
|
7
4
|
import {
|
|
8
5
|
Button
|
|
9
6
|
} from "./chunk-YOEL33HG.mjs";
|
|
10
7
|
import {
|
|
11
8
|
CopilotChat
|
|
12
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-XG356GYI.mjs";
|
|
13
10
|
import {
|
|
14
11
|
UserMessage
|
|
15
12
|
} from "./chunk-HEIDCT7I.mjs";
|
|
16
13
|
import {
|
|
17
14
|
AssistantMessage
|
|
18
15
|
} from "./chunk-5M7ODWKH.mjs";
|
|
19
|
-
import {
|
|
20
|
-
Input
|
|
21
|
-
} from "./chunk-SNLHKLW3.mjs";
|
|
22
16
|
import {
|
|
23
17
|
Messages
|
|
24
18
|
} from "./chunk-ZY25LVYR.mjs";
|
|
19
|
+
import {
|
|
20
|
+
Header
|
|
21
|
+
} from "./chunk-W5HLRVAS.mjs";
|
|
22
|
+
import {
|
|
23
|
+
Input
|
|
24
|
+
} from "./chunk-QJKMOGWN.mjs";
|
|
25
25
|
import {
|
|
26
26
|
ChatContextProvider
|
|
27
27
|
} from "./chunk-UN2E3HCK.mjs";
|
|
@@ -95,4 +95,4 @@ var CopilotModal = ({
|
|
|
95
95
|
export {
|
|
96
96
|
CopilotModal
|
|
97
97
|
};
|
|
98
|
-
//# sourceMappingURL=chunk-
|
|
98
|
+
//# sourceMappingURL=chunk-2IJIJYVG.mjs.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
CopilotModal
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-2IJIJYVG.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-3HSGJHBC.mjs.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
CopilotModal
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-2IJIJYVG.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-N5TIP3NE.mjs.map
|
|
@@ -19,7 +19,10 @@ var Input = ({ inProgress, onSend, isVisible = false, onStop }) => {
|
|
|
19
19
|
const textareaRef = useRef(null);
|
|
20
20
|
const handleDivClick = (event) => {
|
|
21
21
|
var _a;
|
|
22
|
-
|
|
22
|
+
const target = event.target;
|
|
23
|
+
if (target.closest("button"))
|
|
24
|
+
return;
|
|
25
|
+
if (target.tagName === "TEXTAREA")
|
|
23
26
|
return;
|
|
24
27
|
(_a = textareaRef.current) == null ? void 0 : _a.focus();
|
|
25
28
|
};
|
|
@@ -100,4 +103,4 @@ var Input = ({ inProgress, onSend, isVisible = false, onStop }) => {
|
|
|
100
103
|
export {
|
|
101
104
|
Input
|
|
102
105
|
};
|
|
103
|
-
//# sourceMappingURL=chunk-
|
|
106
|
+
//# sourceMappingURL=chunk-QJKMOGWN.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/chat/Input.tsx"],"sourcesContent":["import React, { useEffect, 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 } from \"@copilotkit/react-core\";\n\nexport const Input = ({ inProgress, onSend, isVisible = false, onStop }: InputProps) => {\n const context = useChatContext();\n const copilotContext = useCopilotContext();\n\n const pushToTalkConfigured =\n copilotContext.copilotApiConfig.textToSpeechUrl !== undefined &&\n copilotContext.copilotApiConfig.transcribeAudioUrl !== undefined;\n\n const textareaRef = useRef<HTMLTextAreaElement>(null);\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 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 = isInProgress ? context.icons.stopIcon : context.icons.sendIcon;\n const showPushToTalk =\n pushToTalkConfigured &&\n (pushToTalkState === \"idle\" || pushToTalkState === \"recording\") &&\n !inProgress;\n\n const canSend = () => {\n const interruptEvent = copilotContext.langGraphInterruptAction?.event;\n const interruptInProgress =\n interruptEvent?.name === \"LangGraphInterruptEvent\" && !interruptEvent?.response;\n\n return (\n (isInProgress || (!isInProgress && text.trim().length > 0)) &&\n pushToTalkState === \"idle\" &&\n !interruptInProgress\n );\n };\n\n const sendDisabled = !canSend();\n\n return (\n <div className=\"copilotKitInputContainer\">\n <div className=\"copilotKitInput\" onClick={handleDivClick}>\n <AutoResizingTextarea\n ref={textareaRef}\n placeholder={context.labels.placeholder}\n autoFocus={true}\n maxRows={5}\n value={text}\n onChange={(event) => setText(event.target.value)}\n onKeyDown={(event) => {\n if (event.key === \"Enter\" && !event.shiftKey) {\n event.preventDefault();\n if (canSend()) {\n send();\n }\n }\n }}\n />\n <div className=\"copilotKitInputControls\">\n <div style={{ flexGrow: 1 }} />\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 ? 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 >\n {buttonIcon}\n </button>\n </div>\n </div>\n </div>\n );\n};\n"],"mappings":";;;;;;;;;;;AAAA,SAAgB,WAAW,QAAQ,gBAAgB;AAKnD,SAAS,yBAAyB;AAqE1B,cAgBA,YAhBA;AAnED,IAAM,QAAQ,CAAC,EAAE,YAAY,QAAQ,YAAY,OAAO,OAAO,MAAkB;AACtF,QAAM,UAAU,eAAe;AAC/B,QAAM,iBAAiB,kBAAkB;AAEzC,QAAM,uBACJ,eAAe,iBAAiB,oBAAoB,UACpD,eAAe,iBAAiB,uBAAuB;AAEzD,QAAM,cAAc,OAA4B,IAAI;AAEpD,QAAM,iBAAiB,CAAC,UAA4C;AAjBtE;AAkBI,UAAM,SAAS,MAAM;AAGrB,QAAI,OAAO,QAAQ,QAAQ;AAAG;AAG9B,QAAI,OAAO,YAAY;AAAY;AAGnC,sBAAY,YAAZ,mBAAqB;AAAA,EACvB;AAEA,QAAM,CAAC,MAAM,OAAO,IAAI,SAAS,EAAE;AACnC,QAAM,OAAO,MAAM;AA/BrB;AAgCI,QAAI;AAAY;AAChB,WAAO,IAAI;AACX,YAAQ,EAAE;AAEV,sBAAY,YAAZ,mBAAqB;AAAA,EACvB;AAEA,YAAU,MAAM;AAvClB;AAwCI,QAAI,WAAW;AACb,wBAAY,YAAZ,mBAAqB;AAAA,IACvB;AAAA,EACF,GAAG,CAAC,SAAS,CAAC;AAEd,QAAM,EAAE,iBAAiB,mBAAmB,IAAI,cAAc;AAAA,IAC5D,cAAc;AAAA,IACd;AAAA,EACF,CAAC;AAED,QAAM,eAAe,cAAc,oBAAoB;AACvD,QAAM,aAAa,eAAe,QAAQ,MAAM,WAAW,QAAQ,MAAM;AACzE,QAAM,iBACJ,y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|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import {
|
|
2
|
+
CopilotKitHelpModal
|
|
3
|
+
} from "./chunk-NRA3CFEE.mjs";
|
|
1
4
|
import {
|
|
2
5
|
getPublishedCopilotKitVersion,
|
|
3
6
|
logActions,
|
|
@@ -6,17 +9,14 @@ import {
|
|
|
6
9
|
shouldShowDevConsole
|
|
7
10
|
} from "./chunk-6TCUJ3B7.mjs";
|
|
8
11
|
import {
|
|
9
|
-
|
|
10
|
-
} from "./chunk-
|
|
12
|
+
SmallSpinnerIcon
|
|
13
|
+
} from "./chunk-ORSMX3SE.mjs";
|
|
11
14
|
import {
|
|
12
15
|
CheckIcon,
|
|
13
16
|
ChevronDownIcon,
|
|
14
17
|
ExclamationMarkIcon,
|
|
15
18
|
ExclamationMarkTriangleIcon
|
|
16
19
|
} from "./chunk-Q5V6S67N.mjs";
|
|
17
|
-
import {
|
|
18
|
-
SmallSpinnerIcon
|
|
19
|
-
} from "./chunk-ORSMX3SE.mjs";
|
|
20
20
|
|
|
21
21
|
// src/components/dev-console/console.tsx
|
|
22
22
|
import { useCopilotContext, useCopilotMessagesContext } from "@copilotkit/react-core";
|
|
@@ -201,4 +201,4 @@ export {
|
|
|
201
201
|
CopilotDevConsole,
|
|
202
202
|
DebugMenuButton
|
|
203
203
|
};
|
|
204
|
-
//# sourceMappingURL=chunk-
|
|
204
|
+
//# sourceMappingURL=chunk-QN2SMWML.mjs.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
CopilotDevConsole
|
|
3
|
-
} from "./chunk-D5XIJNXQ.mjs";
|
|
4
1
|
import {
|
|
5
2
|
useChatContext
|
|
6
3
|
} from "./chunk-UN2E3HCK.mjs";
|
|
4
|
+
import {
|
|
5
|
+
CopilotDevConsole
|
|
6
|
+
} from "./chunk-QN2SMWML.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-W5HLRVAS.mjs.map
|
|
@@ -16,16 +16,16 @@ import {
|
|
|
16
16
|
import {
|
|
17
17
|
RenderAgentStateMessage
|
|
18
18
|
} from "./chunk-UWWMAJ7R.mjs";
|
|
19
|
+
import {
|
|
20
|
+
Messages
|
|
21
|
+
} from "./chunk-ZY25LVYR.mjs";
|
|
19
22
|
import {
|
|
20
23
|
Suggestion,
|
|
21
24
|
reloadSuggestions
|
|
22
25
|
} from "./chunk-TOQ7P4DO.mjs";
|
|
23
26
|
import {
|
|
24
27
|
Input
|
|
25
|
-
} from "./chunk-
|
|
26
|
-
import {
|
|
27
|
-
Messages
|
|
28
|
-
} from "./chunk-ZY25LVYR.mjs";
|
|
28
|
+
} from "./chunk-QJKMOGWN.mjs";
|
|
29
29
|
import {
|
|
30
30
|
ChatContext,
|
|
31
31
|
ChatContextProvider
|
|
@@ -327,4 +327,4 @@ export {
|
|
|
327
327
|
WrappedCopilotChat,
|
|
328
328
|
useCopilotChatLogic
|
|
329
329
|
};
|
|
330
|
-
//# sourceMappingURL=chunk-
|
|
330
|
+
//# sourceMappingURL=chunk-XG356GYI.mjs.map
|
|
@@ -730,7 +730,10 @@ var Input = ({ inProgress, onSend, isVisible = false, onStop }) => {
|
|
|
730
730
|
const textareaRef = (0, import_react5.useRef)(null);
|
|
731
731
|
const handleDivClick = (event) => {
|
|
732
732
|
var _a;
|
|
733
|
-
|
|
733
|
+
const target = event.target;
|
|
734
|
+
if (target.closest("button"))
|
|
735
|
+
return;
|
|
736
|
+
if (target.tagName === "TEXTAREA")
|
|
734
737
|
return;
|
|
735
738
|
(_a = textareaRef.current) == null ? void 0 : _a.focus();
|
|
736
739
|
};
|