@vuepress/theme-default 2.0.0-beta.28 → 2.0.0-beta.29

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.
@@ -3,17 +3,16 @@ import { h } from 'vue';
3
3
  import Badge from './components/global/Badge.vue';
4
4
  import CodeGroup from './components/global/CodeGroup';
5
5
  import CodeGroupItem from './components/global/CodeGroupItem.vue';
6
- import OutboundLink from './components/global/OutboundLink.vue';
6
+ import ExternalLinkIcon from './components/global/ExternalLinkIcon.vue';
7
7
  import { useScrollPromise } from './composables';
8
8
  import './styles/index.scss';
9
9
  export default defineClientAppEnhance(({ app, router }) => {
10
10
  app.component('Badge', Badge);
11
11
  app.component('CodeGroup', CodeGroup);
12
12
  app.component('CodeGroupItem', CodeGroupItem);
13
- // unregister the built-in `<OutboundLink>` to avoid warning
14
- delete app._context.components.OutboundLink;
15
- // override the built-in `<OutboundLink>`
16
- app.component('OutboundLink', OutboundLink);
13
+ // override the `<ExternalLinkIcon>` provided by @vuepress/plugin-external-link-icon
14
+ delete app._context.components.ExternalLinkIcon;
15
+ app.component('ExternalLinkIcon', ExternalLinkIcon);
17
16
  // compat with @vuepress/plugin-docsearch and @vuepress/plugin-search
18
17
  app.component('NavbarSearch', () => {
19
18
  const SearchComponent = app.component('Docsearch') || app.component('SearchBox');
@@ -22,7 +22,7 @@
22
22
  >
23
23
  <slot name="before" />
24
24
  {{ item.text }}
25
- <OutboundLink v-if="isBlankTarget" />
25
+ <ExternalLinkIcon v-if="isBlankTarget" />
26
26
  <slot name="after" />
27
27
  </a>
28
28
  </template>
@@ -1,14 +1,11 @@
1
1
  <template>
2
- <RawOutboundLink>
2
+ <RawExternalLinkIcon>
3
3
  <span class="sr-only">{{ themeLocale.openInNewWindow }}</span>
4
- </RawOutboundLink>
4
+ </RawExternalLinkIcon>
5
5
  </template>
6
6
 
7
7
  <script setup lang="ts">
8
- /**
9
- * Override the built-in `<OutboundLink>` for a11y
10
- */
11
- import { OutboundLink as RawOutboundLink } from '@vuepress/client'
8
+ import { ExternalLinkIcon as RawExternalLinkIcon } from '@vuepress/plugin-external-link-icon/lib/client'
12
9
  import { useThemeLocaleData } from '../../composables'
13
10
 
14
11
  const themeLocale = useThemeLocaleData()
@@ -95,6 +95,11 @@
95
95
  --docsearch-footer-background: var(--c-bg);
96
96
  }
97
97
 
98
+ // plugin-external-link-icon
99
+ .external-link-icon {
100
+ --external-link-icon-color: var(--c-text-quote);
101
+ }
102
+
98
103
  // plugin-medium-zoom
99
104
  .medium-zoom-overlay {
100
105
  --medium-zoom-bg-color: var(--c-bg);
@@ -56,6 +56,7 @@ const defaultTheme = ({ themePlugins = {}, ...localeOptions }, app) => {
56
56
  '@vuepress/container',
57
57
  (0, utils_2.resolveContainerPluginOptionsForCodeGroupItem)(themePlugins),
58
58
  ],
59
+ ['@vuepress/external-link-icon', themePlugins.externalLinkIcon !== false],
59
60
  ['@vuepress/git', (0, utils_2.resolveGitPluginOptions)(themePlugins, localeOptions)],
60
61
  ['@vuepress/medium-zoom', (0, utils_2.resolveMediumZoomPluginOptions)(themePlugins)],
61
62
  ['@vuepress/nprogress', themePlugins.nprogress !== false],
@@ -1,4 +1,6 @@
1
- import type { DefaultThemeLocaleOptions } from '../../shared';
1
+ import type { DefaultThemeLocaleData, DefaultThemeLocaleOptions } from '../../shared';
2
+ export declare const DEFAULT_LOCALE_OPTIONS: DefaultThemeLocaleOptions;
3
+ export declare const DEFAULT_LOCALE_DATA: DefaultThemeLocaleData;
2
4
  /**
3
5
  * Assign default options to `themeConfig`
4
6
  */
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.assignDefaultLocaleOptions = void 0;
4
- const defaultLocaleOptions = {
3
+ exports.assignDefaultLocaleOptions = exports.DEFAULT_LOCALE_DATA = exports.DEFAULT_LOCALE_OPTIONS = void 0;
4
+ exports.DEFAULT_LOCALE_OPTIONS = {
5
5
  // navbar
6
6
  navbar: [],
7
7
  logo: null,
@@ -32,7 +32,7 @@ const defaultLocaleOptions = {
32
32
  toggleDarkMode: 'toggle dark mode',
33
33
  toggleSidebar: 'toggle sidebar',
34
34
  };
35
- const defaultLocaleData = {
35
+ exports.DEFAULT_LOCALE_DATA = {
36
36
  // navbar
37
37
  selectLanguageName: 'English',
38
38
  };
@@ -47,11 +47,11 @@ const assignDefaultLocaleOptions = (localeOptions) => {
47
47
  localeOptions.locales['/'] = {};
48
48
  }
49
49
  Object.assign(localeOptions, {
50
- ...defaultLocaleOptions,
50
+ ...exports.DEFAULT_LOCALE_OPTIONS,
51
51
  ...localeOptions,
52
52
  });
53
53
  Object.assign(localeOptions.locales['/'], {
54
- ...defaultLocaleData,
54
+ ...exports.DEFAULT_LOCALE_DATA,
55
55
  ...localeOptions.locales['/'],
56
56
  });
57
57
  };
@@ -21,6 +21,10 @@ export interface DefaultThemePluginsOptions {
21
21
  codeGroup?: boolean;
22
22
  codeGroupItem?: boolean;
23
23
  };
24
+ /**
25
+ * Enable @vuepress/plugin-external-link-icon or not
26
+ */
27
+ externalLinkIcon?: boolean;
24
28
  /**
25
29
  * Enable @vuepress/plugin-git or not
26
30
  */
@@ -219,7 +223,7 @@ export interface DefaultThemeLocaleData extends LocaleData {
219
223
  */
220
224
  backToHome?: string;
221
225
  /**
222
- * A11y text for `<OutboundLink>`
226
+ * A11y text for external link icon
223
227
  */
224
228
  openInNewWindow?: string;
225
229
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vuepress/theme-default",
3
- "version": "2.0.0-beta.28",
3
+ "version": "2.0.0-beta.29",
4
4
  "description": "Default theme of VuePress",
5
5
  "keywords": [
6
6
  "vuepress-theme",
@@ -29,17 +29,18 @@
29
29
  "copy": "cpx \"src/**/*.{d.ts,vue,scss}\" lib"
30
30
  },
31
31
  "dependencies": {
32
- "@vuepress/client": "2.0.0-beta.28",
33
- "@vuepress/core": "2.0.0-beta.28",
34
- "@vuepress/plugin-active-header-links": "2.0.0-beta.28",
35
- "@vuepress/plugin-back-to-top": "2.0.0-beta.28",
36
- "@vuepress/plugin-container": "2.0.0-beta.28",
37
- "@vuepress/plugin-git": "2.0.0-beta.28",
38
- "@vuepress/plugin-medium-zoom": "2.0.0-beta.28",
39
- "@vuepress/plugin-nprogress": "2.0.0-beta.28",
40
- "@vuepress/plugin-palette": "2.0.0-beta.28",
41
- "@vuepress/plugin-prismjs": "2.0.0-beta.28",
42
- "@vuepress/plugin-theme-data": "2.0.0-beta.28",
32
+ "@vuepress/client": "2.0.0-beta.29",
33
+ "@vuepress/core": "2.0.0-beta.29",
34
+ "@vuepress/plugin-active-header-links": "2.0.0-beta.29",
35
+ "@vuepress/plugin-back-to-top": "2.0.0-beta.29",
36
+ "@vuepress/plugin-container": "2.0.0-beta.29",
37
+ "@vuepress/plugin-external-link-icon": "2.0.0-beta.29",
38
+ "@vuepress/plugin-git": "2.0.0-beta.29",
39
+ "@vuepress/plugin-medium-zoom": "2.0.0-beta.29",
40
+ "@vuepress/plugin-nprogress": "2.0.0-beta.29",
41
+ "@vuepress/plugin-palette": "2.0.0-beta.29",
42
+ "@vuepress/plugin-prismjs": "2.0.0-beta.29",
43
+ "@vuepress/plugin-theme-data": "2.0.0-beta.29",
43
44
  "@vuepress/shared": "2.0.0-beta.28",
44
45
  "@vuepress/utils": "2.0.0-beta.28",
45
46
  "@vueuse/core": "^7.1.2",
@@ -51,5 +52,5 @@
51
52
  "publishConfig": {
52
53
  "access": "public"
53
54
  },
54
- "gitHead": "71c34816a79263c7dcba3ff0c103e264abdbf0d2"
55
+ "gitHead": "2c6eb4270f96b6351cd1f565798bed1f662a6bb2"
55
56
  }