@copilotkit/react-core 0.0.0-main-20260403195251 → 0.0.0-main-20260406172622
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 +6 -6
- package/dist/copilotkit-BYNyIuE7.d.cts.map +1 -1
- package/dist/copilotkit-BYNyIuE7.d.ts.map +1 -1
- package/dist/{copilotkit-BK_zLoVm.mjs → copilotkit-C8yWo1ap.mjs} +4 -18
- package/dist/copilotkit-C8yWo1ap.mjs.map +1 -0
- package/dist/{copilotkit-CDZGGOIB.cjs → copilotkit-Cs3FSw_2.cjs} +4 -18
- package/dist/copilotkit-Cs3FSw_2.cjs.map +1 -0
- package/dist/copilotkit-rBCfdqIo.d.mts.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +1 -1
- package/dist/v2/index.cjs +1 -1
- package/dist/v2/index.mjs +1 -1
- package/dist/v2/index.umd.js +3 -17
- package/dist/v2/index.umd.js.map +1 -1
- package/package.json +7 -7
- package/src/v2/components/chat/CopilotChatInput.tsx +3 -19
- package/src/v2/components/chat/__tests__/CopilotChatInput.test.tsx +46 -0
- package/dist/copilotkit-BK_zLoVm.mjs.map +0 -1
- package/dist/copilotkit-CDZGGOIB.cjs.map +0 -1
|
@@ -578,7 +578,7 @@ function renderSlot(slot, DefaultComponent, props) {
|
|
|
578
578
|
//#region src/v2/components/chat/CopilotChatInput.tsx
|
|
579
579
|
const SLASH_MENU_MAX_VISIBLE_ITEMS = 5;
|
|
580
580
|
const SLASH_MENU_ITEM_HEIGHT_PX = 40;
|
|
581
|
-
function CopilotChatInput({ mode = "input", onSubmitMessage, onStop, isRunning = false, onStartTranscribe, onCancelTranscribe, onFinishTranscribe, onFinishTranscribeWithAudio, onAddFile, onChange, value, toolsMenu, autoFocus =
|
|
581
|
+
function CopilotChatInput({ mode = "input", onSubmitMessage, onStop, isRunning = false, onStartTranscribe, onCancelTranscribe, onFinishTranscribe, onFinishTranscribeWithAudio, onAddFile, onChange, value, toolsMenu, autoFocus = false, positioning = "static", keyboardHeight = 0, containerRef, showDisclaimer, textArea, sendButton, startTranscribeButton, cancelTranscribeButton, finishTranscribeButton, addMenuButton, audioRecorder, disclaimer, children, className, ...props }) {
|
|
582
582
|
const isControlled = value !== void 0;
|
|
583
583
|
const [internalValue, setInternalValue] = (0, react.useState)(() => value ?? "");
|
|
584
584
|
(0, react.useEffect)(() => {
|
|
@@ -651,7 +651,7 @@ function CopilotChatInput({ mode = "input", onSubmitMessage, onStop, isRunning =
|
|
|
651
651
|
previousModalStateRef.current = config?.isModalOpen;
|
|
652
652
|
return;
|
|
653
653
|
}
|
|
654
|
-
if (config?.isModalOpen && !previousModalStateRef.current) inputRef.current?.focus();
|
|
654
|
+
if (config?.isModalOpen && !previousModalStateRef.current) inputRef.current?.focus({ preventScroll: true });
|
|
655
655
|
previousModalStateRef.current = config?.isModalOpen;
|
|
656
656
|
}, [config?.isModalOpen, autoFocus]);
|
|
657
657
|
(0, react.useEffect)(() => {
|
|
@@ -1191,21 +1191,7 @@ function CopilotChatInput({ mode = "input", onSubmitMessage, onStop, isRunning =
|
|
|
1191
1191
|
const labels = useCopilotChatConfiguration()?.labels ?? CopilotChatDefaultLabels;
|
|
1192
1192
|
(0, react.useImperativeHandle)(ref, () => internalTextareaRef.current);
|
|
1193
1193
|
(0, react.useEffect)(() => {
|
|
1194
|
-
|
|
1195
|
-
if (!textarea) return;
|
|
1196
|
-
const handleFocus = () => {
|
|
1197
|
-
setTimeout(() => {
|
|
1198
|
-
textarea.scrollIntoView({
|
|
1199
|
-
behavior: "smooth",
|
|
1200
|
-
block: "nearest"
|
|
1201
|
-
});
|
|
1202
|
-
}, 300);
|
|
1203
|
-
};
|
|
1204
|
-
textarea.addEventListener("focus", handleFocus);
|
|
1205
|
-
return () => textarea.removeEventListener("focus", handleFocus);
|
|
1206
|
-
}, []);
|
|
1207
|
-
(0, react.useEffect)(() => {
|
|
1208
|
-
if (autoFocus) internalTextareaRef.current?.focus();
|
|
1194
|
+
if (autoFocus) internalTextareaRef.current?.focus({ preventScroll: true });
|
|
1209
1195
|
}, [autoFocus]);
|
|
1210
1196
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("textarea", {
|
|
1211
1197
|
ref: internalTextareaRef,
|
|
@@ -8071,4 +8057,4 @@ Object.defineProperty(exports, 'useToast', {
|
|
|
8071
8057
|
return useToast;
|
|
8072
8058
|
}
|
|
8073
8059
|
});
|
|
8074
|
-
//# sourceMappingURL=copilotkit-
|
|
8060
|
+
//# sourceMappingURL=copilotkit-Cs3FSw_2.cjs.map
|