stream-chat-react-native-core 9.9.4 → 9.10.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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,166 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { DeviceEventEmitter } from 'react-native';
|
|
3
|
+
|
|
4
|
+
import { act, fireEvent, render, screen } from '@testing-library/react-native';
|
|
5
|
+
|
|
6
|
+
import * as aiComponents from '../index';
|
|
7
|
+
import { AIDictation } from '../native/AIDictation';
|
|
8
|
+
|
|
9
|
+
const flushPromises = () => new Promise<void>((resolve) => setTimeout(resolve, 0));
|
|
10
|
+
|
|
11
|
+
const createNativeModule = () => ({
|
|
12
|
+
addListener: jest.fn(),
|
|
13
|
+
cancel: jest.fn(),
|
|
14
|
+
isRecording: jest.fn(() => false),
|
|
15
|
+
removeListeners: jest.fn(),
|
|
16
|
+
start: jest.fn(),
|
|
17
|
+
stop: jest.fn(),
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
// The AI components read the native module through this getter, so every test can decide whether
|
|
21
|
+
// the module is "compiled in".
|
|
22
|
+
let mockNativeModule: ReturnType<typeof createNativeModule> | null = null;
|
|
23
|
+
jest.mock('../native-specs/NativeAIDictation', () => ({
|
|
24
|
+
__esModule: true,
|
|
25
|
+
get default() {
|
|
26
|
+
return mockNativeModule;
|
|
27
|
+
},
|
|
28
|
+
}));
|
|
29
|
+
|
|
30
|
+
const renderComposer = () =>
|
|
31
|
+
render(
|
|
32
|
+
<aiComponents.StreamTheme>
|
|
33
|
+
<aiComponents.ComposerView onSendMessage={jest.fn(() => Promise.resolve())} />
|
|
34
|
+
</aiComponents.StreamTheme>,
|
|
35
|
+
);
|
|
36
|
+
|
|
37
|
+
describe('ai-components dictation', () => {
|
|
38
|
+
afterEach(() => {
|
|
39
|
+
mockNativeModule = null;
|
|
40
|
+
act(() => {
|
|
41
|
+
aiComponents.dictationStoreApi.reset();
|
|
42
|
+
});
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
describe('when the native module is not compiled in', () => {
|
|
46
|
+
it('reports dictation as unavailable, hides the mic button and warns once in development', () => {
|
|
47
|
+
const warn = jest.spyOn(console, 'warn').mockImplementation(() => {});
|
|
48
|
+
|
|
49
|
+
expect(aiComponents.isDictationAvailable()).toBe(false);
|
|
50
|
+
renderComposer();
|
|
51
|
+
renderComposer();
|
|
52
|
+
|
|
53
|
+
expect(screen.UNSAFE_queryAllByProps({ fill: '#7A7A7A' })).toHaveLength(0);
|
|
54
|
+
expect(warn).toHaveBeenCalledTimes(1);
|
|
55
|
+
expect(warn).toHaveBeenCalledWith(expect.stringContaining('$StreamChatEnableDictation'));
|
|
56
|
+
warn.mockRestore();
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
it('turns the low-level API into no-ops', () => {
|
|
60
|
+
expect(() => AIDictation.start()).not.toThrow();
|
|
61
|
+
expect(AIDictation.isRecording()).toBe(false);
|
|
62
|
+
const unsubscribe = AIDictation.addResultListener(jest.fn());
|
|
63
|
+
expect(() => unsubscribe()).not.toThrow();
|
|
64
|
+
});
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
describe('when the native module is compiled in', () => {
|
|
68
|
+
it('starts dictation and streams the transcript into the input', async () => {
|
|
69
|
+
const nativeModule = createNativeModule();
|
|
70
|
+
mockNativeModule = nativeModule;
|
|
71
|
+
expect(aiComponents.isDictationAvailable()).toBe(true);
|
|
72
|
+
|
|
73
|
+
renderComposer();
|
|
74
|
+
|
|
75
|
+
// The mic is the only icon rendered by an empty composer.
|
|
76
|
+
const mic = screen.UNSAFE_getByProps({ fill: '#7A7A7A' });
|
|
77
|
+
await act(async () => {
|
|
78
|
+
fireEvent.press(mic);
|
|
79
|
+
await flushPromises();
|
|
80
|
+
});
|
|
81
|
+
expect(nativeModule.start).toHaveBeenCalledWith({
|
|
82
|
+
interimResults: true,
|
|
83
|
+
language: 'en-US',
|
|
84
|
+
silenceTimeoutMs: 2500,
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
act(() => {
|
|
88
|
+
DeviceEventEmitter.emit('AIDictationOnState', { state: 'listening' });
|
|
89
|
+
});
|
|
90
|
+
// While recording the mic is highlighted.
|
|
91
|
+
expect(screen.UNSAFE_getByProps({ fill: '#005FFF' })).toBeTruthy();
|
|
92
|
+
|
|
93
|
+
act(() => {
|
|
94
|
+
DeviceEventEmitter.emit('AIDictationOnResult', { isFinal: false, text: 'hello wor' });
|
|
95
|
+
});
|
|
96
|
+
expect(screen.getByPlaceholderText('Ask anything').props.value).toBe('hello wor');
|
|
97
|
+
|
|
98
|
+
// Pressing the mic while listening stops dictation.
|
|
99
|
+
fireEvent.press(screen.UNSAFE_getByProps({ fill: '#005FFF' }));
|
|
100
|
+
expect(nativeModule.stop).toHaveBeenCalled();
|
|
101
|
+
|
|
102
|
+
act(() => {
|
|
103
|
+
DeviceEventEmitter.emit('AIDictationOnState', { state: 'stopping' });
|
|
104
|
+
DeviceEventEmitter.emit('AIDictationOnResult', { isFinal: true, text: 'hello world' });
|
|
105
|
+
});
|
|
106
|
+
expect(aiComponents.dictationStore.getLatestValue()).toMatchObject({
|
|
107
|
+
isRecording: false,
|
|
108
|
+
state: 'idle',
|
|
109
|
+
transcript: 'hello world',
|
|
110
|
+
});
|
|
111
|
+
// Once dictation finishes with text in the input, the send button replaces the mic.
|
|
112
|
+
expect(screen.getByTestId('send-up')).toBeTruthy();
|
|
113
|
+
expect(nativeModule.cancel).toHaveBeenCalled();
|
|
114
|
+
});
|
|
115
|
+
|
|
116
|
+
it('applies a final result that arrives after the recognizer stopped listening', async () => {
|
|
117
|
+
mockNativeModule = createNativeModule();
|
|
118
|
+
renderComposer();
|
|
119
|
+
|
|
120
|
+
await act(async () => {
|
|
121
|
+
fireEvent.press(screen.UNSAFE_getByProps({ fill: '#7A7A7A' }));
|
|
122
|
+
await flushPromises();
|
|
123
|
+
});
|
|
124
|
+
// Some recognizers (e.g. the Android emulator) send no interim results, only a final one
|
|
125
|
+
// after `stopping`.
|
|
126
|
+
act(() => {
|
|
127
|
+
DeviceEventEmitter.emit('AIDictationOnState', { state: 'listening' });
|
|
128
|
+
DeviceEventEmitter.emit('AIDictationOnState', { state: 'stopping' });
|
|
129
|
+
DeviceEventEmitter.emit('AIDictationOnResult', { isFinal: true, text: 'test test' });
|
|
130
|
+
});
|
|
131
|
+
|
|
132
|
+
expect(screen.getByPlaceholderText('Ask anything').props.value).toBe('test test');
|
|
133
|
+
});
|
|
134
|
+
|
|
135
|
+
it('does not restore the transcript of an earlier dictation when the input mounts', () => {
|
|
136
|
+
mockNativeModule = createNativeModule();
|
|
137
|
+
act(() => {
|
|
138
|
+
aiComponents.dictationStore.partialNext({ transcript: 'an earlier dictation' });
|
|
139
|
+
});
|
|
140
|
+
|
|
141
|
+
renderComposer();
|
|
142
|
+
|
|
143
|
+
expect(screen.getByPlaceholderText('Ask anything').props.value).toBe('');
|
|
144
|
+
});
|
|
145
|
+
|
|
146
|
+
it('stores native errors', async () => {
|
|
147
|
+
mockNativeModule = createNativeModule();
|
|
148
|
+
renderComposer();
|
|
149
|
+
|
|
150
|
+
await act(async () => {
|
|
151
|
+
fireEvent.press(screen.UNSAFE_getByProps({ fill: '#7A7A7A' }));
|
|
152
|
+
await flushPromises();
|
|
153
|
+
});
|
|
154
|
+
act(() => {
|
|
155
|
+
DeviceEventEmitter.emit('AIDictationOnState', { state: 'listening' });
|
|
156
|
+
DeviceEventEmitter.emit('AIDictationOnError', { code: 'X', message: 'boom' });
|
|
157
|
+
});
|
|
158
|
+
|
|
159
|
+
expect(aiComponents.dictationStore.getLatestValue()).toMatchObject({
|
|
160
|
+
error: { code: 'X', message: 'boom' },
|
|
161
|
+
isRecording: false,
|
|
162
|
+
state: 'idle',
|
|
163
|
+
});
|
|
164
|
+
});
|
|
165
|
+
});
|
|
166
|
+
});
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { escapeRegExp, generateMarkdownText, parseLinksFromText } from '../markdown';
|
|
2
|
+
|
|
3
|
+
describe('ai-components generateMarkdownText', () => {
|
|
4
|
+
it('returns null for empty input', () => {
|
|
5
|
+
expect(generateMarkdownText(undefined)).toBeNull();
|
|
6
|
+
expect(generateMarkdownText('')).toBeNull();
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
it('converts a raw link into a markdown link', () => {
|
|
10
|
+
expect(generateMarkdownText('Visit getstream.io today')).toBe(
|
|
11
|
+
'Visit [getstream.io](http://getstream.io) today',
|
|
12
|
+
);
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
// Regression: every link used to be replaced on the original text, so only the last one survived.
|
|
16
|
+
it('converts every raw link in the text', () => {
|
|
17
|
+
expect(generateMarkdownText('See getstream.io and reactnative.dev')).toBe(
|
|
18
|
+
'See [getstream.io](http://getstream.io) and [reactnative.dev](http://reactnative.dev)',
|
|
19
|
+
);
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
it('keeps emails as mailto links', () => {
|
|
23
|
+
expect(generateMarkdownText('Mail hello@getstream.io')).toBe(
|
|
24
|
+
'Mail [hello@getstream.io](mailto:hello@getstream.io)',
|
|
25
|
+
);
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
it('closes an unterminated code fence', () => {
|
|
29
|
+
const result = generateMarkdownText('Code:\n```js\nconst a = 1;');
|
|
30
|
+
expect((result?.match(/```/g) ?? []).length % 2).toBe(0);
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
it('collapses indentation after newlines but keeps nested list indentation', () => {
|
|
34
|
+
expect(generateMarkdownText('Line one\n indented line')).toBe('Line one\nindented line');
|
|
35
|
+
expect(generateMarkdownText('- parent\n - child')).toBe('- parent\n - child');
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
it('preserves code blocks verbatim', () => {
|
|
39
|
+
const result = generateMarkdownText('```py\ndef f():\n return 1\n```');
|
|
40
|
+
expect(result).toContain('def f():\n return 1');
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
it('parses links and emails, ignoring markdown links', () => {
|
|
44
|
+
expect(parseLinksFromText('a getstream.io b [x](https://example.com) c me@x.io')).toEqual([
|
|
45
|
+
{ raw: 'getstream.io', url: 'http://getstream.io' },
|
|
46
|
+
{ raw: 'me@x.io', url: 'mailto:me@x.io' },
|
|
47
|
+
]);
|
|
48
|
+
expect(parseLinksFromText(undefined)).toEqual([]);
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
it('escapes regular expression characters', () => {
|
|
52
|
+
expect(escapeRegExp('a.b*c')).toBe('a\\.b\\*c');
|
|
53
|
+
});
|
|
54
|
+
});
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
import { renderHook } from '@testing-library/react-native';
|
|
4
|
+
|
|
5
|
+
import { defaultTheme, mergeThemes, StreamTheme, useTheme } from '../index';
|
|
6
|
+
|
|
7
|
+
describe('ai-components theme', () => {
|
|
8
|
+
it('throws when used outside of StreamTheme', () => {
|
|
9
|
+
jest.spyOn(console, 'error').mockImplementation(() => {});
|
|
10
|
+
expect(() => renderHook(() => useTheme())).toThrow(
|
|
11
|
+
'The useTheme hook was called outside the StreamTheme Provider.',
|
|
12
|
+
);
|
|
13
|
+
jest.restoreAllMocks();
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
it('deep merges style overrides without mutating the default theme', () => {
|
|
17
|
+
const merged = mergeThemes({
|
|
18
|
+
style: { colors: { accent_blue: 'red' }, composer: { inputPillHeight: 60 } },
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
expect(merged.colors.accent_blue).toBe('red');
|
|
22
|
+
expect(merged.colors.black).toBe(defaultTheme.colors.black);
|
|
23
|
+
expect(merged.composer.inputPillHeight).toBe(60);
|
|
24
|
+
expect(defaultTheme.colors.accent_blue).toBe('#005FFF');
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
it('provides the merged theme, or a pre-merged one', () => {
|
|
28
|
+
const { result } = renderHook(() => useTheme(), {
|
|
29
|
+
wrapper: ({ children }) => (
|
|
30
|
+
<StreamTheme style={{ colors: { grey: 'blue' } }}>{children}</StreamTheme>
|
|
31
|
+
),
|
|
32
|
+
});
|
|
33
|
+
expect(result.current.theme.colors.grey).toBe('blue');
|
|
34
|
+
|
|
35
|
+
const mergedStyle = mergeThemes({ style: { colors: { grey: 'green' } } });
|
|
36
|
+
const { result: preMerged } = renderHook(() => useTheme(), {
|
|
37
|
+
wrapper: ({ children }) => <StreamTheme mergedStyle={mergedStyle}>{children}</StreamTheme>,
|
|
38
|
+
});
|
|
39
|
+
expect(preMerged.current.theme).toBe(mergedStyle);
|
|
40
|
+
});
|
|
41
|
+
});
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
import { VictoryChart } from './components';
|
|
4
|
+
import type { ChartSpec } from './types';
|
|
5
|
+
|
|
6
|
+
export type ChartFromBlockProps = {
|
|
7
|
+
spec: ChartSpec;
|
|
8
|
+
height?: number;
|
|
9
|
+
width?: number;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
const Chart = ({ spec, height = 260, width }: ChartFromBlockProps) => {
|
|
13
|
+
if (!spec) {
|
|
14
|
+
return null;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
return <VictoryChart spec={spec} width={width} height={height} />;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export default Chart;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { StyleSheet, Text, View } from 'react-native';
|
|
3
|
+
|
|
4
|
+
import type { Datum } from '../types';
|
|
5
|
+
|
|
6
|
+
export const PieLegend = ({ items, maxRows = 3 }: { items: Datum[]; maxRows?: number }) => {
|
|
7
|
+
return (
|
|
8
|
+
<View style={styles.container}>
|
|
9
|
+
{items.slice(0, maxRows * 4).map((item, i) => (
|
|
10
|
+
<View key={`${item.dimension}-${i}`} style={styles.item}>
|
|
11
|
+
<View
|
|
12
|
+
style={[
|
|
13
|
+
styles.swatch,
|
|
14
|
+
{
|
|
15
|
+
backgroundColor: item.color,
|
|
16
|
+
},
|
|
17
|
+
]}
|
|
18
|
+
/>
|
|
19
|
+
<Text numberOfLines={1} style={styles.label}>
|
|
20
|
+
{item.dimension}
|
|
21
|
+
</Text>
|
|
22
|
+
</View>
|
|
23
|
+
))}
|
|
24
|
+
</View>
|
|
25
|
+
);
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
const styles = StyleSheet.create({
|
|
29
|
+
container: {
|
|
30
|
+
marginTop: 8,
|
|
31
|
+
flexDirection: 'row',
|
|
32
|
+
justifyContent: 'center',
|
|
33
|
+
flexWrap: 'wrap',
|
|
34
|
+
gap: 10,
|
|
35
|
+
},
|
|
36
|
+
item: {
|
|
37
|
+
flexDirection: 'row',
|
|
38
|
+
alignItems: 'center',
|
|
39
|
+
gap: 6,
|
|
40
|
+
maxWidth: '48%', // lets two items sit per row, tweak as needed
|
|
41
|
+
},
|
|
42
|
+
swatch: {
|
|
43
|
+
borderRadius: 2,
|
|
44
|
+
width: 12,
|
|
45
|
+
height: 12,
|
|
46
|
+
},
|
|
47
|
+
label: {
|
|
48
|
+
fontSize: 13,
|
|
49
|
+
},
|
|
50
|
+
});
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Platform, View } from 'react-native';
|
|
3
|
+
|
|
4
|
+
import { LinearGradient, matchFont, vec } from '@shopify/react-native-skia';
|
|
5
|
+
import {
|
|
6
|
+
Area,
|
|
7
|
+
Bar,
|
|
8
|
+
CartesianChart,
|
|
9
|
+
Line,
|
|
10
|
+
Pie,
|
|
11
|
+
PolarChart,
|
|
12
|
+
Scatter,
|
|
13
|
+
// useChartTransformState,
|
|
14
|
+
} from 'victory-native';
|
|
15
|
+
|
|
16
|
+
import { PieLegend } from './PieLegend';
|
|
17
|
+
|
|
18
|
+
import type { ChartSpec } from '../types';
|
|
19
|
+
|
|
20
|
+
const font = matchFont({
|
|
21
|
+
fontFamily: Platform.select({
|
|
22
|
+
ios: 'Helvetica',
|
|
23
|
+
android: 'sans-serif',
|
|
24
|
+
default: 'serif',
|
|
25
|
+
}),
|
|
26
|
+
fontSize: 12,
|
|
27
|
+
fontWeight: 'normal',
|
|
28
|
+
fontStyle: 'normal',
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
export type VictoryChartProps = {
|
|
32
|
+
spec: ChartSpec;
|
|
33
|
+
width?: number;
|
|
34
|
+
height?: number;
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
const DEFAULT_HEIGHT = 260;
|
|
38
|
+
const DEFAULT_WIDTH = 225;
|
|
39
|
+
|
|
40
|
+
export const VictoryChart = (props: VictoryChartProps) => {
|
|
41
|
+
const { spec, height = DEFAULT_HEIGHT, width = DEFAULT_WIDTH } = props;
|
|
42
|
+
|
|
43
|
+
// const { state: transformState } = useChartTransformState({
|
|
44
|
+
// scaleX: 1.5,
|
|
45
|
+
// scaleY: 1.0,
|
|
46
|
+
// });
|
|
47
|
+
|
|
48
|
+
if (spec.type === 'pie') {
|
|
49
|
+
if (!spec?.data.length) return null;
|
|
50
|
+
return (
|
|
51
|
+
<>
|
|
52
|
+
<View style={{ height, width: '100%' }}>
|
|
53
|
+
<PolarChart labelKey={'dimension'} valueKey={'value'} colorKey={'color'} data={spec.data}>
|
|
54
|
+
<Pie.Chart />
|
|
55
|
+
</PolarChart>
|
|
56
|
+
</View>
|
|
57
|
+
<PieLegend items={spec.data} />
|
|
58
|
+
</>
|
|
59
|
+
);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
// Group by color into series
|
|
63
|
+
const seriesNames = Array.from(new Set(spec.data.map((d) => d.color ?? 'series')));
|
|
64
|
+
const yKeys = seriesNames.map((_name, idx) => `y${idx}` as const);
|
|
65
|
+
|
|
66
|
+
let minY = 0;
|
|
67
|
+
|
|
68
|
+
// Normalize data into one row per x, with columns y0,y1,... for each series
|
|
69
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- victory-native rows are keyed by dynamic series names
|
|
70
|
+
const rowsMap = new Map<string | number, Record<string, any>>();
|
|
71
|
+
for (const s of seriesNames) {
|
|
72
|
+
const keyIndex = seriesNames.indexOf(s);
|
|
73
|
+
const yKey = yKeys[keyIndex];
|
|
74
|
+
if (yKey) {
|
|
75
|
+
for (const pt of spec.data.filter((d) => (d.color ?? 'series') === s)) {
|
|
76
|
+
const xKey = spec.isTemporalDim ? new Date(pt.dimension).getTime() : pt.dimension;
|
|
77
|
+
const row = rowsMap.get(xKey) ?? { x: pt.dimension };
|
|
78
|
+
row[yKey] = pt.value;
|
|
79
|
+
minY = Math.min(minY, pt.value);
|
|
80
|
+
rowsMap.set(xKey, row);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
const table = Array.from(rowsMap.values());
|
|
86
|
+
|
|
87
|
+
const visibleBars = table.length;
|
|
88
|
+
|
|
89
|
+
const estimatedBarWidth = (width - 30 - visibleBars * 2) / visibleBars;
|
|
90
|
+
|
|
91
|
+
const maxTickCharCount = spec.isTemporalDim
|
|
92
|
+
? 3
|
|
93
|
+
: Math.max(
|
|
94
|
+
...table.map((entry) =>
|
|
95
|
+
typeof entry.x === 'string' ? entry.x.length : String(entry.x).length,
|
|
96
|
+
),
|
|
97
|
+
);
|
|
98
|
+
|
|
99
|
+
const hasLongLabels =
|
|
100
|
+
(visibleBars > 4 ? maxTickCharCount > 1 : maxTickCharCount > 5) && !spec.isNumericDim;
|
|
101
|
+
|
|
102
|
+
const lowestValue = minY < 0 ? minY - 20 : 0;
|
|
103
|
+
|
|
104
|
+
return (
|
|
105
|
+
<View style={{ height, width: '100%', marginTop: 12 }}>
|
|
106
|
+
<CartesianChart
|
|
107
|
+
data={table}
|
|
108
|
+
xKey={'x'}
|
|
109
|
+
yKeys={yKeys}
|
|
110
|
+
domain={{ y: [lowestValue] }}
|
|
111
|
+
domainPadding={{
|
|
112
|
+
left: estimatedBarWidth * 0.8,
|
|
113
|
+
right: estimatedBarWidth * 0.8,
|
|
114
|
+
top: 20,
|
|
115
|
+
}}
|
|
116
|
+
xAxis={{
|
|
117
|
+
font,
|
|
118
|
+
formatXLabel: (label: number | string) => {
|
|
119
|
+
const parsedLabel = (typeof label === 'number' ? String(label) : label) ?? '';
|
|
120
|
+
if (hasLongLabels && parsedLabel.length > 4) {
|
|
121
|
+
return `${parsedLabel.slice(0, 3)}...`;
|
|
122
|
+
}
|
|
123
|
+
return parsedLabel;
|
|
124
|
+
},
|
|
125
|
+
labelRotate: hasLongLabels ? 90 : 0,
|
|
126
|
+
tickCount: visibleBars,
|
|
127
|
+
labelOffset: hasLongLabels ? 0 : 2,
|
|
128
|
+
}}
|
|
129
|
+
yAxis={[{ font }]}
|
|
130
|
+
padding={{ bottom: hasLongLabels ? 2 * maxTickCharCount + 12 : 0 }}
|
|
131
|
+
// transformState={transformState}
|
|
132
|
+
// transformConfig={{
|
|
133
|
+
// pinch: { enabled: false },
|
|
134
|
+
// pan: { enabled: true, dimensions: 'x', activateAfterLongPress: 10 },
|
|
135
|
+
// }}
|
|
136
|
+
>
|
|
137
|
+
{({ points, chartBounds }) => (
|
|
138
|
+
<>
|
|
139
|
+
{/* One primitive per series */}
|
|
140
|
+
{yKeys.map((yk) => {
|
|
141
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- victory-native types points per static key, ours are dynamic
|
|
142
|
+
const pts = (points as Record<string, any[]>)[yk]!;
|
|
143
|
+
switch (spec.type) {
|
|
144
|
+
case 'bar':
|
|
145
|
+
return (
|
|
146
|
+
<Bar
|
|
147
|
+
key={yk}
|
|
148
|
+
chartBounds={chartBounds}
|
|
149
|
+
points={pts}
|
|
150
|
+
innerPadding={0.33}
|
|
151
|
+
roundedCorners={{
|
|
152
|
+
topLeft: estimatedBarWidth * 0.2,
|
|
153
|
+
topRight: estimatedBarWidth * 0.2,
|
|
154
|
+
}}
|
|
155
|
+
>
|
|
156
|
+
<LinearGradient
|
|
157
|
+
start={vec(0, 0)}
|
|
158
|
+
end={vec(0, 400)}
|
|
159
|
+
colors={['#a78bfa', '#a78bfa50']}
|
|
160
|
+
/>
|
|
161
|
+
</Bar>
|
|
162
|
+
);
|
|
163
|
+
case 'area':
|
|
164
|
+
return (
|
|
165
|
+
<Area key={yk} y0={chartBounds.bottom} points={pts} color={'red'}>
|
|
166
|
+
<LinearGradient
|
|
167
|
+
start={vec(0, 0)}
|
|
168
|
+
end={vec(0, 400)}
|
|
169
|
+
colors={['#a78bfa', '#a78bfa50']}
|
|
170
|
+
/>
|
|
171
|
+
</Area>
|
|
172
|
+
);
|
|
173
|
+
case 'point':
|
|
174
|
+
return <Scatter key={yk} points={pts} radius={3} color={'#a78bfa'} />;
|
|
175
|
+
case 'line':
|
|
176
|
+
default:
|
|
177
|
+
return (
|
|
178
|
+
<Line
|
|
179
|
+
key={yk}
|
|
180
|
+
points={pts}
|
|
181
|
+
strokeWidth={2}
|
|
182
|
+
color={'#a78bfa'}
|
|
183
|
+
connectMissingData={true}
|
|
184
|
+
/>
|
|
185
|
+
);
|
|
186
|
+
}
|
|
187
|
+
})}
|
|
188
|
+
</>
|
|
189
|
+
)}
|
|
190
|
+
</CartesianChart>
|
|
191
|
+
</View>
|
|
192
|
+
);
|
|
193
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './parser';
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { ChartSpec, Datum } from '../types';
|
|
2
|
+
import { colorFromLabel } from '../utils';
|
|
3
|
+
|
|
4
|
+
export const parseMermaidPie = (lines: string[]): ChartSpec => {
|
|
5
|
+
let title: string | undefined;
|
|
6
|
+
const data: Datum[] = [];
|
|
7
|
+
const usedHues: number[] = [];
|
|
8
|
+
for (const ln of lines.slice(1)) {
|
|
9
|
+
const t = ln.match(/^title\s+(.+)$/i);
|
|
10
|
+
// TODO: Check if this is correct ? We only have one group.
|
|
11
|
+
if (t && t[1]) {
|
|
12
|
+
title = t[1]?.trim();
|
|
13
|
+
continue;
|
|
14
|
+
}
|
|
15
|
+
const d = ln.match(/^(?:"([^"]+)"|([^"]+))\s*:\s*([+-]?\d+(?:\.\d+)?)/);
|
|
16
|
+
if (d) {
|
|
17
|
+
const label = (d[1] ?? d[2] ?? '').trim();
|
|
18
|
+
data.push({
|
|
19
|
+
dimension: label,
|
|
20
|
+
value: Number(d[3]),
|
|
21
|
+
color: colorFromLabel(label, usedHues),
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
return { type: 'pie', title, data };
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export const parseMermaid = (code: string) => {
|
|
29
|
+
const lines = code.split(/\r?\n/).map((l) => l.trim());
|
|
30
|
+
if (/^pie\b/i.test(lines[0] || '')) return parseMermaidPie(lines);
|
|
31
|
+
|
|
32
|
+
throw new Error('Unknown mermaid diagram type');
|
|
33
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export type Dim = string;
|
|
2
|
+
|
|
3
|
+
export type Datum = {
|
|
4
|
+
/** The categorical/temporal dimension (label, category, or time). */
|
|
5
|
+
dimension: Dim;
|
|
6
|
+
/** The numeric measure/value. */
|
|
7
|
+
value: number;
|
|
8
|
+
/** Color for this datum; the renderer will fall back to series color. */
|
|
9
|
+
color: string;
|
|
10
|
+
/** Optional series key for multi-series charts (e.g., region). */
|
|
11
|
+
series?: string;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export type ChartType = 'bar' | 'line' | 'area' | 'point' | 'pie';
|
|
15
|
+
|
|
16
|
+
export type ChartSpec = {
|
|
17
|
+
type: ChartType;
|
|
18
|
+
data: Datum[];
|
|
19
|
+
seriesColors?: Record<string, string>;
|
|
20
|
+
title?: string;
|
|
21
|
+
orientation?: 'vertical' | 'horizontal';
|
|
22
|
+
isTemporalDim?: boolean;
|
|
23
|
+
isNumericDim?: boolean;
|
|
24
|
+
dimDomain?: Dim[];
|
|
25
|
+
};
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
/* eslint-disable no-bitwise -- FNV-1a hashing and xorshift PRNG are bitwise by definition */
|
|
2
|
+
// hashing and rng
|
|
3
|
+
export const hashLabel = (raw: string) => {
|
|
4
|
+
const s = raw.trim().toLowerCase().normalize('NFKC');
|
|
5
|
+
let h = 2166136261 >>> 0; // FNV-1a
|
|
6
|
+
for (let i = 0; i < s.length; i++) {
|
|
7
|
+
h ^= s.charCodeAt(i);
|
|
8
|
+
h = Math.imul(h, 16777619) >>> 0;
|
|
9
|
+
}
|
|
10
|
+
return h >>> 0;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export const xorshift32 = (seed: number) => {
|
|
14
|
+
let x = seed || 123456789;
|
|
15
|
+
return () => {
|
|
16
|
+
x ^= x << 13;
|
|
17
|
+
x ^= x >>> 17;
|
|
18
|
+
x ^= x << 5;
|
|
19
|
+
return (x >>> 0) / 0xffffffff;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
// color utils
|
|
24
|
+
export const hslToHex = (h: number, s = 68, l = 52) => {
|
|
25
|
+
const S = s / 100,
|
|
26
|
+
L = l / 100;
|
|
27
|
+
const C = (1 - Math.abs(2 * L - 1)) * S;
|
|
28
|
+
const X = C * (1 - Math.abs(((h / 60) % 2) - 1));
|
|
29
|
+
const m = L - C / 2;
|
|
30
|
+
const [r1, g1, b1] =
|
|
31
|
+
h < 60
|
|
32
|
+
? [C, X, 0]
|
|
33
|
+
: h < 120
|
|
34
|
+
? [X, C, 0]
|
|
35
|
+
: h < 180
|
|
36
|
+
? [0, C, X]
|
|
37
|
+
: h < 240
|
|
38
|
+
? [0, X, C]
|
|
39
|
+
: h < 300
|
|
40
|
+
? [X, 0, C]
|
|
41
|
+
: [C, 0, X];
|
|
42
|
+
const r = Math.round((r1 + m) * 255)
|
|
43
|
+
.toString(16)
|
|
44
|
+
.padStart(2, '0');
|
|
45
|
+
const g = Math.round((g1 + m) * 255)
|
|
46
|
+
.toString(16)
|
|
47
|
+
.padStart(2, '0');
|
|
48
|
+
const b = Math.round((b1 + m) * 255)
|
|
49
|
+
.toString(16)
|
|
50
|
+
.padStart(2, '0');
|
|
51
|
+
return `#${r}${g}${b}`;
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
// ensure hues not closer than MIN_SEP degrees within the same chart
|
|
55
|
+
export const colorFromLabel = (
|
|
56
|
+
label: string,
|
|
57
|
+
usedHues: number[],
|
|
58
|
+
opts?: { minSep?: number; sat?: number; light?: number },
|
|
59
|
+
) => {
|
|
60
|
+
const { minSep = 25, sat = 68, light = 52 } = opts || {};
|
|
61
|
+
const seed = hashLabel(label);
|
|
62
|
+
const rand = xorshift32(seed);
|
|
63
|
+
|
|
64
|
+
// base hue from RNG (looks random, but stable)
|
|
65
|
+
let hue = Math.floor(rand() * 360);
|
|
66
|
+
|
|
67
|
+
// nudge away from already used hues in THIS chart
|
|
68
|
+
let attempts = 0;
|
|
69
|
+
const tooClose = (h: number) =>
|
|
70
|
+
usedHues.some((u) => {
|
|
71
|
+
const d = Math.abs(h - u);
|
|
72
|
+
return Math.min(d, 360 - d) < minSep;
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
while (tooClose(hue) && attempts < 48) {
|
|
76
|
+
hue = (hue + 137.508) % 360; // golden-angle hop
|
|
77
|
+
attempts++;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
usedHues.push(hue);
|
|
81
|
+
return hslToHex(hue, sat, light);
|
|
82
|
+
};
|