Socket
Socket
Sign inDemoInstall

@vuepress/theme-default

Package Overview
Dependencies
Maintainers
2
Versions
223
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@vuepress/theme-default - npm Package Compare versions

Comparing version 2.0.0-rc.9 to 2.0.0-rc.10

7

lib/client/composables/useSidebarItems.d.ts
import type { ComputedRef, InjectionKey } from 'vue';
import type { Router } from 'vue-router';
import type { PageData, PageHeader } from 'vuepress/client';

@@ -20,3 +19,3 @@ import type { DefaultThemeData, DefaultThemeNormalPageFrontmatter, ResolvedSidebarItem, SidebarConfigArray, SidebarConfigObject } from '../../shared/index.js';

*/
export declare const resolveSidebarItems: (frontmatter: DefaultThemeNormalPageFrontmatter, themeLocale: DefaultThemeData, page: PageData, router: Router, path: string) => ResolvedSidebarItem[];
export declare const resolveSidebarItems: (frontmatter: DefaultThemeNormalPageFrontmatter, themeLocale: DefaultThemeData, page: PageData, path: string) => ResolvedSidebarItem[];
/**

@@ -34,6 +33,6 @@ * Util to transform page header to sidebar item

*/
export declare const resolveArraySidebarItems: (page: PageData, router: Router, path: string, sidebarConfig: SidebarConfigArray, sidebarDepth: number) => ResolvedSidebarItem[];
export declare const resolveArraySidebarItems: (page: PageData, path: string, sidebarConfig: SidebarConfigArray, sidebarDepth: number) => ResolvedSidebarItem[];
/**
* Resolve sidebar items if the config is a key -> value (path-prefix -> array) object
*/
export declare const resolveMultiSidebarItems: (page: PageData, router: Router, path: string, sidebarConfig: SidebarConfigObject, sidebarDepth: number) => ResolvedSidebarItem[];
export declare const resolveMultiSidebarItems: (page: PageData, path: string, sidebarConfig: SidebarConfigObject, sidebarDepth: number) => ResolvedSidebarItem[];
import { computed, inject, provide } from 'vue';
import { useRoute, useRouter } from 'vue-router';
import { useRoute } from 'vue-router';
import { usePageData, usePageFrontmatter } from 'vuepress/client';

@@ -26,4 +26,3 @@ import { isPlainObject, isString, resolveLocalePath } from 'vuepress/shared';

const route = useRoute();
const router = useRouter();
const sidebarItems = computed(() => resolveSidebarItems(frontmatter.value, themeLocale.value, page.value, router, route.path));
const sidebarItems = computed(() => resolveSidebarItems(frontmatter.value, themeLocale.value, page.value, route.path));
provide(sidebarItemsSymbol, sidebarItems);

@@ -36,3 +35,3 @@ };

