@copilotkit/react-ui 1.8.14-next.0 → 1.8.14-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.
- package/CHANGELOG.md +17 -0
- package/dist/{chunk-FWKHST6I.mjs → chunk-BNTE4N7G.mjs} +2 -2
- package/dist/{chunk-TIDV74OE.mjs → chunk-C3GSYRC3.mjs} +2 -4
- package/dist/chunk-C3GSYRC3.mjs.map +1 -0
- package/dist/{chunk-QEZ3YYLO.mjs → chunk-MG26A5JB.mjs} +2 -2
- package/dist/{chunk-JU3HNL5N.mjs → chunk-RMX44BOI.mjs} +2 -2
- package/dist/components/chat/Modal.js +8 -10
- package/dist/components/chat/Modal.js.map +1 -1
- package/dist/components/chat/Modal.mjs +2 -2
- package/dist/components/chat/Popup.js +8 -10
- package/dist/components/chat/Popup.js.map +1 -1
- package/dist/components/chat/Popup.mjs +3 -3
- package/dist/components/chat/Sidebar.js +8 -10
- package/dist/components/chat/Sidebar.js.map +1 -1
- package/dist/components/chat/Sidebar.mjs +3 -3
- package/dist/components/chat/Window.js +2 -4
- package/dist/components/chat/Window.js.map +1 -1
- package/dist/components/chat/Window.mjs +1 -1
- package/dist/components/chat/index.js +8 -10
- package/dist/components/chat/index.js.map +1 -1
- package/dist/components/chat/index.mjs +4 -4
- package/dist/components/index.js +8 -10
- package/dist/components/index.js.map +1 -1
- package/dist/components/index.mjs +4 -4
- package/dist/index.js +10 -12
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +4 -4
- package/package.json +4 -4
- package/src/components/chat/Window.tsx +1 -4
- package/dist/chunk-TIDV74OE.mjs.map +0 -1
- /package/dist/{chunk-FWKHST6I.mjs.map → chunk-BNTE4N7G.mjs.map} +0 -0
- /package/dist/{chunk-QEZ3YYLO.mjs.map → chunk-MG26A5JB.mjs.map} +0 -0
- /package/dist/{chunk-JU3HNL5N.mjs.map → chunk-RMX44BOI.mjs.map} +0 -0
|
@@ -3,12 +3,12 @@ import "../chunk-SC6JRFAJ.mjs";
|
|
|
3
3
|
import "../chunk-WB3YULQ4.mjs";
|
|
4
4
|
import {
|
|
5
5
|
CopilotPopup
|
|
6
|
-
} from "../chunk-
|
|
6
|
+
} from "../chunk-MG26A5JB.mjs";
|
|
7
7
|
import {
|
|
8
8
|
CopilotSidebar
|
|
9
|
-
} from "../chunk-
|
|
10
|
-
import "../chunk-
|
|
11
|
-
import "../chunk-
|
|
9
|
+
} from "../chunk-RMX44BOI.mjs";
|
|
10
|
+
import "../chunk-BNTE4N7G.mjs";
|
|
11
|
+
import "../chunk-C3GSYRC3.mjs";
|
|
12
12
|
import "../chunk-UH2UFL5W.mjs";
|
|
13
13
|
import "../chunk-V7W6IM2V.mjs";
|
|
14
14
|
import {
|
package/dist/index.js
CHANGED
|
@@ -411,6 +411,7 @@ var ChatContextProvider = ({
|
|
|
411
411
|
// src/components/chat/Window.tsx
|
|
412
412
|
var import_react2 = __toESM(require("react"));
|
|
413
413
|
var import_react_core = require("@copilotkit/react-core");
|
|
414
|
+
var import_shared = require("@copilotkit/shared");
|
|
414
415
|
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
415
416
|
var Window = ({
|
|
416
417
|
children,
|
|
@@ -447,7 +448,7 @@ var Window = ({
|
|
|
447
448
|
const isDescendantOfWrapper = (_a = windowRef.current) == null ? void 0 : _a.contains(target);
|
|
448
449
|
if (open && event.key === "Escape" && (!isInput || isDescendantOfWrapper) && hitEscapeToClose) {
|
|
449
450
|
setOpen(false);
|
|
450
|
-
} else if (event.key === shortcut && (isMacOS() && event.metaKey || !isMacOS() && event.ctrlKey) && (!isInput || isDescendantOfWrapper)) {
|
|
451
|
+
} else if (event.key === shortcut && ((0, import_shared.isMacOS)() && event.metaKey || !(0, import_shared.isMacOS)() && event.ctrlKey) && (!isInput || isDescendantOfWrapper)) {
|
|
451
452
|
setOpen(!open);
|
|
452
453
|
}
|
|
453
454
|
},
|
|
@@ -516,9 +517,6 @@ var preventScroll = (event) => {
|
|
|
516
517
|
event.preventDefault();
|
|
517
518
|
}
|
|
518
519
|
};
|
|
519
|
-
function isMacOS() {
|
|
520
|
-
return /Mac|iMac|Macintosh/i.test(navigator.userAgent);
|
|
521
|
-
}
|
|
522
520
|
|
|
523
521
|
// src/components/chat/Button.tsx
|
|
524
522
|
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
@@ -747,7 +745,7 @@ var CheckIcon2 = /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
|
747
745
|
|
|
748
746
|
// src/components/dev-console/console.tsx
|
|
749
747
|
var import_react5 = require("@headlessui/react");
|
|
750
|
-
var
|
|
748
|
+
var import_shared2 = require("@copilotkit/shared");
|
|
751
749
|
|
|
752
750
|
// src/components/help-modal/modal.tsx
|
|
753
751
|
var import_react3 = require("react");
|
|
@@ -859,7 +857,7 @@ function CopilotKitHelpModal() {
|
|
|
859
857
|
// src/components/dev-console/console.tsx
|
|
860
858
|
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
861
859
|
function CopilotDevConsole() {
|
|
862
|
-
const currentVersion =
|
|
860
|
+
const currentVersion = import_shared2.COPILOTKIT_VERSION;
|
|
863
861
|
const context = (0, import_react_core3.useCopilotContext)();
|
|
864
862
|
const [showDevConsole, setShowDevConsole] = (0, import_react4.useState)(false);
|
|
865
863
|
(0, import_react4.useEffect)(() => {
|
|
@@ -2505,7 +2503,7 @@ var import_react_core10 = require("@copilotkit/react-core");
|
|
|
2505
2503
|
|
|
2506
2504
|
// src/components/chat/Suggestion.tsx
|
|
2507
2505
|
var import_react_core9 = require("@copilotkit/react-core");
|
|
2508
|
-
var
|
|
2506
|
+
var import_shared3 = require("@copilotkit/shared");
|
|
2509
2507
|
var import_runtime_client_gql3 = require("@copilotkit/runtime-client-gql");
|
|
2510
2508
|
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
2511
2509
|
function Suggestion({ title, onClick, partial, className }) {
|
|
@@ -2529,7 +2527,7 @@ var reloadSuggestions = (context, chatSuggestionConfiguration, setCurrentSuggest
|
|
|
2529
2527
|
Object.values(context.actions).map((action) => ({
|
|
2530
2528
|
name: action.name,
|
|
2531
2529
|
description: action.description,
|
|
2532
|
-
jsonSchema: JSON.stringify((0,
|
|
2530
|
+
jsonSchema: JSON.stringify((0, import_shared3.actionParametersToJsonSchema)(action.parameters))
|
|
2533
2531
|
}))
|
|
2534
2532
|
);
|
|
2535
2533
|
const allSuggestions = [];
|
|
@@ -2595,7 +2593,7 @@ var reloadSuggestions = (context, chatSuggestionConfiguration, setCurrentSuggest
|
|
|
2595
2593
|
|
|
2596
2594
|
// src/components/chat/Chat.tsx
|
|
2597
2595
|
var import_runtime_client_gql4 = require("@copilotkit/runtime-client-gql");
|
|
2598
|
-
var
|
|
2596
|
+
var import_shared4 = require("@copilotkit/shared");
|
|
2599
2597
|
var import_react_core11 = require("@copilotkit/react-core");
|
|
2600
2598
|
|
|
2601
2599
|
// src/components/chat/ImageUploadQueue.tsx
|
|
@@ -2932,7 +2930,7 @@ var useCopilotChatLogic = (makeSystemMessage, onInProgress, onSubmitMessage, onS
|
|
|
2932
2930
|
runChatCompletion,
|
|
2933
2931
|
isLoading
|
|
2934
2932
|
} = (0, import_react_core10.useCopilotChat)({
|
|
2935
|
-
id: (0,
|
|
2933
|
+
id: (0, import_shared4.randomId)(),
|
|
2936
2934
|
makeSystemMessage
|
|
2937
2935
|
});
|
|
2938
2936
|
const [currentSuggestions, setCurrentSuggestions] = (0, import_react13.useState)([]);
|
|
@@ -3237,7 +3235,7 @@ function CopilotSidebar(props) {
|
|
|
3237
3235
|
// src/hooks/use-copilot-chat-suggestions.tsx
|
|
3238
3236
|
var import_react16 = require("react");
|
|
3239
3237
|
var import_react_core12 = require("@copilotkit/react-core");
|
|
3240
|
-
var
|
|
3238
|
+
var import_shared5 = require("@copilotkit/shared");
|
|
3241
3239
|
function useCopilotChatSuggestions({
|
|
3242
3240
|
available = "enabled",
|
|
3243
3241
|
instructions,
|
|
@@ -3249,7 +3247,7 @@ function useCopilotChatSuggestions({
|
|
|
3249
3247
|
(0, import_react16.useEffect)(() => {
|
|
3250
3248
|
if (available === "disabled")
|
|
3251
3249
|
return;
|
|
3252
|
-
const id = (0,
|
|
3250
|
+
const id = (0, import_shared5.randomId)();
|
|
3253
3251
|
context.addChatSuggestionConfiguration(id, {
|
|
3254
3252
|
instructions,
|
|
3255
3253
|
minSuggestions,
|