vitepress 0.22.2 → 1.0.0-draft.1

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 (134) hide show
  1. package/README.md +4 -4
  2. package/client.d.ts +2 -3
  3. package/dist/client/app/components/ClientOnly.js +1 -1
  4. package/dist/client/app/index.js +5 -7
  5. package/dist/client/app/router.js +11 -5
  6. package/dist/client/theme-default/Layout.vue +25 -183
  7. package/dist/client/theme-default/NotFound.vue +9 -8
  8. package/dist/client/theme-default/components/VPAlgoliaSearchBox.vue +127 -0
  9. package/dist/client/theme-default/components/VPBackdrop.vue +39 -0
  10. package/dist/client/theme-default/components/VPContent.vue +44 -0
  11. package/dist/client/theme-default/components/VPContentDoc.vue +173 -0
  12. package/dist/client/theme-default/components/VPContentDocFooter.vue +140 -0
  13. package/dist/client/theme-default/components/VPContentDocOutline.vue +108 -0
  14. package/dist/client/theme-default/components/VPFlyout.vue +149 -0
  15. package/dist/client/theme-default/components/VPLink.vue +37 -0
  16. package/dist/client/theme-default/components/VPLocalNav.vue +106 -0
  17. package/dist/client/theme-default/components/VPMenu.vue +79 -0
  18. package/dist/client/theme-default/components/VPMenuGroup.vue +35 -0
  19. package/dist/client/theme-default/components/VPMenuLink.vue +30 -0
  20. package/dist/client/theme-default/components/VPNav.vue +33 -0
  21. package/dist/client/theme-default/components/VPNavBar.vue +109 -0
  22. package/dist/client/theme-default/components/VPNavBarAppearance.vue +22 -0
  23. package/dist/client/theme-default/components/VPNavBarExtra.vue +107 -0
  24. package/dist/client/theme-default/components/VPNavBarHamburger.vue +79 -0
  25. package/dist/client/theme-default/components/VPNavBarMenu.vue +29 -0
  26. package/dist/client/theme-default/components/VPNavBarMenuGroup.vue +18 -0
  27. package/dist/client/theme-default/components/VPNavBarMenuLink.vue +56 -0
  28. package/dist/client/theme-default/components/VPNavBarSearch.vue +269 -0
  29. package/dist/client/theme-default/components/VPNavBarSocialLinks.vue +27 -0
  30. package/dist/client/theme-default/components/VPNavBarTitle.vue +44 -0
  31. package/dist/client/theme-default/components/VPNavBarTranslations.vue +74 -0
  32. package/dist/client/theme-default/components/VPNavScreen.vue +100 -0
  33. package/dist/client/theme-default/components/VPNavScreenAppearance.vue +30 -0
  34. package/dist/client/theme-default/components/VPNavScreenMenu.vue +24 -0
  35. package/dist/client/theme-default/components/VPNavScreenMenuGroup.vue +118 -0
  36. package/dist/client/theme-default/components/VPNavScreenMenuGroupLink.vue +33 -0
  37. package/dist/client/theme-default/components/VPNavScreenMenuGroupSection.vue +35 -0
  38. package/dist/client/theme-default/components/VPNavScreenMenuLink.vue +34 -0
  39. package/dist/client/theme-default/components/VPNavScreenSocialLinks.vue +14 -0
  40. package/dist/client/theme-default/components/VPNavScreenTranslations.vue +73 -0
  41. package/dist/client/theme-default/components/VPSidebar.vue +118 -0
  42. package/dist/client/theme-default/components/VPSidebarGroup.vue +44 -0
  43. package/dist/client/theme-default/components/VPSidebarLink.vue +57 -0
  44. package/dist/client/theme-default/components/VPSkipLink.vue +72 -0
  45. package/dist/client/theme-default/components/VPSocialLink.vue +63 -0
  46. package/dist/client/theme-default/components/VPSocialLinks.vue +27 -0
  47. package/dist/client/theme-default/components/VPSwitch.vue +66 -0
  48. package/dist/client/theme-default/components/VPSwitchAppearance.vue +74 -0
  49. package/dist/client/theme-default/components/icons/VPIconAlignJustify.vue +8 -0
  50. package/dist/client/theme-default/components/icons/VPIconAlignLeft.vue +8 -0
  51. package/dist/client/theme-default/components/icons/VPIconAlignRight.vue +8 -0
  52. package/dist/client/theme-default/components/icons/{ArrowLeft.vue → VPIconArrowLeft.vue} +0 -0
  53. package/dist/client/theme-default/components/icons/{ArrowRight.vue → VPIconArrowRight.vue} +0 -0
  54. package/dist/client/theme-default/components/icons/VPIconChevronDown.vue +5 -0
  55. package/dist/client/theme-default/components/icons/VPIconChevronLeft.vue +5 -0
  56. package/dist/client/theme-default/components/icons/VPIconChevronRight.vue +5 -0
  57. package/dist/client/theme-default/components/icons/VPIconChevronUp.vue +5 -0
  58. package/dist/client/theme-default/components/icons/VPIconDiscord.vue +5 -0
  59. package/dist/client/theme-default/components/icons/VPIconEdit.vue +6 -0
  60. package/dist/client/theme-default/components/icons/VPIconExternalLink.vue +13 -0
  61. package/dist/client/theme-default/components/icons/VPIconFacebook.vue +5 -0
  62. package/dist/client/theme-default/components/icons/VPIconGitHub.vue +5 -0
  63. package/dist/client/theme-default/components/icons/VPIconInstagram.vue +5 -0
  64. package/dist/client/theme-default/components/icons/VPIconLanguages.vue +9 -0
  65. package/dist/client/theme-default/components/icons/VPIconLinkedIn.vue +5 -0
  66. package/dist/client/theme-default/components/icons/VPIconMoon.vue +5 -0
  67. package/dist/client/theme-default/components/icons/VPIconMoreHorizontal.vue +7 -0
  68. package/dist/client/theme-default/components/icons/VPIconPlus.vue +5 -0
  69. package/dist/client/theme-default/components/icons/VPIconSlack.vue +5 -0
  70. package/dist/client/theme-default/components/icons/VPIconSun.vue +13 -0
  71. package/dist/client/theme-default/components/icons/VPIconTwitter.vue +5 -0
  72. package/dist/client/theme-default/components/icons/VPIconYouTube.vue +5 -0
  73. package/dist/client/theme-default/composables/edit-link.js +22 -0
  74. package/dist/client/theme-default/composables/flyout.js +40 -0
  75. package/dist/client/theme-default/composables/nav.js +27 -1
  76. package/dist/client/theme-default/composables/outline.js +130 -0
  77. package/dist/client/theme-default/composables/prev-next.js +18 -0
  78. package/dist/client/theme-default/composables/sidebar.js +57 -0
  79. package/dist/client/theme-default/fonts/inter-cyrillic-ext.woff2 +0 -0
  80. package/dist/client/theme-default/fonts/inter-cyrillic.woff2 +0 -0
  81. package/dist/client/theme-default/fonts/inter-greek-ext.woff2 +0 -0
  82. package/dist/client/theme-default/fonts/inter-greek.woff2 +0 -0
  83. package/dist/client/theme-default/fonts/inter-latin-ext.woff2 +0 -0
  84. package/dist/client/theme-default/fonts/inter-latin.woff2 +0 -0
  85. package/dist/client/theme-default/fonts/inter-vietnamese.woff2 +0 -0
  86. package/dist/client/theme-default/index.js +4 -4
  87. package/dist/client/theme-default/styles/base.css +200 -0
  88. package/dist/client/theme-default/styles/fonts.css +67 -0
  89. package/dist/client/theme-default/styles/utils.css +9 -0
  90. package/dist/client/theme-default/styles/vars.css +206 -66
  91. package/dist/client/theme-default/styles/vp-doc.css +419 -0
  92. package/dist/client/theme-default/support/sidebar.js +29 -0
  93. package/dist/client/theme-default/support/utils.js +43 -0
  94. package/dist/node/cli.js +1 -1
  95. package/dist/node/index.d.ts +106 -81
  96. package/dist/node/index.js +1 -1
  97. package/dist/node/{serve-cf4b2162.js → serve-428d4610.js} +27 -10
  98. package/package.json +31 -27
  99. package/types/default-theme.d.ts +105 -80
  100. package/dist/client/theme-default/components/AlgoliaSearchBox.vue +0 -195
  101. package/dist/client/theme-default/components/BuySellAds.vue +0 -152
  102. package/dist/client/theme-default/components/CarbonAds.vue +0 -99
  103. package/dist/client/theme-default/components/EditLink.vue +0 -38
  104. package/dist/client/theme-default/components/Home.vue +0 -31
  105. package/dist/client/theme-default/components/HomeFeatures.vue +0 -143
  106. package/dist/client/theme-default/components/HomeFooter.vue +0 -50
  107. package/dist/client/theme-default/components/HomeHero.vue +0 -161
  108. package/dist/client/theme-default/components/LastUpdated.vue +0 -60
  109. package/dist/client/theme-default/components/NavBar.vue +0 -60
  110. package/dist/client/theme-default/components/NavBarTitle.vue +0 -41
  111. package/dist/client/theme-default/components/NavDropdownLink.vue +0 -135
  112. package/dist/client/theme-default/components/NavDropdownLinkItem.vue +0 -76
  113. package/dist/client/theme-default/components/NavLink.vue +0 -61
  114. package/dist/client/theme-default/components/NavLinks.vue +0 -52
  115. package/dist/client/theme-default/components/NextAndPrevLinks.vue +0 -88
  116. package/dist/client/theme-default/components/Page.vue +0 -53
  117. package/dist/client/theme-default/components/PageFooter.vue +0 -44
  118. package/dist/client/theme-default/components/SideBar.vue +0 -60
  119. package/dist/client/theme-default/components/SideBarLink.js +0 -68
  120. package/dist/client/theme-default/components/SideBarLinks.vue +0 -12
  121. package/dist/client/theme-default/components/ToggleSideBarButton.vue +0 -46
  122. package/dist/client/theme-default/components/icons/OutboundLink.vue +0 -31
  123. package/dist/client/theme-default/composables/activeSidebarLink.js +0 -99
  124. package/dist/client/theme-default/composables/editLink.js +0 -49
  125. package/dist/client/theme-default/composables/navLink.js +0 -42
  126. package/dist/client/theme-default/composables/nextAndPrevLinks.js +0 -37
  127. package/dist/client/theme-default/composables/repo.js +0 -38
  128. package/dist/client/theme-default/composables/sideBar.js +0 -57
  129. package/dist/client/theme-default/styles/code.css +0 -299
  130. package/dist/client/theme-default/styles/custom-blocks.css +0 -76
  131. package/dist/client/theme-default/styles/layout.css +0 -236
  132. package/dist/client/theme-default/styles/sidebar-links.css +0 -107
  133. package/dist/client/theme-default/support/sideBar.js +0 -46
  134. package/dist/client/theme-default/utils.js +0 -63
