@copilotkit/react-ui 0.0.0-feat-dynamic-copilotcloud-qa-20250117190454
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 +2436 -0
- package/README.md +46 -0
- package/dist/chunk-34FREWVK.mjs +180 -0
- package/dist/chunk-34FREWVK.mjs.map +1 -0
- package/dist/chunk-3VNMQWGT.mjs +25 -0
- package/dist/chunk-3VNMQWGT.mjs.map +1 -0
- package/dist/chunk-3XAXY2Z3.mjs +18 -0
- package/dist/chunk-3XAXY2Z3.mjs.map +1 -0
- package/dist/chunk-54JAUBUJ.mjs +26 -0
- package/dist/chunk-54JAUBUJ.mjs.map +1 -0
- package/dist/chunk-B23XDGH4.mjs +30 -0
- package/dist/chunk-B23XDGH4.mjs.map +1 -0
- package/dist/chunk-BH6PCAAL.mjs +81 -0
- package/dist/chunk-BH6PCAAL.mjs.map +1 -0
- package/dist/chunk-CBBFRI3Q.mjs +81 -0
- package/dist/chunk-CBBFRI3Q.mjs.map +1 -0
- package/dist/chunk-EFZPSZWO.mjs +1 -0
- package/dist/chunk-EFZPSZWO.mjs.map +1 -0
- package/dist/chunk-EMQEEXUB.mjs +97 -0
- package/dist/chunk-EMQEEXUB.mjs.map +1 -0
- package/dist/chunk-F2W5FD7L.mjs +232 -0
- package/dist/chunk-F2W5FD7L.mjs.map +1 -0
- package/dist/chunk-F7VWGY77.mjs +22 -0
- package/dist/chunk-F7VWGY77.mjs.map +1 -0
- package/dist/chunk-FZC7X5PK.mjs +262 -0
- package/dist/chunk-FZC7X5PK.mjs.map +1 -0
- package/dist/chunk-HEIDCT7I.mjs +10 -0
- package/dist/chunk-HEIDCT7I.mjs.map +1 -0
- package/dist/chunk-I7MG52I5.mjs +314 -0
- package/dist/chunk-I7MG52I5.mjs.map +1 -0
- package/dist/chunk-IU3WTXLQ.mjs +1 -0
- package/dist/chunk-IU3WTXLQ.mjs.map +1 -0
- package/dist/chunk-KXE2JCUH.mjs +1 -0
- package/dist/chunk-KXE2JCUH.mjs.map +1 -0
- package/dist/chunk-MMVDU6DF.mjs +1 -0
- package/dist/chunk-MMVDU6DF.mjs.map +1 -0
- package/dist/chunk-MRXNTQOX.mjs +59 -0
- package/dist/chunk-MRXNTQOX.mjs.map +1 -0
- package/dist/chunk-O6JFOQQA.mjs +21 -0
- package/dist/chunk-O6JFOQQA.mjs.map +1 -0
- package/dist/chunk-OFYI4UU4.mjs +35 -0
- package/dist/chunk-OFYI4UU4.mjs.map +1 -0
- package/dist/chunk-OTPAZXVR.mjs +92 -0
- package/dist/chunk-OTPAZXVR.mjs.map +1 -0
- package/dist/chunk-P5A3A5FO.mjs +112 -0
- package/dist/chunk-P5A3A5FO.mjs.map +1 -0
- package/dist/chunk-PNQVKBPN.mjs +146 -0
- package/dist/chunk-PNQVKBPN.mjs.map +1 -0
- package/dist/chunk-RJCZRKTV.mjs +106 -0
- package/dist/chunk-RJCZRKTV.mjs.map +1 -0
- package/dist/chunk-RQNJNK2W.mjs +25 -0
- package/dist/chunk-RQNJNK2W.mjs.map +1 -0
- package/dist/chunk-S5MBUNGN.mjs +140 -0
- package/dist/chunk-S5MBUNGN.mjs.map +1 -0
- package/dist/chunk-SQMEPWVT.mjs +1 -0
- package/dist/chunk-SQMEPWVT.mjs.map +1 -0
- package/dist/chunk-T26KLXLH.mjs +1 -0
- package/dist/chunk-T26KLXLH.mjs.map +1 -0
- package/dist/chunk-TI7SY2RI.mjs +164 -0
- package/dist/chunk-TI7SY2RI.mjs.map +1 -0
- package/dist/chunk-UPTB2MVO.mjs +395 -0
- package/dist/chunk-UPTB2MVO.mjs.map +1 -0
- package/dist/chunk-UWWMAJ7R.mjs +100 -0
- package/dist/chunk-UWWMAJ7R.mjs.map +1 -0
- package/dist/chunk-V7W6IM2V.mjs +1 -0
- package/dist/chunk-V7W6IM2V.mjs.map +1 -0
- package/dist/chunk-VEC45H6Q.mjs +18 -0
- package/dist/chunk-VEC45H6Q.mjs.map +1 -0
- package/dist/chunk-VKVNMHM5.mjs +105 -0
- package/dist/chunk-VKVNMHM5.mjs.map +1 -0
- package/dist/chunk-WB3YULQ4.mjs +1 -0
- package/dist/chunk-WB3YULQ4.mjs.map +1 -0
- package/dist/chunk-YAGE7RCE.mjs +118 -0
- package/dist/chunk-YAGE7RCE.mjs.map +1 -0
- package/dist/chunk-YQ3D5IQV.mjs +75 -0
- package/dist/chunk-YQ3D5IQV.mjs.map +1 -0
- package/dist/chunk-YQFVRDNC.mjs +53 -0
- package/dist/chunk-YQFVRDNC.mjs.map +1 -0
- package/dist/chunk-Z2UZSN3K.mjs +29 -0
- package/dist/chunk-Z2UZSN3K.mjs.map +1 -0
- package/dist/components/chat/Button.d.ts +7 -0
- package/dist/components/chat/Button.js +71 -0
- package/dist/components/chat/Button.js.map +1 -0
- package/dist/components/chat/Button.mjs +10 -0
- package/dist/components/chat/Button.mjs.map +1 -0
- package/dist/components/chat/Chat.d.ts +156 -0
- package/dist/components/chat/Chat.js +2540 -0
- package/dist/components/chat/Chat.js.map +1 -0
- package/dist/components/chat/Chat.mjs +36 -0
- package/dist/components/chat/Chat.mjs.map +1 -0
- package/dist/components/chat/ChatContext.d.ts +105 -0
- package/dist/components/chat/ChatContext.js +279 -0
- package/dist/components/chat/ChatContext.js.map +1 -0
- package/dist/components/chat/ChatContext.mjs +13 -0
- package/dist/components/chat/ChatContext.mjs.map +1 -0
- package/dist/components/chat/CodeBlock.d.ts +14 -0
- package/dist/components/chat/CodeBlock.js +523 -0
- package/dist/components/chat/CodeBlock.js.map +1 -0
- package/dist/components/chat/CodeBlock.mjs +14 -0
- package/dist/components/chat/CodeBlock.mjs.map +1 -0
- package/dist/components/chat/Header.d.ts +7 -0
- package/dist/components/chat/Header.js +64 -0
- package/dist/components/chat/Header.js.map +1 -0
- package/dist/components/chat/Header.mjs +10 -0
- package/dist/components/chat/Header.mjs.map +1 -0
- package/dist/components/chat/Icons.d.ts +18 -0
- package/dist/components/chat/Icons.js +321 -0
- package/dist/components/chat/Icons.js.map +1 -0
- package/dist/components/chat/Icons.mjs +32 -0
- package/dist/components/chat/Icons.mjs.map +1 -0
- package/dist/components/chat/Input.d.ts +7 -0
- package/dist/components/chat/Input.js +324 -0
- package/dist/components/chat/Input.js.map +1 -0
- package/dist/components/chat/Input.mjs +12 -0
- package/dist/components/chat/Input.mjs.map +1 -0
- package/dist/components/chat/Markdown.d.ts +8 -0
- package/dist/components/chat/Markdown.js +583 -0
- package/dist/components/chat/Markdown.js.map +1 -0
- package/dist/components/chat/Markdown.mjs +11 -0
- package/dist/components/chat/Markdown.mjs.map +1 -0
- package/dist/components/chat/Messages.d.ts +12 -0
- package/dist/components/chat/Messages.js +227 -0
- package/dist/components/chat/Messages.js.map +1 -0
- package/dist/components/chat/Messages.mjs +12 -0
- package/dist/components/chat/Messages.mjs.map +1 -0
- package/dist/components/chat/Modal.d.ts +51 -0
- package/dist/components/chat/Modal.js +2743 -0
- package/dist/components/chat/Modal.js.map +1 -0
- package/dist/components/chat/Modal.mjs +36 -0
- package/dist/components/chat/Modal.mjs.map +1 -0
- package/dist/components/chat/Popup.d.ts +13 -0
- package/dist/components/chat/Popup.js +2754 -0
- package/dist/components/chat/Popup.js.map +1 -0
- package/dist/components/chat/Popup.mjs +37 -0
- package/dist/components/chat/Popup.mjs.map +1 -0
- package/dist/components/chat/Response.d.ts +7 -0
- package/dist/components/chat/Response.js +64 -0
- package/dist/components/chat/Response.js.map +1 -0
- package/dist/components/chat/Response.mjs +10 -0
- package/dist/components/chat/Response.mjs.map +1 -0
- package/dist/components/chat/Sidebar.d.ts +13 -0
- package/dist/components/chat/Sidebar.js +2763 -0
- package/dist/components/chat/Sidebar.js.map +1 -0
- package/dist/components/chat/Sidebar.mjs +37 -0
- package/dist/components/chat/Sidebar.mjs.map +1 -0
- package/dist/components/chat/Suggestion.d.ts +14 -0
- package/dist/components/chat/Suggestion.js +181 -0
- package/dist/components/chat/Suggestion.js.map +1 -0
- package/dist/components/chat/Suggestion.mjs +11 -0
- package/dist/components/chat/Suggestion.mjs.map +1 -0
- package/dist/components/chat/Textarea.d.ts +13 -0
- package/dist/components/chat/Textarea.js +73 -0
- package/dist/components/chat/Textarea.js.map +1 -0
- package/dist/components/chat/Textarea.mjs +8 -0
- package/dist/components/chat/Textarea.mjs.map +1 -0
- package/dist/components/chat/Window.d.ts +7 -0
- package/dist/components/chat/Window.js +164 -0
- package/dist/components/chat/Window.js.map +1 -0
- package/dist/components/chat/Window.mjs +10 -0
- package/dist/components/chat/Window.mjs.map +1 -0
- package/dist/components/chat/index.d.ts +14 -0
- package/dist/components/chat/index.js +2784 -0
- package/dist/components/chat/index.js.map +1 -0
- package/dist/components/chat/index.mjs +58 -0
- package/dist/components/chat/index.mjs.map +1 -0
- package/dist/components/chat/messages/AssistantMessage.d.ts +7 -0
- package/dist/components/chat/messages/AssistantMessage.js +615 -0
- package/dist/components/chat/messages/AssistantMessage.js.map +1 -0
- package/dist/components/chat/messages/AssistantMessage.mjs +13 -0
- package/dist/components/chat/messages/AssistantMessage.mjs.map +1 -0
- package/dist/components/chat/messages/RenderActionExecutionMessage.d.ts +7 -0
- package/dist/components/chat/messages/RenderActionExecutionMessage.js +136 -0
- package/dist/components/chat/messages/RenderActionExecutionMessage.js.map +1 -0
- package/dist/components/chat/messages/RenderActionExecutionMessage.mjs +8 -0
- package/dist/components/chat/messages/RenderActionExecutionMessage.mjs.map +1 -0
- package/dist/components/chat/messages/RenderAgentStateMessage.d.ts +7 -0
- package/dist/components/chat/messages/RenderAgentStateMessage.js +124 -0
- package/dist/components/chat/messages/RenderAgentStateMessage.js.map +1 -0
- package/dist/components/chat/messages/RenderAgentStateMessage.mjs +8 -0
- package/dist/components/chat/messages/RenderAgentStateMessage.mjs.map +1 -0
- package/dist/components/chat/messages/RenderResultMessage.d.ts +7 -0
- package/dist/components/chat/messages/RenderResultMessage.js +46 -0
- package/dist/components/chat/messages/RenderResultMessage.js.map +1 -0
- package/dist/components/chat/messages/RenderResultMessage.mjs +8 -0
- package/dist/components/chat/messages/RenderResultMessage.mjs.map +1 -0
- package/dist/components/chat/messages/RenderTextMessage.d.ts +7 -0
- package/dist/components/chat/messages/RenderTextMessage.js +59 -0
- package/dist/components/chat/messages/RenderTextMessage.js.map +1 -0
- package/dist/components/chat/messages/RenderTextMessage.mjs +8 -0
- package/dist/components/chat/messages/RenderTextMessage.mjs.map +1 -0
- package/dist/components/chat/messages/UserMessage.d.ts +7 -0
- package/dist/components/chat/messages/UserMessage.js +34 -0
- package/dist/components/chat/messages/UserMessage.js.map +1 -0
- package/dist/components/chat/messages/UserMessage.mjs +8 -0
- package/dist/components/chat/messages/UserMessage.mjs.map +1 -0
- package/dist/components/chat/props.d.ts +81 -0
- package/dist/components/chat/props.js +19 -0
- package/dist/components/chat/props.js.map +1 -0
- package/dist/components/chat/props.mjs +2 -0
- package/dist/components/chat/props.mjs.map +1 -0
- package/dist/components/dev-console/console.d.ts +10 -0
- package/dist/components/dev-console/console.js +720 -0
- package/dist/components/dev-console/console.js.map +1 -0
- package/dist/components/dev-console/console.mjs +17 -0
- package/dist/components/dev-console/console.mjs.map +1 -0
- package/dist/components/dev-console/icons.d.ts +9 -0
- package/dist/components/dev-console/icons.js +120 -0
- package/dist/components/dev-console/icons.js.map +1 -0
- package/dist/components/dev-console/icons.mjs +16 -0
- package/dist/components/dev-console/icons.mjs.map +1 -0
- package/dist/components/dev-console/index.d.ts +5 -0
- package/dist/components/dev-console/index.js +720 -0
- package/dist/components/dev-console/index.js.map +1 -0
- package/dist/components/dev-console/index.mjs +18 -0
- package/dist/components/dev-console/index.mjs.map +1 -0
- package/dist/components/dev-console/types.d.ts +9 -0
- package/dist/components/dev-console/types.js +19 -0
- package/dist/components/dev-console/types.js.map +1 -0
- package/dist/components/dev-console/types.mjs +1 -0
- package/dist/components/dev-console/types.mjs.map +1 -0
- package/dist/components/dev-console/utils.d.ts +10 -0
- package/dist/components/dev-console/utils.js +188 -0
- package/dist/components/dev-console/utils.js.map +1 -0
- package/dist/components/dev-console/utils.mjs +16 -0
- package/dist/components/dev-console/utils.mjs.map +1 -0
- package/dist/components/help-modal/icons.d.ts +9 -0
- package/dist/components/help-modal/icons.js +107 -0
- package/dist/components/help-modal/icons.js.map +1 -0
- package/dist/components/help-modal/icons.mjs +12 -0
- package/dist/components/help-modal/icons.mjs.map +1 -0
- package/dist/components/help-modal/index.d.ts +2 -0
- package/dist/components/help-modal/index.js +255 -0
- package/dist/components/help-modal/index.js.map +1 -0
- package/dist/components/help-modal/index.mjs +10 -0
- package/dist/components/help-modal/index.mjs.map +1 -0
- package/dist/components/help-modal/modal.d.ts +5 -0
- package/dist/components/help-modal/modal.js +253 -0
- package/dist/components/help-modal/modal.js.map +1 -0
- package/dist/components/help-modal/modal.mjs +9 -0
- package/dist/components/help-modal/modal.mjs.map +1 -0
- package/dist/components/index.d.ts +17 -0
- package/dist/components/index.js +2788 -0
- package/dist/components/index.js.map +1 -0
- package/dist/components/index.mjs +65 -0
- package/dist/components/index.mjs.map +1 -0
- package/dist/context/index.d.ts +2 -0
- package/dist/context/index.js +19 -0
- package/dist/context/index.js.map +1 -0
- package/dist/context/index.mjs +2 -0
- package/dist/context/index.mjs.map +1 -0
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/index.js +55 -0
- package/dist/hooks/index.js.map +1 -0
- package/dist/hooks/index.mjs +9 -0
- package/dist/hooks/index.mjs.map +1 -0
- package/dist/hooks/use-copilot-chat-suggestions.d.ts +83 -0
- package/dist/hooks/use-copilot-chat-suggestions.js +53 -0
- package/dist/hooks/use-copilot-chat-suggestions.js.map +1 -0
- package/dist/hooks/use-copilot-chat-suggestions.mjs +8 -0
- package/dist/hooks/use-copilot-chat-suggestions.mjs.map +1 -0
- package/dist/hooks/use-copy-to-clipboard.d.ts +9 -0
- package/dist/hooks/use-copy-to-clipboard.js +60 -0
- package/dist/hooks/use-copy-to-clipboard.js.map +1 -0
- package/dist/hooks/use-copy-to-clipboard.mjs +8 -0
- package/dist/hooks/use-copy-to-clipboard.mjs.map +1 -0
- package/dist/hooks/use-push-to-talk.d.ts +19 -0
- package/dist/hooks/use-push-to-talk.js +195 -0
- package/dist/hooks/use-push-to-talk.js.map +1 -0
- package/dist/hooks/use-push-to-talk.mjs +12 -0
- package/dist/hooks/use-push-to-talk.mjs.map +1 -0
- package/dist/index.css +751 -0
- package/dist/index.css.map +1 -0
- package/dist/index.d.ts +19 -0
- package/dist/index.js +2816 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +73 -0
- package/dist/index.mjs.map +1 -0
- package/dist/lib/utils.d.ts +4 -0
- package/dist/lib/utils.js +76 -0
- package/dist/lib/utils.js.map +1 -0
- package/dist/lib/utils.mjs +34 -0
- package/dist/lib/utils.mjs.map +1 -0
- package/dist/lib/utils.test.d.ts +2 -0
- package/dist/lib/utils.test.js +9 -0
- package/dist/lib/utils.test.js.map +1 -0
- package/dist/lib/utils.test.mjs +7 -0
- package/dist/lib/utils.test.mjs.map +1 -0
- package/dist/types/css.d.ts +16 -0
- package/dist/types/css.js +19 -0
- package/dist/types/css.js.map +1 -0
- package/dist/types/css.mjs +1 -0
- package/dist/types/css.mjs.map +1 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/index.js +19 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/index.mjs +2 -0
- package/dist/types/index.mjs.map +1 -0
- package/dist/types/suggestions.d.ts +8 -0
- package/dist/types/suggestions.js +19 -0
- package/dist/types/suggestions.js.map +1 -0
- package/dist/types/suggestions.mjs +1 -0
- package/dist/types/suggestions.mjs.map +1 -0
- package/jest.config.js +5 -0
- package/package.json +78 -0
- package/postcss.config.js +60 -0
- package/src/components/chat/Button.tsx +18 -0
- package/src/components/chat/Chat.tsx +541 -0
- package/src/components/chat/ChatContext.tsx +188 -0
- package/src/components/chat/CodeBlock.tsx +408 -0
- package/src/components/chat/Header.tsx +15 -0
- package/src/components/chat/Icons.tsx +223 -0
- package/src/components/chat/Input.tsx +100 -0
- package/src/components/chat/Markdown.tsx +80 -0
- package/src/components/chat/Messages.tsx +188 -0
- package/src/components/chat/Modal.tsx +124 -0
- package/src/components/chat/Popup.tsx +57 -0
- package/src/components/chat/Response.tsx +12 -0
- package/src/components/chat/Sidebar.tsx +74 -0
- package/src/components/chat/Suggestion.tsx +125 -0
- package/src/components/chat/Textarea.tsx +61 -0
- package/src/components/chat/Window.tsx +153 -0
- package/src/components/chat/index.tsx +8 -0
- package/src/components/chat/messages/AssistantMessage.tsx +20 -0
- package/src/components/chat/messages/RenderActionExecutionMessage.tsx +122 -0
- package/src/components/chat/messages/RenderAgentStateMessage.tsx +112 -0
- package/src/components/chat/messages/RenderResultMessage.tsx +17 -0
- package/src/components/chat/messages/RenderTextMessage.tsx +29 -0
- package/src/components/chat/messages/UserMessage.tsx +5 -0
- package/src/components/chat/props.ts +92 -0
- package/src/components/dev-console/console.tsx +281 -0
- package/src/components/dev-console/icons.tsx +92 -0
- package/src/components/dev-console/index.tsx +2 -0
- package/src/components/dev-console/types.ts +7 -0
- package/src/components/dev-console/utils.ts +162 -0
- package/src/components/help-modal/icons.tsx +68 -0
- package/src/components/help-modal/index.tsx +1 -0
- package/src/components/help-modal/modal.tsx +164 -0
- package/src/components/index.ts +2 -0
- package/src/context/index.ts +1 -0
- package/src/css/animations.css +35 -0
- package/src/css/button.css +56 -0
- package/src/css/colors.css +12 -0
- package/src/css/console.css +134 -0
- package/src/css/header.css +43 -0
- package/src/css/input.css +89 -0
- package/src/css/markdown.css +136 -0
- package/src/css/messages.css +73 -0
- package/src/css/panel.css +38 -0
- package/src/css/popup.css +22 -0
- package/src/css/response.css +26 -0
- package/src/css/sidebar.css +34 -0
- package/src/css/suggestions.css +35 -0
- package/src/css/window.css +60 -0
- package/src/hooks/index.ts +1 -0
- package/src/hooks/use-copilot-chat-suggestions.tsx +112 -0
- package/src/hooks/use-copy-to-clipboard.tsx +29 -0
- package/src/hooks/use-push-to-talk.tsx +166 -0
- package/src/index.tsx +7 -0
- package/src/lib/utils.test.ts +7 -0
- package/src/lib/utils.ts +27 -0
- package/src/styles.css +14 -0
- package/src/types/css.ts +15 -0
- package/src/types/index.ts +1 -0
- package/src/types/suggestions.ts +6 -0
- package/tailwind.config.js +7 -0
- package/tsconfig.json +12 -0
- package/tsup.config.ts +16 -0
- package/typedoc.json +4 -0
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
import React, { useMemo, useState } from "react";
|
|
2
|
+
import * as DefaultIcons from "./Icons";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Icons for CopilotChat component.
|
|
6
|
+
*/
|
|
7
|
+
export interface CopilotChatIcons {
|
|
8
|
+
/**
|
|
9
|
+
* The icon to use for the open chat button.
|
|
10
|
+
* @default <OpenIcon />
|
|
11
|
+
*/
|
|
12
|
+
openIcon?: React.ReactNode;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* The icon to use for the close chat button.
|
|
16
|
+
* @default <CloseIcon />
|
|
17
|
+
*/
|
|
18
|
+
closeIcon?: React.ReactNode;
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* The icon to use for the close chat button in the header.
|
|
22
|
+
* @default <HeaderCloseIcon />
|
|
23
|
+
*/
|
|
24
|
+
headerCloseIcon?: React.ReactNode;
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* The icon to use for the send button.
|
|
28
|
+
* @default <SendIcon />
|
|
29
|
+
*/
|
|
30
|
+
sendIcon?: React.ReactNode;
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* The icon to use for the activity indicator.
|
|
34
|
+
* @default <ActivityIcon />
|
|
35
|
+
*/
|
|
36
|
+
activityIcon?: React.ReactNode;
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* The icon to use for the spinner.
|
|
40
|
+
* @default <SpinnerIcon />
|
|
41
|
+
*/
|
|
42
|
+
spinnerIcon?: React.ReactNode;
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* The icon to use for the stop button.
|
|
46
|
+
* @default <StopIcon />
|
|
47
|
+
*/
|
|
48
|
+
stopIcon?: React.ReactNode;
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* The icon to use for the regenerate button.
|
|
52
|
+
* @default <RegenerateIcon />
|
|
53
|
+
*/
|
|
54
|
+
regenerateIcon?: React.ReactNode;
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* The icons to use for push to talk.
|
|
58
|
+
* @default <PushToTalkIcon />
|
|
59
|
+
*/
|
|
60
|
+
|
|
61
|
+
pushToTalkIcon?: React.ReactNode;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Labels for CopilotChat component.
|
|
66
|
+
*/
|
|
67
|
+
export interface CopilotChatLabels {
|
|
68
|
+
/**
|
|
69
|
+
* The initial message(s) to display in the chat window.
|
|
70
|
+
*/
|
|
71
|
+
initial?: string | string[];
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* The title to display in the header.
|
|
75
|
+
* @default "CopilotKit"
|
|
76
|
+
*/
|
|
77
|
+
title?: string;
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* The placeholder to display in the input.
|
|
81
|
+
* @default "Type a message..."
|
|
82
|
+
*/
|
|
83
|
+
placeholder?: string;
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* The message to display when an error occurs.
|
|
87
|
+
* @default "❌ An error occurred. Please try again."
|
|
88
|
+
*/
|
|
89
|
+
error?: string;
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* The label to display on the stop button.
|
|
93
|
+
* @default "Stop generating"
|
|
94
|
+
*/
|
|
95
|
+
stopGenerating?: string;
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* The label to display on the regenerate button.
|
|
99
|
+
* @default "Regenerate response"
|
|
100
|
+
*/
|
|
101
|
+
regenerateResponse?: string;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
interface ChatContext {
|
|
105
|
+
labels: Required<CopilotChatLabels>;
|
|
106
|
+
icons: Required<CopilotChatIcons>;
|
|
107
|
+
open: boolean;
|
|
108
|
+
setOpen: (open: boolean) => void;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
export const ChatContext = React.createContext<ChatContext | undefined>(undefined);
|
|
112
|
+
|
|
113
|
+
export function useChatContext(): ChatContext {
|
|
114
|
+
const context = React.useContext(ChatContext);
|
|
115
|
+
if (context === undefined) {
|
|
116
|
+
throw new Error(
|
|
117
|
+
"Context not found. Did you forget to wrap your app in a <ChatContextProvider> component?",
|
|
118
|
+
);
|
|
119
|
+
}
|
|
120
|
+
return context;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
interface ChatContextProps {
|
|
124
|
+
// temperature?: number;
|
|
125
|
+
// instructions?: string;
|
|
126
|
+
// maxFeedback?: number;
|
|
127
|
+
labels?: CopilotChatLabels;
|
|
128
|
+
icons?: CopilotChatIcons;
|
|
129
|
+
children?: React.ReactNode;
|
|
130
|
+
open: boolean;
|
|
131
|
+
setOpen: (open: boolean) => void;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
export const ChatContextProvider = ({
|
|
135
|
+
// temperature,
|
|
136
|
+
// instructions,
|
|
137
|
+
// maxFeedback,
|
|
138
|
+
labels,
|
|
139
|
+
icons,
|
|
140
|
+
children,
|
|
141
|
+
open,
|
|
142
|
+
setOpen,
|
|
143
|
+
}: ChatContextProps) => {
|
|
144
|
+
const memoizedLabels = useMemo(
|
|
145
|
+
() => ({
|
|
146
|
+
...{
|
|
147
|
+
initial: "",
|
|
148
|
+
title: "CopilotKit",
|
|
149
|
+
placeholder: "Type a message...",
|
|
150
|
+
error: "❌ An error occurred. Please try again.",
|
|
151
|
+
stopGenerating: "Stop generating",
|
|
152
|
+
regenerateResponse: "Regenerate response",
|
|
153
|
+
},
|
|
154
|
+
...labels,
|
|
155
|
+
}),
|
|
156
|
+
[labels],
|
|
157
|
+
);
|
|
158
|
+
|
|
159
|
+
const memoizedIcons = useMemo(
|
|
160
|
+
() => ({
|
|
161
|
+
...{
|
|
162
|
+
openIcon: DefaultIcons.OpenIcon,
|
|
163
|
+
closeIcon: DefaultIcons.CloseIcon,
|
|
164
|
+
headerCloseIcon: DefaultIcons.HeaderCloseIcon,
|
|
165
|
+
sendIcon: DefaultIcons.SendIcon,
|
|
166
|
+
activityIcon: DefaultIcons.ActivityIcon,
|
|
167
|
+
spinnerIcon: DefaultIcons.SpinnerIcon,
|
|
168
|
+
stopIcon: DefaultIcons.StopIcon,
|
|
169
|
+
regenerateIcon: DefaultIcons.RegenerateIcon,
|
|
170
|
+
pushToTalkIcon: DefaultIcons.PushToTalkIcon,
|
|
171
|
+
},
|
|
172
|
+
...icons,
|
|
173
|
+
}),
|
|
174
|
+
[icons],
|
|
175
|
+
);
|
|
176
|
+
|
|
177
|
+
const context = useMemo(
|
|
178
|
+
() => ({
|
|
179
|
+
labels: memoizedLabels,
|
|
180
|
+
icons: memoizedIcons,
|
|
181
|
+
open,
|
|
182
|
+
setOpen,
|
|
183
|
+
}),
|
|
184
|
+
[memoizedLabels, memoizedIcons, open, setOpen],
|
|
185
|
+
);
|
|
186
|
+
|
|
187
|
+
return <ChatContext.Provider value={context}>{children}</ChatContext.Provider>;
|
|
188
|
+
};
|
|
@@ -0,0 +1,408 @@
|
|
|
1
|
+
import { FC, memo } from "react";
|
|
2
|
+
import { Prism as SyntaxHighlighter } from "react-syntax-highlighter";
|
|
3
|
+
import { useCopyToClipboard } from "../../hooks/use-copy-to-clipboard";
|
|
4
|
+
import { CheckIcon, CopyIcon, DownloadIcon } from "./Icons";
|
|
5
|
+
|
|
6
|
+
interface CodeActionButtonProps {
|
|
7
|
+
onClick: () => void;
|
|
8
|
+
children: React.ReactNode;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
interface Props {
|
|
12
|
+
language: string;
|
|
13
|
+
value: string;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
interface languageMap {
|
|
17
|
+
[key: string]: string | undefined;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export const programmingLanguages: languageMap = {
|
|
21
|
+
javascript: ".js",
|
|
22
|
+
python: ".py",
|
|
23
|
+
java: ".java",
|
|
24
|
+
c: ".c",
|
|
25
|
+
cpp: ".cpp",
|
|
26
|
+
"c++": ".cpp",
|
|
27
|
+
"c#": ".cs",
|
|
28
|
+
ruby: ".rb",
|
|
29
|
+
php: ".php",
|
|
30
|
+
swift: ".swift",
|
|
31
|
+
"objective-c": ".m",
|
|
32
|
+
kotlin: ".kt",
|
|
33
|
+
typescript: ".ts",
|
|
34
|
+
go: ".go",
|
|
35
|
+
perl: ".pl",
|
|
36
|
+
rust: ".rs",
|
|
37
|
+
scala: ".scala",
|
|
38
|
+
haskell: ".hs",
|
|
39
|
+
lua: ".lua",
|
|
40
|
+
shell: ".sh",
|
|
41
|
+
sql: ".sql",
|
|
42
|
+
html: ".html",
|
|
43
|
+
css: ".css",
|
|
44
|
+
// add more file extensions here, make sure the key is same as language prop in CodeBlock.tsx component
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
export const generateRandomString = (length: number, lowercase = false) => {
|
|
48
|
+
const chars = "ABCDEFGHJKLMNPQRSTUVWXY3456789"; // excluding similar looking characters like Z, 2, I, 1, O, 0
|
|
49
|
+
let result = "";
|
|
50
|
+
for (let i = 0; i < length; i++) {
|
|
51
|
+
result += chars.charAt(Math.floor(Math.random() * chars.length));
|
|
52
|
+
}
|
|
53
|
+
return lowercase ? result.toLowerCase() : result;
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
const CodeBlock: FC<Props> = memo(({ language, value }) => {
|
|
57
|
+
const { isCopied, copyToClipboard } = useCopyToClipboard({ timeout: 2000 });
|
|
58
|
+
|
|
59
|
+
const downloadAsFile = () => {
|
|
60
|
+
if (typeof window === "undefined") {
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
const fileExtension = programmingLanguages[language] || ".file";
|
|
64
|
+
const suggestedFileName = `file-${generateRandomString(3, true)}${fileExtension}`;
|
|
65
|
+
const fileName = window.prompt("Enter file name" || "", suggestedFileName);
|
|
66
|
+
|
|
67
|
+
if (!fileName) {
|
|
68
|
+
// User pressed cancel on prompt.
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
const blob = new Blob([value], { type: "text/plain" });
|
|
73
|
+
const url = URL.createObjectURL(blob);
|
|
74
|
+
const link = document.createElement("a");
|
|
75
|
+
link.download = fileName;
|
|
76
|
+
link.href = url;
|
|
77
|
+
link.style.display = "none";
|
|
78
|
+
document.body.appendChild(link);
|
|
79
|
+
link.click();
|
|
80
|
+
document.body.removeChild(link);
|
|
81
|
+
URL.revokeObjectURL(url);
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
const onCopy = () => {
|
|
85
|
+
if (isCopied) return;
|
|
86
|
+
copyToClipboard(value);
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
return (
|
|
90
|
+
<div className="copilotKitCodeBlock">
|
|
91
|
+
<div className="copilotKitCodeBlockToolbar">
|
|
92
|
+
<span className="copilotKitCodeBlockToolbarLanguage">{language}</span>
|
|
93
|
+
<div className="copilotKitCodeBlockToolbarButtons">
|
|
94
|
+
<button className="copilotKitCodeBlockToolbarButton" onClick={downloadAsFile}>
|
|
95
|
+
<DownloadIcon />
|
|
96
|
+
<span className="sr-only">Download</span>
|
|
97
|
+
</button>
|
|
98
|
+
<button className="copilotKitCodeBlockToolbarButton" onClick={onCopy}>
|
|
99
|
+
{isCopied ? <CheckIcon /> : <CopyIcon />}
|
|
100
|
+
<span className="sr-only">Copy code</span>
|
|
101
|
+
</button>
|
|
102
|
+
</div>
|
|
103
|
+
</div>
|
|
104
|
+
<SyntaxHighlighter
|
|
105
|
+
language={language}
|
|
106
|
+
style={highlightStyle}
|
|
107
|
+
PreTag="div"
|
|
108
|
+
customStyle={{
|
|
109
|
+
margin: 0,
|
|
110
|
+
borderBottomLeftRadius: "0.375rem",
|
|
111
|
+
borderBottomRightRadius: "0.375rem",
|
|
112
|
+
}}
|
|
113
|
+
>
|
|
114
|
+
{value}
|
|
115
|
+
</SyntaxHighlighter>
|
|
116
|
+
</div>
|
|
117
|
+
);
|
|
118
|
+
});
|
|
119
|
+
CodeBlock.displayName = "CodeBlock";
|
|
120
|
+
|
|
121
|
+
export { CodeBlock };
|
|
122
|
+
|
|
123
|
+
// import { vscDarkPlus as highlightStyle } from "react-syntax-highlighter/dist/esm/styles/prism";
|
|
124
|
+
// As a workaround, we inline the vscDarkPlus from react-syntax-highlighter.
|
|
125
|
+
// Importing it as recommended in the documentation leads to build errors in the non app router
|
|
126
|
+
// (Next.js classic) setup.
|
|
127
|
+
const highlightStyle: any = {
|
|
128
|
+
'pre[class*="language-"]': {
|
|
129
|
+
color: "#d4d4d4",
|
|
130
|
+
fontSize: "13px",
|
|
131
|
+
textShadow: "none",
|
|
132
|
+
fontFamily: 'Menlo, Monaco, Consolas, "Andale Mono", "Ubuntu Mono", "Courier New", monospace',
|
|
133
|
+
direction: "ltr",
|
|
134
|
+
textAlign: "left",
|
|
135
|
+
whiteSpace: "pre",
|
|
136
|
+
wordSpacing: "normal",
|
|
137
|
+
wordBreak: "normal",
|
|
138
|
+
lineHeight: "1.5",
|
|
139
|
+
MozTabSize: "4",
|
|
140
|
+
OTabSize: "4",
|
|
141
|
+
tabSize: "4",
|
|
142
|
+
WebkitHyphens: "none",
|
|
143
|
+
MozHyphens: "none",
|
|
144
|
+
msHyphens: "none",
|
|
145
|
+
hyphens: "none",
|
|
146
|
+
padding: "1em",
|
|
147
|
+
margin: ".5em 0",
|
|
148
|
+
overflow: "auto",
|
|
149
|
+
background: "#1e1e1e",
|
|
150
|
+
},
|
|
151
|
+
'code[class*="language-"]': {
|
|
152
|
+
color: "#d4d4d4",
|
|
153
|
+
fontSize: "13px",
|
|
154
|
+
textShadow: "none",
|
|
155
|
+
fontFamily: 'Menlo, Monaco, Consolas, "Andale Mono", "Ubuntu Mono", "Courier New", monospace',
|
|
156
|
+
direction: "ltr",
|
|
157
|
+
textAlign: "left",
|
|
158
|
+
whiteSpace: "pre",
|
|
159
|
+
wordSpacing: "normal",
|
|
160
|
+
wordBreak: "normal",
|
|
161
|
+
lineHeight: "1.5",
|
|
162
|
+
MozTabSize: "4",
|
|
163
|
+
OTabSize: "4",
|
|
164
|
+
tabSize: "4",
|
|
165
|
+
WebkitHyphens: "none",
|
|
166
|
+
MozHyphens: "none",
|
|
167
|
+
msHyphens: "none",
|
|
168
|
+
hyphens: "none",
|
|
169
|
+
},
|
|
170
|
+
'pre[class*="language-"]::selection': {
|
|
171
|
+
textShadow: "none",
|
|
172
|
+
background: "#264F78",
|
|
173
|
+
},
|
|
174
|
+
'code[class*="language-"]::selection': {
|
|
175
|
+
textShadow: "none",
|
|
176
|
+
background: "#264F78",
|
|
177
|
+
},
|
|
178
|
+
'pre[class*="language-"] *::selection': {
|
|
179
|
+
textShadow: "none",
|
|
180
|
+
background: "#264F78",
|
|
181
|
+
},
|
|
182
|
+
'code[class*="language-"] *::selection': {
|
|
183
|
+
textShadow: "none",
|
|
184
|
+
background: "#264F78",
|
|
185
|
+
},
|
|
186
|
+
':not(pre) > code[class*="language-"]': {
|
|
187
|
+
padding: ".1em .3em",
|
|
188
|
+
borderRadius: ".3em",
|
|
189
|
+
color: "#db4c69",
|
|
190
|
+
background: "#1e1e1e",
|
|
191
|
+
},
|
|
192
|
+
".namespace": {
|
|
193
|
+
Opacity: ".7",
|
|
194
|
+
},
|
|
195
|
+
"doctype.doctype-tag": {
|
|
196
|
+
color: "#569CD6",
|
|
197
|
+
},
|
|
198
|
+
"doctype.name": {
|
|
199
|
+
color: "#9cdcfe",
|
|
200
|
+
},
|
|
201
|
+
comment: {
|
|
202
|
+
color: "#6a9955",
|
|
203
|
+
},
|
|
204
|
+
prolog: {
|
|
205
|
+
color: "#6a9955",
|
|
206
|
+
},
|
|
207
|
+
punctuation: {
|
|
208
|
+
color: "#d4d4d4",
|
|
209
|
+
},
|
|
210
|
+
".language-html .language-css .token.punctuation": {
|
|
211
|
+
color: "#d4d4d4",
|
|
212
|
+
},
|
|
213
|
+
".language-html .language-javascript .token.punctuation": {
|
|
214
|
+
color: "#d4d4d4",
|
|
215
|
+
},
|
|
216
|
+
property: {
|
|
217
|
+
color: "#9cdcfe",
|
|
218
|
+
},
|
|
219
|
+
tag: {
|
|
220
|
+
color: "#569cd6",
|
|
221
|
+
},
|
|
222
|
+
boolean: {
|
|
223
|
+
color: "#569cd6",
|
|
224
|
+
},
|
|
225
|
+
number: {
|
|
226
|
+
color: "#b5cea8",
|
|
227
|
+
},
|
|
228
|
+
constant: {
|
|
229
|
+
color: "#9cdcfe",
|
|
230
|
+
},
|
|
231
|
+
symbol: {
|
|
232
|
+
color: "#b5cea8",
|
|
233
|
+
},
|
|
234
|
+
inserted: {
|
|
235
|
+
color: "#b5cea8",
|
|
236
|
+
},
|
|
237
|
+
unit: {
|
|
238
|
+
color: "#b5cea8",
|
|
239
|
+
},
|
|
240
|
+
selector: {
|
|
241
|
+
color: "#d7ba7d",
|
|
242
|
+
},
|
|
243
|
+
"attr-name": {
|
|
244
|
+
color: "#9cdcfe",
|
|
245
|
+
},
|
|
246
|
+
string: {
|
|
247
|
+
color: "#ce9178",
|
|
248
|
+
},
|
|
249
|
+
char: {
|
|
250
|
+
color: "#ce9178",
|
|
251
|
+
},
|
|
252
|
+
builtin: {
|
|
253
|
+
color: "#ce9178",
|
|
254
|
+
},
|
|
255
|
+
deleted: {
|
|
256
|
+
color: "#ce9178",
|
|
257
|
+
},
|
|
258
|
+
".language-css .token.string.url": {
|
|
259
|
+
textDecoration: "underline",
|
|
260
|
+
},
|
|
261
|
+
operator: {
|
|
262
|
+
color: "#d4d4d4",
|
|
263
|
+
},
|
|
264
|
+
entity: {
|
|
265
|
+
color: "#569cd6",
|
|
266
|
+
},
|
|
267
|
+
"operator.arrow": {
|
|
268
|
+
color: "#569CD6",
|
|
269
|
+
},
|
|
270
|
+
atrule: {
|
|
271
|
+
color: "#ce9178",
|
|
272
|
+
},
|
|
273
|
+
"atrule.rule": {
|
|
274
|
+
color: "#c586c0",
|
|
275
|
+
},
|
|
276
|
+
"atrule.url": {
|
|
277
|
+
color: "#9cdcfe",
|
|
278
|
+
},
|
|
279
|
+
"atrule.url.function": {
|
|
280
|
+
color: "#dcdcaa",
|
|
281
|
+
},
|
|
282
|
+
"atrule.url.punctuation": {
|
|
283
|
+
color: "#d4d4d4",
|
|
284
|
+
},
|
|
285
|
+
keyword: {
|
|
286
|
+
color: "#569CD6",
|
|
287
|
+
},
|
|
288
|
+
"keyword.module": {
|
|
289
|
+
color: "#c586c0",
|
|
290
|
+
},
|
|
291
|
+
"keyword.control-flow": {
|
|
292
|
+
color: "#c586c0",
|
|
293
|
+
},
|
|
294
|
+
function: {
|
|
295
|
+
color: "#dcdcaa",
|
|
296
|
+
},
|
|
297
|
+
"function.maybe-class-name": {
|
|
298
|
+
color: "#dcdcaa",
|
|
299
|
+
},
|
|
300
|
+
regex: {
|
|
301
|
+
color: "#d16969",
|
|
302
|
+
},
|
|
303
|
+
important: {
|
|
304
|
+
color: "#569cd6",
|
|
305
|
+
},
|
|
306
|
+
italic: {
|
|
307
|
+
fontStyle: "italic",
|
|
308
|
+
},
|
|
309
|
+
"class-name": {
|
|
310
|
+
color: "#4ec9b0",
|
|
311
|
+
},
|
|
312
|
+
"maybe-class-name": {
|
|
313
|
+
color: "#4ec9b0",
|
|
314
|
+
},
|
|
315
|
+
console: {
|
|
316
|
+
color: "#9cdcfe",
|
|
317
|
+
},
|
|
318
|
+
parameter: {
|
|
319
|
+
color: "#9cdcfe",
|
|
320
|
+
},
|
|
321
|
+
interpolation: {
|
|
322
|
+
color: "#9cdcfe",
|
|
323
|
+
},
|
|
324
|
+
"punctuation.interpolation-punctuation": {
|
|
325
|
+
color: "#569cd6",
|
|
326
|
+
},
|
|
327
|
+
variable: {
|
|
328
|
+
color: "#9cdcfe",
|
|
329
|
+
},
|
|
330
|
+
"imports.maybe-class-name": {
|
|
331
|
+
color: "#9cdcfe",
|
|
332
|
+
},
|
|
333
|
+
"exports.maybe-class-name": {
|
|
334
|
+
color: "#9cdcfe",
|
|
335
|
+
},
|
|
336
|
+
escape: {
|
|
337
|
+
color: "#d7ba7d",
|
|
338
|
+
},
|
|
339
|
+
"tag.punctuation": {
|
|
340
|
+
color: "#808080",
|
|
341
|
+
},
|
|
342
|
+
cdata: {
|
|
343
|
+
color: "#808080",
|
|
344
|
+
},
|
|
345
|
+
"attr-value": {
|
|
346
|
+
color: "#ce9178",
|
|
347
|
+
},
|
|
348
|
+
"attr-value.punctuation": {
|
|
349
|
+
color: "#ce9178",
|
|
350
|
+
},
|
|
351
|
+
"attr-value.punctuation.attr-equals": {
|
|
352
|
+
color: "#d4d4d4",
|
|
353
|
+
},
|
|
354
|
+
namespace: {
|
|
355
|
+
color: "#4ec9b0",
|
|
356
|
+
},
|
|
357
|
+
'pre[class*="language-javascript"]': {
|
|
358
|
+
color: "#9cdcfe",
|
|
359
|
+
},
|
|
360
|
+
'code[class*="language-javascript"]': {
|
|
361
|
+
color: "#9cdcfe",
|
|
362
|
+
},
|
|
363
|
+
'pre[class*="language-jsx"]': {
|
|
364
|
+
color: "#9cdcfe",
|
|
365
|
+
},
|
|
366
|
+
'code[class*="language-jsx"]': {
|
|
367
|
+
color: "#9cdcfe",
|
|
368
|
+
},
|
|
369
|
+
'pre[class*="language-typescript"]': {
|
|
370
|
+
color: "#9cdcfe",
|
|
371
|
+
},
|
|
372
|
+
'code[class*="language-typescript"]': {
|
|
373
|
+
color: "#9cdcfe",
|
|
374
|
+
},
|
|
375
|
+
'pre[class*="language-tsx"]': {
|
|
376
|
+
color: "#9cdcfe",
|
|
377
|
+
},
|
|
378
|
+
'code[class*="language-tsx"]': {
|
|
379
|
+
color: "#9cdcfe",
|
|
380
|
+
},
|
|
381
|
+
'pre[class*="language-css"]': {
|
|
382
|
+
color: "#ce9178",
|
|
383
|
+
},
|
|
384
|
+
'code[class*="language-css"]': {
|
|
385
|
+
color: "#ce9178",
|
|
386
|
+
},
|
|
387
|
+
'pre[class*="language-html"]': {
|
|
388
|
+
color: "#d4d4d4",
|
|
389
|
+
},
|
|
390
|
+
'code[class*="language-html"]': {
|
|
391
|
+
color: "#d4d4d4",
|
|
392
|
+
},
|
|
393
|
+
".language-regex .token.anchor": {
|
|
394
|
+
color: "#dcdcaa",
|
|
395
|
+
},
|
|
396
|
+
".language-html .token.punctuation": {
|
|
397
|
+
color: "#808080",
|
|
398
|
+
},
|
|
399
|
+
'pre[class*="language-"] > code[class*="language-"]': {
|
|
400
|
+
position: "relative",
|
|
401
|
+
zIndex: "1",
|
|
402
|
+
},
|
|
403
|
+
".line-highlight.line-highlight": {
|
|
404
|
+
background: "#f7ebc6",
|
|
405
|
+
boxShadow: "inset 5px 0 0 #f7d87c",
|
|
406
|
+
zIndex: "0",
|
|
407
|
+
},
|
|
408
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { HeaderProps } from "./props";
|
|
2
|
+
import { useChatContext } from "./ChatContext";
|
|
3
|
+
|
|
4
|
+
export const Header = ({}: HeaderProps) => {
|
|
5
|
+
const { setOpen, icons, labels } = useChatContext();
|
|
6
|
+
|
|
7
|
+
return (
|
|
8
|
+
<div className="copilotKitHeader">
|
|
9
|
+
<div>{labels.title}</div>
|
|
10
|
+
<button onClick={() => setOpen(false)} aria-label="Close">
|
|
11
|
+
{icons.headerCloseIcon}
|
|
12
|
+
</button>
|
|
13
|
+
</div>
|
|
14
|
+
);
|
|
15
|
+
};
|