diff --git a/package-lock.json b/package-lock.json index 23509de..f521db8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8,6 +8,8 @@ "name": "lego-builder", "version": "0.1.0", "dependencies": { + "@liveblocks/client": "^1.0.1", + "@liveblocks/zustand": "^1.0.1", "@react-three/drei": "^9.57.0", "@react-three/fiber": "^8.11.6", "@testing-library/jest-dom": "^5.16.5", @@ -18,7 +20,9 @@ "react-dom": "^18.2.0", "react-scripts": "5.0.1", "three": "^0.150.1", - "web-vitals": "^2.1.4" + "use-keyboard-shortcut": "^1.1.6", + "web-vitals": "^2.1.4", + "zustand": "^4.3.6" } }, "node_modules/@adobe/css-tools": { @@ -3015,6 +3019,31 @@ "resolved": "https://registry.npmjs.org/@leichtgewicht/ip-codec/-/ip-codec-2.0.4.tgz", "integrity": "sha512-Hcv+nVC0kZnQ3tD9GVu5xSMR4VVYOteQIr/hwFPVEvPdlXqgGEuRjiheChHgdM+JyqdgNcmzZOX/tnl0JOiI7A==" }, + "node_modules/@liveblocks/client": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@liveblocks/client/-/client-1.0.1.tgz", + "integrity": "sha512-lU+A+v1bbvI6H/pOjo93G8LAf1HYM2yqZc4D/LCI6b/JiZT/3bMrJ2X8Or4Yc5DVmIK3T5Rumk2za9bSdcjBQQ==", + "dependencies": { + "@liveblocks/core": "1.0.1" + } + }, + "node_modules/@liveblocks/core": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@liveblocks/core/-/core-1.0.1.tgz", + "integrity": "sha512-IwtVtp1ogmVJLW7KSmkI7J+8+pPg0FMNdFV71oCPAugmlZRxUer3MvdIBOW4ULFBgoBJOzAmcjWRDFsl3K7ADA==" + }, + "node_modules/@liveblocks/zustand": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@liveblocks/zustand/-/zustand-1.0.1.tgz", + "integrity": "sha512-cAXMS5r9wRa+NFAnJ4IusV/azRxcVB9zWtc99WSCXNq2uhxwlrsG6z+kDNR8LemoDHweSVkpb/c3Hi8FDFnv6Q==", + "dependencies": { + "@liveblocks/client": "1.0.1", + "@liveblocks/core": "1.0.1" + }, + "peerDependencies": { + "zustand": "^4.1.3" + } + }, "node_modules/@nicolo-ribaudo/eslint-scope-5-internals": { "version": "5.1.1-v1", "resolved": "https://registry.npmjs.org/@nicolo-ribaudo/eslint-scope-5-internals/-/eslint-scope-5-internals-5.1.1-v1.tgz", @@ -3290,6 +3319,22 @@ } } }, + "node_modules/@react-three/drei/node_modules/zustand": { + "version": "3.7.2", + "resolved": "https://registry.npmjs.org/zustand/-/zustand-3.7.2.tgz", + "integrity": "sha512-PIJDIZKtokhof+9+60cpockVOq05sJzHCriyvaLBmEJixseQ1a5Kdov6fWZfWOu5SK9c+FhH1jU0tntLxRJYMA==", + "engines": { + "node": ">=12.7.0" + }, + "peerDependencies": { + "react": ">=16.8" + }, + "peerDependenciesMeta": { + "react": { + "optional": true + } + } + }, "node_modules/@react-three/fiber": { "version": "8.11.7", "resolved": "https://registry.npmjs.org/@react-three/fiber/-/fiber-8.11.7.tgz", @@ -3339,6 +3384,22 @@ "loose-envify": "^1.1.0" } }, + "node_modules/@react-three/fiber/node_modules/zustand": { + "version": "3.7.2", + "resolved": "https://registry.npmjs.org/zustand/-/zustand-3.7.2.tgz", + "integrity": "sha512-PIJDIZKtokhof+9+60cpockVOq05sJzHCriyvaLBmEJixseQ1a5Kdov6fWZfWOu5SK9c+FhH1jU0tntLxRJYMA==", + "engines": { + "node": ">=12.7.0" + }, + "peerDependencies": { + "react": ">=16.8" + }, + "peerDependenciesMeta": { + "react": { + "optional": true + } + } + }, "node_modules/@rollup/plugin-babel": { "version": "5.3.1", "resolved": "https://registry.npmjs.org/@rollup/plugin-babel/-/plugin-babel-5.3.1.tgz", @@ -12520,6 +12581,22 @@ "react": "^16.8 || ^17.0" } }, + "node_modules/leva/node_modules/zustand": { + "version": "3.7.2", + "resolved": "https://registry.npmjs.org/zustand/-/zustand-3.7.2.tgz", + "integrity": "sha512-PIJDIZKtokhof+9+60cpockVOq05sJzHCriyvaLBmEJixseQ1a5Kdov6fWZfWOu5SK9c+FhH1jU0tntLxRJYMA==", + "engines": { + "node": ">=12.7.0" + }, + "peerDependencies": { + "react": ">=16.8" + }, + "peerDependenciesMeta": { + "react": { + "optional": true + } + } + }, "node_modules/leven": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/leven/-/leven-3.1.0.tgz", @@ -17292,6 +17369,23 @@ "requires-port": "^1.0.0" } }, + "node_modules/use-keyboard-shortcut": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/use-keyboard-shortcut/-/use-keyboard-shortcut-1.1.6.tgz", + "integrity": "sha512-tOKjR7eKXQIfAgFMwhelpWSRTrwE1GaB8CE/47ohtcVCKxUdn7UbfNNhiigTkATpUVoPu+5tRPbHrwjIBgTYoQ==", + "peerDependencies": { + "react": ">=16.8", + "react-dom": ">=16.8" + } + }, + "node_modules/use-sync-external-store": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/use-sync-external-store/-/use-sync-external-store-1.2.0.tgz", + "integrity": "sha512-eEgnFxGQ1Ife9bzYs6VLi8/4X6CObHMw9Qr9tPY43iKwsPw8xE8+EFsf/2cFZ5S3esXgpWgtSCtLNS41F+sKPA==", + "peerDependencies": { + "react": "^16.8.0 || ^17.0.0 || ^18.0.0" + } + }, "node_modules/util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", @@ -18335,16 +18429,23 @@ "integrity": "sha512-DCo0oxvcvOTGP/f5FA6tz2Z6wF+FIcEApSTu0zV5sQgn9hoT5lZ9YRAKUraxt9oP7l4e8TnNdi8IZTCX6WCkwA==" }, "node_modules/zustand": { - "version": "3.7.2", - "resolved": "https://registry.npmjs.org/zustand/-/zustand-3.7.2.tgz", - "integrity": "sha512-PIJDIZKtokhof+9+60cpockVOq05sJzHCriyvaLBmEJixseQ1a5Kdov6fWZfWOu5SK9c+FhH1jU0tntLxRJYMA==", + "version": "4.3.6", + "resolved": "https://registry.npmjs.org/zustand/-/zustand-4.3.6.tgz", + "integrity": "sha512-6J5zDxjxLE+yukC2XZWf/IyWVKnXT9b9HUv09VJ/bwGCpKNcaTqp7Ws28Xr8jnbvnZcdRaidztAPsXFBIqufiw==", + "dependencies": { + "use-sync-external-store": "1.2.0" + }, "engines": { "node": ">=12.7.0" }, "peerDependencies": { + "immer": ">=9.0", "react": ">=16.8" }, "peerDependenciesMeta": { + "immer": { + "optional": true + }, "react": { "optional": true } @@ -20379,6 +20480,28 @@ "resolved": "https://registry.npmjs.org/@leichtgewicht/ip-codec/-/ip-codec-2.0.4.tgz", "integrity": "sha512-Hcv+nVC0kZnQ3tD9GVu5xSMR4VVYOteQIr/hwFPVEvPdlXqgGEuRjiheChHgdM+JyqdgNcmzZOX/tnl0JOiI7A==" }, + "@liveblocks/client": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@liveblocks/client/-/client-1.0.1.tgz", + "integrity": "sha512-lU+A+v1bbvI6H/pOjo93G8LAf1HYM2yqZc4D/LCI6b/JiZT/3bMrJ2X8Or4Yc5DVmIK3T5Rumk2za9bSdcjBQQ==", + "requires": { + "@liveblocks/core": "1.0.1" + } + }, + "@liveblocks/core": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@liveblocks/core/-/core-1.0.1.tgz", + "integrity": "sha512-IwtVtp1ogmVJLW7KSmkI7J+8+pPg0FMNdFV71oCPAugmlZRxUer3MvdIBOW4ULFBgoBJOzAmcjWRDFsl3K7ADA==" + }, + "@liveblocks/zustand": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@liveblocks/zustand/-/zustand-1.0.1.tgz", + "integrity": "sha512-cAXMS5r9wRa+NFAnJ4IusV/azRxcVB9zWtc99WSCXNq2uhxwlrsG6z+kDNR8LemoDHweSVkpb/c3Hi8FDFnv6Q==", + "requires": { + "@liveblocks/client": "1.0.1", + "@liveblocks/core": "1.0.1" + } + }, "@nicolo-ribaudo/eslint-scope-5-internals": { "version": "5.1.1-v1", "resolved": "https://registry.npmjs.org/@nicolo-ribaudo/eslint-scope-5-internals/-/eslint-scope-5-internals-5.1.1-v1.tgz", @@ -20570,6 +20693,14 @@ "troika-three-text": "^0.47.1", "utility-types": "^3.10.0", "zustand": "^3.5.13" + }, + "dependencies": { + "zustand": { + "version": "3.7.2", + "resolved": "https://registry.npmjs.org/zustand/-/zustand-3.7.2.tgz", + "integrity": "sha512-PIJDIZKtokhof+9+60cpockVOq05sJzHCriyvaLBmEJixseQ1a5Kdov6fWZfWOu5SK9c+FhH1jU0tntLxRJYMA==", + "requires": {} + } } }, "@react-three/fiber": { @@ -20594,6 +20725,12 @@ "requires": { "loose-envify": "^1.1.0" } + }, + "zustand": { + "version": "3.7.2", + "resolved": "https://registry.npmjs.org/zustand/-/zustand-3.7.2.tgz", + "integrity": "sha512-PIJDIZKtokhof+9+60cpockVOq05sJzHCriyvaLBmEJixseQ1a5Kdov6fWZfWOu5SK9c+FhH1jU0tntLxRJYMA==", + "requires": {} } } }, @@ -27356,6 +27493,12 @@ } } } + }, + "zustand": { + "version": "3.7.2", + "resolved": "https://registry.npmjs.org/zustand/-/zustand-3.7.2.tgz", + "integrity": "sha512-PIJDIZKtokhof+9+60cpockVOq05sJzHCriyvaLBmEJixseQ1a5Kdov6fWZfWOu5SK9c+FhH1jU0tntLxRJYMA==", + "requires": {} } } }, @@ -30667,6 +30810,18 @@ "requires-port": "^1.0.0" } }, + "use-keyboard-shortcut": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/use-keyboard-shortcut/-/use-keyboard-shortcut-1.1.6.tgz", + "integrity": "sha512-tOKjR7eKXQIfAgFMwhelpWSRTrwE1GaB8CE/47ohtcVCKxUdn7UbfNNhiigTkATpUVoPu+5tRPbHrwjIBgTYoQ==", + "requires": {} + }, + "use-sync-external-store": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/use-sync-external-store/-/use-sync-external-store-1.2.0.tgz", + "integrity": "sha512-eEgnFxGQ1Ife9bzYs6VLi8/4X6CObHMw9Qr9tPY43iKwsPw8xE8+EFsf/2cFZ5S3esXgpWgtSCtLNS41F+sKPA==", + "requires": {} + }, "util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", @@ -31481,10 +31636,12 @@ "integrity": "sha512-DCo0oxvcvOTGP/f5FA6tz2Z6wF+FIcEApSTu0zV5sQgn9hoT5lZ9YRAKUraxt9oP7l4e8TnNdi8IZTCX6WCkwA==" }, "zustand": { - "version": "3.7.2", - "resolved": "https://registry.npmjs.org/zustand/-/zustand-3.7.2.tgz", - "integrity": "sha512-PIJDIZKtokhof+9+60cpockVOq05sJzHCriyvaLBmEJixseQ1a5Kdov6fWZfWOu5SK9c+FhH1jU0tntLxRJYMA==", - "requires": {} + "version": "4.3.6", + "resolved": "https://registry.npmjs.org/zustand/-/zustand-4.3.6.tgz", + "integrity": "sha512-6J5zDxjxLE+yukC2XZWf/IyWVKnXT9b9HUv09VJ/bwGCpKNcaTqp7Ws28Xr8jnbvnZcdRaidztAPsXFBIqufiw==", + "requires": { + "use-sync-external-store": "1.2.0" + } } } } diff --git a/package.json b/package.json index c4d7677..c05a704 100644 --- a/package.json +++ b/package.json @@ -3,17 +3,21 @@ "version": "0.1.0", "private": true, "dependencies": { + "@liveblocks/client": "^1.0.1", + "@liveblocks/zustand": "^1.0.1", + "@react-three/drei": "^9.57.0", + "@react-three/fiber": "^8.11.6", "@testing-library/jest-dom": "^5.16.5", "@testing-library/react": "^13.4.0", "@testing-library/user-event": "^13.5.0", + "leva": "^0.9.34", "react": "^18.2.0", "react-dom": "^18.2.0", "react-scripts": "5.0.1", - "web-vitals": "^2.1.4", - "@react-three/drei": "^9.57.0", - "@react-three/fiber": "^8.11.6", "three": "^0.150.1", - "leva": "^0.9.34" + "use-keyboard-shortcut": "^1.1.6", + "web-vitals": "^2.1.4", + "zustand": "^4.3.6" }, "scripts": { "start": "react-scripts start", diff --git a/src/App.js b/src/App.js index f22d6da..4dded16 100644 --- a/src/App.js +++ b/src/App.js @@ -5,9 +5,9 @@ import { Suspense } from "react"; import { LinearToneMapping } from "three"; import { InfoPanel, Scene } from "./components"; -function App() { +const LegoRoom = () => { return ( -