vitepress 1.0.0-draft.3 → 1.0.0-draft.6

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 (71) hide show
  1. package/README.md +3 -1
  2. package/bin/vitepress.js +1 -1
  3. package/dist/client/app/composables/head.js +2 -2
  4. package/dist/client/app/data.js +2 -4
  5. package/dist/client/app/index.js +1 -5
  6. package/dist/client/index.d.ts +123 -134
  7. package/dist/client/index.js +1 -2
  8. package/dist/client/shared.js +21 -0
  9. package/dist/client/theme-default/Layout.vue +7 -0
  10. package/dist/client/theme-default/NotFound.vue +74 -14
  11. package/dist/client/theme-default/components/VPBox.vue +2 -6
  12. package/dist/client/theme-default/components/VPButton.vue +0 -1
  13. package/dist/client/theme-default/components/VPCarbonAds.vue +90 -0
  14. package/dist/client/theme-default/components/VPContent.vue +14 -10
  15. package/dist/client/theme-default/components/VPDoc.vue +73 -58
  16. package/dist/client/theme-default/components/VPDocAside.vue +34 -0
  17. package/dist/client/theme-default/components/VPDocAsideCarbonAds.vue +13 -0
  18. package/dist/client/theme-default/components/{VPDocOutline.vue → VPDocAsideOutline.vue} +14 -3
  19. package/dist/client/theme-default/components/VPDocAsideSponsors.vue +32 -0
  20. package/dist/client/theme-default/components/VPDocFooter.vue +1 -1
  21. package/dist/client/theme-default/components/VPFlyout.vue +2 -3
  22. package/dist/client/theme-default/components/VPFooter.vue +1 -1
  23. package/dist/client/theme-default/components/VPHero.vue +170 -29
  24. package/dist/client/theme-default/components/VPHomeFeatures.vue +1 -0
  25. package/dist/client/theme-default/components/VPHomeHero.vue +1 -0
  26. package/dist/client/theme-default/components/VPHomeSponsors.vue +3 -3
  27. package/dist/client/theme-default/components/VPLink.vue +2 -1
  28. package/dist/client/theme-default/components/VPLocalNav.vue +1 -1
  29. package/dist/client/theme-default/components/VPMenu.vue +9 -14
  30. package/dist/client/theme-default/components/VPMenuLink.vue +10 -4
  31. package/dist/client/theme-default/components/VPNav.vue +18 -1
  32. package/dist/client/theme-default/components/VPNavBar.vue +20 -8
  33. package/dist/client/theme-default/components/VPNavBarExtra.vue +20 -45
  34. package/dist/client/theme-default/components/VPNavBarMenuGroup.vue +2 -8
  35. package/dist/client/theme-default/components/VPNavBarMenuLink.vue +3 -3
  36. package/dist/client/theme-default/components/VPNavBarSearch.vue +6 -6
  37. package/dist/client/theme-default/components/VPNavBarTitle.vue +4 -2
  38. package/dist/client/theme-default/components/VPNavBarTranslations.vue +10 -39
  39. package/dist/client/theme-default/components/VPNavScreenMenuGroup.vue +1 -2
  40. package/dist/client/theme-default/components/VPNavScreenMenuGroupSection.vue +1 -1
  41. package/dist/client/theme-default/components/VPSidebar.vue +12 -6
  42. package/dist/client/theme-default/components/VPSidebarGroup.vue +80 -17
  43. package/dist/client/theme-default/components/VPSidebarLink.vue +2 -9
  44. package/dist/client/theme-default/components/VPSocialLink.vue +2 -2
  45. package/dist/client/theme-default/components/VPSocialLinks.vue +1 -1
  46. package/dist/client/theme-default/components/VPSponsors.vue +15 -40
  47. package/dist/client/theme-default/components/VPSponsorsGrid.vue +2 -2
  48. package/dist/client/theme-default/components/icons/VPIconMinus.vue +5 -0
  49. package/dist/client/theme-default/components/icons/VPIconMinusSquare.vue +6 -0
  50. package/dist/client/theme-default/components/icons/VPIconPlusSquare.vue +6 -0
  51. package/dist/client/theme-default/composables/aside.js +17 -0
  52. package/dist/client/theme-default/composables/copy-code.js +33 -0
  53. package/dist/client/theme-default/composables/outline.js +14 -4
  54. package/dist/client/theme-default/composables/sponsor-grid.js +8 -6
  55. package/dist/client/theme-default/index.js +4 -2
  56. package/dist/client/theme-default/styles/base.css +13 -1
  57. package/dist/client/theme-default/styles/components/custom-block.css +90 -0
  58. package/dist/client/theme-default/styles/{vp-doc.css → components/vp-doc.css} +152 -115
  59. package/dist/client/theme-default/styles/{vp-sponsor.css → components/vp-sponsor.css} +51 -7
  60. package/dist/client/theme-default/styles/vars.css +109 -58
  61. package/dist/node/cli.js +32 -31
  62. package/dist/node/index.d.ts +371 -361
  63. package/dist/node/index.js +22 -37
  64. package/dist/node/serve-9c85885c.js +64795 -0
  65. package/dist/node-cjs/cli.cjs +304 -0
  66. package/dist/node-cjs/index.cjs +38 -0
  67. package/dist/{node/serve-b5dc02b2.js → node-cjs/serve-a73b4871.cjs} +27405 -28602
  68. package/package.json +47 -40
  69. package/theme.d.ts +7 -2
  70. package/types/default-theme.d.ts +15 -2
  71. package/types/shared.d.ts +3 -0
