@huskel/sdk 0.3.3 → 0.4.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/dist/index.d.mts CHANGED
@@ -91,6 +91,7 @@ declare class HuskelAPI {
91
91
  ingestBatch(products: Product[]): Promise<IngestResponse>;
92
92
  search(query: string, limit?: number): Promise<SearchResponse>;
93
93
  searchVector(query: string, limit?: number): Promise<SearchResponse>;
94
+ searchAutocomplete(query: string, limit?: number): Promise<SearchResponse>;
94
95
  chat(query: string, history?: Array<{
95
96
  role: 'user' | 'assistant';
96
97
  content: string;
@@ -196,6 +197,7 @@ declare function useChat(): UseChatReturn;
196
197
  interface SearchBarProps {
197
198
  placeholder?: string;
198
199
  limit?: number;
200
+ /** Debounce in ms — default 80 for near-instant feel */
199
201
  debounceMs?: number;
200
202
  onSelect?: (result: SearchResult) => void;
201
203
  className?: string;
@@ -209,9 +211,16 @@ interface SparkleProps {
209
211
  productName: string;
210
212
  limit?: number;
211
213
  onResult?: (results: SearchResult[]) => void;
214
+ /** Override the backdrop colour (any CSS colour/gradient) */
215
+ backdropColor?: string;
216
+ /** Override backdrop blur — e.g. "8px" or 8 */
217
+ backdropBlur?: string | number;
218
+ /** Extra classes on the trigger button */
212
219
  className?: string;
220
+ /** Called when user clicks a result — return false to prevent default navigation */
221
+ onNavigate?: (result: SearchResult) => boolean | void;
213
222
  }
214
- declare function Sparkle({ productName, limit, onResult, className }: SparkleProps): react_jsx_runtime.JSX.Element;
223
+ declare function Sparkle({ productName, limit, onResult, backdropColor, backdropBlur, className, onNavigate }: SparkleProps): react_jsx_runtime.JSX.Element;
215
224
 
216
225
  interface ChatWidgetProps {
217
226
  placeholder?: string;
@@ -222,9 +231,20 @@ interface ChatWidgetProps {
222
231
  }
223
232
  declare function ChatWidget({ placeholder, title, className, onSelectSource }: ChatWidgetProps): react_jsx_runtime.JSX.Element;
224
233
 
234
+ interface AIChatButtonProps {
235
+ label?: string;
236
+ title?: string;
237
+ placeholder?: string;
238
+ backdropColor?: string;
239
+ backdropBlur?: string | number;
240
+ className?: string;
241
+ onSelectSource?: (source: ChatSource) => void;
242
+ }
243
+ declare function AIChatButton({ label, title, placeholder, backdropColor, backdropBlur, className, onSelectSource, }: AIChatButtonProps): react_jsx_runtime.JSX.Element;
244
+
225
245
  interface HuskelProviderProps extends HuskelConfig {
226
246
  children: React.ReactNode;
227
247
  }
228
248
  declare function HuskelProvider({ siteId, apiUrl, apiToken, shopperId, children }: HuskelProviderProps): react_jsx_runtime.JSX.Element;
229
249
 
230
- export { type ChatMessage, type ChatSource, ChatWidget, HuskelAPI, HuskelClient, type HuskelConfig, type HuskelError, HuskelProvider, type IngestResponse, type Product, type RawProductInput, SearchBar, type SearchRequest, type SearchResponse, type SearchResult, Sparkle, getHuskelClient, initHuskel, useChat, useHuskel, useIngest, usePageIngest, useSearch };
250
+ export { AIChatButton, type ChatMessage, type ChatSource, ChatWidget, HuskelAPI, HuskelClient, type HuskelConfig, type HuskelError, HuskelProvider, type IngestResponse, type Product, type RawProductInput, SearchBar, type SearchRequest, type SearchResponse, type SearchResult, Sparkle, getHuskelClient, initHuskel, useChat, useHuskel, useIngest, usePageIngest, useSearch };
package/dist/index.d.ts CHANGED
@@ -91,6 +91,7 @@ declare class HuskelAPI {
91
91
  ingestBatch(products: Product[]): Promise<IngestResponse>;
92
92
  search(query: string, limit?: number): Promise<SearchResponse>;
93
93
  searchVector(query: string, limit?: number): Promise<SearchResponse>;
94
+ searchAutocomplete(query: string, limit?: number): Promise<SearchResponse>;
94
95
  chat(query: string, history?: Array<{
95
96
  role: 'user' | 'assistant';
96
97
  content: string;
@@ -196,6 +197,7 @@ declare function useChat(): UseChatReturn;
196
197
  interface SearchBarProps {
197
198
  placeholder?: string;
198
199
  limit?: number;
200
+ /** Debounce in ms — default 80 for near-instant feel */
199
201
  debounceMs?: number;
200
202
  onSelect?: (result: SearchResult) => void;
201
203
  className?: string;
@@ -209,9 +211,16 @@ interface SparkleProps {
209
211
  productName: string;
210
212
  limit?: number;
211
213
  onResult?: (results: SearchResult[]) => void;
214
+ /** Override the backdrop colour (any CSS colour/gradient) */
215
+ backdropColor?: string;
216
+ /** Override backdrop blur — e.g. "8px" or 8 */
217
+ backdropBlur?: string | number;
218
+ /** Extra classes on the trigger button */
212
219
  className?: string;
220
+ /** Called when user clicks a result — return false to prevent default navigation */
221
+ onNavigate?: (result: SearchResult) => boolean | void;
213
222
  }
214
- declare function Sparkle({ productName, limit, onResult, className }: SparkleProps): react_jsx_runtime.JSX.Element;
223
+ declare function Sparkle({ productName, limit, onResult, backdropColor, backdropBlur, className, onNavigate }: SparkleProps): react_jsx_runtime.JSX.Element;
215
224
 
216
225
  interface ChatWidgetProps {
217
226
  placeholder?: string;
@@ -222,9 +231,20 @@ interface ChatWidgetProps {
222
231
  }
223
232
  declare function ChatWidget({ placeholder, title, className, onSelectSource }: ChatWidgetProps): react_jsx_runtime.JSX.Element;
224
233
 
234
+ interface AIChatButtonProps {
235
+ label?: string;
236
+ title?: string;
237
+ placeholder?: string;
238
+ backdropColor?: string;
239
+ backdropBlur?: string | number;
240
+ className?: string;
241
+ onSelectSource?: (source: ChatSource) => void;
242
+ }
243
+ declare function AIChatButton({ label, title, placeholder, backdropColor, backdropBlur, className, onSelectSource, }: AIChatButtonProps): react_jsx_runtime.JSX.Element;
244
+
225
245
  interface HuskelProviderProps extends HuskelConfig {
226
246
  children: React.ReactNode;
227
247
  }
228
248
  declare function HuskelProvider({ siteId, apiUrl, apiToken, shopperId, children }: HuskelProviderProps): react_jsx_runtime.JSX.Element;
229
249
 
230
- export { type ChatMessage, type ChatSource, ChatWidget, HuskelAPI, HuskelClient, type HuskelConfig, type HuskelError, HuskelProvider, type IngestResponse, type Product, type RawProductInput, SearchBar, type SearchRequest, type SearchResponse, type SearchResult, Sparkle, getHuskelClient, initHuskel, useChat, useHuskel, useIngest, usePageIngest, useSearch };
250
+ export { AIChatButton, type ChatMessage, type ChatSource, ChatWidget, HuskelAPI, HuskelClient, type HuskelConfig, type HuskelError, HuskelProvider, type IngestResponse, type Product, type RawProductInput, SearchBar, type SearchRequest, type SearchResponse, type SearchResult, Sparkle, getHuskelClient, initHuskel, useChat, useHuskel, useIngest, usePageIngest, useSearch };