@melony/react 0.1.38 → 0.1.40

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/dist/index.d.cts CHANGED
@@ -1,10 +1,26 @@
1
1
  import * as React$1 from 'react';
2
2
  import React__default, { ReactNode, CSSProperties } from 'react';
3
3
  import { ClientState, MelonyClient } from 'melony/client';
4
- import { Role, Event, Config, UINode, UIContract } from 'melony';
4
+ import { Message, Event, Config, UINode, UIContract } from 'melony';
5
5
  import { QueryClient } from '@tanstack/react-query';
6
6
  import * as react_jsx_runtime from 'react/jsx-runtime';
7
7
 
8
+ interface MelonyContextValue extends ClientState {
9
+ messages: Message[];
10
+ sendEvent: (event: Event) => Promise<void>;
11
+ reset: (events?: Event[]) => void;
12
+ client: MelonyClient;
13
+ config?: Config;
14
+ }
15
+ declare const MelonyContext: React__default.Context<MelonyContextValue | undefined>;
16
+ interface MelonyProviderProps {
17
+ children: ReactNode;
18
+ client: MelonyClient;
19
+ initialEvents?: Event[];
20
+ queryClient?: QueryClient;
21
+ }
22
+ declare const MelonyProvider: React__default.FC<MelonyProviderProps>;
23
+
8
24
  interface User {
9
25
  id?: string;
10
26
  uid: string;
@@ -16,12 +32,6 @@ interface User {
16
32
  lastSignIn?: string | null;
17
33
  emailVerified?: boolean;
18
34
  }
19
- interface Message {
20
- role: Role;
21
- content: Event[];
22
- runId?: string;
23
- threadId?: string;
24
- }
25
35
  interface ThreadData {
26
36
  id: string;
27
37
  title?: string;
@@ -57,22 +67,6 @@ interface ThreadService {
57
67
  getEvents: (threadId: string) => Promise<Event[]>;
58
68
  }
59
69
 
60
- interface MelonyContextValue extends ClientState {
61
- messages: Message[];
62
- sendEvent: (event: Event) => Promise<void>;
63
- reset: (events?: Event[]) => void;
64
- client: MelonyClient;
65
- config?: Config;
66
- }
67
- declare const MelonyContext: React__default.Context<MelonyContextValue | undefined>;
68
- interface MelonyProviderProps {
69
- children: ReactNode;
70
- client: MelonyClient;
71
- initialEvents?: Event[];
72
- queryClient?: QueryClient;
73
- }
74
- declare const MelonyProvider: React__default.FC<MelonyProviderProps>;
75
-
76
70
  interface WelcomeScreenProps {
77
71
  title?: string;
78
72
  description?: string;
@@ -400,6 +394,7 @@ type ListItemProps = BaseComponentProps & UIContract["listItem"] & {
400
394
  type ImageProps = BaseComponentProps & UIContract["image"] & {
401
395
  fallbackText?: string;
402
396
  showFallbackIcon?: boolean;
397
+ groupId?: string;
403
398
  };
404
399
  type ChartProps = BaseComponentProps & UIContract["chart"] & {
405
400
  size?: Size;
@@ -484,6 +479,4 @@ declare const Text: React__default.FC<TextProps>;
484
479
 
485
480
  declare const Badge: React__default.FC<BadgeProps>;
486
481
 
487
- declare function groupEventsToMessages(events: Event[]): Message[];
488
-
489
- export { AccountButton, type AccountButtonProps, AuthContext, type AuthContextValue, AuthProvider, type AuthProviderProps, type AuthService, Badge, Box, Button, Card, Chart, ChatHeader, type ChatHeaderProps, Checkbox, Col, Composer, type ComposerOption, type ComposerOptionGroup, CreateThreadButton, type CreateThreadButtonProps, CreateThreadNavItem, type CreateThreadNavItemProps, Divider, Dropdown, type DropdownProps, Form, FullChat, type FullChatProps, Heading, Image, Input, Label, List, ListItem, MelonyContext, type MelonyContextValue, MelonyProvider, type MelonyProviderProps, type Message, PopupChat, type PopupChatProps, RadioGroup, Row, type ScreenSize, Select, Sidebar, SidebarContext, type SidebarContextValue, type SidebarProps, SidebarProvider, type SidebarProviderProps, SidebarToggle, type SidebarToggleProps, Spacer, type StarterPrompt, Text, Textarea, ThemeProvider, ThemeToggle, Thread, ThreadContext, type ThreadContextValue, type ThreadData, ThreadList, type ThreadListProps, ThreadPopover, type ThreadPopoverProps, ThreadProvider, type ThreadProviderProps, type ThreadService, UIRenderer, type UIRendererProps, type UseMelonyOptions, type User, WelcomeScreen, type WelcomeScreenProps, groupEventsToMessages, useAuth, useMelony, useScreenSize, useSidebar, useTheme, useThreads };
482
+ export { AccountButton, type AccountButtonProps, AuthContext, type AuthContextValue, AuthProvider, type AuthProviderProps, type AuthService, Badge, Box, Button, Card, Chart, ChatHeader, type ChatHeaderProps, Checkbox, Col, Composer, type ComposerOption, type ComposerOptionGroup, CreateThreadButton, type CreateThreadButtonProps, CreateThreadNavItem, type CreateThreadNavItemProps, Divider, Dropdown, type DropdownProps, Form, FullChat, type FullChatProps, Heading, Image, Input, Label, List, ListItem, MelonyContext, type MelonyContextValue, MelonyProvider, type MelonyProviderProps, PopupChat, type PopupChatProps, RadioGroup, Row, type ScreenSize, Select, Sidebar, SidebarContext, type SidebarContextValue, type SidebarProps, SidebarProvider, type SidebarProviderProps, SidebarToggle, type SidebarToggleProps, Spacer, type StarterPrompt, Text, Textarea, ThemeProvider, ThemeToggle, Thread, ThreadContext, type ThreadContextValue, type ThreadData, ThreadList, type ThreadListProps, ThreadPopover, type ThreadPopoverProps, ThreadProvider, type ThreadProviderProps, type ThreadService, UIRenderer, type UIRendererProps, type UseMelonyOptions, type User, WelcomeScreen, type WelcomeScreenProps, useAuth, useMelony, useScreenSize, useSidebar, useTheme, useThreads };
package/dist/index.d.ts CHANGED
@@ -1,10 +1,26 @@
1
1
  import * as React$1 from 'react';
2
2
  import React__default, { ReactNode, CSSProperties } from 'react';
3
3
  import { ClientState, MelonyClient } from 'melony/client';
4
- import { Role, Event, Config, UINode, UIContract } from 'melony';
4
+ import { Message, Event, Config, UINode, UIContract } from 'melony';
5
5
  import { QueryClient } from '@tanstack/react-query';
6
6
  import * as react_jsx_runtime from 'react/jsx-runtime';
7
7
 
8
+ interface MelonyContextValue extends ClientState {
9
+ messages: Message[];
10
+ sendEvent: (event: Event) => Promise<void>;
11
+ reset: (events?: Event[]) => void;
12
+ client: MelonyClient;
13
+ config?: Config;
14
+ }
15
+ declare const MelonyContext: React__default.Context<MelonyContextValue | undefined>;
16
+ interface MelonyProviderProps {
17
+ children: ReactNode;
18
+ client: MelonyClient;
19
+ initialEvents?: Event[];
20
+ queryClient?: QueryClient;
21
+ }
22
+ declare const MelonyProvider: React__default.FC<MelonyProviderProps>;
23
+
8
24
  interface User {
9
25
  id?: string;
10
26
  uid: string;
@@ -16,12 +32,6 @@ interface User {
16
32
  lastSignIn?: string | null;
17
33
  emailVerified?: boolean;
18
34
  }
19
- interface Message {
20
- role: Role;
21
- content: Event[];
22
- runId?: string;
23
- threadId?: string;
24
- }
25
35
  interface ThreadData {
26
36
  id: string;
27
37
  title?: string;
@@ -57,22 +67,6 @@ interface ThreadService {
57
67
  getEvents: (threadId: string) => Promise<Event[]>;
58
68
  }
59
69
 
60
- interface MelonyContextValue extends ClientState {
61
- messages: Message[];
62
- sendEvent: (event: Event) => Promise<void>;
63
- reset: (events?: Event[]) => void;
64
- client: MelonyClient;
65
- config?: Config;
66
- }
67
- declare const MelonyContext: React__default.Context<MelonyContextValue | undefined>;
68
- interface MelonyProviderProps {
69
- children: ReactNode;
70
- client: MelonyClient;
71
- initialEvents?: Event[];
72
- queryClient?: QueryClient;
73
- }
74
- declare const MelonyProvider: React__default.FC<MelonyProviderProps>;
75
-
76
70
  interface WelcomeScreenProps {
77
71
  title?: string;
78
72
  description?: string;
@@ -400,6 +394,7 @@ type ListItemProps = BaseComponentProps & UIContract["listItem"] & {
400
394
  type ImageProps = BaseComponentProps & UIContract["image"] & {
401
395
  fallbackText?: string;
402
396
  showFallbackIcon?: boolean;
397
+ groupId?: string;
403
398
  };
404
399
  type ChartProps = BaseComponentProps & UIContract["chart"] & {
405
400
  size?: Size;
@@ -484,6 +479,4 @@ declare const Text: React__default.FC<TextProps>;
484
479
 
485
480
  declare const Badge: React__default.FC<BadgeProps>;
486
481
 
487
- declare function groupEventsToMessages(events: Event[]): Message[];
488
-
489
- export { AccountButton, type AccountButtonProps, AuthContext, type AuthContextValue, AuthProvider, type AuthProviderProps, type AuthService, Badge, Box, Button, Card, Chart, ChatHeader, type ChatHeaderProps, Checkbox, Col, Composer, type ComposerOption, type ComposerOptionGroup, CreateThreadButton, type CreateThreadButtonProps, CreateThreadNavItem, type CreateThreadNavItemProps, Divider, Dropdown, type DropdownProps, Form, FullChat, type FullChatProps, Heading, Image, Input, Label, List, ListItem, MelonyContext, type MelonyContextValue, MelonyProvider, type MelonyProviderProps, type Message, PopupChat, type PopupChatProps, RadioGroup, Row, type ScreenSize, Select, Sidebar, SidebarContext, type SidebarContextValue, type SidebarProps, SidebarProvider, type SidebarProviderProps, SidebarToggle, type SidebarToggleProps, Spacer, type StarterPrompt, Text, Textarea, ThemeProvider, ThemeToggle, Thread, ThreadContext, type ThreadContextValue, type ThreadData, ThreadList, type ThreadListProps, ThreadPopover, type ThreadPopoverProps, ThreadProvider, type ThreadProviderProps, type ThreadService, UIRenderer, type UIRendererProps, type UseMelonyOptions, type User, WelcomeScreen, type WelcomeScreenProps, groupEventsToMessages, useAuth, useMelony, useScreenSize, useSidebar, useTheme, useThreads };
482
+ export { AccountButton, type AccountButtonProps, AuthContext, type AuthContextValue, AuthProvider, type AuthProviderProps, type AuthService, Badge, Box, Button, Card, Chart, ChatHeader, type ChatHeaderProps, Checkbox, Col, Composer, type ComposerOption, type ComposerOptionGroup, CreateThreadButton, type CreateThreadButtonProps, CreateThreadNavItem, type CreateThreadNavItemProps, Divider, Dropdown, type DropdownProps, Form, FullChat, type FullChatProps, Heading, Image, Input, Label, List, ListItem, MelonyContext, type MelonyContextValue, MelonyProvider, type MelonyProviderProps, PopupChat, type PopupChatProps, RadioGroup, Row, type ScreenSize, Select, Sidebar, SidebarContext, type SidebarContextValue, type SidebarProps, SidebarProvider, type SidebarProviderProps, SidebarToggle, type SidebarToggleProps, Spacer, type StarterPrompt, Text, Textarea, ThemeProvider, ThemeToggle, Thread, ThreadContext, type ThreadContextValue, type ThreadData, ThreadList, type ThreadListProps, ThreadPopover, type ThreadPopoverProps, ThreadProvider, type ThreadProviderProps, type ThreadService, UIRenderer, type UIRendererProps, type UseMelonyOptions, type User, WelcomeScreen, type WelcomeScreenProps, useAuth, useMelony, useScreenSize, useSidebar, useTheme, useThreads };
package/dist/index.js CHANGED
@@ -1,5 +1,6 @@
1
1
  import * as React11 from 'react';
2
2
  import React11__default, { createContext, useState, useContext, useCallback, useEffect, useMemo, useRef } from 'react';
3
+ import { convertEventsToMessages } from 'melony';
3
4
  import { NuqsAdapter } from 'nuqs/adapters/react';
4
5
  import { QueryClient, QueryClientProvider, useQueryClient, useQuery, useMutation } from '@tanstack/react-query';
5
6
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
@@ -9,7 +10,7 @@ import { Dialog as Dialog$1 } from '@base-ui/react/dialog';
9
10
  import { Button as Button$1 } from '@base-ui/react/button';
10
11
  import { cva } from 'class-variance-authority';
11
12
  import * as ICONS from '@tabler/icons-react';
12
- import { IconUser, IconLogout, IconX, IconBrandGoogle, IconFileText, IconFile, IconPaperclip, IconChevronDown, IconLoader2, IconArrowUp, IconDotsVertical, IconTrash, IconHistory, IconPlus, IconArrowLeft, IconMessage, IconLayoutSidebarLeftExpand, IconLayoutSidebarLeftCollapse, IconLayoutSidebarRightExpand, IconLayoutSidebarRightCollapse, IconDeviceDesktop, IconMoon, IconSun, IconCheck, IconSelector, IconChevronUp } from '@tabler/icons-react';
13
+ import { IconUser, IconLogout, IconX, IconBrandGoogle, IconFileText, IconFile, IconPaperclip, IconChevronDown, IconLoader2, IconArrowUp, IconChevronLeft, IconChevronRight, IconDotsVertical, IconTrash, IconHistory, IconPlus, IconArrowLeft, IconMessage, IconLayoutSidebarLeftExpand, IconLayoutSidebarLeftCollapse, IconLayoutSidebarRightExpand, IconLayoutSidebarRightCollapse, IconDeviceDesktop, IconMoon, IconSun, IconCheck, IconSelector, IconChevronUp } from '@tabler/icons-react';
13
14
  import { Menu } from '@base-ui/react/menu';
14
15
  import { Separator as Separator$1 } from '@base-ui/react/separator';
15
16
  import { useQueryState, parseAsString } from 'nuqs';
@@ -21,31 +22,6 @@ import { createPortal } from 'react-dom';
21
22
  import { useHotkeys } from 'react-hotkeys-hook';
22
23
 
23
24
  // src/providers/melony-provider.tsx
24
-
25
- // src/lib/group-events-to-messages.ts
26
- function groupEventsToMessages(events) {
27
- if (events.length === 0) return [];
28
- const messages = [];
29
- let currentMessage = null;
30
- for (const event of events) {
31
- const role = event.role || "assistant";
32
- const runId = event.runId;
33
- if (!currentMessage || currentMessage.role !== role || runId && currentMessage.runId && runId !== currentMessage.runId) {
34
- currentMessage = {
35
- role,
36
- content: [event],
37
- runId
38
- };
39
- messages.push(currentMessage);
40
- } else {
41
- currentMessage.content.push(event);
42
- if (!currentMessage.runId && runId) {
43
- currentMessage.runId = runId;
44
- }
45
- }
46
- }
47
- return messages;
48
- }
49
25
  var MelonyContext = createContext(
50
26
  void 0
51
27
  );
@@ -143,7 +119,7 @@ var MelonyContextProviderInner = ({
143
119
  const value = useMemo(
144
120
  () => ({
145
121
  ...state,
146
- messages: groupEventsToMessages(state.events),
122
+ messages: convertEventsToMessages(state.events),
147
123
  sendEvent,
148
124
  reset,
149
125
  client,
@@ -1758,12 +1734,39 @@ var Image = ({
1758
1734
  src,
1759
1735
  alt,
1760
1736
  size = "sm",
1737
+ groupId,
1761
1738
  className,
1762
1739
  style
1763
1740
  }) => {
1764
1741
  const [hasError, setHasError] = useState(false);
1765
1742
  const [isLoading, setIsLoading] = useState(true);
1766
1743
  const [open, setOpen] = useState(false);
1744
+ const [currentIndex, setCurrentIndex] = useState(0);
1745
+ const [gallery, setGallery] = useState([]);
1746
+ const triggerRef = useRef(null);
1747
+ useEffect(() => {
1748
+ if (open && triggerRef.current) {
1749
+ let parent = triggerRef.current.parentElement;
1750
+ while (parent && parent.parentElement && parent.parentElement.children.length === 1) {
1751
+ parent = parent.parentElement;
1752
+ }
1753
+ const container = parent?.parentElement;
1754
+ if (container) {
1755
+ const foundImgs = Array.from(container.querySelectorAll("img")).map((img) => ({
1756
+ src: img.getAttribute("src") || "",
1757
+ alt: img.getAttribute("alt") || ""
1758
+ })).filter((v, i, a) => a.findIndex((t) => t.src === v.src) === i);
1759
+ setGallery(foundImgs);
1760
+ const idx = foundImgs.findIndex((img) => img.src === src);
1761
+ setCurrentIndex(idx >= 0 ? idx : 0);
1762
+ }
1763
+ }
1764
+ }, [open, src]);
1765
+ const navigate = (dir) => {
1766
+ setCurrentIndex((prev) => (prev + dir + gallery.length) % gallery.length);
1767
+ };
1768
+ const currentImage = gallery[currentIndex] || { src, alt };
1769
+ const hasMultiple = gallery.length > 1;
1767
1770
  const sizes = {
1768
1771
  sm: "h-11",
1769
1772
  md: "h-22",
@@ -1794,7 +1797,11 @@ var Image = ({
1794
1797
  /* @__PURE__ */ jsx(DialogTrigger, { children: /* @__PURE__ */ jsxs(
1795
1798
  "div",
1796
1799
  {
1797
- className: cn("relative overflow-hidden rounded-md border cursor-pointer", className),
1800
+ ref: triggerRef,
1801
+ className: cn(
1802
+ "relative overflow-hidden rounded-md border cursor-pointer",
1803
+ className
1804
+ ),
1798
1805
  style,
1799
1806
  children: [
1800
1807
  /* @__PURE__ */ jsx(
@@ -1818,36 +1825,47 @@ var Image = ({
1818
1825
  /* @__PURE__ */ jsx(
1819
1826
  DialogContent,
1820
1827
  {
1821
- className: "max-w-[90vw] max-h-[90vh] p-0 bg-transparent border-none shadow-none",
1828
+ className: "max-w-[90vw] max-h-[90vh] p-0 bg-transparent border-none shadow-none outline-none",
1822
1829
  onClick: (e) => e.stopPropagation(),
1823
- children: /* @__PURE__ */ jsxs("div", { className: "relative flex items-center justify-center", children: [
1824
- /* @__PURE__ */ jsx(DialogClose, { className: "absolute -top-10 right-0 text-white hover:text-gray-300 transition-colors z-10 bg-black/50 rounded-full p-2", children: /* @__PURE__ */ jsx(
1825
- "svg",
1826
- {
1827
- xmlns: "http://www.w3.org/2000/svg",
1828
- className: "h-5 w-5",
1829
- fill: "none",
1830
- viewBox: "0 0 24 24",
1831
- stroke: "currentColor",
1832
- children: /* @__PURE__ */ jsx(
1833
- "path",
1834
- {
1835
- strokeLinecap: "round",
1836
- strokeLinejoin: "round",
1837
- strokeWidth: 2,
1838
- d: "M6 18L18 6M6 6l12 12"
1839
- }
1840
- )
1841
- }
1842
- ) }),
1830
+ children: /* @__PURE__ */ jsxs("div", { className: "relative flex items-center justify-center group/lightbox", children: [
1831
+ /* @__PURE__ */ jsx(DialogClose, { className: "absolute -top-12 right-0 text-white hover:text-gray-300 transition-colors z-50 bg-black/50 rounded-full p-2", children: /* @__PURE__ */ jsx(IconX, { size: 20 }) }),
1832
+ hasMultiple && /* @__PURE__ */ jsxs(Fragment, { children: [
1833
+ /* @__PURE__ */ jsx(
1834
+ "button",
1835
+ {
1836
+ onClick: (e) => {
1837
+ e.stopPropagation();
1838
+ navigate(-1);
1839
+ },
1840
+ className: "absolute left-4 z-50 p-3 bg-black/40 hover:bg-black/60 text-white rounded-full transition-all opacity-0 group-hover/lightbox:opacity-100",
1841
+ children: /* @__PURE__ */ jsx(IconChevronLeft, { size: 28 })
1842
+ }
1843
+ ),
1844
+ /* @__PURE__ */ jsx(
1845
+ "button",
1846
+ {
1847
+ onClick: (e) => {
1848
+ e.stopPropagation();
1849
+ navigate(1);
1850
+ },
1851
+ className: "absolute right-4 z-50 p-3 bg-black/40 hover:bg-black/60 text-white rounded-full transition-all opacity-0 group-hover/lightbox:opacity-100",
1852
+ children: /* @__PURE__ */ jsx(IconChevronRight, { size: 28 })
1853
+ }
1854
+ )
1855
+ ] }),
1843
1856
  /* @__PURE__ */ jsx(
1844
1857
  "img",
1845
1858
  {
1846
- src,
1847
- alt: alt || "Enlarged image",
1848
- className: "max-w-full max-h-[90vh] object-contain rounded-lg"
1859
+ src: currentImage.src,
1860
+ alt: currentImage.alt || alt || "Enlarged image",
1861
+ className: "max-w-full max-h-[85vh] object-contain rounded-lg shadow-2xl"
1849
1862
  }
1850
- )
1863
+ ),
1864
+ hasMultiple && /* @__PURE__ */ jsxs("div", { className: "absolute -bottom-10 left-1/2 -translate-x-1/2 text-white bg-black/50 px-3 py-1 rounded-full text-sm font-medium", children: [
1865
+ currentIndex + 1,
1866
+ " / ",
1867
+ gallery.length
1868
+ ] })
1851
1869
  ] })
1852
1870
  }
1853
1871
  )
@@ -2812,25 +2830,16 @@ function MessageContent({ events }) {
2812
2830
  }
2813
2831
  function MessageBubble({ message }) {
2814
2832
  const isUser = message.role === "user";
2815
- return /* @__PURE__ */ jsx(
2833
+ return /* @__PURE__ */ jsx("div", { className: cn("flex flex-col", isUser ? "items-end" : "items-start"), children: /* @__PURE__ */ jsx(
2816
2834
  "div",
2817
2835
  {
2818
2836
  className: cn(
2819
- "flex flex-col",
2820
- isUser ? "items-end" : "items-start"
2837
+ "flex flex-col items-start max-w-[85%] rounded-2xl px-4 py-2 space-y-4 whitespace-pre-wrap",
2838
+ isUser ? "bg-primary text-primary-foreground" : "px-0 py-0 text-foreground"
2821
2839
  ),
2822
- children: /* @__PURE__ */ jsx(
2823
- "div",
2824
- {
2825
- className: cn(
2826
- "flex flex-col items-start max-w-[85%] rounded-2xl px-4 py-2 space-y-4 whitespace-pre-wrap",
2827
- isUser ? "bg-primary text-primary-foreground" : "px-0 py-0 text-foreground"
2828
- ),
2829
- children: /* @__PURE__ */ jsx(MessageContent, { events: message.content })
2830
- }
2831
- )
2840
+ children: /* @__PURE__ */ jsx(MessageContent, { events: message.content })
2832
2841
  }
2833
- );
2842
+ ) });
2834
2843
  }
2835
2844
  function LoadingIndicator({ status }) {
2836
2845
  const [isExpanded, setIsExpanded] = useState(false);
@@ -2870,7 +2879,6 @@ function MessageList({
2870
2879
  const lastMessage = messages[messages.length - 1];
2871
2880
  return lastMessage.content.some((event) => event.type === "text-delta");
2872
2881
  }, [messages, isLoading]);
2873
- console.log("MESSAGES", messages);
2874
2882
  return /* @__PURE__ */ jsxs("div", { className: "space-y-6", children: [
2875
2883
  messages.map((message, index) => /* @__PURE__ */ jsx(MessageBubble, { message }, index)),
2876
2884
  isLoading && !isTextStreaming && /* @__PURE__ */ jsx(LoadingIndicator, { status: loadingStatus }),
@@ -2910,20 +2918,17 @@ function Thread({
2910
2918
  const handleSubmit = async (state, overrideInput) => {
2911
2919
  const text = (overrideInput ?? input).trim();
2912
2920
  const hasFiles = state?.files && Array.isArray(state.files) && state.files.length > 0;
2913
- const hasOptions = state && Object.keys(state).filter((k) => k !== "threadId").length > 0;
2914
- if (!text && !hasFiles && !hasOptions || isLoading) return;
2921
+ if (!text && !hasFiles || isLoading) return;
2915
2922
  if (!overrideInput) setInput("");
2916
- await sendEvent(
2917
- {
2918
- type: "text",
2919
- role: "user",
2920
- data: { content: text || "" },
2921
- state: {
2922
- ...state,
2923
- threadId: activeThreadId ?? void 0
2924
- }
2923
+ await sendEvent({
2924
+ type: "text",
2925
+ role: "user",
2926
+ data: { content: text || "" },
2927
+ state: {
2928
+ ...state,
2929
+ threadId: activeThreadId ?? void 0
2925
2930
  }
2926
- );
2931
+ });
2927
2932
  };
2928
2933
  const handleStarterPromptClick = (prompt) => {
2929
2934
  if (onStarterPromptClick) {
@@ -3646,7 +3651,7 @@ var CreateThreadNavItem = ({
3646
3651
  url: "?"
3647
3652
  }
3648
3653
  },
3649
- className: cn(className),
3654
+ className: cn(className, "border roudned-lg"),
3650
3655
  children: [
3651
3656
  /* @__PURE__ */ jsx(IconPlus, { className: "size-4" }),
3652
3657
  "New chat"
@@ -3655,6 +3660,6 @@ var CreateThreadNavItem = ({
3655
3660
  );
3656
3661
  };
3657
3662
 
3658
- export { AccountButton, AuthContext, AuthProvider, Badge2 as Badge, Box, Button2 as Button, Card2 as Card, Chart, ChatHeader, Checkbox, Col, Composer, CreateThreadButton, CreateThreadNavItem, Divider, Dropdown, Form, FullChat, Heading, Image, Input2 as Input, Label2 as Label, List, ListItem, MelonyContext, MelonyProvider, PopupChat, RadioGroup, Row, Select2 as Select, Sidebar, SidebarContext, SidebarProvider, SidebarToggle, Spacer, Text, Textarea2 as Textarea, ThemeProvider, ThemeToggle, Thread, ThreadContext, ThreadList, ThreadPopover, ThreadProvider, UIRenderer, WelcomeScreen, groupEventsToMessages, useAuth, useMelony, useScreenSize, useSidebar, useTheme, useThreads };
3663
+ export { AccountButton, AuthContext, AuthProvider, Badge2 as Badge, Box, Button2 as Button, Card2 as Card, Chart, ChatHeader, Checkbox, Col, Composer, CreateThreadButton, CreateThreadNavItem, Divider, Dropdown, Form, FullChat, Heading, Image, Input2 as Input, Label2 as Label, List, ListItem, MelonyContext, MelonyProvider, PopupChat, RadioGroup, Row, Select2 as Select, Sidebar, SidebarContext, SidebarProvider, SidebarToggle, Spacer, Text, Textarea2 as Textarea, ThemeProvider, ThemeToggle, Thread, ThreadContext, ThreadList, ThreadPopover, ThreadProvider, UIRenderer, WelcomeScreen, useAuth, useMelony, useScreenSize, useSidebar, useTheme, useThreads };
3659
3664
  //# sourceMappingURL=index.js.map
3660
3665
  //# sourceMappingURL=index.js.map