diff --git a/docs/.vitepress/config.ts b/docs/.vitepress/config.ts index 6ab869aed..90c8dd532 100644 --- a/docs/.vitepress/config.ts +++ b/docs/.vitepress/config.ts @@ -1,15 +1,15 @@ import { fileURLToPath, URL } from 'node:url'; import { defineConfig, UserConfig } from 'vitepress'; import { groupIconMdPlugin, groupIconVitePlugin } from 'vitepress-plugin-group-icons'; -import sidebar from './sidebar'; -import snackPlayer from './markdown/snackPlayer'; -import sandpackPlugin from './markdown/sandpack'; -import examplePlugin from './markdown/example'; +import sidebar from './sidebar/index.ts'; +import snackPlayer from './markdown/snackPlayer.ts'; +import sandpackPlugin from './markdown/sandpack.ts'; +import examplePlugin from './markdown/example.ts'; import { readFile } from 'node:fs/promises'; -import { resourcesSidebar } from './sidebar/resources'; +import { resourcesSidebar } from './sidebar/resources.ts'; import llmstxt from 'vitepress-plugin-llms'; -import { transformPageData } from './transformPageData'; -import getHeadConfig from './getHeadConfig'; +import { transformPageData } from './transformPageData.ts'; +import getHeadConfig from './getHeadConfig.ts'; const defaultSandpackCSS = await readFile( fileURLToPath(new URL('./theme/sandpack-default.css', import.meta.url)), @@ -56,12 +56,6 @@ export default defineConfig({ }, resolve: { alias: [ - { - find: /^.*\/VPIconAlignLeft\.vue$/, - replacement: fileURLToPath( - new URL('./theme/components/overrides/VPIconAlignLeft.vue', import.meta.url), - ), - }, { find: /^.*\/VPFooter\.vue$/, replacement: fileURLToPath( diff --git a/docs/.vitepress/lib/categories.ts b/docs/.vitepress/lib/categories.ts index 10f5daf3a..282ee4b3c 100644 --- a/docs/.vitepress/lib/categories.ts +++ b/docs/.vitepress/lib/categories.ts @@ -1,6 +1,6 @@ import fs from 'fs'; import path from 'path'; -import { Category, IconEntity } from '../theme/types'; +import type { Category, IconEntity } from '../theme/types.ts'; const directory = path.join(process.cwd(), '../categories'); diff --git a/docs/.vitepress/lib/codeExamples/createLabCodeExamples.ts b/docs/.vitepress/lib/codeExamples/createLabCodeExamples.ts index 1541d3670..f65ac2348 100644 --- a/docs/.vitepress/lib/codeExamples/createLabCodeExamples.ts +++ b/docs/.vitepress/lib/codeExamples/createLabCodeExamples.ts @@ -1,4 +1,4 @@ -import { highLightCode } from './createCodeExamples'; +import { highLightCode } from './createCodeExamples.ts'; type CodeExampleType = { title: string; diff --git a/docs/.vitepress/lib/fetchPackages.ts b/docs/.vitepress/lib/fetchPackages.ts index aede27839..4c08828dc 100644 --- a/docs/.vitepress/lib/fetchPackages.ts +++ b/docs/.vitepress/lib/fetchPackages.ts @@ -1,6 +1,6 @@ import { promises as fs, constants } from 'fs'; import path from 'path'; -import { PackageItem } from '../theme/types'; +import { type PackageItem } from '../theme/types.ts'; const fileExist = (filePath) => fs diff --git a/docs/.vitepress/markdown/example.ts b/docs/.vitepress/markdown/example.ts index f38b949c1..536b3160f 100644 --- a/docs/.vitepress/markdown/example.ts +++ b/docs/.vitepress/markdown/example.ts @@ -1,6 +1,6 @@ import { readFileSync } from 'node:fs'; import { dirname, isAbsolute, resolve } from 'node:path'; -import type { MarkdownIt, RenderRule } from './types'; +import type { MarkdownIt, RenderRule } from './types.ts'; import container from 'markdown-it-container'; type ContainerArgs = [typeof container, string, { render: RenderRule }]; diff --git a/docs/.vitepress/markdown/sandpack.ts b/docs/.vitepress/markdown/sandpack.ts index 983a2ef90..b1b3d8933 100644 --- a/docs/.vitepress/markdown/sandpack.ts +++ b/docs/.vitepress/markdown/sandpack.ts @@ -1,6 +1,6 @@ -import type { MarkdownIt, RenderRule, Token } from './types'; +import type { MarkdownIt, RenderRule, Token } from './types.ts'; import container from 'markdown-it-container'; -import sandpackTheme from '../theme/sandpackTheme.json'; +import sandpackTheme from '../theme/sandpackTheme.json' with { type: 'json' }; type SnackParams = { defaultFiles?: Record< diff --git a/docs/.vitepress/markdown/snackPlayer.ts b/docs/.vitepress/markdown/snackPlayer.ts index 3005ed208..bdcd84b13 100644 --- a/docs/.vitepress/markdown/snackPlayer.ts +++ b/docs/.vitepress/markdown/snackPlayer.ts @@ -16,7 +16,7 @@ * /> */ -import type { MarkdownIt } from './types'; +import type { MarkdownIt } from './types.ts'; type SnackParams = Record; diff --git a/docs/.vitepress/sidebar/index.ts b/docs/.vitepress/sidebar/index.ts index 62fa9d001..889afb2af 100644 --- a/docs/.vitepress/sidebar/index.ts +++ b/docs/.vitepress/sidebar/index.ts @@ -1,15 +1,15 @@ import { DefaultTheme, UserConfig } from 'vitepress'; -import { reactSidebar } from './react'; -import { vueSidebar } from './vue'; -import { svelteSidebar } from './svelte'; -import { lucideSidebar } from './lucide'; -import { solidSidebar } from './solid'; -import { preactSidebar } from './preact'; -import { reactNativeSidebar } from './react-native'; -import { astroSidebar } from './astro'; -import { resourcesSidebar } from './resources'; -import { angularSidebar } from './angular'; -import { lucideStaticSidebar } from './static'; +import { reactSidebar } from './react.ts'; +import { vueSidebar } from './vue.ts'; +import { svelteSidebar } from './svelte.ts'; +import { lucideSidebar } from './lucide.ts'; +import { solidSidebar } from './solid.ts'; +import { preactSidebar } from './preact.ts'; +import { reactNativeSidebar } from './react-native.ts'; +import { astroSidebar } from './astro.ts'; +import { resourcesSidebar } from './resources.ts'; +import { angularSidebar } from './angular.ts'; +import { lucideStaticSidebar } from './static.ts'; type Sidebar = UserConfig['themeConfig']['sidebar']; diff --git a/docs/.vitepress/theme/components/base/ButtonMenu.vue b/docs/.vitepress/theme/components/base/ButtonMenu.vue index 618642d4a..a06191a85 100644 --- a/docs/.vitepress/theme/components/base/ButtonMenu.vue +++ b/docs/.vitepress/theme/components/base/ButtonMenu.vue @@ -161,7 +161,10 @@ ul.menu-items { .arrow-up-button::before { content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%0A%3E%3Cpolyline points='18 15 12 9 6 15' /%3E%3C/svg%3E%0A"); width: 20px; - height: 28px; + height: 20px; + /* line-height 0 keeps the chevron image at the top of this box, so the button's flex centering + centers it; it used to rely on VitePress 1's 38px button line-height instead */ + line-height: 0; margin: auto; display: block; } diff --git a/docs/.vitepress/theme/components/base/CardGrid.vue b/docs/.vitepress/theme/components/base/CardGrid.vue index 9f022ec8d..490bbca2f 100644 --- a/docs/.vitepress/theme/components/base/CardGrid.vue +++ b/docs/.vitepress/theme/components/base/CardGrid.vue @@ -21,13 +21,13 @@ padding: 8px; } -@media (min-width: 960px) { +@media (min-width: 60rem) { .card-grid-flex > * { flex-basis: 50%; } } -@media (min-width: 1280px) { +@media (min-width: 80rem) { .card-grid-flex > * { flex-basis: 33.33%; } diff --git a/docs/.vitepress/theme/components/base/Checkbox.vue b/docs/.vitepress/theme/components/base/Checkbox.vue index 058d9fdf5..dd3ddcd74 100644 --- a/docs/.vitepress/theme/components/base/Checkbox.vue +++ b/docs/.vitepress/theme/components/base/Checkbox.vue @@ -75,6 +75,7 @@ const model = computed({ appearance: none; width: 16px; height: 16px; + margin: 3px 3px 3px 4px; cursor: pointer; border: 1px solid var(--vp-input-border-color); background-color: var(--vp-input-switch-bg-color); diff --git a/docs/.vitepress/theme/components/base/LayoutTop.vue b/docs/.vitepress/theme/components/base/LayoutTop.vue index e008251f6..cac96d7d8 100644 --- a/docs/.vitepress/theme/components/base/LayoutTop.vue +++ b/docs/.vitepress/theme/components/base/LayoutTop.vue @@ -29,7 +29,7 @@ import RocketDuotoneIcon from '../home/RocketDuotoneIcon.ts'; diff --git a/docs/.vitepress/theme/components/overrides/HeroMatrix.vue b/docs/.vitepress/theme/components/overrides/HeroMatrix.vue deleted file mode 100644 index cd3f8b46c..000000000 --- a/docs/.vitepress/theme/components/overrides/HeroMatrix.vue +++ /dev/null @@ -1,248 +0,0 @@ - - - - - diff --git a/docs/.vitepress/theme/components/overrides/VPCarbonAds.vue b/docs/.vitepress/theme/components/overrides/VPCarbonAds.vue index b033e9c7d..338c05d50 100644 --- a/docs/.vitepress/theme/components/overrides/VPCarbonAds.vue +++ b/docs/.vitepress/theme/components/overrides/VPCarbonAds.vue @@ -1,7 +1,7 @@ - - diff --git a/docs/.vitepress/theme/components/overrides/VPNavBarSearch.vue b/docs/.vitepress/theme/components/overrides/VPNavBarSearch.vue index 59305c683..7137289f8 100644 --- a/docs/.vitepress/theme/components/overrides/VPNavBarSearch.vue +++ b/docs/.vitepress/theme/components/overrides/VPNavBarSearch.vue @@ -2,31 +2,33 @@ import { ref } from 'vue' // This component can be rendered more than once on a page (e.g. a hidden -// copy inside `.content-body`). DocSearch mounts into the first `#docsearch` -// in the document, so only a single instance may ever render the search box. +// copy inside `.content-body`). DocSearch mounts into `#vp-docsearch`, so only +// a single instance may ever render the search box. const loaded = ref(false) +// Shared so that any instance (e.g. the visible input) can open the modal +// rendered by the owning instance. +const openRequest = ref<{ target: 'search'; nonce: number } | null>(null) +let openNonce = 0 +// Every instance registers the hotkeys; only handle each event once. +let lastHandledEvent: KeyboardEvent | null = null