feat: add initial data node

This commit is contained in:
2026-03-10 23:49:28 +01:00
parent dd1de7cb1e
commit 38e1ae3692
12 changed files with 550 additions and 10 deletions

View File

@@ -4,13 +4,14 @@
*/
import React from 'react'
import { ScrollText, Sparkles, Variable, Code2 } from 'lucide-react'
import { ScrollText, Sparkles, Variable, Code2, Database } from 'lucide-react'
import { registerNodeType } from './nodeRegistry'
import { NODE_HELP } from './nodeHelp'
import ConfigNode from '../components/nodes/ConfigNode'
import RenderingNode from '../components/nodes/RenderingNode'
import VariableNode from '../components/nodes/VariableNode'
import FunctionNode from '../components/nodes/FunctionNode'
import DataNode from '../components/nodes/DataNode'
const ICON_CLASS = 'mr-2 h-4 w-4'
@@ -24,7 +25,7 @@ export function registerBuiltinNodes(): void {
hasInput: true,
hasOutput: true,
classification: 'psyche',
allowedSourceTypes: ['config', 'variable', 'function'],
allowedSourceTypes: ['config', 'variable', 'function', 'data'],
allowedTargetTypes: ['config', 'render'],
help: NODE_HELP.config,
menuLabel: 'Config',
@@ -73,6 +74,22 @@ export function registerBuiltinNodes(): void {
menuIcon: <Variable className={ICON_CLASS} />,
})
registerNodeType({
id: 'data',
component: DataNode,
defaultStyle: { width: 360, height: 280 },
defaultData: { rows: [], columns: [], fileName: '' },
idPrefix: 'data_',
hasInput: false,
hasOutput: true,
classification: 'physis',
allowedTargetTypes: ['config'],
help: NODE_HELP.data,
menuLabel: 'Data',
menuIcon: <Database className={ICON_CLASS} />,
connectionLabel: 'data source',
})
registerNodeType({
id: 'function',
component: FunctionNode,