@webority/mobile-chat 0.128.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.
Files changed (264) hide show
  1. package/lib/commonjs/AgentByline.js +1 -0
  2. package/lib/commonjs/ChatComposer.js +1 -0
  3. package/lib/commonjs/ChatConversationActions.js +1 -0
  4. package/lib/commonjs/ChatDictationButton.js +1 -0
  5. package/lib/commonjs/ChatEmbed.js +1 -0
  6. package/lib/commonjs/ChatEntrance.js +1 -0
  7. package/lib/commonjs/ChatFooter.js +1 -0
  8. package/lib/commonjs/ChatFrame.js +1 -0
  9. package/lib/commonjs/ChatHistory.js +1 -0
  10. package/lib/commonjs/ChatLiveBar.js +1 -0
  11. package/lib/commonjs/ChatMessageActions.js +1 -0
  12. package/lib/commonjs/ChatNudge.js +1 -0
  13. package/lib/commonjs/ChatOpenTickets.js +1 -0
  14. package/lib/commonjs/ChatPastChats.js +1 -0
  15. package/lib/commonjs/ChatScreen.js +1 -0
  16. package/lib/commonjs/ChatSheet.js +1 -0
  17. package/lib/commonjs/ChatStarters.js +1 -0
  18. package/lib/commonjs/ChatThread.js +1 -0
  19. package/lib/commonjs/ReadAloudButton.js +1 -0
  20. package/lib/commonjs/chatShared.js +1 -0
  21. package/lib/commonjs/features.map.json +40 -0
  22. package/lib/commonjs/index.js +1 -1
  23. package/lib/commonjs/loaders/ChatLoader.js +1 -0
  24. package/lib/commonjs/loaders/OrbLoader.js +1 -0
  25. package/lib/commonjs/loaders/PhrasesLoader.js +1 -0
  26. package/lib/commonjs/loaders/SkeletonLoader.js +1 -0
  27. package/lib/commonjs/loaders/StepsLoader.js +1 -0
  28. package/lib/commonjs/loaders/TypingPill.js +1 -0
  29. package/lib/commonjs/pushOpen.js +1 -0
  30. package/lib/commonjs/renderers/ActionPart.js +1 -0
  31. package/lib/commonjs/renderers/ChartPart.js +1 -0
  32. package/lib/commonjs/renderers/FigureText.js +1 -0
  33. package/lib/commonjs/renderers/FiguresPart.js +1 -0
  34. package/lib/commonjs/renderers/FilePart.js +1 -0
  35. package/lib/commonjs/renderers/HandoffPart.js +1 -0
  36. package/lib/commonjs/renderers/ImagePart.js +1 -0
  37. package/lib/commonjs/renderers/InputRequestPart.js +1 -0
  38. package/lib/commonjs/renderers/NoticePart.js +1 -0
  39. package/lib/commonjs/renderers/QuickRepliesPart.js +1 -0
  40. package/lib/commonjs/renderers/RecordCardPart.js +1 -0
  41. package/lib/commonjs/renderers/SourcesPart.js +1 -0
  42. package/lib/commonjs/renderers/TablePart.js +1 -0
  43. package/lib/commonjs/renderers/TextPart.js +1 -0
  44. package/lib/commonjs/renderers/TicketPart.js +1 -0
  45. package/lib/commonjs/renderers/VoiceClipPart.js +1 -0
  46. package/lib/commonjs/renderers/index.js +1 -0
  47. package/lib/commonjs/speech/azureSpeech.js +1 -0
  48. package/lib/commonjs/speech/expoAudio.js +1 -0
  49. package/lib/commonjs/speech/phoneSpeech.js +1 -0
  50. package/lib/commonjs/speech/speechText.js +1 -0
  51. package/lib/commonjs/types.js +1 -0
  52. package/lib/commonjs/useChat.js +1 -1
  53. package/lib/commonjs/useChatHaptics.js +1 -0
  54. package/lib/commonjs/useChatSound.js +1 -0
  55. package/lib/commonjs/useChatSpeech.js +1 -0
  56. package/lib/commonjs/useTranscriptActions.js +1 -0
  57. package/lib/module/AgentByline.js +1 -0
  58. package/lib/module/ChatComposer.js +1 -0
  59. package/lib/module/ChatConversationActions.js +1 -0
  60. package/lib/module/ChatDictationButton.js +1 -0
  61. package/lib/module/ChatEmbed.js +1 -0
  62. package/lib/module/ChatEntrance.js +1 -0
  63. package/lib/module/ChatFooter.js +1 -0
  64. package/lib/module/ChatFrame.js +1 -0
  65. package/lib/module/ChatHistory.js +1 -0
  66. package/lib/module/ChatLiveBar.js +1 -0
  67. package/lib/module/ChatMessageActions.js +1 -0
  68. package/lib/module/ChatNudge.js +1 -0
  69. package/lib/module/ChatOpenTickets.js +1 -0
  70. package/lib/module/ChatPastChats.js +1 -0
  71. package/lib/module/ChatScreen.js +1 -0
  72. package/lib/module/ChatSheet.js +1 -0
  73. package/lib/module/ChatStarters.js +1 -0
  74. package/lib/module/ChatThread.js +1 -0
  75. package/lib/module/ReadAloudButton.js +1 -0
  76. package/lib/module/chatShared.js +1 -0
  77. package/lib/module/features.map.json +40 -0
  78. package/lib/module/index.js +1 -1
  79. package/lib/module/loaders/ChatLoader.js +1 -0
  80. package/lib/module/loaders/OrbLoader.js +1 -0
  81. package/lib/module/loaders/PhrasesLoader.js +1 -0
  82. package/lib/module/loaders/SkeletonLoader.js +1 -0
  83. package/lib/module/loaders/StepsLoader.js +1 -0
  84. package/lib/module/loaders/TypingPill.js +1 -0
  85. package/lib/module/pushOpen.js +1 -0
  86. package/lib/module/renderers/ActionPart.js +1 -0
  87. package/lib/module/renderers/ChartPart.js +1 -0
  88. package/lib/module/renderers/FigureText.js +1 -0
  89. package/lib/module/renderers/FiguresPart.js +1 -0
  90. package/lib/module/renderers/FilePart.js +1 -0
  91. package/lib/module/renderers/HandoffPart.js +1 -0
  92. package/lib/module/renderers/ImagePart.js +1 -0
  93. package/lib/module/renderers/InputRequestPart.js +1 -0
  94. package/lib/module/renderers/NoticePart.js +1 -0
  95. package/lib/module/renderers/QuickRepliesPart.js +1 -0
  96. package/lib/module/renderers/RecordCardPart.js +1 -0
  97. package/lib/module/renderers/SourcesPart.js +1 -0
  98. package/lib/module/renderers/TablePart.js +1 -0
  99. package/lib/module/renderers/TextPart.js +1 -0
  100. package/lib/module/renderers/TicketPart.js +1 -0
  101. package/lib/module/renderers/VoiceClipPart.js +1 -0
  102. package/lib/module/renderers/index.js +1 -0
  103. package/lib/module/speech/azureSpeech.js +1 -0
  104. package/lib/module/speech/expoAudio.js +1 -0
  105. package/lib/module/speech/phoneSpeech.js +1 -0
  106. package/lib/module/speech/speechText.js +1 -0
  107. package/lib/module/types.js +1 -0
  108. package/lib/module/useChat.js +1 -1
  109. package/lib/module/useChatHaptics.js +1 -0
  110. package/lib/module/useChatSound.js +1 -0
  111. package/lib/module/useChatSpeech.js +1 -0
  112. package/lib/module/useTranscriptActions.js +1 -0
  113. package/lib/typescript/commonjs/AgentByline.d.ts +9 -0
  114. package/lib/typescript/commonjs/ChatComposer.d.ts +15 -0
  115. package/lib/typescript/commonjs/ChatConversationActions.d.ts +10 -0
  116. package/lib/typescript/commonjs/ChatDictationButton.d.ts +19 -0
  117. package/lib/typescript/commonjs/ChatEmbed.d.ts +11 -0
  118. package/lib/typescript/commonjs/ChatEntrance.d.ts +8 -0
  119. package/lib/typescript/commonjs/ChatFooter.d.ts +9 -0
  120. package/lib/typescript/commonjs/ChatFrame.d.ts +45 -0
  121. package/lib/typescript/commonjs/ChatHistory.d.ts +11 -0
  122. package/lib/typescript/commonjs/ChatLiveBar.d.ts +11 -0
  123. package/lib/typescript/commonjs/ChatMessageActions.d.ts +15 -0
  124. package/lib/typescript/commonjs/ChatNudge.d.ts +14 -0
  125. package/lib/typescript/commonjs/ChatOpenTickets.d.ts +12 -0
  126. package/lib/typescript/commonjs/ChatPastChats.d.ts +21 -0
  127. package/lib/typescript/commonjs/ChatScreen.d.ts +5 -0
  128. package/lib/typescript/commonjs/ChatSheet.d.ts +21 -0
  129. package/lib/typescript/commonjs/ChatStarters.d.ts +12 -0
  130. package/lib/typescript/commonjs/ChatThread.d.ts +36 -0
  131. package/lib/typescript/commonjs/ReadAloudButton.d.ts +11 -0
  132. package/lib/typescript/commonjs/chatShared.d.ts +4 -0
  133. package/lib/typescript/commonjs/index.d.ts +27 -21
  134. package/lib/typescript/commonjs/loaders/ChatLoader.d.ts +13 -0
  135. package/lib/typescript/commonjs/loaders/OrbLoader.d.ts +8 -0
  136. package/lib/typescript/commonjs/loaders/PhrasesLoader.d.ts +8 -0
  137. package/lib/typescript/commonjs/loaders/SkeletonLoader.d.ts +8 -0
  138. package/lib/typescript/commonjs/loaders/StepsLoader.d.ts +8 -0
  139. package/lib/typescript/commonjs/loaders/TypingPill.d.ts +7 -0
  140. package/lib/typescript/commonjs/pushOpen.d.ts +3 -0
  141. package/lib/typescript/commonjs/renderers/ActionPart.d.ts +3 -0
  142. package/lib/typescript/commonjs/renderers/ChartPart.d.ts +8 -0
  143. package/lib/typescript/commonjs/renderers/FigureText.d.ts +23 -0
  144. package/lib/typescript/commonjs/renderers/FiguresPart.d.ts +8 -0
  145. package/lib/typescript/commonjs/renderers/FilePart.d.ts +3 -0
  146. package/lib/typescript/commonjs/renderers/HandoffPart.d.ts +9 -0
  147. package/lib/typescript/commonjs/renderers/ImagePart.d.ts +8 -0
  148. package/lib/typescript/commonjs/renderers/InputRequestPart.d.ts +3 -0
  149. package/lib/typescript/commonjs/renderers/NoticePart.d.ts +8 -0
  150. package/lib/typescript/commonjs/renderers/QuickRepliesPart.d.ts +8 -0
  151. package/lib/typescript/commonjs/renderers/RecordCardPart.d.ts +8 -0
  152. package/lib/typescript/commonjs/renderers/SourcesPart.d.ts +8 -0
  153. package/lib/typescript/commonjs/renderers/TablePart.d.ts +8 -0
  154. package/lib/typescript/commonjs/renderers/TextPart.d.ts +8 -0
  155. package/lib/typescript/commonjs/renderers/TicketPart.d.ts +9 -0
  156. package/lib/typescript/commonjs/renderers/VoiceClipPart.d.ts +9 -0
  157. package/lib/typescript/commonjs/renderers/index.d.ts +3 -0
  158. package/lib/typescript/commonjs/speech/azureSpeech.d.ts +25 -0
  159. package/lib/typescript/commonjs/speech/expoAudio.d.ts +23 -0
  160. package/lib/typescript/commonjs/speech/phoneSpeech.d.ts +16 -0
  161. package/lib/typescript/commonjs/speech/speechText.d.ts +16 -0
  162. package/lib/typescript/commonjs/types.d.ts +29 -0
  163. package/lib/typescript/commonjs/useChat.d.ts +40 -10
  164. package/lib/typescript/commonjs/useChatHaptics.d.ts +3 -0
  165. package/lib/typescript/commonjs/useChatSound.d.ts +35 -0
  166. package/lib/typescript/commonjs/useChatSpeech.d.ts +4 -0
  167. package/lib/typescript/commonjs/useTranscriptActions.d.ts +10 -0
  168. package/lib/typescript/module/AgentByline.d.ts +9 -0
  169. package/lib/typescript/module/ChatComposer.d.ts +15 -0
  170. package/lib/typescript/module/ChatConversationActions.d.ts +10 -0
  171. package/lib/typescript/module/ChatDictationButton.d.ts +19 -0
  172. package/lib/typescript/module/ChatEmbed.d.ts +11 -0
  173. package/lib/typescript/module/ChatEntrance.d.ts +8 -0
  174. package/lib/typescript/module/ChatFooter.d.ts +9 -0
  175. package/lib/typescript/module/ChatFrame.d.ts +45 -0
  176. package/lib/typescript/module/ChatHistory.d.ts +11 -0
  177. package/lib/typescript/module/ChatLiveBar.d.ts +11 -0
  178. package/lib/typescript/module/ChatMessageActions.d.ts +15 -0
  179. package/lib/typescript/module/ChatNudge.d.ts +14 -0
  180. package/lib/typescript/module/ChatOpenTickets.d.ts +12 -0
  181. package/lib/typescript/module/ChatPastChats.d.ts +21 -0
  182. package/lib/typescript/module/ChatScreen.d.ts +5 -0
  183. package/lib/typescript/module/ChatSheet.d.ts +21 -0
  184. package/lib/typescript/module/ChatStarters.d.ts +12 -0
  185. package/lib/typescript/module/ChatThread.d.ts +36 -0
  186. package/lib/typescript/module/ReadAloudButton.d.ts +11 -0
  187. package/lib/typescript/module/chatShared.d.ts +4 -0
  188. package/lib/typescript/module/index.d.ts +27 -21
  189. package/lib/typescript/module/loaders/ChatLoader.d.ts +13 -0
  190. package/lib/typescript/module/loaders/OrbLoader.d.ts +8 -0
  191. package/lib/typescript/module/loaders/PhrasesLoader.d.ts +8 -0
  192. package/lib/typescript/module/loaders/SkeletonLoader.d.ts +8 -0
  193. package/lib/typescript/module/loaders/StepsLoader.d.ts +8 -0
  194. package/lib/typescript/module/loaders/TypingPill.d.ts +7 -0
  195. package/lib/typescript/module/pushOpen.d.ts +3 -0
  196. package/lib/typescript/module/renderers/ActionPart.d.ts +3 -0
  197. package/lib/typescript/module/renderers/ChartPart.d.ts +8 -0
  198. package/lib/typescript/module/renderers/FigureText.d.ts +23 -0
  199. package/lib/typescript/module/renderers/FiguresPart.d.ts +8 -0
  200. package/lib/typescript/module/renderers/FilePart.d.ts +3 -0
  201. package/lib/typescript/module/renderers/HandoffPart.d.ts +9 -0
  202. package/lib/typescript/module/renderers/ImagePart.d.ts +8 -0
  203. package/lib/typescript/module/renderers/InputRequestPart.d.ts +3 -0
  204. package/lib/typescript/module/renderers/NoticePart.d.ts +8 -0
  205. package/lib/typescript/module/renderers/QuickRepliesPart.d.ts +8 -0
  206. package/lib/typescript/module/renderers/RecordCardPart.d.ts +8 -0
  207. package/lib/typescript/module/renderers/SourcesPart.d.ts +8 -0
  208. package/lib/typescript/module/renderers/TablePart.d.ts +8 -0
  209. package/lib/typescript/module/renderers/TextPart.d.ts +8 -0
  210. package/lib/typescript/module/renderers/TicketPart.d.ts +9 -0
  211. package/lib/typescript/module/renderers/VoiceClipPart.d.ts +9 -0
  212. package/lib/typescript/module/renderers/index.d.ts +3 -0
  213. package/lib/typescript/module/speech/azureSpeech.d.ts +25 -0
  214. package/lib/typescript/module/speech/expoAudio.d.ts +23 -0
  215. package/lib/typescript/module/speech/phoneSpeech.d.ts +16 -0
  216. package/lib/typescript/module/speech/speechText.d.ts +16 -0
  217. package/lib/typescript/module/types.d.ts +29 -0
  218. package/lib/typescript/module/useChat.d.ts +40 -10
  219. package/lib/typescript/module/useChatHaptics.d.ts +3 -0
  220. package/lib/typescript/module/useChatSound.d.ts +35 -0
  221. package/lib/typescript/module/useChatSpeech.d.ts +4 -0
  222. package/lib/typescript/module/useTranscriptActions.d.ts +10 -0
  223. package/package.json +43 -15
  224. package/README.md +0 -185
  225. package/lib/commonjs/components/ActionCard.js +0 -1
  226. package/lib/commonjs/components/ChatComposer.js +0 -1
  227. package/lib/commonjs/components/ChatConversationList.js +0 -1
  228. package/lib/commonjs/components/ChatLauncher.js +0 -1
  229. package/lib/commonjs/components/ChatMarkdown.js +0 -1
  230. package/lib/commonjs/components/ChatMessage.js +0 -1
  231. package/lib/commonjs/components/ChatScreen.js +0 -1
  232. package/lib/commonjs/components/ChatThread.js +0 -1
  233. package/lib/commonjs/components/ComposerAttachments.js +0 -1
  234. package/lib/commonjs/components/ReplyRating.js +0 -1
  235. package/lib/module/components/ActionCard.js +0 -1
  236. package/lib/module/components/ChatComposer.js +0 -1
  237. package/lib/module/components/ChatConversationList.js +0 -1
  238. package/lib/module/components/ChatLauncher.js +0 -1
  239. package/lib/module/components/ChatMarkdown.js +0 -1
  240. package/lib/module/components/ChatMessage.js +0 -1
  241. package/lib/module/components/ChatScreen.js +0 -1
  242. package/lib/module/components/ChatThread.js +0 -1
  243. package/lib/module/components/ComposerAttachments.js +0 -1
  244. package/lib/module/components/ReplyRating.js +0 -1
  245. package/lib/typescript/commonjs/components/ActionCard.d.ts +0 -23
  246. package/lib/typescript/commonjs/components/ChatComposer.d.ts +0 -42
  247. package/lib/typescript/commonjs/components/ChatConversationList.d.ts +0 -22
  248. package/lib/typescript/commonjs/components/ChatLauncher.d.ts +0 -22
  249. package/lib/typescript/commonjs/components/ChatMarkdown.d.ts +0 -24
  250. package/lib/typescript/commonjs/components/ChatMessage.d.ts +0 -55
  251. package/lib/typescript/commonjs/components/ChatScreen.d.ts +0 -40
  252. package/lib/typescript/commonjs/components/ChatThread.d.ts +0 -30
  253. package/lib/typescript/commonjs/components/ComposerAttachments.d.ts +0 -12
  254. package/lib/typescript/commonjs/components/ReplyRating.d.ts +0 -19
  255. package/lib/typescript/module/components/ActionCard.d.ts +0 -23
  256. package/lib/typescript/module/components/ChatComposer.d.ts +0 -42
  257. package/lib/typescript/module/components/ChatConversationList.d.ts +0 -22
  258. package/lib/typescript/module/components/ChatLauncher.d.ts +0 -22
  259. package/lib/typescript/module/components/ChatMarkdown.d.ts +0 -24
  260. package/lib/typescript/module/components/ChatMessage.d.ts +0 -55
  261. package/lib/typescript/module/components/ChatScreen.d.ts +0 -40
  262. package/lib/typescript/module/components/ChatThread.d.ts +0 -30
  263. package/lib/typescript/module/components/ComposerAttachments.d.ts +0 -12
  264. package/lib/typescript/module/components/ReplyRating.d.ts +0 -19
