@copilotkit/react-ui 1.4.7 → 1.4.8-coagents-v0-3.1
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 +31 -0
- package/dist/{chunk-2B57NCBA.mjs → chunk-6GBOJUX4.mjs} +3 -3
- package/dist/{chunk-4T3TMQNJ.mjs → chunk-BH6PCAAL.mjs} +38 -2
- package/dist/chunk-BH6PCAAL.mjs.map +1 -0
- package/dist/{chunk-4LUMV4YO.mjs → chunk-EMQEEXUB.mjs} +8 -3
- package/dist/chunk-EMQEEXUB.mjs.map +1 -0
- package/dist/{chunk-63ZKP62F.mjs → chunk-H7UVF2NY.mjs} +3 -3
- package/dist/chunk-ICGZEGHQ.mjs +155 -0
- package/dist/chunk-ICGZEGHQ.mjs.map +1 -0
- package/dist/{chunk-DHGDU64D.mjs → chunk-M7MHMZ5O.mjs} +3 -3
- package/dist/{chunk-4FIGRRFS.mjs → chunk-PNQVKBPN.mjs} +2 -2
- package/dist/{chunk-4FIGRRFS.mjs.map → chunk-PNQVKBPN.mjs.map} +1 -1
- package/dist/{chunk-TKFQ7VQR.mjs → chunk-ROVHRIKR.mjs} +2 -2
- package/dist/{chunk-VYKDFXGS.mjs → chunk-VUK75M5B.mjs} +2 -2
- package/dist/components/chat/Chat.js +124 -5
- package/dist/components/chat/Chat.js.map +1 -1
- package/dist/components/chat/Chat.mjs +6 -6
- package/dist/components/chat/Input.js +7 -2
- package/dist/components/chat/Input.js.map +1 -1
- package/dist/components/chat/Input.mjs +1 -1
- package/dist/components/chat/Modal.js +124 -5
- package/dist/components/chat/Modal.js.map +1 -1
- package/dist/components/chat/Modal.mjs +7 -7
- package/dist/components/chat/Popup.js +124 -5
- package/dist/components/chat/Popup.js.map +1 -1
- package/dist/components/chat/Popup.mjs +8 -8
- package/dist/components/chat/Sidebar.js +124 -5
- package/dist/components/chat/Sidebar.js.map +1 -1
- package/dist/components/chat/Sidebar.mjs +8 -8
- package/dist/components/chat/index.js +124 -5
- package/dist/components/chat/index.js.map +1 -1
- package/dist/components/chat/index.mjs +9 -9
- package/dist/components/dev-console/console.js +117 -3
- package/dist/components/dev-console/console.js.map +1 -1
- package/dist/components/dev-console/console.mjs +4 -4
- package/dist/components/dev-console/index.js +117 -3
- package/dist/components/dev-console/index.js.map +1 -1
- package/dist/components/dev-console/index.mjs +4 -4
- package/dist/components/dev-console/utils.js +1 -1
- package/dist/components/dev-console/utils.js.map +1 -1
- package/dist/components/dev-console/utils.mjs +1 -1
- package/dist/components/help-modal/icons.d.ts +4 -1
- package/dist/components/help-modal/icons.js +39 -2
- package/dist/components/help-modal/icons.js.map +1 -1
- package/dist/components/help-modal/icons.mjs +5 -3
- package/dist/components/help-modal/index.js +136 -2
- package/dist/components/help-modal/index.js.map +1 -1
- package/dist/components/help-modal/index.mjs +2 -2
- package/dist/components/help-modal/modal.js +136 -2
- package/dist/components/help-modal/modal.js.map +1 -1
- package/dist/components/help-modal/modal.mjs +2 -2
- package/dist/components/index.js +124 -5
- package/dist/components/index.js.map +1 -1
- package/dist/components/index.mjs +9 -9
- package/dist/index.js +124 -5
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +9 -9
- package/package.json +4 -4
- package/src/components/chat/Input.tsx +9 -2
- package/src/components/dev-console/utils.ts +1 -1
- package/src/components/help-modal/icons.tsx +28 -0
- package/src/components/help-modal/modal.tsx +90 -27
- package/dist/chunk-4LUMV4YO.mjs.map +0 -1
- package/dist/chunk-4T3TMQNJ.mjs.map +0 -1
- package/dist/chunk-WOUWNTAV.mjs +0 -72
- package/dist/chunk-WOUWNTAV.mjs.map +0 -1
- /package/dist/{chunk-2B57NCBA.mjs.map → chunk-6GBOJUX4.mjs.map} +0 -0
- /package/dist/{chunk-63ZKP62F.mjs.map → chunk-H7UVF2NY.mjs.map} +0 -0
- /package/dist/{chunk-DHGDU64D.mjs.map → chunk-M7MHMZ5O.mjs.map} +0 -0
- /package/dist/{chunk-TKFQ7VQR.mjs.map → chunk-ROVHRIKR.mjs.map} +0 -0
- /package/dist/{chunk-VYKDFXGS.mjs.map → chunk-VUK75M5B.mjs.map} +0 -0
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
import {
|
|
2
2
|
CopilotSidebar
|
|
3
|
-
} from "../../chunk-
|
|
4
|
-
import "../../chunk-
|
|
3
|
+
} from "../../chunk-ROVHRIKR.mjs";
|
|
4
|
+
import "../../chunk-H7UVF2NY.mjs";
|
|
5
5
|
import "../../chunk-YAGE7RCE.mjs";
|
|
6
6
|
import "../../chunk-VEC45H6Q.mjs";
|
|
7
7
|
import "../../chunk-RQNJNK2W.mjs";
|
|
8
|
-
import "../../chunk-
|
|
8
|
+
import "../../chunk-M7MHMZ5O.mjs";
|
|
9
9
|
import "../../chunk-6INMITFA.mjs";
|
|
10
10
|
import "../../chunk-RU73BEZM.mjs";
|
|
11
11
|
import "../../chunk-V7W6IM2V.mjs";
|
|
12
12
|
import "../../chunk-OMTPWC7T.mjs";
|
|
13
13
|
import "../../chunk-ZABXREBH.mjs";
|
|
14
14
|
import "../../chunk-RJCZRKTV.mjs";
|
|
15
|
-
import "../../chunk-
|
|
16
|
-
import "../../chunk-
|
|
15
|
+
import "../../chunk-6GBOJUX4.mjs";
|
|
16
|
+
import "../../chunk-PNQVKBPN.mjs";
|
|
17
17
|
import "../../chunk-KXE2JCUH.mjs";
|
|
18
|
-
import "../../chunk-
|
|
19
|
-
import "../../chunk-
|
|
18
|
+
import "../../chunk-ICGZEGHQ.mjs";
|
|
19
|
+
import "../../chunk-BH6PCAAL.mjs";
|
|
20
20
|
import "../../chunk-OTPAZXVR.mjs";
|
|
21
|
-
import "../../chunk-
|
|
21
|
+
import "../../chunk-EMQEEXUB.mjs";
|
|
22
22
|
import "../../chunk-YQFVRDNC.mjs";
|
|
23
23
|
import "../../chunk-YQ3D5IQV.mjs";
|
|
24
24
|
import "../../chunk-RKPANT3F.mjs";
|
|
@@ -880,7 +880,10 @@ var Input = ({ inProgress, onSend, isVisible = false }) => {
|
|
|
880
880
|
});
|
|
881
881
|
const sendIcon = inProgress || pushToTalkState === "transcribing" ? context.icons.activityIcon : context.icons.sendIcon;
|
|
882
882
|
const showPushToTalk = pushToTalkConfigured && (pushToTalkState === "idle" || pushToTalkState === "recording") && !inProgress;
|
|
883
|
-
const
|
|
883
|
+
const canSend = () => {
|
|
884
|
+
return !inProgress && text.trim().length > 0 && pushToTalkState === "idle";
|
|
885
|
+
};
|
|
886
|
+
const sendDisabled = !canSend();
|
|
884
887
|
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "copilotKitInput", onClick: handleDivClick, children: [
|
|
885
888
|
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
886
889
|
Textarea_default,
|
|
@@ -894,7 +897,9 @@ var Input = ({ inProgress, onSend, isVisible = false }) => {
|
|
|
894
897
|
onKeyDown: (event) => {
|
|
895
898
|
if (event.key === "Enter" && !event.shiftKey) {
|
|
896
899
|
event.preventDefault();
|
|
897
|
-
|
|
900
|
+
if (canSend()) {
|
|
901
|
+
send();
|
|
902
|
+
}
|
|
898
903
|
}
|
|
899
904
|
}
|
|
900
905
|
}
|
|
@@ -1777,7 +1782,7 @@ function logMessages(context) {
|
|
|
1777
1782
|
type: "ActionExecutionMessage",
|
|
1778
1783
|
role: void 0,
|
|
1779
1784
|
name: message.name,
|
|
1780
|
-
scope: message.
|
|
1785
|
+
scope: message.parentMessageId,
|
|
1781
1786
|
content: message.arguments
|
|
1782
1787
|
};
|
|
1783
1788
|
} else if (message.isResultMessage()) {
|
|
@@ -1937,15 +1942,79 @@ var CloseIcon2 = () => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
|
1937
1942
|
children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" })
|
|
1938
1943
|
}
|
|
1939
1944
|
);
|
|
1945
|
+
var LoadingSpinnerIcon = ({ color = "rgb(107 114 128)" }) => /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
|
|
1946
|
+
"svg",
|
|
1947
|
+
{
|
|
1948
|
+
style: {
|
|
1949
|
+
animation: "copilotKitSpinAnimation 1s linear infinite",
|
|
1950
|
+
color
|
|
1951
|
+
},
|
|
1952
|
+
width: "24",
|
|
1953
|
+
height: "24",
|
|
1954
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1955
|
+
fill: "none",
|
|
1956
|
+
viewBox: "0 0 24 24",
|
|
1957
|
+
children: [
|
|
1958
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
1959
|
+
"circle",
|
|
1960
|
+
{
|
|
1961
|
+
style: { opacity: 0.25 },
|
|
1962
|
+
cx: "12",
|
|
1963
|
+
cy: "12",
|
|
1964
|
+
r: "10",
|
|
1965
|
+
stroke: "currentColor",
|
|
1966
|
+
strokeWidth: "4"
|
|
1967
|
+
}
|
|
1968
|
+
),
|
|
1969
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
1970
|
+
"path",
|
|
1971
|
+
{
|
|
1972
|
+
style: { opacity: 0.75 },
|
|
1973
|
+
fill: "currentColor",
|
|
1974
|
+
d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"
|
|
1975
|
+
}
|
|
1976
|
+
)
|
|
1977
|
+
]
|
|
1978
|
+
}
|
|
1979
|
+
);
|
|
1940
1980
|
|
|
1941
1981
|
// src/components/help-modal/modal.tsx
|
|
1942
1982
|
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
1943
1983
|
function CopilotKitHelpModal() {
|
|
1944
1984
|
const [showHelpModal, setShowHelpModal] = (0, import_react9.useState)(false);
|
|
1945
1985
|
const [issueDescription, setIssueDescription] = (0, import_react9.useState)("");
|
|
1946
|
-
const
|
|
1947
|
-
|
|
1986
|
+
const [email, setEmail] = (0, import_react9.useState)("");
|
|
1987
|
+
const [emailError, setEmailError] = (0, import_react9.useState)("");
|
|
1988
|
+
const [submitting, setSubmitting] = (0, import_react9.useState)(false);
|
|
1989
|
+
const validateEmail = (email2) => {
|
|
1990
|
+
const re = /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/;
|
|
1991
|
+
return re.test(email2);
|
|
1948
1992
|
};
|
|
1993
|
+
const handleSubmit = (e) => __async(this, null, function* () {
|
|
1994
|
+
e.preventDefault();
|
|
1995
|
+
if ((email == null ? void 0 : email.length) > 0 && !validateEmail(email)) {
|
|
1996
|
+
setEmailError("Please enter a valid email address");
|
|
1997
|
+
return;
|
|
1998
|
+
}
|
|
1999
|
+
setSubmitting(true);
|
|
2000
|
+
yield fetch("https://api.segment.io/v1/track", {
|
|
2001
|
+
method: "POST",
|
|
2002
|
+
headers: {
|
|
2003
|
+
"Content-Type": "application/json"
|
|
2004
|
+
},
|
|
2005
|
+
body: JSON.stringify({
|
|
2006
|
+
event: "oss.dev-console.help",
|
|
2007
|
+
anonymousId: window.crypto.randomUUID(),
|
|
2008
|
+
properties: { email, text: issueDescription },
|
|
2009
|
+
writeKey: "q0gQqvGYyw9pNyhIocNzefSYKGO1aiwW"
|
|
2010
|
+
})
|
|
2011
|
+
});
|
|
2012
|
+
setEmailError("");
|
|
2013
|
+
setEmail("");
|
|
2014
|
+
setIssueDescription("");
|
|
2015
|
+
setSubmitting(false);
|
|
2016
|
+
setShowHelpModal(false);
|
|
2017
|
+
});
|
|
1949
2018
|
const HelpButton = () => /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
1950
2019
|
"button",
|
|
1951
2020
|
{
|
|
@@ -1955,6 +2024,10 @@ function CopilotKitHelpModal() {
|
|
|
1955
2024
|
children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(LifeBuoyIcon, {})
|
|
1956
2025
|
}
|
|
1957
2026
|
);
|
|
2027
|
+
const submitButtonDisabled = (0, import_react9.useMemo)(
|
|
2028
|
+
() => submitting || !!emailError || issueDescription == null || (issueDescription == null ? void 0 : issueDescription.length) == 0,
|
|
2029
|
+
[submitting, emailError, issueDescription]
|
|
2030
|
+
);
|
|
1958
2031
|
return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_jsx_runtime19.Fragment, { children: [
|
|
1959
2032
|
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(HelpButton, {}),
|
|
1960
2033
|
showHelpModal && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
@@ -1993,6 +2066,52 @@ function CopilotKitHelpModal() {
|
|
|
1993
2066
|
children: "Apply for Priority Direct Slack Support"
|
|
1994
2067
|
}
|
|
1995
2068
|
) })
|
|
2069
|
+
] }),
|
|
2070
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("form", { onSubmit: handleSubmit, className: "flex flex-col space-y-2", children: [
|
|
2071
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { children: [
|
|
2072
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("label", { htmlFor: "feedback", className: "block text-sm font-medium text-gray-700 mb-1", children: "Let us know what your issue is:" }),
|
|
2073
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
2074
|
+
"textarea",
|
|
2075
|
+
{
|
|
2076
|
+
id: "feedback",
|
|
2077
|
+
rows: 4,
|
|
2078
|
+
className: "w-full px-3 py-2 text-gray-700 border rounded-lg focus:outline-none focus:border-blue-500",
|
|
2079
|
+
placeholder: "A Loom link / screen recording is always great!",
|
|
2080
|
+
onChange: (e) => setIssueDescription(e.target.value),
|
|
2081
|
+
value: issueDescription,
|
|
2082
|
+
required: true
|
|
2083
|
+
}
|
|
2084
|
+
)
|
|
2085
|
+
] }),
|
|
2086
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { children: [
|
|
2087
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("label", { htmlFor: "email", className: "block text-sm font-medium text-gray-700 mb-1", children: "Email (optional):" }),
|
|
2088
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
2089
|
+
"input",
|
|
2090
|
+
{
|
|
2091
|
+
type: "email",
|
|
2092
|
+
id: "email",
|
|
2093
|
+
className: `w-full px-3 py-2 text-gray-700 border rounded-lg focus:outline-none focus:border-blue-500 ${emailError ? "border-red-500" : ""}`,
|
|
2094
|
+
placeholder: "Enter your email for follow-up",
|
|
2095
|
+
onChange: (e) => {
|
|
2096
|
+
setEmail(e.target.value);
|
|
2097
|
+
setEmailError("");
|
|
2098
|
+
},
|
|
2099
|
+
value: email
|
|
2100
|
+
}
|
|
2101
|
+
),
|
|
2102
|
+
emailError && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("p", { className: "text-red-500 text-sm mt-1", children: emailError })
|
|
2103
|
+
] }),
|
|
2104
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "bg-gray-50 px-4 py-4 sm:px-6 sm:flex sm:flex-row-reverse rounded-b-lg", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
2105
|
+
"button",
|
|
2106
|
+
{
|
|
2107
|
+
type: "submit",
|
|
2108
|
+
onClick: handleSubmit,
|
|
2109
|
+
disabled: submitButtonDisabled,
|
|
2110
|
+
style: submitButtonDisabled ? { backgroundColor: "rgb(216, 216, 216)", color: "rgb(129, 129, 129)" } : void 0,
|
|
2111
|
+
className: "w-full inline-flex justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-blue-500 text-base font-medium text-white hover:bg-blue-600 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 sm:ml-3 sm:w-auto sm:text-sm disabled:shadow-none",
|
|
2112
|
+
children: submitting ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(LoadingSpinnerIcon, { color: "white" }) : "Submit"
|
|
2113
|
+
}
|
|
2114
|
+
) })
|
|
1996
2115
|
] })
|
|
1997
2116
|
] })
|
|
1998
2117
|
}
|