@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.
Files changed (60) hide show
  1. package/CHANGELOG.md +0 -70
  2. package/dist/{chunk-HC4XNT4D.mjs → chunk-6HXS43LW.mjs} +2 -2
  3. package/dist/{chunk-CV7HMDQX.mjs → chunk-6JX4WIAX.mjs} +2 -2
  4. package/dist/{chunk-COWRPULP.mjs → chunk-725PPN77.mjs} +9 -11
  5. package/dist/chunk-725PPN77.mjs.map +1 -0
  6. package/dist/{chunk-2CVOR5KS.mjs → chunk-EMIYIMQ6.mjs} +14 -24
  7. package/dist/chunk-EMIYIMQ6.mjs.map +1 -0
  8. package/dist/{chunk-HTWRXRTZ.mjs → chunk-GVKA7RQQ.mjs} +2 -2
  9. package/dist/{chunk-6CM2HBBL.mjs → chunk-RT4HE74K.mjs} +10 -12
  10. package/dist/chunk-RT4HE74K.mjs.map +1 -0
  11. package/dist/{chunk-OHLSW5IM.mjs → chunk-SGFUVPDB.mjs} +7 -7
  12. package/dist/components/chat/Chat.d.ts +1 -2
  13. package/dist/components/chat/Chat.js +11 -23
  14. package/dist/components/chat/Chat.js.map +1 -1
  15. package/dist/components/chat/Chat.mjs +6 -6
  16. package/dist/components/chat/Header.mjs +3 -3
  17. package/dist/components/chat/Input.d.ts +1 -1
  18. package/dist/components/chat/Input.js +9 -19
  19. package/dist/components/chat/Input.js.map +1 -1
  20. package/dist/components/chat/Input.mjs +2 -2
  21. package/dist/components/chat/Modal.js +13 -27
  22. package/dist/components/chat/Modal.js.map +1 -1
  23. package/dist/components/chat/Modal.mjs +15 -15
  24. package/dist/components/chat/Popup.js +13 -27
  25. package/dist/components/chat/Popup.js.map +1 -1
  26. package/dist/components/chat/Popup.mjs +16 -16
  27. package/dist/components/chat/Sidebar.js +13 -27
  28. package/dist/components/chat/Sidebar.js.map +1 -1
  29. package/dist/components/chat/Sidebar.mjs +16 -16
  30. package/dist/components/chat/index.js +13 -27
  31. package/dist/components/chat/index.js.map +1 -1
  32. package/dist/components/chat/index.mjs +19 -19
  33. package/dist/components/chat/props.d.ts +0 -1
  34. package/dist/components/chat/props.js.map +1 -1
  35. package/dist/components/dev-console/console.mjs +2 -2
  36. package/dist/components/dev-console/index.mjs +2 -2
  37. package/dist/components/index.js +13 -27
  38. package/dist/components/index.js.map +1 -1
  39. package/dist/components/index.mjs +23 -23
  40. package/dist/index.js +13 -27
  41. package/dist/index.js.map +1 -1
  42. package/dist/index.mjs +24 -24
  43. package/dist/lib/utils.test.d.ts +2 -0
  44. package/dist/lib/utils.test.js +9 -0
  45. package/dist/lib/utils.test.js.map +1 -0
  46. package/dist/lib/utils.test.mjs +7 -0
  47. package/dist/lib/utils.test.mjs.map +1 -0
  48. package/package.json +5 -5
  49. package/src/components/chat/Chat.tsx +0 -4
  50. package/src/components/chat/Input.tsx +11 -21
  51. package/src/components/chat/Modal.tsx +3 -6
  52. package/src/components/chat/props.ts +0 -1
  53. package/tsup.config.ts +6 -1
  54. package/dist/chunk-2CVOR5KS.mjs.map +0 -1
  55. package/dist/chunk-6CM2HBBL.mjs.map +0 -1
  56. package/dist/chunk-COWRPULP.mjs.map +0 -1
  57. /package/dist/{chunk-HC4XNT4D.mjs.map → chunk-6HXS43LW.mjs.map} +0 -0
  58. /package/dist/{chunk-CV7HMDQX.mjs.map → chunk-6JX4WIAX.mjs.map} +0 -0
  59. /package/dist/{chunk-HTWRXRTZ.mjs.map → chunk-GVKA7RQQ.mjs.map} +0 -0
  60. /package/dist/{chunk-OHLSW5IM.mjs.map → chunk-SGFUVPDB.mjs.map} +0 -0