@@ -0,0 +1,8 @@
1
+ import { type ChatPart } from "@webority/chat-core";
2
+ import type { ChatPartRendererProps } from "../types.js";
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;
7
+ export {};
8
+ //# sourceMappingURL=ChartPart.d.ts.map
@@ -0,0 +1,23 @@
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
+ heading?: boolean;
14
+ }
15
+ export interface FigureTextProps extends Omit<FigureRunsProps, "runs"> {
16
+ text: string;
17
+ enabled?: boolean;
18
+ }
19
+ export declare function runsToText(runs: readonly ChatFigureRun[]): string;
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;
22
+ export {};
23
+ //# sourceMappingURL=FigureText.d.ts.map
@@ -0,0 +1,8 @@
1
+ import { type ChatPart } from "@webority/chat-core";
2
+ import type { ChatPartRendererProps } from "../types.js";
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,3 @@
1
+ import type { ChatPartRendererProps } from "../types.js";
2
+ export declare function FilePart(props: ChatPartRendererProps): import("react").JSX.Element;
3
+ //# sourceMappingURL=FilePart.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.js";
4
+ type HandoffView = Extract<ChatPart, {
5
+ kind: "Handoff";
6
+ }>;
7
+ export declare function HandoffPart({ part, turn }: ChatPartRendererProps<HandoffView>): React.ReactElement | null;
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.js";
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,3 @@
1
+ import type { ChatPartRendererProps } from "../types.js";
2
+ export declare function InputRequestPart(props: ChatPartRendererProps): import("react").JSX.Element;
3
+ //# sourceMappingURL=InputRequestPart.d.ts.map
@@ -0,0 +1,8 @@
1
+ import type { ChatPart } from "@webority/chat-core";
2
+ import type { ChatPartRendererProps } from "../types.js";
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.js";
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.js";
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.js";
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.js";
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.js";
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.js";
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.js";
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,3 @@
1
+ import type { ChatRenderers } from "../types.js";
2
+ export declare const defaultRenderers: ChatRenderers;
3
+ //# sourceMappingURL=index.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 = 6000;
4
+ export declare const MAX_DICTATION_MS = 300000;
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 within the limit, 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,29 @@
1
+ import type { ChatLiveMessage, ChatPart, ChatPartKind, ChatTurnApi, ChatUploadFile } from "@webority/chat-core";
2
+ import type React from "react";
3
+ import type { View } from "react-native";
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
+ }
12
+ export type ChatPartRendererProps<P extends ChatPart = ChatPart> = {
13
+ part: P;
14
+ message: ChatLiveMessage;
15
+ turn: ChatTurnApi & ChatTurnHostApi;
16
+ pickAttachments?: () => Promise<ChatUploadFile[]>;
17
+ };
18
+ export type ChatRenderers = Partial<{
19
+ [K in ChatPartKind]: React.ComponentType<ChatPartRendererProps<Extract<ChatPart, {
20
+ kind: K;
21
+ }>>>;
22
+ }>;
23
+ export type ChatLayoutParts = (message: ChatLiveMessage) => Array<ChatPart | ChatPart[]>;
24
+ export interface ChatTicketRef {
25
+ ticketId: string;
26
+ number: string;
27
+ }
28
+ export type ChatOpenTicketHandler = (ticket: ChatTicketRef) => void;
29
+ //# sourceMappingURL=types.d.ts.map
@@ -1,19 +1,49 @@
1
- import type { ChatClient, ChatSession, ChatSessionState } from "@webority/markdown-core/chat";
2
- export type { ChatTurn, ChatTurnError } from "@webority/markdown-core/chat";
1
+ import type { ChatBehaviour, ChatClient, ChatFeature, ChatSession, ChatSessionState } from "@webority/chat-core";
2
+ import type { ChatLayout } from "./ChatFrame.js";
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
- /** Sent with each question; read at the moment of sending. */
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" | "refreshAllowance" | "reset">;
10
- export type UseChatResult = ChatSessionState & ChatActions & {
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
+ /** The message of the last hand-off request that failed, cleared by the next request. */
37
+ handoffError: string | null;
38
+ /** Present only when the host passed `onNavigate`; the turn API of each message hands relative links to it. */
39
+ onNavigate?: (path: string) => void;
40
+ }
13
41
  /**
14
42
  * The chat's state and actions. The session lives in the component that calls it: one per client,
15
- * disposed when the client changes or the component unmounts. Call `reset()` when the signed-in
16
- * person or account changes so nothing of one person's chat shows to the next.
43
+ * screen and narrowing, created in a mount effect (StrictMode runs effects twice and a disposed session never
44
+ * loads again) and disposed when those change or the component unmounts. Until it exists the state is idle and
45
+ * the actions do nothing. Call `reset()` when the signed-in person changes so nothing of one person's chat shows to the next.
17
46
  */
