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 @@
|
|
|
1
|
+
{"version":3,"names":["_react","require","_reactNative","_reactBindings","_useStableCallback","_AIDictation","_store","DEFAULT_OPTIONS","language","interimResults","silenceTimeoutMs","ensureAndroidRecordingPermissions","_ref","_asyncToGenerator2","default","Platform","OS","granted","PermissionsAndroid","request","PERMISSIONS","RECORD_AUDIO","RESULTS","GRANTED","apply","arguments","selector","isRecording","useDictation","defaultOptions","_useStateStore","useStateStore","dictationStore","useEffect","unsubscribeResult","AIDictation","addResultListener","result","partialNext","transcript","text","isFinal","state","unsubscribeState","addStateListener","next","unsubscribeError","addErrorListener","error","start","useCallback","_ref2","override","hasPermission","code","message","opts","_x","stop","cancel","toggle","useStableCallback","exports"],"sourceRoot":"../../../../src","sources":["ai-components/transcription/useDictation.ts"],"mappings":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EAAA;MAAA,OAAAN,KAAA,CAAA3B,KAAA,OAAAC,SAAA;IAAA;EAAA,KACD,CAACI,cAAc,CACjB,CAAC;EAED,IAAM6B,IAAI,GAAG,IAAAR,kBAAW,EAAC,MAAM;IAC7Bf,wBAAW,CAACuB,IAAI,CAAC,CAAC;EACpB,CAAC,EAAE,EAAE,CAAC;EAEN,IAAMC,MAAM,GAAG,IAAAT,kBAAW,EAAC,MAAM;IAC/Bf,wBAAW,CAACwB,MAAM,CAAC,CAAC;EACtB,CAAC,EAAE,EAAE,CAAC;EAEN,IAAMC,MAAM,GAAG,IAAAC,oCAAiB,EAAC,MAAM;IACrC,IAAIlC,WAAW,EAAE;MACf+B,IAAI,CAAC,CAAC;IACR,CAAC,MAAM;MACL,KAAKT,KAAK,CAAC,CAAC;IACd;EACF,CAAC,CAAC;EAEF,OAAO;IACLA,KAAK;IACLS,IAAI;IACJE,MAAM;IACND;EACF,CAAC;AACH,CAAC;AAACG,OAAA,CAAAlC,YAAA,GAAAA,YAAA","ignoreList":[]}
|
package/lib/commonjs/native.js
CHANGED
|
@@ -24,6 +24,7 @@ var NativeHandlers = exports.NativeHandlers = {
|
|
|
24
24
|
shareImage: fail,
|
|
25
25
|
Sound: undefined,
|
|
26
26
|
NativeShimmerView: undefined,
|
|
27
|
+
PerfText: undefined,
|
|
27
28
|
takePhoto: fail,
|
|
28
29
|
triggerHaptic: fail,
|
|
29
30
|
Video: undefined
|
|
@@ -80,6 +81,9 @@ var registerNativeHandlers = handlers => {
|
|
|
80
81
|
if (handlers.NativeShimmerView !== undefined) {
|
|
81
82
|
NativeHandlers.NativeShimmerView = handlers.NativeShimmerView;
|
|
82
83
|
}
|
|
84
|
+
if (handlers.PerfText !== undefined) {
|
|
85
|
+
NativeHandlers.PerfText = handlers.PerfText;
|
|
86
|
+
}
|
|
83
87
|
if (handlers.takePhoto !== undefined) {
|
|
84
88
|
NativeHandlers.takePhoto = handlers.takePhoto;
|
|
85
89
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_reactNative","require","fail","Error","NativeHandlers","exports","Audio","undefined","compressImage","deleteFile","FlatList","DefaultFlatList","getLocalAssetUri","getPhotos","iOS14RefreshGallerySelection","multipartUpload","oniOS14GalleryLibrarySelectionChange","pickDocument","pickImage","saveFile","SDK","setClipboardString","shareImage","Sound","NativeShimmerView","takePhoto","triggerHaptic","Video","registerNativeHandlers","handlers","overrideAudioRecordingConfiguration","audioRecordingConfiguration","isImagePickerAvailable","isDocumentPickerAvailable","isClipboardAvailable","isVideoPlayerAvailable","isHapticFeedbackAvailable","isShareImageAvailable","isFileSystemAvailable","isAudioRecorderAvailable","_NativeHandlers$Audio","startRecording","isSoundPackageAvailable","_NativeHandlers$Sound","_NativeHandlers$Sound2","Player","initializeSound","isImageMediaLibraryAvailable","isNativeMultipartUploadAvailable"],"sourceRoot":"../../src","sources":["native.ts"],"mappings":";;;;AACA,IAAAA,YAAA,GAAAC,OAAA;AA6BA,IAAMC,IAAI,GAAGA,CAAA,KAAM;EACjB,MAAMC,KAAK,CACT,mGACF,CAAC;AACH,CAAC;
|
|
1
|
+
{"version":3,"names":["_reactNative","require","fail","Error","NativeHandlers","exports","Audio","undefined","compressImage","deleteFile","FlatList","DefaultFlatList","getLocalAssetUri","getPhotos","iOS14RefreshGallerySelection","multipartUpload","oniOS14GalleryLibrarySelectionChange","pickDocument","pickImage","saveFile","SDK","setClipboardString","shareImage","Sound","NativeShimmerView","PerfText","takePhoto","triggerHaptic","Video","registerNativeHandlers","handlers","overrideAudioRecordingConfiguration","audioRecordingConfiguration","isImagePickerAvailable","isDocumentPickerAvailable","isClipboardAvailable","isVideoPlayerAvailable","isHapticFeedbackAvailable","isShareImageAvailable","isFileSystemAvailable","isAudioRecorderAvailable","_NativeHandlers$Audio","startRecording","isSoundPackageAvailable","_NativeHandlers$Sound","_NativeHandlers$Sound2","Player","initializeSound","isImageMediaLibraryAvailable","isNativeMultipartUploadAvailable"],"sourceRoot":"../../src","sources":["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7C,CAAC,CAACV,cAAc,CAACY,oCAAoC,IACrD,CAAC,CAACZ,cAAc,CAACQ,gBAAgB;AAACP,OAAA,CAAA2C,4BAAA,GAAAA,4BAAA;AAC7B,IAAMC,gCAAgC,GAAGA,CAAA,KAAM7C,cAAc,CAACW,eAAe,KAAKb,IAAI;AAACG,OAAA,CAAA4C,gCAAA,GAAAA,gCAAA","ignoreList":[]}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
Object.defineProperty(exports, "__esModule", {
|
|
2
|
+
value: true
|
|
3
|
+
});
|
|
4
|
+
exports.AITypingIndicatorView = void 0;
|
|
5
|
+
var _react = require("react");
|
|
6
|
+
var _reactNative = require("react-native");
|
|
7
|
+
var _contexts = require("./contexts");
|
|
8
|
+
var _NativeShimmerView = require("../components/UIComponents/NativeShimmerView");
|
|
9
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
10
|
+
var _jsxFileName = "/home/runner/work/stream-chat-react-native/stream-chat-react-native/package/src/ai-components/AITypingIndicatorView.tsx";
|
|
11
|
+
var AITypingIndicatorView = ({
|
|
12
|
+
text
|
|
13
|
+
}) => {
|
|
14
|
+
var _useTheme = (0, _contexts.useTheme)(),
|
|
15
|
+
shimmer = _useTheme.theme.colors.shimmer;
|
|
16
|
+
var styles = useStyles();
|
|
17
|
+
return (0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
18
|
+
style: styles.wrapper,
|
|
19
|
+
children: [(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
20
|
+
style: styles.text,
|
|
21
|
+
children: text
|
|
22
|
+
}), (0, _jsxRuntime.jsx)(_NativeShimmerView.NativeShimmerView, {
|
|
23
|
+
baseColor: 'transparent',
|
|
24
|
+
duration: 1200,
|
|
25
|
+
gradientColor: shimmer,
|
|
26
|
+
pointerEvents: "none",
|
|
27
|
+
style: [_reactNative.StyleSheet.absoluteFill, styles.shimmer]
|
|
28
|
+
})]
|
|
29
|
+
});
|
|
30
|
+
};
|
|
31
|
+
exports.AITypingIndicatorView = AITypingIndicatorView;
|
|
32
|
+
var useStyles = () => {
|
|
33
|
+
var _useTheme2 = (0, _contexts.useTheme)(),
|
|
34
|
+
theme = _useTheme2.theme;
|
|
35
|
+
return (0, _react.useMemo)(() => _reactNative.StyleSheet.create({
|
|
36
|
+
shimmer: {
|
|
37
|
+
opacity: 0.8
|
|
38
|
+
},
|
|
39
|
+
text: {
|
|
40
|
+
fontSize: 16,
|
|
41
|
+
color: theme.colors.grey_dark
|
|
42
|
+
},
|
|
43
|
+
wrapper: {
|
|
44
|
+
alignSelf: 'flex-start',
|
|
45
|
+
backgroundColor: 'transparent'
|
|
46
|
+
}
|
|
47
|
+
}), [theme]);
|
|
48
|
+
};
|
|
49
|
+
//# sourceMappingURL=AITypingIndicatorView.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_react","require","_reactNative","_contexts","_NativeShimmerView","_jsxRuntime","_jsxFileName","AITypingIndicatorView","text","_useTheme","useTheme","shimmer","theme","colors","styles","useStyles","jsxs","View","style","wrapper","children","jsx","Text","NativeShimmerView","baseColor","duration","gradientColor","pointerEvents","StyleSheet","absoluteFill","exports","_useTheme2","useMemo","create","opacity","fontSize","color","grey_dark","alignSelf","backgroundColor"],"sourceRoot":"../../../src","sources":["ai-components/AITypingIndicatorView.tsx"],"mappings":";;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAEA,IAAAE,SAAA,GAAAF,OAAA;AAEA,IAAAG,kBAAA,GAAAH,OAAA;AAAiF,IAAAI,WAAA,GAAAJ,OAAA;AAAA,IAAAK,YAAA;AAE1E,IAAMC,qBAAqB,GAAGA,CAAC;EAAEC;AAAuB,CAAC,KAAK;EACnE,IAAAC,SAAA,GAII,IAAAC,kBAAQ,EAAC,CAAC;IAFAC,OAAO,GAAAF,SAAA,CADnBG,KAAK,CACHC,MAAM,CAAIF,OAAO;EAGrB,IAAMG,MAAM,GAAGC,SAAS,CAAC,CAAC;EAI1B,OACE,IAAAV,WAAA,CAAAW,IAAA,EAACd,YAAA,CAAAe,IAAI;IAACC,KAAK,EAAEJ,MAAM,CAACK,OAAQ;IAAAC,QAAA,GAC1B,IAAAf,WAAA,CAAAgB,GAAA,EAACnB,YAAA,CAAAoB,IAAI;MAACJ,KAAK,EAAEJ,MAAM,CAACN,IAAK;MAAAY,QAAA,EAAEZ;IAAI,CAAO,CAAC,EACvC,IAAAH,WAAA,CAAAgB,GAAA,EAACjB,kBAAA,CAAAmB,iBAAiB;MAChBC,SAAS,EAAE,aAAc;MACzBC,QAAQ,EAAE,IAAK;MACfC,aAAa,EAAEf,OAAQ;MACvBgB,aAAa,EAAC,MAAM;MACpBT,KAAK,EAAE,CAACU,uBAAU,CAACC,YAAY,EAAEf,MAAM,CAACH,OAAO;IAAE,CAClD,CAAC;EAAA,CACE,CAAC;AAEX,CAAC;AAACmB,OAAA,CAAAvB,qBAAA,GAAAA,qBAAA;AAEF,IAAMQ,SAAS,GAAGA,CAAA,KAAM;EACtB,IAAAgB,UAAA,GAAkB,IAAArB,kBAAQ,EAAC,CAAC;IAApBE,KAAK,GAAAmB,UAAA,CAALnB,KAAK;EAEb,OAAO,IAAAoB,cAAO,EACZ,MACEJ,uBAAU,CAACK,MAAM,CAAC;IAEhBtB,OAAO,EAAE;MAAEuB,OAAO,EAAE;IAAI,CAAC;IACzB1B,IAAI,EAAE;MACJ2B,QAAQ,EAAE,EAAE;MACZC,KAAK,EAAExB,KAAK,CAACC,MAAM,CAACwB;IACtB,CAAC;IACDlB,OAAO,EAAE;MACPmB,SAAS,EAAE,YAAY;MACvBC,eAAe,EAAE;IACnB;EACF,CAAC,CAAC,EACJ,CAAC3B,KAAK,CACR,CAAC;AACH,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,279 @@
|
|
|
1
|
+
# AI components for Stream Chat React Native
|
|
2
|
+
|
|
3
|
+
`stream-chat-react-native/ai-components` (and `stream-chat-expo/ai-components`) contains Stream Chat's UI components for AI-first applications. Paired with the [Chat API](https://getstream.io/chat/), they render responses from LLM providers such as ChatGPT, Gemini, Anthropic or any custom backend: Markdown, code blocks with syntax highlighting, tables, charts, thinking indicators and more.
|
|
4
|
+
|
|
5
|
+
- `StreamingMessageView` - renders text, markdown and code in real time, using a ChatGPT-like typewriter animation
|
|
6
|
+
- `ComposerView` - a prompt composer with attachments and speech input
|
|
7
|
+
- `SpeechToTextButton` - records voice input and streams the recognized transcript into your UI
|
|
8
|
+
- `AITypingIndicatorView` - displays the state of the LLM (thinking, checking external sources, etc.)
|
|
9
|
+
|
|
10
|
+
The components live in their own entry point. Apps that never import `stream-chat-react-native/ai-components` do not bundle any of it, and apps that only use the AI components do not bundle the rest of the chat SDK.
|
|
11
|
+
|
|
12
|
+
## Migrating from `@stream-io/chat-react-native-ai`
|
|
13
|
+
|
|
14
|
+
These components used to ship as the standalone `@stream-io/chat-react-native-ai` package, which is now deprecated. Their API is unchanged; to migrate:
|
|
15
|
+
|
|
16
|
+
1. Uninstall `@stream-io/chat-react-native-ai` and import from `stream-chat-react-native/ai-components` (or `stream-chat-expo/ai-components`) instead:
|
|
17
|
+
|
|
18
|
+
```diff
|
|
19
|
+
- import { ComposerView, StreamingMessageView } from '@stream-io/chat-react-native-ai';
|
|
20
|
+
+ import { ComposerView, StreamingMessageView } from 'stream-chat-react-native/ai-components';
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
2. Dictation is now opt-in on iOS (see [Dictation](#dictation-speech-to-text)): add `$StreamChatEnableDictation = true` to your `Podfile`, or, with Expo, replace the `@stream-io/chat-react-native-ai` config plugin with `stream-chat-expo`.
|
|
24
|
+
3. Keep the `export-namespace-from` Babel plugin (see [Installation](#️-installation)); it is needed by the `zod` dependency.
|
|
25
|
+
4. `ShimmeringView` and `toHexFromRNColor` were removed. `AITypingIndicatorView` now uses the SDK's native shimmer, so `@shopify/react-native-skia` is only needed for charts.
|
|
26
|
+
5. `SpeechToTextButton` and `isDictationAvailable` are now exported.
|
|
27
|
+
|
|
28
|
+
## 🛠️ Installation
|
|
29
|
+
|
|
30
|
+
The AI components ship with `stream-chat-react-native` and `stream-chat-expo`; their JavaScript dependencies are installed with them. Charts additionally need the following peer dependencies, which only apps using the AI components have to install:
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
yarn add victory-native @shopify/react-native-skia
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
`react-native-reanimated`, `react-native-gesture-handler` and `react-native-svg` are already required by the chat SDK.
|
|
37
|
+
|
|
38
|
+
The `zod` dependency ships `export * as` syntax, which the React Native Babel preset does not transform, so add the `export-namespace-from` plugin to your `babel.config.js`:
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
yarn add -D @babel/plugin-transform-export-namespace-from
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
```js
|
|
45
|
+
module.exports = {
|
|
46
|
+
presets: ['module:@react-native/babel-preset'],
|
|
47
|
+
plugins: [
|
|
48
|
+
// ... rest of your @babel plugins
|
|
49
|
+
'@babel/plugin-transform-export-namespace-from',
|
|
50
|
+
// react-native-worklets/plugin has to be the last one
|
|
51
|
+
'react-native-worklets/plugin',
|
|
52
|
+
],
|
|
53
|
+
};
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
Apps that do not import the AI components do not bundle `zod` and do not need the plugin.
|
|
57
|
+
|
|
58
|
+
### Dictation (speech-to-text)
|
|
59
|
+
|
|
60
|
+
The speech-to-text button uses the platform speech recognizers.
|
|
61
|
+
|
|
62
|
+
#### `iOS`
|
|
63
|
+
|
|
64
|
+
Because App Store Connect requires a speech recognition usage description from every app whose binary references the Speech framework, the dictation module is only compiled into apps that opt in. Add this to your `Podfile`, before `use_native_modules!`, and run `pod install`:
|
|
65
|
+
|
|
66
|
+
```ruby
|
|
67
|
+
$StreamChatEnableDictation = true
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
(`STREAM_CHAT_ENABLE_DICTATION=1 pod install` works as well.) Then add the usage descriptions to your `Info.plist`:
|
|
71
|
+
|
|
72
|
+
```txt
|
|
73
|
+
<key>NSMicrophoneUsageDescription</key>
|
|
74
|
+
<string>$(PRODUCT_NAME) would like to access your microphone to capture your voice.</string>
|
|
75
|
+
<key>NSSpeechRecognitionUsageDescription</key>
|
|
76
|
+
<string>$(PRODUCT_NAME) would like to access speech recognition to transcribe your voice.</string>
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
The text you pick for the capabilities is up to you. Without the opt-in the speech-to-text button is hidden, and a development-only warning explains how to enable it.
|
|
80
|
+
|
|
81
|
+
#### `Android`
|
|
82
|
+
|
|
83
|
+
Add the permission to `android/app/src/main/AndroidManifest.xml`:
|
|
84
|
+
|
|
85
|
+
```xml
|
|
86
|
+
<uses-permission android:name="android.permission.RECORD_AUDIO" />
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
#### `Expo`
|
|
90
|
+
|
|
91
|
+
Add the `stream-chat-expo` config plugin to your `app.json`/`app.config.[js|ts]`. It enables the dictation module and adds the permissions (with default descriptions unless you provide your own):
|
|
92
|
+
|
|
93
|
+
```json
|
|
94
|
+
"plugins": [
|
|
95
|
+
// ... rest of your plugins
|
|
96
|
+
[
|
|
97
|
+
"stream-chat-expo",
|
|
98
|
+
{
|
|
99
|
+
"dictationMicrophoneUsageDescription": "$(PRODUCT_NAME) would like to access your microphone to capture your voice.",
|
|
100
|
+
"dictationSpeechRecognitionUsageDescription": "$(PRODUCT_NAME) would like to access speech recognition to transcribe your voice."
|
|
101
|
+
}
|
|
102
|
+
]
|
|
103
|
+
],
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
Pass `"enableDictation": false` to leave dictation out.
|
|
107
|
+
|
|
108
|
+
## Optional features
|
|
109
|
+
|
|
110
|
+
### Media Picker
|
|
111
|
+
|
|
112
|
+
The media picker of the `ComposerView` picks existing images and takes photos with the camera. It works with whichever of these libraries you have installed:
|
|
113
|
+
|
|
114
|
+
- `react-native-image-picker` (React Native CLI). For the camera, add `NSCameraUsageDescription` to your `Info.plist` and the `android.permission.CAMERA` permission to your `AndroidManifest.xml`.
|
|
115
|
+
- `expo-image-picker` (Expo). See the [Expo documentation](https://docs.expo.dev/versions/latest/sdk/imagepicker/) for its permissions.
|
|
116
|
+
|
|
117
|
+
### Clipboard
|
|
118
|
+
|
|
119
|
+
The copy button of code blocks works with whichever of these libraries you have installed:
|
|
120
|
+
|
|
121
|
+
- `@react-native-clipboard/clipboard` (React Native CLI)
|
|
122
|
+
- `expo-clipboard` (Expo)
|
|
123
|
+
|
|
124
|
+
### Syntax highlighting on Android
|
|
125
|
+
|
|
126
|
+
On Android with the New Architecture, highlighted code is rendered by a native `PerfText` view: a single text view with colour spans instead of one `Text` per token, which keeps long code blocks cheap to render and scroll. Elsewhere, code is rendered with nested `Text`.
|
|
127
|
+
|
|
128
|
+
## ⚙️ Usage
|
|
129
|
+
|
|
130
|
+
All of the components listed below are designed to work seamlessly with our existing React Native [Chat SDK](https://getstream.io/chat/react-native-chat/tutorial/). Our [developer guide](https://getstream.io/chat/solutions/ai-integration/) explains how to get started building AI integrations with Stream.
|
|
131
|
+
|
|
132
|
+
In order to use them, they have to be wrapped within our `StreamTheme` provider that will make sure theming is applied to them. It is recommended that you put the provider somewhere high up in the component tree so that it encapsulates all components used downstream.
|
|
133
|
+
|
|
134
|
+
### `StreamingMessageView`
|
|
135
|
+
|
|
136
|
+
The `StreamingMessageView` is a component that can render markdown content efficiently. It has code syntax highlighting, supporting all the major languages. It can render most of the standard markdown content, such as tables, inline code, headings, lists etc.
|
|
137
|
+
|
|
138
|
+
Under the hood, it implements a letter-by-letter typewriter animation with a character queue, similar to ChatGPT.
|
|
139
|
+
|
|
140
|
+
| Name | Type | Required | Description |
|
|
141
|
+
| ------------------------ | -------------------------------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
142
|
+
| `text` | `string` | yes | The text we want to pass as markdown. |
|
|
143
|
+
| `paragraphNumberOfLines` | `number` | no | The `numberOfLines` applied to markdown `Paragraph` and `Text` components. Particularly useful if we want to display the same message, but in a "cut" fashion (for example when replying to someone). |
|
|
144
|
+
| `rules` | [`MarkdownRules`](./markdown/types.ts) | no | An object of `MarkdownRules` that is then going to be deeply merged with our default rules, based on the [`SimpleMarkdown` parsing engine](https://github.com/Khan/perseus/tree/main/packages/simple-markdown#adding-a-simple-extension). Can be used to add custom rules or change existing rules. You can disable a rule by passing `{ [ruleName]: { match: () => null }}`. |
|
|
145
|
+
| `onLink` | `(url: string) => void` | no | A function that is going to be invoked whenever a link is pressed within markdown parsed text. |
|
|
146
|
+
| `letterInterval` | `number` | no | A number signifying the interval at which the typewriter animation is going to render characters. Defaults to `0` |
|
|
147
|
+
| `renderingLetterCount` | `number` | no | A number signifying the number of letters that are going to be rendered per tick of the interval during the typewriter animation. Defaults to `2` |
|
|
148
|
+
|
|
149
|
+
#### Example
|
|
150
|
+
|
|
151
|
+
Provided below is an example of how to use the component.
|
|
152
|
+
|
|
153
|
+
````tsx
|
|
154
|
+
const markdownText = ```
|
|
155
|
+
# Heading
|
|
156
|
+
|
|
157
|
+
some text
|
|
158
|
+
|
|
159
|
+
## Another heading
|
|
160
|
+
```;
|
|
161
|
+
|
|
162
|
+
<StreamingMessageView
|
|
163
|
+
text={markdownText}
|
|
164
|
+
letterInterval={5} // every 5ms
|
|
165
|
+
renderingLetterCount={3} // render 3 letters at a time
|
|
166
|
+
/>;
|
|
167
|
+
````
|
|
168
|
+
|
|
169
|
+
### `AITypingIndicatorView`
|
|
170
|
+
|
|
171
|
+
The `AITypingIndicatorView` is used to represent different states of the LLM, such as `Thinking`, `Checking External Sources` and so on, depending on the states you've defined on your backend. The only thing that needs to be passed to the component is the `text` property, which will then be displayed with a shimmering animation.
|
|
172
|
+
|
|
173
|
+
| Name | Type | Required | Description |
|
|
174
|
+
| ------ | -------- | -------- | ---------------------------------------------------- |
|
|
175
|
+
| `text` | `string` | yes | The text we want to be displayed inside of the view. |
|
|
176
|
+
|
|
177
|
+
#### Example
|
|
178
|
+
|
|
179
|
+
```tsx
|
|
180
|
+
<AITypingIndivacorView text={'Thinking of an answer...'} />
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
### `ComposerView`
|
|
184
|
+
|
|
185
|
+
The `ComposerView` gives users a modern text entry surface with attachment previews, actionable bottom sheet, speech-to-text button and an integrated send button.
|
|
186
|
+
|
|
187
|
+
| Name | Type | Required | Description |
|
|
188
|
+
| -------------------- | ------------------------------------------------------------------------------------------------------------------------ | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
189
|
+
| `onSendMessage` | `(opts: { text: string; attachments?: MediaPickerState['assets']; custom?: Record<string, unknown>; }) => Promise<void>` | yes | A callback that will be invoked whenever the send button is pressed. The `text`, `attachments` and any `custom` data we've added to the state will be passed to it. |
|
|
190
|
+
| `bottomSheetOptions` | [`BottomSheetOption[]`](./message-composer/ComposerView.tsx) | no | An array of [`BottomSheetOption`](./message-composer/ComposerView.tsx) objects that will render the extra options in the bottom sheet. |
|
|
191
|
+
| `bottomSheetInsets` | `{ top: number; bottom: number; left: number; right: number }` | no | An object containing extra insets we can pass to the `ComposerView` in order to make sure the bottom sheet can extend properly beyond them. |
|
|
192
|
+
| `isGenerating` | `boolean` | no | A boolean signifying whether the LLM is currently generating a response or not. It will be used to render the stop-generating button in the composer instead of the send button whenever this happens. |
|
|
193
|
+
| `stopGenerating` | `() => Promise<void>` | no | A callback that is going to be invoked if the stop-generating button is clicked. |
|
|
194
|
+
| `mediaPickerService` | `AbstractMediaPickerService` | no | An instance of the `MediaPickerService` we may decide to inject from the outside for more fine-grained control over attachment state. You can create an instance as `const customInstance = MediaPickerService()` and it will automatically detect which library you're using. |
|
|
195
|
+
| `state` | `StateStore<ComposerState>` | no | A state store of the `ComposerState` we may decide to inject from the outside for more fine-grained control over the composer state. You can create an instance as `const customComposerState = createNewComposerStore()`. |
|
|
196
|
+
|
|
197
|
+
#### Example
|
|
198
|
+
|
|
199
|
+
```tsx
|
|
200
|
+
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
201
|
+
|
|
202
|
+
const options = [
|
|
203
|
+
{
|
|
204
|
+
title: 'Create Image',
|
|
205
|
+
subtitle: 'Visualize anything',
|
|
206
|
+
action: () => Alert.alert('Pressed on Create Image !'),
|
|
207
|
+
Icon: DownloadArrow,
|
|
208
|
+
},
|
|
209
|
+
{
|
|
210
|
+
title: 'Thinking',
|
|
211
|
+
subtitle: 'Think longer for better answers',
|
|
212
|
+
action: () => Alert.alert('Pressed on Thinking !'),
|
|
213
|
+
Icon: Flag,
|
|
214
|
+
},
|
|
215
|
+
];
|
|
216
|
+
|
|
217
|
+
const insets = useSafeAreaInsets();
|
|
218
|
+
|
|
219
|
+
<ComposerView onSendMessage={sendMessage} bottomSheetOptions={bottomSheetOptions} bottomSheetInsets={insets} />;
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
### `SpeechToTextButton`
|
|
223
|
+
|
|
224
|
+
The `SpeechToTextButton` turns voice input into text using native implementations of the iOS and Android speech frameworks, respectively. When tapped it asks for microphone access, records audio and forwards the recognized transcript to the `ComposerState` directly.
|
|
225
|
+
|
|
226
|
+
It uses the `useDictation` hook under the hood, which can also be used without the button as well for voice transcription purposes outside of the button.
|
|
227
|
+
|
|
228
|
+
It takes a single property named `options` that has the following keys:
|
|
229
|
+
|
|
230
|
+
| Name | Type | Required | Description |
|
|
231
|
+
| ------------------ | --------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
232
|
+
| `language` | `string` | no | The language we want to transcribe from. It will default to `en-US`. |
|
|
233
|
+
| `interimResults` | `boolean` | no | A boolean signifying whether we want to receive the intermediate results from the transcription or just the final result when the transcription is deemed done. Defaults to `true` |
|
|
234
|
+
| `silenceTimeoutMs` | `number` | no | A number signifying the number of milliseconds of silence until transcription is deemed finished. Defaults to `2500`. |
|
|
235
|
+
|
|
236
|
+
```tsx
|
|
237
|
+
const options = {
|
|
238
|
+
language: 'de-DE', // set the language to german
|
|
239
|
+
interimResults: false, // disable intermediate results and only use the final results
|
|
240
|
+
silenceTimeoutMs: 3500 // set the silence timeout to 3.5 seconds
|
|
241
|
+
}
|
|
242
|
+
<SpeechToTextButton options={options} />
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
The `SpeechToTextButton` is already integrated within the `ComposerView`, however feel free to use it elsewhere as well. It renders nothing when dictation is not part of the build (see [Dictation](#dictation-speech-to-text)); `isDictationAvailable()` tells you whether it is.
|
|
246
|
+
|
|
247
|
+
### Theming
|
|
248
|
+
|
|
249
|
+
Each one of the components in the SDK is fully theme-compatible. The `StreamTheme` provider takes care of this for you.
|
|
250
|
+
|
|
251
|
+
In order to modify the theme, you may refer to our full fledged theme object [as seen here](./theme.ts).
|
|
252
|
+
|
|
253
|
+
#### Example
|
|
254
|
+
|
|
255
|
+
In the example below, we introduce a dark color scheme through the theming system.
|
|
256
|
+
|
|
257
|
+
```tsx
|
|
258
|
+
const customTheme = {
|
|
259
|
+
colors: colorScheme === 'dark'
|
|
260
|
+
? {
|
|
261
|
+
accent_blue: '#4C9DFF',
|
|
262
|
+
accent_red: '#FF636E',
|
|
263
|
+
black: '#FFFFFF',
|
|
264
|
+
code_block: '#1E1E22',
|
|
265
|
+
grey: '#A1A1AA',
|
|
266
|
+
grey_neutral: '#C5C5C8',
|
|
267
|
+
grey_dark: '#71717A',
|
|
268
|
+
grey_gainsboro: '#3F3F46',
|
|
269
|
+
grey_whisper: '#27272F',
|
|
270
|
+
overlay: '#000000CC',
|
|
271
|
+
transparent: 'transparent',
|
|
272
|
+
white: '#050509',
|
|
273
|
+
white_smoke: '#121214',
|
|
274
|
+
shimmer: '#FFFFFF',
|
|
275
|
+
} : {}
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
<StreamTheme style={customTheme}>{children}</StreamTheme>
|
|
279
|
+
```
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
exports.useStreamingMessage = exports.StreamingMessageView = void 0;
|
|
6
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
7
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
+
var _reactNative = require("react-native");
|
|
9
|
+
var _useStableCallback = require("./internal/hooks/useStableCallback");
|
|
10
|
+
var _markdown = require("./markdown");
|
|
11
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
12
|
+
var _jsxFileName = "/home/runner/work/stream-chat-react-native/stream-chat-react-native/package/src/ai-components/StreamingMessageView.tsx";
|
|
13
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
14
|
+
var useStreamingMessage = ({
|
|
15
|
+
letterInterval = 0,
|
|
16
|
+
renderingLetterCount = 2,
|
|
17
|
+
text
|
|
18
|
+
}) => {
|
|
19
|
+
var _useState = (0, _react.useState)(text),
|
|
20
|
+
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
21
|
+
streamedMessageText = _useState2[0],
|
|
22
|
+
setStreamedMessageText = _useState2[1];
|
|
23
|
+
var textCursor = (0, _react.useRef)(text.length);
|
|
24
|
+
(0, _react.useEffect)(() => {
|
|
25
|
+
var textLength = text.length;
|
|
26
|
+
var interval = setInterval(() => {
|
|
27
|
+
if (!text || textCursor.current >= textLength) {
|
|
28
|
+
clearInterval(interval);
|
|
29
|
+
}
|
|
30
|
+
var newCursorValue = textCursor.current + renderingLetterCount;
|
|
31
|
+
var newText = text.substring(0, newCursorValue);
|
|
32
|
+
textCursor.current += newText.length - textCursor.current;
|
|
33
|
+
var codeBlockCounts = (newText.match(/```/g) || []).length;
|
|
34
|
+
var shouldOptimisticallyCloseCodeBlock = codeBlockCounts > 0 && codeBlockCounts % 2 > 0;
|
|
35
|
+
setStreamedMessageText(shouldOptimisticallyCloseCodeBlock ? newText + '```' : newText);
|
|
36
|
+
}, letterInterval);
|
|
37
|
+
return () => {
|
|
38
|
+
clearInterval(interval);
|
|
39
|
+
};
|
|
40
|
+
}, [letterInterval, renderingLetterCount, text]);
|
|
41
|
+
return {
|
|
42
|
+
streamedMessageText
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
exports.useStreamingMessage = useStreamingMessage;
|
|
46
|
+
var StreamingMessageView = ({
|
|
47
|
+
text,
|
|
48
|
+
paragraphNumberOfLines,
|
|
49
|
+
rules,
|
|
50
|
+
onLink: onLinkParam,
|
|
51
|
+
letterInterval,
|
|
52
|
+
renderingLetterCount
|
|
53
|
+
}) => {
|
|
54
|
+
var markdownText = (0, _react.useMemo)(() => (0, _markdown.generateMarkdownText)(text), [text]);
|
|
55
|
+
var _useStreamingMessage = useStreamingMessage({
|
|
56
|
+
text: markdownText != null ? markdownText : '',
|
|
57
|
+
letterInterval,
|
|
58
|
+
renderingLetterCount
|
|
59
|
+
}),
|
|
60
|
+
streamedMessageText = _useStreamingMessage.streamedMessageText;
|
|
61
|
+
var onLink = (0, _useStableCallback.useStableCallback)(url => onLinkParam ? onLinkParam(url) : _reactNative.Linking.canOpenURL(url).then(canOpenUrl => {
|
|
62
|
+
if (canOpenUrl) {
|
|
63
|
+
return _reactNative.Linking.openURL(url);
|
|
64
|
+
}
|
|
65
|
+
return undefined;
|
|
66
|
+
}));
|
|
67
|
+
return (0, _jsxRuntime.jsx)(_markdown.Markdown, {
|
|
68
|
+
rules: rules,
|
|
69
|
+
onLink: onLink,
|
|
70
|
+
paragraphNumberOfLines: paragraphNumberOfLines,
|
|
71
|
+
children: streamedMessageText
|
|
72
|
+
});
|
|
73
|
+
};
|
|
74
|
+
exports.StreamingMessageView = StreamingMessageView;
|
|
75
|
+
//# sourceMappingURL=StreamingMessageView.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_useStableCallback","_markdown","_jsxRuntime","_jsxFileName","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","_t","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","useStreamingMessage","letterInterval","renderingLetterCount","text","_useState","useState","_useState2","_slicedToArray2","streamedMessageText","setStreamedMessageText","textCursor","useRef","length","useEffect","textLength","interval","setInterval","current","clearInterval","newCursorValue","newText","substring","codeBlockCounts","match","shouldOptimisticallyCloseCodeBlock","exports","StreamingMessageView","paragraphNumberOfLines","rules","onLink","onLinkParam","markdownText","useMemo","generateMarkdownText","_useStreamingMessage","useStableCallback","url","Linking","canOpenURL","then","canOpenUrl","openURL","undefined","jsx","Markdown","children"],"sourceRoot":"../../../src","sources":["ai-components/StreamingMessageView.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAEA,IAAAC,YAAA,GAAAD,OAAA;AAEA,IAAAE,kBAAA,GAAAF,OAAA;AACA,IAAAG,SAAA,GAAAH,OAAA;AAAkD,IAAAI,WAAA,GAAAJ,OAAA;AAAA,IAAAK,YAAA;AAAA,SAAAN,wBAAAO,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAT,uBAAA,YAAAA,CAAAO,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,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JMM,mBAAmB,GAAA0B,oBAAA,CAAnB1B,mBAAmB;EAM3B,IAAMqB,MAAM,GAAG,IAAAM,oCAAiB,EAAEC,GAAW,IAC3CN,WAAW,GACPA,WAAW,CAACM,GAAG,CAAC,GAChBC,oBAAO,CAACC,UAAU,CAACF,GAAG,CAAC,CAACG,IAAI,CAAEC,UAAU,IAAK;IAC3C,IAAIA,UAAU,EAAE;MACd,OAAOH,oBAAO,CAACI,OAAO,CAACL,GAAG,CAAC;IAC7B;IACA,OAAOM,SAAS;EAClB,CAAC,CACP,CAAC;EAED,OACE,IAAAhE,WAAA,CAAAiE,GAAA,EAAClE,SAAA,CAAAmE,QAAQ;IAAChB,KAAK,EAAEA,KAAM;IAACC,MAAM,EAAEA,MAAO;IAACF,sBAAsB,EAAEA,sBAAuB;IAAAkB,QAAA,EACpFrC;EAAmB,CACZ,CAAC;AAEf,CAAC;AAACiB,OAAA,CAAAC,oBAAA,GAAAA,oBAAA","ignoreList":[]}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
exports.default = void 0;
|
|
6
|
+
var _react = _interopRequireDefault(require("react"));
|
|
7
|
+
var _components = require("./components");
|
|
8
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
9
|
+
var _jsxFileName = "/home/runner/work/stream-chat-react-native/stream-chat-react-native/package/src/ai-components/charts/Chart.tsx";
|
|
10
|
+
var Chart = ({
|
|
11
|
+
spec,
|
|
12
|
+
height = 260,
|
|
13
|
+
width
|
|
14
|
+
}) => {
|
|
15
|
+
if (!spec) {
|
|
16
|
+
return null;
|
|
17
|
+
}
|
|
18
|
+
return (0, _jsxRuntime.jsx)(_components.VictoryChart, {
|
|
19
|
+
spec: spec,
|
|
20
|
+
width: width,
|
|
21
|
+
height: height
|
|
22
|
+
});
|
|
23
|
+
};
|
|
24
|
+
var _default = exports.default = Chart;
|
|
25
|
+
//# sourceMappingURL=Chart.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireDefault","require","_components","_jsxRuntime","_jsxFileName","Chart","spec","height","width","jsx","VictoryChart","_default","exports","default"],"sourceRoot":"../../../../src","sources":["ai-components/charts/Chart.tsx"],"mappings":";;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,IAAAC,WAAA,GAAAD,OAAA;AAA4C,IAAAE,WAAA,GAAAF,OAAA;AAAA,IAAAG,YAAA;AAS5C,IAAMC,KAAK,GAAGA,CAAC;EAAEC,IAAI;EAAEC,MAAM,GAAG,GAAG;EAAEC;AAA2B,CAAC,KAAK;EACpE,IAAI,CAACF,IAAI,EAAE;IACT,OAAO,IAAI;EACb;EAEA,OAAO,IAAAH,WAAA,CAAAM,GAAA,EAACP,WAAA,CAAAQ,YAAY;IAACJ,IAAI,EAAEA,IAAK;IAACE,KAAK,EAAEA,KAAM;IAACD,MAAM,EAAEA;EAAO,CAAE,CAAC;AACnE,CAAC;AAAC,IAAAI,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEaR,KAAK","ignoreList":[]}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
exports.PieLegend = void 0;
|
|
6
|
+
var _react = _interopRequireDefault(require("react"));
|
|
7
|
+
var _reactNative = require("react-native");
|
|
8
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
9
|
+
var _jsxFileName = "/home/runner/work/stream-chat-react-native/stream-chat-react-native/package/src/ai-components/charts/components/PieLegend.tsx";
|
|
10
|
+
var PieLegend = ({
|
|
11
|
+
items,
|
|
12
|
+
maxRows = 3
|
|
13
|
+
}) => {
|
|
14
|
+
return (0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
15
|
+
style: styles.container,
|
|
16
|
+
children: items.slice(0, maxRows * 4).map((item, i) => (0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
17
|
+
style: styles.item,
|
|
18
|
+
children: [(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
19
|
+
style: [styles.swatch, {
|
|
20
|
+
backgroundColor: item.color
|
|
21
|
+
}]
|
|
22
|
+
}), (0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
23
|
+
numberOfLines: 1,
|
|
24
|
+
style: styles.label,
|
|
25
|
+
children: item.dimension
|
|
26
|
+
})]
|
|
27
|
+
}, `${item.dimension}-${i}`))
|
|
28
|
+
});
|
|
29
|
+
};
|
|
30
|
+
exports.PieLegend = PieLegend;
|
|
31
|
+
var styles = _reactNative.StyleSheet.create({
|
|
32
|
+
container: {
|
|
33
|
+
marginTop: 8,
|
|
34
|
+
flexDirection: 'row',
|
|
35
|
+
justifyContent: 'center',
|
|
36
|
+
flexWrap: 'wrap',
|
|
37
|
+
gap: 10
|
|
38
|
+
},
|
|
39
|
+
item: {
|
|
40
|
+
flexDirection: 'row',
|
|
41
|
+
alignItems: 'center',
|
|
42
|
+
gap: 6,
|
|
43
|
+
maxWidth: '48%'
|
|
44
|
+
},
|
|
45
|
+
swatch: {
|
|
46
|
+
borderRadius: 2,
|
|
47
|
+
width: 12,
|
|
48
|
+
height: 12
|
|
49
|
+
},
|
|
50
|
+
label: {
|
|
51
|
+
fontSize: 13
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
//# sourceMappingURL=PieLegend.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireDefault","require","_reactNative","_jsxRuntime","_jsxFileName","PieLegend","items","maxRows","jsx","View","style","styles","container","children","slice","map","item","i","jsxs","swatch","backgroundColor","color","Text","numberOfLines","label","dimension","exports","StyleSheet","create","marginTop","flexDirection","justifyContent","flexWrap","gap","alignItems","maxWidth","borderRadius","width","height","fontSize"],"sourceRoot":"../../../../../src","sources":["ai-components/charts/components/PieLegend.tsx"],"mappings":";;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAAsD,IAAAE,WAAA,GAAAF,OAAA;AAAA,IAAAG,YAAA;AAI/C,IAAMC,SAAS,GAAGA,CAAC;EAAEC,KAAK;EAAEC,OAAO,GAAG;AAAwC,CAAC,KAAK;EACzF,OACE,IAAAJ,WAAA,CAAAK,GAAA,EAACN,YAAA,CAAAO,IAAI;IAACC,KAAK,EAAEC,MAAM,CAACC,SAAU;IAAAC,QAAA,EAC3BP,KAAK,CAACQ,KAAK,CAAC,CAAC,EAAEP,OAAO,GAAG,CAAC,CAAC,CAACQ,GAAG,CAAC,CAACC,IAAI,EAAEC,CAAC,KACvC,IAAAd,WAAA,CAAAe,IAAA,EAAChB,YAAA,CAAAO,IAAI;MAAgCC,KAAK,EAAEC,MAAM,CAACK,IAAK;MAAAH,QAAA,GACtD,IAAAV,WAAA,CAAAK,GAAA,EAACN,YAAA,CAAAO,IAAI;QACHC,KAAK,EAAE,CACLC,MAAM,CAACQ,MAAM,EACb;UACEC,eAAe,EAAEJ,IAAI,CAACK;QACxB,CAAC;MACD,CACH,CAAC,EACF,IAAAlB,WAAA,CAAAK,GAAA,EAACN,YAAA,CAAAoB,IAAI;QAACC,aAAa,EAAE,CAAE;QAACb,KAAK,EAAEC,MAAM,CAACa,KAAM;QAAAX,QAAA,EACzCG,IAAI,CAACS;MAAS,CACX,CAAC;IAAA,GAXE,GAAGT,IAAI,CAACS,SAAS,IAAIR,CAAC,EAY3B,CACP;EAAC,CACE,CAAC;AAEX,CAAC;AAACS,OAAA,CAAArB,SAAA,GAAAA,SAAA;AAEF,IAAMM,MAAM,GAAGgB,uBAAU,CAACC,MAAM,CAAC;EAC/BhB,SAAS,EAAE;IACTiB,SAAS,EAAE,CAAC;IACZC,aAAa,EAAE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