@linkdlab/funcnodes_react_flow 0.1.0 → 0.1.1

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.
Files changed (83) hide show
  1. package/{public → app/public}/index.html +3 -3
  2. package/{src → app/src}/App.tsx +1 -1
  3. package/{src → app/src}/index.tsx +6 -6
  4. package/app/tsconfig.app.json +10 -0
  5. package/app/webpack.config.js +143 -0
  6. package/{src → module/src}/frontend/datarenderer/index.tsx +1 -0
  7. package/{src → module/src}/frontend/dialog.tsx +1 -0
  8. package/{src → module/src}/frontend/edge.tsx +1 -0
  9. package/{src/frontend → module/src/frontend/funcnodesreactflow}/funcnodesreactflow.scss +1 -1
  10. package/module/src/frontend/funcnodesreactflow/index.tsx +68 -0
  11. package/{src/frontend/funcnodesreactflow.tsx → module/src/frontend/funcnodesreactflow/react_flow_layer.tsx} +65 -136
  12. package/{src → module/src}/frontend/header/index.tsx +2 -1
  13. package/{src → module/src}/frontend/index.tsx +1 -1
  14. package/{src → module/src}/frontend/lib.tsx +2 -1
  15. package/{src → module/src}/frontend/node/io/default_input_renderer.tsx +3 -1
  16. package/{src → module/src}/frontend/node/io/default_output_render.tsx +3 -4
  17. package/{src → module/src}/frontend/node/io/handle_renderer.tsx +6 -1
  18. package/{src → module/src}/frontend/node/io/io.tsx +1 -0
  19. package/{src → module/src}/frontend/node/io/nodeinput.tsx +3 -1
  20. package/{src → module/src}/frontend/node/io/nodeoutput.tsx +7 -1
  21. package/{src → module/src}/frontend/node/node.tsx +3 -2
  22. package/{src → module/src}/frontend/utils/table.tsx +3 -2
  23. package/{src → module/src}/funcnodes/funcnodesworker.ts +6 -5
  24. package/{src → module/src}/funcnodes/websocketworker.ts +0 -1
  25. package/{src → module/src}/funcnodes/workermanager.ts +6 -2
  26. package/module/src/index.tsx +4 -0
  27. package/{src/state/edge.ts → module/src/states/edge.t.ts} +0 -15
  28. package/module/src/states/edge.ts +15 -0
  29. package/module/src/states/fnrfzst.t.ts +117 -0
  30. package/{src/state → module/src/states}/fnrfzst.ts +19 -44
  31. package/module/src/states/index.ts +7 -0
  32. package/module/src/states/lib.t.ts +30 -0
  33. package/module/src/states/lib.ts +16 -0
  34. package/{src/state/node.ts → module/src/states/node.t.ts} +24 -44
  35. package/module/src/states/node.ts +46 -0
  36. package/{src/types/nodeio.d.ts → module/src/states/nodeio.t.ts} +21 -0
  37. package/module/src/states/nodespace.t.ts +57 -0
  38. package/{src/state → module/src/states}/nodespace.ts +4 -65
  39. package/module/src/states/reactflow.t.ts +27 -0
  40. package/{src/state → module/src/states}/reactflow.ts +2 -18
  41. package/module/src/types/funcnodesreactflow.d.ts +1 -0
  42. package/module/src/types/rendering.t.ts +13 -0
  43. package/module/src/utils/index.ts +4 -0
  44. package/{src/state/index.ts → module/src/utils/objects.ts} +0 -8
  45. package/module/tsconfig.module.json +15 -0
  46. package/module/webpack.config.js +140 -0
  47. package/package.json +27 -5
  48. package/tsconfig.json +1 -3
  49. package/package copy.json +0 -63
  50. package/src/frontend/nodecontextmenu.scss +0 -18
  51. package/src/logo.svg +0 -1
  52. package/src/state/lib.ts +0 -26
  53. package/src/types/lib.d.ts +0 -16
  54. package/src/types/node.d.ts +0 -29
  55. package/src/types/worker.d.ts +0 -56
  56. /package/{public → app/public}/favicon.ico +0 -0
  57. /package/{public → app/public}/logo192.png +0 -0
  58. /package/{public → app/public}/logo512.png +0 -0
  59. /package/{public → app/public}/manifest.json +0 -0
  60. /package/{public → app/public}/robots.txt +0 -0
  61. /package/{public → app/public}/worker_manager +0 -0
  62. /package/{src → app/src}/App.css +0 -0
  63. /package/{src → app/src}/App.test.tsx +0 -0
  64. /package/{src → app/src}/index.css +0 -0
  65. /package/{src → app/src}/react-app-env.d.ts +0 -0
  66. /package/{src → app/src}/reportWebVitals.ts +0 -0
  67. /package/{src → app/src}/setupTests.ts +0 -0
  68. /package/{src → module/src}/frontend/datarenderer/images.tsx +0 -0
  69. /package/{src → module/src}/frontend/datarenderer/plotly.tsx +0 -0
  70. /package/{src → module/src}/frontend/dialog.scss +0 -0
  71. /package/{src → module/src}/frontend/edge.scss +0 -0
  72. /package/{src → module/src}/frontend/header/header.scss +0 -0
  73. /package/{src → module/src}/frontend/layout/htmlelements.scss +0 -0
  74. /package/{src → module/src}/frontend/lib.scss +0 -0
  75. /package/{src → module/src}/frontend/node/index.tsx +0 -0
  76. /package/{src → module/src}/frontend/node/io/index.tsx +0 -0
  77. /package/{src → module/src}/frontend/node/io/io.scss +0 -0
  78. /package/{src → module/src}/frontend/node/node.scss +0 -0
  79. /package/{src → module/src}/frontend/utils/colorpicker.scss +0 -0
  80. /package/{src → module/src}/frontend/utils/colorpicker.tsx +0 -0
  81. /package/{src → module/src}/frontend/utils/jsondata.tsx +0 -0
  82. /package/{src → module/src}/frontend/utils/table.scss +0 -0
  83. /package/{src → module/src}/funcnodes/index.ts +0 -0
