@vuepress/shared 2.0.0-beta.4 → 2.0.0-beta.40
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/index.cjs +198 -0
- package/dist/index.d.ts +289 -0
- package/dist/index.js +152 -0
- package/package.json +36 -13
- package/CHANGELOG.md +0 -152
- package/lib/esm/index.d.ts +0 -2
- package/lib/esm/index.js +0 -2
- package/lib/esm/types/head.d.ts +0 -27
- package/lib/esm/types/head.js +0 -1
- package/lib/esm/types/index.d.ts +0 -5
- package/lib/esm/types/index.js +0 -5
- package/lib/esm/types/locale.d.ts +0 -13
- package/lib/esm/types/locale.js +0 -1
- package/lib/esm/types/page.d.ts +0 -70
- package/lib/esm/types/page.js +0 -1
- package/lib/esm/types/site.d.ts +0 -42
- package/lib/esm/types/site.js +0 -1
- package/lib/esm/types/ssr.d.ts +0 -8
- package/lib/esm/types/ssr.js +0 -1
- package/lib/esm/utils/dedupeHead.d.ts +0 -7
- package/lib/esm/utils/dedupeHead.js +0 -18
- package/lib/esm/utils/ensureEndingSlash.d.ts +0 -4
- package/lib/esm/utils/ensureEndingSlash.js +0 -4
- package/lib/esm/utils/ensureLeadingSlash.d.ts +0 -4
- package/lib/esm/utils/ensureLeadingSlash.js +0 -4
- package/lib/esm/utils/formatDateString.d.ts +0 -4
- package/lib/esm/utils/formatDateString.js +0 -14
- package/lib/esm/utils/htmlEscape.d.ts +0 -4
- package/lib/esm/utils/htmlEscape.js +0 -12
- package/lib/esm/utils/htmlUnescape.d.ts +0 -4
- package/lib/esm/utils/htmlUnescape.js +0 -17
- package/lib/esm/utils/index.d.ts +0 -18
- package/lib/esm/utils/index.js +0 -18
- package/lib/esm/utils/isLinkExternal.d.ts +0 -4
- package/lib/esm/utils/isLinkExternal.js +0 -15
- package/lib/esm/utils/isLinkHttp.d.ts +0 -8
- package/lib/esm/utils/isLinkHttp.js +0 -8
- package/lib/esm/utils/isLinkMailto.d.ts +0 -4
- package/lib/esm/utils/isLinkMailto.js +0 -4
- package/lib/esm/utils/isLinkTel.d.ts +0 -4
- package/lib/esm/utils/isLinkTel.js +0 -4
- package/lib/esm/utils/isPlainObject.d.ts +0 -4
- package/lib/esm/utils/isPlainObject.js +0 -4
- package/lib/esm/utils/normalizePackageName.d.ts +0 -4
- package/lib/esm/utils/normalizePackageName.js +0 -37
- package/lib/esm/utils/removeEndingSlash.d.ts +0 -4
- package/lib/esm/utils/removeEndingSlash.js +0 -4
- package/lib/esm/utils/removeLeadingSlash.d.ts +0 -4
- package/lib/esm/utils/removeLeadingSlash.js +0 -4
- package/lib/esm/utils/resolveHeadIdentifier.d.ts +0 -5
- package/lib/esm/utils/resolveHeadIdentifier.js +0 -18
- package/lib/esm/utils/resolveLocalePath.d.ts +0 -5
- package/lib/esm/utils/resolveLocalePath.js +0 -18
- package/lib/esm/utils/resolveRoutePathFromUrl.d.ts +0 -1
- package/lib/esm/utils/resolveRoutePathFromUrl.js +0 -5
- package/lib/index.d.ts +0 -2
- package/lib/index.js +0 -14
- package/lib/tsconfig.esm.tsbuildinfo +0 -2410
- package/lib/types/head.d.ts +0 -27
- package/lib/types/head.js +0 -2
- package/lib/types/index.d.ts +0 -5
- package/lib/types/index.js +0 -17
- package/lib/types/locale.d.ts +0 -13
- package/lib/types/locale.js +0 -2
- package/lib/types/page.d.ts +0 -70
- package/lib/types/page.js +0 -2
- package/lib/types/site.d.ts +0 -42
- package/lib/types/site.js +0 -2
- package/lib/types/ssr.d.ts +0 -8
- package/lib/types/ssr.js +0 -2
- package/lib/utils/dedupeHead.d.ts +0 -7
- package/lib/utils/dedupeHead.js +0 -22
- package/lib/utils/ensureEndingSlash.d.ts +0 -4
- package/lib/utils/ensureEndingSlash.js +0 -8
- package/lib/utils/ensureLeadingSlash.d.ts +0 -4
- package/lib/utils/ensureLeadingSlash.js +0 -8
- package/lib/utils/formatDateString.d.ts +0 -4
- package/lib/utils/formatDateString.js +0 -18
- package/lib/utils/htmlEscape.d.ts +0 -4
- package/lib/utils/htmlEscape.js +0 -16
- package/lib/utils/htmlUnescape.d.ts +0 -4
- package/lib/utils/htmlUnescape.js +0 -21
- package/lib/utils/index.d.ts +0 -18
- package/lib/utils/index.js +0 -35
- package/lib/utils/isLinkExternal.d.ts +0 -4
- package/lib/utils/isLinkExternal.js +0 -19
- package/lib/utils/isLinkHttp.d.ts +0 -8
- package/lib/utils/isLinkHttp.js +0 -12
- package/lib/utils/isLinkMailto.d.ts +0 -4
- package/lib/utils/isLinkMailto.js +0 -8
- package/lib/utils/isLinkTel.d.ts +0 -4
- package/lib/utils/isLinkTel.js +0 -8
- package/lib/utils/isPlainObject.d.ts +0 -4
- package/lib/utils/isPlainObject.js +0 -8
- package/lib/utils/normalizePackageName.d.ts +0 -4
- package/lib/utils/normalizePackageName.js +0 -41
- package/lib/utils/removeEndingSlash.d.ts +0 -4
- package/lib/utils/removeEndingSlash.js +0 -8
- package/lib/utils/removeLeadingSlash.d.ts +0 -4
- package/lib/utils/removeLeadingSlash.js +0 -8
- package/lib/utils/resolveHeadIdentifier.d.ts +0 -5
- package/lib/utils/resolveHeadIdentifier.js +0 -22
- package/lib/utils/resolveLocalePath.d.ts +0 -5
- package/lib/utils/resolveLocalePath.js +0 -22
- package/lib/utils/resolveRoutePathFromUrl.d.ts +0 -1
- package/lib/utils/resolveRoutePathFromUrl.js +0 -9
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Resolve identifier of a tag, to avoid duplicated tags in `<head>`
|
|
3
|
-
*/
|
|
4
|
-
export const resolveHeadIdentifier = ([tag, attrs, content,]) => {
|
|
5
|
-
// avoid duplicated `<meta>` with same `name`
|
|
6
|
-
if (tag === 'meta' && attrs.name) {
|
|
7
|
-
return `${tag}.${attrs.name}`;
|
|
8
|
-
}
|
|
9
|
-
// there should be only one `<title>` or `<base>`
|
|
10
|
-
if (['title', 'base'].includes(tag)) {
|
|
11
|
-
return tag;
|
|
12
|
-
}
|
|
13
|
-
// avoid duplicated `<template>` with same `id`
|
|
14
|
-
if (tag === 'template' && attrs.id) {
|
|
15
|
-
return `${tag}.${attrs.id}`;
|
|
16
|
-
}
|
|
17
|
-
return JSON.stringify([tag, attrs, content]);
|
|
18
|
-
};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Resolve the matched locale path of route path
|
|
3
|
-
*/
|
|
4
|
-
export const resolveLocalePath = (locales, routePath) => {
|
|
5
|
-
const localePaths = Object.keys(locales).sort((a, b) => {
|
|
6
|
-
const levelDelta = b.split('/').length - a.split('/').length;
|
|
7
|
-
if (levelDelta !== 0) {
|
|
8
|
-
return levelDelta;
|
|
9
|
-
}
|
|
10
|
-
return b.length - a.length;
|
|
11
|
-
});
|
|
12
|
-
for (const localePath of localePaths) {
|
|
13
|
-
if (routePath.startsWith(localePath)) {
|
|
14
|
-
return localePath;
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
return '/';
|
|
18
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const resolveRoutePathFromUrl: (url: string, base?: string) => string;
|
package/lib/index.d.ts
DELETED
package/lib/index.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
-
}) : (function(o, m, k, k2) {
|
|
6
|
-
if (k2 === undefined) k2 = k;
|
|
7
|
-
o[k2] = m[k];
|
|
8
|
-
}));
|
|
9
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
10
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
|
-
};
|
|
12
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
-
__exportStar(require("./types"), exports);
|
|
14
|
-
__exportStar(require("./utils"), exports);
|