@@ -43,12 +43,6 @@
43
43
  --vp-c-text-dark-3: rgba(235, 235, 235, 0.38);
44
44
  --vp-c-text-dark-4: rgba(235, 235, 235, 0.18);
45
45
 
46
- --vp-c-green: #42b883;
47
- --vp-c-green-light: #42d392;
48
- --vp-c-green-lighter: #35eb9a;
49
- --vp-c-green-dark: #33a06f;
50
- --vp-c-green-darker: #155f3e;
51
-
52
46
  --vp-c-indigo: #213547;
53
47
  --vp-c-indigo-soft: #476582;
54
48
  --vp-c-indigo-light: #aac8e4;
@@ -56,29 +50,32 @@
56
50
  --vp-c-indigo-dark: #1d2f3f;
57
51
  --vp-c-indigo-darker: #14212e;
58
52
 
59
- --vp-c-blue: #3b8eed;
60
- --vp-c-blue-light: #549ced;
61
- --vp-c-blue-lighter: #50a2ff;
62
- --vp-c-blue-dark: #3468a3;
63
- --vp-c-blue-darker: #255489;
53
+ --vp-c-green: #42b883;
54
+ --vp-c-green-light: #42d392;
55
+ --vp-c-green-lighter: #35eb9a;
56
+ --vp-c-green-dark: #33a06f;
57
+ --vp-c-green-darker: #155f3e;
58
+ --vp-c-green-dimm-1: rgba(66, 184, 131, 0.5);
59
+ --vp-c-green-dimm-2: rgba(66, 184, 131, 0.25);
60
+ --vp-c-green-dimm-3: rgba(66, 184, 131, 0.05);
64
61
 
65
62
  --vp-c-yellow: #ffc517;
66
- --vp-c-yellow-light: #ffe417;
67
- --vp-c-yellow-lighter: #ffff17;
63
+ --vp-c-yellow-light: #fcd253;
64
+ --vp-c-yellow-lighter: #fcfc7c;
68
65
  --vp-c-yellow-dark: #e0ad15;
69
- --vp-c-yellow-darker: #bc9112;
66
+ --vp-c-yellow-darker: #ad850e;
67
+ --vp-c-yellow-dimm-1: rgba(255, 197, 23, 0.5);
68
+ --vp-c-yellow-dimm-2: rgba(255, 197, 23, 0.25);
69
+ --vp-c-yellow-dimm-3: rgba(255, 197, 23, 0.05);
70
70
 
71
71
  --vp-c-red: #ed3c50;
72
- --vp-c-red-light: #f43771;
72
+ --vp-c-red-light: #f54e82;
73
73
  --vp-c-red-lighter: #fd1d7c;
74
74
  --vp-c-red-dark: #cd2d3f;
75
75
  --vp-c-red-darker: #ab2131;
