vitepress 0.22.4 → 1.0.0-draft.3

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 (149) hide show
  1. package/client.d.ts +2 -3
  2. package/dist/client/app/components/ClientOnly.js +1 -1
  3. package/dist/client/app/index.js +1 -1
  4. package/dist/client/index.d.ts +5 -0
  5. package/dist/client/shared.js +1 -0
  6. package/dist/client/theme-default/Layout.vue +39 -180
  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/VPBox.vue +59 -0
  11. package/dist/client/theme-default/components/VPButton.vue +123 -0
  12. package/dist/client/theme-default/components/VPContent.vue +74 -0
  13. package/dist/client/theme-default/components/VPDoc.vue +173 -0
  14. package/dist/client/theme-default/components/VPDocFooter.vue +141 -0
  15. package/dist/client/theme-default/components/VPDocOutline.vue +108 -0
  16. package/dist/client/theme-default/components/VPFlyout.vue +149 -0
  17. package/dist/client/theme-default/components/VPFooter.vue +53 -0
  18. package/dist/client/theme-default/components/VPHero.vue +144 -0
  19. package/dist/client/theme-default/components/VPHome.vue +33 -0
  20. package/dist/client/theme-default/components/VPHomeFeatures.vue +96 -0
  21. package/dist/client/theme-default/components/VPHomeHero.vue +17 -0
  22. package/dist/client/theme-default/components/VPHomeSponsors.vue +93 -0
  23. package/dist/client/theme-default/components/VPLink.vue +37 -0
  24. package/dist/client/theme-default/components/VPLocalNav.vue +106 -0
  25. package/dist/client/theme-default/components/VPMenu.vue +79 -0
  26. package/dist/client/theme-default/components/VPMenuGroup.vue +35 -0
  27. package/dist/client/theme-default/components/VPMenuLink.vue +30 -0
  28. package/dist/client/theme-default/components/VPNav.vue +33 -0
  29. package/dist/client/theme-default/components/VPNavBar.vue +110 -0
  30. package/dist/client/theme-default/components/VPNavBarAppearance.vue +25 -0
  31. package/dist/client/theme-default/components/VPNavBarExtra.vue +107 -0
  32. package/dist/client/theme-default/components/VPNavBarHamburger.vue +79 -0
  33. package/dist/client/theme-default/components/VPNavBarMenu.vue +29 -0
  34. package/dist/client/theme-default/components/VPNavBarMenuGroup.vue +18 -0
  35. package/dist/client/theme-default/components/VPNavBarMenuLink.vue +56 -0
  36. package/dist/client/theme-default/components/VPNavBarSearch.vue +269 -0
  37. package/dist/client/theme-default/components/VPNavBarSocialLinks.vue +27 -0
  38. package/dist/client/theme-default/components/VPNavBarTitle.vue +57 -0
  39. package/dist/client/theme-default/components/VPNavBarTranslations.vue +74 -0
  40. package/dist/client/theme-default/components/VPNavScreen.vue +100 -0
  41. package/dist/client/theme-default/components/VPNavScreenAppearance.vue +33 -0
  42. package/dist/client/theme-default/components/VPNavScreenMenu.vue +24 -0
  43. package/dist/client/theme-default/components/VPNavScreenMenuGroup.vue +118 -0
  44. package/dist/client/theme-default/components/VPNavScreenMenuGroupLink.vue +33 -0
  45. package/dist/client/theme-default/components/VPNavScreenMenuGroupSection.vue +35 -0
  46. package/dist/client/theme-default/components/VPNavScreenMenuLink.vue +34 -0
  47. package/dist/client/theme-default/components/VPNavScreenSocialLinks.vue +14 -0
  48. package/dist/client/theme-default/components/VPNavScreenTranslations.vue +73 -0
  49. package/dist/client/theme-default/components/VPPage.vue +5 -0
  50. package/dist/client/theme-default/components/VPSidebar.vue +118 -0
  51. package/dist/client/theme-default/components/VPSidebarGroup.vue +44 -0
  52. package/dist/client/theme-default/components/VPSidebarLink.vue +57 -0
  53. package/dist/client/theme-default/components/VPSkipLink.vue +72 -0
  54. package/dist/client/theme-default/components/VPSocialLink.vue +63 -0
  55. package/dist/client/theme-default/components/VPSocialLinks.vue +27 -0
  56. package/dist/client/theme-default/components/VPSponsors.vue +77 -0
  57. package/dist/client/theme-default/components/VPSponsorsGrid.vue +32 -0
  58. package/dist/client/theme-default/components/VPSwitch.vue +66 -0
  59. package/dist/client/theme-default/components/VPSwitchAppearance.vue +74 -0
  60. package/dist/client/theme-default/components/icons/VPIconAlignJustify.vue +8 -0
  61. package/dist/client/theme-default/components/icons/VPIconAlignLeft.vue +8 -0
  62. package/dist/client/theme-default/components/icons/VPIconAlignRight.vue +8 -0
  63. package/dist/client/theme-default/components/icons/{ArrowLeft.vue → VPIconArrowLeft.vue} +0 -0
  64. package/dist/client/theme-default/components/icons/{ArrowRight.vue → VPIconArrowRight.vue} +0 -0
  65. package/dist/client/theme-default/components/icons/VPIconChevronDown.vue +5 -0
  66. package/dist/client/theme-default/components/icons/VPIconChevronLeft.vue +5 -0
  67. package/dist/client/theme-default/components/icons/VPIconChevronRight.vue +5 -0
  68. package/dist/client/theme-default/components/icons/VPIconChevronUp.vue +5 -0
  69. package/dist/client/theme-default/components/icons/VPIconDiscord.vue +5 -0
  70. package/dist/client/theme-default/components/icons/VPIconEdit.vue +6 -0
  71. package/dist/client/theme-default/components/icons/VPIconExternalLink.vue +13 -0
  72. package/dist/client/theme-default/components/icons/VPIconFacebook.vue +5 -0
  73. package/dist/client/theme-default/components/icons/VPIconGitHub.vue +5 -0
  74. package/dist/client/theme-default/components/icons/VPIconHeart.vue +5 -0
  75. package/dist/client/theme-default/components/icons/VPIconInstagram.vue +5 -0
  76. package/dist/client/theme-default/components/icons/VPIconLanguages.vue +9 -0
  77. package/dist/client/theme-default/components/icons/VPIconLinkedIn.vue +5 -0
  78. package/dist/client/theme-default/components/icons/VPIconMoon.vue +5 -0
  79. package/dist/client/theme-default/components/icons/VPIconMoreHorizontal.vue +7 -0
  80. package/dist/client/theme-default/components/icons/VPIconPlus.vue +5 -0
  81. package/dist/client/theme-default/components/icons/VPIconSlack.vue +5 -0
  82. package/dist/client/theme-default/components/icons/VPIconSun.vue +13 -0
  83. package/dist/client/theme-default/components/icons/VPIconTwitter.vue +5 -0
  84. package/dist/client/theme-default/components/icons/VPIconYouTube.vue +5 -0
  85. package/dist/client/theme-default/composables/edit-link.js +22 -0
  86. package/dist/client/theme-default/composables/flyout.js +40 -0
  87. package/dist/client/theme-default/composables/nav.js +27 -1
  88. package/dist/client/theme-default/composables/outline.js +112 -0
  89. package/dist/client/theme-default/composables/prev-next.js +18 -0
  90. package/dist/client/theme-default/composables/sidebar.js +57 -0
  91. package/dist/client/theme-default/composables/sponsor-grid.js +92 -0
  92. package/dist/client/theme-default/fonts/inter-cyrillic-ext.woff2 +0 -0
  93. package/dist/client/theme-default/fonts/inter-cyrillic.woff2 +0 -0
  94. package/dist/client/theme-default/fonts/inter-greek-ext.woff2 +0 -0
  95. package/dist/client/theme-default/fonts/inter-greek.woff2 +0 -0
  96. package/dist/client/theme-default/fonts/inter-latin-ext.woff2 +0 -0
  97. package/dist/client/theme-default/fonts/inter-latin.woff2 +0 -0
  98. package/dist/client/theme-default/fonts/inter-vietnamese.woff2 +0 -0
  99. package/dist/client/theme-default/index.js +8 -4
  100. package/dist/client/theme-default/styles/base.css +203 -0
  101. package/dist/client/theme-default/styles/fonts.css +67 -0
  102. package/dist/client/theme-default/styles/utils.css +9 -0
  103. package/dist/client/theme-default/styles/vars.css +291 -66
  104. package/dist/client/theme-default/styles/vp-doc.css +425 -0
  105. package/dist/client/theme-default/styles/vp-sponsor.css +86 -0
  106. package/dist/client/theme-default/support/sidebar.js +29 -0
  107. package/dist/client/theme-default/support/utils.js +62 -0
  108. package/dist/node/cli.js +3 -8
  109. package/dist/node/index.d.ts +121 -78
  110. package/dist/node/index.js +1 -1
  111. package/dist/node/{serve-3035f99b.js → serve-b5dc02b2.js} +11444 -1417
  112. package/package.json +24 -18
  113. package/types/default-theme.d.ts +114 -77
  114. package/types/shared.d.ts +11 -6
  115. package/dist/client/theme-default/components/AlgoliaSearchBox.vue +0 -188
  116. package/dist/client/theme-default/components/BuySellAds.vue +0 -152
  117. package/dist/client/theme-default/components/CarbonAds.vue +0 -99
  118. package/dist/client/theme-default/components/EditLink.vue +0 -38
  119. package/dist/client/theme-default/components/Home.vue +0 -31
  120. package/dist/client/theme-default/components/HomeFeatures.vue +0 -143
  121. package/dist/client/theme-default/components/HomeFooter.vue +0 -50
  122. package/dist/client/theme-default/components/HomeHero.vue +0 -161
  123. package/dist/client/theme-default/components/LastUpdated.vue +0 -60
  124. package/dist/client/theme-default/components/NavBar.vue +0 -60
  125. package/dist/client/theme-default/components/NavBarTitle.vue +0 -41
  126. package/dist/client/theme-default/components/NavDropdownLink.vue +0 -135
  127. package/dist/client/theme-default/components/NavDropdownLinkItem.vue +0 -76
  128. package/dist/client/theme-default/components/NavLink.vue +0 -61
  129. package/dist/client/theme-default/components/NavLinks.vue +0 -52
  130. package/dist/client/theme-default/components/NextAndPrevLinks.vue +0 -88
  131. package/dist/client/theme-default/components/Page.vue +0 -53
  132. package/dist/client/theme-default/components/PageFooter.vue +0 -44
  133. package/dist/client/theme-default/components/SideBar.vue +0 -60
  134. package/dist/client/theme-default/components/SideBarLink.js +0 -68
  135. package/dist/client/theme-default/components/SideBarLinks.vue +0 -12
  136. package/dist/client/theme-default/components/ToggleSideBarButton.vue +0 -46
  137. package/dist/client/theme-default/components/icons/OutboundLink.vue +0 -31
  138. package/dist/client/theme-default/composables/activeSidebarLink.js +0 -99
  139. package/dist/client/theme-default/composables/editLink.js +0 -49
  140. package/dist/client/theme-default/composables/navLink.js +0 -42
  141. package/dist/client/theme-default/composables/nextAndPrevLinks.js +0 -37
  142. package/dist/client/theme-default/composables/repo.js +0 -38
  143. package/dist/client/theme-default/composables/sideBar.js +0 -57
  144. package/dist/client/theme-default/styles/code.css +0 -299
  145. package/dist/client/theme-default/styles/custom-blocks.css +0 -76
  146. package/dist/client/theme-default/styles/layout.css +0 -236
  147. package/dist/client/theme-default/styles/sidebar-links.css +0 -107
  148. package/dist/client/theme-default/support/sideBar.js +0 -46
  149. package/dist/client/theme-default/utils.js +0 -63
