@vuepress/shared 2.0.0-beta.4 → 2.0.0-beta.42

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.
Files changed (106) hide show
  1. package/dist/index.cjs +198 -0
  2. package/dist/index.d.ts +289 -0
  3. package/dist/index.js +152 -0
  4. package/package.json +37 -13
  5. package/CHANGELOG.md +0 -152
  6. package/lib/esm/index.d.ts +0 -2
  7. package/lib/esm/index.js +0 -2
  8. package/lib/esm/types/head.d.ts +0 -27
  9. package/lib/esm/types/head.js +0 -1
  10. package/lib/esm/types/index.d.ts +0 -5
  11. package/lib/esm/types/index.js +0 -5
  12. package/lib/esm/types/locale.d.ts +0 -13
  13. package/lib/esm/types/locale.js +0 -1
  14. package/lib/esm/types/page.d.ts +0 -70
  15. package/lib/esm/types/page.js +0 -1
  16. package/lib/esm/types/site.d.ts +0 -42
  17. package/lib/esm/types/site.js +0 -1
  18. package/lib/esm/types/ssr.d.ts +0 -8
  19. package/lib/esm/types/ssr.js +0 -1
  20. package/lib/esm/utils/dedupeHead.d.ts +0 -7
  21. package/lib/esm/utils/dedupeHead.js +0 -18
  22. package/lib/esm/utils/ensureEndingSlash.d.ts +0 -4
  23. package/lib/esm/utils/ensureEndingSlash.js +0 -4
  24. package/lib/esm/utils/ensureLeadingSlash.d.ts +0 -4
  25. package/lib/esm/utils/ensureLeadingSlash.js +0 -4
  26. package/lib/esm/utils/formatDateString.d.ts +0 -4
  27. package/lib/esm/utils/formatDateString.js +0 -14
  28. package/lib/esm/utils/htmlEscape.d.ts +0 -4
  29. package/lib/esm/utils/htmlEscape.js +0 -12
  30. package/lib/esm/utils/htmlUnescape.d.ts +0 -4
  31. package/lib/esm/utils/htmlUnescape.js +0 -17
  32. package/lib/esm/utils/index.d.ts +0 -18
  33. package/lib/esm/utils/index.js +0 -18
  34. package/lib/esm/utils/isLinkExternal.d.ts +0 -4
  35. package/lib/esm/utils/isLinkExternal.js +0 -15
  36. package/lib/esm/utils/isLinkHttp.d.ts +0 -8
  37. package/lib/esm/utils/isLinkHttp.js +0 -8
  38. package/lib/esm/utils/isLinkMailto.d.ts +0 -4
  39. package/lib/esm/utils/isLinkMailto.js +0 -4
  40. package/lib/esm/utils/isLinkTel.d.ts +0 -4
  41. package/lib/esm/utils/isLinkTel.js +0 -4
  42. package/lib/esm/utils/isPlainObject.d.ts +0 -4
  43. package/lib/esm/utils/isPlainObject.js +0 -4
  44. package/lib/esm/utils/normalizePackageName.d.ts +0 -4
  45. package/lib/esm/utils/normalizePackageName.js +0 -37
  46. package/lib/esm/utils/removeEndingSlash.d.ts +0 -4
  47. package/lib/esm/utils/removeEndingSlash.js +0 -4
  48. package/lib/esm/utils/removeLeadingSlash.d.ts +0 -4
  49. package/lib/esm/utils/removeLeadingSlash.js +0 -4
  50. package/lib/esm/utils/resolveHeadIdentifier.d.ts +0 -5
  51. package/lib/esm/utils/resolveHeadIdentifier.js +0 -18
  52. package/lib/esm/utils/resolveLocalePath.d.ts +0 -5
  53. package/lib/esm/utils/resolveLocalePath.js +0 -18
  54. package/lib/esm/utils/resolveRoutePathFromUrl.d.ts +0 -1
  55. package/lib/esm/utils/resolveRoutePathFromUrl.js +0 -5
  56. package/lib/index.d.ts +0 -2
  57. package/lib/index.js +0 -14
  58. package/lib/tsconfig.esm.tsbuildinfo +0 -2410
  59. package/lib/types/head.d.ts +0 -27
  60. package/lib/types/head.js +0 -2
  61. package/lib/types/index.d.ts +0 -5
  62. package/lib/types/index.js +0 -17
  63. package/lib/types/locale.d.ts +0 -13
  64. package/lib/types/locale.js +0 -2
  65. package/lib/types/page.d.ts +0 -70
  66. package/lib/types/page.js +0 -2
  67. package/lib/types/site.d.ts +0 -42
  68. package/lib/types/site.js +0 -2
  69. package/lib/types/ssr.d.ts +0 -8
  70. package/lib/types/ssr.js +0 -2
  71. package/lib/utils/dedupeHead.d.ts +0 -7
  72. package/lib/utils/dedupeHead.js +0 -22
  73. package/lib/utils/ensureEndingSlash.d.ts +0 -4
  74. package/lib/utils/ensureEndingSlash.js +0 -8
  75. package/lib/utils/ensureLeadingSlash.d.ts +0 -4
  76. package/lib/utils/ensureLeadingSlash.js +0 -8
  77. package/lib/utils/formatDateString.d.ts +0 -4
  78. package/lib/utils/formatDateString.js +0 -18
  79. package/lib/utils/htmlEscape.d.ts +0 -4
  80. package/lib/utils/htmlEscape.js +0 -16
  81. package/lib/utils/htmlUnescape.d.ts +0 -4
  82. package/lib/utils/htmlUnescape.js +0 -21
  83. package/lib/utils/index.d.ts +0 -18
  84. package/lib/utils/index.js +0 -35
  85. package/lib/utils/isLinkExternal.d.ts +0 -4
  86. package/lib/utils/isLinkExternal.js +0 -19
  87. package/lib/utils/isLinkHttp.d.ts +0 -8
  88. package/lib/utils/isLinkHttp.js +0 -12
  89. package/lib/utils/isLinkMailto.d.ts +0 -4
  90. package/lib/utils/isLinkMailto.js +0 -8
  91. package/lib/utils/isLinkTel.d.ts +0 -4
  92. package/lib/utils/isLinkTel.js +0 -8
  93. package/lib/utils/isPlainObject.d.ts +0 -4
  94. package/lib/utils/isPlainObject.js +0 -8
  95. package/lib/utils/normalizePackageName.d.ts +0 -4
  96. package/lib/utils/normalizePackageName.js +0 -41
  97. package/lib/utils/removeEndingSlash.d.ts +0 -4
  98. package/lib/utils/removeEndingSlash.js +0 -8
  99. package/lib/utils/removeLeadingSlash.d.ts +0 -4
  100. package/lib/utils/removeLeadingSlash.js +0 -8
  101. package/lib/utils/resolveHeadIdentifier.d.ts +0 -5
  102. package/lib/utils/resolveHeadIdentifier.js +0 -22
  103. package/lib/utils/resolveLocalePath.d.ts +0 -5
  104. package/lib/utils/resolveLocalePath.js +0 -22
  105. package/lib/utils/resolveRoutePathFromUrl.d.ts +0 -1
  106. package/lib/utils/resolveRoutePathFromUrl.js +0 -9
@@ -1,5 +0,0 @@
1
- import type { HeadConfig } from '../types';
2
- /**
3
- * Resolve identifier of a tag, to avoid duplicated tags in `<head>`
4
- */
5
- export declare const resolveHeadIdentifier: ([tag, attrs, content,]: HeadConfig) => string;
@@ -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,5 +0,0 @@
1
- import type { LocaleConfig } from '../types';
2
- /**
3
- * Resolve the matched locale path of route path
4
- */
5
- export declare const resolveLocalePath: (locales: LocaleConfig, routePath: string) => string;
@@ -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;
@@ -1,5 +0,0 @@
1
- export const resolveRoutePathFromUrl = (url, base = '/') => url
2
- // remove url origin
3
- .replace(/^(https?:)?\/\/[^/]*/, '')
4
- // remove site base
5
- .replace(new RegExp(`^${base}`), '/');
package/lib/index.d.ts DELETED
@@ -1,2 +0,0 @@
1
- export * from './types';
2
- export * from './utils';
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);