@supernal/interface-nextjs 0.1.1 → 1.0.9
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.mts +69 -30
- package/dist/index.d.ts +69 -30
- package/dist/index.js +844 -145
- package/dist/index.mjs +844 -145
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -18,21 +18,6 @@ interface SupernalProviderProps {
|
|
|
18
18
|
}
|
|
19
19
|
declare function SupernalProvider({ children, theme, position, mode, apiKey, welcomeMessage, routes, disabled, onNavigate, onToolExecute, }: SupernalProviderProps): react_jsx_runtime.JSX.Element;
|
|
20
20
|
|
|
21
|
-
interface ChatInputContextType {
|
|
22
|
-
/**
|
|
23
|
-
* Insert text into the chat input (and optionally submit it)
|
|
24
|
-
*/
|
|
25
|
-
insertText: (text: string, submit?: boolean) => void;
|
|
26
|
-
/**
|
|
27
|
-
* Register the chat input element (called by ChatBubble)
|
|
28
|
-
*/
|
|
29
|
-
registerInput: (callback: (text: string, submit?: boolean) => void) => void;
|
|
30
|
-
}
|
|
31
|
-
declare function useChatInput(): ChatInputContextType;
|
|
32
|
-
declare function ChatInputProvider({ children }: {
|
|
33
|
-
children: React.ReactNode;
|
|
34
|
-
}): react_jsx_runtime.JSX.Element;
|
|
35
|
-
|
|
36
21
|
declare function NavigationContextProvider({ value, children }: {
|
|
37
22
|
value: string;
|
|
38
23
|
children: React.ReactNode;
|
|
@@ -133,14 +118,14 @@ declare function useNavigate(): {
|
|
|
133
118
|
*/
|
|
134
119
|
declare function useAllContexts(): NavigationContext[];
|
|
135
120
|
|
|
136
|
-
interface Message {
|
|
121
|
+
interface Message$1 {
|
|
137
122
|
id: string;
|
|
138
123
|
text: string;
|
|
139
124
|
type: 'user' | 'ai' | 'system';
|
|
140
125
|
timestamp: string;
|
|
141
126
|
}
|
|
142
127
|
interface ChatContextType {
|
|
143
|
-
messages: Message[];
|
|
128
|
+
messages: Message$1[];
|
|
144
129
|
sendMessage: (text: string) => Promise<void>;
|
|
145
130
|
clearMessages: () => void;
|
|
146
131
|
isLoading: boolean;
|
|
@@ -153,21 +138,75 @@ declare function ChatProvider({ children, mode, apiKey, onToolExecute, }: {
|
|
|
153
138
|
onToolExecute?: (tool: string, result: any) => void;
|
|
154
139
|
}): react_jsx_runtime.JSX.Element;
|
|
155
140
|
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
141
|
+
interface Message {
|
|
142
|
+
id: string;
|
|
143
|
+
text: string;
|
|
144
|
+
type: 'user' | 'ai' | 'system';
|
|
145
|
+
timestamp: string;
|
|
146
|
+
}
|
|
147
|
+
type Position = 'bottom-right' | 'bottom-left' | 'top-right' | 'top-left' | 'left-center' | 'right-center' | 'bottom-center';
|
|
148
|
+
type Variant = 'full' | 'floating';
|
|
149
|
+
interface ChatBubbleConfig {
|
|
150
|
+
/** Optional title for the chat header */
|
|
151
|
+
title?: string;
|
|
152
|
+
/** Optional avatar/icon (emoji, URL, or React node) */
|
|
153
|
+
avatar?: string | React.ReactNode;
|
|
154
|
+
/** Optional description shown in info popup */
|
|
155
|
+
description?: string;
|
|
156
|
+
/** Placeholder text for input */
|
|
157
|
+
placeholder?: string;
|
|
158
|
+
/** Send button label */
|
|
159
|
+
sendButtonLabel?: string;
|
|
160
|
+
/** Welcome message configuration */
|
|
161
|
+
welcome?: {
|
|
162
|
+
enabled: boolean;
|
|
163
|
+
title?: string;
|
|
164
|
+
content?: string;
|
|
165
|
+
suggestedCommands?: Array<{
|
|
166
|
+
text: string;
|
|
167
|
+
desc: string;
|
|
168
|
+
}>;
|
|
169
|
+
};
|
|
170
|
+
/** Theme colors */
|
|
171
|
+
theme?: {
|
|
172
|
+
primary?: string;
|
|
173
|
+
secondary?: string;
|
|
174
|
+
background?: string;
|
|
175
|
+
};
|
|
176
|
+
/** Enable glassmorphism effect */
|
|
177
|
+
glassMode?: boolean;
|
|
178
|
+
}
|
|
165
179
|
interface ChatBubbleProps {
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
180
|
+
messages: Message[];
|
|
181
|
+
onSendMessage: (message: string) => void;
|
|
182
|
+
onClearChat?: () => void;
|
|
183
|
+
/** Positioning mode */
|
|
184
|
+
position?: Position;
|
|
185
|
+
/** Variant: 'full' for expanded panel, 'floating' for mini draggable bubble */
|
|
186
|
+
variant?: Variant;
|
|
187
|
+
/** Configuration for branding, text, and theme */
|
|
188
|
+
config?: ChatBubbleConfig;
|
|
189
|
+
/** Initial expanded state */
|
|
190
|
+
defaultExpanded?: boolean;
|
|
191
|
+
/** Storage key for persisting state */
|
|
192
|
+
storageKey?: string;
|
|
169
193
|
}
|
|
170
|
-
declare const ChatBubble:
|
|
194
|
+
declare const ChatBubble: ({ messages, onSendMessage, onClearChat, position, variant, config: userConfig, defaultExpanded, storageKey, }: ChatBubbleProps) => react_jsx_runtime.JSX.Element;
|
|
195
|
+
|
|
196
|
+
interface ChatInputContextType {
|
|
197
|
+
/**
|
|
198
|
+
* Insert text into the chat input (and optionally submit it)
|
|
199
|
+
*/
|
|
200
|
+
insertText: (text: string, submit?: boolean) => void;
|
|
201
|
+
/**
|
|
202
|
+
* Register the chat input element (called by ChatBubble)
|
|
203
|
+
*/
|
|
204
|
+
registerInput: (callback: (text: string, submit?: boolean) => void) => void;
|
|
205
|
+
}
|
|
206
|
+
declare function useChatInput(): ChatInputContextType;
|
|
207
|
+
declare function ChatInputProvider({ children }: {
|
|
208
|
+
children: React.ReactNode;
|
|
209
|
+
}): react_jsx_runtime.JSX.Element;
|
|
171
210
|
|
|
172
211
|
interface AutoNavigationContextProps {
|
|
173
212
|
children: React.ReactNode;
|
package/dist/index.d.ts
CHANGED
|
@@ -18,21 +18,6 @@ interface SupernalProviderProps {
|
|
|
18
18
|
}
|
|
19
19
|
declare function SupernalProvider({ children, theme, position, mode, apiKey, welcomeMessage, routes, disabled, onNavigate, onToolExecute, }: SupernalProviderProps): react_jsx_runtime.JSX.Element;
|
|
20
20
|
|
|
21
|
-
interface ChatInputContextType {
|
|
22
|
-
/**
|
|
23
|
-
* Insert text into the chat input (and optionally submit it)
|
|
24
|
-
*/
|
|
25
|
-
insertText: (text: string, submit?: boolean) => void;
|
|
26
|
-
/**
|
|
27
|
-
* Register the chat input element (called by ChatBubble)
|
|
28
|
-
*/
|
|
29
|
-
registerInput: (callback: (text: string, submit?: boolean) => void) => void;
|
|
30
|
-
}
|
|
31
|
-
declare function useChatInput(): ChatInputContextType;
|
|
32
|
-
declare function ChatInputProvider({ children }: {
|
|
33
|
-
children: React.ReactNode;
|
|
34
|
-
}): react_jsx_runtime.JSX.Element;
|
|
35
|
-
|
|
36
21
|
declare function NavigationContextProvider({ value, children }: {
|
|
37
22
|
value: string;
|
|
38
23
|
children: React.ReactNode;
|
|
@@ -133,14 +118,14 @@ declare function useNavigate(): {
|
|
|
133
118
|
*/
|
|
134
119
|
declare function useAllContexts(): NavigationContext[];
|
|
135
120
|
|
|
136
|
-
interface Message {
|
|
121
|
+
interface Message$1 {
|
|
137
122
|
id: string;
|
|
138
123
|
text: string;
|
|
139
124
|
type: 'user' | 'ai' | 'system';
|
|
140
125
|
timestamp: string;
|
|
141
126
|
}
|
|
142
127
|
interface ChatContextType {
|
|
143
|
-
messages: Message[];
|
|
128
|
+
messages: Message$1[];
|
|
144
129
|
sendMessage: (text: string) => Promise<void>;
|
|
145
130
|
clearMessages: () => void;
|
|
146
131
|
isLoading: boolean;
|
|
@@ -153,21 +138,75 @@ declare function ChatProvider({ children, mode, apiKey, onToolExecute, }: {
|
|
|
153
138
|
onToolExecute?: (tool: string, result: any) => void;
|
|
154
139
|
}): react_jsx_runtime.JSX.Element;
|
|
155
140
|
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
141
|
+
interface Message {
|
|
142
|
+
id: string;
|
|
143
|
+
text: string;
|
|
144
|
+
type: 'user' | 'ai' | 'system';
|
|
145
|
+
timestamp: string;
|
|
146
|
+
}
|
|
147
|
+
type Position = 'bottom-right' | 'bottom-left' | 'top-right' | 'top-left' | 'left-center' | 'right-center' | 'bottom-center';
|
|
148
|
+
type Variant = 'full' | 'floating';
|
|
149
|
+
interface ChatBubbleConfig {
|
|
150
|
+
/** Optional title for the chat header */
|
|
151
|
+
title?: string;
|
|
152
|
+
/** Optional avatar/icon (emoji, URL, or React node) */
|
|
153
|
+
avatar?: string | React.ReactNode;
|
|
154
|
+
/** Optional description shown in info popup */
|
|
155
|
+
description?: string;
|
|
156
|
+
/** Placeholder text for input */
|
|
157
|
+
placeholder?: string;
|
|
158
|
+
/** Send button label */
|
|
159
|
+
sendButtonLabel?: string;
|
|
160
|
+
/** Welcome message configuration */
|
|
161
|
+
welcome?: {
|
|
162
|
+
enabled: boolean;
|
|
163
|
+
title?: string;
|
|
164
|
+
content?: string;
|
|
165
|
+
suggestedCommands?: Array<{
|
|
166
|
+
text: string;
|
|
167
|
+
desc: string;
|
|
168
|
+
}>;
|
|
169
|
+
};
|
|
170
|
+
/** Theme colors */
|
|
171
|
+
theme?: {
|
|
172
|
+
primary?: string;
|
|
173
|
+
secondary?: string;
|
|
174
|
+
background?: string;
|
|
175
|
+
};
|
|
176
|
+
/** Enable glassmorphism effect */
|
|
177
|
+
glassMode?: boolean;
|
|
178
|
+
}
|
|
165
179
|
interface ChatBubbleProps {
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
180
|
+
messages: Message[];
|
|
181
|
+
onSendMessage: (message: string) => void;
|
|
182
|
+
onClearChat?: () => void;
|
|
183
|
+
/** Positioning mode */
|
|
184
|
+
position?: Position;
|
|
185
|
+
/** Variant: 'full' for expanded panel, 'floating' for mini draggable bubble */
|
|
186
|
+
variant?: Variant;
|
|
187
|
+
/** Configuration for branding, text, and theme */
|
|
188
|
+
config?: ChatBubbleConfig;
|
|
189
|
+
/** Initial expanded state */
|
|
190
|
+
defaultExpanded?: boolean;
|
|
191
|
+
/** Storage key for persisting state */
|
|
192
|
+
storageKey?: string;
|
|
169
193
|
}
|
|
170
|
-
declare const ChatBubble:
|
|
194
|
+
declare const ChatBubble: ({ messages, onSendMessage, onClearChat, position, variant, config: userConfig, defaultExpanded, storageKey, }: ChatBubbleProps) => react_jsx_runtime.JSX.Element;
|
|
195
|
+
|
|
196
|
+
interface ChatInputContextType {
|
|
197
|
+
/**
|
|
198
|
+
* Insert text into the chat input (and optionally submit it)
|
|
199
|
+
*/
|
|
200
|
+
insertText: (text: string, submit?: boolean) => void;
|
|
201
|
+
/**
|
|
202
|
+
* Register the chat input element (called by ChatBubble)
|
|
203
|
+
*/
|
|
204
|
+
registerInput: (callback: (text: string, submit?: boolean) => void) => void;
|
|
205
|
+
}
|
|
206
|
+
declare function useChatInput(): ChatInputContextType;
|
|
207
|
+
declare function ChatInputProvider({ children }: {
|
|
208
|
+
children: React.ReactNode;
|
|
209
|
+
}): react_jsx_runtime.JSX.Element;
|
|
171
210
|
|
|
172
211
|
interface AutoNavigationContextProps {
|
|
173
212
|
children: React.ReactNode;
|