stream-chat-react-native-core 9.9.4 → 9.10.0-beta.1

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 (714) hide show
  1. package/ai-components/package.json +6 -0
  2. package/lib/commonjs/ai-components/AITypingIndicatorView.js +49 -0
  3. package/lib/commonjs/ai-components/AITypingIndicatorView.js.map +1 -0
  4. package/lib/commonjs/ai-components/README.md +279 -0
  5. package/lib/commonjs/ai-components/StreamingMessageView.js +75 -0
  6. package/lib/commonjs/ai-components/StreamingMessageView.js.map +1 -0
  7. package/lib/commonjs/ai-components/charts/Chart.js +25 -0
  8. package/lib/commonjs/ai-components/charts/Chart.js.map +1 -0
  9. package/lib/commonjs/ai-components/charts/components/PieLegend.js +54 -0
  10. package/lib/commonjs/ai-components/charts/components/PieLegend.js.map +1 -0
  11. package/lib/commonjs/ai-components/charts/components/VictoryChart.js +183 -0
  12. package/lib/commonjs/ai-components/charts/components/VictoryChart.js.map +1 -0
  13. package/lib/commonjs/ai-components/charts/components/index.js +26 -0
  14. package/lib/commonjs/ai-components/charts/components/index.js.map +1 -0
  15. package/lib/commonjs/ai-components/charts/index.js +70 -0
  16. package/lib/commonjs/ai-components/charts/index.js.map +1 -0
  17. package/lib/commonjs/ai-components/charts/mermaid/index.js +15 -0
  18. package/lib/commonjs/ai-components/charts/mermaid/index.js.map +1 -0
  19. package/lib/commonjs/ai-components/charts/mermaid/parser.js +45 -0
  20. package/lib/commonjs/ai-components/charts/mermaid/parser.js.map +1 -0
  21. package/lib/commonjs/ai-components/charts/types.js +2 -0
  22. package/lib/commonjs/ai-components/charts/types.js.map +1 -0
  23. package/lib/commonjs/ai-components/charts/utils/generate-pie-colors.js +68 -0
  24. package/lib/commonjs/ai-components/charts/utils/generate-pie-colors.js.map +1 -0
  25. package/lib/commonjs/ai-components/charts/utils/index.js +26 -0
  26. package/lib/commonjs/ai-components/charts/utils/index.js.map +1 -0
  27. package/lib/commonjs/ai-components/charts/utils/parse-json-chart.js +15 -0
  28. package/lib/commonjs/ai-components/charts/utils/parse-json-chart.js.map +1 -0
  29. package/lib/commonjs/ai-components/charts/vega-lite/index.js +26 -0
  30. package/lib/commonjs/ai-components/charts/vega-lite/index.js.map +1 -0
  31. package/lib/commonjs/ai-components/charts/vega-lite/parser.js +54 -0
  32. package/lib/commonjs/ai-components/charts/vega-lite/parser.js.map +1 -0
  33. package/lib/commonjs/ai-components/charts/vega-lite/schema.js +82 -0
  34. package/lib/commonjs/ai-components/charts/vega-lite/schema.js.map +1 -0
  35. package/lib/commonjs/ai-components/components/BottomSheet.js +182 -0
  36. package/lib/commonjs/ai-components/components/BottomSheet.js.map +1 -0
  37. package/lib/commonjs/ai-components/components/MarkdownReactiveScrollView.js +81 -0
  38. package/lib/commonjs/ai-components/components/MarkdownReactiveScrollView.js.map +1 -0
  39. package/lib/commonjs/ai-components/components/index.js +26 -0
  40. package/lib/commonjs/ai-components/components/index.js.map +1 -0
  41. package/lib/commonjs/ai-components/contexts/composer-context.js +68 -0
  42. package/lib/commonjs/ai-components/contexts/composer-context.js.map +1 -0
  43. package/lib/commonjs/ai-components/contexts/index.js +26 -0
  44. package/lib/commonjs/ai-components/contexts/index.js.map +1 -0
  45. package/lib/commonjs/ai-components/contexts/theme-context.js +53 -0
  46. package/lib/commonjs/ai-components/contexts/theme-context.js.map +1 -0
  47. package/lib/commonjs/ai-components/index.js +166 -0
  48. package/lib/commonjs/ai-components/index.js.map +1 -0
  49. package/lib/commonjs/ai-components/internal/hooks/useStableCallback.js +14 -0
  50. package/lib/commonjs/ai-components/internal/hooks/useStableCallback.js.map +1 -0
  51. package/lib/commonjs/ai-components/internal/icons/Camera.js +18 -0
  52. package/lib/commonjs/ai-components/internal/icons/Camera.js.map +1 -0
  53. package/lib/commonjs/ai-components/internal/icons/CircleStop.js +24 -0
  54. package/lib/commonjs/ai-components/internal/icons/CircleStop.js.map +1 -0
  55. package/lib/commonjs/ai-components/internal/icons/Close.js +18 -0
  56. package/lib/commonjs/ai-components/internal/icons/Close.js.map +1 -0
  57. package/lib/commonjs/ai-components/internal/icons/Mic.js +27 -0
  58. package/lib/commonjs/ai-components/internal/icons/Mic.js.map +1 -0
  59. package/lib/commonjs/ai-components/internal/icons/Picture.js +21 -0
  60. package/lib/commonjs/ai-components/internal/icons/Picture.js.map +1 -0
  61. package/lib/commonjs/ai-components/internal/icons/SendUp.js +28 -0
  62. package/lib/commonjs/ai-components/internal/icons/SendUp.js.map +1 -0
  63. package/lib/commonjs/ai-components/internal/icons/utils/base.js +42 -0
  64. package/lib/commonjs/ai-components/internal/icons/utils/base.js.map +1 -0
  65. package/lib/commonjs/ai-components/markdown/components/Autolink.js +37 -0
  66. package/lib/commonjs/ai-components/markdown/components/Autolink.js.map +1 -0
  67. package/lib/commonjs/ai-components/markdown/components/BlockQuote.js +37 -0
  68. package/lib/commonjs/ai-components/markdown/components/BlockQuote.js.map +1 -0
  69. package/lib/commonjs/ai-components/markdown/components/Bold.js +32 -0
  70. package/lib/commonjs/ai-components/markdown/components/Bold.js.map +1 -0
  71. package/lib/commonjs/ai-components/markdown/components/CodeBlock.js +114 -0
  72. package/lib/commonjs/ai-components/markdown/components/CodeBlock.js.map +1 -0
  73. package/lib/commonjs/ai-components/markdown/components/Emphasis.js +32 -0
  74. package/lib/commonjs/ai-components/markdown/components/Emphasis.js.map +1 -0
  75. package/lib/commonjs/ai-components/markdown/components/Heading.js +41 -0
  76. package/lib/commonjs/ai-components/markdown/components/Heading.js.map +1 -0
  77. package/lib/commonjs/ai-components/markdown/components/HorizontalRule.js +26 -0
  78. package/lib/commonjs/ai-components/markdown/components/HorizontalRule.js.map +1 -0
  79. package/lib/commonjs/ai-components/markdown/components/InlineCode.js +32 -0
  80. package/lib/commonjs/ai-components/markdown/components/InlineCode.js.map +1 -0
  81. package/lib/commonjs/ai-components/markdown/components/LineBreak.js +27 -0
  82. package/lib/commonjs/ai-components/markdown/components/LineBreak.js.map +1 -0
  83. package/lib/commonjs/ai-components/markdown/components/Link.js +41 -0
  84. package/lib/commonjs/ai-components/markdown/components/Link.js.map +1 -0
  85. package/lib/commonjs/ai-components/markdown/components/List.js +85 -0
  86. package/lib/commonjs/ai-components/markdown/components/List.js.map +1 -0
  87. package/lib/commonjs/ai-components/markdown/components/Mailto.js +37 -0
  88. package/lib/commonjs/ai-components/markdown/components/Mailto.js.map +1 -0
  89. package/lib/commonjs/ai-components/markdown/components/Markdown.js +49 -0
  90. package/lib/commonjs/ai-components/markdown/components/Markdown.js.map +1 -0
  91. package/lib/commonjs/ai-components/markdown/components/NewLine.js +27 -0
  92. package/lib/commonjs/ai-components/markdown/components/NewLine.js.map +1 -0
  93. package/lib/commonjs/ai-components/markdown/components/Paragraph.js +72 -0
  94. package/lib/commonjs/ai-components/markdown/components/Paragraph.js.map +1 -0
  95. package/lib/commonjs/ai-components/markdown/components/Strikethrough.js +32 -0
  96. package/lib/commonjs/ai-components/markdown/components/Strikethrough.js.map +1 -0
  97. package/lib/commonjs/ai-components/markdown/components/Table.js +105 -0
  98. package/lib/commonjs/ai-components/markdown/components/Table.js.map +1 -0
  99. package/lib/commonjs/ai-components/markdown/components/Text.js +45 -0
  100. package/lib/commonjs/ai-components/markdown/components/Text.js.map +1 -0
  101. package/lib/commonjs/ai-components/markdown/components/Url.js +37 -0
  102. package/lib/commonjs/ai-components/markdown/components/Url.js.map +1 -0
  103. package/lib/commonjs/ai-components/markdown/components/index.js +213 -0
  104. package/lib/commonjs/ai-components/markdown/components/index.js.map +1 -0
  105. package/lib/commonjs/ai-components/markdown/index.js +59 -0
  106. package/lib/commonjs/ai-components/markdown/index.js.map +1 -0
  107. package/lib/commonjs/ai-components/markdown/rules.js +152 -0
  108. package/lib/commonjs/ai-components/markdown/rules.js.map +1 -0
  109. package/lib/commonjs/ai-components/markdown/styles.js +240 -0
  110. package/lib/commonjs/ai-components/markdown/styles.js.map +1 -0
  111. package/lib/commonjs/ai-components/markdown/types.js +4 -0
  112. package/lib/commonjs/ai-components/markdown/types.js.map +1 -0
  113. package/lib/commonjs/ai-components/markdown/utils/generate-markdown-text.js +73 -0
  114. package/lib/commonjs/ai-components/markdown/utils/generate-markdown-text.js.map +1 -0
  115. package/lib/commonjs/ai-components/markdown/utils/index.js +15 -0
  116. package/lib/commonjs/ai-components/markdown/utils/index.js.map +1 -0
  117. package/lib/commonjs/ai-components/message-composer/ActionButton.js +104 -0
  118. package/lib/commonjs/ai-components/message-composer/ActionButton.js.map +1 -0
  119. package/lib/commonjs/ai-components/message-composer/ActionSheet.js +197 -0
  120. package/lib/commonjs/ai-components/message-composer/ActionSheet.js.map +1 -0
  121. package/lib/commonjs/ai-components/message-composer/AttachmentButton.js +55 -0
  122. package/lib/commonjs/ai-components/message-composer/AttachmentButton.js.map +1 -0
  123. package/lib/commonjs/ai-components/message-composer/ComposerView.js +151 -0
  124. package/lib/commonjs/ai-components/message-composer/ComposerView.js.map +1 -0
  125. package/lib/commonjs/ai-components/message-composer/MediaPreviewList.js +84 -0
  126. package/lib/commonjs/ai-components/message-composer/MediaPreviewList.js.map +1 -0
  127. package/lib/commonjs/ai-components/message-composer/SpeechToTextButton.js +82 -0
  128. package/lib/commonjs/ai-components/message-composer/SpeechToTextButton.js.map +1 -0
  129. package/lib/commonjs/ai-components/message-composer/index.js +59 -0
  130. package/lib/commonjs/ai-components/message-composer/index.js.map +1 -0
  131. package/lib/commonjs/ai-components/message-composer/utils/withCloseSheet.js +16 -0
  132. package/lib/commonjs/ai-components/message-composer/utils/withCloseSheet.js.map +1 -0
  133. package/lib/commonjs/ai-components/native/AIDictation.js +60 -0
  134. package/lib/commonjs/ai-components/native/AIDictation.js.map +1 -0
  135. package/lib/commonjs/ai-components/native/PerfText.js +31 -0
  136. package/lib/commonjs/ai-components/native/PerfText.js.map +1 -0
  137. package/lib/commonjs/ai-components/native-specs/NativeAIDictation.js +7 -0
  138. package/lib/commonjs/ai-components/native-specs/NativeAIDictation.js.map +1 -0
  139. package/lib/commonjs/ai-components/services/clipboard-service/expo.js +13 -0
  140. package/lib/commonjs/ai-components/services/clipboard-service/expo.js.map +1 -0
  141. package/lib/commonjs/ai-components/services/clipboard-service/index.js +8 -0
  142. package/lib/commonjs/ai-components/services/clipboard-service/index.js.map +1 -0
  143. package/lib/commonjs/ai-components/services/clipboard-service/rncli.js +10 -0
  144. package/lib/commonjs/ai-components/services/clipboard-service/rncli.js.map +1 -0
  145. package/lib/commonjs/ai-components/services/index.js +26 -0
  146. package/lib/commonjs/ai-components/services/index.js.map +1 -0
  147. package/lib/commonjs/ai-components/services/media-picker-service/AbstractMediaPickerService.js +31 -0
  148. package/lib/commonjs/ai-components/services/media-picker-service/AbstractMediaPickerService.js.map +1 -0
  149. package/lib/commonjs/ai-components/services/media-picker-service/expo.js +169 -0
  150. package/lib/commonjs/ai-components/services/media-picker-service/expo.js.map +1 -0
  151. package/lib/commonjs/ai-components/services/media-picker-service/hooks/useMediaPickerState.js +14 -0
  152. package/lib/commonjs/ai-components/services/media-picker-service/hooks/useMediaPickerState.js.map +1 -0
  153. package/lib/commonjs/ai-components/services/media-picker-service/index.js +8 -0
  154. package/lib/commonjs/ai-components/services/media-picker-service/index.js.map +1 -0
  155. package/lib/commonjs/ai-components/services/media-picker-service/optional-modules.d.js +2 -0
  156. package/lib/commonjs/ai-components/services/media-picker-service/optional-modules.d.js.map +1 -0
  157. package/lib/commonjs/ai-components/services/media-picker-service/rncli.js +162 -0
  158. package/lib/commonjs/ai-components/services/media-picker-service/rncli.js.map +1 -0
  159. package/lib/commonjs/ai-components/store/bottom-sheet/store.js +27 -0
  160. package/lib/commonjs/ai-components/store/bottom-sheet/store.js.map +1 -0
  161. package/lib/commonjs/ai-components/store/bottom-sheet/useBottomSheetState.js +16 -0
  162. package/lib/commonjs/ai-components/store/bottom-sheet/useBottomSheetState.js.map +1 -0
  163. package/lib/commonjs/ai-components/store/composer/store.js +11 -0
  164. package/lib/commonjs/ai-components/store/composer/store.js.map +1 -0
  165. package/lib/commonjs/ai-components/store/composer/useComposerHasText.js +18 -0
  166. package/lib/commonjs/ai-components/store/composer/useComposerHasText.js.map +1 -0
  167. package/lib/commonjs/ai-components/store/composer/useComposerText.js +18 -0
  168. package/lib/commonjs/ai-components/store/composer/useComposerText.js.map +1 -0
  169. package/lib/commonjs/ai-components/store/dictation/store.js +17 -0
  170. package/lib/commonjs/ai-components/store/dictation/store.js.map +1 -0
  171. package/lib/commonjs/ai-components/store/dictation/useDictationState.js +18 -0
  172. package/lib/commonjs/ai-components/store/dictation/useDictationState.js.map +1 -0
  173. package/lib/commonjs/ai-components/store/dictation/useDictationTranscript.js +14 -0
  174. package/lib/commonjs/ai-components/store/dictation/useDictationTranscript.js.map +1 -0
  175. package/lib/commonjs/ai-components/store/index.js +70 -0
  176. package/lib/commonjs/ai-components/store/index.js.map +1 -0
  177. package/lib/commonjs/ai-components/syntax-highlighting/SyntaxHighlighter.js +51 -0
  178. package/lib/commonjs/ai-components/syntax-highlighting/SyntaxHighlighter.js.map +1 -0
  179. package/lib/commonjs/ai-components/syntax-highlighting/components/AndroidNativeRenderer.js +35 -0
  180. package/lib/commonjs/ai-components/syntax-highlighting/components/AndroidNativeRenderer.js.map +1 -0
  181. package/lib/commonjs/ai-components/syntax-highlighting/components/index.js +15 -0
  182. package/lib/commonjs/ai-components/syntax-highlighting/components/index.js.map +1 -0
  183. package/lib/commonjs/ai-components/syntax-highlighting/index.js +48 -0
  184. package/lib/commonjs/ai-components/syntax-highlighting/index.js.map +1 -0
  185. package/lib/commonjs/ai-components/syntax-highlighting/prism-config.js +7 -0
  186. package/lib/commonjs/ai-components/syntax-highlighting/prism-config.js.map +1 -0
  187. package/lib/commonjs/ai-components/syntax-highlighting/types.js +4 -0
  188. package/lib/commonjs/ai-components/syntax-highlighting/types.js.map +1 -0
  189. package/lib/commonjs/ai-components/syntax-highlighting/utils/converter.js +107 -0
  190. package/lib/commonjs/ai-components/syntax-highlighting/utils/converter.js.map +1 -0
  191. package/lib/commonjs/ai-components/syntax-highlighting/utils/flatten-nodes.js +139 -0
  192. package/lib/commonjs/ai-components/syntax-highlighting/utils/flatten-nodes.js.map +1 -0
  193. package/lib/commonjs/ai-components/syntax-highlighting/utils/index.js +37 -0
  194. package/lib/commonjs/ai-components/syntax-highlighting/utils/index.js.map +1 -0
  195. package/lib/commonjs/ai-components/syntax-highlighting/utils/renderer.js +117 -0
  196. package/lib/commonjs/ai-components/syntax-highlighting/utils/renderer.js.map +1 -0
  197. package/lib/commonjs/ai-components/theme.js +99 -0
  198. package/lib/commonjs/ai-components/theme.js.map +1 -0
  199. package/lib/commonjs/ai-components/transcription/useDictation.js +114 -0
  200. package/lib/commonjs/ai-components/transcription/useDictation.js.map +1 -0
  201. package/lib/commonjs/native.js +4 -0
  202. package/lib/commonjs/native.js.map +1 -1
  203. package/lib/commonjs/version.json +1 -1
  204. package/lib/module/ai-components/AITypingIndicatorView.js +49 -0
  205. package/lib/module/ai-components/AITypingIndicatorView.js.map +1 -0
  206. package/lib/module/ai-components/README.md +279 -0
  207. package/lib/module/ai-components/StreamingMessageView.js +75 -0
  208. package/lib/module/ai-components/StreamingMessageView.js.map +1 -0
  209. package/lib/module/ai-components/charts/Chart.js +25 -0
  210. package/lib/module/ai-components/charts/Chart.js.map +1 -0
  211. package/lib/module/ai-components/charts/components/PieLegend.js +54 -0
  212. package/lib/module/ai-components/charts/components/PieLegend.js.map +1 -0
  213. package/lib/module/ai-components/charts/components/VictoryChart.js +183 -0
  214. package/lib/module/ai-components/charts/components/VictoryChart.js.map +1 -0
  215. package/lib/module/ai-components/charts/components/index.js +26 -0
  216. package/lib/module/ai-components/charts/components/index.js.map +1 -0
  217. package/lib/module/ai-components/charts/index.js +70 -0
  218. package/lib/module/ai-components/charts/index.js.map +1 -0
  219. package/lib/module/ai-components/charts/mermaid/index.js +15 -0
  220. package/lib/module/ai-components/charts/mermaid/index.js.map +1 -0
  221. package/lib/module/ai-components/charts/mermaid/parser.js +45 -0
  222. package/lib/module/ai-components/charts/mermaid/parser.js.map +1 -0
  223. package/lib/module/ai-components/charts/types.js +2 -0
  224. package/lib/module/ai-components/charts/types.js.map +1 -0
  225. package/lib/module/ai-components/charts/utils/generate-pie-colors.js +68 -0
  226. package/lib/module/ai-components/charts/utils/generate-pie-colors.js.map +1 -0
  227. package/lib/module/ai-components/charts/utils/index.js +26 -0
  228. package/lib/module/ai-components/charts/utils/index.js.map +1 -0
  229. package/lib/module/ai-components/charts/utils/parse-json-chart.js +15 -0
  230. package/lib/module/ai-components/charts/utils/parse-json-chart.js.map +1 -0
  231. package/lib/module/ai-components/charts/vega-lite/index.js +26 -0
  232. package/lib/module/ai-components/charts/vega-lite/index.js.map +1 -0
  233. package/lib/module/ai-components/charts/vega-lite/parser.js +54 -0
  234. package/lib/module/ai-components/charts/vega-lite/parser.js.map +1 -0
  235. package/lib/module/ai-components/charts/vega-lite/schema.js +82 -0
  236. package/lib/module/ai-components/charts/vega-lite/schema.js.map +1 -0
  237. package/lib/module/ai-components/components/BottomSheet.js +182 -0
  238. package/lib/module/ai-components/components/BottomSheet.js.map +1 -0
  239. package/lib/module/ai-components/components/MarkdownReactiveScrollView.js +81 -0
  240. package/lib/module/ai-components/components/MarkdownReactiveScrollView.js.map +1 -0
  241. package/lib/module/ai-components/components/index.js +26 -0
  242. package/lib/module/ai-components/components/index.js.map +1 -0
  243. package/lib/module/ai-components/contexts/composer-context.js +68 -0
  244. package/lib/module/ai-components/contexts/composer-context.js.map +1 -0
  245. package/lib/module/ai-components/contexts/index.js +26 -0
  246. package/lib/module/ai-components/contexts/index.js.map +1 -0
  247. package/lib/module/ai-components/contexts/theme-context.js +53 -0
  248. package/lib/module/ai-components/contexts/theme-context.js.map +1 -0
  249. package/lib/module/ai-components/index.js +166 -0
  250. package/lib/module/ai-components/index.js.map +1 -0
  251. package/lib/module/ai-components/internal/hooks/useStableCallback.js +14 -0
  252. package/lib/module/ai-components/internal/hooks/useStableCallback.js.map +1 -0
  253. package/lib/module/ai-components/internal/icons/Camera.js +18 -0
  254. package/lib/module/ai-components/internal/icons/Camera.js.map +1 -0
  255. package/lib/module/ai-components/internal/icons/CircleStop.js +24 -0
  256. package/lib/module/ai-components/internal/icons/CircleStop.js.map +1 -0
  257. package/lib/module/ai-components/internal/icons/Close.js +18 -0
  258. package/lib/module/ai-components/internal/icons/Close.js.map +1 -0
  259. package/lib/module/ai-components/internal/icons/Mic.js +27 -0
  260. package/lib/module/ai-components/internal/icons/Mic.js.map +1 -0
  261. package/lib/module/ai-components/internal/icons/Picture.js +21 -0
  262. package/lib/module/ai-components/internal/icons/Picture.js.map +1 -0
  263. package/lib/module/ai-components/internal/icons/SendUp.js +28 -0
  264. package/lib/module/ai-components/internal/icons/SendUp.js.map +1 -0
  265. package/lib/module/ai-components/internal/icons/utils/base.js +42 -0
  266. package/lib/module/ai-components/internal/icons/utils/base.js.map +1 -0
  267. package/lib/module/ai-components/markdown/components/Autolink.js +37 -0
  268. package/lib/module/ai-components/markdown/components/Autolink.js.map +1 -0
  269. package/lib/module/ai-components/markdown/components/BlockQuote.js +37 -0
  270. package/lib/module/ai-components/markdown/components/BlockQuote.js.map +1 -0
  271. package/lib/module/ai-components/markdown/components/Bold.js +32 -0
  272. package/lib/module/ai-components/markdown/components/Bold.js.map +1 -0
  273. package/lib/module/ai-components/markdown/components/CodeBlock.js +114 -0
  274. package/lib/module/ai-components/markdown/components/CodeBlock.js.map +1 -0
  275. package/lib/module/ai-components/markdown/components/Emphasis.js +32 -0
  276. package/lib/module/ai-components/markdown/components/Emphasis.js.map +1 -0
  277. package/lib/module/ai-components/markdown/components/Heading.js +41 -0
  278. package/lib/module/ai-components/markdown/components/Heading.js.map +1 -0
  279. package/lib/module/ai-components/markdown/components/HorizontalRule.js +26 -0
  280. package/lib/module/ai-components/markdown/components/HorizontalRule.js.map +1 -0
  281. package/lib/module/ai-components/markdown/components/InlineCode.js +32 -0
  282. package/lib/module/ai-components/markdown/components/InlineCode.js.map +1 -0
  283. package/lib/module/ai-components/markdown/components/LineBreak.js +27 -0
  284. package/lib/module/ai-components/markdown/components/LineBreak.js.map +1 -0
  285. package/lib/module/ai-components/markdown/components/Link.js +41 -0
  286. package/lib/module/ai-components/markdown/components/Link.js.map +1 -0
  287. package/lib/module/ai-components/markdown/components/List.js +85 -0
  288. package/lib/module/ai-components/markdown/components/List.js.map +1 -0
  289. package/lib/module/ai-components/markdown/components/Mailto.js +37 -0
  290. package/lib/module/ai-components/markdown/components/Mailto.js.map +1 -0
  291. package/lib/module/ai-components/markdown/components/Markdown.js +49 -0
  292. package/lib/module/ai-components/markdown/components/Markdown.js.map +1 -0
  293. package/lib/module/ai-components/markdown/components/NewLine.js +27 -0
  294. package/lib/module/ai-components/markdown/components/NewLine.js.map +1 -0
  295. package/lib/module/ai-components/markdown/components/Paragraph.js +72 -0
  296. package/lib/module/ai-components/markdown/components/Paragraph.js.map +1 -0
  297. package/lib/module/ai-components/markdown/components/Strikethrough.js +32 -0
  298. package/lib/module/ai-components/markdown/components/Strikethrough.js.map +1 -0
  299. package/lib/module/ai-components/markdown/components/Table.js +105 -0
  300. package/lib/module/ai-components/markdown/components/Table.js.map +1 -0
  301. package/lib/module/ai-components/markdown/components/Text.js +45 -0
  302. package/lib/module/ai-components/markdown/components/Text.js.map +1 -0
  303. package/lib/module/ai-components/markdown/components/Url.js +37 -0
  304. package/lib/module/ai-components/markdown/components/Url.js.map +1 -0
  305. package/lib/module/ai-components/markdown/components/index.js +213 -0
  306. package/lib/module/ai-components/markdown/components/index.js.map +1 -0
  307. package/lib/module/ai-components/markdown/index.js +59 -0
  308. package/lib/module/ai-components/markdown/index.js.map +1 -0
  309. package/lib/module/ai-components/markdown/rules.js +152 -0
  310. package/lib/module/ai-components/markdown/rules.js.map +1 -0
  311. package/lib/module/ai-components/markdown/styles.js +240 -0
  312. package/lib/module/ai-components/markdown/styles.js.map +1 -0
  313. package/lib/module/ai-components/markdown/types.js +4 -0
  314. package/lib/module/ai-components/markdown/types.js.map +1 -0
  315. package/lib/module/ai-components/markdown/utils/generate-markdown-text.js +73 -0
  316. package/lib/module/ai-components/markdown/utils/generate-markdown-text.js.map +1 -0
  317. package/lib/module/ai-components/markdown/utils/index.js +15 -0
  318. package/lib/module/ai-components/markdown/utils/index.js.map +1 -0
  319. package/lib/module/ai-components/message-composer/ActionButton.js +104 -0
  320. package/lib/module/ai-components/message-composer/ActionButton.js.map +1 -0
  321. package/lib/module/ai-components/message-composer/ActionSheet.js +197 -0
  322. package/lib/module/ai-components/message-composer/ActionSheet.js.map +1 -0
  323. package/lib/module/ai-components/message-composer/AttachmentButton.js +55 -0
  324. package/lib/module/ai-components/message-composer/AttachmentButton.js.map +1 -0
  325. package/lib/module/ai-components/message-composer/ComposerView.js +151 -0
  326. package/lib/module/ai-components/message-composer/ComposerView.js.map +1 -0
  327. package/lib/module/ai-components/message-composer/MediaPreviewList.js +84 -0
  328. package/lib/module/ai-components/message-composer/MediaPreviewList.js.map +1 -0
  329. package/lib/module/ai-components/message-composer/SpeechToTextButton.js +82 -0
  330. package/lib/module/ai-components/message-composer/SpeechToTextButton.js.map +1 -0
  331. package/lib/module/ai-components/message-composer/index.js +59 -0
  332. package/lib/module/ai-components/message-composer/index.js.map +1 -0
  333. package/lib/module/ai-components/message-composer/utils/withCloseSheet.js +16 -0
  334. package/lib/module/ai-components/message-composer/utils/withCloseSheet.js.map +1 -0
  335. package/lib/module/ai-components/native/AIDictation.js +60 -0
  336. package/lib/module/ai-components/native/AIDictation.js.map +1 -0
  337. package/lib/module/ai-components/native/PerfText.js +31 -0
  338. package/lib/module/ai-components/native/PerfText.js.map +1 -0
  339. package/lib/module/ai-components/native-specs/NativeAIDictation.js +7 -0
  340. package/lib/module/ai-components/native-specs/NativeAIDictation.js.map +1 -0
  341. package/lib/module/ai-components/services/clipboard-service/expo.js +13 -0
  342. package/lib/module/ai-components/services/clipboard-service/expo.js.map +1 -0
  343. package/lib/module/ai-components/services/clipboard-service/index.js +8 -0
  344. package/lib/module/ai-components/services/clipboard-service/index.js.map +1 -0
  345. package/lib/module/ai-components/services/clipboard-service/rncli.js +10 -0
  346. package/lib/module/ai-components/services/clipboard-service/rncli.js.map +1 -0
  347. package/lib/module/ai-components/services/index.js +26 -0
  348. package/lib/module/ai-components/services/index.js.map +1 -0
  349. package/lib/module/ai-components/services/media-picker-service/AbstractMediaPickerService.js +31 -0
  350. package/lib/module/ai-components/services/media-picker-service/AbstractMediaPickerService.js.map +1 -0
  351. package/lib/module/ai-components/services/media-picker-service/expo.js +169 -0
  352. package/lib/module/ai-components/services/media-picker-service/expo.js.map +1 -0
  353. package/lib/module/ai-components/services/media-picker-service/hooks/useMediaPickerState.js +14 -0
  354. package/lib/module/ai-components/services/media-picker-service/hooks/useMediaPickerState.js.map +1 -0
  355. package/lib/module/ai-components/services/media-picker-service/index.js +8 -0
  356. package/lib/module/ai-components/services/media-picker-service/index.js.map +1 -0
  357. package/lib/module/ai-components/services/media-picker-service/optional-modules.d.js +2 -0
  358. package/lib/module/ai-components/services/media-picker-service/optional-modules.d.js.map +1 -0
  359. package/lib/module/ai-components/services/media-picker-service/rncli.js +162 -0
  360. package/lib/module/ai-components/services/media-picker-service/rncli.js.map +1 -0
  361. package/lib/module/ai-components/store/bottom-sheet/store.js +27 -0
  362. package/lib/module/ai-components/store/bottom-sheet/store.js.map +1 -0
  363. package/lib/module/ai-components/store/bottom-sheet/useBottomSheetState.js +16 -0
  364. package/lib/module/ai-components/store/bottom-sheet/useBottomSheetState.js.map +1 -0
  365. package/lib/module/ai-components/store/composer/store.js +11 -0
  366. package/lib/module/ai-components/store/composer/store.js.map +1 -0
  367. package/lib/module/ai-components/store/composer/useComposerHasText.js +18 -0
  368. package/lib/module/ai-components/store/composer/useComposerHasText.js.map +1 -0
  369. package/lib/module/ai-components/store/composer/useComposerText.js +18 -0
  370. package/lib/module/ai-components/store/composer/useComposerText.js.map +1 -0
  371. package/lib/module/ai-components/store/dictation/store.js +17 -0
  372. package/lib/module/ai-components/store/dictation/store.js.map +1 -0
  373. package/lib/module/ai-components/store/dictation/useDictationState.js +18 -0
  374. package/lib/module/ai-components/store/dictation/useDictationState.js.map +1 -0
  375. package/lib/module/ai-components/store/dictation/useDictationTranscript.js +14 -0
  376. package/lib/module/ai-components/store/dictation/useDictationTranscript.js.map +1 -0
  377. package/lib/module/ai-components/store/index.js +70 -0
  378. package/lib/module/ai-components/store/index.js.map +1 -0
  379. package/lib/module/ai-components/syntax-highlighting/SyntaxHighlighter.js +51 -0
  380. package/lib/module/ai-components/syntax-highlighting/SyntaxHighlighter.js.map +1 -0
  381. package/lib/module/ai-components/syntax-highlighting/components/AndroidNativeRenderer.js +35 -0
  382. package/lib/module/ai-components/syntax-highlighting/components/AndroidNativeRenderer.js.map +1 -0
  383. package/lib/module/ai-components/syntax-highlighting/components/index.js +15 -0
  384. package/lib/module/ai-components/syntax-highlighting/components/index.js.map +1 -0
  385. package/lib/module/ai-components/syntax-highlighting/index.js +48 -0
  386. package/lib/module/ai-components/syntax-highlighting/index.js.map +1 -0
  387. package/lib/module/ai-components/syntax-highlighting/prism-config.js +7 -0
  388. package/lib/module/ai-components/syntax-highlighting/prism-config.js.map +1 -0
  389. package/lib/module/ai-components/syntax-highlighting/types.js +4 -0
  390. package/lib/module/ai-components/syntax-highlighting/types.js.map +1 -0
  391. package/lib/module/ai-components/syntax-highlighting/utils/converter.js +107 -0
  392. package/lib/module/ai-components/syntax-highlighting/utils/converter.js.map +1 -0
  393. package/lib/module/ai-components/syntax-highlighting/utils/flatten-nodes.js +139 -0
  394. package/lib/module/ai-components/syntax-highlighting/utils/flatten-nodes.js.map +1 -0
  395. package/lib/module/ai-components/syntax-highlighting/utils/index.js +37 -0
  396. package/lib/module/ai-components/syntax-highlighting/utils/index.js.map +1 -0
  397. package/lib/module/ai-components/syntax-highlighting/utils/renderer.js +117 -0
  398. package/lib/module/ai-components/syntax-highlighting/utils/renderer.js.map +1 -0
  399. package/lib/module/ai-components/theme.js +99 -0
  400. package/lib/module/ai-components/theme.js.map +1 -0
  401. package/lib/module/ai-components/transcription/useDictation.js +114 -0
  402. package/lib/module/ai-components/transcription/useDictation.js.map +1 -0
  403. package/lib/module/native.js +4 -0
  404. package/lib/module/native.js.map +1 -1
  405. package/lib/module/version.json +1 -1
  406. package/lib/typescript/ai-components/AITypingIndicatorView.d.ts +4 -0
  407. package/lib/typescript/ai-components/AITypingIndicatorView.d.ts.map +1 -0
  408. package/lib/typescript/ai-components/StreamingMessageView.d.ts +19 -0
  409. package/lib/typescript/ai-components/StreamingMessageView.d.ts.map +1 -0
  410. package/lib/typescript/ai-components/charts/Chart.d.ts +10 -0
  411. package/lib/typescript/ai-components/charts/Chart.d.ts.map +1 -0
  412. package/lib/typescript/ai-components/charts/components/PieLegend.d.ts +7 -0
  413. package/lib/typescript/ai-components/charts/components/PieLegend.d.ts.map +1 -0
  414. package/lib/typescript/ai-components/charts/components/VictoryChart.d.ts +9 -0
  415. package/lib/typescript/ai-components/charts/components/VictoryChart.d.ts.map +1 -0
  416. package/lib/typescript/ai-components/charts/components/index.d.ts +3 -0
  417. package/lib/typescript/ai-components/charts/components/index.d.ts.map +1 -0
  418. package/lib/typescript/ai-components/charts/index.d.ts +7 -0
  419. package/lib/typescript/ai-components/charts/index.d.ts.map +1 -0
  420. package/lib/typescript/ai-components/charts/mermaid/index.d.ts +2 -0
  421. package/lib/typescript/ai-components/charts/mermaid/index.d.ts.map +1 -0
  422. package/lib/typescript/ai-components/charts/mermaid/parser.d.ts +4 -0
  423. package/lib/typescript/ai-components/charts/mermaid/parser.d.ts.map +1 -0
  424. package/lib/typescript/ai-components/charts/types.d.ts +23 -0
  425. package/lib/typescript/ai-components/charts/types.d.ts.map +1 -0
  426. package/lib/typescript/ai-components/charts/utils/generate-pie-colors.d.ts +9 -0
  427. package/lib/typescript/ai-components/charts/utils/generate-pie-colors.d.ts.map +1 -0
  428. package/lib/typescript/ai-components/charts/utils/index.d.ts +3 -0
  429. package/lib/typescript/ai-components/charts/utils/index.d.ts.map +1 -0
  430. package/lib/typescript/ai-components/charts/utils/parse-json-chart.d.ts +3 -0
  431. package/lib/typescript/ai-components/charts/utils/parse-json-chart.d.ts.map +1 -0
  432. package/lib/typescript/ai-components/charts/vega-lite/index.d.ts +3 -0
  433. package/lib/typescript/ai-components/charts/vega-lite/index.d.ts.map +1 -0
  434. package/lib/typescript/ai-components/charts/vega-lite/parser.d.ts +4 -0
  435. package/lib/typescript/ai-components/charts/vega-lite/parser.d.ts.map +1 -0
  436. package/lib/typescript/ai-components/charts/vega-lite/schema.d.ts +305 -0
  437. package/lib/typescript/ai-components/charts/vega-lite/schema.d.ts.map +1 -0
  438. package/lib/typescript/ai-components/components/BottomSheet.d.ts +5 -0
  439. package/lib/typescript/ai-components/components/BottomSheet.d.ts.map +1 -0
  440. package/lib/typescript/ai-components/components/MarkdownReactiveScrollView.d.ts +3 -0
  441. package/lib/typescript/ai-components/components/MarkdownReactiveScrollView.d.ts.map +1 -0
  442. package/lib/typescript/ai-components/components/index.d.ts +3 -0
  443. package/lib/typescript/ai-components/components/index.d.ts.map +1 -0
  444. package/lib/typescript/ai-components/contexts/composer-context.d.ts +16 -0
  445. package/lib/typescript/ai-components/contexts/composer-context.d.ts.map +1 -0
  446. package/lib/typescript/ai-components/contexts/index.d.ts +3 -0
  447. package/lib/typescript/ai-components/contexts/index.d.ts.map +1 -0
  448. package/lib/typescript/ai-components/contexts/theme-context.d.ts +23 -0
  449. package/lib/typescript/ai-components/contexts/theme-context.d.ts.map +1 -0
  450. package/lib/typescript/ai-components/index.d.ts +15 -0
  451. package/lib/typescript/ai-components/index.d.ts.map +1 -0
  452. package/lib/typescript/ai-components/internal/hooks/useStableCallback.d.ts +26 -0
  453. package/lib/typescript/ai-components/internal/hooks/useStableCallback.d.ts.map +1 -0
  454. package/lib/typescript/ai-components/internal/icons/Camera.d.ts +4 -0
  455. package/lib/typescript/ai-components/internal/icons/Camera.d.ts.map +1 -0
  456. package/lib/typescript/ai-components/internal/icons/CircleStop.d.ts +8 -0
  457. package/lib/typescript/ai-components/internal/icons/CircleStop.d.ts.map +1 -0
  458. package/lib/typescript/ai-components/internal/icons/Close.d.ts +4 -0
  459. package/lib/typescript/ai-components/internal/icons/Close.d.ts.map +1 -0
  460. package/lib/typescript/ai-components/internal/icons/Mic.d.ts +8 -0
  461. package/lib/typescript/ai-components/internal/icons/Mic.d.ts.map +1 -0
  462. package/lib/typescript/ai-components/internal/icons/Picture.d.ts +4 -0
  463. package/lib/typescript/ai-components/internal/icons/Picture.d.ts.map +1 -0
  464. package/lib/typescript/ai-components/internal/icons/SendUp.d.ts +8 -0
  465. package/lib/typescript/ai-components/internal/icons/SendUp.d.ts.map +1 -0
  466. package/lib/typescript/ai-components/internal/icons/utils/base.d.ts +13 -0
  467. package/lib/typescript/ai-components/internal/icons/utils/base.d.ts.map +1 -0
  468. package/lib/typescript/ai-components/markdown/components/Autolink.d.ts +4 -0
  469. package/lib/typescript/ai-components/markdown/components/Autolink.d.ts.map +1 -0
  470. package/lib/typescript/ai-components/markdown/components/BlockQuote.d.ts +4 -0
  471. package/lib/typescript/ai-components/markdown/components/BlockQuote.d.ts.map +1 -0
  472. package/lib/typescript/ai-components/markdown/components/Bold.d.ts +4 -0
  473. package/lib/typescript/ai-components/markdown/components/Bold.d.ts.map +1 -0
  474. package/lib/typescript/ai-components/markdown/components/CodeBlock.d.ts +9 -0
  475. package/lib/typescript/ai-components/markdown/components/CodeBlock.d.ts.map +1 -0
  476. package/lib/typescript/ai-components/markdown/components/Emphasis.d.ts +4 -0
  477. package/lib/typescript/ai-components/markdown/components/Emphasis.d.ts.map +1 -0
  478. package/lib/typescript/ai-components/markdown/components/Heading.d.ts +4 -0
  479. package/lib/typescript/ai-components/markdown/components/Heading.d.ts.map +1 -0
  480. package/lib/typescript/ai-components/markdown/components/HorizontalRule.d.ts +4 -0
  481. package/lib/typescript/ai-components/markdown/components/HorizontalRule.d.ts.map +1 -0
  482. package/lib/typescript/ai-components/markdown/components/InlineCode.d.ts +4 -0
  483. package/lib/typescript/ai-components/markdown/components/InlineCode.d.ts.map +1 -0
  484. package/lib/typescript/ai-components/markdown/components/LineBreak.d.ts +4 -0
  485. package/lib/typescript/ai-components/markdown/components/LineBreak.d.ts.map +1 -0
  486. package/lib/typescript/ai-components/markdown/components/Link.d.ts +4 -0
  487. package/lib/typescript/ai-components/markdown/components/Link.d.ts.map +1 -0
  488. package/lib/typescript/ai-components/markdown/components/List.d.ts +4 -0
  489. package/lib/typescript/ai-components/markdown/components/List.d.ts.map +1 -0
  490. package/lib/typescript/ai-components/markdown/components/Mailto.d.ts +4 -0
  491. package/lib/typescript/ai-components/markdown/components/Mailto.d.ts.map +1 -0
  492. package/lib/typescript/ai-components/markdown/components/Markdown.d.ts +4 -0
  493. package/lib/typescript/ai-components/markdown/components/Markdown.d.ts.map +1 -0
  494. package/lib/typescript/ai-components/markdown/components/NewLine.d.ts +4 -0
  495. package/lib/typescript/ai-components/markdown/components/NewLine.d.ts.map +1 -0
  496. package/lib/typescript/ai-components/markdown/components/Paragraph.d.ts +5 -0
  497. package/lib/typescript/ai-components/markdown/components/Paragraph.d.ts.map +1 -0
  498. package/lib/typescript/ai-components/markdown/components/Strikethrough.d.ts +4 -0
  499. package/lib/typescript/ai-components/markdown/components/Strikethrough.d.ts.map +1 -0
  500. package/lib/typescript/ai-components/markdown/components/Table.d.ts +4 -0
  501. package/lib/typescript/ai-components/markdown/components/Table.d.ts.map +1 -0
  502. package/lib/typescript/ai-components/markdown/components/Text.d.ts +4 -0
  503. package/lib/typescript/ai-components/markdown/components/Text.d.ts.map +1 -0
  504. package/lib/typescript/ai-components/markdown/components/Url.d.ts +4 -0
  505. package/lib/typescript/ai-components/markdown/components/Url.d.ts.map +1 -0
  506. package/lib/typescript/ai-components/markdown/components/index.d.ts +20 -0
  507. package/lib/typescript/ai-components/markdown/components/index.d.ts.map +1 -0
  508. package/lib/typescript/ai-components/markdown/index.d.ts +6 -0
  509. package/lib/typescript/ai-components/markdown/index.d.ts.map +1 -0
  510. package/lib/typescript/ai-components/markdown/rules.d.ts +4 -0
  511. package/lib/typescript/ai-components/markdown/rules.d.ts.map +1 -0
  512. package/lib/typescript/ai-components/markdown/styles.d.ts +232 -0
  513. package/lib/typescript/ai-components/markdown/styles.d.ts.map +1 -0
  514. package/lib/typescript/ai-components/markdown/types.d.ts +137 -0
  515. package/lib/typescript/ai-components/markdown/types.d.ts.map +1 -0
  516. package/lib/typescript/ai-components/markdown/utils/generate-markdown-text.d.ts +5 -0
  517. package/lib/typescript/ai-components/markdown/utils/generate-markdown-text.d.ts.map +1 -0
  518. package/lib/typescript/ai-components/markdown/utils/index.d.ts +2 -0
  519. package/lib/typescript/ai-components/markdown/utils/index.d.ts.map +1 -0
  520. package/lib/typescript/ai-components/message-composer/ActionButton.d.ts +4 -0
  521. package/lib/typescript/ai-components/message-composer/ActionButton.d.ts.map +1 -0
  522. package/lib/typescript/ai-components/message-composer/ActionSheet.d.ts +16 -0
  523. package/lib/typescript/ai-components/message-composer/ActionSheet.d.ts.map +1 -0
  524. package/lib/typescript/ai-components/message-composer/AttachmentButton.d.ts +3 -0
  525. package/lib/typescript/ai-components/message-composer/AttachmentButton.d.ts.map +1 -0
  526. package/lib/typescript/ai-components/message-composer/ComposerView.d.ts +33 -0
  527. package/lib/typescript/ai-components/message-composer/ComposerView.d.ts.map +1 -0
  528. package/lib/typescript/ai-components/message-composer/MediaPreviewList.d.ts +3 -0
  529. package/lib/typescript/ai-components/message-composer/MediaPreviewList.d.ts.map +1 -0
  530. package/lib/typescript/ai-components/message-composer/SpeechToTextButton.d.ts +12 -0
  531. package/lib/typescript/ai-components/message-composer/SpeechToTextButton.d.ts.map +1 -0
  532. package/lib/typescript/ai-components/message-composer/index.d.ts +6 -0
  533. package/lib/typescript/ai-components/message-composer/index.d.ts.map +1 -0
  534. package/lib/typescript/ai-components/message-composer/utils/withCloseSheet.d.ts +2 -0
  535. package/lib/typescript/ai-components/message-composer/utils/withCloseSheet.d.ts.map +1 -0
  536. package/lib/typescript/ai-components/native/AIDictation.d.ts +18 -0
  537. package/lib/typescript/ai-components/native/AIDictation.d.ts.map +1 -0
  538. package/lib/typescript/ai-components/native/PerfText.d.ts +13 -0
  539. package/lib/typescript/ai-components/native/PerfText.d.ts.map +1 -0
  540. package/lib/typescript/ai-components/native-specs/NativeAIDictation.d.ts +40 -0
  541. package/lib/typescript/ai-components/native-specs/NativeAIDictation.d.ts.map +1 -0
  542. package/lib/typescript/ai-components/services/clipboard-service/expo.d.ts +2 -0
  543. package/lib/typescript/ai-components/services/clipboard-service/expo.d.ts.map +1 -0
  544. package/lib/typescript/ai-components/services/clipboard-service/index.d.ts +2 -0
  545. package/lib/typescript/ai-components/services/clipboard-service/index.d.ts.map +1 -0
  546. package/lib/typescript/ai-components/services/clipboard-service/rncli.d.ts +2 -0
  547. package/lib/typescript/ai-components/services/clipboard-service/rncli.d.ts.map +1 -0
  548. package/lib/typescript/ai-components/services/index.d.ts +3 -0
  549. package/lib/typescript/ai-components/services/index.d.ts.map +1 -0
  550. package/lib/typescript/ai-components/services/media-picker-service/AbstractMediaPickerService.d.ts +40 -0
  551. package/lib/typescript/ai-components/services/media-picker-service/AbstractMediaPickerService.d.ts.map +1 -0
  552. package/lib/typescript/ai-components/services/media-picker-service/expo.d.ts +34 -0
  553. package/lib/typescript/ai-components/services/media-picker-service/expo.d.ts.map +1 -0
  554. package/lib/typescript/ai-components/services/media-picker-service/hooks/useMediaPickerState.d.ts +11 -0
  555. package/lib/typescript/ai-components/services/media-picker-service/hooks/useMediaPickerState.d.ts.map +1 -0
  556. package/lib/typescript/ai-components/services/media-picker-service/index.d.ts +37 -0
  557. package/lib/typescript/ai-components/services/media-picker-service/index.d.ts.map +1 -0
  558. package/lib/typescript/ai-components/services/media-picker-service/rncli.d.ts +34 -0
  559. package/lib/typescript/ai-components/services/media-picker-service/rncli.d.ts.map +1 -0
  560. package/lib/typescript/ai-components/store/bottom-sheet/store.d.ts +12 -0
  561. package/lib/typescript/ai-components/store/bottom-sheet/store.d.ts.map +1 -0
  562. package/lib/typescript/ai-components/store/bottom-sheet/useBottomSheetState.d.ts +5 -0
  563. package/lib/typescript/ai-components/store/bottom-sheet/useBottomSheetState.d.ts.map +1 -0
  564. package/lib/typescript/ai-components/store/composer/store.d.ts +7 -0
  565. package/lib/typescript/ai-components/store/composer/store.d.ts.map +1 -0
  566. package/lib/typescript/ai-components/store/composer/useComposerHasText.d.ts +4 -0
  567. package/lib/typescript/ai-components/store/composer/useComposerHasText.d.ts.map +1 -0
  568. package/lib/typescript/ai-components/store/composer/useComposerText.d.ts +4 -0
  569. package/lib/typescript/ai-components/store/composer/useComposerText.d.ts.map +1 -0
  570. package/lib/typescript/ai-components/store/dictation/store.d.ts +13 -0
  571. package/lib/typescript/ai-components/store/dictation/store.d.ts.map +1 -0
  572. package/lib/typescript/ai-components/store/dictation/useDictationState.d.ts +6 -0
  573. package/lib/typescript/ai-components/store/dictation/useDictationState.d.ts.map +1 -0
  574. package/lib/typescript/ai-components/store/dictation/useDictationTranscript.d.ts +4 -0
  575. package/lib/typescript/ai-components/store/dictation/useDictationTranscript.d.ts.map +1 -0
  576. package/lib/typescript/ai-components/store/index.d.ts +7 -0
  577. package/lib/typescript/ai-components/store/index.d.ts.map +1 -0
  578. package/lib/typescript/ai-components/syntax-highlighting/SyntaxHighlighter.d.ts +11 -0
  579. package/lib/typescript/ai-components/syntax-highlighting/SyntaxHighlighter.d.ts.map +1 -0
  580. package/lib/typescript/ai-components/syntax-highlighting/components/AndroidNativeRenderer.d.ts +10 -0
  581. package/lib/typescript/ai-components/syntax-highlighting/components/AndroidNativeRenderer.d.ts.map +1 -0
  582. package/lib/typescript/ai-components/syntax-highlighting/components/index.d.ts +2 -0
  583. package/lib/typescript/ai-components/syntax-highlighting/components/index.d.ts.map +1 -0
  584. package/lib/typescript/ai-components/syntax-highlighting/index.d.ts +10 -0
  585. package/lib/typescript/ai-components/syntax-highlighting/index.d.ts.map +1 -0
  586. package/lib/typescript/ai-components/syntax-highlighting/prism-config.d.ts +2 -0
  587. package/lib/typescript/ai-components/syntax-highlighting/prism-config.d.ts.map +1 -0
  588. package/lib/typescript/ai-components/syntax-highlighting/types.d.ts +21 -0
  589. package/lib/typescript/ai-components/syntax-highlighting/types.d.ts.map +1 -0
  590. package/lib/typescript/ai-components/syntax-highlighting/utils/converter.d.ts +5 -0
  591. package/lib/typescript/ai-components/syntax-highlighting/utils/converter.d.ts.map +1 -0
  592. package/lib/typescript/ai-components/syntax-highlighting/utils/flatten-nodes.d.ts +19 -0
  593. package/lib/typescript/ai-components/syntax-highlighting/utils/flatten-nodes.d.ts.map +1 -0
  594. package/lib/typescript/ai-components/syntax-highlighting/utils/index.d.ts +4 -0
  595. package/lib/typescript/ai-components/syntax-highlighting/utils/index.d.ts.map +1 -0
  596. package/lib/typescript/ai-components/syntax-highlighting/utils/renderer.d.ts +30 -0
  597. package/lib/typescript/ai-components/syntax-highlighting/utils/renderer.d.ts.map +1 -0
  598. package/lib/typescript/ai-components/theme.d.ts +58 -0
  599. package/lib/typescript/ai-components/theme.d.ts.map +1 -0
  600. package/lib/typescript/ai-components/transcription/useDictation.d.ts +8 -0
  601. package/lib/typescript/ai-components/transcription/useDictation.d.ts.map +1 -0
  602. package/lib/typescript/native.d.ts +17 -1
  603. package/lib/typescript/native.d.ts.map +1 -1
  604. package/package.json +23 -5
  605. package/src/ai-components/AITypingIndicatorView.tsx +51 -0
  606. package/src/ai-components/README.md +279 -0
  607. package/src/ai-components/StreamingMessageView.tsx +85 -0
  608. package/src/ai-components/__tests__/ComposerView.test.tsx +113 -0
  609. package/src/ai-components/__tests__/Markdown.test.tsx +94 -0
  610. package/src/ai-components/__tests__/StreamingMessageView.test.tsx +126 -0
  611. package/src/ai-components/__tests__/SyntaxHighlighter.test.tsx +136 -0
  612. package/src/ai-components/__tests__/charts.test.ts +131 -0
  613. package/src/ai-components/__tests__/dictation.test.tsx +166 -0
  614. package/src/ai-components/__tests__/generateMarkdownText.test.ts +54 -0
  615. package/src/ai-components/__tests__/theme.test.tsx +41 -0
  616. package/src/ai-components/charts/Chart.tsx +20 -0
  617. package/src/ai-components/charts/components/PieLegend.tsx +50 -0
  618. package/src/ai-components/charts/components/VictoryChart.tsx +193 -0
  619. package/src/ai-components/charts/components/index.ts +2 -0
  620. package/src/ai-components/charts/index.ts +13 -0
  621. package/src/ai-components/charts/mermaid/index.ts +1 -0
  622. package/src/ai-components/charts/mermaid/parser.ts +33 -0
  623. package/src/ai-components/charts/types.ts +25 -0
  624. package/src/ai-components/charts/utils/generate-pie-colors.ts +82 -0
  625. package/src/ai-components/charts/utils/index.ts +2 -0
  626. package/src/ai-components/charts/utils/parse-json-chart.ts +15 -0
  627. package/src/ai-components/charts/vega-lite/index.ts +2 -0
  628. package/src/ai-components/charts/vega-lite/parser.ts +49 -0
  629. package/src/ai-components/charts/vega-lite/schema.ts +112 -0
  630. package/src/ai-components/components/BottomSheet.tsx +158 -0
  631. package/src/ai-components/components/MarkdownReactiveScrollView.tsx +92 -0
  632. package/src/ai-components/components/index.ts +2 -0
  633. package/src/ai-components/contexts/composer-context.tsx +73 -0
  634. package/src/ai-components/contexts/index.ts +2 -0
  635. package/src/ai-components/contexts/theme-context.tsx +68 -0
  636. package/src/ai-components/index.ts +29 -0
  637. package/src/ai-components/internal/hooks/useStableCallback.ts +37 -0
  638. package/src/ai-components/internal/icons/Camera.tsx +12 -0
  639. package/src/ai-components/internal/icons/CircleStop.tsx +18 -0
  640. package/src/ai-components/internal/icons/Close.tsx +12 -0
  641. package/src/ai-components/internal/icons/Mic.tsx +20 -0
  642. package/src/ai-components/internal/icons/Picture.tsx +16 -0
  643. package/src/ai-components/internal/icons/SendUp.tsx +21 -0
  644. package/src/ai-components/internal/icons/utils/base.tsx +44 -0
  645. package/src/ai-components/markdown/components/Autolink.tsx +26 -0
  646. package/src/ai-components/markdown/components/BlockQuote.tsx +19 -0
  647. package/src/ai-components/markdown/components/Bold.tsx +16 -0
  648. package/src/ai-components/markdown/components/CodeBlock.tsx +96 -0
  649. package/src/ai-components/markdown/components/Emphasis.tsx +16 -0
  650. package/src/ai-components/markdown/components/Heading.tsx +30 -0
  651. package/src/ai-components/markdown/components/HorizontalRule.tsx +9 -0
  652. package/src/ai-components/markdown/components/InlineCode.tsx +16 -0
  653. package/src/ai-components/markdown/components/LineBreak.tsx +11 -0
  654. package/src/ai-components/markdown/components/Link.tsx +28 -0
  655. package/src/ai-components/markdown/components/List.tsx +65 -0
  656. package/src/ai-components/markdown/components/Mailto.tsx +26 -0
  657. package/src/ai-components/markdown/components/Markdown.tsx +59 -0
  658. package/src/ai-components/markdown/components/NewLine.tsx +11 -0
  659. package/src/ai-components/markdown/components/Paragraph.tsx +69 -0
  660. package/src/ai-components/markdown/components/Strikethrough.tsx +16 -0
  661. package/src/ai-components/markdown/components/Table.tsx +81 -0
  662. package/src/ai-components/markdown/components/Text.tsx +37 -0
  663. package/src/ai-components/markdown/components/Url.tsx +26 -0
  664. package/src/ai-components/markdown/components/index.ts +20 -0
  665. package/src/ai-components/markdown/index.tsx +5 -0
  666. package/src/ai-components/markdown/rules.ts +216 -0
  667. package/src/ai-components/markdown/styles.ts +236 -0
  668. package/src/ai-components/markdown/types.ts +163 -0
  669. package/src/ai-components/markdown/utils/generate-markdown-text.ts +117 -0
  670. package/src/ai-components/markdown/utils/index.ts +1 -0
  671. package/src/ai-components/message-composer/ActionButton.tsx +99 -0
  672. package/src/ai-components/message-composer/ActionSheet.tsx +205 -0
  673. package/src/ai-components/message-composer/AttachmentButton.tsx +49 -0
  674. package/src/ai-components/message-composer/ComposerView.tsx +187 -0
  675. package/src/ai-components/message-composer/MediaPreviewList.tsx +84 -0
  676. package/src/ai-components/message-composer/SpeechToTextButton.tsx +79 -0
  677. package/src/ai-components/message-composer/index.ts +5 -0
  678. package/src/ai-components/message-composer/utils/withCloseSheet.ts +11 -0
  679. package/src/ai-components/native/AIDictation.ts +77 -0
  680. package/src/ai-components/native/PerfText.tsx +32 -0
  681. package/src/ai-components/native-specs/NativeAIDictation.ts +48 -0
  682. package/src/ai-components/services/clipboard-service/expo.ts +11 -0
  683. package/src/ai-components/services/clipboard-service/index.ts +4 -0
  684. package/src/ai-components/services/clipboard-service/rncli.ts +11 -0
  685. package/src/ai-components/services/index.ts +2 -0
  686. package/src/ai-components/services/media-picker-service/AbstractMediaPickerService.ts +62 -0
  687. package/src/ai-components/services/media-picker-service/expo.ts +148 -0
  688. package/src/ai-components/services/media-picker-service/hooks/useMediaPickerState.ts +14 -0
  689. package/src/ai-components/services/media-picker-service/index.ts +4 -0
  690. package/src/ai-components/services/media-picker-service/optional-modules.d.ts +25 -0
  691. package/src/ai-components/services/media-picker-service/rncli.ts +142 -0
  692. package/src/ai-components/store/bottom-sheet/store.ts +30 -0
  693. package/src/ai-components/store/bottom-sheet/useBottomSheetState.ts +10 -0
  694. package/src/ai-components/store/composer/store.ts +12 -0
  695. package/src/ai-components/store/composer/useComposerHasText.ts +14 -0
  696. package/src/ai-components/store/composer/useComposerText.ts +14 -0
  697. package/src/ai-components/store/dictation/store.ts +23 -0
  698. package/src/ai-components/store/dictation/useDictationState.ts +11 -0
  699. package/src/ai-components/store/dictation/useDictationTranscript.ts +9 -0
  700. package/src/ai-components/store/index.ts +11 -0
  701. package/src/ai-components/syntax-highlighting/SyntaxHighlighter.tsx +66 -0
  702. package/src/ai-components/syntax-highlighting/components/AndroidNativeRenderer.tsx +29 -0
  703. package/src/ai-components/syntax-highlighting/components/index.ts +1 -0
  704. package/src/ai-components/syntax-highlighting/index.ts +11 -0
  705. package/src/ai-components/syntax-highlighting/prism-config.ts +4 -0
  706. package/src/ai-components/syntax-highlighting/types.ts +26 -0
  707. package/src/ai-components/syntax-highlighting/utils/converter.ts +145 -0
  708. package/src/ai-components/syntax-highlighting/utils/flatten-nodes.ts +150 -0
  709. package/src/ai-components/syntax-highlighting/utils/index.ts +3 -0
  710. package/src/ai-components/syntax-highlighting/utils/renderer.tsx +151 -0
  711. package/src/ai-components/theme.ts +138 -0
  712. package/src/ai-components/transcription/useDictation.ts +106 -0
  713. package/src/native.ts +19 -1
  714. package/src/version.json +1 -1
