@copilotkit/react-ui 1.8.10-next.0 → 1.8.10-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 +17 -0
- package/dist/{chunk-BDNHZ3GW.mjs → chunk-B4N2T3V3.mjs} +3 -2
- package/dist/chunk-B4N2T3V3.mjs.map +1 -0
- package/dist/{chunk-JOL7NS2W.mjs → chunk-DP6QC6LJ.mjs} +2 -2
- package/dist/{chunk-O34Z4XM2.mjs → chunk-FHVERB23.mjs} +2 -2
- package/dist/{chunk-Y7UO3RPW.mjs → chunk-IJDF7C64.mjs} +3 -3
- package/dist/{chunk-T7N77F5Y.mjs → chunk-T4ETOM63.mjs} +2 -2
- package/dist/components/chat/Chat.js +2 -1
- package/dist/components/chat/Chat.js.map +1 -1
- package/dist/components/chat/Chat.mjs +2 -2
- package/dist/components/chat/Input.js +2 -1
- package/dist/components/chat/Input.js.map +1 -1
- package/dist/components/chat/Input.mjs +1 -1
- package/dist/components/chat/Modal.js +2 -1
- package/dist/components/chat/Modal.js.map +1 -1
- package/dist/components/chat/Modal.mjs +3 -3
- package/dist/components/chat/Popup.js +2 -1
- package/dist/components/chat/Popup.js.map +1 -1
- package/dist/components/chat/Popup.mjs +4 -4
- package/dist/components/chat/Sidebar.js +2 -1
- package/dist/components/chat/Sidebar.js.map +1 -1
- package/dist/components/chat/Sidebar.mjs +4 -4
- package/dist/components/chat/index.js +2 -1
- package/dist/components/chat/index.js.map +1 -1
- package/dist/components/chat/index.mjs +5 -5
- package/dist/components/index.js +2 -1
- package/dist/components/index.js.map +1 -1
- package/dist/components/index.mjs +5 -5
- package/dist/index.css +18 -3
- package/dist/index.css.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +5 -5
- package/package.json +4 -4
- package/src/components/chat/Input.tsx +3 -1
- package/src/css/input.css +23 -3
- package/dist/chunk-BDNHZ3GW.mjs.map +0 -1
- /package/dist/{chunk-JOL7NS2W.mjs.map → chunk-DP6QC6LJ.mjs.map} +0 -0
- /package/dist/{chunk-O34Z4XM2.mjs.map → chunk-FHVERB23.mjs.map} +0 -0
- /package/dist/{chunk-Y7UO3RPW.mjs.map → chunk-IJDF7C64.mjs.map} +0 -0
- /package/dist/{chunk-T7N77F5Y.mjs.map → chunk-T4ETOM63.mjs.map} +0 -0
package/dist/index.mjs
CHANGED
|
@@ -4,12 +4,12 @@ import "./chunk-MMVDU6DF.mjs";
|
|
|
4
4
|
import "./chunk-PXEVB7IK.mjs";
|
|
5
5
|
import {
|
|
6
6
|
CopilotPopup
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-T4ETOM63.mjs";
|
|
8
8
|
import {
|
|
9
9
|
CopilotSidebar
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-DP6QC6LJ.mjs";
|
|
11
11
|
import "./chunk-WB3YULQ4.mjs";
|
|
12
|
-
import "./chunk-
|
|
12
|
+
import "./chunk-IJDF7C64.mjs";
|
|
13
13
|
import "./chunk-Q2NFQTCQ.mjs";
|
|
14
14
|
import "./chunk-UH2UFL5W.mjs";
|
|
15
15
|
import "./chunk-V7W6IM2V.mjs";
|
|
@@ -26,7 +26,7 @@ import "./chunk-BH6PCAAL.mjs";
|
|
|
26
26
|
import "./chunk-UFN2VWSR.mjs";
|
|
27
27
|
import {
|
|
28
28
|
CopilotChat
|
|
29
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-FHVERB23.mjs";
|
|
30
30
|
import "./chunk-DSQGQJI4.mjs";
|
|
31
31
|
import "./chunk-24TDU7MY.mjs";
|
|
32
32
|
import {
|
|
@@ -42,7 +42,7 @@ import {
|
|
|
42
42
|
} from "./chunk-OZXUB3V7.mjs";
|
|
43
43
|
import "./chunk-XZNY26GH.mjs";
|
|
44
44
|
import "./chunk-PLHTVHUW.mjs";
|
|
45
|
-
import "./chunk-
|
|
45
|
+
import "./chunk-B4N2T3V3.mjs";
|
|
46
46
|
import "./chunk-YQFVRDNC.mjs";
|
|
47
47
|
import {
|
|
48
48
|
Markdown
|
package/package.json
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"publishConfig": {
|
|
10
10
|
"access": "public"
|
|
11
11
|
},
|
|
12
|
-
"version": "1.8.10-next.
|
|
12
|
+
"version": "1.8.10-next.2",
|
|
13
13
|
"sideEffects": [
|
|
14
14
|
"**/*.css"
|
|
15
15
|
],
|
|
@@ -50,9 +50,9 @@
|
|
|
50
50
|
"react-syntax-highlighter": "^15.5.0",
|
|
51
51
|
"remark-gfm": "^3.0.1",
|
|
52
52
|
"remark-math": "^5.1.1",
|
|
53
|
-
"@copilotkit/react-core": "1.8.10-next.
|
|
54
|
-
"@copilotkit/runtime-client-gql": "1.8.10-next.
|
|
55
|
-
"@copilotkit/shared": "1.8.10-next.
|
|
53
|
+
"@copilotkit/react-core": "1.8.10-next.2",
|
|
54
|
+
"@copilotkit/runtime-client-gql": "1.8.10-next.2",
|
|
55
|
+
"@copilotkit/shared": "1.8.10-next.2"
|
|
56
56
|
},
|
|
57
57
|
"keywords": [
|
|
58
58
|
"copilotkit",
|
|
@@ -5,6 +5,8 @@ import AutoResizingTextarea from "./Textarea";
|
|
|
5
5
|
import { usePushToTalk } from "../../hooks/use-push-to-talk";
|
|
6
6
|
import { useCopilotContext } from "@copilotkit/react-core";
|
|
7
7
|
|
|
8
|
+
const MAX_NEWLINES = 6;
|
|
9
|
+
|
|
8
10
|
export const Input = ({ inProgress, onSend, isVisible = false, onStop, onUpload }: InputProps) => {
|
|
9
11
|
const context = useChatContext();
|
|
10
12
|
const copilotContext = useCopilotContext();
|
|
@@ -76,7 +78,7 @@ export const Input = ({ inProgress, onSend, isVisible = false, onStop, onUpload
|
|
|
76
78
|
ref={textareaRef}
|
|
77
79
|
placeholder={context.labels.placeholder}
|
|
78
80
|
autoFocus={true}
|
|
79
|
-
maxRows={
|
|
81
|
+
maxRows={MAX_NEWLINES}
|
|
80
82
|
value={text}
|
|
81
83
|
onChange={(event) => setText(event.target.value)}
|
|
82
84
|
onKeyDown={(event) => {
|
package/src/css/input.css
CHANGED
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
.copilotKitInput {
|
|
2
|
-
display: flex;
|
|
3
|
-
flex-direction: column;
|
|
4
2
|
cursor: text;
|
|
5
3
|
position: relative;
|
|
6
4
|
background-color: var(--copilot-kit-input-background-color);
|
|
7
5
|
border-radius: 20px;
|
|
8
6
|
border: 1px solid var(--copilot-kit-separator-color);
|
|
9
7
|
padding: 12px 14px;
|
|
10
|
-
height: 75px;
|
|
8
|
+
min-height: 75px;
|
|
11
9
|
margin: 0 auto;
|
|
12
10
|
width: 95%;
|
|
13
11
|
}
|
|
@@ -90,6 +88,7 @@
|
|
|
90
88
|
color: var(--copilot-kit-secondary-contrast-color);
|
|
91
89
|
border: 0px;
|
|
92
90
|
background-color: transparent;
|
|
91
|
+
width: 100%;
|
|
93
92
|
}
|
|
94
93
|
|
|
95
94
|
.copilotKitInput > textarea::placeholder {
|
|
@@ -103,3 +102,24 @@
|
|
|
103
102
|
border-radius: 50%;
|
|
104
103
|
animation: copilotKitPulseAnimation 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
|
|
105
104
|
}
|
|
105
|
+
|
|
106
|
+
/* Scrollbar styles */
|
|
107
|
+
.copilotKitInput textarea::-webkit-scrollbar {
|
|
108
|
+
width: 9px; /* Width of the entire scrollbar */
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
.copilotKitInput textarea::-webkit-scrollbar-track {
|
|
112
|
+
background: transparent; /* Color of the tracking area */
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
.copilotKitInput textarea::-webkit-scrollbar-thumb {
|
|
116
|
+
background-color: rgb(200 200 200); /* Color of the scroll thumb */
|
|
117
|
+
border-radius: 10px; /* Roundness of the scroll thumb */
|
|
118
|
+
border: 2px solid transparent; /* Creates padding around scroll thumb */
|
|
119
|
+
background-clip: content-box;
|
|
120
|
+
cursor: pointer;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
.copilotKitInput textarea::-webkit-scrollbar-thumb:hover {
|
|
124
|
+
background-color: color-mix(in srgb, rgb(200 200 200) 80%, black); /* Darker color on hover */
|
|
125
|
+
}
|
|
@@ -1 +0,0 @@
|
|
|
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, onUpload }: 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 {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 ? 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,QAAQ,SAAS,MAAkB;AAChG,QAAM,UAAU,eAAe;AAC/B,QAA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