From f9fb943bf12853ea8e78f58dfe2475bfe9106dcb Mon Sep 17 00:00:00 2001 From: ADJazz <68748165+ADJazzzz@users.noreply.github.com> Date: Sat, 24 Aug 2024 10:38:41 +0800 Subject: [PATCH 1/5] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b68f6c9..29dc9cd 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,7 @@ **注意事项** -- # 还在旧版UI的同学请安装[1.3.6](https://github.com/ADJazzzz/BLSPAM/releases/tag/1.3.6)版本 +- ### 还在旧版UI的同学请安装[1.3.6](https://github.com/ADJazzzz/BLSPAM/releases/tag/1.3.6)版本 - 使用独轮车可能会对直播间环境造成污染,若你的账号被封禁或禁言,本脚本、作者以及贡献者不负任何责任 - 本脚本会使用你的账号信息用于对B站相关API请求 - 本脚本只会对B站相关域名、依赖CDN 和 Github API 发起请求 From 99423938c44320b438e2df85d5d7217e0faa3ab3 Mon Sep 17 00:00:00 2001 From: ADJazz <68748165+ADJazzzz@users.noreply.github.com> Date: Mon, 2 Sep 2024 20:36:37 +0800 Subject: [PATCH 2/5] =?UTF-8?q?perf:=20=E9=80=82=E9=85=8D=E6=96=B0?= =?UTF-8?q?=E6=97=A7=E4=B8=A4=E7=A7=8DUI=E5=B8=83=E5=B1=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/App.vue | 38 ++++++++++++++++++++++++-------------- 1 file changed, 24 insertions(+), 14 deletions(-) diff --git a/src/App.vue b/src/App.vue index c75ac74..2e782a2 100644 --- a/src/App.vue +++ b/src/App.vue @@ -31,15 +31,15 @@ const uiStore = useUIStore() const moduleStore = useModuleStore() uiStore.uiConfig.isShowPanel = false -const renderPanel = () => { - pollingQuery(document, '.chat-input-ctnr-new.p-relative', 300, 300, true).then((controlPanelLeft) => { +const renderPanel = (elementName: string, ctrStyle: object) => { + pollingQuery(document, elementName, 300, 300, true).then((controlPanelContent) => { const buttonNode = h( NButton, { class: 'blspam_btn', text: true, tag: 'div', - style: { marginRight: '4px', alignSelf: 'center' }, + style: ctrStyle, focusable: false, bordered: false, onClick: () => { @@ -75,29 +75,39 @@ const renderPanel = () => { } ) - render(buttonNode, controlPanelLeft) + render(buttonNode, controlPanelContent) }) } - -const handleUpdateCollapse = (collapsed: boolean) => { - uiStore.uiConfig.isCollapsed = collapsed -} - const handleUpdateTheme = () => { const biliTheme = unsafeWindow.bililiveThemeV2.getTheme() uiStore.uiConfig.theme = biliTheme } - const observer = new MutationObserver((mutationsList, observer) => { const controlPanel = dq('#control-panel-ctnr-box') if (controlPanel) { - renderPanel() - observer.disconnect() - logger.log('初始化完成') + const oldTheme = dq('.icon-left-part') + const newTheme = dq('.chat-input-ctnr-new.p-relative') + + if (oldTheme || newTheme) { + if (oldTheme) { + renderPanel('.icon-left-part', { marginLeft: '4px', display: 'inline-block' }) + } + if (newTheme) { + renderPanel('.chat-input-ctnr-new.p-relative', { + marginRight: '4px', + alignSelf: 'center' + }) + } + observer.disconnect() + logger.log('初始化完成') + } } }) - observer.observe(document.body, { childList: true, subtree: true }) + +const handleUpdateCollapse = (collapsed: boolean) => { + uiStore.uiConfig.isCollapsed = collapsed +} // n-config-provider 的 preflight-style-disabled 属性不知道为什么不生效,只能这样了 GM_addStyle('body { font-size: 12px }') From 9a0ee8b132aadc8b67e326b024ce7222e51879d8 Mon Sep 17 00:00:00 2001 From: ADJazz <68748165+ADJazzzz@users.noreply.github.com> Date: Mon, 2 Sep 2024 20:37:29 +0800 Subject: [PATCH 3/5] chore: update dependencies --- package-lock.json | 67 ++++++++++++++++++++++++----------------------- package.json | 6 ++--- 2 files changed, 37 insertions(+), 36 deletions(-) diff --git a/package-lock.json b/package-lock.json index 96eee5d..feedb4a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8,7 +8,7 @@ "name": "bilibili-live-spamer", "version": "1.3.7", "dependencies": { - "axios": "^1.7.4", + "axios": "^1.7.7", "lodash": "^4.17.21", "mitt": "^3.0.1", "naive-ui": "^2.39.0", @@ -17,7 +17,7 @@ }, "devDependencies": { "@rushstack/eslint-patch": "^1.10.4", - "@vitejs/plugin-vue": "^5.1.2", + "@vitejs/plugin-vue": "^5.1.3", "@vue/eslint-config-prettier": "^9.0.0", "@vue/eslint-config-typescript": "^13.0.0", "eslint": "^8.57.0", @@ -27,7 +27,7 @@ "typescript": "^5.5.4", "vite": "^5.4.2", "vite-plugin-monkey": "^4.0.6", - "vue-tsc": "^2.0.29" + "vue-tsc": "^2.1.4" } }, "node_modules/@aashutoshrathi/word-wrap": { @@ -1205,9 +1205,9 @@ "dev": true }, "node_modules/@vitejs/plugin-vue": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/@vitejs/plugin-vue/-/plugin-vue-5.1.2.tgz", - "integrity": "sha512-nY9IwH12qeiJqumTCLJLE7IiNx7HZ39cbHaysEUd+Myvbz9KAqd2yq+U01Kab1R/H1BmiyM2ShTYlNH32Fzo3A==", + "version": "5.1.3", + "resolved": "https://registry.npmjs.org/@vitejs/plugin-vue/-/plugin-vue-5.1.3.tgz", + "integrity": "sha512-3xbWsKEKXYlmX82aOHufFQVnkbMC/v8fLpWwh6hWOUrK5fbbtBh9Q/WWse27BFgSy2/e2c0fz5Scgya9h2GLhw==", "dev": true, "license": "MIT", "engines": { @@ -1219,30 +1219,30 @@ } }, "node_modules/@volar/language-core": { - "version": "2.4.0-alpha.18", - "resolved": "https://registry.npmjs.org/@volar/language-core/-/language-core-2.4.0-alpha.18.tgz", - "integrity": "sha512-JAYeJvYQQROmVRtSBIczaPjP3DX4QW1fOqW1Ebs0d3Y3EwSNRglz03dSv0Dm61dzd0Yx3WgTW3hndDnTQqgmyg==", + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/@volar/language-core/-/language-core-2.4.1.tgz", + "integrity": "sha512-9AKhC7Qn2mQYxj7Dz3bVxeOk7gGJladhWixUYKef/o0o7Bm4an+A3XvmcTHVqZ8stE6lBVH++g050tBtJ4TZPQ==", "dev": true, "license": "MIT", "dependencies": { - "@volar/source-map": "2.4.0-alpha.18" + "@volar/source-map": "2.4.1" } }, "node_modules/@volar/source-map": { - "version": "2.4.0-alpha.18", - "resolved": "https://registry.npmjs.org/@volar/source-map/-/source-map-2.4.0-alpha.18.tgz", - "integrity": "sha512-MTeCV9MUwwsH0sNFiZwKtFrrVZUK6p8ioZs3xFzHc2cvDXHWlYN3bChdQtwKX+FY2HG6H3CfAu1pKijolzIQ8g==", + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/@volar/source-map/-/source-map-2.4.1.tgz", + "integrity": "sha512-Xq6ep3OZg9xUqN90jEgB9ztX5SsTz1yiV8wiQbcYNjWkek+Ie3dc8l7AVt3EhDm9mSIR58oWczHkzM2H6HIsmQ==", "dev": true, "license": "MIT" }, "node_modules/@volar/typescript": { - "version": "2.4.0-alpha.18", - "resolved": "https://registry.npmjs.org/@volar/typescript/-/typescript-2.4.0-alpha.18.tgz", - "integrity": "sha512-sXh5Y8sqGUkgxpMWUGvRXggxYHAVxg0Pa1C42lQZuPDrW6vHJPR0VCK8Sr7WJsAW530HuNQT/ZIskmXtxjybMQ==", + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/@volar/typescript/-/typescript-2.4.1.tgz", + "integrity": "sha512-UoRzC0PXcwajFQTu8XxKSYNsWNBtVja6Y9gC8eLv7kYm+UEKJCcZ8g7dialsOYA0HKs3Vpg57MeCsawFLC6m9Q==", "dev": true, "license": "MIT", "dependencies": { - "@volar/language-core": "2.4.0-alpha.18", + "@volar/language-core": "2.4.1", "path-browserify": "^1.0.1", "vscode-uri": "^3.0.8" } @@ -1353,13 +1353,13 @@ } }, "node_modules/@vue/language-core": { - "version": "2.0.29", - "resolved": "https://registry.npmjs.org/@vue/language-core/-/language-core-2.0.29.tgz", - "integrity": "sha512-o2qz9JPjhdoVj8D2+9bDXbaI4q2uZTHQA/dbyZT4Bj1FR9viZxDJnLcKVHfxdn6wsOzRgpqIzJEEmSSvgMvDTQ==", + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/@vue/language-core/-/language-core-2.1.4.tgz", + "integrity": "sha512-i8pfAgNjTNjabBX1xRsuV6aRw2E8bdQXwd5H8m3cUkTVJju3QN5nfdoXET0uK+yXsuloNJPzo6PXFujRRPNmMA==", "dev": true, "license": "MIT", "dependencies": { - "@volar/language-core": "~2.4.0-alpha.18", + "@volar/language-core": "~2.4.1", "@vue/compiler-dom": "^3.4.0", "@vue/compiler-vue2": "^2.7.16", "@vue/shared": "^3.4.0", @@ -1542,9 +1542,9 @@ "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==" }, "node_modules/axios": { - "version": "1.7.4", - "resolved": "https://registry.npmjs.org/axios/-/axios-1.7.4.tgz", - "integrity": "sha512-DukmaFRnY6AzAALSH4J2M3k6PkaC+MfaAGdEERRWcC9q3/TWQwLpHR8ZRLKTdQ3aBDL64EdluRDjJqKw+BPZEw==", + "version": "1.7.7", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.7.7.tgz", + "integrity": "sha512-S4kL7XrjgBmvdGut0sN3yJxqYzrDOnivkBiN0OFs6hLiUam3UPvswUo0kqGyhqUZGEOytHyumEdXsAkgCOUf3Q==", "license": "MIT", "dependencies": { "follow-redirects": "^1.15.6", @@ -2760,12 +2760,13 @@ } }, "node_modules/micromatch": { - "version": "4.0.5", - "resolved": "https://registry.npmmirror.com/micromatch/-/micromatch-4.0.5.tgz", - "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", + "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", "dev": true, + "license": "MIT", "dependencies": { - "braces": "^3.0.2", + "braces": "^3.0.3", "picomatch": "^2.3.1" }, "engines": { @@ -3838,14 +3839,14 @@ } }, "node_modules/vue-tsc": { - "version": "2.0.29", - "resolved": "https://registry.npmjs.org/vue-tsc/-/vue-tsc-2.0.29.tgz", - "integrity": "sha512-MHhsfyxO3mYShZCGYNziSbc63x7cQ5g9kvijV7dRe1TTXBRLxXyL0FnXWpUF1xII2mJ86mwYpYsUmMwkmerq7Q==", + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/vue-tsc/-/vue-tsc-2.1.4.tgz", + "integrity": "sha512-XTzMXQcsixAvNbpou/9qngEsZawaiJRZH3Ja+lfgRfv2A1TJv9vnZ/Kyv7XxPqv/TaZVFSnjGpM87VbWIg6yQg==", "dev": true, "license": "MIT", "dependencies": { - "@volar/typescript": "~2.4.0-alpha.18", - "@vue/language-core": "2.0.29", + "@volar/typescript": "~2.4.1", + "@vue/language-core": "2.1.4", "semver": "^7.5.4" }, "bin": { diff --git a/package.json b/package.json index f31c2bf..d798742 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,7 @@ "format": "prettier --write src/" }, "dependencies": { - "axios": "^1.7.4", + "axios": "^1.7.7", "lodash": "^4.17.21", "mitt": "^3.0.1", "naive-ui": "^2.39.0", @@ -20,7 +20,7 @@ }, "devDependencies": { "@rushstack/eslint-patch": "^1.10.4", - "@vitejs/plugin-vue": "^5.1.2", + "@vitejs/plugin-vue": "^5.1.3", "@vue/eslint-config-prettier": "^9.0.0", "@vue/eslint-config-typescript": "^13.0.0", "eslint": "^8.57.0", @@ -30,6 +30,6 @@ "typescript": "^5.5.4", "vite": "^5.4.2", "vite-plugin-monkey": "^4.0.6", - "vue-tsc": "^2.0.29" + "vue-tsc": "^2.1.4" } } From b79208cd07f2d52430fb9da59311c76f2e9bb9d0 Mon Sep 17 00:00:00 2001 From: ADJazz <68748165+ADJazzzz@users.noreply.github.com> Date: Mon, 2 Sep 2024 20:46:03 +0800 Subject: [PATCH 4/5] doc: update --- CHANGELOG.md | 8 +++++++- README.md | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 38b8b13..979ea4f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,10 +1,16 @@ ## NEXT_VERSION +## [1.3.8](https://github.com/ADJazzzz/BLSPAM/compare/1.3.7...1.3.8) 2024-09-02 + +### 调整 + +- 适配B站直播新旧两种UI布局 + ## [1.3.7](https://github.com/ADJazzzz/BLSPAM/compare/1.3.6...1.3.7) 2024-08-22 ### 调整 -- 适配B站直播新UI(还在旧版UI的同学请勿更新) +- 适配B站直播新UI ~~(还在旧版UI的同学请勿更新)~~ ## [1.3.6](https://github.com/ADJazzzz/BLSPAM/compare/1.3.5...1.3.6) 2024-08-17 diff --git a/README.md b/README.md index 29dc9cd..55dfccd 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,7 @@ **注意事项** -- ### 还在旧版UI的同学请安装[1.3.6](https://github.com/ADJazzzz/BLSPAM/releases/tag/1.3.6)版本 +- ~~还在旧版UI的同学请安装[1.3.6](https://github.com/ADJazzzz/BLSPAM/releases/tag/1.3.6)版本~~ 新版本(`1.3.8`版本及以上)已支持新旧两种UI布局 - 使用独轮车可能会对直播间环境造成污染,若你的账号被封禁或禁言,本脚本、作者以及贡献者不负任何责任 - 本脚本会使用你的账号信息用于对B站相关API请求 - 本脚本只会对B站相关域名、依赖CDN 和 Github API 发起请求 From 093e41dfe7e345833fffa395a79fb416c609b290 Mon Sep 17 00:00:00 2001 From: ADJazz <68748165+ADJazzzz@users.noreply.github.com> Date: Mon, 2 Sep 2024 20:47:07 +0800 Subject: [PATCH 5/5] release: 1.3.8 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index feedb4a..deb3774 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "bilibili-live-spamer", - "version": "1.3.7", + "version": "1.3.8", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "bilibili-live-spamer", - "version": "1.3.7", + "version": "1.3.8", "dependencies": { "axios": "^1.7.7", "lodash": "^4.17.21", diff --git a/package.json b/package.json index d798742..abdedff 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "bilibili-live-spamer", "private": true, - "version": "1.3.7", + "version": "1.3.8", "type": "module", "scripts": { "dev": "vite",