From 3e8fc40c3621da1ef35645d376dab7765b35bb40 Mon Sep 17 00:00:00 2001 From: Mike Bostock Date: Wed, 9 Oct 2024 10:41:20 -0700 Subject: [PATCH 1/7] fix(client): use `usePreferredDark` with `appearance: "force-auto"` (#4263) --- src/client/app/data.ts | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/client/app/data.ts b/src/client/app/data.ts index 67fc0942..c99de52f 100644 --- a/src/client/app/data.ts +++ b/src/client/app/data.ts @@ -1,5 +1,5 @@ import siteData from '@siteData' -import { useDark } from '@vueuse/core' +import { useDark, usePreferredDark } from '@vueuse/core' import { computed, inject, @@ -79,13 +79,15 @@ export function initData(route: Route): VitePressData { const isDark = appearance === 'force-dark' ? ref(true) - : appearance - ? useDark({ - storageKey: APPEARANCE_KEY, - initialValue: () => (appearance === 'dark' ? 'dark' : 'auto'), - ...(typeof appearance === 'object' ? appearance : {}) - }) - : ref(false) + : appearance === 'force-auto' + ? usePreferredDark() + : appearance + ? useDark({ + storageKey: APPEARANCE_KEY, + initialValue: () => (appearance === 'dark' ? 'dark' : 'auto'), + ...(typeof appearance === 'object' ? appearance : {}) + }) + : ref(false) const hashRef = ref(inBrowser ? location.hash : '') From b46d6d3a204f5ce347647bfd1ab8073bf313afd6 Mon Sep 17 00:00:00 2001 From: Heptazhou Date: Sat, 12 Oct 2024 09:21:30 +0000 Subject: [PATCH 2/7] fix: broken rewrites on windows (#4268) --- src/node/markdownToVue.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/node/markdownToVue.ts b/src/node/markdownToVue.ts index 458837c0..21ea491b 100644 --- a/src/node/markdownToVue.ts +++ b/src/node/markdownToVue.ts @@ -63,14 +63,14 @@ export async function createMarkdownToVueRenderFn( const dynamicRoutes = new Map( siteConfig?.dynamicRoutes?.routes.map((r) => [ r.fullPath, - path.join(srcDir, r.route) + slash(path.join(srcDir, r.route)) ]) || [] ) const rewrites = new Map( Object.entries(siteConfig?.rewrites.map || {}).map(([key, value]) => [ - path.join(srcDir, key), - path.join(srcDir, value!) + slash(path.join(srcDir, key)), + slash(path.join(srcDir, value!)) ]) || [] ) From 461a5b001d29f95169f60fe28bc610e3f6e8fd66 Mon Sep 17 00:00:00 2001 From: Divyansh Singh <40380293+brc-dd@users.noreply.github.com> Date: Sat, 12 Oct 2024 17:15:11 +0530 Subject: [PATCH 3/7] fix(client): wrong script async check --- src/client/app/composables/head.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/client/app/composables/head.ts b/src/client/app/composables/head.ts index 708c16eb..f0296b18 100644 --- a/src/client/app/composables/head.ts +++ b/src/client/app/composables/head.ts @@ -87,7 +87,7 @@ function createHeadElement([tag, attrs, innerHTML]: HeadConfig) { if (innerHTML) { el.innerHTML = innerHTML } - if (tag === 'script' && !attrs.async) { + if (tag === 'script' && attrs.async == null) { // async is true by default for dynamically created scripts ;(el as HTMLScriptElement).async = false } From 92b92aefcab9fbb28b51da70ee8ab21724098277 Mon Sep 17 00:00:00 2001 From: Gunther Konig Date: Sat, 12 Oct 2024 15:09:36 +0300 Subject: [PATCH 4/7] fix(theme): improve local search input a11y (#4066) Co-authored-by: Divyansh Singh <40380293+brc-dd@users.noreply.github.com> --- .../components/VPLocalSearchBox.vue | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/src/client/theme-default/components/VPLocalSearchBox.vue b/src/client/theme-default/components/VPLocalSearchBox.vue index c8aded40..70624e42 100644 --- a/src/client/theme-default/components/VPLocalSearchBox.vue +++ b/src/client/theme-default/components/VPLocalSearchBox.vue @@ -440,10 +440,20 @@ function formMarkRegex(terms: Set) {