@vuepress/client 2.0.0-rc.12 → 2.0.0-rc.14

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.
package/dist/app.js CHANGED
@@ -12,7 +12,7 @@ import {
12
12
  usePageLang,
13
13
  usePageLayout,
14
14
  withBase
15
- } from "./chunk-ZQJPP2LC.js";
15
+ } from "./chunk-YRXAAVF4.js";
16
16
 
17
17
  // src/app.ts
18
18
  import { clientConfigs } from "@internal/clientConfigs";
@@ -49,10 +49,8 @@ var createVueRouter = () => {
49
49
  }
50
50
  ],
51
51
  scrollBehavior: (to, _from, savedPosition) => {
52
- if (savedPosition)
53
- return savedPosition;
54
- if (to.hash)
55
- return { el: to.hash };
52
+ if (savedPosition) return savedPosition;
53
+ if (to.hash) return { el: to.hash };
56
54
  return { top: 0 };
57
55
  }
58
56
  });
@@ -294,7 +292,7 @@ var createVueApp = async () => {
294
292
  setupGlobalComponents(app);
295
293
  const globalComputed = setupGlobalComputed(app, router, clientConfigs);
296
294
  if (__VUEPRESS_DEV__ || __VUE_PROD_DEVTOOLS__) {
297
- const { setupDevtools } = await import("./setupDevtools-H6KAGBNI.js");
295
+ const { setupDevtools } = await import("./setupDevtools-HHDGOOYC.js");
298
296
  setupDevtools(app, globalComputed);
299
297
  }
300
298
  for (const clientConfig of clientConfigs) {
@@ -62,8 +62,7 @@ if (__VUEPRESS_DEV__ && (import.meta.webpackHot || import.meta.hot)) {
62
62
  // src/router/resolveRoutePath.ts
63
63
  var resolveRoutePath = (pathname, currentPath) => {
64
64
  const normalizedRoutePath = normalizeRoutePath(pathname, currentPath);
65
- if (routes.value[normalizedRoutePath])
66
- return normalizedRoutePath;
65
+ if (routes.value[normalizedRoutePath]) return normalizedRoutePath;
67
66
  const encodedRoutePath = encodeURI(normalizedRoutePath);
68
67
  if (routes.value[encodedRoutePath]) {
69
68
  return encodedRoutePath;
@@ -109,16 +108,12 @@ import { useRoute, useRouter } from "vue-router";
109
108
  import { computed, defineComponent, h } from "vue";
110
109
  import { useRoute as useRoute2, useRouter as useRouter2 } from "vue-router";
111
110
  var guardEvent = (event) => {
112
- if (event.metaKey || event.altKey || event.ctrlKey || event.shiftKey)
113
- return;
114
- if (event.defaultPrevented)
115
- return;
116
- if (event.button !== void 0 && event.button !== 0)
117
- return;
111
+ if (event.metaKey || event.altKey || event.ctrlKey || event.shiftKey) return;
112
+ if (event.defaultPrevented) return;
113
+ if (event.button !== void 0 && event.button !== 0) return;
118
114
  if (event.currentTarget) {
119
115
  const target = event.currentTarget.getAttribute("target");
120
- if (target?.match(/\b_blank\b/i))
121
- return;
116
+ if (target?.match(/\b_blank\b/i)) return;
122
117
  }
123
118
  event.preventDefault();
124
119
  return true;
@@ -202,8 +197,7 @@ var AutoLink = defineComponent2({
202
197
  () => config.value.ariaLabel ?? config.value.text
203
198
  );
204
199
  const shouldBeActiveInSubpath = computed2(() => {
205
- if (config.value.exact)
206
- return false;
200
+ if (config.value.exact) return false;
207
201
  const localePaths = Object.keys(siteData.value.locales);
208
202
  return localePaths.length ? (
209
203
  // Check all the locales
@@ -214,8 +208,7 @@ var AutoLink = defineComponent2({
214
208
  );
215
209
  });
216
210
  const isActive = computed2(() => {
217
- if (!isInternal.value)
218
- return false;
211
+ if (!isInternal.value) return false;
219
212
  if (config.value.activeMatch) {
220
213
  return (config.value.activeMatch instanceof RegExp ? config.value.activeMatch : new RegExp(config.value.activeMatch, "u")).test(route.path);
221
214
  }
@@ -283,8 +276,7 @@ var Content = defineComponent4({
283
276
  setup(props) {
284
277
  const pageComponent = usePageComponent();
285
278
  const ContentComponent = computed3(() => {
286
- if (!props.path)
287
- return pageComponent.value;
279
+ if (!props.path) return pageComponent.value;
288
280
  const route = resolveRoute(props.path);
289
281
  return defineAsyncComponent(() => route.loader().then(({ comp }) => comp));
290
282
  });
@@ -376,8 +368,7 @@ var defineClientConfig = (clientConfig = {}) => clientConfig;
376
368
  // src/utils/withBase.ts
377
369
  import { isLinkHttp, removeLeadingSlash } from "@vuepress/shared";
378
370
  var withBase = (url) => {
379
- if (isLinkHttp(url))
380
- return url;
371
+ if (isLinkHttp(url)) return url;
381
372
  return `${__VUEPRESS_BASE__}${removeLeadingSlash(url)}`;
382
373
  };
383
374
 
package/dist/index.js CHANGED
@@ -28,7 +28,7 @@ import {
28
28
  useSiteLocaleData,
29
29
  useUpdateHead,
30
30
  withBase
31
- } from "./chunk-ZQJPP2LC.js";
31
+ } from "./chunk-YRXAAVF4.js";
32
32
  export {
33
33
  AutoLink,
34
34
  ClientOnly,
@@ -40,8 +40,7 @@ var setupDevtools = (app, clientData) => {
40
40
  icon: "article"
41
41
  });
42
42
  api.on.getInspectorTree((payload) => {
43
- if (payload.inspectorId !== INSPECTOR_ID)
44
- return;
43
+ if (payload.inspectorId !== INSPECTOR_ID) return;
45
44
  payload.rootNodes = [
46
45
  {
47
46
  id: INSPECTOR_CLIENT_DATA_ID,
@@ -54,8 +53,7 @@ var setupDevtools = (app, clientData) => {
54
53
  ];
55
54
  });
56
55
  api.on.getInspectorState((payload) => {
57
- if (payload.inspectorId !== INSPECTOR_ID)
58
- return;
56
+ if (payload.inspectorId !== INSPECTOR_ID) return;
59
57
  if (payload.nodeId === INSPECTOR_CLIENT_DATA_ID) {
60
58
  payload.state = {
61
59
  [INSPECTOR_CLIENT_DATA_LABEL]: clientDataEntries.map(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vuepress/client",
3
- "version": "2.0.0-rc.12",
3
+ "version": "2.0.0-rc.14",
4
4
  "description": "Client package of VuePress",
5
5
  "keywords": [
6
6
  "vuepress",
@@ -33,10 +33,10 @@
33
33
  "types.d.ts"
34
34
  ],
35
35
  "dependencies": {
36
- "@vue/devtools-api": "^6.6.1",
37
- "vue": "^3.4.27",
38
- "vue-router": "^4.3.2",
39
- "@vuepress/shared": "2.0.0-rc.12"
36
+ "@vue/devtools-api": "^6.6.3",
37
+ "vue": "^3.4.29",
38
+ "vue-router": "^4.3.3",
39
+ "@vuepress/shared": "2.0.0-rc.14"
40
40
  },
41
41
  "publishConfig": {
42
42
  "access": "public"