76
-
77
- --vp-c-purple: #de41e0;
78
- --vp-c-purple-light: #e936eb;
79
- --vp-c-purple-lighter: #f616f8;
80
- --vp-c-purple-dark: #823c83;
81
- --vp-c-purple-darker: #602960;
76
+ --vp-c-red-dimm-1: rgba(237, 60, 80, 0.5);
77
+ --vp-c-red-dimm-2: rgba(237, 60, 80, 0.25);
78
+ --vp-c-red-dimm-3: rgba(237, 60, 80, 0.05);
82
79
  }
83
80
 
84
81
  /**
@@ -89,8 +86,7 @@
89
86
  --vp-c-bg: var(--vp-c-white);
90
87
  --vp-c-bg-soft: var(--vp-c-white-soft);
91
88
  --vp-c-bg-mute: var(--vp-c-white-mute);
92
- --vp-c-bg-content: var(--vp-c-white);
93
- --vp-c-bg-sidebar: var(--vp-c-white-soft);
89
+ --vp-c-bg-alt: var(--vp-c-white-soft);
94
90
 
95
91
  --vp-c-divider: var(--vp-c-divider-light-1);
96
92
  --vp-c-divider-light: var(--vp-c-divider-light-2);
@@ -120,11 +116,10 @@
120
116
  }
121
117
 
122
118
  .dark {
123
- --vp-c-bg: var(--vp-c-black);
124
- --vp-c-bg-soft: var(--vp-c-black-soft);
125
- --vp-c-bg-mute: var(--vp-c-black-mute);
126
- --vp-c-bg-content: var(--vp-c-bg-soft);
127
- --vp-c-bg-sidebar: var(--vp-c-bg);
119
+ --vp-c-bg: var(--vp-c-black-soft);
120
+ --vp-c-bg-soft: var(--vp-c-black-mute);
121
+ --vp-c-bg-mute: var(--vp-c-gray-dark-3);
122
+ --vp-c-bg-alt: var(--vp-c-black);
128
123
 
129
124
  --vp-c-divider: var(--vp-c-divider-dark-1);
130
125
  --vp-c-divider-light: var(--vp-c-divider-dark-2);
@@ -142,7 +137,7 @@
142
137
  --vp-c-text-inverse-3: var(--vp-c-text-light-3);
143
138
  --vp-c-text-inverse-4: var(--vp-c-text-light-4);
144
139
 
145
- --vp-c-text-code: var(--vp-c-indigo-light);
140
+ --vp-c-text-code: var(--vp-c-indigo-lighter);
146
141
  }
147
142
 
148
143
  /**
@@ -185,31 +180,7 @@
185
180
  * -------------------------------------------------------------------------- */
186
181
 
187
182
  :root {
188
- --vp-layout-max-width: 1376px;
189
- }
190
-
191
- /**
192
- * Component: Nav
193
- * -------------------------------------------------------------------------- */
194
-
195
- :root {
196
- --vp-nav-height: var(--vp-nav-height-mobile);
197
- --vp-nav-height-mobile: 56px;
198
- --vp-nav-height-desktop: 72px;
199
- }
200
-
201
- @media (min-width: 960px) {
202
- :root {
203
- --vp-nav-height: var(--vp-nav-height-desktop);
204
- }
205
- }
206
-
207
- /**
208
- * Component: Sidebar
209
- * -------------------------------------------------------------------------- */
210
-
211
- :root {
212
- --vp-sidebar-width: 272px;
183
+ --vp-layout-max-width: 1440px;
213
184
  }
214
185
 
215
186
  /**
@@ -217,15 +188,23 @@
217
188
  * -------------------------------------------------------------------------- */
218
189
 
219
190
  :root {
220
- --vp-code-line-height: 24px;
221
- --vp-code-font-size: 14px;
191
+ --vp-code-line-height: 1.7;
192
+ --vp-code-font-size: 0.875em;
222
193
 
223
194
  --vp-code-block-color: var(--vp-c-text-dark-1);
224
195
  --vp-code-block-bg: #292d3e;
196
+
197
+ --vp-code-line-highlight-color: rgba(0, 0, 0, 0.5);
198
+
199
+ --vp-code-line-number-color: var(--vp-c-text-dark-3);
200
+
201
+ --vp-code-copy-code-hover-bg: rgba(255, 255, 255, 0.05);
225
202
  }
