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,163 @@
|
|
|
1
|
+
import type { JSX } from 'react';
|
|
2
|
+
import type React from 'react';
|
|
3
|
+
import { type PropsWithChildren } from 'react';
|
|
4
|
+
import type {
|
|
5
|
+
GestureResponderEvent,
|
|
6
|
+
ImageStyle,
|
|
7
|
+
TextProps,
|
|
8
|
+
TextStyle,
|
|
9
|
+
ViewStyle,
|
|
10
|
+
} from 'react-native';
|
|
11
|
+
|
|
12
|
+
import type SimpleMarkdown from '@khanacademy/simple-markdown';
|
|
13
|
+
import type { Output } from '@khanacademy/simple-markdown';
|
|
14
|
+
import type {
|
|
15
|
+
ParserRule,
|
|
16
|
+
ReactOutputRule,
|
|
17
|
+
SingleASTNode,
|
|
18
|
+
State,
|
|
19
|
+
} from '@khanacademy/simple-markdown';
|
|
20
|
+
|
|
21
|
+
import type { DeepPartial } from '../contexts';
|
|
22
|
+
|
|
23
|
+
export type LinkInfo = {
|
|
24
|
+
raw: string;
|
|
25
|
+
url: string;
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export type ReactOutput = Output<React.ReactNode>;
|
|
29
|
+
|
|
30
|
+
export type DefaultRules = typeof SimpleMarkdown.defaultRules & {
|
|
31
|
+
[key: string]: ParserRule & ReactOutputRule;
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
export type MarkdownRules = DeepPartial<DefaultRules>;
|
|
35
|
+
|
|
36
|
+
export type MarkdownProps = {
|
|
37
|
+
onLink?: (url: string) => void | Promise<void>;
|
|
38
|
+
rules?: MarkdownRules;
|
|
39
|
+
styles?: MarkdownStyle;
|
|
40
|
+
paragraphNumberOfLines?: number;
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
export type MarkdownOptions = Partial<Pick<MarkdownProps, 'onLink' | 'paragraphNumberOfLines'>>;
|
|
44
|
+
|
|
45
|
+
export type MarkdownStyleProp = TextStyle | ViewStyle;
|
|
46
|
+
|
|
47
|
+
export type MarkdownState = State & {
|
|
48
|
+
withinText?: boolean;
|
|
49
|
+
withinQuote?: boolean;
|
|
50
|
+
withinHeading?: boolean;
|
|
51
|
+
withinLink?: boolean;
|
|
52
|
+
withinList?: boolean;
|
|
53
|
+
withinParagraphWithImage?: boolean;
|
|
54
|
+
parentLink?: string;
|
|
55
|
+
style: MarkdownStyleProp;
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
export type NodeWithContent = SingleASTNode & { content: SingleASTNode[] };
|
|
59
|
+
export type NodeWithStringContent = SingleASTNode & { content: string };
|
|
60
|
+
export type HeadingNode = SingleASTNode & {
|
|
61
|
+
level: number;
|
|
62
|
+
content: SingleASTNode[];
|
|
63
|
+
};
|
|
64
|
+
export type ListNode = SingleASTNode & {
|
|
65
|
+
ordered: boolean;
|
|
66
|
+
items: SingleASTNode[] | SingleASTNode[][];
|
|
67
|
+
};
|
|
68
|
+
export type TableNode = SingleASTNode & {
|
|
69
|
+
header: SingleASTNode[];
|
|
70
|
+
cells: SingleASTNode[][];
|
|
71
|
+
};
|
|
72
|
+
export type TargetNode = SingleASTNode & { target: string };
|
|
73
|
+
|
|
74
|
+
// Allow dynamic heading style access like styles["heading1"]
|
|
75
|
+
export type HeadingLevel = 1 | 2 | 3 | 4 | 5 | 6 | undefined;
|
|
76
|
+
|
|
77
|
+
export type MarkdownStyle = Partial<{
|
|
78
|
+
autolink: TextStyle;
|
|
79
|
+
blockQuoteBar: ViewStyle;
|
|
80
|
+
blockQuoteSection: ViewStyle;
|
|
81
|
+
blockQuoteSectionBar: ViewStyle;
|
|
82
|
+
blockQuoteText: TextStyle | ViewStyle;
|
|
83
|
+
br: TextStyle;
|
|
84
|
+
codeBlock: TextStyle;
|
|
85
|
+
codeBlockLineNumberGutter: ViewStyle;
|
|
86
|
+
codeBlockContainer: ViewStyle;
|
|
87
|
+
codeBlockWrapper: ViewStyle;
|
|
88
|
+
codeBlockLineNumberCell: TextStyle;
|
|
89
|
+
codeBlockHeaderContainer: ViewStyle;
|
|
90
|
+
codeBlockHeaderTitle: TextStyle;
|
|
91
|
+
del: TextStyle;
|
|
92
|
+
em: TextStyle;
|
|
93
|
+
heading: TextStyle;
|
|
94
|
+
heading1: TextStyle;
|
|
95
|
+
heading2: TextStyle;
|
|
96
|
+
heading3: TextStyle;
|
|
97
|
+
heading4: TextStyle;
|
|
98
|
+
heading5: TextStyle;
|
|
99
|
+
heading6: TextStyle;
|
|
100
|
+
hr: ViewStyle;
|
|
101
|
+
image: ImageStyle;
|
|
102
|
+
inlineCode: TextStyle;
|
|
103
|
+
list: ViewStyle;
|
|
104
|
+
listItem: ViewStyle;
|
|
105
|
+
listItemBullet: TextStyle;
|
|
106
|
+
listItemNumber: TextStyle;
|
|
107
|
+
listItemText: TextStyle;
|
|
108
|
+
listRow: ViewStyle;
|
|
109
|
+
mailTo: TextStyle;
|
|
110
|
+
mentions: TextStyle;
|
|
111
|
+
newline: TextStyle;
|
|
112
|
+
noMargin: TextStyle;
|
|
113
|
+
paragraph: TextStyle;
|
|
114
|
+
paragraphCenter: TextStyle;
|
|
115
|
+
paragraphWithImage: ViewStyle;
|
|
116
|
+
strong: TextStyle;
|
|
117
|
+
sublist: ViewStyle;
|
|
118
|
+
table: ViewStyle;
|
|
119
|
+
tableHeader: ViewStyle;
|
|
120
|
+
tableHeaderCell: TextStyle;
|
|
121
|
+
tableRow: ViewStyle;
|
|
122
|
+
tableRowCell: TextStyle;
|
|
123
|
+
tableRowLast: ViewStyle;
|
|
124
|
+
text: TextStyle;
|
|
125
|
+
u: TextStyle;
|
|
126
|
+
url: TextStyle;
|
|
127
|
+
view: ViewStyle;
|
|
128
|
+
}>;
|
|
129
|
+
|
|
130
|
+
export interface MarkdownOutputProps {
|
|
131
|
+
node: SingleASTNode;
|
|
132
|
+
output: ReactOutput;
|
|
133
|
+
state: State;
|
|
134
|
+
styles: Partial<MarkdownStyle>;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
export type MarkdownComponentProps = PropsWithChildren<RuleRenderFunctionProps>;
|
|
138
|
+
|
|
139
|
+
export interface MarkdownTableRowProps extends MarkdownOutputProps {
|
|
140
|
+
items: SingleASTNode[];
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
export interface BulletProps extends TextProps {
|
|
144
|
+
index?: number;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
export type RuleOutputProps = {
|
|
148
|
+
node: SingleASTNode;
|
|
149
|
+
output: ReactOutput;
|
|
150
|
+
state: MarkdownState;
|
|
151
|
+
};
|
|
152
|
+
|
|
153
|
+
export type RuleRenderFunctionEnrichedProps = {
|
|
154
|
+
styles: MarkdownStyle;
|
|
155
|
+
onPress?: (event: GestureResponderEvent) => void;
|
|
156
|
+
onLongPress?: (event: GestureResponderEvent) => void;
|
|
157
|
+
onLink?: (url: string) => void;
|
|
158
|
+
paragraphNumberOfLines?: number;
|
|
159
|
+
};
|
|
160
|
+
|
|
161
|
+
export type RuleRenderFunctionProps = RuleOutputProps & RuleRenderFunctionEnrichedProps;
|
|
162
|
+
|
|
163
|
+
export type RuleRenderFunction = (props: RuleRenderFunctionProps) => JSX.Element;
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import { find } from 'linkifyjs';
|
|
2
|
+
import truncate from 'lodash/truncate';
|
|
3
|
+
|
|
4
|
+
import type { LinkInfo } from '../index';
|
|
5
|
+
|
|
6
|
+
export function escapeRegExp(text: string) {
|
|
7
|
+
return text.replace(/[-[\]{}()*+?.,/\\^$|#]/g, '\\$&');
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* This is done to remove all markdown formatted links.
|
|
12
|
+
* eg: [google.com](https://www.google.com), [Google](https://www.google.com), [https://www.google.com](https://www.google.com)
|
|
13
|
+
* */
|
|
14
|
+
const removeMarkdownLinksFromText = (input: string) => input.replace(/\[.*\]\(.*\)/g, '');
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* This is done to avoid parsing usernames with dot as well as an email address in it.
|
|
18
|
+
*/
|
|
19
|
+
const removeUserNamesWithEmailFromText = (input: string) =>
|
|
20
|
+
input.replace(/@(\w+(\.\w+)?)(@\w+\.\w+)/g, '');
|
|
21
|
+
|
|
22
|
+
export const parseLinksFromText = (input?: string): LinkInfo[] => {
|
|
23
|
+
if (!input) {
|
|
24
|
+
return [];
|
|
25
|
+
}
|
|
26
|
+
const strippedInput = [removeMarkdownLinksFromText, removeUserNamesWithEmailFromText].reduce(
|
|
27
|
+
(acc, fn) => fn(acc),
|
|
28
|
+
input,
|
|
29
|
+
);
|
|
30
|
+
|
|
31
|
+
const links = find(strippedInput, 'url');
|
|
32
|
+
const emails = find(strippedInput, 'email');
|
|
33
|
+
|
|
34
|
+
const result: LinkInfo[] = [...links, ...emails].map(({ href, value }) => {
|
|
35
|
+
let hrefWithProtocol = href;
|
|
36
|
+
// Matching these: https://reactnative.dev/docs/0.73/linking?syntax=ios#built-in-url-schemes
|
|
37
|
+
const pattern = new RegExp(/^(mailto:|tel:|sms:|\S+:\/\/)/);
|
|
38
|
+
if (!pattern.test(hrefWithProtocol)) {
|
|
39
|
+
hrefWithProtocol = 'http://' + hrefWithProtocol;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
return {
|
|
43
|
+
raw: value,
|
|
44
|
+
url: hrefWithProtocol,
|
|
45
|
+
};
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
return result;
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
export const generateMarkdownText = (text?: string) => {
|
|
52
|
+
if (!text) {
|
|
53
|
+
return null;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
// Trim the extra spaces from the text.
|
|
57
|
+
let resultText = text;
|
|
58
|
+
|
|
59
|
+
// List of all the links present in the text.
|
|
60
|
+
const linkInfos = parseLinksFromText(resultText);
|
|
61
|
+
|
|
62
|
+
for (const linkInfo of linkInfos) {
|
|
63
|
+
const displayLink = truncate(linkInfo.raw, {
|
|
64
|
+
length: 200,
|
|
65
|
+
omission: '...',
|
|
66
|
+
});
|
|
67
|
+
// Convert raw links/emails in the text to respective markdown syntax.
|
|
68
|
+
// Eg: Hi @getstream.io -> Hi @[getstream.io](getstream.io).
|
|
69
|
+
const normalRegEx = new RegExp(escapeRegExp(linkInfo.raw), 'g');
|
|
70
|
+
const markdown = `[${displayLink}](${linkInfo.url})`;
|
|
71
|
+
resultText = resultText.replace(normalRegEx, markdown);
|
|
72
|
+
|
|
73
|
+
// After previous step, in some cases, the mentioned user after `@` might have a link/email so we convert it back to normal raw text.
|
|
74
|
+
// Eg: Hi, @[test.user@gmail.com](mailto:test.user@gmail.com) to @test.user@gmail.com.
|
|
75
|
+
const mentionsRegex = new RegExp(
|
|
76
|
+
`@\\[${escapeRegExp(displayLink)}\\]\\(${escapeRegExp(linkInfo.url)}\\)`,
|
|
77
|
+
'g',
|
|
78
|
+
);
|
|
79
|
+
resultText = resultText.replace(mentionsRegex, `@${displayLink}`);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
// Remove whitespaces that come directly after newlines except in code blocks where we deem this allowed.
|
|
83
|
+
// A line starts a (possibly quoted) list item if, after indentation, it has
|
|
84
|
+
// - unordered bullet: -, *, +
|
|
85
|
+
// - or ordered marker: 1. 2. 10.
|
|
86
|
+
// and at least one space after the marker.
|
|
87
|
+
const LIST_START_RE = /^[ \t]*(?:> ?)*?(?:[*+-]|\d+\.)(?: |\t)(?:\[(?: |x|X)\] )?/;
|
|
88
|
+
|
|
89
|
+
resultText = resultText.replace(
|
|
90
|
+
// 1) fenced code blocks (``` <some code here> ```)
|
|
91
|
+
// 2) inline code (`…`)
|
|
92
|
+
// 3) newline + 2 + spaces/tabs
|
|
93
|
+
/(```[\s\S]*?```|`[^`]*?`)|\n([ \t]{2,})/g,
|
|
94
|
+
(match, code, spaces, offset, full) => {
|
|
95
|
+
// Preserve code spans / fences exactly as they are
|
|
96
|
+
if (code) return code;
|
|
97
|
+
|
|
98
|
+
// Peek what follows this newline + the indent on the same line
|
|
99
|
+
const after = full.slice(offset + match.length);
|
|
100
|
+
|
|
101
|
+
// If that line begins with a list item (any nesting depth, optional > quotes),
|
|
102
|
+
// keep the indentation; otherwise collapse to a single newline.
|
|
103
|
+
return LIST_START_RE.test(after) ? `\n${spaces}` : '\n';
|
|
104
|
+
},
|
|
105
|
+
);
|
|
106
|
+
|
|
107
|
+
// Always replace \n``` with \n\n``` to force the markdown state machine to treat it as a separate block. Otherwise, code blocks inside of list
|
|
108
|
+
// items for example were broken. We clean up the code block closing state within the rendering itself.
|
|
109
|
+
resultText = resultText.replace(/\n```/g, '\n\n```\n');
|
|
110
|
+
|
|
111
|
+
const codeBlockCounts = (resultText.match(/```/g) || []).length;
|
|
112
|
+
if (codeBlockCounts % 2 > 0) {
|
|
113
|
+
resultText += '```';
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
return resultText;
|
|
117
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './generate-markdown-text';
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import React, { useMemo } from 'react';
|
|
2
|
+
import { Pressable, StyleSheet, View } from 'react-native';
|
|
3
|
+
import Animated, { ZoomIn, ZoomOut } from 'react-native-reanimated';
|
|
4
|
+
|
|
5
|
+
import { useStateStore } from '@stream-io/state-store/react-bindings';
|
|
6
|
+
|
|
7
|
+
import type { ComposerViewProps } from './ComposerView';
|
|
8
|
+
|
|
9
|
+
import { SpeechToTextButton } from './SpeechToTextButton';
|
|
10
|
+
|
|
11
|
+
import { useMessageComposerContext, useTheme } from '../contexts';
|
|
12
|
+
import { CircleStop } from '../internal/icons/CircleStop';
|
|
13
|
+
import { SendUp } from '../internal/icons/SendUp';
|
|
14
|
+
import { dictationStore, type DictationStoreState, useComposerHasText } from '../store';
|
|
15
|
+
|
|
16
|
+
const selector = ({ isRecording }: DictationStoreState) => ({
|
|
17
|
+
isRecording,
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
export const ActionButton = ({
|
|
21
|
+
isGenerating,
|
|
22
|
+
stopGenerating,
|
|
23
|
+
}: Pick<ComposerViewProps, 'isGenerating' | 'stopGenerating'>) => {
|
|
24
|
+
const { hasText } = useComposerHasText();
|
|
25
|
+
const { isRecording } = useStateStore(dictationStore, selector);
|
|
26
|
+
const { sendMessage } = useMessageComposerContext();
|
|
27
|
+
const {
|
|
28
|
+
theme: {
|
|
29
|
+
colors: { black, white },
|
|
30
|
+
composer: { iconButton, stopGeneratingIcon, sendIcon },
|
|
31
|
+
},
|
|
32
|
+
} = useTheme();
|
|
33
|
+
const styles = useStyles();
|
|
34
|
+
|
|
35
|
+
if (isGenerating) {
|
|
36
|
+
return (
|
|
37
|
+
<Animated.View
|
|
38
|
+
key={'stop-generating'}
|
|
39
|
+
entering={ZoomIn.duration(250)}
|
|
40
|
+
exiting={ZoomOut.duration(250)}
|
|
41
|
+
>
|
|
42
|
+
<Pressable style={[styles.iconButton, iconButton]} onPress={stopGenerating}>
|
|
43
|
+
<View style={[styles.stopGeneratingIcon, stopGeneratingIcon]}>
|
|
44
|
+
<CircleStop fill={black} size={32} />
|
|
45
|
+
</View>
|
|
46
|
+
</Pressable>
|
|
47
|
+
</Animated.View>
|
|
48
|
+
);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
return hasText && !isRecording ? (
|
|
52
|
+
<Animated.View
|
|
53
|
+
key={'send-button'}
|
|
54
|
+
entering={ZoomIn.duration(250)}
|
|
55
|
+
exiting={ZoomOut.duration(250)}
|
|
56
|
+
>
|
|
57
|
+
<Pressable style={[styles.iconButton, iconButton]} onPress={sendMessage}>
|
|
58
|
+
<View style={[styles.sendIcon, sendIcon]}>
|
|
59
|
+
<SendUp pathFill={white} size={24} />
|
|
60
|
+
</View>
|
|
61
|
+
</Pressable>
|
|
62
|
+
</Animated.View>
|
|
63
|
+
) : (
|
|
64
|
+
<SpeechToTextButton />
|
|
65
|
+
);
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
const useStyles = () => {
|
|
69
|
+
const { theme } = useTheme();
|
|
70
|
+
|
|
71
|
+
return useMemo(
|
|
72
|
+
() =>
|
|
73
|
+
StyleSheet.create({
|
|
74
|
+
micIcon: {
|
|
75
|
+
width: 32,
|
|
76
|
+
height: 32,
|
|
77
|
+
justifyContent: 'center',
|
|
78
|
+
alignItems: 'center',
|
|
79
|
+
},
|
|
80
|
+
sendIcon: {
|
|
81
|
+
width: 32,
|
|
82
|
+
height: 32,
|
|
83
|
+
backgroundColor: theme.colors.black,
|
|
84
|
+
borderRadius: 16,
|
|
85
|
+
},
|
|
86
|
+
stopGeneratingIcon: {
|
|
87
|
+
width: 32,
|
|
88
|
+
height: 32,
|
|
89
|
+
backgroundColor: theme.colors.transparent,
|
|
90
|
+
borderRadius: 16,
|
|
91
|
+
},
|
|
92
|
+
iconButton: {
|
|
93
|
+
justifyContent: 'center',
|
|
94
|
+
alignItems: 'center',
|
|
95
|
+
},
|
|
96
|
+
}),
|
|
97
|
+
[theme],
|
|
98
|
+
);
|
|
99
|
+
};
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
import React, { useCallback, useMemo } from 'react';
|
|
2
|
+
import { Pressable, ScrollView, StyleSheet, Text, View } from 'react-native';
|
|
3
|
+
|
|
4
|
+
import type { BottomSheetOption, ComposerViewProps } from './ComposerView';
|
|
5
|
+
|
|
6
|
+
import { withCloseSheet } from './utils/withCloseSheet';
|
|
7
|
+
|
|
8
|
+
import { useMessageComposerContext, useTheme } from '../contexts';
|
|
9
|
+
import { Camera } from '../internal/icons/Camera';
|
|
10
|
+
import { Picture } from '../internal/icons/Picture';
|
|
11
|
+
import { sheetStoreApi } from '../store';
|
|
12
|
+
|
|
13
|
+
type BottomSheetContentProps = Pick<ComposerViewProps, 'bottomSheetOptions' | 'bottomSheetInsets'>;
|
|
14
|
+
|
|
15
|
+
export const BottomSheetContent = ({
|
|
16
|
+
bottomSheetOptions,
|
|
17
|
+
bottomSheetInsets,
|
|
18
|
+
}: BottomSheetContentProps) => {
|
|
19
|
+
const {
|
|
20
|
+
theme: {
|
|
21
|
+
sheet: { contentContainer, quickActionsCard, divider, listSection },
|
|
22
|
+
},
|
|
23
|
+
} = useTheme();
|
|
24
|
+
const styles = useStyles();
|
|
25
|
+
|
|
26
|
+
const { mediaPickerService } = useMessageComposerContext();
|
|
27
|
+
|
|
28
|
+
const onContentSizeChange = useCallback(
|
|
29
|
+
(_: unknown, height: number) => sheetStoreApi.setHeight(height),
|
|
30
|
+
[],
|
|
31
|
+
);
|
|
32
|
+
|
|
33
|
+
const insetStyle = useMemo(
|
|
34
|
+
() => ({ paddingBottom: 16 + (bottomSheetInsets?.bottom ?? 0) }),
|
|
35
|
+
[bottomSheetInsets],
|
|
36
|
+
);
|
|
37
|
+
|
|
38
|
+
return (
|
|
39
|
+
<ScrollView
|
|
40
|
+
contentContainerStyle={[styles.contentContainer, insetStyle, contentContainer]}
|
|
41
|
+
showsVerticalScrollIndicator={false}
|
|
42
|
+
onContentSizeChange={onContentSizeChange}
|
|
43
|
+
>
|
|
44
|
+
<View style={[styles.quickActionsCard, quickActionsCard]}>
|
|
45
|
+
<QuickActionButton
|
|
46
|
+
label={'Camera'}
|
|
47
|
+
Icon={Camera}
|
|
48
|
+
onPress={withCloseSheet(() => mediaPickerService?.takeMedia({}))}
|
|
49
|
+
/>
|
|
50
|
+
<QuickActionButton
|
|
51
|
+
label={'Photos'}
|
|
52
|
+
Icon={Picture}
|
|
53
|
+
onPress={withCloseSheet(() => mediaPickerService?.pickMedia({}))}
|
|
54
|
+
/>
|
|
55
|
+
</View>
|
|
56
|
+
|
|
57
|
+
{bottomSheetOptions && bottomSheetOptions.length > 0 ? (
|
|
58
|
+
<>
|
|
59
|
+
<View style={[styles.divider, divider]} />
|
|
60
|
+
<View style={[styles.listSection, listSection]}>
|
|
61
|
+
{bottomSheetOptions.map((option, index) => (
|
|
62
|
+
<ListItem key={index} option={option} />
|
|
63
|
+
))}
|
|
64
|
+
</View>
|
|
65
|
+
</>
|
|
66
|
+
) : null}
|
|
67
|
+
</ScrollView>
|
|
68
|
+
);
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
type QuickActionButtonProps = {
|
|
72
|
+
label: string;
|
|
73
|
+
Icon: React.ComponentType;
|
|
74
|
+
onPress?: () => void;
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
export const QuickActionButton = ({ label, Icon, onPress }: QuickActionButtonProps) => {
|
|
78
|
+
const {
|
|
79
|
+
theme: {
|
|
80
|
+
sheet: { quickAction, quickActionLabel },
|
|
81
|
+
},
|
|
82
|
+
} = useTheme();
|
|
83
|
+
const styles = useStyles();
|
|
84
|
+
|
|
85
|
+
return (
|
|
86
|
+
<Pressable
|
|
87
|
+
onPress={onPress}
|
|
88
|
+
style={({ pressed }) => [styles.quickAction, quickAction, pressed && styles.pressedView]}
|
|
89
|
+
>
|
|
90
|
+
<Icon />
|
|
91
|
+
<Text style={[styles.quickActionLabel, quickActionLabel]}>{label}</Text>
|
|
92
|
+
</Pressable>
|
|
93
|
+
);
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
export type ListItemProps = {
|
|
97
|
+
option: BottomSheetOption;
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
export const ListItem = ({ option }: ListItemProps) => {
|
|
101
|
+
const {
|
|
102
|
+
theme: {
|
|
103
|
+
sheet: { listItem, listIcon, listTextContainer, listTitle, listSubtitle },
|
|
104
|
+
},
|
|
105
|
+
} = useTheme();
|
|
106
|
+
const styles = useStyles();
|
|
107
|
+
|
|
108
|
+
const { title, subtitle, action, Icon } = option;
|
|
109
|
+
|
|
110
|
+
return (
|
|
111
|
+
<Pressable
|
|
112
|
+
onPress={withCloseSheet(action)}
|
|
113
|
+
style={({ pressed }) => [styles.listItem, listItem, pressed && styles.pressedView]}
|
|
114
|
+
>
|
|
115
|
+
{Icon ? (
|
|
116
|
+
<View style={[styles.listIcon, listIcon]}>
|
|
117
|
+
<Icon />
|
|
118
|
+
</View>
|
|
119
|
+
) : null}
|
|
120
|
+
|
|
121
|
+
<View style={[styles.listTextContainer, listTextContainer]}>
|
|
122
|
+
<Text style={[styles.listTitle, listTitle]}>{title}</Text>
|
|
123
|
+
<Text style={[styles.listSubtitle, listSubtitle]}>{subtitle}</Text>
|
|
124
|
+
</View>
|
|
125
|
+
</Pressable>
|
|
126
|
+
);
|
|
127
|
+
};
|
|
128
|
+
|
|
129
|
+
const useStyles = () => {
|
|
130
|
+
const { theme } = useTheme();
|
|
131
|
+
|
|
132
|
+
return useMemo(() => {
|
|
133
|
+
const { colors } = theme;
|
|
134
|
+
|
|
135
|
+
return StyleSheet.create({
|
|
136
|
+
container: {
|
|
137
|
+
flex: 1,
|
|
138
|
+
},
|
|
139
|
+
contentContainer: {
|
|
140
|
+
paddingHorizontal: 16,
|
|
141
|
+
paddingTop: 12,
|
|
142
|
+
},
|
|
143
|
+
quickActionsCard: {
|
|
144
|
+
flexDirection: 'row',
|
|
145
|
+
justifyContent: 'center',
|
|
146
|
+
gap: 12,
|
|
147
|
+
borderRadius: 18,
|
|
148
|
+
marginBottom: 16,
|
|
149
|
+
},
|
|
150
|
+
quickAction: {
|
|
151
|
+
flex: 1,
|
|
152
|
+
alignItems: 'center',
|
|
153
|
+
padding: 16,
|
|
154
|
+
borderRadius: 14,
|
|
155
|
+
marginHorizontal: 4,
|
|
156
|
+
backgroundColor: colors.white_smoke,
|
|
157
|
+
},
|
|
158
|
+
pressedView: {
|
|
159
|
+
opacity: 0.7,
|
|
160
|
+
},
|
|
161
|
+
quickActionLabel: {
|
|
162
|
+
fontSize: 13,
|
|
163
|
+
fontWeight: '500',
|
|
164
|
+
color: colors.black,
|
|
165
|
+
marginTop: 4,
|
|
166
|
+
},
|
|
167
|
+
listSection: {
|
|
168
|
+
marginTop: 4,
|
|
169
|
+
borderRadius: 18,
|
|
170
|
+
backgroundColor: colors.white,
|
|
171
|
+
paddingHorizontal: 12,
|
|
172
|
+
paddingVertical: 4,
|
|
173
|
+
},
|
|
174
|
+
listItem: {
|
|
175
|
+
flexDirection: 'row',
|
|
176
|
+
alignItems: 'flex-start',
|
|
177
|
+
paddingVertical: 10,
|
|
178
|
+
},
|
|
179
|
+
listIcon: {
|
|
180
|
+
width: 24,
|
|
181
|
+
height: 24,
|
|
182
|
+
marginRight: 12,
|
|
183
|
+
marginTop: 2,
|
|
184
|
+
},
|
|
185
|
+
listTextContainer: {
|
|
186
|
+
flex: 1,
|
|
187
|
+
},
|
|
188
|
+
listTitle: {
|
|
189
|
+
fontSize: 15,
|
|
190
|
+
fontWeight: '500',
|
|
191
|
+
color: colors.black,
|
|
192
|
+
},
|
|
193
|
+
listSubtitle: {
|
|
194
|
+
marginTop: 2,
|
|
195
|
+
fontSize: 13,
|
|
196
|
+
color: colors.grey_dark,
|
|
197
|
+
},
|
|
198
|
+
divider: {
|
|
199
|
+
height: StyleSheet.hairlineWidth,
|
|
200
|
+
backgroundColor: colors.grey_whisper,
|
|
201
|
+
marginTop: 10,
|
|
202
|
+
},
|
|
203
|
+
});
|
|
204
|
+
}, [theme]);
|
|
205
|
+
};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import React, { useMemo } from 'react';
|
|
2
|
+
import { Pressable, StyleSheet, Text } from 'react-native';
|
|
3
|
+
|
|
4
|
+
import { useTheme } from '../contexts';
|
|
5
|
+
import { sheetStoreApi } from '../store';
|
|
6
|
+
|
|
7
|
+
export const AttachmentButton = () => {
|
|
8
|
+
const {
|
|
9
|
+
theme: {
|
|
10
|
+
composer: { roundButton, attachIcon },
|
|
11
|
+
},
|
|
12
|
+
} = useTheme();
|
|
13
|
+
const styles = useStyles();
|
|
14
|
+
|
|
15
|
+
return (
|
|
16
|
+
<Pressable style={[styles.roundButton, roundButton]} onPress={sheetStoreApi.openSheet}>
|
|
17
|
+
<Text style={[styles.attachIcon, attachIcon]}>+</Text>
|
|
18
|
+
</Pressable>
|
|
19
|
+
);
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
const useStyles = () => {
|
|
23
|
+
const { theme } = useTheme();
|
|
24
|
+
|
|
25
|
+
return useMemo(() => {
|
|
26
|
+
const { colors, composer } = theme;
|
|
27
|
+
|
|
28
|
+
const pillHeight = composer.inputPillHeight;
|
|
29
|
+
|
|
30
|
+
return StyleSheet.create({
|
|
31
|
+
attachIcon: {
|
|
32
|
+
fontSize: 32,
|
|
33
|
+
textAlign: 'center',
|
|
34
|
+
alignSelf: 'center',
|
|
35
|
+
lineHeight: 32,
|
|
36
|
+
color: colors.grey,
|
|
37
|
+
},
|
|
38
|
+
roundButton: {
|
|
39
|
+
width: pillHeight,
|
|
40
|
+
height: pillHeight,
|
|
41
|
+
borderRadius: pillHeight / 2,
|
|
42
|
+
backgroundColor: colors.white_smoke,
|
|
43
|
+
justifyContent: 'center',
|
|
44
|
+
alignItems: 'center',
|
|
45
|
+
marginRight: 8,
|
|
46
|
+
},
|
|
47
|
+
});
|
|
48
|
+
}, [theme]);
|
|
49
|
+
};
|