@nodescript/core
Advanced tools
Comparing version 7.0.3 to 7.1.0
@@ -17,3 +17,3 @@ import { GraphView, NodeView } from '../runtime/index.js'; | ||
isAsync(): boolean; | ||
computeEvalMode(): "auto" | "manual"; | ||
computeEvalMode(): "manual" | "auto"; | ||
emitNodeFunctions(): void; | ||
@@ -20,0 +20,0 @@ private computeEmittedNodes; |
@@ -313,10 +313,17 @@ import { convertAuto, isSchemaCompatible } from '../util/index.js'; | ||
const subgraph = node.getSubgraph(); | ||
if (subgraph) { | ||
const rootNode = subgraph.getRootNode(); | ||
if (rootNode) { | ||
return this.symbols.getNodeSym(rootNode.nodeUid); | ||
} | ||
if (!subgraph) { | ||
return ''; | ||
} | ||
const rootNode = subgraph.getRootNode(); | ||
if (!rootNode) { | ||
return `() => undefined`; | ||
} | ||
return ''; | ||
const sym = this.symbols.getNodeSym(rootNode.nodeUid); | ||
if (this.options.introspect) { | ||
return `(params, ctx) => {` + | ||
`ctx.scopeCaptured.emit({ scopeId: ${JSON.stringify(subgraph.scopeId)}, params });` + | ||
`return ${sym}(params, ctx)` + | ||
`}`; | ||
} | ||
return sym; | ||
} | ||
@@ -323,0 +330,0 @@ emitNodeProps(node) { |
@@ -14,2 +14,3 @@ import { Event } from 'nanoevent'; | ||
nodeEvaluated: Event<t.NodeResult>; | ||
scopeCaptured: Event<t.ScopeData>; | ||
cache: Map<string, any>; | ||
@@ -16,0 +17,0 @@ locals: Map<string, any>; |
@@ -19,2 +19,3 @@ import { Schema } from 'airtight'; | ||
this.nodeEvaluated = parent ? parent.nodeEvaluated : new Event(); | ||
this.scopeCaptured = parent ? parent.scopeCaptured : new Event(); | ||
this.pendingNodeUids = parent ? parent.pendingNodeUids : new Set(); | ||
@@ -21,0 +22,0 @@ } |
@@ -14,2 +14,3 @@ import { Event } from 'nanoevent'; | ||
nodeEvaluated: Event<NodeResult>; | ||
scopeCaptured: Event<ScopeData>; | ||
clear(): void; | ||
@@ -30,1 +31,5 @@ finalize(): Promise<void>; | ||
} | ||
export interface ScopeData { | ||
scopeId: string; | ||
params: any; | ||
} |
{ | ||
"name": "@nodescript/core", | ||
"version": "7.0.3", | ||
"version": "7.1.0", | ||
"type": "module", | ||
@@ -5,0 +5,0 @@ "description": "Visual programming language for Browser and Node", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
193407
3374