@@ -1,68 +1,8 @@
1
- import React, { useRef, useState } from "react";
2
- import { useStore, create, UseBoundStore, StoreApi } from "zustand";
1
+ import { NodeStore } from "./node.t";
3
2
  import {
4
- NodeStore,
5
- createNodeStore,
6
- NodeAction,
7
- assert_full_node,
8
- } from "./node";
9
- import { deep_merge } from "./";
10
- import { RefObject } from "react";
11
-
12
- /**
13
- * Interface for the NodeSpaceZustand state management.
14
- * This interface is used to define the shape of the state and the actions that can be performed on it.
15
- */
16
- interface NodeSpaceZustandInterface {
17
- // A Map object that holds NodeStore objects. The key is a string (node id), and the value is a NodeStore.
18
- nodesstates: Map<string, NodeStore>;
19
-
20
- get_node: (nid: string, raise?: boolean) => NodeStore | undefined;
21
-
22
- // A function to add a new node to the nodesstates Map. It takes a NodeType object as a parameter.
23
- // add_node: ({
24
- // node,
25
- // from_remote,
26
- // }: {
27
- // node: NodeType;
28
- // from_remote: boolean;
29
- // }) => void;
30
-
31
- // // A function to update an existing node in the nodesstates Map.
32
- // // It takes a node id (string) and a PartialNodeType object (which contains the properties to be updated) as parameters.
33
- // update_node: ({
34
- // nid,
35
- // node,
36
- // from_remote,
37
- // }: {
38
- // nid: string;
39
- // node: PartialNodeType;
40
- // from_remote: boolean;
41
- // }) => void;
42
-
43
- // set_value: ({
44
- // node,
45
- // io,
46
- // value,
47
- // set_default,
48
- // }: {
49
- // node: string;
50
- // io: string;
51
- // value: any;
52
- // set_default?: boolean | undefined;
53
- // }) => void;
54
- }
55
-
56
- /**
57
- * Interface for the NodeSpaceZustandProps.
58
- * This interface is used to define the properties that can be passed to the NodeSpaceZustand component.
59
- */
60
- interface NodeSpaceZustandProps {
61
- // Optional callback function that is invoked when a node action occurs.
62
- // The function takes a NodeAction object as a parameter.
63
- // on_node_action?: (action: NodeAction) => void;
64
- }
65
-
3
+ NodeSpaceZustandInterface,
4
+ NodeSpaceZustandProps,
5
+ } from "./nodespace.t";
66
6
  const NodeSpaceZustand =
