@copilotkit/react-ui 0.15.0-alpha.1 → 0.15.0-alpha.2
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/.turbo/turbo-build.log +192 -288
- package/CHANGELOG.md +16 -1
- package/dist/{chunk-ZVAH2Z2W.mjs → chunk-3M4HWSE7.mjs} +3 -3
- package/dist/chunk-3M4HWSE7.mjs.map +1 -0
- package/dist/{chunk-Y2RUG4B3.mjs → chunk-5O2MCJZ2.mjs} +2 -2
- package/dist/chunk-5O2MCJZ2.mjs.map +1 -0
- package/dist/{chunk-X3Z2EVFV.mjs → chunk-CKJXXQ2W.mjs} +5 -5
- package/dist/chunk-CKJXXQ2W.mjs.map +1 -0
- package/dist/{chunk-NXWVWC33.mjs → chunk-DPRH4HX3.mjs} +11 -24
- package/dist/chunk-DPRH4HX3.mjs.map +1 -0
- package/dist/{chunk-UIRFLYXI.mjs → chunk-GWGHQNRI.mjs} +14 -13
- package/dist/chunk-GWGHQNRI.mjs.map +1 -0
- package/dist/chunk-JD7BAH7U.mjs +3 -0
- package/dist/{chunk-X4T6ZUVM.mjs → chunk-KBGIPFXA.mjs} +5 -5
- package/dist/chunk-KBGIPFXA.mjs.map +1 -0
- package/dist/{chunk-DN3OI5WF.mjs → chunk-NNVWLSYK.mjs} +9 -9
- package/dist/chunk-NNVWLSYK.mjs.map +1 -0
- package/dist/{chunk-QFASQEFJ.mjs → chunk-NYLOXKYT.mjs} +2 -2
- package/dist/chunk-NYLOXKYT.mjs.map +1 -0
- package/dist/{chunk-6H3Y2XEI.mjs → chunk-OF66AL5Z.mjs} +1 -1
- package/dist/chunk-OF66AL5Z.mjs.map +1 -0
- package/dist/{chunk-DPUPEOGG.mjs → chunk-UWPFPWAW.mjs} +2 -2
- package/dist/chunk-UWPFPWAW.mjs.map +1 -0
- package/dist/{chunk-GPEJCUWA.mjs → chunk-Z34F3WLK.mjs} +2 -2
- package/dist/chunk-Z34F3WLK.mjs.map +1 -0
- package/dist/components/chat/Button.d.ts +2 -3
- package/dist/components/chat/Button.js +38 -0
- package/dist/components/chat/Button.js.map +1 -0
- package/dist/components/chat/Button.mjs +2 -2
- package/dist/components/chat/Chat.d.ts +15 -14
- package/dist/components/chat/Chat.js +800 -0
- package/dist/components/chat/Chat.js.map +1 -0
- package/dist/components/chat/Chat.mjs +9 -9
- package/dist/components/chat/ChatContext.d.ts +21 -21
- package/dist/components/chat/ChatContext.js +220 -0
- package/dist/components/chat/ChatContext.js.map +1 -0
- package/dist/components/chat/ChatContext.mjs +1 -1
- package/dist/components/chat/CodeBlock.js +221 -0
- package/dist/components/chat/CodeBlock.js.map +1 -0
- package/dist/components/chat/CodeBlock.mjs +1 -1
- package/dist/components/chat/Header.d.ts +2 -3
- package/dist/components/chat/Header.js +31 -0
- package/dist/components/chat/Header.js.map +1 -0
- package/dist/components/chat/Header.mjs +2 -2
- package/dist/components/chat/Icons.d.ts +4 -4
- package/dist/components/chat/Icons.js +233 -0
- package/dist/components/chat/Icons.js.map +1 -0
- package/dist/components/chat/Input.d.ts +2 -3
- package/dist/components/chat/Input.js +111 -0
- package/dist/components/chat/Input.js.map +1 -0
- package/dist/components/chat/Input.mjs +2 -2
- package/dist/components/chat/Markdown.d.ts +1 -3
- package/dist/components/chat/Markdown.js +269 -0
- package/dist/components/chat/Markdown.js.map +1 -0
- package/dist/components/chat/Markdown.mjs +2 -2
- package/dist/components/chat/Messages.d.ts +2 -3
- package/dist/components/chat/Messages.js +331 -0
- package/dist/components/chat/Messages.js.map +1 -0
- package/dist/components/chat/Messages.mjs +4 -4
- package/dist/components/chat/Popup.d.ts +5 -4
- package/dist/components/chat/Popup.js +806 -0
- package/dist/components/chat/Popup.js.map +1 -0
- package/dist/components/chat/Popup.mjs +10 -10
- package/dist/components/chat/Response.d.ts +2 -3
- package/dist/components/chat/Response.js +31 -0
- package/dist/components/chat/Response.js.map +1 -0
- package/dist/components/chat/Response.mjs +2 -2
- package/dist/components/chat/Sidebar.d.ts +7 -6
- package/dist/components/chat/Sidebar.js +817 -0
- package/dist/components/chat/Sidebar.js.map +1 -0
- package/dist/components/chat/Sidebar.mjs +10 -10
- package/dist/components/chat/Textarea.d.ts +4 -4
- package/dist/components/chat/Textarea.js +55 -0
- package/dist/components/chat/Textarea.js.map +1 -0
- package/dist/components/chat/Window.d.ts +1 -1
- package/dist/components/chat/Window.js +116 -0
- package/dist/components/chat/Window.js.map +1 -0
- package/dist/components/chat/index.d.ts +5 -4
- package/dist/components/chat/index.js +824 -0
- package/dist/components/chat/index.js.map +1 -0
- package/dist/components/chat/index.mjs +11 -11
- package/dist/components/chat/props.d.ts +1 -1
- package/dist/components/chat/props.js +4 -0
- package/dist/components/index.d.ts +5 -11
- package/dist/components/index.js +824 -0
- package/dist/components/index.js.map +1 -0
- package/dist/components/index.mjs +12 -33
- package/dist/context/index.js +4 -0
- package/dist/hooks/index.js +4 -0
- package/dist/hooks/use-copy-to-clipboard.js +47 -0
- package/dist/hooks/use-copy-to-clipboard.js.map +1 -0
- package/dist/index.css +112 -916
- package/dist/index.css.map +1 -1
- package/dist/index.d.ts +5 -11
- package/dist/index.js +824 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +13 -34
- package/dist/lib/utils.js +64 -0
- package/dist/lib/utils.js.map +1 -0
- package/dist/lib/utils.mjs +38 -2
- package/dist/lib/utils.mjs.map +1 -1
- package/dist/lib/utils.test.js +10 -0
- package/dist/lib/utils.test.js.map +1 -0
- package/dist/types/index.js +4 -0
- package/dist/types/types.d.ts +1 -1
- package/dist/types/types.js +4 -0
- package/package.json +8 -7
- package/src/components/chat/Button.tsx +1 -2
- package/src/components/chat/Chat.tsx +7 -7
- package/src/components/chat/ChatContext.tsx +10 -10
- package/src/components/chat/CodeBlock.tsx +12 -36
- package/src/components/chat/Header.tsx +1 -2
- package/src/components/chat/Input.tsx +1 -1
- package/src/components/chat/Markdown.tsx +17 -11
- package/src/components/chat/Messages.tsx +2 -2
- package/src/components/chat/Popup.tsx +3 -4
- package/src/components/chat/Response.tsx +1 -2
- package/src/components/chat/Sidebar.tsx +4 -4
- package/src/components/chat/index.tsx +2 -2
- package/src/components/chat/props.ts +1 -1
- package/src/components/index.ts +0 -8
- package/src/css/animations.css +6 -0
- package/src/css/markdown.css +123 -0
- package/src/styles.css +1 -0
- package/src/types/types.ts +1 -1
- package/tsup.config.ts +1 -2
- package/dist/chunk-2KAF7NKC.mjs +0 -484
- package/dist/chunk-2KAF7NKC.mjs.map +0 -1
- package/dist/chunk-5KEDV5VC.mjs +0 -27
- package/dist/chunk-5KEDV5VC.mjs.map +0 -1
- package/dist/chunk-6H3Y2XEI.mjs.map +0 -1
- package/dist/chunk-6LAZQHEB.mjs +0 -129
- package/dist/chunk-6LAZQHEB.mjs.map +0 -1
- package/dist/chunk-C34L4AWW.mjs +0 -39
- package/dist/chunk-C34L4AWW.mjs.map +0 -1
- package/dist/chunk-CF3BK4OX.mjs +0 -53
- package/dist/chunk-CF3BK4OX.mjs.map +0 -1
- package/dist/chunk-CNQX2VY3.mjs +0 -66
- package/dist/chunk-CNQX2VY3.mjs.map +0 -1
- package/dist/chunk-DN3OI5WF.mjs.map +0 -1
- package/dist/chunk-DPUPEOGG.mjs.map +0 -1
- package/dist/chunk-FZRTAML3.mjs +0 -3
- package/dist/chunk-GCOPYGHH.mjs +0 -27
- package/dist/chunk-GCOPYGHH.mjs.map +0 -1
- package/dist/chunk-GPEJCUWA.mjs.map +0 -1
- package/dist/chunk-IJLMKBSZ.mjs +0 -25
- package/dist/chunk-IJLMKBSZ.mjs.map +0 -1
- package/dist/chunk-INCNMGJ7.mjs +0 -72
- package/dist/chunk-INCNMGJ7.mjs.map +0 -1
- package/dist/chunk-M3CZWJI3.mjs +0 -44
- package/dist/chunk-M3CZWJI3.mjs.map +0 -1
- package/dist/chunk-MC6KTH4X.mjs +0 -12
- package/dist/chunk-MC6KTH4X.mjs.map +0 -1
- package/dist/chunk-NXWVWC33.mjs.map +0 -1
- package/dist/chunk-OHWEJUCS.mjs +0 -18
- package/dist/chunk-OHWEJUCS.mjs.map +0 -1
- package/dist/chunk-OOBQC5H6.mjs +0 -34
- package/dist/chunk-OOBQC5H6.mjs.map +0 -1
- package/dist/chunk-Q6YO7LDK.mjs +0 -40
- package/dist/chunk-Q6YO7LDK.mjs.map +0 -1
- package/dist/chunk-QFASQEFJ.mjs.map +0 -1
- package/dist/chunk-RPTRCFSO.mjs +0 -42
- package/dist/chunk-RPTRCFSO.mjs.map +0 -1
- package/dist/chunk-SEH5PQVW.mjs +0 -52
- package/dist/chunk-SEH5PQVW.mjs.map +0 -1
- package/dist/chunk-SHOTWRKC.mjs +0 -18
- package/dist/chunk-SHOTWRKC.mjs.map +0 -1
- package/dist/chunk-SRBUGQTM.mjs +0 -109
- package/dist/chunk-SRBUGQTM.mjs.map +0 -1
- package/dist/chunk-TEYIQHMK.mjs +0 -12
- package/dist/chunk-TEYIQHMK.mjs.map +0 -1
- package/dist/chunk-UIRFLYXI.mjs.map +0 -1
- package/dist/chunk-VGX2W5ZB.mjs +0 -28
- package/dist/chunk-VGX2W5ZB.mjs.map +0 -1
- package/dist/chunk-X3Z2EVFV.mjs.map +0 -1
- package/dist/chunk-X4T6ZUVM.mjs.map +0 -1
- package/dist/chunk-XGUBRIUV.mjs +0 -72
- package/dist/chunk-XGUBRIUV.mjs.map +0 -1
- package/dist/chunk-Y2RUG4B3.mjs.map +0 -1
- package/dist/chunk-ZVAH2Z2W.mjs.map +0 -1
- package/dist/chunk-ZYC5YVDO.mjs +0 -21
- package/dist/chunk-ZYC5YVDO.mjs.map +0 -1
- package/dist/components/chat-components/chat-list.d.ts +0 -8
- package/dist/components/chat-components/chat-list.mjs +0 -13
- package/dist/components/chat-components/chat-message-actions.d.ts +0 -8
- package/dist/components/chat-components/chat-message-actions.mjs +0 -8
- package/dist/components/chat-components/chat-message.d.ts +0 -8
- package/dist/components/chat-components/chat-message.mjs +0 -11
- package/dist/components/chat-components/chat-panel.d.ts +0 -8
- package/dist/components/chat-components/chat-panel.mjs +0 -10
- package/dist/components/chat-components/chat-scroll-anchor.d.ts +0 -6
- package/dist/components/chat-components/chat-scroll-anchor.mjs +0 -5
- package/dist/components/chat-components/clear-history.d.ts +0 -9
- package/dist/components/chat-components/clear-history.mjs +0 -56
- package/dist/components/chat-components/clear-history.mjs.map +0 -1
- package/dist/components/chat-components/copilot-chat.d.ts +0 -12
- package/dist/components/chat-components/copilot-chat.mjs +0 -22
- package/dist/components/chat-components/copilot-chat.mjs.map +0 -1
- package/dist/components/chat-components/default-empty-screen.d.ts +0 -8
- package/dist/components/chat-components/default-empty-screen.mjs +0 -8
- package/dist/components/chat-components/default-empty-screen.mjs.map +0 -1
- package/dist/components/chat-components/external-link.d.ts +0 -6
- package/dist/components/chat-components/external-link.mjs +0 -4
- package/dist/components/chat-components/external-link.mjs.map +0 -1
- package/dist/components/chat-components/markdown.d.ts +0 -6
- package/dist/components/chat-components/markdown.mjs +0 -4
- package/dist/components/chat-components/markdown.mjs.map +0 -1
- package/dist/components/chat-components/prompt-form.d.ts +0 -9
- package/dist/components/chat-components/prompt-form.mjs +0 -9
- package/dist/components/chat-components/prompt-form.mjs.map +0 -1
- package/dist/components/chat-components/theme-toggle.d.ts +0 -3
- package/dist/components/chat-components/theme-toggle.mjs +0 -32
- package/dist/components/chat-components/theme-toggle.mjs.map +0 -1
- package/dist/components/chat-components/toaster.d.ts +0 -1
- package/dist/components/chat-components/toaster.mjs +0 -4
- package/dist/components/chat-components/toaster.mjs.map +0 -1
- package/dist/components/chat-components/ui/alert-dialog.d.ts +0 -20
- package/dist/components/chat-components/ui/alert-dialog.mjs +0 -6
- package/dist/components/chat-components/ui/alert-dialog.mjs.map +0 -1
- package/dist/components/chat-components/ui/badge.d.ts +0 -12
- package/dist/components/chat-components/ui/badge.mjs +0 -29
- package/dist/components/chat-components/ui/badge.mjs.map +0 -1
- package/dist/components/chat-components/ui/button.d.ts +0 -14
- package/dist/components/chat-components/ui/button.mjs +0 -5
- package/dist/components/chat-components/ui/button.mjs.map +0 -1
- package/dist/components/chat-components/ui/codeblock.d.ts +0 -14
- package/dist/components/chat-components/ui/codeblock.mjs +0 -8
- package/dist/components/chat-components/ui/codeblock.mjs.map +0 -1
- package/dist/components/chat-components/ui/dialog.d.ts +0 -18
- package/dist/components/chat-components/ui/dialog.mjs +0 -94
- package/dist/components/chat-components/ui/dialog.mjs.map +0 -1
- package/dist/components/chat-components/ui/dropdown-menu.d.ts +0 -24
- package/dist/components/chat-components/ui/dropdown-menu.mjs +0 -87
- package/dist/components/chat-components/ui/dropdown-menu.mjs.map +0 -1
- package/dist/components/chat-components/ui/icons.d.ts +0 -33
- package/dist/components/chat-components/ui/icons.mjs +0 -5
- package/dist/components/chat-components/ui/icons.mjs.map +0 -1
- package/dist/components/chat-components/ui/input.d.ts +0 -7
- package/dist/components/chat-components/ui/input.mjs +0 -26
- package/dist/components/chat-components/ui/input.mjs.map +0 -1
- package/dist/components/chat-components/ui/label.d.ts +0 -8
- package/dist/components/chat-components/ui/label.mjs +0 -19
- package/dist/components/chat-components/ui/label.mjs.map +0 -1
- package/dist/components/chat-components/ui/select.d.ts +0 -13
- package/dist/components/chat-components/ui/select.mjs +0 -101
- package/dist/components/chat-components/ui/select.mjs.map +0 -1
- package/dist/components/chat-components/ui/separator.d.ts +0 -6
- package/dist/components/chat-components/ui/separator.mjs +0 -5
- package/dist/components/chat-components/ui/separator.mjs.map +0 -1
- package/dist/components/chat-components/ui/sheet.d.ts +0 -19
- package/dist/components/chat-components/ui/sheet.mjs +0 -93
- package/dist/components/chat-components/ui/sheet.mjs.map +0 -1
- package/dist/components/chat-components/ui/switch.d.ts +0 -6
- package/dist/components/chat-components/ui/switch.mjs +0 -33
- package/dist/components/chat-components/ui/switch.mjs.map +0 -1
- package/dist/components/chat-components/ui/textarea.d.ts +0 -7
- package/dist/components/chat-components/ui/textarea.mjs +0 -25
- package/dist/components/chat-components/ui/textarea.mjs.map +0 -1
- package/dist/components/chat-components/ui/tooltip.d.ts +0 -9
- package/dist/components/chat-components/ui/tooltip.mjs +0 -5
- package/dist/components/chat-components/ui/tooltip.mjs.map +0 -1
- package/dist/components/sidebar/copilot-sidebar-ui-provider.d.ts +0 -8
- package/dist/components/sidebar/copilot-sidebar-ui-provider.mjs +0 -25
- package/dist/components/sidebar/copilot-sidebar-ui-provider.mjs.map +0 -1
- package/dist/components/sidebar/copilot-sidebar.d.ts +0 -6
- package/dist/components/sidebar/copilot-sidebar.mjs +0 -23
- package/dist/components/sidebar/copilot-sidebar.mjs.map +0 -1
- package/dist/components/sidebar/sidebar-context.d.ts +0 -9
- package/dist/components/sidebar/sidebar-context.mjs +0 -4
- package/dist/components/sidebar/sidebar-context.mjs.map +0 -1
- package/dist/hooks/use-at-bottom.d.ts +0 -3
- package/dist/hooks/use-at-bottom.mjs +0 -4
- package/dist/hooks/use-at-bottom.mjs.map +0 -1
- package/dist/hooks/use-enter-submit.d.ts +0 -8
- package/dist/hooks/use-enter-submit.mjs +0 -4
- package/dist/hooks/use-enter-submit.mjs.map +0 -1
- package/src/components/chat-components/chat-list.tsx +0 -28
- package/src/components/chat-components/chat-message-actions.tsx +0 -36
- package/src/components/chat-components/chat-message.tsx +0 -70
- package/src/components/chat-components/chat-panel.tsx +0 -64
- package/src/components/chat-components/chat-scroll-anchor.tsx +0 -29
- package/src/components/chat-components/clear-history.tsx +0 -72
- package/src/components/chat-components/copilot-chat.tsx +0 -57
- package/src/components/chat-components/default-empty-screen.tsx +0 -57
- package/src/components/chat-components/external-link.tsx +0 -17
- package/src/components/chat-components/markdown.tsx +0 -8
- package/src/components/chat-components/prompt-form.tsx +0 -85
- package/src/components/chat-components/theme-toggle.tsx +0 -31
- package/src/components/chat-components/toaster.tsx +0 -3
- package/src/components/chat-components/ui/alert-dialog.tsx +0 -126
- package/src/components/chat-components/ui/badge.tsx +0 -33
- package/src/components/chat-components/ui/button.tsx +0 -49
- package/src/components/chat-components/ui/codeblock.tsx +0 -137
- package/src/components/chat-components/ui/dialog.tsx +0 -106
- package/src/components/chat-components/ui/dropdown-menu.tsx +0 -117
- package/src/components/chat-components/ui/icons.tsx +0 -484
- package/src/components/chat-components/ui/input.tsx +0 -24
- package/src/components/chat-components/ui/label.tsx +0 -21
- package/src/components/chat-components/ui/select.tsx +0 -119
- package/src/components/chat-components/ui/separator.tsx +0 -26
- package/src/components/chat-components/ui/sheet.tsx +0 -106
- package/src/components/chat-components/ui/switch.tsx +0 -29
- package/src/components/chat-components/ui/textarea.tsx +0 -23
- package/src/components/chat-components/ui/tooltip.tsx +0 -30
- package/src/components/sidebar/copilot-sidebar-ui-provider.tsx +0 -73
- package/src/components/sidebar/copilot-sidebar.tsx +0 -38
- package/src/components/sidebar/sidebar-context.tsx +0 -11
- package/src/hooks/use-at-bottom.tsx +0 -20
- package/src/hooks/use-enter-submit.tsx +0 -17
- /package/dist/{chunk-FZRTAML3.mjs.map → chunk-JD7BAH7U.mjs.map} +0 -0
- /package/dist/components/{chat-components/chat-list.mjs.map → chat/props.js.map} +0 -0
- /package/dist/{components/chat-components/chat-message-actions.mjs.map → context/index.js.map} +0 -0
- /package/dist/{components/chat-components/chat-message.mjs.map → hooks/index.js.map} +0 -0
- /package/dist/{components/chat-components/chat-panel.mjs.map → types/index.js.map} +0 -0
- /package/dist/{components/chat-components/chat-scroll-anchor.mjs.map → types/types.js.map} +0 -0
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import React from "react";
|
|
2
1
|
import { FC, memo } from "react";
|
|
3
2
|
import ReactMarkdown, { Options, Components } from "react-markdown";
|
|
4
3
|
import { CodeBlock } from "./CodeBlock";
|
|
@@ -15,26 +14,33 @@ type MarkdownProps = {
|
|
|
15
14
|
content: string;
|
|
16
15
|
};
|
|
17
16
|
|
|
18
|
-
export const Markdown
|
|
17
|
+
export const Markdown = ({ content }: MarkdownProps) => {
|
|
19
18
|
return (
|
|
20
|
-
<
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
>
|
|
25
|
-
{content}
|
|
26
|
-
</MemoizedReactMarkdown>
|
|
19
|
+
<div className="copilotKitMarkdown">
|
|
20
|
+
<MemoizedReactMarkdown components={components} remarkPlugins={[remarkGfm, remarkMath]}>
|
|
21
|
+
{content}
|
|
22
|
+
</MemoizedReactMarkdown>
|
|
23
|
+
</div>
|
|
27
24
|
);
|
|
28
25
|
};
|
|
29
26
|
|
|
30
27
|
const components: Components = {
|
|
31
28
|
p({ children }) {
|
|
32
|
-
return <p
|
|
29
|
+
return <p>{children}</p>;
|
|
33
30
|
},
|
|
34
31
|
code({ children, className, inline, ...props }) {
|
|
35
32
|
if (children.length) {
|
|
36
33
|
if (children[0] == "▍") {
|
|
37
|
-
return
|
|
34
|
+
return (
|
|
35
|
+
<span
|
|
36
|
+
style={{
|
|
37
|
+
animation: "pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite",
|
|
38
|
+
marginTop: "0.25rem",
|
|
39
|
+
}}
|
|
40
|
+
>
|
|
41
|
+
▍
|
|
42
|
+
</span>
|
|
43
|
+
);
|
|
38
44
|
}
|
|
39
45
|
|
|
40
46
|
children[0] = (children[0] as string).replace("`▍`", "▍");
|
|
@@ -2,10 +2,10 @@ import React, { useEffect, useMemo } from "react";
|
|
|
2
2
|
import { MessagesProps } from "./props";
|
|
3
3
|
import { useChatContext } from "./ChatContext";
|
|
4
4
|
import { nanoid } from "nanoid";
|
|
5
|
-
import { Message } from "@copilotkit/
|
|
5
|
+
import { Message } from "@copilotkit/shared";
|
|
6
6
|
import { Markdown } from "./Markdown";
|
|
7
7
|
|
|
8
|
-
export const Messages
|
|
8
|
+
export const Messages = ({ messages, inProgress }: MessagesProps) => {
|
|
9
9
|
const context = useChatContext();
|
|
10
10
|
const initialMessages = useMemo(
|
|
11
11
|
() => makeInitialMessages(context.labels.initial),
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { CopilotKitChat, CopilotKitChatProps } from "./Chat";
|
|
1
|
+
import { CopilotChat, CopilotChatProps } from "./Chat";
|
|
3
2
|
|
|
4
|
-
export const
|
|
3
|
+
export const CopilotPopup = (props: CopilotChatProps) => {
|
|
5
4
|
props = {
|
|
6
5
|
...props,
|
|
7
6
|
className: props.className ? props.className + " copilotKitPopup" : "copilotKitPopup",
|
|
8
7
|
};
|
|
9
|
-
return <
|
|
8
|
+
return <CopilotChat {...props} />;
|
|
10
9
|
};
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import React from "react";
|
|
2
1
|
import { useChatContext } from "./ChatContext";
|
|
3
2
|
import { ResponseButtonProps } from "./props";
|
|
4
3
|
|
|
5
|
-
export const ResponseButton
|
|
4
|
+
export const ResponseButton = ({ onClick, inProgress }: ResponseButtonProps) => {
|
|
6
5
|
const context = useChatContext();
|
|
7
6
|
return (
|
|
8
7
|
<button onClick={onClick} className="copilotKitResponseButton">
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import React, { useState } from "react";
|
|
2
|
-
import {
|
|
2
|
+
import { CopilotChat, CopilotChatProps } from "./Chat";
|
|
3
3
|
|
|
4
|
-
interface
|
|
4
|
+
interface CopilotSidebarProps extends CopilotChatProps {
|
|
5
5
|
children?: React.ReactNode;
|
|
6
6
|
}
|
|
7
7
|
|
|
8
|
-
export const
|
|
8
|
+
export const CopilotSidebar = (props: CopilotSidebarProps) => {
|
|
9
9
|
props = {
|
|
10
10
|
...props,
|
|
11
11
|
className: props.className ? props.className + " copilotKitSidebar" : "copilotKitSidebar",
|
|
@@ -22,7 +22,7 @@ export const CopilotKitSidebar: React.FC<CopilotKitSidebarProps> = (props) => {
|
|
|
22
22
|
return (
|
|
23
23
|
<div className={`copilotKitSidebarContentWrapper ${expandedClassName}`}>
|
|
24
24
|
{props.children}
|
|
25
|
-
<
|
|
25
|
+
<CopilotChat {...props} {...{ onSetOpen }} />
|
|
26
26
|
</div>
|
|
27
27
|
);
|
|
28
28
|
};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export * from "./props";
|
|
2
|
-
export {
|
|
3
|
-
export {
|
|
2
|
+
export { CopilotPopup } from "./Popup";
|
|
3
|
+
export { CopilotSidebar } from "./Sidebar";
|
package/src/components/index.ts
CHANGED
|
@@ -1,9 +1 @@
|
|
|
1
|
-
export { CopilotChat } from "./chat-components/copilot-chat";
|
|
2
|
-
export { Tooltip, TooltipProvider } from "./chat-components/ui/tooltip";
|
|
3
|
-
|
|
4
|
-
export { CopilotSidebarUIProvider } from "./sidebar/copilot-sidebar-ui-provider";
|
|
5
|
-
export { CopilotSidebar } from "./sidebar/copilot-sidebar";
|
|
6
|
-
export { CopilotSidebarContext } from "./sidebar/sidebar-context";
|
|
7
|
-
export type { CopilotSidebarContextType } from "./sidebar/sidebar-context";
|
|
8
|
-
|
|
9
1
|
export * from "./chat";
|
package/src/css/animations.css
CHANGED
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
.copilotKitMarkdown h1,
|
|
2
|
+
.copilotKitMarkdown h2,
|
|
3
|
+
.copilotKitMarkdown h3,
|
|
4
|
+
.copilotKitMarkdown h4,
|
|
5
|
+
.copilotKitMarkdown h5,
|
|
6
|
+
.copilotKitMarkdown h6 {
|
|
7
|
+
font-weight: bold;
|
|
8
|
+
line-height: 1.2;
|
|
9
|
+
margin-bottom: 1rem;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.copilotKitMarkdown h1 {
|
|
13
|
+
font-size: 1.5em;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.copilotKitMarkdown h2 {
|
|
17
|
+
font-size: 1.25em;
|
|
18
|
+
font-weight: 600;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.copilotKitMarkdown h3 {
|
|
22
|
+
font-size: 1.1em;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.copilotKitMarkdown h4 {
|
|
26
|
+
font-size: 1em;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.copilotKitMarkdown h5 {
|
|
30
|
+
font-size: 0.9em;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.copilotKitMarkdown h6 {
|
|
34
|
+
font-size: 0.8em;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.copilotKitMarkdown p {
|
|
38
|
+
margin-bottom: 1.25em;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.copilotKitMarkdown pre {
|
|
42
|
+
margin-bottom: 1.25em;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.copilotKitMarkdown blockquote {
|
|
46
|
+
border-color: rgb(142, 142, 160);
|
|
47
|
+
border-left-width: 2px;
|
|
48
|
+
border-left-style: solid;
|
|
49
|
+
line-height: 1.2;
|
|
50
|
+
padding-left: 10px;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.copilotKitMarkdown blockquote p {
|
|
54
|
+
padding: 0.7em 0;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.copilotKitMarkdown ul {
|
|
58
|
+
list-style-type: disc;
|
|
59
|
+
padding-left: 20px;
|
|
60
|
+
overflow: visible;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.copilotKitMarkdown li {
|
|
64
|
+
list-style-type: inherit;
|
|
65
|
+
list-style-position: outside;
|
|
66
|
+
margin-left: 0;
|
|
67
|
+
padding-left: 0;
|
|
68
|
+
position: relative;
|
|
69
|
+
overflow: visible;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.copilotKitCodeBlock {
|
|
73
|
+
position: relative;
|
|
74
|
+
width: 100%;
|
|
75
|
+
background-color: rgb(9 9 11);
|
|
76
|
+
border-radius: 0.375rem;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.copilotKitCodeBlockToolbar {
|
|
80
|
+
display: flex;
|
|
81
|
+
width: 100%;
|
|
82
|
+
align-items: center;
|
|
83
|
+
justify-content: space-between;
|
|
84
|
+
background-color: rgb(39 39 42);
|
|
85
|
+
padding-left: 1rem;
|
|
86
|
+
padding-top: 0.09rem;
|
|
87
|
+
padding-bottom: 0.09rem;
|
|
88
|
+
color: rgb(228, 228, 228);
|
|
89
|
+
border-top-left-radius: 0.375rem;
|
|
90
|
+
border-top-right-radius: 0.375rem;
|
|
91
|
+
font-family: sans-serif;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
.copilotKitCodeBlockToolbarLanguage {
|
|
95
|
+
font-size: 0.75rem;
|
|
96
|
+
line-height: 1rem;
|
|
97
|
+
text-transform: lowercase;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.copilotKitCodeBlockToolbarButtons {
|
|
101
|
+
display: flex;
|
|
102
|
+
align-items: center;
|
|
103
|
+
margin-right: 0.25rem;
|
|
104
|
+
margin-left: 0.25rem;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.copilotKitCodeBlockToolbarButton {
|
|
108
|
+
display: inline-flex;
|
|
109
|
+
align-items: center;
|
|
110
|
+
justify-content: center;
|
|
111
|
+
border-radius: 0.375rem;
|
|
112
|
+
font-size: 0.875rem;
|
|
113
|
+
line-height: 1.25rem;
|
|
114
|
+
font-weight: 500;
|
|
115
|
+
height: 2.5rem;
|
|
116
|
+
width: 2.5rem;
|
|
117
|
+
padding: 3px;
|
|
118
|
+
margin: 2px;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.copilotKitCodeBlockToolbarButton:hover {
|
|
122
|
+
background-color: rgb(55, 55, 58);
|
|
123
|
+
}
|
package/src/styles.css
CHANGED
package/src/types/types.ts
CHANGED
package/tsup.config.ts
CHANGED
|
@@ -2,10 +2,9 @@ import { defineConfig, Options } from "tsup";
|
|
|
2
2
|
|
|
3
3
|
export default defineConfig((options: Options) => ({
|
|
4
4
|
entry: ["src/**/*.{ts,tsx}"],
|
|
5
|
-
format: ["esm"],
|
|
5
|
+
format: ["esm", "cjs"],
|
|
6
6
|
dts: true,
|
|
7
7
|
minify: false,
|
|
8
|
-
clean: true,
|
|
9
8
|
external: ["react"],
|
|
10
9
|
sourcemap: true,
|
|
11
10
|
exclude: [
|