@wzh-/ai-chat-example 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.vscode/extensions.json +3 -0
- package/.vscode/settings.json +6 -0
- package/README.md +5 -0
- package/auto-imports.d.ts +73 -0
- package/components.d.ts +312 -0
- package/components.json +21 -0
- package/index.html +13 -0
- package/package.json +60 -0
- package/public/vite.svg +1 -0
- package/src/App.vue +68 -0
- package/src/components/ChatConversation/ChatConversation.vue +97 -0
- package/src/components/ChatConversation/index.ts +1 -0
- package/src/components/ChatPromptInputProvider/ChatPromptInputProvider.vue +47 -0
- package/src/components/ChatPromptInputProvider/index.ts +1 -0
- package/src/components/ai-elements/artifact/Artifact.vue +23 -0
- package/src/components/ai-elements/artifact/ArtifactAction.vue +72 -0
- package/src/components/ai-elements/artifact/ArtifactActions.vue +19 -0
- package/src/components/ai-elements/artifact/ArtifactClose.vue +39 -0
- package/src/components/ai-elements/artifact/ArtifactContent.vue +20 -0
- package/src/components/ai-elements/artifact/ArtifactDescription.vue +20 -0
- package/src/components/ai-elements/artifact/ArtifactHeader.vue +23 -0
- package/src/components/ai-elements/artifact/ArtifactTitle.vue +20 -0
- package/src/components/ai-elements/artifact/index.ts +8 -0
- package/src/components/ai-elements/canvas/Canvas.vue +37 -0
- package/src/components/ai-elements/canvas/index.ts +1 -0
- package/src/components/ai-elements/chain-of-thought/ChainOfThought.vue +41 -0
- package/src/components/ai-elements/chain-of-thought/ChainOfThoughtContent.vue +32 -0
- package/src/components/ai-elements/chain-of-thought/ChainOfThoughtHeader.vue +43 -0
- package/src/components/ai-elements/chain-of-thought/ChainOfThoughtImage.vue +25 -0
- package/src/components/ai-elements/chain-of-thought/ChainOfThoughtSearchResult.vue +24 -0
- package/src/components/ai-elements/chain-of-thought/ChainOfThoughtSearchResults.vue +17 -0
- package/src/components/ai-elements/chain-of-thought/ChainOfThoughtStep.vue +54 -0
- package/src/components/ai-elements/chain-of-thought/context.ts +22 -0
- package/src/components/ai-elements/chain-of-thought/index.ts +7 -0
- package/src/components/ai-elements/checkpoint/Checkpoint.vue +19 -0
- package/src/components/ai-elements/checkpoint/CheckpointIcon.vue +19 -0
- package/src/components/ai-elements/checkpoint/CheckpointTrigger.vue +46 -0
- package/src/components/ai-elements/checkpoint/index.ts +3 -0
- package/src/components/ai-elements/code-block/CodeBlock.vue +84 -0
- package/src/components/ai-elements/code-block/CodeBlockCopyButton.vue +84 -0
- package/src/components/ai-elements/code-block/context.ts +7 -0
- package/src/components/ai-elements/code-block/index.ts +2 -0
- package/src/components/ai-elements/code-block/utils.ts +46 -0
- package/src/components/ai-elements/confirmation/Confirmation.vue +30 -0
- package/src/components/ai-elements/confirmation/ConfirmationAccepted.vue +18 -0
- package/src/components/ai-elements/confirmation/ConfirmationAction.vue +9 -0
- package/src/components/ai-elements/confirmation/ConfirmationActions.vue +23 -0
- package/src/components/ai-elements/confirmation/ConfirmationRejected.vue +18 -0
- package/src/components/ai-elements/confirmation/ConfirmationRequest.vue +11 -0
- package/src/components/ai-elements/confirmation/ConfirmationTitle.vue +18 -0
- package/src/components/ai-elements/confirmation/context.ts +46 -0
- package/src/components/ai-elements/confirmation/index.ts +7 -0
- package/src/components/ai-elements/connection/Connection.vue +36 -0
- package/src/components/ai-elements/connection/index.ts +1 -0
- package/src/components/ai-elements/context/Context.vue +29 -0
- package/src/components/ai-elements/context/ContextCacheUsage.vue +45 -0
- package/src/components/ai-elements/context/ContextContent.vue +20 -0
- package/src/components/ai-elements/context/ContextContentBody.vue +14 -0
- package/src/components/ai-elements/context/ContextContentFooter.vue +49 -0
- package/src/components/ai-elements/context/ContextContentHeader.vue +49 -0
- package/src/components/ai-elements/context/ContextIcon.vue +62 -0
- package/src/components/ai-elements/context/ContextInputUsage.vue +46 -0
- package/src/components/ai-elements/context/ContextOutputUsage.vue +45 -0
- package/src/components/ai-elements/context/ContextReasoningUsage.vue +48 -0
- package/src/components/ai-elements/context/ContextTrigger.vue +32 -0
- package/src/components/ai-elements/context/TokensWithCost.vue +25 -0
- package/src/components/ai-elements/context/context.ts +23 -0
- package/src/components/ai-elements/context/index.ts +12 -0
- package/src/components/ai-elements/controls/Controls.vue +25 -0
- package/src/components/ai-elements/controls/index.ts +1 -0
- package/src/components/ai-elements/conversation/Conversation.vue +37 -0
- package/src/components/ai-elements/conversation/ConversationContent.vue +21 -0
- package/src/components/ai-elements/conversation/ConversationEmptyState.vue +40 -0
- package/src/components/ai-elements/conversation/ConversationScrollButton.vue +34 -0
- package/src/components/ai-elements/conversation/index.ts +4 -0
- package/src/components/ai-elements/edge/Animated.vue +91 -0
- package/src/components/ai-elements/edge/Temporary.vue +28 -0
- package/src/components/ai-elements/edge/index.ts +2 -0
- package/src/components/ai-elements/image/Image.vue +29 -0
- package/src/components/ai-elements/image/index.ts +1 -0
- package/src/components/ai-elements/inline-citation/InlineCitation.vue +14 -0
- package/src/components/ai-elements/inline-citation/InlineCitationCard.vue +17 -0
- package/src/components/ai-elements/inline-citation/InlineCitationCardBody.vue +15 -0
- package/src/components/ai-elements/inline-citation/InlineCitationCardTrigger.vue +35 -0
- package/src/components/ai-elements/inline-citation/InlineCitationCarousel.vue +15 -0
- package/src/components/ai-elements/inline-citation/InlineCitationCarouselContent.vue +9 -0
- package/src/components/ai-elements/inline-citation/InlineCitationCarouselHeader.vue +16 -0
- package/src/components/ai-elements/inline-citation/InlineCitationCarouselIndex.vue +46 -0
- package/src/components/ai-elements/inline-citation/InlineCitationCarouselItem.vue +15 -0
- package/src/components/ai-elements/inline-citation/InlineCitationCarouselNext.vue +23 -0
- package/src/components/ai-elements/inline-citation/InlineCitationCarouselPrev.vue +23 -0
- package/src/components/ai-elements/inline-citation/InlineCitationQuote.vue +16 -0
- package/src/components/ai-elements/inline-citation/InlineCitationSource.vue +26 -0
- package/src/components/ai-elements/inline-citation/InlineCitationText.vue +14 -0
- package/src/components/ai-elements/inline-citation/index.ts +14 -0
- package/src/components/ai-elements/loader/Loader.vue +23 -0
- package/src/components/ai-elements/loader/LoaderIcon.vue +38 -0
- package/src/components/ai-elements/loader/index.ts +2 -0
- package/src/components/ai-elements/message/Message.vue +27 -0
- package/src/components/ai-elements/message/MessageAction.vue +45 -0
- package/src/components/ai-elements/message/MessageActions.vue +19 -0
- package/src/components/ai-elements/message/MessageAttachment.vue +87 -0
- package/src/components/ai-elements/message/MessageAttachments.vue +25 -0
- package/src/components/ai-elements/message/MessageAvatar.vue +22 -0
- package/src/components/ai-elements/message/MessageBranch.vue +66 -0
- package/src/components/ai-elements/message/MessageBranchContent.vue +51 -0
- package/src/components/ai-elements/message/MessageBranchNext.vue +23 -0
- package/src/components/ai-elements/message/MessageBranchPage.vue +28 -0
- package/src/components/ai-elements/message/MessageBranchPrevious.vue +23 -0
- package/src/components/ai-elements/message/MessageBranchSelector.vue +23 -0
- package/src/components/ai-elements/message/MessageContent.vue +26 -0
- package/src/components/ai-elements/message/MessageResponse.vue +42 -0
- package/src/components/ai-elements/message/MessageToolbar.vue +24 -0
- package/src/components/ai-elements/message/context.ts +22 -0
- package/src/components/ai-elements/message/index.ts +15 -0
- package/src/components/ai-elements/model-selector/ModelSelector.vue +9 -0
- package/src/components/ai-elements/model-selector/ModelSelectorContent.vue +29 -0
- package/src/components/ai-elements/model-selector/ModelSelectorDialog.vue +9 -0
- package/src/components/ai-elements/model-selector/ModelSelectorEmpty.vue +9 -0
- package/src/components/ai-elements/model-selector/ModelSelectorGroup.vue +9 -0
- package/src/components/ai-elements/model-selector/ModelSelectorInput.vue +18 -0
- package/src/components/ai-elements/model-selector/ModelSelectorItem.vue +10 -0
- package/src/components/ai-elements/model-selector/ModelSelectorList.vue +9 -0
- package/src/components/ai-elements/model-selector/ModelSelectorLogo.vue +22 -0
- package/src/components/ai-elements/model-selector/ModelSelectorLogoGroup.vue +24 -0
- package/src/components/ai-elements/model-selector/ModelSelectorName.vue +19 -0
- package/src/components/ai-elements/model-selector/ModelSelectorSeparator.vue +7 -0
- package/src/components/ai-elements/model-selector/ModelSelectorShortcut.vue +9 -0
- package/src/components/ai-elements/model-selector/ModelSelectorTrigger.vue +9 -0
- package/src/components/ai-elements/model-selector/index.ts +14 -0
- package/src/components/ai-elements/node/Node.vue +31 -0
- package/src/components/ai-elements/node/NodeAction.vue +9 -0
- package/src/components/ai-elements/node/NodeContent.vue +15 -0
- package/src/components/ai-elements/node/NodeDescription.vue +9 -0
- package/src/components/ai-elements/node/NodeFooter.vue +15 -0
- package/src/components/ai-elements/node/NodeHeader.vue +15 -0
- package/src/components/ai-elements/node/NodeTitle.vue +9 -0
- package/src/components/ai-elements/node/index.ts +7 -0
- package/src/components/ai-elements/open-in-chat/OpenIn.vue +20 -0
- package/src/components/ai-elements/open-in-chat/OpenInContent.vue +25 -0
- package/src/components/ai-elements/open-in-chat/OpenInItemLink.vue +30 -0
- package/src/components/ai-elements/open-in-chat/OpenInTrigger.vue +16 -0
- package/src/components/ai-elements/open-in-chat/context.ts +20 -0
- package/src/components/ai-elements/open-in-chat/index.ts +9 -0
- package/src/components/ai-elements/open-in-chat/providers/icons/ChatGPT.vue +13 -0
- package/src/components/ai-elements/open-in-chat/providers/icons/Claude.vue +15 -0
- package/src/components/ai-elements/open-in-chat/providers/icons/Cursor.vue +13 -0
- package/src/components/ai-elements/open-in-chat/providers/icons/Github.vue +8 -0
- package/src/components/ai-elements/open-in-chat/providers/icons/Scira.vue +58 -0
- package/src/components/ai-elements/open-in-chat/providers/icons/V0.vue +15 -0
- package/src/components/ai-elements/open-in-chat/providers/icons/index.ts +6 -0
- package/src/components/ai-elements/open-in-chat/providers/index.ts +69 -0
- package/src/components/ai-elements/open-in-chat/providers/items/OpenInChatGPT.vue +18 -0
- package/src/components/ai-elements/open-in-chat/providers/items/OpenInClaude.vue +18 -0
- package/src/components/ai-elements/open-in-chat/providers/items/OpenInCursor.vue +18 -0
- package/src/components/ai-elements/open-in-chat/providers/items/OpenInScira.vue +18 -0
- package/src/components/ai-elements/open-in-chat/providers/items/OpenInT3.vue +18 -0
- package/src/components/ai-elements/open-in-chat/providers/items/OpenInv0.vue +18 -0
- package/src/components/ai-elements/panel/Panel.vue +28 -0
- package/src/components/ai-elements/panel/index.ts +1 -0
- package/src/components/ai-elements/plan/Plan.vue +32 -0
- package/src/components/ai-elements/plan/PlanAction.vue +9 -0
- package/src/components/ai-elements/plan/PlanContent.vue +12 -0
- package/src/components/ai-elements/plan/PlanDescription.vue +25 -0
- package/src/components/ai-elements/plan/PlanFooter.vue +9 -0
- package/src/components/ai-elements/plan/PlanHeader.vue +18 -0
- package/src/components/ai-elements/plan/PlanTitle.vue +16 -0
- package/src/components/ai-elements/plan/PlanTrigger.vue +25 -0
- package/src/components/ai-elements/plan/context.ts +20 -0
- package/src/components/ai-elements/plan/index.ts +8 -0
- package/src/components/ai-elements/prompt-input/PromptInput.vue +116 -0
- package/src/components/ai-elements/prompt-input/PromptInputActionAddAttachments.vue +22 -0
- package/src/components/ai-elements/prompt-input/PromptInputActionMenu.vue +15 -0
- package/src/components/ai-elements/prompt-input/PromptInputActionMenuContent.vue +21 -0
- package/src/components/ai-elements/prompt-input/PromptInputActionMenuItem.vue +19 -0
- package/src/components/ai-elements/prompt-input/PromptInputActionMenuTrigger.vue +22 -0
- package/src/components/ai-elements/prompt-input/PromptInputAttachment.vue +94 -0
- package/src/components/ai-elements/prompt-input/PromptInputAttachments.vue +22 -0
- package/src/components/ai-elements/prompt-input/PromptInputBody.vue +12 -0
- package/src/components/ai-elements/prompt-input/PromptInputButton.vue +56 -0
- package/src/components/ai-elements/prompt-input/PromptInputCommand.vue +19 -0
- package/src/components/ai-elements/prompt-input/PromptInputCommandEmpty.vue +19 -0
- package/src/components/ai-elements/prompt-input/PromptInputCommandGroup.vue +19 -0
- package/src/components/ai-elements/prompt-input/PromptInputCommandInput.vue +17 -0
- package/src/components/ai-elements/prompt-input/PromptInputCommandItem.vue +19 -0
- package/src/components/ai-elements/prompt-input/PromptInputCommandList.vue +17 -0
- package/src/components/ai-elements/prompt-input/PromptInputCommandSeparator.vue +16 -0
- package/src/components/ai-elements/prompt-input/PromptInputFooter.vue +23 -0
- package/src/components/ai-elements/prompt-input/PromptInputHeader.vue +23 -0
- package/src/components/ai-elements/prompt-input/PromptInputHoverCard.vue +23 -0
- package/src/components/ai-elements/prompt-input/PromptInputHoverCardContent.vue +19 -0
- package/src/components/ai-elements/prompt-input/PromptInputHoverCardTrigger.vue +15 -0
- package/src/components/ai-elements/prompt-input/PromptInputProvider.vue +32 -0
- package/src/components/ai-elements/prompt-input/PromptInputSelect.vue +15 -0
- package/src/components/ai-elements/prompt-input/PromptInputSelectContent.vue +19 -0
- package/src/components/ai-elements/prompt-input/PromptInputSelectItem.vue +19 -0
- package/src/components/ai-elements/prompt-input/PromptInputSelectTrigger.vue +26 -0
- package/src/components/ai-elements/prompt-input/PromptInputSelectValue.vue +19 -0
- package/src/components/ai-elements/prompt-input/PromptInputSpeechButton.vue +137 -0
- package/src/components/ai-elements/prompt-input/PromptInputSubmit.vue +60 -0
- package/src/components/ai-elements/prompt-input/PromptInputTab.vue +16 -0
- package/src/components/ai-elements/prompt-input/PromptInputTabBody.vue +16 -0
- package/src/components/ai-elements/prompt-input/PromptInputTabItem.vue +16 -0
- package/src/components/ai-elements/prompt-input/PromptInputTabLabel.vue +16 -0
- package/src/components/ai-elements/prompt-input/PromptInputTabsList.vue +16 -0
- package/src/components/ai-elements/prompt-input/PromptInputTextarea.vue +78 -0
- package/src/components/ai-elements/prompt-input/PromptInputTools.vue +12 -0
- package/src/components/ai-elements/prompt-input/context.ts +223 -0
- package/src/components/ai-elements/prompt-input/index.ts +39 -0
- package/src/components/ai-elements/prompt-input/types.ts +28 -0
- package/src/components/ai-elements/queue/Queue.vue +21 -0
- package/src/components/ai-elements/queue/QueueItem.vue +21 -0
- package/src/components/ai-elements/queue/QueueItemAction.vue +25 -0
- package/src/components/ai-elements/queue/QueueItemActions.vue +14 -0
- package/src/components/ai-elements/queue/QueueItemAttachment.vue +14 -0
- package/src/components/ai-elements/queue/QueueItemContent.vue +32 -0
- package/src/components/ai-elements/queue/QueueItemDescription.vue +32 -0
- package/src/components/ai-elements/queue/QueueItemFile.vue +25 -0
- package/src/components/ai-elements/queue/QueueItemImage.vue +18 -0
- package/src/components/ai-elements/queue/QueueItemIndicator.vue +30 -0
- package/src/components/ai-elements/queue/QueueList.vue +22 -0
- package/src/components/ai-elements/queue/QueueSection.vue +26 -0
- package/src/components/ai-elements/queue/QueueSectionContent.vue +15 -0
- package/src/components/ai-elements/queue/QueueSectionLabel.vue +26 -0
- package/src/components/ai-elements/queue/QueueSectionTrigger.vue +25 -0
- package/src/components/ai-elements/queue/index.ts +15 -0
- package/src/components/ai-elements/reasoning/Reasoning.vue +94 -0
- package/src/components/ai-elements/reasoning/ReasoningContent.vue +41 -0
- package/src/components/ai-elements/reasoning/ReasoningTrigger.vue +61 -0
- package/src/components/ai-elements/reasoning/context.ts +19 -0
- package/src/components/ai-elements/reasoning/index.ts +3 -0
- package/src/components/ai-elements/shimmer/Shimmer.vue +69 -0
- package/src/components/ai-elements/shimmer/index.ts +1 -0
- package/src/components/ai-elements/sources/Source.vue +26 -0
- package/src/components/ai-elements/sources/Sources.vue +17 -0
- package/src/components/ai-elements/sources/SourcesContent.vue +23 -0
- package/src/components/ai-elements/sources/SourcesTrigger.vue +24 -0
- package/src/components/ai-elements/sources/index.ts +4 -0
- package/src/components/ai-elements/suggestion/Suggestion.vue +38 -0
- package/src/components/ai-elements/suggestion/Suggestions.vue +20 -0
- package/src/components/ai-elements/suggestion/index.ts +2 -0
- package/src/components/ai-elements/task/Task.vue +32 -0
- package/src/components/ai-elements/task/TaskContent.vue +27 -0
- package/src/components/ai-elements/task/TaskItem.vue +16 -0
- package/src/components/ai-elements/task/TaskItemFile.vue +18 -0
- package/src/components/ai-elements/task/TaskTrigger.vue +33 -0
- package/src/components/ai-elements/task/index.ts +5 -0
- package/src/components/ai-elements/tool/Tool.vue +18 -0
- package/src/components/ai-elements/tool/ToolContent.vue +23 -0
- package/src/components/ai-elements/tool/ToolHeader.vue +38 -0
- package/src/components/ai-elements/tool/ToolInput.vue +32 -0
- package/src/components/ai-elements/tool/ToolOutput.vue +69 -0
- package/src/components/ai-elements/tool/ToolStatusBadge.vue +63 -0
- package/src/components/ai-elements/tool/index.ts +5 -0
- package/src/components/ai-elements/toolbar/Toolbar.vue +32 -0
- package/src/components/ai-elements/toolbar/index.ts +1 -0
- package/src/components/ai-elements/web-preview/WebPreview.vue +60 -0
- package/src/components/ai-elements/web-preview/WebPreviewBody.vue +34 -0
- package/src/components/ai-elements/web-preview/WebPreviewConsole.vue +92 -0
- package/src/components/ai-elements/web-preview/WebPreviewNavigation.vue +21 -0
- package/src/components/ai-elements/web-preview/WebPreviewNavigationButton.vue +45 -0
- package/src/components/ai-elements/web-preview/WebPreviewUrl.vue +43 -0
- package/src/components/ai-elements/web-preview/context.ts +25 -0
- package/src/components/ai-elements/web-preview/index.ts +7 -0
- package/src/components/ui/alert/Alert.vue +21 -0
- package/src/components/ui/alert/AlertDescription.vue +17 -0
- package/src/components/ui/alert/AlertTitle.vue +17 -0
- package/src/components/ui/alert/index.ts +24 -0
- package/src/components/ui/avatar/Avatar.vue +18 -0
- package/src/components/ui/avatar/AvatarFallback.vue +21 -0
- package/src/components/ui/avatar/AvatarImage.vue +16 -0
- package/src/components/ui/avatar/index.ts +3 -0
- package/src/components/ui/badge/Badge.vue +26 -0
- package/src/components/ui/badge/index.ts +26 -0
- package/src/components/ui/button/Button.vue +29 -0
- package/src/components/ui/button/index.ts +38 -0
- package/src/components/ui/button-group/ButtonGroup.vue +22 -0
- package/src/components/ui/button-group/ButtonGroupSeparator.vue +24 -0
- package/src/components/ui/button-group/ButtonGroupText.vue +29 -0
- package/src/components/ui/button-group/index.ts +25 -0
- package/src/components/ui/card/Card.vue +22 -0
- package/src/components/ui/card/CardAction.vue +17 -0
- package/src/components/ui/card/CardContent.vue +17 -0
- package/src/components/ui/card/CardDescription.vue +17 -0
- package/src/components/ui/card/CardFooter.vue +17 -0
- package/src/components/ui/card/CardHeader.vue +17 -0
- package/src/components/ui/card/CardTitle.vue +17 -0
- package/src/components/ui/card/index.ts +7 -0
- package/src/components/ui/carousel/Carousel.vue +53 -0
- package/src/components/ui/carousel/CarouselContent.vue +33 -0
- package/src/components/ui/carousel/CarouselItem.vue +24 -0
- package/src/components/ui/carousel/CarouselNext.vue +41 -0
- package/src/components/ui/carousel/CarouselPrevious.vue +41 -0
- package/src/components/ui/carousel/index.ts +10 -0
- package/src/components/ui/carousel/interface.ts +26 -0
- package/src/components/ui/carousel/useCarousel.ts +56 -0
- package/src/components/ui/collapsible/Collapsible.vue +19 -0
- package/src/components/ui/collapsible/CollapsibleContent.vue +15 -0
- package/src/components/ui/collapsible/CollapsibleTrigger.vue +15 -0
- package/src/components/ui/collapsible/index.ts +3 -0
- package/src/components/ui/command/Command.vue +87 -0
- package/src/components/ui/command/CommandDialog.vue +31 -0
- package/src/components/ui/command/CommandEmpty.vue +27 -0
- package/src/components/ui/command/CommandGroup.vue +45 -0
- package/src/components/ui/command/CommandInput.vue +39 -0
- package/src/components/ui/command/CommandItem.vue +76 -0
- package/src/components/ui/command/CommandList.vue +25 -0
- package/src/components/ui/command/CommandSeparator.vue +21 -0
- package/src/components/ui/command/CommandShortcut.vue +17 -0
- package/src/components/ui/command/index.ts +25 -0
- package/src/components/ui/dialog/Dialog.vue +19 -0
- package/src/components/ui/dialog/DialogClose.vue +15 -0
- package/src/components/ui/dialog/DialogContent.vue +53 -0
- package/src/components/ui/dialog/DialogDescription.vue +23 -0
- package/src/components/ui/dialog/DialogFooter.vue +15 -0
- package/src/components/ui/dialog/DialogHeader.vue +17 -0
- package/src/components/ui/dialog/DialogOverlay.vue +21 -0
- package/src/components/ui/dialog/DialogScrollContent.vue +59 -0
- package/src/components/ui/dialog/DialogTitle.vue +23 -0
- package/src/components/ui/dialog/DialogTrigger.vue +15 -0
- package/src/components/ui/dialog/index.ts +10 -0
- package/src/components/ui/dropdown-menu/DropdownMenu.vue +19 -0
- package/src/components/ui/dropdown-menu/DropdownMenuCheckboxItem.vue +39 -0
- package/src/components/ui/dropdown-menu/DropdownMenuContent.vue +39 -0
- package/src/components/ui/dropdown-menu/DropdownMenuGroup.vue +15 -0
- package/src/components/ui/dropdown-menu/DropdownMenuItem.vue +31 -0
- package/src/components/ui/dropdown-menu/DropdownMenuLabel.vue +23 -0
- package/src/components/ui/dropdown-menu/DropdownMenuRadioGroup.vue +21 -0
- package/src/components/ui/dropdown-menu/DropdownMenuRadioItem.vue +40 -0
- package/src/components/ui/dropdown-menu/DropdownMenuSeparator.vue +23 -0
- package/src/components/ui/dropdown-menu/DropdownMenuShortcut.vue +17 -0
- package/src/components/ui/dropdown-menu/DropdownMenuSub.vue +18 -0
- package/src/components/ui/dropdown-menu/DropdownMenuSubContent.vue +27 -0
- package/src/components/ui/dropdown-menu/DropdownMenuSubTrigger.vue +30 -0
- package/src/components/ui/dropdown-menu/DropdownMenuTrigger.vue +17 -0
- package/src/components/ui/dropdown-menu/index.ts +16 -0
- package/src/components/ui/hover-card/HoverCard.vue +19 -0
- package/src/components/ui/hover-card/HoverCardContent.vue +43 -0
- package/src/components/ui/hover-card/HoverCardTrigger.vue +15 -0
- package/src/components/ui/hover-card/index.ts +3 -0
- package/src/components/ui/input/Input.vue +33 -0
- package/src/components/ui/input/index.ts +1 -0
- package/src/components/ui/input-group/InputGroup.vue +37 -0
- package/src/components/ui/input-group/InputGroupAddon.vue +36 -0
- package/src/components/ui/input-group/InputGroupButton.vue +21 -0
- package/src/components/ui/input-group/InputGroupInput.vue +19 -0
- package/src/components/ui/input-group/InputGroupText.vue +19 -0
- package/src/components/ui/input-group/InputGroupTextarea.vue +19 -0
- package/src/components/ui/input-group/index.ts +59 -0
- package/src/components/ui/progress/Progress.vue +38 -0
- package/src/components/ui/progress/index.ts +1 -0
- package/src/components/ui/scroll-area/ScrollArea.vue +33 -0
- package/src/components/ui/scroll-area/ScrollBar.vue +32 -0
- package/src/components/ui/scroll-area/index.ts +2 -0
- package/src/components/ui/select/Select.vue +19 -0
- package/src/components/ui/select/SelectContent.vue +51 -0
- package/src/components/ui/select/SelectGroup.vue +15 -0
- package/src/components/ui/select/SelectItem.vue +44 -0
- package/src/components/ui/select/SelectItemText.vue +15 -0
- package/src/components/ui/select/SelectLabel.vue +17 -0
- package/src/components/ui/select/SelectScrollDownButton.vue +26 -0
- package/src/components/ui/select/SelectScrollUpButton.vue +26 -0
- package/src/components/ui/select/SelectSeparator.vue +19 -0
- package/src/components/ui/select/SelectTrigger.vue +33 -0
- package/src/components/ui/select/SelectValue.vue +15 -0
- package/src/components/ui/select/index.ts +11 -0
- package/src/components/ui/separator/Separator.vue +29 -0
- package/src/components/ui/separator/index.ts +1 -0
- package/src/components/ui/textarea/Textarea.vue +28 -0
- package/src/components/ui/textarea/index.ts +1 -0
- package/src/components/ui/tooltip/Tooltip.vue +19 -0
- package/src/components/ui/tooltip/TooltipContent.vue +34 -0
- package/src/components/ui/tooltip/TooltipProvider.vue +14 -0
- package/src/components/ui/tooltip/TooltipTrigger.vue +15 -0
- package/src/components/ui/tooltip/index.ts +4 -0
- package/src/composables/useChat.ts +46 -0
- package/src/index.ts +3 -0
- package/src/lib/utils.ts +7 -0
- package/src/main.ts +5 -0
- package/src/request/index.ts +41 -0
- package/src/style.css +120 -0
- package/tsconfig.app.json +25 -0
- package/tsconfig.json +13 -0
- package/tsconfig.node.json +26 -0
- package/vite.config.ts +26 -0
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { EdgeProps, GraphNode, HandleElement } from '@vue-flow/core'
|
|
3
|
+
import { BaseEdge, getBezierPath, Position } from '@vue-flow/core'
|
|
4
|
+
import { computed } from 'vue'
|
|
5
|
+
|
|
6
|
+
const props = defineProps<EdgeProps>()
|
|
7
|
+
|
|
8
|
+
function getHandleCoordsByPosition(node: GraphNode, handlePosition: Position): readonly [number, number] {
|
|
9
|
+
// Choose the handle type based on position - Left is for target, Right is for source
|
|
10
|
+
const handleType: HandleElement['type'] = handlePosition === Position.Left ? 'target' : 'source'
|
|
11
|
+
|
|
12
|
+
const handle = node.handleBounds?.[handleType]?.find(
|
|
13
|
+
h => h.position === handlePosition,
|
|
14
|
+
)
|
|
15
|
+
|
|
16
|
+
if (!handle)
|
|
17
|
+
return [0, 0] as const
|
|
18
|
+
|
|
19
|
+
let offsetX = handle.width / 2
|
|
20
|
+
let offsetY = handle.height / 2
|
|
21
|
+
|
|
22
|
+
// this is a tiny detail to make the markerEnd of an edge visible.
|
|
23
|
+
// The handle position that gets calculated has the origin top-left, so depending which side we are using, we add a little offset
|
|
24
|
+
// when the handlePosition is Position.Right for example, we need to add an offset as big as the handle itself in order to get the correct position
|
|
25
|
+
switch (handlePosition) {
|
|
26
|
+
case Position.Left:
|
|
27
|
+
offsetX = 0
|
|
28
|
+
break
|
|
29
|
+
case Position.Right:
|
|
30
|
+
offsetX = handle.width
|
|
31
|
+
break
|
|
32
|
+
case Position.Top:
|
|
33
|
+
offsetY = 0
|
|
34
|
+
break
|
|
35
|
+
case Position.Bottom:
|
|
36
|
+
offsetY = handle.height
|
|
37
|
+
break
|
|
38
|
+
default:
|
|
39
|
+
throw new Error(`Invalid handle position: ${handlePosition}`)
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
const x = node.computedPosition.x + handle.x + offsetX
|
|
43
|
+
const y = node.computedPosition.y + handle.y + offsetY
|
|
44
|
+
|
|
45
|
+
return [x, y] as const
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
function getEdgeParams(source: GraphNode, target: GraphNode) {
|
|
49
|
+
const sourcePos = Position.Right
|
|
50
|
+
const [sx, sy] = getHandleCoordsByPosition(source, sourcePos)
|
|
51
|
+
const targetPos = Position.Left
|
|
52
|
+
const [tx, ty] = getHandleCoordsByPosition(target, targetPos)
|
|
53
|
+
return { sx, sy, tx, ty, sourcePos, targetPos }
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
const path = computed(() => {
|
|
57
|
+
const sourceNode = props.sourceNode
|
|
58
|
+
const targetNode = props.targetNode
|
|
59
|
+
if (!sourceNode || !targetNode)
|
|
60
|
+
return ''
|
|
61
|
+
|
|
62
|
+
const { sx, sy, tx, ty, sourcePos, targetPos } = getEdgeParams(
|
|
63
|
+
sourceNode,
|
|
64
|
+
targetNode,
|
|
65
|
+
)
|
|
66
|
+
|
|
67
|
+
const [edgePath] = getBezierPath({
|
|
68
|
+
sourceX: sx,
|
|
69
|
+
sourceY: sy,
|
|
70
|
+
sourcePosition: sourcePos,
|
|
71
|
+
targetX: tx,
|
|
72
|
+
targetY: ty,
|
|
73
|
+
targetPosition: targetPos,
|
|
74
|
+
})
|
|
75
|
+
return edgePath
|
|
76
|
+
})
|
|
77
|
+
</script>
|
|
78
|
+
|
|
79
|
+
<template>
|
|
80
|
+
<g v-if="path">
|
|
81
|
+
<BaseEdge
|
|
82
|
+
:id="props.id"
|
|
83
|
+
:marker-end="markerEnd"
|
|
84
|
+
:path="path"
|
|
85
|
+
:style="style"
|
|
86
|
+
/>
|
|
87
|
+
<circle fill="var(--primary)" r="4">
|
|
88
|
+
<animateMotion dur="2s" :path="path" repeatCount="indefinite" />
|
|
89
|
+
</circle>
|
|
90
|
+
</g>
|
|
91
|
+
</template>
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { EdgeProps } from '@vue-flow/core'
|
|
3
|
+
import { BaseEdge, getSimpleBezierPath } from '@vue-flow/core'
|
|
4
|
+
import { computed } from 'vue'
|
|
5
|
+
|
|
6
|
+
const props = defineProps<EdgeProps>()
|
|
7
|
+
|
|
8
|
+
const path = computed(() => {
|
|
9
|
+
const [edgePath] = getSimpleBezierPath({
|
|
10
|
+
sourceX: props.sourceX,
|
|
11
|
+
sourceY: props.sourceY,
|
|
12
|
+
sourcePosition: props.sourcePosition,
|
|
13
|
+
targetX: props.targetX,
|
|
14
|
+
targetY: props.targetY,
|
|
15
|
+
targetPosition: props.targetPosition,
|
|
16
|
+
})
|
|
17
|
+
return edgePath
|
|
18
|
+
})
|
|
19
|
+
</script>
|
|
20
|
+
|
|
21
|
+
<template>
|
|
22
|
+
<BaseEdge
|
|
23
|
+
:id="props.id"
|
|
24
|
+
:path="path"
|
|
25
|
+
class="stroke-1 stroke-ring"
|
|
26
|
+
:style="{ strokeDasharray: '5, 5' }"
|
|
27
|
+
/>
|
|
28
|
+
</template>
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { Experimental_GeneratedImage } from 'ai'
|
|
3
|
+
import type { HTMLAttributes } from 'vue'
|
|
4
|
+
import { cn } from '@/lib/utils'
|
|
5
|
+
import { computed } from 'vue'
|
|
6
|
+
|
|
7
|
+
interface Props extends Experimental_GeneratedImage {
|
|
8
|
+
class?: HTMLAttributes['class']
|
|
9
|
+
alt?: string
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
const props = defineProps<Props>()
|
|
13
|
+
|
|
14
|
+
const classes = computed(() => cn(
|
|
15
|
+
'h-auto max-w-full overflow-hidden rounded-md',
|
|
16
|
+
props.class,
|
|
17
|
+
))
|
|
18
|
+
|
|
19
|
+
const src = computed(() => `data:${props.mediaType};base64,${props.base64}`)
|
|
20
|
+
</script>
|
|
21
|
+
|
|
22
|
+
<template>
|
|
23
|
+
<img
|
|
24
|
+
:alt="props.alt"
|
|
25
|
+
:class="classes"
|
|
26
|
+
:src="src"
|
|
27
|
+
v-bind="$attrs"
|
|
28
|
+
>
|
|
29
|
+
</template>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Image } from './Image.vue'
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { HTMLAttributes } from 'vue'
|
|
3
|
+
import { cn } from '@/lib/utils'
|
|
4
|
+
|
|
5
|
+
const props = defineProps<{
|
|
6
|
+
class?: HTMLAttributes['class']
|
|
7
|
+
}>()
|
|
8
|
+
</script>
|
|
9
|
+
|
|
10
|
+
<template>
|
|
11
|
+
<span :class="cn('group inline items-center gap-1', props.class)">
|
|
12
|
+
<slot />
|
|
13
|
+
</span>
|
|
14
|
+
</template>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { HoverCard } from '@/components/ui/hover-card'
|
|
3
|
+
|
|
4
|
+
const props = withDefaults(defineProps<{
|
|
5
|
+
closeDelay?: number
|
|
6
|
+
openDelay?: number
|
|
7
|
+
}>(), {
|
|
8
|
+
closeDelay: 0,
|
|
9
|
+
openDelay: 0,
|
|
10
|
+
})
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
<template>
|
|
14
|
+
<HoverCard :close-delay="props.closeDelay" :open-delay="props.openDelay">
|
|
15
|
+
<slot />
|
|
16
|
+
</HoverCard>
|
|
17
|
+
</template>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { HTMLAttributes } from 'vue'
|
|
3
|
+
import { HoverCardContent } from '@/components/ui/hover-card'
|
|
4
|
+
import { cn } from '@/lib/utils'
|
|
5
|
+
|
|
6
|
+
const props = defineProps<{
|
|
7
|
+
class?: HTMLAttributes['class']
|
|
8
|
+
}>()
|
|
9
|
+
</script>
|
|
10
|
+
|
|
11
|
+
<template>
|
|
12
|
+
<HoverCardContent :class="cn('relative w-80 p-0', props.class)">
|
|
13
|
+
<slot />
|
|
14
|
+
</HoverCardContent>
|
|
15
|
+
</template>
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { HTMLAttributes } from 'vue'
|
|
3
|
+
import { Badge } from '@/components/ui/badge'
|
|
4
|
+
import { HoverCardTrigger } from '@/components/ui/hover-card'
|
|
5
|
+
import { cn } from '@/lib/utils'
|
|
6
|
+
import { computed } from 'vue'
|
|
7
|
+
|
|
8
|
+
const props = defineProps<{
|
|
9
|
+
sources: string[]
|
|
10
|
+
class?: HTMLAttributes['class']
|
|
11
|
+
}>()
|
|
12
|
+
|
|
13
|
+
const displayText = computed(() => {
|
|
14
|
+
const firstSource = props.sources[0]
|
|
15
|
+
if (!firstSource)
|
|
16
|
+
return 'unknown'
|
|
17
|
+
|
|
18
|
+
try {
|
|
19
|
+
const hostname = new URL(firstSource).hostname
|
|
20
|
+
const additionalCount = props.sources.length - 1
|
|
21
|
+
return additionalCount > 0 ? `${hostname} +${additionalCount}` : hostname
|
|
22
|
+
}
|
|
23
|
+
catch {
|
|
24
|
+
return 'unknown'
|
|
25
|
+
}
|
|
26
|
+
})
|
|
27
|
+
</script>
|
|
28
|
+
|
|
29
|
+
<template>
|
|
30
|
+
<HoverCardTrigger as-child>
|
|
31
|
+
<Badge :class="cn('ml-1 rounded-full', props.class)" variant="secondary">
|
|
32
|
+
{{ displayText }}
|
|
33
|
+
</Badge>
|
|
34
|
+
</HoverCardTrigger>
|
|
35
|
+
</template>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { HTMLAttributes } from 'vue'
|
|
3
|
+
import { Carousel } from '@/components/ui/carousel'
|
|
4
|
+
import { cn } from '@/lib/utils'
|
|
5
|
+
|
|
6
|
+
const props = defineProps<{
|
|
7
|
+
class?: HTMLAttributes['class']
|
|
8
|
+
}>()
|
|
9
|
+
</script>
|
|
10
|
+
|
|
11
|
+
<template>
|
|
12
|
+
<Carousel :class="cn('w-full', props.class)">
|
|
13
|
+
<slot />
|
|
14
|
+
</Carousel>
|
|
15
|
+
</template>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { HTMLAttributes } from 'vue'
|
|
3
|
+
import { cn } from '@/lib/utils'
|
|
4
|
+
|
|
5
|
+
const props = defineProps<{
|
|
6
|
+
class?: HTMLAttributes['class']
|
|
7
|
+
}>()
|
|
8
|
+
</script>
|
|
9
|
+
|
|
10
|
+
<template>
|
|
11
|
+
<div
|
|
12
|
+
:class="cn('flex items-center justify-between gap-2 rounded-t-md bg-secondary p-2', props.class)"
|
|
13
|
+
>
|
|
14
|
+
<slot />
|
|
15
|
+
</div>
|
|
16
|
+
</template>
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { HTMLAttributes } from 'vue'
|
|
3
|
+
import { useCarousel } from '@/components/ui/carousel'
|
|
4
|
+
import { cn } from '@/lib/utils'
|
|
5
|
+
import { computed, nextTick, ref, watch } from 'vue'
|
|
6
|
+
|
|
7
|
+
const props = defineProps<{
|
|
8
|
+
class?: HTMLAttributes['class']
|
|
9
|
+
}>()
|
|
10
|
+
|
|
11
|
+
const { carouselApi } = useCarousel()
|
|
12
|
+
const current = ref(0)
|
|
13
|
+
const count = ref(0)
|
|
14
|
+
|
|
15
|
+
const displayText = computed(() => `${current.value}/${count.value}`)
|
|
16
|
+
|
|
17
|
+
function updateState() {
|
|
18
|
+
if (!carouselApi.value)
|
|
19
|
+
return
|
|
20
|
+
|
|
21
|
+
count.value = carouselApi.value.scrollSnapList().length
|
|
22
|
+
current.value = carouselApi.value.selectedScrollSnap() + 1
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
const stop = watch(carouselApi, (api) => {
|
|
26
|
+
if (!api)
|
|
27
|
+
return
|
|
28
|
+
|
|
29
|
+
// Watch only once
|
|
30
|
+
nextTick(() => stop())
|
|
31
|
+
|
|
32
|
+
updateState()
|
|
33
|
+
|
|
34
|
+
api.on('select', () => {
|
|
35
|
+
updateState()
|
|
36
|
+
})
|
|
37
|
+
})
|
|
38
|
+
</script>
|
|
39
|
+
|
|
40
|
+
<template>
|
|
41
|
+
<div
|
|
42
|
+
:class="cn('flex flex-1 items-center justify-end px-3 py-1 text-muted-foreground text-xs', props.class)"
|
|
43
|
+
>
|
|
44
|
+
<slot>{{ displayText }}</slot>
|
|
45
|
+
</div>
|
|
46
|
+
</template>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { HTMLAttributes } from 'vue'
|
|
3
|
+
import { CarouselItem } from '@/components/ui/carousel'
|
|
4
|
+
import { cn } from '@/lib/utils'
|
|
5
|
+
|
|
6
|
+
const props = defineProps<{
|
|
7
|
+
class?: HTMLAttributes['class']
|
|
8
|
+
}>()
|
|
9
|
+
</script>
|
|
10
|
+
|
|
11
|
+
<template>
|
|
12
|
+
<CarouselItem :class="cn('w-full space-y-2 p-4 pl-8', props.class)">
|
|
13
|
+
<slot />
|
|
14
|
+
</CarouselItem>
|
|
15
|
+
</template>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { HTMLAttributes } from 'vue'
|
|
3
|
+
import { useCarousel } from '@/components/ui/carousel'
|
|
4
|
+
import { cn } from '@/lib/utils'
|
|
5
|
+
import { ArrowRight } from 'lucide-vue-next'
|
|
6
|
+
|
|
7
|
+
const props = defineProps<{
|
|
8
|
+
class?: HTMLAttributes['class']
|
|
9
|
+
}>()
|
|
10
|
+
|
|
11
|
+
const { scrollNext } = useCarousel()
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
<template>
|
|
15
|
+
<button
|
|
16
|
+
:class="cn('shrink-0', props.class)"
|
|
17
|
+
type="button"
|
|
18
|
+
aria-label="Next"
|
|
19
|
+
@click="scrollNext"
|
|
20
|
+
>
|
|
21
|
+
<ArrowRight class="size-4 text-muted-foreground" />
|
|
22
|
+
</button>
|
|
23
|
+
</template>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { HTMLAttributes } from 'vue'
|
|
3
|
+
import { useCarousel } from '@/components/ui/carousel'
|
|
4
|
+
import { cn } from '@/lib/utils'
|
|
5
|
+
import { ArrowLeft } from 'lucide-vue-next'
|
|
6
|
+
|
|
7
|
+
const props = defineProps<{
|
|
8
|
+
class?: HTMLAttributes['class']
|
|
9
|
+
}>()
|
|
10
|
+
|
|
11
|
+
const { scrollPrev } = useCarousel()
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
<template>
|
|
15
|
+
<button
|
|
16
|
+
:class="cn('shrink-0', props.class)"
|
|
17
|
+
type="button"
|
|
18
|
+
aria-label="Previous"
|
|
19
|
+
@click="scrollPrev"
|
|
20
|
+
>
|
|
21
|
+
<ArrowLeft class="size-4 text-muted-foreground" />
|
|
22
|
+
</button>
|
|
23
|
+
</template>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { HTMLAttributes } from 'vue'
|
|
3
|
+
import { cn } from '@/lib/utils'
|
|
4
|
+
|
|
5
|
+
const props = defineProps<{
|
|
6
|
+
class?: HTMLAttributes['class']
|
|
7
|
+
}>()
|
|
8
|
+
</script>
|
|
9
|
+
|
|
10
|
+
<template>
|
|
11
|
+
<blockquote
|
|
12
|
+
:class="cn('border-muted border-l-2 pl-3 text-muted-foreground text-sm italic', props.class)"
|
|
13
|
+
>
|
|
14
|
+
<slot />
|
|
15
|
+
</blockquote>
|
|
16
|
+
</template>
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { HTMLAttributes } from 'vue'
|
|
3
|
+
import { cn } from '@/lib/utils'
|
|
4
|
+
|
|
5
|
+
const props = defineProps<{
|
|
6
|
+
title?: string
|
|
7
|
+
url?: string
|
|
8
|
+
description?: string
|
|
9
|
+
class?: HTMLAttributes['class']
|
|
10
|
+
}>()
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
<template>
|
|
14
|
+
<div :class="cn('space-y-1', props.class)">
|
|
15
|
+
<h4 v-if="title" class="truncate font-medium text-sm leading-tight">
|
|
16
|
+
{{ title }}
|
|
17
|
+
</h4>
|
|
18
|
+
<p v-if="url" class="truncate break-all text-muted-foreground text-xs">
|
|
19
|
+
{{ url }}
|
|
20
|
+
</p>
|
|
21
|
+
<p v-if="description" class="line-clamp-3 text-muted-foreground text-sm leading-relaxed">
|
|
22
|
+
{{ description }}
|
|
23
|
+
</p>
|
|
24
|
+
<slot />
|
|
25
|
+
</div>
|
|
26
|
+
</template>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { HTMLAttributes } from 'vue'
|
|
3
|
+
import { cn } from '@/lib/utils'
|
|
4
|
+
|
|
5
|
+
const props = defineProps<{
|
|
6
|
+
class?: HTMLAttributes['class']
|
|
7
|
+
}>()
|
|
8
|
+
</script>
|
|
9
|
+
|
|
10
|
+
<template>
|
|
11
|
+
<span :class="cn('transition-colors group-hover:bg-accent', props.class)">
|
|
12
|
+
<slot />
|
|
13
|
+
</span>
|
|
14
|
+
</template>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export { default as InlineCitation } from './InlineCitation.vue'
|
|
2
|
+
export { default as InlineCitationCard } from './InlineCitationCard.vue'
|
|
3
|
+
export { default as InlineCitationCardBody } from './InlineCitationCardBody.vue'
|
|
4
|
+
export { default as InlineCitationCardTrigger } from './InlineCitationCardTrigger.vue'
|
|
5
|
+
export { default as InlineCitationCarousel } from './InlineCitationCarousel.vue'
|
|
6
|
+
export { default as InlineCitationCarouselContent } from './InlineCitationCarouselContent.vue'
|
|
7
|
+
export { default as InlineCitationCarouselHeader } from './InlineCitationCarouselHeader.vue'
|
|
8
|
+
export { default as InlineCitationCarouselIndex } from './InlineCitationCarouselIndex.vue'
|
|
9
|
+
export { default as InlineCitationCarouselItem } from './InlineCitationCarouselItem.vue'
|
|
10
|
+
export { default as InlineCitationCarouselNext } from './InlineCitationCarouselNext.vue'
|
|
11
|
+
export { default as InlineCitationCarouselPrev } from './InlineCitationCarouselPrev.vue'
|
|
12
|
+
export { default as InlineCitationQuote } from './InlineCitationQuote.vue'
|
|
13
|
+
export { default as InlineCitationSource } from './InlineCitationSource.vue'
|
|
14
|
+
export { default as InlineCitationText } from './InlineCitationText.vue'
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { HTMLAttributes } from 'vue'
|
|
3
|
+
import { cn } from '@/lib/utils'
|
|
4
|
+
import LoaderIcon from './LoaderIcon.vue'
|
|
5
|
+
|
|
6
|
+
interface Props {
|
|
7
|
+
size?: number
|
|
8
|
+
class?: HTMLAttributes['class']
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
const props = withDefaults(defineProps<Props>(), {
|
|
12
|
+
size: 16,
|
|
13
|
+
})
|
|
14
|
+
</script>
|
|
15
|
+
|
|
16
|
+
<template>
|
|
17
|
+
<div
|
|
18
|
+
:class="cn('inline-flex animate-spin items-center justify-center', props.class)"
|
|
19
|
+
v-bind="$attrs"
|
|
20
|
+
>
|
|
21
|
+
<LoaderIcon :size="props.size" />
|
|
22
|
+
</div>
|
|
23
|
+
</template>
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
interface Props {
|
|
3
|
+
size?: number
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
withDefaults(defineProps<Props>(), {
|
|
7
|
+
size: 16,
|
|
8
|
+
})
|
|
9
|
+
</script>
|
|
10
|
+
|
|
11
|
+
<template>
|
|
12
|
+
<svg
|
|
13
|
+
:height="size"
|
|
14
|
+
stroke-linejoin="round"
|
|
15
|
+
:style="{ color: 'currentcolor' }"
|
|
16
|
+
viewBox="0 0 16 16"
|
|
17
|
+
:width="size"
|
|
18
|
+
>
|
|
19
|
+
<title>Loader</title>
|
|
20
|
+
<g clip-path="url(#clip0_2393_1490)">
|
|
21
|
+
<path d="M8 0V4" stroke="currentColor" stroke-width="1.5" />
|
|
22
|
+
<path d="M8 16V12" opacity="0.5" stroke="currentColor" stroke-width="1.5" />
|
|
23
|
+
<path d="M3.29773 1.52783L5.64887 4.7639" opacity="0.9" stroke="currentColor" stroke-width="1.5" />
|
|
24
|
+
<path d="M12.7023 1.52783L10.3511 4.7639" opacity="0.1" stroke="currentColor" stroke-width="1.5" />
|
|
25
|
+
<path d="M12.7023 14.472L10.3511 11.236" opacity="0.4" stroke="currentColor" stroke-width="1.5" />
|
|
26
|
+
<path d="M3.29773 14.472L5.64887 11.236" opacity="0.6" stroke="currentColor" stroke-width="1.5" />
|
|
27
|
+
<path d="M15.6085 5.52783L11.8043 6.7639" opacity="0.2" stroke="currentColor" stroke-width="1.5" />
|
|
28
|
+
<path d="M0.391602 10.472L4.19583 9.23598" opacity="0.7" stroke="currentColor" stroke-width="1.5" />
|
|
29
|
+
<path d="M15.6085 10.4722L11.8043 9.2361" opacity="0.3" stroke="currentColor" stroke-width="1.5" />
|
|
30
|
+
<path d="M0.391602 5.52783L4.19583 6.7639" opacity="0.8" stroke="currentColor" stroke-width="1.5" />
|
|
31
|
+
</g>
|
|
32
|
+
<defs>
|
|
33
|
+
<clipPath id="clip0_2393_1490">
|
|
34
|
+
<rect fill="white" height="16" width="16" />
|
|
35
|
+
</clipPath>
|
|
36
|
+
</defs>
|
|
37
|
+
</svg>
|
|
38
|
+
</template>
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { UIMessage } from 'ai'
|
|
3
|
+
import type { HTMLAttributes } from 'vue'
|
|
4
|
+
import { cn } from '@/lib/utils'
|
|
5
|
+
|
|
6
|
+
interface Props {
|
|
7
|
+
from: UIMessage['role']
|
|
8
|
+
class?: HTMLAttributes['class']
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
const props = defineProps<Props>()
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
<template>
|
|
15
|
+
<div
|
|
16
|
+
:class="
|
|
17
|
+
cn(
|
|
18
|
+
'group flex w-full max-w-[80%] gap-2',
|
|
19
|
+
props.from === 'user' ? 'is-user ml-auto justify-end' : 'is-assistant',
|
|
20
|
+
props.class,
|
|
21
|
+
)
|
|
22
|
+
"
|
|
23
|
+
v-bind="$attrs"
|
|
24
|
+
>
|
|
25
|
+
<slot />
|
|
26
|
+
</div>
|
|
27
|
+
</template>
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { ButtonVariants } from '@/components/ui/button'
|
|
3
|
+
import { Button } from '@/components/ui/button'
|
|
4
|
+
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from '@/components/ui/tooltip'
|
|
5
|
+
|
|
6
|
+
interface Props {
|
|
7
|
+
tooltip?: string
|
|
8
|
+
label?: string
|
|
9
|
+
variant?: ButtonVariants['variant']
|
|
10
|
+
size?: ButtonVariants['size']
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
const props = withDefaults(defineProps<Props>(), {
|
|
14
|
+
variant: 'ghost',
|
|
15
|
+
size: 'icon-sm',
|
|
16
|
+
})
|
|
17
|
+
|
|
18
|
+
const buttonProps = {
|
|
19
|
+
variant: props.variant,
|
|
20
|
+
size: props.size,
|
|
21
|
+
type: 'button' as const,
|
|
22
|
+
}
|
|
23
|
+
</script>
|
|
24
|
+
|
|
25
|
+
<template>
|
|
26
|
+
<TooltipProvider v-if="props.tooltip">
|
|
27
|
+
<Tooltip>
|
|
28
|
+
<TooltipTrigger as-child>
|
|
29
|
+
<Button v-bind="{ ...buttonProps, ...$attrs }">
|
|
30
|
+
<slot />
|
|
31
|
+
<span class="sr-only">
|
|
32
|
+
{{ props.label || props.tooltip }}</span>
|
|
33
|
+
</Button>
|
|
34
|
+
</TooltipTrigger>
|
|
35
|
+
<TooltipContent>
|
|
36
|
+
<p>{{ props.tooltip }}</p>
|
|
37
|
+
</TooltipContent>
|
|
38
|
+
</Tooltip>
|
|
39
|
+
</TooltipProvider>
|
|
40
|
+
|
|
41
|
+
<Button v-else v-bind="{ ...buttonProps, ...$attrs }">
|
|
42
|
+
<slot />
|
|
43
|
+
<span class="sr-only">{{ props.label || props.tooltip }}</span>
|
|
44
|
+
</Button>
|
|
45
|
+
</template>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { HTMLAttributes } from 'vue'
|
|
3
|
+
import { cn } from '@/lib/utils'
|
|
4
|
+
|
|
5
|
+
interface Props {
|
|
6
|
+
class?: HTMLAttributes['class']
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
const props = defineProps<Props>()
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<template>
|
|
13
|
+
<div
|
|
14
|
+
:class="cn('flex items-center gap-1', props.class)"
|
|
15
|
+
v-bind="$attrs"
|
|
16
|
+
>
|
|
17
|
+
<slot />
|
|
18
|
+
</div>
|
|
19
|
+
</template>
|