@@ -1,10 +1,18 @@
1
1
  import {
2
2
  CopilotPopup
3
- } from "../../chunk-HC4XNT4D.mjs";
4
- import "../../chunk-COWRPULP.mjs";
3
+ } from "../../chunk-6HXS43LW.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-6CM2HBBL.mjs";
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-2CVOR5KS.mjs";
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-HTWRXRTZ.mjs";
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";
@@ -1417,15 +1417,8 @@ function PoweredByTag({ showPoweredBy = true }) {
1417
1417
  // src/components/chat/Input.tsx
1418
1418
  var import_jsx_runtime13 = require("react/jsx-runtime");
1419
1419
  var MAX_NEWLINES = 6;
1420
- var Input = ({
1421
- inProgress,
1422
- onSend,
1423
- isVisible = false,
1424
- onStop,
1425
- onUpload,
1426
- hideStopButton = false
1427
- }) => {
1428
- var _a, _b;
1420
+ var Input = ({ inProgress, onSend, isVisible = false, onStop, onUpload }) => {
1421
+ var _a;
1429
1422
  const context = useChatContext();
1430
1423
  const copilotContext = (0, import_react_core6.useCopilotContext)();
1431
1424
  const showPoweredBy = !((_a = copilotContext.copilotApiConfig) == null ? void 0 : _a.publicApiKey);
@@ -1454,18 +1447,15 @@ var Input = ({
1454
1447
  inProgress
1455
1448
  });
1456
1449
  const isInProgress = inProgress || pushToTalkState === "transcribing";
1457
- const buttonIcon = isInProgress && !hideStopButton ? context.icons.stopIcon : context.icons.sendIcon;
1450
+ const buttonIcon = isInProgress ? context.icons.stopIcon : context.icons.sendIcon;
1458
1451
  const showPushToTalk = pushToTalkConfigured && (pushToTalkState === "idle" || pushToTalkState === "recording") && !inProgress;
1459
- const canSend = (0, import_react9.useMemo)(() => {
1452
+ const canSend = () => {
1460
1453
  var _a2;
1461
1454
  const interruptEvent = (_a2 = copilotContext.langGraphInterruptAction) == null ? void 0 : _a2.event;
1462
1455
  const interruptInProgress = (interruptEvent == null ? void 0 : interruptEvent.name) === "LangGraphInterruptEvent" && !(interruptEvent == null ? void 0 : interruptEvent.response);
1463
- return !isInProgress && text.trim().length > 0 && pushToTalkState === "idle" && !interruptInProgress;
1464
- }, [(_b = copilotContext.langGraphInterruptAction) == null ? void 0 : _b.event, isInProgress, text, pushToTalkState]);
1465
- const canStop = (0, import_react9.useMemo)(() => {
1466
- return isInProgress && !hideStopButton;
1467
- }, [isInProgress, hideStopButton]);
1468
- const sendDisabled = !canSend && !canStop;
1456
+ return (isInProgress || !isInProgress && text.trim().length > 0) && pushToTalkState === "idle" && !interruptInProgress;
1457
+ };
1458
+ const sendDisabled = !canSend();
1469
1459
  return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: `copilotKitInputContainer ${showPoweredBy ? "poweredByContainer" : ""}`, children: [
1470
1460
  /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "copilotKitInput", onClick: handleDivClick, children: [
1471
1461
  /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
@@ -1480,7 +1470,7 @@ var Input = ({
1480
1470
  onKeyDown: (event) => {
1481
1471
  if (event.key === "Enter" && !event.shiftKey) {
1482
1472
  event.preventDefault();
1483
- if (canSend) {
1473
+ if (canSend()) {
1484
1474
  send();
1485
1475
  }
1486
1476
  }
@@ -1502,7 +1492,7 @@ var Input = ({
1502
1492
  "button",
1503
1493
  {
1504
1494
  disabled: sendDisabled,
1505
- onClick: isInProgress && !hideStopButton ? onStop : send,
1495
+ onClick: isInProgress ? onStop : send,
1506
1496
  "data-copilotkit-in-progress": inProgress,
1507
1497
  "data-test-id": inProgress ? "copilot-chat-request-in-progress" : "copilot-chat-ready",
1508
1498
  className: "copilotKitInputControlButton",
@@ -2708,8 +2698,7 @@ function CopilotChat({
2708
2698
  AssistantMessage: AssistantMessage2 = AssistantMessage,
2709
2699
  UserMessage: UserMessage2 = UserMessage,
2710
2700
  imageUploadsEnabled,
2711
- inputFileAccept = "image/*",
2712
- hideStopButton
2701
+ inputFileAccept = "image/*"
2713
2702
  }) {
2714
2703
  const { additionalInstructions, setChatInstructions } = (0, import_react_core10.useCopilotContext)();
2715
2704
  const [selectedImages, setSelectedImages] = (0, import_react13.useState)([]);
@@ -2892,8 +2881,7 @@ function CopilotChat({
2892
2881
  onUpload: imageUploadsEnabled ? () => {
2893
2882
  var _a;
2894
2883
  return (_a = fileInputRef.current) == null ? void 0 : _a.click();
2895
- } : void 0,
2896
- hideStopButton
2884
+ } : void 0
2897
2885
  }
2898
2886
  )
2899
2887
  ] });
@@ -3158,10 +3146,8 @@ var CopilotModal = (_a) => {
3158
3146
  onSetOpen == null ? void 0 : onSetOpen(open);
3159
3147
  setOpenState(open);
3160
3148
  };
3161
- const memoizedHeader = (0, import_react14.useMemo)(() => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Header2, {}), [Header2]);
3162
- const memoizedChildren = (0, import_react14.useMemo)(() => children, [children]);
3163
3149
  return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(ChatContextProvider, { icons, labels, open: openState, setOpen, children: [
3164
- memoizedChildren,
3150
+ children,
3165
3151
  /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className, children: [
3166
3152
  /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Button2, {}),
3167
3153
  /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
@@ -3171,7 +3157,7 @@ var CopilotModal = (_a) => {
3171
3157
  shortcut,
3172
3158
  hitEscapeToClose,
3173
3159
  children: [
3174
- memoizedHeader,
3160
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Header2, {}),
3175
3161
  /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
3176
3162
  CopilotChat,
3177
3163
  __spreadProps(__spreadValues({}, props), {