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,81 @@
|
|
|
1
|
+
import { useCallback, useMemo } from 'react';
|
|
2
|
+
import { Text, View } from 'react-native';
|
|
3
|
+
|
|
4
|
+
import type { SingleASTNode } from '@khanacademy/simple-markdown';
|
|
5
|
+
|
|
6
|
+
import { MarkdownReactiveScrollView } from '../../components';
|
|
7
|
+
import type {
|
|
8
|
+
MarkdownComponentProps,
|
|
9
|
+
MarkdownOutputProps,
|
|
10
|
+
MarkdownTableRowProps,
|
|
11
|
+
RuleRenderFunction,
|
|
12
|
+
} from '../types';
|
|
13
|
+
|
|
14
|
+
export const Table = ({ node, output, styles, state }: MarkdownComponentProps) => (
|
|
15
|
+
<MarkdownReactiveScrollView>
|
|
16
|
+
<MarkdownTable node={node} output={output} state={state} styles={styles} />
|
|
17
|
+
</MarkdownReactiveScrollView>
|
|
18
|
+
);
|
|
19
|
+
|
|
20
|
+
const transpose = (matrix: SingleASTNode[][]) =>
|
|
21
|
+
// TS gets confused because it considers the matrix to be potentially ragged,
|
|
22
|
+
// while the markdown parser can never output a ragged matrix of AST nodes
|
|
23
|
+
// when parsing a table. Hence, we use the forced type coercion.
|
|
24
|
+
(matrix[0] ?? []).map((_, colIndex) => matrix.map((row) => row[colIndex]!));
|
|
25
|
+
|
|
26
|
+
const MarkdownTable = ({ node, output, state, styles }: MarkdownOutputProps) => {
|
|
27
|
+
const content = useMemo(() => {
|
|
28
|
+
const nodeContent = [node?.header, ...(node?.cells ?? [])];
|
|
29
|
+
return transpose(nodeContent);
|
|
30
|
+
}, [node?.cells, node?.header]);
|
|
31
|
+
const columns = content?.map((column, idx) => (
|
|
32
|
+
<MarkdownTableColumn
|
|
33
|
+
node={node}
|
|
34
|
+
items={column}
|
|
35
|
+
key={`column-${idx}`}
|
|
36
|
+
output={output}
|
|
37
|
+
state={state}
|
|
38
|
+
styles={styles}
|
|
39
|
+
/>
|
|
40
|
+
));
|
|
41
|
+
|
|
42
|
+
return (
|
|
43
|
+
<View key={state.key} style={styles.table}>
|
|
44
|
+
{columns}
|
|
45
|
+
</View>
|
|
46
|
+
);
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
const MarkdownTableColumn = ({ items, output, state, styles }: MarkdownTableRowProps) => {
|
|
50
|
+
const [headerCellContent, ...columnCellContents] = items;
|
|
51
|
+
|
|
52
|
+
const ColumnCell = useCallback(
|
|
53
|
+
({ content }: { content: SingleASTNode }) =>
|
|
54
|
+
content ? (
|
|
55
|
+
<View style={styles.tableRow}>
|
|
56
|
+
<View style={styles.tableRowCell}>{output(content, state)}</View>
|
|
57
|
+
</View>
|
|
58
|
+
) : null,
|
|
59
|
+
[output, state, styles],
|
|
60
|
+
);
|
|
61
|
+
|
|
62
|
+
return (
|
|
63
|
+
<View style={{ flex: 1, flexDirection: 'column' }}>
|
|
64
|
+
{headerCellContent ? (
|
|
65
|
+
<View key={-1} style={styles.tableHeader}>
|
|
66
|
+
<Text style={styles.tableHeaderCell}>{output(headerCellContent, state)}</Text>
|
|
67
|
+
</View>
|
|
68
|
+
) : null}
|
|
69
|
+
{columnCellContents &&
|
|
70
|
+
columnCellContents.map((content, idx) => (
|
|
71
|
+
<ColumnCell content={content} key={`cell-${idx}`} />
|
|
72
|
+
))}
|
|
73
|
+
</View>
|
|
74
|
+
);
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
export const renderTable: RuleRenderFunction = ({ node, output, state, styles }) => (
|
|
78
|
+
<Table key={state.key} node={node} output={output} state={state} styles={styles}>
|
|
79
|
+
{node.content?.trim()}
|
|
80
|
+
</Table>
|
|
81
|
+
);
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { useMemo } from 'react';
|
|
2
|
+
import { Text } from 'react-native';
|
|
3
|
+
|
|
4
|
+
import type { MarkdownComponentProps, RuleRenderFunction } from '../types';
|
|
5
|
+
|
|
6
|
+
export const TextUI = ({ children, styles, state }: MarkdownComponentProps) => {
|
|
7
|
+
const textStyle = useMemo(() => {
|
|
8
|
+
const style = [styles.text, state.style];
|
|
9
|
+
|
|
10
|
+
if (state.withinQuote) {
|
|
11
|
+
style.push(styles.blockQuoteText);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
if (state.withinLink) {
|
|
15
|
+
style.push(styles.autolink);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
return style;
|
|
19
|
+
}, [
|
|
20
|
+
state.style,
|
|
21
|
+
state.withinLink,
|
|
22
|
+
state.withinQuote,
|
|
23
|
+
styles.text,
|
|
24
|
+
styles.autolink,
|
|
25
|
+
styles.blockQuoteText,
|
|
26
|
+
]);
|
|
27
|
+
|
|
28
|
+
return <Text style={textStyle}>{children}</Text>;
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
export const renderText: RuleRenderFunction = ({ node, output, state, styles }) => {
|
|
32
|
+
return (
|
|
33
|
+
<TextUI key={state.key} node={node} output={output} state={state} styles={styles}>
|
|
34
|
+
{node.content}
|
|
35
|
+
</TextUI>
|
|
36
|
+
);
|
|
37
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Text } from 'react-native';
|
|
2
|
+
|
|
3
|
+
import type { MarkdownComponentProps, RuleRenderFunction } from '../types';
|
|
4
|
+
|
|
5
|
+
export const Url = ({ children, styles, onPress }: MarkdownComponentProps) => (
|
|
6
|
+
<Text style={styles.url} onPress={onPress}>
|
|
7
|
+
{children}
|
|
8
|
+
</Text>
|
|
9
|
+
);
|
|
10
|
+
|
|
11
|
+
export const renderUrl: RuleRenderFunction = ({ node, output, state, styles, onLink }) => {
|
|
12
|
+
state.withinLink = true;
|
|
13
|
+
const onLinkPress = () => onLink && onLink(node.target);
|
|
14
|
+
return (
|
|
15
|
+
<Url
|
|
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
|
+
</Url>
|
|
25
|
+
);
|
|
26
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export * from './Autolink';
|
|
2
|
+
export * from './BlockQuote';
|
|
3
|
+
export * from './Bold';
|
|
4
|
+
export * from './CodeBlock';
|
|
5
|
+
export * from './Emphasis';
|
|
6
|
+
export * from './Heading';
|
|
7
|
+
export * from './HorizontalRule';
|
|
8
|
+
export * from './InlineCode';
|
|
9
|
+
export * from './LineBreak';
|
|
10
|
+
export * from './Link';
|
|
11
|
+
export * from './List';
|
|
12
|
+
export * from './Mailto';
|
|
13
|
+
export * from './NewLine';
|
|
14
|
+
export * from './Paragraph';
|
|
15
|
+
export * from './Strikethrough';
|
|
16
|
+
export * from './Table';
|
|
17
|
+
export * from './Text';
|
|
18
|
+
export * from './Url';
|
|
19
|
+
|
|
20
|
+
export * from './Markdown';
|
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
|
|
3
|
+
import type {
|
|
4
|
+
MatchFunction,
|
|
5
|
+
Output,
|
|
6
|
+
OutputRules,
|
|
7
|
+
ParseFunction,
|
|
8
|
+
Parser,
|
|
9
|
+
ReactOutputRule,
|
|
10
|
+
SingleASTNode,
|
|
11
|
+
} from '@khanacademy/simple-markdown';
|
|
12
|
+
import SimpleMarkdown from '@khanacademy/simple-markdown';
|
|
13
|
+
|
|
14
|
+
import {
|
|
15
|
+
renderAutolink,
|
|
16
|
+
renderBlockQuote,
|
|
17
|
+
renderBold,
|
|
18
|
+
renderCodeBlock,
|
|
19
|
+
renderEmphasis,
|
|
20
|
+
renderHeading,
|
|
21
|
+
renderHorizontalRule,
|
|
22
|
+
renderInlineCode,
|
|
23
|
+
renderLineBreak,
|
|
24
|
+
renderLink,
|
|
25
|
+
renderList,
|
|
26
|
+
renderMailto,
|
|
27
|
+
renderNewLine,
|
|
28
|
+
renderParagraph,
|
|
29
|
+
renderStrikethrough,
|
|
30
|
+
renderTable,
|
|
31
|
+
renderText,
|
|
32
|
+
renderUrl,
|
|
33
|
+
} from './components';
|
|
34
|
+
import type {
|
|
35
|
+
MarkdownOptions,
|
|
36
|
+
MarkdownState,
|
|
37
|
+
MarkdownStyle,
|
|
38
|
+
RuleRenderFunction,
|
|
39
|
+
RuleRenderFunctionEnrichedProps,
|
|
40
|
+
} from './types';
|
|
41
|
+
|
|
42
|
+
const LINK_INSIDE = '(?:\\[(?:\\\\.|[^\\\\\\[\\]])*\\]|\\\\.|[^\\[\\]\\\\])*';
|
|
43
|
+
/**
|
|
44
|
+
* Href + optional title (escape-aware). Group 1 === href (angle or bare).
|
|
45
|
+
* The title is in groups 2, 3 or 4.
|
|
46
|
+
*/
|
|
47
|
+
const LINK_HREF_AND_TITLE =
|
|
48
|
+
'\\s*<?([^\\s>]*?)>?\\s*' + // 1: href
|
|
49
|
+
'(?:' +
|
|
50
|
+
'\\\\"((?:\\\\.|[^"\\\\])*)\\\\"' + // 2: "title"
|
|
51
|
+
"|\\\\'((?:\\\\.|[^'\\\\])*)\\\\'" + // 3: 'title'
|
|
52
|
+
'|\\(((?:\\\\.|[^)\\\\])*)\\)' + // 4: (title)
|
|
53
|
+
')?\\s*';
|
|
54
|
+
|
|
55
|
+
const LINK_REGEX = new RegExp('^\\[(' + LINK_INSIDE + ')\\]\\(' + LINK_HREF_AND_TITLE + '\\)');
|
|
56
|
+
|
|
57
|
+
export const getLocalRules = (
|
|
58
|
+
styles: MarkdownStyle,
|
|
59
|
+
opts: MarkdownOptions = {},
|
|
60
|
+
): OutputRules<ReactOutputRule> => {
|
|
61
|
+
const { onLink, paragraphNumberOfLines } = opts;
|
|
62
|
+
const openLinkHandler = (target: string) => {
|
|
63
|
+
if (onLink) {
|
|
64
|
+
// user-supplied handler may be async; we keep the behavior
|
|
65
|
+
Promise.resolve(onLink(target)).catch((error: unknown) => {
|
|
66
|
+
const msg =
|
|
67
|
+
error && typeof error === 'object' && 'toString' in error
|
|
68
|
+
? String(error)
|
|
69
|
+
: 'Unknown error';
|
|
70
|
+
|
|
71
|
+
console.log('There has been a problem with this action. ' + msg);
|
|
72
|
+
throw error;
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
const parseInline = function (
|
|
78
|
+
parse: Parser,
|
|
79
|
+
content: string,
|
|
80
|
+
state: MarkdownState,
|
|
81
|
+
): SingleASTNode[] {
|
|
82
|
+
const isCurrentlyInline = state.inline || false;
|
|
83
|
+
state.inline = true;
|
|
84
|
+
const result = parse(content, state);
|
|
85
|
+
state.inline = isCurrentlyInline;
|
|
86
|
+
return result;
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
const parseCaptureInline: ParseFunction = (capture, parse, state) => {
|
|
90
|
+
return {
|
|
91
|
+
content: parseInline(parse, capture[2] as string, state as MarkdownState),
|
|
92
|
+
};
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
const parseFence: ParseFunction = (capture) => {
|
|
96
|
+
// capture[2] = language string (may be undefined/empty)
|
|
97
|
+
// capture[3] = code content
|
|
98
|
+
let lang = (capture[2] || '').trim() || undefined;
|
|
99
|
+
let content = capture[3] || '';
|
|
100
|
+
|
|
101
|
+
// If we've found no lang on the fence line (the opening fence) but the first code line
|
|
102
|
+
// is a lone token, treat it as lang and strip it from content. Helps with some specific
|
|
103
|
+
// use-cases such as "```<newline>sql<newline>...".
|
|
104
|
+
if (!lang) {
|
|
105
|
+
const nl = content.indexOf('\n');
|
|
106
|
+
const firstLine = (nl === -1 ? content : content.slice(0, nl)).trim();
|
|
107
|
+
if (/^[A-Za-z0-9_+.-]+$/.test(firstLine)) {
|
|
108
|
+
lang = firstLine;
|
|
109
|
+
content = nl === -1 ? '' : content.slice(nl + 1);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
// Mirror your trimming behavior
|
|
114
|
+
content = content.replace(/\n+$/, '');
|
|
115
|
+
|
|
116
|
+
return { type: 'codeBlock', lang, content };
|
|
117
|
+
};
|
|
118
|
+
|
|
119
|
+
const enrichedRenderFunction =
|
|
120
|
+
(render: RuleRenderFunction, options: Partial<RuleRenderFunctionEnrichedProps> = {}) =>
|
|
121
|
+
(node: SingleASTNode, output: Output<React.ReactNode>, { ...state }: MarkdownState) =>
|
|
122
|
+
render({ node, output, state, styles, ...options });
|
|
123
|
+
|
|
124
|
+
return {
|
|
125
|
+
autolink: {
|
|
126
|
+
react: enrichedRenderFunction(renderAutolink, {
|
|
127
|
+
onLink: openLinkHandler,
|
|
128
|
+
}),
|
|
129
|
+
},
|
|
130
|
+
blockQuote: {
|
|
131
|
+
react: enrichedRenderFunction(renderBlockQuote),
|
|
132
|
+
},
|
|
133
|
+
br: {
|
|
134
|
+
react: enrichedRenderFunction(renderLineBreak),
|
|
135
|
+
},
|
|
136
|
+
codeBlock: {
|
|
137
|
+
react: enrichedRenderFunction(renderCodeBlock),
|
|
138
|
+
},
|
|
139
|
+
fence: {
|
|
140
|
+
match: SimpleMarkdown.blockRegex(
|
|
141
|
+
// 1: fence (``` or ~~~)
|
|
142
|
+
// 2: info string (lang etc.) - SAME CAPTURE INDEX AS YOURS
|
|
143
|
+
// 3: code content
|
|
144
|
+
/^ {0,3}(`{3,}|~{3,})[ \t]*(\S+)?[ \t]*\r?\n([\s\S]*?)\r?\n?(?: {0,3})\1[ \t]*(?:\r?\n+|$)/,
|
|
145
|
+
),
|
|
146
|
+
parse: parseFence,
|
|
147
|
+
},
|
|
148
|
+
del: {
|
|
149
|
+
react: enrichedRenderFunction(renderStrikethrough),
|
|
150
|
+
},
|
|
151
|
+
em: {
|
|
152
|
+
react: enrichedRenderFunction(renderEmphasis),
|
|
153
|
+
},
|
|
154
|
+
heading: {
|
|
155
|
+
match: SimpleMarkdown.blockRegex(/^ *(#{1,6}) *([^\n]+?) *#* *(?:\n *)+/),
|
|
156
|
+
react: enrichedRenderFunction(renderHeading),
|
|
157
|
+
},
|
|
158
|
+
hr: {
|
|
159
|
+
react: enrichedRenderFunction(renderHorizontalRule),
|
|
160
|
+
},
|
|
161
|
+
image: {
|
|
162
|
+
// We intentionally disable parsing images; keep the shape
|
|
163
|
+
match: () => null,
|
|
164
|
+
},
|
|
165
|
+
inlineCode: {
|
|
166
|
+
parse: parseCaptureInline,
|
|
167
|
+
react: enrichedRenderFunction(renderInlineCode),
|
|
168
|
+
},
|
|
169
|
+
link: {
|
|
170
|
+
match: SimpleMarkdown.inlineRegex(LINK_REGEX) as MatchFunction,
|
|
171
|
+
react: enrichedRenderFunction(renderLink, {
|
|
172
|
+
onLink: openLinkHandler,
|
|
173
|
+
}),
|
|
174
|
+
},
|
|
175
|
+
list: {
|
|
176
|
+
react: enrichedRenderFunction(renderList),
|
|
177
|
+
},
|
|
178
|
+
mailto: {
|
|
179
|
+
react: enrichedRenderFunction(renderMailto, {
|
|
180
|
+
onLink: openLinkHandler,
|
|
181
|
+
}),
|
|
182
|
+
},
|
|
183
|
+
newline: {
|
|
184
|
+
react: enrichedRenderFunction(renderNewLine),
|
|
185
|
+
},
|
|
186
|
+
paragraph: {
|
|
187
|
+
react: enrichedRenderFunction(renderParagraph, {
|
|
188
|
+
paragraphNumberOfLines,
|
|
189
|
+
}),
|
|
190
|
+
},
|
|
191
|
+
strong: {
|
|
192
|
+
react: enrichedRenderFunction(renderBold),
|
|
193
|
+
},
|
|
194
|
+
sublist: {
|
|
195
|
+
react: enrichedRenderFunction(renderList),
|
|
196
|
+
},
|
|
197
|
+
table: {
|
|
198
|
+
react: enrichedRenderFunction(renderTable),
|
|
199
|
+
},
|
|
200
|
+
text: {
|
|
201
|
+
react: enrichedRenderFunction(renderText),
|
|
202
|
+
},
|
|
203
|
+
u: {
|
|
204
|
+
// no support for underlines yet
|
|
205
|
+
match: () => null,
|
|
206
|
+
},
|
|
207
|
+
url: {
|
|
208
|
+
react: enrichedRenderFunction(renderUrl, {
|
|
209
|
+
onLink: openLinkHandler,
|
|
210
|
+
}),
|
|
211
|
+
},
|
|
212
|
+
// no support for reflinks
|
|
213
|
+
reflink: { match: () => null },
|
|
214
|
+
refimage: { match: () => null },
|
|
215
|
+
} as unknown as OutputRules<ReactOutputRule>;
|
|
216
|
+
};
|
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
import { Dimensions, Platform, StyleSheet } from 'react-native';
|
|
2
|
+
|
|
3
|
+
import type { Theme } from '../theme';
|
|
4
|
+
|
|
5
|
+
export const getLocalStyles = ({ theme }: { theme: Theme }) => {
|
|
6
|
+
const colors = theme.colors;
|
|
7
|
+
|
|
8
|
+
return StyleSheet.create({
|
|
9
|
+
autolink: {
|
|
10
|
+
color: colors.accent_blue,
|
|
11
|
+
},
|
|
12
|
+
bgImage: {
|
|
13
|
+
bottom: 0,
|
|
14
|
+
flex: 1,
|
|
15
|
+
left: 0,
|
|
16
|
+
position: 'absolute',
|
|
17
|
+
right: 0,
|
|
18
|
+
top: 0,
|
|
19
|
+
},
|
|
20
|
+
bgImageView: {
|
|
21
|
+
flex: 1,
|
|
22
|
+
overflow: 'hidden',
|
|
23
|
+
},
|
|
24
|
+
blockQuoteSection: {
|
|
25
|
+
flexDirection: 'row',
|
|
26
|
+
padding: 8,
|
|
27
|
+
},
|
|
28
|
+
blockQuoteSectionBar: {
|
|
29
|
+
backgroundColor: colors.grey_gainsboro,
|
|
30
|
+
height: null,
|
|
31
|
+
marginRight: 8,
|
|
32
|
+
width: 2,
|
|
33
|
+
},
|
|
34
|
+
blockQuoteText: {
|
|
35
|
+
color: colors.grey_dark,
|
|
36
|
+
},
|
|
37
|
+
codeBlock: {
|
|
38
|
+
backgroundColor: colors.code_block,
|
|
39
|
+
fontFamily: Platform.OS === 'ios' ? 'Courier' : 'Monospace',
|
|
40
|
+
fontWeight: '500',
|
|
41
|
+
color: colors.black,
|
|
42
|
+
paddingLeft: 8,
|
|
43
|
+
lineHeight: 14,
|
|
44
|
+
},
|
|
45
|
+
codeBlockWrapper: {
|
|
46
|
+
backgroundColor: colors.code_block,
|
|
47
|
+
borderRadius: 8,
|
|
48
|
+
marginVertical: 8,
|
|
49
|
+
padding: 12,
|
|
50
|
+
},
|
|
51
|
+
codeBlockContainer: {
|
|
52
|
+
flexDirection: 'row',
|
|
53
|
+
},
|
|
54
|
+
codeBlockLineNumberGutter: {
|
|
55
|
+
flexDirection: 'column',
|
|
56
|
+
color: colors.black,
|
|
57
|
+
},
|
|
58
|
+
codeBlockLineNumberCell: {
|
|
59
|
+
fontFamily: Platform.OS === 'ios' ? 'Courier' : 'Monospace',
|
|
60
|
+
color: colors.grey,
|
|
61
|
+
paddingVertical: 1, // should be (codeBlock.lineHeight - this.fontSize) / 2
|
|
62
|
+
fontSize: 12,
|
|
63
|
+
},
|
|
64
|
+
codeBlockHeaderContainer: {
|
|
65
|
+
flexDirection: 'row',
|
|
66
|
+
justifyContent: 'space-between',
|
|
67
|
+
marginBottom: 8,
|
|
68
|
+
},
|
|
69
|
+
codeBlockHeaderTitle: {
|
|
70
|
+
fontSize: 12,
|
|
71
|
+
color: colors.grey,
|
|
72
|
+
fontFamily: Platform.OS === 'ios' ? 'Courier' : 'Monospace',
|
|
73
|
+
},
|
|
74
|
+
del: {
|
|
75
|
+
textDecorationLine: 'line-through',
|
|
76
|
+
textDecorationStyle: 'solid',
|
|
77
|
+
},
|
|
78
|
+
em: {
|
|
79
|
+
fontStyle: 'italic',
|
|
80
|
+
},
|
|
81
|
+
heading: {
|
|
82
|
+
fontWeight: '200',
|
|
83
|
+
},
|
|
84
|
+
heading1: {
|
|
85
|
+
fontSize: 32,
|
|
86
|
+
},
|
|
87
|
+
heading2: {
|
|
88
|
+
fontSize: 24,
|
|
89
|
+
},
|
|
90
|
+
heading3: {
|
|
91
|
+
fontSize: 18,
|
|
92
|
+
},
|
|
93
|
+
heading4: {
|
|
94
|
+
fontSize: 16,
|
|
95
|
+
},
|
|
96
|
+
heading5: {
|
|
97
|
+
fontSize: 13,
|
|
98
|
+
},
|
|
99
|
+
heading6: {
|
|
100
|
+
fontSize: 11,
|
|
101
|
+
},
|
|
102
|
+
hr: {
|
|
103
|
+
backgroundColor: colors.grey_gainsboro,
|
|
104
|
+
height: 1,
|
|
105
|
+
},
|
|
106
|
+
image: {
|
|
107
|
+
alignSelf: 'center',
|
|
108
|
+
height: 200,
|
|
109
|
+
resizeMode: 'contain',
|
|
110
|
+
width: Dimensions.get('window').width - 30,
|
|
111
|
+
},
|
|
112
|
+
imageBox: {
|
|
113
|
+
flex: 1,
|
|
114
|
+
resizeMode: 'cover',
|
|
115
|
+
},
|
|
116
|
+
inlineCode: {
|
|
117
|
+
backgroundColor: colors.white_smoke,
|
|
118
|
+
borderColor: colors.grey_gainsboro,
|
|
119
|
+
borderRadius: 3,
|
|
120
|
+
borderWidth: 1,
|
|
121
|
+
color: colors.accent_red,
|
|
122
|
+
fontFamily: Platform.OS === 'ios' ? 'Courier' : 'Monospace',
|
|
123
|
+
fontWeight: '500',
|
|
124
|
+
fontSize: 13,
|
|
125
|
+
padding: 3,
|
|
126
|
+
paddingHorizontal: 5,
|
|
127
|
+
},
|
|
128
|
+
list: {
|
|
129
|
+
marginBottom: 8,
|
|
130
|
+
marginTop: 8,
|
|
131
|
+
},
|
|
132
|
+
listItem: {
|
|
133
|
+
flexDirection: 'row',
|
|
134
|
+
},
|
|
135
|
+
listItemBullet: {
|
|
136
|
+
fontSize: 20,
|
|
137
|
+
lineHeight: 20,
|
|
138
|
+
},
|
|
139
|
+
listItemNumber: {
|
|
140
|
+
fontWeight: '500',
|
|
141
|
+
},
|
|
142
|
+
listItemText: {
|
|
143
|
+
flex: 0,
|
|
144
|
+
},
|
|
145
|
+
listRow: {
|
|
146
|
+
flexDirection: 'row',
|
|
147
|
+
},
|
|
148
|
+
mentions: {
|
|
149
|
+
color: colors.accent_blue,
|
|
150
|
+
fontWeight: '700',
|
|
151
|
+
},
|
|
152
|
+
noMargin: {
|
|
153
|
+
marginBottom: 0,
|
|
154
|
+
marginTop: 0,
|
|
155
|
+
},
|
|
156
|
+
paragraph: {
|
|
157
|
+
alignItems: 'flex-start',
|
|
158
|
+
flexDirection: 'row',
|
|
159
|
+
flexWrap: 'wrap',
|
|
160
|
+
justifyContent: 'flex-start',
|
|
161
|
+
marginBottom: 8,
|
|
162
|
+
marginTop: 8,
|
|
163
|
+
},
|
|
164
|
+
paragraphCenter: {
|
|
165
|
+
alignItems: 'flex-start',
|
|
166
|
+
flexDirection: 'row',
|
|
167
|
+
flexWrap: 'wrap',
|
|
168
|
+
justifyContent: 'center',
|
|
169
|
+
marginBottom: 8,
|
|
170
|
+
marginTop: 8,
|
|
171
|
+
textAlign: 'center',
|
|
172
|
+
},
|
|
173
|
+
paragraphWithImage: {
|
|
174
|
+
alignItems: 'flex-start',
|
|
175
|
+
flex: 1,
|
|
176
|
+
justifyContent: 'flex-start',
|
|
177
|
+
marginBottom: 8,
|
|
178
|
+
marginTop: 8,
|
|
179
|
+
},
|
|
180
|
+
strong: {
|
|
181
|
+
fontWeight: 'bold',
|
|
182
|
+
},
|
|
183
|
+
sublist: {
|
|
184
|
+
paddingLeft: 10,
|
|
185
|
+
width: Dimensions.get('window').width - 60,
|
|
186
|
+
},
|
|
187
|
+
table: {
|
|
188
|
+
borderColor: colors.grey_dark,
|
|
189
|
+
borderRadius: 3,
|
|
190
|
+
borderWidth: 1,
|
|
191
|
+
flex: 1,
|
|
192
|
+
flexDirection: 'row',
|
|
193
|
+
marginVertical: 8,
|
|
194
|
+
},
|
|
195
|
+
tableHeader: {
|
|
196
|
+
backgroundColor: colors.grey,
|
|
197
|
+
flexDirection: 'row',
|
|
198
|
+
justifyContent: 'space-around',
|
|
199
|
+
},
|
|
200
|
+
tableHeaderCell: {
|
|
201
|
+
color: colors.white,
|
|
202
|
+
fontWeight: '500',
|
|
203
|
+
padding: 5,
|
|
204
|
+
},
|
|
205
|
+
tableRow: {
|
|
206
|
+
alignItems: 'center',
|
|
207
|
+
borderColor: colors.grey_dark,
|
|
208
|
+
flexDirection: 'row',
|
|
209
|
+
justifyContent: 'space-around',
|
|
210
|
+
},
|
|
211
|
+
tableRowCell: {
|
|
212
|
+
borderColor: colors.grey_dark,
|
|
213
|
+
flex: 1,
|
|
214
|
+
padding: 5,
|
|
215
|
+
},
|
|
216
|
+
tableRowLast: {
|
|
217
|
+
borderColor: 'transparent',
|
|
218
|
+
},
|
|
219
|
+
text: {
|
|
220
|
+
color: colors.black,
|
|
221
|
+
},
|
|
222
|
+
textRow: {
|
|
223
|
+
flexDirection: 'row',
|
|
224
|
+
},
|
|
225
|
+
u: {
|
|
226
|
+
borderBottomWidth: 1,
|
|
227
|
+
borderColor: colors.grey_dark,
|
|
228
|
+
},
|
|
229
|
+
url: {
|
|
230
|
+
color: colors.accent_blue,
|
|
231
|
+
},
|
|
232
|
+
view: {
|
|
233
|
+
alignSelf: 'stretch',
|
|
234
|
+
},
|
|
235
|
+
});
|
|
236
|
+
};
|