@copilotkit/react-ui 0.10.0 → 0.12.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/.turbo/turbo-build.log +62 -62
- package/CHANGELOG.md +29 -0
- package/dist/{chunk-KR7MH7XO.mjs → chunk-34MTYKUD.mjs} +4 -12
- package/dist/chunk-34MTYKUD.mjs.map +1 -0
- package/dist/{chunk-UKKJ6H2K.mjs → chunk-4ENGXGIC.mjs} +6 -11
- package/dist/chunk-4ENGXGIC.mjs.map +1 -0
- package/dist/{chunk-V6QYUEJR.mjs → chunk-5HCN6SPC.mjs} +2 -2
- package/dist/chunk-5HCN6SPC.mjs.map +1 -0
- package/dist/{chunk-RSONJDLO.mjs → chunk-6RG3YDAC.mjs} +2 -2
- package/dist/{chunk-TUPGAO7T.mjs → chunk-AYVNEHBC.mjs} +4 -6
- package/dist/chunk-AYVNEHBC.mjs.map +1 -0
- package/dist/{chunk-2NO6SF5H.mjs → chunk-CRRPHVT3.mjs} +10 -6
- package/dist/chunk-CRRPHVT3.mjs.map +1 -0
- package/dist/{chunk-KXJV37FS.mjs → chunk-D72RVITD.mjs} +2 -5
- package/dist/chunk-D72RVITD.mjs.map +1 -0
- package/dist/{chunk-6UJWRTL6.mjs → chunk-ESP3H6NQ.mjs} +6 -12
- package/dist/chunk-ESP3H6NQ.mjs.map +1 -0
- package/dist/{chunk-VSNDSL6W.mjs → chunk-EXOYIXGQ.mjs} +4 -4
- package/dist/{chunk-VSNDSL6W.mjs.map → chunk-EXOYIXGQ.mjs.map} +1 -1
- package/dist/{chunk-LMCFSE4V.mjs → chunk-GBPOPYU3.mjs} +4 -6
- package/dist/chunk-GBPOPYU3.mjs.map +1 -0
- package/dist/{chunk-7KPMJBGH.mjs → chunk-GWX3NPF5.mjs} +2 -2
- package/dist/{chunk-7KPMJBGH.mjs.map → chunk-GWX3NPF5.mjs.map} +1 -1
- package/dist/{chunk-I2AB5FK4.mjs → chunk-HKSE5ISX.mjs} +8 -26
- package/dist/chunk-HKSE5ISX.mjs.map +1 -0
- package/dist/{chunk-BIPCPNHG.mjs → chunk-OHWEJUCS.mjs} +1 -1
- package/dist/chunk-OHWEJUCS.mjs.map +1 -0
- package/dist/{chunk-BS6RR2DJ.mjs → chunk-PY4F436T.mjs} +2 -2
- package/dist/{chunk-BS6RR2DJ.mjs.map → chunk-PY4F436T.mjs.map} +1 -1
- package/dist/{chunk-TVTG3V4F.mjs → chunk-Q6YO7LDK.mjs} +1 -1
- package/dist/chunk-Q6YO7LDK.mjs.map +1 -0
- package/dist/{chunk-6LRNF2VU.mjs → chunk-TEYIQHMK.mjs} +1 -1
- package/dist/chunk-TEYIQHMK.mjs.map +1 -0
- package/dist/chunk-VUNHHCOA.mjs +24 -0
- package/dist/chunk-VUNHHCOA.mjs.map +1 -0
- package/dist/{chunk-HKSY5T7Y.mjs → chunk-XEVSX2QD.mjs} +5 -8
- package/dist/chunk-XEVSX2QD.mjs.map +1 -0
- package/dist/{chunk-ZB6JHNDT.mjs → chunk-XLGSWCCV.mjs} +6 -6
- package/dist/chunk-XLGSWCCV.mjs.map +1 -0
- package/dist/{chunk-APH6ZQHG.mjs → chunk-ZA25IBKF.mjs} +4 -4
- package/dist/chunk-ZA25IBKF.mjs.map +1 -0
- package/dist/{chunk-6LAC5RA2.mjs → chunk-ZLFSBGYI.mjs} +2 -4
- package/dist/chunk-ZLFSBGYI.mjs.map +1 -0
- package/dist/{chunk-N7KB3Z57.mjs → chunk-ZYC5YVDO.mjs} +2 -4
- package/dist/chunk-ZYC5YVDO.mjs.map +1 -0
- package/dist/components/chat-components/chat-list.mjs +10 -10
- package/dist/components/chat-components/chat-message-actions.mjs +5 -5
- package/dist/components/chat-components/chat-message.mjs +8 -8
- package/dist/components/chat-components/chat-panel.mjs +7 -7
- package/dist/components/chat-components/chat-scroll-anchor.mjs +2 -2
- package/dist/components/chat-components/clear-history.mjs +4 -4
- package/dist/components/chat-components/clear-history.mjs.map +1 -1
- package/dist/components/chat-components/copilot-chat.mjs +19 -19
- package/dist/components/chat-components/default-empty-screen.mjs +5 -5
- package/dist/components/chat-components/external-link.d.ts +1 -1
- package/dist/components/chat-components/external-link.mjs +1 -1
- package/dist/components/chat-components/markdown.mjs +1 -1
- package/dist/components/chat-components/prompt-form.d.ts +1 -1
- package/dist/components/chat-components/prompt-form.mjs +6 -6
- package/dist/components/chat-components/theme-toggle.mjs +3 -3
- package/dist/components/chat-components/ui/alert-dialog.mjs +3 -3
- package/dist/components/chat-components/ui/badge.mjs +1 -1
- package/dist/components/chat-components/ui/badge.mjs.map +1 -1
- package/dist/components/chat-components/ui/button.mjs +2 -2
- package/dist/components/chat-components/ui/codeblock.mjs +5 -5
- package/dist/components/chat-components/ui/dialog.mjs +8 -31
- package/dist/components/chat-components/ui/dialog.mjs.map +1 -1
- package/dist/components/chat-components/ui/dropdown-menu.mjs +3 -11
- package/dist/components/chat-components/ui/dropdown-menu.mjs.map +1 -1
- package/dist/components/chat-components/ui/icons.mjs +2 -2
- package/dist/components/chat-components/ui/input.mjs +1 -1
- package/dist/components/chat-components/ui/input.mjs.map +1 -1
- package/dist/components/chat-components/ui/label.mjs +1 -1
- package/dist/components/chat-components/ui/label.mjs.map +1 -1
- package/dist/components/chat-components/ui/select.mjs +2 -2
- package/dist/components/chat-components/ui/select.mjs.map +1 -1
- package/dist/components/chat-components/ui/separator.mjs +2 -2
- package/dist/components/chat-components/ui/sheet.mjs +6 -23
- package/dist/components/chat-components/ui/sheet.mjs.map +1 -1
- package/dist/components/chat-components/ui/switch.mjs +1 -1
- package/dist/components/chat-components/ui/switch.mjs.map +1 -1
- package/dist/components/chat-components/ui/textarea.mjs +1 -1
- package/dist/components/chat-components/ui/textarea.mjs.map +1 -1
- package/dist/components/chat-components/ui/tooltip.mjs +2 -2
- package/dist/components/index.mjs +21 -21
- package/dist/components/sidebar/copilot-sidebar-ui-provider.d.ts +1 -1
- package/dist/components/sidebar/copilot-sidebar-ui-provider.mjs +21 -21
- package/dist/components/sidebar/copilot-sidebar.mjs +20 -20
- package/dist/hooks/use-at-bottom.mjs +1 -1
- package/dist/hooks/use-copy-to-clipboard.d.ts +1 -1
- package/dist/hooks/use-copy-to-clipboard.mjs +1 -1
- package/dist/hooks/use-enter-submit.mjs +1 -1
- package/dist/index.mjs +21 -21
- package/dist/lib/utils.mjs +1 -1
- package/package.json +2 -2
- package/src/components/chat-components/chat-list.tsx +2 -6
- package/src/components/chat-components/chat-message-actions.tsx +2 -6
- package/src/components/chat-components/chat-message.tsx +2 -6
- package/src/components/chat-components/chat-panel.tsx +3 -17
- package/src/components/chat-components/clear-history.tsx +1 -2
- package/src/components/chat-components/copilot-chat.tsx +6 -5
- package/src/components/chat-components/default-empty-screen.tsx +3 -9
- package/src/components/chat-components/external-link.tsx +2 -14
- package/src/components/chat-components/markdown.tsx +1 -2
- package/src/components/chat-components/prompt-form.tsx +2 -8
- package/src/components/chat-components/ui/alert-dialog.tsx +9 -33
- package/src/components/chat-components/ui/badge.tsx +3 -6
- package/src/components/chat-components/ui/button.tsx +7 -15
- package/src/components/chat-components/ui/codeblock.tsx +1 -4
- package/src/components/chat-components/ui/dialog.tsx +8 -30
- package/src/components/chat-components/ui/dropdown-menu.tsx +7 -18
- package/src/components/chat-components/ui/icons.tsx +6 -29
- package/src/components/chat-components/ui/input.tsx +3 -4
- package/src/components/chat-components/ui/label.tsx +3 -8
- package/src/components/chat-components/ui/select.tsx +4 -4
- package/src/components/chat-components/ui/separator.tsx +13 -18
- package/src/components/chat-components/ui/sheet.tsx +7 -23
- package/src/components/chat-components/ui/switch.tsx +2 -2
- package/src/components/chat-components/ui/textarea.tsx +3 -4
- package/src/components/chat-components/ui/tooltip.tsx +1 -1
- package/src/components/sidebar/copilot-sidebar-ui-provider.tsx +2 -6
- package/src/components/sidebar/copilot-sidebar.tsx +1 -3
- package/src/hooks/use-at-bottom.tsx +1 -4
- package/src/hooks/use-copy-to-clipboard.tsx +1 -3
- package/src/hooks/use-enter-submit.tsx +2 -8
- package/src/lib/utils.ts +2 -5
- package/dist/chunk-2NO6SF5H.mjs.map +0 -1
- package/dist/chunk-6LAC5RA2.mjs.map +0 -1
- package/dist/chunk-6LRNF2VU.mjs.map +0 -1
- package/dist/chunk-6UJWRTL6.mjs.map +0 -1
- package/dist/chunk-APH6ZQHG.mjs.map +0 -1
- package/dist/chunk-BIPCPNHG.mjs.map +0 -1
- package/dist/chunk-DOMJCSI6.mjs +0 -26
- package/dist/chunk-DOMJCSI6.mjs.map +0 -1
- package/dist/chunk-HKSY5T7Y.mjs.map +0 -1
- package/dist/chunk-I2AB5FK4.mjs.map +0 -1
- package/dist/chunk-KR7MH7XO.mjs.map +0 -1
- package/dist/chunk-KXJV37FS.mjs.map +0 -1
- package/dist/chunk-LMCFSE4V.mjs.map +0 -1
- package/dist/chunk-N7KB3Z57.mjs.map +0 -1
- package/dist/chunk-TUPGAO7T.mjs.map +0 -1
- package/dist/chunk-TVTG3V4F.mjs.map +0 -1
- package/dist/chunk-UKKJ6H2K.mjs.map +0 -1
- package/dist/chunk-V6QYUEJR.mjs.map +0 -1
- package/dist/chunk-ZB6JHNDT.mjs.map +0 -1
- /package/dist/{chunk-RSONJDLO.mjs.map → chunk-6RG3YDAC.mjs.map} +0 -0
|
@@ -25,13 +25,12 @@ const DropdownMenuSubContent = React.forwardRef<
|
|
|
25
25
|
ref={ref}
|
|
26
26
|
className={cn(
|
|
27
27
|
"z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md animate-in data-[side=bottom]:slide-in-from-top-1 data-[side=left]:slide-in-from-right-1 data-[side=right]:slide-in-from-left-1 data-[side=top]:slide-in-from-bottom-1",
|
|
28
|
-
className
|
|
28
|
+
className,
|
|
29
29
|
)}
|
|
30
30
|
{...props}
|
|
31
31
|
/>
|
|
32
32
|
));
|
|
33
|
-
DropdownMenuSubContent.displayName =
|
|
34
|
-
DropdownMenuPrimitive.SubContent.displayName;
|
|
33
|
+
DropdownMenuSubContent.displayName = DropdownMenuPrimitive.SubContent.displayName;
|
|
35
34
|
|
|
36
35
|
const DropdownMenuContent = React.forwardRef<
|
|
37
36
|
React.ElementRef<typeof DropdownMenuPrimitive.Content>,
|
|
@@ -43,7 +42,7 @@ const DropdownMenuContent = React.forwardRef<
|
|
|
43
42
|
sideOffset={sideOffset}
|
|
44
43
|
className={cn(
|
|
45
44
|
"z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow animate-in data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
|
|
46
|
-
className
|
|
45
|
+
className,
|
|
47
46
|
)}
|
|
48
47
|
{...props}
|
|
49
48
|
/>
|
|
@@ -62,7 +61,7 @@ const DropdownMenuItem = React.forwardRef<
|
|
|
62
61
|
className={cn(
|
|
63
62
|
"relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
64
63
|
inset && "pl-8",
|
|
65
|
-
className
|
|
64
|
+
className,
|
|
66
65
|
)}
|
|
67
66
|
{...props}
|
|
68
67
|
/>
|
|
@@ -77,11 +76,7 @@ const DropdownMenuLabel = React.forwardRef<
|
|
|
77
76
|
>(({ className, inset, ...props }, ref) => (
|
|
78
77
|
<DropdownMenuPrimitive.Label
|
|
79
78
|
ref={ref}
|
|
80
|
-
className={cn(
|
|
81
|
-
"px-2 py-1.5 text-sm font-semibold",
|
|
82
|
-
inset && "pl-8",
|
|
83
|
-
className
|
|
84
|
-
)}
|
|
79
|
+
className={cn("px-2 py-1.5 text-sm font-semibold", inset && "pl-8", className)}
|
|
85
80
|
{...props}
|
|
86
81
|
/>
|
|
87
82
|
));
|
|
@@ -99,15 +94,9 @@ const DropdownMenuSeparator = React.forwardRef<
|
|
|
99
94
|
));
|
|
100
95
|
DropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName;
|
|
101
96
|
|
|
102
|
-
const DropdownMenuShortcut = ({
|
|
103
|
-
className,
|
|
104
|
-
...props
|
|
105
|
-
}: React.HTMLAttributes<HTMLSpanElement>) => {
|
|
97
|
+
const DropdownMenuShortcut = ({ className, ...props }: React.HTMLAttributes<HTMLSpanElement>) => {
|
|
106
98
|
return (
|
|
107
|
-
<span
|
|
108
|
-
className={cn("ml-auto text-xs tracking-widest opacity-60", className)}
|
|
109
|
-
{...props}
|
|
110
|
-
/>
|
|
99
|
+
<span className={cn("ml-auto text-xs tracking-widest opacity-60", className)} {...props} />
|
|
111
100
|
);
|
|
112
101
|
};
|
|
113
102
|
DropdownMenuShortcut.displayName = "DropdownMenuShortcut";
|
|
@@ -29,11 +29,7 @@ function IconNextChat({
|
|
|
29
29
|
gradientUnits="userSpaceOnUse"
|
|
30
30
|
>
|
|
31
31
|
<stop stopColor={inverted ? "white" : "black"} />
|
|
32
|
-
<stop
|
|
33
|
-
offset={1}
|
|
34
|
-
stopColor={inverted ? "white" : "black"}
|
|
35
|
-
stopOpacity={0}
|
|
36
|
-
/>
|
|
32
|
+
<stop offset={1} stopColor={inverted ? "white" : "black"} stopOpacity={0} />
|
|
37
33
|
</linearGradient>
|
|
38
34
|
<linearGradient
|
|
39
35
|
id={`gradient-${id}-2`}
|
|
@@ -44,11 +40,7 @@ function IconNextChat({
|
|
|
44
40
|
gradientUnits="userSpaceOnUse"
|
|
45
41
|
>
|
|
46
42
|
<stop stopColor={inverted ? "white" : "black"} />
|
|
47
|
-
<stop
|
|
48
|
-
offset={1}
|
|
49
|
-
stopColor={inverted ? "white" : "black"}
|
|
50
|
-
stopOpacity={0}
|
|
51
|
-
/>
|
|
43
|
+
<stop offset={1} stopColor={inverted ? "white" : "black"} stopOpacity={0} />
|
|
52
44
|
</linearGradient>
|
|
53
45
|
</defs>
|
|
54
46
|
<path
|
|
@@ -76,13 +68,7 @@ function IconNextChat({
|
|
|
76
68
|
d="M14.2896 14.0018L7.146 4.8H5.80005V11.1973H6.87681V6.16743L13.4444 14.6529C13.7407 14.4545 14.0231 14.2369 14.2896 14.0018Z"
|
|
77
69
|
fill={`url(#gradient-${id}-1)`}
|
|
78
70
|
/>
|
|
79
|
-
<rect
|
|
80
|
-
x="11.2222"
|
|
81
|
-
y="4.8"
|
|
82
|
-
width="1.06667"
|
|
83
|
-
height="6.4"
|
|
84
|
-
fill={`url(#gradient-${id}-2)`}
|
|
85
|
-
/>
|
|
71
|
+
<rect x="11.2222" y="4.8" width="1.06667" height="6.4" fill={`url(#gradient-${id}-2)`} />
|
|
86
72
|
</g>
|
|
87
73
|
</svg>
|
|
88
74
|
);
|
|
@@ -113,10 +99,7 @@ function IconVercel({ className, ...props }: React.ComponentProps<"svg">) {
|
|
|
113
99
|
className={cn("h-4 w-4", className)}
|
|
114
100
|
{...props}
|
|
115
101
|
>
|
|
116
|
-
<path
|
|
117
|
-
d="M37.5896 0.25L74.5396 64.25H0.639648L37.5896 0.25Z"
|
|
118
|
-
fill="currentColor"
|
|
119
|
-
></path>
|
|
102
|
+
<path d="M37.5896 0.25L74.5396 64.25H0.639648L37.5896 0.25Z" fill="currentColor"></path>
|
|
120
103
|
</svg>
|
|
121
104
|
);
|
|
122
105
|
}
|
|
@@ -442,10 +425,7 @@ function IconUsers({ className, ...props }: React.ComponentProps<"svg">) {
|
|
|
442
425
|
);
|
|
443
426
|
}
|
|
444
427
|
|
|
445
|
-
function IconExternalLink({
|
|
446
|
-
className,
|
|
447
|
-
...props
|
|
448
|
-
}: React.ComponentProps<"svg">) {
|
|
428
|
+
function IconExternalLink({ className, ...props }: React.ComponentProps<"svg">) {
|
|
449
429
|
return (
|
|
450
430
|
<svg
|
|
451
431
|
xmlns="http://www.w3.org/2000/svg"
|
|
@@ -459,10 +439,7 @@ function IconExternalLink({
|
|
|
459
439
|
);
|
|
460
440
|
}
|
|
461
441
|
|
|
462
|
-
function IconChevronUpDown({
|
|
463
|
-
className,
|
|
464
|
-
...props
|
|
465
|
-
}: React.ComponentProps<"svg">) {
|
|
442
|
+
function IconChevronUpDown({ className, ...props }: React.ComponentProps<"svg">) {
|
|
466
443
|
return (
|
|
467
444
|
<svg
|
|
468
445
|
xmlns="http://www.w3.org/2000/svg"
|
|
@@ -2,8 +2,7 @@ import * as React from "react";
|
|
|
2
2
|
|
|
3
3
|
import { cn } from "../../../lib/utils";
|
|
4
4
|
|
|
5
|
-
export interface InputProps
|
|
6
|
-
extends React.InputHTMLAttributes<HTMLInputElement> {}
|
|
5
|
+
export interface InputProps extends React.InputHTMLAttributes<HTMLInputElement> {}
|
|
7
6
|
|
|
8
7
|
const Input = React.forwardRef<HTMLInputElement, InputProps>(
|
|
9
8
|
({ className, type, ...props }, ref) => {
|
|
@@ -12,13 +11,13 @@ const Input = React.forwardRef<HTMLInputElement, InputProps>(
|
|
|
12
11
|
type={type}
|
|
13
12
|
className={cn(
|
|
14
13
|
"flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",
|
|
15
|
-
className
|
|
14
|
+
className,
|
|
16
15
|
)}
|
|
17
16
|
ref={ref}
|
|
18
17
|
{...props}
|
|
19
18
|
/>
|
|
20
19
|
);
|
|
21
|
-
}
|
|
20
|
+
},
|
|
22
21
|
);
|
|
23
22
|
Input.displayName = "Input";
|
|
24
23
|
|
|
@@ -7,19 +7,14 @@ import { cva, type VariantProps } from "class-variance-authority";
|
|
|
7
7
|
import { cn } from "../../../lib/utils";
|
|
8
8
|
|
|
9
9
|
const labelVariants = cva(
|
|
10
|
-
"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"
|
|
10
|
+
"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",
|
|
11
11
|
);
|
|
12
12
|
|
|
13
13
|
const Label = React.forwardRef<
|
|
14
14
|
React.ElementRef<typeof LabelPrimitive.Root>,
|
|
15
|
-
React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root> &
|
|
16
|
-
VariantProps<typeof labelVariants>
|
|
15
|
+
React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root> & VariantProps<typeof labelVariants>
|
|
17
16
|
>(({ className, ...props }, ref) => (
|
|
18
|
-
<LabelPrimitive.Root
|
|
19
|
-
ref={ref}
|
|
20
|
-
className={cn(labelVariants(), className)}
|
|
21
|
-
{...props}
|
|
22
|
-
/>
|
|
17
|
+
<LabelPrimitive.Root ref={ref} className={cn(labelVariants(), className)} {...props} />
|
|
23
18
|
));
|
|
24
19
|
Label.displayName = LabelPrimitive.Root.displayName;
|
|
25
20
|
|
|
@@ -20,7 +20,7 @@ const SelectTrigger = React.forwardRef<
|
|
|
20
20
|
ref={ref}
|
|
21
21
|
className={cn(
|
|
22
22
|
"flex h-9 w-full items-center justify-between rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",
|
|
23
|
-
className
|
|
23
|
+
className,
|
|
24
24
|
)}
|
|
25
25
|
{...props}
|
|
26
26
|
>
|
|
@@ -42,7 +42,7 @@ const SelectContent = React.forwardRef<
|
|
|
42
42
|
className={cn(
|
|
43
43
|
"relative z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md animate-in fade-in-80",
|
|
44
44
|
position === "popper" && "translate-y-1",
|
|
45
|
-
className
|
|
45
|
+
className,
|
|
46
46
|
)}
|
|
47
47
|
position={position}
|
|
48
48
|
{...props}
|
|
@@ -51,7 +51,7 @@ const SelectContent = React.forwardRef<
|
|
|
51
51
|
className={cn(
|
|
52
52
|
"p-1",
|
|
53
53
|
position === "popper" &&
|
|
54
|
-
"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"
|
|
54
|
+
"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]",
|
|
55
55
|
)}
|
|
56
56
|
>
|
|
57
57
|
{children}
|
|
@@ -81,7 +81,7 @@ const SelectItem = React.forwardRef<
|
|
|
81
81
|
ref={ref}
|
|
82
82
|
className={cn(
|
|
83
83
|
"relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
84
|
-
className
|
|
84
|
+
className,
|
|
85
85
|
)}
|
|
86
86
|
{...props}
|
|
87
87
|
>
|
|
@@ -8,24 +8,19 @@ import { cn } from "../../../lib/utils";
|
|
|
8
8
|
const Separator = React.forwardRef<
|
|
9
9
|
React.ElementRef<typeof SeparatorPrimitive.Root>,
|
|
10
10
|
React.ComponentPropsWithoutRef<typeof SeparatorPrimitive.Root>
|
|
11
|
-
>(
|
|
12
|
-
|
|
13
|
-
{
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
)}
|
|
25
|
-
{...props}
|
|
26
|
-
/>
|
|
27
|
-
)
|
|
28
|
-
);
|
|
11
|
+
>(({ className, orientation = "horizontal", decorative = true, ...props }, ref) => (
|
|
12
|
+
<SeparatorPrimitive.Root
|
|
13
|
+
ref={ref}
|
|
14
|
+
decorative={decorative}
|
|
15
|
+
orientation={orientation}
|
|
16
|
+
className={cn(
|
|
17
|
+
"shrink-0 bg-border",
|
|
18
|
+
orientation === "horizontal" ? "h-[1px] w-full" : "h-full w-[1px]",
|
|
19
|
+
className,
|
|
20
|
+
)}
|
|
21
|
+
{...props}
|
|
22
|
+
/>
|
|
23
|
+
));
|
|
29
24
|
Separator.displayName = SeparatorPrimitive.Root.displayName;
|
|
30
25
|
|
|
31
26
|
export { Separator };
|
|
@@ -12,15 +12,8 @@ const SheetTrigger = SheetPrimitive.Trigger;
|
|
|
12
12
|
|
|
13
13
|
const SheetClose = SheetPrimitive.Close;
|
|
14
14
|
|
|
15
|
-
const SheetPortal = ({
|
|
16
|
-
className,
|
|
17
|
-
children,
|
|
18
|
-
...props
|
|
19
|
-
}: SheetPrimitive.DialogPortalProps) => (
|
|
20
|
-
<SheetPrimitive.Portal
|
|
21
|
-
className={cn("fixed inset-0 z-50 flex", className)}
|
|
22
|
-
{...props}
|
|
23
|
-
>
|
|
15
|
+
const SheetPortal = ({ className, children, ...props }: SheetPrimitive.DialogPortalProps) => (
|
|
16
|
+
<SheetPrimitive.Portal className={cn("fixed inset-0 z-50 flex", className)} {...props}>
|
|
24
17
|
{children}
|
|
25
18
|
</SheetPrimitive.Portal>
|
|
26
19
|
);
|
|
@@ -33,7 +26,7 @@ const SheetOverlay = React.forwardRef<
|
|
|
33
26
|
<SheetPrimitive.Overlay
|
|
34
27
|
className={cn(
|
|
35
28
|
"fixed inset-0 z-50 transition-all duration-100 data-[state=closed]:animate-out data-[state=closed]:fade-out data-[state=open]:fade-in",
|
|
36
|
-
className
|
|
29
|
+
className,
|
|
37
30
|
)}
|
|
38
31
|
{...props}
|
|
39
32
|
ref={ref}
|
|
@@ -50,7 +43,7 @@ const SheetContent = React.forwardRef<
|
|
|
50
43
|
ref={ref}
|
|
51
44
|
className={cn(
|
|
52
45
|
"fixed z-50 h-full border-r bg-background p-6 opacity-100 shadow-lg data-[state=closed]:animate-slide-to-left data-[state=open]:animate-slide-from-left",
|
|
53
|
-
className
|
|
46
|
+
className,
|
|
54
47
|
)}
|
|
55
48
|
{...props}
|
|
56
49
|
>
|
|
@@ -64,23 +57,14 @@ const SheetContent = React.forwardRef<
|
|
|
64
57
|
));
|
|
65
58
|
SheetContent.displayName = SheetPrimitive.Content.displayName;
|
|
66
59
|
|
|
67
|
-
const SheetHeader = ({
|
|
68
|
-
className,
|
|
69
|
-
...props
|
|
70
|
-
}: React.HTMLAttributes<HTMLDivElement>) => (
|
|
60
|
+
const SheetHeader = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (
|
|
71
61
|
<div className={cn("flex flex-col space-y-2", className)} {...props} />
|
|
72
62
|
);
|
|
73
63
|
SheetHeader.displayName = "SheetHeader";
|
|
74
64
|
|
|
75
|
-
const SheetFooter = ({
|
|
76
|
-
className,
|
|
77
|
-
...props
|
|
78
|
-
}: React.HTMLAttributes<HTMLDivElement>) => (
|
|
65
|
+
const SheetFooter = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (
|
|
79
66
|
<div
|
|
80
|
-
className={cn(
|
|
81
|
-
"flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",
|
|
82
|
-
className
|
|
83
|
-
)}
|
|
67
|
+
className={cn("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2", className)}
|
|
84
68
|
{...props}
|
|
85
69
|
/>
|
|
86
70
|
);
|
|
@@ -12,14 +12,14 @@ const Switch = React.forwardRef<
|
|
|
12
12
|
<SwitchPrimitives.Root
|
|
13
13
|
className={cn(
|
|
14
14
|
"peer inline-flex h-[24px] w-[44px] shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",
|
|
15
|
-
className
|
|
15
|
+
className,
|
|
16
16
|
)}
|
|
17
17
|
{...props}
|
|
18
18
|
ref={ref}
|
|
19
19
|
>
|
|
20
20
|
<SwitchPrimitives.Thumb
|
|
21
21
|
className={cn(
|
|
22
|
-
"pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0"
|
|
22
|
+
"pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0",
|
|
23
23
|
)}
|
|
24
24
|
/>
|
|
25
25
|
</SwitchPrimitives.Root>
|
|
@@ -2,8 +2,7 @@ import * as React from "react";
|
|
|
2
2
|
|
|
3
3
|
import { cn } from "../../../lib/utils";
|
|
4
4
|
|
|
5
|
-
export interface TextareaProps
|
|
6
|
-
extends React.TextareaHTMLAttributes<HTMLTextAreaElement> {}
|
|
5
|
+
export interface TextareaProps extends React.TextareaHTMLAttributes<HTMLTextAreaElement> {}
|
|
7
6
|
|
|
8
7
|
const Textarea = React.forwardRef<HTMLTextAreaElement, TextareaProps>(
|
|
9
8
|
({ className, ...props }, ref) => {
|
|
@@ -11,13 +10,13 @@ const Textarea = React.forwardRef<HTMLTextAreaElement, TextareaProps>(
|
|
|
11
10
|
<textarea
|
|
12
11
|
className={cn(
|
|
13
12
|
"flex min-h-[80px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",
|
|
14
|
-
className
|
|
13
|
+
className,
|
|
15
14
|
)}
|
|
16
15
|
ref={ref}
|
|
17
16
|
{...props}
|
|
18
17
|
/>
|
|
19
18
|
);
|
|
20
|
-
}
|
|
19
|
+
},
|
|
21
20
|
);
|
|
22
21
|
Textarea.displayName = "Textarea";
|
|
23
22
|
|
|
@@ -20,7 +20,7 @@ const TooltipContent = React.forwardRef<
|
|
|
20
20
|
sideOffset={sideOffset}
|
|
21
21
|
className={cn(
|
|
22
22
|
"z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-xs font-medium text-popover-foreground shadow-md animate-in fade-in-50 data-[side=bottom]:slide-in-from-top-1 data-[side=left]:slide-in-from-right-1 data-[side=right]:slide-in-from-left-1 data-[side=top]:slide-in-from-bottom-1",
|
|
23
|
-
className
|
|
23
|
+
className,
|
|
24
24
|
)}
|
|
25
25
|
{...props}
|
|
26
26
|
/>
|
|
@@ -8,9 +8,7 @@ export interface CopilotSidebarUIProviderProps {
|
|
|
8
8
|
children: ReactNode;
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
export function CopilotSidebarUIProvider({
|
|
12
|
-
children,
|
|
13
|
-
}: CopilotSidebarUIProviderProps) {
|
|
11
|
+
export function CopilotSidebarUIProvider({ children }: CopilotSidebarUIProviderProps) {
|
|
14
12
|
const [sidebarOpen, setSidebarOpen] = useState(true);
|
|
15
13
|
|
|
16
14
|
const toggleSidebar = useCallback(() => {
|
|
@@ -18,9 +16,7 @@ export function CopilotSidebarUIProvider({
|
|
|
18
16
|
}, []);
|
|
19
17
|
|
|
20
18
|
return (
|
|
21
|
-
<CopilotSidebarContext.Provider
|
|
22
|
-
value={{ isSidebarOpen: sidebarOpen, toggleSidebar }}
|
|
23
|
-
>
|
|
19
|
+
<CopilotSidebarContext.Provider value={{ isSidebarOpen: sidebarOpen, toggleSidebar }}>
|
|
24
20
|
<>
|
|
25
21
|
<div
|
|
26
22
|
style={{
|
|
@@ -22,9 +22,7 @@ import { XMarkIcon } from "@heroicons/react/24/outline";
|
|
|
22
22
|
function TopBar(props: SidebarProps): JSX.Element {
|
|
23
23
|
return (
|
|
24
24
|
<div className="py-6 flex bg-gray-50 items-center justify-between px-4">
|
|
25
|
-
<h1 className="text-base font-semibold leading-6 text-gray-900">
|
|
26
|
-
Copilot Chat
|
|
27
|
-
</h1>
|
|
25
|
+
<h1 className="text-base font-semibold leading-6 text-gray-900">Copilot Chat</h1>
|
|
28
26
|
<div className="ml-3 flex h-7 items-center">
|
|
29
27
|
<button
|
|
30
28
|
type="button"
|
|
@@ -5,10 +5,7 @@ export function useAtBottom(offset = 0) {
|
|
|
5
5
|
|
|
6
6
|
React.useEffect(() => {
|
|
7
7
|
const handleScroll = () => {
|
|
8
|
-
setIsAtBottom(
|
|
9
|
-
window.innerHeight + window.scrollY >=
|
|
10
|
-
document.body.offsetHeight - offset
|
|
11
|
-
);
|
|
8
|
+
setIsAtBottom(window.innerHeight + window.scrollY >= document.body.offsetHeight - offset);
|
|
12
9
|
};
|
|
13
10
|
|
|
14
11
|
window.addEventListener("scroll", handleScroll, { passive: true });
|
|
@@ -6,9 +6,7 @@ export interface useCopyToClipboardProps {
|
|
|
6
6
|
timeout?: number;
|
|
7
7
|
}
|
|
8
8
|
|
|
9
|
-
export function useCopyToClipboard({
|
|
10
|
-
timeout = 2000,
|
|
11
|
-
}: useCopyToClipboardProps) {
|
|
9
|
+
export function useCopyToClipboard({ timeout = 2000 }: useCopyToClipboardProps) {
|
|
12
10
|
const [isCopied, setIsCopied] = React.useState<Boolean>(false);
|
|
13
11
|
|
|
14
12
|
const copyToClipboard = (value: string) => {
|
|
@@ -6,14 +6,8 @@ export function useEnterSubmit(): {
|
|
|
6
6
|
} {
|
|
7
7
|
const formRef = useRef<HTMLFormElement>(null);
|
|
8
8
|
|
|
9
|
-
const handleKeyDown = (
|
|
10
|
-
event
|
|
11
|
-
): void => {
|
|
12
|
-
if (
|
|
13
|
-
event.key === "Enter" &&
|
|
14
|
-
!event.shiftKey &&
|
|
15
|
-
!event.nativeEvent.isComposing
|
|
16
|
-
) {
|
|
9
|
+
const handleKeyDown = (event: React.KeyboardEvent<HTMLTextAreaElement>): void => {
|
|
10
|
+
if (event.key === "Enter" && !event.shiftKey && !event.nativeEvent.isComposing) {
|
|
17
11
|
formRef.current?.requestSubmit();
|
|
18
12
|
event.preventDefault();
|
|
19
13
|
}
|
package/src/lib/utils.ts
CHANGED
|
@@ -8,13 +8,10 @@ export function cn(...inputs: ClassValue[]) {
|
|
|
8
8
|
|
|
9
9
|
export const nanoid = customAlphabet(
|
|
10
10
|
"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",
|
|
11
|
-
7
|
|
11
|
+
7,
|
|
12
12
|
); // 7-character random string
|
|
13
13
|
|
|
14
|
-
export async function fetcher<JSON = any>(
|
|
15
|
-
input: RequestInfo,
|
|
16
|
-
init?: RequestInit
|
|
17
|
-
): Promise<JSON> {
|
|
14
|
+
export async function fetcher<JSON = any>(input: RequestInfo, init?: RequestInit): Promise<JSON> {
|
|
18
15
|
const res = await fetch(input, init);
|
|
19
16
|
|
|
20
17
|
if (!res.ok) {
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/chat-components/copilot-chat.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;AASA,SAAS,sBAAsB;AAuBrB,SACE,KADF;AAhCV;AAmBO,SAAS,YAAY;AAAA,EAC1B;AAAA,EACA;AAAA,EACA;AAAA,EACA,cAAc;AAChB,GAAqB;AACnB,QAAM,EAAE,iBAAiB,QAAQ,QAAQ,MAAM,WAAW,OAAO,SAAS,IACxE,eAAe,EAAE,IAAI,iBAAiB,kBAAkB,CAAC;AAE3D,SACE,qBAAC;AAAA,IAAI,WAAU;AAAA,IACb;AAAA,0BAAC;AAAA,QAAI,WAAU;AAAA,QACZ,0BAAgB,SACf,qBAAC;AAAA,UAAI,WAAU;AAAA,UACb;AAAA,gCAAC;AAAA,cAAS,UAAU;AAAA,aAAiB;AAAA,YACrC,oBAAC;AAAA,cAAiB,iBAAiB;AAAA,aAAW;AAAA;AAAA,SAChD,IAEA,oBAAC;AAAA,UAAY;AAAA,SAAoB;AAAA,OAErC;AAAA,MAEA,oBAAC;AAAA,QAAI,WAAU;AAAA,QACb,8BAAC;AAAA,UACC;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA,UAAU;AAAA,UACV;AAAA,UACA;AAAA,SACF;AAAA,OACF;AAAA;AAAA,GACF;AAEJ","sourcesContent":["\"use client\";\n\nimport React from \"react\";\n\nimport { ChatList } from \"./chat-list\";\nimport { ChatPanel } from \"./chat-panel\";\nimport { DefaultEmptyScreen, EmptyScreenProps } from \"./default-empty-screen\";\nimport { ChatScrollAnchor } from \"./chat-scroll-anchor\";\nimport { UseCopilotChatOptions } from \"@copilotkit/react-core\";\nimport { useCopilotChat } from \"@copilotkit/react-core\";\n\ninterface ChatComponentInjectionsProps {\n EmptyScreen?: React.FC<EmptyScreenProps>;\n}\n\ninterface CopilotChatProps\n extends UseCopilotChatOptions,\n ChatComponentInjectionsProps {}\n\nexport function CopilotChat({\n id,\n initialMessages,\n makeSystemMessage,\n EmptyScreen = DefaultEmptyScreen,\n}: CopilotChatProps) {\n const { visibleMessages, append, reload, stop, isLoading, input, setInput } =\n useCopilotChat({ id, initialMessages, makeSystemMessage });\n\n return (\n <div className=\"w-full h-full flex flex-col overflow-hidden box-border items-start\">\n <div className=\"pt-5 px-5 overflow-y-auto overflow-x-hidden w-full flex-grow\">\n {visibleMessages.length ? (\n <div className=\"pl-0 pr-6\">\n <ChatList messages={visibleMessages} />\n <ChatScrollAnchor trackVisibility={isLoading} />\n </div>\n ) : (\n <EmptyScreen setInput={setInput} />\n )}\n </div>\n\n <div className=\"flex-shrink-0 w-full\">\n <ChatPanel\n id={id}\n isLoading={isLoading}\n stop={stop}\n append={append}\n reload={reload}\n messages={visibleMessages}\n input={input}\n setInput={setInput}\n />\n </div>\n </div>\n );\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/hooks/use-copy-to-clipboard.tsx"],"names":[],"mappings":";AAEA,YAAY,WAAW;AAFvB;AAQO,SAAS,mBAAmB;AAAA,EACjC,UAAU;AACZ,GAA4B;AAC1B,QAAM,CAAC,UAAU,WAAW,IAAU,eAAkB,KAAK;AAE7D,QAAM,kBAAkB,CAAC,UAAkB;AAb7C;AAcI,QAAI,OAAO,WAAW,eAAe,GAAC,eAAU,cAAV,mBAAqB,YAAW;AACpE;AAAA,IACF;AAEA,QAAI,CAAC,OAAO;AACV;AAAA,IACF;AAEA,cAAU,UAAU,UAAU,KAAK,EAAE,KAAK,MAAM;AAC9C,kBAAY,IAAI;AAEhB,iBAAW,MAAM;AACf,oBAAY,KAAK;AAAA,MACnB,GAAG,OAAO;AAAA,IACZ,CAAC;AAAA,EACH;AAEA,SAAO,EAAE,UAAU,gBAAgB;AACrC","sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\n\nexport interface useCopyToClipboardProps {\n timeout?: number;\n}\n\nexport function useCopyToClipboard({\n timeout = 2000,\n}: useCopyToClipboardProps) {\n const [isCopied, setIsCopied] = React.useState<Boolean>(false);\n\n const copyToClipboard = (value: string) => {\n if (typeof window === \"undefined\" || !navigator.clipboard?.writeText) {\n return;\n }\n\n if (!value) {\n return;\n }\n\n navigator.clipboard.writeText(value).then(() => {\n setIsCopied(true);\n\n setTimeout(() => {\n setIsCopied(false);\n }, timeout);\n });\n };\n\n return { isCopied, copyToClipboard };\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/chat-components/markdown.tsx"],"names":[],"mappings":";AAAA,SAAa,YAAY;AACzB,OAAO,mBAAgC;AAEhC,IAAM,wBAAqC;AAAA,EAChD;AAAA,EACA,CAAC,WAAW,cACV,UAAU,aAAa,UAAU,YACjC,UAAU,cAAc,UAAU;AACtC","sourcesContent":["import { FC, memo } from \"react\";\nimport ReactMarkdown, { Options } from \"react-markdown\";\n\nexport const MemoizedReactMarkdown: FC<Options> = memo(\n ReactMarkdown,\n (prevProps, nextProps) =>\n prevProps.children === nextProps.children &&\n prevProps.className === nextProps.className\n);\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/chat-components/chat-message-actions.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAiCM,SACc,KADd;AAjCN;AAaO,SAAS,mBAAmB,IAIP;AAJO,eACjC;AAAA;AAAA,IACA;AAAA,EAfF,IAamC,IAG9B,kBAH8B,IAG9B;AAAA,IAFH;AAAA,IACA;AAAA;AAGA,QAAM,EAAE,UAAU,gBAAgB,IAAI,mBAAmB,EAAE,SAAS,IAAK,CAAC;AAE1E,QAAM,SAAS,MAAM;AACnB,QAAI;AAAU;AACd,oBAAgB,QAAQ,OAAO;AAAA,EACjC;AAEA,SACE,oBAAC;AAAA,IACC,WAAW;AAAA,MACT;AAAA,MACA;AAAA,IACF;AAAA,KACI,QALL;AAAA,IAOC,+BAAC;AAAA,MAAO,SAAQ;AAAA,MAAQ,MAAK;AAAA,MAAO,SAAS;AAAA,MAC1C;AAAA,mBAAW,oBAAC,aAAU,IAAK,oBAAC,YAAS;AAAA,QACtC,oBAAC;AAAA,UAAK,WAAU;AAAA,UAAU;AAAA,SAAY;AAAA;AAAA,KACxC;AAAA,IACF;AAEJ","sourcesContent":["\"use client\";\n\nimport { type Message } from \"ai\";\n\nimport { Button } from \"./ui/button\";\nimport { IconCheck, IconCopy } from \"./ui/icons\";\nimport { useCopyToClipboard } from \"../../hooks/use-copy-to-clipboard\";\nimport { cn } from \"../../lib/utils\";\n\ninterface ChatMessageActionsProps extends React.ComponentProps<\"div\"> {\n message: Message;\n}\n\nexport function ChatMessageActions({\n message,\n className,\n ...props\n}: ChatMessageActionsProps) {\n const { isCopied, copyToClipboard } = useCopyToClipboard({ timeout: 2000 });\n\n const onCopy = () => {\n if (isCopied) return;\n copyToClipboard(message.content);\n };\n\n return (\n <div\n className={cn(\n \"flex items-center justify-end transition-opacity group-hover:opacity-100 md:absolute md:-right-10 md:-top-2 md:opacity-0\",\n className\n )}\n {...props}\n >\n <Button variant=\"ghost\" size=\"icon\" onClick={onCopy}>\n {isCopied ? <IconCheck /> : <IconCopy />}\n <span className=\"sr-only\">Copy message</span>\n </Button>\n </div>\n );\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/chat-components/chat-panel.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;AAsCY,SAKE,KALF;AAlBL,SAAS,UAAU;AAAA,EACxB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAAmB;AACjB,SACE,oBAAC;AAAA,IACC,WAAU;AAAA,IACV,OAAO,EAAE,OAAO,QAAQ,UAAU,UAAU,WAAW,aAAa;AAAA,IAEpE,+BAAC;AAAA,MAAI,WAAU;AAAA,MACb;AAAA,4BAAC;AAAA,UAAI,WAAU;AAAA,UACZ,sBACC,qBAAC;AAAA,YACC,SAAQ;AAAA,YACR,SAAS,MAAM,KAAK;AAAA,YACpB,WAAU;AAAA,YAEV;AAAA,kCAAC;AAAA,gBAAS,WAAU;AAAA,eAAO;AAAA,cAAE;AAAA;AAAA,WAE/B,KAEA,qCAAU,UAAS,KACjB,qBAAC;AAAA,YACC,SAAQ;AAAA,YACR,SAAS,MAAM,OAAO;AAAA,YACtB,WAAU;AAAA,YAEV;AAAA,kCAAC;AAAA,gBAAY,WAAU;AAAA,eAAO;AAAA,cAAE;AAAA;AAAA,WAElC;AAAA,SAGN;AAAA,QACA,oBAAC;AAAA,UAAI,WAAU;AAAA,UACb,8BAAC;AAAA,YACC,UAAU,CAAO,UAAU;AACzB,oBAAM,OAAO;AAAA,gBACX;AAAA,gBACA,SAAS;AAAA,gBACT,MAAM;AAAA,cACR,CAAC;AAAA,YACH;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,WACF;AAAA,SACF;AAAA;AAAA,KACF;AAAA,GACF;AAEJ","sourcesContent":["import { type UseChatHelpers } from \"ai/react\";\n\nimport { Button } from \"./ui/button\";\nimport { PromptForm } from \"./prompt-form\";\nimport { IconRefresh, IconStop } from \"./ui/icons\";\n\nexport interface ChatPanelProps\n extends Pick<\n UseChatHelpers,\n | \"append\"\n | \"isLoading\"\n | \"reload\"\n | \"messages\"\n | \"stop\"\n | \"input\"\n | \"setInput\"\n > {\n id?: string;\n}\n\nexport function ChatPanel({\n id,\n isLoading,\n stop,\n append,\n reload,\n input,\n setInput,\n messages,\n}: ChatPanelProps) {\n return (\n <div\n className=\"inset-x-0 bottom-0 bg-gradient-to-b from-muted/10 from-10% to-muted/30 to-50% mt-4 mb-8\"\n style={{ width: \"100%\", overflow: \"hidden\", boxSizing: \"border-box\" }}\n >\n <div className=\"mx-auto sm:max-w-2xl sm:px-4\">\n <div className=\"flex h-10 items-center justify-center mb-4\">\n {isLoading ? (\n <Button\n variant=\"outline\"\n onClick={() => stop()}\n className=\"bg-background\"\n >\n <IconStop className=\"mr-2\" />\n Stop generating\n </Button>\n ) : (\n messages?.length > 0 && (\n <Button\n variant=\"outline\"\n onClick={() => reload()}\n className=\"bg-background\"\n >\n <IconRefresh className=\"mr-2\" />\n Regenerate response\n </Button>\n )\n )}\n </div>\n <div className=\"space-y-4 border-2 bg-background px-4 py-2 shadow-lg sm:rounded-xl md:py-4\">\n <PromptForm\n onSubmit={async (value) => {\n await append({\n id,\n content: value,\n role: \"user\",\n });\n }}\n input={input}\n setInput={setInput}\n isLoading={isLoading}\n />\n </div>\n </div>\n </div>\n );\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/hooks/use-enter-submit.tsx"],"names":[],"mappings":";AAAA,SAAS,cAA8B;AAEhC,SAAS,iBAGd;AACA,QAAM,UAAU,OAAwB,IAAI;AAE5C,QAAM,gBAAgB,CACpB,UACS;AAVb;AAWI,QACE,MAAM,QAAQ,WACd,CAAC,MAAM,YACP,CAAC,MAAM,YAAY,aACnB;AACA,oBAAQ,YAAR,mBAAiB;AACjB,YAAM,eAAe;AAAA,IACvB;AAAA,EACF;AAEA,SAAO,EAAE,SAAS,WAAW,cAAc;AAC7C","sourcesContent":["import { useRef, type RefObject } from \"react\";\n\nexport function useEnterSubmit(): {\n formRef: RefObject<HTMLFormElement>;\n onKeyDown: (event: React.KeyboardEvent<HTMLTextAreaElement>) => void;\n} {\n const formRef = useRef<HTMLFormElement>(null);\n\n const handleKeyDown = (\n event: React.KeyboardEvent<HTMLTextAreaElement>\n ): void => {\n if (\n event.key === \"Enter\" &&\n !event.shiftKey &&\n !event.nativeEvent.isComposing\n ) {\n formRef.current?.requestSubmit();\n event.preventDefault();\n }\n };\n\n return { formRef, onKeyDown: handleKeyDown };\n}\n"]}
|
package/dist/chunk-DOMJCSI6.mjs
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { cn } from './chunk-TVTG3V4F.mjs';
|
|
2
|
-
import { __objRest, __spreadValues } from './chunk-MRXNTQOX.mjs';
|
|
3
|
-
import * as React from 'react';
|
|
4
|
-
import * as SeparatorPrimitive from '@radix-ui/react-separator';
|
|
5
|
-
import { jsx } from 'react/jsx-runtime';
|
|
6
|
-
|
|
7
|
-
var Separator = React.forwardRef(
|
|
8
|
-
(_a, ref) => {
|
|
9
|
-
var _b = _a, { className, orientation = "horizontal", decorative = true } = _b, props = __objRest(_b, ["className", "orientation", "decorative"]);
|
|
10
|
-
return /* @__PURE__ */ jsx(SeparatorPrimitive.Root, __spreadValues({
|
|
11
|
-
ref,
|
|
12
|
-
decorative,
|
|
13
|
-
orientation,
|
|
14
|
-
className: cn(
|
|
15
|
-
"shrink-0 bg-border",
|
|
16
|
-
orientation === "horizontal" ? "h-[1px] w-full" : "h-full w-[1px]",
|
|
17
|
-
className
|
|
18
|
-
)
|
|
19
|
-
}, props));
|
|
20
|
-
}
|
|
21
|
-
);
|
|
22
|
-
Separator.displayName = SeparatorPrimitive.Root.displayName;
|
|
23
|
-
|
|
24
|
-
export { Separator };
|
|
25
|
-
//# sourceMappingURL=out.js.map
|
|
26
|
-
//# sourceMappingURL=chunk-DOMJCSI6.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/chat-components/ui/separator.tsx"],"names":[],"mappings":";;;;;;;;;AAEA,YAAY,WAAW;AACvB,YAAY,wBAAwB;AAYhC;AAfJ;AAOA,IAAM,YAAkB;AAAA,EAItB,CACE,IACA,QACA;AAFA,iBAAE,aAAW,cAAc,cAAc,aAAa,KAZ1D,IAYI,IAA+D,kBAA/D,IAA+D,CAA7D,aAAW,eAA4B;AAGzC,+BAAoB,yBAAnB;AAAA,MACC;AAAA,MACA;AAAA,MACA;AAAA,MACA,WAAW;AAAA,QACT;AAAA,QACA,gBAAgB,eAAe,mBAAmB;AAAA,QAClD;AAAA,MACF;AAAA,OACI,MACN;AAAA;AAEJ;AACA,UAAU,cAAiC,wBAAK","sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport * as SeparatorPrimitive from \"@radix-ui/react-separator\";\n\nimport { cn } from \"../../../lib/utils\";\n\nconst Separator = React.forwardRef<\n React.ElementRef<typeof SeparatorPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof SeparatorPrimitive.Root>\n>(\n (\n { className, orientation = \"horizontal\", decorative = true, ...props },\n ref\n ) => (\n <SeparatorPrimitive.Root\n ref={ref}\n decorative={decorative}\n orientation={orientation}\n className={cn(\n \"shrink-0 bg-border\",\n orientation === \"horizontal\" ? \"h-[1px] w-full\" : \"h-full w-[1px]\",\n className\n )}\n {...props}\n />\n )\n);\nSeparator.displayName = SeparatorPrimitive.Root.displayName;\n\nexport { Separator };\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/chat-components/ui/codeblock.tsx"],"names":[],"mappings":"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","sourcesContent":["\"use client\";\n\nimport { FC, memo } from \"react\";\nimport { Prism as SyntaxHighlighter } from \"react-syntax-highlighter\";\n\nimport { useCopyToClipboard } from \"../../../hooks/use-copy-to-clipboard\";\nimport { IconCheck, IconCopy, IconDownload } from \"./icons\";\nimport { Button } from \"./button\";\n\ninterface Props {\n language: string;\n value: string;\n}\n\ninterface languageMap {\n [key: string]: string | undefined;\n}\n\nexport const programmingLanguages: languageMap = {\n javascript: \".js\",\n python: \".py\",\n java: \".java\",\n c: \".c\",\n cpp: \".cpp\",\n \"c++\": \".cpp\",\n \"c#\": \".cs\",\n ruby: \".rb\",\n php: \".php\",\n swift: \".swift\",\n \"objective-c\": \".m\",\n kotlin: \".kt\",\n typescript: \".ts\",\n go: \".go\",\n perl: \".pl\",\n rust: \".rs\",\n scala: \".scala\",\n haskell: \".hs\",\n lua: \".lua\",\n shell: \".sh\",\n sql: \".sql\",\n html: \".html\",\n css: \".css\",\n // add more file extensions here, make sure the key is same as language prop in CodeBlock.tsx component\n};\n\nexport const generateRandomString = (length: number, lowercase = false) => {\n const chars = \"ABCDEFGHJKLMNPQRSTUVWXY3456789\"; // excluding similar looking characters like Z, 2, I, 1, O, 0\n let result = \"\";\n for (let i = 0; i < length; i++) {\n result += chars.charAt(Math.floor(Math.random() * chars.length));\n }\n return lowercase ? result.toLowerCase() : result;\n};\n\nconst CodeBlock: FC<Props> = memo(({ language, value }) => {\n const { isCopied, copyToClipboard } = useCopyToClipboard({ timeout: 2000 });\n\n const downloadAsFile = () => {\n if (typeof window === \"undefined\") {\n return;\n }\n const fileExtension = programmingLanguages[language] || \".file\";\n const suggestedFileName = `file-${generateRandomString(\n 3,\n true\n )}${fileExtension}`;\n const fileName = window.prompt(\"Enter file name\" || \"\", suggestedFileName);\n\n if (!fileName) {\n // User pressed cancel on prompt.\n return;\n }\n\n const blob = new Blob([value], { type: \"text/plain\" });\n const url = URL.createObjectURL(blob);\n const link = document.createElement(\"a\");\n link.download = fileName;\n link.href = url;\n link.style.display = \"none\";\n document.body.appendChild(link);\n link.click();\n document.body.removeChild(link);\n URL.revokeObjectURL(url);\n };\n\n const onCopy = () => {\n if (isCopied) return;\n copyToClipboard(value);\n };\n\n return (\n <div className=\"codeblock relative w-full bg-zinc-950 font-sans\">\n <div className=\"flex w-full items-center justify-between bg-zinc-800 px-6 py-2 pr-4 text-zinc-100\">\n <span className=\"text-xs lowercase\">{language}</span>\n <div className=\"flex items-center space-x-1\">\n <Button\n variant=\"ghost\"\n className=\"hover:bg-zinc-800 focus-visible:ring-1 focus-visible:ring-slate-700 focus-visible:ring-offset-0\"\n onClick={downloadAsFile}\n size=\"icon\"\n >\n <IconDownload />\n <span className=\"sr-only\">Download</span>\n </Button>\n <Button\n variant=\"ghost\"\n size=\"icon\"\n className=\"text-xs hover:bg-zinc-800 focus-visible:ring-1 focus-visible:ring-slate-700 focus-visible:ring-offset-0\"\n onClick={onCopy}\n >\n {isCopied ? <IconCheck /> : <IconCopy />}\n <span className=\"sr-only\">Copy code</span>\n </Button>\n </div>\n </div>\n <SyntaxHighlighter\n language={language}\n PreTag=\"div\"\n showLineNumbers\n customStyle={{\n margin: 0,\n width: \"100%\",\n background: \"transparent\",\n padding: \"1.5rem 1rem\",\n }}\n codeTagProps={{\n style: {\n fontSize: \"0.9rem\",\n fontFamily: \"var(--font-mono)\",\n },\n }}\n >\n {value}\n </SyntaxHighlighter>\n </div>\n );\n});\nCodeBlock.displayName = \"CodeBlock\";\n\nexport { CodeBlock };\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/chat-components/ui/alert-dialog.tsx"],"names":[],"mappings":"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","sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport * as AlertDialogPrimitive from \"@radix-ui/react-alert-dialog\";\n\nimport { cn } from \"../../../lib/utils\";\nimport { buttonVariants } from \"./button\";\n\nconst AlertDialog = AlertDialogPrimitive.Root;\n\nconst AlertDialogTrigger = AlertDialogPrimitive.Trigger;\n\nconst AlertDialogPortal = ({\n className,\n children,\n ...props\n}: AlertDialogPrimitive.AlertDialogPortalProps) => (\n <AlertDialogPrimitive.Portal className={cn(className)} {...props}>\n <div className=\"fixed inset-0 z-50 flex items-end justify-center sm:items-center\">\n {children}\n </div>\n </AlertDialogPrimitive.Portal>\n);\nAlertDialogPortal.displayName = AlertDialogPrimitive.Portal.displayName;\n\nconst AlertDialogOverlay = React.forwardRef<\n React.ElementRef<typeof AlertDialogPrimitive.Overlay>,\n React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Overlay>\n>(({ className, children, ...props }, ref) => (\n <AlertDialogPrimitive.Overlay\n className={cn(\n \"fixed inset-0 z-50 bg-background/80 backdrop-blur-sm transition-opacity animate-in fade-in\",\n className\n )}\n {...props}\n ref={ref}\n />\n));\nAlertDialogOverlay.displayName = AlertDialogPrimitive.Overlay.displayName;\n\nconst AlertDialogContent = React.forwardRef<\n React.ElementRef<typeof AlertDialogPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Content>\n>(({ className, ...props }, ref) => (\n <AlertDialogPortal>\n <AlertDialogOverlay />\n <AlertDialogPrimitive.Content\n ref={ref}\n className={cn(\n \"fixed z-50 grid w-full max-w-lg scale-100 gap-4 border bg-background p-6 opacity-100 shadow-lg animate-in fade-in-90 slide-in-from-bottom-10 sm:rounded-lg sm:zoom-in-90 sm:slide-in-from-bottom-0 md:w-full\",\n className\n )}\n {...props}\n />\n </AlertDialogPortal>\n));\nAlertDialogContent.displayName = AlertDialogPrimitive.Content.displayName;\n\nconst AlertDialogHeader = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLDivElement>) => (\n <div\n className={cn(\n \"flex flex-col space-y-2 text-center sm:text-left\",\n className\n )}\n {...props}\n />\n);\nAlertDialogHeader.displayName = \"AlertDialogHeader\";\n\nconst AlertDialogFooter = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLDivElement>) => (\n <div\n className={cn(\n \"flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2\",\n className\n )}\n {...props}\n />\n);\nAlertDialogFooter.displayName = \"AlertDialogFooter\";\n\nconst AlertDialogTitle = React.forwardRef<\n React.ElementRef<typeof AlertDialogPrimitive.Title>,\n React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Title>\n>(({ className, ...props }, ref) => (\n <AlertDialogPrimitive.Title\n ref={ref}\n className={cn(\"text-lg font-semibold\", className)}\n {...props}\n />\n));\nAlertDialogTitle.displayName = AlertDialogPrimitive.Title.displayName;\n\nconst AlertDialogDescription = React.forwardRef<\n React.ElementRef<typeof AlertDialogPrimitive.Description>,\n React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Description>\n>(({ className, ...props }, ref) => (\n <AlertDialogPrimitive.Description\n ref={ref}\n className={cn(\"text-sm text-muted-foreground\", className)}\n {...props}\n />\n));\nAlertDialogDescription.displayName =\n AlertDialogPrimitive.Description.displayName;\n\nconst AlertDialogAction = React.forwardRef<\n React.ElementRef<typeof AlertDialogPrimitive.Action>,\n React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Action>\n>(({ className, ...props }, ref) => (\n <AlertDialogPrimitive.Action\n ref={ref}\n className={cn(buttonVariants(), className)}\n {...props}\n />\n));\nAlertDialogAction.displayName = AlertDialogPrimitive.Action.displayName;\n\nconst AlertDialogCancel = React.forwardRef<\n React.ElementRef<typeof AlertDialogPrimitive.Cancel>,\n React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Cancel>\n>(({ className, ...props }, ref) => (\n <AlertDialogPrimitive.Cancel\n ref={ref}\n className={cn(\n buttonVariants({ variant: \"outline\" }),\n \"mt-2 sm:mt-0\",\n className\n )}\n {...props}\n />\n));\nAlertDialogCancel.displayName = AlertDialogPrimitive.Cancel.displayName;\n\nexport {\n AlertDialog,\n AlertDialogTrigger,\n AlertDialogContent,\n AlertDialogHeader,\n AlertDialogFooter,\n AlertDialogTitle,\n AlertDialogDescription,\n AlertDialogAction,\n AlertDialogCancel,\n};\n"]}
|