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,113 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Image, Text } from 'react-native';
|
|
3
|
+
|
|
4
|
+
import { act, fireEvent, render, screen, waitFor } from '@testing-library/react-native';
|
|
5
|
+
|
|
6
|
+
import {
|
|
7
|
+
ComposerView,
|
|
8
|
+
type ComposerViewProps,
|
|
9
|
+
sheetStore,
|
|
10
|
+
sheetStoreApi,
|
|
11
|
+
StreamTheme,
|
|
12
|
+
} from '../index';
|
|
13
|
+
import {
|
|
14
|
+
AbstractMediaPickerService,
|
|
15
|
+
type MediaAsset,
|
|
16
|
+
} from '../services/media-picker-service/AbstractMediaPickerService';
|
|
17
|
+
|
|
18
|
+
const flushPromises = () => new Promise<void>((resolve) => setTimeout(resolve, 0));
|
|
19
|
+
|
|
20
|
+
class FakeMediaPickerService extends AbstractMediaPickerService {
|
|
21
|
+
pickMedia = jest.fn(() => {
|
|
22
|
+
const assets: MediaAsset[] = [{ name: 'a.png', uri: 'file:///a.png' }];
|
|
23
|
+
this.appendAssets(assets);
|
|
24
|
+
return Promise.resolve({ assets, cancelled: false });
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
takeMedia = jest.fn(() => Promise.resolve({ cancelled: true }));
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
const renderComposer = (props: Partial<ComposerViewProps> = {}) => {
|
|
31
|
+
const onSendMessage = jest.fn(() => Promise.resolve());
|
|
32
|
+
const utils = render(
|
|
33
|
+
<StreamTheme>
|
|
34
|
+
<ComposerView onSendMessage={onSendMessage} {...props} />
|
|
35
|
+
</StreamTheme>,
|
|
36
|
+
);
|
|
37
|
+
return { ...utils, onSendMessage };
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
describe('ai-components ComposerView', () => {
|
|
41
|
+
afterEach(() => {
|
|
42
|
+
act(() => {
|
|
43
|
+
sheetStoreApi.closeSheet();
|
|
44
|
+
});
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
it('sends the typed text and clears the input', async () => {
|
|
48
|
+
const { onSendMessage } = renderComposer();
|
|
49
|
+
|
|
50
|
+
fireEvent.changeText(screen.getByPlaceholderText('Ask anything'), 'Hello there');
|
|
51
|
+
await act(async () => {
|
|
52
|
+
fireEvent.press(screen.getByTestId('send-up'));
|
|
53
|
+
await flushPromises();
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
expect(onSendMessage).toHaveBeenCalledWith(expect.objectContaining({ text: 'Hello there' }));
|
|
57
|
+
expect(screen.getByPlaceholderText('Ask anything').props.value).toBe('');
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
it('shows the stop button while generating', () => {
|
|
61
|
+
const stopGenerating = jest.fn(() => Promise.resolve());
|
|
62
|
+
renderComposer({ isGenerating: true, stopGenerating });
|
|
63
|
+
|
|
64
|
+
fireEvent.changeText(screen.getByPlaceholderText('Ask anything'), 'Hello');
|
|
65
|
+
expect(screen.queryByTestId('send-up')).toBeNull();
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
it('opens the attachment sheet, picks media and sends it along', async () => {
|
|
69
|
+
const mediaPickerService = new FakeMediaPickerService();
|
|
70
|
+
const action = jest.fn();
|
|
71
|
+
const { onSendMessage } = renderComposer({
|
|
72
|
+
bottomSheetOptions: [{ action, subtitle: 'Do it', title: 'Custom option' }],
|
|
73
|
+
mediaPickerService,
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
fireEvent.press(screen.getByText('+'));
|
|
77
|
+
expect(sheetStore.getLatestValue().open).toBe(true);
|
|
78
|
+
expect(screen.getByText('Camera')).toBeTruthy();
|
|
79
|
+
expect(screen.getByText('Custom option')).toBeTruthy();
|
|
80
|
+
|
|
81
|
+
await act(async () => {
|
|
82
|
+
fireEvent.press(screen.getByText('Photos'));
|
|
83
|
+
await flushPromises();
|
|
84
|
+
});
|
|
85
|
+
expect(mediaPickerService.pickMedia).toHaveBeenCalled();
|
|
86
|
+
expect(sheetStore.getLatestValue().open).toBe(false);
|
|
87
|
+
await waitFor(() => expect(screen.UNSAFE_getAllByType(Image)).toHaveLength(1));
|
|
88
|
+
|
|
89
|
+
act(() => {
|
|
90
|
+
sheetStoreApi.openSheet();
|
|
91
|
+
});
|
|
92
|
+
await act(async () => {
|
|
93
|
+
fireEvent.press(screen.getByText('Custom option'));
|
|
94
|
+
await flushPromises();
|
|
95
|
+
});
|
|
96
|
+
expect(action).toHaveBeenCalled();
|
|
97
|
+
|
|
98
|
+
fireEvent.changeText(screen.getByPlaceholderText('Ask anything'), 'With an image');
|
|
99
|
+
await act(async () => {
|
|
100
|
+
fireEvent.press(screen.getByTestId('send-up'));
|
|
101
|
+
await flushPromises();
|
|
102
|
+
});
|
|
103
|
+
expect(onSendMessage).toHaveBeenCalledWith({
|
|
104
|
+
attachments: [{ name: 'a.png', uri: 'file:///a.png' }],
|
|
105
|
+
custom: undefined,
|
|
106
|
+
text: 'With an image',
|
|
107
|
+
});
|
|
108
|
+
expect(mediaPickerService.state.getLatestValue().assets).toEqual([]);
|
|
109
|
+
expect(
|
|
110
|
+
screen.UNSAFE_queryAllByType(Text).some((t) => t.props.children === 'With an image'),
|
|
111
|
+
).toBe(false);
|
|
112
|
+
});
|
|
113
|
+
});
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
import { fireEvent, render, screen } from '@testing-library/react-native';
|
|
4
|
+
|
|
5
|
+
import { Markdown, mergeThemes, StreamTheme } from '../index';
|
|
6
|
+
|
|
7
|
+
const mockSetString = jest.fn();
|
|
8
|
+
jest.mock(
|
|
9
|
+
'@react-native-clipboard/clipboard',
|
|
10
|
+
() => ({ __esModule: true, default: { setString: (text: string) => mockSetString(text) } }),
|
|
11
|
+
{ virtual: true },
|
|
12
|
+
);
|
|
13
|
+
|
|
14
|
+
const renderMarkdown = (text: string, props: Partial<React.ComponentProps<typeof Markdown>> = {}) =>
|
|
15
|
+
render(
|
|
16
|
+
<StreamTheme>
|
|
17
|
+
<Markdown {...props}>{text}</Markdown>
|
|
18
|
+
</StreamTheme>,
|
|
19
|
+
);
|
|
20
|
+
|
|
21
|
+
describe('ai-components Markdown', () => {
|
|
22
|
+
beforeEach(() => {
|
|
23
|
+
mockSetString.mockClear();
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
it('renders headings, emphasis, lists and links', () => {
|
|
27
|
+
const onLink = jest.fn();
|
|
28
|
+
renderMarkdown(
|
|
29
|
+
'# Title\n\nSome **bold** and *italic* and ~~gone~~ text.\n\n- one\n- two\n\n1. first\n2. second\n\n[docs](https://getstream.io)',
|
|
30
|
+
{ onLink },
|
|
31
|
+
);
|
|
32
|
+
|
|
33
|
+
expect(screen.getByText('Title')).toBeTruthy();
|
|
34
|
+
expect(screen.getByText('bold')).toBeTruthy();
|
|
35
|
+
expect(screen.getByText('italic')).toBeTruthy();
|
|
36
|
+
expect(screen.getByText('one')).toBeTruthy();
|
|
37
|
+
expect(screen.getByText('second')).toBeTruthy();
|
|
38
|
+
|
|
39
|
+
fireEvent.press(screen.getByText('docs'));
|
|
40
|
+
expect(onLink).toHaveBeenCalledWith('https://getstream.io');
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
it('renders tables, block quotes, inline code and horizontal rules', () => {
|
|
44
|
+
renderMarkdown('| a | b |\n|---|---|\n| 1 | 2 |\n\n> quoted\n\nuse `npm i`\n\n---\n\nafter');
|
|
45
|
+
|
|
46
|
+
expect(screen.getByText('a')).toBeTruthy();
|
|
47
|
+
expect(screen.getByText('2')).toBeTruthy();
|
|
48
|
+
expect(screen.getByText('quoted')).toBeTruthy();
|
|
49
|
+
expect(screen.getByText('npm i')).toBeTruthy();
|
|
50
|
+
expect(screen.getByText('after')).toBeTruthy();
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
it('renders a code block with its language and copies its content', () => {
|
|
54
|
+
renderMarkdown('```js\nconst a = 1;\n```');
|
|
55
|
+
|
|
56
|
+
expect(screen.getByText('js')).toBeTruthy();
|
|
57
|
+
expect(screen.getByText(/const/)).toBeTruthy();
|
|
58
|
+
|
|
59
|
+
fireEvent.press(screen.getByText('\u29C9'));
|
|
60
|
+
expect(mockSetString).toHaveBeenCalledWith('const a = 1;');
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
it('renders a mermaid pie chart instead of a code block', () => {
|
|
64
|
+
renderMarkdown('```mermaid\npie\n"Dogs" : 3\n"Cats" : 2\n```');
|
|
65
|
+
|
|
66
|
+
expect(screen.getByTestId('victory-polar-chart')).toBeTruthy();
|
|
67
|
+
expect(screen.getByText('Dogs')).toBeTruthy();
|
|
68
|
+
expect(screen.queryByText('mermaid')).toBeNull();
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
it('renders a vega-lite JSON chart, and falls back to code for other JSON', () => {
|
|
72
|
+
const chart = JSON.stringify({
|
|
73
|
+
data: { values: [{ a: 'A', b: 1 }] },
|
|
74
|
+
encoding: { x: { field: 'a' }, y: { field: 'b' } },
|
|
75
|
+
mark: 'bar',
|
|
76
|
+
});
|
|
77
|
+
renderMarkdown('```json\n' + chart + '\n```');
|
|
78
|
+
expect(screen.getByTestId('victory-cartesian-chart')).toBeTruthy();
|
|
79
|
+
|
|
80
|
+
renderMarkdown('```json\n{ "hello": "world" }\n```');
|
|
81
|
+
expect(screen.getByText('json')).toBeTruthy();
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
it('applies theme overrides', () => {
|
|
85
|
+
const theme = mergeThemes({ style: { markdown: { text: { color: 'rgb(1, 2, 3)' } } } });
|
|
86
|
+
render(
|
|
87
|
+
<StreamTheme mergedStyle={theme}>
|
|
88
|
+
<Markdown>{'# Themed'}</Markdown>
|
|
89
|
+
</StreamTheme>,
|
|
90
|
+
);
|
|
91
|
+
|
|
92
|
+
expect(screen.getByText('Themed')).toHaveStyle({ color: 'rgb(1, 2, 3)' });
|
|
93
|
+
});
|
|
94
|
+
});
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Linking, StyleSheet, View } from 'react-native';
|
|
3
|
+
|
|
4
|
+
import { act, fireEvent, render, renderHook, screen } from '@testing-library/react-native';
|
|
5
|
+
|
|
6
|
+
import { registerNativeHandlers } from '../../native';
|
|
7
|
+
import {
|
|
8
|
+
AITypingIndicatorView,
|
|
9
|
+
StreamingMessageView,
|
|
10
|
+
StreamTheme,
|
|
11
|
+
useStreamingMessage,
|
|
12
|
+
} from '../index';
|
|
13
|
+
|
|
14
|
+
describe('ai-components streaming', () => {
|
|
15
|
+
beforeEach(() => {
|
|
16
|
+
jest.useFakeTimers();
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
afterEach(() => {
|
|
20
|
+
jest.useRealTimers();
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
describe('useStreamingMessage', () => {
|
|
24
|
+
it('renders the initial text immediately and animates text appended later', () => {
|
|
25
|
+
const { result, rerender } = renderHook(
|
|
26
|
+
({ text }: { text: string }) =>
|
|
27
|
+
useStreamingMessage({ letterInterval: 10, renderingLetterCount: 2, text }),
|
|
28
|
+
{ initialProps: { text: 'Hello' } },
|
|
29
|
+
);
|
|
30
|
+
expect(result.current.streamedMessageText).toBe('Hello');
|
|
31
|
+
|
|
32
|
+
rerender({ text: 'Hello world' });
|
|
33
|
+
act(() => {
|
|
34
|
+
jest.advanceTimersByTime(10);
|
|
35
|
+
});
|
|
36
|
+
expect(result.current.streamedMessageText).toBe('Hello w');
|
|
37
|
+
|
|
38
|
+
act(() => {
|
|
39
|
+
jest.advanceTimersByTime(100);
|
|
40
|
+
});
|
|
41
|
+
expect(result.current.streamedMessageText).toBe('Hello world');
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
it('optimistically closes a code fence while it is being streamed', () => {
|
|
45
|
+
const { result, rerender } = renderHook(
|
|
46
|
+
({ text }: { text: string }) =>
|
|
47
|
+
useStreamingMessage({ letterInterval: 10, renderingLetterCount: 4, text }),
|
|
48
|
+
{ initialProps: { text: '' } },
|
|
49
|
+
);
|
|
50
|
+
|
|
51
|
+
rerender({ text: '```js\ncode' });
|
|
52
|
+
act(() => {
|
|
53
|
+
jest.advanceTimersByTime(10);
|
|
54
|
+
});
|
|
55
|
+
expect(result.current.streamedMessageText).toBe('```j```');
|
|
56
|
+
});
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
describe('StreamingMessageView', () => {
|
|
60
|
+
it('renders markdown and handles links with the provided callback', () => {
|
|
61
|
+
const onLink = jest.fn();
|
|
62
|
+
render(
|
|
63
|
+
<StreamTheme>
|
|
64
|
+
<StreamingMessageView onLink={onLink} text={'**Hi** see getstream.io'} />
|
|
65
|
+
</StreamTheme>,
|
|
66
|
+
);
|
|
67
|
+
|
|
68
|
+
expect(screen.getByText('Hi')).toBeTruthy();
|
|
69
|
+
fireEvent.press(screen.getByText('getstream.io'));
|
|
70
|
+
expect(onLink).toHaveBeenCalledWith('http://getstream.io');
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
it('opens links with Linking by default', async () => {
|
|
74
|
+
const canOpenURL = jest.spyOn(Linking, 'canOpenURL').mockResolvedValue(true);
|
|
75
|
+
const openURL = jest.spyOn(Linking, 'openURL').mockResolvedValue(undefined);
|
|
76
|
+
render(
|
|
77
|
+
<StreamTheme>
|
|
78
|
+
<StreamingMessageView text={'see getstream.io'} />
|
|
79
|
+
</StreamTheme>,
|
|
80
|
+
);
|
|
81
|
+
|
|
82
|
+
await act(async () => {
|
|
83
|
+
fireEvent.press(screen.getByText('getstream.io'));
|
|
84
|
+
// Let the `canOpenURL` promise resolve.
|
|
85
|
+
await Promise.resolve();
|
|
86
|
+
});
|
|
87
|
+
|
|
88
|
+
expect(canOpenURL).toHaveBeenCalledWith('http://getstream.io');
|
|
89
|
+
expect(openURL).toHaveBeenCalledWith('http://getstream.io');
|
|
90
|
+
});
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
describe('AITypingIndicatorView', () => {
|
|
94
|
+
it('lays the SDK native shimmer over the text', () => {
|
|
95
|
+
const MockShimmer = jest.fn((props) => <View testID='native-shimmer' {...props} />);
|
|
96
|
+
registerNativeHandlers({ NativeShimmerView: MockShimmer });
|
|
97
|
+
|
|
98
|
+
render(
|
|
99
|
+
<StreamTheme>
|
|
100
|
+
<AITypingIndicatorView text={'Thinking...'} />
|
|
101
|
+
</StreamTheme>,
|
|
102
|
+
);
|
|
103
|
+
|
|
104
|
+
expect(screen.getByText('Thinking...')).toBeTruthy();
|
|
105
|
+
const shimmer = screen.getByTestId('native-shimmer');
|
|
106
|
+
// The native shimmer paints behind its children, so it must be a sibling drawn after the
|
|
107
|
+
// text, covering it, rather than its parent.
|
|
108
|
+
expect(shimmer.props.children).toBeUndefined();
|
|
109
|
+
expect(MockShimmer.mock.calls[0]?.[0]).toMatchObject({
|
|
110
|
+
baseColor: 'transparent',
|
|
111
|
+
duration: 1200,
|
|
112
|
+
gradientColor: '#FFFFFF',
|
|
113
|
+
pointerEvents: 'none',
|
|
114
|
+
});
|
|
115
|
+
expect(StyleSheet.flatten(shimmer.props.style)).toMatchObject({
|
|
116
|
+
bottom: 0,
|
|
117
|
+
left: 0,
|
|
118
|
+
position: 'absolute',
|
|
119
|
+
right: 0,
|
|
120
|
+
top: 0,
|
|
121
|
+
});
|
|
122
|
+
|
|
123
|
+
registerNativeHandlers({ NativeShimmerView: null as unknown as undefined });
|
|
124
|
+
});
|
|
125
|
+
});
|
|
126
|
+
});
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Platform, StyleSheet, Text, View } from 'react-native';
|
|
3
|
+
|
|
4
|
+
import { render, screen } from '@testing-library/react-native';
|
|
5
|
+
|
|
6
|
+
import { registerNativeHandlers } from '../../native';
|
|
7
|
+
import {
|
|
8
|
+
cssToRNTextStyle,
|
|
9
|
+
flattenRowsToTextAndColorRanges,
|
|
10
|
+
generateNewStylesheet,
|
|
11
|
+
StreamTheme,
|
|
12
|
+
SyntaxHighlighter,
|
|
13
|
+
} from '../index';
|
|
14
|
+
|
|
15
|
+
const setPlatform = (os: typeof Platform.OS) =>
|
|
16
|
+
Object.defineProperty(Platform, 'OS', { configurable: true, get: () => os });
|
|
17
|
+
|
|
18
|
+
describe('ai-components syntax highlighting', () => {
|
|
19
|
+
const originalOS = Platform.OS;
|
|
20
|
+
|
|
21
|
+
afterEach(() => {
|
|
22
|
+
setPlatform(originalOS);
|
|
23
|
+
registerNativeHandlers({ PerfText: null as unknown as undefined });
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
it('converts web CSS into React Native text styles', () => {
|
|
27
|
+
expect(
|
|
28
|
+
cssToRNTextStyle({
|
|
29
|
+
color: '#fff',
|
|
30
|
+
font: 'italic bold 14px/20px "Fira Code", monospace',
|
|
31
|
+
letterSpacing: '0.5em',
|
|
32
|
+
overflow: 'auto',
|
|
33
|
+
}),
|
|
34
|
+
).toEqual({
|
|
35
|
+
color: '#fff',
|
|
36
|
+
fontFamily: 'Fira Code',
|
|
37
|
+
fontSize: 14,
|
|
38
|
+
fontStyle: 'italic',
|
|
39
|
+
fontWeight: 'bold',
|
|
40
|
+
letterSpacing: 8,
|
|
41
|
+
lineHeight: 20,
|
|
42
|
+
overflow: 'scroll',
|
|
43
|
+
});
|
|
44
|
+
expect(
|
|
45
|
+
cssToRNTextStyle({ fontSize: '1.5em', lineHeight: 'nope' }, { baseFontSize: 10 }),
|
|
46
|
+
).toEqual({
|
|
47
|
+
fontSize: 15,
|
|
48
|
+
});
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
it('flattens highlighted rows into one text with merged colour ranges', () => {
|
|
52
|
+
const { defaultColor, transformedStyle } = generateNewStylesheet({
|
|
53
|
+
highlighter: 'prism',
|
|
54
|
+
stylesheet: {
|
|
55
|
+
'pre[class*="language-"]': { color: '#111111' },
|
|
56
|
+
keyword: { color: '#ff0000' },
|
|
57
|
+
},
|
|
58
|
+
});
|
|
59
|
+
expect(defaultColor).toBe('#111111');
|
|
60
|
+
|
|
61
|
+
const rows = [
|
|
62
|
+
[
|
|
63
|
+
{
|
|
64
|
+
children: [{ type: 'text', value: 'const' }],
|
|
65
|
+
properties: { className: ['token', 'keyword'] },
|
|
66
|
+
tagName: 'span',
|
|
67
|
+
type: 'element',
|
|
68
|
+
},
|
|
69
|
+
{ type: 'text', value: ' a = 1;' },
|
|
70
|
+
],
|
|
71
|
+
[{ type: 'text', value: 'next' }],
|
|
72
|
+
] as unknown as rendererNode[];
|
|
73
|
+
|
|
74
|
+
const { ranges, text } = flattenRowsToTextAndColorRanges(rows, {
|
|
75
|
+
defaultColor: defaultColor as string,
|
|
76
|
+
// The renderer passes the converted stylesheet through react-syntax-highlighter untyped.
|
|
77
|
+
stylesheet: transformedStyle as unknown as Parameters<
|
|
78
|
+
typeof flattenRowsToTextAndColorRanges
|
|
79
|
+
>[1]['stylesheet'],
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
expect(text).toBe('const a = 1;\nnext');
|
|
83
|
+
expect(ranges).toHaveLength(3);
|
|
84
|
+
expect(ranges[0]).toMatchObject({ end: 5, start: 0 });
|
|
85
|
+
expect(ranges[1]).toMatchObject({ end: 12, start: 5 });
|
|
86
|
+
expect(ranges[2]).toMatchObject({ end: 17, start: 13 });
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
it('renders nested Text on iOS', () => {
|
|
90
|
+
setPlatform('ios');
|
|
91
|
+
render(
|
|
92
|
+
<StreamTheme>
|
|
93
|
+
<SyntaxHighlighter highlighter='prism' language='javascript'>
|
|
94
|
+
{'const a = 1;'}
|
|
95
|
+
</SyntaxHighlighter>
|
|
96
|
+
</StreamTheme>,
|
|
97
|
+
);
|
|
98
|
+
|
|
99
|
+
expect(screen.getByText('const')).toBeTruthy();
|
|
100
|
+
});
|
|
101
|
+
|
|
102
|
+
it('highlights with highlight.js by default', () => {
|
|
103
|
+
setPlatform('ios');
|
|
104
|
+
render(
|
|
105
|
+
<StreamTheme>
|
|
106
|
+
<SyntaxHighlighter language='javascript'>{'const a = 1;'}</SyntaxHighlighter>
|
|
107
|
+
</StreamTheme>,
|
|
108
|
+
);
|
|
109
|
+
|
|
110
|
+
// Tokenized: the keyword is its own text node, inside a span styled by the highlight.js default
|
|
111
|
+
// theme (`hljs-keyword` is bold).
|
|
112
|
+
expect(screen.getByText('const')).toBeTruthy();
|
|
113
|
+
expect(
|
|
114
|
+
screen
|
|
115
|
+
.UNSAFE_getAllByType(Text)
|
|
116
|
+
.some((node) => StyleSheet.flatten(node.props.style)?.fontWeight === 'bold'),
|
|
117
|
+
).toBe(true);
|
|
118
|
+
});
|
|
119
|
+
|
|
120
|
+
it('renders a single PerfText on Android', () => {
|
|
121
|
+
setPlatform('android');
|
|
122
|
+
const MockPerfText = jest.fn((props) => <View testID='perf-text' {...props} />);
|
|
123
|
+
registerNativeHandlers({ PerfText: MockPerfText });
|
|
124
|
+
|
|
125
|
+
render(
|
|
126
|
+
<StreamTheme>
|
|
127
|
+
<SyntaxHighlighter highlighter='prism' language='javascript'>
|
|
128
|
+
{'const a = 1;'}
|
|
129
|
+
</SyntaxHighlighter>
|
|
130
|
+
</StreamTheme>,
|
|
131
|
+
);
|
|
132
|
+
|
|
133
|
+
expect(screen.getByTestId('perf-text')).toBeTruthy();
|
|
134
|
+
expect(MockPerfText.mock.calls[0]?.[0]).toMatchObject({ text: 'const a = 1;' });
|
|
135
|
+
});
|
|
136
|
+
});
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import { colorFromLabel, hashLabel, parseJsonChart, parseMermaid, xorshift32 } from '../charts';
|
|
2
|
+
|
|
3
|
+
describe('ai-components chart parsers', () => {
|
|
4
|
+
describe('parseMermaid', () => {
|
|
5
|
+
it('parses a pie chart with a title', () => {
|
|
6
|
+
const spec = parseMermaid('pie\ntitle Pets\n"Dogs" : 386\n"Cats" : 85.5\nRats : 15');
|
|
7
|
+
|
|
8
|
+
expect(spec.type).toBe('pie');
|
|
9
|
+
expect(spec.title).toBe('Pets');
|
|
10
|
+
expect(spec.data.map(({ dimension, value }) => ({ dimension, value }))).toEqual([
|
|
11
|
+
{ dimension: 'Dogs', value: 386 },
|
|
12
|
+
{ dimension: 'Cats', value: 85.5 },
|
|
13
|
+
{ dimension: 'Rats', value: 15 },
|
|
14
|
+
]);
|
|
15
|
+
spec.data.forEach(({ color }) => expect(color).toMatch(/^#[0-9a-f]{6}$/i));
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
it('throws on unsupported diagrams', () => {
|
|
19
|
+
expect(() => parseMermaid('graph TD\nA-->B')).toThrow('Unknown mermaid diagram type');
|
|
20
|
+
});
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
describe('parseJsonChart', () => {
|
|
24
|
+
it('parses a vega-lite bar chart', () => {
|
|
25
|
+
const spec = parseJsonChart(
|
|
26
|
+
JSON.stringify({
|
|
27
|
+
data: {
|
|
28
|
+
values: [
|
|
29
|
+
{ a: 'A', b: 28 },
|
|
30
|
+
{ a: 'B', b: 55 },
|
|
31
|
+
{ a: 'C', b: 'not a number' },
|
|
32
|
+
],
|
|
33
|
+
},
|
|
34
|
+
encoding: {
|
|
35
|
+
x: { field: 'a', type: 'nominal' },
|
|
36
|
+
y: { field: 'b', type: 'quantitative' },
|
|
37
|
+
},
|
|
38
|
+
mark: 'bar',
|
|
39
|
+
}),
|
|
40
|
+
);
|
|
41
|
+
|
|
42
|
+
expect(spec.type).toBe('bar');
|
|
43
|
+
expect(spec.data).toEqual([
|
|
44
|
+
{ color: undefined, dimension: 'A', value: 28 },
|
|
45
|
+
{ color: undefined, dimension: 'B', value: 55 },
|
|
46
|
+
]);
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
it('parses a vega-lite arc chart as a pie chart', () => {
|
|
50
|
+
const spec = parseJsonChart(
|
|
51
|
+
JSON.stringify({
|
|
52
|
+
data: {
|
|
53
|
+
values: [
|
|
54
|
+
{ category: 'x', value: 4 },
|
|
55
|
+
{ category: 'y', value: 6 },
|
|
56
|
+
],
|
|
57
|
+
},
|
|
58
|
+
encoding: {
|
|
59
|
+
color: { field: 'category', type: 'nominal' },
|
|
60
|
+
theta: { field: 'value', type: 'quantitative' },
|
|
61
|
+
},
|
|
62
|
+
mark: { type: 'arc' },
|
|
63
|
+
}),
|
|
64
|
+
);
|
|
65
|
+
|
|
66
|
+
expect(spec.type).toBe('pie');
|
|
67
|
+
expect(spec.data.map(({ dimension, value }) => ({ dimension, value }))).toEqual([
|
|
68
|
+
{ dimension: 'x', value: 4 },
|
|
69
|
+
{ dimension: 'y', value: 6 },
|
|
70
|
+
]);
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
it('takes the mark from the first layer', () => {
|
|
74
|
+
const spec = parseJsonChart(
|
|
75
|
+
JSON.stringify({
|
|
76
|
+
data: { values: [{ t: '2024-01-01', v: 1 }] },
|
|
77
|
+
encoding: { x: { field: 't', type: 'temporal' }, y: { field: 'v' } },
|
|
78
|
+
layer: [{ mark: { type: 'line' } }],
|
|
79
|
+
}),
|
|
80
|
+
);
|
|
81
|
+
|
|
82
|
+
expect(spec.type).toBe('line');
|
|
83
|
+
expect(spec.isTemporalDim).toBe(true);
|
|
84
|
+
expect(spec.data[0]?.dimension).toBeInstanceOf(Date);
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
it('rejects JSON that is not a supported chart', () => {
|
|
88
|
+
expect(() => parseJsonChart(JSON.stringify({ hello: 'world' }))).toThrow(
|
|
89
|
+
'Unknown type of JSON formatted chart.',
|
|
90
|
+
);
|
|
91
|
+
expect(() =>
|
|
92
|
+
parseJsonChart(
|
|
93
|
+
JSON.stringify({
|
|
94
|
+
data: { values: [] },
|
|
95
|
+
encoding: { x: { field: 'a' }, y: { field: 'b' } },
|
|
96
|
+
mark: 'geoshape',
|
|
97
|
+
}),
|
|
98
|
+
),
|
|
99
|
+
).toThrow();
|
|
100
|
+
expect(() => parseJsonChart('{ not json')).toThrow();
|
|
101
|
+
});
|
|
102
|
+
});
|
|
103
|
+
|
|
104
|
+
describe('colours', () => {
|
|
105
|
+
it('hashes labels case and whitespace insensitively', () => {
|
|
106
|
+
expect(hashLabel(' Dogs ')).toBe(hashLabel('dogs'));
|
|
107
|
+
expect(hashLabel('dogs')).not.toBe(hashLabel('cats'));
|
|
108
|
+
});
|
|
109
|
+
|
|
110
|
+
it('produces a deterministic pseudo random sequence in [0, 1]', () => {
|
|
111
|
+
const a = xorshift32(42);
|
|
112
|
+
const b = xorshift32(42);
|
|
113
|
+
for (let i = 0; i < 5; i++) {
|
|
114
|
+
const value = a();
|
|
115
|
+
expect(value).toBe(b());
|
|
116
|
+
expect(value).toBeGreaterThanOrEqual(0);
|
|
117
|
+
expect(value).toBeLessThanOrEqual(1);
|
|
118
|
+
}
|
|
119
|
+
});
|
|
120
|
+
|
|
121
|
+
it('gives stable, distinct colours per label', () => {
|
|
122
|
+
const firstRun = ['a', 'b', 'c'].map((label) => colorFromLabel(label, []));
|
|
123
|
+
const secondRun = ['a', 'b', 'c'].map((label) => colorFromLabel(label, []));
|
|
124
|
+
expect(firstRun).toEqual(secondRun);
|
|
125
|
+
|
|
126
|
+
const usedHues: number[] = [];
|
|
127
|
+
const distinct = ['a', 'b', 'c', 'd'].map((label) => colorFromLabel(label, usedHues));
|
|
128
|
+
expect(new Set(distinct).size).toBe(4);
|
|
129
|
+
});
|
|
130
|
+
});
|
|
131
|
+
});
|