@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,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.useAutoScroll = useAutoScroll;
|
|
7
|
+
var _react = require("react");
|
|
8
|
+
/**
|
|
9
|
+
* Provides a FlatList ref and helpers that keep the list pinned to the bottom.
|
|
10
|
+
*
|
|
11
|
+
* ```tsx
|
|
12
|
+
* const { ref, onContentSizeChange } = useAutoScroll();
|
|
13
|
+
* <FlatList ref={ref} onContentSizeChange={onContentSizeChange} ... />
|
|
14
|
+
* ```
|
|
15
|
+
*/
|
|
16
|
+
function useAutoScroll(options = {}) {
|
|
17
|
+
const {
|
|
18
|
+
enabled = true
|
|
19
|
+
} = options;
|
|
20
|
+
const ref = (0, _react.useRef)(null);
|
|
21
|
+
const scrollToEnd = (0, _react.useCallback)(() => {
|
|
22
|
+
ref.current?.scrollToEnd({
|
|
23
|
+
animated: true
|
|
24
|
+
});
|
|
25
|
+
}, []);
|
|
26
|
+
const onContentSizeChange = (0, _react.useCallback)(() => {
|
|
27
|
+
if (enabled) {
|
|
28
|
+
ref.current?.scrollToEnd({
|
|
29
|
+
animated: true
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
}, [enabled]);
|
|
33
|
+
return {
|
|
34
|
+
ref,
|
|
35
|
+
scrollToEnd,
|
|
36
|
+
onContentSizeChange
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=useAutoScroll.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_react","require","useAutoScroll","options","enabled","ref","useRef","scrollToEnd","useCallback","current","animated","onContentSizeChange"],"sourceRoot":"../../../src","sources":["hooks/useAutoScroll.ts"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAiBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,aAAaA,CAC3BC,OAA6B,GAAG,CAAC,CAAC,EACV;EACxB,MAAM;IAAEC,OAAO,GAAG;EAAK,CAAC,GAAGD,OAAO;EAClC,MAAME,GAAG,GAAG,IAAAC,aAAM,EAAc,IAAI,CAAC;EAErC,MAAMC,WAAW,GAAG,IAAAC,kBAAW,EAAC,MAAM;IACpCH,GAAG,CAACI,OAAO,EAAEF,WAAW,CAAC;MAAEG,QAAQ,EAAE;IAAK,CAAC,CAAC;EAC9C,CAAC,EAAE,EAAE,CAAC;EAEN,MAAMC,mBAAmB,GAAG,IAAAH,kBAAW,EAAC,MAAM;IAC5C,IAAIJ,OAAO,EAAE;MACXC,GAAG,CAACI,OAAO,EAAEF,WAAW,CAAC;QAAEG,QAAQ,EAAE;MAAK,CAAC,CAAC;IAC9C;EACF,CAAC,EAAE,CAACN,OAAO,CAAC,CAAC;EAEb,OAAO;IAAEC,GAAG;IAAEE,WAAW;IAAEI;EAAoB,CAAC;AAClD","ignoreList":[]}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.useClipboard = useClipboard;
|
|
7
|
+
var _react = require("react");
|
|
8
|
+
var _reactNative = require("react-native");
|
|
9
|
+
const RESET_DELAY_MS = 2_000;
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Thin wrapper around the system clipboard with a transient `copied` flag.
|
|
13
|
+
*
|
|
14
|
+
* Uses the built-in `react-native` Clipboard API. The implementation is
|
|
15
|
+
* isolated so it can be swapped for `@react-native-clipboard/clipboard`
|
|
16
|
+
* without changing the public interface.
|
|
17
|
+
*
|
|
18
|
+
* ```tsx
|
|
19
|
+
* const { copy, copied } = useClipboard();
|
|
20
|
+
* <Pressable onPress={() => copy(code)}>
|
|
21
|
+
* <Text>{copied ? 'Copied!' : 'Copy'}</Text>
|
|
22
|
+
* </Pressable>
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
function useClipboard() {
|
|
26
|
+
const [copied, setCopied] = (0, _react.useState)(false);
|
|
27
|
+
const timerRef = (0, _react.useRef)(null);
|
|
28
|
+
const copy = (0, _react.useCallback)(async text => {
|
|
29
|
+
_reactNative.Clipboard.setString(text);
|
|
30
|
+
setCopied(true);
|
|
31
|
+
if (timerRef.current !== null) {
|
|
32
|
+
clearTimeout(timerRef.current);
|
|
33
|
+
}
|
|
34
|
+
timerRef.current = setTimeout(() => {
|
|
35
|
+
setCopied(false);
|
|
36
|
+
timerRef.current = null;
|
|
37
|
+
}, RESET_DELAY_MS);
|
|
38
|
+
}, []);
|
|
39
|
+
return {
|
|
40
|
+
copy,
|
|
41
|
+
copied
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=useClipboard.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_react","require","_reactNative","RESET_DELAY_MS","useClipboard","copied","setCopied","useState","timerRef","useRef","copy","useCallback","text","Clipboard","setString","current","clearTimeout","setTimeout"],"sourceRoot":"../../../src","sources":["hooks/useClipboard.ts"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AASA,MAAME,cAAc,GAAG,KAAK;;AAE5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,YAAYA,CAAA,EAAuB;EACjD,MAAM,CAACC,MAAM,EAAEC,SAAS,CAAC,GAAG,IAAAC,eAAQ,EAAC,KAAK,CAAC;EAC3C,MAAMC,QAAQ,GAAG,IAAAC,aAAM,EAAuC,IAAI,CAAC;EAEnE,MAAMC,IAAI,GAAG,IAAAC,kBAAW,EAAC,MAAOC,IAAY,IAAoB;IAC9DC,sBAAS,CAACC,SAAS,CAACF,IAAI,CAAC;IACzBN,SAAS,CAAC,IAAI,CAAC;IAEf,IAAIE,QAAQ,CAACO,OAAO,KAAK,IAAI,EAAE;MAC7BC,YAAY,CAACR,QAAQ,CAACO,OAAO,CAAC;IAChC;IAEAP,QAAQ,CAACO,OAAO,GAAGE,UAAU,CAAC,MAAM;MAClCX,SAAS,CAAC,KAAK,CAAC;MAChBE,QAAQ,CAACO,OAAO,GAAG,IAAI;IACzB,CAAC,EAAEZ,cAAc,CAAC;EACpB,CAAC,EAAE,EAAE,CAAC;EAEN,OAAO;IAAEO,IAAI;IAAEL;EAAO,CAAC;AACzB","ignoreList":[]}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.useCollapsible = useCollapsible;
|
|
7
|
+
var _react = require("react");
|
|
8
|
+
/**
|
|
9
|
+
* Minimal state hook for a collapsible section.
|
|
10
|
+
*
|
|
11
|
+
* ```tsx
|
|
12
|
+
* const { isOpen, toggle } = useCollapsible({ defaultOpen: true });
|
|
13
|
+
*
|
|
14
|
+
* <Pressable onPress={toggle}>
|
|
15
|
+
* <Text>{isOpen ? 'Hide' : 'Show'}</Text>
|
|
16
|
+
* </Pressable>
|
|
17
|
+
* {isOpen && <View>...</View>}
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
function useCollapsible(options = {}) {
|
|
21
|
+
const {
|
|
22
|
+
defaultOpen = false
|
|
23
|
+
} = options;
|
|
24
|
+
const [isOpen, setIsOpen] = (0, _react.useState)(defaultOpen);
|
|
25
|
+
const toggle = (0, _react.useCallback)(() => setIsOpen(prev => !prev), []);
|
|
26
|
+
const open = (0, _react.useCallback)(() => setIsOpen(true), []);
|
|
27
|
+
const close = (0, _react.useCallback)(() => setIsOpen(false), []);
|
|
28
|
+
return {
|
|
29
|
+
isOpen,
|
|
30
|
+
toggle,
|
|
31
|
+
open,
|
|
32
|
+
close
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=useCollapsible.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_react","require","useCollapsible","options","defaultOpen","isOpen","setIsOpen","useState","toggle","useCallback","prev","open","close"],"sourceRoot":"../../../src","sources":["hooks/useCollapsible.ts"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAkBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,cAAcA,CAC5BC,OAA8B,GAAG,CAAC,CAAC,EACb;EACtB,MAAM;IAAEC,WAAW,GAAG;EAAM,CAAC,GAAGD,OAAO;EACvC,MAAM,CAACE,MAAM,EAAEC,SAAS,CAAC,GAAG,IAAAC,eAAQ,EAACH,WAAW,CAAC;EAEjD,MAAMI,MAAM,GAAG,IAAAC,kBAAW,EAAC,MAAMH,SAAS,CAAEI,IAAa,IAAK,CAACA,IAAI,CAAC,EAAE,EAAE,CAAC;EACzE,MAAMC,IAAI,GAAG,IAAAF,kBAAW,EAAC,MAAMH,SAAS,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC;EACnD,MAAMM,KAAK,GAAG,IAAAH,kBAAW,EAAC,MAAMH,SAAS,CAAC,KAAK,CAAC,EAAE,EAAE,CAAC;EAErD,OAAO;IAAED,MAAM;IAAEG,MAAM;IAAEG,IAAI;IAAEC;EAAM,CAAC;AACxC","ignoreList":[]}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.useStickToBottom = useStickToBottom;
|
|
7
|
+
var _react = require("react");
|
|
8
|
+
/**
|
|
9
|
+
* Chat-style "stick to bottom" behaviour for a FlatList.
|
|
10
|
+
*
|
|
11
|
+
* When the user is scrolled to (or near) the bottom and new content arrives,
|
|
12
|
+
* the list automatically scrolls down. If the user scrolls up to read history,
|
|
13
|
+
* auto-scrolling pauses until they return to the bottom.
|
|
14
|
+
*
|
|
15
|
+
* ```tsx
|
|
16
|
+
* const { ref, onScroll, onContentSizeChange, isAtBottom, scrollToBottom } =
|
|
17
|
+
* useStickToBottom();
|
|
18
|
+
*
|
|
19
|
+
* <FlatList
|
|
20
|
+
* ref={ref}
|
|
21
|
+
* onScroll={onScroll}
|
|
22
|
+
* onContentSizeChange={onContentSizeChange}
|
|
23
|
+
* scrollEventThrottle={16}
|
|
24
|
+
* ...
|
|
25
|
+
* />
|
|
26
|
+
* ```
|
|
27
|
+
*/
|
|
28
|
+
function useStickToBottom(options = {}) {
|
|
29
|
+
const {
|
|
30
|
+
threshold = 50
|
|
31
|
+
} = options;
|
|
32
|
+
const ref = (0, _react.useRef)(null);
|
|
33
|
+
const [isAtBottom, setIsAtBottom] = (0, _react.useState)(true);
|
|
34
|
+
const onScroll = (0, _react.useCallback)(event => {
|
|
35
|
+
const {
|
|
36
|
+
contentOffset,
|
|
37
|
+
contentSize,
|
|
38
|
+
layoutMeasurement
|
|
39
|
+
} = event.nativeEvent;
|
|
40
|
+
const distanceFromBottom = contentSize.height - layoutMeasurement.height - contentOffset.y;
|
|
41
|
+
setIsAtBottom(distanceFromBottom <= threshold);
|
|
42
|
+
}, [threshold]);
|
|
43
|
+
const scrollToBottom = (0, _react.useCallback)(() => {
|
|
44
|
+
ref.current?.scrollToEnd({
|
|
45
|
+
animated: true
|
|
46
|
+
});
|
|
47
|
+
}, []);
|
|
48
|
+
|
|
49
|
+
// Keep a ref so the callback doesn't re-create on every isAtBottom change,
|
|
50
|
+
// but still reads the latest value.
|
|
51
|
+
const isAtBottomRef = (0, _react.useRef)(isAtBottom);
|
|
52
|
+
isAtBottomRef.current = isAtBottom;
|
|
53
|
+
const onContentSizeChange = (0, _react.useCallback)(() => {
|
|
54
|
+
if (isAtBottomRef.current) {
|
|
55
|
+
ref.current?.scrollToEnd({
|
|
56
|
+
animated: true
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
}, []);
|
|
60
|
+
return {
|
|
61
|
+
isAtBottom,
|
|
62
|
+
scrollToBottom,
|
|
63
|
+
onScroll,
|
|
64
|
+
onContentSizeChange,
|
|
65
|
+
ref
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
//# sourceMappingURL=useStickToBottom.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_react","require","useStickToBottom","options","threshold","ref","useRef","isAtBottom","setIsAtBottom","useState","onScroll","useCallback","event","contentOffset","contentSize","layoutMeasurement","nativeEvent","distanceFromBottom","height","y","scrollToBottom","current","scrollToEnd","animated","isAtBottomRef","onContentSizeChange"],"sourceRoot":"../../../src","sources":["hooks/useStickToBottom.ts"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAyBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,gBAAgBA,CAC9BC,OAAgC,GAAG,CAAC,CAAC,EACV;EAC3B,MAAM;IAAEC,SAAS,GAAG;EAAG,CAAC,GAAGD,OAAO;EAClC,MAAME,GAAG,GAAG,IAAAC,aAAM,EAAc,IAAI,CAAC;EACrC,MAAM,CAACC,UAAU,EAAEC,aAAa,CAAC,GAAG,IAAAC,eAAQ,EAAC,IAAI,CAAC;EAElD,MAAMC,QAAQ,GAAG,IAAAC,kBAAW,EACzBC,KAA8C,IAAK;IAClD,MAAM;MAAEC,aAAa;MAAEC,WAAW;MAAEC;IAAkB,CAAC,GACrDH,KAAK,CAACI,WAAW;IAEnB,MAAMC,kBAAkB,GACtBH,WAAW,CAACI,MAAM,GAAGH,iBAAiB,CAACG,MAAM,GAAGL,aAAa,CAACM,CAAC;IAEjEX,aAAa,CAACS,kBAAkB,IAAIb,SAAS,CAAC;EAChD,CAAC,EACD,CAACA,SAAS,CACZ,CAAC;EAED,MAAMgB,cAAc,GAAG,IAAAT,kBAAW,EAAC,MAAM;IACvCN,GAAG,CAACgB,OAAO,EAAEC,WAAW,CAAC;MAAEC,QAAQ,EAAE;IAAK,CAAC,CAAC;EAC9C,CAAC,EAAE,EAAE,CAAC;;EAEN;EACA;EACA,MAAMC,aAAa,GAAG,IAAAlB,aAAM,EAACC,UAAU,CAAC;EACxCiB,aAAa,CAACH,OAAO,GAAGd,UAAU;EAElC,MAAMkB,mBAAmB,GAAG,IAAAd,kBAAW,EAAC,MAAM;IAC5C,IAAIa,aAAa,CAACH,OAAO,EAAE;MACzBhB,GAAG,CAACgB,OAAO,EAAEC,WAAW,CAAC;QAAEC,QAAQ,EAAE;MAAK,CAAC,CAAC;IAC9C;EACF,CAAC,EAAE,EAAE,CAAC;EAEN,OAAO;IAAEhB,UAAU;IAAEa,cAAc;IAAEV,QAAQ;IAAEe,mBAAmB;IAAEpB;EAAI,CAAC;AAC3E","ignoreList":[]}
|
|
@@ -0,0 +1,257 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "AIElementsProvider", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function () {
|
|
9
|
+
return _theme.AIElementsProvider;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
Object.defineProperty(exports, "AIImage", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () {
|
|
15
|
+
return _chatbot.AIImage;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
Object.defineProperty(exports, "Attachments", {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: function () {
|
|
21
|
+
return _chatbot.Attachments;
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
Object.defineProperty(exports, "Badge", {
|
|
25
|
+
enumerable: true,
|
|
26
|
+
get: function () {
|
|
27
|
+
return _primitives.Badge;
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
Object.defineProperty(exports, "Button", {
|
|
31
|
+
enumerable: true,
|
|
32
|
+
get: function () {
|
|
33
|
+
return _primitives.Button;
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
Object.defineProperty(exports, "Card", {
|
|
37
|
+
enumerable: true,
|
|
38
|
+
get: function () {
|
|
39
|
+
return _primitives.Card;
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
Object.defineProperty(exports, "CardContent", {
|
|
43
|
+
enumerable: true,
|
|
44
|
+
get: function () {
|
|
45
|
+
return _primitives.CardContent;
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
Object.defineProperty(exports, "CardDescription", {
|
|
49
|
+
enumerable: true,
|
|
50
|
+
get: function () {
|
|
51
|
+
return _primitives.CardDescription;
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
Object.defineProperty(exports, "CardFooter", {
|
|
55
|
+
enumerable: true,
|
|
56
|
+
get: function () {
|
|
57
|
+
return _primitives.CardFooter;
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
Object.defineProperty(exports, "CardHeader", {
|
|
61
|
+
enumerable: true,
|
|
62
|
+
get: function () {
|
|
63
|
+
return _primitives.CardHeader;
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
Object.defineProperty(exports, "CardTitle", {
|
|
67
|
+
enumerable: true,
|
|
68
|
+
get: function () {
|
|
69
|
+
return _primitives.CardTitle;
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
Object.defineProperty(exports, "ChatErrorBoundary", {
|
|
73
|
+
enumerable: true,
|
|
74
|
+
get: function () {
|
|
75
|
+
return _chatbot.ChatErrorBoundary;
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
Object.defineProperty(exports, "ChatMessageItem", {
|
|
79
|
+
enumerable: true,
|
|
80
|
+
get: function () {
|
|
81
|
+
return _chatbot.ChatMessageItem;
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
Object.defineProperty(exports, "Collapsible", {
|
|
85
|
+
enumerable: true,
|
|
86
|
+
get: function () {
|
|
87
|
+
return _primitives.Collapsible;
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
Object.defineProperty(exports, "CollapsibleContent", {
|
|
91
|
+
enumerable: true,
|
|
92
|
+
get: function () {
|
|
93
|
+
return _primitives.CollapsibleContent;
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
Object.defineProperty(exports, "CollapsibleTrigger", {
|
|
97
|
+
enumerable: true,
|
|
98
|
+
get: function () {
|
|
99
|
+
return _primitives.CollapsibleTrigger;
|
|
100
|
+
}
|
|
101
|
+
});
|
|
102
|
+
Object.defineProperty(exports, "Conversation", {
|
|
103
|
+
enumerable: true,
|
|
104
|
+
get: function () {
|
|
105
|
+
return _chatbot.Conversation;
|
|
106
|
+
}
|
|
107
|
+
});
|
|
108
|
+
Object.defineProperty(exports, "ConversationScrollButton", {
|
|
109
|
+
enumerable: true,
|
|
110
|
+
get: function () {
|
|
111
|
+
return _chatbot.ConversationScrollButton;
|
|
112
|
+
}
|
|
113
|
+
});
|
|
114
|
+
Object.defineProperty(exports, "Message", {
|
|
115
|
+
enumerable: true,
|
|
116
|
+
get: function () {
|
|
117
|
+
return _chatbot.Message;
|
|
118
|
+
}
|
|
119
|
+
});
|
|
120
|
+
Object.defineProperty(exports, "MessageActions", {
|
|
121
|
+
enumerable: true,
|
|
122
|
+
get: function () {
|
|
123
|
+
return _chatbot.MessageActions;
|
|
124
|
+
}
|
|
125
|
+
});
|
|
126
|
+
Object.defineProperty(exports, "MessageAvatar", {
|
|
127
|
+
enumerable: true,
|
|
128
|
+
get: function () {
|
|
129
|
+
return _chatbot.MessageAvatar;
|
|
130
|
+
}
|
|
131
|
+
});
|
|
132
|
+
Object.defineProperty(exports, "MessageContent", {
|
|
133
|
+
enumerable: true,
|
|
134
|
+
get: function () {
|
|
135
|
+
return _chatbot.MessageContent;
|
|
136
|
+
}
|
|
137
|
+
});
|
|
138
|
+
Object.defineProperty(exports, "PromptInput", {
|
|
139
|
+
enumerable: true,
|
|
140
|
+
get: function () {
|
|
141
|
+
return _chatbot.PromptInput;
|
|
142
|
+
}
|
|
143
|
+
});
|
|
144
|
+
Object.defineProperty(exports, "Reasoning", {
|
|
145
|
+
enumerable: true,
|
|
146
|
+
get: function () {
|
|
147
|
+
return _chatbot.Reasoning;
|
|
148
|
+
}
|
|
149
|
+
});
|
|
150
|
+
Object.defineProperty(exports, "ScrollArea", {
|
|
151
|
+
enumerable: true,
|
|
152
|
+
get: function () {
|
|
153
|
+
return _primitives.ScrollArea;
|
|
154
|
+
}
|
|
155
|
+
});
|
|
156
|
+
Object.defineProperty(exports, "Shimmer", {
|
|
157
|
+
enumerable: true,
|
|
158
|
+
get: function () {
|
|
159
|
+
return _chatbot.Shimmer;
|
|
160
|
+
}
|
|
161
|
+
});
|
|
162
|
+
Object.defineProperty(exports, "Sources", {
|
|
163
|
+
enumerable: true,
|
|
164
|
+
get: function () {
|
|
165
|
+
return _chatbot.Sources;
|
|
166
|
+
}
|
|
167
|
+
});
|
|
168
|
+
Object.defineProperty(exports, "StreamingMarkdown", {
|
|
169
|
+
enumerable: true,
|
|
170
|
+
get: function () {
|
|
171
|
+
return _streaming.StreamingMarkdown;
|
|
172
|
+
}
|
|
173
|
+
});
|
|
174
|
+
Object.defineProperty(exports, "Suggestion", {
|
|
175
|
+
enumerable: true,
|
|
176
|
+
get: function () {
|
|
177
|
+
return _chatbot.Suggestion;
|
|
178
|
+
}
|
|
179
|
+
});
|
|
180
|
+
Object.defineProperty(exports, "Tool", {
|
|
181
|
+
enumerable: true,
|
|
182
|
+
get: function () {
|
|
183
|
+
return _chatbot.Tool;
|
|
184
|
+
}
|
|
185
|
+
});
|
|
186
|
+
Object.defineProperty(exports, "ToolArgs", {
|
|
187
|
+
enumerable: true,
|
|
188
|
+
get: function () {
|
|
189
|
+
return _chatbot.ToolArgs;
|
|
190
|
+
}
|
|
191
|
+
});
|
|
192
|
+
Object.defineProperty(exports, "ToolHeader", {
|
|
193
|
+
enumerable: true,
|
|
194
|
+
get: function () {
|
|
195
|
+
return _chatbot.ToolHeader;
|
|
196
|
+
}
|
|
197
|
+
});
|
|
198
|
+
Object.defineProperty(exports, "ToolResult", {
|
|
199
|
+
enumerable: true,
|
|
200
|
+
get: function () {
|
|
201
|
+
return _chatbot.ToolResult;
|
|
202
|
+
}
|
|
203
|
+
});
|
|
204
|
+
Object.defineProperty(exports, "darkTheme", {
|
|
205
|
+
enumerable: true,
|
|
206
|
+
get: function () {
|
|
207
|
+
return _theme.darkTheme;
|
|
208
|
+
}
|
|
209
|
+
});
|
|
210
|
+
Object.defineProperty(exports, "lightTheme", {
|
|
211
|
+
enumerable: true,
|
|
212
|
+
get: function () {
|
|
213
|
+
return _theme.lightTheme;
|
|
214
|
+
}
|
|
215
|
+
});
|
|
216
|
+
Object.defineProperty(exports, "uiMessageToChatMessageData", {
|
|
217
|
+
enumerable: true,
|
|
218
|
+
get: function () {
|
|
219
|
+
return _chatbot.uiMessageToChatMessageData;
|
|
220
|
+
}
|
|
221
|
+
});
|
|
222
|
+
Object.defineProperty(exports, "useAIElementsTheme", {
|
|
223
|
+
enumerable: true,
|
|
224
|
+
get: function () {
|
|
225
|
+
return _theme.useAIElementsTheme;
|
|
226
|
+
}
|
|
227
|
+
});
|
|
228
|
+
Object.defineProperty(exports, "useAutoScroll", {
|
|
229
|
+
enumerable: true,
|
|
230
|
+
get: function () {
|
|
231
|
+
return _hooks.useAutoScroll;
|
|
232
|
+
}
|
|
233
|
+
});
|
|
234
|
+
Object.defineProperty(exports, "useClipboard", {
|
|
235
|
+
enumerable: true,
|
|
236
|
+
get: function () {
|
|
237
|
+
return _hooks.useClipboard;
|
|
238
|
+
}
|
|
239
|
+
});
|
|
240
|
+
Object.defineProperty(exports, "useCollapsible", {
|
|
241
|
+
enumerable: true,
|
|
242
|
+
get: function () {
|
|
243
|
+
return _hooks.useCollapsible;
|
|
244
|
+
}
|
|
245
|
+
});
|
|
246
|
+
Object.defineProperty(exports, "useStickToBottom", {
|
|
247
|
+
enumerable: true,
|
|
248
|
+
get: function () {
|
|
249
|
+
return _hooks.useStickToBottom;
|
|
250
|
+
}
|
|
251
|
+
});
|
|
252
|
+
var _theme = require("./theme");
|
|
253
|
+
var _primitives = require("./primitives");
|
|
254
|
+
var _streaming = require("./streaming");
|
|
255
|
+
var _hooks = require("./hooks");
|
|
256
|
+
var _chatbot = require("./chatbot");
|
|
257
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_theme","require","_primitives","_streaming","_hooks","_chatbot"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKA,IAAAA,MAAA,GAAAC,OAAA;AAiBA,IAAAC,WAAA,GAAAD,OAAA;AAiCA,IAAAE,UAAA,GAAAF,OAAA;AAIA,IAAAG,MAAA,GAAAH,OAAA;AAiBA,IAAAI,QAAA,GAAAJ,OAAA","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"type":"commonjs"}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.Badge = Badge;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _reactNative = require("react-native");
|
|
9
|
+
var _theme = require("../theme");
|
|
10
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
11
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
|
+
function getVariantStyles(variant, theme) {
|
|
13
|
+
const {
|
|
14
|
+
colors
|
|
15
|
+
} = theme;
|
|
16
|
+
switch (variant) {
|
|
17
|
+
case 'default':
|
|
18
|
+
return {
|
|
19
|
+
container: {
|
|
20
|
+
backgroundColor: colors.primary
|
|
21
|
+
},
|
|
22
|
+
text: {
|
|
23
|
+
color: colors.primaryForeground
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
case 'secondary':
|
|
27
|
+
return {
|
|
28
|
+
container: {
|
|
29
|
+
backgroundColor: colors.secondary
|
|
30
|
+
},
|
|
31
|
+
text: {
|
|
32
|
+
color: colors.secondaryForeground
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
case 'outline':
|
|
36
|
+
return {
|
|
37
|
+
container: {
|
|
38
|
+
backgroundColor: 'transparent',
|
|
39
|
+
borderWidth: 1,
|
|
40
|
+
borderColor: colors.border
|
|
41
|
+
},
|
|
42
|
+
text: {
|
|
43
|
+
color: colors.foreground
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
case 'destructive':
|
|
47
|
+
return {
|
|
48
|
+
container: {
|
|
49
|
+
backgroundColor: colors.destructive
|
|
50
|
+
},
|
|
51
|
+
text: {
|
|
52
|
+
color: colors.destructiveForeground
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
case 'success':
|
|
56
|
+
return {
|
|
57
|
+
container: {
|
|
58
|
+
backgroundColor: colors.success
|
|
59
|
+
},
|
|
60
|
+
text: {
|
|
61
|
+
color: colors.successForeground
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
case 'warning':
|
|
65
|
+
return {
|
|
66
|
+
container: {
|
|
67
|
+
backgroundColor: colors.warning
|
|
68
|
+
},
|
|
69
|
+
text: {
|
|
70
|
+
color: colors.warningForeground
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
function Badge({
|
|
76
|
+
variant = 'default',
|
|
77
|
+
children,
|
|
78
|
+
style
|
|
79
|
+
}) {
|
|
80
|
+
const theme = (0, _theme.useAIElementsTheme)();
|
|
81
|
+
const variantStyles = getVariantStyles(variant, theme);
|
|
82
|
+
const textStyle = {
|
|
83
|
+
...variantStyles.text,
|
|
84
|
+
fontSize: theme.typography.fontSize.xs,
|
|
85
|
+
fontWeight: theme.typography.fontWeight.semibold,
|
|
86
|
+
fontFamily: theme.typography.fontFamily,
|
|
87
|
+
// Intentionally no lineHeight override — on iOS, lineHeight much larger
|
|
88
|
+
// than fontSize creates a tall line box with the glyph sitting at the
|
|
89
|
+
// baseline, which looks pushed-down inside a short pill. Letting RN use
|
|
90
|
+
// the native font metrics + the container's `alignItems: center` gives
|
|
91
|
+
// proper vertical centering.
|
|
92
|
+
textAlignVertical: 'center',
|
|
93
|
+
// Android
|
|
94
|
+
includeFontPadding: false // Android — strip extra font padding
|
|
95
|
+
};
|
|
96
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
97
|
+
style: [styles.base, {
|
|
98
|
+
borderRadius: theme.radius.full
|
|
99
|
+
}, variantStyles.container, style],
|
|
100
|
+
children: typeof children === 'string' ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
101
|
+
style: textStyle,
|
|
102
|
+
children: children
|
|
103
|
+
}) : children
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
const styles = _reactNative.StyleSheet.create({
|
|
107
|
+
base: {
|
|
108
|
+
alignSelf: 'flex-start',
|
|
109
|
+
flexDirection: 'row',
|
|
110
|
+
alignItems: 'center',
|
|
111
|
+
justifyContent: 'center',
|
|
112
|
+
paddingHorizontal: 10,
|
|
113
|
+
paddingVertical: 3,
|
|
114
|
+
// Consistent pill height regardless of rendered font metrics — keeps
|
|
115
|
+
// every variant the same visual size even when text differs.
|
|
116
|
+
minHeight: 22
|
|
117
|
+
}
|
|
118
|
+
});
|
|
119
|
+
//# sourceMappingURL=Badge.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireDefault","require","_reactNative","_theme","_jsxRuntime","e","__esModule","default","getVariantStyles","variant","theme","colors","container","backgroundColor","primary","text","color","primaryForeground","secondary","secondaryForeground","borderWidth","borderColor","border","foreground","destructive","destructiveForeground","success","successForeground","warning","warningForeground","Badge","children","style","useAIElementsTheme","variantStyles","textStyle","fontSize","typography","xs","fontWeight","semibold","fontFamily","textAlignVertical","includeFontPadding","jsx","View","styles","base","borderRadius","radius","full","Text","StyleSheet","create","alignSelf","flexDirection","alignItems","justifyContent","paddingHorizontal","paddingVertical","minHeight"],"sourceRoot":"../../../src","sources":["primitives/Badge.tsx"],"mappings":"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","ignoreList":[]}
|