@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,10 +1,18 @@
|
|
|
1
1
|
import {
|
|
2
2
|
CopilotSidebar
|
|
3
|
-
} from "../../chunk-
|
|
4
|
-
import "../../chunk-
|
|
3
|
+
} from "../../chunk-6JX4WIAX.mjs";
|
|
4
|
+
import "../../chunk-725PPN77.mjs";
|
|
5
5
|
import "../../chunk-C3GSYRC3.mjs";
|
|
6
|
+
import "../../chunk-GVKA7RQQ.mjs";
|
|
7
|
+
import "../../chunk-V7W6IM2V.mjs";
|
|
8
|
+
import "../../chunk-SGFUVPDB.mjs";
|
|
9
|
+
import "../../chunk-Q5V6S67N.mjs";
|
|
10
|
+
import "../../chunk-QN7T3GWI.mjs";
|
|
11
|
+
import "../../chunk-KXE2JCUH.mjs";
|
|
12
|
+
import "../../chunk-NRA3CFEE.mjs";
|
|
13
|
+
import "../../chunk-BH6PCAAL.mjs";
|
|
6
14
|
import "../../chunk-UFN2VWSR.mjs";
|
|
7
|
-
import "../../chunk-
|
|
15
|
+
import "../../chunk-RT4HE74K.mjs";
|
|
8
16
|
import "../../chunk-UKCPOBQM.mjs";
|
|
9
17
|
import "../../chunk-2II3Q27P.mjs";
|
|
10
18
|
import "../../chunk-ULDQXCED.mjs";
|
|
@@ -13,24 +21,16 @@ import "../../chunk-32MUWKL3.mjs";
|
|
|
13
21
|
import "../../chunk-L3GZ7TXC.mjs";
|
|
14
22
|
import "../../chunk-HWMFMBJC.mjs";
|
|
15
23
|
import "../../chunk-QGSPTXOV.mjs";
|
|
16
|
-
import "../../chunk-
|
|
24
|
+
import "../../chunk-IMBPSLL4.mjs";
|
|
25
|
+
import "../../chunk-PLHTVHUW.mjs";
|
|
26
|
+
import "../../chunk-EMIYIMQ6.mjs";
|
|
27
|
+
import "../../chunk-CGEAG65D.mjs";
|
|
17
28
|
import "../../chunk-YQFVRDNC.mjs";
|
|
18
29
|
import "../../chunk-YTXEWDNC.mjs";
|
|
19
|
-
import "../../chunk-B3D7U7TJ.mjs";
|
|
20
|
-
import "../../chunk-CGEAG65D.mjs";
|
|
21
|
-
import "../../chunk-IMBPSLL4.mjs";
|
|
22
30
|
import "../../chunk-KENCH7RN.mjs";
|
|
23
|
-
import "../../chunk-
|
|
24
|
-
import "../../chunk-V7W6IM2V.mjs";
|
|
25
|
-
import "../../chunk-OHLSW5IM.mjs";
|
|
26
|
-
import "../../chunk-QN7T3GWI.mjs";
|
|
27
|
-
import "../../chunk-KXE2JCUH.mjs";
|
|
28
|
-
import "../../chunk-NRA3CFEE.mjs";
|
|
29
|
-
import "../../chunk-BH6PCAAL.mjs";
|
|
30
|
-
import "../../chunk-Q5V6S67N.mjs";
|
|
31
|
+
import "../../chunk-B3D7U7TJ.mjs";
|
|
31
32
|
import "../../chunk-IEMQ2SQW.mjs";
|
|
32
33
|
import "../../chunk-XWG3L6QC.mjs";
|
|
33
|
-
import "../../chunk-PLHTVHUW.mjs";
|
|
34
34
|
import "../../chunk-54JAUBUJ.mjs";
|
|
35
35
|
import "../../chunk-JGMFJZMG.mjs";
|
|
36
36
|
import "../../chunk-S5MBUNGN.mjs";
|
|
@@ -1425,15 +1425,8 @@ function PoweredByTag({ showPoweredBy = true }) {
|
|
|
1425
1425
|
// src/components/chat/Input.tsx
|
|
1426
1426
|
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
1427
1427
|
var MAX_NEWLINES = 6;
|
|
1428
|
-
var Input = ({
|
|
1429
|
-
|
|
1430
|
-
onSend,
|
|
1431
|
-
isVisible = false,
|
|
1432
|
-
onStop,
|
|
1433
|
-
onUpload,
|
|
1434
|
-
hideStopButton = false
|
|
1435
|
-
}) => {
|
|
1436
|
-
var _a, _b;
|
|
1428
|
+
var Input = ({ inProgress, onSend, isVisible = false, onStop, onUpload }) => {
|
|
1429
|
+
var _a;
|
|
1437
1430
|
const context = useChatContext();
|
|
1438
1431
|
const copilotContext = (0, import_react_core6.useCopilotContext)();
|
|
1439
1432
|
const showPoweredBy = !((_a = copilotContext.copilotApiConfig) == null ? void 0 : _a.publicApiKey);
|
|
@@ -1462,18 +1455,15 @@ var Input = ({
|
|
|
1462
1455
|
inProgress
|
|
1463
1456
|
});
|
|
1464
1457
|
const isInProgress = inProgress || pushToTalkState === "transcribing";
|
|
1465
|
-
const buttonIcon = isInProgress
|
|
1458
|
+
const buttonIcon = isInProgress ? context.icons.stopIcon : context.icons.sendIcon;
|
|
1466
1459
|
const showPushToTalk = pushToTalkConfigured && (pushToTalkState === "idle" || pushToTalkState === "recording") && !inProgress;
|
|
1467
|
-
const canSend = (
|
|
1460
|
+
const canSend = () => {
|
|
1468
1461
|
var _a2;
|
|
1469
1462
|
const interruptEvent = (_a2 = copilotContext.langGraphInterruptAction) == null ? void 0 : _a2.event;
|
|
1470
1463
|
const interruptInProgress = (interruptEvent == null ? void 0 : interruptEvent.name) === "LangGraphInterruptEvent" && !(interruptEvent == null ? void 0 : interruptEvent.response);
|
|
1471
|
-
return !isInProgress && text.trim().length > 0 && pushToTalkState === "idle" && !interruptInProgress;
|
|
1472
|
-
}
|
|
1473
|
-
const
|
|
1474
|
-
return isInProgress && !hideStopButton;
|
|
1475
|
-
}, [isInProgress, hideStopButton]);
|
|
1476
|
-
const sendDisabled = !canSend && !canStop;
|
|
1464
|
+
return (isInProgress || !isInProgress && text.trim().length > 0) && pushToTalkState === "idle" && !interruptInProgress;
|
|
1465
|
+
};
|
|
1466
|
+
const sendDisabled = !canSend();
|
|
1477
1467
|
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: `copilotKitInputContainer ${showPoweredBy ? "poweredByContainer" : ""}`, children: [
|
|
1478
1468
|
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "copilotKitInput", onClick: handleDivClick, children: [
|
|
1479
1469
|
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
@@ -1488,7 +1478,7 @@ var Input = ({
|
|
|
1488
1478
|
onKeyDown: (event) => {
|
|
1489
1479
|
if (event.key === "Enter" && !event.shiftKey) {
|
|
1490
1480
|
event.preventDefault();
|
|
1491
|
-
if (canSend) {
|
|
1481
|
+
if (canSend()) {
|
|
1492
1482
|
send();
|
|
1493
1483
|
}
|
|
1494
1484
|
}
|
|
@@ -1510,7 +1500,7 @@ var Input = ({
|
|
|
1510
1500
|
"button",
|
|
1511
1501
|
{
|
|
1512
1502
|
disabled: sendDisabled,
|
|
1513
|
-
onClick: isInProgress
|
|
1503
|
+
onClick: isInProgress ? onStop : send,
|
|
1514
1504
|
"data-copilotkit-in-progress": inProgress,
|
|
1515
1505
|
"data-test-id": inProgress ? "copilot-chat-request-in-progress" : "copilot-chat-ready",
|
|
1516
1506
|
className: "copilotKitInputControlButton",
|
|
@@ -2716,8 +2706,7 @@ function CopilotChat({
|
|
|
2716
2706
|
AssistantMessage: AssistantMessage2 = AssistantMessage,
|
|
2717
2707
|
UserMessage: UserMessage2 = UserMessage,
|
|
2718
2708
|
imageUploadsEnabled,
|
|
2719
|
-
inputFileAccept = "image/*"
|
|
2720
|
-
hideStopButton
|
|
2709
|
+
inputFileAccept = "image/*"
|
|
2721
2710
|
}) {
|
|
2722
2711
|
const { additionalInstructions, setChatInstructions } = (0, import_react_core10.useCopilotContext)();
|
|
2723
2712
|
const [selectedImages, setSelectedImages] = (0, import_react13.useState)([]);
|
|
@@ -2900,8 +2889,7 @@ function CopilotChat({
|
|
|
2900
2889
|
onUpload: imageUploadsEnabled ? () => {
|
|
2901
2890
|
var _a;
|
|
2902
2891
|
return (_a = fileInputRef.current) == null ? void 0 : _a.click();
|
|
2903
|
-
} : void 0
|
|
2904
|
-
hideStopButton
|
|
2892
|
+
} : void 0
|
|
2905
2893
|
}
|
|
2906
2894
|
)
|
|
2907
2895
|
] });
|
|
@@ -3166,10 +3154,8 @@ var CopilotModal = (_a) => {
|
|
|
3166
3154
|
onSetOpen == null ? void 0 : onSetOpen(open);
|
|
3167
3155
|
setOpenState(open);
|
|
3168
3156
|
};
|
|
3169
|
-
const memoizedHeader = (0, import_react14.useMemo)(() => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Header2, {}), [Header2]);
|
|
3170
|
-
const memoizedChildren = (0, import_react14.useMemo)(() => children, [children]);
|
|
3171
3157
|
return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(ChatContextProvider, { icons, labels, open: openState, setOpen, children: [
|
|
3172
|
-
|
|
3158
|
+
children,
|
|
3173
3159
|
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className, children: [
|
|
3174
3160
|
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Button2, {}),
|
|
3175
3161
|
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
|
|
@@ -3179,7 +3165,7 @@ var CopilotModal = (_a) => {
|
|
|
3179
3165
|
shortcut,
|
|
3180
3166
|
hitEscapeToClose,
|
|
3181
3167
|
children: [
|
|
3182
|
-
|
|
3168
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Header2, {}),
|
|
3183
3169
|
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
3184
3170
|
CopilotChat,
|
|
3185
3171
|
__spreadProps(__spreadValues({}, props), {
|