18
- export declare const useChat: ({ client, pageContext }: UseChatOptions) => UseChatResult;
47
+ export declare function useChat(options: UseChatOptions): UseChatResult;
48
+ export {};
19
49
  //# sourceMappingURL=useChat.d.ts.map
@@ -0,0 +1,3 @@
1
+ import type { UseChatResult } from "./useChat.js";
2
+ export declare function useChatHaptics(chat: UseChatResult): void;
3
+ //# sourceMappingURL=useChatHaptics.d.ts.map
@@ -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
@@ -0,0 +1,4 @@
1
+ import type { ChatSpeechAdapter } from "@webority/chat-core";
2
+ import type { UseChatResult } from "./useChat.js";
3
+ export declare function useChatSpeech(chat: UseChatResult): ChatSpeechAdapter | null;
4
+ //# sourceMappingURL=useChatSpeech.d.ts.map
@@ -0,0 +1,10 @@
1
+ import { type ChatLabels, type ChatLiveMessage } from "@webority/chat-core";
2
+ import type { UseChatResult } from "./useChat.js";
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
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@webority/mobile-chat",
3
- "version": "0.128.0",
4
- "description": "AI assistant chat for Webority React Native apps: a streaming chat client, a store-agnostic chat hook, and the chat screen, thread, composer, past chats, reply rating and support action cards, built on @webority/mobile-ui.",
3
+ "version": "0.134.0",
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",
7
7
  "chat",
