@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.
Files changed (71) hide show
  1. package/CHANGELOG.md +31 -0
  2. package/dist/{chunk-2B57NCBA.mjs → chunk-6GBOJUX4.mjs} +3 -3
  3. package/dist/{chunk-4T3TMQNJ.mjs → chunk-BH6PCAAL.mjs} +38 -2
  4. package/dist/chunk-BH6PCAAL.mjs.map +1 -0
  5. package/dist/{chunk-4LUMV4YO.mjs → chunk-EMQEEXUB.mjs} +8 -3
  6. package/dist/chunk-EMQEEXUB.mjs.map +1 -0
  7. package/dist/{chunk-63ZKP62F.mjs → chunk-H7UVF2NY.mjs} +3 -3
  8. package/dist/chunk-ICGZEGHQ.mjs +155 -0
  9. package/dist/chunk-ICGZEGHQ.mjs.map +1 -0
  10. package/dist/{chunk-DHGDU64D.mjs → chunk-M7MHMZ5O.mjs} +3 -3
  11. package/dist/{chunk-4FIGRRFS.mjs → chunk-PNQVKBPN.mjs} +2 -2
  12. package/dist/{chunk-4FIGRRFS.mjs.map → chunk-PNQVKBPN.mjs.map} +1 -1
  13. package/dist/{chunk-TKFQ7VQR.mjs → chunk-ROVHRIKR.mjs} +2 -2
  14. package/dist/{chunk-VYKDFXGS.mjs → chunk-VUK75M5B.mjs} +2 -2
  15. package/dist/components/chat/Chat.js +124 -5
  16. package/dist/components/chat/Chat.js.map +1 -1
  17. package/dist/components/chat/Chat.mjs +6 -6
  18. package/dist/components/chat/Input.js +7 -2
  19. package/dist/components/chat/Input.js.map +1 -1
  20. package/dist/components/chat/Input.mjs +1 -1
  21. package/dist/components/chat/Modal.js +124 -5
  22. package/dist/components/chat/Modal.js.map +1 -1
  23. package/dist/components/chat/Modal.mjs +7 -7
  24. package/dist/components/chat/Popup.js +124 -5
  25. package/dist/components/chat/Popup.js.map +1 -1
  26. package/dist/components/chat/Popup.mjs +8 -8
  27. package/dist/components/chat/Sidebar.js +124 -5
  28. package/dist/components/chat/Sidebar.js.map +1 -1
  29. package/dist/components/chat/Sidebar.mjs +8 -8
  30. package/dist/components/chat/index.js +124 -5
  31. package/dist/components/chat/index.js.map +1 -1
  32. package/dist/components/chat/index.mjs +9 -9
  33. package/dist/components/dev-console/console.js +117 -3
  34. package/dist/components/dev-console/console.js.map +1 -1
  35. package/dist/components/dev-console/console.mjs +4 -4
  36. package/dist/components/dev-console/index.js +117 -3
  37. package/dist/components/dev-console/index.js.map +1 -1
  38. package/dist/components/dev-console/index.mjs +4 -4
  39. package/dist/components/dev-console/utils.js +1 -1
  40. package/dist/components/dev-console/utils.js.map +1 -1
  41. package/dist/components/dev-console/utils.mjs +1 -1
  42. package/dist/components/help-modal/icons.d.ts +4 -1
  43. package/dist/components/help-modal/icons.js +39 -2
  44. package/dist/components/help-modal/icons.js.map +1 -1
  45. package/dist/components/help-modal/icons.mjs +5 -3
  46. package/dist/components/help-modal/index.js +136 -2
  47. package/dist/components/help-modal/index.js.map +1 -1
  48. package/dist/components/help-modal/index.mjs +2 -2
  49. package/dist/components/help-modal/modal.js +136 -2
  50. package/dist/components/help-modal/modal.js.map +1 -1
  51. package/dist/components/help-modal/modal.mjs +2 -2
  52. package/dist/components/index.js +124 -5
  53. package/dist/components/index.js.map +1 -1
  54. package/dist/components/index.mjs +9 -9
  55. package/dist/index.js +124 -5
  56. package/dist/index.js.map +1 -1
  57. package/dist/index.mjs +9 -9
  58. package/package.json +4 -4
  59. package/src/components/chat/Input.tsx +9 -2
  60. package/src/components/dev-console/utils.ts +1 -1
  61. package/src/components/help-modal/icons.tsx +28 -0
  62. package/src/components/help-modal/modal.tsx +90 -27
  63. package/dist/chunk-4LUMV4YO.mjs.map +0 -1
  64. package/dist/chunk-4T3TMQNJ.mjs.map +0 -1
  65. package/dist/chunk-WOUWNTAV.mjs +0 -72
  66. package/dist/chunk-WOUWNTAV.mjs.map +0 -1
  67. /package/dist/{chunk-2B57NCBA.mjs.map → chunk-6GBOJUX4.mjs.map} +0 -0
  68. /package/dist/{chunk-63ZKP62F.mjs.map → chunk-H7UVF2NY.mjs.map} +0 -0
  69. /package/dist/{chunk-DHGDU64D.mjs.map → chunk-M7MHMZ5O.mjs.map} +0 -0
  70. /package/dist/{chunk-TKFQ7VQR.mjs.map → chunk-ROVHRIKR.mjs.map} +0 -0
  71. /package/dist/{chunk-VYKDFXGS.mjs.map → chunk-VUK75M5B.mjs.map} +0 -0
