@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,111 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { inject, watch } from 'vue';
|
|
3
|
+
|
|
4
|
+
const state = inject('state') as { apiActions: any[] };
|
|
5
|
+
const allAvailableVariables = inject('allAvailableVariables')
|
|
6
|
+
|
|
7
|
+
const route = useRoute()
|
|
8
|
+
const { getProjectIntegrations } = useIntegrations()
|
|
9
|
+
|
|
10
|
+
const projectId = route.params.slug as string
|
|
11
|
+
const integrations = await getProjectIntegrations(projectId)
|
|
12
|
+
|
|
13
|
+
watch(state.apiActions, (val) => {
|
|
14
|
+
if (val) {
|
|
15
|
+
async function loadData(action: any) {
|
|
16
|
+
const { fireAction } = useIntegrationActions(action.integration)
|
|
17
|
+
let res = await fireAction(action, allAvailableVariables.value)
|
|
18
|
+
console.log("fireAction res", res); // TODO
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
val.forEach((action) => {
|
|
22
|
+
if (action.fireOnStart && action.hasFired) {
|
|
23
|
+
loadData(action);
|
|
24
|
+
}
|
|
25
|
+
})
|
|
26
|
+
}
|
|
27
|
+
}, { deep: true })
|
|
28
|
+
|
|
29
|
+
const { showBuilder } = useIntegrationActionBuilder()
|
|
30
|
+
const showIntegrationActionBuilder = async () => {
|
|
31
|
+
let newAction = await showBuilder(allAvailableVariables.value);
|
|
32
|
+
|
|
33
|
+
let placeholderName = newAction.serviceType + " - " + newAction.actionType;
|
|
34
|
+
let i = 2;
|
|
35
|
+
while (state.apiActions.find(action => action.label === placeholderName)) {
|
|
36
|
+
placeholderName = newAction.serviceType + " - " + newAction.actionType + " " + i;
|
|
37
|
+
i++;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
state.apiActions.push({
|
|
41
|
+
id: crypto.randomUUID(),
|
|
42
|
+
label: placeholderName,
|
|
43
|
+
action: newAction,
|
|
44
|
+
hasFired: false,
|
|
45
|
+
fireOnStart: false,
|
|
46
|
+
firedAt: null
|
|
47
|
+
})
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
const editIntegrationAction = async (action: any) => {
|
|
51
|
+
let updatedAction = await showBuilder(allAvailableVariables.value, action.action)
|
|
52
|
+
state.apiActions.find(a => a.id === action.id).action = updatedAction
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
const editIntegrationActionName = (action: any) => {
|
|
56
|
+
let newName = prompt("Enter new action name", action.label)
|
|
57
|
+
if (newName) {
|
|
58
|
+
state.apiActions.find(a => a.id === action.id).label = newName
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
const removeAction = (action: any) => {
|
|
63
|
+
state.apiActions = state.apiActions.filter(a => a.id !== action.id)
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
const executeAction = async (action: any) => {
|
|
67
|
+
const { fireAction } = useIntegrationActions(action.action.integration)
|
|
68
|
+
let res = await fireAction(action.action, allAvailableVariables.value)
|
|
69
|
+
state.apiActions.find(a => a.id === action.id).action.response = res
|
|
70
|
+
}
|
|
71
|
+
</script>
|
|
72
|
+
|
|
73
|
+
<template>
|
|
74
|
+
<div class="flex flex-col gap-2 p-2">
|
|
75
|
+
<p class="text-sm font-semibold mb-2">APIs & Actions</p>
|
|
76
|
+
</div>
|
|
77
|
+
|
|
78
|
+
<Button @click="showIntegrationActionBuilder">+ Integration action</Button>
|
|
79
|
+
|
|
80
|
+
<div>
|
|
81
|
+
<p>Actions</p>
|
|
82
|
+
<div class="flex flex-col gap-2">
|
|
83
|
+
<ContextMenu v-for="action in state.apiActions" :key="action.id">
|
|
84
|
+
<ContextMenuTrigger as-child>
|
|
85
|
+
<Button variant="ghost" size="sm" class="flex gap-1 items-center justify-start w-full" @click="editIntegrationAction(action)">
|
|
86
|
+
<IntegrationIcon :type="integrations.find((integration: any) => integration.id === action.action.integration)?.type" class="size-5" v-if="action.action?.integration" />
|
|
87
|
+
<p class="text-sm">{{ action.label }}</p>
|
|
88
|
+
</Button>
|
|
89
|
+
</ContextMenuTrigger>
|
|
90
|
+
<ContextMenuContent class="w-64">
|
|
91
|
+
<ContextMenuItem inset @click="editIntegrationActionName(action)">
|
|
92
|
+
Rename Action
|
|
93
|
+
</ContextMenuItem>
|
|
94
|
+
<ContextMenuItem inset>
|
|
95
|
+
View Data
|
|
96
|
+
</ContextMenuItem>
|
|
97
|
+
<ContextMenuItem inset @click="executeAction(action)">
|
|
98
|
+
Execute Action
|
|
99
|
+
</ContextMenuItem>
|
|
100
|
+
<ContextMenuItem inset variant="destructive" @click="removeAction(action)">
|
|
101
|
+
Remove Action
|
|
102
|
+
</ContextMenuItem>
|
|
103
|
+
<ContextMenuSeparator />
|
|
104
|
+
<ContextMenuCheckboxItem :model-value="action.fireOnStart" @update:model-value="action.fireOnStart = $event">
|
|
105
|
+
Fire on start
|
|
106
|
+
</ContextMenuCheckboxItem>
|
|
107
|
+
</ContextMenuContent>
|
|
108
|
+
</ContextMenu>
|
|
109
|
+
</div>
|
|
110
|
+
</div>
|
|
111
|
+
</template>
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import DraggableElement from './new-element-view/DraggableElement.vue';
|
|
3
|
+
import { Type, Text, SquareMousePointer, TextCursorInput, Bold, Check, ChevronDown, CircleDot, MapPinned, Grid2X2, File, Image, ScanBarcode } from 'lucide-vue-next';
|
|
4
|
+
|
|
5
|
+
const elements = [
|
|
6
|
+
{
|
|
7
|
+
text: "Label",
|
|
8
|
+
icon: Type,
|
|
9
|
+
elementData: {
|
|
10
|
+
component: "Label",
|
|
11
|
+
w: 2,
|
|
12
|
+
h: 8,
|
|
13
|
+
minW: 2,
|
|
14
|
+
minH: 8,
|
|
15
|
+
variableBaseName: "Label"
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
text: "Text",
|
|
20
|
+
icon: Text,
|
|
21
|
+
elementData: {
|
|
22
|
+
component: "Text",
|
|
23
|
+
w: 2,
|
|
24
|
+
h: 8,
|
|
25
|
+
minW: 2,
|
|
26
|
+
minH: 8,
|
|
27
|
+
variableBaseName: "Text"
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
text: "Button",
|
|
32
|
+
icon: SquareMousePointer,
|
|
33
|
+
elementData: {
|
|
34
|
+
component: "Button",
|
|
35
|
+
w: 2,
|
|
36
|
+
h: 6,
|
|
37
|
+
minW: 1,
|
|
38
|
+
minH: 6,
|
|
39
|
+
variableBaseName: "Button",
|
|
40
|
+
defaultValue: ""
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
text: "Textfield",
|
|
45
|
+
icon: TextCursorInput,
|
|
46
|
+
elementData: {
|
|
47
|
+
component: "Textfield",
|
|
48
|
+
w: 2,
|
|
49
|
+
h: 8,
|
|
50
|
+
minW: 2,
|
|
51
|
+
minH: 8,
|
|
52
|
+
variableBaseName: "Textfield",
|
|
53
|
+
defaultValue: ""
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
text: "Textarea",
|
|
58
|
+
icon: TextCursorInput,
|
|
59
|
+
elementData: {
|
|
60
|
+
component: "Textarea",
|
|
61
|
+
w: 3,
|
|
62
|
+
h: 12,
|
|
63
|
+
minW: 3,
|
|
64
|
+
minH: 12,
|
|
65
|
+
variableBaseName: "Textarea",
|
|
66
|
+
defaultValue: ""
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
text: "Richtext",
|
|
71
|
+
icon: Bold,
|
|
72
|
+
elementData: {
|
|
73
|
+
component: "Richtext",
|
|
74
|
+
w: 3,
|
|
75
|
+
h: 16,
|
|
76
|
+
minW: 3,
|
|
77
|
+
minH: 16,
|
|
78
|
+
variableBaseName: "Richtext",
|
|
79
|
+
defaultValue: ""
|
|
80
|
+
}
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
text: "Checkbox",
|
|
84
|
+
icon: Check,
|
|
85
|
+
elementData: {
|
|
86
|
+
component: "Checkbox",
|
|
87
|
+
w: 2,
|
|
88
|
+
h: 8,
|
|
89
|
+
minW: 2,
|
|
90
|
+
minH: 8,
|
|
91
|
+
variableBaseName: "Checkbox",
|
|
92
|
+
defaultValue: false
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
text: "Select",
|
|
97
|
+
icon: ChevronDown,
|
|
98
|
+
elementData: {
|
|
99
|
+
component: "Select",
|
|
100
|
+
w: 2,
|
|
101
|
+
h: 8,
|
|
102
|
+
minW: 2,
|
|
103
|
+
minH: 8,
|
|
104
|
+
variableBaseName: "Select",
|
|
105
|
+
defaultValue: ""
|
|
106
|
+
}
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
text: "Radios",
|
|
110
|
+
icon: CircleDot,
|
|
111
|
+
elementData: {
|
|
112
|
+
component: "Radios",
|
|
113
|
+
w: 2,
|
|
114
|
+
h: 8,
|
|
115
|
+
minW: 2,
|
|
116
|
+
minH: 8,
|
|
117
|
+
variableBaseName: "Radios",
|
|
118
|
+
defaultValue: ""
|
|
119
|
+
}
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
text: "Images",
|
|
123
|
+
icon: Image,
|
|
124
|
+
elementData: {
|
|
125
|
+
component: "Images",
|
|
126
|
+
w: 4,
|
|
127
|
+
h: 16,
|
|
128
|
+
minW: 4,
|
|
129
|
+
minH: 16,
|
|
130
|
+
variableBaseName: "Images",
|
|
131
|
+
defaultValue: []
|
|
132
|
+
}
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
text: "Location",
|
|
136
|
+
icon: MapPinned,
|
|
137
|
+
elementData: {
|
|
138
|
+
component: "Location",
|
|
139
|
+
w: 4,
|
|
140
|
+
h: 16,
|
|
141
|
+
minW: 4,
|
|
142
|
+
minH: 16,
|
|
143
|
+
variableBaseName: "Location",
|
|
144
|
+
defaultValue: { lat: 0, lng: 0 }
|
|
145
|
+
}
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
text: "Items",
|
|
149
|
+
icon: Grid2X2,
|
|
150
|
+
elementData: {
|
|
151
|
+
component: "Items",
|
|
152
|
+
w: 4,
|
|
153
|
+
h: 16,
|
|
154
|
+
minW: 4,
|
|
155
|
+
minH: 16,
|
|
156
|
+
variableBaseName: "Items",
|
|
157
|
+
defaultValue: []
|
|
158
|
+
}
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
text: "File",
|
|
162
|
+
icon: File,
|
|
163
|
+
elementData: {
|
|
164
|
+
component: "File",
|
|
165
|
+
w: 2,
|
|
166
|
+
h: 8,
|
|
167
|
+
minW: 2,
|
|
168
|
+
minH: 8,
|
|
169
|
+
variableBaseName: "File",
|
|
170
|
+
defaultValue: null
|
|
171
|
+
}
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
text: "Scanner",
|
|
175
|
+
icon: ScanBarcode,
|
|
176
|
+
elementData: {
|
|
177
|
+
component: "Scanner",
|
|
178
|
+
w: 2,
|
|
179
|
+
h: 8,
|
|
180
|
+
minW: 2,
|
|
181
|
+
minH: 8,
|
|
182
|
+
variableBaseName: "Scanner",
|
|
183
|
+
defaultValue: null
|
|
184
|
+
}
|
|
185
|
+
},
|
|
186
|
+
]
|
|
187
|
+
</script>
|
|
188
|
+
|
|
189
|
+
<template>
|
|
190
|
+
<div class="flex flex-col gap-2 p-2">
|
|
191
|
+
<p class="text-sm font-semibold mb-2">New Element</p>
|
|
192
|
+
</div>
|
|
193
|
+
|
|
194
|
+
<div class="grid grid-cols-3 gap-2">
|
|
195
|
+
<DraggableElement v-for="element in elements" :key="element.text" :elementData="element.elementData" class="group p-2 pt-4 border border-ring rounded-xl cursor-grab flex flex-col items-center gap-1">
|
|
196
|
+
<component :is="element.icon" class="size-6" />
|
|
197
|
+
<span class="text-xs text-muted-foreground group-hover:text-foreground">{{ element.text }}</span>
|
|
198
|
+
</DraggableElement>
|
|
199
|
+
</div>
|
|
200
|
+
</template>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import Variables from './variables-view/Variables.vue'
|
|
3
|
+
import Transformers from './variables-view/Transformers.vue'
|
|
4
|
+
import ApiActionVariables from './variables-view/ApiActionVariables.vue'
|
|
5
|
+
import RouteQueryParams from './variables-view/RouteQueryParams.vue'
|
|
6
|
+
</script>
|
|
7
|
+
|
|
8
|
+
<template>
|
|
9
|
+
<div class="flex flex-col gap-2 p-2">
|
|
10
|
+
<p class="text-sm font-semibold mb-2">Variables</p>
|
|
11
|
+
</div>
|
|
12
|
+
|
|
13
|
+
<div class="flex flex-col gap-2 p-2">
|
|
14
|
+
<Variables />
|
|
15
|
+
<Transformers />
|
|
16
|
+
<ApiActionVariables />
|
|
17
|
+
<RouteQueryParams />
|
|
18
|
+
</div>
|
|
19
|
+
</template>
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { inject, nextTick } from 'vue';
|
|
3
|
+
|
|
4
|
+
const props = defineProps({
|
|
5
|
+
elementData: {
|
|
6
|
+
type: Object,
|
|
7
|
+
default: () => ({})
|
|
8
|
+
}
|
|
9
|
+
})
|
|
10
|
+
|
|
11
|
+
const mouseXY = inject('mouseXY') as { x: number, y: number };
|
|
12
|
+
const DragPos = inject('DragPos') as { x: number, y: number, w: number, h: number, i: string };
|
|
13
|
+
const state = inject('state') as { layout: any[], layoutRef: any, colNum: number, itemRefs: any };
|
|
14
|
+
const isDragging = inject('isDragging');
|
|
15
|
+
|
|
16
|
+
async function drag() {
|
|
17
|
+
isDragging.value = true;
|
|
18
|
+
const parentRect = document.querySelector('#custom-form-builder .vue-grid-layout')!.getBoundingClientRect();
|
|
19
|
+
let mouseInGrid = false;
|
|
20
|
+
if (((mouseXY.x > parentRect.left) && (mouseXY.x < parentRect.right)) && ((mouseXY.y > parentRect.top) && (mouseXY.y < parentRect.bottom))) {
|
|
21
|
+
mouseInGrid = true;
|
|
22
|
+
}
|
|
23
|
+
if (mouseInGrid === true && (state.layout.findIndex(item => item.i === 'drop')) === -1) {
|
|
24
|
+
await addElement((state.layout.length * 2) % (state.colNum || 12), state.layout.length + (state.colNum || 12), true)
|
|
25
|
+
await nextTick();
|
|
26
|
+
}
|
|
27
|
+
if (!state.itemRefs?.drop) {
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
const index = state.layout.findIndex(item => item.i === 'drop');
|
|
31
|
+
if (index !== -1) {
|
|
32
|
+
if (state.itemRefs?.drop?.el?.style) {
|
|
33
|
+
state.itemRefs.drop.el.style.display = 'none';
|
|
34
|
+
}
|
|
35
|
+
const itemRef = state.itemRefs.drop;
|
|
36
|
+
const new_pos = itemRef.calcXY(mouseXY.y - parentRect.top, mouseXY.x - parentRect.left);
|
|
37
|
+
if (mouseInGrid === true) {
|
|
38
|
+
state.layoutRef.emitter.emit('dragEvent', ['dragstart', 'drop', new_pos.x, new_pos.y, props.elementData?.h || 1, props.elementData?.w || 1]);
|
|
39
|
+
DragPos.i = String(index);
|
|
40
|
+
DragPos.x = state.layout[index].x;
|
|
41
|
+
DragPos.y = state.layout[index].y;
|
|
42
|
+
}
|
|
43
|
+
if (mouseInGrid === false) {
|
|
44
|
+
state.layoutRef.emitter.emit('dragEvent', ['dragend', 'drop', new_pos.x, new_pos.y, props.elementData?.h || 1, props.elementData?.w || 1]);
|
|
45
|
+
state.layout = state.layout.filter(obj => obj.i !== 'drop');
|
|
46
|
+
await nextTick();
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
async function dragend() {
|
|
52
|
+
isDragging.value = false;
|
|
53
|
+
const parentRect = document.querySelector('#custom-form-builder .vue-grid-layout')!.getBoundingClientRect();
|
|
54
|
+
let mouseInGrid = false;
|
|
55
|
+
if (((mouseXY.x > parentRect.left) && (mouseXY.x < parentRect.right)) && ((mouseXY.y > parentRect.top) && (mouseXY.y < parentRect.bottom))) {
|
|
56
|
+
mouseInGrid = true;
|
|
57
|
+
}
|
|
58
|
+
if (mouseInGrid === true) {
|
|
59
|
+
state.layoutRef.emitter.emit('dragEvent', ['dragend', 'drop', DragPos.x, DragPos.y, props.elementData?.h || 1, props.elementData?.w || 1]);
|
|
60
|
+
state.layout = state.layout.filter(obj => obj.i !== 'drop');
|
|
61
|
+
|
|
62
|
+
await addElement(DragPos.x, DragPos.y)
|
|
63
|
+
await nextTick();
|
|
64
|
+
state.layoutRef.emitter.emit('dragEvent', ['dragend', DragPos.i, DragPos.x, DragPos.y, props.elementData?.h || 1, props.elementData?.w || 1]);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
async function addElement(x: number, y: number, ghost?: boolean) {
|
|
69
|
+
let newEl = {
|
|
70
|
+
x: x,
|
|
71
|
+
y: y,
|
|
72
|
+
w: props.elementData?.w || 1,
|
|
73
|
+
h: props.elementData?.h || 1,
|
|
74
|
+
minW: props.elementData?.minW || 1,
|
|
75
|
+
minH: props.elementData?.minH || 1,
|
|
76
|
+
i: ghost ? 'drop' : state.index,
|
|
77
|
+
component: props.elementData.component,
|
|
78
|
+
variableName: getNextVariableName(props.elementData.variableBaseName),
|
|
79
|
+
visibility: 'true'
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
if (Object.keys(props.elementData).includes('defaultValue')) {
|
|
83
|
+
newEl.defaultValue = props.elementData.defaultValue
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
state.layout.push(newEl);
|
|
87
|
+
state.index++;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
function getNextVariableName(baseName: string) {
|
|
91
|
+
const existingNames = state.layout.map((item: any) => item.variableName);
|
|
92
|
+
let index = 2;
|
|
93
|
+
let name = baseName;
|
|
94
|
+
while (existingNames.includes(name)) {
|
|
95
|
+
name = `${baseName}${index}`;
|
|
96
|
+
index++;
|
|
97
|
+
}
|
|
98
|
+
return name;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
</script>
|
|
102
|
+
|
|
103
|
+
<template>
|
|
104
|
+
<div @drag="drag" @dragend="dragend" class="droppable-element" draggable="true" unselectable="on">
|
|
105
|
+
<slot />
|
|
106
|
+
</div>
|
|
107
|
+
</template>
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { ChevronDown } from 'lucide-vue-next';
|
|
3
|
+
import { inject } from 'vue';
|
|
4
|
+
|
|
5
|
+
const state = inject('state') as { apiActions: any[] };
|
|
6
|
+
|
|
7
|
+
const route = useRoute()
|
|
8
|
+
const { getProjectIntegrations } = useIntegrations()
|
|
9
|
+
|
|
10
|
+
const projectId = route.params.slug as string
|
|
11
|
+
const integrations = await getProjectIntegrations(projectId)
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
<template>
|
|
15
|
+
<div>
|
|
16
|
+
<p class="text-sm font-semibold mb-2">Action variables</p>
|
|
17
|
+
<div class="flex flex-col gap-2">
|
|
18
|
+
<Button variant="ghost" size="sm" v-for="action in state.apiActions" :key="action.id" class="flex gap-2 items-center justify-between">
|
|
19
|
+
<div class="flex gap-2 items-center">
|
|
20
|
+
<IntegrationIcon :type="integrations.find((integration: any) => integration.id === action.action.integration)?.type" class="size-5" />
|
|
21
|
+
{{ action.label }}
|
|
22
|
+
</div>
|
|
23
|
+
<ChevronDown class="size-4" />
|
|
24
|
+
</Button>
|
|
25
|
+
</div>
|
|
26
|
+
</div>
|
|
27
|
+
</template>
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { CaseSensitive, Hash, ToggleLeft, Braces, Brackets, Calendar, Settings2 } from 'lucide-vue-next';
|
|
3
|
+
import { inject } from 'vue';
|
|
4
|
+
|
|
5
|
+
const state = inject('state') as { variables: any[] };
|
|
6
|
+
|
|
7
|
+
const route = useRoute()
|
|
8
|
+
|
|
9
|
+
const variableOptions = [
|
|
10
|
+
{ value: "string", label: "String", icon: CaseSensitive, tint: "#e83f3f", defaultValue: "" },
|
|
11
|
+
{ value: "number", label: "Number", icon: Hash, tint: "#2d9225", defaultValue: 0 },
|
|
12
|
+
{ value: "boolean", label: "Boolean", icon: ToggleLeft, tint: "#8e2592", defaultValue: false },
|
|
13
|
+
{ value: "object", label: "Object", icon: Braces, tint: "#926025", defaultValue: {} },
|
|
14
|
+
{ value: "array", label: "Array", icon: Brackets, tint: "#005799", defaultValue: [] },
|
|
15
|
+
{ value: "date", label: "Date", icon: Calendar, tint: "#5b7f91", defaultValue: "" }
|
|
16
|
+
]
|
|
17
|
+
|
|
18
|
+
function toCamelCase(str) {
|
|
19
|
+
return str.replace(/-([a-z])/g, (_, letter) => letter.toUpperCase());
|
|
20
|
+
}
|
|
21
|
+
</script>
|
|
22
|
+
|
|
23
|
+
<template>
|
|
24
|
+
<div class="flex flex-col gap-2 p-2">
|
|
25
|
+
<div>
|
|
26
|
+
<div class="mb-2">
|
|
27
|
+
<p class="text-sm font-semibold mb-2">
|
|
28
|
+
Route query params
|
|
29
|
+
</p>
|
|
30
|
+
</div>
|
|
31
|
+
|
|
32
|
+
<div class="flex flex-col gap-2">
|
|
33
|
+
<div v-for="([param, value]) in Object.entries(route.query)" :key="toCamelCase(param)" class="flex gap-2 items-center">
|
|
34
|
+
<div class="size-6 p-1 rounded flex items-center justify-center" :style="{ backgroundColor: variableOptions.find(option => option.value === 'string')?.tint }">
|
|
35
|
+
<component :is="variableOptions.find(option => option.value === 'string')?.icon" class="text-white" />
|
|
36
|
+
</div>
|
|
37
|
+
<div class="relative w-full group">
|
|
38
|
+
{{ toCamelCase(param) + " = " + value }}
|
|
39
|
+
<Button variant="ghost" size="icon" class="absolute right-0 top-0 rounded-xl shadow-none hidden group-hover:flex">
|
|
40
|
+
<Settings2 />
|
|
41
|
+
</Button>
|
|
42
|
+
</div>
|
|
43
|
+
</div>
|
|
44
|
+
</div>
|
|
45
|
+
</div>
|
|
46
|
+
</div>
|
|
47
|
+
</template>
|
package/components/ui/form-builder/components/admin/setting-views/variables-view/Transformers.vue
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { Calculator, Settings2 } from 'lucide-vue-next';
|
|
3
|
+
import { inject } from 'vue';
|
|
4
|
+
import Transformer from '../../Transformer.vue'
|
|
5
|
+
|
|
6
|
+
const state = inject('state') as { transformers: any[] };
|
|
7
|
+
|
|
8
|
+
async function addTransformer() {
|
|
9
|
+
let id = crypto.randomUUID()
|
|
10
|
+
let name = "New transformer"
|
|
11
|
+
|
|
12
|
+
let i = 2
|
|
13
|
+
while (state.transformers.find(variable => variable.name === name)) {
|
|
14
|
+
name = "New transformer " + i
|
|
15
|
+
i++
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
state.transformers.push({
|
|
19
|
+
id,
|
|
20
|
+
name,
|
|
21
|
+
expression: 'return ""'
|
|
22
|
+
})
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
</script>
|
|
26
|
+
|
|
27
|
+
<template>
|
|
28
|
+
<div class="flex flex-col gap-2 p-2">
|
|
29
|
+
<div>
|
|
30
|
+
<div class="mb-2">
|
|
31
|
+
<p class="text-sm font-semibold mb-2">
|
|
32
|
+
Transformers
|
|
33
|
+
</p>
|
|
34
|
+
<Button variant="outline" size="sm" @click="addTransformer">
|
|
35
|
+
Add new transformer
|
|
36
|
+
</Button>
|
|
37
|
+
</div>
|
|
38
|
+
|
|
39
|
+
<div class="flex flex-col gap-2">
|
|
40
|
+
<div v-for="transformer in state.transformers" :key="transformer.id" class="flex gap-2 items-center">
|
|
41
|
+
<div class="size-6 p-1 rounded flex items-center justify-center bg-[#646464]">
|
|
42
|
+
<Calculator class="text-white" />
|
|
43
|
+
</div>
|
|
44
|
+
<div class="relative w-full group">
|
|
45
|
+
<Input placeholder="Name" v-model="transformer.name" :id="`transformer_name_${transformer.id}`" class="bg-transparent dark:bg-transparent border-transparent hover:border-ring focus:border-ring dark:focus:border-ring shadow-none focus:shadow-xs rounded-xl pr-10" />
|
|
46
|
+
<Popover>
|
|
47
|
+
<PopoverTrigger as-child>
|
|
48
|
+
<Button variant="ghost" size="icon" class="absolute right-0 top-0 rounded-xl shadow-none opacity-0 group-hover:opacity-100">
|
|
49
|
+
<Settings2 />
|
|
50
|
+
</Button>
|
|
51
|
+
</PopoverTrigger>
|
|
52
|
+
<PopoverContent>
|
|
53
|
+
<Transformer v-model="transformer.expression" />
|
|
54
|
+
</PopoverContent>
|
|
55
|
+
</Popover>
|
|
56
|
+
</div>
|
|
57
|
+
</div>
|
|
58
|
+
</div>
|
|
59
|
+
</div>
|
|
60
|
+
</div>
|
|
61
|
+
</template>
|
package/components/ui/form-builder/components/admin/setting-views/variables-view/Variables.vue
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { CaseSensitive, Hash, ToggleLeft, Braces, Brackets, Calendar, Settings2 } from 'lucide-vue-next';
|
|
3
|
+
import { inject } from 'vue';
|
|
4
|
+
|
|
5
|
+
const state = inject('state') as { variables: any[] };
|
|
6
|
+
|
|
7
|
+
async function addVariable(type: string) {
|
|
8
|
+
let id = crypto.randomUUID()
|
|
9
|
+
let name = "New variable"
|
|
10
|
+
|
|
11
|
+
let i = 2
|
|
12
|
+
while (state.variables.find(variable => variable.name === name)) {
|
|
13
|
+
name = "New variable " + i
|
|
14
|
+
i++
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
state.variables.push({
|
|
18
|
+
id,
|
|
19
|
+
type,
|
|
20
|
+
name,
|
|
21
|
+
defaultValue: ''
|
|
22
|
+
})
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
const variableOptions = [
|
|
26
|
+
{ value: "string", label: "String", icon: CaseSensitive, tint: "#e83f3f", defaultValue: "" },
|
|
27
|
+
{ value: "number", label: "Number", icon: Hash, tint: "#2d9225", defaultValue: 0 },
|
|
28
|
+
{ value: "boolean", label: "Boolean", icon: ToggleLeft, tint: "#8e2592", defaultValue: false },
|
|
29
|
+
{ value: "object", label: "Object", icon: Braces, tint: "#926025", defaultValue: {} },
|
|
30
|
+
{ value: "array", label: "Array", icon: Brackets, tint: "#005799", defaultValue: [] },
|
|
31
|
+
{ value: "date", label: "Date", icon: Calendar, tint: "#5b7f91", defaultValue: "" }
|
|
32
|
+
]
|
|
33
|
+
</script>
|
|
34
|
+
|
|
35
|
+
<template>
|
|
36
|
+
<div class="flex flex-col gap-2 p-2">
|
|
37
|
+
<div>
|
|
38
|
+
<div class="mb-2">
|
|
39
|
+
<p class="text-sm font-semibold mb-2">
|
|
40
|
+
Variables
|
|
41
|
+
</p>
|
|
42
|
+
<DropdownMenu>
|
|
43
|
+
<DropdownMenuTrigger as-child>
|
|
44
|
+
<Button variant="outline" size="sm">
|
|
45
|
+
Add new variable
|
|
46
|
+
</Button>
|
|
47
|
+
</DropdownMenuTrigger>
|
|
48
|
+
<DropdownMenuContent>
|
|
49
|
+
<DropdownMenuItem v-for="option in variableOptions" :key="option.value" @click="addVariable(option.value)">
|
|
50
|
+
<div class="size-6 p-1 rounded flex items-center justify-center" :style="{ backgroundColor: option.tint }">
|
|
51
|
+
<component :is="option.icon" class="text-white" />
|
|
52
|
+
</div>
|
|
53
|
+
{{ option.label }}
|
|
54
|
+
</DropdownMenuItem>
|
|
55
|
+
</DropdownMenuContent>
|
|
56
|
+
</DropdownMenu>
|
|
57
|
+
</div>
|
|
58
|
+
|
|
59
|
+
<div class="flex flex-col gap-2">
|
|
60
|
+
<div v-for="variable in state.variables" :key="variable.id" class="flex gap-2 items-center">
|
|
61
|
+
<div class="size-6 p-1 rounded flex items-center justify-center" :style="{ backgroundColor: variableOptions.find(option => option.value === variable.type)?.tint }">
|
|
62
|
+
<component :is="variableOptions.find(option => option.value === variable.type)?.icon" class="text-white" />
|
|
63
|
+
</div>
|
|
64
|
+
<div class="relative w-full group">
|
|
65
|
+
<Input placeholder="Name" v-model="variable.name" :id="`variable_name_${variable.id}`" class="bg-transparent dark:bg-transparent border-transparent hover:border-ring focus:border-ring dark:focus:border-ring shadow-none focus:shadow-xs rounded-xl pr-10" />
|
|
66
|
+
<Button variant="ghost" size="icon" class="absolute right-0 top-0 rounded-xl shadow-none hidden group-hover:flex">
|
|
67
|
+
<Settings2 />
|
|
68
|
+
</Button>
|
|
69
|
+
</div>
|
|
70
|
+
</div>
|
|
71
|
+
</div>
|
|
72
|
+
</div>
|
|
73
|
+
</div>
|
|
74
|
+
</template>
|