@@ -41,19 +41,26 @@
41
41
  "!**/*.spec.*",
42
42
  "!**/*.map"
43
43
  ],
44
- "dependencies": {
45
- "@webority/markdown-core": "0.128.0"
46
- },
47
44
  "peerDependencies": {
48
- "@webority/mobile-core": "0.128.0",
49
- "@webority/mobile-ui": "0.128.0",
50
- "expo-clipboard": ">=57.0.0",
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",
49
+ "expo-audio": ">=57.0.0",
50
+ "expo-file-system": ">=57.0.0",
51
51
  "react": "^19.1.0",
52
52
  "react-native": ">=0.81.0",
53
53
  "react-native-keyboard-controller": ">=1.21.9",
54
54
  "react-native-safe-area-context": ">=5.4.0"
55
55
  },
56
- "peerDependenciesMeta": {},
56
+ "peerDependenciesMeta": {
57
+ "expo-audio": {
58
+ "optional": true
59
+ },
60
+ "expo-file-system": {
61
+ "optional": true
62
+ }
63
+ },
57
64
  "publishConfig": {
58
65
  "access": "public",
59
66
  "registry": "https://registry.npmjs.org/"
@@ -85,25 +92,46 @@
85
92
  ]
86
93
  },
87
94
  "devDependencies": {
95
+ "@react-native/babel-preset": "0.86.3",
96
+ "@react-native/jest-preset": "0.86.3",
88
97
  "@react-native/metro-config": "0.86.3",
89
98
  "@testing-library/react-native": "12.9.0",
90
99
  "@types/react": "19.2.18",
91
- "@webority/mobile-core": "0.128.0",
92
- "@webority/mobile-dev": "0.0.0",
93
- "@webority/mobile-ui": "0.128.0",
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",
105
+ "babel-jest": "29.7.0",
106
+ "expo": "57.0.31",
107
+ "expo-application": "57.0.3",
108
+ "expo-audio": "57.0.5",
109
+ "expo-clipboard": "57.0.2",
110
+ "expo-crypto": "57.0.4",
111
+ "expo-file-system": "57.0.7",
112
+ "expo-haptics": "57.0.3",
113
+ "expo-image": "57.0.5",
114
+ "expo-network": "57.0.3",
115
+ "expo-secure-store": "57.0.4",
116
+ "expo-sqlite": "57.0.4",
94
117
  "jest": "29.7.0",
95
118
  "react": "19.2.8",
119
+ "react-hook-form": "7.89.0",
96
120
  "react-native": "0.86.3",
97
121
  "react-native-builder-bob": "0.43.0",
122
+ "react-native-gesture-handler": "3.2.1",
98
123
  "react-native-keyboard-controller": "1.21.9",
124
+ "react-native-reanimated": "4.5.3",
99
125
  "react-native-safe-area-context": "5.9.1",
126
+ "react-native-svg": "15.15.5",
127
+ "react-native-worklets": "0.10.4",
100
128
  "react-test-renderer": "19.2.8",
101
- "rimraf": "6.1.3",
129
+ "terser": "5.49.1",
102
130
  "typescript": "5.9.3"
103
131
  },
104
132
  "scripts": {
105
- "build": "bob build && node ../mobile-dev/scripts/minify-lib.mjs",
106
- "clean": "rimraf lib",
133
+ "build": "bob build && node ../../scripts/minify-lib.mjs",
134
+ "clean": "node -e \"require('node:fs').rmSync('lib',{recursive:true,force:true})\"",
107
135
  "lint": "biome lint ./src",
108
136
  "lint:fix": "biome lint --write ./src",
109
137
  "test": "jest",