@motiadev/workbench 0.3.1-beta.86 → 0.3.1-beta.88-406962

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 (220) hide show
  1. package/dist/index.d.ts +3 -4
  2. package/dist/index.html +3 -2
  3. package/dist/index.js +2 -3
  4. package/dist/public/icon.png +0 -0
  5. package/dist/public/motia-dark.png +0 -0
  6. package/dist/public/motia-light.png +0 -0
  7. package/dist/src/App.d.ts +2 -0
  8. package/dist/src/App.js +19 -0
  9. package/dist/src/components/endpoints/endpoint-badge.d.ts +1 -1
  10. package/dist/src/components/endpoints/endpoint-badge.js +8 -8
  11. package/dist/src/components/endpoints/endpoint-call.d.ts +3 -3
  12. package/dist/src/components/endpoints/endpoint-call.js +28 -23
  13. package/dist/src/components/endpoints/endpoint-response-schema.d.ts +10 -0
  14. package/dist/src/components/endpoints/endpoint-response-schema.js +17 -0
  15. package/dist/src/components/endpoints/endpoint-response.d.ts +8 -0
  16. package/dist/src/components/endpoints/endpoint-response.js +39 -0
  17. package/dist/src/components/endpoints/endpoints-page.js +14 -0
  18. package/dist/src/components/endpoints/hooks/use-get-endpoints.d.ts +1 -15
  19. package/dist/src/components/endpoints/json-editor.d.ts +9 -0
  20. package/dist/src/components/endpoints/json-editor.js +31 -0
  21. package/dist/src/components/flow/flow-page.d.ts +1 -0
  22. package/dist/src/components/flow/flow-page.js +20 -0
  23. package/dist/src/components/flow/flow-tab-menu-item.d.ts +1 -0
  24. package/dist/src/components/flow/flow-tab-menu-item.js +15 -0
  25. package/dist/src/{views → components}/flow/flow-view.d.ts +1 -2
  26. package/dist/src/components/flow/flow-view.js +21 -0
  27. package/dist/src/components/flow/hooks/use-get-flow-state.d.ts +10 -0
  28. package/dist/src/{views → components}/flow/hooks/use-get-flow-state.js +17 -10
  29. package/dist/src/{views → components}/flow/hooks/use-organize-nodes.d.ts +1 -1
  30. package/dist/src/{views → components}/flow/hooks/use-save-workflow-config.d.ts +1 -1
  31. package/dist/src/components/flow/nodes/api-flow-node.d.ts +2 -0
  32. package/dist/src/{views → components}/flow/nodes/api-flow-node.js +1 -1
  33. package/dist/src/components/flow/nodes/cron-flow-node.d.ts +2 -0
  34. package/dist/src/components/flow/nodes/cron-flow-node.js +5 -0
  35. package/dist/src/{views → components}/flow/nodes/event-flow-node.d.ts +1 -1
  36. package/dist/src/components/flow/nodes/event-flow-node.js +5 -0
  37. package/dist/src/components/flow/nodes/noop-flow-node.d.ts +2 -0
  38. package/dist/src/{views → components}/flow/nodes/noop-flow-node.js +1 -1
  39. package/dist/src/components/header/header.js +3 -11
  40. package/dist/src/components/logs/log-detail.d.ts +3 -1
  41. package/dist/src/components/logs/log-detail.js +33 -11
  42. package/dist/src/components/logs/log-level-badge.js +6 -6
  43. package/dist/src/components/logs/log-level-dot.js +7 -7
  44. package/dist/src/components/logs/logs-page.js +26 -0
  45. package/dist/src/components/observability/events/code/function-call.js +1 -1
  46. package/dist/src/components/observability/events/trace-event.d.ts +1 -1
  47. package/dist/src/components/observability/events/trace-log-event.d.ts +1 -1
  48. package/dist/src/components/observability/events/trace-log-event.js +2 -2
  49. package/dist/src/components/observability/hooks/use-get-endtime.d.ts +1 -1
  50. package/dist/src/components/observability/trace-item/trace-item-detail.d.ts +1 -0
  51. package/dist/src/components/observability/trace-item/trace-item-detail.js +5 -4
  52. package/dist/src/components/observability/trace-item/trace-item.d.ts +1 -0
  53. package/dist/src/components/observability/trace-item/trace-item.js +11 -17
  54. package/dist/src/components/observability/trace-status.d.ts +6 -10
  55. package/dist/src/components/observability/trace-status.js +7 -32
  56. package/dist/src/components/observability/trace-timeline.js +16 -4
  57. package/dist/src/components/observability/traces-groups.d.ts +2 -2
  58. package/dist/src/components/observability/traces-groups.js +4 -4
  59. package/dist/src/components/observability/traces-page.js +12 -0
  60. package/dist/src/components/sidebar/sidebar.d.ts +8 -0
  61. package/dist/src/components/sidebar/sidebar.js +39 -0
  62. package/dist/src/components/states/hooks/states-hooks.d.ts +7 -3
  63. package/dist/src/components/states/hooks/states-hooks.js +5 -33
  64. package/dist/src/components/states/state-detail.d.ts +2 -1
  65. package/dist/src/components/states/state-detail.js +15 -9
  66. package/dist/src/components/states/state-value.js +7 -7
  67. package/dist/src/components/states/states-page.js +18 -0
  68. package/dist/src/components/ui/badge.d.ts +1 -1
  69. package/dist/src/components/ui/table.js +1 -1
  70. package/dist/src/components/ui/theme-toggle.js +4 -3
  71. package/dist/src/hooks/use-fetch-flows.d.ts +1 -5
  72. package/dist/src/hooks/use-fetch-flows.js +18 -13
  73. package/dist/src/hooks/use-log-listener.js +2 -2
  74. package/dist/src/hooks/use-update-handle-positions.d.ts +10 -0
  75. package/dist/src/hooks/use-update-handle-positions.js +35 -0
  76. package/dist/src/index.css +36 -176
  77. package/dist/src/lib/utils.d.ts +1 -0
  78. package/dist/src/lib/utils.js +4 -0
  79. package/dist/src/main.d.ts +1 -0
  80. package/dist/src/main.js +4 -11
  81. package/dist/src/publicComponents/api-node.js +2 -4
  82. package/dist/src/publicComponents/{base-handle.d.ts → base-node/base-handle.d.ts} +1 -0
  83. package/dist/src/publicComponents/base-node/base-handle.js +8 -0
  84. package/dist/src/publicComponents/base-node/base-node.d.ts +21 -0
  85. package/dist/src/publicComponents/base-node/base-node.js +13 -0
  86. package/dist/src/publicComponents/{emits.d.ts → base-node/emits.d.ts} +1 -1
  87. package/dist/src/publicComponents/base-node/emits.js +5 -0
  88. package/dist/src/{views/flow/nodes → publicComponents/base-node}/language-indicator.d.ts +1 -1
  89. package/dist/src/{views/flow/nodes → publicComponents/base-node}/language-indicator.js +8 -7
  90. package/dist/src/publicComponents/base-node/node-header.d.ts +12 -0
  91. package/dist/src/publicComponents/base-node/node-header.js +30 -0
  92. package/dist/src/publicComponents/base-node/node-sidebar.d.ts +18 -0
  93. package/dist/src/publicComponents/base-node/node-sidebar.js +20 -0
  94. package/dist/src/publicComponents/base-node/subscribe.js +4 -0
  95. package/dist/src/publicComponents/cron-node.d.ts +2 -1
  96. package/dist/src/publicComponents/cron-node.js +3 -4
  97. package/dist/src/publicComponents/event-node.d.ts +1 -5
  98. package/dist/src/publicComponents/event-node.js +4 -6
  99. package/dist/src/publicComponents/node-details.js +21 -12
  100. package/dist/src/publicComponents/node-props.d.ts +13 -6
  101. package/dist/src/publicComponents/noop-node.d.ts +3 -7
  102. package/dist/src/publicComponents/noop-node.js +3 -3
  103. package/dist/src/stores/use-flow-store.d.ts +18 -0
  104. package/dist/src/stores/use-flow-store.js +15 -0
  105. package/dist/src/stores/use-global-store.d.ts +24 -0
  106. package/dist/src/stores/use-global-store.js +20 -0
  107. package/dist/src/stores/{use-logs.d.ts → use-logs-store.d.ts} +1 -3
  108. package/dist/src/stores/use-logs-store.js +10 -0
  109. package/dist/src/stores/use-tabs-store.d.ts +17 -0
  110. package/dist/src/stores/use-tabs-store.js +13 -0
  111. package/dist/src/stores/use-theme-store.d.ts +17 -0
  112. package/dist/src/stores/use-theme-store.js +26 -0
  113. package/dist/src/types/endpoint.d.ts +14 -0
  114. package/dist/src/{views/flow/nodes/nodes.types.d.ts → types/flow.d.ts} +45 -0
  115. package/dist/src/types/flow.js +1 -0
  116. package/dist/tsconfig.app.tsbuildinfo +1 -1
  117. package/dist/tsconfig.node.tsbuildinfo +1 -1
  118. package/package.json +28 -26
  119. package/dist/public/.empty +0 -0
  120. package/dist/src/components/app-sidebar.d.ts +0 -1
  121. package/dist/src/components/app-sidebar.js +0 -12
  122. package/dist/src/components/endpoints/endpoints.d.ts +0 -1
  123. package/dist/src/components/endpoints/endpoints.js +0 -34
  124. package/dist/src/components/endpoints/selected-endpoint.d.ts +0 -7
  125. package/dist/src/components/endpoints/selected-endpoint.js +0 -7
  126. package/dist/src/components/logs/log-console.d.ts +0 -1
  127. package/dist/src/components/logs/log-console.js +0 -69
  128. package/dist/src/components/logs/log-field.d.ts +0 -7
  129. package/dist/src/components/logs/log-field.js +0 -20
  130. package/dist/src/components/logs/logs.d.ts +0 -1
  131. package/dist/src/components/logs/logs.js +0 -18
  132. package/dist/src/components/observability/observability-stats.d.ts +0 -5
  133. package/dist/src/components/observability/observability-stats.js +0 -17
  134. package/dist/src/components/states/states.d.ts +0 -1
  135. package/dist/src/components/states/states.js +0 -21
  136. package/dist/src/components/ui/BadgeCount.d.ts +0 -7
  137. package/dist/src/components/ui/BadgeCount.js +0 -13
  138. package/dist/src/components/ui/button.d.ts +0 -11
  139. package/dist/src/components/ui/button.js +0 -33
  140. package/dist/src/components/ui/card.d.ts +0 -8
  141. package/dist/src/components/ui/card.js +0 -16
  142. package/dist/src/components/ui/collapsible.d.ts +0 -5
  143. package/dist/src/components/ui/collapsible.js +0 -5
  144. package/dist/src/components/ui/dialog.d.ts +0 -19
  145. package/dist/src/components/ui/dialog.js +0 -22
  146. package/dist/src/components/ui/dropdown-menu.d.ts +0 -25
  147. package/dist/src/components/ui/dropdown-menu.js +0 -50
  148. package/dist/src/components/ui/input.d.ts +0 -3
  149. package/dist/src/components/ui/input.js +0 -8
  150. package/dist/src/components/ui/logo-icon.d.ts +0 -5
  151. package/dist/src/components/ui/logo-icon.js +0 -5
  152. package/dist/src/components/ui/navigation-menu.d.ts +0 -13
  153. package/dist/src/components/ui/navigation-menu.js +0 -30
  154. package/dist/src/components/ui/scroll-area.d.ts +0 -5
  155. package/dist/src/components/ui/scroll-area.js +0 -9
  156. package/dist/src/components/ui/select.d.ts +0 -13
  157. package/dist/src/components/ui/select.js +0 -25
  158. package/dist/src/components/ui/separator.d.ts +0 -4
  159. package/dist/src/components/ui/separator.js +0 -8
  160. package/dist/src/components/ui/sheet.d.ts +0 -25
  161. package/dist/src/components/ui/sheet.js +0 -36
  162. package/dist/src/components/ui/sidebar.d.ts +0 -12
  163. package/dist/src/components/ui/sidebar.js +0 -25
  164. package/dist/src/components/ui/skeleton.d.ts +0 -3
  165. package/dist/src/components/ui/skeleton.js +0 -6
  166. package/dist/src/components/ui/switch.d.ts +0 -4
  167. package/dist/src/components/ui/switch.js +0 -7
  168. package/dist/src/components/ui/tabs.d.ts +0 -7
  169. package/dist/src/components/ui/tabs.js +0 -12
  170. package/dist/src/components/ui/textarea.d.ts +0 -3
  171. package/dist/src/components/ui/textarea.js +0 -8
  172. package/dist/src/components/ui/tooltip.d.ts +0 -7
  173. package/dist/src/components/ui/tooltip.js +0 -11
  174. package/dist/src/hooks/use-list-flows.d.ts +0 -9
  175. package/dist/src/hooks/use-list-flows.js +0 -8
  176. package/dist/src/hooks/use-theme.d.ts +0 -6
  177. package/dist/src/hooks/use-theme.js +0 -28
  178. package/dist/src/publicComponents/base-handle.js +0 -10
  179. package/dist/src/publicComponents/base-node.d.ts +0 -16
  180. package/dist/src/publicComponents/base-node.js +0 -25
  181. package/dist/src/publicComponents/colorMap.d.ts +0 -6
  182. package/dist/src/publicComponents/colorMap.js +0 -6
  183. package/dist/src/publicComponents/components/header-bar.d.ts +0 -11
  184. package/dist/src/publicComponents/components/header-bar.js +0 -15
  185. package/dist/src/publicComponents/emits.js +0 -6
  186. package/dist/src/publicComponents/subscribe.js +0 -5
  187. package/dist/src/route-wrapper.d.ts +0 -2
  188. package/dist/src/route-wrapper.js +0 -5
  189. package/dist/src/routes/endpoints-page.js +0 -5
  190. package/dist/src/routes/flow.d.ts +0 -1
  191. package/dist/src/routes/flow.js +0 -11
  192. package/dist/src/routes/index.d.ts +0 -1
  193. package/dist/src/routes/index.js +0 -5
  194. package/dist/src/routes/logs-page.js +0 -12
  195. package/dist/src/routes/states-page.js +0 -5
  196. package/dist/src/routes/traces-page.js +0 -14
  197. package/dist/src/stores/use-logs.js +0 -52
  198. package/dist/src/views/flow/arrow-head.d.ts +0 -8
  199. package/dist/src/views/flow/arrow-head.js +0 -6
  200. package/dist/src/views/flow/flow-view.js +0 -48
  201. package/dist/src/views/flow/hooks/use-get-flow-state.d.ts +0 -52
  202. package/dist/src/views/flow/legend.d.ts +0 -4
  203. package/dist/src/views/flow/legend.js +0 -51
  204. package/dist/src/views/flow/nodes/api-flow-node.d.ts +0 -4
  205. package/dist/src/views/flow/nodes/event-flow-node.js +0 -5
  206. package/dist/src/views/flow/nodes/noop-flow-node.d.ts +0 -4
  207. /package/dist/src/{routes → components/endpoints}/endpoints-page.d.ts +0 -0
  208. /package/dist/src/{views → components}/flow/base-edge.d.ts +0 -0
  209. /package/dist/src/{views → components}/flow/base-edge.js +0 -0
  210. /package/dist/src/{views → components}/flow/flow-loader.d.ts +0 -0
  211. /package/dist/src/{views → components}/flow/flow-loader.js +0 -0
  212. /package/dist/src/{views → components}/flow/hooks/use-organize-nodes.js +0 -0
  213. /package/dist/src/{views → components}/flow/hooks/use-save-workflow-config.js +0 -0
  214. /package/dist/src/{views → components}/flow/node-organizer.d.ts +0 -0
  215. /package/dist/src/{views → components}/flow/node-organizer.js +0 -0
  216. /package/dist/src/{routes → components/logs}/logs-page.d.ts +0 -0
  217. /package/dist/src/{routes → components/observability}/traces-page.d.ts +0 -0
  218. /package/dist/src/{routes → components/states}/states-page.d.ts +0 -0
  219. /package/dist/src/publicComponents/{subscribe.d.ts → base-node/subscribe.d.ts} +0 -0
  220. /package/dist/src/{views/flow/nodes/nodes.types.js → types/endpoint.js} +0 -0
