@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,333 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { ref, onMounted, onUnmounted, reactive, computed, provide } from 'vue'
|
|
3
|
+
import AdminToolbar from './AdminToolbar.vue'
|
|
4
|
+
import AdminToolbarView from './AdminToolbarView.vue'
|
|
5
|
+
import AdminElementEditor from './AdminElementEditor.vue'
|
|
6
|
+
import CustomDashboard from './CustomDashboard.vue'
|
|
7
|
+
import { Maximize2 } from 'lucide-vue-next'
|
|
8
|
+
import { interpolateTemplateFromVariableContext } from '../../../../lib/interpolation'
|
|
9
|
+
|
|
10
|
+
const route = useRoute()
|
|
11
|
+
|
|
12
|
+
const props = defineProps({
|
|
13
|
+
isPresentationMode: {
|
|
14
|
+
type: Boolean,
|
|
15
|
+
default: false
|
|
16
|
+
},
|
|
17
|
+
onFinish: {
|
|
18
|
+
type: Function,
|
|
19
|
+
default: () => {}
|
|
20
|
+
},
|
|
21
|
+
providedVariables: {
|
|
22
|
+
type: Array,
|
|
23
|
+
default: () => []
|
|
24
|
+
}
|
|
25
|
+
})
|
|
26
|
+
|
|
27
|
+
const { setModuleBreadcrumbs } = useBreadcrumbs()
|
|
28
|
+
setModuleBreadcrumbs([])
|
|
29
|
+
|
|
30
|
+
const adminPanel = ref('new-element')
|
|
31
|
+
const activeElement = ref(null)
|
|
32
|
+
const selectedItems = ref<string[]>([])
|
|
33
|
+
const isDragging = ref(false)
|
|
34
|
+
|
|
35
|
+
const isEditMode = computed(() => !props.isPresentationMode)
|
|
36
|
+
|
|
37
|
+
const layout = [
|
|
38
|
+
{ x: 0, y: 0, w: 2, h: 2, i: '0', resizable: true, draggable: true, static: false, minY: 0, maxY: 2 },
|
|
39
|
+
];
|
|
40
|
+
|
|
41
|
+
const previewSize = ref({ width: 400, height: 400 }) // Default size
|
|
42
|
+
const builderContainer = ref<HTMLElement | null>(null)
|
|
43
|
+
|
|
44
|
+
// --- Resizing logic ---
|
|
45
|
+
const isResizing = ref(false)
|
|
46
|
+
const resizeStart = ref({ x: 0, y: 0, width: 0, height: 0 })
|
|
47
|
+
|
|
48
|
+
function startResizing(e: MouseEvent) {
|
|
49
|
+
isResizing.value = true;
|
|
50
|
+
resizeStart.value = {
|
|
51
|
+
x: e.clientX,
|
|
52
|
+
y: e.clientY,
|
|
53
|
+
width: previewSize.value.width,
|
|
54
|
+
height: previewSize.value.height
|
|
55
|
+
};
|
|
56
|
+
document.body.style.userSelect = 'none';
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
function handleMouseMove(e: MouseEvent) {
|
|
60
|
+
if (!isResizing.value) return;
|
|
61
|
+
const dx = e.clientX - resizeStart.value.x;
|
|
62
|
+
const dy = e.clientY - resizeStart.value.y;
|
|
63
|
+
const minWidth = 200, minHeight = 200;
|
|
64
|
+
const maxWidth = builderContainer.value?.offsetWidth || 800;
|
|
65
|
+
const maxHeight = builderContainer.value?.offsetHeight || 800;
|
|
66
|
+
previewSize.value.width = Math.max(minWidth, Math.min(resizeStart.value.width + dx, maxWidth));
|
|
67
|
+
previewSize.value.height = Math.max(minHeight, Math.min(resizeStart.value.height + dy, maxHeight));
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
function stopResizing() {
|
|
71
|
+
isResizing.value = false;
|
|
72
|
+
document.body.style.userSelect = '';
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
function clampPreviewToContainer() {
|
|
76
|
+
if (!builderContainer.value) return;
|
|
77
|
+
const maxWidth = builderContainer.value.offsetWidth;
|
|
78
|
+
const maxHeight = builderContainer.value.offsetHeight;
|
|
79
|
+
if (previewSize.value.width > maxWidth) previewSize.value.width = maxWidth;
|
|
80
|
+
if (previewSize.value.height > maxHeight) previewSize.value.height = maxHeight;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
function handleWindowResize() {
|
|
84
|
+
clampPreviewToContainer();
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
onMounted(() => {
|
|
88
|
+
window.addEventListener('mousemove', handleMouseMove);
|
|
89
|
+
window.addEventListener('mouseup', stopResizing);
|
|
90
|
+
window.addEventListener('resize', handleWindowResize);
|
|
91
|
+
// Initial clamp after mount (nextTick to ensure DOM is ready)
|
|
92
|
+
setTimeout(clampPreviewToContainer, 0);
|
|
93
|
+
});
|
|
94
|
+
onUnmounted(() => {
|
|
95
|
+
window.removeEventListener('mousemove', handleMouseMove);
|
|
96
|
+
window.removeEventListener('mouseup', stopResizing);
|
|
97
|
+
window.removeEventListener('resize', handleWindowResize);
|
|
98
|
+
});
|
|
99
|
+
|
|
100
|
+
const state = reactive({
|
|
101
|
+
mirrored: false,
|
|
102
|
+
responsive: true,
|
|
103
|
+
bounded: false,
|
|
104
|
+
transformScale: 1,
|
|
105
|
+
preventCollision: true,
|
|
106
|
+
compact: false,
|
|
107
|
+
restoreOnDrag: false,
|
|
108
|
+
rowHeight: 8,
|
|
109
|
+
index: 0,
|
|
110
|
+
marginX: 0,
|
|
111
|
+
marginY: 0,
|
|
112
|
+
layoutRef: {},
|
|
113
|
+
itemRefs: {},
|
|
114
|
+
|
|
115
|
+
layout: JSON.parse(JSON.stringify(layout)),
|
|
116
|
+
variables: [],
|
|
117
|
+
transformers: [],
|
|
118
|
+
apiActions: [],
|
|
119
|
+
elementValues: {}
|
|
120
|
+
});
|
|
121
|
+
|
|
122
|
+
const getState = () => {
|
|
123
|
+
let { layout, variables, transformers, apiActions } = JSON.parse(JSON.stringify(state))
|
|
124
|
+
|
|
125
|
+
apiActions?.forEach((action: any) => {
|
|
126
|
+
action.action.response = null;
|
|
127
|
+
action.firedAt = null;
|
|
128
|
+
action.hasFired = false;
|
|
129
|
+
})
|
|
130
|
+
|
|
131
|
+
return { layout, variables, transformers, apiActions }
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
const setState = (newState: any) => {
|
|
135
|
+
Object.assign(state, newState)
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
const baseVariables = computed(() => {
|
|
139
|
+
const normalVars = state.variables?.map((v: any) => ({
|
|
140
|
+
name: v.name,
|
|
141
|
+
type: v.type,
|
|
142
|
+
value: v.value ?? null,
|
|
143
|
+
})) || []
|
|
144
|
+
|
|
145
|
+
const apiActionVars = state.apiActions?.map((a: any) => ({
|
|
146
|
+
name: a.label,
|
|
147
|
+
type: 'apiActionResponse',
|
|
148
|
+
value: a.action ?? null,
|
|
149
|
+
})) || []
|
|
150
|
+
|
|
151
|
+
const elementVars = Object.entries(state.elementValues ?? {}).map(([key, val]: [string, any]) => ({
|
|
152
|
+
name: key,
|
|
153
|
+
type: 'element',
|
|
154
|
+
value: {
|
|
155
|
+
value: val ?? null
|
|
156
|
+
}
|
|
157
|
+
})) || []
|
|
158
|
+
|
|
159
|
+
const routeQueryVars = Object.entries(route.query).map(([key, val]: [string, any]) => ({
|
|
160
|
+
name: toCamelCase(key),
|
|
161
|
+
type: 'routeQueryParam',
|
|
162
|
+
value: val ?? null,
|
|
163
|
+
})) || []
|
|
164
|
+
|
|
165
|
+
return [...normalVars, ...apiActionVars, ...elementVars, ...routeQueryVars]?.filter((v: any) => v.name)
|
|
166
|
+
})
|
|
167
|
+
|
|
168
|
+
function toCamelCase(str) {
|
|
169
|
+
return str.replace(/-([a-z])/g, (_, letter) => letter.toUpperCase());
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
const transformerVars = computed(() => {
|
|
173
|
+
const context = Object.fromEntries(
|
|
174
|
+
baseVariables.value.map(v => [
|
|
175
|
+
v.name,
|
|
176
|
+
v.value
|
|
177
|
+
])
|
|
178
|
+
);
|
|
179
|
+
|
|
180
|
+
return (state.transformers ?? []).map((t: any) => ({
|
|
181
|
+
name: t.name,
|
|
182
|
+
type: 'transformer',
|
|
183
|
+
value: getTransformerValue(t.expression, context)
|
|
184
|
+
}));
|
|
185
|
+
});
|
|
186
|
+
|
|
187
|
+
const allAvailableVariables = computed(() => {
|
|
188
|
+
return [...props.providedVariables, ...baseVariables.value, ...transformerVars.value]
|
|
189
|
+
})
|
|
190
|
+
|
|
191
|
+
const getTransformerValue = (expression: string, context: Record<string, any>) => {
|
|
192
|
+
return sandbox(expression, context);
|
|
193
|
+
// return sandbox(`return ${expression}`, context); TODO use return if u support {{ }} in inputs later on
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
const sandbox = (code: string, args = {}) => {
|
|
197
|
+
try {
|
|
198
|
+
const frame = document.createElement('iframe');
|
|
199
|
+
frame.style.display = 'none';
|
|
200
|
+
document.body.appendChild(frame);
|
|
201
|
+
const F = frame.contentWindow?.Function
|
|
202
|
+
document.body.removeChild(frame);
|
|
203
|
+
return F?.(...Object.keys(args), "'use strict';" + code)(...Object.values(args));
|
|
204
|
+
} catch (error) {
|
|
205
|
+
console.error('Sandbox error:', error);
|
|
206
|
+
return ""
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
function removeItem(i: string) {
|
|
211
|
+
state.layout.splice(state.layout.findIndex(item => item.i === i), 1);
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
onMounted(() => {
|
|
215
|
+
document.addEventListener('mousedown', onMouseDown, true);
|
|
216
|
+
document.addEventListener('mouseup', onMouseUp, true);
|
|
217
|
+
});
|
|
218
|
+
|
|
219
|
+
onUnmounted(() => {
|
|
220
|
+
document.removeEventListener('mousedown', onMouseDown, true);
|
|
221
|
+
document.removeEventListener('mouseup', onMouseUp, true);
|
|
222
|
+
});
|
|
223
|
+
|
|
224
|
+
async function onMouseDown(e: MouseEvent) {
|
|
225
|
+
if ((e.target as HTMLElement)?.closest('.vue-grid-item')) {
|
|
226
|
+
isDragging.value = true;
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
function onMouseUp() {
|
|
231
|
+
isDragging.value = false;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
const mouseXY = { x: null, y: null };
|
|
235
|
+
const DragPos = { x: null, y: null, w: 1, h: 1, i: null };
|
|
236
|
+
|
|
237
|
+
document.addEventListener('dragover', (e) => {
|
|
238
|
+
mouseXY.x = e.clientX;
|
|
239
|
+
mouseXY.y = e.clientY;
|
|
240
|
+
}, false);
|
|
241
|
+
|
|
242
|
+
provide('mouseXY', mouseXY);
|
|
243
|
+
provide('DragPos', DragPos);
|
|
244
|
+
provide('state', state);
|
|
245
|
+
provide('isDragging', isDragging)
|
|
246
|
+
provide('activeElement', activeElement)
|
|
247
|
+
provide('selectedItems', selectedItems)
|
|
248
|
+
provide('allAvailableVariables', allAvailableVariables)
|
|
249
|
+
provide('isEditMode', isEditMode)
|
|
250
|
+
provide('onFinish', props.onFinish)
|
|
251
|
+
|
|
252
|
+
async function loadState() {
|
|
253
|
+
const fetchedState = {} // TODO load state
|
|
254
|
+
if (fetchedState) {
|
|
255
|
+
Object.keys(fetchedState)?.forEach((key: string) => {
|
|
256
|
+
state[key] = fetchedState[key]
|
|
257
|
+
})
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
function fillDefaultValues() {
|
|
262
|
+
state.layout?.forEach((item: any) => {
|
|
263
|
+
if (Object.keys(item).includes('defaultValue')) {
|
|
264
|
+
state.elementValues[item.variableName] = interpolateTemplateFromVariableContext(item.defaultValue, allAvailableVariables.value)
|
|
265
|
+
}
|
|
266
|
+
})
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
const setup = async () => {
|
|
270
|
+
await loadState()
|
|
271
|
+
fillDefaultValues()
|
|
272
|
+
loadStartupActions()
|
|
273
|
+
|
|
274
|
+
previewSize.value = {
|
|
275
|
+
width: Math.min(builderContainer.value?.offsetWidth - 40, 700),
|
|
276
|
+
height: Math.min(builderContainer.value?.offsetHeight - 40, 1000)
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
const loadStartupActions = () => {
|
|
281
|
+
async function loadAction(action: any) {
|
|
282
|
+
const { fireAction } = useIntegrationActions(action.action.integration)
|
|
283
|
+
let res = await fireAction(action.action, allAvailableVariables.value)
|
|
284
|
+
state.apiActions.find(a => a.id === action.id).action.response = res
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
state.apiActions.forEach((action: any) => {
|
|
288
|
+
if (action.fireOnStart) {
|
|
289
|
+
loadAction(action)
|
|
290
|
+
}
|
|
291
|
+
})
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
onMounted(() => {
|
|
295
|
+
setup()
|
|
296
|
+
})
|
|
297
|
+
|
|
298
|
+
defineExpose({
|
|
299
|
+
getState,
|
|
300
|
+
setState,
|
|
301
|
+
fillDefaultValues
|
|
302
|
+
})
|
|
303
|
+
</script>
|
|
304
|
+
|
|
305
|
+
<template>
|
|
306
|
+
<CustomDashboard v-if="isPresentationMode" />
|
|
307
|
+
<div class="flex-1 flex flex-col overflow-hidden pt-12 px-4" v-else>
|
|
308
|
+
<div class="@container/custom-dashboard flex-1 flex gap-2 w-full max-h-full overflow-hidden">
|
|
309
|
+
<AdminToolbar v-model="adminPanel" />
|
|
310
|
+
<AdminToolbarView :view="adminPanel" />
|
|
311
|
+
<div class="flex-1 bg-dots flex items-center justify-center text-gray-200 dark:text-muted" ref="builderContainer">
|
|
312
|
+
<div class="relative text-foreground" :style="{ width: previewSize.width + 'px', height: previewSize.height + 'px' }">
|
|
313
|
+
<CustomDashboard />
|
|
314
|
+
<button
|
|
315
|
+
class="absolute -bottom-4 -right-4 border border-transparent hover:border-ring bg-ring/20 dark:bg-ring/50 backdrop-blur-sm hover:scale-110 transition-all rounded-full p-2 cursor-hidden z-10"
|
|
316
|
+
@mousedown.prevent="startResizing"
|
|
317
|
+
>
|
|
318
|
+
<Maximize2 class="size-6 -scale-x-100" />
|
|
319
|
+
</button>
|
|
320
|
+
</div>
|
|
321
|
+
</div>
|
|
322
|
+
<AdminElementEditor v-if="activeElement" @removeItem="removeItem" />
|
|
323
|
+
</div>
|
|
324
|
+
</div>
|
|
325
|
+
</template>
|
|
326
|
+
|
|
327
|
+
<style scoped lang="scss">
|
|
328
|
+
.bg-dots {
|
|
329
|
+
background-color: transparent;
|
|
330
|
+
background-image: radial-gradient(currentColor 1px, transparent 1px);
|
|
331
|
+
background-size: 10px 10px;
|
|
332
|
+
}
|
|
333
|
+
</style>
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
const allAvailableVariables = inject('allAvailableVariables')
|
|
3
|
+
|
|
4
|
+
const props = defineProps({
|
|
5
|
+
modelValue: {
|
|
6
|
+
type: String,
|
|
7
|
+
required: true
|
|
8
|
+
}
|
|
9
|
+
})
|
|
10
|
+
|
|
11
|
+
const emit = defineEmits(['update:modelValue'])
|
|
12
|
+
|
|
13
|
+
const mutableValue = computed({
|
|
14
|
+
get() {
|
|
15
|
+
return props.modelValue
|
|
16
|
+
},
|
|
17
|
+
set(value) {
|
|
18
|
+
emit('update:modelValue', value)
|
|
19
|
+
}
|
|
20
|
+
})
|
|
21
|
+
</script>
|
|
22
|
+
|
|
23
|
+
<template>
|
|
24
|
+
<Sandbox v-model="mutableValue" :variables="allAvailableVariables" style="max-height: 200px" />
|
|
25
|
+
</template>
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { inject } from 'vue'
|
|
3
|
+
|
|
4
|
+
const activeElement = inject('activeElement');
|
|
5
|
+
const allAvailableVariables = inject('allAvailableVariables')
|
|
6
|
+
</script>
|
|
7
|
+
|
|
8
|
+
<template>
|
|
9
|
+
<div class="flex flex-col">
|
|
10
|
+
<Input type="text" placeholder="Text" v-model="activeElement.text" class="mb-4" />
|
|
11
|
+
|
|
12
|
+
<p class="text-sm font-semibold mb-2">Variant</p>
|
|
13
|
+
<Select v-model="activeElement.variant">
|
|
14
|
+
<SelectTrigger class="mb-4">
|
|
15
|
+
<SelectValue placeholder="Select variant" />
|
|
16
|
+
</SelectTrigger>
|
|
17
|
+
<SelectContent>
|
|
18
|
+
<SelectItem value="default">Primary</SelectItem>
|
|
19
|
+
<SelectItem value="secondary">Secondary</SelectItem>
|
|
20
|
+
<SelectItem value="destructive">Destructive</SelectItem>
|
|
21
|
+
<SelectItem value="outline">Outline</SelectItem>
|
|
22
|
+
<SelectItem value="ghost">Ghost</SelectItem>
|
|
23
|
+
<SelectItem value="link">Link</SelectItem>
|
|
24
|
+
</SelectContent>
|
|
25
|
+
</Select>
|
|
26
|
+
|
|
27
|
+
<p class="text-sm font-semibold mb-2">On Click</p>
|
|
28
|
+
<FlowBuilderSelect v-model="activeElement.onClickFlow" :variables="allAvailableVariables" />
|
|
29
|
+
</div>
|
|
30
|
+
</template>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
const activeElement = inject('activeElement');
|
|
3
|
+
const state = inject('state');
|
|
4
|
+
|
|
5
|
+
const defaultValue = computed(() => activeElement.value.defaultValue)
|
|
6
|
+
watch(defaultValue, () => {
|
|
7
|
+
state.elementValues[activeElement.value.variableName] = defaultValue.value
|
|
8
|
+
})
|
|
9
|
+
</script>
|
|
10
|
+
|
|
11
|
+
<template>
|
|
12
|
+
<div class="flex flex-col gap-2">
|
|
13
|
+
<Input type="text" placeholder="Label" v-model="activeElement.label" />
|
|
14
|
+
<Input type="text" placeholder="Text" v-model="activeElement.text" />
|
|
15
|
+
<div class="flex flex-col gap-1">
|
|
16
|
+
<p class="text-sm text-muted">Default value</p>
|
|
17
|
+
<div>
|
|
18
|
+
<Checkbox v-model="activeElement.defaultValue" />
|
|
19
|
+
{{ activeElement.defaultValue ? 'TRUE' : 'FALSE' }}
|
|
20
|
+
</div>
|
|
21
|
+
</div>
|
|
22
|
+
</div>
|
|
23
|
+
</template>
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { inject } from 'vue';
|
|
3
|
+
import Transformer from '../Transformer.vue'
|
|
4
|
+
|
|
5
|
+
const activeElement = inject('activeElement');
|
|
6
|
+
</script>
|
|
7
|
+
|
|
8
|
+
<template>
|
|
9
|
+
<div class="grid">
|
|
10
|
+
<p class="text-sm font-semibold mb-2">Text</p>
|
|
11
|
+
<Transformer v-model="activeElement.text" />
|
|
12
|
+
</div>
|
|
13
|
+
</template>
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { Plus, Ellipsis } from 'lucide-vue-next';
|
|
3
|
+
import { inject, watch, computed } from 'vue';
|
|
4
|
+
|
|
5
|
+
const activeElement = inject('activeElement');
|
|
6
|
+
const state = inject('state');
|
|
7
|
+
|
|
8
|
+
const defaultValue = computed(() => activeElement.value.defaultValue)
|
|
9
|
+
watch(defaultValue, () => {
|
|
10
|
+
state.elementValues[activeElement.value.variableName] = defaultValue.value
|
|
11
|
+
})
|
|
12
|
+
|
|
13
|
+
function addOption() {
|
|
14
|
+
if (!activeElement.value) return;
|
|
15
|
+
|
|
16
|
+
if (!activeElement.value.options) {
|
|
17
|
+
activeElement.value.options = [];
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
let nameBase = "Option", nameCounter = 1, name = nameBase;
|
|
21
|
+
let valueBase = "option", valueCounter = 1, value = valueBase;
|
|
22
|
+
|
|
23
|
+
while (activeElement.value.options.find(option => option.value === value)) {
|
|
24
|
+
valueCounter++;
|
|
25
|
+
value = valueBase + valueCounter;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
while (activeElement.value.options.find(option => option.label === name)) {
|
|
29
|
+
nameCounter++;
|
|
30
|
+
name = nameBase + nameCounter;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
let randomId = crypto.randomUUID()
|
|
34
|
+
activeElement.value.options.push({ value, label: name, id: randomId })
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
function removeOption(id: string) {
|
|
38
|
+
if (!activeElement.value) return;
|
|
39
|
+
|
|
40
|
+
activeElement.value.options = activeElement.value.options.filter(option => option.id !== id)
|
|
41
|
+
}
|
|
42
|
+
</script>
|
|
43
|
+
|
|
44
|
+
<template>
|
|
45
|
+
<div class="flex flex-col gap-2">
|
|
46
|
+
<Input type="text" placeholder="Label" v-model="activeElement.label" />
|
|
47
|
+
|
|
48
|
+
<p>Orientation</p>
|
|
49
|
+
<Select v-model="activeElement.orientation">
|
|
50
|
+
<SelectTrigger>
|
|
51
|
+
<SelectValue placeholder="Select orientation" />
|
|
52
|
+
</SelectTrigger>
|
|
53
|
+
<SelectContent>
|
|
54
|
+
<SelectItem value="vertical">Vertical</SelectItem>
|
|
55
|
+
<SelectItem value="horizontal">Horizontal</SelectItem>
|
|
56
|
+
</SelectContent>
|
|
57
|
+
</Select>
|
|
58
|
+
|
|
59
|
+
<div class="flex items-center justify-between gap-2">
|
|
60
|
+
<p>Options</p>
|
|
61
|
+
<Button variant="ghost" class="rounded-xl" @click="addOption">
|
|
62
|
+
<Plus />
|
|
63
|
+
</Button>
|
|
64
|
+
</div>
|
|
65
|
+
<div>
|
|
66
|
+
<Popover v-for="option in activeElement.options" :key="option.id">
|
|
67
|
+
<PopoverTrigger class="flex justify-between items-center gap-2 w-full">
|
|
68
|
+
{{ option.label }}
|
|
69
|
+
<Ellipsis class="size-4" />
|
|
70
|
+
</PopoverTrigger>
|
|
71
|
+
<PopoverContent>
|
|
72
|
+
<div class="flex flex-col gap-2">
|
|
73
|
+
<Label for="option.id + '_label'">Label</Label>
|
|
74
|
+
<Input type="text" placeholder="Label" :id="option.id + '_label'" v-model="option.label" />
|
|
75
|
+
<Label for="option.id + '_value'">Value</Label>
|
|
76
|
+
<Input type="text" placeholder="Value" :id="option.id + '_value'" v-model="option.value" />
|
|
77
|
+
</div>
|
|
78
|
+
<Button variant="destructive" @click="removeOption(option.id)">Remove</Button>
|
|
79
|
+
</PopoverContent>
|
|
80
|
+
</Popover>
|
|
81
|
+
</div>
|
|
82
|
+
|
|
83
|
+
<Input type="text" placeholder="Default value" v-model="activeElement.defaultValue" />
|
|
84
|
+
</div>
|
|
85
|
+
</template>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { inject } from 'vue'
|
|
3
|
+
|
|
4
|
+
const activeElement = inject('activeElement');
|
|
5
|
+
const allAvailableVariables = inject('allAvailableVariables')
|
|
6
|
+
</script>
|
|
7
|
+
|
|
8
|
+
<template>
|
|
9
|
+
<div class="flex flex-col">
|
|
10
|
+
<Input type="number" placeholder="Time between scans" v-model="activeElement.timeBetweenScans" class="mb-4" />
|
|
11
|
+
|
|
12
|
+
<p class="text-sm font-semibold mb-2">On Scan</p>
|
|
13
|
+
<FlowBuilderSelect v-model="activeElement.onScanFlow" :variables="allAvailableVariables" />
|
|
14
|
+
</div>
|
|
15
|
+
</template>
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { Plus, Ellipsis } from 'lucide-vue-next';
|
|
3
|
+
import { inject, watch, computed } from 'vue';
|
|
4
|
+
|
|
5
|
+
const activeElement = inject('activeElement');
|
|
6
|
+
const state = inject('state');
|
|
7
|
+
|
|
8
|
+
const defaultValue = computed(() => activeElement.value.defaultValue)
|
|
9
|
+
watch(defaultValue, () => {
|
|
10
|
+
state.elementValues[activeElement.value.variableName] = defaultValue.value
|
|
11
|
+
})
|
|
12
|
+
|
|
13
|
+
function addOption() {
|
|
14
|
+
if (!activeElement.value) return;
|
|
15
|
+
|
|
16
|
+
if (!activeElement.value.options) {
|
|
17
|
+
activeElement.value.options = [];
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
let nameBase = "Option", nameCounter = 1, name = nameBase;
|
|
21
|
+
let valueBase = "option", valueCounter = 1, value = valueBase;
|
|
22
|
+
|
|
23
|
+
while (activeElement.value.options.find(option => option.value === value)) {
|
|
24
|
+
valueCounter++;
|
|
25
|
+
value = valueBase + valueCounter;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
while (activeElement.value.options.find(option => option.label === name)) {
|
|
29
|
+
nameCounter++;
|
|
30
|
+
name = nameBase + nameCounter;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
let randomId = crypto.randomUUID()
|
|
34
|
+
activeElement.value.options.push({ value, label: name, id: randomId })
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
function removeOption(id: string) {
|
|
38
|
+
if (!activeElement.value) return;
|
|
39
|
+
|
|
40
|
+
activeElement.value.options = activeElement.value.options.filter(option => option.id !== id)
|
|
41
|
+
}
|
|
42
|
+
</script>
|
|
43
|
+
|
|
44
|
+
<template>
|
|
45
|
+
<div class="flex flex-col gap-2">
|
|
46
|
+
<Input type="text" placeholder="Label" v-model="activeElement.label" />
|
|
47
|
+
<Input type="text" placeholder="Placeholder" v-model="activeElement.placeholder" />
|
|
48
|
+
|
|
49
|
+
<div class="flex items-center justify-between gap-2">
|
|
50
|
+
<p>Options</p>
|
|
51
|
+
<Button variant="ghost" class="rounded-xl" @click="addOption">
|
|
52
|
+
<Plus />
|
|
53
|
+
</Button>
|
|
54
|
+
</div>
|
|
55
|
+
<div>
|
|
56
|
+
<Popover v-for="option in activeElement.options" :key="option.id">
|
|
57
|
+
<PopoverTrigger class="flex justify-between items-center gap-2 w-full">
|
|
58
|
+
{{ option.label }}
|
|
59
|
+
<Ellipsis class="size-4" />
|
|
60
|
+
</PopoverTrigger>
|
|
61
|
+
<PopoverContent>
|
|
62
|
+
<div class="flex flex-col gap-2">
|
|
63
|
+
<Label for="option.id + '_label'">Label</Label>
|
|
64
|
+
<Input type="text" placeholder="Label" :id="option.id + '_label'" v-model="option.label" />
|
|
65
|
+
<Label for="option.id + '_value'">Value</Label>
|
|
66
|
+
<Input type="text" placeholder="Value" :id="option.id + '_value'" v-model="option.value" />
|
|
67
|
+
</div>
|
|
68
|
+
<Button variant="destructive" @click="removeOption(option.id)">Remove</Button>
|
|
69
|
+
</PopoverContent>
|
|
70
|
+
</Popover>
|
|
71
|
+
</div>
|
|
72
|
+
|
|
73
|
+
<Input type="text" placeholder="Default value" v-model="activeElement.defaultValue" />
|
|
74
|
+
</div>
|
|
75
|
+
</template>
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { inject } from 'vue';
|
|
3
|
+
import Transformer from '../Transformer.vue'
|
|
4
|
+
|
|
5
|
+
const activeElement = inject('activeElement');
|
|
6
|
+
</script>
|
|
7
|
+
|
|
8
|
+
<template>
|
|
9
|
+
<div class="grid">
|
|
10
|
+
<p class="text-sm font-semibold mb-2">Text</p>
|
|
11
|
+
<Transformer v-model="activeElement.text" />
|
|
12
|
+
</div>
|
|
13
|
+
</template>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { inject, watch, computed } from 'vue';
|
|
3
|
+
import Transformer from '../Transformer.vue'
|
|
4
|
+
|
|
5
|
+
const activeElement = inject('activeElement');
|
|
6
|
+
const state = inject('state');
|
|
7
|
+
|
|
8
|
+
const defaultValue = computed(() => activeElement.value.defaultValue)
|
|
9
|
+
watch(defaultValue, () => {
|
|
10
|
+
state.elementValues[activeElement.value.variableName] = defaultValue.value
|
|
11
|
+
})
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
<template>
|
|
15
|
+
<div class="flex flex-col gap-2">
|
|
16
|
+
<Transformer v-model="activeElement.label" placeholder="Label" />
|
|
17
|
+
<Transformer v-model="activeElement.placeholder" placeholder="Placeholder" />
|
|
18
|
+
<Transformer v-model="activeElement.defaultValue" placeholder="Default value" />
|
|
19
|
+
</div>
|
|
20
|
+
</template>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { inject, watch, computed } from 'vue';
|
|
3
|
+
import Transformer from '../Transformer.vue'
|
|
4
|
+
|
|
5
|
+
const activeElement = inject('activeElement');
|
|
6
|
+
const state = inject('state');
|
|
7
|
+
|
|
8
|
+
const defaultValue = computed(() => activeElement.value.defaultValue)
|
|
9
|
+
watch(defaultValue, () => {
|
|
10
|
+
state.elementValues[activeElement.value.variableName] = defaultValue.value
|
|
11
|
+
})
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
<template>
|
|
15
|
+
<div class="flex flex-col gap-2">
|
|
16
|
+
<Transformer v-model="activeElement.label" placeholder="Label" />
|
|
17
|
+
<Transformer v-model="activeElement.placeholder" placeholder="Placeholder" />
|
|
18
|
+
<Transformer v-model="activeElement.defaultValue" placeholder="Default value" />
|
|
19
|
+
</div>
|
|
20
|
+
</template>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import CheckboxSettingsView from './Checkbox.vue'
|
|
2
|
+
import LabelSettingsView from './Label.vue'
|
|
3
|
+
import ButtonSettingsView from './Button.vue'
|
|
4
|
+
import TextSettingsView from './Text.vue'
|
|
5
|
+
import TextareaSettingsView from './Textarea.vue'
|
|
6
|
+
import TextfieldSettingsView from './Textfield.vue'
|
|
7
|
+
import SelectSettingsView from './Select.vue'
|
|
8
|
+
import RadiosSettingsView from './Radios.vue'
|
|
9
|
+
import ScannerSettingsView from './Scanner.vue'
|
|
10
|
+
|
|
11
|
+
export default {
|
|
12
|
+
Checkbox: CheckboxSettingsView,
|
|
13
|
+
Label: LabelSettingsView,
|
|
14
|
+
Button: ButtonSettingsView,
|
|
15
|
+
Text: TextSettingsView,
|
|
16
|
+
Textfield: TextfieldSettingsView,
|
|
17
|
+
Textarea: TextareaSettingsView,
|
|
18
|
+
Select: SelectSettingsView,
|
|
19
|
+
Radios: RadiosSettingsView,
|
|
20
|
+
Scanner: ScannerSettingsView
|
|
21
|
+
}
|