@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.
Files changed (58) hide show
  1. package/CHANGELOG.md +0 -60
  2. package/dist/{chunk-2CVOR5KS.mjs → chunk-EMIYIMQ6.mjs} +14 -24
  3. package/dist/chunk-EMIYIMQ6.mjs.map +1 -0
  4. package/dist/{chunk-HC4XNT4D.mjs → chunk-GBGU4ZR6.mjs} +2 -2
  5. package/dist/{chunk-HTWRXRTZ.mjs → chunk-GVKA7RQQ.mjs} +2 -2
  6. package/dist/{chunk-CV7HMDQX.mjs → chunk-KGKVOUC3.mjs} +2 -2
  7. package/dist/{chunk-6CM2HBBL.mjs → chunk-RT4HE74K.mjs} +10 -12
  8. package/dist/chunk-RT4HE74K.mjs.map +1 -0
  9. package/dist/{chunk-OHLSW5IM.mjs → chunk-SGFUVPDB.mjs} +7 -7
  10. package/dist/{chunk-COWRPULP.mjs → chunk-XZI6DUGE.mjs} +6 -6
  11. package/dist/components/chat/Chat.d.ts +1 -2
  12. package/dist/components/chat/Chat.js +11 -23
  13. package/dist/components/chat/Chat.js.map +1 -1
  14. package/dist/components/chat/Chat.mjs +6 -6
  15. package/dist/components/chat/Header.mjs +3 -3
  16. package/dist/components/chat/Input.d.ts +1 -1
  17. package/dist/components/chat/Input.js +9 -19
  18. package/dist/components/chat/Input.js.map +1 -1
  19. package/dist/components/chat/Input.mjs +2 -2
  20. package/dist/components/chat/Modal.js +11 -23
  21. package/dist/components/chat/Modal.js.map +1 -1
  22. package/dist/components/chat/Modal.mjs +15 -15
  23. package/dist/components/chat/Popup.js +11 -23
  24. package/dist/components/chat/Popup.js.map +1 -1
  25. package/dist/components/chat/Popup.mjs +16 -16
  26. package/dist/components/chat/Sidebar.js +11 -23
  27. package/dist/components/chat/Sidebar.js.map +1 -1
  28. package/dist/components/chat/Sidebar.mjs +16 -16
  29. package/dist/components/chat/index.js +11 -23
  30. package/dist/components/chat/index.js.map +1 -1
  31. package/dist/components/chat/index.mjs +19 -19
  32. package/dist/components/chat/props.d.ts +0 -1
  33. package/dist/components/chat/props.js.map +1 -1
  34. package/dist/components/dev-console/console.mjs +2 -2
  35. package/dist/components/dev-console/index.mjs +2 -2
  36. package/dist/components/index.js +11 -23
  37. package/dist/components/index.js.map +1 -1
  38. package/dist/components/index.mjs +23 -23
  39. package/dist/index.js +11 -23
  40. package/dist/index.js.map +1 -1
  41. package/dist/index.mjs +24 -24
  42. package/dist/lib/utils.test.d.ts +2 -0
  43. package/dist/lib/utils.test.js +9 -0
  44. package/dist/lib/utils.test.js.map +1 -0
  45. package/dist/lib/utils.test.mjs +7 -0
  46. package/dist/lib/utils.test.mjs.map +1 -0
  47. package/package.json +5 -5
  48. package/src/components/chat/Chat.tsx +0 -4
  49. package/src/components/chat/Input.tsx +11 -21
  50. package/src/components/chat/props.ts +0 -1
  51. package/tsup.config.ts +6 -1
  52. package/dist/chunk-2CVOR5KS.mjs.map +0 -1
  53. package/dist/chunk-6CM2HBBL.mjs.map +0 -1
  54. /package/dist/{chunk-HC4XNT4D.mjs.map → chunk-GBGU4ZR6.mjs.map} +0 -0
  55. /package/dist/{chunk-HTWRXRTZ.mjs.map → chunk-GVKA7RQQ.mjs.map} +0 -0
  56. /package/dist/{chunk-CV7HMDQX.mjs.map → chunk-KGKVOUC3.mjs.map} +0 -0
  57. /package/dist/{chunk-OHLSW5IM.mjs.map → chunk-SGFUVPDB.mjs.map} +0 -0
  58. /package/dist/{chunk-COWRPULP.mjs.map → chunk-XZI6DUGE.mjs.map} +0 -0
@@ -1,9 +1,17 @@
1
1
  import {
2
2
  CopilotModal
3
- } from "../../chunk-COWRPULP.mjs";
3
+ } from "../../chunk-XZI6DUGE.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-6CM2HBBL.mjs";
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-2CVOR5KS.mjs";
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-HTWRXRTZ.mjs";
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
- inProgress,
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 && !hideStopButton ? context.icons.stopIcon : context.icons.sendIcon;
1449
+ const buttonIcon = isInProgress ? context.icons.stopIcon : context.icons.sendIcon;
1457
1450
  const showPushToTalk = pushToTalkConfigured && (pushToTalkState === "idle" || pushToTalkState === "recording") && !inProgress;
1458
- const canSend = (0, import_react9.useMemo)(() => {
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
- }, [(_b = copilotContext.langGraphInterruptAction) == null ? void 0 : _b.event, isInProgress, text, pushToTalkState]);
1464
- const canStop = (0, import_react9.useMemo)(() => {
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 && !hideStopButton ? onStop : send,
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
  ] });