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,145 @@
|
|
|
1
|
+
import type { TextStyle } from 'react-native';
|
|
2
|
+
|
|
3
|
+
import type { ConvertOpts, CSSP } from '../types';
|
|
4
|
+
|
|
5
|
+
const EM_DEFAULT = 16;
|
|
6
|
+
|
|
7
|
+
// React Native's strict TypeScript API declares style properties as readonly.
|
|
8
|
+
type MutableTextStyle = { -readonly [K in keyof TextStyle]: TextStyle[K] };
|
|
9
|
+
|
|
10
|
+
/** Parse CSS lengths like 14, "14", "14px", "1.25em", "0.875rem" */
|
|
11
|
+
const len = (v: unknown, { baseFontSize, rootFontSize }: ConvertOpts): number | undefined => {
|
|
12
|
+
if (v == null) return undefined;
|
|
13
|
+
if (typeof v === 'number') return v;
|
|
14
|
+
if (typeof v !== 'string') return undefined;
|
|
15
|
+
|
|
16
|
+
const s = v.trim().toLowerCase();
|
|
17
|
+
if (s.endsWith('px')) {
|
|
18
|
+
const n = Number(s.slice(0, -2));
|
|
19
|
+
return Number.isFinite(n) ? n : undefined;
|
|
20
|
+
}
|
|
21
|
+
if (s.endsWith('em')) {
|
|
22
|
+
const n = Number(s.slice(0, -2));
|
|
23
|
+
return Number.isFinite(n) ? n * (baseFontSize ?? EM_DEFAULT) : undefined;
|
|
24
|
+
}
|
|
25
|
+
if (s.endsWith('rem')) {
|
|
26
|
+
const n = Number(s.slice(0, -3));
|
|
27
|
+
const root = rootFontSize ?? baseFontSize ?? EM_DEFAULT;
|
|
28
|
+
return Number.isFinite(n) ? n * root : undefined;
|
|
29
|
+
}
|
|
30
|
+
// plain number-like string
|
|
31
|
+
const n = Number(s);
|
|
32
|
+
return Number.isFinite(n) ? n : undefined;
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
/** Font shorthand: e.g. "italic small-caps 700 14px/20px Menlo, monospace" */
|
|
36
|
+
const parseFontShorthand = (v: string, opts: ConvertOpts) => {
|
|
37
|
+
const out: MutableTextStyle = {};
|
|
38
|
+
const parts = v.split(/\s+/);
|
|
39
|
+
// Very light parser: pick out style, weight, size[/lineHeight], and family
|
|
40
|
+
// Strategy:
|
|
41
|
+
// - style: "normal|italic"
|
|
42
|
+
// - weight: "normal|bold|100..900"
|
|
43
|
+
// - when we hit a token like "14px" or "14px/20px" → size & optional lineHeight
|
|
44
|
+
// - everything after size token is font family (may contain commas/spaces)
|
|
45
|
+
let i = 0;
|
|
46
|
+
|
|
47
|
+
// style
|
|
48
|
+
if (parts[i] === 'italic' || parts[i] === 'normal') {
|
|
49
|
+
if (parts[i] !== 'normal') out.fontStyle = 'italic';
|
|
50
|
+
i++;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
// (skip small-caps if present; RN uses fontVariant which is separate)
|
|
54
|
+
if (parts[i] === 'small-caps') {
|
|
55
|
+
out.fontVariant = ['small-caps'];
|
|
56
|
+
i++;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
// weight
|
|
60
|
+
if (/^(normal|bold|[1-9]00)$/.test(parts[i] ?? '')) {
|
|
61
|
+
const token = parts[i]!;
|
|
62
|
+
out.fontWeight = (token === 'normal' ? undefined : token) as TextStyle['fontWeight'];
|
|
63
|
+
i++;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
// size[/lineHeight]
|
|
67
|
+
const sizeToken = parts[i];
|
|
68
|
+
if (
|
|
69
|
+
sizeToken &&
|
|
70
|
+
(/.+(px|em|rem)$/.test(sizeToken) || /^[\d.]+(\/[\d.]+)?(px|em|rem)?$/.test(sizeToken))
|
|
71
|
+
) {
|
|
72
|
+
const [fs, lh] = sizeToken.split('/');
|
|
73
|
+
const fontSize = len(fs, opts);
|
|
74
|
+
if (fontSize != null) out.fontSize = fontSize;
|
|
75
|
+
if (lh) {
|
|
76
|
+
const lineHeight = len(lh, opts);
|
|
77
|
+
if (lineHeight != null) out.lineHeight = lineHeight;
|
|
78
|
+
}
|
|
79
|
+
i++;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
// family
|
|
83
|
+
const family = parts.slice(i).join(' ').replace(/^,|,$/g, '').trim();
|
|
84
|
+
if (family) {
|
|
85
|
+
// basic cleanup: take first family; strip quotes
|
|
86
|
+
const first = family
|
|
87
|
+
.split(',')[0]
|
|
88
|
+
?.trim()
|
|
89
|
+
.replace(/^["']|["']$/g, '');
|
|
90
|
+
if (first) out.fontFamily = first;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
return out;
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
/** map CSS (web) to RN TextStyle */
|
|
97
|
+
export const cssToRNTextStyle = (css: Partial<CSSP>, options: ConvertOpts = {}): TextStyle => {
|
|
98
|
+
const opts: ConvertOpts = {
|
|
99
|
+
baseFontSize: options.baseFontSize ?? EM_DEFAULT,
|
|
100
|
+
rootFontSize: options.rootFontSize ?? options.baseFontSize ?? EM_DEFAULT,
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
const out: MutableTextStyle = {};
|
|
104
|
+
|
|
105
|
+
// Simple 1:1 or unit-converted mappings
|
|
106
|
+
if (css.color) out.color = String(css.color);
|
|
107
|
+
|
|
108
|
+
if (css.fontFamily) out.fontFamily = String(css.fontFamily);
|
|
109
|
+
if (css.fontStyle) out.fontStyle = css.fontStyle as TextStyle['fontStyle'];
|
|
110
|
+
if (css.fontWeight) out.fontWeight = String(css.fontWeight) as TextStyle['fontWeight'];
|
|
111
|
+
|
|
112
|
+
if (css.fontSize != null) {
|
|
113
|
+
const n = len(css.fontSize, opts);
|
|
114
|
+
if (n != null) out.fontSize = n;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
if (css.lineHeight != null) {
|
|
118
|
+
const n = len(css.lineHeight, opts);
|
|
119
|
+
if (n != null) out.lineHeight = n;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
if (css.letterSpacing != null) {
|
|
123
|
+
const n = len(css.letterSpacing, opts);
|
|
124
|
+
if (n != null) out.letterSpacing = n;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
if (css.textAlign) out.textAlign = css.textAlign as TextStyle['textAlign'];
|
|
128
|
+
|
|
129
|
+
if (css.font && typeof css.font === 'string') {
|
|
130
|
+
Object.assign(out, parseFontShorthand(css.font, opts));
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
// Simulating the closest we can get to a CSS overflow-like functionality
|
|
134
|
+
const overflowLike = css.overflow ?? css.overflowX ?? css.overflowY;
|
|
135
|
+
if (typeof overflowLike === 'string') {
|
|
136
|
+
out.overflow =
|
|
137
|
+
overflowLike === 'hidden'
|
|
138
|
+
? 'hidden'
|
|
139
|
+
: overflowLike === 'scroll' || overflowLike === 'auto'
|
|
140
|
+
? 'scroll'
|
|
141
|
+
: 'visible';
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
return out as TextStyle;
|
|
145
|
+
};
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
import { processColor } from 'react-native';
|
|
2
|
+
|
|
3
|
+
// @ts-expect-error createStyleObject is not available in the type exports, it is still exported though
|
|
4
|
+
import { createStyleObject } from 'react-syntax-highlighter/dist/esm/create-element';
|
|
5
|
+
|
|
6
|
+
import type { ColorRange } from '../SyntaxHighlighter';
|
|
7
|
+
import type { SyntaxHighlighterStylesheet } from '../types';
|
|
8
|
+
|
|
9
|
+
type FlattenOptions = {
|
|
10
|
+
nodes: rendererNode | rendererNode[];
|
|
11
|
+
stylesheet: SyntaxHighlighterStylesheet;
|
|
12
|
+
defaultColor: string;
|
|
13
|
+
fontFamily?: string;
|
|
14
|
+
fontSize?: number;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export const flattenNodesToTextAndColorRanges = ({
|
|
18
|
+
nodes,
|
|
19
|
+
stylesheet,
|
|
20
|
+
defaultColor,
|
|
21
|
+
fontFamily,
|
|
22
|
+
fontSize = 13,
|
|
23
|
+
}: FlattenOptions): { text: string; ranges: ColorRange[] } => {
|
|
24
|
+
let text = '';
|
|
25
|
+
const rawRanges: { start: number; end: number; color: string | number }[] = [];
|
|
26
|
+
|
|
27
|
+
const startingStyle = { fontFamily, fontSize };
|
|
28
|
+
|
|
29
|
+
const walk = (node: rendererNode | null | undefined, inheritedColor: string | number) => {
|
|
30
|
+
if (!node) return;
|
|
31
|
+
|
|
32
|
+
const { type, tagName, value, properties } = node;
|
|
33
|
+
|
|
34
|
+
// leaf node
|
|
35
|
+
if (type === 'text') {
|
|
36
|
+
if (value == null || value === '') return;
|
|
37
|
+
const chunk = String(value);
|
|
38
|
+
const start = text.length;
|
|
39
|
+
text += chunk;
|
|
40
|
+
|
|
41
|
+
const color = inheritedColor ?? defaultColor;
|
|
42
|
+
if (color != null && chunk.length) {
|
|
43
|
+
rawRanges.push({ start, end: start + chunk.length, color });
|
|
44
|
+
}
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
// node with children
|
|
49
|
+
if (tagName) {
|
|
50
|
+
const baseStyle =
|
|
51
|
+
properties && properties.className
|
|
52
|
+
? createStyleObject(
|
|
53
|
+
properties.className,
|
|
54
|
+
Object.assign({ color: defaultColor }, properties.style, startingStyle),
|
|
55
|
+
stylesheet,
|
|
56
|
+
)
|
|
57
|
+
: { ...startingStyle, color: defaultColor };
|
|
58
|
+
|
|
59
|
+
// we take the node's color if present, then its inherited color
|
|
60
|
+
// if present and finally the block's default color if all else
|
|
61
|
+
// fails.
|
|
62
|
+
const effectiveColor =
|
|
63
|
+
(baseStyle as { color?: string | number }).color ?? inheritedColor ?? defaultColor;
|
|
64
|
+
|
|
65
|
+
const children = node.children || [];
|
|
66
|
+
const childArray = Array.isArray(children) ? children : [children];
|
|
67
|
+
for (let i = 0; i < childArray.length; i++) {
|
|
68
|
+
walk(childArray[i], effectiveColor);
|
|
69
|
+
}
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
// fallback
|
|
74
|
+
if (value != null) {
|
|
75
|
+
const chunk = String(value);
|
|
76
|
+
const start = text.length;
|
|
77
|
+
text += chunk;
|
|
78
|
+
const color = inheritedColor ?? defaultColor;
|
|
79
|
+
if (color != null && chunk.length) {
|
|
80
|
+
rawRanges.push({ start, end: start + chunk.length, color });
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
// Recursively flatten nodes
|
|
86
|
+
const nodeArray = Array.isArray(nodes) ? nodes : [nodes];
|
|
87
|
+
for (let i = 0; i < nodeArray.length; i++) {
|
|
88
|
+
walk(nodeArray[i], defaultColor);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
// Merge adjacent ranges with same color and convert them to integers
|
|
92
|
+
rawRanges.sort((a, b) => a.start - b.start);
|
|
93
|
+
const merged: ColorRange[] = [];
|
|
94
|
+
for (let i = 0; i < rawRanges.length; i++) {
|
|
95
|
+
const r = rawRanges[i]!;
|
|
96
|
+
// in case the color is malformed for some reason, use the defaultColor
|
|
97
|
+
// as this one should always be non-nullish.
|
|
98
|
+
const colorInt = processColor(r.color)!; // ?? processColor(defaultColor))!;
|
|
99
|
+
|
|
100
|
+
if (!merged.length) {
|
|
101
|
+
merged.push({ start: r.start, end: r.end, color: colorInt });
|
|
102
|
+
continue;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
const last = merged[merged.length - 1];
|
|
106
|
+
if (last && last.end === r.start && last.color === colorInt) {
|
|
107
|
+
last.end = r.end;
|
|
108
|
+
} else {
|
|
109
|
+
merged.push({ start: r.start, end: r.end, color: colorInt });
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
return { text, ranges: merged };
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
export const flattenRowsToTextAndColorRanges = (
|
|
117
|
+
rows: rendererNode[],
|
|
118
|
+
opts: Omit<FlattenOptions, 'nodes'>,
|
|
119
|
+
): { text: string; ranges: ColorRange[] } => {
|
|
120
|
+
let fullText = '';
|
|
121
|
+
const fullRanges: ColorRange[] = [];
|
|
122
|
+
|
|
123
|
+
for (let rowIndex = 0; rowIndex < rows.length; rowIndex++) {
|
|
124
|
+
const rowNodes = rows[rowIndex];
|
|
125
|
+
|
|
126
|
+
const { text, ranges } = flattenNodesToTextAndColorRanges({
|
|
127
|
+
...opts,
|
|
128
|
+
nodes: rowNodes ?? [],
|
|
129
|
+
});
|
|
130
|
+
|
|
131
|
+
const offset = fullText.length;
|
|
132
|
+
fullText += text;
|
|
133
|
+
|
|
134
|
+
// Add newline between rows (no color)
|
|
135
|
+
if (rowIndex < rows.length - 1) {
|
|
136
|
+
fullText += '\n';
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
// Shift ranges by current offset & push
|
|
140
|
+
for (const r of ranges) {
|
|
141
|
+
fullRanges.push({
|
|
142
|
+
start: r.start + offset,
|
|
143
|
+
end: r.end + offset,
|
|
144
|
+
color: r.color,
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
return { text: fullText, ranges: fullRanges };
|
|
150
|
+
};
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Platform, Text } from 'react-native';
|
|
3
|
+
|
|
4
|
+
import type { SyntaxHighlighterProps } from 'react-syntax-highlighter';
|
|
5
|
+
|
|
6
|
+
// @ts-expect-error createStyleObject is not available in the type exports, it is still exported though
|
|
7
|
+
import { createStyleObject } from 'react-syntax-highlighter/dist/esm/create-element';
|
|
8
|
+
|
|
9
|
+
import { cssToRNTextStyle } from './converter';
|
|
10
|
+
|
|
11
|
+
import { AndroidNativeRenderer } from '../components';
|
|
12
|
+
import type {
|
|
13
|
+
NativeSyntaxHighlighterProps,
|
|
14
|
+
RNSheet,
|
|
15
|
+
RNStyle,
|
|
16
|
+
SyntaxHighlighterStylesheet,
|
|
17
|
+
} from '../types';
|
|
18
|
+
|
|
19
|
+
export const DEFAULT_FONT_SIZE = 13;
|
|
20
|
+
|
|
21
|
+
export const generateNewStylesheet = ({
|
|
22
|
+
stylesheet,
|
|
23
|
+
highlighter,
|
|
24
|
+
}: {
|
|
25
|
+
stylesheet: SyntaxHighlighterStylesheet;
|
|
26
|
+
highlighter: NativeSyntaxHighlighterProps['highlighter'];
|
|
27
|
+
}) => {
|
|
28
|
+
stylesheet = Array.isArray(stylesheet) ? stylesheet[0] : stylesheet;
|
|
29
|
+
|
|
30
|
+
const transformedStyle = Object.entries(stylesheet ?? {}).reduce<RNSheet>(
|
|
31
|
+
(newStylesheet, [className, style]) => {
|
|
32
|
+
const rn = cssToRNTextStyle(style);
|
|
33
|
+
|
|
34
|
+
newStylesheet[className] = rn as RNStyle;
|
|
35
|
+
return newStylesheet;
|
|
36
|
+
},
|
|
37
|
+
{},
|
|
38
|
+
);
|
|
39
|
+
|
|
40
|
+
const topLevel = (
|
|
41
|
+
highlighter === 'prism' ? transformedStyle['pre[class*="language-"]'] : transformedStyle.hljs
|
|
42
|
+
) as RNStyle;
|
|
43
|
+
|
|
44
|
+
const defaultColor = (topLevel && topLevel.color) || '#000';
|
|
45
|
+
|
|
46
|
+
return { transformedStyle, defaultColor };
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
export const createChildren = ({
|
|
50
|
+
stylesheet,
|
|
51
|
+
fontSize,
|
|
52
|
+
fontFamily,
|
|
53
|
+
}: {
|
|
54
|
+
stylesheet: SyntaxHighlighterStylesheet;
|
|
55
|
+
fontSize?: number;
|
|
56
|
+
fontFamily?: string;
|
|
57
|
+
}) => {
|
|
58
|
+
let childrenCount = 0;
|
|
59
|
+
return (children: rendererNode['children'], defaultColor: string) => {
|
|
60
|
+
childrenCount += 1;
|
|
61
|
+
return (children ?? []).map((child, i) =>
|
|
62
|
+
createNativeElement({
|
|
63
|
+
node: child,
|
|
64
|
+
stylesheet,
|
|
65
|
+
key: `code-segment-${childrenCount}-${i}`,
|
|
66
|
+
defaultColor,
|
|
67
|
+
fontSize,
|
|
68
|
+
fontFamily,
|
|
69
|
+
}),
|
|
70
|
+
);
|
|
71
|
+
};
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
export const createNativeElement = ({
|
|
75
|
+
node,
|
|
76
|
+
stylesheet,
|
|
77
|
+
key,
|
|
78
|
+
defaultColor,
|
|
79
|
+
fontFamily,
|
|
80
|
+
fontSize = DEFAULT_FONT_SIZE,
|
|
81
|
+
}: {
|
|
82
|
+
node: rendererNode;
|
|
83
|
+
stylesheet: SyntaxHighlighterStylesheet;
|
|
84
|
+
key: string;
|
|
85
|
+
defaultColor: string;
|
|
86
|
+
fontFamily?: string;
|
|
87
|
+
fontSize?: number;
|
|
88
|
+
}) => {
|
|
89
|
+
const { properties, type, tagName: TagName, value } = node;
|
|
90
|
+
const startingStyle = { fontFamily, fontSize };
|
|
91
|
+
if (type === 'text') {
|
|
92
|
+
return (
|
|
93
|
+
<Text key={key} style={Object.assign({ color: defaultColor }, startingStyle)}>
|
|
94
|
+
{value}
|
|
95
|
+
</Text>
|
|
96
|
+
);
|
|
97
|
+
} else if (TagName) {
|
|
98
|
+
const childrenFactory = createChildren({
|
|
99
|
+
stylesheet,
|
|
100
|
+
fontSize,
|
|
101
|
+
fontFamily,
|
|
102
|
+
});
|
|
103
|
+
const style = properties
|
|
104
|
+
? createStyleObject(
|
|
105
|
+
properties.className,
|
|
106
|
+
Object.assign({ color: defaultColor }, properties.style, startingStyle),
|
|
107
|
+
stylesheet,
|
|
108
|
+
)
|
|
109
|
+
: {};
|
|
110
|
+
const children = childrenFactory(node.children, style.color || defaultColor);
|
|
111
|
+
return (
|
|
112
|
+
<Text key={key} style={style}>
|
|
113
|
+
{children}
|
|
114
|
+
</Text>
|
|
115
|
+
);
|
|
116
|
+
}
|
|
117
|
+
return null;
|
|
118
|
+
};
|
|
119
|
+
|
|
120
|
+
export const nativeRenderer = ({
|
|
121
|
+
defaultColor,
|
|
122
|
+
fontFamily,
|
|
123
|
+
fontSize = 13,
|
|
124
|
+
}: {
|
|
125
|
+
defaultColor: string;
|
|
126
|
+
fontFamily?: string;
|
|
127
|
+
fontSize?: number;
|
|
128
|
+
}): SyntaxHighlighterProps['renderer'] => {
|
|
129
|
+
return ({ rows, stylesheet }) =>
|
|
130
|
+
Platform.OS === 'android' ? (
|
|
131
|
+
<AndroidNativeRenderer
|
|
132
|
+
rows={rows}
|
|
133
|
+
stylesheet={stylesheet}
|
|
134
|
+
defaultColor={defaultColor}
|
|
135
|
+
fontFamily={fontFamily}
|
|
136
|
+
fontSize={fontSize}
|
|
137
|
+
lineHeight={fontSize - 4}
|
|
138
|
+
/>
|
|
139
|
+
) : (
|
|
140
|
+
rows.map((node, i) =>
|
|
141
|
+
createNativeElement({
|
|
142
|
+
node,
|
|
143
|
+
stylesheet,
|
|
144
|
+
key: `code-segment-${i}`,
|
|
145
|
+
defaultColor,
|
|
146
|
+
fontFamily,
|
|
147
|
+
fontSize,
|
|
148
|
+
}),
|
|
149
|
+
)
|
|
150
|
+
);
|
|
151
|
+
};
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import type { ImageStyle, TextStyle, ViewStyle } from 'react-native';
|
|
2
|
+
|
|
3
|
+
import type { MarkdownStyle } from './markdown';
|
|
4
|
+
|
|
5
|
+
export const colors = {
|
|
6
|
+
accent_blue: '#005FFF',
|
|
7
|
+
accent_red: '#FF3742',
|
|
8
|
+
black: '#000000',
|
|
9
|
+
code_block: '#DDDDDD',
|
|
10
|
+
grey: '#7A7A7A',
|
|
11
|
+
grey_neutral: '#9E9E9E',
|
|
12
|
+
grey_dark: '#72767E',
|
|
13
|
+
grey_gainsboro: '#DBDBDB',
|
|
14
|
+
grey_whisper: '#ECEBEB',
|
|
15
|
+
overlay: '#000000CC',
|
|
16
|
+
transparent: 'transparent',
|
|
17
|
+
white: '#FFFFFF',
|
|
18
|
+
white_smoke: '#F2F2F2',
|
|
19
|
+
shimmer: '#FFFFFF',
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export type Theme = {
|
|
23
|
+
colors: typeof colors;
|
|
24
|
+
markdown: MarkdownStyle;
|
|
25
|
+
composer: {
|
|
26
|
+
container: ViewStyle;
|
|
27
|
+
containerRow: ViewStyle;
|
|
28
|
+
inputPillHeight: number;
|
|
29
|
+
inputPillContainer: ViewStyle;
|
|
30
|
+
inputPill: ViewStyle;
|
|
31
|
+
textInput: TextStyle;
|
|
32
|
+
roundButton: ViewStyle;
|
|
33
|
+
attachIcon: TextStyle;
|
|
34
|
+
mediaPreviewStyle: ViewStyle;
|
|
35
|
+
mediaPreviewContentContainerStyle: ViewStyle;
|
|
36
|
+
mediaPreviewImage: ImageStyle;
|
|
37
|
+
mediaPreviewRemoveButton: ViewStyle;
|
|
38
|
+
micIcon: ViewStyle;
|
|
39
|
+
sendIcon: ViewStyle;
|
|
40
|
+
stopGeneratingIcon: ViewStyle;
|
|
41
|
+
iconButton: ViewStyle;
|
|
42
|
+
};
|
|
43
|
+
sheet: {
|
|
44
|
+
contentContainer: ViewStyle;
|
|
45
|
+
quickActionsCard: ViewStyle;
|
|
46
|
+
divider: ViewStyle;
|
|
47
|
+
listSection: ViewStyle;
|
|
48
|
+
quickAction: ViewStyle;
|
|
49
|
+
quickActionLabel: TextStyle;
|
|
50
|
+
listItem: ViewStyle;
|
|
51
|
+
listIcon: ViewStyle;
|
|
52
|
+
listTextContainer: ViewStyle;
|
|
53
|
+
listTitle: TextStyle;
|
|
54
|
+
listSubtitle: TextStyle;
|
|
55
|
+
};
|
|
56
|
+
aiTypingIndicatorView: {
|
|
57
|
+
text: TextStyle;
|
|
58
|
+
};
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
export const defaultTheme: Theme = {
|
|
62
|
+
colors,
|
|
63
|
+
markdown: {
|
|
64
|
+
autolink: {},
|
|
65
|
+
blockQuoteSection: {},
|
|
66
|
+
blockQuoteSectionBar: {},
|
|
67
|
+
blockQuoteText: {},
|
|
68
|
+
strong: {},
|
|
69
|
+
codeBlock: {},
|
|
70
|
+
codeBlockWrapper: {},
|
|
71
|
+
codeBlockContainer: {},
|
|
72
|
+
codeBlockHeaderContainer: {},
|
|
73
|
+
codeBlockHeaderTitle: {},
|
|
74
|
+
em: {},
|
|
75
|
+
heading: {},
|
|
76
|
+
heading1: {},
|
|
77
|
+
heading2: {},
|
|
78
|
+
heading3: {},
|
|
79
|
+
heading4: {},
|
|
80
|
+
heading5: {},
|
|
81
|
+
heading6: {},
|
|
82
|
+
hr: {},
|
|
83
|
+
inlineCode: {},
|
|
84
|
+
br: {},
|
|
85
|
+
list: {},
|
|
86
|
+
listItem: {},
|
|
87
|
+
listItemBullet: {},
|
|
88
|
+
listItemNumber: {},
|
|
89
|
+
listItemText: {},
|
|
90
|
+
listRow: {},
|
|
91
|
+
sublist: {},
|
|
92
|
+
url: {},
|
|
93
|
+
noMargin: {},
|
|
94
|
+
paragraph: {},
|
|
95
|
+
paragraphCenter: {},
|
|
96
|
+
del: {},
|
|
97
|
+
text: {},
|
|
98
|
+
table: {},
|
|
99
|
+
tableRow: {},
|
|
100
|
+
tableRowCell: {},
|
|
101
|
+
tableHeader: {},
|
|
102
|
+
tableHeaderCell: {},
|
|
103
|
+
},
|
|
104
|
+
composer: {
|
|
105
|
+
container: {},
|
|
106
|
+
containerRow: {},
|
|
107
|
+
inputPillHeight: 48,
|
|
108
|
+
inputPillContainer: {},
|
|
109
|
+
inputPill: {},
|
|
110
|
+
textInput: {},
|
|
111
|
+
roundButton: {},
|
|
112
|
+
attachIcon: {},
|
|
113
|
+
mediaPreviewStyle: {},
|
|
114
|
+
mediaPreviewContentContainerStyle: {},
|
|
115
|
+
mediaPreviewImage: {},
|
|
116
|
+
mediaPreviewRemoveButton: {},
|
|
117
|
+
micIcon: {},
|
|
118
|
+
sendIcon: {},
|
|
119
|
+
stopGeneratingIcon: {},
|
|
120
|
+
iconButton: {},
|
|
121
|
+
},
|
|
122
|
+
sheet: {
|
|
123
|
+
contentContainer: {},
|
|
124
|
+
quickActionsCard: {},
|
|
125
|
+
divider: {},
|
|
126
|
+
listSection: {},
|
|
127
|
+
quickAction: {},
|
|
128
|
+
quickActionLabel: {},
|
|
129
|
+
listItem: {},
|
|
130
|
+
listIcon: {},
|
|
131
|
+
listTextContainer: {},
|
|
132
|
+
listTitle: {},
|
|
133
|
+
listSubtitle: {},
|
|
134
|
+
},
|
|
135
|
+
aiTypingIndicatorView: {
|
|
136
|
+
text: {},
|
|
137
|
+
},
|
|
138
|
+
};
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { useCallback, useEffect } from 'react';
|
|
2
|
+
import { PermissionsAndroid, Platform } from 'react-native';
|
|
3
|
+
|
|
4
|
+
import { useStateStore } from '@stream-io/state-store/react-bindings';
|
|
5
|
+
|
|
6
|
+
import { useStableCallback } from '../internal/hooks/useStableCallback';
|
|
7
|
+
import { AIDictation } from '../native/AIDictation';
|
|
8
|
+
import type { DictationResult, DictationStartOptions } from '../native-specs/NativeAIDictation';
|
|
9
|
+
import { dictationStore, type DictationStoreState } from '../store';
|
|
10
|
+
|
|
11
|
+
const DEFAULT_OPTIONS = {
|
|
12
|
+
language: 'en-US',
|
|
13
|
+
interimResults: true,
|
|
14
|
+
silenceTimeoutMs: 2500,
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
const ensureAndroidRecordingPermissions = async (): Promise<boolean> => {
|
|
18
|
+
if (Platform.OS !== 'android') return true;
|
|
19
|
+
|
|
20
|
+
const granted = await PermissionsAndroid.request(PermissionsAndroid.PERMISSIONS.RECORD_AUDIO);
|
|
21
|
+
|
|
22
|
+
return granted === PermissionsAndroid.RESULTS.GRANTED;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
const selector = ({ isRecording }: DictationStoreState) => ({
|
|
26
|
+
isRecording,
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
// TODO: add proper jsdocs
|
|
30
|
+
export const useDictation = (defaultOptions: DictationStartOptions = DEFAULT_OPTIONS) => {
|
|
31
|
+
const { isRecording } = useStateStore(dictationStore, selector);
|
|
32
|
+
|
|
33
|
+
useEffect(() => {
|
|
34
|
+
const unsubscribeResult = AIDictation.addResultListener((result: DictationResult) => {
|
|
35
|
+
dictationStore.partialNext({
|
|
36
|
+
transcript: result.text,
|
|
37
|
+
...(result.isFinal ? { isRecording: false, state: 'idle' } : {}),
|
|
38
|
+
});
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
const unsubscribeState = AIDictation.addStateListener(({ state: next }) => {
|
|
42
|
+
dictationStore.partialNext({
|
|
43
|
+
state: next,
|
|
44
|
+
isRecording: next === 'listening' || next === 'starting',
|
|
45
|
+
});
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
const unsubscribeError = AIDictation.addErrorListener((error) => {
|
|
49
|
+
dictationStore.partialNext({ error, isRecording: false, state: 'idle' });
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
return () => {
|
|
53
|
+
unsubscribeResult();
|
|
54
|
+
unsubscribeState();
|
|
55
|
+
unsubscribeError();
|
|
56
|
+
};
|
|
57
|
+
}, []);
|
|
58
|
+
|
|
59
|
+
const start = useCallback(
|
|
60
|
+
async (override?: DictationStartOptions) => {
|
|
61
|
+
const hasPermission = await ensureAndroidRecordingPermissions();
|
|
62
|
+
if (!hasPermission) {
|
|
63
|
+
dictationStore.partialNext({
|
|
64
|
+
error: {
|
|
65
|
+
code: 'NO_PERMISSION',
|
|
66
|
+
message: 'Microphone permission not granted',
|
|
67
|
+
},
|
|
68
|
+
});
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
dictationStore.partialNext({ error: null, transcript: '' });
|
|
73
|
+
|
|
74
|
+
const opts: DictationStartOptions = {
|
|
75
|
+
...defaultOptions,
|
|
76
|
+
...override,
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
AIDictation.start(opts);
|
|
80
|
+
},
|
|
81
|
+
[defaultOptions],
|
|
82
|
+
);
|
|
83
|
+
|
|
84
|
+
const stop = useCallback(() => {
|
|
85
|
+
AIDictation.stop();
|
|
86
|
+
}, []);
|
|
87
|
+
|
|
88
|
+
const cancel = useCallback(() => {
|
|
89
|
+
AIDictation.cancel();
|
|
90
|
+
}, []);
|
|
91
|
+
|
|
92
|
+
const toggle = useStableCallback(() => {
|
|
93
|
+
if (isRecording) {
|
|
94
|
+
stop();
|
|
95
|
+
} else {
|
|
96
|
+
void start();
|
|
97
|
+
}
|
|
98
|
+
});
|
|
99
|
+
|
|
100
|
+
return {
|
|
101
|
+
start,
|
|
102
|
+
stop,
|
|
103
|
+
toggle,
|
|
104
|
+
cancel,
|
|
105
|
+
};
|
|
106
|
+
};
|