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,74 @@
1
+ <script setup lang="ts">
2
+ import { useRoute, useData } from 'vitepress'
3
+ import { useSidebar } from '../composables/sidebar'
4
+ import NotFound from '../NotFound.vue'
5
+ import VPPage from './VPPage.vue'
6
+ import VPHome from './VPHome.vue'
7
+ import VPDoc from './VPDoc.vue'
8
+
9
+ const route = useRoute()
10
+ const { frontmatter } = useData()
11
+ const { hasSidebar } = useSidebar()
12
+ </script>
13
+
14
+ <template>
15
+ <div
16
+ class="VPContent"
17
+ id="VPContent"
18
+ :class="{
19
+ 'has-sidebar': hasSidebar,
20
+ 'is-home': frontmatter.layout === 'home'
21
+ }"
22
+ >
23
+ <NotFound v-if="route.component === NotFound" />
24
+
25
+ <VPPage v-else-if="frontmatter.layout === 'page'" />
26
+
27
+ <VPHome v-else-if="frontmatter.layout === 'home'">
28
+ <template #home-hero-before><slot name="home-hero-before" /></template>
29
+ <template #home-hero-after><slot name="home-hero-after" /></template>
30
+ <template #home-features-before><slot name="home-features-before" /></template>
31
+ <template #home-features-after><slot name="home-features-after" /></template>
32
+ </VPHome>
33
+
34
+ <VPDoc v-else :class="{ 'has-sidebar': hasSidebar }" />
35
+ </div>
36
+ </template>
37
+
38
+ <style scoped>
39
+ .VPContent {
40
+ flex-grow: 1;
41
+ margin: 0 auto;
42
+ max-width: var(--vp-layout-max-width);
43
+ }
44
+
45
+ .VPContent.is-home {
46
+ width: 100%;
47
+ max-width: 100%;
48
+ }
49
+
50
+ @media (max-width: 768px) {
51
+ .VPContent {
52
+ overflow-x: hidden;
53
+ }
54
+ }
55
+
56
+ @media (min-width: 960px) {
57
+ .VPContent {
58
+ padding-top: var(--vp-nav-height);
59
+ }
60
+
61
+ .VPContent.has-sidebar {
62
+ margin: 0;
63
+ padding-left: var(--vp-sidebar-width);
64
+ max-width: 100%;
65
+ }
66
+ }
67
+
68
+ @media (min-width: 1440px) {
69
+ .VPContent.has-sidebar {
70
+ padding-right: calc((100vw - var(--vp-layout-max-width)) / 2);
71
+ padding-left: calc((100vw - var(--vp-layout-max-width)) / 2 + var(--vp-sidebar-width) - 32px);
72
+ }
73
+ }
74
+ </style>
@@ -0,0 +1,173 @@
1
+ <script setup lang="ts">
2
+ import { computed } from 'vue'
3
+ import { useData } from 'vitepress'
4
+ import VPDocOutline from './VPDocOutline.vue'
5
+ import VPDocFooter from './VPDocFooter.vue'
6
+
7
+ const { page } = useData()
8
+
9
+ const pageName = computed(() => {
10
+ return page.value.relativePath.slice(0, page.value.relativePath.indexOf('/'))
11
+ })
12
+ </script>
13
+
14
+ <template>
15
+ <div class="VPDoc has-aside">
16
+ <div class="container">
17
+ <div class="aside">
18
+ <div class="aside-container">
19
+ <div class="aside-curtain" />
20
+ <div class="aside-content">
21
+ <VPDocOutline v-if="page.headers" />
22
+ </div>
23
+ </div>
24
+ </div>
25
+
26
+ <div class="content">
27
+ <main class="main">
28
+ <Content class="vp-doc" :class="pageName" />
29
+ </main>
30
+
31
+ <VPDocFooter />
32
+ </div>
33
+ </div>
34
+ </div>
35
+ </template>
36
+
37
+ <style scoped>
38
+ .VPDoc {
39
+ padding: 32px 24px 96px;
40
+ }
41
+
42
+ @media (min-width: 768px) {
43
+ .VPDoc {
44
+ padding: 48px 32px 128px;
45
+ }
46
+ }
47
+
48
+ @media (min-width: 960px) {
49
+ .VPDoc {
50
+ padding: 32px 64px 96px;
51
+ }
52
+ }
53
+
54
+ @media (min-width: 1280px) {
55
+ .VPDoc {
56
+ padding: 32px 0 128px 64px;
57
+ }
58
+
59
+ .VPDoc:not(.has-sidebar.has-aside) {
60
+ padding-left: calc((100vw - 688px) / 2);
61
+ }
62
+
63
+ .VPDoc.has-aside:not(.has-sidebar) {
64
+ padding-left: calc((100vw - 688px - 320px) / 2);
65
+ }
66
+
67
+ .VPDoc:not(.has-aside) .content {
68
+ min-width: 688px;
69
+ }
70
+ }
71
+
72
+ @media (min-width: 1440px) {
73
+ .VPDoc {
74
+ padding: 32px 0 128px 96px;
75
+ }
76
+ }
77
+
78
+ @media (min-width: 1280px) {
79
+ .container {
80
+ display: flex;
81
+ }
82
+ }
83
+
84
+ .aside {
85
+ position: relative;
86
+ display: none;
87
+ order: 2;
88
+ flex-shrink: 0;
89
+ flex-grow: 1;
90
+ padding-left: 64px;
91
+ padding-right: 32px;
92
+ min-width: 320px;
93
+ }
94
+
95
+ @media (min-width: 1280px) {
96
+ .aside {
97
+ display: block;
98
+ }
99
+ }
100
+
101
+ @media (min-width: 1440px) {
102
+ .aside {
103
+ padding-left: 96px;
104
+ }
105
+ }
106
+
107
+ .aside-container {
108
+ position: fixed;
109
+ top: var(--vp-nav-height-desktop);
110
+ bottom: 0;
111
+ padding-top: 32px;
112
+ width: 224px;
113
+ overflow-x: hidden;
114
+ overflow-y: auto;
115
+ }
116
+
117
+ .aside-container::-webkit-scrollbar {
118
+ display: none;
119
+ }
120
+
121
+ @media (min-width: 1440px) {
122
+ .aside-container {
123
+ width: 256px;
124
+ }
125
+ }
126
+
127
+ .aside-curtain {
128
+ position: fixed;
129
+ top: var(--vp-nav-height-desktop);
130
+ z-index: 10;
131
+ width: 100%;
132
+ height: 40px;
133
+ background: linear-gradient(var(--vp-c-bg-content), transparent);
134
+ }
135
+
136
+ .aside-content {
137
+ padding-bottom: 96px;
138
+ }
139
+
140
+ .content {
141
+ position: relative;
142
+ margin: 0 auto;
143
+ max-width: 688px;
144
+ }
145
+
146
+ @media (min-width: 1280px) {
147
+ .content {
148
+ order: 1;
149
+ margin: 0;
150
+ min-width: 632px;
151
+ }
152
+ }
153
+
154
+ .edit-link {
155
+ margin: 0 0 32px;
156
+ }
157
+
158
+ .edit-link .vt-link {
159
+ font-size: 14px;
160
+ color: var(--vt-c-brand);
161
+ font-weight: 500;
162
+ }
163
+
164
+ .vt-icon {
165
+ width: 18px;
166
+ height: 18px;
167
+ color: var(--vt-c-brand);
168
+ display: inline-block;
169
+ margin-right: 8px;
170
+ position: relative;
171
+ top: -1px;
172
+ }
173
+ </style>
@@ -0,0 +1,141 @@
1
+ <script setup lang="ts">
2
+ import { useData } from 'vitepress'
3
+ import { normalizeLink } from '../support/utils'
4
+ import { useEditLink } from '../composables/edit-link'
5
+ import { usePrevNext } from '../composables/prev-next'
6
+ import VPIconEdit from './icons/VPIconEdit.vue'
7
+ import VPLink from './VPLink.vue'
8
+
9
+ const { theme, frontmatter } = useData()
10
+
11
+ const editLink = useEditLink()
12
+ const control = usePrevNext()
13
+ </script>
14
+
15
+ <template>
16
+ <footer v-if="control.prev || control.next" class="VPDocFooter">
17
+ <div v-if="theme.editLink && frontmatter.editLink !== false" class="edit-link">
18
+ <VPLink class="edit-link-button" :href="editLink.url" :no-icon="true">
19
+ <VPIconEdit class="edit-link-icon" />
20
+ {{ editLink.text }}
21
+ </VPLink>
22
+ </div>
23
+
24
+ <div class="prev-next">
25
+ <div class="pager">
26
+ <a v-if="control.prev" class="pager-link prev" :href="normalizeLink(control.prev.link)">
27
+ <span class="desc">Previous page</span>
28
+ <span class="title">{{ control.prev.text }} </span>
29
+ </a>
30
+ </div>
31
+ <div class="pager" :class="{ 'has-prev': control.prev }">
32
+ <a v-if="control.next" class="pager-link next" :href="normalizeLink(control.next.link)">
33
+ <span class="desc">Next page</span>
34
+ <span class="title">{{ control.next.text }}</span>
35
+ </a>
36
+ </div>
37
+ </div>
38
+ </footer>
39
+ </template>
40
+
41
+ <style scoped>
42
+ .VPDocFooter {
43
+ margin-top: 64px;
44
+ }
45
+
46
+ .edit-link {
47
+ padding-bottom: 8px;
48
+ }
49
+
50
+ .edit-link-button {
51
+ display: flex;
52
+ align-items: center;
53
+ border: 0;
54
+ padding: 10px 0;
55
+ line-height: 20px;
56
+ font-size: 14px;
57
+ font-weight: 500;
58
+ color: var(--vp-c-brand);
59
+ transition: color 0.25s;
60
+ }
61
+
62
+ .edit-link-button:hover {
63
+ color: var(--vp-c-brand-dark);
64
+ }
65
+
66
+ .edit-link-icon {
67
+ margin-right: 8px;
68
+ width: 14px;
69
+ height: 14px;
70
+ fill: currentColor;
71
+ }
72
+
73
+ .prev-next {
74
+ border-top: 1px solid var(--vp-c-divider-light);
75
+ padding-top: 24px;
76
+ }
77
+
78
+ @media (min-width: 640px) {
79
+ .prev-next {
80
+ display: flex;
81
+ }
82
+ }
83
+
84
+ .pager.has-prev {
85
+ padding-top: 8px;
86
+ }
87
+
88
+ @media (min-width: 640px) {
89
+ .pager {
90
+ display: flex;
91
+ flex-direction: column;
92
+ flex-shrink: 0;
93
+ width: 50%;
94
+ }
95
+
96
+ .pager.has-prev {
97
+ padding-top: 0;
98
+ padding-left: 16px;
99
+ }
100
+ }
101
+
102
+ .pager-link {
103
+ display: block;
104
+ border: 1px solid var(--vp-c-divider-light);
105
+ border-radius: 8px;
106
+ padding: 11px 16px 13px;
107
+ width: 100%;
108
+ height: 100%;
109
+ transition: border-color 0.25s;
110
+ }
111
+
112
+ .pager-link:hover {
113
+ border-color: var(--vp-c-brand);
114
+ }
115
+
116
+ .pager-link:hover .title {
117
+ color: var(--vp-c-brand-dark);
118
+ }
119
+
120
+ .pager-link.next {
121
+ margin-left: auto;
122
+ text-align: right;
123
+ }
124
+
125
+ .desc {
126
+ display: block;
127
+ line-height: 20px;
128
+ font-size: 12px;
129
+ font-weight: 500;
130
+ color: var(--vp-c-text-2);
131
+ }
132
+
133
+ .title {
134
+ display: block;
135
+ line-height: 20px;
136
+ font-size: 14px;
137
+ font-weight: 500;
138
+ color: var(--vp-c-brand);
139
+ transition: color 0.25s;
140
+ }
141
+ </style>
@@ -0,0 +1,108 @@
1
+ <script setup lang="ts">
2
+ import { ref, computed } from 'vue'
3
+ import { useData } from 'vitepress'
4
+ import { resolveHeaders, useActiveAnchor } from '../composables/outline'
5
+
6
+ const { page, frontmatter } = useData()
7
+
8
+ const container = ref()
9
+ const marker = ref()
10
+
11
+ useActiveAnchor(container, marker)
12
+
13
+ const resolvedHeaders = computed(() => {
14
+ return resolveHeaders(page.value.headers)
15
+ })
16
+
17
+ function handleClick({ target: el }: Event) {
18
+ const id = '#' + (el as HTMLAnchorElement).href!.split('#')[1]
19
+ const heading = document.querySelector(id) as HTMLAnchorElement
20
+ heading?.focus()
21
+ }
22
+ </script>
23
+
24
+ <template>
25
+ <div class="VPDocOutline" ref="container">
26
+ <div class="outline-marker" ref="marker" />
27
+
28
+ <div class="outline-title">On this page</div>
29
+
30
+ <nav aria-labelledby="doc-outline-aria-label">
31
+ <span class="visually-hidden" id="doc-outline-aria-label">
32
+ Table of Contents for current page
33
+ </span>
34
+
35
+ <ul class="root">
36
+ <li
37
+ v-for="{ text, link, children, hidden } in resolvedHeaders"
38
+ v-show="!hidden"
39
+ >
40
+ <a class="outline-link" :href="link" @click="handleClick">
41
+ {{ text }}
42
+ </a>
43
+ <ul v-if="children && frontmatter.outline === 'deep'">
44
+ <li v-for="{ text, link, hidden } in children" v-show="!hidden">
45
+ <a class="outline-link nested" :href="link" @click="handleClick">
46
+ {{ text }}
47
+ </a>
48
+ </li>
49
+ </ul>
50
+ </li>
51
+ </ul>
52
+ </nav>
53
+ </div>
54
+ </template>
55
+
56
+ <style scoped>
57
+ .VPDocOutline {
58
+ position: relative;
59
+ border-left: 1px solid var(--vp-c-divider-light);
60
+ padding-left: 16px;
61
+ font-size: 13px;
62
+ font-weight: 500;
63
+ }
64
+
65
+ .outline-marker {
66
+ position: absolute;
67
+ top: 32px;
68
+ left: -1px;
69
+ z-index: 0;
70
+ opacity: 0;
71
+ width: 1px;
72
+ height: 18px;
73
+ background-color: var(--vp-c-brand);
74
+ transition: top 0.25s cubic-bezier(0, 1, 0.5, 1), background-color 0.5s, opacity 0.25s;
75
+ }
76
+
77
+ .outline-title {
78
+ letter-spacing: 0.4px;
79
+ line-height: 28px;
80
+ font-size: 13px;
81
+ font-weight: 600;
82
+ }
83
+
84
+ .outline-link {
85
+ display: block;
86
+ line-height: 28px;
87
+ color: var(--vp-c-text-2);
88
+ white-space: nowrap;
89
+ overflow: hidden;
90
+ text-overflow: ellipsis;
91
+ transition: color 0.5s;
92
+ }
93
+
94
+ .outline-link:hover,
95
+ .outline-link.active {
96
+ color: var(--vp-c-text-1);
97
+ transition: color 0.25s;
98
+ }
99
+
100
+ .outline-link.nested {
101
+ padding-left: 13px;
102
+ }
103
+
104
+ .root {
105
+ position: relative;
106
+ z-index: 1;
107
+ }
108
+ </style>
@@ -0,0 +1,149 @@
1
+ <script lang="ts" setup>
2
+ import { ref } from 'vue'
3
+ import { DefaultTheme } from 'vitepress'
4
+ import { useFlyout } from '../composables/flyout'
5
+ import VPIconChevronDown from './icons/VPIconChevronDown.vue'
6
+ import VPIconMoreHorizontal from './icons/VPIconMoreHorizontal.vue'
7
+ import VPMenu from './VPMenu.vue'
8
+
9
+ const props = defineProps<{
10
+ icon?: any
11
+ button?: string
12
+ label?: string
13
+ items?: any[]
14
+ }>()
15
+
16
+ const open = ref(false)
17
+ const el = ref<HTMLElement>()
18
+
19
+ useFlyout({ el, onBlur })
20
+
21
+ function onBlur() {
22
+ open.value = false
23
+ }
24
+ </script>
25
+
26
+ <template>
27
+ <div
28
+ class="VPFlyout"
29
+ ref="el"
30
+ @mouseenter="open = true"
31
+ @mouseleave="open = false"
32
+ >
33
+ <button
34
+ type="button"
35
+ class="button"
36
+ aria-haspopup="true"
37
+ :aria-expanded="open"
38
+ :aria-label="label"
39
+ @click="open = !open"
40
+ >
41
+ <span v-if="button || icon" class="text">
42
+ <component v-if="icon" :is="icon" class="option-icon" />
43
+ {{ button }}
44
+ <VPIconChevronDown class="text-icon" />
45
+ </span>
46
+
47
+ <VPIconMoreHorizontal v-else class="icon" />
48
+ </button>
49
+
50
+ <div class="menu">
51
+ <VPMenu :items="items">
52
+ <slot />
53
+ </VPMenu>
54
+ </div>
55
+ </div>
56
+ </template>
57
+
58
+ <style scoped>
59
+ .VPFlyout {
60
+ position: relative;
61
+ }
62
+
63
+ .VPFlyout:hover {
64
+ color: var(--vp-c-bland);
65
+ transition: color 0.25s;
66
+ }
67
+
68
+ .VPFlyout:hover .text {
69
+ color: var(--vp-c-text-2);
70
+ }
71
+
72
+ .VPFlyout:hover .icon {
73
+ fill: var(--vp-c-text-2);
74
+ }
75
+
76
+ .VPFlyout:hover .menu,
77
+ .button[aria-expanded="true"] + .menu {
78
+ opacity: 1;
79
+ visibility: visible;
80
+ transform: translateY(0);
81
+ }
82
+
83
+ .button {
84
+ display: flex;
85
+ align-items: center;
86
+ padding: 0 12px;
87
+ height: var(--vp-nav-height-mobile);
88
+ color: var(--vp-c-text-1);
89
+ transition: color 0.5s;
90
+ }
91
+
92
+ @media (min-width: 960px) {
93
+ .button {
94
+ height: var(--vp-nav-height-desktop);
95
+ }
96
+ }
97
+
98
+ .text {
99
+ display: flex;
100
+ align-items: center;
101
+ line-height: var(--vp-nav-height-mobile);
102
+ font-size: 13px;
103
+ font-weight: 500;
104
+ color: var(--vp-c-text-1);
105
+ transition: color 0.25s;
106
+ }
107
+
108
+ @media (min-width: 960px) {
109
+ .text {
110
+ line-height: var(--vp-nav-height-desktop);
111
+ }
112
+ }
113
+
114
+ .option-icon {
115
+ margin-right: 0px;
116
+ width: 16px;
117
+ height: 16px;
118
+ fill: currentColor;
119
+ }
120
+
121
+ .text-icon {
122
+ margin-left: 4px;
123
+ width: 14px;
124
+ height: 14px;
125
+ fill: currentColor;
126
+ }
127
+
128
+ .icon {
129
+ width: 20px;
130
+ height: 20px;
131
+ fill: currentColor;
132
+ transition: fill 0.25s;
133
+ }
134
+
135
+ .menu {
136
+ position: absolute;
137
+ top: calc(var(--vp-nav-height-mobile) / 2 + 20px);
138
+ right: 0;
139
+ opacity: 0;
140
+ visibility: hidden;
141
+ transition: opacity 0.25s, visibility 0.25s, transform 0.25s;
142
+ }
143
+
144
+ @media (min-width: 1280px) {
145
+ .menu {
146
+ top: calc(var(--vp-nav-height-desktop) / 2 + 20px);
147
+ }
148
+ }
149
+ </style>
@@ -0,0 +1,53 @@
1
+ <script setup lang="ts">
2
+ import { useData } from 'vitepress'
3
+ import { useSidebar } from '../composables/sidebar'
4
+
5
+ const { theme } = useData()
6
+ const { hasSidebar } = useSidebar()
7
+ </script>
8
+
9
+ <template>
10
+ <footer v-if="theme.footer" class="VPFooter" :class="{ 'has-sidebar': hasSidebar }">
11
+ <div class="container">
12
+ <p class="message">{{ theme.footer.message }}</p>
13
+ <p class="copyright">{{ theme.footer.copyright }}</p>
14
+ </div>
15
+ </footer>
16
+ </template>
17
+
18
+ <style scoped>
19
+ .VPFooter {
20
+ position: relative;
21
+ z-index: var(--vp-z-index-footer);
22
+ border-top: 1px solid var(--vp-c-divider-light);
23
+ padding: 32px 24px;
24
+ background-color: var(--vp-c-bg-content);
25
+ }
26
+
27
+ .VPFooter.has-sidebar {
28
+ display: none;
29
+ }
30
+
31
+ @media (min-width: 768px) {
32
+ .VPFooter {
33
+ padding: 32px;
34
+ }
35
+ }
36
+
37
+ .container {
38
+ margin: 0 auto;
39
+ max-width: var(--vp-layout-max-width);
40
+ text-align: center;
41
+ }
42
+
43
+ .message,
44
+ .copyright {
45
+ line-height: 24px;
46
+ font-size: 14px;
47
+ font-weight: 500;
48
+ color: var(--vp-c-text-2);
49
+ }
50
+
51
+ .message { order: 2; }
52
+ .copyright { order: 1; }
53
+ </style>