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.
- package/ai-components/package.json +6 -0
- package/lib/commonjs/ai-components/AITypingIndicatorView.js +49 -0
- package/lib/commonjs/ai-components/AITypingIndicatorView.js.map +1 -0
- package/lib/commonjs/ai-components/README.md +279 -0
- package/lib/commonjs/ai-components/StreamingMessageView.js +75 -0
- package/lib/commonjs/ai-components/StreamingMessageView.js.map +1 -0
- package/lib/commonjs/ai-components/charts/Chart.js +25 -0
- package/lib/commonjs/ai-components/charts/Chart.js.map +1 -0
- package/lib/commonjs/ai-components/charts/components/PieLegend.js +54 -0
- package/lib/commonjs/ai-components/charts/components/PieLegend.js.map +1 -0
- package/lib/commonjs/ai-components/charts/components/VictoryChart.js +183 -0
- package/lib/commonjs/ai-components/charts/components/VictoryChart.js.map +1 -0
- package/lib/commonjs/ai-components/charts/components/index.js +26 -0
- package/lib/commonjs/ai-components/charts/components/index.js.map +1 -0
- package/lib/commonjs/ai-components/charts/index.js +70 -0
- package/lib/commonjs/ai-components/charts/index.js.map +1 -0
- package/lib/commonjs/ai-components/charts/mermaid/index.js +15 -0
- package/lib/commonjs/ai-components/charts/mermaid/index.js.map +1 -0
- package/lib/commonjs/ai-components/charts/mermaid/parser.js +45 -0
- package/lib/commonjs/ai-components/charts/mermaid/parser.js.map +1 -0
- package/lib/commonjs/ai-components/charts/types.js +2 -0
- package/lib/commonjs/ai-components/charts/types.js.map +1 -0
- package/lib/commonjs/ai-components/charts/utils/generate-pie-colors.js +68 -0
- package/lib/commonjs/ai-components/charts/utils/generate-pie-colors.js.map +1 -0
- package/lib/commonjs/ai-components/charts/utils/index.js +26 -0
- package/lib/commonjs/ai-components/charts/utils/index.js.map +1 -0
- package/lib/commonjs/ai-components/charts/utils/parse-json-chart.js +15 -0
- package/lib/commonjs/ai-components/charts/utils/parse-json-chart.js.map +1 -0
- package/lib/commonjs/ai-components/charts/vega-lite/index.js +26 -0
- package/lib/commonjs/ai-components/charts/vega-lite/index.js.map +1 -0
- package/lib/commonjs/ai-components/charts/vega-lite/parser.js +54 -0
- package/lib/commonjs/ai-components/charts/vega-lite/parser.js.map +1 -0
- package/lib/commonjs/ai-components/charts/vega-lite/schema.js +82 -0
- package/lib/commonjs/ai-components/charts/vega-lite/schema.js.map +1 -0
- package/lib/commonjs/ai-components/components/BottomSheet.js +182 -0
- package/lib/commonjs/ai-components/components/BottomSheet.js.map +1 -0
- package/lib/commonjs/ai-components/components/MarkdownReactiveScrollView.js +81 -0
- package/lib/commonjs/ai-components/components/MarkdownReactiveScrollView.js.map +1 -0
- package/lib/commonjs/ai-components/components/index.js +26 -0
- package/lib/commonjs/ai-components/components/index.js.map +1 -0
- package/lib/commonjs/ai-components/contexts/composer-context.js +68 -0
- package/lib/commonjs/ai-components/contexts/composer-context.js.map +1 -0
- package/lib/commonjs/ai-components/contexts/index.js +26 -0
- package/lib/commonjs/ai-components/contexts/index.js.map +1 -0
- package/lib/commonjs/ai-components/contexts/theme-context.js +53 -0
- package/lib/commonjs/ai-components/contexts/theme-context.js.map +1 -0
- package/lib/commonjs/ai-components/index.js +166 -0
- package/lib/commonjs/ai-components/index.js.map +1 -0
- package/lib/commonjs/ai-components/internal/hooks/useStableCallback.js +14 -0
- package/lib/commonjs/ai-components/internal/hooks/useStableCallback.js.map +1 -0
- package/lib/commonjs/ai-components/internal/icons/Camera.js +18 -0
- package/lib/commonjs/ai-components/internal/icons/Camera.js.map +1 -0
- package/lib/commonjs/ai-components/internal/icons/CircleStop.js +24 -0
- package/lib/commonjs/ai-components/internal/icons/CircleStop.js.map +1 -0
- package/lib/commonjs/ai-components/internal/icons/Close.js +18 -0
- package/lib/commonjs/ai-components/internal/icons/Close.js.map +1 -0
- package/lib/commonjs/ai-components/internal/icons/Mic.js +27 -0
- package/lib/commonjs/ai-components/internal/icons/Mic.js.map +1 -0
- package/lib/commonjs/ai-components/internal/icons/Picture.js +21 -0
- package/lib/commonjs/ai-components/internal/icons/Picture.js.map +1 -0
- package/lib/commonjs/ai-components/internal/icons/SendUp.js +28 -0
- package/lib/commonjs/ai-components/internal/icons/SendUp.js.map +1 -0
- package/lib/commonjs/ai-components/internal/icons/utils/base.js +42 -0
- package/lib/commonjs/ai-components/internal/icons/utils/base.js.map +1 -0
- package/lib/commonjs/ai-components/markdown/components/Autolink.js +37 -0
- package/lib/commonjs/ai-components/markdown/components/Autolink.js.map +1 -0
- package/lib/commonjs/ai-components/markdown/components/BlockQuote.js +37 -0
- package/lib/commonjs/ai-components/markdown/components/BlockQuote.js.map +1 -0
- package/lib/commonjs/ai-components/markdown/components/Bold.js +32 -0
- package/lib/commonjs/ai-components/markdown/components/Bold.js.map +1 -0
- package/lib/commonjs/ai-components/markdown/components/CodeBlock.js +114 -0
- package/lib/commonjs/ai-components/markdown/components/CodeBlock.js.map +1 -0
- package/lib/commonjs/ai-components/markdown/components/Emphasis.js +32 -0
- package/lib/commonjs/ai-components/markdown/components/Emphasis.js.map +1 -0
- package/lib/commonjs/ai-components/markdown/components/Heading.js +41 -0
- package/lib/commonjs/ai-components/markdown/components/Heading.js.map +1 -0
- package/lib/commonjs/ai-components/markdown/components/HorizontalRule.js +26 -0
- package/lib/commonjs/ai-components/markdown/components/HorizontalRule.js.map +1 -0
- package/lib/commonjs/ai-components/markdown/components/InlineCode.js +32 -0
- package/lib/commonjs/ai-components/markdown/components/InlineCode.js.map +1 -0
- package/lib/commonjs/ai-components/markdown/components/LineBreak.js +27 -0
- package/lib/commonjs/ai-components/markdown/components/LineBreak.js.map +1 -0
- package/lib/commonjs/ai-components/markdown/components/Link.js +41 -0
- package/lib/commonjs/ai-components/markdown/components/Link.js.map +1 -0
- package/lib/commonjs/ai-components/markdown/components/List.js +85 -0
- package/lib/commonjs/ai-components/markdown/components/List.js.map +1 -0
- package/lib/commonjs/ai-components/markdown/components/Mailto.js +37 -0
- package/lib/commonjs/ai-components/markdown/components/Mailto.js.map +1 -0
- package/lib/commonjs/ai-components/markdown/components/Markdown.js +49 -0
- package/lib/commonjs/ai-components/markdown/components/Markdown.js.map +1 -0
- package/lib/commonjs/ai-components/markdown/components/NewLine.js +27 -0
- package/lib/commonjs/ai-components/markdown/components/NewLine.js.map +1 -0
- package/lib/commonjs/ai-components/markdown/components/Paragraph.js +72 -0
- package/lib/commonjs/ai-components/markdown/components/Paragraph.js.map +1 -0
- package/lib/commonjs/ai-components/markdown/components/Strikethrough.js +32 -0
- package/lib/commonjs/ai-components/markdown/components/Strikethrough.js.map +1 -0
- package/lib/commonjs/ai-components/markdown/components/Table.js +105 -0
- package/lib/commonjs/ai-components/markdown/components/Table.js.map +1 -0
- package/lib/commonjs/ai-components/markdown/components/Text.js +45 -0
- package/lib/commonjs/ai-components/markdown/components/Text.js.map +1 -0
- package/lib/commonjs/ai-components/markdown/components/Url.js +37 -0
- package/lib/commonjs/ai-components/markdown/components/Url.js.map +1 -0
- package/lib/commonjs/ai-components/markdown/components/index.js +213 -0
- package/lib/commonjs/ai-components/markdown/components/index.js.map +1 -0
- package/lib/commonjs/ai-components/markdown/index.js +59 -0
- package/lib/commonjs/ai-components/markdown/index.js.map +1 -0
- package/lib/commonjs/ai-components/markdown/rules.js +152 -0
- package/lib/commonjs/ai-components/markdown/rules.js.map +1 -0
- package/lib/commonjs/ai-components/markdown/styles.js +240 -0
- package/lib/commonjs/ai-components/markdown/styles.js.map +1 -0
- package/lib/commonjs/ai-components/markdown/types.js +4 -0
- package/lib/commonjs/ai-components/markdown/types.js.map +1 -0
- package/lib/commonjs/ai-components/markdown/utils/generate-markdown-text.js +73 -0
- package/lib/commonjs/ai-components/markdown/utils/generate-markdown-text.js.map +1 -0
- package/lib/commonjs/ai-components/markdown/utils/index.js +15 -0
- package/lib/commonjs/ai-components/markdown/utils/index.js.map +1 -0
- package/lib/commonjs/ai-components/message-composer/ActionButton.js +104 -0
- package/lib/commonjs/ai-components/message-composer/ActionButton.js.map +1 -0
- package/lib/commonjs/ai-components/message-composer/ActionSheet.js +197 -0
- package/lib/commonjs/ai-components/message-composer/ActionSheet.js.map +1 -0
- package/lib/commonjs/ai-components/message-composer/AttachmentButton.js +55 -0
- package/lib/commonjs/ai-components/message-composer/AttachmentButton.js.map +1 -0
- package/lib/commonjs/ai-components/message-composer/ComposerView.js +151 -0
- package/lib/commonjs/ai-components/message-composer/ComposerView.js.map +1 -0
- package/lib/commonjs/ai-components/message-composer/MediaPreviewList.js +84 -0
- package/lib/commonjs/ai-components/message-composer/MediaPreviewList.js.map +1 -0
- package/lib/commonjs/ai-components/message-composer/SpeechToTextButton.js +82 -0
- package/lib/commonjs/ai-components/message-composer/SpeechToTextButton.js.map +1 -0
- package/lib/commonjs/ai-components/message-composer/index.js +59 -0
- package/lib/commonjs/ai-components/message-composer/index.js.map +1 -0
- package/lib/commonjs/ai-components/message-composer/utils/withCloseSheet.js +16 -0
- package/lib/commonjs/ai-components/message-composer/utils/withCloseSheet.js.map +1 -0
- package/lib/commonjs/ai-components/native/AIDictation.js +60 -0
- package/lib/commonjs/ai-components/native/AIDictation.js.map +1 -0
- package/lib/commonjs/ai-components/native/PerfText.js +31 -0
- package/lib/commonjs/ai-components/native/PerfText.js.map +1 -0
- package/lib/commonjs/ai-components/native-specs/NativeAIDictation.js +7 -0
- package/lib/commonjs/ai-components/native-specs/NativeAIDictation.js.map +1 -0
- package/lib/commonjs/ai-components/services/clipboard-service/expo.js +13 -0
- package/lib/commonjs/ai-components/services/clipboard-service/expo.js.map +1 -0
- package/lib/commonjs/ai-components/services/clipboard-service/index.js +8 -0
- package/lib/commonjs/ai-components/services/clipboard-service/index.js.map +1 -0
- package/lib/commonjs/ai-components/services/clipboard-service/rncli.js +10 -0
- package/lib/commonjs/ai-components/services/clipboard-service/rncli.js.map +1 -0
- package/lib/commonjs/ai-components/services/index.js +26 -0
- package/lib/commonjs/ai-components/services/index.js.map +1 -0
- package/lib/commonjs/ai-components/services/media-picker-service/AbstractMediaPickerService.js +31 -0
- package/lib/commonjs/ai-components/services/media-picker-service/AbstractMediaPickerService.js.map +1 -0
- package/lib/commonjs/ai-components/services/media-picker-service/expo.js +169 -0
- package/lib/commonjs/ai-components/services/media-picker-service/expo.js.map +1 -0
- package/lib/commonjs/ai-components/services/media-picker-service/hooks/useMediaPickerState.js +14 -0
- package/lib/commonjs/ai-components/services/media-picker-service/hooks/useMediaPickerState.js.map +1 -0
- package/lib/commonjs/ai-components/services/media-picker-service/index.js +8 -0
- package/lib/commonjs/ai-components/services/media-picker-service/index.js.map +1 -0
- package/lib/commonjs/ai-components/services/media-picker-service/optional-modules.d.js +2 -0
- package/lib/commonjs/ai-components/services/media-picker-service/optional-modules.d.js.map +1 -0
- package/lib/commonjs/ai-components/services/media-picker-service/rncli.js +162 -0
- package/lib/commonjs/ai-components/services/media-picker-service/rncli.js.map +1 -0
- package/lib/commonjs/ai-components/store/bottom-sheet/store.js +27 -0
- package/lib/commonjs/ai-components/store/bottom-sheet/store.js.map +1 -0
- package/lib/commonjs/ai-components/store/bottom-sheet/useBottomSheetState.js +16 -0
- package/lib/commonjs/ai-components/store/bottom-sheet/useBottomSheetState.js.map +1 -0
- package/lib/commonjs/ai-components/store/composer/store.js +11 -0
- package/lib/commonjs/ai-components/store/composer/store.js.map +1 -0
- package/lib/commonjs/ai-components/store/composer/useComposerHasText.js +18 -0
- package/lib/commonjs/ai-components/store/composer/useComposerHasText.js.map +1 -0
- package/lib/commonjs/ai-components/store/composer/useComposerText.js +18 -0
- package/lib/commonjs/ai-components/store/composer/useComposerText.js.map +1 -0
- package/lib/commonjs/ai-components/store/dictation/store.js +17 -0
- package/lib/commonjs/ai-components/store/dictation/store.js.map +1 -0
- package/lib/commonjs/ai-components/store/dictation/useDictationState.js +18 -0
- package/lib/commonjs/ai-components/store/dictation/useDictationState.js.map +1 -0
- package/lib/commonjs/ai-components/store/dictation/useDictationTranscript.js +14 -0
- package/lib/commonjs/ai-components/store/dictation/useDictationTranscript.js.map +1 -0
- package/lib/commonjs/ai-components/store/index.js +70 -0
- package/lib/commonjs/ai-components/store/index.js.map +1 -0
- package/lib/commonjs/ai-components/syntax-highlighting/SyntaxHighlighter.js +51 -0
- package/lib/commonjs/ai-components/syntax-highlighting/SyntaxHighlighter.js.map +1 -0
- package/lib/commonjs/ai-components/syntax-highlighting/components/AndroidNativeRenderer.js +35 -0
- package/lib/commonjs/ai-components/syntax-highlighting/components/AndroidNativeRenderer.js.map +1 -0
- package/lib/commonjs/ai-components/syntax-highlighting/components/index.js +15 -0
- package/lib/commonjs/ai-components/syntax-highlighting/components/index.js.map +1 -0
- package/lib/commonjs/ai-components/syntax-highlighting/index.js +48 -0
- package/lib/commonjs/ai-components/syntax-highlighting/index.js.map +1 -0
- package/lib/commonjs/ai-components/syntax-highlighting/prism-config.js +7 -0
- package/lib/commonjs/ai-components/syntax-highlighting/prism-config.js.map +1 -0
- package/lib/commonjs/ai-components/syntax-highlighting/types.js +4 -0
- package/lib/commonjs/ai-components/syntax-highlighting/types.js.map +1 -0
- package/lib/commonjs/ai-components/syntax-highlighting/utils/converter.js +107 -0
- package/lib/commonjs/ai-components/syntax-highlighting/utils/converter.js.map +1 -0
- package/lib/commonjs/ai-components/syntax-highlighting/utils/flatten-nodes.js +139 -0
- package/lib/commonjs/ai-components/syntax-highlighting/utils/flatten-nodes.js.map +1 -0
- package/lib/commonjs/ai-components/syntax-highlighting/utils/index.js +37 -0
- package/lib/commonjs/ai-components/syntax-highlighting/utils/index.js.map +1 -0
- package/lib/commonjs/ai-components/syntax-highlighting/utils/renderer.js +117 -0
- package/lib/commonjs/ai-components/syntax-highlighting/utils/renderer.js.map +1 -0
- package/lib/commonjs/ai-components/theme.js +99 -0
- package/lib/commonjs/ai-components/theme.js.map +1 -0
- package/lib/commonjs/ai-components/transcription/useDictation.js +114 -0
- package/lib/commonjs/ai-components/transcription/useDictation.js.map +1 -0
- package/lib/commonjs/native.js +4 -0
- package/lib/commonjs/native.js.map +1 -1
- package/lib/commonjs/version.json +1 -1
- package/lib/module/ai-components/AITypingIndicatorView.js +49 -0
- package/lib/module/ai-components/AITypingIndicatorView.js.map +1 -0
- package/lib/module/ai-components/README.md +279 -0
- package/lib/module/ai-components/StreamingMessageView.js +75 -0
- package/lib/module/ai-components/StreamingMessageView.js.map +1 -0
- package/lib/module/ai-components/charts/Chart.js +25 -0
- package/lib/module/ai-components/charts/Chart.js.map +1 -0
- package/lib/module/ai-components/charts/components/PieLegend.js +54 -0
- package/lib/module/ai-components/charts/components/PieLegend.js.map +1 -0
- package/lib/module/ai-components/charts/components/VictoryChart.js +183 -0
- package/lib/module/ai-components/charts/components/VictoryChart.js.map +1 -0
- package/lib/module/ai-components/charts/components/index.js +26 -0
- package/lib/module/ai-components/charts/components/index.js.map +1 -0
- package/lib/module/ai-components/charts/index.js +70 -0
- package/lib/module/ai-components/charts/index.js.map +1 -0
- package/lib/module/ai-components/charts/mermaid/index.js +15 -0
- package/lib/module/ai-components/charts/mermaid/index.js.map +1 -0
- package/lib/module/ai-components/charts/mermaid/parser.js +45 -0
- package/lib/module/ai-components/charts/mermaid/parser.js.map +1 -0
- package/lib/module/ai-components/charts/types.js +2 -0
- package/lib/module/ai-components/charts/types.js.map +1 -0
- package/lib/module/ai-components/charts/utils/generate-pie-colors.js +68 -0
- package/lib/module/ai-components/charts/utils/generate-pie-colors.js.map +1 -0
- package/lib/module/ai-components/charts/utils/index.js +26 -0
- package/lib/module/ai-components/charts/utils/index.js.map +1 -0
- package/lib/module/ai-components/charts/utils/parse-json-chart.js +15 -0
- package/lib/module/ai-components/charts/utils/parse-json-chart.js.map +1 -0
- package/lib/module/ai-components/charts/vega-lite/index.js +26 -0
- package/lib/module/ai-components/charts/vega-lite/index.js.map +1 -0
- package/lib/module/ai-components/charts/vega-lite/parser.js +54 -0
- package/lib/module/ai-components/charts/vega-lite/parser.js.map +1 -0
- package/lib/module/ai-components/charts/vega-lite/schema.js +82 -0
- package/lib/module/ai-components/charts/vega-lite/schema.js.map +1 -0
- package/lib/module/ai-components/components/BottomSheet.js +182 -0
- package/lib/module/ai-components/components/BottomSheet.js.map +1 -0
- package/lib/module/ai-components/components/MarkdownReactiveScrollView.js +81 -0
- package/lib/module/ai-components/components/MarkdownReactiveScrollView.js.map +1 -0
- package/lib/module/ai-components/components/index.js +26 -0
- package/lib/module/ai-components/components/index.js.map +1 -0
- package/lib/module/ai-components/contexts/composer-context.js +68 -0
- package/lib/module/ai-components/contexts/composer-context.js.map +1 -0
- package/lib/module/ai-components/contexts/index.js +26 -0
- package/lib/module/ai-components/contexts/index.js.map +1 -0
- package/lib/module/ai-components/contexts/theme-context.js +53 -0
- package/lib/module/ai-components/contexts/theme-context.js.map +1 -0
- package/lib/module/ai-components/index.js +166 -0
- package/lib/module/ai-components/index.js.map +1 -0
- package/lib/module/ai-components/internal/hooks/useStableCallback.js +14 -0
- package/lib/module/ai-components/internal/hooks/useStableCallback.js.map +1 -0
- package/lib/module/ai-components/internal/icons/Camera.js +18 -0
- package/lib/module/ai-components/internal/icons/Camera.js.map +1 -0
- package/lib/module/ai-components/internal/icons/CircleStop.js +24 -0
- package/lib/module/ai-components/internal/icons/CircleStop.js.map +1 -0
- package/lib/module/ai-components/internal/icons/Close.js +18 -0
- package/lib/module/ai-components/internal/icons/Close.js.map +1 -0
- package/lib/module/ai-components/internal/icons/Mic.js +27 -0
- package/lib/module/ai-components/internal/icons/Mic.js.map +1 -0
- package/lib/module/ai-components/internal/icons/Picture.js +21 -0
- package/lib/module/ai-components/internal/icons/Picture.js.map +1 -0
- package/lib/module/ai-components/internal/icons/SendUp.js +28 -0
- package/lib/module/ai-components/internal/icons/SendUp.js.map +1 -0
- package/lib/module/ai-components/internal/icons/utils/base.js +42 -0
- package/lib/module/ai-components/internal/icons/utils/base.js.map +1 -0
- package/lib/module/ai-components/markdown/components/Autolink.js +37 -0
- package/lib/module/ai-components/markdown/components/Autolink.js.map +1 -0
- package/lib/module/ai-components/markdown/components/BlockQuote.js +37 -0
- package/lib/module/ai-components/markdown/components/BlockQuote.js.map +1 -0
- package/lib/module/ai-components/markdown/components/Bold.js +32 -0
- package/lib/module/ai-components/markdown/components/Bold.js.map +1 -0
- package/lib/module/ai-components/markdown/components/CodeBlock.js +114 -0
- package/lib/module/ai-components/markdown/components/CodeBlock.js.map +1 -0
- package/lib/module/ai-components/markdown/components/Emphasis.js +32 -0
- package/lib/module/ai-components/markdown/components/Emphasis.js.map +1 -0
- package/lib/module/ai-components/markdown/components/Heading.js +41 -0
- package/lib/module/ai-components/markdown/components/Heading.js.map +1 -0
- package/lib/module/ai-components/markdown/components/HorizontalRule.js +26 -0
- package/lib/module/ai-components/markdown/components/HorizontalRule.js.map +1 -0
- package/lib/module/ai-components/markdown/components/InlineCode.js +32 -0
- package/lib/module/ai-components/markdown/components/InlineCode.js.map +1 -0
- package/lib/module/ai-components/markdown/components/LineBreak.js +27 -0
- package/lib/module/ai-components/markdown/components/LineBreak.js.map +1 -0
- package/lib/module/ai-components/markdown/components/Link.js +41 -0
- package/lib/module/ai-components/markdown/components/Link.js.map +1 -0
- package/lib/module/ai-components/markdown/components/List.js +85 -0
- package/lib/module/ai-components/markdown/components/List.js.map +1 -0
- package/lib/module/ai-components/markdown/components/Mailto.js +37 -0
- package/lib/module/ai-components/markdown/components/Mailto.js.map +1 -0
- package/lib/module/ai-components/markdown/components/Markdown.js +49 -0
- package/lib/module/ai-components/markdown/components/Markdown.js.map +1 -0
- package/lib/module/ai-components/markdown/components/NewLine.js +27 -0
- package/lib/module/ai-components/markdown/components/NewLine.js.map +1 -0
- package/lib/module/ai-components/markdown/components/Paragraph.js +72 -0
- package/lib/module/ai-components/markdown/components/Paragraph.js.map +1 -0
- package/lib/module/ai-components/markdown/components/Strikethrough.js +32 -0
- package/lib/module/ai-components/markdown/components/Strikethrough.js.map +1 -0
- package/lib/module/ai-components/markdown/components/Table.js +105 -0
- package/lib/module/ai-components/markdown/components/Table.js.map +1 -0
- package/lib/module/ai-components/markdown/components/Text.js +45 -0
- package/lib/module/ai-components/markdown/components/Text.js.map +1 -0
- package/lib/module/ai-components/markdown/components/Url.js +37 -0
- package/lib/module/ai-components/markdown/components/Url.js.map +1 -0
- package/lib/module/ai-components/markdown/components/index.js +213 -0
- package/lib/module/ai-components/markdown/components/index.js.map +1 -0
- package/lib/module/ai-components/markdown/index.js +59 -0
- package/lib/module/ai-components/markdown/index.js.map +1 -0
- package/lib/module/ai-components/markdown/rules.js +152 -0
- package/lib/module/ai-components/markdown/rules.js.map +1 -0
- package/lib/module/ai-components/markdown/styles.js +240 -0
- package/lib/module/ai-components/markdown/styles.js.map +1 -0
- package/lib/module/ai-components/markdown/types.js +4 -0
- package/lib/module/ai-components/markdown/types.js.map +1 -0
- package/lib/module/ai-components/markdown/utils/generate-markdown-text.js +73 -0
- package/lib/module/ai-components/markdown/utils/generate-markdown-text.js.map +1 -0
- package/lib/module/ai-components/markdown/utils/index.js +15 -0
- package/lib/module/ai-components/markdown/utils/index.js.map +1 -0
- package/lib/module/ai-components/message-composer/ActionButton.js +104 -0
- package/lib/module/ai-components/message-composer/ActionButton.js.map +1 -0
- package/lib/module/ai-components/message-composer/ActionSheet.js +197 -0
- package/lib/module/ai-components/message-composer/ActionSheet.js.map +1 -0
- package/lib/module/ai-components/message-composer/AttachmentButton.js +55 -0
- package/lib/module/ai-components/message-composer/AttachmentButton.js.map +1 -0
- package/lib/module/ai-components/message-composer/ComposerView.js +151 -0
- package/lib/module/ai-components/message-composer/ComposerView.js.map +1 -0
- package/lib/module/ai-components/message-composer/MediaPreviewList.js +84 -0
- package/lib/module/ai-components/message-composer/MediaPreviewList.js.map +1 -0
- package/lib/module/ai-components/message-composer/SpeechToTextButton.js +82 -0
- package/lib/module/ai-components/message-composer/SpeechToTextButton.js.map +1 -0
- package/lib/module/ai-components/message-composer/index.js +59 -0
- package/lib/module/ai-components/message-composer/index.js.map +1 -0
- package/lib/module/ai-components/message-composer/utils/withCloseSheet.js +16 -0
- package/lib/module/ai-components/message-composer/utils/withCloseSheet.js.map +1 -0
- package/lib/module/ai-components/native/AIDictation.js +60 -0
- package/lib/module/ai-components/native/AIDictation.js.map +1 -0
- package/lib/module/ai-components/native/PerfText.js +31 -0
- package/lib/module/ai-components/native/PerfText.js.map +1 -0
- package/lib/module/ai-components/native-specs/NativeAIDictation.js +7 -0
- package/lib/module/ai-components/native-specs/NativeAIDictation.js.map +1 -0
- package/lib/module/ai-components/services/clipboard-service/expo.js +13 -0
- package/lib/module/ai-components/services/clipboard-service/expo.js.map +1 -0
- package/lib/module/ai-components/services/clipboard-service/index.js +8 -0
- package/lib/module/ai-components/services/clipboard-service/index.js.map +1 -0
- package/lib/module/ai-components/services/clipboard-service/rncli.js +10 -0
- package/lib/module/ai-components/services/clipboard-service/rncli.js.map +1 -0
- package/lib/module/ai-components/services/index.js +26 -0
- package/lib/module/ai-components/services/index.js.map +1 -0
- package/lib/module/ai-components/services/media-picker-service/AbstractMediaPickerService.js +31 -0
- package/lib/module/ai-components/services/media-picker-service/AbstractMediaPickerService.js.map +1 -0
- package/lib/module/ai-components/services/media-picker-service/expo.js +169 -0
- package/lib/module/ai-components/services/media-picker-service/expo.js.map +1 -0
- package/lib/module/ai-components/services/media-picker-service/hooks/useMediaPickerState.js +14 -0
- package/lib/module/ai-components/services/media-picker-service/hooks/useMediaPickerState.js.map +1 -0
- package/lib/module/ai-components/services/media-picker-service/index.js +8 -0
- package/lib/module/ai-components/services/media-picker-service/index.js.map +1 -0
- package/lib/module/ai-components/services/media-picker-service/optional-modules.d.js +2 -0
- package/lib/module/ai-components/services/media-picker-service/optional-modules.d.js.map +1 -0
- package/lib/module/ai-components/services/media-picker-service/rncli.js +162 -0
- package/lib/module/ai-components/services/media-picker-service/rncli.js.map +1 -0
- package/lib/module/ai-components/store/bottom-sheet/store.js +27 -0
- package/lib/module/ai-components/store/bottom-sheet/store.js.map +1 -0
- package/lib/module/ai-components/store/bottom-sheet/useBottomSheetState.js +16 -0
- package/lib/module/ai-components/store/bottom-sheet/useBottomSheetState.js.map +1 -0
- package/lib/module/ai-components/store/composer/store.js +11 -0
- package/lib/module/ai-components/store/composer/store.js.map +1 -0
- package/lib/module/ai-components/store/composer/useComposerHasText.js +18 -0
- package/lib/module/ai-components/store/composer/useComposerHasText.js.map +1 -0
- package/lib/module/ai-components/store/composer/useComposerText.js +18 -0
- package/lib/module/ai-components/store/composer/useComposerText.js.map +1 -0
- package/lib/module/ai-components/store/dictation/store.js +17 -0
- package/lib/module/ai-components/store/dictation/store.js.map +1 -0
- package/lib/module/ai-components/store/dictation/useDictationState.js +18 -0
- package/lib/module/ai-components/store/dictation/useDictationState.js.map +1 -0
- package/lib/module/ai-components/store/dictation/useDictationTranscript.js +14 -0
- package/lib/module/ai-components/store/dictation/useDictationTranscript.js.map +1 -0
- package/lib/module/ai-components/store/index.js +70 -0
- package/lib/module/ai-components/store/index.js.map +1 -0
- package/lib/module/ai-components/syntax-highlighting/SyntaxHighlighter.js +51 -0
- package/lib/module/ai-components/syntax-highlighting/SyntaxHighlighter.js.map +1 -0
- package/lib/module/ai-components/syntax-highlighting/components/AndroidNativeRenderer.js +35 -0
- package/lib/module/ai-components/syntax-highlighting/components/AndroidNativeRenderer.js.map +1 -0
- package/lib/module/ai-components/syntax-highlighting/components/index.js +15 -0
- package/lib/module/ai-components/syntax-highlighting/components/index.js.map +1 -0
- package/lib/module/ai-components/syntax-highlighting/index.js +48 -0
- package/lib/module/ai-components/syntax-highlighting/index.js.map +1 -0
- package/lib/module/ai-components/syntax-highlighting/prism-config.js +7 -0
- package/lib/module/ai-components/syntax-highlighting/prism-config.js.map +1 -0
- package/lib/module/ai-components/syntax-highlighting/types.js +4 -0
- package/lib/module/ai-components/syntax-highlighting/types.js.map +1 -0
- package/lib/module/ai-components/syntax-highlighting/utils/converter.js +107 -0
- package/lib/module/ai-components/syntax-highlighting/utils/converter.js.map +1 -0
- package/lib/module/ai-components/syntax-highlighting/utils/flatten-nodes.js +139 -0
- package/lib/module/ai-components/syntax-highlighting/utils/flatten-nodes.js.map +1 -0
- package/lib/module/ai-components/syntax-highlighting/utils/index.js +37 -0
- package/lib/module/ai-components/syntax-highlighting/utils/index.js.map +1 -0
- package/lib/module/ai-components/syntax-highlighting/utils/renderer.js +117 -0
- package/lib/module/ai-components/syntax-highlighting/utils/renderer.js.map +1 -0
- package/lib/module/ai-components/theme.js +99 -0
- package/lib/module/ai-components/theme.js.map +1 -0
- package/lib/module/ai-components/transcription/useDictation.js +114 -0
- package/lib/module/ai-components/transcription/useDictation.js.map +1 -0
- package/lib/module/native.js +4 -0
- package/lib/module/native.js.map +1 -1
- package/lib/module/version.json +1 -1
- package/lib/typescript/ai-components/AITypingIndicatorView.d.ts +4 -0
- package/lib/typescript/ai-components/AITypingIndicatorView.d.ts.map +1 -0
- package/lib/typescript/ai-components/StreamingMessageView.d.ts +19 -0
- package/lib/typescript/ai-components/StreamingMessageView.d.ts.map +1 -0
- package/lib/typescript/ai-components/charts/Chart.d.ts +10 -0
- package/lib/typescript/ai-components/charts/Chart.d.ts.map +1 -0
- package/lib/typescript/ai-components/charts/components/PieLegend.d.ts +7 -0
- package/lib/typescript/ai-components/charts/components/PieLegend.d.ts.map +1 -0
- package/lib/typescript/ai-components/charts/components/VictoryChart.d.ts +9 -0
- package/lib/typescript/ai-components/charts/components/VictoryChart.d.ts.map +1 -0
- package/lib/typescript/ai-components/charts/components/index.d.ts +3 -0
- package/lib/typescript/ai-components/charts/components/index.d.ts.map +1 -0
- package/lib/typescript/ai-components/charts/index.d.ts +7 -0
- package/lib/typescript/ai-components/charts/index.d.ts.map +1 -0
- package/lib/typescript/ai-components/charts/mermaid/index.d.ts +2 -0
- package/lib/typescript/ai-components/charts/mermaid/index.d.ts.map +1 -0
- package/lib/typescript/ai-components/charts/mermaid/parser.d.ts +4 -0
- package/lib/typescript/ai-components/charts/mermaid/parser.d.ts.map +1 -0
- package/lib/typescript/ai-components/charts/types.d.ts +23 -0
- package/lib/typescript/ai-components/charts/types.d.ts.map +1 -0
- package/lib/typescript/ai-components/charts/utils/generate-pie-colors.d.ts +9 -0
- package/lib/typescript/ai-components/charts/utils/generate-pie-colors.d.ts.map +1 -0
- package/lib/typescript/ai-components/charts/utils/index.d.ts +3 -0
- package/lib/typescript/ai-components/charts/utils/index.d.ts.map +1 -0
- package/lib/typescript/ai-components/charts/utils/parse-json-chart.d.ts +3 -0
- package/lib/typescript/ai-components/charts/utils/parse-json-chart.d.ts.map +1 -0
- package/lib/typescript/ai-components/charts/vega-lite/index.d.ts +3 -0
- package/lib/typescript/ai-components/charts/vega-lite/index.d.ts.map +1 -0
- package/lib/typescript/ai-components/charts/vega-lite/parser.d.ts +4 -0
- package/lib/typescript/ai-components/charts/vega-lite/parser.d.ts.map +1 -0
- package/lib/typescript/ai-components/charts/vega-lite/schema.d.ts +305 -0
- package/lib/typescript/ai-components/charts/vega-lite/schema.d.ts.map +1 -0
- package/lib/typescript/ai-components/components/BottomSheet.d.ts +5 -0
- package/lib/typescript/ai-components/components/BottomSheet.d.ts.map +1 -0
- package/lib/typescript/ai-components/components/MarkdownReactiveScrollView.d.ts +3 -0
- package/lib/typescript/ai-components/components/MarkdownReactiveScrollView.d.ts.map +1 -0
- package/lib/typescript/ai-components/components/index.d.ts +3 -0
- package/lib/typescript/ai-components/components/index.d.ts.map +1 -0
- package/lib/typescript/ai-components/contexts/composer-context.d.ts +16 -0
- package/lib/typescript/ai-components/contexts/composer-context.d.ts.map +1 -0
- package/lib/typescript/ai-components/contexts/index.d.ts +3 -0
- package/lib/typescript/ai-components/contexts/index.d.ts.map +1 -0
- package/lib/typescript/ai-components/contexts/theme-context.d.ts +23 -0
- package/lib/typescript/ai-components/contexts/theme-context.d.ts.map +1 -0
- package/lib/typescript/ai-components/index.d.ts +15 -0
- package/lib/typescript/ai-components/index.d.ts.map +1 -0
- package/lib/typescript/ai-components/internal/hooks/useStableCallback.d.ts +26 -0
- package/lib/typescript/ai-components/internal/hooks/useStableCallback.d.ts.map +1 -0
- package/lib/typescript/ai-components/internal/icons/Camera.d.ts +4 -0
- package/lib/typescript/ai-components/internal/icons/Camera.d.ts.map +1 -0
- package/lib/typescript/ai-components/internal/icons/CircleStop.d.ts +8 -0
- package/lib/typescript/ai-components/internal/icons/CircleStop.d.ts.map +1 -0
- package/lib/typescript/ai-components/internal/icons/Close.d.ts +4 -0
- package/lib/typescript/ai-components/internal/icons/Close.d.ts.map +1 -0
- package/lib/typescript/ai-components/internal/icons/Mic.d.ts +8 -0
- package/lib/typescript/ai-components/internal/icons/Mic.d.ts.map +1 -0
- package/lib/typescript/ai-components/internal/icons/Picture.d.ts +4 -0
- package/lib/typescript/ai-components/internal/icons/Picture.d.ts.map +1 -0
- package/lib/typescript/ai-components/internal/icons/SendUp.d.ts +8 -0
- package/lib/typescript/ai-components/internal/icons/SendUp.d.ts.map +1 -0
- package/lib/typescript/ai-components/internal/icons/utils/base.d.ts +13 -0
- package/lib/typescript/ai-components/internal/icons/utils/base.d.ts.map +1 -0
- package/lib/typescript/ai-components/markdown/components/Autolink.d.ts +4 -0
- package/lib/typescript/ai-components/markdown/components/Autolink.d.ts.map +1 -0
- package/lib/typescript/ai-components/markdown/components/BlockQuote.d.ts +4 -0
- package/lib/typescript/ai-components/markdown/components/BlockQuote.d.ts.map +1 -0
- package/lib/typescript/ai-components/markdown/components/Bold.d.ts +4 -0
- package/lib/typescript/ai-components/markdown/components/Bold.d.ts.map +1 -0
- package/lib/typescript/ai-components/markdown/components/CodeBlock.d.ts +9 -0
- package/lib/typescript/ai-components/markdown/components/CodeBlock.d.ts.map +1 -0
- package/lib/typescript/ai-components/markdown/components/Emphasis.d.ts +4 -0
- package/lib/typescript/ai-components/markdown/components/Emphasis.d.ts.map +1 -0
- package/lib/typescript/ai-components/markdown/components/Heading.d.ts +4 -0
- package/lib/typescript/ai-components/markdown/components/Heading.d.ts.map +1 -0
- package/lib/typescript/ai-components/markdown/components/HorizontalRule.d.ts +4 -0
- package/lib/typescript/ai-components/markdown/components/HorizontalRule.d.ts.map +1 -0
- package/lib/typescript/ai-components/markdown/components/InlineCode.d.ts +4 -0
- package/lib/typescript/ai-components/markdown/components/InlineCode.d.ts.map +1 -0
- package/lib/typescript/ai-components/markdown/components/LineBreak.d.ts +4 -0
- package/lib/typescript/ai-components/markdown/components/LineBreak.d.ts.map +1 -0
- package/lib/typescript/ai-components/markdown/components/Link.d.ts +4 -0
- package/lib/typescript/ai-components/markdown/components/Link.d.ts.map +1 -0
- package/lib/typescript/ai-components/markdown/components/List.d.ts +4 -0
- package/lib/typescript/ai-components/markdown/components/List.d.ts.map +1 -0
- package/lib/typescript/ai-components/markdown/components/Mailto.d.ts +4 -0
- package/lib/typescript/ai-components/markdown/components/Mailto.d.ts.map +1 -0
- package/lib/typescript/ai-components/markdown/components/Markdown.d.ts +4 -0
- package/lib/typescript/ai-components/markdown/components/Markdown.d.ts.map +1 -0
- package/lib/typescript/ai-components/markdown/components/NewLine.d.ts +4 -0
- package/lib/typescript/ai-components/markdown/components/NewLine.d.ts.map +1 -0
- package/lib/typescript/ai-components/markdown/components/Paragraph.d.ts +5 -0
- package/lib/typescript/ai-components/markdown/components/Paragraph.d.ts.map +1 -0
- package/lib/typescript/ai-components/markdown/components/Strikethrough.d.ts +4 -0
- package/lib/typescript/ai-components/markdown/components/Strikethrough.d.ts.map +1 -0
- package/lib/typescript/ai-components/markdown/components/Table.d.ts +4 -0
- package/lib/typescript/ai-components/markdown/components/Table.d.ts.map +1 -0
- package/lib/typescript/ai-components/markdown/components/Text.d.ts +4 -0
- package/lib/typescript/ai-components/markdown/components/Text.d.ts.map +1 -0
- package/lib/typescript/ai-components/markdown/components/Url.d.ts +4 -0
- package/lib/typescript/ai-components/markdown/components/Url.d.ts.map +1 -0
- package/lib/typescript/ai-components/markdown/components/index.d.ts +20 -0
- package/lib/typescript/ai-components/markdown/components/index.d.ts.map +1 -0
- package/lib/typescript/ai-components/markdown/index.d.ts +6 -0
- package/lib/typescript/ai-components/markdown/index.d.ts.map +1 -0
- package/lib/typescript/ai-components/markdown/rules.d.ts +4 -0
- package/lib/typescript/ai-components/markdown/rules.d.ts.map +1 -0
- package/lib/typescript/ai-components/markdown/styles.d.ts +232 -0
- package/lib/typescript/ai-components/markdown/styles.d.ts.map +1 -0
- package/lib/typescript/ai-components/markdown/types.d.ts +137 -0
- package/lib/typescript/ai-components/markdown/types.d.ts.map +1 -0
- package/lib/typescript/ai-components/markdown/utils/generate-markdown-text.d.ts +5 -0
- package/lib/typescript/ai-components/markdown/utils/generate-markdown-text.d.ts.map +1 -0
- package/lib/typescript/ai-components/markdown/utils/index.d.ts +2 -0
- package/lib/typescript/ai-components/markdown/utils/index.d.ts.map +1 -0
- package/lib/typescript/ai-components/message-composer/ActionButton.d.ts +4 -0
- package/lib/typescript/ai-components/message-composer/ActionButton.d.ts.map +1 -0
- package/lib/typescript/ai-components/message-composer/ActionSheet.d.ts +16 -0
- package/lib/typescript/ai-components/message-composer/ActionSheet.d.ts.map +1 -0
- package/lib/typescript/ai-components/message-composer/AttachmentButton.d.ts +3 -0
- package/lib/typescript/ai-components/message-composer/AttachmentButton.d.ts.map +1 -0
- package/lib/typescript/ai-components/message-composer/ComposerView.d.ts +33 -0
- package/lib/typescript/ai-components/message-composer/ComposerView.d.ts.map +1 -0
- package/lib/typescript/ai-components/message-composer/MediaPreviewList.d.ts +3 -0
- package/lib/typescript/ai-components/message-composer/MediaPreviewList.d.ts.map +1 -0
- package/lib/typescript/ai-components/message-composer/SpeechToTextButton.d.ts +12 -0
- package/lib/typescript/ai-components/message-composer/SpeechToTextButton.d.ts.map +1 -0
- package/lib/typescript/ai-components/message-composer/index.d.ts +6 -0
- package/lib/typescript/ai-components/message-composer/index.d.ts.map +1 -0
- package/lib/typescript/ai-components/message-composer/utils/withCloseSheet.d.ts +2 -0
- package/lib/typescript/ai-components/message-composer/utils/withCloseSheet.d.ts.map +1 -0
- package/lib/typescript/ai-components/native/AIDictation.d.ts +18 -0
- package/lib/typescript/ai-components/native/AIDictation.d.ts.map +1 -0
- package/lib/typescript/ai-components/native/PerfText.d.ts +13 -0
- package/lib/typescript/ai-components/native/PerfText.d.ts.map +1 -0
- package/lib/typescript/ai-components/native-specs/NativeAIDictation.d.ts +40 -0
- package/lib/typescript/ai-components/native-specs/NativeAIDictation.d.ts.map +1 -0
- package/lib/typescript/ai-components/services/clipboard-service/expo.d.ts +2 -0
- package/lib/typescript/ai-components/services/clipboard-service/expo.d.ts.map +1 -0
- package/lib/typescript/ai-components/services/clipboard-service/index.d.ts +2 -0
- package/lib/typescript/ai-components/services/clipboard-service/index.d.ts.map +1 -0
- package/lib/typescript/ai-components/services/clipboard-service/rncli.d.ts +2 -0
- package/lib/typescript/ai-components/services/clipboard-service/rncli.d.ts.map +1 -0
- package/lib/typescript/ai-components/services/index.d.ts +3 -0
- package/lib/typescript/ai-components/services/index.d.ts.map +1 -0
- package/lib/typescript/ai-components/services/media-picker-service/AbstractMediaPickerService.d.ts +40 -0
- package/lib/typescript/ai-components/services/media-picker-service/AbstractMediaPickerService.d.ts.map +1 -0
- package/lib/typescript/ai-components/services/media-picker-service/expo.d.ts +34 -0
- package/lib/typescript/ai-components/services/media-picker-service/expo.d.ts.map +1 -0
- package/lib/typescript/ai-components/services/media-picker-service/hooks/useMediaPickerState.d.ts +11 -0
- package/lib/typescript/ai-components/services/media-picker-service/hooks/useMediaPickerState.d.ts.map +1 -0
- package/lib/typescript/ai-components/services/media-picker-service/index.d.ts +37 -0
- package/lib/typescript/ai-components/services/media-picker-service/index.d.ts.map +1 -0
- package/lib/typescript/ai-components/services/media-picker-service/rncli.d.ts +34 -0
- package/lib/typescript/ai-components/services/media-picker-service/rncli.d.ts.map +1 -0
- package/lib/typescript/ai-components/store/bottom-sheet/store.d.ts +12 -0
- package/lib/typescript/ai-components/store/bottom-sheet/store.d.ts.map +1 -0
- package/lib/typescript/ai-components/store/bottom-sheet/useBottomSheetState.d.ts +5 -0
- package/lib/typescript/ai-components/store/bottom-sheet/useBottomSheetState.d.ts.map +1 -0
- package/lib/typescript/ai-components/store/composer/store.d.ts +7 -0
- package/lib/typescript/ai-components/store/composer/store.d.ts.map +1 -0
- package/lib/typescript/ai-components/store/composer/useComposerHasText.d.ts +4 -0
- package/lib/typescript/ai-components/store/composer/useComposerHasText.d.ts.map +1 -0
- package/lib/typescript/ai-components/store/composer/useComposerText.d.ts +4 -0
- package/lib/typescript/ai-components/store/composer/useComposerText.d.ts.map +1 -0
- package/lib/typescript/ai-components/store/dictation/store.d.ts +13 -0
- package/lib/typescript/ai-components/store/dictation/store.d.ts.map +1 -0
- package/lib/typescript/ai-components/store/dictation/useDictationState.d.ts +6 -0
- package/lib/typescript/ai-components/store/dictation/useDictationState.d.ts.map +1 -0
- package/lib/typescript/ai-components/store/dictation/useDictationTranscript.d.ts +4 -0
- package/lib/typescript/ai-components/store/dictation/useDictationTranscript.d.ts.map +1 -0
- package/lib/typescript/ai-components/store/index.d.ts +7 -0
- package/lib/typescript/ai-components/store/index.d.ts.map +1 -0
- package/lib/typescript/ai-components/syntax-highlighting/SyntaxHighlighter.d.ts +11 -0
- package/lib/typescript/ai-components/syntax-highlighting/SyntaxHighlighter.d.ts.map +1 -0
- package/lib/typescript/ai-components/syntax-highlighting/components/AndroidNativeRenderer.d.ts +10 -0
- package/lib/typescript/ai-components/syntax-highlighting/components/AndroidNativeRenderer.d.ts.map +1 -0
- package/lib/typescript/ai-components/syntax-highlighting/components/index.d.ts +2 -0
- package/lib/typescript/ai-components/syntax-highlighting/components/index.d.ts.map +1 -0
- package/lib/typescript/ai-components/syntax-highlighting/index.d.ts +10 -0
- package/lib/typescript/ai-components/syntax-highlighting/index.d.ts.map +1 -0
- package/lib/typescript/ai-components/syntax-highlighting/prism-config.d.ts +2 -0
- package/lib/typescript/ai-components/syntax-highlighting/prism-config.d.ts.map +1 -0
- package/lib/typescript/ai-components/syntax-highlighting/types.d.ts +21 -0
- package/lib/typescript/ai-components/syntax-highlighting/types.d.ts.map +1 -0
- package/lib/typescript/ai-components/syntax-highlighting/utils/converter.d.ts +5 -0
- package/lib/typescript/ai-components/syntax-highlighting/utils/converter.d.ts.map +1 -0
- package/lib/typescript/ai-components/syntax-highlighting/utils/flatten-nodes.d.ts +19 -0
- package/lib/typescript/ai-components/syntax-highlighting/utils/flatten-nodes.d.ts.map +1 -0
- package/lib/typescript/ai-components/syntax-highlighting/utils/index.d.ts +4 -0
- package/lib/typescript/ai-components/syntax-highlighting/utils/index.d.ts.map +1 -0
- package/lib/typescript/ai-components/syntax-highlighting/utils/renderer.d.ts +30 -0
- package/lib/typescript/ai-components/syntax-highlighting/utils/renderer.d.ts.map +1 -0
- package/lib/typescript/ai-components/theme.d.ts +58 -0
- package/lib/typescript/ai-components/theme.d.ts.map +1 -0
- package/lib/typescript/ai-components/transcription/useDictation.d.ts +8 -0
- package/lib/typescript/ai-components/transcription/useDictation.d.ts.map +1 -0
- package/lib/typescript/native.d.ts +17 -1
- package/lib/typescript/native.d.ts.map +1 -1
- package/package.json +23 -5
- package/src/ai-components/AITypingIndicatorView.tsx +51 -0
- package/src/ai-components/README.md +279 -0
- package/src/ai-components/StreamingMessageView.tsx +85 -0
- package/src/ai-components/__tests__/ComposerView.test.tsx +113 -0
- package/src/ai-components/__tests__/Markdown.test.tsx +94 -0
- package/src/ai-components/__tests__/StreamingMessageView.test.tsx +126 -0
- package/src/ai-components/__tests__/SyntaxHighlighter.test.tsx +136 -0
- package/src/ai-components/__tests__/charts.test.ts +131 -0
- package/src/ai-components/__tests__/dictation.test.tsx +166 -0
- package/src/ai-components/__tests__/generateMarkdownText.test.ts +54 -0
- package/src/ai-components/__tests__/theme.test.tsx +41 -0
- package/src/ai-components/charts/Chart.tsx +20 -0
- package/src/ai-components/charts/components/PieLegend.tsx +50 -0
- package/src/ai-components/charts/components/VictoryChart.tsx +193 -0
- package/src/ai-components/charts/components/index.ts +2 -0
- package/src/ai-components/charts/index.ts +13 -0
- package/src/ai-components/charts/mermaid/index.ts +1 -0
- package/src/ai-components/charts/mermaid/parser.ts +33 -0
- package/src/ai-components/charts/types.ts +25 -0
- package/src/ai-components/charts/utils/generate-pie-colors.ts +82 -0
- package/src/ai-components/charts/utils/index.ts +2 -0
- package/src/ai-components/charts/utils/parse-json-chart.ts +15 -0
- package/src/ai-components/charts/vega-lite/index.ts +2 -0
- package/src/ai-components/charts/vega-lite/parser.ts +49 -0
- package/src/ai-components/charts/vega-lite/schema.ts +112 -0
- package/src/ai-components/components/BottomSheet.tsx +158 -0
- package/src/ai-components/components/MarkdownReactiveScrollView.tsx +92 -0
- package/src/ai-components/components/index.ts +2 -0
- package/src/ai-components/contexts/composer-context.tsx +73 -0
- package/src/ai-components/contexts/index.ts +2 -0
- package/src/ai-components/contexts/theme-context.tsx +68 -0
- package/src/ai-components/index.ts +29 -0
- package/src/ai-components/internal/hooks/useStableCallback.ts +37 -0
- package/src/ai-components/internal/icons/Camera.tsx +12 -0
- package/src/ai-components/internal/icons/CircleStop.tsx +18 -0
- package/src/ai-components/internal/icons/Close.tsx +12 -0
- package/src/ai-components/internal/icons/Mic.tsx +20 -0
- package/src/ai-components/internal/icons/Picture.tsx +16 -0
- package/src/ai-components/internal/icons/SendUp.tsx +21 -0
- package/src/ai-components/internal/icons/utils/base.tsx +44 -0
- package/src/ai-components/markdown/components/Autolink.tsx +26 -0
- package/src/ai-components/markdown/components/BlockQuote.tsx +19 -0
- package/src/ai-components/markdown/components/Bold.tsx +16 -0
- package/src/ai-components/markdown/components/CodeBlock.tsx +96 -0
- package/src/ai-components/markdown/components/Emphasis.tsx +16 -0
- package/src/ai-components/markdown/components/Heading.tsx +30 -0
- package/src/ai-components/markdown/components/HorizontalRule.tsx +9 -0
- package/src/ai-components/markdown/components/InlineCode.tsx +16 -0
- package/src/ai-components/markdown/components/LineBreak.tsx +11 -0
- package/src/ai-components/markdown/components/Link.tsx +28 -0
- package/src/ai-components/markdown/components/List.tsx +65 -0
- package/src/ai-components/markdown/components/Mailto.tsx +26 -0
- package/src/ai-components/markdown/components/Markdown.tsx +59 -0
- package/src/ai-components/markdown/components/NewLine.tsx +11 -0
- package/src/ai-components/markdown/components/Paragraph.tsx +69 -0
- package/src/ai-components/markdown/components/Strikethrough.tsx +16 -0
- package/src/ai-components/markdown/components/Table.tsx +81 -0
- package/src/ai-components/markdown/components/Text.tsx +37 -0
- package/src/ai-components/markdown/components/Url.tsx +26 -0
- package/src/ai-components/markdown/components/index.ts +20 -0
- package/src/ai-components/markdown/index.tsx +5 -0
- package/src/ai-components/markdown/rules.ts +216 -0
- package/src/ai-components/markdown/styles.ts +236 -0
- package/src/ai-components/markdown/types.ts +163 -0
- package/src/ai-components/markdown/utils/generate-markdown-text.ts +117 -0
- package/src/ai-components/markdown/utils/index.ts +1 -0
- package/src/ai-components/message-composer/ActionButton.tsx +99 -0
- package/src/ai-components/message-composer/ActionSheet.tsx +205 -0
- package/src/ai-components/message-composer/AttachmentButton.tsx +49 -0
- package/src/ai-components/message-composer/ComposerView.tsx +187 -0
- package/src/ai-components/message-composer/MediaPreviewList.tsx +84 -0
- package/src/ai-components/message-composer/SpeechToTextButton.tsx +79 -0
- package/src/ai-components/message-composer/index.ts +5 -0
- package/src/ai-components/message-composer/utils/withCloseSheet.ts +11 -0
- package/src/ai-components/native/AIDictation.ts +77 -0
- package/src/ai-components/native/PerfText.tsx +32 -0
- package/src/ai-components/native-specs/NativeAIDictation.ts +48 -0
- package/src/ai-components/services/clipboard-service/expo.ts +11 -0
- package/src/ai-components/services/clipboard-service/index.ts +4 -0
- package/src/ai-components/services/clipboard-service/rncli.ts +11 -0
- package/src/ai-components/services/index.ts +2 -0
- package/src/ai-components/services/media-picker-service/AbstractMediaPickerService.ts +62 -0
- package/src/ai-components/services/media-picker-service/expo.ts +148 -0
- package/src/ai-components/services/media-picker-service/hooks/useMediaPickerState.ts +14 -0
- package/src/ai-components/services/media-picker-service/index.ts +4 -0
- package/src/ai-components/services/media-picker-service/optional-modules.d.ts +25 -0
- package/src/ai-components/services/media-picker-service/rncli.ts +142 -0
- package/src/ai-components/store/bottom-sheet/store.ts +30 -0
- package/src/ai-components/store/bottom-sheet/useBottomSheetState.ts +10 -0
- package/src/ai-components/store/composer/store.ts +12 -0
- package/src/ai-components/store/composer/useComposerHasText.ts +14 -0
- package/src/ai-components/store/composer/useComposerText.ts +14 -0
- package/src/ai-components/store/dictation/store.ts +23 -0
- package/src/ai-components/store/dictation/useDictationState.ts +11 -0
- package/src/ai-components/store/dictation/useDictationTranscript.ts +9 -0
- package/src/ai-components/store/index.ts +11 -0
- package/src/ai-components/syntax-highlighting/SyntaxHighlighter.tsx +66 -0
- package/src/ai-components/syntax-highlighting/components/AndroidNativeRenderer.tsx +29 -0
- package/src/ai-components/syntax-highlighting/components/index.ts +1 -0
- package/src/ai-components/syntax-highlighting/index.ts +11 -0
- package/src/ai-components/syntax-highlighting/prism-config.ts +4 -0
- package/src/ai-components/syntax-highlighting/types.ts +26 -0
- package/src/ai-components/syntax-highlighting/utils/converter.ts +145 -0
- package/src/ai-components/syntax-highlighting/utils/flatten-nodes.ts +150 -0
- package/src/ai-components/syntax-highlighting/utils/index.ts +3 -0
- package/src/ai-components/syntax-highlighting/utils/renderer.tsx +151 -0
- package/src/ai-components/theme.ts +138 -0
- package/src/ai-components/transcription/useDictation.ts +106 -0
- package/src/native.ts +19 -1
- package/src/version.json +1 -1
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
import React, { useEffect, useMemo, useRef } from 'react';
|
|
2
|
+
import { Platform, StyleSheet, TextInput, View } from 'react-native';
|
|
3
|
+
|
|
4
|
+
import Animated, { LinearTransition } from 'react-native-reanimated';
|
|
5
|
+
|
|
6
|
+
import type { StateStore } from '@stream-io/state-store';
|
|
7
|
+
|
|
8
|
+
import { ActionButton } from './ActionButton';
|
|
9
|
+
import { BottomSheetContent } from './ActionSheet';
|
|
10
|
+
|
|
11
|
+
import { AttachmentButton } from './AttachmentButton';
|
|
12
|
+
|
|
13
|
+
import { MediaPreviewList } from './MediaPreviewList';
|
|
14
|
+
|
|
15
|
+
import { BottomSheet } from '../components/BottomSheet';
|
|
16
|
+
|
|
17
|
+
import { ComposerProvider, useMessageComposerContext, useTheme } from '../contexts';
|
|
18
|
+
import type {
|
|
19
|
+
AbstractMediaPickerService,
|
|
20
|
+
MediaPickerState,
|
|
21
|
+
} from '../services/media-picker-service/AbstractMediaPickerService';
|
|
22
|
+
import { useComposerText } from '../store';
|
|
23
|
+
import type { ComposerState } from '../store';
|
|
24
|
+
import { useDictationState } from '../store/dictation/useDictationState';
|
|
25
|
+
import { useDictationTranscript } from '../store/dictation/useDictationTranscript';
|
|
26
|
+
|
|
27
|
+
export type BottomSheetOption = {
|
|
28
|
+
title: string;
|
|
29
|
+
action: () => void | Promise<void>;
|
|
30
|
+
subtitle?: string;
|
|
31
|
+
Icon?: React.ComponentType;
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
export type BottomSheetInsets = {
|
|
35
|
+
top: number;
|
|
36
|
+
bottom: number;
|
|
37
|
+
left: number;
|
|
38
|
+
right: number;
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
export type ComposerViewProps = {
|
|
42
|
+
onSendMessage: (opts: {
|
|
43
|
+
text: string;
|
|
44
|
+
attachments?: MediaPickerState['assets'];
|
|
45
|
+
custom?: Record<string, unknown>;
|
|
46
|
+
}) => Promise<void>;
|
|
47
|
+
bottomSheetOptions?: BottomSheetOption[];
|
|
48
|
+
isGenerating?: boolean;
|
|
49
|
+
stopGenerating?: () => Promise<void>;
|
|
50
|
+
bottomSheetInsets?: BottomSheetInsets;
|
|
51
|
+
mediaPickerService?: AbstractMediaPickerService;
|
|
52
|
+
state?: StateStore<ComposerState>;
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
export const ComposerViewUI = ({
|
|
56
|
+
bottomSheetOptions = [],
|
|
57
|
+
bottomSheetInsets,
|
|
58
|
+
isGenerating,
|
|
59
|
+
stopGenerating,
|
|
60
|
+
}: ComposerViewProps) => {
|
|
61
|
+
const {
|
|
62
|
+
theme: {
|
|
63
|
+
composer: { container, containerRow, inputPillContainer, inputPill },
|
|
64
|
+
},
|
|
65
|
+
} = useTheme();
|
|
66
|
+
const styles = useStyles();
|
|
67
|
+
|
|
68
|
+
return (
|
|
69
|
+
<View pointerEvents={'box-none'} style={[styles.container, container]}>
|
|
70
|
+
<View style={[styles.row, containerRow]}>
|
|
71
|
+
<AttachmentButton />
|
|
72
|
+
|
|
73
|
+
<Animated.View
|
|
74
|
+
style={[styles.inputPillContainer, inputPillContainer]}
|
|
75
|
+
layout={LinearTransition.duration(150)}
|
|
76
|
+
>
|
|
77
|
+
<MediaPreviewList />
|
|
78
|
+
<View style={[styles.inputPill, inputPill]}>
|
|
79
|
+
<AIMessageInput />
|
|
80
|
+
<ActionButton isGenerating={isGenerating} stopGenerating={stopGenerating} />
|
|
81
|
+
</View>
|
|
82
|
+
</Animated.View>
|
|
83
|
+
</View>
|
|
84
|
+
<BottomSheet>
|
|
85
|
+
<BottomSheetContent
|
|
86
|
+
bottomSheetOptions={bottomSheetOptions}
|
|
87
|
+
bottomSheetInsets={bottomSheetInsets}
|
|
88
|
+
/>
|
|
89
|
+
</BottomSheet>
|
|
90
|
+
</View>
|
|
91
|
+
);
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
export const AIMessageInput = () => {
|
|
95
|
+
const {
|
|
96
|
+
theme: {
|
|
97
|
+
colors: { grey_neutral },
|
|
98
|
+
composer: { textInput },
|
|
99
|
+
},
|
|
100
|
+
} = useTheme();
|
|
101
|
+
const styles = useStyles();
|
|
102
|
+
|
|
103
|
+
const { error, isRecording } = useDictationState();
|
|
104
|
+
const { text } = useComposerText();
|
|
105
|
+
const { transcript } = useDictationTranscript();
|
|
106
|
+
const { setText } = useMessageComposerContext();
|
|
107
|
+
const previousTranscript = useRef(transcript);
|
|
108
|
+
|
|
109
|
+
useEffect(() => {
|
|
110
|
+
const transcriptChanged = transcript !== previousTranscript.current;
|
|
111
|
+
previousTranscript.current = transcript;
|
|
112
|
+
if (!error && (isRecording || transcriptChanged)) {
|
|
113
|
+
setText(transcript);
|
|
114
|
+
}
|
|
115
|
+
}, [isRecording, transcript, error, setText]);
|
|
116
|
+
|
|
117
|
+
return (
|
|
118
|
+
<TextInput
|
|
119
|
+
value={text}
|
|
120
|
+
onChangeText={setText}
|
|
121
|
+
placeholder={'Ask anything'}
|
|
122
|
+
placeholderTextColor={grey_neutral}
|
|
123
|
+
style={[styles.textInput, textInput]}
|
|
124
|
+
multiline
|
|
125
|
+
underlineColorAndroid={'transparent'}
|
|
126
|
+
/>
|
|
127
|
+
);
|
|
128
|
+
};
|
|
129
|
+
|
|
130
|
+
export const ComposerView = (props: ComposerViewProps) => (
|
|
131
|
+
<ComposerProvider
|
|
132
|
+
onSendMessage={props.onSendMessage}
|
|
133
|
+
mediaPickerService={props.mediaPickerService}
|
|
134
|
+
state={props.state}
|
|
135
|
+
>
|
|
136
|
+
<ComposerViewUI {...props} />
|
|
137
|
+
</ComposerProvider>
|
|
138
|
+
);
|
|
139
|
+
|
|
140
|
+
const useStyles = () => {
|
|
141
|
+
const { theme } = useTheme();
|
|
142
|
+
|
|
143
|
+
return useMemo(() => {
|
|
144
|
+
const { colors, composer } = theme;
|
|
145
|
+
|
|
146
|
+
const pillHeight = composer.inputPillHeight;
|
|
147
|
+
|
|
148
|
+
return StyleSheet.create({
|
|
149
|
+
container: {
|
|
150
|
+
paddingHorizontal: 12,
|
|
151
|
+
paddingVertical: 8,
|
|
152
|
+
},
|
|
153
|
+
row: {
|
|
154
|
+
flexDirection: 'row',
|
|
155
|
+
alignItems: 'flex-end',
|
|
156
|
+
},
|
|
157
|
+
inputPill: {
|
|
158
|
+
alignItems: 'center',
|
|
159
|
+
flexDirection: 'row',
|
|
160
|
+
maxHeight: pillHeight * 3,
|
|
161
|
+
},
|
|
162
|
+
inputPillContainer: {
|
|
163
|
+
flex: 1,
|
|
164
|
+
minHeight: pillHeight,
|
|
165
|
+
alignItems: 'center',
|
|
166
|
+
justifyContent: 'center',
|
|
167
|
+
borderRadius: pillHeight / 2,
|
|
168
|
+
backgroundColor: colors.white_smoke,
|
|
169
|
+
paddingHorizontal: 14,
|
|
170
|
+
paddingVertical: Platform.OS === 'ios' ? 10 : 6,
|
|
171
|
+
shadowColor: colors.black,
|
|
172
|
+
shadowOpacity: 0.08,
|
|
173
|
+
shadowOffset: { width: 0, height: 1 },
|
|
174
|
+
shadowRadius: 4,
|
|
175
|
+
elevation: 2,
|
|
176
|
+
},
|
|
177
|
+
textInput: {
|
|
178
|
+
flex: 1,
|
|
179
|
+
fontSize: 16,
|
|
180
|
+
color: colors.black,
|
|
181
|
+
paddingVertical: 0,
|
|
182
|
+
paddingHorizontal: 0,
|
|
183
|
+
marginRight: 24,
|
|
184
|
+
},
|
|
185
|
+
});
|
|
186
|
+
}, [theme]);
|
|
187
|
+
};
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import React, { useMemo } from 'react';
|
|
2
|
+
import { Image, Pressable, ScrollView, StyleSheet } from 'react-native';
|
|
3
|
+
import Animated, { FadeIn, FadeOut, LinearTransition } from 'react-native-reanimated';
|
|
4
|
+
|
|
5
|
+
import { useMessageComposerContext, useTheme } from '../contexts';
|
|
6
|
+
import { Close } from '../internal/icons/Close';
|
|
7
|
+
import { useMediaPickerState } from '../services/media-picker-service/hooks/useMediaPickerState';
|
|
8
|
+
|
|
9
|
+
export const MediaPreviewList = () => {
|
|
10
|
+
const { mediaPickerService } = useMessageComposerContext();
|
|
11
|
+
const { attachments } = useMediaPickerState({ service: mediaPickerService }) ?? {};
|
|
12
|
+
const {
|
|
13
|
+
theme: {
|
|
14
|
+
colors: { white },
|
|
15
|
+
composer: {
|
|
16
|
+
mediaPreviewStyle,
|
|
17
|
+
mediaPreviewContentContainerStyle,
|
|
18
|
+
mediaPreviewImage,
|
|
19
|
+
mediaPreviewRemoveButton,
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
} = useTheme();
|
|
23
|
+
const styles = useStyles();
|
|
24
|
+
|
|
25
|
+
if (!attachments?.length) {
|
|
26
|
+
return null;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
return (
|
|
30
|
+
<ScrollView
|
|
31
|
+
style={[styles.mediaPreviewStyle, mediaPreviewStyle]}
|
|
32
|
+
contentContainerStyle={[
|
|
33
|
+
styles.mediaPreviewContentContainerStyle,
|
|
34
|
+
mediaPreviewContentContainerStyle,
|
|
35
|
+
]}
|
|
36
|
+
horizontal={true}
|
|
37
|
+
>
|
|
38
|
+
{(attachments ?? []).map((attachment, index) => (
|
|
39
|
+
<Animated.View
|
|
40
|
+
key={attachment.uri}
|
|
41
|
+
entering={FadeIn.duration(150)}
|
|
42
|
+
exiting={FadeOut.duration(150)}
|
|
43
|
+
layout={LinearTransition.duration(150)}
|
|
44
|
+
>
|
|
45
|
+
<Image
|
|
46
|
+
style={[styles.mediaPreviewImage, mediaPreviewImage]}
|
|
47
|
+
source={{ uri: attachment.uri }}
|
|
48
|
+
width={100}
|
|
49
|
+
height={100}
|
|
50
|
+
/>
|
|
51
|
+
<Pressable
|
|
52
|
+
style={[styles.mediaPreviewRemoveButton, mediaPreviewRemoveButton]}
|
|
53
|
+
onPress={() => mediaPickerService?.removeAsset(index)}
|
|
54
|
+
>
|
|
55
|
+
<Close pathFill={white} />
|
|
56
|
+
</Pressable>
|
|
57
|
+
</Animated.View>
|
|
58
|
+
))}
|
|
59
|
+
</ScrollView>
|
|
60
|
+
);
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
const useStyles = () => {
|
|
64
|
+
const { theme } = useTheme();
|
|
65
|
+
|
|
66
|
+
return useMemo(
|
|
67
|
+
() =>
|
|
68
|
+
StyleSheet.create({
|
|
69
|
+
mediaPreviewStyle: {
|
|
70
|
+
width: '100%',
|
|
71
|
+
},
|
|
72
|
+
mediaPreviewContentContainerStyle: { flexGrow: 1, paddingBottom: 8 },
|
|
73
|
+
mediaPreviewImage: { borderRadius: 12, marginRight: 8 },
|
|
74
|
+
mediaPreviewRemoveButton: {
|
|
75
|
+
position: 'absolute',
|
|
76
|
+
top: 8,
|
|
77
|
+
right: 12,
|
|
78
|
+
backgroundColor: theme.colors.overlay,
|
|
79
|
+
borderRadius: 24,
|
|
80
|
+
},
|
|
81
|
+
}),
|
|
82
|
+
[theme],
|
|
83
|
+
);
|
|
84
|
+
};
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import React, { useEffect } from 'react';
|
|
2
|
+
import { Pressable, StyleSheet, View } from 'react-native';
|
|
3
|
+
import Animated, { ZoomIn, ZoomOut } from 'react-native-reanimated';
|
|
4
|
+
|
|
5
|
+
import { useStateStore } from '@stream-io/state-store/react-bindings';
|
|
6
|
+
|
|
7
|
+
import { useTheme } from '../contexts';
|
|
8
|
+
import { Mic } from '../internal/icons/Mic';
|
|
9
|
+
|
|
10
|
+
import { isDictationAvailable, warnIfDictationUnavailable } from '../native/AIDictation';
|
|
11
|
+
import type { DictationStartOptions } from '../native-specs/NativeAIDictation';
|
|
12
|
+
import { dictationStore, type DictationStoreState } from '../store';
|
|
13
|
+
import { useDictation } from '../transcription/useDictation';
|
|
14
|
+
|
|
15
|
+
const selector = ({ isRecording }: DictationStoreState) => ({
|
|
16
|
+
isRecording,
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
type SpeechToTextButtonProps = {
|
|
20
|
+
options?: DictationStartOptions;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Renders nothing when the native dictation module is not part of the build (see
|
|
25
|
+
* `isDictationAvailable`), so that pressing the button can never reach a missing module.
|
|
26
|
+
*/
|
|
27
|
+
export const SpeechToTextButton = (props: SpeechToTextButtonProps) => {
|
|
28
|
+
if (!isDictationAvailable()) {
|
|
29
|
+
warnIfDictationUnavailable();
|
|
30
|
+
return null;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
return <AvailableSpeechToTextButton {...props} />;
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
const AvailableSpeechToTextButton = ({ options }: SpeechToTextButtonProps) => {
|
|
37
|
+
const {
|
|
38
|
+
theme: {
|
|
39
|
+
colors: { grey, accent_blue },
|
|
40
|
+
composer: { iconButton, micIcon },
|
|
41
|
+
},
|
|
42
|
+
} = useTheme();
|
|
43
|
+
|
|
44
|
+
const { cancel, toggle } = useDictation(options);
|
|
45
|
+
const { isRecording } = useStateStore(dictationStore, selector);
|
|
46
|
+
|
|
47
|
+
useEffect(() => {
|
|
48
|
+
return () => {
|
|
49
|
+
cancel();
|
|
50
|
+
};
|
|
51
|
+
}, [cancel]);
|
|
52
|
+
|
|
53
|
+
return (
|
|
54
|
+
<Animated.View
|
|
55
|
+
key={'mic-button'}
|
|
56
|
+
entering={ZoomIn.duration(250)}
|
|
57
|
+
exiting={ZoomOut.duration(250)}
|
|
58
|
+
>
|
|
59
|
+
<Pressable style={[styles.iconButton, iconButton]} onPress={toggle}>
|
|
60
|
+
<View style={[styles.micIcon, micIcon]}>
|
|
61
|
+
<Mic size={32} viewBox={`0 0 ${32} ${28}`} fill={isRecording ? accent_blue : grey} />
|
|
62
|
+
</View>
|
|
63
|
+
</Pressable>
|
|
64
|
+
</Animated.View>
|
|
65
|
+
);
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
const styles = StyleSheet.create({
|
|
69
|
+
micIcon: {
|
|
70
|
+
width: 32,
|
|
71
|
+
height: 32,
|
|
72
|
+
justifyContent: 'center',
|
|
73
|
+
alignItems: 'center',
|
|
74
|
+
},
|
|
75
|
+
iconButton: {
|
|
76
|
+
justifyContent: 'center',
|
|
77
|
+
alignItems: 'center',
|
|
78
|
+
},
|
|
79
|
+
});
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { sheetStoreApi } from '../../store';
|
|
2
|
+
|
|
3
|
+
export const withCloseSheet = <T extends unknown[]>(
|
|
4
|
+
callback: (...args: T) => void | Promise<void> | unknown | Promise<unknown> | undefined,
|
|
5
|
+
) => {
|
|
6
|
+
return async (...args: T) => {
|
|
7
|
+
const result = await callback(...args);
|
|
8
|
+
sheetStoreApi.closeSheet();
|
|
9
|
+
return result;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { NativeEventEmitter, Platform } from 'react-native';
|
|
2
|
+
|
|
3
|
+
import NativeAIDictation, {
|
|
4
|
+
type DictationError,
|
|
5
|
+
type DictationResult,
|
|
6
|
+
type DictationStartOptions,
|
|
7
|
+
type DictationState,
|
|
8
|
+
} from '../native-specs/NativeAIDictation';
|
|
9
|
+
|
|
10
|
+
// Event names emitted by the native module (see `AIDictation.mm` and `AIDictationModule.kt`).
|
|
11
|
+
const ON_STATE_EVENT = 'AIDictationOnState';
|
|
12
|
+
const ON_RESULT_EVENT = 'AIDictationOnResult';
|
|
13
|
+
const ON_ERROR_EVENT = 'AIDictationOnError';
|
|
14
|
+
|
|
15
|
+
let eventEmitter: NativeEventEmitter | undefined;
|
|
16
|
+
const getEventEmitter = () => {
|
|
17
|
+
if (!eventEmitter && NativeAIDictation) {
|
|
18
|
+
eventEmitter = new NativeEventEmitter(NativeAIDictation);
|
|
19
|
+
}
|
|
20
|
+
return eventEmitter;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
const noop = () => {};
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Whether the native dictation module is part of this build. It is always compiled in on Android,
|
|
27
|
+
* while on iOS it is opt-in: add `$StreamChatEnableDictation = true` to your
|
|
28
|
+
* `Podfile` (or use the `stream-chat-expo` config plugin) and run `pod install`.
|
|
29
|
+
*/
|
|
30
|
+
export const isDictationAvailable = () => NativeAIDictation != null;
|
|
31
|
+
|
|
32
|
+
let hasWarnedAboutMissingModule = false;
|
|
33
|
+
export const warnIfDictationUnavailable = () => {
|
|
34
|
+
if (!__DEV__ || hasWarnedAboutMissingModule || isDictationAvailable()) {
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
hasWarnedAboutMissingModule = true;
|
|
38
|
+
console.warn(
|
|
39
|
+
Platform.OS === 'ios'
|
|
40
|
+
? '[stream-chat-react-native/ai-components] Dictation is not compiled into this build, so the speech-to-text button is hidden. Add `$StreamChatEnableDictation = true` to your Podfile (Expo: add the `stream-chat-expo` config plugin) and run `pod install`.'
|
|
41
|
+
: '[stream-chat-react-native/ai-components] Dictation is not available in this build, so the speech-to-text button is hidden.',
|
|
42
|
+
);
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
// Low-level API
|
|
46
|
+
export const AIDictation = {
|
|
47
|
+
start(options?: DictationStartOptions) {
|
|
48
|
+
NativeAIDictation?.start(options);
|
|
49
|
+
},
|
|
50
|
+
stop() {
|
|
51
|
+
NativeAIDictation?.stop();
|
|
52
|
+
},
|
|
53
|
+
cancel() {
|
|
54
|
+
NativeAIDictation?.cancel();
|
|
55
|
+
},
|
|
56
|
+
isRecording() {
|
|
57
|
+
return NativeAIDictation?.isRecording() ?? false;
|
|
58
|
+
},
|
|
59
|
+
addResultListener(listener: (result: DictationResult) => void) {
|
|
60
|
+
const sub = getEventEmitter()?.addListener(ON_RESULT_EVENT, (event) =>
|
|
61
|
+
listener(event as DictationResult),
|
|
62
|
+
);
|
|
63
|
+
return sub ? () => sub.remove() : noop;
|
|
64
|
+
},
|
|
65
|
+
addStateListener(listener: (payload: DictationState) => void) {
|
|
66
|
+
const sub = getEventEmitter()?.addListener(ON_STATE_EVENT, (event) =>
|
|
67
|
+
listener(event as DictationState),
|
|
68
|
+
);
|
|
69
|
+
return sub ? () => sub.remove() : noop;
|
|
70
|
+
},
|
|
71
|
+
addErrorListener(listener: (payload: DictationError) => void) {
|
|
72
|
+
const sub = getEventEmitter()?.addListener(ON_ERROR_EVENT, (event) =>
|
|
73
|
+
listener(event as DictationError),
|
|
74
|
+
);
|
|
75
|
+
return sub ? () => sub.remove() : noop;
|
|
76
|
+
},
|
|
77
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type StyleProp, type ViewStyle } from 'react-native';
|
|
3
|
+
|
|
4
|
+
import { NativeHandlers } from '../../native';
|
|
5
|
+
import type { ColorRange } from '../syntax-highlighting';
|
|
6
|
+
|
|
7
|
+
export type PerfTextProps = {
|
|
8
|
+
text: string;
|
|
9
|
+
ranges: ColorRange[];
|
|
10
|
+
style?: StyleProp<ViewStyle>;
|
|
11
|
+
selectable?: boolean;
|
|
12
|
+
fontSize?: number;
|
|
13
|
+
lineHeight?: number;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export const PerfText = ({ style, fontSize, lineHeight, ranges, text }: PerfTextProps) => {
|
|
17
|
+
const PerfTextNative = NativeHandlers.PerfText;
|
|
18
|
+
if (!PerfTextNative) {
|
|
19
|
+
return null;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
return (
|
|
23
|
+
<PerfTextNative
|
|
24
|
+
style={style}
|
|
25
|
+
text={text}
|
|
26
|
+
colorRanges={ranges as { color: number; end: number; start: number }[]}
|
|
27
|
+
fontFamily={'monospace'}
|
|
28
|
+
fontSize={fontSize}
|
|
29
|
+
lineHeight={lineHeight}
|
|
30
|
+
/>
|
|
31
|
+
);
|
|
32
|
+
};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type { TurboModule } from 'react-native';
|
|
2
|
+
import { TurboModuleRegistry } from 'react-native';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Codegen spec of the native dictation module.
|
|
6
|
+
*
|
|
7
|
+
* This file is duplicated (byte for byte) in `package/native-package/src/native/NativeAIDictation.ts`
|
|
8
|
+
* and `package/expo-package/src/native/NativeAIDictation.ts`, which are the copies codegen reads.
|
|
9
|
+
* `yarn validate-entry-isolation` fails if they drift apart.
|
|
10
|
+
*
|
|
11
|
+
* Events are delivered through `addListener`/`removeListeners` and a `NativeEventEmitter` (see
|
|
12
|
+
* `../native/AIDictation.ts`) rather than codegen `EventEmitter` properties, since the latter are
|
|
13
|
+
* not understood by the codegen of every React Native version the SDK supports (>= 0.76).
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
export type DictationStartOptions = {
|
|
17
|
+
language?: string;
|
|
18
|
+
interimResults?: boolean;
|
|
19
|
+
silenceTimeoutMs?: number;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export type DictationResult = {
|
|
23
|
+
text: string;
|
|
24
|
+
isFinal: boolean;
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export type DictationStateValue = 'idle' | 'starting' | 'listening' | 'stopping';
|
|
28
|
+
export type DictationState = { state: DictationStateValue };
|
|
29
|
+
|
|
30
|
+
export type DictationError = {
|
|
31
|
+
code: string;
|
|
32
|
+
message: string;
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
export interface Spec extends TurboModule {
|
|
36
|
+
start(options?: DictationStartOptions): void;
|
|
37
|
+
stop(): void;
|
|
38
|
+
cancel(): void;
|
|
39
|
+
isRecording(): boolean;
|
|
40
|
+
|
|
41
|
+
addListener(eventName: string): void;
|
|
42
|
+
removeListeners(count: number): void;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
// `get` rather than `getEnforcing`: the module is only compiled in when dictation is enabled
|
|
46
|
+
// (always on Android, opt-in on iOS), and importing the AI entry point
|
|
47
|
+
// must not throw when it is absent.
|
|
48
|
+
export default TurboModuleRegistry.get<Spec>('AIDictation');
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
let Clipboard: { setString: (string: string) => void } | undefined;
|
|
2
|
+
|
|
3
|
+
try {
|
|
4
|
+
Clipboard = require('expo-clipboard');
|
|
5
|
+
} catch (_) {
|
|
6
|
+
// do nothing
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export const setClipboardString = Clipboard
|
|
10
|
+
? (string: string) => Clipboard?.setString(string)
|
|
11
|
+
: undefined;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
let Clipboard: { setString: (string: string) => void } | undefined;
|
|
2
|
+
|
|
3
|
+
try {
|
|
4
|
+
Clipboard = require('@react-native-clipboard/clipboard').default;
|
|
5
|
+
} catch (_) {
|
|
6
|
+
// do nothing
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export const setClipboardString = Clipboard
|
|
10
|
+
? (string: string) => (Clipboard ? Clipboard.setString(string) : {})
|
|
11
|
+
: undefined;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { StateStore } from '@stream-io/state-store';
|
|
2
|
+
|
|
3
|
+
export type MediaAsset = {
|
|
4
|
+
uri: string;
|
|
5
|
+
width?: number;
|
|
6
|
+
height?: number;
|
|
7
|
+
name?: string;
|
|
8
|
+
size?: number;
|
|
9
|
+
type?: string;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export type MediaPickerState = {
|
|
13
|
+
assets: MediaAsset[];
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export type PickMediaOpts = { maxNumberOfFiles?: number };
|
|
17
|
+
export type PickMediaReturnType = {
|
|
18
|
+
assets?: MediaAsset[];
|
|
19
|
+
cancelled?: boolean;
|
|
20
|
+
askToOpenSettings?: boolean;
|
|
21
|
+
};
|
|
22
|
+
export type PickMediaApi = (opts: PickMediaOpts) => Promise<PickMediaReturnType>;
|
|
23
|
+
|
|
24
|
+
export type TakeMediaOpts = { compressionQuality?: number };
|
|
25
|
+
export type TakeMediaReturnType = {
|
|
26
|
+
asset?: MediaAsset;
|
|
27
|
+
cancelled?: boolean;
|
|
28
|
+
askToOpenSettings?: boolean;
|
|
29
|
+
};
|
|
30
|
+
export type TakeMediaApi = (opts: TakeMediaOpts) => Promise<TakeMediaReturnType>;
|
|
31
|
+
|
|
32
|
+
export abstract class AbstractMediaPickerService {
|
|
33
|
+
public state: StateStore<MediaPickerState>;
|
|
34
|
+
|
|
35
|
+
constructor() {
|
|
36
|
+
this.state = new StateStore<MediaPickerState>({
|
|
37
|
+
assets: [],
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
abstract pickMedia: PickMediaApi;
|
|
42
|
+
|
|
43
|
+
abstract takeMedia: TakeMediaApi;
|
|
44
|
+
|
|
45
|
+
appendAssets = (assets: MediaAsset[]) => {
|
|
46
|
+
this.state.next((prevState) => ({
|
|
47
|
+
...prevState,
|
|
48
|
+
assets: [...prevState.assets, ...assets],
|
|
49
|
+
}));
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
removeAsset = (index: number) => {
|
|
53
|
+
this.state.next((prevState) => ({
|
|
54
|
+
...prevState,
|
|
55
|
+
assets: prevState.assets.filter((_, i) => i !== index),
|
|
56
|
+
}));
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
clearAssets = () => {
|
|
60
|
+
this.state.partialNext({ assets: [] });
|
|
61
|
+
};
|
|
62
|
+
}
|