@melony/react 0.1.25 → 0.1.27
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/README.md +4 -2
- package/dist/index.cjs +460 -401
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +47 -46
- package/dist/index.d.ts +47 -46
- package/dist/index.js +456 -399
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.d.cts
CHANGED
|
@@ -76,6 +76,22 @@ interface MelonyClientProviderProps {
|
|
|
76
76
|
}
|
|
77
77
|
declare const MelonyClientProvider: React__default.FC<MelonyClientProviderProps>;
|
|
78
78
|
|
|
79
|
+
interface WelcomeScreenProps {
|
|
80
|
+
title?: string;
|
|
81
|
+
description?: string;
|
|
82
|
+
features?: {
|
|
83
|
+
title: string;
|
|
84
|
+
description: string;
|
|
85
|
+
}[];
|
|
86
|
+
className?: string;
|
|
87
|
+
onLoginClick?: () => void;
|
|
88
|
+
termsUrl?: string;
|
|
89
|
+
privacyUrl?: string;
|
|
90
|
+
imageUrl?: string;
|
|
91
|
+
imageAlt?: string;
|
|
92
|
+
}
|
|
93
|
+
declare function WelcomeScreen({ title, description, features, className, onLoginClick, termsUrl, privacyUrl, imageUrl, imageAlt, }: WelcomeScreenProps): react_jsx_runtime.JSX.Element;
|
|
94
|
+
|
|
79
95
|
interface AuthContextValue {
|
|
80
96
|
user: User | null;
|
|
81
97
|
isAuthenticated: boolean;
|
|
@@ -88,6 +104,7 @@ declare const AuthContext: React__default.Context<AuthContextValue | undefined>;
|
|
|
88
104
|
interface AuthProviderProps {
|
|
89
105
|
children: ReactNode;
|
|
90
106
|
service: AuthService;
|
|
107
|
+
welcomeScreenProps?: WelcomeScreenProps;
|
|
91
108
|
}
|
|
92
109
|
declare const AuthProvider: React__default.FC<AuthProviderProps>;
|
|
93
110
|
|
|
@@ -111,6 +128,23 @@ interface ThreadProviderProps {
|
|
|
111
128
|
}
|
|
112
129
|
declare const ThreadProvider: React__default.FC<ThreadProviderProps>;
|
|
113
130
|
|
|
131
|
+
interface SidebarContextValue {
|
|
132
|
+
leftCollapsed: boolean;
|
|
133
|
+
rightCollapsed: boolean;
|
|
134
|
+
setLeftCollapsed: (collapsed: boolean) => void;
|
|
135
|
+
setRightCollapsed: (collapsed: boolean) => void;
|
|
136
|
+
leftCollapsible: boolean;
|
|
137
|
+
rightCollapsible: boolean;
|
|
138
|
+
}
|
|
139
|
+
declare const SidebarContext: React__default.Context<SidebarContextValue | undefined>;
|
|
140
|
+
declare function useSidebar(): SidebarContextValue;
|
|
141
|
+
interface SidebarProviderProps {
|
|
142
|
+
children: React__default.ReactNode;
|
|
143
|
+
defaultLeftCollapsed?: boolean;
|
|
144
|
+
defaultRightCollapsed?: boolean;
|
|
145
|
+
}
|
|
146
|
+
declare function SidebarProvider({ children, defaultLeftCollapsed, defaultRightCollapsed, }: SidebarProviderProps): react_jsx_runtime.JSX.Element;
|
|
147
|
+
|
|
114
148
|
type Theme = "light" | "dark" | "system";
|
|
115
149
|
interface ThemeContextType {
|
|
116
150
|
theme: Theme;
|
|
@@ -207,7 +241,7 @@ interface ChatHeaderProps {
|
|
|
207
241
|
*/
|
|
208
242
|
declare function ChatHeader({ leftContent, rightContent, className, children, }: ChatHeaderProps): react_jsx_runtime.JSX.Element;
|
|
209
243
|
|
|
210
|
-
interface
|
|
244
|
+
interface PopupChatProps {
|
|
211
245
|
title?: string;
|
|
212
246
|
placeholder?: string;
|
|
213
247
|
starterPrompts?: StarterPrompt[];
|
|
@@ -223,26 +257,20 @@ interface ChatPopupProps {
|
|
|
223
257
|
*/
|
|
224
258
|
defaultSelectedIds?: string[];
|
|
225
259
|
}
|
|
226
|
-
declare function
|
|
260
|
+
declare function PopupChat({ title, placeholder, starterPrompts, options, defaultOpen, headerProps, defaultSelectedIds, }: PopupChatProps): react_jsx_runtime.JSX.Element;
|
|
227
261
|
|
|
228
|
-
interface
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
starterPrompts?: StarterPrompt[];
|
|
232
|
-
options?: ComposerOptionGroup[];
|
|
262
|
+
interface SidebarProps {
|
|
263
|
+
side: "left" | "right";
|
|
264
|
+
children: React__default.ReactNode;
|
|
233
265
|
className?: string;
|
|
234
|
-
/**
|
|
235
|
-
* Props for customizing the header. If provided, title prop will be passed to header.
|
|
236
|
-
*/
|
|
237
|
-
headerProps?: Omit<ChatHeaderProps, "title">;
|
|
238
|
-
/**
|
|
239
|
-
* IDs of options to be selected by default
|
|
240
|
-
*/
|
|
241
|
-
defaultSelectedIds?: string[];
|
|
242
266
|
}
|
|
243
|
-
|
|
267
|
+
/**
|
|
268
|
+
* A sidebar component that responds to ChatSidebarContext.
|
|
269
|
+
* Typically used within ChatFull or a layout with ChatSidebarProvider.
|
|
270
|
+
*/
|
|
271
|
+
declare function Sidebar({ side, children, className }: SidebarProps): react_jsx_runtime.JSX.Element;
|
|
244
272
|
|
|
245
|
-
interface
|
|
273
|
+
interface FullChatProps {
|
|
246
274
|
title?: string;
|
|
247
275
|
placeholder?: string;
|
|
248
276
|
starterPrompts?: StarterPrompt[];
|
|
@@ -252,22 +280,6 @@ interface ChatFullProps {
|
|
|
252
280
|
* Props for customizing the header. If provided, title prop will be passed to header.
|
|
253
281
|
*/
|
|
254
282
|
headerProps?: Omit<ChatHeaderProps, "title">;
|
|
255
|
-
/**
|
|
256
|
-
* Customizable left sidebar content. Typically used for navigation, thread list, etc.
|
|
257
|
-
*/
|
|
258
|
-
leftSidebar?: React__default.ReactNode;
|
|
259
|
-
/**
|
|
260
|
-
* Customizable right sidebar content. Typically used as a canvas, additional info, etc.
|
|
261
|
-
*/
|
|
262
|
-
rightSidebar?: React__default.ReactNode;
|
|
263
|
-
/**
|
|
264
|
-
* Custom className for the left sidebar container
|
|
265
|
-
*/
|
|
266
|
-
leftSidebarClassName?: string;
|
|
267
|
-
/**
|
|
268
|
-
* Custom className for the right sidebar container
|
|
269
|
-
*/
|
|
270
|
-
rightSidebarClassName?: string;
|
|
271
283
|
/**
|
|
272
284
|
* Whether the composer should be auto focused
|
|
273
285
|
*/
|
|
@@ -277,7 +289,7 @@ interface ChatFullProps {
|
|
|
277
289
|
*/
|
|
278
290
|
defaultSelectedIds?: string[];
|
|
279
291
|
}
|
|
280
|
-
declare function
|
|
292
|
+
declare function FullChat({ title, placeholder, starterPrompts, options, className, headerProps, autoFocus, defaultSelectedIds, }: FullChatProps): react_jsx_runtime.JSX.Element;
|
|
281
293
|
|
|
282
294
|
interface SidebarToggleProps {
|
|
283
295
|
side: "left" | "right";
|
|
@@ -285,17 +297,6 @@ interface SidebarToggleProps {
|
|
|
285
297
|
}
|
|
286
298
|
declare function SidebarToggle({ side, className }: SidebarToggleProps): react_jsx_runtime.JSX.Element | null;
|
|
287
299
|
|
|
288
|
-
interface ChatSidebarContextValue {
|
|
289
|
-
leftCollapsed: boolean;
|
|
290
|
-
rightCollapsed: boolean;
|
|
291
|
-
setLeftCollapsed: (collapsed: boolean) => void;
|
|
292
|
-
setRightCollapsed: (collapsed: boolean) => void;
|
|
293
|
-
leftCollapsible: boolean;
|
|
294
|
-
rightCollapsible: boolean;
|
|
295
|
-
}
|
|
296
|
-
declare const ChatSidebarContext: React__default.Context<ChatSidebarContextValue | undefined>;
|
|
297
|
-
declare function useChatSidebar(): ChatSidebarContextValue;
|
|
298
|
-
|
|
299
300
|
interface ThreadListProps {
|
|
300
301
|
className?: string;
|
|
301
302
|
emptyState?: React$1.ReactNode;
|
|
@@ -473,4 +474,4 @@ declare const Badge: React__default.FC<BadgeProps>;
|
|
|
473
474
|
|
|
474
475
|
declare function groupEventsToMessages(events: Event[]): Message[];
|
|
475
476
|
|
|
476
|
-
export { AccountDialog, type AccountDialogProps, AuthContext, type AuthContextValue, AuthProvider, type AuthProviderProps, type AuthService, Badge, Box, Button, Card, Chart,
|
|
477
|
+
export { AccountDialog, type AccountDialogProps, 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, Divider, Form, FullChat, type FullChatProps, Heading, Image, Input, Label, List, ListItem, MelonyClientProvider, type MelonyClientProviderProps, MelonyContext, type MelonyContextValue, 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 };
|
package/dist/index.d.ts
CHANGED
|
@@ -76,6 +76,22 @@ interface MelonyClientProviderProps {
|
|
|
76
76
|
}
|
|
77
77
|
declare const MelonyClientProvider: React__default.FC<MelonyClientProviderProps>;
|
|
78
78
|
|
|
79
|
+
interface WelcomeScreenProps {
|
|
80
|
+
title?: string;
|
|
81
|
+
description?: string;
|
|
82
|
+
features?: {
|
|
83
|
+
title: string;
|
|
84
|
+
description: string;
|
|
85
|
+
}[];
|
|
86
|
+
className?: string;
|
|
87
|
+
onLoginClick?: () => void;
|
|
88
|
+
termsUrl?: string;
|
|
89
|
+
privacyUrl?: string;
|
|
90
|
+
imageUrl?: string;
|
|
91
|
+
imageAlt?: string;
|
|
92
|
+
}
|
|
93
|
+
declare function WelcomeScreen({ title, description, features, className, onLoginClick, termsUrl, privacyUrl, imageUrl, imageAlt, }: WelcomeScreenProps): react_jsx_runtime.JSX.Element;
|
|
94
|
+
|
|
79
95
|
interface AuthContextValue {
|
|
80
96
|
user: User | null;
|
|
81
97
|
isAuthenticated: boolean;
|
|
@@ -88,6 +104,7 @@ declare const AuthContext: React__default.Context<AuthContextValue | undefined>;
|
|
|
88
104
|
interface AuthProviderProps {
|
|
89
105
|
children: ReactNode;
|
|
90
106
|
service: AuthService;
|
|
107
|
+
welcomeScreenProps?: WelcomeScreenProps;
|
|
91
108
|
}
|
|
92
109
|
declare const AuthProvider: React__default.FC<AuthProviderProps>;
|
|
93
110
|
|
|
@@ -111,6 +128,23 @@ interface ThreadProviderProps {
|
|
|
111
128
|
}
|
|
112
129
|
declare const ThreadProvider: React__default.FC<ThreadProviderProps>;
|
|
113
130
|
|
|
131
|
+
interface SidebarContextValue {
|
|
132
|
+
leftCollapsed: boolean;
|
|
133
|
+
rightCollapsed: boolean;
|
|
134
|
+
setLeftCollapsed: (collapsed: boolean) => void;
|
|
135
|
+
setRightCollapsed: (collapsed: boolean) => void;
|
|
136
|
+
leftCollapsible: boolean;
|
|
137
|
+
rightCollapsible: boolean;
|
|
138
|
+
}
|
|
139
|
+
declare const SidebarContext: React__default.Context<SidebarContextValue | undefined>;
|
|
140
|
+
declare function useSidebar(): SidebarContextValue;
|
|
141
|
+
interface SidebarProviderProps {
|
|
142
|
+
children: React__default.ReactNode;
|
|
143
|
+
defaultLeftCollapsed?: boolean;
|
|
144
|
+
defaultRightCollapsed?: boolean;
|
|
145
|
+
}
|
|
146
|
+
declare function SidebarProvider({ children, defaultLeftCollapsed, defaultRightCollapsed, }: SidebarProviderProps): react_jsx_runtime.JSX.Element;
|
|
147
|
+
|
|
114
148
|
type Theme = "light" | "dark" | "system";
|
|
115
149
|
interface ThemeContextType {
|
|
116
150
|
theme: Theme;
|
|
@@ -207,7 +241,7 @@ interface ChatHeaderProps {
|
|
|
207
241
|
*/
|
|
208
242
|
declare function ChatHeader({ leftContent, rightContent, className, children, }: ChatHeaderProps): react_jsx_runtime.JSX.Element;
|
|
209
243
|
|
|
210
|
-
interface
|
|
244
|
+
interface PopupChatProps {
|
|
211
245
|
title?: string;
|
|
212
246
|
placeholder?: string;
|
|
213
247
|
starterPrompts?: StarterPrompt[];
|
|
@@ -223,26 +257,20 @@ interface ChatPopupProps {
|
|
|
223
257
|
*/
|
|
224
258
|
defaultSelectedIds?: string[];
|
|
225
259
|
}
|
|
226
|
-
declare function
|
|
260
|
+
declare function PopupChat({ title, placeholder, starterPrompts, options, defaultOpen, headerProps, defaultSelectedIds, }: PopupChatProps): react_jsx_runtime.JSX.Element;
|
|
227
261
|
|
|
228
|
-
interface
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
starterPrompts?: StarterPrompt[];
|
|
232
|
-
options?: ComposerOptionGroup[];
|
|
262
|
+
interface SidebarProps {
|
|
263
|
+
side: "left" | "right";
|
|
264
|
+
children: React__default.ReactNode;
|
|
233
265
|
className?: string;
|
|
234
|
-
/**
|
|
235
|
-
* Props for customizing the header. If provided, title prop will be passed to header.
|
|
236
|
-
*/
|
|
237
|
-
headerProps?: Omit<ChatHeaderProps, "title">;
|
|
238
|
-
/**
|
|
239
|
-
* IDs of options to be selected by default
|
|
240
|
-
*/
|
|
241
|
-
defaultSelectedIds?: string[];
|
|
242
266
|
}
|
|
243
|
-
|
|
267
|
+
/**
|
|
268
|
+
* A sidebar component that responds to ChatSidebarContext.
|
|
269
|
+
* Typically used within ChatFull or a layout with ChatSidebarProvider.
|
|
270
|
+
*/
|
|
271
|
+
declare function Sidebar({ side, children, className }: SidebarProps): react_jsx_runtime.JSX.Element;
|
|
244
272
|
|
|
245
|
-
interface
|
|
273
|
+
interface FullChatProps {
|
|
246
274
|
title?: string;
|
|
247
275
|
placeholder?: string;
|
|
248
276
|
starterPrompts?: StarterPrompt[];
|
|
@@ -252,22 +280,6 @@ interface ChatFullProps {
|
|
|
252
280
|
* Props for customizing the header. If provided, title prop will be passed to header.
|
|
253
281
|
*/
|
|
254
282
|
headerProps?: Omit<ChatHeaderProps, "title">;
|
|
255
|
-
/**
|
|
256
|
-
* Customizable left sidebar content. Typically used for navigation, thread list, etc.
|
|
257
|
-
*/
|
|
258
|
-
leftSidebar?: React__default.ReactNode;
|
|
259
|
-
/**
|
|
260
|
-
* Customizable right sidebar content. Typically used as a canvas, additional info, etc.
|
|
261
|
-
*/
|
|
262
|
-
rightSidebar?: React__default.ReactNode;
|
|
263
|
-
/**
|
|
264
|
-
* Custom className for the left sidebar container
|
|
265
|
-
*/
|
|
266
|
-
leftSidebarClassName?: string;
|
|
267
|
-
/**
|
|
268
|
-
* Custom className for the right sidebar container
|
|
269
|
-
*/
|
|
270
|
-
rightSidebarClassName?: string;
|
|
271
283
|
/**
|
|
272
284
|
* Whether the composer should be auto focused
|
|
273
285
|
*/
|
|
@@ -277,7 +289,7 @@ interface ChatFullProps {
|
|
|
277
289
|
*/
|
|
278
290
|
defaultSelectedIds?: string[];
|
|
279
291
|
}
|
|
280
|
-
declare function
|
|
292
|
+
declare function FullChat({ title, placeholder, starterPrompts, options, className, headerProps, autoFocus, defaultSelectedIds, }: FullChatProps): react_jsx_runtime.JSX.Element;
|
|
281
293
|
|
|
282
294
|
interface SidebarToggleProps {
|
|
283
295
|
side: "left" | "right";
|
|
@@ -285,17 +297,6 @@ interface SidebarToggleProps {
|
|
|
285
297
|
}
|
|
286
298
|
declare function SidebarToggle({ side, className }: SidebarToggleProps): react_jsx_runtime.JSX.Element | null;
|
|
287
299
|
|
|
288
|
-
interface ChatSidebarContextValue {
|
|
289
|
-
leftCollapsed: boolean;
|
|
290
|
-
rightCollapsed: boolean;
|
|
291
|
-
setLeftCollapsed: (collapsed: boolean) => void;
|
|
292
|
-
setRightCollapsed: (collapsed: boolean) => void;
|
|
293
|
-
leftCollapsible: boolean;
|
|
294
|
-
rightCollapsible: boolean;
|
|
295
|
-
}
|
|
296
|
-
declare const ChatSidebarContext: React__default.Context<ChatSidebarContextValue | undefined>;
|
|
297
|
-
declare function useChatSidebar(): ChatSidebarContextValue;
|
|
298
|
-
|
|
299
300
|
interface ThreadListProps {
|
|
300
301
|
className?: string;
|
|
301
302
|
emptyState?: React$1.ReactNode;
|
|
@@ -473,4 +474,4 @@ declare const Badge: React__default.FC<BadgeProps>;
|
|
|
473
474
|
|
|
474
475
|
declare function groupEventsToMessages(events: Event[]): Message[];
|
|
475
476
|
|
|
476
|
-
export { AccountDialog, type AccountDialogProps, AuthContext, type AuthContextValue, AuthProvider, type AuthProviderProps, type AuthService, Badge, Box, Button, Card, Chart,
|
|
477
|
+
export { AccountDialog, type AccountDialogProps, 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, Divider, Form, FullChat, type FullChatProps, Heading, Image, Input, Label, List, ListItem, MelonyClientProvider, type MelonyClientProviderProps, MelonyContext, type MelonyContextValue, 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 };
|