This commit is contained in:
2026-03-08 00:04:27 +01:00
parent c0a4ee4ec8
commit 9e5fada009
4 changed files with 22 additions and 19 deletions

View File

@@ -56,7 +56,7 @@ export function AnimatedEdge({
id={startId} id={startId}
markerWidth={DOT_MARKER_R * 2} markerWidth={DOT_MARKER_R * 2}
markerHeight={DOT_MARKER_R * 2} markerHeight={DOT_MARKER_R * 2}
refX={DOT_MARKER_R + 5} refX={DOT_MARKER_R + 10}
refY={DOT_MARKER_R} refY={DOT_MARKER_R}
orient="auto" orient="auto"
> >
@@ -72,7 +72,7 @@ export function AnimatedEdge({
id={endId} id={endId}
markerWidth={DOT_MARKER_R * 2} markerWidth={DOT_MARKER_R * 2}
markerHeight={DOT_MARKER_R * 2} markerHeight={DOT_MARKER_R * 2}
refX={DOT_MARKER_R - 5} refX={DOT_MARKER_R - 10}
refY={DOT_MARKER_R} refY={DOT_MARKER_R}
orient="auto" orient="auto"
> >

View File

@@ -12,7 +12,7 @@ import {
BaseNodeFooter, BaseNodeFooter,
BaseNodeHeaderRow, BaseNodeHeaderRow,
} from './BaseNode' } from './BaseNode'
import { ScrollText } from 'lucide-react' import { Code2, ScrollText, Variable } from 'lucide-react'
import { import {
MenubarItem, MenubarItem,
MenubarSub, MenubarSub,
@@ -173,8 +173,9 @@ export const ConfigNode = memo(function ConfigNode({ id, data, width, height }:
hasDependencies ? ( hasDependencies ? (
<> <>
{connectedConfigNodes.map((n: any) => ( {connectedConfigNodes.map((n: any) => (
<MenubarSub key={`config-${n.id}`}> <MenubarSub key={`${n.id}`}>
<MenubarSubTrigger className="text-xs"> <MenubarSubTrigger className="text-xs flex items-center gap-2">
<ScrollText className="size-3.5 shrink-0" />
{n.data?.title ?? n.id} {n.data?.title ?? n.id}
</MenubarSubTrigger> </MenubarSubTrigger>
<MenubarSubContent> <MenubarSubContent>
@@ -182,26 +183,27 @@ export const ConfigNode = memo(function ConfigNode({ id, data, width, height }:
className="text-xs" className="text-xs"
onClick={() => insertExtendsFromNode(n, 'cursor')} onClick={() => insertExtendsFromNode(n, 'cursor')}
> >
extend Extend
</MenubarItem> </MenubarItem>
<MenubarItem <MenubarItem
className="text-xs" className="text-xs"
onClick={() => insertIncludeFromNode(n, 'cursor')} onClick={() => insertIncludeFromNode(n, 'cursor')}
> >
include Include
</MenubarItem> </MenubarItem>
<MenubarItem <MenubarItem
className="text-xs" className="text-xs"
onClick={() => insertImportFromNode(n, 'cursor')} onClick={() => insertImportFromNode(n, 'cursor')}
> >
import Import
</MenubarItem> </MenubarItem>
</MenubarSubContent> </MenubarSubContent>
</MenubarSub> </MenubarSub>
))} ))}
{connectedVariableNodes.map((n: any) => ( {connectedVariableNodes.map((n: any) => (
<MenubarSub key={`var-${n.id}`}> <MenubarSub key={`${n.id}`}>
<MenubarSubTrigger className="text-xs"> <MenubarSubTrigger className="text-xs flex items-center gap-2">
<Variable className="size-3.5 shrink-0" />
{n.id} {n.id}
</MenubarSubTrigger> </MenubarSubTrigger>
<MenubarSubContent> <MenubarSubContent>
@@ -209,14 +211,15 @@ export const ConfigNode = memo(function ConfigNode({ id, data, width, height }:
className="text-xs" className="text-xs"
onClick={() => insertVariableReference(n, 'cursor')} onClick={() => insertVariableReference(n, 'cursor')}
> >
Insert at cursor Insert
</MenubarItem> </MenubarItem>
</MenubarSubContent> </MenubarSubContent>
</MenubarSub> </MenubarSub>
))} ))}
{connectedFunctionNodes.map((n: any) => ( {connectedFunctionNodes.map((n: any) => (
<MenubarSub key={`fn-${n.id}`}> <MenubarSub key={`${n.id}`}>
<MenubarSubTrigger className="text-xs"> <MenubarSubTrigger className="text-xs flex items-center gap-2">
<Code2 className="size-3.5 shrink-0" />
{n.id} {n.id}
</MenubarSubTrigger> </MenubarSubTrigger>
<MenubarSubContent> <MenubarSubContent>
@@ -224,7 +227,7 @@ export const ConfigNode = memo(function ConfigNode({ id, data, width, height }:
className="text-xs" className="text-xs"
onClick={() => insertFunctionCall(n, 'cursor')} onClick={() => insertFunctionCall(n, 'cursor')}
> >
Insert at cursor Insert
</MenubarItem> </MenubarItem>
</MenubarSubContent> </MenubarSubContent>
</MenubarSub> </MenubarSub>

View File

@@ -16,7 +16,7 @@ export function InputHandle({ id }: NodeHandleProps) {
top: 20, top: 20,
width: 20, width: 20,
height: 20, height: 20,
left: -10, left: -15,
borderRadius: '9999px', borderRadius: '9999px',
background: 'transparent', background: 'transparent',
border: 'none', border: 'none',
@@ -26,7 +26,7 @@ export function InputHandle({ id }: NodeHandleProps) {
justifyContent: 'center', justifyContent: 'center',
}} }}
> >
<ArrowDownLeft className="w-4 h-4 text-muted-foreground pointer-events-none" /> <ArrowDownLeft className="w-4 h-4 text-foreground pointer-events-none" />
</Handle> </Handle>
) )
} }
@@ -41,7 +41,7 @@ export function OutputHandle({ id }: NodeHandleProps) {
top: 20, top: 20,
width: 20, width: 20,
height: 20, height: 20,
right: -10, right: -15,
borderRadius: '9999px', borderRadius: '9999px',
background: 'transparent', background: 'transparent',
border: 'none', border: 'none',

View File

@@ -62,14 +62,14 @@ const DEFAULT_DATA: Record<string, any> = {
export function getDefaultDataForType(type: string, newId?: string): any { export function getDefaultDataForType(type: string, newId?: string): any {
const base = { ...DEFAULT_DATA[type] } const base = { ...DEFAULT_DATA[type] }
if (type === 'config' && newId) base.title = `config-${newId}` if (type === 'config' && newId) base.title = `${newId}`
return base return base
} }
/** Data for Reset action: clears code completely for config/function; same as default for others */ /** Data for Reset action: clears code completely for config/function; same as default for others */
export function getResetDataForType(type: string, nodeId?: string): any { export function getResetDataForType(type: string, nodeId?: string): any {
if (type === 'config') { if (type === 'config') {
return { plantuml: '@startuml\n\n@enduml\n', title: nodeId ? `config-${nodeId}` : '' } return { plantuml: '@startuml\n\n@enduml\n', title: nodeId ? `${nodeId}` : '' }
} }
if (type === 'function') { if (type === 'function') {
return { body: '' } return { body: '' }