@vuepress/theme-default 2.0.0-beta.26 → 2.0.0-beta.27

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4,12 +4,15 @@
4
4
 
5
5
  <span ref="siteBrand">
6
6
  <RouterLink :to="siteBrandLink">
7
- <img
8
- v-if="siteBrandLogo"
9
- class="logo"
10
- :src="withBase(siteBrandLogo)"
11
- :alt="siteBrandTitle"
12
- />
7
+ <!-- logo could be different in dark mode, so we make it client-only to avoid ssr-mismatch -->
8
+ <ClientOnly>
9
+ <img
10
+ v-if="siteBrandLogo"
11
+ class="logo"
12
+ :src="withBase(siteBrandLogo)"
13
+ :alt="siteBrandTitle"
14
+ />
15
+ </ClientOnly>
13
16
 
14
17
  <span
15
18
  v-if="siteBrandTitle"
@@ -14,7 +14,7 @@ import { isLinkHttp, isString } from '@vuepress/shared'
14
14
  import { computed } from 'vue'
15
15
  import type { ComputedRef } from 'vue'
16
16
  import { useRouter } from 'vue-router'
17
- import type { NavbarItem, NavbarGroup, ResolvedNavbarItem } from '../../shared'
17
+ import type { NavbarGroup, NavbarItem, ResolvedNavbarItem } from '../../shared'
18
18
  import { useNavLink, useThemeLocaleData } from '../composables'
19
19
  import { resolveRepoType } from '../utils'
20
20
  import DropdownLink from './DropdownLink.vue'
@@ -35,8 +35,8 @@ import {
35
35
  import { computed } from 'vue'
36
36
  import type { ComputedRef } from 'vue'
37
37
  import type {
38
- DefaultThemePageData,
39
38
  DefaultThemeNormalPageFrontmatter,
39
+ DefaultThemePageData,
40
40
  NavLink as NavLinkType,
41
41
  } from '../../shared'
42
42
  import { useThemeLocaleData } from '../composables'
@@ -70,7 +70,8 @@ const useEditNavLink = (): ComputedRef<null | NavLinkType> => {
70
70
  docsBranch,
71
71
  docsDir,
72
72
  filePathRelative: page.value.filePathRelative,
73
- editLinkPattern: themeLocale.value.editLinkPattern,
73
+ editLinkPattern:
74
+ frontmatter.value.editLinkPattern ?? themeLocale.value.editLinkPattern,
74
75
  })
75
76
 
76
77
  if (!editLink) return null
@@ -1,5 +1,5 @@
1
1
  import type { VNode } from 'vue';
2
2
  declare const _default: import("vue").DefineComponent<{}, () => VNode<import("vue").RendererNode, import("vue").RendererElement, {
3
3
  [key: string]: any;
4
- }> | null, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<{} & {} & {}> & ({} | {}), {}>;
4
+ }> | null, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<{} & {} & {}>, {}>;
5
5
  export default _default;
@@ -1,6 +1,6 @@
1
1
  import type { PageHeader } from '@vuepress/client';
2
2
  import type { ComputedRef, InjectionKey } from 'vue';
3
- import type { DefaultThemeData, DefaultThemeNormalPageFrontmatter, SidebarConfigArray, SidebarConfigObject, ResolvedSidebarItem } from '../../shared';
3
+ import type { DefaultThemeData, DefaultThemeNormalPageFrontmatter, ResolvedSidebarItem, SidebarConfigArray, SidebarConfigObject } from '../../shared';
4
4
  export declare type SidebarItemsRef = ComputedRef<ResolvedSidebarItem[]>;
5
5
  export declare const sidebarItemsSymbol: InjectionKey<SidebarItemsRef>;