package/dist/index.mjs CHANGED
@@ -4,18 +4,18 @@ import "./chunk-MMVDU6DF.mjs";
4
4
  import "./chunk-MRFF7GSQ.mjs";
5
5
  import {
6
6
  CopilotSidebar
7
- } from "./chunk-TKFQ7VQR.mjs";
7
+ } from "./chunk-ROVHRIKR.mjs";
8
8
  import "./chunk-WB3YULQ4.mjs";
9
9
  import {
10
10
  CopilotPopup
11
- } from "./chunk-VYKDFXGS.mjs";
12
- import "./chunk-63ZKP62F.mjs";
11
+ } from "./chunk-VUK75M5B.mjs";
12
+ import "./chunk-H7UVF2NY.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-DHGDU64D.mjs";
18
+ } from "./chunk-M7MHMZ5O.mjs";
19
19
  import "./chunk-6INMITFA.mjs";
20
20
  import "./chunk-RU73BEZM.mjs";
21
21
  import "./chunk-V7W6IM2V.mjs";
@@ -24,15 +24,15 @@ import "./chunk-ZABXREBH.mjs";
24
24
  import "./chunk-RJCZRKTV.mjs";
25
25
  import {
26
26
  CopilotDevConsole
27
- } from "./chunk-2B57NCBA.mjs";
27
+ } from "./chunk-6GBOJUX4.mjs";
28
28
  import {
29
29
  shouldShowDevConsole
30
- } from "./chunk-4FIGRRFS.mjs";
30
+ } from "./chunk-PNQVKBPN.mjs";
31
31
  import "./chunk-KXE2JCUH.mjs";
32
- import "./chunk-WOUWNTAV.mjs";
33
- import "./chunk-4T3TMQNJ.mjs";
32
+ import "./chunk-ICGZEGHQ.mjs";
33
+ import "./chunk-BH6PCAAL.mjs";
34
34
  import "./chunk-OTPAZXVR.mjs";
35
- import "./chunk-4LUMV4YO.mjs";
35
+ import "./chunk-EMQEEXUB.mjs";
36
36
  import "./chunk-YQFVRDNC.mjs";
37
37
  import "./chunk-YQ3D5IQV.mjs";
38
38
  import "./chunk-RKPANT3F.mjs";
package/package.json CHANGED
@@ -9,7 +9,7 @@
9
9
  "publishConfig": {
10
10
  "access": "public"
11
11
  },
12
- "version": "1.4.7",
12
+ "version": "1.4.8-coagents-v0-3.1",
13
13
  "sideEffects": [
14
14
  "**/*.css"
15
15
  ],
@@ -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.4.7",
54
- "@copilotkit/runtime-client-gql": "1.4.7",
55
- "@copilotkit/shared": "1.4.7"
53
+ "@copilotkit/react-core": "1.4.8-coagents-v0-3.1",
54
+ "@copilotkit/runtime-client-gql": "1.4.8-coagents-v0-3.1",
55
+ "@copilotkit/shared": "1.4.8-coagents-v0-3.1"
56
56
  },
