diff --git a/frontend/src/components/nodes/VariableNode.tsx b/frontend/src/components/nodes/VariableNode.tsx index e904e4f..a9fc806 100644 --- a/frontend/src/components/nodes/VariableNode.tsx +++ b/frontend/src/components/nodes/VariableNode.tsx @@ -47,9 +47,14 @@ function coerceValue(raw: string, valueType: ValueType): string | number | boole } } -function VariableNodeComponent({ id, data, selected }: Props) { +function VariableNodeComponent({ id, data, width, height, selected }: Props) { const { updateData } = useAbstractNode(id, data ?? {}) + const dimensions = + width != null && height != null && width > 0 && height > 0 + ? { width, height } + : undefined + const valueType: ValueType = data?.valueType ?? 'string' const value = data?.value ?? DEFAULT_BY_TYPE[valueType] const displayValue = typeof value === 'string' ? value : String(value) @@ -79,7 +84,7 @@ function VariableNodeComponent({ id, data, selected }: Props) { ) return ( - }> + }> } title={} /> diff --git a/frontend/src/lib/registerBuiltinNodes.tsx b/frontend/src/lib/registerBuiltinNodes.tsx index ca460d1..549f420 100644 --- a/frontend/src/lib/registerBuiltinNodes.tsx +++ b/frontend/src/lib/registerBuiltinNodes.tsx @@ -62,7 +62,7 @@ export function registerBuiltinNodes(): void { registerNodeType({ id: 'variable', component: VariableNode, - defaultStyle: { width: 224, height: 180 }, + defaultStyle: { width: 224, height: 240 }, defaultData: { value: '', valueType: 'string' }, idPrefix: 'var_', hasInput: false,