67
7
  ({}: NodeSpaceZustandProps): NodeSpaceZustandInterface => {
68
8
  const nodesstates = new Map<string, NodeStore>();
@@ -148,4 +88,3 @@ const NodeSpaceZustand =
148
88
  };
149
89
 
150
90
  export default NodeSpaceZustand;
151
- export type { NodeSpaceZustandInterface };
@@ -0,0 +1,27 @@
1
+ import { create, UseBoundStore, StoreApi } from "zustand";
2
+ import {
3
+ Connection,
4
+ Edge,
5
+ EdgeChange,
6
+ Node,
7
+ NodeChange,
8
+ addEdge,
9
+ OnNodesChange,
10
+ OnEdgesChange,
11
+ OnConnect,
12
+ applyNodeChanges,
13
+ applyEdgeChanges,
14
+ } from "reactflow";
15
+
16
+ type RFState = {
17
+ nodes: Node[];
18
+ edges: Edge[];
19
+ onNodesChange: OnNodesChange;
20
+ onEdgesChange: OnEdgesChange;
21
+ onConnect: OnConnect;
22
+ };
23
+
24
+ // this is our useStore hook that we can use in our components to get parts of the store and call actions
25
+ type RFStore = UseBoundStore<StoreApi<RFState>>;
26
+
27
+ export type { RFState, RFStore };
@@ -1,28 +1,13 @@
1
- import { create, UseBoundStore, StoreApi } from "zustand";
1
+ import { create } from "zustand";
2
2
  import {
3
3
  Connection,
4
- Edge,
5
4
  EdgeChange,
6
- Node,
7
5
  NodeChange,
8
- addEdge,
9
- OnNodesChange,
10
- OnEdgesChange,
11
- OnConnect,
12
6
  applyNodeChanges,
13
7
  applyEdgeChanges,
14
8
  } from "reactflow";
9
+ import { RFState, RFStore } from "./reactflow.t";
15
10
 
