@hachther/akilio-widget 0.7.0 → 1.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 +331 -26
- package/dist/_headers +16 -0
- package/dist/akilio-widget.min.js +45 -44
- package/dist/assets/EmailIcon.d.ts +2 -0
- package/dist/assets/FormIcon.d.ts +2 -0
- package/dist/assets/PhoneIcon.d.ts +2 -0
- package/dist/components/BrandLogo.d.ts +7 -1
- package/dist/components/CartPanel.d.ts +13 -0
- package/dist/components/CommerceActions.d.ts +11 -0
- package/dist/components/Composer.d.ts +7 -1
- package/dist/components/ContactActions.d.ts +2 -2
- package/dist/components/EmptyState.d.ts +3 -7
- package/dist/components/Icons.d.ts +3 -0
- package/dist/components/IdentityVerification.d.ts +14 -0
- package/dist/components/InlineDecisionCard.d.ts +2 -0
- package/dist/components/Launcher.d.ts +6 -1
- package/dist/components/MessageBubble.d.ts +9 -2
- package/dist/components/MessageList.d.ts +1 -1
- package/dist/components/ProductCard.d.ts +4 -2
- package/dist/components/ProductCards.d.ts +6 -1
- package/dist/components/ProductDetail.d.ts +12 -0
- package/dist/components/ProductVariantSelector.d.ts +9 -0
- package/dist/components/SectionPrompt.d.ts +2 -0
- package/dist/components/TextSelectionPrompt.d.ts +2 -0
- package/dist/components/VoiceRecorder.d.ts +11 -0
- package/dist/hooks/current-cart.d.ts +14 -0
- package/dist/hooks/proactive-summary.d.ts +1 -0
- package/dist/hooks/storage.d.ts +2 -0
- package/dist/index.d.ts +5 -1
- package/dist/index.min.js +10412 -7169
- package/dist/index.umd.min.cjs +37 -36
- package/dist/lib/cart-capabilities.d.ts +4 -0
- package/dist/lib/client.d.ts +35 -2
- package/dist/lib/copy.d.ts +8 -2
- package/dist/lib/storefront-cart.d.ts +5 -0
- package/dist/loader.js +46 -0
- package/dist/locales/en.d.ts +161 -0
- package/dist/locales/fr.d.ts +161 -0
- package/dist/locales/index.d.ts +3 -0
- package/dist/releases/1.1.0/akilio-widget.min.js +46 -0
- package/dist/style.css +1842 -81
- package/dist/types.d.ts +569 -31
- package/dist/vanilla.d.ts +1 -0
- package/dist/widget-manifest.json +8 -0
- package/package.json +5 -3
|
@@ -1,10 +1,16 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
export declare const BrandingContext: React.Context<{
|
|
3
|
+
logoUrl?: string;
|
|
4
|
+
name?: string;
|
|
5
|
+
}>;
|
|
6
|
+
export declare function safeLogoUrl(value?: string): string | undefined;
|
|
2
7
|
interface BrandLogoProps {
|
|
8
|
+
showAkilio?: boolean;
|
|
3
9
|
variant?: 'mark' | 'wordmark';
|
|
4
10
|
className?: string;
|
|
5
11
|
style?: React.CSSProperties;
|
|
6
12
|
primaryColor?: string;
|
|
7
13
|
secondaryColor?: string;
|
|
8
14
|
}
|
|
9
|
-
export declare function BrandLogo({ variant, className, style, primaryColor, secondaryColor, }: BrandLogoProps): React.JSX.Element;
|
|
15
|
+
export declare function BrandLogo({ showAkilio, variant, className, style, primaryColor, secondaryColor, }: BrandLogoProps): React.JSX.Element;
|
|
10
16
|
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { AkilioResolvedCopy } from '../lib/copy';
|
|
2
|
+
import type { AkilioCart, AkilioCartAction, AkilioCartLine } from '../types';
|
|
3
|
+
interface CartPanelProps {
|
|
4
|
+
cart: AkilioCart | null;
|
|
5
|
+
loading?: boolean;
|
|
6
|
+
copy: AkilioResolvedCopy;
|
|
7
|
+
locale: string;
|
|
8
|
+
onClose: () => void;
|
|
9
|
+
onRefresh: () => void;
|
|
10
|
+
onAction: (line: AkilioCartLine, action: AkilioCartAction, quantity?: number) => Promise<void>;
|
|
11
|
+
}
|
|
12
|
+
export declare function CartPanel({ cart, loading, copy, locale, onClose, onRefresh, onAction, }: CartPanelProps): import("react").JSX.Element;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { AkilioResolvedCopy } from '../lib/copy';
|
|
2
|
+
import type { AkilioCommercePublicAction, AkilioProduct } from '../types';
|
|
3
|
+
interface CommerceActionsProps {
|
|
4
|
+
actions: AkilioCommercePublicAction[];
|
|
5
|
+
products: AkilioProduct[];
|
|
6
|
+
copy: AkilioResolvedCopy;
|
|
7
|
+
onAction: (action: AkilioCommercePublicAction) => Promise<void>;
|
|
8
|
+
embedded?: boolean;
|
|
9
|
+
}
|
|
10
|
+
export declare function CommerceActions({ actions, products, copy, onAction, embedded, }: CommerceActionsProps): import("react").JSX.Element | null;
|
|
11
|
+
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { AkilioResolvedCopy } from '../lib/copy';
|
|
2
|
-
import type { AkilioChatResponse } from '../types';
|
|
2
|
+
import type { AkilioChatIntent, AkilioChatResponse } from '../types';
|
|
3
3
|
export interface ComposerHandle {
|
|
4
4
|
getDraft(): string;
|
|
5
5
|
setDraft(text: string, options?: {
|
|
@@ -15,11 +15,17 @@ interface ComposerProps {
|
|
|
15
15
|
disabled: boolean;
|
|
16
16
|
copy: AkilioResolvedCopy;
|
|
17
17
|
onSubmit: (query: string) => Promise<AkilioChatResponse>;
|
|
18
|
+
onVoiceSubmit?: (audio: Blob, signal: AbortSignal) => Promise<void>;
|
|
18
19
|
onReviewConsent?: () => void;
|
|
19
20
|
onDraftChange?: (draft: string, manual: boolean) => void;
|
|
20
21
|
disabledMessage?: string;
|
|
21
22
|
showPoweredBy?: boolean;
|
|
22
23
|
slug?: string;
|
|
24
|
+
intentActions?: Array<{
|
|
25
|
+
intent: AkilioChatIntent;
|
|
26
|
+
label: string;
|
|
27
|
+
}>;
|
|
28
|
+
onIntentAction?: (intent: AkilioChatIntent, label: string) => void;
|
|
23
29
|
}
|
|
24
30
|
declare const Composer: import("react").ForwardRefExoticComponent<ComposerProps & import("react").RefAttributes<ComposerHandle>>;
|
|
25
31
|
export default Composer;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { AkilioResolvedCopy } from '../lib/copy';
|
|
2
|
-
import type { AkilioChatMessage, AkilioContactRequest, AkilioContactRequestCapability, AkilioContactRequestResponse } from '../types';
|
|
2
|
+
import type { AkilioChatMessage, AkilioContactRequest, AkilioContactRequestCapability, AkilioContactRequestResponse, AkilioCustomerActionType } from '../types';
|
|
3
3
|
export declare function ContactActions({ message, capability, copy, onSubmit, }: {
|
|
4
4
|
message: AkilioChatMessage;
|
|
5
5
|
capability?: AkilioContactRequestCapability;
|
|
6
6
|
copy: AkilioResolvedCopy;
|
|
7
|
-
onSubmit?: (request: AkilioContactRequest) => Promise<AkilioContactRequestResponse>;
|
|
7
|
+
onSubmit?: (request: AkilioContactRequest, actionType: AkilioCustomerActionType) => Promise<AkilioContactRequestResponse>;
|
|
8
8
|
}): import("react").JSX.Element | null;
|
|
@@ -1,15 +1,11 @@
|
|
|
1
1
|
import type { AkilioResolvedCopy } from '../lib/copy';
|
|
2
|
-
|
|
3
|
-
declare function EmptyState({ copy, onSuggestion, widgetAvailable, showBranding, primaryColor, intentActions, onIntentAction, }: {
|
|
2
|
+
declare function EmptyState({ copy, onSuggestion, widgetAvailable, showBranding, primaryColor, starterQuestions, }: {
|
|
4
3
|
copy: AkilioResolvedCopy;
|
|
5
4
|
onSuggestion: (suggestion: string) => void;
|
|
6
5
|
widgetAvailable: boolean;
|
|
7
6
|
showBranding: boolean;
|
|
8
7
|
primaryColor?: string;
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
label: string;
|
|
12
|
-
}>;
|
|
13
|
-
onIntentAction: (intent: AkilioChatIntent, label: string) => void;
|
|
8
|
+
/** Resolved prompts from host configuration, public configuration, or locale defaults. */
|
|
9
|
+
starterQuestions?: string[];
|
|
14
10
|
}): import("react").JSX.Element;
|
|
15
11
|
export default EmptyState;
|
|
@@ -3,7 +3,10 @@ export declare function SparklesIcon(props: SVGProps<SVGSVGElement>): import("re
|
|
|
3
3
|
export declare function SendIcon(props: SVGProps<SVGSVGElement>): import("react").JSX.Element;
|
|
4
4
|
export declare function CloseIcon(props: SVGProps<SVGSVGElement>): import("react").JSX.Element;
|
|
5
5
|
export declare function TrashIcon(props: SVGProps<SVGSVGElement>): import("react").JSX.Element;
|
|
6
|
+
export declare function CartIcon(props: SVGProps<SVGSVGElement>): import("react").JSX.Element;
|
|
6
7
|
export declare function ThumbsUpIcon(props: SVGProps<SVGSVGElement>): import("react").JSX.Element;
|
|
7
8
|
export declare function ThumbsDownIcon(props: SVGProps<SVGSVGElement>): import("react").JSX.Element;
|
|
8
9
|
export declare function SunIcon(props: SVGProps<SVGSVGElement>): import("react").JSX.Element;
|
|
9
10
|
export declare function MoonIcon(props: SVGProps<SVGSVGElement>): import("react").JSX.Element;
|
|
11
|
+
export declare function MicrophoneIcon(props: SVGProps<SVGSVGElement>): import("react").JSX.Element;
|
|
12
|
+
export declare function StopIcon(props: SVGProps<SVGSVGElement>): import("react").JSX.Element;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { AkilioClient } from '../lib/client';
|
|
2
|
+
import type { AkilioResolvedCopy } from '../lib/copy';
|
|
3
|
+
import type { AkilioIdentityRequirement } from '../types';
|
|
4
|
+
export declare function IdentityVerification({ client, projectKey, subject, conversationId, copy, requirement, availableMethods, onVerified, onCancel, }: {
|
|
5
|
+
client: AkilioClient;
|
|
6
|
+
projectKey: string;
|
|
7
|
+
subject?: string;
|
|
8
|
+
conversationId: string;
|
|
9
|
+
copy: AkilioResolvedCopy;
|
|
10
|
+
requirement?: AkilioIdentityRequirement | null;
|
|
11
|
+
availableMethods?: string[];
|
|
12
|
+
onVerified: () => void;
|
|
13
|
+
onCancel: () => void;
|
|
14
|
+
}): import("react").JSX.Element | null;
|
|
@@ -1,8 +1,13 @@
|
|
|
1
|
-
export declare function Launcher({ label, onClick, showBranding, primaryColor, open, controlsId, }: {
|
|
1
|
+
export declare function Launcher({ label, onClick, showBranding, primaryColor, open, controlsId, experience, expanded, answerReady, typing, accessibleLabel, }: {
|
|
2
2
|
label: string;
|
|
3
3
|
onClick: () => void;
|
|
4
4
|
showBranding?: boolean;
|
|
5
5
|
primaryColor?: string;
|
|
6
6
|
open?: boolean;
|
|
7
7
|
controlsId?: string;
|
|
8
|
+
experience?: 'adaptive' | 'static';
|
|
9
|
+
expanded?: boolean;
|
|
10
|
+
answerReady?: boolean;
|
|
11
|
+
typing?: boolean;
|
|
12
|
+
accessibleLabel?: string;
|
|
8
13
|
}): import("react").JSX.Element;
|
|
@@ -1,16 +1,23 @@
|
|
|
1
1
|
import type { AkilioResolvedCopy } from '../lib/copy';
|
|
2
|
-
import type { AkilioChatMessage, AkilioContactRequest, AkilioContactRequestCapability, AkilioContactRequestResponse, AkilioFeedbackRating, AkilioProduct, AkilioProductVariant } from '../types';
|
|
2
|
+
import type { AkilioAgentTool, AkilioCart, AkilioChatMessage, AkilioCommercePublicAction, AkilioContactRequest, AkilioContactRequestCapability, AkilioContactRequestResponse, AkilioFeedbackRating, AkilioProactiveAction, AkilioProduct, AkilioProductVariant } from '../types';
|
|
3
3
|
interface MessageBubbleProps {
|
|
4
4
|
message: AkilioChatMessage;
|
|
5
5
|
copy: AkilioResolvedCopy;
|
|
6
6
|
locale: string;
|
|
7
7
|
onFeedback?: (message: AkilioChatMessage, rating: AkilioFeedbackRating) => void;
|
|
8
8
|
onSuggestion?: (suggestion: string) => void;
|
|
9
|
+
onProactiveAction?: (action: AkilioProactiveAction) => void;
|
|
9
10
|
onProductClick?: (message: AkilioChatMessage, product: AkilioProduct, variant?: AkilioProductVariant) => void;
|
|
11
|
+
onCommerceAction?: (message: AkilioChatMessage, action: AkilioCommercePublicAction) => Promise<void>;
|
|
12
|
+
cart?: AkilioCart | null;
|
|
13
|
+
showBranding?: boolean;
|
|
10
14
|
primaryColor?: string;
|
|
11
15
|
feedbackPending?: AkilioFeedbackRating;
|
|
12
16
|
contactRequestCapability?: AkilioContactRequestCapability;
|
|
13
|
-
onContactRequest?: (request: AkilioContactRequest) => Promise<AkilioContactRequestResponse>;
|
|
17
|
+
onContactRequest?: (request: AkilioContactRequest, actionType: import('../types').AkilioCustomerActionType) => Promise<AkilioContactRequestResponse>;
|
|
18
|
+
onConfirmExternalOperation?: (message: AkilioChatMessage, tool: AkilioAgentTool) => Promise<void>;
|
|
19
|
+
onConfirmHumanRequest?: (message: AkilioChatMessage, tool: AkilioAgentTool, request: AkilioContactRequest) => Promise<void>;
|
|
20
|
+
onClarificationSubmit?: (message: AkilioChatMessage, values: Record<string, string>, submission: string) => Promise<void>;
|
|
14
21
|
}
|
|
15
22
|
export declare const MessageBubble: import("react").NamedExoticComponent<MessageBubbleProps>;
|
|
16
23
|
export {};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { ChatPanelProps } from '../types';
|
|
2
|
-
declare const MessageList: import("react").NamedExoticComponent<Pick<ChatPanelProps, "primaryColor" | "copy" | "
|
|
2
|
+
declare const MessageList: import("react").NamedExoticComponent<Pick<ChatPanelProps, "primaryColor" | "copy" | "cart" | "locale" | "onSuggestion" | "showBranding" | "onProductClick" | "onCommerceAction" | "onFeedback" | "onProactiveAction" | "feedbackPending" | "contactRequestCapability" | "onContactRequest" | "onConfirmExternalOperation" | "onConfirmHumanRequest" | "onClarificationSubmit" | "messages">>;
|
|
3
3
|
export default MessageList;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { AkilioResolvedCopy } from '../lib/copy';
|
|
2
|
-
import { AkilioProduct,
|
|
2
|
+
import type { AkilioCommercePublicAction, AkilioProduct, AkilioProductVariant } from '../types';
|
|
3
3
|
export type ProductCardLayout = 'vertical' | 'horizontal';
|
|
4
4
|
export interface ProductCardProps {
|
|
5
5
|
product: AkilioProduct;
|
|
@@ -7,6 +7,8 @@ export interface ProductCardProps {
|
|
|
7
7
|
locale: string;
|
|
8
8
|
layout?: ProductCardLayout;
|
|
9
9
|
onProductClick?: (product: AkilioProduct, variant?: AkilioProductVariant) => void;
|
|
10
|
+
actions?: AkilioCommercePublicAction[];
|
|
11
|
+
onCommerceAction?: (action: AkilioCommercePublicAction) => Promise<void>;
|
|
10
12
|
}
|
|
11
|
-
declare function ProductCard({ product, copy, locale, layout, onProductClick, }: ProductCardProps): import("react").JSX.Element;
|
|
13
|
+
declare function ProductCard({ product, copy, locale, layout, onProductClick, actions, onCommerceAction, }: ProductCardProps): import("react").JSX.Element;
|
|
12
14
|
export default ProductCard;
|
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
import type { AkilioResolvedCopy } from '../lib/copy';
|
|
2
|
-
import type { AkilioCommerceCapability, AkilioProduct, AkilioProductVariant } from '../types';
|
|
2
|
+
import type { AkilioCart, AkilioCommerceCapability, AkilioCommercePublicAction, AkilioProduct, AkilioProductVariant } from '../types';
|
|
3
3
|
interface ProductCardsProps {
|
|
4
4
|
commerce: AkilioCommerceCapability;
|
|
5
5
|
copy: AkilioResolvedCopy;
|
|
6
6
|
locale: string;
|
|
7
|
+
products?: AkilioProduct[];
|
|
8
|
+
suggestedProducts?: AkilioProduct[];
|
|
9
|
+
heading?: string;
|
|
7
10
|
onProductClick?: (product: AkilioProduct, variant?: AkilioProductVariant) => void;
|
|
11
|
+
onCommerceAction?: (action: AkilioCommercePublicAction) => Promise<void>;
|
|
12
|
+
cart?: AkilioCart | null;
|
|
8
13
|
}
|
|
9
14
|
export declare const ProductCards: import("react").NamedExoticComponent<ProductCardsProps>;
|
|
10
15
|
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { AkilioResolvedCopy } from '../lib/copy';
|
|
2
|
+
import type { AkilioCommercePublicAction, AkilioProduct, AkilioProductVariant } from '../types';
|
|
3
|
+
interface ProductDetailProps {
|
|
4
|
+
product: AkilioProduct;
|
|
5
|
+
copy: AkilioResolvedCopy;
|
|
6
|
+
locale: string;
|
|
7
|
+
onProductClick?: (product: AkilioProduct, variant?: AkilioProductVariant) => void;
|
|
8
|
+
actions?: AkilioCommercePublicAction[];
|
|
9
|
+
onCommerceAction?: (action: AkilioCommercePublicAction) => Promise<void>;
|
|
10
|
+
}
|
|
11
|
+
export default function ProductDetail({ product, copy, locale, onProductClick, actions, onCommerceAction, }: ProductDetailProps): import("react").JSX.Element;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { AkilioResolvedCopy } from '../lib/copy';
|
|
2
|
+
import type { AkilioProductVariant } from '../types';
|
|
3
|
+
export declare function variantLabel(variant: AkilioProductVariant): string;
|
|
4
|
+
export default function ProductVariantSelector({ variants, selectedId, onSelect, copy, }: {
|
|
5
|
+
variants: AkilioProductVariant[];
|
|
6
|
+
selectedId?: string;
|
|
7
|
+
onSelect: (id: string) => void;
|
|
8
|
+
copy: AkilioResolvedCopy;
|
|
9
|
+
}): import("react").JSX.Element | null;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import type { AkilioResolvedCopy } from '../lib/copy';
|
|
3
|
+
interface VoiceRecorderProps {
|
|
4
|
+
children?: ReactNode;
|
|
5
|
+
disabled: boolean;
|
|
6
|
+
copy: AkilioResolvedCopy;
|
|
7
|
+
onSubmit: (audio: Blob, signal: AbortSignal) => Promise<void>;
|
|
8
|
+
onBusyChange?: (busy: boolean) => void;
|
|
9
|
+
}
|
|
10
|
+
export declare function VoiceRecorder({ children, disabled, copy, onSubmit, onBusyChange, }: VoiceRecorderProps): import("react").JSX.Element;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { AkilioClient } from '../lib/client';
|
|
2
|
+
import type { AkilioCart } from '../types';
|
|
3
|
+
/** Keep provider checkout state current without overlapping requests or stale identities. */
|
|
4
|
+
export declare function useCurrentCart({ client, projectKey, subject, enabled, open, }: {
|
|
5
|
+
client: Pick<AkilioClient, 'getCurrentCart'>;
|
|
6
|
+
projectKey: string;
|
|
7
|
+
subject?: string;
|
|
8
|
+
enabled: boolean;
|
|
9
|
+
open: boolean;
|
|
10
|
+
}): {
|
|
11
|
+
cart: AkilioCart | null;
|
|
12
|
+
loading: boolean;
|
|
13
|
+
refresh: () => Promise<void>;
|
|
14
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function useProactiveSummaryScore(enabled: boolean): number;
|
package/dist/hooks/storage.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import type { Dispatch, SetStateAction } from 'react';
|
|
2
2
|
import type { AkilioChatMessage } from '../types';
|
|
3
3
|
export declare const MAX_AKILIO_HISTORY_MESSAGES = 60;
|
|
4
|
+
export declare function readLocalValue(key: string): string | null;
|
|
5
|
+
export declare function writeLocalValue(key: string, value: string | null): void;
|
|
4
6
|
export declare function safeJsonParse<T>(raw: string | null, fallback: T): T;
|
|
5
7
|
export declare function useLocalMessages(options: {
|
|
6
8
|
enabled: boolean;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
-
export { AkilioWidget
|
|
1
|
+
export { AkilioWidget } from './AkilioWidget';
|
|
2
|
+
export { InlineDecisionCard } from './components/InlineDecisionCard';
|
|
3
|
+
export { SectionPrompt } from './components/SectionPrompt';
|
|
4
|
+
export { TextSelectionPrompt } from './components/TextSelectionPrompt';
|
|
2
5
|
export { AkilioClient } from './lib/client';
|
|
3
6
|
export type * from './types';
|
|
7
|
+
export { resolveLanguagePack } from './locales';
|