@motiadev/workbench 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 +50 -0
- package/components.json +21 -0
- package/dist/.empty +0 -0
- package/dist/assets/index-DGmArPOa.css +1 -0
- package/dist/assets/index-hQsWtfVb.js +182 -0
- package/dist/index.html +20 -0
- package/eslint.config.js +28 -0
- package/index.html +19 -0
- package/index.tsx +10 -0
- package/middleware.ts +46 -0
- package/package.json +56 -0
- package/postcss.config.js +6 -0
- package/public/.empty +0 -0
- package/src/assets/.empty +0 -0
- package/src/components/app-sidebar.tsx +55 -0
- package/src/components/log-console.tsx +76 -0
- package/src/components/log-level-badge.tsx +12 -0
- package/src/components/ui/badge.tsx +31 -0
- package/src/components/ui/button.tsx +47 -0
- package/src/components/ui/collapsible.tsx +9 -0
- package/src/components/ui/dialog.tsx +120 -0
- package/src/components/ui/input.tsx +21 -0
- package/src/components/ui/label.tsx +26 -0
- package/src/components/ui/select.tsx +157 -0
- package/src/components/ui/separator.tsx +22 -0
- package/src/components/ui/sheet.tsx +106 -0
- package/src/components/ui/sidebar.tsx +637 -0
- package/src/components/ui/skeleton.tsx +7 -0
- package/src/components/ui/switch.tsx +27 -0
- package/src/components/ui/table.tsx +76 -0
- package/src/components/ui/textarea.tsx +22 -0
- package/src/components/ui/tooltip.tsx +32 -0
- package/src/hooks/use-list-flows.tsx +20 -0
- package/src/hooks/use-log-listener.tsx +32 -0
- package/src/hooks/use-mobile.tsx +19 -0
- package/src/index.css +190 -0
- package/src/lib/utils.ts +6 -0
- package/src/main.tsx +28 -0
- package/src/publicComponents/api-node.tsx +28 -0
- package/src/publicComponents/base-handle.tsx +43 -0
- package/src/publicComponents/base-node.tsx +57 -0
- package/src/publicComponents/emits.tsx +22 -0
- package/src/publicComponents/event-node.tsx +36 -0
- package/src/publicComponents/node-props.tsx +15 -0
- package/src/publicComponents/noop-node.tsx +21 -0
- package/src/publicComponents/subscribe.tsx +19 -0
- package/src/route-wrapper.tsx +9 -0
- package/src/routeTree.gen.ts +109 -0
- package/src/routes/__root.tsx +26 -0
- package/src/routes/flow/$id.tsx +21 -0
- package/src/routes/index.tsx +13 -0
- package/src/stores/use-logs.ts +22 -0
- package/src/views/flow/arrow-head.tsx +13 -0
- package/src/views/flow/base-edge.tsx +44 -0
- package/src/views/flow/flow-loader.tsx +3 -0
- package/src/views/flow/flow-view.tsx +72 -0
- package/src/views/flow/hooks/use-get-flow-state.tsx +109 -0
- package/src/views/flow/hooks/use-organize-nodes.ts +60 -0
- package/src/views/flow/legend.tsx +59 -0
- package/src/views/flow/node-organizer.tsx +70 -0
- package/src/views/flow/nodes/api-flow-node.tsx +6 -0
- package/src/views/flow/nodes/event-flow-node.tsx +6 -0
- package/src/views/flow/nodes/json-schema-form.tsx +110 -0
- package/src/views/flow/nodes/language-indicator.tsx +74 -0
- package/src/views/flow/nodes/nodes.types.ts +36 -0
- package/src/views/flow/nodes/noop-flow-node.tsx +6 -0
- package/src/vite-env.d.ts +1 -0
- package/tailwind.config.ts +75 -0
- package/tsconfig.app.json +30 -0
- package/tsconfig.json +13 -0
- package/tsconfig.node.json +22 -0
- package/tsconfig.node.tsbuildinfo +1 -0
- package/vite.config.ts +14 -0
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
import * as React from "react"
|
|
2
|
+
import * as SelectPrimitive from "@radix-ui/react-select"
|
|
3
|
+
import { Check, ChevronDown, ChevronUp } from "lucide-react"
|
|
4
|
+
|
|
5
|
+
import { cn } from "@/lib/utils"
|
|
6
|
+
|
|
7
|
+
const Select = SelectPrimitive.Root
|
|
8
|
+
|
|
9
|
+
const SelectGroup = SelectPrimitive.Group
|
|
10
|
+
|
|
11
|
+
const SelectValue = SelectPrimitive.Value
|
|
12
|
+
|
|
13
|
+
const SelectTrigger = React.forwardRef<
|
|
14
|
+
React.ElementRef<typeof SelectPrimitive.Trigger>,
|
|
15
|
+
React.ComponentPropsWithoutRef<typeof SelectPrimitive.Trigger>
|
|
16
|
+
>(({ className, children, ...props }, ref) => (
|
|
17
|
+
<SelectPrimitive.Trigger
|
|
18
|
+
ref={ref}
|
|
19
|
+
className={cn(
|
|
20
|
+
"flex h-9 w-full items-center justify-between whitespace-nowrap rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",
|
|
21
|
+
className
|
|
22
|
+
)}
|
|
23
|
+
{...props}
|
|
24
|
+
>
|
|
25
|
+
{children}
|
|
26
|
+
<SelectPrimitive.Icon asChild>
|
|
27
|
+
<ChevronDown className="h-4 w-4 opacity-50" />
|
|
28
|
+
</SelectPrimitive.Icon>
|
|
29
|
+
</SelectPrimitive.Trigger>
|
|
30
|
+
))
|
|
31
|
+
SelectTrigger.displayName = SelectPrimitive.Trigger.displayName
|
|
32
|
+
|
|
33
|
+
const SelectScrollUpButton = React.forwardRef<
|
|
34
|
+
React.ElementRef<typeof SelectPrimitive.ScrollUpButton>,
|
|
35
|
+
React.ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollUpButton>
|
|
36
|
+
>(({ className, ...props }, ref) => (
|
|
37
|
+
<SelectPrimitive.ScrollUpButton
|
|
38
|
+
ref={ref}
|
|
39
|
+
className={cn(
|
|
40
|
+
"flex cursor-default items-center justify-center py-1",
|
|
41
|
+
className
|
|
42
|
+
)}
|
|
43
|
+
{...props}
|
|
44
|
+
>
|
|
45
|
+
<ChevronUp className="h-4 w-4" />
|
|
46
|
+
</SelectPrimitive.ScrollUpButton>
|
|
47
|
+
))
|
|
48
|
+
SelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName
|
|
49
|
+
|
|
50
|
+
const SelectScrollDownButton = React.forwardRef<
|
|
51
|
+
React.ElementRef<typeof SelectPrimitive.ScrollDownButton>,
|
|
52
|
+
React.ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollDownButton>
|
|
53
|
+
>(({ className, ...props }, ref) => (
|
|
54
|
+
<SelectPrimitive.ScrollDownButton
|
|
55
|
+
ref={ref}
|
|
56
|
+
className={cn(
|
|
57
|
+
"flex cursor-default items-center justify-center py-1",
|
|
58
|
+
className
|
|
59
|
+
)}
|
|
60
|
+
{...props}
|
|
61
|
+
>
|
|
62
|
+
<ChevronDown className="h-4 w-4" />
|
|
63
|
+
</SelectPrimitive.ScrollDownButton>
|
|
64
|
+
))
|
|
65
|
+
SelectScrollDownButton.displayName =
|
|
66
|
+
SelectPrimitive.ScrollDownButton.displayName
|
|
67
|
+
|
|
68
|
+
const SelectContent = React.forwardRef<
|
|
69
|
+
React.ElementRef<typeof SelectPrimitive.Content>,
|
|
70
|
+
React.ComponentPropsWithoutRef<typeof SelectPrimitive.Content>
|
|
71
|
+
>(({ className, children, position = "popper", ...props }, ref) => (
|
|
72
|
+
<SelectPrimitive.Portal>
|
|
73
|
+
<SelectPrimitive.Content
|
|
74
|
+
ref={ref}
|
|
75
|
+
className={cn(
|
|
76
|
+
"relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
|
|
77
|
+
position === "popper" &&
|
|
78
|
+
"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",
|
|
79
|
+
className
|
|
80
|
+
)}
|
|
81
|
+
position={position}
|
|
82
|
+
{...props}
|
|
83
|
+
>
|
|
84
|
+
<SelectScrollUpButton />
|
|
85
|
+
<SelectPrimitive.Viewport
|
|
86
|
+
className={cn(
|
|
87
|
+
"p-1",
|
|
88
|
+
position === "popper" &&
|
|
89
|
+
"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"
|
|
90
|
+
)}
|
|
91
|
+
>
|
|
92
|
+
{children}
|
|
93
|
+
</SelectPrimitive.Viewport>
|
|
94
|
+
<SelectScrollDownButton />
|
|
95
|
+
</SelectPrimitive.Content>
|
|
96
|
+
</SelectPrimitive.Portal>
|
|
97
|
+
))
|
|
98
|
+
SelectContent.displayName = SelectPrimitive.Content.displayName
|
|
99
|
+
|
|
100
|
+
const SelectLabel = React.forwardRef<
|
|
101
|
+
React.ElementRef<typeof SelectPrimitive.Label>,
|
|
102
|
+
React.ComponentPropsWithoutRef<typeof SelectPrimitive.Label>
|
|
103
|
+
>(({ className, ...props }, ref) => (
|
|
104
|
+
<SelectPrimitive.Label
|
|
105
|
+
ref={ref}
|
|
106
|
+
className={cn("px-2 py-1.5 text-sm font-semibold", className)}
|
|
107
|
+
{...props}
|
|
108
|
+
/>
|
|
109
|
+
))
|
|
110
|
+
SelectLabel.displayName = SelectPrimitive.Label.displayName
|
|
111
|
+
|
|
112
|
+
const SelectItem = React.forwardRef<
|
|
113
|
+
React.ElementRef<typeof SelectPrimitive.Item>,
|
|
114
|
+
React.ComponentPropsWithoutRef<typeof SelectPrimitive.Item>
|
|
115
|
+
>(({ className, children, ...props }, ref) => (
|
|
116
|
+
<SelectPrimitive.Item
|
|
117
|
+
ref={ref}
|
|
118
|
+
className={cn(
|
|
119
|
+
"relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
120
|
+
className
|
|
121
|
+
)}
|
|
122
|
+
{...props}
|
|
123
|
+
>
|
|
124
|
+
<span className="absolute right-2 flex h-3.5 w-3.5 items-center justify-center">
|
|
125
|
+
<SelectPrimitive.ItemIndicator>
|
|
126
|
+
<Check className="h-4 w-4" />
|
|
127
|
+
</SelectPrimitive.ItemIndicator>
|
|
128
|
+
</span>
|
|
129
|
+
<SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>
|
|
130
|
+
</SelectPrimitive.Item>
|
|
131
|
+
))
|
|
132
|
+
SelectItem.displayName = SelectPrimitive.Item.displayName
|
|
133
|
+
|
|
134
|
+
const SelectSeparator = React.forwardRef<
|
|
135
|
+
React.ElementRef<typeof SelectPrimitive.Separator>,
|
|
136
|
+
React.ComponentPropsWithoutRef<typeof SelectPrimitive.Separator>
|
|
137
|
+
>(({ className, ...props }, ref) => (
|
|
138
|
+
<SelectPrimitive.Separator
|
|
139
|
+
ref={ref}
|
|
140
|
+
className={cn("-mx-1 my-1 h-px bg-muted", className)}
|
|
141
|
+
{...props}
|
|
142
|
+
/>
|
|
143
|
+
))
|
|
144
|
+
SelectSeparator.displayName = SelectPrimitive.Separator.displayName
|
|
145
|
+
|
|
146
|
+
export {
|
|
147
|
+
Select,
|
|
148
|
+
SelectGroup,
|
|
149
|
+
SelectValue,
|
|
150
|
+
SelectTrigger,
|
|
151
|
+
SelectContent,
|
|
152
|
+
SelectLabel,
|
|
153
|
+
SelectItem,
|
|
154
|
+
SelectSeparator,
|
|
155
|
+
SelectScrollUpButton,
|
|
156
|
+
SelectScrollDownButton,
|
|
157
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
|
|
3
|
+
import * as React from 'react'
|
|
4
|
+
import * as SeparatorPrimitive from '@radix-ui/react-separator'
|
|
5
|
+
|
|
6
|
+
import { cn } from '@/lib/utils'
|
|
7
|
+
|
|
8
|
+
const Separator = React.forwardRef<
|
|
9
|
+
React.ElementRef<typeof SeparatorPrimitive.Root>,
|
|
10
|
+
React.ComponentPropsWithoutRef<typeof SeparatorPrimitive.Root>
|
|
11
|
+
>(({ className, orientation = 'horizontal', decorative = true, ...props }, ref) => (
|
|
12
|
+
<SeparatorPrimitive.Root
|
|
13
|
+
ref={ref}
|
|
14
|
+
decorative={decorative}
|
|
15
|
+
orientation={orientation}
|
|
16
|
+
className={cn('shrink-0 bg-border', orientation === 'horizontal' ? 'h-[1px] w-full' : 'h-full w-[1px]', className)}
|
|
17
|
+
{...props}
|
|
18
|
+
/>
|
|
19
|
+
))
|
|
20
|
+
Separator.displayName = SeparatorPrimitive.Root.displayName
|
|
21
|
+
|
|
22
|
+
export { Separator }
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import * as React from 'react'
|
|
2
|
+
import * as SheetPrimitive from '@radix-ui/react-dialog'
|
|
3
|
+
import { cva, type VariantProps } from 'class-variance-authority'
|
|
4
|
+
import { X } from 'lucide-react'
|
|
5
|
+
import { cn } from '@/lib/utils'
|
|
6
|
+
|
|
7
|
+
const Sheet = SheetPrimitive.Root
|
|
8
|
+
|
|
9
|
+
const SheetTrigger = SheetPrimitive.Trigger
|
|
10
|
+
|
|
11
|
+
const SheetClose = SheetPrimitive.Close
|
|
12
|
+
|
|
13
|
+
const SheetPortal = SheetPrimitive.Portal
|
|
14
|
+
|
|
15
|
+
const SheetOverlay = React.forwardRef<
|
|
16
|
+
React.ElementRef<typeof SheetPrimitive.Overlay>,
|
|
17
|
+
React.ComponentPropsWithoutRef<typeof SheetPrimitive.Overlay>
|
|
18
|
+
>(({ className, ...props }, ref) => (
|
|
19
|
+
<SheetPrimitive.Overlay
|
|
20
|
+
className={cn(
|
|
21
|
+
'fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0',
|
|
22
|
+
className,
|
|
23
|
+
)}
|
|
24
|
+
{...props}
|
|
25
|
+
ref={ref}
|
|
26
|
+
/>
|
|
27
|
+
))
|
|
28
|
+
SheetOverlay.displayName = SheetPrimitive.Overlay.displayName
|
|
29
|
+
|
|
30
|
+
const sheetVariants = cva(
|
|
31
|
+
'fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500 data-[state=open]:animate-in data-[state=closed]:animate-out',
|
|
32
|
+
{
|
|
33
|
+
variants: {
|
|
34
|
+
side: {
|
|
35
|
+
top: 'inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top',
|
|
36
|
+
bottom:
|
|
37
|
+
'inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom',
|
|
38
|
+
left: 'inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm',
|
|
39
|
+
right:
|
|
40
|
+
'inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm',
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
defaultVariants: {
|
|
44
|
+
side: 'right',
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
)
|
|
48
|
+
|
|
49
|
+
interface SheetContentProps
|
|
50
|
+
extends React.ComponentPropsWithoutRef<typeof SheetPrimitive.Content>,
|
|
51
|
+
VariantProps<typeof sheetVariants> {}
|
|
52
|
+
|
|
53
|
+
const SheetContent = React.forwardRef<React.ElementRef<typeof SheetPrimitive.Content>, SheetContentProps>(
|
|
54
|
+
({ side = 'right', className, children, ...props }, ref) => (
|
|
55
|
+
<SheetPortal>
|
|
56
|
+
<SheetOverlay />
|
|
57
|
+
<SheetPrimitive.Content ref={ref} className={cn(sheetVariants({ side }), className)} {...props}>
|
|
58
|
+
<SheetPrimitive.Close className="absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary">
|
|
59
|
+
<X className="h-4 w-4" />
|
|
60
|
+
<span className="sr-only">Close</span>
|
|
61
|
+
</SheetPrimitive.Close>
|
|
62
|
+
{children}
|
|
63
|
+
</SheetPrimitive.Content>
|
|
64
|
+
</SheetPortal>
|
|
65
|
+
),
|
|
66
|
+
)
|
|
67
|
+
SheetContent.displayName = SheetPrimitive.Content.displayName
|
|
68
|
+
|
|
69
|
+
const SheetHeader = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (
|
|
70
|
+
<div className={cn('flex flex-col space-y-2 text-center sm:text-left', className)} {...props} />
|
|
71
|
+
)
|
|
72
|
+
SheetHeader.displayName = 'SheetHeader'
|
|
73
|
+
|
|
74
|
+
const SheetFooter = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (
|
|
75
|
+
<div className={cn('flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2', className)} {...props} />
|
|
76
|
+
)
|
|
77
|
+
SheetFooter.displayName = 'SheetFooter'
|
|
78
|
+
|
|
79
|
+
const SheetTitle = React.forwardRef<
|
|
80
|
+
React.ElementRef<typeof SheetPrimitive.Title>,
|
|
81
|
+
React.ComponentPropsWithoutRef<typeof SheetPrimitive.Title>
|
|
82
|
+
>(({ className, ...props }, ref) => (
|
|
83
|
+
<SheetPrimitive.Title ref={ref} className={cn('text-lg font-semibold text-foreground', className)} {...props} />
|
|
84
|
+
))
|
|
85
|
+
SheetTitle.displayName = SheetPrimitive.Title.displayName
|
|
86
|
+
|
|
87
|
+
const SheetDescription = React.forwardRef<
|
|
88
|
+
React.ElementRef<typeof SheetPrimitive.Description>,
|
|
89
|
+
React.ComponentPropsWithoutRef<typeof SheetPrimitive.Description>
|
|
90
|
+
>(({ className, ...props }, ref) => (
|
|
91
|
+
<SheetPrimitive.Description ref={ref} className={cn('text-sm text-muted-foreground', className)} {...props} />
|
|
92
|
+
))
|
|
93
|
+
SheetDescription.displayName = SheetPrimitive.Description.displayName
|
|
94
|
+
|
|
95
|
+
export {
|
|
96
|
+
Sheet,
|
|
97
|
+
SheetPortal,
|
|
98
|
+
SheetOverlay,
|
|
99
|
+
SheetTrigger,
|
|
100
|
+
SheetClose,
|
|
101
|
+
SheetContent,
|
|
102
|
+
SheetHeader,
|
|
103
|
+
SheetFooter,
|
|
104
|
+
SheetTitle,
|
|
105
|
+
SheetDescription,
|
|
106
|
+
}
|