@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,539 @@
|
|
|
1
|
+
import { useMediaQuery, useWindowSize } from '@vueuse/core';
|
|
2
|
+
import { computed, inject, onBeforeUnmount, onMounted, ref, watch, type ComputedRef, type Ref } from 'vue';
|
|
3
|
+
import { SvedaFillHostKey, SvedaHostEmbedKey } from '../plugin';
|
|
4
|
+
|
|
5
|
+
const CHAT_STORAGE_KEY = 'sveda.chat-dimensions';
|
|
6
|
+
const VIEW_MODE_STORAGE_KEY = 'sveda.chat-view-mode';
|
|
7
|
+
const FIXED_WIDTH_STORAGE_KEY = 'sveda.chat-fixed-width';
|
|
8
|
+
|
|
9
|
+
export const SVEDA_CHAT_LAYOUT_MIN_WIDTH = 320;
|
|
10
|
+
export const SVEDA_CHAT_LAYOUT_MIN_HEIGHT = 400;
|
|
11
|
+
export const SVEDA_CHAT_LAYOUT_MAX_WIDTH = 800;
|
|
12
|
+
export const SVEDA_CHAT_LAYOUT_MAX_HEIGHT = 900;
|
|
13
|
+
export const SVEDA_CHAT_MAIN_CONTENT_MIN_WIDTH = 768;
|
|
14
|
+
|
|
15
|
+
const MIN_WIDTH = SVEDA_CHAT_LAYOUT_MIN_WIDTH;
|
|
16
|
+
const MIN_HEIGHT = SVEDA_CHAT_LAYOUT_MIN_HEIGHT;
|
|
17
|
+
const MAX_WIDTH = SVEDA_CHAT_LAYOUT_MAX_WIDTH;
|
|
18
|
+
const MAX_HEIGHT = SVEDA_CHAT_LAYOUT_MAX_HEIGHT;
|
|
19
|
+
const DEFAULT_WIDTH = 384;
|
|
20
|
+
const DEFAULT_HEIGHT = 600;
|
|
21
|
+
const DEFAULT_FIXED_WIDTH = 400;
|
|
22
|
+
const FIXED_RESIZE_BODY_CLASS = 'sveda-chat-fixed-resizing';
|
|
23
|
+
const FIXED_MODE_BODY_CLASS = 'sveda-chat-fixed-mode';
|
|
24
|
+
const IMMERSIVE_BODY_CLASS = 'sveda-chat-immersive-mode';
|
|
25
|
+
const CHAT_WIDTH_CSS_VAR = '--sveda-chat-width';
|
|
26
|
+
const EMBED_WIDTH_CSS_VAR = '--sveda-embed-width';
|
|
27
|
+
const EMBED_HEIGHT_CSS_VAR = '--sveda-embed-height';
|
|
28
|
+
const IMMERSIVE_MODE_TRANSITION_MS = 300;
|
|
29
|
+
|
|
30
|
+
export type SvedaChatViewMode = 'floating' | 'fixed' | 'immersive';
|
|
31
|
+
|
|
32
|
+
export const useSvedaChatLayout = (isMinimized: ComputedRef<boolean>) => {
|
|
33
|
+
const hostEmbed = inject(SvedaHostEmbedKey, false);
|
|
34
|
+
const fillHost = inject(SvedaFillHostKey, false);
|
|
35
|
+
const isViewportMobile = useMediaQuery('(max-width: 768px)');
|
|
36
|
+
const { width: windowWidth, height: windowHeight } = useWindowSize();
|
|
37
|
+
|
|
38
|
+
const isMobile = computed(() => isViewportMobile.value);
|
|
39
|
+
|
|
40
|
+
const chatWidth = ref(DEFAULT_WIDTH);
|
|
41
|
+
const chatHeight = ref(DEFAULT_HEIGHT);
|
|
42
|
+
const fixedWidth = ref(DEFAULT_FIXED_WIDTH);
|
|
43
|
+
const viewMode: Ref<SvedaChatViewMode> = ref(hostEmbed ? 'floating' : 'fixed');
|
|
44
|
+
const lastNonImmersiveViewMode: Ref<SvedaChatViewMode> = ref(hostEmbed ? 'floating' : 'fixed');
|
|
45
|
+
const isResizing = ref(false);
|
|
46
|
+
const resizeDirection = ref<string | null>(null);
|
|
47
|
+
const isEnteringImmersiveFromDrag = ref(false);
|
|
48
|
+
const isImmersiveModeTransitioning = ref(false);
|
|
49
|
+
let immersiveFromDragTimer: ReturnType<typeof setTimeout> | null = null;
|
|
50
|
+
let immersiveModeTransitionTimer: ReturnType<typeof setTimeout> | null = null;
|
|
51
|
+
let immersiveModeTransitionResolve: (() => void) | null = null;
|
|
52
|
+
|
|
53
|
+
const clearImmersiveFromDragTimer = () => {
|
|
54
|
+
if (immersiveFromDragTimer != null) {
|
|
55
|
+
clearTimeout(immersiveFromDragTimer);
|
|
56
|
+
immersiveFromDragTimer = null;
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
const finishImmersiveFromDrag = () => {
|
|
61
|
+
clearImmersiveFromDragTimer();
|
|
62
|
+
isEnteringImmersiveFromDrag.value = false;
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
const finishImmersiveModeTransition = () => {
|
|
66
|
+
if (immersiveModeTransitionTimer != null) {
|
|
67
|
+
clearTimeout(immersiveModeTransitionTimer);
|
|
68
|
+
immersiveModeTransitionTimer = null;
|
|
69
|
+
}
|
|
70
|
+
isImmersiveModeTransitioning.value = false;
|
|
71
|
+
if (immersiveModeTransitionResolve) {
|
|
72
|
+
immersiveModeTransitionResolve();
|
|
73
|
+
immersiveModeTransitionResolve = null;
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
const startImmersiveModeTransition = () => {
|
|
78
|
+
finishImmersiveModeTransition();
|
|
79
|
+
isImmersiveModeTransitioning.value = true;
|
|
80
|
+
return new Promise<void>(resolve => {
|
|
81
|
+
immersiveModeTransitionResolve = resolve;
|
|
82
|
+
immersiveModeTransitionTimer = setTimeout(() => {
|
|
83
|
+
immersiveModeTransitionTimer = null;
|
|
84
|
+
isImmersiveModeTransitioning.value = false;
|
|
85
|
+
immersiveModeTransitionResolve = null;
|
|
86
|
+
resolve();
|
|
87
|
+
}, IMMERSIVE_MODE_TRANSITION_MS);
|
|
88
|
+
});
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
const applyChatWidthVar = (px: number | null) => {
|
|
92
|
+
document.documentElement.style.removeProperty(CHAT_WIDTH_CSS_VAR);
|
|
93
|
+
if (px == null) {
|
|
94
|
+
document.body.style.removeProperty(CHAT_WIDTH_CSS_VAR);
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
document.body.style.setProperty(CHAT_WIDTH_CSS_VAR, `${px}px`);
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
const maxFixedSplitWidth = computed(() =>
|
|
101
|
+
Math.max(MIN_WIDTH, windowWidth.value - SVEDA_CHAT_MAIN_CONTENT_MIN_WIDTH)
|
|
102
|
+
);
|
|
103
|
+
|
|
104
|
+
const isImmersiveDesktop = computed(
|
|
105
|
+
() => !isMobile.value && !isMinimized.value && viewMode.value === 'immersive'
|
|
106
|
+
);
|
|
107
|
+
|
|
108
|
+
const chatCardStyle = computed(() => {
|
|
109
|
+
if (isMobile.value || fillHost) {
|
|
110
|
+
return { width: '100%', height: '100%' };
|
|
111
|
+
}
|
|
112
|
+
if (viewMode.value === 'immersive') {
|
|
113
|
+
return { width: '100%', height: '100%' };
|
|
114
|
+
}
|
|
115
|
+
if (viewMode.value === 'fixed') {
|
|
116
|
+
return { width: 'var(--sveda-chat-width)', height: '100%' };
|
|
117
|
+
}
|
|
118
|
+
return { width: `${chatWidth.value}px`, height: `${chatHeight.value}px` };
|
|
119
|
+
});
|
|
120
|
+
|
|
121
|
+
const chatShellStyle = computed(() => {
|
|
122
|
+
if (fillHost && !isMinimized.value) {
|
|
123
|
+
return { width: '100%', height: '100%' };
|
|
124
|
+
}
|
|
125
|
+
if (isMobile.value || isMinimized.value) {
|
|
126
|
+
return undefined;
|
|
127
|
+
}
|
|
128
|
+
if (viewMode.value === 'immersive') {
|
|
129
|
+
return { width: '100vw', height: '100dvh' };
|
|
130
|
+
}
|
|
131
|
+
if (viewMode.value === 'fixed') {
|
|
132
|
+
return { width: 'var(--sveda-chat-width)', height: '100dvh' };
|
|
133
|
+
}
|
|
134
|
+
return undefined;
|
|
135
|
+
});
|
|
136
|
+
|
|
137
|
+
const applyEmbedHostSize = () => {
|
|
138
|
+
if (typeof document === 'undefined' || !fillHost) {
|
|
139
|
+
return;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
document.documentElement.style.setProperty(EMBED_WIDTH_CSS_VAR, `${chatWidth.value}px`);
|
|
143
|
+
document.documentElement.style.setProperty(EMBED_HEIGHT_CSS_VAR, `${chatHeight.value}px`);
|
|
144
|
+
};
|
|
145
|
+
|
|
146
|
+
const clearEmbedHostSize = () => {
|
|
147
|
+
if (typeof document === 'undefined' || !fillHost) {
|
|
148
|
+
return;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
document.documentElement.style.removeProperty(EMBED_WIDTH_CSS_VAR);
|
|
152
|
+
document.documentElement.style.removeProperty(EMBED_HEIGHT_CSS_VAR);
|
|
153
|
+
};
|
|
154
|
+
|
|
155
|
+
const loadChatDimensions = () => {
|
|
156
|
+
try {
|
|
157
|
+
const saved = localStorage.getItem(CHAT_STORAGE_KEY);
|
|
158
|
+
if (saved) {
|
|
159
|
+
const { width, height } = JSON.parse(saved) as { width: number; height: number };
|
|
160
|
+
chatWidth.value = Math.max(MIN_WIDTH, Math.min(MAX_WIDTH, width));
|
|
161
|
+
chatHeight.value = Math.max(MIN_HEIGHT, Math.min(MAX_HEIGHT, height));
|
|
162
|
+
}
|
|
163
|
+
} catch (error) {
|
|
164
|
+
console.warn('Failed to load chat dimensions:', error);
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
if (!hostEmbed) {
|
|
168
|
+
try {
|
|
169
|
+
const savedMode = localStorage.getItem(VIEW_MODE_STORAGE_KEY);
|
|
170
|
+
if (
|
|
171
|
+
savedMode &&
|
|
172
|
+
(savedMode === 'floating' || savedMode === 'fixed' || savedMode === 'immersive')
|
|
173
|
+
) {
|
|
174
|
+
viewMode.value = savedMode;
|
|
175
|
+
if (savedMode === 'floating' || savedMode === 'fixed') {
|
|
176
|
+
lastNonImmersiveViewMode.value = savedMode;
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
} catch (error) {
|
|
180
|
+
console.warn('Failed to load view mode:', error);
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
try {
|
|
185
|
+
const savedFixedWidth = localStorage.getItem(FIXED_WIDTH_STORAGE_KEY);
|
|
186
|
+
if (savedFixedWidth) {
|
|
187
|
+
const width = parseInt(savedFixedWidth, 10);
|
|
188
|
+
const room =
|
|
189
|
+
typeof window !== 'undefined'
|
|
190
|
+
? Math.max(MIN_WIDTH, window.innerWidth - SVEDA_CHAT_MAIN_CONTENT_MIN_WIDTH)
|
|
191
|
+
: MAX_WIDTH;
|
|
192
|
+
if (!isNaN(width) && width >= MIN_WIDTH) {
|
|
193
|
+
fixedWidth.value = Math.min(room, width);
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
} catch (error) {
|
|
197
|
+
console.warn('Failed to load fixed width:', error);
|
|
198
|
+
}
|
|
199
|
+
};
|
|
200
|
+
|
|
201
|
+
const saveChatDimensions = () => {
|
|
202
|
+
try {
|
|
203
|
+
localStorage.setItem(
|
|
204
|
+
CHAT_STORAGE_KEY,
|
|
205
|
+
JSON.stringify({
|
|
206
|
+
width: chatWidth.value,
|
|
207
|
+
height: chatHeight.value,
|
|
208
|
+
})
|
|
209
|
+
);
|
|
210
|
+
} catch (error) {
|
|
211
|
+
console.warn('Failed to save chat dimensions:', error);
|
|
212
|
+
}
|
|
213
|
+
};
|
|
214
|
+
|
|
215
|
+
const saveViewMode = () => {
|
|
216
|
+
if (hostEmbed) {
|
|
217
|
+
return;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
try {
|
|
221
|
+
localStorage.setItem(VIEW_MODE_STORAGE_KEY, viewMode.value);
|
|
222
|
+
} catch (error) {
|
|
223
|
+
console.warn('Failed to save view mode:', error);
|
|
224
|
+
}
|
|
225
|
+
};
|
|
226
|
+
|
|
227
|
+
const saveFixedWidth = () => {
|
|
228
|
+
try {
|
|
229
|
+
localStorage.setItem(FIXED_WIDTH_STORAGE_KEY, String(fixedWidth.value));
|
|
230
|
+
} catch (error) {
|
|
231
|
+
console.warn('Failed to save fixed width:', error);
|
|
232
|
+
}
|
|
233
|
+
};
|
|
234
|
+
|
|
235
|
+
const clearFixedResizeBodyClass = () => {
|
|
236
|
+
document.body.classList.remove(FIXED_RESIZE_BODY_CLASS);
|
|
237
|
+
};
|
|
238
|
+
|
|
239
|
+
const updateBodyClass = () => {
|
|
240
|
+
if (hostEmbed) {
|
|
241
|
+
document.body.classList.remove(IMMERSIVE_BODY_CLASS);
|
|
242
|
+
document.body.classList.remove(FIXED_MODE_BODY_CLASS);
|
|
243
|
+
clearFixedResizeBodyClass();
|
|
244
|
+
applyChatWidthVar(null);
|
|
245
|
+
return;
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
document.body.classList.remove(IMMERSIVE_BODY_CLASS);
|
|
249
|
+
if (isMobile.value) {
|
|
250
|
+
document.body.classList.remove(FIXED_MODE_BODY_CLASS);
|
|
251
|
+
clearFixedResizeBodyClass();
|
|
252
|
+
applyChatWidthVar(null);
|
|
253
|
+
return;
|
|
254
|
+
}
|
|
255
|
+
if (viewMode.value === 'immersive' && !isMinimized.value) {
|
|
256
|
+
document.body.classList.remove(FIXED_MODE_BODY_CLASS);
|
|
257
|
+
document.body.classList.add(IMMERSIVE_BODY_CLASS);
|
|
258
|
+
clearFixedResizeBodyClass();
|
|
259
|
+
applyChatWidthVar(null);
|
|
260
|
+
return;
|
|
261
|
+
}
|
|
262
|
+
if (viewMode.value === 'fixed' && !isMinimized.value) {
|
|
263
|
+
document.body.classList.add(FIXED_MODE_BODY_CLASS);
|
|
264
|
+
applyChatWidthVar(fixedWidth.value);
|
|
265
|
+
} else {
|
|
266
|
+
document.body.classList.remove(FIXED_MODE_BODY_CLASS);
|
|
267
|
+
clearFixedResizeBodyClass();
|
|
268
|
+
applyChatWidthVar(null);
|
|
269
|
+
}
|
|
270
|
+
};
|
|
271
|
+
|
|
272
|
+
const toggleViewMode = () => {
|
|
273
|
+
if (viewMode.value === 'immersive') {
|
|
274
|
+
return;
|
|
275
|
+
}
|
|
276
|
+
viewMode.value = viewMode.value === 'floating' ? 'fixed' : 'floating';
|
|
277
|
+
saveViewMode();
|
|
278
|
+
updateBodyClass();
|
|
279
|
+
};
|
|
280
|
+
|
|
281
|
+
const enterImmersiveMode = () => {
|
|
282
|
+
if (isMobile.value || viewMode.value === 'immersive') {
|
|
283
|
+
return;
|
|
284
|
+
}
|
|
285
|
+
finishImmersiveFromDrag();
|
|
286
|
+
void startImmersiveModeTransition();
|
|
287
|
+
lastNonImmersiveViewMode.value = viewMode.value;
|
|
288
|
+
viewMode.value = 'immersive';
|
|
289
|
+
saveViewMode();
|
|
290
|
+
updateBodyClass();
|
|
291
|
+
};
|
|
292
|
+
|
|
293
|
+
const exitImmersiveMode = async () => {
|
|
294
|
+
if (viewMode.value !== 'immersive') {
|
|
295
|
+
return;
|
|
296
|
+
}
|
|
297
|
+
finishImmersiveFromDrag();
|
|
298
|
+
const transitionDone = startImmersiveModeTransition();
|
|
299
|
+
viewMode.value = lastNonImmersiveViewMode.value;
|
|
300
|
+
saveViewMode();
|
|
301
|
+
updateBodyClass();
|
|
302
|
+
await transitionDone;
|
|
303
|
+
};
|
|
304
|
+
|
|
305
|
+
const collapseImmersiveToDefaultFixedMode = async () => {
|
|
306
|
+
if (viewMode.value !== 'immersive') {
|
|
307
|
+
return;
|
|
308
|
+
}
|
|
309
|
+
finishImmersiveFromDrag();
|
|
310
|
+
fixedWidth.value = Math.min(DEFAULT_FIXED_WIDTH, maxFixedSplitWidth.value);
|
|
311
|
+
lastNonImmersiveViewMode.value = 'fixed';
|
|
312
|
+
const transitionDone = startImmersiveModeTransition();
|
|
313
|
+
viewMode.value = 'fixed';
|
|
314
|
+
saveFixedWidth();
|
|
315
|
+
saveViewMode();
|
|
316
|
+
updateBodyClass();
|
|
317
|
+
await transitionDone;
|
|
318
|
+
};
|
|
319
|
+
|
|
320
|
+
const startResize = (direction: string, event: MouseEvent) => {
|
|
321
|
+
event.preventDefault();
|
|
322
|
+
event.stopPropagation();
|
|
323
|
+
isResizing.value = true;
|
|
324
|
+
resizeDirection.value = direction;
|
|
325
|
+
|
|
326
|
+
const pointerCaptureEl =
|
|
327
|
+
event.currentTarget instanceof HTMLElement ? event.currentTarget : null;
|
|
328
|
+
let pointerCaptureId: number | null = null;
|
|
329
|
+
if (pointerCaptureEl?.setPointerCapture) {
|
|
330
|
+
const fromEvent =
|
|
331
|
+
'pointerId' in event ? Number((event as PointerEvent).pointerId) : Number.NaN;
|
|
332
|
+
const candidates = Number.isFinite(fromEvent) ? [fromEvent] : [1];
|
|
333
|
+
for (const id of candidates) {
|
|
334
|
+
try {
|
|
335
|
+
pointerCaptureEl.setPointerCapture(id);
|
|
336
|
+
pointerCaptureId = id;
|
|
337
|
+
break;
|
|
338
|
+
} catch {
|
|
339
|
+
continue;
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
const releasePointerCaptureIfAny = () => {
|
|
345
|
+
if (
|
|
346
|
+
pointerCaptureEl &&
|
|
347
|
+
pointerCaptureId !== null &&
|
|
348
|
+
typeof pointerCaptureEl.releasePointerCapture === 'function'
|
|
349
|
+
) {
|
|
350
|
+
try {
|
|
351
|
+
pointerCaptureEl.releasePointerCapture(pointerCaptureId);
|
|
352
|
+
} catch {
|
|
353
|
+
pointerCaptureId = null;
|
|
354
|
+
return;
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
pointerCaptureId = null;
|
|
358
|
+
};
|
|
359
|
+
|
|
360
|
+
const startX = event.clientX;
|
|
361
|
+
const startY = event.clientY;
|
|
362
|
+
const startWidth = viewMode.value === 'fixed' ? fixedWidth.value : chatWidth.value;
|
|
363
|
+
const startHeight = chatHeight.value;
|
|
364
|
+
|
|
365
|
+
if (viewMode.value === 'fixed' && direction === 'fixed-left') {
|
|
366
|
+
document.body.classList.add(FIXED_RESIZE_BODY_CLASS);
|
|
367
|
+
let dragFixedWidth = startWidth;
|
|
368
|
+
const reservePx = SVEDA_CHAT_MAIN_CONTENT_MIN_WIDTH;
|
|
369
|
+
const handleMouseMoveFixed = (e: MouseEvent) => {
|
|
370
|
+
if (!isResizing.value) return;
|
|
371
|
+
const deltaX = e.clientX - startX;
|
|
372
|
+
const newWidth = startWidth - deltaX;
|
|
373
|
+
const maxChat = window.innerWidth - reservePx;
|
|
374
|
+
const endFixedResize = () => {
|
|
375
|
+
releasePointerCaptureIfAny();
|
|
376
|
+
isResizing.value = false;
|
|
377
|
+
resizeDirection.value = null;
|
|
378
|
+
clearFixedResizeBodyClass();
|
|
379
|
+
saveFixedWidth();
|
|
380
|
+
document.removeEventListener('mousemove', handleMouseMoveFixed);
|
|
381
|
+
document.removeEventListener('mouseup', handleMouseUpFixed);
|
|
382
|
+
};
|
|
383
|
+
if (newWidth > maxChat && maxChat >= MIN_WIDTH) {
|
|
384
|
+
dragFixedWidth = maxChat;
|
|
385
|
+
fixedWidth.value = maxChat;
|
|
386
|
+
lastNonImmersiveViewMode.value = 'fixed';
|
|
387
|
+
applyChatWidthVar(maxChat);
|
|
388
|
+
clearFixedResizeBodyClass();
|
|
389
|
+
isEnteringImmersiveFromDrag.value = true;
|
|
390
|
+
endFixedResize();
|
|
391
|
+
const targetW = typeof window !== 'undefined' ? window.innerWidth : maxChat;
|
|
392
|
+
requestAnimationFrame(() => {
|
|
393
|
+
requestAnimationFrame(() => {
|
|
394
|
+
applyChatWidthVar(targetW);
|
|
395
|
+
});
|
|
396
|
+
});
|
|
397
|
+
clearImmersiveFromDragTimer();
|
|
398
|
+
immersiveFromDragTimer = setTimeout(() => {
|
|
399
|
+
immersiveFromDragTimer = null;
|
|
400
|
+
viewMode.value = 'immersive';
|
|
401
|
+
saveViewMode();
|
|
402
|
+
updateBodyClass();
|
|
403
|
+
finishImmersiveFromDrag();
|
|
404
|
+
}, 320);
|
|
405
|
+
return;
|
|
406
|
+
}
|
|
407
|
+
const upper = Math.max(MIN_WIDTH, maxChat);
|
|
408
|
+
dragFixedWidth = Math.max(MIN_WIDTH, Math.min(upper, newWidth));
|
|
409
|
+
applyChatWidthVar(dragFixedWidth);
|
|
410
|
+
};
|
|
411
|
+
|
|
412
|
+
const handleMouseUpFixed = () => {
|
|
413
|
+
releasePointerCaptureIfAny();
|
|
414
|
+
fixedWidth.value = dragFixedWidth;
|
|
415
|
+
isResizing.value = false;
|
|
416
|
+
resizeDirection.value = null;
|
|
417
|
+
clearFixedResizeBodyClass();
|
|
418
|
+
saveFixedWidth();
|
|
419
|
+
updateBodyClass();
|
|
420
|
+
document.removeEventListener('mousemove', handleMouseMoveFixed);
|
|
421
|
+
document.removeEventListener('mouseup', handleMouseUpFixed);
|
|
422
|
+
};
|
|
423
|
+
|
|
424
|
+
document.addEventListener('mousemove', handleMouseMoveFixed);
|
|
425
|
+
document.addEventListener('mouseup', handleMouseUpFixed);
|
|
426
|
+
return;
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
const handleMouseMove = (e: MouseEvent) => {
|
|
430
|
+
if (!isResizing.value) return;
|
|
431
|
+
|
|
432
|
+
const deltaX = e.clientX - startX;
|
|
433
|
+
const deltaY = e.clientY - startY;
|
|
434
|
+
|
|
435
|
+
if (viewMode.value === 'floating' && resizeDirection.value) {
|
|
436
|
+
if (resizeDirection.value.includes('right')) {
|
|
437
|
+
chatWidth.value = Math.max(MIN_WIDTH, Math.min(MAX_WIDTH, startWidth + deltaX));
|
|
438
|
+
}
|
|
439
|
+
if (resizeDirection.value.includes('left')) {
|
|
440
|
+
chatWidth.value = Math.max(MIN_WIDTH, Math.min(MAX_WIDTH, startWidth - deltaX));
|
|
441
|
+
}
|
|
442
|
+
if (resizeDirection.value.includes('bottom')) {
|
|
443
|
+
chatHeight.value = Math.max(MIN_HEIGHT, Math.min(MAX_HEIGHT, startHeight + deltaY));
|
|
444
|
+
}
|
|
445
|
+
if (resizeDirection.value.includes('top')) {
|
|
446
|
+
chatHeight.value = Math.max(MIN_HEIGHT, Math.min(MAX_HEIGHT, startHeight - deltaY));
|
|
447
|
+
}
|
|
448
|
+
}
|
|
449
|
+
};
|
|
450
|
+
|
|
451
|
+
const handleMouseUp = () => {
|
|
452
|
+
releasePointerCaptureIfAny();
|
|
453
|
+
isResizing.value = false;
|
|
454
|
+
resizeDirection.value = null;
|
|
455
|
+
if (viewMode.value === 'floating') {
|
|
456
|
+
saveChatDimensions();
|
|
457
|
+
}
|
|
458
|
+
document.removeEventListener('mousemove', handleMouseMove);
|
|
459
|
+
document.removeEventListener('mouseup', handleMouseUp);
|
|
460
|
+
};
|
|
461
|
+
|
|
462
|
+
document.addEventListener('mousemove', handleMouseMove);
|
|
463
|
+
document.addEventListener('mouseup', handleMouseUp);
|
|
464
|
+
};
|
|
465
|
+
|
|
466
|
+
if (typeof window !== 'undefined') {
|
|
467
|
+
loadChatDimensions();
|
|
468
|
+
updateBodyClass();
|
|
469
|
+
applyEmbedHostSize();
|
|
470
|
+
}
|
|
471
|
+
|
|
472
|
+
onMounted(() => {
|
|
473
|
+
updateBodyClass();
|
|
474
|
+
applyEmbedHostSize();
|
|
475
|
+
});
|
|
476
|
+
|
|
477
|
+
onBeforeUnmount(() => {
|
|
478
|
+
clearImmersiveFromDragTimer();
|
|
479
|
+
finishImmersiveModeTransition();
|
|
480
|
+
isEnteringImmersiveFromDrag.value = false;
|
|
481
|
+
document.body.classList.remove(IMMERSIVE_BODY_CLASS);
|
|
482
|
+
document.body.classList.remove(FIXED_MODE_BODY_CLASS);
|
|
483
|
+
clearFixedResizeBodyClass();
|
|
484
|
+
clearEmbedHostSize();
|
|
485
|
+
});
|
|
486
|
+
|
|
487
|
+
watch([chatWidth, chatHeight], () => {
|
|
488
|
+
applyEmbedHostSize();
|
|
489
|
+
});
|
|
490
|
+
|
|
491
|
+
watch([maxFixedSplitWidth, () => viewMode.value, () => isMinimized.value], () => {
|
|
492
|
+
if (viewMode.value !== 'fixed' || isMinimized.value || isMobile.value) {
|
|
493
|
+
return;
|
|
494
|
+
}
|
|
495
|
+
if (fixedWidth.value > maxFixedSplitWidth.value) {
|
|
496
|
+
fixedWidth.value = maxFixedSplitWidth.value;
|
|
497
|
+
saveFixedWidth();
|
|
498
|
+
updateBodyClass();
|
|
499
|
+
}
|
|
500
|
+
});
|
|
501
|
+
|
|
502
|
+
watch([() => viewMode.value, () => isMinimized.value, () => isMobile.value], () => {
|
|
503
|
+
updateBodyClass();
|
|
504
|
+
});
|
|
505
|
+
|
|
506
|
+
watch(isMobile, mobile => {
|
|
507
|
+
if (mobile && viewMode.value === 'immersive') {
|
|
508
|
+
viewMode.value = lastNonImmersiveViewMode.value || 'fixed';
|
|
509
|
+
saveViewMode();
|
|
510
|
+
updateBodyClass();
|
|
511
|
+
}
|
|
512
|
+
});
|
|
513
|
+
|
|
514
|
+
return {
|
|
515
|
+
isMobile,
|
|
516
|
+
windowWidth,
|
|
517
|
+
windowHeight,
|
|
518
|
+
chatWidth,
|
|
519
|
+
chatHeight,
|
|
520
|
+
fixedWidth,
|
|
521
|
+
viewMode,
|
|
522
|
+
lastNonImmersiveViewMode,
|
|
523
|
+
isResizing,
|
|
524
|
+
isEnteringImmersiveFromDrag,
|
|
525
|
+
isImmersiveModeTransitioning,
|
|
526
|
+
resizeDirection,
|
|
527
|
+
maxFixedSplitWidth,
|
|
528
|
+
isImmersiveDesktop,
|
|
529
|
+
chatShellStyle,
|
|
530
|
+
chatCardStyle,
|
|
531
|
+
fillHost,
|
|
532
|
+
startResize,
|
|
533
|
+
toggleViewMode,
|
|
534
|
+
enterImmersiveMode,
|
|
535
|
+
exitImmersiveMode,
|
|
536
|
+
collapseImmersiveToDefaultFixedMode,
|
|
537
|
+
updateBodyClass,
|
|
538
|
+
};
|
|
539
|
+
};
|