chore: i have no idea...

This commit is contained in:
hakadao
2022-11-09 00:29:07 +08:00
parent 1035e98899
commit ec3b91b686
3 changed files with 390 additions and 236 deletions

221
pnpm-lock.yaml generated
View File

@@ -1,4 +1,4 @@
lockfileVersion: 5.3
lockfileVersion: 5.4
specifiers:
'@antfu/eslint-config': ^0.23.1
@@ -47,14 +47,14 @@ dependencies:
vue-router: 4.0.13_vue@3.2.38
devDependencies:
'@antfu/eslint-config': 0.23.1_eslint@8.23.0+typescript@4.8.2
'@antfu/eslint-config': 0.23.1_yqf6kl63nyoq5megxukfnom5rm
'@ffflorian/jszip-cli': 3.1.6
'@iconify/json': 2.1.103
'@intlify/vite-plugin-vue-i18n': 6.0.1_vite@2.9.15+vue-i18n@9.1.9
'@types/fs-extra': 9.0.13
'@types/node': 17.0.45
'@types/webextension-polyfill': 0.8.3
'@typescript-eslint/eslint-plugin': 5.36.2_eslint@8.23.0+typescript@4.8.2
'@typescript-eslint/eslint-plugin': 5.36.2_yqf6kl63nyoq5megxukfnom5rm
'@vitejs/plugin-vue': 2.3.4_vite@2.9.15+vue@3.2.38
'@vue/compiler-sfc': 3.2.38
'@vue/test-utils': 2.0.2_vue@3.2.38
@@ -72,8 +72,8 @@ devDependencies:
sass: 1.54.8
tsup: 5.12.9_typescript@4.8.2
typescript: 4.8.2
unplugin-auto-import: 0.7.2_@vueuse+core@8.9.4+vite@2.9.15
unplugin-icons: 0.14.9_8085575a03d8ca20ebacf707d7bb2cba
unplugin-auto-import: 0.7.2_tz26lugnys4zsg624icbm2tdye
unplugin-icons: 0.14.9_qccvowqd3dfcb25m64d5pozmxi
unplugin-vue-components: 0.19.9_vite@2.9.15+vue@3.2.38
vite: 2.9.15_sass@1.54.8
vite-plugin-windicss: 1.8.7_vite@2.9.15
@@ -86,16 +86,16 @@ devDependencies:
packages:
/@antfu/eslint-config-basic/0.23.1_eslint@8.23.0+typescript@4.8.2:
/@antfu/eslint-config-basic/0.23.1_iurrlxgqcgk5svigzxakafpeuu:
resolution: {integrity: sha512-9h0hqK+E/upIrSVTo2Nt2SQoKRqouDhiJcrdkOx3RgvQkcZItuZnpWI2WGDMWQ3WTjE4fYyd+F4p7Mx/QHvX8w==}
peerDependencies:
eslint: '>=7.4.0'
dependencies:
eslint: 8.23.0
eslint-plugin-antfu: 0.23.1_eslint@8.23.0+typescript@4.8.2
eslint-plugin-antfu: 0.23.1_yqf6kl63nyoq5megxukfnom5rm
eslint-plugin-eslint-comments: 3.2.0_eslint@8.23.0
eslint-plugin-html: 6.2.0
eslint-plugin-import: 2.26.0_eslint@8.23.0
eslint-plugin-import: 2.26.0_iepzrjnvahcxaf6zc7cutko6om
eslint-plugin-jsonc: 2.4.0_eslint@8.23.0
eslint-plugin-markdown: 2.2.1_eslint@8.23.0
eslint-plugin-n: 15.2.5_eslint@8.23.0
@@ -105,64 +105,73 @@ packages:
jsonc-eslint-parser: 2.1.0
yaml-eslint-parser: 0.5.0
transitivePeerDependencies:
- '@typescript-eslint/parser'
- eslint-import-resolver-typescript
- eslint-import-resolver-webpack
- supports-color
- typescript
dev: true
/@antfu/eslint-config-react/0.23.1_eslint@8.23.0+typescript@4.8.2:
/@antfu/eslint-config-react/0.23.1_yqf6kl63nyoq5megxukfnom5rm:
resolution: {integrity: sha512-mg/wcl3AxvHljpnFGji6+7i2uyBqtL3YnCeLcjM6pvOq6DqhMkIsWUYiVonaqEOdTczcNGTvjwZpLlElBAOOgQ==}
peerDependencies:
eslint: '>=7.4.0'
dependencies:
'@antfu/eslint-config-ts': 0.23.1_eslint@8.23.0+typescript@4.8.2
'@antfu/eslint-config-ts': 0.23.1_yqf6kl63nyoq5megxukfnom5rm
eslint: 8.23.0
eslint-plugin-react: 7.31.7_eslint@8.23.0
transitivePeerDependencies:
- eslint-import-resolver-typescript
- eslint-import-resolver-webpack
- supports-color
- typescript
dev: true
/@antfu/eslint-config-ts/0.23.1_eslint@8.23.0+typescript@4.8.2:
/@antfu/eslint-config-ts/0.23.1_yqf6kl63nyoq5megxukfnom5rm:
resolution: {integrity: sha512-n/CZU17ZSbHKLKojX3QKuUxHhpbXXbxmOMQQP9W20/bsYo0ewpPotBwF0hjeN1B7D7uH8NGp+CoGzhnN7UyffA==}
peerDependencies:
eslint: '>=7.4.0'
typescript: '>=3.9'
dependencies:
'@antfu/eslint-config-basic': 0.23.1_eslint@8.23.0+typescript@4.8.2
'@typescript-eslint/eslint-plugin': 5.36.2_452315dcd01195d95506cdc0a015e4a5
'@typescript-eslint/parser': 5.36.2_eslint@8.23.0+typescript@4.8.2
'@antfu/eslint-config-basic': 0.23.1_iurrlxgqcgk5svigzxakafpeuu
'@typescript-eslint/eslint-plugin': 5.36.2_iurrlxgqcgk5svigzxakafpeuu
'@typescript-eslint/parser': 5.36.2_yqf6kl63nyoq5megxukfnom5rm
eslint: 8.23.0
typescript: 4.8.2
transitivePeerDependencies:
- eslint-import-resolver-typescript
- eslint-import-resolver-webpack
- supports-color
dev: true
/@antfu/eslint-config-vue/0.23.1_eslint@8.23.0+typescript@4.8.2:
/@antfu/eslint-config-vue/0.23.1_yqf6kl63nyoq5megxukfnom5rm:
resolution: {integrity: sha512-rkOSQuHHoYuB64qRuIwGqK1cdKi6UabfUHxjZSQn586f8fKzcDGoLWFZkHx6e66lEAECKLlVc4VmrKIVuUX2jw==}
peerDependencies:
eslint: '>=7.4.0'
dependencies:
'@antfu/eslint-config-ts': 0.23.1_eslint@8.23.0+typescript@4.8.2
'@antfu/eslint-config-ts': 0.23.1_yqf6kl63nyoq5megxukfnom5rm
eslint: 8.23.0
eslint-plugin-vue: 8.7.1_eslint@8.23.0
transitivePeerDependencies:
- eslint-import-resolver-typescript
- eslint-import-resolver-webpack
- supports-color
- typescript
dev: true
/@antfu/eslint-config/0.23.1_eslint@8.23.0+typescript@4.8.2:
/@antfu/eslint-config/0.23.1_yqf6kl63nyoq5megxukfnom5rm:
resolution: {integrity: sha512-yHx9wiEnGrb22qil15U/2tIyFa+AbpHRdDn6xpyaONsRsa5FphrP/v1imbiF278HJZOzZ9qWvnrihKVtfOaPSw==}
peerDependencies:
eslint: '>=7.4.0'
dependencies:
'@antfu/eslint-config-react': 0.23.1_eslint@8.23.0+typescript@4.8.2
'@antfu/eslint-config-vue': 0.23.1_eslint@8.23.0+typescript@4.8.2
'@typescript-eslint/eslint-plugin': 5.36.2_452315dcd01195d95506cdc0a015e4a5
'@typescript-eslint/parser': 5.36.2_eslint@8.23.0+typescript@4.8.2
'@antfu/eslint-config-react': 0.23.1_yqf6kl63nyoq5megxukfnom5rm
'@antfu/eslint-config-vue': 0.23.1_yqf6kl63nyoq5megxukfnom5rm
'@typescript-eslint/eslint-plugin': 5.36.2_iurrlxgqcgk5svigzxakafpeuu
'@typescript-eslint/parser': 5.36.2_yqf6kl63nyoq5megxukfnom5rm
eslint: 8.23.0
eslint-plugin-eslint-comments: 3.2.0_eslint@8.23.0
eslint-plugin-html: 6.2.0
eslint-plugin-import: 2.26.0_eslint@8.23.0
eslint-plugin-import: 2.26.0_iepzrjnvahcxaf6zc7cutko6om
eslint-plugin-jsonc: 2.4.0_eslint@8.23.0
eslint-plugin-n: 15.2.5_eslint@8.23.0
eslint-plugin-promise: 6.0.1_eslint@8.23.0
@@ -172,6 +181,8 @@ packages:
jsonc-eslint-parser: 2.1.0
yaml-eslint-parser: 0.5.0
transitivePeerDependencies:
- eslint-import-resolver-typescript
- eslint-import-resolver-webpack
- supports-color
- typescript
dev: true
@@ -194,11 +205,19 @@ packages:
'@babel/highlight': 7.14.5
dev: true
/@babel/helper-string-parser/7.19.4:
resolution: {integrity: sha512-nHtDoQcuqFmwYNYPz3Rah5ph2p8PFeFCsZk9A/48dPc/rGocJ5J3hAAZ7pb76VWX3fZKu+uEr/FhH5jLx7umrw==}
engines: {node: '>=6.9.0'}
/@babel/helper-validator-identifier/7.18.6:
resolution: {integrity: sha512-MmetCkz9ej86nJQV+sFCxoGGrUbU3q02kgLciwkrt9QqEB7cP39oKEY0PakknEO0Gu20SskMRi+AYZ3b1TpN9g==}
engines: {node: '>=6.9.0'}
dev: true
/@babel/helper-validator-identifier/7.19.1:
resolution: {integrity: sha512-awrNfaMtnHUr653GgGEs++LlAvW6w+DcPrOliSMXWCKo597CwL5Acf/wWdNkf/tfEQE3mjkeD1YOVZOUV/od1w==}
engines: {node: '>=6.9.0'}
/@babel/highlight/7.14.5:
resolution: {integrity: sha512-qf9u2WFWVV0MppaL877j2dBtQIDgmidgjGk5VIMw3OadXvYaXn66U1BFlH2t4+t3i+8PhedppRv+i40ABzd+gg==}
engines: {node: '>=6.9.0'}
@@ -212,7 +231,8 @@ packages:
resolution: {integrity: sha512-74bEXKX2h+8rrfQUfsBfuZZHzsEs6Eql4pqy/T4Nn6Y9wNPggQOqD6z6pn5Bl8ZfysKouFZT/UXEH94ummEeQw==}
engines: {node: '>=6.0.0'}
hasBin: true
dev: true
dependencies:
'@babel/types': 7.20.2
/@babel/runtime/7.13.9:
resolution: {integrity: sha512-aY2kU+xgJ3dJ1eU6FMB9EH8dIe8dmusF1xEku52joLvw6eAFN0AI+WxCLDnpev2LEejWBAy2sBvBOBAjI3zmvA==}
@@ -220,6 +240,14 @@ packages:
regenerator-runtime: 0.13.9
dev: true
/@babel/types/7.20.2:
resolution: {integrity: sha512-FnnvsNWgZCr232sqtXggapvlkk/tuwR/qhGzcmxI0GXLCjmPYQPzio2FbdlWuY6y1sHFfQKk+rRbUZ9VStQMog==}
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
/@devicefarmer/adbkit-logcat/1.1.0:
resolution: {integrity: sha512-K90P5gUXM/w+yzLvJIRQ+tJooNU6ipUPPQkljtPJ0laR66TGtpt4Gqsjm0n9dPHK1W5KGgU1R5wnCd6RTSlPNA==}
engines: {node: '>= 0.10.4'}
@@ -244,6 +272,8 @@ packages:
debug: 2.6.9
node-forge: 0.10.0
split: 0.3.3
transitivePeerDependencies:
- supports-color
dev: true
/@esbuild-kit/cjs-loader/2.3.3:
@@ -374,8 +404,8 @@ packages:
- supports-color
dev: true
/@intlify/bundle-utils/3.1.0_vue-i18n@9.1.9:
resolution: {integrity: sha512-ghlJ0kR2cCQ8D+poKknC0Xx0ncOt3J3os7CcIAqqIWVF7k6AtGoCDnIru+YzlZcvFRNmP9wEZ7jKliojCdAWNg==}
/@intlify/bundle-utils/3.2.1_vue-i18n@9.1.9:
resolution: {integrity: sha512-rf4cLBOnbqmpXVcCdcYHilZpMt1m82syh3WLBJlZvGxN2KkH9HeHVH4+bnibF/SDXCHNh6lM6wTpS/qw+PkcMg==}
engines: {node: '>= 12'}
peerDependencies:
petite-vue-i18n: '*'
@@ -386,8 +416,8 @@ packages:
vue-i18n:
optional: true
dependencies:
'@intlify/message-compiler': 9.3.0-beta.3
'@intlify/shared': 9.3.0-beta.3
'@intlify/message-compiler': 9.3.0-beta.6
'@intlify/shared': 9.3.0-beta.6
jsonc-eslint-parser: 1.4.1
source-map: 0.6.1
vue-i18n: 9.1.9_vue@3.2.38
@@ -404,14 +434,12 @@ packages:
'@intlify/runtime': 9.1.9
'@intlify/shared': 9.1.9
'@intlify/vue-devtools': 9.1.9
dev: false
/@intlify/devtools-if/9.1.9:
resolution: {integrity: sha512-oKSMKjttG3Ut/1UGEZjSdghuP3fwA15zpDPcjkf/1FjlOIm6uIBGMNS5jXzsZy593u+P/YcnrZD6cD3IVFz9vQ==}
engines: {node: '>= 10'}
dependencies:
'@intlify/shared': 9.1.9
dev: false
/@intlify/message-compiler/9.1.9:
resolution: {integrity: sha512-6YgCMF46Xd0IH2hMRLCssZI3gFG4aywidoWQ3QP4RGYQXQYYfFC54DxhSgfIPpVoPLQ+4AD29eoYmhiHZ+qLFQ==}
@@ -420,20 +448,18 @@ packages:
'@intlify/message-resolver': 9.1.9
'@intlify/shared': 9.1.9
source-map: 0.6.1
dev: false
/@intlify/message-compiler/9.3.0-beta.3:
resolution: {integrity: sha512-j8OwToBQgs01RBMX4GCDNQfcnmw3AiDG3moKIONTrfXcf+1yt/rWznLTYH/DXbKcFMAFijFpCzMYjUmH1jVFYA==}
/@intlify/message-compiler/9.3.0-beta.6:
resolution: {integrity: sha512-3PJqRJoqvFHExA9DCkf7fZYKbvYne1tYQ0fptJAhUOZsELarh8wr4aPLKWCkQSRuutdrtZ/n5CcPgJgUmVthDw==}
engines: {node: '>= 14'}
dependencies:
'@intlify/shared': 9.3.0-beta.3
'@intlify/shared': 9.3.0-beta.6
source-map: 0.6.1
dev: true
/@intlify/message-resolver/9.1.9:
resolution: {integrity: sha512-Lx/DBpigeK0sz2BBbzv5mu9/dAlt98HxwbG7xLawC3O2xMF9MNWU5FtOziwYG6TDIjNq0O/3ZbOJAxwITIWXEA==}
engines: {node: '>= 10'}
dev: false
/@intlify/runtime/9.1.9:
resolution: {integrity: sha512-XgPw8+UlHCiie3fI41HPVa/VDJb3/aSH7bLhY1hJvlvNV713PFtb4p4Jo+rlE0gAoMsMCGcsiT982fImolSltg==}
@@ -442,15 +468,13 @@ packages:
'@intlify/message-compiler': 9.1.9
'@intlify/message-resolver': 9.1.9
'@intlify/shared': 9.1.9
dev: false
/@intlify/shared/9.1.9:
resolution: {integrity: sha512-xKGM1d0EAxdDFCWedcYXOm6V5Pfw/TMudd6/qCdEb4tv0hk9EKeg7lwQF1azE0dP2phvx0yXxrt7UQK+IZjNdw==}
engines: {node: '>= 10'}
dev: false
/@intlify/shared/9.3.0-beta.3:
resolution: {integrity: sha512-Z/0TU4GhFKRxKh+0RbwJExik9zz57gXYgxSYaPn7YQdkQ/pabSioCY/SXnYxQHL6HzULF5tmqarFm6glbGqKhw==}
/@intlify/shared/9.3.0-beta.6:
resolution: {integrity: sha512-ITA1R4tvJYwZXT5x6QCSwxcwQ4dU52zrzVm/EUbgsp8oWzYS1xexBrxyNM80PSQudYvL2rvcZJKQ7yBh7b0LkQ==}
engines: {node: '>= 14'}
dev: true
@@ -469,8 +493,8 @@ packages:
vue-i18n:
optional: true
dependencies:
'@intlify/bundle-utils': 3.1.0_vue-i18n@9.1.9
'@intlify/shared': 9.3.0-beta.3
'@intlify/bundle-utils': 3.2.1_vue-i18n@9.1.9
'@intlify/shared': 9.3.0-beta.6
'@rollup/pluginutils': 4.2.1
debug: 4.3.4
fast-glob: 3.2.11
@@ -488,7 +512,6 @@ packages:
'@intlify/message-resolver': 9.1.9
'@intlify/runtime': 9.1.9
'@intlify/shared': 9.1.9
dev: false
/@mdn/browser-compat-data/4.1.12:
resolution: {integrity: sha512-y3Ntio6hb5+m6asxcA3nnIN6URjAFMji2EZZVYGd2Ag5On4mmvPhMnXdiIScCMXgHjFX+5qXuKaojLLhJHZPAg==}
@@ -564,6 +587,12 @@ packages:
resolution: {integrity: sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==}
dev: true
/@types/keyv/3.1.4:
resolution: {integrity: sha512-BQ5aZNSCpj7D6K2ksrRCTmKRLEpnPvWDiLPfoGyhZ++8YtiK9d/3DBKPJgry359X/P1PfruyYwvnvwFjuEiEIg==}
dependencies:
'@types/node': 17.0.45
dev: true
/@types/mdast/3.0.10:
resolution: {integrity: sha512-W864tg/Osz1+9f4lrGTZpCSO5/z4608eUp19tbozkq2HJK6i3z1kT0H9tlADXuYIb1YYOBByU4Jsqkk75q48qA==}
dependencies:
@@ -586,6 +615,12 @@ packages:
resolution: {integrity: sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA==}
dev: true
/@types/responselike/1.0.0:
resolution: {integrity: sha512-85Y2BjiufFzaMIlvJDvTTB8Fxl2xfLo4HgmHzVBz08w4wDePCTjYw66PdrolO0kzli3yam/YCgRufyo1DdQVTA==}
dependencies:
'@types/node': 17.0.45
dev: true
/@types/unist/2.0.6:
resolution: {integrity: sha512-PBjIUxZHOuj0R15/xuwJYjFi+KZdNFrehocChv4g5hu6aFroHue8m0lBP0POdK2nKzbw0cgV1mws8+V/JAcEkQ==}
dev: true
@@ -604,7 +639,7 @@ packages:
'@types/node': 17.0.45
dev: true
/@typescript-eslint/eslint-plugin/5.36.2_452315dcd01195d95506cdc0a015e4a5:
/@typescript-eslint/eslint-plugin/5.36.2_iurrlxgqcgk5svigzxakafpeuu:
resolution: {integrity: sha512-OwwR8LRwSnI98tdc2z7mJYgY60gf7I9ZfGjN5EjCwwns9bdTuQfAXcsjSB2wSQ/TVNYSGKf4kzVXbNGaZvwiXw==}
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
peerDependencies:
@@ -615,10 +650,10 @@ packages:
typescript:
optional: true
dependencies:
'@typescript-eslint/parser': 5.36.2_eslint@8.23.0+typescript@4.8.2
'@typescript-eslint/parser': 5.36.2_yqf6kl63nyoq5megxukfnom5rm
'@typescript-eslint/scope-manager': 5.36.2
'@typescript-eslint/type-utils': 5.36.2_eslint@8.23.0+typescript@4.8.2
'@typescript-eslint/utils': 5.36.2_eslint@8.23.0+typescript@4.8.2
'@typescript-eslint/type-utils': 5.36.2_yqf6kl63nyoq5megxukfnom5rm
'@typescript-eslint/utils': 5.36.2_yqf6kl63nyoq5megxukfnom5rm
debug: 4.3.4
eslint: 8.23.0
functional-red-black-tree: 1.0.1
@@ -631,7 +666,7 @@ packages:
- supports-color
dev: true
/@typescript-eslint/eslint-plugin/5.36.2_eslint@8.23.0+typescript@4.8.2:
/@typescript-eslint/eslint-plugin/5.36.2_yqf6kl63nyoq5megxukfnom5rm:
resolution: {integrity: sha512-OwwR8LRwSnI98tdc2z7mJYgY60gf7I9ZfGjN5EjCwwns9bdTuQfAXcsjSB2wSQ/TVNYSGKf4kzVXbNGaZvwiXw==}
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
peerDependencies:
@@ -643,8 +678,8 @@ packages:
optional: true
dependencies:
'@typescript-eslint/scope-manager': 5.36.2
'@typescript-eslint/type-utils': 5.36.2_eslint@8.23.0+typescript@4.8.2
'@typescript-eslint/utils': 5.36.2_eslint@8.23.0+typescript@4.8.2
'@typescript-eslint/type-utils': 5.36.2_yqf6kl63nyoq5megxukfnom5rm
'@typescript-eslint/utils': 5.36.2_yqf6kl63nyoq5megxukfnom5rm
debug: 4.3.4
eslint: 8.23.0
functional-red-black-tree: 1.0.1
@@ -657,7 +692,7 @@ packages:
- supports-color
dev: true
/@typescript-eslint/parser/5.36.2_eslint@8.23.0+typescript@4.8.2:
/@typescript-eslint/parser/5.36.2_yqf6kl63nyoq5megxukfnom5rm:
resolution: {integrity: sha512-qS/Kb0yzy8sR0idFspI9Z6+t7mqk/oRjnAYfewG+VN73opAUvmYL3oPIMmgOX6CnQS6gmVIXGshlb5RY/R22pA==}
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
peerDependencies:
@@ -685,7 +720,7 @@ packages:
'@typescript-eslint/visitor-keys': 5.36.2
dev: true
/@typescript-eslint/type-utils/5.36.2_eslint@8.23.0+typescript@4.8.2:
/@typescript-eslint/type-utils/5.36.2_yqf6kl63nyoq5megxukfnom5rm:
resolution: {integrity: sha512-rPQtS5rfijUWLouhy6UmyNquKDPhQjKsaKH0WnY6hl/07lasj8gPaH2UD8xWkePn6SC+jW2i9c2DZVDnL+Dokw==}
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
peerDependencies:
@@ -696,7 +731,7 @@ packages:
optional: true
dependencies:
'@typescript-eslint/typescript-estree': 5.36.2_typescript@4.8.2
'@typescript-eslint/utils': 5.36.2_eslint@8.23.0+typescript@4.8.2
'@typescript-eslint/utils': 5.36.2_yqf6kl63nyoq5megxukfnom5rm
debug: 4.3.4
eslint: 8.23.0
tsutils: 3.21.0_typescript@4.8.2
@@ -731,7 +766,7 @@ packages:
- supports-color
dev: true
/@typescript-eslint/utils/5.36.2_eslint@8.23.0+typescript@4.8.2:
/@typescript-eslint/utils/5.36.2_yqf6kl63nyoq5megxukfnom5rm:
resolution: {integrity: sha512-uNcopWonEITX96v9pefk9DC1bWMdkweeSsewJ6GeC7L6j2t0SJywisgkr9wUTtXk90fi2Eljj90HSHm3OGdGRg==}
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
peerDependencies:
@@ -775,14 +810,12 @@ packages:
'@vue/shared': 3.2.38
estree-walker: 2.0.2
source-map: 0.6.1
dev: true
/@vue/compiler-dom/3.2.38:
resolution: {integrity: sha512-zqX4FgUbw56kzHlgYuEEJR8mefFiiyR3u96498+zWPsLeh1WKvgIReoNE+U7gG8bCUdvsrJ0JRmev0Ky6n2O0g==}
dependencies:
'@vue/compiler-core': 3.2.38
'@vue/shared': 3.2.38
dev: true
/@vue/compiler-sfc/3.2.38:
resolution: {integrity: sha512-KZjrW32KloMYtTcHAFuw3CqsyWc5X6seb8KbkANSWt3Cz9p2qA8c1GJpSkksFP9ABb6an0FLCFl46ZFXx3kKpg==}
@@ -797,18 +830,15 @@ packages:
magic-string: 0.25.7
postcss: 8.3.8
source-map: 0.6.1
dev: true
/@vue/compiler-ssr/3.2.38:
resolution: {integrity: sha512-bm9jOeyv1H3UskNm4S6IfueKjUNFmi2kRweFIGnqaGkkRePjwEcfCVqyS3roe7HvF4ugsEkhf4+kIvDhip6XzQ==}
dependencies:
'@vue/compiler-dom': 3.2.38
'@vue/shared': 3.2.38
dev: true
/@vue/devtools-api/6.0.12:
resolution: {integrity: sha512-iO/4FIezHKXhiDBdKySCvJVh8/mZPxHpiQrTy+PXVqJZgpTPTdHy4q8GXulaY+UKEagdkBb0onxNQZ0LNiqVhw==}
dev: false
/@vue/reactivity-transform/3.2.38:
resolution: {integrity: sha512-3SD3Jmi1yXrDwiNJqQ6fs1x61WsDLqVk4NyKVz78mkaIRh6d3IqtRnptgRfXn+Fzf+m6B1KxBYWq1APj6h4qeA==}
@@ -818,20 +848,17 @@ packages:
'@vue/shared': 3.2.38
estree-walker: 2.0.2
magic-string: 0.25.7
dev: true
/@vue/reactivity/3.2.38:
resolution: {integrity: sha512-6L4myYcH9HG2M25co7/BSo0skKFHpAN8PhkNPM4xRVkyGl1K5M3Jx4rp5bsYhvYze2K4+l+pioN4e6ZwFLUVtw==}
dependencies:
'@vue/shared': 3.2.38
dev: true
/@vue/runtime-core/3.2.38:
resolution: {integrity: sha512-kk0qiSiXUU/IKxZw31824rxmFzrLr3TL6ZcbrxWTKivadoKupdlzbQM4SlGo4MU6Zzrqv4fzyUasTU1jDoEnzg==}
dependencies:
'@vue/reactivity': 3.2.38
'@vue/shared': 3.2.38
dev: true
/@vue/runtime-dom/3.2.38:
resolution: {integrity: sha512-4PKAb/ck2TjxdMSzMsnHViOrrwpudk4/A56uZjhzvusoEU9xqa5dygksbzYepdZeB5NqtRw5fRhWIiQlRVK45A==}
@@ -839,7 +866,6 @@ packages:
'@vue/runtime-core': 3.2.38
'@vue/shared': 3.2.38
csstype: 2.6.17
dev: true
/@vue/server-renderer/3.2.38_vue@3.2.38:
resolution: {integrity: sha512-pg+JanpbOZ5kEfOZzO2bt02YHd+ELhYP8zPeLU1H0e7lg079NtuuSB8fjLdn58c4Ou8UQ6C1/P+528nXnLPAhA==}
@@ -849,11 +875,9 @@ packages:
'@vue/compiler-ssr': 3.2.38
'@vue/shared': 3.2.38
vue: 3.2.38
dev: true
/@vue/shared/3.2.38:
resolution: {integrity: sha512-dTyhTIRmGXBjxJE+skC8tTWCGLCVc4wQgRRLt8+O9p5ewBAjoBwtCAkLPrtToSr1xltoe3st21Pv953aOZ7alg==}
dev: true
/@vue/test-utils/2.0.2_vue@3.2.38:
resolution: {integrity: sha512-E2P4oXSaWDqTZNbmKZFVLrNN/siVN78YkEqs7pHryWerrlZR9bBFLWdJwRoguX45Ru6HxIflzKl4vQvwRMwm5g==}
@@ -1495,6 +1519,8 @@ packages:
escape-string-regexp: 4.0.0
is-wsl: 2.2.0
lighthouse-logger: 1.3.0
transitivePeerDependencies:
- supports-color
dev: true
/ci-info/2.0.0:
@@ -1755,7 +1781,6 @@ packages:
/csstype/2.6.17:
resolution: {integrity: sha512-u1wmTI1jJGzCJzWndZo8mk4wnPTZd1eOIYTYvuEyOQGfmDl3TrabCCfKnOC86FZwW/9djqTl933UF/cS425i9A==}
dev: true
/dashdash/1.14.1:
resolution: {integrity: sha512-jRFi8UDGo6j+odZiEpjazZaWqEal3w/basFjQHQEwVtZJGDpxbH1MeYluwCS8Xq5wmLJooDlMgvVarmWfGM44g==}
@@ -1779,12 +1804,22 @@ packages:
/debug/2.6.9:
resolution: {integrity: sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==}
peerDependencies:
supports-color: '*'
peerDependenciesMeta:
supports-color:
optional: true
dependencies:
ms: 2.0.0
dev: true
/debug/3.2.7:
resolution: {integrity: sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==}
peerDependencies:
supports-color: '*'
peerDependenciesMeta:
supports-color:
optional: true
dependencies:
ms: 2.1.3
dev: true
@@ -2562,25 +2597,43 @@ packages:
dependencies:
debug: 3.2.7
resolve: 1.22.1
transitivePeerDependencies:
- supports-color
dev: true
/eslint-module-utils/2.7.4_eslint@8.23.0:
/eslint-module-utils/2.7.4_jkckkukndwd4xurous7ym67tze:
resolution: {integrity: sha512-j4GT+rqzCoRKHwURX7pddtIPGySnX9Si/cgMI5ztrcqOPtk5dDEeZ34CQVPphnqkJytlc97Vuk05Um2mJ3gEQA==}
engines: {node: '>=4'}
peerDependencies:
'@typescript-eslint/parser': '*'
eslint: '*'
eslint-import-resolver-node: '*'
eslint-import-resolver-typescript: '*'
eslint-import-resolver-webpack: '*'
peerDependenciesMeta:
'@typescript-eslint/parser':
optional: true
eslint:
optional: true
eslint-import-resolver-node:
optional: true
eslint-import-resolver-typescript:
optional: true
eslint-import-resolver-webpack:
optional: true
dependencies:
'@typescript-eslint/parser': 5.36.2_yqf6kl63nyoq5megxukfnom5rm
debug: 3.2.7
eslint: 8.23.0
eslint-import-resolver-node: 0.3.6
transitivePeerDependencies:
- supports-color
dev: true
/eslint-plugin-antfu/0.23.1_eslint@8.23.0+typescript@4.8.2:
/eslint-plugin-antfu/0.23.1_yqf6kl63nyoq5megxukfnom5rm:
resolution: {integrity: sha512-GCc4hqHqPPVM4xIFHUKJFpOZbl9C48t9SupePiNjFisUHAxrZj/c1EHCt0LV0TONJHtSZDR53NNWMuB3O2USSg==}
dependencies:
'@typescript-eslint/utils': 5.36.2_eslint@8.23.0+typescript@4.8.2
'@typescript-eslint/utils': 5.36.2_yqf6kl63nyoq5megxukfnom5rm
transitivePeerDependencies:
- eslint
- supports-color
@@ -2615,19 +2668,24 @@ packages:
htmlparser2: 7.2.0
dev: true
/eslint-plugin-import/2.26.0_eslint@8.23.0:
/eslint-plugin-import/2.26.0_iepzrjnvahcxaf6zc7cutko6om:
resolution: {integrity: sha512-hYfi3FXaM8WPLf4S1cikh/r4IxnO6zrhZbEGz2b660EJRbuxgpDS5gkCuYgGWg2xxh2rBuIr4Pvhve/7c31koA==}
engines: {node: '>=4'}
peerDependencies:
'@typescript-eslint/parser': '*'
eslint: ^2 || ^3 || ^4 || ^5 || ^6 || ^7.2.0 || ^8
peerDependenciesMeta:
'@typescript-eslint/parser':
optional: true
dependencies:
'@typescript-eslint/parser': 5.36.2_yqf6kl63nyoq5megxukfnom5rm
array-includes: 3.1.5
array.prototype.flat: 1.3.0
debug: 2.6.9
doctrine: 2.1.0
eslint: 8.23.0
eslint-import-resolver-node: 0.3.6
eslint-module-utils: 2.7.4_eslint@8.23.0
eslint-module-utils: 2.7.4_jkckkukndwd4xurous7ym67tze
has: 1.0.3
is-core-module: 2.10.0
is-glob: 4.0.3
@@ -2635,6 +2693,10 @@ packages:
object.values: 1.1.5
resolve: 1.22.1
tsconfig-paths: 3.14.1
transitivePeerDependencies:
- eslint-import-resolver-typescript
- eslint-import-resolver-webpack
- supports-color
dev: true
/eslint-plugin-jsonc/2.4.0_eslint@8.23.0:
@@ -2994,7 +3056,6 @@ packages:
/estree-walker/2.0.2:
resolution: {integrity: sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==}
dev: true
/esutils/2.0.3:
resolution: {integrity: sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==}
@@ -3432,6 +3493,8 @@ packages:
dependencies:
'@sindresorhus/is': 0.14.0
'@szmarczak/http-timer': 1.1.2
'@types/keyv': 3.1.4
'@types/responselike': 1.0.0
cacheable-request: 6.1.0
decompress-response: 3.3.0
duplexer3: 0.1.4
@@ -4223,6 +4286,8 @@ packages:
dependencies:
debug: 2.6.9
marky: 1.2.2
transitivePeerDependencies:
- supports-color
dev: true
/lilconfig/2.0.3:
@@ -4364,7 +4429,6 @@ packages:
resolution: {integrity: sha512-4CrMT5DOHTDk4HYDlzmwu4FVCcIYI8gauveasrdCu2IKIFOJ3f0v/8MDGJCDL9oD2ppz/Av1b0Nj345H9M+XIA==}
dependencies:
sourcemap-codec: 1.4.8
dev: true
/magic-string/0.26.3:
resolution: {integrity: sha512-u1Po0NDyFcwdg2nzHT88wSK0+Rih0N1M+Ph1Sp08k8yvFFU3KR72wryS7e1qMPJypt99WB7fIFVCA92mQrMjrg==}
@@ -4574,7 +4638,6 @@ packages:
/nanocolors/0.2.12:
resolution: {integrity: sha512-SFNdALvzW+rVlzqexid6epYdt8H9Zol7xDoQarioEFcFN0JHo4CYNztAxmtfgGTVRCmFlEOqqhBpoFGKqSAMug==}
dev: true
/nanoevents/6.0.2:
resolution: {integrity: sha512-FRS2otuFcPPYDPYViNWQ42+1iZqbXydinkRHTHFxrF4a1CpBfmydR9zkI44WSXAXCyPrkcGtPk5CnpW6Y3lFKQ==}
@@ -4585,7 +4648,6 @@ packages:
resolution: {integrity: sha512-rdwtIXaXCLFAQbnfqDRnI6jaRHp9fTcYBjtFKE8eezcZ7LuLjhUaQGNeMXf1HmRoCH32CLz6XwX0TtxEOS/A3Q==}
engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1}
hasBin: true
dev: true
/nanoid/3.3.4:
resolution: {integrity: sha512-MqBkQh/OHTS2egovRtLk45wEyNXwF+cokD+1YPf9u5VfJiRdAiRwB2froX5Co9Rh20xs4siNPm8naNotSD6RBw==}
@@ -5094,7 +5156,6 @@ packages:
nanocolors: 0.2.12
nanoid: 3.1.25
source-map-js: 0.6.2
dev: true
/postcss/8.4.12:
resolution: {integrity: sha512-lg6eITwYe9v6Hr5CncVbK70SoioNQIq81nsaG86ev5hAidQvmOeETBqs7jm43K2F5/Ley3ytDtriImV6TpNiSg==}
@@ -5633,7 +5694,6 @@ packages:
/source-map-js/0.6.2:
resolution: {integrity: sha512-/3GptzWzu0+0MBQFrDKzw/DvvMTUORvgY6k6jd/VS6iCR4RDTKWH6v6WPwQoUO8667uQEf9Oe38DxAYWY5F/Ug==}
engines: {node: '>=0.10.0'}
dev: true
/source-map-js/1.0.2:
resolution: {integrity: sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==}
@@ -5667,7 +5727,6 @@ packages:
/sourcemap-codec/1.4.8:
resolution: {integrity: sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA==}
dev: true
/spawn-sync/1.0.15:
resolution: {integrity: sha512-9DWBgrgYZzNghseho0JOuh+5fg9u6QWhAWa51QC7+U5rCheZ/j1DrEZnyE0RBBRqZ9uEXGPgSSM0nky6burpVw==}
@@ -5992,6 +6051,10 @@ packages:
rimraf: 3.0.2
dev: true
/to-fast-properties/2.0.0:
resolution: {integrity: sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog==}
engines: {node: '>=4'}
/to-readable-stream/1.0.0:
resolution: {integrity: sha512-Iq25XBt6zD5npPhlLVXGFN3/gyR2/qODcKNNyTMd4vbm39HUaOiAM4PMq0eMVC/Tkxz+Zjdsc55g9yyz+Yq00Q==}
engines: {node: '>=6'}
@@ -6233,7 +6296,7 @@ packages:
engines: {node: '>= 10.0.0'}
dev: true
/unplugin-auto-import/0.7.2_@vueuse+core@8.9.4+vite@2.9.15:
/unplugin-auto-import/0.7.2_tz26lugnys4zsg624icbm2tdye:
resolution: {integrity: sha512-VzaYUa2VByUT70WSFlOXoovyWuwC/8ePKQUC9fhU+BRmvTC7qhCVgChH/NieWMEVgyT+HhacxM+W7xMEOmA+MA==}
engines: {node: '>=14'}
peerDependencies:
@@ -6256,7 +6319,7 @@ packages:
- webpack
dev: true
/unplugin-icons/0.14.9_8085575a03d8ca20ebacf707d7bb2cba:
/unplugin-icons/0.14.9_qccvowqd3dfcb25m64d5pozmxi:
resolution: {integrity: sha512-vPyVfNREH88dP6gszdaoGkAEFPpiScXj1A8eWN905jQgT53A3tsiPEiqJjCHOUVcsUaREt2JSudzumFOsCA78A==}
peerDependencies:
'@svgr/core': '>=5.5.0'
@@ -6590,7 +6653,6 @@ packages:
'@intlify/vue-devtools': 9.1.9
'@vue/devtools-api': 6.0.12
vue: 3.2.38
dev: false
/vue-router/4.0.13_vue@3.2.38:
resolution: {integrity: sha512-LmXrC+BkDRLak+d5xTMgUYraT3Nj0H/vCbP+7usGvIl9Viqd1UP6AsP0i69pSbn9O0dXK/xCdp4yPw21HqV9Jw==}
@@ -6609,7 +6671,6 @@ packages:
'@vue/runtime-dom': 3.2.38
'@vue/server-renderer': 3.2.38_vue@3.2.38
'@vue/shared': 3.2.38
dev: true
/w3c-hr-time/1.0.2:
resolution: {integrity: sha512-z8P5DvDNjKDoFIHK7q8r8lackT6l+jo/Ye3HOle7l9nICP9lf1Ci25fy9vHd0JOWewkIFzXIEig3TdKT7JQ5fQ==}

