@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.
Files changed (435) hide show
  1. package/README.md +1 -0
  2. package/components/ui/apple-emoji/AppleEmoji.vue +32 -0
  3. package/components/ui/apple-emoji/index.ts +1 -0
  4. package/components/ui/avatar/Avatar.vue +18 -0
  5. package/components/ui/avatar/AvatarFallback.vue +23 -0
  6. package/components/ui/avatar/AvatarImage.vue +16 -0
  7. package/components/ui/avatar/index.ts +3 -0
  8. package/components/ui/badge/Badge.vue +39 -0
  9. package/components/ui/badge/index.ts +1 -0
  10. package/components/ui/breadcrumb/Breadcrumb.vue +17 -0
  11. package/components/ui/breadcrumb/BreadcrumbEllipsis.vue +23 -0
  12. package/components/ui/breadcrumb/BreadcrumbItem.vue +17 -0
  13. package/components/ui/breadcrumb/BreadcrumbLink.vue +20 -0
  14. package/components/ui/breadcrumb/BreadcrumbList.vue +17 -0
  15. package/components/ui/breadcrumb/BreadcrumbPage.vue +20 -0
  16. package/components/ui/breadcrumb/BreadcrumbSeparator.vue +22 -0
  17. package/components/ui/breadcrumb/index.ts +7 -0
  18. package/components/ui/button/Button.vue +39 -0
  19. package/components/ui/button/index.ts +36 -0
  20. package/components/ui/calendar/Calendar.vue +63 -0
  21. package/components/ui/calendar/CalendarCell.vue +25 -0
  22. package/components/ui/calendar/CalendarCellTrigger.vue +41 -0
  23. package/components/ui/calendar/CalendarGrid.vue +25 -0
  24. package/components/ui/calendar/CalendarGridBody.vue +14 -0
  25. package/components/ui/calendar/CalendarGridHead.vue +15 -0
  26. package/components/ui/calendar/CalendarGridRow.vue +24 -0
  27. package/components/ui/calendar/CalendarHeadCell.vue +25 -0
  28. package/components/ui/calendar/CalendarHeader.vue +25 -0
  29. package/components/ui/calendar/CalendarHeading.vue +32 -0
  30. package/components/ui/calendar/CalendarNextButton.vue +34 -0
  31. package/components/ui/calendar/CalendarPrevButton.vue +34 -0
  32. package/components/ui/calendar/index.ts +12 -0
  33. package/components/ui/card/Card.vue +22 -0
  34. package/components/ui/card/CardAction.vue +17 -0
  35. package/components/ui/card/CardContent.vue +17 -0
  36. package/components/ui/card/CardDescription.vue +17 -0
  37. package/components/ui/card/CardFooter.vue +17 -0
  38. package/components/ui/card/CardHeader.vue +17 -0
  39. package/components/ui/card/CardTitle.vue +17 -0
  40. package/components/ui/card/index.ts +7 -0
  41. package/components/ui/checkbox/Checkbox.vue +37 -0
  42. package/components/ui/checkbox/index.ts +1 -0
  43. package/components/ui/code-editor/CodeEditor.vue +88 -0
  44. package/components/ui/code-editor/index.ts +1 -0
  45. package/components/ui/code-editor/interpolationHighlight.ts +39 -0
  46. package/components/ui/collapsible/Collapsible.vue +19 -0
  47. package/components/ui/collapsible/CollapsibleContent.vue +14 -0
  48. package/components/ui/collapsible/CollapsibleTrigger.vue +14 -0
  49. package/components/ui/collapsible/index.ts +3 -0
  50. package/components/ui/combobox/Combobox.vue +17 -0
  51. package/components/ui/combobox/ComboboxAnchor.vue +26 -0
  52. package/components/ui/combobox/ComboboxEmpty.vue +24 -0
  53. package/components/ui/combobox/ComboboxGroup.vue +30 -0
  54. package/components/ui/combobox/ComboboxInput.vue +47 -0
  55. package/components/ui/combobox/ComboboxItem.vue +27 -0
  56. package/components/ui/combobox/ComboboxItemIndicator.vue +26 -0
  57. package/components/ui/combobox/ComboboxList.vue +31 -0
  58. package/components/ui/combobox/ComboboxSeparator.vue +24 -0
  59. package/components/ui/combobox/ComboboxTrigger.vue +27 -0
  60. package/components/ui/combobox/ComboboxViewport.vue +26 -0
  61. package/components/ui/combobox/index.ts +12 -0
  62. package/components/ui/command/Command.vue +93 -0
  63. package/components/ui/command/CommandDialog.vue +31 -0
  64. package/components/ui/command/CommandEmpty.vue +29 -0
  65. package/components/ui/command/CommandGroup.vue +47 -0
  66. package/components/ui/command/CommandInput.vue +41 -0
  67. package/components/ui/command/CommandItem.vue +79 -0
  68. package/components/ui/command/CommandList.vue +28 -0
  69. package/components/ui/command/CommandSeparator.vue +24 -0
  70. package/components/ui/command/CommandShortcut.vue +17 -0
  71. package/components/ui/command/index.ts +25 -0
  72. package/components/ui/context-menu/ContextMenu.vue +18 -0
  73. package/components/ui/context-menu/ContextMenuCheckboxItem.vue +41 -0
  74. package/components/ui/context-menu/ContextMenuContent.vue +37 -0
  75. package/components/ui/context-menu/ContextMenuGroup.vue +14 -0
  76. package/components/ui/context-menu/ContextMenuItem.vue +42 -0
  77. package/components/ui/context-menu/ContextMenuLabel.vue +24 -0
  78. package/components/ui/context-menu/ContextMenuPortal.vue +14 -0
  79. package/components/ui/context-menu/ContextMenuRadioGroup.vue +22 -0
  80. package/components/ui/context-menu/ContextMenuRadioItem.vue +41 -0
  81. package/components/ui/context-menu/ContextMenuSeparator.vue +24 -0
  82. package/components/ui/context-menu/ContextMenuShortcut.vue +17 -0
  83. package/components/ui/context-menu/ContextMenuSub.vue +22 -0
  84. package/components/ui/context-menu/ContextMenuSubContent.vue +36 -0
  85. package/components/ui/context-menu/ContextMenuSubTrigger.vue +35 -0
  86. package/components/ui/context-menu/ContextMenuTrigger.vue +16 -0
  87. package/components/ui/context-menu/index.ts +14 -0
  88. package/components/ui/custom-dialog/CustomDialog.vue +31 -0
  89. package/components/ui/custom-dialog/index.ts +1 -0
  90. package/components/ui/dialog/Dialog.vue +17 -0
  91. package/components/ui/dialog/DialogClose.vue +14 -0
  92. package/components/ui/dialog/DialogContent.vue +49 -0
  93. package/components/ui/dialog/DialogDescription.vue +25 -0
  94. package/components/ui/dialog/DialogFooter.vue +15 -0
  95. package/components/ui/dialog/DialogHeader.vue +17 -0
  96. package/components/ui/dialog/DialogOverlay.vue +23 -0
  97. package/components/ui/dialog/DialogScrollContent.vue +59 -0
  98. package/components/ui/dialog/DialogTitle.vue +25 -0
  99. package/components/ui/dialog/DialogTrigger.vue +14 -0
  100. package/components/ui/dialog/index.ts +10 -0
  101. package/components/ui/drawer/Drawer.vue +22 -0
  102. package/components/ui/drawer/DrawerClose.vue +15 -0
  103. package/components/ui/drawer/DrawerContent.vue +34 -0
  104. package/components/ui/drawer/DrawerDescription.vue +24 -0
  105. package/components/ui/drawer/DrawerFooter.vue +17 -0
  106. package/components/ui/drawer/DrawerHeader.vue +17 -0
  107. package/components/ui/drawer/DrawerOverlay.vue +22 -0
  108. package/components/ui/drawer/DrawerTitle.vue +24 -0
  109. package/components/ui/drawer/DrawerTrigger.vue +15 -0
  110. package/components/ui/drawer/index.ts +9 -0
  111. package/components/ui/dropdown-menu/DropdownMenu.vue +17 -0
  112. package/components/ui/dropdown-menu/DropdownMenuCheckboxItem.vue +41 -0
  113. package/components/ui/dropdown-menu/DropdownMenuContent.vue +39 -0
  114. package/components/ui/dropdown-menu/DropdownMenuGroup.vue +14 -0
  115. package/components/ui/dropdown-menu/DropdownMenuItem.vue +30 -0
  116. package/components/ui/dropdown-menu/DropdownMenuLabel.vue +22 -0
  117. package/components/ui/dropdown-menu/DropdownMenuRadioGroup.vue +22 -0
  118. package/components/ui/dropdown-menu/DropdownMenuRadioItem.vue +42 -0
  119. package/components/ui/dropdown-menu/DropdownMenuSeparator.vue +26 -0
  120. package/components/ui/dropdown-menu/DropdownMenuShortcut.vue +17 -0
  121. package/components/ui/dropdown-menu/DropdownMenuSub.vue +19 -0
  122. package/components/ui/dropdown-menu/DropdownMenuSubContent.vue +31 -0
  123. package/components/ui/dropdown-menu/DropdownMenuSubTrigger.vue +30 -0
  124. package/components/ui/dropdown-menu/DropdownMenuTrigger.vue +16 -0
  125. package/components/ui/dropdown-menu/index.ts +16 -0
  126. package/components/ui/emoji-picker/EmojiPicker.vue +71 -0
  127. package/components/ui/emoji-picker/index.ts +1 -0
  128. package/components/ui/flow-builder/FlowBuilder.vue +48 -0
  129. package/components/ui/flow-builder/FlowBuilderSelect.vue +33 -0
  130. package/components/ui/flow-builder/components/Builder.vue +287 -0
  131. package/components/ui/flow-builder/components/DropzoneBackground.vue +13 -0
  132. package/components/ui/flow-builder/components/EdgeEditor.vue +36 -0
  133. package/components/ui/flow-builder/components/Menu.vue +78 -0
  134. package/components/ui/flow-builder/components/NodeEditor.vue +181 -0
  135. package/components/ui/flow-builder/components/edge-editor/DataEdgeEditor.vue +64 -0
  136. package/components/ui/flow-builder/components/edges/DataEdge.vue +87 -0
  137. package/components/ui/flow-builder/components/node-editor/ApiRequestEditor.vue +150 -0
  138. package/components/ui/flow-builder/components/node-editor/ConfettiEditor.vue +23 -0
  139. package/components/ui/flow-builder/components/node-editor/ConfirmEditor.vue +30 -0
  140. package/components/ui/flow-builder/components/node-editor/FinishFlowEditor.vue +33 -0
  141. package/components/ui/flow-builder/components/node-editor/IntegrationActionEditor.vue +50 -0
  142. package/components/ui/flow-builder/components/node-editor/SetVariableEditor.vue +71 -0
  143. package/components/ui/flow-builder/components/node-editor/ShowDialogEditor.vue +26 -0
  144. package/components/ui/flow-builder/components/node-editor/ShowModuleEditor.vue +92 -0
  145. package/components/ui/flow-builder/components/node-editor/ShowToastEditor.vue +28 -0
  146. package/components/ui/flow-builder/components/node-editor/TransformDataEditor.vue +27 -0
  147. package/components/ui/flow-builder/components/node-editor/VisitUrlEditor.vue +31 -0
  148. package/components/ui/flow-builder/components/nodes/ApiRequestNode.vue +45 -0
  149. package/components/ui/flow-builder/components/nodes/ConfettiNode.vue +32 -0
  150. package/components/ui/flow-builder/components/nodes/ConfirmNode.vue +45 -0
  151. package/components/ui/flow-builder/components/nodes/EmptyNode.vue +26 -0
  152. package/components/ui/flow-builder/components/nodes/FinishFlowNode.vue +30 -0
  153. package/components/ui/flow-builder/components/nodes/IntegrationActionNode.vue +52 -0
  154. package/components/ui/flow-builder/components/nodes/SetVariableNode.vue +34 -0
  155. package/components/ui/flow-builder/components/nodes/ShowDialogNode.vue +34 -0
  156. package/components/ui/flow-builder/components/nodes/ShowModuleNode.vue +34 -0
  157. package/components/ui/flow-builder/components/nodes/ShowToastNode.vue +35 -0
  158. package/components/ui/flow-builder/components/nodes/StartNode.vue +27 -0
  159. package/components/ui/flow-builder/components/nodes/TransformDataNode.vue +34 -0
  160. package/components/ui/flow-builder/components/nodes/VisitUrlNode.vue +34 -0
  161. package/components/ui/flow-builder/components/toolbars/ApiRequestToolbar.vue +45 -0
  162. package/components/ui/flow-builder/components/toolbars/ConfirmToolbar.vue +45 -0
  163. package/components/ui/flow-builder/components/toolbars/DefaultToolbar.vue +42 -0
  164. package/components/ui/flow-builder/components/toolbars/IntegrationActionToolbar.vue +45 -0
  165. package/components/ui/flow-builder/components/variables/Widget.vue +137 -0
  166. package/components/ui/flow-builder/composables/outputRegistry.ts +33 -0
  167. package/components/ui/flow-builder/composables/taskHandlers.js +185 -0
  168. package/components/ui/flow-builder/composables/useLayout.js +60 -0
  169. package/components/ui/flow-builder/composables/useProcessNodeLogic.js +55 -0
  170. package/components/ui/flow-builder/composables/useRunProcess.js +267 -0
  171. package/components/ui/flow-builder/index.ts +5 -0
  172. package/components/ui/flow-builder/types.ts +7 -0
  173. package/components/ui/form/FormControl.vue +17 -0
  174. package/components/ui/form/FormDescription.vue +21 -0
  175. package/components/ui/form/FormItem.vue +22 -0
  176. package/components/ui/form/FormLabel.vue +25 -0
  177. package/components/ui/form/FormMessage.vue +22 -0
  178. package/components/ui/form/index.ts +7 -0
  179. package/components/ui/form/injectionKeys.ts +4 -0
  180. package/components/ui/form/useFormField.ts +30 -0
  181. package/components/ui/form-builder/FormBuilder.vue +45 -0
  182. package/components/ui/form-builder/FormBuilderSelect.vue +42 -0
  183. package/components/ui/form-builder/FormDisplayer.vue +39 -0
  184. package/components/ui/form-builder/components/AdminElementEditor.vue +48 -0
  185. package/components/ui/form-builder/components/AdminToolbar.vue +60 -0
  186. package/components/ui/form-builder/components/AdminToolbarView.vue +19 -0
  187. package/components/ui/form-builder/components/CustomDashboard.vue +312 -0
  188. package/components/ui/form-builder/components/FormBuilderWrapper.vue +333 -0
  189. package/components/ui/form-builder/components/admin/Transformer.vue +25 -0
  190. package/components/ui/form-builder/components/admin/element-setting-views/Button.vue +30 -0
  191. package/components/ui/form-builder/components/admin/element-setting-views/Checkbox.vue +23 -0
  192. package/components/ui/form-builder/components/admin/element-setting-views/Label.vue +13 -0
  193. package/components/ui/form-builder/components/admin/element-setting-views/Radios.vue +85 -0
  194. package/components/ui/form-builder/components/admin/element-setting-views/Scanner.vue +15 -0
  195. package/components/ui/form-builder/components/admin/element-setting-views/Select.vue +75 -0
  196. package/components/ui/form-builder/components/admin/element-setting-views/Text.vue +13 -0
  197. package/components/ui/form-builder/components/admin/element-setting-views/Textarea.vue +20 -0
  198. package/components/ui/form-builder/components/admin/element-setting-views/Textfield.vue +20 -0
  199. package/components/ui/form-builder/components/admin/element-setting-views/index.ts +21 -0
  200. package/components/ui/form-builder/components/admin/setting-views/ApiActionsView.vue +111 -0
  201. package/components/ui/form-builder/components/admin/setting-views/NewElementView.vue +200 -0
  202. package/components/ui/form-builder/components/admin/setting-views/VariablesView.vue +19 -0
  203. package/components/ui/form-builder/components/admin/setting-views/new-element-view/DraggableElement.vue +107 -0
  204. package/components/ui/form-builder/components/admin/setting-views/variables-view/ApiActionVariables.vue +27 -0
  205. package/components/ui/form-builder/components/admin/setting-views/variables-view/RouteQueryParams.vue +47 -0
  206. package/components/ui/form-builder/components/admin/setting-views/variables-view/Transformers.vue +61 -0
  207. package/components/ui/form-builder/components/admin/setting-views/variables-view/Variables.vue +74 -0
  208. package/components/ui/form-builder/components/elements/button/Button.vue +60 -0
  209. package/components/ui/form-builder/components/elements/button/index.ts +1 -0
  210. package/components/ui/form-builder/components/elements/checkbox/Checkbox.vue +40 -0
  211. package/components/ui/form-builder/components/elements/checkbox/index.ts +1 -0
  212. package/components/ui/form-builder/components/elements/file/File.vue +6 -0
  213. package/components/ui/form-builder/components/elements/file/index.ts +1 -0
  214. package/components/ui/form-builder/components/elements/images/Images.vue +28 -0
  215. package/components/ui/form-builder/components/elements/images/index.ts +1 -0
  216. package/components/ui/form-builder/components/elements/index.ts +31 -0
  217. package/components/ui/form-builder/components/elements/items/Items.vue +6 -0
  218. package/components/ui/form-builder/components/elements/items/index.ts +1 -0
  219. package/components/ui/form-builder/components/elements/label/Label.vue +20 -0
  220. package/components/ui/form-builder/components/elements/label/index.ts +1 -0
  221. package/components/ui/form-builder/components/elements/location/Location.vue +6 -0
  222. package/components/ui/form-builder/components/elements/location/index.ts +1 -0
  223. package/components/ui/form-builder/components/elements/radios/Radios.vue +42 -0
  224. package/components/ui/form-builder/components/elements/radios/index.ts +1 -0
  225. package/components/ui/form-builder/components/elements/richtext/Richtext.vue +6 -0
  226. package/components/ui/form-builder/components/elements/richtext/index.ts +1 -0
  227. package/components/ui/form-builder/components/elements/scanner/Scanner.vue +173 -0
  228. package/components/ui/form-builder/components/elements/scanner/index.ts +1 -0
  229. package/components/ui/form-builder/components/elements/select/Select.vue +49 -0
  230. package/components/ui/form-builder/components/elements/select/index.ts +1 -0
  231. package/components/ui/form-builder/components/elements/text/Text.vue +20 -0
  232. package/components/ui/form-builder/components/elements/text/index.ts +1 -0
  233. package/components/ui/form-builder/components/elements/textarea/Textarea.vue +30 -0
  234. package/components/ui/form-builder/components/elements/textarea/index.ts +1 -0
  235. package/components/ui/form-builder/components/elements/textfield/Textfield.vue +30 -0
  236. package/components/ui/form-builder/components/elements/textfield/index.ts +1 -0
  237. package/components/ui/form-builder/index.ts +3 -0
  238. package/components/ui/input/Input.vue +33 -0
  239. package/components/ui/input/index.ts +1 -0
  240. package/components/ui/integration-action-builder/IntegrationActionBuilder.vue +193 -0
  241. package/components/ui/integration-action-builder/InterpolationField.vue +29 -0
  242. package/components/ui/integration-action-builder/index.ts +1 -0
  243. package/components/ui/integration-action-builder/integrations/firebase/AddDocument.vue +43 -0
  244. package/components/ui/integration-action-builder/integrations/firebase/DeleteDocument.vue +6 -0
  245. package/components/ui/integration-action-builder/integrations/firebase/GetCollections.vue +6 -0
  246. package/components/ui/integration-action-builder/integrations/firebase/GetDocumentById.vue +6 -0
  247. package/components/ui/integration-action-builder/integrations/firebase/QueryCollectionGroup.vue +6 -0
  248. package/components/ui/integration-action-builder/integrations/firebase/QueryFirestore.vue +165 -0
  249. package/components/ui/integration-action-builder/integrations/firebase/UpdateDocument.vue +6 -0
  250. package/components/ui/integration-action-builder/integrations/firebase/index.ts +204 -0
  251. package/components/ui/integration-action-builder/integrations/index.ts +9 -0
  252. package/components/ui/integration-action-builder/integrations/openai/AddDocument.vue +43 -0
  253. package/components/ui/integration-action-builder/integrations/openai/GenerateText.vue +40 -0
  254. package/components/ui/integration-action-builder/integrations/openai/components/ModelSelector.vue +75 -0
  255. package/components/ui/integration-action-builder/integrations/openai/index.ts +116 -0
  256. package/components/ui/integration-action-builder/integrations/twilio/MakeCall.vue +40 -0
  257. package/components/ui/integration-action-builder/integrations/twilio/SendSMS.vue +39 -0
  258. package/components/ui/integration-action-builder/integrations/twilio/components/ModelSelector.vue +75 -0
  259. package/components/ui/integration-action-builder/integrations/twilio/index.ts +68 -0
  260. package/components/ui/integration-icon/IntegrationIcon.vue +18 -0
  261. package/components/ui/integration-icon/index.ts +1 -0
  262. package/components/ui/label/Label.vue +28 -0
  263. package/components/ui/label/index.ts +1 -0
  264. package/components/ui/lucide-icon-selector/LucideIconPicker.vue +34 -0
  265. package/components/ui/lucide-icon-selector/LucideIconSelector.vue +55 -0
  266. package/components/ui/lucide-icon-selector/index.ts +2 -0
  267. package/components/ui/media-picker/MediaPicker.vue +40 -0
  268. package/components/ui/media-picker/MediaPickerDialog.vue +306 -0
  269. package/components/ui/media-picker/MediaPickerItems.vue +342 -0
  270. package/components/ui/media-picker/index.ts +2 -0
  271. package/components/ui/media-picker/media-picker-dialog/Dropzone.vue +104 -0
  272. package/components/ui/media-picker/media-picker-dialog/FileItem.vue +108 -0
  273. package/components/ui/media-picker/media-picker-dialog/Filters.vue +78 -0
  274. package/components/ui/menubar/Menubar.vue +36 -0
  275. package/components/ui/menubar/MenubarCheckboxItem.vue +41 -0
  276. package/components/ui/menubar/MenubarContent.vue +44 -0
  277. package/components/ui/menubar/MenubarGroup.vue +14 -0
  278. package/components/ui/menubar/MenubarItem.vue +37 -0
  279. package/components/ui/menubar/MenubarLabel.vue +19 -0
  280. package/components/ui/menubar/MenubarMenu.vue +14 -0
  281. package/components/ui/menubar/MenubarRadioGroup.vue +22 -0
  282. package/components/ui/menubar/MenubarRadioItem.vue +41 -0
  283. package/components/ui/menubar/MenubarSeparator.vue +23 -0
  284. package/components/ui/menubar/MenubarShortcut.vue +17 -0
  285. package/components/ui/menubar/MenubarSub.vue +22 -0
  286. package/components/ui/menubar/MenubarSubContent.vue +39 -0
  287. package/components/ui/menubar/MenubarSubTrigger.vue +27 -0
  288. package/components/ui/menubar/MenubarTrigger.vue +30 -0
  289. package/components/ui/menubar/index.ts +15 -0
  290. package/components/ui/number-field/NumberField.vue +23 -0
  291. package/components/ui/number-field/NumberFieldContent.vue +14 -0
  292. package/components/ui/number-field/NumberFieldDecrement.vue +25 -0
  293. package/components/ui/number-field/NumberFieldIncrement.vue +25 -0
  294. package/components/ui/number-field/NumberFieldInput.vue +16 -0
  295. package/components/ui/number-field/index.ts +5 -0
  296. package/components/ui/pagination/PaginationEllipsis.vue +22 -0
  297. package/components/ui/pagination/PaginationFirst.vue +29 -0
  298. package/components/ui/pagination/PaginationLast.vue +29 -0
  299. package/components/ui/pagination/PaginationNext.vue +29 -0
  300. package/components/ui/pagination/PaginationPrev.vue +29 -0
  301. package/components/ui/pagination/index.ts +10 -0
  302. package/components/ui/popover/Popover.vue +18 -0
  303. package/components/ui/popover/PopoverAnchor.vue +15 -0
  304. package/components/ui/popover/PopoverContent.vue +49 -0
  305. package/components/ui/popover/PopoverTrigger.vue +14 -0
  306. package/components/ui/popover/index.ts +4 -0
  307. package/components/ui/query-builder-dialog/QueryBuilderDialog.vue +389 -0
  308. package/components/ui/query-builder-dialog/index.ts +1 -0
  309. package/components/ui/radio-group/RadioGroup.vue +30 -0
  310. package/components/ui/radio-group/RadioGroupItem.vue +43 -0
  311. package/components/ui/radio-group/index.ts +2 -0
  312. package/components/ui/range-calendar/RangeCalendar.vue +57 -0
  313. package/components/ui/range-calendar/RangeCalendarCell.vue +21 -0
  314. package/components/ui/range-calendar/RangeCalendarCellTrigger.vue +37 -0
  315. package/components/ui/range-calendar/RangeCalendarGrid.vue +21 -0
  316. package/components/ui/range-calendar/RangeCalendarGridBody.vue +11 -0
  317. package/components/ui/range-calendar/RangeCalendarGridHead.vue +11 -0
  318. package/components/ui/range-calendar/RangeCalendarGridRow.vue +18 -0
  319. package/components/ui/range-calendar/RangeCalendarHeadCell.vue +18 -0
  320. package/components/ui/range-calendar/RangeCalendarHeader.vue +18 -0
  321. package/components/ui/range-calendar/RangeCalendarHeading.vue +28 -0
  322. package/components/ui/range-calendar/RangeCalendarNextButton.vue +29 -0
  323. package/components/ui/range-calendar/RangeCalendarPrevButton.vue +29 -0
  324. package/components/ui/range-calendar/index.ts +12 -0
  325. package/components/ui/resizable/ResizableHandle.vue +27 -0
  326. package/components/ui/resizable/ResizablePanel.vue +18 -0
  327. package/components/ui/resizable/ResizablePanelGroup.vue +25 -0
  328. package/components/ui/resizable/index.ts +3 -0
  329. package/components/ui/ripple-button/RippleButton.vue +97 -0
  330. package/components/ui/ripple-button/index.ts +1 -0
  331. package/components/ui/sandbox/Sandbox.vue +35 -0
  332. package/components/ui/sandbox/index.ts +1 -0
  333. package/components/ui/scroll-area/ScrollArea.vue +36 -0
  334. package/components/ui/scroll-area/ScrollBar.vue +34 -0
  335. package/components/ui/scroll-area/index.ts +2 -0
  336. package/components/ui/segmented-control/SegmentedControl.vue +121 -0
  337. package/components/ui/segmented-control/SegmentedControlButton.vue +64 -0
  338. package/components/ui/segmented-control/index.ts +2 -0
  339. package/components/ui/select/Select.vue +18 -0
  340. package/components/ui/select/SelectContent.vue +55 -0
  341. package/components/ui/select/SelectGroup.vue +14 -0
  342. package/components/ui/select/SelectItem.vue +45 -0
  343. package/components/ui/select/SelectItemText.vue +14 -0
  344. package/components/ui/select/SelectLabel.vue +16 -0
  345. package/components/ui/select/SelectScrollDownButton.vue +28 -0
  346. package/components/ui/select/SelectScrollUpButton.vue +28 -0
  347. package/components/ui/select/SelectSeparator.vue +21 -0
  348. package/components/ui/select/SelectTrigger.vue +32 -0
  349. package/components/ui/select/SelectValue.vue +15 -0
  350. package/components/ui/select/index.ts +11 -0
  351. package/components/ui/separator/Separator.vue +28 -0
  352. package/components/ui/separator/index.ts +1 -0
  353. package/components/ui/sheet/Sheet.vue +17 -0
  354. package/components/ui/sheet/SheetClose.vue +14 -0
  355. package/components/ui/sheet/SheetContent.vue +65 -0
  356. package/components/ui/sheet/SheetDescription.vue +20 -0
  357. package/components/ui/sheet/SheetFooter.vue +16 -0
  358. package/components/ui/sheet/SheetHeader.vue +15 -0
  359. package/components/ui/sheet/SheetOverlay.vue +24 -0
  360. package/components/ui/sheet/SheetTitle.vue +20 -0
  361. package/components/ui/sheet/SheetTrigger.vue +14 -0
  362. package/components/ui/sheet/index.ts +8 -0
  363. package/components/ui/sidebar/Sidebar.vue +96 -0
  364. package/components/ui/sidebar/SidebarContent.vue +18 -0
  365. package/components/ui/sidebar/SidebarFooter.vue +18 -0
  366. package/components/ui/sidebar/SidebarGroup.vue +18 -0
  367. package/components/ui/sidebar/SidebarGroupAction.vue +27 -0
  368. package/components/ui/sidebar/SidebarGroupContent.vue +18 -0
  369. package/components/ui/sidebar/SidebarGroupLabel.vue +25 -0
  370. package/components/ui/sidebar/SidebarHeader.vue +18 -0
  371. package/components/ui/sidebar/SidebarInput.vue +22 -0
  372. package/components/ui/sidebar/SidebarInset.vue +21 -0
  373. package/components/ui/sidebar/SidebarMenu.vue +18 -0
  374. package/components/ui/sidebar/SidebarMenuAction.vue +34 -0
  375. package/components/ui/sidebar/SidebarMenuBadge.vue +26 -0
  376. package/components/ui/sidebar/SidebarMenuButton.vue +49 -0
  377. package/components/ui/sidebar/SidebarMenuButtonChild.vue +34 -0
  378. package/components/ui/sidebar/SidebarMenuItem.vue +18 -0
  379. package/components/ui/sidebar/SidebarMenuSkeleton.vue +34 -0
  380. package/components/ui/sidebar/SidebarMenuSub.vue +22 -0
  381. package/components/ui/sidebar/SidebarMenuSubButton.vue +36 -0
  382. package/components/ui/sidebar/SidebarMenuSubItem.vue +18 -0
  383. package/components/ui/sidebar/SidebarProvider.vue +81 -0
  384. package/components/ui/sidebar/SidebarRail.vue +33 -0
  385. package/components/ui/sidebar/SidebarSeparator.vue +19 -0
  386. package/components/ui/sidebar/SidebarTrigger.vue +27 -0
  387. package/components/ui/sidebar/index.ts +60 -0
  388. package/components/ui/sidebar/utils.ts +19 -0
  389. package/components/ui/skeleton/Skeleton.vue +17 -0
  390. package/components/ui/skeleton/index.ts +1 -0
  391. package/components/ui/sonner/Sonner.vue +18 -0
  392. package/components/ui/sonner/index.ts +1 -0
  393. package/components/ui/spring-calendar/SpringCalendar.vue +110 -0
  394. package/components/ui/spring-calendar/TextMorph.vue +160 -0
  395. package/components/ui/spring-calendar/index.ts +2 -0
  396. package/components/ui/switch/Switch.vue +41 -0
  397. package/components/ui/switch/index.ts +1 -0
  398. package/components/ui/table/Table.vue +16 -0
  399. package/components/ui/table/TableBody.vue +17 -0
  400. package/components/ui/table/TableCaption.vue +17 -0
  401. package/components/ui/table/TableCell.vue +22 -0
  402. package/components/ui/table/TableEmpty.vue +37 -0
  403. package/components/ui/table/TableFooter.vue +17 -0
  404. package/components/ui/table/TableHead.vue +17 -0
  405. package/components/ui/table/TableHeader.vue +17 -0
  406. package/components/ui/table/TableRow.vue +17 -0
  407. package/components/ui/table/index.ts +9 -0
  408. package/components/ui/table/utils.ts +9 -0
  409. package/components/ui/tabs/Tabs.vue +15 -0
  410. package/components/ui/tabs/TabsContent.vue +22 -0
  411. package/components/ui/tabs/TabsList.vue +25 -0
  412. package/components/ui/tabs/TabsTrigger.vue +29 -0
  413. package/components/ui/tabs/index.ts +4 -0
  414. package/components/ui/tailwind-color-picker/TailwindColorPicker.vue +58 -0
  415. package/components/ui/tailwind-color-picker/index.ts +1 -0
  416. package/components/ui/textarea/Textarea.vue +28 -0
  417. package/components/ui/textarea/index.ts +1 -0
  418. package/components/ui/toggle/Toggle.vue +32 -0
  419. package/components/ui/toggle/index.ts +27 -0
  420. package/components/ui/tooltip/Tooltip.vue +17 -0
  421. package/components/ui/tooltip/TooltipContent.vue +33 -0
  422. package/components/ui/tooltip/TooltipProvider.vue +13 -0
  423. package/components/ui/tooltip/TooltipTrigger.vue +14 -0
  424. package/components/ui/tooltip/index.ts +4 -0
  425. package/composables/useCms.ts +11 -0
  426. package/index.ts +10 -0
  427. package/lib/interpolation.ts +77 -0
  428. package/lib/utils.ts +24 -0
  429. package/package.json +52 -0
  430. package/styles/components/code-editor.css +52 -0
  431. package/styles/components/flow-builder.css +159 -0
  432. package/styles/index.css +2 -0
  433. package/tsconfig.json +19 -0
  434. package/types/index.ts +41 -0
  435. package/vite.config.ts +25 -0
