@copilotkit/react-ui 1.3.1 → 1.3.2-pre.0

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 (38) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/dist/{chunk-FOZVHL73.mjs → chunk-4K36ATCD.mjs} +27 -14
  3. package/dist/chunk-4K36ATCD.mjs.map +1 -0
  4. package/dist/{chunk-HR36Y2FQ.mjs → chunk-I454U2HM.mjs} +2 -2
  5. package/dist/{chunk-QOEAEMUQ.mjs → chunk-KJQVEUVB.mjs} +2 -2
  6. package/dist/{chunk-FL4ETWFB.mjs → chunk-N6GQ4WV4.mjs} +2 -2
  7. package/dist/{chunk-B2KQEX2R.mjs → chunk-PGJGIYRW.mjs} +3 -3
  8. package/dist/components/chat/Chat.js +26 -13
  9. package/dist/components/chat/Chat.js.map +1 -1
  10. package/dist/components/chat/Chat.mjs +2 -2
  11. package/dist/components/chat/Messages.js +26 -13
  12. package/dist/components/chat/Messages.js.map +1 -1
  13. package/dist/components/chat/Messages.mjs +1 -1
  14. package/dist/components/chat/Modal.js +26 -13
  15. package/dist/components/chat/Modal.js.map +1 -1
  16. package/dist/components/chat/Modal.mjs +3 -3
  17. package/dist/components/chat/Popup.js +26 -13
  18. package/dist/components/chat/Popup.js.map +1 -1
  19. package/dist/components/chat/Popup.mjs +4 -4
  20. package/dist/components/chat/Sidebar.js +26 -13
  21. package/dist/components/chat/Sidebar.js.map +1 -1
  22. package/dist/components/chat/Sidebar.mjs +4 -4
  23. package/dist/components/chat/index.js +26 -13
  24. package/dist/components/chat/index.js.map +1 -1
  25. package/dist/components/chat/index.mjs +5 -5
  26. package/dist/components/index.js +26 -13
  27. package/dist/components/index.js.map +1 -1
  28. package/dist/components/index.mjs +5 -5
  29. package/dist/index.js +26 -13
  30. package/dist/index.js.map +1 -1
  31. package/dist/index.mjs +5 -5
  32. package/package.json +7 -7
  33. package/src/components/chat/Messages.tsx +29 -19
  34. package/dist/chunk-FOZVHL73.mjs.map +0 -1
  35. /package/dist/{chunk-HR36Y2FQ.mjs.map → chunk-I454U2HM.mjs.map} +0 -0
  36. /package/dist/{chunk-QOEAEMUQ.mjs.map → chunk-KJQVEUVB.mjs.map} +0 -0
  37. /package/dist/{chunk-FL4ETWFB.mjs.map → chunk-N6GQ4WV4.mjs.map} +0 -0
  38. /package/dist/{chunk-B2KQEX2R.mjs.map → chunk-PGJGIYRW.mjs.map} +0 -0
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  CopilotPopup
3
- } from "../../chunk-FL4ETWFB.mjs";
4
- import "../../chunk-B2KQEX2R.mjs";
3
+ } from "../../chunk-N6GQ4WV4.mjs";
4
+ import "../../chunk-PGJGIYRW.mjs";
5
5
  import "../../chunk-FO7Z5LAL.mjs";
6
6
  import "../../chunk-FLV3J3VX.mjs";
7
7
  import "../../chunk-YOH25I6N.mjs";
8
- import "../../chunk-HR36Y2FQ.mjs";
8
+ import "../../chunk-I454U2HM.mjs";
9
9
  import "../../chunk-V7W6IM2V.mjs";
10
10
  import "../../chunk-WCPLXRZX.mjs";
11
11
  import "../../chunk-I4QG2ZZU.mjs";
@@ -13,7 +13,7 @@ import "../../chunk-H7TM5JE6.mjs";
13
13
  import "../../chunk-OTPAZXVR.mjs";
14
14
  import "../../chunk-U6J5DGOE.mjs";
15
15
  import "../../chunk-YQFVRDNC.mjs";
16
- import "../../chunk-FOZVHL73.mjs";
16
+ import "../../chunk-4K36ATCD.mjs";
17
17
  import "../../chunk-YQ3D5IQV.mjs";
18
18
  import "../../chunk-XSUSSWDS.mjs";
19
19
  import "../../chunk-BJPGMY3I.mjs";
@@ -1049,22 +1049,35 @@ var Messages = ({ messages, inProgress, children }) => {
1049
1049
  } else if (message.status.code !== import_runtime_client_gql.MessageStatusCode.Pending) {
1050
1050
  status = "executing";
1051
1051
  }
1052
- const toRender = render({
1053
- status,
1054
- args,
1055
- result: functionResults[message.id]
1056
- });
1057
- if (!toRender && status === "complete") {
1058
- return null;
1059
- }
1060
- if (typeof toRender === "string") {
1052
+ try {
1053
+ const toRender = render({
1054
+ status,
1055
+ args,
1056
+ result: functionResults[message.id]
1057
+ });
1058
+ if (!toRender && status === "complete") {
1059
+ return null;
1060
+ }
1061
+ if (typeof toRender === "string") {
1062
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: `copilotKitMessage copilotKitAssistantMessage`, children: [
1063
+ isCurrentMessage && inProgress && context.icons.spinnerIcon,
1064
+ " ",
1065
+ toRender
1066
+ ] }, index);
1067
+ } else {
1068
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "copilotKitCustomAssistantMessage", children: toRender }, index);
1069
+ }
1070
+ } catch (e) {
1071
+ console.error(`Error executing render function for action ${message.name}: ${e}`);
1061
1072
  return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: `copilotKitMessage copilotKitAssistantMessage`, children: [
1062
1073
  isCurrentMessage && inProgress && context.icons.spinnerIcon,
1063
- " ",
1064
- toRender
1074
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("b", { children: [
1075
+ "\u274C Error executing render: ",
1076
+ message.name
1077
+ ] }),
1078
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("br", {}),
1079
+ e instanceof Error ? e.message : String(e)
1065
1080
  ] }, index);
1066
- } else {
1067
- return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "copilotKitCustomAssistantMessage", children: toRender }, index);
1068
1081
  }
1069
1082
  }
1070
1083
  } else if (!inProgress || !isCurrentMessage) {