From b3f778f45ba55d6b8a4f83bf134ea27ec3a62d06 Mon Sep 17 00:00:00 2001 From: the1812 Date: Sat, 21 Dec 2024 20:24:21 +0800 Subject: [PATCH 01/26] Update global fixed exclude (#5039) --- registry/lib/components/style/custom-navbar/entry.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/registry/lib/components/style/custom-navbar/entry.ts b/registry/lib/components/style/custom-navbar/entry.ts index 4318daa33..145420d3c 100644 --- a/registry/lib/components/style/custom-navbar/entry.ts +++ b/registry/lib/components/style/custom-navbar/entry.ts @@ -34,6 +34,7 @@ export const entry: ComponentEntry = async ({ metadata: { name } }) => { 'https://www.bilibili.com/read', 'https://www.bilibili.com/opus', 'https://www.bilibili.com/account/history', + 'https://www.bilibili.com/v/topic/detail', ] if (!globalFixedExclude.some(p => matchUrlPattern(p))) { addComponentListener( From fdec2d8dd60eb2e23a8327a2eba66879d3b19afd Mon Sep 17 00:00:00 2001 From: the1812 Date: Sat, 21 Dec 2024 20:36:31 +0800 Subject: [PATCH 02/26] Fix non-face picture (fix #5040) --- .../style/hide/user-pendent/user-pendent-shadow.scss | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/registry/lib/components/style/hide/user-pendent/user-pendent-shadow.scss b/registry/lib/components/style/hide/user-pendent/user-pendent-shadow.scss index ffba4a2fb..802cdd303 100644 --- a/registry/lib/components/style/hide/user-pendent/user-pendent-shadow.scss +++ b/registry/lib/components/style/hide/user-pendent/user-pendent-shadow.scss @@ -3,10 +3,10 @@ container-name: avatar; // .layers:first-child, .layer:not(:first-child), - .layer:not(:has(picture), :has([style*="/face/"])) { + .layer:not(:has(picture [src*="/face/"]), :has([style*="/face/"])) { display: none; } - .layer:is(:has(picture), :has([style*="/face/"])) { + .layer:is(:has(picture [src*="/face/"]), :has([style*="/face/"])) { min-width: 100cqw; min-height: 100cqh; max-width: 100cqw; From d76293ef0a6898055a0267c5ad3e72778f41baac Mon Sep 17 00:00:00 2001 From: the1812 Date: Sat, 21 Dec 2024 20:51:14 +0800 Subject: [PATCH 03/26] Fix focus lost (fix #4732) --- src/components/launch-bar/LaunchBar.vue | 12 +++++++----- src/components/launch-bar/focus-target.ts | 3 +++ 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/components/launch-bar/LaunchBar.vue b/src/components/launch-bar/LaunchBar.vue index 4a2b8bce7..b8b3b9a86 100644 --- a/src/components/launch-bar/LaunchBar.vue +++ b/src/components/launch-bar/LaunchBar.vue @@ -30,7 +30,7 @@ :action="a" @previous-item="previousItem()" @next-item="nextItem()" - @delete-item="onDeleteItem()" + @delete-item="onDeleteItem(index)" @action=" index === actions.length - 1 && onClearHistory() onAction(a) @@ -49,12 +49,12 @@ class="suggest-item disabled" > @@ -234,7 +234,8 @@ export default Vue.extend({ this.focusTarget.next() e.preventDefault() }, - handleIndexUpdate() { + async handleIndexUpdate() { + await this.$nextTick() if (!this.focusTarget.hasFocus) { this.focusInput() return @@ -248,7 +249,8 @@ export default Vue.extend({ this.focusTarget.next() }, search, - onDeleteItem() { + onDeleteItem(index: number) { + this.focusTarget.setFocus(index) this.focusTarget.previous() this.getActions() }, diff --git a/src/components/launch-bar/focus-target.ts b/src/components/launch-bar/focus-target.ts index 5c1d50bcc..a0ae4c18d 100644 --- a/src/components/launch-bar/focus-target.ts +++ b/src/components/launch-bar/focus-target.ts @@ -26,6 +26,9 @@ export class FocusTarget extends EventTarget { return this.itemIndex > -1 } + setFocus(index: number) { + this.index = index + } reset(length: number, index = this.index) { this.itemLength = length this.index = index From 8c0e0f78588b54065944b46e924215ade1aecff3 Mon Sep 17 00:00:00 2001 From: the1812 Date: Sat, 21 Dec 2024 20:58:51 +0800 Subject: [PATCH 04/26] Fix home mute always executed (fix #5045) --- registry/lib/components/live/home-mute/index.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/registry/lib/components/live/home-mute/index.ts b/registry/lib/components/live/home-mute/index.ts index edd392cd7..b0b971271 100644 --- a/registry/lib/components/live/home-mute/index.ts +++ b/registry/lib/components/live/home-mute/index.ts @@ -37,6 +37,10 @@ export const component = defineComponentMetadata({ 'zh-CN': '提前执行代码以尽快静音.', }, async setup() { + const { isComponentEnabled } = await import('@/core/settings') + if (!isComponentEnabled('liveHomeMute')) { + return + } const { matchUrlPattern } = await import('@/core/utils') if (!matchUrlPattern(liveHome)) { return From 96d204839571b47a19d9a289e50bc574e2070e97 Mon Sep 17 00:00:00 2001 From: the1812 Date: Sat, 21 Dec 2024 21:05:25 +0800 Subject: [PATCH 05/26] Update music center url (#5056) --- .../style/custom-navbar/transparent-fill.ts | 39 ++++++++++++------- .../components/style/custom-navbar/urls.ts | 1 + src/components/utils/categories/raw.json | 2 +- 3 files changed, 27 insertions(+), 15 deletions(-) diff --git a/registry/lib/components/style/custom-navbar/transparent-fill.ts b/registry/lib/components/style/custom-navbar/transparent-fill.ts index eb867902d..5ef31a008 100644 --- a/registry/lib/components/style/custom-navbar/transparent-fill.ts +++ b/registry/lib/components/style/custom-navbar/transparent-fill.ts @@ -1,13 +1,37 @@ import { addComponentListener, getComponentSettings } from '@/core/settings' import { sq } from '@/core/spin-query' +import { matchUrlPattern } from '@/core/utils' import { mainSiteUrls, matchCurrentPage } from '@/core/utils/urls' +const setupTransparentFill = (vm: { toggleStyle: (value: boolean, style: string) => void }) => { + addComponentListener( + 'customNavbar.transparent', + value => { + if (!getComponentSettings('hideBanner').enabled) { + vm.toggleStyle(value, 'transparent') + } + }, + true, + ) + addComponentListener('hideBanner', value => { + if (getComponentSettings('customNavbar').options.transparent) { + vm.toggleStyle(!value, 'transparent') + } + }) +} + +const transparentFillUrls = ['//music.bilibili.com/'] + /** * 检查是否应用透明填充(有横幅时) */ export const checkTransparentFill = async (vm: { toggleStyle: (value: boolean, style: string) => void }) => { + if (transparentFillUrls.some(url => matchUrlPattern(url))) { + setupTransparentFill(vm) + return + } if (!matchCurrentPage(mainSiteUrls)) { return } @@ -41,19 +65,6 @@ export const checkTransparentFill = async (vm: { if (banner.length === 0) { return } - addComponentListener( - 'customNavbar.transparent', - value => { - if (!getComponentSettings('hideBanner').enabled) { - vm.toggleStyle(value, 'transparent') - } - }, - true, - ) - addComponentListener('hideBanner', value => { - if (getComponentSettings('customNavbar').options.transparent) { - vm.toggleStyle(!value, 'transparent') - } - }) + setupTransparentFill(vm) }) } diff --git a/registry/lib/components/style/custom-navbar/urls.ts b/registry/lib/components/style/custom-navbar/urls.ts index 77e622f2d..49109300b 100644 --- a/registry/lib/components/style/custom-navbar/urls.ts +++ b/registry/lib/components/style/custom-navbar/urls.ts @@ -11,6 +11,7 @@ export const urlInclude = [ '//app.bilibili.com', '//passport.bilibili.com', '//live.bilibili.com/blackboard/', + '//music.bilibili.com', ] export const urlExclude = [ '//t.bilibili.com/vote/h5/index/#/result', diff --git a/src/components/utils/categories/raw.json b/src/components/utils/categories/raw.json index 757802548..8581150e4 100644 --- a/src/components/utils/categories/raw.json +++ b/src/components/utils/categories/raw.json @@ -1875,7 +1875,7 @@ { "name": "新歌热榜", "report": "musicplus", - "url": "//www.bilibili.com/v/musicplus/", + "url": "//music.bilibili.com/pc/music-center/", "icon": "musicplus" } ] From 648b94a63ef3c289aa40be16064d37f84f764944 Mon Sep 17 00:00:00 2001 From: the1812 Date: Sat, 21 Dec 2024 21:26:15 +0800 Subject: [PATCH 06/26] Fix reorder section when not logged in (#5051) --- .../style/custom-navbar/settings/ExtraOptions.vue | 13 +------------ .../style/custom-navbar/settings/NavbarSettings.vue | 5 +++-- 2 files changed, 4 insertions(+), 14 deletions(-) diff --git a/registry/lib/components/style/custom-navbar/settings/ExtraOptions.vue b/registry/lib/components/style/custom-navbar/settings/ExtraOptions.vue index 49fe9024b..d2722dcd2 100644 --- a/registry/lib/components/style/custom-navbar/settings/ExtraOptions.vue +++ b/registry/lib/components/style/custom-navbar/settings/ExtraOptions.vue @@ -1,17 +1,11 @@ From a31cc26f6ec99c34209baa6eb90063baff3b4e99 Mon Sep 17 00:00:00 2001 From: the1812 Date: Sun, 22 Dec 2024 18:28:52 +0800 Subject: [PATCH 11/26] Rename subscriptions (#4777) --- .../style/custom-navbar/subscriptions/SubscriptionsList.vue | 2 +- .../style/custom-navbar/subscriptions/subscriptions.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/registry/lib/components/style/custom-navbar/subscriptions/SubscriptionsList.vue b/registry/lib/components/style/custom-navbar/subscriptions/SubscriptionsList.vue index 8b9d4b735..d564719de 100644 --- a/registry/lib/components/style/custom-navbar/subscriptions/SubscriptionsList.vue +++ b/registry/lib/components/style/custom-navbar/subscriptions/SubscriptionsList.vue @@ -123,7 +123,7 @@ export default Vue.extend({ `https://api.bilibili.com/x/space/bangumi/follow/list?${params}`, ) if (json.code !== 0) { - logError(`加载订阅信息失败: ${json.message}`) + logError(`加载番剧信息失败: ${json.message}`) return } const newCards: SubscriptionItem[] = lodash diff --git a/registry/lib/components/style/custom-navbar/subscriptions/subscriptions.ts b/registry/lib/components/style/custom-navbar/subscriptions/subscriptions.ts index eae505825..3083f433c 100644 --- a/registry/lib/components/style/custom-navbar/subscriptions/subscriptions.ts +++ b/registry/lib/components/style/custom-navbar/subscriptions/subscriptions.ts @@ -8,8 +8,8 @@ export enum SubscriptionTypes { const uid = getUID() export const subscriptions: CustomNavbarItemInit = { name: 'subscriptions', - displayName: '订阅', - content: '订阅', + displayName: '番剧', + content: '番剧', href: `https://space.bilibili.com/${uid}/bangumi`, touch: true, From 7515dfe3211922d2307db59d20d9879c9253c6fb Mon Sep 17 00:00:00 2001 From: the1812 Date: Sun, 22 Dec 2024 20:26:08 +0800 Subject: [PATCH 12/26] Fix conflict class (fix #5073) --- src/components/launch-bar/ActionItem.vue | 26 ++++++++++++++++-------- src/components/launch-bar/LaunchBar.vue | 8 ++++---- 2 files changed, 21 insertions(+), 13 deletions(-) diff --git a/src/components/launch-bar/ActionItem.vue b/src/components/launch-bar/ActionItem.vue index 7baa4e531..1b95db6f9 100644 --- a/src/components/launch-bar/ActionItem.vue +++ b/src/components/launch-bar/ActionItem.vue @@ -1,7 +1,7 @@