@copilotkit/react-ui 1.4.7 → 1.4.8-no-pino-redact.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 +29 -0
- package/dist/{chunk-4T3TMQNJ.mjs → chunk-BH6PCAAL.mjs} +38 -2
- package/dist/chunk-BH6PCAAL.mjs.map +1 -0
- package/dist/{chunk-63ZKP62F.mjs → chunk-E5SSVET3.mjs} +3 -3
- package/dist/{chunk-4LUMV4YO.mjs → chunk-EMQEEXUB.mjs} +8 -3
- package/dist/chunk-EMQEEXUB.mjs.map +1 -0
- package/dist/{chunk-VYKDFXGS.mjs → chunk-FUDBUYBG.mjs} +2 -2
- package/dist/chunk-ICGZEGHQ.mjs +155 -0
- package/dist/chunk-ICGZEGHQ.mjs.map +1 -0
- package/dist/{chunk-DHGDU64D.mjs → chunk-T35X2SFE.mjs} +3 -3
- package/dist/{chunk-2B57NCBA.mjs → chunk-TTYR7XPN.mjs} +2 -2
- package/dist/{chunk-TKFQ7VQR.mjs → chunk-ZQFKJLQ6.mjs} +2 -2
- package/dist/components/chat/Chat.js +123 -4
- package/dist/components/chat/Chat.js.map +1 -1
- package/dist/components/chat/Chat.mjs +5 -5
- 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 +123 -4
- package/dist/components/chat/Modal.js.map +1 -1
- package/dist/components/chat/Modal.mjs +6 -6
- package/dist/components/chat/Popup.js +123 -4
- package/dist/components/chat/Popup.js.map +1 -1
- package/dist/components/chat/Popup.mjs +7 -7
- package/dist/components/chat/Sidebar.js +123 -4
- package/dist/components/chat/Sidebar.js.map +1 -1
- package/dist/components/chat/Sidebar.mjs +7 -7
- package/dist/components/chat/index.js +123 -4
- package/dist/components/chat/index.js.map +1 -1
- package/dist/components/chat/index.mjs +8 -8
- package/dist/components/dev-console/console.js +116 -2
- package/dist/components/dev-console/console.js.map +1 -1
- package/dist/components/dev-console/console.mjs +3 -3
- package/dist/components/dev-console/index.js +116 -2
- package/dist/components/dev-console/index.js.map +1 -1
- package/dist/components/dev-console/index.mjs +3 -3
- 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 +123 -4
- package/dist/components/index.js.map +1 -1
- package/dist/components/index.mjs +8 -8
- package/dist/index.js +123 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +8 -8
- package/package.json +4 -4
- package/src/components/chat/Input.tsx +9 -2
- 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-63ZKP62F.mjs.map → chunk-E5SSVET3.mjs.map} +0 -0
- /package/dist/{chunk-VYKDFXGS.mjs.map → chunk-FUDBUYBG.mjs.map} +0 -0
- /package/dist/{chunk-DHGDU64D.mjs.map → chunk-T35X2SFE.mjs.map} +0 -0
- /package/dist/{chunk-2B57NCBA.mjs.map → chunk-TTYR7XPN.mjs.map} +0 -0
- /package/dist/{chunk-TKFQ7VQR.mjs.map → chunk-ZQFKJLQ6.mjs.map} +0 -0
|
@@ -2,18 +2,18 @@ import "../chunk-MMVDU6DF.mjs";
|
|
|
2
2
|
import "../chunk-MRFF7GSQ.mjs";
|
|
3
3
|
import {
|
|
4
4
|
CopilotSidebar
|
|
5
|
-
} from "../chunk-
|
|
5
|
+
} from "../chunk-ZQFKJLQ6.mjs";
|
|
6
6
|
import "../chunk-WB3YULQ4.mjs";
|
|
7
7
|
import {
|
|
8
8
|
CopilotPopup
|
|
9
|
-
} from "../chunk-
|
|
10
|
-
import "../chunk-
|
|
9
|
+
} from "../chunk-FUDBUYBG.mjs";
|
|
10
|
+
import "../chunk-E5SSVET3.mjs";
|
|
11
11
|
import "../chunk-YAGE7RCE.mjs";
|
|
12
12
|
import "../chunk-VEC45H6Q.mjs";
|
|
13
13
|
import "../chunk-RQNJNK2W.mjs";
|
|
14
14
|
import {
|
|
15
15
|
CopilotChat
|
|
16
|
-
} from "../chunk-
|
|
16
|
+
} from "../chunk-T35X2SFE.mjs";
|
|
17
17
|
import "../chunk-6INMITFA.mjs";
|
|
18
18
|
import "../chunk-RU73BEZM.mjs";
|
|
19
19
|
import "../chunk-V7W6IM2V.mjs";
|
|
@@ -22,15 +22,15 @@ import "../chunk-ZABXREBH.mjs";
|
|
|
22
22
|
import "../chunk-RJCZRKTV.mjs";
|
|
23
23
|
import {
|
|
24
24
|
CopilotDevConsole
|
|
25
|
-
} from "../chunk-
|
|
25
|
+
} from "../chunk-TTYR7XPN.mjs";
|
|
26
26
|
import {
|
|
27
27
|
shouldShowDevConsole
|
|
28
28
|
} from "../chunk-4FIGRRFS.mjs";
|
|
29
29
|
import "../chunk-KXE2JCUH.mjs";
|
|
30
|
-
import "../chunk-
|
|
31
|
-
import "../chunk-
|
|
30
|
+
import "../chunk-ICGZEGHQ.mjs";
|
|
31
|
+
import "../chunk-BH6PCAAL.mjs";
|
|
32
32
|
import "../chunk-OTPAZXVR.mjs";
|
|
33
|
-
import "../chunk-
|
|
33
|
+
import "../chunk-EMQEEXUB.mjs";
|
|
34
34
|
import "../chunk-YQFVRDNC.mjs";
|
|
35
35
|
import "../chunk-YQ3D5IQV.mjs";
|
|
36
36
|
import "../chunk-RKPANT3F.mjs";
|
package/dist/index.js
CHANGED
|
@@ -884,7 +884,10 @@ var Input = ({ inProgress, onSend, isVisible = false }) => {
|
|
|
884
884
|
});
|
|
885
885
|
const sendIcon = inProgress || pushToTalkState === "transcribing" ? context.icons.activityIcon : context.icons.sendIcon;
|
|
886
886
|
const showPushToTalk = pushToTalkConfigured && (pushToTalkState === "idle" || pushToTalkState === "recording") && !inProgress;
|
|
887
|
-
const
|
|
887
|
+
const canSend = () => {
|
|
888
|
+
return !inProgress && text.trim().length > 0 && pushToTalkState === "idle";
|
|
889
|
+
};
|
|
890
|
+
const sendDisabled = !canSend();
|
|
888
891
|
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "copilotKitInput", onClick: handleDivClick, children: [
|
|
889
892
|
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
890
893
|
Textarea_default,
|
|
@@ -898,7 +901,9 @@ var Input = ({ inProgress, onSend, isVisible = false }) => {
|
|
|
898
901
|
onKeyDown: (event) => {
|
|
899
902
|
if (event.key === "Enter" && !event.shiftKey) {
|
|
900
903
|
event.preventDefault();
|
|
901
|
-
|
|
904
|
+
if (canSend()) {
|
|
905
|
+
send();
|
|
906
|
+
}
|
|
902
907
|
}
|
|
903
908
|
}
|
|
904
909
|
}
|
|
@@ -1941,15 +1946,79 @@ var CloseIcon2 = () => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
|
1941
1946
|
children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" })
|
|
1942
1947
|
}
|
|
1943
1948
|
);
|
|
1949
|
+
var LoadingSpinnerIcon = ({ color = "rgb(107 114 128)" }) => /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
|
|
1950
|
+
"svg",
|
|
1951
|
+
{
|
|
1952
|
+
style: {
|
|
1953
|
+
animation: "copilotKitSpinAnimation 1s linear infinite",
|
|
1954
|
+
color
|
|
1955
|
+
},
|
|
1956
|
+
width: "24",
|
|
1957
|
+
height: "24",
|
|
1958
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1959
|
+
fill: "none",
|
|
1960
|
+
viewBox: "0 0 24 24",
|
|
1961
|
+
children: [
|
|
1962
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
1963
|
+
"circle",
|
|
1964
|
+
{
|
|
1965
|
+
style: { opacity: 0.25 },
|
|
1966
|
+
cx: "12",
|
|
1967
|
+
cy: "12",
|
|
1968
|
+
r: "10",
|
|
1969
|
+
stroke: "currentColor",
|
|
1970
|
+
strokeWidth: "4"
|
|
1971
|
+
}
|
|
1972
|
+
),
|
|
1973
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
1974
|
+
"path",
|
|
1975
|
+
{
|
|
1976
|
+
style: { opacity: 0.75 },
|
|
1977
|
+
fill: "currentColor",
|
|
1978
|
+
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"
|
|
1979
|
+
}
|
|
1980
|
+
)
|
|
1981
|
+
]
|
|
1982
|
+
}
|
|
1983
|
+
);
|
|
1944
1984
|
|
|
1945
1985
|
// src/components/help-modal/modal.tsx
|
|
1946
1986
|
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
1947
1987
|
function CopilotKitHelpModal() {
|
|
1948
1988
|
const [showHelpModal, setShowHelpModal] = (0, import_react9.useState)(false);
|
|
1949
1989
|
const [issueDescription, setIssueDescription] = (0, import_react9.useState)("");
|
|
1950
|
-
const
|
|
1951
|
-
|
|
1990
|
+
const [email, setEmail] = (0, import_react9.useState)("");
|
|
1991
|
+
const [emailError, setEmailError] = (0, import_react9.useState)("");
|
|
1992
|
+
const [submitting, setSubmitting] = (0, import_react9.useState)(false);
|
|
1993
|
+
const validateEmail = (email2) => {
|
|
1994
|
+
const re = /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/;
|
|
1995
|
+
return re.test(email2);
|
|
1952
1996
|
};
|
|
1997
|
+
const handleSubmit = (e) => __async(this, null, function* () {
|
|
1998
|
+
e.preventDefault();
|
|
1999
|
+
if ((email == null ? void 0 : email.length) > 0 && !validateEmail(email)) {
|
|
2000
|
+
setEmailError("Please enter a valid email address");
|
|
2001
|
+
return;
|
|
2002
|
+
}
|
|
2003
|
+
setSubmitting(true);
|
|
2004
|
+
yield fetch("https://api.segment.io/v1/track", {
|
|
2005
|
+
method: "POST",
|
|
2006
|
+
headers: {
|
|
2007
|
+
"Content-Type": "application/json"
|
|
2008
|
+
},
|
|
2009
|
+
body: JSON.stringify({
|
|
2010
|
+
event: "oss.dev-console.help",
|
|
2011
|
+
anonymousId: window.crypto.randomUUID(),
|
|
2012
|
+
properties: { email, text: issueDescription },
|
|
2013
|
+
writeKey: "q0gQqvGYyw9pNyhIocNzefSYKGO1aiwW"
|
|
2014
|
+
})
|
|
2015
|
+
});
|
|
2016
|
+
setEmailError("");
|
|
2017
|
+
setEmail("");
|
|
2018
|
+
setIssueDescription("");
|
|
2019
|
+
setSubmitting(false);
|
|
2020
|
+
setShowHelpModal(false);
|
|
2021
|
+
});
|
|
1953
2022
|
const HelpButton = () => /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
1954
2023
|
"button",
|
|
1955
2024
|
{
|
|
@@ -1959,6 +2028,10 @@ function CopilotKitHelpModal() {
|
|
|
1959
2028
|
children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(LifeBuoyIcon, {})
|
|
1960
2029
|
}
|
|
1961
2030
|
);
|
|
2031
|
+
const submitButtonDisabled = (0, import_react9.useMemo)(
|
|
2032
|
+
() => submitting || !!emailError || issueDescription == null || (issueDescription == null ? void 0 : issueDescription.length) == 0,
|
|
2033
|
+
[submitting, emailError, issueDescription]
|
|
2034
|
+
);
|
|
1962
2035
|
return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_jsx_runtime19.Fragment, { children: [
|
|
1963
2036
|
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(HelpButton, {}),
|
|
1964
2037
|
showHelpModal && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
@@ -1997,6 +2070,52 @@ function CopilotKitHelpModal() {
|
|
|
1997
2070
|
children: "Apply for Priority Direct Slack Support"
|
|
1998
2071
|
}
|
|
1999
2072
|
) })
|
|
2073
|
+
] }),
|
|
2074
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("form", { onSubmit: handleSubmit, className: "flex flex-col space-y-2", children: [
|
|
2075
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { children: [
|
|
2076
|
+
/* @__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:" }),
|
|
2077
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
2078
|
+
"textarea",
|
|
2079
|
+
{
|
|
2080
|
+
id: "feedback",
|
|
2081
|
+
rows: 4,
|
|
2082
|
+
className: "w-full px-3 py-2 text-gray-700 border rounded-lg focus:outline-none focus:border-blue-500",
|
|
2083
|
+
placeholder: "A Loom link / screen recording is always great!",
|
|
2084
|
+
onChange: (e) => setIssueDescription(e.target.value),
|
|
2085
|
+
value: issueDescription,
|
|
2086
|
+
required: true
|
|
2087
|
+
}
|
|
2088
|
+
)
|
|
2089
|
+
] }),
|
|
2090
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { children: [
|
|
2091
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("label", { htmlFor: "email", className: "block text-sm font-medium text-gray-700 mb-1", children: "Email (optional):" }),
|
|
2092
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
2093
|
+
"input",
|
|
2094
|
+
{
|
|
2095
|
+
type: "email",
|
|
2096
|
+
id: "email",
|
|
2097
|
+
className: `w-full px-3 py-2 text-gray-700 border rounded-lg focus:outline-none focus:border-blue-500 ${emailError ? "border-red-500" : ""}`,
|
|
2098
|
+
placeholder: "Enter your email for follow-up",
|
|
2099
|
+
onChange: (e) => {
|
|
2100
|
+
setEmail(e.target.value);
|
|
2101
|
+
setEmailError("");
|
|
2102
|
+
},
|
|
2103
|
+
value: email
|
|
2104
|
+
}
|
|
2105
|
+
),
|
|
2106
|
+
emailError && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("p", { className: "text-red-500 text-sm mt-1", children: emailError })
|
|
2107
|
+
] }),
|
|
2108
|
+
/* @__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)(
|
|
2109
|
+
"button",
|
|
2110
|
+
{
|
|
2111
|
+
type: "submit",
|
|
2112
|
+
onClick: handleSubmit,
|
|
2113
|
+
disabled: submitButtonDisabled,
|
|
2114
|
+
style: submitButtonDisabled ? { backgroundColor: "rgb(216, 216, 216)", color: "rgb(129, 129, 129)" } : void 0,
|
|
2115
|
+
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",
|
|
2116
|
+
children: submitting ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(LoadingSpinnerIcon, { color: "white" }) : "Submit"
|
|
2117
|
+
}
|
|
2118
|
+
) })
|
|
2000
2119
|
] })
|
|
2001
2120
|
] })
|
|
2002
2121
|
}
|