@copilotkit/react-ui 1.9.2-next.10 → 1.9.2-next.3
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 +0 -60
- package/dist/{chunk-2CVOR5KS.mjs → chunk-EMIYIMQ6.mjs} +14 -24
- package/dist/chunk-EMIYIMQ6.mjs.map +1 -0
- package/dist/{chunk-HC4XNT4D.mjs → chunk-GBGU4ZR6.mjs} +2 -2
- package/dist/{chunk-HTWRXRTZ.mjs → chunk-GVKA7RQQ.mjs} +2 -2
- package/dist/{chunk-CV7HMDQX.mjs → chunk-KGKVOUC3.mjs} +2 -2
- package/dist/{chunk-6CM2HBBL.mjs → chunk-RT4HE74K.mjs} +10 -12
- package/dist/chunk-RT4HE74K.mjs.map +1 -0
- package/dist/{chunk-OHLSW5IM.mjs → chunk-SGFUVPDB.mjs} +7 -7
- package/dist/{chunk-COWRPULP.mjs → chunk-XZI6DUGE.mjs} +6 -6
- package/dist/components/chat/Chat.d.ts +1 -2
- package/dist/components/chat/Chat.js +11 -23
- package/dist/components/chat/Chat.js.map +1 -1
- package/dist/components/chat/Chat.mjs +6 -6
- package/dist/components/chat/Header.mjs +3 -3
- package/dist/components/chat/Input.d.ts +1 -1
- package/dist/components/chat/Input.js +9 -19
- package/dist/components/chat/Input.js.map +1 -1
- package/dist/components/chat/Input.mjs +2 -2
- package/dist/components/chat/Modal.js +11 -23
- package/dist/components/chat/Modal.js.map +1 -1
- package/dist/components/chat/Modal.mjs +15 -15
- package/dist/components/chat/Popup.js +11 -23
- package/dist/components/chat/Popup.js.map +1 -1
- package/dist/components/chat/Popup.mjs +16 -16
- package/dist/components/chat/Sidebar.js +11 -23
- package/dist/components/chat/Sidebar.js.map +1 -1
- package/dist/components/chat/Sidebar.mjs +16 -16
- package/dist/components/chat/index.js +11 -23
- package/dist/components/chat/index.js.map +1 -1
- package/dist/components/chat/index.mjs +19 -19
- package/dist/components/chat/props.d.ts +0 -1
- package/dist/components/chat/props.js.map +1 -1
- package/dist/components/dev-console/console.mjs +2 -2
- package/dist/components/dev-console/index.mjs +2 -2
- package/dist/components/index.js +11 -23
- package/dist/components/index.js.map +1 -1
- package/dist/components/index.mjs +23 -23
- package/dist/index.js +11 -23
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +24 -24
- package/dist/lib/utils.test.d.ts +2 -0
- package/dist/lib/utils.test.js +9 -0
- package/dist/lib/utils.test.js.map +1 -0
- package/dist/lib/utils.test.mjs +7 -0
- package/dist/lib/utils.test.mjs.map +1 -0
- package/package.json +5 -5
- package/src/components/chat/Chat.tsx +0 -4
- package/src/components/chat/Input.tsx +11 -21
- package/src/components/chat/props.ts +0 -1
- package/tsup.config.ts +6 -1
- package/dist/chunk-2CVOR5KS.mjs.map +0 -1
- package/dist/chunk-6CM2HBBL.mjs.map +0 -1
- /package/dist/{chunk-HC4XNT4D.mjs.map → chunk-GBGU4ZR6.mjs.map} +0 -0
- /package/dist/{chunk-HTWRXRTZ.mjs.map → chunk-GVKA7RQQ.mjs.map} +0 -0
- /package/dist/{chunk-CV7HMDQX.mjs.map → chunk-KGKVOUC3.mjs.map} +0 -0
- /package/dist/{chunk-OHLSW5IM.mjs.map → chunk-SGFUVPDB.mjs.map} +0 -0
- /package/dist/{chunk-COWRPULP.mjs.map → chunk-XZI6DUGE.mjs.map} +0 -0
|
@@ -3,16 +3,28 @@ import "../chunk-SC6JRFAJ.mjs";
|
|
|
3
3
|
import "../chunk-WB3YULQ4.mjs";
|
|
4
4
|
import {
|
|
5
5
|
CopilotPopup
|
|
6
|
-
} from "../chunk-
|
|
6
|
+
} from "../chunk-GBGU4ZR6.mjs";
|
|
7
7
|
import {
|
|
8
8
|
CopilotSidebar
|
|
9
|
-
} from "../chunk-
|
|
10
|
-
import "../chunk-
|
|
9
|
+
} from "../chunk-KGKVOUC3.mjs";
|
|
10
|
+
import "../chunk-XZI6DUGE.mjs";
|
|
11
11
|
import "../chunk-C3GSYRC3.mjs";
|
|
12
|
+
import "../chunk-GVKA7RQQ.mjs";
|
|
13
|
+
import "../chunk-V7W6IM2V.mjs";
|
|
14
|
+
import {
|
|
15
|
+
CopilotDevConsole
|
|
16
|
+
} from "../chunk-SGFUVPDB.mjs";
|
|
17
|
+
import "../chunk-Q5V6S67N.mjs";
|
|
18
|
+
import {
|
|
19
|
+
shouldShowDevConsole
|
|
20
|
+
} from "../chunk-QN7T3GWI.mjs";
|
|
21
|
+
import "../chunk-KXE2JCUH.mjs";
|
|
22
|
+
import "../chunk-NRA3CFEE.mjs";
|
|
23
|
+
import "../chunk-BH6PCAAL.mjs";
|
|
12
24
|
import "../chunk-UFN2VWSR.mjs";
|
|
13
25
|
import {
|
|
14
26
|
CopilotChat
|
|
15
|
-
} from "../chunk-
|
|
27
|
+
} from "../chunk-RT4HE74K.mjs";
|
|
16
28
|
import "../chunk-UKCPOBQM.mjs";
|
|
17
29
|
import "../chunk-2II3Q27P.mjs";
|
|
18
30
|
import {
|
|
@@ -29,34 +41,22 @@ import {
|
|
|
29
41
|
import {
|
|
30
42
|
Suggestions
|
|
31
43
|
} from "../chunk-QGSPTXOV.mjs";
|
|
32
|
-
import
|
|
44
|
+
import {
|
|
45
|
+
Suggestion
|
|
46
|
+
} from "../chunk-IMBPSLL4.mjs";
|
|
47
|
+
import "../chunk-PLHTVHUW.mjs";
|
|
48
|
+
import "../chunk-EMIYIMQ6.mjs";
|
|
49
|
+
import "../chunk-CGEAG65D.mjs";
|
|
33
50
|
import "../chunk-YQFVRDNC.mjs";
|
|
34
51
|
import {
|
|
35
52
|
Markdown
|
|
36
53
|
} from "../chunk-YTXEWDNC.mjs";
|
|
37
|
-
import "../chunk-B3D7U7TJ.mjs";
|
|
38
|
-
import "../chunk-CGEAG65D.mjs";
|
|
39
|
-
import {
|
|
40
|
-
Suggestion
|
|
41
|
-
} from "../chunk-IMBPSLL4.mjs";
|
|
42
54
|
import "../chunk-KENCH7RN.mjs";
|
|
43
|
-
import "../chunk-
|
|
44
|
-
import "../chunk-V7W6IM2V.mjs";
|
|
45
|
-
import {
|
|
46
|
-
CopilotDevConsole
|
|
47
|
-
} from "../chunk-OHLSW5IM.mjs";
|
|
48
|
-
import {
|
|
49
|
-
shouldShowDevConsole
|
|
50
|
-
} from "../chunk-QN7T3GWI.mjs";
|
|
51
|
-
import "../chunk-KXE2JCUH.mjs";
|
|
52
|
-
import "../chunk-NRA3CFEE.mjs";
|
|
53
|
-
import "../chunk-BH6PCAAL.mjs";
|
|
54
|
-
import "../chunk-Q5V6S67N.mjs";
|
|
55
|
+
import "../chunk-B3D7U7TJ.mjs";
|
|
55
56
|
import {
|
|
56
57
|
useChatContext
|
|
57
58
|
} from "../chunk-IEMQ2SQW.mjs";
|
|
58
59
|
import "../chunk-XWG3L6QC.mjs";
|
|
59
|
-
import "../chunk-PLHTVHUW.mjs";
|
|
60
60
|
import "../chunk-54JAUBUJ.mjs";
|
|
61
61
|
import "../chunk-JGMFJZMG.mjs";
|
|
62
62
|
import "../chunk-S5MBUNGN.mjs";
|
package/dist/index.js
CHANGED
|
@@ -1429,15 +1429,8 @@ function PoweredByTag({ showPoweredBy = true }) {
|
|
|
1429
1429
|
// src/components/chat/Input.tsx
|
|
1430
1430
|
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
1431
1431
|
var MAX_NEWLINES = 6;
|
|
1432
|
-
var Input = ({
|
|
1433
|
-
|
|
1434
|
-
onSend,
|
|
1435
|
-
isVisible = false,
|
|
1436
|
-
onStop,
|
|
1437
|
-
onUpload,
|
|
1438
|
-
hideStopButton = false
|
|
1439
|
-
}) => {
|
|
1440
|
-
var _a, _b;
|
|
1432
|
+
var Input = ({ inProgress, onSend, isVisible = false, onStop, onUpload }) => {
|
|
1433
|
+
var _a;
|
|
1441
1434
|
const context = useChatContext();
|
|
1442
1435
|
const copilotContext = (0, import_react_core6.useCopilotContext)();
|
|
1443
1436
|
const showPoweredBy = !((_a = copilotContext.copilotApiConfig) == null ? void 0 : _a.publicApiKey);
|
|
@@ -1466,18 +1459,15 @@ var Input = ({
|
|
|
1466
1459
|
inProgress
|
|
1467
1460
|
});
|
|
1468
1461
|
const isInProgress = inProgress || pushToTalkState === "transcribing";
|
|
1469
|
-
const buttonIcon = isInProgress
|
|
1462
|
+
const buttonIcon = isInProgress ? context.icons.stopIcon : context.icons.sendIcon;
|
|
1470
1463
|
const showPushToTalk = pushToTalkConfigured && (pushToTalkState === "idle" || pushToTalkState === "recording") && !inProgress;
|
|
1471
|
-
const canSend = (
|
|
1464
|
+
const canSend = () => {
|
|
1472
1465
|
var _a2;
|
|
1473
1466
|
const interruptEvent = (_a2 = copilotContext.langGraphInterruptAction) == null ? void 0 : _a2.event;
|
|
1474
1467
|
const interruptInProgress = (interruptEvent == null ? void 0 : interruptEvent.name) === "LangGraphInterruptEvent" && !(interruptEvent == null ? void 0 : interruptEvent.response);
|
|
1475
|
-
return !isInProgress && text.trim().length > 0 && pushToTalkState === "idle" && !interruptInProgress;
|
|
1476
|
-
}
|
|
1477
|
-
const
|
|
1478
|
-
return isInProgress && !hideStopButton;
|
|
1479
|
-
}, [isInProgress, hideStopButton]);
|
|
1480
|
-
const sendDisabled = !canSend && !canStop;
|
|
1468
|
+
return (isInProgress || !isInProgress && text.trim().length > 0) && pushToTalkState === "idle" && !interruptInProgress;
|
|
1469
|
+
};
|
|
1470
|
+
const sendDisabled = !canSend();
|
|
1481
1471
|
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: `copilotKitInputContainer ${showPoweredBy ? "poweredByContainer" : ""}`, children: [
|
|
1482
1472
|
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "copilotKitInput", onClick: handleDivClick, children: [
|
|
1483
1473
|
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
@@ -1492,7 +1482,7 @@ var Input = ({
|
|
|
1492
1482
|
onKeyDown: (event) => {
|
|
1493
1483
|
if (event.key === "Enter" && !event.shiftKey) {
|
|
1494
1484
|
event.preventDefault();
|
|
1495
|
-
if (canSend) {
|
|
1485
|
+
if (canSend()) {
|
|
1496
1486
|
send();
|
|
1497
1487
|
}
|
|
1498
1488
|
}
|
|
@@ -1514,7 +1504,7 @@ var Input = ({
|
|
|
1514
1504
|
"button",
|
|
1515
1505
|
{
|
|
1516
1506
|
disabled: sendDisabled,
|
|
1517
|
-
onClick: isInProgress
|
|
1507
|
+
onClick: isInProgress ? onStop : send,
|
|
1518
1508
|
"data-copilotkit-in-progress": inProgress,
|
|
1519
1509
|
"data-test-id": inProgress ? "copilot-chat-request-in-progress" : "copilot-chat-ready",
|
|
1520
1510
|
className: "copilotKitInputControlButton",
|
|
@@ -2720,8 +2710,7 @@ function CopilotChat({
|
|
|
2720
2710
|
AssistantMessage: AssistantMessage2 = AssistantMessage,
|
|
2721
2711
|
UserMessage: UserMessage2 = UserMessage,
|
|
2722
2712
|
imageUploadsEnabled,
|
|
2723
|
-
inputFileAccept = "image/*"
|
|
2724
|
-
hideStopButton
|
|
2713
|
+
inputFileAccept = "image/*"
|
|
2725
2714
|
}) {
|
|
2726
2715
|
const { additionalInstructions, setChatInstructions } = (0, import_react_core10.useCopilotContext)();
|
|
2727
2716
|
const [selectedImages, setSelectedImages] = (0, import_react13.useState)([]);
|
|
@@ -2904,8 +2893,7 @@ function CopilotChat({
|
|
|
2904
2893
|
onUpload: imageUploadsEnabled ? () => {
|
|
2905
2894
|
var _a;
|
|
2906
2895
|
return (_a = fileInputRef.current) == null ? void 0 : _a.click();
|
|
2907
|
-
} : void 0
|
|
2908
|
-
hideStopButton
|
|
2896
|
+
} : void 0
|
|
2909
2897
|
}
|
|
2910
2898
|
)
|
|
2911
2899
|
] });
|