@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
@@ -3,16 +3,28 @@ import "../chunk-SC6JRFAJ.mjs";
3
3
  import "../chunk-WB3YULQ4.mjs";
4
4
  import {
5
5
  CopilotPopup
6
- } from "../chunk-HC4XNT4D.mjs";
6
+ } from "../chunk-6HXS43LW.mjs";
7
7
  import {
8
8
  CopilotSidebar
9
- } from "../chunk-CV7HMDQX.mjs";
10
- import "../chunk-COWRPULP.mjs";
9
+ } from "../chunk-6JX4WIAX.mjs";
10
+ import "../chunk-725PPN77.mjs";
11
11
  import "../chunk-C3GSYRC3.mjs";
12
+ import "../chunk-GVKA7RQQ.mjs";
13
+ import "../chunk-V7W6IM2V.mjs";
14
+ import {
15
+ CopilotDevConsole
16
+ } from "../chunk-SGFUVPDB.mjs";
17
+ import "../chunk-Q5V6S67N.mjs";
18
+ import {
19
+ shouldShowDevConsole
20
+ } from "../chunk-QN7T3GWI.mjs";
21
+ import "../chunk-KXE2JCUH.mjs";
22
+ import "../chunk-NRA3CFEE.mjs";
23
+ import "../chunk-BH6PCAAL.mjs";
12
24
  import "../chunk-UFN2VWSR.mjs";
13
25
  import {
14
26
  CopilotChat
15
- } from "../chunk-6CM2HBBL.mjs";
27
+ } from "../chunk-RT4HE74K.mjs";
16
28
  import "../chunk-UKCPOBQM.mjs";
17
29
  import "../chunk-2II3Q27P.mjs";
