@akropolys/kiku 1.8.0 → 2.1.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/README.md +64 -64
- package/dist/chunk-RWGHGIF7.mjs +3 -0
- package/dist/chunk-RWGHGIF7.mjs.map +1 -0
- package/dist/index.d.mts +5 -196
- package/dist/index.d.ts +5 -196
- package/dist/index.js +7 -16
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -46
- package/dist/index.mjs.map +1 -1
- package/dist/lazy-UZ2LZJOA.mjs +39 -0
- package/dist/lazy-UZ2LZJOA.mjs.map +1 -0
- package/dist/styles.css +1 -1
- package/dist/styles.css.map +1 -1
- package/package.json +7 -9
- package/dist/kiku.iife.global.js +0 -111
- package/dist/kiku.iife.global.js.map +0 -1
- package/dist/kiku.iife.js +0 -111
- package/dist/kiku.iife.js.map +0 -1
- package/dist/shopify.global.js +0 -111
- package/dist/shopify.global.js.map +0 -1
- package/dist/shopify.js +0 -111
- package/dist/shopify.js.map +0 -1
- package/shopify/README.md +0 -71
- package/shopify/blocks/kiku-button.liquid +0 -121
- package/shopify/snippets/kiku-embed.liquid +0 -45
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { SearchResult, AkropolysTheme, ChatSource
|
|
2
|
+
import { SearchResult, AkropolysTheme, ChatSource } from '@akropolys/sdk';
|
|
3
3
|
|
|
4
4
|
interface SearchBarProps {
|
|
5
5
|
placeholder?: string;
|
|
@@ -20,44 +20,18 @@ interface SearchBarProps {
|
|
|
20
20
|
}
|
|
21
21
|
declare function SearchBar({ placeholder, limit, debounceMs, onSelect, className, inputClassName, dropdownClassName, renderResult, theme, classNames, }: SearchBarProps): React.JSX.Element;
|
|
22
22
|
|
|
23
|
-
interface ChatWidgetProps {
|
|
24
|
-
title?: string;
|
|
25
|
-
placeholder?: string;
|
|
26
|
-
emptyStateText?: string;
|
|
27
|
-
emptyStateSuggestions?: string;
|
|
28
|
-
defaultCurrency?: string;
|
|
29
|
-
className?: string;
|
|
30
|
-
theme?: AkropolysTheme;
|
|
31
|
-
classNames?: {
|
|
32
|
-
root?: string;
|
|
33
|
-
header?: string;
|
|
34
|
-
messageBubble?: string;
|
|
35
|
-
input?: string;
|
|
36
|
-
};
|
|
37
|
-
onSelectSource?: (source: ChatSource) => void;
|
|
38
|
-
enableVoice?: boolean;
|
|
39
|
-
/** Enable 📷 visual style-match search */
|
|
40
|
-
enableVision?: boolean;
|
|
41
|
-
visionCategoryHint?: string;
|
|
42
|
-
/** Enable 🔊 TTS voice audio responses from AI */
|
|
43
|
-
enableAudioResponse?: boolean;
|
|
44
|
-
/** Optional AI voice preset */
|
|
45
|
-
ttsVoice?: string;
|
|
46
|
-
autoSpeakResponses?: boolean;
|
|
47
|
-
}
|
|
48
|
-
declare function ChatWidget({ title, placeholder, emptyStateText, emptyStateSuggestions, defaultCurrency, className, theme, classNames, onSelectSource, enableVoice, enableVision, visionCategoryHint, enableAudioResponse, ttsVoice, autoSpeakResponses }: ChatWidgetProps): React.JSX.Element;
|
|
49
|
-
|
|
50
23
|
interface KikuButtonProps {
|
|
51
24
|
label?: React.ReactNode;
|
|
52
25
|
children?: React.ReactNode;
|
|
53
26
|
icon?: React.ReactNode;
|
|
54
27
|
title?: string;
|
|
28
|
+
/** Wordmark shown in place of the name in the topbar. */
|
|
29
|
+
logo?: string;
|
|
55
30
|
placeholder?: string;
|
|
56
31
|
backdropColor?: string;
|
|
57
32
|
backdropBlur?: string | number;
|
|
58
33
|
className?: string;
|
|
59
34
|
onSelectSource?: (source: ChatSource) => void;
|
|
60
|
-
defaultCurrency?: string;
|
|
61
35
|
chips?: string[];
|
|
62
36
|
theme?: 'light' | 'dark' | AkropolysTheme;
|
|
63
37
|
classNames?: {
|
|
@@ -70,173 +44,8 @@ interface KikuButtonProps {
|
|
|
70
44
|
enableVoice?: boolean;
|
|
71
45
|
voiceLang?: string;
|
|
72
46
|
enableVision?: boolean;
|
|
73
|
-
visionCategoryHint?: string;
|
|
74
|
-
/** Enable 🔊 TTS voice audio responses from AI */
|
|
75
|
-
enableAudioResponse?: boolean;
|
|
76
|
-
ttsVoice?: string;
|
|
77
|
-
autoSpeakResponses?: boolean;
|
|
78
|
-
}
|
|
79
|
-
declare function KikuButton({ label, children, icon, title, placeholder, backdropColor, backdropBlur, className, onSelectSource, defaultCurrency, chips, theme, classNames, enableVoice, voiceLang, enableVision, visionCategoryHint, enableAudioResponse, ttsVoice, autoSpeakResponses, }: KikuButtonProps): React.JSX.Element;
|
|
80
|
-
|
|
81
|
-
interface SparkleProps {
|
|
82
|
-
productName: string;
|
|
83
|
-
limit?: number;
|
|
84
|
-
onResult?: (results: SearchResult[]) => void;
|
|
85
|
-
backdropColor?: string;
|
|
86
|
-
backdropBlur?: string | number;
|
|
87
|
-
className?: string;
|
|
88
|
-
onNavigate?: (result: SearchResult) => boolean | void;
|
|
89
|
-
theme?: AkropolysTheme;
|
|
90
|
-
classNames?: {
|
|
91
|
-
button?: string;
|
|
92
|
-
backdrop?: string;
|
|
93
|
-
card?: string;
|
|
94
|
-
item?: string;
|
|
95
|
-
};
|
|
96
|
-
product?: Product;
|
|
97
|
-
children?: React.ReactNode;
|
|
98
|
-
}
|
|
99
|
-
declare function Sparkle({ productName, limit, onResult, backdropColor, backdropBlur, className, onNavigate, theme, classNames, product, children, }: SparkleProps): React.JSX.Element;
|
|
100
|
-
|
|
101
|
-
interface VoiceButtonProps {
|
|
102
|
-
onTranscript: (text: string) => void;
|
|
103
|
-
onInterim?: (text: string) => void;
|
|
104
|
-
/** BCP-47 tag. Defaults to the page's <html lang>, then the browser language. */
|
|
105
|
-
lang?: string;
|
|
106
|
-
className?: string;
|
|
107
|
-
disabled?: boolean;
|
|
108
|
-
/** Raw SpeechRecognition error code — 'not-allowed', 'audio-capture', etc. */
|
|
109
|
-
onError?: (code: string) => void;
|
|
110
|
-
}
|
|
111
|
-
/**
|
|
112
|
-
* VoiceButton — speech to text input with pause-based utterance detection.
|
|
113
|
-
*/
|
|
114
|
-
declare function VoiceButton({ onTranscript, onInterim, lang, className, disabled, onError, }: VoiceButtonProps): React.JSX.Element | null;
|
|
115
|
-
|
|
116
|
-
interface VisualSearchProps {
|
|
117
|
-
/** Called with search results + the base64 preview when Gemini responds. */
|
|
118
|
-
onResults: (res: VisualSearchResponse, previewBase64: string) => void;
|
|
119
|
-
onError?: (err: Error) => void;
|
|
120
|
-
/**
|
|
121
|
-
* Category hint sent to Gemini to sharpen the match_query.
|
|
122
|
-
* e.g. "dress", "curtains", "sofa", "shoes"
|
|
123
|
-
*/
|
|
124
|
-
categoryHint?: string;
|
|
125
|
-
className?: string;
|
|
126
|
-
disabled?: boolean;
|
|
127
|
-
}
|
|
128
|
-
/**
|
|
129
|
-
* VisualSearch — camera/image-upload button for style-match search.
|
|
130
|
-
*/
|
|
131
|
-
declare function VisualSearch({ onResults, onError, categoryHint, className, disabled, }: VisualSearchProps): React.JSX.Element;
|
|
132
|
-
|
|
133
|
-
interface ScoutRailProps {
|
|
134
|
-
className?: string;
|
|
135
|
-
themeAttr?: string;
|
|
136
|
-
onAsk?: (scout: Scout) => void;
|
|
137
|
-
onNew?: (avatar: string) => void;
|
|
138
|
-
open?: boolean;
|
|
139
|
-
onOpenChange?: (open: boolean) => void;
|
|
140
|
-
}
|
|
141
|
-
declare function ScoutRail({ className, themeAttr, onAsk, onNew, open: openProp, onOpenChange }: ScoutRailProps): React.JSX.Element;
|
|
142
|
-
|
|
143
|
-
type ScoutMood = 'watching' | 'resting' | 'struck' | 'gone';
|
|
144
|
-
interface ScoutCharacterProps {
|
|
145
|
-
scoutId: string;
|
|
146
|
-
avatar?: string;
|
|
147
|
-
mood?: ScoutMood;
|
|
148
|
-
size?: number;
|
|
149
|
-
layer?: 'all' | 'body';
|
|
150
|
-
}
|
|
151
|
-
declare function ScoutCharacter({ scoutId, avatar, mood, size, layer }: ScoutCharacterProps): React.JSX.Element;
|
|
152
|
-
|
|
153
|
-
interface ShopifyProduct {
|
|
154
|
-
id?: number | string;
|
|
155
|
-
title?: string;
|
|
156
|
-
name?: string;
|
|
157
|
-
handle?: string;
|
|
158
|
-
url?: string;
|
|
159
|
-
price?: number | string;
|
|
160
|
-
compare_at_price?: number | string;
|
|
161
|
-
price_min?: number | string;
|
|
162
|
-
featured_image?: string;
|
|
163
|
-
images?: string[] | {
|
|
164
|
-
src: string;
|
|
165
|
-
}[];
|
|
166
|
-
image?: string;
|
|
167
|
-
type?: string;
|
|
168
|
-
product_type?: string;
|
|
169
|
-
category?: string;
|
|
170
|
-
vendor?: string;
|
|
171
|
-
brand?: string;
|
|
172
|
-
tags?: string[] | string;
|
|
173
|
-
description?: string;
|
|
174
|
-
body_html?: string;
|
|
175
|
-
variants?: Array<{
|
|
176
|
-
id: number | string;
|
|
177
|
-
title?: string;
|
|
178
|
-
price?: number | string;
|
|
179
|
-
sku?: string;
|
|
180
|
-
available?: boolean;
|
|
181
|
-
}>;
|
|
182
|
-
available?: boolean;
|
|
183
|
-
[key: string]: any;
|
|
184
|
-
}
|
|
185
|
-
interface StandaloneConfig {
|
|
186
|
-
siteId?: string;
|
|
187
|
-
apiToken?: string;
|
|
188
|
-
apiUrl?: string;
|
|
189
|
-
vertical?: string;
|
|
190
|
-
shopperId?: string;
|
|
191
|
-
theme?: 'dark' | 'light' | any;
|
|
192
|
-
buttonLabel?: string;
|
|
193
|
-
title?: string;
|
|
194
|
-
placeholder?: string;
|
|
195
|
-
defaultCurrency?: string;
|
|
196
|
-
chips?: string[];
|
|
197
|
-
enableVoice?: boolean;
|
|
198
|
-
voiceLang?: string;
|
|
199
|
-
enableVision?: boolean;
|
|
200
|
-
visionCategoryHint?: string;
|
|
201
|
-
enableAudioResponse?: boolean;
|
|
202
47
|
ttsVoice?: string;
|
|
203
|
-
autoSpeakResponses?: boolean;
|
|
204
|
-
position?: 'bottom-right' | 'bottom-left' | 'top-right' | 'top-left' | 'inline' | 'hidden' | 'custom';
|
|
205
|
-
containerId?: string;
|
|
206
|
-
containerSelector?: string;
|
|
207
|
-
dockable?: boolean;
|
|
208
|
-
product?: ShopifyProduct;
|
|
209
|
-
onAddToCart?: (items: ChatSource[]) => void;
|
|
210
|
-
onAction?: (action: any) => void;
|
|
211
|
-
[key: string]: any;
|
|
212
|
-
}
|
|
213
|
-
declare global {
|
|
214
|
-
interface Window {
|
|
215
|
-
AkropolysConfig?: StandaloneConfig;
|
|
216
|
-
Kiku?: {
|
|
217
|
-
version: string;
|
|
218
|
-
open: () => void;
|
|
219
|
-
close: () => void;
|
|
220
|
-
toggle: () => void;
|
|
221
|
-
ingest: (product: ShopifyProduct) => Promise<void>;
|
|
222
|
-
resetPosition: () => void;
|
|
223
|
-
getClient: () => any;
|
|
224
|
-
config: StandaloneConfig;
|
|
225
|
-
};
|
|
226
|
-
}
|
|
227
48
|
}
|
|
228
|
-
|
|
229
|
-
* Normalizes a Shopify product object into Akropolys entity format.
|
|
230
|
-
*/
|
|
231
|
-
declare function normalizeShopifyProduct(p: ShopifyProduct): Record<string, any>;
|
|
232
|
-
/**
|
|
233
|
-
* Native Shopify Cart Integration.
|
|
234
|
-
*/
|
|
235
|
-
declare function shopifyAddToCart(items: ChatSource[]): Promise<any>;
|
|
236
|
-
/**
|
|
237
|
-
* Native Shopify Get Cart.
|
|
238
|
-
*/
|
|
239
|
-
declare function shopifyGetCart(): Promise<any>;
|
|
240
|
-
declare function initKiku(customConfig?: StandaloneConfig): void;
|
|
49
|
+
declare function KikuButton({ label, children, icon, title, logo, placeholder, backdropColor, backdropBlur, className, onSelectSource, chips, theme, classNames, enableVoice, voiceLang, ttsVoice, enableVision, }: KikuButtonProps): React.JSX.Element;
|
|
241
50
|
|
|
242
|
-
export {
|
|
51
|
+
export { KikuButton, type KikuButtonProps, SearchBar, type SearchBarProps };
|