@linkdlab/funcnodes_react_flow 0.1.4 → 0.1.6
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/css/style.css +13 -10
- package/dist/data_text_javascript_base64_.index.js +22 -0
- package/dist/frontend/datarenderer/data_renderer_overlay.d.ts +5 -0
- package/dist/frontend/datarenderer/data_renderer_preview.d.ts +5 -0
- package/dist/frontend/datarenderer/default_preview_renderer.d.ts +15 -0
- package/dist/frontend/datarenderer/images.d.ts +4 -4
- package/dist/frontend/datarenderer/index.d.ts +3 -3
- package/dist/frontend/datarenderer/plotly.d.ts +9 -13
- package/dist/frontend/datarenderer/rendermappings.d.ts +122 -0
- package/dist/frontend/dialog.d.ts +1 -0
- package/dist/frontend/edge.d.ts +3 -3
- package/dist/frontend/funcnodesreactflow/index.d.ts +2 -2
- package/dist/frontend/funcnodesreactflow/react_flow_layer.d.ts +3 -3
- package/dist/frontend/lib.d.ts +3 -3
- package/dist/frontend/node/body_data_renderer.d.ts +7 -0
- package/dist/frontend/node/io/default_input_renderer.d.ts +4 -4
- package/dist/frontend/node/io/default_output_render.d.ts +2 -2
- package/dist/frontend/node/io/handle_renderer.d.ts +5 -3
- package/dist/frontend/node/io/io.d.ts +4 -4
- package/dist/frontend/node/io/nodeinput.d.ts +2 -2
- package/dist/frontend/node/io/nodeoutput.d.ts +2 -2
- package/dist/frontend/node/node.d.ts +3 -3
- package/dist/frontend/utils/colorpicker.d.ts +10 -8
- package/dist/frontend/utils/jsondata.d.ts +2 -2
- package/dist/frontend/utils/select.d.ts +14 -0
- package/dist/frontend/utils/table.d.ts +2 -2
- package/dist/funcnodes/funcnodesworker.d.ts +28 -12
- package/dist/index.d.ts +6 -1
- package/dist/index.js +140 -20
- package/dist/plugin/index.d.ts +6 -0
- package/dist/plugin/rendenderer.d.ts +20 -0
- package/dist/states/fnrfzst.d.ts +7 -7
- package/dist/states/fnrfzst.t.d.ts +13 -2
- package/dist/states/lib.t.d.ts +19 -5
- package/dist/states/node.d.ts +2 -1
- package/dist/states/nodeio.t.d.ts +3 -3
- package/dist/states/reactflow.d.ts +3 -3
- package/dist/states/reactflow.t.d.ts +2 -2
- package/dist/types/rendering.t.d.ts +3 -3
- package/dist/utils/autolayout/force.d.ts +2 -0
- package/dist/utils/autolayout/index.d.ts +2 -0
- package/package.json +10 -8
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { HandlePreviewRendererType, DataOverlayRendererType, DataPreviewViewRendererType, DataViewRendererType } from "../frontend/datarenderer/rendermappings";
|
|
2
|
+
import { InputRendererType } from "../states/nodeio.t";
|
|
3
|
+
interface RendererPlugin {
|
|
4
|
+
input_renderers?: {
|
|
5
|
+
[key: string]: InputRendererType;
|
|
6
|
+
};
|
|
7
|
+
handle_preview_renderers?: {
|
|
8
|
+
[key: string]: HandlePreviewRendererType;
|
|
9
|
+
};
|
|
10
|
+
data_overlay_renderers?: {
|
|
11
|
+
[key: string]: DataOverlayRendererType;
|
|
12
|
+
};
|
|
13
|
+
data_preview_renderers?: {
|
|
14
|
+
[key: string]: DataPreviewViewRendererType;
|
|
15
|
+
};
|
|
16
|
+
data_view_renderers?: {
|
|
17
|
+
[key: string]: DataViewRendererType;
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
export default RendererPlugin;
|
package/dist/states/fnrfzst.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import LibZustand from
|
|
2
|
-
import NodeSpaceZustand from
|
|
3
|
-
import { Node as RFNode } from
|
|
4
|
-
import { NodeStore } from
|
|
5
|
-
import type { FuncNodesReactFlowZustandInterface } from
|
|
6
|
-
import type { NodeType } from
|
|
1
|
+
import LibZustand from "./lib";
|
|
2
|
+
import NodeSpaceZustand from "./nodespace";
|
|
3
|
+
import { Node as RFNode } from "reactflow";
|
|
4
|
+
import { NodeStore } from "./node.t";
|
|
5
|
+
import type { FuncNodesReactFlowZustandInterface, FuncnodesReactFlowProps } from "./fnrfzst.t";
|
|
6
|
+
import type { NodeType } from "./node.t";
|
|
7
7
|
declare const assert_reactflow_node: (node: NodeType, store: NodeStore, fnrf_instance?: FuncNodesReactFlowZustandInterface) => NodeType & RFNode;
|
|
8
|
-
declare const FuncNodesReactFlowZustand: () => FuncNodesReactFlowZustandInterface;
|
|
8
|
+
declare const FuncNodesReactFlowZustand: ({ useWorkerManager, default_worker, }: FuncnodesReactFlowProps) => FuncNodesReactFlowZustandInterface;
|
|
9
9
|
export default FuncNodesReactFlowZustand;
|
|
10
10
|
export { LibZustand, NodeSpaceZustand, assert_reactflow_node };
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { StoreApi, UseBoundStore } from "zustand";
|
|
2
2
|
import { FuncNodesWorker, WorkerManager } from "../funcnodes";
|
|
3
|
-
import { LibType, LibZustandInterface } from "./lib.t";
|
|
3
|
+
import { ExternalWorkerDependecies, LibType, LibZustandInterface } from "./lib.t";
|
|
4
4
|
import { NodeSpaceZustandInterface } from "./nodespace.t";
|
|
5
5
|
import { NodeAction, NodeType } from "./node.t";
|
|
6
6
|
import { RFStore } from "./reactflow.t";
|
|
7
7
|
import { EdgeAction } from "./edge.t";
|
|
8
8
|
import { useReactFlow } from "reactflow";
|
|
9
|
+
import FuncNodesReactPlugin from "../plugin";
|
|
9
10
|
interface RenderOptions {
|
|
10
11
|
typemap?: {
|
|
11
12
|
[key: string]: string;
|
|
@@ -39,6 +40,7 @@ interface FullState {
|
|
|
39
40
|
worker: {
|
|
40
41
|
[key: string]: string[];
|
|
41
42
|
};
|
|
43
|
+
worker_dependencies: ExternalWorkerDependecies[];
|
|
42
44
|
}
|
|
43
45
|
interface ProgressState {
|
|
44
46
|
message: string;
|
|
@@ -79,7 +81,12 @@ interface WorkerRepresentation {
|
|
|
79
81
|
interface WorkersState {
|
|
80
82
|
[key: string]: WorkerRepresentation;
|
|
81
83
|
}
|
|
84
|
+
interface FuncnodesReactFlowProps {
|
|
85
|
+
useWorkerManager?: boolean;
|
|
86
|
+
default_worker?: FuncNodesWorker;
|
|
87
|
+
}
|
|
82
88
|
interface FuncNodesReactFlowZustandInterface {
|
|
89
|
+
options: FuncnodesReactFlowProps;
|
|
83
90
|
lib: LibZustandInterface;
|
|
84
91
|
workermanager: WorkerManager | undefined;
|
|
85
92
|
workers: UseBoundStore<StoreApi<WorkersState>>;
|
|
@@ -94,7 +101,11 @@ interface FuncNodesReactFlowZustandInterface {
|
|
|
94
101
|
on_edge_action: (edge: EdgeAction) => void;
|
|
95
102
|
set_progress: (progress: ProgressState) => void;
|
|
96
103
|
auto_progress: () => void;
|
|
104
|
+
plugins: UseBoundStore<StoreApi<{
|
|
105
|
+
[key: string]: FuncNodesReactPlugin;
|
|
106
|
+
}>>;
|
|
107
|
+
add_plugin: (name: string, plugin: FuncNodesReactPlugin) => void;
|
|
97
108
|
reactflowRef: HTMLDivElement | null;
|
|
98
109
|
clear_all: () => void;
|
|
99
110
|
}
|
|
100
|
-
export type { FuncNodesReactFlowZustandInterface, WorkersState, WorkerRepresentation, JSONMessage, FullState, FullNodeSpaceJSON, ViewState, RenderOptions, ProgressState, ProgressStateMessage, ResultMessage, ErrorMessage, NodeSpaceEvent, NodeViewState, };
|
|
111
|
+
export type { FuncNodesReactFlowZustandInterface, WorkersState, WorkerRepresentation, JSONMessage, FullState, FullNodeSpaceJSON, ViewState, RenderOptions, ProgressState, ProgressStateMessage, ResultMessage, ErrorMessage, NodeSpaceEvent, NodeViewState, FuncnodesReactFlowProps, };
|
package/dist/states/lib.t.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { UseBoundStore, StoreApi } from
|
|
1
|
+
import { UseBoundStore, StoreApi } from "zustand";
|
|
2
2
|
type LibNode = {
|
|
3
3
|
node_id: string;
|
|
4
4
|
description?: string;
|
|
@@ -13,12 +13,26 @@ type Shelf = {
|
|
|
13
13
|
type LibType = {
|
|
14
14
|
shelves: Shelf[];
|
|
15
15
|
};
|
|
16
|
+
interface ExternalWorkerClassDep {
|
|
17
|
+
module: string;
|
|
18
|
+
class_name: string;
|
|
19
|
+
name: string;
|
|
20
|
+
}
|
|
21
|
+
interface ExternalWorkerDependecies {
|
|
22
|
+
module: string;
|
|
23
|
+
worker_classes: ExternalWorkerClassDep[];
|
|
24
|
+
}
|
|
16
25
|
interface LibState {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
26
|
+
lib: LibType;
|
|
27
|
+
external_worker?: ExternalWorkerDependecies[];
|
|
28
|
+
set: (state: {
|
|
29
|
+
lib?: LibType;
|
|
30
|
+
external_worker?: ExternalWorkerDependecies[];
|
|
31
|
+
}) => void;
|
|
32
|
+
get_lib: () => LibType;
|
|
33
|
+
get_external_worker: () => ExternalWorkerDependecies[] | undefined;
|
|
20
34
|
}
|
|
21
35
|
interface LibZustandInterface {
|
|
22
36
|
libstate: UseBoundStore<StoreApi<LibState>>;
|
|
23
37
|
}
|
|
24
|
-
export type { LibZustandInterface, LibState, LibType, Shelf, LibNode };
|
|
38
|
+
export type { LibZustandInterface, LibState, LibType, Shelf, LibNode, ExternalWorkerClassDep, ExternalWorkerDependecies, };
|
package/dist/states/node.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { NodeType, PartialNodeType, NodeStore } from "./node.t";
|
|
2
2
|
declare const assert_full_node: (node: PartialNodeType) => NodeType;
|
|
3
|
+
declare const normalize_node: (node: PartialNodeType) => PartialNodeType;
|
|
3
4
|
declare const createNodeStore: (node: NodeType) => NodeStore;
|
|
4
|
-
export { createNodeStore, assert_full_node };
|
|
5
|
+
export { createNodeStore, assert_full_node, normalize_node };
|
|
@@ -30,7 +30,7 @@ interface TypeOf {
|
|
|
30
30
|
type SerializedType = string | AllOf | AnyOf | ArrayOf | DictOf | EnumOf | TypeOf;
|
|
31
31
|
interface IORenderOptions extends BaseRenderOptions {
|
|
32
32
|
step?: number;
|
|
33
|
-
set_default
|
|
33
|
+
set_default: boolean;
|
|
34
34
|
}
|
|
35
35
|
interface IOValueOptions {
|
|
36
36
|
min?: number;
|
|
@@ -50,7 +50,7 @@ interface IOType {
|
|
|
50
50
|
type: SerializedType;
|
|
51
51
|
value: any;
|
|
52
52
|
fullvalue?: any;
|
|
53
|
-
render_options
|
|
53
|
+
render_options: IORenderOptions;
|
|
54
54
|
value_options?: IOValueOptions;
|
|
55
55
|
valuepreview_type?: string;
|
|
56
56
|
try_get_full_value: () => void;
|
|
@@ -60,7 +60,7 @@ type OutputRendererType = ({ io }: {
|
|
|
60
60
|
}) => JSX.Element;
|
|
61
61
|
interface InputRendererProps {
|
|
62
62
|
io: IOType;
|
|
63
|
-
inputconverter: (v: any) => any;
|
|
63
|
+
inputconverter: [(v: any) => any, (v: any) => any];
|
|
64
64
|
}
|
|
65
65
|
type InputRendererType = ({ io, inputconverter, }: InputRendererProps) => JSX.Element;
|
|
66
66
|
type PartialIOType = DeepPartial<IOType>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Connection, EdgeChange, NodeChange } from
|
|
2
|
-
import { RFStore } from
|
|
3
|
-
declare const reactflowstore: ({ on_node_change, on_edge_change, on_connect }: {
|
|
1
|
+
import { Connection, EdgeChange, NodeChange } from "reactflow";
|
|
2
|
+
import { RFStore } from "./reactflow.t";
|
|
3
|
+
declare const reactflowstore: ({ on_node_change, on_edge_change, on_connect, }: {
|
|
4
4
|
on_node_change?: ((changes: NodeChange[]) => void) | undefined;
|
|
5
5
|
on_edge_change?: ((changes: EdgeChange[]) => void) | undefined;
|
|
6
6
|
on_connect?: ((connection: Connection) => void) | undefined;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { UseBoundStore, StoreApi } from
|
|
2
|
-
import { Edge, Node, OnNodesChange, OnEdgesChange, OnConnect } from
|
|
1
|
+
import { UseBoundStore, StoreApi } from "zustand";
|
|
2
|
+
import { Edge, Node, OnNodesChange, OnEdgesChange, OnConnect } from "reactflow";
|
|
3
3
|
type RFState = {
|
|
4
4
|
nodes: Node[];
|
|
5
5
|
edges: Edge[];
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
import { SerializedType } from "../states/nodeio.t";
|
|
2
|
+
type RenderType = "string" | "number" | "boolean" | "image" | SerializedType;
|
|
2
3
|
interface BaseRenderOptions {
|
|
3
|
-
type
|
|
4
|
+
type: RenderType;
|
|
4
5
|
}
|
|
5
6
|
interface DataRenderOptions extends BaseRenderOptions {
|
|
6
7
|
src?: string;
|
|
7
|
-
type?: RenderType;
|
|
8
8
|
preview_type?: string;
|
|
9
9
|
}
|
|
10
10
|
export type { DataRenderOptions, RenderType, BaseRenderOptions };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@linkdlab/funcnodes_react_flow",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.6",
|
|
4
4
|
"description": "This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -25,10 +25,11 @@
|
|
|
25
25
|
"build": "react-scripts build",
|
|
26
26
|
"test": "react-scripts test",
|
|
27
27
|
"eject": "react-scripts eject",
|
|
28
|
-
"buildmod": "tsc -p tsconfig.esm.json",
|
|
29
28
|
"webpack:app": "cd app && webpack",
|
|
30
|
-
"webpack:module": "
|
|
31
|
-
"serve": "cd app && webpack serve --mode=development"
|
|
29
|
+
"webpack:module": "webpack",
|
|
30
|
+
"serve": "cd app && webpack serve --mode=development",
|
|
31
|
+
"watch": "webpack --watch --progress",
|
|
32
|
+
"pretty": "prettier --write \"./src/**/*.{js,jsx,mjs,cjs,ts,tsx,json}\""
|
|
32
33
|
},
|
|
33
34
|
"dependencies": {
|
|
34
35
|
"@emotion/react": "^11.11.3",
|
|
@@ -37,25 +38,26 @@
|
|
|
37
38
|
"@mui/material": "^5.15.10",
|
|
38
39
|
"@radix-ui/react-dialog": "^1.0.5",
|
|
39
40
|
"@radix-ui/react-popover": "^1.0.7",
|
|
41
|
+
"@radix-ui/react-slider": "^1.1.2",
|
|
40
42
|
"@radix-ui/react-tooltip": "^1.0.7",
|
|
41
43
|
"@testing-library/jest-dom": "^5.14.1",
|
|
42
44
|
"@testing-library/react": "^13.0.0",
|
|
43
45
|
"@testing-library/user-event": "^13.2.1",
|
|
44
46
|
"@types/color-convert": "^2.0.3",
|
|
47
|
+
"@types/d3": "^7.4.3",
|
|
45
48
|
"@types/jest": "^27.0.1",
|
|
46
49
|
"@types/node": "^16.7.13",
|
|
47
|
-
"@types/plotly.js": "^2.29.1",
|
|
48
50
|
"@types/react": "^18.0.0",
|
|
49
51
|
"@types/react-dom": "^18.0.0",
|
|
50
|
-
"@types/react-plotly.js": "^2.6.3",
|
|
51
52
|
"@types/uuid": "^9.0.8",
|
|
53
|
+
"buffer": "^6.0.3",
|
|
52
54
|
"color-convert": "^2.0.1",
|
|
53
|
-
"
|
|
55
|
+
"d3": "^7.9.0",
|
|
54
56
|
"react": "^18.2.0",
|
|
55
57
|
"react-dom": "^18.2.0",
|
|
56
58
|
"react-json-view-lite": "^1.3.0",
|
|
57
|
-
"react-plotly.js": "^2.6.0",
|
|
58
59
|
"react-scripts": "5.0.1",
|
|
60
|
+
"react-select": "^5.8.0",
|
|
59
61
|
"reactflow": "^11.10.3",
|
|
60
62
|
"sass": "^1.75.0",
|
|
61
63
|
"scss": "^0.2.4",
|