@copilotkit/react-ui 1.8.6 → 1.8.7
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 +20 -0
- package/dist/{chunk-Q2YY2NX3.mjs → chunk-24TDU7MY.mjs} +2 -2
- package/dist/{chunk-XNQO5AZZ.mjs → chunk-ABHUX6T6.mjs} +2 -2
- package/dist/{chunk-QJKMOGWN.mjs → chunk-BDNHZ3GW.mjs} +4 -3
- package/dist/chunk-BDNHZ3GW.mjs.map +1 -0
- package/dist/{chunk-NMNC4ROZ.mjs → chunk-DSQGQJI4.mjs} +2 -2
- package/dist/{chunk-HEIDCT7I.mjs → chunk-HWMFMBJC.mjs} +2 -2
- package/dist/chunk-HWMFMBJC.mjs.map +1 -0
- package/dist/{chunk-UN2E3HCK.mjs → chunk-IEMQ2SQW.mjs} +6 -4
- package/dist/chunk-IEMQ2SQW.mjs.map +1 -0
- package/dist/{chunk-ZY25LVYR.mjs → chunk-IJADIQAR.mjs} +20 -2
- package/dist/chunk-IJADIQAR.mjs.map +1 -0
- package/dist/{chunk-X6EFGEBJ.mjs → chunk-JOL7NS2W.mjs} +2 -2
- package/dist/{chunk-PCTCOQK2.mjs → chunk-KENCH7RN.mjs} +2 -2
- package/dist/{chunk-ZLRUNNS7.mjs → chunk-O34Z4XM2.mjs} +170 -30
- package/dist/chunk-O34Z4XM2.mjs.map +1 -0
- package/dist/{chunk-5M7ODWKH.mjs → chunk-OZXUB3V7.mjs} +3 -3
- package/dist/chunk-PLHTVHUW.mjs +82 -0
- package/dist/chunk-PLHTVHUW.mjs.map +1 -0
- package/dist/{chunk-62QMTKMJ.mjs → chunk-POWCBXRY.mjs} +3 -3
- package/dist/chunk-PXEVB7IK.mjs +1 -0
- package/dist/{chunk-HIORSNVD.mjs → chunk-Q2NFQTCQ.mjs} +2 -2
- package/dist/chunk-SLTG4L62.mjs +78 -0
- package/dist/chunk-SLTG4L62.mjs.map +1 -0
- package/dist/{chunk-SMJ3QQCE.mjs → chunk-T7N77F5Y.mjs} +2 -2
- package/dist/{chunk-YOEL33HG.mjs → chunk-UFN2VWSR.mjs} +2 -2
- package/dist/{chunk-2OTVZXDX.mjs → chunk-UH2UFL5W.mjs} +3 -3
- package/dist/{chunk-D5XIJNXQ.mjs → chunk-VGPQYMKJ.mjs} +8 -8
- package/dist/{chunk-WNC6OCIB.mjs → chunk-XFCMZH2H.mjs} +2 -2
- package/dist/{chunk-ORSMX3SE.mjs → chunk-XWG3L6QC.mjs} +15 -1
- package/dist/{chunk-ORSMX3SE.mjs.map → chunk-XWG3L6QC.mjs.map} +1 -1
- package/dist/{chunk-TOQ7P4DO.mjs → chunk-XZNY26GH.mjs} +2 -2
- package/dist/{chunk-GOAED4H6.mjs → chunk-Y7UO3RPW.mjs} +10 -10
- package/dist/components/chat/Button.js.map +1 -1
- package/dist/components/chat/Button.mjs +3 -3
- package/dist/components/chat/Chat.d.ts +23 -3
- package/dist/components/chat/Chat.js +341 -30
- package/dist/components/chat/Chat.js.map +1 -1
- package/dist/components/chat/Chat.mjs +16 -14
- package/dist/components/chat/ChatContext.d.ts +5 -0
- package/dist/components/chat/ChatContext.js +15 -1
- package/dist/components/chat/ChatContext.js.map +1 -1
- package/dist/components/chat/ChatContext.mjs +2 -2
- package/dist/components/chat/CodeBlock.js.map +1 -1
- package/dist/components/chat/CodeBlock.mjs +2 -2
- package/dist/components/chat/Header.js.map +1 -1
- package/dist/components/chat/Header.mjs +5 -5
- package/dist/components/chat/Icons.d.ts +2 -1
- package/dist/components/chat/Icons.js +17 -2
- package/dist/components/chat/Icons.js.map +1 -1
- package/dist/components/chat/Icons.mjs +5 -3
- package/dist/components/chat/ImageUploadQueue.d.ts +13 -0
- package/dist/components/chat/ImageUploadQueue.js +106 -0
- package/dist/components/chat/ImageUploadQueue.js.map +1 -0
- package/dist/components/chat/ImageUploadQueue.mjs +8 -0
- package/dist/components/chat/ImageUploadQueue.mjs.map +1 -0
- package/dist/components/chat/Input.d.ts +1 -1
- package/dist/components/chat/Input.js +2 -1
- package/dist/components/chat/Input.js.map +1 -1
- package/dist/components/chat/Input.mjs +3 -3
- package/dist/components/chat/Markdown.js.map +1 -1
- package/dist/components/chat/Markdown.mjs +3 -3
- package/dist/components/chat/Messages.d.ts +1 -1
- package/dist/components/chat/Messages.js +18 -0
- package/dist/components/chat/Messages.js.map +1 -1
- package/dist/components/chat/Messages.mjs +3 -3
- package/dist/components/chat/Modal.js +348 -37
- package/dist/components/chat/Modal.js.map +1 -1
- package/dist/components/chat/Modal.mjs +22 -20
- package/dist/components/chat/Popup.js +350 -39
- package/dist/components/chat/Popup.js.map +1 -1
- package/dist/components/chat/Popup.mjs +23 -21
- package/dist/components/chat/Sidebar.js +350 -39
- package/dist/components/chat/Sidebar.js.map +1 -1
- package/dist/components/chat/Sidebar.mjs +23 -21
- package/dist/components/chat/Suggestion.js.map +1 -1
- package/dist/components/chat/Suggestion.mjs +2 -2
- package/dist/components/chat/Window.js.map +1 -1
- package/dist/components/chat/Window.mjs +3 -3
- package/dist/components/chat/index.d.ts +1 -0
- package/dist/components/chat/index.js +354 -41
- package/dist/components/chat/index.js.map +1 -1
- package/dist/components/chat/index.mjs +30 -25
- package/dist/components/chat/messages/AssistantMessage.js.map +1 -1
- package/dist/components/chat/messages/AssistantMessage.mjs +5 -5
- package/dist/components/chat/messages/RenderActionExecutionMessage.js.map +1 -1
- package/dist/components/chat/messages/RenderActionExecutionMessage.mjs +6 -6
- package/dist/components/chat/messages/RenderAgentStateMessage.js.map +1 -1
- package/dist/components/chat/messages/RenderAgentStateMessage.mjs +6 -6
- package/dist/components/chat/messages/RenderImageMessage.d.ts +7 -0
- package/dist/components/chat/messages/RenderImageMessage.js +774 -0
- package/dist/components/chat/messages/RenderImageMessage.js.map +1 -0
- package/dist/components/chat/messages/RenderImageMessage.mjs +15 -0
- package/dist/components/chat/messages/RenderImageMessage.mjs.map +1 -0
- package/dist/components/chat/messages/RenderResultMessage.js.map +1 -1
- package/dist/components/chat/messages/RenderResultMessage.mjs +6 -6
- package/dist/components/chat/messages/RenderTextMessage.js +1 -1
- package/dist/components/chat/messages/RenderTextMessage.js.map +1 -1
- package/dist/components/chat/messages/RenderTextMessage.mjs +7 -7
- package/dist/components/chat/messages/UserMessage.js +1 -1
- package/dist/components/chat/messages/UserMessage.js.map +1 -1
- package/dist/components/chat/messages/UserMessage.mjs +1 -1
- package/dist/components/chat/props.d.ts +3 -0
- package/dist/components/chat/props.js.map +1 -1
- package/dist/components/dev-console/console.js.map +1 -1
- package/dist/components/dev-console/console.mjs +3 -3
- package/dist/components/dev-console/index.js.map +1 -1
- package/dist/components/dev-console/index.mjs +3 -3
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.js +354 -41
- package/dist/components/index.js.map +1 -1
- package/dist/components/index.mjs +30 -25
- package/dist/index.d.ts +1 -0
- package/dist/index.js +354 -41
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +30 -25
- package/package.json +6 -6
- package/src/components/chat/Chat.tsx +198 -18
- package/src/components/chat/ChatContext.tsx +7 -0
- package/src/components/chat/Icons.tsx +14 -0
- package/src/components/chat/ImageUploadQueue.tsx +77 -0
- package/src/components/chat/Input.tsx +8 -1
- package/src/components/chat/Messages.tsx +17 -0
- package/src/components/chat/index.tsx +1 -0
- package/src/components/chat/messages/RenderImageMessage.tsx +64 -0
- package/src/components/chat/messages/UserMessage.tsx +5 -1
- package/src/components/chat/props.ts +3 -0
- package/dist/chunk-HEIDCT7I.mjs.map +0 -1
- package/dist/chunk-QJKMOGWN.mjs.map +0 -1
- package/dist/chunk-SQMEPWVT.mjs +0 -1
- package/dist/chunk-UN2E3HCK.mjs.map +0 -1
- package/dist/chunk-ZLRUNNS7.mjs.map +0 -1
- package/dist/chunk-ZY25LVYR.mjs.map +0 -1
- /package/dist/{chunk-Q2YY2NX3.mjs.map → chunk-24TDU7MY.mjs.map} +0 -0
- /package/dist/{chunk-XNQO5AZZ.mjs.map → chunk-ABHUX6T6.mjs.map} +0 -0
- /package/dist/{chunk-NMNC4ROZ.mjs.map → chunk-DSQGQJI4.mjs.map} +0 -0
- /package/dist/{chunk-X6EFGEBJ.mjs.map → chunk-JOL7NS2W.mjs.map} +0 -0
- /package/dist/{chunk-PCTCOQK2.mjs.map → chunk-KENCH7RN.mjs.map} +0 -0
- /package/dist/{chunk-5M7ODWKH.mjs.map → chunk-OZXUB3V7.mjs.map} +0 -0
- /package/dist/{chunk-62QMTKMJ.mjs.map → chunk-POWCBXRY.mjs.map} +0 -0
- /package/dist/{chunk-SQMEPWVT.mjs.map → chunk-PXEVB7IK.mjs.map} +0 -0
- /package/dist/{chunk-HIORSNVD.mjs.map → chunk-Q2NFQTCQ.mjs.map} +0 -0
- /package/dist/{chunk-SMJ3QQCE.mjs.map → chunk-T7N77F5Y.mjs.map} +0 -0
- /package/dist/{chunk-YOEL33HG.mjs.map → chunk-UFN2VWSR.mjs.map} +0 -0
- /package/dist/{chunk-2OTVZXDX.mjs.map → chunk-UH2UFL5W.mjs.map} +0 -0
- /package/dist/{chunk-D5XIJNXQ.mjs.map → chunk-VGPQYMKJ.mjs.map} +0 -0
- /package/dist/{chunk-WNC6OCIB.mjs.map → chunk-XFCMZH2H.mjs.map} +0 -0
- /package/dist/{chunk-TOQ7P4DO.mjs.map → chunk-XZNY26GH.mjs.map} +0 -0
- /package/dist/{chunk-GOAED4H6.mjs.map → chunk-Y7UO3RPW.mjs.map} +0 -0
|
@@ -1,32 +1,34 @@
|
|
|
1
1
|
import {
|
|
2
2
|
CopilotPopup
|
|
3
|
-
} from "../../chunk-
|
|
4
|
-
import "../../chunk-
|
|
5
|
-
import "../../chunk-
|
|
6
|
-
import "../../chunk-
|
|
3
|
+
} from "../../chunk-T7N77F5Y.mjs";
|
|
4
|
+
import "../../chunk-Y7UO3RPW.mjs";
|
|
5
|
+
import "../../chunk-Q2NFQTCQ.mjs";
|
|
6
|
+
import "../../chunk-UH2UFL5W.mjs";
|
|
7
7
|
import "../../chunk-V7W6IM2V.mjs";
|
|
8
|
-
import "../../chunk-
|
|
8
|
+
import "../../chunk-VGPQYMKJ.mjs";
|
|
9
|
+
import "../../chunk-Q5V6S67N.mjs";
|
|
9
10
|
import "../../chunk-6TCUJ3B7.mjs";
|
|
10
11
|
import "../../chunk-KXE2JCUH.mjs";
|
|
11
12
|
import "../../chunk-NRA3CFEE.mjs";
|
|
12
13
|
import "../../chunk-BH6PCAAL.mjs";
|
|
13
|
-
import "../../chunk-
|
|
14
|
-
import "../../chunk-
|
|
15
|
-
import "../../chunk-
|
|
16
|
-
import "../../chunk-
|
|
17
|
-
import "../../chunk-
|
|
18
|
-
import "../../chunk-
|
|
19
|
-
import "../../chunk-
|
|
20
|
-
import "../../chunk-
|
|
21
|
-
import "../../chunk-
|
|
22
|
-
import "../../chunk-
|
|
23
|
-
import "../../chunk-
|
|
14
|
+
import "../../chunk-UFN2VWSR.mjs";
|
|
15
|
+
import "../../chunk-O34Z4XM2.mjs";
|
|
16
|
+
import "../../chunk-DSQGQJI4.mjs";
|
|
17
|
+
import "../../chunk-24TDU7MY.mjs";
|
|
18
|
+
import "../../chunk-SLTG4L62.mjs";
|
|
19
|
+
import "../../chunk-XFCMZH2H.mjs";
|
|
20
|
+
import "../../chunk-POWCBXRY.mjs";
|
|
21
|
+
import "../../chunk-HWMFMBJC.mjs";
|
|
22
|
+
import "../../chunk-OZXUB3V7.mjs";
|
|
23
|
+
import "../../chunk-XZNY26GH.mjs";
|
|
24
|
+
import "../../chunk-PLHTVHUW.mjs";
|
|
25
|
+
import "../../chunk-BDNHZ3GW.mjs";
|
|
24
26
|
import "../../chunk-YQFVRDNC.mjs";
|
|
25
|
-
import "../../chunk-
|
|
26
|
-
import "../../chunk-
|
|
27
|
-
import "../../chunk-
|
|
28
|
-
import "../../chunk-
|
|
29
|
-
import "../../chunk-
|
|
27
|
+
import "../../chunk-ABHUX6T6.mjs";
|
|
28
|
+
import "../../chunk-KENCH7RN.mjs";
|
|
29
|
+
import "../../chunk-IJADIQAR.mjs";
|
|
30
|
+
import "../../chunk-IEMQ2SQW.mjs";
|
|
31
|
+
import "../../chunk-XWG3L6QC.mjs";
|
|
30
32
|
import "../../chunk-54JAUBUJ.mjs";
|
|
31
33
|
import "../../chunk-JGMFJZMG.mjs";
|
|
32
34
|
import "../../chunk-S5MBUNGN.mjs";
|
|
@@ -301,6 +301,19 @@ var DownloadIcon = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
|
301
301
|
)
|
|
302
302
|
}
|
|
303
303
|
);
|
|
304
|
+
var UploadIcon = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
305
|
+
"svg",
|
|
306
|
+
{
|
|
307
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
308
|
+
fill: "none",
|
|
309
|
+
viewBox: "0 0 24 24",
|
|
310
|
+
strokeWidth: "1.5",
|
|
311
|
+
stroke: "currentColor",
|
|
312
|
+
width: "24",
|
|
313
|
+
height: "24",
|
|
314
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 4.5v15m7.5-7.5h-15" })
|
|
315
|
+
}
|
|
316
|
+
);
|
|
304
317
|
var CheckIcon = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
305
318
|
"svg",
|
|
306
319
|
{
|
|
@@ -366,7 +379,8 @@ var ChatContextProvider = ({
|
|
|
366
379
|
pushToTalkIcon: MicrophoneIcon,
|
|
367
380
|
copyIcon: CopyIcon,
|
|
368
381
|
thumbsUpIcon: ThumbsUpIcon,
|
|
369
|
-
thumbsDownIcon: ThumbsDownIcon
|
|
382
|
+
thumbsDownIcon: ThumbsDownIcon,
|
|
383
|
+
uploadIcon: UploadIcon
|
|
370
384
|
}), icons),
|
|
371
385
|
[icons]
|
|
372
386
|
);
|
|
@@ -1071,6 +1085,7 @@ var Messages = ({
|
|
|
1071
1085
|
RenderActionExecutionMessage: RenderActionExecutionMessage2,
|
|
1072
1086
|
RenderAgentStateMessage: RenderAgentStateMessage2,
|
|
1073
1087
|
RenderResultMessage: RenderResultMessage2,
|
|
1088
|
+
RenderImageMessage: RenderImageMessage2,
|
|
1074
1089
|
AssistantMessage: AssistantMessage2,
|
|
1075
1090
|
UserMessage: UserMessage2,
|
|
1076
1091
|
onRegenerate,
|
|
@@ -1159,6 +1174,23 @@ var Messages = ({
|
|
|
1159
1174
|
},
|
|
1160
1175
|
index
|
|
1161
1176
|
);
|
|
1177
|
+
} else if (message.isImageMessage && message.isImageMessage()) {
|
|
1178
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1179
|
+
RenderImageMessage2,
|
|
1180
|
+
{
|
|
1181
|
+
message,
|
|
1182
|
+
inProgress,
|
|
1183
|
+
index,
|
|
1184
|
+
isCurrentMessage,
|
|
1185
|
+
AssistantMessage: AssistantMessage2,
|
|
1186
|
+
UserMessage: UserMessage2,
|
|
1187
|
+
onRegenerate,
|
|
1188
|
+
onCopy,
|
|
1189
|
+
onThumbsUp,
|
|
1190
|
+
onThumbsDown
|
|
1191
|
+
},
|
|
1192
|
+
index
|
|
1193
|
+
);
|
|
1162
1194
|
}
|
|
1163
1195
|
}),
|
|
1164
1196
|
interrupt
|
|
@@ -1401,7 +1433,7 @@ var usePushToTalk = ({
|
|
|
1401
1433
|
// src/components/chat/Input.tsx
|
|
1402
1434
|
var import_react_core6 = require("@copilotkit/react-core");
|
|
1403
1435
|
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
1404
|
-
var Input = ({ inProgress, onSend, isVisible = false, onStop }) => {
|
|
1436
|
+
var Input = ({ inProgress, onSend, isVisible = false, onStop, onUpload }) => {
|
|
1405
1437
|
const context = useChatContext();
|
|
1406
1438
|
const copilotContext = (0, import_react_core6.useCopilotContext)();
|
|
1407
1439
|
const pushToTalkConfigured = copilotContext.copilotApiConfig.textToSpeechUrl !== void 0 && copilotContext.copilotApiConfig.transcribeAudioUrl !== void 0;
|
|
@@ -1465,6 +1497,7 @@ var Input = ({ inProgress, onSend, isVisible = false, onStop }) => {
|
|
|
1465
1497
|
}
|
|
1466
1498
|
),
|
|
1467
1499
|
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "copilotKitInputControls", children: [
|
|
1500
|
+
onUpload && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("button", { onClick: onUpload, className: "copilotKitInputControlButton", children: context.icons.uploadIcon }),
|
|
1468
1501
|
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { style: { flexGrow: 1 } }),
|
|
1469
1502
|
showPushToTalk && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1470
1503
|
"button",
|
|
@@ -1492,7 +1525,7 @@ var Input = ({ inProgress, onSend, isVisible = false, onStop }) => {
|
|
|
1492
1525
|
// src/components/chat/messages/UserMessage.tsx
|
|
1493
1526
|
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
1494
1527
|
var UserMessage = (props) => {
|
|
1495
|
-
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "copilotKitMessage copilotKitUserMessage", children: props.message });
|
|
1528
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "copilotKitMessage copilotKitUserMessage", children: props.subComponent || props.message });
|
|
1496
1529
|
};
|
|
1497
1530
|
|
|
1498
1531
|
// src/components/chat/Markdown.tsx
|
|
@@ -2346,13 +2379,77 @@ function RenderAgentStateMessage(_a) {
|
|
|
2346
2379
|
}
|
|
2347
2380
|
}
|
|
2348
2381
|
|
|
2382
|
+
// src/components/chat/messages/RenderImageMessage.tsx
|
|
2383
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
2384
|
+
function RenderImageMessage(_a) {
|
|
2385
|
+
var _b = _a, {
|
|
2386
|
+
UserMessage: UserMessage2 = UserMessage,
|
|
2387
|
+
AssistantMessage: AssistantMessage2 = AssistantMessage
|
|
2388
|
+
} = _b, props = __objRest(_b, [
|
|
2389
|
+
"UserMessage",
|
|
2390
|
+
"AssistantMessage"
|
|
2391
|
+
]);
|
|
2392
|
+
const {
|
|
2393
|
+
message,
|
|
2394
|
+
inProgress,
|
|
2395
|
+
index,
|
|
2396
|
+
isCurrentMessage,
|
|
2397
|
+
onRegenerate,
|
|
2398
|
+
onCopy,
|
|
2399
|
+
onThumbsUp,
|
|
2400
|
+
onThumbsDown
|
|
2401
|
+
} = props;
|
|
2402
|
+
if (message.isImageMessage()) {
|
|
2403
|
+
const imageData = `data:${message.format};base64,${message.bytes}`;
|
|
2404
|
+
const imageComponent = /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "copilotKitImage", children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
2405
|
+
"img",
|
|
2406
|
+
{
|
|
2407
|
+
src: imageData,
|
|
2408
|
+
alt: "User uploaded image",
|
|
2409
|
+
style: { maxWidth: "100%", maxHeight: "300px", borderRadius: "8px" }
|
|
2410
|
+
}
|
|
2411
|
+
) });
|
|
2412
|
+
if (message.role === "user") {
|
|
2413
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
2414
|
+
UserMessage2,
|
|
2415
|
+
{
|
|
2416
|
+
"data-message-role": "user",
|
|
2417
|
+
message: "",
|
|
2418
|
+
rawData: message,
|
|
2419
|
+
subComponent: imageComponent
|
|
2420
|
+
},
|
|
2421
|
+
index
|
|
2422
|
+
);
|
|
2423
|
+
} else if (message.role === "assistant") {
|
|
2424
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
2425
|
+
AssistantMessage2,
|
|
2426
|
+
{
|
|
2427
|
+
"data-message-role": "assistant",
|
|
2428
|
+
message: "",
|
|
2429
|
+
rawData: message,
|
|
2430
|
+
subComponent: imageComponent,
|
|
2431
|
+
isLoading: inProgress && isCurrentMessage && !message.bytes,
|
|
2432
|
+
isGenerating: inProgress && isCurrentMessage && !!message.bytes,
|
|
2433
|
+
isCurrentMessage,
|
|
2434
|
+
onRegenerate: () => onRegenerate == null ? void 0 : onRegenerate(message.id),
|
|
2435
|
+
onCopy,
|
|
2436
|
+
onThumbsUp,
|
|
2437
|
+
onThumbsDown
|
|
2438
|
+
},
|
|
2439
|
+
index
|
|
2440
|
+
);
|
|
2441
|
+
}
|
|
2442
|
+
}
|
|
2443
|
+
return null;
|
|
2444
|
+
}
|
|
2445
|
+
|
|
2349
2446
|
// src/components/chat/Suggestion.tsx
|
|
2350
2447
|
var import_react_core9 = require("@copilotkit/react-core");
|
|
2351
2448
|
var import_shared2 = require("@copilotkit/shared");
|
|
2352
2449
|
var import_runtime_client_gql3 = require("@copilotkit/runtime-client-gql");
|
|
2353
|
-
var
|
|
2450
|
+
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
2354
2451
|
function Suggestion({ title, message, onClick, partial, className }) {
|
|
2355
|
-
return /* @__PURE__ */ (0,
|
|
2452
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
2356
2453
|
"button",
|
|
2357
2454
|
{
|
|
2358
2455
|
disabled: partial,
|
|
@@ -2362,7 +2459,7 @@ function Suggestion({ title, message, onClick, partial, className }) {
|
|
|
2362
2459
|
},
|
|
2363
2460
|
className: className || (partial ? "suggestion loading" : "suggestion"),
|
|
2364
2461
|
"data-test-id": "suggestion",
|
|
2365
|
-
children: partial ? SmallSpinnerIcon : /* @__PURE__ */ (0,
|
|
2462
|
+
children: partial ? SmallSpinnerIcon : /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { children: title })
|
|
2366
2463
|
}
|
|
2367
2464
|
);
|
|
2368
2465
|
}
|
|
@@ -2442,7 +2539,87 @@ var import_react_core10 = require("@copilotkit/react-core");
|
|
|
2442
2539
|
var import_runtime_client_gql4 = require("@copilotkit/runtime-client-gql");
|
|
2443
2540
|
var import_shared3 = require("@copilotkit/shared");
|
|
2444
2541
|
var import_react_core11 = require("@copilotkit/react-core");
|
|
2445
|
-
|
|
2542
|
+
|
|
2543
|
+
// src/components/chat/ImageUploadQueue.tsx
|
|
2544
|
+
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
2545
|
+
var ImageUploadQueue = ({
|
|
2546
|
+
images,
|
|
2547
|
+
onRemoveImage,
|
|
2548
|
+
className = ""
|
|
2549
|
+
}) => {
|
|
2550
|
+
if (images.length === 0)
|
|
2551
|
+
return null;
|
|
2552
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
2553
|
+
"div",
|
|
2554
|
+
{
|
|
2555
|
+
className: `copilotKitImageUploadQueue ${className}`,
|
|
2556
|
+
style: {
|
|
2557
|
+
display: "flex",
|
|
2558
|
+
flexWrap: "wrap",
|
|
2559
|
+
gap: "8px",
|
|
2560
|
+
margin: "8px",
|
|
2561
|
+
padding: "8px"
|
|
2562
|
+
},
|
|
2563
|
+
children: images.map((image, index) => /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
|
2564
|
+
"div",
|
|
2565
|
+
{
|
|
2566
|
+
className: "copilotKitImageUploadQueueItem",
|
|
2567
|
+
style: {
|
|
2568
|
+
position: "relative",
|
|
2569
|
+
display: "inline-block",
|
|
2570
|
+
width: "60px",
|
|
2571
|
+
height: "60px",
|
|
2572
|
+
borderRadius: "4px",
|
|
2573
|
+
overflow: "hidden"
|
|
2574
|
+
},
|
|
2575
|
+
children: [
|
|
2576
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
2577
|
+
"img",
|
|
2578
|
+
{
|
|
2579
|
+
src: `data:${image.contentType};base64,${image.bytes}`,
|
|
2580
|
+
alt: `Selected image ${index + 1}`,
|
|
2581
|
+
style: {
|
|
2582
|
+
width: "100%",
|
|
2583
|
+
height: "100%",
|
|
2584
|
+
objectFit: "cover"
|
|
2585
|
+
}
|
|
2586
|
+
}
|
|
2587
|
+
),
|
|
2588
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
2589
|
+
"button",
|
|
2590
|
+
{
|
|
2591
|
+
onClick: () => onRemoveImage(index),
|
|
2592
|
+
className: "copilotKitImageUploadQueueRemoveButton",
|
|
2593
|
+
style: {
|
|
2594
|
+
position: "absolute",
|
|
2595
|
+
top: "2px",
|
|
2596
|
+
right: "2px",
|
|
2597
|
+
background: "rgba(0,0,0,0.6)",
|
|
2598
|
+
color: "white",
|
|
2599
|
+
border: "none",
|
|
2600
|
+
borderRadius: "50%",
|
|
2601
|
+
width: "18px",
|
|
2602
|
+
height: "18px",
|
|
2603
|
+
display: "flex",
|
|
2604
|
+
alignItems: "center",
|
|
2605
|
+
justifyContent: "center",
|
|
2606
|
+
cursor: "pointer",
|
|
2607
|
+
fontSize: "10px",
|
|
2608
|
+
padding: 0
|
|
2609
|
+
},
|
|
2610
|
+
children: "\u2715"
|
|
2611
|
+
}
|
|
2612
|
+
)
|
|
2613
|
+
]
|
|
2614
|
+
},
|
|
2615
|
+
index
|
|
2616
|
+
))
|
|
2617
|
+
}
|
|
2618
|
+
);
|
|
2619
|
+
};
|
|
2620
|
+
|
|
2621
|
+
// src/components/chat/Chat.tsx
|
|
2622
|
+
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
2446
2623
|
function CopilotChat({
|
|
2447
2624
|
instructions,
|
|
2448
2625
|
onSubmitMessage,
|
|
@@ -2459,14 +2636,64 @@ function CopilotChat({
|
|
|
2459
2636
|
RenderActionExecutionMessage: RenderActionExecutionMessage2 = RenderActionExecutionMessage,
|
|
2460
2637
|
RenderAgentStateMessage: RenderAgentStateMessage2 = RenderAgentStateMessage,
|
|
2461
2638
|
RenderResultMessage: RenderResultMessage2 = RenderResultMessage,
|
|
2639
|
+
RenderImageMessage: RenderImageMessage2 = RenderImageMessage,
|
|
2462
2640
|
Input: Input2 = Input,
|
|
2463
2641
|
className,
|
|
2464
2642
|
icons,
|
|
2465
2643
|
labels,
|
|
2466
2644
|
AssistantMessage: AssistantMessage2 = AssistantMessage,
|
|
2467
|
-
UserMessage: UserMessage2 = UserMessage
|
|
2645
|
+
UserMessage: UserMessage2 = UserMessage,
|
|
2646
|
+
imageUploadsEnabled,
|
|
2647
|
+
inputFileAccept = "image/*"
|
|
2468
2648
|
}) {
|
|
2469
2649
|
const { additionalInstructions, setChatInstructions } = (0, import_react_core10.useCopilotContext)();
|
|
2650
|
+
const [selectedImages, setSelectedImages] = (0, import_react13.useState)([]);
|
|
2651
|
+
const fileInputRef = (0, import_react13.useRef)(null);
|
|
2652
|
+
(0, import_react13.useEffect)(() => {
|
|
2653
|
+
if (!imageUploadsEnabled)
|
|
2654
|
+
return;
|
|
2655
|
+
const handlePaste = (e) => __async(this, null, function* () {
|
|
2656
|
+
var _a, _b;
|
|
2657
|
+
const target = e.target;
|
|
2658
|
+
if (!((_a = target.parentElement) == null ? void 0 : _a.classList.contains("copilotKitInput")))
|
|
2659
|
+
return;
|
|
2660
|
+
const items = Array.from(((_b = e.clipboardData) == null ? void 0 : _b.items) || []);
|
|
2661
|
+
const imageItems = items.filter((item) => item.type.startsWith("image/"));
|
|
2662
|
+
if (imageItems.length === 0)
|
|
2663
|
+
return;
|
|
2664
|
+
e.preventDefault();
|
|
2665
|
+
const imagePromises = imageItems.map((item) => {
|
|
2666
|
+
const file = item.getAsFile();
|
|
2667
|
+
if (!file)
|
|
2668
|
+
return Promise.resolve(null);
|
|
2669
|
+
return new Promise((resolve, reject) => {
|
|
2670
|
+
const reader = new FileReader();
|
|
2671
|
+
reader.onload = (e2) => {
|
|
2672
|
+
var _a2, _b2;
|
|
2673
|
+
const base64String = (_b2 = (_a2 = e2.target) == null ? void 0 : _a2.result) == null ? void 0 : _b2.split(",")[1];
|
|
2674
|
+
if (base64String) {
|
|
2675
|
+
resolve({
|
|
2676
|
+
contentType: file.type,
|
|
2677
|
+
bytes: base64String
|
|
2678
|
+
});
|
|
2679
|
+
} else {
|
|
2680
|
+
resolve(null);
|
|
2681
|
+
}
|
|
2682
|
+
};
|
|
2683
|
+
reader.onerror = reject;
|
|
2684
|
+
reader.readAsDataURL(file);
|
|
2685
|
+
});
|
|
2686
|
+
});
|
|
2687
|
+
try {
|
|
2688
|
+
const loadedImages = (yield Promise.all(imagePromises)).filter((img) => img !== null);
|
|
2689
|
+
setSelectedImages((prev) => [...prev, ...loadedImages]);
|
|
2690
|
+
} catch (error) {
|
|
2691
|
+
console.error("Error processing pasted images:", error);
|
|
2692
|
+
}
|
|
2693
|
+
});
|
|
2694
|
+
document.addEventListener("paste", handlePaste);
|
|
2695
|
+
return () => document.removeEventListener("paste", handlePaste);
|
|
2696
|
+
}, [imageUploadsEnabled]);
|
|
2470
2697
|
(0, import_react13.useEffect)(() => {
|
|
2471
2698
|
if (!(additionalInstructions == null ? void 0 : additionalInstructions.length)) {
|
|
2472
2699
|
setChatInstructions(instructions || "");
|
|
@@ -2494,6 +2721,14 @@ function CopilotChat({
|
|
|
2494
2721
|
onStopGeneration,
|
|
2495
2722
|
onReloadMessages
|
|
2496
2723
|
);
|
|
2724
|
+
const handleSendMessage = (text) => {
|
|
2725
|
+
const images = selectedImages;
|
|
2726
|
+
setSelectedImages([]);
|
|
2727
|
+
if (fileInputRef.current) {
|
|
2728
|
+
fileInputRef.current.value = "";
|
|
2729
|
+
}
|
|
2730
|
+
return sendMessage(text, images);
|
|
2731
|
+
};
|
|
2497
2732
|
const chatContext = import_react13.default.useContext(ChatContext);
|
|
2498
2733
|
const isVisible = chatContext ? chatContext.open : true;
|
|
2499
2734
|
const handleRegenerate = (messageId) => {
|
|
@@ -2507,8 +2742,42 @@ function CopilotChat({
|
|
|
2507
2742
|
onCopy(message);
|
|
2508
2743
|
}
|
|
2509
2744
|
};
|
|
2510
|
-
|
|
2511
|
-
|
|
2745
|
+
const handleImageUpload = (event) => __async(this, null, function* () {
|
|
2746
|
+
if (!event.target.files || event.target.files.length === 0) {
|
|
2747
|
+
return;
|
|
2748
|
+
}
|
|
2749
|
+
const files = Array.from(event.target.files).filter((file) => file.type.startsWith("image/"));
|
|
2750
|
+
if (files.length === 0)
|
|
2751
|
+
return;
|
|
2752
|
+
const fileReadPromises = files.map((file) => {
|
|
2753
|
+
return new Promise((resolve, reject) => {
|
|
2754
|
+
const reader = new FileReader();
|
|
2755
|
+
reader.onload = (e) => {
|
|
2756
|
+
var _a, _b;
|
|
2757
|
+
const base64String = ((_b = (_a = e.target) == null ? void 0 : _a.result) == null ? void 0 : _b.split(",")[1]) || "";
|
|
2758
|
+
if (base64String) {
|
|
2759
|
+
resolve({
|
|
2760
|
+
contentType: file.type,
|
|
2761
|
+
bytes: base64String
|
|
2762
|
+
});
|
|
2763
|
+
}
|
|
2764
|
+
};
|
|
2765
|
+
reader.onerror = reject;
|
|
2766
|
+
reader.readAsDataURL(file);
|
|
2767
|
+
});
|
|
2768
|
+
});
|
|
2769
|
+
try {
|
|
2770
|
+
const loadedImages = yield Promise.all(fileReadPromises);
|
|
2771
|
+
setSelectedImages((prev) => [...prev, ...loadedImages]);
|
|
2772
|
+
} catch (error) {
|
|
2773
|
+
console.error("Error reading files:", error);
|
|
2774
|
+
}
|
|
2775
|
+
});
|
|
2776
|
+
const removeSelectedImage = (index) => {
|
|
2777
|
+
setSelectedImages((prev) => prev.filter((_, i) => i !== index));
|
|
2778
|
+
};
|
|
2779
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(WrappedCopilotChat, { icons, labels, className, children: [
|
|
2780
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
2512
2781
|
Messages2,
|
|
2513
2782
|
{
|
|
2514
2783
|
AssistantMessage: AssistantMessage2,
|
|
@@ -2517,32 +2786,51 @@ function CopilotChat({
|
|
|
2517
2786
|
RenderActionExecutionMessage: RenderActionExecutionMessage2,
|
|
2518
2787
|
RenderAgentStateMessage: RenderAgentStateMessage2,
|
|
2519
2788
|
RenderResultMessage: RenderResultMessage2,
|
|
2789
|
+
RenderImageMessage: RenderImageMessage2,
|
|
2520
2790
|
messages: visibleMessages,
|
|
2521
2791
|
inProgress: isLoading,
|
|
2522
2792
|
onRegenerate: handleRegenerate,
|
|
2523
2793
|
onCopy: handleCopy,
|
|
2524
2794
|
onThumbsUp,
|
|
2525
2795
|
onThumbsDown,
|
|
2526
|
-
children: currentSuggestions.length > 0 && /* @__PURE__ */ (0,
|
|
2796
|
+
children: currentSuggestions.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "suggestions", children: currentSuggestions.map((suggestion, index) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
2527
2797
|
Suggestion,
|
|
2528
2798
|
{
|
|
2529
2799
|
title: suggestion.title,
|
|
2530
2800
|
message: suggestion.message,
|
|
2531
2801
|
partial: suggestion.partial,
|
|
2532
2802
|
className: suggestion.className,
|
|
2533
|
-
onClick: (message) =>
|
|
2803
|
+
onClick: (message) => handleSendMessage(message)
|
|
2534
2804
|
},
|
|
2535
2805
|
index
|
|
2536
2806
|
)) })
|
|
2537
2807
|
}
|
|
2538
2808
|
),
|
|
2539
|
-
/* @__PURE__ */ (0,
|
|
2809
|
+
imageUploadsEnabled && /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(import_jsx_runtime24.Fragment, { children: [
|
|
2810
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(ImageUploadQueue, { images: selectedImages, onRemoveImage: removeSelectedImage }),
|
|
2811
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
2812
|
+
"input",
|
|
2813
|
+
{
|
|
2814
|
+
type: "file",
|
|
2815
|
+
multiple: true,
|
|
2816
|
+
ref: fileInputRef,
|
|
2817
|
+
onChange: handleImageUpload,
|
|
2818
|
+
accept: inputFileAccept,
|
|
2819
|
+
style: { display: "none" }
|
|
2820
|
+
}
|
|
2821
|
+
)
|
|
2822
|
+
] }),
|
|
2823
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
2540
2824
|
Input2,
|
|
2541
2825
|
{
|
|
2542
2826
|
inProgress: isLoading,
|
|
2543
|
-
onSend:
|
|
2827
|
+
onSend: handleSendMessage,
|
|
2544
2828
|
isVisible,
|
|
2545
|
-
onStop: stopGeneration
|
|
2829
|
+
onStop: stopGeneration,
|
|
2830
|
+
onUpload: imageUploadsEnabled ? () => {
|
|
2831
|
+
var _a;
|
|
2832
|
+
return (_a = fileInputRef.current) == null ? void 0 : _a.click();
|
|
2833
|
+
} : void 0
|
|
2546
2834
|
}
|
|
2547
2835
|
)
|
|
2548
2836
|
] });
|
|
@@ -2555,10 +2843,10 @@ function WrappedCopilotChat({
|
|
|
2555
2843
|
}) {
|
|
2556
2844
|
const chatContext = import_react13.default.useContext(ChatContext);
|
|
2557
2845
|
if (!chatContext) {
|
|
2558
|
-
return /* @__PURE__ */ (0,
|
|
2559
|
-
}, children: /* @__PURE__ */ (0,
|
|
2846
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(ChatContextProvider, { icons, labels, open: true, setOpen: () => {
|
|
2847
|
+
}, children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: `copilotKitChat ${className}`, children }) });
|
|
2560
2848
|
}
|
|
2561
|
-
return /* @__PURE__ */ (0,
|
|
2849
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_jsx_runtime24.Fragment, { children });
|
|
2562
2850
|
}
|
|
2563
2851
|
var SUGGESTIONS_DEBOUNCE_TIMEOUT = 1e3;
|
|
2564
2852
|
var useCopilotChatLogic = (makeSystemMessage, onInProgress, onSubmitMessage, onStopGeneration, onReloadMessages) => {
|
|
@@ -2612,22 +2900,45 @@ var useCopilotChatLogic = (makeSystemMessage, onInProgress, onSubmitMessage, onS
|
|
|
2612
2900
|
// global context
|
|
2613
2901
|
visibleMessages.length == 0
|
|
2614
2902
|
]);
|
|
2615
|
-
const sendMessage = (messageContent) => __async(void 0, null, function* () {
|
|
2903
|
+
const sendMessage = (messageContent, imagesToUse) => __async(void 0, null, function* () {
|
|
2904
|
+
const images = imagesToUse || [];
|
|
2616
2905
|
abortSuggestions();
|
|
2617
2906
|
setCurrentSuggestions([]);
|
|
2618
|
-
|
|
2619
|
-
|
|
2620
|
-
|
|
2621
|
-
|
|
2622
|
-
|
|
2623
|
-
|
|
2624
|
-
|
|
2625
|
-
|
|
2626
|
-
|
|
2907
|
+
let firstMessage = null;
|
|
2908
|
+
if (messageContent.trim().length > 0) {
|
|
2909
|
+
const textMessage = new import_runtime_client_gql4.TextMessage({
|
|
2910
|
+
content: messageContent,
|
|
2911
|
+
role: import_runtime_client_gql4.Role.User
|
|
2912
|
+
});
|
|
2913
|
+
if (onSubmitMessage) {
|
|
2914
|
+
try {
|
|
2915
|
+
yield onSubmitMessage(messageContent);
|
|
2916
|
+
} catch (error) {
|
|
2917
|
+
console.error("Error in onSubmitMessage:", error);
|
|
2918
|
+
}
|
|
2919
|
+
}
|
|
2920
|
+
yield appendMessage(textMessage, { followUp: images.length === 0 });
|
|
2921
|
+
if (!firstMessage) {
|
|
2922
|
+
firstMessage = textMessage;
|
|
2923
|
+
}
|
|
2924
|
+
}
|
|
2925
|
+
if (images.length > 0) {
|
|
2926
|
+
for (let i = 0; i < images.length; i++) {
|
|
2927
|
+
const imageMessage = new import_runtime_client_gql4.ImageMessage({
|
|
2928
|
+
format: images[i].contentType.replace("image/", ""),
|
|
2929
|
+
bytes: images[i].bytes,
|
|
2930
|
+
role: import_runtime_client_gql4.Role.User
|
|
2931
|
+
});
|
|
2932
|
+
yield appendMessage(imageMessage, { followUp: i === images.length - 1 });
|
|
2933
|
+
if (!firstMessage) {
|
|
2934
|
+
firstMessage = imageMessage;
|
|
2935
|
+
}
|
|
2627
2936
|
}
|
|
2628
2937
|
}
|
|
2629
|
-
|
|
2630
|
-
|
|
2938
|
+
if (!firstMessage) {
|
|
2939
|
+
return new import_runtime_client_gql4.TextMessage({ content: "", role: import_runtime_client_gql4.Role.User });
|
|
2940
|
+
}
|
|
2941
|
+
return firstMessage;
|
|
2631
2942
|
});
|
|
2632
2943
|
const messages = visibleMessages;
|
|
2633
2944
|
const { setMessages } = messagesContext;
|
|
@@ -2720,7 +3031,7 @@ var useCopilotChatLogic = (makeSystemMessage, onInProgress, onSubmitMessage, onS
|
|
|
2720
3031
|
};
|
|
2721
3032
|
|
|
2722
3033
|
// src/components/chat/Modal.tsx
|
|
2723
|
-
var
|
|
3034
|
+
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
2724
3035
|
var CopilotModal = ({
|
|
2725
3036
|
instructions,
|
|
2726
3037
|
defaultOpen = false,
|
|
@@ -2754,19 +3065,19 @@ var CopilotModal = ({
|
|
|
2754
3065
|
onSetOpen == null ? void 0 : onSetOpen(open);
|
|
2755
3066
|
setOpenState(open);
|
|
2756
3067
|
};
|
|
2757
|
-
return /* @__PURE__ */ (0,
|
|
3068
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(ChatContextProvider, { icons, labels, open: openState, setOpen, children: [
|
|
2758
3069
|
children,
|
|
2759
|
-
/* @__PURE__ */ (0,
|
|
2760
|
-
/* @__PURE__ */ (0,
|
|
2761
|
-
/* @__PURE__ */ (0,
|
|
3070
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className, children: [
|
|
3071
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Button2, {}),
|
|
3072
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
|
|
2762
3073
|
Window2,
|
|
2763
3074
|
{
|
|
2764
3075
|
clickOutsideToClose,
|
|
2765
3076
|
shortcut,
|
|
2766
3077
|
hitEscapeToClose,
|
|
2767
3078
|
children: [
|
|
2768
|
-
/* @__PURE__ */ (0,
|
|
2769
|
-
/* @__PURE__ */ (0,
|
|
3079
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Header2, {}),
|
|
3080
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
2770
3081
|
CopilotChat,
|
|
2771
3082
|
{
|
|
2772
3083
|
instructions,
|
|
@@ -2793,7 +3104,7 @@ var CopilotModal = ({
|
|
|
2793
3104
|
};
|
|
2794
3105
|
|
|
2795
3106
|
// src/components/chat/Sidebar.tsx
|
|
2796
|
-
var
|
|
3107
|
+
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
2797
3108
|
function CopilotSidebar(props) {
|
|
2798
3109
|
props = __spreadProps(__spreadValues({}, props), {
|
|
2799
3110
|
className: props.className ? props.className + " copilotKitSidebar" : "copilotKitSidebar"
|
|
@@ -2806,7 +3117,7 @@ function CopilotSidebar(props) {
|
|
|
2806
3117
|
(_a = props.onSetOpen) == null ? void 0 : _a.call(props, open);
|
|
2807
3118
|
setExpandedClassName(open ? "sidebarExpanded" : "");
|
|
2808
3119
|
};
|
|
2809
|
-
return /* @__PURE__ */ (0,
|
|
3120
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: `copilotKitSidebarContentWrapper ${expandedClassName}`, children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(CopilotModal, __spreadProps(__spreadValues(__spreadValues({}, props), { onSetOpen }), { children: props.children })) });
|
|
2810
3121
|
}
|
|
2811
3122
|
// Annotate the CommonJS export names for ESM import in node:
|
|
2812
3123
|
0 && (module.exports = {
|