@sveda-ai/vue 0.1.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/LICENSE +21 -0
- package/README.md +9 -0
- package/dist/appearance.d.ts +52 -0
- package/dist/appearance.d.ts.map +1 -0
- package/dist/components/chat/AnimatedStreamBlock.vue.d.ts +16 -0
- package/dist/components/chat/AnimatedStreamBlock.vue.d.ts.map +1 -0
- package/dist/components/chat/ChatHistoryDropdown.vue.d.ts +17 -0
- package/dist/components/chat/ChatHistoryDropdown.vue.d.ts.map +1 -0
- package/dist/components/chat/ChatInput.vue.d.ts +30 -0
- package/dist/components/chat/ChatInput.vue.d.ts.map +1 -0
- package/dist/components/chat/ChatMessageActivityBlock.vue.d.ts +13 -0
- package/dist/components/chat/ChatMessageActivityBlock.vue.d.ts.map +1 -0
- package/dist/components/chat/ChatMessageItem.vue.d.ts +15 -0
- package/dist/components/chat/ChatMessageItem.vue.d.ts.map +1 -0
- package/dist/components/chat/ChatMessageList.vue.d.ts +31 -0
- package/dist/components/chat/ChatMessageList.vue.d.ts.map +1 -0
- package/dist/components/chat/ChatPendingIndicator.vue.d.ts +12 -0
- package/dist/components/chat/ChatPendingIndicator.vue.d.ts.map +1 -0
- package/dist/components/chat/ReasoningStream.vue.d.ts +11 -0
- package/dist/components/chat/ReasoningStream.vue.d.ts.map +1 -0
- package/dist/components/chat/index.d.ts +9 -0
- package/dist/components/chat/index.d.ts.map +1 -0
- package/dist/components/shell/SvedaAgentCompletedNotice.vue.d.ts +9 -0
- package/dist/components/shell/SvedaAgentCompletedNotice.vue.d.ts.map +1 -0
- package/dist/components/shell/SvedaAgentTasksPanel.vue.d.ts +12 -0
- package/dist/components/shell/SvedaAgentTasksPanel.vue.d.ts.map +1 -0
- package/dist/components/shell/SvedaChat.vue.d.ts +22 -0
- package/dist/components/shell/SvedaChat.vue.d.ts.map +1 -0
- package/dist/components/shell/SvedaContextUsageBar.vue.d.ts +10 -0
- package/dist/components/shell/SvedaContextUsageBar.vue.d.ts.map +1 -0
- package/dist/components/shell/SvedaHistorySheet.vue.d.ts +15 -0
- package/dist/components/shell/SvedaHistorySheet.vue.d.ts.map +1 -0
- package/dist/components/shell/SvedaHistorySidebar.vue.d.ts +15 -0
- package/dist/components/shell/SvedaHistorySidebar.vue.d.ts.map +1 -0
- package/dist/components/shell/SvedaInputSection.vue.d.ts +25 -0
- package/dist/components/shell/SvedaInputSection.vue.d.ts.map +1 -0
- package/dist/components/shell/SvedaLandingView.vue.d.ts +40 -0
- package/dist/components/shell/SvedaLandingView.vue.d.ts.map +1 -0
- package/dist/components/shell/SvedaMaxStepsNotice.vue.d.ts +13 -0
- package/dist/components/shell/SvedaMaxStepsNotice.vue.d.ts.map +1 -0
- package/dist/components/shell/SvedaMinimizedTrigger.vue.d.ts +15 -0
- package/dist/components/shell/SvedaMinimizedTrigger.vue.d.ts.map +1 -0
- package/dist/components/shell/SvedaModelControls.vue.d.ts +12 -0
- package/dist/components/shell/SvedaModelControls.vue.d.ts.map +1 -0
- package/dist/components/shell/SvedaModelSelect.vue.d.ts +10 -0
- package/dist/components/shell/SvedaModelSelect.vue.d.ts.map +1 -0
- package/dist/components/shell/SvedaQuickPrompts.vue.d.ts +13 -0
- package/dist/components/shell/SvedaQuickPrompts.vue.d.ts.map +1 -0
- package/dist/components/shell/SvedaResizeHandles.vue.d.ts +11 -0
- package/dist/components/shell/SvedaResizeHandles.vue.d.ts.map +1 -0
- package/dist/components/shell/SvedaTabs.vue.d.ts +17 -0
- package/dist/components/shell/SvedaTabs.vue.d.ts.map +1 -0
- package/dist/components/shell/SvedaToolbar.vue.d.ts +33 -0
- package/dist/components/shell/SvedaToolbar.vue.d.ts.map +1 -0
- package/dist/composables/useSvedaAgentTasks.d.ts +57 -0
- package/dist/composables/useSvedaAgentTasks.d.ts.map +1 -0
- package/dist/composables/useSvedaBootstrap.d.ts +18 -0
- package/dist/composables/useSvedaBootstrap.d.ts.map +1 -0
- package/dist/composables/useSvedaChat.d.ts +264 -0
- package/dist/composables/useSvedaChat.d.ts.map +1 -0
- package/dist/composables/useSvedaChatLayout.d.ts +39 -0
- package/dist/composables/useSvedaChatLayout.d.ts.map +1 -0
- package/dist/composables/useSvedaChatPage.d.ts +309 -0
- package/dist/composables/useSvedaChatPage.d.ts.map +1 -0
- package/dist/composables/useSvedaContextWindow.d.ts +10 -0
- package/dist/composables/useSvedaContextWindow.d.ts.map +1 -0
- package/dist/composables/useSvedaDocuments.d.ts +20 -0
- package/dist/composables/useSvedaDocuments.d.ts.map +1 -0
- package/dist/composables/useSvedaMaxStepsContinue.d.ts +12 -0
- package/dist/composables/useSvedaMaxStepsContinue.d.ts.map +1 -0
- package/dist/composables/useSvedaMessaging.d.ts +55 -0
- package/dist/composables/useSvedaMessaging.d.ts.map +1 -0
- package/dist/composables/useSvedaModel.d.ts +16 -0
- package/dist/composables/useSvedaModel.d.ts.map +1 -0
- package/dist/composables/useSvedaPrompts.d.ts +18 -0
- package/dist/composables/useSvedaPrompts.d.ts.map +1 -0
- package/dist/composables/useSvedaReadable.d.ts +3 -0
- package/dist/composables/useSvedaReadable.d.ts.map +1 -0
- package/dist/composables/useSvedaScroll.d.ts +19 -0
- package/dist/composables/useSvedaScroll.d.ts.map +1 -0
- package/dist/composables/useSvedaShell.d.ts +29 -0
- package/dist/composables/useSvedaShell.d.ts.map +1 -0
- package/dist/composables/useSvedaStreaming.d.ts +46 -0
- package/dist/composables/useSvedaStreaming.d.ts.map +1 -0
- package/dist/composables/useSvedaTool.d.ts +4 -0
- package/dist/composables/useSvedaTool.d.ts.map +1 -0
- package/dist/i18n/index.d.ts +18 -0
- package/dist/i18n/index.d.ts.map +1 -0
- package/dist/i18n/locales/en.d.ts +4 -0
- package/dist/i18n/locales/en.d.ts.map +1 -0
- package/dist/i18n/locales/ru.d.ts +4 -0
- package/dist/i18n/locales/ru.d.ts.map +1 -0
- package/dist/index.d.ts +64 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +6612 -0
- package/dist/launcherIcons.d.ts +5 -0
- package/dist/launcherIcons.d.ts.map +1 -0
- package/dist/lib/assistantMessage.d.ts +89 -0
- package/dist/lib/assistantMessage.d.ts.map +1 -0
- package/dist/lib/chatHistoryMerge.d.ts +20 -0
- package/dist/lib/chatHistoryMerge.d.ts.map +1 -0
- package/dist/lib/chatI18nKeys.d.ts +2 -0
- package/dist/lib/chatI18nKeys.d.ts.map +1 -0
- package/dist/lib/chatMessageVisibility.d.ts +4 -0
- package/dist/lib/chatMessageVisibility.d.ts.map +1 -0
- package/dist/lib/chatTabs.d.ts +9 -0
- package/dist/lib/chatTabs.d.ts.map +1 -0
- package/dist/lib/chatTitle.d.ts +3 -0
- package/dist/lib/chatTitle.d.ts.map +1 -0
- package/dist/lib/chatUiStorage.d.ts +4 -0
- package/dist/lib/chatUiStorage.d.ts.map +1 -0
- package/dist/lib/finalizeMessages.d.ts +21 -0
- package/dist/lib/finalizeMessages.d.ts.map +1 -0
- package/dist/lib/markdown.d.ts +8 -0
- package/dist/lib/markdown.d.ts.map +1 -0
- package/dist/lib/modelLabels.d.ts +3 -0
- package/dist/lib/modelLabels.d.ts.map +1 -0
- package/dist/lib/pendingStatusRotation.d.ts +3 -0
- package/dist/lib/pendingStatusRotation.d.ts.map +1 -0
- package/dist/lib/useAnimatedText.d.ts +8 -0
- package/dist/lib/useAnimatedText.d.ts.map +1 -0
- package/dist/lib/userMessage.d.ts +17 -0
- package/dist/lib/userMessage.d.ts.map +1 -0
- package/dist/lib/utils.d.ts +3 -0
- package/dist/lib/utils.d.ts.map +1 -0
- package/dist/plugin.d.ts +64 -0
- package/dist/plugin.d.ts.map +1 -0
- package/dist/styles.css +5 -0
- package/dist/ui/alert-dialog/AlertDialog.vue.d.ts +18 -0
- package/dist/ui/alert-dialog/AlertDialog.vue.d.ts.map +1 -0
- package/dist/ui/alert-dialog/AlertDialogAction.vue.d.ts +18 -0
- package/dist/ui/alert-dialog/AlertDialogAction.vue.d.ts.map +1 -0
- package/dist/ui/alert-dialog/AlertDialogCancel.vue.d.ts +18 -0
- package/dist/ui/alert-dialog/AlertDialogCancel.vue.d.ts.map +1 -0
- package/dist/ui/alert-dialog/AlertDialogContent.vue.d.ts +32 -0
- package/dist/ui/alert-dialog/AlertDialogContent.vue.d.ts.map +1 -0
- package/dist/ui/alert-dialog/AlertDialogDescription.vue.d.ts +18 -0
- package/dist/ui/alert-dialog/AlertDialogDescription.vue.d.ts.map +1 -0
- package/dist/ui/alert-dialog/AlertDialogFooter.vue.d.ts +17 -0
- package/dist/ui/alert-dialog/AlertDialogFooter.vue.d.ts.map +1 -0
- package/dist/ui/alert-dialog/AlertDialogHeader.vue.d.ts +17 -0
- package/dist/ui/alert-dialog/AlertDialogHeader.vue.d.ts.map +1 -0
- package/dist/ui/alert-dialog/AlertDialogTitle.vue.d.ts +18 -0
- package/dist/ui/alert-dialog/AlertDialogTitle.vue.d.ts.map +1 -0
- package/dist/ui/alert-dialog/AlertDialogTrigger.vue.d.ts +14 -0
- package/dist/ui/alert-dialog/AlertDialogTrigger.vue.d.ts.map +1 -0
- package/dist/ui/alert-dialog/index.d.ts +10 -0
- package/dist/ui/alert-dialog/index.d.ts.map +1 -0
- package/dist/ui/badge/Badge.vue.d.ts +19 -0
- package/dist/ui/badge/Badge.vue.d.ts.map +1 -0
- package/dist/ui/badge/index.d.ts +7 -0
- package/dist/ui/badge/index.d.ts.map +1 -0
- package/dist/ui/button/Button.vue.d.ts +23 -0
- package/dist/ui/button/Button.vue.d.ts.map +1 -0
- package/dist/ui/button/index.d.ts +9 -0
- package/dist/ui/button/index.d.ts.map +1 -0
- package/dist/ui/card/Card.vue.d.ts +17 -0
- package/dist/ui/card/Card.vue.d.ts.map +1 -0
- package/dist/ui/card/CardContent.vue.d.ts +17 -0
- package/dist/ui/card/CardContent.vue.d.ts.map +1 -0
- package/dist/ui/card/CardDescription.vue.d.ts +17 -0
- package/dist/ui/card/CardDescription.vue.d.ts.map +1 -0
- package/dist/ui/card/CardFooter.vue.d.ts +17 -0
- package/dist/ui/card/CardFooter.vue.d.ts.map +1 -0
- package/dist/ui/card/CardHeader.vue.d.ts +17 -0
- package/dist/ui/card/CardHeader.vue.d.ts.map +1 -0
- package/dist/ui/card/CardTitle.vue.d.ts +17 -0
- package/dist/ui/card/CardTitle.vue.d.ts.map +1 -0
- package/dist/ui/card/index.d.ts +7 -0
- package/dist/ui/card/index.d.ts.map +1 -0
- package/dist/ui/checkbox/Checkbox.vue.d.ts +30 -0
- package/dist/ui/checkbox/Checkbox.vue.d.ts.map +1 -0
- package/dist/ui/checkbox/index.d.ts +2 -0
- package/dist/ui/checkbox/index.d.ts.map +1 -0
- package/dist/ui/dialog/Dialog.vue.d.ts +18 -0
- package/dist/ui/dialog/Dialog.vue.d.ts.map +1 -0
- package/dist/ui/dialog/DialogClose.vue.d.ts +14 -0
- package/dist/ui/dialog/DialogClose.vue.d.ts.map +1 -0
- package/dist/ui/dialog/DialogContent.vue.d.ts +32 -0
- package/dist/ui/dialog/DialogContent.vue.d.ts.map +1 -0
- package/dist/ui/dialog/DialogDescription.vue.d.ts +18 -0
- package/dist/ui/dialog/DialogDescription.vue.d.ts.map +1 -0
- package/dist/ui/dialog/DialogFooter.vue.d.ts +17 -0
- package/dist/ui/dialog/DialogFooter.vue.d.ts.map +1 -0
- package/dist/ui/dialog/DialogHeader.vue.d.ts +17 -0
- package/dist/ui/dialog/DialogHeader.vue.d.ts.map +1 -0
- package/dist/ui/dialog/DialogScrollContent.vue.d.ts +32 -0
- package/dist/ui/dialog/DialogScrollContent.vue.d.ts.map +1 -0
- package/dist/ui/dialog/DialogTitle.vue.d.ts +18 -0
- package/dist/ui/dialog/DialogTitle.vue.d.ts.map +1 -0
- package/dist/ui/dialog/DialogTrigger.vue.d.ts +14 -0
- package/dist/ui/dialog/DialogTrigger.vue.d.ts.map +1 -0
- package/dist/ui/dialog/index.d.ts +10 -0
- package/dist/ui/dialog/index.d.ts.map +1 -0
- package/dist/ui/dropdown-menu/DropdownMenu.vue.d.ts +18 -0
- package/dist/ui/dropdown-menu/DropdownMenu.vue.d.ts.map +1 -0
- package/dist/ui/dropdown-menu/DropdownMenuCheckboxItem.vue.d.ts +24 -0
- package/dist/ui/dropdown-menu/DropdownMenuCheckboxItem.vue.d.ts.map +1 -0
- package/dist/ui/dropdown-menu/DropdownMenuContent.vue.d.ts +32 -0
- package/dist/ui/dropdown-menu/DropdownMenuContent.vue.d.ts.map +1 -0
- package/dist/ui/dropdown-menu/DropdownMenuGroup.vue.d.ts +14 -0
- package/dist/ui/dropdown-menu/DropdownMenuGroup.vue.d.ts.map +1 -0
- package/dist/ui/dropdown-menu/DropdownMenuItem.vue.d.ts +19 -0
- package/dist/ui/dropdown-menu/DropdownMenuItem.vue.d.ts.map +1 -0
- package/dist/ui/dropdown-menu/DropdownMenuLabel.vue.d.ts +19 -0
- package/dist/ui/dropdown-menu/DropdownMenuLabel.vue.d.ts.map +1 -0
- package/dist/ui/dropdown-menu/DropdownMenuRadioGroup.vue.d.ts +18 -0
- package/dist/ui/dropdown-menu/DropdownMenuRadioGroup.vue.d.ts.map +1 -0
- package/dist/ui/dropdown-menu/DropdownMenuRadioItem.vue.d.ts +22 -0
- package/dist/ui/dropdown-menu/DropdownMenuRadioItem.vue.d.ts.map +1 -0
- package/dist/ui/dropdown-menu/DropdownMenuSeparator.vue.d.ts +8 -0
- package/dist/ui/dropdown-menu/DropdownMenuSeparator.vue.d.ts.map +1 -0
- package/dist/ui/dropdown-menu/DropdownMenuShortcut.vue.d.ts +17 -0
- package/dist/ui/dropdown-menu/DropdownMenuShortcut.vue.d.ts.map +1 -0
- package/dist/ui/dropdown-menu/DropdownMenuSub.vue.d.ts +18 -0
- package/dist/ui/dropdown-menu/DropdownMenuSub.vue.d.ts.map +1 -0
- package/dist/ui/dropdown-menu/DropdownMenuSubContent.vue.d.ts +34 -0
- package/dist/ui/dropdown-menu/DropdownMenuSubContent.vue.d.ts.map +1 -0
- package/dist/ui/dropdown-menu/DropdownMenuSubTrigger.vue.d.ts +18 -0
- package/dist/ui/dropdown-menu/DropdownMenuSubTrigger.vue.d.ts.map +1 -0
- package/dist/ui/dropdown-menu/DropdownMenuTrigger.vue.d.ts +14 -0
- package/dist/ui/dropdown-menu/DropdownMenuTrigger.vue.d.ts.map +1 -0
- package/dist/ui/dropdown-menu/index.d.ts +16 -0
- package/dist/ui/dropdown-menu/index.d.ts.map +1 -0
- package/dist/ui/input/Input.vue.d.ts +13 -0
- package/dist/ui/input/Input.vue.d.ts.map +1 -0
- package/dist/ui/input/index.d.ts +2 -0
- package/dist/ui/input/index.d.ts.map +1 -0
- package/dist/ui/label/Label.vue.d.ts +18 -0
- package/dist/ui/label/Label.vue.d.ts.map +1 -0
- package/dist/ui/label/index.d.ts +2 -0
- package/dist/ui/label/index.d.ts.map +1 -0
- package/dist/ui/responsive-dialog/ResponsiveDialog.vue.d.ts +32 -0
- package/dist/ui/responsive-dialog/ResponsiveDialog.vue.d.ts.map +1 -0
- package/dist/ui/responsive-dialog/index.d.ts +2 -0
- package/dist/ui/responsive-dialog/index.d.ts.map +1 -0
- package/dist/ui/scroll-area/ScrollArea.vue.d.ts +18 -0
- package/dist/ui/scroll-area/ScrollArea.vue.d.ts.map +1 -0
- package/dist/ui/scroll-area/ScrollBar.vue.d.ts +10 -0
- package/dist/ui/scroll-area/ScrollBar.vue.d.ts.map +1 -0
- package/dist/ui/scroll-area/index.d.ts +3 -0
- package/dist/ui/scroll-area/index.d.ts.map +1 -0
- package/dist/ui/select/Select.vue.d.ts +21 -0
- package/dist/ui/select/Select.vue.d.ts.map +1 -0
- package/dist/ui/select/SelectContent.vue.d.ts +28 -0
- package/dist/ui/select/SelectContent.vue.d.ts.map +1 -0
- package/dist/ui/select/SelectGroup.vue.d.ts +18 -0
- package/dist/ui/select/SelectGroup.vue.d.ts.map +1 -0
- package/dist/ui/select/SelectItem.vue.d.ts +18 -0
- package/dist/ui/select/SelectItem.vue.d.ts.map +1 -0
- package/dist/ui/select/SelectItemText.vue.d.ts +14 -0
- package/dist/ui/select/SelectItemText.vue.d.ts.map +1 -0
- package/dist/ui/select/SelectLabel.vue.d.ts +18 -0
- package/dist/ui/select/SelectLabel.vue.d.ts.map +1 -0
- package/dist/ui/select/SelectScrollDownButton.vue.d.ts +18 -0
- package/dist/ui/select/SelectScrollDownButton.vue.d.ts.map +1 -0
- package/dist/ui/select/SelectScrollUpButton.vue.d.ts +18 -0
- package/dist/ui/select/SelectScrollUpButton.vue.d.ts.map +1 -0
- package/dist/ui/select/SelectSeparator.vue.d.ts +8 -0
- package/dist/ui/select/SelectSeparator.vue.d.ts.map +1 -0
- package/dist/ui/select/SelectTrigger.vue.d.ts +18 -0
- package/dist/ui/select/SelectTrigger.vue.d.ts.map +1 -0
- package/dist/ui/select/SelectValue.vue.d.ts +14 -0
- package/dist/ui/select/SelectValue.vue.d.ts.map +1 -0
- package/dist/ui/select/index.d.ts +12 -0
- package/dist/ui/select/index.d.ts.map +1 -0
- package/dist/ui/sheet/Sheet.vue.d.ts +18 -0
- package/dist/ui/sheet/Sheet.vue.d.ts.map +1 -0
- package/dist/ui/sheet/SheetClose.vue.d.ts +14 -0
- package/dist/ui/sheet/SheetClose.vue.d.ts.map +1 -0
- package/dist/ui/sheet/SheetContent.vue.d.ts +34 -0
- package/dist/ui/sheet/SheetContent.vue.d.ts.map +1 -0
- package/dist/ui/sheet/SheetDescription.vue.d.ts +18 -0
- package/dist/ui/sheet/SheetDescription.vue.d.ts.map +1 -0
- package/dist/ui/sheet/SheetFooter.vue.d.ts +17 -0
- package/dist/ui/sheet/SheetFooter.vue.d.ts.map +1 -0
- package/dist/ui/sheet/SheetHeader.vue.d.ts +17 -0
- package/dist/ui/sheet/SheetHeader.vue.d.ts.map +1 -0
- package/dist/ui/sheet/SheetTitle.vue.d.ts +18 -0
- package/dist/ui/sheet/SheetTitle.vue.d.ts.map +1 -0
- package/dist/ui/sheet/SheetTrigger.vue.d.ts +14 -0
- package/dist/ui/sheet/SheetTrigger.vue.d.ts.map +1 -0
- package/dist/ui/sheet/index.d.ts +14 -0
- package/dist/ui/sheet/index.d.ts.map +1 -0
- package/dist/ui/switch/Switch.vue.d.ts +23 -0
- package/dist/ui/switch/Switch.vue.d.ts.map +1 -0
- package/dist/ui/switch/index.d.ts +2 -0
- package/dist/ui/switch/index.d.ts.map +1 -0
- package/dist/ui/textarea/Textarea.vue.d.ts +13 -0
- package/dist/ui/textarea/Textarea.vue.d.ts.map +1 -0
- package/dist/ui/textarea/index.d.ts +2 -0
- package/dist/ui/textarea/index.d.ts.map +1 -0
- package/dist/ui/toast/Toast.vue.d.ts +96 -0
- package/dist/ui/toast/Toast.vue.d.ts.map +1 -0
- package/dist/ui/toast/ToastAction.vue.d.ts +18 -0
- package/dist/ui/toast/ToastAction.vue.d.ts.map +1 -0
- package/dist/ui/toast/ToastClose.vue.d.ts +8 -0
- package/dist/ui/toast/ToastClose.vue.d.ts.map +1 -0
- package/dist/ui/toast/ToastDescription.vue.d.ts +18 -0
- package/dist/ui/toast/ToastDescription.vue.d.ts.map +1 -0
- package/dist/ui/toast/ToastProvider.vue.d.ts +14 -0
- package/dist/ui/toast/ToastProvider.vue.d.ts.map +1 -0
- package/dist/ui/toast/ToastTitle.vue.d.ts +18 -0
- package/dist/ui/toast/ToastTitle.vue.d.ts.map +1 -0
- package/dist/ui/toast/ToastViewport.vue.d.ts +8 -0
- package/dist/ui/toast/ToastViewport.vue.d.ts.map +1 -0
- package/dist/ui/toast/Toaster.vue.d.ts +3 -0
- package/dist/ui/toast/Toaster.vue.d.ts.map +1 -0
- package/dist/ui/toast/index.d.ts +23 -0
- package/dist/ui/toast/index.d.ts.map +1 -0
- package/dist/ui/toast/use-toast.d.ts +23 -0
- package/dist/ui/toast/use-toast.d.ts.map +1 -0
- package/dist/ui/tooltip/Tooltip.vue.d.ts +18 -0
- package/dist/ui/tooltip/Tooltip.vue.d.ts.map +1 -0
- package/dist/ui/tooltip/TooltipContent.vue.d.ts +26 -0
- package/dist/ui/tooltip/TooltipContent.vue.d.ts.map +1 -0
- package/dist/ui/tooltip/TooltipProvider.vue.d.ts +14 -0
- package/dist/ui/tooltip/TooltipProvider.vue.d.ts.map +1 -0
- package/dist/ui/tooltip/TooltipTrigger.vue.d.ts +14 -0
- package/dist/ui/tooltip/TooltipTrigger.vue.d.ts.map +1 -0
- package/dist/ui/tooltip/index.d.ts +5 -0
- package/dist/ui/tooltip/index.d.ts.map +1 -0
- package/dist/ui/utils.d.ts +2 -0
- package/dist/ui/utils.d.ts.map +1 -0
- package/dist/vue.css +1 -0
- package/package.json +64 -0
- package/src/appearance.ts +568 -0
- package/src/components/chat/AnimatedStreamBlock.vue +94 -0
- package/src/components/chat/ChatHistoryDropdown.vue +226 -0
- package/src/components/chat/ChatInput.vue +571 -0
- package/src/components/chat/ChatMessageActivityBlock.vue +447 -0
- package/src/components/chat/ChatMessageItem.vue +357 -0
- package/src/components/chat/ChatMessageList.vue +178 -0
- package/src/components/chat/ChatPendingIndicator.vue +163 -0
- package/src/components/chat/ReasoningStream.vue +112 -0
- package/src/components/chat/index.ts +8 -0
- package/src/components/shell/SvedaAgentCompletedNotice.vue +25 -0
- package/src/components/shell/SvedaAgentTasksPanel.vue +146 -0
- package/src/components/shell/SvedaChat.vue +514 -0
- package/src/components/shell/SvedaContextUsageBar.vue +33 -0
- package/src/components/shell/SvedaHistorySheet.vue +52 -0
- package/src/components/shell/SvedaHistorySidebar.vue +41 -0
- package/src/components/shell/SvedaInputSection.vue +53 -0
- package/src/components/shell/SvedaLandingView.vue +93 -0
- package/src/components/shell/SvedaMaxStepsNotice.vue +33 -0
- package/src/components/shell/SvedaMinimizedTrigger.vue +43 -0
- package/src/components/shell/SvedaModelControls.vue +47 -0
- package/src/components/shell/SvedaModelSelect.vue +32 -0
- package/src/components/shell/SvedaQuickPrompts.vue +44 -0
- package/src/components/shell/SvedaResizeHandles.vue +31 -0
- package/src/components/shell/SvedaTabs.vue +123 -0
- package/src/components/shell/SvedaToolbar.vue +171 -0
- package/src/composables/useSvedaAgentTasks.ts +93 -0
- package/src/composables/useSvedaBootstrap.ts +36 -0
- package/src/composables/useSvedaChat.ts +593 -0
- package/src/composables/useSvedaChatLayout.ts +539 -0
- package/src/composables/useSvedaChatPage.ts +339 -0
- package/src/composables/useSvedaContextWindow.ts +31 -0
- package/src/composables/useSvedaDocuments.ts +115 -0
- package/src/composables/useSvedaMaxStepsContinue.ts +68 -0
- package/src/composables/useSvedaMessaging.ts +99 -0
- package/src/composables/useSvedaModel.ts +85 -0
- package/src/composables/useSvedaPrompts.ts +59 -0
- package/src/composables/useSvedaReadable.ts +33 -0
- package/src/composables/useSvedaScroll.ts +93 -0
- package/src/composables/useSvedaShell.ts +91 -0
- package/src/composables/useSvedaStreaming.ts +408 -0
- package/src/composables/useSvedaTool.ts +18 -0
- package/src/i18n/index.ts +72 -0
- package/src/i18n/locales/en.ts +58 -0
- package/src/i18n/locales/ru.ts +59 -0
- package/src/index.ts +141 -0
- package/src/launcherIcons.ts +39 -0
- package/src/lib/assistantMessage.ts +437 -0
- package/src/lib/chatHistoryMerge.ts +93 -0
- package/src/lib/chatI18nKeys.ts +62 -0
- package/src/lib/chatMessageVisibility.ts +50 -0
- package/src/lib/chatTabs.ts +54 -0
- package/src/lib/chatTitle.ts +30 -0
- package/src/lib/chatUiStorage.ts +33 -0
- package/src/lib/finalizeMessages.ts +81 -0
- package/src/lib/markdown.ts +90 -0
- package/src/lib/modelLabels.ts +24 -0
- package/src/lib/pendingStatusRotation.ts +26 -0
- package/src/lib/shims-vue.d.ts +6 -0
- package/src/lib/useAnimatedText.ts +78 -0
- package/src/lib/userMessage.ts +55 -0
- package/src/lib/utils.ts +6 -0
- package/src/plugin.ts +164 -0
- package/src/styles.css +5 -0
- package/src/theme.css +95 -0
- package/src/theme.test.mjs +80 -0
- package/src/ui/alert-dialog/AlertDialog.vue +14 -0
- package/src/ui/alert-dialog/AlertDialogAction.vue +17 -0
- package/src/ui/alert-dialog/AlertDialogCancel.vue +24 -0
- package/src/ui/alert-dialog/AlertDialogContent.vue +39 -0
- package/src/ui/alert-dialog/AlertDialogDescription.vue +22 -0
- package/src/ui/alert-dialog/AlertDialogFooter.vue +21 -0
- package/src/ui/alert-dialog/AlertDialogHeader.vue +16 -0
- package/src/ui/alert-dialog/AlertDialogTitle.vue +19 -0
- package/src/ui/alert-dialog/AlertDialogTrigger.vue +11 -0
- package/src/ui/alert-dialog/index.ts +9 -0
- package/src/ui/badge/Badge.vue +16 -0
- package/src/ui/badge/index.ts +27 -0
- package/src/ui/button/Button.vue +56 -0
- package/src/ui/button/index.ts +50 -0
- package/src/ui/card/Card.vue +14 -0
- package/src/ui/card/CardContent.vue +14 -0
- package/src/ui/card/CardDescription.vue +14 -0
- package/src/ui/card/CardFooter.vue +14 -0
- package/src/ui/card/CardHeader.vue +14 -0
- package/src/ui/card/CardTitle.vue +14 -0
- package/src/ui/card/index.ts +6 -0
- package/src/ui/checkbox/Checkbox.vue +41 -0
- package/src/ui/checkbox/index.ts +1 -0
- package/src/ui/dialog/Dialog.vue +14 -0
- package/src/ui/dialog/DialogClose.vue +11 -0
- package/src/ui/dialog/DialogContent.vue +50 -0
- package/src/ui/dialog/DialogDescription.vue +24 -0
- package/src/ui/dialog/DialogFooter.vue +19 -0
- package/src/ui/dialog/DialogHeader.vue +16 -0
- package/src/ui/dialog/DialogScrollContent.vue +59 -0
- package/src/ui/dialog/DialogTitle.vue +29 -0
- package/src/ui/dialog/DialogTrigger.vue +11 -0
- package/src/ui/dialog/index.ts +9 -0
- package/src/ui/dropdown-menu/DropdownMenu.vue +14 -0
- package/src/ui/dropdown-menu/DropdownMenuCheckboxItem.vue +42 -0
- package/src/ui/dropdown-menu/DropdownMenuContent.vue +40 -0
- package/src/ui/dropdown-menu/DropdownMenuGroup.vue +11 -0
- package/src/ui/dropdown-menu/DropdownMenuItem.vue +30 -0
- package/src/ui/dropdown-menu/DropdownMenuLabel.vue +21 -0
- package/src/ui/dropdown-menu/DropdownMenuRadioGroup.vue +14 -0
- package/src/ui/dropdown-menu/DropdownMenuRadioItem.vue +43 -0
- package/src/ui/dropdown-menu/DropdownMenuSeparator.vue +21 -0
- package/src/ui/dropdown-menu/DropdownMenuShortcut.vue +14 -0
- package/src/ui/dropdown-menu/DropdownMenuSub.vue +14 -0
- package/src/ui/dropdown-menu/DropdownMenuSubContent.vue +30 -0
- package/src/ui/dropdown-menu/DropdownMenuSubTrigger.vue +31 -0
- package/src/ui/dropdown-menu/DropdownMenuTrigger.vue +13 -0
- package/src/ui/dropdown-menu/index.ts +16 -0
- package/src/ui/input/Input.vue +32 -0
- package/src/ui/input/index.ts +1 -0
- package/src/ui/label/Label.vue +22 -0
- package/src/ui/label/index.ts +1 -0
- package/src/ui/responsive-dialog/ResponsiveDialog.vue +55 -0
- package/src/ui/responsive-dialog/index.ts +1 -0
- package/src/ui/scroll-area/ScrollArea.vue +29 -0
- package/src/ui/scroll-area/ScrollBar.vue +30 -0
- package/src/ui/scroll-area/index.ts +2 -0
- package/src/ui/select/Select.vue +15 -0
- package/src/ui/select/SelectContent.vue +53 -0
- package/src/ui/select/SelectGroup.vue +19 -0
- package/src/ui/select/SelectItem.vue +44 -0
- package/src/ui/select/SelectItemText.vue +11 -0
- package/src/ui/select/SelectLabel.vue +13 -0
- package/src/ui/select/SelectScrollDownButton.vue +24 -0
- package/src/ui/select/SelectScrollUpButton.vue +24 -0
- package/src/ui/select/SelectSeparator.vue +17 -0
- package/src/ui/select/SelectTrigger.vue +31 -0
- package/src/ui/select/SelectValue.vue +11 -0
- package/src/ui/select/index.ts +11 -0
- package/src/ui/sheet/Sheet.vue +14 -0
- package/src/ui/sheet/SheetClose.vue +11 -0
- package/src/ui/sheet/SheetContent.vue +53 -0
- package/src/ui/sheet/SheetDescription.vue +19 -0
- package/src/ui/sheet/SheetFooter.vue +12 -0
- package/src/ui/sheet/SheetHeader.vue +12 -0
- package/src/ui/sheet/SheetTitle.vue +19 -0
- package/src/ui/sheet/SheetTrigger.vue +11 -0
- package/src/ui/sheet/index.ts +29 -0
- package/src/ui/switch/Switch.vue +55 -0
- package/src/ui/switch/index.ts +1 -0
- package/src/ui/textarea/Textarea.vue +24 -0
- package/src/ui/textarea/index.ts +1 -0
- package/src/ui/toast/Toast.vue +28 -0
- package/src/ui/toast/ToastAction.vue +19 -0
- package/src/ui/toast/ToastClose.vue +22 -0
- package/src/ui/toast/ToastDescription.vue +19 -0
- package/src/ui/toast/ToastProvider.vue +11 -0
- package/src/ui/toast/ToastTitle.vue +19 -0
- package/src/ui/toast/ToastViewport.vue +17 -0
- package/src/ui/toast/Toaster.vue +48 -0
- package/src/ui/toast/index.ts +39 -0
- package/src/ui/toast/use-toast.ts +109 -0
- package/src/ui/tooltip/Tooltip.vue +14 -0
- package/src/ui/tooltip/TooltipContent.vue +39 -0
- package/src/ui/tooltip/TooltipProvider.vue +11 -0
- package/src/ui/tooltip/TooltipTrigger.vue +11 -0
- package/src/ui/tooltip/index.ts +4 -0
- package/src/ui/utils.ts +1 -0
|
@@ -0,0 +1,568 @@
|
|
|
1
|
+
import { reactive } from 'vue';
|
|
2
|
+
|
|
3
|
+
export const SVEDA_APPEARANCE_STYLE_ID = 'sveda-appearance';
|
|
4
|
+
|
|
5
|
+
export const SVEDA_TOKEN_KEYS = [
|
|
6
|
+
'background',
|
|
7
|
+
'foreground',
|
|
8
|
+
'card',
|
|
9
|
+
'card_foreground',
|
|
10
|
+
'popover',
|
|
11
|
+
'popover_foreground',
|
|
12
|
+
'primary',
|
|
13
|
+
'primary_foreground',
|
|
14
|
+
'secondary',
|
|
15
|
+
'secondary_foreground',
|
|
16
|
+
'muted',
|
|
17
|
+
'muted_foreground',
|
|
18
|
+
'accent',
|
|
19
|
+
'accent_foreground',
|
|
20
|
+
'destructive',
|
|
21
|
+
'destructive_foreground',
|
|
22
|
+
'border',
|
|
23
|
+
'input',
|
|
24
|
+
'ring',
|
|
25
|
+
'brand',
|
|
26
|
+
'brand_foreground',
|
|
27
|
+
] as const;
|
|
28
|
+
|
|
29
|
+
export type SvedaTokenKey = (typeof SVEDA_TOKEN_KEYS)[number];
|
|
30
|
+
|
|
31
|
+
export type SvedaAppearanceTokens = Record<SvedaTokenKey, string>;
|
|
32
|
+
|
|
33
|
+
export type SvedaAppearanceTheme = 'light' | 'dark';
|
|
34
|
+
|
|
35
|
+
export const SVEDA_LAUNCHER_ICON_IDS = [
|
|
36
|
+
'sparkles',
|
|
37
|
+
'message-circle',
|
|
38
|
+
'message-square',
|
|
39
|
+
'bot',
|
|
40
|
+
'bot-message-square',
|
|
41
|
+
'brain',
|
|
42
|
+
'zap',
|
|
43
|
+
'star',
|
|
44
|
+
'heart',
|
|
45
|
+
'circle-help',
|
|
46
|
+
'rocket',
|
|
47
|
+
'gem',
|
|
48
|
+
] as const;
|
|
49
|
+
|
|
50
|
+
export const SVEDA_DEFAULT_LAUNCHER_ICON = 'sparkles';
|
|
51
|
+
|
|
52
|
+
export const SVEDA_LAUNCHER_IMAGE_MAX_BYTES = 262144;
|
|
53
|
+
|
|
54
|
+
export const SVEDA_LAUNCHER_IMAGE_MAX_CHARS = 360000;
|
|
55
|
+
|
|
56
|
+
export type SvedaLauncherIconId = (typeof SVEDA_LAUNCHER_ICON_IDS)[number];
|
|
57
|
+
|
|
58
|
+
export type SvedaAppearanceLauncher = {
|
|
59
|
+
label: string;
|
|
60
|
+
icon: SvedaLauncherIconId;
|
|
61
|
+
image: string;
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
export type SvedaAppearance = {
|
|
65
|
+
preset?: string;
|
|
66
|
+
radius?: string;
|
|
67
|
+
theme?: SvedaAppearanceTheme;
|
|
68
|
+
tokens?: Partial<SvedaAppearanceTokens> | Record<string, string>;
|
|
69
|
+
dark_tokens?: Partial<SvedaAppearanceTokens> | Record<string, string>;
|
|
70
|
+
launcher?: Partial<SvedaAppearanceLauncher> | { label?: string; icon?: string; image?: string };
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
export const SVEDA_APPEARANCE_PRESET_IDS = ['default', 'lms', 'ocean', 'forest', 'sunset', 'sand'] as const;
|
|
74
|
+
|
|
75
|
+
export type SvedaAppearancePresetId = (typeof SVEDA_APPEARANCE_PRESET_IDS)[number];
|
|
76
|
+
|
|
77
|
+
const NEUTRAL_LIGHT: SvedaAppearanceTokens = {
|
|
78
|
+
background: '210 20% 98%',
|
|
79
|
+
foreground: '0 0% 3.9%',
|
|
80
|
+
card: '0 0% 100%',
|
|
81
|
+
card_foreground: '0 0% 3.9%',
|
|
82
|
+
popover: '0 0% 100%',
|
|
83
|
+
popover_foreground: '0 0% 3.9%',
|
|
84
|
+
primary: '0 0% 9%',
|
|
85
|
+
primary_foreground: '0 0% 98%',
|
|
86
|
+
secondary: '0 0% 92.1%',
|
|
87
|
+
secondary_foreground: '0 0% 9%',
|
|
88
|
+
muted: '0 0% 96.1%',
|
|
89
|
+
muted_foreground: '0 0% 45.1%',
|
|
90
|
+
accent: '0 0% 96.1%',
|
|
91
|
+
accent_foreground: '0 0% 9%',
|
|
92
|
+
destructive: '0 84.2% 60.2%',
|
|
93
|
+
destructive_foreground: '0 0% 98%',
|
|
94
|
+
border: '220 13% 91%',
|
|
95
|
+
input: '220 14% 96%',
|
|
96
|
+
ring: '0 0% 3.9%',
|
|
97
|
+
brand: '0 0% 9%',
|
|
98
|
+
brand_foreground: '0 0% 98%',
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
const NEUTRAL_DARK: SvedaAppearanceTokens = {
|
|
102
|
+
background: '222.2 47.4% 11.2%',
|
|
103
|
+
foreground: '210 40% 98%',
|
|
104
|
+
card: '222.2 47.4% 14%',
|
|
105
|
+
card_foreground: '210 40% 98%',
|
|
106
|
+
popover: '222.2 47.4% 14%',
|
|
107
|
+
popover_foreground: '210 40% 98%',
|
|
108
|
+
primary: '210 40% 98%',
|
|
109
|
+
primary_foreground: '222.2 47.4% 11.2%',
|
|
110
|
+
secondary: '217.2 32.6% 17.5%',
|
|
111
|
+
secondary_foreground: '210 40% 98%',
|
|
112
|
+
muted: '217.2 32.6% 17.5%',
|
|
113
|
+
muted_foreground: '215 20.2% 65.1%',
|
|
114
|
+
accent: '217.2 32.6% 17.5%',
|
|
115
|
+
accent_foreground: '210 40% 98%',
|
|
116
|
+
destructive: '0 62.8% 30.6%',
|
|
117
|
+
destructive_foreground: '210 40% 98%',
|
|
118
|
+
border: '217.2 32.6% 17.5%',
|
|
119
|
+
input: '217.2 32.6% 17.5%',
|
|
120
|
+
ring: '212.7 26.8% 83.9%',
|
|
121
|
+
brand: '210 40% 98%',
|
|
122
|
+
brand_foreground: '222.2 47.4% 11.2%',
|
|
123
|
+
};
|
|
124
|
+
|
|
125
|
+
export const SVEDA_APPEARANCE_PRESETS: Record<SvedaAppearancePresetId, Required<Pick<SvedaAppearance, 'preset' | 'radius'>> & {
|
|
126
|
+
tokens: SvedaAppearanceTokens;
|
|
127
|
+
dark_tokens: SvedaAppearanceTokens;
|
|
128
|
+
}> = {
|
|
129
|
+
default: {
|
|
130
|
+
preset: 'default',
|
|
131
|
+
radius: '0px',
|
|
132
|
+
tokens: { ...NEUTRAL_LIGHT },
|
|
133
|
+
dark_tokens: { ...NEUTRAL_DARK },
|
|
134
|
+
},
|
|
135
|
+
lms: {
|
|
136
|
+
preset: 'lms',
|
|
137
|
+
radius: '0px',
|
|
138
|
+
tokens: {
|
|
139
|
+
...NEUTRAL_LIGHT,
|
|
140
|
+
accent: '275 60% 96%',
|
|
141
|
+
ring: '275 96% 52%',
|
|
142
|
+
brand: '275 96% 52%',
|
|
143
|
+
brand_foreground: '0 0% 98%',
|
|
144
|
+
},
|
|
145
|
+
dark_tokens: {
|
|
146
|
+
...NEUTRAL_DARK,
|
|
147
|
+
accent: '275 40% 18%',
|
|
148
|
+
ring: '275 100% 62%',
|
|
149
|
+
brand: '275 100% 42%',
|
|
150
|
+
brand_foreground: '0 0% 98%',
|
|
151
|
+
},
|
|
152
|
+
},
|
|
153
|
+
ocean: {
|
|
154
|
+
preset: 'ocean',
|
|
155
|
+
radius: '0px',
|
|
156
|
+
tokens: {
|
|
157
|
+
...NEUTRAL_LIGHT,
|
|
158
|
+
background: '214 40% 98%',
|
|
159
|
+
accent: '214 80% 96%',
|
|
160
|
+
ring: '221 83% 53%',
|
|
161
|
+
brand: '221 83% 53%',
|
|
162
|
+
brand_foreground: '0 0% 98%',
|
|
163
|
+
},
|
|
164
|
+
dark_tokens: {
|
|
165
|
+
...NEUTRAL_DARK,
|
|
166
|
+
accent: '217 40% 18%',
|
|
167
|
+
ring: '213 94% 68%',
|
|
168
|
+
brand: '213 94% 68%',
|
|
169
|
+
brand_foreground: '222.2 47.4% 11.2%',
|
|
170
|
+
},
|
|
171
|
+
},
|
|
172
|
+
forest: {
|
|
173
|
+
preset: 'forest',
|
|
174
|
+
radius: '0px',
|
|
175
|
+
tokens: {
|
|
176
|
+
...NEUTRAL_LIGHT,
|
|
177
|
+
background: '168 25% 98%',
|
|
178
|
+
card: '150 20% 99%',
|
|
179
|
+
popover: '150 20% 99%',
|
|
180
|
+
accent: '166 30% 94%',
|
|
181
|
+
ring: '166 72% 32%',
|
|
182
|
+
brand: '166 72% 32%',
|
|
183
|
+
brand_foreground: '0 0% 98%',
|
|
184
|
+
},
|
|
185
|
+
dark_tokens: {
|
|
186
|
+
...NEUTRAL_DARK,
|
|
187
|
+
accent: '166 28% 18%',
|
|
188
|
+
ring: '166 50% 52%',
|
|
189
|
+
brand: '166 50% 52%',
|
|
190
|
+
brand_foreground: '222.2 47.4% 11.2%',
|
|
191
|
+
},
|
|
192
|
+
},
|
|
193
|
+
sunset: {
|
|
194
|
+
preset: 'sunset',
|
|
195
|
+
radius: '0px',
|
|
196
|
+
tokens: {
|
|
197
|
+
...NEUTRAL_LIGHT,
|
|
198
|
+
background: '28 45% 98%',
|
|
199
|
+
card: '30 50% 99%',
|
|
200
|
+
popover: '30 50% 99%',
|
|
201
|
+
accent: '20 70% 95%',
|
|
202
|
+
ring: '16 82% 50%',
|
|
203
|
+
brand: '16 82% 50%',
|
|
204
|
+
brand_foreground: '0 0% 98%',
|
|
205
|
+
},
|
|
206
|
+
dark_tokens: {
|
|
207
|
+
...NEUTRAL_DARK,
|
|
208
|
+
accent: '16 40% 18%',
|
|
209
|
+
ring: '18 85% 62%',
|
|
210
|
+
brand: '18 85% 62%',
|
|
211
|
+
brand_foreground: '222.2 47.4% 11.2%',
|
|
212
|
+
},
|
|
213
|
+
},
|
|
214
|
+
sand: {
|
|
215
|
+
preset: 'sand',
|
|
216
|
+
radius: '0px',
|
|
217
|
+
tokens: {
|
|
218
|
+
...NEUTRAL_LIGHT,
|
|
219
|
+
background: '40 33% 97%',
|
|
220
|
+
card: '40 40% 99%',
|
|
221
|
+
popover: '40 40% 99%',
|
|
222
|
+
muted: '36 24% 93%',
|
|
223
|
+
accent: '36 30% 93%',
|
|
224
|
+
border: '36 18% 86%',
|
|
225
|
+
input: '36 22% 94%',
|
|
226
|
+
ring: '28 35% 24%',
|
|
227
|
+
brand: '28 35% 24%',
|
|
228
|
+
brand_foreground: '40 33% 97%',
|
|
229
|
+
},
|
|
230
|
+
dark_tokens: {
|
|
231
|
+
...NEUTRAL_DARK,
|
|
232
|
+
background: '30 12% 11%',
|
|
233
|
+
card: '30 10% 14%',
|
|
234
|
+
popover: '30 10% 14%',
|
|
235
|
+
accent: '30 12% 18%',
|
|
236
|
+
border: '30 10% 20%',
|
|
237
|
+
input: '30 10% 18%',
|
|
238
|
+
ring: '36 35% 72%',
|
|
239
|
+
brand: '36 35% 72%',
|
|
240
|
+
brand_foreground: '30 12% 11%',
|
|
241
|
+
},
|
|
242
|
+
},
|
|
243
|
+
};
|
|
244
|
+
|
|
245
|
+
const isPresetId = (value: unknown): value is SvedaAppearancePresetId =>
|
|
246
|
+
typeof value === 'string' && (SVEDA_APPEARANCE_PRESET_IDS as readonly string[]).includes(value);
|
|
247
|
+
|
|
248
|
+
const HSL_PATTERN = /^\d{1,3}(?:\.\d+)?\s+\d{1,3}(?:\.\d+)?%\s+\d{1,3}(?:\.\d+)?%$/;
|
|
249
|
+
const RADIUS_PATTERN = /^\d+(?:\.\d+)?(?:px|rem|em)$/;
|
|
250
|
+
|
|
251
|
+
const tokenCssName = (key: string): string => `--sveda-${key.replace(/_/g, '-')}`;
|
|
252
|
+
|
|
253
|
+
export const isSvedaHsl = (value: unknown): value is string =>
|
|
254
|
+
typeof value === 'string' && HSL_PATTERN.test(value.trim());
|
|
255
|
+
|
|
256
|
+
export const sanitizeSvedaTheme = (value: unknown): SvedaAppearanceTheme | undefined =>
|
|
257
|
+
value === 'light' || value === 'dark' ? value : undefined;
|
|
258
|
+
|
|
259
|
+
const isLauncherIconId = (value: unknown): value is SvedaLauncherIconId =>
|
|
260
|
+
typeof value === 'string' && (SVEDA_LAUNCHER_ICON_IDS as readonly string[]).includes(value);
|
|
261
|
+
|
|
262
|
+
export const sanitizeSvedaLauncherImage = (value: unknown): string => {
|
|
263
|
+
if (typeof value !== 'string') {
|
|
264
|
+
return '';
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
const trimmed = value.trim();
|
|
268
|
+
if (trimmed === '') {
|
|
269
|
+
return '';
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
const dataMatch = trimmed.match(/^data:image\/(png|jpeg|jpg|webp|gif);base64,([A-Za-z0-9+/=\s]+)$/i);
|
|
273
|
+
if (dataMatch) {
|
|
274
|
+
const payload = dataMatch[2].replace(/\s+/g, '');
|
|
275
|
+
const detected = dataMatch[1].toLowerCase() === 'jpg' ? 'jpeg' : dataMatch[1].toLowerCase();
|
|
276
|
+
const normalized = `data:image/${detected};base64,${payload}`;
|
|
277
|
+
if (normalized.length > SVEDA_LAUNCHER_IMAGE_MAX_CHARS) {
|
|
278
|
+
return '';
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
return normalized;
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
if (/^https?:\/\//i.test(trimmed) && trimmed.length <= 2048) {
|
|
285
|
+
try {
|
|
286
|
+
const url = new URL(trimmed);
|
|
287
|
+
if (url.protocol === 'http:' || url.protocol === 'https:') {
|
|
288
|
+
return trimmed;
|
|
289
|
+
}
|
|
290
|
+
} catch {
|
|
291
|
+
return '';
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
if (
|
|
296
|
+
trimmed.startsWith('/') &&
|
|
297
|
+
!trimmed.startsWith('//') &&
|
|
298
|
+
!trimmed.includes('..') &&
|
|
299
|
+
!trimmed.includes('\\') &&
|
|
300
|
+
!/[\s<>"']/.test(trimmed) &&
|
|
301
|
+
trimmed.length <= 2048
|
|
302
|
+
) {
|
|
303
|
+
return trimmed;
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
return '';
|
|
307
|
+
};
|
|
308
|
+
|
|
309
|
+
export const sanitizeSvedaLauncher = (launcher: SvedaAppearance['launcher'] | null | undefined): SvedaAppearanceLauncher => {
|
|
310
|
+
const label = typeof launcher?.label === 'string' ? launcher.label.trim().replace(/\s+/g, ' ').slice(0, 64) : '';
|
|
311
|
+
const icon = isLauncherIconId(launcher?.icon) ? launcher.icon : SVEDA_DEFAULT_LAUNCHER_ICON;
|
|
312
|
+
|
|
313
|
+
return { label, icon, image: sanitizeSvedaLauncherImage(launcher?.image) };
|
|
314
|
+
};
|
|
315
|
+
|
|
316
|
+
export const svedaLauncher = reactive<SvedaAppearanceLauncher>(sanitizeSvedaLauncher(null));
|
|
317
|
+
|
|
318
|
+
export const useSvedaLauncher = (): SvedaAppearanceLauncher => svedaLauncher;
|
|
319
|
+
|
|
320
|
+
export const sanitizeSvedaRadius = (value: unknown): string | null => {
|
|
321
|
+
if (typeof value === 'number' && Number.isFinite(value)) {
|
|
322
|
+
return `${Math.max(0, Math.min(64, Math.round(value)))}px`;
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
if (typeof value !== 'string') {
|
|
326
|
+
return null;
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
const trimmed = value.trim();
|
|
330
|
+
if (trimmed === '0') {
|
|
331
|
+
return '0px';
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
if (!RADIUS_PATTERN.test(trimmed)) {
|
|
335
|
+
return null;
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
return trimmed;
|
|
339
|
+
};
|
|
340
|
+
|
|
341
|
+
export const parseRadiusPx = (value: unknown): number => {
|
|
342
|
+
const raw = String(value ?? '').trim();
|
|
343
|
+
const match = raw.match(/^([\d.]+)(px|rem|em)$/);
|
|
344
|
+
if (!match) {
|
|
345
|
+
return raw === '0' ? 0 : 0;
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
const amount = Number(match[1]);
|
|
349
|
+
if (!Number.isFinite(amount)) {
|
|
350
|
+
return 0;
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
if (match[2] === 'px') {
|
|
354
|
+
return Math.max(0, Math.min(64, amount));
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
return Math.max(0, Math.min(64, amount * 16));
|
|
358
|
+
};
|
|
359
|
+
|
|
360
|
+
export const formatRadiusPx = (px: number): string => `${Math.round(Math.max(0, Math.min(64, px)))}px`;
|
|
361
|
+
|
|
362
|
+
export const hslToHex = (hsl: string): string => {
|
|
363
|
+
const match = String(hsl)
|
|
364
|
+
.trim()
|
|
365
|
+
.match(/^([\d.]+)\s+([\d.]+)%\s+([\d.]+)%$/);
|
|
366
|
+
if (!match) {
|
|
367
|
+
return '#000000';
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
const h = (((Number(match[1]) % 360) + 360) % 360) / 360;
|
|
371
|
+
const s = Math.min(100, Math.max(0, Number(match[2]))) / 100;
|
|
372
|
+
const l = Math.min(100, Math.max(0, Number(match[3]))) / 100;
|
|
373
|
+
const a = s * Math.min(l, 1 - l);
|
|
374
|
+
const f = (n: number): string => {
|
|
375
|
+
const k = (n + h * 12) % 12;
|
|
376
|
+
const color = l - a * Math.max(Math.min(k - 3, 9 - k, 1), -1);
|
|
377
|
+
|
|
378
|
+
return Math.round(255 * color)
|
|
379
|
+
.toString(16)
|
|
380
|
+
.padStart(2, '0');
|
|
381
|
+
};
|
|
382
|
+
|
|
383
|
+
return `#${f(0)}${f(8)}${f(4)}`;
|
|
384
|
+
};
|
|
385
|
+
|
|
386
|
+
export const hexToHsl = (hex: string): string => {
|
|
387
|
+
const raw = hex.replace('#', '').trim();
|
|
388
|
+
const full = raw.length === 3 ? raw.split('').map((char) => char + char).join('') : raw;
|
|
389
|
+
if (!/^[\da-f]{6}$/i.test(full)) {
|
|
390
|
+
return '0 0% 0%';
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
const r = parseInt(full.slice(0, 2), 16) / 255;
|
|
394
|
+
const g = parseInt(full.slice(2, 4), 16) / 255;
|
|
395
|
+
const b = parseInt(full.slice(4, 6), 16) / 255;
|
|
396
|
+
const max = Math.max(r, g, b);
|
|
397
|
+
const min = Math.min(r, g, b);
|
|
398
|
+
const l = (max + min) / 2;
|
|
399
|
+
let h = 0;
|
|
400
|
+
let s = 0;
|
|
401
|
+
|
|
402
|
+
if (max !== min) {
|
|
403
|
+
const d = max - min;
|
|
404
|
+
s = l > 0.5 ? d / (2 - max - min) : d / (max + min);
|
|
405
|
+
switch (max) {
|
|
406
|
+
case r:
|
|
407
|
+
h = (g - b) / d + (g < b ? 6 : 0);
|
|
408
|
+
break;
|
|
409
|
+
case g:
|
|
410
|
+
h = (b - r) / d + 2;
|
|
411
|
+
break;
|
|
412
|
+
default:
|
|
413
|
+
h = (r - g) / d + 4;
|
|
414
|
+
break;
|
|
415
|
+
}
|
|
416
|
+
h *= 60;
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
return `${Math.round(h)} ${Math.round(s * 100)}% ${Math.round(l * 100)}%`;
|
|
420
|
+
};
|
|
421
|
+
|
|
422
|
+
const unwrapHsl = (value: unknown): string | null => {
|
|
423
|
+
if (typeof value !== 'string') {
|
|
424
|
+
return null;
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
let next = value.trim();
|
|
428
|
+
next = next.replace(/^hsla?\(/i, '');
|
|
429
|
+
next = next.replace(/\)$/, '').trim();
|
|
430
|
+
|
|
431
|
+
return HSL_PATTERN.test(next) ? next : null;
|
|
432
|
+
};
|
|
433
|
+
|
|
434
|
+
const overlayTokens = (tokens: SvedaAppearance['tokens']): Partial<SvedaAppearanceTokens> => {
|
|
435
|
+
const clean: Partial<SvedaAppearanceTokens> = {};
|
|
436
|
+
if (!tokens || typeof tokens !== 'object') {
|
|
437
|
+
return clean;
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
for (const key of SVEDA_TOKEN_KEYS) {
|
|
441
|
+
const value = unwrapHsl(tokens[key]);
|
|
442
|
+
if (value) {
|
|
443
|
+
clean[key] = value;
|
|
444
|
+
}
|
|
445
|
+
}
|
|
446
|
+
|
|
447
|
+
return clean;
|
|
448
|
+
};
|
|
449
|
+
|
|
450
|
+
const mergeTokens = (base: SvedaAppearanceTokens, overlay: Partial<SvedaAppearanceTokens>): SvedaAppearanceTokens => {
|
|
451
|
+
const merged = { ...base };
|
|
452
|
+
for (const key of SVEDA_TOKEN_KEYS) {
|
|
453
|
+
const value = overlay[key];
|
|
454
|
+
if (value) {
|
|
455
|
+
merged[key] = value;
|
|
456
|
+
}
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
return merged;
|
|
460
|
+
};
|
|
461
|
+
|
|
462
|
+
const sameTokens = (left: SvedaAppearanceTokens, right: SvedaAppearanceTokens): boolean =>
|
|
463
|
+
SVEDA_TOKEN_KEYS.every((key) => left[key] === right[key]);
|
|
464
|
+
|
|
465
|
+
export const resolveSvedaAppearance = (appearance: SvedaAppearance | null | undefined): SvedaAppearance | null => {
|
|
466
|
+
if (!appearance || typeof appearance !== 'object') {
|
|
467
|
+
return null;
|
|
468
|
+
}
|
|
469
|
+
|
|
470
|
+
const legacyRounded = appearance.preset === 'rounded';
|
|
471
|
+
const namedId = isPresetId(appearance.preset)
|
|
472
|
+
? appearance.preset
|
|
473
|
+
: legacyRounded
|
|
474
|
+
? 'forest'
|
|
475
|
+
: 'default';
|
|
476
|
+
const named = SVEDA_APPEARANCE_PRESETS[namedId];
|
|
477
|
+
const tokenOverlay = overlayTokens(appearance.tokens);
|
|
478
|
+
const darkOverlay = overlayTokens(appearance.dark_tokens);
|
|
479
|
+
const tokens =
|
|
480
|
+
Object.keys(tokenOverlay).length === 0 ? named.tokens : mergeTokens(named.tokens, tokenOverlay);
|
|
481
|
+
const darkTokens =
|
|
482
|
+
Object.keys(darkOverlay).length === 0 ? named.dark_tokens : mergeTokens(named.dark_tokens, darkOverlay);
|
|
483
|
+
const radius = Object.prototype.hasOwnProperty.call(appearance, 'radius')
|
|
484
|
+
? (sanitizeSvedaRadius(appearance.radius) ?? '0px')
|
|
485
|
+
: legacyRounded
|
|
486
|
+
? '20px'
|
|
487
|
+
: named.radius;
|
|
488
|
+
const customTokens = !sameTokens(tokens, named.tokens) || !sameTokens(darkTokens, named.dark_tokens);
|
|
489
|
+
|
|
490
|
+
const theme = sanitizeSvedaTheme(appearance.theme);
|
|
491
|
+
const launcher = sanitizeSvedaLauncher(appearance.launcher);
|
|
492
|
+
|
|
493
|
+
if (appearance.preset === 'custom' || customTokens) {
|
|
494
|
+
return {
|
|
495
|
+
preset: 'custom',
|
|
496
|
+
radius,
|
|
497
|
+
...(theme ? { theme } : {}),
|
|
498
|
+
tokens,
|
|
499
|
+
dark_tokens: darkTokens,
|
|
500
|
+
launcher,
|
|
501
|
+
};
|
|
502
|
+
}
|
|
503
|
+
|
|
504
|
+
return {
|
|
505
|
+
preset: named.preset,
|
|
506
|
+
radius,
|
|
507
|
+
...(theme ? { theme } : {}),
|
|
508
|
+
tokens: named.tokens,
|
|
509
|
+
dark_tokens: named.dark_tokens,
|
|
510
|
+
launcher,
|
|
511
|
+
};
|
|
512
|
+
};
|
|
513
|
+
|
|
514
|
+
const declarations = (tokens: Record<string, string> | undefined, radius: string): string => {
|
|
515
|
+
const parts = [`--sveda-radius:${radius}`];
|
|
516
|
+
for (const key of SVEDA_TOKEN_KEYS) {
|
|
517
|
+
const value = unwrapHsl(tokens?.[key]);
|
|
518
|
+
if (!value) {
|
|
519
|
+
continue;
|
|
520
|
+
}
|
|
521
|
+
|
|
522
|
+
parts.push(`${tokenCssName(key)}:${value}`);
|
|
523
|
+
}
|
|
524
|
+
|
|
525
|
+
return parts.join(';');
|
|
526
|
+
};
|
|
527
|
+
|
|
528
|
+
export const buildAppearanceCss = (appearance: SvedaAppearance | null | undefined): string => {
|
|
529
|
+
const resolved = resolveSvedaAppearance(appearance);
|
|
530
|
+
if (!resolved) {
|
|
531
|
+
return '';
|
|
532
|
+
}
|
|
533
|
+
|
|
534
|
+
const radius = sanitizeSvedaRadius(resolved.radius) ?? '0px';
|
|
535
|
+
const light = declarations(resolved.tokens as Record<string, string> | undefined, radius);
|
|
536
|
+
const dark = declarations(resolved.dark_tokens as Record<string, string> | undefined, radius);
|
|
537
|
+
const theme = sanitizeSvedaTheme(resolved.theme);
|
|
538
|
+
|
|
539
|
+
if (theme === 'dark') {
|
|
540
|
+
return `.sveda-chat{${dark}}`;
|
|
541
|
+
}
|
|
542
|
+
|
|
543
|
+
if (theme === 'light') {
|
|
544
|
+
return `.sveda-chat{${light}}`;
|
|
545
|
+
}
|
|
546
|
+
|
|
547
|
+
return `.sveda-chat{${light}}.dark .sveda-chat,.sveda-chat.dark{${dark}}`;
|
|
548
|
+
};
|
|
549
|
+
|
|
550
|
+
export const applySvedaAppearance = (appearance: SvedaAppearance | null | undefined): void => {
|
|
551
|
+
const launcher = sanitizeSvedaLauncher(resolveSvedaAppearance(appearance)?.launcher);
|
|
552
|
+
svedaLauncher.label = launcher.label;
|
|
553
|
+
svedaLauncher.icon = launcher.icon;
|
|
554
|
+
svedaLauncher.image = launcher.image;
|
|
555
|
+
|
|
556
|
+
if (typeof document === 'undefined') {
|
|
557
|
+
return;
|
|
558
|
+
}
|
|
559
|
+
|
|
560
|
+
let style = document.getElementById(SVEDA_APPEARANCE_STYLE_ID) as HTMLStyleElement | null;
|
|
561
|
+
if (!style) {
|
|
562
|
+
style = document.createElement('style');
|
|
563
|
+
style.id = SVEDA_APPEARANCE_STYLE_ID;
|
|
564
|
+
document.head.appendChild(style);
|
|
565
|
+
}
|
|
566
|
+
|
|
567
|
+
style.textContent = buildAppearanceCss(appearance);
|
|
568
|
+
};
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { useAnimatedText } from '../../lib/useAnimatedText.js';
|
|
3
|
+
import { nextTick, ref, watch } from 'vue';
|
|
4
|
+
|
|
5
|
+
const props = defineProps({
|
|
6
|
+
animated: {
|
|
7
|
+
type: Boolean,
|
|
8
|
+
default: false,
|
|
9
|
+
},
|
|
10
|
+
text: {
|
|
11
|
+
type: String,
|
|
12
|
+
default: '',
|
|
13
|
+
},
|
|
14
|
+
maxHeight: {
|
|
15
|
+
type: String,
|
|
16
|
+
default: '10rem',
|
|
17
|
+
},
|
|
18
|
+
showMask: {
|
|
19
|
+
type: Boolean,
|
|
20
|
+
default: true,
|
|
21
|
+
},
|
|
22
|
+
variant: {
|
|
23
|
+
type: String,
|
|
24
|
+
default: 'mono',
|
|
25
|
+
},
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
const contentRef = ref(null);
|
|
29
|
+
const translateY = ref(0);
|
|
30
|
+
const displayedText = useAnimatedText(() => props.text, {
|
|
31
|
+
enabled: () => props.animated,
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
function updateTranslate() {
|
|
35
|
+
if (!contentRef.value) return;
|
|
36
|
+
const container = contentRef.value.parentElement;
|
|
37
|
+
if (!container) return;
|
|
38
|
+
const contentHeight = contentRef.value.offsetHeight;
|
|
39
|
+
const containerHeight = container.offsetHeight;
|
|
40
|
+
const overflow = Math.max(0, contentHeight - containerHeight);
|
|
41
|
+
translateY.value = -overflow;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
watch(
|
|
45
|
+
displayedText,
|
|
46
|
+
() => {
|
|
47
|
+
nextTick(updateTranslate);
|
|
48
|
+
},
|
|
49
|
+
{ flush: 'post' }
|
|
50
|
+
);
|
|
51
|
+
</script>
|
|
52
|
+
|
|
53
|
+
<template>
|
|
54
|
+
<div
|
|
55
|
+
class="animated-stream-block"
|
|
56
|
+
:class="{ 'animated-stream-block--masked': showMask }"
|
|
57
|
+
:style="{ height: maxHeight }"
|
|
58
|
+
>
|
|
59
|
+
<div
|
|
60
|
+
ref="contentRef"
|
|
61
|
+
class="animated-stream-block__content"
|
|
62
|
+
:class="{ 'animated-stream-block__content--mono': variant === 'mono' }"
|
|
63
|
+
:style="{ transform: `translateY(${translateY}px)` }"
|
|
64
|
+
>
|
|
65
|
+
{{ displayedText }}
|
|
66
|
+
</div>
|
|
67
|
+
</div>
|
|
68
|
+
</template>
|
|
69
|
+
|
|
70
|
+
<style scoped>
|
|
71
|
+
.animated-stream-block {
|
|
72
|
+
overflow: hidden;
|
|
73
|
+
position: relative;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.animated-stream-block--masked {
|
|
77
|
+
mask-image: linear-gradient(to bottom, transparent 0%, black 12%, black 88%, transparent 100%);
|
|
78
|
+
-webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 12%, black 88%, transparent 100%);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.animated-stream-block__content {
|
|
82
|
+
font-size: 0.7rem;
|
|
83
|
+
line-height: 1.5;
|
|
84
|
+
color: hsl(var(--muted-foreground) / 0.9);
|
|
85
|
+
white-space: pre-wrap;
|
|
86
|
+
word-break: break-word;
|
|
87
|
+
padding: 0.25rem 0;
|
|
88
|
+
transition: transform 0.3s ease-out;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.animated-stream-block__content--mono {
|
|
92
|
+
font-family: ui-monospace, monospace;
|
|
93
|
+
}
|
|
94
|
+
</style>
|