@slexn/codecenter-ui 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +34 -0
- package/README.md +148 -0
- package/components.json +20 -0
- package/dist/codecenter-ui.cjs +10 -0
- package/dist/codecenter-ui.js +17995 -0
- package/dist/components/ui/accordion/Accordion.vue.d.ts +28 -0
- package/dist/components/ui/accordion/AccordionContent.vue.d.ts +22 -0
- package/dist/components/ui/accordion/AccordionItem.vue.d.ts +24 -0
- package/dist/components/ui/accordion/AccordionTrigger.vue.d.ts +22 -0
- package/dist/components/ui/accordion/index.d.ts +4 -0
- package/dist/components/ui/alert/Alert.vue.d.ts +32 -0
- package/dist/components/ui/alert/AlertDescription.vue.d.ts +24 -0
- package/dist/components/ui/alert/AlertTitle.vue.d.ts +24 -0
- package/dist/components/ui/alert/index.d.ts +4 -0
- package/dist/components/ui/alert/variants.d.ts +5 -0
- package/dist/components/ui/button/Button.vue.d.ts +27 -0
- package/dist/components/ui/button/index.d.ts +2 -0
- package/dist/components/ui/button/variants.d.ts +6 -0
- package/dist/components/ui/button-group/ButtonGroup.vue.d.ts +25 -0
- package/dist/components/ui/button-group/index.d.ts +2 -0
- package/dist/components/ui/card/Card.vue.d.ts +21 -0
- package/dist/components/ui/card/CardContent.vue.d.ts +21 -0
- package/dist/components/ui/card/CardDescription.vue.d.ts +21 -0
- package/dist/components/ui/card/CardFooter.vue.d.ts +21 -0
- package/dist/components/ui/card/CardHeader.vue.d.ts +21 -0
- package/dist/components/ui/card/CardTitle.vue.d.ts +21 -0
- package/dist/components/ui/card/index.d.ts +6 -0
- package/dist/components/ui/chart/Chart.vue.d.ts +92 -0
- package/dist/components/ui/chart/index.d.ts +2 -0
- package/dist/components/ui/chat/Chat.vue.d.ts +190 -0
- package/dist/components/ui/chat/ChatAttachments.vue.d.ts +11 -0
- package/dist/components/ui/chat/ChatCodeBlock.vue.d.ts +16 -0
- package/dist/components/ui/chat/code-block.d.ts +27 -0
- package/dist/components/ui/chat/index.d.ts +6 -0
- package/dist/components/ui/chat/types.d.ts +15 -0
- package/dist/components/ui/checkbox/Checkbox.vue.d.ts +29 -0
- package/dist/components/ui/checkbox/index.d.ts +1 -0
- package/dist/components/ui/commit/Commit.vue.d.ts +62 -0
- package/dist/components/ui/commit/index.d.ts +2 -0
- package/dist/components/ui/contribution-graph/ContributionGraph.vue.d.ts +87 -0
- package/dist/components/ui/contribution-graph/index.d.ts +2 -0
- package/dist/components/ui/data-table/DataTable.vue.d.ts +109 -0
- package/dist/components/ui/data-table/index.d.ts +2 -0
- package/dist/components/ui/date-picker/DatePicker.vue.d.ts +37 -0
- package/dist/components/ui/date-picker/index.d.ts +2 -0
- package/dist/components/ui/dialog/Dialog.vue.d.ts +25 -0
- package/dist/components/ui/dialog/DialogClose.vue.d.ts +18 -0
- package/dist/components/ui/dialog/DialogContent.vue.d.ts +39 -0
- package/dist/components/ui/dialog/DialogDescription.vue.d.ts +22 -0
- package/dist/components/ui/dialog/DialogFooter.vue.d.ts +21 -0
- package/dist/components/ui/dialog/DialogHeader.vue.d.ts +21 -0
- package/dist/components/ui/dialog/DialogOverlay.vue.d.ts +22 -0
- package/dist/components/ui/dialog/DialogScrollContent.vue.d.ts +36 -0
- package/dist/components/ui/dialog/DialogTitle.vue.d.ts +22 -0
- package/dist/components/ui/dialog/DialogTrigger.vue.d.ts +18 -0
- package/dist/components/ui/dialog/index.d.ts +10 -0
- package/dist/components/ui/diff/DiffTool.vue.d.ts +21 -0
- package/dist/components/ui/diff/diff-parser.d.ts +30 -0
- package/dist/components/ui/diff/diff-tool.d.ts +36 -0
- package/dist/components/ui/diff/index.d.ts +2 -0
- package/dist/components/ui/dropdown-menu/DropdownMenu.vue.d.ts +24 -0
- package/dist/components/ui/dropdown-menu/DropdownMenuCheckboxItem.vue.d.ts +29 -0
- package/dist/components/ui/dropdown-menu/DropdownMenuContent.vue.d.ts +36 -0
- package/dist/components/ui/dropdown-menu/DropdownMenuGroup.vue.d.ts +18 -0
- package/dist/components/ui/dropdown-menu/DropdownMenuItem.vue.d.ts +26 -0
- package/dist/components/ui/dropdown-menu/DropdownMenuLabel.vue.d.ts +23 -0
- package/dist/components/ui/dropdown-menu/DropdownMenuRadioGroup.vue.d.ts +22 -0
- package/dist/components/ui/dropdown-menu/DropdownMenuRadioItem.vue.d.ts +27 -0
- package/dist/components/ui/dropdown-menu/DropdownMenuSeparator.vue.d.ts +7 -0
- package/dist/components/ui/dropdown-menu/DropdownMenuShortcut.vue.d.ts +21 -0
- package/dist/components/ui/dropdown-menu/DropdownMenuSub.vue.d.ts +22 -0
- package/dist/components/ui/dropdown-menu/DropdownMenuSubContent.vue.d.ts +38 -0
- package/dist/components/ui/dropdown-menu/DropdownMenuSubTrigger.vue.d.ts +23 -0
- package/dist/components/ui/dropdown-menu/DropdownMenuTrigger.vue.d.ts +18 -0
- package/dist/components/ui/dropdown-menu/index.d.ts +15 -0
- package/dist/components/ui/gauge/Gauge.vue.d.ts +62 -0
- package/dist/components/ui/gauge/index.d.ts +2 -0
- package/dist/components/ui/git-graph/GitGraph.vue.d.ts +59 -0
- package/dist/components/ui/git-graph/index.d.ts +2 -0
- package/dist/components/ui/incident-timeline/IncidentTimeline.vue.d.ts +50 -0
- package/dist/components/ui/incident-timeline/index.d.ts +2 -0
- package/dist/components/ui/input/Input.vue.d.ts +14 -0
- package/dist/components/ui/input/InputControl.vue.d.ts +14 -0
- package/dist/components/ui/input/InputFieldGroup.vue.d.ts +21 -0
- package/dist/components/ui/input/index.d.ts +4 -0
- package/dist/components/ui/input/types.d.ts +31 -0
- package/dist/components/ui/kpi-card/KpiCard.vue.d.ts +46 -0
- package/dist/components/ui/kpi-card/index.d.ts +2 -0
- package/dist/components/ui/kpi-line-card/KpiLineCard.vue.d.ts +66 -0
- package/dist/components/ui/kpi-line-card/index.d.ts +2 -0
- package/dist/components/ui/model-selector/ModelSelector.vue.d.ts +41 -0
- package/dist/components/ui/model-selector/index.d.ts +2 -0
- package/dist/components/ui/model-selector/types.d.ts +12 -0
- package/dist/components/ui/network-graph/NetworkGraph.vue.d.ts +75 -0
- package/dist/components/ui/network-graph/index.d.ts +2 -0
- package/dist/components/ui/pagination/Pagination.vue.d.ts +29 -0
- package/dist/components/ui/pagination/PaginationContent.vue.d.ts +29 -0
- package/dist/components/ui/pagination/PaginationEllipsis.vue.d.ts +22 -0
- package/dist/components/ui/pagination/PaginationFirst.vue.d.ts +26 -0
- package/dist/components/ui/pagination/PaginationItem.vue.d.ts +28 -0
- package/dist/components/ui/pagination/PaginationLast.vue.d.ts +26 -0
- package/dist/components/ui/pagination/PaginationNext.vue.d.ts +26 -0
- package/dist/components/ui/pagination/PaginationPrevious.vue.d.ts +26 -0
- package/dist/components/ui/pagination/index.d.ts +8 -0
- package/dist/components/ui/profile/Profile.vue.d.ts +30 -0
- package/dist/components/ui/profile/ProfileGroup.vue.d.ts +37 -0
- package/dist/components/ui/profile/index.d.ts +4 -0
- package/dist/components/ui/progress/Progress.vue.d.ts +36 -0
- package/dist/components/ui/progress/index.d.ts +2 -0
- package/dist/components/ui/prompt-input/PromptInput.vue.d.ts +150 -0
- package/dist/components/ui/prompt-input/index.d.ts +2 -0
- package/dist/components/ui/prompt-input/types.d.ts +61 -0
- package/dist/components/ui/radio-group/RadioGroup.vue.d.ts +30 -0
- package/dist/components/ui/radio-group/RadioGroupItem.vue.d.ts +12 -0
- package/dist/components/ui/radio-group/RadioGroupOption.vue.d.ts +28 -0
- package/dist/components/ui/radio-group/index.d.ts +3 -0
- package/dist/components/ui/reasoning/Reasoning.vue.d.ts +40 -0
- package/dist/components/ui/reasoning/index.d.ts +2 -0
- package/dist/components/ui/reasoning/types.d.ts +26 -0
- package/dist/components/ui/select/Select.vue.d.ts +28 -0
- package/dist/components/ui/select/SelectContent.vue.d.ts +46 -0
- package/dist/components/ui/select/SelectGroup.vue.d.ts +18 -0
- package/dist/components/ui/select/SelectItem.vue.d.ts +26 -0
- package/dist/components/ui/select/SelectItemText.vue.d.ts +18 -0
- package/dist/components/ui/select/SelectLabel.vue.d.ts +22 -0
- package/dist/components/ui/select/SelectScrollDownButton.vue.d.ts +22 -0
- package/dist/components/ui/select/SelectScrollUpButton.vue.d.ts +22 -0
- package/dist/components/ui/select/SelectSeparator.vue.d.ts +7 -0
- package/dist/components/ui/select/SelectTrigger.vue.d.ts +25 -0
- package/dist/components/ui/select/SelectValue.vue.d.ts +18 -0
- package/dist/components/ui/select/index.d.ts +11 -0
- package/dist/components/ui/select/search.d.ts +18 -0
- package/dist/components/ui/separator/Separator.vue.d.ts +6 -0
- package/dist/components/ui/separator/index.d.ts +2 -0
- package/dist/components/ui/separator/types.d.ts +7 -0
- package/dist/components/ui/shimmer/Shimmer.vue.d.ts +37 -0
- package/dist/components/ui/shimmer/index.d.ts +2 -0
- package/dist/components/ui/sidebar/Sidebar.vue.d.ts +24 -0
- package/dist/components/ui/sidebar/SidebarContent.vue.d.ts +21 -0
- package/dist/components/ui/sidebar/SidebarFooter.vue.d.ts +21 -0
- package/dist/components/ui/sidebar/SidebarGroup.vue.d.ts +21 -0
- package/dist/components/ui/sidebar/SidebarGroupAction.vue.d.ts +24 -0
- package/dist/components/ui/sidebar/SidebarGroupContent.vue.d.ts +21 -0
- package/dist/components/ui/sidebar/SidebarGroupLabel.vue.d.ts +24 -0
- package/dist/components/ui/sidebar/SidebarHeader.vue.d.ts +21 -0
- package/dist/components/ui/sidebar/SidebarInput.vue.d.ts +6 -0
- package/dist/components/ui/sidebar/SidebarInset.vue.d.ts +21 -0
- package/dist/components/ui/sidebar/SidebarMenu.vue.d.ts +21 -0
- package/dist/components/ui/sidebar/SidebarMenuAction.vue.d.ts +25 -0
- package/dist/components/ui/sidebar/SidebarMenuBadge.vue.d.ts +21 -0
- package/dist/components/ui/sidebar/SidebarMenuButton.vue.d.ts +25 -0
- package/dist/components/ui/sidebar/SidebarMenuButtonChild.vue.d.ts +30 -0
- package/dist/components/ui/sidebar/SidebarMenuItem.vue.d.ts +21 -0
- package/dist/components/ui/sidebar/SidebarMenuSub.vue.d.ts +21 -0
- package/dist/components/ui/sidebar/SidebarMenuSubButton.vue.d.ts +27 -0
- package/dist/components/ui/sidebar/SidebarMenuSubItem.vue.d.ts +21 -0
- package/dist/components/ui/sidebar/SidebarProvider.vue.d.ts +36 -0
- package/dist/components/ui/sidebar/SidebarRail.vue.d.ts +21 -0
- package/dist/components/ui/sidebar/SidebarSeparator.vue.d.ts +6 -0
- package/dist/components/ui/sidebar/SidebarTrigger.vue.d.ts +6 -0
- package/dist/components/ui/sidebar/context.d.ts +19 -0
- package/dist/components/ui/sidebar/index.d.ts +26 -0
- package/dist/components/ui/sidebar/types.d.ts +11 -0
- package/dist/components/ui/sidebar/variants.d.ts +6 -0
- package/dist/components/ui/skeleton/Skeleton.vue.d.ts +18 -0
- package/dist/components/ui/skeleton/index.d.ts +2 -0
- package/dist/components/ui/sonner/Sonner.vue.d.ts +5 -0
- package/dist/components/ui/sonner/index.d.ts +2 -0
- package/dist/components/ui/spinner/Spinner.vue.d.ts +11 -0
- package/dist/components/ui/spinner/index.d.ts +1 -0
- package/dist/components/ui/stepper/Stepper.vue.d.ts +38 -0
- package/dist/components/ui/stepper/StepperDescription.vue.d.ts +22 -0
- package/dist/components/ui/stepper/StepperIndicator.vue.d.ts +30 -0
- package/dist/components/ui/stepper/StepperItem.vue.d.ts +24 -0
- package/dist/components/ui/stepper/StepperSeparator.vue.d.ts +7 -0
- package/dist/components/ui/stepper/StepperTitle.vue.d.ts +22 -0
- package/dist/components/ui/stepper/StepperTrigger.vue.d.ts +22 -0
- package/dist/components/ui/stepper/index.d.ts +7 -0
- package/dist/components/ui/switch/Switch.vue.d.ts +12 -0
- package/dist/components/ui/switch/index.d.ts +1 -0
- package/dist/components/ui/table/Table.vue.d.ts +22 -0
- package/dist/components/ui/table/TableBody.vue.d.ts +21 -0
- package/dist/components/ui/table/TableCaption.vue.d.ts +21 -0
- package/dist/components/ui/table/TableCell.vue.d.ts +22 -0
- package/dist/components/ui/table/TableEmpty.vue.d.ts +24 -0
- package/dist/components/ui/table/TableFooter.vue.d.ts +21 -0
- package/dist/components/ui/table/TableHead.vue.d.ts +21 -0
- package/dist/components/ui/table/TableHeader.vue.d.ts +21 -0
- package/dist/components/ui/table/TableRow.vue.d.ts +21 -0
- package/dist/components/ui/table/index.d.ts +9 -0
- package/dist/components/ui/tabs/Tabs.vue.d.ts +28 -0
- package/dist/components/ui/tabs/TabsContent.vue.d.ts +22 -0
- package/dist/components/ui/tabs/TabsList.vue.d.ts +22 -0
- package/dist/components/ui/tabs/TabsTrigger.vue.d.ts +22 -0
- package/dist/components/ui/tabs/index.d.ts +4 -0
- package/dist/components/ui/tag/Tag.vue.d.ts +35 -0
- package/dist/components/ui/tag/index.d.ts +2 -0
- package/dist/components/ui/tag/variants.d.ts +6 -0
- package/dist/components/ui/textarea/Textarea.vue.d.ts +14 -0
- package/dist/components/ui/textarea/TextareaControl.vue.d.ts +14 -0
- package/dist/components/ui/textarea/TextareaFieldGroup.vue.d.ts +21 -0
- package/dist/components/ui/textarea/index.d.ts +4 -0
- package/dist/components/ui/textarea/types.d.ts +32 -0
- package/dist/components/ui/tool/Tool.vue.d.ts +61 -0
- package/dist/components/ui/tool/index.d.ts +2 -0
- package/dist/components/ui/tooltip/Tooltip.vue.d.ts +24 -0
- package/dist/components/ui/tooltip/TooltipContent.vue.d.ts +32 -0
- package/dist/components/ui/tooltip/TooltipProvider.vue.d.ts +20 -0
- package/dist/components/ui/tooltip/TooltipTrigger.vue.d.ts +18 -0
- package/dist/components/ui/tooltip/index.d.ts +4 -0
- package/dist/docs/component-docs.d.ts +18 -0
- package/dist/docs/markdown.d.ts +27 -0
- package/dist/index.d.ts +45 -0
- package/dist/lib/code-highlight.d.ts +11 -0
- package/dist/lib/utils.d.ts +2 -0
- package/dist/styles.css +3 -0
- package/package.json +76 -0
- package/public/r/accordion.json +52 -0
- package/public/r/alert.json +51 -0
- package/public/r/button-group.json +31 -0
- package/public/r/button.json +39 -0
- package/public/r/card.json +61 -0
- package/public/r/chart.json +31 -0
- package/public/r/chat.json +186 -0
- package/public/r/checkbox.json +34 -0
- package/public/r/commit.json +32 -0
- package/public/r/contribution-graph.json +63 -0
- package/public/r/data-table.json +197 -0
- package/public/r/date-picker.json +33 -0
- package/public/r/dialog.json +88 -0
- package/public/r/diff.json +71 -0
- package/public/r/dropdown-menu.json +112 -0
- package/public/r/gauge.json +31 -0
- package/public/r/git-graph.json +32 -0
- package/public/r/incident-timeline.json +64 -0
- package/public/r/input.json +49 -0
- package/public/r/kpi-card.json +32 -0
- package/public/r/kpi-line-card.json +32 -0
- package/public/r/model-selector.json +148 -0
- package/public/r/network-graph.json +33 -0
- package/public/r/pagination.json +95 -0
- package/public/r/profile.json +37 -0
- package/public/r/progress.json +31 -0
- package/public/r/prompt-input.json +293 -0
- package/public/r/radio-group.json +45 -0
- package/public/r/reasoning.json +38 -0
- package/public/r/registry.json +2512 -0
- package/public/r/select.json +100 -0
- package/public/r/separator.json +37 -0
- package/public/r/shimmer.json +31 -0
- package/public/r/sidebar.json +221 -0
- package/public/r/skeleton.json +31 -0
- package/public/r/sonner.json +33 -0
- package/public/r/spinner.json +31 -0
- package/public/r/stepper.json +70 -0
- package/public/r/switch.json +33 -0
- package/public/r/table.json +79 -0
- package/public/r/tabs.json +51 -0
- package/public/r/tag.json +39 -0
- package/public/r/textarea.json +49 -0
- package/public/r/tool.json +32 -0
- package/public/r/tooltip.json +51 -0
- package/registry.json +2512 -0
- package/src/components/docs/MarkdownContent.vue +106 -0
- package/src/components/ui/accordion/Accordion.vue +24 -0
- package/src/components/ui/accordion/AccordionContent.vue +62 -0
- package/src/components/ui/accordion/AccordionItem.vue +23 -0
- package/src/components/ui/accordion/AccordionTrigger.vue +38 -0
- package/src/components/ui/accordion/index.ts +4 -0
- package/src/components/ui/alert/Alert.vue +40 -0
- package/src/components/ui/alert/AlertDescription.vue +24 -0
- package/src/components/ui/alert/AlertTitle.vue +24 -0
- package/src/components/ui/alert/index.ts +4 -0
- package/src/components/ui/alert/variants.ts +19 -0
- package/src/components/ui/button/Button.vue +27 -0
- package/src/components/ui/button/index.ts +2 -0
- package/src/components/ui/button/variants.ts +32 -0
- package/src/components/ui/button-group/ButtonGroup.vue +31 -0
- package/src/components/ui/button-group/index.ts +2 -0
- package/src/components/ui/card/Card.vue +17 -0
- package/src/components/ui/card/CardContent.vue +14 -0
- package/src/components/ui/card/CardDescription.vue +14 -0
- package/src/components/ui/card/CardFooter.vue +14 -0
- package/src/components/ui/card/CardHeader.vue +17 -0
- package/src/components/ui/card/CardTitle.vue +14 -0
- package/src/components/ui/card/index.ts +6 -0
- package/src/components/ui/chart/Chart.vue +1042 -0
- package/src/components/ui/chart/index.ts +13 -0
- package/src/components/ui/chat/Chat.vue +1297 -0
- package/src/components/ui/chat/ChatAttachments.vue +278 -0
- package/src/components/ui/chat/ChatCodeBlock.vue +283 -0
- package/src/components/ui/chat/code-block.ts +30 -0
- package/src/components/ui/chat/index.ts +24 -0
- package/src/components/ui/chat/types.ts +23 -0
- package/src/components/ui/checkbox/Checkbox.vue +38 -0
- package/src/components/ui/checkbox/index.ts +1 -0
- package/src/components/ui/commit/Commit.vue +423 -0
- package/src/components/ui/commit/index.ts +9 -0
- package/src/components/ui/contribution-graph/ContributionGraph.vue +719 -0
- package/src/components/ui/contribution-graph/index.ts +9 -0
- package/src/components/ui/data-table/DataTable.vue +534 -0
- package/src/components/ui/data-table/index.ts +9 -0
- package/src/components/ui/date-picker/DatePicker.vue +649 -0
- package/src/components/ui/date-picker/index.ts +7 -0
- package/src/components/ui/dialog/Dialog.vue +19 -0
- package/src/components/ui/dialog/DialogClose.vue +17 -0
- package/src/components/ui/dialog/DialogContent.vue +60 -0
- package/src/components/ui/dialog/DialogDescription.vue +23 -0
- package/src/components/ui/dialog/DialogFooter.vue +17 -0
- package/src/components/ui/dialog/DialogHeader.vue +17 -0
- package/src/components/ui/dialog/DialogOverlay.vue +23 -0
- package/src/components/ui/dialog/DialogScrollContent.vue +69 -0
- package/src/components/ui/dialog/DialogTitle.vue +23 -0
- package/src/components/ui/dialog/DialogTrigger.vue +17 -0
- package/src/components/ui/dialog/index.ts +10 -0
- package/src/components/ui/diff/DiffTool.vue +513 -0
- package/src/components/ui/diff/diff-parser.ts +423 -0
- package/src/components/ui/diff/diff-tool.ts +39 -0
- package/src/components/ui/diff/index.ts +5 -0
- package/src/components/ui/dropdown-menu/DropdownMenu.vue +19 -0
- package/src/components/ui/dropdown-menu/DropdownMenuCheckboxItem.vue +39 -0
- package/src/components/ui/dropdown-menu/DropdownMenuContent.vue +39 -0
- package/src/components/ui/dropdown-menu/DropdownMenuGroup.vue +15 -0
- package/src/components/ui/dropdown-menu/DropdownMenuItem.vue +31 -0
- package/src/components/ui/dropdown-menu/DropdownMenuLabel.vue +23 -0
- package/src/components/ui/dropdown-menu/DropdownMenuRadioGroup.vue +21 -0
- package/src/components/ui/dropdown-menu/DropdownMenuRadioItem.vue +40 -0
- package/src/components/ui/dropdown-menu/DropdownMenuSeparator.vue +23 -0
- package/src/components/ui/dropdown-menu/DropdownMenuShortcut.vue +17 -0
- package/src/components/ui/dropdown-menu/DropdownMenuSub.vue +18 -0
- package/src/components/ui/dropdown-menu/DropdownMenuSubContent.vue +27 -0
- package/src/components/ui/dropdown-menu/DropdownMenuSubTrigger.vue +31 -0
- package/src/components/ui/dropdown-menu/DropdownMenuTrigger.vue +17 -0
- package/src/components/ui/dropdown-menu/index.ts +16 -0
- package/src/components/ui/gauge/Gauge.vue +725 -0
- package/src/components/ui/gauge/index.ts +9 -0
- package/src/components/ui/git-graph/GitGraph.vue +715 -0
- package/src/components/ui/git-graph/index.ts +9 -0
- package/src/components/ui/incident-timeline/IncidentTimeline.vue +360 -0
- package/src/components/ui/incident-timeline/index.ts +7 -0
- package/src/components/ui/input/Input.vue +159 -0
- package/src/components/ui/input/InputControl.vue +135 -0
- package/src/components/ui/input/InputFieldGroup.vue +14 -0
- package/src/components/ui/input/index.ts +9 -0
- package/src/components/ui/input/types.ts +34 -0
- package/src/components/ui/kpi-card/KpiCard.vue +268 -0
- package/src/components/ui/kpi-card/index.ts +9 -0
- package/src/components/ui/kpi-line-card/KpiLineCard.vue +622 -0
- package/src/components/ui/kpi-line-card/index.ts +11 -0
- package/src/components/ui/model-selector/ModelSelector.vue +328 -0
- package/src/components/ui/model-selector/index.ts +6 -0
- package/src/components/ui/model-selector/types.ts +15 -0
- package/src/components/ui/network-graph/NetworkGraph.vue +902 -0
- package/src/components/ui/network-graph/index.ts +7 -0
- package/src/components/ui/pagination/Pagination.vue +26 -0
- package/src/components/ui/pagination/PaginationContent.vue +24 -0
- package/src/components/ui/pagination/PaginationEllipsis.vue +27 -0
- package/src/components/ui/pagination/PaginationFirst.vue +33 -0
- package/src/components/ui/pagination/PaginationItem.vue +39 -0
- package/src/components/ui/pagination/PaginationLast.vue +33 -0
- package/src/components/ui/pagination/PaginationNext.vue +33 -0
- package/src/components/ui/pagination/PaginationPrevious.vue +33 -0
- package/src/components/ui/pagination/index.ts +8 -0
- package/src/components/ui/profile/Profile.vue +226 -0
- package/src/components/ui/profile/ProfileGroup.vue +96 -0
- package/src/components/ui/profile/index.ts +8 -0
- package/src/components/ui/progress/Progress.vue +271 -0
- package/src/components/ui/progress/index.ts +9 -0
- package/src/components/ui/prompt-input/PromptInput.vue +1094 -0
- package/src/components/ui/prompt-input/index.ts +14 -0
- package/src/components/ui/prompt-input/types.ts +78 -0
- package/src/components/ui/radio-group/RadioGroup.vue +36 -0
- package/src/components/ui/radio-group/RadioGroupItem.vue +45 -0
- package/src/components/ui/radio-group/RadioGroupOption.vue +80 -0
- package/src/components/ui/radio-group/index.ts +3 -0
- package/src/components/ui/reasoning/Reasoning.vue +278 -0
- package/src/components/ui/reasoning/index.ts +8 -0
- package/src/components/ui/reasoning/types.ts +29 -0
- package/src/components/ui/select/Select.vue +19 -0
- package/src/components/ui/select/SelectContent.vue +166 -0
- package/src/components/ui/select/SelectGroup.vue +23 -0
- package/src/components/ui/select/SelectItem.vue +97 -0
- package/src/components/ui/select/SelectItemText.vue +15 -0
- package/src/components/ui/select/SelectLabel.vue +17 -0
- package/src/components/ui/select/SelectScrollDownButton.vue +26 -0
- package/src/components/ui/select/SelectScrollUpButton.vue +26 -0
- package/src/components/ui/select/SelectSeparator.vue +19 -0
- package/src/components/ui/select/SelectTrigger.vue +33 -0
- package/src/components/ui/select/SelectValue.vue +15 -0
- package/src/components/ui/select/index.ts +11 -0
- package/src/components/ui/select/search.ts +26 -0
- package/src/components/ui/separator/Separator.vue +30 -0
- package/src/components/ui/separator/index.ts +5 -0
- package/src/components/ui/separator/types.ts +9 -0
- package/src/components/ui/shimmer/Shimmer.vue +110 -0
- package/src/components/ui/shimmer/index.ts +5 -0
- package/src/components/ui/sidebar/Sidebar.vue +142 -0
- package/src/components/ui/sidebar/SidebarContent.vue +18 -0
- package/src/components/ui/sidebar/SidebarFooter.vue +18 -0
- package/src/components/ui/sidebar/SidebarGroup.vue +18 -0
- package/src/components/ui/sidebar/SidebarGroupAction.vue +31 -0
- package/src/components/ui/sidebar/SidebarGroupContent.vue +18 -0
- package/src/components/ui/sidebar/SidebarGroupLabel.vue +30 -0
- package/src/components/ui/sidebar/SidebarHeader.vue +18 -0
- package/src/components/ui/sidebar/SidebarInput.vue +26 -0
- package/src/components/ui/sidebar/SidebarInset.vue +23 -0
- package/src/components/ui/sidebar/SidebarMenu.vue +18 -0
- package/src/components/ui/sidebar/SidebarMenuAction.vue +34 -0
- package/src/components/ui/sidebar/SidebarMenuBadge.vue +25 -0
- package/src/components/ui/sidebar/SidebarMenuButton.vue +37 -0
- package/src/components/ui/sidebar/SidebarMenuButtonChild.vue +38 -0
- package/src/components/ui/sidebar/SidebarMenuItem.vue +18 -0
- package/src/components/ui/sidebar/SidebarMenuSub.vue +18 -0
- package/src/components/ui/sidebar/SidebarMenuSubButton.vue +36 -0
- package/src/components/ui/sidebar/SidebarMenuSubItem.vue +18 -0
- package/src/components/ui/sidebar/SidebarProvider.vue +119 -0
- package/src/components/ui/sidebar/SidebarRail.vue +35 -0
- package/src/components/ui/sidebar/SidebarSeparator.vue +18 -0
- package/src/components/ui/sidebar/SidebarTrigger.vue +28 -0
- package/src/components/ui/sidebar/context.ts +39 -0
- package/src/components/ui/sidebar/index.ts +43 -0
- package/src/components/ui/sidebar/types.ts +13 -0
- package/src/components/ui/sidebar/variants.ts +25 -0
- package/src/components/ui/skeleton/Skeleton.vue +53 -0
- package/src/components/ui/skeleton/index.ts +5 -0
- package/src/components/ui/sonner/Sonner.vue +69 -0
- package/src/components/ui/sonner/index.ts +12 -0
- package/src/components/ui/spinner/Spinner.vue +33 -0
- package/src/components/ui/spinner/index.ts +1 -0
- package/src/components/ui/stepper/Stepper.vue +29 -0
- package/src/components/ui/stepper/StepperDescription.vue +30 -0
- package/src/components/ui/stepper/StepperIndicator.vue +50 -0
- package/src/components/ui/stepper/StepperItem.vue +28 -0
- package/src/components/ui/stepper/StepperSeparator.vue +25 -0
- package/src/components/ui/stepper/StepperTitle.vue +27 -0
- package/src/components/ui/stepper/StepperTrigger.vue +27 -0
- package/src/components/ui/stepper/index.ts +7 -0
- package/src/components/ui/switch/Switch.vue +41 -0
- package/src/components/ui/switch/index.ts +1 -0
- package/src/components/ui/table/Table.vue +23 -0
- package/src/components/ui/table/TableBody.vue +17 -0
- package/src/components/ui/table/TableCaption.vue +17 -0
- package/src/components/ui/table/TableCell.vue +24 -0
- package/src/components/ui/table/TableEmpty.vue +31 -0
- package/src/components/ui/table/TableFooter.vue +17 -0
- package/src/components/ui/table/TableHead.vue +22 -0
- package/src/components/ui/table/TableHeader.vue +17 -0
- package/src/components/ui/table/TableRow.vue +22 -0
- package/src/components/ui/table/index.ts +9 -0
- package/src/components/ui/tabs/Tabs.vue +24 -0
- package/src/components/ui/tabs/TabsContent.vue +22 -0
- package/src/components/ui/tabs/TabsList.vue +27 -0
- package/src/components/ui/tabs/TabsTrigger.vue +27 -0
- package/src/components/ui/tabs/index.ts +4 -0
- package/src/components/ui/tag/Tag.vue +55 -0
- package/src/components/ui/tag/index.ts +2 -0
- package/src/components/ui/tag/variants.ts +29 -0
- package/src/components/ui/textarea/Textarea.vue +159 -0
- package/src/components/ui/textarea/TextareaControl.vue +120 -0
- package/src/components/ui/textarea/TextareaFieldGroup.vue +14 -0
- package/src/components/ui/textarea/index.ts +10 -0
- package/src/components/ui/textarea/types.ts +35 -0
- package/src/components/ui/tool/Tool.vue +304 -0
- package/src/components/ui/tool/index.ts +7 -0
- package/src/components/ui/tooltip/Tooltip.vue +19 -0
- package/src/components/ui/tooltip/TooltipContent.vue +44 -0
- package/src/components/ui/tooltip/TooltipProvider.vue +14 -0
- package/src/components/ui/tooltip/TooltipTrigger.vue +15 -0
- package/src/components/ui/tooltip/index.ts +4 -0
- package/src/lib/code-highlight.ts +220 -0
- package/src/lib/utils.ts +6 -0
- package/src/styles.css +684 -0
|
@@ -0,0 +1,715 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { computed } from "vue"
|
|
3
|
+
import type { CSSProperties, HTMLAttributes } from "vue"
|
|
4
|
+
import { GitCommitHorizontalIcon, GitForkIcon, TagIcon } from "@lucide/vue"
|
|
5
|
+
import { cn } from "@/lib/utils"
|
|
6
|
+
|
|
7
|
+
export type GitGraphSize = "sm" | "default" | "lg"
|
|
8
|
+
export type GitGraphRefType = "branch" | "head" | "remote" | "tag"
|
|
9
|
+
|
|
10
|
+
export interface GitGraphRef {
|
|
11
|
+
name: string
|
|
12
|
+
type?: GitGraphRefType
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export interface GitGraphCommit {
|
|
16
|
+
author?: string
|
|
17
|
+
date?: string
|
|
18
|
+
hash?: string
|
|
19
|
+
id: string
|
|
20
|
+
lane?: number
|
|
21
|
+
message: string
|
|
22
|
+
parents?: string[]
|
|
23
|
+
refs?: Array<string | GitGraphRef>
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export interface GitGraphSelectPayload {
|
|
27
|
+
commit: GitGraphCommit
|
|
28
|
+
index: number
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
interface NormalizedGitGraphRef extends GitGraphRef {
|
|
32
|
+
type: GitGraphRefType
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
interface GitGraphRow {
|
|
36
|
+
commit: GitGraphCommit
|
|
37
|
+
index: number
|
|
38
|
+
lane: number
|
|
39
|
+
parentIds: string[]
|
|
40
|
+
refs: NormalizedGitGraphRef[]
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
type GitGraphEdgeKind = "direct" | "branch" | "merge"
|
|
44
|
+
|
|
45
|
+
interface GitGraphEdge {
|
|
46
|
+
color: string
|
|
47
|
+
d: string
|
|
48
|
+
fromIndex: number
|
|
49
|
+
kind: GitGraphEdgeKind
|
|
50
|
+
lane: number
|
|
51
|
+
parentId: string
|
|
52
|
+
toIndex: number
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
interface GitGraphMetaItem {
|
|
56
|
+
class?: HTMLAttributes["class"]
|
|
57
|
+
slot: "git-graph-author" | "git-graph-date" | "git-graph-hash"
|
|
58
|
+
value: string
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export interface GitGraphProps {
|
|
62
|
+
class?: HTMLAttributes["class"]
|
|
63
|
+
commits?: GitGraphCommit[]
|
|
64
|
+
description?: string
|
|
65
|
+
emptyLabel?: string
|
|
66
|
+
laneColors?: string[]
|
|
67
|
+
modelValue?: string
|
|
68
|
+
selectable?: boolean
|
|
69
|
+
showAuthor?: boolean
|
|
70
|
+
showCommitIcon?: boolean
|
|
71
|
+
showDate?: boolean
|
|
72
|
+
showGraph?: boolean
|
|
73
|
+
showHash?: boolean
|
|
74
|
+
showMeta?: boolean
|
|
75
|
+
showRefs?: boolean
|
|
76
|
+
size?: GitGraphSize
|
|
77
|
+
summary?: string
|
|
78
|
+
title?: string
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
const props = withDefaults(defineProps<GitGraphProps>(), {
|
|
82
|
+
emptyLabel: "No commits.",
|
|
83
|
+
selectable: true,
|
|
84
|
+
showAuthor: true,
|
|
85
|
+
showCommitIcon: true,
|
|
86
|
+
showDate: true,
|
|
87
|
+
showGraph: true,
|
|
88
|
+
showHash: true,
|
|
89
|
+
showMeta: true,
|
|
90
|
+
showRefs: true,
|
|
91
|
+
size: "default",
|
|
92
|
+
})
|
|
93
|
+
|
|
94
|
+
const emit = defineEmits<{
|
|
95
|
+
"select": [payload: GitGraphSelectPayload]
|
|
96
|
+
"update:modelValue": [value: string]
|
|
97
|
+
}>()
|
|
98
|
+
|
|
99
|
+
const defaultLaneColors = [
|
|
100
|
+
"oklch(62.7% 0.194 149.214)",
|
|
101
|
+
"oklch(55.8% 0.288 302.321)",
|
|
102
|
+
"oklch(63.7% 0.237 25.331)",
|
|
103
|
+
"oklch(68.1% 0.162 75.834)",
|
|
104
|
+
"oklch(58.8% 0.158 241.966)",
|
|
105
|
+
"oklch(61.7% 0.19 204.36)",
|
|
106
|
+
]
|
|
107
|
+
|
|
108
|
+
const commits = computed(() => props.commits ?? [])
|
|
109
|
+
const rows = computed<GitGraphRow[]>(() => resolveRows(commits.value))
|
|
110
|
+
const rowByCommitId = computed(() => {
|
|
111
|
+
const rowMap = new Map<string, GitGraphRow>()
|
|
112
|
+
|
|
113
|
+
for (const row of rows.value) {
|
|
114
|
+
rowMap.set(row.commit.id, row)
|
|
115
|
+
|
|
116
|
+
if (row.commit.hash) {
|
|
117
|
+
rowMap.set(row.commit.hash, row)
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
return rowMap
|
|
122
|
+
})
|
|
123
|
+
const laneCount = computed(() => {
|
|
124
|
+
const lanes = rows.value.map((row) => row.lane)
|
|
125
|
+
|
|
126
|
+
return Math.max(1, Math.max(...lanes, 0) + 1)
|
|
127
|
+
})
|
|
128
|
+
const sizeClasses = computed(() => {
|
|
129
|
+
if (props.size === "sm") {
|
|
130
|
+
return {
|
|
131
|
+
content: "text-xs",
|
|
132
|
+
description: "text-xs",
|
|
133
|
+
graphIcon: "size-3.5",
|
|
134
|
+
hash: "text-[11px]",
|
|
135
|
+
header: "gap-2.5 px-3 py-2.5",
|
|
136
|
+
message: "text-xs",
|
|
137
|
+
meta: "gap-1.5 text-[11px]",
|
|
138
|
+
node: 7,
|
|
139
|
+
ref: "h-5.5 gap-1 px-1.5 text-[11px]",
|
|
140
|
+
refIcon: "size-3",
|
|
141
|
+
row: "h-11 px-3",
|
|
142
|
+
rowHeight: 44,
|
|
143
|
+
laneGap: 18,
|
|
144
|
+
lanePadding: 10,
|
|
145
|
+
rowPadding: 12,
|
|
146
|
+
title: "text-xs",
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
if (props.size === "lg") {
|
|
151
|
+
return {
|
|
152
|
+
content: "text-sm",
|
|
153
|
+
description: "text-sm",
|
|
154
|
+
graphIcon: "size-4.5",
|
|
155
|
+
hash: "text-xs",
|
|
156
|
+
header: "gap-3 px-5 py-4",
|
|
157
|
+
message: "text-sm",
|
|
158
|
+
meta: "gap-2 text-xs",
|
|
159
|
+
node: 10,
|
|
160
|
+
ref: "h-6.5 gap-1.5 px-2 text-xs",
|
|
161
|
+
refIcon: "size-3.5",
|
|
162
|
+
row: "h-15 px-5",
|
|
163
|
+
rowHeight: 60,
|
|
164
|
+
laneGap: 24,
|
|
165
|
+
lanePadding: 14,
|
|
166
|
+
rowPadding: 20,
|
|
167
|
+
title: "text-sm",
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
return {
|
|
172
|
+
content: "text-[13px]",
|
|
173
|
+
description: "text-sm",
|
|
174
|
+
graphIcon: "size-4",
|
|
175
|
+
hash: "text-xs",
|
|
176
|
+
header: "gap-2.5 px-4 py-3",
|
|
177
|
+
message: "text-[13px]",
|
|
178
|
+
meta: "gap-1.5 text-xs",
|
|
179
|
+
node: 9,
|
|
180
|
+
ref: "h-6 gap-1.5 px-2 text-xs",
|
|
181
|
+
refIcon: "size-3.5",
|
|
182
|
+
row: "h-13 px-4",
|
|
183
|
+
rowHeight: 52,
|
|
184
|
+
laneGap: 20,
|
|
185
|
+
lanePadding: 12,
|
|
186
|
+
rowPadding: 16,
|
|
187
|
+
title: "text-[13px]",
|
|
188
|
+
}
|
|
189
|
+
})
|
|
190
|
+
const hasHeader = computed(() => Boolean(props.title || props.description || props.summary))
|
|
191
|
+
const graphAreaWidth = computed(() =>
|
|
192
|
+
props.showGraph
|
|
193
|
+
? (sizeClasses.value.lanePadding * 2) + ((laneCount.value - 1) * sizeClasses.value.laneGap) + sizeClasses.value.node
|
|
194
|
+
: 0,
|
|
195
|
+
)
|
|
196
|
+
const graphHeight = computed(() => Math.max(rows.value.length, 1) * sizeClasses.value.rowHeight)
|
|
197
|
+
const graphStyle = computed<CSSProperties>(() => ({
|
|
198
|
+
minWidth: props.showGraph && graphAreaWidth.value > 180 ? `${graphAreaWidth.value + 240}px` : undefined,
|
|
199
|
+
}))
|
|
200
|
+
const svgStyle = computed<CSSProperties>(() => ({
|
|
201
|
+
height: `${graphHeight.value}px`,
|
|
202
|
+
left: `${sizeClasses.value.rowPadding}px`,
|
|
203
|
+
width: `${graphAreaWidth.value}px`,
|
|
204
|
+
}))
|
|
205
|
+
const edges = computed<GitGraphEdge[]>(() => {
|
|
206
|
+
const nextEdges: GitGraphEdge[] = []
|
|
207
|
+
|
|
208
|
+
for (const row of rows.value) {
|
|
209
|
+
for (const [parentIndex, parentId] of row.parentIds.entries()) {
|
|
210
|
+
const parentRow = rowByCommitId.value.get(parentId)
|
|
211
|
+
|
|
212
|
+
if (!parentRow || parentRow.index <= row.index) continue
|
|
213
|
+
const kind = edgeKind(row, parentRow, parentIndex)
|
|
214
|
+
const colorLane = parentIndex > 0 ? parentRow.lane : row.lane
|
|
215
|
+
|
|
216
|
+
nextEdges.push({
|
|
217
|
+
color: laneColor(colorLane),
|
|
218
|
+
d: edgePath(row, parentRow, parentIndex),
|
|
219
|
+
fromIndex: row.index,
|
|
220
|
+
kind,
|
|
221
|
+
lane: colorLane,
|
|
222
|
+
parentId,
|
|
223
|
+
toIndex: parentRow.index,
|
|
224
|
+
})
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
return nextEdges.sort((a, b) => edgeSortWeight(a.kind) - edgeSortWeight(b.kind))
|
|
229
|
+
})
|
|
230
|
+
|
|
231
|
+
function normalizeLane(value: number) {
|
|
232
|
+
if (!Number.isFinite(value)) return 0
|
|
233
|
+
|
|
234
|
+
return Math.max(0, Math.trunc(value))
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
function resolveRows(items: GitGraphCommit[]): GitGraphRow[] {
|
|
238
|
+
const aliasMap = buildAliasMap(items)
|
|
239
|
+
const activeLanes: Array<string | undefined> = []
|
|
240
|
+
const nextRows: GitGraphRow[] = []
|
|
241
|
+
|
|
242
|
+
for (const [index, commit] of items.entries()) {
|
|
243
|
+
const parentIds = normalizeParentIds(commit.parents)
|
|
244
|
+
const activeLane = findActiveLane(commit, activeLanes, aliasMap)
|
|
245
|
+
const hintedLane = typeof commit.lane === "number" ? normalizeLane(commit.lane) : undefined
|
|
246
|
+
const lane = activeLane ?? hintedLane ?? firstAvailableLane(activeLanes)
|
|
247
|
+
|
|
248
|
+
ensureLane(activeLanes, lane)
|
|
249
|
+
activeLanes[lane] = commit.id
|
|
250
|
+
removeDuplicateActiveRefs(activeLanes, commit, lane, aliasMap)
|
|
251
|
+
|
|
252
|
+
nextRows.push({
|
|
253
|
+
commit,
|
|
254
|
+
index,
|
|
255
|
+
lane,
|
|
256
|
+
parentIds,
|
|
257
|
+
refs: normalizeRefs(commit.refs),
|
|
258
|
+
})
|
|
259
|
+
|
|
260
|
+
if (parentIds[0]) {
|
|
261
|
+
activeLanes[lane] = parentIds[0]
|
|
262
|
+
} else {
|
|
263
|
+
activeLanes[lane] = undefined
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
for (const parentId of parentIds.slice(1)) {
|
|
267
|
+
if (findActiveRef(activeLanes, parentId, aliasMap) !== undefined) continue
|
|
268
|
+
|
|
269
|
+
const parentLane = firstAvailableLane(activeLanes, lane + 1)
|
|
270
|
+
ensureLane(activeLanes, parentLane)
|
|
271
|
+
activeLanes[parentLane] = parentId
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
trimInactiveLanes(activeLanes)
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
return nextRows
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
function normalizeParentIds(parents?: string[]) {
|
|
281
|
+
return (parents ?? []).filter((parentId) => parentId.trim().length > 0)
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
function buildAliasMap(items: GitGraphCommit[]) {
|
|
285
|
+
const aliasMap = new Map<string, Set<string>>()
|
|
286
|
+
|
|
287
|
+
for (const commit of items) {
|
|
288
|
+
const aliases = commitAliases(commit)
|
|
289
|
+
const aliasSet = new Set(aliases)
|
|
290
|
+
|
|
291
|
+
for (const alias of aliases) {
|
|
292
|
+
aliasMap.set(alias, aliasSet)
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
return aliasMap
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
function commitAliases(commit: GitGraphCommit) {
|
|
300
|
+
return [commit.id, commit.hash].filter((alias): alias is string => Boolean(alias))
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
function refsMatch(left: string, right: string, aliasMap: Map<string, Set<string>>) {
|
|
304
|
+
if (left === right) return true
|
|
305
|
+
|
|
306
|
+
return (aliasMap.get(left)?.has(right) ?? false) || (aliasMap.get(right)?.has(left) ?? false)
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
function findActiveLane(
|
|
310
|
+
commit: GitGraphCommit,
|
|
311
|
+
activeLanes: Array<string | undefined>,
|
|
312
|
+
aliasMap: Map<string, Set<string>>,
|
|
313
|
+
) {
|
|
314
|
+
const aliases = commitAliases(commit)
|
|
315
|
+
const lane = activeLanes.findIndex((activeRef) =>
|
|
316
|
+
Boolean(activeRef && aliases.some((alias) => refsMatch(activeRef, alias, aliasMap))),
|
|
317
|
+
)
|
|
318
|
+
|
|
319
|
+
return lane >= 0 ? lane : undefined
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
function findActiveRef(
|
|
323
|
+
activeLanes: Array<string | undefined>,
|
|
324
|
+
ref: string,
|
|
325
|
+
aliasMap: Map<string, Set<string>>,
|
|
326
|
+
) {
|
|
327
|
+
const lane = activeLanes.findIndex((activeRef) => Boolean(activeRef && refsMatch(activeRef, ref, aliasMap)))
|
|
328
|
+
|
|
329
|
+
return lane >= 0 ? lane : undefined
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
function firstAvailableLane(activeLanes: Array<string | undefined>, startAt = 0) {
|
|
333
|
+
for (let lane = Math.max(0, startAt); lane < activeLanes.length; lane += 1) {
|
|
334
|
+
if (!activeLanes[lane]) return lane
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
return activeLanes.length
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
function ensureLane(activeLanes: Array<string | undefined>, lane: number) {
|
|
341
|
+
while (activeLanes.length <= lane) {
|
|
342
|
+
activeLanes.push(undefined)
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
function removeDuplicateActiveRefs(
|
|
347
|
+
activeLanes: Array<string | undefined>,
|
|
348
|
+
commit: GitGraphCommit,
|
|
349
|
+
currentLane: number,
|
|
350
|
+
aliasMap: Map<string, Set<string>>,
|
|
351
|
+
) {
|
|
352
|
+
const aliases = commitAliases(commit)
|
|
353
|
+
|
|
354
|
+
for (const [lane, activeRef] of activeLanes.entries()) {
|
|
355
|
+
if (lane === currentLane || !activeRef) continue
|
|
356
|
+
|
|
357
|
+
if (aliases.some((alias) => refsMatch(activeRef, alias, aliasMap))) {
|
|
358
|
+
activeLanes[lane] = undefined
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
function trimInactiveLanes(activeLanes: Array<string | undefined>) {
|
|
364
|
+
while (activeLanes.length && !activeLanes[activeLanes.length - 1]) {
|
|
365
|
+
activeLanes.pop()
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
function normalizeRefs(refs?: Array<string | GitGraphRef>): NormalizedGitGraphRef[] {
|
|
370
|
+
return (refs ?? []).map((ref) => {
|
|
371
|
+
if (typeof ref === "string") {
|
|
372
|
+
return {
|
|
373
|
+
name: ref,
|
|
374
|
+
type: inferRefType(ref),
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
return {
|
|
379
|
+
...ref,
|
|
380
|
+
type: ref.type ?? inferRefType(ref.name),
|
|
381
|
+
}
|
|
382
|
+
})
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
function inferRefType(name: string): GitGraphRefType {
|
|
386
|
+
if (name === "HEAD") return "head"
|
|
387
|
+
if (name.startsWith("origin/")) return "remote"
|
|
388
|
+
if (/^v?\d+\.\d+/.test(name)) return "tag"
|
|
389
|
+
|
|
390
|
+
return "branch"
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
function laneColor(lane: number) {
|
|
394
|
+
const colors = props.laneColors?.length ? props.laneColors : defaultLaneColors
|
|
395
|
+
|
|
396
|
+
return colors[lane % colors.length] ?? colors[0]
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
function laneX(lane: number) {
|
|
400
|
+
return sizeClasses.value.lanePadding + (lane * sizeClasses.value.laneGap) + (sizeClasses.value.node / 2)
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
function rowY(index: number) {
|
|
404
|
+
return (index * sizeClasses.value.rowHeight) + (sizeClasses.value.rowHeight / 2)
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
function edgeKind(fromRow: GitGraphRow, toRow: GitGraphRow, parentIndex: number): GitGraphEdgeKind {
|
|
408
|
+
if (fromRow.lane === toRow.lane) return "direct"
|
|
409
|
+
if (parentIndex > 0) return "merge"
|
|
410
|
+
|
|
411
|
+
return "branch"
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
function edgeSortWeight(kind: GitGraphEdgeKind) {
|
|
415
|
+
if (kind === "direct") return 0
|
|
416
|
+
if (kind === "branch") return 1
|
|
417
|
+
|
|
418
|
+
return 2
|
|
419
|
+
}
|
|
420
|
+
|
|
421
|
+
function edgePath(fromRow: GitGraphRow, toRow: GitGraphRow, parentIndex: number) {
|
|
422
|
+
const fromX = laneX(fromRow.lane)
|
|
423
|
+
const fromY = rowY(fromRow.index)
|
|
424
|
+
const toX = laneX(toRow.lane)
|
|
425
|
+
const toY = rowY(toRow.index)
|
|
426
|
+
|
|
427
|
+
if (fromX === toX) return `M ${fromX} ${fromY} L ${toX} ${toY}`
|
|
428
|
+
|
|
429
|
+
const spanY = Math.max(sizeClasses.value.rowHeight, toY - fromY)
|
|
430
|
+
const lead = Math.max(10, Math.min(sizeClasses.value.rowHeight * 0.38, spanY * 0.42))
|
|
431
|
+
const curveStartY = parentIndex > 0
|
|
432
|
+
? fromY + (lead * 0.55)
|
|
433
|
+
: Math.max(fromY + lead, toY - (lead * 1.35))
|
|
434
|
+
const curveEndY = parentIndex > 0
|
|
435
|
+
? Math.min(toY - (lead * 0.35), curveStartY + (lead * 1.15))
|
|
436
|
+
: toY - (lead * 0.25)
|
|
437
|
+
const controlOffset = Math.max(6, Math.min(18, lead * 0.55))
|
|
438
|
+
|
|
439
|
+
return [
|
|
440
|
+
`M ${fromX} ${fromY}`,
|
|
441
|
+
`L ${fromX} ${curveStartY}`,
|
|
442
|
+
`C ${fromX} ${curveStartY + controlOffset}, ${toX} ${curveEndY - controlOffset}, ${toX} ${curveEndY}`,
|
|
443
|
+
`L ${toX} ${toY}`,
|
|
444
|
+
].join(" ")
|
|
445
|
+
}
|
|
446
|
+
|
|
447
|
+
function refClass(type: GitGraphRefType) {
|
|
448
|
+
if (type === "head") return "border-primary/30 bg-primary text-primary-foreground"
|
|
449
|
+
if (type === "remote") return "border-sky-600/20 bg-sky-600/10 text-sky-600"
|
|
450
|
+
if (type === "tag") return "border-amber-600/20 bg-amber-600/10 text-amber-600"
|
|
451
|
+
|
|
452
|
+
return "border-emerald-600/20 bg-emerald-600/10 text-emerald-600"
|
|
453
|
+
}
|
|
454
|
+
|
|
455
|
+
function refIcon(type: GitGraphRefType) {
|
|
456
|
+
if (type === "tag") return TagIcon
|
|
457
|
+
|
|
458
|
+
return GitForkIcon
|
|
459
|
+
}
|
|
460
|
+
|
|
461
|
+
function isSelected(commit: GitGraphCommit) {
|
|
462
|
+
return props.modelValue === commit.id || props.modelValue === commit.hash
|
|
463
|
+
}
|
|
464
|
+
|
|
465
|
+
function rowMetaItems(row: GitGraphRow): GitGraphMetaItem[] {
|
|
466
|
+
if (!props.showMeta) return []
|
|
467
|
+
|
|
468
|
+
const items: GitGraphMetaItem[] = []
|
|
469
|
+
|
|
470
|
+
if (props.showHash && row.commit.hash) {
|
|
471
|
+
items.push({
|
|
472
|
+
class: cn("font-mono", sizeClasses.value.hash),
|
|
473
|
+
slot: "git-graph-hash",
|
|
474
|
+
value: row.commit.hash,
|
|
475
|
+
})
|
|
476
|
+
}
|
|
477
|
+
|
|
478
|
+
if (props.showAuthor && row.commit.author) {
|
|
479
|
+
items.push({
|
|
480
|
+
slot: "git-graph-author",
|
|
481
|
+
value: row.commit.author,
|
|
482
|
+
})
|
|
483
|
+
}
|
|
484
|
+
|
|
485
|
+
if (props.showDate && row.commit.date) {
|
|
486
|
+
items.push({
|
|
487
|
+
slot: "git-graph-date",
|
|
488
|
+
value: row.commit.date,
|
|
489
|
+
})
|
|
490
|
+
}
|
|
491
|
+
|
|
492
|
+
return items
|
|
493
|
+
}
|
|
494
|
+
|
|
495
|
+
function rowLabel(row: GitGraphRow) {
|
|
496
|
+
const meta = rowMetaItems(row).map((item) => item.value).join(", ")
|
|
497
|
+
|
|
498
|
+
return meta ? `${row.commit.message}, ${meta}` : row.commit.message
|
|
499
|
+
}
|
|
500
|
+
|
|
501
|
+
function handleSelect(row: GitGraphRow) {
|
|
502
|
+
if (!props.selectable) return
|
|
503
|
+
|
|
504
|
+
emit("update:modelValue", row.commit.id)
|
|
505
|
+
emit("select", {
|
|
506
|
+
commit: row.commit,
|
|
507
|
+
index: row.index,
|
|
508
|
+
})
|
|
509
|
+
}
|
|
510
|
+
</script>
|
|
511
|
+
|
|
512
|
+
<template>
|
|
513
|
+
<article
|
|
514
|
+
data-slot="git-graph"
|
|
515
|
+
:data-size="props.size"
|
|
516
|
+
:class="cn('overflow-hidden rounded-xl border bg-card text-card-foreground shadow-xs', props.class)"
|
|
517
|
+
>
|
|
518
|
+
<header
|
|
519
|
+
v-if="hasHeader"
|
|
520
|
+
data-slot="git-graph-header"
|
|
521
|
+
:class="cn('flex flex-wrap items-start justify-between border-b', sizeClasses.header)"
|
|
522
|
+
>
|
|
523
|
+
<div v-if="props.title || props.description" class="flex min-w-0 flex-col gap-1">
|
|
524
|
+
<h3
|
|
525
|
+
v-if="props.title"
|
|
526
|
+
data-slot="git-graph-title"
|
|
527
|
+
:class="cn('truncate font-semibold leading-tight tracking-normal', sizeClasses.title)"
|
|
528
|
+
>
|
|
529
|
+
{{ props.title }}
|
|
530
|
+
</h3>
|
|
531
|
+
<p
|
|
532
|
+
v-if="props.description"
|
|
533
|
+
data-slot="git-graph-description"
|
|
534
|
+
:class="cn('text-muted-foreground', sizeClasses.description)"
|
|
535
|
+
>
|
|
536
|
+
{{ props.description }}
|
|
537
|
+
</p>
|
|
538
|
+
</div>
|
|
539
|
+
|
|
540
|
+
<p
|
|
541
|
+
v-if="props.summary"
|
|
542
|
+
data-slot="git-graph-summary"
|
|
543
|
+
class="shrink-0 text-xs font-medium text-muted-foreground"
|
|
544
|
+
>
|
|
545
|
+
{{ props.summary }}
|
|
546
|
+
</p>
|
|
547
|
+
</header>
|
|
548
|
+
|
|
549
|
+
<div
|
|
550
|
+
v-if="rows.length"
|
|
551
|
+
data-slot="git-graph-scroll"
|
|
552
|
+
class="min-w-0 overflow-x-auto"
|
|
553
|
+
>
|
|
554
|
+
<div
|
|
555
|
+
data-slot="git-graph-content"
|
|
556
|
+
class="relative min-w-full"
|
|
557
|
+
:style="graphStyle"
|
|
558
|
+
>
|
|
559
|
+
<svg
|
|
560
|
+
v-if="props.showGraph"
|
|
561
|
+
data-slot="git-graph-edges"
|
|
562
|
+
aria-hidden="true"
|
|
563
|
+
class="pointer-events-none absolute top-0 z-0 overflow-visible"
|
|
564
|
+
:height="graphHeight"
|
|
565
|
+
:width="graphAreaWidth"
|
|
566
|
+
:viewBox="`0 0 ${graphAreaWidth} ${graphHeight}`"
|
|
567
|
+
:style="svgStyle"
|
|
568
|
+
>
|
|
569
|
+
<path
|
|
570
|
+
v-for="edge in edges"
|
|
571
|
+
:key="`${edge.fromIndex}-${edge.toIndex}-${edge.parentId}`"
|
|
572
|
+
data-slot="git-graph-edge"
|
|
573
|
+
:data-kind="edge.kind"
|
|
574
|
+
:data-lane="edge.lane"
|
|
575
|
+
fill="none"
|
|
576
|
+
stroke-linecap="round"
|
|
577
|
+
stroke-linejoin="round"
|
|
578
|
+
:d="edge.d"
|
|
579
|
+
:stroke="edge.color"
|
|
580
|
+
:stroke-width="2"
|
|
581
|
+
:opacity="edge.kind === 'direct' ? 0.64 : 0.78"
|
|
582
|
+
/>
|
|
583
|
+
</svg>
|
|
584
|
+
|
|
585
|
+
<ul data-slot="git-graph-rows" class="relative z-10 flex min-w-full flex-col">
|
|
586
|
+
<li
|
|
587
|
+
v-for="row in rows"
|
|
588
|
+
:key="row.commit.id"
|
|
589
|
+
data-slot="git-graph-row-item"
|
|
590
|
+
:data-selected="isSelected(row.commit) ? '' : undefined"
|
|
591
|
+
class="relative"
|
|
592
|
+
>
|
|
593
|
+
<span
|
|
594
|
+
v-if="row.index > 0"
|
|
595
|
+
data-slot="git-graph-row-separator"
|
|
596
|
+
aria-hidden="true"
|
|
597
|
+
class="pointer-events-none absolute inset-x-0 top-0 z-20 h-px bg-border"
|
|
598
|
+
/>
|
|
599
|
+
|
|
600
|
+
<component
|
|
601
|
+
:is="props.selectable ? 'button' : 'div'"
|
|
602
|
+
data-slot="git-graph-row"
|
|
603
|
+
:type="props.selectable ? 'button' : undefined"
|
|
604
|
+
:aria-label="props.selectable ? rowLabel(row) : undefined"
|
|
605
|
+
:aria-selected="props.selectable ? isSelected(row.commit) : undefined"
|
|
606
|
+
:class="
|
|
607
|
+
cn(
|
|
608
|
+
'grid w-full min-w-0 grid-cols-[var(--git-graph-width)_minmax(0,1fr)] items-center text-left outline-none transition-colors',
|
|
609
|
+
props.selectable && 'hover:bg-muted/50 focus-visible:bg-muted/70 focus-visible:ring-[3px] focus-visible:ring-ring/50',
|
|
610
|
+
isSelected(row.commit) && 'bg-muted/60',
|
|
611
|
+
sizeClasses.row,
|
|
612
|
+
)
|
|
613
|
+
"
|
|
614
|
+
:style="{ '--git-graph-width': `${graphAreaWidth}px` }"
|
|
615
|
+
@click="handleSelect(row)"
|
|
616
|
+
>
|
|
617
|
+
<span
|
|
618
|
+
v-if="props.showGraph"
|
|
619
|
+
data-slot="git-graph-lanes"
|
|
620
|
+
class="relative block h-full"
|
|
621
|
+
>
|
|
622
|
+
<span
|
|
623
|
+
data-slot="git-graph-node"
|
|
624
|
+
:style="{
|
|
625
|
+
backgroundColor: laneColor(row.lane),
|
|
626
|
+
height: `${sizeClasses.node}px`,
|
|
627
|
+
left: `${laneX(row.lane) - (sizeClasses.node / 2)}px`,
|
|
628
|
+
top: `calc(50% - ${sizeClasses.node / 2}px)`,
|
|
629
|
+
width: `${sizeClasses.node}px`,
|
|
630
|
+
}"
|
|
631
|
+
class="absolute rounded-full ring-2 ring-card"
|
|
632
|
+
/>
|
|
633
|
+
</span>
|
|
634
|
+
|
|
635
|
+
<span data-slot="git-graph-commit" class="flex min-w-0 items-center gap-2">
|
|
636
|
+
<span class="flex min-w-0 flex-1 items-center gap-2.5">
|
|
637
|
+
<span data-slot="git-graph-text" class="flex min-w-0 flex-col gap-1">
|
|
638
|
+
<span class="flex min-w-0 items-center">
|
|
639
|
+
<span
|
|
640
|
+
data-slot="git-graph-message"
|
|
641
|
+
:class="cn('min-w-0 truncate font-semibold leading-tight tracking-normal', sizeClasses.message)"
|
|
642
|
+
>
|
|
643
|
+
{{ row.commit.message }}
|
|
644
|
+
</span>
|
|
645
|
+
</span>
|
|
646
|
+
|
|
647
|
+
<span
|
|
648
|
+
v-if="rowMetaItems(row).length"
|
|
649
|
+
data-slot="git-graph-meta"
|
|
650
|
+
:class="cn('flex min-w-0 flex-wrap items-center leading-tight text-muted-foreground', sizeClasses.meta)"
|
|
651
|
+
>
|
|
652
|
+
<template
|
|
653
|
+
v-for="(meta, metaIndex) in rowMetaItems(row)"
|
|
654
|
+
:key="meta.slot"
|
|
655
|
+
>
|
|
656
|
+
<span
|
|
657
|
+
v-if="metaIndex > 0"
|
|
658
|
+
aria-hidden="true"
|
|
659
|
+
>
|
|
660
|
+
·
|
|
661
|
+
</span>
|
|
662
|
+
<span
|
|
663
|
+
:data-slot="meta.slot"
|
|
664
|
+
:class="meta.class"
|
|
665
|
+
>
|
|
666
|
+
{{ meta.value }}
|
|
667
|
+
</span>
|
|
668
|
+
</template>
|
|
669
|
+
</span>
|
|
670
|
+
</span>
|
|
671
|
+
|
|
672
|
+
<span
|
|
673
|
+
v-if="props.showRefs && row.refs.length"
|
|
674
|
+
data-slot="git-graph-refs"
|
|
675
|
+
class="hidden min-w-0 shrink-0 items-center gap-2 self-center sm:flex"
|
|
676
|
+
>
|
|
677
|
+
<span
|
|
678
|
+
v-for="ref in row.refs"
|
|
679
|
+
:key="`${row.commit.id}-${ref.name}`"
|
|
680
|
+
data-slot="git-graph-ref"
|
|
681
|
+
:data-type="ref.type"
|
|
682
|
+
:class="cn('inline-flex max-w-36 shrink-0 items-center rounded-full border font-medium leading-tight', sizeClasses.ref, refClass(ref.type))"
|
|
683
|
+
>
|
|
684
|
+
<component
|
|
685
|
+
:is="refIcon(ref.type)"
|
|
686
|
+
aria-hidden="true"
|
|
687
|
+
:class="sizeClasses.refIcon"
|
|
688
|
+
/>
|
|
689
|
+
<span class="truncate">{{ ref.name }}</span>
|
|
690
|
+
</span>
|
|
691
|
+
</span>
|
|
692
|
+
</span>
|
|
693
|
+
|
|
694
|
+
<GitCommitHorizontalIcon
|
|
695
|
+
v-if="props.showCommitIcon"
|
|
696
|
+
data-slot="git-graph-commit-icon"
|
|
697
|
+
aria-hidden="true"
|
|
698
|
+
:class="cn('hidden shrink-0 text-muted-foreground sm:block', sizeClasses.graphIcon)"
|
|
699
|
+
/>
|
|
700
|
+
</span>
|
|
701
|
+
</component>
|
|
702
|
+
</li>
|
|
703
|
+
</ul>
|
|
704
|
+
</div>
|
|
705
|
+
</div>
|
|
706
|
+
|
|
707
|
+
<div
|
|
708
|
+
v-else
|
|
709
|
+
data-slot="git-graph-empty"
|
|
710
|
+
:class="cn('text-muted-foreground', sizeClasses.header, sizeClasses.content)"
|
|
711
|
+
>
|
|
712
|
+
{{ props.emptyLabel }}
|
|
713
|
+
</div>
|
|
714
|
+
</article>
|
|
715
|
+
</template>
|