@motiadev/workbench 0.5.1-beta.100 → 0.5.2-beta.102-571342

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.
@@ -3,8 +3,10 @@ type JsonEditorProps = {
3
3
  value: string;
4
4
  height?: number | string;
5
5
  schema?: Record<string, unknown>;
6
- onChange: (value: string) => void;
6
+ onChange?: (value: string) => void;
7
7
  onValidate?: (isValid: boolean) => void;
8
+ language?: 'json' | string;
9
+ readOnly?: boolean;
8
10
  };
9
11
  export declare const JsonEditor: FC<JsonEditorProps>;
10
12
  export {};
@@ -1,16 +1,16 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- import { useEffect, useMemo } from 'react';
3
- import Editor, { useMonaco } from '@monaco-editor/react';
4
2
  import { useThemeStore } from '@/stores/use-theme-store';
5
- export const JsonEditor = ({ value, height = 300, schema, onChange, onValidate }) => {
3
+ import Editor, { useMonaco } from '@monaco-editor/react';
4
+ import { useEffect, useMemo } from 'react';
5
+ export const JsonEditor = ({ value, height = 300, schema, onChange, onValidate, language = 'json', readOnly = false, }) => {
6
6
  const monaco = useMonaco();
7
7
  const theme = useThemeStore((state) => state.theme);
8
8
  const editorTheme = useMemo(() => (theme === 'dark' ? 'vs-dark' : 'light'), [theme]);
9
9
  useEffect(() => {
10
10
  if (!monaco)
11
11
  return;
12
+ monaco.languages.typescript.javascriptDefaults.setCompilerOptions({ isolatedModules: true });
12
13
  monaco.languages.json.jsonDefaults.setDiagnosticsOptions({
13
- validate: true,
14
14
  schemas: schema
15
15
  ? [
16
16
  {
@@ -21,11 +21,15 @@ export const JsonEditor = ({ value, height = 300, schema, onChange, onValidate }
21
21
  ]
22
22
  : [],
23
23
  });
24
- }, [monaco, schema]);
25
- return (_jsx(Editor, { "data-testid": "json-editor", height: height, language: "json", value: value, theme: editorTheme, onChange: (value) => {
24
+ }, [monaco, schema, language]);
25
+ return (_jsx(Editor, { "data-testid": "json-editor", height: height, language: language, value: value, theme: editorTheme, onChange: (value) => {
26
26
  if (!value) {
27
27
  onValidate?.(false);
28
28
  }
29
- onChange(value ?? '');
30
- }, onValidate: (markers) => onValidate?.(markers.length === 0), options: { lineNumbers: 'off', minimap: { enabled: false } } }));
29
+ onChange?.(value ?? '');
30
+ }, onValidate: (markers) => onValidate?.(markers.length === 0), options: {
31
+ readOnly,
32
+ scrollBeyondLastLine: false,
33
+ minimap: { enabled: false },
34
+ } }));
31
35
  };
@@ -1,5 +1,5 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { BaseNode } from './base-node/base-node';
3
3
  export const ApiNode = ({ data, children }) => {
4
- return (_jsxs(BaseNode, { data: data, variant: "api", title: data.name, language: data.language, subtitle: data.description, disableSourceHandle: !data.emits?.length && !data.virtualEmits?.length, disableTargetHandle: !data.subscribes?.length && !data.virtualSubscribes?.length, subscribes: data.subscribes, emits: data.emits, details: [{ label: 'Endpoint', value: data.webhookUrl }].filter((item) => !!item), children: [data.webhookUrl && (_jsx("div", { className: "flex gap-1 items-center text-xs text-muted-foreground", children: _jsx("div", { className: "font-mono", children: data.webhookUrl }) })), children] }));
4
+ return (_jsxs(BaseNode, { data: data, variant: "api", title: data.name, language: data.language, subtitle: data.description, disableSourceHandle: !data.emits?.length && !data.virtualEmits?.length, disableTargetHandle: !data.subscribes?.length && !data.virtualSubscribes?.length, children: [data.webhookUrl && (_jsx("div", { className: "flex gap-1 items-center text-muted-foreground", children: _jsx("div", { className: "font-mono", children: data.webhookUrl }) })), children] }));
5
5
  };
@@ -1,4 +1,3 @@
1
- import { PanelDetailItem } from '@motiadev/ui';
2
1
  import React, { PropsWithChildren } from 'react';
3
2
  import { BaseNodeProps } from '../node-props';
4
3
  type Props = PropsWithChildren<{
@@ -9,12 +8,6 @@ type Props = PropsWithChildren<{
9
8
  className?: string;
10
9
  disableSourceHandle?: boolean;
11
10
  disableTargetHandle?: boolean;
12
- details?: PanelDetailItem[];
13
- emits?: Array<string | {
14
- topic: string;
15
- label?: string;
16
- }>;
17
- subscribes?: string[];
18
11
  data: BaseNodeProps;
19
12
  }>;
20
13
  export declare const BaseNode: React.FC<Props>;
@@ -1,13 +1,28 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useHandlePositions } from '@/hooks/use-update-handle-positions';
3
- import { ChevronUp } from 'lucide-react';
4
- import { useState } from 'react';
3
+ import { Button, cn } from '@motiadev/ui';
4
+ import { ScanSearch } from 'lucide-react';
5
+ import { useCallback, useEffect, useState } from 'react';
5
6
  import { BaseHandle } from './base-handle';
6
- import { LanguageIndicator } from './language-indicator';
7
7
  import { NodeHeader } from './node-header';
8
8
  import { NodeSidebar } from './node-sidebar';
9
- export const BaseNode = ({ title, variant, children, disableSourceHandle, disableTargetHandle, language, subtitle, details, subscribes, emits, data, }) => {
9
+ export const BaseNode = ({ title, variant, children, disableSourceHandle, disableTargetHandle, language, subtitle, data, }) => {
10
10
  const [isOpen, setIsOpen] = useState(false);
11
11
  const { sourcePosition, targetPosition, toggleTargetPosition, toggleSourcePosition } = useHandlePositions(data);
12
- return (_jsxs("div", { className: "p-[1px] rounded-lg max-w-[350px]", children: [_jsx("div", { className: "rounded-lg bg-background border-2 border-muted border-solid border-muted-foreground/10", "data-testid": `node-${title?.toLowerCase().replace(/ /g, '-')}`, children: _jsxs("div", { className: "group relative", children: [_jsxs(NodeHeader, { text: title, variant: variant, subtitle: subtitle, children: [_jsx(LanguageIndicator, { language: language }), _jsx("div", { className: "flex justify-end gap-2", children: _jsx("div", { className: "p-[2px] cursor-pointer rounded-md hover:bg-muted-foreground/10", onClick: () => setIsOpen(true), children: _jsx(ChevronUp, { className: "w-4 h-4" }) }) })] }), children && _jsx("div", { className: "border-t-2 border-muted-foreground/10 p-4 space-y-3", children: children }), !disableTargetHandle && (_jsx(BaseHandle, { type: "target", position: targetPosition, onTogglePosition: toggleTargetPosition })), !disableSourceHandle && (_jsx(BaseHandle, { type: "source", position: sourcePosition, onTogglePosition: toggleSourcePosition }))] }) }), _jsx(NodeSidebar, { title: title, subtitle: subtitle, variant: variant, language: language, isOpen: isOpen, onClose: () => setIsOpen(false), details: details, subscribes: subscribes, emits: emits })] }));
12
+ const [content, setContent] = useState(null);
13
+ const fetchContent = useCallback(async () => {
14
+ const response = await fetch(`/step/${data.id}`);
15
+ const responseData = await response.json();
16
+ setContent(responseData.content);
17
+ }, [data.id]);
18
+ useEffect(() => {
19
+ if (data.id && isOpen) {
20
+ fetchContent();
21
+ }
22
+ }, [data.id, isOpen, fetchContent]);
23
+ return (_jsxs("div", { className: cn('p-1 rounded-lg max-w-[350px]', {
24
+ 'bg-muted-foreground/20': isOpen,
25
+ }), children: [_jsx("div", { className: "rounded-lg bg-background border-1 border-muted-foreground/30 border-solid", "data-testid": `node-${title?.toLowerCase().replace(/ /g, '-')}`, children: _jsxs("div", { className: "group relative", children: [_jsx(NodeHeader, { text: title, variant: variant, className: "border-b-2 border-muted-foreground/10", children: _jsx("div", { className: "flex justify-end", children: _jsx(Button, { variant: "ghost", className: "h-5 p-0.5", onClick: () => setIsOpen(true), children: _jsx(ScanSearch, { className: "w-4 h-4" }) }) }) }), subtitle && _jsx("div", { className: "py-4 px-6 text-sm text-muted-foreground", children: subtitle }), children && (_jsx("div", { className: "p-2", children: _jsx("div", { className: cn('space-y-3 p-4 text-sm text-muted-foreground', {
26
+ 'bg-card': variant !== 'noop',
27
+ }), children: children }) })), !disableTargetHandle && (_jsx(BaseHandle, { type: "target", position: targetPosition, onTogglePosition: toggleTargetPosition })), !disableSourceHandle && (_jsx(BaseHandle, { type: "source", position: sourcePosition, onTogglePosition: toggleSourcePosition }))] }) }), content && (_jsx(NodeSidebar, { content: content, title: title, subtitle: subtitle, variant: variant, language: language, isOpen: isOpen, onClose: () => setIsOpen(false) }))] }));
13
28
  };
@@ -2,6 +2,9 @@ import { EventNodeData } from '@/types/flow';
2
2
  import { FC } from 'react';
3
3
  type Props = {
4
4
  language: EventNodeData['language'];
5
+ className?: string;
6
+ size?: number;
7
+ showLabel?: boolean;
5
8
  };
6
9
  export declare const LanguageIndicator: FC<Props>;
7
10
  export {};
@@ -1,26 +1,29 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- export const LanguageIndicator = ({ language }) => {
3
- const size = 18;
1
+ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { cn } from '@motiadev/ui';
3
+ export const LanguageIndicator = ({ language, className, size = 18, showLabel = false }) => {
4
4
  const renderIcon = (language) => {
5
5
  if (language === 'typescript') {
6
- return (_jsxs("svg", { width: size, height: size, viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [_jsx("g", { clipPath: "url(#clip0_42_2963)", children: _jsx("path", { d: "M0.9375 0C0.418333 0 0 0.418333 0 0.9375V19.0625C0 19.5817 0.418333 20 0.9375 20H19.0625C19.5817 20 20 19.5817 20 19.0625V0.9375C20 0.418333 19.5817 0 19.0625 0H0.9375ZM15.4067 8.125C15.9167 8.125 16.3683 8.15583 16.7625 8.2175C17.1343 8.2732 17.4991 8.36818 17.8508 8.50083V10.5492C17.682 10.4324 17.5026 10.3317 17.315 10.2483C17.1215 10.1613 16.9218 10.0889 16.7175 10.0317C16.3305 9.92383 15.9309 9.86778 15.5292 9.865C15.2792 9.865 15.0517 9.88833 14.8467 9.93667C14.664 9.97574 14.4887 10.0438 14.3275 10.1383C14.1858 10.225 14.0775 10.3292 14 10.45C13.9221 10.5718 13.8815 10.7137 13.8833 10.8583C13.8833 11.0217 13.9275 11.1692 14.0133 11.2992C14.1 11.4292 14.2233 11.5525 14.3825 11.6692C14.5417 11.7858 14.735 11.8992 14.9625 12.0108C15.19 12.1233 15.4475 12.2392 15.7342 12.3575C16.1258 12.5217 16.4775 12.6967 16.7892 12.8808C17.1008 13.0658 17.3683 13.275 17.5917 13.5083C17.815 13.7408 17.985 14.0067 18.1033 14.3058C18.2217 14.605 18.2817 14.9525 18.2817 15.35C18.2817 15.8975 18.1775 16.3583 17.9708 16.73C17.7689 17.0966 17.4791 17.4072 17.1275 17.6342C16.7485 17.8745 16.3284 18.0429 15.8883 18.1308C15.4167 18.2308 14.9192 18.2808 14.3967 18.2808C13.8824 18.2831 13.3691 18.2373 12.8633 18.1442C12.4258 18.0685 12.0014 17.9301 11.6033 17.7333V15.5417C12.3565 16.1826 13.3119 16.5368 14.3008 16.5417C14.5783 16.5417 14.8208 16.5167 15.0275 16.4667C15.235 16.4167 15.4075 16.3467 15.5467 16.2583C15.685 16.1683 15.7883 16.0633 15.8575 15.9417C15.9339 15.8 15.9687 15.6396 15.9578 15.479C15.9469 15.3184 15.8907 15.1642 15.7958 15.0342C15.672 14.8703 15.5206 14.7293 15.3483 14.6175C15.1347 14.4759 14.9098 14.3521 14.6758 14.2475C14.3985 14.1209 14.1188 13.9997 13.8367 13.8842C13.0717 13.565 12.5017 13.1742 12.1258 12.7133C11.7508 12.2525 11.5625 11.695 11.5625 11.0425C11.5625 10.5308 11.665 10.0917 11.87 9.72417C12.075 9.35667 12.3533 9.05417 12.7067 8.81667C13.0804 8.57012 13.4953 8.39259 13.9317 8.2925C14.415 8.17855 14.9101 8.12232 15.4067 8.125ZM2.8125 8.28167H10.7817V10.0867H7.92167V18.125H5.6575V10.0867H2.8125V8.28167Z", fill: "white" }) }), _jsx("defs", { children: _jsx("clipPath", { id: "clip0_42_2963", children: _jsx("rect", { width: "20", height: "20", fill: "white" }) }) })] }));
6
+ return (_jsxs(_Fragment, { children: [showLabel ? _jsx(_Fragment, { children: "TypeScript" }) : null, _jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: size, height: size, viewBox: "0 0 24 24", fill: "none", children: _jsx("path", { d: "M3 3V21H21V3H3ZM9 12H13.5V13.5H12V19.5H10.5V13.5H9V12ZM16.5 12H19.5V13.5H16.5V15H18C18.3975 15.0012 18.7783 15.1596 19.0593 15.4407C19.3404 15.7217 19.4988 16.1025 19.5 16.5V18C19.4988 18.3975 19.3404 18.7783 19.0593 19.0593C18.7783 19.3404 18.3975 19.4988 18 19.5H15V18H18V16.5H16.5C16.1025 16.4988 15.7217 16.3404 15.4407 16.0593C15.1596 15.7783 15.0012 15.3975 15 15V13.5C15.0012 13.1025 15.1596 12.7217 15.4407 12.4407C15.7217 12.1596 16.1025 12.0012 16.5 12Z", fill: "#0288D1" }) })] }));
7
7
  }
8
8
  if (language === 'javascript') {
9
- return (_jsxs("svg", { width: size, height: size, viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [_jsx("g", { clipPath: "url(#clip0_42_2938)", children: _jsx("path", { d: "M0 0H20V20H0V0ZM18.3617 15.23C18.2158 14.3175 17.6217 13.5508 15.8592 12.8358C15.2458 12.5483 14.5642 12.3483 14.3617 11.8858C14.2858 11.6108 14.2742 11.4608 14.3233 11.2983C14.4483 10.76 15.0858 10.5983 15.5858 10.7483C15.9108 10.8483 16.2108 11.0983 16.3992 11.4983C17.2608 10.935 17.2608 10.935 17.8617 10.5608C17.6367 10.2108 17.525 10.06 17.3733 9.91083C16.8483 9.32333 16.1492 9.02333 15.0117 9.04917L14.4242 9.12333C13.8608 9.26083 13.3242 9.56083 12.9992 9.96083C12.0492 11.0367 12.3233 12.9117 13.4733 13.6867C14.6108 14.5367 16.2742 14.7233 16.4867 15.5242C16.6867 16.4992 15.7617 16.8117 14.8483 16.6992C14.1725 16.5492 13.7983 16.2108 13.3858 15.5858L11.8608 16.4617C12.0358 16.8617 12.2358 17.0358 12.5358 17.3858C13.9858 18.8492 17.6108 18.7742 18.2617 16.5492C18.2858 16.4742 18.4617 15.9617 18.3233 15.1742L18.3617 15.23ZM10.8758 9.1925H9.0025C9.0025 10.8075 8.995 12.4125 8.995 14.03C8.995 15.0567 9.0475 15.9992 8.88 16.2892C8.605 16.8633 7.89667 16.79 7.575 16.6892C7.245 16.5258 7.0775 16.3008 6.88333 15.9767C6.83083 15.8892 6.79167 15.8133 6.7775 15.8133L5.25667 16.7508C5.51083 17.2758 5.88167 17.7275 6.36 18.015C7.0725 18.44 8.03 18.5775 9.0325 18.3525C9.685 18.1642 10.2475 17.7767 10.5417 17.1767C10.9667 16.4017 10.8767 15.4517 10.8725 14.3883C10.8825 12.6767 10.8725 10.9642 10.8725 9.23917L10.8758 9.1925Z", fill: "white" }) }), _jsx("defs", { children: _jsx("clipPath", { id: "clip0_42_2938", children: _jsx("rect", { width: "20", height: "20", fill: "white" }) }) })] }));
9
+ return (_jsxs(_Fragment, { children: [showLabel ? _jsx(_Fragment, { children: "JavaScript" }) : null, _jsxs("svg", { width: size, height: size, viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", className: className, children: [_jsx("g", { clipPath: "url(#clip0_42_2938)", children: _jsx("path", { d: "M0 0H20V20H0V0ZM18.3617 15.23C18.2158 14.3175 17.6217 13.5508 15.8592 12.8358C15.2458 12.5483 14.5642 12.3483 14.3617 11.8858C14.2858 11.6108 14.2742 11.4608 14.3233 11.2983C14.4483 10.76 15.0858 10.5983 15.5858 10.7483C15.9108 10.8483 16.2108 11.0983 16.3992 11.4983C17.2608 10.935 17.2608 10.935 17.8617 10.5608C17.6367 10.2108 17.525 10.06 17.3733 9.91083C16.8483 9.32333 16.1492 9.02333 15.0117 9.04917L14.4242 9.12333C13.8608 9.26083 13.3242 9.56083 12.9992 9.96083C12.0492 11.0367 12.3233 12.9117 13.4733 13.6867C14.6108 14.5367 16.2742 14.7233 16.4867 15.5242C16.6867 16.4992 15.7617 16.8117 14.8483 16.6992C14.1725 16.5492 13.7983 16.2108 13.3858 15.5858L11.8608 16.4617C12.0358 16.8617 12.2358 17.0358 12.5358 17.3858C13.9858 18.8492 17.6108 18.7742 18.2617 16.5492C18.2858 16.4742 18.4617 15.9617 18.3233 15.1742L18.3617 15.23ZM10.8758 9.1925H9.0025C9.0025 10.8075 8.995 12.4125 8.995 14.03C8.995 15.0567 9.0475 15.9992 8.88 16.2892C8.605 16.8633 7.89667 16.79 7.575 16.6892C7.245 16.5258 7.0775 16.3008 6.88333 15.9767C6.83083 15.8892 6.79167 15.8133 6.7775 15.8133L5.25667 16.7508C5.51083 17.2758 5.88167 17.7275 6.36 18.015C7.0725 18.44 8.03 18.5775 9.0325 18.3525C9.685 18.1642 10.2475 17.7767 10.5417 17.1767C10.9667 16.4017 10.8767 15.4517 10.8725 14.3883C10.8825 12.6767 10.8725 10.9642 10.8725 9.23917L10.8758 9.1925Z", fill: "white" }) }), _jsx("defs", { children: _jsx("clipPath", { id: "clip0_42_2938", children: _jsx("rect", { width: "20", height: "20", fill: "white" }) }) })] })] }));
10
10
  }
11
11
  if (language === 'python') {
12
- return (_jsxs("svg", { width: size, height: size, viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [_jsx("g", { clipPath: "url(#clip0_42_2966)", children: _jsx("path", { d: "M11.8752 0.15L12.6252 0.316667L13.2335 0.533333L13.7252 0.783333L14.1002 1.05L14.3835 1.33333L14.5919 1.61667L14.7252 1.89167L14.8085 2.14167L14.8419 2.35833L14.8585 2.525L14.8502 2.63333V7.08333L14.8085 7.60833L14.7002 8.06667L14.5252 8.45L14.3085 8.76667L14.0585 9.025L13.7835 9.23333L13.4919 9.39167L13.2002 9.50833L12.9252 9.59167L12.6752 9.65L12.4585 9.68333L12.2835 9.7H7.30853L6.73353 9.74167L6.24186 9.85833L5.82519 10.0417L5.48353 10.2667L5.20853 10.5333L4.98353 10.825L4.81686 11.125L4.69186 11.4333L4.60853 11.725L4.5502 11.9917L4.51686 12.2167L4.5002 12.3917V14.9417H2.64186L2.46686 14.9167L2.23353 14.8583L1.96686 14.7583L1.6752 14.6083L1.3752 14.3917L1.0752 14.0917L0.783529 13.7083L0.516862 13.2167L0.283529 12.6083L0.108529 11.875L-0.00813802 11L-0.0498047 9.975L0.00019531 8.95833L0.133529 8.09167L0.333529 7.36667L0.600195 6.775L0.900195 6.3L1.23353 5.93333L1.58353 5.65833L1.93353 5.45833L2.26686 5.325L2.56686 5.24167L2.83353 5.2L3.03353 5.19167H3.16686L3.21686 5.2H10.0169V4.50833H5.1502L5.14186 2.21667L5.1252 1.90833L5.16686 1.625L5.25853 1.36667L5.4002 1.13333L5.60853 0.916667L5.86686 0.725L6.18353 0.558333L6.5502 0.408333L6.9752 0.283333L7.45853 0.183333L7.99186 0.1L8.58353 0.05L9.22519 0.0166667L9.9252 0L10.9835 0.0416667L11.8752 0.15ZM6.6252 1.8L6.43353 2.075L6.36686 2.41667L6.43353 2.75833L6.6252 3.04167L6.9002 3.225L7.24186 3.3L7.58353 3.225L7.85853 3.04167L8.0502 2.75833L8.11686 2.41667L8.0502 2.075L7.85853 1.8L7.58353 1.61667L7.24186 1.54167L6.9002 1.61667L6.6252 1.8ZM17.5335 5.09167L17.7669 5.14167L18.0335 5.24167L18.3252 5.39167L18.6252 5.61667L18.9252 5.90833L19.2169 6.3L19.4835 6.79167L19.7169 7.4L19.8919 8.13333L20.0085 9L20.0502 10.025L20.0002 11.05L19.8669 11.9167L19.6669 12.6333L19.4002 13.225L19.1002 13.7L18.7669 14.075L18.4169 14.35L18.0669 14.55L17.7335 14.6833L17.4335 14.7583L17.1669 14.8L16.9669 14.8167L16.8335 14.8083H9.98353V15.4917H14.8502L14.8585 17.7917L14.8752 18.0917L14.8335 18.375L14.7419 18.6333L14.6002 18.875L14.3919 19.0833L14.1335 19.2833L13.8169 19.45L13.4502 19.5917L13.0252 19.7167L12.5419 19.825L12.0085 19.9L11.4169 19.9583L10.7752 19.9917L10.0752 20L9.01686 19.9667L8.1252 19.85L7.3752 19.6833L6.76686 19.475L6.2752 19.225L5.9002 18.95L5.61686 18.6667L5.40853 18.3833L5.2752 18.1083L5.19186 17.8583L5.15853 17.65L5.14186 17.4833L5.1502 17.375V12.925L5.19186 12.3917L5.3002 11.9417L5.4752 11.5583L5.69186 11.2417L5.94186 10.975L6.21686 10.775L6.50853 10.6083L6.8002 10.4917L7.0752 10.4083L7.3252 10.3583L7.54186 10.325L7.71686 10.3083L7.8252 10.3H12.6919L13.2669 10.2583L13.7585 10.1417L14.1752 9.96667L14.5169 9.73333L14.7919 9.46667L15.0169 9.175L15.1835 8.875L15.3085 8.575L15.3919 8.28333L15.4502 8.01667L15.4835 7.78333L15.5002 7.60833V5.05833H17.2419L17.3585 5.06667L17.5335 5.09167ZM12.1419 16.9667L11.9502 17.2417L11.8835 17.5833L11.9502 17.925L12.1419 18.2L12.4169 18.3917L12.7585 18.4583L13.1002 18.3917L13.3752 18.2L13.5669 17.925L13.6335 17.5833L13.5669 17.2417L13.3752 16.9667L13.1002 16.775L12.7585 16.7083L12.4169 16.775L12.1419 16.9667Z", fill: "white" }) }), _jsx("defs", { children: _jsx("clipPath", { id: "clip0_42_2966", children: _jsx("rect", { width: "20", height: "20", fill: "white" }) }) })] }));
12
+ return (_jsxs(_Fragment, { children: [showLabel ? _jsx(_Fragment, { children: "Python" }) : null, _jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: size, height: size, viewBox: "0 0 24 24", fill: "none", children: [_jsx("path", { d: "M9.86 2C9.10148 2 8.37403 2.30132 7.83767 2.83767C7.30132 3.37403 7 4.10148 7 4.86V6.54H11.29C11.68 6.54 12 7.11 12 7.5H4.86C4.10148 7.5 3.37403 7.80132 2.83767 8.33767C2.30132 8.87403 2 9.60148 2 10.36V14.141C2 14.8995 2.30132 15.627 2.83767 16.1633C3.37403 16.6997 4.10148 17.001 4.86 17.001H6.04V14.321C6.03868 13.9459 6.11143 13.5742 6.25407 13.2273C6.3967 12.8803 6.60642 12.565 6.8712 12.2993C7.13598 12.0336 7.45061 11.8227 7.79704 11.6789C8.14347 11.535 8.51489 11.461 8.89 11.461H14.14C15.72 11.461 17 10.19 17 8.61V4.86C17 4.10148 16.6987 3.37403 16.1623 2.83767C15.626 2.30132 14.8985 2 14.14 2H9.86ZM9.14 3.61C9.54 3.61 9.86 3.73 9.86 4.32C9.86 4.91 9.54 5.211 9.14 5.211C8.75 5.211 8.43 4.911 8.43 4.321C8.43 3.731 8.75 3.61 9.14 3.61Z", fill: "#0288D1" }), _jsx("path", { d: "M17.959 7V9.68C17.9602 10.055 17.8873 10.4266 17.7446 10.7734C17.602 11.1202 17.3922 11.4355 17.1274 11.7011C16.8627 11.9667 16.5481 12.1774 16.2017 12.3212C15.8554 12.465 15.484 12.539 15.109 12.539H9.86C9.48489 12.5377 9.11321 12.6104 8.76628 12.7531C8.41935 12.8957 8.10399 13.1054 7.83828 13.3702C7.57257 13.635 7.36175 13.9496 7.2179 14.296C7.07405 14.6425 7 15.0139 7 15.389V19.139C7 19.8975 7.30132 20.625 7.83767 21.1613C8.37403 21.6977 9.10148 21.999 9.86 21.999H14.14C14.8983 21.999 15.6256 21.6978 16.162 21.1617C16.6983 20.6255 16.9997 19.8983 17 19.14V17.46H12.709C12.319 17.46 12 16.89 12 16.5H19.14C19.8985 16.5 20.626 16.1987 21.1623 15.6623C21.6987 15.126 22 14.3985 22 13.64V9.86C22 9.10148 21.6987 8.37403 21.1623 7.83767C20.626 7.30132 19.8985 7 19.14 7H17.959ZM8.32 11.513L8.316 11.517L8.354 11.513H8.32ZM14.86 18.789C15.25 18.789 15.57 19.089 15.57 19.679C15.57 19.7722 15.5516 19.8646 15.516 19.9507C15.4803 20.0368 15.428 20.1151 15.362 20.181C15.2961 20.247 15.2178 20.2993 15.1317 20.335C15.0456 20.3706 14.9532 20.389 14.86 20.389C14.46 20.389 14.14 20.269 14.14 19.679C14.14 19.089 14.46 18.789 14.86 18.789Z", fill: "#FDD835" })] })] }));
13
13
  }
14
14
  if (language === 'go') {
15
- return (_jsx("svg", { viewBox: "0 0 128 128", width: size, height: size, children: _jsx("path", { d: "M108.7 64.4c-1.6-1.2-3.8-1.9-6-1.9-.1-3.6-.2-7.2-.2-10.7-.1-9.5-.1-19.3-2.6-28.6 6.5-2.5 6.2-7.6 5.9-9.2-.7-3.8-4-7.9-9-7.9-1.9 0-3.9.6-5.8 1.9C83.4 1.6 73 .5 62.5.5 53 1.3 46.4 2.8 41 5.4c-2.3 1.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 0 4.6 1 6 .5.7 1.2 1.1 1.8 1.1.9 0 1.9-.7 2.8-1.8.6 1 1.5 1.7 2.7 1.9h.2c.2-.1.4-.2.6-.2.7-.2 1.4-.5 1.9-1.3v-.1c.3-1.4.1-2.9 0-4.3l-.1-1.2c.5.2 1 .3 1.5.3 1 0 1.8-.4 2.5-1.2.9-1 1.2-2 1-3-.1-2.3-2.4-4-4.6-5zm-5.9 13.2c-.9 1.1-1.7 1.7-2.4 1.7-.5 0-.9-.3-1.3-.7-.9-1.2-1.3-3.7-.9-5.6l.5-.1h.2l.6-.1h.1l1.2-.4.6-.2c.1 0 .1 0 .2-.1.2-.1.3-.1.5-.1.2-.1.4-.1.7-.2h.2l-.1 1.3c-.1 1.3-.2 2.9-.1 4.5zm5.2-3.3c.1 1.3.2 2.7 0 4-.3.6-.8.7-1.5 1l-.6.2c-1-.2-1.8-.8-2.2-1.8-.2-1.5-.1-3 .1-4.6l.1-1.5h.1c1.1 0 2.1.5 3.1.9l.7.3c.1.4.2.9.2 1.5zm4.1-2.7c-.6.7-1.3 1-2 1-.6 0-1.1-.2-1.7-.4-.3-.1-.6-.2-.9-.4-1.1-.4-2.2-.9-3.4-.9h-1.3l-.4.1c-.1 0-.2 0-.3.1-.2 0-.3.1-.5.2-.1 0-.2 0-.2.1l-.8.3c-.1.1-.3.1-.4.1l-.3.1-.3.1c-.2.1-.3.1-.5.1-.1 0-.2 0-.3.1l-.5.1h-.2l-.6.1c-1 0-1.7-.4-2.2-1.3-.6-1-.6-2.3.1-3.5.7-1.2 1.9-2.1 3.1-2.3 1.2 2.5 8.1 2.2 9.9-.2 2 .9 4.2 2.5 4.5 4.2.2.7-.1 1.5-.8 2.3zM58 29.4z" }) }));
15
+ return (_jsxs(_Fragment, { children: [showLabel ? _jsx(_Fragment, { children: "Go" }) : null, _jsx("svg", { viewBox: "0 0 128 128", width: size, height: size, className: className, children: _jsx("path", { d: "M108.7 64.4c-1.6-1.2-3.8-1.9-6-1.9-.1-3.6-.2-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}));
16
16
  }
17
17
  if (language === 'ruby') {
18
- return (_jsxs("svg", { width: size, height: size, viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [_jsx("g", { clipPath: "url(#clip0_42_2969)", children: _jsx("path", { d: "M16.7967 0.0691243C19.3242 0.506624 20.0408 2.23412 19.9875 4.04412L20 4.01829L18.8625 18.925L4.075 19.9383H4.08833C2.86083 19.8866 0.125 19.7741 0 15.9491L1.37083 13.4491L3.72 18.9375L4.13917 19.9141L6.47667 12.2941L6.45167 12.3L6.465 12.275L14.1775 14.7383L13.0142 10.2125L12.1892 6.96246L19.5392 6.48829L19.0267 6.06329L13.75 1.76162L16.7992 0.060791L16.7967 0.0691243ZM4.275 4.22746C7.2425 1.28329 11.0725 -0.456709 12.5433 1.02746C14.0117 2.50829 12.4558 6.11496 9.4825 9.05746C6.51333 12.0008 2.73 13.8358 1.2625 12.355C-0.209167 10.8741 1.3 7.17412 4.2725 4.22996L4.275 4.22746Z", fill: "white" }) }), _jsx("defs", { children: _jsx("clipPath", { id: "clip0_42_2969", children: _jsx("rect", { width: "20", height: "20", fill: "white" }) }) })] }));
18
+ return (_jsxs(_Fragment, { children: [showLabel ? _jsx(_Fragment, { children: "Ruby" }) : null, _jsxs("svg", { width: size, height: size, viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", className: className, children: [_jsx("g", { clipPath: "url(#clip0_42_2969)", children: _jsx("path", { d: "M16.7967 0.0691243C19.3242 0.506624 20.0408 2.23412 19.9875 4.04412L20 4.01829L18.8625 18.925L4.075 19.9383H4.08833C2.86083 19.8866 0.125 19.7741 0 15.9491L1.37083 13.4491L3.72 18.9375L4.13917 19.9141L6.47667 12.2941L6.45167 12.3L6.465 12.275L14.1775 14.7383L13.0142 10.2125L12.1892 6.96246L19.5392 6.48829L19.0267 6.06329L13.75 1.76162L16.7992 0.060791L16.7967 0.0691243ZM4.275 4.22746C7.2425 1.28329 11.0725 -0.456709 12.5433 1.02746C14.0117 2.50829 12.4558 6.11496 9.4825 9.05746C6.51333 12.0008 2.73 13.8358 1.2625 12.355C-0.209167 10.8741 1.3 7.17412 4.2725 4.22996L4.275 4.22746Z", fill: "white" }) }), _jsx("defs", { children: _jsx("clipPath", { id: "clip0_42_2969", children: _jsx("rect", { width: "20", height: "20", fill: "white" }) }) })] })] }));
19
19
  }
20
20
  if (language === 'php') {
21
- return (_jsx("svg", { viewBox: "0 0 128 128", width: size, height: size, children: _jsx("path", { d: "M64 30.332C28.654 30.332 0 45.407 0 64s28.654 33.668 64 33.668c35.345 0 64-15.075 64-33.668S99.346 30.332 64 30.332zm-5.982 9.81h7.293v.003l-1.745 8.968h6.496c4.087 0 6.908.714 8.458 2.139 1.553 1.427 2.017 2.017 3.737 3.737 5.946 1.719 2.209-2.209 2.209-5.928 0-8.137zm-51.051 51.372c0-3.757-1.072-5.686-3.214-5.791a6.03 6.03 0 00-2.495.409c-.646.231-1.082.461-1.311.692v8.968c1.371.86 2.588 1.26 3.649 1.197 2.247-.148 3.371-1.971 3.371-5.475zm2.643.157c0 1.909-.447 3.493-1.348 4.753-1.003 1.427-2.394 2.16-4.172 2.201-1.34.043-2.721-.378-4.142-1.258v8.151l-2.298-.82V107.14c.377-.462.862-.859 1.451-1.196 1.368-.798 3.031-1.207 4.987-1.228l.033.032c1.788-.022 3.166.712 4.134 2.201.902 1.366 1.355 3.117 1.355 5.257zm14.049 5.349c0 2.56-.257 4.333-.77 5.318-.516.986-1.497 1.773-2.945 2.359-1.174.463-2.444.714-3.808.757l-.38-1.448c1.386-.188 2.362-.378 2.928-.566 1.114-.377 1.878-.955 2.298-1.73.337-.631.503-1.835.503-3.618v-.599a11.809 11.809 0 01-4.941 1.068c-1.132 0-2.13-.354-2.99-1.068-.966-.777-1.449-1.764-1.449-2.958v-9.566l2.299-.787v9.63c0 1.028.332 1.82.996 2.376s1.524.822 2.578.803c1.054-.022 2.183-.431 3.382-1.228v-11.234h2.299v12.491zm8.973 1.479a9.457 9.457 0 01-.757.032c-1.3 0-2.314-.309-3.038-.93-.722-.622-1.084-1.479-1.084-2.573v-9.054h-1.574v-1.446h1.574v-3.84l2.296-.817v4.657h2.583v1.446h-2.583v8.991c0 .862.231 1.474.694 1.83.397.295 1.029.463 1.889.506v1.198zm13.917-.189h-2.298v-8.873c0-.902-.211-1.68-.631-2.329-.485-.734-1.159-1.102-2.024-1.102-1.054 0-2.372.556-3.954 1.668v10.636h-2.298V97.637l2.298-.725v9.659c1.469-1.068 3.073-1.604 4.816-1.604 1.218 0 2.203.41 2.958 1.228.757.817 1.134 1.836 1.134 3.053v9.597h-.001zm12.218-7.157c0-1.444-.274-2.636-.82-3.579-.649-1.149-1.657-1.756-3.021-1.818-2.52.146-3.778 1.951-3.778 5.412 0 1.587.262 2.912.79 3.976.674 1.356 1.685 2.024 3.033 2.002 2.531-.02 3.796-2.017 3.796-5.993zm2.518.015c0 2.055-.526 3.765-1.575 5.131-1.154 1.528-2.749 2.296-4.783 2.296-2.017 0-3.589-.768-4.723-2.296-1.028-1.366-1.542-3.076-1.542-5.131 0-1.932.556-3.556 1.668-4.879 1.174-1.403 2.718-2.107 4.627-2.107 1.909 0 3.463.704 4.66 2.107 1.111 1.323 1.668 2.947 1.668 4.879zm13.178 7.142h-2.299v-9.376c0-1.028-.31-1.831-.928-2.409-.619-.576-1.443-.855-2.472-.833-1.091.021-2.13.378-3.116 1.069v11.549h-2.299v-11.833c1.323-.963 2.54-1.592 3.652-1.886 1.049-.274 1.974-.41 2.771-.41.545 0 1.059.053 1.542.158.903.209 1.637.596 2.203 1.164.631.629.946 1.384.946 2.267v10.54z" }) }));
21
+ return (_jsxs(_Fragment, { children: [showLabel ? _jsx(_Fragment, { children: "PHP" }) : null, _jsx("svg", { viewBox: "0 0 128 128", width: size, height: size, className: className, children: _jsx("path", { d: "M64 30.332C28.654 30.332 0 45.407 0 64s28.654 33.668 64 33.668c35.345 0 64-15.075 64-33.668S99.346 30.332 64 30.332zm-5.982 9.81h7.293v.003l-1.745 8.968h6.496c4.087 0 6.908.714 8.458 2.139 1.553 1.427 2.017 2.017 3.737 3.737 5.946 1.719 2.209-2.209 2.209-5.928 0-8.137zm-51.051 51.372c0-3.757-1.072-5.686-3.214-5.791a6.03 6.03 0 00-2.495.409c-.646.231-1.082.461-1.311.692v8.968c1.371.86 2.588 1.26 3.649 1.197 2.247-.148 3.371-1.971 3.371-5.475zm2.643.157c0 1.909-.447 3.493-1.348 4.753-1.003 1.427-2.394 2.16-4.172 2.201-1.34.043-2.721-.378-4.142-1.258v8.151l-2.298-.82V107.14c.377-.462.862-.859 1.451-1.196 1.368-.798 3.031-1.207 4.987-1.228l.033.032c1.788-.022 3.166.712 4.134 2.201.902 1.366 1.355 3.117 1.355 5.257zm14.049 5.349c0 2.56-.257 4.333-.77 5.318-.516.986-1.497 1.773-2.945 2.359-1.174.463-2.444.714-3.808.757l-.38-1.448c1.386-.188 2.362-.378 2.928-.566 1.114-.377 1.878-.955 2.298-1.73.337-.631.503-1.835.503-3.618v-.599a11.809 11.809 0 01-4.941 1.068c-1.132 0-2.13-.354-2.99-1.068-.966-.777-1.449-1.764-1.449-2.958v-9.566l2.299-.787v9.63c0 1.028.332 1.82.996 2.376s1.524.822 2.578.803c1.054-.022 2.183-.431 3.382-1.228v-11.234h2.299v12.491zm8.973 1.479a9.457 9.457 0 01-.757.032c-1.3 0-2.314-.309-3.038-.93-.722-.622-1.084-1.479-1.084-2.573v-9.054h-1.574v-1.446h1.574v-3.84l2.296-.817v4.657h2.583v1.446h-2.583v8.991c0 .862.231 1.474.694 1.83.397.295 1.029.463 1.889.506v1.198zm13.917-.189h-2.298v-8.873c0-.902-.211-1.68-.631-2.329-.485-.734-1.159-1.102-2.024-1.102-1.054 0-2.372.556-3.954 1.668v10.636h-2.298V97.637l2.298-.725v9.659c1.469-1.068 3.073-1.604 4.816-1.604 1.218 0 2.203.41 2.958 1.228.757.817 1.134 1.836 1.134 3.053v9.597h-.001zm12.218-7.157c0-1.444-.274-2.636-.82-3.579-.649-1.149-1.657-1.756-3.021-1.818-2.52.146-3.778 1.951-3.778 5.412 0 1.587.262 2.912.79 3.976.674 1.356 1.685 2.024 3.033 2.002 2.531-.02 3.796-2.017 3.796-5.993zm2.518.015c0 2.055-.526 3.765-1.575 5.131-1.154 1.528-2.749 2.296-4.783 2.296-2.017 0-3.589-.768-4.723-2.296-1.028-1.366-1.542-3.076-1.542-5.131 0-1.932.556-3.556 1.668-4.879 1.174-1.403 2.718-2.107 4.627-2.107 1.909 0 3.463.704 4.66 2.107 1.111 1.323 1.668 2.947 1.668 4.879zm13.178 7.142h-2.299v-9.376c0-1.028-.31-1.831-.928-2.409-.619-.576-1.443-.855-2.472-.833-1.091.021-2.13.378-3.116 1.069v11.549h-2.299v-11.833c1.323-.963 2.54-1.592 3.652-1.886 1.049-.274 1.974-.41 2.771-.41.545 0 1.059.053 1.542.158.903.209 1.637.596 2.203 1.164.631.629.946 1.384.946 2.267v10.54z" }) })] }));
22
22
  }
23
23
  return;
24
24
  };
25
- return _jsx("div", { className: "text-xs font-mono text-muted-foreground", children: renderIcon(language) });
25
+ return (_jsx("div", { className: cn('text-muted-foreground', {
26
+ 'text-sm flex items-center justify-center flex-row gap-2': showLabel,
27
+ 'font-mono text-xs': !showLabel,
28
+ }), children: renderIcon(language) }));
26
29
  };
@@ -5,8 +5,8 @@ declare const baseIcon: (props?: ({
5
5
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
6
6
  type Props = PropsWithChildren<{
7
7
  text: string;
8
- subtitle?: string;
9
8
  variant: VariantProps<typeof baseIcon>['variant'];
9
+ className?: string;
10
10
  }>;
11
11
  export declare const NodeHeader: React.FC<Props>;
12
12
  export {};
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { cn } from '@/lib/utils';
3
3
  import { cva } from 'class-variance-authority';
4
4
  import { CalendarClock, CircleOff, Link2, Waypoints } from 'lucide-react';
5
- const baseIcon = cva('rounded-md p-3', {
5
+ const baseIcon = cva('rounded-md p-2', {
6
6
  variants: {
7
7
  variant: {
8
8
  event: 'bg-[rgba(30,118,231,0.2)] text-[rgb(30,118,231)]',
@@ -27,4 +27,4 @@ const NodeIcon = ({ variant }) => {
27
27
  }
28
28
  return _jsx("div", { className: cn(baseIcon({ variant })), children: "Icon" });
29
29
  };
30
- export const NodeHeader = ({ text, variant, subtitle, children }) => (_jsxs("div", { className: "flex items-center gap-4 p-4", children: [_jsx("div", { className: baseIcon({ variant }), children: _jsx(NodeIcon, { variant: variant }) }), _jsxs("div", { className: "flex flex-1 justify-between items-start gap-4", children: [_jsxs("div", { className: "flex flex-col", children: [_jsx("div", { className: "font-semibold text-md", children: text }), subtitle && _jsx("div", { className: "text-sm text-muted-foreground", children: subtitle })] }), children] })] }));
30
+ export const NodeHeader = ({ text, variant, children, className }) => (_jsxs("div", { className: cn('flex items-center gap-2 p-2', className), children: [_jsx("div", { className: baseIcon({ variant }), children: _jsx(NodeIcon, { variant: variant }) }), _jsxs("div", { className: "flex flex-1 justify-between items-start gap-4", children: [_jsx("div", { className: "flex flex-col", children: _jsx("div", { className: "text-sm font-semibold leading-[1.25] tracking-[-0.25px]", children: text }) }), children] })] }));
@@ -1,18 +1,12 @@
1
- import { PanelDetailItem } from '@motiadev/ui';
2
1
  import React from 'react';
3
2
  type NodeSidebarProps = {
3
+ content: string;
4
4
  title: string;
5
5
  subtitle?: string;
6
6
  variant: 'event' | 'api' | 'noop' | 'cron';
7
7
  language?: string;
8
8
  isOpen: boolean;
9
9
  onClose: () => void;
10
- details?: PanelDetailItem[];
11
- subscribes?: string[];
12
- emits?: Array<string | {
13
- topic: string;
14
- label?: string;
15
- }>;
16
10
  };
17
11
  export declare const NodeSidebar: React.FC<NodeSidebarProps>;
18
12
  export {};
@@ -1,20 +1,10 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { JsonEditor } from '@/components/endpoints/json-editor';
2
3
  import { Sidebar } from '@/components/sidebar/sidebar';
3
- import { LanguageIndicator } from '@/publicComponents/base-node/language-indicator';
4
4
  import { X } from 'lucide-react';
5
- import { Emits } from './emits';
6
- import { Subscribe } from './subscribe';
7
- export const NodeSidebar = ({ title, subtitle, variant, language, isOpen, onClose, details, subscribes, emits, }) => {
5
+ import { LanguageIndicator } from './language-indicator';
6
+ export const NodeSidebar = ({ content, title, subtitle, language, isOpen, onClose }) => {
8
7
  if (!isOpen)
9
8
  return null;
10
- return (_jsx(Sidebar, { title: title, subtitle: subtitle, onClose: onClose, actions: [{ icon: _jsx(X, {}), onClick: onClose, label: 'Close' }], details: [
11
- { label: 'Type', value: _jsx("div", { className: "capitalize flex gap-2 items-center", children: variant }) },
12
- {
13
- label: 'Language',
14
- value: (_jsxs("div", { className: "capitalize flex gap-2 items-center", children: [_jsx(LanguageIndicator, { language: language }), language] })),
15
- },
16
- subscribes ? { label: 'Subscribes', value: _jsx(Subscribe, { subscribes: subscribes }) } : undefined,
17
- emits ? { label: 'Emits', value: _jsx(Emits, { emits: emits }) } : undefined,
18
- ...(details ?? []),
19
- ].filter((item) => !!item) }));
9
+ return (_jsxs(Sidebar, { title: title, subtitle: subtitle, initialWidth: 600, contentClassName: "p-0 h-full gap-0", onClose: onClose, actions: [{ icon: _jsx(X, {}), onClick: onClose, label: 'Close' }], children: [_jsxs("div", { className: "flex items-center py-2 px-5 dark:bg-[#1e1e1e] gap-2 justify-center", children: [_jsx("div", { className: "text-sm text-muted-foreground", children: "Read only" }), _jsx("div", { className: "flex-1" }), _jsx(LanguageIndicator, { language: language, className: "w-4 h-4", size: 16, showLabel: true })] }), _jsx(JsonEditor, { value: content, language: language, height: 'calc(100vh - 160px)', readOnly: true })] }));
20
10
  };
@@ -2,5 +2,5 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { Clock } from 'lucide-react';
3
3
  import { BaseNode } from './base-node/base-node';
4
4
  export const CronNode = ({ data, children }) => {
5
- return (_jsxs(BaseNode, { data: data, variant: "cron", title: data.name, subtitle: data.description, language: data.language, disableTargetHandle: !data.virtualSubscribes?.length, disableSourceHandle: !data.virtualEmits?.length && !data.emits?.length, emits: data.emits, subscribes: data.virtualSubscribes, children: [_jsxs("div", { className: "text-xs text-muted-foreground flex items-center gap-2", children: [_jsx(Clock, { className: "w-3 h-3" }), " ", data.cronExpression] }), children] }));
5
+ return (_jsxs(BaseNode, { data: data, variant: "cron", title: data.name, subtitle: data.description, language: data.language, disableTargetHandle: !data.virtualSubscribes?.length, disableSourceHandle: !data.virtualEmits?.length && !data.emits?.length, children: [_jsxs("div", { className: "text-xs text-muted-foreground flex items-center gap-2", children: [_jsx(Clock, { className: "w-3 h-3" }), " ", data.cronExpression] }), children] }));
6
6
  };
@@ -1,5 +1,5 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { BaseNode } from './base-node/base-node';
3
3
  export const EventNode = ({ data, children }) => {
4
- return (_jsx(BaseNode, { data: data, variant: "event", title: data.name, subtitle: data.description, language: data.language, disableSourceHandle: !data.emits?.length && !data.virtualEmits?.length, disableTargetHandle: !data.subscribes?.length && !data.virtualSubscribes?.length, emits: data.emits, subscribes: data.subscribes, children: children }));
4
+ return (_jsx(BaseNode, { data: data, variant: "event", title: data.name, subtitle: data.description, language: data.language, disableSourceHandle: !data.emits?.length && !data.virtualEmits?.length, disableTargetHandle: !data.subscribes?.length && !data.virtualSubscribes?.length, children: children }));
5
5
  };