@linkdlab/funcnodes_react_flow 0.4.3 → 0.4.4
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/dist/browser_index.d.ts +8 -0
- package/dist/frontend/assets/fontawsome.d.ts +21 -0
- package/dist/frontend/assets/mui.d.ts +8 -0
- package/dist/frontend/datarenderer/data_renderer_overlay.d.ts +3 -0
- package/dist/frontend/datarenderer/default_data_overlay_views.d.ts +6 -0
- package/dist/frontend/datarenderer/default_data_preview_renderer.d.ts +5 -0
- package/dist/frontend/datarenderer/default_data_view_renderer.d.ts +13 -0
- package/dist/frontend/datarenderer/default_handle_previews.d.ts +4 -0
- package/dist/frontend/datarenderer/default_inline_renderer.d.ts +5 -0
- package/dist/frontend/datarenderer/default_input_renderer.d.ts +17 -0
- package/dist/frontend/datarenderer/default_output_renderer.d.ts +9 -0
- package/dist/frontend/datarenderer/images.d.ts +19 -0
- package/dist/frontend/datarenderer/rendermappings.d.ts +204 -0
- package/dist/frontend/dialog.d.ts +20 -0
- package/dist/frontend/edge.d.ts +4 -0
- package/dist/frontend/funcnodesreactflow/index.d.ts +8 -0
- package/dist/frontend/funcnodesreactflow/react_flow_layer.d.ts +7 -0
- package/dist/frontend/header/index.d.ts +4 -0
- package/dist/frontend/index.d.ts +0 -0
- package/dist/frontend/layout/components.d.ts +36 -0
- package/dist/frontend/layout/fullscreenelement.d.ts +17 -0
- package/dist/frontend/layout/smoothexpand.d.ts +22 -0
- package/dist/frontend/lib.d.ts +10 -0
- package/dist/frontend/node/body_data_renderer.d.ts +3 -0
- package/dist/frontend/node/index.d.ts +4 -0
- package/dist/frontend/node/io/handle_renderer.d.ts +3 -0
- package/dist/frontend/node/io/index.d.ts +3 -0
- package/dist/frontend/node/io/io.d.ts +15 -0
- package/dist/frontend/node/io/iodataoverlay.d.ts +10 -0
- package/dist/frontend/node/io/nodeinput.d.ts +10 -0
- package/dist/frontend/node/io/nodeoutput.d.ts +6 -0
- package/dist/frontend/node/node.d.ts +25 -0
- package/dist/frontend/node/nodesettings.d.ts +3 -0
- package/dist/frontend/utils/colorpicker.d.ts +22 -0
- package/dist/frontend/utils/jsondata.d.ts +5 -0
- package/dist/frontend/utils/progressbar.d.ts +46 -0
- package/dist/frontend/utils/select.d.ts +17 -0
- package/dist/frontend/utils/table.d.ts +10 -0
- package/dist/funcnodes/datastructures.d.ts +51 -0
- package/dist/funcnodes/funcnodesworker.d.ts +147 -0
- package/dist/funcnodes/index.d.ts +4 -0
- package/dist/funcnodes/websocketworker.d.ts +45 -0
- package/dist/funcnodes/workermanager.d.ts +34 -0
- package/dist/funcnodes_react_flow.css +1 -0
- package/dist/index.cjs.js +865 -0
- package/dist/index.d.ts +16 -1224
- package/dist/index.es.js +40601 -0
- package/dist/index.umd.js +865 -0
- package/dist/plugin/helper.d.ts +2 -0
- package/dist/plugin/index.d.ts +7 -0
- package/dist/plugin/v0/index.d.ts +2 -0
- package/dist/plugin/v1/index.d.ts +2 -0
- package/dist/plugin/v1/upgrader.d.ts +34 -0
- package/dist/states/edge.d.ts +7 -0
- package/dist/states/edge.t.d.ts +16 -0
- package/dist/states/fnrfzst.d.ts +9 -0
- package/dist/states/fnrfzst.t.d.ts +182 -0
- package/dist/states/index.d.ts +7 -0
- package/dist/states/lib.d.ts +3 -0
- package/dist/states/lib.t.d.ts +45 -0
- package/dist/states/node/newnode.d.ts +4 -0
- package/dist/states/node/update_funcs.d.ts +9 -0
- package/dist/states/node/update_io.d.ts +3 -0
- package/dist/states/node/update_node.d.ts +6 -0
- package/dist/states/nodespace.d.ts +3 -0
- package/dist/states/nodespace.t.d.ts +16 -0
- package/dist/states/reactflow.d.ts +8 -0
- package/dist/states/reactflow.t.d.ts +11 -0
- package/dist/types/versioned/v0/index.d.ts +5 -0
- package/dist/types/versioned/v0/io.t.d.ts +29 -0
- package/dist/types/versioned/v0/node.t.d.ts +75 -0
- package/dist/types/versioned/v0/plugins.t.d.ts +37 -0
- package/dist/types/versioned/v0/rendering.t.d.ts +42 -0
- package/dist/types/versioned/v0/rendermappings.t.d.ts +27 -0
- package/dist/types/versioned/v1/index.d.ts +5 -0
- package/dist/types/versioned/v1/io.t.d.ts +51 -0
- package/dist/types/versioned/v1/node.t.d.ts +64 -0
- package/dist/types/versioned/v1/plugins.t.d.ts +39 -0
- package/dist/types/versioned/v1/rendering.t.d.ts +1 -0
- package/dist/types/versioned/v1/rendermappings.t.d.ts +53 -0
- package/dist/types/versioned/versions.t.d.ts +3 -0
- package/dist/utils/autolayout/force.d.ts +2 -0
- package/dist/utils/autolayout/index.d.ts +2 -0
- package/dist/utils/autolayout/txt.d.ts +15 -0
- package/dist/utils/data.d.ts +12 -0
- package/dist/utils/debugger.d.ts +5 -0
- package/dist/utils/helperfunctions.d.ts +16 -0
- package/dist/utils/index.d.ts +3 -0
- package/dist/utils/logger.d.ts +26 -0
- package/dist/utils/objects.d.ts +142 -0
- package/package.json +36 -70
- package/dist/esm/index.esm.mjs +0 -105
- package/dist/esm/index.esm.mjs.map +0 -1
- package/dist/style.css +0 -1
- package/dist/umd/index.umd.js +0 -105
- package/dist/umd/index.umd.js.map +0 -1
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { latest as latest_types } from '../types/versioned/versions.t';
|
|
2
|
+
export interface PackedPlugin {
|
|
3
|
+
module: string;
|
|
4
|
+
js?: string[];
|
|
5
|
+
css?: string[];
|
|
6
|
+
}
|
|
7
|
+
export declare const upgradeFuncNodesReactPlugin: (plugin: latest_types.AnyFuncNodesReactPlugin) => latest_types.FuncNodesReactPlugin;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { v1 as v1_types, v0 as v0_types } from '../../types/versioned/versions.t';
|
|
2
|
+
type olderPlugins_v1 = v0_types.FuncNodesReactPlugin;
|
|
3
|
+
export declare class IOHelperClass implements v0_types.IOType {
|
|
4
|
+
constructor(iostore: v1_types.IOStore);
|
|
5
|
+
iostore: v1_types.IOStore;
|
|
6
|
+
get connected(): boolean;
|
|
7
|
+
set connected(v: boolean);
|
|
8
|
+
get does_trigger(): boolean;
|
|
9
|
+
set does_trigger(v: boolean);
|
|
10
|
+
get full_id(): string;
|
|
11
|
+
set full_id(v: string);
|
|
12
|
+
get id(): string;
|
|
13
|
+
set id(v: string);
|
|
14
|
+
get is_input(): boolean;
|
|
15
|
+
set is_input(v: boolean);
|
|
16
|
+
get name(): string;
|
|
17
|
+
set name(v: string);
|
|
18
|
+
get node(): string;
|
|
19
|
+
set node(v: string);
|
|
20
|
+
get type(): v0_types.SerializedType;
|
|
21
|
+
set type(v: v0_types.SerializedType);
|
|
22
|
+
get value(): any;
|
|
23
|
+
set value(v: any);
|
|
24
|
+
get fullvalue(): any;
|
|
25
|
+
set fullvalue(v: any);
|
|
26
|
+
get render_options(): v0_types.IORenderOptions;
|
|
27
|
+
set render_options(v: v0_types.IORenderOptions);
|
|
28
|
+
get hidden(): boolean;
|
|
29
|
+
set hidden(v: boolean);
|
|
30
|
+
get try_get_full_value(): undefined | (() => void);
|
|
31
|
+
get set_hidden(): undefined | ((v: boolean) => void);
|
|
32
|
+
}
|
|
33
|
+
declare const upgradePlugin_v1: (plugin: olderPlugins_v1 | v1_types.FuncNodesReactPlugin) => v1_types.FuncNodesReactPlugin;
|
|
34
|
+
export { upgradePlugin_v1 };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
interface BaseEdgeAction {
|
|
2
|
+
type: string;
|
|
3
|
+
src_nid: string;
|
|
4
|
+
src_ioid: string;
|
|
5
|
+
trg_nid: string;
|
|
6
|
+
trg_ioid: string;
|
|
7
|
+
from_remote: boolean;
|
|
8
|
+
}
|
|
9
|
+
interface EdgeActionAdd extends BaseEdgeAction {
|
|
10
|
+
type: "add";
|
|
11
|
+
}
|
|
12
|
+
interface EdgeActionDelete extends BaseEdgeAction {
|
|
13
|
+
type: "delete";
|
|
14
|
+
}
|
|
15
|
+
type EdgeAction = EdgeActionAdd | EdgeActionDelete;
|
|
16
|
+
export type { EdgeAction, EdgeActionAdd, EdgeActionDelete };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { default as LibZustand } from './lib';
|
|
2
|
+
import { default as NodeSpaceZustand } from './nodespace';
|
|
3
|
+
import { Node as RFNode } from '@xyflow/react';
|
|
4
|
+
import { FuncNodesReactFlowZustandInterface, FuncnodesReactFlowProps } from './fnrfzst.t';
|
|
5
|
+
import { latest } from '../types/versioned/versions.t';
|
|
6
|
+
declare const assert_reactflow_node: (store: latest.NodeStore, fnrf_instance?: FuncNodesReactFlowZustandInterface) => latest.NodeType & RFNode;
|
|
7
|
+
declare const FuncNodesReactFlowZustand: (props: FuncnodesReactFlowProps) => FuncNodesReactFlowZustandInterface;
|
|
8
|
+
export default FuncNodesReactFlowZustand;
|
|
9
|
+
export { LibZustand, NodeSpaceZustand, assert_reactflow_node };
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
import { StoreApi, UseBoundStore } from 'zustand';
|
|
2
|
+
import { FuncNodesWorker, WorkerManager } from '../funcnodes';
|
|
3
|
+
import { ExternalWorkerDependencies, LibType, LibZustandInterface } from './lib.t';
|
|
4
|
+
import { NodeSpaceZustandInterface } from './nodespace.t';
|
|
5
|
+
import { RFStore } from './reactflow.t';
|
|
6
|
+
import { EdgeAction } from './edge.t';
|
|
7
|
+
import { useReactFlow } from '@xyflow/react';
|
|
8
|
+
import { Logger } from '../utils/logger';
|
|
9
|
+
import { FuncNodesWorkerState } from '../funcnodes/funcnodesworker';
|
|
10
|
+
import { latest } from '../types/versioned/versions.t';
|
|
11
|
+
interface RenderOptions {
|
|
12
|
+
typemap?: {
|
|
13
|
+
[key: string]: string | undefined;
|
|
14
|
+
};
|
|
15
|
+
inputconverter?: {
|
|
16
|
+
[key: string]: string | undefined;
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
interface NodeViewState {
|
|
20
|
+
pos: [number, number];
|
|
21
|
+
size: [number, number];
|
|
22
|
+
collapsed: boolean;
|
|
23
|
+
}
|
|
24
|
+
interface ViewState {
|
|
25
|
+
nodes: {
|
|
26
|
+
[key: string]: NodeViewState | undefined;
|
|
27
|
+
};
|
|
28
|
+
renderoptions?: RenderOptions;
|
|
29
|
+
}
|
|
30
|
+
interface FullNodeSpaceJSON {
|
|
31
|
+
nodes: latest.SerializedNodeType[];
|
|
32
|
+
edges: [string, string, string, string][];
|
|
33
|
+
prop: {
|
|
34
|
+
[key: string]: any | undefined;
|
|
35
|
+
};
|
|
36
|
+
lib: LibType;
|
|
37
|
+
}
|
|
38
|
+
interface FullState {
|
|
39
|
+
backend: FullNodeSpaceJSON;
|
|
40
|
+
view: ViewState;
|
|
41
|
+
worker: {
|
|
42
|
+
[key: string]: string[] | undefined;
|
|
43
|
+
};
|
|
44
|
+
worker_dependencies: ExternalWorkerDependencies[];
|
|
45
|
+
}
|
|
46
|
+
interface ProgressState {
|
|
47
|
+
message: string;
|
|
48
|
+
status: string;
|
|
49
|
+
progress: number;
|
|
50
|
+
blocking: boolean;
|
|
51
|
+
}
|
|
52
|
+
interface ProgressStateMessage extends ProgressState {
|
|
53
|
+
type: "progress";
|
|
54
|
+
}
|
|
55
|
+
interface ResultMessage {
|
|
56
|
+
type: "result";
|
|
57
|
+
id?: string;
|
|
58
|
+
result: any;
|
|
59
|
+
}
|
|
60
|
+
interface ErrorMessage {
|
|
61
|
+
type: "error";
|
|
62
|
+
error: string;
|
|
63
|
+
tb: string[];
|
|
64
|
+
id?: string;
|
|
65
|
+
}
|
|
66
|
+
interface NodeSpaceEvent {
|
|
67
|
+
type: "nsevent";
|
|
68
|
+
event: string;
|
|
69
|
+
data: {
|
|
70
|
+
[key: string]: any | undefined;
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
interface WorkerEvent {
|
|
74
|
+
type: "workerevent";
|
|
75
|
+
event: string;
|
|
76
|
+
data: {
|
|
77
|
+
[key: string]: any | undefined;
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
interface LargeMessageHint {
|
|
81
|
+
type: "large_message";
|
|
82
|
+
msg_id: string;
|
|
83
|
+
}
|
|
84
|
+
interface PongMessage {
|
|
85
|
+
type: "pong";
|
|
86
|
+
}
|
|
87
|
+
type JSONMessage = ProgressStateMessage | ResultMessage | ErrorMessage | NodeSpaceEvent | WorkerEvent | LargeMessageHint | PongMessage;
|
|
88
|
+
interface WorkerRepresentation {
|
|
89
|
+
uuid: string;
|
|
90
|
+
host: string;
|
|
91
|
+
port: number;
|
|
92
|
+
ssl: boolean;
|
|
93
|
+
active: boolean;
|
|
94
|
+
open: boolean;
|
|
95
|
+
name: string | null;
|
|
96
|
+
}
|
|
97
|
+
interface WorkersState {
|
|
98
|
+
[key: string]: WorkerRepresentation | undefined;
|
|
99
|
+
}
|
|
100
|
+
interface FuncnodesReactHeaderProps {
|
|
101
|
+
show: boolean;
|
|
102
|
+
showmenu: boolean;
|
|
103
|
+
}
|
|
104
|
+
interface ReactFlowLibraryProps {
|
|
105
|
+
show: boolean;
|
|
106
|
+
}
|
|
107
|
+
interface ReactFlowLayerProps {
|
|
108
|
+
minimap: boolean;
|
|
109
|
+
static: boolean;
|
|
110
|
+
minZoom: number;
|
|
111
|
+
maxZoom: number;
|
|
112
|
+
allowFullScreen: boolean;
|
|
113
|
+
allowExpand: boolean;
|
|
114
|
+
showNodeSettings: boolean;
|
|
115
|
+
}
|
|
116
|
+
interface FuncnodesReactFlowProps {
|
|
117
|
+
id: string;
|
|
118
|
+
debug: boolean;
|
|
119
|
+
on_sync_complete?: (worker: FuncNodesWorker) => Promise<void>;
|
|
120
|
+
useWorkerManager: boolean;
|
|
121
|
+
show_library: boolean;
|
|
122
|
+
load_worker?: string;
|
|
123
|
+
worker?: FuncNodesWorker;
|
|
124
|
+
header: FuncnodesReactHeaderProps;
|
|
125
|
+
flow: ReactFlowLayerProps;
|
|
126
|
+
library: ReactFlowLibraryProps;
|
|
127
|
+
worker_url?: string;
|
|
128
|
+
fnw_url?: string;
|
|
129
|
+
workermanager_url?: string;
|
|
130
|
+
on_ready?: ({ fnrf_zst, }: {
|
|
131
|
+
fnrf_zst: FuncNodesReactFlowZustandInterface;
|
|
132
|
+
}) => void;
|
|
133
|
+
}
|
|
134
|
+
interface DevSettings {
|
|
135
|
+
debug: boolean;
|
|
136
|
+
}
|
|
137
|
+
interface FuncnodesReactFlowViewSettings {
|
|
138
|
+
expand_node_props?: boolean;
|
|
139
|
+
expand_lib?: boolean;
|
|
140
|
+
}
|
|
141
|
+
interface FuncnodesReactFlowLocalSettings {
|
|
142
|
+
view_settings: FuncnodesReactFlowViewSettings;
|
|
143
|
+
update_view_settings: (settings: FuncnodesReactFlowViewSettings) => void;
|
|
144
|
+
}
|
|
145
|
+
interface FuncnodesReactFlowLocalState {
|
|
146
|
+
selected_nodes: string[];
|
|
147
|
+
selected_edges: string[];
|
|
148
|
+
funcnodescontainerRef: HTMLDivElement | null;
|
|
149
|
+
}
|
|
150
|
+
interface FuncNodesReactFlowZustandInterface {
|
|
151
|
+
options: FuncnodesReactFlowProps;
|
|
152
|
+
local_settings: UseBoundStore<StoreApi<FuncnodesReactFlowLocalSettings>>;
|
|
153
|
+
local_state: UseBoundStore<StoreApi<FuncnodesReactFlowLocalState>>;
|
|
154
|
+
lib: LibZustandInterface;
|
|
155
|
+
workermanager: WorkerManager | undefined;
|
|
156
|
+
workers: UseBoundStore<StoreApi<WorkersState>>;
|
|
157
|
+
workerstate: UseBoundStore<StoreApi<FuncNodesWorkerState>>;
|
|
158
|
+
worker: FuncNodesWorker | undefined;
|
|
159
|
+
set_worker: (worker: FuncNodesWorker | undefined) => void;
|
|
160
|
+
_unsubscribeFromWorker: (() => void) | undefined;
|
|
161
|
+
nodespace: NodeSpaceZustandInterface;
|
|
162
|
+
useReactFlowStore: RFStore;
|
|
163
|
+
render_options: UseBoundStore<StoreApi<RenderOptions>>;
|
|
164
|
+
progress_state: UseBoundStore<StoreApi<ProgressState>>;
|
|
165
|
+
update_render_options: (options: RenderOptions) => void;
|
|
166
|
+
rf_instance?: ReturnType<typeof useReactFlow>;
|
|
167
|
+
on_node_action: (action: latest.NodeAction) => void;
|
|
168
|
+
on_edge_action: (edge: EdgeAction) => void;
|
|
169
|
+
set_progress: (progress: ProgressState) => void;
|
|
170
|
+
auto_progress: () => void;
|
|
171
|
+
plugins: UseBoundStore<StoreApi<{
|
|
172
|
+
[key: string]: latest.FuncNodesReactPlugin | undefined;
|
|
173
|
+
}>>;
|
|
174
|
+
add_plugin: (name: string, plugin: latest.FuncNodesReactPlugin) => void;
|
|
175
|
+
reactflowRef: HTMLDivElement | null;
|
|
176
|
+
clear_all: () => void;
|
|
177
|
+
center_node: (node_id: string | string[]) => void;
|
|
178
|
+
center_all: () => void;
|
|
179
|
+
dev_settings: DevSettings;
|
|
180
|
+
logger: Logger;
|
|
181
|
+
}
|
|
182
|
+
export type { FuncNodesReactFlowZustandInterface, WorkersState, WorkerRepresentation, JSONMessage, FullState, FullNodeSpaceJSON, ViewState, RenderOptions, ProgressState, ProgressStateMessage, ResultMessage, ErrorMessage, NodeSpaceEvent, WorkerEvent, LargeMessageHint, NodeViewState, FuncnodesReactFlowProps, FuncnodesReactHeaderProps, ReactFlowLayerProps, FuncnodesReactFlowLocalSettings, FuncnodesReactFlowLocalState, FuncnodesReactFlowViewSettings, ReactFlowLibraryProps, };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { default as LibZustand } from './lib';
|
|
2
|
+
import { default as NodeSpaceZustand } from './nodespace';
|
|
3
|
+
import { WorkersState } from './fnrfzst.t';
|
|
4
|
+
import { default as FuncNodesReactFlowZustand } from './fnrfzst';
|
|
5
|
+
export default FuncNodesReactFlowZustand;
|
|
6
|
+
export { LibZustand, NodeSpaceZustand };
|
|
7
|
+
export type { WorkersState };
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { UseBoundStore, StoreApi } from 'zustand';
|
|
2
|
+
type LibNode = {
|
|
3
|
+
node_id: string;
|
|
4
|
+
description?: string;
|
|
5
|
+
node_name?: string;
|
|
6
|
+
};
|
|
7
|
+
type Shelf = {
|
|
8
|
+
name: string;
|
|
9
|
+
description?: string;
|
|
10
|
+
nodes: LibNode[];
|
|
11
|
+
subshelves: Shelf[];
|
|
12
|
+
};
|
|
13
|
+
type LibType = {
|
|
14
|
+
shelves: Shelf[];
|
|
15
|
+
};
|
|
16
|
+
interface ExternalWorkerInstance {
|
|
17
|
+
uuid: string;
|
|
18
|
+
nodeclassid: string;
|
|
19
|
+
running: boolean;
|
|
20
|
+
name: string;
|
|
21
|
+
}
|
|
22
|
+
interface ExternalWorkerClassDep {
|
|
23
|
+
module: string;
|
|
24
|
+
class_name: string;
|
|
25
|
+
name: string;
|
|
26
|
+
instances: ExternalWorkerInstance[];
|
|
27
|
+
}
|
|
28
|
+
interface ExternalWorkerDependencies {
|
|
29
|
+
module: string;
|
|
30
|
+
worker_classes: ExternalWorkerClassDep[];
|
|
31
|
+
}
|
|
32
|
+
interface LibState {
|
|
33
|
+
lib: LibType;
|
|
34
|
+
external_worker?: ExternalWorkerDependencies[];
|
|
35
|
+
set: (state: {
|
|
36
|
+
lib?: LibType;
|
|
37
|
+
external_worker?: ExternalWorkerDependencies[];
|
|
38
|
+
}) => void;
|
|
39
|
+
get_lib: () => LibType;
|
|
40
|
+
get_external_worker: () => ExternalWorkerDependencies[] | undefined;
|
|
41
|
+
}
|
|
42
|
+
interface LibZustandInterface {
|
|
43
|
+
libstate: UseBoundStore<StoreApi<LibState>>;
|
|
44
|
+
}
|
|
45
|
+
export type { LibZustandInterface, LibState, LibType, Shelf, LibNode, ExternalWorkerClassDep, ExternalWorkerDependencies, ExternalWorkerInstance, };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { FuncNodesReactFlowZustandInterface } from '../fnrfzst.t';
|
|
2
|
+
import { latest } from '../../types/versioned/versions.t';
|
|
3
|
+
declare const createNodeStore: (fnrfz: FuncNodesReactFlowZustandInterface, node: latest.SerializedNodeType) => latest.NodeStore;
|
|
4
|
+
export { createNodeStore };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { latest } from '../../types/versioned/versions.t';
|
|
2
|
+
declare const simple_updater: <U extends string | number | boolean, T extends U | undefined>(oldvalue: U, newvalue: T) => [U, boolean];
|
|
3
|
+
declare function assertNever(x: never, y: any): never;
|
|
4
|
+
interface NormalizedPartialSerializedNodeType extends latest.PartialSerializedNodeType {
|
|
5
|
+
io_order: string[];
|
|
6
|
+
}
|
|
7
|
+
declare const normalize_node: (node: latest.PartialSerializedNodeType) => NormalizedPartialSerializedNodeType;
|
|
8
|
+
export { simple_updater, assertNever, normalize_node };
|
|
9
|
+
export type { NormalizedPartialSerializedNodeType };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { NodeViewState } from '../fnrfzst.t';
|
|
2
|
+
import { UseBoundStore, StoreApi } from 'zustand';
|
|
3
|
+
import { latest } from '../../types/versioned/versions.t';
|
|
4
|
+
declare const update_node: (old_store: UseBoundStore<StoreApi<latest.NodeType>>, new_state: latest.PartialSerializedNodeType) => void;
|
|
5
|
+
declare const update_nodeview: (node: latest.PartialSerializedNodeType, view: Partial<NodeViewState>) => void;
|
|
6
|
+
export { update_node, update_nodeview };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { latest } from '../types/versioned/versions.t';
|
|
2
|
+
/**
|
|
3
|
+
* Interface for the NodeSpaceZustand state management.
|
|
4
|
+
* This interface is used to define the shape of the state and the actions that can be performed on it.
|
|
5
|
+
*/
|
|
6
|
+
interface NodeSpaceZustandInterface {
|
|
7
|
+
nodesstates: Map<string, latest.NodeStore>;
|
|
8
|
+
get_node: (nid: string, raise?: boolean) => latest.NodeStore | undefined;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Interface for the NodeSpaceZustandProps.
|
|
12
|
+
* This interface is used to define the properties that can be passed to the NodeSpaceZustand component.
|
|
13
|
+
*/
|
|
14
|
+
interface NodeSpaceZustandProps {
|
|
15
|
+
}
|
|
16
|
+
export type { NodeSpaceZustandProps, NodeSpaceZustandInterface };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Connection, EdgeChange, NodeChange } from '@xyflow/react';
|
|
2
|
+
import { RFStore } from './reactflow.t';
|
|
3
|
+
declare const reactflowstore: ({ on_node_change, on_edge_change, on_connect, }: {
|
|
4
|
+
on_node_change?: (changes: NodeChange[]) => void;
|
|
5
|
+
on_edge_change?: (changes: EdgeChange[]) => void;
|
|
6
|
+
on_connect?: (connection: Connection) => void;
|
|
7
|
+
}) => RFStore;
|
|
8
|
+
export default reactflowstore;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { UseBoundStore, StoreApi } from 'zustand';
|
|
2
|
+
import { Edge, Node, OnNodesChange, OnEdgesChange, OnConnect } from '@xyflow/react';
|
|
3
|
+
type RFState = {
|
|
4
|
+
nodes: Node[];
|
|
5
|
+
edges: Edge[];
|
|
6
|
+
onNodesChange: OnNodesChange;
|
|
7
|
+
onEdgesChange: OnEdgesChange;
|
|
8
|
+
onConnect: OnConnect;
|
|
9
|
+
};
|
|
10
|
+
type RFStore = UseBoundStore<StoreApi<RFState>>;
|
|
11
|
+
export type { RFState, RFStore };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { BaseRenderOptions, EnumOf, SerializedType } from './rendering.t';
|
|
2
|
+
export interface IORenderOptions extends BaseRenderOptions {
|
|
3
|
+
set_default: boolean;
|
|
4
|
+
}
|
|
5
|
+
export interface IOValueOptions {
|
|
6
|
+
min?: number;
|
|
7
|
+
max?: number;
|
|
8
|
+
step?: number;
|
|
9
|
+
options?: (string | number)[] | EnumOf;
|
|
10
|
+
colorspace?: string;
|
|
11
|
+
}
|
|
12
|
+
export interface IOType {
|
|
13
|
+
connected: boolean;
|
|
14
|
+
does_trigger: boolean;
|
|
15
|
+
full_id: string;
|
|
16
|
+
id: string;
|
|
17
|
+
is_input: boolean;
|
|
18
|
+
name: string;
|
|
19
|
+
node: string;
|
|
20
|
+
type: SerializedType;
|
|
21
|
+
value: any;
|
|
22
|
+
fullvalue?: any;
|
|
23
|
+
render_options: IORenderOptions;
|
|
24
|
+
value_options?: IOValueOptions;
|
|
25
|
+
valuepreview_type?: string;
|
|
26
|
+
try_get_full_value: undefined | (() => void);
|
|
27
|
+
hidden: boolean;
|
|
28
|
+
set_hidden: undefined | ((v: boolean) => void);
|
|
29
|
+
}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { UseBoundStore, StoreApi } from 'zustand';
|
|
2
|
+
import { DataRenderOptions } from './rendering.t';
|
|
3
|
+
import { DeepPartial } from '../../../utils/objects';
|
|
4
|
+
import { IOType } from './io.t';
|
|
5
|
+
import { TqdmState } from '../../../frontend/utils/progressbar';
|
|
6
|
+
/**
|
|
7
|
+
* Interface for the NodeActionAdd.
|
|
8
|
+
* This interface is used when a new node is being added.
|
|
9
|
+
* It has a type property set to "add" and a node property of NodeType.
|
|
10
|
+
*/
|
|
11
|
+
export interface BaseNodeAction {
|
|
12
|
+
type: string;
|
|
13
|
+
from_remote: boolean;
|
|
14
|
+
id: string;
|
|
15
|
+
immediate?: boolean;
|
|
16
|
+
}
|
|
17
|
+
export interface NodeActionAdd extends BaseNodeAction {
|
|
18
|
+
type: "add";
|
|
19
|
+
node: NodeType;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Interface for the NodeActionUpdate.
|
|
23
|
+
* This interface is used when an existing node is being updated.
|
|
24
|
+
* It has a type property set to "update", an id property for the node to be updated,
|
|
25
|
+
* and a node property of PartialNodeType which contains the properties to be updated.
|
|
26
|
+
*/
|
|
27
|
+
export interface NodeActionUpdate extends BaseNodeAction {
|
|
28
|
+
type: "update";
|
|
29
|
+
node: PartialNodeType;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Interface for the NodeActionDelete.
|
|
33
|
+
* This interface is used when a node is being deleted.
|
|
34
|
+
* It has a type property set to "delete" and an id property for the node to be deleted.
|
|
35
|
+
*/
|
|
36
|
+
export interface NodeActionDelete extends BaseNodeAction {
|
|
37
|
+
type: "delete";
|
|
38
|
+
}
|
|
39
|
+
export interface NodeActionError extends BaseNodeAction {
|
|
40
|
+
type: "error";
|
|
41
|
+
errortype: string;
|
|
42
|
+
error: string;
|
|
43
|
+
tb?: string;
|
|
44
|
+
}
|
|
45
|
+
export interface NodeActionTrigger extends BaseNodeAction {
|
|
46
|
+
type: "trigger";
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Type alias for NodeAction.
|
|
50
|
+
* A NodeAction can be either a NodeActionAdd, NodeActionUpdate, or NodeActionDelete.
|
|
51
|
+
*/
|
|
52
|
+
export type NodeAction = NodeActionAdd | NodeActionUpdate | NodeActionDelete | NodeActionError | NodeActionTrigger;
|
|
53
|
+
export type NodeStore = UseBoundStore<StoreApi<NodeType>>;
|
|
54
|
+
export interface NodeRenderOptions {
|
|
55
|
+
data?: DataRenderOptions;
|
|
56
|
+
}
|
|
57
|
+
export interface NodeType {
|
|
58
|
+
id: string;
|
|
59
|
+
node_name: string;
|
|
60
|
+
io: {
|
|
61
|
+
[key: string]: IOType | undefined;
|
|
62
|
+
};
|
|
63
|
+
frontend: {
|
|
64
|
+
pos: [number, number];
|
|
65
|
+
size: [number, number];
|
|
66
|
+
collapsed: boolean;
|
|
67
|
+
};
|
|
68
|
+
name: string;
|
|
69
|
+
in_trigger: boolean;
|
|
70
|
+
error?: string;
|
|
71
|
+
render_options?: NodeRenderOptions;
|
|
72
|
+
io_order: string[];
|
|
73
|
+
progress: TqdmState;
|
|
74
|
+
}
|
|
75
|
+
export type PartialNodeType = DeepPartial<NodeType>;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { FuncNodesReactFlowZustandInterface } from '../../../states/fnrfzst.t';
|
|
2
|
+
import { NodeContextType } from '../../../frontend/node/node';
|
|
3
|
+
import { DataOverlayRendererType, DataPreviewViewRendererType, DataViewRendererType, HandlePreviewRendererType, InputRendererType, OutputRendererType } from './rendermappings.t';
|
|
4
|
+
import * as React from "react";
|
|
5
|
+
export type RenderPluginFactoryProps = {
|
|
6
|
+
React: typeof React;
|
|
7
|
+
fnrf_zst: FuncNodesReactFlowZustandInterface;
|
|
8
|
+
NodeContext: React.Context<NodeContextType | null>;
|
|
9
|
+
};
|
|
10
|
+
export interface RendererPlugin {
|
|
11
|
+
input_renderers?: {
|
|
12
|
+
[key: string]: InputRendererType | undefined;
|
|
13
|
+
};
|
|
14
|
+
output_renderers?: {
|
|
15
|
+
[key: string]: OutputRendererType | undefined;
|
|
16
|
+
};
|
|
17
|
+
handle_preview_renderers?: {
|
|
18
|
+
[key: string]: HandlePreviewRendererType | undefined;
|
|
19
|
+
};
|
|
20
|
+
data_overlay_renderers?: {
|
|
21
|
+
[key: string]: DataOverlayRendererType | undefined;
|
|
22
|
+
};
|
|
23
|
+
data_preview_renderers?: {
|
|
24
|
+
[key: string]: DataPreviewViewRendererType | undefined;
|
|
25
|
+
};
|
|
26
|
+
data_view_renderers?: {
|
|
27
|
+
[key: string]: DataViewRendererType | undefined;
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
export interface FuncNodesReactPlugin {
|
|
31
|
+
RendererPlugin?: RendererPlugin;
|
|
32
|
+
renderpluginfactory?: (props: RenderPluginFactoryProps) => RendererPlugin;
|
|
33
|
+
v?: 0 | "0";
|
|
34
|
+
}
|
|
35
|
+
export type AnyFuncNodesReactPlugin = FuncNodesReactPlugin;
|
|
36
|
+
export type AnyRendererPlugin = RendererPlugin;
|
|
37
|
+
export type AnyRenderPluginFactoryProps = RenderPluginFactoryProps;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
export interface AllOf {
|
|
2
|
+
allOf: SerializedType[];
|
|
3
|
+
}
|
|
4
|
+
export interface AnyOf {
|
|
5
|
+
anyOf: SerializedType[];
|
|
6
|
+
}
|
|
7
|
+
export interface ArrayOf {
|
|
8
|
+
type: "array";
|
|
9
|
+
items: SerializedType;
|
|
10
|
+
uniqueItems: boolean;
|
|
11
|
+
}
|
|
12
|
+
export interface DictOf {
|
|
13
|
+
type: "object";
|
|
14
|
+
keys: SerializedType;
|
|
15
|
+
values: SerializedType;
|
|
16
|
+
}
|
|
17
|
+
export interface EnumOf {
|
|
18
|
+
type: "enum";
|
|
19
|
+
values: (number | string | boolean | null)[];
|
|
20
|
+
keys: string[];
|
|
21
|
+
nullable: boolean;
|
|
22
|
+
}
|
|
23
|
+
export interface TypeOf {
|
|
24
|
+
type: "type";
|
|
25
|
+
value: SerializedType;
|
|
26
|
+
}
|
|
27
|
+
export type SerializedType = string | AllOf | AnyOf | ArrayOf | DictOf | EnumOf | TypeOf;
|
|
28
|
+
export type RenderType = "string" | "number" | "boolean" | "image" | SerializedType;
|
|
29
|
+
export interface BaseRenderOptions {
|
|
30
|
+
type: RenderType;
|
|
31
|
+
}
|
|
32
|
+
export interface DataRenderOptions extends BaseRenderOptions {
|
|
33
|
+
src?: string;
|
|
34
|
+
preview_type?: string;
|
|
35
|
+
}
|
|
36
|
+
export interface StringRenderOptions extends BaseRenderOptions {
|
|
37
|
+
max_length?: number;
|
|
38
|
+
}
|
|
39
|
+
export interface ImageRenderOptions extends BaseRenderOptions {
|
|
40
|
+
format?: "png" | "jpeg";
|
|
41
|
+
}
|
|
42
|
+
export type RenderOptions = BaseRenderOptions | ImageRenderOptions | StringRenderOptions;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { JSX } from 'react';
|
|
2
|
+
import { IOType } from './io.t';
|
|
3
|
+
export interface InputRendererProps {
|
|
4
|
+
io: IOType;
|
|
5
|
+
inputconverter: [(v: any) => any, (v: any) => any];
|
|
6
|
+
}
|
|
7
|
+
export type InputRendererType = ({ io, inputconverter, }: InputRendererProps) => JSX.Element;
|
|
8
|
+
export type OutputRendererProps = {
|
|
9
|
+
io: IOType;
|
|
10
|
+
};
|
|
11
|
+
export type OutputRendererType = ({ io }: OutputRendererProps) => JSX.Element;
|
|
12
|
+
export type DataViewRendererProps = {
|
|
13
|
+
io: IOType;
|
|
14
|
+
};
|
|
15
|
+
export type DataViewRendererType = ({ io, }: DataViewRendererProps) => JSX.Element;
|
|
16
|
+
export type HandlePreviewRendererProps = {
|
|
17
|
+
io: IOType;
|
|
18
|
+
};
|
|
19
|
+
export type HandlePreviewRendererType = ({ io, }: HandlePreviewRendererProps) => JSX.Element;
|
|
20
|
+
export type DataOverlayRendererProps = {
|
|
21
|
+
io: IOType;
|
|
22
|
+
};
|
|
23
|
+
export type DataOverlayRendererType = ({ io, }: DataOverlayRendererProps) => JSX.Element;
|
|
24
|
+
export type DataPreviewViewRendererProps = {
|
|
25
|
+
io: IOType;
|
|
26
|
+
};
|
|
27
|
+
export type DataPreviewViewRendererType = ({ io, }: DataPreviewViewRendererProps) => JSX.Element;
|