stream-chat-react-native-core 9.9.4-beta.1 → 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,107 @@
|
|
|
1
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
exports.cssToRNTextStyle = void 0;
|
|
6
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
7
|
+
var EM_DEFAULT = 16;
|
|
8
|
+
var len = (v, {
|
|
9
|
+
baseFontSize,
|
|
10
|
+
rootFontSize
|
|
11
|
+
}) => {
|
|
12
|
+
if (v == null) return undefined;
|
|
13
|
+
if (typeof v === 'number') return v;
|
|
14
|
+
if (typeof v !== 'string') return undefined;
|
|
15
|
+
var s = v.trim().toLowerCase();
|
|
16
|
+
if (s.endsWith('px')) {
|
|
17
|
+
var _n = Number(s.slice(0, -2));
|
|
18
|
+
return Number.isFinite(_n) ? _n : undefined;
|
|
19
|
+
}
|
|
20
|
+
if (s.endsWith('em')) {
|
|
21
|
+
var _n2 = Number(s.slice(0, -2));
|
|
22
|
+
return Number.isFinite(_n2) ? _n2 * (baseFontSize != null ? baseFontSize : EM_DEFAULT) : undefined;
|
|
23
|
+
}
|
|
24
|
+
if (s.endsWith('rem')) {
|
|
25
|
+
var _ref;
|
|
26
|
+
var _n3 = Number(s.slice(0, -3));
|
|
27
|
+
var root = (_ref = rootFontSize != null ? rootFontSize : baseFontSize) != null ? _ref : EM_DEFAULT;
|
|
28
|
+
return Number.isFinite(_n3) ? _n3 * root : undefined;
|
|
29
|
+
}
|
|
30
|
+
var n = Number(s);
|
|
31
|
+
return Number.isFinite(n) ? n : undefined;
|
|
32
|
+
};
|
|
33
|
+
var parseFontShorthand = (v, opts) => {
|
|
34
|
+
var _parts$i;
|
|
35
|
+
var out = {};
|
|
36
|
+
var parts = v.split(/\s+/);
|
|
37
|
+
var i = 0;
|
|
38
|
+
if (parts[i] === 'italic' || parts[i] === 'normal') {
|
|
39
|
+
if (parts[i] !== 'normal') out.fontStyle = 'italic';
|
|
40
|
+
i++;
|
|
41
|
+
}
|
|
42
|
+
if (parts[i] === 'small-caps') {
|
|
43
|
+
out.fontVariant = ['small-caps'];
|
|
44
|
+
i++;
|
|
45
|
+
}
|
|
46
|
+
if (/^(normal|bold|[1-9]00)$/.test((_parts$i = parts[i]) != null ? _parts$i : '')) {
|
|
47
|
+
var token = parts[i];
|
|
48
|
+
out.fontWeight = token === 'normal' ? undefined : token;
|
|
49
|
+
i++;
|
|
50
|
+
}
|
|
51
|
+
var sizeToken = parts[i];
|
|
52
|
+
if (sizeToken && (/.+(px|em|rem)$/.test(sizeToken) || /^[\d.]+(\/[\d.]+)?(px|em|rem)?$/.test(sizeToken))) {
|
|
53
|
+
var _sizeToken$split = sizeToken.split('/'),
|
|
54
|
+
_sizeToken$split2 = (0, _slicedToArray2.default)(_sizeToken$split, 2),
|
|
55
|
+
fs = _sizeToken$split2[0],
|
|
56
|
+
lh = _sizeToken$split2[1];
|
|
57
|
+
var fontSize = len(fs, opts);
|
|
58
|
+
if (fontSize != null) out.fontSize = fontSize;
|
|
59
|
+
if (lh) {
|
|
60
|
+
var lineHeight = len(lh, opts);
|
|
61
|
+
if (lineHeight != null) out.lineHeight = lineHeight;
|
|
62
|
+
}
|
|
63
|
+
i++;
|
|
64
|
+
}
|
|
65
|
+
var family = parts.slice(i).join(' ').replace(/^,|,$/g, '').trim();
|
|
66
|
+
if (family) {
|
|
67
|
+
var _family$split$;
|
|
68
|
+
var first = (_family$split$ = family.split(',')[0]) == null ? void 0 : _family$split$.trim().replace(/^["']|["']$/g, '');
|
|
69
|
+
if (first) out.fontFamily = first;
|
|
70
|
+
}
|
|
71
|
+
return out;
|
|
72
|
+
};
|
|
73
|
+
var cssToRNTextStyle = (css, options = {}) => {
|
|
74
|
+
var _options$baseFontSize, _ref2, _options$rootFontSize, _ref3, _css$overflow;
|
|
75
|
+
var opts = {
|
|
76
|
+
baseFontSize: (_options$baseFontSize = options.baseFontSize) != null ? _options$baseFontSize : EM_DEFAULT,
|
|
77
|
+
rootFontSize: (_ref2 = (_options$rootFontSize = options.rootFontSize) != null ? _options$rootFontSize : options.baseFontSize) != null ? _ref2 : EM_DEFAULT
|
|
78
|
+
};
|
|
79
|
+
var out = {};
|
|
80
|
+
if (css.color) out.color = String(css.color);
|
|
81
|
+
if (css.fontFamily) out.fontFamily = String(css.fontFamily);
|
|
82
|
+
if (css.fontStyle) out.fontStyle = css.fontStyle;
|
|
83
|
+
if (css.fontWeight) out.fontWeight = String(css.fontWeight);
|
|
84
|
+
if (css.fontSize != null) {
|
|
85
|
+
var n = len(css.fontSize, opts);
|
|
86
|
+
if (n != null) out.fontSize = n;
|
|
87
|
+
}
|
|
88
|
+
if (css.lineHeight != null) {
|
|
89
|
+
var _n4 = len(css.lineHeight, opts);
|
|
90
|
+
if (_n4 != null) out.lineHeight = _n4;
|
|
91
|
+
}
|
|
92
|
+
if (css.letterSpacing != null) {
|
|
93
|
+
var _n5 = len(css.letterSpacing, opts);
|
|
94
|
+
if (_n5 != null) out.letterSpacing = _n5;
|
|
95
|
+
}
|
|
96
|
+
if (css.textAlign) out.textAlign = css.textAlign;
|
|
97
|
+
if (css.font && typeof css.font === 'string') {
|
|
98
|
+
Object.assign(out, parseFontShorthand(css.font, opts));
|
|
99
|
+
}
|
|
100
|
+
var overflowLike = (_ref3 = (_css$overflow = css.overflow) != null ? _css$overflow : css.overflowX) != null ? _ref3 : css.overflowY;
|
|
101
|
+
if (typeof overflowLike === 'string') {
|
|
102
|
+
out.overflow = overflowLike === 'hidden' ? 'hidden' : overflowLike === 'scroll' || overflowLike === 'auto' ? 'scroll' : 'visible';
|
|
103
|
+
}
|
|
104
|
+
return out;
|
|
105
|
+
};
|
|
106
|
+
exports.cssToRNTextStyle = cssToRNTextStyle;
|
|
107
|
+
//# sourceMappingURL=converter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["EM_DEFAULT","len","v","baseFontSize","rootFontSize","undefined","s","trim","toLowerCase","endsWith","n","Number","slice","isFinite","_ref","root","parseFontShorthand","opts","_parts$i","out","parts","split","i","fontStyle","fontVariant","test","token","fontWeight","sizeToken","_sizeToken$split","_sizeToken$split2","_slicedToArray2","default","fs","lh","fontSize","lineHeight","family","join","replace","_family$split$","first","fontFamily","cssToRNTextStyle","css","options","_options$baseFontSize","_ref2","_options$rootFontSize","_ref3","_css$overflow","color","String","letterSpacing","textAlign","font","Object","assign","overflowLike","overflow","overflowX","overflowY","exports"],"sourceRoot":"../../../../../src","sources":["ai-components/syntax-highlighting/utils/converter.ts"],"mappings":";;;;;;AAIA,IAAMA,UAAU,GAAG,EAAE;AAMrB,IAAMC,GAAG,GAAGA,CAACC,CAAU,EAAE;EAAEC,YAAY;EAAEC;AAA0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X,GAAG,CAACW,IAAI,KAAK,QAAQ,EAAE;IAC5CC,MAAM,CAACC,MAAM,CAACtC,GAAG,EAAEH,kBAAkB,CAAC4B,GAAG,CAACW,IAAI,EAAEtC,IAAI,CAAC,CAAC;EACxD;EAGA,IAAMyC,YAAY,IAAAT,KAAA,IAAAC,aAAA,GAAGN,GAAG,CAACe,QAAQ,YAAAT,aAAA,GAAIN,GAAG,CAACgB,SAAS,YAAAX,KAAA,GAAIL,GAAG,CAACiB,SAAS;EACnE,IAAI,OAAOH,YAAY,KAAK,QAAQ,EAAE;IACpCvC,GAAG,CAACwC,QAAQ,GACVD,YAAY,KAAK,QAAQ,GACrB,QAAQ,GACRA,YAAY,KAAK,QAAQ,IAAIA,YAAY,KAAK,MAAM,GAClD,QAAQ,GACR,SAAS;EACnB;EAEA,OAAOvC,GAAG;AACZ,CAAC;AAAC2C,OAAA,CAAAnB,gBAAA,GAAAA,gBAAA","ignoreList":[]}
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
Object.defineProperty(exports, "__esModule", {
|
|
2
|
+
value: true
|
|
3
|
+
});
|
|
4
|
+
exports.flattenRowsToTextAndColorRanges = exports.flattenNodesToTextAndColorRanges = void 0;
|
|
5
|
+
var _reactNative = require("react-native");
|
|
6
|
+
var _createElement = require("react-syntax-highlighter/dist/esm/create-element");
|
|
7
|
+
function _createForOfIteratorHelperLoose(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (t) return (t = t.call(r)).next.bind(t); if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var o = 0; return function () { return o >= r.length ? { done: !0 } : { done: !1, value: r[o++] }; }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
8
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
9
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
10
|
+
var flattenNodesToTextAndColorRanges = ({
|
|
11
|
+
nodes,
|
|
12
|
+
stylesheet,
|
|
13
|
+
defaultColor,
|
|
14
|
+
fontFamily,
|
|
15
|
+
fontSize = 13
|
|
16
|
+
}) => {
|
|
17
|
+
var text = '';
|
|
18
|
+
var rawRanges = [];
|
|
19
|
+
var startingStyle = {
|
|
20
|
+
fontFamily,
|
|
21
|
+
fontSize
|
|
22
|
+
};
|
|
23
|
+
var walk = (node, inheritedColor) => {
|
|
24
|
+
if (!node) return;
|
|
25
|
+
var type = node.type,
|
|
26
|
+
tagName = node.tagName,
|
|
27
|
+
value = node.value,
|
|
28
|
+
properties = node.properties;
|
|
29
|
+
if (type === 'text') {
|
|
30
|
+
if (value == null || value === '') return;
|
|
31
|
+
var chunk = String(value);
|
|
32
|
+
var start = text.length;
|
|
33
|
+
text += chunk;
|
|
34
|
+
var color = inheritedColor != null ? inheritedColor : defaultColor;
|
|
35
|
+
if (color != null && chunk.length) {
|
|
36
|
+
rawRanges.push({
|
|
37
|
+
start,
|
|
38
|
+
end: start + chunk.length,
|
|
39
|
+
color
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
if (tagName) {
|
|
45
|
+
var _ref, _color;
|
|
46
|
+
var baseStyle = properties && properties.className ? (0, _createElement.createStyleObject)(properties.className, Object.assign({
|
|
47
|
+
color: defaultColor
|
|
48
|
+
}, properties.style, startingStyle), stylesheet) : {
|
|
49
|
+
...startingStyle,
|
|
50
|
+
color: defaultColor
|
|
51
|
+
};
|
|
52
|
+
var effectiveColor = (_ref = (_color = baseStyle.color) != null ? _color : inheritedColor) != null ? _ref : defaultColor;
|
|
53
|
+
var children = node.children || [];
|
|
54
|
+
var childArray = Array.isArray(children) ? children : [children];
|
|
55
|
+
for (var i = 0; i < childArray.length; i++) {
|
|
56
|
+
walk(childArray[i], effectiveColor);
|
|
57
|
+
}
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
if (value != null) {
|
|
61
|
+
var _chunk = String(value);
|
|
62
|
+
var _start = text.length;
|
|
63
|
+
text += _chunk;
|
|
64
|
+
var _color2 = inheritedColor != null ? inheritedColor : defaultColor;
|
|
65
|
+
if (_color2 != null && _chunk.length) {
|
|
66
|
+
rawRanges.push({
|
|
67
|
+
start: _start,
|
|
68
|
+
end: _start + _chunk.length,
|
|
69
|
+
color: _color2
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
var nodeArray = Array.isArray(nodes) ? nodes : [nodes];
|
|
75
|
+
for (var i = 0; i < nodeArray.length; i++) {
|
|
76
|
+
walk(nodeArray[i], defaultColor);
|
|
77
|
+
}
|
|
78
|
+
rawRanges.sort((a, b) => a.start - b.start);
|
|
79
|
+
var merged = [];
|
|
80
|
+
for (var _i = 0; _i < rawRanges.length; _i++) {
|
|
81
|
+
var r = rawRanges[_i];
|
|
82
|
+
var colorInt = (0, _reactNative.processColor)(r.color);
|
|
83
|
+
if (!merged.length) {
|
|
84
|
+
merged.push({
|
|
85
|
+
start: r.start,
|
|
86
|
+
end: r.end,
|
|
87
|
+
color: colorInt
|
|
88
|
+
});
|
|
89
|
+
continue;
|
|
90
|
+
}
|
|
91
|
+
var last = merged[merged.length - 1];
|
|
92
|
+
if (last && last.end === r.start && last.color === colorInt) {
|
|
93
|
+
last.end = r.end;
|
|
94
|
+
} else {
|
|
95
|
+
merged.push({
|
|
96
|
+
start: r.start,
|
|
97
|
+
end: r.end,
|
|
98
|
+
color: colorInt
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
return {
|
|
103
|
+
text,
|
|
104
|
+
ranges: merged
|
|
105
|
+
};
|
|
106
|
+
};
|
|
107
|
+
exports.flattenNodesToTextAndColorRanges = flattenNodesToTextAndColorRanges;
|
|
108
|
+
var flattenRowsToTextAndColorRanges = (rows, opts) => {
|
|
109
|
+
var fullText = '';
|
|
110
|
+
var fullRanges = [];
|
|
111
|
+
for (var rowIndex = 0; rowIndex < rows.length; rowIndex++) {
|
|
112
|
+
var rowNodes = rows[rowIndex];
|
|
113
|
+
var _flattenNodesToTextAn = flattenNodesToTextAndColorRanges({
|
|
114
|
+
...opts,
|
|
115
|
+
nodes: rowNodes != null ? rowNodes : []
|
|
116
|
+
}),
|
|
117
|
+
text = _flattenNodesToTextAn.text,
|
|
118
|
+
ranges = _flattenNodesToTextAn.ranges;
|
|
119
|
+
var offset = fullText.length;
|
|
120
|
+
fullText += text;
|
|
121
|
+
if (rowIndex < rows.length - 1) {
|
|
122
|
+
fullText += '\n';
|
|
123
|
+
}
|
|
124
|
+
for (var _iterator = _createForOfIteratorHelperLoose(ranges), _step; !(_step = _iterator()).done;) {
|
|
125
|
+
var r = _step.value;
|
|
126
|
+
fullRanges.push({
|
|
127
|
+
start: r.start + offset,
|
|
128
|
+
end: r.end + offset,
|
|
129
|
+
color: r.color
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
return {
|
|
134
|
+
text: fullText,
|
|
135
|
+
ranges: fullRanges
|
|
136
|
+
};
|
|
137
|
+
};
|
|
138
|
+
exports.flattenRowsToTextAndColorRanges = flattenRowsToTextAndColorRanges;
|
|
139
|
+
//# sourceMappingURL=flatten-nodes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_reactNative","require","_createElement","_createForOfIteratorHelperLoose","r","e","t","Symbol","iterator","call","next","bind","Array","isArray","_unsupportedIterableToArray","length","o","done","value","TypeError","a","_arrayLikeToArray","toString","slice","constructor","name","from","test","n","flattenNodesToTextAndColorRanges","nodes","stylesheet","defaultColor","fontFamily","fontSize","text","rawRanges","startingStyle","walk","node","inheritedColor","type","tagName","properties","chunk","String","start","color","push","end","_ref","_color","baseStyle","className","createStyleObject","Object","assign","style","effectiveColor","children","childArray","i","nodeArray","sort","b","merged","colorInt","processColor","last","ranges","exports","flattenRowsToTextAndColorRanges","rows","opts","fullText","fullRanges","rowIndex","rowNodes","_flattenNodesToTextAn","offset","_iterator","_step"],"sourceRoot":"../../../../../src","sources":["ai-components/syntax-highlighting/utils/flatten-nodes.ts"],"mappings":";;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAGA,IAAAC,cAAA,GAAAD,OAAA;AAAqF,SAAAE,gCAAAC,CAAA,EAAAC,CAAA,QAAAC,CAAA,yBAAAC,MAAA,IAAAH,CAAA,CAAAG,MAAA,CAAAC,QAAA,KAAAJ,CAAA,oBAAAE,CAAA,UAAAA,CAAA,GAAAA,CAAA,CAAAG,IAAA,CAAAL,CAAA,GAAAM,IAAA,CAAAC,IAAA,CAAAL,CAAA,OAAAM,KAAA,CAAAC,OAAA,CAAAT,CAAA,MAAAE,CAAA,GAAAQ,2BAAA,CAAAV,CAAA,MAAAC,CAAA,IAAAD,CAAA,uBAAAA,CAAA,CAAAW,MAAA,IAAAT,CAAA,KAAAF,CAAA,GAAAE,CAAA,OAAAU,CAAA,kCAAAA,CAAA,IAAAZ,CAAA,CAAAW,MAAA,KAAAE,IAAA,WAAAA,IAAA,MAAAC,KAAA,EAAAd,CAAA,CAAAY,CAAA,sBAAAG,SAAA;AAAA,SAAAL,4BAAAV,CAAA,EAAAgB,CAAA,QAAAhB,CAAA,2BAAAA,CAAA,SAAAiB,iBAAA,CAAAjB,CAAA,EAAAgB,CAAA,OAAAd,CAAA,MAAAgB,QAAA,CAAAb,IAAA,CAAAL,CAAA,EAAAmB,KAAA,6BAAAjB,CAAA,IAAAF,CAAA,CAAAoB,WAAA,KAAAlB,CAAA,GAAAF,CAA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,QAAQ,IAAI,IAAI;IAClB;IAGA,SAAAM,SAAA,GAAA7E,+BAAA,CAAgBkE,MAAM,GAAAY,KAAA,IAAAA,KAAA,GAAAD,SAAA,IAAA/D,IAAA,GAAE;MAAA,IAAbb,CAAC,GAAA6E,KAAA,CAAA/D,KAAA;MACVyD,UAAU,CAAC3B,IAAI,CAAC;QACdF,KAAK,EAAE1C,CAAC,CAAC0C,KAAK,GAAGiC,MAAM;QACvB9B,GAAG,EAAE7C,CAAC,CAAC6C,GAAG,GAAG8B,MAAM;QACnBhC,KAAK,EAAE3C,CAAC,CAAC2C;MACX,CAAC,CAAC;IACJ;EACF;EAEA,OAAO;IAAEZ,IAAI,EAAEuC,QAAQ;IAAEL,MAAM,EAAEM;EAAW,CAAC;AAC/C,CAAC;AAACL,OAAA,CAAAC,+BAAA,GAAAA,+BAAA","ignoreList":[]}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
Object.defineProperty(exports, "__esModule", {
|
|
2
|
+
value: true
|
|
3
|
+
});
|
|
4
|
+
var _converter = require("./converter");
|
|
5
|
+
Object.keys(_converter).forEach(function (key) {
|
|
6
|
+
if (key === "default" || key === "__esModule") return;
|
|
7
|
+
if (key in exports && exports[key] === _converter[key]) return;
|
|
8
|
+
Object.defineProperty(exports, key, {
|
|
9
|
+
enumerable: true,
|
|
10
|
+
get: function () {
|
|
11
|
+
return _converter[key];
|
|
12
|
+
}
|
|
13
|
+
});
|
|
14
|
+
});
|
|
15
|
+
var _flattenNodes = require("./flatten-nodes");
|
|
16
|
+
Object.keys(_flattenNodes).forEach(function (key) {
|
|
17
|
+
if (key === "default" || key === "__esModule") return;
|
|
18
|
+
if (key in exports && exports[key] === _flattenNodes[key]) return;
|
|
19
|
+
Object.defineProperty(exports, key, {
|
|
20
|
+
enumerable: true,
|
|
21
|
+
get: function () {
|
|
22
|
+
return _flattenNodes[key];
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
});
|
|
26
|
+
var _renderer = require("./renderer");
|
|
27
|
+
Object.keys(_renderer).forEach(function (key) {
|
|
28
|
+
if (key === "default" || key === "__esModule") return;
|
|
29
|
+
if (key in exports && exports[key] === _renderer[key]) return;
|
|
30
|
+
Object.defineProperty(exports, key, {
|
|
31
|
+
enumerable: true,
|
|
32
|
+
get: function () {
|
|
33
|
+
return _renderer[key];
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
});
|
|
37
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_converter","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get","_flattenNodes","_renderer"],"sourceRoot":"../../../../../src","sources":["ai-components/syntax-highlighting/utils/index.ts"],"mappings":";;;AAAA,IAAAA,UAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,UAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,UAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAT,UAAA,CAAAK,GAAA;IAAA;EAAA;AAAA;AACA,IAAAK,aAAA,GAAAT,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAO,aAAA,EAAAN,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAK,aAAA,CAAAL,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAC,aAAA,CAAAL,GAAA;IAAA;EAAA;AAAA;AACA,IAAAM,SAAA,GAAAV,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAQ,SAAA,EAAAP,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAM,SAAA,CAAAN,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAE,SAAA,CAAAN,GAAA;IAAA;EAAA;AAAA","ignoreList":[]}
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
exports.nativeRenderer = exports.generateNewStylesheet = exports.createNativeElement = exports.createChildren = exports.DEFAULT_FONT_SIZE = void 0;
|
|
6
|
+
var _react = _interopRequireDefault(require("react"));
|
|
7
|
+
var _reactNative = require("react-native");
|
|
8
|
+
var _createElement = require("react-syntax-highlighter/dist/esm/create-element");
|
|
9
|
+
var _converter = require("./converter");
|
|
10
|
+
var _components = require("../components");
|
|
11
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
12
|
+
var _jsxFileName = "/home/runner/work/stream-chat-react-native/stream-chat-react-native/package/src/ai-components/syntax-highlighting/utils/renderer.tsx";
|
|
13
|
+
var DEFAULT_FONT_SIZE = exports.DEFAULT_FONT_SIZE = 13;
|
|
14
|
+
var generateNewStylesheet = ({
|
|
15
|
+
stylesheet,
|
|
16
|
+
highlighter
|
|
17
|
+
}) => {
|
|
18
|
+
stylesheet = Array.isArray(stylesheet) ? stylesheet[0] : stylesheet;
|
|
19
|
+
var transformedStyle = Object.entries(stylesheet != null ? stylesheet : {}).reduce((newStylesheet, [className, style]) => {
|
|
20
|
+
var rn = (0, _converter.cssToRNTextStyle)(style);
|
|
21
|
+
newStylesheet[className] = rn;
|
|
22
|
+
return newStylesheet;
|
|
23
|
+
}, {});
|
|
24
|
+
var topLevel = highlighter === 'prism' ? transformedStyle['pre[class*="language-"]'] : transformedStyle.hljs;
|
|
25
|
+
var defaultColor = topLevel && topLevel.color || '#000';
|
|
26
|
+
return {
|
|
27
|
+
transformedStyle,
|
|
28
|
+
defaultColor
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
exports.generateNewStylesheet = generateNewStylesheet;
|
|
32
|
+
var createChildren = ({
|
|
33
|
+
stylesheet,
|
|
34
|
+
fontSize,
|
|
35
|
+
fontFamily
|
|
36
|
+
}) => {
|
|
37
|
+
var childrenCount = 0;
|
|
38
|
+
return (children, defaultColor) => {
|
|
39
|
+
childrenCount += 1;
|
|
40
|
+
return (children != null ? children : []).map((child, i) => createNativeElement({
|
|
41
|
+
node: child,
|
|
42
|
+
stylesheet,
|
|
43
|
+
key: `code-segment-${childrenCount}-${i}`,
|
|
44
|
+
defaultColor,
|
|
45
|
+
fontSize,
|
|
46
|
+
fontFamily
|
|
47
|
+
}));
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
exports.createChildren = createChildren;
|
|
51
|
+
var createNativeElement = ({
|
|
52
|
+
node,
|
|
53
|
+
stylesheet,
|
|
54
|
+
key,
|
|
55
|
+
defaultColor,
|
|
56
|
+
fontFamily,
|
|
57
|
+
fontSize = DEFAULT_FONT_SIZE
|
|
58
|
+
}) => {
|
|
59
|
+
var properties = node.properties,
|
|
60
|
+
type = node.type,
|
|
61
|
+
TagName = node.tagName,
|
|
62
|
+
value = node.value;
|
|
63
|
+
var startingStyle = {
|
|
64
|
+
fontFamily,
|
|
65
|
+
fontSize
|
|
66
|
+
};
|
|
67
|
+
if (type === 'text') {
|
|
68
|
+
return (0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
69
|
+
style: Object.assign({
|
|
70
|
+
color: defaultColor
|
|
71
|
+
}, startingStyle),
|
|
72
|
+
children: value
|
|
73
|
+
}, key);
|
|
74
|
+
} else if (TagName) {
|
|
75
|
+
var childrenFactory = createChildren({
|
|
76
|
+
stylesheet,
|
|
77
|
+
fontSize,
|
|
78
|
+
fontFamily
|
|
79
|
+
});
|
|
80
|
+
var style = properties ? (0, _createElement.createStyleObject)(properties.className, Object.assign({
|
|
81
|
+
color: defaultColor
|
|
82
|
+
}, properties.style, startingStyle), stylesheet) : {};
|
|
83
|
+
var children = childrenFactory(node.children, style.color || defaultColor);
|
|
84
|
+
return (0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
85
|
+
style: style,
|
|
86
|
+
children: children
|
|
87
|
+
}, key);
|
|
88
|
+
}
|
|
89
|
+
return null;
|
|
90
|
+
};
|
|
91
|
+
exports.createNativeElement = createNativeElement;
|
|
92
|
+
var nativeRenderer = ({
|
|
93
|
+
defaultColor,
|
|
94
|
+
fontFamily,
|
|
95
|
+
fontSize = 13
|
|
96
|
+
}) => {
|
|
97
|
+
return ({
|
|
98
|
+
rows,
|
|
99
|
+
stylesheet
|
|
100
|
+
}) => _reactNative.Platform.OS === 'android' ? (0, _jsxRuntime.jsx)(_components.AndroidNativeRenderer, {
|
|
101
|
+
rows: rows,
|
|
102
|
+
stylesheet: stylesheet,
|
|
103
|
+
defaultColor: defaultColor,
|
|
104
|
+
fontFamily: fontFamily,
|
|
105
|
+
fontSize: fontSize,
|
|
106
|
+
lineHeight: fontSize - 4
|
|
107
|
+
}) : rows.map((node, i) => createNativeElement({
|
|
108
|
+
node,
|
|
109
|
+
stylesheet,
|
|
110
|
+
key: `code-segment-${i}`,
|
|
111
|
+
defaultColor,
|
|
112
|
+
fontFamily,
|
|
113
|
+
fontSize
|
|
114
|
+
}));
|
|
115
|
+
};
|
|
116
|
+
exports.nativeRenderer = nativeRenderer;
|
|
117
|
+
//# sourceMappingURL=renderer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireDefault","require","_reactNative","_createElement","_converter","_components","_jsxRuntime","_jsxFileName","DEFAULT_FONT_SIZE","exports","generateNewStylesheet","stylesheet","highlighter","Array","isArray","transformedStyle","Object","entries","reduce","newStylesheet","className","style","rn","cssToRNTextStyle","topLevel","hljs","defaultColor","color","createChildren","fontSize","fontFamily","childrenCount","children","map","child","i","createNativeElement","node","key","properties","type","TagName","tagName","value","startingStyle","jsx","Text","assign","childrenFactory","createStyleObject","nativeRenderer","rows","Platform","OS","AndroidNativeRenderer","lineHeight"],"sourceRoot":"../../../../../src","sources":["ai-components/syntax-highlighting/utils/renderer.tsx"],"mappings":";;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAKA,IAAAE,cAAA,GAAAF,OAAA;AAEA,IAAAG,UAAA,GAAAH,OAAA;AAEA,IAAAI,WAAA,GAAAJ,OAAA;AAAsD,IAAAK,WAAA,GAAAL,OAAA;AAAA,IAAAM,YAAA;AAQ/C,IAAMC,iBAAiB,GAAAC,OAAA,CAAAD,iBAAA,GAAG,EAAE;AAE5B,IAAME,qBAAqB,GAAGA,CAAC;EACpCC,UAAU;EACVC;AAIF,CAAC,KAAK;EACJD,UAAU,GAAGE,KAAK,CAACC,OAAO,CAACH,UAAU,CAAC,GAAGA,UAAU,CAAC,CAAC,CAAC,GAAGA,UAAU;EAEnE,IAAMI,gBAAgB,GAAGC,MAAM,CAACC,OAAO,CAACN,UAAU,WAAVA,UAAU,GAAI,CAAC,CAAC,CAAC,CAACO,MAAM,CAC9D,CAACC,aAAa,EAAE,CAACC,SAAS,EAAEC,KAAK,CAAC,KAAK;IACrC,IAAMC,EAAE,GAAG,IAAAC,2BAAgB,EAACF,KAAK,CAAC;IAElCF,aAAa,CAACC,SAAS,CAAC,GAAGE,EAAa;IACxC,OAAOH,aAAa;EACtB,CAAC,EACD,CAAC,CACH,CAAC;EAED,IAAMK,QAAQ,GACZZ,WAAW,KAAK,OAAO,GAAGG,gBAAgB,CAAC,yBAAyB,CAAC,GAAGA,gBAAgB,CAACU,IAC/E;EAEZ,IAAMC,YAAY,GAAIF,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,IAAI,EAAEF,CAAC,KACfC,mBAAmB,CAAC;IAClBC,IAAI;IACJ1B,UAAU;IACV2B,GAAG,EAAE,gBAAgBH,CAAC,EAAE;IACxBT,YAAY;IACZI,UAAU;IACVD;EACF,CAAC,CACH,CACD;AACL,CAAC;AAACpB,OAAA,CAAAyC,cAAA,GAAAA,cAAA","ignoreList":[]}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
Object.defineProperty(exports, "__esModule", {
|
|
2
|
+
value: true
|
|
3
|
+
});
|
|
4
|
+
exports.defaultTheme = exports.colors = void 0;
|
|
5
|
+
var colors = exports.colors = {
|
|
6
|
+
accent_blue: '#005FFF',
|
|
7
|
+
accent_red: '#FF3742',
|
|
8
|
+
black: '#000000',
|
|
9
|
+
code_block: '#DDDDDD',
|
|
10
|
+
grey: '#7A7A7A',
|
|
11
|
+
grey_neutral: '#9E9E9E',
|
|
12
|
+
grey_dark: '#72767E',
|
|
13
|
+
grey_gainsboro: '#DBDBDB',
|
|
14
|
+
grey_whisper: '#ECEBEB',
|
|
15
|
+
overlay: '#000000CC',
|
|
16
|
+
transparent: 'transparent',
|
|
17
|
+
white: '#FFFFFF',
|
|
18
|
+
white_smoke: '#F2F2F2',
|
|
19
|
+
shimmer: '#FFFFFF'
|
|
20
|
+
};
|
|
21
|
+
var defaultTheme = exports.defaultTheme = {
|
|
22
|
+
colors,
|
|
23
|
+
markdown: {
|
|
24
|
+
autolink: {},
|
|
25
|
+
blockQuoteSection: {},
|
|
26
|
+
blockQuoteSectionBar: {},
|
|
27
|
+
blockQuoteText: {},
|
|
28
|
+
strong: {},
|
|
29
|
+
codeBlock: {},
|
|
30
|
+
codeBlockWrapper: {},
|
|
31
|
+
codeBlockContainer: {},
|
|
32
|
+
codeBlockHeaderContainer: {},
|
|
33
|
+
codeBlockHeaderTitle: {},
|
|
34
|
+
em: {},
|
|
35
|
+
heading: {},
|
|
36
|
+
heading1: {},
|
|
37
|
+
heading2: {},
|
|
38
|
+
heading3: {},
|
|
39
|
+
heading4: {},
|
|
40
|
+
heading5: {},
|
|
41
|
+
heading6: {},
|
|
42
|
+
hr: {},
|
|
43
|
+
inlineCode: {},
|
|
44
|
+
br: {},
|
|
45
|
+
list: {},
|
|
46
|
+
listItem: {},
|
|
47
|
+
listItemBullet: {},
|
|
48
|
+
listItemNumber: {},
|
|
49
|
+
listItemText: {},
|
|
50
|
+
listRow: {},
|
|
51
|
+
sublist: {},
|
|
52
|
+
url: {},
|
|
53
|
+
noMargin: {},
|
|
54
|
+
paragraph: {},
|
|
55
|
+
paragraphCenter: {},
|
|
56
|
+
del: {},
|
|
57
|
+
text: {},
|
|
58
|
+
table: {},
|
|
59
|
+
tableRow: {},
|
|
60
|
+
tableRowCell: {},
|
|
61
|
+
tableHeader: {},
|
|
62
|
+
tableHeaderCell: {}
|
|
63
|
+
},
|
|
64
|
+
composer: {
|
|
65
|
+
container: {},
|
|
66
|
+
containerRow: {},
|
|
67
|
+
inputPillHeight: 48,
|
|
68
|
+
inputPillContainer: {},
|
|
69
|
+
inputPill: {},
|
|
70
|
+
textInput: {},
|
|
71
|
+
roundButton: {},
|
|
72
|
+
attachIcon: {},
|
|
73
|
+
mediaPreviewStyle: {},
|
|
74
|
+
mediaPreviewContentContainerStyle: {},
|
|
75
|
+
mediaPreviewImage: {},
|
|
76
|
+
mediaPreviewRemoveButton: {},
|
|
77
|
+
micIcon: {},
|
|
78
|
+
sendIcon: {},
|
|
79
|
+
stopGeneratingIcon: {},
|
|
80
|
+
iconButton: {}
|
|
81
|
+
},
|
|
82
|
+
sheet: {
|
|
83
|
+
contentContainer: {},
|
|
84
|
+
quickActionsCard: {},
|
|
85
|
+
divider: {},
|
|
86
|
+
listSection: {},
|
|
87
|
+
quickAction: {},
|
|
88
|
+
quickActionLabel: {},
|
|
89
|
+
listItem: {},
|
|
90
|
+
listIcon: {},
|
|
91
|
+
listTextContainer: {},
|
|
92
|
+
listTitle: {},
|
|
93
|
+
listSubtitle: {}
|
|
94
|
+
},
|
|
95
|
+
aiTypingIndicatorView: {
|
|
96
|
+
text: {}
|
|
97
|
+
}
|
|
98
|
+
};
|
|
99
|
+
//# sourceMappingURL=theme.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["colors","exports","accent_blue","accent_red","black","code_block","grey","grey_neutral","grey_dark","grey_gainsboro","grey_whisper","overlay","transparent","white","white_smoke","shimmer","defaultTheme","markdown","autolink","blockQuoteSection","blockQuoteSectionBar","blockQuoteText","strong","codeBlock","codeBlockWrapper","codeBlockContainer","codeBlockHeaderContainer","codeBlockHeaderTitle","em","heading","heading1","heading2","heading3","heading4","heading5","heading6","hr","inlineCode","br","list","listItem","listItemBullet","listItemNumber","listItemText","listRow","sublist","url","noMargin","paragraph","paragraphCenter","del","text","table","tableRow","tableRowCell","tableHeader","tableHeaderCell","composer","container","containerRow","inputPillHeight","inputPillContainer","inputPill","textInput","roundButton","attachIcon","mediaPreviewStyle","mediaPreviewContentContainerStyle","mediaPreviewImage","mediaPreviewRemoveButton","micIcon","sendIcon","stopGeneratingIcon","iconButton","sheet","contentContainer","quickActionsCard","divider","listSection","quickAction","quickActionLabel","listIcon","listTextContainer","listTitle","listSubtitle","aiTypingIndicatorView"],"sourceRoot":"../../../src","sources":["ai-components/theme.ts"],"mappings":";;;;AAIO,IAAMA,MAAM,GAAAC,OAAA,CAAAD,MAAA,GAAG;EACpBE,WAAW,EAAE,SAAS;EACtBC,UAAU,EAAE,SAAS;EACrBC,KAAK,EAAE,SAAS;EAChBC,UAAU,EAAE,SAAS;EACrBC,IAAI,EAAE,SAAS;EACfC,YAAY,EAAE,SAAS;EACvBC,SAAS,EAAE,SAAS;EACpBC,cAAc,EAAE,SAAS;EACzBC,YAAY,EAAE,SAAS;EACvBC,OAAO,EAAE,WAAW;EACpBC,WAAW,EAAE,aAAa;EAC1BC,KAAK,EAAE,SAAS;EAChBC,WAAW,EAAE,SAAS;EACtBC,OAAO,EAAE;AACX,CAAC;AAyCM,IAAMC,YAAm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AW,EAAE,CAAC,CAAC;IACfC,eAAe,EAAE,CAAC;EACpB,CAAC;EACDC,QAAQ,EAAE;IACRC,SAAS,EAAE,CAAC,CAAC;IACbC,YAAY,EAAE,CAAC,CAAC;IAChBC,eAAe,EAAE,EAAE;IACnBC,kBAAkB,EAAE,CAAC,CAAC;IACtBC,SAAS,EAAE,CAAC,CAAC;IACbC,SAAS,EAAE,CAAC,CAAC;IACbC,WAAW,EAAE,CAAC,CAAC;IACfC,UAAU,EAAE,CAAC,CAAC;IACdC,iBAAiB,EAAE,CAAC,CAAC;IACrBC,iCAAiC,EAAE,CAAC,CAAC;IACrCC,iBAAiB,EAAE,CAAC,CAAC;IACrBC,wBAAwB,EAAE,CAAC,CAAC;IAC5BC,OAAO,EAAE,CAAC,CAAC;IACXC,QAAQ,EAAE,CAAC,CAAC;IACZC,kBAAkB,EAAE,CAAC,CAAC;IACtBC,UAAU,EAAE,CAAC;EACf,CAAC;EACDC,KAAK,EAAE;IACLC,gBAAgB,EAAE,CAAC,CAAC;IACpBC,gBAAgB,EAAE,CAAC,CAAC;IACpBC,OAAO,EAAE,CAAC,CAAC;IACXC,WAAW,EAAE,CAAC,CAAC;IACfC,WAAW,EAAE,CAAC,CAAC;IACfC,gBAAgB,EAAE,CAAC,CAAC;IACpBxC,QAAQ,EAAE,CAAC,CAAC;IACZyC,QAAQ,EAAE,CAAC,CAAC;IACZC,iBAAiB,EAAE,CAAC,CAAC;IACrBC,SAAS,EAAE,CAAC,CAAC;IACbC,YAAY,EAAE,CAAC;EACjB,CAAC;EACDC,qBAAqB,EAAE;IACrBlC,IAAI,EAAE,CAAC;EACT;AACF,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
exports.useDictation = void 0;
|
|
6
|
+
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
7
|
+
var _react = require("react");
|
|
8
|
+
var _reactNative = require("react-native");
|
|
9
|
+
var _reactBindings = require("@stream-io/state-store/react-bindings");
|
|
10
|
+
var _useStableCallback = require("../internal/hooks/useStableCallback");
|
|
11
|
+
var _AIDictation = require("../native/AIDictation");
|
|
12
|
+
var _store = require("../store");
|
|
13
|
+
var DEFAULT_OPTIONS = {
|
|
14
|
+
language: 'en-US',
|
|
15
|
+
interimResults: true,
|
|
16
|
+
silenceTimeoutMs: 2500
|
|
17
|
+
};
|
|
18
|
+
var ensureAndroidRecordingPermissions = function () {
|
|
19
|
+
var _ref = (0, _asyncToGenerator2.default)(function* () {
|
|
20
|
+
if (_reactNative.Platform.OS !== 'android') return true;
|
|
21
|
+
var granted = yield _reactNative.PermissionsAndroid.request(_reactNative.PermissionsAndroid.PERMISSIONS.RECORD_AUDIO);
|
|
22
|
+
return granted === _reactNative.PermissionsAndroid.RESULTS.GRANTED;
|
|
23
|
+
});
|
|
24
|
+
return function ensureAndroidRecordingPermissions() {
|
|
25
|
+
return _ref.apply(this, arguments);
|
|
26
|
+
};
|
|
27
|
+
}();
|
|
28
|
+
var selector = ({
|
|
29
|
+
isRecording
|
|
30
|
+
}) => ({
|
|
31
|
+
isRecording
|
|
32
|
+
});
|
|
33
|
+
var useDictation = (defaultOptions = DEFAULT_OPTIONS) => {
|
|
34
|
+
var _useStateStore = (0, _reactBindings.useStateStore)(_store.dictationStore, selector),
|
|
35
|
+
isRecording = _useStateStore.isRecording;
|
|
36
|
+
(0, _react.useEffect)(() => {
|
|
37
|
+
var unsubscribeResult = _AIDictation.AIDictation.addResultListener(result => {
|
|
38
|
+
_store.dictationStore.partialNext({
|
|
39
|
+
transcript: result.text,
|
|
40
|
+
...(result.isFinal ? {
|
|
41
|
+
isRecording: false,
|
|
42
|
+
state: 'idle'
|
|
43
|
+
} : {})
|
|
44
|
+
});
|
|
45
|
+
});
|
|
46
|
+
var unsubscribeState = _AIDictation.AIDictation.addStateListener(({
|
|
47
|
+
state: next
|
|
48
|
+
}) => {
|
|
49
|
+
_store.dictationStore.partialNext({
|
|
50
|
+
state: next,
|
|
51
|
+
isRecording: next === 'listening' || next === 'starting'
|
|
52
|
+
});
|
|
53
|
+
});
|
|
54
|
+
var unsubscribeError = _AIDictation.AIDictation.addErrorListener(error => {
|
|
55
|
+
_store.dictationStore.partialNext({
|
|
56
|
+
error,
|
|
57
|
+
isRecording: false,
|
|
58
|
+
state: 'idle'
|
|
59
|
+
});
|
|
60
|
+
});
|
|
61
|
+
return () => {
|
|
62
|
+
unsubscribeResult();
|
|
63
|
+
unsubscribeState();
|
|
64
|
+
unsubscribeError();
|
|
65
|
+
};
|
|
66
|
+
}, []);
|
|
67
|
+
var start = (0, _react.useCallback)(function () {
|
|
68
|
+
var _ref2 = (0, _asyncToGenerator2.default)(function* (override) {
|
|
69
|
+
var hasPermission = yield ensureAndroidRecordingPermissions();
|
|
70
|
+
if (!hasPermission) {
|
|
71
|
+
_store.dictationStore.partialNext({
|
|
72
|
+
error: {
|
|
73
|
+
code: 'NO_PERMISSION',
|
|
74
|
+
message: 'Microphone permission not granted'
|
|
75
|
+
}
|
|
76
|
+
});
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
_store.dictationStore.partialNext({
|
|
80
|
+
error: null,
|
|
81
|
+
transcript: ''
|
|
82
|
+
});
|
|
83
|
+
var opts = {
|
|
84
|
+
...defaultOptions,
|
|
85
|
+
...override
|
|
86
|
+
};
|
|
87
|
+
_AIDictation.AIDictation.start(opts);
|
|
88
|
+
});
|
|
89
|
+
return function (_x) {
|
|
90
|
+
return _ref2.apply(this, arguments);
|
|
91
|
+
};
|
|
92
|
+
}(), [defaultOptions]);
|
|
93
|
+
var stop = (0, _react.useCallback)(() => {
|
|
94
|
+
_AIDictation.AIDictation.stop();
|
|
95
|
+
}, []);
|
|
96
|
+
var cancel = (0, _react.useCallback)(() => {
|
|
97
|
+
_AIDictation.AIDictation.cancel();
|
|
98
|
+
}, []);
|
|
99
|
+
var toggle = (0, _useStableCallback.useStableCallback)(() => {
|
|
100
|
+
if (isRecording) {
|
|
101
|
+
stop();
|
|
102
|
+
} else {
|
|
103
|
+
void start();
|
|
104
|
+
}
|
|
105
|
+
});
|
|
106
|
+
return {
|
|
107
|
+
start,
|
|
108
|
+
stop,
|
|
109
|
+
toggle,
|
|
110
|
+
cancel
|
|
111
|
+
};
|
|
112
|
+
};
|
|
113
|
+
exports.useDictation = useDictation;
|
|
114
|
+
//# sourceMappingURL=useDictation.js.map
|