vitepress 0.22.3 → 1.0.0-draft.2

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 (208) 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 +5 -7
  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 +97 -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/composables/sponsor.js +87 -0
  93. package/dist/client/theme-default/fonts/inter-cyrillic-ext.woff2 +0 -0
  94. package/dist/client/theme-default/fonts/inter-cyrillic.woff2 +0 -0
  95. package/dist/client/theme-default/fonts/inter-greek-ext.woff2 +0 -0
  96. package/dist/client/theme-default/fonts/inter-greek.woff2 +0 -0
  97. package/dist/client/theme-default/fonts/inter-latin-ext.woff2 +0 -0
  98. package/dist/client/theme-default/fonts/inter-latin.woff2 +0 -0
  99. package/dist/client/theme-default/fonts/inter-vietnamese.woff2 +0 -0
  100. package/dist/client/theme-default/index.js +8 -4
  101. package/dist/client/theme-default/styles/base.css +203 -0
  102. package/dist/client/theme-default/styles/fonts.css +67 -0
  103. package/dist/client/theme-default/styles/utils.css +9 -0
  104. package/dist/client/theme-default/styles/vars.css +291 -66
  105. package/dist/client/theme-default/styles/vp-doc.css +425 -0
  106. package/dist/client/theme-default/styles/vp-sponsor.css +86 -0
  107. package/dist/client/theme-default/support/sidebar.js +29 -0
  108. package/dist/client/theme-default/support/utils.js +62 -0
  109. package/dist/node/alias.js +60 -0
  110. package/dist/node/alias.js.map +1 -0
  111. package/dist/node/build/build.js +57 -0
  112. package/dist/node/build/build.js.map +1 -0
  113. package/dist/node/build/buildMPAClient.js +44 -0
  114. package/dist/node/build/buildMPAClient.js.map +1 -0
  115. package/dist/node/build/bundle.js +163 -0
  116. package/dist/node/build/bundle.js.map +1 -0
  117. package/dist/node/build/render.js +185 -0
  118. package/dist/node/build/render.js.map +1 -0
  119. package/dist/node/cli.js +37 -294
  120. package/dist/node/cli.js.map +1 -0
  121. package/dist/node/config.js +176 -0
  122. package/dist/node/config.js.map +1 -0
  123. package/dist/node/index.d.ts +122 -79
  124. package/dist/node/index.js +22 -37
  125. package/dist/node/index.js.map +1 -0
  126. package/dist/node/markdown/markdown.js +75 -0
  127. package/dist/node/markdown/markdown.js.map +1 -0
  128. package/dist/node/markdown/plugins/component.js +86 -0
  129. package/dist/node/markdown/plugins/component.js.map +1 -0
  130. package/dist/node/markdown/plugins/containers.js +41 -0
  131. package/dist/node/markdown/plugins/containers.js.map +1 -0
  132. package/dist/node/markdown/plugins/headings.js +25 -0
  133. package/dist/node/markdown/plugins/headings.js.map +1 -0
  134. package/dist/node/markdown/plugins/highlight.js +53 -0
  135. package/dist/node/markdown/plugins/highlight.js.map +1 -0
  136. package/dist/node/markdown/plugins/highlightLines.js +48 -0
  137. package/dist/node/markdown/plugins/highlightLines.js.map +1 -0
  138. package/dist/node/markdown/plugins/hoist.js +22 -0
  139. package/dist/node/markdown/plugins/hoist.js.map +1 -0
  140. package/dist/node/markdown/plugins/image.js +17 -0
  141. package/dist/node/markdown/plugins/image.js.map +1 -0
  142. package/dist/node/markdown/plugins/lineNumbers.js +23 -0
  143. package/dist/node/markdown/plugins/lineNumbers.js.map +1 -0
  144. package/dist/node/markdown/plugins/link.js +85 -0
  145. package/dist/node/markdown/plugins/link.js.map +1 -0
  146. package/dist/node/markdown/plugins/preWrapper.js +22 -0
  147. package/dist/node/markdown/plugins/preWrapper.js.map +1 -0
  148. package/dist/node/markdown/plugins/slugify.js +26 -0
  149. package/dist/node/markdown/plugins/slugify.js.map +1 -0
  150. package/dist/node/markdown/plugins/snippet.js +146 -0
  151. package/dist/node/markdown/plugins/snippet.js.map +1 -0
  152. package/dist/node/markdownToVue.js +166 -0
  153. package/dist/node/markdownToVue.js.map +1 -0
  154. package/dist/node/plugin.js +227 -0
  155. package/dist/node/plugin.js.map +1 -0
  156. package/dist/node/serve/serve.js +59 -0
  157. package/dist/node/serve/serve.js.map +1 -0
  158. package/dist/node/{serve-777539c0.js → serve-b5dc02b2.js} +27 -2
  159. package/dist/node/server.js +18 -0
  160. package/dist/node/server.js.map +1 -0
  161. package/dist/node/shared.js +72 -0
  162. package/dist/node/shared.js.map +1 -0
  163. package/dist/node/staticDataPlugin.js +99 -0
  164. package/dist/node/staticDataPlugin.js.map +1 -0
  165. package/dist/node/utils/getGitTimestamp.js +17 -0
  166. package/dist/node/utils/getGitTimestamp.js.map +1 -0
  167. package/dist/node/utils/parseHeader.js +57 -0
  168. package/dist/node/utils/parseHeader.js.map +1 -0
  169. package/dist/node/utils/slash.js +8 -0
  170. package/dist/node/utils/slash.js.map +1 -0
  171. package/package.json +31 -25
  172. package/types/default-theme.d.ts +115 -78
  173. package/types/shared.d.ts +11 -6
  174. package/dist/client/theme-default/components/AlgoliaSearchBox.vue +0 -188
  175. package/dist/client/theme-default/components/BuySellAds.vue +0 -152
  176. package/dist/client/theme-default/components/CarbonAds.vue +0 -99
  177. package/dist/client/theme-default/components/EditLink.vue +0 -38
  178. package/dist/client/theme-default/components/Home.vue +0 -31
  179. package/dist/client/theme-default/components/HomeFeatures.vue +0 -143
  180. package/dist/client/theme-default/components/HomeFooter.vue +0 -50
  181. package/dist/client/theme-default/components/HomeHero.vue +0 -161
  182. package/dist/client/theme-default/components/LastUpdated.vue +0 -60
  183. package/dist/client/theme-default/components/NavBar.vue +0 -60
  184. package/dist/client/theme-default/components/NavBarTitle.vue +0 -41
  185. package/dist/client/theme-default/components/NavDropdownLink.vue +0 -135
  186. package/dist/client/theme-default/components/NavDropdownLinkItem.vue +0 -76
  187. package/dist/client/theme-default/components/NavLink.vue +0 -61
  188. package/dist/client/theme-default/components/NavLinks.vue +0 -52
  189. package/dist/client/theme-default/components/NextAndPrevLinks.vue +0 -88
  190. package/dist/client/theme-default/components/Page.vue +0 -53
  191. package/dist/client/theme-default/components/PageFooter.vue +0 -44
  192. package/dist/client/theme-default/components/SideBar.vue +0 -60
  193. package/dist/client/theme-default/components/SideBarLink.js +0 -68
  194. package/dist/client/theme-default/components/SideBarLinks.vue +0 -12
  195. package/dist/client/theme-default/components/ToggleSideBarButton.vue +0 -46
  196. package/dist/client/theme-default/components/icons/OutboundLink.vue +0 -31
  197. package/dist/client/theme-default/composables/activeSidebarLink.js +0 -99
  198. package/dist/client/theme-default/composables/editLink.js +0 -49
  199. package/dist/client/theme-default/composables/navLink.js +0 -42
  200. package/dist/client/theme-default/composables/nextAndPrevLinks.js +0 -37
  201. package/dist/client/theme-default/composables/repo.js +0 -38
  202. package/dist/client/theme-default/composables/sideBar.js +0 -57
  203. package/dist/client/theme-default/styles/code.css +0 -299
  204. package/dist/client/theme-default/styles/custom-blocks.css +0 -76
  205. package/dist/client/theme-default/styles/layout.css +0 -236
  206. package/dist/client/theme-default/styles/sidebar-links.css +0 -107
  207. package/dist/client/theme-default/support/sideBar.js +0 -46
  208. package/dist/client/theme-default/utils.js +0 -63
