@crafter/rn-ai-elements 0.0.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/lib/commonjs/chatbot/AIImage.js +126 -0
- package/lib/commonjs/chatbot/AIImage.js.map +1 -0
- package/lib/commonjs/chatbot/Attachments.js +317 -0
- package/lib/commonjs/chatbot/Attachments.js.map +1 -0
- package/lib/commonjs/chatbot/ChatErrorBoundary.js +201 -0
- package/lib/commonjs/chatbot/ChatErrorBoundary.js.map +1 -0
- package/lib/commonjs/chatbot/ChatMessageItem.js +169 -0
- package/lib/commonjs/chatbot/ChatMessageItem.js.map +1 -0
- package/lib/commonjs/chatbot/Conversation.js +415 -0
- package/lib/commonjs/chatbot/Conversation.js.map +1 -0
- package/lib/commonjs/chatbot/ConversationScrollButton.js +131 -0
- package/lib/commonjs/chatbot/ConversationScrollButton.js.map +1 -0
- package/lib/commonjs/chatbot/Message.js +203 -0
- package/lib/commonjs/chatbot/Message.js.map +1 -0
- package/lib/commonjs/chatbot/PromptInput.js +352 -0
- package/lib/commonjs/chatbot/PromptInput.js.map +1 -0
- package/lib/commonjs/chatbot/Reasoning.js +184 -0
- package/lib/commonjs/chatbot/Reasoning.js.map +1 -0
- package/lib/commonjs/chatbot/Shimmer.js +116 -0
- package/lib/commonjs/chatbot/Shimmer.js.map +1 -0
- package/lib/commonjs/chatbot/Sources.js +212 -0
- package/lib/commonjs/chatbot/Sources.js.map +1 -0
- package/lib/commonjs/chatbot/Suggestion.js +99 -0
- package/lib/commonjs/chatbot/Suggestion.js.map +1 -0
- package/lib/commonjs/chatbot/Tool.js +307 -0
- package/lib/commonjs/chatbot/Tool.js.map +1 -0
- package/lib/commonjs/chatbot/adapters/uiMessageAdapter.js +141 -0
- package/lib/commonjs/chatbot/adapters/uiMessageAdapter.js.map +1 -0
- package/lib/commonjs/chatbot/index.js +140 -0
- package/lib/commonjs/chatbot/index.js.map +1 -0
- package/lib/commonjs/chatbot/types.js +6 -0
- package/lib/commonjs/chatbot/types.js.map +1 -0
- package/lib/commonjs/hooks/index.js +34 -0
- package/lib/commonjs/hooks/index.js.map +1 -0
- package/lib/commonjs/hooks/useAutoScroll.js +39 -0
- package/lib/commonjs/hooks/useAutoScroll.js.map +1 -0
- package/lib/commonjs/hooks/useClipboard.js +44 -0
- package/lib/commonjs/hooks/useClipboard.js.map +1 -0
- package/lib/commonjs/hooks/useCollapsible.js +35 -0
- package/lib/commonjs/hooks/useCollapsible.js.map +1 -0
- package/lib/commonjs/hooks/useStickToBottom.js +68 -0
- package/lib/commonjs/hooks/useStickToBottom.js.map +1 -0
- package/lib/commonjs/index.js +257 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/commonjs/package.json +1 -0
- package/lib/commonjs/primitives/Badge.js +119 -0
- package/lib/commonjs/primitives/Badge.js.map +1 -0
- package/lib/commonjs/primitives/Button.js +185 -0
- package/lib/commonjs/primitives/Button.js.map +1 -0
- package/lib/commonjs/primitives/Card.js +166 -0
- package/lib/commonjs/primitives/Card.js.map +1 -0
- package/lib/commonjs/primitives/Collapsible.js +137 -0
- package/lib/commonjs/primitives/Collapsible.js.map +1 -0
- package/lib/commonjs/primitives/ScrollArea.js +40 -0
- package/lib/commonjs/primitives/ScrollArea.js.map +1 -0
- package/lib/commonjs/primitives/index.js +83 -0
- package/lib/commonjs/primitives/index.js.map +1 -0
- package/lib/commonjs/streaming/StreamingMarkdown.js +252 -0
- package/lib/commonjs/streaming/StreamingMarkdown.js.map +1 -0
- package/lib/commonjs/streaming/index.js +13 -0
- package/lib/commonjs/streaming/index.js.map +1 -0
- package/lib/commonjs/streaming/parser.js +482 -0
- package/lib/commonjs/streaming/parser.js.map +1 -0
- package/lib/commonjs/streaming/renderers/BlockquoteRenderer.js +35 -0
- package/lib/commonjs/streaming/renderers/BlockquoteRenderer.js.map +1 -0
- package/lib/commonjs/streaming/renderers/CodeRenderer.js +128 -0
- package/lib/commonjs/streaming/renderers/CodeRenderer.js.map +1 -0
- package/lib/commonjs/streaming/renderers/HeadingRenderer.js +61 -0
- package/lib/commonjs/streaming/renderers/HeadingRenderer.js.map +1 -0
- package/lib/commonjs/streaming/renderers/ImageRenderer.js +53 -0
- package/lib/commonjs/streaming/renderers/ImageRenderer.js.map +1 -0
- package/lib/commonjs/streaming/renderers/LinkRenderer.js +49 -0
- package/lib/commonjs/streaming/renderers/LinkRenderer.js.map +1 -0
- package/lib/commonjs/streaming/renderers/ListRenderer.js +63 -0
- package/lib/commonjs/streaming/renderers/ListRenderer.js.map +1 -0
- package/lib/commonjs/streaming/renderers/TableRenderer.js +77 -0
- package/lib/commonjs/streaming/renderers/TableRenderer.js.map +1 -0
- package/lib/commonjs/streaming/renderers/TextRenderer.js +41 -0
- package/lib/commonjs/streaming/renderers/TextRenderer.js.map +1 -0
- package/lib/commonjs/streaming/renderers/index.js +76 -0
- package/lib/commonjs/streaming/renderers/index.js.map +1 -0
- package/lib/commonjs/streaming/renderers/renderInlineChildren.js +112 -0
- package/lib/commonjs/streaming/renderers/renderInlineChildren.js.map +1 -0
- package/lib/commonjs/streaming/renderers/renderNode.js +81 -0
- package/lib/commonjs/streaming/renderers/renderNode.js.map +1 -0
- package/lib/commonjs/theme/ThemeProvider.js +68 -0
- package/lib/commonjs/theme/ThemeProvider.js.map +1 -0
- package/lib/commonjs/theme/defaultTheme.js +96 -0
- package/lib/commonjs/theme/defaultTheme.js.map +1 -0
- package/lib/commonjs/theme/index.js +32 -0
- package/lib/commonjs/theme/index.js.map +1 -0
- package/lib/commonjs/theme/tokens.js +2 -0
- package/lib/commonjs/theme/tokens.js.map +1 -0
- package/lib/commonjs/types.d.js +2 -0
- package/lib/commonjs/types.d.js.map +1 -0
- package/lib/commonjs/voice/index.js +13 -0
- package/lib/commonjs/voice/index.js.map +1 -0
- package/lib/commonjs/voice/useSpeechRecognition.js +172 -0
- package/lib/commonjs/voice/useSpeechRecognition.js.map +1 -0
- package/lib/module/chatbot/AIImage.js +121 -0
- package/lib/module/chatbot/AIImage.js.map +1 -0
- package/lib/module/chatbot/Attachments.js +312 -0
- package/lib/module/chatbot/Attachments.js.map +1 -0
- package/lib/module/chatbot/ChatErrorBoundary.js +196 -0
- package/lib/module/chatbot/ChatErrorBoundary.js.map +1 -0
- package/lib/module/chatbot/ChatMessageItem.js +164 -0
- package/lib/module/chatbot/ChatMessageItem.js.map +1 -0
- package/lib/module/chatbot/Conversation.js +412 -0
- package/lib/module/chatbot/Conversation.js.map +1 -0
- package/lib/module/chatbot/ConversationScrollButton.js +126 -0
- package/lib/module/chatbot/ConversationScrollButton.js.map +1 -0
- package/lib/module/chatbot/Message.js +198 -0
- package/lib/module/chatbot/Message.js.map +1 -0
- package/lib/module/chatbot/PromptInput.js +347 -0
- package/lib/module/chatbot/PromptInput.js.map +1 -0
- package/lib/module/chatbot/Reasoning.js +179 -0
- package/lib/module/chatbot/Reasoning.js.map +1 -0
- package/lib/module/chatbot/Shimmer.js +111 -0
- package/lib/module/chatbot/Shimmer.js.map +1 -0
- package/lib/module/chatbot/Sources.js +207 -0
- package/lib/module/chatbot/Sources.js.map +1 -0
- package/lib/module/chatbot/Suggestion.js +94 -0
- package/lib/module/chatbot/Suggestion.js.map +1 -0
- package/lib/module/chatbot/Tool.js +303 -0
- package/lib/module/chatbot/Tool.js.map +1 -0
- package/lib/module/chatbot/adapters/uiMessageAdapter.js +137 -0
- package/lib/module/chatbot/adapters/uiMessageAdapter.js.map +1 -0
- package/lib/module/chatbot/index.js +39 -0
- package/lib/module/chatbot/index.js.map +1 -0
- package/lib/module/chatbot/types.js +4 -0
- package/lib/module/chatbot/types.js.map +1 -0
- package/lib/module/hooks/index.js +7 -0
- package/lib/module/hooks/index.js.map +1 -0
- package/lib/module/hooks/useAutoScroll.js +35 -0
- package/lib/module/hooks/useAutoScroll.js.map +1 -0
- package/lib/module/hooks/useClipboard.js +40 -0
- package/lib/module/hooks/useClipboard.js.map +1 -0
- package/lib/module/hooks/useCollapsible.js +31 -0
- package/lib/module/hooks/useCollapsible.js.map +1 -0
- package/lib/module/hooks/useStickToBottom.js +64 -0
- package/lib/module/hooks/useStickToBottom.js.map +1 -0
- package/lib/module/index.js +19 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/package.json +1 -0
- package/lib/module/primitives/Badge.js +114 -0
- package/lib/module/primitives/Badge.js.map +1 -0
- package/lib/module/primitives/Button.js +180 -0
- package/lib/module/primitives/Button.js.map +1 -0
- package/lib/module/primitives/Card.js +156 -0
- package/lib/module/primitives/Card.js.map +1 -0
- package/lib/module/primitives/Collapsible.js +130 -0
- package/lib/module/primitives/Collapsible.js.map +1 -0
- package/lib/module/primitives/ScrollArea.js +35 -0
- package/lib/module/primitives/ScrollArea.js.map +1 -0
- package/lib/module/primitives/index.js +8 -0
- package/lib/module/primitives/index.js.map +1 -0
- package/lib/module/streaming/StreamingMarkdown.js +246 -0
- package/lib/module/streaming/StreamingMarkdown.js.map +1 -0
- package/lib/module/streaming/index.js +4 -0
- package/lib/module/streaming/index.js.map +1 -0
- package/lib/module/streaming/parser.js +477 -0
- package/lib/module/streaming/parser.js.map +1 -0
- package/lib/module/streaming/renderers/BlockquoteRenderer.js +30 -0
- package/lib/module/streaming/renderers/BlockquoteRenderer.js.map +1 -0
- package/lib/module/streaming/renderers/CodeRenderer.js +123 -0
- package/lib/module/streaming/renderers/CodeRenderer.js.map +1 -0
- package/lib/module/streaming/renderers/HeadingRenderer.js +56 -0
- package/lib/module/streaming/renderers/HeadingRenderer.js.map +1 -0
- package/lib/module/streaming/renderers/ImageRenderer.js +48 -0
- package/lib/module/streaming/renderers/ImageRenderer.js.map +1 -0
- package/lib/module/streaming/renderers/LinkRenderer.js +44 -0
- package/lib/module/streaming/renderers/LinkRenderer.js.map +1 -0
- package/lib/module/streaming/renderers/ListRenderer.js +58 -0
- package/lib/module/streaming/renderers/ListRenderer.js.map +1 -0
- package/lib/module/streaming/renderers/TableRenderer.js +72 -0
- package/lib/module/streaming/renderers/TableRenderer.js.map +1 -0
- package/lib/module/streaming/renderers/TextRenderer.js +36 -0
- package/lib/module/streaming/renderers/TextRenderer.js.map +1 -0
- package/lib/module/streaming/renderers/index.js +13 -0
- package/lib/module/streaming/renderers/index.js.map +1 -0
- package/lib/module/streaming/renderers/renderInlineChildren.js +107 -0
- package/lib/module/streaming/renderers/renderInlineChildren.js.map +1 -0
- package/lib/module/streaming/renderers/renderNode.js +78 -0
- package/lib/module/streaming/renderers/renderNode.js.map +1 -0
- package/lib/module/theme/ThemeProvider.js +62 -0
- package/lib/module/theme/ThemeProvider.js.map +1 -0
- package/lib/module/theme/defaultTheme.js +92 -0
- package/lib/module/theme/defaultTheme.js.map +1 -0
- package/lib/module/theme/index.js +5 -0
- package/lib/module/theme/index.js.map +1 -0
- package/lib/module/theme/tokens.js +2 -0
- package/lib/module/theme/tokens.js.map +1 -0
- package/lib/module/types.d.js +2 -0
- package/lib/module/types.d.js.map +1 -0
- package/lib/module/voice/index.js +14 -0
- package/lib/module/voice/index.js.map +1 -0
- package/lib/module/voice/useSpeechRecognition.js +169 -0
- package/lib/module/voice/useSpeechRecognition.js.map +1 -0
- package/lib/typescript/src/chatbot/AIImage.d.ts +24 -0
- package/lib/typescript/src/chatbot/AIImage.d.ts.map +1 -0
- package/lib/typescript/src/chatbot/Attachments.d.ts +20 -0
- package/lib/typescript/src/chatbot/Attachments.d.ts.map +1 -0
- package/lib/typescript/src/chatbot/ChatErrorBoundary.d.ts +57 -0
- package/lib/typescript/src/chatbot/ChatErrorBoundary.d.ts.map +1 -0
- package/lib/typescript/src/chatbot/ChatMessageItem.d.ts +45 -0
- package/lib/typescript/src/chatbot/ChatMessageItem.d.ts.map +1 -0
- package/lib/typescript/src/chatbot/Conversation.d.ts +94 -0
- package/lib/typescript/src/chatbot/Conversation.d.ts.map +1 -0
- package/lib/typescript/src/chatbot/ConversationScrollButton.d.ts +62 -0
- package/lib/typescript/src/chatbot/ConversationScrollButton.d.ts.map +1 -0
- package/lib/typescript/src/chatbot/Message.d.ts +39 -0
- package/lib/typescript/src/chatbot/Message.d.ts.map +1 -0
- package/lib/typescript/src/chatbot/PromptInput.d.ts +93 -0
- package/lib/typescript/src/chatbot/PromptInput.d.ts.map +1 -0
- package/lib/typescript/src/chatbot/Reasoning.d.ts +14 -0
- package/lib/typescript/src/chatbot/Reasoning.d.ts.map +1 -0
- package/lib/typescript/src/chatbot/Shimmer.d.ts +13 -0
- package/lib/typescript/src/chatbot/Shimmer.d.ts.map +1 -0
- package/lib/typescript/src/chatbot/Sources.d.ts +17 -0
- package/lib/typescript/src/chatbot/Sources.d.ts.map +1 -0
- package/lib/typescript/src/chatbot/Suggestion.d.ts +15 -0
- package/lib/typescript/src/chatbot/Suggestion.d.ts.map +1 -0
- package/lib/typescript/src/chatbot/Tool.d.ts +30 -0
- package/lib/typescript/src/chatbot/Tool.d.ts.map +1 -0
- package/lib/typescript/src/chatbot/adapters/uiMessageAdapter.d.ts +24 -0
- package/lib/typescript/src/chatbot/adapters/uiMessageAdapter.d.ts.map +1 -0
- package/lib/typescript/src/chatbot/index.d.ts +29 -0
- package/lib/typescript/src/chatbot/index.d.ts.map +1 -0
- package/lib/typescript/src/chatbot/types.d.ts +49 -0
- package/lib/typescript/src/chatbot/types.d.ts.map +1 -0
- package/lib/typescript/src/hooks/index.d.ts +9 -0
- package/lib/typescript/src/hooks/index.d.ts.map +1 -0
- package/lib/typescript/src/hooks/useAutoScroll.d.ts +23 -0
- package/lib/typescript/src/hooks/useAutoScroll.d.ts.map +1 -0
- package/lib/typescript/src/hooks/useClipboard.d.ts +22 -0
- package/lib/typescript/src/hooks/useClipboard.d.ts.map +1 -0
- package/lib/typescript/src/hooks/useCollapsible.d.ts +28 -0
- package/lib/typescript/src/hooks/useCollapsible.d.ts.map +1 -0
- package/lib/typescript/src/hooks/useStickToBottom.d.ts +39 -0
- package/lib/typescript/src/hooks/useStickToBottom.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +11 -0
- package/lib/typescript/src/index.d.ts.map +1 -0
- package/lib/typescript/src/primitives/Badge.d.ts +10 -0
- package/lib/typescript/src/primitives/Badge.d.ts.map +1 -0
- package/lib/typescript/src/primitives/Button.d.ts +16 -0
- package/lib/typescript/src/primitives/Button.d.ts.map +1 -0
- package/lib/typescript/src/primitives/Card.d.ts +33 -0
- package/lib/typescript/src/primitives/Card.d.ts.map +1 -0
- package/lib/typescript/src/primitives/Collapsible.d.ts +20 -0
- package/lib/typescript/src/primitives/Collapsible.d.ts.map +1 -0
- package/lib/typescript/src/primitives/ScrollArea.d.ts +10 -0
- package/lib/typescript/src/primitives/ScrollArea.d.ts.map +1 -0
- package/lib/typescript/src/primitives/index.d.ts +11 -0
- package/lib/typescript/src/primitives/index.d.ts.map +1 -0
- package/lib/typescript/src/streaming/StreamingMarkdown.d.ts +47 -0
- package/lib/typescript/src/streaming/StreamingMarkdown.d.ts.map +1 -0
- package/lib/typescript/src/streaming/index.d.ts +3 -0
- package/lib/typescript/src/streaming/index.d.ts.map +1 -0
- package/lib/typescript/src/streaming/parser.d.ts +41 -0
- package/lib/typescript/src/streaming/parser.d.ts.map +1 -0
- package/lib/typescript/src/streaming/renderers/BlockquoteRenderer.d.ts +7 -0
- package/lib/typescript/src/streaming/renderers/BlockquoteRenderer.d.ts.map +1 -0
- package/lib/typescript/src/streaming/renderers/CodeRenderer.d.ts +7 -0
- package/lib/typescript/src/streaming/renderers/CodeRenderer.d.ts.map +1 -0
- package/lib/typescript/src/streaming/renderers/HeadingRenderer.d.ts +7 -0
- package/lib/typescript/src/streaming/renderers/HeadingRenderer.d.ts.map +1 -0
- package/lib/typescript/src/streaming/renderers/ImageRenderer.d.ts +7 -0
- package/lib/typescript/src/streaming/renderers/ImageRenderer.d.ts.map +1 -0
- package/lib/typescript/src/streaming/renderers/LinkRenderer.d.ts +7 -0
- package/lib/typescript/src/streaming/renderers/LinkRenderer.d.ts.map +1 -0
- package/lib/typescript/src/streaming/renderers/ListRenderer.d.ts +7 -0
- package/lib/typescript/src/streaming/renderers/ListRenderer.d.ts.map +1 -0
- package/lib/typescript/src/streaming/renderers/TableRenderer.d.ts +7 -0
- package/lib/typescript/src/streaming/renderers/TableRenderer.d.ts.map +1 -0
- package/lib/typescript/src/streaming/renderers/TextRenderer.d.ts +7 -0
- package/lib/typescript/src/streaming/renderers/TextRenderer.d.ts.map +1 -0
- package/lib/typescript/src/streaming/renderers/index.d.ts +19 -0
- package/lib/typescript/src/streaming/renderers/index.d.ts.map +1 -0
- package/lib/typescript/src/streaming/renderers/renderInlineChildren.d.ts +12 -0
- package/lib/typescript/src/streaming/renderers/renderInlineChildren.d.ts.map +1 -0
- package/lib/typescript/src/streaming/renderers/renderNode.d.ts +8 -0
- package/lib/typescript/src/streaming/renderers/renderNode.d.ts.map +1 -0
- package/lib/typescript/src/theme/ThemeProvider.d.ts +14 -0
- package/lib/typescript/src/theme/ThemeProvider.d.ts.map +1 -0
- package/lib/typescript/src/theme/defaultTheme.d.ts +4 -0
- package/lib/typescript/src/theme/defaultTheme.d.ts.map +1 -0
- package/lib/typescript/src/theme/index.d.ts +5 -0
- package/lib/typescript/src/theme/index.d.ts.map +1 -0
- package/lib/typescript/src/theme/tokens.d.ts +66 -0
- package/lib/typescript/src/theme/tokens.d.ts.map +1 -0
- package/lib/typescript/src/voice/index.d.ts +3 -0
- package/lib/typescript/src/voice/index.d.ts.map +1 -0
- package/lib/typescript/src/voice/useSpeechRecognition.d.ts +77 -0
- package/lib/typescript/src/voice/useSpeechRecognition.d.ts.map +1 -0
- package/package.json +132 -0
- package/src/chatbot/AIImage.tsx +166 -0
- package/src/chatbot/Attachments.tsx +382 -0
- package/src/chatbot/ChatErrorBoundary.tsx +230 -0
- package/src/chatbot/ChatMessageItem.tsx +195 -0
- package/src/chatbot/Conversation.tsx +537 -0
- package/src/chatbot/ConversationScrollButton.tsx +149 -0
- package/src/chatbot/Message.tsx +266 -0
- package/src/chatbot/PromptInput.tsx +532 -0
- package/src/chatbot/Reasoning.tsx +198 -0
- package/src/chatbot/Shimmer.tsx +146 -0
- package/src/chatbot/Sources.tsx +263 -0
- package/src/chatbot/Suggestion.tsx +123 -0
- package/src/chatbot/Tool.tsx +340 -0
- package/src/chatbot/adapters/uiMessageAdapter.ts +177 -0
- package/src/chatbot/index.ts +97 -0
- package/src/chatbot/types.ts +66 -0
- package/src/hooks/index.ts +17 -0
- package/src/hooks/useAutoScroll.ts +43 -0
- package/src/hooks/useClipboard.ts +46 -0
- package/src/hooks/useCollapsible.ts +42 -0
- package/src/hooks/useStickToBottom.ts +82 -0
- package/src/index.ts +139 -0
- package/src/primitives/Badge.tsx +119 -0
- package/src/primitives/Button.tsx +213 -0
- package/src/primitives/Card.tsx +221 -0
- package/src/primitives/Collapsible.tsx +168 -0
- package/src/primitives/ScrollArea.tsx +53 -0
- package/src/primitives/index.ts +36 -0
- package/src/streaming/StreamingMarkdown.tsx +282 -0
- package/src/streaming/index.ts +2 -0
- package/src/streaming/parser.ts +506 -0
- package/src/streaming/renderers/BlockquoteRenderer.tsx +42 -0
- package/src/streaming/renderers/CodeRenderer.tsx +158 -0
- package/src/streaming/renderers/HeadingRenderer.tsx +64 -0
- package/src/streaming/renderers/ImageRenderer.tsx +62 -0
- package/src/streaming/renderers/LinkRenderer.tsx +53 -0
- package/src/streaming/renderers/ListRenderer.tsx +65 -0
- package/src/streaming/renderers/TableRenderer.tsx +103 -0
- package/src/streaming/renderers/TextRenderer.tsx +39 -0
- package/src/streaming/renderers/index.ts +26 -0
- package/src/streaming/renderers/renderInlineChildren.tsx +115 -0
- package/src/streaming/renderers/renderNode.tsx +72 -0
- package/src/theme/ThemeProvider.tsx +77 -0
- package/src/theme/defaultTheme.ts +93 -0
- package/src/theme/index.ts +4 -0
- package/src/theme/tokens.ts +69 -0
- package/src/types.d.ts +71 -0
- package/src/voice/index.ts +15 -0
- package/src/voice/useSpeechRecognition.ts +230 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Card.d.ts","sourceRoot":"","sources":["../../../../src/primitives/Card.tsx"],"names":[],"mappings":"AAAA,OAAc,EAA6B,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AACzE,OAAO,EAKL,KAAK,SAAS,EACd,KAAK,SAAS,EACd,KAAK,SAAS,EACf,MAAM,cAAc,CAAC;AAsBtB,MAAM,WAAW,SAAS;IACxB,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B;AAED,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B;AAED,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B;AAED,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B;AAED,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B;AAED,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B;AAMD,wBAAgB,IAAI,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE,SAAS,2CAmClD;AAED,wBAAgB,UAAU,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE,eAAe,2CAc9D;AAED,wBAAgB,SAAS,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE,cAAc,2CAoB5D;AAED,wBAAgB,eAAe,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE,oBAAoB,2CAoBxE;AAED,wBAAgB,WAAW,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE,gBAAgB,2CAiBhE;AAED,wBAAgB,UAAU,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE,eAAe,2CAkB9D"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import { type StyleProp, type ViewStyle } from 'react-native';
|
|
3
|
+
export interface CollapsibleProps {
|
|
4
|
+
open?: boolean;
|
|
5
|
+
onOpenChange?: (open: boolean) => void;
|
|
6
|
+
children?: ReactNode;
|
|
7
|
+
style?: StyleProp<ViewStyle>;
|
|
8
|
+
}
|
|
9
|
+
export interface CollapsibleTriggerProps {
|
|
10
|
+
children?: ReactNode;
|
|
11
|
+
style?: StyleProp<ViewStyle>;
|
|
12
|
+
}
|
|
13
|
+
export interface CollapsibleContentProps {
|
|
14
|
+
children?: ReactNode;
|
|
15
|
+
style?: StyleProp<ViewStyle>;
|
|
16
|
+
}
|
|
17
|
+
export declare function Collapsible({ open: controlledOpen, onOpenChange, children, style, }: CollapsibleProps): import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
export declare function CollapsibleTrigger({ children, style, }: CollapsibleTriggerProps): import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
export declare function CollapsibleContent({ children, style, }: CollapsibleContentProps): import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
//# sourceMappingURL=Collapsible.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Collapsible.d.ts","sourceRoot":"","sources":["../../../../src/primitives/Collapsible.tsx"],"names":[],"mappings":"AAAA,OAAc,EAKZ,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AACf,OAAO,EAAyB,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAiCrF,MAAM,WAAW,gBAAgB;IAC/B,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IACvC,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B;AAED,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B;AAED,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B;AAMD,wBAAgB,WAAW,CAAC,EAC1B,IAAI,EAAE,cAAc,EACpB,YAAY,EACZ,QAAQ,EACR,KAAK,GACN,EAAE,gBAAgB,2CAmBlB;AAMD,wBAAgB,kBAAkB,CAAC,EACjC,QAAQ,EACR,KAAK,GACN,EAAE,uBAAuB,2CAWzB;AAMD,wBAAgB,kBAAkB,CAAC,EACjC,QAAQ,EACR,KAAK,GACN,EAAE,uBAAuB,2CAkCzB"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import { type ScrollViewProps, type StyleProp, type ViewStyle } from 'react-native';
|
|
3
|
+
export interface ScrollAreaProps extends Omit<ScrollViewProps, 'style' | 'contentContainerStyle'> {
|
|
4
|
+
horizontal?: boolean;
|
|
5
|
+
style?: StyleProp<ViewStyle>;
|
|
6
|
+
contentContainerStyle?: StyleProp<ViewStyle>;
|
|
7
|
+
children?: ReactNode;
|
|
8
|
+
}
|
|
9
|
+
export declare function ScrollArea({ horizontal, style, contentContainerStyle, children, ...scrollViewProps }: ScrollAreaProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
//# sourceMappingURL=ScrollArea.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ScrollArea.d.ts","sourceRoot":"","sources":["../../../../src/primitives/ScrollArea.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAC9C,OAAO,EAGL,KAAK,eAAe,EACpB,KAAK,SAAS,EACd,KAAK,SAAS,EACf,MAAM,cAAc,CAAC;AAGtB,MAAM,WAAW,eACf,SAAQ,IAAI,CAAC,eAAe,EAAE,OAAO,GAAG,uBAAuB,CAAC;IAChE,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B,qBAAqB,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7C,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED,wBAAgB,UAAU,CAAC,EACzB,UAAkB,EAClB,KAAK,EACL,qBAAqB,EACrB,QAAQ,EACR,GAAG,eAAe,EACnB,EAAE,eAAe,2CAmBjB"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export { Button } from './Button';
|
|
2
|
+
export type { ButtonProps, ButtonVariant, ButtonSize } from './Button';
|
|
3
|
+
export { Badge } from './Badge';
|
|
4
|
+
export type { BadgeProps, BadgeVariant } from './Badge';
|
|
5
|
+
export { Card, CardHeader, CardTitle, CardDescription, CardContent, CardFooter, } from './Card';
|
|
6
|
+
export type { CardProps, CardHeaderProps, CardTitleProps, CardDescriptionProps, CardContentProps, CardFooterProps, } from './Card';
|
|
7
|
+
export { Collapsible, CollapsibleTrigger, CollapsibleContent, } from './Collapsible';
|
|
8
|
+
export type { CollapsibleProps, CollapsibleTriggerProps, CollapsibleContentProps, } from './Collapsible';
|
|
9
|
+
export { ScrollArea } from './ScrollArea';
|
|
10
|
+
export type { ScrollAreaProps } from './ScrollArea';
|
|
11
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/primitives/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,YAAY,EAAE,WAAW,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAEvE,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,YAAY,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAExD,OAAO,EACL,IAAI,EACJ,UAAU,EACV,SAAS,EACT,eAAe,EACf,WAAW,EACX,UAAU,GACX,MAAM,QAAQ,CAAC;AAChB,YAAY,EACV,SAAS,EACT,eAAe,EACf,cAAc,EACd,oBAAoB,EACpB,gBAAgB,EAChB,eAAe,GAChB,MAAM,QAAQ,CAAC;AAEhB,OAAO,EACL,WAAW,EACX,kBAAkB,EAClB,kBAAkB,GACnB,MAAM,eAAe,CAAC;AACvB,YAAY,EACV,gBAAgB,EAChB,uBAAuB,EACvB,uBAAuB,GACxB,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,YAAY,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { type StyleProp, type ViewStyle } from 'react-native';
|
|
2
|
+
export interface StreamingMarkdownProps {
|
|
3
|
+
/** The markdown string (may be partial while streaming). */
|
|
4
|
+
content: string;
|
|
5
|
+
/** Hint that content is still being appended. Default false. */
|
|
6
|
+
isStreaming?: boolean;
|
|
7
|
+
/**
|
|
8
|
+
* @deprecated No longer applied. The component now matches Vercel
|
|
9
|
+
* ai-elements' `MessageResponse` and performs no custom fade
|
|
10
|
+
* animation — content simply re-renders as it grows. Kept in the
|
|
11
|
+
* props for backwards compatibility so existing call sites don't
|
|
12
|
+
* break; safe to remove.
|
|
13
|
+
*/
|
|
14
|
+
fadeDuration?: number;
|
|
15
|
+
/** Optional container style override. */
|
|
16
|
+
style?: StyleProp<ViewStyle>;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* StreamingMarkdown — renders markdown content using react-native-markdown-display.
|
|
20
|
+
*
|
|
21
|
+
* Deliberately matches the simplicity of Vercel ai-elements'
|
|
22
|
+
* `MessageResponse` (a memoized wrapper around `Streamdown`): no custom
|
|
23
|
+
* fade animations, no block-level entrance effects, no opacity tricks,
|
|
24
|
+
* **no additional throttling**. Content re-renders as it grows and the
|
|
25
|
+
* visual "streaming" feel comes from the tokens arriving incrementally
|
|
26
|
+
* from the network.
|
|
27
|
+
*
|
|
28
|
+
* **Why no RAF throttling?** We used to throttle updates to ~60fps via
|
|
29
|
+
* `requestAnimationFrame` inside this component. That sounds good on
|
|
30
|
+
* paper but stacks badly with `useChat`'s own `experimental_throttle`:
|
|
31
|
+
* the two timers drift out of phase, and you end up seeing "first word,
|
|
32
|
+
* then the rest of the text all at once" on subsequent messages. Vercel
|
|
33
|
+
* ai-elements trusts `useChat` entirely and does the same — see
|
|
34
|
+
* `opensrc/.../vercel/ai-elements/packages/elements/src/message.tsx:326`.
|
|
35
|
+
* If you need to throttle the re-render rate, set
|
|
36
|
+
* `experimental_throttle: 25` (or whatever) on the `useChat` call. Don't
|
|
37
|
+
* layer a second throttler here.
|
|
38
|
+
*
|
|
39
|
+
* What IS preserved:
|
|
40
|
+
* - `stabilizePartialMarkdown` — closes unclosed code fences mid-stream
|
|
41
|
+
* so the parser doesn't swallow the rest of the message as code.
|
|
42
|
+
* Pure correctness, not visual.
|
|
43
|
+
* - `MemoMarkdown` — shallow-equal memoization so identical content
|
|
44
|
+
* doesn't re-parse. Matches `memo(MessageResponse)` in ai-elements.
|
|
45
|
+
*/
|
|
46
|
+
export declare function StreamingMarkdown({ content, isStreaming, style, }: StreamingMarkdownProps): import("react/jsx-runtime").JSX.Element | null;
|
|
47
|
+
//# sourceMappingURL=StreamingMarkdown.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StreamingMarkdown.d.ts","sourceRoot":"","sources":["../../../../src/streaming/StreamingMarkdown.tsx"],"names":[],"mappings":"AACA,OAAO,EAA6B,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAuBzF,MAAM,WAAW,sBAAsB;IACrC,4DAA4D;IAC5D,OAAO,EAAE,MAAM,CAAC;IAChB,gEAAgE;IAChE,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;;;;;OAMG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,yCAAyC;IACzC,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B;AAgLD;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,wBAAgB,iBAAiB,CAAC,EAChC,OAAO,EACP,WAAmB,EACnB,KAAK,GACN,EAAE,sBAAsB,kDA4BxB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/streaming/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,YAAY,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
export type MarkdownNodeType = 'paragraph' | 'heading' | 'text' | 'bold' | 'italic' | 'bold_italic' | 'code_inline' | 'code_block' | 'link' | 'image' | 'list' | 'list_item' | 'blockquote' | 'horizontal_rule' | 'table' | 'table_row' | 'table_cell';
|
|
2
|
+
export interface MarkdownNode {
|
|
3
|
+
type: MarkdownNodeType;
|
|
4
|
+
content?: string;
|
|
5
|
+
children?: MarkdownNode[];
|
|
6
|
+
/** Heading level 1-6 */
|
|
7
|
+
level?: number;
|
|
8
|
+
/** Code block language hint */
|
|
9
|
+
language?: string;
|
|
10
|
+
/** Link / image URL */
|
|
11
|
+
url?: string;
|
|
12
|
+
/** Image alt text */
|
|
13
|
+
alt?: string;
|
|
14
|
+
/** Whether a list is ordered */
|
|
15
|
+
ordered?: boolean;
|
|
16
|
+
/** Whether a table cell is a header cell */
|
|
17
|
+
header?: boolean;
|
|
18
|
+
}
|
|
19
|
+
export interface ParseResult {
|
|
20
|
+
/** Fully-parsed AST nodes */
|
|
21
|
+
nodes: MarkdownNode[];
|
|
22
|
+
/** true when trailing content looks like an unclosed block */
|
|
23
|
+
isStreaming: boolean;
|
|
24
|
+
/** Index up to which the text has been safely consumed */
|
|
25
|
+
lastSafeIndex: number;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Parse a complete markdown string into an AST.
|
|
29
|
+
* Suitable for non-streaming use cases.
|
|
30
|
+
*/
|
|
31
|
+
export declare function parseMarkdown(text: string): MarkdownNode[];
|
|
32
|
+
/**
|
|
33
|
+
* Incremental streaming-aware parse.
|
|
34
|
+
*
|
|
35
|
+
* When `previousResult` is supplied the parser can skip re-parsing blocks
|
|
36
|
+
* that haven't changed (those before `previousResult.lastSafeIndex`).
|
|
37
|
+
* In practice, for simplicity in v1, we re-parse the full text but still
|
|
38
|
+
* return `isStreaming` and `lastSafeIndex` so the renderer can optimise.
|
|
39
|
+
*/
|
|
40
|
+
export declare function parseMarkdownIncremental(text: string, _previousResult?: ParseResult): ParseResult;
|
|
41
|
+
//# sourceMappingURL=parser.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parser.d.ts","sourceRoot":"","sources":["../../../../src/streaming/parser.ts"],"names":[],"mappings":"AAKA,MAAM,MAAM,gBAAgB,GACxB,WAAW,GACX,SAAS,GACT,MAAM,GACN,MAAM,GACN,QAAQ,GACR,aAAa,GACb,aAAa,GACb,YAAY,GACZ,MAAM,GACN,OAAO,GACP,MAAM,GACN,WAAW,GACX,YAAY,GACZ,iBAAiB,GACjB,OAAO,GACP,WAAW,GACX,YAAY,CAAC;AAEjB,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,gBAAgB,CAAC;IACvB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,YAAY,EAAE,CAAC;IAC1B,wBAAwB;IACxB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,+BAA+B;IAC/B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,uBAAuB;IACvB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,qBAAqB;IACrB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,gCAAgC;IAChC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,4CAA4C;IAC5C,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,WAAW,WAAW;IAC1B,6BAA6B;IAC7B,KAAK,EAAE,YAAY,EAAE,CAAC;IACtB,8DAA8D;IAC9D,WAAW,EAAE,OAAO,CAAC;IACrB,0DAA0D;IAC1D,aAAa,EAAE,MAAM,CAAC;CACvB;AA8aD;;;GAGG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,YAAY,EAAE,CAG1D;AAED;;;;;;;GAOG;AACH,wBAAgB,wBAAwB,CACtC,IAAI,EAAE,MAAM,EACZ,eAAe,CAAC,EAAE,WAAW,GAC5B,WAAW,CAMb"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { MarkdownNode } from '../parser';
|
|
3
|
+
export interface BlockquoteRendererProps {
|
|
4
|
+
node: MarkdownNode;
|
|
5
|
+
}
|
|
6
|
+
export declare const BlockquoteRenderer: React.NamedExoticComponent<BlockquoteRendererProps>;
|
|
7
|
+
//# sourceMappingURL=BlockquoteRenderer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BlockquoteRenderer.d.ts","sourceRoot":"","sources":["../../../../../src/streaming/renderers/BlockquoteRenderer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAG9C,MAAM,WAAW,uBAAuB;IACtC,IAAI,EAAE,YAAY,CAAC;CACpB;AAED,eAAO,MAAM,kBAAkB,qDAqB7B,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { MarkdownNode } from '../parser';
|
|
3
|
+
export interface CodeRendererProps {
|
|
4
|
+
node: MarkdownNode;
|
|
5
|
+
}
|
|
6
|
+
export declare const CodeRenderer: React.NamedExoticComponent<CodeRendererProps>;
|
|
7
|
+
//# sourceMappingURL=CodeRenderer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CodeRenderer.d.ts","sourceRoot":"","sources":["../../../../../src/streaming/renderers/CodeRenderer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsB,MAAM,OAAO,CAAC;AAW3C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAE9C,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,YAAY,CAAC;CACpB;AAED,eAAO,MAAM,YAAY,+CA4GvB,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { MarkdownNode } from '../parser';
|
|
3
|
+
export interface HeadingRendererProps {
|
|
4
|
+
node: MarkdownNode;
|
|
5
|
+
}
|
|
6
|
+
export declare const HeadingRenderer: React.NamedExoticComponent<HeadingRendererProps>;
|
|
7
|
+
//# sourceMappingURL=HeadingRenderer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HeadingRenderer.d.ts","sourceRoot":"","sources":["../../../../../src/streaming/renderers/HeadingRenderer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAG9C,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,YAAY,CAAC;CACpB;AAqCD,eAAO,MAAM,eAAe,kDAW1B,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { MarkdownNode } from '../parser';
|
|
3
|
+
export interface ImageRendererProps {
|
|
4
|
+
node: MarkdownNode;
|
|
5
|
+
}
|
|
6
|
+
export declare const ImageRenderer: React.NamedExoticComponent<ImageRendererProps>;
|
|
7
|
+
//# sourceMappingURL=ImageRenderer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ImageRenderer.d.ts","sourceRoot":"","sources":["../../../../../src/streaming/renderers/ImageRenderer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAE9C,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,YAAY,CAAC;CACpB;AAED,eAAO,MAAM,aAAa,gDAqCxB,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { MarkdownNode } from '../parser';
|
|
3
|
+
export interface LinkRendererProps {
|
|
4
|
+
node: MarkdownNode;
|
|
5
|
+
}
|
|
6
|
+
export declare const LinkRenderer: React.NamedExoticComponent<LinkRendererProps>;
|
|
7
|
+
//# sourceMappingURL=LinkRenderer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LinkRenderer.d.ts","sourceRoot":"","sources":["../../../../../src/streaming/renderers/LinkRenderer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsB,MAAM,OAAO,CAAC;AAG3C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAG9C,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,YAAY,CAAC;CACpB;AAED,eAAO,MAAM,YAAY,+CAiCvB,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { MarkdownNode } from '../parser';
|
|
3
|
+
export interface ListRendererProps {
|
|
4
|
+
node: MarkdownNode;
|
|
5
|
+
}
|
|
6
|
+
export declare const ListRenderer: React.NamedExoticComponent<ListRendererProps>;
|
|
7
|
+
//# sourceMappingURL=ListRenderer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ListRenderer.d.ts","sourceRoot":"","sources":["../../../../../src/streaming/renderers/ListRenderer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAG9C,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,YAAY,CAAC;CACpB;AAED,eAAO,MAAM,YAAY,+CAmCvB,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { MarkdownNode } from '../parser';
|
|
3
|
+
export interface TableRendererProps {
|
|
4
|
+
node: MarkdownNode;
|
|
5
|
+
}
|
|
6
|
+
export declare const TableRenderer: React.NamedExoticComponent<TableRendererProps>;
|
|
7
|
+
//# sourceMappingURL=TableRenderer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TableRenderer.d.ts","sourceRoot":"","sources":["../../../../../src/streaming/renderers/TableRenderer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAG9C,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,YAAY,CAAC;CACpB;AAED,eAAO,MAAM,aAAa,gDAqExB,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { MarkdownNode } from '../parser';
|
|
3
|
+
export interface TextRendererProps {
|
|
4
|
+
node: MarkdownNode;
|
|
5
|
+
}
|
|
6
|
+
export declare const TextRenderer: React.NamedExoticComponent<TextRendererProps>;
|
|
7
|
+
//# sourceMappingURL=TextRenderer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TextRenderer.d.ts","sourceRoot":"","sources":["../../../../../src/streaming/renderers/TextRenderer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAG9C,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,YAAY,CAAC;CACpB;AAED,eAAO,MAAM,YAAY,+CAsBvB,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export { TextRenderer } from './TextRenderer';
|
|
2
|
+
export type { TextRendererProps } from './TextRenderer';
|
|
3
|
+
export { HeadingRenderer } from './HeadingRenderer';
|
|
4
|
+
export type { HeadingRendererProps } from './HeadingRenderer';
|
|
5
|
+
export { CodeRenderer } from './CodeRenderer';
|
|
6
|
+
export type { CodeRendererProps } from './CodeRenderer';
|
|
7
|
+
export { ListRenderer } from './ListRenderer';
|
|
8
|
+
export type { ListRendererProps } from './ListRenderer';
|
|
9
|
+
export { LinkRenderer } from './LinkRenderer';
|
|
10
|
+
export type { LinkRendererProps } from './LinkRenderer';
|
|
11
|
+
export { ImageRenderer } from './ImageRenderer';
|
|
12
|
+
export type { ImageRendererProps } from './ImageRenderer';
|
|
13
|
+
export { BlockquoteRenderer } from './BlockquoteRenderer';
|
|
14
|
+
export type { BlockquoteRendererProps } from './BlockquoteRenderer';
|
|
15
|
+
export { TableRenderer } from './TableRenderer';
|
|
16
|
+
export type { TableRendererProps } from './TableRenderer';
|
|
17
|
+
export { renderNode } from './renderNode';
|
|
18
|
+
export { renderInlineChildren } from './renderInlineChildren';
|
|
19
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/streaming/renderers/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,YAAY,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAExD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,YAAY,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAE9D,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,YAAY,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAExD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,YAAY,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAExD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,YAAY,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAExD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,YAAY,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAE1D,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,YAAY,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAEpE,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,YAAY,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAE1D,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import type { AIElementsTheme } from '../../theme';
|
|
3
|
+
import type { MarkdownNode } from '../parser';
|
|
4
|
+
/**
|
|
5
|
+
* Recursively render inline markdown nodes (text, bold, italic, bold_italic,
|
|
6
|
+
* code_inline, link, image) as nested React Native <Text> elements.
|
|
7
|
+
*
|
|
8
|
+
* This is extracted as a shared helper so every block-level renderer can
|
|
9
|
+
* render its inline children consistently.
|
|
10
|
+
*/
|
|
11
|
+
export declare function renderInlineChildren(children: MarkdownNode[] | undefined, theme: AIElementsTheme): ReactNode;
|
|
12
|
+
//# sourceMappingURL=renderInlineChildren.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"renderInlineChildren.d.ts","sourceRoot":"","sources":["../../../../../src/streaming/renderers/renderInlineChildren.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAE9C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAE9C;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAClC,QAAQ,EAAE,YAAY,EAAE,GAAG,SAAS,EACpC,KAAK,EAAE,eAAe,GACrB,SAAS,CAmGX"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import type { MarkdownNode } from '../parser';
|
|
3
|
+
/**
|
|
4
|
+
* Map a single MarkdownNode to its corresponding React Native renderer.
|
|
5
|
+
* Used by both StreamingMarkdown and BlockquoteRenderer (for nested blocks).
|
|
6
|
+
*/
|
|
7
|
+
export declare function renderNode(node: MarkdownNode, key: string): ReactNode;
|
|
8
|
+
//# sourceMappingURL=renderNode.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"renderNode.d.ts","sourceRoot":"","sources":["../../../../../src/streaming/renderers/renderNode.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAG9C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AA8B9C;;;GAGG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,YAAY,EAAE,GAAG,EAAE,MAAM,GAAG,SAAS,CAkCrE"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type PropsWithChildren } from 'react';
|
|
2
|
+
import type { AIElementsTheme } from './tokens';
|
|
3
|
+
export type ColorSchemeMode = 'light' | 'dark' | 'system';
|
|
4
|
+
type DeepPartial<T> = {
|
|
5
|
+
[P in keyof T]?: T[P] extends object ? DeepPartial<T[P]> : T[P];
|
|
6
|
+
};
|
|
7
|
+
export interface AIElementsProviderProps {
|
|
8
|
+
theme?: DeepPartial<AIElementsTheme>;
|
|
9
|
+
mode?: ColorSchemeMode;
|
|
10
|
+
}
|
|
11
|
+
export declare function AIElementsProvider({ theme: themeOverrides, mode, children, }: PropsWithChildren<AIElementsProviderProps>): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export declare function useAIElementsTheme(): AIElementsTheme;
|
|
13
|
+
export {};
|
|
14
|
+
//# sourceMappingURL=ThemeProvider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ThemeProvider.d.ts","sourceRoot":"","sources":["../../../../src/theme/ThemeProvider.tsx"],"names":[],"mappings":"AAAA,OAAc,EAIZ,KAAK,iBAAiB,EACvB,MAAM,OAAO,CAAC;AAEf,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAKhD,MAAM,MAAM,eAAe,GAAG,OAAO,GAAG,MAAM,GAAG,QAAQ,CAAC;AAE1D,KAAK,WAAW,CAAC,CAAC,IAAI;KACnB,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS,MAAM,GAAG,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAChE,CAAC;AAEF,MAAM,WAAW,uBAAuB;IACtC,KAAK,CAAC,EAAE,WAAW,CAAC,eAAe,CAAC,CAAC;IACrC,IAAI,CAAC,EAAE,eAAe,CAAC;CACxB;AAgCD,wBAAgB,kBAAkB,CAAC,EACjC,KAAK,EAAE,cAAc,EACrB,IAAe,EACf,QAAQ,GACT,EAAE,iBAAiB,CAAC,uBAAuB,CAAC,2CAe5C;AAED,wBAAgB,kBAAkB,IAAI,eAAe,CAEpD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"defaultTheme.d.ts","sourceRoot":"","sources":["../../../../src/theme/defaultTheme.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AA0ChD,eAAO,MAAM,UAAU,EAAE,eAwBxB,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,eAwBvB,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { AIElementsProvider, useAIElementsTheme } from './ThemeProvider';
|
|
2
|
+
export type { AIElementsProviderProps, ColorSchemeMode } from './ThemeProvider';
|
|
3
|
+
export type { AIElementsTheme, ColorTokens, SpacingTokens, RadiusTokens, TypographyTokens } from './tokens';
|
|
4
|
+
export { lightTheme, darkTheme } from './defaultTheme';
|
|
5
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/theme/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AACzE,YAAY,EAAE,uBAAuB,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAChF,YAAY,EAAE,eAAe,EAAE,WAAW,EAAE,aAAa,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAC5G,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
export interface ColorTokens {
|
|
2
|
+
primary: string;
|
|
3
|
+
primaryForeground: string;
|
|
4
|
+
secondary: string;
|
|
5
|
+
secondaryForeground: string;
|
|
6
|
+
background: string;
|
|
7
|
+
foreground: string;
|
|
8
|
+
muted: string;
|
|
9
|
+
mutedForeground: string;
|
|
10
|
+
card: string;
|
|
11
|
+
cardForeground: string;
|
|
12
|
+
border: string;
|
|
13
|
+
destructive: string;
|
|
14
|
+
destructiveForeground: string;
|
|
15
|
+
success: string;
|
|
16
|
+
successForeground: string;
|
|
17
|
+
warning: string;
|
|
18
|
+
warningForeground: string;
|
|
19
|
+
accent: string;
|
|
20
|
+
accentForeground: string;
|
|
21
|
+
}
|
|
22
|
+
export interface SpacingTokens {
|
|
23
|
+
xs: number;
|
|
24
|
+
sm: number;
|
|
25
|
+
md: number;
|
|
26
|
+
lg: number;
|
|
27
|
+
xl: number;
|
|
28
|
+
'2xl': number;
|
|
29
|
+
}
|
|
30
|
+
export interface RadiusTokens {
|
|
31
|
+
sm: number;
|
|
32
|
+
md: number;
|
|
33
|
+
lg: number;
|
|
34
|
+
full: number;
|
|
35
|
+
}
|
|
36
|
+
export interface TypographyTokens {
|
|
37
|
+
fontFamily: string;
|
|
38
|
+
monoFontFamily: string;
|
|
39
|
+
fontSize: {
|
|
40
|
+
xs: number;
|
|
41
|
+
sm: number;
|
|
42
|
+
md: number;
|
|
43
|
+
lg: number;
|
|
44
|
+
xl: number;
|
|
45
|
+
'2xl': number;
|
|
46
|
+
};
|
|
47
|
+
lineHeight: {
|
|
48
|
+
tight: number;
|
|
49
|
+
normal: number;
|
|
50
|
+
relaxed: number;
|
|
51
|
+
};
|
|
52
|
+
fontWeight: {
|
|
53
|
+
normal: string;
|
|
54
|
+
medium: string;
|
|
55
|
+
semibold: string;
|
|
56
|
+
bold: string;
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
export interface AIElementsTheme {
|
|
60
|
+
colors: ColorTokens;
|
|
61
|
+
spacing: SpacingTokens;
|
|
62
|
+
radius: RadiusTokens;
|
|
63
|
+
typography: TypographyTokens;
|
|
64
|
+
dark: boolean;
|
|
65
|
+
}
|
|
66
|
+
//# sourceMappingURL=tokens.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tokens.d.ts","sourceRoot":"","sources":["../../../../src/theme/tokens.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,SAAS,EAAE,MAAM,CAAC;IAClB,mBAAmB,EAAE,MAAM,CAAC;IAC5B,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,eAAe,EAAE,MAAM,CAAC;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,cAAc,EAAE,MAAM,CAAC;IACvB,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,qBAAqB,EAAE,MAAM,CAAC;IAC9B,OAAO,EAAE,MAAM,CAAC;IAChB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,gBAAgB,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,gBAAgB;IAC/B,UAAU,EAAE,MAAM,CAAC;IACnB,cAAc,EAAE,MAAM,CAAC;IACvB,QAAQ,EAAE;QACR,EAAE,EAAE,MAAM,CAAC;QACX,EAAE,EAAE,MAAM,CAAC;QACX,EAAE,EAAE,MAAM,CAAC;QACX,EAAE,EAAE,MAAM,CAAC;QACX,EAAE,EAAE,MAAM,CAAC;QACX,KAAK,EAAE,MAAM,CAAC;KACf,CAAC;IACF,UAAU,EAAE;QACV,KAAK,EAAE,MAAM,CAAC;QACd,MAAM,EAAE,MAAM,CAAC;QACf,OAAO,EAAE,MAAM,CAAC;KACjB,CAAC;IACF,UAAU,EAAE;QACV,MAAM,EAAE,MAAM,CAAC;QACf,MAAM,EAAE,MAAM,CAAC;QACf,QAAQ,EAAE,MAAM,CAAC;QACjB,IAAI,EAAE,MAAM,CAAC;KACd,CAAC;CACH;AAED,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,WAAW,CAAC;IACpB,OAAO,EAAE,aAAa,CAAC;IACvB,MAAM,EAAE,YAAY,CAAC;IACrB,UAAU,EAAE,gBAAgB,CAAC;IAC7B,IAAI,EAAE,OAAO,CAAC;CACf"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/voice/index.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,YAAY,EACV,2BAA2B,EAC3B,0BAA0B,GAC3B,MAAM,wBAAwB,CAAC"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { type ExpoSpeechRecognitionErrorCode } from 'expo-speech-recognition';
|
|
2
|
+
export interface UseSpeechRecognitionOptions {
|
|
3
|
+
/** BCP-47 locale tag for recognition. Default `'en-US'`. */
|
|
4
|
+
lang?: string;
|
|
5
|
+
/**
|
|
6
|
+
* Emit interim (partial) results as the user speaks. Default `true` —
|
|
7
|
+
* gives a ChatGPT-style live transcription feel.
|
|
8
|
+
*/
|
|
9
|
+
interimResults?: boolean;
|
|
10
|
+
/**
|
|
11
|
+
* Keep recognizing after a pause instead of auto-stopping on silence.
|
|
12
|
+
* Default `false` — the user typically taps-to-stop anyway, and
|
|
13
|
+
* continuous mode has caveats on Android 12-.
|
|
14
|
+
*/
|
|
15
|
+
continuous?: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Insert punctuation into the transcript automatically. Default `true`
|
|
18
|
+
* — matches the feel of iOS's built-in dictation.
|
|
19
|
+
*/
|
|
20
|
+
addsPunctuation?: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* Called when a final transcript is available. Useful for auto-submit
|
|
23
|
+
* flows; the transcript is also available via the `transcript` state.
|
|
24
|
+
*/
|
|
25
|
+
onFinalResult?: (transcript: string) => void;
|
|
26
|
+
}
|
|
27
|
+
export interface UseSpeechRecognitionReturn {
|
|
28
|
+
/** True while the recognizer is actively listening. */
|
|
29
|
+
isListening: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* The current transcript — updates live with interim results while
|
|
32
|
+
* `isListening`, then settles on the final transcript when recognition
|
|
33
|
+
* stops. Cleared by `reset()` or by calling `start()` again.
|
|
34
|
+
*/
|
|
35
|
+
transcript: string;
|
|
36
|
+
/** Last error from the recognizer, or `null` if nothing has gone wrong. */
|
|
37
|
+
error: {
|
|
38
|
+
code: ExpoSpeechRecognitionErrorCode;
|
|
39
|
+
message: string;
|
|
40
|
+
} | null;
|
|
41
|
+
/** Request permissions (if needed) and start recognition. */
|
|
42
|
+
start: () => Promise<void>;
|
|
43
|
+
/** Stop recognition — final result will be delivered before isListening flips. */
|
|
44
|
+
stop: () => void;
|
|
45
|
+
/** Shortcut: start if idle, stop if listening. Most common press handler. */
|
|
46
|
+
toggle: () => Promise<void>;
|
|
47
|
+
/** Clear the transcript and reset the error state. */
|
|
48
|
+
reset: () => void;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* React hook wrapping `expo-speech-recognition` for chat-style voice input.
|
|
52
|
+
*
|
|
53
|
+
* @example
|
|
54
|
+
* ```tsx
|
|
55
|
+
* import { useSpeechRecognition } from '@crafter/rn-ai-elements/voice';
|
|
56
|
+
*
|
|
57
|
+
* const { isListening, transcript, toggle } = useSpeechRecognition({
|
|
58
|
+
* onFinalResult: (text) => console.log('final:', text),
|
|
59
|
+
* });
|
|
60
|
+
*
|
|
61
|
+
* // Pipe transcript into your input state
|
|
62
|
+
* useEffect(() => {
|
|
63
|
+
* if (transcript) setInput(transcript);
|
|
64
|
+
* }, [transcript]);
|
|
65
|
+
*
|
|
66
|
+
* // Wire the mic button
|
|
67
|
+
* <PromptInput
|
|
68
|
+
* value={input}
|
|
69
|
+
* onChangeText={setInput}
|
|
70
|
+
* isListening={isListening}
|
|
71
|
+
* onMicPress={toggle}
|
|
72
|
+
* ...
|
|
73
|
+
* />
|
|
74
|
+
* ```
|
|
75
|
+
*/
|
|
76
|
+
export declare function useSpeechRecognition(options?: UseSpeechRecognitionOptions): UseSpeechRecognitionReturn;
|
|
77
|
+
//# sourceMappingURL=useSpeechRecognition.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useSpeechRecognition.d.ts","sourceRoot":"","sources":["../../../../src/voice/useSpeechRecognition.ts"],"names":[],"mappings":"AACA,OAAO,EAGL,KAAK,8BAA8B,EAEpC,MAAM,yBAAyB,CAAC;AA6BjC,MAAM,WAAW,2BAA2B;IAC1C,4DAA4D;IAC5D,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB;;;;OAIG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;OAGG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B;;;OAGG;IACH,aAAa,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,IAAI,CAAC;CAC9C;AAED,MAAM,WAAW,0BAA0B;IACzC,uDAAuD;IACvD,WAAW,EAAE,OAAO,CAAC;IACrB;;;;OAIG;IACH,UAAU,EAAE,MAAM,CAAC;IACnB,2EAA2E;IAC3E,KAAK,EAAE;QAAE,IAAI,EAAE,8BAA8B,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;IACxE,6DAA6D;IAC7D,KAAK,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAC3B,kFAAkF;IAClF,IAAI,EAAE,MAAM,IAAI,CAAC;IACjB,6EAA6E;IAC7E,MAAM,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAC5B,sDAAsD;IACtD,KAAK,EAAE,MAAM,IAAI,CAAC;CACnB;AAID;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,oBAAoB,CAClC,OAAO,GAAE,2BAAgC,GACxC,0BAA0B,CAqH5B"}
|