@copilotkit/react-ui 1.9.2-next.10 → 1.9.2-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 +0 -70
- package/dist/{chunk-HC4XNT4D.mjs → chunk-6HXS43LW.mjs} +2 -2
- package/dist/{chunk-CV7HMDQX.mjs → chunk-6JX4WIAX.mjs} +2 -2
- package/dist/{chunk-COWRPULP.mjs → chunk-725PPN77.mjs} +9 -11
- package/dist/chunk-725PPN77.mjs.map +1 -0
- package/dist/{chunk-2CVOR5KS.mjs → chunk-EMIYIMQ6.mjs} +14 -24
- package/dist/chunk-EMIYIMQ6.mjs.map +1 -0
- package/dist/{chunk-HTWRXRTZ.mjs → chunk-GVKA7RQQ.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/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 +13 -27
- package/dist/components/chat/Modal.js.map +1 -1
- package/dist/components/chat/Modal.mjs +15 -15
- package/dist/components/chat/Popup.js +13 -27
- package/dist/components/chat/Popup.js.map +1 -1
- package/dist/components/chat/Popup.mjs +16 -16
- package/dist/components/chat/Sidebar.js +13 -27
- package/dist/components/chat/Sidebar.js.map +1 -1
- package/dist/components/chat/Sidebar.mjs +16 -16
- package/dist/components/chat/index.js +13 -27
- 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 +13 -27
- package/dist/components/index.js.map +1 -1
- package/dist/components/index.mjs +23 -23
- package/dist/index.js +13 -27
- 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/Modal.tsx +3 -6
- 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-COWRPULP.mjs.map +0 -1
- /package/dist/{chunk-HC4XNT4D.mjs.map → chunk-6HXS43LW.mjs.map} +0 -0
- /package/dist/{chunk-CV7HMDQX.mjs.map → chunk-6JX4WIAX.mjs.map} +0 -0
- /package/dist/{chunk-HTWRXRTZ.mjs.map → chunk-GVKA7RQQ.mjs.map} +0 -0
- /package/dist/{chunk-OHLSW5IM.mjs.map → chunk-SGFUVPDB.mjs.map} +0 -0
|
@@ -1,9 +1,17 @@
|
|
|
1
1
|
import {
|
|
2
2
|
CopilotModal
|
|
3
|
-
} from "../../chunk-
|
|
3
|
+
} from "../../chunk-725PPN77.mjs";
|
|
4
4
|
import "../../chunk-C3GSYRC3.mjs";
|
|
5
|
+
import "../../chunk-GVKA7RQQ.mjs";
|
|
6
|
+
import "../../chunk-V7W6IM2V.mjs";
|
|
7
|
+
import "../../chunk-SGFUVPDB.mjs";
|
|
8
|
+
import "../../chunk-Q5V6S67N.mjs";
|
|
9
|
+
import "../../chunk-QN7T3GWI.mjs";
|
|
10
|
+
import "../../chunk-KXE2JCUH.mjs";
|
|
11
|
+
import "../../chunk-NRA3CFEE.mjs";
|
|
12
|
+
import "../../chunk-BH6PCAAL.mjs";
|
|
5
13
|
import "../../chunk-UFN2VWSR.mjs";
|
|
6
|
-
import "../../chunk-
|
|
14
|
+
import "../../chunk-RT4HE74K.mjs";
|
|
7
15
|
import "../../chunk-UKCPOBQM.mjs";
|
|
8
16
|
import "../../chunk-2II3Q27P.mjs";
|
|
9
17
|
import "../../chunk-ULDQXCED.mjs";
|
|
@@ -12,24 +20,16 @@ import "../../chunk-32MUWKL3.mjs";
|
|
|
12
20
|
import "../../chunk-L3GZ7TXC.mjs";
|
|
13
21
|
import "../../chunk-HWMFMBJC.mjs";
|
|
14
22
|
import "../../chunk-QGSPTXOV.mjs";
|
|
15
|
-
import "../../chunk-
|
|
23
|
+
import "../../chunk-IMBPSLL4.mjs";
|
|
24
|
+
import "../../chunk-PLHTVHUW.mjs";
|
|
25
|
+
import "../../chunk-EMIYIMQ6.mjs";
|
|
26
|
+
import "../../chunk-CGEAG65D.mjs";
|
|
16
27
|
import "../../chunk-YQFVRDNC.mjs";
|
|
17
28
|
import "../../chunk-YTXEWDNC.mjs";
|
|
18
|
-
import "../../chunk-B3D7U7TJ.mjs";
|
|
19
|
-
import "../../chunk-CGEAG65D.mjs";
|
|
20
|
-
import "../../chunk-IMBPSLL4.mjs";
|
|
21
29
|
import "../../chunk-KENCH7RN.mjs";
|
|
22
|
-
import "../../chunk-
|
|
23
|
-
import "../../chunk-V7W6IM2V.mjs";
|
|
24
|
-
import "../../chunk-OHLSW5IM.mjs";
|
|
25
|
-
import "../../chunk-QN7T3GWI.mjs";
|
|
26
|
-
import "../../chunk-KXE2JCUH.mjs";
|
|
27
|
-
import "../../chunk-NRA3CFEE.mjs";
|
|
28
|
-
import "../../chunk-BH6PCAAL.mjs";
|
|
29
|
-
import "../../chunk-Q5V6S67N.mjs";
|
|
30
|
+
import "../../chunk-B3D7U7TJ.mjs";
|
|
30
31
|
import "../../chunk-IEMQ2SQW.mjs";
|
|
31
32
|
import "../../chunk-XWG3L6QC.mjs";
|
|
32
|
-
import "../../chunk-PLHTVHUW.mjs";
|
|
33
33
|
import "../../chunk-54JAUBUJ.mjs";
|
|
34
34
|
import "../../chunk-JGMFJZMG.mjs";
|
|
35
35
|
import "../../chunk-S5MBUNGN.mjs";
|
|
@@ -1416,15 +1416,8 @@ function PoweredByTag({ showPoweredBy = true }) {
|
|
|
1416
1416
|
// src/components/chat/Input.tsx
|
|
1417
1417
|
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
1418
1418
|
var MAX_NEWLINES = 6;
|
|
1419
|
-
var Input = ({
|
|
1420
|
-
|
|
1421
|
-
onSend,
|
|
1422
|
-
isVisible = false,
|
|
1423
|
-
onStop,
|
|
1424
|
-
onUpload,
|
|
1425
|
-
hideStopButton = false
|
|
1426
|
-
}) => {
|
|
1427
|
-
var _a, _b;
|
|
1419
|
+
var Input = ({ inProgress, onSend, isVisible = false, onStop, onUpload }) => {
|
|
1420
|
+
var _a;
|
|
1428
1421
|
const context = useChatContext();
|
|
1429
1422
|
const copilotContext = (0, import_react_core6.useCopilotContext)();
|
|
1430
1423
|
const showPoweredBy = !((_a = copilotContext.copilotApiConfig) == null ? void 0 : _a.publicApiKey);
|
|
@@ -1453,18 +1446,15 @@ var Input = ({
|
|
|
1453
1446
|
inProgress
|
|
1454
1447
|
});
|
|
1455
1448
|
const isInProgress = inProgress || pushToTalkState === "transcribing";
|
|
1456
|
-
const buttonIcon = isInProgress
|
|
1449
|
+
const buttonIcon = isInProgress ? context.icons.stopIcon : context.icons.sendIcon;
|
|
1457
1450
|
const showPushToTalk = pushToTalkConfigured && (pushToTalkState === "idle" || pushToTalkState === "recording") && !inProgress;
|
|
1458
|
-
const canSend = (
|
|
1451
|
+
const canSend = () => {
|
|
1459
1452
|
var _a2;
|
|
1460
1453
|
const interruptEvent = (_a2 = copilotContext.langGraphInterruptAction) == null ? void 0 : _a2.event;
|
|
1461
1454
|
const interruptInProgress = (interruptEvent == null ? void 0 : interruptEvent.name) === "LangGraphInterruptEvent" && !(interruptEvent == null ? void 0 : interruptEvent.response);
|
|
1462
|
-
return !isInProgress && text.trim().length > 0 && pushToTalkState === "idle" && !interruptInProgress;
|
|
1463
|
-
}
|
|
1464
|
-
const
|
|
1465
|
-
return isInProgress && !hideStopButton;
|
|
1466
|
-
}, [isInProgress, hideStopButton]);
|
|
1467
|
-
const sendDisabled = !canSend && !canStop;
|
|
1455
|
+
return (isInProgress || !isInProgress && text.trim().length > 0) && pushToTalkState === "idle" && !interruptInProgress;
|
|
1456
|
+
};
|
|
1457
|
+
const sendDisabled = !canSend();
|
|
1468
1458
|
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: `copilotKitInputContainer ${showPoweredBy ? "poweredByContainer" : ""}`, children: [
|
|
1469
1459
|
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "copilotKitInput", onClick: handleDivClick, children: [
|
|
1470
1460
|
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
@@ -1479,7 +1469,7 @@ var Input = ({
|
|
|
1479
1469
|
onKeyDown: (event) => {
|
|
1480
1470
|
if (event.key === "Enter" && !event.shiftKey) {
|
|
1481
1471
|
event.preventDefault();
|
|
1482
|
-
if (canSend) {
|
|
1472
|
+
if (canSend()) {
|
|
1483
1473
|
send();
|
|
1484
1474
|
}
|
|
1485
1475
|
}
|
|
@@ -1501,7 +1491,7 @@ var Input = ({
|
|
|
1501
1491
|
"button",
|
|
1502
1492
|
{
|
|
1503
1493
|
disabled: sendDisabled,
|
|
1504
|
-
onClick: isInProgress
|
|
1494
|
+
onClick: isInProgress ? onStop : send,
|
|
1505
1495
|
"data-copilotkit-in-progress": inProgress,
|
|
1506
1496
|
"data-test-id": inProgress ? "copilot-chat-request-in-progress" : "copilot-chat-ready",
|
|
1507
1497
|
className: "copilotKitInputControlButton",
|
|
@@ -2707,8 +2697,7 @@ function CopilotChat({
|
|
|
2707
2697
|
AssistantMessage: AssistantMessage2 = AssistantMessage,
|
|
2708
2698
|
UserMessage: UserMessage2 = UserMessage,
|
|
2709
2699
|
imageUploadsEnabled,
|
|
2710
|
-
inputFileAccept = "image/*"
|
|
2711
|
-
hideStopButton
|
|
2700
|
+
inputFileAccept = "image/*"
|
|
2712
2701
|
}) {
|
|
2713
2702
|
const { additionalInstructions, setChatInstructions } = (0, import_react_core10.useCopilotContext)();
|
|
2714
2703
|
const [selectedImages, setSelectedImages] = (0, import_react13.useState)([]);
|
|
@@ -2891,8 +2880,7 @@ function CopilotChat({
|
|
|
2891
2880
|
onUpload: imageUploadsEnabled ? () => {
|
|
2892
2881
|
var _a;
|
|
2893
2882
|
return (_a = fileInputRef.current) == null ? void 0 : _a.click();
|
|
2894
|
-
} : void 0
|
|
2895
|
-
hideStopButton
|
|
2883
|
+
} : void 0
|
|
2896
2884
|
}
|
|
2897
2885
|
)
|
|
2898
2886
|
] });
|
|
@@ -3157,10 +3145,8 @@ var CopilotModal = (_a) => {
|
|
|
3157
3145
|
onSetOpen == null ? void 0 : onSetOpen(open);
|
|
3158
3146
|
setOpenState(open);
|
|
3159
3147
|
};
|
|
3160
|
-
const memoizedHeader = (0, import_react14.useMemo)(() => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Header2, {}), [Header2]);
|
|
3161
|
-
const memoizedChildren = (0, import_react14.useMemo)(() => children, [children]);
|
|
3162
3148
|
return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(ChatContextProvider, { icons, labels, open: openState, setOpen, children: [
|
|
3163
|
-
|
|
3149
|
+
children,
|
|
3164
3150
|
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className, children: [
|
|
3165
3151
|
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Button2, {}),
|
|
3166
3152
|
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
|
|
@@ -3170,7 +3156,7 @@ var CopilotModal = (_a) => {
|
|
|
3170
3156
|
shortcut,
|
|
3171
3157
|
hitEscapeToClose,
|
|
3172
3158
|
children: [
|
|
3173
|
-
|
|
3159
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Header2, {}),
|
|
3174
3160
|
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
3175
3161
|
CopilotChat,
|
|
3176
3162
|
__spreadProps(__spreadValues({}, props), {
|