6
6
  /**
@@ -1,4 +1,4 @@
1
- import type { NavItem, NavGroup, NavLink, NavbarItem, NavbarGroup, NavbarConfig, ResolvedNavbarItem, SidebarItem, SidebarConfigArray, SidebarConfigObject, SidebarConfig, ResolvedSidebarItem, DefaultThemePluginsOptions, DefaultThemeLocaleOptions, DefaultThemeData, DefaultThemeLocaleData, DefaultThemePageData, DefaultThemePageFrontmatter, DefaultThemeHomePageFrontmatter, DefaultThemeNormalPageFrontmatter } from '../shared';
1
+ import type { DefaultThemeData, DefaultThemeHomePageFrontmatter, DefaultThemeLocaleData, DefaultThemeLocaleOptions, DefaultThemeNormalPageFrontmatter, DefaultThemePageData, DefaultThemePageFrontmatter, DefaultThemePluginsOptions, NavbarConfig, NavbarGroup, NavbarItem, NavGroup, NavItem, NavLink, ResolvedNavbarItem, ResolvedSidebarItem, SidebarConfig, SidebarConfigArray, SidebarConfigObject, SidebarItem } from '../shared';
2
2
  export type { NavItem, NavGroup, NavLink, NavbarItem, NavbarGroup, NavbarConfig, ResolvedNavbarItem, SidebarItem, SidebarConfigArray, SidebarConfigObject, SidebarConfig, ResolvedSidebarItem, DefaultThemePluginsOptions, DefaultThemeLocaleOptions, DefaultThemeData, DefaultThemeLocaleData, DefaultThemePageData, DefaultThemePageFrontmatter, DefaultThemeHomePageFrontmatter, DefaultThemeNormalPageFrontmatter, };
3
3
  export * from './composables';
4
4
  export * from './utils';
@@ -135,6 +135,7 @@ pre[class*='language-'] {
135
135
  padding: 0;
136
136
  background-color: transparent;
137
137
  border-radius: 0;
138
+ overflow-wrap: unset;
138
139
  -webkit-font-smoothing: auto;
139
140
  -moz-osx-font-smoothing: auto;
140
141
  }
@@ -26,6 +26,13 @@
26
26
  margin: 1.8rem auto;
27
27
  }
28
28
 
29
+ .actions {
30
+ display: flex;
31
+ flex-wrap: wrap;
32
+ gap: 1rem;
33
+ justify-content: center;
34
+ }
35
+
29
36
  .description {
30
37
  max-width: 35rem;
31
38
  font-size: 1.6rem;
@@ -43,10 +50,6 @@
43
50
  transition: background-color var(--t-color);
44
51
  box-sizing: border-box;
45
52
 
46
- &:not(:first-child) {
47
- margin-left: 1.5rem;
48
- }
49
-
50
53
  &.primary {
51
54
  color: var(--c-bg);
52
55
  background-color: var(--c-brand);
@@ -1,4 +1,4 @@
1
- import { isLinkHttp, removeLeadingSlash, removeEndingSlash, } from '@vuepress/shared';
1
+ import { isLinkHttp, removeEndingSlash, removeLeadingSlash, } from '@vuepress/shared';
2
2
  import { resolveRepoType } from './resolveRepoType';
3
3
  export const editLinkPatterns = {
4
4
  GitHub: ':repo/edit/:branch/:path',
@@ -4,7 +4,7 @@ exports.defaultTheme = void 0;
4
4
  const utils_1 = require("@vuepress/utils");
5
5
  const utils_2 = require("./utils");
6
6
  const defaultTheme = ({ themePlugins = {}, ...localeOptions }) => {
7
- utils_2.assignDefaultLocaleOptions(localeOptions);
7
+ (0, utils_2.assignDefaultLocaleOptions)(localeOptions);
8
8
  return {
9
9
  name: '@vuepress/theme-default',
10
10
  layouts: utils_1.path.resolve(__dirname, '../client/layouts'),
@@ -15,35 +15,35 @@ const defaultTheme = ({ themePlugins = {}, ...localeOptions }) => {
15
15
  plugins: [
16
16
  [
17
17
  '@vuepress/active-header-links',
18
- utils_2.resolveActiveHeaderLinksPluginOptions(themePlugins),
18
+ (0, utils_2.resolveActiveHeaderLinksPluginOptions)(themePlugins),
19
19
  ],
20
20
  ['@vuepress/back-to-top', themePlugins.backToTop !== false],
21
21
  [
22
22
  '@vuepress/container',
23
- utils_2.resolveContainerPluginOptions(themePlugins, localeOptions, 'tip'),
23
+ (0, utils_2.resolveContainerPluginOptions)(themePlugins, localeOptions, 'tip'),
24
24
  ],
25
25
  [
26
26
  '@vuepress/container',
27
- utils_2.resolveContainerPluginOptions(themePlugins, localeOptions, 'warning'),
27
+ (0, utils_2.resolveContainerPluginOptions)(themePlugins, localeOptions, 'warning'),
28
28
  ],
29
29
  [
30
30
  '@vuepress/container',
31
- utils_2.resolveContainerPluginOptions(themePlugins, localeOptions, 'danger'),
31
+ (0, utils_2.resolveContainerPluginOptions)(themePlugins, localeOptions, 'danger'),
32
32
  ],
33
33
  [
34
34
  '@vuepress/container',
35
- utils_2.resolveContainerPluginOptionsForDetails(themePlugins),
35
+ (0, utils_2.resolveContainerPluginOptionsForDetails)(themePlugins),
36
36
  ],
37
37
  [
38
38
  '@vuepress/container',
39
- utils_2.resolveContainerPluginOptionsForCodeGroup(themePlugins),
39
+ (0, utils_2.resolveContainerPluginOptionsForCodeGroup)(themePlugins),
40
40
  ],
41
41
  [
42
42
  '@vuepress/container',
43
- utils_2.resolveContainerPluginOptionsForCodeGroupItem(themePlugins),
43
+ (0, utils_2.resolveContainerPluginOptionsForCodeGroupItem)(themePlugins),
44
44
  ],
45
- ['@vuepress/git', utils_2.resolveGitPluginOptions(themePlugins, localeOptions)],
46
- ['@vuepress/medium-zoom', utils_2.resolveMediumZoomPluginOptions(themePlugins)],
45
+ ['@vuepress/git', (0, utils_2.resolveGitPluginOptions)(themePlugins, localeOptions)],
46
+ ['@vuepress/medium-zoom', (0, utils_2.resolveMediumZoomPluginOptions)(themePlugins)],
47
47
  ['@vuepress/nprogress', themePlugins.nprogress !== false],
48
48
  ['@vuepress/palette', { preset: 'sass' }],
49
49
  ['@vuepress/prismjs', themePlugins.prismjs !== false],
@@ -1,5 +1,5 @@
1
1
  import type { ContainerPluginOptions } from '@vuepress/plugin-container';
2
- import type { DefaultThemePluginsOptions, DefaultThemeData } from '../../shared';
2
+ import type { DefaultThemeData, DefaultThemePluginsOptions } from '../../shared';
3
3
  /**
4
4
  * Resolve options for @vuepress/plugin-container
5
5
  *
@@ -1,5 +1,5 @@
1
1
  import type { GitPluginOptions } from '@vuepress/plugin-git';
2
- import type { DefaultThemePluginsOptions, DefaultThemeLocaleOptions } from '../../shared';
2
+ import type { DefaultThemeLocaleOptions, DefaultThemePluginsOptions } from '../../shared';
3
3
  /**
4
4
  * Resolve options for @vuepress/plugin-git
5
5
  */
