@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,60 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { inject, ref, computed } from 'vue'
|
|
3
|
+
import { useRunProcess } from '@oneclick.dev/cms-kit/components/ui/flow-builder/composables/useRunProcess'
|
|
4
|
+
import { useLayout } from '@oneclick.dev/cms-kit/components/ui/flow-builder/composables/useLayout'
|
|
5
|
+
|
|
6
|
+
const props = defineProps({
|
|
7
|
+
variableName: {
|
|
8
|
+
type: String,
|
|
9
|
+
required: true
|
|
10
|
+
},
|
|
11
|
+
text: {
|
|
12
|
+
type: String,
|
|
13
|
+
default: ""
|
|
14
|
+
},
|
|
15
|
+
variant: {
|
|
16
|
+
type: String,
|
|
17
|
+
default: ""
|
|
18
|
+
},
|
|
19
|
+
onClickFlow: {
|
|
20
|
+
type: Object,
|
|
21
|
+
default: () => ({
|
|
22
|
+
nodes: [],
|
|
23
|
+
edges: [],
|
|
24
|
+
variables: [],
|
|
25
|
+
computedVariables: []
|
|
26
|
+
})
|
|
27
|
+
}
|
|
28
|
+
})
|
|
29
|
+
|
|
30
|
+
const isEditMode = inject('isEditMode', ref(false))
|
|
31
|
+
const allAvailableVariables = inject('allAvailableVariables', ref([]))
|
|
32
|
+
const onFinish = inject('onFinish', () => {})
|
|
33
|
+
|
|
34
|
+
const handleClick = () => {
|
|
35
|
+
const { graph, layout } = useLayout()
|
|
36
|
+
const { run } = useRunProcess({
|
|
37
|
+
graph,
|
|
38
|
+
cancelOnError: true,
|
|
39
|
+
nodes: props.onClickFlow.nodes,
|
|
40
|
+
edges: props.onClickFlow.edges,
|
|
41
|
+
variables: [...allAvailableVariables.value, ...props.onClickFlow.variables],
|
|
42
|
+
computedVariables: props.onClickFlow.computedVariables,
|
|
43
|
+
onFinish
|
|
44
|
+
})
|
|
45
|
+
const laidOutNodes = layout(props.onClickFlow.nodes, props.onClickFlow.edges, 'LR')
|
|
46
|
+
run(laidOutNodes)
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
const isDisabled = computed(() => {
|
|
50
|
+
return false;
|
|
51
|
+
})
|
|
52
|
+
</script>
|
|
53
|
+
|
|
54
|
+
<template>
|
|
55
|
+
<Button :variant="variant" @click="handleClick" :disabled="isDisabled" class="w-full" :class="{ 'pointer-events-none': isEditMode }" :tabindex="isEditMode ? -1 : 0">
|
|
56
|
+
<span class="truncate w-full">
|
|
57
|
+
{{ text }}
|
|
58
|
+
</span>
|
|
59
|
+
</Button>
|
|
60
|
+
</template>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as CustomFormButton } from './Button.vue'
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { inject } from 'vue'
|
|
3
|
+
|
|
4
|
+
const randomId = crypto.randomUUID()
|
|
5
|
+
|
|
6
|
+
const props = defineProps({
|
|
7
|
+
variableName: {
|
|
8
|
+
type: String,
|
|
9
|
+
required: true
|
|
10
|
+
},
|
|
11
|
+
label: {
|
|
12
|
+
type: String,
|
|
13
|
+
required: true
|
|
14
|
+
},
|
|
15
|
+
text: {
|
|
16
|
+
type: String,
|
|
17
|
+
required: true
|
|
18
|
+
}
|
|
19
|
+
})
|
|
20
|
+
|
|
21
|
+
const state = inject('state');
|
|
22
|
+
|
|
23
|
+
</script>
|
|
24
|
+
|
|
25
|
+
<template>
|
|
26
|
+
<div class="items-top flex gap-x-2">
|
|
27
|
+
<Checkbox :id="randomId" v-model="state.elementValues[variableName]" class="border-ring" />
|
|
28
|
+
<div class="grid gap-1.5 leading-none">
|
|
29
|
+
<label
|
|
30
|
+
:for="randomId"
|
|
31
|
+
class="text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"
|
|
32
|
+
>
|
|
33
|
+
{{ label }}
|
|
34
|
+
</label>
|
|
35
|
+
<p class="text-sm text-muted-foreground">
|
|
36
|
+
{{ text }}
|
|
37
|
+
</p>
|
|
38
|
+
</div>
|
|
39
|
+
</div>
|
|
40
|
+
</template>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as CustomFormCheckbox } from './Checkbox.vue'
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as CustomFormFile } from './File.vue'
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { inject } from 'vue'
|
|
3
|
+
|
|
4
|
+
const props = defineProps({
|
|
5
|
+
variableName: {
|
|
6
|
+
type: String,
|
|
7
|
+
required: true
|
|
8
|
+
},
|
|
9
|
+
label: {
|
|
10
|
+
type: String,
|
|
11
|
+
default: ""
|
|
12
|
+
},
|
|
13
|
+
placeholder: {
|
|
14
|
+
type: String,
|
|
15
|
+
default: ""
|
|
16
|
+
}
|
|
17
|
+
})
|
|
18
|
+
|
|
19
|
+
const state = inject('state');
|
|
20
|
+
|
|
21
|
+
</script>
|
|
22
|
+
|
|
23
|
+
<template>
|
|
24
|
+
<div class="flex flex-col w-full h-full items-start gap-1.5">
|
|
25
|
+
<Label v-if="label">{{ label }}</Label>
|
|
26
|
+
<MediaPicker v-model="state.elementValues[variableName]"></MediaPicker>
|
|
27
|
+
</div>
|
|
28
|
+
</template>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as CustomFormImages } from './Images.vue'
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { CustomFormCheckbox } from './checkbox';
|
|
2
|
+
import { CustomFormFile } from './file';
|
|
3
|
+
import { CustomFormImages } from './images';
|
|
4
|
+
import { CustomFormItems } from './items';
|
|
5
|
+
import { CustomFormLabel } from './label';
|
|
6
|
+
import { CustomFormLocation } from './location';
|
|
7
|
+
import { CustomFormRadios } from './radios';
|
|
8
|
+
import { CustomFormRichText } from './richtext';
|
|
9
|
+
import { CustomFormSelect } from './select';
|
|
10
|
+
import { CustomFormText } from './text';
|
|
11
|
+
import { CustomFormTextarea } from './textarea';
|
|
12
|
+
import { CustomFormTextfield } from './textfield';
|
|
13
|
+
import { CustomFormButton } from './button';
|
|
14
|
+
import { CustomFormScanner } from './scanner';
|
|
15
|
+
|
|
16
|
+
export const elementComponents = {
|
|
17
|
+
CustomFormCheckbox,
|
|
18
|
+
CustomFormFile,
|
|
19
|
+
CustomFormImages,
|
|
20
|
+
CustomFormItems,
|
|
21
|
+
CustomFormLabel,
|
|
22
|
+
CustomFormLocation,
|
|
23
|
+
CustomFormRadios,
|
|
24
|
+
CustomFormRichText,
|
|
25
|
+
CustomFormSelect,
|
|
26
|
+
CustomFormText,
|
|
27
|
+
CustomFormTextarea,
|
|
28
|
+
CustomFormTextfield,
|
|
29
|
+
CustomFormButton,
|
|
30
|
+
CustomFormScanner
|
|
31
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as CustomFormItems } from './Items.vue'
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { interpolateTemplateFromVariableContext } from '@/lib/interpolation'
|
|
3
|
+
|
|
4
|
+
const props = defineProps({
|
|
5
|
+
text: {
|
|
6
|
+
type: String,
|
|
7
|
+
default: ''
|
|
8
|
+
}
|
|
9
|
+
})
|
|
10
|
+
|
|
11
|
+
const allAvailableVariables = inject('allAvailableVariables')
|
|
12
|
+
|
|
13
|
+
const output = computed(() => {
|
|
14
|
+
return interpolateTemplateFromVariableContext(props.text, allAvailableVariables?.value)
|
|
15
|
+
})
|
|
16
|
+
</script>
|
|
17
|
+
|
|
18
|
+
<template>
|
|
19
|
+
<p class="whitespace-pre-wrap">{{ output }}</p>
|
|
20
|
+
</template>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as CustomFormLabel } from './Label.vue'
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as CustomFormLocation } from './Location.vue'
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
const randomId = crypto.randomUUID()
|
|
3
|
+
|
|
4
|
+
interface Option {
|
|
5
|
+
value: string;
|
|
6
|
+
label: string;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
const props = defineProps({
|
|
10
|
+
variableName: {
|
|
11
|
+
type: String,
|
|
12
|
+
required: true
|
|
13
|
+
},
|
|
14
|
+
label: {
|
|
15
|
+
type: String,
|
|
16
|
+
default: ""
|
|
17
|
+
},
|
|
18
|
+
orientation: {
|
|
19
|
+
type: String,
|
|
20
|
+
default: "vertical"
|
|
21
|
+
},
|
|
22
|
+
options: {
|
|
23
|
+
type: Array as PropType<Option[]>,
|
|
24
|
+
required: true
|
|
25
|
+
}
|
|
26
|
+
})
|
|
27
|
+
|
|
28
|
+
const state = inject('state');
|
|
29
|
+
|
|
30
|
+
</script>
|
|
31
|
+
|
|
32
|
+
<template>
|
|
33
|
+
<div class="grid w-full items-center gap-1.5">
|
|
34
|
+
<Label v-if="label">{{ label }}</Label>
|
|
35
|
+
<RadioGroup v-model="state.elementValues[variableName]" :orientation="orientation" class="flex-wrap">
|
|
36
|
+
<div class="flex items-center space-x-2" v-for="option in options" :key="option.value">
|
|
37
|
+
<RadioGroupItem :id="randomId + '_' + option.value" :value="option.value" class="border-ring" />
|
|
38
|
+
<Label :for="randomId + '_' + option.value">{{ option.label }}</Label>
|
|
39
|
+
</div>
|
|
40
|
+
</RadioGroup>
|
|
41
|
+
</div>
|
|
42
|
+
</template>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as CustomFormRadios } from './Radios.vue'
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as CustomFormRichText } from './RichText.vue'
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { inject, ref, onMounted, onUnmounted } from 'vue'
|
|
3
|
+
import { BrowserMultiFormatReader } from '@zxing/browser'
|
|
4
|
+
import { useRunProcess } from '@oneclick.dev/cms-kit/components/ui/flow-builder/composables/useRunProcess'
|
|
5
|
+
import { useLayout } from '@oneclick.dev/cms-kit/components/ui/flow-builder/composables/useLayout'
|
|
6
|
+
|
|
7
|
+
const props = defineProps({
|
|
8
|
+
variableName: {
|
|
9
|
+
type: String,
|
|
10
|
+
required: true
|
|
11
|
+
},
|
|
12
|
+
timeBetweenScans: {
|
|
13
|
+
type: Number,
|
|
14
|
+
default: 800
|
|
15
|
+
},
|
|
16
|
+
onScanFlow: {
|
|
17
|
+
type: Object,
|
|
18
|
+
default: () => ({
|
|
19
|
+
nodes: [],
|
|
20
|
+
edges: [],
|
|
21
|
+
variables: [],
|
|
22
|
+
computedVariables: []
|
|
23
|
+
})
|
|
24
|
+
}
|
|
25
|
+
})
|
|
26
|
+
|
|
27
|
+
const emit = defineEmits(['scanned'])
|
|
28
|
+
const allAvailableVariables = inject('allAvailableVariables', ref([]))
|
|
29
|
+
const state = inject('state');
|
|
30
|
+
|
|
31
|
+
const scanning = ref(false)
|
|
32
|
+
const error = ref<string | null>(null)
|
|
33
|
+
const videoRef = ref<HTMLVideoElement | null>(null)
|
|
34
|
+
let codeReader: BrowserMultiFormatReader | null = null
|
|
35
|
+
let lastScanTime = 0
|
|
36
|
+
|
|
37
|
+
const devices = ref<MediaDeviceInfo[]>([])
|
|
38
|
+
const uniqueDevices = ref<{ deviceId: string, label: string }[]>([])
|
|
39
|
+
const selectedDeviceId = ref<string | undefined>(undefined)
|
|
40
|
+
|
|
41
|
+
const getCameras = async () => {
|
|
42
|
+
try {
|
|
43
|
+
const mediaDevices = await navigator.mediaDevices.enumerateDevices()
|
|
44
|
+
const videoInputs = mediaDevices.filter(device => device.kind === 'videoinput')
|
|
45
|
+
// Deduplicate by label or deviceId
|
|
46
|
+
const seen = new Set<string>()
|
|
47
|
+
let camCount = 1
|
|
48
|
+
uniqueDevices.value = videoInputs.reduce((arr, device) => {
|
|
49
|
+
const key = device.label || device.deviceId
|
|
50
|
+
if (!seen.has(key)) {
|
|
51
|
+
seen.add(key)
|
|
52
|
+
arr.push({
|
|
53
|
+
deviceId: device.deviceId,
|
|
54
|
+
label: device.label || `Camera ${camCount++}`
|
|
55
|
+
})
|
|
56
|
+
}
|
|
57
|
+
return arr
|
|
58
|
+
}, [] as { deviceId: string, label: string }[])
|
|
59
|
+
devices.value = videoInputs
|
|
60
|
+
if (!selectedDeviceId.value && uniqueDevices.value.length > 0) {
|
|
61
|
+
selectedDeviceId.value = uniqueDevices.value[0].deviceId
|
|
62
|
+
}
|
|
63
|
+
} catch (e) {
|
|
64
|
+
error.value = 'Could not list cameras'
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
import { nextTick } from 'vue';
|
|
69
|
+
|
|
70
|
+
let lastScannedCode: string | null = null;
|
|
71
|
+
let lastScannedTime: number = 0;
|
|
72
|
+
|
|
73
|
+
const startScanner = async () => {
|
|
74
|
+
error.value = null;
|
|
75
|
+
console.log(state)
|
|
76
|
+
state.elementValues[props.variableName] = null;
|
|
77
|
+
scanning.value = true;
|
|
78
|
+
await nextTick(); // Ensure videoRef is set
|
|
79
|
+
|
|
80
|
+
if (!codeReader) {
|
|
81
|
+
codeReader = new BrowserMultiFormatReader();
|
|
82
|
+
}
|
|
83
|
+
try {
|
|
84
|
+
await codeReader.decodeFromVideoDevice(
|
|
85
|
+
selectedDeviceId.value,
|
|
86
|
+
videoRef.value!,
|
|
87
|
+
(result: any, err) => {
|
|
88
|
+
if (result) {
|
|
89
|
+
const code = result.getText();
|
|
90
|
+
const now = Date.now();
|
|
91
|
+
if (code === lastScannedCode) {
|
|
92
|
+
if (now - lastScannedTime >= 5000) {
|
|
93
|
+
lastScannedTime = now;
|
|
94
|
+
state.elementValues[props.variableName] = code;
|
|
95
|
+
emit('scanned', code);
|
|
96
|
+
handleScan();
|
|
97
|
+
}
|
|
98
|
+
// else: ignore scan, still in cooldown
|
|
99
|
+
} else {
|
|
100
|
+
lastScannedCode = code;
|
|
101
|
+
lastScannedTime = now;
|
|
102
|
+
state.elementValues[props.variableName] = code;
|
|
103
|
+
emit('scanned', code);
|
|
104
|
+
handleScan();
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
// Ignore 'No MultiFormat Readers...' error
|
|
108
|
+
if (err && err.message !== 'No MultiFormat Readers were able to detect the code.') {
|
|
109
|
+
error.value = err.message || 'Scan error';
|
|
110
|
+
} else {
|
|
111
|
+
error.value = null;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
);
|
|
115
|
+
} catch (e: any) {
|
|
116
|
+
error.value = e.message || 'Could not access camera';
|
|
117
|
+
scanning.value = false;
|
|
118
|
+
}
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
const stopScanner = () => {
|
|
122
|
+
scanning.value = false;
|
|
123
|
+
if (codeReader) {
|
|
124
|
+
if (typeof codeReader.stopContinuousDecode === 'function') {
|
|
125
|
+
codeReader.stopContinuousDecode();
|
|
126
|
+
} else if (typeof codeReader.reset === 'function') {
|
|
127
|
+
codeReader.reset();
|
|
128
|
+
}
|
|
129
|
+
codeReader = null;
|
|
130
|
+
}
|
|
131
|
+
};
|
|
132
|
+
|
|
133
|
+
onUnmounted(() => {
|
|
134
|
+
stopScanner()
|
|
135
|
+
})
|
|
136
|
+
|
|
137
|
+
onMounted(() => {
|
|
138
|
+
getCameras()
|
|
139
|
+
startScanner()
|
|
140
|
+
})
|
|
141
|
+
|
|
142
|
+
const handleScan = () => {
|
|
143
|
+
const { graph, layout } = useLayout()
|
|
144
|
+
const { run } = useRunProcess({
|
|
145
|
+
graph,
|
|
146
|
+
cancelOnError: true,
|
|
147
|
+
nodes: props.onScanFlow.nodes,
|
|
148
|
+
edges: props.onScanFlow.edges,
|
|
149
|
+
variables: [...allAvailableVariables.value, ...props.onScanFlow.variables],
|
|
150
|
+
computedVariables: props.onScanFlow.computedVariables
|
|
151
|
+
})
|
|
152
|
+
const laidOutNodes = layout(props.onScanFlow.nodes, props.onScanFlow.edges, 'LR')
|
|
153
|
+
run(laidOutNodes)
|
|
154
|
+
}
|
|
155
|
+
</script>
|
|
156
|
+
|
|
157
|
+
<template>
|
|
158
|
+
<div class="flex flex-col items-center gap-4">
|
|
159
|
+
<div class="w-full flex flex-col items-center">
|
|
160
|
+
<label v-if="uniqueDevices.length > 1" class="mb-2 text-sm">
|
|
161
|
+
Camera:
|
|
162
|
+
<select v-model="selectedDeviceId" class="border rounded px-2 py-1 ml-2">
|
|
163
|
+
<option v-for="(device, idx) in uniqueDevices" :key="device.deviceId" :value="device.deviceId">
|
|
164
|
+
{{ device.label }}
|
|
165
|
+
</option>
|
|
166
|
+
</select>
|
|
167
|
+
</label>
|
|
168
|
+
</div>
|
|
169
|
+
<div>
|
|
170
|
+
<video ref="videoRef" autoplay playsinline class="rounded border w-72 h-72 bg-black"></video>
|
|
171
|
+
</div>
|
|
172
|
+
</div>
|
|
173
|
+
</template>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as CustomFormScanner } from './Scanner.vue'
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
const randomId = crypto.randomUUID()
|
|
3
|
+
|
|
4
|
+
interface Option {
|
|
5
|
+
value: string;
|
|
6
|
+
label: string;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
const props = defineProps({
|
|
10
|
+
variableName: {
|
|
11
|
+
type: String,
|
|
12
|
+
required: true
|
|
13
|
+
},
|
|
14
|
+
label: {
|
|
15
|
+
type: String,
|
|
16
|
+
default: ""
|
|
17
|
+
},
|
|
18
|
+
placeholder: {
|
|
19
|
+
type: String,
|
|
20
|
+
default: ""
|
|
21
|
+
},
|
|
22
|
+
options: {
|
|
23
|
+
type: Array as PropType<Option[]>,
|
|
24
|
+
required: true
|
|
25
|
+
}
|
|
26
|
+
})
|
|
27
|
+
|
|
28
|
+
const state = inject('state');
|
|
29
|
+
|
|
30
|
+
</script>
|
|
31
|
+
|
|
32
|
+
<template>
|
|
33
|
+
<div class="grid w-full items-center gap-1.5">
|
|
34
|
+
<Label :for="randomId" v-if="label">{{ label }}</Label>
|
|
35
|
+
|
|
36
|
+
<Select v-model="state.elementValues[variableName]">
|
|
37
|
+
<SelectTrigger class="w-[180px] border-ring">
|
|
38
|
+
<SelectValue :placeholder="placeholder" />
|
|
39
|
+
</SelectTrigger>
|
|
40
|
+
<SelectContent>
|
|
41
|
+
<SelectGroup>
|
|
42
|
+
<SelectItem v-for="option in options" :key="option.value" :value="option.value">
|
|
43
|
+
{{ option.label }}
|
|
44
|
+
</SelectItem>
|
|
45
|
+
</SelectGroup>
|
|
46
|
+
</SelectContent>
|
|
47
|
+
</Select>
|
|
48
|
+
</div>
|
|
49
|
+
</template>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as CustomFormSelect } from './Select.vue'
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { interpolateTemplateFromVariableContext } from '@/lib/interpolation'
|
|
3
|
+
|
|
4
|
+
const props = defineProps({
|
|
5
|
+
text: {
|
|
6
|
+
type: String,
|
|
7
|
+
default: ''
|
|
8
|
+
}
|
|
9
|
+
})
|
|
10
|
+
|
|
11
|
+
const allAvailableVariables = inject('allAvailableVariables')
|
|
12
|
+
|
|
13
|
+
const output = computed(() => {
|
|
14
|
+
return interpolateTemplateFromVariableContext(props.text, allAvailableVariables?.value)
|
|
15
|
+
})
|
|
16
|
+
</script>
|
|
17
|
+
|
|
18
|
+
<template>
|
|
19
|
+
<p class="whitespace-pre-wrap">{{ output }}</p>
|
|
20
|
+
</template>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as CustomFormText } from './Text.vue'
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { inject } from 'vue'
|
|
3
|
+
|
|
4
|
+
const randomId = crypto.randomUUID()
|
|
5
|
+
|
|
6
|
+
const props = defineProps({
|
|
7
|
+
variableName: {
|
|
8
|
+
type: String,
|
|
9
|
+
required: true
|
|
10
|
+
},
|
|
11
|
+
label: {
|
|
12
|
+
type: String,
|
|
13
|
+
default: ""
|
|
14
|
+
},
|
|
15
|
+
placeholder: {
|
|
16
|
+
type: String,
|
|
17
|
+
default: ""
|
|
18
|
+
}
|
|
19
|
+
})
|
|
20
|
+
|
|
21
|
+
const state = inject('state');
|
|
22
|
+
|
|
23
|
+
</script>
|
|
24
|
+
|
|
25
|
+
<template>
|
|
26
|
+
<div class="flex flex-col w-full h-full items-start gap-1.5">
|
|
27
|
+
<Label :for="randomId" v-if="label">{{ label }}</Label>
|
|
28
|
+
<Textarea :id="randomId" v-model="state.elementValues[variableName]" :placeholder="placeholder" class="border-ring h-full resize-none"></Textarea>
|
|
29
|
+
</div>
|
|
30
|
+
</template>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as CustomFormTextarea } from './Textarea.vue'
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { inject } from 'vue'
|
|
3
|
+
|
|
4
|
+
const randomId = crypto.randomUUID()
|
|
5
|
+
|
|
6
|
+
const props = defineProps({
|
|
7
|
+
variableName: {
|
|
8
|
+
type: String,
|
|
9
|
+
required: true
|
|
10
|
+
},
|
|
11
|
+
label: {
|
|
12
|
+
type: String,
|
|
13
|
+
default: ""
|
|
14
|
+
},
|
|
15
|
+
placeholder: {
|
|
16
|
+
type: String,
|
|
17
|
+
default: ""
|
|
18
|
+
}
|
|
19
|
+
})
|
|
20
|
+
|
|
21
|
+
const state = inject('state');
|
|
22
|
+
|
|
23
|
+
</script>
|
|
24
|
+
|
|
25
|
+
<template>
|
|
26
|
+
<div class="grid w-full items-center gap-1.5">
|
|
27
|
+
<Label :for="randomId" v-if="label">{{ label }}</Label>
|
|
28
|
+
<Input :id="randomId" v-model="state.elementValues[variableName]" type="text" :placeholder="placeholder" class="border-ring" />
|
|
29
|
+
</div>
|
|
30
|
+
</template>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as CustomFormTextfield } from './Textfield.vue'
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { HTMLAttributes } from 'vue'
|
|
3
|
+
import { cn } from '../../../lib/utils'
|
|
4
|
+
import { useVModel } from '@vueuse/core'
|
|
5
|
+
|
|
6
|
+
const props = defineProps<{
|
|
7
|
+
defaultValue?: string | number
|
|
8
|
+
modelValue?: string | number
|
|
9
|
+
class?: HTMLAttributes['class']
|
|
10
|
+
}>()
|
|
11
|
+
|
|
12
|
+
const emits = defineEmits<{
|
|
13
|
+
(e: 'update:modelValue', payload: string | number): void
|
|
14
|
+
}>()
|
|
15
|
+
|
|
16
|
+
const modelValue = useVModel(props, 'modelValue', emits, {
|
|
17
|
+
passive: true,
|
|
18
|
+
defaultValue: props.defaultValue,
|
|
19
|
+
})
|
|
20
|
+
</script>
|
|
21
|
+
|
|
22
|
+
<template>
|
|
23
|
+
<input
|
|
24
|
+
v-model="modelValue"
|
|
25
|
+
data-slot="input"
|
|
26
|
+
:class="cn(
|
|
27
|
+
'file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input flex h-9 w-full min-w-0 rounded-md border bg-background px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm',
|
|
28
|
+
'focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]',
|
|
29
|
+
'aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive',
|
|
30
|
+
props.class,
|
|
31
|
+
)"
|
|
32
|
+
>
|
|
33
|
+
</template>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Input } from './Input.vue'
|