@vuepress/plugin-catalog
Advanced tools
Comparing version 2.0.0-rc.41 to 2.0.0-rc.42
@@ -0,1 +1,2 @@ | ||
/* eslint-disable @typescript-eslint/no-shadow */ | ||
import { endsWith, ensureEndingSlash, ensureLeadingSlash, entries, isNumber, isPlainObject, isString, keys, startsWith, useLocaleConfig, } from '@vuepress/helper/client'; | ||
@@ -148,3 +149,3 @@ import { computed, defineComponent, h, shallowRef } from 'vue'; | ||
const isDeep = catalogData.value.some((item) => item.children); | ||
return h('div', { class: ['vp-catalog-wrapper', { index: props.index }] }, [ | ||
return h('div', { class: ['vp-catalog', { index: props.index }] }, [ | ||
props.hideHeading | ||
@@ -154,5 +155,5 @@ ? null | ||
catalogData.value.length | ||
? h(props.index ? 'ol' : 'ul', { class: ['vp-catalogs', { deep: isDeep }] }, catalogData.value.map(({ children = [], title, path, content }) => { | ||
? h(props.index ? 'ol' : 'ul', { class: ['vp-catalog-list', { deep: isDeep }] }, catalogData.value.map(({ children = [], title, path, content }) => { | ||
const childLink = h(RouteLink, { class: 'vp-catalog-title', to: path }, () => (content ? h(content) : title)); | ||
return h('li', { class: 'vp-catalog' }, isDeep | ||
return h('li', { class: 'vp-catalog-item' }, isDeep | ||
? [ | ||
@@ -159,0 +160,0 @@ h('h3', { |
@@ -6,3 +6,2 @@ import { hasGlobalComponent } from '@vuepress/helper/client'; | ||
import './styles/vars.css'; | ||
// eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion | ||
export default defineClientConfig({ | ||
@@ -9,0 +8,0 @@ enhance: ({ app }) => { |
@@ -5,3 +5,3 @@ import { addViteSsrNoExternal, getLocaleConfig } from '@vuepress/helper'; | ||
import { catalogLocales as defaultLocales } from './locales.js'; | ||
import { logger, PLUGIN_NAME } from './logger.js'; | ||
import { PLUGIN_NAME, logger } from './logger.js'; | ||
const __dirname = getDirname(import.meta.url); | ||
@@ -22,4 +22,4 @@ export const catalogPlugin = (options = {}) => (app) => { | ||
}), | ||
onInitialized: (app) => generateCatalogPage(app, options), | ||
extendsBundlerOptions: (bundlerOptions, app) => { | ||
onInitialized: () => generateCatalogPage(app, options), | ||
extendsBundlerOptions: (bundlerOptions) => { | ||
addViteSsrNoExternal(bundlerOptions, app, '@vuepress/helper'); | ||
@@ -26,0 +26,0 @@ }, |
@@ -20,4 +20,6 @@ import { createPage } from 'vuepress/core'; | ||
// not being excluded | ||
// eslint-disable-next-line @typescript-eslint/no-loop-func | ||
exclude.every((pattern) => !catalogPath.match(pattern)) && | ||
// path not found | ||
// eslint-disable-next-line @typescript-eslint/no-loop-func | ||
pages.every(({ path }) => path !== catalogPath)) { | ||
@@ -32,4 +34,4 @@ if (isDebug) | ||
.map((path) => decodeURI(path)) | ||
.map((path) => { | ||
const [, basename = ''] = /\/([^/]+)\/?$/.exec(path) || []; | ||
.map(async (path) => { | ||
const [, basename = ''] = /\/([^/]+)\/?$/.exec(path) ?? []; | ||
const title = getTitleFromFilename(basename); | ||
@@ -39,3 +41,3 @@ return createPage(app, { | ||
title, | ||
...(frontmatter(path) || {}), | ||
...frontmatter(path), | ||
}, | ||
@@ -45,5 +47,5 @@ content, | ||
}); | ||
})).then((pages) => { | ||
app.pages.push(...pages); | ||
})).then((catalogPages) => { | ||
app.pages.push(...catalogPages); | ||
}); | ||
}; |
{ | ||
"name": "@vuepress/plugin-catalog", | ||
"version": "2.0.0-rc.41", | ||
"version": "2.0.0-rc.42", | ||
"description": "VuePress plugin - catalog", | ||
@@ -39,7 +39,7 @@ "keywords": [ | ||
"dependencies": { | ||
"@vuepress/helper": "2.0.0-rc.41", | ||
"vue": "^3.4.37" | ||
"@vuepress/helper": "2.0.0-rc.42", | ||
"vue": "^3.4.38" | ||
}, | ||
"peerDependencies": { | ||
"vuepress": "2.0.0-rc.14" | ||
"vuepress": "2.0.0-rc.15" | ||
}, | ||
@@ -49,3 +49,3 @@ "publishConfig": { | ||
}, | ||
"gitHead": "7382aceb24df0b09f36ddd603dd4a00597343651" | ||
"gitHead": "66e494405a7fbb02f6d46d7be670ec69605b7606" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
28838
821
+ Added@vuepress/cli@2.0.0-rc.15(transitive)
+ Added@vuepress/client@2.0.0-rc.15(transitive)
+ Added@vuepress/core@2.0.0-rc.15(transitive)
+ Added@vuepress/helper@2.0.0-rc.42(transitive)
+ Added@vuepress/markdown@2.0.0-rc.15(transitive)
+ Added@vuepress/shared@2.0.0-rc.15(transitive)
+ Added@vuepress/utils@2.0.0-rc.15(transitive)
+ Addedvuepress@2.0.0-rc.15(transitive)
- Removed@vuepress/cli@2.0.0-rc.14(transitive)
- Removed@vuepress/client@2.0.0-rc.14(transitive)
- Removed@vuepress/core@2.0.0-rc.14(transitive)
- Removed@vuepress/helper@2.0.0-rc.41(transitive)
- Removed@vuepress/markdown@2.0.0-rc.14(transitive)
- Removed@vuepress/shared@2.0.0-rc.14(transitive)
- Removed@vuepress/utils@2.0.0-rc.14(transitive)
- Removedvuepress@2.0.0-rc.14(transitive)
Updated@vuepress/helper@2.0.0-rc.42
Updatedvue@^3.4.38