Socket
Socket
Sign inDemoInstall

@vuepress/theme-default

Package Overview
Dependencies
410
Maintainers
6
Versions
213
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 2.0.0-beta.50-pre.1 to 2.0.0-rc.0

lib/client/composables/useUpdateDeviceStatus.d.ts

6

lib/client/components/global/CodeGroup.d.ts

@@ -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

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc