@copilotkit/react-ui 1.4.6 → 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 +95 -8
- 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
|
@@ -739,7 +739,10 @@ var Input = ({ inProgress, onSend, isVisible = false }) => {
|
|
|
739
739
|
});
|
|
740
740
|
const sendIcon = inProgress || pushToTalkState === "transcribing" ? context.icons.activityIcon : context.icons.sendIcon;
|
|
741
741
|
const showPushToTalk = pushToTalkConfigured && (pushToTalkState === "idle" || pushToTalkState === "recording") && !inProgress;
|
|
742
|
-
const
|
|
742
|
+
const canSend = () => {
|
|
743
|
+
return !inProgress && text.trim().length > 0 && pushToTalkState === "idle";
|
|
744
|
+
};
|
|
745
|
+
const sendDisabled = !canSend();
|
|
743
746
|
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "copilotKitInput", onClick: handleDivClick, children: [
|
|
744
747
|
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
745
748
|
Textarea_default,
|
|
@@ -753,7 +756,9 @@ var Input = ({ inProgress, onSend, isVisible = false }) => {
|
|
|
753
756
|
onKeyDown: (event) => {
|
|
754
757
|
if (event.key === "Enter" && !event.shiftKey) {
|
|
755
758
|
event.preventDefault();
|
|
756
|
-
|
|
759
|
+
if (canSend()) {
|
|
760
|
+
send();
|
|
761
|
+
}
|
|
757
762
|
}
|
|
758
763
|
}
|
|
759
764
|
}
|
|
@@ -1636,7 +1641,7 @@ function logMessages(context) {
|
|
|
1636
1641
|
type: "ActionExecutionMessage",
|
|
1637
1642
|
role: void 0,
|
|
1638
1643
|
name: message.name,
|
|
1639
|
-
scope: message.
|
|
1644
|
+
scope: message.parentMessageId,
|
|
1640
1645
|
content: message.arguments
|
|
1641
1646
|
};
|
|
1642
1647
|
} else if (message.isResultMessage()) {
|
|
@@ -1796,15 +1801,79 @@ var CloseIcon2 = () => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
|
1796
1801
|
children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" })
|
|
1797
1802
|
}
|
|
1798
1803
|
);
|
|
1804
|
+
var LoadingSpinnerIcon = ({ color = "rgb(107 114 128)" }) => /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
1805
|
+
"svg",
|
|
1806
|
+
{
|
|
1807
|
+
style: {
|
|
1808
|
+
animation: "copilotKitSpinAnimation 1s linear infinite",
|
|
1809
|
+
color
|
|
1810
|
+
},
|
|
1811
|
+
width: "24",
|
|
1812
|
+
height: "24",
|
|
1813
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1814
|
+
fill: "none",
|
|
1815
|
+
viewBox: "0 0 24 24",
|
|
1816
|
+
children: [
|
|
1817
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1818
|
+
"circle",
|
|
1819
|
+
{
|
|
1820
|
+
style: { opacity: 0.25 },
|
|
1821
|
+
cx: "12",
|
|
1822
|
+
cy: "12",
|
|
1823
|
+
r: "10",
|
|
1824
|
+
stroke: "currentColor",
|
|
1825
|
+
strokeWidth: "4"
|
|
1826
|
+
}
|
|
1827
|
+
),
|
|
1828
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1829
|
+
"path",
|
|
1830
|
+
{
|
|
1831
|
+
style: { opacity: 0.75 },
|
|
1832
|
+
fill: "currentColor",
|
|
1833
|
+
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"
|
|
1834
|
+
}
|
|
1835
|
+
)
|
|
1836
|
+
]
|
|
1837
|
+
}
|
|
1838
|
+
);
|
|
1799
1839
|
|
|
1800
1840
|
// src/components/help-modal/modal.tsx
|
|
1801
1841
|
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
1802
1842
|
function CopilotKitHelpModal() {
|
|
1803
1843
|
const [showHelpModal, setShowHelpModal] = (0, import_react8.useState)(false);
|
|
1804
1844
|
const [issueDescription, setIssueDescription] = (0, import_react8.useState)("");
|
|
1805
|
-
const
|
|
1806
|
-
|
|
1845
|
+
const [email, setEmail] = (0, import_react8.useState)("");
|
|
1846
|
+
const [emailError, setEmailError] = (0, import_react8.useState)("");
|
|
1847
|
+
const [submitting, setSubmitting] = (0, import_react8.useState)(false);
|
|
1848
|
+
const validateEmail = (email2) => {
|
|
1849
|
+
const re = /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/;
|
|
1850
|
+
return re.test(email2);
|
|
1807
1851
|
};
|
|
1852
|
+
const handleSubmit = (e) => __async(this, null, function* () {
|
|
1853
|
+
e.preventDefault();
|
|
1854
|
+
if ((email == null ? void 0 : email.length) > 0 && !validateEmail(email)) {
|
|
1855
|
+
setEmailError("Please enter a valid email address");
|
|
1856
|
+
return;
|
|
1857
|
+
}
|
|
1858
|
+
setSubmitting(true);
|
|
1859
|
+
yield fetch("https://api.segment.io/v1/track", {
|
|
1860
|
+
method: "POST",
|
|
1861
|
+
headers: {
|
|
1862
|
+
"Content-Type": "application/json"
|
|
1863
|
+
},
|
|
1864
|
+
body: JSON.stringify({
|
|
1865
|
+
event: "oss.dev-console.help",
|
|
1866
|
+
anonymousId: window.crypto.randomUUID(),
|
|
1867
|
+
properties: { email, text: issueDescription },
|
|
1868
|
+
writeKey: "q0gQqvGYyw9pNyhIocNzefSYKGO1aiwW"
|
|
1869
|
+
})
|
|
1870
|
+
});
|
|
1871
|
+
setEmailError("");
|
|
1872
|
+
setEmail("");
|
|
1873
|
+
setIssueDescription("");
|
|
1874
|
+
setSubmitting(false);
|
|
1875
|
+
setShowHelpModal(false);
|
|
1876
|
+
});
|
|
1808
1877
|
const HelpButton = () => /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
1809
1878
|
"button",
|
|
1810
1879
|
{
|
|
@@ -1814,6 +1883,10 @@ function CopilotKitHelpModal() {
|
|
|
1814
1883
|
children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(LifeBuoyIcon, {})
|
|
1815
1884
|
}
|
|
1816
1885
|
);
|
|
1886
|
+
const submitButtonDisabled = (0, import_react8.useMemo)(
|
|
1887
|
+
() => submitting || !!emailError || issueDescription == null || (issueDescription == null ? void 0 : issueDescription.length) == 0,
|
|
1888
|
+
[submitting, emailError, issueDescription]
|
|
1889
|
+
);
|
|
1817
1890
|
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_jsx_runtime16.Fragment, { children: [
|
|
1818
1891
|
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(HelpButton, {}),
|
|
1819
1892
|
showHelpModal && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
@@ -1852,6 +1925,52 @@ function CopilotKitHelpModal() {
|
|
|
1852
1925
|
children: "Apply for Priority Direct Slack Support"
|
|
1853
1926
|
}
|
|
1854
1927
|
) })
|
|
1928
|
+
] }),
|
|
1929
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("form", { onSubmit: handleSubmit, className: "flex flex-col space-y-2", children: [
|
|
1930
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { children: [
|
|
1931
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("label", { htmlFor: "feedback", className: "block text-sm font-medium text-gray-700 mb-1", children: "Let us know what your issue is:" }),
|
|
1932
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
1933
|
+
"textarea",
|
|
1934
|
+
{
|
|
1935
|
+
id: "feedback",
|
|
1936
|
+
rows: 4,
|
|
1937
|
+
className: "w-full px-3 py-2 text-gray-700 border rounded-lg focus:outline-none focus:border-blue-500",
|
|
1938
|
+
placeholder: "A Loom link / screen recording is always great!",
|
|
1939
|
+
onChange: (e) => setIssueDescription(e.target.value),
|
|
1940
|
+
value: issueDescription,
|
|
1941
|
+
required: true
|
|
1942
|
+
}
|
|
1943
|
+
)
|
|
1944
|
+
] }),
|
|
1945
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { children: [
|
|
1946
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("label", { htmlFor: "email", className: "block text-sm font-medium text-gray-700 mb-1", children: "Email (optional):" }),
|
|
1947
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
1948
|
+
"input",
|
|
1949
|
+
{
|
|
1950
|
+
type: "email",
|
|
1951
|
+
id: "email",
|
|
1952
|
+
className: `w-full px-3 py-2 text-gray-700 border rounded-lg focus:outline-none focus:border-blue-500 ${emailError ? "border-red-500" : ""}`,
|
|
1953
|
+
placeholder: "Enter your email for follow-up",
|
|
1954
|
+
onChange: (e) => {
|
|
1955
|
+
setEmail(e.target.value);
|
|
1956
|
+
setEmailError("");
|
|
1957
|
+
},
|
|
1958
|
+
value: email
|
|
1959
|
+
}
|
|
1960
|
+
),
|
|
1961
|
+
emailError && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("p", { className: "text-red-500 text-sm mt-1", children: emailError })
|
|
1962
|
+
] }),
|
|
1963
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.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_runtime16.jsx)(
|
|
1964
|
+
"button",
|
|
1965
|
+
{
|
|
1966
|
+
type: "submit",
|
|
1967
|
+
onClick: handleSubmit,
|
|
1968
|
+
disabled: submitButtonDisabled,
|
|
1969
|
+
style: submitButtonDisabled ? { backgroundColor: "rgb(216, 216, 216)", color: "rgb(129, 129, 129)" } : void 0,
|
|
1970
|
+
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",
|
|
1971
|
+
children: submitting ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(LoadingSpinnerIcon, { color: "white" }) : "Submit"
|
|
1972
|
+
}
|
|
1973
|
+
) })
|
|
1855
1974
|
] })
|
|
1856
1975
|
] })
|
|
1857
1976
|
}
|