16
- type RFState = {
17
- nodes: Node[];
18
- edges: Edge[];
19
- onNodesChange: OnNodesChange;
20
- onEdgesChange: OnEdgesChange;
21
- onConnect: OnConnect;
22
- };
23
-
24
- // this is our useStore hook that we can use in our components to get parts of the store and call actions
25
- type RFStore = UseBoundStore<StoreApi<RFState>>;
26
11
  const reactflowstore = ({
27
12
  on_node_change,
28
13
  on_edge_change,
@@ -62,4 +47,3 @@ const reactflowstore = ({
62
47
  };
63
48
 
64
49
  export default reactflowstore;
65
- export type { RFState, RFStore };
@@ -0,0 +1,13 @@
1
+ type RenderType = "string" | "number" | "boolean" | "image";
2
+
3
+ interface BaseRenderOptions {
4
+ type?: RenderType;
5
+ }
6
+
7
+ interface DataRenderOptions extends BaseRenderOptions {
8
+ src?: string;
9
+ type?: RenderType;
10
+ preview_type?: string;
11
+ }
12
+
13
+ export type { DataRenderOptions, RenderType, BaseRenderOptions };
@@ -0,0 +1,4 @@
1
+ import { deep_merge, deep_compare_objects, DeepPartial } from "./objects";
2
+
3
+ export { deep_merge, deep_compare_objects };
4
+ export type { DeepPartial };
@@ -1,11 +1,3 @@
1
- import LibZustand, { LibZustandInterface } from "./lib";
2
- import NodeSpaceZustand, { NodeSpaceZustandInterface } from "./nodespace";
3
- import { FuncNodesReactFlowZustandInterface, WorkersState } from "./fnrfzst";
4
- import FuncNodesReactFlowZustand from "./fnrfzst";
5
- export default FuncNodesReactFlowZustand;
6
- export { LibZustand, NodeSpaceZustand };
7
- export type { FuncNodesReactFlowZustandInterface, WorkersState };
8
-
9
1
  // Type alias for DeepPartial. It makes all properties of T optional and recursive.
10
2
  type DeepPartial<T> = T extends object
11
3
  ? {
@@ -0,0 +1,15 @@
1
+ {
2
+ "extends": "../tsconfig.json",
3
+ "compilerOptions": {
4
+ "module": "es2015" /* Specify what module code is generated. */,
5
+ "declaration": true /* Generate .d.ts files from TypeScript and JavaScript files in your project. */,
6
+ "outDir": "./dist/tsc",
7
+ "esModuleInterop": true /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */,
8
+ "forceConsistentCasingInFileNames": true /* Ensure that casing is correct in imports. */,
9
+ "strict": true /* Enable all strict type-checking options. */,
10
+ "skipLibCheck": true /* Skip type checking all .d.ts files. */,
11
+ "noEmit": false,
12
+ "declarationMap": true
13
+ },
14
+ "include": ["src/**/*"]
15
+ }
@@ -0,0 +1,140 @@
1
+ // webpack.config.js
2
+ const path = require("path");
3
+ const MiniCssExtractPlugin = require("mini-css-extract-plugin");
4
+ const glob = require("glob");
5
+ const { PurgeCSSPlugin } = require("purgecss-webpack-plugin");
6
+
7
+ const PATHS = {
8
+ src: path.join(__dirname, "src"),
9
+ };
10
+
11
+ module.exports = {
12
+ context: __dirname,
13
+ entry: "./src/index.tsx",
14
+
15
+ output: {
16
+ path: path.resolve(__dirname, "dist"),
17
+ filename: "index.js",
18
+ libraryTarget: "umd",
19
+ library: "ModuleName",
20
+ },
21
+ performance: {
22
+ maxEntrypointSize: 5 * 1024 * 1024, // 5mb
23
+ maxAssetSize: 5 * 1024 * 1024, // 5mb
24
+ },
25
+ mode: "development",
26
+ module: {
27
+ rules: [
28
+ //typescript
29
+ {
30
+ test: /\.(tsx|ts)$/,
31
+ use: [
32
+ {
33
+ loader: "ts-loader",
34
+ options: {
35
+ configFile: "tsconfig.module.json",
36
+ },
37
+ },
38
+ ],
39
+ exclude: /node_modules/,
40
+ },
41
+ //css
42
+ {
43
+ test: /\.css$/,
44
+ use: [
45
+ // "style-loader",
46
+ MiniCssExtractPlugin.loader,
47
+ { loader: "css-loader", options: { importLoaders: 5 } },
48
+ {
49
+ loader: "postcss-loader",
50
+ options: {
51
+ postcssOptions: {
52
+ plugins: [require("autoprefixer"), require("cssnano")],
53
+ },
54
+ },
55
+ },
56
+ ],
57
+ sideEffects: true,
58
+ },
59
+ //javascript
60
+ {
61
+ test: /\.js$/,
62
+ use: "babel-loader",
63
+ },
64
+ //scss
65
+ {
66
+ test: /\.scss$/,
67
+ sideEffects: true,
68
+ use: [
69
+ MiniCssExtractPlugin.loader,
70
+ // "style-loader",
71
+ {
72
+ loader: "css-loader",
73
+ options: {
74
+ importLoaders: 5,
75
+ url: true, // Ensure CSS loader handles URL() paths
76
+ },
77
+ },
78
+
79
+ {
80
+ loader: "postcss-loader",
81
+ options: {
82
+ postcssOptions: {
83
+ plugins: [require("autoprefixer"), require("cssnano")],
84
+ },
85
+ },
86
+ },
87
+ {
88
+ loader: "sass-loader",
89
+ },
90
+ ],
91
+ },
92
+ //images
93
+ {
94
+ test: /\.(png|svg|jpg|jpeg|gif|webp)$/i,
95
+ type: "asset/resource",
96
+ generator: {
97
+ filename: "img/[name][ext][query]",
98
+ },
99
+ },
100
+ //fonts
101
+ {
102
+ test: /\.(woff|woff2|eot|ttf|otf)$/i,
103
+ type: "asset/resource",
104
+ generator: {
105
+ filename: "fonts/[name][ext][query]",
106
+ },
107
+ },
108
+ ],
109
+ },
110
+
111
+ devServer: {
112
+ static: "./public",
113
+ historyApiFallback: true,
114
+ },
115
+ plugins: [
116
+ new MiniCssExtractPlugin({
117
+ // Options similar to the same options in webpackOptions.output
118
+ // both options are optional
119
+ filename: "css/style.css",
120
+ chunkFilename: "css/[name].css",
121
+ }),
122
+ new PurgeCSSPlugin({
123
+ paths: glob.sync(`${PATHS.src}/**/*`, { nodir: true }),
124
+ whitelistPatterns: [/sm:/, /md:/, /lg:/, /xl:/, /2xl:/, /bg-/, /text-/],
125
+ defaultExtractor: (content) => content.match(/[\w-/:.!]+(?<!:)/g) || [],
126
+ }),
127
+ ],
128
+ resolve: {
129
+ extensions: [
130
+ ".js",
131
+ ".jsx",
132
+ ".tsx",
133
+ ".ts",
134
+ ".html",
135
+ ".scss",
136
+ ".css",
137
+ ".ttf",
138
+ ],
139
+ },
140
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@linkdlab/funcnodes_react_flow",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "dependencies": {
5
5
  "@emotion/react": "^11.11.3",
6
6
  "@emotion/styled": "^11.11.0",
@@ -28,7 +28,7 @@
28
28
  "react-plotly.js": "^2.6.0",
29
29
  "react-scripts": "5.0.1",
30
30
  "reactflow": "^11.10.3",
31
- "sass": "^1.70.0",
31
+ "sass": "^1.75.0",
32
32
  "scss": "^0.2.4",
33
33
  "typescript": "^4.4.2",
34
34
  "uuid": "^9.0.1",
@@ -39,7 +39,10 @@
39
39
  "start": "react-scripts start",
40
40
  "build": "react-scripts build",
41
41
  "test": "react-scripts test",
42
- "eject": "react-scripts eject"
42
+ "eject": "react-scripts eject",
43
+ "buildmod": "tsc -p tsconfig.esm.json",
44
+ "webpack": "cd app && webpack",
45
+ "serve": "cd app && webpack serve --mode=development"
43
46
  },
44
47
  "eslintConfig": {
45
48
  "extends": [
@@ -60,8 +63,27 @@
60
63
  ]
61
64
  },
62
65
  "description": "This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).",
63
- "main": "index.js",
64
- "devDependencies": {},
66
+ "main": "module/src/index.tsx",
67
+ "devDependencies": {
68
+ "@rollup/plugin-node-resolve": "^15.2.3",
69
+ "autoprefixer": "^10.4.19",
70
+ "babel-loader": "^9.1.3",
71
+ "css-loader": "^7.1.1",
72
+ "cssnano": "^6.1.2",
73
+ "html-webpack-plugin": "^5.6.0",
74
+ "mini-css-extract-plugin": "^2.9.0",
75
+ "postcss": "^8.4.38",
76
+ "postcss-loader": "^8.1.1",
77
+ "purgecss-webpack-plugin": "^6.0.0",
78
+ "rollup": "^4.16.3",
79
+ "rollup-plugin-import-css": "^3.5.0",
80
+ "rollup-plugin-scss": "^4.0.0",
81
+ "rollup-plugin-typescript2": "^0.36.0",
82
+ "sass-loader": "^14.2.1",
83
+ "ts-loader": "^9.5.1",
84
+ "webpack": "^5.91.0",
85
+ "webpack-cli": "^5.1.4"
86
+ },
65
87
  "repository": {
66
88
  "type": "git",
67
89
  "url": "git+https://github.com/Linkdlab/FuncNodesReact.git"
package/tsconfig.json CHANGED
@@ -9,12 +9,10 @@
9
9
  "strict": true,
10
10
  "forceConsistentCasingInFileNames": true,
11
11
  "noFallthroughCasesInSwitch": true,
12
- "module": "esnext",
13
12
  "moduleResolution": "node",
14
13
  "resolveJsonModule": true,
15
14
  "isolatedModules": true,
16
- "noEmit": true,
17
- "jsx": "react-jsx"
15
+ "jsx": "react-jsx",
18
16
  },
19
17
  "include": ["./src/**/*"]
20
18
  }
@@ -1,63 +0,0 @@
1
- {
2
- "name": "funcnodes_react_flow",
3
- "version": "0.1.0",
4
- "private": true,
5
- "dependencies": {
6
- "@emotion/react": "^11.11.3",
7
- "@emotion/styled": "^11.11.0",
8
- "@mui/icons-material": "^5.15.10",
9
- "@mui/material": "^5.15.10",
10
- "@radix-ui/react-dialog": "^1.0.5",
11
- "@radix-ui/react-popover": "^1.0.7",
12
- "@radix-ui/react-tooltip": "^1.0.7",
13
- "@testing-library/jest-dom": "^5.14.1",
14
- "@testing-library/react": "^13.0.0",
15
- "@testing-library/user-event": "^13.2.1",
16
- "@types/color-convert": "^2.0.3",
17
- "@types/jest": "^27.0.1",
18
- "@types/node": "^16.7.13",
19
- "@types/plotly.js": "^2.29.1",
20
- "@types/react": "^18.0.0",
21
- "@types/react-dom": "^18.0.0",
22
- "@types/react-plotly.js": "^2.6.3",
23
- "@types/uuid": "^9.0.8",
24
- "color-convert": "^2.0.1",
25
- "plotly.js": "^2.29.1",
26
- "react": "^18.2.0",
27
- "react-dom": "^18.2.0",
28
- "react-json-view-lite": "^1.3.0",
29
- "react-plotly.js": "^2.6.0",
30
- "react-scripts": "5.0.1",
31
- "reactflow": "^11.10.3",
32
- "sass": "^1.70.0",
33
- "scss": "^0.2.4",
34
- "typescript": "^4.4.2",
35
- "uuid": "^9.0.1",
36
- "web-vitals": "^2.1.0",
37
- "zustand": "^4.5.0"
38
- },
39
- "scripts": {
40
- "start": "react-scripts start",
41
- "build": "react-scripts build",
42
- "test": "react-scripts test",
43
- "eject": "react-scripts eject"
44
- },
45
- "eslintConfig": {
46
- "extends": [
47
- "react-app",
48
- "react-app/jest"
49
- ]
50
- },
51
- "browserslist": {
52
- "production": [
53
- ">0.2%",
54
- "not dead",
55
- "not op_mini all"
56
- ],
57
- "development": [
58
- "last 1 chrome version",
59
- "last 1 firefox version",
60
- "last 1 safari version"
61
- ]
62
- }
63
- }
@@ -1,18 +0,0 @@
1
- .context-menu {
2
- background: white;
3
- border-style: solid;
4
- box-shadow: 10px 19px 20px rgba(0, 0, 0, 10%);
5
- position: absolute;
6
- }
7
-
8
- .context-menu button {
9
- border: none;
10
- display: block;
11
- padding: 0.5em;
12
- text-align: left;
13
- width: 100%;
14
- }
15
-
16
- .context-menu button:hover {
17
- background: white;
18
- }
package/src/logo.svg DELETED
@@ -1 +0,0 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 841.9 595.3"><g fill="#61DAFB"><path d="M666.3 296.5c0-32.5-40.7-63.3-103.1-82.4 14.4-63.6 8-114.2-20.2-130.4-6.5-3.8-14.1-5.6-22.4-5.6v22.3c4.6 0 8.3.9 11.4 2.6 13.6 7.8 19.5 37.5 14.9 75.7-1.1 9.4-2.9 19.3-5.1 29.4-19.6-4.8-41-8.5-63.5-10.9-13.5-18.5-27.5-35.3-41.6-50 32.6-30.3 63.2-46.9 84-46.9V78c-27.5 0-63.5 19.6-99.9 53.6-36.4-33.8-72.4-53.2-99.9-53.2v22.3c20.7 0 51.4 16.5 84 46.6-14 14.7-28 31.4-41.3 49.9-22.6 2.4-44 6.1-63.6 11-2.3-10-4-19.7-5.2-29-4.7-38.2 1.1-67.9 14.6-75.8 3-1.8 6.9-2.6 11.5-2.6V78.5c-8.4 0-16 1.8-22.6 5.6-28.1 16.2-34.4 66.7-19.9 130.1-62.2 19.2-102.7 49.9-102.7 82.3 0 32.5 40.7 63.3 103.1 82.4-14.4 63.6-8 114.2 20.2 130.4 6.5 3.8 14.1 5.6 22.5 5.6 27.5 0 63.5-19.6 99.9-53.6 36.4 33.8 72.4 53.2 99.9 53.2 8.4 0 16-1.8 22.6-5.6 28.1-16.2 34.4-66.7 19.9-130.1 62-19.1 102.5-49.9 102.5-82.3zm-130.2-66.7c-3.7 12.9-8.3 26.2-13.5 39.5-4.1-8-8.4-16-13.1-24-4.6-8-9.5-15.8-14.4-23.4 14.2 2.1 27.9 4.7 41 7.9zm-45.8 106.5c-7.8 13.5-15.8 26.3-24.1 38.2-14.9 1.3-30 2-45.2 2-15.1 0-30.2-.7-45-1.9-8.3-11.9-16.4-24.6-24.2-38-7.6-13.1-14.5-26.4-20.8-39.8 6.2-13.4 13.2-26.8 20.7-39.9 7.8-13.5 15.8-26.3 24.1-38.2 14.9-1.3 30-2 45.2-2 15.1 0 30.2.7 45 1.9 8.3 11.9 16.4 24.6 24.2 38 7.6 13.1 14.5 26.4 20.8 39.8-6.3 13.4-13.2 26.8-20.7 39.9zm32.3-13c5.4 13.4 10 26.8 13.8 39.8-13.1 3.2-26.9 5.9-41.2 8 4.9-7.7 9.8-15.6 14.4-23.7 4.6-8 8.9-16.1 13-24.1zM421.2 430c-9.3-9.6-18.6-20.3-27.8-32 9 .4 18.2.7 27.5.7 9.4 0 18.7-.2 27.8-.7-9 11.7-18.3 22.4-27.5 32zm-74.4-58.9c-14.2-2.1-27.9-4.7-41-7.9 3.7-12.9 8.3-26.2 13.5-39.5 4.1 8 8.4 16 13.1 24 4.7 8 9.5 15.8 14.4 23.4zM420.7 163c9.3 9.6 18.6 20.3 27.8 32-9-.4-18.2-.7-27.5-.7-9.4 0-18.7.2-27.8.7 9-11.7 18.3-22.4 27.5-32zm-74 58.9c-4.9 7.7-9.8 15.6-14.4 23.7-4.6 8-8.9 16-13 24-5.4-13.4-10-26.8-13.8-39.8 13.1-3.1 26.9-5.8 41.2-7.9zm-90.5 125.2c-35.4-15.1-58.3-34.9-58.3-50.6 0-15.7 22.9-35.6 58.3-50.6 8.6-3.7 18-7 27.7-10.1 5.7 19.6 13.2 40 22.5 60.9-9.2 20.8-16.6 41.1-22.2 60.6-9.9-3.1-19.3-6.5-28-10.2zM310 490c-13.6-7.8-19.5-37.5-14.9-75.7 1.1-9.4 2.9-19.3 5.1-29.4 19.6 4.8 41 8.5 63.5 10.9 13.5 18.5 27.5 35.3 41.6 50-32.6 30.3-63.2 46.9-84 46.9-4.5-.1-8.3-1-11.3-2.7zm237.2-76.2c4.7 38.2-1.1 67.9-14.6 75.8-3 1.8-6.9 2.6-11.5 2.6-20.7 0-51.4-16.5-84-46.6 14-14.7 28-31.4 41.3-49.9 22.6-2.4 44-6.1 63.6-11 2.3 10.1 4.1 19.8 5.2 29.1zm38.5-66.7c-8.6 3.7-18 7-27.7 10.1-5.7-19.6-13.2-40-22.5-60.9 9.2-20.8 16.6-41.1 22.2-60.6 9.9 3.1 19.3 6.5 28.1 10.2 35.4 15.1 58.3 34.9 58.3 50.6-.1 15.7-23 35.6-58.4 50.6zM320.8 78.4z"/><circle cx="420.9" cy="296.5" r="45.7"/><path d="M520.5 78.1z"/></g></svg>
package/src/state/lib.ts DELETED
@@ -1,26 +0,0 @@
1
- import { useStore, create, UseBoundStore, StoreApi } from "zustand";
2
-
3
- interface LibState {
4
- state: LibType;
5
- set: (state: LibType) => void;
6
- get: () => LibType;
7
- }
8
-
9
- interface LibZustandInterface {
10
- libstate: UseBoundStore<StoreApi<LibState>>;
11
- }
12
-
13
- const LibZustand = (): LibZustandInterface => {
14
- return {
15
- libstate: create<LibState>((set, get) => ({
16
- state: {
17
- shelves: [],
18
- },
19
- set: (state: LibType) => set({ state: state }),
20
- get: () => get().state,
21
- })),
22
- };
23
- };
24
-
25
- export default LibZustand;
26
- export type { LibZustandInterface, LibState };
@@ -1,16 +0,0 @@
1
- type LibNode = {
2
- node_id: string;
3
- description?: string;
4
- node_name?: string;
5
- };
6
-
7
- type Shelf = {
8
- name: string;
9
- description?: string;
10
- nodes: LibNode[];
11
- subshelves: Shelf[];
12
- };
13
-
14
- type LibType = {
15
- shelves: Shelf[];
16
- };
@@ -1,29 +0,0 @@
1
- type RenderType = "string" | "number" | "boolean" | "image";
2
-
3
- interface DataRenderOptions extends BaseRenderOptions {
4
- src?: string;
5
- type?: RenderType;
6
- preview_type?: string;
7
- }
8
-
9
- interface NodeRenderOptions {
10
- data?: DataRenderOptions;
11
- }
12
-
13
- interface NodeType {
14
- id: string;
15
- node_name: string;
16
- io: { [key: string]: IOType };
17
- frontend: {
18
- pos: [number, number];
19
- size: [number, number];
20
- collapsed: boolean;
21
- };
22
- name: string;
23
- in_trigger: boolean;
24
- error?: string;
25
- render_options?: NodeRenderOptions;
26
- io_order: string[];
27
- }
28
-
29
- type PartialNodeType = DeepPartial<NodeType>;
@@ -1,56 +0,0 @@
1
- interface RenderOptions {
2
- typemap?: { [key: string]: string };
3
- inputconverter?: { [key: string]: string };
4
- }
5
- interface ViewState {
6
- nodes: { [key: string]: NodeViewState };
7
- renderoptions?: RenderOptions;
8
- }
9
-
10
- interface FullNodeSpaceJSON {
11
- nodes: NodeType[];
12
- edges: [str, str, str, str][];
13
- prop: { [key: string]: any };
14
- lib: LibType;
15
- }
16
-
17
- interface FullState {
18
- backend: FullNodeSpaceJSON;
19
- view: ViewState;
20
- worker: { [key: string]: string[] };
21
- }
22
-
23
- interface ProgressState {
24
- message: string;
25
- status: string;
26
- progress: number;
27
- blocking: boolean;
28
- }
29
-
30
- interface ProgressStateMessage extends ProgressState {
31
- type: "progress";
32
- }
33
-
34
- interface ResultMessage {
35
- type: "result";
36
- id?: string;
37
- result: any;
38
- }
39
-
40
- interface ErrorMessage {
41
- type: "error";
42
- error: string;
43
- tb: string[];
44
- id?: string;
45
- }
46
-
47
- interface NodeSpaceEvent {
48
- type: "nsevent";
49
- event: string;
50
- data: { [key: string]: any };
51
- }
52
- type JSONMessage =
53
- | ProgressStateMessage
54
- | ResultMessage
55
- | ErrorMessage
56
- | NodeSpaceEvent;
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes