@hachther/akilio-widget 0.6.1 → 0.6.5
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 +37 -10
- package/dist/AkilioWidget.d.ts +1 -1
- package/dist/akilio-widget.min.js +39 -40
- package/dist/components/BrandLogo.d.ts +5 -1
- package/dist/components/ChatPanel.d.ts +1 -33
- package/dist/components/Composer.d.ts +24 -0
- package/dist/components/EmptyState.d.ts +9 -0
- package/dist/components/Launcher.d.ts +2 -1
- package/dist/components/LauncherCoachmark.d.ts +12 -0
- package/dist/components/MessageBubble.d.ts +1 -0
- package/dist/components/MessageList.d.ts +3 -0
- package/dist/components/ProductCard.d.ts +12 -0
- package/dist/components/StreamActivity.d.ts +7 -0
- package/dist/index.min.js +4252 -3681
- package/dist/index.umd.min.cjs +29 -30
- package/dist/lib/client.d.ts +5 -1
- package/dist/lib/detector.d.ts +16 -0
- package/dist/logos/AkilioMark.d.ts +1 -1
- package/dist/logos/AkilioWordmark.d.ts +2 -1
- package/dist/style.css +503 -100
- package/dist/types.d.ts +65 -15
- package/package.json +3 -2
- package/dist/driver.js-CVJgNCO-.js +0 -534
package/dist/types.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
|
+
import type { AkilioResolvedCopy } from './lib/copy';
|
|
2
3
|
export type AkilioMode = 'floating' | 'inline' | 'side-panel' | 'drawer' | 'hybrid';
|
|
3
4
|
export type AkilioColorMode = 'light' | 'dark' | 'system';
|
|
4
5
|
export type AkilioLocale = string;
|
|
@@ -9,6 +10,7 @@ export type AkilioWidgetBranding = 'akilio_required' | 'removable' | 'white_labe
|
|
|
9
10
|
export type AkilioCommerceCapabilityType = 'product_search' | 'product_recommendation';
|
|
10
11
|
export type AkilioCommerceEventType = 'search' | 'recommendation' | 'compare' | 'add_to_cart' | 'checkout' | 'purchase';
|
|
11
12
|
export type AkilioCredentialsMode = 'omit' | 'same-origin' | 'include';
|
|
13
|
+
export type StreamEventType = 'open' | 'close' | 'answer-complete' | 'question' | 'answer-start' | 'answer-delta' | 'error' | 'typing-cancel' | 'draft-change' | 'typing-start' | 'typing-complete' | 'reset' | 'ready';
|
|
12
14
|
export type AkilioTokenProvider = () => string | null | undefined | Promise<string | null | undefined>;
|
|
13
15
|
export interface AkilioIssuedWidgetToken {
|
|
14
16
|
token: string;
|
|
@@ -36,21 +38,20 @@ export interface AkilioAuthConfig {
|
|
|
36
38
|
onWidgetToken?: (token: AkilioIssuedWidgetToken) => void;
|
|
37
39
|
}
|
|
38
40
|
export interface AkilioThemeConfig {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
41
|
+
primary_color?: string;
|
|
42
|
+
primary_dark_color?: string;
|
|
43
|
+
primary_foreground_color?: string;
|
|
44
|
+
accent_color?: string;
|
|
45
|
+
surface_color?: string;
|
|
46
|
+
text_color?: string;
|
|
47
|
+
muted_color?: string;
|
|
46
48
|
radius?: string;
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
[key: string]: unknown;
|
|
49
|
+
launcher_label?: string;
|
|
50
|
+
panel_width?: number;
|
|
51
|
+
z_index?: number;
|
|
52
|
+
logo_url?: string;
|
|
53
|
+
brand_name?: string;
|
|
54
|
+
color_mode?: AkilioColorMode;
|
|
54
55
|
}
|
|
55
56
|
export interface AkilioPageContext {
|
|
56
57
|
url?: string;
|
|
@@ -188,6 +189,7 @@ export interface AkilioChatStreamHandlers {
|
|
|
188
189
|
onStatus?: (stage: string, data: Record<string, unknown>) => void;
|
|
189
190
|
onConversation?: (conversationId: string) => void;
|
|
190
191
|
onDelta?: (delta: string) => void;
|
|
192
|
+
onFinish?: (finalResponse: AkilioChatResponse) => void;
|
|
191
193
|
}
|
|
192
194
|
export type AkilioPublicApiErrorCode = 'NOT_READY' | 'INVALID_QUESTION' | 'EMPTY_DRAFT' | 'BUSY' | 'TYPING_CANCELLED' | 'STREAM_FAILED' | 'RESET_FAILED';
|
|
193
195
|
export interface AkilioDraftOptions {
|
|
@@ -297,6 +299,11 @@ export interface AkilioCopyOverrides {
|
|
|
297
299
|
privacyRequired?: string;
|
|
298
300
|
widgetUnavailable?: string;
|
|
299
301
|
poweredBy?: string;
|
|
302
|
+
aiContentWarning?: string;
|
|
303
|
+
tourTitle?: string;
|
|
304
|
+
tourMessage?: string;
|
|
305
|
+
tourAction?: string;
|
|
306
|
+
tourDismiss?: string;
|
|
300
307
|
privacyDefaultNotice?: string;
|
|
301
308
|
switchToLightMode?: string;
|
|
302
309
|
switchToDarkMode?: string;
|
|
@@ -315,8 +322,9 @@ export interface AkilioLauncherRenderProps {
|
|
|
315
322
|
}
|
|
316
323
|
export type AkilioLauncher = 'default' | 'hidden' | ((controls: AkilioLauncherRenderProps) => ReactNode);
|
|
317
324
|
export type AkilioStyleIsolation = 'shadow' | 'scoped' | 'none';
|
|
325
|
+
export type IntegrationType = 'shopify' | 'woocommerce' | 'wordpress' | 'prestashop' | 'magento' | 'wix' | 'webflow' | 'squarespace' | 'nextjs' | 'react' | 'vue' | 'angular' | 'vanilla' | 'unknown';
|
|
318
326
|
export interface AkilioWidgetProps {
|
|
319
|
-
apiBaseUrl
|
|
327
|
+
apiBaseUrl?: string;
|
|
320
328
|
projectKey: string;
|
|
321
329
|
locale?: AkilioLocale;
|
|
322
330
|
mode?: AkilioMode;
|
|
@@ -338,7 +346,12 @@ export interface AkilioWidgetProps {
|
|
|
338
346
|
/** Built-in launcher, no launcher, or a custom React launcher renderer. */
|
|
339
347
|
launcher?: AkilioLauncher;
|
|
340
348
|
persistOpenState?: boolean;
|
|
349
|
+
/** Show a one-time, dependency-free coachmark beside the default launcher. */
|
|
341
350
|
enableTour?: boolean;
|
|
351
|
+
/** Delay before the automatic coachmark appears. Defaults to 3000ms. */
|
|
352
|
+
tourDelayMs?: number;
|
|
353
|
+
/** Change this value to show a revised coachmark again. Defaults to "v1". */
|
|
354
|
+
tourVersion?: string;
|
|
342
355
|
enableLocalHistory?: boolean;
|
|
343
356
|
enableServerHistorySync?: boolean;
|
|
344
357
|
anonymousId?: string;
|
|
@@ -365,4 +378,41 @@ export interface AkilioWidgetProps {
|
|
|
365
378
|
onMessage?: (message: AkilioChatMessage) => void;
|
|
366
379
|
onProductClick?: (product: AkilioProduct, variant?: AkilioProductVariant) => void;
|
|
367
380
|
onError?: (error: Error) => void;
|
|
381
|
+
integration?: IntegrationType;
|
|
382
|
+
}
|
|
383
|
+
export interface ChatPanelProps {
|
|
384
|
+
open: boolean;
|
|
385
|
+
isDesktop: boolean;
|
|
386
|
+
inline: boolean;
|
|
387
|
+
colorMode: 'light' | 'dark';
|
|
388
|
+
allowColorModeToggle: boolean;
|
|
389
|
+
widgetAvailable: boolean;
|
|
390
|
+
showBranding: boolean;
|
|
391
|
+
showPoweredBy: boolean;
|
|
392
|
+
copy: AkilioResolvedCopy;
|
|
393
|
+
locale: string;
|
|
394
|
+
messages: AkilioChatMessage[];
|
|
395
|
+
streamingMessage?: AkilioChatMessage | null;
|
|
396
|
+
loading: boolean;
|
|
397
|
+
loadingLabel?: string;
|
|
398
|
+
consentDecision: 'pending' | 'accepted' | 'rejected';
|
|
399
|
+
consentGranted: boolean;
|
|
400
|
+
requireConsent: boolean;
|
|
401
|
+
privacyNotice: string;
|
|
402
|
+
privacyNoticeUrl?: string;
|
|
403
|
+
onConsentDecision: (decision: 'pending' | 'accepted' | 'rejected') => void;
|
|
404
|
+
onClose: () => void;
|
|
405
|
+
onToggleColorMode: () => void;
|
|
406
|
+
onClear: () => void;
|
|
407
|
+
onSubmit: (query: string) => Promise<AkilioChatResponse>;
|
|
408
|
+
onDraftChange?: (draft: string, manual: boolean) => void;
|
|
409
|
+
onFeedback: (message: AkilioChatMessage, rating: AkilioFeedbackRating) => void;
|
|
410
|
+
onSuggestion: (suggestion: string) => void;
|
|
411
|
+
onProductClick: (message: AkilioChatMessage, product: AkilioProduct, variant?: AkilioProductVariant) => void;
|
|
412
|
+
primaryColor?: string;
|
|
368
413
|
}
|
|
414
|
+
export type IntegrationDetection = {
|
|
415
|
+
integration: IntegrationType;
|
|
416
|
+
confidence: 'high' | 'medium' | 'low';
|
|
417
|
+
signals: string[];
|
|
418
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hachther/akilio-widget",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.5",
|
|
4
4
|
"description": "Embeddable React AI assistant widget for Akilio backend.",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"type": "module",
|
|
@@ -32,12 +32,13 @@
|
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"clsx": "^2.1.1",
|
|
35
|
-
"driver.js": "^1.8.0",
|
|
36
35
|
"react-markdown": "^10.1.0",
|
|
37
36
|
"rehype-highlight": "^7.0.2",
|
|
37
|
+
"rehype-raw": "^7.0.0",
|
|
38
38
|
"remark-gfm": "^4.0.1"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
|
+
"@testing-library/dom": "^10.4.1",
|
|
41
42
|
"@testing-library/react": "^16.3.2",
|
|
42
43
|
"@types/react": "^19.0.0",
|
|
43
44
|
"@types/react-dom": "^19.0.0",
|