@copilotkit/react-ui 1.5.18-next.3 → 1.5.19-next.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.
Files changed (38) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/dist/{chunk-LTVGARDO.mjs → chunk-525VKRDO.mjs} +2 -2
  3. package/dist/{chunk-EQD5OMET.mjs → chunk-652TZXBO.mjs} +2 -2
  4. package/dist/{chunk-IBPPZVL7.mjs → chunk-PO3UGUKD.mjs} +2 -2
  5. package/dist/{chunk-BS76QNZU.mjs → chunk-QRHVTE25.mjs} +3 -3
  6. package/dist/{chunk-EMQEEXUB.mjs → chunk-QXTRFMPM.mjs} +5 -2
  7. package/dist/chunk-QXTRFMPM.mjs.map +1 -0
  8. package/dist/components/chat/Chat.js +4 -1
  9. package/dist/components/chat/Chat.js.map +1 -1
  10. package/dist/components/chat/Chat.mjs +2 -2
  11. package/dist/components/chat/Input.js +4 -1
  12. package/dist/components/chat/Input.js.map +1 -1
  13. package/dist/components/chat/Input.mjs +1 -1
  14. package/dist/components/chat/Modal.js +4 -1
  15. package/dist/components/chat/Modal.js.map +1 -1
  16. package/dist/components/chat/Modal.mjs +3 -3
  17. package/dist/components/chat/Popup.js +4 -1
  18. package/dist/components/chat/Popup.js.map +1 -1
  19. package/dist/components/chat/Popup.mjs +4 -4
  20. package/dist/components/chat/Sidebar.js +4 -1
  21. package/dist/components/chat/Sidebar.js.map +1 -1
  22. package/dist/components/chat/Sidebar.mjs +4 -4
  23. package/dist/components/chat/index.js +4 -1
  24. package/dist/components/chat/index.js.map +1 -1
  25. package/dist/components/chat/index.mjs +5 -5
  26. package/dist/components/index.js +4 -1
  27. package/dist/components/index.js.map +1 -1
  28. package/dist/components/index.mjs +5 -5
  29. package/dist/index.js +4 -1
  30. package/dist/index.js.map +1 -1
  31. package/dist/index.mjs +5 -5
  32. package/package.json +4 -4
  33. package/src/components/chat/Input.tsx +6 -1
  34. package/dist/chunk-EMQEEXUB.mjs.map +0 -1
  35. /package/dist/{chunk-LTVGARDO.mjs.map → chunk-525VKRDO.mjs.map} +0 -0
  36. /package/dist/{chunk-EQD5OMET.mjs.map → chunk-652TZXBO.mjs.map} +0 -0
  37. /package/dist/{chunk-IBPPZVL7.mjs.map → chunk-PO3UGUKD.mjs.map} +0 -0
  38. /package/dist/{chunk-BS76QNZU.mjs.map → chunk-QRHVTE25.mjs.map} +0 -0
package/dist/index.mjs CHANGED
@@ -4,18 +4,18 @@ import "./chunk-MMVDU6DF.mjs";
4
4
  import "./chunk-SQMEPWVT.mjs";
5
5
  import {
6
6
  CopilotSidebar
7
- } from "./chunk-EQD5OMET.mjs";
7
+ } from "./chunk-652TZXBO.mjs";
8
8
  import "./chunk-WB3YULQ4.mjs";
9
9
  import {
10
10
  CopilotPopup
11
- } from "./chunk-IBPPZVL7.mjs";
12
- import "./chunk-BS76QNZU.mjs";
11
+ } from "./chunk-PO3UGUKD.mjs";
12
+ import "./chunk-QRHVTE25.mjs";
13
13
  import "./chunk-YAGE7RCE.mjs";
14
14
  import "./chunk-VEC45H6Q.mjs";
15
15
  import "./chunk-RQNJNK2W.mjs";
16
16
  import {
17
17
  CopilotChat
18
- } from "./chunk-LTVGARDO.mjs";
18
+ } from "./chunk-525VKRDO.mjs";
19
19
  import "./chunk-UWWMAJ7R.mjs";
20
20
  import "./chunk-F7VWGY77.mjs";
21
21
  import "./chunk-OFYI4UU4.mjs";
@@ -38,7 +38,7 @@ import "./chunk-KXE2JCUH.mjs";
38
38
  import "./chunk-TI7SY2RI.mjs";
39
39
  import "./chunk-BH6PCAAL.mjs";
40
40
  import "./chunk-OTPAZXVR.mjs";
41
- import "./chunk-EMQEEXUB.mjs";
41
+ import "./chunk-QXTRFMPM.mjs";
42
42
  import "./chunk-YQFVRDNC.mjs";
43
43
  import {
44
44
  Markdown
package/package.json CHANGED
@@ -9,7 +9,7 @@
9
9
  "publishConfig": {
10
10
  "access": "public"
11
11
  },
12
- "version": "1.5.18-next.3",
12
+ "version": "1.5.19-next.0",
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.5.18-next.3",
54
- "@copilotkit/runtime-client-gql": "1.5.18-next.3",
55
- "@copilotkit/shared": "1.5.18-next.3"
53
+ "@copilotkit/react-core": "1.5.19-next.0",
54
+ "@copilotkit/runtime-client-gql": "1.5.19-next.0",
55
+ "@copilotkit/shared": "1.5.19-next.0"
56
56
  },
57
57
  "keywords": [
58
58
  "copilotkit",
@@ -52,7 +52,12 @@ export const Input = ({ inProgress, onSend, isVisible = false }: InputProps) =>
52
52
  !inProgress;
53
53
 
54
54
  const canSend = () => {
55
- return !inProgress && text.trim().length > 0 && pushToTalkState === "idle";
55
+ const interruptEvent = copilotContext.langGraphInterruptAction?.event;
56
+ const interruptInProgress =
57
+ interruptEvent?.name === "LangGraphInterruptEvent" && !interruptEvent?.response;
58
+ return (
59
+ !inProgress && text.trim().length > 0 && pushToTalkState === "idle" && !interruptInProgress
60
+ );
56
61
  };
57
62
 
58
63
  const sendDisabled = !canSend();
@@ -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 }: 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 // Check if the clicked element is not the textarea itself\n if (event.target !== event.currentTarget) return;\n\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 sendIcon =\n inProgress || pushToTalkState === \"transcribing\"\n ? context.icons.activityIcon\n : context.icons.sendIcon;\n const showPushToTalk =\n pushToTalkConfigured &&\n (pushToTalkState === \"idle\" || pushToTalkState === \"recording\") &&\n !inProgress;\n\n const canSend = () => {\n return !inProgress && text.trim().length > 0 && pushToTalkState === \"idle\";\n };\n\n const sendDisabled = !canSend();\n\n return (\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 {showPushToTalk && (\n <button\n onClick={() =>\n setPushToTalkState(pushToTalkState === \"idle\" ? \"recording\" : \"transcribing\")\n }\n className={pushToTalkState === \"recording\" ? \"copilotKitPushToTalkRecording\" : \"\"}\n >\n {context.icons.pushToTalkIcon}\n </button>\n )}\n <button\n disabled={sendDisabled}\n onClick={send}\n data-copilotkit-in-progress={!!inProgress}\n data-testid={inProgress ? \"copilot-chat-request-in-progress\" : undefined}\n >\n {sendIcon}\n </button>\n </div>\n </div>\n );\n};\n"],"mappings":";;;;;;;;;;;AAAA,SAAgB,WAAW,QAAQ,gBAAgB;AAKnD,SAAS,yBAAyB;AAwD5B,cAgBA,YAhBA;AAtDC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