@@ -29,6 +29,7 @@ export interface DefaultThemeHomePageFrontmatter extends DefaultThemePageFrontma
29
29
  export interface DefaultThemeNormalPageFrontmatter extends DefaultThemePageFrontmatter {
30
30
  home?: false;
31
31
  editLink?: boolean;
32
+ editLinkPattern?: string;
32
33
  lastUpdated?: boolean;
33
34
  contributors?: boolean;
34
35
  sidebar?: 'auto' | false | SidebarConfig;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vuepress/theme-default",
3
- "version": "2.0.0-beta.26",
3
+ "version": "2.0.0-beta.27",
4
4
  "description": "Default theme of VuePress",
5
5
  "keywords": [
6
6
  "vuepress-theme",
@@ -29,27 +29,27 @@
29
29
  "copy": "cpx \"src/**/*.{d.ts,vue,scss}\" lib"
30
30
  },
31
31
  "dependencies": {
32
- "@vuepress/client": "2.0.0-beta.26",
33
- "@vuepress/core": "2.0.0-beta.26",
34
- "@vuepress/plugin-active-header-links": "2.0.0-beta.26",
35
- "@vuepress/plugin-back-to-top": "2.0.0-beta.26",
36
- "@vuepress/plugin-container": "2.0.0-beta.26",
37
- "@vuepress/plugin-git": "2.0.0-beta.26",
38
- "@vuepress/plugin-medium-zoom": "2.0.0-beta.26",
39
- "@vuepress/plugin-nprogress": "2.0.0-beta.26",
40
- "@vuepress/plugin-palette": "2.0.0-beta.26",
41
- "@vuepress/plugin-prismjs": "2.0.0-beta.26",
42
- "@vuepress/plugin-theme-data": "2.0.0-beta.26",
43
- "@vuepress/shared": "2.0.0-beta.25",
44
- "@vuepress/utils": "2.0.0-beta.25",
45
- "@vueuse/core": "^6.0.0",
46
- "sass": "^1.38.0",
47
- "sass-loader": "^12.1.0",
48
- "vue": "^3.2.3",
49
- "vue-router": "^4.0.10"
32
+ "@vuepress/client": "2.0.0-beta.27",
33
+ "@vuepress/core": "2.0.0-beta.27",
34
+ "@vuepress/plugin-active-header-links": "2.0.0-beta.27",
35
+ "@vuepress/plugin-back-to-top": "2.0.0-beta.27",
36
+ "@vuepress/plugin-container": "2.0.0-beta.27",
37
+ "@vuepress/plugin-git": "2.0.0-beta.27",
38
+ "@vuepress/plugin-medium-zoom": "2.0.0-beta.27",
39
+ "@vuepress/plugin-nprogress": "2.0.0-beta.27",
40
+ "@vuepress/plugin-palette": "2.0.0-beta.27",
41
+ "@vuepress/plugin-prismjs": "2.0.0-beta.27",
42
+ "@vuepress/plugin-theme-data": "2.0.0-beta.27",
43
+ "@vuepress/shared": "2.0.0-beta.27",
44
+ "@vuepress/utils": "2.0.0-beta.27",
45
+ "@vueuse/core": "^6.7.3",
46
+ "sass": "^1.43.4",
47
+ "sass-loader": "^12.2.0",
48
+ "vue": "^3.2.20",
49
+ "vue-router": "^4.0.12"
50
50
  },
51
51
  "publishConfig": {
52
52
  "access": "public"
53
53
  },
54
- "gitHead": "6cbf3e07b2871383cebad5180fcbb02d69c79566"
54
+ "gitHead": "2671a94fe6864e215eb84f318b7e657744a0bc5d"
55
55
  }