226
203
 
227
204
  .dark {
228
- --vp-code-block-bg: var(--vp-c-bg-sidebar);
205
+ --vp-code-block-bg: var(--vp-c-bg-alt);
206
+
207
+ --vp-code-line-number-color: var(--vp-c-text-dark-3);
229
208
  }
230
209
 
231
210
  /**
@@ -280,7 +259,7 @@
280
259
  --vp-button-alt-bg: var(--vp-c-bg-mute);
281
260
  --vp-button-alt-hover-border: var(--vp-c-gray-dark-2);
282
261
  --vp-button-alt-hover-text: var(--vp-c-text-dark-1);
283
- --vp-button-alt-hover-bg: var(--vp-c-gray-dark-3);
262
+ --vp-button-alt-hover-bg: var(--vp-c-gray-dark-2);
284
263
  --vp-button-alt-active-border: var(--vp-c-gray-dark-2);
285
264
  --vp-button-alt-active-text: var(--vp-c-text-dark-1);
286
265
  --vp-button-alt-active-bg: var(--vp-button-alt-bg);
@@ -289,6 +268,78 @@
289
268
  --vp-button-sponsor-text: var(--vp-c-text-dark-2);
290
269
  }
291
270
 
271
+ /**
272
+ * Component: Custom Block
273
+ * -------------------------------------------------------------------------- */
274
+
275
+ :root {
276
+ --vp-custom-block-code-font-size: 13px;
277
+
278
+ --vp-custom-block-info-border: var(--vp-c-divider-light);
279
+ --vp-custom-block-info-text: var(--vp-c-text-2);
280
+ --vp-custom-block-info-bg: var(--vp-c-white-soft);
281
+ --vp-custom-block-info-code-bg: var(--vp-c-gray-light-4);
282
+
283
+ --vp-custom-block-tip-border: var(--vp-c-green-dimm-1);
284
+ --vp-custom-block-tip-text: var(--vp-c-green-darker);
285
+ --vp-custom-block-tip-bg: var(--vp-c-green-dimm-3);
286
+ --vp-custom-block-tip-code-bg: var(--vp-custom-block-tip-bg);
287
+
288
+ --vp-custom-block-warning-border: var(--vp-c-yellow-dimm-1);
289
+ --vp-custom-block-warning-text: var(--vp-c-yellow-darker);
290
+ --vp-custom-block-warning-bg: var(--vp-c-yellow-dimm-3);
291
+ --vp-custom-block-warning-code-bg: var(--vp-custom-block-warning-bg);
292
+
293
+ --vp-custom-block-danger-border: var(--vp-c-red-dimm-1);
294
+ --vp-custom-block-danger-text: var(--vp-c-red-darker);
295
+ --vp-custom-block-danger-bg: var(--vp-c-red-dimm-3);
296
+ --vp-custom-block-danger-code-bg: var(--vp-custom-block-danger-bg);
297
+
298
+ --vp-custom-block-details-border: var(--vp-custom-block-info-border);
299
+ --vp-custom-block-details-text: var(--vp-custom-block-info-text);
300
+ --vp-custom-block-details-bg: var(--vp-custom-block-info-bg);
301
+ --vp-custom-block-details-code-bg: var(--vp-custom-block-details-bg);
302
+ }
303
+
304
+ .dark {
305
+ --vp-custom-block-info-border: var(--vp-c-divider-light);
306
+ --vp-custom-block-info-bg: var(--vp-c-black-mute);
307
+ --vp-custom-block-info-code-bg: var(--vp-c-gray-dark-4);
308
+
309
+ --vp-custom-block-tip-border: var(--vp-c-green-dimm-2);
310
+ --vp-custom-block-tip-text: var(--vp-c-green-light);
311
+
312
+ --vp-custom-block-warning-border: var(--vp-c-yellow-dimm-2);
313
+ --vp-custom-block-warning-text: var(--vp-c-yellow-light);
314
+
315
+ --vp-custom-block-danger-border: var(--vp-c-red-dimm-2);
316
+ --vp-custom-block-danger-text: var(--vp-c-red-light);
317
+ }
318
+
319
+ /**
320
+ * Component: Nav
321
+ * -------------------------------------------------------------------------- */
322
+
323
+ :root {
324
+ --vp-nav-height: var(--vp-nav-height-mobile);
325
+ --vp-nav-height-mobile: 56px;
326
+ --vp-nav-height-desktop: 72px;
327
+ }
328
+
329
+ @media (min-width: 960px) {
330
+ :root {
331
+ --vp-nav-height: var(--vp-nav-height-desktop);
332
+ }
333
+ }
334
+
335
+ /**
336
+ * Component: Sidebar
337
+ * -------------------------------------------------------------------------- */
338
+
339
+ :root {
340
+ --vp-sidebar-width: 272px;
341
+ }
342
+
292
343
  /**
293
344
  * Component: Home
294
345
  * -------------------------------------------------------------------------- */