@@ -0,0 +1,113 @@
1
+ import React from 'react';
2
+ import { Image, Text } from 'react-native';
3
+
4
+ import { act, fireEvent, render, screen, waitFor } from '@testing-library/react-native';
5
+
6
+ import {
7
+ ComposerView,
8
+ type ComposerViewProps,
9
+ sheetStore,
10
+ sheetStoreApi,
11
+ StreamTheme,
12
+ } from '../index';
13
+ import {
14
+ AbstractMediaPickerService,
15
+ type MediaAsset,
16
+ } from '../services/media-picker-service/AbstractMediaPickerService';
17
+
18
+ const flushPromises = () => new Promise<void>((resolve) => setTimeout(resolve, 0));
19
+
20
+ class FakeMediaPickerService extends AbstractMediaPickerService {
21
+ pickMedia = jest.fn(() => {
22
+ const assets: MediaAsset[] = [{ name: 'a.png', uri: 'file:///a.png' }];
23
+ this.appendAssets(assets);
24
+ return Promise.resolve({ assets, cancelled: false });
25
+ });
26
+
27
+ takeMedia = jest.fn(() => Promise.resolve({ cancelled: true }));
28
+ }
29
+
30
+ const renderComposer = (props: Partial<ComposerViewProps> = {}) => {
31
+ const onSendMessage = jest.fn(() => Promise.resolve());
32
+ const utils = render(
33
+ <StreamTheme>
34
+ <ComposerView onSendMessage={onSendMessage} {...props} />
35
+ </StreamTheme>,
36
+ );
37
+ return { ...utils, onSendMessage };
38
+ };
39
+
40
+ describe('ai-components ComposerView', () => {
41
+ afterEach(() => {
42
+ act(() => {
43
+ sheetStoreApi.closeSheet();
44
+ });
45
+ });
46
+
47
+ it('sends the typed text and clears the input', async () => {
48
+ const { onSendMessage } = renderComposer();
49
+
50
+ fireEvent.changeText(screen.getByPlaceholderText('Ask anything'), 'Hello there');
51
+ await act(async () => {
52
+ fireEvent.press(screen.getByTestId('send-up'));
53
+ await flushPromises();
54
+ });
55
+
56
+ expect(onSendMessage).toHaveBeenCalledWith(expect.objectContaining({ text: 'Hello there' }));
57
+ expect(screen.getByPlaceholderText('Ask anything').props.value).toBe('');
58
+ });
59
+
60
+ it('shows the stop button while generating', () => {
61
+ const stopGenerating = jest.fn(() => Promise.resolve());
62
+ renderComposer({ isGenerating: true, stopGenerating });
63
+
64
+ fireEvent.changeText(screen.getByPlaceholderText('Ask anything'), 'Hello');
65
+ expect(screen.queryByTestId('send-up')).toBeNull();
66
+ });
67
+
68
+ it('opens the attachment sheet, picks media and sends it along', async () => {
69
+ const mediaPickerService = new FakeMediaPickerService();
70
+ const action = jest.fn();
71
+ const { onSendMessage } = renderComposer({
72
+ bottomSheetOptions: [{ action, subtitle: 'Do it', title: 'Custom option' }],
73
+ mediaPickerService,
74
+ });
75
+
76
+ fireEvent.press(screen.getByText('+'));
77
+ expect(sheetStore.getLatestValue().open).toBe(true);
78
+ expect(screen.getByText('Camera')).toBeTruthy();
79
+ expect(screen.getByText('Custom option')).toBeTruthy();
80
+
81
+ await act(async () => {
82
+ fireEvent.press(screen.getByText('Photos'));
83
+ await flushPromises();
84
+ });
85
+ expect(mediaPickerService.pickMedia).toHaveBeenCalled();
86
+ expect(sheetStore.getLatestValue().open).toBe(false);
87
+ await waitFor(() => expect(screen.UNSAFE_getAllByType(Image)).toHaveLength(1));
88
+
89
+ act(() => {
90
+ sheetStoreApi.openSheet();
91
+ });
92
+ await act(async () => {
93
+ fireEvent.press(screen.getByText('Custom option'));
94
+ await flushPromises();
95
+ });
96
+ expect(action).toHaveBeenCalled();
97
+
98
+ fireEvent.changeText(screen.getByPlaceholderText('Ask anything'), 'With an image');
99
+ await act(async () => {
100
+ fireEvent.press(screen.getByTestId('send-up'));
101
+ await flushPromises();
102
+ });
103
+ expect(onSendMessage).toHaveBeenCalledWith({
104
+ attachments: [{ name: 'a.png', uri: 'file:///a.png' }],
105
+ custom: undefined,
106
+ text: 'With an image',
107
+ });
108
+ expect(mediaPickerService.state.getLatestValue().assets).toEqual([]);
109
+ expect(
110
+ screen.UNSAFE_queryAllByType(Text).some((t) => t.props.children === 'With an image'),
111
+ ).toBe(false);
112
+ });
113
+ });
@@ -0,0 +1,94 @@
1
+ import React from 'react';
2
+
3
+ import { fireEvent, render, screen } from '@testing-library/react-native';
4
+
5
+ import { Markdown, mergeThemes, StreamTheme } from '../index';
6
+
7
+ const mockSetString = jest.fn();
8
+ jest.mock(
9
+ '@react-native-clipboard/clipboard',
10
+ () => ({ __esModule: true, default: { setString: (text: string) => mockSetString(text) } }),
11
+ { virtual: true },
12
+ );
13
+
14
+ const renderMarkdown = (text: string, props: Partial<React.ComponentProps<typeof Markdown>> = {}) =>
15
+ render(
16
+ <StreamTheme>
17
+ <Markdown {...props}>{text}</Markdown>
18
+ </StreamTheme>,
19
+ );
20
+
21
+ describe('ai-components Markdown', () => {
22
+ beforeEach(() => {
23
+ mockSetString.mockClear();
24
+ });
25
+
26
+ it('renders headings, emphasis, lists and links', () => {
27
+ const onLink = jest.fn();
28
+ renderMarkdown(
29
+ '# Title\n\nSome **bold** and *italic* and ~~gone~~ text.\n\n- one\n- two\n\n1. first\n2. second\n\n[docs](https://getstream.io)',
30
+ { onLink },
31
+ );
32
+
33
+ expect(screen.getByText('Title')).toBeTruthy();
34
+ expect(screen.getByText('bold')).toBeTruthy();
35
+ expect(screen.getByText('italic')).toBeTruthy();
36
+ expect(screen.getByText('one')).toBeTruthy();
37
+ expect(screen.getByText('second')).toBeTruthy();
38
+
39
+ fireEvent.press(screen.getByText('docs'));
40
+ expect(onLink).toHaveBeenCalledWith('https://getstream.io');
41
+ });
42
+
43
+ it('renders tables, block quotes, inline code and horizontal rules', () => {
44
+ renderMarkdown('| a | b |\n|---|---|\n| 1 | 2 |\n\n> quoted\n\nuse `npm i`\n\n---\n\nafter');
45
+
46
+ expect(screen.getByText('a')).toBeTruthy();
47
+ expect(screen.getByText('2')).toBeTruthy();
48
+ expect(screen.getByText('quoted')).toBeTruthy();
49
+ expect(screen.getByText('npm i')).toBeTruthy();
50
+ expect(screen.getByText('after')).toBeTruthy();
51
+ });
52
+
53
+ it('renders a code block with its language and copies its content', () => {
54
+ renderMarkdown('```js\nconst a = 1;\n```');
55
+
56
+ expect(screen.getByText('js')).toBeTruthy();
57
+ expect(screen.getByText(/const/)).toBeTruthy();
58
+
59
+ fireEvent.press(screen.getByText('\u29C9'));
60
+ expect(mockSetString).toHaveBeenCalledWith('const a = 1;');
61
+ });
62
+
63
+ it('renders a mermaid pie chart instead of a code block', () => {
64
+ renderMarkdown('```mermaid\npie\n"Dogs" : 3\n"Cats" : 2\n```');
65
+
66
+ expect(screen.getByTestId('victory-polar-chart')).toBeTruthy();
67
+ expect(screen.getByText('Dogs')).toBeTruthy();
68
+ expect(screen.queryByText('mermaid')).toBeNull();
69
+ });
70
+
71
+ it('renders a vega-lite JSON chart, and falls back to code for other JSON', () => {
72
+ const chart = JSON.stringify({
73
+ data: { values: [{ a: 'A', b: 1 }] },
74
+ encoding: { x: { field: 'a' }, y: { field: 'b' } },
75
+ mark: 'bar',
76
+ });
77
+ renderMarkdown('```json\n' + chart + '\n```');
78
+ expect(screen.getByTestId('victory-cartesian-chart')).toBeTruthy();
79
+
80
+ renderMarkdown('```json\n{ "hello": "world" }\n```');
81
+ expect(screen.getByText('json')).toBeTruthy();
82
+ });
83
+
84
+ it('applies theme overrides', () => {
85
+ const theme = mergeThemes({ style: { markdown: { text: { color: 'rgb(1, 2, 3)' } } } });
86
+ render(
87
+ <StreamTheme mergedStyle={theme}>
88
+ <Markdown>{'# Themed'}</Markdown>
89
+ </StreamTheme>,
90
+ );
91
+
92
+ expect(screen.getByText('Themed')).toHaveStyle({ color: 'rgb(1, 2, 3)' });
93
+ });
94
+ });
@@ -0,0 +1,126 @@
1
+ import React from 'react';
2
+ import { Linking, StyleSheet, View } from 'react-native';
3
+
4
+ import { act, fireEvent, render, renderHook, screen } from '@testing-library/react-native';
5
+
6
+ import { registerNativeHandlers } from '../../native';
7
+ import {
8
+ AITypingIndicatorView,
9
+ StreamingMessageView,
10
+ StreamTheme,
11
+ useStreamingMessage,
12
+ } from '../index';
13
+
14
+ describe('ai-components streaming', () => {
15
+ beforeEach(() => {
16
+ jest.useFakeTimers();
17
+ });
18
+
19
+ afterEach(() => {
20
+ jest.useRealTimers();
21
+ });
22
+
23
+ describe('useStreamingMessage', () => {
24
+ it('renders the initial text immediately and animates text appended later', () => {
25
+ const { result, rerender } = renderHook(
26
+ ({ text }: { text: string }) =>
27
+ useStreamingMessage({ letterInterval: 10, renderingLetterCount: 2, text }),
28
+ { initialProps: { text: 'Hello' } },
29
+ );
30
+ expect(result.current.streamedMessageText).toBe('Hello');
31
+
32
+ rerender({ text: 'Hello world' });
33
+ act(() => {
34
+ jest.advanceTimersByTime(10);
35
+ });
36
+ expect(result.current.streamedMessageText).toBe('Hello w');
37
+
38
+ act(() => {
39
+ jest.advanceTimersByTime(100);
40
+ });
41
+ expect(result.current.streamedMessageText).toBe('Hello world');
42
+ });
43
+
44
+ it('optimistically closes a code fence while it is being streamed', () => {
45
+ const { result, rerender } = renderHook(
46
+ ({ text }: { text: string }) =>
47
+ useStreamingMessage({ letterInterval: 10, renderingLetterCount: 4, text }),
48
+ { initialProps: { text: '' } },
49
+ );
50
+
51
+ rerender({ text: '```js\ncode' });
52
+ act(() => {
53
+ jest.advanceTimersByTime(10);
54
+ });
55
+ expect(result.current.streamedMessageText).toBe('```j```');
56
+ });
57
+ });
58
+
59
+ describe('StreamingMessageView', () => {
60
+ it('renders markdown and handles links with the provided callback', () => {
61
+ const onLink = jest.fn();
62
+ render(
63
+ <StreamTheme>
64
+ <StreamingMessageView onLink={onLink} text={'**Hi** see getstream.io'} />
65
+ </StreamTheme>,
66
+ );
67
+
68
+ expect(screen.getByText('Hi')).toBeTruthy();
69
+ fireEvent.press(screen.getByText('getstream.io'));
70
+ expect(onLink).toHaveBeenCalledWith('http://getstream.io');
71
+ });
72
+
73
+ it('opens links with Linking by default', async () => {
74
+ const canOpenURL = jest.spyOn(Linking, 'canOpenURL').mockResolvedValue(true);
75
+ const openURL = jest.spyOn(Linking, 'openURL').mockResolvedValue(undefined);
76
+ render(
77
+ <StreamTheme>
78
+ <StreamingMessageView text={'see getstream.io'} />
79
+ </StreamTheme>,
80
+ );
81
+
82
+ await act(async () => {
83
+ fireEvent.press(screen.getByText('getstream.io'));
84
+ // Let the `canOpenURL` promise resolve.
85
+ await Promise.resolve();
86
+ });
87
+
88
+ expect(canOpenURL).toHaveBeenCalledWith('http://getstream.io');
89
+ expect(openURL).toHaveBeenCalledWith('http://getstream.io');
90
+ });
91
+ });
92
+
93
+ describe('AITypingIndicatorView', () => {
94
+ it('lays the SDK native shimmer over the text', () => {
95
+ const MockShimmer = jest.fn((props) => <View testID='native-shimmer' {...props} />);
96
+ registerNativeHandlers({ NativeShimmerView: MockShimmer });
97
+
98
+ render(
99
+ <StreamTheme>
100
+ <AITypingIndicatorView text={'Thinking...'} />
101
+ </StreamTheme>,
102
+ );
103
+
104
+ expect(screen.getByText('Thinking...')).toBeTruthy();
105
+ const shimmer = screen.getByTestId('native-shimmer');
106
+ // The native shimmer paints behind its children, so it must be a sibling drawn after the
107
+ // text, covering it, rather than its parent.
108
+ expect(shimmer.props.children).toBeUndefined();
109
+ expect(MockShimmer.mock.calls[0]?.[0]).toMatchObject({
110
+ baseColor: 'transparent',
111
+ duration: 1200,
112
+ gradientColor: '#FFFFFF',
113
+ pointerEvents: 'none',
114
+ });
115
+ expect(StyleSheet.flatten(shimmer.props.style)).toMatchObject({
116
+ bottom: 0,
117
+ left: 0,
118
+ position: 'absolute',
119
+ right: 0,
120
+ top: 0,
121
+ });
122
+
123
+ registerNativeHandlers({ NativeShimmerView: null as unknown as undefined });
124
+ });
125
+ });
126
+ });
@@ -0,0 +1,136 @@
1
+ import React from 'react';
2
+ import { Platform, StyleSheet, Text, View } from 'react-native';
3
+
4
+ import { render, screen } from '@testing-library/react-native';
5
+
6
+ import { registerNativeHandlers } from '../../native';
7
+ import {
8
+ cssToRNTextStyle,
9
+ flattenRowsToTextAndColorRanges,
10
+ generateNewStylesheet,
11
+ StreamTheme,
12
+ SyntaxHighlighter,
13
+ } from '../index';
14
+
15
+ const setPlatform = (os: typeof Platform.OS) =>
16
+ Object.defineProperty(Platform, 'OS', { configurable: true, get: () => os });
17
+
18
+ describe('ai-components syntax highlighting', () => {
19
+ const originalOS = Platform.OS;
20
+
21
+ afterEach(() => {
22
+ setPlatform(originalOS);
23
+ registerNativeHandlers({ PerfText: null as unknown as undefined });
24
+ });
25
+
26
+ it('converts web CSS into React Native text styles', () => {
27
+ expect(
28
+ cssToRNTextStyle({
29
+ color: '#fff',
30
+ font: 'italic bold 14px/20px "Fira Code", monospace',
31
+ letterSpacing: '0.5em',
32
+ overflow: 'auto',
33
+ }),
34
+ ).toEqual({
35
+ color: '#fff',
36
+ fontFamily: 'Fira Code',
37
+ fontSize: 14,
38
+ fontStyle: 'italic',
39
+ fontWeight: 'bold',
40
+ letterSpacing: 8,
41
+ lineHeight: 20,
42
+ overflow: 'scroll',
43
+ });
44
+ expect(
45
+ cssToRNTextStyle({ fontSize: '1.5em', lineHeight: 'nope' }, { baseFontSize: 10 }),
46
+ ).toEqual({
47
+ fontSize: 15,
48
+ });
49
+ });
50
+
51
+ it('flattens highlighted rows into one text with merged colour ranges', () => {
52
+ const { defaultColor, transformedStyle } = generateNewStylesheet({
53
+ highlighter: 'prism',
54
+ stylesheet: {
55
+ 'pre[class*="language-"]': { color: '#111111' },
56
+ keyword: { color: '#ff0000' },
57
+ },
58
+ });
59
+ expect(defaultColor).toBe('#111111');
60
+
61
+ const rows = [
62
+ [
63
+ {
64
+ children: [{ type: 'text', value: 'const' }],
65
+ properties: { className: ['token', 'keyword'] },
66
+ tagName: 'span',
67
+ type: 'element',
68
+ },
69
+ { type: 'text', value: ' a = 1;' },
70
+ ],
71
+ [{ type: 'text', value: 'next' }],
72
+ ] as unknown as rendererNode[];
73
+
74
+ const { ranges, text } = flattenRowsToTextAndColorRanges(rows, {
75
+ defaultColor: defaultColor as string,
76
+ // The renderer passes the converted stylesheet through react-syntax-highlighter untyped.
77
+ stylesheet: transformedStyle as unknown as Parameters<
78
+ typeof flattenRowsToTextAndColorRanges
79
+ >[1]['stylesheet'],
80
+ });
81
+
82
+ expect(text).toBe('const a = 1;\nnext');
83
+ expect(ranges).toHaveLength(3);
84
+ expect(ranges[0]).toMatchObject({ end: 5, start: 0 });
85
+ expect(ranges[1]).toMatchObject({ end: 12, start: 5 });
86
+ expect(ranges[2]).toMatchObject({ end: 17, start: 13 });
87
+ });
88
+
89
+ it('renders nested Text on iOS', () => {
90
+ setPlatform('ios');
91
+ render(
92
+ <StreamTheme>
93
+ <SyntaxHighlighter highlighter='prism' language='javascript'>
94
+ {'const a = 1;'}
95
+ </SyntaxHighlighter>
96
+ </StreamTheme>,
97
+ );
98
+
99
+ expect(screen.getByText('const')).toBeTruthy();
100
+ });
101
+
102
+ it('highlights with highlight.js by default', () => {
103
+ setPlatform('ios');
104
+ render(
105
+ <StreamTheme>
106
+ <SyntaxHighlighter language='javascript'>{'const a = 1;'}</SyntaxHighlighter>
107
+ </StreamTheme>,
108
+ );
109
+
110
+ // Tokenized: the keyword is its own text node, inside a span styled by the highlight.js default
111
+ // theme (`hljs-keyword` is bold).
112
+ expect(screen.getByText('const')).toBeTruthy();
113
+ expect(
114
+ screen
115
+ .UNSAFE_getAllByType(Text)
116
+ .some((node) => StyleSheet.flatten(node.props.style)?.fontWeight === 'bold'),
117
+ ).toBe(true);
118
+ });
119
+
120
+ it('renders a single PerfText on Android', () => {
121
+ setPlatform('android');
122
+ const MockPerfText = jest.fn((props) => <View testID='perf-text' {...props} />);
123
+ registerNativeHandlers({ PerfText: MockPerfText });
124
+
125
+ render(
126
+ <StreamTheme>
127
+ <SyntaxHighlighter highlighter='prism' language='javascript'>
128
+ {'const a = 1;'}
129
+ </SyntaxHighlighter>
130
+ </StreamTheme>,
131
+ );
132
+
133
+ expect(screen.getByTestId('perf-text')).toBeTruthy();
134
+ expect(MockPerfText.mock.calls[0]?.[0]).toMatchObject({ text: 'const a = 1;' });
135
+ });
136
+ });
@@ -0,0 +1,131 @@
1
+ import { colorFromLabel, hashLabel, parseJsonChart, parseMermaid, xorshift32 } from '../charts';
2
+
3
+ describe('ai-components chart parsers', () => {
4
+ describe('parseMermaid', () => {
5
+ it('parses a pie chart with a title', () => {
6
+ const spec = parseMermaid('pie\ntitle Pets\n"Dogs" : 386\n"Cats" : 85.5\nRats : 15');
7
+
8
+ expect(spec.type).toBe('pie');
9
+ expect(spec.title).toBe('Pets');
10
+ expect(spec.data.map(({ dimension, value }) => ({ dimension, value }))).toEqual([
11
+ { dimension: 'Dogs', value: 386 },
12
+ { dimension: 'Cats', value: 85.5 },
13
+ { dimension: 'Rats', value: 15 },
14
+ ]);
15
+ spec.data.forEach(({ color }) => expect(color).toMatch(/^#[0-9a-f]{6}$/i));
16
+ });
17
+
18
+ it('throws on unsupported diagrams', () => {
19
+ expect(() => parseMermaid('graph TD\nA-->B')).toThrow('Unknown mermaid diagram type');
20
+ });
21
+ });
22
+
23
+ describe('parseJsonChart', () => {
24
+ it('parses a vega-lite bar chart', () => {
25
+ const spec = parseJsonChart(
26
+ JSON.stringify({
27
+ data: {
28
+ values: [
29
+ { a: 'A', b: 28 },
30
+ { a: 'B', b: 55 },
31
+ { a: 'C', b: 'not a number' },
32
+ ],
33
+ },
34
+ encoding: {
35
+ x: { field: 'a', type: 'nominal' },
36
+ y: { field: 'b', type: 'quantitative' },
37
+ },
38
+ mark: 'bar',
39
+ }),
40
+ );
41
+
42
+ expect(spec.type).toBe('bar');
43
+ expect(spec.data).toEqual([
44
+ { color: undefined, dimension: 'A', value: 28 },
45
+ { color: undefined, dimension: 'B', value: 55 },
46
+ ]);
47
+ });
48
+
49
+ it('parses a vega-lite arc chart as a pie chart', () => {
50
+ const spec = parseJsonChart(
51
+ JSON.stringify({
52
+ data: {
53
+ values: [
54
+ { category: 'x', value: 4 },
55
+ { category: 'y', value: 6 },
56
+ ],
57
+ },
58
+ encoding: {
59
+ color: { field: 'category', type: 'nominal' },
60
+ theta: { field: 'value', type: 'quantitative' },
61
+ },
62
+ mark: { type: 'arc' },
63
+ }),
64
+ );
65
+
66
+ expect(spec.type).toBe('pie');
67
+ expect(spec.data.map(({ dimension, value }) => ({ dimension, value }))).toEqual([
68
+ { dimension: 'x', value: 4 },
69
+ { dimension: 'y', value: 6 },
70
+ ]);
71
+ });
72
+
73
+ it('takes the mark from the first layer', () => {
74
+ const spec = parseJsonChart(
75
+ JSON.stringify({
76
+ data: { values: [{ t: '2024-01-01', v: 1 }] },
77
+ encoding: { x: { field: 't', type: 'temporal' }, y: { field: 'v' } },
78
+ layer: [{ mark: { type: 'line' } }],
79
+ }),
80
+ );
81
+
82
+ expect(spec.type).toBe('line');
83
+ expect(spec.isTemporalDim).toBe(true);
84
+ expect(spec.data[0]?.dimension).toBeInstanceOf(Date);
85
+ });
86
+
87
+ it('rejects JSON that is not a supported chart', () => {
88
+ expect(() => parseJsonChart(JSON.stringify({ hello: 'world' }))).toThrow(
89
+ 'Unknown type of JSON formatted chart.',
90
+ );
91
+ expect(() =>
92
+ parseJsonChart(
93
+ JSON.stringify({
94
+ data: { values: [] },
95
+ encoding: { x: { field: 'a' }, y: { field: 'b' } },
96
+ mark: 'geoshape',
97
+ }),
98
+ ),
99
+ ).toThrow();
100
+ expect(() => parseJsonChart('{ not json')).toThrow();
101
+ });
102
+ });
103
+
104
+ describe('colours', () => {
105
+ it('hashes labels case and whitespace insensitively', () => {
106
+ expect(hashLabel(' Dogs ')).toBe(hashLabel('dogs'));
107
+ expect(hashLabel('dogs')).not.toBe(hashLabel('cats'));
108
+ });
109
+
110
+ it('produces a deterministic pseudo random sequence in [0, 1]', () => {
111
+ const a = xorshift32(42);
112
+ const b = xorshift32(42);
113
+ for (let i = 0; i < 5; i++) {
114
+ const value = a();
115
+ expect(value).toBe(b());
116
+ expect(value).toBeGreaterThanOrEqual(0);
117
+ expect(value).toBeLessThanOrEqual(1);
118
+ }
119
+ });
120
+
121
+ it('gives stable, distinct colours per label', () => {
122
+ const firstRun = ['a', 'b', 'c'].map((label) => colorFromLabel(label, []));
123
+ const secondRun = ['a', 'b', 'c'].map((label) => colorFromLabel(label, []));
124
+ expect(firstRun).toEqual(secondRun);
125
+
126
+ const usedHues: number[] = [];
127
+ const distinct = ['a', 'b', 'c', 'd'].map((label) => colorFromLabel(label, usedHues));
128
+ expect(new Set(distinct).size).toBe(4);
129
+ });
130
+ });
131
+ });