diff --git a/docs/layouts/sidebar.md b/docs/layouts/sidebar.md index 511fcd9c..4985076a 100644 --- a/docs/layouts/sidebar.md +++ b/docs/layouts/sidebar.md @@ -99,9 +99,9 @@ module.exports = { startsWith: '', /** - * Optionally, you can specify if the sidebar items are collapsable. Default is true. + * Optionally, you can specify if the sidebar items are collapsible. Default is true. */ - collapsable: true, + collapsible: true, /** * Optionally, you can specify a depth for the sidebar items. Default is 6, which is the maximum VitePress sidebar depth. diff --git a/package.json b/package.json index beae8be8..decc50c4 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "vitepress-openapi", "type": "module", - "version": "0.0.3-alpha.51", + "version": "0.0.3-alpha.52", "packageManager": "pnpm@9.1.1", "homepage": "https://vitepress-openapi.vercel.app/", "repository": { diff --git a/src/composables/useSidebar.ts b/src/composables/useSidebar.ts index 35faea51..2374bfa6 100644 --- a/src/composables/useSidebar.ts +++ b/src/composables/useSidebar.ts @@ -203,13 +203,13 @@ export function useSidebar({ function itemsByPaths({ startsWith = '', - collapsable = true, + collapsible = true, depth = 6, sidebarItemTemplate = sidebarItemTemplateForMethodPath, linkPrefix: itemLinkPrefix = linkPrefix, }: { startsWith?: string - collapsable?: boolean + collapsible?: boolean depth?: number sidebarItemTemplate?: (method: OpenAPIV3.HttpMethods, path: string) => string linkPrefix?: string @@ -219,7 +219,7 @@ export function useSidebar({ const sidebarItems = generateSidebarItemsByPaths({ paths, startsWith, - collapsable, + collapsible, depth, itemLinkPrefix, sidebarItemTemplate, diff --git a/src/lib/sidebar/generateSidebarItemsByPaths.ts b/src/lib/sidebar/generateSidebarItemsByPaths.ts index f3351e8f..264c3a36 100644 --- a/src/lib/sidebar/generateSidebarItemsByPaths.ts +++ b/src/lib/sidebar/generateSidebarItemsByPaths.ts @@ -9,14 +9,14 @@ import { flatSidebarItems } from './flatSidebarItems' export function generateSidebarItemsByPaths({ paths, startsWith = '', - collapsable = true, + collapsible = true, itemLinkPrefix = '', depth = 6, sidebarItemTemplate, }: { paths: OpenAPIV3.PathsObject startsWith?: string - collapsable?: boolean + collapsible?: boolean itemLinkPrefix?: string depth?: number sidebarItemTemplate?: (method: OpenAPIV3.HttpMethods, path: string) => string @@ -74,7 +74,7 @@ export function generateSidebarItemsByPaths({ sidebarItems = ensureGroupTextSlashPrefix(sidebarItems) - if (collapsable) { + if (collapsible) { sidebarItems = setItemCollapsedState(sidebarItems) } diff --git a/test/composables/useSidebar.itemsByPaths.test.ts b/test/composables/useSidebar.itemsByPaths.test.ts index 575d197d..7cb3cf7e 100644 --- a/test/composables/useSidebar.itemsByPaths.test.ts +++ b/test/composables/useSidebar.itemsByPaths.test.ts @@ -272,7 +272,7 @@ describe('useSidebar itemsByPaths', () => { it('generate items by path without collapsed option', () => { const result = sidebar.itemsByPaths({ - collapsable: false, + collapsible: false, }) expect( @@ -342,7 +342,7 @@ describe('useSidebar itemsByPaths', () => { it('generate items witn linkPrefix option', () => { const result = sidebar.itemsByPaths({ linkPrefix: '/custom-prefix/', - collapsable: false, + collapsible: false, }) expect(