View File

@@ -1,8 +1,9 @@
<script lang="ts">
import { isNewArticle, isNewVideo, setLastestOffsetID } from './notify'
import { language } from '~/logic'
import { getUserID, calcTimeSince } from '~/utils'
import { MomentItem, MomentType, LanguageType } from '~/types'
import { calcTimeSince, getUserID } from '~/utils'
import type { MomentItem } from '~/types'
import { LanguageType, MomentType } from '~/types'
export default defineComponent({
data() {
@@ -38,7 +39,8 @@ export default defineComponent({
},
watch: {
selectedTab(newVal: number, oldVal: number) {
if (newVal === oldVal) return
if (newVal === oldVal)
return
this.scrollToTop(this.$refs.momentsWrap as HTMLElement, 300)
this.moments = []
@@ -59,8 +61,12 @@ export default defineComponent({
const momentsWrap = this.$refs.momentsWrap as HTMLDivElement
momentsWrap.addEventListener('scroll', () => {
if (momentsWrap.clientHeight + momentsWrap.scrollTop >= momentsWrap.scrollHeight
&& this.moments.length > 0 && !this.isLoading) {
if (
momentsWrap.clientHeight + momentsWrap.scrollTop
>= momentsWrap.scrollHeight
&& this.moments.length > 0
&& !this.isLoading
) {
if (this.selectedTab === 0 && !this.noMoreContent)
this.getHistoryMoments([MomentType.Video, MomentType.Bangumi])
else if (this.selectedTab === 1 && !this.noMoreContent)
@@ -73,99 +79,139 @@ export default defineComponent({
methods: {
onClickTab(tabId: number) {
// Prevent changing tab when loading, cuz it will cause a bug
if (this.isLoading) return
if (this.isLoading)
return
this.selectedTab = tabId
this.momentTabs.forEach((tab) => {
tab.isSelected = tab.id === tabId
})
},
getHistoryList() {
this.isLoading = true
browser.runtime
.sendMessage({
contentScriptQuery: 'getHistoryList',
// uid: getUserID(),
// typeList,
})
.then((res) => {
if (res.code === 0) {
if (this.moments.length !== 0 && res.data.cards.length < 20) {
this.isLoading = false
this.noMoreContent = true
return
}
res.data.cards.forEach((item: any) => {
this.pushItemIntoMoments(item)
})
// set this lastest offset id, which will clear the new moment's marker point
// after you watch these moments.
if (this.selectedTab === 0)
setLastestOffsetID(MomentType.Video, this.moments[0].id)
else if (this.selectedTab === 2)
setLastestOffsetID(MomentType.Article, this.moments[0].id)
this.noMoreContent = false
}
this.isLoading = false
})
},
getNewMoments(typeList: number[]) {
this.isLoading = true
browser.runtime.sendMessage({
contentScriptQuery: 'getNewMoments',
uid: getUserID(),
typeList,
}).then((res) => {
if (res.code === 0) {
if (this.moments.length !== 0 && res.data.cards.length < 20) {
this.isLoading = false
this.noMoreContent = true
return
browser.runtime
.sendMessage({
contentScriptQuery: 'getNewMoments',
uid: getUserID(),
typeList,
})
.then((res) => {
if (res.code === 0) {
if (this.moments.length !== 0 && res.data.cards.length < 20) {
this.isLoading = false
this.noMoreContent = true
return
}
res.data.cards.forEach((item: any) => {
this.pushItemIntoMoments(item)
})
// set this lastest offset id, which will clear the new moment's marker point
// after you watch these moments.
if (this.selectedTab === 0)
setLastestOffsetID(MomentType.Video, this.moments[0].id)
else if (this.selectedTab === 2)
setLastestOffsetID(MomentType.Article, this.moments[0].id)
this.noMoreContent = false
}
res.data.cards.forEach((item: any) => {
this.pushItemIntoMoments(item)
})
// set this lastest offset id, which will clear the new moment's marker point
// after you watch these moments.
if (this.selectedTab === 0)
setLastestOffsetID(MomentType.Video, this.moments[0].id)
else if (this.selectedTab === 2)
setLastestOffsetID(MomentType.Article, this.moments[0].id)
this.noMoreContent = false
}
this.isLoading = false
})
this.isLoading = false
})
},
getHistoryMoments(typeList: number[]) {
this.isLoading = true
browser.runtime.sendMessage({
contentScriptQuery: 'getHistoryMoments',
uid: getUserID(),
typeList,
offsetDynamicID: this.moments[this.moments.length - 1].dynamic_id_str,
}).then((res) => {
if (res.code === 0) {
if (res.data.has_more === 0) {
this.isLoading = false
this.noMoreContent = true
return
}
browser.runtime
.sendMessage({
contentScriptQuery: 'getHistoryMoments',
uid: getUserID(),
typeList,
offsetDynamicID: this.moments[this.moments.length - 1].dynamic_id_str,
})
.then((res) => {
if (res.code === 0) {
if (res.data.has_more === 0) {
this.isLoading = false
this.noMoreContent = true
return
}
res.data.cards.forEach((item: any) => {
this.pushItemIntoMoments(item)
})
this.noMoreContent = false
}
this.isLoading = false
})
res.data.cards.forEach((item: any) => {
this.pushItemIntoMoments(item)
})
this.noMoreContent = false
}
this.isLoading = false
})
},
getLiveMoments(page: number) {
this.isLoading = true
browser.runtime.sendMessage({
contentScriptQuery: 'getLiveMoments',
page,
pageSize: 10,
}).then((res) => {
if (res.code === 0) {
// if the length of this list is less then the pageSize, it means that it have no more contents
if (this.moments.length !== 0 && res.data.list.length < 10) {
this.isLoading = false
this.noMoreContent = true
return
}
browser.runtime
.sendMessage({
contentScriptQuery: 'getLiveMoments',
page,
pageSize: 10,
})
.then((res) => {
if (res.code === 0) {
// if the length of this list is less then the pageSize, it means that it have no more contents
if (this.moments.length !== 0 && res.data.list.length < 10) {
this.isLoading = false
this.noMoreContent = true
return
}
// if the length of this list is equal to the pageSize, this means that it may have the next page.
if (res.data.list.length === 10)
this.livePage++
res.data.list.forEach((item: any) => {
this.moments.push({
id: item.roomid,
uid: item.uid,
name: item.uname,
face: item.face,
url: item.link,
title: item.title,
cover: item.pic,
} as MomentItem)
})
this.noMoreContent = false
}
this.isLoading = false
})
// if the length of this list is equal to the pageSize, this means that it may have the next page.
if (res.data.list.length === 10)
this.livePage++
res.data.list.forEach((item: any) => {
this.moments.push({
id: item.roomid,
uid: item.uid,
name: item.uname,
face: item.face,
url: item.link,
title: item.title,
cover: item.pic,
} as MomentItem)
})
this.noMoreContent = false
}
this.isLoading = false
})
},
pushItemIntoMoments(item: any) {
const card = JSON.parse(item.card)
@@ -224,8 +270,9 @@ export default defineComponent({
* smooth scroll to the top of the html element
*/
scrollToTop(element: HTMLElement, duration: number) {
// cancel if already on top
if (element.scrollTop === 0) return
// cancel if already on top
if (element.scrollTop === 0)
return
const cosParameter = element.scrollTop / 2
let scrollCount = 0
@@ -234,9 +281,11 @@ export default defineComponent({
function step(newTimestamp: number) {
if (oldTimestamp !== 0) {
// if duration is 0 scrollCount will be Infinity
scrollCount += Math.PI * (newTimestamp - oldTimestamp) / duration
if (scrollCount >= Math.PI) return element.scrollTop = 0
element.scrollTop = cosParameter + cosParameter * Math.cos(scrollCount)
scrollCount += (Math.PI * (newTimestamp - oldTimestamp)) / duration
if (scrollCount >= Math.PI)
return (element.scrollTop = 0)
element.scrollTop
= cosParameter + cosParameter * Math.cos(scrollCount)
}
oldTimestamp = newTimestamp
window.requestAnimationFrame(step)
@@ -289,10 +338,15 @@ export default defineComponent({
<!-- moments wrapper -->
<div ref="momentsWrap" h="430px" overflow="y-scroll" p="x-4">
<!-- loading -->
<loading v-if="isLoading && moments.length === 0" h="full" flex="~" items="center"></loading>
<loading
v-if="isLoading && moments.length === 0"
h="full"
flex="~"
items="center"
/>
<!-- empty -->
<empty v-if="!isLoading && moments.length === 0" w="full" h="full"></empty>
<empty v-if="!isLoading && moments.length === 0" w="full" h="full" />
<!-- moments -->
<transition-group name="list">
@@ -322,37 +376,69 @@ export default defineComponent({
bg="$bew-theme-color"
pos="absolute -top-10px -left-10px"
style="box-shadow: 0 0 4px var(--bew-theme-color)"
></div>
/>
<a
:href="moment.type === MomentType.Video ? 'https://space.bilibili.com/' + moment.uid : moment.url"
:href="
moment.type === MomentType.Video
? `https://space.bilibili.com/${moment.uid}`
: moment.url
"
target="_blank"
>
<img :src="moment.face + '@60w_60h_1c'" rounded="$bew-radius" w="40px" h="40px" m="r-4" />
<img
:src="`${moment.face}@60w_60h_1c`"
rounded="$bew-radius"
w="40px"
h="40px"
m="r-4"
>
</a>
<div flex="~" justify="between" w="full">
<div>
<span>{{ moment.name }}</span> {{ $t('topbar.moments_dropdown.uploaded') }}{{ moment.title }}
<div v-if="moment.type !== MomentType.Bangumi" text="$bew-text-2 sm" m="y-2">
<span>{{ moment.name }}</span>
{{ $t('topbar.moments_dropdown.uploaded') }}{{ moment.title }}
<div
v-if="moment.type !== MomentType.Bangumi"
text="$bew-text-2 sm"
m="y-2"
>
<!-- Videos and articles -->
<div v-if="selectedTab === 0 || selectedTab === 2">
{{ calcTimeSince(new Date(moment.ctime * 1000)) }}{{ language === LanguageType.English ? ' ' + $t('common.ago') : $t('common.ago') }}
{{ calcTimeSince(new Date(moment.ctime * 1000))
}}{{
language === LanguageType.English
? ` ${$t('common.ago')}`
: $t('common.ago')
}}
</div>
<!-- Live -->
<div v-else-if="selectedTab === 1" text="$bew-theme-color" font="bold" flex="~" items="center">
<fluent:live-24-filled m="r-2" /> {{ $t('topbar.moments_dropdown.live_status') }}
<div
v-else-if="selectedTab === 1"
text="$bew-theme-color"
font="bold"
flex="~"
items="center"
>
<fluent:live-24-filled m="r-2" />
{{ $t('topbar.moments_dropdown.live_status') }}
</div>
</div>
</div>
<img :src="moment.cover + '@128w_72h_1c'" w="82px" h="46px" m="l-4" rounded="$bew-radius" />
<img
:src="`${moment.cover}@128w_72h_1c`"
w="82px"
h="46px"
m="l-4"
rounded="$bew-radius"
>
</div>
</a>
</transition-group>
<!-- loading -->
<loading v-if="isLoading && moments.length !== 0" m="-t-4"></loading>
<loading v-if="isLoading && moments.length !== 0" m="-t-4" />
</div>
</div>
</template>

View File

@@ -1,5 +1,6 @@
<script lang="ts">
import MomentsDropdown from './MomentsDropdown.vue'
import HistoryDropdown from './HistoryDropdown.vue'
import { updateInterval } from './notify'
import { getUserID } from '~/utils'
@@ -15,6 +16,7 @@ export default defineComponent({
showNotificationsDropDown: false,
showMomentsDropDown: false,
showUploadDropDown: false,
showHistoryDropDown: false,
isLogin: !!getUserID(),
unReadmessage: {},
unReadDm: {},
@@ -34,10 +36,8 @@ export default defineComponent({
this.initUserPanel()
document.addEventListener('scroll', () => {
if (window.scrollY > 0)
this.showTopbarMask = true
else
this.showTopbarMask = false
if (window.scrollY > 0) this.showTopbarMask = true
else this.showTopbarMask = false
})
},
methods: {
@@ -82,38 +82,40 @@ export default defineComponent({
contentScriptQuery: 'getUserInfo',
})
.then((res) => {
if (res.code === 0)
this.userInfo = res.data
if (res.code === 0) this.userInfo = res.data
})
},
async getUnreadMessageCount() {
if (!this.isLogin)
return
if (!this.isLogin) return
await browser.runtime
.sendMessage({
contentScriptQuery: 'getUnreadMsg',
}).then(res => this.unReadmessage = res.data)
})
.then((res) => (this.unReadmessage = res.data))
await browser.runtime
.sendMessage({
contentScriptQuery: 'getUnreadDm',
}).then(res => this.unReadDm = res.data)
})
.then((res) => (this.unReadDm = res.data))
this.unReadmessageCount = 0
for (const [key, value] of Object.entries(this.unReadmessage))
for (const [key, value] of Object.entries(this.unReadmessage)) {
if (key !== 'up') this.unReadmessageCount += parseInt(`${value}`)
}
for (const [, value] of Object.entries(this.unReadDm))
this.unReadmessageCount += parseInt(`${value}`)
},
getNewMomentsCount() {
if (!this.isLogin)
return
if (!this.isLogin) return
browser.runtime
.sendMessage({
contentScriptQuery: 'getNewMomentsCount',
}).then((res) => {
})
.then((res) => {
this.newMomentsCount = res.data.update_info.item.count
})
},
@@ -138,7 +140,7 @@ export default defineComponent({
opacity="100"
pointer="none"
style="background: linear-gradient(var(--bew-bg), transparent)"
></div>
/>
</transition>
<div
@@ -146,10 +148,7 @@ export default defineComponent({
@mouseenter.self="showLogoMenuDropdown()"
@mouseleave.self="closeLogoMenuDropdown()"
>
<div
ref="logo"
class="logo"
>
<div ref="logo" class="logo">
<svg
t="1645466458357"
class="icon"
@@ -166,7 +165,12 @@ export default defineComponent({
/>
</svg>
<tabler:chevron-down w="!4" h="!4" m="l-4" icon="stroke-4 fill-$bew-text-1" />
<tabler:chevron-down
w="!4"
h="!4"
m="l-4"
icon="stroke-4 fill-$bew-text-1"
/>
</div>
<transition name="slide">
<logo-menu-dropdown
@@ -174,16 +178,12 @@ export default defineComponent({
class="bew-popover"
pos="!left-0 !top-70px"
transform="!translate-x-0"
></logo-menu-dropdown>
/>
</transition>
</div>
<!-- search bar -->
<div
flex="~"
w="full"
justify="md:center <md:end"
>
<div flex="~" w="full" justify="md:center <md:end">
<!-- <button
class="icon-btn"
text="$bew-text-1 2xl"
@@ -192,16 +192,16 @@ export default defineComponent({
>
<tabler:search />
</button> -->
<search-bar
ref="searchBar"
></search-bar>
<search-bar ref="searchBar" />
</div>
<!-- right content -->
<div class="right-side">
<div v-if="!isLogin" class="right-side-item">
<a href="https://passport.bilibili.com/login" class="login">
<ic-outline-account-circle class="text-base mr-2" />{{ $t('topbar.sign_in') }}
<ic-outline-account-circle class="text-base mr-2" />{{
$t('topbar.sign_in')
}}
</a>
</div>
<template v-if="isLogin">
@@ -214,18 +214,28 @@ export default defineComponent({
<a
id="avatar-img"
ref="avatarImg"
:href="'https://space.bilibili.com/' + mid"
:href="`https://space.bilibili.com/${mid}`"
target="_blank"
class="rounded-full z-1 w-40px h-40px bg-$bew-fill-3 bg-cover bg-center"
:style="{ backgroundImage: `url(${(userInfo.face + '').replace('http:', '')})` }"
></a>
:style="{
backgroundImage: `url(${`${userInfo.face}`.replace(
'http:',
''
)})`,
}"
/>
<div
id="avatar-shadow"
ref="avatarShadow"
class="absolute top-0 rounded-full z-0 w-40px h-40px filter blur-sm bg-cover bg-center"
opacity="80"
:style="{ backgroundImage: `url(${(userInfo.face + '').replace('http:', '')})` }"
></div>
:style="{
backgroundImage: `url(${`${userInfo.face}`.replace(
'http:',
''
)})`,
}"
/>
<transition name="slide">
<user-panel-dropdown
v-if="showUserPanel"
@@ -233,7 +243,7 @@ export default defineComponent({
:user-info="userInfo"
after:h="!0"
class="bew-popover"
></user-panel-dropdown>
/>
</transition>
</div>
@@ -243,10 +253,7 @@ export default defineComponent({
@mouseenter="showNotificationsDropDown = true"
@mouseleave="showNotificationsDropDown = false"
>
<div
v-if="unReadmessageCount !== 0"
class="unread-message"
>
<div v-if="unReadmessageCount !== 0" class="unread-message">
{{ unReadmessageCount > 999 ? '999+' : unReadmessageCount }}
</div>
<a
@@ -262,7 +269,7 @@ export default defineComponent({
v-if="showNotificationsDropDown"
ref="notificationsDropdown"
class="bew-popover"
></notifications-dropdown>
/>
</transition>
</div>
@@ -272,10 +279,7 @@ export default defineComponent({
@mouseenter="showMomentsDropDown = true"
@mouseleave="showMomentsDropDown = false"
>
<div
v-if="newMomentsCount !== 0"
class="unread-message"
>
<div v-if="newMomentsCount !== 0" class="unread-message">
{{ newMomentsCount > 999 ? '999+' : newMomentsCount }}
</div>
<a
@@ -287,18 +291,14 @@ export default defineComponent({
</a>
<transition name="slide">
<moments-dropdown
v-if="showMomentsDropDown"
class="bew-popover"
>
</moments-dropdown>
<MomentsDropdown v-if="showMomentsDropDown" class="bew-popover" />
</transition>
</div>
<!-- Favorites -->
<div class="right-side-item">
<a
:href="'https://space.bilibili.com/' + mid + '/favlist'"
:href="`https://space.bilibili.com/${mid}/favlist`"
target="_blank"
:title="$t('topbar.favorites')"
>
@@ -307,7 +307,11 @@ export default defineComponent({
</div>
<!-- History -->
<div class="right-side-item">
<div
class="right-side-item"
@mouseenter="showHistoryDropDown = true"
@mouseleave="showHistoryDropDown = false"
>
<a
href="https://www.bilibili.com/account/history"
target="_blank"
@@ -315,6 +319,10 @@ export default defineComponent({
>
<tabler:clock />
</a>
<transition name="slide">
<HistoryDropdown v-if="showHistoryDropDown" class="bew-popover" />
</transition>
</div>
<!-- Createive center -->
@@ -343,10 +351,9 @@ export default defineComponent({
p="xl:auto <xl:unset"
>
<tabler:upload />
<span
m="l-2"
display="xl:block <xl:hidden"
>{{ $t('topbar.upload') }}</span>
<span m="l-2" display="xl:block <xl:hidden">{{
$t('topbar.upload')
}}</span>
</a>
<transition name="slide">
@@ -355,7 +362,7 @@ export default defineComponent({
class="bew-popover"
pos="!left-auto !-right-2"
transform="!translate-x-0"
></upload-dropdown>
/>
</transition>
</div>
</template>