@vuepress/theme-default 2.0.0-rc.14 → 2.0.0-rc.17

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.
@@ -1,8 +1,7 @@
1
1
  <script setup lang="ts">
2
2
  import { computed, toRefs } from 'vue'
3
3
  import type { PropType } from 'vue'
4
- import { useRoute } from 'vue-router'
5
- import { useSiteData } from 'vuepress/client'
4
+ import { useRoute, useSiteData } from 'vuepress/client'
6
5
  import { isLinkHttp, isLinkWithProtocol } from 'vuepress/shared'
7
6
  import type { NavLink } from '../../shared/index.js'
8
7
 
@@ -3,7 +3,7 @@ import AutoLink from '@theme/AutoLink.vue'
3
3
  import DropdownTransition from '@theme/DropdownTransition.vue'
4
4
  import { computed, ref, toRefs, watch } from 'vue'
5
5
  import type { PropType } from 'vue'
6
- import { useRoute } from 'vue-router'
6
+ import { useRoute } from 'vuepress/client'
7
7
  import type { NavbarItem, ResolvedNavbarItem } from '../../shared/index.js'
8
8
 
9
9
  const props = defineProps({
@@ -4,8 +4,12 @@ import NavbarDropdown from '@theme/NavbarDropdown.vue'
4
4
  import { useRoutePaths } from '@vuepress/helper/client'
5
5
  import { computed, ref } from 'vue'
6
6
  import type { ComputedRef } from 'vue'
7
- import { useRoute } from 'vue-router'
8
- import { useRouteLocale, useSiteData, useSiteLocaleData } from 'vuepress/client'
7
+ import {
8
+ useRoute,
9
+ useRouteLocale,
10
+ useSiteData,
11
+ useSiteLocaleData,
12
+ } from 'vuepress/client'
9
13
  import { isLinkHttp, isString } from 'vuepress/shared'
10
14
  import type {
11
15
  NavbarGroup,
@@ -1,9 +1,8 @@
1
1
  <script setup lang="ts">
2
2
  import AutoLink from '@theme/AutoLink.vue'
3
3
  import { computed } from 'vue'
4
- import type { Router } from 'vue-router'
5
- import { useRoute, useRouter } from 'vue-router'
6
- import { usePageFrontmatter } from 'vuepress/client'
4
+ import type { Router } from 'vuepress/client'
5
+ import { usePageFrontmatter, useRoute, useRouter } from 'vuepress/client'
7
6
  import { isPlainObject, isString } from 'vuepress/shared'
8
7
  import type {
9
8
  DefaultThemeNormalPageFrontmatter,
@@ -4,7 +4,7 @@ import DropdownTransition from '@theme/DropdownTransition.vue'
4
4
  import { useToggle } from '@vueuse/core'
5
5
  import { computed, nextTick, onBeforeUnmount, toRefs } from 'vue'
6
6
  import type { PropType } from 'vue'
7
- import { useRoute, useRouter } from 'vue-router'
7
+ import { useRoute, useRouter } from 'vuepress/client'
8
8
  import type { ResolvedSidebarItem } from '../../shared/index.js'
9
9
  import { isActiveSidebarItem } from '../utils/index.js'
10
10
 
@@ -1,7 +1,7 @@
1
1
  <script setup lang="ts">
2
2
  import SidebarItem from '@theme/SidebarItem.vue'
3
3
  import { onMounted, watch } from 'vue'
4
- import { useRoute } from 'vue-router'
4
+ import { useRoute } from 'vuepress/client'
5
5
  import { useSidebarItems } from '../composables/index.js'
6
6
 
7
7
  const route = useRoute()
@@ -1,6 +1,5 @@
1
1
  import { computed, inject, provide } from 'vue';
2
- import { useRoute } from 'vue-router';
3
- import { usePageData, usePageFrontmatter } from 'vuepress/client';
2
+ import { usePageData, usePageFrontmatter, useRoute } from 'vuepress/client';
4
3
  import { isPlainObject, isString, resolveLocalePath } from 'vuepress/shared';
5
4
  import { getNavLink } from '../utils/index.js';
6
5
  import { useThemeLocaleData } from './useThemeData.js';
@@ -4,8 +4,7 @@ import Navbar from '@theme/Navbar.vue'
4
4
  import Page from '@theme/Page.vue'
5
5
  import Sidebar from '@theme/Sidebar.vue'
6
6
  import { computed, onMounted, onUnmounted, ref } from 'vue'
7
- import { useRouter } from 'vue-router'
8
- import { usePageData, usePageFrontmatter } from 'vuepress/client'
7
+ import { usePageData, usePageFrontmatter, useRouter } from 'vuepress/client'
9
8
  import type { DefaultThemePageFrontmatter } from '../../shared/index.js'
10
9
  import {
11
10
  useScrollPromise,
@@ -54,7 +54,7 @@
54
54
 
55
55
  & > a {
56
56
  font-weight: inherit;
57
- &.router-link-active {
57
+ &.route-link-active {
58
58
  &::after {
59
59
  display: none;
60
60
  }
@@ -84,7 +84,7 @@
84
84
  color: var(--c-text-accent);
85
85
  }
86
86
 
87
- &.router-link-active {
87
+ &.route-link-active {
88
88
  color: var(--c-text-accent);
89
89
 
90
90
  &::after {
@@ -76,7 +76,7 @@
76
76
  color: inherit;
77
77
 
78
78
  &:hover,
79
- &.router-link-active {
79
+ &.route-link-active {
80
80
  color: var(--c-text);
81
81
  }
82
82
  }
@@ -93,7 +93,7 @@
93
93
 
94
94
  > a {
95
95
  &:hover,
96
- &.router-link-active {
96
+ &.route-link-active {
97
97
  margin-bottom: -2px;
98
98
  border-bottom: 2px solid var(--c-text-accent);
99
99
  }
@@ -108,7 +108,7 @@
108
108
 
109
109
  > a {
110
110
  &:hover,
111
- &.router-link-active {
111
+ &.route-link-active {
112
112
  margin-bottom: 0;
113
113
  border-bottom: none;
114
114
  }
@@ -117,7 +117,7 @@
117
117
 
118
118
  a {
119
119
  &:hover,
120
- &.router-link-active {
120
+ &.route-link-active {
121
121
  color: var(--c-text-accent);
122
122
  }
123
123
  }
@@ -43,7 +43,7 @@
43
43
  .navbar-dropdown-wrapper
44
44
  .navbar-dropdown
45
45
  .navbar-dropdown-item
46
- a.router-link-active::after {
46
+ a.route-link-active::after {
47
47
  top: calc(1rem - 2px);
48
48
  }
49
49
  }
@@ -66,3 +66,10 @@ html.dark .DocSearch {
66
66
  --docsearch-footer-shadow: inset 0 1px 0 0 rgba(73, 76, 106, 0.5),
67
67
  0 -4px 8px 0 rgba(0, 0, 0, 0.2);
68
68
  }
69
+
70
+ // plugin-pwa
71
+ html.dark body {
72
+ --pwa-shadow-color: rgb(0 0 0 / 30%);
73
+ --pwa-content-color: #ccc;
74
+ --pwa-content-light-color: #999;
75
+ }
@@ -149,14 +149,13 @@ body {
149
149
  }
150
150
 
151
151
  // plugin-pwa-popup
152
- .pwa-popup {
153
- --pwa-popup-text-color: var(--c-text);
154
- --pwa-popup-bg-color: var(--c-bg);
155
- --pwa-popup-border-color: var(--c-brand);
156
- --pwa-popup-shadow: 0 4px 16px var(--c-brand);
157
- --pwa-popup-btn-text-color: var(--c-bg);
158
- --pwa-popup-btn-bg-color: var(--c-brand);
159
- --pwa-popup-btn-hover-bg-color: var(--c-brand-light);
152
+ body {
153
+ --pwa-text-color: var(--c-text);
154
+ --pwa-bg-color: var(--c-bg);
155
+ --pwa-border-color: var(--c-brand);
156
+ --pwa-btn-text-color: var(--c-bg);
157
+ --pwa-btn-bg-color: var(--c-brand);
158
+ --pwa-btn-hover-bg-color: var(--c-brand-light);
160
159
  }
161
160
 
162
161
  // plugin-redirect
@@ -1,3 +1,3 @@
1
- import type { RouteLocationNormalizedLoaded } from 'vue-router';
1
+ import type { RouteLocationNormalizedLoaded } from 'vuepress/client';
2
2
  import type { ResolvedSidebarItem } from '../../shared/index.js';
3
3
  export declare const isActiveSidebarItem: (item: ResolvedSidebarItem, route: RouteLocationNormalizedLoaded) => boolean;
@@ -4,6 +4,7 @@ import { containerPlugin } from '@vuepress/plugin-container';
4
4
  import { copyCodePlugin } from '@vuepress/plugin-copy-code';
5
5
  import { externalLinkIconPlugin } from '@vuepress/plugin-external-link-icon';
6
6
  import { gitPlugin } from '@vuepress/plugin-git';
7
+ import { linksCheckPlugin } from '@vuepress/plugin-links-check';
7
8
  import { mediumZoomPlugin } from '@vuepress/plugin-medium-zoom';
8
9
  import { nprogressPlugin } from '@vuepress/plugin-nprogress';
9
10
  import { palettePlugin } from '@vuepress/plugin-palette';
@@ -109,6 +110,12 @@ export const defaultTheme = ({ hostname, themePlugins = {}, ...localeOptions } =
109
110
  contributors: localeOptions.contributors !== false,
110
111
  })
111
112
  : [],
113
+ // @vuepress/plugin-links-check
114
+ themePlugins.linksCheck !== false
115
+ ? linksCheckPlugin(isPlainObject(themePlugins.linksCheck)
116
+ ? themePlugins.linksCheck
117
+ : {})
118
+ : [],
112
119
  // @vuepress/plugin-medium-zoom
113
120
  themePlugins.mediumZoom !== false
114
121
  ? mediumZoomPlugin({
@@ -1,5 +1,6 @@
1
1
  import type { BackToTopPluginOptions } from '@vuepress/plugin-back-to-top';
2
2
  import type { CopyCodePluginOptions } from '@vuepress/plugin-copy-code';
3
+ import type { LinksCheckPluginOptions } from '@vuepress/plugin-links-check';
3
4
  import type { SeoPluginOptions } from '@vuepress/plugin-seo';
4
5
  import type { SitemapPluginOptions } from '@vuepress/plugin-sitemap';
5
6
  import type { ThemeData } from '@vuepress/plugin-theme-data';
@@ -37,6 +38,10 @@ export interface DefaultThemePluginsOptions {
37
38
  * Enable @vuepress/plugin-git or not
38
39
  */
39
40
  git?: boolean;
41
+ /**
42
+ * Enable @vuepress/plugin-links-check or not
43
+ */
44
+ linksCheck?: LinksCheckPluginOptions | boolean;
40
45
  /**
41
46
  * Enable @vuepress/plugin-medium-zoom or not
42
47
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vuepress/theme-default",
3
- "version": "2.0.0-rc.14",
3
+ "version": "2.0.0-rc.17",
4
4
  "description": "Default theme of VuePress",
5
5
  "keywords": [
6
6
  "vuepress-theme",
@@ -42,28 +42,28 @@
42
42
  "copy": "cpx \"src/**/*.{d.ts,vue,scss}\" lib"
43
43
  },
44
44
  "dependencies": {
45
- "@vuepress/helper": "~2.0.0-rc.14",
46
- "@vuepress/plugin-active-header-links": "~2.0.0-rc.14",
47
- "@vuepress/plugin-back-to-top": "~2.0.0-rc.14",
48
- "@vuepress/plugin-container": "~2.0.0-rc.12",
49
- "@vuepress/plugin-copy-code": "~2.0.0-rc.14",
50
- "@vuepress/plugin-external-link-icon": "~2.0.0-rc.14",
51
- "@vuepress/plugin-git": "~2.0.0-rc.12",
52
- "@vuepress/plugin-medium-zoom": "~2.0.0-rc.14",
53
- "@vuepress/plugin-nprogress": "~2.0.0-rc.14",
54
- "@vuepress/plugin-palette": "~2.0.0-rc.14",
55
- "@vuepress/plugin-prismjs": "~2.0.0-rc.12",
56
- "@vuepress/plugin-seo": "~2.0.0-rc.14",
57
- "@vuepress/plugin-sitemap": "~2.0.0-rc.14",
58
- "@vuepress/plugin-theme-data": "~2.0.0-rc.14",
59
- "@vueuse/core": "^10.7.2",
60
- "sass": "^1.70.0",
61
- "vue": "^3.4.16",
62
- "vue-router": "^4.2.5"
45
+ "@vuepress/helper": "~2.0.0-rc.17",
46
+ "@vuepress/plugin-active-header-links": "~2.0.0-rc.17",
47
+ "@vuepress/plugin-back-to-top": "~2.0.0-rc.17",
48
+ "@vuepress/plugin-container": "~2.0.0-rc.15",
49
+ "@vuepress/plugin-copy-code": "~2.0.0-rc.17",
50
+ "@vuepress/plugin-external-link-icon": "~2.0.0-rc.15",
51
+ "@vuepress/plugin-git": "~2.0.0-rc.15",
52
+ "@vuepress/plugin-links-check": "~2.0.0-rc.17",
53
+ "@vuepress/plugin-medium-zoom": "~2.0.0-rc.17",
54
+ "@vuepress/plugin-nprogress": "~2.0.0-rc.15",
55
+ "@vuepress/plugin-palette": "~2.0.0-rc.15",
56
+ "@vuepress/plugin-prismjs": "~2.0.0-rc.15",
57
+ "@vuepress/plugin-seo": "~2.0.0-rc.17",
58
+ "@vuepress/plugin-sitemap": "~2.0.0-rc.17",
59
+ "@vuepress/plugin-theme-data": "~2.0.0-rc.15",
60
+ "@vueuse/core": "^10.8.0",
61
+ "sass": "^1.71.1",
62
+ "vue": "^3.4.19"
63
63
  },
64
64
  "peerDependencies": {
65
65
  "sass-loader": "^14.0.0",
66
- "vuepress": "2.0.0-rc.7"
66
+ "vuepress": "2.0.0-rc.8"
67
67
  },
68
68
  "peerDependenciesMeta": {
69
69
  "sass-loader": {
@@ -73,5 +73,5 @@
73
73
  "publishConfig": {
74
74
  "access": "public"
75
75
  },
76
- "gitHead": "cf292f189b5b4852a241bffc48c45112f647b2de"
76
+ "gitHead": "f1cd0f6d2b8bf9fb66cab5e1944e2bdd7459909f"
77
77
  }