@@ -0,0 +1,34 @@
1
+ <script setup>
2
+ import { Position, Handle } from '@vue-flow/core'
3
+ import NodeToolbarWrapper from '../toolbars/DefaultToolbar.vue'
4
+ import { Braces } from 'lucide-vue-next'
5
+
6
+ const props = defineProps({
7
+ id: {
8
+ type: String,
9
+ required: true,
10
+ },
11
+ position: {
12
+ type: Object,
13
+ required: true,
14
+ },
15
+ data: {
16
+ type: Object
17
+ }
18
+ })
19
+ </script>
20
+
21
+ <template>
22
+ <NodeToolbarWrapper :nodeId="id" :toolbarVisible="data.toolbarVisible" :toolbarPosition="data.toolbarPosition">
23
+ <Handle type="target" :position="Position.Left" />
24
+
25
+ <div class="flex items-center gap-2">
26
+ <div class="size-8 bg-yellow-500 text-white rounded-xl flex items-center justify-center">
27
+ <Braces class="size-5" />
28
+ </div>
29
+ <div>Transform data</div>
30
+ </div>
31
+
32
+ <Handle type="source" id="success" :position="Position.Right" />
33
+ </NodeToolbarWrapper>
34
+ </template>
@@ -0,0 +1,34 @@
1
+ <script setup>
2
+ import { Position, Handle } from '@vue-flow/core'
3
+ import NodeToolbarWrapper from '../toolbars/DefaultToolbar.vue'
4
+ import { Globe } from 'lucide-vue-next'
5
+
6
+ const props = defineProps({
7
+ id: {
8
+ type: String,
9
+ required: true,
10
+ },
11
+ position: {
12
+ type: Object,
13
+ required: true,
14
+ },
15
+ data: {
16
+ type: Object
17
+ }
18
+ })
19
+ </script>
20
+
21
+ <template>
22
+ <NodeToolbarWrapper :nodeId="id" :toolbarVisible="data.toolbarVisible" :toolbarPosition="data.toolbarPosition">
23
+ <Handle type="target" :position="Position.Left" />
24
+
25
+ <div class="flex items-center gap-2">
26
+ <div class="size-8 bg-blue-500 text-white rounded-xl flex items-center justify-center">
27
+ <Globe class="size-5" />
28
+ </div>
29
+ <div>Visit URL</div>
30
+ </div>
31
+
32
+ <Handle type="source" id="success" :position="Position.Right" />
33
+ </NodeToolbarWrapper>
34
+ </template>
@@ -0,0 +1,45 @@
1
+ <script setup lang="ts">
2
+ import { Position } from '@vue-flow/core'
3
+ import { NodeToolbar } from '@vue-flow/node-toolbar'
4
+ import { Plus } from 'lucide-vue-next'
5
+
6
+ const props = defineProps({
7
+ nodeId: String,
8
+ toolbarVisible: Boolean,
9
+ })
10
+
11
+ const createNewNode = inject('createNewNode') as (args: any) => void
12
+
13
+ const addSuccessNode = () => {
14
+ createNewNode({ type: 'empty', parentId: props.nodeId, sourceHandle: 'success' })
15
+ }
16
+
17
+ const addErrorNode = () => {
18
+ createNewNode({ type: 'empty', parentId: props.nodeId, sourceHandle: 'error' })
19
+ }
20
+ </script>
21
+
22
+ <template>
23
+ <NodeToolbar :is-visible="toolbarVisible" :position="Position.Right">
24
+ <div class="flex flex-col gap-2">
25
+ <Button
26
+ size="icon"
27
+ class="rounded-full bg-green-500 hover:bg-green-600 size-7"
28
+ @click="addSuccessNode"
29
+ title="Add on success"
30
+ >
31
+ <Plus class="text-white size-4" />
32
+ </Button>
33
+ <Button
34
+ size="icon"
35
+ class="rounded-full bg-red-500 hover:bg-red-600 size-7"
36
+ @click="addErrorNode"
37
+ title="Add on error"
38
+ >
39
+ <Plus class="text-white size-4" />
40
+ </Button>
41
+ </div>
42
+ </NodeToolbar>
43
+
44
+ <slot></slot>
45
+ </template>
@@ -0,0 +1,45 @@
1
+ <script setup lang="ts">
2
+ import { Position } from '@vue-flow/core'
3
+ import { NodeToolbar } from '@vue-flow/node-toolbar'
4
+ import { Plus } from 'lucide-vue-next'
5
+
6
+ const props = defineProps({
7
+ nodeId: String,
8
+ toolbarVisible: Boolean,
9
+ })
10
+
11
+ const createNewNode = inject('createNewNode') as (args: any) => void
12
+
13
+ const addSuccessNode = () => {
14
+ createNewNode({ type: 'empty', parentId: props.nodeId, sourceHandle: 'success' })
15
+ }
16
+
17
+ const addErrorNode = () => {
18
+ createNewNode({ type: 'empty', parentId: props.nodeId, sourceHandle: 'error' })
19
+ }
20
+ </script>
21
+
22
+ <template>
23
+ <NodeToolbar :is-visible="toolbarVisible" :position="Position.Right">
24
+ <div class="flex flex-col gap-2">
25
+ <Button
26
+ size="icon"
27
+ class="rounded-full bg-green-500 hover:bg-green-600 size-7"
28
+ @click="addSuccessNode"
29
+ title="Add on success"
30
+ >
31
+ <Plus class="text-white size-4" />
32
+ </Button>
33
+ <Button
34
+ size="icon"
35
+ class="rounded-full bg-red-500 hover:bg-red-600 size-7"
36
+ @click="addErrorNode"
37
+ title="Add on error"
38
+ >
39
+ <Plus class="text-white size-4" />
40
+ </Button>
41
+ </div>
42
+ </NodeToolbar>
43
+
44
+ <slot></slot>
45
+ </template>
@@ -0,0 +1,42 @@
1
+ <script lang="ts" setup>
2
+ import { Plus } from 'lucide-vue-next'
3
+ import { Position } from '@vue-flow/core'
4
+ import { NodeToolbar } from '@vue-flow/node-toolbar'
5
+
6
+ defineOptions({ inheritAttrs: false })
7
+
8
+ const props = defineProps({
9
+ nodeId: {
10
+ type: String,
11
+ required: true,
12
+ },
13
+ toolbarVisible: {
14
+ type: Boolean,
15
+ default: false,
16
+ },
17
+ toolbarPosition: {
18
+ type: String as () => Position,
19
+ default: Position.Right,
20
+ },
21
+ })
22
+
23
+ const createNewNode = inject('createNewNode') as (node: any) => void
24
+
25
+ const addNode = () => {
26
+ createNewNode({ type: 'empty', parentId: props.nodeId, sourceHandle: 'success' })
27
+ }
28
+ </script>
29
+
30
+ <template>
31
+ <NodeToolbar :is-visible="toolbarVisible" :position="toolbarPosition">
32
+ <Button
33
+ size="icon"
34
+ class="rounded-full bg-purple-500 hover:bg-purple-600"
35
+ @click="addNode"
36
+ >
37
+ <Plus class="text-white size-5" />
38
+ </Button>
39
+ </NodeToolbar>
40
+
41
+ <slot></slot>
42
+ </template>
@@ -0,0 +1,45 @@
1
+ <script setup lang="ts">
2
+ import { Position } from '@vue-flow/core'
3
+ import { NodeToolbar } from '@vue-flow/node-toolbar'
4
+ import { Plus } from 'lucide-vue-next'
5
+
6
+ const props = defineProps({
7
+ nodeId: String,
8
+ toolbarVisible: Boolean,
9
+ })
10
+
11
+ const createNewNode = inject('createNewNode') as (args: any) => void
12
+
13
+ const addSuccessNode = () => {
14
+ createNewNode({ type: 'empty', parentId: props.nodeId, sourceHandle: 'success' })
15
+ }
16
+
17
+ const addErrorNode = () => {
18
+ createNewNode({ type: 'empty', parentId: props.nodeId, sourceHandle: 'error' })
19
+ }
20
+ </script>
21
+
22
+ <template>
23
+ <NodeToolbar :is-visible="toolbarVisible" :position="Position.Right">
24
+ <div class="flex flex-col gap-2">
25
+ <Button
26
+ size="icon"
27
+ class="rounded-full bg-green-500 hover:bg-green-600 size-7"
28
+ @click="addSuccessNode"
29
+ title="Add on success"
30
+ >
31
+ <Plus class="text-white size-4" />
32
+ </Button>
33
+ <Button
34
+ size="icon"
35
+ class="rounded-full bg-red-500 hover:bg-red-600 size-7"
36
+ @click="addErrorNode"
37
+ title="Add on error"
38
+ >
39
+ <Plus class="text-white size-4" />
40
+ </Button>
41
+ </div>
42
+ </NodeToolbar>
43
+
44
+ <slot></slot>
45
+ </template>
@@ -0,0 +1,137 @@
1
+ <script setup lang="ts">
2
+ import { ControlButton } from '@vue-flow/controls'
3
+ import { Variable, CaseSensitive, Hash, ToggleLeft, Braces, Brackets, Calendar, ChevronDown, Plus } from 'lucide-vue-next'
4
+ import { inject, ref } from 'vue';
5
+ import { type FlowVariable } from '../../types'
6
+
7
+
8
+ const openVariableId = ref<string | null>(null)
9
+
10
+ const variables = inject('variables', ref([])) as { value: FlowVariable[] }
11
+
12
+ async function addVariable(type: string) {
13
+ let id = crypto.randomUUID()
14
+ let name = "New variable"
15
+
16
+ let i = 2
17
+ while (variables.value.find(variable => variable.name === name)) {
18
+ name = "New variable " + i
19
+ i++
20
+ }
21
+
22
+ variables.value.push({
23
+ id,
24
+ type,
25
+ name,
26
+ defaultValue: ''
27
+ })
28
+ }
29
+
30
+ const variableOptions = [
31
+ { value: "string", label: "String", icon: CaseSensitive, tint: "#e83f3f", defaultValue: "" },
32
+ { value: "number", label: "Number", icon: Hash, tint: "#2d9225", defaultValue: 0 },
33
+ { value: "boolean", label: "Boolean", icon: ToggleLeft, tint: "#8e2592", defaultValue: false },
34
+ { value: "object", label: "Object", icon: Braces, tint: "#926025", defaultValue: {} },
35
+ { value: "array", label: "Array", icon: Brackets, tint: "#005799", defaultValue: [] },
36
+ { value: "date", label: "Date", icon: Calendar, tint: "#5b7f91", defaultValue: "" }
37
+ ]
38
+ </script>
39
+
40
+ <template>
41
+ <Tooltip>
42
+ <Popover>
43
+ <PopoverTrigger as-child>
44
+ <TooltipTrigger as-child>
45
+ <ControlButton>
46
+ <Variable class="text-gray-500 size-5" />
47
+ </ControlButton>
48
+ </TooltipTrigger>
49
+ <TooltipContent>
50
+ <p>Variables</p>
51
+ </TooltipContent>
52
+ </PopoverTrigger>
53
+ <PopoverContent class="w-64">
54
+ <div class="grid gap-4">
55
+ <div>
56
+ <div class="flex items-center justify-between mb-2">
57
+ <div class="flex flex-col gap-1">
58
+ <p class="text-sm font-semibold">
59
+ Global variables
60
+ </p>
61
+ <p class="text-xs text-muted-foreground">Persist data between nodes</p>
62
+ </div>
63
+
64
+ <DropdownMenu>
65
+ <DropdownMenuTrigger as-child>
66
+ <Button size="icon" variant="secondary" class="rounded-full -mr-0.5">
67
+ <Plus class="size-4" />
68
+ </Button>
69
+ </DropdownMenuTrigger>
70
+ <DropdownMenuContent>
71
+ <DropdownMenuItem v-for="option in variableOptions" :key="option.value" @click="addVariable(option.value)">
72
+ <div class="size-6 p-1 rounded flex items-center justify-center" :style="{ backgroundColor: option.tint }">
73
+ <component :is="option.icon" class="text-white" />
74
+ </div>
75
+ {{ option.label }}
76
+ </DropdownMenuItem>
77
+ </DropdownMenuContent>
78
+ </DropdownMenu>
79
+ </div>
80
+
81
+ <div class="flex flex-col gap-2">
82
+ <div v-for="variable in variables" :key="variable.id">
83
+ <div class="flex gap-2 items-center">
84
+ <div class="size-6 p-1 rounded flex items-center justify-center" :style="{ backgroundColor: variableOptions.find(option => option.value === variable.type)?.tint }">
85
+ <component :is="variableOptions.find(option => option.value === variable.type)?.icon" class="text-white" />
86
+ </div>
87
+ <div class="relative w-full group">
88
+ <Input placeholder="Name" v-model="variable.name" :id="`variable_name_${variable.id}`" class="bg-transparent dark:bg-transparent border-transparent hover:border-ring focus:border-ring dark:focus:border-ring shadow-none focus:shadow-xs rounded-xl pr-10" />
89
+ <Button variant="ghost" size="icon" class="absolute right-0 top-0 rounded-xl shadow-none hidden group-hover:flex" @click="openVariableId = openVariableId === variable.id ? null : variable.id">
90
+ <ChevronDown class="size-4 transition-all duration-200" :class="{ 'rotate-180': openVariableId === variable.id }" />
91
+ </Button>
92
+ </div>
93
+ </div>
94
+
95
+ <div class="grid transition-all duration-200" :class="`${openVariableId === variable.id ? 'opacity-100 grid-rows-[1fr]' : 'opacity-0 grid-rows-[0fr]'}`">
96
+ <div class="grid gap-2 overflow-hidden">
97
+ <div class="flex gap-2 items-center justify-between">
98
+ <p class="text-sm font-semibold">
99
+ Type
100
+ </p>
101
+ <DropdownMenu>
102
+ <DropdownMenuTrigger as-child>
103
+ <Button variant="outline" size="sm">
104
+ {{ variableOptions.find(option => option.value === variable.type)?.label }}
105
+ </Button>
106
+ </DropdownMenuTrigger>
107
+ <DropdownMenuContent>
108
+ <DropdownMenuItem v-for="option in variableOptions" :key="option.value" @click="variable.type = option.value">
109
+ {{ option.label }}
110
+ </DropdownMenuItem>
111
+ </DropdownMenuContent>
112
+ </DropdownMenu>
113
+ </div>
114
+
115
+ <div class="flex gap-2 items-center justify-between flex-wrap mb-2">
116
+ <label :for="`variable_default_value_${variable.id}`" class="text-sm font-semibold select-none whitespace-nowrap">
117
+ Default value
118
+ </label>
119
+ <div class="flex items-center gap-2" v-if="variable.type === 'boolean'">
120
+ <Checkbox v-model="variable.defaultValue" class="border-ring" :id="`variable_default_value_${variable.id}`" />
121
+ <Label :for="`variable_default_value_${variable.id}`" class="text-sm font-semibold select-none">
122
+ {{ variable.defaultValue ? 'true' : 'false' }}
123
+ </Label>
124
+ </div>
125
+ <Input placeholder="Default value" v-model="variable.defaultValue" v-else :id="`variable_default_value_${variable.id}`"/>
126
+ </div>
127
+ </div>
128
+ </div>
129
+ </div>
130
+ </div>
131
+
132
+ </div>
133
+ </div>
134
+ </PopoverContent>
135
+ </Popover>
136
+ </Tooltip>
137
+ </template>
@@ -0,0 +1,33 @@
1
+ export const outputRegistry = {
2
+ 'integration-action': {
3
+ success: [
4
+ {
5
+ name: 'result',
6
+ type: '{ success: boolean; data?: any; message?: string }',
7
+ shortType: 'Object'
8
+ }
9
+ ],
10
+ error: [
11
+ {
12
+ name: 'result',
13
+ type: '{ success: false; error: string | { message: string; code?: string }; statusCode?: number }',
14
+ shortType: 'Object'
15
+ }
16
+ ]
17
+ },
18
+ 'transform-data': {
19
+ success: [
20
+ {
21
+ name: 'value',
22
+ type: 'any',
23
+ shortType: 'any'
24
+ }
25
+ ]
26
+ },
27
+ default: {}
28
+ }
29
+
30
+ export function getOutputsForNode(node: any, handleId: string) {
31
+ const type = node.type || 'default'
32
+ return outputRegistry[type]?.[handleId] ?? []
33
+ }
@@ -0,0 +1,185 @@
1
+ import { toast } from 'vue-sonner'
2
+ import { useNuxtApp } from '#imports'
3
+ import { interpolateTemplateFromVariableContext } from '../../../../lib/interpolation'
4
+
5
+ export default {
6
+ 'api-request': async (input, { node }) => {
7
+ try {
8
+ let variables = Object.keys(input).map(key => ({ name: key, value: input[key] }))
9
+
10
+ let url = interpolateTemplateFromVariableContext(node.data.url, variables)
11
+ let method = interpolateTemplateFromVariableContext(node.data.method, variables).toUpperCase()
12
+
13
+ let bodyPairs = node.data.body?.map(pair => ({
14
+ key: interpolateTemplateFromVariableContext(pair.key, variables),
15
+ value: interpolateTemplateFromVariableContext(pair.value, variables),
16
+ })) || []
17
+
18
+ let headersPairs = node.data.headers?.map(pair => ({
19
+ key: interpolateTemplateFromVariableContext(pair.key, variables),
20
+ value: interpolateTemplateFromVariableContext(pair.value, variables),
21
+ })) || []
22
+
23
+ let cookiesPairs = node.data.cookies?.map(pair => ({
24
+ key: interpolateTemplateFromVariableContext(pair.key, variables),
25
+ value: interpolateTemplateFromVariableContext(pair.value, variables),
26
+ })) || []
27
+
28
+ let urlParamPairs = node.data.urlParameters?.map(pair => ({
29
+ key: interpolateTemplateFromVariableContext(pair.key, variables),
30
+ value: interpolateTemplateFromVariableContext(pair.value, variables),
31
+ })) || []
32
+
33
+ // Build query string
34
+ const queryString = urlParamPairs
35
+ .filter(p => p.key)
36
+ .map(p => `${encodeURIComponent(p.key)}=${encodeURIComponent(p.value)}`)
37
+ .join('&')
38
+ const fullUrl = queryString ? `${url}?${queryString}` : url
39
+
40
+ // Build headers
41
+ const headers = {}
42
+ headersPairs.forEach(({ key, value }) => {
43
+ if (key) headers[key] = value
44
+ })
45
+
46
+ // Build cookies
47
+ if (cookiesPairs.length > 0) {
48
+ const cookieHeader = cookiesPairs
49
+ .map(({ key, value }) => `${key}=${value}`)
50
+ .join('; ')
51
+ headers['Cookie'] = cookieHeader
52
+ }
53
+
54
+ // Build body
55
+ let body = null
56
+ if (['POST', 'PUT', 'PATCH'].includes(method)) {
57
+ const bodyObject = {}
58
+ bodyPairs.forEach(({ key, value }) => {
59
+ if (key) bodyObject[key] = value
60
+ })
61
+ body = JSON.stringify(bodyObject)
62
+ headers['Content-Type'] ||= 'application/json'
63
+ }
64
+
65
+ // Make request
66
+ const res = await fetch(fullUrl, {
67
+ method,
68
+ headers,
69
+ body,
70
+ credentials: 'include', // includes cookies if any
71
+ })
72
+
73
+ if (res.status >= 400) {
74
+ return { result: { success: false, status: res.status } }
75
+ }
76
+
77
+ // Try to parse response
78
+ let result
79
+ const contentType = res.headers.get('content-type')
80
+ if (contentType?.includes('application/json')) {
81
+ result = await res.json()
82
+ } else {
83
+ result = await res.text()
84
+ }
85
+
86
+ return { result: { success: true, data: result, status: res.status } }
87
+ } catch (error) {
88
+ return { result: { success: false, status: error.status || 500 } }
89
+ }
90
+ },
91
+ 'integration-action': async (input, { node }) => {
92
+ const { fireAction } = useIntegrationActions(node.data.action.integration)
93
+ let res = await fireAction(node.data.action, input)
94
+ return { result: res }
95
+ },
96
+ 'show-toast': async (input, { node }) => {
97
+ console.log('Show toast', input, node)
98
+ let variables = Object.keys(input).map(key => ({ name: key, value: input[key] }))
99
+ let title = interpolateTemplateFromVariableContext(node.data.title, variables)
100
+ let description = interpolateTemplateFromVariableContext(node.data.message, variables)
101
+ toast(title, { description })
102
+ return { shown: true }
103
+ },
104
+ 'finish-flow': async (input, { node, onFinish }) => {
105
+ if (node.data.returnData) {
106
+ let returnValue = sandbox(node.data.transform, input)
107
+ onFinish(returnValue)
108
+ } else {
109
+ onFinish()
110
+ }
111
+ return { finished: true }
112
+ },
113
+ 'confetti': async (input, { node }) => {
114
+ const { $confetti } = useNuxtApp()
115
+ $confetti()
116
+ return { confetti: true }
117
+ },
118
+ 'confirm': async (input, { node }) => {
119
+ const { confirm } = useConfirmation()
120
+ if (confirm) {
121
+ let variables = Object.keys(input).map(key => ({ name: key, value: input[key] }))
122
+ let title = interpolateTemplateFromVariableContext(node.data.title, variables)
123
+ let message = interpolateTemplateFromVariableContext(node.data.message, variables)
124
+ let confirmText = interpolateTemplateFromVariableContext(node.data.confirmText, variables)
125
+ const confirmed = await confirm(message, title, confirmText)
126
+ return { confirmed }
127
+ }
128
+ return { confirmed: false }
129
+ },
130
+ 'set-variable': async (input, { node, localVariables }) => {
131
+ console.log('Set variable', input, node, localVariables)
132
+ let variables = Object.keys(input).map(key => ({ name: key, value: input[key] }))
133
+
134
+ for (const action of node.data.updateActions ?? []) {
135
+ const variable = localVariables.value.find(v => v.id === action.variableId)
136
+ if (variable) {
137
+ variable.value = interpolateTemplateFromVariableContext(action.value, variables)
138
+ }
139
+ }
140
+
141
+ return { set: true }
142
+ },
143
+ 'transform-data': async (input, { node }) => {
144
+ let transformedValue = sandbox(node.data.transform, input)
145
+ return { transformed: true, value: transformedValue }
146
+ },
147
+ 'visit-url': async (input, { node }) => {
148
+ let variables = Object.keys(input).map(key => ({ name: key, value: input[key] }))
149
+ let url = interpolateTemplateFromVariableContext(node.data.url, variables)
150
+
151
+ if (node.data.newTab) {
152
+ window.open(url, '_blank')
153
+ } else {
154
+ window.location.href = url
155
+ }
156
+ return { visited: true }
157
+ },
158
+ 'show-dialog': async (input, { node }) => {
159
+ const { openCustomDialog } = useCustomDialog()
160
+ let variables = Object.keys(input).map(key => ({ name: key, value: input[key] }))
161
+ const result = await openCustomDialog(node.data.layout, variables)
162
+ console.log('Dialog result', result)
163
+ return result
164
+ },
165
+ 'show-module': async (input, { node }) => {
166
+ console.log('Show module', input, node)
167
+ const { openInOverlay } = useModuleOverlay()
168
+ let variables = Object.keys(input).map(key => ({ name: key, value: input[key] }))
169
+ const params = {};
170
+ node.data.moduleData?.forEach((d) => {
171
+ params[interpolateTemplateFromVariableContext(d.key, variables)] = interpolateTemplateFromVariableContext(d.value, variables)
172
+ })
173
+ openInOverlay(node.data.moduleId, params)
174
+ return { shown: true }
175
+ }
176
+ }
177
+
178
+
179
+ const sandbox = (code, args = {}) => {
180
+ var frame = document.createElement('iframe');
181
+ document.body.appendChild(frame);
182
+ var F = frame.contentWindow.Function;
183
+ document.body.removeChild(frame);
184
+ return F(...Object.keys(args), "'use strict';" + code)(...Object.values(args));
185
+ }
@@ -0,0 +1,60 @@
1
+ import dagre from '@dagrejs/dagre'
2
+ import { Position, useVueFlow } from '@vue-flow/core'
3
+ import { ref } from 'vue'
4
+ import { Graph as GraphlibGraph } from 'graphlib'
5
+
6
+ export function useLayout() {
7
+ const { findNode } = useVueFlow()
8
+
9
+ // 🟦 This is the logical graph for process traversal
10
+ const graph = ref(new GraphlibGraph({ directed: true }))
11
+
12
+ /**
13
+ * Layout the nodes visually using Dagre, and update graph traversal DAG
14
+ */
15
+ function layout(nodes, edges, direction = 'TB') {
16
+ const dagreGraph = new dagre.graphlib.Graph()
17
+ dagreGraph.setDefaultEdgeLabel(() => ({}))
18
+ dagreGraph.setGraph({ rankdir: direction })
19
+
20
+ const isHorizontal = direction === 'LR'
21
+
22
+ // layout graph nodes
23
+ for (const node of nodes) {
24
+ const graphNode = findNode(node.id)
25
+ dagreGraph.setNode(node.id, {
26
+ width: graphNode?.dimensions.width || 150,
27
+ height: graphNode?.dimensions.height || 50,
28
+ })
29
+ }
30
+
31
+ for (const edge of edges) {
32
+ dagreGraph.setEdge(edge.source, edge.target)
33
+ }
34
+
35
+ // 💥 Update visual layout
36
+ dagre.layout(dagreGraph)
37
+
38
+ // ✅ Rebuild process traversal graph (separate)
39
+ const traversalGraph = new GraphlibGraph({ directed: true })
40
+ for (const node of nodes) {
41
+ traversalGraph.setNode(node.id)
42
+ }
43
+ for (const edge of edges) {
44
+ traversalGraph.setEdge(edge.source, edge.target)
45
+ }
46
+ graph.value = traversalGraph // ← used in useRunProcess()
47
+
48
+ return nodes.map((node) => {
49
+ const pos = dagreGraph.node(node.id)
50
+ return {
51
+ ...node,
52
+ targetPosition: isHorizontal ? Position.Left : Position.Top,
53
+ sourcePosition: isHorizontal ? Position.Right : Position.Bottom,
54
+ position: { x: pos.x, y: pos.y },
55
+ }
56
+ })
57
+ }
58
+
59
+ return { graph, layout }
60
+ }