stream-chat-react-native-core 9.9.4 → 9.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (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,107 @@
1
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ exports.cssToRNTextStyle = void 0;
6
+ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
7
+ var EM_DEFAULT = 16;
8
+ var len = (v, {
9
+ baseFontSize,
10
+ rootFontSize
11
+ }) => {
12
+ if (v == null) return undefined;
13
+ if (typeof v === 'number') return v;
14
+ if (typeof v !== 'string') return undefined;
15
+ var s = v.trim().toLowerCase();
16
+ if (s.endsWith('px')) {
17
+ var _n = Number(s.slice(0, -2));
18
+ return Number.isFinite(_n) ? _n : undefined;
19
+ }
20
+ if (s.endsWith('em')) {
21
+ var _n2 = Number(s.slice(0, -2));
22
+ return Number.isFinite(_n2) ? _n2 * (baseFontSize != null ? baseFontSize : EM_DEFAULT) : undefined;
23
+ }
24
+ if (s.endsWith('rem')) {
25
+ var _ref;
26
+ var _n3 = Number(s.slice(0, -3));
27
+ var root = (_ref = rootFontSize != null ? rootFontSize : baseFontSize) != null ? _ref : EM_DEFAULT;
28
+ return Number.isFinite(_n3) ? _n3 * root : undefined;
29
+ }
30
+ var n = Number(s);
31
+ return Number.isFinite(n) ? n : undefined;
32
+ };
33
+ var parseFontShorthand = (v, opts) => {
34
+ var _parts$i;
35
+ var out = {};
36
+ var parts = v.split(/\s+/);
37
+ var i = 0;
38
+ if (parts[i] === 'italic' || parts[i] === 'normal') {
39
+ if (parts[i] !== 'normal') out.fontStyle = 'italic';
40
+ i++;
41
+ }
42
+ if (parts[i] === 'small-caps') {
43
+ out.fontVariant = ['small-caps'];
44
+ i++;
45
+ }
46
+ if (/^(normal|bold|[1-9]00)$/.test((_parts$i = parts[i]) != null ? _parts$i : '')) {
47
+ var token = parts[i];
48
+ out.fontWeight = token === 'normal' ? undefined : token;
49
+ i++;
50
+ }
51
+ var sizeToken = parts[i];
52
+ if (sizeToken && (/.+(px|em|rem)$/.test(sizeToken) || /^[\d.]+(\/[\d.]+)?(px|em|rem)?$/.test(sizeToken))) {
53
+ var _sizeToken$split = sizeToken.split('/'),
54
+ _sizeToken$split2 = (0, _slicedToArray2.default)(_sizeToken$split, 2),
55
+ fs = _sizeToken$split2[0],
56
+ lh = _sizeToken$split2[1];
57
+ var fontSize = len(fs, opts);
58
+ if (fontSize != null) out.fontSize = fontSize;
59
+ if (lh) {
60
+ var lineHeight = len(lh, opts);
61
+ if (lineHeight != null) out.lineHeight = lineHeight;
62
+ }
63
+ i++;
64
+ }
65
+ var family = parts.slice(i).join(' ').replace(/^,|,$/g, '').trim();
66
+ if (family) {
67
+ var _family$split$;
68
+ var first = (_family$split$ = family.split(',')[0]) == null ? void 0 : _family$split$.trim().replace(/^["']|["']$/g, '');
69
+ if (first) out.fontFamily = first;
70
+ }
71
+ return out;
72
+ };
73
+ var cssToRNTextStyle = (css, options = {}) => {
74
+ var _options$baseFontSize, _ref2, _options$rootFontSize, _ref3, _css$overflow;
75
+ var opts = {
76
+ baseFontSize: (_options$baseFontSize = options.baseFontSize) != null ? _options$baseFontSize : EM_DEFAULT,
77
+ rootFontSize: (_ref2 = (_options$rootFontSize = options.rootFontSize) != null ? _options$rootFontSize : options.baseFontSize) != null ? _ref2 : EM_DEFAULT
78
+ };
79
+ var out = {};
80
+ if (css.color) out.color = String(css.color);
81
+ if (css.fontFamily) out.fontFamily = String(css.fontFamily);
82
+ if (css.fontStyle) out.fontStyle = css.fontStyle;
83
+ if (css.fontWeight) out.fontWeight = String(css.fontWeight);
84
+ if (css.fontSize != null) {
85
+ var n = len(css.fontSize, opts);
86
+ if (n != null) out.fontSize = n;
87
+ }
88
+ if (css.lineHeight != null) {
89
+ var _n4 = len(css.lineHeight, opts);
90
+ if (_n4 != null) out.lineHeight = _n4;
91
+ }
92
+ if (css.letterSpacing != null) {
93
+ var _n5 = len(css.letterSpacing, opts);
94
+ if (_n5 != null) out.letterSpacing = _n5;
95
+ }
96
+ if (css.textAlign) out.textAlign = css.textAlign;
97
+ if (css.font && typeof css.font === 'string') {
98
+ Object.assign(out, parseFontShorthand(css.font, opts));
99
+ }
100
+ var overflowLike = (_ref3 = (_css$overflow = css.overflow) != null ? _css$overflow : css.overflowX) != null ? _ref3 : css.overflowY;
101
+ if (typeof overflowLike === 'string') {
102
+ out.overflow = overflowLike === 'hidden' ? 'hidden' : overflowLike === 'scroll' || overflowLike === 'auto' ? 'scroll' : 'visible';
103
+ }
104
+ return out;
105
+ };
106
+ exports.cssToRNTextStyle = cssToRNTextStyle;
107
+ //# sourceMappingURL=converter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["EM_DEFAULT","len","v","baseFontSize","rootFontSize","undefined","s","trim","toLowerCase","endsWith","n","Number","slice","isFinite","_ref","root","parseFontShorthand","opts","_parts$i","out","parts","split","i","fontStyle","fontVariant","test","token","fontWeight","sizeToken","_sizeToken$split","_sizeToken$split2","_slicedToArray2","default","fs","lh","fontSize","lineHeight","family","join","replace","_family$split$","first","fontFamily","cssToRNTextStyle","css","options","_options$baseFontSize","_ref2","_options$rootFontSize","_ref3","_css$overflow","color","String","letterSpacing","textAlign","font","Object","assign","overflowLike","overflow","overflowX","overflowY","exports"],"sourceRoot":"../../../../../src","sources":["ai-components/syntax-highlighting/utils/converter.ts"],"mappings":";;;;;;AAIA,IAAMA,UAAU,GAAG,EAAE;AAMrB,IAAMC,GAAG,GAAGA,CAACC,CAAU,EAAE;EAAEC,YAAY;EAAEC;AAA0B,CAAC,KAAyB;EAC3F,IAAIF,CAAC,IAAI,IAAI,EAAE,OAAOG,SAAS;EAC/B,IAAI,OAAOH,CAAC,KAAK,QAAQ,EAAE,OAAOA,CAAC;EACnC,IAAI,OAAOA,CAAC,KAAK,QAAQ,EAAE,OAAOG,SAAS;EAE3C,IAAMC,CAAC,GAAGJ,CAAC,CAACK,IAAI,CAAC,CAAC,CAACC,WAAW,CAAC,CAAC;EAChC,IAAIF,CAAC,CAACG,QAAQ,CAAC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S;EACnE,IAAI,OAAOH,YAAY,KAAK,QAAQ,EAAE;IACpCvC,GAAG,CAACwC,QAAQ,GACVD,YAAY,KAAK,QAAQ,GACrB,QAAQ,GACRA,YAAY,KAAK,QAAQ,IAAIA,YAAY,KAAK,MAAM,GAClD,QAAQ,GACR,SAAS;EACnB;EAEA,OAAOvC,GAAG;AACZ,CAAC;AAAC2C,OAAA,CAAAnB,gBAAA,GAAAA,gBAAA","ignoreList":[]}
@@ -0,0 +1,139 @@
1
+ Object.defineProperty(exports, "__esModule", {
2
+ value: true
3
+ });
4
+ exports.flattenRowsToTextAndColorRanges = exports.flattenNodesToTextAndColorRanges = void 0;
5
+ var _reactNative = require("react-native");
6
+ var _createElement = require("react-syntax-highlighter/dist/esm/create-element");
7
+ function _createForOfIteratorHelperLoose(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (t) return (t = t.call(r)).next.bind(t); if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var o = 0; return function () { return o >= r.length ? { done: !0 } : { done: !1, value: r[o++] }; }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
8
+ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
9
+ function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
10
+ var flattenNodesToTextAndColorRanges = ({
11
+ nodes,
12
+ stylesheet,
13
+ defaultColor,
14
+ fontFamily,
15
+ fontSize = 13
16
+ }) => {
17
+ var text = '';
18
+ var rawRanges = [];
19
+ var startingStyle = {
20
+ fontFamily,
21
+ fontSize
22
+ };
23
+ var walk = (node, inheritedColor) => {
24
+ if (!node) return;
25
+ var type = node.type,
26
+ tagName = node.tagName,
27
+ value = node.value,
28
+ properties = node.properties;
29
+ if (type === 'text') {
30
+ if (value == null || value === '') return;
31
+ var chunk = String(value);
32
+ var start = text.length;
33
+ text += chunk;
34
+ var color = inheritedColor != null ? inheritedColor : defaultColor;
35
+ if (color != null && chunk.length) {
36
+ rawRanges.push({
37
+ start,
38
+ end: start + chunk.length,
39
+ color
40
+ });
41
+ }
42
+ return;
43
+ }
44
+ if (tagName) {
45
+ var _ref, _color;
46
+ var baseStyle = properties && properties.className ? (0, _createElement.createStyleObject)(properties.className, Object.assign({
47
+ color: defaultColor
48
+ }, properties.style, startingStyle), stylesheet) : {
49
+ ...startingStyle,
50
+ color: defaultColor
51
+ };
52
+ var effectiveColor = (_ref = (_color = baseStyle.color) != null ? _color : inheritedColor) != null ? _ref : defaultColor;
53
+ var children = node.children || [];
54
+ var childArray = Array.isArray(children) ? children : [children];
55
+ for (var i = 0; i < childArray.length; i++) {
56
+ walk(childArray[i], effectiveColor);
57
+ }
58
+ return;
59
+ }
60
+ if (value != null) {
61
+ var _chunk = String(value);
62
+ var _start = text.length;
63
+ text += _chunk;
64
+ var _color2 = inheritedColor != null ? inheritedColor : defaultColor;
65
+ if (_color2 != null && _chunk.length) {
66
+ rawRanges.push({
67
+ start: _start,
68
+ end: _start + _chunk.length,
69
+ color: _color2
70
+ });
71
+ }
72
+ }
73
+ };
74
+ var nodeArray = Array.isArray(nodes) ? nodes : [nodes];
75
+ for (var i = 0; i < nodeArray.length; i++) {
76
+ walk(nodeArray[i], defaultColor);
77
+ }
78
+ rawRanges.sort((a, b) => a.start - b.start);
79
+ var merged = [];
80
+ for (var _i = 0; _i < rawRanges.length; _i++) {
81
+ var r = rawRanges[_i];
82
+ var colorInt = (0, _reactNative.processColor)(r.color);
83
+ if (!merged.length) {
84
+ merged.push({
85
+ start: r.start,
86
+ end: r.end,
87
+ color: colorInt
88
+ });
89
+ continue;
90
+ }
91
+ var last = merged[merged.length - 1];
92
+ if (last && last.end === r.start && last.color === colorInt) {
93
+ last.end = r.end;
94
+ } else {
95
+ merged.push({
96
+ start: r.start,
97
+ end: r.end,
98
+ color: colorInt
99
+ });
100
+ }
101
+ }
102
+ return {
103
+ text,
104
+ ranges: merged
105
+ };
106
+ };
107
+ exports.flattenNodesToTextAndColorRanges = flattenNodesToTextAndColorRanges;
108
+ var flattenRowsToTextAndColorRanges = (rows, opts) => {
109
+ var fullText = '';
110
+ var fullRanges = [];
111
+ for (var rowIndex = 0; rowIndex < rows.length; rowIndex++) {
112
+ var rowNodes = rows[rowIndex];
113
+ var _flattenNodesToTextAn = flattenNodesToTextAndColorRanges({
114
+ ...opts,
115
+ nodes: rowNodes != null ? rowNodes : []
116
+ }),
117
+ text = _flattenNodesToTextAn.text,
118
+ ranges = _flattenNodesToTextAn.ranges;
119
+ var offset = fullText.length;
120
+ fullText += text;
121
+ if (rowIndex < rows.length - 1) {
122
+ fullText += '\n';
123
+ }
124
+ for (var _iterator = _createForOfIteratorHelperLoose(ranges), _step; !(_step = _iterator()).done;) {
125
+ var r = _step.value;
126
+ fullRanges.push({
127
+ start: r.start + offset,
128
+ end: r.end + offset,
129
+ color: r.color
130
+ });
131
+ }
132
+ }
133
+ return {
134
+ text: fullText,
135
+ ranges: fullRanges
136
+ };
137
+ };
138
+ exports.flattenRowsToTextAndColorRanges = flattenRowsToTextAndColorRanges;
139
+ //# sourceMappingURL=flatten-nodes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_reactNative","require","_createElement","_createForOfIteratorHelperLoose","r","e","t","Symbol","iterator","call","next","bind","Array","isArray","_unsupportedIterableToArray","length","o","done","value","TypeError","a","_arrayLikeToArray","toString","slice","constructor","name","from","test","n","flattenNodesToTextAndColorRanges","nodes","stylesheet","defaultColor","fontFamily","fontSize","text","rawRanges","startingStyle","walk","node","inheritedColor","type","tagName","properties","chunk","String","start","color","push","end","_ref","_color","baseStyle","className","createStyleObject","Object","assign","style","effectiveColor","children","childArray","i","nodeArray","sort","b","merged","colorInt","processColor","last","ranges","exports","flattenRowsToTextAndColorRanges","rows","opts","fullText","fullRanges","rowIndex","rowNodes","_flattenNodesToTextAn","offset","_iterator","_step"],"sourceRoot":"../../../../../src","sources":["ai-components/syntax-highlighting/utils/flatten-nodes.ts"],"mappings":";;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAGA,IAAAC,cAAA,GAAAD,OAAA;AAAqF,SAAAE,gCAAAC,CAAA,EAAAC,CAAA,QAAAC,CAAA,yBAAAC,MAAA,IAAAH,CAAA,CAAAG,MAAA,CAAAC,QAAA,KAAAJ,CAAA,oBAAAE,CAAA,UAAAA,CAAA,GAAAA,CAAA,CAAAG,IAAA,CAAAL,CAAA,GAAAM,IAAA,CAAAC,IAAA,CAAAL,CAAA,OAAAM,KAAA,CAAAC,OAAA,CAAAT,CAAA,MAAAE,CAAA,GAAAQ,2BAAA,CAAAV,CAAA,MAAAC,CAAA,IAAAD,CAAA,uBAAAA,CAAA,CAAAW,MAAA,IAAAT,CAAA,KAAAF,CAAA,GAAAE,CAAA,OAAAU,CAAA,kCAAAA,CAAA,IAAAZ,CAAA,CAAAW,MAAA,KAAAE,IAAA,WAAAA,IAAA,MAAAC,KAAA,EAAAd,CAAA,CAAAY,CAAA,sBAAAG,SAAA;AAAA,SAAAL,4BAAAV,CAAA,EAAAgB,CAAA,QAAAhB,CAAA,2BAAAA,CAAA,SAAAiB,iBAAA,CAAAjB,CAAA,EAAAgB,CAAA,OAAAd,CAAA,MAAAgB,QAAA,CAAAb,IAAA,CAAAL,CAAA,EAAAmB,KAAA,6BAAAjB,CAAA,IAAAF,CAAA,CAAAoB,WAAA,KAAAlB,CAAA,GAAAF,CAAA,CAAAoB,WAAA,CAAAC,IAAA,aAAAnB,CAAA,cAAAA,CAAA,GAAAM,KAAA,CAAAc,IAAA,CAAAtB,CA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A,KAAA,GAAAD,SAAA,IAAA/D,IAAA,GAAE;MAAA,IAAbb,CAAC,GAAA6E,KAAA,CAAA/D,KAAA;MACVyD,UAAU,CAAC3B,IAAI,CAAC;QACdF,KAAK,EAAE1C,CAAC,CAAC0C,KAAK,GAAGiC,MAAM;QACvB9B,GAAG,EAAE7C,CAAC,CAAC6C,GAAG,GAAG8B,MAAM;QACnBhC,KAAK,EAAE3C,CAAC,CAAC2C;MACX,CAAC,CAAC;IACJ;EACF;EAEA,OAAO;IAAEZ,IAAI,EAAEuC,QAAQ;IAAEL,MAAM,EAAEM;EAAW,CAAC;AAC/C,CAAC;AAACL,OAAA,CAAAC,+BAAA,GAAAA,+BAAA","ignoreList":[]}
@@ -0,0 +1,37 @@
1
+ Object.defineProperty(exports, "__esModule", {
2
+ value: true
3
+ });
4
+ var _converter = require("./converter");
5
+ Object.keys(_converter).forEach(function (key) {
6
+ if (key === "default" || key === "__esModule") return;
7
+ if (key in exports && exports[key] === _converter[key]) return;
8
+ Object.defineProperty(exports, key, {
9
+ enumerable: true,
10
+ get: function () {
11
+ return _converter[key];
12
+ }
13
+ });
14
+ });
15
+ var _flattenNodes = require("./flatten-nodes");
16
+ Object.keys(_flattenNodes).forEach(function (key) {
17
+ if (key === "default" || key === "__esModule") return;
18
+ if (key in exports && exports[key] === _flattenNodes[key]) return;
19
+ Object.defineProperty(exports, key, {
20
+ enumerable: true,
21
+ get: function () {
22
+ return _flattenNodes[key];
23
+ }
24
+ });
25
+ });
26
+ var _renderer = require("./renderer");
27
+ Object.keys(_renderer).forEach(function (key) {
28
+ if (key === "default" || key === "__esModule") return;
29
+ if (key in exports && exports[key] === _renderer[key]) return;
30
+ Object.defineProperty(exports, key, {
31
+ enumerable: true,
32
+ get: function () {
33
+ return _renderer[key];
34
+ }
35
+ });
36
+ });
37
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_converter","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get","_flattenNodes","_renderer"],"sourceRoot":"../../../../../src","sources":["ai-components/syntax-highlighting/utils/index.ts"],"mappings":";;;AAAA,IAAAA,UAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,UAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,UAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAT,UAAA,CAAAK,GAAA;IAAA;EAAA;AAAA;AACA,IAAAK,aAAA,GAAAT,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAO,aAAA,EAAAN,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAK,aAAA,CAAAL,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAC,aAAA,CAAAL,GAAA;IAAA;EAAA;AAAA;AACA,IAAAM,SAAA,GAAAV,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAQ,SAAA,EAAAP,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAM,SAAA,CAAAN,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAE,SAAA,CAAAN,GAAA;IAAA;EAAA;AAAA","ignoreList":[]}
@@ -0,0 +1,117 @@
1
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ exports.nativeRenderer = exports.generateNewStylesheet = exports.createNativeElement = exports.createChildren = exports.DEFAULT_FONT_SIZE = void 0;
6
+ var _react = _interopRequireDefault(require("react"));
7
+ var _reactNative = require("react-native");
8
+ var _createElement = require("react-syntax-highlighter/dist/esm/create-element");
9
+ var _converter = require("./converter");
10
+ var _components = require("../components");
11
+ var _jsxRuntime = require("react/jsx-runtime");
12
+ var _jsxFileName = "/home/runner/work/stream-chat-react-native/stream-chat-react-native/package/src/ai-components/syntax-highlighting/utils/renderer.tsx";
13
+ var DEFAULT_FONT_SIZE = exports.DEFAULT_FONT_SIZE = 13;
14
+ var generateNewStylesheet = ({
15
+ stylesheet,
16
+ highlighter
17
+ }) => {
18
+ stylesheet = Array.isArray(stylesheet) ? stylesheet[0] : stylesheet;
19
+ var transformedStyle = Object.entries(stylesheet != null ? stylesheet : {}).reduce((newStylesheet, [className, style]) => {
20
+ var rn = (0, _converter.cssToRNTextStyle)(style);
21
+ newStylesheet[className] = rn;
22
+ return newStylesheet;
23
+ }, {});
24
+ var topLevel = highlighter === 'prism' ? transformedStyle['pre[class*="language-"]'] : transformedStyle.hljs;
25
+ var defaultColor = topLevel && topLevel.color || '#000';
26
+ return {
27
+ transformedStyle,
28
+ defaultColor
29
+ };
30
+ };
31
+ exports.generateNewStylesheet = generateNewStylesheet;
32
+ var createChildren = ({
33
+ stylesheet,
34
+ fontSize,
35
+ fontFamily
36
+ }) => {
37
+ var childrenCount = 0;
38
+ return (children, defaultColor) => {
39
+ childrenCount += 1;
40
+ return (children != null ? children : []).map((child, i) => createNativeElement({
41
+ node: child,
42
+ stylesheet,
43
+ key: `code-segment-${childrenCount}-${i}`,
44
+ defaultColor,
45
+ fontSize,
46
+ fontFamily
47
+ }));
48
+ };
49
+ };
50
+ exports.createChildren = createChildren;
51
+ var createNativeElement = ({
52
+ node,
53
+ stylesheet,
54
+ key,
55
+ defaultColor,
56
+ fontFamily,
57
+ fontSize = DEFAULT_FONT_SIZE
58
+ }) => {
59
+ var properties = node.properties,
60
+ type = node.type,
61
+ TagName = node.tagName,
62
+ value = node.value;
63
+ var startingStyle = {
64
+ fontFamily,
65
+ fontSize
66
+ };
67
+ if (type === 'text') {
68
+ return (0, _jsxRuntime.jsx)(_reactNative.Text, {
69
+ style: Object.assign({
70
+ color: defaultColor
71
+ }, startingStyle),
72
+ children: value
73
+ }, key);
74
+ } else if (TagName) {
75
+ var childrenFactory = createChildren({
76
+ stylesheet,
77
+ fontSize,
78
+ fontFamily
79
+ });
80
+ var style = properties ? (0, _createElement.createStyleObject)(properties.className, Object.assign({
81
+ color: defaultColor
82
+ }, properties.style, startingStyle), stylesheet) : {};
83
+ var children = childrenFactory(node.children, style.color || defaultColor);
84
+ return (0, _jsxRuntime.jsx)(_reactNative.Text, {
85
+ style: style,
86
+ children: children
87
+ }, key);
88
+ }
89
+ return null;
90
+ };
91
+ exports.createNativeElement = createNativeElement;
92
+ var nativeRenderer = ({
93
+ defaultColor,
94
+ fontFamily,
95
+ fontSize = 13
96
+ }) => {
97
+ return ({
98
+ rows,
99
+ stylesheet
100
+ }) => _reactNative.Platform.OS === 'android' ? (0, _jsxRuntime.jsx)(_components.AndroidNativeRenderer, {
101
+ rows: rows,
102
+ stylesheet: stylesheet,
103
+ defaultColor: defaultColor,
104
+ fontFamily: fontFamily,
105
+ fontSize: fontSize,
106
+ lineHeight: fontSize - 4
107
+ }) : rows.map((node, i) => createNativeElement({
108
+ node,
109
+ stylesheet,
110
+ key: `code-segment-${i}`,
111
+ defaultColor,
112
+ fontFamily,
113
+ fontSize
114
+ }));
115
+ };
116
+ exports.nativeRenderer = nativeRenderer;
117
+ //# sourceMappingURL=renderer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_react","_interopRequireDefault","require","_reactNative","_createElement","_converter","_components","_jsxRuntime","_jsxFileName","DEFAULT_FONT_SIZE","exports","generateNewStylesheet","stylesheet","highlighter","Array","isArray","transformedStyle","Object","entries","reduce","newStylesheet","className","style","rn","cssToRNTextStyle","topLevel","hljs","defaultColor","color","createChildren","fontSize","fontFamily","childrenCount","children","map","child","i","createNativeElement","node","key","properties","type","TagName","tagName","value","startingStyle","jsx","Text","assign","childrenFactory","createStyleObject","nativeRenderer","rows","Platform","OS","AndroidNativeRenderer","lineHeight"],"sourceRoot":"../../../../../src","sources":["ai-components/syntax-highlighting/utils/renderer.tsx"],"mappings":";;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAKA,IAAAE,cAAA,GAAAF,OAAA;AAEA,IAAAG,UAAA,GAAAH,OAAA;AAEA,IAAAI,WAAA,GAAAJ,OAAA;AAAsD,IAAAK,WAAA,GAAAL,OAAA;AAAA,IAAAM,YAAA;AAQ/C,IAAMC,iBAAiB,GAAAC,OAAA,CAAAD,iBAAA,GAAG,EAAE;AAE5B,IAAME,qBAAqB,GAAGA,CAAC;EACpCC,UAAU;EACVC;AAIF,CAAC,KAAK;EACJD,UAAU,GAAGE,KAAK,CAACC,OAAO,CAACH,UAAU,CAAC,GAAGA,UAAU,CAAC,CAAC,CAAC,GAAGA,UAAU;EAEnE,IAAMI,gBAAgB,GAAGC,MAAM,CAACC,OAAO,CAACN,UAAU,WAAVA,UAAU,GAAI,CAAC,CAAC,CAAC,CAACO,MAAM,CAC9D,CAACC,aAAa,EAAE,CAACC,SAAS,EAAEC,KAAK,CAAC,KAAK;IACrC,IAAMC,EAAE,GAAG,IAAAC,2BAAgB,EAACF,KAAK,CAAC;IAElCF,aAAa,CAACC,SAAS,CAAC,GAAGE,EAAa;IACxC,OAAOH,aAAa;EACtB,CAAC,EACD,CAAC,CACH,CAAC;EAED,IAAMK,QAAQ,GACZZ,WAAW,KAAK,OAAO,GAAGG,gBAAgB,CAAC,yBAAyB,CAAC,GAAGA,gBAAgB,CAACU,IAC/E;EAEZ,IAAMC,YAAY,GAAIF,QAAQ,IAAIA,QAA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C,KACfC,mBAAmB,CAAC;IAClBC,IAAI;IACJ1B,UAAU;IACV2B,GAAG,EAAE,gBAAgBH,CAAC,EAAE;IACxBT,YAAY;IACZI,UAAU;IACVD;EACF,CAAC,CACH,CACD;AACL,CAAC;AAACpB,OAAA,CAAAyC,cAAA,GAAAA,cAAA","ignoreList":[]}
@@ -0,0 +1,99 @@
1
+ Object.defineProperty(exports, "__esModule", {
2
+ value: true
3
+ });
4
+ exports.defaultTheme = exports.colors = void 0;
5
+ var colors = exports.colors = {
6
+ accent_blue: '#005FFF',
7
+ accent_red: '#FF3742',
8
+ black: '#000000',
9
+ code_block: '#DDDDDD',
10
+ grey: '#7A7A7A',
11
+ grey_neutral: '#9E9E9E',
12
+ grey_dark: '#72767E',
13
+ grey_gainsboro: '#DBDBDB',
14
+ grey_whisper: '#ECEBEB',
15
+ overlay: '#000000CC',
16
+ transparent: 'transparent',
17
+ white: '#FFFFFF',
18
+ white_smoke: '#F2F2F2',
19
+ shimmer: '#FFFFFF'
20
+ };
21
+ var defaultTheme = exports.defaultTheme = {
22
+ colors,
23
+ markdown: {
24
+ autolink: {},
25
+ blockQuoteSection: {},
26
+ blockQuoteSectionBar: {},
27
+ blockQuoteText: {},
28
+ strong: {},
29
+ codeBlock: {},
30
+ codeBlockWrapper: {},
31
+ codeBlockContainer: {},
32
+ codeBlockHeaderContainer: {},
33
+ codeBlockHeaderTitle: {},
34
+ em: {},
35
+ heading: {},
36
+ heading1: {},
37
+ heading2: {},
38
+ heading3: {},
39
+ heading4: {},
40
+ heading5: {},
41
+ heading6: {},
42
+ hr: {},
43
+ inlineCode: {},
44
+ br: {},
45
+ list: {},
46
+ listItem: {},
47
+ listItemBullet: {},
48
+ listItemNumber: {},
49
+ listItemText: {},
50
+ listRow: {},
51
+ sublist: {},
52
+ url: {},
53
+ noMargin: {},
54
+ paragraph: {},
55
+ paragraphCenter: {},
56
+ del: {},
57
+ text: {},
58
+ table: {},
59
+ tableRow: {},
60
+ tableRowCell: {},
61
+ tableHeader: {},
62
+ tableHeaderCell: {}
63
+ },
64
+ composer: {
65
+ container: {},
66
+ containerRow: {},
67
+ inputPillHeight: 48,
68
+ inputPillContainer: {},
69
+ inputPill: {},
70
+ textInput: {},
71
+ roundButton: {},
72
+ attachIcon: {},
73
+ mediaPreviewStyle: {},
74
+ mediaPreviewContentContainerStyle: {},
75
+ mediaPreviewImage: {},
76
+ mediaPreviewRemoveButton: {},
77
+ micIcon: {},
78
+ sendIcon: {},
79
+ stopGeneratingIcon: {},
80
+ iconButton: {}
81
+ },
82
+ sheet: {
83
+ contentContainer: {},
84
+ quickActionsCard: {},
85
+ divider: {},
86
+ listSection: {},
87
+ quickAction: {},
88
+ quickActionLabel: {},
89
+ listItem: {},
90
+ listIcon: {},
91
+ listTextContainer: {},
92
+ listTitle: {},
93
+ listSubtitle: {}
94
+ },
95
+ aiTypingIndicatorView: {
96
+ text: {}
97
+ }
98
+ };
99
+ //# sourceMappingURL=theme.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["colors","exports","accent_blue","accent_red","black","code_block","grey","grey_neutral","grey_dark","grey_gainsboro","grey_whisper","overlay","transparent","white","white_smoke","shimmer","defaultTheme","markdown","autolink","blockQuoteSection","blockQuoteSectionBar","blockQuoteText","strong","codeBlock","codeBlockWrapper","codeBlockContainer","codeBlockHeaderContainer","codeBlockHeaderTitle","em","heading","heading1","heading2","heading3","heading4","heading5","heading6","hr","inlineCode","br","list","listItem","listItemBullet","listItemNumber","listItemText","listRow","sublist","url","noMargin","paragraph","paragraphCenter","del","text","table","tableRow","tableRowCell","tableHeader","tableHeaderCell","composer","container","containerRow","inputPillHeight","inputPillContainer","inputPill","textInput","roundButton","attachIcon","mediaPreviewStyle","mediaPreviewContentContainerStyle","mediaPreviewImage","mediaPreviewRemoveButton","micIcon","sendIcon","stopGeneratingIcon","iconButton","sheet","contentContainer","quickActionsCard","divider","listSection","quickAction","quickActionLabel","listIcon","listTextContainer","listTitle","listSubtitle","aiTypingIndicatorView"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AAC;IACfC,gBAAgB,EAAE,CAAC,CAAC;IACpBxC,QAAQ,EAAE,CAAC,CAAC;IACZyC,QAAQ,EAAE,CAAC,CAAC;IACZC,iBAAiB,EAAE,CAAC,CAAC;IACrBC,SAAS,EAAE,CAAC,CAAC;IACbC,YAAY,EAAE,CAAC;EACjB,CAAC;EACDC,qBAAqB,EAAE;IACrBlC,IAAI,EAAE,CAAC;EACT;AACF,CAAC","ignoreList":[]}
@@ -0,0 +1,114 @@
1
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ exports.useDictation = void 0;
6
+ var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
7
+ var _react = require("react");
8
+ var _reactNative = require("react-native");
9
+ var _reactBindings = require("@stream-io/state-store/react-bindings");
10
+ var _useStableCallback = require("../internal/hooks/useStableCallback");
11
+ var _AIDictation = require("../native/AIDictation");
12
+ var _store = require("../store");
13
+ var DEFAULT_OPTIONS = {
14
+ language: 'en-US',
15
+ interimResults: true,
16
+ silenceTimeoutMs: 2500
17
+ };
18
+ var ensureAndroidRecordingPermissions = function () {
19
+ var _ref = (0, _asyncToGenerator2.default)(function* () {
20
+ if (_reactNative.Platform.OS !== 'android') return true;
21
+ var granted = yield _reactNative.PermissionsAndroid.request(_reactNative.PermissionsAndroid.PERMISSIONS.RECORD_AUDIO);
22
+ return granted === _reactNative.PermissionsAndroid.RESULTS.GRANTED;
23
+ });
24
+ return function ensureAndroidRecordingPermissions() {
25
+ return _ref.apply(this, arguments);
26
+ };
27
+ }();
28
+ var selector = ({
29
+ isRecording
30
+ }) => ({
31
+ isRecording
32
+ });
33
+ var useDictation = (defaultOptions = DEFAULT_OPTIONS) => {
34
+ var _useStateStore = (0, _reactBindings.useStateStore)(_store.dictationStore, selector),
35
+ isRecording = _useStateStore.isRecording;
36
+ (0, _react.useEffect)(() => {
37
+ var unsubscribeResult = _AIDictation.AIDictation.addResultListener(result => {
38
+ _store.dictationStore.partialNext({
39
+ transcript: result.text,
40
+ ...(result.isFinal ? {
41
+ isRecording: false,
42
+ state: 'idle'
43
+ } : {})
44
+ });
45
+ });
46
+ var unsubscribeState = _AIDictation.AIDictation.addStateListener(({
47
+ state: next
48
+ }) => {
49
+ _store.dictationStore.partialNext({
50
+ state: next,
51
+ isRecording: next === 'listening' || next === 'starting'
52
+ });
53
+ });
54
+ var unsubscribeError = _AIDictation.AIDictation.addErrorListener(error => {
55
+ _store.dictationStore.partialNext({
56
+ error,
57
+ isRecording: false,
58
+ state: 'idle'
59
+ });
60
+ });
61
+ return () => {
62
+ unsubscribeResult();
63
+ unsubscribeState();
64
+ unsubscribeError();
65
+ };
66
+ }, []);
67
+ var start = (0, _react.useCallback)(function () {
68
+ var _ref2 = (0, _asyncToGenerator2.default)(function* (override) {
69
+ var hasPermission = yield ensureAndroidRecordingPermissions();
70
+ if (!hasPermission) {
71
+ _store.dictationStore.partialNext({
72
+ error: {
73
+ code: 'NO_PERMISSION',
74
+ message: 'Microphone permission not granted'
75
+ }
76
+ });
77
+ return;
78
+ }
79
+ _store.dictationStore.partialNext({
80
+ error: null,
81
+ transcript: ''
82
+ });
83
+ var opts = {
84
+ ...defaultOptions,
85
+ ...override
86
+ };
87
+ _AIDictation.AIDictation.start(opts);
88
+ });
89
+ return function (_x) {
90
+ return _ref2.apply(this, arguments);
91
+ };
92
+ }(), [defaultOptions]);
93
+ var stop = (0, _react.useCallback)(() => {
94
+ _AIDictation.AIDictation.stop();
95
+ }, []);
96
+ var cancel = (0, _react.useCallback)(() => {
97
+ _AIDictation.AIDictation.cancel();
98
+ }, []);
99
+ var toggle = (0, _useStableCallback.useStableCallback)(() => {
100
+ if (isRecording) {
101
+ stop();
102
+ } else {
103
+ void start();
104
+ }
105
+ });
106
+ return {
107
+ start,
108
+ stop,
109
+ toggle,
110
+ cancel
111
+ };
112
+ };
113
+ exports.useDictation = useDictation;
114
+ //# sourceMappingURL=useDictation.js.map