package/dist/node/cli.js CHANGED
@@ -1,26 +1,25 @@
1
- 'use strict';
2
-
3
- var serve = require('./serve-b5dc02b2.js');
4
- require('fs');
5
- require('path');
6
- require('url');
7
- require('vite');
8
- require('readline');
9
- require('assert');
10
- require('events');
11
- require('stream');
12
- require('util');
13
- require('buffer');
14
- require('punycode');
15
- require('prismjs');
16
- require('child_process');
17
- require('querystring');
18
- require('tty');
19
- require('net');
20
- require('zlib');
21
- require('constants');
22
- require('os');
23
- require('http');
1
+ import { h as c, e as createServer, g as build, s as serve } from './serve-9c85885c.js';
2
+ import 'shiki';
3
+ import 'fs';
4
+ import 'path';
5
+ import 'url';
6
+ import 'vite';
7
+ import 'readline';
8
+ import 'os';
9
+ import 'tty';
10
+ import 'assert';
11
+ import 'events';
12
+ import 'stream';
13
+ import 'util';
14
+ import 'buffer';
15
+ import 'module';
16
+ import 'child_process';
17
+ import 'punycode';
18
+ import 'querystring';
19
+ import 'net';
20
+ import 'zlib';
21
+ import 'http';
22
+ import 'constants';
24
23
 
25
24
  var minimist = function (args, opts) {
26
25
  if (!opts) opts = {};
@@ -267,35 +266,37 @@ function isNumber (x) {
267
266
  return /^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(x);
268
267
  }
269
268
 
269
+ var version = "1.0.0-draft.6";
270
+
270
271
  const argv = minimist(process.argv.slice(2));
271
- console.log(serve.source.cyan(`vitepress v${require("../../package.json").version}`));
272
+ console.log(c.cyan(`vitepress v${version}`));
272
273
  const command = argv._[0];
273
274
  const root = argv._[command ? 1 : 0];
274
275
  if (root) {
275
276
  argv.root = root;
276
277
  }
277
278
  if (!command || command === "dev") {
278
- serve.createServer(root, argv).then((server) => server.listen()).then((server) => {
279
+ createServer(root, argv).then((server) => server.listen()).then((server) => {
279
280
  console.log();
280
281
  server.printUrls();
281
282
  }).catch((err) => {
282
- console.error(serve.source.red(`failed to start server. error:
283
+ console.error(c.red(`failed to start server. error:
283
284
  `), err);
284
285
  process.exit(1);
285
286
  });
286
287
  } else if (command === "build") {
287
- serve.build(root, argv).catch((err) => {
288
- console.error(serve.source.red(`build error:
288
+ build(root, argv).catch((err) => {
289
+ console.error(c.red(`build error:
289
290
  `), err);
290
291
  process.exit(1);
291
292
  });
292
293
  } else if (command === "serve") {
293
- serve.serve(argv).catch((err) => {
294
- console.error(serve.source.red(`failed to start server. error:
294
+ serve(argv).catch((err) => {
295
+ console.error(c.red(`failed to start server. error:
295
296
  `), err);
296
297
  process.exit(1);
297
298
  });
298
299
  } else {
299
- console.log(serve.source.red(`unknown command "${command}".`));
300
+ console.log(c.red(`unknown command "${command}".`));
300
301
  process.exit(1);
301
302
  }