@webority/mobile-chat 0.128.0 → 0.133.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 -0
- package/lib/commonjs/ChatComposer.js +1 -0
- package/lib/commonjs/ChatConversationActions.js +1 -0
- package/lib/commonjs/ChatDictationButton.js +1 -0
- package/lib/commonjs/ChatEmbed.js +1 -0
- package/lib/commonjs/ChatEntrance.js +1 -0
- package/lib/commonjs/ChatFooter.js +1 -0
- package/lib/commonjs/ChatFrame.js +1 -0
- package/lib/commonjs/ChatHistory.js +1 -0
- package/lib/commonjs/ChatLiveBar.js +1 -0
- package/lib/commonjs/ChatMessageActions.js +1 -0
- package/lib/commonjs/ChatNudge.js +1 -0
- package/lib/commonjs/ChatOpenTickets.js +1 -0
- package/lib/commonjs/ChatScreen.js +1 -0
- package/lib/commonjs/ChatSheet.js +1 -0
- package/lib/commonjs/ChatStarters.js +1 -0
- package/lib/commonjs/ChatThread.js +1 -0
- package/lib/commonjs/ReadAloudButton.js +1 -0
- package/lib/commonjs/chatShared.js +1 -0
- package/lib/commonjs/features.map.json +40 -0
- package/lib/commonjs/index.js +1 -1
- package/lib/commonjs/loaders/ChatLoader.js +1 -0
- package/lib/commonjs/loaders/OrbLoader.js +1 -0
- package/lib/commonjs/loaders/PhrasesLoader.js +1 -0
- package/lib/commonjs/loaders/SkeletonLoader.js +1 -0
- package/lib/commonjs/loaders/StepsLoader.js +1 -0
- package/lib/commonjs/loaders/TypingPill.js +1 -0
- package/lib/commonjs/pushOpen.js +1 -0
- package/lib/commonjs/renderers/ActionPart.js +1 -0
- package/lib/commonjs/renderers/ChartPart.js +1 -0
- package/lib/commonjs/renderers/FigureText.js +1 -0
- package/lib/commonjs/renderers/FiguresPart.js +1 -0
- package/lib/commonjs/renderers/FilePart.js +1 -0
- package/lib/commonjs/renderers/HandoffPart.js +1 -0
- package/lib/commonjs/renderers/ImagePart.js +1 -0
- package/lib/commonjs/renderers/InputRequestPart.js +1 -0
- package/lib/commonjs/renderers/NoticePart.js +1 -0
- package/lib/commonjs/renderers/QuickRepliesPart.js +1 -0
- package/lib/commonjs/renderers/RecordCardPart.js +1 -0
- package/lib/commonjs/renderers/SourcesPart.js +1 -0
- package/lib/commonjs/renderers/TablePart.js +1 -0
- package/lib/commonjs/renderers/TextPart.js +1 -0
- package/lib/commonjs/renderers/TicketPart.js +1 -0
- package/lib/commonjs/renderers/VoiceClipPart.js +1 -0
- package/lib/commonjs/renderers/index.js +1 -0
- package/lib/commonjs/speech/azureSpeech.js +1 -0
- package/lib/commonjs/speech/expoAudio.js +1 -0
- package/lib/commonjs/speech/phoneSpeech.js +1 -0
- package/lib/commonjs/speech/speechText.js +1 -0
- package/lib/commonjs/types.js +1 -0
- package/lib/commonjs/useChat.js +1 -1
- package/lib/commonjs/useChatHaptics.js +1 -0
- package/lib/commonjs/useChatSpeech.js +1 -0
- package/lib/commonjs/useTranscriptActions.js +1 -0
- package/lib/module/AgentByline.js +1 -0
- package/lib/module/ChatComposer.js +1 -0
- package/lib/module/ChatConversationActions.js +1 -0
- package/lib/module/ChatDictationButton.js +1 -0
- package/lib/module/ChatEmbed.js +1 -0
- package/lib/module/ChatEntrance.js +1 -0
- package/lib/module/ChatFooter.js +1 -0
- package/lib/module/ChatFrame.js +1 -0
- package/lib/module/ChatHistory.js +1 -0
- package/lib/module/ChatLiveBar.js +1 -0
- package/lib/module/ChatMessageActions.js +1 -0
- package/lib/module/ChatNudge.js +1 -0
- package/lib/module/ChatOpenTickets.js +1 -0
- package/lib/module/ChatScreen.js +1 -0
- package/lib/module/ChatSheet.js +1 -0
- package/lib/module/ChatStarters.js +1 -0
- package/lib/module/ChatThread.js +1 -0
- package/lib/module/ReadAloudButton.js +1 -0
- package/lib/module/chatShared.js +1 -0
- package/lib/module/features.map.json +40 -0
- package/lib/module/index.js +1 -1
- package/lib/module/loaders/ChatLoader.js +1 -0
- package/lib/module/loaders/OrbLoader.js +1 -0
- package/lib/module/loaders/PhrasesLoader.js +1 -0
- package/lib/module/loaders/SkeletonLoader.js +1 -0
- package/lib/module/loaders/StepsLoader.js +1 -0
- package/lib/module/loaders/TypingPill.js +1 -0
- package/lib/module/pushOpen.js +1 -0
- package/lib/module/renderers/ActionPart.js +1 -0
- package/lib/module/renderers/ChartPart.js +1 -0
- package/lib/module/renderers/FigureText.js +1 -0
- package/lib/module/renderers/FiguresPart.js +1 -0
- package/lib/module/renderers/FilePart.js +1 -0
- package/lib/module/renderers/HandoffPart.js +1 -0
- package/lib/module/renderers/ImagePart.js +1 -0
- package/lib/module/renderers/InputRequestPart.js +1 -0
- package/lib/module/renderers/NoticePart.js +1 -0
- package/lib/module/renderers/QuickRepliesPart.js +1 -0
- package/lib/module/renderers/RecordCardPart.js +1 -0
- package/lib/module/renderers/SourcesPart.js +1 -0
- package/lib/module/renderers/TablePart.js +1 -0
- package/lib/module/renderers/TextPart.js +1 -0
- package/lib/module/renderers/TicketPart.js +1 -0
- package/lib/module/renderers/VoiceClipPart.js +1 -0
- package/lib/module/renderers/index.js +1 -0
- package/lib/module/speech/azureSpeech.js +1 -0
- package/lib/module/speech/expoAudio.js +1 -0
- package/lib/module/speech/phoneSpeech.js +1 -0
- package/lib/module/speech/speechText.js +1 -0
- package/lib/module/types.js +1 -0
- package/lib/module/useChat.js +1 -1
- package/lib/module/useChatHaptics.js +1 -0
- package/lib/module/useChatSpeech.js +1 -0
- package/lib/module/useTranscriptActions.js +1 -0
- package/lib/typescript/commonjs/AgentByline.d.ts +9 -0
- package/lib/typescript/commonjs/ChatComposer.d.ts +14 -0
- package/lib/typescript/commonjs/ChatConversationActions.d.ts +10 -0
- package/lib/typescript/commonjs/ChatDictationButton.d.ts +17 -0
- package/lib/typescript/commonjs/ChatEmbed.d.ts +11 -0
- package/lib/typescript/commonjs/ChatEntrance.d.ts +8 -0
- package/lib/typescript/commonjs/ChatFooter.d.ts +9 -0
- package/lib/typescript/commonjs/ChatFrame.d.ts +39 -0
- package/lib/typescript/commonjs/ChatHistory.d.ts +11 -0
- package/lib/typescript/commonjs/ChatLiveBar.d.ts +11 -0
- package/lib/typescript/commonjs/ChatMessageActions.d.ts +15 -0
- package/lib/typescript/commonjs/ChatNudge.d.ts +14 -0
- package/lib/typescript/commonjs/ChatOpenTickets.d.ts +12 -0
- package/lib/typescript/commonjs/ChatScreen.d.ts +5 -0
- package/lib/typescript/commonjs/ChatSheet.d.ts +21 -0
- package/lib/typescript/commonjs/ChatStarters.d.ts +12 -0
- package/lib/typescript/commonjs/ChatThread.d.ts +34 -0
- package/lib/typescript/commonjs/ReadAloudButton.d.ts +11 -0
- package/lib/typescript/commonjs/chatShared.d.ts +4 -0
- package/lib/typescript/commonjs/index.d.ts +26 -21
- package/lib/typescript/commonjs/loaders/ChatLoader.d.ts +13 -0
- package/lib/typescript/commonjs/loaders/OrbLoader.d.ts +8 -0
- package/lib/typescript/commonjs/loaders/PhrasesLoader.d.ts +8 -0
- package/lib/typescript/commonjs/loaders/SkeletonLoader.d.ts +8 -0
- package/lib/typescript/commonjs/loaders/StepsLoader.d.ts +8 -0
- package/lib/typescript/commonjs/loaders/TypingPill.d.ts +7 -0
- package/lib/typescript/commonjs/pushOpen.d.ts +3 -0
- package/lib/typescript/commonjs/renderers/ActionPart.d.ts +3 -0
- package/lib/typescript/commonjs/renderers/ChartPart.d.ts +8 -0
- package/lib/typescript/commonjs/renderers/FigureText.d.ts +21 -0
- package/lib/typescript/commonjs/renderers/FiguresPart.d.ts +8 -0
- package/lib/typescript/commonjs/renderers/FilePart.d.ts +3 -0
- package/lib/typescript/commonjs/renderers/HandoffPart.d.ts +9 -0
- package/lib/typescript/commonjs/renderers/ImagePart.d.ts +8 -0
- package/lib/typescript/commonjs/renderers/InputRequestPart.d.ts +3 -0
- package/lib/typescript/commonjs/renderers/NoticePart.d.ts +8 -0
- package/lib/typescript/commonjs/renderers/QuickRepliesPart.d.ts +8 -0
- package/lib/typescript/commonjs/renderers/RecordCardPart.d.ts +8 -0
- package/lib/typescript/commonjs/renderers/SourcesPart.d.ts +8 -0
- package/lib/typescript/commonjs/renderers/TablePart.d.ts +8 -0
- package/lib/typescript/commonjs/renderers/TextPart.d.ts +8 -0
- package/lib/typescript/commonjs/renderers/TicketPart.d.ts +9 -0
- package/lib/typescript/commonjs/renderers/VoiceClipPart.d.ts +9 -0
- package/lib/typescript/commonjs/renderers/index.d.ts +3 -0
- package/lib/typescript/commonjs/speech/azureSpeech.d.ts +25 -0
- package/lib/typescript/commonjs/speech/expoAudio.d.ts +23 -0
- package/lib/typescript/commonjs/speech/phoneSpeech.d.ts +16 -0
- package/lib/typescript/commonjs/speech/speechText.d.ts +16 -0
- package/lib/typescript/commonjs/types.d.ts +21 -0
- package/lib/typescript/commonjs/useChat.d.ts +38 -10
- package/lib/typescript/commonjs/useChatHaptics.d.ts +3 -0
- package/lib/typescript/commonjs/useChatSpeech.d.ts +4 -0
- package/lib/typescript/commonjs/useTranscriptActions.d.ts +10 -0
- package/lib/typescript/module/AgentByline.d.ts +9 -0
- package/lib/typescript/module/ChatComposer.d.ts +14 -0
- package/lib/typescript/module/ChatConversationActions.d.ts +10 -0
- package/lib/typescript/module/ChatDictationButton.d.ts +17 -0
- package/lib/typescript/module/ChatEmbed.d.ts +11 -0
- package/lib/typescript/module/ChatEntrance.d.ts +8 -0
- package/lib/typescript/module/ChatFooter.d.ts +9 -0
- package/lib/typescript/module/ChatFrame.d.ts +39 -0
- package/lib/typescript/module/ChatHistory.d.ts +11 -0
- package/lib/typescript/module/ChatLiveBar.d.ts +11 -0
- package/lib/typescript/module/ChatMessageActions.d.ts +15 -0
- package/lib/typescript/module/ChatNudge.d.ts +14 -0
- package/lib/typescript/module/ChatOpenTickets.d.ts +12 -0
- package/lib/typescript/module/ChatScreen.d.ts +5 -0
- package/lib/typescript/module/ChatSheet.d.ts +21 -0
- package/lib/typescript/module/ChatStarters.d.ts +12 -0
- package/lib/typescript/module/ChatThread.d.ts +34 -0
- package/lib/typescript/module/ReadAloudButton.d.ts +11 -0
- package/lib/typescript/module/chatShared.d.ts +4 -0
- package/lib/typescript/module/index.d.ts +26 -21
- package/lib/typescript/module/loaders/ChatLoader.d.ts +13 -0
- package/lib/typescript/module/loaders/OrbLoader.d.ts +8 -0
- package/lib/typescript/module/loaders/PhrasesLoader.d.ts +8 -0
- package/lib/typescript/module/loaders/SkeletonLoader.d.ts +8 -0
- package/lib/typescript/module/loaders/StepsLoader.d.ts +8 -0
- package/lib/typescript/module/loaders/TypingPill.d.ts +7 -0
- package/lib/typescript/module/pushOpen.d.ts +3 -0
- package/lib/typescript/module/renderers/ActionPart.d.ts +3 -0
- package/lib/typescript/module/renderers/ChartPart.d.ts +8 -0
- package/lib/typescript/module/renderers/FigureText.d.ts +21 -0
- package/lib/typescript/module/renderers/FiguresPart.d.ts +8 -0
- package/lib/typescript/module/renderers/FilePart.d.ts +3 -0
- package/lib/typescript/module/renderers/HandoffPart.d.ts +9 -0
- package/lib/typescript/module/renderers/ImagePart.d.ts +8 -0
- package/lib/typescript/module/renderers/InputRequestPart.d.ts +3 -0
- package/lib/typescript/module/renderers/NoticePart.d.ts +8 -0
- package/lib/typescript/module/renderers/QuickRepliesPart.d.ts +8 -0
- package/lib/typescript/module/renderers/RecordCardPart.d.ts +8 -0
- package/lib/typescript/module/renderers/SourcesPart.d.ts +8 -0
- package/lib/typescript/module/renderers/TablePart.d.ts +8 -0
- package/lib/typescript/module/renderers/TextPart.d.ts +8 -0
- package/lib/typescript/module/renderers/TicketPart.d.ts +9 -0
- package/lib/typescript/module/renderers/VoiceClipPart.d.ts +9 -0
- package/lib/typescript/module/renderers/index.d.ts +3 -0
- package/lib/typescript/module/speech/azureSpeech.d.ts +25 -0
- package/lib/typescript/module/speech/expoAudio.d.ts +23 -0
- package/lib/typescript/module/speech/phoneSpeech.d.ts +16 -0
- package/lib/typescript/module/speech/speechText.d.ts +16 -0
- package/lib/typescript/module/types.d.ts +21 -0
- package/lib/typescript/module/useChat.d.ts +38 -10
- package/lib/typescript/module/useChatHaptics.d.ts +3 -0
- package/lib/typescript/module/useChatSpeech.d.ts +4 -0
- package/lib/typescript/module/useTranscriptActions.d.ts +10 -0
- package/package.json +42 -15
- package/README.md +0 -185
- package/lib/commonjs/components/ActionCard.js +0 -1
- package/lib/commonjs/components/ChatComposer.js +0 -1
- package/lib/commonjs/components/ChatConversationList.js +0 -1
- package/lib/commonjs/components/ChatLauncher.js +0 -1
- package/lib/commonjs/components/ChatMarkdown.js +0 -1
- package/lib/commonjs/components/ChatMessage.js +0 -1
- package/lib/commonjs/components/ChatScreen.js +0 -1
- package/lib/commonjs/components/ChatThread.js +0 -1
- package/lib/commonjs/components/ComposerAttachments.js +0 -1
- package/lib/commonjs/components/ReplyRating.js +0 -1
- package/lib/module/components/ActionCard.js +0 -1
- package/lib/module/components/ChatComposer.js +0 -1
- package/lib/module/components/ChatConversationList.js +0 -1
- package/lib/module/components/ChatLauncher.js +0 -1
- package/lib/module/components/ChatMarkdown.js +0 -1
- package/lib/module/components/ChatMessage.js +0 -1
- package/lib/module/components/ChatScreen.js +0 -1
- package/lib/module/components/ChatThread.js +0 -1
- package/lib/module/components/ComposerAttachments.js +0 -1
- package/lib/module/components/ReplyRating.js +0 -1
- package/lib/typescript/commonjs/components/ActionCard.d.ts +0 -23
- package/lib/typescript/commonjs/components/ChatComposer.d.ts +0 -42
- package/lib/typescript/commonjs/components/ChatConversationList.d.ts +0 -22
- package/lib/typescript/commonjs/components/ChatLauncher.d.ts +0 -22
- package/lib/typescript/commonjs/components/ChatMarkdown.d.ts +0 -24
- package/lib/typescript/commonjs/components/ChatMessage.d.ts +0 -55
- package/lib/typescript/commonjs/components/ChatScreen.d.ts +0 -40
- package/lib/typescript/commonjs/components/ChatThread.d.ts +0 -30
- package/lib/typescript/commonjs/components/ComposerAttachments.d.ts +0 -12
- package/lib/typescript/commonjs/components/ReplyRating.d.ts +0 -19
- package/lib/typescript/module/components/ActionCard.d.ts +0 -23
- package/lib/typescript/module/components/ChatComposer.d.ts +0 -42
- package/lib/typescript/module/components/ChatConversationList.d.ts +0 -22
- package/lib/typescript/module/components/ChatLauncher.d.ts +0 -22
- package/lib/typescript/module/components/ChatMarkdown.d.ts +0 -24
- package/lib/typescript/module/components/ChatMessage.d.ts +0 -55
- package/lib/typescript/module/components/ChatScreen.d.ts +0 -40
- package/lib/typescript/module/components/ChatThread.d.ts +0 -30
- package/lib/typescript/module/components/ComposerAttachments.d.ts +0 -12
- package/lib/typescript/module/components/ReplyRating.d.ts +0 -19
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { ChatLabels } from "@webority/chat-core";
|
|
2
|
+
import type React from "react";
|
|
3
|
+
import type { ChatTicketRef } from "./types";
|
|
4
|
+
import type { UseChatResult } from "./useChat";
|
|
5
|
+
export interface ChatOpenTicketsProps {
|
|
6
|
+
chat: UseChatResult;
|
|
7
|
+
labels: ChatLabels;
|
|
8
|
+
onOpenTicket?: (ticket: ChatTicketRef) => void;
|
|
9
|
+
testID?: string;
|
|
10
|
+
}
|
|
11
|
+
export declare function ChatOpenTickets({ chat, labels, onOpenTicket, testID, }: ChatOpenTicketsProps): React.ReactElement | null;
|
|
12
|
+
//# sourceMappingURL=ChatOpenTickets.d.ts.map
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type React from "react";
|
|
2
|
+
import { type ChatShellProps } from "./ChatFrame";
|
|
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;
|
|
5
|
+
//# sourceMappingURL=ChatScreen.d.ts.map
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { type BottomSheetProps } from "@webority/mobile-ui";
|
|
2
|
+
import type React from "react";
|
|
3
|
+
import { type ChatShellProps } from "./ChatFrame";
|
|
4
|
+
export interface ChatSheetProps extends ChatShellProps {
|
|
5
|
+
/** Controls the sheet. When given, the sheet follows it. */
|
|
6
|
+
open?: boolean;
|
|
7
|
+
/** The starting state when `open` is not given. Default false. */
|
|
8
|
+
defaultOpen?: boolean;
|
|
9
|
+
onOpenChange?: (open: boolean) => void;
|
|
10
|
+
position?: "end" | "start";
|
|
11
|
+
/** Space between the launcher and the bottom edge. Default 16. */
|
|
12
|
+
bottomOffset?: number;
|
|
13
|
+
snapPoints?: BottomSheetProps["snapPoints"];
|
|
14
|
+
/** The launcher shows only its icon. */
|
|
15
|
+
compact?: boolean;
|
|
16
|
+
/** Opens the sheet on this conversation when it changes to a new id (a push tap); uncontrolled sheets only. */
|
|
17
|
+
conversationId?: string | null;
|
|
18
|
+
}
|
|
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;
|
|
21
|
+
//# sourceMappingURL=ChatSheet.d.ts.map
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { ChatLabels } from "@webority/chat-core";
|
|
2
|
+
import type React from "react";
|
|
3
|
+
import type { ChatOpenTicketHandler } from "./types";
|
|
4
|
+
import type { UseChatResult } from "./useChat";
|
|
5
|
+
export interface ChatStartersProps {
|
|
6
|
+
chat: UseChatResult;
|
|
7
|
+
labels: ChatLabels;
|
|
8
|
+
openTicket?: ChatOpenTicketHandler;
|
|
9
|
+
testID?: string;
|
|
10
|
+
}
|
|
11
|
+
export declare function ChatStarters({ chat, labels, openTicket, testID }: ChatStartersProps): React.ReactElement | null;
|
|
12
|
+
//# sourceMappingURL=ChatStarters.d.ts.map
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { ChatLabels, ChatLoaderStyle, ChatMotion, ChatPart, ChatUploadFile } from "@webority/chat-core";
|
|
2
|
+
import type React from "react";
|
|
3
|
+
import { type StyleProp, type ViewStyle } from "react-native";
|
|
4
|
+
import type { ChatLayoutParts, ChatOpenTicketHandler, ChatRenderers } from "./types";
|
|
5
|
+
import type { UseChatResult } from "./useChat";
|
|
6
|
+
export interface ChatThreadProps {
|
|
7
|
+
chat: UseChatResult;
|
|
8
|
+
labels: ChatLabels;
|
|
9
|
+
renderers?: ChatRenderers;
|
|
10
|
+
layoutParts?: ChatLayoutParts;
|
|
11
|
+
loader?: ChatLoaderStyle;
|
|
12
|
+
motion?: ChatMotion;
|
|
13
|
+
pickAttachments?: () => Promise<ChatUploadFile[]>;
|
|
14
|
+
onOpenAttachment?: (part: Extract<ChatPart, {
|
|
15
|
+
kind: "File";
|
|
16
|
+
}>) => void;
|
|
17
|
+
onOpenTarget?: (target: string) => void;
|
|
18
|
+
onNavigate?: (path: string) => void;
|
|
19
|
+
openTicket?: ChatOpenTicketHandler;
|
|
20
|
+
handoffHosts?: readonly string[];
|
|
21
|
+
keyboardAware?: boolean;
|
|
22
|
+
keyboardOffset?: number;
|
|
23
|
+
/** Drawn before the first message. */
|
|
24
|
+
empty?: React.ReactNode;
|
|
25
|
+
style?: StyleProp<ViewStyle>;
|
|
26
|
+
testID?: string;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* The conversation on mobile-ui's `MessageList`, newest at the bottom. The typing slot holds the
|
|
30
|
+
* pill while a paced reply is held, the loader while a reply is awaited and the error row after a
|
|
31
|
+
* failed or stopped turn.
|
|
32
|
+
*/
|
|
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;
|
|
34
|
+
//# sourceMappingURL=ChatThread.d.ts.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type ChatLabels, type ChatLiveMessage } from "@webority/chat-core";
|
|
2
|
+
import type React from "react";
|
|
3
|
+
import type { UseChatResult } from "./useChat";
|
|
4
|
+
export interface ReadAloudButtonProps {
|
|
5
|
+
chat: UseChatResult;
|
|
6
|
+
message: ChatLiveMessage;
|
|
7
|
+
labels: ChatLabels;
|
|
8
|
+
testID?: string;
|
|
9
|
+
}
|
|
10
|
+
export declare function ReadAloudButton({ chat, message, labels, testID }: ReadAloudButtonProps): React.ReactElement | null;
|
|
11
|
+
//# sourceMappingURL=ReadAloudButton.d.ts.map
|
|
@@ -1,23 +1,28 @@
|
|
|
1
|
-
export
|
|
2
|
-
export {
|
|
3
|
-
export
|
|
4
|
-
export {
|
|
5
|
-
export
|
|
6
|
-
export {
|
|
7
|
-
export type {
|
|
8
|
-
export {
|
|
9
|
-
export
|
|
10
|
-
export {
|
|
11
|
-
export
|
|
12
|
-
export {
|
|
13
|
-
export
|
|
14
|
-
export {
|
|
15
|
-
export
|
|
16
|
-
export {
|
|
17
|
-
export
|
|
18
|
-
export {
|
|
19
|
-
export
|
|
20
|
-
export {
|
|
21
|
-
export
|
|
1
|
+
export { AgentByline } from "./AgentByline";
|
|
2
|
+
export { ChatComposer } from "./ChatComposer";
|
|
3
|
+
export { ChatConversationActions } from "./ChatConversationActions";
|
|
4
|
+
export { ChatDictationButton } from "./ChatDictationButton";
|
|
5
|
+
export { ChatEmbed } from "./ChatEmbed";
|
|
6
|
+
export { ChatFooter } from "./ChatFooter";
|
|
7
|
+
export type { ChatShellProps } from "./ChatFrame";
|
|
8
|
+
export { ChatHistory } from "./ChatHistory";
|
|
9
|
+
export { ChatLiveBar } from "./ChatLiveBar";
|
|
10
|
+
export { ChatMessageActions } from "./ChatMessageActions";
|
|
11
|
+
export { ChatNudge } from "./ChatNudge";
|
|
12
|
+
export { ChatOpenTickets } from "./ChatOpenTickets";
|
|
13
|
+
export { ChatScreen } from "./ChatScreen";
|
|
14
|
+
export type { ChatSheetProps } from "./ChatSheet";
|
|
15
|
+
export { ChatSheet } from "./ChatSheet";
|
|
16
|
+
export { ChatStarters } from "./ChatStarters";
|
|
17
|
+
export { ChatThread } from "./ChatThread";
|
|
18
|
+
export { defaultOpenTarget, messageSignature } from "./chatShared";
|
|
19
|
+
export { ChatLoader } from "./loaders/ChatLoader";
|
|
20
|
+
export { TypingPill } from "./loaders/TypingPill";
|
|
21
|
+
export { CHAT_PUSH_TYPE, chatConversationIdFromPush } from "./pushOpen";
|
|
22
|
+
export { ReadAloudButton } from "./ReadAloudButton";
|
|
23
|
+
export { defaultRenderers } from "./renderers";
|
|
24
|
+
export type { ChatLayoutParts, ChatPartRendererProps, ChatRenderers } from "./types";
|
|
25
|
+
export type { UseChatOptions, UseChatResult } from "./useChat";
|
|
22
26
|
export { useChat } from "./useChat";
|
|
27
|
+
export { useChatSpeech } from "./useChatSpeech";
|
|
23
28
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type ChatLoaderStyle } from "@webority/chat-core";
|
|
2
|
+
import type React from "react";
|
|
3
|
+
export interface ChatLoaderProps {
|
|
4
|
+
style?: ChatLoaderStyle;
|
|
5
|
+
steps?: readonly string[];
|
|
6
|
+
phrases: readonly string[];
|
|
7
|
+
intervalMs: number;
|
|
8
|
+
motion?: "On" | "Reduced";
|
|
9
|
+
announce: string;
|
|
10
|
+
testID?: string;
|
|
11
|
+
}
|
|
12
|
+
export declare function ChatLoader({ style, steps, phrases, intervalMs, motion, announce, testID, }: ChatLoaderProps): React.JSX.Element;
|
|
13
|
+
//# sourceMappingURL=ChatLoader.d.ts.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ChatLoaderView } from "@webority/chat-core";
|
|
2
|
+
import type React from "react";
|
|
3
|
+
export interface OrbLoaderProps {
|
|
4
|
+
view: ChatLoaderView;
|
|
5
|
+
reduced: boolean;
|
|
6
|
+
}
|
|
7
|
+
export declare function OrbLoader({ view, reduced }: OrbLoaderProps): React.JSX.Element;
|
|
8
|
+
//# sourceMappingURL=OrbLoader.d.ts.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ChatLoaderView } from "@webority/chat-core";
|
|
2
|
+
import type React from "react";
|
|
3
|
+
export interface PhrasesLoaderProps {
|
|
4
|
+
view: ChatLoaderView;
|
|
5
|
+
reduced: boolean;
|
|
6
|
+
}
|
|
7
|
+
export declare function PhrasesLoader({ view, reduced }: PhrasesLoaderProps): React.JSX.Element;
|
|
8
|
+
//# sourceMappingURL=PhrasesLoader.d.ts.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ChatLoaderView } from "@webority/chat-core";
|
|
2
|
+
import type React from "react";
|
|
3
|
+
export interface SkeletonLoaderProps {
|
|
4
|
+
view: ChatLoaderView;
|
|
5
|
+
reduced: boolean;
|
|
6
|
+
}
|
|
7
|
+
export declare function SkeletonLoader({ view, reduced }: SkeletonLoaderProps): React.JSX.Element;
|
|
8
|
+
//# sourceMappingURL=SkeletonLoader.d.ts.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ChatLoaderView } from "@webority/chat-core";
|
|
2
|
+
import type React from "react";
|
|
3
|
+
export interface StepsLoaderProps {
|
|
4
|
+
view: ChatLoaderView;
|
|
5
|
+
reduced: boolean;
|
|
6
|
+
}
|
|
7
|
+
export declare function StepsLoader({ view, reduced }: StepsLoaderProps): React.JSX.Element;
|
|
8
|
+
//# sourceMappingURL=StepsLoader.d.ts.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type ChatPart } from "@webority/chat-core";
|
|
2
|
+
import type { ChatPartRendererProps } from "../types";
|
|
3
|
+
type ChartPartProps = ChatPartRendererProps<Extract<ChatPart, {
|
|
4
|
+
kind: "Chart";
|
|
5
|
+
}>>;
|
|
6
|
+
export declare function ChartPart({ part, turn }: Pick<ChartPartProps, "part" | "turn">): import("react").JSX.Element | null;
|
|
7
|
+
export {};
|
|
8
|
+
//# sourceMappingURL=ChartPart.d.ts.map
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { type ChatFigureRun } from "@webority/chat-core";
|
|
2
|
+
import { Text } from "@webority/mobile-ui";
|
|
3
|
+
import { type ComponentProps } from "react";
|
|
4
|
+
type MobileText = ComponentProps<typeof Text>;
|
|
5
|
+
export interface FigureRunsProps {
|
|
6
|
+
runs: readonly ChatFigureRun[];
|
|
7
|
+
variant?: MobileText["variant"];
|
|
8
|
+
color?: MobileText["color"];
|
|
9
|
+
strong?: boolean;
|
|
10
|
+
numberOfLines?: number;
|
|
11
|
+
accessibilityLabel?: string;
|
|
12
|
+
testID?: string;
|
|
13
|
+
}
|
|
14
|
+
export interface FigureTextProps extends Omit<FigureRunsProps, "runs"> {
|
|
15
|
+
text: string;
|
|
16
|
+
}
|
|
17
|
+
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 {};
|
|
21
|
+
//# sourceMappingURL=FigureText.d.ts.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type ChatPart } from "@webority/chat-core";
|
|
2
|
+
import type { ChatPartRendererProps } from "../types";
|
|
3
|
+
type FiguresPartProps = ChatPartRendererProps<Extract<ChatPart, {
|
|
4
|
+
kind: "Figures";
|
|
5
|
+
}>>;
|
|
6
|
+
export declare function FiguresPart({ part, turn }: Pick<FiguresPartProps, "part" | "turn">): import("react").JSX.Element | null;
|
|
7
|
+
export {};
|
|
8
|
+
//# sourceMappingURL=FiguresPart.d.ts.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ChatPart } from "@webority/chat-core";
|
|
2
|
+
import type React from "react";
|
|
3
|
+
import type { ChatPartRendererProps } from "../types";
|
|
4
|
+
type HandoffView = Extract<ChatPart, {
|
|
5
|
+
kind: "Handoff";
|
|
6
|
+
}>;
|
|
7
|
+
export declare function HandoffPart({ part, turn }: ChatPartRendererProps<HandoffView>): React.ReactElement;
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=HandoffPart.d.ts.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ChatPart } from "@webority/chat-core";
|
|
2
|
+
import type { ChatPartRendererProps } from "../types";
|
|
3
|
+
type ImagePartProps = ChatPartRendererProps<Extract<ChatPart, {
|
|
4
|
+
kind: "Image";
|
|
5
|
+
}>>;
|
|
6
|
+
export declare function ImagePart({ part, turn }: Pick<ImagePartProps, "part" | "turn">): import("react").JSX.Element;
|
|
7
|
+
export {};
|
|
8
|
+
//# sourceMappingURL=ImagePart.d.ts.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ChatPart } from "@webority/chat-core";
|
|
2
|
+
import type { ChatPartRendererProps } from "../types";
|
|
3
|
+
type NoticePartProps = ChatPartRendererProps<Extract<ChatPart, {
|
|
4
|
+
kind: "Notice";
|
|
5
|
+
}>>;
|
|
6
|
+
export declare function NoticePart({ part }: NoticePartProps): import("react").JSX.Element;
|
|
7
|
+
export {};
|
|
8
|
+
//# sourceMappingURL=NoticePart.d.ts.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type ChatPart } from "@webority/chat-core";
|
|
2
|
+
import type { ChatPartRendererProps } from "../types";
|
|
3
|
+
type QuickRepliesPartProps = ChatPartRendererProps<Extract<ChatPart, {
|
|
4
|
+
kind: "QuickReplies";
|
|
5
|
+
}>>;
|
|
6
|
+
export declare function QuickRepliesPart({ part, turn }: QuickRepliesPartProps): import("react").JSX.Element | null;
|
|
7
|
+
export {};
|
|
8
|
+
//# sourceMappingURL=QuickRepliesPart.d.ts.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type ChatPart } from "@webority/chat-core";
|
|
2
|
+
import type { ChatPartRendererProps } from "../types";
|
|
3
|
+
type RecordCardPartProps = ChatPartRendererProps<Extract<ChatPart, {
|
|
4
|
+
kind: "RecordCard";
|
|
5
|
+
}>>;
|
|
6
|
+
export declare function RecordCardPart({ part, turn }: Pick<RecordCardPartProps, "part" | "turn">): import("react").JSX.Element;
|
|
7
|
+
export {};
|
|
8
|
+
//# sourceMappingURL=RecordCardPart.d.ts.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ChatPart } from "@webority/chat-core";
|
|
2
|
+
import type { ChatPartRendererProps } from "../types";
|
|
3
|
+
type SourcesPartProps = ChatPartRendererProps<Extract<ChatPart, {
|
|
4
|
+
kind: "Sources";
|
|
5
|
+
}>>;
|
|
6
|
+
export declare function SourcesPart({ part, turn }: SourcesPartProps): import("react").JSX.Element | null;
|
|
7
|
+
export {};
|
|
8
|
+
//# sourceMappingURL=SourcesPart.d.ts.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type ChatPart } from "@webority/chat-core";
|
|
2
|
+
import type { ChatPartRendererProps } from "../types";
|
|
3
|
+
type TablePartProps = ChatPartRendererProps<Extract<ChatPart, {
|
|
4
|
+
kind: "Table";
|
|
5
|
+
}>>;
|
|
6
|
+
export declare function TablePart({ part, turn }: Pick<TablePartProps, "part" | "turn">): import("react").JSX.Element | null;
|
|
7
|
+
export {};
|
|
8
|
+
//# sourceMappingURL=TablePart.d.ts.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type ChatPart } from "@webority/chat-core";
|
|
2
|
+
import type { ChatPartRendererProps } from "../types";
|
|
3
|
+
type TextPartProps = ChatPartRendererProps<Extract<ChatPart, {
|
|
4
|
+
kind: "Text";
|
|
5
|
+
}>>;
|
|
6
|
+
export declare function TextPart({ part, message, turn }: TextPartProps): import("react").JSX.Element;
|
|
7
|
+
export {};
|
|
8
|
+
//# sourceMappingURL=TextPart.d.ts.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ChatPart } from "@webority/chat-core";
|
|
2
|
+
import type React from "react";
|
|
3
|
+
import type { ChatPartRendererProps } from "../types";
|
|
4
|
+
type TicketView = Extract<ChatPart, {
|
|
5
|
+
kind: "Ticket";
|
|
6
|
+
}>;
|
|
7
|
+
export declare function TicketPart({ part, turn }: ChatPartRendererProps<TicketView>): React.ReactElement;
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=TicketPart.d.ts.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ChatPart } from "@webority/chat-core";
|
|
2
|
+
import type React from "react";
|
|
3
|
+
import type { ChatPartRendererProps } from "../types";
|
|
4
|
+
type VoiceClipProps = ChatPartRendererProps<Extract<ChatPart, {
|
|
5
|
+
kind: "VoiceClip";
|
|
6
|
+
}>>;
|
|
7
|
+
export declare function VoiceClipPart({ part, turn }: VoiceClipProps): React.ReactElement;
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=VoiceClipPart.d.ts.map
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { type ChatAbortSignal } from "@webority/chat-core";
|
|
2
|
+
export interface SpeechEndpointToken {
|
|
3
|
+
token: string;
|
|
4
|
+
region: string;
|
|
5
|
+
}
|
|
6
|
+
export declare class SpeechRequestError extends Error {
|
|
7
|
+
readonly status: number;
|
|
8
|
+
constructor(status: number);
|
|
9
|
+
}
|
|
10
|
+
export declare function transcribeClip(input: {
|
|
11
|
+
token: SpeechEndpointToken;
|
|
12
|
+
uri: string;
|
|
13
|
+
language: string;
|
|
14
|
+
signal?: ChatAbortSignal;
|
|
15
|
+
fetchImpl?: typeof fetch;
|
|
16
|
+
}): Promise<string>;
|
|
17
|
+
export declare function synthesizeSpeech(input: {
|
|
18
|
+
token: SpeechEndpointToken;
|
|
19
|
+
text: string;
|
|
20
|
+
language: string;
|
|
21
|
+
voice: string;
|
|
22
|
+
signal?: ChatAbortSignal;
|
|
23
|
+
fetchImpl?: typeof fetch;
|
|
24
|
+
}): Promise<Uint8Array>;
|
|
25
|
+
//# sourceMappingURL=azureSpeech.d.ts.map
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export interface RecordedClip {
|
|
2
|
+
uri: string;
|
|
3
|
+
durationMs: number;
|
|
4
|
+
}
|
|
5
|
+
export interface ClipRecording {
|
|
6
|
+
stop(): Promise<RecordedClip>;
|
|
7
|
+
cancel(): Promise<void>;
|
|
8
|
+
}
|
|
9
|
+
export interface ClipPlayback {
|
|
10
|
+
finished: Promise<void>;
|
|
11
|
+
pause(): void;
|
|
12
|
+
resume(): void;
|
|
13
|
+
stop(): void;
|
|
14
|
+
}
|
|
15
|
+
/** Starts a recording as m4a (AAC) on both platforms, mono at 16 kHz, which the transcription request reads. */
|
|
16
|
+
export declare function startRecording(): Promise<ClipRecording>;
|
|
17
|
+
/** Plays a local file. Starting one stops the playback before it, so a clip and a read-aloud never overlap. */
|
|
18
|
+
export declare function playFile(uri: string, onStatus?: (status: {
|
|
19
|
+
positionMs: number;
|
|
20
|
+
durationMs: number | null;
|
|
21
|
+
playing: boolean;
|
|
22
|
+
}) => void): ClipPlayback;
|
|
23
|
+
//# sourceMappingURL=expoAudio.d.ts.map
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type ChatSpeechAdapter, ChatSpeechError, type ChatSpeechErrorCode, type ChatSpeechToken } from "@webority/chat-core";
|
|
2
|
+
export type PhoneSpeechErrorCode = "MicDenied" | "MicBlocked" | "MicUnavailable" | "Failed" | "Unavailable";
|
|
3
|
+
/** The chat-core code the UI reads, plus the finer phone code that says which step refused. */
|
|
4
|
+
export declare class PhoneSpeechError extends ChatSpeechError {
|
|
5
|
+
readonly phoneCode: PhoneSpeechErrorCode;
|
|
6
|
+
constructor(code: ChatSpeechErrorCode, phoneCode: PhoneSpeechErrorCode, message?: string);
|
|
7
|
+
}
|
|
8
|
+
export interface PhoneSpeechOptions {
|
|
9
|
+
getToken: () => Promise<ChatSpeechToken>;
|
|
10
|
+
language?: string;
|
|
11
|
+
voice?: string;
|
|
12
|
+
}
|
|
13
|
+
/** Deletes a temporary audio file. A file that cannot be removed is left for the OS to clear. */
|
|
14
|
+
export declare function discardFile(uri: string): void;
|
|
15
|
+
export declare function createPhoneSpeech(options: PhoneSpeechOptions): ChatSpeechAdapter;
|
|
16
|
+
//# sourceMappingURL=phoneSpeech.d.ts.map
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export declare const DEFAULT_SPEECH_LANGUAGE = "en-IN";
|
|
2
|
+
export declare const DEFAULT_SPEECH_VOICE = "en-IN-NeerjaNeural";
|
|
3
|
+
export declare const MAX_SPEAK_CHARS = 4000;
|
|
4
|
+
export declare const MAX_DICTATION_MS = 60000;
|
|
5
|
+
export declare const MIN_DICTATION_MS = 600;
|
|
6
|
+
/** The file extension a recording's bytes stand for. m4a is the fallback, the format the phone records. */
|
|
7
|
+
export declare function audioExtension(bytes: Uint8Array): string;
|
|
8
|
+
export declare function escapeSsml(text: string): string;
|
|
9
|
+
export declare function buildSsml(text: string, language: string, voice: string): string;
|
|
10
|
+
/** Cuts at the last sentence end past the floor, so a long reply is read whole sentences at a time. */
|
|
11
|
+
export declare function clampSpeakText(text: string): string;
|
|
12
|
+
/** Whole seconds as m:ss. A negative or non-finite value reads as 0:00. */
|
|
13
|
+
export declare function formatClipTime(ms: number): string;
|
|
14
|
+
/** Appends what was heard to the draft, with one space between, and keeps the result within maxLength. */
|
|
15
|
+
export declare function joinDictation(draft: string, heard: string, maxLength: number): string;
|
|
16
|
+
//# sourceMappingURL=speechText.d.ts.map
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { ChatLiveMessage, ChatPart, ChatPartKind, ChatTurnApi, ChatUploadFile } from "@webority/chat-core";
|
|
2
|
+
import type React from "react";
|
|
3
|
+
export type { ChatMotion } from "@webority/chat-core";
|
|
4
|
+
export type ChatPartRendererProps<P extends ChatPart = ChatPart> = {
|
|
5
|
+
part: P;
|
|
6
|
+
message: ChatLiveMessage;
|
|
7
|
+
turn: ChatTurnApi;
|
|
8
|
+
pickAttachments?: () => Promise<ChatUploadFile[]>;
|
|
9
|
+
};
|
|
10
|
+
export type ChatRenderers = Partial<{
|
|
11
|
+
[K in ChatPartKind]: React.ComponentType<ChatPartRendererProps<Extract<ChatPart, {
|
|
12
|
+
kind: K;
|
|
13
|
+
}>>>;
|
|
14
|
+
}>;
|
|
15
|
+
export type ChatLayoutParts = (message: ChatLiveMessage) => Array<ChatPart | ChatPart[]>;
|
|
16
|
+
export interface ChatTicketRef {
|
|
17
|
+
ticketId: string;
|
|
18
|
+
number: string;
|
|
19
|
+
}
|
|
20
|
+
export type ChatOpenTicketHandler = (ticket: ChatTicketRef) => void;
|
|
21
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1,19 +1,47 @@
|
|
|
1
|
-
import type { ChatClient, ChatSession, ChatSessionState } from "@webority/
|
|
2
|
-
|
|
1
|
+
import type { ChatBehaviour, ChatClient, ChatFeature, ChatSession, ChatSessionState } from "@webority/chat-core";
|
|
2
|
+
import type { ChatLayout } from "./ChatFrame";
|
|
3
|
+
export interface ChatPrefs {
|
|
4
|
+
get(key: string): string | null;
|
|
5
|
+
set(key: string, value: string): void;
|
|
6
|
+
}
|
|
3
7
|
export interface UseChatOptions {
|
|
4
|
-
/** From `createChatClient`. */
|
|
5
8
|
client: ChatClient;
|
|
6
|
-
/**
|
|
9
|
+
/** The screen key the profile resolves for; the phone has no URL. */
|
|
10
|
+
screen?: string;
|
|
11
|
+
/** The shell that hosts the session, named in its open and close events. */
|
|
12
|
+
layout?: ChatLayout;
|
|
13
|
+
/** Features switched off on this surface, on top of the server profile. */
|
|
14
|
+
narrow?: Partial<Record<ChatFeature, false>>;
|
|
15
|
+
/** Opens this conversation once after the profile loads. */
|
|
16
|
+
conversationId?: string | null;
|
|
17
|
+
/** Sent with each message; read at the moment of sending. */
|
|
7
18
|
pageContext?: unknown;
|
|
19
|
+
/** The behaviour the host app measured; read at the moment of sending. */
|
|
20
|
+
behaviour?: () => ChatBehaviour | null;
|
|
21
|
+
/** Where the session keeps the mute choice (key wchat:muted). */
|
|
22
|
+
prefs: ChatPrefs;
|
|
23
|
+
getCaptchaToken?: (action: string) => Promise<string | null>;
|
|
24
|
+
onEvent?: (name: string, data: Record<string, unknown>) => void;
|
|
25
|
+
onError?: (error: unknown) => void;
|
|
26
|
+
/** Receives the path of a relative link in a reply; the host decides how to navigate to it. */
|
|
27
|
+
onNavigate?: (path: string) => void;
|
|
8
28
|
}
|
|
9
|
-
type ChatActions = Pick<ChatSession, "submit" | "stop" | "retry" | "regenerate" | "startEdit" | "cancelEdit" | "attach" | "removeAttachment" | "openConversation" | "newConversation" | "rate" | "
|
|
10
|
-
export
|
|
29
|
+
type ChatActions = Pick<ChatSession, "load" | "submit" | "chooseQuickReply" | "answerInput" | "confirmAction" | "rejectAction" | "stop" | "retry" | "regenerate" | "startEdit" | "cancelEdit" | "attach" | "removeAttachment" | "openConversation" | "resumeLast" | "newConversation" | "rate" | "reset" | "requestHandoff" | "notifyTyping" | "resumeLive">;
|
|
30
|
+
export interface UseChatResult extends ChatSessionState, ChatActions {
|
|
31
|
+
session: ChatSession;
|
|
11
32
|
client: ChatClient;
|
|
12
|
-
|
|
33
|
+
emit: (name: string, data: Record<string, unknown>) => void;
|
|
34
|
+
/** The host reports whether the chat is on screen; the live stream runs only while it is and the app is active. */
|
|
35
|
+
setChatVisible: (visible: boolean) => void;
|
|
36
|
+
/** Present only when the host passed `onNavigate`; the turn API of each message hands relative links to it. */
|
|
37
|
+
onNavigate?: (path: string) => void;
|
|
38
|
+
}
|
|
13
39
|
/**
|
|
14
40
|
* The chat's state and actions. The session lives in the component that calls it: one per client,
|
|
15
|
-
*
|
|
16
|
-
*
|
|
41
|
+
* screen and narrowing, created in a mount effect (StrictMode runs effects twice and a disposed session never
|
|
42
|
+
* loads again) and disposed when those change or the component unmounts. Until it exists the state is idle and
|
|
43
|
+
* the actions do nothing. Call `reset()` when the signed-in person changes so nothing of one person's chat shows to the next.
|
|
17
44
|
*/
|
|
18
|
-
export declare
|
|
45
|
+
export declare function useChat(options: UseChatOptions): UseChatResult;
|
|
46
|
+
export {};
|
|
19
47
|
//# sourceMappingURL=useChat.d.ts.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type ChatLabels, type ChatLiveMessage } from "@webority/chat-core";
|
|
2
|
+
import type { UseChatResult } from "./useChat";
|
|
3
|
+
export interface TranscriptActions {
|
|
4
|
+
canShare: boolean;
|
|
5
|
+
notice: string | null;
|
|
6
|
+
shareReply(message: ChatLiveMessage): Promise<void>;
|
|
7
|
+
shareConversation(): Promise<void>;
|
|
8
|
+
}
|
|
9
|
+
export default function useTranscriptActions(chat: UseChatResult, labels: ChatLabels): TranscriptActions;
|
|
10
|
+
//# sourceMappingURL=useTranscriptActions.d.ts.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ChatAuthor, ChatLabels } from "@webority/chat-core";
|
|
2
|
+
import type React from "react";
|
|
3
|
+
export interface AgentBylineProps {
|
|
4
|
+
author: ChatAuthor;
|
|
5
|
+
labels: ChatLabels;
|
|
6
|
+
}
|
|
7
|
+
/** The name and picture of the person who wrote an agent message. The spoken text carries the name instead. */
|
|
8
|
+
export declare function AgentByline({ author, labels }: AgentBylineProps): React.ReactElement;
|
|
9
|
+
//# sourceMappingURL=AgentByline.d.ts.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { ChatLabels, ChatUploadFile } from "@webority/chat-core";
|
|
2
|
+
import type React from "react";
|
|
3
|
+
import type { UseChatResult } from "./useChat.js";
|
|
4
|
+
export interface ChatComposerProps {
|
|
5
|
+
chat: UseChatResult;
|
|
6
|
+
labels: ChatLabels;
|
|
7
|
+
pickAttachments?: () => Promise<ChatUploadFile[]>;
|
|
8
|
+
keyboardOffset?: number;
|
|
9
|
+
keyboardAware?: boolean;
|
|
10
|
+
safeArea?: boolean;
|
|
11
|
+
testID?: string;
|
|
12
|
+
}
|
|
13
|
+
export declare function ChatComposer({ chat, labels, pickAttachments, keyboardOffset, keyboardAware, safeArea, testID, }: ChatComposerProps): React.ReactElement;
|
|
14
|
+
//# sourceMappingURL=ChatComposer.d.ts.map
|