stream-chat-react-native-core 9.9.4-beta.1 → 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,12 @@
1
+ import React from 'react';
2
+
3
+ import { type IconProps, RootPath, RootSvg } from './utils/base';
4
+
5
+ export const Close = (props: IconProps) => (
6
+ <RootSvg {...props}>
7
+ <RootPath
8
+ d='M7.05 7.05a1 1 0 000 1.414L10.586 12 7.05 15.536a1 1 0 101.414 1.414L12 13.414l3.536 3.536a1 1 0 001.414-1.414L13.414 12l3.536-3.536a1 1 0 00-1.414-1.414L12 10.586 8.464 7.05a1 1 0 00-1.414 0z'
9
+ {...props}
10
+ />
11
+ </RootSvg>
12
+ );
@@ -0,0 +1,20 @@
1
+ import React from 'react';
2
+
3
+ import { G, 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 Mic = ({ size, ...rest }: Props) => (
12
+ <Svg height={size} viewBox={`0 0 ${size} ${size}`} width={size} {...rest}>
13
+ <G id='24 / mic_iOS'>
14
+ <Path
15
+ d='M11.5234 13.9922C11.5234 16.8047 13.375 18.7734 16 18.7734C18.6367 18.7734 20.4766 16.8047 20.4766 13.9922V6.69141C20.4766 3.86719 18.6367 1.89844 16 1.89844C13.375 1.89844 11.5234 3.86719 11.5234 6.69141V13.9922ZM13.7383 14.0273V6.64453C13.7383 5.08594 14.6172 4.01953 16 4.01953C17.3828 4.01953 18.2617 5.08594 18.2617 6.64453V14.0273C18.2617 15.5977 17.3828 16.6523 16 16.6523C14.6172 16.6523 13.7383 15.5977 13.7383 14.0273ZM7.10547 14.5078C7.10547 19.3242 10.3047 22.6289 14.9336 23.0742V25.4766H10.6211C10.0234 25.4766 9.51953 25.9688 9.51953 26.5781C9.51953 27.1758 10.0234 27.668 10.6211 27.668H21.3789C21.9883 27.668 22.4922 27.1758 22.4922 26.5781C22.4922 25.9688 21.9883 25.4766 21.3789 25.4766H17.0781V23.0742C21.6953 22.6289 24.9062 19.3242 24.9062 14.5078V12.1875C24.9062 11.5781 24.4141 11.0977 23.8047 11.0977C23.1953 11.0977 22.6914 11.5781 22.6914 12.1875V14.4258C22.6914 18.4102 19.9961 21.0469 16 21.0469C12.0039 21.0469 9.30859 18.4102 9.30859 14.4258V12.1875C9.30859 11.5781 8.81641 11.0977 8.20703 11.0977C7.59766 11.0977 7.10547 11.5781 7.10547 12.1875V14.5078Z'
16
+ {...rest}
17
+ />
18
+ </G>
19
+ </Svg>
20
+ );
@@ -0,0 +1,16 @@
1
+ import React from 'react';
2
+
3
+ import { type IconProps, RootPath, RootSvg } from './utils/base';
4
+
5
+ export const Picture = (props: IconProps) => (
6
+ <RootSvg {...props}>
7
+ <RootPath
8
+ d='M2 8a3 3 0 013-3h14a3 3 0 013 3v8a3 3 0 01-3 3H5a3 3 0 01-3-3V8zm3-1a1 1 0 00-1 1v8a1 1 0 001 1h14a1 1 0 001-1V8a1 1 0 00-1-1H5z'
9
+ {...props}
10
+ />
11
+ <RootPath
12
+ d='M15.99 9a1 1 0 01.778.36l5 6a1 1 0 11-1.536 1.28l-4.216-5.059-3.235 4.044a1 1 0 01-1.381.175l-3.306-2.48-3.387 3.387a1 1 0 01-1.414-1.414l4-4A1 1 0 018.6 11.2l3.225 2.418 3.394-4.243A1 1 0 0115.99 9z'
13
+ {...props}
14
+ />
15
+ </RootSvg>
16
+ );
@@ -0,0 +1,21 @@
1
+ import React from 'react';
2
+
3
+ import Svg, { Path } 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 SendUp = ({ size, ...rest }: Props) => (
12
+ <Svg height={size} viewBox={`0 0 ${size} ${size}`} width={size} {...rest} testID='send-up'>
13
+ {/*<Circle cx={size / 2} cy={size / 2} r={size / 2} {...rest} />*/}
14
+ <Path
15
+ clipRule='evenodd'
16
+ d='M14.6673 16V22.6667H17.334V16H22.6673L16.0007 9.33337L9.33398 16H14.6673Z'
17
+ fill={'white'}
18
+ fillRule='evenodd'
19
+ />
20
+ </Svg>
21
+ );
@@ -0,0 +1,44 @@
1
+ import React from 'react';
2
+ import Svg, { Path, type PathProps, type SvgProps } from 'react-native-svg';
3
+
4
+ export type IconProps = Partial<SvgProps> &
5
+ Omit<RootPathProps, 'd'> & {
6
+ height?: number;
7
+ width?: number;
8
+ };
9
+
10
+ export const RootSvg = (props: IconProps) => {
11
+ const { children, height = 24, viewBox = '0 0 24 24', width = 24 } = props;
12
+ return (
13
+ <Svg
14
+ {...{
15
+ height,
16
+ viewBox,
17
+ width,
18
+ }}
19
+ {...props}
20
+ >
21
+ {children}
22
+ </Svg>
23
+ );
24
+ };
25
+
26
+ export type RootPathProps = Pick<PathProps, 'd'> & {
27
+ pathFill?: SvgProps['fill'];
28
+ pathOpacity?: PathProps['opacity'];
29
+ };
30
+
31
+ export const RootPath = (props: RootPathProps) => {
32
+ const { d, pathFill = 'black', pathOpacity } = props;
33
+ return (
34
+ <Path
35
+ {...{
36
+ clipRule: 'evenodd',
37
+ d,
38
+ fill: pathFill,
39
+ fillRule: 'evenodd',
40
+ opacity: pathOpacity,
41
+ }}
42
+ />
43
+ );
44
+ };
@@ -0,0 +1,26 @@
1
+ import { Text } from 'react-native';
2
+
3
+ import type { MarkdownComponentProps, RuleRenderFunction } from '../types';
4
+
5
+ export const Autolink = ({ children, styles, onPress }: MarkdownComponentProps) => (
6
+ <Text style={styles.autolink} onPress={onPress}>
7
+ {children}
8
+ </Text>
9
+ );
10
+
11
+ export const renderAutolink: RuleRenderFunction = ({ node, output, state, styles, onLink }) => {
12
+ state.withinLink = true;
13
+ const onLinkPress = () => onLink && onLink(node.target);
14
+ return (
15
+ <Autolink
16
+ key={state.key}
17
+ node={node}
18
+ output={output}
19
+ state={state}
20
+ styles={styles}
21
+ onPress={onLinkPress}
22
+ >
23
+ {output(node.content, state)}
24
+ </Autolink>
25
+ );
26
+ };
@@ -0,0 +1,19 @@
1
+ import { Text, View } from 'react-native';
2
+
3
+ import type { MarkdownComponentProps, RuleRenderFunction } from '../types';
4
+
5
+ export const BlockQuote = ({ children, styles }: MarkdownComponentProps) => (
6
+ <View style={styles.blockQuoteSection}>
7
+ <View style={styles.blockQuoteSectionBar} />
8
+ <Text style={styles.blockQuoteText}>{children}</Text>
9
+ </View>
10
+ );
11
+
12
+ export const renderBlockQuote: RuleRenderFunction = ({ node, output, state, styles }) => {
13
+ state.withinQuote = true;
14
+ return (
15
+ <BlockQuote key={state.key} node={node} output={output} state={state} styles={styles}>
16
+ {output(node.content, state)}
17
+ </BlockQuote>
18
+ );
19
+ };
@@ -0,0 +1,16 @@
1
+ import { Text } from 'react-native';
2
+
3
+ import type { MarkdownComponentProps, RuleRenderFunction } from '../types';
4
+
5
+ export const Bold = ({ children, styles }: MarkdownComponentProps) => (
6
+ <Text style={styles.strong}>{children}</Text>
7
+ );
8
+
9
+ export const renderBold: RuleRenderFunction = ({ node, output, state, styles }) => {
10
+ state.withinText = true;
11
+ return (
12
+ <Bold key={state.key} node={node} output={output} state={state} styles={styles}>
13
+ {output(node.content, state)}
14
+ </Bold>
15
+ );
16
+ };
@@ -0,0 +1,96 @@
1
+ import React, { type PropsWithChildren, useCallback, useMemo } from 'react';
2
+ import { Pressable, type PressableProps, Text, View } from 'react-native';
3
+
4
+ import { parseJsonChart } from '../../charts';
5
+ import { parseMermaid } from '../../charts';
6
+ import Chart from '../../charts/Chart';
7
+ import { MarkdownReactiveScrollView } from '../../components';
8
+ import { useStableCallback } from '../../internal/hooks/useStableCallback';
9
+ import { setClipboardString } from '../../services';
10
+ import { SyntaxHighlighter } from '../../syntax-highlighting';
11
+ import type { MarkdownComponentProps, RuleRenderFunction } from '../types';
12
+
13
+ export const CodeBlockCopyButton = ({ onPress }: { onPress?: PressableProps['onPress'] }) => (
14
+ <Pressable style={({ pressed }) => ({ opacity: pressed ? 0.5 : 1 })} onPress={onPress}>
15
+ <Text style={{ fontSize: 15 }}>{'\u29C9'}</Text>
16
+ </Pressable>
17
+ );
18
+
19
+ const areEqual = (prev: MarkdownComponentProps, next: MarkdownComponentProps) =>
20
+ prev.node.content === next.node.content;
21
+
22
+ export const CodeBlock = React.memo(({ styles, node }: MarkdownComponentProps) => {
23
+ const text = useMemo(() => node.content?.trim(), [node.content]);
24
+
25
+ const copyText = useStableCallback(() => {
26
+ if (setClipboardString) {
27
+ setClipboardString(text);
28
+ }
29
+ });
30
+
31
+ const CodeTag = useCallback(
32
+ ({ children }: PropsWithChildren) => (
33
+ <View style={styles.codeBlockContainer}>
34
+ <Text style={styles.codeBlock}>{children}</Text>
35
+ </View>
36
+ ),
37
+ [styles],
38
+ );
39
+
40
+ const CodeBlockHeader = useCallback(
41
+ () => (
42
+ <View style={styles.codeBlockHeaderContainer}>
43
+ <Text style={styles.codeBlockHeaderTitle}>{node.lang}</Text>
44
+ <CodeBlockCopyButton onPress={copyText} />
45
+ </View>
46
+ ),
47
+ [styles, node.lang, copyText],
48
+ );
49
+
50
+ const CodeBlockWrapper = useCallback(
51
+ ({ children }: PropsWithChildren) => (
52
+ <View style={styles.codeBlockWrapper}>
53
+ <CodeBlockHeader />
54
+ <MarkdownReactiveScrollView>{children}</MarkdownReactiveScrollView>
55
+ </View>
56
+ ),
57
+ [CodeBlockHeader, styles.codeBlockWrapper],
58
+ );
59
+
60
+ if (node.lang === 'mermaid') {
61
+ try {
62
+ const parsed = parseMermaid(text);
63
+ if (parsed) {
64
+ return <Chart spec={parsed} />;
65
+ }
66
+ } catch (_e) {
67
+ /* do nothing */
68
+ }
69
+ }
70
+
71
+ if (node.lang === 'json') {
72
+ try {
73
+ const parsed = parseJsonChart(text);
74
+ if (parsed) {
75
+ return <Chart spec={parsed} />;
76
+ }
77
+ } catch (_e) {
78
+ /* do nothing */
79
+ }
80
+ }
81
+
82
+ return (
83
+ <SyntaxHighlighter
84
+ language={node.lang}
85
+ highlighter={'prism'}
86
+ CodeTag={CodeTag}
87
+ PreTag={CodeBlockWrapper}
88
+ >
89
+ {text}
90
+ </SyntaxHighlighter>
91
+ );
92
+ }, areEqual);
93
+
94
+ export const renderCodeBlock: RuleRenderFunction = ({ node, output, state, styles }) => (
95
+ <CodeBlock key={state.key} node={node} output={output} state={state} styles={styles} />
96
+ );
@@ -0,0 +1,16 @@
1
+ import { Text } from 'react-native';
2
+
3
+ import type { MarkdownComponentProps, RuleRenderFunction } from '../types';
4
+
5
+ export const Emphasis = ({ children, styles }: MarkdownComponentProps) => (
6
+ <Text style={styles.em}>{children}</Text>
7
+ );
8
+
9
+ export const renderEmphasis: RuleRenderFunction = ({ node, output, state, styles }) => {
10
+ state.withinText = true;
11
+ return (
12
+ <Emphasis key={state.key} node={node} output={output} state={state} styles={styles}>
13
+ {output(node.content, state)}
14
+ </Emphasis>
15
+ );
16
+ };
@@ -0,0 +1,30 @@
1
+ import { useMemo } from 'react';
2
+ import { Text } from 'react-native';
3
+
4
+ import type { HeadingLevel, MarkdownComponentProps, RuleRenderFunction } from '../types';
5
+
6
+ const DEFAULT_HEADING_LEVEL = undefined;
7
+
8
+ const isValidHeadingLevel = (n: unknown): n is HeadingLevel =>
9
+ (Number.isInteger(n) && (n as number) >= 1 && (n as number) <= 6) || n === undefined;
10
+
11
+ export const Heading = ({ children, node, styles }: MarkdownComponentProps) => {
12
+ const headingLevel = isValidHeadingLevel(node.level) ? node.level : DEFAULT_HEADING_LEVEL;
13
+
14
+ const headingStyle = useMemo(
15
+ () => styles[`heading${headingLevel ?? ''}`],
16
+ [headingLevel, styles],
17
+ );
18
+
19
+ return <Text style={headingStyle}>{children}</Text>;
20
+ };
21
+
22
+ export const renderHeading: RuleRenderFunction = ({ node, output, state, styles }) => {
23
+ state.withinText = true;
24
+ state.withinHeading = true;
25
+ return (
26
+ <Heading key={state.key} node={node} output={output} state={state} styles={styles}>
27
+ {output(node.content, state)}
28
+ </Heading>
29
+ );
30
+ };
@@ -0,0 +1,9 @@
1
+ import { View } from 'react-native';
2
+
3
+ import type { MarkdownComponentProps, RuleRenderFunction } from '../types';
4
+
5
+ export const HorizontalRule = ({ styles }: MarkdownComponentProps) => <View style={styles.hr} />;
6
+
7
+ export const renderHorizontalRule: RuleRenderFunction = ({ node, output, state, styles }) => (
8
+ <HorizontalRule key={state.key} node={node} output={output} state={state} styles={styles} />
9
+ );
@@ -0,0 +1,16 @@
1
+ import { Text } from 'react-native';
2
+
3
+ import type { MarkdownComponentProps, RuleRenderFunction } from '../types';
4
+
5
+ export const InlineCode = ({ children, styles }: MarkdownComponentProps) => (
6
+ <Text style={styles.inlineCode}>{children}</Text>
7
+ );
8
+
9
+ export const renderInlineCode: RuleRenderFunction = ({ node, output, state, styles }) => {
10
+ state.withinText = true;
11
+ return (
12
+ <InlineCode key={state.key} node={node} output={output} state={state} styles={styles}>
13
+ {output(node.content, state)}
14
+ </InlineCode>
15
+ );
16
+ };
@@ -0,0 +1,11 @@
1
+ import { Text } from 'react-native';
2
+
3
+ import type { MarkdownComponentProps, RuleRenderFunction } from '../types';
4
+
5
+ export const LineBreak = ({ styles }: MarkdownComponentProps) => (
6
+ <Text style={styles.br}>{'\n\n'}</Text>
7
+ );
8
+
9
+ export const renderLineBreak: RuleRenderFunction = ({ node, output, state, styles }) => (
10
+ <LineBreak key={state.key} node={node} output={output} state={state} styles={styles} />
11
+ );
@@ -0,0 +1,28 @@
1
+ import { Text } from 'react-native';
2
+
3
+ import type { MarkdownComponentProps, RuleRenderFunction } from '../types';
4
+
5
+ export const Link = ({ children, styles, onPress }: MarkdownComponentProps) => (
6
+ <Text style={styles.autolink} onPress={onPress} suppressHighlighting={false}>
7
+ {children}
8
+ </Text>
9
+ );
10
+
11
+ export const renderLink: RuleRenderFunction = ({ node, output, state, styles, onLink }) => {
12
+ const url = state.parentLink ?? node.target;
13
+ state.withinLink = true;
14
+ state.parentLink = url;
15
+ const onLinkPress = () => onLink && onLink(url);
16
+ return (
17
+ <Link
18
+ key={state.key}
19
+ node={node}
20
+ output={output}
21
+ state={state}
22
+ styles={styles}
23
+ onPress={onLinkPress}
24
+ >
25
+ {output(node.content, state)}
26
+ </Link>
27
+ );
28
+ };
@@ -0,0 +1,65 @@
1
+ import type { PropsWithChildren } from 'react';
2
+ import { Text, type TextProps, View, type ViewProps } from 'react-native';
3
+
4
+ import type { SingleASTNode } from '@khanacademy/simple-markdown';
5
+
6
+ import type { BulletProps, MarkdownComponentProps, RuleRenderFunction } from '../types';
7
+
8
+ const parentTypes = ['text', 'paragraph', 'strong'];
9
+
10
+ export const List = ({ node, output, state, styles }: MarkdownComponentProps) => {
11
+ let isSublist = state.withinList;
12
+
13
+ return (
14
+ <View key={state.key} style={isSublist ? styles?.sublist : styles?.list}>
15
+ {node.items.map((item: SingleASTNode, index: number) => {
16
+ const indexAfterStart = node.start + index;
17
+
18
+ if (item === null) {
19
+ return (
20
+ <ListRow key={index} style={styles?.listRow}>
21
+ <Bullet
22
+ index={node.ordered && indexAfterStart}
23
+ style={node.ordered ? styles?.listItemNumber : styles?.listItemBullet}
24
+ />
25
+ </ListRow>
26
+ );
27
+ }
28
+
29
+ isSublist = item.length > 1 && item[1].type === 'list';
30
+ const isSublistWithinText = parentTypes.includes((item[0] ?? {}).type) && isSublist;
31
+ const style = isSublistWithinText ? { marginBottom: 0 } : {};
32
+
33
+ return (
34
+ <ListRow key={index} style={styles?.listRow}>
35
+ <Bullet
36
+ index={node.ordered && indexAfterStart}
37
+ style={node.ordered ? styles?.listItemNumber : styles?.listItemBullet}
38
+ />
39
+ <ListItem key={1} style={[styles?.listItemText, style]}>
40
+ {output(item, { ...state, withinList: true })}
41
+ </ListItem>
42
+ </ListRow>
43
+ );
44
+ })}
45
+ </View>
46
+ );
47
+ };
48
+
49
+ const Bullet = ({ index, style }: BulletProps) => (
50
+ <Text key={0} style={style}>
51
+ {index ? `${index}. ` : '\u2022 '}
52
+ </Text>
53
+ );
54
+
55
+ const ListRow = ({ children, style }: PropsWithChildren<ViewProps>) => (
56
+ <View style={style}>{children}</View>
57
+ );
58
+
59
+ const ListItem = ({ children, style }: PropsWithChildren<TextProps>) => (
60
+ <Text style={style}>{children}</Text>
61
+ );
62
+
63
+ export const renderList: RuleRenderFunction = ({ node, output, state, styles }) => (
64
+ <List key={`list-${state.key}`} node={node} output={output} state={state} styles={styles} />
65
+ );
@@ -0,0 +1,26 @@
1
+ import { Text } from 'react-native';
2
+
3
+ import type { MarkdownComponentProps, RuleRenderFunction } from '../types';
4
+
5
+ export const Mailto = ({ children, styles, onPress }: MarkdownComponentProps) => (
6
+ <Text style={styles.url} onPress={onPress}>
7
+ {children}
8
+ </Text>
9
+ );
10
+
11
+ export const renderMailto: RuleRenderFunction = ({ node, output, state, styles, onLink }) => {
12
+ state.withinLink = true;
13
+ const onLinkPress = () => onLink && onLink(node.target);
14
+ return (
15
+ <Mailto
16
+ key={state.key}
17
+ node={node}
18
+ output={output}
19
+ state={state}
20
+ styles={styles}
21
+ onPress={onLinkPress}
22
+ >
23
+ {output(node.content, state)}
24
+ </Mailto>
25
+ );
26
+ };
@@ -0,0 +1,59 @@
1
+ import React, { type PropsWithChildren, useMemo } from 'react';
2
+
3
+ import { View } from 'react-native';
4
+
5
+ import SimpleMarkdown, {
6
+ type OutputRules,
7
+ type ParserRules,
8
+ type ReactOutputRule,
9
+ } from '@khanacademy/simple-markdown';
10
+ import isArray from 'lodash/isArray';
11
+ import isEqual from 'lodash/isEqual';
12
+ import merge from 'lodash/merge';
13
+
14
+ import { useTheme } from '../../contexts';
15
+ import { getLocalRules } from '../rules';
16
+
17
+ import { getLocalStyles } from '../styles';
18
+ import type { MarkdownProps } from '../types';
19
+
20
+ const UnmemoizedMarkdown = (props: PropsWithChildren<MarkdownProps>) => {
21
+ const { theme } = useTheme();
22
+
23
+ const { onLink, rules: rulesProp, paragraphNumberOfLines, children } = props;
24
+
25
+ const mergedStyles = useMemo(() => merge({}, getLocalStyles({ theme }), theme.markdown), [theme]);
26
+
27
+ const localRules = useMemo(
28
+ () =>
29
+ merge(
30
+ {},
31
+ SimpleMarkdown.defaultRules,
32
+ getLocalRules(mergedStyles, { onLink, paragraphNumberOfLines }),
33
+ rulesProp,
34
+ ) as unknown as ParserRules,
35
+ [mergedStyles, onLink, rulesProp, paragraphNumberOfLines],
36
+ );
37
+
38
+ const parser = useMemo(() => SimpleMarkdown.parserFor(localRules), [localRules]);
39
+ const renderer = useMemo(
40
+ () => SimpleMarkdown.outputFor(localRules as unknown as OutputRules<ReactOutputRule>, 'react'),
41
+ [localRules],
42
+ );
43
+
44
+ const childText = useMemo(() => (isArray(children) ? children.join('') : children), [children]);
45
+
46
+ const toRender = useMemo(() => {
47
+ const blockSource = `${childText ?? ''}\n\n`;
48
+ return parser(blockSource, { inline: false });
49
+ }, [childText, parser]);
50
+
51
+ const tree = useMemo(() => renderer(toRender), [renderer, toRender]);
52
+
53
+ return <View style={mergedStyles.view}>{tree}</View>;
54
+ };
55
+
56
+ const areEqual = (prevProps: PropsWithChildren, nextProps: PropsWithChildren) =>
57
+ isEqual(prevProps.children, nextProps.children);
58
+
59
+ export const Markdown = React.memo(UnmemoizedMarkdown, areEqual);
@@ -0,0 +1,11 @@
1
+ import { Text } from 'react-native';
2
+
3
+ import type { MarkdownComponentProps, RuleRenderFunction } from '../types';
4
+
5
+ export const NewLine = ({ styles }: MarkdownComponentProps) => (
6
+ <Text style={styles.br}>{'\n'}</Text>
7
+ );
8
+
9
+ export const renderNewLine: RuleRenderFunction = ({ node, output, state, styles }) => (
10
+ <NewLine key={state.key} node={node} output={output} state={state} styles={styles} />
11
+ );
@@ -0,0 +1,69 @@
1
+ import { useMemo } from 'react';
2
+ import { Text, type TextStyle, View } from 'react-native';
3
+
4
+ import size from 'lodash/size';
5
+ import some from 'lodash/some';
6
+
7
+ import type { MarkdownComponentProps, RuleRenderFunction } from '../types';
8
+
9
+ export const Paragraph = ({
10
+ children,
11
+ styles,
12
+ node,
13
+ state,
14
+ paragraphNumberOfLines,
15
+ }: MarkdownComponentProps) => {
16
+ const paragraphStyle = useMemo(() => {
17
+ let style: TextStyle | (TextStyle | undefined)[] | undefined =
18
+ size(node.content) < 3 && some(node.content, { type: 'strong' })
19
+ ? styles.paragraphCenter
20
+ : styles.paragraph;
21
+
22
+ if (state.withinList) {
23
+ style = [style, styles.noMargin];
24
+ }
25
+
26
+ return style;
27
+ }, [node.content, state.withinList, styles.paragraph, styles.paragraphCenter, styles.noMargin]);
28
+
29
+ return (
30
+ <Text style={paragraphStyle} numberOfLines={paragraphNumberOfLines}>
31
+ {children}
32
+ </Text>
33
+ );
34
+ };
35
+
36
+ export const ParagraphWithImage = ({ children, styles }: MarkdownComponentProps) => (
37
+ <View style={styles.paragraphWithImage}>{children}</View>
38
+ );
39
+
40
+ export const renderParagraph: RuleRenderFunction = ({
41
+ node,
42
+ output,
43
+ state,
44
+ styles,
45
+ paragraphNumberOfLines,
46
+ }) => {
47
+ if (some(node.content, { type: 'image' })) {
48
+ state.withinParagraphWithImage = true;
49
+
50
+ return (
51
+ <ParagraphWithImage key={state.key} node={node} output={output} state={state} styles={styles}>
52
+ {output(node.content, state)}
53
+ </ParagraphWithImage>
54
+ );
55
+ }
56
+
57
+ return (
58
+ <Paragraph
59
+ key={state.key}
60
+ node={node}
61
+ output={output}
62
+ state={state}
63
+ styles={styles}
64
+ paragraphNumberOfLines={paragraphNumberOfLines}
65
+ >
66
+ {output(node.content, state)}
67
+ </Paragraph>
68
+ );
69
+ };
@@ -0,0 +1,16 @@
1
+ import { Text } from 'react-native';
2
+
3
+ import type { MarkdownComponentProps, RuleRenderFunction } from '../types';
4
+
5
+ export const Strikethrough = ({ children, styles }: MarkdownComponentProps) => (
6
+ <Text style={styles.del}>{children}</Text>
7
+ );
8
+
9
+ export const renderStrikethrough: RuleRenderFunction = ({ node, output, state, styles }) => {
10
+ state.withinText = true;
11
+ return (
12
+ <Strikethrough key={state.key} node={node} output={output} state={state} styles={styles}>
13
+ {output(node.content, state)}
14
+ </Strikethrough>
15
+ );
16
+ };