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,2 @@
1
+ export * from './generate-pie-colors';
2
+ export * from './parse-json-chart';
@@ -0,0 +1,15 @@
1
+ import type { ChartSpec } from '../types';
2
+ import { parseVegalite, VegaLiteSchema } from '../vega-lite';
3
+
4
+ export const parseJsonChart = (code: string): ChartSpec => {
5
+ const json = JSON.parse(code);
6
+
7
+ try {
8
+ const parsedVegaLite = VegaLiteSchema.parse(json);
9
+ return parseVegalite(parsedVegaLite);
10
+ } catch (_error) {
11
+ /* do nothing */
12
+ }
13
+
14
+ throw new Error('Unknown type of JSON formatted chart.');
15
+ };
@@ -0,0 +1,2 @@
1
+ export * from './parser';
2
+ export * from './schema';
@@ -0,0 +1,49 @@
1
+ import type { VegaLite } from './schema';
2
+
3
+ import type { ChartSpec, Datum } from '../types';
4
+ import { colorFromLabel } from '../utils';
5
+
6
+ export const parseVegalite = (spec: VegaLite): ChartSpec => {
7
+ if (spec.type === 'pie') {
8
+ const tField = spec.encoding?.theta?.field;
9
+ const cField = spec.encoding?.color?.field;
10
+ const usedHues: number[] = [];
11
+ const data = (spec.data?.values ?? [])
12
+ .map((d) => {
13
+ const y = Number(d[tField]);
14
+ const x = cField ? String(d[cField]) : '';
15
+ return Number.isFinite(y)
16
+ ? {
17
+ dimension: x.trim(),
18
+ value: y,
19
+ color: colorFromLabel(x, usedHues),
20
+ }
21
+ : null;
22
+ })
23
+ .filter(Boolean) as Datum[];
24
+ return { type: 'pie', data };
25
+ }
26
+
27
+ const { x, y, color } = spec.encoding;
28
+ const xField = x?.field,
29
+ yField = y?.field;
30
+ const xIsTime = (x?.type ?? '').toLowerCase() === 'temporal';
31
+ const xIsNumeric = (x?.type ?? '').toLowerCase() === 'quantitative';
32
+
33
+ const data = (spec.data?.values ?? [])
34
+ .map((d) => {
35
+ const xv = xIsTime && typeof d[xField] === 'string' ? new Date(d[xField]) : d[xField];
36
+ const yv = Number(d[yField]);
37
+ if (!Number.isFinite(yv)) return null;
38
+ const c = color?.field ? String(d[color.field]) : undefined;
39
+ return { dimension: xv, value: yv, color: c };
40
+ })
41
+ .filter(Boolean) as Datum[];
42
+
43
+ return {
44
+ type: spec.type === 'xy' && spec.markName !== 'arc' ? spec.markName : 'pie',
45
+ data,
46
+ isTemporalDim: xIsTime,
47
+ isNumericDim: xIsNumeric,
48
+ };
49
+ };
@@ -0,0 +1,112 @@
1
+ import { z } from 'zod';
2
+
3
+ /* primitives */
4
+ export const VLType = z.enum(['quantitative', 'ordinal', 'nominal', 'temporal']);
5
+
6
+ const FieldRef = z.object({
7
+ field: z.string(),
8
+ type: VLType.optional(),
9
+ });
10
+
11
+ const ColorXY = z.object({
12
+ field: z.string().optional(),
13
+ type: VLType.optional(),
14
+ });
15
+ const ColorPie = z.object({ field: z.string(), type: VLType.optional() });
16
+
17
+ /* we support only these currently */
18
+ const MarkName = z.enum([
19
+ 'bar',
20
+ 'line',
21
+ 'area',
22
+ 'point',
23
+ 'arc',
24
+ // 'rect',
25
+ // 'rule',
26
+ // 'text',
27
+ // 'tick',
28
+ // 'circle',
29
+ // 'square',
30
+ // 'trail',
31
+ // 'geoshape',
32
+ // 'image',
33
+ ]);
34
+
35
+ const MarkDef = z.looseObject({
36
+ type: z.union([MarkName, z.string()]).optional(),
37
+ });
38
+
39
+ /* encodings */
40
+ const XyEncoding = z.object({
41
+ x: FieldRef,
42
+ y: FieldRef,
43
+ color: ColorXY.optional(),
44
+ });
45
+
46
+ const PieEncoding = z.object({
47
+ theta: FieldRef,
48
+ color: ColorPie.optional(),
49
+ });
50
+
51
+ /* base spec */
52
+ const BaseVL = z.object({
53
+ archetype: z.literal('vegalite'),
54
+ $schema: z.string().optional(),
55
+ data: z.object({
56
+ values: z.array(z.record(z.string(), z.unknown())),
57
+ }),
58
+ mark: z.union([MarkName, MarkDef, z.string()]).optional(),
59
+ layer: z.array(z.looseObject({ mark: MarkDef })).optional(),
60
+ marks: z.array(MarkDef).optional(),
61
+ markName: MarkName,
62
+ });
63
+
64
+ /* branches (with explicit kind) */
65
+ const VL_XY = BaseVL.extend({
66
+ type: z.literal('xy'),
67
+ encoding: XyEncoding,
68
+ }).strip();
69
+
70
+ const VL_PIE = BaseVL.extend({
71
+ type: z.literal('pie'),
72
+ encoding: PieEncoding,
73
+ }).strip();
74
+
75
+ const normalizeMarkName = (m: unknown): string | undefined => {
76
+ if (typeof m === 'string') return m.toLowerCase();
77
+ if (m && typeof m === 'object' && typeof (m as { type?: unknown }).type === 'string') {
78
+ return String((m as { type?: unknown }).type).toLowerCase();
79
+ }
80
+ return undefined;
81
+ };
82
+
83
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any -- untyped JSON input, validated by the zod schema below
84
+ const deriveMarkName = (o: any): string | undefined => {
85
+ // spec.mark (string or MarkDef)
86
+ const direct = normalizeMarkName(o?.mark);
87
+ if (direct) return direct;
88
+
89
+ // first layer's mark.type
90
+ const firstLayerMark =
91
+ Array.isArray(o?.layer) && o.layer[0]?.mark ? normalizeMarkName(o.layer[0].mark) : undefined;
92
+ if (firstLayerMark) return firstLayerMark;
93
+
94
+ // first marks[] item .type
95
+ return Array.isArray(o?.marks) && o.marks.length > 0 ? normalizeMarkName(o.marks[0]) : undefined;
96
+ };
97
+
98
+ export const VegaLiteCore = z.discriminatedUnion('type', [VL_XY, VL_PIE]);
99
+
100
+ /* final schema: preprocess to inject needed metadata, then discriminated union */
101
+ export const VegaLiteSchema = z.preprocess((raw) => {
102
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any -- untyped JSON input, validated by the zod schema below
103
+ const o: any = raw ?? {};
104
+ const markName = deriveMarkName(o);
105
+ const hasTheta = !!o?.encoding?.theta;
106
+
107
+ const type = markName === 'arc' || hasTheta ? 'pie' : 'xy';
108
+
109
+ return { ...o, type, archetype: 'vegalite', markName };
110
+ }, VegaLiteCore);
111
+
112
+ export type VegaLite = z.infer<typeof VegaLiteSchema>;
@@ -0,0 +1,158 @@
1
+ import React, { type PropsWithChildren, useEffect, useMemo, useRef, useState } from 'react';
2
+ import { Dimensions, Modal, Platform, Pressable, StyleSheet, View } from 'react-native';
3
+ import {
4
+ Gesture,
5
+ GestureDetector,
6
+ GestureHandlerRootView,
7
+ type GestureType,
8
+ } from 'react-native-gesture-handler';
9
+ import Animated, {
10
+ runOnJS,
11
+ useAnimatedStyle,
12
+ useSharedValue,
13
+ withTiming,
14
+ } from 'react-native-reanimated';
15
+
16
+ import { sheetStoreApi, useBottomSheetState } from '../store';
17
+
18
+ type Props = PropsWithChildren;
19
+
20
+ const { height: SCREEN_H } = Dimensions.get('window');
21
+ const SPRING = { duration: 200 };
22
+ const MAX_BOTTOM_SHEET_HEIGHT = Math.round(SCREEN_H * 0.4);
23
+ const BACKDROP_OPACITY = 0.4;
24
+
25
+ export function BottomSheet({ children }: Props) {
26
+ const { open, height } = useBottomSheetState();
27
+ const [bottomSheetModalOpen, setBottomSheetModalOpen] = useState(open);
28
+ const maxTranslateY = SCREEN_H;
29
+ const translateY = useSharedValue(maxTranslateY);
30
+
31
+ const bottomSheetHeight = useMemo(() => Math.min(height, MAX_BOTTOM_SHEET_HEIGHT), [height]);
32
+ const bottomSheetY = SCREEN_H - bottomSheetHeight;
33
+
34
+ useEffect(() => {
35
+ if (open) {
36
+ setBottomSheetModalOpen(true);
37
+ } else {
38
+ translateY.value = withTiming(maxTranslateY, SPRING, (finished) => {
39
+ if (finished) {
40
+ runOnJS(setBottomSheetModalOpen)(false);
41
+ }
42
+ });
43
+ }
44
+ }, [setBottomSheetModalOpen, maxTranslateY, open, translateY]);
45
+
46
+ useEffect(() => {
47
+ if (bottomSheetModalOpen && open) {
48
+ translateY.value = withTiming(bottomSheetY, SPRING);
49
+ }
50
+ }, [open, bottomSheetModalOpen, bottomSheetY, translateY]);
51
+
52
+ const dragStartY = useRef(0);
53
+ const panRef = useRef<GestureType | undefined>(undefined);
54
+ const scrollRef = useRef<GestureType | undefined>(undefined);
55
+
56
+ const nativeScroll = useMemo(() => Gesture.Native().withRef(scrollRef), []);
57
+
58
+ const pan = Gesture.Pan()
59
+ .withRef(panRef)
60
+ .requireExternalGestureToFail(scrollRef)
61
+ .onBegin(() => {
62
+ dragStartY.current = 0;
63
+ })
64
+ .onUpdate((e) => {
65
+ if (dragStartY.current === 0) dragStartY.current = translateY.value;
66
+ const next = dragStartY.current + e.translationY;
67
+ const minY = bottomSheetY;
68
+ const maxY = maxTranslateY;
69
+ const overTop = next < minY;
70
+ const overBottom = next > maxY;
71
+ translateY.value = overTop
72
+ ? minY - (minY - next) * 0.2
73
+ : overBottom
74
+ ? maxY + (next - maxY) * 0.2
75
+ : next;
76
+ })
77
+ .onEnd((e) => {
78
+ // very basic momentum bias
79
+ const projected = e.translationY + e.velocityY * 0.15;
80
+ const nearest = projected >= bottomSheetHeight * 0.5 ? maxTranslateY : bottomSheetY;
81
+ translateY.value = withTiming(nearest, SPRING, (finished) => {
82
+ if (finished && nearest === maxTranslateY) runOnJS(sheetStoreApi.closeSheet)();
83
+ });
84
+ });
85
+
86
+ const backdropStyle = useAnimatedStyle(() => {
87
+ const minY = bottomSheetY;
88
+ const t = 1 - Math.min(1, Math.max(0, (translateY.value - minY) / (maxTranslateY - minY)));
89
+ return {
90
+ opacity: t * BACKDROP_OPACITY,
91
+ pointerEvents: t > 0.02 ? ('auto' as const) : ('none' as const),
92
+ };
93
+ });
94
+
95
+ const sheetStyle = useAnimatedStyle(() => ({
96
+ transform: [{ translateY: translateY.value }],
97
+ }));
98
+
99
+ const sheetContentStyle = useMemo(() => ({ height: bottomSheetHeight }), [bottomSheetHeight]);
100
+
101
+ return (
102
+ <Modal visible={bottomSheetModalOpen} transparent={true}>
103
+ <GestureHandlerRootView style={styles.gestureHandlerRootView}>
104
+ <View style={StyleSheet.absoluteFill} pointerEvents={'box-none'}>
105
+ <Animated.View style={[StyleSheet.absoluteFill, styles.backdrop, backdropStyle]}>
106
+ <Pressable style={StyleSheet.absoluteFill} onPress={sheetStoreApi.closeSheet} />
107
+ </Animated.View>
108
+
109
+ <GestureDetector gesture={pan}>
110
+ <Animated.View style={[styles.sheet, sheetStyle]}>
111
+ <View style={styles.handleContainer} pointerEvents={'none'}>
112
+ <View style={styles.handle} />
113
+ </View>
114
+
115
+ <View style={[styles.content, sheetContentStyle]}>
116
+ <View style={styles.contentContainer}>
117
+ {open ? (
118
+ <GestureDetector gesture={nativeScroll}>{children}</GestureDetector>
119
+ ) : null}
120
+ </View>
121
+ </View>
122
+ </Animated.View>
123
+ </GestureDetector>
124
+ </View>
125
+ </GestureHandlerRootView>
126
+ </Modal>
127
+ );
128
+ }
129
+
130
+ const styles = StyleSheet.create({
131
+ gestureHandlerRootView: { flex: 1 },
132
+ backdrop: { backgroundColor: '#000' },
133
+ sheet: {
134
+ position: 'absolute',
135
+ overflow: 'hidden',
136
+ left: 0,
137
+ right: 0,
138
+ top: 0,
139
+ height: SCREEN_H,
140
+ transform: [{ translateY: SCREEN_H }],
141
+ borderTopLeftRadius: 20,
142
+ borderTopRightRadius: 20,
143
+ backgroundColor: 'white',
144
+ ...Platform.select({
145
+ ios: {
146
+ shadowColor: '#000',
147
+ shadowOpacity: 0.2,
148
+ shadowOffset: { width: 0, height: -4 },
149
+ shadowRadius: 12,
150
+ },
151
+ android: { elevation: 18 },
152
+ }),
153
+ },
154
+ handleContainer: { alignItems: 'center', paddingVertical: 8 },
155
+ handle: { width: 40, height: 4, borderRadius: 2, backgroundColor: '#444' },
156
+ content: { flexGrow: 0 },
157
+ contentContainer: { flex: 1, minHeight: 0 },
158
+ });
@@ -0,0 +1,92 @@
1
+ import { type PropsWithChildren, useMemo } from 'react';
2
+ import { type LayoutChangeEvent, StyleSheet, View } from 'react-native';
3
+ import { Gesture, GestureDetector } from 'react-native-gesture-handler';
4
+ import Animated, { clamp, scrollTo, useAnimatedRef, useSharedValue } from 'react-native-reanimated';
5
+
6
+ import { useStableCallback } from '../internal/hooks/useStableCallback';
7
+
8
+ export const MarkdownReactiveScrollView = ({ children }: PropsWithChildren) => {
9
+ const scrollViewRef = useAnimatedRef<Animated.ScrollView>();
10
+ const contentWidth = useSharedValue(0);
11
+ const visibleContentWidth = useSharedValue(0);
12
+ const offsetBeforeScroll = useSharedValue(0);
13
+ const touchStart = useSharedValue<{ x: number; y: number } | null>(null);
14
+
15
+ const panGesture = useMemo(
16
+ () =>
17
+ Gesture.Pan()
18
+ .onBegin((event) => {
19
+ touchStart.value = { x: event.x, y: event.y };
20
+ })
21
+ .onTouchesMove((event, state) => {
22
+ if (!touchStart.value || !event.changedTouches.length) {
23
+ state.fail();
24
+ return;
25
+ }
26
+
27
+ const xDiff = Math.abs(event.changedTouches[0]!.x - touchStart.value.x);
28
+ const yDiff = Math.abs(event.changedTouches[0]!.y - touchStart.value.y);
29
+ const isHorizontalPanning = xDiff > yDiff;
30
+
31
+ if (isHorizontalPanning) {
32
+ state.activate();
33
+ } else {
34
+ state.fail();
35
+ }
36
+ })
37
+ .onUpdate((event) => {
38
+ const { translationX } = event;
39
+
40
+ scrollTo(scrollViewRef, offsetBeforeScroll.value - translationX, 0, false);
41
+ })
42
+ .onEnd((event) => {
43
+ const { translationX } = event;
44
+
45
+ const velocityEffect = event.velocityX * 0.3;
46
+
47
+ const finalPosition = clamp(
48
+ offsetBeforeScroll.value - translationX - velocityEffect,
49
+ 0,
50
+ contentWidth.value - visibleContentWidth.value,
51
+ );
52
+
53
+ offsetBeforeScroll.value = finalPosition;
54
+
55
+ scrollTo(scrollViewRef, finalPosition, 0, true);
56
+ }),
57
+ [contentWidth, offsetBeforeScroll, scrollViewRef, touchStart, visibleContentWidth],
58
+ );
59
+
60
+ const onContentSizeChange = useStableCallback((width: number) => {
61
+ contentWidth.value = width;
62
+ });
63
+
64
+ const onLayout = useStableCallback((event: LayoutChangeEvent) => {
65
+ visibleContentWidth.value = event.nativeEvent.layout.width;
66
+ });
67
+
68
+ return (
69
+ <View style={styles.wrapper}>
70
+ <GestureDetector gesture={panGesture}>
71
+ <Animated.ScrollView
72
+ contentContainerStyle={styles.contentContainer}
73
+ horizontal
74
+ nestedScrollEnabled={true}
75
+ onContentSizeChange={onContentSizeChange}
76
+ onLayout={onLayout}
77
+ ref={scrollViewRef}
78
+ scrollEnabled={false}
79
+ >
80
+ {children}
81
+ </Animated.ScrollView>
82
+ </GestureDetector>
83
+ </View>
84
+ );
85
+ };
86
+
87
+ const styles = StyleSheet.create({
88
+ wrapper: {
89
+ width: '100%',
90
+ },
91
+ contentContainer: { flexGrow: 1 },
92
+ });
@@ -0,0 +1,2 @@
1
+ export * from './MarkdownReactiveScrollView';
2
+ export * from '../native/PerfText';
@@ -0,0 +1,73 @@
1
+ import React, { type PropsWithChildren, useMemo, useState } from 'react';
2
+
3
+ import type { StateStore } from '@stream-io/state-store';
4
+
5
+ import { useStableCallback } from '../internal/hooks/useStableCallback';
6
+ import type { ComposerViewProps } from '../message-composer';
7
+ import { MediaPickerService } from '../services';
8
+ import type { AbstractMediaPickerService } from '../services/media-picker-service/AbstractMediaPickerService';
9
+ import { type ComposerState, createNewComposerStore } from '../store';
10
+
11
+ export type ComposerContext = {
12
+ state: StateStore<ComposerState>;
13
+ setText: (text: string) => void | Promise<void>;
14
+ sendMessage: () => void | Promise<void>;
15
+ mediaPickerService?: AbstractMediaPickerService;
16
+ };
17
+
18
+ export type ComposerContextProps = PropsWithChildren<
19
+ Pick<ComposerViewProps, 'onSendMessage' | 'mediaPickerService' | 'state'>
20
+ >;
21
+
22
+ export const ComposerContext = React.createContext<ComposerContext | undefined>(undefined);
23
+
24
+ export const ComposerProvider = ({
25
+ onSendMessage,
26
+ mediaPickerService: mediaPickerServiceOverride,
27
+ state: stateOverride,
28
+ children,
29
+ }: ComposerContextProps) => {
30
+ const [mediaPickerService] = useState(
31
+ () => mediaPickerServiceOverride ?? (MediaPickerService ? new MediaPickerService() : undefined),
32
+ );
33
+ const [state] = useState(() => stateOverride ?? createNewComposerStore());
34
+
35
+ const setText = useStableCallback((text: string) => state.partialNext({ text }));
36
+
37
+ const clearState = useStableCallback(() => {
38
+ setText('');
39
+ mediaPickerService?.clearAssets();
40
+ });
41
+
42
+ const sendMessage = useStableCallback(async () => {
43
+ const { text, custom } = state.getLatestValue();
44
+
45
+ const data = {
46
+ text,
47
+ attachments: mediaPickerService?.state.getLatestValue().assets,
48
+ custom,
49
+ };
50
+
51
+ clearState();
52
+
53
+ await onSendMessage(data);
54
+ });
55
+
56
+ const contextValue = useMemo(
57
+ () => ({ mediaPickerService, state, setText, sendMessage, clearState }),
58
+ [state, mediaPickerService, setText, sendMessage, clearState],
59
+ );
60
+
61
+ return <ComposerContext.Provider value={contextValue}>{children}</ComposerContext.Provider>;
62
+ };
63
+
64
+ export const useMessageComposerContext = () => {
65
+ const value = React.useContext(ComposerContext);
66
+ if (value === undefined) {
67
+ throw new Error(
68
+ 'The useMessageComposerContext hook was called outside of the ComposerContext provider.',
69
+ );
70
+ }
71
+
72
+ return value;
73
+ };
@@ -0,0 +1,2 @@
1
+ export * from './composer-context';
2
+ export * from './theme-context';
@@ -0,0 +1,68 @@
1
+ import React, { createContext, type PropsWithChildren, useContext, useMemo } from 'react';
2
+
3
+ import merge from 'lodash/merge';
4
+
5
+ import { defaultTheme, type Theme } from '../theme';
6
+
7
+ export type DeepPartial<T> = T extends (...args: never[]) => unknown
8
+ ? T
9
+ : T extends object
10
+ ? { [K in keyof T]?: DeepPartial<T[K]> }
11
+ : T;
12
+
13
+ export type StreamThemeInputValue = {
14
+ mergedStyle?: Theme;
15
+ style?: DeepPartial<Theme>;
16
+ };
17
+
18
+ export type MergedThemesParams = {
19
+ style?: DeepPartial<Theme>;
20
+ theme?: Theme;
21
+ };
22
+
23
+ export type ThemeContextValue = {
24
+ theme: Theme;
25
+ };
26
+
27
+ export const mergeThemes = (params: MergedThemesParams) => {
28
+ const { style, theme } = params;
29
+ // TODO: Use structured-clone here or something similar.
30
+ const finalTheme = (
31
+ !theme || Object.keys(theme).length === 0
32
+ ? JSON.parse(JSON.stringify(defaultTheme))
33
+ : JSON.parse(JSON.stringify(theme))
34
+ ) as Theme;
35
+
36
+ if (style) {
37
+ merge(finalTheme, style);
38
+ }
39
+
40
+ return finalTheme;
41
+ };
42
+
43
+ export const ThemeContext = createContext<Theme | undefined>(undefined);
44
+
45
+ export const StreamTheme = (
46
+ props: PropsWithChildren<StreamThemeInputValue & Partial<ThemeContextValue>>,
47
+ ) => {
48
+ const { children, mergedStyle, style, theme } = props;
49
+
50
+ const modifiedTheme = useMemo(() => {
51
+ if (mergedStyle) {
52
+ return mergedStyle;
53
+ }
54
+
55
+ return mergeThemes({ style, theme });
56
+ }, [mergedStyle, style, theme]);
57
+
58
+ return <ThemeContext.Provider value={modifiedTheme}>{children}</ThemeContext.Provider>;
59
+ };
60
+
61
+ export const useTheme = () => {
62
+ const theme = useContext(ThemeContext);
63
+
64
+ if (theme === undefined) {
65
+ throw new Error('The useTheme hook was called outside the StreamTheme Provider.');
66
+ }
67
+ return { theme };
68
+ };
@@ -0,0 +1,29 @@
1
+ // primitives
2
+ export * from './markdown';
3
+ export * from './syntax-highlighting';
4
+ export * from './charts';
5
+ export * from './message-composer';
6
+ export * from './StreamingMessageView';
7
+ export * from './AITypingIndicatorView';
8
+
9
+ // components
10
+ export * from './components';
11
+
12
+ // contexts
13
+ export * from './contexts';
14
+
15
+ // services
16
+ export * from './services';
17
+ export * from './transcription/useDictation';
18
+ export { isDictationAvailable } from './native/AIDictation';
19
+
20
+ // state-stores
21
+ export * from './store';
22
+
23
+ // theme
24
+ export * from './theme';
25
+
26
+ // Native handler registration, used by the `stream-chat-react-native/ai-components` and
27
+ // `stream-chat-expo/ai-components` entry points to register only the native pieces this entry
28
+ // point needs (without importing, and therefore bundling, the main SDK entry point).
29
+ export { registerNativeHandlers } from '../native';
@@ -0,0 +1,37 @@
1
+ import { useCallback, useRef } from 'react';
2
+
3
+ export type StableCallback<A extends unknown[], R> = (...args: A) => R;
4
+
5
+ /**
6
+ * A utility hook implementing a stable callback. It takes in an unstable method that
7
+ * is supposed to be invoked somewhere deeper in the DOM tree without making it
8
+ * change its reference every time the parent component rerenders. It will also return
9
+ * the value of the callback if it does return one.
10
+ * A common use-case would be having a function whose invocation depends on state
11
+ * somewhere high up in the DOM tree and wanting to use the same function deeper
12
+ * down, for example in a leaf node and simply using useCallback results in
13
+ * cascading dependency hell. If we wrap it in useStableCallback, we would be able
14
+ * to:
15
+ * - Use the same function as a dependency of another hook (since it is stable)
16
+ * - Still invoke it and get the latest state
17
+ *
18
+ * **Caveats:**
19
+ * - Never wrap a function that is supposed to return a React.ReactElement in
20
+ * useStableCallback, since React will not know that the DOM needs to be updated
21
+ * whenever the callback value changes (for example, renderItem from FlatList must
22
+ * never be wrapped in this hook)
23
+ * - Always prefer using a standard useCallback/stable function wherever possible
24
+ * (the purpose of useStableCallback is to bridge the gap between top level contexts
25
+ * and cascading rereders in downstream components - **not** as an escape hatch)
26
+ * @param callback - the callback we want to stabilize
27
+ */
28
+ export const useStableCallback = <A extends unknown[], R>(
29
+ callback: StableCallback<A, R>,
30
+ ): StableCallback<A, R> => {
31
+ const ref = useRef(callback);
32
+ ref.current = callback;
33
+
34
+ return useCallback<StableCallback<A, R>>((...args) => {
35
+ return ref.current(...args);
36
+ }, []);
37
+ };
@@ -0,0 +1,12 @@
1
+ import React from 'react';
2
+
3
+ import { type IconProps, RootPath, RootSvg } from './utils/base';
4
+
5
+ export const Camera = (props: IconProps) => (
6
+ <RootSvg {...props}>
7
+ <RootPath
8
+ d='M15 3H9L7 5H3a1 1 0 00-1 1v14a1 1 0 001 1h18a1 1 0 001-1V6a1 1 0 00-1-1h-4l-2-2zM7.828 7l2-2h4.344l2 2H20v12H4V7h3.828zM12 18a5.5 5.5 0 110-11 5.5 5.5 0 010 11zm3.5-5.5a3.5 3.5 0 11-7 0 3.5 3.5 0 017 0z'
9
+ {...props}
10
+ />
11
+ </RootSvg>
12
+ );
@@ -0,0 +1,18 @@
1
+ import React from 'react';
2
+
3
+ import { Path, Svg } from 'react-native-svg';
4
+
5
+ import type { IconProps } from './utils/base';
6
+
7
+ type Props = IconProps & {
8
+ size: number;
9
+ };
10
+
11
+ export const CircleStop = ({ size, ...rest }: Props) => (
12
+ <Svg fill={'none'} height={size} viewBox={`0 0 ${size} ${size}`} width={size}>
13
+ <Path
14
+ d='M16.4551 27.2441C22.6309 27.2441 27.7441 22.1198 27.7441 15.9551C27.7441 9.7793 22.6198 4.66602 16.444 4.66602C10.2793 4.66602 5.16602 9.7793 5.16602 15.9551C5.16602 22.1198 10.2904 27.2441 16.4551 27.2441ZM16.4551 25.3626C11.2311 25.3626 7.05859 21.179 7.05859 15.9551C7.05859 10.7311 11.2201 6.54753 16.444 6.54753C21.668 6.54753 25.8516 10.7311 25.8626 15.9551C25.8737 21.179 21.679 25.3626 16.4551 25.3626ZM13.5221 19.9837H19.3659C20.0632 19.9837 20.4727 19.5742 20.4727 18.8991V13.0111C20.4727 12.3249 20.0632 11.9264 19.3659 11.9264H13.5221C12.8359 11.9264 12.4154 12.3249 12.4154 13.0111V18.8991C12.4154 19.5742 12.8359 19.9837 13.5221 19.9837Z'
15
+ {...rest}
16
+ />
17
+ </Svg>
18
+ );