stream-chat-react-native-core 9.9.4 → 9.10.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ai-components/package.json +6 -0
- package/lib/commonjs/ai-components/AITypingIndicatorView.js +49 -0
- package/lib/commonjs/ai-components/AITypingIndicatorView.js.map +1 -0
- package/lib/commonjs/ai-components/README.md +279 -0
- package/lib/commonjs/ai-components/StreamingMessageView.js +75 -0
- package/lib/commonjs/ai-components/StreamingMessageView.js.map +1 -0
- package/lib/commonjs/ai-components/charts/Chart.js +25 -0
- package/lib/commonjs/ai-components/charts/Chart.js.map +1 -0
- package/lib/commonjs/ai-components/charts/components/PieLegend.js +54 -0
- package/lib/commonjs/ai-components/charts/components/PieLegend.js.map +1 -0
- package/lib/commonjs/ai-components/charts/components/VictoryChart.js +183 -0
- package/lib/commonjs/ai-components/charts/components/VictoryChart.js.map +1 -0
- package/lib/commonjs/ai-components/charts/components/index.js +26 -0
- package/lib/commonjs/ai-components/charts/components/index.js.map +1 -0
- package/lib/commonjs/ai-components/charts/index.js +70 -0
- package/lib/commonjs/ai-components/charts/index.js.map +1 -0
- package/lib/commonjs/ai-components/charts/mermaid/index.js +15 -0
- package/lib/commonjs/ai-components/charts/mermaid/index.js.map +1 -0
- package/lib/commonjs/ai-components/charts/mermaid/parser.js +45 -0
- package/lib/commonjs/ai-components/charts/mermaid/parser.js.map +1 -0
- package/lib/commonjs/ai-components/charts/types.js +2 -0
- package/lib/commonjs/ai-components/charts/types.js.map +1 -0
- package/lib/commonjs/ai-components/charts/utils/generate-pie-colors.js +68 -0
- package/lib/commonjs/ai-components/charts/utils/generate-pie-colors.js.map +1 -0
- package/lib/commonjs/ai-components/charts/utils/index.js +26 -0
- package/lib/commonjs/ai-components/charts/utils/index.js.map +1 -0
- package/lib/commonjs/ai-components/charts/utils/parse-json-chart.js +15 -0
- package/lib/commonjs/ai-components/charts/utils/parse-json-chart.js.map +1 -0
- package/lib/commonjs/ai-components/charts/vega-lite/index.js +26 -0
- package/lib/commonjs/ai-components/charts/vega-lite/index.js.map +1 -0
- package/lib/commonjs/ai-components/charts/vega-lite/parser.js +54 -0
- package/lib/commonjs/ai-components/charts/vega-lite/parser.js.map +1 -0
- package/lib/commonjs/ai-components/charts/vega-lite/schema.js +82 -0
- package/lib/commonjs/ai-components/charts/vega-lite/schema.js.map +1 -0
- package/lib/commonjs/ai-components/components/BottomSheet.js +182 -0
- package/lib/commonjs/ai-components/components/BottomSheet.js.map +1 -0
- package/lib/commonjs/ai-components/components/MarkdownReactiveScrollView.js +81 -0
- package/lib/commonjs/ai-components/components/MarkdownReactiveScrollView.js.map +1 -0
- package/lib/commonjs/ai-components/components/index.js +26 -0
- package/lib/commonjs/ai-components/components/index.js.map +1 -0
- package/lib/commonjs/ai-components/contexts/composer-context.js +68 -0
- package/lib/commonjs/ai-components/contexts/composer-context.js.map +1 -0
- package/lib/commonjs/ai-components/contexts/index.js +26 -0
- package/lib/commonjs/ai-components/contexts/index.js.map +1 -0
- package/lib/commonjs/ai-components/contexts/theme-context.js +53 -0
- package/lib/commonjs/ai-components/contexts/theme-context.js.map +1 -0
- package/lib/commonjs/ai-components/index.js +166 -0
- package/lib/commonjs/ai-components/index.js.map +1 -0
- package/lib/commonjs/ai-components/internal/hooks/useStableCallback.js +14 -0
- package/lib/commonjs/ai-components/internal/hooks/useStableCallback.js.map +1 -0
- package/lib/commonjs/ai-components/internal/icons/Camera.js +18 -0
- package/lib/commonjs/ai-components/internal/icons/Camera.js.map +1 -0
- package/lib/commonjs/ai-components/internal/icons/CircleStop.js +24 -0
- package/lib/commonjs/ai-components/internal/icons/CircleStop.js.map +1 -0
- package/lib/commonjs/ai-components/internal/icons/Close.js +18 -0
- package/lib/commonjs/ai-components/internal/icons/Close.js.map +1 -0
- package/lib/commonjs/ai-components/internal/icons/Mic.js +27 -0
- package/lib/commonjs/ai-components/internal/icons/Mic.js.map +1 -0
- package/lib/commonjs/ai-components/internal/icons/Picture.js +21 -0
- package/lib/commonjs/ai-components/internal/icons/Picture.js.map +1 -0
- package/lib/commonjs/ai-components/internal/icons/SendUp.js +28 -0
- package/lib/commonjs/ai-components/internal/icons/SendUp.js.map +1 -0
- package/lib/commonjs/ai-components/internal/icons/utils/base.js +42 -0
- package/lib/commonjs/ai-components/internal/icons/utils/base.js.map +1 -0
- package/lib/commonjs/ai-components/markdown/components/Autolink.js +37 -0
- package/lib/commonjs/ai-components/markdown/components/Autolink.js.map +1 -0
- package/lib/commonjs/ai-components/markdown/components/BlockQuote.js +37 -0
- package/lib/commonjs/ai-components/markdown/components/BlockQuote.js.map +1 -0
- package/lib/commonjs/ai-components/markdown/components/Bold.js +32 -0
- package/lib/commonjs/ai-components/markdown/components/Bold.js.map +1 -0
- package/lib/commonjs/ai-components/markdown/components/CodeBlock.js +114 -0
- package/lib/commonjs/ai-components/markdown/components/CodeBlock.js.map +1 -0
- package/lib/commonjs/ai-components/markdown/components/Emphasis.js +32 -0
- package/lib/commonjs/ai-components/markdown/components/Emphasis.js.map +1 -0
- package/lib/commonjs/ai-components/markdown/components/Heading.js +41 -0
- package/lib/commonjs/ai-components/markdown/components/Heading.js.map +1 -0
- package/lib/commonjs/ai-components/markdown/components/HorizontalRule.js +26 -0
- package/lib/commonjs/ai-components/markdown/components/HorizontalRule.js.map +1 -0
- package/lib/commonjs/ai-components/markdown/components/InlineCode.js +32 -0
- package/lib/commonjs/ai-components/markdown/components/InlineCode.js.map +1 -0
- package/lib/commonjs/ai-components/markdown/components/LineBreak.js +27 -0
- package/lib/commonjs/ai-components/markdown/components/LineBreak.js.map +1 -0
- package/lib/commonjs/ai-components/markdown/components/Link.js +41 -0
- package/lib/commonjs/ai-components/markdown/components/Link.js.map +1 -0
- package/lib/commonjs/ai-components/markdown/components/List.js +85 -0
- package/lib/commonjs/ai-components/markdown/components/List.js.map +1 -0
- package/lib/commonjs/ai-components/markdown/components/Mailto.js +37 -0
- package/lib/commonjs/ai-components/markdown/components/Mailto.js.map +1 -0
- package/lib/commonjs/ai-components/markdown/components/Markdown.js +49 -0
- package/lib/commonjs/ai-components/markdown/components/Markdown.js.map +1 -0
- package/lib/commonjs/ai-components/markdown/components/NewLine.js +27 -0
- package/lib/commonjs/ai-components/markdown/components/NewLine.js.map +1 -0
- package/lib/commonjs/ai-components/markdown/components/Paragraph.js +72 -0
- package/lib/commonjs/ai-components/markdown/components/Paragraph.js.map +1 -0
- package/lib/commonjs/ai-components/markdown/components/Strikethrough.js +32 -0
- package/lib/commonjs/ai-components/markdown/components/Strikethrough.js.map +1 -0
- package/lib/commonjs/ai-components/markdown/components/Table.js +105 -0
- package/lib/commonjs/ai-components/markdown/components/Table.js.map +1 -0
- package/lib/commonjs/ai-components/markdown/components/Text.js +45 -0
- package/lib/commonjs/ai-components/markdown/components/Text.js.map +1 -0
- package/lib/commonjs/ai-components/markdown/components/Url.js +37 -0
- package/lib/commonjs/ai-components/markdown/components/Url.js.map +1 -0
- package/lib/commonjs/ai-components/markdown/components/index.js +213 -0
- package/lib/commonjs/ai-components/markdown/components/index.js.map +1 -0
- package/lib/commonjs/ai-components/markdown/index.js +59 -0
- package/lib/commonjs/ai-components/markdown/index.js.map +1 -0
- package/lib/commonjs/ai-components/markdown/rules.js +152 -0
- package/lib/commonjs/ai-components/markdown/rules.js.map +1 -0
- package/lib/commonjs/ai-components/markdown/styles.js +240 -0
- package/lib/commonjs/ai-components/markdown/styles.js.map +1 -0
- package/lib/commonjs/ai-components/markdown/types.js +4 -0
- package/lib/commonjs/ai-components/markdown/types.js.map +1 -0
- package/lib/commonjs/ai-components/markdown/utils/generate-markdown-text.js +73 -0
- package/lib/commonjs/ai-components/markdown/utils/generate-markdown-text.js.map +1 -0
- package/lib/commonjs/ai-components/markdown/utils/index.js +15 -0
- package/lib/commonjs/ai-components/markdown/utils/index.js.map +1 -0
- package/lib/commonjs/ai-components/message-composer/ActionButton.js +104 -0
- package/lib/commonjs/ai-components/message-composer/ActionButton.js.map +1 -0
- package/lib/commonjs/ai-components/message-composer/ActionSheet.js +197 -0
- package/lib/commonjs/ai-components/message-composer/ActionSheet.js.map +1 -0
- package/lib/commonjs/ai-components/message-composer/AttachmentButton.js +55 -0
- package/lib/commonjs/ai-components/message-composer/AttachmentButton.js.map +1 -0
- package/lib/commonjs/ai-components/message-composer/ComposerView.js +151 -0
- package/lib/commonjs/ai-components/message-composer/ComposerView.js.map +1 -0
- package/lib/commonjs/ai-components/message-composer/MediaPreviewList.js +84 -0
- package/lib/commonjs/ai-components/message-composer/MediaPreviewList.js.map +1 -0
- package/lib/commonjs/ai-components/message-composer/SpeechToTextButton.js +82 -0
- package/lib/commonjs/ai-components/message-composer/SpeechToTextButton.js.map +1 -0
- package/lib/commonjs/ai-components/message-composer/index.js +59 -0
- package/lib/commonjs/ai-components/message-composer/index.js.map +1 -0
- package/lib/commonjs/ai-components/message-composer/utils/withCloseSheet.js +16 -0
- package/lib/commonjs/ai-components/message-composer/utils/withCloseSheet.js.map +1 -0
- package/lib/commonjs/ai-components/native/AIDictation.js +60 -0
- package/lib/commonjs/ai-components/native/AIDictation.js.map +1 -0
- package/lib/commonjs/ai-components/native/PerfText.js +31 -0
- package/lib/commonjs/ai-components/native/PerfText.js.map +1 -0
- package/lib/commonjs/ai-components/native-specs/NativeAIDictation.js +7 -0
- package/lib/commonjs/ai-components/native-specs/NativeAIDictation.js.map +1 -0
- package/lib/commonjs/ai-components/services/clipboard-service/expo.js +13 -0
- package/lib/commonjs/ai-components/services/clipboard-service/expo.js.map +1 -0
- package/lib/commonjs/ai-components/services/clipboard-service/index.js +8 -0
- package/lib/commonjs/ai-components/services/clipboard-service/index.js.map +1 -0
- package/lib/commonjs/ai-components/services/clipboard-service/rncli.js +10 -0
- package/lib/commonjs/ai-components/services/clipboard-service/rncli.js.map +1 -0
- package/lib/commonjs/ai-components/services/index.js +26 -0
- package/lib/commonjs/ai-components/services/index.js.map +1 -0
- package/lib/commonjs/ai-components/services/media-picker-service/AbstractMediaPickerService.js +31 -0
- package/lib/commonjs/ai-components/services/media-picker-service/AbstractMediaPickerService.js.map +1 -0
- package/lib/commonjs/ai-components/services/media-picker-service/expo.js +169 -0
- package/lib/commonjs/ai-components/services/media-picker-service/expo.js.map +1 -0
- package/lib/commonjs/ai-components/services/media-picker-service/hooks/useMediaPickerState.js +14 -0
- package/lib/commonjs/ai-components/services/media-picker-service/hooks/useMediaPickerState.js.map +1 -0
- package/lib/commonjs/ai-components/services/media-picker-service/index.js +8 -0
- package/lib/commonjs/ai-components/services/media-picker-service/index.js.map +1 -0
- package/lib/commonjs/ai-components/services/media-picker-service/optional-modules.d.js +2 -0
- package/lib/commonjs/ai-components/services/media-picker-service/optional-modules.d.js.map +1 -0
- package/lib/commonjs/ai-components/services/media-picker-service/rncli.js +162 -0
- package/lib/commonjs/ai-components/services/media-picker-service/rncli.js.map +1 -0
- package/lib/commonjs/ai-components/store/bottom-sheet/store.js +27 -0
- package/lib/commonjs/ai-components/store/bottom-sheet/store.js.map +1 -0
- package/lib/commonjs/ai-components/store/bottom-sheet/useBottomSheetState.js +16 -0
- package/lib/commonjs/ai-components/store/bottom-sheet/useBottomSheetState.js.map +1 -0
- package/lib/commonjs/ai-components/store/composer/store.js +11 -0
- package/lib/commonjs/ai-components/store/composer/store.js.map +1 -0
- package/lib/commonjs/ai-components/store/composer/useComposerHasText.js +18 -0
- package/lib/commonjs/ai-components/store/composer/useComposerHasText.js.map +1 -0
- package/lib/commonjs/ai-components/store/composer/useComposerText.js +18 -0
- package/lib/commonjs/ai-components/store/composer/useComposerText.js.map +1 -0
- package/lib/commonjs/ai-components/store/dictation/store.js +17 -0
- package/lib/commonjs/ai-components/store/dictation/store.js.map +1 -0
- package/lib/commonjs/ai-components/store/dictation/useDictationState.js +18 -0
- package/lib/commonjs/ai-components/store/dictation/useDictationState.js.map +1 -0
- package/lib/commonjs/ai-components/store/dictation/useDictationTranscript.js +14 -0
- package/lib/commonjs/ai-components/store/dictation/useDictationTranscript.js.map +1 -0
- package/lib/commonjs/ai-components/store/index.js +70 -0
- package/lib/commonjs/ai-components/store/index.js.map +1 -0
- package/lib/commonjs/ai-components/syntax-highlighting/SyntaxHighlighter.js +51 -0
- package/lib/commonjs/ai-components/syntax-highlighting/SyntaxHighlighter.js.map +1 -0
- package/lib/commonjs/ai-components/syntax-highlighting/components/AndroidNativeRenderer.js +35 -0
- package/lib/commonjs/ai-components/syntax-highlighting/components/AndroidNativeRenderer.js.map +1 -0
- package/lib/commonjs/ai-components/syntax-highlighting/components/index.js +15 -0
- package/lib/commonjs/ai-components/syntax-highlighting/components/index.js.map +1 -0
- package/lib/commonjs/ai-components/syntax-highlighting/index.js +48 -0
- package/lib/commonjs/ai-components/syntax-highlighting/index.js.map +1 -0
- package/lib/commonjs/ai-components/syntax-highlighting/prism-config.js +7 -0
- package/lib/commonjs/ai-components/syntax-highlighting/prism-config.js.map +1 -0
- package/lib/commonjs/ai-components/syntax-highlighting/types.js +4 -0
- package/lib/commonjs/ai-components/syntax-highlighting/types.js.map +1 -0
- package/lib/commonjs/ai-components/syntax-highlighting/utils/converter.js +107 -0
- package/lib/commonjs/ai-components/syntax-highlighting/utils/converter.js.map +1 -0
- package/lib/commonjs/ai-components/syntax-highlighting/utils/flatten-nodes.js +139 -0
- package/lib/commonjs/ai-components/syntax-highlighting/utils/flatten-nodes.js.map +1 -0
- package/lib/commonjs/ai-components/syntax-highlighting/utils/index.js +37 -0
- package/lib/commonjs/ai-components/syntax-highlighting/utils/index.js.map +1 -0
- package/lib/commonjs/ai-components/syntax-highlighting/utils/renderer.js +117 -0
- package/lib/commonjs/ai-components/syntax-highlighting/utils/renderer.js.map +1 -0
- package/lib/commonjs/ai-components/theme.js +99 -0
- package/lib/commonjs/ai-components/theme.js.map +1 -0
- package/lib/commonjs/ai-components/transcription/useDictation.js +114 -0
- package/lib/commonjs/ai-components/transcription/useDictation.js.map +1 -0
- package/lib/commonjs/native.js +4 -0
- package/lib/commonjs/native.js.map +1 -1
- package/lib/commonjs/version.json +1 -1
- package/lib/module/ai-components/AITypingIndicatorView.js +49 -0
- package/lib/module/ai-components/AITypingIndicatorView.js.map +1 -0
- package/lib/module/ai-components/README.md +279 -0
- package/lib/module/ai-components/StreamingMessageView.js +75 -0
- package/lib/module/ai-components/StreamingMessageView.js.map +1 -0
- package/lib/module/ai-components/charts/Chart.js +25 -0
- package/lib/module/ai-components/charts/Chart.js.map +1 -0
- package/lib/module/ai-components/charts/components/PieLegend.js +54 -0
- package/lib/module/ai-components/charts/components/PieLegend.js.map +1 -0
- package/lib/module/ai-components/charts/components/VictoryChart.js +183 -0
- package/lib/module/ai-components/charts/components/VictoryChart.js.map +1 -0
- package/lib/module/ai-components/charts/components/index.js +26 -0
- package/lib/module/ai-components/charts/components/index.js.map +1 -0
- package/lib/module/ai-components/charts/index.js +70 -0
- package/lib/module/ai-components/charts/index.js.map +1 -0
- package/lib/module/ai-components/charts/mermaid/index.js +15 -0
- package/lib/module/ai-components/charts/mermaid/index.js.map +1 -0
- package/lib/module/ai-components/charts/mermaid/parser.js +45 -0
- package/lib/module/ai-components/charts/mermaid/parser.js.map +1 -0
- package/lib/module/ai-components/charts/types.js +2 -0
- package/lib/module/ai-components/charts/types.js.map +1 -0
- package/lib/module/ai-components/charts/utils/generate-pie-colors.js +68 -0
- package/lib/module/ai-components/charts/utils/generate-pie-colors.js.map +1 -0
- package/lib/module/ai-components/charts/utils/index.js +26 -0
- package/lib/module/ai-components/charts/utils/index.js.map +1 -0
- package/lib/module/ai-components/charts/utils/parse-json-chart.js +15 -0
- package/lib/module/ai-components/charts/utils/parse-json-chart.js.map +1 -0
- package/lib/module/ai-components/charts/vega-lite/index.js +26 -0
- package/lib/module/ai-components/charts/vega-lite/index.js.map +1 -0
- package/lib/module/ai-components/charts/vega-lite/parser.js +54 -0
- package/lib/module/ai-components/charts/vega-lite/parser.js.map +1 -0
- package/lib/module/ai-components/charts/vega-lite/schema.js +82 -0
- package/lib/module/ai-components/charts/vega-lite/schema.js.map +1 -0
- package/lib/module/ai-components/components/BottomSheet.js +182 -0
- package/lib/module/ai-components/components/BottomSheet.js.map +1 -0
- package/lib/module/ai-components/components/MarkdownReactiveScrollView.js +81 -0
- package/lib/module/ai-components/components/MarkdownReactiveScrollView.js.map +1 -0
- package/lib/module/ai-components/components/index.js +26 -0
- package/lib/module/ai-components/components/index.js.map +1 -0
- package/lib/module/ai-components/contexts/composer-context.js +68 -0
- package/lib/module/ai-components/contexts/composer-context.js.map +1 -0
- package/lib/module/ai-components/contexts/index.js +26 -0
- package/lib/module/ai-components/contexts/index.js.map +1 -0
- package/lib/module/ai-components/contexts/theme-context.js +53 -0
- package/lib/module/ai-components/contexts/theme-context.js.map +1 -0
- package/lib/module/ai-components/index.js +166 -0
- package/lib/module/ai-components/index.js.map +1 -0
- package/lib/module/ai-components/internal/hooks/useStableCallback.js +14 -0
- package/lib/module/ai-components/internal/hooks/useStableCallback.js.map +1 -0
- package/lib/module/ai-components/internal/icons/Camera.js +18 -0
- package/lib/module/ai-components/internal/icons/Camera.js.map +1 -0
- package/lib/module/ai-components/internal/icons/CircleStop.js +24 -0
- package/lib/module/ai-components/internal/icons/CircleStop.js.map +1 -0
- package/lib/module/ai-components/internal/icons/Close.js +18 -0
- package/lib/module/ai-components/internal/icons/Close.js.map +1 -0
- package/lib/module/ai-components/internal/icons/Mic.js +27 -0
- package/lib/module/ai-components/internal/icons/Mic.js.map +1 -0
- package/lib/module/ai-components/internal/icons/Picture.js +21 -0
- package/lib/module/ai-components/internal/icons/Picture.js.map +1 -0
- package/lib/module/ai-components/internal/icons/SendUp.js +28 -0
- package/lib/module/ai-components/internal/icons/SendUp.js.map +1 -0
- package/lib/module/ai-components/internal/icons/utils/base.js +42 -0
- package/lib/module/ai-components/internal/icons/utils/base.js.map +1 -0
- package/lib/module/ai-components/markdown/components/Autolink.js +37 -0
- package/lib/module/ai-components/markdown/components/Autolink.js.map +1 -0
- package/lib/module/ai-components/markdown/components/BlockQuote.js +37 -0
- package/lib/module/ai-components/markdown/components/BlockQuote.js.map +1 -0
- package/lib/module/ai-components/markdown/components/Bold.js +32 -0
- package/lib/module/ai-components/markdown/components/Bold.js.map +1 -0
- package/lib/module/ai-components/markdown/components/CodeBlock.js +114 -0
- package/lib/module/ai-components/markdown/components/CodeBlock.js.map +1 -0
- package/lib/module/ai-components/markdown/components/Emphasis.js +32 -0
- package/lib/module/ai-components/markdown/components/Emphasis.js.map +1 -0
- package/lib/module/ai-components/markdown/components/Heading.js +41 -0
- package/lib/module/ai-components/markdown/components/Heading.js.map +1 -0
- package/lib/module/ai-components/markdown/components/HorizontalRule.js +26 -0
- package/lib/module/ai-components/markdown/components/HorizontalRule.js.map +1 -0
- package/lib/module/ai-components/markdown/components/InlineCode.js +32 -0
- package/lib/module/ai-components/markdown/components/InlineCode.js.map +1 -0
- package/lib/module/ai-components/markdown/components/LineBreak.js +27 -0
- package/lib/module/ai-components/markdown/components/LineBreak.js.map +1 -0
- package/lib/module/ai-components/markdown/components/Link.js +41 -0
- package/lib/module/ai-components/markdown/components/Link.js.map +1 -0
- package/lib/module/ai-components/markdown/components/List.js +85 -0
- package/lib/module/ai-components/markdown/components/List.js.map +1 -0
- package/lib/module/ai-components/markdown/components/Mailto.js +37 -0
- package/lib/module/ai-components/markdown/components/Mailto.js.map +1 -0
- package/lib/module/ai-components/markdown/components/Markdown.js +49 -0
- package/lib/module/ai-components/markdown/components/Markdown.js.map +1 -0
- package/lib/module/ai-components/markdown/components/NewLine.js +27 -0
- package/lib/module/ai-components/markdown/components/NewLine.js.map +1 -0
- package/lib/module/ai-components/markdown/components/Paragraph.js +72 -0
- package/lib/module/ai-components/markdown/components/Paragraph.js.map +1 -0
- package/lib/module/ai-components/markdown/components/Strikethrough.js +32 -0
- package/lib/module/ai-components/markdown/components/Strikethrough.js.map +1 -0
- package/lib/module/ai-components/markdown/components/Table.js +105 -0
- package/lib/module/ai-components/markdown/components/Table.js.map +1 -0
- package/lib/module/ai-components/markdown/components/Text.js +45 -0
- package/lib/module/ai-components/markdown/components/Text.js.map +1 -0
- package/lib/module/ai-components/markdown/components/Url.js +37 -0
- package/lib/module/ai-components/markdown/components/Url.js.map +1 -0
- package/lib/module/ai-components/markdown/components/index.js +213 -0
- package/lib/module/ai-components/markdown/components/index.js.map +1 -0
- package/lib/module/ai-components/markdown/index.js +59 -0
- package/lib/module/ai-components/markdown/index.js.map +1 -0
- package/lib/module/ai-components/markdown/rules.js +152 -0
- package/lib/module/ai-components/markdown/rules.js.map +1 -0
- package/lib/module/ai-components/markdown/styles.js +240 -0
- package/lib/module/ai-components/markdown/styles.js.map +1 -0
- package/lib/module/ai-components/markdown/types.js +4 -0
- package/lib/module/ai-components/markdown/types.js.map +1 -0
- package/lib/module/ai-components/markdown/utils/generate-markdown-text.js +73 -0
- package/lib/module/ai-components/markdown/utils/generate-markdown-text.js.map +1 -0
- package/lib/module/ai-components/markdown/utils/index.js +15 -0
- package/lib/module/ai-components/markdown/utils/index.js.map +1 -0
- package/lib/module/ai-components/message-composer/ActionButton.js +104 -0
- package/lib/module/ai-components/message-composer/ActionButton.js.map +1 -0
- package/lib/module/ai-components/message-composer/ActionSheet.js +197 -0
- package/lib/module/ai-components/message-composer/ActionSheet.js.map +1 -0
- package/lib/module/ai-components/message-composer/AttachmentButton.js +55 -0
- package/lib/module/ai-components/message-composer/AttachmentButton.js.map +1 -0
- package/lib/module/ai-components/message-composer/ComposerView.js +151 -0
- package/lib/module/ai-components/message-composer/ComposerView.js.map +1 -0
- package/lib/module/ai-components/message-composer/MediaPreviewList.js +84 -0
- package/lib/module/ai-components/message-composer/MediaPreviewList.js.map +1 -0
- package/lib/module/ai-components/message-composer/SpeechToTextButton.js +82 -0
- package/lib/module/ai-components/message-composer/SpeechToTextButton.js.map +1 -0
- package/lib/module/ai-components/message-composer/index.js +59 -0
- package/lib/module/ai-components/message-composer/index.js.map +1 -0
- package/lib/module/ai-components/message-composer/utils/withCloseSheet.js +16 -0
- package/lib/module/ai-components/message-composer/utils/withCloseSheet.js.map +1 -0
- package/lib/module/ai-components/native/AIDictation.js +60 -0
- package/lib/module/ai-components/native/AIDictation.js.map +1 -0
- package/lib/module/ai-components/native/PerfText.js +31 -0
- package/lib/module/ai-components/native/PerfText.js.map +1 -0
- package/lib/module/ai-components/native-specs/NativeAIDictation.js +7 -0
- package/lib/module/ai-components/native-specs/NativeAIDictation.js.map +1 -0
- package/lib/module/ai-components/services/clipboard-service/expo.js +13 -0
- package/lib/module/ai-components/services/clipboard-service/expo.js.map +1 -0
- package/lib/module/ai-components/services/clipboard-service/index.js +8 -0
- package/lib/module/ai-components/services/clipboard-service/index.js.map +1 -0
- package/lib/module/ai-components/services/clipboard-service/rncli.js +10 -0
- package/lib/module/ai-components/services/clipboard-service/rncli.js.map +1 -0
- package/lib/module/ai-components/services/index.js +26 -0
- package/lib/module/ai-components/services/index.js.map +1 -0
- package/lib/module/ai-components/services/media-picker-service/AbstractMediaPickerService.js +31 -0
- package/lib/module/ai-components/services/media-picker-service/AbstractMediaPickerService.js.map +1 -0
- package/lib/module/ai-components/services/media-picker-service/expo.js +169 -0
- package/lib/module/ai-components/services/media-picker-service/expo.js.map +1 -0
- package/lib/module/ai-components/services/media-picker-service/hooks/useMediaPickerState.js +14 -0
- package/lib/module/ai-components/services/media-picker-service/hooks/useMediaPickerState.js.map +1 -0
- package/lib/module/ai-components/services/media-picker-service/index.js +8 -0
- package/lib/module/ai-components/services/media-picker-service/index.js.map +1 -0
- package/lib/module/ai-components/services/media-picker-service/optional-modules.d.js +2 -0
- package/lib/module/ai-components/services/media-picker-service/optional-modules.d.js.map +1 -0
- package/lib/module/ai-components/services/media-picker-service/rncli.js +162 -0
- package/lib/module/ai-components/services/media-picker-service/rncli.js.map +1 -0
- package/lib/module/ai-components/store/bottom-sheet/store.js +27 -0
- package/lib/module/ai-components/store/bottom-sheet/store.js.map +1 -0
- package/lib/module/ai-components/store/bottom-sheet/useBottomSheetState.js +16 -0
- package/lib/module/ai-components/store/bottom-sheet/useBottomSheetState.js.map +1 -0
- package/lib/module/ai-components/store/composer/store.js +11 -0
- package/lib/module/ai-components/store/composer/store.js.map +1 -0
- package/lib/module/ai-components/store/composer/useComposerHasText.js +18 -0
- package/lib/module/ai-components/store/composer/useComposerHasText.js.map +1 -0
- package/lib/module/ai-components/store/composer/useComposerText.js +18 -0
- package/lib/module/ai-components/store/composer/useComposerText.js.map +1 -0
- package/lib/module/ai-components/store/dictation/store.js +17 -0
- package/lib/module/ai-components/store/dictation/store.js.map +1 -0
- package/lib/module/ai-components/store/dictation/useDictationState.js +18 -0
- package/lib/module/ai-components/store/dictation/useDictationState.js.map +1 -0
- package/lib/module/ai-components/store/dictation/useDictationTranscript.js +14 -0
- package/lib/module/ai-components/store/dictation/useDictationTranscript.js.map +1 -0
- package/lib/module/ai-components/store/index.js +70 -0
- package/lib/module/ai-components/store/index.js.map +1 -0
- package/lib/module/ai-components/syntax-highlighting/SyntaxHighlighter.js +51 -0
- package/lib/module/ai-components/syntax-highlighting/SyntaxHighlighter.js.map +1 -0
- package/lib/module/ai-components/syntax-highlighting/components/AndroidNativeRenderer.js +35 -0
- package/lib/module/ai-components/syntax-highlighting/components/AndroidNativeRenderer.js.map +1 -0
- package/lib/module/ai-components/syntax-highlighting/components/index.js +15 -0
- package/lib/module/ai-components/syntax-highlighting/components/index.js.map +1 -0
- package/lib/module/ai-components/syntax-highlighting/index.js +48 -0
- package/lib/module/ai-components/syntax-highlighting/index.js.map +1 -0
- package/lib/module/ai-components/syntax-highlighting/prism-config.js +7 -0
- package/lib/module/ai-components/syntax-highlighting/prism-config.js.map +1 -0
- package/lib/module/ai-components/syntax-highlighting/types.js +4 -0
- package/lib/module/ai-components/syntax-highlighting/types.js.map +1 -0
- package/lib/module/ai-components/syntax-highlighting/utils/converter.js +107 -0
- package/lib/module/ai-components/syntax-highlighting/utils/converter.js.map +1 -0
- package/lib/module/ai-components/syntax-highlighting/utils/flatten-nodes.js +139 -0
- package/lib/module/ai-components/syntax-highlighting/utils/flatten-nodes.js.map +1 -0
- package/lib/module/ai-components/syntax-highlighting/utils/index.js +37 -0
- package/lib/module/ai-components/syntax-highlighting/utils/index.js.map +1 -0
- package/lib/module/ai-components/syntax-highlighting/utils/renderer.js +117 -0
- package/lib/module/ai-components/syntax-highlighting/utils/renderer.js.map +1 -0
- package/lib/module/ai-components/theme.js +99 -0
- package/lib/module/ai-components/theme.js.map +1 -0
- package/lib/module/ai-components/transcription/useDictation.js +114 -0
- package/lib/module/ai-components/transcription/useDictation.js.map +1 -0
- package/lib/module/native.js +4 -0
- package/lib/module/native.js.map +1 -1
- package/lib/module/version.json +1 -1
- package/lib/typescript/ai-components/AITypingIndicatorView.d.ts +4 -0
- package/lib/typescript/ai-components/AITypingIndicatorView.d.ts.map +1 -0
- package/lib/typescript/ai-components/StreamingMessageView.d.ts +19 -0
- package/lib/typescript/ai-components/StreamingMessageView.d.ts.map +1 -0
- package/lib/typescript/ai-components/charts/Chart.d.ts +10 -0
- package/lib/typescript/ai-components/charts/Chart.d.ts.map +1 -0
- package/lib/typescript/ai-components/charts/components/PieLegend.d.ts +7 -0
- package/lib/typescript/ai-components/charts/components/PieLegend.d.ts.map +1 -0
- package/lib/typescript/ai-components/charts/components/VictoryChart.d.ts +9 -0
- package/lib/typescript/ai-components/charts/components/VictoryChart.d.ts.map +1 -0
- package/lib/typescript/ai-components/charts/components/index.d.ts +3 -0
- package/lib/typescript/ai-components/charts/components/index.d.ts.map +1 -0
- package/lib/typescript/ai-components/charts/index.d.ts +7 -0
- package/lib/typescript/ai-components/charts/index.d.ts.map +1 -0
- package/lib/typescript/ai-components/charts/mermaid/index.d.ts +2 -0
- package/lib/typescript/ai-components/charts/mermaid/index.d.ts.map +1 -0
- package/lib/typescript/ai-components/charts/mermaid/parser.d.ts +4 -0
- package/lib/typescript/ai-components/charts/mermaid/parser.d.ts.map +1 -0
- package/lib/typescript/ai-components/charts/types.d.ts +23 -0
- package/lib/typescript/ai-components/charts/types.d.ts.map +1 -0
- package/lib/typescript/ai-components/charts/utils/generate-pie-colors.d.ts +9 -0
- package/lib/typescript/ai-components/charts/utils/generate-pie-colors.d.ts.map +1 -0
- package/lib/typescript/ai-components/charts/utils/index.d.ts +3 -0
- package/lib/typescript/ai-components/charts/utils/index.d.ts.map +1 -0
- package/lib/typescript/ai-components/charts/utils/parse-json-chart.d.ts +3 -0
- package/lib/typescript/ai-components/charts/utils/parse-json-chart.d.ts.map +1 -0
- package/lib/typescript/ai-components/charts/vega-lite/index.d.ts +3 -0
- package/lib/typescript/ai-components/charts/vega-lite/index.d.ts.map +1 -0
- package/lib/typescript/ai-components/charts/vega-lite/parser.d.ts +4 -0
- package/lib/typescript/ai-components/charts/vega-lite/parser.d.ts.map +1 -0
- package/lib/typescript/ai-components/charts/vega-lite/schema.d.ts +305 -0
- package/lib/typescript/ai-components/charts/vega-lite/schema.d.ts.map +1 -0
- package/lib/typescript/ai-components/components/BottomSheet.d.ts +5 -0
- package/lib/typescript/ai-components/components/BottomSheet.d.ts.map +1 -0
- package/lib/typescript/ai-components/components/MarkdownReactiveScrollView.d.ts +3 -0
- package/lib/typescript/ai-components/components/MarkdownReactiveScrollView.d.ts.map +1 -0
- package/lib/typescript/ai-components/components/index.d.ts +3 -0
- package/lib/typescript/ai-components/components/index.d.ts.map +1 -0
- package/lib/typescript/ai-components/contexts/composer-context.d.ts +16 -0
- package/lib/typescript/ai-components/contexts/composer-context.d.ts.map +1 -0
- package/lib/typescript/ai-components/contexts/index.d.ts +3 -0
- package/lib/typescript/ai-components/contexts/index.d.ts.map +1 -0
- package/lib/typescript/ai-components/contexts/theme-context.d.ts +23 -0
- package/lib/typescript/ai-components/contexts/theme-context.d.ts.map +1 -0
- package/lib/typescript/ai-components/index.d.ts +15 -0
- package/lib/typescript/ai-components/index.d.ts.map +1 -0
- package/lib/typescript/ai-components/internal/hooks/useStableCallback.d.ts +26 -0
- package/lib/typescript/ai-components/internal/hooks/useStableCallback.d.ts.map +1 -0
- package/lib/typescript/ai-components/internal/icons/Camera.d.ts +4 -0
- package/lib/typescript/ai-components/internal/icons/Camera.d.ts.map +1 -0
- package/lib/typescript/ai-components/internal/icons/CircleStop.d.ts +8 -0
- package/lib/typescript/ai-components/internal/icons/CircleStop.d.ts.map +1 -0
- package/lib/typescript/ai-components/internal/icons/Close.d.ts +4 -0
- package/lib/typescript/ai-components/internal/icons/Close.d.ts.map +1 -0
- package/lib/typescript/ai-components/internal/icons/Mic.d.ts +8 -0
- package/lib/typescript/ai-components/internal/icons/Mic.d.ts.map +1 -0
- package/lib/typescript/ai-components/internal/icons/Picture.d.ts +4 -0
- package/lib/typescript/ai-components/internal/icons/Picture.d.ts.map +1 -0
- package/lib/typescript/ai-components/internal/icons/SendUp.d.ts +8 -0
- package/lib/typescript/ai-components/internal/icons/SendUp.d.ts.map +1 -0
- package/lib/typescript/ai-components/internal/icons/utils/base.d.ts +13 -0
- package/lib/typescript/ai-components/internal/icons/utils/base.d.ts.map +1 -0
- package/lib/typescript/ai-components/markdown/components/Autolink.d.ts +4 -0
- package/lib/typescript/ai-components/markdown/components/Autolink.d.ts.map +1 -0
- package/lib/typescript/ai-components/markdown/components/BlockQuote.d.ts +4 -0
- package/lib/typescript/ai-components/markdown/components/BlockQuote.d.ts.map +1 -0
- package/lib/typescript/ai-components/markdown/components/Bold.d.ts +4 -0
- package/lib/typescript/ai-components/markdown/components/Bold.d.ts.map +1 -0
- package/lib/typescript/ai-components/markdown/components/CodeBlock.d.ts +9 -0
- package/lib/typescript/ai-components/markdown/components/CodeBlock.d.ts.map +1 -0
- package/lib/typescript/ai-components/markdown/components/Emphasis.d.ts +4 -0
- package/lib/typescript/ai-components/markdown/components/Emphasis.d.ts.map +1 -0
- package/lib/typescript/ai-components/markdown/components/Heading.d.ts +4 -0
- package/lib/typescript/ai-components/markdown/components/Heading.d.ts.map +1 -0
- package/lib/typescript/ai-components/markdown/components/HorizontalRule.d.ts +4 -0
- package/lib/typescript/ai-components/markdown/components/HorizontalRule.d.ts.map +1 -0
- package/lib/typescript/ai-components/markdown/components/InlineCode.d.ts +4 -0
- package/lib/typescript/ai-components/markdown/components/InlineCode.d.ts.map +1 -0
- package/lib/typescript/ai-components/markdown/components/LineBreak.d.ts +4 -0
- package/lib/typescript/ai-components/markdown/components/LineBreak.d.ts.map +1 -0
- package/lib/typescript/ai-components/markdown/components/Link.d.ts +4 -0
- package/lib/typescript/ai-components/markdown/components/Link.d.ts.map +1 -0
- package/lib/typescript/ai-components/markdown/components/List.d.ts +4 -0
- package/lib/typescript/ai-components/markdown/components/List.d.ts.map +1 -0
- package/lib/typescript/ai-components/markdown/components/Mailto.d.ts +4 -0
- package/lib/typescript/ai-components/markdown/components/Mailto.d.ts.map +1 -0
- package/lib/typescript/ai-components/markdown/components/Markdown.d.ts +4 -0
- package/lib/typescript/ai-components/markdown/components/Markdown.d.ts.map +1 -0
- package/lib/typescript/ai-components/markdown/components/NewLine.d.ts +4 -0
- package/lib/typescript/ai-components/markdown/components/NewLine.d.ts.map +1 -0
- package/lib/typescript/ai-components/markdown/components/Paragraph.d.ts +5 -0
- package/lib/typescript/ai-components/markdown/components/Paragraph.d.ts.map +1 -0
- package/lib/typescript/ai-components/markdown/components/Strikethrough.d.ts +4 -0
- package/lib/typescript/ai-components/markdown/components/Strikethrough.d.ts.map +1 -0
- package/lib/typescript/ai-components/markdown/components/Table.d.ts +4 -0
- package/lib/typescript/ai-components/markdown/components/Table.d.ts.map +1 -0
- package/lib/typescript/ai-components/markdown/components/Text.d.ts +4 -0
- package/lib/typescript/ai-components/markdown/components/Text.d.ts.map +1 -0
- package/lib/typescript/ai-components/markdown/components/Url.d.ts +4 -0
- package/lib/typescript/ai-components/markdown/components/Url.d.ts.map +1 -0
- package/lib/typescript/ai-components/markdown/components/index.d.ts +20 -0
- package/lib/typescript/ai-components/markdown/components/index.d.ts.map +1 -0
- package/lib/typescript/ai-components/markdown/index.d.ts +6 -0
- package/lib/typescript/ai-components/markdown/index.d.ts.map +1 -0
- package/lib/typescript/ai-components/markdown/rules.d.ts +4 -0
- package/lib/typescript/ai-components/markdown/rules.d.ts.map +1 -0
- package/lib/typescript/ai-components/markdown/styles.d.ts +232 -0
- package/lib/typescript/ai-components/markdown/styles.d.ts.map +1 -0
- package/lib/typescript/ai-components/markdown/types.d.ts +137 -0
- package/lib/typescript/ai-components/markdown/types.d.ts.map +1 -0
- package/lib/typescript/ai-components/markdown/utils/generate-markdown-text.d.ts +5 -0
- package/lib/typescript/ai-components/markdown/utils/generate-markdown-text.d.ts.map +1 -0
- package/lib/typescript/ai-components/markdown/utils/index.d.ts +2 -0
- package/lib/typescript/ai-components/markdown/utils/index.d.ts.map +1 -0
- package/lib/typescript/ai-components/message-composer/ActionButton.d.ts +4 -0
- package/lib/typescript/ai-components/message-composer/ActionButton.d.ts.map +1 -0
- package/lib/typescript/ai-components/message-composer/ActionSheet.d.ts +16 -0
- package/lib/typescript/ai-components/message-composer/ActionSheet.d.ts.map +1 -0
- package/lib/typescript/ai-components/message-composer/AttachmentButton.d.ts +3 -0
- package/lib/typescript/ai-components/message-composer/AttachmentButton.d.ts.map +1 -0
- package/lib/typescript/ai-components/message-composer/ComposerView.d.ts +33 -0
- package/lib/typescript/ai-components/message-composer/ComposerView.d.ts.map +1 -0
- package/lib/typescript/ai-components/message-composer/MediaPreviewList.d.ts +3 -0
- package/lib/typescript/ai-components/message-composer/MediaPreviewList.d.ts.map +1 -0
- package/lib/typescript/ai-components/message-composer/SpeechToTextButton.d.ts +12 -0
- package/lib/typescript/ai-components/message-composer/SpeechToTextButton.d.ts.map +1 -0
- package/lib/typescript/ai-components/message-composer/index.d.ts +6 -0
- package/lib/typescript/ai-components/message-composer/index.d.ts.map +1 -0
- package/lib/typescript/ai-components/message-composer/utils/withCloseSheet.d.ts +2 -0
- package/lib/typescript/ai-components/message-composer/utils/withCloseSheet.d.ts.map +1 -0
- package/lib/typescript/ai-components/native/AIDictation.d.ts +18 -0
- package/lib/typescript/ai-components/native/AIDictation.d.ts.map +1 -0
- package/lib/typescript/ai-components/native/PerfText.d.ts +13 -0
- package/lib/typescript/ai-components/native/PerfText.d.ts.map +1 -0
- package/lib/typescript/ai-components/native-specs/NativeAIDictation.d.ts +40 -0
- package/lib/typescript/ai-components/native-specs/NativeAIDictation.d.ts.map +1 -0
- package/lib/typescript/ai-components/services/clipboard-service/expo.d.ts +2 -0
- package/lib/typescript/ai-components/services/clipboard-service/expo.d.ts.map +1 -0
- package/lib/typescript/ai-components/services/clipboard-service/index.d.ts +2 -0
- package/lib/typescript/ai-components/services/clipboard-service/index.d.ts.map +1 -0
- package/lib/typescript/ai-components/services/clipboard-service/rncli.d.ts +2 -0
- package/lib/typescript/ai-components/services/clipboard-service/rncli.d.ts.map +1 -0
- package/lib/typescript/ai-components/services/index.d.ts +3 -0
- package/lib/typescript/ai-components/services/index.d.ts.map +1 -0
- package/lib/typescript/ai-components/services/media-picker-service/AbstractMediaPickerService.d.ts +40 -0
- package/lib/typescript/ai-components/services/media-picker-service/AbstractMediaPickerService.d.ts.map +1 -0
- package/lib/typescript/ai-components/services/media-picker-service/expo.d.ts +34 -0
- package/lib/typescript/ai-components/services/media-picker-service/expo.d.ts.map +1 -0
- package/lib/typescript/ai-components/services/media-picker-service/hooks/useMediaPickerState.d.ts +11 -0
- package/lib/typescript/ai-components/services/media-picker-service/hooks/useMediaPickerState.d.ts.map +1 -0
- package/lib/typescript/ai-components/services/media-picker-service/index.d.ts +37 -0
- package/lib/typescript/ai-components/services/media-picker-service/index.d.ts.map +1 -0
- package/lib/typescript/ai-components/services/media-picker-service/rncli.d.ts +34 -0
- package/lib/typescript/ai-components/services/media-picker-service/rncli.d.ts.map +1 -0
- package/lib/typescript/ai-components/store/bottom-sheet/store.d.ts +12 -0
- package/lib/typescript/ai-components/store/bottom-sheet/store.d.ts.map +1 -0
- package/lib/typescript/ai-components/store/bottom-sheet/useBottomSheetState.d.ts +5 -0
- package/lib/typescript/ai-components/store/bottom-sheet/useBottomSheetState.d.ts.map +1 -0
- package/lib/typescript/ai-components/store/composer/store.d.ts +7 -0
- package/lib/typescript/ai-components/store/composer/store.d.ts.map +1 -0
- package/lib/typescript/ai-components/store/composer/useComposerHasText.d.ts +4 -0
- package/lib/typescript/ai-components/store/composer/useComposerHasText.d.ts.map +1 -0
- package/lib/typescript/ai-components/store/composer/useComposerText.d.ts +4 -0
- package/lib/typescript/ai-components/store/composer/useComposerText.d.ts.map +1 -0
- package/lib/typescript/ai-components/store/dictation/store.d.ts +13 -0
- package/lib/typescript/ai-components/store/dictation/store.d.ts.map +1 -0
- package/lib/typescript/ai-components/store/dictation/useDictationState.d.ts +6 -0
- package/lib/typescript/ai-components/store/dictation/useDictationState.d.ts.map +1 -0
- package/lib/typescript/ai-components/store/dictation/useDictationTranscript.d.ts +4 -0
- package/lib/typescript/ai-components/store/dictation/useDictationTranscript.d.ts.map +1 -0
- package/lib/typescript/ai-components/store/index.d.ts +7 -0
- package/lib/typescript/ai-components/store/index.d.ts.map +1 -0
- package/lib/typescript/ai-components/syntax-highlighting/SyntaxHighlighter.d.ts +11 -0
- package/lib/typescript/ai-components/syntax-highlighting/SyntaxHighlighter.d.ts.map +1 -0
- package/lib/typescript/ai-components/syntax-highlighting/components/AndroidNativeRenderer.d.ts +10 -0
- package/lib/typescript/ai-components/syntax-highlighting/components/AndroidNativeRenderer.d.ts.map +1 -0
- package/lib/typescript/ai-components/syntax-highlighting/components/index.d.ts +2 -0
- package/lib/typescript/ai-components/syntax-highlighting/components/index.d.ts.map +1 -0
- package/lib/typescript/ai-components/syntax-highlighting/index.d.ts +10 -0
- package/lib/typescript/ai-components/syntax-highlighting/index.d.ts.map +1 -0
- package/lib/typescript/ai-components/syntax-highlighting/prism-config.d.ts +2 -0
- package/lib/typescript/ai-components/syntax-highlighting/prism-config.d.ts.map +1 -0
- package/lib/typescript/ai-components/syntax-highlighting/types.d.ts +21 -0
- package/lib/typescript/ai-components/syntax-highlighting/types.d.ts.map +1 -0
- package/lib/typescript/ai-components/syntax-highlighting/utils/converter.d.ts +5 -0
- package/lib/typescript/ai-components/syntax-highlighting/utils/converter.d.ts.map +1 -0
- package/lib/typescript/ai-components/syntax-highlighting/utils/flatten-nodes.d.ts +19 -0
- package/lib/typescript/ai-components/syntax-highlighting/utils/flatten-nodes.d.ts.map +1 -0
- package/lib/typescript/ai-components/syntax-highlighting/utils/index.d.ts +4 -0
- package/lib/typescript/ai-components/syntax-highlighting/utils/index.d.ts.map +1 -0
- package/lib/typescript/ai-components/syntax-highlighting/utils/renderer.d.ts +30 -0
- package/lib/typescript/ai-components/syntax-highlighting/utils/renderer.d.ts.map +1 -0
- package/lib/typescript/ai-components/theme.d.ts +58 -0
- package/lib/typescript/ai-components/theme.d.ts.map +1 -0
- package/lib/typescript/ai-components/transcription/useDictation.d.ts +8 -0
- package/lib/typescript/ai-components/transcription/useDictation.d.ts.map +1 -0
- package/lib/typescript/native.d.ts +17 -1
- package/lib/typescript/native.d.ts.map +1 -1
- package/package.json +23 -5
- package/src/ai-components/AITypingIndicatorView.tsx +51 -0
- package/src/ai-components/README.md +279 -0
- package/src/ai-components/StreamingMessageView.tsx +85 -0
- package/src/ai-components/__tests__/ComposerView.test.tsx +113 -0
- package/src/ai-components/__tests__/Markdown.test.tsx +94 -0
- package/src/ai-components/__tests__/StreamingMessageView.test.tsx +126 -0
- package/src/ai-components/__tests__/SyntaxHighlighter.test.tsx +136 -0
- package/src/ai-components/__tests__/charts.test.ts +131 -0
- package/src/ai-components/__tests__/dictation.test.tsx +166 -0
- package/src/ai-components/__tests__/generateMarkdownText.test.ts +54 -0
- package/src/ai-components/__tests__/theme.test.tsx +41 -0
- package/src/ai-components/charts/Chart.tsx +20 -0
- package/src/ai-components/charts/components/PieLegend.tsx +50 -0
- package/src/ai-components/charts/components/VictoryChart.tsx +193 -0
- package/src/ai-components/charts/components/index.ts +2 -0
- package/src/ai-components/charts/index.ts +13 -0
- package/src/ai-components/charts/mermaid/index.ts +1 -0
- package/src/ai-components/charts/mermaid/parser.ts +33 -0
- package/src/ai-components/charts/types.ts +25 -0
- package/src/ai-components/charts/utils/generate-pie-colors.ts +82 -0
- package/src/ai-components/charts/utils/index.ts +2 -0
- package/src/ai-components/charts/utils/parse-json-chart.ts +15 -0
- package/src/ai-components/charts/vega-lite/index.ts +2 -0
- package/src/ai-components/charts/vega-lite/parser.ts +49 -0
- package/src/ai-components/charts/vega-lite/schema.ts +112 -0
- package/src/ai-components/components/BottomSheet.tsx +158 -0
- package/src/ai-components/components/MarkdownReactiveScrollView.tsx +92 -0
- package/src/ai-components/components/index.ts +2 -0
- package/src/ai-components/contexts/composer-context.tsx +73 -0
- package/src/ai-components/contexts/index.ts +2 -0
- package/src/ai-components/contexts/theme-context.tsx +68 -0
- package/src/ai-components/index.ts +29 -0
- package/src/ai-components/internal/hooks/useStableCallback.ts +37 -0
- package/src/ai-components/internal/icons/Camera.tsx +12 -0
- package/src/ai-components/internal/icons/CircleStop.tsx +18 -0
- package/src/ai-components/internal/icons/Close.tsx +12 -0
- package/src/ai-components/internal/icons/Mic.tsx +20 -0
- package/src/ai-components/internal/icons/Picture.tsx +16 -0
- package/src/ai-components/internal/icons/SendUp.tsx +21 -0
- package/src/ai-components/internal/icons/utils/base.tsx +44 -0
- package/src/ai-components/markdown/components/Autolink.tsx +26 -0
- package/src/ai-components/markdown/components/BlockQuote.tsx +19 -0
- package/src/ai-components/markdown/components/Bold.tsx +16 -0
- package/src/ai-components/markdown/components/CodeBlock.tsx +96 -0
- package/src/ai-components/markdown/components/Emphasis.tsx +16 -0
- package/src/ai-components/markdown/components/Heading.tsx +30 -0
- package/src/ai-components/markdown/components/HorizontalRule.tsx +9 -0
- package/src/ai-components/markdown/components/InlineCode.tsx +16 -0
- package/src/ai-components/markdown/components/LineBreak.tsx +11 -0
- package/src/ai-components/markdown/components/Link.tsx +28 -0
- package/src/ai-components/markdown/components/List.tsx +65 -0
- package/src/ai-components/markdown/components/Mailto.tsx +26 -0
- package/src/ai-components/markdown/components/Markdown.tsx +59 -0
- package/src/ai-components/markdown/components/NewLine.tsx +11 -0
- package/src/ai-components/markdown/components/Paragraph.tsx +69 -0
- package/src/ai-components/markdown/components/Strikethrough.tsx +16 -0
- package/src/ai-components/markdown/components/Table.tsx +81 -0
- package/src/ai-components/markdown/components/Text.tsx +37 -0
- package/src/ai-components/markdown/components/Url.tsx +26 -0
- package/src/ai-components/markdown/components/index.ts +20 -0
- package/src/ai-components/markdown/index.tsx +5 -0
- package/src/ai-components/markdown/rules.ts +216 -0
- package/src/ai-components/markdown/styles.ts +236 -0
- package/src/ai-components/markdown/types.ts +163 -0
- package/src/ai-components/markdown/utils/generate-markdown-text.ts +117 -0
- package/src/ai-components/markdown/utils/index.ts +1 -0
- package/src/ai-components/message-composer/ActionButton.tsx +99 -0
- package/src/ai-components/message-composer/ActionSheet.tsx +205 -0
- package/src/ai-components/message-composer/AttachmentButton.tsx +49 -0
- package/src/ai-components/message-composer/ComposerView.tsx +187 -0
- package/src/ai-components/message-composer/MediaPreviewList.tsx +84 -0
- package/src/ai-components/message-composer/SpeechToTextButton.tsx +79 -0
- package/src/ai-components/message-composer/index.ts +5 -0
- package/src/ai-components/message-composer/utils/withCloseSheet.ts +11 -0
- package/src/ai-components/native/AIDictation.ts +77 -0
- package/src/ai-components/native/PerfText.tsx +32 -0
- package/src/ai-components/native-specs/NativeAIDictation.ts +48 -0
- package/src/ai-components/services/clipboard-service/expo.ts +11 -0
- package/src/ai-components/services/clipboard-service/index.ts +4 -0
- package/src/ai-components/services/clipboard-service/rncli.ts +11 -0
- package/src/ai-components/services/index.ts +2 -0
- package/src/ai-components/services/media-picker-service/AbstractMediaPickerService.ts +62 -0
- package/src/ai-components/services/media-picker-service/expo.ts +148 -0
- package/src/ai-components/services/media-picker-service/hooks/useMediaPickerState.ts +14 -0
- package/src/ai-components/services/media-picker-service/index.ts +4 -0
- package/src/ai-components/services/media-picker-service/optional-modules.d.ts +25 -0
- package/src/ai-components/services/media-picker-service/rncli.ts +142 -0
- package/src/ai-components/store/bottom-sheet/store.ts +30 -0
- package/src/ai-components/store/bottom-sheet/useBottomSheetState.ts +10 -0
- package/src/ai-components/store/composer/store.ts +12 -0
- package/src/ai-components/store/composer/useComposerHasText.ts +14 -0
- package/src/ai-components/store/composer/useComposerText.ts +14 -0
- package/src/ai-components/store/dictation/store.ts +23 -0
- package/src/ai-components/store/dictation/useDictationState.ts +11 -0
- package/src/ai-components/store/dictation/useDictationTranscript.ts +9 -0
- package/src/ai-components/store/index.ts +11 -0
- package/src/ai-components/syntax-highlighting/SyntaxHighlighter.tsx +66 -0
- package/src/ai-components/syntax-highlighting/components/AndroidNativeRenderer.tsx +29 -0
- package/src/ai-components/syntax-highlighting/components/index.ts +1 -0
- package/src/ai-components/syntax-highlighting/index.ts +11 -0
- package/src/ai-components/syntax-highlighting/prism-config.ts +4 -0
- package/src/ai-components/syntax-highlighting/types.ts +26 -0
- package/src/ai-components/syntax-highlighting/utils/converter.ts +145 -0
- package/src/ai-components/syntax-highlighting/utils/flatten-nodes.ts +150 -0
- package/src/ai-components/syntax-highlighting/utils/index.ts +3 -0
- package/src/ai-components/syntax-highlighting/utils/renderer.tsx +151 -0
- package/src/ai-components/theme.ts +138 -0
- package/src/ai-components/transcription/useDictation.ts +106 -0
- package/src/native.ts +19 -1
- package/src/version.json +1 -1
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
import { type IconProps, RootPath, RootSvg } from './utils/base';
|
|
4
|
+
|
|
5
|
+
export const Close = (props: IconProps) => (
|
|
6
|
+
<RootSvg {...props}>
|
|
7
|
+
<RootPath
|
|
8
|
+
d='M7.05 7.05a1 1 0 000 1.414L10.586 12 7.05 15.536a1 1 0 101.414 1.414L12 13.414l3.536 3.536a1 1 0 001.414-1.414L13.414 12l3.536-3.536a1 1 0 00-1.414-1.414L12 10.586 8.464 7.05a1 1 0 00-1.414 0z'
|
|
9
|
+
{...props}
|
|
10
|
+
/>
|
|
11
|
+
</RootSvg>
|
|
12
|
+
);
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
import { G, Path, Svg } from 'react-native-svg';
|
|
4
|
+
|
|
5
|
+
import type { IconProps } from './utils/base';
|
|
6
|
+
|
|
7
|
+
type Props = IconProps & {
|
|
8
|
+
size: number;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export const Mic = ({ size, ...rest }: Props) => (
|
|
12
|
+
<Svg height={size} viewBox={`0 0 ${size} ${size}`} width={size} {...rest}>
|
|
13
|
+
<G id='24 / mic_iOS'>
|
|
14
|
+
<Path
|
|
15
|
+
d='M11.5234 13.9922C11.5234 16.8047 13.375 18.7734 16 18.7734C18.6367 18.7734 20.4766 16.8047 20.4766 13.9922V6.69141C20.4766 3.86719 18.6367 1.89844 16 1.89844C13.375 1.89844 11.5234 3.86719 11.5234 6.69141V13.9922ZM13.7383 14.0273V6.64453C13.7383 5.08594 14.6172 4.01953 16 4.01953C17.3828 4.01953 18.2617 5.08594 18.2617 6.64453V14.0273C18.2617 15.5977 17.3828 16.6523 16 16.6523C14.6172 16.6523 13.7383 15.5977 13.7383 14.0273ZM7.10547 14.5078C7.10547 19.3242 10.3047 22.6289 14.9336 23.0742V25.4766H10.6211C10.0234 25.4766 9.51953 25.9688 9.51953 26.5781C9.51953 27.1758 10.0234 27.668 10.6211 27.668H21.3789C21.9883 27.668 22.4922 27.1758 22.4922 26.5781C22.4922 25.9688 21.9883 25.4766 21.3789 25.4766H17.0781V23.0742C21.6953 22.6289 24.9062 19.3242 24.9062 14.5078V12.1875C24.9062 11.5781 24.4141 11.0977 23.8047 11.0977C23.1953 11.0977 22.6914 11.5781 22.6914 12.1875V14.4258C22.6914 18.4102 19.9961 21.0469 16 21.0469C12.0039 21.0469 9.30859 18.4102 9.30859 14.4258V12.1875C9.30859 11.5781 8.81641 11.0977 8.20703 11.0977C7.59766 11.0977 7.10547 11.5781 7.10547 12.1875V14.5078Z'
|
|
16
|
+
{...rest}
|
|
17
|
+
/>
|
|
18
|
+
</G>
|
|
19
|
+
</Svg>
|
|
20
|
+
);
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
import { type IconProps, RootPath, RootSvg } from './utils/base';
|
|
4
|
+
|
|
5
|
+
export const Picture = (props: IconProps) => (
|
|
6
|
+
<RootSvg {...props}>
|
|
7
|
+
<RootPath
|
|
8
|
+
d='M2 8a3 3 0 013-3h14a3 3 0 013 3v8a3 3 0 01-3 3H5a3 3 0 01-3-3V8zm3-1a1 1 0 00-1 1v8a1 1 0 001 1h14a1 1 0 001-1V8a1 1 0 00-1-1H5z'
|
|
9
|
+
{...props}
|
|
10
|
+
/>
|
|
11
|
+
<RootPath
|
|
12
|
+
d='M15.99 9a1 1 0 01.778.36l5 6a1 1 0 11-1.536 1.28l-4.216-5.059-3.235 4.044a1 1 0 01-1.381.175l-3.306-2.48-3.387 3.387a1 1 0 01-1.414-1.414l4-4A1 1 0 018.6 11.2l3.225 2.418 3.394-4.243A1 1 0 0115.99 9z'
|
|
13
|
+
{...props}
|
|
14
|
+
/>
|
|
15
|
+
</RootSvg>
|
|
16
|
+
);
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
import Svg, { Path } from 'react-native-svg';
|
|
4
|
+
|
|
5
|
+
import type { IconProps } from './utils/base';
|
|
6
|
+
|
|
7
|
+
type Props = IconProps & {
|
|
8
|
+
size: number;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export const SendUp = ({ size, ...rest }: Props) => (
|
|
12
|
+
<Svg height={size} viewBox={`0 0 ${size} ${size}`} width={size} {...rest} testID='send-up'>
|
|
13
|
+
{/*<Circle cx={size / 2} cy={size / 2} r={size / 2} {...rest} />*/}
|
|
14
|
+
<Path
|
|
15
|
+
clipRule='evenodd'
|
|
16
|
+
d='M14.6673 16V22.6667H17.334V16H22.6673L16.0007 9.33337L9.33398 16H14.6673Z'
|
|
17
|
+
fill={'white'}
|
|
18
|
+
fillRule='evenodd'
|
|
19
|
+
/>
|
|
20
|
+
</Svg>
|
|
21
|
+
);
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import Svg, { Path, type PathProps, type SvgProps } from 'react-native-svg';
|
|
3
|
+
|
|
4
|
+
export type IconProps = Partial<SvgProps> &
|
|
5
|
+
Omit<RootPathProps, 'd'> & {
|
|
6
|
+
height?: number;
|
|
7
|
+
width?: number;
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export const RootSvg = (props: IconProps) => {
|
|
11
|
+
const { children, height = 24, viewBox = '0 0 24 24', width = 24 } = props;
|
|
12
|
+
return (
|
|
13
|
+
<Svg
|
|
14
|
+
{...{
|
|
15
|
+
height,
|
|
16
|
+
viewBox,
|
|
17
|
+
width,
|
|
18
|
+
}}
|
|
19
|
+
{...props}
|
|
20
|
+
>
|
|
21
|
+
{children}
|
|
22
|
+
</Svg>
|
|
23
|
+
);
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export type RootPathProps = Pick<PathProps, 'd'> & {
|
|
27
|
+
pathFill?: SvgProps['fill'];
|
|
28
|
+
pathOpacity?: PathProps['opacity'];
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
export const RootPath = (props: RootPathProps) => {
|
|
32
|
+
const { d, pathFill = 'black', pathOpacity } = props;
|
|
33
|
+
return (
|
|
34
|
+
<Path
|
|
35
|
+
{...{
|
|
36
|
+
clipRule: 'evenodd',
|
|
37
|
+
d,
|
|
38
|
+
fill: pathFill,
|
|
39
|
+
fillRule: 'evenodd',
|
|
40
|
+
opacity: pathOpacity,
|
|
41
|
+
}}
|
|
42
|
+
/>
|
|
43
|
+
);
|
|
44
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Text } from 'react-native';
|
|
2
|
+
|
|
3
|
+
import type { MarkdownComponentProps, RuleRenderFunction } from '../types';
|
|
4
|
+
|
|
5
|
+
export const Autolink = ({ children, styles, onPress }: MarkdownComponentProps) => (
|
|
6
|
+
<Text style={styles.autolink} onPress={onPress}>
|
|
7
|
+
{children}
|
|
8
|
+
</Text>
|
|
9
|
+
);
|
|
10
|
+
|
|
11
|
+
export const renderAutolink: RuleRenderFunction = ({ node, output, state, styles, onLink }) => {
|
|
12
|
+
state.withinLink = true;
|
|
13
|
+
const onLinkPress = () => onLink && onLink(node.target);
|
|
14
|
+
return (
|
|
15
|
+
<Autolink
|
|
16
|
+
key={state.key}
|
|
17
|
+
node={node}
|
|
18
|
+
output={output}
|
|
19
|
+
state={state}
|
|
20
|
+
styles={styles}
|
|
21
|
+
onPress={onLinkPress}
|
|
22
|
+
>
|
|
23
|
+
{output(node.content, state)}
|
|
24
|
+
</Autolink>
|
|
25
|
+
);
|
|
26
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Text, View } from 'react-native';
|
|
2
|
+
|
|
3
|
+
import type { MarkdownComponentProps, RuleRenderFunction } from '../types';
|
|
4
|
+
|
|
5
|
+
export const BlockQuote = ({ children, styles }: MarkdownComponentProps) => (
|
|
6
|
+
<View style={styles.blockQuoteSection}>
|
|
7
|
+
<View style={styles.blockQuoteSectionBar} />
|
|
8
|
+
<Text style={styles.blockQuoteText}>{children}</Text>
|
|
9
|
+
</View>
|
|
10
|
+
);
|
|
11
|
+
|
|
12
|
+
export const renderBlockQuote: RuleRenderFunction = ({ node, output, state, styles }) => {
|
|
13
|
+
state.withinQuote = true;
|
|
14
|
+
return (
|
|
15
|
+
<BlockQuote key={state.key} node={node} output={output} state={state} styles={styles}>
|
|
16
|
+
{output(node.content, state)}
|
|
17
|
+
</BlockQuote>
|
|
18
|
+
);
|
|
19
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Text } from 'react-native';
|
|
2
|
+
|
|
3
|
+
import type { MarkdownComponentProps, RuleRenderFunction } from '../types';
|
|
4
|
+
|
|
5
|
+
export const Bold = ({ children, styles }: MarkdownComponentProps) => (
|
|
6
|
+
<Text style={styles.strong}>{children}</Text>
|
|
7
|
+
);
|
|
8
|
+
|
|
9
|
+
export const renderBold: RuleRenderFunction = ({ node, output, state, styles }) => {
|
|
10
|
+
state.withinText = true;
|
|
11
|
+
return (
|
|
12
|
+
<Bold key={state.key} node={node} output={output} state={state} styles={styles}>
|
|
13
|
+
{output(node.content, state)}
|
|
14
|
+
</Bold>
|
|
15
|
+
);
|
|
16
|
+
};
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import React, { type PropsWithChildren, useCallback, useMemo } from 'react';
|
|
2
|
+
import { Pressable, type PressableProps, Text, View } from 'react-native';
|
|
3
|
+
|
|
4
|
+
import { parseJsonChart } from '../../charts';
|
|
5
|
+
import { parseMermaid } from '../../charts';
|
|
6
|
+
import Chart from '../../charts/Chart';
|
|
7
|
+
import { MarkdownReactiveScrollView } from '../../components';
|
|
8
|
+
import { useStableCallback } from '../../internal/hooks/useStableCallback';
|
|
9
|
+
import { setClipboardString } from '../../services';
|
|
10
|
+
import { SyntaxHighlighter } from '../../syntax-highlighting';
|
|
11
|
+
import type { MarkdownComponentProps, RuleRenderFunction } from '../types';
|
|
12
|
+
|
|
13
|
+
export const CodeBlockCopyButton = ({ onPress }: { onPress?: PressableProps['onPress'] }) => (
|
|
14
|
+
<Pressable style={({ pressed }) => ({ opacity: pressed ? 0.5 : 1 })} onPress={onPress}>
|
|
15
|
+
<Text style={{ fontSize: 15 }}>{'\u29C9'}</Text>
|
|
16
|
+
</Pressable>
|
|
17
|
+
);
|
|
18
|
+
|
|
19
|
+
const areEqual = (prev: MarkdownComponentProps, next: MarkdownComponentProps) =>
|
|
20
|
+
prev.node.content === next.node.content;
|
|
21
|
+
|
|
22
|
+
export const CodeBlock = React.memo(({ styles, node }: MarkdownComponentProps) => {
|
|
23
|
+
const text = useMemo(() => node.content?.trim(), [node.content]);
|
|
24
|
+
|
|
25
|
+
const copyText = useStableCallback(() => {
|
|
26
|
+
if (setClipboardString) {
|
|
27
|
+
setClipboardString(text);
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
const CodeTag = useCallback(
|
|
32
|
+
({ children }: PropsWithChildren) => (
|
|
33
|
+
<View style={styles.codeBlockContainer}>
|
|
34
|
+
<Text style={styles.codeBlock}>{children}</Text>
|
|
35
|
+
</View>
|
|
36
|
+
),
|
|
37
|
+
[styles],
|
|
38
|
+
);
|
|
39
|
+
|
|
40
|
+
const CodeBlockHeader = useCallback(
|
|
41
|
+
() => (
|
|
42
|
+
<View style={styles.codeBlockHeaderContainer}>
|
|
43
|
+
<Text style={styles.codeBlockHeaderTitle}>{node.lang}</Text>
|
|
44
|
+
<CodeBlockCopyButton onPress={copyText} />
|
|
45
|
+
</View>
|
|
46
|
+
),
|
|
47
|
+
[styles, node.lang, copyText],
|
|
48
|
+
);
|
|
49
|
+
|
|
50
|
+
const CodeBlockWrapper = useCallback(
|
|
51
|
+
({ children }: PropsWithChildren) => (
|
|
52
|
+
<View style={styles.codeBlockWrapper}>
|
|
53
|
+
<CodeBlockHeader />
|
|
54
|
+
<MarkdownReactiveScrollView>{children}</MarkdownReactiveScrollView>
|
|
55
|
+
</View>
|
|
56
|
+
),
|
|
57
|
+
[CodeBlockHeader, styles.codeBlockWrapper],
|
|
58
|
+
);
|
|
59
|
+
|
|
60
|
+
if (node.lang === 'mermaid') {
|
|
61
|
+
try {
|
|
62
|
+
const parsed = parseMermaid(text);
|
|
63
|
+
if (parsed) {
|
|
64
|
+
return <Chart spec={parsed} />;
|
|
65
|
+
}
|
|
66
|
+
} catch (_e) {
|
|
67
|
+
/* do nothing */
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
if (node.lang === 'json') {
|
|
72
|
+
try {
|
|
73
|
+
const parsed = parseJsonChart(text);
|
|
74
|
+
if (parsed) {
|
|
75
|
+
return <Chart spec={parsed} />;
|
|
76
|
+
}
|
|
77
|
+
} catch (_e) {
|
|
78
|
+
/* do nothing */
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
return (
|
|
83
|
+
<SyntaxHighlighter
|
|
84
|
+
language={node.lang}
|
|
85
|
+
highlighter={'prism'}
|
|
86
|
+
CodeTag={CodeTag}
|
|
87
|
+
PreTag={CodeBlockWrapper}
|
|
88
|
+
>
|
|
89
|
+
{text}
|
|
90
|
+
</SyntaxHighlighter>
|
|
91
|
+
);
|
|
92
|
+
}, areEqual);
|
|
93
|
+
|
|
94
|
+
export const renderCodeBlock: RuleRenderFunction = ({ node, output, state, styles }) => (
|
|
95
|
+
<CodeBlock key={state.key} node={node} output={output} state={state} styles={styles} />
|
|
96
|
+
);
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Text } from 'react-native';
|
|
2
|
+
|
|
3
|
+
import type { MarkdownComponentProps, RuleRenderFunction } from '../types';
|
|
4
|
+
|
|
5
|
+
export const Emphasis = ({ children, styles }: MarkdownComponentProps) => (
|
|
6
|
+
<Text style={styles.em}>{children}</Text>
|
|
7
|
+
);
|
|
8
|
+
|
|
9
|
+
export const renderEmphasis: RuleRenderFunction = ({ node, output, state, styles }) => {
|
|
10
|
+
state.withinText = true;
|
|
11
|
+
return (
|
|
12
|
+
<Emphasis key={state.key} node={node} output={output} state={state} styles={styles}>
|
|
13
|
+
{output(node.content, state)}
|
|
14
|
+
</Emphasis>
|
|
15
|
+
);
|
|
16
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { useMemo } from 'react';
|
|
2
|
+
import { Text } from 'react-native';
|
|
3
|
+
|
|
4
|
+
import type { HeadingLevel, MarkdownComponentProps, RuleRenderFunction } from '../types';
|
|
5
|
+
|
|
6
|
+
const DEFAULT_HEADING_LEVEL = undefined;
|
|
7
|
+
|
|
8
|
+
const isValidHeadingLevel = (n: unknown): n is HeadingLevel =>
|
|
9
|
+
(Number.isInteger(n) && (n as number) >= 1 && (n as number) <= 6) || n === undefined;
|
|
10
|
+
|
|
11
|
+
export const Heading = ({ children, node, styles }: MarkdownComponentProps) => {
|
|
12
|
+
const headingLevel = isValidHeadingLevel(node.level) ? node.level : DEFAULT_HEADING_LEVEL;
|
|
13
|
+
|
|
14
|
+
const headingStyle = useMemo(
|
|
15
|
+
() => styles[`heading${headingLevel ?? ''}`],
|
|
16
|
+
[headingLevel, styles],
|
|
17
|
+
);
|
|
18
|
+
|
|
19
|
+
return <Text style={headingStyle}>{children}</Text>;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export const renderHeading: RuleRenderFunction = ({ node, output, state, styles }) => {
|
|
23
|
+
state.withinText = true;
|
|
24
|
+
state.withinHeading = true;
|
|
25
|
+
return (
|
|
26
|
+
<Heading key={state.key} node={node} output={output} state={state} styles={styles}>
|
|
27
|
+
{output(node.content, state)}
|
|
28
|
+
</Heading>
|
|
29
|
+
);
|
|
30
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { View } from 'react-native';
|
|
2
|
+
|
|
3
|
+
import type { MarkdownComponentProps, RuleRenderFunction } from '../types';
|
|
4
|
+
|
|
5
|
+
export const HorizontalRule = ({ styles }: MarkdownComponentProps) => <View style={styles.hr} />;
|
|
6
|
+
|
|
7
|
+
export const renderHorizontalRule: RuleRenderFunction = ({ node, output, state, styles }) => (
|
|
8
|
+
<HorizontalRule key={state.key} node={node} output={output} state={state} styles={styles} />
|
|
9
|
+
);
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Text } from 'react-native';
|
|
2
|
+
|
|
3
|
+
import type { MarkdownComponentProps, RuleRenderFunction } from '../types';
|
|
4
|
+
|
|
5
|
+
export const InlineCode = ({ children, styles }: MarkdownComponentProps) => (
|
|
6
|
+
<Text style={styles.inlineCode}>{children}</Text>
|
|
7
|
+
);
|
|
8
|
+
|
|
9
|
+
export const renderInlineCode: RuleRenderFunction = ({ node, output, state, styles }) => {
|
|
10
|
+
state.withinText = true;
|
|
11
|
+
return (
|
|
12
|
+
<InlineCode key={state.key} node={node} output={output} state={state} styles={styles}>
|
|
13
|
+
{output(node.content, state)}
|
|
14
|
+
</InlineCode>
|
|
15
|
+
);
|
|
16
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Text } from 'react-native';
|
|
2
|
+
|
|
3
|
+
import type { MarkdownComponentProps, RuleRenderFunction } from '../types';
|
|
4
|
+
|
|
5
|
+
export const LineBreak = ({ styles }: MarkdownComponentProps) => (
|
|
6
|
+
<Text style={styles.br}>{'\n\n'}</Text>
|
|
7
|
+
);
|
|
8
|
+
|
|
9
|
+
export const renderLineBreak: RuleRenderFunction = ({ node, output, state, styles }) => (
|
|
10
|
+
<LineBreak key={state.key} node={node} output={output} state={state} styles={styles} />
|
|
11
|
+
);
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Text } from 'react-native';
|
|
2
|
+
|
|
3
|
+
import type { MarkdownComponentProps, RuleRenderFunction } from '../types';
|
|
4
|
+
|
|
5
|
+
export const Link = ({ children, styles, onPress }: MarkdownComponentProps) => (
|
|
6
|
+
<Text style={styles.autolink} onPress={onPress} suppressHighlighting={false}>
|
|
7
|
+
{children}
|
|
8
|
+
</Text>
|
|
9
|
+
);
|
|
10
|
+
|
|
11
|
+
export const renderLink: RuleRenderFunction = ({ node, output, state, styles, onLink }) => {
|
|
12
|
+
const url = state.parentLink ?? node.target;
|
|
13
|
+
state.withinLink = true;
|
|
14
|
+
state.parentLink = url;
|
|
15
|
+
const onLinkPress = () => onLink && onLink(url);
|
|
16
|
+
return (
|
|
17
|
+
<Link
|
|
18
|
+
key={state.key}
|
|
19
|
+
node={node}
|
|
20
|
+
output={output}
|
|
21
|
+
state={state}
|
|
22
|
+
styles={styles}
|
|
23
|
+
onPress={onLinkPress}
|
|
24
|
+
>
|
|
25
|
+
{output(node.content, state)}
|
|
26
|
+
</Link>
|
|
27
|
+
);
|
|
28
|
+
};
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import type { PropsWithChildren } from 'react';
|
|
2
|
+
import { Text, type TextProps, View, type ViewProps } from 'react-native';
|
|
3
|
+
|
|
4
|
+
import type { SingleASTNode } from '@khanacademy/simple-markdown';
|
|
5
|
+
|
|
6
|
+
import type { BulletProps, MarkdownComponentProps, RuleRenderFunction } from '../types';
|
|
7
|
+
|
|
8
|
+
const parentTypes = ['text', 'paragraph', 'strong'];
|
|
9
|
+
|
|
10
|
+
export const List = ({ node, output, state, styles }: MarkdownComponentProps) => {
|
|
11
|
+
let isSublist = state.withinList;
|
|
12
|
+
|
|
13
|
+
return (
|
|
14
|
+
<View key={state.key} style={isSublist ? styles?.sublist : styles?.list}>
|
|
15
|
+
{node.items.map((item: SingleASTNode, index: number) => {
|
|
16
|
+
const indexAfterStart = node.start + index;
|
|
17
|
+
|
|
18
|
+
if (item === null) {
|
|
19
|
+
return (
|
|
20
|
+
<ListRow key={index} style={styles?.listRow}>
|
|
21
|
+
<Bullet
|
|
22
|
+
index={node.ordered && indexAfterStart}
|
|
23
|
+
style={node.ordered ? styles?.listItemNumber : styles?.listItemBullet}
|
|
24
|
+
/>
|
|
25
|
+
</ListRow>
|
|
26
|
+
);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
isSublist = item.length > 1 && item[1].type === 'list';
|
|
30
|
+
const isSublistWithinText = parentTypes.includes((item[0] ?? {}).type) && isSublist;
|
|
31
|
+
const style = isSublistWithinText ? { marginBottom: 0 } : {};
|
|
32
|
+
|
|
33
|
+
return (
|
|
34
|
+
<ListRow key={index} style={styles?.listRow}>
|
|
35
|
+
<Bullet
|
|
36
|
+
index={node.ordered && indexAfterStart}
|
|
37
|
+
style={node.ordered ? styles?.listItemNumber : styles?.listItemBullet}
|
|
38
|
+
/>
|
|
39
|
+
<ListItem key={1} style={[styles?.listItemText, style]}>
|
|
40
|
+
{output(item, { ...state, withinList: true })}
|
|
41
|
+
</ListItem>
|
|
42
|
+
</ListRow>
|
|
43
|
+
);
|
|
44
|
+
})}
|
|
45
|
+
</View>
|
|
46
|
+
);
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
const Bullet = ({ index, style }: BulletProps) => (
|
|
50
|
+
<Text key={0} style={style}>
|
|
51
|
+
{index ? `${index}. ` : '\u2022 '}
|
|
52
|
+
</Text>
|
|
53
|
+
);
|
|
54
|
+
|
|
55
|
+
const ListRow = ({ children, style }: PropsWithChildren<ViewProps>) => (
|
|
56
|
+
<View style={style}>{children}</View>
|
|
57
|
+
);
|
|
58
|
+
|
|
59
|
+
const ListItem = ({ children, style }: PropsWithChildren<TextProps>) => (
|
|
60
|
+
<Text style={style}>{children}</Text>
|
|
61
|
+
);
|
|
62
|
+
|
|
63
|
+
export const renderList: RuleRenderFunction = ({ node, output, state, styles }) => (
|
|
64
|
+
<List key={`list-${state.key}`} node={node} output={output} state={state} styles={styles} />
|
|
65
|
+
);
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Text } from 'react-native';
|
|
2
|
+
|
|
3
|
+
import type { MarkdownComponentProps, RuleRenderFunction } from '../types';
|
|
4
|
+
|
|
5
|
+
export const Mailto = ({ children, styles, onPress }: MarkdownComponentProps) => (
|
|
6
|
+
<Text style={styles.url} onPress={onPress}>
|
|
7
|
+
{children}
|
|
8
|
+
</Text>
|
|
9
|
+
);
|
|
10
|
+
|
|
11
|
+
export const renderMailto: RuleRenderFunction = ({ node, output, state, styles, onLink }) => {
|
|
12
|
+
state.withinLink = true;
|
|
13
|
+
const onLinkPress = () => onLink && onLink(node.target);
|
|
14
|
+
return (
|
|
15
|
+
<Mailto
|
|
16
|
+
key={state.key}
|
|
17
|
+
node={node}
|
|
18
|
+
output={output}
|
|
19
|
+
state={state}
|
|
20
|
+
styles={styles}
|
|
21
|
+
onPress={onLinkPress}
|
|
22
|
+
>
|
|
23
|
+
{output(node.content, state)}
|
|
24
|
+
</Mailto>
|
|
25
|
+
);
|
|
26
|
+
};
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import React, { type PropsWithChildren, useMemo } from 'react';
|
|
2
|
+
|
|
3
|
+
import { View } from 'react-native';
|
|
4
|
+
|
|
5
|
+
import SimpleMarkdown, {
|
|
6
|
+
type OutputRules,
|
|
7
|
+
type ParserRules,
|
|
8
|
+
type ReactOutputRule,
|
|
9
|
+
} from '@khanacademy/simple-markdown';
|
|
10
|
+
import isArray from 'lodash/isArray';
|
|
11
|
+
import isEqual from 'lodash/isEqual';
|
|
12
|
+
import merge from 'lodash/merge';
|
|
13
|
+
|
|
14
|
+
import { useTheme } from '../../contexts';
|
|
15
|
+
import { getLocalRules } from '../rules';
|
|
16
|
+
|
|
17
|
+
import { getLocalStyles } from '../styles';
|
|
18
|
+
import type { MarkdownProps } from '../types';
|
|
19
|
+
|
|
20
|
+
const UnmemoizedMarkdown = (props: PropsWithChildren<MarkdownProps>) => {
|
|
21
|
+
const { theme } = useTheme();
|
|
22
|
+
|
|
23
|
+
const { onLink, rules: rulesProp, paragraphNumberOfLines, children } = props;
|
|
24
|
+
|
|
25
|
+
const mergedStyles = useMemo(() => merge({}, getLocalStyles({ theme }), theme.markdown), [theme]);
|
|
26
|
+
|
|
27
|
+
const localRules = useMemo(
|
|
28
|
+
() =>
|
|
29
|
+
merge(
|
|
30
|
+
{},
|
|
31
|
+
SimpleMarkdown.defaultRules,
|
|
32
|
+
getLocalRules(mergedStyles, { onLink, paragraphNumberOfLines }),
|
|
33
|
+
rulesProp,
|
|
34
|
+
) as unknown as ParserRules,
|
|
35
|
+
[mergedStyles, onLink, rulesProp, paragraphNumberOfLines],
|
|
36
|
+
);
|
|
37
|
+
|
|
38
|
+
const parser = useMemo(() => SimpleMarkdown.parserFor(localRules), [localRules]);
|
|
39
|
+
const renderer = useMemo(
|
|
40
|
+
() => SimpleMarkdown.outputFor(localRules as unknown as OutputRules<ReactOutputRule>, 'react'),
|
|
41
|
+
[localRules],
|
|
42
|
+
);
|
|
43
|
+
|
|
44
|
+
const childText = useMemo(() => (isArray(children) ? children.join('') : children), [children]);
|
|
45
|
+
|
|
46
|
+
const toRender = useMemo(() => {
|
|
47
|
+
const blockSource = `${childText ?? ''}\n\n`;
|
|
48
|
+
return parser(blockSource, { inline: false });
|
|
49
|
+
}, [childText, parser]);
|
|
50
|
+
|
|
51
|
+
const tree = useMemo(() => renderer(toRender), [renderer, toRender]);
|
|
52
|
+
|
|
53
|
+
return <View style={mergedStyles.view}>{tree}</View>;
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
const areEqual = (prevProps: PropsWithChildren, nextProps: PropsWithChildren) =>
|
|
57
|
+
isEqual(prevProps.children, nextProps.children);
|
|
58
|
+
|
|
59
|
+
export const Markdown = React.memo(UnmemoizedMarkdown, areEqual);
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Text } from 'react-native';
|
|
2
|
+
|
|
3
|
+
import type { MarkdownComponentProps, RuleRenderFunction } from '../types';
|
|
4
|
+
|
|
5
|
+
export const NewLine = ({ styles }: MarkdownComponentProps) => (
|
|
6
|
+
<Text style={styles.br}>{'\n'}</Text>
|
|
7
|
+
);
|
|
8
|
+
|
|
9
|
+
export const renderNewLine: RuleRenderFunction = ({ node, output, state, styles }) => (
|
|
10
|
+
<NewLine key={state.key} node={node} output={output} state={state} styles={styles} />
|
|
11
|
+
);
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { useMemo } from 'react';
|
|
2
|
+
import { Text, type TextStyle, View } from 'react-native';
|
|
3
|
+
|
|
4
|
+
import size from 'lodash/size';
|
|
5
|
+
import some from 'lodash/some';
|
|
6
|
+
|
|
7
|
+
import type { MarkdownComponentProps, RuleRenderFunction } from '../types';
|
|
8
|
+
|
|
9
|
+
export const Paragraph = ({
|
|
10
|
+
children,
|
|
11
|
+
styles,
|
|
12
|
+
node,
|
|
13
|
+
state,
|
|
14
|
+
paragraphNumberOfLines,
|
|
15
|
+
}: MarkdownComponentProps) => {
|
|
16
|
+
const paragraphStyle = useMemo(() => {
|
|
17
|
+
let style: TextStyle | (TextStyle | undefined)[] | undefined =
|
|
18
|
+
size(node.content) < 3 && some(node.content, { type: 'strong' })
|
|
19
|
+
? styles.paragraphCenter
|
|
20
|
+
: styles.paragraph;
|
|
21
|
+
|
|
22
|
+
if (state.withinList) {
|
|
23
|
+
style = [style, styles.noMargin];
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
return style;
|
|
27
|
+
}, [node.content, state.withinList, styles.paragraph, styles.paragraphCenter, styles.noMargin]);
|
|
28
|
+
|
|
29
|
+
return (
|
|
30
|
+
<Text style={paragraphStyle} numberOfLines={paragraphNumberOfLines}>
|
|
31
|
+
{children}
|
|
32
|
+
</Text>
|
|
33
|
+
);
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
export const ParagraphWithImage = ({ children, styles }: MarkdownComponentProps) => (
|
|
37
|
+
<View style={styles.paragraphWithImage}>{children}</View>
|
|
38
|
+
);
|
|
39
|
+
|
|
40
|
+
export const renderParagraph: RuleRenderFunction = ({
|
|
41
|
+
node,
|
|
42
|
+
output,
|
|
43
|
+
state,
|
|
44
|
+
styles,
|
|
45
|
+
paragraphNumberOfLines,
|
|
46
|
+
}) => {
|
|
47
|
+
if (some(node.content, { type: 'image' })) {
|
|
48
|
+
state.withinParagraphWithImage = true;
|
|
49
|
+
|
|
50
|
+
return (
|
|
51
|
+
<ParagraphWithImage key={state.key} node={node} output={output} state={state} styles={styles}>
|
|
52
|
+
{output(node.content, state)}
|
|
53
|
+
</ParagraphWithImage>
|
|
54
|
+
);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
return (
|
|
58
|
+
<Paragraph
|
|
59
|
+
key={state.key}
|
|
60
|
+
node={node}
|
|
61
|
+
output={output}
|
|
62
|
+
state={state}
|
|
63
|
+
styles={styles}
|
|
64
|
+
paragraphNumberOfLines={paragraphNumberOfLines}
|
|
65
|
+
>
|
|
66
|
+
{output(node.content, state)}
|
|
67
|
+
</Paragraph>
|
|
68
|
+
);
|
|
69
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Text } from 'react-native';
|
|
2
|
+
|
|
3
|
+
import type { MarkdownComponentProps, RuleRenderFunction } from '../types';
|
|
4
|
+
|
|
5
|
+
export const Strikethrough = ({ children, styles }: MarkdownComponentProps) => (
|
|
6
|
+
<Text style={styles.del}>{children}</Text>
|
|
7
|
+
);
|
|
8
|
+
|
|
9
|
+
export const renderStrikethrough: RuleRenderFunction = ({ node, output, state, styles }) => {
|
|
10
|
+
state.withinText = true;
|
|
11
|
+
return (
|
|
12
|
+
<Strikethrough key={state.key} node={node} output={output} state={state} styles={styles}>
|
|
13
|
+
{output(node.content, state)}
|
|
14
|
+
</Strikethrough>
|
|
15
|
+
);
|
|
16
|
+
};
|