@eloquentai/chat-sdk 0.36.0-dev.1 → 0.36.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/components/chat/hooks/use-chat.d.ts +4 -0
- package/dist/components/chat/hooks/use-message-events.d.ts +3 -1
- package/dist/components/chat/hooks/use-new-message-sound.d.ts +17 -0
- package/dist/components/chat-interface/types.d.ts +3 -0
- package/dist/index.mjs +1540 -1419
- package/dist/index.mjs.map +1 -1
- package/dist/lib/eloquent-ai-api-client.d.ts +2 -0
- package/dist/lib/notification-sound.d.ts +6 -0
- package/dist/{skeleton-BGsnxX4m.js → skeleton-CNz9cQ6u.js} +1457 -1412
- package/dist/skeleton-CNz9cQ6u.js.map +1 -0
- package/dist/ui.mjs +1 -1
- package/package.json +1 -1
- package/dist/skeleton-BGsnxX4m.js.map +0 -1
|
@@ -52,6 +52,10 @@ export interface UseChatReturn {
|
|
|
52
52
|
isChatClosed: boolean;
|
|
53
53
|
onStartNewChat: () => void;
|
|
54
54
|
onRateChat: (rating: number) => Promise<void>;
|
|
55
|
+
/** Lets the browser play the new-message sound; call from a user gesture. */
|
|
56
|
+
unlockSound: () => void;
|
|
57
|
+
isSoundMuted: boolean;
|
|
58
|
+
toggleSound: () => void;
|
|
55
59
|
}
|
|
56
60
|
/**
|
|
57
61
|
* The primary chat hook, responsible for managing the chat state and operations.
|
|
@@ -20,6 +20,8 @@ export interface UseMessageEventsProps {
|
|
|
20
20
|
} | null>>;
|
|
21
21
|
onChatClosed?: () => void;
|
|
22
22
|
isChatClosed?: boolean;
|
|
23
|
+
/** Called for each agent or operator reply that is added to the conversation. */
|
|
24
|
+
onAgentMessage?: () => void;
|
|
23
25
|
}
|
|
24
26
|
export interface UseMessageEventsReturn {
|
|
25
27
|
onCleanMessages: () => void;
|
|
@@ -29,4 +31,4 @@ export interface UseMessageEventsReturn {
|
|
|
29
31
|
/**
|
|
30
32
|
* Hook to handle message events like sending and cleaning
|
|
31
33
|
*/
|
|
32
|
-
export declare function useMessageEvents({ appId, userId, userName, userData, externalId, deviceId, apiClient, chatSettings, messages, setMessages, currentChat, setCurrentChat, onChatClosed, isChatClosed, }: UseMessageEventsProps): UseMessageEventsReturn;
|
|
34
|
+
export declare function useMessageEvents({ appId, userId, userName, userData, externalId, deviceId, apiClient, chatSettings, messages, setMessages, currentChat, setCurrentChat, onChatClosed, isChatClosed, onAgentMessage, }: UseMessageEventsProps): UseMessageEventsReturn;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export interface UseNewMessageSoundReturn {
|
|
2
|
+
/** Call for an agent or operator message; plays only when the customer isn't looking at the chat. */
|
|
3
|
+
notify: () => void;
|
|
4
|
+
/** Call from a user gesture: browsers only allow sound once the visitor has interacted. */
|
|
5
|
+
unlock: () => void;
|
|
6
|
+
isMuted: boolean;
|
|
7
|
+
toggleMuted: () => void;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* A soft ceramic tap when a reply arrives while the customer isn't looking:
|
|
11
|
+
* the tab is hidden, the window isn't focused, or the widget is closed.
|
|
12
|
+
* `isEnabled` is the business's setting; the customer can also mute it.
|
|
13
|
+
*/
|
|
14
|
+
export declare function useNewMessageSound({ isEnabled, isOpen, }: {
|
|
15
|
+
isEnabled: boolean;
|
|
16
|
+
isOpen: boolean;
|
|
17
|
+
}): UseNewMessageSoundReturn;
|
|
@@ -58,6 +58,9 @@ export interface ChatInterfaceProps {
|
|
|
58
58
|
isChatClosed?: boolean;
|
|
59
59
|
onStartNewChat?: () => void;
|
|
60
60
|
onRateChat?: (rating: number) => void;
|
|
61
|
+
/** Whether the new-message sound is muted; with `onToggleSound`, the header shows a mute toggle. */
|
|
62
|
+
isSoundMuted?: boolean;
|
|
63
|
+
onToggleSound?: () => void;
|
|
61
64
|
}
|
|
62
65
|
export interface AttachmentChipsProps {
|
|
63
66
|
attachmentFiles: AttachmentFile[];
|