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

View File

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

View File

@@ -16,7 +16,7 @@ export function InputHandle({ id }: NodeHandleProps) {
top: 20,
width: 20,
height: 20,
left: -10,
left: -15,
borderRadius: '9999px',
background: 'transparent',
border: 'none',
@@ -26,7 +26,7 @@ export function InputHandle({ id }: NodeHandleProps) {
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>
)
}
@@ -41,7 +41,7 @@ export function OutputHandle({ id }: NodeHandleProps) {
top: 20,
width: 20,
height: 20,
right: -10,
right: -15,
borderRadius: '9999px',
background: 'transparent',
border: 'none',

View File

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