diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..e8cb213 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,2 @@ +/config/** +/dist/** diff --git a/config/webpack.common.js b/config/webpack.common.js index 8323156..ccba3b4 100644 --- a/config/webpack.common.js +++ b/config/webpack.common.js @@ -91,7 +91,6 @@ module.exports = { importWorkboxFrom: 'local', skipWaiting: true, clientsClaim: true, - navigateFallback: '/', }), ], } diff --git a/config/webpack.prod.js b/config/webpack.prod.js index 7782e95..492173f 100644 --- a/config/webpack.prod.js +++ b/config/webpack.prod.js @@ -10,9 +10,8 @@ module.exports = merge(common, { mode: "production", plugins: [ - new CleanWebpackPlugin(['dist'], { - root: path.resolve(__dirname, '../'), - verbose: true, + new CleanWebpackPlugin({ + // verbose: true, }), new CopyWebpackPlugin([{ diff --git a/package-lock.json b/package-lock.json index 4795f4f..77d07a8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -958,83 +958,6 @@ "resolved": "https://registry.npmjs.org/@emotion/unitless/-/unitless-0.7.3.tgz", "integrity": "sha512-4zAPlpDEh2VwXswwr/t8xGNDGg8RQiPxtxZ3qQEXyQsBV39ptTdESCjuBvGze1nLMVrxmTIKmnO/nAV8Tqjjzg==" }, - "@iamstarkov/listr-update-renderer": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/@iamstarkov/listr-update-renderer/-/listr-update-renderer-0.4.1.tgz", - "integrity": "sha512-IJyxQWsYDEkf8C8QthBn5N8tIUR9V9je6j3sMIpAkonaadjbvxmRC6RAhpa3RKxndhNnU2M6iNbtJwd7usQYIA==", - "dev": true, - "requires": { - "chalk": "^1.1.3", - "cli-truncate": "^0.2.1", - "elegant-spinner": "^1.0.1", - "figures": "^1.7.0", - "indent-string": "^3.0.0", - "log-symbols": "^1.0.2", - "log-update": "^2.3.0", - "strip-ansi": "^3.0.1" - }, - "dependencies": { - "ansi-regex": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", - "dev": true - }, - "ansi-styles": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", - "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", - "dev": true - }, - "chalk": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", - "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", - "dev": true, - "requires": { - "ansi-styles": "^2.2.1", - "escape-string-regexp": "^1.0.2", - "has-ansi": "^2.0.0", - "strip-ansi": "^3.0.0", - "supports-color": "^2.0.0" - } - }, - "figures": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/figures/-/figures-1.7.0.tgz", - "integrity": "sha1-y+Hjr/zxzUS4DK3+0o3Hk6lwHS4=", - "dev": true, - "requires": { - "escape-string-regexp": "^1.0.5", - "object-assign": "^4.1.0" - } - }, - "log-symbols": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-1.0.2.tgz", - "integrity": "sha1-N2/3tY6jCGoPCfrMdGF+ylAeGhg=", - "dev": true, - "requires": { - "chalk": "^1.0.0" - } - }, - "strip-ansi": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", - "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", - "dev": true, - "requires": { - "ansi-regex": "^2.0.0" - } - }, - "supports-color": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", - "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", - "dev": true - } - } - }, "@mapbox/hast-util-table-cell-style": { "version": "0.1.3", "resolved": "https://registry.npmjs.org/@mapbox/hast-util-table-cell-style/-/hast-util-table-cell-style-0.1.3.tgz", @@ -1044,15 +967,15 @@ } }, "@material-ui/core": { - "version": "4.0.0-alpha.1", - "resolved": "https://registry.npmjs.org/@material-ui/core/-/core-4.0.0-alpha.1.tgz", - "integrity": "sha512-/QjIMuD+8nGzAOV0Wl5MV2NXSDyEshL0HKthcm+g9tr7LPhymopN8ki7O48HglZB1ZtFOx7x7O4xY2/sYoYtMA==", + "version": "4.0.0-alpha.2", + "resolved": "https://registry.npmjs.org/@material-ui/core/-/core-4.0.0-alpha.2.tgz", + "integrity": "sha512-Y53JLBc5alKhKXtLEEG6uS0PBbJ5PXuGkVFetFRR4aisIFfimGDaC0rFjB9JDjmBqs078u2hPKty887TJ1KGBQ==", "requires": { "@babel/runtime": "^7.2.0", "@material-ui/system": "^4.0.0-alpha.0", - "@material-ui/utils": "^4.0.0-alpha.0", + "@material-ui/utils": "^4.0.0-alpha.2", "@types/jss": "^9.5.6", - "@types/react-transition-group": "^2.0.8", + "@types/react-transition-group": "^2.0.16", "brcast": "^3.0.1", "clsx": "^1.0.2", "csstype": "^2.5.2", @@ -1070,9 +993,9 @@ "jss-vendor-prefixer": "^7.0.0", "normalize-scroll-left": "^0.1.2", "popper.js": "^1.14.1", - "prop-types": "^15.6.0", - "react-event-listener": "^0.6.2", - "react-transition-group": "^2.2.1", + "prop-types": "^15.7.2", + "react-event-listener": "^0.6.6", + "react-transition-group": "^2.5.3", "warning": "^4.0.1" } }, @@ -1142,12 +1065,12 @@ } }, "@material-ui/utils": { - "version": "4.0.0-alpha.0", - "resolved": "https://registry.npmjs.org/@material-ui/utils/-/utils-4.0.0-alpha.0.tgz", - "integrity": "sha512-w8zSXDuAyS0J5Z8mnU0+HgFf+GP3vGno8wecHT011DM7P3ZoS/2ngU2SqJGwRxuNk7N65tWX1h8NKvoevDPUyQ==", + "version": "4.0.0-alpha.2", + "resolved": "https://registry.npmjs.org/@material-ui/utils/-/utils-4.0.0-alpha.2.tgz", + "integrity": "sha512-b1NzryVlf3pfzkCMqW6MX5Nb4PvYgyJ1u40hchG9j2qP75YJKFQ+iEAR6HQTqZ6wGAOLLZ3S4m1bO5j5kuaEkg==", "requires": { "@babel/runtime": "^7.2.0", - "prop-types": "^15.6.0", + "prop-types": "^15.7.2", "react-is": "^16.8.0" } }, @@ -1204,24 +1127,24 @@ } }, "@types/lodash": { - "version": "4.14.121", - "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.121.tgz", - "integrity": "sha512-ORj7IBWj13iYufXt/VXrCNMbUuCTJfhzme5kx9U/UtcIPdJYuvPDUAlHlbNhz/8lKCLy9XGIZnGrqXOtQbPGoQ==", + "version": "4.14.122", + "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.122.tgz", + "integrity": "sha512-9IdED8wU93ty8gP06ninox+42SBSJHp2IAamsSYMUY76mshRTeUsid/gtbl8ovnOwy8im41ib4cxTiIYMXGKew==", "dev": true }, "@types/lodash-es": { - "version": "4.17.2", - "resolved": "https://registry.npmjs.org/@types/lodash-es/-/lodash-es-4.17.2.tgz", - "integrity": "sha512-Bpl6bh7kF9IdepJEfSd6g/E6OPq99jcIQP5g0xqv47P1FjLOP1+PENCy2vWvrzY+KwnnHwGAbUcTxbEr+WAnUw==", + "version": "4.17.3", + "resolved": "https://registry.npmjs.org/@types/lodash-es/-/lodash-es-4.17.3.tgz", + "integrity": "sha512-iHI0i7ZAL1qepz1Y7f3EKg/zUMDwDfTzitx+AlHhJJvXwenP682ZyGbgPSc5Ej3eEAKVbNWKFuwOadCj5vBbYQ==", "dev": true, "requires": { "@types/lodash": "*" } }, "@types/node": { - "version": "11.9.6", - "resolved": "https://registry.npmjs.org/@types/node/-/node-11.9.6.tgz", - "integrity": "sha512-4hS2K4gwo9/aXIcoYxCtHpdgd8XUeDmo1siRCAH3RziXB65JlPqUFMtfy9VPj+og7dp3w1TFjGwYga4e0m9GwA==" + "version": "11.10.4", + "resolved": "https://registry.npmjs.org/@types/node/-/node-11.10.4.tgz", + "integrity": "sha512-wa09itaLE8L705aXd8F80jnFpxz3Y1/KRHfKsYL2bPc0XF+wEWu8sR9n5bmeu8Ba1N9z2GRNzm/YdHcghLkLKg==" }, "@types/prop-types": { "version": "15.7.0", @@ -1285,9 +1208,9 @@ } }, "@types/styled-components": { - "version": "4.1.11", - "resolved": "https://registry.npmjs.org/@types/styled-components/-/styled-components-4.1.11.tgz", - "integrity": "sha512-AMuEwRLqV8T9T7+OV7KnMMODKRxcEAEDGd59pJDFcjx9TTVQmUzBqw7TtNVGh1poxJsm3Iv7SURpgdUr28E7Xw==", + "version": "4.1.12", + "resolved": "https://registry.npmjs.org/@types/styled-components/-/styled-components-4.1.12.tgz", + "integrity": "sha512-Du0bltHm5sWkDnXzYi6cMNhnSKWHQW6//at359DtRJNfjeG1SdtqQPX6jiVtrUkBJ1JsjxqT18DssYBLJ/fg/A==", "dev": true, "requires": { "@types/react": "*", @@ -1582,6 +1505,12 @@ "integrity": "sha512-HJ7CfNHrfJLlNTzIEUTj43LNWGkqpRLxm3YjAlcD0ACydk9XynzYsCBHxut+iqt+1aBXkx9UP/w/ZqMr13XIzg==", "dev": true }, + "acorn-walk": { + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-6.1.1.tgz", + "integrity": "sha512-OtUw6JUTgxA2QoqqmrmQ7F2NYqiBPi/L2jqHyFtllhOUvXYQXf0Z1CYUinIfyT4bTCGmrA7gX9FvHA81uzCoVw==", + "dev": true + }, "ajv": { "version": "6.9.2", "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.9.2.tgz", @@ -2652,12 +2581,76 @@ } }, "clean-webpack-plugin": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/clean-webpack-plugin/-/clean-webpack-plugin-1.0.1.tgz", - "integrity": "sha512-gvwfMsqu3HBgTVvaBa1H3AZKO03CHpr5uP92SPIktP3827EovAitwW+1xoqXyTxCuXnLYpMHG5ytS4AoukHDWA==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/clean-webpack-plugin/-/clean-webpack-plugin-2.0.0.tgz", + "integrity": "sha512-xH9RUgXaeeW2VmtygwcGNFAmYzRrv93uHk+c5gYA4qHmX1gpRfjScsvvCT7PcUb0Z5Y30H/pswTM1qYApVLBXA==", "dev": true, "requires": { - "rimraf": "^2.6.1" + "del": "^4.0.0" + }, + "dependencies": { + "del": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/del/-/del-4.0.0.tgz", + "integrity": "sha512-/BnSJ+SuZyLu7xMn48kZY0nMXDi+5KNmR4g8n21Wivsl8+B9njV6/5kcTNE9juSprp0zRWBU28JuHUq0FqK1Nw==", + "dev": true, + "requires": { + "globby": "^6.1.0", + "is-path-cwd": "^2.0.0", + "is-path-in-cwd": "^2.0.0", + "p-map": "^2.0.0", + "pify": "^4.0.1", + "rimraf": "^2.6.2" + } + }, + "globby": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/globby/-/globby-6.1.0.tgz", + "integrity": "sha1-9abXDoOV4hyFj7BInWTfAkJNUGw=", + "dev": true, + "requires": { + "array-union": "^1.0.1", + "glob": "^7.0.3", + "object-assign": "^4.0.1", + "pify": "^2.0.0", + "pinkie-promise": "^2.0.0" + }, + "dependencies": { + "pify": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", + "dev": true + } + } + }, + "is-path-cwd": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-path-cwd/-/is-path-cwd-2.0.0.tgz", + "integrity": "sha512-m5dHHzpOXEiv18JEORttBO64UgTEypx99vCxQLjbBvGhOJxnTNglYoFXxwo6AbsQb79sqqycQEHv2hWkHZAijA==", + "dev": true + }, + "is-path-in-cwd": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-path-in-cwd/-/is-path-in-cwd-2.0.0.tgz", + "integrity": "sha512-6Vz5Gc9s/sDA3JBVu0FzWufm8xaBsqy1zn8Q6gmvGP6nSDMw78aS4poBNeatWjaRpTpxxLn1WOndAiOlk+qY8A==", + "dev": true, + "requires": { + "is-path-inside": "^1.0.0" + } + }, + "p-map": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/p-map/-/p-map-2.0.0.tgz", + "integrity": "sha512-GO107XdrSUmtHxVoi60qc9tUl/KkNKm+X2CF4P9amalpGxv5YqVPJNfSb0wcA+syCopkZvYYIzW8OVTQW59x/w==", + "dev": true + }, + "pify": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz", + "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==", + "dev": true + } } }, "cli-cursor": { @@ -3834,9 +3827,9 @@ "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=" }, "eslint": { - "version": "5.14.1", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-5.14.1.tgz", - "integrity": "sha512-CyUMbmsjxedx8B0mr79mNOqetvkbij/zrXnFeK2zc3pGRn3/tibjiNAv/3UxFEyfMDjh+ZqTrJrEGBFiGfD5Og==", + "version": "5.15.1", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-5.15.1.tgz", + "integrity": "sha512-NTcm6vQ+PTgN3UBsALw5BMhgO6i5EpIjQF/Xb5tIh3sk9QhrFafujUOczGz4J24JBlzWclSB9Vmx8d+9Z6bFCg==", "dev": true, "requires": { "@babel/code-frame": "^7.0.0", @@ -3845,7 +3838,7 @@ "cross-spawn": "^6.0.5", "debug": "^4.0.1", "doctrine": "^3.0.0", - "eslint-scope": "^4.0.0", + "eslint-scope": "^4.0.2", "eslint-utils": "^1.3.1", "eslint-visitor-keys": "^1.0.0", "espree": "^5.0.1", @@ -3886,6 +3879,16 @@ "ms": "^2.1.1" } }, + "eslint-scope": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-4.0.2.tgz", + "integrity": "sha512-5q1+B/ogmHl8+paxtOKx38Z8LtWkVGuNt3+GQNErqwLl6ViNp/gdJGMCjZNxZ8j/VYjDNZ2Fo+eQc1TAVPIzbg==", + "dev": true, + "requires": { + "esrecurse": "^4.1.0", + "estraverse": "^4.1.1" + } + }, "ignore": { "version": "4.0.6", "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", @@ -3919,9 +3922,9 @@ } }, "eslint-plugin-react-hooks": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-1.3.0.tgz", - "integrity": "sha512-hjgyNq0sfDXaLkXHkmo3vRh+p+42lwQIU3r56hVoomMYRMToJ2D/PGhwL2EPyB5ZEMlbLsRm3s5v4gm5FIjlvg==", + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-1.4.0.tgz", + "integrity": "sha512-fMGlzztW/5hSQT0UBnlPwulao0uF8Kyp0Uv6PA81lzmcDz2LBtthkWQaE8Wz2F2kEe7mSRDgK8ABEFK1ipeDxw==", "dev": true }, "eslint-scope": { @@ -6617,12 +6620,11 @@ } }, "lint-staged": { - "version": "8.1.4", - "resolved": "https://registry.npmjs.org/lint-staged/-/lint-staged-8.1.4.tgz", - "integrity": "sha512-oFbbhB/VzN8B3i/sIdb9gMfngGArI6jIfxSn+WPdQb2Ni3GJeS6T4j5VriSbQfxfMuYoQlMHOoFt+lfcWV0HfA==", + "version": "8.1.5", + "resolved": "https://registry.npmjs.org/lint-staged/-/lint-staged-8.1.5.tgz", + "integrity": "sha512-e5ZavfnSLcBJE1BTzRTqw6ly8OkqVyO3GL2M6teSmTBYQ/2BuueD5GIt2RPsP31u/vjKdexUyDCxSyK75q4BDA==", "dev": true, "requires": { - "@iamstarkov/listr-update-renderer": "0.4.1", "chalk": "^2.3.1", "commander": "^2.14.1", "cosmiconfig": "^5.0.2", @@ -6635,6 +6637,7 @@ "is-glob": "^4.0.0", "is-windows": "^1.0.2", "listr": "^0.14.2", + "listr-update-renderer": "^0.5.0", "lodash": "^4.17.11", "log-symbols": "^2.2.0", "micromatch": "^3.1.8", @@ -8265,14 +8268,14 @@ } }, "react": { - "version": "16.8.3", - "resolved": "https://registry.npmjs.org/react/-/react-16.8.3.tgz", - "integrity": "sha512-3UoSIsEq8yTJuSu0luO1QQWYbgGEILm+eJl2QN/VLDi7hL+EN18M3q3oVZwmVzzBJ3DkM7RMdRwBmZZ+b4IzSA==", + "version": "16.8.4", + "resolved": "https://registry.npmjs.org/react/-/react-16.8.4.tgz", + "integrity": "sha512-0GQ6gFXfUH7aZcjGVymlPOASTuSjlQL4ZtVC5YKH+3JL6bBLCVO21DknzmaPlI90LN253ojj02nsapy+j7wIjg==", "requires": { "loose-envify": "^1.1.0", "object-assign": "^4.1.1", "prop-types": "^15.6.2", - "scheduler": "^0.13.3" + "scheduler": "^0.13.4" } }, "react-cropper": { @@ -8286,14 +8289,14 @@ } }, "react-dom": { - "version": "16.8.3", - "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-16.8.3.tgz", - "integrity": "sha512-ttMem9yJL4/lpItZAQ2NTFAbV7frotHk5DZEHXUOws2rMmrsvh1Na7ThGT0dTzUIl6pqTOi5tYREfL8AEna3lA==", + "version": "16.8.4", + "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-16.8.4.tgz", + "integrity": "sha512-Ob2wK7XG2tUDt7ps7LtLzGYYB6DXMCLj0G5fO6WeEICtT4/HdpOi7W/xLzZnR6RCG1tYza60nMdqtxzA8FaPJQ==", "requires": { "loose-envify": "^1.1.0", "object-assign": "^4.1.1", "prop-types": "^15.6.2", - "scheduler": "^0.13.3" + "scheduler": "^0.13.4" } }, "react-event-listener": { @@ -8317,9 +8320,9 @@ "integrity": "sha512-fBASbA6LnOU9dOU2eW7aQ8xmYBSXUIWr+UmF9b1efZBazGNO+rcXT/icdKnYm2pTwcRylVUYwW7H1PHfLekVzA==" }, "react-spring": { - "version": "8.0.9", - "resolved": "https://registry.npmjs.org/react-spring/-/react-spring-8.0.9.tgz", - "integrity": "sha512-ii1NhZnKifyser174wH5uJJmGQUdqxl4Fs0ilXXUjKmJbaHF1Cmxv8aabTUh2MzRQ2/tx54JBiF4GTKTinnCzw==", + "version": "8.0.11", + "resolved": "https://registry.npmjs.org/react-spring/-/react-spring-8.0.11.tgz", + "integrity": "sha512-CCW4Nj6pWJyZrBp/PWF1PopI9x0lj+6imx4sWzzPLXYoLuhUQbbYQgcNRh6KvshwiGJJABlVREUIB/Tm8/36/g==", "requires": { "@babel/runtime": "^7.3.1" } @@ -8771,9 +8774,9 @@ "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" }, "scheduler": { - "version": "0.13.3", - "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.13.3.tgz", - "integrity": "sha512-UxN5QRYWtpR1egNWzJcVLk8jlegxAugswQc984lD3kU7NuobsO37/sRfbpTdBjtnD5TBNFA2Q2oLV5+UmPSmEQ==", + "version": "0.13.4", + "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.13.4.tgz", + "integrity": "sha512-cvSOlRPxOHs5dAhP9yiS/6IDmVAVxmk33f0CtTJRkmUWcb1Us+t7b1wqdzoC0REw2muC9V5f1L/w5R5uKGaepA==", "requires": { "loose-envify": "^1.1.0", "object-assign": "^4.1.1" @@ -10359,12 +10362,13 @@ } }, "webpack-bundle-analyzer": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/webpack-bundle-analyzer/-/webpack-bundle-analyzer-3.0.4.tgz", - "integrity": "sha512-ggDUgtKuQki4vmc93Ej65GlYxeCUR/0THa7gA+iqAGC2FFAxO+r+RM9sAUa8HWdw4gJ3/NZHX/QUcVgRjdIsDg==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/webpack-bundle-analyzer/-/webpack-bundle-analyzer-3.1.0.tgz", + "integrity": "sha512-nyDyWEs7C6DZlgvu1pR1zzJfIWSiGPbtaByZr8q+Fd2xp70FuM/8ngCJzj3Er1TYRLSFmp1F1OInbEm4DZH8NA==", "dev": true, "requires": { - "acorn": "^5.7.3", + "acorn": "^6.0.7", + "acorn-walk": "^6.1.1", "bfj": "^6.1.1", "chalk": "^2.4.1", "commander": "^2.18.0", @@ -10378,12 +10382,6 @@ "ws": "^6.0.0" }, "dependencies": { - "acorn": { - "version": "5.7.3", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.7.3.tgz", - "integrity": "sha512-T/zvzYRfbVojPWahDsE5evJdHb3oJoQfFbsrKM7w5Zcs++Tr257tia3BmMP8XYVjp1S9RZXQMh7gao96BlqZOw==", - "dev": true - }, "commander": { "version": "2.19.0", "resolved": "https://registry.npmjs.org/commander/-/commander-2.19.0.tgz", diff --git a/package.json b/package.json index 072baef..1656700 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,7 @@ "dependencies": { "@aspnet/signalr": "^1.1.2", "@cc98/ubb-core": "1.1.0", - "@material-ui/core": "^4.0.0-alpha.1", + "@material-ui/core": "^4.0.0-alpha.2", "@material-ui/icons": "^3.0.2", "@material-ui/styles": "^3.0.0-alpha.10", "@reach/router": "^1.2.1", @@ -31,10 +31,10 @@ "dayjs": "^1.8.8", "dplayer": "^1.25.0", "lodash-es": "^4.17.11", - "react": "16.8.3", + "react": "16.8.4", "react-cropper": "^1.2.0", - "react-dom": "16.8.3", - "react-spring": "^8.0.9", + "react-dom": "16.8.4", + "react-spring": "^8.0.11", "remark": "^10.0.1", "remark-react": "^5.0.1", "styled-components": "^4.1.3", @@ -49,13 +49,13 @@ "@babel/preset-env": "^7.3.4", "@babel/preset-react": "^7.0.0", "@babel/preset-typescript": "^7.3.3", - "@types/lodash-es": "^4.17.2", - "@types/node": "^11.9.6", + "@types/lodash-es": "^4.17.3", + "@types/node": "^11.10.4", "@types/reach__router": "^1.2.3", "@types/react": "^16.8.6", "@types/react-cropper": "^0.10.4", "@types/react-dom": "^16.8.2", - "@types/styled-components": "^4.1.11", + "@types/styled-components": "^4.1.12", "@types/url-parse": "^1.4.3", "@typescript-eslint/eslint-plugin": "^1.4.2", "@typescript-eslint/parser": "^1.4.2", @@ -63,25 +63,25 @@ "babel-loader": "^8.0.5", "babel-plugin-styled-components": "^1.10.0", "babel-plugin-transform-imports": "^1.5.1", - "clean-webpack-plugin": "^1.0.1", + "clean-webpack-plugin": "^2.0.0", "copy-webpack-plugin": "^5.0.0", "cross-env": "^5.2.0", "css-loader": "^2.1.0", - "eslint": "^5.14.1", + "eslint": "^5.15.1", "eslint-config-alloy": "^1.4.2", "eslint-config-prettier": "^4.1.0", - "eslint-plugin-react-hooks": "^1.3.0", + "eslint-plugin-react-hooks": "^1.4.0", "file-loader": "^3.0.1", "html-webpack-plugin": "^4.0.0-beta.5", "husky": "^1.3.1", - "lint-staged": "^8.1.4", + "lint-staged": "^8.1.5", "prettier": "^1.16.4", "style-loader": "^0.23.1", "terser-webpack-plugin": "^1.2.3", "typescript": "^3.3.3333", "url-loader": "^1.1.2", "webpack": "^4.29.6", - "webpack-bundle-analyzer": "^3.0.4", + "webpack-bundle-analyzer": "^3.1.0", "webpack-cli": "^3.2.3", "webpack-dev-server": "^3.2.1", "webpack-merge": "^4.2.1", diff --git a/src/components/BackGround/index.tsx b/src/components/BackGround/index.tsx index 0bf9039..37bc51f 100644 --- a/src/components/BackGround/index.tsx +++ b/src/components/BackGround/index.tsx @@ -17,10 +17,6 @@ const Background = muiStyled(Paper).attrs({ // 该占位符高度和 TopBar 保持一致 const Placeholder = styled.div` height: 56px; - - @media (min-width: 600px) { - height: 64px; - } ` const BackGround: React.FC = ({ children }) => ( diff --git a/src/hooks/useModel.ts b/src/hooks/useModel.ts index bc703e7..552b685 100644 --- a/src/hooks/useModel.ts +++ b/src/hooks/useModel.ts @@ -21,13 +21,11 @@ export class Model { /** * just like setState in react * @param state_or_updater - * @param callback */ setState( updater: | ((prevState: Readonly) => Pick | State | null) - | (Pick | State | null), - callback?: () => void + | (Pick | State | null) ) { let nextState: Pick | State | null @@ -40,20 +38,14 @@ export class Model { // (v == null) equal to (v === null || v === undefined) // this will prevent broadcast if (nextState == null) { - if (callback) callback() - - return Promise.resolve() + return } this._prevState = this.state this.state = Object.assign({}, this.state, nextState) - const promises = this._listeners.map(listener => listener(this._prevState, this.state)) - - return Promise.all(promises).then(() => { - if (callback) { - return callback() - } + this._listeners.forEach(listener => { + listener(this._prevState, this.state) }) } } diff --git a/src/models/setting.ts b/src/models/setting.ts index 06dafd5..179bbaf 100644 --- a/src/models/setting.ts +++ b/src/models/setting.ts @@ -41,39 +41,31 @@ class SettingModel extends Model { } TOGGLE_THEME = () => { - this.setState( - state => ({ - theme: state.theme === 'light' ? 'dark' : 'light', - }), - this.SYNC_SETTING - ) + this.setState(state => ({ + theme: state.theme === 'light' ? 'dark' : 'light', + })) + this.SYNC_SETTING() } TOGGLE_SIGNALR = () => { - this.setState( - state => ({ - useSignalr: !state.useSignalr, - }), - this.SYNC_SETTING - ) + this.setState(state => ({ + useSignalr: !state.useSignalr, + })) + this.SYNC_SETTING() } CHANGE_CACHE = (size: number) => { - this.setState( - { - cacheSize: size, - }, - this.SYNC_SETTING - ) + this.setState({ + cacheSize: size, + }) + this.SYNC_SETTING() } CHANGE_CUSTOMHOME = (value: number) => { - this.setState( - { - customHome: value, - }, - this.SYNC_SETTING - ) + this.setState({ + customHome: value, + }) + this.SYNC_SETTING() } } diff --git a/src/models/user.ts b/src/models/user.ts index 163abfa..bd1b094 100644 --- a/src/models/user.ts +++ b/src/models/user.ts @@ -31,12 +31,10 @@ class UserModel extends Model { const token = await logIn(username, password) token.fail().succeed(_ => { - this.setState( - { - isLogIn: true, - }, - this.FRESH_INFO - ) + this.setState({ + isLogIn: true, + }) + this.FRESH_INFO() }) return token diff --git a/src/pages/Board/components/BoardItemHead.tsx b/src/pages/Board/components/BoardItemHead.tsx index 2813437..b8c2b37 100644 --- a/src/pages/Board/components/BoardItemHead.tsx +++ b/src/pages/Board/components/BoardItemHead.tsx @@ -23,10 +23,6 @@ const Wrapper = muiStyled(Paper).attrs({ paddingRight: 0, /* z-index of TopBar is 1100 and DrawerMenu is 1200 */ zIndex: 1105, - - '@media (min-width: 600px)': { - height: 64, - }, }) const GobackIcon = muiStyled(IconButton)({ diff --git a/src/pages/Editor/Editor/ToolBox/StickerBox.tsx b/src/pages/Editor/Editor/ToolBox/StickerBox.tsx index 6eb52e8..730eb3c 100644 --- a/src/pages/Editor/Editor/ToolBox/StickerBox.tsx +++ b/src/pages/Editor/Editor/ToolBox/StickerBox.tsx @@ -79,8 +79,6 @@ export default ({ editor, handleClose }: Props) => { return ( <> - {/* - // @ts-ignore */} { return ( <> - {/* - // @ts-ignore */} { return ( <> - {/* - // @ts-ignore */} { this.setState({ locationStates }) } + + /** + * 删除最后一个路由(配合 replace 使用 + */ + POP() { + const { locationStates } = this.state + locationStates.pop() + + this.setState({ locationStates }) + } } /** diff --git a/src/services/utils/errorHandler.ts b/src/services/utils/errorHandler.ts index cc9c3dd..d3df6ed 100644 --- a/src/services/utils/errorHandler.ts +++ b/src/services/utils/errorHandler.ts @@ -18,15 +18,15 @@ export function notificationHandler(err: FetchError) { export function navigateHandler(err: FetchError) { if (err.status === 400) { - navigate('/error/400') + navigate('/error/400', { replace: true }) } else if (err.status === 401) { - navigate('/error/401') + navigate('/error/401', { replace: true }) } else if (err.status === 403) { - navigate('/error/403') + navigate('/error/403', { replace: true }) } else if (err.status === 404) { - navigate('/error/404') + navigate('/error/404', { replace: true }) } else if (err.status === 500 || err.status === 502 || err.status === 503) { - navigate('/error/500') + navigate('/error/500', { replace: true }) } } diff --git a/src/utils/history.ts b/src/utils/history.ts index 2570559..fcb8756 100644 --- a/src/utils/history.ts +++ b/src/utils/history.ts @@ -1,6 +1,5 @@ import { navigate as reachNavigate, NavigateOptions } from '@reach/router' - -// TODO: 忽略不需要 cache 的页面 +import { routerModel } from '@/router' /** * 路由跳转到对应 URL @@ -8,6 +7,10 @@ import { navigate as reachNavigate, NavigateOptions } from '@reach/router' * @param options */ export function navigate(url: string, options?: NavigateOptions<{}>) { + if (options && options.replace) { + routerModel.POP() + } + reachNavigate(url, options) }