@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,423 @@
|
|
|
1
|
+
import {
|
|
2
|
+
codeLineNumberWidth,
|
|
3
|
+
createCodeLines,
|
|
4
|
+
normalizeCode,
|
|
5
|
+
normalizeCodeLanguage,
|
|
6
|
+
splitTextLines,
|
|
7
|
+
} from "@/lib/code-highlight"
|
|
8
|
+
|
|
9
|
+
export type SplitDiffKind = "addition" | "context" | "deletion" | "empty"
|
|
10
|
+
|
|
11
|
+
export type SplitDiffSide = {
|
|
12
|
+
content: string
|
|
13
|
+
html: string
|
|
14
|
+
isEmpty: boolean
|
|
15
|
+
kind: SplitDiffKind
|
|
16
|
+
lineNumber?: number
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export type SplitDiffRow = {
|
|
20
|
+
key: string
|
|
21
|
+
left: SplitDiffSide
|
|
22
|
+
right: SplitDiffSide
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export type SplitDiffModel = {
|
|
26
|
+
language?: string
|
|
27
|
+
leftLabel: string
|
|
28
|
+
lineNumberWidth: string
|
|
29
|
+
rightLabel: string
|
|
30
|
+
rows: SplitDiffRow[]
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
type PendingSide = Omit<SplitDiffSide, "html" | "isEmpty">
|
|
34
|
+
|
|
35
|
+
const hunkPattern = /^@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@/
|
|
36
|
+
const languageByExtension: Record<string, string> = {
|
|
37
|
+
cjs: "javascript",
|
|
38
|
+
css: "css",
|
|
39
|
+
htm: "html",
|
|
40
|
+
html: "html",
|
|
41
|
+
js: "javascript",
|
|
42
|
+
json: "json",
|
|
43
|
+
jsonc: "json",
|
|
44
|
+
jsx: "javascript",
|
|
45
|
+
md: "markdown",
|
|
46
|
+
mjs: "javascript",
|
|
47
|
+
py: "python",
|
|
48
|
+
rb: "ruby",
|
|
49
|
+
scss: "scss",
|
|
50
|
+
sh: "bash",
|
|
51
|
+
ts: "typescript",
|
|
52
|
+
tsx: "typescript",
|
|
53
|
+
vue: "vue",
|
|
54
|
+
xml: "xml",
|
|
55
|
+
yaml: "yaml",
|
|
56
|
+
yml: "yaml",
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export function createSplitDiffModel({
|
|
60
|
+
code,
|
|
61
|
+
highlight = true,
|
|
62
|
+
language,
|
|
63
|
+
leftCode,
|
|
64
|
+
leftLabel = "원본",
|
|
65
|
+
rightCode,
|
|
66
|
+
rightLabel = "변경본",
|
|
67
|
+
}: {
|
|
68
|
+
code?: string
|
|
69
|
+
highlight?: boolean
|
|
70
|
+
language?: string
|
|
71
|
+
leftCode?: string
|
|
72
|
+
leftLabel?: string
|
|
73
|
+
rightCode?: string
|
|
74
|
+
rightLabel?: string
|
|
75
|
+
}): SplitDiffModel {
|
|
76
|
+
const normalizedCode = normalizeCode(code ?? "").trim()
|
|
77
|
+
const normalizedLeftCode = normalizeCode(leftCode ?? "")
|
|
78
|
+
const normalizedRightCode = normalizeCode(rightCode ?? "")
|
|
79
|
+
const parsed = normalizedCode
|
|
80
|
+
? parseUnifiedDiff(normalizedCode, leftLabel, rightLabel)
|
|
81
|
+
: createPairedDiff(normalizedLeftCode, normalizedRightCode, leftLabel, rightLabel)
|
|
82
|
+
const normalizedLanguage = normalizeCodeLanguage(language) ??
|
|
83
|
+
inferCodeLanguage(leftLabel, rightLabel)
|
|
84
|
+
|
|
85
|
+
return applyHighlight({
|
|
86
|
+
...parsed,
|
|
87
|
+
language: normalizedLanguage,
|
|
88
|
+
rows: parsed.rows.length > 0 ? parsed.rows : createEmptyRows(),
|
|
89
|
+
}, highlight)
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
export function splitDiffCopyText(model: SplitDiffModel) {
|
|
93
|
+
return [
|
|
94
|
+
model.leftLabel,
|
|
95
|
+
sideText(model.rows, "left"),
|
|
96
|
+
"",
|
|
97
|
+
model.rightLabel,
|
|
98
|
+
sideText(model.rows, "right"),
|
|
99
|
+
].join("\n")
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
function parseUnifiedDiff(
|
|
103
|
+
code: string,
|
|
104
|
+
leftLabel: string,
|
|
105
|
+
rightLabel: string,
|
|
106
|
+
): Omit<SplitDiffModel, "language" | "lineNumberWidth"> {
|
|
107
|
+
const rows: SplitDiffRow[] = []
|
|
108
|
+
const lines = splitTextLines(code)
|
|
109
|
+
const pendingDeletions: PendingSide[] = []
|
|
110
|
+
let leftLineNumber = 0
|
|
111
|
+
let rightLineNumber = 0
|
|
112
|
+
let inHunk = false
|
|
113
|
+
|
|
114
|
+
for (const line of lines) {
|
|
115
|
+
if (line.startsWith("diff ") || line.startsWith("index ")) {
|
|
116
|
+
flushPendingDeletions(rows, pendingDeletions)
|
|
117
|
+
inHunk = false
|
|
118
|
+
continue
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
if (!inHunk && (line.startsWith("--- ") || line.startsWith("+++ "))) {
|
|
122
|
+
continue
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
const hunkMatch = line.match(hunkPattern)
|
|
126
|
+
|
|
127
|
+
if (hunkMatch) {
|
|
128
|
+
flushPendingDeletions(rows, pendingDeletions)
|
|
129
|
+
leftLineNumber = Number(hunkMatch[1])
|
|
130
|
+
rightLineNumber = Number(hunkMatch[2])
|
|
131
|
+
inHunk = true
|
|
132
|
+
continue
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
if (!inHunk || line.startsWith("\\ No newline")) {
|
|
136
|
+
continue
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
if (line.startsWith("-")) {
|
|
140
|
+
pendingDeletions.push({
|
|
141
|
+
content: line.slice(1),
|
|
142
|
+
kind: "deletion",
|
|
143
|
+
lineNumber: leftLineNumber,
|
|
144
|
+
})
|
|
145
|
+
leftLineNumber += 1
|
|
146
|
+
continue
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
if (line.startsWith("+")) {
|
|
150
|
+
const leftSide = pendingDeletions.shift()
|
|
151
|
+
rows.push(createCodeRow(
|
|
152
|
+
rows.length,
|
|
153
|
+
leftSide,
|
|
154
|
+
{
|
|
155
|
+
content: line.slice(1),
|
|
156
|
+
kind: "addition",
|
|
157
|
+
lineNumber: rightLineNumber,
|
|
158
|
+
},
|
|
159
|
+
))
|
|
160
|
+
rightLineNumber += 1
|
|
161
|
+
continue
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
flushPendingDeletions(rows, pendingDeletions)
|
|
165
|
+
|
|
166
|
+
const content = line.startsWith(" ") ? line.slice(1) : line
|
|
167
|
+
rows.push(createCodeRow(
|
|
168
|
+
rows.length,
|
|
169
|
+
{
|
|
170
|
+
content,
|
|
171
|
+
kind: "context",
|
|
172
|
+
lineNumber: leftLineNumber,
|
|
173
|
+
},
|
|
174
|
+
{
|
|
175
|
+
content,
|
|
176
|
+
kind: "context",
|
|
177
|
+
lineNumber: rightLineNumber,
|
|
178
|
+
},
|
|
179
|
+
))
|
|
180
|
+
leftLineNumber += 1
|
|
181
|
+
rightLineNumber += 1
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
flushPendingDeletions(rows, pendingDeletions)
|
|
185
|
+
|
|
186
|
+
return {
|
|
187
|
+
leftLabel,
|
|
188
|
+
rightLabel,
|
|
189
|
+
rows,
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
function createPairedDiff(
|
|
194
|
+
leftCode: string,
|
|
195
|
+
rightCode: string,
|
|
196
|
+
leftLabel: string,
|
|
197
|
+
rightLabel: string,
|
|
198
|
+
): Omit<SplitDiffModel, "language" | "lineNumberWidth"> {
|
|
199
|
+
const operations = createLineOperations(splitTextLines(leftCode), splitTextLines(rightCode))
|
|
200
|
+
const rows: SplitDiffRow[] = []
|
|
201
|
+
const pendingDeletions: PendingSide[] = []
|
|
202
|
+
|
|
203
|
+
for (const operation of operations) {
|
|
204
|
+
if (operation.type === "deletion") {
|
|
205
|
+
pendingDeletions.push({
|
|
206
|
+
content: operation.content,
|
|
207
|
+
kind: "deletion",
|
|
208
|
+
lineNumber: operation.leftLineNumber,
|
|
209
|
+
})
|
|
210
|
+
continue
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
if (operation.type === "addition") {
|
|
214
|
+
const leftSide = pendingDeletions.shift()
|
|
215
|
+
rows.push(createCodeRow(
|
|
216
|
+
rows.length,
|
|
217
|
+
leftSide,
|
|
218
|
+
{
|
|
219
|
+
content: operation.content,
|
|
220
|
+
kind: "addition",
|
|
221
|
+
lineNumber: operation.rightLineNumber,
|
|
222
|
+
},
|
|
223
|
+
))
|
|
224
|
+
continue
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
flushPendingDeletions(rows, pendingDeletions)
|
|
228
|
+
rows.push(createCodeRow(
|
|
229
|
+
rows.length,
|
|
230
|
+
{
|
|
231
|
+
content: operation.content,
|
|
232
|
+
kind: "context",
|
|
233
|
+
lineNumber: operation.leftLineNumber,
|
|
234
|
+
},
|
|
235
|
+
{
|
|
236
|
+
content: operation.content,
|
|
237
|
+
kind: "context",
|
|
238
|
+
lineNumber: operation.rightLineNumber,
|
|
239
|
+
},
|
|
240
|
+
))
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
flushPendingDeletions(rows, pendingDeletions)
|
|
244
|
+
|
|
245
|
+
return {
|
|
246
|
+
leftLabel,
|
|
247
|
+
rightLabel,
|
|
248
|
+
rows,
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
function createLineOperations(leftLines: string[], rightLines: string[]) {
|
|
253
|
+
const distances = Array.from(
|
|
254
|
+
{ length: leftLines.length + 1 },
|
|
255
|
+
() => Array<number>(rightLines.length + 1).fill(0),
|
|
256
|
+
)
|
|
257
|
+
|
|
258
|
+
for (let leftIndex = leftLines.length - 1; leftIndex >= 0; leftIndex -= 1) {
|
|
259
|
+
for (let rightIndex = rightLines.length - 1; rightIndex >= 0; rightIndex -= 1) {
|
|
260
|
+
distances[leftIndex][rightIndex] = leftLines[leftIndex] === rightLines[rightIndex]
|
|
261
|
+
? distances[leftIndex + 1][rightIndex + 1] + 1
|
|
262
|
+
: Math.max(
|
|
263
|
+
distances[leftIndex + 1][rightIndex],
|
|
264
|
+
distances[leftIndex][rightIndex + 1],
|
|
265
|
+
)
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
const operations: Array<{
|
|
270
|
+
content: string
|
|
271
|
+
leftLineNumber?: number
|
|
272
|
+
rightLineNumber?: number
|
|
273
|
+
type: "addition" | "context" | "deletion"
|
|
274
|
+
}> = []
|
|
275
|
+
let leftIndex = 0
|
|
276
|
+
let rightIndex = 0
|
|
277
|
+
|
|
278
|
+
while (leftIndex < leftLines.length && rightIndex < rightLines.length) {
|
|
279
|
+
if (leftLines[leftIndex] === rightLines[rightIndex]) {
|
|
280
|
+
operations.push({
|
|
281
|
+
content: leftLines[leftIndex],
|
|
282
|
+
leftLineNumber: leftIndex + 1,
|
|
283
|
+
rightLineNumber: rightIndex + 1,
|
|
284
|
+
type: "context",
|
|
285
|
+
})
|
|
286
|
+
leftIndex += 1
|
|
287
|
+
rightIndex += 1
|
|
288
|
+
continue
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
if (distances[leftIndex + 1][rightIndex] >= distances[leftIndex][rightIndex + 1]) {
|
|
292
|
+
operations.push({
|
|
293
|
+
content: leftLines[leftIndex],
|
|
294
|
+
leftLineNumber: leftIndex + 1,
|
|
295
|
+
type: "deletion",
|
|
296
|
+
})
|
|
297
|
+
leftIndex += 1
|
|
298
|
+
continue
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
operations.push({
|
|
302
|
+
content: rightLines[rightIndex],
|
|
303
|
+
rightLineNumber: rightIndex + 1,
|
|
304
|
+
type: "addition",
|
|
305
|
+
})
|
|
306
|
+
rightIndex += 1
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
for (; leftIndex < leftLines.length; leftIndex += 1) {
|
|
310
|
+
operations.push({
|
|
311
|
+
content: leftLines[leftIndex],
|
|
312
|
+
leftLineNumber: leftIndex + 1,
|
|
313
|
+
type: "deletion",
|
|
314
|
+
})
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
for (; rightIndex < rightLines.length; rightIndex += 1) {
|
|
318
|
+
operations.push({
|
|
319
|
+
content: rightLines[rightIndex],
|
|
320
|
+
rightLineNumber: rightIndex + 1,
|
|
321
|
+
type: "addition",
|
|
322
|
+
})
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
return operations
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
function applyHighlight(
|
|
329
|
+
model: Omit<SplitDiffModel, "lineNumberWidth">,
|
|
330
|
+
highlight: boolean,
|
|
331
|
+
): SplitDiffModel {
|
|
332
|
+
const leftCode = model.rows.map((row) => row.left.content).join("\n")
|
|
333
|
+
const rightCode = model.rows.map((row) => row.right.content).join("\n")
|
|
334
|
+
const leftLines = createCodeLines(leftCode, model.language, highlight)
|
|
335
|
+
const rightLines = createCodeLines(rightCode, model.language, highlight)
|
|
336
|
+
const maxLineNumber = model.rows.reduce((current, row) => Math.max(
|
|
337
|
+
current,
|
|
338
|
+
row.left.lineNumber ?? 0,
|
|
339
|
+
row.right.lineNumber ?? 0,
|
|
340
|
+
), 1)
|
|
341
|
+
|
|
342
|
+
return {
|
|
343
|
+
...model,
|
|
344
|
+
lineNumberWidth: codeLineNumberWidth(maxLineNumber),
|
|
345
|
+
rows: model.rows.map((row, index) => ({
|
|
346
|
+
...row,
|
|
347
|
+
left: {
|
|
348
|
+
...row.left,
|
|
349
|
+
html: leftLines[index]?.html ?? "",
|
|
350
|
+
isEmpty: row.left.content.length === 0,
|
|
351
|
+
},
|
|
352
|
+
right: {
|
|
353
|
+
...row.right,
|
|
354
|
+
html: rightLines[index]?.html ?? "",
|
|
355
|
+
isEmpty: row.right.content.length === 0,
|
|
356
|
+
},
|
|
357
|
+
})),
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
function createCodeRow(
|
|
362
|
+
index: number,
|
|
363
|
+
left?: PendingSide,
|
|
364
|
+
right?: PendingSide,
|
|
365
|
+
): SplitDiffRow {
|
|
366
|
+
return {
|
|
367
|
+
key: `code-${index}`,
|
|
368
|
+
left: createSide(left),
|
|
369
|
+
right: createSide(right),
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
function createEmptyRows() {
|
|
374
|
+
return [
|
|
375
|
+
createCodeRow(0, {
|
|
376
|
+
content: "",
|
|
377
|
+
kind: "context",
|
|
378
|
+
lineNumber: 1,
|
|
379
|
+
}, {
|
|
380
|
+
content: "",
|
|
381
|
+
kind: "context",
|
|
382
|
+
lineNumber: 1,
|
|
383
|
+
}),
|
|
384
|
+
]
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
function createSide(side?: PendingSide): SplitDiffSide {
|
|
388
|
+
if (!side) {
|
|
389
|
+
return {
|
|
390
|
+
content: "",
|
|
391
|
+
html: "",
|
|
392
|
+
isEmpty: true,
|
|
393
|
+
kind: "empty",
|
|
394
|
+
}
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
return {
|
|
398
|
+
...side,
|
|
399
|
+
html: "",
|
|
400
|
+
isEmpty: side.content.length === 0,
|
|
401
|
+
}
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
function flushPendingDeletions(rows: SplitDiffRow[], pendingDeletions: PendingSide[]) {
|
|
405
|
+
while (pendingDeletions.length > 0) {
|
|
406
|
+
rows.push(createCodeRow(rows.length, pendingDeletions.shift()))
|
|
407
|
+
}
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
function inferCodeLanguage(leftLabel: string, rightLabel: string) {
|
|
411
|
+
const extension = [rightLabel, leftLabel]
|
|
412
|
+
.map((label) => label.match(/\.([a-z0-9]+)(?:\s|$)/i)?.[1]?.toLowerCase())
|
|
413
|
+
.find(Boolean)
|
|
414
|
+
|
|
415
|
+
return extension ? languageByExtension[extension] : undefined
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
function sideText(rows: SplitDiffRow[], side: "left" | "right") {
|
|
419
|
+
return rows
|
|
420
|
+
.map((row) => row[side].kind === "empty" ? "" : row[side].content)
|
|
421
|
+
.join("\n")
|
|
422
|
+
.replace(/\n+$/g, "")
|
|
423
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { HTMLAttributes } from "vue"
|
|
2
|
+
|
|
3
|
+
export interface DiffToolProps {
|
|
4
|
+
class?: HTMLAttributes["class"]
|
|
5
|
+
closeLabel?: string
|
|
6
|
+
code?: string
|
|
7
|
+
copiedLabel?: string
|
|
8
|
+
copyLabel?: string
|
|
9
|
+
expandLabel?: string
|
|
10
|
+
highlight?: boolean
|
|
11
|
+
label?: string
|
|
12
|
+
language?: string
|
|
13
|
+
leftCode?: string
|
|
14
|
+
leftLabel?: string
|
|
15
|
+
lineNumbers?: boolean
|
|
16
|
+
maxVisibleLines?: number
|
|
17
|
+
rightCode?: string
|
|
18
|
+
rightLabel?: string
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export type DiffToolEmits = {
|
|
22
|
+
copy: [code: string]
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export const diffToolDefaults = {
|
|
26
|
+
closeLabel: "닫기",
|
|
27
|
+
code: "",
|
|
28
|
+
copiedLabel: "복사됨",
|
|
29
|
+
copyLabel: "diff 복사",
|
|
30
|
+
expandLabel: "크게 보기",
|
|
31
|
+
highlight: true,
|
|
32
|
+
label: "Diff",
|
|
33
|
+
leftCode: "",
|
|
34
|
+
leftLabel: "원본",
|
|
35
|
+
lineNumbers: true,
|
|
36
|
+
maxVisibleLines: 20,
|
|
37
|
+
rightCode: "",
|
|
38
|
+
rightLabel: "변경본",
|
|
39
|
+
} satisfies Partial<DiffToolProps>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { DropdownMenuRootEmits, DropdownMenuRootProps } from "reka-ui"
|
|
3
|
+
import { DropdownMenuRoot, useForwardPropsEmits } from "reka-ui"
|
|
4
|
+
|
|
5
|
+
const props = defineProps<DropdownMenuRootProps>()
|
|
6
|
+
const emits = defineEmits<DropdownMenuRootEmits>()
|
|
7
|
+
|
|
8
|
+
const forwarded = useForwardPropsEmits(props, emits)
|
|
9
|
+
</script>
|
|
10
|
+
|
|
11
|
+
<template>
|
|
12
|
+
<DropdownMenuRoot
|
|
13
|
+
v-slot="slotProps"
|
|
14
|
+
data-slot="dropdown-menu"
|
|
15
|
+
v-bind="forwarded"
|
|
16
|
+
>
|
|
17
|
+
<slot v-bind="slotProps" />
|
|
18
|
+
</DropdownMenuRoot>
|
|
19
|
+
</template>
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { DropdownMenuCheckboxItemEmits, DropdownMenuCheckboxItemProps } from "reka-ui"
|
|
3
|
+
import type { HTMLAttributes } from "vue"
|
|
4
|
+
import { Check } from "@lucide/vue"
|
|
5
|
+
import { reactiveOmit } from "@vueuse/core"
|
|
6
|
+
import {
|
|
7
|
+
DropdownMenuCheckboxItem,
|
|
8
|
+
DropdownMenuItemIndicator,
|
|
9
|
+
useForwardPropsEmits,
|
|
10
|
+
} from "reka-ui"
|
|
11
|
+
import { cn } from "@/lib/utils"
|
|
12
|
+
|
|
13
|
+
const props = defineProps<DropdownMenuCheckboxItemProps & { class?: HTMLAttributes["class"] }>()
|
|
14
|
+
const emits = defineEmits<DropdownMenuCheckboxItemEmits>()
|
|
15
|
+
|
|
16
|
+
const delegatedProps = reactiveOmit(props, "class")
|
|
17
|
+
|
|
18
|
+
const forwarded = useForwardPropsEmits(delegatedProps, emits)
|
|
19
|
+
</script>
|
|
20
|
+
|
|
21
|
+
<template>
|
|
22
|
+
<DropdownMenuCheckboxItem
|
|
23
|
+
data-slot="dropdown-menu-checkbox-item"
|
|
24
|
+
v-bind="forwarded"
|
|
25
|
+
:class="cn(
|
|
26
|
+
'focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*=size-])]:size-4',
|
|
27
|
+
props.class,
|
|
28
|
+
)"
|
|
29
|
+
>
|
|
30
|
+
<span class="pointer-events-none absolute left-2 flex size-3.5 items-center justify-center">
|
|
31
|
+
<DropdownMenuItemIndicator>
|
|
32
|
+
<slot name="indicator-icon">
|
|
33
|
+
<Check class="size-4" />
|
|
34
|
+
</slot>
|
|
35
|
+
</DropdownMenuItemIndicator>
|
|
36
|
+
</span>
|
|
37
|
+
<slot />
|
|
38
|
+
</DropdownMenuCheckboxItem>
|
|
39
|
+
</template>
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { DropdownMenuContentEmits, DropdownMenuContentProps } from "reka-ui"
|
|
3
|
+
import type { HTMLAttributes } from "vue"
|
|
4
|
+
import { reactiveOmit } from "@vueuse/core"
|
|
5
|
+
import {
|
|
6
|
+
DropdownMenuContent,
|
|
7
|
+
DropdownMenuPortal,
|
|
8
|
+
useForwardPropsEmits,
|
|
9
|
+
} from "reka-ui"
|
|
10
|
+
import { cn } from "@/lib/utils"
|
|
11
|
+
|
|
12
|
+
defineOptions({
|
|
13
|
+
inheritAttrs: false,
|
|
14
|
+
})
|
|
15
|
+
|
|
16
|
+
const props = withDefaults(
|
|
17
|
+
defineProps<DropdownMenuContentProps & { class?: HTMLAttributes["class"] }>(),
|
|
18
|
+
{
|
|
19
|
+
sideOffset: 4,
|
|
20
|
+
},
|
|
21
|
+
)
|
|
22
|
+
const emits = defineEmits<DropdownMenuContentEmits>()
|
|
23
|
+
|
|
24
|
+
const delegatedProps = reactiveOmit(props, "class")
|
|
25
|
+
|
|
26
|
+
const forwarded = useForwardPropsEmits(delegatedProps, emits)
|
|
27
|
+
</script>
|
|
28
|
+
|
|
29
|
+
<template>
|
|
30
|
+
<DropdownMenuPortal>
|
|
31
|
+
<DropdownMenuContent
|
|
32
|
+
data-slot="dropdown-menu-content"
|
|
33
|
+
v-bind="{ ...$attrs, ...forwarded }"
|
|
34
|
+
:class="cn('bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--reka-dropdown-menu-content-available-height) min-w-[8rem] origin-(--reka-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md', props.class)"
|
|
35
|
+
>
|
|
36
|
+
<slot />
|
|
37
|
+
</DropdownMenuContent>
|
|
38
|
+
</DropdownMenuPortal>
|
|
39
|
+
</template>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { DropdownMenuGroupProps } from "reka-ui"
|
|
3
|
+
import { DropdownMenuGroup } from "reka-ui"
|
|
4
|
+
|
|
5
|
+
const props = defineProps<DropdownMenuGroupProps>()
|
|
6
|
+
</script>
|
|
7
|
+
|
|
8
|
+
<template>
|
|
9
|
+
<DropdownMenuGroup
|
|
10
|
+
data-slot="dropdown-menu-group"
|
|
11
|
+
v-bind="props"
|
|
12
|
+
>
|
|
13
|
+
<slot />
|
|
14
|
+
</DropdownMenuGroup>
|
|
15
|
+
</template>
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { DropdownMenuItemProps } from "reka-ui"
|
|
3
|
+
import type { HTMLAttributes } from "vue"
|
|
4
|
+
import { reactiveOmit } from "@vueuse/core"
|
|
5
|
+
import { DropdownMenuItem, useForwardProps } from "reka-ui"
|
|
6
|
+
import { cn } from "@/lib/utils"
|
|
7
|
+
|
|
8
|
+
const props = withDefaults(defineProps<DropdownMenuItemProps & {
|
|
9
|
+
class?: HTMLAttributes["class"]
|
|
10
|
+
inset?: boolean
|
|
11
|
+
variant?: "default" | "destructive"
|
|
12
|
+
}>(), {
|
|
13
|
+
variant: "default",
|
|
14
|
+
})
|
|
15
|
+
|
|
16
|
+
const delegatedProps = reactiveOmit(props, "inset", "variant", "class")
|
|
17
|
+
|
|
18
|
+
const forwardedProps = useForwardProps(delegatedProps)
|
|
19
|
+
</script>
|
|
20
|
+
|
|
21
|
+
<template>
|
|
22
|
+
<DropdownMenuItem
|
|
23
|
+
data-slot="dropdown-menu-item"
|
|
24
|
+
:data-inset="inset ? '' : undefined"
|
|
25
|
+
:data-variant="variant"
|
|
26
|
+
v-bind="forwardedProps"
|
|
27
|
+
:class="cn('focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*=text-])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*=size-])]:size-4', props.class)"
|
|
28
|
+
>
|
|
29
|
+
<slot />
|
|
30
|
+
</DropdownMenuItem>
|
|
31
|
+
</template>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { DropdownMenuLabelProps } from "reka-ui"
|
|
3
|
+
import type { HTMLAttributes } from "vue"
|
|
4
|
+
import { reactiveOmit } from "@vueuse/core"
|
|
5
|
+
import { DropdownMenuLabel, useForwardProps } from "reka-ui"
|
|
6
|
+
import { cn } from "@/lib/utils"
|
|
7
|
+
|
|
8
|
+
const props = defineProps<DropdownMenuLabelProps & { class?: HTMLAttributes["class"], inset?: boolean }>()
|
|
9
|
+
|
|
10
|
+
const delegatedProps = reactiveOmit(props, "class", "inset")
|
|
11
|
+
const forwardedProps = useForwardProps(delegatedProps)
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
<template>
|
|
15
|
+
<DropdownMenuLabel
|
|
16
|
+
data-slot="dropdown-menu-label"
|
|
17
|
+
:data-inset="inset ? '' : undefined"
|
|
18
|
+
v-bind="forwardedProps"
|
|
19
|
+
:class="cn('px-2 py-1.5 text-sm font-medium data-[inset]:pl-8', props.class)"
|
|
20
|
+
>
|
|
21
|
+
<slot />
|
|
22
|
+
</DropdownMenuLabel>
|
|
23
|
+
</template>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { DropdownMenuRadioGroupEmits, DropdownMenuRadioGroupProps } from "reka-ui"
|
|
3
|
+
import {
|
|
4
|
+
DropdownMenuRadioGroup,
|
|
5
|
+
useForwardPropsEmits,
|
|
6
|
+
} from "reka-ui"
|
|
7
|
+
|
|
8
|
+
const props = defineProps<DropdownMenuRadioGroupProps>()
|
|
9
|
+
const emits = defineEmits<DropdownMenuRadioGroupEmits>()
|
|
10
|
+
|
|
11
|
+
const forwarded = useForwardPropsEmits(props, emits)
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
<template>
|
|
15
|
+
<DropdownMenuRadioGroup
|
|
16
|
+
data-slot="dropdown-menu-radio-group"
|
|
17
|
+
v-bind="forwarded"
|
|
18
|
+
>
|
|
19
|
+
<slot />
|
|
20
|
+
</DropdownMenuRadioGroup>
|
|
21
|
+
</template>
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { DropdownMenuRadioItemEmits, DropdownMenuRadioItemProps } from "reka-ui"
|
|
3
|
+
import type { HTMLAttributes } from "vue"
|
|
4
|
+
import { Circle } from "@lucide/vue"
|
|
5
|
+
import { reactiveOmit } from "@vueuse/core"
|
|
6
|
+
import {
|
|
7
|
+
DropdownMenuItemIndicator,
|
|
8
|
+
DropdownMenuRadioItem,
|
|
9
|
+
useForwardPropsEmits,
|
|
10
|
+
} from "reka-ui"
|
|
11
|
+
import { cn } from "@/lib/utils"
|
|
12
|
+
|
|
13
|
+
const props = defineProps<DropdownMenuRadioItemProps & { class?: HTMLAttributes["class"] }>()
|
|
14
|
+
|
|
15
|
+
const emits = defineEmits<DropdownMenuRadioItemEmits>()
|
|
16
|
+
|
|
17
|
+
const delegatedProps = reactiveOmit(props, "class")
|
|
18
|
+
|
|
19
|
+
const forwarded = useForwardPropsEmits(delegatedProps, emits)
|
|
20
|
+
</script>
|
|
21
|
+
|
|
22
|
+
<template>
|
|
23
|
+
<DropdownMenuRadioItem
|
|
24
|
+
data-slot="dropdown-menu-radio-item"
|
|
25
|
+
v-bind="forwarded"
|
|
26
|
+
:class="cn(
|
|
27
|
+
'focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*=size-])]:size-4',
|
|
28
|
+
props.class,
|
|
29
|
+
)"
|
|
30
|
+
>
|
|
31
|
+
<span class="pointer-events-none absolute left-2 flex size-3.5 items-center justify-center">
|
|
32
|
+
<DropdownMenuItemIndicator>
|
|
33
|
+
<slot name="indicator-icon">
|
|
34
|
+
<Circle class="size-2 fill-current" />
|
|
35
|
+
</slot>
|
|
36
|
+
</DropdownMenuItemIndicator>
|
|
37
|
+
</span>
|
|
38
|
+
<slot />
|
|
39
|
+
</DropdownMenuRadioItem>
|
|
40
|
+
</template>
|