@@ -0,0 +1,425 @@
1
+ /**
2
+ * Headings
3
+ * -------------------------------------------------------------------------- */
4
+
5
+ .vp-doc h1,
6
+ .vp-doc h2,
7
+ .vp-doc h3,
8
+ .vp-doc h4,
9
+ .vp-doc h5,
10
+ .vp-doc h6 {
11
+ position: relative;
12
+ font-weight: 600;
13
+ outline: none;
14
+ }
15
+
16
+ .vp-doc h1 {
17
+ letter-spacing: -0.02em;
18
+ line-height: 40px;
19
+ font-size: 28px;
20
+ }
21
+
22
+ .vp-doc h2 {
23
+ margin: 48px 0 0;
24
+ border-top: 1px solid var(--vp-c-divider-light);
25
+ padding-top: 24px;
26
+ letter-spacing: -0.02em;
27
+ line-height: 32px;
28
+ font-size: 24px;
29
+ }
30
+
31
+ .vp-doc h3 {
32
+ margin: 48px 0 0;
33
+ letter-spacing: -0.01em;
34
+ line-height: 28px;
35
+ font-size: 20px;
36
+ }
37
+
38
+ .vp-doc .header-anchor {
39
+ float: left;
40
+ margin-left: -0.87em;
41
+ padding-right: 0.23em;
42
+ font-weight: 500;
43
+ opacity: 0;
44
+ transition: color 0.25s, opacity 0.25s;
45
+ }
46
+
47
+ .vp-doc h1:hover .header-anchor,
48
+ .vp-doc h1 .header-anchor:focus,
49
+ .vp-doc h2:hover .header-anchor,
50
+ .vp-doc h2 .header-anchor:focus,
51
+ .vp-doc h3:hover .header-anchor,
52
+ .vp-doc h3 .header-anchor:focus,
53
+ .vp-doc h4:hover .header-anchor,
54
+ .vp-doc h4 .header-anchor:focus,
55
+ .vp-doc h5:hover .header-anchor,
56
+ .vp-doc h5 .header-anchor:focus,
57
+ .vp-doc h6:hover .header-anchor,
58
+ .vp-doc h6 .header-anchor:focus {
59
+ opacity: 1;
60
+ }
61
+
62
+ @media (min-width: 768px) {
63
+ .vp-doc h1 {
64
+ letter-spacing: -0.02em;
65
+ line-height: 40px;
66
+ font-size: 32px;
67
+ }
68
+ }
69
+
70
+ /**
71
+ * Paragraph and inline elements
72
+ * -------------------------------------------------------------------------- */
73
+
74
+ .vp-doc p,
75
+ .vp-doc summary {
76
+ margin: 16px 0;
77
+ }
78
+
79
+ .vp-doc p {
80
+ line-height: 28px;
81
+ }
82
+
83
+ .vp-doc blockquote {
84
+ margin: 16px 0;
85
+ border-left: 2px solid var(--vp-c-divider);
86
+ padding-left: 16px;
87
+ transition: border-color 0.5s;
88
+ }
89
+
90
+ .vp-doc blockquote > p {
91
+ margin: 0;
92
+ font-size: 16px;
93
+ color: var(--vp-c-text-2);
94
+ transition: color 0.5s;
95
+ }
96
+
97
+ .vp-doc a {
98
+ font-weight: 500;
99
+ color: var(--vp-c-brand);
100
+ text-decoration-style: dotted;
101
+ transition: color 0.25s;
102
+ }
103
+
104
+ .vp-doc a:hover {
105
+ color: var(--vp-c-brand-dark);
106
+ }
107
+
108
+ .vp-doc strong {
109
+ font-weight: 600;
110
+ }
111
+
112
+ /**
113
+ * Lists
114
+ * -------------------------------------------------------------------------- */
115
+
116
+ .vp-doc ul,
117
+ .vp-doc ol {
118
+ margin: 16px 0;
119
+ }
120
+
121
+ .vp-doc ul {
122
+ padding-left: 1.25rem;
123
+ list-style: disc;
124
+ }
125
+
126
+ .vp-doc li + li {
127
+ margin-top: 8px;
128
+ }
129
+
130
+ /**
131
+ * Table
132
+ * -------------------------------------------------------------------------- */
133
+
134
+ .vp-doc table {
135
+ display: block;
136
+ border-collapse: collapse;
137
+ margin: 20px 0;
138
+ overflow-x: auto;
139
+ }
140
+
141
+ .vp-doc tr {
142
+ border-top: 1px solid var(--vp-c-divider);
143
+ transition: background-color 0.5s;
144
+ }
145
+
146
+ .vp-doc tr:nth-child(2n) {
147
+ background-color: var(--vp-c-bg-soft);
148
+ }
149
+
150
+ .dark .vp-doc tr:nth-child(2n) {
151
+ background-color: var(--vp-c-bg-mute);
152
+ }
153
+
154
+ .vp-doc th,
155
+ .vp-doc td {
156
+ border: 1px solid var(--vp-c-divider);
157
+ padding: 12px 16px;
158
+ }
159
+
160
+ .vp-doc th {
161
+ font-size: 16px;
162
+ font-weight: 600;
163
+ background-color: var(--vp-c-white-soft);
164
+ }
165
+
166
+ .dark .vp-doc th {
167
+ background-color: var(--vp-c-black);
168
+ }
169
+
170
+ /**
171
+ * Decorational elements
172
+ * -------------------------------------------------------------------------- */
173
+
174
+ .vp-doc hr {
175
+ margin: 16px 0;
176
+ border: none;
177
+ border-top: 1px solid var(--vp-c-divider-light);
178
+ }
179
+
180
+ /**
181
+ * Code
182
+ * -------------------------------------------------------------------------- */
183
+
184
+ /* inline code */
185
+ .vp-doc :not(pre, h1, h2, h3, h4, h5, h6) > code {
186
+ font-size: var(--vp-code-font-size);
187
+ }
188
+
189
+ .vp-doc :not(pre) > code {
190
+ border-radius: 4px;
191
+ padding: 3px 6px;
192
+ color: var(--vp-c-text-code);
193
+ background-color: var(--vp-c-bg-mute);
194
+ transition: color 0.5s, background-color 0.5s;
195
+ }
196
+
197
+ .vp-doc h1 > code,
198
+ .vp-doc h2 > code,
199
+ .vp-doc h3 > code {
200
+ font-size: 0.9em;
201
+ }
202
+
203
+ @media (min-width: 768px) {
204
+ .vp-doc :not(pre) > code {
205
+ white-space: nowrap;
206
+ }
207
+ }
208
+
209
+ .vp-doc a > code {
210
+ color: var(--vp-c-brand-dark);
211
+ }
212
+
213
+ .vp-doc div[class*='language-'] {
214
+ position: relative;
215
+ margin: 20px -24px;
216
+ background-color: var(--vp-code-block-bg);
217
+ overflow-x: auto;
218
+ transition: background-color 0.5s;
219
+ }
220
+
221
+ @media (min-width: 640px) {
222
+ .vp-doc div[class*='language-'] {
223
+ border-radius: 8px;
224
+ margin: 24px 0;
225
+ }
226
+ }
227
+
228
+ @media (max-width: 639px) {
229
+ .vp-doc li div[class*='language-'] {
230
+ border-radius: 8px 0 0 8px;
231
+ }
232
+ }
233
+
234
+ .vp-doc div[class*='language-'] + div[class*='language-'],
235
+ .vp-doc div[class$='-api'] + div[class*='language-'],
236
+ .vp-doc div[class*='language-'] + div[class$='-api'] > div[class*='language-'] {
237
+ margin-top: -12px;
238
+ }
239
+
240
+ .vp-doc [class*='language-'] pre,
241
+ .vp-doc [class*='language-'] code {
242
+ text-align: left;
243
+ white-space: pre;
244
+ word-spacing: normal;
245
+ word-break: normal;
246
+ word-wrap: normal;
247
+ -moz-tab-size: 4;
248
+ -o-tab-size: 4;
249
+ tab-size: 4;
250
+ -webkit-hyphens: none;
251
+ -moz-hyphens: none;
252
+ -ms-hyphens: none;
253
+ hyphens: none;
254
+ }
255
+
256
+ .vp-doc [class*='language-'] pre {
257
+ position: relative;
258
+ z-index: 1;
259
+ margin: 0;
260
+ padding: 16px 24px;
261
+ background: transparent;
262
+ overflow-x: auto;
263
+ }
264
+
265
+ .vp-doc [class*='language-'] code {
266
+ display: inline-block;
267
+ padding: 0;
268
+ line-height: var(--vp-code-line-height);
269
+ font-size: var(--vp-code-font-size);
270
+ color: var(--vp-code-block-color);
271
+ transition: color 0.5s;
272
+ }
273
+
274
+ .vp-doc .highlight-lines {
275
+ position: absolute;
276
+ top: 0;
277
+ bottom: 0;
278
+ left: 0;
279
+ padding: 13px 0 11px;
280
+ width: 100%;
281
+ font-family: var(--vp-font-family-mono);
282
+ line-height: var(--vp-code-line-height);
283
+ font-size: var(--vp-code-font-size);
284
+ user-select: none;
285
+ overflow: hidden;
286
+ }
287
+
288
+ .vp-doc .highlight-lines .highlighted {
289
+ background-color: rgba(0, 0, 0, 0.3);
290
+ transition: background-color 0.5s;
291
+ }
292
+
293
+ .dark .vp-doc .highlight-lines .highlighted {
294
+ background-color: rgba(255, 255, 255, 0.05);
295
+ }
296
+
297
+ .vp-doc div[class*='language-'].line-numbers-mode {
298
+ padding-left: 32px;
299
+ }
300
+
301
+ .vp-doc .line-numbers-wrapper {
302
+ position: absolute;
303
+ top: 0;
304
+ bottom: 0;
305
+ left: 0;
306
+ z-index: 3;
307
+ border-right: 1px solid var(--vp-c-divider-light);
308
+ padding: 13px 0 11px;
309
+ width: 32px;
310
+ text-align: center;
311
+ font-family: var(--vp-font-family-mono);
312
+ line-height: var(--vp-code-line-height);
313
+ font-size: var(--vp-code-font-size);
314
+ color: var(--vp-c-text-3);
315
+ transition: border-color 0.5s, color 0.5s;
316
+ }
317
+
318
+ .vp-doc [class*='language-']:before {
319
+ position: absolute;
320
+ top: 4px;
321
+ right: 10px;
322
+ z-index: 2;
323
+ font-size: 12px;
324
+ font-weight: 500;
325
+ color: var(--vp-c-text-dark-3);
326
+ transition: color 0.5s;
327
+ }
328
+
329
+ .vp-doc [class~='language-vue']:before { content: 'vue'; }
330
+ .vp-doc [class~='language-html']:before { content: 'html'; }
331
+ .vp-doc [class~='language-vue-html']:before { content: 'template'; }
332
+ .vp-doc [class~='language-css']:before { content: 'css'; }
333
+ .vp-doc [class~='language-js']:before { content: 'js'; }
334
+ .vp-doc [class~='language-jsx']:before { content: 'jsx'; }
335
+ .vp-doc [class~='language-ts']:before { content: 'ts'; }
336
+ .vp-doc [class~='language-tsx']:before { content: 'tsx'; }
337
+ .vp-doc [class~='language-json']:before { content: 'json'; }
338
+ .vp-doc [class~='language-yaml']:before { content: 'yaml'; }
339
+ .vp-doc [class~='language-yml']:before { content: 'yaml'; }
340
+ .vp-doc [class~='language-sh']:before { content: 'sh'; }
341
+ .vp-doc [class~='language-bash']:before { content: 'sh'; }
342
+
343
+ /**
344
+ * Code: Highlight
345
+ *
346
+ * prism.js tomorrow night eighties theme.
347
+ * https://github.com/chriskempson/tomorrow-theme
348
+ *
349
+ * @author Rose Pritchard
350
+ * -------------------------------------------------------------------------- */
351
+
352
+ .token.comment,
353
+ .token.block-comment,
354
+ .token.prolog,
355
+ .token.doctype,
356
+ .token.cdata {
357
+ color: #999;
358
+ }
359
+
360
+ .token.punctuation {
361
+ color: #ccc;
362
+ }
363
+
364
+ .token.tag,
365
+ .token.attr-name,
366
+ .token.namespace,
367
+ .token.deleted {
368
+ color: #e2777a;
369
+ }
370
+
371
+ .token.function-name {
372
+ color: #6196cc;
373
+ }
374
+
375
+ .token.boolean,
376
+ .token.number,
377
+ .token.function {
378
+ color: #f08d49;
379
+ }
380
+
381
+ .token.property,
382
+ .token.class-name,
383
+ .token.constant,
384
+ .token.symbol {
385
+ color: #f8c555;
386
+ }
387
+
388
+ .token.selector,
389
+ .token.important,
390
+ .token.atrule,
391
+ .token.keyword,
392
+ .token.builtin {
393
+ color: #cc99cd;
394
+ }
395
+
396
+ .token.string,
397
+ .token.char,
398
+ .token.attr-value,
399
+ .token.regex,
400
+ .token.variable {
401
+ color: #7ec699;
402
+ }
403
+
404
+ .token.operator,
405
+ .token.entity,
406
+ .token.url {
407
+ color: #67cdcc;
408
+ }
409
+
410
+ .token.important,
411
+ .token.bold {
412
+ font-weight: bold;
413
+ }
414
+
415
+ .token.italic {
416
+ font-style: italic;
417
+ }
418
+
419
+ .token.entity {
420
+ cursor: help;
421
+ }
422
+
423
+ .token.inserted {
424
+ color: green;
425
+ }
@@ -0,0 +1,86 @@
1
+ .vp-sponsor-grid {
2
+ display: flex;
3
+ flex-wrap: wrap;
4
+ gap: 4px;
5
+ }
6
+
7
+ .vp-sponsor-grid.small .vp-sponsor-grid-link { height: 96px; }
8
+ .vp-sponsor-grid.small .vp-sponsor-grid-image { max-width: 96px; max-height: 24px }
9
+
10
+ .vp-sponsor-grid.medium .vp-sponsor-grid-link { height: 112px; }
11
+ .vp-sponsor-grid.medium .vp-sponsor-grid-image { max-width: 120px; max-height: 36px }
12
+
13
+ .vp-sponsor-grid.big .vp-sponsor-grid-link { height: 184px; }
14
+ .vp-sponsor-grid.big .vp-sponsor-grid-image { max-width: 192px; max-height: 56px }
15
+
16
+ .vp-sponsor-grid[data-vp-grid="2"] .vp-sponsor-grid-item {
17
+ width: calc((100% - 4px) / 2);
18
+ }
19
+
20
+ .vp-sponsor-grid[data-vp-grid="3"] .vp-sponsor-grid-item {
21
+ width: calc((100% - 4px * 2) / 3);
22
+ }
23
+
24
+ .vp-sponsor-grid[data-vp-grid="4"] .vp-sponsor-grid-item {
25
+ width: calc((100% - 4px * 3) / 4);
26
+ }
27
+
28
+ .vp-sponsor-grid[data-vp-grid="5"] .vp-sponsor-grid-item {
29
+ width: calc((100% - 4px * 4) / 5);
30
+ }
31
+
32
+ .vp-sponsor-grid[data-vp-grid="6"] .vp-sponsor-grid-item {
33
+ width: calc((100% - 4px * 5) / 6);
34
+ }
35
+
36
+ .vp-sponsor-grid-item {
37
+ flex-shrink: 0;
38
+ width: 100%;
39
+ background-color: var(--vp-c-white-soft);
40
+ transition: background-color 0.25s;
41
+ }
42
+
43
+ .vp-sponsor-grid-item:hover {
44
+ background-color: var(--vp-c-white-mute);
45
+ }
46
+
47
+ .vp-sponsor-grid-item:hover .vp-sponsor-grid-image {
48
+ filter: grayscale(0) invert(0);
49
+ }
50
+
51
+ .vp-sponsor-grid-item.empty:hover {
52
+ background-color: var(--vp-c-white-soft);
53
+ }
54
+
55
+ .dark .vp-sponsor-grid-item {
56
+ background-color: var(--vp-c-black-mute);
57
+ }
58
+
59
+ .dark .vp-sponsor-grid-item:hover {
60
+ background-color: var(--vp-c-white-soft);
61
+ }
62
+
63
+ .dark .vp-sponsor-grid-item.empty:hover {
64
+ background-color: var(--vp-c-black-mute);
65
+ }
66
+
67
+ .vp-sponsor-grid-link {
68
+ display: flex;
69
+ }
70
+
71
+ .vp-sponsor-grid-box {
72
+ display: flex;
73
+ justify-content: center;
74
+ align-items: center;
75
+ width: 100%;
76
+ }
77
+
78
+ .vp-sponsor-grid-image {
79
+ max-width: 100%;
80
+ filter: grayscale(1);
81
+ transition: filter 0.25s;
82
+ }
83
+
84
+ .dark .vp-sponsor-grid-image {
85
+ filter: grayscale(1) invert(1);
86
+ }
@@ -0,0 +1,29 @@
1
+ import { ensureStartingSlash } from './utils';
2
+ /**
3
+ * Get the `Sidebar` from sidebar option. This method will ensure to get correct
4
+ * sidebar config from `MultiSideBarConfig` with various path combinations such
5
+ * as matching `guide/` and `/guide/`. If no matching config was found, it will
6
+ * return empty array.
7
+ */
8
+ export function getSidebar(sidebar, path) {
9
+ if (Array.isArray(sidebar)) {
10
+ return sidebar;
11
+ }
12
+ path = ensureStartingSlash(path);
13
+ for (const dir in sidebar) {
14
+ // make sure the multi sidebar key starts with slash too
15
+ if (path.startsWith(ensureStartingSlash(dir))) {
16
+ return sidebar[dir];
17
+ }
18
+ }
19
+ return [];
20
+ }
21
+ export function getFlatSideBarLinks(sidebar) {
22
+ const links = [];
23
+ for (const group of sidebar) {
24
+ for (const link of group.items) {
25
+ links.push(link);
26
+ }
27
+ }
28
+ return links;
29
+ }
@@ -0,0 +1,62 @@
1
+ import { ref } from 'vue';
2
+ import { withBase } from 'vitepress';
3
+ export const HASH_RE = /#.*$/;
4
+ export const EXT_RE = /(index)?\.(md|html)$/;
5
+ export const OUTBOUND_RE = /^[a-z]+:/i;
6
+ const inBrowser = typeof window !== 'undefined';
7
+ const hashRef = ref(inBrowser ? location.hash : '');
8
+ export function isExternal(path) {
9
+ return OUTBOUND_RE.test(path);
10
+ }
11
+ export function throttleAndDebounce(fn, delay) {
12
+ let timeout;
13
+ let called = false;
14
+ return () => {
15
+ if (timeout) {
16
+ clearTimeout(timeout);
17
+ }
18
+ if (!called) {
19
+ fn();
20
+ called = true;
21
+ setTimeout(() => {
22
+ called = false;
23
+ }, delay);
24
+ }
25
+ else {
26
+ timeout = setTimeout(fn, delay);
27
+ }
28
+ };
29
+ }
30
+ export function isActive(currentPath, matchPath, asRegex = false) {
31
+ if (matchPath === undefined) {
32
+ return false;
33
+ }
34
+ currentPath = normalize(`/${currentPath}`);
35
+ if (asRegex) {
36
+ return new RegExp(matchPath).test(currentPath);
37
+ }
38
+ if (normalize(matchPath) !== currentPath) {
39
+ return false;
40
+ }
41
+ const hashMatch = matchPath.match(HASH_RE);
42
+ if (hashMatch) {
43
+ return hashRef.value === hashMatch[0];
44
+ }
45
+ return true;
46
+ }
47
+ export function ensureStartingSlash(path) {
48
+ return /^\//.test(path) ? path : `/${path}`;
49
+ }
50
+ export function normalize(path) {
51
+ return decodeURI(path).replace(HASH_RE, '').replace(EXT_RE, '');
52
+ }
53
+ export function normalizeLink(url) {
54
+ if (isExternal(url)) {
55
+ return url;
56
+ }
57
+ const { pathname, search, hash } = new URL(url, 'http://example.com');
58
+ const normalizedPath = pathname.endsWith('/') || pathname.endsWith('.html')
59
+ ? url
60
+ : `${pathname.replace(/(\.md)?$/, '.html')}${search}${hash}`;
61
+ return withBase(normalizedPath);
62
+ }
package/dist/node/cli.js CHANGED
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var serve = require('./serve-3035f99b.js');
3
+ var serve = require('./serve-b5dc02b2.js');
4
4
  require('fs');
