diff --git a/package-lock.json b/package-lock.json index 2ab5317..ce0c0ad 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,6 +9,7 @@ "version": "1.0.0", "license": "MIT", "dependencies": { + "@chaitin_rivers/multi_river": "^0.0.3", "@emotion/cache": "^11.11.0", "@emotion/react": "^11.11.0", "@emotion/server": "^11.11.0", @@ -114,6 +115,23 @@ "npm": ">=8.0.0" } }, + ".yalc/multi_river": { + "version": "0.0.1", + "extraneous": true, + "license": "MIT", + "dependencies": { + "@mui/icons-material": "^5.15.3", + "react-copy-to-clipboard": "^5.1.0", + "react-router-dom": "^6.21.1" + }, + "peerDependencies": { + "@emotion/styled": "^11.11.0", + "@mui/material": "^5.15.3", + "next": ">=14.0.4", + "react": ">=16.9.0", + "react-dom": ">=16.9.0" + } + }, "node_modules/@aashutoshrathi/word-wrap": { "version": "1.2.6", "resolved": "https://registry.npmmirror.com/@aashutoshrathi/word-wrap/-/word-wrap-1.2.6.tgz", @@ -657,6 +675,25 @@ "node": ">=6.9.0" } }, + "node_modules/@chaitin_rivers/multi_river": { + "version": "0.0.3", + "resolved": "https://registry.npmmirror.com/@chaitin_rivers/multi_river/-/multi_river-0.0.3.tgz", + "integrity": "sha512-DJ46R3Vki+E1GNZ73DxJYTVNQYQ+UO6HffEAqTwZMdecvoQp9tj8imI1HPSxleIMKfOfCRVqogMzYK2IQC5ULw==", + "dependencies": { + "@mui/icons-material": "^5.15.3", + "react-copy-to-clipboard": "^5.1.0" + }, + "optionalDependencies": { + "next": ">=14.0.4", + "react-router-dom": "^6.21.1" + }, + "peerDependencies": { + "@emotion/styled": "^11.11.0", + "@mui/material": "^5.15.3", + "react": ">=16.9.0", + "react-dom": ">=16.9.0" + } + }, "node_modules/@commitlint/cli": { "version": "18.4.3", "resolved": "https://registry.npmmirror.com/@commitlint/cli/-/cli-18.4.3.tgz", @@ -1518,16 +1555,16 @@ } }, "node_modules/@mui/core-downloads-tracker": { - "version": "5.15.1", - "resolved": "https://registry.npmmirror.com/@mui/core-downloads-tracker/-/core-downloads-tracker-5.15.1.tgz", - "integrity": "sha512-y/nUEsWHyBzaKYp9zLtqJKrLod/zMNEWpMj488FuQY9QTmqBiyUhI2uh7PVaLqLewXRtdmG6JV0b6T5exyuYRw==" + "version": "5.15.3", + "resolved": "https://registry.npmmirror.com/@mui/core-downloads-tracker/-/core-downloads-tracker-5.15.3.tgz", + "integrity": "sha512-sWeihiVyxdJjpLkp8SHkTy9kt2M/o11M60G1MzwljGL2BXdM3Ktzqv5QaQHdi00y7Y1ulvtI3GOSxP2xU8mQJw==" }, "node_modules/@mui/icons-material": { - "version": "5.15.1", - "resolved": "https://registry.npmmirror.com/@mui/icons-material/-/icons-material-5.15.1.tgz", - "integrity": "sha512-VPJdBSyap6uOxCb5BLbWbkvd6aeJCp1pQZm8DcZBITCH0NOSv8Mz9c8Zvo8xr4Od7+xyWHUAgvRSL4047pL2WQ==", + "version": "5.15.3", + "resolved": "https://registry.npmmirror.com/@mui/icons-material/-/icons-material-5.15.3.tgz", + "integrity": "sha512-7LEs8AnO2Se/XYH+CcJndRsGAE+M8KAExiiQHf0V11poqmPVGcbbY82Ry2IUYf9+rOilCVnWI18ErghZ625BPQ==", "dependencies": { - "@babel/runtime": "^7.23.5" + "@babel/runtime": "^7.23.6" }, "engines": { "node": ">=12.0.0" @@ -1580,16 +1617,16 @@ } }, "node_modules/@mui/material": { - "version": "5.15.1", - "resolved": "https://registry.npmmirror.com/@mui/material/-/material-5.15.1.tgz", - "integrity": "sha512-WA5DVyvacxDakVyAhNqu/rRT28ppuuUFFw1bLpmRzrCJ4uw/zLTATcd4WB3YbB+7MdZNEGG/SJNWTDLEIyn3xQ==", - "dependencies": { - "@babel/runtime": "^7.23.5", - "@mui/base": "5.0.0-beta.28", - "@mui/core-downloads-tracker": "^5.15.1", - "@mui/system": "^5.15.1", - "@mui/types": "^7.2.11", - "@mui/utils": "^5.15.1", + "version": "5.15.3", + "resolved": "https://registry.npmmirror.com/@mui/material/-/material-5.15.3.tgz", + "integrity": "sha512-DODBBMouyq1B5f3YkEWL9vO8pGCxuEGqtfpltF6peMJzz/78tJFyLQsDas9MNLC/8AdFu2BQdkK7wox5UBPTAA==", + "dependencies": { + "@babel/runtime": "^7.23.6", + "@mui/base": "5.0.0-beta.30", + "@mui/core-downloads-tracker": "^5.15.3", + "@mui/system": "^5.15.3", + "@mui/types": "^7.2.12", + "@mui/utils": "^5.15.3", "@types/react-transition-group": "^4.4.10", "clsx": "^2.0.0", "csstype": "^3.1.2", @@ -1619,13 +1656,40 @@ } } }, + "node_modules/@mui/material/node_modules/@mui/base": { + "version": "5.0.0-beta.30", + "resolved": "https://registry.npmmirror.com/@mui/base/-/base-5.0.0-beta.30.tgz", + "integrity": "sha512-dc38W4W3K42atE9nSaOeoJ7/x9wGIfawdwC/UmMxMLlZ1iSsITQ8dQJaTATCbn98YvYPINK/EH541YA5enQIPQ==", + "dependencies": { + "@babel/runtime": "^7.23.6", + "@floating-ui/react-dom": "^2.0.4", + "@mui/types": "^7.2.12", + "@mui/utils": "^5.15.3", + "@popperjs/core": "^2.11.8", + "clsx": "^2.0.0", + "prop-types": "^15.8.1" + }, + "engines": { + "node": ">=12.0.0" + }, + "peerDependencies": { + "@types/react": "^17.0.0 || ^18.0.0", + "react": "^17.0.0 || ^18.0.0", + "react-dom": "^17.0.0 || ^18.0.0" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, "node_modules/@mui/private-theming": { - "version": "5.15.1", - "resolved": "https://registry.npmmirror.com/@mui/private-theming/-/private-theming-5.15.1.tgz", - "integrity": "sha512-wTbzuy5KjSvCPE9UVJktWHJ0b/tD5biavY9wvF+OpYDLPpdXK52vc1hTDxSbdkHIFMkJExzrwO9GvpVAHZBnFQ==", + "version": "5.15.3", + "resolved": "https://registry.npmmirror.com/@mui/private-theming/-/private-theming-5.15.3.tgz", + "integrity": "sha512-Q79MhVMmywC1l5bMsMZq5PsIudr1MNPJnx9/EqdMP0vpz5iNvFpnLmxsD7d8/hqTWgFAljI+LH3jX8MxlZH9Gw==", "dependencies": { - "@babel/runtime": "^7.23.5", - "@mui/utils": "^5.15.1", + "@babel/runtime": "^7.23.6", + "@mui/utils": "^5.15.3", "prop-types": "^15.8.1" }, "engines": { @@ -1642,11 +1706,11 @@ } }, "node_modules/@mui/styled-engine": { - "version": "5.15.1", - "resolved": "https://registry.npmmirror.com/@mui/styled-engine/-/styled-engine-5.15.1.tgz", - "integrity": "sha512-7WDZTJLqGexWDjqE9oAgjU8ak6hEtUw2yQU7SIYID5kLVO2Nj/Wi/KicbLsXnTsJNvSqePIlUIWTBSXwWJCPZw==", + "version": "5.15.3", + "resolved": "https://registry.npmmirror.com/@mui/styled-engine/-/styled-engine-5.15.3.tgz", + "integrity": "sha512-+d5XZCTeemOO/vBfWGEeHgTm8fjU1Psdgm+xAw+uegycO2EnoA/EfGSaG5UwZ6g3b66y48Mkxi35AggShMr88w==", "dependencies": { - "@babel/runtime": "^7.23.5", + "@babel/runtime": "^7.23.6", "@emotion/cache": "^11.11.0", "csstype": "^3.1.2", "prop-types": "^15.8.1" @@ -1669,15 +1733,15 @@ } }, "node_modules/@mui/system": { - "version": "5.15.1", - "resolved": "https://registry.npmmirror.com/@mui/system/-/system-5.15.1.tgz", - "integrity": "sha512-LAnP0ls69rqW9eBgI29phIx/lppv+WDGI7b3EJN7VZIqw0RezA0GD7NRpV12BgEYJABEii6z5Q9B5tg7dsX0Iw==", - "dependencies": { - "@babel/runtime": "^7.23.5", - "@mui/private-theming": "^5.15.1", - "@mui/styled-engine": "^5.15.1", - "@mui/types": "^7.2.11", - "@mui/utils": "^5.15.1", + "version": "5.15.3", + "resolved": "https://registry.npmmirror.com/@mui/system/-/system-5.15.3.tgz", + "integrity": "sha512-ewVU4eRgo4VfNMGpO61cKlfWmH7l9s6rA8EknRzuMX3DbSLfmtW2WJJg6qPwragvpPIir0Pp/AdWVSDhyNy5Tw==", + "dependencies": { + "@babel/runtime": "^7.23.6", + "@mui/private-theming": "^5.15.3", + "@mui/styled-engine": "^5.15.3", + "@mui/types": "^7.2.12", + "@mui/utils": "^5.15.3", "clsx": "^2.0.0", "csstype": "^3.1.2", "prop-types": "^15.8.1" @@ -1704,9 +1768,9 @@ } }, "node_modules/@mui/types": { - "version": "7.2.11", - "resolved": "https://registry.npmmirror.com/@mui/types/-/types-7.2.11.tgz", - "integrity": "sha512-KWe/QTEsFFlFSH+qRYf3zoFEj3z67s+qAuSnMMg+gFwbxG7P96Hm6g300inQL1Wy///gSRb8juX7Wafvp93m3w==", + "version": "7.2.12", + "resolved": "https://registry.npmmirror.com/@mui/types/-/types-7.2.12.tgz", + "integrity": "sha512-3kaHiNm9khCAo0pVe0RenketDSFoZGAlVZ4zDjB/QNZV0XiCj+sh1zkX0VVhQPgYJDlBEzAag+MHJ1tU3vf0Zw==", "peerDependencies": { "@types/react": "^17.0.0 || ^18.0.0" }, @@ -1717,11 +1781,11 @@ } }, "node_modules/@mui/utils": { - "version": "5.15.1", - "resolved": "https://registry.npmmirror.com/@mui/utils/-/utils-5.15.1.tgz", - "integrity": "sha512-V1/d0E3Bju5YdB59HJf2G0tnHrFEvWLN+f8hAXp9+JSNy/LC2zKyqUfPPahflR6qsI681P8G9r4mEZte/SrrYA==", + "version": "5.15.3", + "resolved": "https://registry.npmmirror.com/@mui/utils/-/utils-5.15.3.tgz", + "integrity": "sha512-mT3LiSt9tZWCdx1pl7q4Q5tNo6gdZbvJel286ZHGuj6LQQXjWNAh8qiF9d+LogvNUI+D7eLkTnj605d1zoazfg==", "dependencies": { - "@babel/runtime": "^7.23.5", + "@babel/runtime": "^7.23.6", "@types/prop-types": "^15.7.11", "prop-types": "^15.8.1", "react-is": "^18.2.0" @@ -1955,9 +2019,9 @@ } }, "node_modules/@remix-run/router": { - "version": "1.14.0", - "resolved": "https://registry.npmmirror.com/@remix-run/router/-/router-1.14.0.tgz", - "integrity": "sha512-WOHih+ClN7N8oHk9N4JUiMxQJmRVaOxcg8w7F/oHUXzJt920ekASLI/7cYX8XkntDWRhLZtsk6LbGrkgOAvi5A==", + "version": "1.14.1", + "resolved": "https://registry.npmmirror.com/@remix-run/router/-/router-1.14.1.tgz", + "integrity": "sha512-Qg4DMQsfPNAs88rb2xkdk03N3bjK4jgX5fR24eHCTR9q6PrhZQZ4UJBPzCHJkIpTRN1UKxx2DzjZmnC+7Lj0Ow==", "engines": { "node": ">=14.0.0" } @@ -7783,11 +7847,11 @@ } }, "node_modules/react-router": { - "version": "6.21.0", - "resolved": "https://registry.npmmirror.com/react-router/-/react-router-6.21.0.tgz", - "integrity": "sha512-hGZ0HXbwz3zw52pLZV3j3+ec+m/PQ9cTpBvqjFQmy2XVUWGn5MD+31oXHb6dVTxYzmAeaiUBYjkoNz66n3RGCg==", + "version": "6.21.1", + "resolved": "https://registry.npmmirror.com/react-router/-/react-router-6.21.1.tgz", + "integrity": "sha512-W0l13YlMTm1YrpVIOpjCADJqEUpz1vm+CMo47RuFX4Ftegwm6KOYsL5G3eiE52jnJpKvzm6uB/vTKTPKM8dmkA==", "dependencies": { - "@remix-run/router": "1.14.0" + "@remix-run/router": "1.14.1" }, "engines": { "node": ">=14.0.0" @@ -7797,12 +7861,12 @@ } }, "node_modules/react-router-dom": { - "version": "6.21.0", - "resolved": "https://registry.npmmirror.com/react-router-dom/-/react-router-dom-6.21.0.tgz", - "integrity": "sha512-1dUdVj3cwc1npzJaf23gulB562ESNvxf7E4x8upNJycqyUm5BRRZ6dd3LrlzhtLaMrwOCO8R0zoiYxdaJx4LlQ==", + "version": "6.21.1", + "resolved": "https://registry.npmmirror.com/react-router-dom/-/react-router-dom-6.21.1.tgz", + "integrity": "sha512-QCNrtjtDPwHDO+AO21MJd7yIcr41UetYt5jzaB9Y1UYaPTCnVuJq6S748g1dE11OQlCFIQg+RtAA1SEZIyiBeA==", "dependencies": { - "@remix-run/router": "1.14.0", - "react-router": "6.21.0" + "@remix-run/router": "1.14.1", + "react-router": "6.21.1" }, "engines": { "node": ">=14.0.0" diff --git a/package.json b/package.json index 8981ced..7c4f912 100644 --- a/package.json +++ b/package.json @@ -21,6 +21,7 @@ } }, "dependencies": { + "@chaitin_rivers/multi_river": "^0.0.3", "@emotion/cache": "^11.11.0", "@emotion/react": "^11.11.0", "@emotion/server": "^11.11.0", diff --git a/public/cnzz.js b/public/cnzz.js index b48f389..c27c4ed 100644 --- a/public/cnzz.js +++ b/public/cnzz.js @@ -11,12 +11,4 @@ if ( var cnzzTag = document.createElement('script'); cnzzTag.src = 'https://s4.cnzz.com/z.js?id=1281132544&async=1'; document.head.append(cnzzTag); - - const DOMAIN = location?.hostname?.includes('dev') - ? 'https://dev.rivers.ctopt.cn' - : 'https://rivers.chaitin.cn'; - var riverTag = document.createElement('script'); - riverTag.src = DOMAIN + '/main-header.js'; - document.head.append(riverTag); - document.body.style.paddingTop = '64px'; } diff --git a/src/pages/_app.tsx b/src/pages/_app.tsx index 4cff919..e7b8243 100644 --- a/src/pages/_app.tsx +++ b/src/pages/_app.tsx @@ -20,6 +20,7 @@ import { usePath } from '@/hooks'; import { useMemo } from 'react'; import { allTools } from '@/utils/tools'; import Head from 'next/head'; +import { Header as RiverHeader } from '@chaitin_rivers/multi_river'; const clientSideEmotionCache = createEmotionCache(); @@ -32,7 +33,7 @@ export default function App({ emotionCache = clientSideEmotionCache, }: any) { const { path } = usePath(); - + const isProduction = process.env.NODE_ENV === 'production'; const currentItem = useMemo(() => { return allTools.find((item) => item.path === path); }, [path]); @@ -62,6 +63,7 @@ export default function App({ + {isProduction ? : null}