From 05871ed0b2930f275e2ae74099ddb54d6ab0a682 Mon Sep 17 00:00:00 2001 From: Innei Date: Fri, 23 Dec 2022 16:50:12 +0800 Subject: [PATCH] feat: `recently` support comment Signed-off-by: Innei --- package.json | 4 +- .../components/Icons/for-recently.tsx | 11 + .../kami-design/components/Icons/shared.tsx | 14 - pnpm-lock.yaml | 326 ++++++++++++------ renovate.json | 14 +- .../in-page/Recently/RefPreview/index.tsx | 30 ++ .../in-page/Recently/SendBox/index.tsx | 56 +++ src/components/layouts/AppLayout.tsx | 2 +- src/components/layouts/DebugLayout.tsx | 2 +- .../universal/Markdown/MarkdownToc.tsx | 2 +- .../universal/Modal/{index.tsx => Modal.tsx} | 4 +- .../universal/Modal/index.module.css | 37 -- src/components/universal/Modal/index.ts | 2 + .../universal/Modal/modal.module.css | 65 ++++ .../{stack.context.tsx => stack-context.tsx} | 6 +- src/components/widgets/Comment/box.tsx | 18 +- src/components/widgets/Comment/index.tsx | 11 +- src/components/widgets/Toast/card.tsx | 6 +- src/pages/recently/index.tsx | 205 +++++------ src/utils/client.ts | 6 +- tsconfig.json | 15 +- 21 files changed, 516 insertions(+), 320 deletions(-) create mode 100644 src/components/in-page/Recently/RefPreview/index.tsx create mode 100644 src/components/in-page/Recently/SendBox/index.tsx rename src/components/universal/Modal/{index.tsx => Modal.tsx} (95%) delete mode 100644 src/components/universal/Modal/index.module.css create mode 100644 src/components/universal/Modal/index.ts create mode 100644 src/components/universal/Modal/modal.module.css rename src/components/universal/Modal/{stack.context.tsx => stack-context.tsx} (97%) diff --git a/package.json b/package.json index 8a76dab83..29240eb25 100644 --- a/package.json +++ b/package.json @@ -62,7 +62,7 @@ "dependencies": { "@floating-ui/react-dom": "1.0.1", "@formkit/auto-animate": "1.0.0-beta.5", - "@mx-space/api-client": "1.0.0-beta.3", + "@mx-space/api-client": "1.0.2", "axios": "0.27.2", "clsx": "1.2.1", "css-spring": "4.1.0", @@ -75,7 +75,7 @@ "medium-zoom": "1.0.8", "mobx": "6.7.0", "mobx-react-lite": "3.4.0", - "next": "13.0.6", + "next": "13.1.0", "next-seo": "5.15.0", "next-suspense": "0.1.3", "randomcolor": "0.6.2", diff --git a/packages/kami-design/components/Icons/for-recently.tsx b/packages/kami-design/components/Icons/for-recently.tsx index d6a437cb4..8bed055e3 100644 --- a/packages/kami-design/components/Icons/for-recently.tsx +++ b/packages/kami-design/components/Icons/for-recently.tsx @@ -28,3 +28,14 @@ export function PhLinkFill(props: SVGProps) { ) } + +export function FontistoComments(props: SVGProps) { + return ( + + + + ) +} diff --git a/packages/kami-design/components/Icons/shared.tsx b/packages/kami-design/components/Icons/shared.tsx index efebea89c..20b54a9b5 100644 --- a/packages/kami-design/components/Icons/shared.tsx +++ b/packages/kami-design/components/Icons/shared.tsx @@ -18,17 +18,3 @@ export function FluentList16Filled(props: SVGProps) { ) } - -export function HumbleiconsTimes(props: SVGProps) { - return ( - - - - ) -} diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 91a3c7580..51c5e6093 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -12,7 +12,7 @@ importers: '@formkit/auto-animate': 1.0.0-beta.5 '@innei/eslint-config-react-ts': 0.9.6 '@innei/prettier': 0.9.6 - '@mx-space/api-client': 1.0.0-beta.3 + '@mx-space/api-client': 1.0.2 '@next/bundle-analyzer': 13.0.7 '@trivago/prettier-plugin-sort-imports': 4.0.0 '@types/inflection': 1.13.0 @@ -47,7 +47,7 @@ importers: medium-zoom: 1.0.8 mobx: 6.7.0 mobx-react-lite: 3.4.0 - next: 13.0.6 + next: 13.1.0 next-compose-plugins: 2.2.1 next-seo: 5.15.0 next-suspense: 0.1.3 @@ -84,7 +84,7 @@ importers: dependencies: '@floating-ui/react-dom': 1.0.1_biqbaboplfbrettd7655fr4n2y '@formkit/auto-animate': 1.0.0-beta.5 - '@mx-space/api-client': 1.0.0-beta.3 + '@mx-space/api-client': 1.0.2 axios: 0.27.2 clsx: 1.2.1 css-spring: 4.1.0 @@ -97,9 +97,9 @@ importers: medium-zoom: 1.0.8 mobx: 6.7.0 mobx-react-lite: 3.4.0_jofyzmwkboewm6mjrhi25mngky - next: 13.0.6_biqbaboplfbrettd7655fr4n2y - next-seo: 5.15.0_6jx7hpii6hgsrmhxgqrmo3277u - next-suspense: 0.1.3_next@13.0.6 + next: 13.1.0_biqbaboplfbrettd7655fr4n2y + next-seo: 5.15.0_s75y6mxmikaw2mhqmuko6w7njm + next-suspense: 0.1.3_next@13.1.0 randomcolor: 0.6.2 react: 18.2.0 react-collapse: 5.1.1_react@18.2.0 @@ -285,24 +285,24 @@ packages: - supports-color dev: true - /@babel/core/7.20.5: - resolution: {integrity: sha512-UdOWmk4pNWTm/4DlPUl/Pt4Gz4rcEMb7CY0Y3eJl5Yz1vI8ZJGmHWaVE55LoxRjdpx0z259GE9U5STA9atUinQ==} + /@babel/core/7.20.7: + resolution: {integrity: sha512-t1ZjCluspe5DW24bn2Rr1CDb2v9rn/hROtg9a2tmd0+QYf4bsloYfLQzjG4qHPNMhWtKdGC33R5AxGR2Af2cBw==} engines: {node: '>=6.9.0'} dependencies: '@ampproject/remapping': 2.2.0 '@babel/code-frame': 7.18.6 - '@babel/generator': 7.20.5 - '@babel/helper-compilation-targets': 7.20.0_@babel+core@7.20.5 - '@babel/helper-module-transforms': 7.20.2 - '@babel/helpers': 7.20.6 - '@babel/parser': 7.20.5 - '@babel/template': 7.18.10 - '@babel/traverse': 7.20.5 - '@babel/types': 7.20.5 + '@babel/generator': 7.20.7 + '@babel/helper-compilation-targets': 7.20.7_@babel+core@7.20.7 + '@babel/helper-module-transforms': 7.20.7 + '@babel/helpers': 7.20.7 + '@babel/parser': 7.20.7 + '@babel/template': 7.20.7 + '@babel/traverse': 7.20.8 + '@babel/types': 7.20.7 convert-source-map: 1.9.0 debug: 4.3.4 gensync: 1.0.0-beta.2 - json5: 2.2.1 + json5: 2.2.2 semver: 6.3.0 transitivePeerDependencies: - supports-color @@ -326,6 +326,15 @@ packages: jsesc: 2.5.2 dev: true + /@babel/generator/7.20.7: + resolution: {integrity: sha512-7wqMOJq8doJMZmP4ApXTzLxSr7+oO2jroJURrVEp6XShrQUObV8Tq/D0NCcoYg2uHqUrjzO0zwBjoYzelxK+sw==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/types': 7.20.7 + '@jridgewell/gen-mapping': 0.3.2 + jsesc: 2.5.2 + dev: true + /@babel/helper-compilation-targets/7.20.0_@babel+core@7.17.8: resolution: {integrity: sha512-0jp//vDGp9e8hZzBc6N/KwA5ZK3Wsm/pfm4CrY7vzegkVxc65SgSn6wYOnwHe9Js9HRQ1YTCKLGPzDtaS3RoLQ==} engines: {node: '>=6.9.0'} @@ -339,16 +348,17 @@ packages: semver: 6.3.0 dev: true - /@babel/helper-compilation-targets/7.20.0_@babel+core@7.20.5: - resolution: {integrity: sha512-0jp//vDGp9e8hZzBc6N/KwA5ZK3Wsm/pfm4CrY7vzegkVxc65SgSn6wYOnwHe9Js9HRQ1YTCKLGPzDtaS3RoLQ==} + /@babel/helper-compilation-targets/7.20.7_@babel+core@7.20.7: + resolution: {integrity: sha512-4tGORmfQcrc+bvrjb5y3dG9Mx1IOZjsHqQVUz7XCNHO+iTmqxWnVg3KRygjGmpRLJGdQSKuvFinbIb0CnZwHAQ==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0 dependencies: '@babel/compat-data': 7.20.5 - '@babel/core': 7.20.5 + '@babel/core': 7.20.7 '@babel/helper-validator-option': 7.18.6 browserslist: 4.21.4 + lru-cache: 5.1.1 semver: 6.3.0 dev: true @@ -394,6 +404,22 @@ packages: - supports-color dev: true + /@babel/helper-module-transforms/7.20.7: + resolution: {integrity: sha512-FNdu7r67fqMUSVuQpFQGE6BPdhJIhitoxhGzDbAXNcA07uoVG37fOiMk3OSV8rEICuyG6t8LGkd9EE64qIEoIA==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/helper-environment-visitor': 7.18.9 + '@babel/helper-module-imports': 7.18.6 + '@babel/helper-simple-access': 7.20.2 + '@babel/helper-split-export-declaration': 7.18.6 + '@babel/helper-validator-identifier': 7.19.1 + '@babel/template': 7.20.7 + '@babel/traverse': 7.20.8 + '@babel/types': 7.20.7 + transitivePeerDependencies: + - supports-color + dev: true + /@babel/helper-simple-access/7.20.2: resolution: {integrity: sha512-+0woI/WPq59IrqDYbVGfshjT5Dmk/nnbdpcF8SnMhhXObpTq2KNBdLFRFrkVdbDOyUmHBCxzm5FHV1rACIkIbA==} engines: {node: '>=6.9.0'} @@ -432,6 +458,17 @@ packages: - supports-color dev: true + /@babel/helpers/7.20.7: + resolution: {integrity: sha512-PBPjs5BppzsGaxHQCDKnZ6Gd9s6xl8bBCluz3vEInLGRJmnZan4F6BYCeqtyXqkk4W5IlPmjK4JlOuZkpJ3xZA==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/template': 7.20.7 + '@babel/traverse': 7.20.8 + '@babel/types': 7.20.7 + transitivePeerDependencies: + - supports-color + dev: true + /@babel/highlight/7.18.6: resolution: {integrity: sha512-u7stbOuYjaPezCuLj29hNW1v64M2Md2qupEKP1fHc7WdOA3DgLh37suiSrZYY7haUB7iBeQZ9P1uiRF359do3g==} engines: {node: '>=6.9.0'} @@ -457,6 +494,14 @@ packages: '@babel/types': 7.20.5 dev: true + /@babel/parser/7.20.7: + resolution: {integrity: sha512-T3Z9oHybU+0vZlY9CiDSJQTD5ZapcW18ZctFMi0MOAl/4BjFF4ul7NVSARLdbGO5vDqy9eQiGTV0LtKfvCYvcg==} + engines: {node: '>=6.0.0'} + hasBin: true + dependencies: + '@babel/types': 7.20.7 + dev: true + /@babel/runtime/7.18.0: resolution: {integrity: sha512-YMQvx/6nKEaucl0MY56mwIG483xk8SDNdlUwb2Ts6FUpr7fm85DxEmsY18LXBNhcTz6tO6JwZV8w1W06v8UKeg==} engines: {node: '>=6.9.0'} @@ -473,6 +518,15 @@ packages: '@babel/types': 7.20.5 dev: true + /@babel/template/7.20.7: + resolution: {integrity: sha512-8SegXApWe6VoNw0r9JHpSteLKTpTiLZ4rMlGIm9JQ18KiCtyQiAMEazujAHrUS5flrcqYZa75ukev3P6QmUwUw==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/code-frame': 7.18.6 + '@babel/parser': 7.20.7 + '@babel/types': 7.20.7 + dev: true + /@babel/traverse/7.17.3: resolution: {integrity: sha512-5irClVky7TxRWIRtxlh2WPUUOLhcPN06AGgaQSB8AEwuyEBgJVuJ5imdHm5zxk8w0QS5T+tDfnDxAlhWjpb7cw==} engines: {node: '>=6.9.0'} @@ -509,6 +563,24 @@ packages: - supports-color dev: true + /@babel/traverse/7.20.8: + resolution: {integrity: sha512-/RNkaYDeCy4MjyV70+QkSHhxbvj2JO/5Ft2Pa880qJOG8tWrqcT/wXUuCCv43yogfqPzHL77Xu101KQPf4clnQ==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/code-frame': 7.18.6 + '@babel/generator': 7.20.7 + '@babel/helper-environment-visitor': 7.18.9 + '@babel/helper-function-name': 7.19.0 + '@babel/helper-hoist-variables': 7.18.6 + '@babel/helper-split-export-declaration': 7.18.6 + '@babel/parser': 7.20.7 + '@babel/types': 7.20.7 + debug: 4.3.4 + globals: 11.12.0 + transitivePeerDependencies: + - supports-color + dev: true + /@babel/types/7.17.0: resolution: {integrity: sha512-TmKSNO4D5rzhL5bjWFcVHHLETzfQ/AmbKpKPOSjlP0WoHZ6L911fgoOKY4Alp/emzG4cHJdyN49zpgkbXFEHHw==} engines: {node: '>=6.9.0'} @@ -525,6 +597,15 @@ packages: '@babel/helper-validator-identifier': 7.19.1 to-fast-properties: 2.0.0 + /@babel/types/7.20.7: + resolution: {integrity: sha512-69OnhBxSSgK0OzTJai4kyPDiKTIe3j+ctaHdIGVbRahTLAT7L3R9oeXHC2aVSuGYt3cVnoAMDmOCgJ2yaiLMvg==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/helper-string-parser': 7.19.4 + '@babel/helper-validator-identifier': 7.19.1 + to-fast-properties: 2.0.0 + dev: true + /@csstools/postcss-cascade-layers/1.1.1_postcss@8.4.20: resolution: {integrity: sha512-+KdYrpKC5TgomQr2DlZF4lDEpHcoxnj5IGddYYfBWJAKfj1JtuHUIqMa+E1pJJ+z3kvDViWMqyqPlG4Ja7amQA==} engines: {node: ^12 || ^14 || >=16} @@ -964,11 +1045,11 @@ packages: '@vue/compiler-sfc': optional: true dependencies: - '@babel/core': 7.20.5 - '@babel/generator': 7.20.5 - '@babel/parser': 7.20.5 - '@babel/traverse': 7.20.5 - '@babel/types': 7.20.5 + '@babel/core': 7.20.7 + '@babel/generator': 7.20.7 + '@babel/parser': 7.20.7 + '@babel/traverse': 7.20.8 + '@babel/types': 7.20.7 javascript-natural-sort: 0.7.1 lodash.clone: 4.5.0 lodash.isequal: 4.5.0 @@ -998,11 +1079,11 @@ packages: peerDependencies: typescript: '>=4' dependencies: - '@typescript-eslint/eslint-plugin': 5.45.0_6narg373zdytqrpc5ppkk4srai - '@typescript-eslint/parser': 5.46.0_lzzuuodtsqwxnvqeq4g4likcqa + '@typescript-eslint/eslint-plugin': 5.45.0_ncmi6noazr3nzas7jxykisekym + '@typescript-eslint/parser': 5.47.0_lzzuuodtsqwxnvqeq4g4likcqa eslint: 8.30.0 eslint-config-prettier: 8.5.0_eslint@8.30.0 - eslint-plugin-import: 2.26.0_dvbwtjzt7fcpbk7v6xpiuyy3ju + eslint-plugin-import: 2.26.0_tqyj5ytb5g6r5ett7xxedhk6eq eslint-plugin-unused-imports: 2.0.0_b2o2jvby2crjpgs6kddox5afiy typescript: 4.9.4 transitivePeerDependencies: @@ -1087,6 +1168,11 @@ packages: engines: {pnpm: '>=6'} dev: false + /@mx-space/api-client/1.0.2: + resolution: {integrity: sha512-8efMizuF0Clqysv+kAGbVxuta18X9qWq1bksGB3Gn4TfgauwzrS62JWlrNhceYMfcYWldsEU90Pp8hq/TBjVww==} + engines: {pnpm: '>=6'} + dev: false + /@next/bundle-analyzer/13.0.7: resolution: {integrity: sha512-kUvKjdScipM5fjVRoehBS+c1nwIk2HYwI01NfF8GZlpfyTnMIAmfb5cP2trHfD3rZKUTFl2bKR52+CDwo6SBgg==} dependencies: @@ -1096,12 +1182,12 @@ packages: - utf-8-validate dev: true - /@next/env/13.0.6: - resolution: {integrity: sha512-yceT6DCHKqPRS1cAm8DHvDvK74DLIkDQdm5iV+GnIts8h0QbdHvkUIkdOvQoOODgpr6018skbmSQp12z5OWIQQ==} + /@next/env/13.1.0: + resolution: {integrity: sha512-6iNixFzCndH+Bl4FetQzOMjxCJqg8fs0LAlZviig1K6mIjOWH2m2oPcHcOg1Ta5VCe7Bx5KG1Hs+NrWDUkBt9A==} dev: false - /@next/swc-android-arm-eabi/13.0.6: - resolution: {integrity: sha512-FGFSj3v2Bluw8fD/X+1eXIEB0PhoJE0zfutsAauRhmNpjjZshLDgoXMWm1jTRL/04K/o9gwwO2+A8+sPVCH1uw==} + /@next/swc-android-arm-eabi/13.1.0: + resolution: {integrity: sha512-ANBZZRjZBV+Sii11ZVxbxSvfIi6dZwu4w+XnJBDmz+0/wtAigpjYWyMkuWZ/RCD7INdusOlU4EgJ99WzWGIDjA==} engines: {node: '>= 10'} cpu: [arm] os: [android] @@ -1109,8 +1195,8 @@ packages: dev: false optional: true - /@next/swc-android-arm64/13.0.6: - resolution: {integrity: sha512-7MgbtU7kimxuovVsd7jSJWMkIHBDBUsNLmmlkrBRHTvgzx5nDBXogP0hzZm7EImdOPwVMPpUHRQMBP9mbsiJYQ==} + /@next/swc-android-arm64/13.1.0: + resolution: {integrity: sha512-nPwbkS3aZjCIe61wztgjXjIeylijOP8uGtDGjjJVUF3B/5GLVx3ngZu6tjPTMEgaLM0u//HuGK+aZolWUQWE4g==} engines: {node: '>= 10'} cpu: [arm64] os: [android] @@ -1118,8 +1204,8 @@ packages: dev: false optional: true - /@next/swc-darwin-arm64/13.0.6: - resolution: {integrity: sha512-AUVEpVTxbP/fxdFsjVI9d5a0CFn6NVV7A/RXOb0Y+pXKIIZ1V5rFjPwpYfIfyOo2lrqgehMNQcyMRoTrhq04xg==} + /@next/swc-darwin-arm64/13.1.0: + resolution: {integrity: sha512-0hUydiAW18jK2uGPnZRdnRQtdB/3ZoPo84A6zH7MJHxAWw9lzVsv3kMg9kgVBBlrivzqdNN8rdgA+eYNxzXU9w==} engines: {node: '>= 10'} cpu: [arm64] os: [darwin] @@ -1127,8 +1213,8 @@ packages: dev: false optional: true - /@next/swc-darwin-x64/13.0.6: - resolution: {integrity: sha512-SasCDJlshglsPnbzhWaIF6VEGkQy2NECcAOxPwaPr0cwbbt4aUlZ7QmskNzgolr5eAjFS/xTr7CEeKJtZpAAtQ==} + /@next/swc-darwin-x64/13.1.0: + resolution: {integrity: sha512-3S3iQqJIysklj0Q9gnanuYMzF8H9p+fUVhvSHxVVLcKH4HsE8EGddNkXsaOyznL1kC6vGKw7h6uz1ojaXEafCA==} engines: {node: '>= 10'} cpu: [x64] os: [darwin] @@ -1136,8 +1222,8 @@ packages: dev: false optional: true - /@next/swc-freebsd-x64/13.0.6: - resolution: {integrity: sha512-6Lbxd9gAdXneTkwHyYW/qtX1Tdw7ND9UbiGsGz/SP43ZInNWnW6q0au4hEVPZ9bOWWRKzcVoeTBdoMpQk9Hx9w==} + /@next/swc-freebsd-x64/13.1.0: + resolution: {integrity: sha512-wAgzwm/em48GIuWq3OYr0BpncMy7c+UA3hsyX+xKh/vb/sOIpQly7JTa+GNdk17s7kprhMfsgzPG3da36NLpkA==} engines: {node: '>= 10'} cpu: [x64] os: [freebsd] @@ -1145,8 +1231,8 @@ packages: dev: false optional: true - /@next/swc-linux-arm-gnueabihf/13.0.6: - resolution: {integrity: sha512-wNdi5A519e1P+ozEuYOhWPzzE6m1y7mkO6NFwn6watUwO0X9nZs7fT9THmnekvmFQpaZ6U+xf2MQ9poQoCh6jQ==} + /@next/swc-linux-arm-gnueabihf/13.1.0: + resolution: {integrity: sha512-Cr2hzL7ad+4nj9KrR1Cz1RDcsWa61X6I7gc6PToRYIY4gL480Sijq19xo7dlXQPnr1viVzbNiNnNXZASHv7uvw==} engines: {node: '>= 10'} cpu: [arm] os: [linux] @@ -1154,8 +1240,8 @@ packages: dev: false optional: true - /@next/swc-linux-arm64-gnu/13.0.6: - resolution: {integrity: sha512-e8KTRnleQY1KLk5PwGV5hrmvKksCc74QRpHl5ffWnEEAtL2FE0ave5aIkXqErsPdXkiKuA/owp3LjQrP+/AH7Q==} + /@next/swc-linux-arm64-gnu/13.1.0: + resolution: {integrity: sha512-EjCIKfeZB9h72evL2yGNwBvE5Im96Zn7o2zxImlvCiUYb/xXDqn4hzhck035BSP3g3sGDLfijFTE1wKRyXIk4w==} engines: {node: '>= 10'} cpu: [arm64] os: [linux] @@ -1163,8 +1249,8 @@ packages: dev: false optional: true - /@next/swc-linux-arm64-musl/13.0.6: - resolution: {integrity: sha512-/7RF03C3mhjYpHN+pqOolgME3guiHU5T3TsejuyteqyEyzdEyLHod+jcYH6ft7UZ71a6TdOewvmbLOtzHW2O8A==} + /@next/swc-linux-arm64-musl/13.1.0: + resolution: {integrity: sha512-WAsZtCtPXlz/7/bnW9ryw856xEun+c6xSwZwbcvrMxtcSiW3z0LD91Nsj3AkexsjRtBjeEpNeVtDExqF2VKKSA==} engines: {node: '>= 10'} cpu: [arm64] os: [linux] @@ -1172,8 +1258,8 @@ packages: dev: false optional: true - /@next/swc-linux-x64-gnu/13.0.6: - resolution: {integrity: sha512-kxyEXnYHpOEkFnmrlwB1QlzJtjC6sAJytKcceIyFUHbCaD3W/Qb5tnclcnHKTaFccizZRePXvV25Ok/eUSpKTw==} + /@next/swc-linux-x64-gnu/13.1.0: + resolution: {integrity: sha512-Tjd5gieI3X9vPce5yF+GsQxOl0jwUkyOrTR1g5PQr+bT/9Qos/yPL48H1L5ayEp0hxgLVPW7skGal7lVnAoVEQ==} engines: {node: '>= 10'} cpu: [x64] os: [linux] @@ -1181,8 +1267,8 @@ packages: dev: false optional: true - /@next/swc-linux-x64-musl/13.0.6: - resolution: {integrity: sha512-N0c6gubS3WW1oYYgo02xzZnNatfVQP/CiJq2ax+DJ55ePV62IACbRCU99TZNXXg+Kos6vNW4k+/qgvkvpGDeyA==} + /@next/swc-linux-x64-musl/13.1.0: + resolution: {integrity: sha512-H9UMEQv40e9pkgdX4mCms0dDf2dimmZ6WXhDTWF/yIh9icgcsHaP73BJ9IFlgvh80wLiUgWZ3LAX4vXnXzidmg==} engines: {node: '>= 10'} cpu: [x64] os: [linux] @@ -1190,8 +1276,8 @@ packages: dev: false optional: true - /@next/swc-win32-arm64-msvc/13.0.6: - resolution: {integrity: sha512-QjeMB2EBqBFPb/ac0CYr7GytbhUkrG4EwFWbcE0vsRp4H8grt25kYpFQckL4Jak3SUrp7vKfDwZ/SwO7QdO8vw==} + /@next/swc-win32-arm64-msvc/13.1.0: + resolution: {integrity: sha512-LFFIKjW/cPl4wvG8HF/6oYPJZ+Jy32G3FUflC8UW1Od6W9yOSEvadhk9fMyDZN4cgsNOcVc3uVSMpcuuCpbDGw==} engines: {node: '>= 10'} cpu: [arm64] os: [win32] @@ -1199,8 +1285,8 @@ packages: dev: false optional: true - /@next/swc-win32-ia32-msvc/13.0.6: - resolution: {integrity: sha512-EQzXtdqRTcmhT/tCq81rIwE36Y3fNHPInaCuJzM/kftdXfa0F+64y7FAoMO13npX8EG1+SamXgp/emSusKrCXg==} + /@next/swc-win32-ia32-msvc/13.1.0: + resolution: {integrity: sha512-MBLaoHZSenMdxhB3Ww1VNEhjyPT3uLjzAi5Ygk48LLLbOGu5KxQolhINRrqGuJWqJRNWSJ9JSFBfJrZwQzrUew==} engines: {node: '>= 10'} cpu: [ia32] os: [win32] @@ -1208,8 +1294,8 @@ packages: dev: false optional: true - /@next/swc-win32-x64-msvc/13.0.6: - resolution: {integrity: sha512-pSkqZ//UP/f2sS9T7IvHLfEWDPTX0vRyXJnAUNisKvO3eF3e1xdhDX7dix/X3Z3lnN4UjSwOzclAI87JFbOwmQ==} + /@next/swc-win32-x64-msvc/13.1.0: + resolution: {integrity: sha512-fFTfIQvnmpbKoyh4v3ezlGqtERlgc2Sx8qJwPuYqoVi0V08wCx9wp2Iq1CINxP3UMHkEeNX7gYpDOd+9Cw9EiQ==} engines: {node: '>= 10'} cpu: [x64] os: [win32] @@ -1522,7 +1608,7 @@ packages: resolution: {integrity: sha512-Jjakcv8Roqtio6w1gr0D7y6twbhx6gGgFGF5BLwajPpnOIOxFkakFhCq+LmyyeAz7BX6ULrjBOxdKaCDy+4+dQ==} dev: true - /@typescript-eslint/eslint-plugin/5.45.0_6narg373zdytqrpc5ppkk4srai: + /@typescript-eslint/eslint-plugin/5.45.0_ncmi6noazr3nzas7jxykisekym: resolution: {integrity: sha512-CXXHNlf0oL+Yg021cxgOdMHNTXD17rHkq7iW6RFHoybdFgQBjU3yIXhhcPpGwr1CjZlo6ET8C6tzX5juQoXeGA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: @@ -1533,13 +1619,13 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/parser': 5.46.0_lzzuuodtsqwxnvqeq4g4likcqa + '@typescript-eslint/parser': 5.47.0_lzzuuodtsqwxnvqeq4g4likcqa '@typescript-eslint/scope-manager': 5.45.0 '@typescript-eslint/type-utils': 5.45.0_lzzuuodtsqwxnvqeq4g4likcqa '@typescript-eslint/utils': 5.45.0_lzzuuodtsqwxnvqeq4g4likcqa debug: 4.3.4 eslint: 8.30.0 - ignore: 5.2.1 + ignore: 5.2.4 natural-compare-lite: 1.4.0 regexpp: 3.2.0 semver: 7.3.8 @@ -1549,8 +1635,8 @@ packages: - supports-color dev: true - /@typescript-eslint/parser/5.46.0_lzzuuodtsqwxnvqeq4g4likcqa: - resolution: {integrity: sha512-joNO6zMGUZg+C73vwrKXCd8usnsmOYmgW/w5ZW0pG0RGvqeznjtGDk61EqqTpNrFLUYBW2RSBFrxdAZMqA4OZA==} + /@typescript-eslint/parser/5.47.0_lzzuuodtsqwxnvqeq4g4likcqa: + resolution: {integrity: sha512-udPU4ckK+R1JWCGdQC4Qa27NtBg7w020ffHqGyAK8pAgOVuNw7YaKXGChk+udh+iiGIJf6/E/0xhVXyPAbsczw==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 @@ -1559,9 +1645,9 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/scope-manager': 5.46.0 - '@typescript-eslint/types': 5.46.0 - '@typescript-eslint/typescript-estree': 5.46.0_typescript@4.9.4 + '@typescript-eslint/scope-manager': 5.47.0 + '@typescript-eslint/types': 5.47.0 + '@typescript-eslint/typescript-estree': 5.47.0_typescript@4.9.4 debug: 4.3.4 eslint: 8.30.0 typescript: 4.9.4 @@ -1577,12 +1663,12 @@ packages: '@typescript-eslint/visitor-keys': 5.45.0 dev: true - /@typescript-eslint/scope-manager/5.46.0: - resolution: {integrity: sha512-7wWBq9d/GbPiIM6SqPK9tfynNxVbfpihoY5cSFMer19OYUA3l4powA2uv0AV2eAZV6KoAh6lkzxv4PoxOLh1oA==} + /@typescript-eslint/scope-manager/5.47.0: + resolution: {integrity: sha512-dvJab4bFf7JVvjPuh3sfBUWsiD73aiftKBpWSfi3sUkysDQ4W8x+ZcFpNp7Kgv0weldhpmMOZBjx1wKN8uWvAw==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dependencies: - '@typescript-eslint/types': 5.46.0 - '@typescript-eslint/visitor-keys': 5.46.0 + '@typescript-eslint/types': 5.47.0 + '@typescript-eslint/visitor-keys': 5.47.0 dev: true /@typescript-eslint/type-utils/5.45.0_lzzuuodtsqwxnvqeq4g4likcqa: @@ -1610,8 +1696,8 @@ packages: engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dev: true - /@typescript-eslint/types/5.46.0: - resolution: {integrity: sha512-wHWgQHFB+qh6bu0IAPAJCdeCdI0wwzZnnWThlmHNY01XJ9Z97oKqKOzWYpR2I83QmshhQJl6LDM9TqMiMwJBTw==} + /@typescript-eslint/types/5.47.0: + resolution: {integrity: sha512-eslFG0Qy8wpGzDdYKu58CEr3WLkjwC5Usa6XbuV89ce/yN5RITLe1O8e+WFEuxnfftHiJImkkOBADj58ahRxSg==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dev: true @@ -1636,8 +1722,8 @@ packages: - supports-color dev: true - /@typescript-eslint/typescript-estree/5.46.0_typescript@4.9.4: - resolution: {integrity: sha512-kDLNn/tQP+Yp8Ro2dUpyyVV0Ksn2rmpPpB0/3MO874RNmXtypMwSeazjEN/Q6CTp8D7ExXAAekPEcCEB/vtJkw==} + /@typescript-eslint/typescript-estree/5.47.0_typescript@4.9.4: + resolution: {integrity: sha512-LxfKCG4bsRGq60Sqqu+34QT5qT2TEAHvSCCJ321uBWywgE2dS0LKcu5u+3sMGo+Vy9UmLOhdTw5JHzePV/1y4Q==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: typescript: '*' @@ -1645,8 +1731,8 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/types': 5.46.0 - '@typescript-eslint/visitor-keys': 5.46.0 + '@typescript-eslint/types': 5.47.0 + '@typescript-eslint/visitor-keys': 5.47.0 debug: 4.3.4 globby: 11.1.0 is-glob: 4.0.3 @@ -1685,11 +1771,11 @@ packages: eslint-visitor-keys: 3.3.0 dev: true - /@typescript-eslint/visitor-keys/5.46.0: - resolution: {integrity: sha512-E13gBoIXmaNhwjipuvQg1ByqSAu/GbEpP/qzFihugJ+MomtoJtFAJG/+2DRPByf57B863m0/q7Zt16V9ohhANw==} + /@typescript-eslint/visitor-keys/5.47.0: + resolution: {integrity: sha512-ByPi5iMa6QqDXe/GmT/hR6MZtVPi0SqMQPDx15FczCBXJo/7M8T88xReOALAfpBLm+zxpPfmhuEvPb577JRAEg==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dependencies: - '@typescript-eslint/types': 5.46.0 + '@typescript-eslint/types': 5.47.0 eslint-visitor-keys: 3.3.0 dev: true @@ -2036,11 +2122,16 @@ packages: /caniuse-lite/1.0.30001431: resolution: {integrity: sha512-zBUoFU0ZcxpvSt9IU66dXVT/3ctO1cy4y9cscs1szkPlcWb6pasYM144GqrUygUbT+k7cmUCW61cvskjcv0enQ==} + dev: true /caniuse-lite/1.0.30001439: resolution: {integrity: sha512-1MgUzEkoMO6gKfXflStpYgZDlFM7M/ck/bgfVCACO5vnAf0fXoNVHdWtqGU+MYca+4bL9Z5bpOVmR33cWW9G2A==} dev: true + /caniuse-lite/1.0.30001441: + resolution: {integrity: sha512-OyxRR4Vof59I3yGWXws6i908EtGbMzVUi3ganaZQHmydk1iwDhRnvaPG2WaR0KcqrDFKrxVZHULT396LEPhXfg==} + dev: false + /chalk/2.4.2: resolution: {integrity: sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==} engines: {node: '>=4'} @@ -2720,7 +2811,7 @@ packages: - supports-color dev: true - /eslint-module-utils/2.7.4_k2cokddgeywek7ihv24pf75u64: + /eslint-module-utils/2.7.4_5vuadmvmkyhbtm34phil3e6noa: resolution: {integrity: sha512-j4GT+rqzCoRKHwURX7pddtIPGySnX9Si/cgMI5ztrcqOPtk5dDEeZ34CQVPphnqkJytlc97Vuk05Um2mJ3gEQA==} engines: {node: '>=4'} peerDependencies: @@ -2741,7 +2832,7 @@ packages: eslint-import-resolver-webpack: optional: true dependencies: - '@typescript-eslint/parser': 5.46.0_lzzuuodtsqwxnvqeq4g4likcqa + '@typescript-eslint/parser': 5.47.0_lzzuuodtsqwxnvqeq4g4likcqa debug: 3.2.7 eslint: 8.30.0 eslint-import-resolver-node: 0.3.6 @@ -2749,7 +2840,7 @@ packages: - supports-color dev: true - /eslint-plugin-import/2.26.0_dvbwtjzt7fcpbk7v6xpiuyy3ju: + /eslint-plugin-import/2.26.0_tqyj5ytb5g6r5ett7xxedhk6eq: resolution: {integrity: sha512-hYfi3FXaM8WPLf4S1cikh/r4IxnO6zrhZbEGz2b660EJRbuxgpDS5gkCuYgGWg2xxh2rBuIr4Pvhve/7c31koA==} engines: {node: '>=4'} peerDependencies: @@ -2759,14 +2850,14 @@ packages: '@typescript-eslint/parser': optional: true dependencies: - '@typescript-eslint/parser': 5.46.0_lzzuuodtsqwxnvqeq4g4likcqa + '@typescript-eslint/parser': 5.47.0_lzzuuodtsqwxnvqeq4g4likcqa array-includes: 3.1.6 array.prototype.flat: 1.3.1 debug: 2.6.9 doctrine: 2.1.0 eslint: 8.30.0 eslint-import-resolver-node: 0.3.6 - eslint-module-utils: 2.7.4_k2cokddgeywek7ihv24pf75u64 + eslint-module-utils: 2.7.4_5vuadmvmkyhbtm34phil3e6noa has: 1.0.3 is-core-module: 2.11.0 is-glob: 4.0.3 @@ -2823,7 +2914,7 @@ packages: '@typescript-eslint/eslint-plugin': optional: true dependencies: - '@typescript-eslint/eslint-plugin': 5.45.0_6narg373zdytqrpc5ppkk4srai + '@typescript-eslint/eslint-plugin': 5.45.0_ncmi6noazr3nzas7jxykisekym eslint: 8.30.0 eslint-rule-composer: 0.3.0 dev: true @@ -3409,6 +3500,11 @@ packages: engines: {node: '>= 4'} dev: true + /ignore/5.2.4: + resolution: {integrity: sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ==} + engines: {node: '>= 4'} + dev: true + /import-cwd/3.0.0: resolution: {integrity: sha512-4pnzH16plW+hgvRECbDWpQl3cqtvSofHWh44met7ESfZ8UZOWWddm8hEyDTqREJ9RbYHY8gi8DqmaelApoOGMg==} engines: {node: '>=8'} @@ -3710,6 +3806,12 @@ packages: hasBin: true dev: true + /json5/2.2.2: + resolution: {integrity: sha512-46Tk9JiOL2z7ytNQWFLpj99RZkVgeHf87yGQKsIkaPz1qSH9UczKH1rO7K3wgRselo0tYMUNfecYpm/p1vC7tQ==} + engines: {node: '>=6'} + hasBin: true + dev: true + /jsonc-parser/3.2.0: resolution: {integrity: sha512-gfFQZrcTc8CnKXp6Y4/CBT3fTc0OVuDofpre4aEeEpSBPV5X5v4+Vmx+8snU7RLPrNHPKSgLxGo9YuQzz20o+w==} dev: true @@ -3877,6 +3979,12 @@ packages: dependencies: js-tokens: 4.0.0 + /lru-cache/5.1.1: + resolution: {integrity: sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==} + dependencies: + yallist: 3.1.1 + dev: true + /lru-cache/6.0.0: resolution: {integrity: sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==} engines: {node: '>=10'} @@ -4104,7 +4212,7 @@ packages: resolution: {integrity: sha512-OjJ+fV15FXO2uQXQagLD4C0abYErBjyjE0I0FHpOEIB8upw0hg1ldFP6cqHTJBH1cZqy96OeR3u1dJ+Ez2D4Bg==} dev: true - /next-seo/5.15.0_6jx7hpii6hgsrmhxgqrmo3277u: + /next-seo/5.15.0_s75y6mxmikaw2mhqmuko6w7njm: resolution: {integrity: sha512-LGbcY91yDKGMb7YI+28n3g+RuChUkt6pXNpa8FkfKkEmNiJkeRDEXTnnjVtwT9FmMhG6NH8qwHTelGrlYm9rgg==} peerDependencies: next: ^8.1.1-canary.54 || >=9.0.0 @@ -4116,12 +4224,12 @@ packages: react: optional: true dependencies: - next: 13.0.6_biqbaboplfbrettd7655fr4n2y + next: 13.1.0_biqbaboplfbrettd7655fr4n2y react: 18.2.0 react-dom: 18.2.0_react@18.2.0 dev: false - /next-suspense/0.1.3_next@13.0.6: + /next-suspense/0.1.3_next@13.1.0: resolution: {integrity: sha512-eo2HImfMlRUsg5t9MmoX0cV0Cdw7jgYbCeGolHHSnmsnT8LN0yVJhRKy+cBJY5DGumPOqRFgEwGiIV1WqpA0Eg==} engines: {pnpm: '>=7'} peerDependencies: @@ -4130,11 +4238,11 @@ packages: next: optional: true dependencies: - next: 13.0.6_biqbaboplfbrettd7655fr4n2y + next: 13.1.0_biqbaboplfbrettd7655fr4n2y dev: false - /next/13.0.6_biqbaboplfbrettd7655fr4n2y: - resolution: {integrity: sha512-COvigvms2LRt1rrzfBQcMQ2GZd86Mvk1z+LOLY5pniFtL4VrTmhZ9salrbKfSiXbhsD01TrDdD68ec3ABDyscA==} + /next/13.1.0_biqbaboplfbrettd7655fr4n2y: + resolution: {integrity: sha512-lQMZH1V94L5IL/WaihQkTYabSY73aqgrkGPJB5uz+2O3ES4I3losV/maXLY7l7x5e+oNyE9N81upNQ8uRsR5/A==} engines: {node: '>=14.6.0'} hasBin: true peerDependencies: @@ -4153,27 +4261,27 @@ packages: sass: optional: true dependencies: - '@next/env': 13.0.6 + '@next/env': 13.1.0 '@swc/helpers': 0.4.14 - caniuse-lite: 1.0.30001431 + caniuse-lite: 1.0.30001441 postcss: 8.4.14 react: 18.2.0 react-dom: 18.2.0_react@18.2.0 - styled-jsx: 5.1.0_react@18.2.0 + styled-jsx: 5.1.1_react@18.2.0 optionalDependencies: - '@next/swc-android-arm-eabi': 13.0.6 - '@next/swc-android-arm64': 13.0.6 - '@next/swc-darwin-arm64': 13.0.6 - '@next/swc-darwin-x64': 13.0.6 - '@next/swc-freebsd-x64': 13.0.6 - '@next/swc-linux-arm-gnueabihf': 13.0.6 - '@next/swc-linux-arm64-gnu': 13.0.6 - '@next/swc-linux-arm64-musl': 13.0.6 - '@next/swc-linux-x64-gnu': 13.0.6 - '@next/swc-linux-x64-musl': 13.0.6 - '@next/swc-win32-arm64-msvc': 13.0.6 - '@next/swc-win32-ia32-msvc': 13.0.6 - '@next/swc-win32-x64-msvc': 13.0.6 + '@next/swc-android-arm-eabi': 13.1.0 + '@next/swc-android-arm64': 13.1.0 + '@next/swc-darwin-arm64': 13.1.0 + '@next/swc-darwin-x64': 13.1.0 + '@next/swc-freebsd-x64': 13.1.0 + '@next/swc-linux-arm-gnueabihf': 13.1.0 + '@next/swc-linux-arm64-gnu': 13.1.0 + '@next/swc-linux-arm64-musl': 13.1.0 + '@next/swc-linux-x64-gnu': 13.1.0 + '@next/swc-linux-x64-musl': 13.1.0 + '@next/swc-win32-arm64-msvc': 13.1.0 + '@next/swc-win32-ia32-msvc': 13.1.0 + '@next/swc-win32-x64-msvc': 13.1.0 transitivePeerDependencies: - '@babel/core' - babel-plugin-macros @@ -6072,8 +6180,8 @@ packages: resolution: {integrity: sha512-Dj1Okke1C3uKKwQcetra4jSuk0DqbzbYtXipzFlFMZtowbF1x7BKJwB9AayVMyFARvU8EDrZdcax4At/452cAg==} dev: true - /styled-jsx/5.1.0_react@18.2.0: - resolution: {integrity: sha512-/iHaRJt9U7T+5tp6TRelLnqBqiaIT0HsO0+vgyj8hK2KUk7aejFqRrumqPUlAqDwAj8IbS/1hk3IhBAAK/FCUQ==} + /styled-jsx/5.1.1_react@18.2.0: + resolution: {integrity: sha512-pW7uC1l4mBZ8ugbiZrcIsiIvVx1UmTfw7UkC3Um2tmfUq9Bhk8IiyEIPl6F8agHgjzku6j0xQEZbfA5uSgSaCw==} engines: {node: '>= 12.0.0'} peerDependencies: '@babel/core': '*' @@ -6579,6 +6687,10 @@ packages: engines: {node: '>=10'} dev: true + /yallist/3.1.1: + resolution: {integrity: sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==} + dev: true + /yallist/4.0.0: resolution: {integrity: sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==} dev: true diff --git a/renovate.json b/renovate.json index 5a5398fe6..bd23e9ecb 100644 --- a/renovate.json +++ b/renovate.json @@ -8,15 +8,9 @@ ], "packageRules": [ { - "updateTypes": [ - "major" - ], - "labels": [ - "UPDATE-MAJOR" - ] + "updateTypes": ["major"], + "labels": ["UPDATE-MAJOR"] } ], - "ignoreDeps": [ - "next" - ] -} \ No newline at end of file + "ignoreDeps": ["next", "axios"] +} diff --git a/src/components/in-page/Recently/RefPreview/index.tsx b/src/components/in-page/Recently/RefPreview/index.tsx new file mode 100644 index 000000000..fba16722e --- /dev/null +++ b/src/components/in-page/Recently/RefPreview/index.tsx @@ -0,0 +1,30 @@ +import Link from 'next/link' +import type { FC } from 'react' +import { useMemo } from 'react' + +import { Divider } from '@mx-space/kami-design/components/Divider' +import { PhLinkFill } from '@mx-space/kami-design/components/Icons' + +import { urlBuilder } from '~/utils/url' + +export const RefPreview: FC<{ refModel: any }> = (props) => { + const title = props.refModel?.title + + const url = useMemo(() => { + return urlBuilder.build(props.refModel) + }, [props.refModel]) + + if (!title) { + return null + } + + return ( + <> + +

+ 发表于: + {title} +

+ + ) +} diff --git a/src/components/in-page/Recently/SendBox/index.tsx b/src/components/in-page/Recently/SendBox/index.tsx new file mode 100644 index 000000000..026c30ab1 --- /dev/null +++ b/src/components/in-page/Recently/SendBox/index.tsx @@ -0,0 +1,56 @@ +import type { FC } from 'react' +import { memo, useCallback, useRef, useState } from 'react' + +import { Input } from '@mx-space/kami-design/components/Input' + +import { apiClient } from '~/utils/client' + +export const RecentlySendBox: FC = memo(() => { + const [content, setText] = useState('') + + const taRef = useRef(null) + const handleSubmit = useCallback(() => { + apiClient.shorthand.proxy.post({ data: { content } }).then(() => { + setText('') + taRef.current && (taRef.current.value = '') + }) + }, [content]) + return ( +
{ + e.preventDefault() + handleSubmit() + }, + [handleSubmit], + )} + > + { + setText(e.target.value) + }} + autoFocus={true} + placeholder={'今天遇到了什么烦心事?'} + /> +
+ +
+
+ ) +}) diff --git a/src/components/layouts/AppLayout.tsx b/src/components/layouts/AppLayout.tsx index 773eab512..5e8b5369e 100644 --- a/src/components/layouts/AppLayout.tsx +++ b/src/components/layouts/AppLayout.tsx @@ -8,7 +8,7 @@ import type { AggregateRoot } from '@mx-space/api-client' import { MetaFooter } from '~/components/biz/Meta/footer' import { DynamicHeadMeta } from '~/components/biz/Meta/head' import Loader from '~/components/universal/Loader' -import { ModalStackProvider } from '~/components/universal/Modal/stack.context' +import { ModalStackProvider } from '~/components/universal/Modal/stack-context' import { useRootTrackerListener } from '~/hooks/use-analyze' import { useCheckLogged } from '~/hooks/use-check-logged' import { useCheckOldBrowser } from '~/hooks/use-check-old-browser' diff --git a/src/components/layouts/DebugLayout.tsx b/src/components/layouts/DebugLayout.tsx index 480d06ddb..cd7428737 100644 --- a/src/components/layouts/DebugLayout.tsx +++ b/src/components/layouts/DebugLayout.tsx @@ -3,7 +3,7 @@ import { useEffect } from 'react' import { store } from '~/store' -import { ModalStackProvider } from '../universal/Modal/stack.context' +import { ModalStackProvider } from '../universal/Modal/stack-context' export const DebugLayout: FC = (props) => { useEffect(() => { diff --git a/src/components/universal/Markdown/MarkdownToc.tsx b/src/components/universal/Markdown/MarkdownToc.tsx index aad43258e..1c9bfe3da 100644 --- a/src/components/universal/Markdown/MarkdownToc.tsx +++ b/src/components/universal/Markdown/MarkdownToc.tsx @@ -9,7 +9,7 @@ import { FluentList16Filled } from '@mx-space/kami-design/components/Icons/share import type { TocProps } from '~/components/widgets/Toc' import { useStore } from '~/store' -import { useModalStack } from '../Modal/stack.context' +import { useModalStack } from '../Modal/stack-context' const Toc = dynamic( () => import('~/components/widgets/Toc').then((m) => m.Toc), diff --git a/src/components/universal/Modal/index.tsx b/src/components/universal/Modal/Modal.tsx similarity index 95% rename from src/components/universal/Modal/index.tsx rename to src/components/universal/Modal/Modal.tsx index 2c4625407..ea0eeafe8 100644 --- a/src/components/universal/Modal/index.tsx +++ b/src/components/universal/Modal/Modal.tsx @@ -13,7 +13,7 @@ import { CloseIcon } from '@mx-space/kami-design/components/Icons/layout' import { useStore } from '~/store' import { BottomUpTransitionView } from '../Transition/bottom-up' -import styles from './index.module.css' +import styles from './modal.module.css' import { ScaleModalTransition } from './scale-transition' export interface ModalProps { @@ -24,6 +24,7 @@ export interface ModalProps { modalClassName?: string contentClassName?: string noBlur?: boolean + fixedWidth?: boolean } export type ModalRefObject = { @@ -65,6 +66,7 @@ export const Modal = observer(
h4 { - @apply font-medium text-lg m-0; - } -} - -.content { - @apply p-6; - - &.has-title { - @apply -mt-5; - } -} diff --git a/src/components/universal/Modal/index.ts b/src/components/universal/Modal/index.ts new file mode 100644 index 000000000..88ee8fe77 --- /dev/null +++ b/src/components/universal/Modal/index.ts @@ -0,0 +1,2 @@ +export * from './Modal' +export * from './stack-context' diff --git a/src/components/universal/Modal/modal.module.css b/src/components/universal/Modal/modal.module.css new file mode 100644 index 000000000..16024818a --- /dev/null +++ b/src/components/universal/Modal/modal.module.css @@ -0,0 +1,65 @@ +.modal { + @apply bg-bg-opacity min-h-8 min-w-30 rounded-lg block overflow-hidden shadow-md relative; + + @apply flex flex-col; + + backdrop-filter: blur(20px) saturate(180%); + + &.no-blur { + @apply bg-light-bg; + + backdrop-filter: none; + } + + @apply max-w-65vw max-h-70vh; + + @screen phone { + @apply max-w-95vw max-h-85vh; + } + + @screen tablet { + @apply max-w-85vw max-h-70vh; + } + + &.fixed-width { + @apply w-65vw; + + @screen phone { + @apply w-95vw; + } + + @screen tablet { + @apply w-85vw; + } + } +} + +.modal.drawer { + @apply !max-w-screen !w-full !max-h-90vh !w-screen bg-light-bg; + + border-radius: 12px 12px 0 0; +} + +.close-btn { + @apply absolute h-16 top-0 right-0 w-16 flex items-center justify-center; +} + +.header { + @apply flex-shrink-0 h-16; +} + +.title-wrapper { + @apply h-16 px-6 relative box-content flex items-center flex-shrink-0; + + > h4 { + @apply font-medium text-lg m-0; + } +} + +.content { + @apply p-6 overflow-auto flex-grow flex-shrink; + + &.has-title { + @apply pt-1; + } +} diff --git a/src/components/universal/Modal/stack.context.tsx b/src/components/universal/Modal/stack-context.tsx similarity index 97% rename from src/components/universal/Modal/stack.context.tsx rename to src/components/universal/Modal/stack-context.tsx index 64e407200..8cce0b864 100644 --- a/src/components/universal/Modal/stack.context.tsx +++ b/src/components/universal/Modal/stack-context.tsx @@ -21,10 +21,10 @@ import React, { import { useIsClient } from '~/hooks/use-is-client' import { useStore } from '~/store' -import type { ModalProps, ModalRefObject } from '.' -import { Modal } from '.' import type { OverlayProps } from '../Overlay' import { Overlay } from '../Overlay' +import type { ModalProps, ModalRefObject } from './Modal' +import { Modal } from './Modal' /** * @param {boolean} immediately 立即销毁,不会等待动画结束 @@ -65,7 +65,7 @@ export interface IModalStackComponent extends UniversalProps { */ component: ReactNode | ReactElement | React.FC /** - * 传递组件的 props, 可以是一个函数, 如果是函数, 则会在 Modal 出现的时候调用获取 props + * 传递组件的 props, 可以是一个函数,如果是函数,则会在 Modal 出现的时候调用获取 props */ props?: T | (() => T) /** diff --git a/src/components/widgets/Comment/box.tsx b/src/components/widgets/Comment/box.tsx index 21ecbbd49..3eddc1c10 100644 --- a/src/components/widgets/Comment/box.tsx +++ b/src/components/widgets/Comment/box.tsx @@ -133,28 +133,28 @@ export const CommentBox: FC<{ if (!logged) { if (author === userStore.name || author === userStore.username) { - return message.error('昵称与我主人重名了, 但是你好像并不是我的主人唉') + return message.error('昵称与我主人重名了,但是你好像并不是我的主人唉') } if (!author || !text || !mail) { - message.error('小可爱, 能把信息填完整么') + message.error('小可爱,能把信息填完整么') return } if (url && !isUrl(url, { require_protocol: true })) { - message.error('小可爱, 网址格式不正确哦') + message.error('小可爱,网址格式不正确哦') return } if (!isEmail(mail)) { - message.error('小可爱, 邮箱格式不正确哦') + message.error('小可爱,邮箱格式不正确哦') return } if (author.length > 20) { - message.error('昵称太长了了啦, 服务器会坏掉的') + message.error('昵称太长了了啦,服务器会坏掉的') return } } if (text.length > 500) { - message.error('内容太长了了啦, 服务器会坏掉的') + message.error('内容太长了了啦,服务器会坏掉的') return } const model = { @@ -280,7 +280,7 @@ export const CommentBox: FC<{ placeholder={ !logged ? '嘿 ︿( ̄︶ ̄)︿, 留个评论好不好嘛~' - : '主人, 说点什么好呢? ' + : '主人,说点什么好呢?' } /> @@ -289,6 +289,7 @@ export const CommentBox: FC<{ >
(
@@ -170,7 +204,7 @@ const RecentlyPage: NextPage = () => { {hasNext && (
- {loading && } + {isLoading && }
)} @@ -179,75 +213,4 @@ const RecentlyPage: NextPage = () => { ) } -const RefPreview: FC<{ refModel: any }> = (props) => { - const title = props.refModel?.title - - const url = useMemo(() => { - return urlBuilder.build(props.refModel) - }, [props.refModel]) - - if (!title) { - return null - } - - return ( - <> - -

- 发表于: - {title} -

- - ) -} - -const RecentlyBox: FC = memo(() => { - const [content, setText] = useState('') - - const taRef = useRef(null) - const handleSubmit = useCallback(() => { - apiClient.shorthand.proxy.post({ data: { content } }).then(() => { - setText('') - taRef.current && (taRef.current.value = '') - }) - }, [content]) - return ( -
{ - e.preventDefault() - handleSubmit() - }, - [handleSubmit], - )} - > - { - setText(e.target.value) - }} - autoFocus={true} - placeholder={'今天遇到了什么烦心事?'} - /> -
- -
-
- ) -}) export default NoSSRWrapper(observer(RecentlyPage)) diff --git a/src/utils/client.ts b/src/utils/client.ts index 847de2bc2..2624c09f0 100644 --- a/src/utils/client.ts +++ b/src/utils/client.ts @@ -1,4 +1,4 @@ -import type { AxiosError } from 'axios' +import type { AxiosError, AxiosInstance } from 'axios' import { CanceledError } from 'axios' import { message } from 'react-message-popup' @@ -24,7 +24,7 @@ export const apiClient = createClient(axiosAdaptor)(API_URL, { const uuid = genUUID() -export const $axios = axiosAdaptor.default +export const $axios = axiosAdaptor.default as AxiosInstance $axios.defaults.timeout = 10000 @@ -57,7 +57,7 @@ $axios.interceptors.response.use( error.code === 'ECONNABORTED' ) { if (isClientSide()) { - message.error('请求超时, 请检查一下网络哦!') + message.error('请求超时,请检查一下网络哦!') } else { const msg = '上游服务器请求超时' message.error(msg) diff --git a/tsconfig.json b/tsconfig.json index 2a9a74bed..b221796ee 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -30,23 +30,24 @@ "isolatedModules": true, "incremental": true, "paths": { + "@mx-space/kami-design": [ + "../packages/kami-design" + ], + "@mx-space/kami-design/*": [ + "../packages/kami-design/*" + ], "~/*": [ "./*" ], "~": [ "." ], - "@mx-space/kami-design": [ - "../packages/kami-design" - ], - "@mx-space/kami-design/*": [ - "../packages/kami-design/*" - ] } }, "exclude": [ ".next", - "server/**/*.*" + "server/**/*.*", + "packages/kami-design/dist/**/*.*" ], "include": [ "next-env.d.ts",