@oneclick.dev/cms-kit 0.0.1
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/README.md +1 -0
- package/components/ui/apple-emoji/AppleEmoji.vue +32 -0
- package/components/ui/apple-emoji/index.ts +1 -0
- package/components/ui/avatar/Avatar.vue +18 -0
- package/components/ui/avatar/AvatarFallback.vue +23 -0
- package/components/ui/avatar/AvatarImage.vue +16 -0
- package/components/ui/avatar/index.ts +3 -0
- package/components/ui/badge/Badge.vue +39 -0
- package/components/ui/badge/index.ts +1 -0
- package/components/ui/breadcrumb/Breadcrumb.vue +17 -0
- package/components/ui/breadcrumb/BreadcrumbEllipsis.vue +23 -0
- package/components/ui/breadcrumb/BreadcrumbItem.vue +17 -0
- package/components/ui/breadcrumb/BreadcrumbLink.vue +20 -0
- package/components/ui/breadcrumb/BreadcrumbList.vue +17 -0
- package/components/ui/breadcrumb/BreadcrumbPage.vue +20 -0
- package/components/ui/breadcrumb/BreadcrumbSeparator.vue +22 -0
- package/components/ui/breadcrumb/index.ts +7 -0
- package/components/ui/button/Button.vue +39 -0
- package/components/ui/button/index.ts +36 -0
- package/components/ui/calendar/Calendar.vue +63 -0
- package/components/ui/calendar/CalendarCell.vue +25 -0
- package/components/ui/calendar/CalendarCellTrigger.vue +41 -0
- package/components/ui/calendar/CalendarGrid.vue +25 -0
- package/components/ui/calendar/CalendarGridBody.vue +14 -0
- package/components/ui/calendar/CalendarGridHead.vue +15 -0
- package/components/ui/calendar/CalendarGridRow.vue +24 -0
- package/components/ui/calendar/CalendarHeadCell.vue +25 -0
- package/components/ui/calendar/CalendarHeader.vue +25 -0
- package/components/ui/calendar/CalendarHeading.vue +32 -0
- package/components/ui/calendar/CalendarNextButton.vue +34 -0
- package/components/ui/calendar/CalendarPrevButton.vue +34 -0
- package/components/ui/calendar/index.ts +12 -0
- package/components/ui/card/Card.vue +22 -0
- package/components/ui/card/CardAction.vue +17 -0
- package/components/ui/card/CardContent.vue +17 -0
- package/components/ui/card/CardDescription.vue +17 -0
- package/components/ui/card/CardFooter.vue +17 -0
- package/components/ui/card/CardHeader.vue +17 -0
- package/components/ui/card/CardTitle.vue +17 -0
- package/components/ui/card/index.ts +7 -0
- package/components/ui/checkbox/Checkbox.vue +37 -0
- package/components/ui/checkbox/index.ts +1 -0
- package/components/ui/code-editor/CodeEditor.vue +88 -0
- package/components/ui/code-editor/index.ts +1 -0
- package/components/ui/code-editor/interpolationHighlight.ts +39 -0
- package/components/ui/collapsible/Collapsible.vue +19 -0
- package/components/ui/collapsible/CollapsibleContent.vue +14 -0
- package/components/ui/collapsible/CollapsibleTrigger.vue +14 -0
- package/components/ui/collapsible/index.ts +3 -0
- package/components/ui/combobox/Combobox.vue +17 -0
- package/components/ui/combobox/ComboboxAnchor.vue +26 -0
- package/components/ui/combobox/ComboboxEmpty.vue +24 -0
- package/components/ui/combobox/ComboboxGroup.vue +30 -0
- package/components/ui/combobox/ComboboxInput.vue +47 -0
- package/components/ui/combobox/ComboboxItem.vue +27 -0
- package/components/ui/combobox/ComboboxItemIndicator.vue +26 -0
- package/components/ui/combobox/ComboboxList.vue +31 -0
- package/components/ui/combobox/ComboboxSeparator.vue +24 -0
- package/components/ui/combobox/ComboboxTrigger.vue +27 -0
- package/components/ui/combobox/ComboboxViewport.vue +26 -0
- package/components/ui/combobox/index.ts +12 -0
- package/components/ui/command/Command.vue +93 -0
- package/components/ui/command/CommandDialog.vue +31 -0
- package/components/ui/command/CommandEmpty.vue +29 -0
- package/components/ui/command/CommandGroup.vue +47 -0
- package/components/ui/command/CommandInput.vue +41 -0
- package/components/ui/command/CommandItem.vue +79 -0
- package/components/ui/command/CommandList.vue +28 -0
- package/components/ui/command/CommandSeparator.vue +24 -0
- package/components/ui/command/CommandShortcut.vue +17 -0
- package/components/ui/command/index.ts +25 -0
- package/components/ui/context-menu/ContextMenu.vue +18 -0
- package/components/ui/context-menu/ContextMenuCheckboxItem.vue +41 -0
- package/components/ui/context-menu/ContextMenuContent.vue +37 -0
- package/components/ui/context-menu/ContextMenuGroup.vue +14 -0
- package/components/ui/context-menu/ContextMenuItem.vue +42 -0
- package/components/ui/context-menu/ContextMenuLabel.vue +24 -0
- package/components/ui/context-menu/ContextMenuPortal.vue +14 -0
- package/components/ui/context-menu/ContextMenuRadioGroup.vue +22 -0
- package/components/ui/context-menu/ContextMenuRadioItem.vue +41 -0
- package/components/ui/context-menu/ContextMenuSeparator.vue +24 -0
- package/components/ui/context-menu/ContextMenuShortcut.vue +17 -0
- package/components/ui/context-menu/ContextMenuSub.vue +22 -0
- package/components/ui/context-menu/ContextMenuSubContent.vue +36 -0
- package/components/ui/context-menu/ContextMenuSubTrigger.vue +35 -0
- package/components/ui/context-menu/ContextMenuTrigger.vue +16 -0
- package/components/ui/context-menu/index.ts +14 -0
- package/components/ui/custom-dialog/CustomDialog.vue +31 -0
- package/components/ui/custom-dialog/index.ts +1 -0
- package/components/ui/dialog/Dialog.vue +17 -0
- package/components/ui/dialog/DialogClose.vue +14 -0
- package/components/ui/dialog/DialogContent.vue +49 -0
- package/components/ui/dialog/DialogDescription.vue +25 -0
- package/components/ui/dialog/DialogFooter.vue +15 -0
- package/components/ui/dialog/DialogHeader.vue +17 -0
- package/components/ui/dialog/DialogOverlay.vue +23 -0
- package/components/ui/dialog/DialogScrollContent.vue +59 -0
- package/components/ui/dialog/DialogTitle.vue +25 -0
- package/components/ui/dialog/DialogTrigger.vue +14 -0
- package/components/ui/dialog/index.ts +10 -0
- package/components/ui/drawer/Drawer.vue +22 -0
- package/components/ui/drawer/DrawerClose.vue +15 -0
- package/components/ui/drawer/DrawerContent.vue +34 -0
- package/components/ui/drawer/DrawerDescription.vue +24 -0
- package/components/ui/drawer/DrawerFooter.vue +17 -0
- package/components/ui/drawer/DrawerHeader.vue +17 -0
- package/components/ui/drawer/DrawerOverlay.vue +22 -0
- package/components/ui/drawer/DrawerTitle.vue +24 -0
- package/components/ui/drawer/DrawerTrigger.vue +15 -0
- package/components/ui/drawer/index.ts +9 -0
- package/components/ui/dropdown-menu/DropdownMenu.vue +17 -0
- package/components/ui/dropdown-menu/DropdownMenuCheckboxItem.vue +41 -0
- package/components/ui/dropdown-menu/DropdownMenuContent.vue +39 -0
- package/components/ui/dropdown-menu/DropdownMenuGroup.vue +14 -0
- package/components/ui/dropdown-menu/DropdownMenuItem.vue +30 -0
- package/components/ui/dropdown-menu/DropdownMenuLabel.vue +22 -0
- package/components/ui/dropdown-menu/DropdownMenuRadioGroup.vue +22 -0
- package/components/ui/dropdown-menu/DropdownMenuRadioItem.vue +42 -0
- package/components/ui/dropdown-menu/DropdownMenuSeparator.vue +26 -0
- package/components/ui/dropdown-menu/DropdownMenuShortcut.vue +17 -0
- package/components/ui/dropdown-menu/DropdownMenuSub.vue +19 -0
- package/components/ui/dropdown-menu/DropdownMenuSubContent.vue +31 -0
- package/components/ui/dropdown-menu/DropdownMenuSubTrigger.vue +30 -0
- package/components/ui/dropdown-menu/DropdownMenuTrigger.vue +16 -0
- package/components/ui/dropdown-menu/index.ts +16 -0
- package/components/ui/emoji-picker/EmojiPicker.vue +71 -0
- package/components/ui/emoji-picker/index.ts +1 -0
- package/components/ui/flow-builder/FlowBuilder.vue +48 -0
- package/components/ui/flow-builder/FlowBuilderSelect.vue +33 -0
- package/components/ui/flow-builder/components/Builder.vue +287 -0
- package/components/ui/flow-builder/components/DropzoneBackground.vue +13 -0
- package/components/ui/flow-builder/components/EdgeEditor.vue +36 -0
- package/components/ui/flow-builder/components/Menu.vue +78 -0
- package/components/ui/flow-builder/components/NodeEditor.vue +181 -0
- package/components/ui/flow-builder/components/edge-editor/DataEdgeEditor.vue +64 -0
- package/components/ui/flow-builder/components/edges/DataEdge.vue +87 -0
- package/components/ui/flow-builder/components/node-editor/ApiRequestEditor.vue +150 -0
- package/components/ui/flow-builder/components/node-editor/ConfettiEditor.vue +23 -0
- package/components/ui/flow-builder/components/node-editor/ConfirmEditor.vue +30 -0
- package/components/ui/flow-builder/components/node-editor/FinishFlowEditor.vue +33 -0
- package/components/ui/flow-builder/components/node-editor/IntegrationActionEditor.vue +50 -0
- package/components/ui/flow-builder/components/node-editor/SetVariableEditor.vue +71 -0
- package/components/ui/flow-builder/components/node-editor/ShowDialogEditor.vue +26 -0
- package/components/ui/flow-builder/components/node-editor/ShowModuleEditor.vue +92 -0
- package/components/ui/flow-builder/components/node-editor/ShowToastEditor.vue +28 -0
- package/components/ui/flow-builder/components/node-editor/TransformDataEditor.vue +27 -0
- package/components/ui/flow-builder/components/node-editor/VisitUrlEditor.vue +31 -0
- package/components/ui/flow-builder/components/nodes/ApiRequestNode.vue +45 -0
- package/components/ui/flow-builder/components/nodes/ConfettiNode.vue +32 -0
- package/components/ui/flow-builder/components/nodes/ConfirmNode.vue +45 -0
- package/components/ui/flow-builder/components/nodes/EmptyNode.vue +26 -0
- package/components/ui/flow-builder/components/nodes/FinishFlowNode.vue +30 -0
- package/components/ui/flow-builder/components/nodes/IntegrationActionNode.vue +52 -0
- package/components/ui/flow-builder/components/nodes/SetVariableNode.vue +34 -0
- package/components/ui/flow-builder/components/nodes/ShowDialogNode.vue +34 -0
- package/components/ui/flow-builder/components/nodes/ShowModuleNode.vue +34 -0
- package/components/ui/flow-builder/components/nodes/ShowToastNode.vue +35 -0
- package/components/ui/flow-builder/components/nodes/StartNode.vue +27 -0
- package/components/ui/flow-builder/components/nodes/TransformDataNode.vue +34 -0
- package/components/ui/flow-builder/components/nodes/VisitUrlNode.vue +34 -0
- package/components/ui/flow-builder/components/toolbars/ApiRequestToolbar.vue +45 -0
- package/components/ui/flow-builder/components/toolbars/ConfirmToolbar.vue +45 -0
- package/components/ui/flow-builder/components/toolbars/DefaultToolbar.vue +42 -0
- package/components/ui/flow-builder/components/toolbars/IntegrationActionToolbar.vue +45 -0
- package/components/ui/flow-builder/components/variables/Widget.vue +137 -0
- package/components/ui/flow-builder/composables/outputRegistry.ts +33 -0
- package/components/ui/flow-builder/composables/taskHandlers.js +185 -0
- package/components/ui/flow-builder/composables/useLayout.js +60 -0
- package/components/ui/flow-builder/composables/useProcessNodeLogic.js +55 -0
- package/components/ui/flow-builder/composables/useRunProcess.js +267 -0
- package/components/ui/flow-builder/index.ts +5 -0
- package/components/ui/flow-builder/types.ts +7 -0
- package/components/ui/form/FormControl.vue +17 -0
- package/components/ui/form/FormDescription.vue +21 -0
- package/components/ui/form/FormItem.vue +22 -0
- package/components/ui/form/FormLabel.vue +25 -0
- package/components/ui/form/FormMessage.vue +22 -0
- package/components/ui/form/index.ts +7 -0
- package/components/ui/form/injectionKeys.ts +4 -0
- package/components/ui/form/useFormField.ts +30 -0
- package/components/ui/form-builder/FormBuilder.vue +45 -0
- package/components/ui/form-builder/FormBuilderSelect.vue +42 -0
- package/components/ui/form-builder/FormDisplayer.vue +39 -0
- package/components/ui/form-builder/components/AdminElementEditor.vue +48 -0
- package/components/ui/form-builder/components/AdminToolbar.vue +60 -0
- package/components/ui/form-builder/components/AdminToolbarView.vue +19 -0
- package/components/ui/form-builder/components/CustomDashboard.vue +312 -0
- package/components/ui/form-builder/components/FormBuilderWrapper.vue +333 -0
- package/components/ui/form-builder/components/admin/Transformer.vue +25 -0
- package/components/ui/form-builder/components/admin/element-setting-views/Button.vue +30 -0
- package/components/ui/form-builder/components/admin/element-setting-views/Checkbox.vue +23 -0
- package/components/ui/form-builder/components/admin/element-setting-views/Label.vue +13 -0
- package/components/ui/form-builder/components/admin/element-setting-views/Radios.vue +85 -0
- package/components/ui/form-builder/components/admin/element-setting-views/Scanner.vue +15 -0
- package/components/ui/form-builder/components/admin/element-setting-views/Select.vue +75 -0
- package/components/ui/form-builder/components/admin/element-setting-views/Text.vue +13 -0
- package/components/ui/form-builder/components/admin/element-setting-views/Textarea.vue +20 -0
- package/components/ui/form-builder/components/admin/element-setting-views/Textfield.vue +20 -0
- package/components/ui/form-builder/components/admin/element-setting-views/index.ts +21 -0
- package/components/ui/form-builder/components/admin/setting-views/ApiActionsView.vue +111 -0
- package/components/ui/form-builder/components/admin/setting-views/NewElementView.vue +200 -0
- package/components/ui/form-builder/components/admin/setting-views/VariablesView.vue +19 -0
- package/components/ui/form-builder/components/admin/setting-views/new-element-view/DraggableElement.vue +107 -0
- package/components/ui/form-builder/components/admin/setting-views/variables-view/ApiActionVariables.vue +27 -0
- package/components/ui/form-builder/components/admin/setting-views/variables-view/RouteQueryParams.vue +47 -0
- package/components/ui/form-builder/components/admin/setting-views/variables-view/Transformers.vue +61 -0
- package/components/ui/form-builder/components/admin/setting-views/variables-view/Variables.vue +74 -0
- package/components/ui/form-builder/components/elements/button/Button.vue +60 -0
- package/components/ui/form-builder/components/elements/button/index.ts +1 -0
- package/components/ui/form-builder/components/elements/checkbox/Checkbox.vue +40 -0
- package/components/ui/form-builder/components/elements/checkbox/index.ts +1 -0
- package/components/ui/form-builder/components/elements/file/File.vue +6 -0
- package/components/ui/form-builder/components/elements/file/index.ts +1 -0
- package/components/ui/form-builder/components/elements/images/Images.vue +28 -0
- package/components/ui/form-builder/components/elements/images/index.ts +1 -0
- package/components/ui/form-builder/components/elements/index.ts +31 -0
- package/components/ui/form-builder/components/elements/items/Items.vue +6 -0
- package/components/ui/form-builder/components/elements/items/index.ts +1 -0
- package/components/ui/form-builder/components/elements/label/Label.vue +20 -0
- package/components/ui/form-builder/components/elements/label/index.ts +1 -0
- package/components/ui/form-builder/components/elements/location/Location.vue +6 -0
- package/components/ui/form-builder/components/elements/location/index.ts +1 -0
- package/components/ui/form-builder/components/elements/radios/Radios.vue +42 -0
- package/components/ui/form-builder/components/elements/radios/index.ts +1 -0
- package/components/ui/form-builder/components/elements/richtext/Richtext.vue +6 -0
- package/components/ui/form-builder/components/elements/richtext/index.ts +1 -0
- package/components/ui/form-builder/components/elements/scanner/Scanner.vue +173 -0
- package/components/ui/form-builder/components/elements/scanner/index.ts +1 -0
- package/components/ui/form-builder/components/elements/select/Select.vue +49 -0
- package/components/ui/form-builder/components/elements/select/index.ts +1 -0
- package/components/ui/form-builder/components/elements/text/Text.vue +20 -0
- package/components/ui/form-builder/components/elements/text/index.ts +1 -0
- package/components/ui/form-builder/components/elements/textarea/Textarea.vue +30 -0
- package/components/ui/form-builder/components/elements/textarea/index.ts +1 -0
- package/components/ui/form-builder/components/elements/textfield/Textfield.vue +30 -0
- package/components/ui/form-builder/components/elements/textfield/index.ts +1 -0
- package/components/ui/form-builder/index.ts +3 -0
- package/components/ui/input/Input.vue +33 -0
- package/components/ui/input/index.ts +1 -0
- package/components/ui/integration-action-builder/IntegrationActionBuilder.vue +193 -0
- package/components/ui/integration-action-builder/InterpolationField.vue +29 -0
- package/components/ui/integration-action-builder/index.ts +1 -0
- package/components/ui/integration-action-builder/integrations/firebase/AddDocument.vue +43 -0
- package/components/ui/integration-action-builder/integrations/firebase/DeleteDocument.vue +6 -0
- package/components/ui/integration-action-builder/integrations/firebase/GetCollections.vue +6 -0
- package/components/ui/integration-action-builder/integrations/firebase/GetDocumentById.vue +6 -0
- package/components/ui/integration-action-builder/integrations/firebase/QueryCollectionGroup.vue +6 -0
- package/components/ui/integration-action-builder/integrations/firebase/QueryFirestore.vue +165 -0
- package/components/ui/integration-action-builder/integrations/firebase/UpdateDocument.vue +6 -0
- package/components/ui/integration-action-builder/integrations/firebase/index.ts +204 -0
- package/components/ui/integration-action-builder/integrations/index.ts +9 -0
- package/components/ui/integration-action-builder/integrations/openai/AddDocument.vue +43 -0
- package/components/ui/integration-action-builder/integrations/openai/GenerateText.vue +40 -0
- package/components/ui/integration-action-builder/integrations/openai/components/ModelSelector.vue +75 -0
- package/components/ui/integration-action-builder/integrations/openai/index.ts +116 -0
- package/components/ui/integration-action-builder/integrations/twilio/MakeCall.vue +40 -0
- package/components/ui/integration-action-builder/integrations/twilio/SendSMS.vue +39 -0
- package/components/ui/integration-action-builder/integrations/twilio/components/ModelSelector.vue +75 -0
- package/components/ui/integration-action-builder/integrations/twilio/index.ts +68 -0
- package/components/ui/integration-icon/IntegrationIcon.vue +18 -0
- package/components/ui/integration-icon/index.ts +1 -0
- package/components/ui/label/Label.vue +28 -0
- package/components/ui/label/index.ts +1 -0
- package/components/ui/lucide-icon-selector/LucideIconPicker.vue +34 -0
- package/components/ui/lucide-icon-selector/LucideIconSelector.vue +55 -0
- package/components/ui/lucide-icon-selector/index.ts +2 -0
- package/components/ui/media-picker/MediaPicker.vue +40 -0
- package/components/ui/media-picker/MediaPickerDialog.vue +306 -0
- package/components/ui/media-picker/MediaPickerItems.vue +342 -0
- package/components/ui/media-picker/index.ts +2 -0
- package/components/ui/media-picker/media-picker-dialog/Dropzone.vue +104 -0
- package/components/ui/media-picker/media-picker-dialog/FileItem.vue +108 -0
- package/components/ui/media-picker/media-picker-dialog/Filters.vue +78 -0
- package/components/ui/menubar/Menubar.vue +36 -0
- package/components/ui/menubar/MenubarCheckboxItem.vue +41 -0
- package/components/ui/menubar/MenubarContent.vue +44 -0
- package/components/ui/menubar/MenubarGroup.vue +14 -0
- package/components/ui/menubar/MenubarItem.vue +37 -0
- package/components/ui/menubar/MenubarLabel.vue +19 -0
- package/components/ui/menubar/MenubarMenu.vue +14 -0
- package/components/ui/menubar/MenubarRadioGroup.vue +22 -0
- package/components/ui/menubar/MenubarRadioItem.vue +41 -0
- package/components/ui/menubar/MenubarSeparator.vue +23 -0
- package/components/ui/menubar/MenubarShortcut.vue +17 -0
- package/components/ui/menubar/MenubarSub.vue +22 -0
- package/components/ui/menubar/MenubarSubContent.vue +39 -0
- package/components/ui/menubar/MenubarSubTrigger.vue +27 -0
- package/components/ui/menubar/MenubarTrigger.vue +30 -0
- package/components/ui/menubar/index.ts +15 -0
- package/components/ui/number-field/NumberField.vue +23 -0
- package/components/ui/number-field/NumberFieldContent.vue +14 -0
- package/components/ui/number-field/NumberFieldDecrement.vue +25 -0
- package/components/ui/number-field/NumberFieldIncrement.vue +25 -0
- package/components/ui/number-field/NumberFieldInput.vue +16 -0
- package/components/ui/number-field/index.ts +5 -0
- package/components/ui/pagination/PaginationEllipsis.vue +22 -0
- package/components/ui/pagination/PaginationFirst.vue +29 -0
- package/components/ui/pagination/PaginationLast.vue +29 -0
- package/components/ui/pagination/PaginationNext.vue +29 -0
- package/components/ui/pagination/PaginationPrev.vue +29 -0
- package/components/ui/pagination/index.ts +10 -0
- package/components/ui/popover/Popover.vue +18 -0
- package/components/ui/popover/PopoverAnchor.vue +15 -0
- package/components/ui/popover/PopoverContent.vue +49 -0
- package/components/ui/popover/PopoverTrigger.vue +14 -0
- package/components/ui/popover/index.ts +4 -0
- package/components/ui/query-builder-dialog/QueryBuilderDialog.vue +389 -0
- package/components/ui/query-builder-dialog/index.ts +1 -0
- package/components/ui/radio-group/RadioGroup.vue +30 -0
- package/components/ui/radio-group/RadioGroupItem.vue +43 -0
- package/components/ui/radio-group/index.ts +2 -0
- package/components/ui/range-calendar/RangeCalendar.vue +57 -0
- package/components/ui/range-calendar/RangeCalendarCell.vue +21 -0
- package/components/ui/range-calendar/RangeCalendarCellTrigger.vue +37 -0
- package/components/ui/range-calendar/RangeCalendarGrid.vue +21 -0
- package/components/ui/range-calendar/RangeCalendarGridBody.vue +11 -0
- package/components/ui/range-calendar/RangeCalendarGridHead.vue +11 -0
- package/components/ui/range-calendar/RangeCalendarGridRow.vue +18 -0
- package/components/ui/range-calendar/RangeCalendarHeadCell.vue +18 -0
- package/components/ui/range-calendar/RangeCalendarHeader.vue +18 -0
- package/components/ui/range-calendar/RangeCalendarHeading.vue +28 -0
- package/components/ui/range-calendar/RangeCalendarNextButton.vue +29 -0
- package/components/ui/range-calendar/RangeCalendarPrevButton.vue +29 -0
- package/components/ui/range-calendar/index.ts +12 -0
- package/components/ui/resizable/ResizableHandle.vue +27 -0
- package/components/ui/resizable/ResizablePanel.vue +18 -0
- package/components/ui/resizable/ResizablePanelGroup.vue +25 -0
- package/components/ui/resizable/index.ts +3 -0
- package/components/ui/ripple-button/RippleButton.vue +97 -0
- package/components/ui/ripple-button/index.ts +1 -0
- package/components/ui/sandbox/Sandbox.vue +35 -0
- package/components/ui/sandbox/index.ts +1 -0
- package/components/ui/scroll-area/ScrollArea.vue +36 -0
- package/components/ui/scroll-area/ScrollBar.vue +34 -0
- package/components/ui/scroll-area/index.ts +2 -0
- package/components/ui/segmented-control/SegmentedControl.vue +121 -0
- package/components/ui/segmented-control/SegmentedControlButton.vue +64 -0
- package/components/ui/segmented-control/index.ts +2 -0
- package/components/ui/select/Select.vue +18 -0
- package/components/ui/select/SelectContent.vue +55 -0
- package/components/ui/select/SelectGroup.vue +14 -0
- package/components/ui/select/SelectItem.vue +45 -0
- package/components/ui/select/SelectItemText.vue +14 -0
- package/components/ui/select/SelectLabel.vue +16 -0
- package/components/ui/select/SelectScrollDownButton.vue +28 -0
- package/components/ui/select/SelectScrollUpButton.vue +28 -0
- package/components/ui/select/SelectSeparator.vue +21 -0
- package/components/ui/select/SelectTrigger.vue +32 -0
- package/components/ui/select/SelectValue.vue +15 -0
- package/components/ui/select/index.ts +11 -0
- package/components/ui/separator/Separator.vue +28 -0
- package/components/ui/separator/index.ts +1 -0
- package/components/ui/sheet/Sheet.vue +17 -0
- package/components/ui/sheet/SheetClose.vue +14 -0
- package/components/ui/sheet/SheetContent.vue +65 -0
- package/components/ui/sheet/SheetDescription.vue +20 -0
- package/components/ui/sheet/SheetFooter.vue +16 -0
- package/components/ui/sheet/SheetHeader.vue +15 -0
- package/components/ui/sheet/SheetOverlay.vue +24 -0
- package/components/ui/sheet/SheetTitle.vue +20 -0
- package/components/ui/sheet/SheetTrigger.vue +14 -0
- package/components/ui/sheet/index.ts +8 -0
- package/components/ui/sidebar/Sidebar.vue +96 -0
- package/components/ui/sidebar/SidebarContent.vue +18 -0
- package/components/ui/sidebar/SidebarFooter.vue +18 -0
- package/components/ui/sidebar/SidebarGroup.vue +18 -0
- package/components/ui/sidebar/SidebarGroupAction.vue +27 -0
- package/components/ui/sidebar/SidebarGroupContent.vue +18 -0
- package/components/ui/sidebar/SidebarGroupLabel.vue +25 -0
- package/components/ui/sidebar/SidebarHeader.vue +18 -0
- package/components/ui/sidebar/SidebarInput.vue +22 -0
- package/components/ui/sidebar/SidebarInset.vue +21 -0
- package/components/ui/sidebar/SidebarMenu.vue +18 -0
- package/components/ui/sidebar/SidebarMenuAction.vue +34 -0
- package/components/ui/sidebar/SidebarMenuBadge.vue +26 -0
- package/components/ui/sidebar/SidebarMenuButton.vue +49 -0
- package/components/ui/sidebar/SidebarMenuButtonChild.vue +34 -0
- package/components/ui/sidebar/SidebarMenuItem.vue +18 -0
- package/components/ui/sidebar/SidebarMenuSkeleton.vue +34 -0
- package/components/ui/sidebar/SidebarMenuSub.vue +22 -0
- package/components/ui/sidebar/SidebarMenuSubButton.vue +36 -0
- package/components/ui/sidebar/SidebarMenuSubItem.vue +18 -0
- package/components/ui/sidebar/SidebarProvider.vue +81 -0
- package/components/ui/sidebar/SidebarRail.vue +33 -0
- package/components/ui/sidebar/SidebarSeparator.vue +19 -0
- package/components/ui/sidebar/SidebarTrigger.vue +27 -0
- package/components/ui/sidebar/index.ts +60 -0
- package/components/ui/sidebar/utils.ts +19 -0
- package/components/ui/skeleton/Skeleton.vue +17 -0
- package/components/ui/skeleton/index.ts +1 -0
- package/components/ui/sonner/Sonner.vue +18 -0
- package/components/ui/sonner/index.ts +1 -0
- package/components/ui/spring-calendar/SpringCalendar.vue +110 -0
- package/components/ui/spring-calendar/TextMorph.vue +160 -0
- package/components/ui/spring-calendar/index.ts +2 -0
- package/components/ui/switch/Switch.vue +41 -0
- package/components/ui/switch/index.ts +1 -0
- package/components/ui/table/Table.vue +16 -0
- package/components/ui/table/TableBody.vue +17 -0
- package/components/ui/table/TableCaption.vue +17 -0
- package/components/ui/table/TableCell.vue +22 -0
- package/components/ui/table/TableEmpty.vue +37 -0
- package/components/ui/table/TableFooter.vue +17 -0
- package/components/ui/table/TableHead.vue +17 -0
- package/components/ui/table/TableHeader.vue +17 -0
- package/components/ui/table/TableRow.vue +17 -0
- package/components/ui/table/index.ts +9 -0
- package/components/ui/table/utils.ts +9 -0
- package/components/ui/tabs/Tabs.vue +15 -0
- package/components/ui/tabs/TabsContent.vue +22 -0
- package/components/ui/tabs/TabsList.vue +25 -0
- package/components/ui/tabs/TabsTrigger.vue +29 -0
- package/components/ui/tabs/index.ts +4 -0
- package/components/ui/tailwind-color-picker/TailwindColorPicker.vue +58 -0
- package/components/ui/tailwind-color-picker/index.ts +1 -0
- package/components/ui/textarea/Textarea.vue +28 -0
- package/components/ui/textarea/index.ts +1 -0
- package/components/ui/toggle/Toggle.vue +32 -0
- package/components/ui/toggle/index.ts +27 -0
- package/components/ui/tooltip/Tooltip.vue +17 -0
- package/components/ui/tooltip/TooltipContent.vue +33 -0
- package/components/ui/tooltip/TooltipProvider.vue +13 -0
- package/components/ui/tooltip/TooltipTrigger.vue +14 -0
- package/components/ui/tooltip/index.ts +4 -0
- package/composables/useCms.ts +11 -0
- package/index.ts +10 -0
- package/lib/interpolation.ts +77 -0
- package/lib/utils.ts +24 -0
- package/package.json +52 -0
- package/styles/components/code-editor.css +52 -0
- package/styles/components/flow-builder.css +159 -0
- package/styles/index.css +2 -0
- package/tsconfig.json +19 -0
- package/types/index.ts +41 -0
- package/vite.config.ts +25 -0
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { cn } from '../../../lib/utils'
|
|
3
|
+
import { TabsContent, type TabsContentProps } from 'reka-ui'
|
|
4
|
+
import { computed, type HTMLAttributes } from 'vue'
|
|
5
|
+
|
|
6
|
+
const props = defineProps<TabsContentProps & { class?: HTMLAttributes['class'] }>()
|
|
7
|
+
|
|
8
|
+
const delegatedProps = computed(() => {
|
|
9
|
+
const { class: _, ...delegated } = props
|
|
10
|
+
|
|
11
|
+
return delegated
|
|
12
|
+
})
|
|
13
|
+
</script>
|
|
14
|
+
|
|
15
|
+
<template>
|
|
16
|
+
<TabsContent
|
|
17
|
+
:class="cn('mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2', props.class)"
|
|
18
|
+
v-bind="delegatedProps"
|
|
19
|
+
>
|
|
20
|
+
<slot />
|
|
21
|
+
</TabsContent>
|
|
22
|
+
</template>
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { cn } from '../../../lib/utils'
|
|
3
|
+
import { TabsList, type TabsListProps } from 'reka-ui'
|
|
4
|
+
import { computed, type HTMLAttributes } from 'vue'
|
|
5
|
+
|
|
6
|
+
const props = defineProps<TabsListProps & { class?: HTMLAttributes['class'] }>()
|
|
7
|
+
|
|
8
|
+
const delegatedProps = computed(() => {
|
|
9
|
+
const { class: _, ...delegated } = props
|
|
10
|
+
|
|
11
|
+
return delegated
|
|
12
|
+
})
|
|
13
|
+
</script>
|
|
14
|
+
|
|
15
|
+
<template>
|
|
16
|
+
<TabsList
|
|
17
|
+
v-bind="delegatedProps"
|
|
18
|
+
:class="cn(
|
|
19
|
+
'inline-flex items-center justify-center rounded-md bg-muted p-1 text-muted-foreground',
|
|
20
|
+
props.class,
|
|
21
|
+
)"
|
|
22
|
+
>
|
|
23
|
+
<slot />
|
|
24
|
+
</TabsList>
|
|
25
|
+
</template>
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { cn } from '../../../lib/utils'
|
|
3
|
+
import { TabsTrigger, type TabsTriggerProps, useForwardProps } from 'reka-ui'
|
|
4
|
+
import { computed, type HTMLAttributes } from 'vue'
|
|
5
|
+
|
|
6
|
+
const props = defineProps<TabsTriggerProps & { class?: HTMLAttributes['class'] }>()
|
|
7
|
+
|
|
8
|
+
const delegatedProps = computed(() => {
|
|
9
|
+
const { class: _, ...delegated } = props
|
|
10
|
+
|
|
11
|
+
return delegated
|
|
12
|
+
})
|
|
13
|
+
|
|
14
|
+
const forwardedProps = useForwardProps(delegatedProps)
|
|
15
|
+
</script>
|
|
16
|
+
|
|
17
|
+
<template>
|
|
18
|
+
<TabsTrigger
|
|
19
|
+
v-bind="forwardedProps"
|
|
20
|
+
:class="cn(
|
|
21
|
+
'inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm',
|
|
22
|
+
props.class,
|
|
23
|
+
)"
|
|
24
|
+
>
|
|
25
|
+
<span class="truncate">
|
|
26
|
+
<slot />
|
|
27
|
+
</span>
|
|
28
|
+
</TabsTrigger>
|
|
29
|
+
</template>
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { HTMLAttributes } from 'vue'
|
|
3
|
+
import { useVModel } from '@vueuse/core'
|
|
4
|
+
|
|
5
|
+
const tailwindColors = ['yellow', 'green', 'cyan', 'blue', 'purple', 'pink', 'red']
|
|
6
|
+
|
|
7
|
+
const props = defineProps<{
|
|
8
|
+
defaultValue?: string
|
|
9
|
+
modelValue?: string
|
|
10
|
+
class?: HTMLAttributes['class']
|
|
11
|
+
}>()
|
|
12
|
+
|
|
13
|
+
const emits = defineEmits<{
|
|
14
|
+
(e: 'update:modelValue', payload: string): void
|
|
15
|
+
}>()
|
|
16
|
+
|
|
17
|
+
const modelValue = useVModel(props, 'modelValue', emits, {
|
|
18
|
+
passive: true,
|
|
19
|
+
defaultValue: props.defaultValue ?? '',
|
|
20
|
+
})
|
|
21
|
+
|
|
22
|
+
const selectColor = (color: string) => {
|
|
23
|
+
if (color === modelValue.value) {
|
|
24
|
+
emits('update:modelValue', props.defaultValue ?? '')
|
|
25
|
+
} else {
|
|
26
|
+
emits('update:modelValue', color)
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
</script>
|
|
30
|
+
|
|
31
|
+
<template>
|
|
32
|
+
<Popover>
|
|
33
|
+
<PopoverTrigger as-child>
|
|
34
|
+
<Button variant="outline" class="w-44">
|
|
35
|
+
<span v-if="modelValue" class="flex items-center gap-2">
|
|
36
|
+
<div :class="`bg-${modelValue}`" class="size-5 rounded-full"></div>
|
|
37
|
+
{{modelValue.split('-')[0]}}
|
|
38
|
+
{{modelValue.split('-')[1]}}
|
|
39
|
+
</span>
|
|
40
|
+
<span v-else>
|
|
41
|
+
Select color
|
|
42
|
+
</span>
|
|
43
|
+
</Button>
|
|
44
|
+
</PopoverTrigger>
|
|
45
|
+
<PopoverContent class="w-[170px]">
|
|
46
|
+
<div class="flex gap-1 mb-1" v-for="colorPalette in tailwindColors" :key="colorPalette">
|
|
47
|
+
<div
|
|
48
|
+
v-for="i in 5"
|
|
49
|
+
:key="i"
|
|
50
|
+
class="flex flex-col items-center cursor-pointer size-6 rounded-full cursor-pointer transition-all"
|
|
51
|
+
:class="`bg-${colorPalette}-${(i + 2) * 100} ${modelValue === `${colorPalette}-${(i + 2) * 100}` ? 'scale-110 z-10 outline-2 outline-white' : ''}`"
|
|
52
|
+
@click="selectColor(`${colorPalette}-${(i + 2) * 100}`)"
|
|
53
|
+
>
|
|
54
|
+
</div>
|
|
55
|
+
</div>
|
|
56
|
+
</PopoverContent>
|
|
57
|
+
</Popover>
|
|
58
|
+
</template>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as TailwindColorPicker } from './TailwindColorPicker.vue'
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { HTMLAttributes } from 'vue'
|
|
3
|
+
import { cn } from '../../../lib/utils'
|
|
4
|
+
import { useVModel } from '@vueuse/core'
|
|
5
|
+
|
|
6
|
+
const props = defineProps<{
|
|
7
|
+
class?: HTMLAttributes['class']
|
|
8
|
+
defaultValue?: string | number
|
|
9
|
+
modelValue?: string | number
|
|
10
|
+
}>()
|
|
11
|
+
|
|
12
|
+
const emits = defineEmits<{
|
|
13
|
+
(e: 'update:modelValue', payload: string | number): void
|
|
14
|
+
}>()
|
|
15
|
+
|
|
16
|
+
const modelValue = useVModel(props, 'modelValue', emits, {
|
|
17
|
+
passive: true,
|
|
18
|
+
defaultValue: props.defaultValue,
|
|
19
|
+
})
|
|
20
|
+
</script>
|
|
21
|
+
|
|
22
|
+
<template>
|
|
23
|
+
<textarea
|
|
24
|
+
v-model="modelValue"
|
|
25
|
+
data-slot="textarea"
|
|
26
|
+
:class="cn('border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex field-sizing-content min-h-16 w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm', props.class)"
|
|
27
|
+
/>
|
|
28
|
+
</template>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Textarea } from './Textarea.vue'
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { HTMLAttributes } from 'vue'
|
|
3
|
+
import { cn } from '../../../lib/utils'
|
|
4
|
+
import { reactiveOmit } from '@vueuse/core'
|
|
5
|
+
import { Toggle, type ToggleEmits, type ToggleProps, useForwardPropsEmits } from 'reka-ui'
|
|
6
|
+
import { type ToggleVariants, toggleVariants } from '.'
|
|
7
|
+
|
|
8
|
+
const props = withDefaults(defineProps<ToggleProps & {
|
|
9
|
+
class?: HTMLAttributes['class']
|
|
10
|
+
variant?: ToggleVariants['variant']
|
|
11
|
+
size?: ToggleVariants['size']
|
|
12
|
+
}>(), {
|
|
13
|
+
variant: 'default',
|
|
14
|
+
size: 'default',
|
|
15
|
+
disabled: false,
|
|
16
|
+
})
|
|
17
|
+
|
|
18
|
+
const emits = defineEmits<ToggleEmits>()
|
|
19
|
+
|
|
20
|
+
const delegatedProps = reactiveOmit(props, 'class', 'size', 'variant')
|
|
21
|
+
const forwarded = useForwardPropsEmits(delegatedProps, emits)
|
|
22
|
+
</script>
|
|
23
|
+
|
|
24
|
+
<template>
|
|
25
|
+
<Toggle
|
|
26
|
+
data-slot="toggle"
|
|
27
|
+
v-bind="forwarded"
|
|
28
|
+
:class="cn(toggleVariants({ variant, size }), props.class)"
|
|
29
|
+
>
|
|
30
|
+
<slot />
|
|
31
|
+
</Toggle>
|
|
32
|
+
</template>
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { cva, type VariantProps } from 'class-variance-authority'
|
|
2
|
+
|
|
3
|
+
export { default as Toggle } from './Toggle.vue'
|
|
4
|
+
|
|
5
|
+
export const toggleVariants = cva(
|
|
6
|
+
'inline-flex items-center justify-center gap-2 rounded-md text-sm font-medium hover:bg-muted hover:text-muted-foreground disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground [&_svg]:pointer-events-none [&_svg:not([class*=\'size-\'])]:size-4 [&_svg]:shrink-0 focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] outline-none transition-[color,box-shadow] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive whitespace-nowrap',
|
|
7
|
+
{
|
|
8
|
+
variants: {
|
|
9
|
+
variant: {
|
|
10
|
+
default: 'bg-transparent',
|
|
11
|
+
outline:
|
|
12
|
+
'border border-input bg-transparent shadow-xs hover:bg-accent hover:text-accent-foreground',
|
|
13
|
+
},
|
|
14
|
+
size: {
|
|
15
|
+
default: 'h-9 px-2 min-w-9',
|
|
16
|
+
sm: 'h-8 px-1.5 min-w-8',
|
|
17
|
+
lg: 'h-10 px-2.5 min-w-10',
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
defaultVariants: {
|
|
21
|
+
variant: 'default',
|
|
22
|
+
size: 'default',
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
)
|
|
26
|
+
|
|
27
|
+
export type ToggleVariants = VariantProps<typeof toggleVariants>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { TooltipRoot, type TooltipRootEmits, type TooltipRootProps, useForwardPropsEmits } from 'reka-ui'
|
|
3
|
+
|
|
4
|
+
const props = defineProps<TooltipRootProps>()
|
|
5
|
+
const emits = defineEmits<TooltipRootEmits>()
|
|
6
|
+
|
|
7
|
+
const forwarded = useForwardPropsEmits(props, emits)
|
|
8
|
+
</script>
|
|
9
|
+
|
|
10
|
+
<template>
|
|
11
|
+
<TooltipRoot
|
|
12
|
+
data-slot="tooltip"
|
|
13
|
+
v-bind="forwarded"
|
|
14
|
+
>
|
|
15
|
+
<slot />
|
|
16
|
+
</TooltipRoot>
|
|
17
|
+
</template>
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { HTMLAttributes } from 'vue'
|
|
3
|
+
import { cn } from '../../../lib/utils'
|
|
4
|
+
import { reactiveOmit } from '@vueuse/core'
|
|
5
|
+
import { TooltipArrow, TooltipContent, type TooltipContentEmits, type TooltipContentProps, TooltipPortal, useForwardPropsEmits } from 'reka-ui'
|
|
6
|
+
|
|
7
|
+
defineOptions({
|
|
8
|
+
inheritAttrs: false,
|
|
9
|
+
})
|
|
10
|
+
|
|
11
|
+
const props = withDefaults(defineProps<TooltipContentProps & { class?: HTMLAttributes['class'] }>(), {
|
|
12
|
+
sideOffset: 4,
|
|
13
|
+
})
|
|
14
|
+
|
|
15
|
+
const emits = defineEmits<TooltipContentEmits>()
|
|
16
|
+
|
|
17
|
+
const delegatedProps = reactiveOmit(props, 'class')
|
|
18
|
+
const forwarded = useForwardPropsEmits(delegatedProps, emits)
|
|
19
|
+
</script>
|
|
20
|
+
|
|
21
|
+
<template>
|
|
22
|
+
<TooltipPortal>
|
|
23
|
+
<TooltipContent
|
|
24
|
+
data-slot="tooltip-content"
|
|
25
|
+
v-bind="{ ...forwarded, ...$attrs }"
|
|
26
|
+
:class="cn('bg-primary text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-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 w-fit rounded-md px-3 py-1.5 text-xs text-balance', props.class)"
|
|
27
|
+
>
|
|
28
|
+
<slot />
|
|
29
|
+
|
|
30
|
+
<TooltipArrow class="bg-primary fill-primary z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]" />
|
|
31
|
+
</TooltipContent>
|
|
32
|
+
</TooltipPortal>
|
|
33
|
+
</template>
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { TooltipProvider, type TooltipProviderProps } from 'reka-ui'
|
|
3
|
+
|
|
4
|
+
const props = withDefaults(defineProps<TooltipProviderProps>(), {
|
|
5
|
+
delayDuration: 0,
|
|
6
|
+
})
|
|
7
|
+
</script>
|
|
8
|
+
|
|
9
|
+
<template>
|
|
10
|
+
<TooltipProvider v-bind="props">
|
|
11
|
+
<slot />
|
|
12
|
+
</TooltipProvider>
|
|
13
|
+
</template>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { TooltipTrigger, type TooltipTriggerProps } from 'reka-ui'
|
|
3
|
+
|
|
4
|
+
const props = defineProps<TooltipTriggerProps>()
|
|
5
|
+
</script>
|
|
6
|
+
|
|
7
|
+
<template>
|
|
8
|
+
<TooltipTrigger
|
|
9
|
+
data-slot="tooltip-trigger"
|
|
10
|
+
v-bind="props"
|
|
11
|
+
>
|
|
12
|
+
<slot />
|
|
13
|
+
</TooltipTrigger>
|
|
14
|
+
</template>
|
package/index.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export * from './composables/useCms'
|
|
2
|
+
export * from './types'
|
|
3
|
+
|
|
4
|
+
const modules = import.meta.glob('./components/ui/**/index.ts', { eager: true })
|
|
5
|
+
|
|
6
|
+
export const components = {}
|
|
7
|
+
|
|
8
|
+
for (const mod of Object.values(modules)) {
|
|
9
|
+
Object.assign(components, mod)
|
|
10
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
export function interpolateTemplateFromVariableContext(template: string, variableContext: Variable[]): string {
|
|
2
|
+
if (!template) return "";
|
|
3
|
+
const context: Record<string, any> = variableContext?.reduce((acc, variable) => {
|
|
4
|
+
acc[variable.name] = variable.value
|
|
5
|
+
return acc
|
|
6
|
+
}, {}) ?? {}
|
|
7
|
+
|
|
8
|
+
return interpolateTemplate(template, sanitizeContext(context))
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export function interpolateTemplateFromVariableObject(template: string, variableContext: Record<string, any>): string {
|
|
12
|
+
return interpolateTemplate(template, sanitizeContext(variableContext))
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
// HELPER INTERFACES & FUNCTIONS
|
|
17
|
+
interface Variable {
|
|
18
|
+
name: string,
|
|
19
|
+
type: string,
|
|
20
|
+
value: any
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function isValidIdentifier(name: string): boolean {
|
|
24
|
+
return /^[$A-Z_][0-9A-Z_$]*$/i.test(name)
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
function sanitizeContext(context: Record<string, any>): Record<string, any> {
|
|
28
|
+
const blacklist = ['__proto__', 'constructor', 'prototype']
|
|
29
|
+
const deepSanitize = (obj: any): any => {
|
|
30
|
+
if (Array.isArray(obj)) return obj.map(deepSanitize)
|
|
31
|
+
if (obj && typeof obj === 'object') {
|
|
32
|
+
const result: Record<string, any> = {}
|
|
33
|
+
for (const key in obj) {
|
|
34
|
+
if (!blacklist.includes(key) && isValidIdentifier(key)) {
|
|
35
|
+
result[key] = deepSanitize(obj[key])
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
return result
|
|
39
|
+
}
|
|
40
|
+
return obj
|
|
41
|
+
}
|
|
42
|
+
return deepSanitize(context)
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
function interpolateTemplate(template: string, context: Record<string, any>): string {
|
|
46
|
+
return template.replace(/\{\{\s*(.+?)\s*\}\}/gs, (_, rawExpr) => {
|
|
47
|
+
const expr = rawExpr.trim()
|
|
48
|
+
if (!expr) return ''
|
|
49
|
+
|
|
50
|
+
// 🧠 Detect all referenced variable names
|
|
51
|
+
const usedVars = extractIdentifiers(expr)
|
|
52
|
+
|
|
53
|
+
// 🛡 Build guaranteed-safe context
|
|
54
|
+
const fullContext: Record<string, any> = { ...context }
|
|
55
|
+
for (const key of usedVars) {
|
|
56
|
+
if (!(key in fullContext)) fullContext[key] = undefined
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
const keys = Object.keys(fullContext)
|
|
60
|
+
const values = Object.values(fullContext)
|
|
61
|
+
|
|
62
|
+
try {
|
|
63
|
+
const func = new Function(...keys, `'use strict'; return (${expr})`)
|
|
64
|
+
const result = func(...values)
|
|
65
|
+
return typeof result === 'string' ? result : JSON.stringify(result, null, 2)
|
|
66
|
+
} catch (err) {
|
|
67
|
+
console.warn(`Interpolation failed for expression: "${rawExpr}"`, err)
|
|
68
|
+
return ''
|
|
69
|
+
}
|
|
70
|
+
})
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
function extractIdentifiers(expr: string): string[] {
|
|
74
|
+
const matches = expr.match(/\b[a-zA-Z_][a-zA-Z0-9_]*\b/g) || []
|
|
75
|
+
const reserved = new Set(['true', 'false', 'null', 'undefined', 'return', 'if', 'else', 'try', 'catch', 'typeof'])
|
|
76
|
+
return [...new Set(matches.filter(word => !reserved.has(word)))]
|
|
77
|
+
}
|
package/lib/utils.ts
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { Updater } from '@tanstack/vue-table'
|
|
2
|
+
import type { Ref } from 'vue'
|
|
3
|
+
import { type ClassValue, clsx } from 'clsx'
|
|
4
|
+
import { twMerge } from 'tailwind-merge'
|
|
5
|
+
|
|
6
|
+
export function cn(...inputs: ClassValue[]) {
|
|
7
|
+
return twMerge(clsx(inputs))
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export function valueUpdater<T extends Updater<any>>(updaterOrValue: T, ref: Ref) {
|
|
11
|
+
ref.value = typeof updaterOrValue === 'function'
|
|
12
|
+
? updaterOrValue(ref.value)
|
|
13
|
+
: updaterOrValue
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export function formatFileSize(size: number) {
|
|
17
|
+
const units = ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB']
|
|
18
|
+
let i = 0
|
|
19
|
+
while (size >= 1024 && i < units.length - 1) {
|
|
20
|
+
size /= 1024
|
|
21
|
+
i++
|
|
22
|
+
}
|
|
23
|
+
return `${size.toFixed(2)} ${units[i]}`
|
|
24
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@oneclick.dev/cms-kit",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"peerDependencies": {
|
|
5
|
+
"vue": "^3.3.0"
|
|
6
|
+
},
|
|
7
|
+
"scripts": {
|
|
8
|
+
"build": "vite build",
|
|
9
|
+
"dev": "vite",
|
|
10
|
+
"build:watch": "vite build --watch"
|
|
11
|
+
},
|
|
12
|
+
"devDependencies": {
|
|
13
|
+
"@tailwindcss/cli": "^4.1.5",
|
|
14
|
+
"@vitejs/plugin-vue": "^5.2.3",
|
|
15
|
+
"vite": "^6.3.2",
|
|
16
|
+
"vite-plugin-dts": "^4.5.3"
|
|
17
|
+
},
|
|
18
|
+
"dependencies": {
|
|
19
|
+
"@codemirror/autocomplete": "^6.9.2",
|
|
20
|
+
"@codemirror/commands": "^6.8.1",
|
|
21
|
+
"@codemirror/lang-javascript": "^6.1.7",
|
|
22
|
+
"@codemirror/language": "^6.11.1",
|
|
23
|
+
"@codemirror/state": "^6.4.2",
|
|
24
|
+
"@codemirror/theme-one-dark": "^6.1.2",
|
|
25
|
+
"@codemirror/view": "^6.24.0",
|
|
26
|
+
"@dagrejs/dagre": "^1.1.5",
|
|
27
|
+
"@dicebear/collection": "^9.2.2",
|
|
28
|
+
"@dicebear/core": "^9.2.2",
|
|
29
|
+
"@tanstack/vue-table": "^8.21.3",
|
|
30
|
+
"@vue-flow/background": "^1.3.2",
|
|
31
|
+
"@vue-flow/controls": "^1.1.2",
|
|
32
|
+
"@vue-flow/core": "^1.45.0",
|
|
33
|
+
"@vue-flow/minimap": "^1.5.3",
|
|
34
|
+
"@vue-flow/node-toolbar": "^1.1.1",
|
|
35
|
+
"@vueuse/core": "^13.1.0",
|
|
36
|
+
"@zxing/browser": "^0.1.5",
|
|
37
|
+
"class-variance-authority": "^0.7.1",
|
|
38
|
+
"clsx": "^2.1.1",
|
|
39
|
+
"emoji-mart-vue-fast": "^15.0.4",
|
|
40
|
+
"graphlib": "^2.1.8",
|
|
41
|
+
"gsap": "^3.13.0",
|
|
42
|
+
"lucide-vue-next": "^0.509.0",
|
|
43
|
+
"motion-v": "^1.0.0",
|
|
44
|
+
"reka-ui": "^2.2.0",
|
|
45
|
+
"tailwind-merge": "^3.2.0",
|
|
46
|
+
"tailwindcss": "^4.1.5",
|
|
47
|
+
"vaul-vue": "^0.4.1",
|
|
48
|
+
"vee-validate": "^4.15.0",
|
|
49
|
+
"vue-grid-layout-v3": "^3.1.2",
|
|
50
|
+
"vue-sonner": "^1.3.2"
|
|
51
|
+
}
|
|
52
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
.cm-editor {
|
|
2
|
+
min-height: 100%;
|
|
3
|
+
max-height: 200px;
|
|
4
|
+
padding-block: calc(var(--spacing) * 1);
|
|
5
|
+
padding-inline: calc(var(--spacing) * 3);
|
|
6
|
+
border: 1px solid var(--input);
|
|
7
|
+
border-radius: calc(var(--radius) - 2px);
|
|
8
|
+
background-color: var(--background);
|
|
9
|
+
--tw-shadow: 0 1px 2px 0 var(--tw-shadow-color, rgb(0 0 0 / 0.05));
|
|
10
|
+
box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
|
|
11
|
+
color: inherit;
|
|
12
|
+
transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
|
|
13
|
+
|
|
14
|
+
&.cm-focused {
|
|
15
|
+
outline: 3px solid color-mix(in oklab, var(--ring) 50%, transparent);
|
|
16
|
+
border-style: var(--tw-border-style);
|
|
17
|
+
border-width: 1px;
|
|
18
|
+
--tw-shadow: 0 1px 2px 0 var(--tw-shadow-color, rgb(0 0 0 / 0.05));
|
|
19
|
+
border-color: var(--ring);
|
|
20
|
+
--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor);
|
|
21
|
+
box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
|
|
22
|
+
--tw-ring-color: color-mix(in oklab, var(--ring) 50%, transparent);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.cm-line {
|
|
27
|
+
padding: 0 !important;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.cm-scroller {
|
|
31
|
+
flex: 1;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.cm-interpolation {
|
|
35
|
+
color: #235dff;
|
|
36
|
+
background: #edf1ff;
|
|
37
|
+
padding: 4px 6px;
|
|
38
|
+
border-radius: 5px;
|
|
39
|
+
font-weight: 600;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
.dark {
|
|
44
|
+
.cm-editor {
|
|
45
|
+
background-color: color-mix(in oklab, var(--input) 30%, transparent);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.cm-interpolation {
|
|
49
|
+
color: #bfbfff;
|
|
50
|
+
background: #edf1ff26;
|
|
51
|
+
}
|
|
52
|
+
}
|