refactor: Universe component

This commit is contained in:
cha0s 2021-03-23 14:16:06 -05:00
parent 01e1a0eb87
commit 0671b2f2f6
7 changed files with 166 additions and 12 deletions

View File

@ -4,6 +4,7 @@ import './index.scss';
import {hot} from 'react-hot-loader';
import {useIsNative} from '@humus/core';
import {Universe} from '@humus/universe';
import {React} from '@latus/react';
import {ConnectedRouter} from 'connected-react-router';
import {
@ -17,7 +18,6 @@ import Play from '../play';
import Renderer from '../renderer';
import Title from '../title';
import Ui from '../ui';
import Universe from '../universe';
import history from './history';

View File

@ -27,13 +27,16 @@
"@avocado/s13n": "^2.0.0",
"@avocado/timing": "^2.0.0",
"@avocado/traits": "^2.0.0",
"@humus/core": "^1.0.0",
"@latus/core": "^2.0.0",
"@latus/react": "^2.0.0",
"@latus/redux": "^2.0.0",
"@latus/socket": "^2.0.0",
"autoprefixer": "^9.8.6",
"debug": "4.3.1",
"express": "^4.17.1",
"glob": "^7.1.6"
"glob": "^7.1.6",
"react-router-dom": "^5.2.0"
},
"devDependencies": {
"@latus/build": "1.x",

View File

Before

Width:  |  Height:  |  Size: 594 KiB

After

Width:  |  Height:  |  Size: 594 KiB

View File

@ -1,7 +1,6 @@
import './index.scss';
import './universe.scss';
import {useIsNative} from '@humus/core';
import {universesByLocalitySelector, universesSelector} from '@humus/universe';
import {useSelector} from '@latus/redux';
import {PropTypes, React} from '@latus/react';
import {
@ -11,6 +10,8 @@ import {
useLocation,
} from 'react-router-dom';
import {universesByLocalitySelector, universesSelector} from '../state';
const Universe = ({match: {params: {uuid}}}) => {
const history = useHistory();
const isNative = useIsNative();

View File

@ -2,6 +2,8 @@ import {gatherWithLatus} from '@latus/core';
import {universes} from './state';
export {default as Universe} from './components/universe';
export * from './state';
export default {

View File

@ -2,6 +2,19 @@
# yarn lockfile v1
"@avocado/behavior@2.0.0", "@avocado/behavior@^2.0.0":
version "2.0.0"
resolved "http://npm.cha0sdev/@avocado%2fbehavior/-/behavior-2.0.0.tgz#875a3fa4498476c82063495069c53cad12f4f3c5"
integrity sha512-WymGaQGK/nM7yvzyWkzSHdlaqi71T6PxLE6UT+ZwcucMR8CBFIjEzTAP5C6WvUxSib1VRuF+s+q6e/DEsyb1dQ==
dependencies:
"@avocado/core" "2.0.0"
"@avocado/traits" "^2.0.0"
"@latus/core" "2.0.0"
autoprefixer "^9.8.6"
debug "4.3.1"
deepmerge "^4.2.2"
lodash.mapvalues "^4.6.0"
"@avocado/core@2.0.0", "@avocado/core@^2.0.0":
version "2.0.0"
resolved "http://npm.cha0sdev/@avocado%2fcore/-/core-2.0.0.tgz#c18b0f64e4503c1a9dec67586f7ebf9bda5d129e"
@ -10,7 +23,27 @@
autoprefixer "^9.8.6"
debug "4.3.1"
"@avocado/graphics@2.0.0":
"@avocado/entity@^2.0.0":
version "2.0.0"
resolved "http://npm.cha0sdev/@avocado%2fentity/-/entity-2.0.0.tgz#333d9b7ac858762f11a8bb24d8f478094a59d793"
integrity sha512-y1/MSwRya1a7XC/o7fMtGRMPSpdEq2Y6qjNYFNl/LgG03e2Ie4m5HA2dFCxwErz0sdzW7N8F6wOSRb0cmNESxA==
dependencies:
"@avocado/behavior" "2.0.0"
"@avocado/core" "2.0.0"
"@avocado/graphics" "^2.0.0"
"@avocado/math" "2.0.0"
"@avocado/resource" "2.0.0"
"@avocado/s13n" "2.0.0"
"@avocado/timing" "2.0.0"
"@avocado/traits" "^2.0.0"
"@latus/core" "2.0.0"
"@latus/socket" "2.0.0"
autoprefixer "^9.8.6"
debug "4.3.1"
deepmerge "^4.2.2"
lodash.without "^4.4.0"
"@avocado/graphics@2.0.0", "@avocado/graphics@^2.0.0":
version "2.0.0"
resolved "http://npm.cha0sdev/@avocado%2fgraphics/-/graphics-2.0.0.tgz#c881ce2e1d4ace9763d367fa81ac2487ea9931b3"
integrity sha512-zLPglQ5J4rE7zN1qPyfecWtkov/LkW7J0abkb6YUk2fsB6ccMZ23737VyjW6N4/xL+ZtXAqaElMZ9khFSUEPpg==
@ -35,7 +68,7 @@
debug "4.3.1"
image-size "^0.9.3"
"@avocado/input@2.0.0":
"@avocado/input@2.0.0", "@avocado/input@^2.0.0":
version "2.0.0"
resolved "http://npm.cha0sdev/@avocado%2finput/-/input-2.0.0.tgz#0a4cc8e933af72480a900c592a5025d117deea4f"
integrity sha512-aTbLXYM8JdFaD8CrMb4747BmRpxPucECoQcznlAW/ulndIRGhGBaSkDa6OwHa9oH7KfaL5Dcnu4EWaOAKkTcXA==
@ -68,7 +101,7 @@
deepmerge "^4.2.2"
uuid "^8.3.2"
"@avocado/s13n@^2.0.0":
"@avocado/s13n@2.0.0", "@avocado/s13n@^2.0.0":
version "2.0.0"
resolved "http://npm.cha0sdev/@avocado%2fs13n/-/s13n-2.0.0.tgz#2849a8dd3f2ec91821ee18ffa51f6d6ccc3ac957"
integrity sha512-I26AuKZQj7g82RzqCYxtUPNX9ZedNWoPaNJnenJbMCDjznklNIFW0ZVpgbOb5Rqoa99YFDpafkEsaMKBGZTW6g==
@ -80,7 +113,7 @@
debug "4.3.1"
msgpack-lite "^0.1.26"
"@avocado/timing@^2.0.0":
"@avocado/timing@2.0.0", "@avocado/timing@^2.0.0":
version "2.0.0"
resolved "http://npm.cha0sdev/@avocado%2ftiming/-/timing-2.0.0.tgz#fb804113c0449187dfea7329c35b61cb1c34d88a"
integrity sha512-w1lsuvFWM+jIOfAADdA1NNjhdZVm1A7O4RJ73w+IXnVh7hactdYHRCqbV8IIdzmmDFFsptFsYqUVyolq6VHK2w==
@ -948,6 +981,13 @@
core-js-pure "^3.0.0"
regenerator-runtime "^0.13.4"
"@babel/runtime@^7.1.2":
version "7.13.10"
resolved "http://npm.cha0sdev/@babel%2fruntime/-/runtime-7.13.10.tgz#47d42a57b6095f4468da440388fdbad8bebf0d7d"
integrity sha512-4QPkjJq6Ns3V/RgpEahRk+AGfL0eO6RHHtTWoNNr5mO49G6B5+X6d6THgWEAvTrznU5xYpbAlVKRYcsCgh/Akw==
dependencies:
regenerator-runtime "^0.13.4"
"@babel/runtime@^7.10.2", "@babel/runtime@^7.11.2", "@babel/runtime@^7.12.1", "@babel/runtime@^7.8.4":
version "7.12.13"
resolved "http://npm.cha0sdev/@babel%2fruntime/-/runtime-7.12.13.tgz#0a21452352b02542db0ffb928ac2d3ca7cb6d66d"
@ -1013,6 +1053,28 @@
object-assign "^4.1.1"
scheduler "^0.20.1"
"@humus/core@^1.0.0":
version "1.0.0"
resolved "http://npm.cha0sdev/@humus%2fcore/-/core-1.0.0.tgz#0ef7b24006747bc97b2ef3c671e7c43c3a0ea01d"
integrity sha512-KGkDwf2Wec013MLZZnH1qXZdno0sB0YcrNSNOwpN6ECkRz/w/aUiL2t9evIkJOCOskCb/eHXoyieB2P05Ag3VQ==
dependencies:
"@avocado/behavior" "^2.0.0"
"@avocado/core" "^2.0.0"
"@avocado/entity" "^2.0.0"
"@avocado/graphics" "^2.0.0"
"@avocado/input" "^2.0.0"
"@avocado/math" "^2.0.0"
"@avocado/resource" "^2.0.0"
"@avocado/s13n" "^2.0.0"
"@avocado/traits" "^2.0.0"
"@latus/core" "^2.0.0"
"@latus/react" "^2.0.0"
"@latus/redux" "^2.0.0"
"@latus/socket" "^2.0.0"
autoprefixer "^9.8.6"
debug "4.3.1"
msgpack-lite "^0.1.26"
"@latus/build@1.x":
version "1.0.0"
resolved "http://npm.cha0sdev/@latus%2fbuild/-/build-1.0.0.tgz#f46931805023e753e6ac5038acc832e53801e46c"
@ -4506,6 +4568,18 @@ he@1.2.0, he@1.2.x, he@^1.2.0:
resolved "http://npm.cha0sdev/he/-/he-1.2.0.tgz#84ae65fa7eafb165fddb61566ae14baf05664f0f"
integrity sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==
history@^4.9.0:
version "4.10.1"
resolved "http://npm.cha0sdev/history/-/history-4.10.1.tgz#33371a65e3a83b267434e2b3f3b1b4c58aad4cf3"
integrity sha512-36nwAD620w12kuzPAsyINPWJqlNbij+hpK1k9XRloDtym8mxzGYl2c17LnV6IAGB2Dmg4tEa7G7DlawS0+qjew==
dependencies:
"@babel/runtime" "^7.1.2"
loose-envify "^1.2.0"
resolve-pathname "^3.0.0"
tiny-invariant "^1.0.2"
tiny-warning "^1.0.0"
value-equal "^1.0.1"
hmac-drbg@^1.0.1:
version "1.0.1"
resolved "http://npm.cha0sdev/hmac-drbg/-/hmac-drbg-1.0.1.tgz#d2745701025a6c775a6c545793ed502fc0c649a1"
@ -4515,7 +4589,7 @@ hmac-drbg@^1.0.1:
minimalistic-assert "^1.0.0"
minimalistic-crypto-utils "^1.0.1"
hoist-non-react-statics@^3.3.0, hoist-non-react-statics@^3.3.2:
hoist-non-react-statics@^3.1.0, hoist-non-react-statics@^3.3.0, hoist-non-react-statics@^3.3.2:
version "3.3.2"
resolved "http://npm.cha0sdev/hoist-non-react-statics/-/hoist-non-react-statics-3.3.2.tgz#ece0acaf71d62c2969c2ec59feff42a4b1a85b45"
integrity sha512-/gGivxi8JPKWNm/W0jSmzcMPpfpPLc3dY/6GxhX2hQ9iGj3aDfklV4ET7NjKpSinLpJ5vafa9iiGIEZg10SfBw==
@ -5126,6 +5200,11 @@ is-wsl@^1.1.0:
resolved "http://npm.cha0sdev/is-wsl/-/is-wsl-1.1.0.tgz#1f16e4aa22b04d1336b66188a66af3c600c3a66d"
integrity sha1-HxbkqiKwTRM2tmGIpmrzxgDDpm0=
isarray@0.0.1:
version "0.0.1"
resolved "http://npm.cha0sdev/isarray/-/isarray-0.0.1.tgz#8a18acfca9a8f4177e09abfc6038939b05d1eedf"
integrity sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=
isarray@1.0.0, isarray@^1.0.0, isarray@~1.0.0:
version "1.0.0"
resolved "http://npm.cha0sdev/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11"
@ -5453,6 +5532,11 @@ lodash.uniq@^4.5.0:
resolved "http://npm.cha0sdev/lodash.uniq/-/lodash.uniq-4.5.0.tgz#d0225373aeb652adc1bc82e4945339a842754773"
integrity sha1-0CJTc662Uq3BvILklFM5qEJ1R3M=
lodash.without@^4.4.0:
version "4.4.0"
resolved "http://npm.cha0sdev/lodash.without/-/lodash.without-4.4.0.tgz#3cd4574a00b67bae373a94b748772640507b7aac"
integrity sha1-PNRXSgC2e643OpS3SHcmQFB7eqw=
lodash@^4.0.0, lodash@^4.17.11, lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17.19, lodash@^4.17.20, lodash@~4.17.10:
version "4.17.20"
resolved "http://npm.cha0sdev/lodash/-/lodash-4.17.20.tgz#b44a9b6297bcb698f1c51a3545a2b3b368d59c52"
@ -5470,7 +5554,7 @@ loglevel@^1.6.8:
resolved "http://npm.cha0sdev/loglevel/-/loglevel-1.7.1.tgz#005fde2f5e6e47068f935ff28573e125ef72f197"
integrity sha512-Hesni4s5UkWkwCGJMQGAh71PaLUmKFM60dHvq0zi/vDhhrzuk+4GgNbTXJ12YYQJn6ZKBDNIjYcuQGKudvqrIw==
loose-envify@^1.1.0, loose-envify@^1.4.0:
loose-envify@^1.1.0, loose-envify@^1.2.0, loose-envify@^1.3.1, loose-envify@^1.4.0:
version "1.4.0"
resolved "http://npm.cha0sdev/loose-envify/-/loose-envify-1.4.0.tgz#71ee51fa7be4caec1a63839f7e682d8132d30caf"
integrity sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==
@ -5692,6 +5776,14 @@ min-document@^2.19.0:
dependencies:
dom-walk "^0.1.0"
mini-create-react-context@^0.4.0:
version "0.4.1"
resolved "http://npm.cha0sdev/mini-create-react-context/-/mini-create-react-context-0.4.1.tgz#072171561bfdc922da08a60c2197a497cc2d1d5e"
integrity sha512-YWCYEmd5CQeHGSAKrYvXgmzzkrvssZcuuQDDeqkT+PziKGMgE+0MCCtcKbROzocGBG1meBLl2FotlRwf4gAzbQ==
dependencies:
"@babel/runtime" "^7.12.1"
tiny-warning "^1.0.3"
mini-css-extract-plugin@^0.12.0:
version "0.12.0"
resolved "http://npm.cha0sdev/mini-css-extract-plugin/-/mini-css-extract-plugin-0.12.0.tgz#ddeb74fd6304ca9f99c1db74acc7d5b507705454"
@ -6503,6 +6595,13 @@ path-to-regexp@0.1.7:
resolved "http://npm.cha0sdev/path-to-regexp/-/path-to-regexp-0.1.7.tgz#df604178005f522f15eb4490e7247a1bfaa67f8c"
integrity sha1-32BBeABfUi8V60SQ5yR6G/qmf4w=
path-to-regexp@^1.7.0:
version "1.8.0"
resolved "http://npm.cha0sdev/path-to-regexp/-/path-to-regexp-1.8.0.tgz#887b3ba9d84393e87a0a0b9f4cb756198b53548a"
integrity sha512-n43JRhlUKUAlibEJhPeir1ncUID16QnEjNpwzNdO3Lm4ywrBpBZ5oLD0I6br9evr1Y9JTqwRtAh7JLoOzAQdVA==
dependencies:
isarray "0.0.1"
path-type@^1.0.0:
version "1.1.0"
resolved "http://npm.cha0sdev/path-type/-/path-type-1.1.0.tgz#59c44f7ee491da704da415da5a4070ba4f8fe441"
@ -6739,7 +6838,7 @@ promise-inflight@^1.0.1:
resolved "http://npm.cha0sdev/promise-inflight/-/promise-inflight-1.0.1.tgz#98472870bf228132fcbdd868129bad12c3c029e3"
integrity sha1-mEcocL8igTL8vdhoEputEsPAKeM=
prop-types@^15.6.1, prop-types@^15.7.2:
prop-types@^15.6.1, prop-types@^15.6.2, prop-types@^15.7.2:
version "15.7.2"
resolved "http://npm.cha0sdev/prop-types/-/prop-types-15.7.2.tgz#52c41e75b8c87e72b9d9360e0206b99dcbffa6c5"
integrity sha512-8QQikdH7//R2vurIJSutZ1smHYTcLpRWEOlHnzcWHmBYrOGUysKwSsrC89BCiFj3CbrfJ/nXFdJepOVrY1GCHQ==
@ -6916,7 +7015,7 @@ react-hot-loader@^4.13.0:
shallowequal "^1.1.0"
source-map "^0.7.3"
react-is@^16.13.1, react-is@^16.7.0, react-is@^16.8.1:
react-is@^16.13.1, react-is@^16.6.0, react-is@^16.7.0, react-is@^16.8.1:
version "16.13.1"
resolved "http://npm.cha0sdev/react-is/-/react-is-16.13.1.tgz#789729a4dc36de2999dc156dd6c1d9c18cea56a4"
integrity sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==
@ -6937,6 +7036,35 @@ react-redux@^7.2.2:
prop-types "^15.7.2"
react-is "^16.13.1"
react-router-dom@^5.2.0:
version "5.2.0"
resolved "http://npm.cha0sdev/react-router-dom/-/react-router-dom-5.2.0.tgz#9e65a4d0c45e13289e66c7b17c7e175d0ea15662"
integrity sha512-gxAmfylo2QUjcwxI63RhQ5G85Qqt4voZpUXSEqCwykV0baaOTQDR1f0PmY8AELqIyVc0NEZUj0Gov5lNGcXgsA==
dependencies:
"@babel/runtime" "^7.1.2"
history "^4.9.0"
loose-envify "^1.3.1"
prop-types "^15.6.2"
react-router "5.2.0"
tiny-invariant "^1.0.2"
tiny-warning "^1.0.0"
react-router@5.2.0:
version "5.2.0"
resolved "http://npm.cha0sdev/react-router/-/react-router-5.2.0.tgz#424e75641ca8747fbf76e5ecca69781aa37ea293"
integrity sha512-smz1DUuFHRKdcJC0jobGo8cVbhO3x50tCL4icacOlcwDOEQPq4TMqwx3sY1TP+DvtTgz4nm3thuo7A+BK2U0Dw==
dependencies:
"@babel/runtime" "^7.1.2"
history "^4.9.0"
hoist-non-react-statics "^3.1.0"
loose-envify "^1.3.1"
mini-create-react-context "^0.4.0"
path-to-regexp "^1.7.0"
prop-types "^15.6.2"
react-is "^16.6.0"
tiny-invariant "^1.0.2"
tiny-warning "^1.0.0"
react@^17.0.1:
version "17.0.1"
resolved "http://npm.cha0sdev/react/-/react-17.0.1.tgz#6e0600416bd57574e3f86d92edba3d9008726127"
@ -7236,6 +7364,11 @@ resolve-from@^4.0.0:
resolved "http://npm.cha0sdev/resolve-from/-/resolve-from-4.0.0.tgz#4abcd852ad32dd7baabfe9b40e00a36db5f392e6"
integrity sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==
resolve-pathname@^3.0.0:
version "3.0.0"
resolved "http://npm.cha0sdev/resolve-pathname/-/resolve-pathname-3.0.0.tgz#99d02224d3cf263689becbb393bc560313025dcd"
integrity sha512-C7rARubxI8bXFNB/hqcp/4iUeIXJhJZvFPFPiSPRnhU5UPxzMFIl+2E6yY6c4k9giDJAhtV+enfA+G89N6Csng==
resolve-url@^0.2.1:
version "0.2.1"
resolved "http://npm.cha0sdev/resolve-url/-/resolve-url-0.2.1.tgz#2c637fe77c893afd2a663fe21aa9080068e2052a"
@ -8134,6 +8267,16 @@ timers-browserify@^2.0.4:
dependencies:
setimmediate "^1.0.4"
tiny-invariant@^1.0.2:
version "1.1.0"
resolved "http://npm.cha0sdev/tiny-invariant/-/tiny-invariant-1.1.0.tgz#634c5f8efdc27714b7f386c35e6760991d230875"
integrity sha512-ytxQvrb1cPc9WBEI/HSeYYoGD0kWnGEOR8RY6KomWLBVhqz0RgTwVO9dLrGz7dC+nN9llyI7OKAgRq8Vq4ZBSw==
tiny-warning@^1.0.0, tiny-warning@^1.0.3:
version "1.0.3"
resolved "http://npm.cha0sdev/tiny-warning/-/tiny-warning-1.0.3.tgz#94a30db453df4c643d0fd566060d60a875d84754"
integrity sha512-lBN9zLN/oAf68o3zNXYrdCt1kP8WsiGW8Oo2ka41b2IM5JL/S1CTyX1rW0mb/zSuJun0ZUrDxx4sqvYS2FWzPA==
to-arraybuffer@^1.0.0:
version "1.0.1"
resolved "http://npm.cha0sdev/to-arraybuffer/-/to-arraybuffer-1.0.1.tgz#7d229b1fcc637e466ca081180836a7aabff83f43"
@ -8458,6 +8601,11 @@ validate-npm-package-license@^3.0.1:
spdx-correct "^3.0.0"
spdx-expression-parse "^3.0.0"
value-equal@^1.0.1:
version "1.0.1"
resolved "http://npm.cha0sdev/value-equal/-/value-equal-1.0.1.tgz#1e0b794c734c5c0cade179c437d356d931a34d6c"
integrity sha512-NOJ6JZCAWr0zlxZt+xqCHNTEKOsrks2HQd4MqhP1qy4z1SkbEP467eNx6TgDKXMvUOb+OENfJCZwM+16n7fRfw==
vary@^1, vary@~1.1.2:
version "1.1.2"
resolved "http://npm.cha0sdev/vary/-/vary-1.1.2.tgz#2299f02c6ded30d4a5961b0b9f74524a18f634fc"