5
5
  require('path');
6
6
  require('url');
@@ -94,7 +94,7 @@ var minimist = function (args, opts) {
94
94
  var o = obj;
95
95
  for (var i = 0; i < keys.length-1; i++) {
96
96
  var key = keys[i];
97
- if (isConstructorOrProto(o, key)) return;
97
+ if (key === '__proto__') return;
98
98
  if (o[key] === undefined) o[key] = {};
99
99
  if (o[key] === Object.prototype || o[key] === Number.prototype
100
100
  || o[key] === String.prototype) o[key] = {};
@@ -103,7 +103,7 @@ var minimist = function (args, opts) {
103
103
  }
104
104
 
105
105
  var key = keys[keys.length - 1];
106
- if (isConstructorOrProto(o, key)) return;
106
+ if (key === '__proto__') return;
107
107
  if (o === Object.prototype || o === Number.prototype
108
108
  || o === String.prototype) o = {};
109
109
  if (o === Array.prototype) o = [];
@@ -267,11 +267,6 @@ function isNumber (x) {
267
267
  return /^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(x);
268
268
  }
269
269
 
270
-
271
- function isConstructorOrProto (obj, key) {
272
- return key === 'constructor' && typeof obj[key] === 'function' || key === '__proto__';
273
- }
274
-
275
270
  const argv = minimist(process.argv.slice(2));
276
271
  console.log(serve.source.cyan(`vitepress v${require("../../package.json").version}`));
277
272
  const command = argv._[0];