57
57
  "keywords": [
58
58
  "copilotkit",
@@ -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
- const sendDisabled = inProgress || text.length === 0 || pushToTalkState !== "idle";
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
- send();
72
+ if (canSend()) {
73
+ send();
74
+ }
68
75
  }
69
76
  }}
70
77
  />
@@ -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.scope,
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,12 +1,45 @@
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 handleSubmit = () => {
9
- // submit issueDescription
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
 
@@ -20,6 +53,11 @@ export function CopilotKitHelpModal() {
20
53
  </button>
21
54
  );
22
55
 
56
+ const submitButtonDisabled = useMemo(
57
+ () => submitting || !!emailError || issueDescription == null || issueDescription?.length == 0,
58
+ [submitting, emailError, issueDescription],
59
+ );
60
+
23
61
  return (
24
62
  <>
25
63
  <HelpButton />
@@ -60,29 +98,54 @@ export function CopilotKitHelpModal() {
60
98
  </a>
61
99
  </div>
62
100
  </div>
63
- {/*<form onSubmit={handleSubmit} className="flex flex-col space-y-4">*/}
64
- {/* <div>*/}
65
- {/* <label htmlFor="feedback" className="block text-sm font-medium text-gray-700 mb-1">*/}
66
- {/* Let us know what your issue is:*/}
67
- {/* </label>*/}
68
- {/* <textarea*/}
69
- {/* id="feedback"*/}
70
- {/* rows={4}*/}
71
- {/* className="w-full px-3 py-2 text-gray-700 border rounded-lg focus:outline-none focus:border-blue-500"*/}
72
- {/* placeholder="A Loom link / screen recording is always great!"*/}
73
- {/* onChange={e => setIssueDescription(e.target.value)}*/}
74
- {/* value={issueDescription}*/}
75
- {/* ></textarea>*/}
76
- {/* </div>*/}
77
- {/* <div className="bg-gray-50 px-4 py-3 sm:px-6 sm:flex sm:flex-row-reverse rounded-b-lg">*/}
78
- {/* <button*/}
79
- {/* type="submit"*/}
80
- {/* 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"*/}
81
- {/* >*/}
82
- {/* Submit*/}
83
- {/* </button>*/}
84
- {/* </div>*/}
85
- {/*</form>*/}
101
+ <form onSubmit={handleSubmit} className="flex flex-col space-y-2">
102
+ <div>
103
+ <label htmlFor="feedback" className="block text-sm font-medium text-gray-700 mb-1">
104
+ Let us know what your issue is:
105
+ </label>
106
+ <textarea
107
+ id="feedback"
108
+ rows={4}
109
+ className="w-full px-3 py-2 text-gray-700 border rounded-lg focus:outline-none focus:border-blue-500"
110
+ placeholder="A Loom link / screen recording is always great!"
111
+ onChange={(e) => setIssueDescription(e.target.value)}
112
+ value={issueDescription}
113
+ required
114
+ ></textarea>
115
+ </div>
116
+ <div>
117
+ <label htmlFor="email" className="block text-sm font-medium text-gray-700 mb-1">
118
+ Email (optional):
119
+ </label>
120
+ <input
121
+ type="email"
122
+ id="email"
123
+ className={`w-full px-3 py-2 text-gray-700 border rounded-lg focus:outline-none focus:border-blue-500 ${emailError ? "border-red-500" : ""}`}
124
+ placeholder="Enter your email for follow-up"
125
+ onChange={(e) => {
126
+ setEmail(e.target.value);
127
+ setEmailError("");
128
+ }}
129
+ value={email}
130
+ />
131
+ {emailError && <p className="text-red-500 text-sm mt-1">{emailError}</p>}
132
+ </div>
133
+ <div className="bg-gray-50 px-4 py-4 sm:px-6 sm:flex sm:flex-row-reverse rounded-b-lg">
134
+ <button
135
+ type="submit"
136
+ onClick={handleSubmit}
137
+ disabled={submitButtonDisabled}
138
+ style={
139
+ submitButtonDisabled
140
+ ? { backgroundColor: "rgb(216, 216, 216)", color: "rgb(129, 129, 129)" }
141
+ : undefined
142
+ }
143
+ 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"
144
+ >
145
+ {submitting ? <LoadingSpinnerIcon color="white" /> : "Submit"}
146
+ </button>
147
+ </div>
148
+ </form>
86
149
  </div>
87
150
  </div>
88
151
  )}
@@ -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,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":[]}