diff --git a/.babelrc b/.babelrc deleted file mode 100644 index 8f4cafb..0000000 --- a/.babelrc +++ /dev/null @@ -1,18 +0,0 @@ -{ - "presets": [ - ["@babel/env", { - "modules": false, - "targets": { "esmodules": true } - }], - "@babel/react", - "@babel/typescript" - ], - "plugins": [ - ["@babel/plugin-proposal-class-properties", { "loose": true }], - ["transform-imports", { - "@material-ui/core": { "transform": "@material-ui/core/${member}" }, - "lodash-es": { "transform": "lodash-es/${member}" } - }], - ["babel-plugin-styled-components", { "ssr": false }] - ] -} diff --git a/.browserslistrc b/.browserslistrc new file mode 100644 index 0000000..6ed2e33 --- /dev/null +++ b/.browserslistrc @@ -0,0 +1,10 @@ +# Browsers that we support + +ios 10.3 +Android > 67 + +last 2 version +> 1% in CN + +not dead +not IE > 0 diff --git a/babel.config.js b/babel.config.js new file mode 100644 index 0000000..a02f2ca --- /dev/null +++ b/babel.config.js @@ -0,0 +1,31 @@ +const presets = [ + ["@babel/env", { + "debug": process.env.NODE_ENV === "production", + "modules": false, + }], + "@babel/react", + "@babel/typescript", +] + +const plugins = [ + ["@babel/plugin-transform-runtime"], + ["@babel/plugin-proposal-class-properties", { + "loose": true + }], + ["transform-imports", { + "@material-ui/core": { + "transform": "@material-ui/core/es/${member}" + }, + "lodash-es": { + "transform": "lodash-es/${member}" + } + }], + ["babel-plugin-styled-components", { + "ssr": false + }], +] + +module.exports = { + presets, + plugins, +} diff --git a/config/webpack.dev.js b/config/webpack.dev.js index 3f815ea..8b8d317 100644 --- a/config/webpack.dev.js +++ b/config/webpack.dev.js @@ -17,6 +17,7 @@ module.exports = merge(common, { devtool: 'eval-source-map', devServer: { + disableHostCheck: true, historyApiFallback: true, port: 9898, host: '0.0.0.0', diff --git a/package-lock.json b/package-lock.json index 6a9721c..654cf50 100644 --- a/package-lock.json +++ b/package-lock.json @@ -682,6 +682,18 @@ "regenerator-transform": "^0.13.3" } }, + "@babel/plugin-transform-runtime": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-runtime/-/plugin-transform-runtime-7.2.0.tgz", + "integrity": "sha512-jIgkljDdq4RYDnJyQsiWbdvGeei/0MOTtSHKO/rfbd/mXBxNpdlulMx49L0HQ4pug1fXannxoqCI+fYSle9eSw==", + "dev": true, + "requires": { + "@babel/helper-module-imports": "^7.0.0", + "@babel/helper-plugin-utils": "^7.0.0", + "resolve": "^1.8.1", + "semver": "^5.5.1" + } + }, "@babel/plugin-transform-shorthand-properties": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.2.0.tgz", @@ -992,9 +1004,9 @@ } }, "@material-ui/core": { - "version": "3.7.0", - "resolved": "https://registry.npmjs.org/@material-ui/core/-/core-3.7.0.tgz", - "integrity": "sha512-Eac2JlwL8oG6ns2ay5L5mvqx8HUmbSnLj2zqsakdi/7h52wuJj6u+Zz0UCHe2UCowiEcmjJ2Tz9iVpLrKrp2sw==", + "version": "3.7.1", + "resolved": "https://registry.npmjs.org/@material-ui/core/-/core-3.7.1.tgz", + "integrity": "sha512-CjIGwvzn84BgzXWzC9M/Tz2gDI7AfUe3G1JXkZQAVy+ddPikh+iZwn5snnElfcjuC+ahXxaIyK49ARt3NM49vQ==", "requires": { "@babel/runtime": "7.2.0", "@material-ui/utils": "^3.0.0-alpha.1", @@ -1008,7 +1020,7 @@ "dom-helpers": "^3.2.1", "hoist-non-react-statics": "^3.2.1", "is-plain-object": "^2.0.4", - "jss": "^9.3.3", + "jss": "^9.8.7", "jss-camel-case": "^6.0.0", "jss-default-unit": "^8.0.2", "jss-global": "^3.0.0", @@ -7882,6 +7894,14 @@ "resolved": "https://registry.npmjs.org/react-lifecycles-compat/-/react-lifecycles-compat-3.0.4.tgz", "integrity": "sha512-fBASbA6LnOU9dOU2eW7aQ8xmYBSXUIWr+UmF9b1efZBazGNO+rcXT/icdKnYm2pTwcRylVUYwW7H1PHfLekVzA==" }, + "react-spring": { + "version": "7.2.5", + "resolved": "https://registry.npmjs.org/react-spring/-/react-spring-7.2.5.tgz", + "integrity": "sha512-J14PEJmkTOKLqN03+y7nM9szUrnQhZnapyQu4Tr8Ncq5wpKUB4ASZ4pRU/amNVKf0WVPkYeD62FqZFIrDjELJg==", + "requires": { + "@babel/runtime": "^7.0.0" + } + }, "react-transition-group": { "version": "2.5.2", "resolved": "https://registry.npmjs.org/react-transition-group/-/react-transition-group-2.5.2.tgz", diff --git a/package.json b/package.json index 1178918..aa822ba 100644 --- a/package.json +++ b/package.json @@ -16,7 +16,7 @@ "dependencies": { "@aspnet/signalr": "^1.1.0", "@cc98/ubb-core": "1.1.0", - "@material-ui/core": "^3.7.0", + "@material-ui/core": "^3.7.1", "@material-ui/icons": "^3.0.1", "@reach/router": "^1.2.1", "@sentry/browser": "^4.4.2", @@ -25,6 +25,7 @@ "lodash-es": "^4.17.11", "react": "16.7.0-alpha.2", "react-dom": "16.7.0-alpha.2", + "react-spring": "^7.2.5", "remark": "^10.0.1", "remark-react": "^5.0.1", "styled-components": "^4.1.3", @@ -34,6 +35,7 @@ "devDependencies": { "@babel/core": "^7.2.2", "@babel/plugin-proposal-class-properties": "^7.2.3", + "@babel/plugin-transform-runtime": "^7.2.0", "@babel/preset-env": "^7.2.3", "@babel/preset-react": "^7.0.0", "@babel/preset-typescript": "^7.1.0", diff --git a/src/@types/@cc98/IConfig.d.ts b/src/@types/@cc98/IConfig.d.ts index 0531c7d..7a5663e 100644 --- a/src/@types/@cc98/IConfig.d.ts +++ b/src/@types/@cc98/IConfig.d.ts @@ -37,7 +37,7 @@ declare module '@cc98/api' { /** * 推荐功能 */ - recommendationFunction: Array + recommendationFunction: any[] /** * 推荐阅读 */ diff --git a/src/UBB/handlerHub/specificTagHandlers/bili.tsx b/src/UBB/handlerHub/specificTagHandlers/bili.tsx index e8ee400..046d93e 100644 --- a/src/UBB/handlerHub/specificTagHandlers/bili.tsx +++ b/src/UBB/handlerHub/specificTagHandlers/bili.tsx @@ -12,20 +12,11 @@ const handler: ITagHandler = { const { bili } = node.tagData const partNumber = parseInt(bili, 10) || 1 - const props = { - border: 0, - frameborder: 'no', - framespacing: 0, - allowfullscreen: true, - } - return (