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,15 @@
|
|
|
1
|
+
import type { ChartSpec } from '../types';
|
|
2
|
+
import { parseVegalite, VegaLiteSchema } from '../vega-lite';
|
|
3
|
+
|
|
4
|
+
export const parseJsonChart = (code: string): ChartSpec => {
|
|
5
|
+
const json = JSON.parse(code);
|
|
6
|
+
|
|
7
|
+
try {
|
|
8
|
+
const parsedVegaLite = VegaLiteSchema.parse(json);
|
|
9
|
+
return parseVegalite(parsedVegaLite);
|
|
10
|
+
} catch (_error) {
|
|
11
|
+
/* do nothing */
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
throw new Error('Unknown type of JSON formatted chart.');
|
|
15
|
+
};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import type { VegaLite } from './schema';
|
|
2
|
+
|
|
3
|
+
import type { ChartSpec, Datum } from '../types';
|
|
4
|
+
import { colorFromLabel } from '../utils';
|
|
5
|
+
|
|
6
|
+
export const parseVegalite = (spec: VegaLite): ChartSpec => {
|
|
7
|
+
if (spec.type === 'pie') {
|
|
8
|
+
const tField = spec.encoding?.theta?.field;
|
|
9
|
+
const cField = spec.encoding?.color?.field;
|
|
10
|
+
const usedHues: number[] = [];
|
|
11
|
+
const data = (spec.data?.values ?? [])
|
|
12
|
+
.map((d) => {
|
|
13
|
+
const y = Number(d[tField]);
|
|
14
|
+
const x = cField ? String(d[cField]) : '';
|
|
15
|
+
return Number.isFinite(y)
|
|
16
|
+
? {
|
|
17
|
+
dimension: x.trim(),
|
|
18
|
+
value: y,
|
|
19
|
+
color: colorFromLabel(x, usedHues),
|
|
20
|
+
}
|
|
21
|
+
: null;
|
|
22
|
+
})
|
|
23
|
+
.filter(Boolean) as Datum[];
|
|
24
|
+
return { type: 'pie', data };
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const { x, y, color } = spec.encoding;
|
|
28
|
+
const xField = x?.field,
|
|
29
|
+
yField = y?.field;
|
|
30
|
+
const xIsTime = (x?.type ?? '').toLowerCase() === 'temporal';
|
|
31
|
+
const xIsNumeric = (x?.type ?? '').toLowerCase() === 'quantitative';
|
|
32
|
+
|
|
33
|
+
const data = (spec.data?.values ?? [])
|
|
34
|
+
.map((d) => {
|
|
35
|
+
const xv = xIsTime && typeof d[xField] === 'string' ? new Date(d[xField]) : d[xField];
|
|
36
|
+
const yv = Number(d[yField]);
|
|
37
|
+
if (!Number.isFinite(yv)) return null;
|
|
38
|
+
const c = color?.field ? String(d[color.field]) : undefined;
|
|
39
|
+
return { dimension: xv, value: yv, color: c };
|
|
40
|
+
})
|
|
41
|
+
.filter(Boolean) as Datum[];
|
|
42
|
+
|
|
43
|
+
return {
|
|
44
|
+
type: spec.type === 'xy' && spec.markName !== 'arc' ? spec.markName : 'pie',
|
|
45
|
+
data,
|
|
46
|
+
isTemporalDim: xIsTime,
|
|
47
|
+
isNumericDim: xIsNumeric,
|
|
48
|
+
};
|
|
49
|
+
};
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
/* primitives */
|
|
4
|
+
export const VLType = z.enum(['quantitative', 'ordinal', 'nominal', 'temporal']);
|
|
5
|
+
|
|
6
|
+
const FieldRef = z.object({
|
|
7
|
+
field: z.string(),
|
|
8
|
+
type: VLType.optional(),
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
const ColorXY = z.object({
|
|
12
|
+
field: z.string().optional(),
|
|
13
|
+
type: VLType.optional(),
|
|
14
|
+
});
|
|
15
|
+
const ColorPie = z.object({ field: z.string(), type: VLType.optional() });
|
|
16
|
+
|
|
17
|
+
/* we support only these currently */
|
|
18
|
+
const MarkName = z.enum([
|
|
19
|
+
'bar',
|
|
20
|
+
'line',
|
|
21
|
+
'area',
|
|
22
|
+
'point',
|
|
23
|
+
'arc',
|
|
24
|
+
// 'rect',
|
|
25
|
+
// 'rule',
|
|
26
|
+
// 'text',
|
|
27
|
+
// 'tick',
|
|
28
|
+
// 'circle',
|
|
29
|
+
// 'square',
|
|
30
|
+
// 'trail',
|
|
31
|
+
// 'geoshape',
|
|
32
|
+
// 'image',
|
|
33
|
+
]);
|
|
34
|
+
|
|
35
|
+
const MarkDef = z.looseObject({
|
|
36
|
+
type: z.union([MarkName, z.string()]).optional(),
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
/* encodings */
|
|
40
|
+
const XyEncoding = z.object({
|
|
41
|
+
x: FieldRef,
|
|
42
|
+
y: FieldRef,
|
|
43
|
+
color: ColorXY.optional(),
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
const PieEncoding = z.object({
|
|
47
|
+
theta: FieldRef,
|
|
48
|
+
color: ColorPie.optional(),
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
/* base spec */
|
|
52
|
+
const BaseVL = z.object({
|
|
53
|
+
archetype: z.literal('vegalite'),
|
|
54
|
+
$schema: z.string().optional(),
|
|
55
|
+
data: z.object({
|
|
56
|
+
values: z.array(z.record(z.string(), z.unknown())),
|
|
57
|
+
}),
|
|
58
|
+
mark: z.union([MarkName, MarkDef, z.string()]).optional(),
|
|
59
|
+
layer: z.array(z.looseObject({ mark: MarkDef })).optional(),
|
|
60
|
+
marks: z.array(MarkDef).optional(),
|
|
61
|
+
markName: MarkName,
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
/* branches (with explicit kind) */
|
|
65
|
+
const VL_XY = BaseVL.extend({
|
|
66
|
+
type: z.literal('xy'),
|
|
67
|
+
encoding: XyEncoding,
|
|
68
|
+
}).strip();
|
|
69
|
+
|
|
70
|
+
const VL_PIE = BaseVL.extend({
|
|
71
|
+
type: z.literal('pie'),
|
|
72
|
+
encoding: PieEncoding,
|
|
73
|
+
}).strip();
|
|
74
|
+
|
|
75
|
+
const normalizeMarkName = (m: unknown): string | undefined => {
|
|
76
|
+
if (typeof m === 'string') return m.toLowerCase();
|
|
77
|
+
if (m && typeof m === 'object' && typeof (m as { type?: unknown }).type === 'string') {
|
|
78
|
+
return String((m as { type?: unknown }).type).toLowerCase();
|
|
79
|
+
}
|
|
80
|
+
return undefined;
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- untyped JSON input, validated by the zod schema below
|
|
84
|
+
const deriveMarkName = (o: any): string | undefined => {
|
|
85
|
+
// spec.mark (string or MarkDef)
|
|
86
|
+
const direct = normalizeMarkName(o?.mark);
|
|
87
|
+
if (direct) return direct;
|
|
88
|
+
|
|
89
|
+
// first layer's mark.type
|
|
90
|
+
const firstLayerMark =
|
|
91
|
+
Array.isArray(o?.layer) && o.layer[0]?.mark ? normalizeMarkName(o.layer[0].mark) : undefined;
|
|
92
|
+
if (firstLayerMark) return firstLayerMark;
|
|
93
|
+
|
|
94
|
+
// first marks[] item .type
|
|
95
|
+
return Array.isArray(o?.marks) && o.marks.length > 0 ? normalizeMarkName(o.marks[0]) : undefined;
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
export const VegaLiteCore = z.discriminatedUnion('type', [VL_XY, VL_PIE]);
|
|
99
|
+
|
|
100
|
+
/* final schema: preprocess to inject needed metadata, then discriminated union */
|
|
101
|
+
export const VegaLiteSchema = z.preprocess((raw) => {
|
|
102
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- untyped JSON input, validated by the zod schema below
|
|
103
|
+
const o: any = raw ?? {};
|
|
104
|
+
const markName = deriveMarkName(o);
|
|
105
|
+
const hasTheta = !!o?.encoding?.theta;
|
|
106
|
+
|
|
107
|
+
const type = markName === 'arc' || hasTheta ? 'pie' : 'xy';
|
|
108
|
+
|
|
109
|
+
return { ...o, type, archetype: 'vegalite', markName };
|
|
110
|
+
}, VegaLiteCore);
|
|
111
|
+
|
|
112
|
+
export type VegaLite = z.infer<typeof VegaLiteSchema>;
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
import React, { type PropsWithChildren, useEffect, useMemo, useRef, useState } from 'react';
|
|
2
|
+
import { Dimensions, Modal, Platform, Pressable, StyleSheet, View } from 'react-native';
|
|
3
|
+
import {
|
|
4
|
+
Gesture,
|
|
5
|
+
GestureDetector,
|
|
6
|
+
GestureHandlerRootView,
|
|
7
|
+
type GestureType,
|
|
8
|
+
} from 'react-native-gesture-handler';
|
|
9
|
+
import Animated, {
|
|
10
|
+
runOnJS,
|
|
11
|
+
useAnimatedStyle,
|
|
12
|
+
useSharedValue,
|
|
13
|
+
withTiming,
|
|
14
|
+
} from 'react-native-reanimated';
|
|
15
|
+
|
|
16
|
+
import { sheetStoreApi, useBottomSheetState } from '../store';
|
|
17
|
+
|
|
18
|
+
type Props = PropsWithChildren;
|
|
19
|
+
|
|
20
|
+
const { height: SCREEN_H } = Dimensions.get('window');
|
|
21
|
+
const SPRING = { duration: 200 };
|
|
22
|
+
const MAX_BOTTOM_SHEET_HEIGHT = Math.round(SCREEN_H * 0.4);
|
|
23
|
+
const BACKDROP_OPACITY = 0.4;
|
|
24
|
+
|
|
25
|
+
export function BottomSheet({ children }: Props) {
|
|
26
|
+
const { open, height } = useBottomSheetState();
|
|
27
|
+
const [bottomSheetModalOpen, setBottomSheetModalOpen] = useState(open);
|
|
28
|
+
const maxTranslateY = SCREEN_H;
|
|
29
|
+
const translateY = useSharedValue(maxTranslateY);
|
|
30
|
+
|
|
31
|
+
const bottomSheetHeight = useMemo(() => Math.min(height, MAX_BOTTOM_SHEET_HEIGHT), [height]);
|
|
32
|
+
const bottomSheetY = SCREEN_H - bottomSheetHeight;
|
|
33
|
+
|
|
34
|
+
useEffect(() => {
|
|
35
|
+
if (open) {
|
|
36
|
+
setBottomSheetModalOpen(true);
|
|
37
|
+
} else {
|
|
38
|
+
translateY.value = withTiming(maxTranslateY, SPRING, (finished) => {
|
|
39
|
+
if (finished) {
|
|
40
|
+
runOnJS(setBottomSheetModalOpen)(false);
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
}, [setBottomSheetModalOpen, maxTranslateY, open, translateY]);
|
|
45
|
+
|
|
46
|
+
useEffect(() => {
|
|
47
|
+
if (bottomSheetModalOpen && open) {
|
|
48
|
+
translateY.value = withTiming(bottomSheetY, SPRING);
|
|
49
|
+
}
|
|
50
|
+
}, [open, bottomSheetModalOpen, bottomSheetY, translateY]);
|
|
51
|
+
|
|
52
|
+
const dragStartY = useRef(0);
|
|
53
|
+
const panRef = useRef<GestureType | undefined>(undefined);
|
|
54
|
+
const scrollRef = useRef<GestureType | undefined>(undefined);
|
|
55
|
+
|
|
56
|
+
const nativeScroll = useMemo(() => Gesture.Native().withRef(scrollRef), []);
|
|
57
|
+
|
|
58
|
+
const pan = Gesture.Pan()
|
|
59
|
+
.withRef(panRef)
|
|
60
|
+
.requireExternalGestureToFail(scrollRef)
|
|
61
|
+
.onBegin(() => {
|
|
62
|
+
dragStartY.current = 0;
|
|
63
|
+
})
|
|
64
|
+
.onUpdate((e) => {
|
|
65
|
+
if (dragStartY.current === 0) dragStartY.current = translateY.value;
|
|
66
|
+
const next = dragStartY.current + e.translationY;
|
|
67
|
+
const minY = bottomSheetY;
|
|
68
|
+
const maxY = maxTranslateY;
|
|
69
|
+
const overTop = next < minY;
|
|
70
|
+
const overBottom = next > maxY;
|
|
71
|
+
translateY.value = overTop
|
|
72
|
+
? minY - (minY - next) * 0.2
|
|
73
|
+
: overBottom
|
|
74
|
+
? maxY + (next - maxY) * 0.2
|
|
75
|
+
: next;
|
|
76
|
+
})
|
|
77
|
+
.onEnd((e) => {
|
|
78
|
+
// very basic momentum bias
|
|
79
|
+
const projected = e.translationY + e.velocityY * 0.15;
|
|
80
|
+
const nearest = projected >= bottomSheetHeight * 0.5 ? maxTranslateY : bottomSheetY;
|
|
81
|
+
translateY.value = withTiming(nearest, SPRING, (finished) => {
|
|
82
|
+
if (finished && nearest === maxTranslateY) runOnJS(sheetStoreApi.closeSheet)();
|
|
83
|
+
});
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
const backdropStyle = useAnimatedStyle(() => {
|
|
87
|
+
const minY = bottomSheetY;
|
|
88
|
+
const t = 1 - Math.min(1, Math.max(0, (translateY.value - minY) / (maxTranslateY - minY)));
|
|
89
|
+
return {
|
|
90
|
+
opacity: t * BACKDROP_OPACITY,
|
|
91
|
+
pointerEvents: t > 0.02 ? ('auto' as const) : ('none' as const),
|
|
92
|
+
};
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
const sheetStyle = useAnimatedStyle(() => ({
|
|
96
|
+
transform: [{ translateY: translateY.value }],
|
|
97
|
+
}));
|
|
98
|
+
|
|
99
|
+
const sheetContentStyle = useMemo(() => ({ height: bottomSheetHeight }), [bottomSheetHeight]);
|
|
100
|
+
|
|
101
|
+
return (
|
|
102
|
+
<Modal visible={bottomSheetModalOpen} transparent={true}>
|
|
103
|
+
<GestureHandlerRootView style={styles.gestureHandlerRootView}>
|
|
104
|
+
<View style={StyleSheet.absoluteFill} pointerEvents={'box-none'}>
|
|
105
|
+
<Animated.View style={[StyleSheet.absoluteFill, styles.backdrop, backdropStyle]}>
|
|
106
|
+
<Pressable style={StyleSheet.absoluteFill} onPress={sheetStoreApi.closeSheet} />
|
|
107
|
+
</Animated.View>
|
|
108
|
+
|
|
109
|
+
<GestureDetector gesture={pan}>
|
|
110
|
+
<Animated.View style={[styles.sheet, sheetStyle]}>
|
|
111
|
+
<View style={styles.handleContainer} pointerEvents={'none'}>
|
|
112
|
+
<View style={styles.handle} />
|
|
113
|
+
</View>
|
|
114
|
+
|
|
115
|
+
<View style={[styles.content, sheetContentStyle]}>
|
|
116
|
+
<View style={styles.contentContainer}>
|
|
117
|
+
{open ? (
|
|
118
|
+
<GestureDetector gesture={nativeScroll}>{children}</GestureDetector>
|
|
119
|
+
) : null}
|
|
120
|
+
</View>
|
|
121
|
+
</View>
|
|
122
|
+
</Animated.View>
|
|
123
|
+
</GestureDetector>
|
|
124
|
+
</View>
|
|
125
|
+
</GestureHandlerRootView>
|
|
126
|
+
</Modal>
|
|
127
|
+
);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
const styles = StyleSheet.create({
|
|
131
|
+
gestureHandlerRootView: { flex: 1 },
|
|
132
|
+
backdrop: { backgroundColor: '#000' },
|
|
133
|
+
sheet: {
|
|
134
|
+
position: 'absolute',
|
|
135
|
+
overflow: 'hidden',
|
|
136
|
+
left: 0,
|
|
137
|
+
right: 0,
|
|
138
|
+
top: 0,
|
|
139
|
+
height: SCREEN_H,
|
|
140
|
+
transform: [{ translateY: SCREEN_H }],
|
|
141
|
+
borderTopLeftRadius: 20,
|
|
142
|
+
borderTopRightRadius: 20,
|
|
143
|
+
backgroundColor: 'white',
|
|
144
|
+
...Platform.select({
|
|
145
|
+
ios: {
|
|
146
|
+
shadowColor: '#000',
|
|
147
|
+
shadowOpacity: 0.2,
|
|
148
|
+
shadowOffset: { width: 0, height: -4 },
|
|
149
|
+
shadowRadius: 12,
|
|
150
|
+
},
|
|
151
|
+
android: { elevation: 18 },
|
|
152
|
+
}),
|
|
153
|
+
},
|
|
154
|
+
handleContainer: { alignItems: 'center', paddingVertical: 8 },
|
|
155
|
+
handle: { width: 40, height: 4, borderRadius: 2, backgroundColor: '#444' },
|
|
156
|
+
content: { flexGrow: 0 },
|
|
157
|
+
contentContainer: { flex: 1, minHeight: 0 },
|
|
158
|
+
});
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { type PropsWithChildren, useMemo } from 'react';
|
|
2
|
+
import { type LayoutChangeEvent, StyleSheet, View } from 'react-native';
|
|
3
|
+
import { Gesture, GestureDetector } from 'react-native-gesture-handler';
|
|
4
|
+
import Animated, { clamp, scrollTo, useAnimatedRef, useSharedValue } from 'react-native-reanimated';
|
|
5
|
+
|
|
6
|
+
import { useStableCallback } from '../internal/hooks/useStableCallback';
|
|
7
|
+
|
|
8
|
+
export const MarkdownReactiveScrollView = ({ children }: PropsWithChildren) => {
|
|
9
|
+
const scrollViewRef = useAnimatedRef<Animated.ScrollView>();
|
|
10
|
+
const contentWidth = useSharedValue(0);
|
|
11
|
+
const visibleContentWidth = useSharedValue(0);
|
|
12
|
+
const offsetBeforeScroll = useSharedValue(0);
|
|
13
|
+
const touchStart = useSharedValue<{ x: number; y: number } | null>(null);
|
|
14
|
+
|
|
15
|
+
const panGesture = useMemo(
|
|
16
|
+
() =>
|
|
17
|
+
Gesture.Pan()
|
|
18
|
+
.onBegin((event) => {
|
|
19
|
+
touchStart.value = { x: event.x, y: event.y };
|
|
20
|
+
})
|
|
21
|
+
.onTouchesMove((event, state) => {
|
|
22
|
+
if (!touchStart.value || !event.changedTouches.length) {
|
|
23
|
+
state.fail();
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const xDiff = Math.abs(event.changedTouches[0]!.x - touchStart.value.x);
|
|
28
|
+
const yDiff = Math.abs(event.changedTouches[0]!.y - touchStart.value.y);
|
|
29
|
+
const isHorizontalPanning = xDiff > yDiff;
|
|
30
|
+
|
|
31
|
+
if (isHorizontalPanning) {
|
|
32
|
+
state.activate();
|
|
33
|
+
} else {
|
|
34
|
+
state.fail();
|
|
35
|
+
}
|
|
36
|
+
})
|
|
37
|
+
.onUpdate((event) => {
|
|
38
|
+
const { translationX } = event;
|
|
39
|
+
|
|
40
|
+
scrollTo(scrollViewRef, offsetBeforeScroll.value - translationX, 0, false);
|
|
41
|
+
})
|
|
42
|
+
.onEnd((event) => {
|
|
43
|
+
const { translationX } = event;
|
|
44
|
+
|
|
45
|
+
const velocityEffect = event.velocityX * 0.3;
|
|
46
|
+
|
|
47
|
+
const finalPosition = clamp(
|
|
48
|
+
offsetBeforeScroll.value - translationX - velocityEffect,
|
|
49
|
+
0,
|
|
50
|
+
contentWidth.value - visibleContentWidth.value,
|
|
51
|
+
);
|
|
52
|
+
|
|
53
|
+
offsetBeforeScroll.value = finalPosition;
|
|
54
|
+
|
|
55
|
+
scrollTo(scrollViewRef, finalPosition, 0, true);
|
|
56
|
+
}),
|
|
57
|
+
[contentWidth, offsetBeforeScroll, scrollViewRef, touchStart, visibleContentWidth],
|
|
58
|
+
);
|
|
59
|
+
|
|
60
|
+
const onContentSizeChange = useStableCallback((width: number) => {
|
|
61
|
+
contentWidth.value = width;
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
const onLayout = useStableCallback((event: LayoutChangeEvent) => {
|
|
65
|
+
visibleContentWidth.value = event.nativeEvent.layout.width;
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
return (
|
|
69
|
+
<View style={styles.wrapper}>
|
|
70
|
+
<GestureDetector gesture={panGesture}>
|
|
71
|
+
<Animated.ScrollView
|
|
72
|
+
contentContainerStyle={styles.contentContainer}
|
|
73
|
+
horizontal
|
|
74
|
+
nestedScrollEnabled={true}
|
|
75
|
+
onContentSizeChange={onContentSizeChange}
|
|
76
|
+
onLayout={onLayout}
|
|
77
|
+
ref={scrollViewRef}
|
|
78
|
+
scrollEnabled={false}
|
|
79
|
+
>
|
|
80
|
+
{children}
|
|
81
|
+
</Animated.ScrollView>
|
|
82
|
+
</GestureDetector>
|
|
83
|
+
</View>
|
|
84
|
+
);
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
const styles = StyleSheet.create({
|
|
88
|
+
wrapper: {
|
|
89
|
+
width: '100%',
|
|
90
|
+
},
|
|
91
|
+
contentContainer: { flexGrow: 1 },
|
|
92
|
+
});
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import React, { type PropsWithChildren, useMemo, useState } from 'react';
|
|
2
|
+
|
|
3
|
+
import type { StateStore } from '@stream-io/state-store';
|
|
4
|
+
|
|
5
|
+
import { useStableCallback } from '../internal/hooks/useStableCallback';
|
|
6
|
+
import type { ComposerViewProps } from '../message-composer';
|
|
7
|
+
import { MediaPickerService } from '../services';
|
|
8
|
+
import type { AbstractMediaPickerService } from '../services/media-picker-service/AbstractMediaPickerService';
|
|
9
|
+
import { type ComposerState, createNewComposerStore } from '../store';
|
|
10
|
+
|
|
11
|
+
export type ComposerContext = {
|
|
12
|
+
state: StateStore<ComposerState>;
|
|
13
|
+
setText: (text: string) => void | Promise<void>;
|
|
14
|
+
sendMessage: () => void | Promise<void>;
|
|
15
|
+
mediaPickerService?: AbstractMediaPickerService;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export type ComposerContextProps = PropsWithChildren<
|
|
19
|
+
Pick<ComposerViewProps, 'onSendMessage' | 'mediaPickerService' | 'state'>
|
|
20
|
+
>;
|
|
21
|
+
|
|
22
|
+
export const ComposerContext = React.createContext<ComposerContext | undefined>(undefined);
|
|
23
|
+
|
|
24
|
+
export const ComposerProvider = ({
|
|
25
|
+
onSendMessage,
|
|
26
|
+
mediaPickerService: mediaPickerServiceOverride,
|
|
27
|
+
state: stateOverride,
|
|
28
|
+
children,
|
|
29
|
+
}: ComposerContextProps) => {
|
|
30
|
+
const [mediaPickerService] = useState(
|
|
31
|
+
() => mediaPickerServiceOverride ?? (MediaPickerService ? new MediaPickerService() : undefined),
|
|
32
|
+
);
|
|
33
|
+
const [state] = useState(() => stateOverride ?? createNewComposerStore());
|
|
34
|
+
|
|
35
|
+
const setText = useStableCallback((text: string) => state.partialNext({ text }));
|
|
36
|
+
|
|
37
|
+
const clearState = useStableCallback(() => {
|
|
38
|
+
setText('');
|
|
39
|
+
mediaPickerService?.clearAssets();
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
const sendMessage = useStableCallback(async () => {
|
|
43
|
+
const { text, custom } = state.getLatestValue();
|
|
44
|
+
|
|
45
|
+
const data = {
|
|
46
|
+
text,
|
|
47
|
+
attachments: mediaPickerService?.state.getLatestValue().assets,
|
|
48
|
+
custom,
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
clearState();
|
|
52
|
+
|
|
53
|
+
await onSendMessage(data);
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
const contextValue = useMemo(
|
|
57
|
+
() => ({ mediaPickerService, state, setText, sendMessage, clearState }),
|
|
58
|
+
[state, mediaPickerService, setText, sendMessage, clearState],
|
|
59
|
+
);
|
|
60
|
+
|
|
61
|
+
return <ComposerContext.Provider value={contextValue}>{children}</ComposerContext.Provider>;
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
export const useMessageComposerContext = () => {
|
|
65
|
+
const value = React.useContext(ComposerContext);
|
|
66
|
+
if (value === undefined) {
|
|
67
|
+
throw new Error(
|
|
68
|
+
'The useMessageComposerContext hook was called outside of the ComposerContext provider.',
|
|
69
|
+
);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
return value;
|
|
73
|
+
};
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import React, { createContext, type PropsWithChildren, useContext, useMemo } from 'react';
|
|
2
|
+
|
|
3
|
+
import merge from 'lodash/merge';
|
|
4
|
+
|
|
5
|
+
import { defaultTheme, type Theme } from '../theme';
|
|
6
|
+
|
|
7
|
+
export type DeepPartial<T> = T extends (...args: never[]) => unknown
|
|
8
|
+
? T
|
|
9
|
+
: T extends object
|
|
10
|
+
? { [K in keyof T]?: DeepPartial<T[K]> }
|
|
11
|
+
: T;
|
|
12
|
+
|
|
13
|
+
export type StreamThemeInputValue = {
|
|
14
|
+
mergedStyle?: Theme;
|
|
15
|
+
style?: DeepPartial<Theme>;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export type MergedThemesParams = {
|
|
19
|
+
style?: DeepPartial<Theme>;
|
|
20
|
+
theme?: Theme;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export type ThemeContextValue = {
|
|
24
|
+
theme: Theme;
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export const mergeThemes = (params: MergedThemesParams) => {
|
|
28
|
+
const { style, theme } = params;
|
|
29
|
+
// TODO: Use structured-clone here or something similar.
|
|
30
|
+
const finalTheme = (
|
|
31
|
+
!theme || Object.keys(theme).length === 0
|
|
32
|
+
? JSON.parse(JSON.stringify(defaultTheme))
|
|
33
|
+
: JSON.parse(JSON.stringify(theme))
|
|
34
|
+
) as Theme;
|
|
35
|
+
|
|
36
|
+
if (style) {
|
|
37
|
+
merge(finalTheme, style);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
return finalTheme;
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
export const ThemeContext = createContext<Theme | undefined>(undefined);
|
|
44
|
+
|
|
45
|
+
export const StreamTheme = (
|
|
46
|
+
props: PropsWithChildren<StreamThemeInputValue & Partial<ThemeContextValue>>,
|
|
47
|
+
) => {
|
|
48
|
+
const { children, mergedStyle, style, theme } = props;
|
|
49
|
+
|
|
50
|
+
const modifiedTheme = useMemo(() => {
|
|
51
|
+
if (mergedStyle) {
|
|
52
|
+
return mergedStyle;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
return mergeThemes({ style, theme });
|
|
56
|
+
}, [mergedStyle, style, theme]);
|
|
57
|
+
|
|
58
|
+
return <ThemeContext.Provider value={modifiedTheme}>{children}</ThemeContext.Provider>;
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
export const useTheme = () => {
|
|
62
|
+
const theme = useContext(ThemeContext);
|
|
63
|
+
|
|
64
|
+
if (theme === undefined) {
|
|
65
|
+
throw new Error('The useTheme hook was called outside the StreamTheme Provider.');
|
|
66
|
+
}
|
|
67
|
+
return { theme };
|
|
68
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
// primitives
|
|
2
|
+
export * from './markdown';
|
|
3
|
+
export * from './syntax-highlighting';
|
|
4
|
+
export * from './charts';
|
|
5
|
+
export * from './message-composer';
|
|
6
|
+
export * from './StreamingMessageView';
|
|
7
|
+
export * from './AITypingIndicatorView';
|
|
8
|
+
|
|
9
|
+
// components
|
|
10
|
+
export * from './components';
|
|
11
|
+
|
|
12
|
+
// contexts
|
|
13
|
+
export * from './contexts';
|
|
14
|
+
|
|
15
|
+
// services
|
|
16
|
+
export * from './services';
|
|
17
|
+
export * from './transcription/useDictation';
|
|
18
|
+
export { isDictationAvailable } from './native/AIDictation';
|
|
19
|
+
|
|
20
|
+
// state-stores
|
|
21
|
+
export * from './store';
|
|
22
|
+
|
|
23
|
+
// theme
|
|
24
|
+
export * from './theme';
|
|
25
|
+
|
|
26
|
+
// Native handler registration, used by the `stream-chat-react-native/ai-components` and
|
|
27
|
+
// `stream-chat-expo/ai-components` entry points to register only the native pieces this entry
|
|
28
|
+
// point needs (without importing, and therefore bundling, the main SDK entry point).
|
|
29
|
+
export { registerNativeHandlers } from '../native';
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { useCallback, useRef } from 'react';
|
|
2
|
+
|
|
3
|
+
export type StableCallback<A extends unknown[], R> = (...args: A) => R;
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* A utility hook implementing a stable callback. It takes in an unstable method that
|
|
7
|
+
* is supposed to be invoked somewhere deeper in the DOM tree without making it
|
|
8
|
+
* change its reference every time the parent component rerenders. It will also return
|
|
9
|
+
* the value of the callback if it does return one.
|
|
10
|
+
* A common use-case would be having a function whose invocation depends on state
|
|
11
|
+
* somewhere high up in the DOM tree and wanting to use the same function deeper
|
|
12
|
+
* down, for example in a leaf node and simply using useCallback results in
|
|
13
|
+
* cascading dependency hell. If we wrap it in useStableCallback, we would be able
|
|
14
|
+
* to:
|
|
15
|
+
* - Use the same function as a dependency of another hook (since it is stable)
|
|
16
|
+
* - Still invoke it and get the latest state
|
|
17
|
+
*
|
|
18
|
+
* **Caveats:**
|
|
19
|
+
* - Never wrap a function that is supposed to return a React.ReactElement in
|
|
20
|
+
* useStableCallback, since React will not know that the DOM needs to be updated
|
|
21
|
+
* whenever the callback value changes (for example, renderItem from FlatList must
|
|
22
|
+
* never be wrapped in this hook)
|
|
23
|
+
* - Always prefer using a standard useCallback/stable function wherever possible
|
|
24
|
+
* (the purpose of useStableCallback is to bridge the gap between top level contexts
|
|
25
|
+
* and cascading rereders in downstream components - **not** as an escape hatch)
|
|
26
|
+
* @param callback - the callback we want to stabilize
|
|
27
|
+
*/
|
|
28
|
+
export const useStableCallback = <A extends unknown[], R>(
|
|
29
|
+
callback: StableCallback<A, R>,
|
|
30
|
+
): StableCallback<A, R> => {
|
|
31
|
+
const ref = useRef(callback);
|
|
32
|
+
ref.current = callback;
|
|
33
|
+
|
|
34
|
+
return useCallback<StableCallback<A, R>>((...args) => {
|
|
35
|
+
return ref.current(...args);
|
|
36
|
+
}, []);
|
|
37
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
import { type IconProps, RootPath, RootSvg } from './utils/base';
|
|
4
|
+
|
|
5
|
+
export const Camera = (props: IconProps) => (
|
|
6
|
+
<RootSvg {...props}>
|
|
7
|
+
<RootPath
|
|
8
|
+
d='M15 3H9L7 5H3a1 1 0 00-1 1v14a1 1 0 001 1h18a1 1 0 001-1V6a1 1 0 00-1-1h-4l-2-2zM7.828 7l2-2h4.344l2 2H20v12H4V7h3.828zM12 18a5.5 5.5 0 110-11 5.5 5.5 0 010 11zm3.5-5.5a3.5 3.5 0 11-7 0 3.5 3.5 0 017 0z'
|
|
9
|
+
{...props}
|
|
10
|
+
/>
|
|
11
|
+
</RootSvg>
|
|
12
|
+
);
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
import { Path, Svg } from 'react-native-svg';
|
|
4
|
+
|
|
5
|
+
import type { IconProps } from './utils/base';
|
|
6
|
+
|
|
7
|
+
type Props = IconProps & {
|
|
8
|
+
size: number;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export const CircleStop = ({ size, ...rest }: Props) => (
|
|
12
|
+
<Svg fill={'none'} height={size} viewBox={`0 0 ${size} ${size}`} width={size}>
|
|
13
|
+
<Path
|
|
14
|
+
d='M16.4551 27.2441C22.6309 27.2441 27.7441 22.1198 27.7441 15.9551C27.7441 9.7793 22.6198 4.66602 16.444 4.66602C10.2793 4.66602 5.16602 9.7793 5.16602 15.9551C5.16602 22.1198 10.2904 27.2441 16.4551 27.2441ZM16.4551 25.3626C11.2311 25.3626 7.05859 21.179 7.05859 15.9551C7.05859 10.7311 11.2201 6.54753 16.444 6.54753C21.668 6.54753 25.8516 10.7311 25.8626 15.9551C25.8737 21.179 21.679 25.3626 16.4551 25.3626ZM13.5221 19.9837H19.3659C20.0632 19.9837 20.4727 19.5742 20.4727 18.8991V13.0111C20.4727 12.3249 20.0632 11.9264 19.3659 11.9264H13.5221C12.8359 11.9264 12.4154 12.3249 12.4154 13.0111V18.8991C12.4154 19.5742 12.8359 19.9837 13.5221 19.9837Z'
|
|
15
|
+
{...rest}
|
|
16
|
+
/>
|
|
17
|
+
</Svg>
|
|
18
|
+
);
|