From 3d45a48232b60fe7f735424d13ff03030054908e Mon Sep 17 00:00:00 2001 From: Ben Houston Date: Tue, 25 Jul 2023 22:20:48 -0400 Subject: [PATCH] registry is a flow prop now. --- apps/graph-editor/package.json | 1 + apps/graph-editor/src/components/MyFlow.tsx | 28 ++ .../graph-editor}/src/hooks/useRegistry.ts | 0 apps/graph-editor/src/index.tsx | 23 +- package-lock.json | 337 ++++++++++-------- packages/core/src/Execution/Engine.ts | 2 +- packages/flow/package.json | 1 - packages/flow/src/components/Flow.tsx | 7 +- packages/flow/src/index.ts | 1 - packages/flow/src/util/customNodeTypes.tsx | 12 - packages/flow/src/util/getNodeSpecJSON.ts | 7 - 11 files changed, 223 insertions(+), 196 deletions(-) create mode 100644 apps/graph-editor/src/components/MyFlow.tsx rename {packages/flow => apps/graph-editor}/src/hooks/useRegistry.ts (100%) delete mode 100644 packages/flow/src/util/customNodeTypes.tsx delete mode 100644 packages/flow/src/util/getNodeSpecJSON.ts diff --git a/apps/graph-editor/package.json b/apps/graph-editor/package.json index 67f0e694..f47eeca4 100644 --- a/apps/graph-editor/package.json +++ b/apps/graph-editor/package.json @@ -8,6 +8,7 @@ }, "dependencies": { "@behave-graph/core": "*", + "@behave-graph/scene": "*", "@behave-graph/flow": "*", "three": "0.152.2", "three-stdlib": "^2.22.4" diff --git a/apps/graph-editor/src/components/MyFlow.tsx b/apps/graph-editor/src/components/MyFlow.tsx new file mode 100644 index 00000000..ae3f3cd6 --- /dev/null +++ b/apps/graph-editor/src/components/MyFlow.tsx @@ -0,0 +1,28 @@ +import React from 'react'; +import Branch from '../../../../graphs/core/flow/Branch.json'; +import HelloWorld from '../../../../graphs/core/HelloWorld.json'; +import Polynomial from '../../../../graphs/core/logic/Polynomial.json'; +import Delay from '../../../../graphs/core/time/Delay.json'; +import SetGet from '../../../../graphs/core/variables/SetGet.json'; +import rawGraph from '../graph.json'; +import { GraphJSON } from '@behave-graph/core'; +import { Examples, Flow } from '@behave-graph/flow'; +import { useRegistry } from '../hooks/useRegistry.js'; + +const graph = rawGraph as unknown as GraphJSON; + +// TODO remove when json types fixed in behave-graph +const examples: Examples = { + branch: Branch as unknown as GraphJSON, + delay: Delay as unknown as GraphJSON, + helloWorld: HelloWorld as unknown as GraphJSON, + polynomial: Polynomial as unknown as GraphJSON, + setGet: SetGet as unknown as GraphJSON +} as Record; + +const MyFlow: React.FC = () => { + const registry = useRegistry(); + return ; +}; + +export default MyFlow; diff --git a/packages/flow/src/hooks/useRegistry.ts b/apps/graph-editor/src/hooks/useRegistry.ts similarity index 100% rename from packages/flow/src/hooks/useRegistry.ts rename to apps/graph-editor/src/hooks/useRegistry.ts diff --git a/apps/graph-editor/src/index.tsx b/apps/graph-editor/src/index.tsx index 9c430e37..6d74db1e 100644 --- a/apps/graph-editor/src/index.tsx +++ b/apps/graph-editor/src/index.tsx @@ -1,35 +1,16 @@ import 'reactflow/dist/style.css'; import './styles.css'; -import { GraphJSON } from '@behave-graph/core'; -import { Examples, Flow } from '@behave-graph/flow'; import React from 'react'; import ReactDOM from 'react-dom/client'; - -import Branch from '../../../graphs/core/flow/Branch.json'; -import HelloWorld from '../../../graphs/core/HelloWorld.json'; -import Polynomial from '../../../graphs/core/logic/Polynomial.json'; -import Delay from '../../../graphs/core/time/Delay.json'; -import SetGet from '../../../graphs/core/variables/SetGet.json'; -import rawGraph from './graph.json'; - -const graph = rawGraph as unknown as GraphJSON; +import MyFlow from './components/MyFlow.js'; const root = ReactDOM.createRoot( document.getElementById('root') as HTMLElement ); -// TODO remove when json types fixed in behave-graph -const examples: Examples = { - branch: Branch as unknown as GraphJSON, - delay: Delay as unknown as GraphJSON, - helloWorld: HelloWorld as unknown as GraphJSON, - polynomial: Polynomial as unknown as GraphJSON, - setGet: SetGet as unknown as GraphJSON -} as Record; - root.render( - + ); diff --git a/package-lock.json b/package-lock.json index 9b5917b7..fbf7a35b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -86,6 +86,7 @@ "dependencies": { "@behave-graph/core": "*", "@behave-graph/flow": "*", + "@behave-graph/scene": "*", "three": "0.152.2", "three-stdlib": "^2.22.4" }, @@ -966,9 +967,9 @@ } }, "node_modules/@esbuild/android-arm": { - "version": "0.18.14", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.18.14.tgz", - "integrity": "sha512-blODaaL+lngG5bdK/t4qZcQvq2BBqrABmYwqPPcS5VRxrCSGHb9R/rA3fqxh7R18I7WU4KKv+NYkt22FDfalcg==", + "version": "0.18.17", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.18.17.tgz", + "integrity": "sha512-wHsmJG/dnL3OkpAcwbgoBTTMHVi4Uyou3F5mf58ZtmUyIKfcdA7TROav/6tCzET4A3QW2Q2FC+eFneMU+iyOxg==", "cpu": [ "arm" ], @@ -982,9 +983,9 @@ } }, "node_modules/@esbuild/android-arm64": { - "version": "0.18.14", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.18.14.tgz", - "integrity": "sha512-rZ2v+Luba5/3D6l8kofWgTnqE+qsC/L5MleKIKFyllHTKHrNBMqeRCnZI1BtRx8B24xMYxeU32iIddRQqMsOsg==", + "version": "0.18.17", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.18.17.tgz", + "integrity": "sha512-9np+YYdNDed5+Jgr1TdWBsozZ85U1Oa3xW0c7TWqH0y2aGghXtZsuT8nYRbzOMcl0bXZXjOGbksoTtVOlWrRZg==", "cpu": [ "arm64" ], @@ -998,9 +999,9 @@ } }, "node_modules/@esbuild/android-x64": { - "version": "0.18.14", - "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.18.14.tgz", - "integrity": "sha512-qSwh8y38QKl+1Iqg+YhvCVYlSk3dVLk9N88VO71U4FUjtiSFylMWK3Ugr8GC6eTkkP4Tc83dVppt2n8vIdlSGg==", + "version": "0.18.17", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.18.17.tgz", + "integrity": "sha512-O+FeWB/+xya0aLg23hHEM2E3hbfwZzjqumKMSIqcHbNvDa+dza2D0yLuymRBQQnC34CWrsJUXyH2MG5VnLd6uw==", "cpu": [ "x64" ], @@ -1014,9 +1015,9 @@ } }, "node_modules/@esbuild/darwin-arm64": { - "version": "0.18.14", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.18.14.tgz", - "integrity": "sha512-9Hl2D2PBeDYZiNbnRKRWuxwHa9v5ssWBBjisXFkVcSP5cZqzZRFBUWEQuqBHO4+PKx4q4wgHoWtfQ1S7rUqJ2Q==", + "version": "0.18.17", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.18.17.tgz", + "integrity": "sha512-M9uJ9VSB1oli2BE/dJs3zVr9kcCBBsE883prage1NWz6pBS++1oNn/7soPNS3+1DGj0FrkSvnED4Bmlu1VAE9g==", "cpu": [ "arm64" ], @@ -1030,9 +1031,9 @@ } }, "node_modules/@esbuild/darwin-x64": { - "version": "0.18.14", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.18.14.tgz", - "integrity": "sha512-ZnI3Dg4ElQ6tlv82qLc/UNHtFsgZSKZ7KjsUNAo1BF1SoYDjkGKHJyCrYyWjFecmXpvvG/KJ9A/oe0H12odPLQ==", + "version": "0.18.17", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.18.17.tgz", + "integrity": "sha512-XDre+J5YeIJDMfp3n0279DFNrGCXlxOuGsWIkRb1NThMZ0BsrWXoTg23Jer7fEXQ9Ye5QjrvXpxnhzl3bHtk0g==", "cpu": [ "x64" ], @@ -1046,9 +1047,9 @@ } }, "node_modules/@esbuild/freebsd-arm64": { - "version": "0.18.14", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.18.14.tgz", - "integrity": "sha512-h3OqR80Da4oQCIa37zl8tU5MwHQ7qgPV0oVScPfKJK21fSRZEhLE4IIVpmcOxfAVmqjU6NDxcxhYaM8aDIGRLw==", + "version": "0.18.17", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.18.17.tgz", + "integrity": "sha512-cjTzGa3QlNfERa0+ptykyxs5A6FEUQQF0MuilYXYBGdBxD3vxJcKnzDlhDCa1VAJCmAxed6mYhA2KaJIbtiNuQ==", "cpu": [ "arm64" ], @@ -1062,9 +1063,9 @@ } }, "node_modules/@esbuild/freebsd-x64": { - "version": "0.18.14", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.18.14.tgz", - "integrity": "sha512-ha4BX+S6CZG4BoH9tOZTrFIYC1DH13UTCRHzFc3GWX74nz3h/N6MPF3tuR3XlsNjMFUazGgm35MPW5tHkn2lzQ==", + "version": "0.18.17", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.18.17.tgz", + "integrity": "sha512-sOxEvR8d7V7Kw8QqzxWc7bFfnWnGdaFBut1dRUYtu+EIRXefBc/eIsiUiShnW0hM3FmQ5Zf27suDuHsKgZ5QrA==", "cpu": [ "x64" ], @@ -1078,9 +1079,9 @@ } }, "node_modules/@esbuild/linux-arm": { - "version": "0.18.14", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.18.14.tgz", - "integrity": "sha512-5+7vehI1iqru5WRtJyU2XvTOvTGURw3OZxe3YTdE9muNNIdmKAVmSHpB3Vw2LazJk2ifEdIMt/wTWnVe5V98Kg==", + "version": "0.18.17", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.18.17.tgz", + "integrity": "sha512-2d3Lw6wkwgSLC2fIvXKoMNGVaeY8qdN0IC3rfuVxJp89CRfA3e3VqWifGDfuakPmp90+ZirmTfye1n4ncjv2lg==", "cpu": [ "arm" ], @@ -1094,9 +1095,9 @@ } }, "node_modules/@esbuild/linux-arm64": { - "version": "0.18.14", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.18.14.tgz", - "integrity": "sha512-IXORRe22In7U65NZCzjwAUc03nn8SDIzWCnfzJ6t/8AvGx5zBkcLfknI+0P+hhuftufJBmIXxdSTbzWc8X/V4w==", + "version": "0.18.17", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.18.17.tgz", + "integrity": "sha512-c9w3tE7qA3CYWjT+M3BMbwMt+0JYOp3vCMKgVBrCl1nwjAlOMYzEo+gG7QaZ9AtqZFj5MbUc885wuBBmu6aADQ==", "cpu": [ "arm64" ], @@ -1110,9 +1111,9 @@ } }, "node_modules/@esbuild/linux-ia32": { - "version": "0.18.14", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.18.14.tgz", - "integrity": "sha512-BfHlMa0nibwpjG+VXbOoqJDmFde4UK2gnW351SQ2Zd4t1N3zNdmUEqRkw/srC1Sa1DRBE88Dbwg4JgWCbNz/FQ==", + "version": "0.18.17", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.18.17.tgz", + "integrity": "sha512-1DS9F966pn5pPnqXYz16dQqWIB0dmDfAQZd6jSSpiT9eX1NzKh07J6VKR3AoXXXEk6CqZMojiVDSZi1SlmKVdg==", "cpu": [ "ia32" ], @@ -1126,9 +1127,9 @@ } }, "node_modules/@esbuild/linux-loong64": { - "version": "0.18.14", - "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.18.14.tgz", - "integrity": "sha512-j2/Ex++DRUWIAaUDprXd3JevzGtZ4/d7VKz+AYDoHZ3HjJzCyYBub9CU1wwIXN+viOP0b4VR3RhGClsvyt/xSw==", + "version": "0.18.17", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.18.17.tgz", + "integrity": "sha512-EvLsxCk6ZF0fpCB6w6eOI2Fc8KW5N6sHlIovNe8uOFObL2O+Mr0bflPHyHwLT6rwMg9r77WOAWb2FqCQrVnwFg==", "cpu": [ "loong64" ], @@ -1142,9 +1143,9 @@ } }, "node_modules/@esbuild/linux-mips64el": { - "version": "0.18.14", - "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.18.14.tgz", - "integrity": "sha512-qn2+nc+ZCrJmiicoAnJXJJkZWt8Nwswgu1crY7N+PBR8ChBHh89XRxj38UU6Dkthl2yCVO9jWuafZ24muzDC/A==", + "version": "0.18.17", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.18.17.tgz", + "integrity": "sha512-e0bIdHA5p6l+lwqTE36NAW5hHtw2tNRmHlGBygZC14QObsA3bD4C6sXLJjvnDIjSKhW1/0S3eDy+QmX/uZWEYQ==", "cpu": [ "mips64el" ], @@ -1158,9 +1159,9 @@ } }, "node_modules/@esbuild/linux-ppc64": { - "version": "0.18.14", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.18.14.tgz", - "integrity": "sha512-aGzXzd+djqeEC5IRkDKt3kWzvXoXC6K6GyYKxd+wsFJ2VQYnOWE954qV2tvy5/aaNrmgPTb52cSCHFE+Z7Z0yg==", + "version": "0.18.17", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.18.17.tgz", + "integrity": "sha512-BAAilJ0M5O2uMxHYGjFKn4nJKF6fNCdP1E0o5t5fvMYYzeIqy2JdAP88Az5LHt9qBoUa4tDaRpfWt21ep5/WqQ==", "cpu": [ "ppc64" ], @@ -1174,9 +1175,9 @@ } }, "node_modules/@esbuild/linux-riscv64": { - "version": "0.18.14", - "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.18.14.tgz", - "integrity": "sha512-8C6vWbfr0ygbAiMFLS6OPz0BHvApkT2gCboOGV76YrYw+sD/MQJzyITNsjZWDXJwPu9tjrFQOVG7zijRzBCnLw==", + "version": "0.18.17", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.18.17.tgz", + "integrity": "sha512-Wh/HW2MPnC3b8BqRSIme/9Zhab36PPH+3zam5pqGRH4pE+4xTrVLx2+XdGp6fVS3L2x+DrsIcsbMleex8fbE6g==", "cpu": [ "riscv64" ], @@ -1190,9 +1191,9 @@ } }, "node_modules/@esbuild/linux-s390x": { - "version": "0.18.14", - "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.18.14.tgz", - "integrity": "sha512-G/Lf9iu8sRMM60OVGOh94ZW2nIStksEcITkXdkD09/T6QFD/o+g0+9WVyR/jajIb3A0LvBJ670tBnGe1GgXMgw==", + "version": "0.18.17", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.18.17.tgz", + "integrity": "sha512-j/34jAl3ul3PNcK3pfI0NSlBANduT2UO5kZ7FCaK33XFv3chDhICLY8wJJWIhiQ+YNdQ9dxqQctRg2bvrMlYgg==", "cpu": [ "s390x" ], @@ -1206,9 +1207,9 @@ } }, "node_modules/@esbuild/linux-x64": { - "version": "0.18.14", - "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.18.14.tgz", - "integrity": "sha512-TBgStYBQaa3EGhgqIDM+ECnkreb0wkcKqL7H6m+XPcGUoU4dO7dqewfbm0mWEQYH3kzFHrzjOFNpSAVzDZRSJw==", + "version": "0.18.17", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.18.17.tgz", + "integrity": "sha512-QM50vJ/y+8I60qEmFxMoxIx4de03pGo2HwxdBeFd4nMh364X6TIBZ6VQ5UQmPbQWUVWHWws5MmJXlHAXvJEmpQ==", "cpu": [ "x64" ], @@ -1222,9 +1223,9 @@ } }, "node_modules/@esbuild/netbsd-x64": { - "version": "0.18.14", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.18.14.tgz", - "integrity": "sha512-stvCcjyCQR2lMTroqNhAbvROqRjxPEq0oQ380YdXxA81TaRJEucH/PzJ/qsEtsHgXlWFW6Ryr/X15vxQiyRXVg==", + "version": "0.18.17", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.18.17.tgz", + "integrity": "sha512-/jGlhWR7Sj9JPZHzXyyMZ1RFMkNPjC6QIAan0sDOtIo2TYk3tZn5UDrkE0XgsTQCxWTTOcMPf9p6Rh2hXtl5TQ==", "cpu": [ "x64" ], @@ -1238,9 +1239,9 @@ } }, "node_modules/@esbuild/openbsd-x64": { - "version": "0.18.14", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.18.14.tgz", - "integrity": "sha512-apAOJF14CIsN5ht1PA57PboEMsNV70j3FUdxLmA2liZ20gEQnfTG5QU0FhENo5nwbTqCB2O3WDsXAihfODjHYw==", + "version": "0.18.17", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.18.17.tgz", + "integrity": "sha512-rSEeYaGgyGGf4qZM2NonMhMOP/5EHp4u9ehFiBrg7stH6BYEEjlkVREuDEcQ0LfIl53OXLxNbfuIj7mr5m29TA==", "cpu": [ "x64" ], @@ -1254,9 +1255,9 @@ } }, "node_modules/@esbuild/sunos-x64": { - "version": "0.18.14", - "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.18.14.tgz", - "integrity": "sha512-fYRaaS8mDgZcGybPn2MQbn1ZNZx+UXFSUoS5Hd2oEnlsyUcr/l3c6RnXf1bLDRKKdLRSabTmyCy7VLQ7VhGdOQ==", + "version": "0.18.17", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.18.17.tgz", + "integrity": "sha512-Y7ZBbkLqlSgn4+zot4KUNYst0bFoO68tRgI6mY2FIM+b7ZbyNVtNbDP5y8qlu4/knZZ73fgJDlXID+ohY5zt5g==", "cpu": [ "x64" ], @@ -1270,9 +1271,9 @@ } }, "node_modules/@esbuild/win32-arm64": { - "version": "0.18.14", - "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.18.14.tgz", - "integrity": "sha512-1c44RcxKEJPrVj62XdmYhxXaU/V7auELCmnD+Ri+UCt+AGxTvzxl9uauQhrFso8gj6ZV1DaORV0sT9XSHOAk8Q==", + "version": "0.18.17", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.18.17.tgz", + "integrity": "sha512-bwPmTJsEQcbZk26oYpc4c/8PvTY3J5/QK8jM19DVlEsAB41M39aWovWoHtNm78sd6ip6prilxeHosPADXtEJFw==", "cpu": [ "arm64" ], @@ -1286,9 +1287,9 @@ } }, "node_modules/@esbuild/win32-ia32": { - "version": "0.18.14", - "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.18.14.tgz", - "integrity": "sha512-EXAFttrdAxZkFQmpvcAQ2bywlWUsONp/9c2lcfvPUhu8vXBBenCXpoq9YkUvVP639ld3YGiYx0YUQ6/VQz3Maw==", + "version": "0.18.17", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.18.17.tgz", + "integrity": "sha512-H/XaPtPKli2MhW+3CQueo6Ni3Avggi6hP/YvgkEe1aSaxw+AeO8MFjq8DlgfTd9Iz4Yih3QCZI6YLMoyccnPRg==", "cpu": [ "ia32" ], @@ -1302,9 +1303,9 @@ } }, "node_modules/@esbuild/win32-x64": { - "version": "0.18.14", - "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.18.14.tgz", - "integrity": "sha512-K0QjGbcskx+gY+qp3v4/940qg8JitpXbdxFhRDA1aYoNaPff88+aEwoq45aqJ+ogpxQxmU0ZTjgnrQD/w8iiUg==", + "version": "0.18.17", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.18.17.tgz", + "integrity": "sha512-fGEb8f2BSA3CW7riJVurug65ACLuQAzKq0SSqkY2b2yHHH0MzDfbLyKIGzHwOI/gkHcxM/leuSW6D5w/LMNitA==", "cpu": [ "x64" ], @@ -1333,9 +1334,9 @@ } }, "node_modules/@eslint-community/regexpp": { - "version": "4.5.1", - "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.5.1.tgz", - "integrity": "sha512-Z5ba73P98O1KUYCCJTUeVpja9RcGoMdncZ6T49FCUl2lN38JtCJ+3WgIDBv0AuY4WChU5PmtJmOCTlN6FZTFKQ==", + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.6.2.tgz", + "integrity": "sha512-pPTNuaAG3QMH+buKyBIGJs3g/S5y0caxw0ygM3YyE6yJFySwiGGSzA+mM3KJ8QQvzeLh3blwgSonkFjgQdxzMw==", "dev": true, "engines": { "node": "^12.0.0 || ^14.0.0 || >=16.0.0" @@ -2793,6 +2794,30 @@ "node": ">=10" } }, + "node_modules/@lerna/legacy-package-management/node_modules/make-dir": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", + "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", + "dev": true, + "dependencies": { + "semver": "^6.0.0" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@lerna/legacy-package-management/node_modules/make-dir/node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true, + "bin": { + "semver": "bin/semver.js" + } + }, "node_modules/@lerna/legacy-package-management/node_modules/minimatch": { "version": "3.0.5", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.5.tgz", @@ -5142,9 +5167,9 @@ "dev": true }, "node_modules/@types/node": { - "version": "18.16.19", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.16.19.tgz", - "integrity": "sha512-IXl7o+R9iti9eBW4Wg2hx1xQDig183jj7YLn8F7udNceyfkbn1ZxmzZXuak20gR40D7pIkIY1kYGx5VIGbaHKA==", + "version": "18.17.1", + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.17.1.tgz", + "integrity": "sha512-xlR1jahfizdplZYRU59JlUx9uzF1ARa8jbhM11ccpCJya8kvos5jwdm2ZAgxSCwOl0fq21svP18EVwPBXMQudw==", "dev": true }, "node_modules/@types/normalize-package-data": { @@ -5177,9 +5202,9 @@ "dev": true }, "node_modules/@types/react": { - "version": "18.2.15", - "resolved": "https://registry.npmjs.org/@types/react/-/react-18.2.15.tgz", - "integrity": "sha512-oEjE7TQt1fFTFSbf8kkNuc798ahTUzn3Le67/PWjE8MAfYAD/qB7O8hSTcromLFqHCt9bcdOg5GXMokzTjJ5SA==", + "version": "18.2.16", + "resolved": "https://registry.npmjs.org/@types/react/-/react-18.2.16.tgz", + "integrity": "sha512-LLFWr12ZhBJ4YVw7neWLe6Pk7Ey5R9OCydfuMsz1L8bZxzaawJj2p06Q8/EFEHDeTBQNFLF62X+CG7B2zIyu0Q==", "dev": true, "dependencies": { "@types/prop-types": "*", @@ -5221,9 +5246,9 @@ "dev": true }, "node_modules/@types/testing-library__jest-dom": { - "version": "5.14.8", - "resolved": "https://registry.npmjs.org/@types/testing-library__jest-dom/-/testing-library__jest-dom-5.14.8.tgz", - "integrity": "sha512-NRfJE9Cgpmu4fx716q9SYmU4jxxhYRU1BQo239Txt/9N3EC745XZX1Yl7h/SBIDlo1ANVOCRB4YDXjaQdoKCHQ==", + "version": "5.14.9", + "resolved": "https://registry.npmjs.org/@types/testing-library__jest-dom/-/testing-library__jest-dom-5.14.9.tgz", + "integrity": "sha512-FSYhIjFlfOpGSRyVoMBMuS3ws5ehFQODymf3vlI7U1K8c7PHwWwFY7VREfmsuzHSOnoKs/9/Y983ayOs7eRzqw==", "dev": true, "dependencies": { "@types/jest": "*" @@ -8146,9 +8171,9 @@ } }, "node_modules/electron-to-chromium": { - "version": "1.4.465", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.465.tgz", - "integrity": "sha512-XQcuHvEJRMU97UJ75e170mgcITZoz0lIyiaVjk6R+NMTJ8KBIvUHYd1779swgOppUlzxR+JsLpq59PumaXS1jQ==", + "version": "1.4.471", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.471.tgz", + "integrity": "sha512-GpmGRC1vTl60w/k6YpQ18pSiqnmr0j3un//5TV1idPi6aheNfkT1Ye71tMEabWyNDO6sBMgAR+95Eb0eUUr1tA==", "dev": true }, "node_modules/emittery": { @@ -8363,9 +8388,9 @@ } }, "node_modules/esbuild": { - "version": "0.18.14", - "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.18.14.tgz", - "integrity": "sha512-uNPj5oHPYmj+ZhSQeYQVFZ+hAlJZbAGOmmILWIqrGvPVlNLbyOvU5Bu6Woi8G8nskcx0vwY0iFoMPrzT86Ko+w==", + "version": "0.18.17", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.18.17.tgz", + "integrity": "sha512-1GJtYnUxsJreHYA0Y+iQz2UEykonY66HNWOb0yXYZi9/kNrORUEHVg87eQsCtqh59PEJ5YVZJO98JHznMJSWjg==", "dev": true, "hasInstallScript": true, "bin": { @@ -8375,28 +8400,28 @@ "node": ">=12" }, "optionalDependencies": { - "@esbuild/android-arm": "0.18.14", - "@esbuild/android-arm64": "0.18.14", - "@esbuild/android-x64": "0.18.14", - "@esbuild/darwin-arm64": "0.18.14", - "@esbuild/darwin-x64": "0.18.14", - "@esbuild/freebsd-arm64": "0.18.14", - "@esbuild/freebsd-x64": "0.18.14", - "@esbuild/linux-arm": "0.18.14", - "@esbuild/linux-arm64": "0.18.14", - "@esbuild/linux-ia32": "0.18.14", - "@esbuild/linux-loong64": "0.18.14", - "@esbuild/linux-mips64el": "0.18.14", - "@esbuild/linux-ppc64": "0.18.14", - "@esbuild/linux-riscv64": "0.18.14", - "@esbuild/linux-s390x": "0.18.14", - "@esbuild/linux-x64": "0.18.14", - "@esbuild/netbsd-x64": "0.18.14", - "@esbuild/openbsd-x64": "0.18.14", - "@esbuild/sunos-x64": "0.18.14", - "@esbuild/win32-arm64": "0.18.14", - "@esbuild/win32-ia32": "0.18.14", - "@esbuild/win32-x64": "0.18.14" + "@esbuild/android-arm": "0.18.17", + "@esbuild/android-arm64": "0.18.17", + "@esbuild/android-x64": "0.18.17", + "@esbuild/darwin-arm64": "0.18.17", + "@esbuild/darwin-x64": "0.18.17", + "@esbuild/freebsd-arm64": "0.18.17", + "@esbuild/freebsd-x64": "0.18.17", + "@esbuild/linux-arm": "0.18.17", + "@esbuild/linux-arm64": "0.18.17", + "@esbuild/linux-ia32": "0.18.17", + "@esbuild/linux-loong64": "0.18.17", + "@esbuild/linux-mips64el": "0.18.17", + "@esbuild/linux-ppc64": "0.18.17", + "@esbuild/linux-riscv64": "0.18.17", + "@esbuild/linux-s390x": "0.18.17", + "@esbuild/linux-x64": "0.18.17", + "@esbuild/netbsd-x64": "0.18.17", + "@esbuild/openbsd-x64": "0.18.17", + "@esbuild/sunos-x64": "0.18.17", + "@esbuild/win32-arm64": "0.18.17", + "@esbuild/win32-ia32": "0.18.17", + "@esbuild/win32-x64": "0.18.17" } }, "node_modules/escalade": { @@ -8622,9 +8647,9 @@ } }, "node_modules/eslint-plugin-react": { - "version": "7.32.2", - "resolved": "https://registry.npmjs.org/eslint-plugin-react/-/eslint-plugin-react-7.32.2.tgz", - "integrity": "sha512-t2fBMa+XzonrrNkyVirzKlvn5RXzzPwRHtMvLAtVZrt8oxgnTQaYbU6SXTOO1mwQgp1y5+toMSKInnzGr0Knqg==", + "version": "7.33.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-react/-/eslint-plugin-react-7.33.0.tgz", + "integrity": "sha512-qewL/8P34WkY8jAqdQxsiL82pDUeT7nhs8IsuXgfgnsEloKCT4miAV9N9kGtx7/KM9NH/NCGUE7Edt9iGxLXFw==", "dev": true, "dependencies": { "array-includes": "^3.1.6", @@ -8640,7 +8665,7 @@ "object.values": "^1.1.6", "prop-types": "^15.8.1", "resolve": "^2.0.0-next.4", - "semver": "^6.3.0", + "semver": "^6.3.1", "string.prototype.matchall": "^4.0.8" }, "engines": { @@ -9169,9 +9194,9 @@ "dev": true }, "node_modules/fast-glob": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.0.tgz", - "integrity": "sha512-ChDuvbOypPuNjO8yIDf36x7BlZX1smcUMTTcyoIjycexOxd6DFsKsg21qVBzEmr3G7fUKIRy2/psii+CIUt7FA==", + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.1.tgz", + "integrity": "sha512-kNFPyjhh5cKjrUltxs+wFx+ZkbRaxxmZ+X0ZU31SOsxCEtP9VPgtq2teZw1DebupL5GmDaNQ6yKMMVcM41iqDg==", "dev": true, "dependencies": { "@nodelib/fs.stat": "^2.0.2", @@ -11377,17 +11402,17 @@ } }, "node_modules/istanbul-lib-report": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.0.tgz", - "integrity": "sha512-wcdi+uAKzfiGT2abPpKZ0hSU1rGQjUQnLvtY5MpQ7QCTahD3VODhcu4wcfY1YtkGaDD5yuydOLINXsfbus9ROw==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.1.tgz", + "integrity": "sha512-GCfE1mtsHGOELCU8e/Z7YWzpmybrx/+dSTfLrvY8qRmaY6zXTKWn6WQIjaAFw069icm6GVMNkgu0NzI4iPZUNw==", "dev": true, "dependencies": { "istanbul-lib-coverage": "^3.0.0", - "make-dir": "^3.0.0", + "make-dir": "^4.0.0", "supports-color": "^7.1.0" }, "engines": { - "node": ">=8" + "node": ">=10" } }, "node_modules/istanbul-lib-report/node_modules/has-flag": { @@ -11426,9 +11451,9 @@ } }, "node_modules/istanbul-reports": { - "version": "3.1.5", - "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.1.5.tgz", - "integrity": "sha512-nUsEMa9pBt/NOHqbcbeJEgqIlY/K7rVWUX6Lql2orY5e9roQOthbR3vtY4zzf2orPELg80fnxxk9zUyPlgwD1w==", + "version": "3.1.6", + "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.1.6.tgz", + "integrity": "sha512-TLgnMkKg3iTDsQ9PbPTdpfAK2DzjF9mqUG7RMgcQl8oFjad8ob4laGxv5XV5U9MAfx8D6tSJiUyuAwzLicaxlg==", "dev": true, "dependencies": { "html-escaper": "^2.0.0", @@ -11439,9 +11464,9 @@ } }, "node_modules/jackspeak": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-2.2.1.tgz", - "integrity": "sha512-MXbxovZ/Pm42f6cDIDkl3xpwv1AGwObKwfmjs2nQePiy85tP3fatofl3FC1aBsOtP/6fq5SbtgHwWcMsLP+bDw==", + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-2.2.2.tgz", + "integrity": "sha512-mgNtVv4vUuaKA97yxUHoA3+FkuhtxkjdXEWOyB/N76fjy0FjezEt34oy3epBtvCvS+7DyKwqCFWx/oJLV5+kCg==", "dev": true, "dependencies": { "@isaacs/cliui": "^8.0.2" @@ -13642,6 +13667,30 @@ "graceful-fs": "^4.1.6" } }, + "node_modules/lerna/node_modules/make-dir": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", + "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", + "dev": true, + "dependencies": { + "semver": "^6.0.0" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/lerna/node_modules/make-dir/node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true, + "bin": { + "semver": "bin/semver.js" + } + }, "node_modules/lerna/node_modules/minimatch": { "version": "3.0.5", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.5.tgz", @@ -14322,29 +14371,20 @@ } }, "node_modules/make-dir": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", - "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-4.0.0.tgz", + "integrity": "sha512-hXdUTZYIVOt1Ex//jAQi+wTZZpUpwBj/0QsOzqegb3rGMMeJiSEu5xLHnYfBrRV4RH2+OCSOO95Is/7x1WJ4bw==", "dev": true, "dependencies": { - "semver": "^6.0.0" + "semver": "^7.5.3" }, "engines": { - "node": ">=8" + "node": ">=10" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/make-dir/node_modules/semver": { - "version": "6.3.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", - "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", - "dev": true, - "bin": { - "semver": "bin/semver.js" - } - }, "node_modules/make-error": { "version": "1.3.6", "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", @@ -16619,9 +16659,9 @@ } }, "node_modules/postcss": { - "version": "8.4.26", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.26.tgz", - "integrity": "sha512-jrXHFF8iTloAenySjM/ob3gSj7pCu0Ji49hnjqzsgSRa50hkWCKD0HQ+gMNJkW38jBI68MpAAg7ZWwHwX8NMMw==", + "version": "8.4.27", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.27.tgz", + "integrity": "sha512-gY/ACJtJPSmUFPDCHtX78+01fHa64FaU4zaaWfuh1MhGJISufJAH4cun6k/8fwsHYeK4UQmENQK+tRLCFJE8JQ==", "dev": true, "funding": [ { @@ -19246,9 +19286,9 @@ } }, "node_modules/tslib": { - "version": "2.6.0", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.0.tgz", - "integrity": "sha512-7At1WUettjcSRHXCyYtTselblcHl9PJFFVKiCAy/bY97+BPZXSQ2wbq0P9s8tK2G7dFQfNnlJnPAiArVBVBsfA==" + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.1.tgz", + "integrity": "sha512-t0hLfiEKfMUoqhG+U1oid7Pva4bbDPHYfJNiB7BiIjRkj1pyC++4N3huJfqY6aRH6VTB0rvtzQwjM4K6qpfOig==" }, "node_modules/tsutils": { "version": "3.21.0", @@ -19702,13 +19742,13 @@ } }, "node_modules/vite": { - "version": "4.4.4", - "resolved": "https://registry.npmjs.org/vite/-/vite-4.4.4.tgz", - "integrity": "sha512-4mvsTxjkveWrKDJI70QmelfVqTm+ihFAb6+xf4sjEU2TmUCTlVX87tmg/QooPEMQb/lM9qGHT99ebqPziEd3wg==", + "version": "4.4.7", + "resolved": "https://registry.npmjs.org/vite/-/vite-4.4.7.tgz", + "integrity": "sha512-6pYf9QJ1mHylfVh39HpuSfMPojPSKVxZvnclX1K1FyZ1PXDOcLBibdq5t1qxJSnL63ca8Wf4zts6mD8u8oc9Fw==", "dev": true, "dependencies": { "esbuild": "^0.18.10", - "postcss": "^8.4.25", + "postcss": "^8.4.26", "rollup": "^3.25.2" }, "bin": { @@ -20267,7 +20307,6 @@ "version": "0.9.12", "dependencies": { "@behave-graph/core": "*", - "@behave-graph/scene": "*", "@fortawesome/fontawesome-svg-core": "^6.1.2", "@fortawesome/free-solid-svg-icons": "^6.1.2", "@fortawesome/react-fontawesome": "^0.2.0", diff --git a/packages/core/src/Execution/Engine.ts b/packages/core/src/Execution/Engine.ts index dec70822..5e227fb7 100644 --- a/packages/core/src/Execution/Engine.ts +++ b/packages/core/src/Execution/Engine.ts @@ -1,5 +1,5 @@ /* eslint-disable space-in-parens */ - +// fdfdfd import { Assert } from '../Diagnostics/Assert.js'; import { EventEmitter } from '../Events/EventEmitter.js'; import { GraphNodes } from '../Graphs/Graph.js'; diff --git a/packages/flow/package.json b/packages/flow/package.json index 1677ed1e..c509cadd 100644 --- a/packages/flow/package.json +++ b/packages/flow/package.json @@ -20,7 +20,6 @@ }, "dependencies": { "@behave-graph/core": "*", - "@behave-graph/scene": "*", "@fortawesome/fontawesome-svg-core": "^6.1.2", "@fortawesome/free-solid-svg-icons": "^6.1.2", "@fortawesome/react-fontawesome": "^0.2.0", diff --git a/packages/flow/src/components/Flow.tsx b/packages/flow/src/components/Flow.tsx index 564dde9a..472ec4a0 100644 --- a/packages/flow/src/components/Flow.tsx +++ b/packages/flow/src/components/Flow.tsx @@ -1,4 +1,4 @@ -import { GraphJSON } from '@behave-graph/core'; +import { GraphJSON, IRegistry } from '@behave-graph/core'; import React from 'react'; import { Background, BackgroundVariant, ReactFlow } from 'reactflow'; @@ -6,22 +6,21 @@ import { useBehaveGraphFlow } from '../hooks/useBehaveGraphFlow.js'; import { useFlowHandlers } from '../hooks/useFlowHandlers.js'; import { useGraphRunner } from '../hooks/useGraphRunner.js'; import { useNodeSpecJson } from '../hooks/useNodeSpecJson.js'; -import { useRegistry } from '../hooks/useRegistry.js'; import CustomControls from './Controls.js'; import { Examples } from './modals/LoadModal.js'; import { NodePicker } from './NodePicker.js'; type FlowProps = { initialGraph: GraphJSON; + registry: IRegistry; examples: Examples; }; export const Flow: React.FC = ({ initialGraph: graph, + registry, examples }) => { - const registry = useRegistry(); - const specJson = useNodeSpecJson(registry); const { diff --git a/packages/flow/src/index.ts b/packages/flow/src/index.ts index 3f32e577..5cb4cdd9 100644 --- a/packages/flow/src/index.ts +++ b/packages/flow/src/index.ts @@ -20,7 +20,6 @@ export * from './hooks/useFlowHandlers.js'; export * from './hooks/useGraphRunner.js'; export * from './hooks/useBehaveGraphFlow.js'; export * from './hooks/useNodeSpecJson.js'; -export * from './hooks/useRegistry.js'; export * from './hooks/useCustomNodeTypes.js'; export * from './hooks/useMergeMap.js'; diff --git a/packages/flow/src/util/customNodeTypes.tsx b/packages/flow/src/util/customNodeTypes.tsx deleted file mode 100644 index 3e1c1459..00000000 --- a/packages/flow/src/util/customNodeTypes.tsx +++ /dev/null @@ -1,12 +0,0 @@ -import React from 'react'; -import { NodeTypes } from 'reactflow'; - -import { Node } from '../components/Node.js'; -import { getNodeSpecJSON } from './getNodeSpecJSON.js'; - -const spec = getNodeSpecJSON(); - -export const customNodeTypes = spec.reduce((nodes, node) => { - nodes[node.type] = (props) => ; - return nodes; -}, {} as NodeTypes); diff --git a/packages/flow/src/util/getNodeSpecJSON.ts b/packages/flow/src/util/getNodeSpecJSON.ts deleted file mode 100644 index 8a031757..00000000 --- a/packages/flow/src/util/getNodeSpecJSON.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { memo, NodeSpecJSON, writeNodeSpecsToJSON } from '@behave-graph/core'; - -import { useRegistry } from '../hooks/useRegistry.js'; - -export const getNodeSpecJSON = memo(() => - writeNodeSpecsToJSON(useRegistry()) -);