@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,130 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import React, { createContext, useCallback, useContext, useState } from 'react';
|
|
4
|
+
import { Pressable, StyleSheet } from 'react-native';
|
|
5
|
+
import Animated, { useAnimatedStyle, useDerivedValue, useSharedValue, withTiming } from 'react-native-reanimated';
|
|
6
|
+
|
|
7
|
+
// ---------------------------------------------------------------------------
|
|
8
|
+
// Context
|
|
9
|
+
// ---------------------------------------------------------------------------
|
|
10
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
11
|
+
const CollapsibleContext = /*#__PURE__*/createContext(null);
|
|
12
|
+
function useCollapsibleContext() {
|
|
13
|
+
const ctx = useContext(CollapsibleContext);
|
|
14
|
+
if (!ctx) {
|
|
15
|
+
throw new Error('Collapsible compound components must be used within a <Collapsible>.');
|
|
16
|
+
}
|
|
17
|
+
return ctx;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
// ---------------------------------------------------------------------------
|
|
21
|
+
// Prop types
|
|
22
|
+
// ---------------------------------------------------------------------------
|
|
23
|
+
|
|
24
|
+
// ---------------------------------------------------------------------------
|
|
25
|
+
// Collapsible (parent)
|
|
26
|
+
// ---------------------------------------------------------------------------
|
|
27
|
+
|
|
28
|
+
export function Collapsible({
|
|
29
|
+
open: controlledOpen,
|
|
30
|
+
onOpenChange,
|
|
31
|
+
children,
|
|
32
|
+
style
|
|
33
|
+
}) {
|
|
34
|
+
const [internalOpen, setInternalOpen] = useState(false);
|
|
35
|
+
const isControlled = controlledOpen !== undefined;
|
|
36
|
+
const open = isControlled ? controlledOpen : internalOpen;
|
|
37
|
+
const onToggle = useCallback(() => {
|
|
38
|
+
const next = !open;
|
|
39
|
+
if (!isControlled) {
|
|
40
|
+
setInternalOpen(next);
|
|
41
|
+
}
|
|
42
|
+
onOpenChange?.(next);
|
|
43
|
+
}, [open, isControlled, onOpenChange]);
|
|
44
|
+
return /*#__PURE__*/_jsx(CollapsibleContext.Provider, {
|
|
45
|
+
value: {
|
|
46
|
+
open,
|
|
47
|
+
onToggle
|
|
48
|
+
},
|
|
49
|
+
children: /*#__PURE__*/_jsx(Animated.View, {
|
|
50
|
+
style: style,
|
|
51
|
+
children: children
|
|
52
|
+
})
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
// ---------------------------------------------------------------------------
|
|
57
|
+
// CollapsibleTrigger
|
|
58
|
+
// ---------------------------------------------------------------------------
|
|
59
|
+
|
|
60
|
+
export function CollapsibleTrigger({
|
|
61
|
+
children,
|
|
62
|
+
style
|
|
63
|
+
}) {
|
|
64
|
+
const {
|
|
65
|
+
onToggle
|
|
66
|
+
} = useCollapsibleContext();
|
|
67
|
+
return /*#__PURE__*/_jsx(Pressable, {
|
|
68
|
+
onPress: onToggle,
|
|
69
|
+
style: ({
|
|
70
|
+
pressed
|
|
71
|
+
}) => [pressed && styles.pressed, style],
|
|
72
|
+
children: children
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
// ---------------------------------------------------------------------------
|
|
77
|
+
// CollapsibleContent (animated)
|
|
78
|
+
// ---------------------------------------------------------------------------
|
|
79
|
+
|
|
80
|
+
export function CollapsibleContent({
|
|
81
|
+
children,
|
|
82
|
+
style
|
|
83
|
+
}) {
|
|
84
|
+
const {
|
|
85
|
+
open
|
|
86
|
+
} = useCollapsibleContext();
|
|
87
|
+
const measuredHeight = useSharedValue(0);
|
|
88
|
+
const progress = useDerivedValue(() => withTiming(open ? 1 : 0, {
|
|
89
|
+
duration: 250
|
|
90
|
+
}));
|
|
91
|
+
const animatedContainerStyle = useAnimatedStyle(() => ({
|
|
92
|
+
height: progress.value * measuredHeight.value,
|
|
93
|
+
opacity: progress.value,
|
|
94
|
+
overflow: 'hidden'
|
|
95
|
+
}));
|
|
96
|
+
const onLayout = useCallback(event => {
|
|
97
|
+
const layoutHeight = event.nativeEvent.layout.height;
|
|
98
|
+
if (layoutHeight > 0) {
|
|
99
|
+
measuredHeight.value = layoutHeight;
|
|
100
|
+
}
|
|
101
|
+
}, [measuredHeight]);
|
|
102
|
+
return /*#__PURE__*/_jsx(Animated.View, {
|
|
103
|
+
style: [animatedContainerStyle, style],
|
|
104
|
+
children: /*#__PURE__*/_jsx(Animated.View, {
|
|
105
|
+
style: styles.inner,
|
|
106
|
+
onLayout: onLayout,
|
|
107
|
+
children: children
|
|
108
|
+
})
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
// ---------------------------------------------------------------------------
|
|
113
|
+
// Styles
|
|
114
|
+
// ---------------------------------------------------------------------------
|
|
115
|
+
|
|
116
|
+
const styles = StyleSheet.create({
|
|
117
|
+
pressed: {
|
|
118
|
+
opacity: 0.7
|
|
119
|
+
},
|
|
120
|
+
inner: {
|
|
121
|
+
// Position absolute so we can measure the natural height without
|
|
122
|
+
// the parent constraining it while collapsed. Once the parent animates
|
|
123
|
+
// to the full measured height the content is fully visible.
|
|
124
|
+
position: 'absolute',
|
|
125
|
+
width: '100%',
|
|
126
|
+
top: 0,
|
|
127
|
+
left: 0
|
|
128
|
+
}
|
|
129
|
+
});
|
|
130
|
+
//# sourceMappingURL=Collapsible.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","createContext","useCallback","useContext","useState","Pressable","StyleSheet","Animated","useAnimatedStyle","useDerivedValue","useSharedValue","withTiming","jsx","_jsx","CollapsibleContext","useCollapsibleContext","ctx","Error","Collapsible","open","controlledOpen","onOpenChange","children","style","internalOpen","setInternalOpen","isControlled","undefined","onToggle","next","Provider","value","View","CollapsibleTrigger","onPress","pressed","styles","CollapsibleContent","measuredHeight","progress","duration","animatedContainerStyle","height","opacity","overflow","onLayout","event","layoutHeight","nativeEvent","layout","inner","create","position","width","top","left"],"sourceRoot":"../../../src","sources":["primitives/Collapsible.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IACVC,aAAa,EACbC,WAAW,EACXC,UAAU,EACVC,QAAQ,QAEH,OAAO;AACd,SAASC,SAAS,EAAEC,UAAU,QAAwC,cAAc;AACpF,OAAOC,QAAQ,IACbC,gBAAgB,EAChBC,eAAe,EACfC,cAAc,EACdC,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T,KAAK,EAAEa,MAAM,CAACc,KAAM;MACpBL,QAAQ,EAAEA,QAAS;MAAAvB,QAAA,EAElBA;IAAQ,CACI;EAAC,CACH,CAAC;AAEpB;;AAEA;AACA;AACA;;AAEA,MAAMc,MAAM,GAAG9B,UAAU,CAAC6C,MAAM,CAAC;EAC/BhB,OAAO,EAAE;IACPQ,OAAO,EAAE;EACX,CAAC;EACDO,KAAK,EAAE;IACL;IACA;IACA;IACAE,QAAQ,EAAE,UAAU;IACpBC,KAAK,EAAE,MAAM;IACbC,GAAG,EAAE,CAAC;IACNC,IAAI,EAAE;EACR;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { ScrollView, StyleSheet } from 'react-native';
|
|
5
|
+
import { useAIElementsTheme } from '../theme';
|
|
6
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
|
+
export function ScrollArea({
|
|
8
|
+
horizontal = false,
|
|
9
|
+
style,
|
|
10
|
+
contentContainerStyle,
|
|
11
|
+
children,
|
|
12
|
+
...scrollViewProps
|
|
13
|
+
}) {
|
|
14
|
+
const theme = useAIElementsTheme();
|
|
15
|
+
return /*#__PURE__*/_jsx(ScrollView, {
|
|
16
|
+
...scrollViewProps,
|
|
17
|
+
horizontal: horizontal,
|
|
18
|
+
showsVerticalScrollIndicator: false,
|
|
19
|
+
showsHorizontalScrollIndicator: false,
|
|
20
|
+
style: [styles.base, {
|
|
21
|
+
backgroundColor: theme.colors.background
|
|
22
|
+
}, style],
|
|
23
|
+
contentContainerStyle: [styles.contentContainer, contentContainerStyle],
|
|
24
|
+
children: children
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
const styles = StyleSheet.create({
|
|
28
|
+
base: {
|
|
29
|
+
flex: 1
|
|
30
|
+
},
|
|
31
|
+
contentContainer: {
|
|
32
|
+
flexGrow: 1
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
//# sourceMappingURL=ScrollArea.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","ScrollView","StyleSheet","useAIElementsTheme","jsx","_jsx","ScrollArea","horizontal","style","contentContainerStyle","children","scrollViewProps","theme","showsVerticalScrollIndicator","showsHorizontalScrollIndicator","styles","base","backgroundColor","colors","background","contentContainer","create","flex","flexGrow"],"sourceRoot":"../../../src","sources":["primitives/ScrollArea.tsx"],"mappings":";;AAAA,OAAOA,KAAK,MAA0B,OAAO;AAC7C,SACEC,UAAU,EACVC,UAAU,QAIL,cAAc;AACrB,SAASC,kBAAkB,QAAQ,UAAU;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAU9C,OAAO,SAASC,UAAUA,CAAC;EACzBC,UAAU,GAAG,KAAK;EAClBC,KAAK;EACLC,qBAAqB;EACrBC,QAAQ;EACR,GAAGC;AACY,CAAC,EAAE;EAClB,MAAMC,KAAK,GAAGT,kBAAkB,CAAC,CAAC;EAElC,oBACEE,IAAA,CAACJ,UAAU;IAAA,GACLU,eAAe;IACnBJ,UAAU,EAAEA,UAAW;IACvBM,4BAA4B,EAAE,KAAM;IACpCC,8BAA8B,EAAE,KAAM;IACtCN,KAAK,EAAE,CACLO,MAAM,CAACC,IAAI,EACX;MAAEC,eAAe,EAAEL,KAAK,CAACM,MAAM,CAACC;IAAW,CAAC,EAC5CX,KAAK,CACL;IACFC,qBAAqB,EAAE,CAACM,MAAM,CAACK,gBAAgB,EAAEX,qBAAqB,CAAE;IAAAC,QAAA,EAEvEA;EAAQ,CACC,CAAC;AAEjB;AAEA,MAAMK,MAAM,GAAGb,UAAU,CAACmB,MAAM,CAAC;EAC/BL,IAAI,EAAE;IACJM,IAAI,EAAE;EACR,CAAC;EACDF,gBAAgB,EAAE;IAChBG,QAAQ,EAAE;EACZ;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
export { Button } from './Button';
|
|
4
|
+
export { Badge } from './Badge';
|
|
5
|
+
export { Card, CardHeader, CardTitle, CardDescription, CardContent, CardFooter } from './Card';
|
|
6
|
+
export { Collapsible, CollapsibleTrigger, CollapsibleContent } from './Collapsible';
|
|
7
|
+
export { ScrollArea } from './ScrollArea';
|
|
8
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["Button","Badge","Card","CardHeader","CardTitle","CardDescription","CardContent","CardFooter","Collapsible","CollapsibleTrigger","CollapsibleContent","ScrollArea"],"sourceRoot":"../../../src","sources":["primitives/index.ts"],"mappings":";;AAAA,SAASA,MAAM,QAAQ,UAAU;AAGjC,SAASC,KAAK,QAAQ,SAAS;AAG/B,SACEC,IAAI,EACJC,UAAU,EACVC,SAAS,EACTC,eAAe,EACfC,WAAW,EACXC,UAAU,QACL,QAAQ;AAUf,SACEC,WAAW,EACXC,kBAAkB,EAClBC,kBAAkB,QACb,eAAe;AAOtB,SAASC,UAAU,QAAQ,cAAc","ignoreList":[]}
|
|
@@ -0,0 +1,246 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import React, { memo, useCallback, useMemo } from 'react';
|
|
4
|
+
import { Linking, StyleSheet, View } from 'react-native';
|
|
5
|
+
import Markdown from 'react-native-markdown-display';
|
|
6
|
+
import { useAIElementsTheme } from '../theme';
|
|
7
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
|
+
/**
|
|
9
|
+
* Closes any dangling markdown constructs that the parser would otherwise
|
|
10
|
+
* mis-render mid-stream. Most importantly: an unclosed fenced code block
|
|
11
|
+
* causes everything after the opening ``` to be rendered as code until the
|
|
12
|
+
* closing fence arrives, which produces a jarring flicker.
|
|
13
|
+
*
|
|
14
|
+
* This is correctness, not animation — keep it even in the "simple" version.
|
|
15
|
+
*/
|
|
16
|
+
function stabilizePartialMarkdown(content) {
|
|
17
|
+
const fenceMatches = content.match(/^```/gm);
|
|
18
|
+
const fenceCount = fenceMatches?.length ?? 0;
|
|
19
|
+
if (fenceCount % 2 === 1) {
|
|
20
|
+
const needsNewline = !content.endsWith('\n');
|
|
21
|
+
return `${content}${needsNewline ? '\n' : ''}\`\`\``;
|
|
22
|
+
}
|
|
23
|
+
return content;
|
|
24
|
+
}
|
|
25
|
+
function createMarkdownStyles(theme) {
|
|
26
|
+
return {
|
|
27
|
+
body: {
|
|
28
|
+
color: theme.colors.foreground,
|
|
29
|
+
fontSize: 12,
|
|
30
|
+
lineHeight: 12 * theme.typography.lineHeight.normal,
|
|
31
|
+
fontFamily: theme.typography.fontFamily
|
|
32
|
+
},
|
|
33
|
+
heading1: {
|
|
34
|
+
color: theme.colors.foreground,
|
|
35
|
+
fontSize: theme.typography.fontSize['2xl'],
|
|
36
|
+
fontWeight: theme.typography.fontWeight.bold,
|
|
37
|
+
lineHeight: theme.typography.fontSize['2xl'] * theme.typography.lineHeight.tight,
|
|
38
|
+
marginTop: theme.spacing.lg,
|
|
39
|
+
marginBottom: theme.spacing.md
|
|
40
|
+
},
|
|
41
|
+
heading2: {
|
|
42
|
+
color: theme.colors.foreground,
|
|
43
|
+
fontSize: theme.typography.fontSize.xl,
|
|
44
|
+
fontWeight: theme.typography.fontWeight.bold,
|
|
45
|
+
lineHeight: theme.typography.fontSize.xl * theme.typography.lineHeight.tight,
|
|
46
|
+
marginTop: theme.spacing.lg,
|
|
47
|
+
marginBottom: theme.spacing.sm
|
|
48
|
+
},
|
|
49
|
+
heading3: {
|
|
50
|
+
color: theme.colors.foreground,
|
|
51
|
+
fontSize: theme.typography.fontSize.lg,
|
|
52
|
+
fontWeight: theme.typography.fontWeight.semibold,
|
|
53
|
+
lineHeight: theme.typography.fontSize.lg * theme.typography.lineHeight.tight,
|
|
54
|
+
marginTop: theme.spacing.md,
|
|
55
|
+
marginBottom: theme.spacing.sm
|
|
56
|
+
},
|
|
57
|
+
heading4: {
|
|
58
|
+
color: theme.colors.foreground,
|
|
59
|
+
fontSize: theme.typography.fontSize.md,
|
|
60
|
+
fontWeight: theme.typography.fontWeight.semibold,
|
|
61
|
+
marginTop: theme.spacing.md,
|
|
62
|
+
marginBottom: theme.spacing.xs
|
|
63
|
+
},
|
|
64
|
+
strong: {
|
|
65
|
+
fontWeight: theme.typography.fontWeight.bold
|
|
66
|
+
},
|
|
67
|
+
em: {
|
|
68
|
+
fontStyle: 'italic'
|
|
69
|
+
},
|
|
70
|
+
link: {
|
|
71
|
+
color: theme.colors.primary,
|
|
72
|
+
textDecorationLine: 'underline'
|
|
73
|
+
},
|
|
74
|
+
code_inline: {
|
|
75
|
+
backgroundColor: theme.colors.muted,
|
|
76
|
+
color: theme.colors.foreground,
|
|
77
|
+
fontFamily: theme.typography.monoFontFamily,
|
|
78
|
+
fontSize: theme.typography.fontSize.sm,
|
|
79
|
+
paddingHorizontal: 4,
|
|
80
|
+
paddingVertical: 2,
|
|
81
|
+
borderRadius: theme.radius.sm
|
|
82
|
+
},
|
|
83
|
+
code_block: {
|
|
84
|
+
backgroundColor: theme.dark ? '#1E1E1E' : '#F8F8F8',
|
|
85
|
+
color: theme.colors.foreground,
|
|
86
|
+
fontFamily: theme.typography.monoFontFamily,
|
|
87
|
+
fontSize: theme.typography.fontSize.sm,
|
|
88
|
+
lineHeight: theme.typography.fontSize.sm * theme.typography.lineHeight.relaxed,
|
|
89
|
+
padding: theme.spacing.md,
|
|
90
|
+
borderRadius: theme.radius.md,
|
|
91
|
+
marginVertical: theme.spacing.sm
|
|
92
|
+
},
|
|
93
|
+
fence: {
|
|
94
|
+
backgroundColor: theme.dark ? '#1E1E1E' : '#F8F8F8',
|
|
95
|
+
color: theme.colors.foreground,
|
|
96
|
+
fontFamily: theme.typography.monoFontFamily,
|
|
97
|
+
fontSize: theme.typography.fontSize.sm,
|
|
98
|
+
lineHeight: theme.typography.fontSize.sm * theme.typography.lineHeight.relaxed,
|
|
99
|
+
padding: theme.spacing.md,
|
|
100
|
+
borderRadius: theme.radius.md,
|
|
101
|
+
marginVertical: theme.spacing.sm
|
|
102
|
+
},
|
|
103
|
+
blockquote: {
|
|
104
|
+
backgroundColor: theme.colors.muted,
|
|
105
|
+
borderLeftColor: theme.colors.border,
|
|
106
|
+
borderLeftWidth: 3,
|
|
107
|
+
paddingHorizontal: theme.spacing.md,
|
|
108
|
+
paddingVertical: theme.spacing.sm,
|
|
109
|
+
marginVertical: theme.spacing.sm,
|
|
110
|
+
borderRadius: theme.radius.sm
|
|
111
|
+
},
|
|
112
|
+
bullet_list: {
|
|
113
|
+
marginVertical: theme.spacing.xs
|
|
114
|
+
},
|
|
115
|
+
ordered_list: {
|
|
116
|
+
marginVertical: theme.spacing.xs
|
|
117
|
+
},
|
|
118
|
+
list_item: {
|
|
119
|
+
flexDirection: 'row',
|
|
120
|
+
marginVertical: 2
|
|
121
|
+
},
|
|
122
|
+
bullet_list_icon: {
|
|
123
|
+
color: theme.colors.mutedForeground,
|
|
124
|
+
fontSize: theme.typography.fontSize.md,
|
|
125
|
+
lineHeight: theme.typography.fontSize.md * theme.typography.lineHeight.normal,
|
|
126
|
+
marginRight: theme.spacing.sm
|
|
127
|
+
},
|
|
128
|
+
ordered_list_icon: {
|
|
129
|
+
color: theme.colors.mutedForeground,
|
|
130
|
+
fontSize: theme.typography.fontSize.md,
|
|
131
|
+
lineHeight: theme.typography.fontSize.md * theme.typography.lineHeight.normal,
|
|
132
|
+
marginRight: theme.spacing.sm
|
|
133
|
+
},
|
|
134
|
+
table: {
|
|
135
|
+
borderWidth: StyleSheet.hairlineWidth,
|
|
136
|
+
borderColor: theme.colors.border,
|
|
137
|
+
borderRadius: theme.radius.sm,
|
|
138
|
+
marginVertical: theme.spacing.sm
|
|
139
|
+
},
|
|
140
|
+
thead: {
|
|
141
|
+
backgroundColor: theme.colors.muted
|
|
142
|
+
},
|
|
143
|
+
th: {
|
|
144
|
+
padding: theme.spacing.sm,
|
|
145
|
+
borderRightWidth: StyleSheet.hairlineWidth,
|
|
146
|
+
borderColor: theme.colors.border,
|
|
147
|
+
fontWeight: theme.typography.fontWeight.semibold
|
|
148
|
+
},
|
|
149
|
+
tr: {
|
|
150
|
+
borderBottomWidth: StyleSheet.hairlineWidth,
|
|
151
|
+
borderColor: theme.colors.border
|
|
152
|
+
},
|
|
153
|
+
td: {
|
|
154
|
+
padding: theme.spacing.sm,
|
|
155
|
+
borderRightWidth: StyleSheet.hairlineWidth,
|
|
156
|
+
borderColor: theme.colors.border
|
|
157
|
+
},
|
|
158
|
+
hr: {
|
|
159
|
+
backgroundColor: theme.colors.border,
|
|
160
|
+
height: 1,
|
|
161
|
+
marginVertical: theme.spacing.lg
|
|
162
|
+
},
|
|
163
|
+
paragraph: {
|
|
164
|
+
marginVertical: theme.spacing.xs
|
|
165
|
+
},
|
|
166
|
+
image: {
|
|
167
|
+
borderRadius: theme.radius.md
|
|
168
|
+
}
|
|
169
|
+
};
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* Memoized markdown body. Re-renders only when the content string or theme
|
|
173
|
+
* styles change — mirroring the `memo(MessageResponse)` pattern that Vercel
|
|
174
|
+
* ai-elements uses around `Streamdown`
|
|
175
|
+
* (opensrc/.../vercel/ai-elements/packages/elements/src/message.tsx:326).
|
|
176
|
+
*/
|
|
177
|
+
const MemoMarkdown = /*#__PURE__*/memo(({
|
|
178
|
+
content,
|
|
179
|
+
styles,
|
|
180
|
+
onLinkPress
|
|
181
|
+
}) => /*#__PURE__*/_jsx(Markdown, {
|
|
182
|
+
style: styles,
|
|
183
|
+
mergeStyle: true,
|
|
184
|
+
onLinkPress: onLinkPress,
|
|
185
|
+
children: content
|
|
186
|
+
}), (prev, next) => prev.content === next.content && prev.styles === next.styles && prev.onLinkPress === next.onLinkPress);
|
|
187
|
+
MemoMarkdown.displayName = 'MemoMarkdown';
|
|
188
|
+
|
|
189
|
+
/**
|
|
190
|
+
* StreamingMarkdown — renders markdown content using react-native-markdown-display.
|
|
191
|
+
*
|
|
192
|
+
* Deliberately matches the simplicity of Vercel ai-elements'
|
|
193
|
+
* `MessageResponse` (a memoized wrapper around `Streamdown`): no custom
|
|
194
|
+
* fade animations, no block-level entrance effects, no opacity tricks,
|
|
195
|
+
* **no additional throttling**. Content re-renders as it grows and the
|
|
196
|
+
* visual "streaming" feel comes from the tokens arriving incrementally
|
|
197
|
+
* from the network.
|
|
198
|
+
*
|
|
199
|
+
* **Why no RAF throttling?** We used to throttle updates to ~60fps via
|
|
200
|
+
* `requestAnimationFrame` inside this component. That sounds good on
|
|
201
|
+
* paper but stacks badly with `useChat`'s own `experimental_throttle`:
|
|
202
|
+
* the two timers drift out of phase, and you end up seeing "first word,
|
|
203
|
+
* then the rest of the text all at once" on subsequent messages. Vercel
|
|
204
|
+
* ai-elements trusts `useChat` entirely and does the same — see
|
|
205
|
+
* `opensrc/.../vercel/ai-elements/packages/elements/src/message.tsx:326`.
|
|
206
|
+
* If you need to throttle the re-render rate, set
|
|
207
|
+
* `experimental_throttle: 25` (or whatever) on the `useChat` call. Don't
|
|
208
|
+
* layer a second throttler here.
|
|
209
|
+
*
|
|
210
|
+
* What IS preserved:
|
|
211
|
+
* - `stabilizePartialMarkdown` — closes unclosed code fences mid-stream
|
|
212
|
+
* so the parser doesn't swallow the rest of the message as code.
|
|
213
|
+
* Pure correctness, not visual.
|
|
214
|
+
* - `MemoMarkdown` — shallow-equal memoization so identical content
|
|
215
|
+
* doesn't re-parse. Matches `memo(MessageResponse)` in ai-elements.
|
|
216
|
+
*/
|
|
217
|
+
export function StreamingMarkdown({
|
|
218
|
+
content,
|
|
219
|
+
isStreaming = false,
|
|
220
|
+
style
|
|
221
|
+
}) {
|
|
222
|
+
const theme = useAIElementsTheme();
|
|
223
|
+
const markdownStyles = useMemo(() => createMarkdownStyles(theme), [theme]);
|
|
224
|
+
const handleLinkPress = useCallback(url => {
|
|
225
|
+
Linking.openURL(url).catch(() => {});
|
|
226
|
+
return false;
|
|
227
|
+
}, []);
|
|
228
|
+
const displayContent = useMemo(() => isStreaming ? stabilizePartialMarkdown(content) : content, [content, isStreaming]);
|
|
229
|
+
if (displayContent.length === 0) {
|
|
230
|
+
return null;
|
|
231
|
+
}
|
|
232
|
+
return /*#__PURE__*/_jsx(View, {
|
|
233
|
+
style: [styles.container, style],
|
|
234
|
+
children: /*#__PURE__*/_jsx(MemoMarkdown, {
|
|
235
|
+
content: displayContent,
|
|
236
|
+
styles: markdownStyles,
|
|
237
|
+
onLinkPress: handleLinkPress
|
|
238
|
+
})
|
|
239
|
+
});
|
|
240
|
+
}
|
|
241
|
+
const styles = StyleSheet.create({
|
|
242
|
+
container: {
|
|
243
|
+
flexShrink: 1
|
|
244
|
+
}
|
|
245
|
+
});
|
|
246
|
+
//# sourceMappingURL=StreamingMarkdown.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","memo","useCallback","useMemo","Linking","StyleSheet","View","Markdown","useAIElementsTheme","jsx","_jsx","stabilizePartialMarkdown","content","fenceMatches","match","fenceCount","length","needsNewline","endsWith","createMarkdownStyles","theme","body","color","colors","foreground","fontSize","lineHeight","typography","normal","fontFamily","heading1","fontWeight","bold","tight","marginTop","spacing","lg","marginBottom","md","heading2","xl","sm","heading3","semibold","heading4","xs","strong","em","fontStyle","link","primary","textDecorationLine","code_inline","backgroundColor","muted","monoFontFamily","paddingHorizontal","paddingVertical","borderRadius","radius","code_block","dark","relaxed","padding","marginVertical","fence","blockquote","borderLeftColor","border","borderLeftWidth","bullet_list","ordered_list","list_item","flexDirection","bullet_list_icon","mutedForeground","marginRight","ordered_list_icon","table","borderWidth","hairlineWidth","borderColor","thead","th","borderRightWidth","tr","borderBottomWidth","td","hr","height","paragraph","image","MemoMarkdown","styles","onLinkPress","style","mergeStyle","children","prev","next","displayName","StreamingMarkdown","isStreaming","markdownStyles","handleLinkPress","url","openURL","catch","displayContent","container","create","flexShrink"],"sourceRoot":"../../../src","sources":["streaming/StreamingMarkdown.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IAAIC,IAAI,EA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O,CAAC,MAAMgB,oBAAoB,CAACC,KAAK,CAAC,EAAE,CAACA,KAAK,CAAC,CAAC;EAE1E,MAAMoF,eAAe,GAAGtG,WAAW,CAAEuG,GAAW,IAAK;IACnDrG,OAAO,CAACsG,OAAO,CAACD,GAAG,CAAC,CAACE,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC;IACpC,OAAO,KAAK;EACd,CAAC,EAAE,EAAE,CAAC;EAEN,MAAMC,cAAc,GAAGzG,OAAO,CAC5B,MAAOmG,WAAW,GAAG3F,wBAAwB,CAACC,OAAO,CAAC,GAAGA,OAAQ,EACjE,CAACA,OAAO,EAAE0F,WAAW,CACvB,CAAC;EAED,IAAIM,cAAc,CAAC5F,MAAM,KAAK,CAAC,EAAE;IAC/B,OAAO,IAAI;EACb;EAEA,oBACEN,IAAA,CAACJ,IAAI;IAACyF,KAAK,EAAE,CAACF,MAAM,CAACgB,SAAS,EAAEd,KAAK,CAAE;IAAAE,QAAA,eACrCvF,IAAA,CAACkF,YAAY;MACXhF,OAAO,EAAEgG,cAAe;MACxBf,MAAM,EAAEU,cAAe;MACvBT,WAAW,EAAEU;IAAgB,CAC9B;EAAC,CACE,CAAC;AAEX;AAEA,MAAMX,MAAM,GAAGxF,UAAU,CAACyG,MAAM,CAAC;EAC/BD,SAAS,EAAE;IACTE,UAAU,EAAE;EACd;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["StreamingMarkdown"],"sourceRoot":"../../../src","sources":["streaming/index.ts"],"mappings":";;AAAA,SAASA,iBAAiB,QAAQ,qBAAqB","ignoreList":[]}
|