@vuepress/theme-default
Advanced tools
Comparing version 2.0.0-beta.50-pre.1 to 2.0.0-rc.0
@@ -1,4 +0,6 @@ | ||
import type { VNode } from 'vue'; | ||
import type { SlotsType, VNode } from 'vue'; | ||
export declare const CodeGroup: import("vue").DefineComponent<{}, () => VNode<import("vue").RendererNode, import("vue").RendererElement, { | ||
[key: string]: any; | ||
}> | null, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>; | ||
}> | null, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}, SlotsType<{ | ||
default: () => VNode[]; | ||
}>>; |
@@ -1,12 +0,12 @@ | ||
import { defineComponent, h, onBeforeUpdate, ref } from 'vue'; | ||
import { useStorage } from '@vueuse/core'; | ||
import { computed, defineComponent, h, onBeforeUpdate, onMounted, ref, watch, } from 'vue'; | ||
export const CodeGroup = defineComponent({ | ||
name: 'CodeGroup', | ||
slots: Object, | ||
setup(_, { slots }) { | ||
// index of current active item | ||
const activeIndex = ref(-1); | ||
// refs of the tab buttons | ||
const tabRefs = ref([]); | ||
if (__VUEPRESS_DEV__) { | ||
// after removing a code-group-item, we need to clear the ref | ||
// of the removed item to avoid issues caused by HMR | ||
// in dev mode, we need to clear the tabs ref to avoid HMR issues | ||
// after removing a code-group-item | ||
onBeforeUpdate(() => { | ||
@@ -16,2 +16,18 @@ tabRefs.value = []; | ||
} | ||
// index of current active item | ||
const activeIndex = ref(-1); | ||
const codeGroupStorage = useStorage('vuepress-code-group', {}); | ||
const codeGroupKey = computed(() => tabRefs.value.map((tab) => tab.innerText).join(',')); | ||
onMounted(() => { | ||
watch(() => codeGroupStorage.value[codeGroupKey.value], (val = -1) => { | ||
if (activeIndex.value !== val) { | ||
activeIndex.value = val; | ||
} | ||
}, { immediate: true }); | ||
watch(activeIndex, (val) => { | ||
if (codeGroupStorage.value[codeGroupKey.value] !== val) { | ||
codeGroupStorage.value[codeGroupKey.value] = val; | ||
} | ||
}); | ||
}); | ||
// activate next tab | ||
@@ -53,6 +69,3 @@ const activateNext = (i = activeIndex.value) => { | ||
return () => { | ||
// NOTICE: here we put the `slots.default()` inside the render function to make | ||
// the slots reactive, otherwise the slot content won't be changed once the | ||
// `setup()` function of current component is called | ||
// get children code-group-item | ||
// get children code-group-item from default slots | ||
const items = (slots.default?.() || []) | ||
@@ -70,4 +83,4 @@ .filter((vnode) => vnode.type.name === 'CodeGroupItem') | ||
} | ||
// if activeIndex is invalid | ||
if (activeIndex.value < 0 || activeIndex.value > items.length - 1) { | ||
// if `activeIndex` is invalid | ||
// find the index of the code-group-item with `active` props | ||
@@ -80,2 +93,3 @@ activeIndex.value = items.findIndex((vnode) => vnode.props.active === '' || vnode.props.active === true); | ||
} | ||
// if activeIndex is valid | ||
else { | ||
@@ -82,0 +96,0 @@ // set the active item |
@@ -7,1 +7,2 @@ export * from './useDarkMode.js'; | ||
export * from './useThemeData.js'; | ||
export * from './useUpdateDeviceStatus.js'; |
@@ -7,1 +7,2 @@ export * from './useDarkMode.js'; | ||
export * from './useThemeData.js'; | ||
export * from './useUpdateDeviceStatus.js'; |
import type { InjectionKey, WritableComputedRef } from 'vue'; | ||
export declare type DarkModeRef = WritableComputedRef<boolean>; | ||
export type DarkModeRef = WritableComputedRef<boolean>; | ||
export declare const darkModeSymbol: InjectionKey<DarkModeRef>; | ||
@@ -4,0 +4,0 @@ /** |
import type { PageHeader } from '@vuepress/client'; | ||
import type { ComputedRef, InjectionKey } from 'vue'; | ||
import type { DefaultThemeData, DefaultThemeNormalPageFrontmatter, ResolvedSidebarItem, SidebarConfigArray, SidebarConfigObject } from '../../shared/index.js'; | ||
export declare type SidebarItemsRef = ComputedRef<ResolvedSidebarItem[]>; | ||
export type SidebarItemsRef = ComputedRef<ResolvedSidebarItem[]>; | ||
export declare const sidebarItemsSymbol: InjectionKey<SidebarItemsRef>; | ||
@@ -6,0 +6,0 @@ /** |
@@ -56,3 +56,3 @@ import { usePageData, usePageFrontmatter } from '@vuepress/client'; | ||
text: header.title, | ||
link: `#${header.slug}`, | ||
link: header.link, | ||
children: headersToSidebarItemChildren(header.children, sidebarDepth), | ||
@@ -59,0 +59,0 @@ }); |
@@ -5,2 +5,4 @@ import { defineClientConfig } from '@vuepress/client'; | ||
import { setupDarkMode, setupSidebarItems, useScrollPromise, } from './composables/index.js'; | ||
import Layout from './layouts/Layout.vue'; | ||
import NotFound from './layouts/NotFound.vue'; | ||
import './styles/index.scss'; | ||
@@ -39,2 +41,6 @@ export default defineClientConfig({ | ||
}, | ||
layouts: { | ||
Layout, | ||
NotFound, | ||
}, | ||
}); |
@@ -6,1 +6,6 @@ declare module '*.vue' { | ||
} | ||
declare module '*.module.scss?module' { | ||
const cssVars: Record<string, string> | ||
export default cssVars | ||
} |
@@ -1,2 +0,2 @@ | ||
export declare type RepoType = 'GitHub' | 'GitLab' | 'Gitee' | 'Bitbucket' | null; | ||
export type RepoType = 'GitHub' | 'GitLab' | 'Gitee' | 'Bitbucket' | null; | ||
export declare const resolveRepoType: (repo: string) => RepoType; |
@@ -18,12 +18,13 @@ import { activeHeaderLinksPlugin } from '@vuepress/plugin-active-header-links'; | ||
name: '@vuepress/theme-default', | ||
layouts: path.resolve(__dirname, '../client/layouts'), | ||
templateBuild: path.resolve(__dirname, '../../templates/build.html'), | ||
// use alias to make all components replaceable | ||
alias: Object.fromEntries(fs | ||
.readdirSync(path.resolve(__dirname, '../client/components')) | ||
.filter((file) => file.endsWith('.vue')) | ||
.map((file) => [ | ||
`@theme/${file}`, | ||
path.resolve(__dirname, '../client/components', file), | ||
])), | ||
alias: { | ||
// use alias to make all components replaceable | ||
...Object.fromEntries(fs | ||
.readdirSync(path.resolve(__dirname, '../client/components')) | ||
.filter((file) => file.endsWith('.vue')) | ||
.map((file) => [ | ||
`@theme/${file}`, | ||
path.resolve(__dirname, '../client/components', file), | ||
])), | ||
}, | ||
clientConfigFile: path.resolve(__dirname, '../client/config.js'), | ||
@@ -30,0 +31,0 @@ extendsPage: (page) => { |
@@ -26,19 +26,18 @@ /** | ||
*/ | ||
export declare type NavbarItem = NavLink; | ||
export declare type NavbarGroup = NavGroup<NavbarGroup | NavbarItem | string>; | ||
export declare type NavbarConfig = (NavbarItem | NavbarGroup | string)[]; | ||
export declare type ResolvedNavbarItem = NavbarItem | NavGroup<ResolvedNavbarItem>; | ||
export type NavbarItem = NavLink; | ||
export type NavbarGroup = NavGroup<NavbarGroup | NavbarItem | string>; | ||
export type NavbarConfig = (NavbarItem | NavbarGroup | string)[]; | ||
export type ResolvedNavbarItem = NavbarItem | NavGroup<ResolvedNavbarItem>; | ||
/** | ||
* Sidebar types | ||
*/ | ||
export declare type SidebarItem = NavItem & Partial<NavLink>; | ||
export declare type SidebarGroup = SidebarItem & NavGroup<SidebarItem | SidebarGroup | string>; | ||
export declare type SidebarGroupCollapsible = SidebarGroup & { | ||
export type SidebarItem = NavItem & Partial<NavLink>; | ||
export type SidebarGroup = SidebarItem & NavGroup<SidebarItem | SidebarGroup | string> & { | ||
collapsible?: boolean; | ||
}; | ||
export declare type SidebarConfigArray = (SidebarItem | SidebarGroupCollapsible | string)[]; | ||
export declare type SidebarConfigObject = Record<string, SidebarConfigArray>; | ||
export declare type SidebarConfig = SidebarConfigArray | SidebarConfigObject; | ||
export declare type ResolvedSidebarItem = SidebarItem & Partial<NavGroup<ResolvedSidebarItem>> & { | ||
export type SidebarConfigArray = (SidebarItem | SidebarGroup | string)[]; | ||
export type SidebarConfigObject = Record<string, SidebarConfigArray>; | ||
export type SidebarConfig = SidebarConfigArray | SidebarConfigObject; | ||
export type ResolvedSidebarItem = SidebarItem & Partial<NavGroup<ResolvedSidebarItem>> & { | ||
collapsible?: boolean; | ||
}; |
@@ -45,4 +45,4 @@ import type { ThemeData } from '@vuepress/plugin-theme-data'; | ||
} | ||
export declare type DefaultThemeLocaleOptions = DefaultThemeData; | ||
export declare type DefaultThemeData = ThemeData<DefaultThemeLocaleData>; | ||
export type DefaultThemeLocaleOptions = DefaultThemeData; | ||
export type DefaultThemeData = ThemeData<DefaultThemeLocaleData>; | ||
export interface DefaultThemeLocaleData extends LocaleData { | ||
@@ -49,0 +49,0 @@ /** |
@@ -16,2 +16,3 @@ import type { GitPluginPageData } from '@vuepress/plugin-git'; | ||
heroAlt?: string; | ||
heroHeight?: number; | ||
heroText?: string | null; | ||
@@ -18,0 +19,0 @@ tagline?: string | null; |
{ | ||
"name": "@vuepress/theme-default", | ||
"version": "2.0.0-beta.50-pre.1", | ||
"version": "2.0.0-rc.0", | ||
"description": "Default theme of VuePress", | ||
@@ -25,3 +25,7 @@ "keywords": [ | ||
"./client": "./lib/client/index.js", | ||
"./components/*": "./lib/client/components/*", | ||
"./layouts/*": "./lib/client/layouts/*", | ||
"./styles/*": "./lib/client/styles/*", | ||
"./templates/*": "./templates/*", | ||
"./lib/*": "./lib/*", | ||
"./package.json": "./package.json" | ||
@@ -36,23 +40,23 @@ }, | ||
"dependencies": { | ||
"@vuepress/client": "2.0.0-beta.50-pre.1", | ||
"@vuepress/core": "2.0.0-beta.50-pre.1", | ||
"@vuepress/plugin-active-header-links": "2.0.0-beta.50-pre.1", | ||
"@vuepress/plugin-back-to-top": "2.0.0-beta.50-pre.1", | ||
"@vuepress/plugin-container": "2.0.0-beta.50-pre.1", | ||
"@vuepress/plugin-external-link-icon": "2.0.0-beta.50-pre.1", | ||
"@vuepress/plugin-git": "2.0.0-beta.50-pre.1", | ||
"@vuepress/plugin-medium-zoom": "2.0.0-beta.50-pre.1", | ||
"@vuepress/plugin-nprogress": "2.0.0-beta.50-pre.1", | ||
"@vuepress/plugin-palette": "2.0.0-beta.50-pre.1", | ||
"@vuepress/plugin-prismjs": "2.0.0-beta.50-pre.1", | ||
"@vuepress/plugin-theme-data": "2.0.0-beta.50-pre.1", | ||
"@vuepress/shared": "2.0.0-beta.50-pre.1", | ||
"@vuepress/utils": "2.0.0-beta.50-pre.1", | ||
"@vueuse/core": "^9.1.0", | ||
"sass": "^1.54.4", | ||
"vue": "^3.2.37", | ||
"vue-router": "^4.1.3" | ||
"@vueuse/core": "^10.6.1", | ||
"sass": "^1.69.5", | ||
"vue": "^3.3.8", | ||
"vue-router": "^4.2.5", | ||
"@vuepress/core": "2.0.0-rc.0", | ||
"@vuepress/client": "2.0.0-rc.0", | ||
"@vuepress/plugin-active-header-links": "2.0.0-rc.0", | ||
"@vuepress/plugin-container": "2.0.0-rc.0", | ||
"@vuepress/plugin-external-link-icon": "2.0.0-rc.0", | ||
"@vuepress/plugin-nprogress": "2.0.0-rc.0", | ||
"@vuepress/plugin-back-to-top": "2.0.0-rc.0", | ||
"@vuepress/plugin-medium-zoom": "2.0.0-rc.0", | ||
"@vuepress/plugin-theme-data": "2.0.0-rc.0", | ||
"@vuepress/plugin-git": "2.0.0-rc.0", | ||
"@vuepress/plugin-palette": "2.0.0-rc.0", | ||
"@vuepress/utils": "2.0.0-rc.0", | ||
"@vuepress/shared": "2.0.0-rc.0", | ||
"@vuepress/plugin-prismjs": "2.0.0-rc.0" | ||
}, | ||
"peerDependencies": { | ||
"sass-loader": "^13.0.0" | ||
"sass-loader": "^13.3.2" | ||
}, | ||
@@ -59,0 +63,0 @@ "peerDependenciesMeta": { |
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
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
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
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
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
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
Deprecated
MaintenanceThe maintainer of the package marked it as deprecated. This could indicate that a single version should not be used, or that the package is no longer maintained and any new vulnerabilities will not be fixed.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
122830
97
1198
0
0
+ Added@mdit-vue/plugin-component@1.0.0(transitive)
+ Added@mdit-vue/plugin-frontmatter@1.0.0(transitive)
+ Added@mdit-vue/plugin-headers@1.0.0(transitive)
+ Added@mdit-vue/plugin-sfc@1.0.0(transitive)
+ Added@mdit-vue/plugin-title@1.0.0(transitive)
+ Added@mdit-vue/plugin-toc@1.0.0(transitive)
+ Added@mdit-vue/shared@1.0.0(transitive)
+ Added@mdit-vue/types@1.0.0(transitive)
+ Added@sindresorhus/merge-streams@2.3.0(transitive)
+ Added@types/fs-extra@11.0.4(transitive)
+ Added@types/jsonfile@6.1.4(transitive)
+ Added@types/linkify-it@3.0.5(transitive)
+ Added@types/markdown-it@13.0.8(transitive)
+ Added@types/mdurl@1.0.5(transitive)
+ Added@types/web-bluetooth@0.0.20(transitive)
+ Added@vuepress/client@2.0.0-rc.0(transitive)
+ Added@vuepress/core@2.0.0-rc.0(transitive)
+ Added@vuepress/markdown@2.0.0-rc.0(transitive)
+ Added@vuepress/plugin-active-header-links@2.0.0-rc.0(transitive)
+ Added@vuepress/plugin-back-to-top@2.0.0-rc.0(transitive)
+ Added@vuepress/plugin-container@2.0.0-rc.0(transitive)
+ Added@vuepress/plugin-external-link-icon@2.0.0-rc.0(transitive)
+ Added@vuepress/plugin-git@2.0.0-rc.0(transitive)
+ Added@vuepress/plugin-medium-zoom@2.0.0-rc.0(transitive)
+ Added@vuepress/plugin-nprogress@2.0.0-rc.0(transitive)
+ Added@vuepress/plugin-palette@2.0.0-rc.0(transitive)
+ Added@vuepress/plugin-prismjs@2.0.0-rc.0(transitive)
+ Added@vuepress/plugin-theme-data@2.0.0-rc.0(transitive)
+ Added@vuepress/shared@2.0.0-rc.0(transitive)
+ Added@vuepress/utils@2.0.0-rc.0(transitive)
+ Added@vueuse/core@10.10.0(transitive)
+ Added@vueuse/metadata@10.10.0(transitive)
+ Added@vueuse/shared@10.10.0(transitive)
+ Addedeastasianwidth@0.2.0(transitive)
+ Addedemoji-regex@10.3.0(transitive)
+ Addedexeca@8.0.1(transitive)
+ Addedfs-extra@11.2.0(transitive)
+ Addedget-stream@8.0.1(transitive)
+ Addedglobby@14.0.1(transitive)
+ Addedhuman-signals@5.0.0(transitive)
+ Addedora@7.0.1(transitive)
+ Addedpath-type@5.0.0(transitive)
+ Addedsignal-exit@4.1.0(transitive)
+ Addedslash@5.1.0(transitive)
+ Addedstring-width@6.1.0(transitive)
+ Addedunicorn-magic@0.1.0(transitive)
- Removed@mdit-vue/plugin-component@0.9.4(transitive)
- Removed@mdit-vue/plugin-frontmatter@0.9.2(transitive)
- Removed@mdit-vue/plugin-headers@0.9.3(transitive)
- Removed@mdit-vue/plugin-sfc@0.9.2(transitive)
- Removed@mdit-vue/plugin-title@0.9.3(transitive)
- Removed@mdit-vue/plugin-toc@0.9.2(transitive)
- Removed@mdit-vue/shared@0.9.2(transitive)
- Removed@mdit-vue/types@0.9.2(transitive)
- Removed@types/fs-extra@9.0.13(transitive)
- Removed@types/linkify-it@5.0.0(transitive)
- Removed@types/markdown-it@12.2.3(transitive)
- Removed@types/mdurl@2.0.0(transitive)
- Removed@types/web-bluetooth@0.0.16(transitive)
- Removed@vuepress/client@2.0.0-beta.50-pre.1(transitive)
- Removed@vuepress/core@2.0.0-beta.50-pre.1(transitive)
- Removed@vuepress/markdown@2.0.0-beta.50-pre.1(transitive)
- Removed@vuepress/plugin-active-header-links@2.0.0-beta.50-pre.1(transitive)
- Removed@vuepress/plugin-back-to-top@2.0.0-beta.50-pre.1(transitive)
- Removed@vuepress/plugin-container@2.0.0-beta.50-pre.1(transitive)
- Removed@vuepress/plugin-external-link-icon@2.0.0-beta.50-pre.1(transitive)
- Removed@vuepress/plugin-git@2.0.0-beta.50-pre.1(transitive)
- Removed@vuepress/plugin-medium-zoom@2.0.0-beta.50-pre.1(transitive)
- Removed@vuepress/plugin-nprogress@2.0.0-beta.50-pre.1(transitive)
- Removed@vuepress/plugin-palette@2.0.0-beta.50-pre.1(transitive)
- Removed@vuepress/plugin-prismjs@2.0.0-beta.50-pre.1(transitive)
- Removed@vuepress/plugin-theme-data@2.0.0-beta.50-pre.1(transitive)
- Removed@vuepress/shared@2.0.0-beta.50-pre.1(transitive)
- Removed@vuepress/utils@2.0.0-beta.50-pre.1(transitive)
- Removed@vueuse/core@9.13.0(transitive)
- Removed@vueuse/metadata@9.13.0(transitive)
- Removed@vueuse/shared@9.13.0(transitive)
- Removedclone@1.0.4(transitive)
- Removeddefaults@1.0.4(transitive)
- Removeddir-glob@3.0.1(transitive)
- Removedexeca@6.1.0(transitive)
- Removedfs-extra@10.1.0(transitive)
- Removedget-stream@6.0.1(transitive)
- Removedglobby@13.2.2(transitive)
- Removedhuman-signals@3.0.1(transitive)
- Removedora@6.3.1(transitive)
- Removedpath-type@4.0.0(transitive)
- Removedslash@4.0.0(transitive)
- Removedwcwidth@1.0.1(transitive)
Updated@vuepress/client@2.0.0-rc.0
Updated@vuepress/core@2.0.0-rc.0
Updated@vuepress/shared@2.0.0-rc.0
Updated@vuepress/utils@2.0.0-rc.0
Updated@vueuse/core@^10.6.1
Updatedsass@^1.69.5
Updatedvue@^3.3.8
Updatedvue-router@^4.2.5