@@ -1,236 +0,0 @@
1
- *,
2
- ::before,
3
- ::after {
4
- box-sizing: border-box;
5
- }
6
-
7
- html {
8
- line-height: 1.4;
9
- font-size: 16px;
10
- -webkit-text-size-adjust: 100%;
11
- }
12
-
13
- body {
14
- margin: 0;
15
- width: 100%;
16
- min-width: 320px;
17
- min-height: 100vh;
18
- line-height: 1.4;
19
- font-family: var(--font-family-base);
20
- font-size: 16px;
21
- font-weight: 400;
22
- color: var(--c-text);
23
- background-color: var(--c-bg);
24
- direction: ltr;
25
- font-synthesis: none;
26
- text-rendering: optimizeLegibility;
27
- -webkit-font-smoothing: antialiased;
28
- -moz-osx-font-smoothing: grayscale;
29
- }
30
-
31
- main {
32
- display: block;
33
- }
34
-
35
- h1,
36
- h2,
37
- h3,
38
- h4,
39
- h5,
40
- h6 {
41
- margin: 0;
42
- line-height: 1.25;
43
- }
44
-
45
- h1,
46
- h2,
47
- h3,
48
- h4,
49
- h5,
50
- h6,
51
- strong,
52
- b {
53
- font-weight: 600;
54
- }
55
-
56
- h1:hover .header-anchor,
57
- h1:focus .header-anchor,
58
- h2:hover .header-anchor,
59
- h2:focus .header-anchor,
60
- h3:hover .header-anchor,
61
- h3:focus .header-anchor,
62
- h4:hover .header-anchor,
63
- h4:focus .header-anchor,
64
- h5:hover .header-anchor,
65
- h5:focus .header-anchor,
66
- h6:hover .header-anchor,
67
- h6:focus .header-anchor {
68
- opacity: 1;
69
- }
70
-
71
- h1 {
72
- margin-top: 1.5rem;
73
- font-size: 1.9rem;
74
- }
75
-
76
- @media screen and (min-width: 420px) {
77
- h1 {
78
- font-size: 2.2rem;
79
- }
80
- }
81
-
82
- h2 {
83
- margin-top: 2.25rem;
84
- margin-bottom: 1.25rem;
85
- border-bottom: 1px solid var(--c-divider);
86
- padding-bottom: 0.3rem;
87
- line-height: 1.25;
88
- font-size: 1.65rem;
89
- /* overflow-x: auto; */
90
- }
91
-
92
- h2 + h3 {
93
- margin-top: 1.5rem;
94
- }
95
-
96
- h3 {
97
- margin-top: 2rem;
98
- font-size: 1.35rem;
99
- }
100
-
101
- h4 {
102
- font-size: 1.15rem;
103
- }
104
-
105
- p,
106
- ol,
107
- ul {
108
- margin: 1rem 0;
109
- line-height: 1.7;
110
- }
111
-
112
- a,
113
- area,
114
- button,
115
- [role='button'],
116
- input,
117
- label,
118
- select,
119
- summary,
120
- textarea {
121
- touch-action: manipulation;
122
- }
123
-
124
- a {
125
- text-decoration: none;
126
- color: var(--c-brand);
127
- }
128
-
129
- a:hover {
130
- text-decoration: underline;
131
- }
132
-
133
- a.header-anchor {
134
- float: left;
135
- margin-top: 0.125em;
136
- margin-left: -0.87em;
137
- padding-right: 0.23em;
138
- font-size: 0.85em;
139
- opacity: 0;
140
- }
141
-
142
- a.header-anchor:hover,
143
- a.header-anchor:focus {
144
- text-decoration: none;
145
- }
146
-
147
- figure {
148
- margin: 0;
149
- }
150
-
151
- img {
152
- max-width: 100%;
153
- }
154
-
155
- ul,
156
- ol {
157
- padding-left: 1.25em;
158
- }
159
-
160
- li > ul,
161
- li > ol {
162
- margin: 0;
163
- }
164
-
165
- table {
166
- display: block;
167
- border-collapse: collapse;
168
- margin: 1rem 0;
169
- overflow-x: auto;
170
- }
171
-
172
- tr {
173
- border-top: 1px solid #dfe2e5;
174
- }
175
-
176
- tr:nth-child(2n) {
177
- background-color: #f6f8fa;
178
- }
179
-
180
- th,
181
- td {
182
- border: 1px solid #dfe2e5;
183
- padding: 0.6em 1em;
184
- }
185
-
186
- blockquote {
187
- margin: 1rem 0;
188
- border-left: 0.2rem solid #dfe2e5;
189
- padding: 0.25rem 0 0.25rem 1rem;
190
- font-size: 1rem;
191
- color: #999;
192
- }
193
-
194
- blockquote > p {
195
- margin: 0;
196
- }
197
-
198
- form {
199
- margin: 0;
200
- }
201
-
202
- .theme.sidebar-open .sidebar-mask {
203
- display: block;
204
- }
205
-
206
- .theme.no-navbar > h1,
207
- .theme.no-navbar > h2,
208
- .theme.no-navbar > h3,
209
- .theme.no-navbar > h4,
210
- .theme.no-navbar > h5,
211
- .theme.no-navbar > h6 {
212
- margin-top: 1.5rem;
213
- padding-top: 0;
214
- }
215
-
216
- .theme.no-navbar aside {
217
- top: 0;
218
- }
219
-
220
- @media screen and (min-width: 720px) {
221
- .theme.no-sidebar aside {
222
- display: none;
223
- }
224
-
225
- .theme.no-sidebar main {
226
- margin-left: 0;
227
- }
228
- }
229
-
230
- .sidebar-mask {
231
- position: fixed;
232
- z-index: 2;
233
- display: none;
234
- width: 100vw;
235
- height: 100vh;
236
- }
@@ -1,107 +0,0 @@
1
- .sidebar-links {
2
- margin: 0;
3
- padding: 0;
4
- list-style: none;
5
- }
6
-
7
- .sidebar-link-item {
8
- display: block;
9
- margin: 0;
10
- border-left: 0.25rem solid transparent;
11
- color: var(--c-text);
12
- }
13
-
14
- a.sidebar-link-item:hover {
15
- text-decoration: none;
16
- color: var(--c-brand);
17
- }
18
-
19
- a.sidebar-link-item.active {
20
- color: var(--c-brand);
21
- }
22
-
23
- .sidebar > .sidebar-links {
24
- padding: 0.75rem 0 5rem;
25
- }
26
-
27
- @media (min-width: 720px) {
28
- .sidebar > .sidebar-links {
29
- padding: 1.5rem 0;
30
- }
31
- }
32
-
33
- .sidebar > .sidebar-links > .sidebar-link + .sidebar-link {
34
- padding-top: 0.5rem;
35
- }
36
-
37
- @media (min-width: 720px) {
38
- .sidebar > .sidebar-links > .sidebar-link + .sidebar-link {
39
- padding-top: 1.25rem;
40
- }
41
- }
42
-
43
- .sidebar > .sidebar-links > .sidebar-link > .sidebar-link-item {
44
- padding: 0.35rem 1.5rem 0.35rem 1.25rem;
45
- font-size: 1.1rem;
46
- font-weight: 700;
47
- }
48
-
49
- .sidebar > .sidebar-links > .sidebar-link > a.sidebar-link-item.active {
50
- border-left-color: var(--c-brand);
51
- font-weight: 600;
52
- }
53
-
54
- .sidebar
55
- > .sidebar-links
56
- > .sidebar-link
57
- > .sidebar-links
58
- > .sidebar-link
59
- > .sidebar-link-item {
60
- display: block;
61
- padding: 0.35rem 1.5rem 0.35rem 2rem;
62
- line-height: 1.4;
63
- font-size: 1rem;
64
- font-weight: 400;
65
- }
66
-
67
- .sidebar
68
- > .sidebar-links
69
- > .sidebar-link
70
- > .sidebar-links
71
- > .sidebar-link
72
- > a.sidebar-link-item.active {
73
- border-left-color: var(--c-brand);
74
- font-weight: 600;
75
- }
76
-
77
- .sidebar
78
- > .sidebar-links
79
- > .sidebar-link
80
- > .sidebar-links
81
- > .sidebar-link
82
- > .sidebar-links
83
- > .sidebar-link
84
- > .sidebar-link-item {
85
- display: block;
86
- padding: 0.3rem 1.5rem 0.3rem 3rem;
87
- line-height: 1.4;
88
- font-size: 0.9rem;
89
- font-weight: 400;
90
- }
91
-
92
- .sidebar
93
- > .sidebar-links
94
- > .sidebar-link
95
- > .sidebar-links
96
- > .sidebar-link
97
- > .sidebar-links
98
- > .sidebar-link
99
- > .sidebar-links
100
- > .sidebar-link
101
- > .sidebar-link-item {
102
- display: block;
103
- padding: 0.3rem 1.5rem 0.3rem 4rem;
104
- line-height: 1.4;
105
- font-size: 0.9rem;
106
- font-weight: 400;
107
- }
@@ -1,46 +0,0 @@
1
- import { isArray, ensureStartingSlash, removeExtention } from '../utils';
2
- export function isSideBarConfig(sidebar) {
3
- return sidebar === false || sidebar === 'auto' || isArray(sidebar);
4
- }
5
- export function isSideBarGroup(item) {
6
- return item.children !== undefined;
7
- }
8
- export function isSideBarEmpty(sidebar) {
9
- return isArray(sidebar) ? sidebar.length === 0 : !sidebar;
10
- }
11
- /**
12
- * Get the `SideBarConfig` from sidebar option. This method will ensure to get
13
- * correct sidebar config from `MultiSideBarConfig` with various path
14
- * combinations such as matching `guide/` and `/guide/`. If no matching config
15
- * was found, it will return `auto` as a fallback.
16
- */
17
- export function getSideBarConfig(sidebar, path) {
18
- if (isSideBarConfig(sidebar)) {
19
- return sidebar;
20
- }
21
- path = ensureStartingSlash(path);
22
- for (const dir in sidebar) {
23
- // make sure the multi sidebar key starts with slash too
24
- if (path.startsWith(ensureStartingSlash(dir))) {
25
- return sidebar[dir];
26
- }
27
- }
28
- return 'auto';
29
- }
30
- /**
31
- * Get flat sidebar links from the sidebar items. This method is useful for
32
- * creating the "next and prev link" feature. It will ignore any items that
33
- * don't have `link` property and removes `.md` or `.html` extension if a
34
- * link contains it.
35
- */
36
- export function getFlatSideBarLinks(sidebar) {
37
- return sidebar.reduce((links, item) => {
38
- if (item.link) {
39
- links.push({ text: item.text, link: removeExtention(item.link) });
40
- }
41
- if (isSideBarGroup(item)) {
42
- links = [...links, ...getFlatSideBarLinks(item.children)];
43
- }
44
- return links;
45
- }, []);
46
- }
@@ -1,63 +0,0 @@
1
- export const hashRE = /#.*$/;
2
- export const extRE = /(index)?\.(md|html)$/;
3
- export const endingSlashRE = /\/$/;
4
- export const outboundRE = /^[a-z]+:/i;
5
- export function isNullish(value) {
6
- return value === null || value === undefined;
7
- }
8
- export function isArray(value) {
9
- return Array.isArray(value);
10
- }
11
- export function isExternal(path) {
12
- return outboundRE.test(path);
13
- }
14
- export function isActive(route, path) {
15
- if (path === undefined) {
16
- return false;
17
- }
18
- const routePath = normalize(`/${route.data.relativePath}`);
19
- const pagePath = normalize(path);
20
- return routePath === pagePath;
21
- }
22
- export function normalize(path) {
23
- return decodeURI(path).replace(hashRE, '').replace(extRE, '');
24
- }
25
- export function joinUrl(base, path) {
26
- const baseEndsWithSlash = base.endsWith('/');
27
- const pathStartsWithSlash = path.startsWith('/');
28
- if (baseEndsWithSlash && pathStartsWithSlash) {
29
- return base.slice(0, -1) + path;
30
- }
31
- if (!baseEndsWithSlash && !pathStartsWithSlash) {
32
- return `${base}/${path}`;
33
- }
34
- return base + path;
35
- }
36
- /**
37
- * get the path without filename (the last segment). for example, if the given
38
- * path is `/guide/getting-started.html`, this method will return `/guide/`.
39
- * Always with a trailing slash.
40
- */
41
- export function getPathDirName(path) {
42
- const segments = path.split('/');
43
- if (segments[segments.length - 1]) {
44
- segments.pop();
45
- }
46
- return ensureEndingSlash(segments.join('/'));
47
- }
48
- export function ensureSlash(path) {
49
- return ensureEndingSlash(ensureStartingSlash(path));
50
- }
51
- export function ensureStartingSlash(path) {
52
- return /^\//.test(path) ? path : `/${path}`;
53
- }
54
- export function ensureEndingSlash(path) {
55
- return /(\.html|\/)$/.test(path) ? path : `${path}/`;
56
- }
57
- /**
58
- * Remove `.md` or `.html` extention from the given path. It also converts
59
- * `index` to slush.
60
- */
61
- export function removeExtention(path) {
62
- return path.replace(/(index)?(\.(md|html))?$/, '') || '/';
63
- }