@@ -1,25 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { useState, useEffect } from 'react';
3
- import { cn } from '@/lib/utils';
4
- import { PanelLeftClose, PanelLeftOpen } from 'lucide-react';
5
- import { Button } from './button';
6
- const SIDEBAR_COLLAPSED_KEY = 'sidebar-collapsed';
7
- export const Sidebar = ({ children }) => {
8
- const [isCollapsed, setIsCollapsed] = useState(() => {
9
- if (typeof window !== 'undefined') {
10
- const saved = localStorage.getItem(SIDEBAR_COLLAPSED_KEY);
11
- return saved ? JSON.parse(saved) : true;
12
- }
13
- return true;
14
- });
15
- useEffect(() => {
16
- localStorage.setItem(SIDEBAR_COLLAPSED_KEY, JSON.stringify(isCollapsed));
17
- }, [isCollapsed]);
18
- return (_jsxs("div", { className: cn('max-h-screen overflow-y-auto transition-[width] duration-300 border-r border-sidebar-border bg-sidebar text-sidebar-foreground border-solid overflow-hidden relative', isCollapsed ? 'w-[50px]' : 'w-[250px]'), children: [_jsx("div", { className: "flex items-center justify-end gap-2 absolute top-3 right-1", children: _jsx(Button, { variant: "ghost", size: "icon", "data-testid": "sidebar-toggle", onClick: () => setIsCollapsed(!isCollapsed), children: isCollapsed ? _jsx(PanelLeftOpen, { className: "w-4 h-4" }) : _jsx(PanelLeftClose, { className: "w-4 h-4" }) }) }), !isCollapsed && _jsx("div", { className: "overflow-y-auto w-[250px] mt-4", children: children })] }));
19
- };
20
- export const SidebarGroup = ({ children, title, testId, }) => {
21
- return (_jsxs("div", { className: "flex flex-col", children: [_jsx("h2", { className: "text-xs font-bold text-muted-foreground px-4 py-2 uppercase", "data-testid": testId, children: title }), children] }));
22
- };
23
- export const SidebarButton = ({ children, isActive, icon }) => {
24
- return (_jsxs("div", { className: cn('flex text-sm font-medium items-center gap-2 px-4 py-3 hover:bg-sidebar-accent hover:text-sidebar-accent-foreground transition-colors cursor-pointer', isActive && 'bg-sidebar-accent text-sidebar-accent-foreground'), children: [_jsx("div", { className: "text-sidebar-foreground/70", children: icon }), children] }));
25
- };
@@ -1,3 +0,0 @@
1
- import React from 'react';
2
- declare function Skeleton({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): import("react/jsx-runtime").JSX.Element;
3
- export { Skeleton };
@@ -1,6 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { cn } from '@/lib/utils';
3
- function Skeleton({ className, ...props }) {
4
- return _jsx("div", { className: cn('animate-pulse rounded-md bg-primary/10', className), ...props });
5
- }
6
- export { Skeleton };
@@ -1,4 +0,0 @@
1
- import * as React from 'react';
2
- import * as SwitchPrimitives from '@radix-ui/react-switch';
3
- declare const Switch: React.ForwardRefExoticComponent<Omit<SwitchPrimitives.SwitchProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
4
- export { Switch };
@@ -1,7 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import * as React from 'react';
3
- import * as SwitchPrimitives from '@radix-ui/react-switch';
4
- import { cn } from '@/lib/utils';
5
- const Switch = React.forwardRef(({ className, ...props }, ref) => (_jsx(SwitchPrimitives.Root, { className: cn('peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input', className), ...props, ref: ref, children: _jsx(SwitchPrimitives.Thumb, { className: cn('pointer-events-none block h-4 w-4 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0') }) })));
6
- Switch.displayName = SwitchPrimitives.Root.displayName;
7
- export { Switch };
@@ -1,7 +0,0 @@
1
- import * as React from 'react';
2
- import * as TabsPrimitive from '@radix-ui/react-tabs';
3
- declare const Tabs: React.ForwardRefExoticComponent<TabsPrimitive.TabsProps & React.RefAttributes<HTMLDivElement>>;
4
- declare const TabsList: React.ForwardRefExoticComponent<Omit<TabsPrimitive.TabsListProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
5
- declare const TabsTrigger: React.ForwardRefExoticComponent<Omit<TabsPrimitive.TabsTriggerProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
6
- declare const TabsContent: React.ForwardRefExoticComponent<Omit<TabsPrimitive.TabsContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
7
- export { Tabs, TabsList, TabsTrigger, TabsContent };
@@ -1,12 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import * as React from 'react';
3
- import * as TabsPrimitive from '@radix-ui/react-tabs';
4
- import { cn } from '@/lib/utils';
5
- const Tabs = TabsPrimitive.Root;
6
- const TabsList = React.forwardRef(({ className, ...props }, ref) => (_jsx(TabsPrimitive.List, { ref: ref, className: cn('inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground', className), ...props })));
7
- TabsList.displayName = TabsPrimitive.List.displayName;
8
- const TabsTrigger = React.forwardRef(({ className, ...props }, ref) => (_jsx(TabsPrimitive.Trigger, { ref: ref, className: cn('inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm', className), ...props })));
9
- TabsTrigger.displayName = TabsPrimitive.Trigger.displayName;
10
- const TabsContent = React.forwardRef(({ className, ...props }, ref) => (_jsx(TabsPrimitive.Content, { ref: ref, className: cn('mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2', className), ...props })));
11
- TabsContent.displayName = TabsPrimitive.Content.displayName;
12
- export { Tabs, TabsList, TabsTrigger, TabsContent };
@@ -1,3 +0,0 @@
1
- import * as React from 'react';
2
- declare const Textarea: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement>, "ref"> & React.RefAttributes<HTMLTextAreaElement>>;
3
- export { Textarea };
@@ -1,8 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import * as React from 'react';
3
- import { cn } from '@/lib/utils';
4
- const Textarea = React.forwardRef(({ className, ...props }, ref) => {
5
- return (_jsx("textarea", { className: cn('flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm', className), ref: ref, ...props }));
6
- });
7
- Textarea.displayName = 'Textarea';
8
- export { Textarea };
@@ -1,7 +0,0 @@
1
- import * as React from 'react';
2
- import * as TooltipPrimitive from '@radix-ui/react-tooltip';
3
- declare const TooltipProvider: React.FC<TooltipPrimitive.TooltipProviderProps>;
4
- declare const Tooltip: React.FC<TooltipPrimitive.TooltipProps>;
5
- declare const TooltipTrigger: React.ForwardRefExoticComponent<TooltipPrimitive.TooltipTriggerProps & React.RefAttributes<HTMLButtonElement>>;
6
- declare const TooltipContent: React.ForwardRefExoticComponent<Omit<TooltipPrimitive.TooltipContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
7
- export { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider };
@@ -1,11 +0,0 @@
1
- 'use client';
2
- import { jsx as _jsx } from "react/jsx-runtime";
3
- import * as React from 'react';
4
- import * as TooltipPrimitive from '@radix-ui/react-tooltip';
5
- import { cn } from '@/lib/utils';
6
- const TooltipProvider = TooltipPrimitive.Provider;
7
- const Tooltip = TooltipPrimitive.Root;
8
- const TooltipTrigger = TooltipPrimitive.Trigger;
9
- const TooltipContent = React.forwardRef(({ className, sideOffset = 4, ...props }, ref) => (_jsx(TooltipPrimitive.Portal, { children: _jsx(TooltipPrimitive.Content, { ref: ref, sideOffset: sideOffset, className: cn('z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-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', className), ...props }) })));
10
- TooltipContent.displayName = TooltipPrimitive.Content.displayName;
11
- export { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider };
@@ -1,9 +0,0 @@
1
- import { FlowResponse } from '@/views/flow/hooks/use-get-flow-state';
2
- export type Flow = {
3
- id: string;
4
- name: string;
5
- data?: FlowResponse;
6
- };
7
- export declare const useListFlows: () => {
8
- flows: Flow[];
9
- };
@@ -1,8 +0,0 @@
1
- import { useStreamGroup } from '@motiadev/stream-client-react';
2
- export const useListFlows = () => {
3
- const { data: flows } = useStreamGroup({
4
- streamName: '__motia.flows',
5
- groupId: 'default',
6
- });
7
- return { flows };
8
- };
@@ -1,6 +0,0 @@
1
- type Theme = 'dark' | 'light' | 'system';
2
- export declare const useTheme: () => {
3
- theme: Theme;
4
- setTheme: (newTheme: Theme) => void;
5
- };
6
- export {};
@@ -1,28 +0,0 @@
1
- import { useCallback, useEffect, useState } from 'react';
2
- const storageKey = 'motia-workbench-theme';
3
- const defaultTheme = localStorage.getItem(storageKey) || 'system';
4
- const updateTheme = (theme) => {
5
- const root = window.document.body;
6
- root.classList.remove('light', 'dark');
7
- if (theme === 'system') {
8
- const systemTheme = window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';
9
- root.classList.add(systemTheme);
10
- return;
11
- }
12
- root.classList.add(theme);
13
- };
14
- export const useTheme = () => {
15
- const [theme, _setTheme] = useState(defaultTheme);
16
- useEffect(() => {
17
- updateTheme(defaultTheme);
18
- }, []);
19
- const setTheme = useCallback((newTheme) => {
20
- localStorage.setItem(storageKey, newTheme);
21
- _setTheme(newTheme);
22
- updateTheme(newTheme);
23
- }, []);
24
- return {
25
- theme,
26
- setTheme,
27
- };
28
- };
@@ -1,10 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { Position, Handle as RFHandle } from '@xyflow/react';
3
- import clsx from 'clsx';
4
- import { colorMap } from './colorMap';
5
- export const BaseHandle = (props) => {
6
- const { isHidden, position, variant, ...rest } = props;
7
- return (_jsx("div", { className: clsx('absolute w-[6px] h-[6px]', position === Position.Top && '-top-[20px]', position === Position.Bottom && '-bottom-[20px]', 'left-1/2 -ml-[2px]', isHidden && 'hidden'), children: _jsx(RFHandle, { ...rest, position: position, style: {
8
- background: colorMap[variant],
9
- }, className: "\n !static\n !w-[6px]\n !h-[6px]\n !min-w-[6px]\n !min-h-[6px]\n !p-0\n !border-none\n !transform-none\n !rounded-full\n !outline-none\n !shadow-none\n " }) }));
10
- };
@@ -1,16 +0,0 @@
1
- import { type VariantProps } from 'class-variance-authority';
2
- import React, { PropsWithChildren } from 'react';
3
- declare const baseDot: (props?: ({
4
- variant?: "event" | "api" | "noop" | "cron" | null | undefined;
5
- } & import("class-variance-authority/types").ClassProp) | undefined) => string;
6
- type Props = PropsWithChildren<{
7
- title: string;
8
- variant: VariantProps<typeof baseDot>['variant'];
9
- language?: string;
10
- headerChildren?: React.ReactNode;
11
- className?: string;
12
- disableSourceHandle?: boolean;
13
- disableTargetHandle?: boolean;
14
- }>;
15
- export declare const BaseNode: (props: Props) => import("react/jsx-runtime").JSX.Element;
16
- export {};
@@ -1,25 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { cn } from '@/lib/utils';
3
- import { Position } from '@xyflow/react';
4
- import { cva } from 'class-variance-authority';
5
- import { BaseHandle } from './base-handle';
6
- import { LanguageIndicator } from '../views/flow/nodes/language-indicator';
7
- import { colorMap } from './colorMap';
8
- const baseDot = cva('w-[6px] h-[6px] rounded-full', {
9
- variants: {
10
- variant: {
11
- event: 'bg-[rgba(0,117,255,1)]',
12
- api: 'bg-[rgba(189,255,0,1)]',
13
- noop: 'bg-[rgba(255,49,234,1)]',
14
- cron: 'bg-[rgba(255,113,11,1)]',
15
- },
16
- },
17
- });
18
- const Dot = ({ variant }) => (_jsx("div", { className: cn(baseDot({ variant })) }));
19
- const HeaderBar = ({ text, variant, children, }) => (_jsxs("div", { className: "text-sm text-foreground flex justify-between items-center gap-4", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(Dot, { variant: variant }), _jsx("span", { children: text })] }), children] }));
20
- export const BaseNode = (props) => {
21
- const { title, variant, children, disableSourceHandle, disableTargetHandle, language } = props;
22
- return (_jsx("div", { className: "p-[1px] rounded-lg max-w-[350px] ", children: _jsx("div", { className: "rounded-lg bg-background p-4 border border-muted border-solid", "data-testid": `node-${title?.toLowerCase().replace(/ /g, '-')}`, style: {
23
- borderColor: colorMap[variant],
24
- }, children: _jsxs("div", { className: "group relative", children: [_jsx(HeaderBar, { text: title, variant: variant, children: _jsx(LanguageIndicator, { language: language }) }), _jsx("div", { className: "pt-4 space-y-3", children: children }), !disableTargetHandle && _jsx(BaseHandle, { type: "target", position: Position.Top, variant: variant }), !disableSourceHandle && _jsx(BaseHandle, { type: "source", position: Position.Bottom, variant: variant }), _jsx("div", { className: "absolute inset-0 -z-10 translate-y-1 translate-x-1 bg-background rounded-md border border-white/5" })] }) }) }));
25
- };
@@ -1,6 +0,0 @@
1
- export declare const colorMap: {
2
- event: string;
3
- api: string;
4
- noop: string;
5
- cron: string;
6
- };
@@ -1,6 +0,0 @@
1
- export const colorMap = {
2
- event: 'rgb(0,117,255)',
3
- api: 'rgb(189,255,0)',
4
- noop: 'rgb(255,49,234)',
5
- cron: 'rgb(255,113,11)',
6
- };
@@ -1,11 +0,0 @@
1
- import { type VariantProps } from 'class-variance-authority';
2
- import React from 'react';
3
- declare const baseDot: (props?: ({
4
- variant?: "event" | "api" | "noop" | "cron" | null | undefined;
5
- } & import("class-variance-authority/types").ClassProp) | undefined) => string;
6
- export declare const HeaderBar: ({ text, variant, children, }: {
7
- text: string;
8
- variant: VariantProps<typeof baseDot>["variant"];
9
- children?: React.ReactNode;
10
- }) => import("react/jsx-runtime").JSX.Element;
11
- export {};
@@ -1,15 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { cn } from '@/lib/utils';
3
- import { cva } from 'class-variance-authority';
4
- const baseDot = cva('w-[6px] h-[6px] rounded-full', {
5
- variants: {
6
- variant: {
7
- event: 'bg-[rgba(0,117,255,1)]',
8
- api: 'bg-[rgba(189,255,0,1)]',
9
- noop: 'bg-[rgba(255,49,234,1)]',
10
- cron: 'bg-[rgba(255,113,11,1)]',
11
- },
12
- },
13
- });
14
- const Dot = ({ variant }) => (_jsx("div", { className: cn(baseDot({ variant })) }));
15
- export const HeaderBar = ({ text, variant, children, }) => (_jsxs("div", { className: "text-sm text-foreground flex justify-between items-center gap-4", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(Dot, { variant: variant }), _jsx("span", { children: text })] }), children] }));
@@ -1,6 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
- import { Send } from 'lucide-react';
3
- const toTopic = (emit) => typeof emit === 'string' ? emit : emit.topic;
4
- export const Emits = ({ emits }) => {
5
- return (_jsx(_Fragment, { children: emits.map((emit) => (_jsxs("div", { className: "flex gap-2 items-center text-xs text-muted-foreground", "data-testid": `emits__${toTopic(emit)}`, children: [_jsx(Send, { className: "w-4 h-4 text-muted-foreground/60" }), _jsx("div", { className: "font-mono tracking-wider", children: toTopic(emit) })] }, toTopic(emit)))) }));
6
- };
@@ -1,5 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
- import { Eye } from 'lucide-react';
3
- export const Subscribe = ({ subscribes }) => {
4
- return (_jsx(_Fragment, { children: subscribes.map((subscribe) => (_jsxs("div", { className: "flex gap-2 items-center text-xs text-muted-foreground", "data-testid": `subscribes__${subscribe}`, children: [_jsx(Eye, { className: "w-4 h-4 text-muted-foreground/60" }), _jsx("div", { className: "font-mono tracking-wider", children: subscribe })] }, subscribe))) }));
5
- };
@@ -1,2 +0,0 @@
1
- import React, { PropsWithChildren } from 'react';
2
- export declare const RouteWrapper: React.FC<PropsWithChildren>;
@@ -1,5 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { AppSidebar } from './components/app-sidebar';
3
- import { ReactFlowProvider } from '@xyflow/react';
4
- import { Header } from './components/header/header';
5
- export const RouteWrapper = ({ children }) => (_jsx("div", { className: "flex flex-col bg-background text-foreground h-screen", children: _jsxs(ReactFlowProvider, { children: [_jsx(Header, {}), _jsxs("div", { className: "flex flex-row flex-1", children: [_jsx(AppSidebar, {}), _jsx("div", { className: "flex-1", children: children })] })] }) }));
@@ -1,5 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { Endpoints } from '@/components/endpoints/endpoints';
3
- export const EndpointsPage = () => {
4
- return _jsx(Endpoints, {});
5
- };
@@ -1 +0,0 @@
1
- export declare const Flow: () => import("react/jsx-runtime").JSX.Element;
@@ -1,11 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { FlowView } from '@/views/flow/flow-view';
3
- import { useParams } from 'react-router';
4
- import { useFetchFlows } from '@/hooks/use-fetch-flows';
5
- export const Flow = () => {
6
- const { id } = useParams();
7
- const { flow, flowConfig } = useFetchFlows(id);
8
- if (!flow || flow.error)
9
- return (_jsx("div", { className: "w-full h-full bg-background flex flex-col items-center justify-center", children: _jsx("p", { children: flow?.error }) }));
10
- return (_jsx("div", { className: "w-full h-full bg-background", children: _jsx(FlowView, { flow: flow, flowConfig: flowConfig }) }));
11
- };
@@ -1 +0,0 @@
1
- export declare const Index: () => import("react/jsx-runtime").JSX.Element;
@@ -1,5 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { Button } from '@/components/ui/button';
3
- export const Index = () => {
4
- return (_jsxs("div", { className: "flex flex-col items-center justify-center w-full h-full gap-10 bg-gradient-to-r from-background via-background to-muted", children: [_jsx("h1", { className: "text-5xl font-extrabold max-w-[600px] text-center text-foreground", children: "Unified Backend Framework for APIs, Events and AI Agents" }), _jsx("div", { className: "max-w-[600px] text-center text-xl font-medium text-muted-foreground", children: "Write in any language. Automate anything. From AI agents to backend automation, Motia runs event-driven workflows with zero overhead." }), _jsx("div", { className: "p-[1px] min-w-[600px] rounded-lg shadow-lg border border-border", children: _jsx("div", { className: "rounded-lg bg-card p-8 font-semibold text-xl min-h-[100px] flex items-center", children: _jsxs("div", { className: "flex items-center gap-2 font-mono", children: [_jsx("span", { className: "text-primary", children: "$" }), _jsx("span", { className: "text-card-foreground", children: "npx motia generate step" })] }) }) }), _jsxs("div", { className: "flex flex-col gap-8 items-center", children: [_jsx("span", { className: "text-muted-foreground text-xl", children: "or" }), _jsx("a", { href: "https://motia.dev/docs", target: "_blank", children: _jsx(Button, { size: "lg", className: "text-xl py-6 px-8", children: "Read developer docs" }) })] })] }));
5
- };
@@ -1,12 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { Logs } from '@/components/logs/logs';
3
- import { useLogs } from '@/stores/use-logs';
4
- import { useEffect } from 'react';
5
- export const LogsPage = () => {
6
- const setUnreadLogsCount = useLogs((state) => state.setUnreadLogsCount);
7
- useEffect(() => {
8
- setUnreadLogsCount(0);
9
- return () => setUnreadLogsCount(0);
10
- }, [setUnreadLogsCount]);
11
- return (_jsxs("div", { className: "w-full h-full overflow-hidden bg-background text-foreground", children: [_jsxs("header", { className: "p-4 border-b border-border", children: [_jsx("h1", { className: "text-2xl font-bold text-foreground", children: "Logs" }), _jsx("span", { className: "text-sm text-muted-foreground", children: "Check all logs saved locally" })] }), _jsx(Logs, {})] }));
12
- };
@@ -1,5 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { States } from '@/components/states/states';
3
- export const StatesPage = () => {
4
- return (_jsxs("div", { className: "w-full h-full overflow-hidden bg-background text-foreground", children: [_jsxs("header", { className: "p-4 border-b border-border", children: [_jsx("h1", { className: "text-xl font-bold text-foreground", children: "State details" }), _jsx("span", { className: "text-sm text-muted-foreground", children: "Check all states saved locally along with all fields" })] }), _jsx(States, {})] }));
5
- };
@@ -1,14 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { ObservabilityStats } from '@/components/observability/observability-stats';
3
- import { TraceTimeline } from '@/components/observability/trace-timeline';
4
- import { useStreamGroup } from '@motiadev/stream-client-react';
5
- import { useState } from 'react';
6
- import { TracesGroups } from '../components/observability/traces-groups';
7
- export const TracesPage = () => {
8
- const [selectedGroupId, setSelectedGroupId] = useState(null);
9
- const { data } = useStreamGroup({ streamName: 'motia-trace-group', groupId: 'default' });
10
- const handleGroupSelect = (group) => {
11
- setSelectedGroupId(group.id);
12
- };
13
- return (_jsxs("div", { className: "flex flex-col h-screen", children: [_jsx("div", { className: "border-b border-border p-4", children: _jsx(ObservabilityStats, { groups: data }) }), _jsxs("div", { className: "flex flex-1 overflow-hidden", children: [_jsx("div", { className: "w-1/3 border-r border-border overflow-auto", "data-testid": "traces-container", children: _jsx(TracesGroups, { groups: data, selectedGroupId: selectedGroupId, onGroupSelect: handleGroupSelect }) }), _jsxs("div", { className: "flex-1 overflow-auto", "data-testid": "trace-details", children: [selectedGroupId && _jsx(TraceTimeline, { groupId: selectedGroupId }), !selectedGroupId && (_jsx("div", { className: "flex items-center justify-center h-full text-muted-foreground", children: "Select a trace or trace group to view the timeline" }))] })] })] }));
14
- };
@@ -1,52 +0,0 @@
1
- import { useSyncExternalStore, useCallback } from 'react';
2
- const listeners = new Set();
3
- let currentLogs = [];
4
- let currentUnreadLogsCount = 0;
5
- let memoizedSnapshot;
6
- const updateMemoizedSnapshot = () => {
7
- memoizedSnapshot = {
8
- logs: currentLogs,
9
- unreadLogsCount: currentUnreadLogsCount,
10
- addLog: storeActions.addLog,
11
- resetLogs: storeActions.resetLogs,
12
- setUnreadLogsCount: storeActions.setUnreadLogsCount,
13
- };
14
- };
15
- const notify = () => {
16
- listeners.forEach((listener) => listener());
17
- };
18
- const storeActions = {
19
- addLog: (log) => {
20
- currentLogs = [log, ...currentLogs];
21
- currentUnreadLogsCount += 1;
22
- updateMemoizedSnapshot();
23
- notify();
24
- },
25
- resetLogs: () => {
26
- if (currentLogs.length === 0 && currentUnreadLogsCount === 0) {
27
- return;
28
- }
29
- currentLogs = [];
30
- currentUnreadLogsCount = 0;
31
- updateMemoizedSnapshot();
32
- notify();
33
- },
34
- setUnreadLogsCount: (count) => {
35
- if (currentUnreadLogsCount === count) {
36
- return;
37
- }
38
- currentUnreadLogsCount = count;
39
- updateMemoizedSnapshot();
40
- notify();
41
- },
42
- };
43
- updateMemoizedSnapshot();
44
- // Stable subscribe function so React doesn't unnecessarily tear down the subscription
45
- const subscribe = (onStoreChange) => {
46
- listeners.add(onStoreChange);
47
- return () => listeners.delete(onStoreChange);
48
- };
49
- export function useLogs(selector = (state) => state) {
50
- const getSnapshot = useCallback(() => selector(memoizedSnapshot), [selector]);
51
- return useSyncExternalStore(subscribe, getSnapshot);
52
- }
@@ -1,8 +0,0 @@
1
- import React from 'react';
2
- type Props = {
3
- color?: string;
4
- id: string;
5
- className?: string;
6
- };
7
- export declare const ArrowHead: React.FC<Props>;
8
- export {};
@@ -1,6 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- export const ArrowHead = (props) => {
3
- // Use CSS custom property for theme-aware coloring, fallback to provided color
4
- const strokeColor = props.color || 'var(--arrow-color, #B3B3B3)';
5
- return (_jsxs("marker", { id: props.id, viewBox: "-5 -5 10 10", markerUnits: "strokeWidth", markerWidth: "10", markerHeight: "10", className: props.className, children: [_jsx("line", { x1: 0, y1: 0, x2: 2, y2: -2, stroke: strokeColor, strokeWidth: "1", strokeOpacity: "1", strokeLinecap: "round" }), _jsx("line", { x1: -2, y1: -2, x2: 0, y2: 0, stroke: strokeColor, strokeWidth: "1", strokeOpacity: "1", strokeLinecap: "round" })] }));
6
- };
@@ -1,48 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { LogConsole } from '@/components/logs/log-console';
3
- import { Background, BackgroundVariant, ReactFlow, } from '@xyflow/react';
4
- import { useCallback, useMemo, useState } from 'react';
5
- import { ArrowHead } from './arrow-head';
6
- import { BaseEdge } from './base-edge';
7
- import { FlowLoader } from './flow-loader';
8
- import { useGetFlowState } from './hooks/use-get-flow-state';
9
- import { Legend } from './legend';
10
- import { NodeOrganizer } from './node-organizer';
11
- import '@xyflow/react/dist/style.css';
12
- const edgeTypes = {
13
- base: BaseEdge,
14
- };
15
- export const FlowView = ({ flow, flowConfig }) => {
16
- const { nodes, edges, onNodesChange, onEdgesChange, nodeTypes } = useGetFlowState(flow, flowConfig);
17
- const [initialized, setInitialized] = useState(false);
18
- const [hoveredType, setHoveredType] = useState(null);
19
- const onInitialized = useCallback(() => {
20
- setInitialized(true);
21
- }, []);
22
- const getClassName = useCallback((nodeType) => {
23
- if (!hoveredType)
24
- return '';
25
- if (nodeType) {
26
- return nodeType === hoveredType
27
- ? 'border border-border scale-[1.02] transition-all duration-300'
28
- : 'opacity-30 transition-all duration-300';
29
- }
30
- // If no nodeType is provided, this is an edge
31
- return 'opacity-30 transition-all duration-300';
32
- }, [hoveredType]);
33
- const nodesWithHighlights = useMemo(() => nodes.map((node) => ({
34
- ...node,
35
- className: getClassName(node.data.type),
36
- })), [nodes, getClassName]);
37
- const edgesWithHighlights = useMemo(() => edges.map((edge) => ({
38
- ...edge,
39
- className: getClassName(), // No argument means it's an edge
40
- })), [edges, getClassName]);
41
- const onNodesChangeHandler = useCallback((changes) => {
42
- onNodesChange(changes);
43
- }, [onNodesChange]);
44
- if (!nodeTypes) {
45
- return null;
46
- }
47
- return (_jsxs("div", { className: "w-full h-full relative bg-background", children: [!initialized && _jsx(FlowLoader, {}), _jsx(Legend, { onHover: setHoveredType }), _jsxs(ReactFlow, { nodes: nodesWithHighlights, edges: edgesWithHighlights, nodeTypes: nodeTypes, edgeTypes: edgeTypes, onNodesChange: onNodesChangeHandler, onEdgesChange: onEdgesChange, children: [_jsx(Background, { variant: BackgroundVariant.Dots, gap: 50, size: 2, className: "[--xy-background-color-dots:theme(colors.muted.DEFAULT)] [--xy-background-color:theme(colors.background)]" }), _jsx(NodeOrganizer, { onInitialized: onInitialized }), _jsx("svg", { className: "[--arrow-color:theme(colors.muted.foreground)]", children: _jsx("defs", { children: _jsx(ArrowHead, { id: "arrowhead" }) }) })] }), _jsx(LogConsole, {})] }));
48
- };
@@ -1,52 +0,0 @@
1
- import { Edge, Node } from '@xyflow/react';
2
- import React from 'react';
3
- import type { EdgeData, NodeData } from '../nodes/nodes.types';
4
- type Emit = string | {
5
- topic: string;
6
- label?: string;
7
- };
8
- type FlowStep = {
9
- id: string;
10
- name: string;
11
- type: 'event' | 'api' | 'noop' | 'cron';
12
- description?: string;
13
- subscribes?: string[];
14
- emits: Emit[];
15
- virtualEmits?: Emit[];
16
- action?: 'webhook';
17
- webhookUrl?: string;
18
- language?: string;
19
- nodeComponentPath?: string;
20
- filePath?: string;
21
- };
22
- export type FlowResponse = {
23
- id: string;
24
- name: string;
25
- steps: FlowStep[];
26
- edges: FlowEdge[];
27
- error?: string;
28
- };
29
- export type FlowConfigResponse = {
30
- id: string;
31
- config: {
32
- [stepName: string]: Position;
33
- };
34
- };
35
- type FlowEdge = {
36
- id: string;
37
- source: string;
38
- target: string;
39
- data: EdgeData;
40
- };
41
- type Position = {
42
- x: number;
43
- y: number;
44
- };
45
- export declare const useGetFlowState: (flow: FlowResponse, flowConfig: FlowConfigResponse) => {
46
- nodes: Node<NodeData>[];
47
- edges: Edge<EdgeData>[];
48
- onNodesChange: import("@xyflow/react").OnNodesChange<Node<NodeData>>;
49
- onEdgesChange: import("@xyflow/react").OnEdgesChange<Edge<EdgeData>>;
50
- nodeTypes: Record<string, React.ComponentType<any>>;
51
- };
52
- export {};
@@ -1,4 +0,0 @@
1
- import { FC } from 'react';
2
- export declare const Legend: FC<{
3
- onHover: (type: string | null) => void;
4
- }>;
@@ -1,51 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
- import { Button } from '@/components/ui/button';
3
- import { cn } from '@/lib/utils';
4
- import { LayoutList, X } from 'lucide-react';
5
- import { useState } from 'react';
6
- import { colorMap } from '@/publicComponents/colorMap';
7
- const EdgeSwatch = ({ color, dashed }) => (_jsx("svg", { className: "my-1", width: "48", height: "10", viewBox: "0 0 48 10", xmlns: "http://www.w3.org/2000/svg", children: _jsx("line", { x1: "0", y1: "5", x2: "48", y2: "5", stroke: color, strokeWidth: "2", strokeDasharray: dashed ? '4' : 'none', strokeLinecap: "round" }) }));
8
- const legendItems = [
9
- {
10
- label: 'Event (Core)',
11
- type: 'event',
12
- color: colorMap.event,
13
- description: 'Core logic components that process events.',
14
- },
15
- {
16
- label: 'API',
17
- type: 'api',
18
- color: colorMap.api,
19
- description: 'HTTP endpoints that trigger flows.',
20
- },
21
- {
22
- label: 'Noop (Non-Operation)',
23
- type: 'noop',
24
- color: colorMap.noop,
25
- description: 'Placeholder nodes for external processes.',
26
- },
27
- {
28
- label: 'Cron',
29
- type: 'cron',
30
- color: colorMap.cron,
31
- description: 'Scheduled tasks that run at specified intervals.',
32
- },
33
- ];
34
- const edgeLegendItems = [
35
- {
36
- label: 'Event Edge',
37
- color: colorMap.event,
38
- description: 'Represents an event emitted and subscribed by steps.',
39
- dashed: true,
40
- },
41
- {
42
- label: 'Virtual Edge',
43
- color: 'hsl(var(--muted-foreground))',
44
- description: 'Represents virtual connections.',
45
- dashed: true,
46
- },
47
- ];
48
- export const Legend = ({ onHover }) => {
49
- const [isExpanded, setIsExpanded] = useState(false);
50
- return (_jsx("div", { className: 'absolute right-4 top-4 z-10 max-w-[500px]', children: _jsxs("div", { className: cn('rounded-lg border border-border bg-background/90 p-4 flex flex-col', !isExpanded && 'rounded-b-lg', isExpanded && 'gap-4'), children: [_jsxs("div", { className: "flex items-center gap-2", children: [isExpanded && _jsx("div", { className: "text-sm text-muted-foreground uppercase", children: "Flow Legend" }), _jsx("div", { className: "flex-1 flex justify-end", children: _jsx(Button, { variant: "ghost", size: "sm", onClick: () => setIsExpanded(!isExpanded), className: "p-2 hover:bg-muted", children: isExpanded ? _jsx(X, { size: 16 }) : _jsx(LayoutList, { size: 16 }) }) })] }), _jsx("div", { className: cn('overflow-hidden transition-all duration-200 ease-in-out', isExpanded ? 'max-h-[600px] opacity-100' : 'max-h-0 opacity-0'), children: isExpanded && (_jsxs(_Fragment, { children: [_jsx("div", { className: "grid grid-cols-2 gap-3", children: legendItems.map((item) => (_jsx("div", { onMouseEnter: () => onHover(item.type), onMouseLeave: () => onHover(null), className: "group cursor-pointer transition-all hover:bg-muted/20 rounded-md p-2", children: _jsxs("div", { className: "flex items-start gap-3", children: [_jsx("div", { className: "w-[8px] h-[8px] mt-[4px] rounded-full", style: { backgroundColor: item.color } }), _jsxs("div", { className: "flex-1", children: [_jsx("div", { className: "text-foreground text-sm font-medium", children: item.label }), _jsx("div", { className: "text-muted-foreground text-sm mt-0.5", children: item.description })] })] }) }, item.type))) }), _jsx("div", { className: "h-px bg-border my-4" }), _jsx("div", { className: "text-sm text-muted-foreground uppercase pb-4", children: "Edge Legend" }), _jsx("div", { className: "grid grid-cols-2 gap-3", children: edgeLegendItems.map((item) => (_jsxs("div", { className: "flex items-start gap-3", children: [_jsx(EdgeSwatch, { color: item.color, dashed: item.dashed }), _jsxs("div", { className: "flex-1", children: [_jsx("div", { className: "text-foreground text-sm font-medium", children: item.label }), _jsx("div", { className: "text-muted-foreground text-sm mt-0.5", children: item.description })] })] }, item.label))) })] })) })] }) }));
51
- };
@@ -1,4 +0,0 @@
1
- import { ApiNodeData } from './nodes.types';
2
- export declare const ApiFlowNode: ({ data }: {
3
- data: ApiNodeData;
4
- }) => import("react/jsx-runtime").JSX.Element;