@copilotkit/react-ui 1.5.0-tyler-reset-chat.0 → 1.5.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.
- package/CHANGELOG.md +192 -5
- package/dist/{chunk-Z2RXDT7O.mjs → chunk-375NVWZM.mjs} +2 -2
- package/dist/{chunk-OMTPWC7T.mjs → chunk-3E7HY2UN.mjs} +5 -4
- package/dist/chunk-3E7HY2UN.mjs.map +1 -0
- package/dist/{chunk-RKPANT3F.mjs → chunk-7II4YL7R.mjs} +2 -6
- package/dist/chunk-7II4YL7R.mjs.map +1 -0
- package/dist/{chunk-4T3TMQNJ.mjs → chunk-BH6PCAAL.mjs} +38 -2
- package/dist/chunk-BH6PCAAL.mjs.map +1 -0
- package/dist/{chunk-OI5EKZPO.mjs → chunk-DCNCY2PL.mjs} +13 -6
- package/dist/{chunk-OI5EKZPO.mjs.map → chunk-DCNCY2PL.mjs.map} +1 -1
- package/dist/{chunk-4LUMV4YO.mjs → chunk-EMQEEXUB.mjs} +8 -3
- package/dist/chunk-EMQEEXUB.mjs.map +1 -0
- package/dist/{chunk-2B57NCBA.mjs → chunk-F2W5FD7L.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-TI7SY2RI.mjs +164 -0
- package/dist/chunk-TI7SY2RI.mjs.map +1 -0
- package/dist/{chunk-B6A6OMIG.mjs → chunk-UWVGLGFQ.mjs} +4 -4
- package/dist/{chunk-RQRK6DEW.mjs → chunk-WSMMTZCM.mjs} +2 -2
- package/dist/components/chat/Chat.js +149 -36
- package/dist/components/chat/Chat.js.map +1 -1
- package/dist/components/chat/Chat.mjs +8 -8
- 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/Messages.d.ts +3 -3
- package/dist/components/chat/Messages.js.map +1 -1
- package/dist/components/chat/Messages.mjs +1 -1
- package/dist/components/chat/Modal.js +149 -36
- package/dist/components/chat/Modal.js.map +1 -1
- package/dist/components/chat/Modal.mjs +9 -9
- package/dist/components/chat/Popup.js +149 -36
- package/dist/components/chat/Popup.js.map +1 -1
- package/dist/components/chat/Popup.mjs +10 -10
- package/dist/components/chat/Sidebar.js +149 -36
- package/dist/components/chat/Sidebar.js.map +1 -1
- package/dist/components/chat/Sidebar.mjs +10 -10
- package/dist/components/chat/index.js +149 -36
- package/dist/components/chat/index.js.map +1 -1
- package/dist/components/chat/index.mjs +11 -11
- package/dist/components/chat/messages/RenderActionExecutionMessage.js +4 -3
- package/dist/components/chat/messages/RenderActionExecutionMessage.js.map +1 -1
- package/dist/components/chat/messages/RenderActionExecutionMessage.mjs +1 -1
- package/dist/components/dev-console/console.js +128 -28
- 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 +128 -28
- 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 +147 -27
- 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 +147 -27
- package/dist/components/help-modal/modal.js.map +1 -1
- package/dist/components/help-modal/modal.mjs +2 -2
- package/dist/components/index.js +149 -36
- package/dist/components/index.js.map +1 -1
- package/dist/components/index.mjs +11 -11
- package/dist/index.js +149 -36
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +11 -11
- package/package.json +7 -7
- package/src/components/chat/Chat.tsx +9 -2
- package/src/components/chat/Input.tsx +9 -2
- package/src/components/chat/Messages.tsx +2 -9
- package/src/components/chat/messages/RenderActionExecutionMessage.tsx +10 -3
- 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 +102 -29
- package/dist/chunk-4LUMV4YO.mjs.map +0 -1
- package/dist/chunk-4T3TMQNJ.mjs.map +0 -1
- package/dist/chunk-OMTPWC7T.mjs.map +0 -1
- package/dist/chunk-RKPANT3F.mjs.map +0 -1
- package/dist/chunk-WOUWNTAV.mjs +0 -72
- package/dist/chunk-WOUWNTAV.mjs.map +0 -1
- /package/dist/{chunk-Z2RXDT7O.mjs.map → chunk-375NVWZM.mjs.map} +0 -0
- /package/dist/{chunk-2B57NCBA.mjs.map → chunk-F2W5FD7L.mjs.map} +0 -0
- /package/dist/{chunk-B6A6OMIG.mjs.map → chunk-UWVGLGFQ.mjs.map} +0 -0
- /package/dist/{chunk-RQRK6DEW.mjs.map → chunk-WSMMTZCM.mjs.map} +0 -0
package/dist/index.mjs
CHANGED
|
@@ -4,38 +4,38 @@ import "./chunk-MMVDU6DF.mjs";
|
|
|
4
4
|
import "./chunk-MRFF7GSQ.mjs";
|
|
5
5
|
import {
|
|
6
6
|
CopilotSidebar
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-WSMMTZCM.mjs";
|
|
8
8
|
import "./chunk-WB3YULQ4.mjs";
|
|
9
9
|
import {
|
|
10
10
|
CopilotPopup
|
|
11
|
-
} from "./chunk-
|
|
12
|
-
import "./chunk-
|
|
11
|
+
} from "./chunk-375NVWZM.mjs";
|
|
12
|
+
import "./chunk-UWVGLGFQ.mjs";
|
|
13
13
|
import "./chunk-YAGE7RCE.mjs";
|
|
14
14
|
import "./chunk-VEC45H6Q.mjs";
|
|
15
15
|
import "./chunk-RQNJNK2W.mjs";
|
|
16
16
|
import {
|
|
17
17
|
CopilotChat
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-DCNCY2PL.mjs";
|
|
19
19
|
import "./chunk-6INMITFA.mjs";
|
|
20
20
|
import "./chunk-RU73BEZM.mjs";
|
|
21
21
|
import "./chunk-V7W6IM2V.mjs";
|
|
22
|
-
import "./chunk-
|
|
22
|
+
import "./chunk-3E7HY2UN.mjs";
|
|
23
23
|
import "./chunk-ZABXREBH.mjs";
|
|
24
24
|
import "./chunk-RJCZRKTV.mjs";
|
|
25
25
|
import {
|
|
26
26
|
CopilotDevConsole
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-F2W5FD7L.mjs";
|
|
28
28
|
import {
|
|
29
29
|
shouldShowDevConsole
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-PNQVKBPN.mjs";
|
|
31
31
|
import "./chunk-KXE2JCUH.mjs";
|
|
32
|
-
import "./chunk-
|
|
33
|
-
import "./chunk-
|
|
32
|
+
import "./chunk-TI7SY2RI.mjs";
|
|
33
|
+
import "./chunk-BH6PCAAL.mjs";
|
|
34
34
|
import "./chunk-OTPAZXVR.mjs";
|
|
35
|
-
import "./chunk-
|
|
35
|
+
import "./chunk-EMQEEXUB.mjs";
|
|
36
36
|
import "./chunk-YQFVRDNC.mjs";
|
|
37
37
|
import "./chunk-YQ3D5IQV.mjs";
|
|
38
|
-
import "./chunk-
|
|
38
|
+
import "./chunk-7II4YL7R.mjs";
|
|
39
39
|
import "./chunk-3XAXY2Z3.mjs";
|
|
40
40
|
import {
|
|
41
41
|
useChatContext
|
package/package.json
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"publishConfig": {
|
|
10
10
|
"access": "public"
|
|
11
11
|
},
|
|
12
|
-
"version": "1.5.0
|
|
12
|
+
"version": "1.5.0",
|
|
13
13
|
"sideEffects": [
|
|
14
14
|
"**/*.css"
|
|
15
15
|
],
|
|
@@ -40,9 +40,9 @@
|
|
|
40
40
|
"ts-jest": "^29.1.1",
|
|
41
41
|
"tsup": "^6.7.0",
|
|
42
42
|
"typescript": "^5.2.3",
|
|
43
|
-
"eslint-config-custom": "1.4.
|
|
44
|
-
"tailwind-config": "1.4.
|
|
45
|
-
"tsconfig": "1.4.
|
|
43
|
+
"eslint-config-custom": "1.4.6",
|
|
44
|
+
"tailwind-config": "1.4.6",
|
|
45
|
+
"tsconfig": "1.4.6"
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
48
|
"@headlessui/react": "^2.1.3",
|
|
@@ -50,9 +50,9 @@
|
|
|
50
50
|
"react-syntax-highlighter": "^15.5.0",
|
|
51
51
|
"remark-gfm": "^3.0.1",
|
|
52
52
|
"remark-math": "^5.1.1",
|
|
53
|
-
"@copilotkit/react-core": "1.5.0
|
|
54
|
-
"@copilotkit/runtime-client-gql": "1.5.0
|
|
55
|
-
"@copilotkit/shared": "1.5.0
|
|
53
|
+
"@copilotkit/react-core": "1.5.0",
|
|
54
|
+
"@copilotkit/runtime-client-gql": "1.5.0",
|
|
55
|
+
"@copilotkit/shared": "1.5.0"
|
|
56
56
|
},
|
|
57
57
|
"keywords": [
|
|
58
58
|
"copilotkit",
|
|
@@ -346,6 +346,7 @@ export const useCopilotChatLogic = (
|
|
|
346
346
|
appendMessage,
|
|
347
347
|
reloadMessages: defaultReloadMessages,
|
|
348
348
|
stopGeneration: defaultStopGeneration,
|
|
349
|
+
runChatCompletion,
|
|
349
350
|
isLoading,
|
|
350
351
|
} = useCopilotChat({
|
|
351
352
|
id: randomId(),
|
|
@@ -387,7 +388,7 @@ export const useCopilotChatLogic = (
|
|
|
387
388
|
|
|
388
389
|
return () => {
|
|
389
390
|
clearTimeout(debounceTimerRef.current);
|
|
390
|
-
}
|
|
391
|
+
};
|
|
391
392
|
}, [
|
|
392
393
|
isLoading,
|
|
393
394
|
context.chatSuggestionConfiguration,
|
|
@@ -445,7 +446,13 @@ export const useCopilotChatLogic = (
|
|
|
445
446
|
};
|
|
446
447
|
const runCurrentAgent = async (hint?: HintFunction) => {
|
|
447
448
|
if (generalContext.agentSession) {
|
|
448
|
-
await runAgent(
|
|
449
|
+
await runAgent(
|
|
450
|
+
generalContext.agentSession.agentName,
|
|
451
|
+
context,
|
|
452
|
+
appendMessage,
|
|
453
|
+
runChatCompletion,
|
|
454
|
+
hint,
|
|
455
|
+
);
|
|
449
456
|
}
|
|
450
457
|
};
|
|
451
458
|
const stopCurrentAgent = () => {
|
|
@@ -50,7 +50,12 @@ export const Input = ({ inProgress, onSend, isVisible = false }: InputProps) =>
|
|
|
50
50
|
pushToTalkConfigured &&
|
|
51
51
|
(pushToTalkState === "idle" || pushToTalkState === "recording") &&
|
|
52
52
|
!inProgress;
|
|
53
|
-
|
|
53
|
+
|
|
54
|
+
const canSend = () => {
|
|
55
|
+
return !inProgress && text.trim().length > 0 && pushToTalkState === "idle";
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
const sendDisabled = !canSend();
|
|
54
59
|
|
|
55
60
|
return (
|
|
56
61
|
<div className="copilotKitInput" onClick={handleDivClick}>
|
|
@@ -64,7 +69,9 @@ export const Input = ({ inProgress, onSend, isVisible = false }: InputProps) =>
|
|
|
64
69
|
onKeyDown={(event) => {
|
|
65
70
|
if (event.key === "Enter" && !event.shiftKey) {
|
|
66
71
|
event.preventDefault();
|
|
67
|
-
|
|
72
|
+
if (canSend()) {
|
|
73
|
+
send();
|
|
74
|
+
}
|
|
68
75
|
}
|
|
69
76
|
}}
|
|
70
77
|
/>
|
|
@@ -1,14 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { useEffect, useMemo, useRef } from "react";
|
|
2
2
|
import { MessagesProps } from "./props";
|
|
3
3
|
import { useChatContext } from "./ChatContext";
|
|
4
|
-
import {
|
|
5
|
-
ActionExecutionMessage,
|
|
6
|
-
Message,
|
|
7
|
-
ResultMessage,
|
|
8
|
-
TextMessage,
|
|
9
|
-
Role,
|
|
10
|
-
AgentStateMessage,
|
|
11
|
-
} from "@copilotkit/runtime-client-gql";
|
|
4
|
+
import { Message, ResultMessage, TextMessage, Role } from "@copilotkit/runtime-client-gql";
|
|
12
5
|
|
|
13
6
|
export const Messages = ({
|
|
14
7
|
messages,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { MessageStatusCode } from "@copilotkit/runtime-client-gql";
|
|
2
2
|
import { RenderMessageProps } from "../props";
|
|
3
3
|
import { useChatContext } from "../ChatContext";
|
|
4
4
|
import { RenderFunctionStatus, useCopilotContext } from "@copilotkit/react-core";
|
|
@@ -9,8 +9,14 @@ export function RenderActionExecutionMessage(props: RenderMessageProps) {
|
|
|
9
9
|
const { icons } = useChatContext();
|
|
10
10
|
|
|
11
11
|
if (message.isActionExecutionMessage()) {
|
|
12
|
-
if (
|
|
13
|
-
|
|
12
|
+
if (
|
|
13
|
+
chatComponentsCache.current !== null &&
|
|
14
|
+
(chatComponentsCache.current.actions[message.name] ||
|
|
15
|
+
chatComponentsCache.current.actions["*"])
|
|
16
|
+
) {
|
|
17
|
+
const render =
|
|
18
|
+
chatComponentsCache.current.actions[message.name] ||
|
|
19
|
+
chatComponentsCache.current.actions["*"];
|
|
14
20
|
// render a static string
|
|
15
21
|
if (typeof render === "string") {
|
|
16
22
|
// when render is static, we show it only when in progress
|
|
@@ -43,6 +49,7 @@ export function RenderActionExecutionMessage(props: RenderMessageProps) {
|
|
|
43
49
|
status: status as any,
|
|
44
50
|
args,
|
|
45
51
|
result: actionResult,
|
|
52
|
+
name: message.name,
|
|
46
53
|
});
|
|
47
54
|
// No result and complete: stay silent
|
|
48
55
|
if (!toRender && status === "complete") {
|
|
@@ -135,7 +135,7 @@ export function logMessages(context: CopilotMessagesContextParams) {
|
|
|
135
135
|
type: "ActionExecutionMessage",
|
|
136
136
|
role: undefined,
|
|
137
137
|
name: message.name,
|
|
138
|
-
scope: message.
|
|
138
|
+
scope: message.parentMessageId,
|
|
139
139
|
content: message.arguments,
|
|
140
140
|
};
|
|
141
141
|
} else if (message.isResultMessage()) {
|
|
@@ -38,3 +38,31 @@ export const CloseIcon = () => (
|
|
|
38
38
|
<path strokeLinecap="round" strokeLinejoin="round" d="M6 18L18 6M6 6l12 12" />
|
|
39
39
|
</svg>
|
|
40
40
|
);
|
|
41
|
+
|
|
42
|
+
export const LoadingSpinnerIcon = ({ color = "rgb(107 114 128)" }: { color?: string }) => (
|
|
43
|
+
<svg
|
|
44
|
+
style={{
|
|
45
|
+
animation: "copilotKitSpinAnimation 1s linear infinite",
|
|
46
|
+
color,
|
|
47
|
+
}}
|
|
48
|
+
width="24"
|
|
49
|
+
height="24"
|
|
50
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
51
|
+
fill="none"
|
|
52
|
+
viewBox="0 0 24 24"
|
|
53
|
+
>
|
|
54
|
+
<circle
|
|
55
|
+
style={{ opacity: 0.25 }}
|
|
56
|
+
cx="12"
|
|
57
|
+
cy="12"
|
|
58
|
+
r="10"
|
|
59
|
+
stroke="currentColor"
|
|
60
|
+
strokeWidth="4"
|
|
61
|
+
></circle>
|
|
62
|
+
<path
|
|
63
|
+
style={{ opacity: 0.75 }}
|
|
64
|
+
fill="currentColor"
|
|
65
|
+
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"
|
|
66
|
+
></path>
|
|
67
|
+
</svg>
|
|
68
|
+
);
|
|
@@ -1,25 +1,64 @@
|
|
|
1
|
-
import React, { useState } from "react";
|
|
2
|
-
import { CloseIcon, LifeBuoyIcon } from "./icons";
|
|
1
|
+
import React, { useMemo, useState } from "react";
|
|
2
|
+
import { CloseIcon, LifeBuoyIcon, LoadingSpinnerIcon } from "./icons";
|
|
3
3
|
|
|
4
4
|
export function CopilotKitHelpModal() {
|
|
5
5
|
const [showHelpModal, setShowHelpModal] = useState(false);
|
|
6
6
|
const [issueDescription, setIssueDescription] = useState("");
|
|
7
|
+
const [email, setEmail] = useState("");
|
|
8
|
+
const [emailError, setEmailError] = useState("");
|
|
9
|
+
const [submitting, setSubmitting] = useState(false);
|
|
7
10
|
|
|
8
|
-
const
|
|
9
|
-
|
|
11
|
+
const validateEmail = (email: string) => {
|
|
12
|
+
const re = /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/;
|
|
13
|
+
return re.test(email);
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
const handleSubmit = async (e: React.FormEvent) => {
|
|
17
|
+
e.preventDefault();
|
|
18
|
+
|
|
19
|
+
if (email?.length > 0 && !validateEmail(email)) {
|
|
20
|
+
setEmailError("Please enter a valid email address");
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
setSubmitting(true);
|
|
24
|
+
|
|
25
|
+
await fetch("https://api.segment.io/v1/track", {
|
|
26
|
+
method: "POST",
|
|
27
|
+
headers: {
|
|
28
|
+
"Content-Type": "application/json",
|
|
29
|
+
},
|
|
30
|
+
body: JSON.stringify({
|
|
31
|
+
event: "oss.dev-console.help",
|
|
32
|
+
anonymousId: window.crypto.randomUUID(),
|
|
33
|
+
properties: { email, text: issueDescription },
|
|
34
|
+
writeKey: "q0gQqvGYyw9pNyhIocNzefSYKGO1aiwW",
|
|
35
|
+
}),
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
// Reset
|
|
39
|
+
setEmailError("");
|
|
40
|
+
setEmail("");
|
|
41
|
+
setIssueDescription("");
|
|
42
|
+
setSubmitting(false);
|
|
10
43
|
setShowHelpModal(false);
|
|
11
44
|
};
|
|
12
45
|
|
|
13
46
|
const HelpButton = () => (
|
|
14
47
|
<button
|
|
15
48
|
onClick={() => setShowHelpModal(true)}
|
|
16
|
-
|
|
49
|
+
style={{ width: "50px", height: "30px", marginRight: "0.25rem" }}
|
|
50
|
+
className="text-sm p-0 bg-transparent rounded border border-blue-500"
|
|
17
51
|
aria-label="Open Help"
|
|
18
52
|
>
|
|
19
|
-
|
|
53
|
+
Help
|
|
20
54
|
</button>
|
|
21
55
|
);
|
|
22
56
|
|
|
57
|
+
const submitButtonDisabled = useMemo(
|
|
58
|
+
() => submitting || !!emailError || issueDescription == null || issueDescription?.length == 0,
|
|
59
|
+
[submitting, emailError, issueDescription],
|
|
60
|
+
);
|
|
61
|
+
|
|
23
62
|
return (
|
|
24
63
|
<>
|
|
25
64
|
<HelpButton />
|
|
@@ -41,6 +80,15 @@ export function CopilotKitHelpModal() {
|
|
|
41
80
|
<h2 className="text-2xl font-bold">Help Options</h2>
|
|
42
81
|
</div>
|
|
43
82
|
<div className="space-y-4 mb-4">
|
|
83
|
+
<div className="block w-full text-center py-2 px-4 bg-blue-500 text-white rounded hover:bg-blue-600 transition duration-150 text-sm">
|
|
84
|
+
<a
|
|
85
|
+
href="https://docs.copilotkit.ai/coagents/troubleshooting/common-issues"
|
|
86
|
+
target="_blank"
|
|
87
|
+
rel="noopener noreferrer"
|
|
88
|
+
>
|
|
89
|
+
Visit the Troubleshooting and FAQ section in the docs
|
|
90
|
+
</a>
|
|
91
|
+
</div>
|
|
44
92
|
<div className="block w-full text-center py-2 px-4 bg-blue-500 text-white rounded hover:bg-blue-600 transition duration-150 text-sm">
|
|
45
93
|
<a
|
|
46
94
|
href="https://go.copilotkit.ai/dev-console-support-discord"
|
|
@@ -60,29 +108,54 @@ export function CopilotKitHelpModal() {
|
|
|
60
108
|
</a>
|
|
61
109
|
</div>
|
|
62
110
|
</div>
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
111
|
+
<form onSubmit={handleSubmit} className="flex flex-col space-y-2">
|
|
112
|
+
<div>
|
|
113
|
+
<label htmlFor="feedback" className="block text-sm font-medium text-gray-700 mb-1">
|
|
114
|
+
Let us know what your issue is:
|
|
115
|
+
</label>
|
|
116
|
+
<textarea
|
|
117
|
+
id="feedback"
|
|
118
|
+
rows={4}
|
|
119
|
+
className="w-full px-3 py-2 text-gray-700 border rounded-lg focus:outline-none focus:border-blue-500"
|
|
120
|
+
placeholder="A Loom link / screen recording is always great!"
|
|
121
|
+
onChange={(e) => setIssueDescription(e.target.value)}
|
|
122
|
+
value={issueDescription}
|
|
123
|
+
required
|
|
124
|
+
></textarea>
|
|
125
|
+
</div>
|
|
126
|
+
<div>
|
|
127
|
+
<label htmlFor="email" className="block text-sm font-medium text-gray-700 mb-1">
|
|
128
|
+
Email (optional):
|
|
129
|
+
</label>
|
|
130
|
+
<input
|
|
131
|
+
type="email"
|
|
132
|
+
id="email"
|
|
133
|
+
className={`w-full px-3 py-2 text-gray-700 border rounded-lg focus:outline-none focus:border-blue-500 ${emailError ? "border-red-500" : ""}`}
|
|
134
|
+
placeholder="Enter your email for follow-up"
|
|
135
|
+
onChange={(e) => {
|
|
136
|
+
setEmail(e.target.value);
|
|
137
|
+
setEmailError("");
|
|
138
|
+
}}
|
|
139
|
+
value={email}
|
|
140
|
+
/>
|
|
141
|
+
{emailError && <p className="text-red-500 text-sm mt-1">{emailError}</p>}
|
|
142
|
+
</div>
|
|
143
|
+
<div className="bg-gray-50 px-4 py-4 sm:px-6 sm:flex sm:flex-row-reverse rounded-b-lg">
|
|
144
|
+
<button
|
|
145
|
+
type="submit"
|
|
146
|
+
onClick={handleSubmit}
|
|
147
|
+
disabled={submitButtonDisabled}
|
|
148
|
+
style={
|
|
149
|
+
submitButtonDisabled
|
|
150
|
+
? { backgroundColor: "rgb(216, 216, 216)", color: "rgb(129, 129, 129)" }
|
|
151
|
+
: undefined
|
|
152
|
+
}
|
|
153
|
+
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"
|
|
154
|
+
>
|
|
155
|
+
{submitting ? <LoadingSpinnerIcon color="white" /> : "Submit"}
|
|
156
|
+
</button>
|
|
157
|
+
</div>
|
|
158
|
+
</form>
|
|
86
159
|
</div>
|
|
87
160
|
</div>
|
|
88
161
|
)}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/chat/Input.tsx"],"sourcesContent":["import React, { useEffect, useRef, useState } from \"react\";\nimport { InputProps } from \"./props\";\nimport { useChatContext } from \"./ChatContext\";\nimport AutoResizingTextarea from \"./Textarea\";\nimport { usePushToTalk } from \"../../hooks/use-push-to-talk\";\nimport { useCopilotContext } from \"@copilotkit/react-core\";\n\nexport const Input = ({ inProgress, onSend, isVisible = false }: InputProps) => {\n const context = useChatContext();\n const copilotContext = useCopilotContext();\n\n const pushToTalkConfigured =\n copilotContext.copilotApiConfig.textToSpeechUrl !== undefined &&\n copilotContext.copilotApiConfig.transcribeAudioUrl !== undefined;\n\n const textareaRef = useRef<HTMLTextAreaElement>(null);\n\n const handleDivClick = (event: React.MouseEvent<HTMLDivElement>) => {\n // Check if the clicked element is not the textarea itself\n if (event.target !== event.currentTarget) return;\n\n textareaRef.current?.focus();\n };\n\n const [text, setText] = useState(\"\");\n const send = () => {\n if (inProgress) return;\n onSend(text);\n setText(\"\");\n\n textareaRef.current?.focus();\n };\n\n useEffect(() => {\n if (isVisible) {\n textareaRef.current?.focus();\n }\n }, [isVisible]);\n\n const { pushToTalkState, setPushToTalkState } = usePushToTalk({\n sendFunction: onSend,\n inProgress,\n });\n\n const sendIcon =\n inProgress || pushToTalkState === \"transcribing\"\n ? context.icons.activityIcon\n : context.icons.sendIcon;\n const showPushToTalk =\n pushToTalkConfigured &&\n (pushToTalkState === \"idle\" || pushToTalkState === \"recording\") &&\n !inProgress;\n const sendDisabled = inProgress || text.length === 0 || pushToTalkState !== \"idle\";\n\n return (\n <div className=\"copilotKitInput\" onClick={handleDivClick}>\n <AutoResizingTextarea\n ref={textareaRef}\n placeholder={context.labels.placeholder}\n autoFocus={true}\n maxRows={5}\n value={text}\n onChange={(event) => setText(event.target.value)}\n onKeyDown={(event) => {\n if (event.key === \"Enter\" && !event.shiftKey) {\n event.preventDefault();\n send();\n }\n }}\n />\n <div className=\"copilotKitInputControls\">\n {showPushToTalk && (\n <button\n onClick={() =>\n setPushToTalkState(pushToTalkState === \"idle\" ? \"recording\" : \"transcribing\")\n }\n className={pushToTalkState === \"recording\" ? \"copilotKitPushToTalkRecording\" : \"\"}\n >\n {context.icons.pushToTalkIcon}\n </button>\n )}\n <button\n disabled={sendDisabled}\n onClick={send}\n data-copilotkit-in-progress={!!inProgress}\n data-testid={inProgress ? \"copilot-chat-request-in-progress\" : undefined}\n >\n {sendIcon}\n </button>\n </div>\n </div>\n );\n};\n"],"mappings":";;;;;;;;;;;AAAA,SAAgB,WAAW,QAAQ,gBAAgB;AAKnD,SAAS,yBAAyB;AAmD5B,cAcA,YAdA;AAjDC,IAAM,QAAQ,CAAC,EAAE,YAAY,QAAQ,YAAY,MAAM,MAAkB;AAC9E,QAAM,UAAU,eAAe;AAC/B,QAAM,iBAAiB,kBAAkB;AAEzC,QAAM,uBACJ,eAAe,iBAAiB,oBAAoB,UACpD,eAAe,iBAAiB,uBAAuB;AAEzD,QAAM,cAAc,OAA4B,IAAI;AAEpD,QAAM,iBAAiB,CAAC,UAA4C;AAjBtE;AAmBI,QAAI,MAAM,WAAW,MAAM;AAAe;AAE1C,sBAAY,YAAZ,mBAAqB;AAAA,EACvB;AAEA,QAAM,CAAC,MAAM,OAAO,IAAI,SAAS,EAAE;AACnC,QAAM,OAAO,MAAM;AAzBrB;AA0BI,QAAI;AAAY;AAChB,WAAO,IAAI;AACX,YAAQ,EAAE;AAEV,sBAAY,YAAZ,mBAAqB;AAAA,EACvB;AAEA,YAAU,MAAM;AAjClB;AAkCI,QAAI,WAAW;AACb,wBAAY,YAAZ,mBAAqB;AAAA,IACvB;AAAA,EACF,GAAG,CAAC,SAAS,CAAC;AAEd,QAAM,EAAE,iBAAiB,mBAAmB,IAAI,cAAc;AAAA,IAC5D,cAAc;AAAA,IACd;AAAA,EACF,CAAC;AAED,QAAM,WACJ,cAAc,oBAAoB,iBAC9B,QAAQ,MAAM,eACd,QAAQ,MAAM;AACpB,QAAM,iBACJ,yBACC,oBAAoB,UAAU,oBAAoB,gBACnD,CAAC;AACH,QAAM,eAAe,cAAc,KAAK,WAAW,KAAK,oBAAoB;AAE5E,SACE,qBAAC,SAAI,WAAU,mBAAkB,SAAS,gBACxC;AAAA;AAAA,MAAC;AAAA;AAAA,QACC,KAAK;AAAA,QACL,aAAa,QAAQ,OAAO;AAAA,QAC5B,WAAW;AAAA,QACX,SAAS;AAAA,QACT,OAAO;AAAA,QACP,UAAU,CAAC,UAAU,QAAQ,MAAM,OAAO,KAAK;AAAA,QAC/C,WAAW,CAAC,UAAU;AACpB,cAAI,MAAM,QAAQ,WAAW,CAAC,MAAM,UAAU;AAC5C,kBAAM,eAAe;AACrB,iBAAK;AAAA,UACP;AAAA,QACF;AAAA;AAAA,IACF;AAAA,IACA,qBAAC,SAAI,WAAU,2BACZ;AAAA,wBACC;AAAA,QAAC;AAAA;AAAA,UACC,SAAS,MACP,mBAAmB,oBAAoB,SAAS,cAAc,cAAc;AAAA,UAE9E,WAAW,oBAAoB,cAAc,kCAAkC;AAAA,UAE9E,kBAAQ,MAAM;AAAA;AAAA,MACjB;AAAA,MAEF;AAAA,QAAC;AAAA;AAAA,UACC,UAAU;AAAA,UACV,SAAS;AAAA,UACT,+BAA6B,CAAC,CAAC;AAAA,UAC/B,eAAa,aAAa,qCAAqC;AAAA,UAE9D;AAAA;AAAA,MACH;AAAA,OACF;AAAA,KACF;AAEJ;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/help-modal/icons.tsx"],"sourcesContent":["import React from \"react\";\n\nexport const LifeBuoyIcon = () => (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n className=\"icon icon-tabler icons-tabler-outline icon-tabler-lifebuoy\"\n >\n <g transform=\"translate(0, -1)\">\n <path stroke=\"none\" d=\"M0 0h24v24H0z\" fill=\"none\" />\n <path d=\"M12 12m-4 0a4 4 0 1 0 8 0a4 4 0 1 0 -8 0\" />\n <path d=\"M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0\" />\n <path d=\"M15 15l3.35 3.35\" />\n <path d=\"M9 15l-3.35 3.35\" />\n <path d=\"M5.65 5.65l3.35 3.35\" />\n <path d=\"M18.35 5.65l-3.35 3.35\" />\n </g>\n </svg>\n);\n\nexport const CloseIcon = () => (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n strokeWidth=\"1.5\"\n stroke=\"currentColor\"\n width=\"20\"\n height=\"20\"\n >\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" d=\"M6 18L18 6M6 6l12 12\" />\n </svg>\n);\n"],"mappings":";AAeI,SACE,KADF;AAbG,IAAM,eAAe,MAC1B;AAAA,EAAC;AAAA;AAAA,IACC,OAAM;AAAA,IACN,OAAM;AAAA,IACN,QAAO;AAAA,IACP,SAAQ;AAAA,IACR,MAAK;AAAA,IACL,QAAO;AAAA,IACP,aAAY;AAAA,IACZ,eAAc;AAAA,IACd,gBAAe;AAAA,IACf,WAAU;AAAA,IAEV,+BAAC,OAAE,WAAU,oBACX;AAAA,0BAAC,UAAK,QAAO,QAAO,GAAE,iBAAgB,MAAK,QAAO;AAAA,MAClD,oBAAC,UAAK,GAAE,4CAA2C;AAAA,MACnD,oBAAC,UAAK,GAAE,8CAA6C;AAAA,MACrD,oBAAC,UAAK,GAAE,oBAAmB;AAAA,MAC3B,oBAAC,UAAK,GAAE,oBAAmB;AAAA,MAC3B,oBAAC,UAAK,GAAE,wBAAuB;AAAA,MAC/B,oBAAC,UAAK,GAAE,0BAAyB;AAAA,OACnC;AAAA;AACF;AAGK,IAAM,YAAY,MACvB;AAAA,EAAC;AAAA;AAAA,IACC,OAAM;AAAA,IACN,MAAK;AAAA,IACL,SAAQ;AAAA,IACR,aAAY;AAAA,IACZ,QAAO;AAAA,IACP,OAAM;AAAA,IACN,QAAO;AAAA,IAEP,8BAAC,UAAK,eAAc,SAAQ,gBAAe,SAAQ,GAAE,wBAAuB;AAAA;AAC9E;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/chat/messages/RenderActionExecutionMessage.tsx"],"sourcesContent":["import { ActionExecutionMessage, MessageStatusCode } from \"@copilotkit/runtime-client-gql\";\nimport { RenderMessageProps } from \"../props\";\nimport { useChatContext } from \"../ChatContext\";\nimport { RenderFunctionStatus, useCopilotContext } from \"@copilotkit/react-core\";\n\nexport function RenderActionExecutionMessage(props: RenderMessageProps) {\n const { message, inProgress, index, isCurrentMessage, actionResult } = props;\n const { chatComponentsCache } = useCopilotContext();\n const { icons } = useChatContext();\n\n if (message.isActionExecutionMessage()) {\n if (chatComponentsCache.current !== null && chatComponentsCache.current.actions[message.name]) {\n const render = chatComponentsCache.current.actions[message.name];\n // render a static string\n if (typeof render === \"string\") {\n // when render is static, we show it only when in progress\n if (isCurrentMessage && inProgress) {\n return (\n <div key={index} className={`copilotKitMessage copilotKitAssistantMessage`}>\n {icons.spinnerIcon} <span className=\"inProgressLabel\">{render}</span>\n </div>\n );\n }\n // Done - silent by default to avoid a series of \"done\" messages\n else {\n return null;\n }\n }\n // render is a function\n else {\n const args = message.arguments;\n\n let status: RenderFunctionStatus = \"inProgress\";\n\n if (actionResult !== undefined) {\n status = \"complete\";\n } else if (message.status.code !== MessageStatusCode.Pending) {\n status = \"executing\";\n }\n\n try {\n const toRender = render({\n status: status as any,\n args,\n result: actionResult,\n });\n // No result and complete: stay silent\n if (!toRender && status === \"complete\") {\n return null;\n }\n if (typeof toRender === \"string\") {\n return (\n <div key={index} className={`copilotKitMessage copilotKitAssistantMessage`}>\n {isCurrentMessage && inProgress && icons.spinnerIcon} {toRender}\n </div>\n );\n } else {\n return (\n <div\n key={index}\n data-message-type=\"action-render\"\n className=\"copilotKitCustomAssistantMessage\"\n >\n {toRender}\n </div>\n );\n }\n } catch (e) {\n console.error(`Error executing render function for action ${message.name}: ${e}`);\n return (\n <div key={index} className={`copilotKitMessage copilotKitAssistantMessage`}>\n {isCurrentMessage && inProgress && icons.spinnerIcon}\n <b>❌ Error executing render: {message.name}</b>\n <br />\n {e instanceof Error ? e.message : String(e)}\n </div>\n );\n }\n }\n }\n // No render function found- show the default message\n else if (!inProgress || !isCurrentMessage) {\n // Done - silent by default to avoid a series of \"done\" messages\n return null;\n } else {\n // In progress\n return (\n <div key={index} className={`copilotKitMessage copilotKitAssistantMessage`}>\n {icons.spinnerIcon}\n </div>\n );\n }\n }\n}\n"],"mappings":";;;;;AAAA,SAAiC,yBAAyB;AAG1D,SAA+B,yBAAyB;AAe5C,SACsB,KADtB;AAbL,SAAS,6BAA6B,OAA2B;AACtE,QAAM,EAAE,SAAS,YAAY,OAAO,kBAAkB,aAAa,IAAI;AACvE,QAAM,EAAE,oBAAoB,IAAI,kBAAkB;AAClD,QAAM,EAAE,MAAM,IAAI,eAAe;AAEjC,MAAI,QAAQ,yBAAyB,GAAG;AACtC,QAAI,oBAAoB,YAAY,QAAQ,oBAAoB,QAAQ,QAAQ,QAAQ,IAAI,GAAG;AAC7F,YAAM,SAAS,oBAAoB,QAAQ,QAAQ,QAAQ,IAAI;AAE/D,UAAI,OAAO,WAAW,UAAU;AAE9B,YAAI,oBAAoB,YAAY;AAClC,iBACE,qBAAC,SAAgB,WAAW,gDACzB;AAAA,kBAAM;AAAA,YAAY;AAAA,YAAC,oBAAC,UAAK,WAAU,mBAAmB,kBAAO;AAA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ent":["import React, { useEffect, useMemo, useRef } from \"react\";\nimport { MessagesProps } from \"./props\";\nimport { useChatContext } from \"./ChatContext\";\nimport {\n ActionExecutionMessage,\n Message,\n ResultMessage,\n TextMessage,\n Role,\n AgentStateMessage,\n} from \"@copilotkit/runtime-client-gql\";\n\nexport const Messages = ({\n messages,\n inProgress,\n children,\n RenderTextMessage,\n RenderActionExecutionMessage,\n RenderAgentStateMessage,\n RenderResultMessage,\n}: MessagesProps) => {\n const context = useChatContext();\n const initialMessages = useMemo(\n () => makeInitialMessages(context.labels.initial),\n [context.labels.initial],\n );\n messages = [...initialMessages, ...messages];\n\n const actionResults: Record<string, string> = {};\n\n for (let i = 0; i < messages.length; i++) {\n if (messages[i].isActionExecutionMessage()) {\n const id = messages[i].id;\n const resultMessage: ResultMessage | undefined = messages.find(\n (message) => message.isResultMessage() && message.actionExecutionId === id,\n ) as ResultMessage | undefined;\n\n if (resultMessage) {\n actionResults[id] = ResultMessage.decodeResult(resultMessage.result || \"\");\n }\n }\n }\n\n const { messagesEndRef, messagesContainerRef } = useScrollToBottom(messages);\n\n return (\n <div className=\"copilotKitMessages\" ref={messagesContainerRef}>\n {messages.map((message, index) => {\n const isCurrentMessage = index === messages.length - 1;\n\n if (message.isTextMessage()) {\n return (\n <RenderTextMessage\n key={index}\n message={message}\n inProgress={inProgress}\n index={index}\n isCurrentMessage={isCurrentMessage}\n />\n );\n } else if (message.isActionExecutionMessage()) {\n return (\n <RenderActionExecutionMessage\n key={index}\n message={message}\n inProgress={inProgress}\n index={index}\n isCurrentMessage={isCurrentMessage}\n actionResult={actionResults[message.id]}\n />\n );\n } else if (message.isAgentStateMessage()) {\n return (\n <RenderAgentStateMessage\n key={index}\n message={message}\n inProgress={inProgress}\n index={index}\n isCurrentMessage={isCurrentMessage}\n />\n );\n } else if (message.isResultMessage()) {\n return (\n <RenderResultMessage\n key={index}\n message={message}\n inProgress={inProgress}\n index={index}\n isCurrentMessage={isCurrentMessage}\n />\n );\n }\n })}\n <footer ref={messagesEndRef}>{children}</footer>\n </div>\n );\n};\n\nfunction makeInitialMessages(initial?: string | string[]): Message[] {\n let initialArray: string[] = [];\n if (initial) {\n if (Array.isArray(initial)) {\n initialArray.push(...initial);\n } else {\n initialArray.push(initial);\n }\n }\n\n return initialArray.map(\n (message) =>\n new TextMessage({\n role: Role.Assistant,\n content: message,\n }),\n );\n}\nexport function useScrollToBottom(messages: any[]) {\n const messagesEndRef = useRef<HTMLDivElement>(null);\n const messagesContainerRef = useRef<HTMLDivElement | null>(null);\n const isProgrammaticScrollRef = useRef(false);\n const isUserScrollUpRef = useRef(false);\n\n const scrollToBottom = () => {\n if (messagesEndRef.current) {\n isProgrammaticScrollRef.current = true;\n messagesEndRef.current.scrollIntoView({\n behavior: \"auto\",\n });\n }\n };\n\n const handleScroll = () => {\n if (isProgrammaticScrollRef.current) {\n isProgrammaticScrollRef.current = false;\n return;\n }\n\n if (messagesContainerRef.current) {\n const { scrollTop, scrollHeight, clientHeight } = messagesContainerRef.current;\n isUserScrollUpRef.current = scrollTop + clientHeight < scrollHeight;\n }\n };\n\n useEffect(() => {\n const container = messagesContainerRef.current;\n if (container) {\n container.addEventListener(\"scroll\", handleScroll);\n }\n return () => {\n if (container) {\n container.removeEventListener(\"scroll\", handleScroll);\n }\n };\n }, []);\n\n useEffect(() => {\n const container = messagesContainerRef.current;\n if (!container) {\n return;\n }\n\n const mutationObserver = new MutationObserver(() => {\n if (!isUserScrollUpRef.current) {\n scrollToBottom();\n }\n });\n\n mutationObserver.observe(container, {\n childList: true,\n subtree: true,\n characterData: true,\n });\n\n return () => {\n mutationObserver.disconnect();\n };\n }, []);\n\n useEffect(() => {\n isUserScrollUpRef.current = false;\n scrollToBottom();\n }, [messages.filter((m) => m.isTextMessage() && m.role === Role.User).length]);\n\n return { messagesEndRef, messagesContainerRef };\n}\n"],"mappings":";;;;;AAAA,SAAgB,WAAW,SAAS,cAAc;AAGlD;AAAA,EAGE;AAAA,EACA;AAAA,EACA;AAAA,OA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AM;AACd,UAAM,YAAY,qBAAqB;AACvC,QAAI,WAAW;AACb,gBAAU,iBAAiB,UAAU,YAAY;AAAA,IACnD;AACA,WAAO,MAAM;AACX,UAAI,WAAW;AACb,kBAAU,oBAAoB,UAAU,YAAY;AAAA,MACtD;AAAA,IACF;AAAA,EACF,GAAG,CAAC,CAAC;AAEL,YAAU,MAAM;AACd,UAAM,YAAY,qBAAqB;AACvC,QAAI,CAAC,WAAW;AACd;AAAA,IACF;AAEA,UAAM,mBAAmB,IAAI,iBAAiB,MAAM;AAClD,UAAI,CAAC,kBAAkB,SAAS;AAC9B,uBAAe;AAAA,MACjB;AAAA,IACF,CAAC;AAED,qBAAiB,QAAQ,WAAW;AAAA,MAClC,WAAW;AAAA,MACX,SAAS;AAAA,MACT,eAAe;AAAA,IACjB,CAAC;AAED,WAAO,MAAM;AACX,uBAAiB,WAAW;AAAA,IAC9B;AAAA,EACF,GAAG,CAAC,CAAC;AAEL,YAAU,MAAM;AACd,sBAAkB,UAAU;AAC5B,mBAAe;AAAA,EACjB,GAAG,CAAC,SAAS,OAAO,CAAC,MAAM,EAAE,cAAc,KAAK,EAAE,SAAS,KAAK,IAAI,EAAE,MAAM,CAAC;AAE7E,SAAO,EAAE,gBAAgB,qBAAqB;AAChD;","names":[]}
|
package/dist/chunk-WOUWNTAV.mjs
DELETED
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
CloseIcon,
|
|
3
|
-
LifeBuoyIcon
|
|
4
|
-
} from "./chunk-4T3TMQNJ.mjs";
|
|
5
|
-
|
|
6
|
-
// src/components/help-modal/modal.tsx
|
|
7
|
-
import { useState } from "react";
|
|
8
|
-
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
9
|
-
function CopilotKitHelpModal() {
|
|
10
|
-
const [showHelpModal, setShowHelpModal] = useState(false);
|
|
11
|
-
const [issueDescription, setIssueDescription] = useState("");
|
|
12
|
-
const handleSubmit = () => {
|
|
13
|
-
setShowHelpModal(false);
|
|
14
|
-
};
|
|
15
|
-
const HelpButton = () => /* @__PURE__ */ jsx(
|
|
16
|
-
"button",
|
|
17
|
-
{
|
|
18
|
-
onClick: () => setShowHelpModal(true),
|
|
19
|
-
className: "p-2 bg-transparent rounded-full shadow-lg hover:shadow-xl transition-shadow duration-300 focus:outline-none focus:ring-2 focus:ring-blue-500",
|
|
20
|
-
"aria-label": "Open Help",
|
|
21
|
-
children: /* @__PURE__ */ jsx(LifeBuoyIcon, {})
|
|
22
|
-
}
|
|
23
|
-
);
|
|
24
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
25
|
-
/* @__PURE__ */ jsx(HelpButton, {}),
|
|
26
|
-
showHelpModal && /* @__PURE__ */ jsx(
|
|
27
|
-
"div",
|
|
28
|
-
{
|
|
29
|
-
className: "fixed inset-0 flex items-center justify-center p-4",
|
|
30
|
-
style: { backgroundColor: "rgba(11, 15, 26, 0.5)", zIndex: 99 },
|
|
31
|
-
children: /* @__PURE__ */ jsxs("div", { className: "bg-white rounded-lg shadow-xl max-w-md w-full p-4 flex-col relative", children: [
|
|
32
|
-
/* @__PURE__ */ jsx(
|
|
33
|
-
"button",
|
|
34
|
-
{
|
|
35
|
-
className: "absolute text-gray-400 hover:text-gray-600 focus:outline-none",
|
|
36
|
-
style: { top: "10px", right: "10px" },
|
|
37
|
-
onClick: () => setShowHelpModal(false),
|
|
38
|
-
"aria-label": "Close",
|
|
39
|
-
children: /* @__PURE__ */ jsx(CloseIcon, {})
|
|
40
|
-
}
|
|
41
|
-
),
|
|
42
|
-
/* @__PURE__ */ jsx("div", { className: "w-full flex mb-6 justify-center", children: /* @__PURE__ */ jsx("h2", { className: "text-2xl font-bold", children: "Help Options" }) }),
|
|
43
|
-
/* @__PURE__ */ jsxs("div", { className: "space-y-4 mb-4", children: [
|
|
44
|
-
/* @__PURE__ */ jsx("div", { className: "block w-full text-center py-2 px-4 bg-blue-500 text-white rounded hover:bg-blue-600 transition duration-150 text-sm", children: /* @__PURE__ */ jsx(
|
|
45
|
-
"a",
|
|
46
|
-
{
|
|
47
|
-
href: "https://go.copilotkit.ai/dev-console-support-discord",
|
|
48
|
-
target: "_blank",
|
|
49
|
-
rel: "noopener noreferrer",
|
|
50
|
-
children: "Go to Discord Support Channel (Community Support)"
|
|
51
|
-
}
|
|
52
|
-
) }),
|
|
53
|
-
/* @__PURE__ */ jsx("div", { className: "block w-full text-center py-2 px-4 bg-blue-500 text-white rounded hover:bg-blue-600 transition duration-150 text-sm", children: /* @__PURE__ */ jsx(
|
|
54
|
-
"a",
|
|
55
|
-
{
|
|
56
|
-
href: "https://go.copilotkit.ai/dev-console-support-slack",
|
|
57
|
-
target: "_blank",
|
|
58
|
-
rel: "noopener noreferrer",
|
|
59
|
-
children: "Apply for Priority Direct Slack Support"
|
|
60
|
-
}
|
|
61
|
-
) })
|
|
62
|
-
] })
|
|
63
|
-
] })
|
|
64
|
-
}
|
|
65
|
-
)
|
|
66
|
-
] });
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
export {
|
|
70
|
-
CopilotKitHelpModal
|
|
71
|
-
};
|
|
72
|
-
//# sourceMappingURL=chunk-WOUWNTAV.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/help-modal/modal.tsx"],"sourcesContent":["import React, { useState } from \"react\";\nimport { CloseIcon, LifeBuoyIcon } from \"./icons\";\n\nexport function CopilotKitHelpModal() {\n const [showHelpModal, setShowHelpModal] = useState(false);\n const [issueDescription, setIssueDescription] = useState(\"\");\n\n const handleSubmit = () => {\n // submit issueDescription\n setShowHelpModal(false);\n };\n\n const HelpButton = () => (\n <button\n onClick={() => setShowHelpModal(true)}\n className=\"p-2 bg-transparent rounded-full shadow-lg hover:shadow-xl transition-shadow duration-300 focus:outline-none focus:ring-2 focus:ring-blue-500\"\n aria-label=\"Open Help\"\n >\n <LifeBuoyIcon />\n </button>\n );\n\n return (\n <>\n <HelpButton />\n {showHelpModal && (\n <div\n className=\"fixed inset-0 flex items-center justify-center p-4\"\n style={{ backgroundColor: \"rgba(11, 15, 26, 0.5)\", zIndex: 99 }}\n >\n <div className=\"bg-white rounded-lg shadow-xl max-w-md w-full p-4 flex-col relative\">\n <button\n className=\"absolute text-gray-400 hover:text-gray-600 focus:outline-none\"\n style={{ top: \"10px\", right: \"10px\" }}\n onClick={() => setShowHelpModal(false)}\n aria-label=\"Close\"\n >\n <CloseIcon />\n </button>\n <div className=\"w-full flex mb-6 justify-center\">\n <h2 className=\"text-2xl font-bold\">Help Options</h2>\n </div>\n <div className=\"space-y-4 mb-4\">\n <div className=\"block w-full text-center py-2 px-4 bg-blue-500 text-white rounded hover:bg-blue-600 transition duration-150 text-sm\">\n <a\n href=\"https://go.copilotkit.ai/dev-console-support-discord\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n Go to Discord Support Channel (Community Support)\n </a>\n </div>\n <div className=\"block w-full text-center py-2 px-4 bg-blue-500 text-white rounded hover:bg-blue-600 transition duration-150 text-sm\">\n <a\n href=\"https://go.copilotkit.ai/dev-console-support-slack\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n Apply for Priority Direct Slack Support\n </a>\n </div>\n </div>\n {/*<form onSubmit={handleSubmit} className=\"flex flex-col space-y-4\">*/}\n {/* <div>*/}\n {/* <label htmlFor=\"feedback\" className=\"block text-sm font-medium text-gray-700 mb-1\">*/}\n {/* Let us know what your issue is:*/}\n {/* </label>*/}\n {/* <textarea*/}\n {/* id=\"feedback\"*/}\n {/* rows={4}*/}\n {/* className=\"w-full px-3 py-2 text-gray-700 border rounded-lg focus:outline-none focus:border-blue-500\"*/}\n {/* placeholder=\"A Loom link / screen recording is always great!\"*/}\n {/* onChange={e => setIssueDescription(e.target.value)}*/}\n {/* value={issueDescription}*/}\n {/* ></textarea>*/}\n {/* </div>*/}\n {/* <div className=\"bg-gray-50 px-4 py-3 sm:px-6 sm:flex sm:flex-row-reverse rounded-b-lg\">*/}\n {/* <button*/}\n {/* type=\"submit\"*/}\n {/* 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\"*/}\n {/* >*/}\n {/* Submit*/}\n {/* </button>*/}\n {/* </div>*/}\n {/*</form>*/}\n </div>\n </div>\n )}\n </>\n );\n}\n"],"mappings":";;;;;;AAAA,SAAgB,gBAAgB;AAkB1B,SAKF,UALE,KAwBM,YAxBN;AAfC,SAAS,sBAAsB;AACpC,QAAM,CAAC,eAAe,gBAAgB,IAAI,SAAS,KAAK;AACxD,QAAM,CAAC,kBAAkB,mBAAmB,IAAI,SAAS,EAAE;AAE3D,QAAM,eAAe,MAAM;AAEzB,qBAAiB,KAAK;AAAA,EACxB;AAEA,QAAM,aAAa,MACjB;AAAA,IAAC;AAAA;AAAA,MACC,SAAS,MAAM,iBAAiB,IAAI;AAAA,MACpC,WAAU;AAAA,MACV,cAAW;AAAA,MAEX,8BAAC,gBAAa;AAAA;AAAA,EAChB;AAGF,SACE,iCACE;AAAA,wBAAC,cAAW;AAAA,IACX,iBACC;AAAA,MAAC;AAAA;AAAA,QACC,WAAU;AAAA,QACV,OAAO,EAAE,iBAAiB,yBAAyB,QAAQ,GAAG;AAAA,QAE9D,+BAAC,SAAI,WAAU,uEACb;AAAA;AAAA,YAAC;AAAA;AAAA,cACC,WAAU;AAAA,cACV,OAAO,EAAE,KAAK,QAAQ,OAAO,OAAO;AAAA,cACpC,SAAS,MAAM,iBAAiB,KAAK;AAAA,cACrC,cAAW;AAAA,cAEX,8BAAC,aAAU;AAAA;AAAA,UACb;AAAA,UACA,oBAAC,SAAI,WAAU,mCACb,8BAAC,QAAG,WAAU,sBAAqB,0BAAY,GACjD;AAAA,UACA,qBAAC,SAAI,WAAU,kBACb;AAAA,gCAAC,SAAI,WAAU,uHACb;AAAA,cAAC;AAAA;AAAA,gBACC,MAAK;AAAA,gBACL,QAAO;AAAA,gBACP,KAAI;AAAA,gBACL;AAAA;AAAA,YAED,GACF;AAAA,YACA,oBAAC,SAAI,WAAU,uHACb;AAAA,cAAC;AAAA;AAAA,gBACC,MAAK;AAAA,gBACL,QAAO;AAAA,gBACP,KAAI;AAAA,gBACL;AAAA;AAAA,YAED,GACF;AAAA,aACF;AAAA,WAwBF;AAAA;AAAA,IACF;AAAA,KAEJ;AAEJ;","names":[]}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|