18
30
  import {
@@ -29,34 +41,22 @@ import {
29
41
  import {
30
42
  Suggestions
31
43
  } from "../chunk-QGSPTXOV.mjs";
32
- import "../chunk-2CVOR5KS.mjs";
44
+ import {
45
+ Suggestion
46
+ } from "../chunk-IMBPSLL4.mjs";
47
+ import "../chunk-PLHTVHUW.mjs";
48
+ import "../chunk-EMIYIMQ6.mjs";
49
+ import "../chunk-CGEAG65D.mjs";
33
50
  import "../chunk-YQFVRDNC.mjs";
34
51
  import {
35
52
  Markdown
36
53
  } from "../chunk-YTXEWDNC.mjs";
37
- import "../chunk-B3D7U7TJ.mjs";
38
- import "../chunk-CGEAG65D.mjs";
39
- import {
40
- Suggestion
41
- } from "../chunk-IMBPSLL4.mjs";
42
54
  import "../chunk-KENCH7RN.mjs";
43
- import "../chunk-HTWRXRTZ.mjs";
44
- import "../chunk-V7W6IM2V.mjs";
45
- import {
46
- CopilotDevConsole
47
- } from "../chunk-OHLSW5IM.mjs";
48
- import {
49
- shouldShowDevConsole
50
- } from "../chunk-QN7T3GWI.mjs";
51
- import "../chunk-KXE2JCUH.mjs";
52
- import "../chunk-NRA3CFEE.mjs";
53
- import "../chunk-BH6PCAAL.mjs";
54
- import "../chunk-Q5V6S67N.mjs";
55
+ import "../chunk-B3D7U7TJ.mjs";
55
56
  import {
56
57
  useChatContext
57
58
  } from "../chunk-IEMQ2SQW.mjs";
58
59
  import "../chunk-XWG3L6QC.mjs";
59
- import "../chunk-PLHTVHUW.mjs";
60
60
  import "../chunk-54JAUBUJ.mjs";
61
61
  import "../chunk-JGMFJZMG.mjs";
62
62
  import "../chunk-S5MBUNGN.mjs";
package/dist/index.js CHANGED
@@ -1429,15 +1429,8 @@ function PoweredByTag({ showPoweredBy = true }) {
1429
1429
  // src/components/chat/Input.tsx
1430
1430
  var import_jsx_runtime13 = require("react/jsx-runtime");
1431
1431
  var MAX_NEWLINES = 6;
1432
- var Input = ({
1433
- inProgress,
1434
- onSend,
1435
- isVisible = false,
1436
- onStop,
1437
- onUpload,
1438
- hideStopButton = false
1439
- }) => {
1440
- var _a, _b;
1432
+ var Input = ({ inProgress, onSend, isVisible = false, onStop, onUpload }) => {
1433
+ var _a;
1441
1434
  const context = useChatContext();
1442
1435
  const copilotContext = (0, import_react_core6.useCopilotContext)();
1443
1436
  const showPoweredBy = !((_a = copilotContext.copilotApiConfig) == null ? void 0 : _a.publicApiKey);
@@ -1466,18 +1459,15 @@ var Input = ({
1466
1459
  inProgress
1467
1460
  });
1468
1461
  const isInProgress = inProgress || pushToTalkState === "transcribing";
1469
- const buttonIcon = isInProgress && !hideStopButton ? context.icons.stopIcon : context.icons.sendIcon;
1462
+ const buttonIcon = isInProgress ? context.icons.stopIcon : context.icons.sendIcon;
1470
1463
  const showPushToTalk = pushToTalkConfigured && (pushToTalkState === "idle" || pushToTalkState === "recording") && !inProgress;
1471
- const canSend = (0, import_react9.useMemo)(() => {
1464
+ const canSend = () => {
1472
1465
  var _a2;
1473
1466
  const interruptEvent = (_a2 = copilotContext.langGraphInterruptAction) == null ? void 0 : _a2.event;
1474
1467
  const interruptInProgress = (interruptEvent == null ? void 0 : interruptEvent.name) === "LangGraphInterruptEvent" && !(interruptEvent == null ? void 0 : interruptEvent.response);
1475
- return !isInProgress && text.trim().length > 0 && pushToTalkState === "idle" && !interruptInProgress;
1476
- }, [(_b = copilotContext.langGraphInterruptAction) == null ? void 0 : _b.event, isInProgress, text, pushToTalkState]);
1477
- const canStop = (0, import_react9.useMemo)(() => {
1478
- return isInProgress && !hideStopButton;
1479
- }, [isInProgress, hideStopButton]);
1480
- const sendDisabled = !canSend && !canStop;
1468
+ return (isInProgress || !isInProgress && text.trim().length > 0) && pushToTalkState === "idle" && !interruptInProgress;
1469
+ };
1470
+ const sendDisabled = !canSend();
1481
1471
  return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: `copilotKitInputContainer ${showPoweredBy ? "poweredByContainer" : ""}`, children: [
1482
1472
  /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "copilotKitInput", onClick: handleDivClick, children: [
1483
1473
  /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
@@ -1492,7 +1482,7 @@ var Input = ({
1492
1482
  onKeyDown: (event) => {
1493
1483
  if (event.key === "Enter" && !event.shiftKey) {
1494
1484
  event.preventDefault();
1495
- if (canSend) {
1485
+ if (canSend()) {
1496
1486
  send();
1497
1487
  }
1498
1488
  }
@@ -1514,7 +1504,7 @@ var Input = ({
1514
1504
  "button",
1515
1505
  {
1516
1506
  disabled: sendDisabled,
1517
- onClick: isInProgress && !hideStopButton ? onStop : send,
1507
+ onClick: isInProgress ? onStop : send,
1518
1508
  "data-copilotkit-in-progress": inProgress,
1519
1509
  "data-test-id": inProgress ? "copilot-chat-request-in-progress" : "copilot-chat-ready",
1520
1510
  className: "copilotKitInputControlButton",
@@ -2720,8 +2710,7 @@ function CopilotChat({
2720
2710
  AssistantMessage: AssistantMessage2 = AssistantMessage,
2721
2711
  UserMessage: UserMessage2 = UserMessage,
2722
2712
  imageUploadsEnabled,
2723
- inputFileAccept = "image/*",
2724
- hideStopButton
2713
+ inputFileAccept = "image/*"
2725
2714
  }) {
2726
2715
  const { additionalInstructions, setChatInstructions } = (0, import_react_core10.useCopilotContext)();
2727
2716
  const [selectedImages, setSelectedImages] = (0, import_react13.useState)([]);
@@ -2904,8 +2893,7 @@ function CopilotChat({
2904
2893
  onUpload: imageUploadsEnabled ? () => {
2905
2894
  var _a;
2906
2895
  return (_a = fileInputRef.current) == null ? void 0 : _a.click();
2907
- } : void 0,
2908
- hideStopButton
2896
+ } : void 0
2909
2897
  }
2910
2898
  )
2911
2899
  ] });
@@ -3170,10 +3158,8 @@ var CopilotModal = (_a) => {
3170
3158
  onSetOpen == null ? void 0 : onSetOpen(open);
3171
3159
  setOpenState(open);
3172
3160
  };
3173
- const memoizedHeader = (0, import_react14.useMemo)(() => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Header2, {}), [Header2]);
3174
- const memoizedChildren = (0, import_react14.useMemo)(() => children, [children]);
3175
3161
  return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(ChatContextProvider, { icons, labels, open: openState, setOpen, children: [
3176
- memoizedChildren,
3162
+ children,
3177
3163
  /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className, children: [
3178
3164
  /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Button2, {}),
3179
3165
  /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
@@ -3183,7 +3169,7 @@ var CopilotModal = (_a) => {
3183
3169
  shortcut,
3184
3170
  hitEscapeToClose,
3185
3171
  children: [
3186
- memoizedHeader,
3172
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Header2, {}),
3187
3173
  /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
3188
3174
  CopilotChat,
3189
3175
  __spreadProps(__spreadValues({}, props), {