@bian-womp/spark-workbench 0.2.21 → 0.2.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/index.cjs +186 -60
- package/lib/cjs/index.cjs.map +1 -1
- package/lib/cjs/src/misc/DefaultNode.d.ts.map +1 -1
- package/lib/cjs/src/misc/NodeHandles.d.ts.map +1 -1
- package/lib/cjs/src/misc/WorkbenchStudio.d.ts +3 -37
- package/lib/cjs/src/misc/WorkbenchStudio.d.ts.map +1 -1
- package/lib/cjs/src/misc/context/WorkbenchContext.d.ts +34 -1
- package/lib/cjs/src/misc/context/WorkbenchContext.d.ts.map +1 -1
- package/lib/cjs/src/misc/context/WorkbenchContext.provider.d.ts +3 -1
- package/lib/cjs/src/misc/context/WorkbenchContext.provider.d.ts.map +1 -1
- package/lib/cjs/src/misc/mapping.d.ts +1 -0
- package/lib/cjs/src/misc/mapping.d.ts.map +1 -1
- package/lib/cjs/src/runtime/LocalGraphRunner.d.ts.map +1 -1
- package/lib/esm/index.js +186 -60
- package/lib/esm/index.js.map +1 -1
- package/lib/esm/src/misc/DefaultNode.d.ts.map +1 -1
- package/lib/esm/src/misc/NodeHandles.d.ts.map +1 -1
- package/lib/esm/src/misc/WorkbenchStudio.d.ts +3 -37
- package/lib/esm/src/misc/WorkbenchStudio.d.ts.map +1 -1
- package/lib/esm/src/misc/context/WorkbenchContext.d.ts +34 -1
- package/lib/esm/src/misc/context/WorkbenchContext.d.ts.map +1 -1
- package/lib/esm/src/misc/context/WorkbenchContext.provider.d.ts +3 -1
- package/lib/esm/src/misc/context/WorkbenchContext.provider.d.ts.map +1 -1
- package/lib/esm/src/misc/mapping.d.ts +1 -0
- package/lib/esm/src/misc/mapping.d.ts.map +1 -1
- package/lib/esm/src/runtime/LocalGraphRunner.d.ts.map +1 -1
- package/package.json +4 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DefaultNode.d.ts","sourceRoot":"","sources":["../../../../src/misc/DefaultNode.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAEL,KAAK,SAAS,EACd,KAAK,IAAI,EACV,MAAM,eAAe,CAAC;AAOvB,OAAO,EAA2B,KAAK,UAAU,EAAE,MAAM,WAAW,CAAC;AAGrE,eAAO,MAAM,WAAW,yDAuDtB,CAAC;AAGH,wBAAgB,iBAAiB,CAAC,EAChC,EAAE,EACF,KAAK,EACL,UAAU,EACV,KAAK,EACL,MAAM,EACN,YAAY,GACb,EAAE;IACD,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE;QAAE,MAAM,CAAC,EAAE,GAAG,EAAE,CAAC;QAAC,OAAO,CAAC,EAAE,GAAG,EAAE,CAAC;QAAC,MAAM,CAAC,EAAE,GAAG,EAAE,CAAA;KAAE,CAAC;IAChE,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;CAC3B,2CAwDA;AAED,wBAAgB,kBAAkB,CAAC,EACjC,IAAI,EACJ,aAAa,GACd,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,EAAE,MAAM,GAAG,eAAe,CAAC,
|
|
1
|
+
{"version":3,"file":"DefaultNode.d.ts","sourceRoot":"","sources":["../../../../src/misc/DefaultNode.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAEL,KAAK,SAAS,EACd,KAAK,IAAI,EACV,MAAM,eAAe,CAAC;AAOvB,OAAO,EAA2B,KAAK,UAAU,EAAE,MAAM,WAAW,CAAC;AAGrE,eAAO,MAAM,WAAW,yDAuDtB,CAAC;AAGH,wBAAgB,iBAAiB,CAAC,EAChC,EAAE,EACF,KAAK,EACL,UAAU,EACV,KAAK,EACL,MAAM,EACN,YAAY,GACb,EAAE;IACD,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE;QAAE,MAAM,CAAC,EAAE,GAAG,EAAE,CAAC;QAAC,OAAO,CAAC,EAAE,GAAG,EAAE,CAAC;QAAC,MAAM,CAAC,EAAE,GAAG,EAAE,CAAA;KAAE,CAAC;IAChE,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;CAC3B,2CAwDA;AAED,wBAAgB,kBAAkB,CAAC,EACjC,IAAI,EACJ,aAAa,GACd,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,EAAE,MAAM,GAAG,eAAe,CAAC,2CAyI7D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NodeHandles.d.ts","sourceRoot":"","sources":["../../../../src/misc/NodeHandles.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"NodeHandles.d.ts","sourceRoot":"","sources":["../../../../src/misc/NodeHandles.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAyD5C,wBAAgB,WAAW,CAAC,EAC1B,IAAI,EACJ,aAAa,EACb,cAAyC,EACzC,eAA0C,EAC1C,YAAY,EACZ,WAAW,EACX,cAA4F,GAC7F,EAAE;IACD,IAAI,EAAE,UAAU,CAAC;IACjB,aAAa,EAAE,OAAO,CAAC;IACvB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE;QACpB,IAAI,EAAE,OAAO,GAAG,QAAQ,CAAC;QACzB,EAAE,EAAE,MAAM,CAAC;QACX,IAAI,EAAE,QAAQ,GAAG,QAAQ,CAAC;KAC3B,KAAK,MAAM,GAAG,SAAS,CAAC;IACzB,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE;QACnB,IAAI,EAAE,OAAO,GAAG,QAAQ,CAAC;QACzB,EAAE,EAAE,MAAM,CAAC;KACZ,KAAK,KAAK,CAAC,SAAS,CAAC;IACtB,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB,2CAkJA;AAED,eAAe,WAAW,CAAC"}
|
|
@@ -1,40 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
1
|
+
import { type GraphDefinition } from "@bian-womp/spark-graph";
|
|
2
|
+
import { WorkbenchOverrides } from "./context/WorkbenchContext";
|
|
3
3
|
import { InMemoryWorkbench } from "../core/InMemoryWorkbench";
|
|
4
|
-
import {
|
|
5
|
-
import { EngineKind, ExecutionBackendKind, IGraphRunner } from "../runtime/IGraphRunner";
|
|
6
|
-
export type ExampleDescriptor = {
|
|
7
|
-
id: string;
|
|
8
|
-
label: string;
|
|
9
|
-
load: () => Promise<{
|
|
10
|
-
registry?: Registry;
|
|
11
|
-
def: GraphDefinition;
|
|
12
|
-
}>;
|
|
13
|
-
defaultEngine?: EngineKind;
|
|
14
|
-
};
|
|
15
|
-
type WorkbenchOverrides = {
|
|
16
|
-
toString?: (baseToString: (typeId?: string, value?: unknown) => string, ctx: {
|
|
17
|
-
registry: Registry;
|
|
18
|
-
}) => (typeId?: string, value?: unknown) => string;
|
|
19
|
-
toElement?: (baseToElement: (typeId?: string, value?: unknown) => JSX.Element, ctx: {
|
|
20
|
-
registry: Registry;
|
|
21
|
-
}) => (typeId?: string, value?: unknown) => JSX.Element;
|
|
22
|
-
setInput?: (baseSetInput: (handle: string, raw: string | number | undefined) => void, ctx: {
|
|
23
|
-
runner: IGraphRunner;
|
|
24
|
-
selectedNodeId?: string;
|
|
25
|
-
registry: Registry;
|
|
26
|
-
}) => (handle: string, raw: string | number | undefined) => void;
|
|
27
|
-
registerUI?: (baseRegisterUI: (wb: AbstractWorkbench) => void, ctx: {
|
|
28
|
-
wb: AbstractWorkbench;
|
|
29
|
-
wbRunner: IGraphRunner;
|
|
30
|
-
}) => void;
|
|
31
|
-
getExamples?: (defaults: ExampleDescriptor[]) => ExampleDescriptor[];
|
|
32
|
-
contextPanel?: React.ReactNode;
|
|
33
|
-
getDefaultNodeSize?: (typeId: string) => {
|
|
34
|
-
width: number;
|
|
35
|
-
height: number;
|
|
36
|
-
} | undefined;
|
|
37
|
-
};
|
|
4
|
+
import { ExecutionBackendKind, IGraphRunner } from "../runtime/IGraphRunner";
|
|
38
5
|
export declare function WorkbenchStudio({ engine, onEngineChange, example, onExampleChange, backendKind, onBackendKindChange, httpBaseUrl, onHttpBaseUrlChange, wsUrl, onWsUrlChange, debug, onDebugChange, showValues, onShowValuesChange, hideWorkbench, onHideWorkbenchChange, autoScroll, onAutoScrollChange, overrides, onInit, onChange, }: {
|
|
39
6
|
engine?: string;
|
|
40
7
|
onEngineChange?: (v: string | undefined) => void;
|
|
@@ -65,5 +32,4 @@ export declare function WorkbenchStudio({ engine, onEngineChange, example, onExa
|
|
|
65
32
|
inputs: Record<string, Record<string, unknown>>;
|
|
66
33
|
}) => void;
|
|
67
34
|
}): import("react/jsx-runtime").JSX.Element;
|
|
68
|
-
export {};
|
|
69
35
|
//# sourceMappingURL=WorkbenchStudio.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WorkbenchStudio.d.ts","sourceRoot":"","sources":["../../../../src/misc/WorkbenchStudio.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"WorkbenchStudio.d.ts","sourceRoot":"","sources":["../../../../src/misc/WorkbenchStudio.tsx"],"names":[],"mappings":"AAOA,OAAO,EACL,KAAK,eAAe,EAcrB,MAAM,wBAAwB,CAAC;AAchC,OAAO,E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IAAI,CAAC;IAC5C,UAAU,EAAE,OAAO,CAAC;IACpB,kBAAkB,EAAE,CAAC,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;IACzC,SAAS,CAAC,EAAE,kBAAkB,CAAC;IAC/B,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE;QACd,EAAE,EAAE,iBAAiB,CAAC;QACtB,MAAM,EAAE,YAAY,CAAC;QACrB,eAAe,EAAE,CACf,GAAG,EAAE,eAAe,EACpB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,KAC7C,OAAO,CAAC,IAAI,CAAC,CAAC;KACpB,KAAK,IAAI,CAAC;IACX,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE;QAChB,GAAG,EAAE,eAAe,CAAC;QACrB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;KACjD,KAAK,IAAI,CAAC;CACZ,2CAiEA"}
|
|
@@ -1,8 +1,41 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import type { Registry, GraphDefinition, ValidationIssue } from "@bian-womp/spark-graph";
|
|
3
3
|
import { InMemoryWorkbench } from "../../core/InMemoryWorkbench";
|
|
4
|
-
import { IGraphRunner, type EngineKind } from "../../runtime/IGraphRunner";
|
|
5
4
|
import type { HandleIssue, NodeRunStatus, EdgeRunStatus, DebugEvent } from "../../core/contracts";
|
|
5
|
+
import { AbstractWorkbench } from "../../core/AbstractWorkbench";
|
|
6
|
+
import { IGraphRunner, type EngineKind } from "../../runtime/IGraphRunner";
|
|
7
|
+
export type ExampleDescriptor = {
|
|
8
|
+
id: string;
|
|
9
|
+
label: string;
|
|
10
|
+
load: () => Promise<{
|
|
11
|
+
registry?: Registry;
|
|
12
|
+
def: GraphDefinition;
|
|
13
|
+
}>;
|
|
14
|
+
defaultEngine?: EngineKind;
|
|
15
|
+
};
|
|
16
|
+
export type WorkbenchOverrides = {
|
|
17
|
+
toString?: (baseToString: (typeId?: string, value?: unknown) => string, ctx: {
|
|
18
|
+
registry: Registry;
|
|
19
|
+
}) => (typeId?: string, value?: unknown) => string;
|
|
20
|
+
toElement?: (baseToElement: (typeId?: string, value?: unknown) => JSX.Element, ctx: {
|
|
21
|
+
registry: Registry;
|
|
22
|
+
}) => (typeId?: string, value?: unknown) => JSX.Element;
|
|
23
|
+
setInput?: (baseSetInput: (handle: string, raw: string | number | undefined) => void, ctx: {
|
|
24
|
+
runner: IGraphRunner;
|
|
25
|
+
selectedNodeId?: string;
|
|
26
|
+
registry: Registry;
|
|
27
|
+
}) => (handle: string, raw: string | number | undefined) => void;
|
|
28
|
+
registerUI?: (baseRegisterUI: (wb: AbstractWorkbench) => void, ctx: {
|
|
29
|
+
wb: AbstractWorkbench;
|
|
30
|
+
wbRunner: IGraphRunner;
|
|
31
|
+
}) => void;
|
|
32
|
+
getExamples?: (defaults: ExampleDescriptor[]) => ExampleDescriptor[];
|
|
33
|
+
contextPanel?: React.ReactNode;
|
|
34
|
+
getDefaultNodeSize?: (typeId: string) => {
|
|
35
|
+
width: number;
|
|
36
|
+
height: number;
|
|
37
|
+
} | undefined;
|
|
38
|
+
};
|
|
6
39
|
export interface WorkbenchContextValue {
|
|
7
40
|
wb: InMemoryWorkbench;
|
|
8
41
|
runner: IGraphRunner;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WorkbenchContext.d.ts","sourceRoot":"","sources":["../../../../../src/misc/context/WorkbenchContext.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoC,MAAM,OAAO,CAAC;AACzD,OAAO,KAAK,EACV,QAAQ,EACR,eAAe,EACf,eAAe,EAChB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,EAAE,YAAY,EAAE,KAAK,UAAU,EAAE,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3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AAC;IACjB,KAAK,EAAE,MAAM,IAAI,CAAC;IAGlB,aAAa,EAAE,MAAM,IAAI,CAAC;IAG1B,cAAc,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,SAAS,KAAK,IAAI,CAAC;IAGrE,eAAe,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;CAC3D;AAED,eAAO,MAAM,gBAAgB,6CAE5B,CAAC;AAEF,wBAAgB,mBAAmB,IAAI,qBAAqB,CAO3D"}
|
|
@@ -2,11 +2,13 @@ import React from "react";
|
|
|
2
2
|
import { type Registry } from "@bian-womp/spark-graph";
|
|
3
3
|
import { InMemoryWorkbench } from "../../core/InMemoryWorkbench";
|
|
4
4
|
import { IGraphRunner } from "../../runtime/IGraphRunner";
|
|
5
|
-
|
|
5
|
+
import { WorkbenchOverrides } from "./WorkbenchContext";
|
|
6
|
+
export declare function WorkbenchProvider({ wb, runner, registry, setRegistry, overrides, children, }: {
|
|
6
7
|
wb: InMemoryWorkbench;
|
|
7
8
|
runner: IGraphRunner;
|
|
8
9
|
registry: Registry;
|
|
9
10
|
setRegistry: (r: Registry) => void;
|
|
11
|
+
overrides?: WorkbenchOverrides;
|
|
10
12
|
children: React.ReactNode;
|
|
11
13
|
}): import("react/jsx-runtime").JSX.Element;
|
|
12
14
|
//# sourceMappingURL=WorkbenchContext.provider.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WorkbenchContext.provider.d.ts","sourceRoot":"","sources":["../../../../../src/misc/context/WorkbenchContext.provider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAMN,MAAM,OAAO,CAAC;AAEf,OAAO,EAAE,KAAK,QAAQ,EAAwB,MAAM,wBAAwB,CAAC;AAC7E,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,EAAE,YAAY,EAAmB,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"WorkbenchContext.provider.d.ts","sourceRoot":"","sources":["../../../../../src/misc/context/WorkbenchContext.provider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAMN,MAAM,OAAO,CAAC;AAEf,OAAO,EAAE,KAAK,QAAQ,EAAwB,MAAM,wBAAwB,CAAC;AAC7E,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,EAAE,YAAY,EAAmB,MAAM,4BAA4B,CAAC;AAa3E,OAAO,EAGL,kBAAkB,EACnB,MAAM,oBAAoB,CAAC;AAI5B,wBAAgB,iBAAiB,CAAC,EAChC,EAAE,EACF,MAAM,EACN,QAAQ,EACR,WAAW,EACX,SAAS,EACT,QAAQ,GACT,EAAE;IACD,EAAE,EAAE,iBAAiB,CAAC;IACtB,MAAM,EAAE,YAAY,CAAC;IACrB,QAAQ,EAAE,QAAQ,CAAC;IACnB,WAAW,EAAE,CAAC,CAAC,EAAE,QAAQ,KAAK,IAAI,CAAC;IACnC,SAAS,CAAC,EAAE,kBAAkB,CAAC;IAC/B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B,2CAokBA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mapping.d.ts","sourceRoot":"","sources":["../../../../src/misc/mapping.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,eAAe,EACpB,KAAK,QAAQ,EACb,KAAK,eAAe,
|
|
1
|
+
{"version":3,"file":"mapping.d.ts","sourceRoot":"","sources":["../../../../src/misc/mapping.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,eAAe,EACpB,KAAK,QAAQ,EACb,KAAK,eAAe,EAGrB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AACtE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,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MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAaxE,cAAc,QACP,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,SACrB;QAAE,KAAK,CAAC,EAAE,OAAO,CAAA;KAAE,UAU1B;IAEF,cAAc,QAAO,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,CAEtD;IAEI,YAAY;;;;;;IA4BZ,iBAAiB,CAAC,OAAO,EAAE,mBAAmB;IAUpD,OAAO,IAAI,IAAI;CAKhB"}
|
package/lib/esm/index.js
CHANGED
|
@@ -532,13 +532,19 @@ class LocalGraphRunner extends AbstractGraphRunner {
|
|
|
532
532
|
const def = undefined; // UI will supply def/positions on download for local
|
|
533
533
|
const inputs = this.getInputs(this.runtime
|
|
534
534
|
? {
|
|
535
|
-
nodes: Array.from(this.runtime.getNodeIds()).map((id) => ({
|
|
535
|
+
nodes: Array.from(this.runtime.getNodeIds()).map((id) => ({
|
|
536
|
+
nodeId: id,
|
|
537
|
+
typeId: "",
|
|
538
|
+
})),
|
|
536
539
|
edges: [],
|
|
537
540
|
}
|
|
538
541
|
: { nodes: [], edges: [] });
|
|
539
542
|
const outputs = this.getOutputs(this.runtime
|
|
540
543
|
? {
|
|
541
|
-
nodes: Array.from(this.runtime.getNodeIds()).map((id) => ({
|
|
544
|
+
nodes: Array.from(this.runtime.getNodeIds()).map((id) => ({
|
|
545
|
+
nodeId: id,
|
|
546
|
+
typeId: "",
|
|
547
|
+
})),
|
|
542
548
|
edges: [],
|
|
543
549
|
}
|
|
544
550
|
: { nodes: [], edges: [] });
|
|
@@ -1259,18 +1265,44 @@ function layoutNode(args) {
|
|
|
1259
1265
|
}
|
|
1260
1266
|
|
|
1261
1267
|
function toReactFlow(def, positions, registry, opts) {
|
|
1268
|
+
const EDGE_STYLE_MISSING = { stroke: "#f59e0b", strokeWidth: 2 }; // amber-500
|
|
1262
1269
|
const EDGE_STYLE_ERROR = { stroke: "#ef4444", strokeWidth: 2 };
|
|
1263
1270
|
const EDGE_STYLE_RUNNING = { stroke: "#3b82f6" };
|
|
1264
|
-
|
|
1265
|
-
|
|
1271
|
+
// Build a map of valid handles per node up-front
|
|
1272
|
+
const validHandleMap = {};
|
|
1273
|
+
for (const n of def.nodes) {
|
|
1274
|
+
const { inputs, outputs } = computeEffectiveHandles(n, registry);
|
|
1275
|
+
const inputOrder = Object.keys(inputs).filter((k) => !isInputPrivate(inputs, k));
|
|
1276
|
+
const outputOrder = Object.keys(outputs);
|
|
1277
|
+
validHandleMap[n.nodeId] = {
|
|
1278
|
+
inputs: new Set(inputOrder),
|
|
1279
|
+
outputs: new Set(outputOrder),
|
|
1280
|
+
};
|
|
1281
|
+
}
|
|
1282
|
+
// Track which inputs are connected (for UI) and which handles are missing (for layout)
|
|
1266
1283
|
const connectedInputs = {};
|
|
1284
|
+
const missingInputsByNode = {};
|
|
1285
|
+
const missingOutputsByNode = {};
|
|
1267
1286
|
for (const e of def.edges) {
|
|
1268
|
-
const
|
|
1269
|
-
const
|
|
1270
|
-
if (!connectedInputs[
|
|
1271
|
-
connectedInputs[
|
|
1272
|
-
connectedInputs[
|
|
1273
|
-
|
|
1287
|
+
const tgtId = e.target.nodeId;
|
|
1288
|
+
const tgtHandle = e.target.handle;
|
|
1289
|
+
if (!connectedInputs[tgtId])
|
|
1290
|
+
connectedInputs[tgtId] = new Set();
|
|
1291
|
+
connectedInputs[tgtId].add(tgtHandle);
|
|
1292
|
+
const tgtValid = !!validHandleMap[tgtId]?.inputs.has(tgtHandle);
|
|
1293
|
+
if (!tgtValid) {
|
|
1294
|
+
(missingInputsByNode[tgtId] || (missingInputsByNode[tgtId] = new Set())).add(tgtHandle);
|
|
1295
|
+
}
|
|
1296
|
+
const srcId = e.source.nodeId;
|
|
1297
|
+
const srcHandle = e.source.handle;
|
|
1298
|
+
const srcValid = !!validHandleMap[srcId]?.outputs.has(srcHandle);
|
|
1299
|
+
if (!srcValid) {
|
|
1300
|
+
(missingOutputsByNode[srcId] || (missingOutputsByNode[srcId] = new Set())).add(srcHandle);
|
|
1301
|
+
}
|
|
1302
|
+
}
|
|
1303
|
+
// This map is still used later for certain checks; align with valid handles
|
|
1304
|
+
const nodeHandleMap = {};
|
|
1305
|
+
Object.assign(nodeHandleMap, validHandleMap);
|
|
1274
1306
|
const nodes = def.nodes.map((n) => {
|
|
1275
1307
|
const { inputs: inputSource, outputs: outputSource } = computeEffectiveHandles(n, registry);
|
|
1276
1308
|
const overrideSize = opts.getDefaultNodeSize?.(n.typeId);
|
|
@@ -1292,11 +1324,61 @@ function toReactFlow(def, positions, registry, opts) {
|
|
|
1292
1324
|
inputs: new Set(inputHandles.map((h) => h.id)),
|
|
1293
1325
|
outputs: new Set(outputHandles.map((h) => h.id)),
|
|
1294
1326
|
};
|
|
1295
|
-
//
|
|
1327
|
+
// Append placeholder entries for any missing handles (below valid ones)
|
|
1328
|
+
const baseLeftCount = geom.inputOrder.length;
|
|
1329
|
+
const baseRightCount = geom.outputOrder.length;
|
|
1330
|
+
const extraInputs = Array.from(missingInputsByNode[n.nodeId] || []);
|
|
1331
|
+
const extraOutputs = Array.from(missingOutputsByNode[n.nodeId] || []);
|
|
1332
|
+
const HEADER = NODE_HEADER_HEIGHT_PX;
|
|
1333
|
+
const ROW = NODE_ROW_HEIGHT_PX;
|
|
1334
|
+
const extraHandleLayoutLeft = extraInputs.map((id, i) => ({
|
|
1335
|
+
id,
|
|
1336
|
+
type: "target",
|
|
1337
|
+
position: Position.Left,
|
|
1338
|
+
y: HEADER + (baseLeftCount + i) * ROW + ROW / 2,
|
|
1339
|
+
missing: true,
|
|
1340
|
+
}));
|
|
1341
|
+
const extraHandleLayoutRight = extraOutputs.map((id, i) => ({
|
|
1342
|
+
id,
|
|
1343
|
+
type: "source",
|
|
1344
|
+
position: Position.Right,
|
|
1345
|
+
y: HEADER + (baseRightCount + i) * ROW + ROW / 2,
|
|
1346
|
+
missing: true,
|
|
1347
|
+
}));
|
|
1348
|
+
const handleLayout = [
|
|
1349
|
+
...geom.handleLayout,
|
|
1350
|
+
...extraHandleLayoutLeft,
|
|
1351
|
+
...extraHandleLayoutRight,
|
|
1352
|
+
];
|
|
1353
|
+
// Precompute handle bounds (including missing) so edges can render immediately
|
|
1354
|
+
const missingBoundsLeft = extraInputs.map((id, i) => ({
|
|
1355
|
+
id,
|
|
1356
|
+
type: "target",
|
|
1357
|
+
position: Position.Left,
|
|
1358
|
+
x: 0,
|
|
1359
|
+
y: HEADER + (baseLeftCount + i) * ROW,
|
|
1360
|
+
width: 1,
|
|
1361
|
+
height: ROW + 2,
|
|
1362
|
+
}));
|
|
1363
|
+
const missingBoundsRight = extraOutputs.map((id, i) => ({
|
|
1364
|
+
id,
|
|
1365
|
+
type: "source",
|
|
1366
|
+
position: Position.Right,
|
|
1367
|
+
x: geom.width - 1,
|
|
1368
|
+
y: HEADER + (baseRightCount + i) * ROW,
|
|
1369
|
+
width: 1,
|
|
1370
|
+
height: ROW + 2,
|
|
1371
|
+
}));
|
|
1372
|
+
const handles = [
|
|
1373
|
+
...geom.handles,
|
|
1374
|
+
...missingBoundsLeft,
|
|
1375
|
+
...missingBoundsRight,
|
|
1376
|
+
];
|
|
1377
|
+
// Adjust node height to accommodate missing handle rows
|
|
1378
|
+
const baseRows = Math.max(baseLeftCount, baseRightCount);
|
|
1379
|
+
const newRows = Math.max(baseLeftCount + extraInputs.length, baseRightCount + extraOutputs.length);
|
|
1296
1380
|
const initialWidth = geom.width;
|
|
1297
|
-
const initialHeight = geom.height;
|
|
1298
|
-
// Precompute handle bounds so edges can render immediately without waiting for measurement
|
|
1299
|
-
const handles = geom.handles;
|
|
1381
|
+
const initialHeight = geom.height + Math.max(0, newRows - baseRows) * ROW;
|
|
1300
1382
|
return {
|
|
1301
1383
|
id: n.nodeId,
|
|
1302
1384
|
data: {
|
|
@@ -1308,7 +1390,7 @@ function toReactFlow(def, positions, registry, opts) {
|
|
|
1308
1390
|
h.id,
|
|
1309
1391
|
!!connectedInputs[n.nodeId]?.has(h.id),
|
|
1310
1392
|
])),
|
|
1311
|
-
handleLayout
|
|
1393
|
+
handleLayout,
|
|
1312
1394
|
showValues: opts.showValues,
|
|
1313
1395
|
renderWidth: initialWidth,
|
|
1314
1396
|
renderHeight: initialHeight,
|
|
@@ -1335,24 +1417,21 @@ function toReactFlow(def, positions, registry, opts) {
|
|
|
1335
1417
|
height: initialHeight,
|
|
1336
1418
|
};
|
|
1337
1419
|
});
|
|
1338
|
-
const edges = def.edges
|
|
1339
|
-
.filter((e) => {
|
|
1340
|
-
const src = nodeHandleMap[e.source.nodeId];
|
|
1341
|
-
const dst = nodeHandleMap[e.target.nodeId];
|
|
1342
|
-
if (!src || !dst)
|
|
1343
|
-
return false;
|
|
1344
|
-
return (src.outputs.has(e.source.handle) && dst.inputs.has(e.target.handle));
|
|
1345
|
-
})
|
|
1346
|
-
.map((e) => {
|
|
1420
|
+
const edges = def.edges.map((e) => {
|
|
1347
1421
|
const st = opts.edgeStatus?.[e.id];
|
|
1348
1422
|
const isRunning = !!st?.activeRuns;
|
|
1349
1423
|
const hasError = !!st?.lastError;
|
|
1350
1424
|
const isInvalidEdge = !!opts.edgeValidation?.[e.id];
|
|
1351
|
-
const
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1425
|
+
const sourceMissing = !validHandleMap[e.source.nodeId]?.outputs.has(e.source.handle);
|
|
1426
|
+
const targetMissing = !validHandleMap[e.target.nodeId]?.inputs.has(e.target.handle);
|
|
1427
|
+
const isMissing = sourceMissing || targetMissing;
|
|
1428
|
+
const style = isMissing
|
|
1429
|
+
? EDGE_STYLE_MISSING
|
|
1430
|
+
: hasError || isInvalidEdge
|
|
1431
|
+
? EDGE_STYLE_ERROR
|
|
1432
|
+
: isRunning
|
|
1433
|
+
? EDGE_STYLE_RUNNING
|
|
1434
|
+
: undefined;
|
|
1356
1435
|
return {
|
|
1357
1436
|
id: e.id,
|
|
1358
1437
|
source: e.source.nodeId,
|
|
@@ -1362,7 +1441,7 @@ function toReactFlow(def, positions, registry, opts) {
|
|
|
1362
1441
|
selected: opts.selectedEdgeIds
|
|
1363
1442
|
? opts.selectedEdgeIds.has(e.id)
|
|
1364
1443
|
: undefined,
|
|
1365
|
-
animated: isRunning,
|
|
1444
|
+
animated: isRunning && !isMissing,
|
|
1366
1445
|
style,
|
|
1367
1446
|
label: e.typeId || undefined,
|
|
1368
1447
|
};
|
|
@@ -1418,7 +1497,7 @@ function useWorkbenchContext() {
|
|
|
1418
1497
|
return ctx;
|
|
1419
1498
|
}
|
|
1420
1499
|
|
|
1421
|
-
function WorkbenchProvider({ wb, runner, registry, setRegistry, children, }) {
|
|
1500
|
+
function WorkbenchProvider({ wb, runner, registry, setRegistry, overrides, children, }) {
|
|
1422
1501
|
const [nodeStatus, setNodeStatus] = useState({});
|
|
1423
1502
|
const [edgeStatus, setEdgeStatus] = useState({});
|
|
1424
1503
|
const [events, setEvents] = useState([]);
|
|
@@ -1549,8 +1628,14 @@ function WorkbenchProvider({ wb, runner, registry, setRegistry, children, }) {
|
|
|
1549
1628
|
if (!node)
|
|
1550
1629
|
continue;
|
|
1551
1630
|
// Prefer showValues sizing similar to node rendering
|
|
1552
|
-
//
|
|
1553
|
-
const
|
|
1631
|
+
// Consider per-type overrides when available via UI
|
|
1632
|
+
const overrideSize = overrides?.getDefaultNodeSize?.(node.typeId) ?? undefined;
|
|
1633
|
+
const size = estimateNodeSize({
|
|
1634
|
+
node,
|
|
1635
|
+
registry,
|
|
1636
|
+
showValues: true,
|
|
1637
|
+
overrides: overrideSize,
|
|
1638
|
+
});
|
|
1554
1639
|
heights[id] = size.height;
|
|
1555
1640
|
if (size.width > maxWidth)
|
|
1556
1641
|
maxWidth = size.width;
|
|
@@ -1565,7 +1650,7 @@ function WorkbenchProvider({ wb, runner, registry, setRegistry, children, }) {
|
|
|
1565
1650
|
curX += maxWidth + H_GAP;
|
|
1566
1651
|
}
|
|
1567
1652
|
wb.setPositions(pos);
|
|
1568
|
-
}, [wb]);
|
|
1653
|
+
}, [wb, registry, overrides?.getDefaultNodeSize]);
|
|
1569
1654
|
const updateEdgeType = useCallback((edgeId, typeId) => wb.updateEdgeType(edgeId, typeId), [wb]);
|
|
1570
1655
|
const triggerExternal = useCallback((nodeId, event) => runner.triggerExternal(nodeId, event), [runner]);
|
|
1571
1656
|
// Subscribe to runner/workbench events
|
|
@@ -2153,6 +2238,17 @@ function Inspector({ debug, autoScroll, hideWorkbench, onAutoScrollChange, onHid
|
|
|
2153
2238
|
}, title: "Delete referenced edge", children: "Delete edge" }))] }, i))) })] }))] })) }), debug && (jsx("div", { className: "mt-3 flex-none min-h-0 h-[50%]", children: jsx(DebugEvents, { autoScroll: !!autoScroll, hideWorkbench: !!hideWorkbench, onAutoScrollChange: onAutoScrollChange, onHideWorkbenchChange: onHideWorkbenchChange }) }))] }));
|
|
2154
2239
|
}
|
|
2155
2240
|
|
|
2241
|
+
function NodeHandleItem({ kind, id, type, position, y, isConnectable, className, labelClassName, renderLabel, }) {
|
|
2242
|
+
return (jsxs(Fragment, { children: [jsx(Handle, { id: id, type: type, position: position, isConnectable: isConnectable, className: className, style: y !== undefined ? { top: y } : undefined }), renderLabel && (jsx("div", { className: labelClassName + (kind === "input" ? " left-2" : " right-2"), style: {
|
|
2243
|
+
top: (y ?? 0) - 8,
|
|
2244
|
+
...(kind === "input"
|
|
2245
|
+
? { right: "50%" }
|
|
2246
|
+
: { left: "50%", textAlign: "right" }),
|
|
2247
|
+
whiteSpace: "nowrap",
|
|
2248
|
+
overflow: "hidden",
|
|
2249
|
+
textOverflow: "ellipsis",
|
|
2250
|
+
}, children: renderLabel({ kind, id }) }))] }));
|
|
2251
|
+
}
|
|
2156
2252
|
function NodeHandles({ data, isConnectable, inputClassName = "!w-2 !h-2 !bg-gray-600", outputClassName = "!w-2 !h-2 !bg-gray-600", getClassName, renderLabel, labelClassName = "absolute text-[11px] text-gray-700 dark:text-gray-300 pointer-events-none", }) {
|
|
2157
2253
|
const layout = data.handleLayout ?? [];
|
|
2158
2254
|
const byId = React.useMemo(() => {
|
|
@@ -2163,40 +2259,49 @@ function NodeHandles({ data, isConnectable, inputClassName = "!w-2 !h-2 !bg-gray
|
|
|
2163
2259
|
position: h.position,
|
|
2164
2260
|
y: h.y,
|
|
2165
2261
|
type: h.type,
|
|
2262
|
+
missing: h.missing,
|
|
2166
2263
|
});
|
|
2167
2264
|
// Back-compat: also store by id-only if not already set
|
|
2168
2265
|
if (!m.has(h.id))
|
|
2169
|
-
m.set(h.id, {
|
|
2266
|
+
m.set(h.id, {
|
|
2267
|
+
position: h.position,
|
|
2268
|
+
y: h.y,
|
|
2269
|
+
type: h.type,
|
|
2270
|
+
missing: h.missing,
|
|
2271
|
+
});
|
|
2170
2272
|
}
|
|
2171
2273
|
return m;
|
|
2172
2274
|
}, [layout]);
|
|
2275
|
+
const inputIds = React.useMemo(() => new Set((data.inputHandles ?? []).map((h) => h.id)), [data.inputHandles]);
|
|
2276
|
+
const outputIds = React.useMemo(() => new Set((data.outputHandles ?? []).map((h) => h.id)), [data.outputHandles]);
|
|
2277
|
+
const missingInputs = React.useMemo(() => (layout || []).filter((h) => h.type === "target" && (!inputIds.has(h.id) || h.missing)), [layout, inputIds]);
|
|
2278
|
+
const missingOutputs = React.useMemo(() => (layout || []).filter((h) => h.type === "source" && (!outputIds.has(h.id) || h.missing)), [layout, outputIds]);
|
|
2173
2279
|
return (jsxs(Fragment, { children: [(data.inputHandles ?? []).map((h) => {
|
|
2174
2280
|
const placed = byId.get(`target:${h.id}`) ?? byId.get(h.id);
|
|
2175
2281
|
const position = placed?.position ?? Position.Left;
|
|
2176
2282
|
const y = placed?.y;
|
|
2177
2283
|
const cls = getClassName?.({ kind: "input", id: h.id, type: "target" }) ??
|
|
2178
2284
|
inputClassName;
|
|
2179
|
-
return (
|
|
2180
|
-
|
|
2181
|
-
|
|
2182
|
-
|
|
2183
|
-
|
|
2184
|
-
|
|
2185
|
-
|
|
2285
|
+
return (jsx(NodeHandleItem, { kind: "input", id: h.id, type: "target", position: position, y: y, isConnectable: isConnectable, className: cls, labelClassName: labelClassName, renderLabel: renderLabel }, h.id));
|
|
2286
|
+
}), missingInputs.map((h) => {
|
|
2287
|
+
const key = `missing-input:${h.id}`;
|
|
2288
|
+
const position = h.position ?? Position.Left;
|
|
2289
|
+
const y = h.y;
|
|
2290
|
+
const cls = "!w-3 !h-3 !bg-amber-400 !border-amber-500";
|
|
2291
|
+
return (jsx(NodeHandleItem, { kind: "input", id: h.id, type: "target", position: position, y: y, isConnectable: false, className: cls, labelClassName: labelClassName, renderLabel: renderLabel }, key));
|
|
2186
2292
|
}), (data.outputHandles ?? []).map((h) => {
|
|
2187
2293
|
const placed = byId.get(`source:${h.id}`) ?? byId.get(h.id);
|
|
2188
2294
|
const position = placed?.position ?? Position.Right;
|
|
2189
2295
|
const y = placed?.y;
|
|
2190
2296
|
const cls = getClassName?.({ kind: "output", id: h.id, type: "source" }) ??
|
|
2191
2297
|
outputClassName;
|
|
2192
|
-
return (
|
|
2193
|
-
|
|
2194
|
-
|
|
2195
|
-
|
|
2196
|
-
|
|
2197
|
-
|
|
2198
|
-
|
|
2199
|
-
}, children: renderLabel({ kind: "output", id: h.id }) }))] }, h.id));
|
|
2298
|
+
return (jsx(NodeHandleItem, { kind: "output", id: h.id, type: "source", position: position, y: y, isConnectable: isConnectable, className: `${cls} wb-nodrag wb-nowheel`, labelClassName: labelClassName, renderLabel: renderLabel }, h.id));
|
|
2299
|
+
}), missingOutputs.map((h) => {
|
|
2300
|
+
const key = `missing-output:${h.id}`;
|
|
2301
|
+
const position = h.position ?? Position.Right;
|
|
2302
|
+
const y = h.y;
|
|
2303
|
+
const cls = "!w-3 !h-3 !bg-amber-400 !border-amber-500 !rounded-none wb-nodrag wb-nowheel";
|
|
2304
|
+
return (jsx(NodeHandleItem, { kind: "output", id: h.id, type: "source", position: position, y: y, isConnectable: false, className: cls, labelClassName: labelClassName, renderLabel: renderLabel }, key));
|
|
2200
2305
|
})] }));
|
|
2201
2306
|
}
|
|
2202
2307
|
|
|
@@ -2260,6 +2365,18 @@ function DefaultNodeHeader({ id, title, validation, right, showId, onInvalidate,
|
|
|
2260
2365
|
}
|
|
2261
2366
|
function DefaultNodeContent({ data, isConnectable, }) {
|
|
2262
2367
|
const { showValues, inputValues, outputValues, toString } = data;
|
|
2368
|
+
const prettyHandle = React.useCallback((id) => {
|
|
2369
|
+
try {
|
|
2370
|
+
const parts = String(id).split(":");
|
|
2371
|
+
// If there are exactly 3 colons (4 parts), display only the second part
|
|
2372
|
+
if (parts.length === 4)
|
|
2373
|
+
return parts[1] || id;
|
|
2374
|
+
return id;
|
|
2375
|
+
}
|
|
2376
|
+
catch {
|
|
2377
|
+
return id;
|
|
2378
|
+
}
|
|
2379
|
+
}, []);
|
|
2263
2380
|
const inputEntries = data.inputHandles ?? [];
|
|
2264
2381
|
const outputEntries = data.outputHandles ?? [];
|
|
2265
2382
|
const status = data.status ?? { activeRuns: 0 };
|
|
@@ -2277,7 +2394,7 @@ function DefaultNodeContent({ data, isConnectable, }) {
|
|
|
2277
2394
|
const entries = kind === "input" ? inputEntries : outputEntries;
|
|
2278
2395
|
const entry = entries.find((e) => e.id === handleId);
|
|
2279
2396
|
if (!entry)
|
|
2280
|
-
return handleId;
|
|
2397
|
+
return prettyHandle(handleId);
|
|
2281
2398
|
const vIssues = (kind === "input" ? validation.inputs : validation.outputs).filter((v) => v.handle === handleId);
|
|
2282
2399
|
const hasAny = vIssues.length > 0;
|
|
2283
2400
|
const hasErr = vIssues.some((v) => v.level === "error");
|
|
@@ -2295,7 +2412,7 @@ function DefaultNodeContent({ data, isConnectable, }) {
|
|
|
2295
2412
|
const txt = toString(resolved.typeId, resolved.value);
|
|
2296
2413
|
return typeof txt === "string" ? txt : String(txt);
|
|
2297
2414
|
})();
|
|
2298
|
-
return (jsxs("span", { className: "flex items-center gap-1 w-full", children: [kind === "output" ? (jsxs(Fragment, { children: [valueText !== undefined ? (jsx("span", { className: "opacity-60 truncate pl-1", style: { flex: 1, minWidth: 0, maxWidth: "100%" }, children: valueText })) : (jsx("span", { style: { flex: 1, minWidth: 0, maxWidth: "100%" } })), jsx("span", { className: "truncate shrink-0", style: valueText !== undefined ? { maxWidth: "40%" } : {}, children: handleId })] })) : (jsxs(Fragment, { children: [jsx("span", { className: "truncate shrink-0", style: valueText !== undefined ? { maxWidth: "40%" } : {}, children: handleId }), valueText !== undefined && (jsx("span", { className: "opacity-60 truncate pr-1", style: { flex: 1, minWidth: 0, maxWidth: "100%" }, children: valueText }))] })), hasAny && (jsx(IssueBadge, { level: hasErr ? "error" : "warning", size: 12, className: "shrink-0", title: title }))] }));
|
|
2415
|
+
return (jsxs("span", { className: "flex items-center gap-1 w-full", children: [kind === "output" ? (jsxs(Fragment, { children: [valueText !== undefined ? (jsx("span", { className: "opacity-60 truncate pl-1", style: { flex: 1, minWidth: 0, maxWidth: "100%" }, children: valueText })) : (jsx("span", { style: { flex: 1, minWidth: 0, maxWidth: "100%" } })), jsx("span", { className: "truncate shrink-0", style: valueText !== undefined ? { maxWidth: "40%" } : {}, children: prettyHandle(handleId) })] })) : (jsxs(Fragment, { children: [jsx("span", { className: "truncate shrink-0", style: valueText !== undefined ? { maxWidth: "40%" } : {}, children: prettyHandle(handleId) }), valueText !== undefined && (jsx("span", { className: "opacity-60 truncate pr-1", style: { flex: 1, minWidth: 0, maxWidth: "100%" }, children: valueText }))] })), hasAny && (jsx(IssueBadge, { level: hasErr ? "error" : "warning", size: 12, className: "shrink-0", title: title }))] }));
|
|
2299
2416
|
} })] }));
|
|
2300
2417
|
}
|
|
2301
2418
|
|
|
@@ -2885,6 +3002,7 @@ function WorkbenchStudioCanvas({ setRegistry, autoScroll, onAutoScrollChange, ex
|
|
|
2885
3002
|
return overrides.getExamples(defaultExamples);
|
|
2886
3003
|
return defaultExamples;
|
|
2887
3004
|
}, [overrides, defaultExamples]);
|
|
3005
|
+
const [hydrated, setHydrated] = useState(false);
|
|
2888
3006
|
const lastAutoLaunched = useRef(undefined);
|
|
2889
3007
|
const autoLayoutRan = useRef(false);
|
|
2890
3008
|
const canvasRef = useRef(null);
|
|
@@ -2908,7 +3026,6 @@ function WorkbenchStudioCanvas({ setRegistry, autoScroll, onAutoScrollChange, ex
|
|
|
2908
3026
|
runner.setInputs(nodeId, map);
|
|
2909
3027
|
}
|
|
2910
3028
|
}
|
|
2911
|
-
runAutoLayout();
|
|
2912
3029
|
};
|
|
2913
3030
|
onInit({ wb, runner, setInitialGraph });
|
|
2914
3031
|
}, [onInit, wb, runner, runAutoLayout, registry, setRegistry]);
|
|
@@ -3096,7 +3213,7 @@ function WorkbenchStudioCanvas({ setRegistry, autoScroll, onAutoScrollChange, ex
|
|
|
3096
3213
|
createRuntime: () => ({
|
|
3097
3214
|
async onInputsChanged() { },
|
|
3098
3215
|
}),
|
|
3099
|
-
policy: {
|
|
3216
|
+
policy: { asyncConcurrency: "switch" },
|
|
3100
3217
|
};
|
|
3101
3218
|
r.categories.register(category);
|
|
3102
3219
|
}
|
|
@@ -3165,23 +3282,32 @@ function WorkbenchStudioCanvas({ setRegistry, autoScroll, onAutoScrollChange, ex
|
|
|
3165
3282
|
}, [engine, runner, wb, backendKind]);
|
|
3166
3283
|
// When switching to remote backend, auto-hydrate registry from backend
|
|
3167
3284
|
useEffect(() => {
|
|
3285
|
+
let hydrate;
|
|
3168
3286
|
if (backendKind === "remote-http" && httpBaseUrl) {
|
|
3169
|
-
hydrateFromBackend("remote-http", httpBaseUrl);
|
|
3287
|
+
hydrate = hydrateFromBackend("remote-http", httpBaseUrl);
|
|
3170
3288
|
}
|
|
3171
3289
|
else if (backendKind === "remote-ws" && wsUrl) {
|
|
3172
|
-
hydrateFromBackend("remote-ws", wsUrl);
|
|
3290
|
+
hydrate = hydrateFromBackend("remote-ws", wsUrl);
|
|
3173
3291
|
}
|
|
3174
|
-
|
|
3292
|
+
if (hydrate) {
|
|
3293
|
+
hydrate.then(() => {
|
|
3294
|
+
setHydrated(true);
|
|
3295
|
+
});
|
|
3296
|
+
}
|
|
3297
|
+
}, [backendKind, httpBaseUrl, wsUrl, hydrateFromBackend, setHydrated]);
|
|
3175
3298
|
useEffect(() => {
|
|
3176
3299
|
if (autoLayoutRan.current)
|
|
3177
3300
|
return;
|
|
3301
|
+
if (backendKind !== "local" && !hydrated)
|
|
3302
|
+
return;
|
|
3178
3303
|
const cur = wb.export();
|
|
3179
|
-
const
|
|
3304
|
+
const positions = wb.getPositions();
|
|
3305
|
+
const allMissing = cur.nodes.every((n) => !positions[n.nodeId]);
|
|
3180
3306
|
if (allMissing) {
|
|
3181
3307
|
autoLayoutRan.current = true;
|
|
3182
3308
|
runAutoLayout();
|
|
3183
3309
|
}
|
|
3184
|
-
}, [wb, runAutoLayout]);
|
|
3310
|
+
}, [wb, runAutoLayout, backendKind, hydrated]);
|
|
3185
3311
|
const baseSetInput = useCallback((handle, raw) => {
|
|
3186
3312
|
if (!selectedNodeId)
|
|
3187
3313
|
return;
|
|
@@ -3407,7 +3533,7 @@ function WorkbenchStudio({ engine, onEngineChange, example, onExampleChange, bac
|
|
|
3407
3533
|
overrides?.registerUI?.(baseRegisterUI, { wb, wbRunner: runner });
|
|
3408
3534
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
3409
3535
|
}, [wb, runner, overrides]);
|
|
3410
|
-
return (jsx(WorkbenchProvider, { wb: wb, runner: runner, registry: registry, setRegistry: setRegistry, children: jsx(WorkbenchStudioCanvas, { setRegistry: setRegistry, autoScroll: autoScroll, onAutoScrollChange: onAutoScrollChange, example: example, onExampleChange: onExampleChange, engine: engine, onEngineChange: onEngineChange, backendKind: backendKind, onBackendKindChange: (v) => {
|
|
3536
|
+
return (jsx(WorkbenchProvider, { wb: wb, runner: runner, registry: registry, setRegistry: setRegistry, overrides: overrides, children: jsx(WorkbenchStudioCanvas, { setRegistry: setRegistry, autoScroll: autoScroll, onAutoScrollChange: onAutoScrollChange, example: example, onExampleChange: onExampleChange, engine: engine, onEngineChange: onEngineChange, backendKind: backendKind, onBackendKindChange: (v) => {
|
|
3411
3537
|
if (runner.isRunning())
|
|
3412
3538
|
runner.dispose();
|
|
3413
3539
|
onBackendKindChange(v);
|