*/
export const resolveSidebarItems = (frontmatter, themeLocale, page, router, path) => {
export const resolveSidebarItems = (frontmatter, themeLocale, page, path) => {
// get sidebar config from frontmatter > theme data

@@ -49,6 +48,6 @@ const sidebarConfig = frontmatter.sidebar ?? themeLocale.sidebar ?? 'auto';

if (Array.isArray(sidebarConfig)) {
return resolveArraySidebarItems(page, router, path, sidebarConfig, sidebarDepth);
return resolveArraySidebarItems(page, path, sidebarConfig, sidebarDepth);
}
if (isPlainObject(sidebarConfig)) {
return resolveMultiSidebarItems(page, router, path, sidebarConfig, sidebarDepth);
return resolveMultiSidebarItems(page, path, sidebarConfig, sidebarDepth);
}

@@ -82,7 +81,7 @@ return [];

*/
export const resolveArraySidebarItems = (page, router, path, sidebarConfig, sidebarDepth) => {
export const resolveArraySidebarItems = (page, path, sidebarConfig, sidebarDepth) => {
const handleChildItem = (item) => {
let childItem;
if (isString(item)) {
childItem = getNavLink(router, item);
childItem = getNavLink(item);
}

@@ -115,3 +114,3 @@ else {

*/
export const resolveMultiSidebarItems = (page, router, path, sidebarConfig, sidebarDepth) => {
export const resolveMultiSidebarItems = (page, path, sidebarConfig, sidebarDepth) => {
const sidebarPath = resolveLocalePath(sidebarConfig, path);

@@ -122,3 +121,3 @@ const matchedSidebarConfig = sidebarConfig[sidebarPath] ?? [];

}
return resolveArraySidebarItems(page, router, path, matchedSidebarConfig, sidebarDepth);
return resolveArraySidebarItems(page, path, matchedSidebarConfig, sidebarDepth);
};

@@ -1,3 +0,3 @@

export * from '../shared/index.js';
export * from './composables/index.js';
export * from './utils/index.js';
export type * from '../shared/index.js';

@@ -1,3 +0,2 @@

export * from '../shared/index.js';
export * from './composables/index.js';
export * from './utils/index.js';

@@ -1,8 +0,2 @@

import type { Router } from 'vue-router';
import type { NavLink } from '../../shared/index.js';
declare module 'vue-router' {
interface RouteMeta {
title?: string;
}
}
/**

@@ -15,2 +9,2 @@ * Resolve NavLink props from string

*/
export declare const getNavLink: (router: Router, item: string) => NavLink;
export declare const getNavLink: (config: string) => NavLink;

@@ -1,2 +0,2 @@

import { getResolveRouteWithRedirect } from './getResolveRouteWithRedirect.js';
import { resolveRoute } from 'vuepress/client';
/**

@@ -9,11 +9,10 @@ * Resolve NavLink props from string

*/
export const getNavLink = (router, item) => {
// the route path of vue-router is url-encoded, and we expect users are using
// non-url-encoded string in theme config, so we need to url-encode it first to
// resolve the route correctly
const resolved = getResolveRouteWithRedirect(router, encodeURI(item));
return {
text: resolved.meta.title || item,
link: resolved.name === '404' ? item : resolved.fullPath,
};
export const getNavLink = (config) => {
const { notFound, meta, path } = resolveRoute(config);
return notFound
? { text: path, link: path }
: {
text: meta.title || path,
link: path,
};
};
export * from './getNavLink.js';
export * from './getResolveRouteWithRedirect.js';
export * from './isActiveSidebarItem.js';
export * from './resolveEditLink.js';
export * from './resolveRepoType.js';
export * from './getNavLink.js';
export * from './getResolveRouteWithRedirect.js';
export * from './isActiveSidebarItem.js';
export * from './resolveEditLink.js';
export * from './resolveRepoType.js';
import { defaultTheme } from './defaultTheme.js';
export * from '../shared/index.js';
export * from './defaultTheme.js';
export * from './utils/index.js';
export type * from '../shared/index.js';
/** @deprecated Use named export instead */
export default defaultTheme;
import { defaultTheme } from './defaultTheme.js';
export * from '../shared/index.js';
export * from './defaultTheme.js';
export * from './utils/index.js';
/** @deprecated Use named export instead */
export default defaultTheme;
{
"name": "@vuepress/theme-default",
"version": "2.0.0-rc.9",
"version": "2.0.0-rc.10",
"description": "Default theme of VuePress",

@@ -45,16 +45,16 @@ "keywords": [

"dependencies": {
"@vuepress/helper": "2.0.0-rc.9",
"@vuepress/plugin-active-header-links": "2.0.0-rc.7",
"@vuepress/plugin-back-to-top": "2.0.0-rc.9",
"@vuepress/plugin-container": "2.0.0-rc.7",
"@vuepress/plugin-copy-code": "2.0.0-rc.9",
"@vuepress/plugin-external-link-icon": "2.0.0-rc.7",
"@vuepress/plugin-git": "2.0.0-rc.7",
"@vuepress/plugin-medium-zoom": "2.0.0-rc.7",
"@vuepress/plugin-nprogress": "2.0.0-rc.7",
"@vuepress/plugin-palette": "2.0.0-rc.7",
"@vuepress/plugin-prismjs": "2.0.0-rc.7",
"@vuepress/plugin-seo": "2.0.0-rc.9",
"@vuepress/plugin-sitemap": "2.0.0-rc.9",
"@vuepress/plugin-theme-data": "2.0.0-rc.7",
"@vuepress/helper": "~2.0.0-rc.10",
"@vuepress/plugin-active-header-links": "2.0.0-rc.10",
"@vuepress/plugin-back-to-top": "2.0.0-rc.10",
"@vuepress/plugin-container": "2.0.0-rc.10",
"@vuepress/plugin-copy-code": "2.0.0-rc.10",
"@vuepress/plugin-external-link-icon": "2.0.0-rc.10",
"@vuepress/plugin-git": "2.0.0-rc.10",
"@vuepress/plugin-medium-zoom": "2.0.0-rc.10",
"@vuepress/plugin-nprogress": "2.0.0-rc.10",
"@vuepress/plugin-palette": "2.0.0-rc.10",
"@vuepress/plugin-prismjs": "2.0.0-rc.10",
"@vuepress/plugin-seo": "2.0.0-rc.10",
"@vuepress/plugin-sitemap": "2.0.0-rc.10",
"@vuepress/plugin-theme-data": "2.0.0-rc.10",
"@vueuse/core": "^10.7.2",

@@ -67,3 +67,3 @@ "sass": "^1.70.0",

"sass-loader": "^14.0.0",
"vuepress": "2.0.0-rc.2"
"vuepress": "2.0.0-rc.5"
},

@@ -78,3 +78,3 @@ "peerDependenciesMeta": {

},
"gitHead": "12c12dadd0758df4ad5256851fc3cb3c949873e8"
"gitHead": "2e4d75617b030b584fb59346087790c982dbf411"
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc