@webority/mobile-chat 0.133.0 → 0.134.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/lib/commonjs/AgentByline.js +1 -1
- package/lib/commonjs/ChatComposer.js +1 -1
- package/lib/commonjs/ChatConversationActions.js +1 -1
- package/lib/commonjs/ChatDictationButton.js +1 -1
- package/lib/commonjs/ChatEmbed.js +1 -1
- package/lib/commonjs/ChatFooter.js +1 -1
- package/lib/commonjs/ChatFrame.js +1 -1
- package/lib/commonjs/ChatHistory.js +1 -1
- package/lib/commonjs/ChatLiveBar.js +1 -1
- package/lib/commonjs/ChatMessageActions.js +1 -1
- package/lib/commonjs/ChatNudge.js +1 -1
- package/lib/commonjs/ChatOpenTickets.js +1 -1
- package/lib/commonjs/ChatPastChats.js +1 -0
- package/lib/commonjs/ChatScreen.js +1 -1
- package/lib/commonjs/ChatSheet.js +1 -1
- package/lib/commonjs/ChatStarters.js +1 -1
- package/lib/commonjs/ChatThread.js +1 -1
- package/lib/commonjs/ReadAloudButton.js +1 -1
- package/lib/commonjs/features.map.json +3 -3
- package/lib/commonjs/index.js +1 -1
- package/lib/commonjs/loaders/ChatLoader.js +1 -1
- package/lib/commonjs/renderers/ActionPart.js +1 -1
- package/lib/commonjs/renderers/ChartPart.js +1 -1
- package/lib/commonjs/renderers/FigureText.js +1 -1
- package/lib/commonjs/renderers/FiguresPart.js +1 -1
- package/lib/commonjs/renderers/FilePart.js +1 -1
- package/lib/commonjs/renderers/HandoffPart.js +1 -1
- package/lib/commonjs/renderers/ImagePart.js +1 -1
- package/lib/commonjs/renderers/InputRequestPart.js +1 -1
- package/lib/commonjs/renderers/NoticePart.js +1 -1
- package/lib/commonjs/renderers/QuickRepliesPart.js +1 -1
- package/lib/commonjs/renderers/RecordCardPart.js +1 -1
- package/lib/commonjs/renderers/SourcesPart.js +1 -1
- package/lib/commonjs/renderers/TablePart.js +1 -1
- package/lib/commonjs/renderers/TicketPart.js +1 -1
- package/lib/commonjs/renderers/VoiceClipPart.js +1 -1
- package/lib/commonjs/speech/phoneSpeech.js +1 -1
- package/lib/commonjs/speech/speechText.js +1 -1
- package/lib/commonjs/useChat.js +1 -1
- package/lib/commonjs/useChatHaptics.js +1 -1
- package/lib/commonjs/useChatSound.js +1 -0
- package/lib/module/AgentByline.js +1 -1
- package/lib/module/ChatComposer.js +1 -1
- package/lib/module/ChatConversationActions.js +1 -1
- package/lib/module/ChatDictationButton.js +1 -1
- package/lib/module/ChatEmbed.js +1 -1
- package/lib/module/ChatFooter.js +1 -1
- package/lib/module/ChatFrame.js +1 -1
- package/lib/module/ChatHistory.js +1 -1
- package/lib/module/ChatLiveBar.js +1 -1
- package/lib/module/ChatMessageActions.js +1 -1
- package/lib/module/ChatNudge.js +1 -1
- package/lib/module/ChatOpenTickets.js +1 -1
- package/lib/module/ChatPastChats.js +1 -0
- package/lib/module/ChatScreen.js +1 -1
- package/lib/module/ChatSheet.js +1 -1
- package/lib/module/ChatStarters.js +1 -1
- package/lib/module/ChatThread.js +1 -1
- package/lib/module/ReadAloudButton.js +1 -1
- package/lib/module/features.map.json +3 -3
- package/lib/module/index.js +1 -1
- package/lib/module/loaders/ChatLoader.js +1 -1
- package/lib/module/renderers/ActionPart.js +1 -1
- package/lib/module/renderers/ChartPart.js +1 -1
- package/lib/module/renderers/FigureText.js +1 -1
- package/lib/module/renderers/FiguresPart.js +1 -1
- package/lib/module/renderers/FilePart.js +1 -1
- package/lib/module/renderers/HandoffPart.js +1 -1
- package/lib/module/renderers/ImagePart.js +1 -1
- package/lib/module/renderers/InputRequestPart.js +1 -1
- package/lib/module/renderers/NoticePart.js +1 -1
- package/lib/module/renderers/QuickRepliesPart.js +1 -1
- package/lib/module/renderers/RecordCardPart.js +1 -1
- package/lib/module/renderers/SourcesPart.js +1 -1
- package/lib/module/renderers/TablePart.js +1 -1
- package/lib/module/renderers/TicketPart.js +1 -1
- package/lib/module/renderers/VoiceClipPart.js +1 -1
- package/lib/module/speech/phoneSpeech.js +1 -1
- package/lib/module/speech/speechText.js +1 -1
- package/lib/module/useChat.js +1 -1
- package/lib/module/useChatHaptics.js +1 -1
- package/lib/module/useChatSound.js +1 -0
- package/lib/typescript/commonjs/ChatComposer.d.ts +2 -1
- package/lib/typescript/commonjs/ChatConversationActions.d.ts +1 -1
- package/lib/typescript/commonjs/ChatDictationButton.d.ts +3 -1
- package/lib/typescript/commonjs/ChatEmbed.d.ts +1 -1
- package/lib/typescript/commonjs/ChatFrame.d.ts +7 -1
- package/lib/typescript/commonjs/ChatPastChats.d.ts +21 -0
- package/lib/typescript/commonjs/ChatScreen.d.ts +1 -1
- package/lib/typescript/commonjs/ChatSheet.d.ts +1 -1
- package/lib/typescript/commonjs/ChatThread.d.ts +3 -1
- package/lib/typescript/commonjs/index.d.ts +1 -0
- package/lib/typescript/commonjs/renderers/ChartPart.d.ts +1 -1
- package/lib/typescript/commonjs/renderers/FigureText.d.ts +4 -2
- package/lib/typescript/commonjs/renderers/HandoffPart.d.ts +1 -1
- package/lib/typescript/commonjs/renderers/VoiceClipPart.d.ts +1 -1
- package/lib/typescript/commonjs/speech/speechText.d.ts +3 -3
- package/lib/typescript/commonjs/types.d.ts +9 -1
- package/lib/typescript/commonjs/useChat.d.ts +2 -0
- package/lib/typescript/commonjs/useChatSound.d.ts +35 -0
- package/lib/typescript/module/ChatComposer.d.ts +2 -1
- package/lib/typescript/module/ChatConversationActions.d.ts +1 -1
- package/lib/typescript/module/ChatDictationButton.d.ts +3 -1
- package/lib/typescript/module/ChatEmbed.d.ts +1 -1
- package/lib/typescript/module/ChatFrame.d.ts +7 -1
- package/lib/typescript/module/ChatPastChats.d.ts +21 -0
- package/lib/typescript/module/ChatScreen.d.ts +1 -1
- package/lib/typescript/module/ChatSheet.d.ts +1 -1
- package/lib/typescript/module/ChatThread.d.ts +3 -1
- package/lib/typescript/module/index.d.ts +1 -0
- package/lib/typescript/module/renderers/ChartPart.d.ts +1 -1
- package/lib/typescript/module/renderers/FigureText.d.ts +4 -2
- package/lib/typescript/module/renderers/HandoffPart.d.ts +1 -1
- package/lib/typescript/module/renderers/VoiceClipPart.d.ts +1 -1
- package/lib/typescript/module/speech/speechText.d.ts +3 -3
- package/lib/typescript/module/types.d.ts +9 -1
- package/lib/typescript/module/useChat.d.ts +2 -0
- package/lib/typescript/module/useChatSound.d.ts +35 -0
- package/package.json +10 -9
|
@@ -9,6 +9,7 @@ export interface ChatComposerProps {
|
|
|
9
9
|
keyboardAware?: boolean;
|
|
10
10
|
safeArea?: boolean;
|
|
11
11
|
testID?: string;
|
|
12
|
+
focusRef?: React.MutableRefObject<(() => void) | null>;
|
|
12
13
|
}
|
|
13
|
-
export declare function ChatComposer({ chat, labels, pickAttachments, keyboardOffset, keyboardAware, safeArea, testID, }: ChatComposerProps): React.ReactElement;
|
|
14
|
+
export declare function ChatComposer({ chat, labels, pickAttachments, keyboardOffset, keyboardAware, safeArea, testID, focusRef, }: ChatComposerProps): React.ReactElement;
|
|
14
15
|
//# sourceMappingURL=ChatComposer.d.ts.map
|
|
@@ -4,6 +4,7 @@ import type { UseChatResult } from "./useChat.js";
|
|
|
4
4
|
export interface DictationNotice {
|
|
5
5
|
message: string;
|
|
6
6
|
openSettings: boolean;
|
|
7
|
+
tone: "danger" | "info";
|
|
7
8
|
}
|
|
8
9
|
export interface ChatDictationButtonProps {
|
|
9
10
|
chat: UseChatResult;
|
|
@@ -12,6 +13,7 @@ export interface ChatDictationButtonProps {
|
|
|
12
13
|
onText: (text: string) => void;
|
|
13
14
|
onNotice: (notice: DictationNotice | null) => void;
|
|
14
15
|
testID?: string;
|
|
16
|
+
stopRef?: React.MutableRefObject<(() => void) | null>;
|
|
15
17
|
}
|
|
16
|
-
export declare function ChatDictationButton({ chat, labels, disabled, onText, onNotice, testID, }: ChatDictationButtonProps): React.ReactElement | null;
|
|
18
|
+
export declare function ChatDictationButton({ chat, labels, disabled, onText, onNotice, testID, stopRef, }: ChatDictationButtonProps): React.ReactElement | null;
|
|
17
19
|
//# sourceMappingURL=ChatDictationButton.d.ts.map
|
|
@@ -7,5 +7,5 @@ export interface ChatEmbedProps extends ChatShellProps {
|
|
|
7
7
|
height?: number;
|
|
8
8
|
}
|
|
9
9
|
/** The chat drawn inside a bounded area of a screen, with a border and rounded corners. */
|
|
10
|
-
export declare function ChatEmbed({ chat, labels, renderers, layoutParts, loader, motion, pickAttachments, onOpenAttachment, onOpenTarget, onNavigate, openTicket, handoffHosts, keyboardOffset, title, headerActions, height, testID, }: ChatEmbedProps): React.ReactElement | null;
|
|
10
|
+
export declare function ChatEmbed({ chat, labels, renderers, layoutParts, loader, motion, pickAttachments, onOpenAttachment, onOpenTarget, onNavigate, openTicket, handoffHosts, resolveLink, keyboardOffset, title, headerActions, onClose, height, testID, }: ChatEmbedProps): React.ReactElement | null;
|
|
11
11
|
//# sourceMappingURL=ChatEmbed.d.ts.map
|
|
@@ -21,6 +21,8 @@ export interface ChatCommonProps {
|
|
|
21
21
|
openTicket?: ChatOpenTicketHandler;
|
|
22
22
|
/** Hosts an absolute https link or Navigate chip may open; any other absolute target is not linked. */
|
|
23
23
|
handoffHosts?: readonly string[];
|
|
24
|
+
/** Resolves a link in a reply to a host route or address; null leaves the link as text. */
|
|
25
|
+
resolveLink?: (href: string) => string | null;
|
|
24
26
|
keyboardOffset?: number;
|
|
25
27
|
testID?: string;
|
|
26
28
|
}
|
|
@@ -28,12 +30,16 @@ export interface ChatFrameProps extends ChatCommonProps {
|
|
|
28
30
|
layout: ChatLayout;
|
|
29
31
|
title?: string;
|
|
30
32
|
headerActions?: React.ReactNode;
|
|
33
|
+
/** The host sheet closes through this callback. */
|
|
34
|
+
onClose?: () => void;
|
|
31
35
|
}
|
|
32
36
|
/** The props of the three shells: the frame's, with labels as a partial merged over the defaults. */
|
|
33
37
|
export interface ChatShellProps extends Omit<ChatCommonProps, "labels"> {
|
|
34
38
|
labels?: Partial<ChatLabels>;
|
|
35
39
|
title?: string;
|
|
36
40
|
headerActions?: React.ReactNode;
|
|
41
|
+
/** The host sheet closes through this callback. */
|
|
42
|
+
onClose?: () => void;
|
|
37
43
|
}
|
|
38
|
-
export declare function ChatFrame({ chat, labels, renderers, layoutParts, loader, motion, pickAttachments, onOpenAttachment, onOpenTarget, onNavigate, openTicket, handoffHosts, keyboardOffset, layout, title, headerActions, testID, }: ChatFrameProps): React.ReactElement | null;
|
|
44
|
+
export declare function ChatFrame({ chat, labels, renderers, layoutParts, loader, motion, pickAttachments, onOpenAttachment, onOpenTarget, onNavigate, openTicket, handoffHosts, resolveLink, keyboardOffset, layout, title, headerActions, onClose, testID, }: ChatFrameProps): React.ReactElement | null;
|
|
39
45
|
//# sourceMappingURL=ChatFrame.d.ts.map
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { ChatConversationSummary, ChatLabels } from "@webority/chat-core";
|
|
2
|
+
import { type ConversationList } from "@webority/chat-core";
|
|
3
|
+
import type React from "react";
|
|
4
|
+
import type { UseChatResult } from "./useChat.js";
|
|
5
|
+
export interface ChatPastChatsProps {
|
|
6
|
+
chat: UseChatResult;
|
|
7
|
+
labels: ChatLabels;
|
|
8
|
+
testID?: string;
|
|
9
|
+
}
|
|
10
|
+
export interface ConversationRowProps {
|
|
11
|
+
conversation: ChatConversationSummary;
|
|
12
|
+
list: ConversationList | null;
|
|
13
|
+
chat: UseChatResult;
|
|
14
|
+
labels: ChatLabels;
|
|
15
|
+
testID: string;
|
|
16
|
+
onOpen: (conversation: ChatConversationSummary) => void;
|
|
17
|
+
untitledTitle?: string;
|
|
18
|
+
}
|
|
19
|
+
export declare function ChatPastChats({ chat, labels, testID }: ChatPastChatsProps): React.ReactElement | null;
|
|
20
|
+
export declare function ConversationRow({ conversation, list, chat, labels, testID, onOpen, untitledTitle, }: ConversationRowProps): React.ReactElement;
|
|
21
|
+
//# sourceMappingURL=ChatPastChats.d.ts.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type React from "react";
|
|
2
2
|
import { type ChatShellProps } from "./ChatFrame.js";
|
|
3
3
|
/** The whole chat for one screen of the app's navigator. Keep `useChat` above the navigator so the conversation survives leaving the screen. */
|
|
4
|
-
export declare function ChatScreen({ chat, labels, renderers, layoutParts, loader, motion, pickAttachments, onOpenAttachment, onOpenTarget, onNavigate, openTicket, handoffHosts, keyboardOffset, title, headerActions, testID, }: ChatShellProps): React.ReactElement | null;
|
|
4
|
+
export declare function ChatScreen({ chat, labels, renderers, layoutParts, loader, motion, pickAttachments, onOpenAttachment, onOpenTarget, onNavigate, openTicket, handoffHosts, resolveLink, keyboardOffset, title, headerActions, onClose, testID, }: ChatShellProps): React.ReactElement | null;
|
|
5
5
|
//# sourceMappingURL=ChatScreen.d.ts.map
|
|
@@ -17,5 +17,5 @@ export interface ChatSheetProps extends ChatShellProps {
|
|
|
17
17
|
conversationId?: string | null;
|
|
18
18
|
}
|
|
19
19
|
/** The chat in a bottom sheet over the screen, opened from a floating launcher. */
|
|
20
|
-
export declare function ChatSheet({ chat, labels, renderers, layoutParts, loader, motion, pickAttachments, onOpenAttachment, onOpenTarget, onNavigate, keyboardOffset, open, defaultOpen, onOpenChange, position, bottomOffset, snapPoints, compact, openTicket, handoffHosts, conversationId, testID, }: ChatSheetProps): React.ReactElement | null;
|
|
20
|
+
export declare function ChatSheet({ chat, labels, renderers, layoutParts, loader, motion, pickAttachments, onOpenAttachment, onOpenTarget, onNavigate, keyboardOffset, open, defaultOpen, onOpenChange, position, bottomOffset, snapPoints, compact, openTicket, handoffHosts, resolveLink, conversationId, onClose, testID, }: ChatSheetProps): React.ReactElement | null;
|
|
21
21
|
//# sourceMappingURL=ChatSheet.d.ts.map
|
|
@@ -18,6 +18,8 @@ export interface ChatThreadProps {
|
|
|
18
18
|
onNavigate?: (path: string) => void;
|
|
19
19
|
openTicket?: ChatOpenTicketHandler;
|
|
20
20
|
handoffHosts?: readonly string[];
|
|
21
|
+
resolveLink?: (href: string) => string | null;
|
|
22
|
+
focusComposer?: () => void;
|
|
21
23
|
keyboardAware?: boolean;
|
|
22
24
|
keyboardOffset?: number;
|
|
23
25
|
/** Drawn before the first message. */
|
|
@@ -30,5 +32,5 @@ export interface ChatThreadProps {
|
|
|
30
32
|
* pill while a paced reply is held, the loader while a reply is awaited and the error row after a
|
|
31
33
|
* failed or stopped turn.
|
|
32
34
|
*/
|
|
33
|
-
export declare function ChatThread({ chat, labels, renderers, layoutParts, loader, motion, pickAttachments, onOpenAttachment, onOpenTarget, onNavigate, openTicket, handoffHosts, keyboardAware, keyboardOffset, empty, style, testID, }: ChatThreadProps): React.ReactElement;
|
|
35
|
+
export declare function ChatThread({ chat, labels, renderers, layoutParts, loader, motion, pickAttachments, onOpenAttachment, onOpenTarget, onNavigate, openTicket, handoffHosts, resolveLink, focusComposer, keyboardAware, keyboardOffset, empty, style, testID, }: ChatThreadProps): React.ReactElement;
|
|
34
36
|
//# sourceMappingURL=ChatThread.d.ts.map
|
|
@@ -10,6 +10,7 @@ export { ChatLiveBar } from "./ChatLiveBar.js";
|
|
|
10
10
|
export { ChatMessageActions } from "./ChatMessageActions.js";
|
|
11
11
|
export { ChatNudge } from "./ChatNudge.js";
|
|
12
12
|
export { ChatOpenTickets } from "./ChatOpenTickets.js";
|
|
13
|
+
export { ChatPastChats } from "./ChatPastChats.js";
|
|
13
14
|
export { ChatScreen } from "./ChatScreen.js";
|
|
14
15
|
export type { ChatSheetProps } from "./ChatSheet.js";
|
|
15
16
|
export { ChatSheet } from "./ChatSheet.js";
|
|
@@ -3,6 +3,6 @@ import type { ChatPartRendererProps } from "../types.js";
|
|
|
3
3
|
type ChartPartProps = ChatPartRendererProps<Extract<ChatPart, {
|
|
4
4
|
kind: "Chart";
|
|
5
5
|
}>>;
|
|
6
|
-
export declare function ChartPart({ part, turn }: Pick<ChartPartProps, "part" | "turn">): import("react").JSX.Element
|
|
6
|
+
export declare function ChartPart({ part, turn }: Pick<ChartPartProps, "part" | "turn">): import("react").JSX.Element;
|
|
7
7
|
export {};
|
|
8
8
|
//# sourceMappingURL=ChartPart.d.ts.map
|
|
@@ -10,12 +10,14 @@ export interface FigureRunsProps {
|
|
|
10
10
|
numberOfLines?: number;
|
|
11
11
|
accessibilityLabel?: string;
|
|
12
12
|
testID?: string;
|
|
13
|
+
heading?: boolean;
|
|
13
14
|
}
|
|
14
15
|
export interface FigureTextProps extends Omit<FigureRunsProps, "runs"> {
|
|
15
16
|
text: string;
|
|
17
|
+
enabled?: boolean;
|
|
16
18
|
}
|
|
17
19
|
export declare function runsToText(runs: readonly ChatFigureRun[]): string;
|
|
18
|
-
export declare function FigureRuns({ runs, variant, color, strong, numberOfLines, accessibilityLabel, testID, }: FigureRunsProps): import("react").JSX.Element;
|
|
19
|
-
export declare function FigureText({ text, variant, ...rest }: FigureTextProps): import("react").JSX.Element;
|
|
20
|
+
export declare function FigureRuns({ runs, variant, color, strong, numberOfLines, accessibilityLabel, testID, heading, }: FigureRunsProps): import("react").JSX.Element;
|
|
21
|
+
export declare function FigureText({ text, variant, enabled, ...rest }: FigureTextProps): import("react").JSX.Element;
|
|
20
22
|
export {};
|
|
21
23
|
//# sourceMappingURL=FigureText.d.ts.map
|
|
@@ -4,6 +4,6 @@ import type { ChatPartRendererProps } from "../types.js";
|
|
|
4
4
|
type HandoffView = Extract<ChatPart, {
|
|
5
5
|
kind: "Handoff";
|
|
6
6
|
}>;
|
|
7
|
-
export declare function HandoffPart({ part, turn }: ChatPartRendererProps<HandoffView>): React.ReactElement;
|
|
7
|
+
export declare function HandoffPart({ part, turn }: ChatPartRendererProps<HandoffView>): React.ReactElement | null;
|
|
8
8
|
export {};
|
|
9
9
|
//# sourceMappingURL=HandoffPart.d.ts.map
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
export declare const DEFAULT_SPEECH_LANGUAGE = "en-IN";
|
|
2
2
|
export declare const DEFAULT_SPEECH_VOICE = "en-IN-NeerjaNeural";
|
|
3
|
-
export declare const MAX_SPEAK_CHARS =
|
|
4
|
-
export declare const MAX_DICTATION_MS =
|
|
3
|
+
export declare const MAX_SPEAK_CHARS = 6000;
|
|
4
|
+
export declare const MAX_DICTATION_MS = 300000;
|
|
5
5
|
export declare const MIN_DICTATION_MS = 600;
|
|
6
6
|
/** The file extension a recording's bytes stand for. m4a is the fallback, the format the phone records. */
|
|
7
7
|
export declare function audioExtension(bytes: Uint8Array): string;
|
|
8
8
|
export declare function escapeSsml(text: string): string;
|
|
9
9
|
export declare function buildSsml(text: string, language: string, voice: string): string;
|
|
10
|
-
/** Cuts at the last sentence end
|
|
10
|
+
/** Cuts at the last sentence end within the limit, so a long reply is read whole sentences at a time. */
|
|
11
11
|
export declare function clampSpeakText(text: string): string;
|
|
12
12
|
/** Whole seconds as m:ss. A negative or non-finite value reads as 0:00. */
|
|
13
13
|
export declare function formatClipTime(ms: number): string;
|
|
@@ -1,10 +1,18 @@
|
|
|
1
1
|
import type { ChatLiveMessage, ChatPart, ChatPartKind, ChatTurnApi, ChatUploadFile } from "@webority/chat-core";
|
|
2
2
|
import type React from "react";
|
|
3
|
+
import type { View } from "react-native";
|
|
3
4
|
export type { ChatMotion } from "@webority/chat-core";
|
|
5
|
+
/** Host values the thread adds to each part's turn: the host's link resolver and the source rows a citation focuses. */
|
|
6
|
+
export interface ChatTurnHostApi {
|
|
7
|
+
resolveLink?: (href: string) => string | null;
|
|
8
|
+
registerSourceRow?: (marker: string, row: View | null) => void;
|
|
9
|
+
/** Moves focus to the composer input after a quick reply is chosen. */
|
|
10
|
+
focusComposer?: () => void;
|
|
11
|
+
}
|
|
4
12
|
export type ChatPartRendererProps<P extends ChatPart = ChatPart> = {
|
|
5
13
|
part: P;
|
|
6
14
|
message: ChatLiveMessage;
|
|
7
|
-
turn: ChatTurnApi;
|
|
15
|
+
turn: ChatTurnApi & ChatTurnHostApi;
|
|
8
16
|
pickAttachments?: () => Promise<ChatUploadFile[]>;
|
|
9
17
|
};
|
|
10
18
|
export type ChatRenderers = Partial<{
|
|
@@ -33,6 +33,8 @@ export interface UseChatResult extends ChatSessionState, ChatActions {
|
|
|
33
33
|
emit: (name: string, data: Record<string, unknown>) => void;
|
|
34
34
|
/** The host reports whether the chat is on screen; the live stream runs only while it is and the app is active. */
|
|
35
35
|
setChatVisible: (visible: boolean) => void;
|
|
36
|
+
/** The message of the last hand-off request that failed, cleared by the next request. */
|
|
37
|
+
handoffError: string | null;
|
|
36
38
|
/** Present only when the host passed `onNavigate`; the turn API of each message hands relative links to it. */
|
|
37
39
|
onNavigate?: (path: string) => void;
|
|
38
40
|
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { UseChatResult } from "./useChat.js";
|
|
2
|
+
/**
|
|
3
|
+
* Plays the open cue when the panel opens, and the sent and reply cues for each new message, as the web chat does
|
|
4
|
+
* (chat-elements/src/WuiChat.js _playSounds). A send, an edit and a retry each add a new visitor message; an assistant,
|
|
5
|
+
* script or agent message plays the reply cue. Restored messages, notices and a history load stay silent, and the
|
|
6
|
+
* visitor message the server's copy replaces after a turn is stored, so it does not play the sent cue again.
|
|
7
|
+
* The phone has no WebAudio, so each cue is a short 16-bit WAV written once to the cache and played from there.
|
|
8
|
+
*/
|
|
9
|
+
export declare const CUES: {
|
|
10
|
+
readonly open: {
|
|
11
|
+
readonly from: 420;
|
|
12
|
+
readonly to: 920;
|
|
13
|
+
readonly seconds: 0.16;
|
|
14
|
+
readonly peak: 0.16;
|
|
15
|
+
};
|
|
16
|
+
readonly reply: {
|
|
17
|
+
readonly from: 680;
|
|
18
|
+
readonly to: 540;
|
|
19
|
+
readonly seconds: 0.11;
|
|
20
|
+
readonly peak: 0.06;
|
|
21
|
+
};
|
|
22
|
+
readonly sent: {
|
|
23
|
+
readonly from: 540;
|
|
24
|
+
readonly to: 760;
|
|
25
|
+
readonly seconds: 0.09;
|
|
26
|
+
readonly peak: 0.05;
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* Plays one cue at the given volume (0 to 1). The file is written on the first play and reused after that.
|
|
31
|
+
* A failure is logged, never thrown, so a missing sound never breaks the chat.
|
|
32
|
+
*/
|
|
33
|
+
export declare function playCue(name: keyof typeof CUES, volume?: number): void;
|
|
34
|
+
export declare function useChatSound(chat: UseChatResult): void;
|
|
35
|
+
//# sourceMappingURL=useChatSound.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webority/mobile-chat",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.134.0",
|
|
4
4
|
"description": "Webority Chat for React Native apps: the chat screen, sheet and embedded shells, thread, composer, one renderer per message part kind and the useChat hook, built on @webority/chat-core and @webority/mobile-ui.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react-native",
|
|
@@ -42,9 +42,10 @@
|
|
|
42
42
|
"!**/*.map"
|
|
43
43
|
],
|
|
44
44
|
"peerDependencies": {
|
|
45
|
-
"@webority/chat-core": "0.
|
|
46
|
-
"@webority/
|
|
47
|
-
"@webority/mobile-
|
|
45
|
+
"@webority/chat-core": "0.134.0",
|
|
46
|
+
"@webority/markdown-core": "^0.130.3",
|
|
47
|
+
"@webority/mobile-core": "^0.130.3",
|
|
48
|
+
"@webority/mobile-ui": "^0.130.3",
|
|
48
49
|
"expo-audio": ">=57.0.0",
|
|
49
50
|
"expo-file-system": ">=57.0.0",
|
|
50
51
|
"react": "^19.1.0",
|
|
@@ -96,11 +97,11 @@
|
|
|
96
97
|
"@react-native/metro-config": "0.86.3",
|
|
97
98
|
"@testing-library/react-native": "12.9.0",
|
|
98
99
|
"@types/react": "19.2.18",
|
|
99
|
-
"@webority/canvas-kit": "0.130.
|
|
100
|
-
"@webority/chat-core": "0.
|
|
101
|
-
"@webority/markdown-core": "0.130.
|
|
102
|
-
"@webority/mobile-core": "0.130.
|
|
103
|
-
"@webority/mobile-ui": "0.130.
|
|
100
|
+
"@webority/canvas-kit": "0.130.3",
|
|
101
|
+
"@webority/chat-core": "0.134.0",
|
|
102
|
+
"@webority/markdown-core": "0.130.3",
|
|
103
|
+
"@webority/mobile-core": "0.130.3",
|
|
104
|
+
"@webority/mobile-ui": "0.130.3",
|
|
104
105
|
"babel-jest": "29.7.0",
|
|
105
106
|
"expo": "57.0.31",
|
|
106
107
|
"expo-application": "57.0.3",
|