@@ -0,0 +1,118 @@
1
+ <script lang="ts" setup>
2
+ import { ref, watchPostEffect, nextTick } from 'vue'
3
+ import { useSidebar } from '../composables/sidebar'
4
+ import VPSidebarGroup from './VPSidebarGroup.vue'
5
+
6
+ const { sidebar, hasSidebar } = useSidebar()
7
+
8
+ const props = defineProps<{
9
+ open: boolean
10
+ }>()
11
+
12
+ // a11y: focus Nav element when menu has opened
13
+ let navEl = ref<(Element & { focus(): void }) | null>(null)
14
+
15
+ watchPostEffect(async () => {
16
+ if (props.open) {
17
+ await nextTick()
18
+ navEl.value?.focus()
19
+ }
20
+ })
21
+ </script>
22
+
23
+ <template>
24
+ <aside
25
+ v-if="hasSidebar"
26
+ class="VPSidebar"
27
+ :class="{ open }"
28
+ ref="navEl"
29
+ @click.stop
30
+ >
31
+ <nav class="nav" id="VPSidebarNav" aria-labelledby="sidebar-aria-label" tabindex="-1">
32
+ <span class="visually-hidden" id="sidebar-aria-label">
33
+ Sidebar Navigation
34
+ </span>
35
+
36
+ <div v-for="group in sidebar" :key="group.text" class="group">
37
+ <VPSidebarGroup :text="group.text" :items="group.items" />
38
+ </div>
39
+ </nav>
40
+ </aside>
41
+ </template>
42
+
43
+ <style scoped>
44
+ .VPSidebar {
45
+ position: fixed;
46
+ top: 0;
47
+ bottom: 0;
48
+ left: 0;
49
+ z-index: var(--vp-z-index-sidebar);
50
+ padding: 32px 32px 96px;
51
+ width: calc(100vw - 64px);
52
+ max-width: 320px;
53
+ background-color: var(--vp-c-bg);
54
+ opacity: 0;
55
+ box-shadow: var(--vp-c-shadow-3);
56
+ overflow-x: hidden;
57
+ overflow-y: auto;
58
+ transform: translateX(-100%);
59
+ transition: background-color 0.5s, opacity 0.5s, transform 0.25s ease;
60
+ }
61
+
62
+ .VPSidebar.open {
63
+ opacity: 1;
64
+ visibility: visible;
65
+ transform: translateX(0);
66
+ transition: background-color 0.5s,
67
+ opacity 0.25s,
68
+ transform 0.5s cubic-bezier(0.19, 1, 0.22, 1);
69
+ }
70
+
71
+ .dark .VPSidebar {
72
+ box-shadow: var(--vp-shadow-1);
73
+ }
74
+
75
+ @media (min-width: 960px) {
76
+ .VPSidebar {
77
+ z-index: 1;
78
+ padding-top: var(--vp-nav-height-desktop);
79
+ padding-bottom: 128px;
80
+ width: var(--vp-sidebar-width);
81
+ max-width: 100%;
82
+ width: var(--vp-sidebar-width);
83
+ background-color: var(--vp-c-bg-sidebar);
84
+ opacity: 1;
85
+ visibility: visible;
86
+ box-shadow: none;
87
+ transform: translateX(0);
88
+ transition: border-color 0.5s, background-color 0.5s;
89
+ }
90
+ }
91
+
92
+ @media (min-width: 1440px) {
93
+ .VPSidebar {
94
+ padding-left: calc((100% - var(--vp-layout-max-width)) / 2);
95
+ width: calc((100% - var(--vp-layout-max-width)) / 2 + var(--vp-sidebar-width) - 32px);
96
+ }
97
+ }
98
+
99
+ .nav {
100
+ outline: 0;
101
+ }
102
+
103
+ .group + .group {
104
+ margin-top: 32px;
105
+ border-top: 1px solid var(--vp-c-divider-light);
106
+ padding-top: 8px;
107
+ }
108
+
109
+ @media (min-width: 960px) {
110
+ .group {
111
+ padding-top: 8px;
112
+ }
113
+
114
+ .group + .group {
115
+ margin-top: 24px;
116
+ }
117
+ }
118
+ </style>
@@ -0,0 +1,44 @@
1
+ <script lang="ts" setup>
2
+ import { useData } from 'vitepress'
3
+ import { DefaultTheme } from '../config'
4
+ import VPSidebarLink from './VPSidebarLink.vue'
5
+
6
+ const props = defineProps<{
7
+ text: string
8
+ items: DefaultTheme.SidebarItem[]
9
+ }>()
10
+
11
+ const { page } = useData()
12
+ </script>
13
+
14
+ <template>
15
+ <section class="VPSidebarGroup">
16
+ <div class="title">
17
+ <h2 class="title-text">{{ text }}</h2>
18
+ </div>
19
+
20
+ <template v-for="item in items" :key="item.link">
21
+ <VPSidebarLink :item="item" />
22
+ </template>
23
+ </section>
24
+ </template>
25
+
26
+ <style scoped>
27
+ .title {
28
+ padding: 6px 0;
29
+ }
30
+
31
+ @media (min-width: 960px) {
32
+ .title {
33
+ padding: 4px 0;
34
+ }
35
+ }
36
+
37
+ .title-text {
38
+ line-height: 20px;
39
+ font-size: 13px;
40
+ font-weight: 600;
41
+ color: var(--vp-c-text-1);
42
+ transition: color 0.5s;
43
+ }
44
+ </style>
@@ -0,0 +1,57 @@
1
+ <script lang="ts" setup>
2
+ import { inject } from 'vue'
3
+ import { useData } from 'vitepress'
4
+ import { DefaultTheme } from '../config'
5
+ import { isActive, normalizeLink } from '../support/utils'
6
+
7
+ defineProps<{
8
+ item: DefaultTheme.SidebarItem
9
+ }>()
10
+
11
+ const { page } = useData()
12
+
13
+ const closeSideBar = inject('close-sidebar') as () => void
14
+ </script>
15
+
16
+ <template>
17
+ <a
18
+ class="link"
19
+ :class="{ active: isActive(page.relativePath, item.link) }"
20
+ :href="normalizeLink(item.link)"
21
+ @click="closeSideBar"
22
+ >
23
+ <p class="link-text">{{ item.text }}</p>
24
+ </a>
25
+ </template>
26
+
27
+ <style scoped>
28
+ .link {
29
+ display: block;
30
+ padding: 6px 0;
31
+ }
32
+
33
+ .link:hover .link-text {
34
+ color: var(--vp-c-brand);
35
+ transition: color 0.25s;
36
+ }
37
+
38
+ .link.active .link-text {
39
+ font-weight: 600;
40
+ color: var(--vp-c-brand);
41
+ transition: color 0.25s;
42
+ }
43
+
44
+ @media (min-width: 960px) {
45
+ .link {
46
+ padding: 4px 0;
47
+ }
48
+ }
49
+
50
+ .link-text {
51
+ line-height: 20px;
52
+ font-size: 13px;
53
+ font-weight: 500;
54
+ color: var(--vp-c-text-2);
55
+ transition: color 0.5s;
56
+ }
57
+ </style>
@@ -0,0 +1,72 @@
1
+ <script lang="ts" setup>
2
+ import { ref, watch } from 'vue'
3
+ import { useRoute } from 'vitepress'
4
+
5
+ const route = useRoute()
6
+ const backToTop = ref()
7
+
8
+ watch(() => route.path, () => backToTop.value.focus())
9
+
10
+ function focusOnTargetAnchor({ target }: Event) {
11
+ const el = document.querySelector(
12
+ (target as HTMLAnchorElement).hash!
13
+ ) as HTMLAnchorElement
14
+
15
+ if (el) {
16
+ const removeTabIndex = () => {
17
+ el.removeAttribute('tabindex')
18
+ el.removeEventListener('blur', removeTabIndex)
19
+ }
20
+
21
+ el.setAttribute('tabindex', '-1')
22
+ el.addEventListener('blur', removeTabIndex)
23
+ el.focus()
24
+ window.scrollTo(0, 0)
25
+ }
26
+ }
27
+ </script>
28
+
29
+ <template>
30
+ <span ref="backToTop" tabindex="-1" />
31
+ <a
32
+ href="#VPContent"
33
+ class="VPSkipLink visually-hidden"
34
+ @click="focusOnTargetAnchor"
35
+ >
36
+ Skip to content
37
+ </a>
38
+ </template>
39
+
40
+ <style scoped>
41
+ .VPSkipLink {
42
+ top: 8px;
43
+ left: 8px;
44
+ padding: 8px 16px;
45
+ z-index: 999;
46
+ border-radius: 8px;
47
+ font-size: 12px;
48
+ font-weight: bold;
49
+ text-decoration: none;
50
+ color: var(--vp-c-brand);
51
+ box-shadow: var(--vp-shadow-3);
52
+ background-color: var(--vp-c-bg);
53
+ }
54
+
55
+ .VPSkipLink:focus {
56
+ height: auto;
57
+ width: auto;
58
+ clip: auto;
59
+ clip-path: none;
60
+ }
61
+
62
+ .dark .VPSkipLink {
63
+ color: var(--vp-c-green);
64
+ }
65
+
66
+ @media (min-width: 1280px) {
67
+ .VPSkipLink {
68
+ top: 14px;
69
+ left: 16px;
70
+ }
71
+ }
72
+ </style>
@@ -0,0 +1,63 @@
1
+ <script lang="ts" setup>
2
+ import { DefaultTheme } from 'vitepress'
3
+ import VPIconDiscord from './icons/VPIconDiscord.vue'
4
+ import VPIconFacebook from './icons/VPIconFacebook.vue'
5
+ import VPIconGitHub from './icons/VPIconGitHub.vue'
6
+ import VPIconLinkedIn from './icons/VPIconLinkedIn.vue'
7
+ import VPIconInstagram from './icons/VPIconInstagram.vue'
8
+ import VPIconSlack from './icons/VPIconSlack.vue'
9
+ import VPIconTwitter from './icons/VPIconTwitter.vue'
10
+ import VPIconYouTube from './icons/VPIconYouTube.vue'
11
+
12
+ const props = defineProps<{
13
+ icon: DefaultTheme.SocialLinkIcon
14
+ link: string
15
+ }>()
16
+
17
+ const icons = {
18
+ discord: VPIconDiscord,
19
+ facebook: VPIconFacebook,
20
+ github: VPIconGitHub,
21
+ instagram: VPIconInstagram,
22
+ linkedin: VPIconLinkedIn,
23
+ slack: VPIconSlack,
24
+ twitter: VPIconTwitter,
25
+ youtube: VPIconYouTube
26
+ }
27
+ </script>
28
+
29
+ <template>
30
+ <a
31
+ class="VPSocialLink"
32
+ :href="link"
33
+ :title="icon"
34
+ target="_blank"
35
+ rel="noopener noreferrer"
36
+ >
37
+ <component :is="icons[icon]" class="icon" />
38
+ <span class="visually-hidden">{{ icon }}</span>
39
+ </a>
40
+ </template>
41
+
42
+ <style scoped>
43
+ .VPSocialLink {
44
+ display: flex;
45
+ justify-content: center;
46
+ align-items: center;
47
+ width: 36px;
48
+ height: 36px;
49
+ color: var(--vp-c-text-2);
50
+ transition: color .5s;
51
+ }
52
+
53
+ .VPSocialLink:hover {
54
+ color: var(--vp-c-text-1);
55
+ transition: color .25s;
56
+ }
57
+
58
+ .icon {
59
+ width: 20px;
60
+ height: 20px;
61
+ fill: currentColor;
62
+ }
63
+ </style>
@@ -0,0 +1,27 @@
1
+ <script lang="ts" setup>
2
+ import { DefaultTheme } from 'vitepress'
3
+ import VPSocialLink from './VPSocialLink.vue'
4
+
5
+ defineProps<{
6
+ links: DefaultTheme.SocialLink[]
7
+ }>()
8
+ </script>
9
+
10
+ <template>
11
+ <div class="VPSocialLinks">
12
+ <VPSocialLink
13
+ v-for="{ link, icon } in links"
14
+ :key="link"
15
+ :icon="icon"
16
+ :link="link"
17
+ />
18
+ </div>
19
+ </template>
20
+
21
+ <style scoped>
22
+ .VPSocialLinks {
23
+ display: flex;
24
+ flex-wrap: wrap;
25
+ justify-content: center;
26
+ }
27
+ </style>
@@ -0,0 +1,77 @@
1
+ <script setup lang="ts">
2
+ import { computed } from 'vue'
3
+ import VPSponsorsGrid from './VPSponsorsGrid.vue'
4
+
5
+ interface Sponsors {
6
+ tier?: string
7
+ size?: 'small' | 'medium' | 'big'
8
+ items: Sponsor[]
9
+ }
10
+
11
+ interface Sponsor {
12
+ name: string
13
+ img: string
14
+ url: string
15
+ }
16
+
17
+ const props = defineProps<{
18
+ tier?: string
19
+ size?: 'small' | 'medium' | 'big'
20
+ data: Sposors[] | Sponsor[]
21
+ }>()
22
+
23
+ const sponsors = computed(() => {
24
+ const isSponsors = props.data.some((s: any) => s.items)
25
+
26
+ if (isSponsors) {
27
+ return props.data
28
+ }
29
+
30
+ return [{
31
+ tier: props.tier,
32
+ size: props.size,
33
+ items: props.data
34
+ }]
35
+ })
36
+ </script>
37
+
38
+ <template>
39
+ <div class="VPSponsors">
40
+ <section v-for="(sponsor, index) in sponsors" :key="index" class="section">
41
+ <h3 v-if="sponsor.tier" class="tier">{{ sponsor.tier }}</h3>
42
+ <VPSponsorsGrid :size="sponsor.size" :data="sponsor.items" />
43
+ </section>
44
+ </div>
45
+ </template>
46
+
47
+ <style scoped>
48
+ .VPSponsors {
49
+ border-radius: 16px;
50
+ overflow: hidden;
51
+ }
52
+
53
+ .section + .section {
54
+ margin-top: 4px;
55
+ }
56
+
57
+ .tier {
58
+ margin-bottom: 4px;
59
+ padding: 13px 0 11px;
60
+ text-align: center;
61
+ letter-spacing: 1px;
62
+ line-height: 24px;
63
+ width: 100%;
64
+ font-size: 14px;
65
+ font-weight: 600;
66
+ color: var(--vp-c-text-2);
67
+ background-color: var(--vp-c-white-soft);
68
+ }
69
+
70
+ .dark .tier {
71
+ background-color: var(--vp-c-black-mute);
72
+ }
73
+
74
+ .VPSponsorsGrid + .tier {
75
+ margin-top: 4px;
76
+ }
77
+ </style>
@@ -0,0 +1,32 @@
1
+ <script setup lang="ts">
2
+ import { ref } from 'vue'
3
+ import { useSponsorsGrid } from '../composables/sponsor-grid'
4
+
5
+ interface Sponsor {
6
+ name: string
7
+ img: string
8
+ url: string
9
+ }
10
+
11
+ const props = defineProps<{
12
+ size?: 'small' | 'medium' | 'big'
13
+ data: Sponsor[]
14
+ }>()
15
+
16
+ const el = ref(null)
17
+
18
+ useSponsorsGrid({ el, size: props.size })
19
+ </script>
20
+
21
+ <template>
22
+ <div class="VPSponsorsGrid vp-sponsor-grid" :class="[props.size ?? 'medium']" ref="el">
23
+ <div v-for="sponsor in data" :key="sponsor.tier" class="vp-sponsor-grid-item">
24
+ <a class="vp-sponsor-grid-link" :href="sponsor.url" target="_blank" rel="sponsored noopener">
25
+ <article class="vp-sponsor-grid-box">
26
+ <h4 class="visually-hidden">{{ sponsor.name }}</h4>
27
+ <img class="vp-sponsor-grid-image" :src="sponsor.img" :alt="sponsor.name" />
28
+ </article>
29
+ </a>
30
+ </div>
31
+ </div>
32
+ </template>
@@ -0,0 +1,66 @@
1
+ <template>
2
+ <button class="VPSwitch" type="button" role="switch">
3
+ <span class="check">
4
+ <span class="icon" v-if="$slots.default">
5
+ <slot />
6
+ </span>
7
+ </span>
8
+ </button>
9
+ </template>
10
+
11
+ <style scoped>
12
+ .VPSwitch {
13
+ position: relative;
14
+ border-radius: 11px;
15
+ display: block;
16
+ width: 40px;
17
+ height: 22px;
18
+ flex-shrink: 0;
19
+ border: 1px solid var(--vp-c-divider);
20
+ background-color: var(--vp-c-bg-mute);
21
+ transition: border-color 0.25s, background-color 0.25s;
22
+ }
23
+
24
+ .VPSwitch:hover {
25
+ border-color: var(--vp-c-gray);
26
+ }
27
+
28
+ .check {
29
+ position: absolute;
30
+ top: 1px;
31
+ left: 1px;
32
+ width: 18px;
33
+ height: 18px;
34
+ border-radius: 50%;
35
+ background-color: var(--vp-c-white);
36
+ box-shadow: var(--vp-shadow-1);
37
+ transition: background-color 0.25s, transform 0.25s;
38
+ }
39
+
40
+ .dark .check {
41
+ background-color: var(--vp-c-black);
42
+ }
43
+
44
+ .icon {
45
+ position: relative;
46
+ display: block;
47
+ width: 18px;
48
+ height: 18px;
49
+ border-radius: 50%;
50
+ overflow: hidden;
51
+ }
52
+
53
+ .icon :deep(svg) {
54
+ position: absolute;
55
+ top: 3px;
56
+ left: 3px;
57
+ width: 12px;
58
+ height: 12px;
59
+ fill: var(--vp-c-text-2);
60
+ }
61
+
62
+ .dark .icon :deep(svg) {
63
+ fill: var(--vp-c-text-1);
64
+ transition: opacity 0.25s;
65
+ }
66
+ </style>
@@ -0,0 +1,74 @@
1
+ <script lang="ts" setup>
2
+ import { APPEARANCE_KEY } from '../../shared'
3
+ import VPSwitch from './VPSwitch.vue'
4
+ import VPIconSun from './icons/VPIconSun.vue'
5
+ import VPIconMoon from './icons/VPIconMoon.vue'
6
+
7
+ const toggle = typeof localStorage !== 'undefined' ? useAppearance() : () => {}
8
+
9
+ function useAppearance() {
10
+ const query = window.matchMedia('(prefers-color-scheme: dark)')
11
+ const classList = document.documentElement.classList
12
+
13
+ let userPreference = localStorage.getItem(APPEARANCE_KEY) || 'auto'
14
+
15
+ let isDark = userPreference === 'auto'
16
+ ? query.matches
17
+ : userPreference === 'dark'
18
+
19
+ query.onchange = (e) => {
20
+ if (userPreference === 'auto') {
21
+ setClass((isDark = e.matches))
22
+ }
23
+ }
24
+
25
+ function toggle() {
26
+ setClass((isDark = !isDark))
27
+
28
+ userPreference = isDark
29
+ ? query.matches ? 'auto' : 'dark'
30
+ : query.matches ? 'light' : 'auto'
31
+
32
+ localStorage.setItem(APPEARANCE_KEY, userPreference)
33
+ }
34
+
35
+ function setClass(dark: boolean): void {
36
+ classList[dark ? 'add' : 'remove']('dark')
37
+ }
38
+
39
+ return toggle
40
+ }
41
+ </script>
42
+
43
+ <template>
44
+ <VPSwitch
45
+ class="VPSwitchAppearance"
46
+ aria-label="toggle dark mode"
47
+ @click="toggle"
48
+ >
49
+ <VPIconSun class="sun" />
50
+ <VPIconMoon class="moon" />
51
+ </VPSwitch>
52
+ </template>
53
+
54
+ <style scoped>
55
+ .sun {
56
+ opacity: 1;
57
+ }
58
+
59
+ .moon {
60
+ opacity: 0;
61
+ }
62
+
63
+ .dark .sun {
64
+ opacity: 0;
65
+ }
66
+
67
+ .dark .moon {
68
+ opacity: 1;
69
+ }
70
+
71
+ .dark .VPSwitchAppearance :deep(.check) {
72
+ transform: translateX(18px);
73
+ }
74
+ </style>
@@ -0,0 +1,8 @@
1
+ <template>
2
+ <svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" viewBox="0 0 24 24">
3
+ <path d="M21,11H3c-0.6,0-1-0.4-1-1s0.4-1,1-1h18c0.6,0,1,0.4,1,1S21.6,11,21,11z" />
4
+ <path d="M21,7H3C2.4,7,2,6.6,2,6s0.4-1,1-1h18c0.6,0,1,0.4,1,1S21.6,7,21,7z" />
5
+ <path d="M21,15H3c-0.6,0-1-0.4-1-1s0.4-1,1-1h18c0.6,0,1,0.4,1,1S21.6,15,21,15z" />
6
+ <path d="M21,19H3c-0.6,0-1-0.4-1-1s0.4-1,1-1h18c0.6,0,1,0.4,1,1S21.6,19,21,19z" />
7
+ </svg>
8
+ </template>
@@ -0,0 +1,8 @@
1
+ <template>
2
+ <svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" viewBox="0 0 24 24">
3
+ <path d="M17,11H3c-0.6,0-1-0.4-1-1s0.4-1,1-1h14c0.6,0,1,0.4,1,1S17.6,11,17,11z" />
4
+ <path d="M21,7H3C2.4,7,2,6.6,2,6s0.4-1,1-1h18c0.6,0,1,0.4,1,1S21.6,7,21,7z" />
5
+ <path d="M21,15H3c-0.6,0-1-0.4-1-1s0.4-1,1-1h18c0.6,0,1,0.4,1,1S21.6,15,21,15z" />
6
+ <path d="M17,19H3c-0.6,0-1-0.4-1-1s0.4-1,1-1h14c0.6,0,1,0.4,1,1S17.6,19,17,19z" />
7
+ </svg>
8
+ </template>
@@ -0,0 +1,8 @@
1
+ <template>
2
+ <svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" viewBox="0 0 24 24">
3
+ <path d="M21,11H7c-0.6,0-1-0.4-1-1s0.4-1,1-1h14c0.6,0,1,0.4,1,1S21.6,11,21,11z" />
4
+ <path d="M21,7H3C2.4,7,2,6.6,2,6s0.4-1,1-1h18c0.6,0,1,0.4,1,1S21.6,7,21,7z" />
5
+ <path d="M21,15H3c-0.6,0-1-0.4-1-1s0.4-1,1-1h18c0.6,0,1,0.4,1,1S21.6,15,21,15z" />
6
+ <path d="M21,19H7c-0.6,0-1-0.4-1-1s0.4-1,1-1h14c0.6,0,1,0.4,1,1S21.6,19,21,19z" />
7
+ </svg>
8
+ </template>
@@ -0,0 +1,5 @@
1
+ <template>
2
+ <svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" viewBox="0 0 24 24">
3
+ <path d="M12,16c-0.3,0-0.5-0.1-0.7-0.3l-6-6c-0.4-0.4-0.4-1,0-1.4s1-0.4,1.4,0l5.3,5.3l5.3-5.3c0.4-0.4,1-0.4,1.4,0s0.4,1,0,1.4l-6,6C12.5,15.9,12.3,16,12,16z" />
4
+ </svg>
5
+ </template>
@@ -0,0 +1,5 @@
1
+ <template>
2
+ <svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" viewBox="0 0 24 24">
3
+ <path d="M15,19c-0.3,0-0.5-0.1-0.7-0.3l-6-6c-0.4-0.4-0.4-1,0-1.4l6-6c0.4-0.4,1-0.4,1.4,0s0.4,1,0,1.4L10.4,12l5.3,5.3c0.4,0.4,0.4,1,0,1.4C15.5,18.9,15.3,19,15,19z" />
4
+ </svg>
5
+ </template>
@@ -0,0 +1,5 @@
1
+ <template>
2
+ <svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" viewBox="0 0 24 24">
3
+ <path d="M9,19c-0.3,0-0.5-0.1-0.7-0.3c-0.4-0.4-0.4-1,0-1.4l5.3-5.3L8.3,6.7c-0.4-0.4-0.4-1,0-1.4s1-0.4,1.4,0l6,6c0.4,0.4,0.4,1,0,1.4l-6,6C9.5,18.9,9.3,19,9,19z" />
4
+ </svg>
5
+ </template>
@@ -0,0 +1,5 @@
1
+ <template>
2
+ <svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" viewBox="0 0 24 24">
3
+ <path d="M18,16c-0.3,0-0.5-0.1-0.7-0.3L12,10.4l-5.3,5.3c-0.4,0.4-1,0.4-1.4,0s-0.4-1,0-1.4l6-6c0.4-0.4,1-0.4,1.4,0l6,6c0.4,0.4,0.4,1,0,1.4C18.5,15.9,18.3,16,18,16z" />
4
+ </svg>
5
+ </template>